From: support Date: Thu, 2 Feb 2023 12:19:19 +0000 (+0000) Subject: Built motion from commit 896e83a8.|2.6.30 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;//%22%7B%7Blicense.mail?a=commitdiff_plain;h=d4a6ec8f31b08e5615602325f1060bce6eed413c;p=motion2.git Built motion from commit 896e83a8.|2.6.30 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 00bcf4d..4f16427 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2023-02-02T09:59:48.711Z", + "time": "2023-02-02T12:10:12.809Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 820c2fc..08ca2f8 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2023-02-02T09:59:48.711Z", + "time": "2023-02-02T12:10:12.809Z", "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 f29fc47..e165920 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 _0x6b27=['browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','TEXT','urlForward[body]','sequelize','VIRTUAL','getDataValue','action','STRING','integration','motionbar','jscripty','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'];(function(_0x572c0a,_0x55951b){var _0x12c7f7=function(_0x2582c6){while(--_0x2582c6){_0x572c0a['push'](_0x572c0a['shift']());}};_0x12c7f7(++_0x55951b);}(_0x6b27,0xc3));var _0x76b2=function(_0x89fd1e,_0x344785){_0x89fd1e=_0x89fd1e-0x0;var _0x464931=_0x6b27[_0x89fd1e];return _0x464931;};'use strict';var Sequelize=require(_0x76b2('0x0'));module['exports']={'name':{'type':Sequelize[_0x76b2('0x1')],'get':function(_0xc4d1ca){return this[_0x76b2('0x2')](_0x76b2('0x3'));}},'action':{'type':Sequelize[_0x76b2('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x76b2('0x5'),_0x76b2('0x6'),_0x76b2('0x7'),'urlForward','browser',_0x76b2('0x8'),_0x76b2('0x9')]],'msg':_0x76b2('0xa')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x76b2('0x4')](0x1000),'comment':_0x76b2('0xb')},'data2':{'type':Sequelize[_0x76b2('0x4')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x76b2('0x4')](0x1000),'comment':_0x76b2('0xc')},'data4':{'type':Sequelize[_0x76b2('0x4')](0x1000),'comments':_0x76b2('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize['STRING'],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x76b2('0xe')],'comments':_0x76b2('0xf')}}; \ No newline at end of file +var _0xe7b3=['urlForward[body]','sequelize','VIRTUAL','getDataValue','contactManager','integration','motionbar','jscripty','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT'];(function(_0x29a3a5,_0x4873c8){var _0x37fe1d=function(_0x26920b){while(--_0x26920b){_0x29a3a5['push'](_0x29a3a5['shift']());}};_0x37fe1d(++_0x4873c8);}(_0xe7b3,0xd2));var _0x3e7b=function(_0x13edd2,_0x165577){_0x13edd2=_0x13edd2-0x0;var _0x53f5eb=_0xe7b3[_0x13edd2];return _0x53f5eb;};'use strict';var Sequelize=require(_0x3e7b('0x0'));module['exports']={'name':{'type':Sequelize[_0x3e7b('0x1')],'get':function(_0x14baf0){return this[_0x3e7b('0x2')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x3e7b('0x3'),_0x3e7b('0x4'),_0x3e7b('0x5'),_0x3e7b('0x6'),'urlForward','browser',_0x3e7b('0x7'),_0x3e7b('0x8')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x3e7b('0x9')},'data1':{'type':Sequelize[_0x3e7b('0xa')](0x1000),'comment':_0x3e7b('0xb')},'data2':{'type':Sequelize[_0x3e7b('0xa')](0x1000),'comment':_0x3e7b('0xc')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x3e7b('0xd')},'data4':{'type':Sequelize[_0x3e7b('0xa')](0x1000),'comments':_0x3e7b('0xe')},'data5':{'type':Sequelize[_0x3e7b('0xa')](0x1000),'comments':_0x3e7b('0xf')},'data6':{'type':Sequelize[_0x3e7b('0xa')],'comments':_0x3e7b('0x10')},'data7':{'type':Sequelize[_0x3e7b('0x11')],'comments':_0x3e7b('0x12')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index efb9414..c6f8b6d 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 _0xb600=['offset','reject','save','update','then','error','stack','name','send','body','find','params','catch','destroy','Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','limit','count'];(function(_0x1401e1,_0xabb499){var _0x1aab56=function(_0x1071fd){while(--_0x1071fd){_0x1401e1['push'](_0x1401e1['shift']());}};_0x1aab56(++_0xabb499);}(_0xb600,0xa5));var _0x0b60=function(_0x360926,_0x15f49f){_0x360926=_0x360926-0x0;var _0x33a85a=_0xb600[_0x360926];return _0x33a85a;};'use strict';var emlformat=require(_0x0b60('0x0'));var rimraf=require(_0x0b60('0x1'));var zipdir=require(_0x0b60('0x2'));var jsonpatch=require(_0x0b60('0x3'));var rp=require(_0x0b60('0x4'));var moment=require('moment');var BPromise=require(_0x0b60('0x5'));var Mustache=require(_0x0b60('0x6'));var util=require(_0x0b60('0x7'));var path=require('path');var sox=require(_0x0b60('0x8'));var csv=require(_0x0b60('0x9'));var ejs=require(_0x0b60('0xa'));var fs=require('fs');var fs_extra=require(_0x0b60('0xb'));var _=require(_0x0b60('0xc'));var squel=require(_0x0b60('0xd'));var crypto=require(_0x0b60('0xe'));var jsforce=require(_0x0b60('0xf'));var deskjs=require(_0x0b60('0x10'));var toCsv=require('to-csv');var querystring=require(_0x0b60('0x11'));var Papa=require(_0x0b60('0x12'));var Redis=require(_0x0b60('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x0b60('0x14'));var as=require(_0x0b60('0x15'));var hardwareService=require(_0x0b60('0x16'));var logger=require(_0x0b60('0x17'))(_0x0b60('0x18'));var utils=require(_0x0b60('0x19'));var config=require(_0x0b60('0x1a'));var licenseUtil=require(_0x0b60('0x1b'));var db=require(_0x0b60('0x1c'))['db'];function respondWithStatusCode(_0x3d5408,_0x3e9008){_0x3e9008=_0x3e9008||0xcc;return function(_0x34bebe){if(_0x34bebe){return _0x3d5408[_0x0b60('0x1d')](_0x3e9008);}return _0x3d5408['status'](_0x3e9008)[_0x0b60('0x1e')]();};}function respondWithResult(_0x3ec774,_0x3c32c6){_0x3c32c6=_0x3c32c6||0xc8;return function(_0x26da59){if(_0x26da59){return _0x3ec774[_0x0b60('0x1f')](_0x3c32c6)['json'](_0x26da59);}};}function respondWithFilteredResult(_0x448473,_0x46bcdf){return function(_0x362e9c){if(_0x362e9c){var _0x4f232b=typeof _0x46bcdf['offset']===_0x0b60('0x20')&&typeof _0x46bcdf[_0x0b60('0x21')]===_0x0b60('0x20');var _0x1e5c3f=_0x362e9c[_0x0b60('0x22')];var _0x41100a=_0x4f232b?0x0:_0x46bcdf[_0x0b60('0x23')];var _0x51e3ec=_0x4f232b?_0x362e9c[_0x0b60('0x22')]:_0x46bcdf[_0x0b60('0x23')]+_0x46bcdf[_0x0b60('0x21')];var _0x10a65c;if(_0x51e3ec>=_0x1e5c3f){_0x51e3ec=_0x1e5c3f;_0x10a65c=0xc8;}else{_0x10a65c=0xce;}_0x448473[_0x0b60('0x1f')](_0x10a65c);return _0x448473['set']('Content-Range',_0x41100a+'-'+_0x51e3ec+'/'+_0x1e5c3f)['json'](_0x362e9c);}return null;};}function patchUpdates(_0x14f5cf){return function(_0x5dadca){try{jsonpatch['apply'](_0x5dadca,_0x14f5cf,!![]);}catch(_0x3efb79){return BPromise[_0x0b60('0x24')](_0x3efb79);}return _0x5dadca[_0x0b60('0x25')]();};}function saveUpdates(_0x455d5a,_0x29c6cc){return function(_0x38b12f){if(_0x38b12f){return _0x38b12f[_0x0b60('0x26')](_0x455d5a)[_0x0b60('0x27')](function(_0x187298){return _0x187298;});}return null;};}function removeEntity(_0x10242c,_0x32d4aa){return function(_0x2e0d46){if(_0x2e0d46){return _0x2e0d46['destroy']()[_0x0b60('0x27')](function(){_0x10242c[_0x0b60('0x1f')](0xcc)[_0x0b60('0x1e')]();});}};}function handleEntityNotFound(_0x4acdf8,_0x41793e){return function(_0x503613){if(!_0x503613){_0x4acdf8[_0x0b60('0x1d')](0x194);}return _0x503613;};}function handleError(_0x726330,_0x4c4215){_0x4c4215=_0x4c4215||0x1f4;return function(_0x6eb0f3){logger[_0x0b60('0x28')](_0x6eb0f3[_0x0b60('0x29')]);if(_0x6eb0f3[_0x0b60('0x2a')]){delete _0x6eb0f3[_0x0b60('0x2a')];}_0x726330['status'](_0x4c4215)[_0x0b60('0x2b')](_0x6eb0f3);};}exports['update']=function(_0x48ac4b,_0x5a9d14){if(_0x48ac4b[_0x0b60('0x2c')]['id']){delete _0x48ac4b[_0x0b60('0x2c')]['id'];}return db['Action'][_0x0b60('0x2d')]({'where':{'id':_0x48ac4b[_0x0b60('0x2e')]['id']}})['then'](handleEntityNotFound(_0x5a9d14,null))['then'](saveUpdates(_0x48ac4b[_0x0b60('0x2c')],null))[_0x0b60('0x27')](respondWithResult(_0x5a9d14,null))[_0x0b60('0x2f')](handleError(_0x5a9d14,null));};exports[_0x0b60('0x30')]=function(_0xd4b69e,_0xc871d6){return db[_0x0b60('0x31')][_0x0b60('0x2d')]({'where':{'id':_0xd4b69e[_0x0b60('0x2e')]['id']}})[_0x0b60('0x27')](handleEntityNotFound(_0xc871d6,null))['then'](removeEntity(_0xc871d6,null))[_0x0b60('0x2f')](handleError(_0xc871d6,null));}; \ No newline at end of file +var _0x2d36=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','stack','name','send','update','body','params','Action','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3d4876,_0x366386){var _0x58ca9d=function(_0x5bd045){while(--_0x5bd045){_0x3d4876['push'](_0x3d4876['shift']());}};_0x58ca9d(++_0x366386);}(_0x2d36,0x73));var _0x62d3=function(_0xeda3ff,_0x1736fe){_0xeda3ff=_0xeda3ff-0x0;var _0x4b0c13=_0x2d36[_0xeda3ff];return _0x4b0c13;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x62d3('0x0'));var zipdir=require(_0x62d3('0x1'));var jsonpatch=require(_0x62d3('0x2'));var rp=require(_0x62d3('0x3'));var moment=require(_0x62d3('0x4'));var BPromise=require(_0x62d3('0x5'));var Mustache=require(_0x62d3('0x6'));var util=require('util');var path=require('path');var sox=require(_0x62d3('0x7'));var csv=require(_0x62d3('0x8'));var ejs=require(_0x62d3('0x9'));var fs=require('fs');var fs_extra=require(_0x62d3('0xa'));var _=require(_0x62d3('0xb'));var squel=require(_0x62d3('0xc'));var crypto=require(_0x62d3('0xd'));var jsforce=require(_0x62d3('0xe'));var deskjs=require(_0x62d3('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x62d3('0x10'));var Redis=require(_0x62d3('0x11'));var authService=require(_0x62d3('0x12'));var qs=require(_0x62d3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x62d3('0x14'));var logger=require(_0x62d3('0x15'))('api');var utils=require(_0x62d3('0x16'));var config=require(_0x62d3('0x17'));var licenseUtil=require(_0x62d3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b5ca0,_0x1e2595){_0x1e2595=_0x1e2595||0xcc;return function(_0x3f3607){if(_0x3f3607){return _0x4b5ca0['sendStatus'](_0x1e2595);}return _0x4b5ca0[_0x62d3('0x19')](_0x1e2595)[_0x62d3('0x1a')]();};}function respondWithResult(_0x24e7eb,_0x28f4f6){_0x28f4f6=_0x28f4f6||0xc8;return function(_0x2caa56){if(_0x2caa56){return _0x24e7eb[_0x62d3('0x19')](_0x28f4f6)[_0x62d3('0x1b')](_0x2caa56);}};}function respondWithFilteredResult(_0x220f6e,_0x79b4ef){return function(_0x58f9e6){if(_0x58f9e6){var _0x251dba=typeof _0x79b4ef[_0x62d3('0x1c')]===_0x62d3('0x1d')&&typeof _0x79b4ef[_0x62d3('0x1e')]===_0x62d3('0x1d');var _0x2fe3ee=_0x58f9e6['count'];var _0x7225fa=_0x251dba?0x0:_0x79b4ef[_0x62d3('0x1c')];var _0xd66ea1=_0x251dba?_0x58f9e6[_0x62d3('0x1f')]:_0x79b4ef[_0x62d3('0x1c')]+_0x79b4ef[_0x62d3('0x1e')];var _0x287713;if(_0xd66ea1>=_0x2fe3ee){_0xd66ea1=_0x2fe3ee;_0x287713=0xc8;}else{_0x287713=0xce;}_0x220f6e['status'](_0x287713);return _0x220f6e['set'](_0x62d3('0x20'),_0x7225fa+'-'+_0xd66ea1+'/'+_0x2fe3ee)['json'](_0x58f9e6);}return null;};}function patchUpdates(_0x3086d4){return function(_0x57e941){try{jsonpatch[_0x62d3('0x21')](_0x57e941,_0x3086d4,!![]);}catch(_0x364f7a){return BPromise[_0x62d3('0x22')](_0x364f7a);}return _0x57e941['save']();};}function saveUpdates(_0x4ff8ac,_0x3312e5){return function(_0x878997){if(_0x878997){return _0x878997['update'](_0x4ff8ac)[_0x62d3('0x23')](function(_0x774995){return _0x774995;});}return null;};}function removeEntity(_0x227981,_0x19d629){return function(_0x50a491){if(_0x50a491){return _0x50a491[_0x62d3('0x24')]()['then'](function(){_0x227981[_0x62d3('0x19')](0xcc)[_0x62d3('0x1a')]();});}};}function handleEntityNotFound(_0x4d6aca,_0x4e7bf9){return function(_0x4f0eeb){if(!_0x4f0eeb){_0x4d6aca['sendStatus'](0x194);}return _0x4f0eeb;};}function handleError(_0x177ac4,_0x432722){_0x432722=_0x432722||0x1f4;return function(_0x2dd7aa){logger['error'](_0x2dd7aa[_0x62d3('0x25')]);if(_0x2dd7aa[_0x62d3('0x26')]){delete _0x2dd7aa[_0x62d3('0x26')];}_0x177ac4[_0x62d3('0x19')](_0x432722)[_0x62d3('0x27')](_0x2dd7aa);};}exports[_0x62d3('0x28')]=function(_0x199e44,_0x52c8da){if(_0x199e44[_0x62d3('0x29')]['id']){delete _0x199e44['body']['id'];}return db['Action']['find']({'where':{'id':_0x199e44[_0x62d3('0x2a')]['id']}})[_0x62d3('0x23')](handleEntityNotFound(_0x52c8da,null))[_0x62d3('0x23')](saveUpdates(_0x199e44[_0x62d3('0x29')],null))['then'](respondWithResult(_0x52c8da,null))['catch'](handleError(_0x52c8da,null));};exports[_0x62d3('0x24')]=function(_0x5a7668,_0x47597d){return db[_0x62d3('0x2b')][_0x62d3('0x2c')]({'where':{'id':_0x5a7668['params']['id']}})[_0x62d3('0x23')](handleEntityNotFound(_0x47597d,null))[_0x62d3('0x23')](removeEntity(_0x47597d,null))['catch'](handleError(_0x47597d,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 247dbee..c8de35f 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 _0xa723=['moment','bluebird','request-promise','path','../../config/environment','./action.attributes','Action','tools_actions','lodash','../../config/logger','api'];(function(_0x2380b2,_0x4cf1cf){var _0x495c21=function(_0x4a70b8){while(--_0x4a70b8){_0x2380b2['push'](_0x2380b2['shift']());}};_0x495c21(++_0x4cf1cf);}(_0xa723,0x110));var _0x3a72=function(_0x1306f3,_0x1da761){_0x1306f3=_0x1306f3-0x0;var _0xc1c7bf=_0xa723[_0x1306f3];return _0xc1c7bf;};'use strict';var _=require(_0x3a72('0x0'));var util=require('util');var logger=require(_0x3a72('0x1'))(_0x3a72('0x2'));var moment=require(_0x3a72('0x3'));var BPromise=require(_0x3a72('0x4'));var rp=require(_0x3a72('0x5'));var fs=require('fs');var path=require(_0x3a72('0x6'));var rimraf=require('rimraf');var config=require(_0x3a72('0x7'));var attributes=require(_0x3a72('0x8'));module['exports']=function(_0x1bc9f6,_0x5a5536){return _0x1bc9f6['define'](_0x3a72('0x9'),attributes,{'tableName':_0x3a72('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ff4=['request-promise','path','rimraf','../../config/environment','define','tools_actions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4326eb,_0x1801c5){var _0x2735a3=function(_0x4b1f8d){while(--_0x4b1f8d){_0x4326eb['push'](_0x4326eb['shift']());}};_0x2735a3(++_0x1801c5);}(_0x6ff4,0x1ce));var _0x46ff=function(_0x34ae6c,_0xbba594){_0x34ae6c=_0x34ae6c-0x0;var _0x29cc87=_0x6ff4[_0x34ae6c];return _0x29cc87;};'use strict';var _=require(_0x46ff('0x0'));var util=require(_0x46ff('0x1'));var logger=require(_0x46ff('0x2'))(_0x46ff('0x3'));var moment=require(_0x46ff('0x4'));var BPromise=require(_0x46ff('0x5'));var rp=require(_0x46ff('0x6'));var fs=require('fs');var path=require(_0x46ff('0x7'));var rimraf=require(_0x46ff('0x8'));var config=require(_0x46ff('0x9'));var attributes=require('./action.attributes');module['exports']=function(_0x2b6271,_0x1cfba1){return _0x2b6271[_0x46ff('0xa')]('Action',attributes,{'tableName':_0x46ff('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 be1384d..0ce75f2 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 _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(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x57fe81,_0x5ab32f){_0x57fe81=_0x57fe81-0x0;var _0x245330=_0x7a54[_0x57fe81];return _0x245330;};'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 +var _0x7fbe=['request','then','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x58ab46,_0x197f7f){var _0x28c5f6=function(_0x320a59){while(--_0x320a59){_0x58ab46['push'](_0x58ab46['shift']());}};_0x28c5f6(++_0x197f7f);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x456032,_0x1a799d){_0x456032=_0x456032-0x0;var _0x1a53cd=_0x7fbe[_0x456032];return _0x1a53cd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe7fb('0x0'));var BPromise=require(_0xe7fb('0x1'));var rs=require(_0xe7fb('0x2'));var fs=require('fs');var Redis=require(_0xe7fb('0x3'));var db=require(_0xe7fb('0x4'))['db'];var utils=require(_0xe7fb('0x5'));var logger=require(_0xe7fb('0x6'))(_0xe7fb('0x7'));var config=require(_0xe7fb('0x8'));var jayson=require(_0xe7fb('0x9'));var client=jayson[_0xe7fb('0xa')][_0xe7fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24cd67,_0x1f943f,_0x5ad75b){return new BPromise(function(_0x213ebc,_0x228f6b){return client[_0xe7fb('0xc')](_0x24cd67,_0x5ad75b)[_0xe7fb('0xd')](function(_0x4ba197){logger['info'](_0xe7fb('0xe'),_0x1f943f,_0xe7fb('0xf'));logger[_0xe7fb('0x10')](_0xe7fb('0x11'),_0x1f943f,_0xe7fb('0xf'),JSON[_0xe7fb('0x12')](_0x4ba197));if(_0x4ba197[_0xe7fb('0x13')]){if(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x14')]===0x1f4){logger[_0xe7fb('0x13')](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);return _0x228f6b(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x4ba197[_0xe7fb('0x13')]['message']);return _0x213ebc(_0x4ba197[_0xe7fb('0x13')][_0xe7fb('0x15')]);}else{logger['info'](_0xe7fb('0xe'),_0x1f943f,'request\x20sent');_0x213ebc(_0x4ba197[_0xe7fb('0x16')][_0xe7fb('0x15')]);}})[_0xe7fb('0x17')](function(_0x17e8a8){logger['error'](_0xe7fb('0xe'),_0x1f943f,_0x17e8a8);_0x228f6b(_0x17e8a8);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index fe99cc6..531826d 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 _0x2a63=['../../components/auth/service','./action.controller','put','isAuthenticated','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x2a3ee3,_0x45e68f){var _0x4a0b34=function(_0x368d7e){while(--_0x368d7e){_0x2a3ee3['push'](_0x2a3ee3['shift']());}};_0x4a0b34(++_0x45e68f);}(_0x2a63,0x79));var _0x32a6=function(_0x3bd4e5,_0x33854f){_0x3bd4e5=_0x3bd4e5-0x0;var _0x2d1522=_0x2a63[_0x3bd4e5];return _0x2d1522;};'use strict';var multer=require(_0x32a6('0x0'));var util=require(_0x32a6('0x1'));var path=require(_0x32a6('0x2'));var timeout=require(_0x32a6('0x3'));var express=require(_0x32a6('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x32a6('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x32a6('0x6'));router[_0x32a6('0x7')]('/:id',auth[_0x32a6('0x8')](),controller[_0x32a6('0x9')]);router[_0x32a6('0xa')](_0x32a6('0xb'),auth[_0x32a6('0x8')](),controller[_0x32a6('0xc')]);module[_0x32a6('0xd')]=router; \ No newline at end of file +var _0xf9c0=['isAuthenticated','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf9c0,0x177));var _0x0f9c=function(_0xa4aae,_0x9e1982){_0xa4aae=_0xa4aae-0x0;var _0x3b4b91=_0xf9c0[_0xa4aae];return _0x3b4b91;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0f9c('0x0'));var timeout=require('connect-timeout');var express=require(_0x0f9c('0x1'));var router=express[_0x0f9c('0x2')]();var fs_extra=require(_0x0f9c('0x3'));var auth=require(_0x0f9c('0x4'));var interaction=require(_0x0f9c('0x5'));var config=require(_0x0f9c('0x6'));var controller=require('./action.controller');router[_0x0f9c('0x7')](_0x0f9c('0x8'),auth[_0x0f9c('0x9')](),controller['update']);router['delete'](_0x0f9c('0x8'),auth[_0x0f9c('0x9')](),controller[_0x0f9c('0xa')]);module[_0x0f9c('0xb')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 20f897d..554ae89 100644 --- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js +++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda19=['exports','STRING','TEXT'];(function(_0x262d98,_0x1236e9){var _0x38c0fb=function(_0x2d9835){while(--_0x2d9835){_0x262d98['push'](_0x262d98['shift']());}};_0x38c0fb(++_0x1236e9);}(_0xda19,0xd5));var _0x9da1=function(_0x1dfc71,_0x52cbd3){_0x1dfc71=_0x1dfc71-0x0;var _0x449188=_0xda19[_0x1dfc71];return _0x449188;};'use strict';var Sequelize=require('sequelize');module[_0x9da1('0x0')]={'name':{'type':Sequelize[_0x9da1('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9da1('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x9da1('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x9957=['exports','STRING','TEXT','sequelize'];(function(_0xf24f30,_0x77205b){var _0x364bea=function(_0x562a10){while(--_0x562a10){_0xf24f30['push'](_0xf24f30['shift']());}};_0x364bea(++_0x77205b);}(_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')]={'name':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7995('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x7995('0x2')]},'conditions':{'type':Sequelize[_0x7995('0x3')]},'joins':{'type':Sequelize[_0x7995('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 10edd2d..1fee5d0 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 _0x1f80=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','show','params','length','options','find','catch','body','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','create','CustomReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','foreignKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20EMPTY','%s.%s\x20=\x20%s.%s','parse','output','web','fullPath','%s-%s.%s','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','runReport','IS\x20NULL','condition','getFields','AnalyticMetric','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','desk.js'];(function(_0x542a5d,_0x27e6c8){var _0x251378=function(_0x295247){while(--_0x295247){_0x542a5d['push'](_0x542a5d['shift']());}};_0x251378(++_0x27e6c8);}(_0x1f80,0x148));var _0x01f8=function(_0x2b92e2,_0x358e56){_0x2b92e2=_0x2b92e2-0x0;var _0x2b88a9=_0x1f80[_0x2b92e2];return _0x2b88a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x01f8('0x0'));var zipdir=require(_0x01f8('0x1'));var jsonpatch=require(_0x01f8('0x2'));var rp=require(_0x01f8('0x3'));var moment=require(_0x01f8('0x4'));var BPromise=require(_0x01f8('0x5'));var Mustache=require(_0x01f8('0x6'));var util=require(_0x01f8('0x7'));var path=require(_0x01f8('0x8'));var sox=require(_0x01f8('0x9'));var csv=require(_0x01f8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x01f8('0xb'));var squel=require('squel');var crypto=require(_0x01f8('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x01f8('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x01f8('0xe'));var Redis=require(_0x01f8('0xf'));var authService=require(_0x01f8('0x10'));var qs=require(_0x01f8('0x11'));var as=require(_0x01f8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x01f8('0x13'))(_0x01f8('0x14'));var utils=require(_0x01f8('0x15'));var config=require(_0x01f8('0x16'));var licenseUtil=require(_0x01f8('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x01f8('0x18'))[_0x01f8('0x19')];function respondWithStatusCode(_0x1d399f,_0x52cf79){_0x52cf79=_0x52cf79||0xcc;return function(_0x275efc){if(_0x275efc){return _0x1d399f['sendStatus'](_0x52cf79);}return _0x1d399f[_0x01f8('0x1a')](_0x52cf79)[_0x01f8('0x1b')]();};}function respondWithResult(_0x409cbd,_0x448d06){_0x448d06=_0x448d06||0xc8;return function(_0x115a73){if(_0x115a73){return _0x409cbd[_0x01f8('0x1a')](_0x448d06)[_0x01f8('0x1c')](_0x115a73);}};}function respondWithFilteredResult(_0x5a3ed5,_0x48166c){return function(_0x3f46da){if(_0x3f46da){var _0x19724d=typeof _0x48166c[_0x01f8('0x1d')]===_0x01f8('0x1e')&&typeof _0x48166c[_0x01f8('0x1f')]===_0x01f8('0x1e');var _0x352854=_0x3f46da[_0x01f8('0x20')];var _0x46380c=_0x19724d?0x0:_0x48166c[_0x01f8('0x1d')];var _0x4d3b0c=_0x19724d?_0x3f46da[_0x01f8('0x20')]:_0x48166c[_0x01f8('0x1d')]+_0x48166c[_0x01f8('0x1f')];var _0x5d8a77;if(_0x4d3b0c>=_0x352854){_0x4d3b0c=_0x352854;_0x5d8a77=0xc8;}else{_0x5d8a77=0xce;}_0x5a3ed5[_0x01f8('0x1a')](_0x5d8a77);return _0x5a3ed5[_0x01f8('0x21')](_0x01f8('0x22'),_0x46380c+'-'+_0x4d3b0c+'/'+_0x352854)[_0x01f8('0x1c')](_0x3f46da);}return null;};}function patchUpdates(_0x26f3bb){return function(_0x3428f9){try{jsonpatch[_0x01f8('0x23')](_0x3428f9,_0x26f3bb,!![]);}catch(_0x26e623){return BPromise[_0x01f8('0x24')](_0x26e623);}return _0x3428f9[_0x01f8('0x25')]();};}function saveUpdates(_0x5d511d,_0x2b0755){return function(_0x5183f6){if(_0x5183f6){return _0x5183f6[_0x01f8('0x26')](_0x5d511d)[_0x01f8('0x27')](function(_0x2d4d3f){return _0x2d4d3f;});}return null;};}function removeEntity(_0x376487,_0x274158){return function(_0x3b3b32){if(_0x3b3b32){return _0x3b3b32['destroy']()[_0x01f8('0x27')](function(){var _0x33552a=_0x3b3b32[_0x01f8('0x28')]({'plain':!![]});var _0x3cd8ed='CustomReports';return db[_0x01f8('0x29')][_0x01f8('0x2a')]({'where':{'type':_0x3cd8ed,'resourceId':_0x33552a['id']}})['then'](function(){return _0x3b3b32;});})['then'](function(){_0x376487[_0x01f8('0x1a')](0xcc)[_0x01f8('0x1b')]();});}};}function handleEntityNotFound(_0xf48611,_0x309714){return function(_0xbd5d79){if(!_0xbd5d79){_0xf48611[_0x01f8('0x2b')](0x194);}return _0xbd5d79;};}function handleError(_0xbc9495,_0x2a8dce){_0x2a8dce=_0x2a8dce||0x1f4;return function(_0x22d8a5){logger['error'](_0x22d8a5[_0x01f8('0x2c')]);if(_0x22d8a5[_0x01f8('0x2d')]){delete _0x22d8a5[_0x01f8('0x2d')];}_0xbc9495[_0x01f8('0x1a')](_0x2a8dce)[_0x01f8('0x2e')](_0x22d8a5);};}exports[_0x01f8('0x2f')]=function(_0x5e05e4,_0x59eea1){var _0x26056b={},_0x324a2c={},_0x531afa={'count':0x0,'rows':[]};var _0x48dcea=_[_0x01f8('0x30')](db[_0x01f8('0x31')][_0x01f8('0x32')],function(_0x118973){return{'name':_0x118973['fieldName'],'type':_0x118973['type'][_0x01f8('0x33')]};});_0x324a2c[_0x01f8('0x34')]=_[_0x01f8('0x30')](_0x48dcea,'name');_0x324a2c[_0x01f8('0x35')]=_[_0x01f8('0x36')](_0x5e05e4[_0x01f8('0x35')]);_0x324a2c['filters']=_[_0x01f8('0x37')](_0x324a2c['model'],_0x324a2c[_0x01f8('0x35')]);_0x26056b['attributes']=_[_0x01f8('0x37')](_0x324a2c[_0x01f8('0x34')],qs[_0x01f8('0x38')](_0x5e05e4[_0x01f8('0x35')]['fields']));_0x26056b['attributes']=_0x26056b[_0x01f8('0x39')]['length']?_0x26056b[_0x01f8('0x39')]:_0x324a2c['model'];if(!_0x5e05e4[_0x01f8('0x35')][_0x01f8('0x3a')]('nolimit')){_0x26056b[_0x01f8('0x1f')]=qs[_0x01f8('0x1f')](_0x5e05e4[_0x01f8('0x35')]['limit']);_0x26056b['offset']=qs[_0x01f8('0x1d')](_0x5e05e4[_0x01f8('0x35')][_0x01f8('0x1d')]);}_0x26056b[_0x01f8('0x3b')]=qs[_0x01f8('0x3c')](_0x5e05e4['query'][_0x01f8('0x3c')]);_0x26056b[_0x01f8('0x3d')]=qs[_0x01f8('0x3e')](_[_0x01f8('0x3f')](_0x5e05e4[_0x01f8('0x35')],_0x324a2c[_0x01f8('0x3e')]),_0x48dcea);if(_0x5e05e4[_0x01f8('0x35')][_0x01f8('0x40')]){_0x26056b[_0x01f8('0x3d')]=_['merge'](_0x26056b[_0x01f8('0x3d')],{'$or':_['map'](_0x48dcea,function(_0x550280){if(_0x550280[_0x01f8('0x41')]!==_0x01f8('0x42')){var _0x472027={};_0x472027[_0x550280[_0x01f8('0x2d')]]={'$like':'%'+_0x5e05e4[_0x01f8('0x35')]['filter']+'%'};return _0x472027;}})});}_0x26056b=_[_0x01f8('0x43')]({},_0x26056b,_0x5e05e4['options']);var _0x4e0681={'where':_0x26056b[_0x01f8('0x3d')]};return db[_0x01f8('0x31')]['count'](_0x4e0681)[_0x01f8('0x27')](function(_0x4efb32){_0x531afa[_0x01f8('0x20')]=_0x4efb32;if(_0x5e05e4['query'][_0x01f8('0x44')]){_0x26056b[_0x01f8('0x45')]=[{'all':!![]}];}return db[_0x01f8('0x31')][_0x01f8('0x46')](_0x26056b);})[_0x01f8('0x27')](function(_0xa01131){_0x531afa['rows']=_0xa01131;return _0x531afa;})[_0x01f8('0x27')](respondWithFilteredResult(_0x59eea1,_0x26056b))['catch'](handleError(_0x59eea1,null));};exports[_0x01f8('0x47')]=function(_0x145335,_0x4fefdc){var _0x1fdf51={'raw':![],'where':{'id':_0x145335[_0x01f8('0x48')]['id']}},_0xbb858d={};_0xbb858d[_0x01f8('0x34')]=_[_0x01f8('0x36')](db[_0x01f8('0x31')]['rawAttributes']);_0xbb858d[_0x01f8('0x35')]=_['keys'](_0x145335[_0x01f8('0x35')]);_0xbb858d[_0x01f8('0x3e')]=_[_0x01f8('0x37')](_0xbb858d[_0x01f8('0x34')],_0xbb858d[_0x01f8('0x35')]);_0x1fdf51[_0x01f8('0x39')]=_[_0x01f8('0x37')](_0xbb858d[_0x01f8('0x34')],qs[_0x01f8('0x38')](_0x145335[_0x01f8('0x35')][_0x01f8('0x38')]));_0x1fdf51[_0x01f8('0x39')]=_0x1fdf51[_0x01f8('0x39')][_0x01f8('0x49')]?_0x1fdf51[_0x01f8('0x39')]:_0xbb858d[_0x01f8('0x34')];if(_0x145335[_0x01f8('0x35')][_0x01f8('0x44')]){_0x1fdf51[_0x01f8('0x45')]=[{'all':!![]}];}_0x1fdf51=_[_0x01f8('0x43')]({},_0x1fdf51,_0x145335[_0x01f8('0x4a')]);return db[_0x01f8('0x31')][_0x01f8('0x4b')](_0x1fdf51)['then'](handleEntityNotFound(_0x4fefdc,null))['then'](respondWithResult(_0x4fefdc,null))[_0x01f8('0x4c')](handleError(_0x4fefdc,null));};exports['create']=function(_0x16e9c3,_0x3eefda){return db[_0x01f8('0x31')]['create'](_0x16e9c3[_0x01f8('0x4d')],{})[_0x01f8('0x27')](function(_0x3625ef){var _0x1683b7=_0x16e9c3[_0x01f8('0x4e')][_0x01f8('0x28')]({'plain':!![]});if(!_0x1683b7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1683b7[_0x01f8('0x4f')]===_0x01f8('0x4e')){var _0x22224f=_0x3625ef[_0x01f8('0x28')]({'plain':!![]});var _0x45c431=_0x01f8('0x50');return db[_0x01f8('0x51')][_0x01f8('0x4b')]({'where':{'name':_0x45c431,'userProfileId':_0x1683b7[_0x01f8('0x52')]},'raw':!![]})['then'](function(_0xa15265){if(_0xa15265&&_0xa15265[_0x01f8('0x53')]===0x0){return db[_0x01f8('0x29')][_0x01f8('0x54')]({'name':_0x22224f[_0x01f8('0x2d')],'resourceId':_0x22224f['id'],'type':_0x01f8('0x55'),'sectionId':_0xa15265['id']},{})[_0x01f8('0x27')](function(){return _0x3625ef;});}else{return _0x3625ef;}})[_0x01f8('0x4c')](function(_0x4b1ce0){logger[_0x01f8('0x56')](_0x01f8('0x57'),_0x4b1ce0);throw _0x4b1ce0;});}return _0x3625ef;})[_0x01f8('0x27')](respondWithResult(_0x3eefda,0xc9))['catch'](handleError(_0x3eefda,null));};exports[_0x01f8('0x26')]=function(_0x5e328d,_0x5d8ad9){if(_0x5e328d[_0x01f8('0x4d')]['id']){delete _0x5e328d[_0x01f8('0x4d')]['id'];}return db['AnalyticCustomReport'][_0x01f8('0x4b')]({'where':{'id':_0x5e328d[_0x01f8('0x48')]['id']}})[_0x01f8('0x27')](handleEntityNotFound(_0x5d8ad9,null))[_0x01f8('0x27')](saveUpdates(_0x5e328d[_0x01f8('0x4d')],null))['then'](respondWithResult(_0x5d8ad9,null))['catch'](handleError(_0x5d8ad9,null));};exports['destroy']=function(_0x30d396,_0x548348){return db[_0x01f8('0x31')][_0x01f8('0x4b')]({'where':{'id':_0x30d396[_0x01f8('0x48')]['id']}})[_0x01f8('0x27')](handleEntityNotFound(_0x548348,null))[_0x01f8('0x27')](removeEntity(_0x548348,null))[_0x01f8('0x4c')](handleError(_0x548348,null));};exports[_0x01f8('0x58')]=function(_0x4124af,_0x8904c2){var _0x40a3b9=0xa;var _0x8d8f4f=['join','left_join','right_join','cross_join'];var _0x4cb98a={'SUM':'SUM(%s)','COUNT':_0x01f8('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x01f8('0x5a'),'MIN':_0x01f8('0x5b'),'AVG':_0x01f8('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x01f8('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x33bc22={'SEC_TO_TIME':_0x01f8('0x5e'),'DATE':_0x01f8('0x5f'),'HOUR':_0x01f8('0x60'),'ROUND':_0x01f8('0x61'),'UNIX_TIMESTAMP':_0x01f8('0x62')};var _0xc67043=function(_0x3c075f){return!_[_0x01f8('0x63')](['IS\x20NULL',_0x01f8('0x64'),'IS\x20EMPTY',_0x01f8('0x65')],_0x3c075f);};var _0x23d2ec=function(_0x503a87){if(!_0x503a87||!_0x503a87[_0x01f8('0x66')][_0x01f8('0x49')]){return'';}for(var _0x5d943c='(',_0x5b5016=0x0;_0x5b5016<_0x503a87[_0x01f8('0x66')][_0x01f8('0x49')];_0x5b5016+=0x1){_0x5b5016>0x0&&(_0x5d943c+='\x20'+_0x503a87[_0x01f8('0x67')]+'\x20');_0x5d943c+=_0x503a87['rules'][_0x5b5016][_0x01f8('0x68')]?_0x23d2ec(_0x503a87[_0x01f8('0x66')][_0x5b5016][_0x01f8('0x68')]):_0x503a87[_0x01f8('0x66')][_0x5b5016][_0x01f8('0x69')]+'\x20'+_0x503a87[_0x01f8('0x66')][_0x5b5016]['condition']+(_0xc67043(_0x503a87[_0x01f8('0x66')][_0x5b5016]['condition'])?'\x20'+_0x503a87[_0x01f8('0x66')][_0x5b5016][_0x01f8('0x6a')]:'');}return _0x5d943c+')';};var _0xab3670={'where':{'id':_0x4124af[_0x01f8('0x48')]['id']}},_0x42a289,_0x44d255,_0x1f73f9,_0x468a09,_0x6ff0ea;_0xab3670=_[_0x01f8('0x43')]({},_0xab3670,_0x4124af[_0x01f8('0x4a')]);return db[_0x01f8('0x31')][_0x01f8('0x4b')](_0xab3670)[_0x01f8('0x27')](function(_0x206e14){if(_0x206e14){_0x42a289=_0x206e14;return _0x206e14['getFields']();}return null;})[_0x01f8('0x27')](function(_0x181273){if(_0x181273){if(!_0x181273['length']){throw new db[(_0x01f8('0x6b'))][(_0x01f8('0x6c'))](_0x01f8('0x6d'),0x193);}_0x44d255=_0x181273;return db['AnalyticMetric'][_0x01f8('0x46')]({'raw':!![]});}return null;})[_0x01f8('0x27')](function(_0x435058){if(_0x435058){_0x1f73f9=_[_0x01f8('0x6e')](_0x435058,'id');var _0x4201c7;var _0x5d04ed=squel[_0x01f8('0x6f')]();_0x5d04ed[_0x01f8('0x70')](_0x42a289[_0x01f8('0x71')]);for(var _0x27823e=0x0;_0x27823e<_0x44d255[_0x01f8('0x49')];_0x27823e+=0x1){_0x4201c7=_0x44d255[_0x27823e]['MetricId']?_0x1f73f9[_0x44d255[_0x27823e][_0x01f8('0x72')]][_0x01f8('0x73')]:_0x44d255[_0x27823e][_0x01f8('0x69')];_0x4201c7=_0x44d255[_0x27823e][_0x01f8('0x74')]?_[_0x01f8('0x75')](_0x4cb98a[_0x44d255[_0x27823e][_0x01f8('0x74')]],'%s',_0x4201c7):_0x4201c7;_0x4201c7=_0x44d255[_0x27823e]['format']?_['replace'](_0x33bc22[_0x44d255[_0x27823e][_0x01f8('0x76')]],'%s',_0x4201c7):_0x4201c7;if(_0x44d255[_0x27823e][_0x01f8('0x77')]){_0x5d04ed[_0x01f8('0x68')](_0x4201c7);}_0x44d255[_0x27823e]['orderBy']&&_0x5d04ed[_0x01f8('0x3b')](_0x4201c7,_0x44d255[_0x27823e][_0x01f8('0x78')]===_0x01f8('0x79')?![]:!![]);_0x5d04ed[_0x01f8('0x69')](_0x4201c7,_0x44d255[_0x27823e][_0x01f8('0x7a')]||_0x4201c7);}if(_0x42a289[_0x01f8('0x7b')]){_0x42a289['joins']=JSON['parse'](_0x42a289['joins']);for(var _0x39bf02=0x0;_0x39bf02<_0x42a289[_0x01f8('0x7b')][_0x01f8('0x49')];_0x39bf02+=0x1){if(_0x42a289[_0x01f8('0x7b')][_0x39bf02]['type']&&_[_0x01f8('0x63')](_0x8d8f4f,_0x42a289[_0x01f8('0x7b')][_0x39bf02][_0x01f8('0x41')])&&_0x42a289[_0x01f8('0x7b')][_0x39bf02][_0x01f8('0x7c')]&&_0x42a289[_0x01f8('0x7b')][_0x39bf02][_0x01f8('0x7d')]&&_0x42a289[_0x01f8('0x7b')][_0x39bf02]['foreignKey']){_0x5d04ed[_0x42a289[_0x01f8('0x7b')][_0x39bf02]['type']](_0x42a289[_0x01f8('0x7b')][_0x39bf02][_0x01f8('0x7d')],null,util[_0x01f8('0x76')]('%s.%s\x20=\x20%s.%s',_0x42a289['table'],_0x42a289[_0x01f8('0x7b')][_0x39bf02][_0x01f8('0x7c')],_0x42a289[_0x01f8('0x7b')][_0x39bf02][_0x01f8('0x7d')],_0x42a289[_0x01f8('0x7b')][_0x39bf02][_0x01f8('0x7e')]));}}}if(_0x42a289['conditions']){_0x42a289['conditions']=JSON['parse'](_0x42a289[_0x01f8('0x7f')]);_0x5d04ed[_0x01f8('0x3d')](_0x23d2ec(_0x42a289['conditions'][_0x01f8('0x68')]));}_0x6ff0ea=_0x5d04ed[_0x01f8('0x80')]();_0x5d04ed[_0x01f8('0x1f')](_0x40a3b9);_0x5d04ed[_0x01f8('0x1d')](0x0);logger[_0x01f8('0x81')](_0x01f8('0x82'),_0x5d04ed['toString']());return dbH[_0x01f8('0x83')][_0x01f8('0x35')](_0x5d04ed[_0x01f8('0x84')](),{'type':dbH['sequelize'][_0x01f8('0x85')][_0x01f8('0x86')]});}})[_0x01f8('0x27')](respondWithResult(_0x8904c2,null))['catch'](handleError(_0x8904c2,null));};function runReport(_0x13ac9a,_0x507866,_0x2ed107){var _0x15f817=_0x507866[_0x01f8('0x2d')];var _0x1d2de2=0xa;var _0x2a5ee4=[_0x01f8('0x87'),_0x01f8('0x88'),_0x01f8('0x89'),_0x01f8('0x8a')];var _0x5c37d8={'SUM':_0x01f8('0x8b'),'COUNT':_0x01f8('0x59'),'COUNT DISTINCT':_0x01f8('0x8c'),'MAX':'MAX(%s)','MIN':_0x01f8('0x5b'),'AVG':_0x01f8('0x5c'),'GROUP_CONCAT':_0x01f8('0x8d'),'GROUP_CONCAT ASC':_0x01f8('0x5d'),'GROUP_CONCAT DESC':_0x01f8('0x8e')};var _0x3fec1c={'SEC_TO_TIME':_0x01f8('0x5e'),'DATE':_0x01f8('0x5f'),'HOUR':_0x01f8('0x60'),'ROUND':_0x01f8('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x44be26=function(_0x3f7409){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0x01f8('0x8f'),_0x01f8('0x65')],_0x3f7409);};var _0x352ab0=function(_0x123ebb){if(!_0x123ebb||!_0x123ebb[_0x01f8('0x66')][_0x01f8('0x49')]){return'';}for(var _0x46c4bf='(',_0x1c2c2d=0x0;_0x1c2c2d<_0x123ebb[_0x01f8('0x66')][_0x01f8('0x49')];_0x1c2c2d+=0x1){_0x1c2c2d>0x0&&(_0x46c4bf+='\x20'+_0x123ebb[_0x01f8('0x67')]+'\x20');_0x46c4bf+=_0x123ebb[_0x01f8('0x66')][_0x1c2c2d][_0x01f8('0x68')]?_0x352ab0(_0x123ebb['rules'][_0x1c2c2d]['group']):_0x123ebb[_0x01f8('0x66')][_0x1c2c2d]['field']+'\x20'+_0x123ebb['rules'][_0x1c2c2d]['condition']+(_0x44be26(_0x123ebb[_0x01f8('0x66')][_0x1c2c2d]['condition'])?'\x20'+_0x123ebb['rules'][_0x1c2c2d]['value']:'');}return _0x46c4bf+')';};var _0xa7f724={'where':{'id':_0x13ac9a['id']}},_0x123339,_0x20ae16,_0x242108,_0x57b0ce,_0x166cce;_0xa7f724=_['merge']({},_0xa7f724,_0x2ed107);return db['AnalyticCustomReport']['find'](_0xa7f724)[_0x01f8('0x27')](function(_0x138118){if(_0x138118){_0x123339=_0x138118;return _0x138118['getFields']();}return null;})['then'](function(_0x18a466){if(_0x18a466){if(!_0x18a466[_0x01f8('0x49')]){throw new db[(_0x01f8('0x6b'))][(_0x01f8('0x6c'))](_0x01f8('0x6d'),0x193);}_0x20ae16=_0x18a466;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x01f8('0x27')](function(_0x20b890){if(_0x20b890){_0x242108=_[_0x01f8('0x6e')](_0x20b890,'id');var _0x168bc5;var _0x414932=squel[_0x01f8('0x6f')]();_0x414932[_0x01f8('0x70')](_0x123339['table']);for(var _0x5be240=0x0;_0x5be240<_0x20ae16[_0x01f8('0x49')];_0x5be240+=0x1){_0x168bc5=_0x20ae16[_0x5be240][_0x01f8('0x72')]?_0x242108[_0x20ae16[_0x5be240][_0x01f8('0x72')]][_0x01f8('0x73')]:_0x20ae16[_0x5be240][_0x01f8('0x69')];_0x168bc5=_0x20ae16[_0x5be240][_0x01f8('0x74')]?_['replace'](_0x5c37d8[_0x20ae16[_0x5be240][_0x01f8('0x74')]],'%s',_0x168bc5):_0x168bc5;_0x168bc5=_0x20ae16[_0x5be240][_0x01f8('0x76')]?_[_0x01f8('0x75')](_0x3fec1c[_0x20ae16[_0x5be240][_0x01f8('0x76')]],'%s',_0x168bc5):_0x168bc5;if(_0x20ae16[_0x5be240]['groupBy']){_0x414932[_0x01f8('0x68')](_0x168bc5);}_0x20ae16[_0x5be240][_0x01f8('0x78')]&&_0x414932[_0x01f8('0x3b')](_0x168bc5,_0x20ae16[_0x5be240][_0x01f8('0x78')]===_0x01f8('0x79')?![]:!![]);_0x414932[_0x01f8('0x69')](_0x168bc5,_0x20ae16[_0x5be240]['alias']||_0x168bc5);}if(_0x123339[_0x01f8('0x7b')]){_0x123339['joins']=JSON['parse'](_0x123339[_0x01f8('0x7b')]);for(var _0x33c101=0x0;_0x33c101<_0x123339[_0x01f8('0x7b')]['length'];_0x33c101+=0x1){if(_0x123339[_0x01f8('0x7b')][_0x33c101]['type']&&_['includes'](_0x2a5ee4,_0x123339[_0x01f8('0x7b')][_0x33c101][_0x01f8('0x41')])&&_0x123339['joins'][_0x33c101][_0x01f8('0x7c')]&&_0x123339[_0x01f8('0x7b')][_0x33c101][_0x01f8('0x7d')]&&_0x123339[_0x01f8('0x7b')][_0x33c101][_0x01f8('0x7e')]){_0x414932[_0x123339['joins'][_0x33c101]['type']](_0x123339['joins'][_0x33c101][_0x01f8('0x7d')],null,util[_0x01f8('0x76')](_0x01f8('0x90'),_0x123339[_0x01f8('0x71')],_0x123339[_0x01f8('0x7b')][_0x33c101][_0x01f8('0x7c')],_0x123339['joins'][_0x33c101]['foreignTable'],_0x123339[_0x01f8('0x7b')][_0x33c101][_0x01f8('0x7e')]));}}}if(_0x123339['conditions']){_0x123339['conditions']=JSON[_0x01f8('0x91')](_0x123339[_0x01f8('0x7f')]);_0x414932[_0x01f8('0x3d')](_0x352ab0(_0x123339[_0x01f8('0x7f')][_0x01f8('0x68')]));}_0x166cce=_0x414932[_0x01f8('0x80')]();_0x414932[_0x01f8('0x1f')](_0x1d2de2);_0x414932[_0x01f8('0x1d')](0x0);return;}})[_0x01f8('0x27')](function(){if(_0x507866[_0x01f8('0x92')]===_0x01f8('0x93')){return null;}var _0x2d2530=_['merge'](_0x507866,{'name':_0x507866[_0x01f8('0x94')]||_0x507866[_0x01f8('0x2d')]||_0x123339[_0x01f8('0x2d')],'basename':_0x15f817,'savename':util[_0x01f8('0x76')](_0x01f8('0x95'),_0x507866['name']||_0x123339['name'],require('randomstring')[_0x01f8('0x96')](0x4),_0x507866[_0x01f8('0x92')]||_0x01f8('0x97')),'reportId':_0x123339['id'],'reportType':'custom'});return db[_0x01f8('0x98')]['create'](_0x2d2530,{'raw':!![]});})[_0x01f8('0x27')](function(_0x9f5f0a){if(_0x123339[_0x01f8('0x71')]===_0x01f8('0x99')){_0x166cce[_0x01f8('0x3d')](_0x123339[_0x01f8('0x71')]+_0x01f8('0x9a'),_0x507866['startDate'],_0x507866[_0x01f8('0x9b')]);}else{_0x166cce[_0x01f8('0x3d')](_0x123339[_0x01f8('0x71')]+_0x01f8('0x9c'),_0x507866[_0x01f8('0x9d')],_0x507866[_0x01f8('0x9b')]);}if(_0x9f5f0a){logger[_0x01f8('0x9e')](_0x01f8('0x9f'),_0x166cce[_0x01f8('0x84')]());require(_0x01f8('0xa0'))[_0x01f8('0xa1')](path['join'](__dirname,'../../components/export/',_0x9f5f0a[_0x01f8('0x92')]),[_0x9f5f0a['id'],_0x166cce[_0x01f8('0x84')](),path[_0x01f8('0x87')](__dirname,_0x01f8('0xa2'),_0x9f5f0a[_0x01f8('0xa3')]),_0x15f817]);return _0x9f5f0a;}else{var _0x1eeea0=squel[_0x01f8('0x6f')]();_0x1eeea0[_0x01f8('0x70')]('('+_0x166cce[_0x01f8('0x84')]()+')',_0x01f8('0xa4'));_0x1eeea0[_0x01f8('0x69')](_0x01f8('0xa5'),_0x01f8('0x20'));_0x166cce['limit'](_0x507866[_0x01f8('0x1f')]||_0x1d2de2);_0x166cce[_0x01f8('0x1d')](_0x507866['offset']||0x0);return dbH[_0x01f8('0x83')][_0x01f8('0x35')](_0x1eeea0['toString'](),{'type':dbH[_0x01f8('0x83')][_0x01f8('0x85')]['SELECT']})[_0x01f8('0x27')](function(_0x345417){if(!_0x345417[_0x01f8('0x49')]){_0x57b0ce=0x0;}else{_0x57b0ce=_0x345417[0x0][_0x01f8('0x20')]||0x0;}return dbH['sequelize'][_0x01f8('0x35')](_0x166cce[_0x01f8('0x84')](),{'type':dbH[_0x01f8('0x83')][_0x01f8('0x85')][_0x01f8('0x86')]});})[_0x01f8('0x27')](function(_0x43eb31){return{'rows':_0x43eb31||[],'count':_0x57b0ce};});}});}exports['run']=function(_0x14e0b7,_0x4a31a7){return runReport(_0x14e0b7[_0x01f8('0x48')],_0x14e0b7[_0x01f8('0x35')],_0x14e0b7[_0x01f8('0x4a')])['then'](respondWithResult(_0x4a31a7,null))[_0x01f8('0x4c')](handleError(_0x4a31a7,null));};exports[_0x01f8('0xa6')]=runReport;exports[_0x01f8('0x35')]=function(_0x2af8b8,_0x54004c){var _0x19033d=0xa;var _0x3f062e=[_0x01f8('0x87'),_0x01f8('0x88'),_0x01f8('0x89'),_0x01f8('0x8a')];var _0x48bf68={'SUM':_0x01f8('0x8b'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x01f8('0x8c'),'MAX':_0x01f8('0x5a'),'MIN':_0x01f8('0x5b'),'AVG':_0x01f8('0x5c'),'GROUP_CONCAT':_0x01f8('0x8d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x01f8('0x8e')};var _0x4ddc14={'SEC_TO_TIME':_0x01f8('0x5e'),'DATE':_0x01f8('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x01f8('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x186cd0=function(_0x27fc5d){return!_[_0x01f8('0x63')]([_0x01f8('0xa7'),_0x01f8('0x64'),_0x01f8('0x8f'),_0x01f8('0x65')],_0x27fc5d);};var _0x5f4748=function(_0x4b5fa6){if(!_0x4b5fa6||!_0x4b5fa6[_0x01f8('0x66')][_0x01f8('0x49')]){return'';}for(var _0x1f79ce='(',_0x6e257=0x0;_0x6e257<_0x4b5fa6['rules']['length'];_0x6e257+=0x1){_0x6e257>0x0&&(_0x1f79ce+='\x20'+_0x4b5fa6[_0x01f8('0x67')]+'\x20');_0x1f79ce+=_0x4b5fa6[_0x01f8('0x66')][_0x6e257][_0x01f8('0x68')]?_0x5f4748(_0x4b5fa6[_0x01f8('0x66')][_0x6e257]['group']):_0x4b5fa6['rules'][_0x6e257][_0x01f8('0x69')]+'\x20'+_0x4b5fa6['rules'][_0x6e257]['condition']+(_0x186cd0(_0x4b5fa6[_0x01f8('0x66')][_0x6e257][_0x01f8('0xa8')])?'\x20'+_0x4b5fa6[_0x01f8('0x66')][_0x6e257][_0x01f8('0x6a')]:'');}return _0x1f79ce+')';};var _0x4be8b8={'where':{'id':_0x2af8b8[_0x01f8('0x48')]['id']}},_0xa5b068,_0x941b9f,_0x456eaa,_0x3668e8,_0x1f5319;_0x4be8b8=_[_0x01f8('0x43')]({},_0x4be8b8,_0x2af8b8[_0x01f8('0x4a')]);return db[_0x01f8('0x31')]['find'](_0x4be8b8)[_0x01f8('0x27')](function(_0x14d3d8){if(_0x14d3d8){_0xa5b068=_0x14d3d8;return _0x14d3d8[_0x01f8('0xa9')]();}return null;})[_0x01f8('0x27')](function(_0x4003b0){if(_0x4003b0){if(!_0x4003b0[_0x01f8('0x49')]){throw new db[(_0x01f8('0x6b'))][(_0x01f8('0x6c'))](_0x01f8('0x6d'),0x193);}_0x941b9f=_0x4003b0;return db[_0x01f8('0xaa')][_0x01f8('0x46')]({'raw':!![]});}return null;})['then'](function(_0x3758ad){if(_0x3758ad){_0x456eaa=_['keyBy'](_0x3758ad,'id');var _0x3fa75c;var _0xbaa87e=squel['select']();_0xbaa87e[_0x01f8('0x70')](_0xa5b068[_0x01f8('0x71')]);for(var _0x38ce79=0x0;_0x38ce79<_0x941b9f['length'];_0x38ce79+=0x1){_0x3fa75c=_0x941b9f[_0x38ce79][_0x01f8('0x72')]?_0x456eaa[_0x941b9f[_0x38ce79][_0x01f8('0x72')]][_0x01f8('0x73')]:_0x941b9f[_0x38ce79][_0x01f8('0x69')];_0x3fa75c=_0x941b9f[_0x38ce79][_0x01f8('0x74')]?_[_0x01f8('0x75')](_0x48bf68[_0x941b9f[_0x38ce79][_0x01f8('0x74')]],'%s',_0x3fa75c):_0x3fa75c;_0x3fa75c=_0x941b9f[_0x38ce79][_0x01f8('0x76')]?_[_0x01f8('0x75')](_0x4ddc14[_0x941b9f[_0x38ce79]['format']],'%s',_0x3fa75c):_0x3fa75c;if(_0x941b9f[_0x38ce79][_0x01f8('0x77')]){_0xbaa87e[_0x01f8('0x68')](_0x3fa75c);}_0x941b9f[_0x38ce79][_0x01f8('0x78')]&&_0xbaa87e[_0x01f8('0x3b')](_0x3fa75c,_0x941b9f[_0x38ce79][_0x01f8('0x78')]===_0x01f8('0x79')?![]:!![]);_0xbaa87e[_0x01f8('0x69')](_0x3fa75c,_0x941b9f[_0x38ce79]['alias']||_0x3fa75c);}if(_0xa5b068[_0x01f8('0x7b')]){_0xa5b068[_0x01f8('0x7b')]=JSON[_0x01f8('0x91')](_0xa5b068[_0x01f8('0x7b')]);for(var _0x3cb003=0x0;_0x3cb003<_0xa5b068[_0x01f8('0x7b')][_0x01f8('0x49')];_0x3cb003+=0x1){if(_0xa5b068[_0x01f8('0x7b')][_0x3cb003][_0x01f8('0x41')]&&_[_0x01f8('0x63')](_0x3f062e,_0xa5b068[_0x01f8('0x7b')][_0x3cb003][_0x01f8('0x41')])&&_0xa5b068[_0x01f8('0x7b')][_0x3cb003][_0x01f8('0x7c')]&&_0xa5b068[_0x01f8('0x7b')][_0x3cb003]['foreignTable']&&_0xa5b068['joins'][_0x3cb003][_0x01f8('0x7e')]){_0xbaa87e[_0xa5b068['joins'][_0x3cb003][_0x01f8('0x41')]](_0xa5b068[_0x01f8('0x7b')][_0x3cb003][_0x01f8('0x7d')],null,util[_0x01f8('0x76')]('%s.%s\x20=\x20%s.%s',_0xa5b068[_0x01f8('0x71')],_0xa5b068['joins'][_0x3cb003]['parentKey'],_0xa5b068[_0x01f8('0x7b')][_0x3cb003][_0x01f8('0x7d')],_0xa5b068[_0x01f8('0x7b')][_0x3cb003][_0x01f8('0x7e')]));}}}if(_0xa5b068[_0x01f8('0x7f')]){_0xa5b068[_0x01f8('0x7f')]=JSON[_0x01f8('0x91')](_0xa5b068[_0x01f8('0x7f')]);_0xbaa87e['where'](_0x5f4748(_0xa5b068[_0x01f8('0x7f')]['group']));}_0x1f5319=_0xbaa87e[_0x01f8('0x80')]();_0xbaa87e[_0x01f8('0x1f')](_0x19033d);_0xbaa87e[_0x01f8('0x1d')](0x0);logger[_0x01f8('0x81')](_0x01f8('0x82'),_0xbaa87e[_0x01f8('0x84')]());return dbH[_0x01f8('0x83')][_0x01f8('0x35')](_0xbaa87e[_0x01f8('0x84')](),{'type':dbH[_0x01f8('0x83')]['QueryTypes']['SELECT']});}})[_0x01f8('0x27')](function(){return{'sql':_0x1f5319['toString']()};})[_0x01f8('0x27')](respondWithResult(_0x54004c,null))[_0x01f8('0x4c')](handleError(_0x54004c,null));}; \ No newline at end of file +var _0xc9d8=['end','status','offset','undefined','limit','count','set','Content-Range','json','save','destroy','then','CustomReports','UserProfileResource','error','name','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','left_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','metric','replace','function','format','groupBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','right_join','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','Sequelize','keyBy','orderBy','order','output','web','fullPath','%s-%s.%s','randomstring','csv','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','from','countTable','COUNT(*)','run','COUNT(DISTINCT\x20%s)','IS\x20EMPTY','ValidationErrorItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0xc9d8,0x138));var _0x8c9d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc9d8[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x8c9d('0x0'));var rimraf=require(_0x8c9d('0x1'));var zipdir=require(_0x8c9d('0x2'));var jsonpatch=require(_0x8c9d('0x3'));var rp=require(_0x8c9d('0x4'));var moment=require(_0x8c9d('0x5'));var BPromise=require(_0x8c9d('0x6'));var Mustache=require(_0x8c9d('0x7'));var util=require(_0x8c9d('0x8'));var path=require('path');var sox=require(_0x8c9d('0x9'));var csv=require(_0x8c9d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8c9d('0xb'));var _=require(_0x8c9d('0xc'));var squel=require(_0x8c9d('0xd'));var crypto=require(_0x8c9d('0xe'));var jsforce=require(_0x8c9d('0xf'));var deskjs=require(_0x8c9d('0x10'));var toCsv=require(_0x8c9d('0xa'));var querystring=require(_0x8c9d('0x11'));var Papa=require(_0x8c9d('0x12'));var Redis=require(_0x8c9d('0x13'));var authService=require(_0x8c9d('0x14'));var qs=require(_0x8c9d('0x15'));var as=require(_0x8c9d('0x16'));var hardwareService=require(_0x8c9d('0x17'));var logger=require(_0x8c9d('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x8c9d('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x8c9d('0x1a'))['db'];var dbH=require(_0x8c9d('0x1a'))['dbH'];function respondWithStatusCode(_0x443a3b,_0x5c56f3){_0x5c56f3=_0x5c56f3||0xcc;return function(_0x40355a){if(_0x40355a){return _0x443a3b[_0x8c9d('0x1b')](_0x5c56f3);}return _0x443a3b['status'](_0x5c56f3)[_0x8c9d('0x1c')]();};}function respondWithResult(_0x1004e1,_0x4fb794){_0x4fb794=_0x4fb794||0xc8;return function(_0x1022b6){if(_0x1022b6){return _0x1004e1[_0x8c9d('0x1d')](_0x4fb794)['json'](_0x1022b6);}};}function respondWithFilteredResult(_0x3a6092,_0x1227c3){return function(_0x38fa03){if(_0x38fa03){var _0x90974a=typeof _0x1227c3[_0x8c9d('0x1e')]===_0x8c9d('0x1f')&&typeof _0x1227c3[_0x8c9d('0x20')]===_0x8c9d('0x1f');var _0x3a65c5=_0x38fa03[_0x8c9d('0x21')];var _0xf4439=_0x90974a?0x0:_0x1227c3[_0x8c9d('0x1e')];var _0x3ded4a=_0x90974a?_0x38fa03[_0x8c9d('0x21')]:_0x1227c3['offset']+_0x1227c3[_0x8c9d('0x20')];var _0x3b1f3f;if(_0x3ded4a>=_0x3a65c5){_0x3ded4a=_0x3a65c5;_0x3b1f3f=0xc8;}else{_0x3b1f3f=0xce;}_0x3a6092['status'](_0x3b1f3f);return _0x3a6092[_0x8c9d('0x22')](_0x8c9d('0x23'),_0xf4439+'-'+_0x3ded4a+'/'+_0x3a65c5)[_0x8c9d('0x24')](_0x38fa03);}return null;};}function patchUpdates(_0x56e8cb){return function(_0x2538bb){try{jsonpatch['apply'](_0x2538bb,_0x56e8cb,!![]);}catch(_0x50c57c){return BPromise['reject'](_0x50c57c);}return _0x2538bb[_0x8c9d('0x25')]();};}function saveUpdates(_0x2c06ce,_0x18e2b6){return function(_0x4fefcf){if(_0x4fefcf){return _0x4fefcf['update'](_0x2c06ce)['then'](function(_0x1cd59e){return _0x1cd59e;});}return null;};}function removeEntity(_0x2e407,_0x24b1fb){return function(_0x1d2a96){if(_0x1d2a96){return _0x1d2a96[_0x8c9d('0x26')]()[_0x8c9d('0x27')](function(){var _0x20be5a=_0x1d2a96['get']({'plain':!![]});var _0x5812a3=_0x8c9d('0x28');return db[_0x8c9d('0x29')][_0x8c9d('0x26')]({'where':{'type':_0x5812a3,'resourceId':_0x20be5a['id']}})[_0x8c9d('0x27')](function(){return _0x1d2a96;});})[_0x8c9d('0x27')](function(){_0x2e407[_0x8c9d('0x1d')](0xcc)[_0x8c9d('0x1c')]();});}};}function handleEntityNotFound(_0x282555,_0xcfe4d9){return function(_0x2afaf7){if(!_0x2afaf7){_0x282555[_0x8c9d('0x1b')](0x194);}return _0x2afaf7;};}function handleError(_0x431ece,_0x40bf56){_0x40bf56=_0x40bf56||0x1f4;return function(_0x243e2a){logger[_0x8c9d('0x2a')](_0x243e2a['stack']);if(_0x243e2a[_0x8c9d('0x2b')]){delete _0x243e2a['name'];}_0x431ece[_0x8c9d('0x1d')](_0x40bf56)['send'](_0x243e2a);};}exports['index']=function(_0x5f2eb8,_0x47ef32){var _0x1fc196={},_0x389a95={},_0x41eb8b={'count':0x0,'rows':[]};var _0x11a8dc=_[_0x8c9d('0x2c')](db[_0x8c9d('0x2d')][_0x8c9d('0x2e')],function(_0x25ed04){return{'name':_0x25ed04[_0x8c9d('0x2f')],'type':_0x25ed04[_0x8c9d('0x30')][_0x8c9d('0x31')]};});_0x389a95['model']=_[_0x8c9d('0x2c')](_0x11a8dc,_0x8c9d('0x2b'));_0x389a95[_0x8c9d('0x32')]=_[_0x8c9d('0x33')](_0x5f2eb8[_0x8c9d('0x32')]);_0x389a95[_0x8c9d('0x34')]=_[_0x8c9d('0x35')](_0x389a95[_0x8c9d('0x36')],_0x389a95[_0x8c9d('0x32')]);_0x1fc196[_0x8c9d('0x37')]=_[_0x8c9d('0x35')](_0x389a95[_0x8c9d('0x36')],qs[_0x8c9d('0x38')](_0x5f2eb8['query']['fields']));_0x1fc196['attributes']=_0x1fc196[_0x8c9d('0x37')][_0x8c9d('0x39')]?_0x1fc196[_0x8c9d('0x37')]:_0x389a95[_0x8c9d('0x36')];if(!_0x5f2eb8['query'][_0x8c9d('0x3a')](_0x8c9d('0x3b'))){_0x1fc196[_0x8c9d('0x20')]=qs[_0x8c9d('0x20')](_0x5f2eb8[_0x8c9d('0x32')]['limit']);_0x1fc196[_0x8c9d('0x1e')]=qs[_0x8c9d('0x1e')](_0x5f2eb8[_0x8c9d('0x32')][_0x8c9d('0x1e')]);}_0x1fc196['order']=qs[_0x8c9d('0x3c')](_0x5f2eb8[_0x8c9d('0x32')][_0x8c9d('0x3c')]);_0x1fc196[_0x8c9d('0x3d')]=qs[_0x8c9d('0x34')](_[_0x8c9d('0x3e')](_0x5f2eb8['query'],_0x389a95['filters']),_0x11a8dc);if(_0x5f2eb8[_0x8c9d('0x32')]['filter']){_0x1fc196[_0x8c9d('0x3d')]=_[_0x8c9d('0x3f')](_0x1fc196['where'],{'$or':_[_0x8c9d('0x2c')](_0x11a8dc,function(_0x27b4aa){if(_0x27b4aa[_0x8c9d('0x30')]!=='VIRTUAL'){var _0xd5862c={};_0xd5862c[_0x27b4aa[_0x8c9d('0x2b')]]={'$like':'%'+_0x5f2eb8[_0x8c9d('0x32')][_0x8c9d('0x40')]+'%'};return _0xd5862c;}})});}_0x1fc196=_[_0x8c9d('0x3f')]({},_0x1fc196,_0x5f2eb8[_0x8c9d('0x41')]);var _0x36de0f={'where':_0x1fc196['where']};return db['AnalyticCustomReport']['count'](_0x36de0f)[_0x8c9d('0x27')](function(_0x7bd851){_0x41eb8b['count']=_0x7bd851;if(_0x5f2eb8[_0x8c9d('0x32')][_0x8c9d('0x42')]){_0x1fc196[_0x8c9d('0x43')]=[{'all':!![]}];}return db[_0x8c9d('0x2d')][_0x8c9d('0x44')](_0x1fc196);})['then'](function(_0x1639e7){_0x41eb8b[_0x8c9d('0x45')]=_0x1639e7;return _0x41eb8b;})[_0x8c9d('0x27')](respondWithFilteredResult(_0x47ef32,_0x1fc196))['catch'](handleError(_0x47ef32,null));};exports[_0x8c9d('0x46')]=function(_0x1eebf4,_0x490f58){var _0x50dba7={'raw':![],'where':{'id':_0x1eebf4[_0x8c9d('0x47')]['id']}},_0x3ef263={};_0x3ef263[_0x8c9d('0x36')]=_['keys'](db[_0x8c9d('0x2d')]['rawAttributes']);_0x3ef263['query']=_[_0x8c9d('0x33')](_0x1eebf4[_0x8c9d('0x32')]);_0x3ef263[_0x8c9d('0x34')]=_[_0x8c9d('0x35')](_0x3ef263[_0x8c9d('0x36')],_0x3ef263['query']);_0x50dba7['attributes']=_['intersection'](_0x3ef263[_0x8c9d('0x36')],qs[_0x8c9d('0x38')](_0x1eebf4[_0x8c9d('0x32')][_0x8c9d('0x38')]));_0x50dba7[_0x8c9d('0x37')]=_0x50dba7[_0x8c9d('0x37')]['length']?_0x50dba7[_0x8c9d('0x37')]:_0x3ef263[_0x8c9d('0x36')];if(_0x1eebf4[_0x8c9d('0x32')][_0x8c9d('0x42')]){_0x50dba7[_0x8c9d('0x43')]=[{'all':!![]}];}_0x50dba7=_['merge']({},_0x50dba7,_0x1eebf4[_0x8c9d('0x41')]);return db[_0x8c9d('0x2d')][_0x8c9d('0x48')](_0x50dba7)[_0x8c9d('0x27')](handleEntityNotFound(_0x490f58,null))['then'](respondWithResult(_0x490f58,null))[_0x8c9d('0x49')](handleError(_0x490f58,null));};exports[_0x8c9d('0x4a')]=function(_0x51dd2f,_0x4f1498){return db[_0x8c9d('0x2d')][_0x8c9d('0x4a')](_0x51dd2f[_0x8c9d('0x4b')],{})[_0x8c9d('0x27')](function(_0x3a2484){var _0x11fccd=_0x51dd2f[_0x8c9d('0x4c')][_0x8c9d('0x4d')]({'plain':!![]});if(!_0x11fccd)throw new Error(_0x8c9d('0x4e'));if(_0x11fccd[_0x8c9d('0x4f')]===_0x8c9d('0x4c')){var _0xba0366=_0x3a2484[_0x8c9d('0x4d')]({'plain':!![]});var _0x3d4205=_0x8c9d('0x50');return db[_0x8c9d('0x51')][_0x8c9d('0x48')]({'where':{'name':_0x3d4205,'userProfileId':_0x11fccd[_0x8c9d('0x52')]},'raw':!![]})[_0x8c9d('0x27')](function(_0x12bb72){if(_0x12bb72&&_0x12bb72[_0x8c9d('0x53')]===0x0){return db['UserProfileResource'][_0x8c9d('0x4a')]({'name':_0xba0366[_0x8c9d('0x2b')],'resourceId':_0xba0366['id'],'type':_0x8c9d('0x28'),'sectionId':_0x12bb72['id']},{})[_0x8c9d('0x27')](function(){return _0x3a2484;});}else{return _0x3a2484;}})[_0x8c9d('0x49')](function(_0x275412){logger[_0x8c9d('0x2a')](_0x8c9d('0x54'),_0x275412);throw _0x275412;});}return _0x3a2484;})[_0x8c9d('0x27')](respondWithResult(_0x4f1498,0xc9))[_0x8c9d('0x49')](handleError(_0x4f1498,null));};exports[_0x8c9d('0x55')]=function(_0x3755fe,_0x677876){if(_0x3755fe[_0x8c9d('0x4b')]['id']){delete _0x3755fe[_0x8c9d('0x4b')]['id'];}return db['AnalyticCustomReport'][_0x8c9d('0x48')]({'where':{'id':_0x3755fe[_0x8c9d('0x47')]['id']}})[_0x8c9d('0x27')](handleEntityNotFound(_0x677876,null))[_0x8c9d('0x27')](saveUpdates(_0x3755fe[_0x8c9d('0x4b')],null))[_0x8c9d('0x27')](respondWithResult(_0x677876,null))[_0x8c9d('0x49')](handleError(_0x677876,null));};exports[_0x8c9d('0x26')]=function(_0x61ed8a,_0x320eac){return db['AnalyticCustomReport'][_0x8c9d('0x48')]({'where':{'id':_0x61ed8a[_0x8c9d('0x47')]['id']}})[_0x8c9d('0x27')](handleEntityNotFound(_0x320eac,null))['then'](removeEntity(_0x320eac,null))[_0x8c9d('0x49')](handleError(_0x320eac,null));};exports[_0x8c9d('0x56')]=function(_0x100076,_0xc09499){var _0x16e352=0xa;var _0x1d351d=['join',_0x8c9d('0x57'),'right_join',_0x8c9d('0x58')];var _0x305e9a={'SUM':_0x8c9d('0x59'),'COUNT':_0x8c9d('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x8c9d('0x5b'),'MIN':_0x8c9d('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x8c9d('0x5d'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x8c9d('0x5e')};var _0x157d0d={'SEC_TO_TIME':_0x8c9d('0x5f'),'DATE':'DATE(%s)','HOUR':_0x8c9d('0x60'),'ROUND':_0x8c9d('0x61'),'UNIX_TIMESTAMP':_0x8c9d('0x62')};var _0x5422c2=function(_0x431081){return!_[_0x8c9d('0x63')]([_0x8c9d('0x64'),_0x8c9d('0x65'),'IS\x20EMPTY',_0x8c9d('0x66')],_0x431081);};var _0x1d05a0=function(_0x4b5626){if(!_0x4b5626||!_0x4b5626[_0x8c9d('0x67')][_0x8c9d('0x39')]){return'';}for(var _0x5020fd='(',_0xeb6bb5=0x0;_0xeb6bb5<_0x4b5626[_0x8c9d('0x67')][_0x8c9d('0x39')];_0xeb6bb5+=0x1){_0xeb6bb5>0x0&&(_0x5020fd+='\x20'+_0x4b5626[_0x8c9d('0x68')]+'\x20');_0x5020fd+=_0x4b5626[_0x8c9d('0x67')][_0xeb6bb5][_0x8c9d('0x69')]?_0x1d05a0(_0x4b5626[_0x8c9d('0x67')][_0xeb6bb5][_0x8c9d('0x69')]):_0x4b5626[_0x8c9d('0x67')][_0xeb6bb5][_0x8c9d('0x6a')]+'\x20'+_0x4b5626['rules'][_0xeb6bb5][_0x8c9d('0x6b')]+(_0x5422c2(_0x4b5626[_0x8c9d('0x67')][_0xeb6bb5][_0x8c9d('0x6b')])?'\x20'+_0x4b5626[_0x8c9d('0x67')][_0xeb6bb5][_0x8c9d('0x6c')]:'');}return _0x5020fd+')';};var _0x2563e2={'where':{'id':_0x100076[_0x8c9d('0x47')]['id']}},_0x465ebc,_0x3ce5a2,_0x2b7ab1,_0x3c1548,_0x11ca65;_0x2563e2=_['merge']({},_0x2563e2,_0x100076[_0x8c9d('0x41')]);return db[_0x8c9d('0x2d')]['find'](_0x2563e2)[_0x8c9d('0x27')](function(_0x1786f7){if(_0x1786f7){_0x465ebc=_0x1786f7;return _0x1786f7[_0x8c9d('0x6d')]();}return null;})['then'](function(_0x5465cc){if(_0x5465cc){if(!_0x5465cc[_0x8c9d('0x39')]){throw new db['Sequelize']['ValidationErrorItem'](_0x8c9d('0x6e'),0x193);}_0x3ce5a2=_0x5465cc;return db[_0x8c9d('0x6f')][_0x8c9d('0x44')]({'raw':!![]});}return null;})[_0x8c9d('0x27')](function(_0x34f94a){if(_0x34f94a){_0x2b7ab1=_['keyBy'](_0x34f94a,'id');var _0x3503b0;var _0x16e08a=squel[_0x8c9d('0x70')]();_0x16e08a['from'](_0x465ebc[_0x8c9d('0x71')]);for(var _0x49bbcc=0x0;_0x49bbcc<_0x3ce5a2[_0x8c9d('0x39')];_0x49bbcc+=0x1){_0x3503b0=_0x3ce5a2[_0x49bbcc]['MetricId']?_0x2b7ab1[_0x3ce5a2[_0x49bbcc][_0x8c9d('0x72')]][_0x8c9d('0x73')]:_0x3ce5a2[_0x49bbcc]['field'];_0x3503b0=_0x3ce5a2[_0x49bbcc]['function']?_[_0x8c9d('0x74')](_0x305e9a[_0x3ce5a2[_0x49bbcc][_0x8c9d('0x75')]],'%s',_0x3503b0):_0x3503b0;_0x3503b0=_0x3ce5a2[_0x49bbcc][_0x8c9d('0x76')]?_[_0x8c9d('0x74')](_0x157d0d[_0x3ce5a2[_0x49bbcc]['format']],'%s',_0x3503b0):_0x3503b0;if(_0x3ce5a2[_0x49bbcc][_0x8c9d('0x77')]){_0x16e08a[_0x8c9d('0x69')](_0x3503b0);}_0x3ce5a2[_0x49bbcc]['orderBy']&&_0x16e08a['order'](_0x3503b0,_0x3ce5a2[_0x49bbcc]['orderBy']===_0x8c9d('0x78')?![]:!![]);_0x16e08a[_0x8c9d('0x6a')](_0x3503b0,_0x3ce5a2[_0x49bbcc][_0x8c9d('0x79')]||_0x3503b0);}if(_0x465ebc['joins']){_0x465ebc[_0x8c9d('0x7a')]=JSON[_0x8c9d('0x7b')](_0x465ebc['joins']);for(var _0x3b262c=0x0;_0x3b262c<_0x465ebc[_0x8c9d('0x7a')][_0x8c9d('0x39')];_0x3b262c+=0x1){if(_0x465ebc[_0x8c9d('0x7a')][_0x3b262c][_0x8c9d('0x30')]&&_['includes'](_0x1d351d,_0x465ebc['joins'][_0x3b262c]['type'])&&_0x465ebc[_0x8c9d('0x7a')][_0x3b262c][_0x8c9d('0x7c')]&&_0x465ebc[_0x8c9d('0x7a')][_0x3b262c][_0x8c9d('0x7d')]&&_0x465ebc[_0x8c9d('0x7a')][_0x3b262c][_0x8c9d('0x7e')]){_0x16e08a[_0x465ebc[_0x8c9d('0x7a')][_0x3b262c]['type']](_0x465ebc['joins'][_0x3b262c][_0x8c9d('0x7d')],null,util[_0x8c9d('0x76')](_0x8c9d('0x7f'),_0x465ebc['table'],_0x465ebc[_0x8c9d('0x7a')][_0x3b262c][_0x8c9d('0x7c')],_0x465ebc[_0x8c9d('0x7a')][_0x3b262c][_0x8c9d('0x7d')],_0x465ebc[_0x8c9d('0x7a')][_0x3b262c]['foreignKey']));}}}if(_0x465ebc['conditions']){_0x465ebc[_0x8c9d('0x80')]=JSON[_0x8c9d('0x7b')](_0x465ebc[_0x8c9d('0x80')]);_0x16e08a['where'](_0x1d05a0(_0x465ebc['conditions'][_0x8c9d('0x69')]));}_0x11ca65=_0x16e08a[_0x8c9d('0x81')]();_0x16e08a[_0x8c9d('0x20')](_0x16e352);_0x16e08a[_0x8c9d('0x1e')](0x0);logger[_0x8c9d('0x82')](_0x8c9d('0x83'),_0x16e08a[_0x8c9d('0x84')]());return dbH['sequelize'][_0x8c9d('0x32')](_0x16e08a[_0x8c9d('0x84')](),{'type':dbH[_0x8c9d('0x85')][_0x8c9d('0x86')][_0x8c9d('0x87')]});}})['then'](respondWithResult(_0xc09499,null))[_0x8c9d('0x49')](handleError(_0xc09499,null));};function runReport(_0x4659f9,_0x1fbb32,_0x59db8b){var _0x2860e9=_0x1fbb32[_0x8c9d('0x2b')];var _0x17196b=0xa;var _0x3f1d38=[_0x8c9d('0x88'),'left_join',_0x8c9d('0x89'),_0x8c9d('0x58')];var _0xaa9b2b={'SUM':_0x8c9d('0x59'),'COUNT':_0x8c9d('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x8c9d('0x5c'),'AVG':_0x8c9d('0x8a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x8c9d('0x8b'),'GROUP_CONCAT DESC':_0x8c9d('0x5e')};var _0x2548d3={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x8c9d('0x8c'),'HOUR':_0x8c9d('0x60'),'ROUND':_0x8c9d('0x61'),'UNIX_TIMESTAMP':_0x8c9d('0x62')};var _0x33b8bb=function(_0x3b2069){return!_[_0x8c9d('0x63')]([_0x8c9d('0x64'),_0x8c9d('0x65'),'IS\x20EMPTY',_0x8c9d('0x66')],_0x3b2069);};var _0x3fce1e=function(_0x589608){if(!_0x589608||!_0x589608[_0x8c9d('0x67')][_0x8c9d('0x39')]){return'';}for(var _0x45f2a7='(',_0x77a7e5=0x0;_0x77a7e5<_0x589608[_0x8c9d('0x67')][_0x8c9d('0x39')];_0x77a7e5+=0x1){_0x77a7e5>0x0&&(_0x45f2a7+='\x20'+_0x589608[_0x8c9d('0x68')]+'\x20');_0x45f2a7+=_0x589608[_0x8c9d('0x67')][_0x77a7e5][_0x8c9d('0x69')]?_0x3fce1e(_0x589608['rules'][_0x77a7e5][_0x8c9d('0x69')]):_0x589608[_0x8c9d('0x67')][_0x77a7e5][_0x8c9d('0x6a')]+'\x20'+_0x589608[_0x8c9d('0x67')][_0x77a7e5][_0x8c9d('0x6b')]+(_0x33b8bb(_0x589608[_0x8c9d('0x67')][_0x77a7e5]['condition'])?'\x20'+_0x589608[_0x8c9d('0x67')][_0x77a7e5][_0x8c9d('0x6c')]:'');}return _0x45f2a7+')';};var _0x32cf4c={'where':{'id':_0x4659f9['id']}},_0x194331,_0x6c9f5e,_0x47b04e,_0x149142,_0x2490b7;_0x32cf4c=_[_0x8c9d('0x3f')]({},_0x32cf4c,_0x59db8b);return db['AnalyticCustomReport'][_0x8c9d('0x48')](_0x32cf4c)[_0x8c9d('0x27')](function(_0x1bb9a0){if(_0x1bb9a0){_0x194331=_0x1bb9a0;return _0x1bb9a0[_0x8c9d('0x6d')]();}return null;})[_0x8c9d('0x27')](function(_0x4d7c40){if(_0x4d7c40){if(!_0x4d7c40[_0x8c9d('0x39')]){throw new db[(_0x8c9d('0x8d'))]['ValidationErrorItem'](_0x8c9d('0x6e'),0x193);}_0x6c9f5e=_0x4d7c40;return db[_0x8c9d('0x6f')][_0x8c9d('0x44')]({'raw':!![]});}return null;})[_0x8c9d('0x27')](function(_0x1f8e89){if(_0x1f8e89){_0x47b04e=_[_0x8c9d('0x8e')](_0x1f8e89,'id');var _0x1f2580;var _0x124ea0=squel[_0x8c9d('0x70')]();_0x124ea0['from'](_0x194331['table']);for(var _0x4ed751=0x0;_0x4ed751<_0x6c9f5e[_0x8c9d('0x39')];_0x4ed751+=0x1){_0x1f2580=_0x6c9f5e[_0x4ed751][_0x8c9d('0x72')]?_0x47b04e[_0x6c9f5e[_0x4ed751][_0x8c9d('0x72')]][_0x8c9d('0x73')]:_0x6c9f5e[_0x4ed751][_0x8c9d('0x6a')];_0x1f2580=_0x6c9f5e[_0x4ed751]['function']?_[_0x8c9d('0x74')](_0xaa9b2b[_0x6c9f5e[_0x4ed751]['function']],'%s',_0x1f2580):_0x1f2580;_0x1f2580=_0x6c9f5e[_0x4ed751][_0x8c9d('0x76')]?_[_0x8c9d('0x74')](_0x2548d3[_0x6c9f5e[_0x4ed751][_0x8c9d('0x76')]],'%s',_0x1f2580):_0x1f2580;if(_0x6c9f5e[_0x4ed751][_0x8c9d('0x77')]){_0x124ea0[_0x8c9d('0x69')](_0x1f2580);}_0x6c9f5e[_0x4ed751][_0x8c9d('0x8f')]&&_0x124ea0[_0x8c9d('0x90')](_0x1f2580,_0x6c9f5e[_0x4ed751]['orderBy']==='DESC'?![]:!![]);_0x124ea0[_0x8c9d('0x6a')](_0x1f2580,_0x6c9f5e[_0x4ed751]['alias']||_0x1f2580);}if(_0x194331[_0x8c9d('0x7a')]){_0x194331[_0x8c9d('0x7a')]=JSON[_0x8c9d('0x7b')](_0x194331[_0x8c9d('0x7a')]);for(var _0x3cdbfe=0x0;_0x3cdbfe<_0x194331[_0x8c9d('0x7a')][_0x8c9d('0x39')];_0x3cdbfe+=0x1){if(_0x194331[_0x8c9d('0x7a')][_0x3cdbfe][_0x8c9d('0x30')]&&_['includes'](_0x3f1d38,_0x194331['joins'][_0x3cdbfe][_0x8c9d('0x30')])&&_0x194331[_0x8c9d('0x7a')][_0x3cdbfe][_0x8c9d('0x7c')]&&_0x194331[_0x8c9d('0x7a')][_0x3cdbfe]['foreignTable']&&_0x194331[_0x8c9d('0x7a')][_0x3cdbfe][_0x8c9d('0x7e')]){_0x124ea0[_0x194331[_0x8c9d('0x7a')][_0x3cdbfe][_0x8c9d('0x30')]](_0x194331[_0x8c9d('0x7a')][_0x3cdbfe][_0x8c9d('0x7d')],null,util[_0x8c9d('0x76')]('%s.%s\x20=\x20%s.%s',_0x194331['table'],_0x194331[_0x8c9d('0x7a')][_0x3cdbfe][_0x8c9d('0x7c')],_0x194331[_0x8c9d('0x7a')][_0x3cdbfe][_0x8c9d('0x7d')],_0x194331[_0x8c9d('0x7a')][_0x3cdbfe][_0x8c9d('0x7e')]));}}}if(_0x194331[_0x8c9d('0x80')]){_0x194331['conditions']=JSON[_0x8c9d('0x7b')](_0x194331['conditions']);_0x124ea0[_0x8c9d('0x3d')](_0x3fce1e(_0x194331[_0x8c9d('0x80')][_0x8c9d('0x69')]));}_0x2490b7=_0x124ea0[_0x8c9d('0x81')]();_0x124ea0[_0x8c9d('0x20')](_0x17196b);_0x124ea0[_0x8c9d('0x1e')](0x0);return;}})[_0x8c9d('0x27')](function(){if(_0x1fbb32[_0x8c9d('0x91')]===_0x8c9d('0x92')){return null;}var _0x190257=_[_0x8c9d('0x3f')](_0x1fbb32,{'name':_0x1fbb32[_0x8c9d('0x93')]||_0x1fbb32[_0x8c9d('0x2b')]||_0x194331[_0x8c9d('0x2b')],'basename':_0x2860e9,'savename':util[_0x8c9d('0x76')](_0x8c9d('0x94'),_0x1fbb32[_0x8c9d('0x2b')]||_0x194331[_0x8c9d('0x2b')],require(_0x8c9d('0x95'))['generate'](0x4),_0x1fbb32[_0x8c9d('0x91')]||_0x8c9d('0x96')),'reportId':_0x194331['id'],'reportType':'custom'});return db[_0x8c9d('0x97')][_0x8c9d('0x4a')](_0x190257,{'raw':!![]});})[_0x8c9d('0x27')](function(_0x243aca){if(_0x194331['table']==='cdr'){_0x2490b7['where'](_0x194331[_0x8c9d('0x71')]+_0x8c9d('0x98'),_0x1fbb32[_0x8c9d('0x99')],_0x1fbb32[_0x8c9d('0x9a')]);}else{_0x2490b7['where'](_0x194331[_0x8c9d('0x71')]+_0x8c9d('0x9b'),_0x1fbb32[_0x8c9d('0x99')],_0x1fbb32[_0x8c9d('0x9a')]);}if(_0x243aca){logger[_0x8c9d('0x9c')](_0x8c9d('0x9d'),_0x2490b7[_0x8c9d('0x84')]());require(_0x8c9d('0x9e'))[_0x8c9d('0x9f')](path[_0x8c9d('0x88')](__dirname,_0x8c9d('0xa0'),_0x243aca[_0x8c9d('0x91')]),[_0x243aca['id'],_0x2490b7[_0x8c9d('0x84')](),path[_0x8c9d('0x88')](__dirname,_0x8c9d('0xa1'),_0x243aca[_0x8c9d('0xa2')]),_0x2860e9]);return _0x243aca;}else{var _0x496ba2=squel[_0x8c9d('0x70')]();_0x496ba2[_0x8c9d('0xa3')]('('+_0x2490b7[_0x8c9d('0x84')]()+')',_0x8c9d('0xa4'));_0x496ba2[_0x8c9d('0x6a')](_0x8c9d('0xa5'),_0x8c9d('0x21'));_0x2490b7[_0x8c9d('0x20')](_0x1fbb32[_0x8c9d('0x20')]||_0x17196b);_0x2490b7[_0x8c9d('0x1e')](_0x1fbb32[_0x8c9d('0x1e')]||0x0);return dbH[_0x8c9d('0x85')]['query'](_0x496ba2['toString'](),{'type':dbH[_0x8c9d('0x85')]['QueryTypes'][_0x8c9d('0x87')]})[_0x8c9d('0x27')](function(_0x1a157c){if(!_0x1a157c['length']){_0x149142=0x0;}else{_0x149142=_0x1a157c[0x0]['count']||0x0;}return dbH[_0x8c9d('0x85')][_0x8c9d('0x32')](_0x2490b7[_0x8c9d('0x84')](),{'type':dbH[_0x8c9d('0x85')][_0x8c9d('0x86')]['SELECT']});})[_0x8c9d('0x27')](function(_0xec5c79){return{'rows':_0xec5c79||[],'count':_0x149142};});}});}exports[_0x8c9d('0xa6')]=function(_0x4c2ad4,_0x562aa7){return runReport(_0x4c2ad4['params'],_0x4c2ad4['query'],_0x4c2ad4[_0x8c9d('0x41')])[_0x8c9d('0x27')](respondWithResult(_0x562aa7,null))[_0x8c9d('0x49')](handleError(_0x562aa7,null));};exports['runReport']=runReport;exports[_0x8c9d('0x32')]=function(_0x5dafe8,_0x34afbd){var _0x5ea95f=0xa;var _0x3ccbba=[_0x8c9d('0x88'),_0x8c9d('0x57'),'right_join','cross_join'];var _0x66b87c={'SUM':_0x8c9d('0x59'),'COUNT':_0x8c9d('0x5a'),'COUNT DISTINCT':_0x8c9d('0xa7'),'MAX':_0x8c9d('0x5b'),'MIN':_0x8c9d('0x5c'),'AVG':_0x8c9d('0x8a'),'GROUP_CONCAT':_0x8c9d('0x5d'),'GROUP_CONCAT ASC':_0x8c9d('0x8b'),'GROUP_CONCAT DESC':_0x8c9d('0x5e')};var _0xf0ead9={'SEC_TO_TIME':_0x8c9d('0x5f'),'DATE':_0x8c9d('0x8c'),'HOUR':_0x8c9d('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2360b2=function(_0x3c4056){return!_['includes']([_0x8c9d('0x64'),'IS\x20NOT\x20NULL',_0x8c9d('0xa8'),_0x8c9d('0x66')],_0x3c4056);};var _0x9bbee6=function(_0x1bcdde){if(!_0x1bcdde||!_0x1bcdde[_0x8c9d('0x67')][_0x8c9d('0x39')]){return'';}for(var _0x47006b='(',_0x596983=0x0;_0x596983<_0x1bcdde[_0x8c9d('0x67')][_0x8c9d('0x39')];_0x596983+=0x1){_0x596983>0x0&&(_0x47006b+='\x20'+_0x1bcdde[_0x8c9d('0x68')]+'\x20');_0x47006b+=_0x1bcdde[_0x8c9d('0x67')][_0x596983]['group']?_0x9bbee6(_0x1bcdde[_0x8c9d('0x67')][_0x596983]['group']):_0x1bcdde[_0x8c9d('0x67')][_0x596983]['field']+'\x20'+_0x1bcdde[_0x8c9d('0x67')][_0x596983][_0x8c9d('0x6b')]+(_0x2360b2(_0x1bcdde['rules'][_0x596983][_0x8c9d('0x6b')])?'\x20'+_0x1bcdde[_0x8c9d('0x67')][_0x596983]['value']:'');}return _0x47006b+')';};var _0x4e223a={'where':{'id':_0x5dafe8['params']['id']}},_0x4fb17c,_0x419929,_0x29492c,_0x398151,_0x4d6be2;_0x4e223a=_[_0x8c9d('0x3f')]({},_0x4e223a,_0x5dafe8[_0x8c9d('0x41')]);return db[_0x8c9d('0x2d')][_0x8c9d('0x48')](_0x4e223a)[_0x8c9d('0x27')](function(_0xdd5493){if(_0xdd5493){_0x4fb17c=_0xdd5493;return _0xdd5493[_0x8c9d('0x6d')]();}return null;})[_0x8c9d('0x27')](function(_0x1642b5){if(_0x1642b5){if(!_0x1642b5['length']){throw new db[(_0x8c9d('0x8d'))][(_0x8c9d('0xa9'))](_0x8c9d('0x6e'),0x193);}_0x419929=_0x1642b5;return db[_0x8c9d('0x6f')][_0x8c9d('0x44')]({'raw':!![]});}return null;})[_0x8c9d('0x27')](function(_0x8da741){if(_0x8da741){_0x29492c=_[_0x8c9d('0x8e')](_0x8da741,'id');var _0x3d2b9b;var _0x330d6f=squel[_0x8c9d('0x70')]();_0x330d6f[_0x8c9d('0xa3')](_0x4fb17c['table']);for(var _0x3b4567=0x0;_0x3b4567<_0x419929[_0x8c9d('0x39')];_0x3b4567+=0x1){_0x3d2b9b=_0x419929[_0x3b4567]['MetricId']?_0x29492c[_0x419929[_0x3b4567]['MetricId']]['metric']:_0x419929[_0x3b4567]['field'];_0x3d2b9b=_0x419929[_0x3b4567]['function']?_['replace'](_0x66b87c[_0x419929[_0x3b4567][_0x8c9d('0x75')]],'%s',_0x3d2b9b):_0x3d2b9b;_0x3d2b9b=_0x419929[_0x3b4567]['format']?_[_0x8c9d('0x74')](_0xf0ead9[_0x419929[_0x3b4567]['format']],'%s',_0x3d2b9b):_0x3d2b9b;if(_0x419929[_0x3b4567][_0x8c9d('0x77')]){_0x330d6f[_0x8c9d('0x69')](_0x3d2b9b);}_0x419929[_0x3b4567]['orderBy']&&_0x330d6f['order'](_0x3d2b9b,_0x419929[_0x3b4567]['orderBy']===_0x8c9d('0x78')?![]:!![]);_0x330d6f[_0x8c9d('0x6a')](_0x3d2b9b,_0x419929[_0x3b4567]['alias']||_0x3d2b9b);}if(_0x4fb17c[_0x8c9d('0x7a')]){_0x4fb17c['joins']=JSON[_0x8c9d('0x7b')](_0x4fb17c[_0x8c9d('0x7a')]);for(var _0xb28293=0x0;_0xb28293<_0x4fb17c[_0x8c9d('0x7a')]['length'];_0xb28293+=0x1){if(_0x4fb17c[_0x8c9d('0x7a')][_0xb28293][_0x8c9d('0x30')]&&_[_0x8c9d('0x63')](_0x3ccbba,_0x4fb17c[_0x8c9d('0x7a')][_0xb28293]['type'])&&_0x4fb17c[_0x8c9d('0x7a')][_0xb28293][_0x8c9d('0x7c')]&&_0x4fb17c[_0x8c9d('0x7a')][_0xb28293][_0x8c9d('0x7d')]&&_0x4fb17c[_0x8c9d('0x7a')][_0xb28293][_0x8c9d('0x7e')]){_0x330d6f[_0x4fb17c[_0x8c9d('0x7a')][_0xb28293]['type']](_0x4fb17c[_0x8c9d('0x7a')][_0xb28293][_0x8c9d('0x7d')],null,util[_0x8c9d('0x76')](_0x8c9d('0x7f'),_0x4fb17c[_0x8c9d('0x71')],_0x4fb17c['joins'][_0xb28293][_0x8c9d('0x7c')],_0x4fb17c[_0x8c9d('0x7a')][_0xb28293][_0x8c9d('0x7d')],_0x4fb17c[_0x8c9d('0x7a')][_0xb28293][_0x8c9d('0x7e')]));}}}if(_0x4fb17c[_0x8c9d('0x80')]){_0x4fb17c['conditions']=JSON[_0x8c9d('0x7b')](_0x4fb17c['conditions']);_0x330d6f[_0x8c9d('0x3d')](_0x9bbee6(_0x4fb17c[_0x8c9d('0x80')][_0x8c9d('0x69')]));}_0x4d6be2=_0x330d6f[_0x8c9d('0x81')]();_0x330d6f['limit'](_0x5ea95f);_0x330d6f['offset'](0x0);logger[_0x8c9d('0x82')](_0x8c9d('0x83'),_0x330d6f['toString']());return dbH[_0x8c9d('0x85')]['query'](_0x330d6f[_0x8c9d('0x84')](),{'type':dbH[_0x8c9d('0x85')][_0x8c9d('0x86')][_0x8c9d('0x87')]});}})['then'](function(){return{'sql':_0x4d6be2['toString']()};})['then'](respondWithResult(_0x34afbd,null))[_0x8c9d('0x49')](handleError(_0x34afbd,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index b6dac55..3778fdb 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 _0x3930=['request-promise','path','../../config/environment','./analyticCustomReport.attributes','define','analytics_custom_reports','lodash','../../config/logger','api','moment','bluebird'];(function(_0x28e973,_0x2a1364){var _0x178b9e=function(_0x11907d){while(--_0x11907d){_0x28e973['push'](_0x28e973['shift']());}};_0x178b9e(++_0x2a1364);}(_0x3930,0x19d));var _0x0393=function(_0x1ad901,_0x852d9e){_0x1ad901=_0x1ad901-0x0;var _0x3c0249=_0x3930[_0x1ad901];return _0x3c0249;};'use strict';var _=require(_0x0393('0x0'));var util=require('util');var logger=require(_0x0393('0x1'))(_0x0393('0x2'));var moment=require(_0x0393('0x3'));var BPromise=require(_0x0393('0x4'));var rp=require(_0x0393('0x5'));var fs=require('fs');var path=require(_0x0393('0x6'));var rimraf=require('rimraf');var config=require(_0x0393('0x7'));var attributes=require(_0x0393('0x8'));module['exports']=function(_0x47dee1,_0x479a0b){return _0x47dee1[_0x0393('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0x0393('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x370a=['exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes'];(function(_0x1c461e,_0x1b98ff){var _0x1dce4f=function(_0x5cbdf0){while(--_0x5cbdf0){_0x1c461e['push'](_0x1c461e['shift']());}};_0x1dce4f(++_0x1b98ff);}(_0x370a,0xfb));var _0xa370=function(_0x56fb4a,_0x1a66ec){_0x56fb4a=_0x56fb4a-0x0;var _0x4e47fd=_0x370a[_0x56fb4a];return _0x4e47fd;};'use strict';var _=require(_0xa370('0x0'));var util=require(_0xa370('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa370('0x2'));var BPromise=require(_0xa370('0x3'));var rp=require(_0xa370('0x4'));var fs=require('fs');var path=require(_0xa370('0x5'));var rimraf=require(_0xa370('0x6'));var config=require(_0xa370('0x7'));var attributes=require(_0xa370('0x8'));module[_0xa370('0x9')]=function(_0x3d9271,_0x335d4c){return _0x3d9271[_0xa370('0xa')](_0xa370('0xb'),attributes,{'tableName':_0xa370('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 00ddb07..974cb72 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 _0x727b=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x727b,0xe3));var _0xb727=function(_0x106fd8,_0x19dbc1){_0x106fd8=_0x106fd8-0x0;var _0x2fec5c=_0x727b[_0x106fd8];return _0x2fec5c;};'use strict';var _=require(_0xb727('0x0'));var util=require(_0xb727('0x1'));var moment=require(_0xb727('0x2'));var BPromise=require(_0xb727('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb727('0x4'));var db=require(_0xb727('0x5'))['db'];var utils=require(_0xb727('0x6'));var logger=require('../../config/logger')(_0xb727('0x7'));var config=require('../../config/environment');var jayson=require(_0xb727('0x8'));var client=jayson[_0xb727('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ac0a6,_0x21aa38,_0xf108d2){return new BPromise(function(_0x4c145d,_0x3a486b){return client[_0xb727('0xa')](_0x2ac0a6,_0xf108d2)['then'](function(_0x50bacb){logger[_0xb727('0xb')](_0xb727('0xc'),_0x21aa38,_0xb727('0xd'));logger['debug'](_0xb727('0xe'),_0x21aa38,_0xb727('0xd'),JSON[_0xb727('0xf')](_0x50bacb));if(_0x50bacb[_0xb727('0x10')]){if(_0x50bacb['error']['code']===0x1f4){logger[_0xb727('0x10')](_0xb727('0xc'),_0x21aa38,_0x50bacb['error']['message']);return _0x3a486b(_0x50bacb[_0xb727('0x10')][_0xb727('0x11')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x21aa38,_0x50bacb[_0xb727('0x10')][_0xb727('0x11')]);return _0x4c145d(_0x50bacb['error']['message']);}else{logger[_0xb727('0xb')](_0xb727('0xc'),_0x21aa38,'request\x20sent');_0x4c145d(_0x50bacb['result'][_0xb727('0x11')]);}})[_0xb727('0x12')](function(_0x56c6dc){logger['error'](_0xb727('0xc'),_0x21aa38,_0x56c6dc);_0x3a486b(_0x56c6dc);});});} \ No newline at end of file +var _0x2911=['info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x5f0864,_0x413e01){var _0x5700dc=function(_0x1677cf){while(--_0x1677cf){_0x5f0864['push'](_0x5f0864['shift']());}};_0x5700dc(++_0x413e01);}(_0x2911,0x163));var _0x1291=function(_0x2bd440,_0x46c53d){_0x2bd440=_0x2bd440-0x0;var _0xc57de4=_0x2911[_0x2bd440];return _0xc57de4;};'use strict';var _=require(_0x1291('0x0'));var util=require(_0x1291('0x1'));var moment=require(_0x1291('0x2'));var BPromise=require(_0x1291('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1291('0x4'));var db=require(_0x1291('0x5'))['db'];var utils=require(_0x1291('0x6'));var logger=require(_0x1291('0x7'))(_0x1291('0x8'));var config=require(_0x1291('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1291('0xa')][_0x1291('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14939f,_0x323755,_0x28001b){return new BPromise(function(_0x3b591c,_0x1641fb){return client[_0x1291('0xc')](_0x14939f,_0x28001b)['then'](function(_0x4cba96){logger['info'](_0x1291('0xd'),_0x323755,_0x1291('0xe'));logger[_0x1291('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x323755,_0x1291('0xe'),JSON['stringify'](_0x4cba96));if(_0x4cba96[_0x1291('0x10')]){if(_0x4cba96[_0x1291('0x10')][_0x1291('0x11')]===0x1f4){logger[_0x1291('0x10')](_0x1291('0xd'),_0x323755,_0x4cba96[_0x1291('0x10')][_0x1291('0x12')]);return _0x1641fb(_0x4cba96[_0x1291('0x10')]['message']);}logger[_0x1291('0x10')](_0x1291('0xd'),_0x323755,_0x4cba96['error'][_0x1291('0x12')]);return _0x3b591c(_0x4cba96[_0x1291('0x10')][_0x1291('0x12')]);}else{logger[_0x1291('0x13')](_0x1291('0xd'),_0x323755,_0x1291('0xe'));_0x3b591c(_0x4cba96[_0x1291('0x14')][_0x1291('0x12')]);}})[_0x1291('0x15')](function(_0x2c6569){logger[_0x1291('0x10')](_0x1291('0xd'),_0x323755,_0x2c6569);_0x1641fb(_0x2c6569);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 66162d5..880bc2c 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 _0xc4aa=['exports','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/preview','/:id/run','run','/:id/query','query','create','update','destroy'];(function(_0x5977ba,_0x15369e){var _0x32be1d=function(_0x20c222){while(--_0x20c222){_0x5977ba['push'](_0x5977ba['shift']());}};_0x32be1d(++_0x15369e);}(_0xc4aa,0x17d));var _0xac4a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc4aa[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0xac4a('0x0'));var path=require(_0xac4a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xac4a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xac4a('0x3'));var interaction=require(_0xac4a('0x4'));var config=require(_0xac4a('0x5'));var controller=require('./analyticCustomReport.controller');router[_0xac4a('0x6')]('/',auth['isAuthenticated'](),controller[_0xac4a('0x7')]);router[_0xac4a('0x6')](_0xac4a('0x8'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router['get'](_0xac4a('0xb'),auth['isAuthenticated'](),controller['preview']);router['get'](_0xac4a('0xc'),auth['isAuthenticated'](),controller[_0xac4a('0xd')]);router[_0xac4a('0x6')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xf')]);router['post']('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0x10')]);router['put'](_0xac4a('0x8'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xac4a('0x12')]);module[_0xac4a('0x13')]=router; \ No newline at end of file +var _0xa275=['post','create','update','delete','destroy','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','/:id/run','/:id/query','query'];(function(_0x4e0e01,_0x2e1f1b){var _0x2389bd=function(_0x9c8e06){while(--_0x9c8e06){_0x4e0e01['push'](_0x4e0e01['shift']());}};_0x2389bd(++_0x2e1f1b);}(_0xa275,0x1d3));var _0x5a27=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa275[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x5a27('0x0'));var util=require('util');var path=require(_0x5a27('0x1'));var timeout=require('connect-timeout');var express=require(_0x5a27('0x2'));var router=express[_0x5a27('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5a27('0x4'));var interaction=require(_0x5a27('0x5'));var config=require(_0x5a27('0x6'));var controller=require(_0x5a27('0x7'));router[_0x5a27('0x8')]('/',auth[_0x5a27('0x9')](),controller['index']);router['get'](_0x5a27('0xa'),auth[_0x5a27('0x9')](),controller[_0x5a27('0xb')]);router['get'](_0x5a27('0xc'),auth[_0x5a27('0x9')](),controller['preview']);router['get'](_0x5a27('0xd'),auth['isAuthenticated'](),controller['run']);router[_0x5a27('0x8')](_0x5a27('0xe'),auth['isAuthenticated'](),controller[_0x5a27('0xf')]);router[_0x5a27('0x10')]('/',auth['isAuthenticated'](),controller[_0x5a27('0x11')]);router['put']('/:id',auth[_0x5a27('0x9')](),controller[_0x5a27('0x12')]);router[_0x5a27('0x13')](_0x5a27('0xa'),auth['isAuthenticated'](),controller[_0x5a27('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 6e1ff0b..10818e7 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 _0xdbf5=['exports','STRING','TEXT'];(function(_0x197c26,_0x121ce8){var _0x5abb84=function(_0x377ef9){while(--_0x377ef9){_0x197c26['push'](_0x197c26['shift']());}};_0x5abb84(++_0x121ce8);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x4f86f3,_0x1258b5){_0x4f86f3=_0x4f86f3-0x0;var _0x1d58e7=_0xdbf5[_0x4f86f3];return _0x1d58e7;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5dbf('0x1')]},'table':{'type':Sequelize[_0x5dbf('0x1')]},'conditions':{'type':Sequelize[_0x5dbf('0x2')]},'joins':{'type':Sequelize[_0x5dbf('0x2')]}}; \ No newline at end of file +var _0x7da7=['TEXT','sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7da7,0x10d));var _0x77da=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x7da7[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require(_0x77da('0x0'));module[_0x77da('0x1')]={'name':{'type':Sequelize[_0x77da('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x77da('0x2')]},'conditions':{'type':Sequelize[_0x77da('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index fd818d1..7b84b4f 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 _0x2675=['AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','include','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','select','table','MetricId','metric','field','function','replace','format','groupBy','order','orderBy','DESC','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20EMPTY','Sequelize','keyBy','from','alias','output','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../files/reports','savename','COUNT(*)','SELECT','run','runReport','MIN(%s)','debug','eml-format','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','DefaultReports','name','map'];(function(_0x117581,_0x307e77){var _0x25cfa7=function(_0xcb89ee){while(--_0xcb89ee){_0x117581['push'](_0x117581['shift']());}};_0x25cfa7(++_0x307e77);}(_0x2675,0x75));var _0x5267=function(_0x4b6f0e,_0x59016d){_0x4b6f0e=_0x4b6f0e-0x0;var _0x33afa2=_0x2675[_0x4b6f0e];return _0x33afa2;};'use strict';var emlformat=require(_0x5267('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5267('0x1'));var moment=require(_0x5267('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x5267('0x3'));var util=require(_0x5267('0x4'));var path=require('path');var sox=require(_0x5267('0x5'));var csv=require(_0x5267('0x6'));var ejs=require(_0x5267('0x7'));var fs=require('fs');var fs_extra=require(_0x5267('0x8'));var _=require(_0x5267('0x9'));var squel=require(_0x5267('0xa'));var crypto=require('crypto');var jsforce=require(_0x5267('0xb'));var deskjs=require(_0x5267('0xc'));var toCsv=require('to-csv');var querystring=require(_0x5267('0xd'));var Papa=require('papaparse');var Redis=require(_0x5267('0xe'));var authService=require(_0x5267('0xf'));var qs=require(_0x5267('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5267('0x11'));var logger=require('../../config/logger')(_0x5267('0x12'));var utils=require('../../config/utils');var config=require(_0x5267('0x13'));var licenseUtil=require(_0x5267('0x14'));var db=require(_0x5267('0x15'))['db'];var dbH=require(_0x5267('0x15'))[_0x5267('0x16')];function respondWithStatusCode(_0x1171b9,_0x20785c){_0x20785c=_0x20785c||0xcc;return function(_0x36dc17){if(_0x36dc17){return _0x1171b9[_0x5267('0x17')](_0x20785c);}return _0x1171b9[_0x5267('0x18')](_0x20785c)[_0x5267('0x19')]();};}function respondWithResult(_0x29349a,_0x3e2bab){_0x3e2bab=_0x3e2bab||0xc8;return function(_0x548040){if(_0x548040){return _0x29349a['status'](_0x3e2bab)[_0x5267('0x1a')](_0x548040);}};}function respondWithFilteredResult(_0x40d897,_0x38a147){return function(_0x3f5344){if(_0x3f5344){var _0x46b2c2=typeof _0x38a147[_0x5267('0x1b')]===_0x5267('0x1c')&&typeof _0x38a147[_0x5267('0x1d')]===_0x5267('0x1c');var _0xb1c97a=_0x3f5344[_0x5267('0x1e')];var _0x1ab03=_0x46b2c2?0x0:_0x38a147['offset'];var _0x18f32e=_0x46b2c2?_0x3f5344[_0x5267('0x1e')]:_0x38a147['offset']+_0x38a147[_0x5267('0x1d')];var _0x56733e;if(_0x18f32e>=_0xb1c97a){_0x18f32e=_0xb1c97a;_0x56733e=0xc8;}else{_0x56733e=0xce;}_0x40d897[_0x5267('0x18')](_0x56733e);return _0x40d897[_0x5267('0x1f')](_0x5267('0x20'),_0x1ab03+'-'+_0x18f32e+'/'+_0xb1c97a)[_0x5267('0x1a')](_0x3f5344);}return null;};}function patchUpdates(_0x5ca9c6){return function(_0x4dd637){try{jsonpatch[_0x5267('0x21')](_0x4dd637,_0x5ca9c6,!![]);}catch(_0x5aebdd){return BPromise[_0x5267('0x22')](_0x5aebdd);}return _0x4dd637[_0x5267('0x23')]();};}function saveUpdates(_0x3b53ac,_0x56dd95){return function(_0x499f19){if(_0x499f19){return _0x499f19['update'](_0x3b53ac)['then'](function(_0x5ea6a6){return _0x5ea6a6;});}return null;};}function removeEntity(_0x26c7f8,_0x399e64){return function(_0x2d761d){if(_0x2d761d){return _0x2d761d[_0x5267('0x24')]()[_0x5267('0x25')](function(){var _0x40d1be=_0x2d761d[_0x5267('0x26')]({'plain':!![]});var _0x220e03=_0x5267('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x220e03,'resourceId':_0x40d1be['id']}})[_0x5267('0x25')](function(){return _0x2d761d;});})[_0x5267('0x25')](function(){_0x26c7f8['status'](0xcc)[_0x5267('0x19')]();});}};}function handleEntityNotFound(_0x52504e,_0x4d7c2a){return function(_0x43e7e7){if(!_0x43e7e7){_0x52504e[_0x5267('0x17')](0x194);}return _0x43e7e7;};}function handleError(_0x1f33b7,_0x2d2ace){_0x2d2ace=_0x2d2ace||0x1f4;return function(_0x33c431){logger['error'](_0x33c431['stack']);if(_0x33c431[_0x5267('0x28')]){delete _0x33c431[_0x5267('0x28')];}_0x1f33b7[_0x5267('0x18')](_0x2d2ace)['send'](_0x33c431);};}exports['index']=function(_0xbe7922,_0x3ef2a8){var _0x1fa725={},_0x5bec7e={},_0x59b091={'count':0x0,'rows':[]};var _0x2249a1=_[_0x5267('0x29')](db[_0x5267('0x2a')][_0x5267('0x2b')],function(_0x5bbb83){return{'name':_0x5bbb83[_0x5267('0x2c')],'type':_0x5bbb83[_0x5267('0x2d')][_0x5267('0x2e')]};});_0x5bec7e[_0x5267('0x2f')]=_[_0x5267('0x29')](_0x2249a1,_0x5267('0x28'));_0x5bec7e[_0x5267('0x30')]=_[_0x5267('0x31')](_0xbe7922['query']);_0x5bec7e['filters']=_[_0x5267('0x32')](_0x5bec7e['model'],_0x5bec7e[_0x5267('0x30')]);_0x1fa725[_0x5267('0x33')]=_[_0x5267('0x32')](_0x5bec7e[_0x5267('0x2f')],qs['fields'](_0xbe7922[_0x5267('0x30')][_0x5267('0x34')]));_0x1fa725[_0x5267('0x33')]=_0x1fa725[_0x5267('0x33')][_0x5267('0x35')]?_0x1fa725[_0x5267('0x33')]:_0x5bec7e[_0x5267('0x2f')];if(!_0xbe7922[_0x5267('0x30')]['hasOwnProperty'](_0x5267('0x36'))){_0x1fa725['limit']=qs[_0x5267('0x1d')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1d')]);_0x1fa725[_0x5267('0x1b')]=qs[_0x5267('0x1b')](_0xbe7922[_0x5267('0x30')][_0x5267('0x1b')]);}_0x1fa725['order']=qs[_0x5267('0x37')](_0xbe7922[_0x5267('0x30')][_0x5267('0x37')]);_0x1fa725[_0x5267('0x38')]=qs[_0x5267('0x39')](_[_0x5267('0x3a')](_0xbe7922[_0x5267('0x30')],_0x5bec7e['filters']),_0x2249a1);if(_0xbe7922[_0x5267('0x30')]['filter']){_0x1fa725[_0x5267('0x38')]=_['merge'](_0x1fa725['where'],{'$or':_['map'](_0x2249a1,function(_0x46bfcc){if(_0x46bfcc['type']!==_0x5267('0x3b')){var _0x146476={};_0x146476[_0x46bfcc[_0x5267('0x28')]]={'$like':'%'+_0xbe7922[_0x5267('0x30')]['filter']+'%'};return _0x146476;}})});}_0x1fa725=_[_0x5267('0x3c')]({},_0x1fa725,_0xbe7922[_0x5267('0x3d')]);var _0x588edf={'where':_0x1fa725['where']};return db[_0x5267('0x2a')]['count'](_0x588edf)[_0x5267('0x25')](function(_0x1cf94a){_0x59b091[_0x5267('0x1e')]=_0x1cf94a;if(_0xbe7922[_0x5267('0x30')][_0x5267('0x3e')]){_0x1fa725[_0x5267('0x3f')]=[{'all':!![]}];}return db[_0x5267('0x2a')]['findAll'](_0x1fa725);})['then'](function(_0x28ea4a){_0x59b091['rows']=_0x28ea4a;return _0x59b091;})[_0x5267('0x25')](respondWithFilteredResult(_0x3ef2a8,_0x1fa725))[_0x5267('0x40')](handleError(_0x3ef2a8,null));};exports['show']=function(_0x1fa925,_0xc764cd){var _0x299a13={'raw':!![],'where':{'id':_0x1fa925[_0x5267('0x41')]['id']}},_0x161fed={};_0x161fed[_0x5267('0x2f')]=_[_0x5267('0x31')](db[_0x5267('0x2a')][_0x5267('0x2b')]);_0x161fed['query']=_[_0x5267('0x31')](_0x1fa925[_0x5267('0x30')]);_0x161fed[_0x5267('0x39')]=_[_0x5267('0x32')](_0x161fed[_0x5267('0x2f')],_0x161fed['query']);_0x299a13[_0x5267('0x33')]=_['intersection'](_0x161fed[_0x5267('0x2f')],qs['fields'](_0x1fa925['query'][_0x5267('0x34')]));_0x299a13['attributes']=_0x299a13[_0x5267('0x33')][_0x5267('0x35')]?_0x299a13[_0x5267('0x33')]:_0x161fed[_0x5267('0x2f')];if(_0x1fa925['query'][_0x5267('0x3e')]){_0x299a13['include']=[{'all':!![]}];}_0x299a13=_['merge']({},_0x299a13,_0x1fa925[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x299a13)['then'](handleEntityNotFound(_0xc764cd,null))[_0x5267('0x25')](respondWithResult(_0xc764cd,null))[_0x5267('0x40')](handleError(_0xc764cd,null));};exports[_0x5267('0x42')]=function(_0x1b5a7e,_0x1c2803){return db[_0x5267('0x2a')][_0x5267('0x42')](_0x1b5a7e[_0x5267('0x43')],{})[_0x5267('0x25')](function(_0x2cfe09){var _0x21b040=_0x1b5a7e[_0x5267('0x44')][_0x5267('0x26')]({'plain':!![]});if(!_0x21b040)throw new Error(_0x5267('0x45'));if(_0x21b040['role']===_0x5267('0x44')){var _0x466d46=_0x2cfe09[_0x5267('0x26')]({'plain':!![]});var _0x4f0148=_0x5267('0x46');return db[_0x5267('0x47')][_0x5267('0x48')]({'where':{'name':_0x4f0148,'userProfileId':_0x21b040[_0x5267('0x49')]},'raw':!![]})[_0x5267('0x25')](function(_0x1457cf){if(_0x1457cf&&_0x1457cf['autoAssociation']===0x0){return db[_0x5267('0x4a')]['create']({'name':_0x466d46[_0x5267('0x28')],'resourceId':_0x466d46['id'],'type':_0x5267('0x27'),'sectionId':_0x1457cf['id']},{})[_0x5267('0x25')](function(){return _0x2cfe09;});}else{return _0x2cfe09;}})[_0x5267('0x40')](function(_0x91b932){logger[_0x5267('0x4b')](_0x5267('0x4c'),_0x91b932);throw _0x91b932;});}return _0x2cfe09;})['then'](respondWithResult(_0x1c2803,0xc9))['catch'](handleError(_0x1c2803,null));};exports[_0x5267('0x4d')]=function(_0x15b5c9,_0x566b6f){if(_0x15b5c9[_0x5267('0x43')]['id']){delete _0x15b5c9['body']['id'];}return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0x15b5c9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x566b6f,null))[_0x5267('0x25')](saveUpdates(_0x15b5c9[_0x5267('0x43')],null))[_0x5267('0x25')](respondWithResult(_0x566b6f,null))[_0x5267('0x40')](handleError(_0x566b6f,null));};exports[_0x5267('0x24')]=function(_0xf0b5a9,_0x43d254){return db['AnalyticDefaultReport'][_0x5267('0x48')]({'where':{'id':_0xf0b5a9[_0x5267('0x41')]['id']}})[_0x5267('0x25')](handleEntityNotFound(_0x43d254,null))[_0x5267('0x25')](removeEntity(_0x43d254,null))[_0x5267('0x40')](handleError(_0x43d254,null));};exports[_0x5267('0x4e')]=function(_0x552211,_0x195575){var _0x5ad1ce=0xa;var _0x1522d6=[_0x5267('0x4f'),_0x5267('0x50'),'right_join',_0x5267('0x51')];var _0x161dab={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x51220c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x4e3771=function(_0x489780){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),'IS\x20EMPTY',_0x5267('0x60')],_0x489780);};var _0xc88193=function(_0x293e61){if(!_0x293e61||!_0x293e61[_0x5267('0x61')]['length']){return'';}for(var _0x5a87b5='(',_0x540ab8=0x0;_0x540ab8<_0x293e61[_0x5267('0x61')][_0x5267('0x35')];_0x540ab8+=0x1){_0x540ab8>0x0&&(_0x5a87b5+='\x20'+_0x293e61[_0x5267('0x62')]+'\x20');_0x5a87b5+=_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]?_0xc88193(_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x63')]):_0x293e61[_0x5267('0x61')][_0x540ab8]['field']+'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x64')]+(_0x4e3771(_0x293e61['rules'][_0x540ab8][_0x5267('0x64')])?'\x20'+_0x293e61[_0x5267('0x61')][_0x540ab8][_0x5267('0x65')]:'');}return _0x5a87b5+')';};var _0x1b6dd7={'where':{'id':_0x552211[_0x5267('0x41')]['id']}},_0x19adf5,_0xde1ecd,_0x4915f4,_0x2ca259,_0x726410;_0x1b6dd7=_[_0x5267('0x3c')]({},_0x1b6dd7,_0x552211[_0x5267('0x3d')]);return db[_0x5267('0x2a')]['find'](_0x1b6dd7)[_0x5267('0x25')](function(_0x87465){if(_0x87465){_0x19adf5=_0x87465;return _0x87465[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x1a4016){if(_0x1a4016){if(!_0x1a4016[_0x5267('0x35')]){throw new db['Sequelize'][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0xde1ecd=_0x1a4016;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})['then'](function(_0x516e6e){if(_0x516e6e){_0x4915f4=_['keyBy'](_0x516e6e,'id');var _0x910f97;var _0x5cca85=squel[_0x5267('0x6b')]();_0x5cca85['from'](_0x19adf5[_0x5267('0x6c')]);for(var _0x1150ba=0x0;_0x1150ba<_0xde1ecd[_0x5267('0x35')];_0x1150ba+=0x1){_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x6d')]?_0x4915f4[_0xde1ecd[_0x1150ba][_0x5267('0x6d')]][_0x5267('0x6e')]:_0xde1ecd[_0x1150ba][_0x5267('0x6f')];_0x910f97=_0xde1ecd[_0x1150ba][_0x5267('0x70')]?_['replace'](_0x161dab[_0xde1ecd[_0x1150ba]['function']],'%s',_0x910f97):_0x910f97;_0x910f97=_0xde1ecd[_0x1150ba]['format']?_[_0x5267('0x71')](_0x51220c[_0xde1ecd[_0x1150ba][_0x5267('0x72')]],'%s',_0x910f97):_0x910f97;if(_0xde1ecd[_0x1150ba][_0x5267('0x73')]){_0x5cca85[_0x5267('0x63')](_0x910f97);}_0xde1ecd[_0x1150ba]['orderBy']&&_0x5cca85[_0x5267('0x74')](_0x910f97,_0xde1ecd[_0x1150ba][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x5cca85[_0x5267('0x6f')](_0x910f97,_0xde1ecd[_0x1150ba]['alias']||_0x910f97);}if(_0x19adf5[_0x5267('0x77')]){_0x19adf5[_0x5267('0x77')]=JSON['parse'](_0x19adf5[_0x5267('0x77')]);for(var _0x268805=0x0;_0x268805<_0x19adf5['joins']['length'];_0x268805+=0x1){if(_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x2d')]&&_['includes'](_0x1522d6,_0x19adf5['joins'][_0x268805][_0x5267('0x2d')])&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')]&&_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')]&&_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]){_0x5cca85[_0x19adf5[_0x5267('0x77')][_0x268805]['type']](_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x19adf5[_0x5267('0x6c')],_0x19adf5[_0x5267('0x77')][_0x268805][_0x5267('0x78')],_0x19adf5[_0x5267('0x77')][_0x268805]['foreignTable'],_0x19adf5['joins'][_0x268805][_0x5267('0x7a')]));}}}if(_0x19adf5[_0x5267('0x7c')]){_0x19adf5[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x19adf5['conditions']);_0x5cca85[_0x5267('0x38')](_0xc88193(_0x19adf5['conditions'][_0x5267('0x63')]));}_0x726410=_0x5cca85[_0x5267('0x7e')]();_0x5cca85[_0x5267('0x1d')](_0x5ad1ce);_0x5cca85[_0x5267('0x1b')](0x0);logger['debug']('Limited\x20Query:',_0x5cca85[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x5cca85[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')]['SELECT']});}})[_0x5267('0x25')](respondWithResult(_0x195575,null))['catch'](handleError(_0x195575,null));};function runReport(_0x418a03,_0x5b8026,_0x2c2b95){var _0x20888d=_0x5b8026[_0x5267('0x28')];var _0x87aa90=0xa;var _0x164cc1=[_0x5267('0x4f'),_0x5267('0x50'),_0x5267('0x82'),_0x5267('0x51')];var _0x28e4b6={'SUM':_0x5267('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':'MIN(%s)','AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0xd18795={'SEC_TO_TIME':_0x5267('0x83'),'DATE':_0x5267('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x2543a4=function(_0x2feea8){return!_[_0x5267('0x5d')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5267('0x84'),_0x5267('0x60')],_0x2feea8);};var _0x199ff6=function(_0xbf36fb){if(!_0xbf36fb||!_0xbf36fb['rules'][_0x5267('0x35')]){return'';}for(var _0x3cc775='(',_0x2630f2=0x0;_0x2630f2<_0xbf36fb[_0x5267('0x61')][_0x5267('0x35')];_0x2630f2+=0x1){_0x2630f2>0x0&&(_0x3cc775+='\x20'+_0xbf36fb[_0x5267('0x62')]+'\x20');_0x3cc775+=_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]?_0x199ff6(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x63')]):_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x6f')]+'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2]['condition']+(_0x2543a4(_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x64')])?'\x20'+_0xbf36fb[_0x5267('0x61')][_0x2630f2][_0x5267('0x65')]:'');}return _0x3cc775+')';};var _0x447b5f={'where':{'id':_0x418a03['id']}},_0x25ce90,_0x257c69,_0x160c9c,_0x42694a,_0x11a2f4;_0x447b5f=_[_0x5267('0x3c')]({},_0x447b5f,_0x2c2b95);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x447b5f)[_0x5267('0x25')](function(_0x35c3b7){if(_0x35c3b7){_0x25ce90=_0x35c3b7;return _0x35c3b7[_0x5267('0x66')]();}return null;})[_0x5267('0x25')](function(_0x35a4a3){if(_0x35a4a3){if(!_0x35a4a3[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))][(_0x5267('0x67'))](_0x5267('0x68'),0x193);}_0x257c69=_0x35a4a3;return db[_0x5267('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x318393){if(_0x318393){_0x160c9c=_[_0x5267('0x86')](_0x318393,'id');var _0x405eb4;var _0x38f5b7=squel['select']();_0x38f5b7[_0x5267('0x87')](_0x25ce90[_0x5267('0x6c')]);for(var _0x4c68cd=0x0;_0x4c68cd<_0x257c69['length'];_0x4c68cd+=0x1){_0x405eb4=_0x257c69[_0x4c68cd]['MetricId']?_0x160c9c[_0x257c69[_0x4c68cd][_0x5267('0x6d')]]['metric']:_0x257c69[_0x4c68cd][_0x5267('0x6f')];_0x405eb4=_0x257c69[_0x4c68cd]['function']?_['replace'](_0x28e4b6[_0x257c69[_0x4c68cd][_0x5267('0x70')]],'%s',_0x405eb4):_0x405eb4;_0x405eb4=_0x257c69[_0x4c68cd][_0x5267('0x72')]?_[_0x5267('0x71')](_0xd18795[_0x257c69[_0x4c68cd][_0x5267('0x72')]],'%s',_0x405eb4):_0x405eb4;if(_0x257c69[_0x4c68cd][_0x5267('0x73')]){_0x38f5b7['group'](_0x405eb4);}_0x257c69[_0x4c68cd]['orderBy']&&_0x38f5b7[_0x5267('0x74')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x38f5b7[_0x5267('0x6f')](_0x405eb4,_0x257c69[_0x4c68cd][_0x5267('0x88')]||_0x405eb4);}if(_0x25ce90['joins']){_0x25ce90[_0x5267('0x77')]=JSON['parse'](_0x25ce90['joins']);for(var _0x3dfd8d=0x0;_0x3dfd8d<_0x25ce90['joins']['length'];_0x3dfd8d+=0x1){if(_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x2d')]&&_['includes'](_0x164cc1,_0x25ce90['joins'][_0x3dfd8d]['type'])&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['parentKey']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable']&&_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x7a')]){_0x38f5b7[_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x2d')]](_0x25ce90[_0x5267('0x77')][_0x3dfd8d][_0x5267('0x79')],null,util[_0x5267('0x72')](_0x5267('0x7b'),_0x25ce90[_0x5267('0x6c')],_0x25ce90['joins'][_0x3dfd8d]['parentKey'],_0x25ce90[_0x5267('0x77')][_0x3dfd8d]['foreignTable'],_0x25ce90['joins'][_0x3dfd8d][_0x5267('0x7a')]));}}}if(_0x25ce90['conditions']){_0x25ce90[_0x5267('0x7c')]=JSON['parse'](_0x25ce90[_0x5267('0x7c')]);_0x38f5b7['where'](_0x199ff6(_0x25ce90[_0x5267('0x7c')][_0x5267('0x63')]));}_0x11a2f4=_0x38f5b7[_0x5267('0x7e')]();_0x38f5b7[_0x5267('0x1d')](_0x87aa90);_0x38f5b7[_0x5267('0x1b')](0x0);return;}})[_0x5267('0x25')](function(){if(_0x5b8026[_0x5267('0x89')]==='web'){return null;}var _0x4df99f=_[_0x5267('0x3c')](_0x5b8026,{'name':_0x5b8026['fullPath']||_0x5b8026['name']||_0x25ce90['name'],'basename':_0x20888d,'savename':util['format']('%s-%s.%s',_0x5b8026['name']||_0x25ce90[_0x5267('0x28')],require(_0x5267('0x8a'))[_0x5267('0x8b')](0x4),_0x5b8026[_0x5267('0x89')]||_0x5267('0x8c')),'reportId':_0x25ce90['id'],'reportType':_0x5267('0x8d')});return db[_0x5267('0x8e')][_0x5267('0x42')](_0x4df99f,{'raw':!![]});})['then'](function(_0x5df23d){if(_0x25ce90['table']===_0x5267('0x8f')){_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+_0x5267('0x90'),_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}else{_0x11a2f4[_0x5267('0x38')](_0x25ce90['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5b8026[_0x5267('0x91')],_0x5b8026[_0x5267('0x92')]);}if(_0x5df23d){logger[_0x5267('0x93')](_0x5267('0x94'),_0x11a2f4[_0x5267('0x7f')]());require(_0x5267('0x95'))[_0x5267('0x96')](path['join'](__dirname,'../../components/export/',_0x5df23d['output']),[_0x5df23d['id'],_0x11a2f4[_0x5267('0x7f')](),path[_0x5267('0x4f')](__dirname,_0x5267('0x97'),_0x5df23d[_0x5267('0x98')]),_0x20888d]);return _0x5df23d;}else{var _0x190ef4=squel[_0x5267('0x6b')]();_0x190ef4['from']('('+_0x11a2f4[_0x5267('0x7f')]()+')','countTable');_0x190ef4[_0x5267('0x6f')](_0x5267('0x99'),_0x5267('0x1e'));_0x11a2f4[_0x5267('0x1d')](_0x5b8026[_0x5267('0x1d')]||_0x87aa90);_0x11a2f4['offset'](_0x5b8026[_0x5267('0x1b')]||0x0);return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x190ef4['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5267('0x9a')]})[_0x5267('0x25')](function(_0x1be763){if(!_0x1be763[_0x5267('0x35')]){_0x42694a=0x0;}else{_0x42694a=_0x1be763[0x0]['count']||0x0;}return dbH['sequelize'][_0x5267('0x30')](_0x11a2f4[_0x5267('0x7f')](),{'type':dbH['sequelize'][_0x5267('0x81')][_0x5267('0x9a')]});})['then'](function(_0x5005b3){return{'rows':_0x5005b3||[],'count':_0x42694a};});}});}exports[_0x5267('0x9b')]=function(_0x11a6f4,_0x5a16ee){return runReport(_0x11a6f4[_0x5267('0x41')],_0x11a6f4[_0x5267('0x30')],_0x11a6f4[_0x5267('0x3d')])[_0x5267('0x25')](respondWithResult(_0x5a16ee,null))[_0x5267('0x40')](handleError(_0x5a16ee,null));};exports[_0x5267('0x9c')]=runReport;exports[_0x5267('0x30')]=function(_0x1e9651,_0x66da7a){var _0x54b582=0xa;var _0x4e4724=[_0x5267('0x4f'),'left_join',_0x5267('0x82'),_0x5267('0x51')];var _0x2722f9={'SUM':_0x5267('0x52'),'COUNT':_0x5267('0x53'),'COUNT DISTINCT':_0x5267('0x54'),'MAX':_0x5267('0x55'),'MIN':_0x5267('0x9d'),'AVG':_0x5267('0x56'),'GROUP_CONCAT':_0x5267('0x57'),'GROUP_CONCAT ASC':_0x5267('0x58'),'GROUP_CONCAT DESC':_0x5267('0x59')};var _0x5909b3={'SEC_TO_TIME':_0x5267('0x83'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x5267('0x5b'),'UNIX_TIMESTAMP':_0x5267('0x5c')};var _0x1d7987=function(_0x59efe1){return!_[_0x5267('0x5d')]([_0x5267('0x5e'),_0x5267('0x5f'),_0x5267('0x84'),_0x5267('0x60')],_0x59efe1);};var _0x46c79e=function(_0xcfba51){if(!_0xcfba51||!_0xcfba51[_0x5267('0x61')][_0x5267('0x35')]){return'';}for(var _0x3c5516='(',_0x1e8367=0x0;_0x1e8367<_0xcfba51[_0x5267('0x61')]['length'];_0x1e8367+=0x1){_0x1e8367>0x0&&(_0x3c5516+='\x20'+_0xcfba51[_0x5267('0x62')]+'\x20');_0x3c5516+=_0xcfba51[_0x5267('0x61')][_0x1e8367]['group']?_0x46c79e(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x63')]):_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x6f')]+'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x64')]+(_0x1d7987(_0xcfba51[_0x5267('0x61')][_0x1e8367][_0x5267('0x64')])?'\x20'+_0xcfba51['rules'][_0x1e8367][_0x5267('0x65')]:'');}return _0x3c5516+')';};var _0x19935d={'where':{'id':_0x1e9651[_0x5267('0x41')]['id']}},_0x3102e0,_0x2d215e,_0xc0af94,_0x178080,_0x3485ab;_0x19935d=_[_0x5267('0x3c')]({},_0x19935d,_0x1e9651['options']);return db[_0x5267('0x2a')][_0x5267('0x48')](_0x19935d)['then'](function(_0x17d2d4){if(_0x17d2d4){_0x3102e0=_0x17d2d4;return _0x17d2d4['getFields']();}return null;})[_0x5267('0x25')](function(_0x4c5a26){if(_0x4c5a26){if(!_0x4c5a26[_0x5267('0x35')]){throw new db[(_0x5267('0x85'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d215e=_0x4c5a26;return db[_0x5267('0x69')][_0x5267('0x6a')]({'raw':!![]});}return null;})[_0x5267('0x25')](function(_0x1a0883){if(_0x1a0883){_0xc0af94=_[_0x5267('0x86')](_0x1a0883,'id');var _0x501da6;var _0x3dcf73=squel['select']();_0x3dcf73['from'](_0x3102e0['table']);for(var _0x1ded05=0x0;_0x1ded05<_0x2d215e[_0x5267('0x35')];_0x1ded05+=0x1){_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x6d')]?_0xc0af94[_0x2d215e[_0x1ded05][_0x5267('0x6d')]][_0x5267('0x6e')]:_0x2d215e[_0x1ded05][_0x5267('0x6f')];_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x70')]?_['replace'](_0x2722f9[_0x2d215e[_0x1ded05]['function']],'%s',_0x501da6):_0x501da6;_0x501da6=_0x2d215e[_0x1ded05][_0x5267('0x72')]?_[_0x5267('0x71')](_0x5909b3[_0x2d215e[_0x1ded05][_0x5267('0x72')]],'%s',_0x501da6):_0x501da6;if(_0x2d215e[_0x1ded05][_0x5267('0x73')]){_0x3dcf73[_0x5267('0x63')](_0x501da6);}_0x2d215e[_0x1ded05]['orderBy']&&_0x3dcf73[_0x5267('0x74')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x75')]===_0x5267('0x76')?![]:!![]);_0x3dcf73[_0x5267('0x6f')](_0x501da6,_0x2d215e[_0x1ded05][_0x5267('0x88')]||_0x501da6);}if(_0x3102e0['joins']){_0x3102e0[_0x5267('0x77')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x77')]);for(var _0x4bfafd=0x0;_0x4bfafd<_0x3102e0[_0x5267('0x77')]['length'];_0x4bfafd+=0x1){if(_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]&&_['includes'](_0x4e4724,_0x3102e0[_0x5267('0x77')][_0x4bfafd]['type'])&&_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')]&&_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')]&&_0x3102e0[_0x5267('0x77')][_0x4bfafd]['foreignKey']){_0x3dcf73[_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x2d')]](_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x79')],null,util[_0x5267('0x72')]('%s.%s\x20=\x20%s.%s',_0x3102e0['table'],_0x3102e0[_0x5267('0x77')][_0x4bfafd][_0x5267('0x78')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x79')],_0x3102e0['joins'][_0x4bfafd][_0x5267('0x7a')]));}}}if(_0x3102e0[_0x5267('0x7c')]){_0x3102e0[_0x5267('0x7c')]=JSON[_0x5267('0x7d')](_0x3102e0[_0x5267('0x7c')]);_0x3dcf73[_0x5267('0x38')](_0x46c79e(_0x3102e0[_0x5267('0x7c')][_0x5267('0x63')]));}_0x3485ab=_0x3dcf73[_0x5267('0x7e')]();_0x3dcf73[_0x5267('0x1d')](_0x54b582);_0x3dcf73[_0x5267('0x1b')](0x0);logger[_0x5267('0x9e')]('Limited\x20Query:',_0x3dcf73[_0x5267('0x7f')]());return dbH[_0x5267('0x80')][_0x5267('0x30')](_0x3dcf73[_0x5267('0x7f')](),{'type':dbH[_0x5267('0x80')][_0x5267('0x81')][_0x5267('0x9a')]});}})[_0x5267('0x25')](function(){return{'sql':_0x3485ab[_0x5267('0x7f')]()};})[_0x5267('0x25')](respondWithResult(_0x66da7a,null))[_0x5267('0x40')](handleError(_0x66da7a,null));}; \ No newline at end of file +var _0x1967=['conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','table','web','%s-%s.%s','randomstring','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','select','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','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','DefaultReports','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey'];(function(_0x16b495,_0x2eedfb){var _0x2b0c87=function(_0xfbbf7e){while(--_0xfbbf7e){_0x16b495['push'](_0x16b495['shift']());}};_0x2b0c87(++_0x2eedfb);}(_0x1967,0x173));var _0x7196=function(_0x7e46a7,_0x51ed98){_0x7e46a7=_0x7e46a7-0x0;var _0x41aec6=_0x1967[_0x7e46a7];return _0x41aec6;};'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'];var dbH=require(_0x7196('0x1b'))[_0x7196('0x1c')];function respondWithStatusCode(_0xba707b,_0x154101){_0x154101=_0x154101||0xcc;return function(_0x4e8c4c){if(_0x4e8c4c){return _0xba707b[_0x7196('0x1d')](_0x154101);}return _0xba707b[_0x7196('0x1e')](_0x154101)[_0x7196('0x1f')]();};}function respondWithResult(_0xf098c1,_0x511aa1){_0x511aa1=_0x511aa1||0xc8;return function(_0x31c778){if(_0x31c778){return _0xf098c1['status'](_0x511aa1)[_0x7196('0x20')](_0x31c778);}};}function respondWithFilteredResult(_0x2590a6,_0xf7e97){return function(_0x3ed1ad){if(_0x3ed1ad){var _0x12dce7=typeof _0xf7e97[_0x7196('0x21')]===_0x7196('0x22')&&typeof _0xf7e97[_0x7196('0x23')]===_0x7196('0x22');var _0x32fe2b=_0x3ed1ad[_0x7196('0x24')];var _0x5b716a=_0x12dce7?0x0:_0xf7e97['offset'];var _0x448f13=_0x12dce7?_0x3ed1ad[_0x7196('0x24')]:_0xf7e97[_0x7196('0x21')]+_0xf7e97['limit'];var _0x39b944;if(_0x448f13>=_0x32fe2b){_0x448f13=_0x32fe2b;_0x39b944=0xc8;}else{_0x39b944=0xce;}_0x2590a6['status'](_0x39b944);return _0x2590a6['set'](_0x7196('0x25'),_0x5b716a+'-'+_0x448f13+'/'+_0x32fe2b)[_0x7196('0x20')](_0x3ed1ad);}return null;};}function patchUpdates(_0x8dee9d){return function(_0x4ddf78){try{jsonpatch['apply'](_0x4ddf78,_0x8dee9d,!![]);}catch(_0x38d291){return BPromise[_0x7196('0x26')](_0x38d291);}return _0x4ddf78['save']();};}function saveUpdates(_0x18649b,_0x27ff84){return function(_0x6e22e5){if(_0x6e22e5){return _0x6e22e5[_0x7196('0x27')](_0x18649b)[_0x7196('0x28')](function(_0x549f34){return _0x549f34;});}return null;};}function removeEntity(_0x3f8178,_0x520d01){return function(_0x3ce9a0){if(_0x3ce9a0){return _0x3ce9a0[_0x7196('0x29')]()[_0x7196('0x28')](function(){var _0xa69810=_0x3ce9a0[_0x7196('0x2a')]({'plain':!![]});var _0x43f6a2='DefaultReports';return db['UserProfileResource'][_0x7196('0x29')]({'where':{'type':_0x43f6a2,'resourceId':_0xa69810['id']}})[_0x7196('0x28')](function(){return _0x3ce9a0;});})[_0x7196('0x28')](function(){_0x3f8178['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41cfd2,_0x162cfc){return function(_0x675e64){if(!_0x675e64){_0x41cfd2['sendStatus'](0x194);}return _0x675e64;};}function handleError(_0x35eef9,_0x4ecea1){_0x4ecea1=_0x4ecea1||0x1f4;return function(_0x4fd339){logger['error'](_0x4fd339[_0x7196('0x2b')]);if(_0x4fd339[_0x7196('0x2c')]){delete _0x4fd339[_0x7196('0x2c')];}_0x35eef9['status'](_0x4ecea1)[_0x7196('0x2d')](_0x4fd339);};}exports[_0x7196('0x2e')]=function(_0x2f9583,_0xf999e9){var _0x50c386={},_0x39710d={},_0x429160={'count':0x0,'rows':[]};var _0xd07f22=_[_0x7196('0x2f')](db[_0x7196('0x30')][_0x7196('0x31')],function(_0x15c5f0){return{'name':_0x15c5f0[_0x7196('0x32')],'type':_0x15c5f0[_0x7196('0x33')][_0x7196('0x34')]};});_0x39710d[_0x7196('0x35')]=_['map'](_0xd07f22,_0x7196('0x2c'));_0x39710d['query']=_[_0x7196('0x36')](_0x2f9583['query']);_0x39710d[_0x7196('0x37')]=_[_0x7196('0x38')](_0x39710d['model'],_0x39710d[_0x7196('0x39')]);_0x50c386[_0x7196('0x3a')]=_[_0x7196('0x38')](_0x39710d[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x2f9583['query'][_0x7196('0x3b')]));_0x50c386[_0x7196('0x3a')]=_0x50c386[_0x7196('0x3a')][_0x7196('0x3c')]?_0x50c386[_0x7196('0x3a')]:_0x39710d[_0x7196('0x35')];if(!_0x2f9583['query'][_0x7196('0x3d')](_0x7196('0x3e'))){_0x50c386[_0x7196('0x23')]=qs['limit'](_0x2f9583[_0x7196('0x39')][_0x7196('0x23')]);_0x50c386[_0x7196('0x21')]=qs[_0x7196('0x21')](_0x2f9583[_0x7196('0x39')][_0x7196('0x21')]);}_0x50c386[_0x7196('0x3f')]=qs[_0x7196('0x40')](_0x2f9583[_0x7196('0x39')][_0x7196('0x40')]);_0x50c386['where']=qs[_0x7196('0x37')](_[_0x7196('0x41')](_0x2f9583['query'],_0x39710d[_0x7196('0x37')]),_0xd07f22);if(_0x2f9583['query']['filter']){_0x50c386[_0x7196('0x42')]=_[_0x7196('0x43')](_0x50c386['where'],{'$or':_['map'](_0xd07f22,function(_0x1bad95){if(_0x1bad95[_0x7196('0x33')]!==_0x7196('0x44')){var _0x4c2341={};_0x4c2341[_0x1bad95[_0x7196('0x2c')]]={'$like':'%'+_0x2f9583[_0x7196('0x39')][_0x7196('0x45')]+'%'};return _0x4c2341;}})});}_0x50c386=_[_0x7196('0x43')]({},_0x50c386,_0x2f9583[_0x7196('0x46')]);var _0x428d76={'where':_0x50c386[_0x7196('0x42')]};return db[_0x7196('0x30')]['count'](_0x428d76)[_0x7196('0x28')](function(_0xa852e1){_0x429160['count']=_0xa852e1;if(_0x2f9583[_0x7196('0x39')][_0x7196('0x47')]){_0x50c386['include']=[{'all':!![]}];}return db[_0x7196('0x30')][_0x7196('0x48')](_0x50c386);})[_0x7196('0x28')](function(_0x5749e2){_0x429160[_0x7196('0x49')]=_0x5749e2;return _0x429160;})[_0x7196('0x28')](respondWithFilteredResult(_0xf999e9,_0x50c386))['catch'](handleError(_0xf999e9,null));};exports[_0x7196('0x4a')]=function(_0x1a7052,_0x4f0c6c){var _0x335e6f={'raw':!![],'where':{'id':_0x1a7052['params']['id']}},_0x53a5e6={};_0x53a5e6['model']=_['keys'](db['AnalyticDefaultReport'][_0x7196('0x31')]);_0x53a5e6['query']=_[_0x7196('0x36')](_0x1a7052[_0x7196('0x39')]);_0x53a5e6[_0x7196('0x37')]=_[_0x7196('0x38')](_0x53a5e6['model'],_0x53a5e6[_0x7196('0x39')]);_0x335e6f['attributes']=_[_0x7196('0x38')](_0x53a5e6[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x1a7052['query'][_0x7196('0x3b')]));_0x335e6f[_0x7196('0x3a')]=_0x335e6f[_0x7196('0x3a')]['length']?_0x335e6f['attributes']:_0x53a5e6[_0x7196('0x35')];if(_0x1a7052['query'][_0x7196('0x47')]){_0x335e6f['include']=[{'all':!![]}];}_0x335e6f=_['merge']({},_0x335e6f,_0x1a7052[_0x7196('0x46')]);return db['AnalyticDefaultReport']['find'](_0x335e6f)['then'](handleEntityNotFound(_0x4f0c6c,null))[_0x7196('0x28')](respondWithResult(_0x4f0c6c,null))['catch'](handleError(_0x4f0c6c,null));};exports['create']=function(_0x28591e,_0x182c8b){return db[_0x7196('0x30')][_0x7196('0x4b')](_0x28591e['body'],{})[_0x7196('0x28')](function(_0x564688){var _0x36844f=_0x28591e[_0x7196('0x4c')]['get']({'plain':!![]});if(!_0x36844f)throw new Error(_0x7196('0x4d'));if(_0x36844f[_0x7196('0x4e')]===_0x7196('0x4c')){var _0x4fa18f=_0x564688[_0x7196('0x2a')]({'plain':!![]});var _0x5d51aa=_0x7196('0x4f');return db[_0x7196('0x50')][_0x7196('0x51')]({'where':{'name':_0x5d51aa,'userProfileId':_0x36844f[_0x7196('0x52')]},'raw':!![]})[_0x7196('0x28')](function(_0x19733a){if(_0x19733a&&_0x19733a[_0x7196('0x53')]===0x0){return db[_0x7196('0x54')]['create']({'name':_0x4fa18f['name'],'resourceId':_0x4fa18f['id'],'type':_0x7196('0x55'),'sectionId':_0x19733a['id']},{})[_0x7196('0x28')](function(){return _0x564688;});}else{return _0x564688;}})[_0x7196('0x56')](function(_0xe4b032){logger['error'](_0x7196('0x57'),_0xe4b032);throw _0xe4b032;});}return _0x564688;})[_0x7196('0x28')](respondWithResult(_0x182c8b,0xc9))[_0x7196('0x56')](handleError(_0x182c8b,null));};exports[_0x7196('0x27')]=function(_0x9fcfd4,_0x3177c2){if(_0x9fcfd4[_0x7196('0x58')]['id']){delete _0x9fcfd4[_0x7196('0x58')]['id'];}return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x9fcfd4[_0x7196('0x59')]['id']}})['then'](handleEntityNotFound(_0x3177c2,null))[_0x7196('0x28')](saveUpdates(_0x9fcfd4[_0x7196('0x58')],null))[_0x7196('0x28')](respondWithResult(_0x3177c2,null))['catch'](handleError(_0x3177c2,null));};exports[_0x7196('0x29')]=function(_0x5ca1ca,_0x34407d){return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x5ca1ca[_0x7196('0x59')]['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x34407d,null))['then'](removeEntity(_0x34407d,null))[_0x7196('0x56')](handleError(_0x34407d,null));};exports['preview']=function(_0x4be36d,_0x5b9824){var _0x1bc358=0xa;var _0x3be180=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x2d8b3d={'SUM':'SUM(%s)','COUNT':_0x7196('0x5e'),'COUNT DISTINCT':_0x7196('0x5f'),'MAX':_0x7196('0x60'),'MIN':_0x7196('0x61'),'AVG':_0x7196('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7196('0x63')};var _0x1c7eb2={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x43ee13=function(_0x13e9d0){return!_[_0x7196('0x69')]([_0x7196('0x6a'),'IS\x20NOT\x20NULL',_0x7196('0x6b'),_0x7196('0x6c')],_0x13e9d0);};var _0x27d5d7=function(_0x33f43b){if(!_0x33f43b||!_0x33f43b['rules'][_0x7196('0x3c')]){return'';}for(var _0x204c3a='(',_0x1f3acc=0x0;_0x1f3acc<_0x33f43b[_0x7196('0x6d')][_0x7196('0x3c')];_0x1f3acc+=0x1){_0x1f3acc>0x0&&(_0x204c3a+='\x20'+_0x33f43b[_0x7196('0x6e')]+'\x20');_0x204c3a+=_0x33f43b[_0x7196('0x6d')][_0x1f3acc]['group']?_0x27d5d7(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x6f')]):_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x70')]+'\x20'+_0x33f43b['rules'][_0x1f3acc][_0x7196('0x71')]+(_0x43ee13(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x71')])?'\x20'+_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x72')]:'');}return _0x204c3a+')';};var _0x37c6be={'where':{'id':_0x4be36d['params']['id']}},_0x57065,_0x517dfb,_0x56b2eb,_0x56955e,_0x72f6f1;_0x37c6be=_[_0x7196('0x43')]({},_0x37c6be,_0x4be36d[_0x7196('0x46')]);return db[_0x7196('0x30')][_0x7196('0x51')](_0x37c6be)[_0x7196('0x28')](function(_0x30d44f){if(_0x30d44f){_0x57065=_0x30d44f;return _0x30d44f[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x3881a5){if(_0x3881a5){if(!_0x3881a5['length']){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x517dfb=_0x3881a5;return db[_0x7196('0x76')][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x45e21f){if(_0x45e21f){_0x56b2eb=_[_0x7196('0x77')](_0x45e21f,'id');var _0x2f36f8;var _0x4cc5e3=squel['select']();_0x4cc5e3[_0x7196('0x78')](_0x57065['table']);for(var _0x30d114=0x0;_0x30d114<_0x517dfb['length'];_0x30d114+=0x1){_0x2f36f8=_0x517dfb[_0x30d114][_0x7196('0x79')]?_0x56b2eb[_0x517dfb[_0x30d114][_0x7196('0x79')]][_0x7196('0x7a')]:_0x517dfb[_0x30d114][_0x7196('0x70')];_0x2f36f8=_0x517dfb[_0x30d114]['function']?_['replace'](_0x2d8b3d[_0x517dfb[_0x30d114][_0x7196('0x7b')]],'%s',_0x2f36f8):_0x2f36f8;_0x2f36f8=_0x517dfb[_0x30d114]['format']?_[_0x7196('0x7c')](_0x1c7eb2[_0x517dfb[_0x30d114][_0x7196('0x7d')]],'%s',_0x2f36f8):_0x2f36f8;if(_0x517dfb[_0x30d114][_0x7196('0x7e')]){_0x4cc5e3[_0x7196('0x6f')](_0x2f36f8);}_0x517dfb[_0x30d114][_0x7196('0x7f')]&&_0x4cc5e3[_0x7196('0x3f')](_0x2f36f8,_0x517dfb[_0x30d114]['orderBy']===_0x7196('0x80')?![]:!![]);_0x4cc5e3[_0x7196('0x70')](_0x2f36f8,_0x517dfb[_0x30d114][_0x7196('0x81')]||_0x2f36f8);}if(_0x57065[_0x7196('0x82')]){_0x57065[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x82')]);for(var _0x473c0e=0x0;_0x473c0e<_0x57065[_0x7196('0x82')][_0x7196('0x3c')];_0x473c0e+=0x1){if(_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')]&&_['includes'](_0x3be180,_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')])&&_0x57065['joins'][_0x473c0e]['parentKey']&&_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')]&&_0x57065[_0x7196('0x82')][_0x473c0e]['foreignKey']){_0x4cc5e3[_0x57065[_0x7196('0x82')][_0x473c0e]['type']](_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],null,util['format'](_0x7196('0x85'),_0x57065['table'],_0x57065['joins'][_0x473c0e][_0x7196('0x86')],_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],_0x57065['joins'][_0x473c0e][_0x7196('0x87')]));}}}if(_0x57065['conditions']){_0x57065[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x88')]);_0x4cc5e3[_0x7196('0x42')](_0x27d5d7(_0x57065[_0x7196('0x88')]['group']));}_0x72f6f1=_0x4cc5e3[_0x7196('0x89')]();_0x4cc5e3[_0x7196('0x23')](_0x1bc358);_0x4cc5e3[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x4cc5e3[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x4cc5e3['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});}})[_0x7196('0x28')](respondWithResult(_0x5b9824,null))['catch'](handleError(_0x5b9824,null));};function runReport(_0x1364f5,_0x2cb53c,_0x4fe2cb){var _0x2e4807=_0x2cb53c['name'];var _0xd6d8cf=0xa;var _0x5318c1=[_0x7196('0x5a'),_0x7196('0x5b'),'right_join',_0x7196('0x5d')];var _0x2b52c0={'SUM':_0x7196('0x90'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7196('0x60'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0x509c4a={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x26048c=function(_0x1a4d17){return!_[_0x7196('0x69')]([_0x7196('0x6a'),_0x7196('0x93'),_0x7196('0x6b'),'IS\x20NOT\x20EMPTY'],_0x1a4d17);};var _0x5acff1=function(_0x32ab6c){if(!_0x32ab6c||!_0x32ab6c['rules']['length']){return'';}for(var _0x2bfdc4='(',_0x1604fa=0x0;_0x1604fa<_0x32ab6c[_0x7196('0x6d')][_0x7196('0x3c')];_0x1604fa+=0x1){_0x1604fa>0x0&&(_0x2bfdc4+='\x20'+_0x32ab6c['operator']+'\x20');_0x2bfdc4+=_0x32ab6c['rules'][_0x1604fa][_0x7196('0x6f')]?_0x5acff1(_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x6f')]):_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['field']+'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['condition']+(_0x26048c(_0x32ab6c['rules'][_0x1604fa][_0x7196('0x71')])?'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x72')]:'');}return _0x2bfdc4+')';};var _0x494418={'where':{'id':_0x1364f5['id']}},_0x400aa5,_0x40d4c3,_0x1824e2,_0x30c54b,_0x10712f;_0x494418=_[_0x7196('0x43')]({},_0x494418,_0x4fe2cb);return db[_0x7196('0x30')][_0x7196('0x51')](_0x494418)['then'](function(_0x9bd2ea){if(_0x9bd2ea){_0x400aa5=_0x9bd2ea;return _0x9bd2ea[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x408760){if(_0x408760){if(!_0x408760[_0x7196('0x3c')]){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x40d4c3=_0x408760;return db[_0x7196('0x76')]['findAll']({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x4b98de){if(_0x4b98de){_0x1824e2=_['keyBy'](_0x4b98de,'id');var _0x1dcf93;var _0x25d323=squel['select']();_0x25d323[_0x7196('0x78')](_0x400aa5[_0x7196('0x94')]);for(var _0x48ceda=0x0;_0x48ceda<_0x40d4c3[_0x7196('0x3c')];_0x48ceda+=0x1){_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x79')]?_0x1824e2[_0x40d4c3[_0x48ceda][_0x7196('0x79')]][_0x7196('0x7a')]:_0x40d4c3[_0x48ceda][_0x7196('0x70')];_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7b')]?_['replace'](_0x2b52c0[_0x40d4c3[_0x48ceda][_0x7196('0x7b')]],'%s',_0x1dcf93):_0x1dcf93;_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0x509c4a[_0x40d4c3[_0x48ceda]['format']],'%s',_0x1dcf93):_0x1dcf93;if(_0x40d4c3[_0x48ceda]['groupBy']){_0x25d323['group'](_0x1dcf93);}_0x40d4c3[_0x48ceda][_0x7196('0x7f')]&&_0x25d323[_0x7196('0x3f')](_0x1dcf93,_0x40d4c3[_0x48ceda][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x25d323[_0x7196('0x70')](_0x1dcf93,_0x40d4c3[_0x48ceda]['alias']||_0x1dcf93);}if(_0x400aa5[_0x7196('0x82')]){_0x400aa5['joins']=JSON[_0x7196('0x83')](_0x400aa5[_0x7196('0x82')]);for(var _0x33d5bf=0x0;_0x33d5bf<_0x400aa5[_0x7196('0x82')][_0x7196('0x3c')];_0x33d5bf+=0x1){if(_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x33')]&&_['includes'](_0x5318c1,_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type'])&&_0x400aa5['joins'][_0x33d5bf]['parentKey']&&_0x400aa5['joins'][_0x33d5bf]['foreignTable']&&_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]){_0x25d323[_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type']](_0x400aa5[_0x7196('0x82')][_0x33d5bf]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x400aa5[_0x7196('0x94')],_0x400aa5['joins'][_0x33d5bf][_0x7196('0x86')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x84')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]));}}}if(_0x400aa5[_0x7196('0x88')]){_0x400aa5[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x400aa5['conditions']);_0x25d323[_0x7196('0x42')](_0x5acff1(_0x400aa5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x10712f=_0x25d323['clone']();_0x25d323[_0x7196('0x23')](_0xd6d8cf);_0x25d323[_0x7196('0x21')](0x0);return;}})[_0x7196('0x28')](function(){if(_0x2cb53c['output']===_0x7196('0x95')){return null;}var _0x46a563=_[_0x7196('0x43')](_0x2cb53c,{'name':_0x2cb53c['fullPath']||_0x2cb53c[_0x7196('0x2c')]||_0x400aa5[_0x7196('0x2c')],'basename':_0x2e4807,'savename':util['format'](_0x7196('0x96'),_0x2cb53c['name']||_0x400aa5[_0x7196('0x2c')],require(_0x7196('0x97'))['generate'](0x4),_0x2cb53c[_0x7196('0x98')]||'csv'),'reportId':_0x400aa5['id'],'reportType':_0x7196('0x99')});return db[_0x7196('0x9a')][_0x7196('0x4b')](_0x46a563,{'raw':!![]});})['then'](function(_0xd9619d){if(_0x400aa5[_0x7196('0x94')]===_0x7196('0x9b')){_0x10712f[_0x7196('0x42')](_0x400aa5['table']+_0x7196('0x9c'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}else{_0x10712f['where'](_0x400aa5['table']+_0x7196('0x9f'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}if(_0xd9619d){logger[_0x7196('0xa0')]('Run\x20Query:',_0x10712f[_0x7196('0x8c')]());require('child_process')[_0x7196('0xa1')](path['join'](__dirname,_0x7196('0xa2'),_0xd9619d[_0x7196('0x98')]),[_0xd9619d['id'],_0x10712f[_0x7196('0x8c')](),path[_0x7196('0x5a')](__dirname,_0x7196('0xa3'),_0xd9619d[_0x7196('0xa4')]),_0x2e4807]);return _0xd9619d;}else{var _0x342fb1=squel['select']();_0x342fb1[_0x7196('0x78')]('('+_0x10712f[_0x7196('0x8c')]()+')',_0x7196('0xa5'));_0x342fb1[_0x7196('0x70')](_0x7196('0xa6'),_0x7196('0x24'));_0x10712f[_0x7196('0x23')](_0x2cb53c[_0x7196('0x23')]||_0xd6d8cf);_0x10712f['offset'](_0x2cb53c[_0x7196('0x21')]||0x0);return dbH[_0x7196('0x8d')]['query'](_0x342fb1[_0x7196('0x8c')](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]})[_0x7196('0x28')](function(_0xdf1ede){if(!_0xdf1ede[_0x7196('0x3c')]){_0x30c54b=0x0;}else{_0x30c54b=_0xdf1ede[0x0]['count']||0x0;}return dbH['sequelize'][_0x7196('0x39')](_0x10712f['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});})[_0x7196('0x28')](function(_0x2df80a){return{'rows':_0x2df80a||[],'count':_0x30c54b};});}});}exports['run']=function(_0x392e74,_0x17ba6d){return runReport(_0x392e74[_0x7196('0x59')],_0x392e74[_0x7196('0x39')],_0x392e74[_0x7196('0x46')])[_0x7196('0x28')](respondWithResult(_0x17ba6d,null))[_0x7196('0x56')](handleError(_0x17ba6d,null));};exports[_0x7196('0xa7')]=runReport;exports[_0x7196('0x39')]=function(_0x5a3c87,_0x58fb86){var _0x51da79=0xa;var _0x144613=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x9055af={'SUM':_0x7196('0x90'),'COUNT':_0x7196('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0xab9595={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':'HOUR(%s)','ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5236a0=function(_0x520fe8){return!_['includes'](['IS\x20NULL',_0x7196('0x93'),'IS\x20EMPTY',_0x7196('0x6c')],_0x520fe8);};var _0x425a57=function(_0x302728){if(!_0x302728||!_0x302728[_0x7196('0x6d')][_0x7196('0x3c')]){return'';}for(var _0x14492e='(',_0x58df43=0x0;_0x58df43<_0x302728[_0x7196('0x6d')][_0x7196('0x3c')];_0x58df43+=0x1){_0x58df43>0x0&&(_0x14492e+='\x20'+_0x302728[_0x7196('0x6e')]+'\x20');_0x14492e+=_0x302728['rules'][_0x58df43][_0x7196('0x6f')]?_0x425a57(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x6f')]):_0x302728['rules'][_0x58df43]['field']+'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')]+(_0x5236a0(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')])?'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x72')]:'');}return _0x14492e+')';};var _0x1a8a5a={'where':{'id':_0x5a3c87[_0x7196('0x59')]['id']}},_0x2944e5,_0x3f9385,_0xbd94ef,_0x5d2a56,_0x2fb552;_0x1a8a5a=_['merge']({},_0x1a8a5a,_0x5a3c87[_0x7196('0x46')]);return db[_0x7196('0x30')]['find'](_0x1a8a5a)[_0x7196('0x28')](function(_0x386259){if(_0x386259){_0x2944e5=_0x386259;return _0x386259[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x1e7a64){if(_0x1e7a64){if(!_0x1e7a64[_0x7196('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7196('0x75'),0x193);}_0x3f9385=_0x1e7a64;return db['AnalyticMetric'][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x30db09){if(_0x30db09){_0xbd94ef=_['keyBy'](_0x30db09,'id');var _0x4729e1;var _0x66e1e6=squel[_0x7196('0xa8')]();_0x66e1e6[_0x7196('0x78')](_0x2944e5[_0x7196('0x94')]);for(var _0x1e2105=0x0;_0x1e2105<_0x3f9385[_0x7196('0x3c')];_0x1e2105+=0x1){_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x79')]?_0xbd94ef[_0x3f9385[_0x1e2105][_0x7196('0x79')]]['metric']:_0x3f9385[_0x1e2105][_0x7196('0x70')];_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7b')]?_[_0x7196('0x7c')](_0x9055af[_0x3f9385[_0x1e2105][_0x7196('0x7b')]],'%s',_0x4729e1):_0x4729e1;_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0xab9595[_0x3f9385[_0x1e2105]['format']],'%s',_0x4729e1):_0x4729e1;if(_0x3f9385[_0x1e2105][_0x7196('0x7e')]){_0x66e1e6['group'](_0x4729e1);}_0x3f9385[_0x1e2105][_0x7196('0x7f')]&&_0x66e1e6[_0x7196('0x3f')](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x66e1e6['field'](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x81')]||_0x4729e1);}if(_0x2944e5[_0x7196('0x82')]){_0x2944e5[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x2944e5[_0x7196('0x82')]);for(var _0x220315=0x0;_0x220315<_0x2944e5[_0x7196('0x82')][_0x7196('0x3c')];_0x220315+=0x1){if(_0x2944e5['joins'][_0x220315][_0x7196('0x33')]&&_[_0x7196('0x69')](_0x144613,_0x2944e5['joins'][_0x220315][_0x7196('0x33')])&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')]&&_0x2944e5['joins'][_0x220315][_0x7196('0x84')]&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]){_0x66e1e6[_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x33')]](_0x2944e5['joins'][_0x220315]['foreignTable'],null,util[_0x7196('0x7d')](_0x7196('0x85'),_0x2944e5[_0x7196('0x94')],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')],_0x2944e5[_0x7196('0x82')][_0x220315]['foreignTable'],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]));}}}if(_0x2944e5[_0x7196('0x88')]){_0x2944e5[_0x7196('0x88')]=JSON['parse'](_0x2944e5[_0x7196('0x88')]);_0x66e1e6[_0x7196('0x42')](_0x425a57(_0x2944e5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x2fb552=_0x66e1e6[_0x7196('0x89')]();_0x66e1e6[_0x7196('0x23')](_0x51da79);_0x66e1e6[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x66e1e6[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x66e1e6['toString'](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]});}})['then'](function(){return{'sql':_0x2fb552[_0x7196('0x8c')]()};})['then'](respondWithResult(_0x58fb86,null))[_0x7196('0x56')](handleError(_0x58fb86,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 5f4bf5e..9dc04e8 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 _0xd336=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./analyticDefaultReport.attributes','AnalyticDefaultReport','lodash'];(function(_0x5da875,_0x475a8b){var _0x25d687=function(_0xb8a423){while(--_0xb8a423){_0x5da875['push'](_0x5da875['shift']());}};_0x25d687(++_0x475a8b);}(_0xd336,0x8b));var _0x6d33=function(_0x1e4f2d,_0x22e2bb){_0x1e4f2d=_0x1e4f2d-0x0;var _0xd05ce5=_0xd336[_0x1e4f2d];return _0xd05ce5;};'use strict';var _=require(_0x6d33('0x0'));var util=require(_0x6d33('0x1'));var logger=require(_0x6d33('0x2'))('api');var moment=require(_0x6d33('0x3'));var BPromise=require(_0x6d33('0x4'));var rp=require(_0x6d33('0x5'));var fs=require('fs');var path=require(_0x6d33('0x6'));var rimraf=require('rimraf');var config=require(_0x6d33('0x7'));var attributes=require(_0x6d33('0x8'));module['exports']=function(_0x413eff,_0x4bd62a){return _0x413eff['define'](_0x6d33('0x9'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3596=['moment','bluebird','path','rimraf','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','util','api'];(function(_0x10449b,_0xc645ce){var _0x333339=function(_0x4db72b){while(--_0x4db72b){_0x10449b['push'](_0x10449b['shift']());}};_0x333339(++_0xc645ce);}(_0x3596,0x8c));var _0x6359=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x3596[_0x173441];return _0x2423a8;};'use strict';var _=require(_0x6359('0x0'));var util=require(_0x6359('0x1'));var logger=require('../../config/logger')(_0x6359('0x2'));var moment=require(_0x6359('0x3'));var BPromise=require(_0x6359('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6359('0x5'));var rimraf=require(_0x6359('0x6'));var config=require('../../config/environment');var attributes=require(_0x6359('0x7'));module[_0x6359('0x8')]=function(_0x1c2afc,_0x36b6d0){return _0x1c2afc[_0x6359('0x9')]('AnalyticDefaultReport',attributes,{'tableName':_0x6359('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index c3ca34f..d6a0d84 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 _0x66a4=['catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','code','error','message','info','result'];(function(_0x4bda79,_0x23627a){var _0x36b69f=function(_0x217589){while(--_0x217589){_0x4bda79['push'](_0x4bda79['shift']());}};_0x36b69f(++_0x23627a);}(_0x66a4,0x85));var _0x466a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x66a4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x466a('0x0'));var util=require(_0x466a('0x1'));var moment=require(_0x466a('0x2'));var BPromise=require(_0x466a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x466a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x466a('0x5'))(_0x466a('0x6'));var config=require(_0x466a('0x7'));var jayson=require(_0x466a('0x8'));var client=jayson[_0x466a('0x9')][_0x466a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x44fbff,_0x483c4a,_0x39bcfb){return new BPromise(function(_0x2cb9c3,_0x49f698){return client[_0x466a('0xb')](_0x44fbff,_0x39bcfb)['then'](function(_0x533a04){logger['info'](_0x466a('0xc'),_0x483c4a,_0x466a('0xd'));logger[_0x466a('0xe')](_0x466a('0xf'),_0x483c4a,'request\x20sent',JSON['stringify'](_0x533a04));if(_0x533a04['error']){if(_0x533a04['error'][_0x466a('0x10')]===0x1f4){logger[_0x466a('0x11')](_0x466a('0xc'),_0x483c4a,_0x533a04['error'][_0x466a('0x12')]);return _0x49f698(_0x533a04['error'][_0x466a('0x12')]);}logger[_0x466a('0x11')](_0x466a('0xc'),_0x483c4a,_0x533a04['error'][_0x466a('0x12')]);return _0x2cb9c3(_0x533a04['error'][_0x466a('0x12')]);}else{logger[_0x466a('0x13')](_0x466a('0xc'),_0x483c4a,'request\x20sent');_0x2cb9c3(_0x533a04[_0x466a('0x14')][_0x466a('0x12')]);}})[_0x466a('0x15')](function(_0x58404b){logger[_0x466a('0x11')](_0x466a('0xc'),_0x483c4a,_0x58404b);_0x49f698(_0x58404b);});});} \ No newline at end of file +var _0x1df1=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticDefaultReport,\x20%s,\x20%s','result','catch','util','ioredis'];(function(_0x1ae976,_0x1ec9b8){var _0x43c3be=function(_0x5365d5){while(--_0x5365d5){_0x1ae976['push'](_0x1ae976['shift']());}};_0x43c3be(++_0x1ec9b8);}(_0x1df1,0x1f2));var _0x11df=function(_0x1e18c0,_0x44146e){_0x1e18c0=_0x1e18c0-0x0;var _0xdb46a2=_0x1df1[_0x1e18c0];return _0xdb46a2;};'use strict';var _=require('lodash');var util=require(_0x11df('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11df('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x11df('0x2'));var config=require(_0x11df('0x3'));var jayson=require(_0x11df('0x4'));var client=jayson[_0x11df('0x5')][_0x11df('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1b0785,_0x2d08b0,_0x4d7c83){return new BPromise(function(_0x4ea6c9,_0x1582c5){return client[_0x11df('0x7')](_0x1b0785,_0x4d7c83)[_0x11df('0x8')](function(_0x2bee7e){logger[_0x11df('0x9')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2d08b0,_0x11df('0xa'));logger[_0x11df('0xb')](_0x11df('0xc'),_0x2d08b0,_0x11df('0xa'),JSON[_0x11df('0xd')](_0x2bee7e));if(_0x2bee7e[_0x11df('0xe')]){if(_0x2bee7e[_0x11df('0xe')][_0x11df('0xf')]===0x1f4){logger[_0x11df('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x2d08b0,_0x2bee7e[_0x11df('0xe')][_0x11df('0x10')]);return _0x1582c5(_0x2bee7e[_0x11df('0xe')][_0x11df('0x10')]);}logger[_0x11df('0xe')](_0x11df('0x11'),_0x2d08b0,_0x2bee7e[_0x11df('0xe')][_0x11df('0x10')]);return _0x4ea6c9(_0x2bee7e[_0x11df('0xe')][_0x11df('0x10')]);}else{logger[_0x11df('0x9')](_0x11df('0x11'),_0x2d08b0,_0x11df('0xa'));_0x4ea6c9(_0x2bee7e[_0x11df('0x12')][_0x11df('0x10')]);}})[_0x11df('0x13')](function(_0x2289fc){logger[_0x11df('0xe')](_0x11df('0x11'),_0x2d08b0,_0x2289fc);_0x1582c5(_0x2289fc);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index bbb4196..59fd31c 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 _0x74f7=['show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','/:id','update','delete','destroy','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index'];(function(_0x42c576,_0x2b93de){var _0x4cb4e5=function(_0x4a2f71){while(--_0x4a2f71){_0x42c576['push'](_0x42c576['shift']());}};_0x4cb4e5(++_0x2b93de);}(_0x74f7,0xbd));var _0x774f=function(_0x5ee936,_0x5775c0){_0x5ee936=_0x5ee936-0x0;var _0x2cf998=_0x74f7[_0x5ee936];return _0x2cf998;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x774f('0x0'));var timeout=require(_0x774f('0x1'));var express=require(_0x774f('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x774f('0x3'));var config=require(_0x774f('0x4'));var controller=require(_0x774f('0x5'));router[_0x774f('0x6')]('/',auth[_0x774f('0x7')](),controller[_0x774f('0x8')]);router[_0x774f('0x6')]('/:id',auth[_0x774f('0x7')](),controller[_0x774f('0x9')]);router[_0x774f('0x6')](_0x774f('0xa'),auth[_0x774f('0x7')](),controller[_0x774f('0xb')]);router[_0x774f('0x6')](_0x774f('0xc'),auth[_0x774f('0x7')](),controller[_0x774f('0xd')]);router[_0x774f('0x6')](_0x774f('0xe'),auth[_0x774f('0x7')](),controller[_0x774f('0xf')]);router[_0x774f('0x10')]('/',auth[_0x774f('0x7')](),controller['create']);router[_0x774f('0x11')](_0x774f('0x12'),auth['isAuthenticated'](),controller[_0x774f('0x13')]);router[_0x774f('0x14')]('/:id',auth[_0x774f('0x7')](),controller[_0x774f('0x15')]);module['exports']=router; \ No newline at end of file +var _0x7f0d=['preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated','show'];(function(_0x49335f,_0x46042c){var _0x144233=function(_0x52534b){while(--_0x52534b){_0x49335f['push'](_0x49335f['shift']());}};_0x144233(++_0x46042c);}(_0x7f0d,0x113));var _0xd7f0=function(_0x4a20ae,_0x402a4e){_0x4a20ae=_0x4a20ae-0x0;var _0x2cc779=_0x7f0d[_0x4a20ae];return _0x2cc779;};'use strict';var multer=require(_0xd7f0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd7f0('0x1'));var express=require(_0xd7f0('0x2'));var router=express[_0xd7f0('0x3')]();var fs_extra=require(_0xd7f0('0x4'));var auth=require(_0xd7f0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xd7f0('0x6'));var controller=require(_0xd7f0('0x7'));router[_0xd7f0('0x8')]('/',auth['isAuthenticated'](),controller[_0xd7f0('0x9')]);router[_0xd7f0('0x8')](_0xd7f0('0xa'),auth[_0xd7f0('0xb')](),controller[_0xd7f0('0xc')]);router[_0xd7f0('0x8')]('/:id/preview',auth[_0xd7f0('0xb')](),controller[_0xd7f0('0xd')]);router[_0xd7f0('0x8')](_0xd7f0('0xe'),auth[_0xd7f0('0xb')](),controller[_0xd7f0('0xf')]);router['get'](_0xd7f0('0x10'),auth[_0xd7f0('0xb')](),controller[_0xd7f0('0x11')]);router[_0xd7f0('0x12')]('/',auth[_0xd7f0('0xb')](),controller[_0xd7f0('0x13')]);router[_0xd7f0('0x14')](_0xd7f0('0xa'),auth[_0xd7f0('0xb')](),controller[_0xd7f0('0x15')]);router[_0xd7f0('0x16')](_0xd7f0('0xa'),auth['isAuthenticated'](),controller[_0xd7f0('0x17')]);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 8b59b97..71b8f44 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 _0x4d1a=['sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled','INTEGER'];(function(_0x4ef205,_0x1ea546){var _0x3c70ce=function(_0x5d2031){while(--_0x5d2031){_0x4ef205['push'](_0x4ef205['shift']());}};_0x3c70ce(++_0x1ea546);}(_0x4d1a,0x82));var _0xa4d1=function(_0x1cfa5f,_0x3e9f58){_0x1cfa5f=_0x1cfa5f-0x0;var _0x2ffbc8=_0x4d1a[_0x1cfa5f];return _0x2ffbc8;};'use strict';var Sequelize=require(_0xa4d1('0x0'));var moment=require(_0xa4d1('0x1'));module[_0xa4d1('0x2')]={'name':{'type':Sequelize[_0xa4d1('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xa4d1('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xa4d1('0x4')](_0xa4d1('0x5'),_0xa4d1('0x6'),_0xa4d1('0x7')),'allowNull':![],'defaultValue':_0xa4d1('0x5')},'savename':{'type':Sequelize[_0xa4d1('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xa4d1('0x8')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':_0xa4d1('0x9')},'type':{'type':Sequelize[_0xa4d1('0x4')](_0xa4d1('0xa'),_0xa4d1('0xb')),'allowNull':![],'defaultValue':_0xa4d1('0xa')},'reportId':{'type':Sequelize[_0xa4d1('0xc')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3085=['xlsx','DATE','Loading','manual','scheduled','INTEGER','exports','STRING','ENUM','csv','pdf'];(function(_0x2df2d0,_0x1d6ea8){var _0x3c4438=function(_0x456da2){while(--_0x456da2){_0x2df2d0['push'](_0x2df2d0['shift']());}};_0x3c4438(++_0x1d6ea8);}(_0x3085,0x150));var _0x5308=function(_0x377666,_0x21ead1){_0x377666=_0x377666-0x0;var _0x3889c6=_0x3085[_0x377666];return _0x3889c6;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x5308('0x0')]={'name':{'type':Sequelize[_0x5308('0x1')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x5308('0x2')](_0x5308('0x3'),_0x5308('0x4'),_0x5308('0x5')),'allowNull':![],'defaultValue':_0x5308('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x5308('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x5308('0x1')],'defaultValue':_0x5308('0x7')},'type':{'type':Sequelize[_0x5308('0x2')](_0x5308('0x8'),_0x5308('0x9')),'allowNull':![],'defaultValue':_0x5308('0x8')},'reportId':{'type':Sequelize[_0x5308('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index a1dd985..95979f5 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 _0x81ab=['bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','then','ExtractedReports','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','include','catch','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','destroy','download','savename','output','existsSync','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','join','format','%s.%s','basename','toLowerCase','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x5b1b10,_0x127b8b){var _0x51eaf0=function(_0x56bcb7){while(--_0x56bcb7){_0x5b1b10['push'](_0x5b1b10['shift']());}};_0x51eaf0(++_0x127b8b);}(_0x81ab,0x174));var _0xb81a=function(_0xe8129c,_0x2fb03c){_0xe8129c=_0xe8129c-0x0;var _0x709fc5=_0x81ab[_0xe8129c];return _0x709fc5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb81a('0x0'));var zipdir=require(_0xb81a('0x1'));var jsonpatch=require(_0xb81a('0x2'));var rp=require('request-promise');var moment=require(_0xb81a('0x3'));var BPromise=require(_0xb81a('0x4'));var Mustache=require(_0xb81a('0x5'));var util=require(_0xb81a('0x6'));var path=require(_0xb81a('0x7'));var sox=require(_0xb81a('0x8'));var csv=require('to-csv');var ejs=require(_0xb81a('0x9'));var fs=require('fs');var fs_extra=require(_0xb81a('0xa'));var _=require(_0xb81a('0xb'));var squel=require(_0xb81a('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb81a('0xd'));var toCsv=require(_0xb81a('0xe'));var querystring=require(_0xb81a('0xf'));var Papa=require(_0xb81a('0x10'));var Redis=require(_0xb81a('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb81a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb81a('0x13'))(_0xb81a('0x14'));var utils=require(_0xb81a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb81a('0x16'));var db=require(_0xb81a('0x17'))['db'];function respondWithStatusCode(_0x349bd5,_0x1071e3){_0x1071e3=_0x1071e3||0xcc;return function(_0x1078c0){if(_0x1078c0){return _0x349bd5[_0xb81a('0x18')](_0x1071e3);}return _0x349bd5['status'](_0x1071e3)[_0xb81a('0x19')]();};}function respondWithResult(_0x1b6043,_0x1bed3b){_0x1bed3b=_0x1bed3b||0xc8;return function(_0xf27755){if(_0xf27755){return _0x1b6043[_0xb81a('0x1a')](_0x1bed3b)[_0xb81a('0x1b')](_0xf27755);}};}function respondWithFilteredResult(_0x280ef9,_0x27bdbe){return function(_0x534b6c){if(_0x534b6c){var _0x4ea148=typeof _0x27bdbe[_0xb81a('0x1c')]===_0xb81a('0x1d')&&typeof _0x27bdbe[_0xb81a('0x1e')]==='undefined';var _0x9843ab=_0x534b6c[_0xb81a('0x1f')];var _0x1f46ba=_0x4ea148?0x0:_0x27bdbe['offset'];var _0x4d34b4=_0x4ea148?_0x534b6c[_0xb81a('0x1f')]:_0x27bdbe[_0xb81a('0x1c')]+_0x27bdbe['limit'];var _0x547b58;if(_0x4d34b4>=_0x9843ab){_0x4d34b4=_0x9843ab;_0x547b58=0xc8;}else{_0x547b58=0xce;}_0x280ef9[_0xb81a('0x1a')](_0x547b58);return _0x280ef9[_0xb81a('0x20')](_0xb81a('0x21'),_0x1f46ba+'-'+_0x4d34b4+'/'+_0x9843ab)[_0xb81a('0x1b')](_0x534b6c);}return null;};}function patchUpdates(_0x134733){return function(_0x43d2e1){try{jsonpatch['apply'](_0x43d2e1,_0x134733,!![]);}catch(_0x5eec6e){return BPromise[_0xb81a('0x22')](_0x5eec6e);}return _0x43d2e1['save']();};}function saveUpdates(_0x44314c,_0x59f92d){return function(_0x5918b6){if(_0x5918b6){return _0x5918b6['update'](_0x44314c)[_0xb81a('0x23')](function(_0x550857){return _0x550857;});}return null;};}function removeEntity(_0x18b96a,_0x208342){return function(_0x3bf62e){if(_0x3bf62e){return _0x3bf62e['destroy']()[_0xb81a('0x23')](function(){var _0x31c3d=_0x3bf62e['get']({'plain':!![]});var _0x4e2690=_0xb81a('0x24');return db[_0xb81a('0x25')]['destroy']({'where':{'type':_0x4e2690,'resourceId':_0x31c3d['id']}})[_0xb81a('0x23')](function(){return _0x3bf62e;});})['then'](function(){_0x18b96a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ab819,_0x2139d5){return function(_0x4f0d57){if(!_0x4f0d57){_0x1ab819[_0xb81a('0x18')](0x194);}return _0x4f0d57;};}function handleError(_0x424d11,_0x24c236){_0x24c236=_0x24c236||0x1f4;return function(_0xff591){logger[_0xb81a('0x26')](_0xff591[_0xb81a('0x27')]);if(_0xff591[_0xb81a('0x28')]){delete _0xff591[_0xb81a('0x28')];}_0x424d11['status'](_0x24c236)[_0xb81a('0x29')](_0xff591);};}exports[_0xb81a('0x2a')]=function(_0xe15458,_0x5e0914){var _0xdd431f={},_0x5503c4={},_0x41984a={'count':0x0,'rows':[]};var _0x9aee22=_[_0xb81a('0x2b')](db[_0xb81a('0x2c')][_0xb81a('0x2d')],function(_0x1aa409){return{'name':_0x1aa409['fieldName'],'type':_0x1aa409[_0xb81a('0x2e')][_0xb81a('0x2f')]};});_0x5503c4[_0xb81a('0x30')]=_['map'](_0x9aee22,'name');_0x5503c4[_0xb81a('0x31')]=_[_0xb81a('0x32')](_0xe15458[_0xb81a('0x31')]);_0x5503c4['filters']=_[_0xb81a('0x33')](_0x5503c4[_0xb81a('0x30')],_0x5503c4[_0xb81a('0x31')]);_0xdd431f['attributes']=_['intersection'](_0x5503c4[_0xb81a('0x30')],qs[_0xb81a('0x34')](_0xe15458['query']['fields']));_0xdd431f[_0xb81a('0x35')]=_0xdd431f[_0xb81a('0x35')]['length']?_0xdd431f[_0xb81a('0x35')]:_0x5503c4[_0xb81a('0x30')];if(!_0xe15458['query'][_0xb81a('0x36')](_0xb81a('0x37'))){_0xdd431f[_0xb81a('0x1e')]=qs[_0xb81a('0x1e')](_0xe15458[_0xb81a('0x31')][_0xb81a('0x1e')]);_0xdd431f[_0xb81a('0x1c')]=qs[_0xb81a('0x1c')](_0xe15458[_0xb81a('0x31')][_0xb81a('0x1c')]);}_0xdd431f[_0xb81a('0x38')]=qs[_0xb81a('0x39')](_0xe15458[_0xb81a('0x31')][_0xb81a('0x39')]);_0xdd431f[_0xb81a('0x3a')]=qs[_0xb81a('0x3b')](_[_0xb81a('0x3c')](_0xe15458[_0xb81a('0x31')],_0x5503c4['filters']),_0x9aee22);if(_0xe15458[_0xb81a('0x31')][_0xb81a('0x3d')]){_0xdd431f[_0xb81a('0x3a')]=_[_0xb81a('0x3e')](_0xdd431f[_0xb81a('0x3a')],{'$or':_[_0xb81a('0x2b')](_0x9aee22,function(_0x1878c2){if(_0x1878c2[_0xb81a('0x2e')]!=='VIRTUAL'){var _0x3259e8={};_0x3259e8[_0x1878c2['name']]={'$like':'%'+_0xe15458[_0xb81a('0x31')]['filter']+'%'};return _0x3259e8;}})});}_0xdd431f=_[_0xb81a('0x3e')]({},_0xdd431f,_0xe15458['options']);var _0x859e17={'where':_0xdd431f[_0xb81a('0x3a')]};return db[_0xb81a('0x2c')][_0xb81a('0x1f')](_0x859e17)[_0xb81a('0x23')](function(_0x427457){_0x41984a[_0xb81a('0x1f')]=_0x427457;if(_0xe15458['query'][_0xb81a('0x3f')]){_0xdd431f[_0xb81a('0x40')]=[{'all':!![]}];}return db[_0xb81a('0x2c')]['findAll'](_0xdd431f);})['then'](function(_0x7263fa){_0x41984a['rows']=_0x7263fa;return _0x41984a;})['then'](respondWithFilteredResult(_0x5e0914,_0xdd431f))[_0xb81a('0x41')](handleError(_0x5e0914,null));};exports['show']=function(_0x339d54,_0x1ca587){var _0xb4ca37={'raw':!![],'where':{'id':_0x339d54[_0xb81a('0x42')]['id']}},_0x5f40cb={};_0x5f40cb['model']=_[_0xb81a('0x32')](db['AnalyticExtractedReport']['rawAttributes']);_0x5f40cb[_0xb81a('0x31')]=_[_0xb81a('0x32')](_0x339d54[_0xb81a('0x31')]);_0x5f40cb['filters']=_[_0xb81a('0x33')](_0x5f40cb[_0xb81a('0x30')],_0x5f40cb[_0xb81a('0x31')]);_0xb4ca37[_0xb81a('0x35')]=_[_0xb81a('0x33')](_0x5f40cb[_0xb81a('0x30')],qs[_0xb81a('0x34')](_0x339d54[_0xb81a('0x31')]['fields']));_0xb4ca37['attributes']=_0xb4ca37[_0xb81a('0x35')][_0xb81a('0x43')]?_0xb4ca37[_0xb81a('0x35')]:_0x5f40cb[_0xb81a('0x30')];if(_0x339d54[_0xb81a('0x31')][_0xb81a('0x3f')]){_0xb4ca37[_0xb81a('0x40')]=[{'all':!![]}];}_0xb4ca37=_[_0xb81a('0x3e')]({},_0xb4ca37,_0x339d54['options']);return db[_0xb81a('0x2c')][_0xb81a('0x44')](_0xb4ca37)[_0xb81a('0x23')](handleEntityNotFound(_0x1ca587,null))[_0xb81a('0x23')](respondWithResult(_0x1ca587,null))['catch'](handleError(_0x1ca587,null));};exports[_0xb81a('0x45')]=function(_0x29d1e8,_0x3bad21){return db[_0xb81a('0x2c')][_0xb81a('0x45')](_0x29d1e8['body'],{})['then'](function(_0x545509){var _0x5b27b0=_0x29d1e8['user']['get']({'plain':!![]});if(!_0x5b27b0)throw new Error(_0xb81a('0x46'));if(_0x5b27b0[_0xb81a('0x47')]===_0xb81a('0x48')){var _0x2f290f=_0x545509[_0xb81a('0x49')]({'plain':!![]});var _0x16dd83=_0xb81a('0x24');return db[_0xb81a('0x4a')][_0xb81a('0x44')]({'where':{'name':_0x16dd83,'userProfileId':_0x5b27b0[_0xb81a('0x4b')]},'raw':!![]})[_0xb81a('0x23')](function(_0x27852e){if(_0x27852e&&_0x27852e['autoAssociation']===0x0){return db[_0xb81a('0x25')][_0xb81a('0x45')]({'name':_0x2f290f['name'],'resourceId':_0x2f290f['id'],'type':_0x27852e[_0xb81a('0x28')],'sectionId':_0x27852e['id']},{})[_0xb81a('0x23')](function(){return _0x545509;});}else{return _0x545509;}})[_0xb81a('0x41')](function(_0xaad58e){logger['error'](_0xb81a('0x4c'),_0xaad58e);throw _0xaad58e;});}return _0x545509;})[_0xb81a('0x23')](respondWithResult(_0x3bad21,0xc9))[_0xb81a('0x41')](handleError(_0x3bad21,null));};exports[_0xb81a('0x4d')]=function(_0x1b16fe,_0x577e58){if(_0x1b16fe[_0xb81a('0x4e')]['id']){delete _0x1b16fe[_0xb81a('0x4e')]['id'];}return db[_0xb81a('0x2c')][_0xb81a('0x44')]({'where':{'id':_0x1b16fe[_0xb81a('0x42')]['id']}})[_0xb81a('0x23')](handleEntityNotFound(_0x577e58,null))['then'](saveUpdates(_0x1b16fe[_0xb81a('0x4e')],null))[_0xb81a('0x23')](respondWithResult(_0x577e58,null))[_0xb81a('0x41')](handleError(_0x577e58,null));};exports[_0xb81a('0x4f')]=function(_0x43a6d3,_0x9d176e){return db[_0xb81a('0x2c')][_0xb81a('0x44')]({'where':{'id':_0x43a6d3[_0xb81a('0x42')]['id']}})[_0xb81a('0x23')](handleEntityNotFound(_0x9d176e,null))['then'](removeEntity(_0x9d176e,null))[_0xb81a('0x41')](handleError(_0x9d176e,null));};exports[_0xb81a('0x50')]=function(_0x160eb1,_0x16d16c,_0x1617e1){return db[_0xb81a('0x2c')]['find']({'where':{'id':_0x160eb1['params']['id']},'attributes':['name','basename',_0xb81a('0x51'),_0xb81a('0x52')],'raw':!![]})[_0xb81a('0x23')](handleEntityNotFound(_0x16d16c,null))[_0xb81a('0x23')](function(_0x41c5ce){if(_0x41c5ce){if(!fs[_0xb81a('0x53')](path['join'](config[_0xb81a('0x54')],_0xb81a('0x55'),_0x41c5ce['savename']))){throw new db[(_0xb81a('0x56'))]['ValidationError'](_0xb81a('0x57'));}if(_0x160eb1[_0xb81a('0x31')][_0xb81a('0x58')]){return _0x16d16c[_0xb81a('0x18')](0xc8);}return _0x16d16c[_0xb81a('0x50')](path[_0xb81a('0x59')](config[_0xb81a('0x54')],_0xb81a('0x55'),_0x41c5ce['savename']),util[_0xb81a('0x5a')](_0xb81a('0x5b'),_0x41c5ce[_0xb81a('0x5c')]||_0x41c5ce[_0xb81a('0x28')],_0x41c5ce[_0xb81a('0x52')][_0xb81a('0x5d')]()));}})[_0xb81a('0x41')](handleError(_0x16d16c,null));}; \ No newline at end of file +var _0xdaf5=['sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','error','stack','name','send','index','map','AnalyticExtractedReport','fieldName','type','model','query','keys','attributes','intersection','fields','nolimit','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','rawAttributes','length','find','create','user','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','basename','savename','output','existsSync','join','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','server/files/reports','%s.%s','toLowerCase','eml-format','rimraf','fast-json-patch','moment','bluebird','path','sox','to-csv','squel','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'];(function(_0x59347a,_0x1dd138){var _0x487c22=function(_0x3a6fc7){while(--_0x3a6fc7){_0x59347a['push'](_0x59347a['shift']());}};_0x487c22(++_0x1dd138);}(_0xdaf5,0x1f0));var _0x5daf=function(_0x3fd66d,_0x410d26){_0x3fd66d=_0x3fd66d-0x0;var _0x5a6464=_0xdaf5[_0x3fd66d];return _0x5a6464;};'use strict';var emlformat=require(_0x5daf('0x0'));var rimraf=require(_0x5daf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5daf('0x2'));var rp=require('request-promise');var moment=require(_0x5daf('0x3'));var BPromise=require(_0x5daf('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5daf('0x5'));var sox=require(_0x5daf('0x6'));var csv=require(_0x5daf('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5daf('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5daf('0x9'));var toCsv=require(_0x5daf('0x7'));var querystring=require(_0x5daf('0xa'));var Papa=require(_0x5daf('0xb'));var Redis=require('ioredis');var authService=require(_0x5daf('0xc'));var qs=require(_0x5daf('0xd'));var as=require(_0x5daf('0xe'));var hardwareService=require(_0x5daf('0xf'));var logger=require(_0x5daf('0x10'))('api');var utils=require(_0x5daf('0x11'));var config=require(_0x5daf('0x12'));var licenseUtil=require(_0x5daf('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5cfda8,_0x33ba94){_0x33ba94=_0x33ba94||0xcc;return function(_0x99230d){if(_0x99230d){return _0x5cfda8[_0x5daf('0x14')](_0x33ba94);}return _0x5cfda8[_0x5daf('0x15')](_0x33ba94)[_0x5daf('0x16')]();};}function respondWithResult(_0x4fad4c,_0x37b59c){_0x37b59c=_0x37b59c||0xc8;return function(_0x6c8c7){if(_0x6c8c7){return _0x4fad4c[_0x5daf('0x15')](_0x37b59c)[_0x5daf('0x17')](_0x6c8c7);}};}function respondWithFilteredResult(_0x188385,_0x5ab418){return function(_0x4974a7){if(_0x4974a7){var _0x3e8684=typeof _0x5ab418[_0x5daf('0x18')]===_0x5daf('0x19')&&typeof _0x5ab418['limit']===_0x5daf('0x19');var _0x40f2f3=_0x4974a7[_0x5daf('0x1a')];var _0x4c9237=_0x3e8684?0x0:_0x5ab418['offset'];var _0x290fbe=_0x3e8684?_0x4974a7[_0x5daf('0x1a')]:_0x5ab418[_0x5daf('0x18')]+_0x5ab418[_0x5daf('0x1b')];var _0x5138bd;if(_0x290fbe>=_0x40f2f3){_0x290fbe=_0x40f2f3;_0x5138bd=0xc8;}else{_0x5138bd=0xce;}_0x188385[_0x5daf('0x15')](_0x5138bd);return _0x188385[_0x5daf('0x1c')](_0x5daf('0x1d'),_0x4c9237+'-'+_0x290fbe+'/'+_0x40f2f3)['json'](_0x4974a7);}return null;};}function patchUpdates(_0x2904d8){return function(_0x48af85){try{jsonpatch[_0x5daf('0x1e')](_0x48af85,_0x2904d8,!![]);}catch(_0x290673){return BPromise['reject'](_0x290673);}return _0x48af85[_0x5daf('0x1f')]();};}function saveUpdates(_0x223da0,_0x5e34f2){return function(_0x346585){if(_0x346585){return _0x346585['update'](_0x223da0)[_0x5daf('0x20')](function(_0x47efd0){return _0x47efd0;});}return null;};}function removeEntity(_0x4c5d0f,_0x186898){return function(_0x1483a6){if(_0x1483a6){return _0x1483a6[_0x5daf('0x21')]()[_0x5daf('0x20')](function(){var _0x29a43b=_0x1483a6[_0x5daf('0x22')]({'plain':!![]});var _0x27f06e='ExtractedReports';return db['UserProfileResource'][_0x5daf('0x21')]({'where':{'type':_0x27f06e,'resourceId':_0x29a43b['id']}})[_0x5daf('0x20')](function(){return _0x1483a6;});})[_0x5daf('0x20')](function(){_0x4c5d0f[_0x5daf('0x15')](0xcc)[_0x5daf('0x16')]();});}};}function handleEntityNotFound(_0x42d37b,_0x1a18af){return function(_0x52ce6d){if(!_0x52ce6d){_0x42d37b[_0x5daf('0x14')](0x194);}return _0x52ce6d;};}function handleError(_0x5550a3,_0x2ba8ee){_0x2ba8ee=_0x2ba8ee||0x1f4;return function(_0x32ccea){logger[_0x5daf('0x23')](_0x32ccea[_0x5daf('0x24')]);if(_0x32ccea[_0x5daf('0x25')]){delete _0x32ccea['name'];}_0x5550a3[_0x5daf('0x15')](_0x2ba8ee)[_0x5daf('0x26')](_0x32ccea);};}exports[_0x5daf('0x27')]=function(_0x52fa52,_0x1b5f69){var _0x4fbe3e={},_0x91d547={},_0x79d5a2={'count':0x0,'rows':[]};var _0xa0fd68=_[_0x5daf('0x28')](db[_0x5daf('0x29')]['rawAttributes'],function(_0x4875f8){return{'name':_0x4875f8[_0x5daf('0x2a')],'type':_0x4875f8[_0x5daf('0x2b')]['key']};});_0x91d547[_0x5daf('0x2c')]=_[_0x5daf('0x28')](_0xa0fd68,'name');_0x91d547[_0x5daf('0x2d')]=_[_0x5daf('0x2e')](_0x52fa52[_0x5daf('0x2d')]);_0x91d547['filters']=_['intersection'](_0x91d547[_0x5daf('0x2c')],_0x91d547[_0x5daf('0x2d')]);_0x4fbe3e[_0x5daf('0x2f')]=_[_0x5daf('0x30')](_0x91d547['model'],qs[_0x5daf('0x31')](_0x52fa52['query'][_0x5daf('0x31')]));_0x4fbe3e['attributes']=_0x4fbe3e[_0x5daf('0x2f')]['length']?_0x4fbe3e[_0x5daf('0x2f')]:_0x91d547[_0x5daf('0x2c')];if(!_0x52fa52[_0x5daf('0x2d')]['hasOwnProperty'](_0x5daf('0x32'))){_0x4fbe3e[_0x5daf('0x1b')]=qs[_0x5daf('0x1b')](_0x52fa52[_0x5daf('0x2d')][_0x5daf('0x1b')]);_0x4fbe3e['offset']=qs[_0x5daf('0x18')](_0x52fa52[_0x5daf('0x2d')][_0x5daf('0x18')]);}_0x4fbe3e['order']=qs['sort'](_0x52fa52[_0x5daf('0x2d')]['sort']);_0x4fbe3e[_0x5daf('0x33')]=qs[_0x5daf('0x34')](_[_0x5daf('0x35')](_0x52fa52[_0x5daf('0x2d')],_0x91d547['filters']),_0xa0fd68);if(_0x52fa52[_0x5daf('0x2d')][_0x5daf('0x36')]){_0x4fbe3e[_0x5daf('0x33')]=_[_0x5daf('0x37')](_0x4fbe3e[_0x5daf('0x33')],{'$or':_['map'](_0xa0fd68,function(_0x392220){if(_0x392220[_0x5daf('0x2b')]!==_0x5daf('0x38')){var _0x136766={};_0x136766[_0x392220[_0x5daf('0x25')]]={'$like':'%'+_0x52fa52[_0x5daf('0x2d')][_0x5daf('0x36')]+'%'};return _0x136766;}})});}_0x4fbe3e=_[_0x5daf('0x37')]({},_0x4fbe3e,_0x52fa52[_0x5daf('0x39')]);var _0x4009af={'where':_0x4fbe3e[_0x5daf('0x33')]};return db['AnalyticExtractedReport']['count'](_0x4009af)[_0x5daf('0x20')](function(_0x4a8c47){_0x79d5a2[_0x5daf('0x1a')]=_0x4a8c47;if(_0x52fa52[_0x5daf('0x2d')][_0x5daf('0x3a')]){_0x4fbe3e['include']=[{'all':!![]}];}return db[_0x5daf('0x29')]['findAll'](_0x4fbe3e);})[_0x5daf('0x20')](function(_0x50ecd9){_0x79d5a2[_0x5daf('0x3b')]=_0x50ecd9;return _0x79d5a2;})[_0x5daf('0x20')](respondWithFilteredResult(_0x1b5f69,_0x4fbe3e))[_0x5daf('0x3c')](handleError(_0x1b5f69,null));};exports['show']=function(_0xa03280,_0x8c3f25){var _0x3514cb={'raw':!![],'where':{'id':_0xa03280[_0x5daf('0x3d')]['id']}},_0x3353a0={};_0x3353a0['model']=_[_0x5daf('0x2e')](db['AnalyticExtractedReport'][_0x5daf('0x3e')]);_0x3353a0[_0x5daf('0x2d')]=_['keys'](_0xa03280[_0x5daf('0x2d')]);_0x3353a0[_0x5daf('0x34')]=_['intersection'](_0x3353a0[_0x5daf('0x2c')],_0x3353a0[_0x5daf('0x2d')]);_0x3514cb[_0x5daf('0x2f')]=_[_0x5daf('0x30')](_0x3353a0[_0x5daf('0x2c')],qs[_0x5daf('0x31')](_0xa03280['query']['fields']));_0x3514cb[_0x5daf('0x2f')]=_0x3514cb[_0x5daf('0x2f')][_0x5daf('0x3f')]?_0x3514cb[_0x5daf('0x2f')]:_0x3353a0[_0x5daf('0x2c')];if(_0xa03280[_0x5daf('0x2d')]['includeAll']){_0x3514cb['include']=[{'all':!![]}];}_0x3514cb=_[_0x5daf('0x37')]({},_0x3514cb,_0xa03280[_0x5daf('0x39')]);return db[_0x5daf('0x29')][_0x5daf('0x40')](_0x3514cb)[_0x5daf('0x20')](handleEntityNotFound(_0x8c3f25,null))['then'](respondWithResult(_0x8c3f25,null))[_0x5daf('0x3c')](handleError(_0x8c3f25,null));};exports['create']=function(_0xbe692e,_0x2fee99){return db['AnalyticExtractedReport'][_0x5daf('0x41')](_0xbe692e['body'],{})[_0x5daf('0x20')](function(_0x1d534f){var _0x1783a6=_0xbe692e[_0x5daf('0x42')][_0x5daf('0x22')]({'plain':!![]});if(!_0x1783a6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1783a6['role']===_0x5daf('0x42')){var _0x101bcc=_0x1d534f[_0x5daf('0x22')]({'plain':!![]});var _0x2d6e71=_0x5daf('0x43');return db[_0x5daf('0x44')][_0x5daf('0x40')]({'where':{'name':_0x2d6e71,'userProfileId':_0x1783a6[_0x5daf('0x45')]},'raw':!![]})[_0x5daf('0x20')](function(_0x2ebfb0){if(_0x2ebfb0&&_0x2ebfb0[_0x5daf('0x46')]===0x0){return db[_0x5daf('0x47')][_0x5daf('0x41')]({'name':_0x101bcc[_0x5daf('0x25')],'resourceId':_0x101bcc['id'],'type':_0x2ebfb0['name'],'sectionId':_0x2ebfb0['id']},{})['then'](function(){return _0x1d534f;});}else{return _0x1d534f;}})[_0x5daf('0x3c')](function(_0x24ab25){logger['error'](_0x5daf('0x48'),_0x24ab25);throw _0x24ab25;});}return _0x1d534f;})[_0x5daf('0x20')](respondWithResult(_0x2fee99,0xc9))[_0x5daf('0x3c')](handleError(_0x2fee99,null));};exports['update']=function(_0x20a312,_0xb79a82){if(_0x20a312[_0x5daf('0x49')]['id']){delete _0x20a312['body']['id'];}return db['AnalyticExtractedReport'][_0x5daf('0x40')]({'where':{'id':_0x20a312[_0x5daf('0x3d')]['id']}})[_0x5daf('0x20')](handleEntityNotFound(_0xb79a82,null))[_0x5daf('0x20')](saveUpdates(_0x20a312[_0x5daf('0x49')],null))['then'](respondWithResult(_0xb79a82,null))['catch'](handleError(_0xb79a82,null));};exports[_0x5daf('0x21')]=function(_0x739575,_0x56a892){return db['AnalyticExtractedReport'][_0x5daf('0x40')]({'where':{'id':_0x739575[_0x5daf('0x3d')]['id']}})['then'](handleEntityNotFound(_0x56a892,null))['then'](removeEntity(_0x56a892,null))[_0x5daf('0x3c')](handleError(_0x56a892,null));};exports['download']=function(_0x149bc7,_0x14bbe6,_0x4b3b7e){return db[_0x5daf('0x29')]['find']({'where':{'id':_0x149bc7[_0x5daf('0x3d')]['id']},'attributes':[_0x5daf('0x25'),_0x5daf('0x4a'),_0x5daf('0x4b'),_0x5daf('0x4c')],'raw':!![]})[_0x5daf('0x20')](handleEntityNotFound(_0x14bbe6,null))[_0x5daf('0x20')](function(_0x4a389b){if(_0x4a389b){if(!fs[_0x5daf('0x4d')](path[_0x5daf('0x4e')](config['root'],'server/files/reports',_0x4a389b[_0x5daf('0x4b')]))){throw new db['Sequelize'][(_0x5daf('0x4f'))](_0x5daf('0x50'));}if(_0x149bc7[_0x5daf('0x2d')][_0x5daf('0x51')]){return _0x14bbe6['sendStatus'](0xc8);}return _0x14bbe6[_0x5daf('0x52')](path[_0x5daf('0x4e')](config['root'],_0x5daf('0x53'),_0x4a389b[_0x5daf('0x4b')]),util['format'](_0x5daf('0x54'),_0x4a389b[_0x5daf('0x4a')]||_0x4a389b[_0x5daf('0x25')],_0x4a389b[_0x5daf('0x4c')][_0x5daf('0x55')]()));}})['catch'](handleError(_0x14bbe6,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index e11d2d1..b95f470 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 _0x8199=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util'];(function(_0x4ccc4b,_0x533a47){var _0x739005=function(_0x2515d3){while(--_0x2515d3){_0x4ccc4b['push'](_0x4ccc4b['shift']());}};_0x739005(++_0x533a47);}(_0x8199,0x1be));var _0x9819=function(_0x318e2a,_0x50e65d){_0x318e2a=_0x318e2a-0x0;var _0x111736=_0x8199[_0x318e2a];return _0x111736;};'use strict';var _=require(_0x9819('0x0'));var util=require(_0x9819('0x1'));var logger=require('../../config/logger')(_0x9819('0x2'));var moment=require(_0x9819('0x3'));var BPromise=require(_0x9819('0x4'));var rp=require(_0x9819('0x5'));var fs=require('fs');var path=require(_0x9819('0x6'));var rimraf=require(_0x9819('0x7'));var config=require(_0x9819('0x8'));var attributes=require(_0x9819('0x9'));module[_0x9819('0xa')]=function(_0x4e1624,_0x1593ca){return _0x4e1624[_0x9819('0xb')](_0x9819('0xc'),attributes,{'tableName':_0x9819('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c6c=['rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x297c55,_0x34fa75){var _0x120389=function(_0x595108){while(--_0x595108){_0x297c55['push'](_0x297c55['shift']());}};_0x120389(++_0x34fa75);}(_0x5c6c,0xf0));var _0xc5c6=function(_0x2e5ba9,_0x54115f){_0x2e5ba9=_0x2e5ba9-0x0;var _0x4c5488=_0x5c6c[_0x2e5ba9];return _0x4c5488;};'use strict';var _=require(_0xc5c6('0x0'));var util=require(_0xc5c6('0x1'));var logger=require(_0xc5c6('0x2'))(_0xc5c6('0x3'));var moment=require('moment');var BPromise=require(_0xc5c6('0x4'));var rp=require(_0xc5c6('0x5'));var fs=require('fs');var path=require(_0xc5c6('0x6'));var rimraf=require(_0xc5c6('0x7'));var config=require(_0xc5c6('0x8'));var attributes=require(_0xc5c6('0x9'));module[_0xc5c6('0xa')]=function(_0x483828,_0x2927b6){return _0x483828['define'](_0xc5c6('0xb'),attributes,{'tableName':_0xc5c6('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 061704f..b78c7f0 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 _0x21fd=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0x33c2c7,_0x31de52){var _0x220e88=function(_0x3f4722){while(--_0x3f4722){_0x33c2c7['push'](_0x33c2c7['shift']());}};_0x220e88(++_0x31de52);}(_0x21fd,0x1e2));var _0xd21f=function(_0x59e57a,_0x38b6b7){_0x59e57a=_0x59e57a-0x0;var _0x1b8f29=_0x21fd[_0x59e57a];return _0x1b8f29;};'use strict';var _=require(_0xd21f('0x0'));var util=require(_0xd21f('0x1'));var moment=require(_0xd21f('0x2'));var BPromise=require(_0xd21f('0x3'));var rs=require(_0xd21f('0x4'));var fs=require('fs');var Redis=require(_0xd21f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd21f('0x6'));var logger=require(_0xd21f('0x7'))('rpc');var config=require(_0xd21f('0x8'));var jayson=require(_0xd21f('0x9'));var client=jayson[_0xd21f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3aec4f,_0x1380c5,_0x3c74a2){return new BPromise(function(_0x245ab7,_0x3a2dfb){return client[_0xd21f('0xb')](_0x3aec4f,_0x3c74a2)[_0xd21f('0xc')](function(_0xcf4a59){logger[_0xd21f('0xd')](_0xd21f('0xe'),_0x1380c5,_0xd21f('0xf'));logger[_0xd21f('0x10')](_0xd21f('0x11'),_0x1380c5,_0xd21f('0xf'),JSON[_0xd21f('0x12')](_0xcf4a59));if(_0xcf4a59[_0xd21f('0x13')]){if(_0xcf4a59[_0xd21f('0x13')]['code']===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1380c5,_0xcf4a59[_0xd21f('0x13')][_0xd21f('0x14')]);return _0x3a2dfb(_0xcf4a59[_0xd21f('0x13')]['message']);}logger[_0xd21f('0x13')](_0xd21f('0xe'),_0x1380c5,_0xcf4a59[_0xd21f('0x13')]['message']);return _0x245ab7(_0xcf4a59[_0xd21f('0x13')]['message']);}else{logger['info'](_0xd21f('0xe'),_0x1380c5,_0xd21f('0xf'));_0x245ab7(_0xcf4a59[_0xd21f('0x15')][_0xd21f('0x14')]);}})[_0xd21f('0x16')](function(_0x144673){logger['error'](_0xd21f('0xe'),_0x1380c5,_0x144673);_0x3a2dfb(_0x144673);});});} \ No newline at end of file +var _0x8135=['util','moment','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','code','error','message','catch','lodash'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x8135,0x17b));var _0x5813=function(_0x59144a,_0x1d9de2){_0x59144a=_0x59144a-0x0;var _0x10f69f=_0x8135[_0x59144a];return _0x10f69f;};'use strict';var _=require(_0x5813('0x0'));var util=require(_0x5813('0x1'));var moment=require(_0x5813('0x2'));var BPromise=require(_0x5813('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5813('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5813('0x5'));var config=require(_0x5813('0x6'));var jayson=require(_0x5813('0x7'));var client=jayson[_0x5813('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17e6cb,_0x4b77b3,_0x4ec8dd){return new BPromise(function(_0x34f21d,_0x20ff48){return client[_0x5813('0x9')](_0x17e6cb,_0x4ec8dd)[_0x5813('0xa')](function(_0x2d8f1f){logger[_0x5813('0xb')](_0x5813('0xc'),_0x4b77b3,_0x5813('0xd'));logger[_0x5813('0xe')](_0x5813('0xf'),_0x4b77b3,'request\x20sent',JSON['stringify'](_0x2d8f1f));if(_0x2d8f1f['error']){if(_0x2d8f1f['error'][_0x5813('0x10')]===0x1f4){logger[_0x5813('0x11')](_0x5813('0xc'),_0x4b77b3,_0x2d8f1f['error'][_0x5813('0x12')]);return _0x20ff48(_0x2d8f1f[_0x5813('0x11')][_0x5813('0x12')]);}logger['error'](_0x5813('0xc'),_0x4b77b3,_0x2d8f1f[_0x5813('0x11')][_0x5813('0x12')]);return _0x34f21d(_0x2d8f1f[_0x5813('0x11')][_0x5813('0x12')]);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x4b77b3,_0x5813('0xd'));_0x34f21d(_0x2d8f1f['result'][_0x5813('0x12')]);}})[_0x5813('0x13')](function(_0x496012){logger['error'](_0x5813('0xc'),_0x4b77b3,_0x496012);_0x20ff48(_0x496012);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 1b7666e..ec2798b 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 _0x2461=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','put','/:id','delete','destroy'];(function(_0x3722bd,_0x1e1603){var _0x22221e=function(_0x51d82a){while(--_0x51d82a){_0x3722bd['push'](_0x3722bd['shift']());}};_0x22221e(++_0x1e1603);}(_0x2461,0x176));var _0x1246=function(_0x108244,_0x281704){_0x108244=_0x108244-0x0;var _0x50603c=_0x2461[_0x108244];return _0x50603c;};'use strict';var multer=require(_0x1246('0x0'));var util=require('util');var path=require(_0x1246('0x1'));var timeout=require(_0x1246('0x2'));var express=require(_0x1246('0x3'));var router=express[_0x1246('0x4')]();var fs_extra=require(_0x1246('0x5'));var auth=require(_0x1246('0x6'));var interaction=require(_0x1246('0x7'));var config=require(_0x1246('0x8'));var controller=require(_0x1246('0x9'));router[_0x1246('0xa')]('/',auth[_0x1246('0xb')](),controller[_0x1246('0xc')]);router[_0x1246('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x1246('0xd')]);router['get'](_0x1246('0xe'),auth[_0x1246('0xb')](),controller[_0x1246('0xf')]);router[_0x1246('0x10')]('/',auth[_0x1246('0xb')](),controller[_0x1246('0x11')]);router[_0x1246('0x12')](_0x1246('0x13'),auth[_0x1246('0xb')](),controller['update']);router[_0x1246('0x14')](_0x1246('0x13'),auth['isAuthenticated'](),controller[_0x1246('0x15')]);module['exports']=router; \ No newline at end of file +var _0x9e38=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','/:id','show','/:id/download','isAuthenticated','download','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x33155c,_0x3fdde1){var _0x5becf7=function(_0x2f7a2f){while(--_0x2f7a2f){_0x33155c['push'](_0x33155c['shift']());}};_0x5becf7(++_0x3fdde1);}(_0x9e38,0xb9));var _0x89e3=function(_0x1034bb,_0x4e20b3){_0x1034bb=_0x1034bb-0x0;var _0x453fdb=_0x9e38[_0x1034bb];return _0x453fdb;};'use strict';var multer=require(_0x89e3('0x0'));var util=require(_0x89e3('0x1'));var path=require(_0x89e3('0x2'));var timeout=require(_0x89e3('0x3'));var express=require(_0x89e3('0x4'));var router=express[_0x89e3('0x5')]();var fs_extra=require(_0x89e3('0x6'));var auth=require(_0x89e3('0x7'));var interaction=require(_0x89e3('0x8'));var config=require(_0x89e3('0x9'));var controller=require(_0x89e3('0xa'));router[_0x89e3('0xb')]('/',auth['isAuthenticated'](),controller[_0x89e3('0xc')]);router[_0x89e3('0xb')](_0x89e3('0xd'),auth['isAuthenticated'](),controller[_0x89e3('0xe')]);router['get'](_0x89e3('0xf'),auth[_0x89e3('0x10')](),controller[_0x89e3('0x11')]);router[_0x89e3('0x12')]('/',auth[_0x89e3('0x10')](),controller[_0x89e3('0x13')]);router[_0x89e3('0x14')](_0x89e3('0xd'),auth[_0x89e3('0x10')](),controller[_0x89e3('0x15')]);router[_0x89e3('0x16')](_0x89e3('0xd'),auth[_0x89e3('0x10')](),controller[_0x89e3('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 4e6455e..36a6a02 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 _0x10f0=['STRING','BOOLEAN','exports','TEXT'];(function(_0x2796f5,_0x1e6841){var _0x17632d=function(_0x40f2ee){while(--_0x40f2ee){_0x2796f5['push'](_0x2796f5['shift']());}};_0x17632d(++_0x1e6841);}(_0x10f0,0x11a));var _0x010f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x10f0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');module[_0x010f('0x0')]={'field':{'type':Sequelize[_0x010f('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x010f('0x2')]},'format':{'type':Sequelize[_0x010f('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x010f('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x215a=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x116e3b,_0x13f263){var _0x2d489d=function(_0x581316){while(--_0x581316){_0x116e3b['push'](_0x116e3b['shift']());}};_0x2d489d(++_0x13f263);}(_0x215a,0x1ac));var _0xa215=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x215a[_0x565ed7];return _0x183ad7;};'use strict';var Sequelize=require(_0xa215('0x0'));module[_0xa215('0x1')]={'field':{'type':Sequelize[_0xa215('0x2')]},'alias':{'type':Sequelize[_0xa215('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xa215('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xa215('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 91e0bb9..a82fcba 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 _0x2050=['Content-Range','apply','reject','update','destroy','then','error','name','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','intersection','includeAll','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','count','offset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2050,0x15e));var _0x0205=function(_0x3f5229,_0x360dfa){_0x3f5229=_0x3f5229-0x0;var _0x2fcb29=_0x2050[_0x3f5229];return _0x2fcb29;};'use strict';var emlformat=require(_0x0205('0x0'));var rimraf=require(_0x0205('0x1'));var zipdir=require(_0x0205('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0205('0x3'));var moment=require(_0x0205('0x4'));var BPromise=require(_0x0205('0x5'));var Mustache=require('mustache');var util=require(_0x0205('0x6'));var path=require(_0x0205('0x7'));var sox=require('sox');var csv=require(_0x0205('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0205('0x9'));var _=require(_0x0205('0xa'));var squel=require(_0x0205('0xb'));var crypto=require(_0x0205('0xc'));var jsforce=require(_0x0205('0xd'));var deskjs=require(_0x0205('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0205('0xf'));var Papa=require(_0x0205('0x10'));var Redis=require(_0x0205('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0205('0x12'));var as=require(_0x0205('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0205('0x14'))(_0x0205('0x15'));var utils=require('../../config/utils');var config=require(_0x0205('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0205('0x17'))['db'];function respondWithStatusCode(_0x638030,_0x13e5e4){_0x13e5e4=_0x13e5e4||0xcc;return function(_0x23e38f){if(_0x23e38f){return _0x638030[_0x0205('0x18')](_0x13e5e4);}return _0x638030[_0x0205('0x19')](_0x13e5e4)[_0x0205('0x1a')]();};}function respondWithResult(_0xede146,_0x5c8d8a){_0x5c8d8a=_0x5c8d8a||0xc8;return function(_0x4c4816){if(_0x4c4816){return _0xede146[_0x0205('0x19')](_0x5c8d8a)['json'](_0x4c4816);}};}function respondWithFilteredResult(_0x17e454,_0x1f66c0){return function(_0x376611){if(_0x376611){var _0x412abe=typeof _0x1f66c0['offset']===_0x0205('0x1b')&&typeof _0x1f66c0['limit']===_0x0205('0x1b');var _0xddb3f6=_0x376611[_0x0205('0x1c')];var _0x16af40=_0x412abe?0x0:_0x1f66c0[_0x0205('0x1d')];var _0x40a380=_0x412abe?_0x376611[_0x0205('0x1c')]:_0x1f66c0[_0x0205('0x1d')]+_0x1f66c0['limit'];var _0x147cb3;if(_0x40a380>=_0xddb3f6){_0x40a380=_0xddb3f6;_0x147cb3=0xc8;}else{_0x147cb3=0xce;}_0x17e454[_0x0205('0x19')](_0x147cb3);return _0x17e454['set'](_0x0205('0x1e'),_0x16af40+'-'+_0x40a380+'/'+_0xddb3f6)['json'](_0x376611);}return null;};}function patchUpdates(_0x520f81){return function(_0x342063){try{jsonpatch[_0x0205('0x1f')](_0x342063,_0x520f81,!![]);}catch(_0x5d9ba7){return BPromise[_0x0205('0x20')](_0x5d9ba7);}return _0x342063['save']();};}function saveUpdates(_0x19f880,_0x445b4c){return function(_0x3639fc){if(_0x3639fc){return _0x3639fc[_0x0205('0x21')](_0x19f880)['then'](function(_0x591aed){return _0x591aed;});}return null;};}function removeEntity(_0x29a22f,_0x7bfa64){return function(_0x540c62){if(_0x540c62){return _0x540c62[_0x0205('0x22')]()[_0x0205('0x23')](function(){_0x29a22f[_0x0205('0x19')](0xcc)[_0x0205('0x1a')]();});}};}function handleEntityNotFound(_0x2edc4c,_0x34975d){return function(_0x142c9f){if(!_0x142c9f){_0x2edc4c[_0x0205('0x18')](0x194);}return _0x142c9f;};}function handleError(_0x163089,_0x3f040a){_0x3f040a=_0x3f040a||0x1f4;return function(_0x2417ca){logger[_0x0205('0x24')](_0x2417ca['stack']);if(_0x2417ca[_0x0205('0x25')]){delete _0x2417ca[_0x0205('0x25')];}_0x163089[_0x0205('0x19')](_0x3f040a)['send'](_0x2417ca);};}exports['index']=function(_0x4e0e3f,_0x1460bb){var _0x310ed5={},_0x575679={},_0xf532f2={'count':0x0,'rows':[]};var _0x7c4c02=_['map'](db[_0x0205('0x26')][_0x0205('0x27')],function(_0x34dd74){return{'name':_0x34dd74[_0x0205('0x28')],'type':_0x34dd74[_0x0205('0x29')][_0x0205('0x2a')]};});_0x575679[_0x0205('0x2b')]=_['map'](_0x7c4c02,'name');_0x575679['query']=_[_0x0205('0x2c')](_0x4e0e3f['query']);_0x575679[_0x0205('0x2d')]=_['intersection'](_0x575679[_0x0205('0x2b')],_0x575679[_0x0205('0x2e')]);_0x310ed5[_0x0205('0x2f')]=_['intersection'](_0x575679[_0x0205('0x2b')],qs[_0x0205('0x30')](_0x4e0e3f[_0x0205('0x2e')][_0x0205('0x30')]));_0x310ed5[_0x0205('0x2f')]=_0x310ed5[_0x0205('0x2f')][_0x0205('0x31')]?_0x310ed5[_0x0205('0x2f')]:_0x575679[_0x0205('0x2b')];if(!_0x4e0e3f[_0x0205('0x2e')][_0x0205('0x32')](_0x0205('0x33'))){_0x310ed5[_0x0205('0x34')]=qs[_0x0205('0x34')](_0x4e0e3f[_0x0205('0x2e')][_0x0205('0x34')]);_0x310ed5[_0x0205('0x1d')]=qs[_0x0205('0x1d')](_0x4e0e3f[_0x0205('0x2e')][_0x0205('0x1d')]);}_0x310ed5[_0x0205('0x35')]=qs['sort'](_0x4e0e3f['query']['sort']);_0x310ed5[_0x0205('0x36')]=qs[_0x0205('0x2d')](_[_0x0205('0x37')](_0x4e0e3f[_0x0205('0x2e')],_0x575679[_0x0205('0x2d')]),_0x7c4c02);if(_0x4e0e3f[_0x0205('0x2e')][_0x0205('0x38')]){_0x310ed5['where']=_[_0x0205('0x39')](_0x310ed5['where'],{'$or':_['map'](_0x7c4c02,function(_0x3444d3){if(_0x3444d3[_0x0205('0x29')]!=='VIRTUAL'){var _0x35a570={};_0x35a570[_0x3444d3[_0x0205('0x25')]]={'$like':'%'+_0x4e0e3f[_0x0205('0x2e')][_0x0205('0x38')]+'%'};return _0x35a570;}})});}_0x310ed5=_[_0x0205('0x39')]({},_0x310ed5,_0x4e0e3f[_0x0205('0x3a')]);var _0xcad153={'where':_0x310ed5[_0x0205('0x36')]};return db[_0x0205('0x26')][_0x0205('0x1c')](_0xcad153)[_0x0205('0x23')](function(_0x1bf461){_0xf532f2[_0x0205('0x1c')]=_0x1bf461;if(_0x4e0e3f[_0x0205('0x2e')]['includeAll']){_0x310ed5[_0x0205('0x3b')]=[{'all':!![]}];}return db[_0x0205('0x26')][_0x0205('0x3c')](_0x310ed5);})[_0x0205('0x23')](function(_0x741a15){_0xf532f2[_0x0205('0x3d')]=_0x741a15;return _0xf532f2;})[_0x0205('0x23')](respondWithFilteredResult(_0x1460bb,_0x310ed5))[_0x0205('0x3e')](handleError(_0x1460bb,null));};exports[_0x0205('0x3f')]=function(_0x2ca4e6,_0x2a4b88){var _0x112276={'raw':![],'where':{'id':_0x2ca4e6[_0x0205('0x40')]['id']}},_0x5d0e00={};_0x5d0e00['model']=_[_0x0205('0x2c')](db[_0x0205('0x26')]['rawAttributes']);_0x5d0e00['query']=_[_0x0205('0x2c')](_0x2ca4e6[_0x0205('0x2e')]);_0x5d0e00['filters']=_[_0x0205('0x41')](_0x5d0e00[_0x0205('0x2b')],_0x5d0e00['query']);_0x112276[_0x0205('0x2f')]=_[_0x0205('0x41')](_0x5d0e00[_0x0205('0x2b')],qs[_0x0205('0x30')](_0x2ca4e6[_0x0205('0x2e')][_0x0205('0x30')]));_0x112276[_0x0205('0x2f')]=_0x112276[_0x0205('0x2f')][_0x0205('0x31')]?_0x112276[_0x0205('0x2f')]:_0x5d0e00[_0x0205('0x2b')];if(_0x2ca4e6[_0x0205('0x2e')][_0x0205('0x42')]){_0x112276[_0x0205('0x3b')]=[{'all':!![]}];}_0x112276=_['merge']({},_0x112276,_0x2ca4e6['options']);return db[_0x0205('0x26')][_0x0205('0x43')](_0x112276)[_0x0205('0x23')](handleEntityNotFound(_0x2a4b88,null))[_0x0205('0x23')](respondWithResult(_0x2a4b88,null))[_0x0205('0x3e')](handleError(_0x2a4b88,null));};exports[_0x0205('0x44')]=function(_0x15abd7,_0x194581){return db[_0x0205('0x26')][_0x0205('0x44')](_0x15abd7[_0x0205('0x45')],{})[_0x0205('0x23')](respondWithResult(_0x194581,0xc9))[_0x0205('0x3e')](handleError(_0x194581,null));};exports[_0x0205('0x46')]=function(_0x182d18,_0x174b89){return db[_0x0205('0x26')][_0x0205('0x46')](_0x182d18[_0x0205('0x45')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x174b89,0xc9))[_0x0205('0x3e')](handleError(_0x174b89,null));};exports[_0x0205('0x21')]=function(_0x2fa193,_0x52462c){if(_0x2fa193[_0x0205('0x45')]['id']){delete _0x2fa193[_0x0205('0x45')]['id'];}return db['AnalyticFieldReport']['find']({'where':{'id':_0x2fa193[_0x0205('0x40')]['id']}})[_0x0205('0x23')](handleEntityNotFound(_0x52462c,null))[_0x0205('0x23')](saveUpdates(_0x2fa193[_0x0205('0x45')],null))[_0x0205('0x23')](respondWithResult(_0x52462c,null))[_0x0205('0x3e')](handleError(_0x52462c,null));};exports[_0x0205('0x22')]=function(_0x351a1d,_0x29e8d8){return db['AnalyticFieldReport'][_0x0205('0x43')]({'where':{'id':_0x351a1d[_0x0205('0x40')]['id']}})[_0x0205('0x23')](handleEntityNotFound(_0x29e8d8,null))[_0x0205('0x23')](removeEntity(_0x29e8d8,null))['catch'](handleError(_0x29e8d8,null));};exports[_0x0205('0x47')]=function(_0x63f6fb,_0x1db79c){return db[_0x0205('0x26')]['destroy']({'where':{'id':_0x63f6fb[_0x0205('0x2e')][_0x0205('0x48')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x1db79c,0xcc))[_0x0205('0x3e')](handleError(_0x1db79c,null));};exports[_0x0205('0x49')]=function(_0x4fe0b2,_0x3a4ab3,_0xeddab5){return db[_0x0205('0x4a')]['findOne']({'where':{'id':_0x4fe0b2[_0x0205('0x40')]['id']}})[_0x0205('0x23')](handleEntityNotFound(_0x3a4ab3,null))[_0x0205('0x23')](function(_0x307b3d){if(_0x307b3d){return db[_0x0205('0x4b')]['transaction'](function(_0x43397e){return db['AnalyticFieldReport'][_0x0205('0x22')]({'where':{'CustomReportId':_0x4fe0b2[_0x0205('0x40')]['id']},'transaction':_0x43397e})[_0x0205('0x23')](function(_0x185b1e){var _0x4e0f76=_['map'](_0x4fe0b2['body'],function(_0x34ccc1){delete _0x34ccc1['id'];_0x34ccc1['CustomReportId']=_0x4fe0b2[_0x0205('0x40')]['id'];return _0x34ccc1;});return db[_0x0205('0x26')][_0x0205('0x46')](_0x4e0f76,{'transaction':_0x43397e});});})[_0x0205('0x23')](function(){return db[_0x0205('0x26')][_0x0205('0x3c')]({'where':{'CustomReportId':_0x4fe0b2[_0x0205('0x40')]['id']}});});}})[_0x0205('0x23')](respondWithResult(_0x3a4ab3,null))['catch'](handleError(_0x3a4ab3,null));}; \ No newline at end of file +var _0x75b8=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','end','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','destroy','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x4a9765,_0x323732){var _0x1c363c=function(_0x4667d8){while(--_0x4667d8){_0x4a9765['push'](_0x4a9765['shift']());}};_0x1c363c(++_0x323732);}(_0x75b8,0x9e));var _0x875b=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x75b8[_0x403c20];return _0x2b271a;};'use strict';var emlformat=require(_0x875b('0x0'));var rimraf=require(_0x875b('0x1'));var zipdir=require(_0x875b('0x2'));var jsonpatch=require(_0x875b('0x3'));var rp=require(_0x875b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x875b('0x5'));var util=require(_0x875b('0x6'));var path=require(_0x875b('0x7'));var sox=require(_0x875b('0x8'));var csv=require(_0x875b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x875b('0xa'));var _=require(_0x875b('0xb'));var squel=require(_0x875b('0xc'));var crypto=require(_0x875b('0xd'));var jsforce=require(_0x875b('0xe'));var deskjs=require(_0x875b('0xf'));var toCsv=require(_0x875b('0x9'));var querystring=require(_0x875b('0x10'));var Papa=require('papaparse');var Redis=require(_0x875b('0x11'));var authService=require(_0x875b('0x12'));var qs=require(_0x875b('0x13'));var as=require(_0x875b('0x14'));var hardwareService=require(_0x875b('0x15'));var logger=require(_0x875b('0x16'))(_0x875b('0x17'));var utils=require(_0x875b('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x875b('0x19'))['db'];function respondWithStatusCode(_0x496d5b,_0x4f9bcf){_0x4f9bcf=_0x4f9bcf||0xcc;return function(_0x1061c3){if(_0x1061c3){return _0x496d5b[_0x875b('0x1a')](_0x4f9bcf);}return _0x496d5b['status'](_0x4f9bcf)['end']();};}function respondWithResult(_0x115db0,_0x5f4402){_0x5f4402=_0x5f4402||0xc8;return function(_0x1d8847){if(_0x1d8847){return _0x115db0[_0x875b('0x1b')](_0x5f4402)[_0x875b('0x1c')](_0x1d8847);}};}function respondWithFilteredResult(_0x36b33c,_0x243438){return function(_0x30e766){if(_0x30e766){var _0x132950=typeof _0x243438[_0x875b('0x1d')]===_0x875b('0x1e')&&typeof _0x243438[_0x875b('0x1f')]==='undefined';var _0x5a645e=_0x30e766[_0x875b('0x20')];var _0x49d137=_0x132950?0x0:_0x243438['offset'];var _0x2b4ac5=_0x132950?_0x30e766[_0x875b('0x20')]:_0x243438[_0x875b('0x1d')]+_0x243438['limit'];var _0x2d34f3;if(_0x2b4ac5>=_0x5a645e){_0x2b4ac5=_0x5a645e;_0x2d34f3=0xc8;}else{_0x2d34f3=0xce;}_0x36b33c[_0x875b('0x1b')](_0x2d34f3);return _0x36b33c[_0x875b('0x21')](_0x875b('0x22'),_0x49d137+'-'+_0x2b4ac5+'/'+_0x5a645e)[_0x875b('0x1c')](_0x30e766);}return null;};}function patchUpdates(_0x1a6db1){return function(_0x5cb629){try{jsonpatch[_0x875b('0x23')](_0x5cb629,_0x1a6db1,!![]);}catch(_0x39d494){return BPromise['reject'](_0x39d494);}return _0x5cb629['save']();};}function saveUpdates(_0x28013f,_0x283655){return function(_0x26082d){if(_0x26082d){return _0x26082d[_0x875b('0x24')](_0x28013f)[_0x875b('0x25')](function(_0xa23638){return _0xa23638;});}return null;};}function removeEntity(_0xe6258e,_0x371381){return function(_0x2de15e){if(_0x2de15e){return _0x2de15e['destroy']()['then'](function(){_0xe6258e[_0x875b('0x1b')](0xcc)[_0x875b('0x26')]();});}};}function handleEntityNotFound(_0x1cdb7e,_0x1e83ac){return function(_0x2e6531){if(!_0x2e6531){_0x1cdb7e[_0x875b('0x1a')](0x194);}return _0x2e6531;};}function handleError(_0x1d933b,_0x2ab3bf){_0x2ab3bf=_0x2ab3bf||0x1f4;return function(_0x338384){logger['error'](_0x338384[_0x875b('0x27')]);if(_0x338384['name']){delete _0x338384[_0x875b('0x28')];}_0x1d933b[_0x875b('0x1b')](_0x2ab3bf)[_0x875b('0x29')](_0x338384);};}exports[_0x875b('0x2a')]=function(_0x5a9106,_0x276bea){var _0x48c128={},_0x22d332={},_0xd871ba={'count':0x0,'rows':[]};var _0x3815b4=_[_0x875b('0x2b')](db[_0x875b('0x2c')][_0x875b('0x2d')],function(_0x5d46c2){return{'name':_0x5d46c2[_0x875b('0x2e')],'type':_0x5d46c2[_0x875b('0x2f')][_0x875b('0x30')]};});_0x22d332[_0x875b('0x31')]=_[_0x875b('0x2b')](_0x3815b4,_0x875b('0x28'));_0x22d332[_0x875b('0x32')]=_[_0x875b('0x33')](_0x5a9106[_0x875b('0x32')]);_0x22d332[_0x875b('0x34')]=_[_0x875b('0x35')](_0x22d332[_0x875b('0x31')],_0x22d332[_0x875b('0x32')]);_0x48c128[_0x875b('0x36')]=_[_0x875b('0x35')](_0x22d332[_0x875b('0x31')],qs['fields'](_0x5a9106[_0x875b('0x32')][_0x875b('0x37')]));_0x48c128[_0x875b('0x36')]=_0x48c128[_0x875b('0x36')][_0x875b('0x38')]?_0x48c128[_0x875b('0x36')]:_0x22d332['model'];if(!_0x5a9106['query']['hasOwnProperty'](_0x875b('0x39'))){_0x48c128['limit']=qs[_0x875b('0x1f')](_0x5a9106[_0x875b('0x32')][_0x875b('0x1f')]);_0x48c128[_0x875b('0x1d')]=qs[_0x875b('0x1d')](_0x5a9106[_0x875b('0x32')][_0x875b('0x1d')]);}_0x48c128[_0x875b('0x3a')]=qs[_0x875b('0x3b')](_0x5a9106[_0x875b('0x32')][_0x875b('0x3b')]);_0x48c128[_0x875b('0x3c')]=qs[_0x875b('0x34')](_['pick'](_0x5a9106[_0x875b('0x32')],_0x22d332[_0x875b('0x34')]),_0x3815b4);if(_0x5a9106[_0x875b('0x32')][_0x875b('0x3d')]){_0x48c128[_0x875b('0x3c')]=_[_0x875b('0x3e')](_0x48c128[_0x875b('0x3c')],{'$or':_['map'](_0x3815b4,function(_0x3f1b30){if(_0x3f1b30['type']!==_0x875b('0x3f')){var _0x50c385={};_0x50c385[_0x3f1b30[_0x875b('0x28')]]={'$like':'%'+_0x5a9106[_0x875b('0x32')][_0x875b('0x3d')]+'%'};return _0x50c385;}})});}_0x48c128=_[_0x875b('0x3e')]({},_0x48c128,_0x5a9106[_0x875b('0x40')]);var _0x43c7a5={'where':_0x48c128['where']};return db[_0x875b('0x2c')][_0x875b('0x20')](_0x43c7a5)[_0x875b('0x25')](function(_0x4c0a26){_0xd871ba[_0x875b('0x20')]=_0x4c0a26;if(_0x5a9106[_0x875b('0x32')]['includeAll']){_0x48c128[_0x875b('0x41')]=[{'all':!![]}];}return db[_0x875b('0x2c')][_0x875b('0x42')](_0x48c128);})[_0x875b('0x25')](function(_0x16008a){_0xd871ba[_0x875b('0x43')]=_0x16008a;return _0xd871ba;})['then'](respondWithFilteredResult(_0x276bea,_0x48c128))[_0x875b('0x44')](handleError(_0x276bea,null));};exports[_0x875b('0x45')]=function(_0xe23ee5,_0x2ac976){var _0x913fdb={'raw':![],'where':{'id':_0xe23ee5[_0x875b('0x46')]['id']}},_0x4a5a4d={};_0x4a5a4d[_0x875b('0x31')]=_[_0x875b('0x33')](db[_0x875b('0x2c')][_0x875b('0x2d')]);_0x4a5a4d[_0x875b('0x32')]=_[_0x875b('0x33')](_0xe23ee5[_0x875b('0x32')]);_0x4a5a4d['filters']=_[_0x875b('0x35')](_0x4a5a4d[_0x875b('0x31')],_0x4a5a4d[_0x875b('0x32')]);_0x913fdb[_0x875b('0x36')]=_['intersection'](_0x4a5a4d[_0x875b('0x31')],qs[_0x875b('0x37')](_0xe23ee5['query']['fields']));_0x913fdb[_0x875b('0x36')]=_0x913fdb['attributes'][_0x875b('0x38')]?_0x913fdb[_0x875b('0x36')]:_0x4a5a4d[_0x875b('0x31')];if(_0xe23ee5[_0x875b('0x32')][_0x875b('0x47')]){_0x913fdb['include']=[{'all':!![]}];}_0x913fdb=_[_0x875b('0x3e')]({},_0x913fdb,_0xe23ee5[_0x875b('0x40')]);return db['AnalyticFieldReport'][_0x875b('0x48')](_0x913fdb)[_0x875b('0x25')](handleEntityNotFound(_0x2ac976,null))[_0x875b('0x25')](respondWithResult(_0x2ac976,null))[_0x875b('0x44')](handleError(_0x2ac976,null));};exports[_0x875b('0x49')]=function(_0x277123,_0x5923d1){return db[_0x875b('0x2c')][_0x875b('0x49')](_0x277123[_0x875b('0x4a')],{})[_0x875b('0x25')](respondWithResult(_0x5923d1,0xc9))[_0x875b('0x44')](handleError(_0x5923d1,null));};exports['bulkCreate']=function(_0x3d36fb,_0x513f23){return db[_0x875b('0x2c')][_0x875b('0x4b')](_0x3d36fb[_0x875b('0x4a')],{'raw':![],'individualHooks':!![]})[_0x875b('0x25')](respondWithResult(_0x513f23,0xc9))['catch'](handleError(_0x513f23,null));};exports[_0x875b('0x24')]=function(_0x48e78b,_0x4b5ab6){if(_0x48e78b[_0x875b('0x4a')]['id']){delete _0x48e78b[_0x875b('0x4a')]['id'];}return db[_0x875b('0x2c')][_0x875b('0x48')]({'where':{'id':_0x48e78b[_0x875b('0x46')]['id']}})[_0x875b('0x25')](handleEntityNotFound(_0x4b5ab6,null))[_0x875b('0x25')](saveUpdates(_0x48e78b[_0x875b('0x4a')],null))['then'](respondWithResult(_0x4b5ab6,null))['catch'](handleError(_0x4b5ab6,null));};exports['destroy']=function(_0xab7327,_0x5d3b60){return db['AnalyticFieldReport'][_0x875b('0x48')]({'where':{'id':_0xab7327[_0x875b('0x46')]['id']}})[_0x875b('0x25')](handleEntityNotFound(_0x5d3b60,null))[_0x875b('0x25')](removeEntity(_0x5d3b60,null))[_0x875b('0x44')](handleError(_0x5d3b60,null));};exports[_0x875b('0x4c')]=function(_0x547aa5,_0x39cec0){return db[_0x875b('0x2c')]['destroy']({'where':{'id':_0x547aa5[_0x875b('0x32')][_0x875b('0x4d')]||[]},'raw':![],'individualHooks':!![]})[_0x875b('0x25')](respondWithResult(_0x39cec0,0xcc))[_0x875b('0x44')](handleError(_0x39cec0,null));};exports[_0x875b('0x4e')]=function(_0xbd5532,_0x1e2bbd,_0x13ff44){return db[_0x875b('0x4f')][_0x875b('0x50')]({'where':{'id':_0xbd5532[_0x875b('0x46')]['id']}})[_0x875b('0x25')](handleEntityNotFound(_0x1e2bbd,null))[_0x875b('0x25')](function(_0x20161f){if(_0x20161f){return db[_0x875b('0x51')][_0x875b('0x52')](function(_0x5b1461){return db['AnalyticFieldReport'][_0x875b('0x53')]({'where':{'CustomReportId':_0xbd5532[_0x875b('0x46')]['id']},'transaction':_0x5b1461})[_0x875b('0x25')](function(_0x3666cb){var _0x53f924=_[_0x875b('0x2b')](_0xbd5532[_0x875b('0x4a')],function(_0x30b611){delete _0x30b611['id'];_0x30b611[_0x875b('0x54')]=_0xbd5532[_0x875b('0x46')]['id'];return _0x30b611;});return db[_0x875b('0x2c')]['bulkCreate'](_0x53f924,{'transaction':_0x5b1461});});})[_0x875b('0x25')](function(){return db[_0x875b('0x2c')][_0x875b('0x42')]({'where':{'CustomReportId':_0xbd5532[_0x875b('0x46')]['id']}});});}})['then'](respondWithResult(_0x1e2bbd,null))['catch'](handleError(_0x1e2bbd,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 4ca080b..bc8093b 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 _0x4f61=['util','api','bluebird','request-promise','path','../../config/environment','exports','define','analytics_report_fields','lodash'];(function(_0x423e39,_0x25445e){var _0x4eb87a=function(_0x198fec){while(--_0x198fec){_0x423e39['push'](_0x423e39['shift']());}};_0x4eb87a(++_0x25445e);}(_0x4f61,0xb3));var _0x14f6=function(_0x46142d,_0x4114f9){_0x46142d=_0x46142d-0x0;var _0x14cea9=_0x4f61[_0x46142d];return _0x14cea9;};'use strict';var _=require(_0x14f6('0x0'));var util=require(_0x14f6('0x1'));var logger=require('../../config/logger')(_0x14f6('0x2'));var moment=require('moment');var BPromise=require(_0x14f6('0x3'));var rp=require(_0x14f6('0x4'));var fs=require('fs');var path=require(_0x14f6('0x5'));var rimraf=require('rimraf');var config=require(_0x14f6('0x6'));var attributes=require('./analyticFieldReport.attributes');module[_0x14f6('0x7')]=function(_0x4aeca3,_0x88261c){return _0x4aeca3[_0x14f6('0x8')]('AnalyticFieldReport',attributes,{'tableName':_0x14f6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9bec=['AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./analyticFieldReport.attributes','define'];(function(_0x4169d8,_0x3d7cd4){var _0x32084a=function(_0x5f59c6){while(--_0x5f59c6){_0x4169d8['push'](_0x4169d8['shift']());}};_0x32084a(++_0x3d7cd4);}(_0x9bec,0xda));var _0xc9be=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x9bec[_0xe73080];return _0x12cbc4;};'use strict';var _=require(_0xc9be('0x0'));var util=require(_0xc9be('0x1'));var logger=require(_0xc9be('0x2'))(_0xc9be('0x3'));var moment=require(_0xc9be('0x4'));var BPromise=require(_0xc9be('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc9be('0x6'));var rimraf=require(_0xc9be('0x7'));var config=require('../../config/environment');var attributes=require(_0xc9be('0x8'));module['exports']=function(_0x362b2b,_0x401a3c){return _0x362b2b[_0xc9be('0x9')](_0xc9be('0xa'),attributes,{'tableName':_0xc9be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 11ab91e..2092d02 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 _0x9177=['client','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3df550,_0x5ecd0d){var _0x3e6ffd=function(_0x1c7adb){while(--_0x1c7adb){_0x3df550['push'](_0x3df550['shift']());}};_0x3e6ffd(++_0x5ecd0d);}(_0x9177,0xe7));var _0x7917=function(_0x4ee9cd,_0xd375b0){_0x4ee9cd=_0x4ee9cd-0x0;var _0x328a5b=_0x9177[_0x4ee9cd];return _0x328a5b;};'use strict';var _=require('lodash');var util=require(_0x7917('0x0'));var moment=require(_0x7917('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7917('0x2'));var db=require(_0x7917('0x3'))['db'];var utils=require(_0x7917('0x4'));var logger=require(_0x7917('0x5'))(_0x7917('0x6'));var config=require(_0x7917('0x7'));var jayson=require(_0x7917('0x8'));var client=jayson[_0x7917('0x9')][_0x7917('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x539afe,_0x5cb4d0,_0x344f95){return new BPromise(function(_0x3ac655,_0x541a61){return client['request'](_0x539afe,_0x344f95)[_0x7917('0xb')](function(_0x4f35b4){logger[_0x7917('0xc')](_0x7917('0xd'),_0x5cb4d0,_0x7917('0xe'));logger['debug'](_0x7917('0xf'),_0x5cb4d0,'request\x20sent',JSON['stringify'](_0x4f35b4));if(_0x4f35b4['error']){if(_0x4f35b4[_0x7917('0x10')]['code']===0x1f4){logger['error'](_0x7917('0xd'),_0x5cb4d0,_0x4f35b4[_0x7917('0x10')][_0x7917('0x11')]);return _0x541a61(_0x4f35b4['error']['message']);}logger[_0x7917('0x10')](_0x7917('0xd'),_0x5cb4d0,_0x4f35b4[_0x7917('0x10')][_0x7917('0x11')]);return _0x3ac655(_0x4f35b4[_0x7917('0x10')][_0x7917('0x11')]);}else{logger['info'](_0x7917('0xd'),_0x5cb4d0,_0x7917('0xe'));_0x3ac655(_0x4f35b4[_0x7917('0x12')][_0x7917('0x11')]);}})[_0x7917('0x13')](function(_0x113ba3){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x5cb4d0,_0x113ba3);_0x541a61(_0x113ba3);});});} \ No newline at end of file +var _0x3242=['bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','message','AnalyticFieldReport,\x20%s,\x20%s','result','catch','lodash','util','moment'];(function(_0x45365d,_0x267e43){var _0x23a842=function(_0xc1e1ff){while(--_0xc1e1ff){_0x45365d['push'](_0x45365d['shift']());}};_0x23a842(++_0x267e43);}(_0x3242,0x105));var _0x2324=function(_0x5d8c33,_0x3017c8){_0x5d8c33=_0x5d8c33-0x0;var _0x4117b1=_0x3242[_0x5d8c33];return _0x4117b1;};'use strict';var _=require(_0x2324('0x0'));var util=require(_0x2324('0x1'));var moment=require(_0x2324('0x2'));var BPromise=require(_0x2324('0x3'));var rs=require(_0x2324('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2324('0x5'));var logger=require('../../config/logger')(_0x2324('0x6'));var config=require('../../config/environment');var jayson=require(_0x2324('0x7'));var client=jayson[_0x2324('0x8')][_0x2324('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4b618f,_0x23aa61,_0x4ee896){return new BPromise(function(_0x1788c1,_0x562749){return client[_0x2324('0xa')](_0x4b618f,_0x4ee896)[_0x2324('0xb')](function(_0x5622c9){logger[_0x2324('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x23aa61,'request\x20sent');logger[_0x2324('0xd')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x23aa61,_0x2324('0xe'),JSON[_0x2324('0xf')](_0x5622c9));if(_0x5622c9[_0x2324('0x10')]){if(_0x5622c9['error'][_0x2324('0x11')]===0x1f4){logger[_0x2324('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x23aa61,_0x5622c9[_0x2324('0x10')][_0x2324('0x12')]);return _0x562749(_0x5622c9[_0x2324('0x10')]['message']);}logger[_0x2324('0x10')](_0x2324('0x13'),_0x23aa61,_0x5622c9[_0x2324('0x10')][_0x2324('0x12')]);return _0x1788c1(_0x5622c9[_0x2324('0x10')][_0x2324('0x12')]);}else{logger[_0x2324('0xc')](_0x2324('0x13'),_0x23aa61,'request\x20sent');_0x1788c1(_0x5622c9[_0x2324('0x14')][_0x2324('0x12')]);}})[_0x2324('0x15')](function(_0x20e990){logger['error'](_0x2324('0x13'),_0x23aa61,_0x20e990);_0x562749(_0x20e990);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index bbd521d..dd57d2c 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(_0x51d0c8,_0x424307){var _0x9cc64c=function(_0x25af2e){while(--_0x25af2e){_0x51d0c8['push'](_0x51d0c8['shift']());}};_0x9cc64c(++_0x424307);}(_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('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(_0x1d6688,_0x1e887d){var _0xb94e97=function(_0x3658cd){while(--_0x3658cd){_0x1d6688['push'](_0x1d6688['shift']());}};_0xb94e97(++_0x1e887d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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 3969b83..05d476d 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 _0x594d=['STRING','TEXT','sequelize','name'];(function(_0x12ca5f,_0x223d98){var _0xfc3ae9=function(_0x1928fb){while(--_0x1928fb){_0x12ca5f['push'](_0x12ca5f['shift']());}};_0xfc3ae9(++_0x223d98);}(_0x594d,0x92));var _0xd594=function(_0x56f215,_0x391360){_0x56f215=_0x56f215-0x0;var _0x68e039=_0x594d[_0x56f215];return _0x68e039;};'use strict';var Sequelize=require(_0xd594('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd594('0x1')},'table':{'type':Sequelize[_0xd594('0x2')]},'metric':{'type':Sequelize[_0xd594('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2697=['exports','STRING','name','TEXT'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2697,0x120));var _0x7269=function(_0xdeefbd,_0x9e1b3d){_0xdeefbd=_0xdeefbd-0x0;var _0x4ff63f=_0x2697[_0xdeefbd];return _0x4ff63f;};'use strict';var Sequelize=require('sequelize');module[_0x7269('0x0')]={'name':{'type':Sequelize[_0x7269('0x1')],'allowNull':![],'unique':_0x7269('0x2')},'table':{'type':Sequelize[_0x7269('0x1')]},'metric':{'type':Sequelize[_0x7269('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 80e99e8..a89bf82 100644 --- a/server/api/analyticMetric/analyticMetric.controller.js +++ b/server/api/analyticMetric/analyticMetric.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdbf5=['../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','Content-Range','save','update','then','destroy','get','Metrics','UserProfileResource','end','error','name','send','index','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','AnalyticMetric','includeAll','include','findAll','rows','catch','show','keys','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x31fb35,_0x1854f8){var _0x5cad7a=function(_0x3ce198){while(--_0x3ce198){_0x31fb35['push'](_0x31fb35['shift']());}};_0x5cad7a(++_0x1854f8);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x5e866a,_0x536f8a){_0x5e866a=_0x5e866a-0x0;var _0x3e10a1=_0xdbf5[_0x5e866a];return _0x3e10a1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5dbf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5dbf('0x1'));var moment=require(_0x5dbf('0x2'));var BPromise=require(_0x5dbf('0x3'));var Mustache=require(_0x5dbf('0x4'));var util=require(_0x5dbf('0x5'));var path=require(_0x5dbf('0x6'));var sox=require(_0x5dbf('0x7'));var csv=require(_0x5dbf('0x8'));var ejs=require(_0x5dbf('0x9'));var fs=require('fs');var fs_extra=require(_0x5dbf('0xa'));var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5dbf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x182cec,_0x2bb7ed){_0x2bb7ed=_0x2bb7ed||0xcc;return function(_0x1453a9){if(_0x1453a9){return _0x182cec[_0x5dbf('0x16')](_0x2bb7ed);}return _0x182cec[_0x5dbf('0x17')](_0x2bb7ed)['end']();};}function respondWithResult(_0x4803ca,_0x2b4e1c){_0x2b4e1c=_0x2b4e1c||0xc8;return function(_0x3480c8){if(_0x3480c8){return _0x4803ca['status'](_0x2b4e1c)[_0x5dbf('0x18')](_0x3480c8);}};}function respondWithFilteredResult(_0x248e3c,_0x23f763){return function(_0x2dfa44){if(_0x2dfa44){var _0x181816=typeof _0x23f763[_0x5dbf('0x19')]===_0x5dbf('0x1a')&&typeof _0x23f763['limit']==='undefined';var _0x16dc82=_0x2dfa44[_0x5dbf('0x1b')];var _0x39c7aa=_0x181816?0x0:_0x23f763[_0x5dbf('0x19')];var _0x20c2b0=_0x181816?_0x2dfa44['count']:_0x23f763[_0x5dbf('0x19')]+_0x23f763['limit'];var _0x565efa;if(_0x20c2b0>=_0x16dc82){_0x20c2b0=_0x16dc82;_0x565efa=0xc8;}else{_0x565efa=0xce;}_0x248e3c['status'](_0x565efa);return _0x248e3c[_0x5dbf('0x1c')](_0x5dbf('0x1d'),_0x39c7aa+'-'+_0x20c2b0+'/'+_0x16dc82)[_0x5dbf('0x18')](_0x2dfa44);}return null;};}function patchUpdates(_0x2ab57c){return function(_0x1e3cce){try{jsonpatch['apply'](_0x1e3cce,_0x2ab57c,!![]);}catch(_0x2764ea){return BPromise['reject'](_0x2764ea);}return _0x1e3cce[_0x5dbf('0x1e')]();};}function saveUpdates(_0x11cc67,_0x14d133){return function(_0x43a612){if(_0x43a612){return _0x43a612[_0x5dbf('0x1f')](_0x11cc67)[_0x5dbf('0x20')](function(_0x58085e){return _0x58085e;});}return null;};}function removeEntity(_0x4027c3,_0x3e3a2d){return function(_0x2d3e1b){if(_0x2d3e1b){return _0x2d3e1b[_0x5dbf('0x21')]()[_0x5dbf('0x20')](function(){var _0x226b93=_0x2d3e1b[_0x5dbf('0x22')]({'plain':!![]});var _0x20ab1b=_0x5dbf('0x23');return db[_0x5dbf('0x24')][_0x5dbf('0x21')]({'where':{'type':_0x20ab1b,'resourceId':_0x226b93['id']}})[_0x5dbf('0x20')](function(){return _0x2d3e1b;});})[_0x5dbf('0x20')](function(){_0x4027c3[_0x5dbf('0x17')](0xcc)[_0x5dbf('0x25')]();});}};}function handleEntityNotFound(_0x17f135,_0x466985){return function(_0x3f8341){if(!_0x3f8341){_0x17f135[_0x5dbf('0x16')](0x194);}return _0x3f8341;};}function handleError(_0x22ec42,_0x6a9757){_0x6a9757=_0x6a9757||0x1f4;return function(_0x471027){logger[_0x5dbf('0x26')](_0x471027['stack']);if(_0x471027[_0x5dbf('0x27')]){delete _0x471027[_0x5dbf('0x27')];}_0x22ec42[_0x5dbf('0x17')](_0x6a9757)[_0x5dbf('0x28')](_0x471027);};}exports[_0x5dbf('0x29')]=function(_0x6a276d,_0x2a65c5){var _0x31d57a={},_0x406ce6={},_0x273b63={'count':0x0,'rows':[]};var _0x294dd7=_['map'](db['AnalyticMetric'][_0x5dbf('0x2a')],function(_0x19015a){return{'name':_0x19015a[_0x5dbf('0x2b')],'type':_0x19015a[_0x5dbf('0x2c')][_0x5dbf('0x2d')]};});_0x406ce6['model']=_['map'](_0x294dd7,_0x5dbf('0x27'));_0x406ce6[_0x5dbf('0x2e')]=_['keys'](_0x6a276d[_0x5dbf('0x2e')]);_0x406ce6[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0x406ce6[_0x5dbf('0x31')],_0x406ce6[_0x5dbf('0x2e')]);_0x31d57a['attributes']=_[_0x5dbf('0x30')](_0x406ce6[_0x5dbf('0x31')],qs[_0x5dbf('0x32')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x32')]));_0x31d57a['attributes']=_0x31d57a[_0x5dbf('0x33')][_0x5dbf('0x34')]?_0x31d57a[_0x5dbf('0x33')]:_0x406ce6[_0x5dbf('0x31')];if(!_0x6a276d['query'][_0x5dbf('0x35')](_0x5dbf('0x36'))){_0x31d57a[_0x5dbf('0x37')]=qs[_0x5dbf('0x37')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x37')]);_0x31d57a[_0x5dbf('0x19')]=qs[_0x5dbf('0x19')](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x19')]);}_0x31d57a[_0x5dbf('0x38')]=qs['sort'](_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x39')]);_0x31d57a[_0x5dbf('0x3a')]=qs['filters'](_[_0x5dbf('0x3b')](_0x6a276d[_0x5dbf('0x2e')],_0x406ce6[_0x5dbf('0x2f')]),_0x294dd7);if(_0x6a276d['query'][_0x5dbf('0x3c')]){_0x31d57a[_0x5dbf('0x3a')]=_[_0x5dbf('0x3d')](_0x31d57a['where'],{'$or':_[_0x5dbf('0x3e')](_0x294dd7,function(_0x29a62d){if(_0x29a62d[_0x5dbf('0x2c')]!==_0x5dbf('0x3f')){var _0x10537d={};_0x10537d[_0x29a62d[_0x5dbf('0x27')]]={'$like':'%'+_0x6a276d[_0x5dbf('0x2e')][_0x5dbf('0x3c')]+'%'};return _0x10537d;}})});}_0x31d57a=_['merge']({},_0x31d57a,_0x6a276d['options']);var _0x57ee72={'where':_0x31d57a['where']};return db[_0x5dbf('0x40')][_0x5dbf('0x1b')](_0x57ee72)['then'](function(_0x3ef0eb){_0x273b63[_0x5dbf('0x1b')]=_0x3ef0eb;if(_0x6a276d['query'][_0x5dbf('0x41')]){_0x31d57a[_0x5dbf('0x42')]=[{'all':!![]}];}return db[_0x5dbf('0x40')][_0x5dbf('0x43')](_0x31d57a);})[_0x5dbf('0x20')](function(_0x7c390d){_0x273b63[_0x5dbf('0x44')]=_0x7c390d;return _0x273b63;})[_0x5dbf('0x20')](respondWithFilteredResult(_0x2a65c5,_0x31d57a))[_0x5dbf('0x45')](handleError(_0x2a65c5,null));};exports[_0x5dbf('0x46')]=function(_0x50ac70,_0x78aef3){var _0x22f958={'raw':!![],'where':{'id':_0x50ac70['params']['id']}},_0xec1d28={};_0xec1d28[_0x5dbf('0x31')]=_[_0x5dbf('0x47')](db[_0x5dbf('0x40')][_0x5dbf('0x2a')]);_0xec1d28['query']=_[_0x5dbf('0x47')](_0x50ac70['query']);_0xec1d28[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0xec1d28[_0x5dbf('0x31')],_0xec1d28[_0x5dbf('0x2e')]);_0x22f958['attributes']=_['intersection'](_0xec1d28[_0x5dbf('0x31')],qs[_0x5dbf('0x32')](_0x50ac70[_0x5dbf('0x2e')]['fields']));_0x22f958[_0x5dbf('0x33')]=_0x22f958['attributes']['length']?_0x22f958['attributes']:_0xec1d28['model'];if(_0x50ac70[_0x5dbf('0x2e')][_0x5dbf('0x41')]){_0x22f958['include']=[{'all':!![]}];}_0x22f958=_[_0x5dbf('0x3d')]({},_0x22f958,_0x50ac70[_0x5dbf('0x48')]);return db['AnalyticMetric'][_0x5dbf('0x49')](_0x22f958)[_0x5dbf('0x20')](handleEntityNotFound(_0x78aef3,null))['then'](respondWithResult(_0x78aef3,null))[_0x5dbf('0x45')](handleError(_0x78aef3,null));};exports['create']=function(_0x5ab862,_0x337897){return db[_0x5dbf('0x40')][_0x5dbf('0x4a')](_0x5ab862['body'],{})['then'](function(_0x442a43){var _0x3e8612=_0x5ab862[_0x5dbf('0x4b')][_0x5dbf('0x22')]({'plain':!![]});if(!_0x3e8612)throw new Error(_0x5dbf('0x4c'));if(_0x3e8612[_0x5dbf('0x4d')]===_0x5dbf('0x4b')){var _0x319906=_0x442a43['get']({'plain':!![]});var _0x3f38a0=_0x5dbf('0x23');return db[_0x5dbf('0x4e')][_0x5dbf('0x49')]({'where':{'name':_0x3f38a0,'userProfileId':_0x3e8612[_0x5dbf('0x4f')]},'raw':!![]})[_0x5dbf('0x20')](function(_0x328dc5){if(_0x328dc5&&_0x328dc5['autoAssociation']===0x0){return db[_0x5dbf('0x24')]['create']({'name':_0x319906[_0x5dbf('0x27')],'resourceId':_0x319906['id'],'type':_0x328dc5[_0x5dbf('0x27')],'sectionId':_0x328dc5['id']},{})[_0x5dbf('0x20')](function(){return _0x442a43;});}else{return _0x442a43;}})[_0x5dbf('0x45')](function(_0x78ab84){logger[_0x5dbf('0x26')](_0x5dbf('0x50'),_0x78ab84);throw _0x78ab84;});}return _0x442a43;})['then'](respondWithResult(_0x337897,0xc9))['catch'](handleError(_0x337897,null));};exports['update']=function(_0x1e1876,_0xfdacc7){if(_0x1e1876[_0x5dbf('0x51')]['id']){delete _0x1e1876['body']['id'];}return db['AnalyticMetric'][_0x5dbf('0x49')]({'where':{'id':_0x1e1876[_0x5dbf('0x52')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0xfdacc7,null))['then'](saveUpdates(_0x1e1876[_0x5dbf('0x51')],null))['then'](respondWithResult(_0xfdacc7,null))[_0x5dbf('0x45')](handleError(_0xfdacc7,null));};exports[_0x5dbf('0x21')]=function(_0x2145ea,_0x5da14b){return db['AnalyticMetric'][_0x5dbf('0x49')]({'where':{'id':_0x2145ea[_0x5dbf('0x52')]['id']}})[_0x5dbf('0x20')](handleEntityNotFound(_0x5da14b,null))[_0x5dbf('0x20')](removeEntity(_0x5da14b,null))['catch'](handleError(_0x5da14b,null));}; \ No newline at end of file +var _0x7fbe=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','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','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x5524a4,_0x5808eb){var _0x2033ec=function(_0xdd3ce5){while(--_0xdd3ce5){_0x5524a4['push'](_0x5524a4['shift']());}};_0x2033ec(++_0x5808eb);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x4aa350,_0x12a9eb){_0x4aa350=_0x4aa350-0x0;var _0x32a16f=_0x7fbe[_0x4aa350];return _0x32a16f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 5ee800d..2543f49 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 _0xf483=['api','moment','bluebird','request-promise','path','rimraf','AnalyticMetric','analytics_metrics','util'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0xf483,0xf2));var _0x3f48=function(_0x4263c6,_0x239009){_0x4263c6=_0x4263c6-0x0;var _0x47b675=_0xf483[_0x4263c6];return _0x47b675;};'use strict';var _=require('lodash');var util=require(_0x3f48('0x0'));var logger=require('../../config/logger')(_0x3f48('0x1'));var moment=require(_0x3f48('0x2'));var BPromise=require(_0x3f48('0x3'));var rp=require(_0x3f48('0x4'));var fs=require('fs');var path=require(_0x3f48('0x5'));var rimraf=require(_0x3f48('0x6'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x1a3447,_0x16905e){return _0x1a3447['define'](_0x3f48('0x7'),attributes,{'tableName':_0x3f48('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf8af=['bluebird','path','rimraf','../../config/environment','./analyticMetric.attributes','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','moment'];(function(_0x5397d4,_0x2b4b0d){var _0x33746c=function(_0xc1626c){while(--_0xc1626c){_0x5397d4['push'](_0x5397d4['shift']());}};_0x33746c(++_0x2b4b0d);}(_0xf8af,0x8b));var _0xff8a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf8af[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xff8a('0x0'));var util=require('util');var logger=require(_0xff8a('0x1'))(_0xff8a('0x2'));var moment=require(_0xff8a('0x3'));var BPromise=require(_0xff8a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xff8a('0x5'));var rimraf=require(_0xff8a('0x6'));var config=require(_0xff8a('0x7'));var attributes=require(_0xff8a('0x8'));module['exports']=function(_0x5a4a51,_0x1fc99e){return _0x5a4a51['define'](_0xff8a('0x9'),attributes,{'tableName':_0xff8a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 132c088..4e556cd 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 _0xc8e4=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment'];(function(_0x5b0207,_0x251750){var _0x9cdd39=function(_0x5f98b2){while(--_0x5f98b2){_0x5b0207['push'](_0x5b0207['shift']());}};_0x9cdd39(++_0x251750);}(_0xc8e4,0x1e0));var _0x4c8e=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xc8e4[_0x1a72f3];return _0x57ef47;};'use strict';var _=require(_0x4c8e('0x0'));var util=require(_0x4c8e('0x1'));var moment=require(_0x4c8e('0x2'));var BPromise=require(_0x4c8e('0x3'));var rs=require(_0x4c8e('0x4'));var fs=require('fs');var Redis=require(_0x4c8e('0x5'));var db=require(_0x4c8e('0x6'))['db'];var utils=require(_0x4c8e('0x7'));var logger=require('../../config/logger')(_0x4c8e('0x8'));var config=require('../../config/environment');var jayson=require(_0x4c8e('0x9'));var client=jayson[_0x4c8e('0xa')][_0x4c8e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x490228,_0x35eecc,_0x477b64){return new BPromise(function(_0x3cb1da,_0x248ca2){return client[_0x4c8e('0xc')](_0x490228,_0x477b64)[_0x4c8e('0xd')](function(_0x570f32){logger[_0x4c8e('0xe')](_0x4c8e('0xf'),_0x35eecc,_0x4c8e('0x10'));logger[_0x4c8e('0x11')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x35eecc,_0x4c8e('0x10'),JSON['stringify'](_0x570f32));if(_0x570f32[_0x4c8e('0x12')]){if(_0x570f32[_0x4c8e('0x12')][_0x4c8e('0x13')]===0x1f4){logger[_0x4c8e('0x12')](_0x4c8e('0xf'),_0x35eecc,_0x570f32['error'][_0x4c8e('0x14')]);return _0x248ca2(_0x570f32[_0x4c8e('0x12')][_0x4c8e('0x14')]);}logger['error'](_0x4c8e('0xf'),_0x35eecc,_0x570f32[_0x4c8e('0x12')][_0x4c8e('0x14')]);return _0x3cb1da(_0x570f32[_0x4c8e('0x12')][_0x4c8e('0x14')]);}else{logger['info'](_0x4c8e('0xf'),_0x35eecc,_0x4c8e('0x10'));_0x3cb1da(_0x570f32[_0x4c8e('0x15')]['message']);}})[_0x4c8e('0x16')](function(_0x794f11){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x35eecc,_0x794f11);_0x248ca2(_0x794f11);});});} \ No newline at end of file +var _0x3c98=['info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x30a5e5,_0x4ba8a0){var _0x15d571=function(_0x1285a5){while(--_0x1285a5){_0x30a5e5['push'](_0x30a5e5['shift']());}};_0x15d571(++_0x4ba8a0);}(_0x3c98,0xc6));var _0x83c9=function(_0x4081da,_0x7e4af9){_0x4081da=_0x4081da-0x0;var _0x5b2533=_0x3c98[_0x4081da];return _0x5b2533;};'use strict';var _=require(_0x83c9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x83c9('0x1'));var fs=require('fs');var Redis=require(_0x83c9('0x2'));var db=require(_0x83c9('0x3'))['db'];var utils=require(_0x83c9('0x4'));var logger=require('../../config/logger')(_0x83c9('0x5'));var config=require(_0x83c9('0x6'));var jayson=require(_0x83c9('0x7'));var client=jayson['client'][_0x83c9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf2c93c,_0x690129,_0x4c9369){return new BPromise(function(_0x20f0c5,_0x824f35){return client[_0x83c9('0x9')](_0xf2c93c,_0x4c9369)[_0x83c9('0xa')](function(_0x58bb0f){logger[_0x83c9('0xb')](_0x83c9('0xc'),_0x690129,_0x83c9('0xd'));logger[_0x83c9('0xe')](_0x83c9('0xf'),_0x690129,_0x83c9('0xd'),JSON['stringify'](_0x58bb0f));if(_0x58bb0f[_0x83c9('0x10')]){if(_0x58bb0f[_0x83c9('0x10')]['code']===0x1f4){logger[_0x83c9('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x690129,_0x58bb0f[_0x83c9('0x10')]['message']);return _0x824f35(_0x58bb0f[_0x83c9('0x10')]['message']);}logger[_0x83c9('0x10')](_0x83c9('0xc'),_0x690129,_0x58bb0f[_0x83c9('0x10')][_0x83c9('0x11')]);return _0x20f0c5(_0x58bb0f[_0x83c9('0x10')][_0x83c9('0x11')]);}else{logger[_0x83c9('0xb')](_0x83c9('0xc'),_0x690129,_0x83c9('0xd'));_0x20f0c5(_0x58bb0f['result'][_0x83c9('0x11')]);}})[_0x83c9('0x12')](function(_0x110323){logger[_0x83c9('0x10')](_0x83c9('0xc'),_0x690129,_0x110323);_0x824f35(_0x110323);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 7808c09..972a379 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 _0xd3e3=['post','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x2365a0,_0x4c1e17){var _0x1a5ce9=function(_0x35841d){while(--_0x35841d){_0x2365a0['push'](_0x2365a0['shift']());}};_0x1a5ce9(++_0x4c1e17);}(_0xd3e3,0xdd));var _0x3d3e=function(_0x27fdae,_0x45daa8){_0x27fdae=_0x27fdae-0x0;var _0x165d1e=_0xd3e3[_0x27fdae];return _0x165d1e;};'use strict';var multer=require(_0x3d3e('0x0'));var util=require(_0x3d3e('0x1'));var path=require(_0x3d3e('0x2'));var timeout=require(_0x3d3e('0x3'));var express=require('express');var router=express[_0x3d3e('0x4')]();var fs_extra=require(_0x3d3e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3d3e('0x6'));var config=require(_0x3d3e('0x7'));var controller=require('./analyticMetric.controller');router[_0x3d3e('0x8')]('/',auth[_0x3d3e('0x9')](),controller[_0x3d3e('0xa')]);router[_0x3d3e('0x8')](_0x3d3e('0xb'),auth['isAuthenticated'](),controller[_0x3d3e('0xc')]);router[_0x3d3e('0xd')]('/',auth[_0x3d3e('0x9')](),controller['create']);router[_0x3d3e('0xe')](_0x3d3e('0xb'),auth[_0x3d3e('0x9')](),controller[_0x3d3e('0xf')]);router['delete'](_0x3d3e('0xb'),auth['isAuthenticated'](),controller[_0x3d3e('0x10')]);module[_0x3d3e('0x11')]=router; \ No newline at end of file +var _0x5c91=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x54a2da,_0x51925b){var _0x20297e=function(_0x16fb4d){while(--_0x16fb4d){_0x54a2da['push'](_0x54a2da['shift']());}};_0x20297e(++_0x51925b);}(_0x5c91,0x1e9));var _0x15c9=function(_0x3f18d9,_0x3b2f8f){_0x3f18d9=_0x3f18d9-0x0;var _0x243ff4=_0x5c91[_0x3f18d9];return _0x243ff4;};'use strict';var multer=require(_0x15c9('0x0'));var util=require(_0x15c9('0x1'));var path=require(_0x15c9('0x2'));var timeout=require('connect-timeout');var express=require(_0x15c9('0x3'));var router=express[_0x15c9('0x4')]();var fs_extra=require(_0x15c9('0x5'));var auth=require(_0x15c9('0x6'));var interaction=require(_0x15c9('0x7'));var config=require(_0x15c9('0x8'));var controller=require('./analyticMetric.controller');router[_0x15c9('0x9')]('/',auth[_0x15c9('0xa')](),controller[_0x15c9('0xb')]);router[_0x15c9('0x9')](_0x15c9('0xc'),auth['isAuthenticated'](),controller[_0x15c9('0xd')]);router[_0x15c9('0xe')]('/',auth[_0x15c9('0xa')](),controller['create']);router[_0x15c9('0xf')](_0x15c9('0xc'),auth[_0x15c9('0xa')](),controller['update']);router['delete'](_0x15c9('0xc'),auth[_0x15c9('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index cfcb2d8..9d4a258 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 _0xfbf9=['exports','TEXT'];(function(_0x1f3c2a,_0xb2ee90){var _0x2cbce9=function(_0x1ba35c){while(--_0x1ba35c){_0x1f3c2a['push'](_0x1f3c2a['shift']());}};_0x2cbce9(++_0xb2ee90);}(_0xfbf9,0x138));var _0x9fbf=function(_0x1b48cd,_0x4e1a55){_0x1b48cd=_0x1b48cd-0x0;var _0x11a3c8=_0xfbf9[_0x1b48cd];return _0x11a3c8;};'use strict';var Sequelize=require('sequelize');module[_0x9fbf('0x0')]={'tree':{'type':Sequelize[_0x9fbf('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xf73a=['exports','sequelize'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xf73a,0x115));var _0xaf73=function(_0x3d3bf7,_0x3d8ecf){_0x3d3bf7=_0x3d3bf7-0x0;var _0x16bd6d=_0xf73a[_0x3d3bf7];return _0x16bd6d;};'use strict';var Sequelize=require(_0xaf73('0x0'));module[_0xaf73('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 4b860db..b4e9b6a 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 _0x5f39=['moment','bluebird','util','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticTreeReport','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x34d7b1,_0x3a495b){var _0x2314f0=function(_0x3604e7){while(--_0x3604e7){_0x34d7b1['push'](_0x34d7b1['shift']());}};_0x2314f0(++_0x3a495b);}(_0x5f39,0x17c));var _0x95f3=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x5f39[_0x46698a];return _0x356db0;};'use strict';var emlformat=require(_0x95f3('0x0'));var rimraf=require(_0x95f3('0x1'));var zipdir=require(_0x95f3('0x2'));var jsonpatch=require(_0x95f3('0x3'));var rp=require(_0x95f3('0x4'));var moment=require(_0x95f3('0x5'));var BPromise=require(_0x95f3('0x6'));var Mustache=require('mustache');var util=require(_0x95f3('0x7'));var path=require('path');var sox=require(_0x95f3('0x8'));var csv=require(_0x95f3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x95f3('0xa'));var _=require(_0x95f3('0xb'));var squel=require('squel');var crypto=require(_0x95f3('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x95f3('0xd'));var toCsv=require(_0x95f3('0x9'));var querystring=require(_0x95f3('0xe'));var Papa=require(_0x95f3('0xf'));var Redis=require(_0x95f3('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x95f3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x95f3('0x12'));var logger=require(_0x95f3('0x13'))(_0x95f3('0x14'));var utils=require(_0x95f3('0x15'));var config=require(_0x95f3('0x16'));var licenseUtil=require(_0x95f3('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1dd009,_0x1a73f9){_0x1a73f9=_0x1a73f9||0xcc;return function(_0x9c4fa0){if(_0x9c4fa0){return _0x1dd009[_0x95f3('0x18')](_0x1a73f9);}return _0x1dd009[_0x95f3('0x19')](_0x1a73f9)[_0x95f3('0x1a')]();};}function respondWithResult(_0x58935f,_0x25560f){_0x25560f=_0x25560f||0xc8;return function(_0x4a638b){if(_0x4a638b){return _0x58935f['status'](_0x25560f)[_0x95f3('0x1b')](_0x4a638b);}};}function respondWithFilteredResult(_0x105fd0,_0x1aa020){return function(_0x352567){if(_0x352567){var _0x1f5af0=typeof _0x1aa020[_0x95f3('0x1c')]===_0x95f3('0x1d')&&typeof _0x1aa020[_0x95f3('0x1e')]===_0x95f3('0x1d');var _0x3d79c5=_0x352567[_0x95f3('0x1f')];var _0x431369=_0x1f5af0?0x0:_0x1aa020['offset'];var _0x16f8d7=_0x1f5af0?_0x352567[_0x95f3('0x1f')]:_0x1aa020[_0x95f3('0x1c')]+_0x1aa020[_0x95f3('0x1e')];var _0x17884a;if(_0x16f8d7>=_0x3d79c5){_0x16f8d7=_0x3d79c5;_0x17884a=0xc8;}else{_0x17884a=0xce;}_0x105fd0[_0x95f3('0x19')](_0x17884a);return _0x105fd0[_0x95f3('0x20')](_0x95f3('0x21'),_0x431369+'-'+_0x16f8d7+'/'+_0x3d79c5)[_0x95f3('0x1b')](_0x352567);}return null;};}function patchUpdates(_0x2ba089){return function(_0xd48b33){try{jsonpatch['apply'](_0xd48b33,_0x2ba089,!![]);}catch(_0xa90021){return BPromise[_0x95f3('0x22')](_0xa90021);}return _0xd48b33[_0x95f3('0x23')]();};}function saveUpdates(_0x27e7a8,_0x332f47){return function(_0x3e8a57){if(_0x3e8a57){return _0x3e8a57[_0x95f3('0x24')](_0x27e7a8)[_0x95f3('0x25')](function(_0x43ad67){return _0x43ad67;});}return null;};}function removeEntity(_0x5c7ecc,_0x530f2f){return function(_0x5254f6){if(_0x5254f6){return _0x5254f6[_0x95f3('0x26')]()['then'](function(){_0x5c7ecc[_0x95f3('0x19')](0xcc)[_0x95f3('0x1a')]();});}};}function handleEntityNotFound(_0x2cf9b1,_0x5bbdd2){return function(_0x1fd524){if(!_0x1fd524){_0x2cf9b1[_0x95f3('0x18')](0x194);}return _0x1fd524;};}function handleError(_0x5cbb0e,_0x2ec5db){_0x2ec5db=_0x2ec5db||0x1f4;return function(_0x536500){logger[_0x95f3('0x27')](_0x536500[_0x95f3('0x28')]);if(_0x536500[_0x95f3('0x29')]){delete _0x536500[_0x95f3('0x29')];}_0x5cbb0e[_0x95f3('0x19')](_0x2ec5db)[_0x95f3('0x2a')](_0x536500);};}exports[_0x95f3('0x2b')]=function(_0x41589d,_0x57452e){var _0x18bc62={},_0x76cabd={},_0x3ea942={'count':0x0,'rows':[]};var _0x1a6bec=_[_0x95f3('0x2c')](db['AnalyticTreeReport']['rawAttributes'],function(_0x2e0fad){return{'name':_0x2e0fad[_0x95f3('0x2d')],'type':_0x2e0fad[_0x95f3('0x2e')][_0x95f3('0x2f')]};});_0x76cabd[_0x95f3('0x30')]=_[_0x95f3('0x2c')](_0x1a6bec,_0x95f3('0x29'));_0x76cabd[_0x95f3('0x31')]=_['keys'](_0x41589d[_0x95f3('0x31')]);_0x76cabd['filters']=_[_0x95f3('0x32')](_0x76cabd[_0x95f3('0x30')],_0x76cabd[_0x95f3('0x31')]);_0x18bc62['attributes']=_[_0x95f3('0x32')](_0x76cabd[_0x95f3('0x30')],qs[_0x95f3('0x33')](_0x41589d[_0x95f3('0x31')][_0x95f3('0x33')]));_0x18bc62[_0x95f3('0x34')]=_0x18bc62['attributes'][_0x95f3('0x35')]?_0x18bc62[_0x95f3('0x34')]:_0x76cabd[_0x95f3('0x30')];if(!_0x41589d[_0x95f3('0x31')][_0x95f3('0x36')](_0x95f3('0x37'))){_0x18bc62[_0x95f3('0x1e')]=qs[_0x95f3('0x1e')](_0x41589d['query'][_0x95f3('0x1e')]);_0x18bc62['offset']=qs[_0x95f3('0x1c')](_0x41589d[_0x95f3('0x31')][_0x95f3('0x1c')]);}_0x18bc62[_0x95f3('0x38')]=qs[_0x95f3('0x39')](_0x41589d[_0x95f3('0x31')][_0x95f3('0x39')]);_0x18bc62[_0x95f3('0x3a')]=qs[_0x95f3('0x3b')](_[_0x95f3('0x3c')](_0x41589d['query'],_0x76cabd[_0x95f3('0x3b')]),_0x1a6bec);if(_0x41589d['query'][_0x95f3('0x3d')]){_0x18bc62[_0x95f3('0x3a')]=_[_0x95f3('0x3e')](_0x18bc62['where'],{'$or':_[_0x95f3('0x2c')](_0x1a6bec,function(_0x12516b){if(_0x12516b[_0x95f3('0x2e')]!==_0x95f3('0x3f')){var _0x3ec6c5={};_0x3ec6c5[_0x12516b[_0x95f3('0x29')]]={'$like':'%'+_0x41589d[_0x95f3('0x31')]['filter']+'%'};return _0x3ec6c5;}})});}_0x18bc62=_['merge']({},_0x18bc62,_0x41589d[_0x95f3('0x40')]);var _0x4b0225={'where':_0x18bc62[_0x95f3('0x3a')]};return db[_0x95f3('0x41')][_0x95f3('0x1f')](_0x4b0225)[_0x95f3('0x25')](function(_0x5114a8){_0x3ea942[_0x95f3('0x1f')]=_0x5114a8;if(_0x41589d['query'][_0x95f3('0x42')]){_0x18bc62['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x95f3('0x43')](_0x18bc62);})[_0x95f3('0x25')](function(_0x2a33f5){_0x3ea942[_0x95f3('0x44')]=_0x2a33f5;return _0x3ea942;})[_0x95f3('0x25')](respondWithFilteredResult(_0x57452e,_0x18bc62))[_0x95f3('0x45')](handleError(_0x57452e,null));};exports[_0x95f3('0x46')]=function(_0x47c741,_0x4ccad3){var _0x1dad70={'raw':!![],'where':{'id':_0x47c741[_0x95f3('0x47')]['id']}},_0x1a8711={};_0x1a8711[_0x95f3('0x30')]=_['keys'](db[_0x95f3('0x41')][_0x95f3('0x48')]);_0x1a8711[_0x95f3('0x31')]=_['keys'](_0x47c741['query']);_0x1a8711[_0x95f3('0x3b')]=_[_0x95f3('0x32')](_0x1a8711[_0x95f3('0x30')],_0x1a8711[_0x95f3('0x31')]);_0x1dad70[_0x95f3('0x34')]=_[_0x95f3('0x32')](_0x1a8711[_0x95f3('0x30')],qs[_0x95f3('0x33')](_0x47c741[_0x95f3('0x31')][_0x95f3('0x33')]));_0x1dad70[_0x95f3('0x34')]=_0x1dad70['attributes'][_0x95f3('0x35')]?_0x1dad70[_0x95f3('0x34')]:_0x1a8711[_0x95f3('0x30')];if(_0x47c741[_0x95f3('0x31')][_0x95f3('0x42')]){_0x1dad70[_0x95f3('0x49')]=[{'all':!![]}];}_0x1dad70=_[_0x95f3('0x3e')]({},_0x1dad70,_0x47c741[_0x95f3('0x40')]);return db[_0x95f3('0x41')][_0x95f3('0x4a')](_0x1dad70)[_0x95f3('0x25')](handleEntityNotFound(_0x4ccad3,null))[_0x95f3('0x25')](respondWithResult(_0x4ccad3,null))[_0x95f3('0x45')](handleError(_0x4ccad3,null));};exports[_0x95f3('0x4b')]=function(_0x2db8f5,_0x57a928){return db['AnalyticTreeReport'][_0x95f3('0x4b')](_0x2db8f5[_0x95f3('0x4c')],{})[_0x95f3('0x25')](respondWithResult(_0x57a928,0xc9))['catch'](handleError(_0x57a928,null));};exports[_0x95f3('0x24')]=function(_0x55461d,_0x2a4036){if(_0x55461d[_0x95f3('0x4c')]['id']){delete _0x55461d['body']['id'];}return db['AnalyticTreeReport'][_0x95f3('0x4a')]({'where':{'id':_0x55461d['params']['id']}})[_0x95f3('0x25')](handleEntityNotFound(_0x2a4036,null))[_0x95f3('0x25')](saveUpdates(_0x55461d[_0x95f3('0x4c')],null))[_0x95f3('0x25')](respondWithResult(_0x2a4036,null))['catch'](handleError(_0x2a4036,null));};exports['destroy']=function(_0x5a2f05,_0x29a83f){return db['AnalyticTreeReport'][_0x95f3('0x4a')]({'where':{'id':_0x5a2f05[_0x95f3('0x47')]['id']}})['then'](handleEntityNotFound(_0x29a83f,null))['then'](removeEntity(_0x29a83f,null))[_0x95f3('0x45')](handleError(_0x29a83f,null));}; \ No newline at end of file +var _0xd8bd=['index','map','AnalyticTreeReport','rawAttributes','key','name','query','keys','filters','intersection','attributes','model','fields','length','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','find','create','body','params','eml-format','rimraf','zip-dir','bluebird','mustache','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','end','error','stack','send'];(function(_0x3bab09,_0x217c29){var _0x164376=function(_0x277730){while(--_0x277730){_0x3bab09['push'](_0x3bab09['shift']());}};_0x164376(++_0x217c29);}(_0xd8bd,0xb0));var _0xdd8b=function(_0x57f135,_0x54061b){_0x57f135=_0x57f135-0x0;var _0x166438=_0xd8bd[_0x57f135];return _0x166438;};'use strict';var emlformat=require(_0xdd8b('0x0'));var rimraf=require(_0xdd8b('0x1'));var zipdir=require(_0xdd8b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdd8b('0x3'));var Mustache=require(_0xdd8b('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xdd8b('0x5'));var ejs=require(_0xdd8b('0x6'));var fs=require('fs');var fs_extra=require(_0xdd8b('0x7'));var _=require(_0xdd8b('0x8'));var squel=require('squel');var crypto=require(_0xdd8b('0x9'));var jsforce=require(_0xdd8b('0xa'));var deskjs=require(_0xdd8b('0xb'));var toCsv=require('to-csv');var querystring=require(_0xdd8b('0xc'));var Papa=require(_0xdd8b('0xd'));var Redis=require(_0xdd8b('0xe'));var authService=require(_0xdd8b('0xf'));var qs=require(_0xdd8b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd8b('0x11'))(_0xdd8b('0x12'));var utils=require('../../config/utils');var config=require(_0xdd8b('0x13'));var licenseUtil=require(_0xdd8b('0x14'));var db=require(_0xdd8b('0x15'))['db'];function respondWithStatusCode(_0x5c6dd7,_0x40165b){_0x40165b=_0x40165b||0xcc;return function(_0x3dd77b){if(_0x3dd77b){return _0x5c6dd7[_0xdd8b('0x16')](_0x40165b);}return _0x5c6dd7[_0xdd8b('0x17')](_0x40165b)['end']();};}function respondWithResult(_0x27a4f2,_0x27d57a){_0x27d57a=_0x27d57a||0xc8;return function(_0x27b476){if(_0x27b476){return _0x27a4f2[_0xdd8b('0x17')](_0x27d57a)['json'](_0x27b476);}};}function respondWithFilteredResult(_0x43534a,_0x38680a){return function(_0x15f99a){if(_0x15f99a){var _0x1e535d=typeof _0x38680a[_0xdd8b('0x18')]===_0xdd8b('0x19')&&typeof _0x38680a[_0xdd8b('0x1a')]==='undefined';var _0x53e523=_0x15f99a['count'];var _0x47015b=_0x1e535d?0x0:_0x38680a[_0xdd8b('0x18')];var _0x2d4256=_0x1e535d?_0x15f99a[_0xdd8b('0x1b')]:_0x38680a['offset']+_0x38680a[_0xdd8b('0x1a')];var _0x4e2b42;if(_0x2d4256>=_0x53e523){_0x2d4256=_0x53e523;_0x4e2b42=0xc8;}else{_0x4e2b42=0xce;}_0x43534a[_0xdd8b('0x17')](_0x4e2b42);return _0x43534a[_0xdd8b('0x1c')](_0xdd8b('0x1d'),_0x47015b+'-'+_0x2d4256+'/'+_0x53e523)[_0xdd8b('0x1e')](_0x15f99a);}return null;};}function patchUpdates(_0x5db4a7){return function(_0x551d68){try{jsonpatch[_0xdd8b('0x1f')](_0x551d68,_0x5db4a7,!![]);}catch(_0x38439e){return BPromise['reject'](_0x38439e);}return _0x551d68[_0xdd8b('0x20')]();};}function saveUpdates(_0x5043b9,_0x46b93c){return function(_0x2aba8e){if(_0x2aba8e){return _0x2aba8e[_0xdd8b('0x21')](_0x5043b9)[_0xdd8b('0x22')](function(_0x20c4ee){return _0x20c4ee;});}return null;};}function removeEntity(_0x3f5c64,_0x334cd4){return function(_0x323384){if(_0x323384){return _0x323384[_0xdd8b('0x23')]()['then'](function(){_0x3f5c64[_0xdd8b('0x17')](0xcc)[_0xdd8b('0x24')]();});}};}function handleEntityNotFound(_0x2ccead,_0xa7e4ea){return function(_0x4c90fd){if(!_0x4c90fd){_0x2ccead['sendStatus'](0x194);}return _0x4c90fd;};}function handleError(_0x4e0998,_0x1b8305){_0x1b8305=_0x1b8305||0x1f4;return function(_0x4248e1){logger[_0xdd8b('0x25')](_0x4248e1[_0xdd8b('0x26')]);if(_0x4248e1['name']){delete _0x4248e1['name'];}_0x4e0998['status'](_0x1b8305)[_0xdd8b('0x27')](_0x4248e1);};}exports[_0xdd8b('0x28')]=function(_0x188c95,_0x237f4a){var _0x48331d={},_0x1a6d5c={},_0x2e9158={'count':0x0,'rows':[]};var _0xadd297=_[_0xdd8b('0x29')](db[_0xdd8b('0x2a')][_0xdd8b('0x2b')],function(_0x3724b4){return{'name':_0x3724b4['fieldName'],'type':_0x3724b4['type'][_0xdd8b('0x2c')]};});_0x1a6d5c['model']=_[_0xdd8b('0x29')](_0xadd297,_0xdd8b('0x2d'));_0x1a6d5c[_0xdd8b('0x2e')]=_[_0xdd8b('0x2f')](_0x188c95[_0xdd8b('0x2e')]);_0x1a6d5c[_0xdd8b('0x30')]=_[_0xdd8b('0x31')](_0x1a6d5c['model'],_0x1a6d5c['query']);_0x48331d[_0xdd8b('0x32')]=_['intersection'](_0x1a6d5c[_0xdd8b('0x33')],qs[_0xdd8b('0x34')](_0x188c95[_0xdd8b('0x2e')][_0xdd8b('0x34')]));_0x48331d[_0xdd8b('0x32')]=_0x48331d[_0xdd8b('0x32')][_0xdd8b('0x35')]?_0x48331d[_0xdd8b('0x32')]:_0x1a6d5c[_0xdd8b('0x33')];if(!_0x188c95['query']['hasOwnProperty']('nolimit')){_0x48331d[_0xdd8b('0x1a')]=qs['limit'](_0x188c95[_0xdd8b('0x2e')][_0xdd8b('0x1a')]);_0x48331d[_0xdd8b('0x18')]=qs['offset'](_0x188c95[_0xdd8b('0x2e')][_0xdd8b('0x18')]);}_0x48331d[_0xdd8b('0x36')]=qs[_0xdd8b('0x37')](_0x188c95[_0xdd8b('0x2e')][_0xdd8b('0x37')]);_0x48331d[_0xdd8b('0x38')]=qs[_0xdd8b('0x30')](_[_0xdd8b('0x39')](_0x188c95[_0xdd8b('0x2e')],_0x1a6d5c[_0xdd8b('0x30')]),_0xadd297);if(_0x188c95[_0xdd8b('0x2e')][_0xdd8b('0x3a')]){_0x48331d[_0xdd8b('0x38')]=_['merge'](_0x48331d['where'],{'$or':_[_0xdd8b('0x29')](_0xadd297,function(_0x700aef){if(_0x700aef[_0xdd8b('0x3b')]!==_0xdd8b('0x3c')){var _0x30170b={};_0x30170b[_0x700aef['name']]={'$like':'%'+_0x188c95[_0xdd8b('0x2e')]['filter']+'%'};return _0x30170b;}})});}_0x48331d=_[_0xdd8b('0x3d')]({},_0x48331d,_0x188c95['options']);var _0x3afaa6={'where':_0x48331d[_0xdd8b('0x38')]};return db[_0xdd8b('0x2a')][_0xdd8b('0x1b')](_0x3afaa6)[_0xdd8b('0x22')](function(_0x129d66){_0x2e9158[_0xdd8b('0x1b')]=_0x129d66;if(_0x188c95[_0xdd8b('0x2e')][_0xdd8b('0x3e')]){_0x48331d[_0xdd8b('0x3f')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0xdd8b('0x40')](_0x48331d);})[_0xdd8b('0x22')](function(_0x31c599){_0x2e9158[_0xdd8b('0x41')]=_0x31c599;return _0x2e9158;})[_0xdd8b('0x22')](respondWithFilteredResult(_0x237f4a,_0x48331d))[_0xdd8b('0x42')](handleError(_0x237f4a,null));};exports[_0xdd8b('0x43')]=function(_0x8ab2be,_0xc15427){var _0x10dcc9={'raw':!![],'where':{'id':_0x8ab2be['params']['id']}},_0x3c599c={};_0x3c599c[_0xdd8b('0x33')]=_[_0xdd8b('0x2f')](db[_0xdd8b('0x2a')][_0xdd8b('0x2b')]);_0x3c599c[_0xdd8b('0x2e')]=_[_0xdd8b('0x2f')](_0x8ab2be[_0xdd8b('0x2e')]);_0x3c599c[_0xdd8b('0x30')]=_[_0xdd8b('0x31')](_0x3c599c[_0xdd8b('0x33')],_0x3c599c[_0xdd8b('0x2e')]);_0x10dcc9['attributes']=_[_0xdd8b('0x31')](_0x3c599c[_0xdd8b('0x33')],qs[_0xdd8b('0x34')](_0x8ab2be[_0xdd8b('0x2e')]['fields']));_0x10dcc9['attributes']=_0x10dcc9['attributes']['length']?_0x10dcc9[_0xdd8b('0x32')]:_0x3c599c['model'];if(_0x8ab2be['query']['includeAll']){_0x10dcc9[_0xdd8b('0x3f')]=[{'all':!![]}];}_0x10dcc9=_[_0xdd8b('0x3d')]({},_0x10dcc9,_0x8ab2be['options']);return db['AnalyticTreeReport'][_0xdd8b('0x44')](_0x10dcc9)[_0xdd8b('0x22')](handleEntityNotFound(_0xc15427,null))[_0xdd8b('0x22')](respondWithResult(_0xc15427,null))['catch'](handleError(_0xc15427,null));};exports[_0xdd8b('0x45')]=function(_0x3e91f2,_0x1e3144){return db[_0xdd8b('0x2a')][_0xdd8b('0x45')](_0x3e91f2[_0xdd8b('0x46')],{})['then'](respondWithResult(_0x1e3144,0xc9))[_0xdd8b('0x42')](handleError(_0x1e3144,null));};exports[_0xdd8b('0x21')]=function(_0x156d8f,_0x3f9751){if(_0x156d8f[_0xdd8b('0x46')]['id']){delete _0x156d8f['body']['id'];}return db[_0xdd8b('0x2a')][_0xdd8b('0x44')]({'where':{'id':_0x156d8f[_0xdd8b('0x47')]['id']}})['then'](handleEntityNotFound(_0x3f9751,null))[_0xdd8b('0x22')](saveUpdates(_0x156d8f[_0xdd8b('0x46')],null))['then'](respondWithResult(_0x3f9751,null))[_0xdd8b('0x42')](handleError(_0x3f9751,null));};exports[_0xdd8b('0x23')]=function(_0x63ae9,_0x240c74){return db[_0xdd8b('0x2a')]['find']({'where':{'id':_0x63ae9[_0xdd8b('0x47')]['id']}})[_0xdd8b('0x22')](handleEntityNotFound(_0x240c74,null))[_0xdd8b('0x22')](removeEntity(_0x240c74,null))[_0xdd8b('0x42')](handleError(_0x240c74,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 84d6235..ea46fd9 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 _0x387f=['define','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticTreeReport.attributes'];(function(_0x57b35b,_0x4b0493){var _0x34a20b=function(_0x3ee3e7){while(--_0x3ee3e7){_0x57b35b['push'](_0x57b35b['shift']());}};_0x34a20b(++_0x4b0493);}(_0x387f,0x169));var _0xf387=function(_0x4f784f,_0x33c48e){_0x4f784f=_0x4f784f-0x0;var _0x4921cc=_0x387f[_0x4f784f];return _0x4921cc;};'use strict';var _=require(_0xf387('0x0'));var util=require(_0xf387('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf387('0x2'));var BPromise=require(_0xf387('0x3'));var rp=require(_0xf387('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf387('0x5'));var config=require(_0xf387('0x6'));var attributes=require(_0xf387('0x7'));module['exports']=function(_0x46d710,_0xc7bc56){return _0x46d710[_0xf387('0x8')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b3f=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','analytics_report_trees'];(function(_0x237c9f,_0xad81c4){var _0x1be536=function(_0x1bfaea){while(--_0x1bfaea){_0x237c9f['push'](_0x237c9f['shift']());}};_0x1be536(++_0xad81c4);}(_0x0b3f,0x6c));var _0xf0b3=function(_0x46d463,_0x2e8e61){_0x46d463=_0x46d463-0x0;var _0x3f9c94=_0x0b3f[_0x46d463];return _0x3f9c94;};'use strict';var _=require(_0xf0b3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf0b3('0x1'));var moment=require(_0xf0b3('0x2'));var BPromise=require(_0xf0b3('0x3'));var rp=require(_0xf0b3('0x4'));var fs=require('fs');var path=require(_0xf0b3('0x5'));var rimraf=require(_0xf0b3('0x6'));var config=require(_0xf0b3('0x7'));var attributes=require(_0xf0b3('0x8'));module[_0xf0b3('0x9')]=function(_0x240d83,_0x4f1f62){return _0x240d83[_0xf0b3('0xa')]('AnalyticTreeReport',attributes,{'tableName':_0xf0b3('0xb'),'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 1321bcc..55d70f8 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 _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(_0x21c56c,_0x24cccf){var _0x51d085=function(_0x1274c2){while(--_0x1274c2){_0x21c56c['push'](_0x21c56c['shift']());}};_0x51d085(++_0x24cccf);}(_0x1261,0x144));var _0x1126=function(_0x1249f4,_0x27226c){_0x1249f4=_0x1249f4-0x0;var _0x47c8a9=_0x1261[_0x1249f4];return _0x47c8a9;};'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 +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(_0x27bc6d,_0x5cc68f){var _0x1131f1=function(_0xc3f2f5){while(--_0xc3f2f5){_0x27bc6d['push'](_0x27bc6d['shift']());}};_0x1131f1(++_0x5cc68f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc4aa[_0x321bb2];return _0x9c12ed;};'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 diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index af62fa6..595c00e 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 _0xc672=['../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1f716f,_0xbb9877){var _0x397db0=function(_0x59f7){while(--_0x59f7){_0x1f716f['push'](_0x1f716f['shift']());}};_0x397db0(++_0xbb9877);}(_0xc672,0xf1));var _0x2c67=function(_0x163571,_0xc890f8){_0x163571=_0x163571-0x0;var _0x31d66d=_0xc672[_0x163571];return _0x31d66d;};'use strict';var multer=require(_0x2c67('0x0'));var util=require('util');var path=require(_0x2c67('0x1'));var timeout=require(_0x2c67('0x2'));var express=require(_0x2c67('0x3'));var router=express[_0x2c67('0x4')]();var fs_extra=require(_0x2c67('0x5'));var auth=require(_0x2c67('0x6'));var interaction=require(_0x2c67('0x7'));var config=require('../../config/environment');var controller=require(_0x2c67('0x8'));router['get']('/',auth[_0x2c67('0x9')](),controller['index']);router['get'](_0x2c67('0xa'),auth['isAuthenticated'](),controller[_0x2c67('0xb')]);router[_0x2c67('0xc')]('/',auth[_0x2c67('0x9')](),controller[_0x2c67('0xd')]);router[_0x2c67('0xe')](_0x2c67('0xa'),auth[_0x2c67('0x9')](),controller[_0x2c67('0xf')]);router[_0x2c67('0x10')](_0x2c67('0xa'),auth[_0x2c67('0x9')](),controller[_0x2c67('0x11')]);module[_0x2c67('0x12')]=router; \ No newline at end of file +var _0x46fd=['isAuthenticated','index','get','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x3addde,_0x251294){var _0x55364e=function(_0x36812e){while(--_0x36812e){_0x3addde['push'](_0x3addde['shift']());}};_0x55364e(++_0x251294);}(_0x46fd,0x1eb));var _0xd46f=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x46fd[_0x12fc8d];return _0x3f9d04;};'use strict';var multer=require(_0xd46f('0x0'));var util=require(_0xd46f('0x1'));var path=require(_0xd46f('0x2'));var timeout=require(_0xd46f('0x3'));var express=require(_0xd46f('0x4'));var router=express['Router']();var fs_extra=require(_0xd46f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd46f('0x6'));var config=require(_0xd46f('0x7'));var controller=require(_0xd46f('0x8'));router['get']('/',auth[_0xd46f('0x9')](),controller[_0xd46f('0xa')]);router[_0xd46f('0xb')](_0xd46f('0xc'),auth[_0xd46f('0x9')](),controller[_0xd46f('0xd')]);router[_0xd46f('0xe')]('/',auth[_0xd46f('0x9')](),controller[_0xd46f('0xf')]);router[_0xd46f('0x10')](_0xd46f('0xc'),auth[_0xd46f('0x9')](),controller[_0xd46f('0x11')]);router['delete'](_0xd46f('0xc'),auth[_0xd46f('0x9')](),controller[_0xd46f('0x12')]);module[_0xd46f('0x13')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index c7ac6d4..5295b52 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 _0xe700=['exports','STRING','sequelize'];(function(_0x86eb0c,_0x4e16de){var _0x463d7b=function(_0x51f56e){while(--_0x51f56e){_0x86eb0c['push'](_0x86eb0c['shift']());}};_0x463d7b(++_0x4e16de);}(_0xe700,0x16a));var _0x0e70=function(_0x3887ce,_0x327268){_0x3887ce=_0x3887ce-0x0;var _0x3bf1cb=_0xe700[_0x3887ce];return _0x3bf1cb;};'use strict';var Sequelize=require(_0x0e70('0x0'));module[_0x0e70('0x1')]={'name':{'type':Sequelize[_0x0e70('0x2')]},'basename':{'type':Sequelize[_0x0e70('0x2')]},'type':{'type':Sequelize[_0x0e70('0x2')]}}; \ No newline at end of file +var _0xbb53=['STRING','sequelize','exports'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xbb53,0x121));var _0x3bb5=function(_0x5a80b3,_0x574647){_0x5a80b3=_0x5a80b3-0x0;var _0x2ab3c0=_0xbb53[_0x5a80b3];return _0x2ab3c0;};'use strict';var Sequelize=require(_0x3bb5('0x0'));module[_0x3bb5('0x1')]={'name':{'type':Sequelize[_0x3bb5('0x2')]},'basename':{'type':Sequelize[_0x3bb5('0x2')]},'type':{'type':Sequelize[_0x3bb5('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index c72b9ce..e2a4422 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 _0xb2f2=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','sendStatus','error','name','index','map','fieldName','type','key','query','model','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','options','Attachment','includeAll','include','findAll','rows','catch','params','rawAttributes','intersection','find','keys','get','omit','createdAt','body','create','file','originalname','filename','mimetype','download','findOne','ChatOfflineMessageId','server/files/attachments/','join','offline-chat/','basename','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xb2f2,0x159));var _0x2b2f=function(_0x70207a,_0x40dc8b){_0x70207a=_0x70207a-0x0;var _0x25c3d2=_0xb2f2[_0x70207a];return _0x25c3d2;};'use strict';var emlformat=require(_0x2b2f('0x0'));var rimraf=require(_0x2b2f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2b2f('0x2'));var rp=require(_0x2b2f('0x3'));var moment=require(_0x2b2f('0x4'));var BPromise=require(_0x2b2f('0x5'));var Mustache=require(_0x2b2f('0x6'));var util=require('util');var path=require(_0x2b2f('0x7'));var sox=require(_0x2b2f('0x8'));var csv=require(_0x2b2f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2b2f('0xa'));var _=require(_0x2b2f('0xb'));var squel=require(_0x2b2f('0xc'));var crypto=require(_0x2b2f('0xd'));var jsforce=require(_0x2b2f('0xe'));var deskjs=require(_0x2b2f('0xf'));var toCsv=require(_0x2b2f('0x9'));var querystring=require(_0x2b2f('0x10'));var Papa=require(_0x2b2f('0x11'));var Redis=require(_0x2b2f('0x12'));var authService=require(_0x2b2f('0x13'));var qs=require(_0x2b2f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2b2f('0x15'));var logger=require(_0x2b2f('0x16'))(_0x2b2f('0x17'));var utils=require(_0x2b2f('0x18'));var config=require(_0x2b2f('0x19'));var licenseUtil=require(_0x2b2f('0x1a'));var db=require(_0x2b2f('0x1b'))['db'];function respondWithStatusCode(_0x2d99db,_0x2fac77){_0x2fac77=_0x2fac77||0xcc;return function(_0x510416){if(_0x510416){return _0x2d99db['sendStatus'](_0x2fac77);}return _0x2d99db[_0x2b2f('0x1c')](_0x2fac77)[_0x2b2f('0x1d')]();};}function respondWithResult(_0x19cb59,_0x43758c){_0x43758c=_0x43758c||0xc8;return function(_0xa0fb5a){if(_0xa0fb5a){return _0x19cb59[_0x2b2f('0x1c')](_0x43758c)[_0x2b2f('0x1e')](_0xa0fb5a);}};}function respondWithFilteredResult(_0x1971fd,_0xa72617){return function(_0x3e049a){if(_0x3e049a){var _0x4eccad=typeof _0xa72617[_0x2b2f('0x1f')]===_0x2b2f('0x20')&&typeof _0xa72617[_0x2b2f('0x21')]===_0x2b2f('0x20');var _0xce8db8=_0x3e049a[_0x2b2f('0x22')];var _0x2027a9=_0x4eccad?0x0:_0xa72617[_0x2b2f('0x1f')];var _0xca2c89=_0x4eccad?_0x3e049a[_0x2b2f('0x22')]:_0xa72617[_0x2b2f('0x1f')]+_0xa72617[_0x2b2f('0x21')];var _0x5f5920;if(_0xca2c89>=_0xce8db8){_0xca2c89=_0xce8db8;_0x5f5920=0xc8;}else{_0x5f5920=0xce;}_0x1971fd[_0x2b2f('0x1c')](_0x5f5920);return _0x1971fd['set'](_0x2b2f('0x23'),_0x2027a9+'-'+_0xca2c89+'/'+_0xce8db8)['json'](_0x3e049a);}return null;};}function patchUpdates(_0x296fb9){return function(_0x4072a2){try{jsonpatch['apply'](_0x4072a2,_0x296fb9,!![]);}catch(_0x211c43){return BPromise[_0x2b2f('0x24')](_0x211c43);}return _0x4072a2['save']();};}function saveUpdates(_0x5477ee,_0x2d791a){return function(_0xbc5768){if(_0xbc5768){return _0xbc5768[_0x2b2f('0x25')](_0x5477ee)[_0x2b2f('0x26')](function(_0x40cb6f){return _0x40cb6f;});}return null;};}function removeEntity(_0x5fd92b,_0x276e34){return function(_0x4a8fe6){if(_0x4a8fe6){return _0x4a8fe6[_0x2b2f('0x27')]()[_0x2b2f('0x26')](function(){_0x5fd92b[_0x2b2f('0x1c')](0xcc)[_0x2b2f('0x1d')]();});}};}function handleEntityNotFound(_0x58ec66,_0x483594){return function(_0x36dea8){if(!_0x36dea8){_0x58ec66[_0x2b2f('0x28')](0x194);}return _0x36dea8;};}function handleError(_0x2ef433,_0x367679){_0x367679=_0x367679||0x1f4;return function(_0xf636d7){logger[_0x2b2f('0x29')](_0xf636d7['stack']);if(_0xf636d7[_0x2b2f('0x2a')]){delete _0xf636d7[_0x2b2f('0x2a')];}_0x2ef433['status'](_0x367679)['send'](_0xf636d7);};}exports[_0x2b2f('0x2b')]=function(_0x37cc9d,_0x4f452d){var _0x113cca={},_0x54f2f4={},_0x4b882b={'count':0x0,'rows':[]};var _0x2549ec=_[_0x2b2f('0x2c')](db['Attachment']['rawAttributes'],function(_0x8b8f65){return{'name':_0x8b8f65[_0x2b2f('0x2d')],'type':_0x8b8f65[_0x2b2f('0x2e')][_0x2b2f('0x2f')]};});_0x54f2f4['model']=_[_0x2b2f('0x2c')](_0x2549ec,_0x2b2f('0x2a'));_0x54f2f4[_0x2b2f('0x30')]=_['keys'](_0x37cc9d['query']);_0x54f2f4['filters']=_['intersection'](_0x54f2f4[_0x2b2f('0x31')],_0x54f2f4[_0x2b2f('0x30')]);_0x113cca[_0x2b2f('0x32')]=_['intersection'](_0x54f2f4['model'],qs[_0x2b2f('0x33')](_0x37cc9d[_0x2b2f('0x30')][_0x2b2f('0x33')]));_0x113cca['attributes']=_0x113cca[_0x2b2f('0x32')][_0x2b2f('0x34')]?_0x113cca[_0x2b2f('0x32')]:_0x54f2f4[_0x2b2f('0x31')];if(!_0x37cc9d[_0x2b2f('0x30')]['hasOwnProperty'](_0x2b2f('0x35'))){_0x113cca[_0x2b2f('0x21')]=qs[_0x2b2f('0x21')](_0x37cc9d[_0x2b2f('0x30')][_0x2b2f('0x21')]);_0x113cca[_0x2b2f('0x1f')]=qs['offset'](_0x37cc9d['query'][_0x2b2f('0x1f')]);}_0x113cca[_0x2b2f('0x36')]=qs[_0x2b2f('0x37')](_0x37cc9d['query']['sort']);_0x113cca[_0x2b2f('0x38')]=qs['filters'](_[_0x2b2f('0x39')](_0x37cc9d[_0x2b2f('0x30')],_0x54f2f4[_0x2b2f('0x3a')]),_0x2549ec);if(_0x37cc9d[_0x2b2f('0x30')][_0x2b2f('0x3b')]){_0x113cca[_0x2b2f('0x38')]=_[_0x2b2f('0x3c')](_0x113cca['where'],{'$or':_[_0x2b2f('0x2c')](_0x2549ec,function(_0x17d985){if(_0x17d985['type']!=='VIRTUAL'){var _0x2e9c32={};_0x2e9c32[_0x17d985['name']]={'$like':'%'+_0x37cc9d['query']['filter']+'%'};return _0x2e9c32;}})});}_0x113cca=_[_0x2b2f('0x3c')]({},_0x113cca,_0x37cc9d[_0x2b2f('0x3d')]);var _0x376f6d={'where':_0x113cca[_0x2b2f('0x38')]};return db[_0x2b2f('0x3e')][_0x2b2f('0x22')](_0x376f6d)[_0x2b2f('0x26')](function(_0x48cacd){_0x4b882b[_0x2b2f('0x22')]=_0x48cacd;if(_0x37cc9d[_0x2b2f('0x30')][_0x2b2f('0x3f')]){_0x113cca[_0x2b2f('0x40')]=[{'all':!![]}];}return db[_0x2b2f('0x3e')][_0x2b2f('0x41')](_0x113cca);})['then'](function(_0x4da539){_0x4b882b[_0x2b2f('0x42')]=_0x4da539;return _0x4b882b;})['then'](respondWithFilteredResult(_0x4f452d,_0x113cca))[_0x2b2f('0x43')](handleError(_0x4f452d,null));};exports['show']=function(_0x256a80,_0x43f2b4){var _0x516ecf={'raw':!![],'where':{'id':_0x256a80[_0x2b2f('0x44')]['id']}},_0x685d7a={};_0x685d7a['model']=_['keys'](db[_0x2b2f('0x3e')][_0x2b2f('0x45')]);_0x685d7a[_0x2b2f('0x30')]=_['keys'](_0x256a80[_0x2b2f('0x30')]);_0x685d7a['filters']=_[_0x2b2f('0x46')](_0x685d7a['model'],_0x685d7a[_0x2b2f('0x30')]);_0x516ecf[_0x2b2f('0x32')]=_[_0x2b2f('0x46')](_0x685d7a['model'],qs[_0x2b2f('0x33')](_0x256a80[_0x2b2f('0x30')]['fields']));_0x516ecf[_0x2b2f('0x32')]=_0x516ecf[_0x2b2f('0x32')]['length']?_0x516ecf[_0x2b2f('0x32')]:_0x685d7a[_0x2b2f('0x31')];if(_0x256a80['query'][_0x2b2f('0x3f')]){_0x516ecf[_0x2b2f('0x40')]=[{'all':!![]}];}_0x516ecf=_[_0x2b2f('0x3c')]({},_0x516ecf,_0x256a80['options']);return db['Attachment'][_0x2b2f('0x47')](_0x516ecf)[_0x2b2f('0x26')](handleEntityNotFound(_0x43f2b4,null))[_0x2b2f('0x26')](respondWithResult(_0x43f2b4,null))['catch'](handleError(_0x43f2b4,null));};exports['clone']=function(_0x5b3c19,_0x455c18){var _0x5f133a={'where':{'id':_0x5b3c19[_0x2b2f('0x44')]['id']}},_0x591e99={};_0x591e99[_0x2b2f('0x31')]=_[_0x2b2f('0x48')](db[_0x2b2f('0x3e')][_0x2b2f('0x45')]);_0x5f133a[_0x2b2f('0x32')]=_[_0x2b2f('0x46')](_0x591e99[_0x2b2f('0x31')],qs[_0x2b2f('0x33')](_0x5b3c19[_0x2b2f('0x30')][_0x2b2f('0x33')]));_0x5f133a[_0x2b2f('0x32')]=_0x5f133a['attributes'][_0x2b2f('0x34')]?_0x5f133a[_0x2b2f('0x32')]:_0x591e99[_0x2b2f('0x31')];if(_0x5b3c19['query']['includeAll']){_0x5f133a[_0x2b2f('0x40')]=[{'all':!![]}];}_0x5f133a=_['merge']({},_0x5f133a,_0x5b3c19[_0x2b2f('0x3d')]);return db[_0x2b2f('0x3e')]['find'](_0x5f133a)[_0x2b2f('0x26')](handleEntityNotFound(_0x455c18,null))[_0x2b2f('0x26')](function(_0xdf8f08){if(_0xdf8f08){var _0x1dbdf0=_0xdf8f08[_0x2b2f('0x49')]({'plain':!![]});_0x1dbdf0=qs[_0x2b2f('0x4a')](_0x1dbdf0,['id',_0x2b2f('0x4b'),'updatedAt']);_0x5b3c19['body']=_[_0x2b2f('0x4a')](_0x5b3c19[_0x2b2f('0x4c')],['id',_0x2b2f('0x4b'),'updatedAt']);return db['Attachment']['create'](_[_0x2b2f('0x3c')](_0x1dbdf0,_0x5b3c19[_0x2b2f('0x4c')]),{'include':_0x5b3c19[_0x2b2f('0x30')][_0x2b2f('0x3f')]?[{'all':!![]}]:undefined});}})[_0x2b2f('0x26')](respondWithResult(_0x455c18,0xc9))['catch'](handleError(_0x455c18,null));};exports['update']=function(_0x465479,_0x595fb9){if(_0x465479[_0x2b2f('0x4c')]['id']){delete _0x465479[_0x2b2f('0x4c')]['id'];}return db[_0x2b2f('0x3e')][_0x2b2f('0x47')]({'where':{'id':_0x465479[_0x2b2f('0x44')]['id']}})[_0x2b2f('0x26')](handleEntityNotFound(_0x595fb9,null))['then'](saveUpdates(_0x465479[_0x2b2f('0x4c')],null))[_0x2b2f('0x26')](respondWithResult(_0x595fb9,null))['catch'](handleError(_0x595fb9,null));};exports[_0x2b2f('0x27')]=function(_0x2ab265,_0x5c9fcd){return db[_0x2b2f('0x3e')][_0x2b2f('0x47')]({'where':{'id':_0x2ab265[_0x2b2f('0x44')]['id']}})[_0x2b2f('0x26')](handleEntityNotFound(_0x5c9fcd,null))[_0x2b2f('0x26')](removeEntity(_0x5c9fcd,null))['catch'](handleError(_0x5c9fcd,null));};exports[_0x2b2f('0x4d')]=function(_0x175a7d,_0xca4182,_0x7c9ea5){_0x175a7d[_0x2b2f('0x4c')][_0x2b2f('0x2a')]=_0x175a7d[_0x2b2f('0x4e')][_0x2b2f('0x4f')];_0x175a7d[_0x2b2f('0x4c')]['basename']=_0x175a7d['file'][_0x2b2f('0x50')];_0x175a7d[_0x2b2f('0x4c')][_0x2b2f('0x2e')]=_0x175a7d[_0x2b2f('0x4e')][_0x2b2f('0x51')];return db[_0x2b2f('0x3e')]['create'](_0x175a7d['body'])[_0x2b2f('0x26')](respondWithResult(_0xca4182,0xc9))[_0x2b2f('0x43')](handleError(_0xca4182,null));};exports[_0x2b2f('0x52')]=function(_0x353247,_0x27feb1,_0x199c9b){return db['Attachment'][_0x2b2f('0x53')]({'where':{'id':_0x353247[_0x2b2f('0x44')]['id']},'raw':!![]})[_0x2b2f('0x26')](handleEntityNotFound(_0x27feb1,null))[_0x2b2f('0x26')](function(_0x55d296){if(_0x55d296){var _0x478ae7=_0x55d296[_0x2b2f('0x54')]!==null;var _0x376758=path['join'](config['root'],_0x2b2f('0x55'));if(_0x478ae7){_0x376758=path[_0x2b2f('0x56')](_0x376758,_0x2b2f('0x57'));}var _0x22a9f0=path[_0x2b2f('0x56')](_0x376758,_0x55d296[_0x2b2f('0x58')]);return _0x27feb1[_0x2b2f('0x52')](_0x22a9f0);}})[_0x2b2f('0x43')](handleError(_0x27feb1,null));}; \ No newline at end of file +var _0xacf4=['findAll','rows','catch','show','params','intersection','find','clone','get','omit','createdAt','body','updatedAt','create','file','originalname','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','eml-format','zip-dir','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','send','map','Attachment','rawAttributes','fieldName','type','model','name','query','keys','filters','fields','attributes','length','nolimit','order','sort','where','filter','merge','options','includeAll','include'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xacf4,0x186));var _0x4acf=function(_0x4bf457,_0x14dcf4){_0x4bf457=_0x4bf457-0x0;var _0x232be2=_0xacf4[_0x4bf457];return _0x232be2;};'use strict';var emlformat=require(_0x4acf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4acf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4acf('0x2'));var moment=require(_0x4acf('0x3'));var BPromise=require(_0x4acf('0x4'));var Mustache=require(_0x4acf('0x5'));var util=require(_0x4acf('0x6'));var path=require(_0x4acf('0x7'));var sox=require(_0x4acf('0x8'));var csv=require('to-csv');var ejs=require(_0x4acf('0x9'));var fs=require('fs');var fs_extra=require(_0x4acf('0xa'));var _=require('lodash');var squel=require(_0x4acf('0xb'));var crypto=require(_0x4acf('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4acf('0xd'));var toCsv=require(_0x4acf('0xe'));var querystring=require('querystring');var Papa=require(_0x4acf('0xf'));var Redis=require(_0x4acf('0x10'));var authService=require(_0x4acf('0x11'));var qs=require(_0x4acf('0x12'));var as=require(_0x4acf('0x13'));var hardwareService=require(_0x4acf('0x14'));var logger=require(_0x4acf('0x15'))('api');var utils=require(_0x4acf('0x16'));var config=require(_0x4acf('0x17'));var licenseUtil=require(_0x4acf('0x18'));var db=require(_0x4acf('0x19'))['db'];function respondWithStatusCode(_0x2f30c1,_0x4ddfce){_0x4ddfce=_0x4ddfce||0xcc;return function(_0x391e31){if(_0x391e31){return _0x2f30c1[_0x4acf('0x1a')](_0x4ddfce);}return _0x2f30c1[_0x4acf('0x1b')](_0x4ddfce)[_0x4acf('0x1c')]();};}function respondWithResult(_0x4486f4,_0x115242){_0x115242=_0x115242||0xc8;return function(_0x55d9e2){if(_0x55d9e2){return _0x4486f4[_0x4acf('0x1b')](_0x115242)[_0x4acf('0x1d')](_0x55d9e2);}};}function respondWithFilteredResult(_0x1a8caf,_0x5b146b){return function(_0x4ecaec){if(_0x4ecaec){var _0x2d2552=typeof _0x5b146b['offset']===_0x4acf('0x1e')&&typeof _0x5b146b[_0x4acf('0x1f')]==='undefined';var _0x2e4c00=_0x4ecaec[_0x4acf('0x20')];var _0x214d1e=_0x2d2552?0x0:_0x5b146b[_0x4acf('0x21')];var _0x2fbe89=_0x2d2552?_0x4ecaec[_0x4acf('0x20')]:_0x5b146b[_0x4acf('0x21')]+_0x5b146b['limit'];var _0x3f73e3;if(_0x2fbe89>=_0x2e4c00){_0x2fbe89=_0x2e4c00;_0x3f73e3=0xc8;}else{_0x3f73e3=0xce;}_0x1a8caf[_0x4acf('0x1b')](_0x3f73e3);return _0x1a8caf[_0x4acf('0x22')](_0x4acf('0x23'),_0x214d1e+'-'+_0x2fbe89+'/'+_0x2e4c00)[_0x4acf('0x1d')](_0x4ecaec);}return null;};}function patchUpdates(_0x39b2c3){return function(_0x4379ea){try{jsonpatch['apply'](_0x4379ea,_0x39b2c3,!![]);}catch(_0x1a6a6a){return BPromise[_0x4acf('0x24')](_0x1a6a6a);}return _0x4379ea[_0x4acf('0x25')]();};}function saveUpdates(_0x4e54dd,_0x436f4e){return function(_0x55ca5b){if(_0x55ca5b){return _0x55ca5b[_0x4acf('0x26')](_0x4e54dd)[_0x4acf('0x27')](function(_0x152b3c){return _0x152b3c;});}return null;};}function removeEntity(_0x5d5011,_0x485319){return function(_0x410968){if(_0x410968){return _0x410968[_0x4acf('0x28')]()['then'](function(){_0x5d5011['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x47a3fd,_0x4c82f4){return function(_0x523c08){if(!_0x523c08){_0x47a3fd['sendStatus'](0x194);}return _0x523c08;};}function handleError(_0x2f980c,_0x4a9fcc){_0x4a9fcc=_0x4a9fcc||0x1f4;return function(_0x17f496){logger[_0x4acf('0x29')](_0x17f496['stack']);if(_0x17f496['name']){delete _0x17f496['name'];}_0x2f980c['status'](_0x4a9fcc)[_0x4acf('0x2a')](_0x17f496);};}exports['index']=function(_0x517264,_0x390928){var _0x32366b={},_0x45e9e6={},_0x3e3115={'count':0x0,'rows':[]};var _0x17325d=_[_0x4acf('0x2b')](db[_0x4acf('0x2c')][_0x4acf('0x2d')],function(_0x58e8af){return{'name':_0x58e8af[_0x4acf('0x2e')],'type':_0x58e8af[_0x4acf('0x2f')]['key']};});_0x45e9e6[_0x4acf('0x30')]=_[_0x4acf('0x2b')](_0x17325d,_0x4acf('0x31'));_0x45e9e6[_0x4acf('0x32')]=_[_0x4acf('0x33')](_0x517264[_0x4acf('0x32')]);_0x45e9e6[_0x4acf('0x34')]=_['intersection'](_0x45e9e6[_0x4acf('0x30')],_0x45e9e6[_0x4acf('0x32')]);_0x32366b['attributes']=_['intersection'](_0x45e9e6['model'],qs['fields'](_0x517264[_0x4acf('0x32')][_0x4acf('0x35')]));_0x32366b['attributes']=_0x32366b[_0x4acf('0x36')][_0x4acf('0x37')]?_0x32366b[_0x4acf('0x36')]:_0x45e9e6['model'];if(!_0x517264[_0x4acf('0x32')]['hasOwnProperty'](_0x4acf('0x38'))){_0x32366b[_0x4acf('0x1f')]=qs[_0x4acf('0x1f')](_0x517264['query'][_0x4acf('0x1f')]);_0x32366b['offset']=qs['offset'](_0x517264[_0x4acf('0x32')][_0x4acf('0x21')]);}_0x32366b[_0x4acf('0x39')]=qs['sort'](_0x517264[_0x4acf('0x32')][_0x4acf('0x3a')]);_0x32366b[_0x4acf('0x3b')]=qs[_0x4acf('0x34')](_['pick'](_0x517264[_0x4acf('0x32')],_0x45e9e6[_0x4acf('0x34')]),_0x17325d);if(_0x517264[_0x4acf('0x32')][_0x4acf('0x3c')]){_0x32366b[_0x4acf('0x3b')]=_[_0x4acf('0x3d')](_0x32366b[_0x4acf('0x3b')],{'$or':_['map'](_0x17325d,function(_0x4ed1d1){if(_0x4ed1d1[_0x4acf('0x2f')]!=='VIRTUAL'){var _0xe42309={};_0xe42309[_0x4ed1d1['name']]={'$like':'%'+_0x517264['query'][_0x4acf('0x3c')]+'%'};return _0xe42309;}})});}_0x32366b=_[_0x4acf('0x3d')]({},_0x32366b,_0x517264[_0x4acf('0x3e')]);var _0x23212b={'where':_0x32366b['where']};return db['Attachment'][_0x4acf('0x20')](_0x23212b)[_0x4acf('0x27')](function(_0x36f948){_0x3e3115[_0x4acf('0x20')]=_0x36f948;if(_0x517264[_0x4acf('0x32')][_0x4acf('0x3f')]){_0x32366b[_0x4acf('0x40')]=[{'all':!![]}];}return db['Attachment'][_0x4acf('0x41')](_0x32366b);})[_0x4acf('0x27')](function(_0x2b1725){_0x3e3115[_0x4acf('0x42')]=_0x2b1725;return _0x3e3115;})['then'](respondWithFilteredResult(_0x390928,_0x32366b))[_0x4acf('0x43')](handleError(_0x390928,null));};exports[_0x4acf('0x44')]=function(_0x18e440,_0x403feb){var _0x12072d={'raw':!![],'where':{'id':_0x18e440[_0x4acf('0x45')]['id']}},_0x3d5c6f={};_0x3d5c6f[_0x4acf('0x30')]=_[_0x4acf('0x33')](db[_0x4acf('0x2c')][_0x4acf('0x2d')]);_0x3d5c6f[_0x4acf('0x32')]=_['keys'](_0x18e440['query']);_0x3d5c6f[_0x4acf('0x34')]=_[_0x4acf('0x46')](_0x3d5c6f[_0x4acf('0x30')],_0x3d5c6f[_0x4acf('0x32')]);_0x12072d['attributes']=_['intersection'](_0x3d5c6f['model'],qs[_0x4acf('0x35')](_0x18e440['query'][_0x4acf('0x35')]));_0x12072d['attributes']=_0x12072d[_0x4acf('0x36')][_0x4acf('0x37')]?_0x12072d[_0x4acf('0x36')]:_0x3d5c6f[_0x4acf('0x30')];if(_0x18e440[_0x4acf('0x32')][_0x4acf('0x3f')]){_0x12072d[_0x4acf('0x40')]=[{'all':!![]}];}_0x12072d=_['merge']({},_0x12072d,_0x18e440[_0x4acf('0x3e')]);return db[_0x4acf('0x2c')][_0x4acf('0x47')](_0x12072d)[_0x4acf('0x27')](handleEntityNotFound(_0x403feb,null))[_0x4acf('0x27')](respondWithResult(_0x403feb,null))[_0x4acf('0x43')](handleError(_0x403feb,null));};exports[_0x4acf('0x48')]=function(_0x138c7c,_0xc6ebec){var _0x4318bb={'where':{'id':_0x138c7c['params']['id']}},_0x1d0bdd={};_0x1d0bdd[_0x4acf('0x30')]=_[_0x4acf('0x33')](db[_0x4acf('0x2c')]['rawAttributes']);_0x4318bb[_0x4acf('0x36')]=_[_0x4acf('0x46')](_0x1d0bdd['model'],qs[_0x4acf('0x35')](_0x138c7c['query'][_0x4acf('0x35')]));_0x4318bb[_0x4acf('0x36')]=_0x4318bb[_0x4acf('0x36')][_0x4acf('0x37')]?_0x4318bb[_0x4acf('0x36')]:_0x1d0bdd[_0x4acf('0x30')];if(_0x138c7c['query']['includeAll']){_0x4318bb[_0x4acf('0x40')]=[{'all':!![]}];}_0x4318bb=_[_0x4acf('0x3d')]({},_0x4318bb,_0x138c7c[_0x4acf('0x3e')]);return db[_0x4acf('0x2c')][_0x4acf('0x47')](_0x4318bb)[_0x4acf('0x27')](handleEntityNotFound(_0xc6ebec,null))[_0x4acf('0x27')](function(_0xbeac2){if(_0xbeac2){var _0xb33f98=_0xbeac2[_0x4acf('0x49')]({'plain':!![]});_0xb33f98=qs[_0x4acf('0x4a')](_0xb33f98,['id',_0x4acf('0x4b'),'updatedAt']);_0x138c7c[_0x4acf('0x4c')]=_['omit'](_0x138c7c['body'],['id',_0x4acf('0x4b'),_0x4acf('0x4d')]);return db[_0x4acf('0x2c')][_0x4acf('0x4e')](_[_0x4acf('0x3d')](_0xb33f98,_0x138c7c['body']),{'include':_0x138c7c[_0x4acf('0x32')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x4acf('0x27')](respondWithResult(_0xc6ebec,0xc9))[_0x4acf('0x43')](handleError(_0xc6ebec,null));};exports['update']=function(_0x450359,_0x528cdc){if(_0x450359[_0x4acf('0x4c')]['id']){delete _0x450359[_0x4acf('0x4c')]['id'];}return db['Attachment'][_0x4acf('0x47')]({'where':{'id':_0x450359['params']['id']}})[_0x4acf('0x27')](handleEntityNotFound(_0x528cdc,null))['then'](saveUpdates(_0x450359[_0x4acf('0x4c')],null))['then'](respondWithResult(_0x528cdc,null))['catch'](handleError(_0x528cdc,null));};exports['destroy']=function(_0x38b8ca,_0x176d15){return db['Attachment'][_0x4acf('0x47')]({'where':{'id':_0x38b8ca[_0x4acf('0x45')]['id']}})[_0x4acf('0x27')](handleEntityNotFound(_0x176d15,null))[_0x4acf('0x27')](removeEntity(_0x176d15,null))[_0x4acf('0x43')](handleError(_0x176d15,null));};exports[_0x4acf('0x4e')]=function(_0x3bbe39,_0x2c62dd,_0xe20668){_0x3bbe39[_0x4acf('0x4c')][_0x4acf('0x31')]=_0x3bbe39[_0x4acf('0x4f')][_0x4acf('0x50')];_0x3bbe39[_0x4acf('0x4c')]['basename']=_0x3bbe39['file'][_0x4acf('0x51')];_0x3bbe39['body']['type']=_0x3bbe39[_0x4acf('0x4f')][_0x4acf('0x52')];return db[_0x4acf('0x2c')][_0x4acf('0x4e')](_0x3bbe39[_0x4acf('0x4c')])[_0x4acf('0x27')](respondWithResult(_0x2c62dd,0xc9))['catch'](handleError(_0x2c62dd,null));};exports[_0x4acf('0x53')]=function(_0x2e2ed7,_0xa9a7ba,_0x1096d8){return db[_0x4acf('0x2c')][_0x4acf('0x54')]({'where':{'id':_0x2e2ed7[_0x4acf('0x45')]['id']},'raw':!![]})[_0x4acf('0x27')](handleEntityNotFound(_0xa9a7ba,null))[_0x4acf('0x27')](function(_0xd345fe){if(_0xd345fe){var _0x591e89=_0xd345fe[_0x4acf('0x55')]!==null;var _0x48e823=path[_0x4acf('0x56')](config[_0x4acf('0x57')],_0x4acf('0x58'));if(_0x591e89){_0x48e823=path['join'](_0x48e823,_0x4acf('0x59'));}var _0x4216b6=path[_0x4acf('0x56')](_0x48e823,_0xd345fe[_0x4acf('0x5a')]);return _0xa9a7ba['download'](_0x4216b6);}})[_0x4acf('0x43')](handleError(_0xa9a7ba,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 7789de8..3decb4c 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 _0xbcdb=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','Attachment','attachments'];(function(_0x209ec9,_0x30378c){var _0x129b1b=function(_0x2f2b9e){while(--_0x2f2b9e){_0x209ec9['push'](_0x209ec9['shift']());}};_0x129b1b(++_0x30378c);}(_0xbcdb,0xe4));var _0xbbcd=function(_0x31362c,_0x46b97d){_0x31362c=_0x31362c-0x0;var _0x341918=_0xbcdb[_0x31362c];return _0x341918;};'use strict';var _=require('lodash');var util=require(_0xbbcd('0x0'));var logger=require(_0xbbcd('0x1'))(_0xbbcd('0x2'));var moment=require(_0xbbcd('0x3'));var BPromise=require(_0xbbcd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbbcd('0x5'));var rimraf=require(_0xbbcd('0x6'));var config=require(_0xbbcd('0x7'));var attributes=require('./attachment.attributes');module[_0xbbcd('0x8')]=function(_0x1273af,_0x500596){return _0x1273af[_0xbbcd('0x9')](_0xbbcd('0xa'),attributes,{'tableName':_0xbbcd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc832=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','./attachment.attributes','exports','define','Attachment','attachments','lodash'];(function(_0x239a3d,_0xc087f4){var _0x1a43de=function(_0x2b2391){while(--_0x2b2391){_0x239a3d['push'](_0x239a3d['shift']());}};_0x1a43de(++_0xc087f4);}(_0xc832,0xf6));var _0x2c83=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xc832[_0x33032e];return _0x13316b;};'use strict';var _=require(_0x2c83('0x0'));var util=require(_0x2c83('0x1'));var logger=require(_0x2c83('0x2'))(_0x2c83('0x3'));var moment=require('moment');var BPromise=require(_0x2c83('0x4'));var rp=require(_0x2c83('0x5'));var fs=require('fs');var path=require(_0x2c83('0x6'));var rimraf=require(_0x2c83('0x7'));var config=require('../../config/environment');var attributes=require(_0x2c83('0x8'));module[_0x2c83('0x9')]=function(_0x44fefc,_0x424a78){return _0x44fefc[_0x2c83('0xa')](_0x2c83('0xb'),attributes,{'tableName':_0x2c83('0xc'),'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 a2d2838..618b947 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 _0x22fb=['message','error','result','catch','Attachment','create','options','raw','CreateAttachment','stringify','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','code'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x22fb,0x192));var _0xb22f=function(_0x3fdabd,_0x4f21c3){_0x3fdabd=_0x3fdabd-0x0;var _0x323f9b=_0x22fb[_0x3fdabd];return _0x323f9b;};'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']('Attachment,\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')]('Attachment,\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);});});}exports['CreateAttachment']=function(_0x252742){var _0x35caec=this;return new Promise(function(_0x2aaec4,_0x1f515d){return db[_0xb22f('0x16')][_0xb22f('0x17')](_0x252742['body'],{'raw':_0x252742[_0xb22f('0x18')]?_0x252742['options'][_0xb22f('0x19')]===undefined?!![]:![]:!![]})[_0xb22f('0xb')](function(_0x316f11){logger[_0xb22f('0xc')](_0xb22f('0x1a'),_0x252742);logger['debug']('CreateAttachment',_0x252742,JSON[_0xb22f('0x1b')](_0x316f11));_0x2aaec4(_0x316f11);})[_0xb22f('0x15')](function(_0xf34e0d){logger[_0xb22f('0x13')](_0xb22f('0x1a'),_0xf34e0d[_0xb22f('0x12')],_0x252742);_0x1f515d(_0x35caec[_0xb22f('0x13')](0x1f4,_0xf34e0d[_0xb22f('0x12')]));});});}; \ No newline at end of file +var _0x559a=['request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x5207d6,_0x2eb625){var _0x2c7443=function(_0x3201d2){while(--_0x3201d2){_0x5207d6['push'](_0x5207d6['shift']());}};_0x2c7443(++_0x2eb625);}(_0x559a,0xb3));var _0xa559=function(_0x1b3381,_0x568e87){_0x1b3381=_0x1b3381-0x0;var _0x114fec=_0x559a[_0x1b3381];return _0x114fec;};'use strict';var _=require(_0xa559('0x0'));var util=require(_0xa559('0x1'));var moment=require('moment');var BPromise=require(_0xa559('0x2'));var rs=require(_0xa559('0x3'));var fs=require('fs');var Redis=require(_0xa559('0x4'));var db=require(_0xa559('0x5'))['db'];var utils=require(_0xa559('0x6'));var logger=require(_0xa559('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa559('0x8'));var client=jayson[_0xa559('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2edab4,_0x1a5cec,_0x4eada1){return new BPromise(function(_0xb8055,_0x218e3b){return client[_0xa559('0xa')](_0x2edab4,_0x4eada1)[_0xa559('0xb')](function(_0x48aa9a){logger[_0xa559('0xc')](_0xa559('0xd'),_0x1a5cec,_0xa559('0xe'));logger[_0xa559('0xf')]('Attachment,\x20%s,\x20%s,\x20%s',_0x1a5cec,'request\x20sent',JSON[_0xa559('0x10')](_0x48aa9a));if(_0x48aa9a[_0xa559('0x11')]){if(_0x48aa9a['error'][_0xa559('0x12')]===0x1f4){logger['error'](_0xa559('0xd'),_0x1a5cec,_0x48aa9a['error'][_0xa559('0x13')]);return _0x218e3b(_0x48aa9a[_0xa559('0x11')][_0xa559('0x13')]);}logger['error'](_0xa559('0xd'),_0x1a5cec,_0x48aa9a[_0xa559('0x11')]['message']);return _0xb8055(_0x48aa9a[_0xa559('0x11')][_0xa559('0x13')]);}else{logger[_0xa559('0xc')](_0xa559('0xd'),_0x1a5cec,'request\x20sent');_0xb8055(_0x48aa9a[_0xa559('0x14')]['message']);}})[_0xa559('0x15')](function(_0x1387b6){logger['error'](_0xa559('0xd'),_0x1a5cec,_0x1387b6);_0x218e3b(_0x1387b6);});});}exports[_0xa559('0x16')]=function(_0x163405){var _0xd21ebf=this;return new Promise(function(_0x1a4c42,_0x16f090){return db[_0xa559('0x17')][_0xa559('0x18')](_0x163405[_0xa559('0x19')],{'raw':_0x163405[_0xa559('0x1a')]?_0x163405['options']['raw']===undefined?!![]:![]:!![]})[_0xa559('0xb')](function(_0x3aa532){logger['info'](_0xa559('0x16'),_0x163405);logger[_0xa559('0xf')](_0xa559('0x16'),_0x163405,JSON[_0xa559('0x10')](_0x3aa532));_0x1a4c42(_0x3aa532);})[_0xa559('0x15')](function(_0x2dd8cf){logger['error'](_0xa559('0x16'),_0x2dd8cf['message'],_0x163405);_0x16f090(_0xd21ebf[_0xa559('0x11')](0x1f4,_0x2dd8cf[_0xa559('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index f65c468..29d2f95 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x20daa8,_0x1022a4){var _0xdada56=function(_0x528750){while(--_0x528750){_0x20daa8['push'](_0x20daa8['shift']());}};_0xdada56(++_0x1022a4);}(_0x5f2f,0x73));var _0xf5f2=function(_0x30bea1,_0x468ea6){_0x30bea1=_0x30bea1-0x0;var _0xa2e99c=_0x5f2f[_0x30bea1];return _0xa2e99c;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file +var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x2bd6c9,_0x36a113){var _0x147850=function(_0x5b729a){while(--_0x5b729a){_0x2bd6c9['push'](_0x2bd6c9['shift']());}};_0x147850(++_0x36a113);}(_0xadb5,0xad));var _0x5adb=function(_0x575f66,_0x4d744c){_0x575f66=_0x575f66-0x0;var _0x2db7a5=_0xadb5[_0x575f66];return _0x2db7a5;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index fba8bc7..58819e9 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcbba=['../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','adSsoEnabled','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','role','disabled','blocked','blockedAt','online','admin','user','agent','then','blockDuration','add','minutes','clearBlockUser','getLicense','status','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','password','User','passport','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x23b349,_0xf34aaa){var _0x32ef80=function(_0x1d5660){while(--_0x1d5660){_0x23b349['push'](_0x23b349['shift']());}};_0x32ef80(++_0xf34aaa);}(_0xcbba,0x16a));var _0xacbb=function(_0x263b36,_0x988d3c){_0x263b36=_0x263b36-0x0;var _0x64387b=_0xcbba[_0x263b36];return _0x64387b;};'use strict';var passport=require(_0xacbb('0x0'));var LocalStrategy=require('passport-local')[_0xacbb('0x1')];var moment=require(_0xacbb('0x2'));var ActiveDirectory=require(_0xacbb('0x3'));var BPromise=require(_0xacbb('0x4'));var util=require(_0xacbb('0x5'));var db=require(_0xacbb('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xacbb('0x7'));var config=require(_0xacbb('0x8'));var logger=require(_0xacbb('0x9'))(_0xacbb('0xa'));function isActiveDirectoryConfigured(_0x30e358){var _0x452740=![];if(typeof _0x30e358[_0xacbb('0xb')]!==_0xacbb('0xc')){_0x452740=_0x30e358[_0xacbb('0xb')][_0xacbb('0xd')]&&_0x30e358[_0xacbb('0xb')][_0xacbb('0xe')]&&_0x30e358[_0xacbb('0xb')][_0xacbb('0xf')];}return _0x452740;}function adAuthenticate(_0x390018,_0x1a87db,_0x117374){return new BPromise(function(_0x494708,_0xb163e){try{var _0x74fb8c=new ActiveDirectory(_0x390018);_0x74fb8c[_0xacbb('0x10')](_0x1a87db,_0x117374,function(_0x3f05b8,_0x144efe){if(_0x3f05b8){logger[_0xacbb('0x11')](_0xacbb('0x12'),_0x1a87db,util[_0xacbb('0x13')](_0x3f05b8,{'showHidden':![],'depth':null}));_0xb163e(_0xacbb('0x14'));}else if(!_0x144efe){logger[_0xacbb('0x11')](_0xacbb('0x15'),_0x1a87db);_0xb163e(_0xacbb('0x14'));}else{_0x494708(_0x144efe);}});}catch(_0x55ada0){_0xb163e(_0x55ada0);}});}function ActiveDirectoryAuthenticate(_0x34b2ba,_0x22ef55,_0x23f8f4,_0x3b178b){var _0x5c438b,_0x2d9dd2;if(!isActiveDirectoryConfigured(config)){logger[_0xacbb('0x11')](_0xacbb('0x16'),_0x22ef55);return _0x3b178b(null,![],{'message':_0xacbb('0x14')});}return db['Setting'][_0xacbb('0x17')]({'where':{'id':0x1},'attributes':[_0xacbb('0x18'),'blockDuration'],'raw':!![]})['then'](function(_0x5c4c58){_0x5c438b=_0x5c4c58;if(!_0x5c438b[_0xacbb('0x18')]){logger[_0xacbb('0x11')](_0xacbb('0x19'),_0x22ef55);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x34b2ba['findOne']({'attributes':['id',_0xacbb('0x1a'),'password',_0xacbb('0x1b'),_0xacbb('0x1c'),_0xacbb('0x1d'),_0xacbb('0x1e'),_0xacbb('0x1f'),_0xacbb('0x20')],'where':{'name':_0x22ef55,'role':{'$or':[_0xacbb('0x21'),_0xacbb('0x22'),_0xacbb('0x23')]},'adSsoEnabled':!![]}});})[_0xacbb('0x24')](function(_0x28cba4){if(!_0x28cba4||_0x28cba4&&_0x28cba4['name']!==_0x22ef55){throw new Error(_0xacbb('0x14'));}_0x2d9dd2=_0x28cba4;var _0x1fe481=_0x2d9dd2[_0xacbb('0x1a')]+'@'+config[_0xacbb('0xb')][_0xacbb('0xf')];return adAuthenticate(config[_0xacbb('0xb')],_0x1fe481,_0x23f8f4);})['then'](function(_0x437217){if(_0x2d9dd2[_0xacbb('0x1d')]){throw new Error(_0xacbb('0x14'));}if(_0x5c438b[_0xacbb('0x25')]>0x0){if(_0x2d9dd2[_0xacbb('0x1e')]){if(moment(_0x2d9dd2[_0xacbb('0x1f')])[_0xacbb('0x26')](_0x5c438b[_0xacbb('0x25')],_0xacbb('0x27'))>moment()){throw new Error(_0xacbb('0x14'));}return utils[_0xacbb('0x28')](_0x2d9dd2,0x0,![],null)[_0xacbb('0x24')](function(){return utils[_0xacbb('0x29')](_0x2d9dd2);})[_0xacbb('0x24')](function(){return _0x3b178b(null,_0x2d9dd2);});}else{return utils[_0xacbb('0x29')](_0x2d9dd2)[_0xacbb('0x24')](function(){return _0x3b178b(null,_0x2d9dd2);});}}else{return utils[_0xacbb('0x29')](_0x2d9dd2)[_0xacbb('0x24')](function(){return _0x3b178b(null,_0x2d9dd2);});}})['catch'](function(_0x1fe214){return _0x3b178b(null,![],_0x1fe214);});}function handleError(_0x321110,_0x351502,_0x2c7de9){return _0x321110[_0xacbb('0x2a')](_0x351502||0x1f4)[_0xacbb('0x2b')]({'message':_0x2c7de9?_0x2c7de9[_0xacbb('0x2c')]||_0x2c7de9:''});}exports[_0xacbb('0x2d')]=function(_0x372dda,_0x3df636,_0x530416){passport[_0xacbb('0x10')](_0xacbb('0x2e'),function(_0x3b3f4e,_0x12533a,_0x274cc5){var _0x227006=_0x3b3f4e||_0x274cc5;if(_0x227006){return handleError(_0x3df636,0x191,_0x227006);}if(!_0x12533a){return handleError(_0x3df636,0x194,{'message':_0xacbb('0x2f')});}else{var _0x312ec5={'payload':{'id':_0x12533a['id'],'role':_0x12533a[_0xacbb('0x1c')]},'options':{'expiresIn':0x15180}};return authService[_0xacbb('0x30')](_0x312ec5)[_0xacbb('0x24')](function(_0x5a9d3a){_0x3df636[_0xacbb('0x31')]({'id':_0x12533a['id'],'token':_0x5a9d3a,'statusCall':'','isAlreadyLogged':_0x12533a[_0xacbb('0x20')]});});}})(_0x372dda,_0x3df636,_0x530416);};passport[_0xacbb('0x32')](_0xacbb('0x2e'),new LocalStrategy({'usernameField':'name','passwordField':_0xacbb('0x33')},function(_0x1a1f7d,_0x2ed80a,_0x53789c){return ActiveDirectoryAuthenticate(db[_0xacbb('0x34')],_0x1a1f7d,_0x2ed80a,_0x53789c);})); \ No newline at end of file +var _0xcc20=['admin','user','agent','minutes','clearBlockUser','getLicense','catch','status','message','login','ad-login','json','passport','passport-local','moment','activedirectory2','util','../../config/utils','../../config/environment','../../config/logger','undefined','activedirectory','baseDN','url','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','salt','role','disabled','blocked','blockedAt','online'];(function(_0x360e5c,_0x1d60de){var _0x3629ea=function(_0x3f12b6){while(--_0x3f12b6){_0x360e5c['push'](_0x360e5c['shift']());}};_0x3629ea(++_0x1d60de);}(_0xcc20,0x114));var _0x0cc2=function(_0x18d9cb,_0x4df904){_0x18d9cb=_0x18d9cb-0x0;var _0x5ba26d=_0xcc20[_0x18d9cb];return _0x5ba26d;};'use strict';var passport=require(_0x0cc2('0x0'));var LocalStrategy=require(_0x0cc2('0x1'))['Strategy'];var moment=require(_0x0cc2('0x2'));var ActiveDirectory=require(_0x0cc2('0x3'));var BPromise=require('bluebird');var util=require(_0x0cc2('0x4'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x0cc2('0x5'));var config=require(_0x0cc2('0x6'));var logger=require(_0x0cc2('0x7'))('api');function isActiveDirectoryConfigured(_0x390b91){var _0x169d72=![];if(typeof _0x390b91['activedirectory']!==_0x0cc2('0x8')){_0x169d72=_0x390b91[_0x0cc2('0x9')][_0x0cc2('0xa')]&&_0x390b91[_0x0cc2('0x9')][_0x0cc2('0xb')]&&_0x390b91[_0x0cc2('0x9')]['domain'];}return _0x169d72;}function adAuthenticate(_0x30a25c,_0x2d91c8,_0x4977eb){return new BPromise(function(_0x3d705c,_0x52fcf2){try{var _0x230fb1=new ActiveDirectory(_0x30a25c);_0x230fb1[_0x0cc2('0xc')](_0x2d91c8,_0x4977eb,function(_0x1ba5a8,_0x16575d){if(_0x1ba5a8){logger[_0x0cc2('0xd')](_0x0cc2('0xe'),_0x2d91c8,util[_0x0cc2('0xf')](_0x1ba5a8,{'showHidden':![],'depth':null}));_0x52fcf2(_0x0cc2('0x10'));}else if(!_0x16575d){logger[_0x0cc2('0xd')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x2d91c8);_0x52fcf2('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x3d705c(_0x16575d);}});}catch(_0x50c282){_0x52fcf2(_0x50c282);}});}function ActiveDirectoryAuthenticate(_0x26a506,_0x39fb38,_0x3e2e5e,_0x5b0869){var _0x151644,_0x29b1fd;if(!isActiveDirectoryConfigured(config)){logger[_0x0cc2('0xd')](_0x0cc2('0x11'),_0x39fb38);return _0x5b0869(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x0cc2('0x12')]['findOne']({'where':{'id':0x1},'attributes':[_0x0cc2('0x13'),_0x0cc2('0x14')],'raw':!![]})[_0x0cc2('0x15')](function(_0x48522a){_0x151644=_0x48522a;if(!_0x151644['adSsoEnabled']){logger[_0x0cc2('0xd')](_0x0cc2('0x16'),_0x39fb38);throw new Error(_0x0cc2('0x10'));}return _0x26a506[_0x0cc2('0x17')]({'attributes':['id',_0x0cc2('0x18'),_0x0cc2('0x19'),_0x0cc2('0x1a'),_0x0cc2('0x1b'),_0x0cc2('0x1c'),_0x0cc2('0x1d'),_0x0cc2('0x1e'),_0x0cc2('0x1f')],'where':{'name':_0x39fb38,'role':{'$or':[_0x0cc2('0x20'),_0x0cc2('0x21'),_0x0cc2('0x22')]},'adSsoEnabled':!![]}});})['then'](function(_0x3aefc5){if(!_0x3aefc5||_0x3aefc5&&_0x3aefc5[_0x0cc2('0x18')]!==_0x39fb38){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x29b1fd=_0x3aefc5;var _0x398f8c=_0x29b1fd[_0x0cc2('0x18')]+'@'+config[_0x0cc2('0x9')]['domain'];return adAuthenticate(config['activedirectory'],_0x398f8c,_0x3e2e5e);})[_0x0cc2('0x15')](function(_0x4ef0ee){if(_0x29b1fd[_0x0cc2('0x1c')]){throw new Error(_0x0cc2('0x10'));}if(_0x151644['blockDuration']>0x0){if(_0x29b1fd[_0x0cc2('0x1d')]){if(moment(_0x29b1fd['blockedAt'])['add'](_0x151644[_0x0cc2('0x14')],_0x0cc2('0x23'))>moment()){throw new Error(_0x0cc2('0x10'));}return utils[_0x0cc2('0x24')](_0x29b1fd,0x0,![],null)[_0x0cc2('0x15')](function(){return utils[_0x0cc2('0x25')](_0x29b1fd);})[_0x0cc2('0x15')](function(){return _0x5b0869(null,_0x29b1fd);});}else{return utils['getLicense'](_0x29b1fd)[_0x0cc2('0x15')](function(){return _0x5b0869(null,_0x29b1fd);});}}else{return utils[_0x0cc2('0x25')](_0x29b1fd)['then'](function(){return _0x5b0869(null,_0x29b1fd);});}})[_0x0cc2('0x26')](function(_0x5414e5){return _0x5b0869(null,![],_0x5414e5);});}function handleError(_0x3996d4,_0x3c8adb,_0x2f7b92){return _0x3996d4[_0x0cc2('0x27')](_0x3c8adb||0x1f4)['send']({'message':_0x2f7b92?_0x2f7b92[_0x0cc2('0x28')]||_0x2f7b92:''});}exports[_0x0cc2('0x29')]=function(_0x499174,_0x57de66,_0x52dfbf){passport[_0x0cc2('0xc')](_0x0cc2('0x2a'),function(_0x204490,_0x47e8e3,_0x34c28c){var _0x4a4311=_0x204490||_0x34c28c;if(_0x4a4311){return handleError(_0x57de66,0x191,_0x4a4311);}if(!_0x47e8e3){return handleError(_0x57de66,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x2ef2cd={'payload':{'id':_0x47e8e3['id'],'role':_0x47e8e3[_0x0cc2('0x1b')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x2ef2cd)['then'](function(_0x27b49c){_0x57de66[_0x0cc2('0x2b')]({'id':_0x47e8e3['id'],'token':_0x27b49c,'statusCall':'','isAlreadyLogged':_0x47e8e3[_0x0cc2('0x1f')]});});}})(_0x499174,_0x57de66,_0x52dfbf);};passport['use'](_0x0cc2('0x2a'),new LocalStrategy({'usernameField':'name','passwordField':_0x0cc2('0x19')},function(_0x17238e,_0x5c7efb,_0x26757c){return ActiveDirectoryAuthenticate(db['User'],_0x17238e,_0x5c7efb,_0x26757c);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 45e531c..b11b2f4 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb626=['./authActiveDirectory.controller','post','express','Router'];(function(_0x506477,_0x45b375){var _0x176218=function(_0x3d7d0c){while(--_0x3d7d0c){_0x506477['push'](_0x506477['shift']());}};_0x176218(++_0x45b375);}(_0xb626,0x17a));var _0x6b62=function(_0x43f1f4,_0x2207b6){_0x43f1f4=_0x43f1f4-0x0;var _0x3b5c46=_0xb626[_0x43f1f4];return _0x3b5c46;};'use strict';var express=require(_0x6b62('0x0'));var router=express[_0x6b62('0x1')]();var controller=require(_0x6b62('0x2'));router[_0x6b62('0x3')]('/',controller['login']);module['exports']=router; \ No newline at end of file +var _0x238b=['exports','express','Router','login'];(function(_0x1b4155,_0x2396c9){var _0x106480=function(_0x5769bc){while(--_0x5769bc){_0x1b4155['push'](_0x1b4155['shift']());}};_0x106480(++_0x2396c9);}(_0x238b,0xd1));var _0xb238=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x238b[_0x14add3];return _0x4a174f;};'use strict';var express=require(_0xb238('0x0'));var router=express[_0xb238('0x1')]();var controller=require('./authActiveDirectory.controller');router['post']('/',controller[_0xb238('0x2')]);module[_0xb238('0x3')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index edc30e6..cd037c4 100644 --- a/server/api/authGoogle/authGoogle.controller.js +++ b/server/api/authGoogle/authGoogle.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x114693,_0x21e8ba){var _0xc04995=function(_0x4fa7a9){while(--_0x4fa7a9){_0x114693['push'](_0x114693['shift']());}};_0xc04995(++_0x21e8ba);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x7a54,0x106));var _0x47a5=function(_0x11b9ff,_0x4ea87e){_0x11b9ff=_0x11b9ff-0x0;var _0x436e8d=_0x7a54[_0x11b9ff];return _0x436e8d;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 5a58816..986f749 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 _0xe25e=['get','/callback','isMiddleware','setTokenCookie','passport','Router','./authGoogle.controller','../../components/auth/service'];(function(_0x47dd48,_0x33c6e2){var _0x31e99e=function(_0xcde139){while(--_0xcde139){_0x47dd48['push'](_0x47dd48['shift']());}};_0x31e99e(++_0x33c6e2);}(_0xe25e,0x10c));var _0xee25=function(_0x5bd613,_0x151a02){_0x5bd613=_0x5bd613-0x0;var _0x62f674=_0xe25e[_0x5bd613];return _0x62f674;};'use strict';var express=require('express');var passport=require(_0xee25('0x0'));var router=express[_0xee25('0x1')]();var controller=require(_0xee25('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0xee25('0x3'));router[_0xee25('0x4')]('/',controller['login']);router['get'](_0xee25('0x5'),controller['callback'],authService[_0xee25('0x6')],userController['login'],authService[_0xee25('0x7')]);module['exports']=router; \ No newline at end of file +var _0xc42d=['callback','setTokenCookie','exports','express','passport','Router','../user/user.controller.js','../../components/auth/service','get','login','/callback'];(function(_0x36f56b,_0x4f7224){var _0x34fe0d=function(_0x3dcf3c){while(--_0x3dcf3c){_0x36f56b['push'](_0x36f56b['shift']());}};_0x34fe0d(++_0x4f7224);}(_0xc42d,0x1dc));var _0xdc42=function(_0x34ddd4,_0x143395){_0x34ddd4=_0x34ddd4-0x0;var _0x82e9a9=_0xc42d[_0x34ddd4];return _0x82e9a9;};'use strict';var express=require(_0xdc42('0x0'));var passport=require(_0xdc42('0x1'));var router=express[_0xdc42('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0xdc42('0x3'));var authService=require(_0xdc42('0x4'));router[_0xdc42('0x5')]('/',controller[_0xdc42('0x6')]);router['get'](_0xdc42('0x7'),controller[_0xdc42('0x8')],authService['isMiddleware'],userController[_0xdc42('0x6')],authService[_0xdc42('0x9')]);module[_0xdc42('0xa')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 20a043d..6742e61 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 _0x7bd7=['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/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','validatePasswordPattern','password','enforcePasswordHistory','validatePasswordHistory','previousPasswords','passwordHistoryLimit','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','salt','role','disabled','blocked','loginAttempts','admin','user','agent','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','blockedAt','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset'];(function(_0x5c7158,_0x40146f){var _0x526bc4=function(_0x58260f){while(--_0x58260f){_0x5c7158['push'](_0x5c7158['shift']());}};_0x526bc4(++_0x40146f);}(_0x7bd7,0x173));var _0x77bd=function(_0x54a166,_0x259c8f){_0x54a166=_0x54a166-0x0;var _0x2c4472=_0x7bd7[_0x54a166];return _0x2c4472;};'use strict';var util=require(_0x77bd('0x0'));var passport=require(_0x77bd('0x1'));var LocalStrategy=require(_0x77bd('0x2'))[_0x77bd('0x3')];var jayson=require(_0x77bd('0x4'));var _=require('lodash');var rs=require(_0x77bd('0x5'));var moment=require(_0x77bd('0x6'));var db=require(_0x77bd('0x7'))['db'];var authService=require(_0x77bd('0x8'));var utils=require('../../config/utils');var client=jayson[_0x77bd('0x9')][_0x77bd('0xa')]({'port':0x232b});function localAuthenticate(_0x4ab0ba,_0x7d389c,_0x22ce4c,_0x974de0){var _0x6cee37,_0x1407e3;return db[_0x77bd('0xb')][_0x77bd('0xc')]({'where':{'id':0x1},'attributes':[_0x77bd('0xd'),_0x77bd('0xe')],'raw':!![]})[_0x77bd('0xf')](function(_0x280d93){_0x6cee37=_0x280d93;return _0x4ab0ba[_0x77bd('0xc')]({'attributes':['id',_0x77bd('0x10'),'password',_0x77bd('0x11'),_0x77bd('0x12'),_0x77bd('0x13'),_0x77bd('0x14'),'blockedAt',_0x77bd('0x15')],'where':{'name':_0x7d389c,'role':{'$or':[_0x77bd('0x16'),_0x77bd('0x17'),_0x77bd('0x18')]}}});})['then'](function(_0x4edd38){if(!_0x4edd38||_0x4edd38&&_0x4edd38[_0x77bd('0x10')]!==_0x7d389c){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x1407e3=_0x4edd38;return _0x1407e3;}})[_0x77bd('0xf')](function(){_0x1407e3[_0x77bd('0x19')](_0x22ce4c,function(_0x34082e,_0x113427){var _0x57c06d=_0x1407e3[_0x77bd('0x15')]+0x1;if(_0x34082e){return _0x974de0(_0x34082e);}else if(!_0x113427){if(_0x1407e3[_0x77bd('0x13')]){return _0x974de0(null,![],{'message':_0x77bd('0x1a')});}else if(_0x6cee37['allowedLoginAttempts']>0x0){if(_0x1407e3[_0x77bd('0x14')]){if(_0x6cee37[_0x77bd('0xe')]>0x0){if(moment(_0x1407e3['blockedAt'])[_0x77bd('0x1b')](_0x6cee37[_0x77bd('0xe')],_0x77bd('0x1c'))>moment()){return _0x974de0(null,![],{'message':_0x77bd('0x1a')});}else{return utils[_0x77bd('0x1d')](_0x1407e3,_0x57c06d,![],null)['then'](function(){return _0x974de0(null,![],{'message':_0x77bd('0x1a')});});}}else{return _0x974de0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x57c06d>=_0x6cee37[_0x77bd('0xd')]){return utils[_0x77bd('0x1d')](_0x1407e3,0x0,!![],moment())['then'](function(){return _0x974de0(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x77bd('0x1d')](_0x1407e3,_0x57c06d,![],null)['then'](function(){return _0x974de0(null,![],{'message':_0x77bd('0x1a')});});}}}else{return _0x974de0(null,![],{'message':_0x77bd('0x1a')});}}else{if(_0x1407e3['disabled']){return _0x974de0(null,![],{'message':_0x77bd('0x1a')});}else if(_0x6cee37[_0x77bd('0xd')]>0x0){if(_0x1407e3[_0x77bd('0x14')]){if(_0x6cee37[_0x77bd('0xe')]>0x0){if(moment(_0x1407e3[_0x77bd('0x1e')])[_0x77bd('0x1b')](_0x6cee37[_0x77bd('0xe')],_0x77bd('0x1c'))>moment()){return _0x974de0(null,![],{'message':_0x77bd('0x1a')});}else{return utils[_0x77bd('0x1d')](_0x1407e3,0x0,![],null)[_0x77bd('0xf')](function(){return utils[_0x77bd('0x1f')](_0x1407e3);})[_0x77bd('0xf')](function(){return _0x974de0(null,_0x1407e3);});}}else{return _0x974de0(null,![],{'message':_0x77bd('0x1a')});}}else{return utils['clearBlockUser'](_0x1407e3,0x0,![],null)[_0x77bd('0xf')](function(){return utils['getLicense'](_0x1407e3);})[_0x77bd('0xf')](function(){return _0x974de0(null,_0x1407e3);})[_0x77bd('0x20')](function(_0x5c6800){return _0x974de0(null,![],_0x5c6800);});}}else{if(_0x1407e3[_0x77bd('0x14')]){return _0x974de0(null,![],{'message':_0x77bd('0x1a')});}else{return utils[_0x77bd('0x1f')](_0x1407e3)[_0x77bd('0xf')](function(){return _0x974de0(null,_0x1407e3);});}}}});})['catch'](function(_0x512a6b){return _0x974de0(null,![],_0x512a6b);});}function sendServiceMail(_0x49e460){return db[_0x77bd('0x21')][_0x77bd('0x22')]({'where':{'service':!![]},'attributes':['id',_0x77bd('0x10'),_0x77bd('0x23')],'include':[{'model':db[_0x77bd('0x24')],'as':_0x77bd('0x25'),'include':[{'model':db[_0x77bd('0x26')],'as':_0x77bd('0x26')}]}]})['then'](function(_0x4c8a11){if(!_0x4c8a11){throw new Error(_0x77bd('0x27'));}var _0x1e66c5=_0x4c8a11['getSmtpOptions']();var _0x34d5f2={'account':_0x1e66c5,'message':_['merge']({'from':util[_0x77bd('0x28')](_0x77bd('0x29'),_0x4c8a11[_0x77bd('0x10')],_0x4c8a11[_0x77bd('0x23')]||_0x4c8a11['Smtp'][_0x77bd('0x17')])},_0x49e460)};return client[_0x77bd('0x2a')](_0x77bd('0x2b'),_0x34d5f2);})['then'](function(_0x40a914){if(_0x40a914[_0x77bd('0x2c')]){throw new Error(util[_0x77bd('0x28')](_0x77bd('0x2d'),_0x40a914['error'][_0x77bd('0x2e')]||JSON['stringify'](_0x40a914[_0x77bd('0x2c')])));}return!![];});}function handleError(_0xaebef9,_0x215f5d,_0x59334a){return _0xaebef9[_0x77bd('0x2f')](_0x215f5d||0x1f4)[_0x77bd('0x30')]({'message':_0x59334a?_0x59334a[_0x77bd('0x2e')]||_0x59334a:''});}exports[_0x77bd('0x31')]=function(_0x85106d,_0x19d99f,_0x50a170){passport['authenticate'](_0x77bd('0x32'),function(_0xfd0764,_0x4e75ff,_0x4867c8){var _0x59dd78=_0xfd0764||_0x4867c8;if(_0x59dd78){return handleError(_0x19d99f,0x191,_0x59dd78);}if(!_0x4e75ff){return handleError(_0x19d99f,0x194,{'message':_0x77bd('0x33')});}else{var _0xe481b9={'payload':{'id':_0x4e75ff['id'],'role':_0x4e75ff[_0x77bd('0x12')]},'options':{'expiresIn':0x15180}};return authService[_0x77bd('0x34')](_0xe481b9)['then'](function(_0x2c40f0){_0x19d99f[_0x77bd('0x35')]({'id':_0x4e75ff['id'],'token':_0x2c40f0,'statusCall':'','isAlreadyLogged':_0x4e75ff[_0x77bd('0x36')]});});}})(_0x85106d,_0x19d99f,_0x50a170);};exports[_0x77bd('0x37')]=function(_0x969245,_0x5a7140){if(!_0x969245[_0x77bd('0x38')][_0x77bd('0x23')]){return handleError(_0x5a7140,0x1f4,{'message':_0x77bd('0x39')});}var _0x52c6bc=rs[_0x77bd('0x3a')]();_0x969245[_0x77bd('0x38')][_0x77bd('0x23')]=_0x969245[_0x77bd('0x38')]['email'][_0x77bd('0x3b')]()[_0x77bd('0x3c')]();var _0x3269de;return db[_0x77bd('0xb')][_0x77bd('0xc')]({'where':{'id':0x1},'attributes':[_0x77bd('0xd'),'blockDuration'],'raw':!![]})['then'](function(_0x503d37){_0x3269de=_0x503d37;return db[_0x77bd('0x3d')][_0x77bd('0x22')]({'where':{'email':_0x969245['body'][_0x77bd('0x23')]}});})[_0x77bd('0xf')](function(_0x320eee){if(!_0x320eee){throw new Error(_0x77bd('0x3e'));}if(_0x320eee[_0x77bd('0x13')]){throw new Error(_0x77bd('0x3f'));}if(_0x320eee[_0x77bd('0x14')]){if(moment(_0x320eee[_0x77bd('0x1e')])[_0x77bd('0x1b')](_0x3269de[_0x77bd('0xe')],_0x77bd('0x1c'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x320eee[_0x77bd('0x14')]=![];_0x320eee[_0x77bd('0x1e')]=null;}}_0x320eee[_0x77bd('0x40')]=_0x52c6bc;_0x320eee[_0x77bd('0x41')]=Date[_0x77bd('0x42')]()+0x36ee80;return _0x320eee[_0x77bd('0x43')]();})[_0x77bd('0xf')](function(){return sendServiceMail({'to':_0x969245['body'][_0x77bd('0x23')],'subject':_0x77bd('0x44'),'text':_0x77bd('0x45')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x77bd('0x46')+_0x969245[_0x77bd('0x47')]['host']+_0x77bd('0x48')+_0x52c6bc+'\x0a\x0a'+_0x77bd('0x49')});})['then'](function(){_0x5a7140[_0x77bd('0x2f')](0xc8)[_0x77bd('0x30')]({'message':_0x77bd('0x4a')});})[_0x77bd('0x20')](function(_0x1518c4){return handleError(_0x5a7140,0x1f4,_0x1518c4);});};exports[_0x77bd('0x4b')]=function(_0x1131ac,_0x37a26f){return db[_0x77bd('0x3d')][_0x77bd('0x22')]({'where':{'resetPasswordToken':_0x1131ac[_0x77bd('0x4c')][_0x77bd('0x4d')],'resetPasswordExpires':{'$gt':Date[_0x77bd('0x42')]()}}})[_0x77bd('0xf')](function(_0x349512){if(!_0x349512){throw new Error(_0x77bd('0x4e'));}return db['Setting'][_0x77bd('0xc')]({'attributes':['id',_0x77bd('0x4f'),'enforcePasswordHistory','passwordHistoryLimit']})['then'](function(_0x45ea47){if(_0x45ea47[_0x77bd('0x4f')])authService[_0x77bd('0x50')](_0x1131ac[_0x77bd('0x38')][_0x77bd('0x51')]);if(!_0x45ea47[_0x77bd('0x52')]||!_0x349512['previousPasswords'])return _0x349512;authService[_0x77bd('0x53')](_0x1131ac[_0x77bd('0x38')]['password'],_0x349512[_0x77bd('0x54')],_0x45ea47[_0x77bd('0x55')]);return _0x349512;})['then'](function(){_0x349512[_0x77bd('0x51')]=_0x1131ac['body']['password'];_0x349512['resetPasswordToken']=null;_0x349512[_0x77bd('0x41')]=null;return _0x349512[_0x77bd('0x43')]();});})[_0x77bd('0xf')](function(){_0x37a26f[_0x77bd('0x2f')](0xc8)['send']({'message':_0x77bd('0x56')});})['catch'](function(_0x109838){return handleError(_0x37a26f,0x1f4,_0x109838);});};passport[_0x77bd('0x57')](_0x77bd('0x32'),new LocalStrategy({'usernameField':_0x77bd('0x10'),'passwordField':'password'},function(_0x5e579a,_0x2ad754,_0x11fcce){return localAuthenticate(db['User'],_0x5e579a,_0x2ad754,_0x11fcce);})); \ No newline at end of file +var _0x2c33=['client','Setting','findOne','then','name','password','salt','role','blocked','blockedAt','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','minutes','clearBlockUser','allowedLoginAttempts','blockDuration','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','merge','format','\x22%s\x22\x20<%s>','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','trim','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','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','util','passport-local','jayson/promise','lodash','randomstring','moment','../../config/utils'];(function(_0x2f3d29,_0x150e7b){var _0x53d69d=function(_0x45f6ec){while(--_0x45f6ec){_0x2f3d29['push'](_0x2f3d29['shift']());}};_0x53d69d(++_0x150e7b);}(_0x2c33,0xef));var _0x32c3=function(_0x4abed2,_0x567260){_0x4abed2=_0x4abed2-0x0;var _0x5c6928=_0x2c33[_0x4abed2];return _0x5c6928;};'use strict';var util=require(_0x32c3('0x0'));var passport=require('passport');var LocalStrategy=require(_0x32c3('0x1'))['Strategy'];var jayson=require(_0x32c3('0x2'));var _=require(_0x32c3('0x3'));var rs=require(_0x32c3('0x4'));var moment=require(_0x32c3('0x5'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x32c3('0x6'));var client=jayson[_0x32c3('0x7')]['http']({'port':0x232b});function localAuthenticate(_0x1431a2,_0x3f6196,_0x146e60,_0x23d2e4){var _0x358fab,_0x2b3a40;return db[_0x32c3('0x8')][_0x32c3('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x32c3('0xa')](function(_0x43787c){_0x358fab=_0x43787c;return _0x1431a2[_0x32c3('0x9')]({'attributes':['id',_0x32c3('0xb'),_0x32c3('0xc'),_0x32c3('0xd'),_0x32c3('0xe'),'disabled',_0x32c3('0xf'),_0x32c3('0x10'),_0x32c3('0x11')],'where':{'name':_0x3f6196,'role':{'$or':[_0x32c3('0x12'),_0x32c3('0x13'),'agent']}}});})[_0x32c3('0xa')](function(_0x1e8109){if(!_0x1e8109||_0x1e8109&&_0x1e8109['name']!==_0x3f6196){throw new Error(_0x32c3('0x14'));}else{_0x2b3a40=_0x1e8109;return _0x2b3a40;}})[_0x32c3('0xa')](function(){_0x2b3a40[_0x32c3('0x15')](_0x146e60,function(_0x520656,_0x17fcd0){var _0x5f0a82=_0x2b3a40[_0x32c3('0x11')]+0x1;if(_0x520656){return _0x23d2e4(_0x520656);}else if(!_0x17fcd0){if(_0x2b3a40['disabled']){return _0x23d2e4(null,![],{'message':_0x32c3('0x14')});}else if(_0x358fab['allowedLoginAttempts']>0x0){if(_0x2b3a40[_0x32c3('0xf')]){if(_0x358fab['blockDuration']>0x0){if(moment(_0x2b3a40[_0x32c3('0x10')])['add'](_0x358fab['blockDuration'],_0x32c3('0x16'))>moment()){return _0x23d2e4(null,![],{'message':_0x32c3('0x14')});}else{return utils[_0x32c3('0x17')](_0x2b3a40,_0x5f0a82,![],null)[_0x32c3('0xa')](function(){return _0x23d2e4(null,![],{'message':_0x32c3('0x14')});});}}else{return _0x23d2e4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x5f0a82>=_0x358fab['allowedLoginAttempts']){return utils[_0x32c3('0x17')](_0x2b3a40,0x0,!![],moment())[_0x32c3('0xa')](function(){return _0x23d2e4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0x32c3('0x17')](_0x2b3a40,_0x5f0a82,![],null)[_0x32c3('0xa')](function(){return _0x23d2e4(null,![],{'message':_0x32c3('0x14')});});}}}else{return _0x23d2e4(null,![],{'message':_0x32c3('0x14')});}}else{if(_0x2b3a40['disabled']){return _0x23d2e4(null,![],{'message':_0x32c3('0x14')});}else if(_0x358fab[_0x32c3('0x18')]>0x0){if(_0x2b3a40[_0x32c3('0xf')]){if(_0x358fab[_0x32c3('0x19')]>0x0){if(moment(_0x2b3a40[_0x32c3('0x10')])['add'](_0x358fab[_0x32c3('0x19')],_0x32c3('0x16'))>moment()){return _0x23d2e4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x2b3a40,0x0,![],null)['then'](function(){return utils[_0x32c3('0x1a')](_0x2b3a40);})[_0x32c3('0xa')](function(){return _0x23d2e4(null,_0x2b3a40);});}}else{return _0x23d2e4(null,![],{'message':_0x32c3('0x14')});}}else{return utils[_0x32c3('0x17')](_0x2b3a40,0x0,![],null)[_0x32c3('0xa')](function(){return utils[_0x32c3('0x1a')](_0x2b3a40);})[_0x32c3('0xa')](function(){return _0x23d2e4(null,_0x2b3a40);})['catch'](function(_0x33504b){return _0x23d2e4(null,![],_0x33504b);});}}else{if(_0x2b3a40[_0x32c3('0xf')]){return _0x23d2e4(null,![],{'message':_0x32c3('0x14')});}else{return utils[_0x32c3('0x1a')](_0x2b3a40)[_0x32c3('0xa')](function(){return _0x23d2e4(null,_0x2b3a40);});}}}});})[_0x32c3('0x1b')](function(_0x40d958){return _0x23d2e4(null,![],_0x40d958);});}function sendServiceMail(_0x4ff120){return db[_0x32c3('0x1c')][_0x32c3('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x32c3('0xb'),_0x32c3('0x1e')],'include':[{'model':db[_0x32c3('0x1f')],'as':_0x32c3('0x20'),'include':[{'model':db['CloudProvider'],'as':_0x32c3('0x21')}]}]})[_0x32c3('0xa')](function(_0x446931){if(!_0x446931){throw new Error(_0x32c3('0x22'));}var _0x1d824d=_0x446931['getSmtpOptions']();var _0xc3a024={'account':_0x1d824d,'message':_[_0x32c3('0x23')]({'from':util[_0x32c3('0x24')](_0x32c3('0x25'),_0x446931[_0x32c3('0xb')],_0x446931[_0x32c3('0x1e')]||_0x446931[_0x32c3('0x20')][_0x32c3('0x13')])},_0x4ff120)};return client[_0x32c3('0x26')](_0x32c3('0x27'),_0xc3a024);})[_0x32c3('0xa')](function(_0x44afd1){if(_0x44afd1['error']){throw new Error(util[_0x32c3('0x24')](_0x32c3('0x28'),_0x44afd1[_0x32c3('0x29')][_0x32c3('0x2a')]||JSON[_0x32c3('0x2b')](_0x44afd1[_0x32c3('0x29')])));}return!![];});}function handleError(_0x34e2a7,_0x1804c1,_0x3147f9){return _0x34e2a7['status'](_0x1804c1||0x1f4)[_0x32c3('0x2c')]({'message':_0x3147f9?_0x3147f9['message']||_0x3147f9:''});}exports[_0x32c3('0x2d')]=function(_0x34ba66,_0x2ed3f7,_0x58b256){passport[_0x32c3('0x15')]('local-login',function(_0x3ccc2d,_0x20b9b1,_0x234c89){var _0x1db448=_0x3ccc2d||_0x234c89;if(_0x1db448){return handleError(_0x2ed3f7,0x191,_0x1db448);}if(!_0x20b9b1){return handleError(_0x2ed3f7,0x194,{'message':_0x32c3('0x2e')});}else{var _0xd610b8={'payload':{'id':_0x20b9b1['id'],'role':_0x20b9b1[_0x32c3('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x32c3('0x2f')](_0xd610b8)[_0x32c3('0xa')](function(_0x4a2cfc){_0x2ed3f7[_0x32c3('0x30')]({'id':_0x20b9b1['id'],'token':_0x4a2cfc,'statusCall':'','isAlreadyLogged':_0x20b9b1[_0x32c3('0x31')]});});}})(_0x34ba66,_0x2ed3f7,_0x58b256);};exports[_0x32c3('0x32')]=function(_0x44a0c7,_0x198f7c){if(!_0x44a0c7['body']['email']){return handleError(_0x198f7c,0x1f4,{'message':_0x32c3('0x33')});}var _0x3ebd26=rs['generate']();_0x44a0c7['body'][_0x32c3('0x1e')]=_0x44a0c7['body'][_0x32c3('0x1e')][_0x32c3('0x34')]()[_0x32c3('0x35')]();var _0x3622e7;return db['Setting'][_0x32c3('0x9')]({'where':{'id':0x1},'attributes':[_0x32c3('0x18'),_0x32c3('0x19')],'raw':!![]})[_0x32c3('0xa')](function(_0x1f5cfa){_0x3622e7=_0x1f5cfa;return db[_0x32c3('0x36')][_0x32c3('0x1d')]({'where':{'email':_0x44a0c7[_0x32c3('0x37')][_0x32c3('0x1e')]}});})[_0x32c3('0xa')](function(_0x5bca50){if(!_0x5bca50){throw new Error(_0x32c3('0x38'));}if(_0x5bca50['disabled']){throw new Error(_0x32c3('0x39'));}if(_0x5bca50[_0x32c3('0xf')]){if(moment(_0x5bca50['blockedAt'])['add'](_0x3622e7['blockDuration'],_0x32c3('0x16'))>moment()){throw new Error(_0x32c3('0x3a'));}else{_0x5bca50[_0x32c3('0xf')]=![];_0x5bca50[_0x32c3('0x10')]=null;}}_0x5bca50[_0x32c3('0x3b')]=_0x3ebd26;_0x5bca50['resetPasswordExpires']=Date[_0x32c3('0x3c')]()+0x36ee80;return _0x5bca50['save']();})['then'](function(){return sendServiceMail({'to':_0x44a0c7[_0x32c3('0x37')][_0x32c3('0x1e')],'subject':_0x32c3('0x3d'),'text':_0x32c3('0x3e')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0x32c3('0x3f')+_0x44a0c7[_0x32c3('0x40')][_0x32c3('0x41')]+_0x32c3('0x42')+_0x3ebd26+'\x0a\x0a'+_0x32c3('0x43')});})['then'](function(){_0x198f7c[_0x32c3('0x44')](0xc8)['send']({'message':_0x32c3('0x45')});})[_0x32c3('0x1b')](function(_0x16d758){return handleError(_0x198f7c,0x1f4,_0x16d758);});};exports[_0x32c3('0x46')]=function(_0x463f68,_0x121101){return db['User'][_0x32c3('0x1d')]({'where':{'resetPasswordToken':_0x463f68[_0x32c3('0x47')][_0x32c3('0x48')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x32c3('0xa')](function(_0x4d240b){if(!_0x4d240b){throw new Error(_0x32c3('0x49'));}return db[_0x32c3('0x8')][_0x32c3('0x9')]({'attributes':['id',_0x32c3('0x4a'),_0x32c3('0x4b'),_0x32c3('0x4c')]})['then'](function(_0x813920){if(_0x813920[_0x32c3('0x4a')])authService['validatePasswordPattern'](_0x463f68[_0x32c3('0x37')]['password']);if(!_0x813920[_0x32c3('0x4b')]||!_0x4d240b[_0x32c3('0x4d')])return _0x4d240b;authService[_0x32c3('0x4e')](_0x463f68[_0x32c3('0x37')][_0x32c3('0xc')],_0x4d240b[_0x32c3('0x4d')],_0x813920[_0x32c3('0x4c')]);return _0x4d240b;})['then'](function(){_0x4d240b['password']=_0x463f68['body']['password'];_0x4d240b['resetPasswordToken']=null;_0x4d240b[_0x32c3('0x4f')]=null;return _0x4d240b['save']();});})[_0x32c3('0xa')](function(){_0x121101[_0x32c3('0x44')](0xc8)['send']({'message':_0x32c3('0x50')});})[_0x32c3('0x1b')](function(_0x368d10){return handleError(_0x121101,0x1f4,_0x368d10);});};passport[_0x32c3('0x51')]('local-login',new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0xa0988b,_0x170754,_0x1d1476){return localAuthenticate(db[_0x32c3('0x36')],_0xa0988b,_0x170754,_0x1d1476);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index f3a36fe..d929fa6 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 _0xa830=['/forgot','forgot','/reset/:token','exports','express','Router','./authLocal.controller','post','login'];(function(_0x235210,_0x2f2967){var _0x48f600=function(_0x192c4a){while(--_0x192c4a){_0x235210['push'](_0x235210['shift']());}};_0x48f600(++_0x2f2967);}(_0xa830,0x151));var _0x0a83=function(_0x185ce6,_0x80b049){_0x185ce6=_0x185ce6-0x0;var _0xb2b554=_0xa830[_0x185ce6];return _0xb2b554;};'use strict';var express=require(_0x0a83('0x0'));var router=express[_0x0a83('0x1')]();var controller=require(_0x0a83('0x2'));router[_0x0a83('0x3')]('/',controller[_0x0a83('0x4')]);router[_0x0a83('0x3')](_0x0a83('0x5'),controller[_0x0a83('0x6')]);router[_0x0a83('0x3')](_0x0a83('0x7'),controller['reset']);module[_0x0a83('0x8')]=router; \ No newline at end of file +var _0xab5a=['reset','Router','post','login','/forgot'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0xab5a,0x1cd));var _0xaab5=function(_0xc67aef,_0x36a9ba){_0xc67aef=_0xc67aef-0x0;var _0x23a974=_0xab5a[_0xc67aef];return _0x23a974;};'use strict';var express=require('express');var router=express[_0xaab5('0x0')]();var controller=require('./authLocal.controller');router[_0xaab5('0x1')]('/',controller[_0xaab5('0x2')]);router[_0xaab5('0x1')](_0xaab5('0x3'),controller['forgot']);router[_0xaab5('0x1')]('/reset/:token',controller[_0xaab5('0x4')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 33b4b17..e58e9a7 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 _0x1423=['STRING','BOOLEAN','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1423,0x1d6));var _0x3142=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1423[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0x3142('0x0')]={'name':{'type':Sequelize[_0x3142('0x1')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3142('0x1')]},'status':{'type':Sequelize[_0x3142('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +var _0x1a00=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x52d358,_0x51d6fd){var _0x386ffb=function(_0x3ea9ab){while(--_0x3ea9ab){_0x52d358['push'](_0x52d358['shift']());}};_0x386ffb(++_0x51d6fd);}(_0x1a00,0x96));var _0x01a0=function(_0x3ce3cd,_0x508147){_0x3ce3cd=_0x3ce3cd-0x0;var _0x12d8d8=_0x1a00[_0x3ce3cd];return _0x12d8d8;};'use strict';var Sequelize=require(_0x01a0('0x0'));module[_0x01a0('0x1')]={'name':{'type':Sequelize[_0x01a0('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x01a0('0x2')]},'status':{'type':Sequelize[_0x01a0('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x01a0('0x4')],'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 02e8dee..61a1cbb 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 _0x8ad1=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','include','findAll','rows','catch','show','keys','includeAll','options','create','body','find','params','addConditions','Condition','ids','omit','getConditions','findOne','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','map','Automation','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length'];(function(_0x39e134,_0xd37a5d){var _0x3239a7=function(_0x597cc7){while(--_0x597cc7){_0x39e134['push'](_0x39e134['shift']());}};_0x3239a7(++_0xd37a5d);}(_0x8ad1,0x1d5));var _0x18ad=function(_0x583200,_0x42c9d1){_0x583200=_0x583200-0x0;var _0x31f4bb=_0x8ad1[_0x583200];return _0x31f4bb;};'use strict';var emlformat=require(_0x18ad('0x0'));var rimraf=require(_0x18ad('0x1'));var zipdir=require(_0x18ad('0x2'));var jsonpatch=require(_0x18ad('0x3'));var rp=require(_0x18ad('0x4'));var moment=require(_0x18ad('0x5'));var BPromise=require(_0x18ad('0x6'));var Mustache=require(_0x18ad('0x7'));var util=require(_0x18ad('0x8'));var path=require('path');var sox=require(_0x18ad('0x9'));var csv=require(_0x18ad('0xa'));var ejs=require(_0x18ad('0xb'));var fs=require('fs');var fs_extra=require(_0x18ad('0xc'));var _=require(_0x18ad('0xd'));var squel=require(_0x18ad('0xe'));var crypto=require(_0x18ad('0xf'));var jsforce=require(_0x18ad('0x10'));var deskjs=require(_0x18ad('0x11'));var toCsv=require(_0x18ad('0xa'));var querystring=require('querystring');var Papa=require(_0x18ad('0x12'));var Redis=require(_0x18ad('0x13'));var authService=require(_0x18ad('0x14'));var qs=require(_0x18ad('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x18ad('0x16'));var logger=require(_0x18ad('0x17'))(_0x18ad('0x18'));var utils=require('../../config/utils');var config=require(_0x18ad('0x19'));var licenseUtil=require(_0x18ad('0x1a'));var db=require(_0x18ad('0x1b'))['db'];function respondWithStatusCode(_0x3db3de,_0x2d66c0){_0x2d66c0=_0x2d66c0||0xcc;return function(_0x266694){if(_0x266694){return _0x3db3de[_0x18ad('0x1c')](_0x2d66c0);}return _0x3db3de[_0x18ad('0x1d')](_0x2d66c0)['end']();};}function respondWithResult(_0x25bbc0,_0x32b023){_0x32b023=_0x32b023||0xc8;return function(_0x48cb4b){if(_0x48cb4b){return _0x25bbc0['status'](_0x32b023)[_0x18ad('0x1e')](_0x48cb4b);}};}function respondWithFilteredResult(_0x3da2d2,_0xe09514){return function(_0x4fcb31){if(_0x4fcb31){var _0xb6864=typeof _0xe09514[_0x18ad('0x1f')]==='undefined'&&typeof _0xe09514['limit']===_0x18ad('0x20');var _0x18710e=_0x4fcb31[_0x18ad('0x21')];var _0x3817e4=_0xb6864?0x0:_0xe09514[_0x18ad('0x1f')];var _0x1fe116=_0xb6864?_0x4fcb31['count']:_0xe09514[_0x18ad('0x1f')]+_0xe09514[_0x18ad('0x22')];var _0x30a2f5;if(_0x1fe116>=_0x18710e){_0x1fe116=_0x18710e;_0x30a2f5=0xc8;}else{_0x30a2f5=0xce;}_0x3da2d2[_0x18ad('0x1d')](_0x30a2f5);return _0x3da2d2[_0x18ad('0x23')](_0x18ad('0x24'),_0x3817e4+'-'+_0x1fe116+'/'+_0x18710e)[_0x18ad('0x1e')](_0x4fcb31);}return null;};}function patchUpdates(_0x264cbf){return function(_0x1feeb8){try{jsonpatch[_0x18ad('0x25')](_0x1feeb8,_0x264cbf,!![]);}catch(_0x5e70dd){return BPromise[_0x18ad('0x26')](_0x5e70dd);}return _0x1feeb8[_0x18ad('0x27')]();};}function saveUpdates(_0x485147,_0x28dd1f){return function(_0x21f0a5){if(_0x21f0a5){return _0x21f0a5[_0x18ad('0x28')](_0x485147)[_0x18ad('0x29')](function(_0x32aba8){return _0x32aba8;});}return null;};}function removeEntity(_0x565b93,_0xefe1fe){return function(_0x37229d){if(_0x37229d){return _0x37229d[_0x18ad('0x2a')]()[_0x18ad('0x29')](function(){_0x565b93[_0x18ad('0x1d')](0xcc)[_0x18ad('0x2b')]();});}};}function handleEntityNotFound(_0x5e78bb,_0x52ff4d){return function(_0x150fd2){if(!_0x150fd2){_0x5e78bb['sendStatus'](0x194);}return _0x150fd2;};}function handleError(_0x56125f,_0x430f45){_0x430f45=_0x430f45||0x1f4;return function(_0xcf7125){logger[_0x18ad('0x2c')](_0xcf7125['stack']);if(_0xcf7125[_0x18ad('0x2d')]){delete _0xcf7125[_0x18ad('0x2d')];}_0x56125f[_0x18ad('0x1d')](_0x430f45)[_0x18ad('0x2e')](_0xcf7125);};}exports['index']=function(_0xc759af,_0x3e2357){var _0xf70b31={},_0x6be5d7={},_0x567fff={'count':0x0,'rows':[]};var _0xdcd7e1=_[_0x18ad('0x2f')](db[_0x18ad('0x30')][_0x18ad('0x31')],function(_0x52f8b2){return{'name':_0x52f8b2[_0x18ad('0x32')],'type':_0x52f8b2['type'][_0x18ad('0x33')]};});_0x6be5d7[_0x18ad('0x34')]=_[_0x18ad('0x2f')](_0xdcd7e1,_0x18ad('0x2d'));_0x6be5d7[_0x18ad('0x35')]=_['keys'](_0xc759af[_0x18ad('0x35')]);_0x6be5d7[_0x18ad('0x36')]=_['intersection'](_0x6be5d7[_0x18ad('0x34')],_0x6be5d7[_0x18ad('0x35')]);_0xf70b31['attributes']=_[_0x18ad('0x37')](_0x6be5d7['model'],qs[_0x18ad('0x38')](_0xc759af[_0x18ad('0x35')][_0x18ad('0x38')]));_0xf70b31[_0x18ad('0x39')]=_0xf70b31[_0x18ad('0x39')][_0x18ad('0x3a')]?_0xf70b31[_0x18ad('0x39')]:_0x6be5d7[_0x18ad('0x34')];if(!_0xc759af[_0x18ad('0x35')][_0x18ad('0x3b')](_0x18ad('0x3c'))){_0xf70b31[_0x18ad('0x22')]=qs[_0x18ad('0x22')](_0xc759af[_0x18ad('0x35')]['limit']);_0xf70b31[_0x18ad('0x1f')]=qs[_0x18ad('0x1f')](_0xc759af[_0x18ad('0x35')][_0x18ad('0x1f')]);}_0xf70b31[_0x18ad('0x3d')]=qs['sort'](_0xc759af[_0x18ad('0x35')][_0x18ad('0x3e')]);_0xf70b31[_0x18ad('0x3f')]=qs[_0x18ad('0x36')](_[_0x18ad('0x40')](_0xc759af['query'],_0x6be5d7[_0x18ad('0x36')]),_0xdcd7e1);if(_0xc759af[_0x18ad('0x35')][_0x18ad('0x41')]){_0xf70b31[_0x18ad('0x3f')]=_[_0x18ad('0x42')](_0xf70b31[_0x18ad('0x3f')],{'$or':_[_0x18ad('0x2f')](_0xdcd7e1,function(_0x31c722){if(_0x31c722[_0x18ad('0x43')]!=='VIRTUAL'){var _0x5066da={};_0x5066da[_0x31c722[_0x18ad('0x2d')]]={'$like':'%'+_0xc759af[_0x18ad('0x35')][_0x18ad('0x41')]+'%'};return _0x5066da;}})});}_0xf70b31=_[_0x18ad('0x42')]({},_0xf70b31,_0xc759af['options']);var _0x34fcba={'where':_0xf70b31[_0x18ad('0x3f')]};return db['Automation'][_0x18ad('0x21')](_0x34fcba)[_0x18ad('0x29')](function(_0x14c58f){_0x567fff[_0x18ad('0x21')]=_0x14c58f;if(_0xc759af[_0x18ad('0x35')]['includeAll']){_0xf70b31[_0x18ad('0x44')]=[{'all':!![]}];}return db['Automation'][_0x18ad('0x45')](_0xf70b31);})[_0x18ad('0x29')](function(_0x31d866){_0x567fff[_0x18ad('0x46')]=_0x31d866;return _0x567fff;})[_0x18ad('0x29')](respondWithFilteredResult(_0x3e2357,_0xf70b31))[_0x18ad('0x47')](handleError(_0x3e2357,null));};exports[_0x18ad('0x48')]=function(_0x595c00,_0x51e327){var _0x37abc8={'raw':![],'where':{'id':_0x595c00['params']['id']}},_0x38f93c={};_0x38f93c['model']=_['keys'](db['Automation']['rawAttributes']);_0x38f93c[_0x18ad('0x35')]=_[_0x18ad('0x49')](_0x595c00['query']);_0x38f93c[_0x18ad('0x36')]=_['intersection'](_0x38f93c[_0x18ad('0x34')],_0x38f93c[_0x18ad('0x35')]);_0x37abc8[_0x18ad('0x39')]=_[_0x18ad('0x37')](_0x38f93c[_0x18ad('0x34')],qs[_0x18ad('0x38')](_0x595c00[_0x18ad('0x35')][_0x18ad('0x38')]));_0x37abc8[_0x18ad('0x39')]=_0x37abc8[_0x18ad('0x39')][_0x18ad('0x3a')]?_0x37abc8[_0x18ad('0x39')]:_0x38f93c[_0x18ad('0x34')];if(_0x595c00['query'][_0x18ad('0x4a')]){_0x37abc8[_0x18ad('0x44')]=[{'all':!![]}];}_0x37abc8=_['merge']({},_0x37abc8,_0x595c00[_0x18ad('0x4b')]);return db[_0x18ad('0x30')]['find'](_0x37abc8)[_0x18ad('0x29')](handleEntityNotFound(_0x51e327,null))['then'](respondWithResult(_0x51e327,null))[_0x18ad('0x47')](handleError(_0x51e327,null));};exports[_0x18ad('0x4c')]=function(_0x10f87c,_0x419812){return db['Automation'][_0x18ad('0x4c')](_0x10f87c[_0x18ad('0x4d')],{})[_0x18ad('0x29')](respondWithResult(_0x419812,0xc9))[_0x18ad('0x47')](handleError(_0x419812,null));};exports[_0x18ad('0x28')]=function(_0x261c90,_0xe7d085){if(_0x261c90[_0x18ad('0x4d')]['id']){delete _0x261c90[_0x18ad('0x4d')]['id'];}return db[_0x18ad('0x30')][_0x18ad('0x4e')]({'where':{'id':_0x261c90[_0x18ad('0x4f')]['id']}})[_0x18ad('0x29')](handleEntityNotFound(_0xe7d085,null))['then'](saveUpdates(_0x261c90[_0x18ad('0x4d')],null))[_0x18ad('0x29')](respondWithResult(_0xe7d085,null))[_0x18ad('0x47')](handleError(_0xe7d085,null));};exports[_0x18ad('0x2a')]=function(_0x379570,_0xa070d6){return db[_0x18ad('0x30')]['find']({'where':{'id':_0x379570[_0x18ad('0x4f')]['id']}})[_0x18ad('0x29')](handleEntityNotFound(_0xa070d6,null))['then'](removeEntity(_0xa070d6,null))[_0x18ad('0x47')](handleError(_0xa070d6,null));};exports[_0x18ad('0x50')]=function(_0x2332e8,_0x410f36,_0x164c8d){return db[_0x18ad('0x51')][_0x18ad('0x4e')]({'where':{'id':_0x2332e8[_0x18ad('0x4f')]['id']}})[_0x18ad('0x29')](handleEntityNotFound(_0x410f36,null))['then'](function(_0x397c5a){if(_0x397c5a){return _0x397c5a[_0x18ad('0x50')](_0x2332e8[_0x18ad('0x4d')][_0x18ad('0x52')],_[_0x18ad('0x53')](_0x2332e8[_0x18ad('0x4d')],[_0x18ad('0x52'),'id'])||{});}})[_0x18ad('0x29')](respondWithResult(_0x410f36,null))['catch'](handleError(_0x410f36,null));};exports[_0x18ad('0x54')]=function(_0x183e58,_0x3f1341,_0x3d53f6){var _0x1ac49c={};var _0x19590a={};var _0x3044fb;var _0x41eb56;return db[_0x18ad('0x30')][_0x18ad('0x55')]({'where':{'id':_0x183e58[_0x18ad('0x4f')]['id']}})[_0x18ad('0x29')](handleEntityNotFound(_0x3f1341,null))[_0x18ad('0x29')](function(_0x2c691a){if(_0x2c691a){_0x3044fb=_0x2c691a;_0x19590a['model']=_[_0x18ad('0x49')](db['Condition'][_0x18ad('0x31')]);_0x19590a[_0x18ad('0x35')]=_['keys'](_0x183e58[_0x18ad('0x35')]);_0x19590a['filters']=_[_0x18ad('0x37')](_0x19590a[_0x18ad('0x34')],_0x19590a['query']);_0x1ac49c[_0x18ad('0x39')]=_[_0x18ad('0x37')](_0x19590a[_0x18ad('0x34')],qs[_0x18ad('0x38')](_0x183e58['query'][_0x18ad('0x38')]));_0x1ac49c[_0x18ad('0x39')]=_0x1ac49c[_0x18ad('0x39')][_0x18ad('0x3a')]?_0x1ac49c[_0x18ad('0x39')]:_0x19590a[_0x18ad('0x34')];_0x1ac49c['order']=qs[_0x18ad('0x3e')](_0x183e58[_0x18ad('0x35')]['sort']);_0x1ac49c[_0x18ad('0x3f')]=qs[_0x18ad('0x36')](_['pick'](_0x183e58[_0x18ad('0x35')],_0x19590a[_0x18ad('0x36')]));if(_0x183e58['query'][_0x18ad('0x41')]){_0x1ac49c['where']=_[_0x18ad('0x42')](_0x1ac49c[_0x18ad('0x3f')],{'$or':_[_0x18ad('0x2f')](_0x1ac49c[_0x18ad('0x39')],function(_0x211117){var _0x2c4b5d={};_0x2c4b5d[_0x211117]={'$like':'%'+_0x183e58[_0x18ad('0x35')][_0x18ad('0x41')]+'%'};return _0x2c4b5d;})});}_0x1ac49c=_[_0x18ad('0x42')]({},_0x1ac49c,_0x183e58[_0x18ad('0x4b')]);return _0x3044fb[_0x18ad('0x54')](_0x1ac49c);}})['then'](function(_0x5e2411){if(_0x5e2411){_0x41eb56=_0x5e2411[_0x18ad('0x3a')];if(!_0x183e58[_0x18ad('0x35')][_0x18ad('0x3b')](_0x18ad('0x3c'))){_0x1ac49c[_0x18ad('0x22')]=qs[_0x18ad('0x22')](_0x183e58[_0x18ad('0x35')][_0x18ad('0x22')]);_0x1ac49c[_0x18ad('0x1f')]=qs[_0x18ad('0x1f')](_0x183e58[_0x18ad('0x35')][_0x18ad('0x1f')]);}return _0x3044fb[_0x18ad('0x54')](_0x1ac49c);}})[_0x18ad('0x29')](function(_0x59482e){if(_0x59482e){return _0x59482e?{'count':_0x41eb56,'rows':_0x59482e}:null;}})[_0x18ad('0x29')](respondWithResult(_0x3f1341,null))[_0x18ad('0x47')](handleError(_0x3f1341,null));};exports['addActions']=function(_0x13a7f8,_0x1ca3eb,_0x53576c){return db[_0x18ad('0x56')][_0x18ad('0x4e')]({'where':{'id':_0x13a7f8['params']['id']}})[_0x18ad('0x29')](handleEntityNotFound(_0x1ca3eb,null))[_0x18ad('0x29')](function(_0xd8f4d8){if(_0xd8f4d8){return _0xd8f4d8['addActions'](_0x13a7f8[_0x18ad('0x4d')][_0x18ad('0x52')],_[_0x18ad('0x53')](_0x13a7f8[_0x18ad('0x4d')],[_0x18ad('0x52'),'id'])||{});}})[_0x18ad('0x29')](respondWithResult(_0x1ca3eb,null))[_0x18ad('0x47')](handleError(_0x1ca3eb,null));};exports[_0x18ad('0x57')]=function(_0x21b354,_0x152731,_0x357efe){var _0x5e4194={};var _0x10bc5a={};var _0x31d49c;var _0x667bdf;return db[_0x18ad('0x30')][_0x18ad('0x55')]({'where':{'id':_0x21b354['params']['id']}})[_0x18ad('0x29')](handleEntityNotFound(_0x152731,null))[_0x18ad('0x29')](function(_0x126206){if(_0x126206){_0x31d49c=_0x126206;_0x10bc5a[_0x18ad('0x34')]=_[_0x18ad('0x49')](db['Action']['rawAttributes']);_0x10bc5a[_0x18ad('0x35')]=_[_0x18ad('0x49')](_0x21b354[_0x18ad('0x35')]);_0x10bc5a[_0x18ad('0x36')]=_['intersection'](_0x10bc5a[_0x18ad('0x34')],_0x10bc5a[_0x18ad('0x35')]);_0x5e4194[_0x18ad('0x39')]=_['intersection'](_0x10bc5a['model'],qs[_0x18ad('0x38')](_0x21b354[_0x18ad('0x35')][_0x18ad('0x38')]));_0x5e4194['attributes']=_0x5e4194[_0x18ad('0x39')][_0x18ad('0x3a')]?_0x5e4194[_0x18ad('0x39')]:_0x10bc5a[_0x18ad('0x34')];_0x5e4194[_0x18ad('0x3d')]=qs[_0x18ad('0x3e')](_0x21b354[_0x18ad('0x35')][_0x18ad('0x3e')]);_0x5e4194[_0x18ad('0x3f')]=qs[_0x18ad('0x36')](_[_0x18ad('0x40')](_0x21b354['query'],_0x10bc5a[_0x18ad('0x36')]));if(_0x21b354[_0x18ad('0x35')][_0x18ad('0x41')]){_0x5e4194[_0x18ad('0x3f')]=_[_0x18ad('0x42')](_0x5e4194['where'],{'$or':_[_0x18ad('0x2f')](_0x5e4194[_0x18ad('0x39')],function(_0x3c5b48){var _0x30bd6c={};_0x30bd6c[_0x3c5b48]={'$like':'%'+_0x21b354['query'][_0x18ad('0x41')]+'%'};return _0x30bd6c;})});}_0x5e4194=_[_0x18ad('0x42')]({},_0x5e4194,_0x21b354[_0x18ad('0x4b')]);return _0x31d49c[_0x18ad('0x57')](_0x5e4194);}})['then'](function(_0x58581f){if(_0x58581f){_0x667bdf=_0x58581f[_0x18ad('0x3a')];if(!_0x21b354[_0x18ad('0x35')][_0x18ad('0x3b')](_0x18ad('0x3c'))){_0x5e4194[_0x18ad('0x22')]=qs[_0x18ad('0x22')](_0x21b354['query'][_0x18ad('0x22')]);_0x5e4194[_0x18ad('0x1f')]=qs[_0x18ad('0x1f')](_0x21b354[_0x18ad('0x35')][_0x18ad('0x1f')]);}return _0x31d49c['getActions'](_0x5e4194);}})[_0x18ad('0x29')](function(_0x7b00d0){if(_0x7b00d0){return _0x7b00d0?{'count':_0x667bdf,'rows':_0x7b00d0}:null;}})['then'](respondWithResult(_0x152731,null))[_0x18ad('0x47')](handleError(_0x152731,null));}; \ No newline at end of file +var _0x708f=['pick','filters','filter','merge','include','findAll','rows','catch','show','params','length','includeAll','options','find','create','update','body','addConditions','Condition','ids','getConditions','findOne','keys','sort','nolimit','limit','Action','addActions','omit','getActions','hasOwnProperty','eml-format','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','count','offset','Content-Range','json','reject','save','then','destroy','error','stack','send','index','Automation','rawAttributes','fieldName','type','key','model','map','name','query','intersection','attributes','fields','order','where'];(function(_0x31a9ae,_0x2a1716){var _0x23a1d0=function(_0x740fab){while(--_0x740fab){_0x31a9ae['push'](_0x31a9ae['shift']());}};_0x23a1d0(++_0x2a1716);}(_0x708f,0xc7));var _0xf708=function(_0x1a613b,_0x381801){_0x1a613b=_0x1a613b-0x0;var _0x5b80f0=_0x708f[_0x1a613b];return _0x5b80f0;};'use strict';var emlformat=require(_0xf708('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf708('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf708('0x2'));var moment=require(_0xf708('0x3'));var BPromise=require(_0xf708('0x4'));var Mustache=require(_0xf708('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf708('0x6'));var csv=require(_0xf708('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf708('0x8'));var _=require(_0xf708('0x9'));var squel=require(_0xf708('0xa'));var crypto=require(_0xf708('0xb'));var jsforce=require(_0xf708('0xc'));var deskjs=require(_0xf708('0xd'));var toCsv=require(_0xf708('0x7'));var querystring=require('querystring');var Papa=require(_0xf708('0xe'));var Redis=require(_0xf708('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf708('0x10'));var hardwareService=require(_0xf708('0x11'));var logger=require(_0xf708('0x12'))(_0xf708('0x13'));var utils=require(_0xf708('0x14'));var config=require(_0xf708('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf708('0x16'))['db'];function respondWithStatusCode(_0x3b959d,_0x316e93){_0x316e93=_0x316e93||0xcc;return function(_0x151c32){if(_0x151c32){return _0x3b959d[_0xf708('0x17')](_0x316e93);}return _0x3b959d[_0xf708('0x18')](_0x316e93)[_0xf708('0x19')]();};}function respondWithResult(_0xe9c51d,_0x37e132){_0x37e132=_0x37e132||0xc8;return function(_0x1caf7b){if(_0x1caf7b){return _0xe9c51d[_0xf708('0x18')](_0x37e132)['json'](_0x1caf7b);}};}function respondWithFilteredResult(_0x469d14,_0x3dda9e){return function(_0x107b6b){if(_0x107b6b){var _0x3aea42=typeof _0x3dda9e['offset']===_0xf708('0x1a')&&typeof _0x3dda9e['limit']===_0xf708('0x1a');var _0x238b35=_0x107b6b[_0xf708('0x1b')];var _0x6ac8c8=_0x3aea42?0x0:_0x3dda9e[_0xf708('0x1c')];var _0x5cedb6=_0x3aea42?_0x107b6b['count']:_0x3dda9e[_0xf708('0x1c')]+_0x3dda9e['limit'];var _0x3ee2e5;if(_0x5cedb6>=_0x238b35){_0x5cedb6=_0x238b35;_0x3ee2e5=0xc8;}else{_0x3ee2e5=0xce;}_0x469d14[_0xf708('0x18')](_0x3ee2e5);return _0x469d14['set'](_0xf708('0x1d'),_0x6ac8c8+'-'+_0x5cedb6+'/'+_0x238b35)[_0xf708('0x1e')](_0x107b6b);}return null;};}function patchUpdates(_0x6b31b1){return function(_0x3e59af){try{jsonpatch['apply'](_0x3e59af,_0x6b31b1,!![]);}catch(_0x187315){return BPromise[_0xf708('0x1f')](_0x187315);}return _0x3e59af[_0xf708('0x20')]();};}function saveUpdates(_0x23873c,_0x336c57){return function(_0x551e66){if(_0x551e66){return _0x551e66['update'](_0x23873c)[_0xf708('0x21')](function(_0x1cd749){return _0x1cd749;});}return null;};}function removeEntity(_0xec5a1d,_0x576c99){return function(_0x13718e){if(_0x13718e){return _0x13718e[_0xf708('0x22')]()['then'](function(){_0xec5a1d[_0xf708('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41596f,_0x512782){return function(_0x288118){if(!_0x288118){_0x41596f[_0xf708('0x17')](0x194);}return _0x288118;};}function handleError(_0x273fbd,_0x49fa30){_0x49fa30=_0x49fa30||0x1f4;return function(_0xa71dc4){logger[_0xf708('0x23')](_0xa71dc4[_0xf708('0x24')]);if(_0xa71dc4['name']){delete _0xa71dc4['name'];}_0x273fbd[_0xf708('0x18')](_0x49fa30)[_0xf708('0x25')](_0xa71dc4);};}exports[_0xf708('0x26')]=function(_0x1e2e22,_0x56859c){var _0x440e79={},_0x5c5141={},_0xf655e={'count':0x0,'rows':[]};var _0x195eac=_['map'](db[_0xf708('0x27')][_0xf708('0x28')],function(_0x52da8b){return{'name':_0x52da8b[_0xf708('0x29')],'type':_0x52da8b[_0xf708('0x2a')][_0xf708('0x2b')]};});_0x5c5141[_0xf708('0x2c')]=_[_0xf708('0x2d')](_0x195eac,_0xf708('0x2e'));_0x5c5141[_0xf708('0x2f')]=_['keys'](_0x1e2e22['query']);_0x5c5141['filters']=_[_0xf708('0x30')](_0x5c5141[_0xf708('0x2c')],_0x5c5141[_0xf708('0x2f')]);_0x440e79[_0xf708('0x31')]=_[_0xf708('0x30')](_0x5c5141[_0xf708('0x2c')],qs[_0xf708('0x32')](_0x1e2e22['query'][_0xf708('0x32')]));_0x440e79[_0xf708('0x31')]=_0x440e79['attributes']['length']?_0x440e79[_0xf708('0x31')]:_0x5c5141[_0xf708('0x2c')];if(!_0x1e2e22[_0xf708('0x2f')]['hasOwnProperty']('nolimit')){_0x440e79['limit']=qs['limit'](_0x1e2e22[_0xf708('0x2f')]['limit']);_0x440e79[_0xf708('0x1c')]=qs[_0xf708('0x1c')](_0x1e2e22[_0xf708('0x2f')][_0xf708('0x1c')]);}_0x440e79[_0xf708('0x33')]=qs['sort'](_0x1e2e22[_0xf708('0x2f')]['sort']);_0x440e79[_0xf708('0x34')]=qs['filters'](_[_0xf708('0x35')](_0x1e2e22['query'],_0x5c5141[_0xf708('0x36')]),_0x195eac);if(_0x1e2e22[_0xf708('0x2f')][_0xf708('0x37')]){_0x440e79[_0xf708('0x34')]=_[_0xf708('0x38')](_0x440e79[_0xf708('0x34')],{'$or':_[_0xf708('0x2d')](_0x195eac,function(_0xb1ed3d){if(_0xb1ed3d[_0xf708('0x2a')]!=='VIRTUAL'){var _0x4445fd={};_0x4445fd[_0xb1ed3d[_0xf708('0x2e')]]={'$like':'%'+_0x1e2e22['query'][_0xf708('0x37')]+'%'};return _0x4445fd;}})});}_0x440e79=_[_0xf708('0x38')]({},_0x440e79,_0x1e2e22['options']);var _0x29e0a4={'where':_0x440e79[_0xf708('0x34')]};return db[_0xf708('0x27')][_0xf708('0x1b')](_0x29e0a4)[_0xf708('0x21')](function(_0x155d4d){_0xf655e[_0xf708('0x1b')]=_0x155d4d;if(_0x1e2e22[_0xf708('0x2f')]['includeAll']){_0x440e79[_0xf708('0x39')]=[{'all':!![]}];}return db[_0xf708('0x27')][_0xf708('0x3a')](_0x440e79);})[_0xf708('0x21')](function(_0x1382c3){_0xf655e[_0xf708('0x3b')]=_0x1382c3;return _0xf655e;})[_0xf708('0x21')](respondWithFilteredResult(_0x56859c,_0x440e79))[_0xf708('0x3c')](handleError(_0x56859c,null));};exports[_0xf708('0x3d')]=function(_0x1b90de,_0x4dfb54){var _0x15ebcf={'raw':![],'where':{'id':_0x1b90de[_0xf708('0x3e')]['id']}},_0x286535={};_0x286535[_0xf708('0x2c')]=_['keys'](db[_0xf708('0x27')][_0xf708('0x28')]);_0x286535[_0xf708('0x2f')]=_['keys'](_0x1b90de['query']);_0x286535[_0xf708('0x36')]=_['intersection'](_0x286535[_0xf708('0x2c')],_0x286535['query']);_0x15ebcf[_0xf708('0x31')]=_[_0xf708('0x30')](_0x286535[_0xf708('0x2c')],qs[_0xf708('0x32')](_0x1b90de[_0xf708('0x2f')][_0xf708('0x32')]));_0x15ebcf[_0xf708('0x31')]=_0x15ebcf[_0xf708('0x31')][_0xf708('0x3f')]?_0x15ebcf[_0xf708('0x31')]:_0x286535[_0xf708('0x2c')];if(_0x1b90de[_0xf708('0x2f')][_0xf708('0x40')]){_0x15ebcf[_0xf708('0x39')]=[{'all':!![]}];}_0x15ebcf=_[_0xf708('0x38')]({},_0x15ebcf,_0x1b90de[_0xf708('0x41')]);return db[_0xf708('0x27')][_0xf708('0x42')](_0x15ebcf)[_0xf708('0x21')](handleEntityNotFound(_0x4dfb54,null))['then'](respondWithResult(_0x4dfb54,null))['catch'](handleError(_0x4dfb54,null));};exports['create']=function(_0x193ff8,_0xc5a809){return db[_0xf708('0x27')][_0xf708('0x43')](_0x193ff8['body'],{})[_0xf708('0x21')](respondWithResult(_0xc5a809,0xc9))[_0xf708('0x3c')](handleError(_0xc5a809,null));};exports[_0xf708('0x44')]=function(_0xcd6ee8,_0x3c07c5){if(_0xcd6ee8[_0xf708('0x45')]['id']){delete _0xcd6ee8[_0xf708('0x45')]['id'];}return db[_0xf708('0x27')][_0xf708('0x42')]({'where':{'id':_0xcd6ee8[_0xf708('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3c07c5,null))[_0xf708('0x21')](saveUpdates(_0xcd6ee8['body'],null))[_0xf708('0x21')](respondWithResult(_0x3c07c5,null))[_0xf708('0x3c')](handleError(_0x3c07c5,null));};exports[_0xf708('0x22')]=function(_0xc01004,_0x3553d8){return db[_0xf708('0x27')][_0xf708('0x42')]({'where':{'id':_0xc01004[_0xf708('0x3e')]['id']}})[_0xf708('0x21')](handleEntityNotFound(_0x3553d8,null))[_0xf708('0x21')](removeEntity(_0x3553d8,null))[_0xf708('0x3c')](handleError(_0x3553d8,null));};exports[_0xf708('0x46')]=function(_0x5355b3,_0x437313,_0x5cda7e){return db[_0xf708('0x47')][_0xf708('0x42')]({'where':{'id':_0x5355b3[_0xf708('0x3e')]['id']}})[_0xf708('0x21')](handleEntityNotFound(_0x437313,null))[_0xf708('0x21')](function(_0x2dca06){if(_0x2dca06){return _0x2dca06[_0xf708('0x46')](_0x5355b3[_0xf708('0x45')][_0xf708('0x48')],_['omit'](_0x5355b3['body'],[_0xf708('0x48'),'id'])||{});}})[_0xf708('0x21')](respondWithResult(_0x437313,null))[_0xf708('0x3c')](handleError(_0x437313,null));};exports[_0xf708('0x49')]=function(_0x45ffed,_0xddc8fd,_0x970ed9){var _0x322cd9={};var _0x564d67={};var _0x3ec77d;var _0x1c71f9;return db[_0xf708('0x27')][_0xf708('0x4a')]({'where':{'id':_0x45ffed[_0xf708('0x3e')]['id']}})[_0xf708('0x21')](handleEntityNotFound(_0xddc8fd,null))[_0xf708('0x21')](function(_0x26838d){if(_0x26838d){_0x3ec77d=_0x26838d;_0x564d67[_0xf708('0x2c')]=_[_0xf708('0x4b')](db[_0xf708('0x47')][_0xf708('0x28')]);_0x564d67[_0xf708('0x2f')]=_[_0xf708('0x4b')](_0x45ffed[_0xf708('0x2f')]);_0x564d67[_0xf708('0x36')]=_[_0xf708('0x30')](_0x564d67[_0xf708('0x2c')],_0x564d67[_0xf708('0x2f')]);_0x322cd9[_0xf708('0x31')]=_[_0xf708('0x30')](_0x564d67['model'],qs[_0xf708('0x32')](_0x45ffed[_0xf708('0x2f')][_0xf708('0x32')]));_0x322cd9[_0xf708('0x31')]=_0x322cd9[_0xf708('0x31')]['length']?_0x322cd9[_0xf708('0x31')]:_0x564d67[_0xf708('0x2c')];_0x322cd9['order']=qs[_0xf708('0x4c')](_0x45ffed[_0xf708('0x2f')][_0xf708('0x4c')]);_0x322cd9['where']=qs[_0xf708('0x36')](_[_0xf708('0x35')](_0x45ffed[_0xf708('0x2f')],_0x564d67[_0xf708('0x36')]));if(_0x45ffed[_0xf708('0x2f')][_0xf708('0x37')]){_0x322cd9[_0xf708('0x34')]=_[_0xf708('0x38')](_0x322cd9[_0xf708('0x34')],{'$or':_[_0xf708('0x2d')](_0x322cd9[_0xf708('0x31')],function(_0x2d6a40){var _0x2cb8e0={};_0x2cb8e0[_0x2d6a40]={'$like':'%'+_0x45ffed[_0xf708('0x2f')][_0xf708('0x37')]+'%'};return _0x2cb8e0;})});}_0x322cd9=_[_0xf708('0x38')]({},_0x322cd9,_0x45ffed[_0xf708('0x41')]);return _0x3ec77d['getConditions'](_0x322cd9);}})[_0xf708('0x21')](function(_0x4a0899){if(_0x4a0899){_0x1c71f9=_0x4a0899[_0xf708('0x3f')];if(!_0x45ffed[_0xf708('0x2f')]['hasOwnProperty'](_0xf708('0x4d'))){_0x322cd9[_0xf708('0x4e')]=qs['limit'](_0x45ffed[_0xf708('0x2f')][_0xf708('0x4e')]);_0x322cd9[_0xf708('0x1c')]=qs['offset'](_0x45ffed[_0xf708('0x2f')][_0xf708('0x1c')]);}return _0x3ec77d['getConditions'](_0x322cd9);}})[_0xf708('0x21')](function(_0x3b811e){if(_0x3b811e){return _0x3b811e?{'count':_0x1c71f9,'rows':_0x3b811e}:null;}})['then'](respondWithResult(_0xddc8fd,null))[_0xf708('0x3c')](handleError(_0xddc8fd,null));};exports['addActions']=function(_0xadd558,_0x121e83,_0x301e18){return db[_0xf708('0x4f')][_0xf708('0x42')]({'where':{'id':_0xadd558[_0xf708('0x3e')]['id']}})[_0xf708('0x21')](handleEntityNotFound(_0x121e83,null))[_0xf708('0x21')](function(_0x32020b){if(_0x32020b){return _0x32020b[_0xf708('0x50')](_0xadd558[_0xf708('0x45')][_0xf708('0x48')],_[_0xf708('0x51')](_0xadd558[_0xf708('0x45')],[_0xf708('0x48'),'id'])||{});}})['then'](respondWithResult(_0x121e83,null))[_0xf708('0x3c')](handleError(_0x121e83,null));};exports['getActions']=function(_0x4b3d5b,_0x302dbb,_0x3b92be){var _0x5c63d9={};var _0x3bb9ac={};var _0x1aebfc;var _0x170d92;return db[_0xf708('0x27')][_0xf708('0x4a')]({'where':{'id':_0x4b3d5b[_0xf708('0x3e')]['id']}})[_0xf708('0x21')](handleEntityNotFound(_0x302dbb,null))[_0xf708('0x21')](function(_0x222e7e){if(_0x222e7e){_0x1aebfc=_0x222e7e;_0x3bb9ac[_0xf708('0x2c')]=_[_0xf708('0x4b')](db[_0xf708('0x4f')][_0xf708('0x28')]);_0x3bb9ac[_0xf708('0x2f')]=_['keys'](_0x4b3d5b[_0xf708('0x2f')]);_0x3bb9ac['filters']=_['intersection'](_0x3bb9ac[_0xf708('0x2c')],_0x3bb9ac[_0xf708('0x2f')]);_0x5c63d9[_0xf708('0x31')]=_[_0xf708('0x30')](_0x3bb9ac[_0xf708('0x2c')],qs['fields'](_0x4b3d5b[_0xf708('0x2f')]['fields']));_0x5c63d9[_0xf708('0x31')]=_0x5c63d9[_0xf708('0x31')][_0xf708('0x3f')]?_0x5c63d9['attributes']:_0x3bb9ac[_0xf708('0x2c')];_0x5c63d9[_0xf708('0x33')]=qs[_0xf708('0x4c')](_0x4b3d5b[_0xf708('0x2f')][_0xf708('0x4c')]);_0x5c63d9[_0xf708('0x34')]=qs['filters'](_[_0xf708('0x35')](_0x4b3d5b[_0xf708('0x2f')],_0x3bb9ac[_0xf708('0x36')]));if(_0x4b3d5b['query'][_0xf708('0x37')]){_0x5c63d9[_0xf708('0x34')]=_[_0xf708('0x38')](_0x5c63d9[_0xf708('0x34')],{'$or':_[_0xf708('0x2d')](_0x5c63d9['attributes'],function(_0x525874){var _0xafc2aa={};_0xafc2aa[_0x525874]={'$like':'%'+_0x4b3d5b[_0xf708('0x2f')]['filter']+'%'};return _0xafc2aa;})});}_0x5c63d9=_[_0xf708('0x38')]({},_0x5c63d9,_0x4b3d5b['options']);return _0x1aebfc[_0xf708('0x52')](_0x5c63d9);}})[_0xf708('0x21')](function(_0x41ef79){if(_0x41ef79){_0x170d92=_0x41ef79['length'];if(!_0x4b3d5b['query'][_0xf708('0x53')]('nolimit')){_0x5c63d9['limit']=qs[_0xf708('0x4e')](_0x4b3d5b[_0xf708('0x2f')][_0xf708('0x4e')]);_0x5c63d9[_0xf708('0x1c')]=qs[_0xf708('0x1c')](_0x4b3d5b['query'][_0xf708('0x1c')]);}return _0x1aebfc[_0xf708('0x52')](_0x5c63d9);}})[_0xf708('0x21')](function(_0x4f62f5){if(_0x4f62f5){return _0x4f62f5?{'count':_0x170d92,'rows':_0x4f62f5}:null;}})[_0xf708('0x21')](respondWithResult(_0x302dbb,null))[_0xf708('0x3c')](handleError(_0x302dbb,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 0a4c7f7..3fbc196 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 _0x08a5=['tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./automation.attributes','exports','define','Automation'];(function(_0x21a2b3,_0x5d6564){var _0x4651a7=function(_0x285f59){while(--_0x285f59){_0x21a2b3['push'](_0x21a2b3['shift']());}};_0x4651a7(++_0x5d6564);}(_0x08a5,0x1d5));var _0x508a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x08a5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x508a('0x0'));var util=require(_0x508a('0x1'));var logger=require(_0x508a('0x2'))(_0x508a('0x3'));var moment=require(_0x508a('0x4'));var BPromise=require(_0x508a('0x5'));var rp=require(_0x508a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x508a('0x7'));var config=require('../../config/environment');var attributes=require(_0x508a('0x8'));module[_0x508a('0x9')]=function(_0x30bfea,_0x5c87b8){return _0x30bfea[_0x508a('0xa')](_0x508a('0xb'),attributes,{'tableName':_0x508a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa80f=['define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./automation.attributes'];(function(_0x30b2c6,_0x1eafe8){var _0x42052d=function(_0xfeb539){while(--_0xfeb539){_0x30b2c6['push'](_0x30b2c6['shift']());}};_0x42052d(++_0x1eafe8);}(_0xa80f,0x17c));var _0xfa80=function(_0x5a57c6,_0x394b7d){_0x5a57c6=_0x5a57c6-0x0;var _0x509601=_0xa80f[_0x5a57c6];return _0x509601;};'use strict';var _=require(_0xfa80('0x0'));var util=require(_0xfa80('0x1'));var logger=require(_0xfa80('0x2'))(_0xfa80('0x3'));var moment=require(_0xfa80('0x4'));var BPromise=require(_0xfa80('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa80('0x6'));var rimraf=require(_0xfa80('0x7'));var config=require(_0xfa80('0x8'));var attributes=require(_0xfa80('0x9'));module['exports']=function(_0xe5a2a0,_0x1c5bd7){return _0xe5a2a0[_0xfa80('0xa')](_0xfa80('0xb'),attributes,{'tableName':_0xfa80('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 0e5814a..e742f0e 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 _0x87d9=['../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x314f8b,_0x28224e){var _0x6c3532=function(_0x4a6132){while(--_0x4a6132){_0x314f8b['push'](_0x314f8b['shift']());}};_0x6c3532(++_0x28224e);}(_0x87d9,0x143));var _0x987d=function(_0x4633ee,_0xc061fe){_0x4633ee=_0x4633ee-0x0;var _0x5c5ac0=_0x87d9[_0x4633ee];return _0x5c5ac0;};'use strict';var _=require(_0x987d('0x0'));var util=require('util');var moment=require(_0x987d('0x1'));var BPromise=require(_0x987d('0x2'));var rs=require(_0x987d('0x3'));var fs=require('fs');var Redis=require(_0x987d('0x4'));var db=require(_0x987d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x987d('0x6'))('rpc');var config=require(_0x987d('0x7'));var jayson=require(_0x987d('0x8'));var client=jayson['client'][_0x987d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ee510,_0x5bf349,_0x11d89e){return new BPromise(function(_0x1f97b6,_0x444273){return client[_0x987d('0xa')](_0x3ee510,_0x11d89e)[_0x987d('0xb')](function(_0x325c8b){logger[_0x987d('0xc')]('Automation,\x20%s,\x20%s',_0x5bf349,_0x987d('0xd'));logger[_0x987d('0xe')](_0x987d('0xf'),_0x5bf349,_0x987d('0xd'),JSON['stringify'](_0x325c8b));if(_0x325c8b[_0x987d('0x10')]){if(_0x325c8b[_0x987d('0x10')][_0x987d('0x11')]===0x1f4){logger[_0x987d('0x10')](_0x987d('0x12'),_0x5bf349,_0x325c8b[_0x987d('0x10')][_0x987d('0x13')]);return _0x444273(_0x325c8b[_0x987d('0x10')][_0x987d('0x13')]);}logger['error']('Automation,\x20%s,\x20%s',_0x5bf349,_0x325c8b[_0x987d('0x10')][_0x987d('0x13')]);return _0x1f97b6(_0x325c8b[_0x987d('0x10')][_0x987d('0x13')]);}else{logger[_0x987d('0xc')](_0x987d('0x12'),_0x5bf349,_0x987d('0xd'));_0x1f97b6(_0x325c8b[_0x987d('0x14')][_0x987d('0x13')]);}})[_0x987d('0x15')](function(_0x197e46){logger[_0x987d('0x10')](_0x987d('0x12'),_0x5bf349,_0x197e46);_0x444273(_0x197e46);});});} \ No newline at end of file +var _0x0b0e=['Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','debug'];(function(_0x2e249d,_0x41b7e7){var _0x1faa37=function(_0x1422b4){while(--_0x1422b4){_0x2e249d['push'](_0x2e249d['shift']());}};_0x1faa37(++_0x41b7e7);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3c5ad6,_0x47b7bf){_0x3c5ad6=_0x3c5ad6-0x0;var _0x3154f2=_0x0b0e[_0x3c5ad6];return _0x3154f2;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('Automation,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 1205be1..3ed5275 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 _0x9de3=['../../config/environment','./automation.controller','get','index','/:id','isAuthenticated','show','getConditions','/:id/actions','getActions','post','create','/:id/conditions','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0xa9eaa0,_0x4ba2b4){var _0x30897a=function(_0x2caa01){while(--_0x2caa01){_0xa9eaa0['push'](_0xa9eaa0['shift']());}};_0x30897a(++_0x4ba2b4);}(_0x9de3,0xea));var _0x39de=function(_0x100521,_0x351566){_0x100521=_0x100521-0x0;var _0x4c8267=_0x9de3[_0x100521];return _0x4c8267;};'use strict';var multer=require(_0x39de('0x0'));var util=require('util');var path=require(_0x39de('0x1'));var timeout=require(_0x39de('0x2'));var express=require(_0x39de('0x3'));var router=express['Router']();var fs_extra=require(_0x39de('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x39de('0x5'));var config=require(_0x39de('0x6'));var controller=require(_0x39de('0x7'));router[_0x39de('0x8')]('/',auth['isAuthenticated'](),controller[_0x39de('0x9')]);router[_0x39de('0x8')](_0x39de('0xa'),auth[_0x39de('0xb')](),controller[_0x39de('0xc')]);router['get']('/:id/conditions',auth['isAuthenticated'](),controller[_0x39de('0xd')]);router[_0x39de('0x8')](_0x39de('0xe'),auth[_0x39de('0xb')](),controller[_0x39de('0xf')]);router[_0x39de('0x10')]('/',auth[_0x39de('0xb')](),controller[_0x39de('0x11')]);router['post'](_0x39de('0x12'),auth['isAuthenticated'](),controller['addConditions']);router[_0x39de('0x10')](_0x39de('0xe'),auth[_0x39de('0xb')](),controller['addActions']);router[_0x39de('0x13')](_0x39de('0xa'),auth[_0x39de('0xb')](),controller[_0x39de('0x14')]);router[_0x39de('0x15')](_0x39de('0xa'),auth[_0x39de('0xb')](),controller[_0x39de('0x16')]);module[_0x39de('0x17')]=router; \ No newline at end of file +var _0xd0a2=['/:id','/:id/conditions','/:id/actions','getActions','post','create','addConditions','put','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index'];(function(_0x105e11,_0x128087){var _0x3cc2e5=function(_0x3aec6d){while(--_0x3aec6d){_0x105e11['push'](_0x105e11['shift']());}};_0x3cc2e5(++_0x128087);}(_0xd0a2,0x128));var _0x2d0a=function(_0xfadc1a,_0xc6a189){_0xfadc1a=_0xfadc1a-0x0;var _0x1be3a4=_0xd0a2[_0xfadc1a];return _0x1be3a4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2d0a('0x0'));var timeout=require(_0x2d0a('0x1'));var express=require(_0x2d0a('0x2'));var router=express[_0x2d0a('0x3')]();var fs_extra=require(_0x2d0a('0x4'));var auth=require(_0x2d0a('0x5'));var interaction=require(_0x2d0a('0x6'));var config=require(_0x2d0a('0x7'));var controller=require(_0x2d0a('0x8'));router[_0x2d0a('0x9')]('/',auth[_0x2d0a('0xa')](),controller[_0x2d0a('0xb')]);router[_0x2d0a('0x9')](_0x2d0a('0xc'),auth[_0x2d0a('0xa')](),controller['show']);router[_0x2d0a('0x9')](_0x2d0a('0xd'),auth[_0x2d0a('0xa')](),controller['getConditions']);router[_0x2d0a('0x9')](_0x2d0a('0xe'),auth[_0x2d0a('0xa')](),controller[_0x2d0a('0xf')]);router[_0x2d0a('0x10')]('/',auth[_0x2d0a('0xa')](),controller[_0x2d0a('0x11')]);router[_0x2d0a('0x10')]('/:id/conditions',auth[_0x2d0a('0xa')](),controller[_0x2d0a('0x12')]);router[_0x2d0a('0x10')](_0x2d0a('0xe'),auth[_0x2d0a('0xa')](),controller['addActions']);router[_0x2d0a('0x13')](_0x2d0a('0xc'),auth[_0x2d0a('0xa')](),controller['update']);router[_0x2d0a('0x14')](_0x2d0a('0xc'),auth[_0x2d0a('0xa')](),controller['destroy']);module[_0x2d0a('0x15')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 8e11561..eebafd1 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 _0x2813=['BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','ENUM','always','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\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ivr'];(function(_0x4233e2,_0x1ae078){var _0x5bad86=function(_0xffc34e){while(--_0xffc34e){_0x4233e2['push'](_0x4233e2['shift']());}};_0x5bad86(++_0x1ae078);}(_0x2813,0x6e));var _0x3281=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2813[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x3281('0x0')]={'name':{'type':Sequelize[_0x3281('0x1')],'unique':_0x3281('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x3281('0x3')),'allowNull':![],'defaultValue':_0x3281('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x3281('0x4')],'defaultValue':0x0,'comment':_0x3281('0x5')},'limitCalls':{'type':Sequelize[_0x3281('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x3281('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x3281('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3281('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x3281('0x6')](0x3)[_0x3281('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x3281('0x6')](0x3)[_0x3281('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3281('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3281('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3281('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x3281('0x6')](0x3)[_0x3281('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3281('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x3281('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3281('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x3281('0xd')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3281('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x3281('0xe')](_0x3281('0xf'),_0x3281('0x10'),_0x3281('0x11')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x3281('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x3281('0x6')](0x9)[_0x3281('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3281('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x3281('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x3281('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3281('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3281('0x6')](0x9)[_0x3281('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3281('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x3281('0x6')](0x9)[_0x3281('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3281('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x3281('0x6')](0x9)[_0x3281('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3281('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3281('0x6')](0x9)[_0x3281('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3281('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3281('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x3281('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x3281('0x6')](0x9)[_0x3281('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3281('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x3281('0xe')](_0x3281('0x1b'),_0x3281('0x1c')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x3281('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x3281('0x6')](0x3)[_0x3281('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3281('0x1d')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x3281('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3281('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x3281('0x6')](0x3)[_0x3281('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3281('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x3281('0x6')](0x5)[_0x3281('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x3281('0x6')](0x3)[_0x3281('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x3281('0x6')](0x5)[_0x3281('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3281('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x3281('0x6')](0x3)[_0x3281('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3281('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3281('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x3281('0x6')](0x3)[_0x3281('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3281('0x22')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3281('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x3281('0x6')](0x3)[_0x3281('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3281('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3281('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3281('0x25')}}; \ No newline at end of file +var _0x4e63=['exports','ENUM','STRING','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4e63,0x1ad));var _0x34e6=function(_0x200770,_0x4391ed){_0x200770=_0x200770-0x0;var _0x303db6=_0x4e63[_0x200770];return _0x303db6;};'use strict';var Sequelize=require('sequelize');module[_0x34e6('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x34e6('0x1')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize[_0x34e6('0x2')]},'active':{'type':Sequelize[_0x34e6('0x3')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x34e6('0x4')](0x4)[_0x34e6('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x34e6('0x6')},'dialOriginateCallerIdName':{'type':Sequelize[_0x34e6('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x34e6('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x34e6('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x34e6('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0x34e6('0x4')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x34e6('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x34e6('0x4')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x34e6('0x9')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x34e6('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x34e6('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x34e6('0x4')](0x5)[_0x34e6('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x34e6('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x34e6('0x4')](0x3)[_0x34e6('0x5')],'defaultValue':0x3,'comment':_0x34e6('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x34e6('0x4')](0x5)[_0x34e6('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x34e6('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x34e6('0x5')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x34e6('0xe')},'dialTimezone':{'type':Sequelize[_0x34e6('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x34e6('0x2')],'defaultValue':_0x34e6('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x34e6('0x1')](_0x34e6('0x10'),_0x34e6('0x11'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x34e6('0x3')],'defaultValue':0x0,'comment':_0x34e6('0x12')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x34e6('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x34e6('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x34e6('0x4')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x34e6('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x34e6('0x4')](0x9)[_0x34e6('0x5')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x34e6('0x15')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x34e6('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x34e6('0x4')](0x9)[_0x34e6('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x34e6('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x34e6('0x4')](0x9)[_0x34e6('0x5')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x34e6('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x34e6('0x4')](0x5)[_0x34e6('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x34e6('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x34e6('0x4')](0x9)[_0x34e6('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x34e6('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x34e6('0x1')](_0x34e6('0x1a'),_0x34e6('0x1b')),'defaultValue':_0x34e6('0x1a')},'dialPrefix':{'type':Sequelize[_0x34e6('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x34e6('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x34e6('0x1c')},'dialCutDigit':{'type':Sequelize[_0x34e6('0x4')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x34e6('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x34e6('0x4')](0x3)[_0x34e6('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x34e6('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x34e6('0x4')](0x5)[_0x34e6('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x34e6('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x34e6('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x34e6('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0x34e6('0x4')](0x5)[_0x34e6('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x34e6('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x34e6('0x4')](0x3)[_0x34e6('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x34e6('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x34e6('0x4')](0x5)[_0x34e6('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x34e6('0x23')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x34e6('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x34e6('0x24')},'dialMachineRetryFrequency':{'type':Sequelize[_0x34e6('0x4')](0x5)[_0x34e6('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x34e6('0x4')](0x3)[_0x34e6('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x34e6('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x34e6('0x26')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 5e26efc..fcddeb3 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 _0x30d6=['sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','offset','count','Content-Range','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','stack','name','send','index','Campaign','rawAttributes','fieldName','type','key','map','query','keys','intersection','attributes','model','length','hasOwnProperty','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','includeAll','catch','params','fields','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','body','role','findOne','CampaignId','CmHopper','findAll','rows','getHopperHistories','CmHopperHistory','nolimit','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','ids','omit','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','from','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','fromQuery','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','OrderBy','ci.item','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache'];(function(_0x2d1357,_0x40febc){var _0x44f553=function(_0x5257bb){while(--_0x5257bb){_0x2d1357['push'](_0x2d1357['shift']());}};_0x44f553(++_0x40febc);}(_0x30d6,0x1b0));var _0x630d=function(_0x23f58d,_0x22b11c){_0x23f58d=_0x23f58d-0x0;var _0x515d10=_0x30d6[_0x23f58d];return _0x515d10;};'use strict';var emlformat=require(_0x630d('0x0'));var rimraf=require(_0x630d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x630d('0x2'));var rp=require('request-promise');var moment=require(_0x630d('0x3'));var BPromise=require(_0x630d('0x4'));var Mustache=require(_0x630d('0x5'));var util=require('util');var path=require('path');var sox=require(_0x630d('0x6'));var csv=require(_0x630d('0x7'));var ejs=require(_0x630d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x630d('0x9'));var squel=require(_0x630d('0xa'));var crypto=require(_0x630d('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x630d('0x7'));var querystring=require(_0x630d('0xc'));var Papa=require(_0x630d('0xd'));var Redis=require(_0x630d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x630d('0xf'));var as=require(_0x630d('0x10'));var hardwareService=require(_0x630d('0x11'));var logger=require(_0x630d('0x12'))(_0x630d('0x13'));var utils=require(_0x630d('0x14'));var config=require(_0x630d('0x15'));var licenseUtil=require(_0x630d('0x16'));var db=require(_0x630d('0x17'))['db'];function respondWithStatusCode(_0x3c86ef,_0x4e67c4){_0x4e67c4=_0x4e67c4||0xcc;return function(_0x1f458a){if(_0x1f458a){return _0x3c86ef['sendStatus'](_0x4e67c4);}return _0x3c86ef[_0x630d('0x18')](_0x4e67c4)[_0x630d('0x19')]();};}function respondWithResult(_0x51808f,_0x23e4e4){_0x23e4e4=_0x23e4e4||0xc8;return function(_0x1cc36b){if(_0x1cc36b){return _0x51808f[_0x630d('0x18')](_0x23e4e4)[_0x630d('0x1a')](_0x1cc36b);}};}function respondWithFilteredResult(_0x1c3f36,_0x82d90){return function(_0x162263){if(_0x162263){var _0x156687=typeof _0x82d90['offset']===_0x630d('0x1b')&&typeof _0x82d90['limit']===_0x630d('0x1b');var _0x48d0af=_0x162263['count'];var _0x227d62=_0x156687?0x0:_0x82d90[_0x630d('0x1c')];var _0x57066b=_0x156687?_0x162263[_0x630d('0x1d')]:_0x82d90[_0x630d('0x1c')]+_0x82d90['limit'];var _0x3443b1;if(_0x57066b>=_0x48d0af){_0x57066b=_0x48d0af;_0x3443b1=0xc8;}else{_0x3443b1=0xce;}_0x1c3f36['status'](_0x3443b1);return _0x1c3f36['set'](_0x630d('0x1e'),_0x227d62+'-'+_0x57066b+'/'+_0x48d0af)['json'](_0x162263);}return null;};}function patchUpdates(_0x2d960f){return function(_0xa7c90e){try{jsonpatch['apply'](_0xa7c90e,_0x2d960f,!![]);}catch(_0x9d16e6){return BPromise[_0x630d('0x1f')](_0x9d16e6);}return _0xa7c90e[_0x630d('0x20')]();};}function saveUpdates(_0x52d152,_0x4f5334){return function(_0x4c27b2){if(_0x4c27b2){return _0x4c27b2[_0x630d('0x21')](_0x52d152)[_0x630d('0x22')](function(_0x324f51){return _0x324f51;});}return null;};}function removeEntity(_0x56743e,_0x1e178e){return function(_0x1bae23){if(_0x1bae23){return _0x1bae23[_0x630d('0x23')]()[_0x630d('0x22')](function(){var _0x5ae2a1=_0x1bae23[_0x630d('0x24')]({'plain':!![]});var _0x10fb6e=_0x630d('0x25');return db[_0x630d('0x26')][_0x630d('0x23')]({'where':{'type':_0x10fb6e,'resourceId':_0x5ae2a1['id']}})[_0x630d('0x22')](function(){return _0x1bae23;});})[_0x630d('0x22')](function(){_0x56743e['status'](0xcc)[_0x630d('0x19')]();});}};}function handleEntityNotFound(_0x5c5d36,_0xd198d5){return function(_0x5346da){if(!_0x5346da){_0x5c5d36['sendStatus'](0x194);}return _0x5346da;};}function handleError(_0x368a88,_0x274a40){_0x274a40=_0x274a40||0x1f4;return function(_0x3d62dd){logger['error'](_0x3d62dd[_0x630d('0x27')]);if(_0x3d62dd['name']){delete _0x3d62dd[_0x630d('0x28')];}_0x368a88[_0x630d('0x18')](_0x274a40)[_0x630d('0x29')](_0x3d62dd);};}exports[_0x630d('0x2a')]=function(_0x20fc93,_0x8db5c1){var _0x2a9269={},_0x2d6d26={},_0x357f46={'count':0x0,'rows':[]};var _0x33ad60=_['map'](db[_0x630d('0x2b')][_0x630d('0x2c')],function(_0x2120e8){return{'name':_0x2120e8[_0x630d('0x2d')],'type':_0x2120e8[_0x630d('0x2e')][_0x630d('0x2f')]};});_0x2d6d26['model']=_[_0x630d('0x30')](_0x33ad60,_0x630d('0x28'));_0x2d6d26[_0x630d('0x31')]=_[_0x630d('0x32')](_0x20fc93[_0x630d('0x31')]);_0x2d6d26['filters']=_[_0x630d('0x33')](_0x2d6d26['model'],_0x2d6d26[_0x630d('0x31')]);_0x2a9269[_0x630d('0x34')]=_[_0x630d('0x33')](_0x2d6d26[_0x630d('0x35')],qs['fields'](_0x20fc93[_0x630d('0x31')]['fields']));_0x2a9269[_0x630d('0x34')]=_0x2a9269[_0x630d('0x34')][_0x630d('0x36')]?_0x2a9269[_0x630d('0x34')]:_0x2d6d26['model'];if(!_0x20fc93[_0x630d('0x31')][_0x630d('0x37')]('nolimit')){_0x2a9269[_0x630d('0x38')]=qs[_0x630d('0x38')](_0x20fc93[_0x630d('0x31')]['limit']);_0x2a9269[_0x630d('0x1c')]=qs[_0x630d('0x1c')](_0x20fc93[_0x630d('0x31')]['offset']);}_0x2a9269[_0x630d('0x39')]=qs[_0x630d('0x3a')](_0x20fc93['query'][_0x630d('0x3a')]);_0x2a9269[_0x630d('0x3b')]=qs[_0x630d('0x3c')](_[_0x630d('0x3d')](_0x20fc93[_0x630d('0x31')],_0x2d6d26[_0x630d('0x3c')]),_0x33ad60);if(_0x20fc93[_0x630d('0x31')][_0x630d('0x3e')]){_0x2a9269[_0x630d('0x3b')]=_['merge'](_0x2a9269[_0x630d('0x3b')],{'$or':_['map'](_0x33ad60,function(_0x13ed13){if(_0x13ed13[_0x630d('0x2e')]!==_0x630d('0x3f')){var _0x4a4f31={};_0x4a4f31[_0x13ed13[_0x630d('0x28')]]={'$like':'%'+_0x20fc93[_0x630d('0x31')][_0x630d('0x3e')]+'%'};return _0x4a4f31;}})});}_0x2a9269=_[_0x630d('0x40')]({},_0x2a9269,_0x20fc93['options']);var _0x25711={'where':_0x2a9269[_0x630d('0x3b')]};return db[_0x630d('0x2b')][_0x630d('0x1d')](_0x25711)[_0x630d('0x22')](function(_0x4402de){_0x357f46['count']=_0x4402de;if(_0x20fc93[_0x630d('0x31')][_0x630d('0x41')]){_0x2a9269['include']=[{'all':!![]}];}return db[_0x630d('0x2b')]['findAll'](_0x2a9269);})[_0x630d('0x22')](function(_0x4e4223){_0x357f46['rows']=_0x4e4223;return _0x357f46;})[_0x630d('0x22')](respondWithFilteredResult(_0x8db5c1,_0x2a9269))[_0x630d('0x42')](handleError(_0x8db5c1,null));};exports['show']=function(_0x319650,_0x400cb5){var _0x5b35a0={'raw':![],'where':{'id':_0x319650[_0x630d('0x43')]['id']}},_0x2d5580={};_0x2d5580[_0x630d('0x35')]=_['keys'](db[_0x630d('0x2b')][_0x630d('0x2c')]);_0x2d5580[_0x630d('0x31')]=_[_0x630d('0x32')](_0x319650['query']);_0x2d5580[_0x630d('0x3c')]=_['intersection'](_0x2d5580['model'],_0x2d5580[_0x630d('0x31')]);_0x5b35a0[_0x630d('0x34')]=_[_0x630d('0x33')](_0x2d5580[_0x630d('0x35')],qs[_0x630d('0x44')](_0x319650[_0x630d('0x31')][_0x630d('0x44')]));_0x5b35a0[_0x630d('0x34')]=_0x5b35a0['attributes']['length']?_0x5b35a0[_0x630d('0x34')]:_0x2d5580[_0x630d('0x35')];if(_0x319650[_0x630d('0x31')][_0x630d('0x41')]){_0x5b35a0[_0x630d('0x45')]=[{'all':!![]}];}_0x5b35a0=_['merge']({},_0x5b35a0,_0x319650[_0x630d('0x46')]);return db['Campaign'][_0x630d('0x47')](_0x5b35a0)[_0x630d('0x22')](handleEntityNotFound(_0x400cb5,null))[_0x630d('0x22')](respondWithResult(_0x400cb5,null))[_0x630d('0x42')](handleError(_0x400cb5,null));};exports['create']=function(_0x2c81c6,_0x17d3fe){return db[_0x630d('0x2b')][_0x630d('0x48')](_0x2c81c6['body'],{})['then'](function(_0x522b8e){var _0x432716=_0x2c81c6[_0x630d('0x49')][_0x630d('0x24')]({'plain':!![]});if(!_0x432716)throw new Error(_0x630d('0x4a'));if(_0x432716['role']===_0x630d('0x49')){var _0x3a225a=_0x522b8e[_0x630d('0x24')]({'plain':!![]});var _0x4c84dc=_0x630d('0x25');return db[_0x630d('0x4b')]['find']({'where':{'name':_0x4c84dc,'userProfileId':_0x432716[_0x630d('0x4c')]},'raw':!![]})['then'](function(_0x1d25aa){if(_0x1d25aa&&_0x1d25aa[_0x630d('0x4d')]===0x0){return db[_0x630d('0x26')][_0x630d('0x48')]({'name':_0x3a225a[_0x630d('0x28')],'resourceId':_0x3a225a['id'],'type':_0x1d25aa[_0x630d('0x28')],'sectionId':_0x1d25aa['id']},{})['then'](function(){return _0x522b8e;});}else{return _0x522b8e;}})[_0x630d('0x42')](function(_0x4ce602){logger[_0x630d('0x4e')](_0x630d('0x4f'),_0x4ce602);throw _0x4ce602;});}return _0x522b8e;})[_0x630d('0x22')](respondWithResult(_0x17d3fe,0xc9))[_0x630d('0x42')](handleError(_0x17d3fe,null));};exports[_0x630d('0x50')]=function(_0x4bc6cb,_0x5cf1e9){var _0xab862b={'where':{'id':_0x4bc6cb[_0x630d('0x43')]['id']}},_0xacf4de={};_0xacf4de[_0x630d('0x35')]=_[_0x630d('0x32')](db[_0x630d('0x2b')][_0x630d('0x2c')]);_0xab862b[_0x630d('0x34')]=_['intersection'](_0xacf4de[_0x630d('0x35')],qs[_0x630d('0x44')](_0x4bc6cb[_0x630d('0x31')][_0x630d('0x44')]));_0xab862b[_0x630d('0x34')]=_0xab862b[_0x630d('0x34')]['length']?_0xab862b[_0x630d('0x34')]:_0xacf4de['model'];if(_0x4bc6cb[_0x630d('0x31')][_0x630d('0x41')]){_0xab862b[_0x630d('0x45')]=[{'all':!![]}];}_0xab862b=_[_0x630d('0x40')]({},_0xab862b,_0x4bc6cb[_0x630d('0x46')]);return db['Campaign'][_0x630d('0x47')](_0xab862b)[_0x630d('0x22')](handleEntityNotFound(_0x5cf1e9,null))[_0x630d('0x22')](function(_0x27307a){if(_0x27307a){var _0x234804=_0x27307a[_0x630d('0x24')]({'plain':!![]});_0x234804=qs['omit'](_0x234804,['id',_0x630d('0x51'),_0x630d('0x52')]);_0x4bc6cb[_0x630d('0x53')]=_['omit'](_0x4bc6cb[_0x630d('0x53')],['id','createdAt',_0x630d('0x52')]);return db[_0x630d('0x2b')][_0x630d('0x48')](_[_0x630d('0x40')](_0x234804,_0x4bc6cb[_0x630d('0x53')]),{'include':_0x4bc6cb[_0x630d('0x31')][_0x630d('0x41')]?[{'all':!![]}]:undefined})[_0x630d('0x22')](function(_0x518cbe){var _0x296851=_0x4bc6cb['user'][_0x630d('0x24')]({'plain':!![]});if(!_0x296851)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x296851[_0x630d('0x54')]==='user'){var _0x304a9a=_0x518cbe['get']({'plain':!![]});var _0x49c8d7=_0x630d('0x25');return db[_0x630d('0x4b')]['find']({'where':{'name':_0x49c8d7,'userProfileId':_0x296851['userProfileId']},'raw':!![]})['then'](function(_0x22c547){if(_0x22c547&&_0x22c547[_0x630d('0x4d')]===0x0){return db[_0x630d('0x26')]['create']({'name':_0x304a9a['name'],'resourceId':_0x304a9a['id'],'type':_0x22c547[_0x630d('0x28')],'sectionId':_0x22c547['id']},{})[_0x630d('0x22')](function(){return _0x518cbe;});}else{return _0x518cbe;}})[_0x630d('0x42')](function(_0x2cd222){logger[_0x630d('0x4e')](_0x630d('0x4f'),_0x2cd222);throw _0x2cd222;});}return _0x518cbe;});}})[_0x630d('0x22')](respondWithResult(_0x5cf1e9,0xc9))[_0x630d('0x42')](handleError(_0x5cf1e9,null));};exports['update']=function(_0x55f5cf,_0x4c6c25){if(_0x55f5cf[_0x630d('0x53')]['id']){delete _0x55f5cf[_0x630d('0x53')]['id'];}return db['Campaign'][_0x630d('0x47')]({'where':{'id':_0x55f5cf['params']['id']}})[_0x630d('0x22')](handleEntityNotFound(_0x4c6c25,null))[_0x630d('0x22')](saveUpdates(_0x55f5cf[_0x630d('0x53')],null))[_0x630d('0x22')](respondWithResult(_0x4c6c25,null))[_0x630d('0x42')](handleError(_0x4c6c25,null));};exports[_0x630d('0x23')]=function(_0x114772,_0x3bad41){return db[_0x630d('0x2b')][_0x630d('0x47')]({'where':{'id':_0x114772[_0x630d('0x43')]['id']}})['then'](handleEntityNotFound(_0x3bad41,null))['then'](removeEntity(_0x3bad41,null))[_0x630d('0x42')](handleError(_0x3bad41,null));};exports['getHoppers']=function(_0x104c4f,_0x40688a,_0x417f33){var _0x23e4ba={'raw':!![],'where':{}};var _0x57a7e9={};var _0xdf5bde={'count':0x0,'rows':[]};return db[_0x630d('0x2b')][_0x630d('0x55')]({'where':{'id':_0x104c4f[_0x630d('0x43')]['id']}})[_0x630d('0x22')](handleEntityNotFound(_0x40688a,null))[_0x630d('0x22')](function(_0x5588c1){if(_0x5588c1){_0x57a7e9['model']=_[_0x630d('0x32')](db['CmHopper'][_0x630d('0x2c')]);_0x57a7e9[_0x630d('0x31')]=_[_0x630d('0x32')](_0x104c4f[_0x630d('0x31')]);_0x57a7e9[_0x630d('0x3c')]=_[_0x630d('0x33')](_0x57a7e9[_0x630d('0x35')],_0x57a7e9[_0x630d('0x31')]);_0x23e4ba[_0x630d('0x34')]=_['intersection'](_0x57a7e9['model'],qs[_0x630d('0x44')](_0x104c4f['query']['fields']));_0x23e4ba[_0x630d('0x34')]=_0x23e4ba['attributes']['length']?_0x23e4ba['attributes']:_0x57a7e9[_0x630d('0x35')];if(!_0x104c4f[_0x630d('0x31')][_0x630d('0x37')]('nolimit')){_0x23e4ba['limit']=qs[_0x630d('0x38')](_0x104c4f['query'][_0x630d('0x38')]);_0x23e4ba[_0x630d('0x1c')]=qs[_0x630d('0x1c')](_0x104c4f[_0x630d('0x31')][_0x630d('0x1c')]);}_0x23e4ba['order']=qs[_0x630d('0x3a')](_0x104c4f[_0x630d('0x31')][_0x630d('0x3a')]);_0x23e4ba[_0x630d('0x3b')]=qs[_0x630d('0x3c')](_[_0x630d('0x3d')](_0x104c4f[_0x630d('0x31')],_0x57a7e9['filters']));_0x23e4ba['where'][_0x630d('0x56')]=_0x5588c1['id'];if(_0x104c4f[_0x630d('0x31')]['filter']){_0x23e4ba[_0x630d('0x3b')]=_['merge'](_0x23e4ba[_0x630d('0x3b')],{'$or':_[_0x630d('0x30')](_0x23e4ba[_0x630d('0x34')],function(_0x3aacfa){var _0x7dcfd2={};_0x7dcfd2[_0x3aacfa]={'$like':'%'+_0x104c4f[_0x630d('0x31')]['filter']+'%'};return _0x7dcfd2;})});}_0x23e4ba=_['merge']({},_0x23e4ba,_0x104c4f[_0x630d('0x46')]);return db[_0x630d('0x57')]['count']({'where':_0x23e4ba['where']})['then'](function(_0x58ef6f){_0xdf5bde[_0x630d('0x1d')]=_0x58ef6f;if(_0x104c4f[_0x630d('0x31')][_0x630d('0x41')]){_0x23e4ba['include']=[{'all':!![]}];}return db[_0x630d('0x57')][_0x630d('0x58')](_0x23e4ba);})[_0x630d('0x22')](function(_0x83e0fb){_0xdf5bde[_0x630d('0x59')]=_0x83e0fb;return _0xdf5bde;});}})['then'](respondWithFilteredResult(_0x40688a,_0x23e4ba))[_0x630d('0x42')](handleError(_0x40688a,null));};exports[_0x630d('0x5a')]=function(_0x1cfd6a,_0x7d9941,_0x31f39e){var _0x3f7aff={'raw':!![],'where':{}};var _0x5047a0={};var _0x30a9b4={'count':0x0,'rows':[]};return db[_0x630d('0x2b')][_0x630d('0x55')]({'where':{'id':_0x1cfd6a[_0x630d('0x43')]['id']}})[_0x630d('0x22')](handleEntityNotFound(_0x7d9941,null))['then'](function(_0x327aba){if(_0x327aba){_0x5047a0['model']=_[_0x630d('0x32')](db[_0x630d('0x5b')][_0x630d('0x2c')]);_0x5047a0[_0x630d('0x31')]=_[_0x630d('0x32')](_0x1cfd6a[_0x630d('0x31')]);_0x5047a0[_0x630d('0x3c')]=_[_0x630d('0x33')](_0x5047a0[_0x630d('0x35')],_0x5047a0[_0x630d('0x31')]);_0x3f7aff[_0x630d('0x34')]=_[_0x630d('0x33')](_0x5047a0[_0x630d('0x35')],qs['fields'](_0x1cfd6a[_0x630d('0x31')][_0x630d('0x44')]));_0x3f7aff[_0x630d('0x34')]=_0x3f7aff[_0x630d('0x34')]['length']?_0x3f7aff[_0x630d('0x34')]:_0x5047a0[_0x630d('0x35')];if(!_0x1cfd6a['query'][_0x630d('0x37')](_0x630d('0x5c'))){_0x3f7aff[_0x630d('0x38')]=qs[_0x630d('0x38')](_0x1cfd6a[_0x630d('0x31')][_0x630d('0x38')]);_0x3f7aff[_0x630d('0x1c')]=qs[_0x630d('0x1c')](_0x1cfd6a[_0x630d('0x31')][_0x630d('0x1c')]);}_0x3f7aff[_0x630d('0x39')]=qs[_0x630d('0x3a')](_0x1cfd6a[_0x630d('0x31')][_0x630d('0x3a')]);_0x3f7aff[_0x630d('0x3b')]=qs[_0x630d('0x3c')](_[_0x630d('0x3d')](_0x1cfd6a[_0x630d('0x31')],_0x5047a0[_0x630d('0x3c')]));_0x3f7aff[_0x630d('0x3b')]['CampaignId']=_0x327aba['id'];if(_0x1cfd6a[_0x630d('0x31')][_0x630d('0x3e')]){_0x3f7aff[_0x630d('0x3b')]=_[_0x630d('0x40')](_0x3f7aff[_0x630d('0x3b')],{'$or':_[_0x630d('0x30')](_0x3f7aff[_0x630d('0x34')],function(_0xcf5dc4){var _0x32e12d={};_0x32e12d[_0xcf5dc4]={'$like':'%'+_0x1cfd6a[_0x630d('0x31')][_0x630d('0x3e')]+'%'};return _0x32e12d;})});}_0x3f7aff=_[_0x630d('0x40')]({},_0x3f7aff,_0x1cfd6a[_0x630d('0x46')]);return db['CmHopperHistory'][_0x630d('0x1d')]({'where':_0x3f7aff[_0x630d('0x3b')]})[_0x630d('0x22')](function(_0x2bb5f5){_0x30a9b4[_0x630d('0x1d')]=_0x2bb5f5;if(_0x1cfd6a['query']['includeAll']){_0x3f7aff[_0x630d('0x45')]=[{'all':!![]}];}return db[_0x630d('0x5b')][_0x630d('0x58')](_0x3f7aff);})[_0x630d('0x22')](function(_0x347fd1){_0x30a9b4[_0x630d('0x59')]=_0x347fd1;return _0x30a9b4;});}})['then'](respondWithFilteredResult(_0x7d9941,_0x3f7aff))[_0x630d('0x42')](handleError(_0x7d9941,null));};exports[_0x630d('0x5d')]=function(_0x555ee6,_0xce602e,_0x4fdcf4){var _0x36b585={'raw':!![],'where':{}};var _0x1d1d74={};var _0xc42603={'count':0x0,'rows':[]};return db[_0x630d('0x2b')][_0x630d('0x55')]({'where':{'id':_0x555ee6['params']['id']}})[_0x630d('0x22')](handleEntityNotFound(_0xce602e,null))[_0x630d('0x22')](function(_0x2da810){if(_0x2da810){_0x1d1d74[_0x630d('0x35')]=_[_0x630d('0x32')](db[_0x630d('0x5e')][_0x630d('0x2c')]);_0x1d1d74['query']=_[_0x630d('0x32')](_0x555ee6[_0x630d('0x31')]);_0x1d1d74[_0x630d('0x3c')]=_['intersection'](_0x1d1d74['model'],_0x1d1d74[_0x630d('0x31')]);_0x36b585['attributes']=_[_0x630d('0x33')](_0x1d1d74[_0x630d('0x35')],qs[_0x630d('0x44')](_0x555ee6[_0x630d('0x31')]['fields']));_0x36b585[_0x630d('0x34')]=_0x36b585[_0x630d('0x34')][_0x630d('0x36')]?_0x36b585['attributes']:_0x1d1d74[_0x630d('0x35')];if(!_0x555ee6[_0x630d('0x31')][_0x630d('0x37')]('nolimit')){_0x36b585['limit']=qs[_0x630d('0x38')](_0x555ee6[_0x630d('0x31')][_0x630d('0x38')]);_0x36b585[_0x630d('0x1c')]=qs[_0x630d('0x1c')](_0x555ee6[_0x630d('0x31')][_0x630d('0x1c')]);}_0x36b585[_0x630d('0x39')]=qs[_0x630d('0x3a')](_0x555ee6[_0x630d('0x31')][_0x630d('0x3a')]);_0x36b585[_0x630d('0x3b')]=qs[_0x630d('0x3c')](_['pick'](_0x555ee6[_0x630d('0x31')],_0x1d1d74[_0x630d('0x3c')]));_0x36b585[_0x630d('0x3b')][_0x630d('0x56')]=_0x2da810['id'];if(_0x555ee6['query'][_0x630d('0x3e')]){_0x36b585[_0x630d('0x3b')]=_[_0x630d('0x40')](_0x36b585[_0x630d('0x3b')],{'$or':_[_0x630d('0x30')](_0x36b585[_0x630d('0x34')],function(_0x17ca19){var _0x3ce33b={};_0x3ce33b[_0x17ca19]={'$like':'%'+_0x555ee6[_0x630d('0x31')]['filter']+'%'};return _0x3ce33b;})});}_0x36b585=_[_0x630d('0x40')]({},_0x36b585,_0x555ee6[_0x630d('0x46')]);return db[_0x630d('0x5e')][_0x630d('0x1d')]({'where':_0x36b585[_0x630d('0x3b')]})[_0x630d('0x22')](function(_0x4ba2e5){_0xc42603[_0x630d('0x1d')]=_0x4ba2e5;if(_0x555ee6[_0x630d('0x31')][_0x630d('0x41')]){_0x36b585[_0x630d('0x45')]=[{'all':!![]}];}return db[_0x630d('0x5e')]['findAll'](_0x36b585);})[_0x630d('0x22')](function(_0x29cfd6){_0xc42603[_0x630d('0x59')]=_0x29cfd6;return _0xc42603;});}})['then'](respondWithFilteredResult(_0xce602e,_0x36b585))[_0x630d('0x42')](handleError(_0xce602e,null));};exports[_0x630d('0x5f')]=function(_0x4a0086,_0x596b6f,_0x3b499a){var _0x4cdc7a={'raw':!![],'where':{}};var _0x113496={};var _0x5bccb0={'count':0x0,'rows':[]};return db[_0x630d('0x2b')][_0x630d('0x55')]({'where':{'id':_0x4a0086[_0x630d('0x43')]['id']}})[_0x630d('0x22')](handleEntityNotFound(_0x596b6f,null))[_0x630d('0x22')](function(_0x5aefab){if(_0x5aefab){_0x113496['model']=_[_0x630d('0x32')](db[_0x630d('0x60')][_0x630d('0x2c')]);_0x113496[_0x630d('0x31')]=_['keys'](_0x4a0086[_0x630d('0x31')]);_0x113496[_0x630d('0x3c')]=_[_0x630d('0x33')](_0x113496['model'],_0x113496[_0x630d('0x31')]);_0x4cdc7a['attributes']=_[_0x630d('0x33')](_0x113496['model'],qs[_0x630d('0x44')](_0x4a0086[_0x630d('0x31')]['fields']));_0x4cdc7a[_0x630d('0x34')]=_0x4cdc7a[_0x630d('0x34')][_0x630d('0x36')]?_0x4cdc7a['attributes']:_0x113496['model'];if(!_0x4a0086[_0x630d('0x31')][_0x630d('0x37')](_0x630d('0x5c'))){_0x4cdc7a[_0x630d('0x38')]=qs[_0x630d('0x38')](_0x4a0086[_0x630d('0x31')]['limit']);_0x4cdc7a['offset']=qs[_0x630d('0x1c')](_0x4a0086[_0x630d('0x31')][_0x630d('0x1c')]);}_0x4cdc7a[_0x630d('0x39')]=qs[_0x630d('0x3a')](_0x4a0086[_0x630d('0x31')]['sort']);_0x4cdc7a['where']=qs[_0x630d('0x3c')](_[_0x630d('0x3d')](_0x4a0086[_0x630d('0x31')],_0x113496['filters']));_0x4cdc7a[_0x630d('0x3b')]['CampaignId']=_0x5aefab['id'];if(_0x4a0086['query'][_0x630d('0x3e')]){_0x4cdc7a[_0x630d('0x3b')]=_[_0x630d('0x40')](_0x4cdc7a['where'],{'$or':_['map'](_0x4cdc7a['attributes'],function(_0x14d9a6){var _0x4f551b={};_0x4f551b[_0x14d9a6]={'$like':'%'+_0x4a0086[_0x630d('0x31')]['filter']+'%'};return _0x4f551b;})});}_0x4cdc7a=_[_0x630d('0x40')]({},_0x4cdc7a,_0x4a0086['options']);return db[_0x630d('0x60')][_0x630d('0x1d')]({'where':_0x4cdc7a['where']})[_0x630d('0x22')](function(_0x2bbe36){_0x5bccb0[_0x630d('0x1d')]=_0x2bbe36;if(_0x4a0086['query'][_0x630d('0x41')]){_0x4cdc7a[_0x630d('0x45')]=[{'all':!![]}];}return db[_0x630d('0x60')][_0x630d('0x58')](_0x4cdc7a);})[_0x630d('0x22')](function(_0x5b7e2f){_0x5bccb0['rows']=_0x5b7e2f;return _0x5bccb0;});}})[_0x630d('0x22')](respondWithFilteredResult(_0x596b6f,_0x4cdc7a))['catch'](handleError(_0x596b6f,null));};exports[_0x630d('0x61')]=function(_0x628634,_0x260438,_0x3b72fa){var _0x4c89f4={};var _0x451a75={};var _0x2d1a1c;var _0x242649;return db[_0x630d('0x2b')][_0x630d('0x55')]({'where':{'id':_0x628634[_0x630d('0x43')]['id']}})[_0x630d('0x22')](handleEntityNotFound(_0x260438,null))[_0x630d('0x22')](function(_0x214e14){if(_0x214e14){_0x2d1a1c=_0x214e14;_0x451a75[_0x630d('0x35')]=_[_0x630d('0x32')](db[_0x630d('0x62')][_0x630d('0x2c')]);_0x451a75[_0x630d('0x31')]=_[_0x630d('0x32')](_0x628634[_0x630d('0x31')]);_0x451a75['filters']=_[_0x630d('0x33')](_0x451a75[_0x630d('0x35')],_0x451a75['query']);_0x4c89f4[_0x630d('0x34')]=_['intersection'](_0x451a75[_0x630d('0x35')],qs[_0x630d('0x44')](_0x628634[_0x630d('0x31')][_0x630d('0x44')]));_0x4c89f4['attributes']=_0x4c89f4['attributes']['length']?_0x4c89f4[_0x630d('0x34')]:_0x451a75[_0x630d('0x35')];_0x4c89f4[_0x630d('0x39')]=qs[_0x630d('0x3a')](_0x628634['query'][_0x630d('0x3a')]);_0x4c89f4[_0x630d('0x3b')]=qs[_0x630d('0x3c')](_[_0x630d('0x3d')](_0x628634[_0x630d('0x31')],_0x451a75[_0x630d('0x3c')]));if(_0x628634[_0x630d('0x31')][_0x630d('0x3e')]){_0x4c89f4[_0x630d('0x3b')]=_['merge'](_0x4c89f4[_0x630d('0x3b')],{'$or':_[_0x630d('0x30')](_0x4c89f4[_0x630d('0x34')],function(_0x456de1){var _0x46ca50={};_0x46ca50[_0x456de1]={'$like':'%'+_0x628634[_0x630d('0x31')]['filter']+'%'};return _0x46ca50;})});}_0x4c89f4=_[_0x630d('0x40')]({},_0x4c89f4,_0x628634[_0x630d('0x46')]);return _0x2d1a1c[_0x630d('0x61')](_0x4c89f4);}})[_0x630d('0x22')](function(_0x3b21e8){if(_0x3b21e8){_0x242649=_0x3b21e8[_0x630d('0x36')];if(!_0x628634[_0x630d('0x31')][_0x630d('0x37')](_0x630d('0x5c'))){_0x4c89f4[_0x630d('0x38')]=qs[_0x630d('0x38')](_0x628634[_0x630d('0x31')]['limit']);_0x4c89f4[_0x630d('0x1c')]=qs[_0x630d('0x1c')](_0x628634[_0x630d('0x31')][_0x630d('0x1c')]);}return _0x2d1a1c[_0x630d('0x61')](_0x4c89f4);}})['then'](function(_0x2f649a){if(_0x2f649a){return _0x2f649a?{'count':_0x242649,'rows':_0x2f649a}:null;}})[_0x630d('0x22')](respondWithResult(_0x260438,null))[_0x630d('0x42')](handleError(_0x260438,null));};exports[_0x630d('0x63')]=function(_0xb4ac4e,_0x2728b0,_0x28a6e9){var _0x35ec4e,_0x17bb3f;var _0x15128d=[];var _0x436071=moment()[_0x630d('0x64')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x630d('0x2b')][_0x630d('0x47')]({'where':{'id':_0xb4ac4e['params']['id']}})[_0x630d('0x22')](handleEntityNotFound(_0x2728b0,null))[_0x630d('0x22')](function(_0x1889cc){if(_0x1889cc){_0x17bb3f=_0x1889cc;return _0x1889cc['addLists'](_0xb4ac4e[_0x630d('0x53')][_0x630d('0x65')],_[_0x630d('0x66')](_0xb4ac4e['body'],[_0x630d('0x65'),'id'])||{});}return null;})[_0x630d('0x67')](function(_0x1da3d8){var _0x1e1802;var _0x4b0cdd;_0x35ec4e=_0x1da3d8||[];var _0xf69299=[];if(_0x1da3d8){for(var _0x59a2b8=0x0;_0x59a2b8<_0x1da3d8[_0x630d('0x36')];_0x59a2b8+=0x1){var _0x46571b=_0x1da3d8[_0x59a2b8]['get']({'plain':!![]});_0x17bb3f['dialCheckDuplicateType']=_0xb4ac4e[_0x630d('0x53')][_0x630d('0x68')]?_0xb4ac4e[_0x630d('0x53')][_0x630d('0x68')]:_0x17bb3f[_0x630d('0x68')];switch(_0x17bb3f[_0x630d('0x68')]){case _0x630d('0x69'):_0x1e1802=squel[_0x630d('0x6a')]()[_0x630d('0x6b')](_0x630d('0x6c'))['fromQuery']([_0x630d('0x6d'),_0x630d('0x6e'),_0x630d('0x6f'),_0x630d('0x70'),'CampaignId',_0x630d('0x51'),_0x630d('0x52')],squel[_0x630d('0x71')]()['field'](_0x630d('0x6d'),_0x630d('0x6d'))[_0x630d('0x72')]('NOW()',_0x630d('0x6e'))['field']('id',_0x630d('0x6f'))[_0x630d('0x72')](_0x46571b[_0x630d('0x73')][_0x630d('0x74')](),_0x630d('0x70'))[_0x630d('0x72')](_0xb4ac4e[_0x630d('0x43')]['id']['toString'](),_0x630d('0x56'))['field']('\x27'+_0x436071+'\x27','createdAt')['field']('\x27'+_0x436071+'\x27',_0x630d('0x52'))[_0x630d('0x75')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')['where'](_0x630d('0x76'),_0x46571b[_0x630d('0x73')][_0x630d('0x74')]())[_0x630d('0x3b')]('phone\x20IS\x20NOT\x20NULL')[_0x630d('0x3b')](_0x630d('0x77'),squel[_0x630d('0x71')]()[_0x630d('0x72')](_0x630d('0x78'))[_0x630d('0x75')](_0x630d('0x79'))[_0x630d('0x3b')](_0x630d('0x7a'),_0xb4ac4e[_0x630d('0x43')]['id']['toString']()))[_0x630d('0x3b')](_0x630d('0x77'),squel[_0x630d('0x71')]()['field'](_0x630d('0x7b'))[_0x630d('0x75')](_0x630d('0x6c'))[_0x630d('0x3b')]('CampaignId\x20=\x20?',_0xb4ac4e[_0x630d('0x43')]['id'][_0x630d('0x74')]())))[_0x630d('0x74')]();break;case'onlyIfOpen':_0x1e1802=squel[_0x630d('0x6a')]()['into'](_0x630d('0x6c'))[_0x630d('0x7c')]([_0x630d('0x6d'),_0x630d('0x6e'),_0x630d('0x6f'),_0x630d('0x70'),_0x630d('0x56'),_0x630d('0x51'),_0x630d('0x52')],squel[_0x630d('0x71')]()['field'](_0x630d('0x6d'),_0x630d('0x6d'))[_0x630d('0x72')](_0x630d('0x7d'),_0x630d('0x6e'))[_0x630d('0x72')]('id',_0x630d('0x6f'))[_0x630d('0x72')](_0x46571b[_0x630d('0x73')]['toString'](),_0x630d('0x70'))['field'](_0xb4ac4e[_0x630d('0x43')]['id']['toString'](),_0x630d('0x56'))[_0x630d('0x72')]('\x27'+_0x436071+'\x27',_0x630d('0x51'))['field']('\x27'+_0x436071+'\x27',_0x630d('0x52'))[_0x630d('0x75')](_0x630d('0x7e'))['where'](_0x630d('0x7f'))[_0x630d('0x3b')](_0x630d('0x76'),_0x46571b['CmListId'][_0x630d('0x74')]())[_0x630d('0x3b')](_0x630d('0x80'))[_0x630d('0x3b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x630d('0x71')]()[_0x630d('0x72')](_0x630d('0x7b'))[_0x630d('0x75')]('cm_hopper')[_0x630d('0x3b')](_0x630d('0x7a'),_0xb4ac4e[_0x630d('0x43')]['id']['toString']())))[_0x630d('0x74')]();break;default:_0x1e1802=squel[_0x630d('0x6a')]()['into'](_0x630d('0x6c'))[_0x630d('0x7c')]([_0x630d('0x6d'),_0x630d('0x6e'),'ContactId','ListId',_0x630d('0x56'),_0x630d('0x51'),'updatedAt'],squel[_0x630d('0x71')]()[_0x630d('0x72')](_0x630d('0x6d'),_0x630d('0x6d'))[_0x630d('0x72')](_0x630d('0x7d'),_0x630d('0x6e'))['field']('id',_0x630d('0x6f'))[_0x630d('0x72')](_0x46571b[_0x630d('0x73')]['toString'](),_0x630d('0x70'))[_0x630d('0x72')](_0xb4ac4e[_0x630d('0x43')]['id'][_0x630d('0x74')](),'CampaignId')['field']('\x27'+_0x436071+'\x27',_0x630d('0x51'))['field']('\x27'+_0x436071+'\x27','updatedAt')['from']('cm_contacts')[_0x630d('0x3b')]('deletedAt\x20IS\x20NULL')[_0x630d('0x3b')]('ListId\x20=\x20?',_0x46571b[_0x630d('0x73')][_0x630d('0x74')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x630d('0x74')]();}_0x4b0cdd=squel[_0x630d('0x6a')]()[_0x630d('0x6b')](_0x630d('0x81'))[_0x630d('0x7c')](['cmHopperId',_0x630d('0x6e'),'phone',_0x630d('0x82'),_0x630d('0x51'),_0x630d('0x52')],squel[_0x630d('0x71')]()[_0x630d('0x72')]('h.id','id')[_0x630d('0x72')](_0x630d('0x7d'),_0x630d('0x6e'))['field'](_0x630d('0x83'),'phone')[_0x630d('0x72')](_0x630d('0x84'),_0x630d('0x82'))[_0x630d('0x72')]('\x27'+_0x436071+'\x27',_0x630d('0x51'))[_0x630d('0x72')]('\x27'+_0x436071+'\x27',_0x630d('0x52'))['from'](_0x630d('0x85'),'ci')['join'](_0x630d('0x6c'),'h',_0x630d('0x86'))[_0x630d('0x3b')](_0x630d('0x87'),_0x46571b[_0x630d('0x73')][_0x630d('0x74')]())[_0x630d('0x3b')](_0x630d('0x88'),_0xb4ac4e['params']['id']['toString']())['where'](_0x630d('0x89'),_0x436071))[_0x630d('0x74')]();_0xf69299[_0x630d('0x8a')](db['sequelize'][_0x630d('0x31')](_0x1e1802));_0x15128d[_0x630d('0x8a')](db[_0x630d('0x8b')]['query'](_0x4b0cdd));}return BPromise[_0x630d('0x8c')](_0xf69299);}})[_0x630d('0x22')](function(){return BPromise['all'](_0x15128d);})[_0x630d('0x22')](function(){return _0x35ec4e;})[_0x630d('0x22')](respondWithResult(_0x2728b0,null))['catch'](handleError(_0x2728b0,null));};exports[_0x630d('0x8d')]=function(_0x5664a6,_0x40bff7,_0x1d4afb){return db[_0x630d('0x2b')][_0x630d('0x47')]({'where':{'id':_0x5664a6[_0x630d('0x43')]['id']}})[_0x630d('0x22')](handleEntityNotFound(_0x40bff7,null))[_0x630d('0x22')](function(_0x5fb03a){if(_0x5fb03a){return _0x5fb03a[_0x630d('0x8d')](_0x5664a6[_0x630d('0x31')][_0x630d('0x65')]);}})[_0x630d('0x22')](function(_0x200714){if(_0x200714){return db[_0x630d('0x57')][_0x630d('0x23')]({'where':{'ListId':_0x5664a6[_0x630d('0x31')][_0x630d('0x65')],'CampaignId':_0x5664a6[_0x630d('0x43')]['id']}})['then'](function(){return _0x200714;});}})[_0x630d('0x22')](respondWithStatusCode(_0x40bff7,null))[_0x630d('0x42')](handleError(_0x40bff7,null));};exports[_0x630d('0x8e')]=function(_0x3395fe,_0x2aca64,_0xa24d6e){var _0x421241={};var _0x1efaa8={};var _0x333740;var _0x28dfa5;return db[_0x630d('0x2b')][_0x630d('0x55')]({'where':{'id':_0x3395fe['params']['id']}})[_0x630d('0x22')](handleEntityNotFound(_0x2aca64,null))[_0x630d('0x22')](function(_0xcaadda){if(_0xcaadda){_0x333740=_0xcaadda;_0x1efaa8[_0x630d('0x35')]=_[_0x630d('0x32')](db[_0x630d('0x62')]['rawAttributes']);_0x1efaa8[_0x630d('0x31')]=_[_0x630d('0x32')](_0x3395fe['query']);_0x1efaa8[_0x630d('0x3c')]=_[_0x630d('0x33')](_0x1efaa8[_0x630d('0x35')],_0x1efaa8[_0x630d('0x31')]);_0x421241[_0x630d('0x34')]=_[_0x630d('0x33')](_0x1efaa8[_0x630d('0x35')],qs[_0x630d('0x44')](_0x3395fe['query'][_0x630d('0x44')]));_0x421241[_0x630d('0x34')]=_0x421241['attributes'][_0x630d('0x36')]?_0x421241[_0x630d('0x34')]:_0x1efaa8[_0x630d('0x35')];_0x421241[_0x630d('0x39')]=qs[_0x630d('0x3a')](_0x3395fe[_0x630d('0x31')]['sort']);_0x421241[_0x630d('0x3b')]=qs[_0x630d('0x3c')](_[_0x630d('0x3d')](_0x3395fe['query'],_0x1efaa8[_0x630d('0x3c')]));if(_0x3395fe['query'][_0x630d('0x3e')]){_0x421241[_0x630d('0x3b')]=_['merge'](_0x421241[_0x630d('0x3b')],{'$or':_[_0x630d('0x30')](_0x421241[_0x630d('0x34')],function(_0x456817){var _0x488f2d={};_0x488f2d[_0x456817]={'$like':'%'+_0x3395fe['query'][_0x630d('0x3e')]+'%'};return _0x488f2d;})});}_0x421241=_[_0x630d('0x40')]({},_0x421241,_0x3395fe[_0x630d('0x46')]);return _0x333740[_0x630d('0x8e')](_0x421241);}})[_0x630d('0x22')](function(_0x620517){if(_0x620517){_0x28dfa5=_0x620517['length'];if(!_0x3395fe[_0x630d('0x31')][_0x630d('0x37')](_0x630d('0x5c'))){_0x421241[_0x630d('0x38')]=qs[_0x630d('0x38')](_0x3395fe[_0x630d('0x31')]['limit']);_0x421241[_0x630d('0x1c')]=qs[_0x630d('0x1c')](_0x3395fe[_0x630d('0x31')]['offset']);}return _0x333740[_0x630d('0x8e')](_0x421241);}})[_0x630d('0x22')](function(_0x4c385a){if(_0x4c385a){return _0x4c385a?{'count':_0x28dfa5,'rows':_0x4c385a}:null;}})[_0x630d('0x22')](respondWithResult(_0x2aca64,null))[_0x630d('0x42')](handleError(_0x2aca64,null));};exports['addBlackLists']=function(_0xa31ad3,_0x109f7f,_0x59b217){var _0x3eedd5,_0x212575;var _0x5b89a1=[];var _0x3bfffe=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0x630d('0x2b')][_0x630d('0x47')]({'where':{'id':_0xa31ad3[_0x630d('0x43')]['id']}})[_0x630d('0x22')](handleEntityNotFound(_0x109f7f,null))[_0x630d('0x22')](function(_0x31e20a){if(_0x31e20a){_0x212575=_0x31e20a;return _0x31e20a[_0x630d('0x8f')](_0xa31ad3['body'][_0x630d('0x65')],_[_0x630d('0x66')](_0xa31ad3['body'],[_0x630d('0x65'),'id'])||{});}return null;})[_0x630d('0x67')](function(_0x1931a7){var _0xf25ef0;var _0x361d22;_0x3eedd5=_0x1931a7||[];var _0x1bb79c=[];if(_0x1931a7){for(var _0x189c8a=0x0;_0x189c8a<_0x1931a7['length'];_0x189c8a+=0x1){var _0x13b4e7=_0x1931a7[_0x189c8a][_0x630d('0x24')]({'plain':!![]});_0xf25ef0=squel[_0x630d('0x6a')]()[_0x630d('0x6b')](_0x630d('0x90'))[_0x630d('0x7c')]([_0x630d('0x6d'),_0x630d('0x6f'),'ListId',_0x630d('0x56'),_0x630d('0x51'),_0x630d('0x52')],squel[_0x630d('0x71')]()[_0x630d('0x72')]('phone','phone')[_0x630d('0x72')]('id','ContactId')['field'](_0x13b4e7['CmListId'][_0x630d('0x74')](),_0x630d('0x70'))[_0x630d('0x72')](_0xa31ad3['params']['id'][_0x630d('0x74')](),_0x630d('0x56'))[_0x630d('0x72')](_0x630d('0x7d'),'createdAt')[_0x630d('0x72')](_0x630d('0x7d'),'updatedAt')[_0x630d('0x75')](_0x630d('0x7e'))[_0x630d('0x3b')](_0x630d('0x7f'))[_0x630d('0x3b')](_0x630d('0x76'),_0x13b4e7[_0x630d('0x73')][_0x630d('0x74')]())[_0x630d('0x3b')]('phone\x20IS\x20NOT\x20NULL'))[_0x630d('0x74')]();_0x1bb79c[_0x630d('0x8a')](db[_0x630d('0x8b')][_0x630d('0x31')](_0xf25ef0));}return BPromise[_0x630d('0x8c')](_0x1bb79c);}})['then'](function(){return _0x3eedd5;})[_0x630d('0x22')](respondWithResult(_0x109f7f,null))[_0x630d('0x42')](handleError(_0x109f7f,null));};exports[_0x630d('0x91')]=function(_0x13dd25,_0x556169,_0xc138e7){return db[_0x630d('0x2b')][_0x630d('0x47')]({'where':{'id':_0x13dd25['params']['id']}})[_0x630d('0x22')](handleEntityNotFound(_0x556169,null))['then'](function(_0x26a1ed){if(_0x26a1ed){return _0x26a1ed[_0x630d('0x91')](_0x13dd25[_0x630d('0x31')][_0x630d('0x65')]);}})['then'](function(_0x37afdb){if(_0x37afdb){return db[_0x630d('0x60')][_0x630d('0x23')]({'where':{'ListId':_0x13dd25[_0x630d('0x31')]['ids'],'CampaignId':_0x13dd25[_0x630d('0x43')]['id']}})[_0x630d('0x22')](function(){return _0x37afdb;});}})[_0x630d('0x22')](respondWithStatusCode(_0x556169,null))[_0x630d('0x42')](handleError(_0x556169,null));}; \ No newline at end of file +var _0xa571=['status','json','undefined','limit','count','offset','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','end','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','options','include','findAll','rows','catch','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','UserProfileSection','autoAssociation','params','getHoppers','CmHopper','pick','CampaignId','filter','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','format','addLists','ids','dialCheckDuplicateType','always','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','select','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','NOW()','insert','into','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0xa571,0x107));var _0x1a57=function(_0x26cc10,_0x24dd3b){_0x26cc10=_0x26cc10-0x0;var _0xb7cbec=_0xa571[_0x26cc10];return _0xb7cbec;};'use strict';var emlformat=require(_0x1a57('0x0'));var rimraf=require(_0x1a57('0x1'));var zipdir=require(_0x1a57('0x2'));var jsonpatch=require(_0x1a57('0x3'));var rp=require('request-promise');var moment=require(_0x1a57('0x4'));var BPromise=require(_0x1a57('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1a57('0x6'));var sox=require('sox');var csv=require(_0x1a57('0x7'));var ejs=require(_0x1a57('0x8'));var fs=require('fs');var fs_extra=require(_0x1a57('0x9'));var _=require(_0x1a57('0xa'));var squel=require(_0x1a57('0xb'));var crypto=require(_0x1a57('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1a57('0xd'));var toCsv=require(_0x1a57('0x7'));var querystring=require(_0x1a57('0xe'));var Papa=require('papaparse');var Redis=require(_0x1a57('0xf'));var authService=require(_0x1a57('0x10'));var qs=require(_0x1a57('0x11'));var as=require(_0x1a57('0x12'));var hardwareService=require(_0x1a57('0x13'));var logger=require(_0x1a57('0x14'))(_0x1a57('0x15'));var utils=require(_0x1a57('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1a57('0x17'))['db'];function respondWithStatusCode(_0x1911b2,_0x202d9a){_0x202d9a=_0x202d9a||0xcc;return function(_0x5ae643){if(_0x5ae643){return _0x1911b2[_0x1a57('0x18')](_0x202d9a);}return _0x1911b2[_0x1a57('0x19')](_0x202d9a)['end']();};}function respondWithResult(_0x503278,_0x587422){_0x587422=_0x587422||0xc8;return function(_0xd08107){if(_0xd08107){return _0x503278[_0x1a57('0x19')](_0x587422)[_0x1a57('0x1a')](_0xd08107);}};}function respondWithFilteredResult(_0x153d01,_0x5802d6){return function(_0x20f7ad){if(_0x20f7ad){var _0x53c61f=typeof _0x5802d6['offset']===_0x1a57('0x1b')&&typeof _0x5802d6[_0x1a57('0x1c')]===_0x1a57('0x1b');var _0x51b4c2=_0x20f7ad[_0x1a57('0x1d')];var _0x1662a3=_0x53c61f?0x0:_0x5802d6[_0x1a57('0x1e')];var _0x53bb20=_0x53c61f?_0x20f7ad[_0x1a57('0x1d')]:_0x5802d6[_0x1a57('0x1e')]+_0x5802d6[_0x1a57('0x1c')];var _0xcba6b7;if(_0x53bb20>=_0x51b4c2){_0x53bb20=_0x51b4c2;_0xcba6b7=0xc8;}else{_0xcba6b7=0xce;}_0x153d01[_0x1a57('0x19')](_0xcba6b7);return _0x153d01['set']('Content-Range',_0x1662a3+'-'+_0x53bb20+'/'+_0x51b4c2)[_0x1a57('0x1a')](_0x20f7ad);}return null;};}function patchUpdates(_0x21e811){return function(_0x211c63){try{jsonpatch['apply'](_0x211c63,_0x21e811,!![]);}catch(_0x5c200e){return BPromise['reject'](_0x5c200e);}return _0x211c63[_0x1a57('0x1f')]();};}function saveUpdates(_0x113ad4,_0x3f52b9){return function(_0xee133b){if(_0xee133b){return _0xee133b[_0x1a57('0x20')](_0x113ad4)[_0x1a57('0x21')](function(_0x2efa49){return _0x2efa49;});}return null;};}function removeEntity(_0x2f8b00,_0x183ca3){return function(_0x35d5dc){if(_0x35d5dc){return _0x35d5dc[_0x1a57('0x22')]()[_0x1a57('0x21')](function(){var _0x26cdd3=_0x35d5dc[_0x1a57('0x23')]({'plain':!![]});var _0x2f9454=_0x1a57('0x24');return db[_0x1a57('0x25')][_0x1a57('0x22')]({'where':{'type':_0x2f9454,'resourceId':_0x26cdd3['id']}})[_0x1a57('0x21')](function(){return _0x35d5dc;});})[_0x1a57('0x21')](function(){_0x2f8b00[_0x1a57('0x19')](0xcc)[_0x1a57('0x26')]();});}};}function handleEntityNotFound(_0x5a53c8,_0x530401){return function(_0x139d8c){if(!_0x139d8c){_0x5a53c8[_0x1a57('0x18')](0x194);}return _0x139d8c;};}function handleError(_0x545041,_0x46dac6){_0x46dac6=_0x46dac6||0x1f4;return function(_0x54f6a5){logger[_0x1a57('0x27')](_0x54f6a5[_0x1a57('0x28')]);if(_0x54f6a5['name']){delete _0x54f6a5[_0x1a57('0x29')];}_0x545041[_0x1a57('0x19')](_0x46dac6)[_0x1a57('0x2a')](_0x54f6a5);};}exports[_0x1a57('0x2b')]=function(_0x492b90,_0x366d5f){var _0x396832={},_0x4374f0={},_0x160536={'count':0x0,'rows':[]};var _0x5763ba=_[_0x1a57('0x2c')](db[_0x1a57('0x2d')][_0x1a57('0x2e')],function(_0x32f79f){return{'name':_0x32f79f[_0x1a57('0x2f')],'type':_0x32f79f[_0x1a57('0x30')][_0x1a57('0x31')]};});_0x4374f0[_0x1a57('0x32')]=_[_0x1a57('0x2c')](_0x5763ba,'name');_0x4374f0[_0x1a57('0x33')]=_[_0x1a57('0x34')](_0x492b90['query']);_0x4374f0['filters']=_[_0x1a57('0x35')](_0x4374f0[_0x1a57('0x32')],_0x4374f0[_0x1a57('0x33')]);_0x396832[_0x1a57('0x36')]=_[_0x1a57('0x35')](_0x4374f0[_0x1a57('0x32')],qs[_0x1a57('0x37')](_0x492b90[_0x1a57('0x33')][_0x1a57('0x37')]));_0x396832[_0x1a57('0x36')]=_0x396832[_0x1a57('0x36')][_0x1a57('0x38')]?_0x396832[_0x1a57('0x36')]:_0x4374f0[_0x1a57('0x32')];if(!_0x492b90[_0x1a57('0x33')][_0x1a57('0x39')](_0x1a57('0x3a'))){_0x396832[_0x1a57('0x1c')]=qs['limit'](_0x492b90[_0x1a57('0x33')][_0x1a57('0x1c')]);_0x396832[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x492b90[_0x1a57('0x33')][_0x1a57('0x1e')]);}_0x396832[_0x1a57('0x3b')]=qs[_0x1a57('0x3c')](_0x492b90[_0x1a57('0x33')]['sort']);_0x396832['where']=qs['filters'](_['pick'](_0x492b90[_0x1a57('0x33')],_0x4374f0[_0x1a57('0x3d')]),_0x5763ba);if(_0x492b90[_0x1a57('0x33')]['filter']){_0x396832[_0x1a57('0x3e')]=_[_0x1a57('0x3f')](_0x396832[_0x1a57('0x3e')],{'$or':_[_0x1a57('0x2c')](_0x5763ba,function(_0x5bf186){if(_0x5bf186[_0x1a57('0x30')]!=='VIRTUAL'){var _0xd39e5a={};_0xd39e5a[_0x5bf186[_0x1a57('0x29')]]={'$like':'%'+_0x492b90[_0x1a57('0x33')]['filter']+'%'};return _0xd39e5a;}})});}_0x396832=_[_0x1a57('0x3f')]({},_0x396832,_0x492b90[_0x1a57('0x40')]);var _0x61e9f6={'where':_0x396832[_0x1a57('0x3e')]};return db[_0x1a57('0x2d')]['count'](_0x61e9f6)[_0x1a57('0x21')](function(_0x47e998){_0x160536['count']=_0x47e998;if(_0x492b90[_0x1a57('0x33')]['includeAll']){_0x396832[_0x1a57('0x41')]=[{'all':!![]}];}return db[_0x1a57('0x2d')][_0x1a57('0x42')](_0x396832);})['then'](function(_0x188a50){_0x160536[_0x1a57('0x43')]=_0x188a50;return _0x160536;})[_0x1a57('0x21')](respondWithFilteredResult(_0x366d5f,_0x396832))[_0x1a57('0x44')](handleError(_0x366d5f,null));};exports['show']=function(_0xc7bab4,_0x150fb6){var _0x4fdd29={'raw':![],'where':{'id':_0xc7bab4['params']['id']}},_0x32d05b={};_0x32d05b['model']=_[_0x1a57('0x34')](db[_0x1a57('0x2d')][_0x1a57('0x2e')]);_0x32d05b[_0x1a57('0x33')]=_['keys'](_0xc7bab4[_0x1a57('0x33')]);_0x32d05b[_0x1a57('0x3d')]=_[_0x1a57('0x35')](_0x32d05b[_0x1a57('0x32')],_0x32d05b[_0x1a57('0x33')]);_0x4fdd29['attributes']=_[_0x1a57('0x35')](_0x32d05b[_0x1a57('0x32')],qs[_0x1a57('0x37')](_0xc7bab4[_0x1a57('0x33')]['fields']));_0x4fdd29[_0x1a57('0x36')]=_0x4fdd29['attributes'][_0x1a57('0x38')]?_0x4fdd29[_0x1a57('0x36')]:_0x32d05b[_0x1a57('0x32')];if(_0xc7bab4[_0x1a57('0x33')][_0x1a57('0x45')]){_0x4fdd29[_0x1a57('0x41')]=[{'all':!![]}];}_0x4fdd29=_[_0x1a57('0x3f')]({},_0x4fdd29,_0xc7bab4[_0x1a57('0x40')]);return db[_0x1a57('0x2d')][_0x1a57('0x46')](_0x4fdd29)[_0x1a57('0x21')](handleEntityNotFound(_0x150fb6,null))[_0x1a57('0x21')](respondWithResult(_0x150fb6,null))[_0x1a57('0x44')](handleError(_0x150fb6,null));};exports['create']=function(_0xf4d056,_0x480aff){return db[_0x1a57('0x2d')][_0x1a57('0x47')](_0xf4d056[_0x1a57('0x48')],{})[_0x1a57('0x21')](function(_0x323af1){var _0x3cbb9e=_0xf4d056[_0x1a57('0x49')][_0x1a57('0x23')]({'plain':!![]});if(!_0x3cbb9e)throw new Error(_0x1a57('0x4a'));if(_0x3cbb9e['role']===_0x1a57('0x49')){var _0x439a42=_0x323af1['get']({'plain':!![]});var _0x15f1f5=_0x1a57('0x24');return db['UserProfileSection'][_0x1a57('0x46')]({'where':{'name':_0x15f1f5,'userProfileId':_0x3cbb9e[_0x1a57('0x4b')]},'raw':!![]})['then'](function(_0x4d3177){if(_0x4d3177&&_0x4d3177['autoAssociation']===0x0){return db[_0x1a57('0x25')][_0x1a57('0x47')]({'name':_0x439a42['name'],'resourceId':_0x439a42['id'],'type':_0x4d3177[_0x1a57('0x29')],'sectionId':_0x4d3177['id']},{})[_0x1a57('0x21')](function(){return _0x323af1;});}else{return _0x323af1;}})['catch'](function(_0x5e510e){logger['error'](_0x1a57('0x4c'),_0x5e510e);throw _0x5e510e;});}return _0x323af1;})[_0x1a57('0x21')](respondWithResult(_0x480aff,0xc9))[_0x1a57('0x44')](handleError(_0x480aff,null));};exports[_0x1a57('0x4d')]=function(_0x28738e,_0x33379c){var _0xd64b3a={'where':{'id':_0x28738e['params']['id']}},_0x1f705b={};_0x1f705b['model']=_['keys'](db['Campaign']['rawAttributes']);_0xd64b3a[_0x1a57('0x36')]=_[_0x1a57('0x35')](_0x1f705b[_0x1a57('0x32')],qs[_0x1a57('0x37')](_0x28738e[_0x1a57('0x33')][_0x1a57('0x37')]));_0xd64b3a[_0x1a57('0x36')]=_0xd64b3a[_0x1a57('0x36')]['length']?_0xd64b3a['attributes']:_0x1f705b['model'];if(_0x28738e[_0x1a57('0x33')]['includeAll']){_0xd64b3a[_0x1a57('0x41')]=[{'all':!![]}];}_0xd64b3a=_[_0x1a57('0x3f')]({},_0xd64b3a,_0x28738e[_0x1a57('0x40')]);return db[_0x1a57('0x2d')][_0x1a57('0x46')](_0xd64b3a)[_0x1a57('0x21')](handleEntityNotFound(_0x33379c,null))[_0x1a57('0x21')](function(_0x561add){if(_0x561add){var _0x4e56b5=_0x561add['get']({'plain':!![]});_0x4e56b5=qs[_0x1a57('0x4e')](_0x4e56b5,['id',_0x1a57('0x4f'),_0x1a57('0x50')]);_0x28738e[_0x1a57('0x48')]=_[_0x1a57('0x4e')](_0x28738e[_0x1a57('0x48')],['id',_0x1a57('0x4f'),'updatedAt']);return db['Campaign'][_0x1a57('0x47')](_[_0x1a57('0x3f')](_0x4e56b5,_0x28738e[_0x1a57('0x48')]),{'include':_0x28738e[_0x1a57('0x33')][_0x1a57('0x45')]?[{'all':!![]}]:undefined})[_0x1a57('0x21')](function(_0x59a731){var _0x47db75=_0x28738e[_0x1a57('0x49')][_0x1a57('0x23')]({'plain':!![]});if(!_0x47db75)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47db75['role']===_0x1a57('0x49')){var _0x3a8806=_0x59a731[_0x1a57('0x23')]({'plain':!![]});var _0x10ceb8=_0x1a57('0x24');return db[_0x1a57('0x51')][_0x1a57('0x46')]({'where':{'name':_0x10ceb8,'userProfileId':_0x47db75['userProfileId']},'raw':!![]})['then'](function(_0x2fbf49){if(_0x2fbf49&&_0x2fbf49[_0x1a57('0x52')]===0x0){return db[_0x1a57('0x25')][_0x1a57('0x47')]({'name':_0x3a8806['name'],'resourceId':_0x3a8806['id'],'type':_0x2fbf49[_0x1a57('0x29')],'sectionId':_0x2fbf49['id']},{})[_0x1a57('0x21')](function(){return _0x59a731;});}else{return _0x59a731;}})[_0x1a57('0x44')](function(_0x33c8d4){logger[_0x1a57('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x33c8d4);throw _0x33c8d4;});}return _0x59a731;});}})['then'](respondWithResult(_0x33379c,0xc9))['catch'](handleError(_0x33379c,null));};exports[_0x1a57('0x20')]=function(_0x223ba5,_0x1e2df1){if(_0x223ba5[_0x1a57('0x48')]['id']){delete _0x223ba5[_0x1a57('0x48')]['id'];}return db[_0x1a57('0x2d')][_0x1a57('0x46')]({'where':{'id':_0x223ba5[_0x1a57('0x53')]['id']}})['then'](handleEntityNotFound(_0x1e2df1,null))[_0x1a57('0x21')](saveUpdates(_0x223ba5[_0x1a57('0x48')],null))['then'](respondWithResult(_0x1e2df1,null))['catch'](handleError(_0x1e2df1,null));};exports[_0x1a57('0x22')]=function(_0x5be7b4,_0x2ebd9c){return db[_0x1a57('0x2d')][_0x1a57('0x46')]({'where':{'id':_0x5be7b4[_0x1a57('0x53')]['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x2ebd9c,null))[_0x1a57('0x21')](removeEntity(_0x2ebd9c,null))[_0x1a57('0x44')](handleError(_0x2ebd9c,null));};exports[_0x1a57('0x54')]=function(_0x5ae6ae,_0x7783ec,_0xc33b56){var _0x5e5b2f={'raw':!![],'where':{}};var _0x24b56c={};var _0x392f49={'count':0x0,'rows':[]};return db[_0x1a57('0x2d')]['findOne']({'where':{'id':_0x5ae6ae['params']['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x7783ec,null))[_0x1a57('0x21')](function(_0x3c5840){if(_0x3c5840){_0x24b56c[_0x1a57('0x32')]=_['keys'](db[_0x1a57('0x55')][_0x1a57('0x2e')]);_0x24b56c[_0x1a57('0x33')]=_[_0x1a57('0x34')](_0x5ae6ae[_0x1a57('0x33')]);_0x24b56c['filters']=_[_0x1a57('0x35')](_0x24b56c[_0x1a57('0x32')],_0x24b56c[_0x1a57('0x33')]);_0x5e5b2f[_0x1a57('0x36')]=_[_0x1a57('0x35')](_0x24b56c[_0x1a57('0x32')],qs[_0x1a57('0x37')](_0x5ae6ae[_0x1a57('0x33')][_0x1a57('0x37')]));_0x5e5b2f[_0x1a57('0x36')]=_0x5e5b2f[_0x1a57('0x36')]['length']?_0x5e5b2f[_0x1a57('0x36')]:_0x24b56c[_0x1a57('0x32')];if(!_0x5ae6ae['query'][_0x1a57('0x39')](_0x1a57('0x3a'))){_0x5e5b2f['limit']=qs[_0x1a57('0x1c')](_0x5ae6ae[_0x1a57('0x33')][_0x1a57('0x1c')]);_0x5e5b2f[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x5ae6ae[_0x1a57('0x33')][_0x1a57('0x1e')]);}_0x5e5b2f[_0x1a57('0x3b')]=qs['sort'](_0x5ae6ae[_0x1a57('0x33')][_0x1a57('0x3c')]);_0x5e5b2f['where']=qs[_0x1a57('0x3d')](_[_0x1a57('0x56')](_0x5ae6ae[_0x1a57('0x33')],_0x24b56c[_0x1a57('0x3d')]));_0x5e5b2f[_0x1a57('0x3e')][_0x1a57('0x57')]=_0x3c5840['id'];if(_0x5ae6ae[_0x1a57('0x33')][_0x1a57('0x58')]){_0x5e5b2f[_0x1a57('0x3e')]=_['merge'](_0x5e5b2f[_0x1a57('0x3e')],{'$or':_[_0x1a57('0x2c')](_0x5e5b2f[_0x1a57('0x36')],function(_0x1e4d4e){var _0x12ae08={};_0x12ae08[_0x1e4d4e]={'$like':'%'+_0x5ae6ae['query'][_0x1a57('0x58')]+'%'};return _0x12ae08;})});}_0x5e5b2f=_[_0x1a57('0x3f')]({},_0x5e5b2f,_0x5ae6ae[_0x1a57('0x40')]);return db[_0x1a57('0x55')][_0x1a57('0x1d')]({'where':_0x5e5b2f[_0x1a57('0x3e')]})[_0x1a57('0x21')](function(_0x2831f7){_0x392f49['count']=_0x2831f7;if(_0x5ae6ae[_0x1a57('0x33')][_0x1a57('0x45')]){_0x5e5b2f[_0x1a57('0x41')]=[{'all':!![]}];}return db[_0x1a57('0x55')]['findAll'](_0x5e5b2f);})['then'](function(_0x49f809){_0x392f49['rows']=_0x49f809;return _0x392f49;});}})['then'](respondWithFilteredResult(_0x7783ec,_0x5e5b2f))[_0x1a57('0x44')](handleError(_0x7783ec,null));};exports[_0x1a57('0x59')]=function(_0x5e640b,_0x3219ce,_0x19f1d5){var _0x5f4509={'raw':!![],'where':{}};var _0x758985={};var _0x1fbcb1={'count':0x0,'rows':[]};return db[_0x1a57('0x2d')][_0x1a57('0x5a')]({'where':{'id':_0x5e640b['params']['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x3219ce,null))[_0x1a57('0x21')](function(_0x4c66e3){if(_0x4c66e3){_0x758985[_0x1a57('0x32')]=_[_0x1a57('0x34')](db[_0x1a57('0x5b')][_0x1a57('0x2e')]);_0x758985[_0x1a57('0x33')]=_[_0x1a57('0x34')](_0x5e640b[_0x1a57('0x33')]);_0x758985['filters']=_[_0x1a57('0x35')](_0x758985['model'],_0x758985[_0x1a57('0x33')]);_0x5f4509[_0x1a57('0x36')]=_[_0x1a57('0x35')](_0x758985[_0x1a57('0x32')],qs['fields'](_0x5e640b[_0x1a57('0x33')][_0x1a57('0x37')]));_0x5f4509[_0x1a57('0x36')]=_0x5f4509['attributes'][_0x1a57('0x38')]?_0x5f4509[_0x1a57('0x36')]:_0x758985[_0x1a57('0x32')];if(!_0x5e640b['query'][_0x1a57('0x39')](_0x1a57('0x3a'))){_0x5f4509[_0x1a57('0x1c')]=qs[_0x1a57('0x1c')](_0x5e640b[_0x1a57('0x33')][_0x1a57('0x1c')]);_0x5f4509[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x5e640b[_0x1a57('0x33')][_0x1a57('0x1e')]);}_0x5f4509[_0x1a57('0x3b')]=qs['sort'](_0x5e640b[_0x1a57('0x33')]['sort']);_0x5f4509[_0x1a57('0x3e')]=qs['filters'](_['pick'](_0x5e640b['query'],_0x758985['filters']));_0x5f4509[_0x1a57('0x3e')][_0x1a57('0x57')]=_0x4c66e3['id'];if(_0x5e640b[_0x1a57('0x33')]['filter']){_0x5f4509[_0x1a57('0x3e')]=_['merge'](_0x5f4509[_0x1a57('0x3e')],{'$or':_[_0x1a57('0x2c')](_0x5f4509[_0x1a57('0x36')],function(_0x597c28){var _0x1000e5={};_0x1000e5[_0x597c28]={'$like':'%'+_0x5e640b[_0x1a57('0x33')]['filter']+'%'};return _0x1000e5;})});}_0x5f4509=_['merge']({},_0x5f4509,_0x5e640b[_0x1a57('0x40')]);return db['CmHopperHistory'][_0x1a57('0x1d')]({'where':_0x5f4509[_0x1a57('0x3e')]})['then'](function(_0x45afe5){_0x1fbcb1[_0x1a57('0x1d')]=_0x45afe5;if(_0x5e640b['query'][_0x1a57('0x45')]){_0x5f4509[_0x1a57('0x41')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x5f4509);})[_0x1a57('0x21')](function(_0x4dd78e){_0x1fbcb1[_0x1a57('0x43')]=_0x4dd78e;return _0x1fbcb1;});}})[_0x1a57('0x21')](respondWithFilteredResult(_0x3219ce,_0x5f4509))[_0x1a57('0x44')](handleError(_0x3219ce,null));};exports[_0x1a57('0x5c')]=function(_0x1e4456,_0x46337f,_0x3770b9){var _0x4db879={'raw':!![],'where':{}};var _0xe7a762={};var _0x272589={'count':0x0,'rows':[]};return db[_0x1a57('0x2d')]['findOne']({'where':{'id':_0x1e4456['params']['id']}})['then'](handleEntityNotFound(_0x46337f,null))[_0x1a57('0x21')](function(_0x297300){if(_0x297300){_0xe7a762['model']=_['keys'](db[_0x1a57('0x5d')][_0x1a57('0x2e')]);_0xe7a762[_0x1a57('0x33')]=_['keys'](_0x1e4456[_0x1a57('0x33')]);_0xe7a762[_0x1a57('0x3d')]=_[_0x1a57('0x35')](_0xe7a762[_0x1a57('0x32')],_0xe7a762['query']);_0x4db879[_0x1a57('0x36')]=_[_0x1a57('0x35')](_0xe7a762[_0x1a57('0x32')],qs[_0x1a57('0x37')](_0x1e4456[_0x1a57('0x33')][_0x1a57('0x37')]));_0x4db879[_0x1a57('0x36')]=_0x4db879[_0x1a57('0x36')][_0x1a57('0x38')]?_0x4db879['attributes']:_0xe7a762[_0x1a57('0x32')];if(!_0x1e4456[_0x1a57('0x33')][_0x1a57('0x39')](_0x1a57('0x3a'))){_0x4db879[_0x1a57('0x1c')]=qs[_0x1a57('0x1c')](_0x1e4456[_0x1a57('0x33')][_0x1a57('0x1c')]);_0x4db879[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x1e4456[_0x1a57('0x33')][_0x1a57('0x1e')]);}_0x4db879[_0x1a57('0x3b')]=qs['sort'](_0x1e4456[_0x1a57('0x33')][_0x1a57('0x3c')]);_0x4db879[_0x1a57('0x3e')]=qs[_0x1a57('0x3d')](_[_0x1a57('0x56')](_0x1e4456[_0x1a57('0x33')],_0xe7a762['filters']));_0x4db879[_0x1a57('0x3e')][_0x1a57('0x57')]=_0x297300['id'];if(_0x1e4456[_0x1a57('0x33')][_0x1a57('0x58')]){_0x4db879[_0x1a57('0x3e')]=_['merge'](_0x4db879[_0x1a57('0x3e')],{'$or':_[_0x1a57('0x2c')](_0x4db879['attributes'],function(_0x29bdca){var _0x350dbd={};_0x350dbd[_0x29bdca]={'$like':'%'+_0x1e4456[_0x1a57('0x33')][_0x1a57('0x58')]+'%'};return _0x350dbd;})});}_0x4db879=_['merge']({},_0x4db879,_0x1e4456['options']);return db[_0x1a57('0x5d')][_0x1a57('0x1d')]({'where':_0x4db879['where']})[_0x1a57('0x21')](function(_0x67d85){_0x272589[_0x1a57('0x1d')]=_0x67d85;if(_0x1e4456[_0x1a57('0x33')][_0x1a57('0x45')]){_0x4db879[_0x1a57('0x41')]=[{'all':!![]}];}return db[_0x1a57('0x5d')][_0x1a57('0x42')](_0x4db879);})[_0x1a57('0x21')](function(_0x26d7b8){_0x272589[_0x1a57('0x43')]=_0x26d7b8;return _0x272589;});}})[_0x1a57('0x21')](respondWithFilteredResult(_0x46337f,_0x4db879))['catch'](handleError(_0x46337f,null));};exports[_0x1a57('0x5e')]=function(_0x31805d,_0x30295e,_0x739c6b){var _0x2c40de={'raw':!![],'where':{}};var _0x771d07={};var _0x3d4cab={'count':0x0,'rows':[]};return db[_0x1a57('0x2d')][_0x1a57('0x5a')]({'where':{'id':_0x31805d['params']['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x30295e,null))[_0x1a57('0x21')](function(_0x1ff4fa){if(_0x1ff4fa){_0x771d07[_0x1a57('0x32')]=_[_0x1a57('0x34')](db[_0x1a57('0x5f')][_0x1a57('0x2e')]);_0x771d07['query']=_[_0x1a57('0x34')](_0x31805d[_0x1a57('0x33')]);_0x771d07[_0x1a57('0x3d')]=_[_0x1a57('0x35')](_0x771d07[_0x1a57('0x32')],_0x771d07[_0x1a57('0x33')]);_0x2c40de[_0x1a57('0x36')]=_[_0x1a57('0x35')](_0x771d07[_0x1a57('0x32')],qs[_0x1a57('0x37')](_0x31805d[_0x1a57('0x33')]['fields']));_0x2c40de['attributes']=_0x2c40de[_0x1a57('0x36')]['length']?_0x2c40de[_0x1a57('0x36')]:_0x771d07[_0x1a57('0x32')];if(!_0x31805d[_0x1a57('0x33')][_0x1a57('0x39')](_0x1a57('0x3a'))){_0x2c40de[_0x1a57('0x1c')]=qs[_0x1a57('0x1c')](_0x31805d[_0x1a57('0x33')][_0x1a57('0x1c')]);_0x2c40de[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x31805d[_0x1a57('0x33')][_0x1a57('0x1e')]);}_0x2c40de['order']=qs['sort'](_0x31805d[_0x1a57('0x33')]['sort']);_0x2c40de[_0x1a57('0x3e')]=qs[_0x1a57('0x3d')](_['pick'](_0x31805d[_0x1a57('0x33')],_0x771d07[_0x1a57('0x3d')]));_0x2c40de[_0x1a57('0x3e')][_0x1a57('0x57')]=_0x1ff4fa['id'];if(_0x31805d[_0x1a57('0x33')][_0x1a57('0x58')]){_0x2c40de[_0x1a57('0x3e')]=_['merge'](_0x2c40de[_0x1a57('0x3e')],{'$or':_[_0x1a57('0x2c')](_0x2c40de['attributes'],function(_0x2d37cd){var _0x10217b={};_0x10217b[_0x2d37cd]={'$like':'%'+_0x31805d[_0x1a57('0x33')]['filter']+'%'};return _0x10217b;})});}_0x2c40de=_[_0x1a57('0x3f')]({},_0x2c40de,_0x31805d['options']);return db['CmHopperBlack'][_0x1a57('0x1d')]({'where':_0x2c40de['where']})['then'](function(_0x1779ab){_0x3d4cab[_0x1a57('0x1d')]=_0x1779ab;if(_0x31805d[_0x1a57('0x33')][_0x1a57('0x45')]){_0x2c40de['include']=[{'all':!![]}];}return db[_0x1a57('0x5f')][_0x1a57('0x42')](_0x2c40de);})['then'](function(_0x308e36){_0x3d4cab[_0x1a57('0x43')]=_0x308e36;return _0x3d4cab;});}})[_0x1a57('0x21')](respondWithFilteredResult(_0x30295e,_0x2c40de))[_0x1a57('0x44')](handleError(_0x30295e,null));};exports['getLists']=function(_0x5656e5,_0x2dbb1e,_0x2036f1){var _0x190395={};var _0x37b838={};var _0x561d62;var _0x533af1;return db[_0x1a57('0x2d')]['findOne']({'where':{'id':_0x5656e5['params']['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x2dbb1e,null))[_0x1a57('0x21')](function(_0x44b6f8){if(_0x44b6f8){_0x561d62=_0x44b6f8;_0x37b838[_0x1a57('0x32')]=_[_0x1a57('0x34')](db[_0x1a57('0x60')][_0x1a57('0x2e')]);_0x37b838[_0x1a57('0x33')]=_[_0x1a57('0x34')](_0x5656e5[_0x1a57('0x33')]);_0x37b838[_0x1a57('0x3d')]=_[_0x1a57('0x35')](_0x37b838[_0x1a57('0x32')],_0x37b838['query']);_0x190395[_0x1a57('0x36')]=_[_0x1a57('0x35')](_0x37b838[_0x1a57('0x32')],qs[_0x1a57('0x37')](_0x5656e5[_0x1a57('0x33')][_0x1a57('0x37')]));_0x190395[_0x1a57('0x36')]=_0x190395[_0x1a57('0x36')][_0x1a57('0x38')]?_0x190395[_0x1a57('0x36')]:_0x37b838['model'];_0x190395[_0x1a57('0x3b')]=qs[_0x1a57('0x3c')](_0x5656e5[_0x1a57('0x33')][_0x1a57('0x3c')]);_0x190395[_0x1a57('0x3e')]=qs[_0x1a57('0x3d')](_[_0x1a57('0x56')](_0x5656e5[_0x1a57('0x33')],_0x37b838['filters']));if(_0x5656e5[_0x1a57('0x33')][_0x1a57('0x58')]){_0x190395['where']=_[_0x1a57('0x3f')](_0x190395[_0x1a57('0x3e')],{'$or':_[_0x1a57('0x2c')](_0x190395['attributes'],function(_0xdaf58b){var _0x5247c5={};_0x5247c5[_0xdaf58b]={'$like':'%'+_0x5656e5[_0x1a57('0x33')][_0x1a57('0x58')]+'%'};return _0x5247c5;})});}_0x190395=_[_0x1a57('0x3f')]({},_0x190395,_0x5656e5[_0x1a57('0x40')]);return _0x561d62[_0x1a57('0x61')](_0x190395);}})['then'](function(_0x337ce5){if(_0x337ce5){_0x533af1=_0x337ce5[_0x1a57('0x38')];if(!_0x5656e5[_0x1a57('0x33')][_0x1a57('0x39')](_0x1a57('0x3a'))){_0x190395[_0x1a57('0x1c')]=qs[_0x1a57('0x1c')](_0x5656e5[_0x1a57('0x33')][_0x1a57('0x1c')]);_0x190395[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x5656e5[_0x1a57('0x33')]['offset']);}return _0x561d62['getLists'](_0x190395);}})[_0x1a57('0x21')](function(_0x4d0799){if(_0x4d0799){return _0x4d0799?{'count':_0x533af1,'rows':_0x4d0799}:null;}})[_0x1a57('0x21')](respondWithResult(_0x2dbb1e,null))[_0x1a57('0x44')](handleError(_0x2dbb1e,null));};exports['addLists']=function(_0x2f9860,_0x8bfcb,_0x4f8f97){var _0x30c86b,_0x584f30;var _0x38d08b=[];var _0x33622a=moment()[_0x1a57('0x62')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x1a57('0x2d')][_0x1a57('0x46')]({'where':{'id':_0x2f9860[_0x1a57('0x53')]['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x8bfcb,null))['then'](function(_0x85bec5){if(_0x85bec5){_0x584f30=_0x85bec5;return _0x85bec5[_0x1a57('0x63')](_0x2f9860['body'][_0x1a57('0x64')],_[_0x1a57('0x4e')](_0x2f9860[_0x1a57('0x48')],[_0x1a57('0x64'),'id'])||{});}return null;})['spread'](function(_0x186d91){var _0x6bab68;var _0x2fcd4a;_0x30c86b=_0x186d91||[];var _0x56e2a2=[];if(_0x186d91){for(var _0x8698fe=0x0;_0x8698fe<_0x186d91[_0x1a57('0x38')];_0x8698fe+=0x1){var _0x3e1944=_0x186d91[_0x8698fe]['get']({'plain':!![]});_0x584f30['dialCheckDuplicateType']=_0x2f9860[_0x1a57('0x48')][_0x1a57('0x65')]?_0x2f9860[_0x1a57('0x48')]['dialCheckDuplicateType']:_0x584f30[_0x1a57('0x65')];switch(_0x584f30['dialCheckDuplicateType']){case _0x1a57('0x66'):_0x6bab68=squel['insert']()['into'](_0x1a57('0x67'))[_0x1a57('0x68')]([_0x1a57('0x69'),_0x1a57('0x6a'),_0x1a57('0x6b'),_0x1a57('0x6c'),_0x1a57('0x57'),_0x1a57('0x4f'),'updatedAt'],squel['select']()['field'](_0x1a57('0x69'),'phone')[_0x1a57('0x6d')]('NOW()',_0x1a57('0x6a'))[_0x1a57('0x6d')]('id',_0x1a57('0x6b'))[_0x1a57('0x6d')](_0x3e1944[_0x1a57('0x6e')][_0x1a57('0x6f')](),'ListId')[_0x1a57('0x6d')](_0x2f9860[_0x1a57('0x53')]['id'][_0x1a57('0x6f')](),_0x1a57('0x57'))[_0x1a57('0x6d')]('\x27'+_0x33622a+'\x27','createdAt')[_0x1a57('0x6d')]('\x27'+_0x33622a+'\x27','updatedAt')[_0x1a57('0x70')](_0x1a57('0x71'))[_0x1a57('0x3e')](_0x1a57('0x72'))['where'](_0x1a57('0x73'),_0x3e1944['CmListId']['toString']())[_0x1a57('0x3e')](_0x1a57('0x74'))[_0x1a57('0x3e')](_0x1a57('0x75'),squel['select']()['field'](_0x1a57('0x76'))[_0x1a57('0x70')]('cm_hopper_final')[_0x1a57('0x3e')]('CampaignId\x20=\x20?',_0x2f9860[_0x1a57('0x53')]['id'][_0x1a57('0x6f')]()))[_0x1a57('0x3e')](_0x1a57('0x75'),squel[_0x1a57('0x77')]()[_0x1a57('0x6d')](_0x1a57('0x78'))[_0x1a57('0x70')](_0x1a57('0x67'))[_0x1a57('0x3e')](_0x1a57('0x79'),_0x2f9860[_0x1a57('0x53')]['id'][_0x1a57('0x6f')]())))[_0x1a57('0x6f')]();break;case _0x1a57('0x7a'):_0x6bab68=squel['insert']()['into']('cm_hopper')[_0x1a57('0x68')]([_0x1a57('0x69'),_0x1a57('0x6a'),'ContactId','ListId',_0x1a57('0x57'),_0x1a57('0x4f'),_0x1a57('0x50')],squel[_0x1a57('0x77')]()[_0x1a57('0x6d')]('phone',_0x1a57('0x69'))[_0x1a57('0x6d')](_0x1a57('0x7b'),_0x1a57('0x6a'))[_0x1a57('0x6d')]('id',_0x1a57('0x6b'))[_0x1a57('0x6d')](_0x3e1944[_0x1a57('0x6e')]['toString'](),'ListId')['field'](_0x2f9860[_0x1a57('0x53')]['id'][_0x1a57('0x6f')](),_0x1a57('0x57'))[_0x1a57('0x6d')]('\x27'+_0x33622a+'\x27',_0x1a57('0x4f'))[_0x1a57('0x6d')]('\x27'+_0x33622a+'\x27',_0x1a57('0x50'))[_0x1a57('0x70')](_0x1a57('0x71'))['where'](_0x1a57('0x72'))[_0x1a57('0x3e')](_0x1a57('0x73'),_0x3e1944[_0x1a57('0x6e')]['toString']())[_0x1a57('0x3e')](_0x1a57('0x74'))['where'](_0x1a57('0x75'),squel[_0x1a57('0x77')]()[_0x1a57('0x6d')]('COALESCE(phone,\x27\x27)')['from'](_0x1a57('0x67'))[_0x1a57('0x3e')](_0x1a57('0x79'),_0x2f9860[_0x1a57('0x53')]['id'][_0x1a57('0x6f')]())))[_0x1a57('0x6f')]();break;default:_0x6bab68=squel[_0x1a57('0x7c')]()['into'](_0x1a57('0x67'))[_0x1a57('0x68')]([_0x1a57('0x69'),_0x1a57('0x6a'),_0x1a57('0x6b'),'ListId','CampaignId',_0x1a57('0x4f'),_0x1a57('0x50')],squel[_0x1a57('0x77')]()[_0x1a57('0x6d')](_0x1a57('0x69'),'phone')[_0x1a57('0x6d')](_0x1a57('0x7b'),_0x1a57('0x6a'))[_0x1a57('0x6d')]('id',_0x1a57('0x6b'))[_0x1a57('0x6d')](_0x3e1944[_0x1a57('0x6e')][_0x1a57('0x6f')](),'ListId')['field'](_0x2f9860[_0x1a57('0x53')]['id'][_0x1a57('0x6f')](),_0x1a57('0x57'))[_0x1a57('0x6d')]('\x27'+_0x33622a+'\x27',_0x1a57('0x4f'))['field']('\x27'+_0x33622a+'\x27','updatedAt')[_0x1a57('0x70')](_0x1a57('0x71'))[_0x1a57('0x3e')](_0x1a57('0x72'))['where']('ListId\x20=\x20?',_0x3e1944[_0x1a57('0x6e')][_0x1a57('0x6f')]())[_0x1a57('0x3e')](_0x1a57('0x74')))[_0x1a57('0x6f')]();}_0x2fcd4a=squel[_0x1a57('0x7c')]()[_0x1a57('0x7d')]('cm_hopper_additional_phones')[_0x1a57('0x68')](['cmHopperId',_0x1a57('0x6a'),_0x1a57('0x69'),_0x1a57('0x7e'),_0x1a57('0x4f'),_0x1a57('0x50')],squel[_0x1a57('0x77')]()['field'](_0x1a57('0x7f'),'id')['field'](_0x1a57('0x7b'),'scheduledAt')[_0x1a57('0x6d')](_0x1a57('0x80'),'phone')[_0x1a57('0x6d')](_0x1a57('0x81'),_0x1a57('0x7e'))[_0x1a57('0x6d')]('\x27'+_0x33622a+'\x27','createdAt')[_0x1a57('0x6d')]('\x27'+_0x33622a+'\x27',_0x1a57('0x50'))[_0x1a57('0x70')](_0x1a57('0x82'),'ci')[_0x1a57('0x83')]('cm_hopper','h',_0x1a57('0x84'))[_0x1a57('0x3e')](_0x1a57('0x85'),_0x3e1944[_0x1a57('0x6e')][_0x1a57('0x6f')]())[_0x1a57('0x3e')](_0x1a57('0x86'),_0x2f9860[_0x1a57('0x53')]['id'][_0x1a57('0x6f')]())['where'](_0x1a57('0x87'),_0x33622a))['toString']();_0x56e2a2[_0x1a57('0x88')](db[_0x1a57('0x89')]['query'](_0x6bab68));_0x38d08b[_0x1a57('0x88')](db[_0x1a57('0x89')][_0x1a57('0x33')](_0x2fcd4a));}return BPromise[_0x1a57('0x8a')](_0x56e2a2);}})['then'](function(){return BPromise[_0x1a57('0x8a')](_0x38d08b);})[_0x1a57('0x21')](function(){return _0x30c86b;})['then'](respondWithResult(_0x8bfcb,null))[_0x1a57('0x44')](handleError(_0x8bfcb,null));};exports[_0x1a57('0x8b')]=function(_0x2d944e,_0x2d528a,_0x13fa27){return db[_0x1a57('0x2d')][_0x1a57('0x46')]({'where':{'id':_0x2d944e[_0x1a57('0x53')]['id']}})['then'](handleEntityNotFound(_0x2d528a,null))[_0x1a57('0x21')](function(_0x51b73d){if(_0x51b73d){return _0x51b73d[_0x1a57('0x8b')](_0x2d944e[_0x1a57('0x33')][_0x1a57('0x64')]);}})[_0x1a57('0x21')](function(_0x221622){if(_0x221622){return db[_0x1a57('0x55')][_0x1a57('0x22')]({'where':{'ListId':_0x2d944e[_0x1a57('0x33')]['ids'],'CampaignId':_0x2d944e[_0x1a57('0x53')]['id']}})[_0x1a57('0x21')](function(){return _0x221622;});}})[_0x1a57('0x21')](respondWithStatusCode(_0x2d528a,null))[_0x1a57('0x44')](handleError(_0x2d528a,null));};exports[_0x1a57('0x8c')]=function(_0x4896da,_0x5df8e0,_0x291d5d){var _0x3d7632={};var _0x1440df={};var _0x116a92;var _0x4b9f41;return db[_0x1a57('0x2d')][_0x1a57('0x5a')]({'where':{'id':_0x4896da['params']['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x5df8e0,null))['then'](function(_0x4d7d88){if(_0x4d7d88){_0x116a92=_0x4d7d88;_0x1440df[_0x1a57('0x32')]=_[_0x1a57('0x34')](db['CmList'][_0x1a57('0x2e')]);_0x1440df[_0x1a57('0x33')]=_[_0x1a57('0x34')](_0x4896da[_0x1a57('0x33')]);_0x1440df[_0x1a57('0x3d')]=_[_0x1a57('0x35')](_0x1440df[_0x1a57('0x32')],_0x1440df[_0x1a57('0x33')]);_0x3d7632[_0x1a57('0x36')]=_['intersection'](_0x1440df[_0x1a57('0x32')],qs[_0x1a57('0x37')](_0x4896da[_0x1a57('0x33')][_0x1a57('0x37')]));_0x3d7632[_0x1a57('0x36')]=_0x3d7632[_0x1a57('0x36')][_0x1a57('0x38')]?_0x3d7632['attributes']:_0x1440df[_0x1a57('0x32')];_0x3d7632[_0x1a57('0x3b')]=qs[_0x1a57('0x3c')](_0x4896da['query'][_0x1a57('0x3c')]);_0x3d7632[_0x1a57('0x3e')]=qs[_0x1a57('0x3d')](_['pick'](_0x4896da[_0x1a57('0x33')],_0x1440df['filters']));if(_0x4896da['query']['filter']){_0x3d7632[_0x1a57('0x3e')]=_[_0x1a57('0x3f')](_0x3d7632[_0x1a57('0x3e')],{'$or':_[_0x1a57('0x2c')](_0x3d7632['attributes'],function(_0x4138bd){var _0x1d400e={};_0x1d400e[_0x4138bd]={'$like':'%'+_0x4896da[_0x1a57('0x33')]['filter']+'%'};return _0x1d400e;})});}_0x3d7632=_[_0x1a57('0x3f')]({},_0x3d7632,_0x4896da[_0x1a57('0x40')]);return _0x116a92[_0x1a57('0x8c')](_0x3d7632);}})[_0x1a57('0x21')](function(_0x4d8aeb){if(_0x4d8aeb){_0x4b9f41=_0x4d8aeb[_0x1a57('0x38')];if(!_0x4896da[_0x1a57('0x33')][_0x1a57('0x39')]('nolimit')){_0x3d7632[_0x1a57('0x1c')]=qs[_0x1a57('0x1c')](_0x4896da[_0x1a57('0x33')][_0x1a57('0x1c')]);_0x3d7632[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x4896da[_0x1a57('0x33')][_0x1a57('0x1e')]);}return _0x116a92['getBlackLists'](_0x3d7632);}})[_0x1a57('0x21')](function(_0xeaebb5){if(_0xeaebb5){return _0xeaebb5?{'count':_0x4b9f41,'rows':_0xeaebb5}:null;}})[_0x1a57('0x21')](respondWithResult(_0x5df8e0,null))[_0x1a57('0x44')](handleError(_0x5df8e0,null));};exports[_0x1a57('0x8d')]=function(_0x5d9afb,_0x1a863d,_0x4cfdef){var _0x2f2698,_0x2b2165;var _0x412c11=[];var _0x4363d1=moment()[_0x1a57('0x62')]('YYYY-MM-DD\x20HH:mm:ss');return db['Campaign'][_0x1a57('0x46')]({'where':{'id':_0x5d9afb[_0x1a57('0x53')]['id']}})['then'](handleEntityNotFound(_0x1a863d,null))[_0x1a57('0x21')](function(_0x278fa7){if(_0x278fa7){_0x2b2165=_0x278fa7;return _0x278fa7[_0x1a57('0x8d')](_0x5d9afb['body']['ids'],_['omit'](_0x5d9afb[_0x1a57('0x48')],['ids','id'])||{});}return null;})[_0x1a57('0x8e')](function(_0x56c92b){var _0x3876c1;var _0x287766;_0x2f2698=_0x56c92b||[];var _0x13abb5=[];if(_0x56c92b){for(var _0x5cae61=0x0;_0x5cae61<_0x56c92b['length'];_0x5cae61+=0x1){var _0x154e08=_0x56c92b[_0x5cae61][_0x1a57('0x23')]({'plain':!![]});_0x3876c1=squel[_0x1a57('0x7c')]()[_0x1a57('0x7d')]('cm_hopper_black')['fromQuery']([_0x1a57('0x69'),_0x1a57('0x6b'),'ListId',_0x1a57('0x57'),_0x1a57('0x4f'),_0x1a57('0x50')],squel[_0x1a57('0x77')]()[_0x1a57('0x6d')]('phone','phone')[_0x1a57('0x6d')]('id',_0x1a57('0x6b'))['field'](_0x154e08[_0x1a57('0x6e')]['toString'](),'ListId')[_0x1a57('0x6d')](_0x5d9afb[_0x1a57('0x53')]['id'][_0x1a57('0x6f')](),_0x1a57('0x57'))['field'](_0x1a57('0x7b'),_0x1a57('0x4f'))[_0x1a57('0x6d')](_0x1a57('0x7b'),'updatedAt')[_0x1a57('0x70')](_0x1a57('0x71'))[_0x1a57('0x3e')](_0x1a57('0x72'))[_0x1a57('0x3e')](_0x1a57('0x73'),_0x154e08[_0x1a57('0x6e')]['toString']())[_0x1a57('0x3e')](_0x1a57('0x74')))[_0x1a57('0x6f')]();_0x13abb5[_0x1a57('0x88')](db['sequelize']['query'](_0x3876c1));}return BPromise[_0x1a57('0x8a')](_0x13abb5);}})[_0x1a57('0x21')](function(){return _0x2f2698;})[_0x1a57('0x21')](respondWithResult(_0x1a863d,null))[_0x1a57('0x44')](handleError(_0x1a863d,null));};exports[_0x1a57('0x8f')]=function(_0x3e7879,_0x373d43,_0x54189e){return db['Campaign']['find']({'where':{'id':_0x3e7879['params']['id']}})['then'](handleEntityNotFound(_0x373d43,null))[_0x1a57('0x21')](function(_0x31783b){if(_0x31783b){return _0x31783b['removeBlackLists'](_0x3e7879[_0x1a57('0x33')][_0x1a57('0x64')]);}})[_0x1a57('0x21')](function(_0x1c12ce){if(_0x1c12ce){return db[_0x1a57('0x5f')][_0x1a57('0x22')]({'where':{'ListId':_0x3e7879[_0x1a57('0x33')][_0x1a57('0x64')],'CampaignId':_0x3e7879[_0x1a57('0x53')]['id']}})[_0x1a57('0x21')](function(){return _0x1c12ce;});}})[_0x1a57('0x21')](respondWithStatusCode(_0x373d43,null))[_0x1a57('0x44')](handleError(_0x373d43,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 1fb6f4a..9c5e4a1 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(_0x386b69,_0x5d9360){var _0x476415=function(_0x49fd60){while(--_0x49fd60){_0x386b69['push'](_0x386b69['shift']());}};_0x476415(++_0x5d9360);}(_0x7a54,0x106));var _0x47a5=function(_0xe0c1a7,_0x5f37cb){_0xe0c1a7=_0xe0c1a7-0x0;var _0x314d9b=_0x7a54[_0xe0c1a7];return _0x314d9b;};'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 _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 5d43d5f..a3558de 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 _0x50a6=['../../config/utils','../../config/logger','../../config/environment','http','then','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Campaign','options','raw','where','attributes','limit','map','include','model','info','GetCampaign','lodash','util','randomstring','../../mysqldb'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x50a6,0xa4));var _0x650a=function(_0xdd45,_0x2daf10){_0xdd45=_0xdd45-0x0;var _0x106736=_0x50a6[_0xdd45];return _0x106736;};'use strict';var _=require(_0x650a('0x0'));var util=require(_0x650a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x650a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x650a('0x3'))['db'];var utils=require(_0x650a('0x4'));var logger=require(_0x650a('0x5'))('rpc');var config=require(_0x650a('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x650a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2d1bb4,_0x2c22b9,_0x61618a){return new BPromise(function(_0x56d38f,_0x25366e){return client['request'](_0x2d1bb4,_0x61618a)[_0x650a('0x8')](function(_0x1e4796){logger['info'](_0x650a('0x9'),_0x2c22b9,_0x650a('0xa'));logger['debug'](_0x650a('0xb'),_0x2c22b9,'request\x20sent',JSON[_0x650a('0xc')](_0x1e4796));if(_0x1e4796['error']){if(_0x1e4796[_0x650a('0xd')]['code']===0x1f4){logger[_0x650a('0xd')]('Campaign,\x20%s,\x20%s',_0x2c22b9,_0x1e4796[_0x650a('0xd')][_0x650a('0xe')]);return _0x25366e(_0x1e4796[_0x650a('0xd')]['message']);}logger[_0x650a('0xd')](_0x650a('0x9'),_0x2c22b9,_0x1e4796[_0x650a('0xd')][_0x650a('0xe')]);return _0x56d38f(_0x1e4796[_0x650a('0xd')][_0x650a('0xe')]);}else{logger['info'](_0x650a('0x9'),_0x2c22b9,'request\x20sent');_0x56d38f(_0x1e4796[_0x650a('0xf')][_0x650a('0xe')]);}})[_0x650a('0x10')](function(_0x5d9c92){logger['error']('Campaign,\x20%s,\x20%s',_0x2c22b9,_0x5d9c92);_0x25366e(_0x5d9c92);});});}exports['GetCampaign']=function(_0x2ad2d7){var _0x359314=this;return new Promise(function(_0x41d2fa,_0xd0f717){return db[_0x650a('0x11')]['findAll']({'raw':_0x2ad2d7['options']?_0x2ad2d7[_0x650a('0x12')][_0x650a('0x13')]===undefined?!![]:![]:!![],'where':_0x2ad2d7['options']?_0x2ad2d7[_0x650a('0x12')][_0x650a('0x14')]||null:null,'attributes':_0x2ad2d7['options']?_0x2ad2d7[_0x650a('0x12')][_0x650a('0x15')]||null:null,'limit':_0x2ad2d7[_0x650a('0x12')]?_0x2ad2d7[_0x650a('0x12')][_0x650a('0x16')]||null:null,'include':_0x2ad2d7['options']?_0x2ad2d7[_0x650a('0x12')]['include']?_[_0x650a('0x17')](_0x2ad2d7[_0x650a('0x12')][_0x650a('0x18')],function(_0x469e53){return{'model':db[_0x469e53[_0x650a('0x19')]],'as':_0x469e53['as'],'attributes':_0x469e53[_0x650a('0x15')],'include':_0x469e53[_0x650a('0x18')]?_[_0x650a('0x17')](_0x469e53[_0x650a('0x18')],function(_0x2761a8){return{'model':db[_0x2761a8[_0x650a('0x19')]],'as':_0x2761a8['as'],'attributes':_0x2761a8[_0x650a('0x15')],'include':_0x2761a8[_0x650a('0x18')]?_[_0x650a('0x17')](_0x2761a8[_0x650a('0x18')],function(_0x39a155){return{'model':db[_0x39a155[_0x650a('0x19')]],'as':_0x39a155['as'],'attributes':_0x39a155[_0x650a('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2290a7){logger[_0x650a('0x1a')](_0x650a('0x1b'),_0x2ad2d7);logger['debug'](_0x650a('0x1b'),_0x2ad2d7,JSON[_0x650a('0xc')](_0x2290a7));_0x41d2fa(_0x2290a7);})[_0x650a('0x10')](function(_0x783509){logger[_0x650a('0xd')](_0x650a('0x1b'),_0x783509['message'],_0x2ad2d7);_0xd0f717(_0x359314[_0x650a('0xd')](0x1f4,_0x783509[_0x650a('0xe')]));});});}; \ No newline at end of file +var _0x12fd=['catch','GetCampaign','Campaign','options','raw','where','attributes','limit','include','map','model','debug','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','Campaign,\x20%s,\x20%s','result'];(function(_0x343e70,_0xe5f373){var _0x2742fd=function(_0x27e56e){while(--_0x27e56e){_0x343e70['push'](_0x343e70['shift']());}};_0x2742fd(++_0xe5f373);}(_0x12fd,0x199));var _0xd12f=function(_0x5105ca,_0x2f2589){_0x5105ca=_0x5105ca-0x0;var _0x567724=_0x12fd[_0x5105ca];return _0x567724;};'use strict';var _=require(_0xd12f('0x0'));var util=require(_0xd12f('0x1'));var moment=require(_0xd12f('0x2'));var BPromise=require(_0xd12f('0x3'));var rs=require(_0xd12f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd12f('0x5'))['db'];var utils=require(_0xd12f('0x6'));var logger=require(_0xd12f('0x7'))(_0xd12f('0x8'));var config=require(_0xd12f('0x9'));var jayson=require(_0xd12f('0xa'));var client=jayson['client'][_0xd12f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ca6e6,_0x285abf,_0x193e89){return new BPromise(function(_0x62de68,_0x40aaf8){return client['request'](_0x5ca6e6,_0x193e89)[_0xd12f('0xc')](function(_0x539473){logger[_0xd12f('0xd')]('Campaign,\x20%s,\x20%s',_0x285abf,'request\x20sent');logger['debug'](_0xd12f('0xe'),_0x285abf,_0xd12f('0xf'),JSON['stringify'](_0x539473));if(_0x539473['error']){if(_0x539473['error']['code']===0x1f4){logger[_0xd12f('0x10')]('Campaign,\x20%s,\x20%s',_0x285abf,_0x539473[_0xd12f('0x10')][_0xd12f('0x11')]);return _0x40aaf8(_0x539473['error'][_0xd12f('0x11')]);}logger[_0xd12f('0x10')]('Campaign,\x20%s,\x20%s',_0x285abf,_0x539473['error']['message']);return _0x62de68(_0x539473[_0xd12f('0x10')][_0xd12f('0x11')]);}else{logger[_0xd12f('0xd')](_0xd12f('0x12'),_0x285abf,_0xd12f('0xf'));_0x62de68(_0x539473[_0xd12f('0x13')][_0xd12f('0x11')]);}})[_0xd12f('0x14')](function(_0x4769a2){logger['error']('Campaign,\x20%s,\x20%s',_0x285abf,_0x4769a2);_0x40aaf8(_0x4769a2);});});}exports[_0xd12f('0x15')]=function(_0x45ff4d){var _0x58a653=this;return new Promise(function(_0x14c619,_0x12c884){return db[_0xd12f('0x16')]['findAll']({'raw':_0x45ff4d['options']?_0x45ff4d[_0xd12f('0x17')][_0xd12f('0x18')]===undefined?!![]:![]:!![],'where':_0x45ff4d[_0xd12f('0x17')]?_0x45ff4d[_0xd12f('0x17')][_0xd12f('0x19')]||null:null,'attributes':_0x45ff4d[_0xd12f('0x17')]?_0x45ff4d['options'][_0xd12f('0x1a')]||null:null,'limit':_0x45ff4d[_0xd12f('0x17')]?_0x45ff4d[_0xd12f('0x17')][_0xd12f('0x1b')]||null:null,'include':_0x45ff4d[_0xd12f('0x17')]?_0x45ff4d[_0xd12f('0x17')][_0xd12f('0x1c')]?_[_0xd12f('0x1d')](_0x45ff4d[_0xd12f('0x17')][_0xd12f('0x1c')],function(_0x42eb92){return{'model':db[_0x42eb92[_0xd12f('0x1e')]],'as':_0x42eb92['as'],'attributes':_0x42eb92[_0xd12f('0x1a')],'include':_0x42eb92[_0xd12f('0x1c')]?_[_0xd12f('0x1d')](_0x42eb92[_0xd12f('0x1c')],function(_0x2218fe){return{'model':db[_0x2218fe[_0xd12f('0x1e')]],'as':_0x2218fe['as'],'attributes':_0x2218fe[_0xd12f('0x1a')],'include':_0x2218fe[_0xd12f('0x1c')]?_[_0xd12f('0x1d')](_0x2218fe[_0xd12f('0x1c')],function(_0x3d71be){return{'model':db[_0x3d71be['model']],'as':_0x3d71be['as'],'attributes':_0x3d71be[_0xd12f('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x163f95){logger[_0xd12f('0xd')]('GetCampaign',_0x45ff4d);logger[_0xd12f('0x1f')]('GetCampaign',_0x45ff4d,JSON[_0xd12f('0x20')](_0x163f95));_0x14c619(_0x163f95);})[_0xd12f('0x14')](function(_0x3418de){logger[_0xd12f('0x10')]('GetCampaign',_0x3418de['message'],_0x45ff4d);_0x12c884(_0x58a653[_0xd12f('0x10')](0x1f4,_0x3418de['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 6757fe5..92c71d8 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 _0xc38d=['multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','/:id','show','get','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','addLists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','exports'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xc38d,0x110));var _0xdc38=function(_0xf8dfc8,_0x58486e){_0xf8dfc8=_0xf8dfc8-0x0;var _0x3a601d=_0xc38d[_0xf8dfc8];return _0x3a601d;};'use strict';var multer=require(_0xdc38('0x0'));var util=require(_0xdc38('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdc38('0x2'));var router=express[_0xdc38('0x3')]();var fs_extra=require(_0xdc38('0x4'));var auth=require(_0xdc38('0x5'));var interaction=require(_0xdc38('0x6'));var config=require(_0xdc38('0x7'));var controller=require(_0xdc38('0x8'));router['get']('/',auth[_0xdc38('0x9')](),controller[_0xdc38('0xa')]);router['get'](_0xdc38('0xb'),auth['isAuthenticated'](),controller[_0xdc38('0xc')]);router[_0xdc38('0xd')](_0xdc38('0xe'),auth[_0xdc38('0x9')](),controller[_0xdc38('0xf')]);router[_0xdc38('0xd')]('/:id/hopper_histories',auth[_0xdc38('0x9')](),controller[_0xdc38('0x10')]);router[_0xdc38('0xd')](_0xdc38('0x11'),auth[_0xdc38('0x9')](),controller['getHopperFinals']);router['get']('/:id/hopper_black',auth[_0xdc38('0x9')](),controller[_0xdc38('0x12')]);router['get'](_0xdc38('0x13'),auth[_0xdc38('0x9')](),controller[_0xdc38('0x14')]);router['get'](_0xdc38('0x15'),auth[_0xdc38('0x9')](),controller[_0xdc38('0x16')]);router['post']('/',auth[_0xdc38('0x9')](),controller[_0xdc38('0x17')]);router[_0xdc38('0x18')]('/:id/clone',auth[_0xdc38('0x9')](),controller['clone']);router[_0xdc38('0x18')](_0xdc38('0x13'),auth[_0xdc38('0x9')](),controller[_0xdc38('0x19')]);router[_0xdc38('0x18')](_0xdc38('0x15'),auth['isAuthenticated'](),controller[_0xdc38('0x1a')]);router[_0xdc38('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0xdc38('0x1c')]);router[_0xdc38('0x1d')](_0xdc38('0xb'),auth[_0xdc38('0x9')](),controller[_0xdc38('0x1e')]);router[_0xdc38('0x1d')](_0xdc38('0x13'),auth['isAuthenticated'](),controller[_0xdc38('0x1f')]);router[_0xdc38('0x1d')]('/:id/blacklists',auth[_0xdc38('0x9')](),controller[_0xdc38('0x20')]);module[_0xdc38('0x21')]=router; \ No newline at end of file +var _0x30c6=['create','/:id/clone','clone','addLists','addBlackLists','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post'];(function(_0x3cf346,_0x3b8a44){var _0x33f272=function(_0x5d4056){while(--_0x5d4056){_0x3cf346['push'](_0x3cf346['shift']());}};_0x33f272(++_0x3b8a44);}(_0x30c6,0x171));var _0x630c=function(_0x459885,_0x5dcd09){_0x459885=_0x459885-0x0;var _0x39372f=_0x30c6[_0x459885];return _0x39372f;};'use strict';var multer=require(_0x630c('0x0'));var util=require('util');var path=require(_0x630c('0x1'));var timeout=require(_0x630c('0x2'));var express=require(_0x630c('0x3'));var router=express[_0x630c('0x4')]();var fs_extra=require(_0x630c('0x5'));var auth=require(_0x630c('0x6'));var interaction=require(_0x630c('0x7'));var config=require(_0x630c('0x8'));var controller=require(_0x630c('0x9'));router[_0x630c('0xa')]('/',auth[_0x630c('0xb')](),controller[_0x630c('0xc')]);router[_0x630c('0xa')](_0x630c('0xd'),auth[_0x630c('0xb')](),controller[_0x630c('0xe')]);router[_0x630c('0xa')]('/:id/hoppers',auth[_0x630c('0xb')](),controller[_0x630c('0xf')]);router[_0x630c('0xa')](_0x630c('0x10'),auth[_0x630c('0xb')](),controller[_0x630c('0x11')]);router[_0x630c('0xa')](_0x630c('0x12'),auth['isAuthenticated'](),controller[_0x630c('0x13')]);router['get'](_0x630c('0x14'),auth['isAuthenticated'](),controller[_0x630c('0x15')]);router['get'](_0x630c('0x16'),auth[_0x630c('0xb')](),controller[_0x630c('0x17')]);router[_0x630c('0xa')](_0x630c('0x18'),auth['isAuthenticated'](),controller[_0x630c('0x19')]);router[_0x630c('0x1a')]('/',auth['isAuthenticated'](),controller[_0x630c('0x1b')]);router['post'](_0x630c('0x1c'),auth[_0x630c('0xb')](),controller[_0x630c('0x1d')]);router[_0x630c('0x1a')]('/:id/lists',auth[_0x630c('0xb')](),controller[_0x630c('0x1e')]);router[_0x630c('0x1a')](_0x630c('0x18'),auth[_0x630c('0xb')](),controller[_0x630c('0x1f')]);router[_0x630c('0x20')](_0x630c('0xd'),auth['isAuthenticated'](),controller[_0x630c('0x21')]);router[_0x630c('0x22')]('/:id',auth['isAuthenticated'](),controller[_0x630c('0x23')]);router[_0x630c('0x22')](_0x630c('0x16'),auth[_0x630c('0xb')](),controller['removeLists']);router[_0x630c('0x22')](_0x630c('0x18'),auth[_0x630c('0xb')](),controller['removeBlackLists']);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 6d3d2e6..68f5b86 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 _0x5b4e=['STRING','TEXT','medium','VIRTUAL','getDataValue','key','sequelize','exports'];(function(_0xd25cef,_0x35c0e5){var _0x5d933d=function(_0x552767){while(--_0x552767){_0xd25cef['push'](_0xd25cef['shift']());}};_0x5d933d(++_0x35c0e5);}(_0x5b4e,0x196));var _0xe5b4=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5b4e[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0xe5b4('0x0'));module[_0xe5b4('0x1')]={'key':{'type':Sequelize[_0xe5b4('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xe5b4('0x3')],'length':_0xe5b4('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xe5b4('0x2')]},'name':{'type':Sequelize[_0xe5b4('0x5')],'get':function(){return this[_0xe5b4('0x6')](_0xe5b4('0x7'));}}}; \ No newline at end of file +var _0x9d25=['TEXT','getDataValue','sequelize','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9d25,0xde));var _0x59d2=function(_0x15b78c,_0x364a98){_0x15b78c=_0x15b78c-0x0;var _0x46804e=_0x9d25[_0x15b78c];return _0x46804e;};'use strict';var Sequelize=require(_0x59d2('0x0'));module[_0x59d2('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x59d2('0x2')],'length':'medium','allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x59d2('0x3')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 28366da..e578443 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 _0x21d9=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','apply','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','find','catch','body','params','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x152b4d,_0x5e6b47){var _0x5abe5e=function(_0x13a033){while(--_0x13a033){_0x152b4d['push'](_0x152b4d['shift']());}};_0x5abe5e(++_0x5e6b47);}(_0x21d9,0x1ae));var _0x921d=function(_0x4a2707,_0x56a7aa){_0x4a2707=_0x4a2707-0x0;var _0x2eb468=_0x21d9[_0x4a2707];return _0x2eb468;};'use strict';var emlformat=require(_0x921d('0x0'));var rimraf=require(_0x921d('0x1'));var zipdir=require(_0x921d('0x2'));var jsonpatch=require(_0x921d('0x3'));var rp=require(_0x921d('0x4'));var moment=require(_0x921d('0x5'));var BPromise=require(_0x921d('0x6'));var Mustache=require('mustache');var util=require(_0x921d('0x7'));var path=require(_0x921d('0x8'));var sox=require(_0x921d('0x9'));var csv=require(_0x921d('0xa'));var ejs=require(_0x921d('0xb'));var fs=require('fs');var fs_extra=require(_0x921d('0xc'));var _=require(_0x921d('0xd'));var squel=require(_0x921d('0xe'));var crypto=require(_0x921d('0xf'));var jsforce=require(_0x921d('0x10'));var deskjs=require(_0x921d('0x11'));var toCsv=require('to-csv');var querystring=require(_0x921d('0x12'));var Papa=require(_0x921d('0x13'));var Redis=require(_0x921d('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x921d('0x15'));var hardwareService=require(_0x921d('0x16'));var logger=require(_0x921d('0x17'))(_0x921d('0x18'));var utils=require(_0x921d('0x19'));var config=require(_0x921d('0x1a'));var licenseUtil=require(_0x921d('0x1b'));var db=require(_0x921d('0x1c'))['db'];function respondWithStatusCode(_0x44c951,_0x5a212f){_0x5a212f=_0x5a212f||0xcc;return function(_0x499f80){if(_0x499f80){return _0x44c951['sendStatus'](_0x5a212f);}return _0x44c951[_0x921d('0x1d')](_0x5a212f)[_0x921d('0x1e')]();};}function respondWithResult(_0x2aefac,_0x362bf4){_0x362bf4=_0x362bf4||0xc8;return function(_0x10285c){if(_0x10285c){return _0x2aefac[_0x921d('0x1d')](_0x362bf4)[_0x921d('0x1f')](_0x10285c);}};}function respondWithFilteredResult(_0x3e2baf,_0x5c64d9){return function(_0x141ab0){if(_0x141ab0){var _0x552053=typeof _0x5c64d9[_0x921d('0x20')]==='undefined'&&typeof _0x5c64d9[_0x921d('0x21')]===_0x921d('0x22');var _0x1e7e8d=_0x141ab0['count'];var _0x4ce8d5=_0x552053?0x0:_0x5c64d9['offset'];var _0x5bd96c=_0x552053?_0x141ab0[_0x921d('0x23')]:_0x5c64d9[_0x921d('0x20')]+_0x5c64d9[_0x921d('0x21')];var _0x126e94;if(_0x5bd96c>=_0x1e7e8d){_0x5bd96c=_0x1e7e8d;_0x126e94=0xc8;}else{_0x126e94=0xce;}_0x3e2baf[_0x921d('0x1d')](_0x126e94);return _0x3e2baf['set']('Content-Range',_0x4ce8d5+'-'+_0x5bd96c+'/'+_0x1e7e8d)[_0x921d('0x1f')](_0x141ab0);}return null;};}function patchUpdates(_0x48222b){return function(_0x3b84f8){try{jsonpatch[_0x921d('0x24')](_0x3b84f8,_0x48222b,!![]);}catch(_0x4b1e4a){return BPromise['reject'](_0x4b1e4a);}return _0x3b84f8[_0x921d('0x25')]();};}function saveUpdates(_0x51ee84,_0x1ec8fb){return function(_0x45833e){if(_0x45833e){return _0x45833e[_0x921d('0x26')](_0x51ee84)[_0x921d('0x27')](function(_0xfef3aa){return _0xfef3aa;});}return null;};}function removeEntity(_0xf63933,_0x3d8d01){return function(_0x1f2983){if(_0x1f2983){return _0x1f2983[_0x921d('0x28')]()[_0x921d('0x27')](function(){var _0x459208=_0x1f2983['get']({'plain':!![]});var _0x1facc5='CannedAnswers';return db[_0x921d('0x29')][_0x921d('0x28')]({'where':{'type':_0x1facc5,'resourceId':_0x459208['id']}})[_0x921d('0x27')](function(){return _0x1f2983;});})[_0x921d('0x27')](function(){_0xf63933[_0x921d('0x1d')](0xcc)[_0x921d('0x1e')]();});}};}function handleEntityNotFound(_0x471cf8,_0x2774ff){return function(_0x5b8f64){if(!_0x5b8f64){_0x471cf8['sendStatus'](0x194);}return _0x5b8f64;};}function handleError(_0x55fda7,_0x411894){_0x411894=_0x411894||0x1f4;return function(_0x3ff668){logger[_0x921d('0x2a')](_0x3ff668[_0x921d('0x2b')]);if(_0x3ff668[_0x921d('0x2c')]){delete _0x3ff668[_0x921d('0x2c')];}_0x55fda7[_0x921d('0x1d')](_0x411894)[_0x921d('0x2d')](_0x3ff668);};}exports[_0x921d('0x2e')]=function(_0xecaf05,_0x48ff95){var _0x492bc9={},_0xd718f9={},_0x501d00={'count':0x0,'rows':[]};var _0xfb1572=_[_0x921d('0x2f')](db[_0x921d('0x30')][_0x921d('0x31')],function(_0x5412f9){return{'name':_0x5412f9[_0x921d('0x32')],'type':_0x5412f9['type']['key']};});_0xd718f9['model']=_[_0x921d('0x2f')](_0xfb1572,_0x921d('0x2c'));_0xd718f9[_0x921d('0x33')]=_[_0x921d('0x34')](_0xecaf05['query']);_0xd718f9[_0x921d('0x35')]=_[_0x921d('0x36')](_0xd718f9[_0x921d('0x37')],_0xd718f9[_0x921d('0x33')]);_0x492bc9[_0x921d('0x38')]=_[_0x921d('0x36')](_0xd718f9[_0x921d('0x37')],qs[_0x921d('0x39')](_0xecaf05[_0x921d('0x33')]['fields']));_0x492bc9[_0x921d('0x38')]=_0x492bc9[_0x921d('0x38')][_0x921d('0x3a')]?_0x492bc9[_0x921d('0x38')]:_0xd718f9['model'];if(!_0xecaf05[_0x921d('0x33')][_0x921d('0x3b')]('nolimit')){_0x492bc9[_0x921d('0x21')]=qs[_0x921d('0x21')](_0xecaf05[_0x921d('0x33')][_0x921d('0x21')]);_0x492bc9[_0x921d('0x20')]=qs[_0x921d('0x20')](_0xecaf05[_0x921d('0x33')][_0x921d('0x20')]);}_0x492bc9[_0x921d('0x3c')]=qs['sort'](_0xecaf05[_0x921d('0x33')][_0x921d('0x3d')]);_0x492bc9[_0x921d('0x3e')]=qs['filters'](_[_0x921d('0x3f')](_0xecaf05[_0x921d('0x33')],_0xd718f9[_0x921d('0x35')]),_0xfb1572);if(_0xecaf05[_0x921d('0x33')][_0x921d('0x40')]){_0x492bc9[_0x921d('0x3e')]=_[_0x921d('0x41')](_0x492bc9[_0x921d('0x3e')],{'$or':[{'key':{'$like':'%'+_0xecaf05['query']['filter']+'%'}},{'value':{'$like':'%'+_0xecaf05['query'][_0x921d('0x40')]+'%'}}]});}_0x492bc9=_[_0x921d('0x41')]({},_0x492bc9,_0xecaf05[_0x921d('0x42')]);var _0x522651={'where':_0x492bc9[_0x921d('0x3e')]};return db['CannedAnswer'][_0x921d('0x23')](_0x522651)['then'](function(_0x483a60){_0x501d00[_0x921d('0x23')]=_0x483a60;if(_0xecaf05['query'][_0x921d('0x43')]){_0x492bc9[_0x921d('0x44')]=[{'all':!![]}];}return db[_0x921d('0x30')][_0x921d('0x45')](_0x492bc9);})[_0x921d('0x27')](function(_0xabb198){_0x501d00[_0x921d('0x46')]=_0xabb198;return _0x501d00;})['then'](respondWithFilteredResult(_0x48ff95,_0x492bc9))['catch'](handleError(_0x48ff95,null));};exports['show']=function(_0x55f1ad,_0xe7759c){var _0xf365c1={'raw':!![],'where':{'id':_0x55f1ad['params']['id']}},_0xd462b0={};_0xd462b0[_0x921d('0x37')]=_[_0x921d('0x34')](db[_0x921d('0x30')][_0x921d('0x31')]);_0xd462b0['query']=_[_0x921d('0x34')](_0x55f1ad['query']);_0xd462b0['filters']=_[_0x921d('0x36')](_0xd462b0[_0x921d('0x37')],_0xd462b0[_0x921d('0x33')]);_0xf365c1[_0x921d('0x38')]=_[_0x921d('0x36')](_0xd462b0['model'],qs['fields'](_0x55f1ad['query']['fields']));_0xf365c1['attributes']=_0xf365c1[_0x921d('0x38')][_0x921d('0x3a')]?_0xf365c1[_0x921d('0x38')]:_0xd462b0[_0x921d('0x37')];if(_0x55f1ad['query']['includeAll']){_0xf365c1[_0x921d('0x44')]=[{'all':!![]}];}_0xf365c1=_['merge']({},_0xf365c1,_0x55f1ad[_0x921d('0x42')]);return db[_0x921d('0x30')][_0x921d('0x47')](_0xf365c1)['then'](handleEntityNotFound(_0xe7759c,null))[_0x921d('0x27')](respondWithResult(_0xe7759c,null))[_0x921d('0x48')](handleError(_0xe7759c,null));};exports[_0x921d('0x26')]=function(_0x1e64f7,_0x4edd1c){if(_0x1e64f7[_0x921d('0x49')]['id']){delete _0x1e64f7[_0x921d('0x49')]['id'];}return db[_0x921d('0x30')][_0x921d('0x47')]({'where':{'id':_0x1e64f7[_0x921d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4edd1c,null))[_0x921d('0x27')](saveUpdates(_0x1e64f7[_0x921d('0x49')],null))['then'](respondWithResult(_0x4edd1c,null))[_0x921d('0x48')](handleError(_0x4edd1c,null));};exports[_0x921d('0x28')]=function(_0xf74c08,_0x12d796){return db[_0x921d('0x30')]['find']({'where':{'id':_0xf74c08[_0x921d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x12d796,null))[_0x921d('0x27')](removeEntity(_0x12d796,null))[_0x921d('0x48')](handleError(_0x12d796,null));};exports[_0x921d('0x4b')]=function(_0x1d28b8,_0x4e32ff){var _0x139914={'key':_0x1d28b8['body'][_0x921d('0x4c')]};if(_0x1d28b8[_0x921d('0x49')][_0x921d('0x4d')]){_0x139914[_0x921d('0x4d')]=_0x1d28b8[_0x921d('0x49')]['MailAccountId'];}else if(_0x1d28b8[_0x921d('0x49')][_0x921d('0x4e')]){_0x139914['SmsAccountId']=_0x1d28b8[_0x921d('0x49')]['SmsAccountId'];}else if(_0x1d28b8[_0x921d('0x49')][_0x921d('0x4f')]){_0x139914[_0x921d('0x4f')]=_0x1d28b8['body'][_0x921d('0x4f')];}else if(_0x1d28b8[_0x921d('0x49')][_0x921d('0x50')]){_0x139914[_0x921d('0x50')]=_0x1d28b8[_0x921d('0x49')][_0x921d('0x50')];}return db[_0x921d('0x30')][_0x921d('0x47')]({'where':_0x139914})[_0x921d('0x27')](function(_0x31cf7f){if(_0x31cf7f){throw new db['Sequelize'][(_0x921d('0x51'))](_0x921d('0x52'));}return db[_0x921d('0x30')][_0x921d('0x4b')](_0x1d28b8[_0x921d('0x49')]);})['then'](function(_0x26438d){var _0x5a0dac=_0x1d28b8[_0x921d('0x53')][_0x921d('0x54')]({'plain':!![]});if(!_0x5a0dac)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a0dac[_0x921d('0x55')]==='user'){var _0x249e41=_0x26438d[_0x921d('0x54')]({'plain':!![]});return db[_0x921d('0x56')][_0x921d('0x47')]({'where':{'name':'CannedAnswers','userProfileId':_0x5a0dac[_0x921d('0x57')]},'raw':!![]})[_0x921d('0x27')](function(_0x34d6a9){if(_0x34d6a9&&_0x34d6a9[_0x921d('0x58')]===0x0){return db[_0x921d('0x29')][_0x921d('0x4b')]({'name':_0x249e41['name'],'resourceId':_0x249e41['id'],'type':_0x34d6a9['name'],'sectionId':_0x34d6a9['id']},{})[_0x921d('0x27')](function(){return _0x26438d;});}else{return _0x26438d;}})[_0x921d('0x48')](function(_0x47e57b){logger[_0x921d('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x47e57b);throw _0x47e57b;});}return _0x26438d;})['then'](respondWithResult(_0x4e32ff,0xc9))[_0x921d('0x48')](handleError(_0x4e32ff,null));}; \ No newline at end of file +var _0x3d79=['SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','end','error','stack','name','send','index','CannedAnswer','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','filters','pick','filter','where','merge','options','count','include','findAll','catch','params','keys','length','includeAll','find','body','create','MailAccountId'];(function(_0x15ee93,_0x62af92){var _0x48cc71=function(_0x36bb89){while(--_0x36bb89){_0x15ee93['push'](_0x15ee93['shift']());}};_0x48cc71(++_0x62af92);}(_0x3d79,0x186));var _0x93d7=function(_0x101d07,_0x1a9a15){_0x101d07=_0x101d07-0x0;var _0xdcca9d=_0x3d79[_0x101d07];return _0xdcca9d;};'use strict';var emlformat=require(_0x93d7('0x0'));var rimraf=require(_0x93d7('0x1'));var zipdir=require(_0x93d7('0x2'));var jsonpatch=require(_0x93d7('0x3'));var rp=require(_0x93d7('0x4'));var moment=require('moment');var BPromise=require(_0x93d7('0x5'));var Mustache=require(_0x93d7('0x6'));var util=require(_0x93d7('0x7'));var path=require(_0x93d7('0x8'));var sox=require('sox');var csv=require(_0x93d7('0x9'));var ejs=require(_0x93d7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x93d7('0xb'));var squel=require(_0x93d7('0xc'));var crypto=require('crypto');var jsforce=require(_0x93d7('0xd'));var deskjs=require(_0x93d7('0xe'));var toCsv=require(_0x93d7('0x9'));var querystring=require(_0x93d7('0xf'));var Papa=require(_0x93d7('0x10'));var Redis=require(_0x93d7('0x11'));var authService=require(_0x93d7('0x12'));var qs=require(_0x93d7('0x13'));var as=require(_0x93d7('0x14'));var hardwareService=require(_0x93d7('0x15'));var logger=require(_0x93d7('0x16'))(_0x93d7('0x17'));var utils=require(_0x93d7('0x18'));var config=require(_0x93d7('0x19'));var licenseUtil=require(_0x93d7('0x1a'));var db=require(_0x93d7('0x1b'))['db'];function respondWithStatusCode(_0x5b8cd2,_0x410201){_0x410201=_0x410201||0xcc;return function(_0xe67c1c){if(_0xe67c1c){return _0x5b8cd2[_0x93d7('0x1c')](_0x410201);}return _0x5b8cd2['status'](_0x410201)['end']();};}function respondWithResult(_0x414953,_0x5f11ba){_0x5f11ba=_0x5f11ba||0xc8;return function(_0xd77f2c){if(_0xd77f2c){return _0x414953[_0x93d7('0x1d')](_0x5f11ba)[_0x93d7('0x1e')](_0xd77f2c);}};}function respondWithFilteredResult(_0x268cca,_0x416820){return function(_0x2debcb){if(_0x2debcb){var _0x11caee=typeof _0x416820['offset']==='undefined'&&typeof _0x416820[_0x93d7('0x1f')]===_0x93d7('0x20');var _0x3e7003=_0x2debcb['count'];var _0x2b0a34=_0x11caee?0x0:_0x416820[_0x93d7('0x21')];var _0x4b3c86=_0x11caee?_0x2debcb['count']:_0x416820[_0x93d7('0x21')]+_0x416820[_0x93d7('0x1f')];var _0x53b120;if(_0x4b3c86>=_0x3e7003){_0x4b3c86=_0x3e7003;_0x53b120=0xc8;}else{_0x53b120=0xce;}_0x268cca[_0x93d7('0x1d')](_0x53b120);return _0x268cca[_0x93d7('0x22')](_0x93d7('0x23'),_0x2b0a34+'-'+_0x4b3c86+'/'+_0x3e7003)[_0x93d7('0x1e')](_0x2debcb);}return null;};}function patchUpdates(_0x5d5f41){return function(_0x486aad){try{jsonpatch[_0x93d7('0x24')](_0x486aad,_0x5d5f41,!![]);}catch(_0x329d98){return BPromise[_0x93d7('0x25')](_0x329d98);}return _0x486aad[_0x93d7('0x26')]();};}function saveUpdates(_0x4fd91b,_0x40df40){return function(_0x1ab8a1){if(_0x1ab8a1){return _0x1ab8a1[_0x93d7('0x27')](_0x4fd91b)['then'](function(_0x3d15f2){return _0x3d15f2;});}return null;};}function removeEntity(_0x2c581b,_0x2ddb05){return function(_0x2e94db){if(_0x2e94db){return _0x2e94db[_0x93d7('0x28')]()[_0x93d7('0x29')](function(){var _0x1a9feb=_0x2e94db[_0x93d7('0x2a')]({'plain':!![]});var _0x4dbccd='CannedAnswers';return db['UserProfileResource']['destroy']({'where':{'type':_0x4dbccd,'resourceId':_0x1a9feb['id']}})[_0x93d7('0x29')](function(){return _0x2e94db;});})[_0x93d7('0x29')](function(){_0x2c581b[_0x93d7('0x1d')](0xcc)[_0x93d7('0x2b')]();});}};}function handleEntityNotFound(_0x1355ab,_0x160526){return function(_0x3b4212){if(!_0x3b4212){_0x1355ab[_0x93d7('0x1c')](0x194);}return _0x3b4212;};}function handleError(_0x571dfc,_0x55c41d){_0x55c41d=_0x55c41d||0x1f4;return function(_0x3f7ead){logger[_0x93d7('0x2c')](_0x3f7ead[_0x93d7('0x2d')]);if(_0x3f7ead[_0x93d7('0x2e')]){delete _0x3f7ead[_0x93d7('0x2e')];}_0x571dfc[_0x93d7('0x1d')](_0x55c41d)[_0x93d7('0x2f')](_0x3f7ead);};}exports[_0x93d7('0x30')]=function(_0xe6476,_0x3c45d8){var _0x43c562={},_0xa23382={},_0x4220bb={'count':0x0,'rows':[]};var _0x1bfe70=_['map'](db[_0x93d7('0x31')][_0x93d7('0x32')],function(_0x29c16e){return{'name':_0x29c16e[_0x93d7('0x33')],'type':_0x29c16e[_0x93d7('0x34')][_0x93d7('0x35')]};});_0xa23382[_0x93d7('0x36')]=_[_0x93d7('0x37')](_0x1bfe70,'name');_0xa23382['query']=_['keys'](_0xe6476[_0x93d7('0x38')]);_0xa23382['filters']=_[_0x93d7('0x39')](_0xa23382[_0x93d7('0x36')],_0xa23382[_0x93d7('0x38')]);_0x43c562[_0x93d7('0x3a')]=_['intersection'](_0xa23382['model'],qs[_0x93d7('0x3b')](_0xe6476[_0x93d7('0x38')][_0x93d7('0x3b')]));_0x43c562[_0x93d7('0x3a')]=_0x43c562['attributes']['length']?_0x43c562[_0x93d7('0x3a')]:_0xa23382[_0x93d7('0x36')];if(!_0xe6476[_0x93d7('0x38')][_0x93d7('0x3c')](_0x93d7('0x3d'))){_0x43c562[_0x93d7('0x1f')]=qs['limit'](_0xe6476[_0x93d7('0x38')][_0x93d7('0x1f')]);_0x43c562[_0x93d7('0x21')]=qs[_0x93d7('0x21')](_0xe6476[_0x93d7('0x38')][_0x93d7('0x21')]);}_0x43c562['order']=qs['sort'](_0xe6476[_0x93d7('0x38')]['sort']);_0x43c562['where']=qs[_0x93d7('0x3e')](_[_0x93d7('0x3f')](_0xe6476['query'],_0xa23382[_0x93d7('0x3e')]),_0x1bfe70);if(_0xe6476[_0x93d7('0x38')][_0x93d7('0x40')]){_0x43c562[_0x93d7('0x41')]=_['merge'](_0x43c562[_0x93d7('0x41')],{'$or':[{'key':{'$like':'%'+_0xe6476[_0x93d7('0x38')][_0x93d7('0x40')]+'%'}},{'value':{'$like':'%'+_0xe6476[_0x93d7('0x38')][_0x93d7('0x40')]+'%'}}]});}_0x43c562=_[_0x93d7('0x42')]({},_0x43c562,_0xe6476[_0x93d7('0x43')]);var _0x1ac4c6={'where':_0x43c562[_0x93d7('0x41')]};return db[_0x93d7('0x31')][_0x93d7('0x44')](_0x1ac4c6)['then'](function(_0x52f124){_0x4220bb['count']=_0x52f124;if(_0xe6476[_0x93d7('0x38')]['includeAll']){_0x43c562[_0x93d7('0x45')]=[{'all':!![]}];}return db[_0x93d7('0x31')][_0x93d7('0x46')](_0x43c562);})['then'](function(_0x1b7137){_0x4220bb['rows']=_0x1b7137;return _0x4220bb;})['then'](respondWithFilteredResult(_0x3c45d8,_0x43c562))[_0x93d7('0x47')](handleError(_0x3c45d8,null));};exports['show']=function(_0x5b55cb,_0x1387fd){var _0x5c2b6f={'raw':!![],'where':{'id':_0x5b55cb[_0x93d7('0x48')]['id']}},_0x5b5da8={};_0x5b5da8[_0x93d7('0x36')]=_[_0x93d7('0x49')](db[_0x93d7('0x31')][_0x93d7('0x32')]);_0x5b5da8[_0x93d7('0x38')]=_['keys'](_0x5b55cb[_0x93d7('0x38')]);_0x5b5da8[_0x93d7('0x3e')]=_['intersection'](_0x5b5da8['model'],_0x5b5da8['query']);_0x5c2b6f['attributes']=_[_0x93d7('0x39')](_0x5b5da8[_0x93d7('0x36')],qs[_0x93d7('0x3b')](_0x5b55cb[_0x93d7('0x38')][_0x93d7('0x3b')]));_0x5c2b6f[_0x93d7('0x3a')]=_0x5c2b6f[_0x93d7('0x3a')][_0x93d7('0x4a')]?_0x5c2b6f[_0x93d7('0x3a')]:_0x5b5da8[_0x93d7('0x36')];if(_0x5b55cb[_0x93d7('0x38')][_0x93d7('0x4b')]){_0x5c2b6f['include']=[{'all':!![]}];}_0x5c2b6f=_[_0x93d7('0x42')]({},_0x5c2b6f,_0x5b55cb[_0x93d7('0x43')]);return db[_0x93d7('0x31')][_0x93d7('0x4c')](_0x5c2b6f)[_0x93d7('0x29')](handleEntityNotFound(_0x1387fd,null))[_0x93d7('0x29')](respondWithResult(_0x1387fd,null))[_0x93d7('0x47')](handleError(_0x1387fd,null));};exports['update']=function(_0x3a00ef,_0xdd7c6a){if(_0x3a00ef['body']['id']){delete _0x3a00ef['body']['id'];}return db[_0x93d7('0x31')][_0x93d7('0x4c')]({'where':{'id':_0x3a00ef[_0x93d7('0x48')]['id']}})[_0x93d7('0x29')](handleEntityNotFound(_0xdd7c6a,null))[_0x93d7('0x29')](saveUpdates(_0x3a00ef[_0x93d7('0x4d')],null))[_0x93d7('0x29')](respondWithResult(_0xdd7c6a,null))[_0x93d7('0x47')](handleError(_0xdd7c6a,null));};exports['destroy']=function(_0x1ad59f,_0x963579){return db[_0x93d7('0x31')][_0x93d7('0x4c')]({'where':{'id':_0x1ad59f[_0x93d7('0x48')]['id']}})['then'](handleEntityNotFound(_0x963579,null))[_0x93d7('0x29')](removeEntity(_0x963579,null))['catch'](handleError(_0x963579,null));};exports[_0x93d7('0x4e')]=function(_0x43ac54,_0x2f3691){var _0x2d831a={'key':_0x43ac54[_0x93d7('0x4d')][_0x93d7('0x35')]};if(_0x43ac54[_0x93d7('0x4d')][_0x93d7('0x4f')]){_0x2d831a[_0x93d7('0x4f')]=_0x43ac54[_0x93d7('0x4d')][_0x93d7('0x4f')];}else if(_0x43ac54[_0x93d7('0x4d')]['SmsAccountId']){_0x2d831a[_0x93d7('0x50')]=_0x43ac54['body']['SmsAccountId'];}else if(_0x43ac54['body']['OpenchannelAccountId']){_0x2d831a[_0x93d7('0x51')]=_0x43ac54[_0x93d7('0x4d')][_0x93d7('0x51')];}else if(_0x43ac54[_0x93d7('0x4d')][_0x93d7('0x52')]){_0x2d831a['ChatWebsiteId']=_0x43ac54['body'][_0x93d7('0x52')];}return db[_0x93d7('0x31')][_0x93d7('0x4c')]({'where':_0x2d831a})['then'](function(_0x436c2f){if(_0x436c2f){throw new db[(_0x93d7('0x53'))]['ValidationError'](_0x93d7('0x54'));}return db['CannedAnswer']['create'](_0x43ac54['body']);})[_0x93d7('0x29')](function(_0xc15d77){var _0x2107c3=_0x43ac54[_0x93d7('0x55')][_0x93d7('0x2a')]({'plain':!![]});if(!_0x2107c3)throw new Error(_0x93d7('0x56'));if(_0x2107c3[_0x93d7('0x57')]===_0x93d7('0x55')){var _0x51e8b6=_0xc15d77[_0x93d7('0x2a')]({'plain':!![]});return db[_0x93d7('0x58')][_0x93d7('0x4c')]({'where':{'name':_0x93d7('0x59'),'userProfileId':_0x2107c3[_0x93d7('0x5a')]},'raw':!![]})['then'](function(_0x27518a){if(_0x27518a&&_0x27518a[_0x93d7('0x5b')]===0x0){return db[_0x93d7('0x5c')][_0x93d7('0x4e')]({'name':_0x51e8b6[_0x93d7('0x2e')],'resourceId':_0x51e8b6['id'],'type':_0x27518a[_0x93d7('0x2e')],'sectionId':_0x27518a['id']},{})[_0x93d7('0x29')](function(){return _0xc15d77;});}else{return _0xc15d77;}})[_0x93d7('0x47')](function(_0x1a6d92){logger[_0x93d7('0x2c')](_0x93d7('0x5d'),_0x1a6d92);throw _0x1a6d92;});}return _0xc15d77;})[_0x93d7('0x29')](respondWithResult(_0x2f3691,0xc9))[_0x93d7('0x47')](handleError(_0x2f3691,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index d52eb41..209500f 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 _0xc366=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','rimraf','../../config/environment','./cannedAnswer.attributes','CannedAnswer','tools_canned_answers'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc366,0x1c5));var _0x6c36=function(_0x4fe2dc,_0x2a4d5d){_0x4fe2dc=_0x4fe2dc-0x0;var _0xac84b6=_0xc366[_0x4fe2dc];return _0xac84b6;};'use strict';var _=require(_0x6c36('0x0'));var util=require(_0x6c36('0x1'));var logger=require(_0x6c36('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6c36('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6c36('0x4'));var config=require(_0x6c36('0x5'));var attributes=require(_0x6c36('0x6'));module['exports']=function(_0x24f233,_0x5d1d5e){return _0x24f233['define'](_0x6c36('0x7'),attributes,{'tableName':_0x6c36('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6c36('0x9'),'collate':_0x6c36('0xa')});}; \ No newline at end of file +var _0x96f8=['util','api','bluebird','request-promise','path','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x93a6ee,_0x253344){var _0xb5ee31=function(_0x41cc23){while(--_0x41cc23){_0x93a6ee['push'](_0x93a6ee['shift']());}};_0xb5ee31(++_0x253344);}(_0x96f8,0x1db));var _0x896f=function(_0x44b68f,_0x5313e9){_0x44b68f=_0x44b68f-0x0;var _0x4ee6b8=_0x96f8[_0x44b68f];return _0x4ee6b8;};'use strict';var _=require(_0x896f('0x0'));var util=require(_0x896f('0x1'));var logger=require('../../config/logger')(_0x896f('0x2'));var moment=require('moment');var BPromise=require(_0x896f('0x3'));var rp=require(_0x896f('0x4'));var fs=require('fs');var path=require(_0x896f('0x5'));var rimraf=require('rimraf');var config=require(_0x896f('0x6'));var attributes=require(_0x896f('0x7'));module[_0x896f('0x8')]=function(_0x465f84,_0x453273){return _0x465f84[_0x896f('0x9')](_0x896f('0xa'),attributes,{'tableName':_0x896f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x896f('0xc'),'collate':_0x896f('0xd')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index a2a491c..e9727aa 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(_0x20f1bc,_0x5d1517){var _0x15cef1=function(_0x926a9d){while(--_0x926a9d){_0x20f1bc['push'](_0x20f1bc['shift']());}};_0x15cef1(++_0x5d1517);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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(_0x50222c,_0x139e18){var _0x2b01fd=function(_0x2a2cd4){while(--_0x2a2cd4){_0x50222c['push'](_0x50222c['shift']());}};_0x2b01fd(++_0x139e18);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 15bbaac..97a17fa 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 _0xbc78=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','show','post','put','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x47d256,_0x384f2d){var _0x40c53f=function(_0xca0b6f){while(--_0xca0b6f){_0x47d256['push'](_0x47d256['shift']());}};_0x40c53f(++_0x384f2d);}(_0xbc78,0x1ed));var _0x8bc7=function(_0xfb5548,_0xc3760b){_0xfb5548=_0xfb5548-0x0;var _0x2cbe6a=_0xbc78[_0xfb5548];return _0x2cbe6a;};'use strict';var multer=require('multer');var util=require(_0x8bc7('0x0'));var path=require(_0x8bc7('0x1'));var timeout=require(_0x8bc7('0x2'));var express=require(_0x8bc7('0x3'));var router=express[_0x8bc7('0x4')]();var fs_extra=require(_0x8bc7('0x5'));var auth=require(_0x8bc7('0x6'));var interaction=require(_0x8bc7('0x7'));var config=require(_0x8bc7('0x8'));var controller=require(_0x8bc7('0x9'));router[_0x8bc7('0xa')]('/',auth[_0x8bc7('0xb')](),controller[_0x8bc7('0xc')]);router['get']('/:id',auth[_0x8bc7('0xb')](),controller[_0x8bc7('0xd')]);router[_0x8bc7('0xe')]('/',auth[_0x8bc7('0xb')](),controller['create']);router[_0x8bc7('0xf')](_0x8bc7('0x10'),auth[_0x8bc7('0xb')](),controller['update']);router[_0x8bc7('0x11')]('/:id',auth[_0x8bc7('0xb')](),controller[_0x8bc7('0x12')]);module[_0x8bc7('0x13')]=router; \ No newline at end of file +var _0x4d23=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','index','get','show','post','isAuthenticated','create','put','/:id','update','delete','destroy','exports','util','path'];(function(_0x57d7aa,_0x44a62f){var _0xe6f3f2=function(_0x25e1a6){while(--_0x25e1a6){_0x57d7aa['push'](_0x57d7aa['shift']());}};_0xe6f3f2(++_0x44a62f);}(_0x4d23,0x82));var _0x34d2=function(_0xd985de,_0x1a704a){_0xd985de=_0xd985de-0x0;var _0x1d9e79=_0x4d23[_0xd985de];return _0x1d9e79;};'use strict';var multer=require('multer');var util=require(_0x34d2('0x0'));var path=require(_0x34d2('0x1'));var timeout=require(_0x34d2('0x2'));var express=require(_0x34d2('0x3'));var router=express[_0x34d2('0x4')]();var fs_extra=require(_0x34d2('0x5'));var auth=require(_0x34d2('0x6'));var interaction=require(_0x34d2('0x7'));var config=require(_0x34d2('0x8'));var controller=require(_0x34d2('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x34d2('0xa')]);router[_0x34d2('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x34d2('0xc')]);router[_0x34d2('0xd')]('/',auth[_0x34d2('0xe')](),controller[_0x34d2('0xf')]);router[_0x34d2('0x10')](_0x34d2('0x11'),auth[_0x34d2('0xe')](),controller[_0x34d2('0x12')]);router[_0x34d2('0x13')]('/:id',auth[_0x34d2('0xe')](),controller[_0x34d2('0x14')]);module[_0x34d2('0x15')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index a2fd659..9222921 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 _0x57f8=['1970-01-01\x2000:00:01','STRING','INTEGER','exports','DATE'];(function(_0x3b24f8,_0x3dc308){var _0x3e8327=function(_0xbadb7a){while(--_0xbadb7a){_0x3b24f8['push'](_0x3b24f8['shift']());}};_0x3e8327(++_0x3dc308);}(_0x57f8,0x198));var _0x857f=function(_0x304e0e,_0x2654a3){_0x304e0e=_0x304e0e-0x0;var _0x4449c8=_0x57f8[_0x304e0e];return _0x4449c8;};'use strict';var Sequelize=require('sequelize');module[_0x857f('0x0')]={'calldate':{'type':Sequelize[_0x857f('0x1')],'allowNull':![],'defaultValue':_0x857f('0x2')},'clid':{'type':Sequelize[_0x857f('0x3')]},'src':{'type':Sequelize[_0x857f('0x3')]},'dst':{'type':Sequelize[_0x857f('0x3')]},'dcontext':{'type':Sequelize[_0x857f('0x3')]},'channel':{'type':Sequelize[_0x857f('0x3')]},'dstchannel':{'type':Sequelize[_0x857f('0x3')]},'lastapp':{'type':Sequelize[_0x857f('0x3')]},'lastdata':{'type':Sequelize[_0x857f('0x3')]},'duration':{'type':Sequelize[_0x857f('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x857f('0x3')]},'amaflags':{'type':Sequelize[_0x857f('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x857f('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x857f('0x3')]},'linkedid':{'type':Sequelize[_0x857f('0x3')]},'sequence':{'type':Sequelize[_0x857f('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x857f('0x3')]},'tag':{'type':Sequelize[_0x857f('0x3')]}}; \ No newline at end of file +var _0x117d=['STRING','INTEGER','sequelize','exports','DATE'];(function(_0x52538f,_0x203635){var _0x12d71b=function(_0x10486b){while(--_0x10486b){_0x52538f['push'](_0x52538f['shift']());}};_0x12d71b(++_0x203635);}(_0x117d,0xac));var _0xd117=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x117d[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xd117('0x0'));module[_0xd117('0x1')]={'calldate':{'type':Sequelize[_0xd117('0x2')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0xd117('0x3')]},'src':{'type':Sequelize[_0xd117('0x3')]},'dst':{'type':Sequelize[_0xd117('0x3')]},'dcontext':{'type':Sequelize[_0xd117('0x3')]},'channel':{'type':Sequelize[_0xd117('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xd117('0x3')]},'lastdata':{'type':Sequelize[_0xd117('0x3')]},'duration':{'type':Sequelize[_0xd117('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xd117('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xd117('0x3')]},'userfield':{'type':Sequelize[_0xd117('0x3')]},'uniqueid':{'type':Sequelize[_0xd117('0x3')]},'linkedid':{'type':Sequelize[_0xd117('0x3')]},'sequence':{'type':Sequelize[_0xd117('0x3')]},'peeraccount':{'type':Sequelize[_0xd117('0x3')]},'type':{'type':Sequelize[_0xd117('0x3')]},'tag':{'type':Sequelize[_0xd117('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index ca1a40a..1632751 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 _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','Cdr','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x55ca,0x126));var _0xa55c=function(_0x38080e,_0x95512d){_0x38080e=_0x38080e-0x0;var _0x4e4c87=_0x55ca[_0x38080e];return _0x4e4c87;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['Cdr'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file +var _0x6c32=['name','send','index','map','Cdr','rawAttributes','fieldName','type','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','intersection','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','save','update','destroy','then','error'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x6c32,0x6e));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x26c3('0x0'));var rimraf=require(_0x26c3('0x1'));var zipdir=require(_0x26c3('0x2'));var jsonpatch=require(_0x26c3('0x3'));var rp=require(_0x26c3('0x4'));var moment=require(_0x26c3('0x5'));var BPromise=require(_0x26c3('0x6'));var Mustache=require(_0x26c3('0x7'));var util=require(_0x26c3('0x8'));var path=require('path');var sox=require(_0x26c3('0x9'));var csv=require(_0x26c3('0xa'));var ejs=require(_0x26c3('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x26c3('0xc'));var squel=require('squel');var crypto=require(_0x26c3('0xd'));var jsforce=require(_0x26c3('0xe'));var deskjs=require(_0x26c3('0xf'));var toCsv=require(_0x26c3('0xa'));var querystring=require(_0x26c3('0x10'));var Papa=require(_0x26c3('0x11'));var Redis=require(_0x26c3('0x12'));var authService=require(_0x26c3('0x13'));var qs=require(_0x26c3('0x14'));var as=require(_0x26c3('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x26c3('0x16'));var licenseUtil=require(_0x26c3('0x17'));var db=require(_0x26c3('0x18'))['db'];function respondWithStatusCode(_0x457fc9,_0x4b8d92){_0x4b8d92=_0x4b8d92||0xcc;return function(_0x4c7b94){if(_0x4c7b94){return _0x457fc9[_0x26c3('0x19')](_0x4b8d92);}return _0x457fc9[_0x26c3('0x1a')](_0x4b8d92)[_0x26c3('0x1b')]();};}function respondWithResult(_0x3cd3c7,_0x17c399){_0x17c399=_0x17c399||0xc8;return function(_0x568d0b){if(_0x568d0b){return _0x3cd3c7['status'](_0x17c399)[_0x26c3('0x1c')](_0x568d0b);}};}function respondWithFilteredResult(_0xc14c69,_0x4f4256){return function(_0x4ed7c1){if(_0x4ed7c1){var _0x124cb3=typeof _0x4f4256['offset']===_0x26c3('0x1d')&&typeof _0x4f4256['limit']==='undefined';var _0x3931d5=_0x4ed7c1['count'];var _0x38fe17=_0x124cb3?0x0:_0x4f4256['offset'];var _0x170039=_0x124cb3?_0x4ed7c1[_0x26c3('0x1e')]:_0x4f4256[_0x26c3('0x1f')]+_0x4f4256[_0x26c3('0x20')];var _0x20317d;if(_0x170039>=_0x3931d5){_0x170039=_0x3931d5;_0x20317d=0xc8;}else{_0x20317d=0xce;}_0xc14c69['status'](_0x20317d);return _0xc14c69['set'](_0x26c3('0x21'),_0x38fe17+'-'+_0x170039+'/'+_0x3931d5)[_0x26c3('0x1c')](_0x4ed7c1);}return null;};}function patchUpdates(_0x480b76){return function(_0x5344e7){try{jsonpatch[_0x26c3('0x22')](_0x5344e7,_0x480b76,!![]);}catch(_0x5c2f7d){return BPromise['reject'](_0x5c2f7d);}return _0x5344e7[_0x26c3('0x23')]();};}function saveUpdates(_0x4eb863,_0x21034d){return function(_0x4a76b5){if(_0x4a76b5){return _0x4a76b5[_0x26c3('0x24')](_0x4eb863)['then'](function(_0x449548){return _0x449548;});}return null;};}function removeEntity(_0x146b69,_0x2f1648){return function(_0xdc0f2c){if(_0xdc0f2c){return _0xdc0f2c[_0x26c3('0x25')]()[_0x26c3('0x26')](function(){_0x146b69[_0x26c3('0x1a')](0xcc)[_0x26c3('0x1b')]();});}};}function handleEntityNotFound(_0x85a057,_0x3f6a18){return function(_0x52dae1){if(!_0x52dae1){_0x85a057[_0x26c3('0x19')](0x194);}return _0x52dae1;};}function handleError(_0x4c7696,_0x50d85e){_0x50d85e=_0x50d85e||0x1f4;return function(_0x44b4f8){logger[_0x26c3('0x27')](_0x44b4f8['stack']);if(_0x44b4f8[_0x26c3('0x28')]){delete _0x44b4f8['name'];}_0x4c7696[_0x26c3('0x1a')](_0x50d85e)[_0x26c3('0x29')](_0x44b4f8);};}exports[_0x26c3('0x2a')]=function(_0x130fcc,_0x3dbda5){var _0x50cd11={},_0x1d3331={},_0x27f556={'count':0x0,'rows':[]};var _0xebb766=_[_0x26c3('0x2b')](db[_0x26c3('0x2c')][_0x26c3('0x2d')],function(_0x5557b8){return{'name':_0x5557b8[_0x26c3('0x2e')],'type':_0x5557b8[_0x26c3('0x2f')][_0x26c3('0x30')]};});_0x1d3331['model']=_[_0x26c3('0x2b')](_0xebb766,_0x26c3('0x28'));_0x1d3331[_0x26c3('0x31')]=_[_0x26c3('0x32')](_0x130fcc[_0x26c3('0x31')]);_0x1d3331[_0x26c3('0x33')]=_['intersection'](_0x1d3331[_0x26c3('0x34')],_0x1d3331[_0x26c3('0x31')]);_0x50cd11['attributes']=_['intersection'](_0x1d3331['model'],qs['fields'](_0x130fcc['query'][_0x26c3('0x35')]));_0x50cd11[_0x26c3('0x36')]=_0x50cd11['attributes'][_0x26c3('0x37')]?_0x50cd11[_0x26c3('0x36')]:_0x1d3331['model'];if(!_0x130fcc['query'][_0x26c3('0x38')]('nolimit')){_0x50cd11[_0x26c3('0x20')]=qs['limit'](_0x130fcc[_0x26c3('0x31')][_0x26c3('0x20')]);_0x50cd11[_0x26c3('0x1f')]=qs[_0x26c3('0x1f')](_0x130fcc[_0x26c3('0x31')]['offset']);}_0x50cd11[_0x26c3('0x39')]=qs[_0x26c3('0x3a')](_0x130fcc[_0x26c3('0x31')][_0x26c3('0x3a')]);_0x50cd11[_0x26c3('0x3b')]=qs[_0x26c3('0x33')](_['pick'](_0x130fcc['query'],_0x1d3331[_0x26c3('0x33')]),_0xebb766);if(_0x130fcc[_0x26c3('0x31')][_0x26c3('0x3c')]){_0x50cd11[_0x26c3('0x3b')]=_[_0x26c3('0x3d')](_0x50cd11['where'],{'$or':_['map'](_0xebb766,function(_0x4c2df1){if(_0x4c2df1[_0x26c3('0x2f')]!==_0x26c3('0x3e')){var _0x832ef2={};_0x832ef2[_0x4c2df1[_0x26c3('0x28')]]={'$like':'%'+_0x130fcc[_0x26c3('0x31')]['filter']+'%'};return _0x832ef2;}})});}_0x50cd11=_['merge']({},_0x50cd11,_0x130fcc[_0x26c3('0x3f')]);var _0x16e680={'where':_0x50cd11[_0x26c3('0x3b')]};return db[_0x26c3('0x2c')]['count'](_0x16e680)[_0x26c3('0x26')](function(_0x2b4bdf){_0x27f556[_0x26c3('0x1e')]=_0x2b4bdf;if(_0x130fcc[_0x26c3('0x31')][_0x26c3('0x40')]){_0x50cd11[_0x26c3('0x41')]=[{'all':!![]}];}return db[_0x26c3('0x2c')][_0x26c3('0x42')](_0x50cd11);})[_0x26c3('0x26')](function(_0x1c0d6c){_0x27f556[_0x26c3('0x43')]=_0x1c0d6c;return _0x27f556;})[_0x26c3('0x26')](respondWithFilteredResult(_0x3dbda5,_0x50cd11))[_0x26c3('0x44')](handleError(_0x3dbda5,null));};exports['show']=function(_0x2f775b,_0x2ecb43){var _0xfb596a={'raw':!![],'where':{'id':_0x2f775b[_0x26c3('0x45')]['id']}},_0x46ebfb={};_0x46ebfb[_0x26c3('0x34')]=_['keys'](db[_0x26c3('0x2c')]['rawAttributes']);_0x46ebfb[_0x26c3('0x31')]=_['keys'](_0x2f775b[_0x26c3('0x31')]);_0x46ebfb[_0x26c3('0x33')]=_['intersection'](_0x46ebfb[_0x26c3('0x34')],_0x46ebfb[_0x26c3('0x31')]);_0xfb596a[_0x26c3('0x36')]=_[_0x26c3('0x46')](_0x46ebfb[_0x26c3('0x34')],qs['fields'](_0x2f775b[_0x26c3('0x31')]['fields']));_0xfb596a[_0x26c3('0x36')]=_0xfb596a['attributes']['length']?_0xfb596a[_0x26c3('0x36')]:_0x46ebfb[_0x26c3('0x34')];if(_0x2f775b[_0x26c3('0x31')]['includeAll']){_0xfb596a[_0x26c3('0x41')]=[{'all':!![]}];}_0xfb596a=_[_0x26c3('0x3d')]({},_0xfb596a,_0x2f775b[_0x26c3('0x3f')]);return db[_0x26c3('0x2c')][_0x26c3('0x47')](_0xfb596a)[_0x26c3('0x26')](handleEntityNotFound(_0x2ecb43,null))['then'](respondWithResult(_0x2ecb43,null))[_0x26c3('0x44')](handleError(_0x2ecb43,null));};exports[_0x26c3('0x48')]=function(_0x378982,_0x133cf7){return db['Cdr'][_0x26c3('0x48')](_0x378982[_0x26c3('0x49')],{})['then'](respondWithResult(_0x133cf7,0xc9))[_0x26c3('0x44')](handleError(_0x133cf7,null));};exports[_0x26c3('0x24')]=function(_0x522fe2,_0x4566ab){if(_0x522fe2['body']['id']){delete _0x522fe2[_0x26c3('0x49')]['id'];}return db[_0x26c3('0x2c')][_0x26c3('0x47')]({'where':{'id':_0x522fe2[_0x26c3('0x45')]['id']}})[_0x26c3('0x26')](handleEntityNotFound(_0x4566ab,null))[_0x26c3('0x26')](saveUpdates(_0x522fe2[_0x26c3('0x49')],null))['then'](respondWithResult(_0x4566ab,null))[_0x26c3('0x44')](handleError(_0x4566ab,null));};exports['destroy']=function(_0x4ada42,_0x3b3e31){return db[_0x26c3('0x2c')][_0x26c3('0x47')]({'where':{'id':_0x4ada42['params']['id']}})['then'](handleEntityNotFound(_0x3b3e31,null))[_0x26c3('0x26')](removeEntity(_0x3b3e31,null))[_0x26c3('0x44')](handleError(_0x3b3e31,null));};exports[_0x26c3('0x4a')]=function(_0x4d1ec7,_0x446453){return db[_0x26c3('0x2c')][_0x26c3('0x4a')]()['then'](respondWithResult(_0x446453,null))[_0x26c3('0x44')](handleError(_0x446453,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index a9ea052..dd55244 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(_0x41920b,_0x213cb6){var _0x5b3099=function(_0x3c2653){while(--_0x3c2653){_0x41920b['push'](_0x41920b['shift']());}};_0x5b3099(++_0x213cb6);}(_0x7a54,0x106));var _0x47a5=function(_0xd63678,_0x38f3c3){_0xd63678=_0xd63678-0x0;var _0x41c3cc=_0x7a54[_0xd63678];return _0x41c3cc;};'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(_0x581f97,_0x122d3f){var _0xd67f57=function(_0x305f8d){while(--_0x305f8d){_0x581f97['push'](_0x581f97['shift']());}};_0xd67f57(++_0x122d3f);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 08d5cde..8e998c7 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 _0x7745=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x144c0c,_0x113cfe){var _0x436221=function(_0x231dd7){while(--_0x231dd7){_0x144c0c['push'](_0x144c0c['shift']());}};_0x436221(++_0x113cfe);}(_0x7745,0x15a));var _0x5774=function(_0x25248b,_0x3c8491){_0x25248b=_0x25248b-0x0;var _0x509939=_0x7745[_0x25248b];return _0x509939;};'use strict';var _=require(_0x5774('0x0'));var util=require(_0x5774('0x1'));var moment=require(_0x5774('0x2'));var BPromise=require(_0x5774('0x3'));var rs=require(_0x5774('0x4'));var fs=require('fs');var Redis=require(_0x5774('0x5'));var db=require(_0x5774('0x6'))['db'];var utils=require(_0x5774('0x7'));var logger=require(_0x5774('0x8'))(_0x5774('0x9'));var config=require(_0x5774('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x5774('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5151a8,_0x333bad,_0x500341){return new BPromise(function(_0x4f759e,_0x12c5ff){return client['request'](_0x5151a8,_0x500341)[_0x5774('0xc')](function(_0x3726e1){logger[_0x5774('0xd')](_0x5774('0xe'),_0x333bad,_0x5774('0xf'));logger[_0x5774('0x10')](_0x5774('0x11'),_0x333bad,_0x5774('0xf'),JSON['stringify'](_0x3726e1));if(_0x3726e1[_0x5774('0x12')]){if(_0x3726e1['error'][_0x5774('0x13')]===0x1f4){logger[_0x5774('0x12')](_0x5774('0xe'),_0x333bad,_0x3726e1[_0x5774('0x12')][_0x5774('0x14')]);return _0x12c5ff(_0x3726e1['error'][_0x5774('0x14')]);}logger[_0x5774('0x12')](_0x5774('0xe'),_0x333bad,_0x3726e1[_0x5774('0x12')][_0x5774('0x14')]);return _0x4f759e(_0x3726e1[_0x5774('0x12')][_0x5774('0x14')]);}else{logger[_0x5774('0xd')](_0x5774('0xe'),_0x333bad,_0x5774('0xf'));_0x4f759e(_0x3726e1[_0x5774('0x15')]['message']);}})[_0x5774('0x16')](function(_0x4a0a32){logger[_0x5774('0x12')]('Cdr,\x20%s,\x20%s',_0x333bad,_0x4a0a32);_0x12c5ff(_0x4a0a32);});});} \ No newline at end of file +var _0x9e65=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xeba6a7,_0x587d8c){var _0x4f52a6=function(_0x371b2d){while(--_0x371b2d){_0xeba6a7['push'](_0xeba6a7['shift']());}};_0x4f52a6(++_0x587d8c);}(_0x9e65,0x170));var _0x59e6=function(_0x50c00a,_0x2afdb8){_0x50c00a=_0x50c00a-0x0;var _0x37e299=_0x9e65[_0x50c00a];return _0x37e299;};'use strict';var _=require(_0x59e6('0x0'));var util=require('util');var moment=require(_0x59e6('0x1'));var BPromise=require('bluebird');var rs=require(_0x59e6('0x2'));var fs=require('fs');var Redis=require(_0x59e6('0x3'));var db=require(_0x59e6('0x4'))['db'];var utils=require(_0x59e6('0x5'));var logger=require(_0x59e6('0x6'))(_0x59e6('0x7'));var config=require(_0x59e6('0x8'));var jayson=require(_0x59e6('0x9'));var client=jayson[_0x59e6('0xa')][_0x59e6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b0c2c,_0x36e922,_0x24ce33){return new BPromise(function(_0x57525a,_0x495791){return client[_0x59e6('0xc')](_0x4b0c2c,_0x24ce33)[_0x59e6('0xd')](function(_0x33b616){logger[_0x59e6('0xe')](_0x59e6('0xf'),_0x36e922,_0x59e6('0x10'));logger[_0x59e6('0x11')]('Cdr,\x20%s,\x20%s,\x20%s',_0x36e922,_0x59e6('0x10'),JSON[_0x59e6('0x12')](_0x33b616));if(_0x33b616[_0x59e6('0x13')]){if(_0x33b616['error']['code']===0x1f4){logger[_0x59e6('0x13')](_0x59e6('0xf'),_0x36e922,_0x33b616[_0x59e6('0x13')]['message']);return _0x495791(_0x33b616[_0x59e6('0x13')][_0x59e6('0x14')]);}logger[_0x59e6('0x13')](_0x59e6('0xf'),_0x36e922,_0x33b616['error'][_0x59e6('0x14')]);return _0x57525a(_0x33b616[_0x59e6('0x13')][_0x59e6('0x14')]);}else{logger[_0x59e6('0xe')](_0x59e6('0xf'),_0x36e922,_0x59e6('0x10'));_0x57525a(_0x33b616['result']['message']);}})[_0x59e6('0x15')](function(_0x2d67ee){logger['error'](_0x59e6('0xf'),_0x36e922,_0x2d67ee);_0x495791(_0x2d67ee);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 3f08cab..89b2de3 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 _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x59c366,_0x153fb5){var _0x467fd4=function(_0x30f38b){while(--_0x30f38b){_0x59c366['push'](_0x59c366['shift']());}};_0x467fd4(++_0x153fb5);}(_0xb10b,0x12a));var _0xbb10=function(_0x39106e,_0x586f3d){_0x39106e=_0x39106e-0x0;var _0x892aec=_0xb10b[_0x39106e];return _0x892aec;};'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 +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(_0x56b794,_0x50003f){var _0x80c80=function(_0x54dc03){while(--_0x54dc03){_0x56b794['push'](_0x56b794['shift']());}};_0x80c80(++_0x50003f);}(_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 diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 5cd460a..29e14c0 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 _0x7719=['exports','INTEGER','STRING','noop','TEXT'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x7719,0x9b));var _0x9771=function(_0x4f1de8,_0x1452c2){_0x4f1de8=_0x4f1de8-0x0;var _0x306d47=_0x7719[_0x4f1de8];return _0x306d47;};'use strict';var Sequelize=require('sequelize');module[_0x9771('0x0')]={'priority':{'type':Sequelize[_0x9771('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x9771('0x2')],'allowNull':![],'defaultValue':_0x9771('0x3')},'appdata':{'type':Sequelize[_0x9771('0x4')]()},'description':{'type':Sequelize[_0x9771('0x2')]},'interval':{'type':Sequelize[_0x9771('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x9ee3=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize','exports'];(function(_0x333767,_0x3e6f9c){var _0x51661b=function(_0x46e5d6){while(--_0x46e5d6){_0x333767['push'](_0x333767['shift']());}};_0x51661b(++_0x3e6f9c);}(_0x9ee3,0x11d));var _0x39ee=function(_0x1de9a2,_0x38b784){_0x1de9a2=_0x1de9a2-0x0;var _0x2ca2b4=_0x9ee3[_0x1de9a2];return _0x2ca2b4;};'use strict';var Sequelize=require(_0x39ee('0x0'));module[_0x39ee('0x1')]={'priority':{'type':Sequelize[_0x39ee('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x39ee('0x3')],'allowNull':![],'defaultValue':_0x39ee('0x4')},'appdata':{'type':Sequelize[_0x39ee('0x5')]()},'description':{'type':Sequelize[_0x39ee('0x3')]},'interval':{'type':Sequelize[_0x39ee('0x3')],'defaultValue':_0x39ee('0x6')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 14f604d..858e60f 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 _0x43b1=['fields','length','includeAll','include','merge','then','catch','body','find','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','name','show','params','model','keys','ChatApplication','filters','intersection','query','attributes'];(function(_0x29771f,_0x1189ae){var _0x279baf=function(_0xd66325){while(--_0xd66325){_0x29771f['push'](_0x29771f['shift']());}};_0x279baf(++_0x1189ae);}(_0x43b1,0x7d));var _0x143b=function(_0x279298,_0x4f589b){_0x279298=_0x279298-0x0;var _0x10f64e=_0x43b1[_0x279298];return _0x10f64e;};'use strict';var emlformat=require(_0x143b('0x0'));var rimraf=require(_0x143b('0x1'));var zipdir=require(_0x143b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x143b('0x3'));var moment=require('moment');var BPromise=require(_0x143b('0x4'));var Mustache=require(_0x143b('0x5'));var util=require(_0x143b('0x6'));var path=require(_0x143b('0x7'));var sox=require(_0x143b('0x8'));var csv=require(_0x143b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x143b('0xa'));var _=require(_0x143b('0xb'));var squel=require(_0x143b('0xc'));var crypto=require('crypto');var jsforce=require(_0x143b('0xd'));var deskjs=require(_0x143b('0xe'));var toCsv=require(_0x143b('0x9'));var querystring=require(_0x143b('0xf'));var Papa=require(_0x143b('0x10'));var Redis=require(_0x143b('0x11'));var authService=require(_0x143b('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x143b('0x13'));var hardwareService=require(_0x143b('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x143b('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x143b('0x16'));var db=require(_0x143b('0x17'))['db'];function respondWithStatusCode(_0x52429f,_0x2d6c07){_0x2d6c07=_0x2d6c07||0xcc;return function(_0x1ef389){if(_0x1ef389){return _0x52429f[_0x143b('0x18')](_0x2d6c07);}return _0x52429f[_0x143b('0x19')](_0x2d6c07)[_0x143b('0x1a')]();};}function respondWithResult(_0x34cd9b,_0x1325c3){_0x1325c3=_0x1325c3||0xc8;return function(_0x40ce06){if(_0x40ce06){return _0x34cd9b[_0x143b('0x19')](_0x1325c3)[_0x143b('0x1b')](_0x40ce06);}};}function respondWithFilteredResult(_0x2bca2c,_0x3cc649){return function(_0x2d746a){if(_0x2d746a){var _0x133603=typeof _0x3cc649[_0x143b('0x1c')]===_0x143b('0x1d')&&typeof _0x3cc649[_0x143b('0x1e')]==='undefined';var _0x520197=_0x2d746a[_0x143b('0x1f')];var _0x244ba8=_0x133603?0x0:_0x3cc649[_0x143b('0x1c')];var _0x139aa9=_0x133603?_0x2d746a[_0x143b('0x1f')]:_0x3cc649[_0x143b('0x1c')]+_0x3cc649[_0x143b('0x1e')];var _0x1ca6d2;if(_0x139aa9>=_0x520197){_0x139aa9=_0x520197;_0x1ca6d2=0xc8;}else{_0x1ca6d2=0xce;}_0x2bca2c[_0x143b('0x19')](_0x1ca6d2);return _0x2bca2c[_0x143b('0x20')](_0x143b('0x21'),_0x244ba8+'-'+_0x139aa9+'/'+_0x520197)['json'](_0x2d746a);}return null;};}function patchUpdates(_0x1dd05b){return function(_0x35df37){try{jsonpatch[_0x143b('0x22')](_0x35df37,_0x1dd05b,!![]);}catch(_0xfd9194){return BPromise[_0x143b('0x23')](_0xfd9194);}return _0x35df37[_0x143b('0x24')]();};}function saveUpdates(_0x159ef6,_0x1d5b5b){return function(_0x5d0684){if(_0x5d0684){return _0x5d0684[_0x143b('0x25')](_0x159ef6)['then'](function(_0x2a55fe){return _0x2a55fe;});}return null;};}function removeEntity(_0x5bdebc,_0x549638){return function(_0x56717f){if(_0x56717f){return _0x56717f[_0x143b('0x26')]()['then'](function(){_0x5bdebc['status'](0xcc)[_0x143b('0x1a')]();});}};}function handleEntityNotFound(_0x53c102,_0x35e097){return function(_0x54eca6){if(!_0x54eca6){_0x53c102[_0x143b('0x18')](0x194);}return _0x54eca6;};}function handleError(_0xd30b1,_0x1adf50){_0x1adf50=_0x1adf50||0x1f4;return function(_0x4f5a17){logger['error'](_0x4f5a17['stack']);if(_0x4f5a17['name']){delete _0x4f5a17[_0x143b('0x27')];}_0xd30b1['status'](_0x1adf50)['send'](_0x4f5a17);};}exports[_0x143b('0x28')]=function(_0x37611b,_0x6174a3){var _0x5535b5={'raw':!![],'where':{'id':_0x37611b[_0x143b('0x29')]['id']}},_0xd1aa12={};_0xd1aa12[_0x143b('0x2a')]=_[_0x143b('0x2b')](db[_0x143b('0x2c')]['rawAttributes']);_0xd1aa12['query']=_['keys'](_0x37611b['query']);_0xd1aa12[_0x143b('0x2d')]=_[_0x143b('0x2e')](_0xd1aa12[_0x143b('0x2a')],_0xd1aa12[_0x143b('0x2f')]);_0x5535b5[_0x143b('0x30')]=_[_0x143b('0x2e')](_0xd1aa12[_0x143b('0x2a')],qs[_0x143b('0x31')](_0x37611b[_0x143b('0x2f')][_0x143b('0x31')]));_0x5535b5['attributes']=_0x5535b5[_0x143b('0x30')][_0x143b('0x32')]?_0x5535b5['attributes']:_0xd1aa12['model'];if(_0x37611b[_0x143b('0x2f')][_0x143b('0x33')]){_0x5535b5[_0x143b('0x34')]=[{'all':!![]}];}_0x5535b5=_[_0x143b('0x35')]({},_0x5535b5,_0x37611b['options']);return db['ChatApplication']['find'](_0x5535b5)['then'](handleEntityNotFound(_0x6174a3,null))[_0x143b('0x36')](respondWithResult(_0x6174a3,null))[_0x143b('0x37')](handleError(_0x6174a3,null));};exports[_0x143b('0x25')]=function(_0x54dcb9,_0x1f2eff){if(_0x54dcb9[_0x143b('0x38')]['id']){delete _0x54dcb9[_0x143b('0x38')]['id'];}return db['ChatApplication'][_0x143b('0x39')]({'where':{'id':_0x54dcb9[_0x143b('0x29')]['id']}})[_0x143b('0x36')](handleEntityNotFound(_0x1f2eff,null))['then'](saveUpdates(_0x54dcb9[_0x143b('0x38')],null))[_0x143b('0x36')](respondWithResult(_0x1f2eff,null))['catch'](handleError(_0x1f2eff,null));};exports['destroy']=function(_0x5a8bd8,_0x1388fc){return db[_0x143b('0x2c')]['find']({'where':{'id':_0x5a8bd8[_0x143b('0x29')]['id']}})[_0x143b('0x36')](handleEntityNotFound(_0x1388fc,null))[_0x143b('0x36')](removeEntity(_0x1388fc,null))[_0x143b('0x37')](handleError(_0x1388fc,null));}; \ No newline at end of file +var _0x063c=['json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','end','error','stack','name','show','params','model','keys','rawAttributes','query','intersection','attributes','fields','length','merge','ChatApplication','find','body','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x40e006,_0x43182b){var _0x59c350=function(_0x2af04b){while(--_0x2af04b){_0x40e006['push'](_0x40e006['shift']());}};_0x59c350(++_0x43182b);}(_0x063c,0xba));var _0xc063=function(_0x3091ea,_0x43ce06){_0x3091ea=_0x3091ea-0x0;var _0x4f99e7=_0x063c[_0x3091ea];return _0x4f99e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc063('0x0'));var zipdir=require(_0xc063('0x1'));var jsonpatch=require(_0xc063('0x2'));var rp=require(_0xc063('0x3'));var moment=require(_0xc063('0x4'));var BPromise=require(_0xc063('0x5'));var Mustache=require('mustache');var util=require(_0xc063('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc063('0x7'));var fs=require('fs');var fs_extra=require(_0xc063('0x8'));var _=require('lodash');var squel=require(_0xc063('0x9'));var crypto=require(_0xc063('0xa'));var jsforce=require(_0xc063('0xb'));var deskjs=require(_0xc063('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc063('0xd'));var Papa=require(_0xc063('0xe'));var Redis=require('ioredis');var authService=require(_0xc063('0xf'));var qs=require(_0xc063('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc063('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc063('0x12'));var licenseUtil=require(_0xc063('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8fc3dc,_0x5d0d2a){_0x5d0d2a=_0x5d0d2a||0xcc;return function(_0x14f55e){if(_0x14f55e){return _0x8fc3dc[_0xc063('0x14')](_0x5d0d2a);}return _0x8fc3dc[_0xc063('0x15')](_0x5d0d2a)['end']();};}function respondWithResult(_0x364264,_0x1249b2){_0x1249b2=_0x1249b2||0xc8;return function(_0x21b8da){if(_0x21b8da){return _0x364264[_0xc063('0x15')](_0x1249b2)[_0xc063('0x16')](_0x21b8da);}};}function respondWithFilteredResult(_0x391910,_0xf7fe54){return function(_0xac1724){if(_0xac1724){var _0x3baaeb=typeof _0xf7fe54['offset']===_0xc063('0x17')&&typeof _0xf7fe54[_0xc063('0x18')]==='undefined';var _0x89bb1e=_0xac1724[_0xc063('0x19')];var _0x4dcef1=_0x3baaeb?0x0:_0xf7fe54[_0xc063('0x1a')];var _0x13cc09=_0x3baaeb?_0xac1724[_0xc063('0x19')]:_0xf7fe54[_0xc063('0x1a')]+_0xf7fe54['limit'];var _0x234f33;if(_0x13cc09>=_0x89bb1e){_0x13cc09=_0x89bb1e;_0x234f33=0xc8;}else{_0x234f33=0xce;}_0x391910[_0xc063('0x15')](_0x234f33);return _0x391910[_0xc063('0x1b')]('Content-Range',_0x4dcef1+'-'+_0x13cc09+'/'+_0x89bb1e)[_0xc063('0x16')](_0xac1724);}return null;};}function patchUpdates(_0x5fa053){return function(_0x5741e0){try{jsonpatch[_0xc063('0x1c')](_0x5741e0,_0x5fa053,!![]);}catch(_0x4606eb){return BPromise[_0xc063('0x1d')](_0x4606eb);}return _0x5741e0[_0xc063('0x1e')]();};}function saveUpdates(_0x1ba785,_0x4a82eb){return function(_0x59c960){if(_0x59c960){return _0x59c960['update'](_0x1ba785)[_0xc063('0x1f')](function(_0x552560){return _0x552560;});}return null;};}function removeEntity(_0x4fb406,_0x481a6b){return function(_0x382f79){if(_0x382f79){return _0x382f79[_0xc063('0x20')]()[_0xc063('0x1f')](function(){_0x4fb406[_0xc063('0x15')](0xcc)[_0xc063('0x21')]();});}};}function handleEntityNotFound(_0x49f26e,_0x5a0d10){return function(_0x7317e7){if(!_0x7317e7){_0x49f26e['sendStatus'](0x194);}return _0x7317e7;};}function handleError(_0x36ba5a,_0x43e592){_0x43e592=_0x43e592||0x1f4;return function(_0x7db21a){logger[_0xc063('0x22')](_0x7db21a[_0xc063('0x23')]);if(_0x7db21a[_0xc063('0x24')]){delete _0x7db21a[_0xc063('0x24')];}_0x36ba5a[_0xc063('0x15')](_0x43e592)['send'](_0x7db21a);};}exports[_0xc063('0x25')]=function(_0xb48cc9,_0x5a623d){var _0x3a18bd={'raw':!![],'where':{'id':_0xb48cc9[_0xc063('0x26')]['id']}},_0x3359cd={};_0x3359cd[_0xc063('0x27')]=_[_0xc063('0x28')](db['ChatApplication'][_0xc063('0x29')]);_0x3359cd[_0xc063('0x2a')]=_['keys'](_0xb48cc9['query']);_0x3359cd['filters']=_[_0xc063('0x2b')](_0x3359cd['model'],_0x3359cd[_0xc063('0x2a')]);_0x3a18bd[_0xc063('0x2c')]=_[_0xc063('0x2b')](_0x3359cd[_0xc063('0x27')],qs['fields'](_0xb48cc9[_0xc063('0x2a')][_0xc063('0x2d')]));_0x3a18bd[_0xc063('0x2c')]=_0x3a18bd['attributes'][_0xc063('0x2e')]?_0x3a18bd['attributes']:_0x3359cd[_0xc063('0x27')];if(_0xb48cc9[_0xc063('0x2a')]['includeAll']){_0x3a18bd['include']=[{'all':!![]}];}_0x3a18bd=_[_0xc063('0x2f')]({},_0x3a18bd,_0xb48cc9['options']);return db[_0xc063('0x30')][_0xc063('0x31')](_0x3a18bd)[_0xc063('0x1f')](handleEntityNotFound(_0x5a623d,null))['then'](respondWithResult(_0x5a623d,null))['catch'](handleError(_0x5a623d,null));};exports['update']=function(_0x40fee0,_0x4ee218){if(_0x40fee0[_0xc063('0x32')]['id']){delete _0x40fee0['body']['id'];}return db[_0xc063('0x30')][_0xc063('0x31')]({'where':{'id':_0x40fee0[_0xc063('0x26')]['id']}})[_0xc063('0x1f')](handleEntityNotFound(_0x4ee218,null))['then'](saveUpdates(_0x40fee0[_0xc063('0x32')],null))[_0xc063('0x1f')](respondWithResult(_0x4ee218,null))[_0xc063('0x33')](handleError(_0x4ee218,null));};exports['destroy']=function(_0xcd344b,_0xb6b651){return db[_0xc063('0x30')][_0xc063('0x31')]({'where':{'id':_0xcd344b[_0xc063('0x26')]['id']}})[_0xc063('0x1f')](handleEntityNotFound(_0xb6b651,null))[_0xc063('0x1f')](removeEntity(_0xb6b651,null))[_0xc063('0x33')](handleError(_0xb6b651,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 4574b5d..a5b1d7c 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 _0xec0e=['bluebird','request-promise','rimraf','../../config/environment','./chatApplication.attributes','exports','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xec0e,0x1d1));var _0xeec0=function(_0x61bb05,_0x47421f){_0x61bb05=_0x61bb05-0x0;var _0x3ceb3e=_0xec0e[_0x61bb05];return _0x3ceb3e;};'use strict';var _=require(_0xeec0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xeec0('0x1'));var moment=require(_0xeec0('0x2'));var BPromise=require(_0xeec0('0x3'));var rp=require(_0xeec0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeec0('0x5'));var config=require(_0xeec0('0x6'));var attributes=require(_0xeec0('0x7'));module[_0xeec0('0x8')]=function(_0x20c9a9,_0x830f66){return _0x20c9a9['define']('ChatApplication',attributes,{'tableName':_0xeec0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xeec0('0xa'),'collate':_0xeec0('0xb')});}; \ No newline at end of file +var _0x5d01=['utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications'];(function(_0x434634,_0x2b232d){var _0x5d866b=function(_0x5d2691){while(--_0x5d2691){_0x434634['push'](_0x434634['shift']());}};_0x5d866b(++_0x2b232d);}(_0x5d01,0xe5));var _0x15d0=function(_0x25d33a,_0x3859b9){_0x25d33a=_0x25d33a-0x0;var _0x4ede62=_0x5d01[_0x25d33a];return _0x4ede62;};'use strict';var _=require(_0x15d0('0x0'));var util=require('util');var logger=require(_0x15d0('0x1'))(_0x15d0('0x2'));var moment=require('moment');var BPromise=require(_0x15d0('0x3'));var rp=require(_0x15d0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x15d0('0x5'));var attributes=require(_0x15d0('0x6'));module[_0x15d0('0x7')]=function(_0x1b0e27,_0x2af55d){return _0x1b0e27[_0x15d0('0x8')](_0x15d0('0x9'),attributes,{'tableName':_0x15d0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x15d0('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 00ad176..7c2fb38 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 _0x3301=['request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http'];(function(_0x1e6955,_0x2f6273){var _0x21271e=function(_0xd75f7d){while(--_0xd75f7d){_0x1e6955['push'](_0x1e6955['shift']());}};_0x21271e(++_0x2f6273);}(_0x3301,0x182));var _0x1330=function(_0x5f1b74,_0x498562){_0x5f1b74=_0x5f1b74-0x0;var _0x1fb5a0=_0x3301[_0x5f1b74];return _0x1fb5a0;};'use strict';var _=require(_0x1330('0x0'));var util=require(_0x1330('0x1'));var moment=require(_0x1330('0x2'));var BPromise=require(_0x1330('0x3'));var rs=require(_0x1330('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1330('0x5'))['db'];var utils=require(_0x1330('0x6'));var logger=require(_0x1330('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1330('0x8')][_0x1330('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c8bbf,_0x474b44,_0xc85bdd){return new BPromise(function(_0x69d2e1,_0xc4bec){return client[_0x1330('0xa')](_0x5c8bbf,_0xc85bdd)[_0x1330('0xb')](function(_0x5ad070){logger[_0x1330('0xc')](_0x1330('0xd'),_0x474b44,_0x1330('0xe'));logger[_0x1330('0xf')](_0x1330('0x10'),_0x474b44,_0x1330('0xe'),JSON[_0x1330('0x11')](_0x5ad070));if(_0x5ad070[_0x1330('0x12')]){if(_0x5ad070['error'][_0x1330('0x13')]===0x1f4){logger[_0x1330('0x12')](_0x1330('0xd'),_0x474b44,_0x5ad070[_0x1330('0x12')]['message']);return _0xc4bec(_0x5ad070[_0x1330('0x12')][_0x1330('0x14')]);}logger[_0x1330('0x12')](_0x1330('0xd'),_0x474b44,_0x5ad070[_0x1330('0x12')][_0x1330('0x14')]);return _0x69d2e1(_0x5ad070[_0x1330('0x12')][_0x1330('0x14')]);}else{logger[_0x1330('0xc')](_0x1330('0xd'),_0x474b44,_0x1330('0xe'));_0x69d2e1(_0x5ad070[_0x1330('0x15')][_0x1330('0x14')]);}})['catch'](function(_0x2597f3){logger['error'](_0x1330('0xd'),_0x474b44,_0x2597f3);_0xc4bec(_0x2597f3);});});} \ No newline at end of file +var _0xe0fe=['http','request','then','info','request\x20sent','debug','stringify','error','code','message','ChatApplication,\x20%s,\x20%s','result','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x144efb,_0x1e9c15){var _0x3b7832=function(_0x9a6cd){while(--_0x9a6cd){_0x144efb['push'](_0x144efb['shift']());}};_0x3b7832(++_0x1e9c15);}(_0xe0fe,0x108));var _0xee0f=function(_0x166614,_0x548d47){_0x166614=_0x166614-0x0;var _0x4a1307=_0xe0fe[_0x166614];return _0x4a1307;};'use strict';var _=require(_0xee0f('0x0'));var util=require(_0xee0f('0x1'));var moment=require(_0xee0f('0x2'));var BPromise=require(_0xee0f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xee0f('0x4'));var logger=require('../../config/logger')(_0xee0f('0x5'));var config=require(_0xee0f('0x6'));var jayson=require(_0xee0f('0x7'));var client=jayson[_0xee0f('0x8')][_0xee0f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa63d33,_0x36c4ea,_0x314cf6){return new BPromise(function(_0x4d7ee0,_0x440dc9){return client[_0xee0f('0xa')](_0xa63d33,_0x314cf6)[_0xee0f('0xb')](function(_0x5594cd){logger[_0xee0f('0xc')]('ChatApplication,\x20%s,\x20%s',_0x36c4ea,_0xee0f('0xd'));logger[_0xee0f('0xe')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x36c4ea,_0xee0f('0xd'),JSON[_0xee0f('0xf')](_0x5594cd));if(_0x5594cd[_0xee0f('0x10')]){if(_0x5594cd[_0xee0f('0x10')][_0xee0f('0x11')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x36c4ea,_0x5594cd[_0xee0f('0x10')][_0xee0f('0x12')]);return _0x440dc9(_0x5594cd['error'][_0xee0f('0x12')]);}logger[_0xee0f('0x10')](_0xee0f('0x13'),_0x36c4ea,_0x5594cd[_0xee0f('0x10')][_0xee0f('0x12')]);return _0x4d7ee0(_0x5594cd[_0xee0f('0x10')][_0xee0f('0x12')]);}else{logger[_0xee0f('0xc')](_0xee0f('0x13'),_0x36c4ea,_0xee0f('0xd'));_0x4d7ee0(_0x5594cd[_0xee0f('0x14')][_0xee0f('0x12')]);}})['catch'](function(_0x3590a5){logger[_0xee0f('0x10')](_0xee0f('0x13'),_0x36c4ea,_0x3590a5);_0x440dc9(_0x3590a5);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 45adeb3..0632e1f 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 _0x373d=['destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','show','/:id','isAuthenticated'];(function(_0x492c02,_0x177429){var _0x403eda=function(_0x3dbb0f){while(--_0x3dbb0f){_0x492c02['push'](_0x492c02['shift']());}};_0x403eda(++_0x177429);}(_0x373d,0xb8));var _0xd373=function(_0x42f7cd,_0x1c47b7){_0x42f7cd=_0x42f7cd-0x0;var _0x514f16=_0x373d[_0x42f7cd];return _0x514f16;};'use strict';var multer=require(_0xd373('0x0'));var util=require('util');var path=require(_0xd373('0x1'));var timeout=require(_0xd373('0x2'));var express=require('express');var router=express[_0xd373('0x3')]();var fs_extra=require(_0xd373('0x4'));var auth=require(_0xd373('0x5'));var interaction=require(_0xd373('0x6'));var config=require(_0xd373('0x7'));var controller=require(_0xd373('0x8'));router['get']('/:id',auth['isAuthenticated'](),controller[_0xd373('0x9')]);router['put'](_0xd373('0xa'),auth[_0xd373('0xb')](),controller['update']);router['delete'](_0xd373('0xa'),auth['isAuthenticated'](),controller[_0xd373('0xc')]);module[_0xd373('0xd')]=router; \ No newline at end of file +var _0xd2ca=['fs-extra','../../components/auth/service','get','/:id','isAuthenticated','show','put','update','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xd2ca,0x1cb));var _0xad2c=function(_0x4c4c82,_0x24a215){_0x4c4c82=_0x4c4c82-0x0;var _0xab2ece=_0xd2ca[_0x4c4c82];return _0xab2ece;};'use strict';var multer=require(_0xad2c('0x0'));var util=require(_0xad2c('0x1'));var path=require(_0xad2c('0x2'));var timeout=require(_0xad2c('0x3'));var express=require(_0xad2c('0x4'));var router=express[_0xad2c('0x5')]();var fs_extra=require(_0xad2c('0x6'));var auth=require(_0xad2c('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatApplication.controller');router[_0xad2c('0x8')](_0xad2c('0x9'),auth[_0xad2c('0xa')](),controller[_0xad2c('0xb')]);router[_0xad2c('0xc')](_0xad2c('0x9'),auth[_0xad2c('0xa')](),controller[_0xad2c('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xad2c('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index a822099..550e978 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 _0x4a9a=['exports','STRING','BOOLEAN'];(function(_0x1233d2,_0x5416f4){var _0x22759e=function(_0xb516aa){while(--_0xb516aa){_0x1233d2['push'](_0x1233d2['shift']());}};_0x22759e(++_0x5416f4);}(_0x4a9a,0x123));var _0xa4a9=function(_0x3f9951,_0x4bf5d0){_0x3f9951=_0x3f9951-0x0;var _0x11eae7=_0x4a9a[_0x3f9951];return _0x11eae7;};'use strict';var Sequelize=require('sequelize');module[_0xa4a9('0x0')]={'name':{'type':Sequelize[_0xa4a9('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xa4a9('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x94aa=['BOOLEAN','sequelize'];(function(_0x5a92ad,_0x2219a6){var _0x2466f8=function(_0x4ad04e){while(--_0x4ad04e){_0x5a92ad['push'](_0x5a92ad['shift']());}};_0x2466f8(++_0x2219a6);}(_0x94aa,0x65));var _0xa94a=function(_0x5bee26,_0x3d4891){_0x5bee26=_0x5bee26-0x0;var _0x557587=_0x94aa[_0x5bee26];return _0x557587;};'use strict';var Sequelize=require(_0xa94a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xa94a('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 21c6710..69f9012 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 _0x49b6=['filters','pick','filter','merge','options','ChatGroup','catch','show','includeAll','include','create','body','find','params','describe','getUnread','ChatInternalMessage','toInteger','addMembers','omit','ids','getMembers','User','removeMembers','addMessage','ChatGroupId','$gte','split','format','getMessages','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','send','index','map','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x1708e8,_0x11f822){var _0x5a305f=function(_0xa045d0){while(--_0xa045d0){_0x1708e8['push'](_0x1708e8['shift']());}};_0x5a305f(++_0x11f822);}(_0x49b6,0x1ea));var _0x649b=function(_0x15fe68,_0xddc145){_0x15fe68=_0x15fe68-0x0;var _0x1d144c=_0x49b6[_0x15fe68];return _0x1d144c;};'use strict';var emlformat=require(_0x649b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x649b('0x1'));var jsonpatch=require(_0x649b('0x2'));var rp=require(_0x649b('0x3'));var moment=require(_0x649b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x649b('0x5'));var path=require(_0x649b('0x6'));var sox=require(_0x649b('0x7'));var csv=require(_0x649b('0x8'));var ejs=require(_0x649b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x649b('0xa'));var squel=require(_0x649b('0xb'));var crypto=require(_0x649b('0xc'));var jsforce=require(_0x649b('0xd'));var deskjs=require(_0x649b('0xe'));var toCsv=require(_0x649b('0x8'));var querystring=require(_0x649b('0xf'));var Papa=require('papaparse');var Redis=require(_0x649b('0x10'));var authService=require(_0x649b('0x11'));var qs=require(_0x649b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x649b('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x649b('0x14'));var config=require(_0x649b('0x15'));var licenseUtil=require(_0x649b('0x16'));var db=require(_0x649b('0x17'))['db'];config[_0x649b('0x18')]=_['defaults'](config[_0x649b('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x649b('0x19'))(new Redis(config[_0x649b('0x18')]));require('./chatGroup.socket')[_0x649b('0x1a')](socket);function respondWithStatusCode(_0x41b3eb,_0x1c7a13){_0x1c7a13=_0x1c7a13||0xcc;return function(_0xd9d95e){if(_0xd9d95e){return _0x41b3eb[_0x649b('0x1b')](_0x1c7a13);}return _0x41b3eb[_0x649b('0x1c')](_0x1c7a13)[_0x649b('0x1d')]();};}function respondWithResult(_0x45bc63,_0x28b4f0){_0x28b4f0=_0x28b4f0||0xc8;return function(_0x40ba96){if(_0x40ba96){return _0x45bc63[_0x649b('0x1c')](_0x28b4f0)[_0x649b('0x1e')](_0x40ba96);}};}function respondWithFilteredResult(_0x5ec263,_0x7db0de){return function(_0xd36fe){if(_0xd36fe){var _0x44b458=typeof _0x7db0de[_0x649b('0x1f')]==='undefined'&&typeof _0x7db0de[_0x649b('0x20')]===_0x649b('0x21');var _0x342ce7=_0xd36fe[_0x649b('0x22')];var _0x2eda80=_0x44b458?0x0:_0x7db0de[_0x649b('0x1f')];var _0xecdc2b=_0x44b458?_0xd36fe[_0x649b('0x22')]:_0x7db0de[_0x649b('0x1f')]+_0x7db0de[_0x649b('0x20')];var _0x128190;if(_0xecdc2b>=_0x342ce7){_0xecdc2b=_0x342ce7;_0x128190=0xc8;}else{_0x128190=0xce;}_0x5ec263[_0x649b('0x1c')](_0x128190);return _0x5ec263[_0x649b('0x23')](_0x649b('0x24'),_0x2eda80+'-'+_0xecdc2b+'/'+_0x342ce7)[_0x649b('0x1e')](_0xd36fe);}return null;};}function patchUpdates(_0x3d6b31){return function(_0x2424d9){try{jsonpatch[_0x649b('0x25')](_0x2424d9,_0x3d6b31,!![]);}catch(_0x386c8b){return BPromise[_0x649b('0x26')](_0x386c8b);}return _0x2424d9[_0x649b('0x27')]();};}function saveUpdates(_0x120f61,_0xc51f0b){return function(_0x45ed78){if(_0x45ed78){return _0x45ed78[_0x649b('0x28')](_0x120f61)[_0x649b('0x29')](function(_0x224011){return _0x224011;});}return null;};}function removeEntity(_0x483057,_0x585190){return function(_0x57d85f){if(_0x57d85f){return _0x57d85f[_0x649b('0x2a')]()[_0x649b('0x29')](function(){_0x483057[_0x649b('0x1c')](0xcc)[_0x649b('0x1d')]();});}};}function handleEntityNotFound(_0x3207f1,_0x47aac7){return function(_0x315476){if(!_0x315476){_0x3207f1[_0x649b('0x1b')](0x194);}return _0x315476;};}function handleError(_0x1c6b36,_0x2aac47){_0x2aac47=_0x2aac47||0x1f4;return function(_0x2b90b4){logger[_0x649b('0x2b')](_0x2b90b4[_0x649b('0x2c')]);if(_0x2b90b4['name']){delete _0x2b90b4['name'];}_0x1c6b36[_0x649b('0x1c')](_0x2aac47)[_0x649b('0x2d')](_0x2b90b4);};}exports[_0x649b('0x2e')]=function(_0x3b57aa,_0x1a0f15){var _0x330ac3={},_0x5c9847={},_0x369be0={'count':0x0,'rows':[]};var _0x255f28=_[_0x649b('0x2f')](db['ChatGroup'][_0x649b('0x30')],function(_0x6341ea){return{'name':_0x6341ea['fieldName'],'type':_0x6341ea[_0x649b('0x31')]['key']};});_0x5c9847[_0x649b('0x32')]=_[_0x649b('0x2f')](_0x255f28,'name');_0x5c9847[_0x649b('0x33')]=_[_0x649b('0x34')](_0x3b57aa[_0x649b('0x33')]);_0x5c9847['filters']=_[_0x649b('0x35')](_0x5c9847['model'],_0x5c9847[_0x649b('0x33')]);_0x330ac3[_0x649b('0x36')]=_[_0x649b('0x35')](_0x5c9847[_0x649b('0x32')],qs[_0x649b('0x37')](_0x3b57aa[_0x649b('0x33')]['fields']));_0x330ac3[_0x649b('0x36')]=_0x330ac3[_0x649b('0x36')][_0x649b('0x38')]?_0x330ac3[_0x649b('0x36')]:_0x5c9847[_0x649b('0x32')];if(!_0x3b57aa['query'][_0x649b('0x39')](_0x649b('0x3a'))){_0x330ac3[_0x649b('0x20')]=qs[_0x649b('0x20')](_0x3b57aa[_0x649b('0x33')]['limit']);_0x330ac3[_0x649b('0x1f')]=qs[_0x649b('0x1f')](_0x3b57aa[_0x649b('0x33')]['offset']);}_0x330ac3[_0x649b('0x3b')]=qs[_0x649b('0x3c')](_0x3b57aa[_0x649b('0x33')][_0x649b('0x3c')]);_0x330ac3[_0x649b('0x3d')]=qs[_0x649b('0x3e')](_[_0x649b('0x3f')](_0x3b57aa['query'],_0x5c9847[_0x649b('0x3e')]),_0x255f28);if(_0x3b57aa['query'][_0x649b('0x40')]){_0x330ac3[_0x649b('0x3d')]=_[_0x649b('0x41')](_0x330ac3['where'],{'$or':_['map'](_0x255f28,function(_0x15a419){if(_0x15a419['type']!=='VIRTUAL'){var _0x38d087={};_0x38d087[_0x15a419['name']]={'$like':'%'+_0x3b57aa[_0x649b('0x33')][_0x649b('0x40')]+'%'};return _0x38d087;}})});}_0x330ac3=_[_0x649b('0x41')]({},_0x330ac3,_0x3b57aa[_0x649b('0x42')]);var _0x115f14={'where':_0x330ac3[_0x649b('0x3d')]};return db['ChatGroup'][_0x649b('0x22')](_0x115f14)[_0x649b('0x29')](function(_0x1700a7){_0x369be0[_0x649b('0x22')]=_0x1700a7;if(_0x3b57aa[_0x649b('0x33')]['includeAll']){_0x330ac3['include']=[{'all':!![]}];}return db[_0x649b('0x43')]['findAll'](_0x330ac3);})['then'](function(_0x3c3b6b){_0x369be0['rows']=_0x3c3b6b;return _0x369be0;})[_0x649b('0x29')](respondWithFilteredResult(_0x1a0f15,_0x330ac3))[_0x649b('0x44')](handleError(_0x1a0f15,null));};exports[_0x649b('0x45')]=function(_0x1e4ce7,_0x4ad8ad){var _0x3e4f65={'raw':!![],'where':{'id':_0x1e4ce7['params']['id']}},_0x449dc4={};_0x449dc4['model']=_['keys'](db[_0x649b('0x43')][_0x649b('0x30')]);_0x449dc4[_0x649b('0x33')]=_[_0x649b('0x34')](_0x1e4ce7[_0x649b('0x33')]);_0x449dc4['filters']=_['intersection'](_0x449dc4['model'],_0x449dc4[_0x649b('0x33')]);_0x3e4f65[_0x649b('0x36')]=_[_0x649b('0x35')](_0x449dc4[_0x649b('0x32')],qs['fields'](_0x1e4ce7[_0x649b('0x33')][_0x649b('0x37')]));_0x3e4f65[_0x649b('0x36')]=_0x3e4f65[_0x649b('0x36')][_0x649b('0x38')]?_0x3e4f65[_0x649b('0x36')]:_0x449dc4[_0x649b('0x32')];if(_0x1e4ce7[_0x649b('0x33')][_0x649b('0x46')]){_0x3e4f65[_0x649b('0x47')]=[{'all':!![]}];}_0x3e4f65=_['merge']({},_0x3e4f65,_0x1e4ce7['options']);return db[_0x649b('0x43')]['find'](_0x3e4f65)[_0x649b('0x29')](handleEntityNotFound(_0x4ad8ad,null))[_0x649b('0x29')](respondWithResult(_0x4ad8ad,null))[_0x649b('0x44')](handleError(_0x4ad8ad,null));};exports['create']=function(_0x8895ec,_0x525a96){return db[_0x649b('0x43')][_0x649b('0x48')](_0x8895ec[_0x649b('0x49')],{})[_0x649b('0x29')](respondWithResult(_0x525a96,0xc9))[_0x649b('0x44')](handleError(_0x525a96,null));};exports[_0x649b('0x28')]=function(_0x25ea88,_0xb8ae93){if(_0x25ea88[_0x649b('0x49')]['id']){delete _0x25ea88[_0x649b('0x49')]['id'];}return db[_0x649b('0x43')]['find']({'where':{'id':_0x25ea88['params']['id']}})[_0x649b('0x29')](handleEntityNotFound(_0xb8ae93,null))[_0x649b('0x29')](saveUpdates(_0x25ea88[_0x649b('0x49')],null))[_0x649b('0x29')](respondWithResult(_0xb8ae93,null))[_0x649b('0x44')](handleError(_0xb8ae93,null));};exports[_0x649b('0x2a')]=function(_0x3af923,_0x55f579){return db[_0x649b('0x43')][_0x649b('0x4a')]({'where':{'id':_0x3af923[_0x649b('0x4b')]['id']}})[_0x649b('0x29')](handleEntityNotFound(_0x55f579,null))[_0x649b('0x29')](removeEntity(_0x55f579,null))[_0x649b('0x44')](handleError(_0x55f579,null));};exports[_0x649b('0x4c')]=function(_0x251314,_0x51fd22){return db[_0x649b('0x43')][_0x649b('0x4c')]()[_0x649b('0x29')](respondWithResult(_0x51fd22,null))[_0x649b('0x44')](handleError(_0x51fd22,null));};exports[_0x649b('0x4d')]=function(_0x151f23,_0x125369,_0x308226){return db[_0x649b('0x4e')]['count']({'where':{'ChatGroupId':_0x151f23[_0x649b('0x4b')]['id'],'ToId':_0x151f23['user']['id'],'read':![]}})[_0x649b('0x29')](function(_0x2c686d){return{'id':_[_0x649b('0x4f')](_0x151f23[_0x649b('0x4b')]['id']),'count':_0x2c686d};})[_0x649b('0x29')](respondWithResult(_0x125369,null))[_0x649b('0x44')](handleError(_0x125369,null));};exports[_0x649b('0x50')]=function(_0x594dad,_0x418562,_0x405e14){return db[_0x649b('0x43')][_0x649b('0x4a')]({'where':{'id':_0x594dad[_0x649b('0x4b')]['id']}})[_0x649b('0x29')](handleEntityNotFound(_0x418562,null))[_0x649b('0x29')](function(_0x2d0dd2){if(_0x2d0dd2){return _0x2d0dd2[_0x649b('0x50')](_0x594dad[_0x649b('0x49')]['ids'],_[_0x649b('0x51')](_0x594dad['body'],[_0x649b('0x52'),'id'])||{});}})[_0x649b('0x29')](respondWithResult(_0x418562,null))[_0x649b('0x44')](handleError(_0x418562,null));};exports[_0x649b('0x53')]=function(_0x1c8ac0,_0x67f059,_0x4ce759){var _0x399d3a={};var _0x20f32f={};var _0x3b2801;var _0x46b195;return db[_0x649b('0x43')]['findOne']({'where':{'id':_0x1c8ac0[_0x649b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x67f059,null))[_0x649b('0x29')](function(_0x4d1a90){if(_0x4d1a90){_0x3b2801=_0x4d1a90;_0x20f32f[_0x649b('0x32')]=_[_0x649b('0x34')](db[_0x649b('0x54')][_0x649b('0x30')]);_0x20f32f[_0x649b('0x33')]=_[_0x649b('0x34')](_0x1c8ac0[_0x649b('0x33')]);_0x20f32f[_0x649b('0x3e')]=_['intersection'](_0x20f32f[_0x649b('0x32')],_0x20f32f[_0x649b('0x33')]);_0x399d3a['attributes']=_[_0x649b('0x35')](_0x20f32f[_0x649b('0x32')],qs[_0x649b('0x37')](_0x1c8ac0[_0x649b('0x33')][_0x649b('0x37')]));_0x399d3a['attributes']=_0x399d3a[_0x649b('0x36')][_0x649b('0x38')]?_0x399d3a[_0x649b('0x36')]:_0x20f32f[_0x649b('0x32')];_0x399d3a[_0x649b('0x3b')]=qs[_0x649b('0x3c')](_0x1c8ac0['query']['sort']);_0x399d3a['where']=qs[_0x649b('0x3e')](_['pick'](_0x1c8ac0[_0x649b('0x33')],_0x20f32f[_0x649b('0x3e')]));if(_0x1c8ac0[_0x649b('0x33')][_0x649b('0x40')]){_0x399d3a[_0x649b('0x3d')]=_['merge'](_0x399d3a[_0x649b('0x3d')],{'$or':_[_0x649b('0x2f')](_0x399d3a['attributes'],function(_0x24fa0d){var _0x5c9381={};_0x5c9381[_0x24fa0d]={'$like':'%'+_0x1c8ac0[_0x649b('0x33')][_0x649b('0x40')]+'%'};return _0x5c9381;})});}_0x399d3a=_[_0x649b('0x41')]({},_0x399d3a,_0x1c8ac0[_0x649b('0x42')]);return _0x3b2801[_0x649b('0x53')](_0x399d3a);}})[_0x649b('0x29')](function(_0x3b7006){if(_0x3b7006){_0x46b195=_0x3b7006['length'];if(!_0x1c8ac0['query'][_0x649b('0x39')](_0x649b('0x3a'))){_0x399d3a[_0x649b('0x20')]=qs[_0x649b('0x20')](_0x1c8ac0['query'][_0x649b('0x20')]);_0x399d3a[_0x649b('0x1f')]=qs[_0x649b('0x1f')](_0x1c8ac0[_0x649b('0x33')]['offset']);}return _0x3b2801['getMembers'](_0x399d3a);}})[_0x649b('0x29')](function(_0x18c5e8){if(_0x18c5e8){return _0x18c5e8?{'count':_0x46b195,'rows':_0x18c5e8}:null;}})[_0x649b('0x29')](respondWithResult(_0x67f059,null))['catch'](handleError(_0x67f059,null));};exports[_0x649b('0x55')]=function(_0x1f1f94,_0x471638,_0x1e1b76){return db[_0x649b('0x43')][_0x649b('0x4a')]({'where':{'id':_0x1f1f94[_0x649b('0x4b')]['id']}})[_0x649b('0x29')](handleEntityNotFound(_0x471638,null))['then'](function(_0x1d0ad9){if(_0x1d0ad9){return _0x1d0ad9['removeMembers'](_0x1f1f94['query'][_0x649b('0x52')]);}})[_0x649b('0x29')](respondWithStatusCode(_0x471638,null))[_0x649b('0x44')](handleError(_0x471638,null));};exports[_0x649b('0x56')]=function(_0x3f83e0,_0x14ca4c,_0x346f44){if(_0x3f83e0[_0x649b('0x49')]['id']){delete _0x3f83e0['body']['id'];}return db['ChatGroup'][_0x649b('0x4a')]({'where':{'id':_0x3f83e0[_0x649b('0x4b')]['id']}})[_0x649b('0x29')](handleEntityNotFound(_0x14ca4c,null))['then'](function(_0x491560){if(_0x491560){_0x3f83e0[_0x649b('0x49')][_0x649b('0x57')]=_0x491560['id'];return db[_0x649b('0x4e')][_0x649b('0x48')](_0x3f83e0[_0x649b('0x49')]);}})[_0x649b('0x29')](respondWithResult(_0x14ca4c,null))[_0x649b('0x44')](handleError(_0x14ca4c,null));};exports['getMessages']=function(_0x52a679,_0x1fcb4b,_0x51e003){var _0x21f758={};var _0x1a23fb={};var _0x4906e8;var _0x441a76;return db[_0x649b('0x43')]['findOne']({'where':{'id':_0x52a679['params']['id']}})[_0x649b('0x29')](handleEntityNotFound(_0x1fcb4b,null))['then'](function(_0x351758){if(_0x351758){_0x4906e8=_0x351758;_0x1a23fb[_0x649b('0x32')]=_[_0x649b('0x34')](db[_0x649b('0x4e')][_0x649b('0x30')]);_0x1a23fb[_0x649b('0x33')]=_[_0x649b('0x34')](_0x52a679[_0x649b('0x33')]);_0x1a23fb[_0x649b('0x3e')]=_[_0x649b('0x35')](_0x1a23fb[_0x649b('0x32')],_0x1a23fb[_0x649b('0x33')]);_0x21f758[_0x649b('0x36')]=_['intersection'](_0x1a23fb['model'],qs['fields'](_0x52a679[_0x649b('0x33')][_0x649b('0x37')]));_0x21f758[_0x649b('0x36')]=_0x21f758['attributes'][_0x649b('0x38')]?_0x21f758[_0x649b('0x36')]:_0x1a23fb[_0x649b('0x32')];_0x21f758[_0x649b('0x3b')]=qs[_0x649b('0x3c')](_0x52a679['query'][_0x649b('0x3c')]);_0x21f758['where']=qs['filters'](_[_0x649b('0x3f')](_0x52a679[_0x649b('0x33')],_0x1a23fb[_0x649b('0x3e')]));if(_0x52a679['query']['filter']){_0x21f758['where']=_[_0x649b('0x41')](_0x21f758[_0x649b('0x3d')],{'$or':_['map'](_0x21f758[_0x649b('0x36')],function(_0x146b49){var _0x318517={};_0x318517[_0x146b49]={'$like':'%'+_0x52a679[_0x649b('0x33')][_0x649b('0x40')]+'%'};return _0x318517;})});}if(_0x52a679[_0x649b('0x33')][_0x649b('0x58')]){var _0x473e78=_0x52a679[_0x649b('0x33')]['$gte'][_0x649b('0x59')](',');var _0x3f4bb3={};_0x3f4bb3[_0x473e78[0x0]]={'$gte':moment(_0x473e78[0x1])[_0x649b('0x5a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x21f758[_0x649b('0x3d')]=_[_0x649b('0x41')](_0x21f758['where'],_0x3f4bb3);}_0x21f758=_['merge']({},_0x21f758,_0x52a679[_0x649b('0x42')]);return _0x4906e8[_0x649b('0x5b')](_0x21f758);}})[_0x649b('0x29')](function(_0x50dc03){if(_0x50dc03){_0x441a76=_0x50dc03[_0x649b('0x38')];if(!_0x52a679['query'][_0x649b('0x39')](_0x649b('0x3a'))){_0x21f758['limit']=qs['limit'](_0x52a679[_0x649b('0x33')]['limit']);_0x21f758[_0x649b('0x1f')]=qs[_0x649b('0x1f')](_0x52a679[_0x649b('0x33')][_0x649b('0x1f')]);}return _0x4906e8[_0x649b('0x5b')](_0x21f758);}})[_0x649b('0x29')](function(_0x3ae3ba){if(_0x3ae3ba){return _0x3ae3ba?{'count':_0x441a76,'rows':_0x3ae3ba}:null;}})['then'](respondWithResult(_0x1fcb4b,null))['catch'](handleError(_0x1fcb4b,null));}; \ No newline at end of file +var _0x3d4c=['findOne','keys','User','sort','nolimit','getMembers','removeMembers','addMessage','ChatGroupId','$gte','split','hasOwnProperty','getMessages','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','stack','name','send','map','ChatGroup','rawAttributes','type','key','model','query','intersection','attributes','fields','length','order','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','filters','find','create','body','describe','ChatInternalMessage','toInteger','addMembers','ids','omit'];(function(_0x154cbb,_0x43c57f){var _0x494584=function(_0x971bd9){while(--_0x971bd9){_0x154cbb['push'](_0x154cbb['shift']());}};_0x494584(++_0x43c57f);}(_0x3d4c,0x12a));var _0xc3d4=function(_0x32612f,_0x353794){_0x32612f=_0x32612f-0x0;var _0x1d2bc6=_0x3d4c[_0x32612f];return _0x1d2bc6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc3d4('0x0'));var zipdir=require(_0xc3d4('0x1'));var jsonpatch=require(_0xc3d4('0x2'));var rp=require(_0xc3d4('0x3'));var moment=require(_0xc3d4('0x4'));var BPromise=require(_0xc3d4('0x5'));var Mustache=require('mustache');var util=require(_0xc3d4('0x6'));var path=require(_0xc3d4('0x7'));var sox=require('sox');var csv=require(_0xc3d4('0x8'));var ejs=require(_0xc3d4('0x9'));var fs=require('fs');var fs_extra=require(_0xc3d4('0xa'));var _=require(_0xc3d4('0xb'));var squel=require(_0xc3d4('0xc'));var crypto=require(_0xc3d4('0xd'));var jsforce=require(_0xc3d4('0xe'));var deskjs=require(_0xc3d4('0xf'));var toCsv=require(_0xc3d4('0x8'));var querystring=require('querystring');var Papa=require(_0xc3d4('0x10'));var Redis=require('ioredis');var authService=require(_0xc3d4('0x11'));var qs=require(_0xc3d4('0x12'));var as=require(_0xc3d4('0x13'));var hardwareService=require(_0xc3d4('0x14'));var logger=require('../../config/logger')(_0xc3d4('0x15'));var utils=require(_0xc3d4('0x16'));var config=require(_0xc3d4('0x17'));var licenseUtil=require(_0xc3d4('0x18'));var db=require(_0xc3d4('0x19'))['db'];config[_0xc3d4('0x1a')]=_[_0xc3d4('0x1b')](config[_0xc3d4('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc3d4('0x1a')]));require(_0xc3d4('0x1c'))[_0xc3d4('0x1d')](socket);function respondWithStatusCode(_0x18b12c,_0x28d16e){_0x28d16e=_0x28d16e||0xcc;return function(_0x56e563){if(_0x56e563){return _0x18b12c[_0xc3d4('0x1e')](_0x28d16e);}return _0x18b12c[_0xc3d4('0x1f')](_0x28d16e)[_0xc3d4('0x20')]();};}function respondWithResult(_0x257403,_0x37be54){_0x37be54=_0x37be54||0xc8;return function(_0x32fb11){if(_0x32fb11){return _0x257403[_0xc3d4('0x1f')](_0x37be54)[_0xc3d4('0x21')](_0x32fb11);}};}function respondWithFilteredResult(_0x458b75,_0x3598a3){return function(_0x4437b8){if(_0x4437b8){var _0x25a6c9=typeof _0x3598a3[_0xc3d4('0x22')]===_0xc3d4('0x23')&&typeof _0x3598a3[_0xc3d4('0x24')]===_0xc3d4('0x23');var _0x5289df=_0x4437b8[_0xc3d4('0x25')];var _0x4dd3e5=_0x25a6c9?0x0:_0x3598a3[_0xc3d4('0x22')];var _0x41e9b3=_0x25a6c9?_0x4437b8[_0xc3d4('0x25')]:_0x3598a3[_0xc3d4('0x22')]+_0x3598a3['limit'];var _0x1bf898;if(_0x41e9b3>=_0x5289df){_0x41e9b3=_0x5289df;_0x1bf898=0xc8;}else{_0x1bf898=0xce;}_0x458b75['status'](_0x1bf898);return _0x458b75[_0xc3d4('0x26')]('Content-Range',_0x4dd3e5+'-'+_0x41e9b3+'/'+_0x5289df)[_0xc3d4('0x21')](_0x4437b8);}return null;};}function patchUpdates(_0x1b1434){return function(_0x1b2c07){try{jsonpatch[_0xc3d4('0x27')](_0x1b2c07,_0x1b1434,!![]);}catch(_0x53c430){return BPromise['reject'](_0x53c430);}return _0x1b2c07[_0xc3d4('0x28')]();};}function saveUpdates(_0x5d1538,_0x53d986){return function(_0x56ad56){if(_0x56ad56){return _0x56ad56[_0xc3d4('0x29')](_0x5d1538)[_0xc3d4('0x2a')](function(_0x27f025){return _0x27f025;});}return null;};}function removeEntity(_0x51f9f1,_0x59262){return function(_0x2916fe){if(_0x2916fe){return _0x2916fe[_0xc3d4('0x2b')]()['then'](function(){_0x51f9f1[_0xc3d4('0x1f')](0xcc)[_0xc3d4('0x20')]();});}};}function handleEntityNotFound(_0x3710a0,_0x1c2cba){return function(_0x4b3871){if(!_0x4b3871){_0x3710a0[_0xc3d4('0x1e')](0x194);}return _0x4b3871;};}function handleError(_0x23817e,_0x51ab94){_0x51ab94=_0x51ab94||0x1f4;return function(_0x1d3be){logger[_0xc3d4('0x2c')](_0x1d3be[_0xc3d4('0x2d')]);if(_0x1d3be['name']){delete _0x1d3be[_0xc3d4('0x2e')];}_0x23817e[_0xc3d4('0x1f')](_0x51ab94)[_0xc3d4('0x2f')](_0x1d3be);};}exports['index']=function(_0x32a548,_0xc4242b){var _0x5d182d={},_0x345094={},_0x6cd03a={'count':0x0,'rows':[]};var _0x3590b7=_[_0xc3d4('0x30')](db[_0xc3d4('0x31')][_0xc3d4('0x32')],function(_0x1fa3d9){return{'name':_0x1fa3d9['fieldName'],'type':_0x1fa3d9[_0xc3d4('0x33')][_0xc3d4('0x34')]};});_0x345094[_0xc3d4('0x35')]=_[_0xc3d4('0x30')](_0x3590b7,_0xc3d4('0x2e'));_0x345094['query']=_['keys'](_0x32a548[_0xc3d4('0x36')]);_0x345094['filters']=_[_0xc3d4('0x37')](_0x345094[_0xc3d4('0x35')],_0x345094[_0xc3d4('0x36')]);_0x5d182d[_0xc3d4('0x38')]=_['intersection'](_0x345094['model'],qs[_0xc3d4('0x39')](_0x32a548[_0xc3d4('0x36')][_0xc3d4('0x39')]));_0x5d182d[_0xc3d4('0x38')]=_0x5d182d[_0xc3d4('0x38')][_0xc3d4('0x3a')]?_0x5d182d[_0xc3d4('0x38')]:_0x345094[_0xc3d4('0x35')];if(!_0x32a548[_0xc3d4('0x36')]['hasOwnProperty']('nolimit')){_0x5d182d[_0xc3d4('0x24')]=qs[_0xc3d4('0x24')](_0x32a548['query'][_0xc3d4('0x24')]);_0x5d182d[_0xc3d4('0x22')]=qs[_0xc3d4('0x22')](_0x32a548[_0xc3d4('0x36')][_0xc3d4('0x22')]);}_0x5d182d[_0xc3d4('0x3b')]=qs['sort'](_0x32a548[_0xc3d4('0x36')]['sort']);_0x5d182d[_0xc3d4('0x3c')]=qs['filters'](_[_0xc3d4('0x3d')](_0x32a548[_0xc3d4('0x36')],_0x345094['filters']),_0x3590b7);if(_0x32a548['query'][_0xc3d4('0x3e')]){_0x5d182d[_0xc3d4('0x3c')]=_[_0xc3d4('0x3f')](_0x5d182d['where'],{'$or':_[_0xc3d4('0x30')](_0x3590b7,function(_0x2c3952){if(_0x2c3952[_0xc3d4('0x33')]!=='VIRTUAL'){var _0x1dde41={};_0x1dde41[_0x2c3952[_0xc3d4('0x2e')]]={'$like':'%'+_0x32a548['query'][_0xc3d4('0x3e')]+'%'};return _0x1dde41;}})});}_0x5d182d=_['merge']({},_0x5d182d,_0x32a548[_0xc3d4('0x40')]);var _0x437858={'where':_0x5d182d[_0xc3d4('0x3c')]};return db[_0xc3d4('0x31')][_0xc3d4('0x25')](_0x437858)[_0xc3d4('0x2a')](function(_0x56f6ef){_0x6cd03a[_0xc3d4('0x25')]=_0x56f6ef;if(_0x32a548[_0xc3d4('0x36')][_0xc3d4('0x41')]){_0x5d182d[_0xc3d4('0x42')]=[{'all':!![]}];}return db[_0xc3d4('0x31')][_0xc3d4('0x43')](_0x5d182d);})['then'](function(_0x144120){_0x6cd03a[_0xc3d4('0x44')]=_0x144120;return _0x6cd03a;})[_0xc3d4('0x2a')](respondWithFilteredResult(_0xc4242b,_0x5d182d))[_0xc3d4('0x45')](handleError(_0xc4242b,null));};exports[_0xc3d4('0x46')]=function(_0x379604,_0x1a418e){var _0xc0fc89={'raw':!![],'where':{'id':_0x379604[_0xc3d4('0x47')]['id']}},_0x5dfe66={};_0x5dfe66[_0xc3d4('0x35')]=_['keys'](db[_0xc3d4('0x31')][_0xc3d4('0x32')]);_0x5dfe66[_0xc3d4('0x36')]=_['keys'](_0x379604[_0xc3d4('0x36')]);_0x5dfe66[_0xc3d4('0x48')]=_[_0xc3d4('0x37')](_0x5dfe66[_0xc3d4('0x35')],_0x5dfe66[_0xc3d4('0x36')]);_0xc0fc89['attributes']=_[_0xc3d4('0x37')](_0x5dfe66[_0xc3d4('0x35')],qs[_0xc3d4('0x39')](_0x379604[_0xc3d4('0x36')][_0xc3d4('0x39')]));_0xc0fc89[_0xc3d4('0x38')]=_0xc0fc89[_0xc3d4('0x38')]['length']?_0xc0fc89[_0xc3d4('0x38')]:_0x5dfe66['model'];if(_0x379604[_0xc3d4('0x36')][_0xc3d4('0x41')]){_0xc0fc89[_0xc3d4('0x42')]=[{'all':!![]}];}_0xc0fc89=_[_0xc3d4('0x3f')]({},_0xc0fc89,_0x379604[_0xc3d4('0x40')]);return db[_0xc3d4('0x31')][_0xc3d4('0x49')](_0xc0fc89)[_0xc3d4('0x2a')](handleEntityNotFound(_0x1a418e,null))[_0xc3d4('0x2a')](respondWithResult(_0x1a418e,null))[_0xc3d4('0x45')](handleError(_0x1a418e,null));};exports[_0xc3d4('0x4a')]=function(_0x250884,_0x9cbaaa){return db[_0xc3d4('0x31')][_0xc3d4('0x4a')](_0x250884['body'],{})[_0xc3d4('0x2a')](respondWithResult(_0x9cbaaa,0xc9))[_0xc3d4('0x45')](handleError(_0x9cbaaa,null));};exports[_0xc3d4('0x29')]=function(_0x51ae7b,_0x338a14){if(_0x51ae7b[_0xc3d4('0x4b')]['id']){delete _0x51ae7b[_0xc3d4('0x4b')]['id'];}return db[_0xc3d4('0x31')][_0xc3d4('0x49')]({'where':{'id':_0x51ae7b['params']['id']}})[_0xc3d4('0x2a')](handleEntityNotFound(_0x338a14,null))['then'](saveUpdates(_0x51ae7b[_0xc3d4('0x4b')],null))[_0xc3d4('0x2a')](respondWithResult(_0x338a14,null))[_0xc3d4('0x45')](handleError(_0x338a14,null));};exports[_0xc3d4('0x2b')]=function(_0x370610,_0x7bfadb){return db['ChatGroup']['find']({'where':{'id':_0x370610[_0xc3d4('0x47')]['id']}})[_0xc3d4('0x2a')](handleEntityNotFound(_0x7bfadb,null))[_0xc3d4('0x2a')](removeEntity(_0x7bfadb,null))[_0xc3d4('0x45')](handleError(_0x7bfadb,null));};exports[_0xc3d4('0x4c')]=function(_0x32ae4f,_0x24ab39){return db[_0xc3d4('0x31')][_0xc3d4('0x4c')]()['then'](respondWithResult(_0x24ab39,null))[_0xc3d4('0x45')](handleError(_0x24ab39,null));};exports['getUnread']=function(_0x1af5e9,_0x59609c,_0x2d6d5a){return db[_0xc3d4('0x4d')]['count']({'where':{'ChatGroupId':_0x1af5e9[_0xc3d4('0x47')]['id'],'ToId':_0x1af5e9['user']['id'],'read':![]}})[_0xc3d4('0x2a')](function(_0x3f2063){return{'id':_[_0xc3d4('0x4e')](_0x1af5e9[_0xc3d4('0x47')]['id']),'count':_0x3f2063};})[_0xc3d4('0x2a')](respondWithResult(_0x59609c,null))['catch'](handleError(_0x59609c,null));};exports[_0xc3d4('0x4f')]=function(_0xd46579,_0x15137e,_0x390c8f){return db[_0xc3d4('0x31')][_0xc3d4('0x49')]({'where':{'id':_0xd46579[_0xc3d4('0x47')]['id']}})['then'](handleEntityNotFound(_0x15137e,null))[_0xc3d4('0x2a')](function(_0xaa12b8){if(_0xaa12b8){return _0xaa12b8[_0xc3d4('0x4f')](_0xd46579['body'][_0xc3d4('0x50')],_[_0xc3d4('0x51')](_0xd46579['body'],[_0xc3d4('0x50'),'id'])||{});}})['then'](respondWithResult(_0x15137e,null))[_0xc3d4('0x45')](handleError(_0x15137e,null));};exports['getMembers']=function(_0x382269,_0x50eeff,_0x1cefa4){var _0x4adb5d={};var _0x577ac5={};var _0x183801;var _0x46cc15;return db[_0xc3d4('0x31')][_0xc3d4('0x52')]({'where':{'id':_0x382269[_0xc3d4('0x47')]['id']}})[_0xc3d4('0x2a')](handleEntityNotFound(_0x50eeff,null))['then'](function(_0x1ae8cd){if(_0x1ae8cd){_0x183801=_0x1ae8cd;_0x577ac5[_0xc3d4('0x35')]=_[_0xc3d4('0x53')](db[_0xc3d4('0x54')][_0xc3d4('0x32')]);_0x577ac5['query']=_['keys'](_0x382269[_0xc3d4('0x36')]);_0x577ac5[_0xc3d4('0x48')]=_[_0xc3d4('0x37')](_0x577ac5['model'],_0x577ac5['query']);_0x4adb5d[_0xc3d4('0x38')]=_[_0xc3d4('0x37')](_0x577ac5['model'],qs['fields'](_0x382269['query'][_0xc3d4('0x39')]));_0x4adb5d[_0xc3d4('0x38')]=_0x4adb5d['attributes']['length']?_0x4adb5d['attributes']:_0x577ac5[_0xc3d4('0x35')];_0x4adb5d[_0xc3d4('0x3b')]=qs[_0xc3d4('0x55')](_0x382269['query'][_0xc3d4('0x55')]);_0x4adb5d[_0xc3d4('0x3c')]=qs[_0xc3d4('0x48')](_[_0xc3d4('0x3d')](_0x382269['query'],_0x577ac5[_0xc3d4('0x48')]));if(_0x382269[_0xc3d4('0x36')][_0xc3d4('0x3e')]){_0x4adb5d[_0xc3d4('0x3c')]=_['merge'](_0x4adb5d[_0xc3d4('0x3c')],{'$or':_[_0xc3d4('0x30')](_0x4adb5d[_0xc3d4('0x38')],function(_0x29b8d6){var _0x1edf7d={};_0x1edf7d[_0x29b8d6]={'$like':'%'+_0x382269[_0xc3d4('0x36')][_0xc3d4('0x3e')]+'%'};return _0x1edf7d;})});}_0x4adb5d=_[_0xc3d4('0x3f')]({},_0x4adb5d,_0x382269['options']);return _0x183801['getMembers'](_0x4adb5d);}})[_0xc3d4('0x2a')](function(_0x438548){if(_0x438548){_0x46cc15=_0x438548[_0xc3d4('0x3a')];if(!_0x382269[_0xc3d4('0x36')]['hasOwnProperty'](_0xc3d4('0x56'))){_0x4adb5d[_0xc3d4('0x24')]=qs[_0xc3d4('0x24')](_0x382269[_0xc3d4('0x36')][_0xc3d4('0x24')]);_0x4adb5d[_0xc3d4('0x22')]=qs[_0xc3d4('0x22')](_0x382269[_0xc3d4('0x36')][_0xc3d4('0x22')]);}return _0x183801[_0xc3d4('0x57')](_0x4adb5d);}})['then'](function(_0x3ad302){if(_0x3ad302){return _0x3ad302?{'count':_0x46cc15,'rows':_0x3ad302}:null;}})[_0xc3d4('0x2a')](respondWithResult(_0x50eeff,null))[_0xc3d4('0x45')](handleError(_0x50eeff,null));};exports[_0xc3d4('0x58')]=function(_0x2cf1d6,_0x7c46bc,_0x4c64a1){return db[_0xc3d4('0x31')][_0xc3d4('0x49')]({'where':{'id':_0x2cf1d6[_0xc3d4('0x47')]['id']}})[_0xc3d4('0x2a')](handleEntityNotFound(_0x7c46bc,null))[_0xc3d4('0x2a')](function(_0x430fb7){if(_0x430fb7){return _0x430fb7[_0xc3d4('0x58')](_0x2cf1d6[_0xc3d4('0x36')]['ids']);}})[_0xc3d4('0x2a')](respondWithStatusCode(_0x7c46bc,null))['catch'](handleError(_0x7c46bc,null));};exports[_0xc3d4('0x59')]=function(_0x198b43,_0xef0f73,_0x2cacf8){if(_0x198b43[_0xc3d4('0x4b')]['id']){delete _0x198b43['body']['id'];}return db[_0xc3d4('0x31')]['find']({'where':{'id':_0x198b43[_0xc3d4('0x47')]['id']}})[_0xc3d4('0x2a')](handleEntityNotFound(_0xef0f73,null))['then'](function(_0x7b13db){if(_0x7b13db){_0x198b43[_0xc3d4('0x4b')][_0xc3d4('0x5a')]=_0x7b13db['id'];return db[_0xc3d4('0x4d')][_0xc3d4('0x4a')](_0x198b43['body']);}})[_0xc3d4('0x2a')](respondWithResult(_0xef0f73,null))[_0xc3d4('0x45')](handleError(_0xef0f73,null));};exports['getMessages']=function(_0x6f1bad,_0x36fa6e,_0x3cb4a2){var _0x3f861f={};var _0x1a77e5={};var _0x527b15;var _0x2b5e67;return db[_0xc3d4('0x31')][_0xc3d4('0x52')]({'where':{'id':_0x6f1bad[_0xc3d4('0x47')]['id']}})[_0xc3d4('0x2a')](handleEntityNotFound(_0x36fa6e,null))[_0xc3d4('0x2a')](function(_0x162f91){if(_0x162f91){_0x527b15=_0x162f91;_0x1a77e5['model']=_[_0xc3d4('0x53')](db[_0xc3d4('0x4d')][_0xc3d4('0x32')]);_0x1a77e5[_0xc3d4('0x36')]=_[_0xc3d4('0x53')](_0x6f1bad[_0xc3d4('0x36')]);_0x1a77e5[_0xc3d4('0x48')]=_['intersection'](_0x1a77e5[_0xc3d4('0x35')],_0x1a77e5[_0xc3d4('0x36')]);_0x3f861f[_0xc3d4('0x38')]=_[_0xc3d4('0x37')](_0x1a77e5['model'],qs[_0xc3d4('0x39')](_0x6f1bad[_0xc3d4('0x36')][_0xc3d4('0x39')]));_0x3f861f[_0xc3d4('0x38')]=_0x3f861f[_0xc3d4('0x38')][_0xc3d4('0x3a')]?_0x3f861f['attributes']:_0x1a77e5['model'];_0x3f861f[_0xc3d4('0x3b')]=qs['sort'](_0x6f1bad[_0xc3d4('0x36')][_0xc3d4('0x55')]);_0x3f861f[_0xc3d4('0x3c')]=qs[_0xc3d4('0x48')](_[_0xc3d4('0x3d')](_0x6f1bad['query'],_0x1a77e5[_0xc3d4('0x48')]));if(_0x6f1bad[_0xc3d4('0x36')]['filter']){_0x3f861f[_0xc3d4('0x3c')]=_[_0xc3d4('0x3f')](_0x3f861f[_0xc3d4('0x3c')],{'$or':_[_0xc3d4('0x30')](_0x3f861f[_0xc3d4('0x38')],function(_0xb66961){var _0x546d59={};_0x546d59[_0xb66961]={'$like':'%'+_0x6f1bad['query'][_0xc3d4('0x3e')]+'%'};return _0x546d59;})});}if(_0x6f1bad[_0xc3d4('0x36')][_0xc3d4('0x5b')]){var _0x60352c=_0x6f1bad[_0xc3d4('0x36')][_0xc3d4('0x5b')][_0xc3d4('0x5c')](',');var _0x355e0b={};_0x355e0b[_0x60352c[0x0]]={'$gte':moment(_0x60352c[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x3f861f['where']=_['merge'](_0x3f861f['where'],_0x355e0b);}_0x3f861f=_[_0xc3d4('0x3f')]({},_0x3f861f,_0x6f1bad[_0xc3d4('0x40')]);return _0x527b15['getMessages'](_0x3f861f);}})[_0xc3d4('0x2a')](function(_0x6c5fa9){if(_0x6c5fa9){_0x2b5e67=_0x6c5fa9[_0xc3d4('0x3a')];if(!_0x6f1bad[_0xc3d4('0x36')][_0xc3d4('0x5d')](_0xc3d4('0x56'))){_0x3f861f['limit']=qs[_0xc3d4('0x24')](_0x6f1bad[_0xc3d4('0x36')][_0xc3d4('0x24')]);_0x3f861f['offset']=qs[_0xc3d4('0x22')](_0x6f1bad['query'][_0xc3d4('0x22')]);}return _0x527b15[_0xc3d4('0x5e')](_0x3f861f);}})[_0xc3d4('0x2a')](function(_0x5d9379){if(_0x5d9379){return _0x5d9379?{'count':_0x2b5e67,'rows':_0x5d9379}:null;}})[_0xc3d4('0x2a')](respondWithResult(_0x36fa6e,null))[_0xc3d4('0x45')](handleError(_0x36fa6e,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 4d76b82..727ab96 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 _0xe2bb=['update','remove','emit','hasOwnProperty','hook','exports','save'];(function(_0x1ca29f,_0x318ac5){var _0x576c3b=function(_0x40caab){while(--_0x40caab){_0x1ca29f['push'](_0x1ca29f['shift']());}};_0x576c3b(++_0x318ac5);}(_0xe2bb,0x76));var _0xbe2b=function(_0xffc8d6,_0x5a4ef2){_0xffc8d6=_0xffc8d6-0x0;var _0x1c6060=_0xe2bb[_0xffc8d6];return _0x1c6060;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xbe2b('0x0'),'afterUpdate':_0xbe2b('0x1'),'afterDestroy':_0xbe2b('0x2')};function emitEvent(_0x1379c5){return function(_0x34a542,_0xd0d1ae,_0xc944a3){ChatGroupEvents[_0xbe2b('0x3')](_0x1379c5+':'+_0x34a542['id'],_0x34a542);ChatGroupEvents[_0xbe2b('0x3')](_0x1379c5,_0x34a542);_0xc944a3(null);};}for(var e in events){if(events[_0xbe2b('0x4')](e)){var event=events[e];ChatGroup[_0xbe2b('0x5')](e,emitEvent(event));}}module[_0xbe2b('0x6')]=ChatGroupEvents; \ No newline at end of file +var _0x85d6=['setMaxListeners','save','emit','hook','exports','events','../../mysqldb','ChatGroup'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x85d6,0x135));var _0x685d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x85d6[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x685d('0x0'));var ChatGroup=require(_0x685d('0x1'))['db'][_0x685d('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x685d('0x3')](0x0);var events={'afterCreate':_0x685d('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x447935){return function(_0x5074f9,_0xa4c797,_0x362db4){ChatGroupEvents[_0x685d('0x5')](_0x447935+':'+_0x5074f9['id'],_0x5074f9);ChatGroupEvents[_0x685d('0x5')](_0x447935,_0x5074f9);_0x362db4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x685d('0x6')](e,emitEvent(event));}}module[_0x685d('0x7')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index ee5da53..c34e454 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 _0x98b0=['path','rimraf','./chatGroup.attributes','define','ChatGroup','chat_groups','lodash','../../config/logger','api','moment','bluebird'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x98b0,0x1b3));var _0x098b=function(_0x1e399a,_0x351c59){_0x1e399a=_0x1e399a-0x0;var _0x539897=_0x98b0[_0x1e399a];return _0x539897;};'use strict';var _=require(_0x098b('0x0'));var util=require('util');var logger=require(_0x098b('0x1'))(_0x098b('0x2'));var moment=require(_0x098b('0x3'));var BPromise=require(_0x098b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x098b('0x5'));var rimraf=require(_0x098b('0x6'));var config=require('../../config/environment');var attributes=require(_0x098b('0x7'));module['exports']=function(_0x1ae882,_0x28c14d){return _0x1ae882[_0x098b('0x8')](_0x098b('0x9'),attributes,{'tableName':_0x098b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfb7d=['exports','ChatGroup','chat_groups','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./chatGroup.attributes'];(function(_0x421c08,_0x524eba){var _0x107a0b=function(_0x250416){while(--_0x250416){_0x421c08['push'](_0x421c08['shift']());}};_0x107a0b(++_0x524eba);}(_0xfb7d,0x1bf));var _0xdfb7=function(_0x40a8a4,_0x3bd1ed){_0x40a8a4=_0x40a8a4-0x0;var _0x23af3b=_0xfb7d[_0x40a8a4];return _0x23af3b;};'use strict';var _=require(_0xdfb7('0x0'));var util=require(_0xdfb7('0x1'));var logger=require(_0xdfb7('0x2'))(_0xdfb7('0x3'));var moment=require('moment');var BPromise=require(_0xdfb7('0x4'));var rp=require(_0xdfb7('0x5'));var fs=require('fs');var path=require(_0xdfb7('0x6'));var rimraf=require(_0xdfb7('0x7'));var config=require('../../config/environment');var attributes=require(_0xdfb7('0x8'));module[_0xdfb7('0x9')]=function(_0x38bf51,_0x308d85){return _0x38bf51['define'](_0xdfb7('0xa'),attributes,{'tableName':_0xdfb7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index 95d7b43..a9d1948 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 _0x6dac=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1ae141,_0x9b00e4){var _0x970bb1=function(_0x2252e6){while(--_0x2252e6){_0x1ae141['push'](_0x1ae141['shift']());}};_0x970bb1(++_0x9b00e4);}(_0x6dac,0x16e));var _0xc6da=function(_0x38b7e3,_0x4aa608){_0x38b7e3=_0x38b7e3-0x0;var _0x4e4b0d=_0x6dac[_0x38b7e3];return _0x4e4b0d;};'use strict';var _=require(_0xc6da('0x0'));var util=require(_0xc6da('0x1'));var moment=require(_0xc6da('0x2'));var BPromise=require(_0xc6da('0x3'));var rs=require(_0xc6da('0x4'));var fs=require('fs');var Redis=require(_0xc6da('0x5'));var db=require(_0xc6da('0x6'))['db'];var utils=require(_0xc6da('0x7'));var logger=require(_0xc6da('0x8'))(_0xc6da('0x9'));var config=require(_0xc6da('0xa'));var jayson=require(_0xc6da('0xb'));var client=jayson[_0xc6da('0xc')]['http']({'port':0x232a});config[_0xc6da('0xd')]=_[_0xc6da('0xe')](config[_0xc6da('0xd')],{'host':_0xc6da('0xf'),'port':0x18eb});var socket=require(_0xc6da('0x10'))(new Redis(config[_0xc6da('0xd')]));require(_0xc6da('0x11'))[_0xc6da('0x12')](socket);function respondWithRpcPromise(_0x13fea1,_0x48455d,_0x34b9ea){return new BPromise(function(_0x2e4eb7,_0x414831){return client[_0xc6da('0x13')](_0x13fea1,_0x34b9ea)[_0xc6da('0x14')](function(_0x27411e){logger[_0xc6da('0x15')](_0xc6da('0x16'),_0x48455d,_0xc6da('0x17'));logger[_0xc6da('0x18')](_0xc6da('0x19'),_0x48455d,_0xc6da('0x17'),JSON[_0xc6da('0x1a')](_0x27411e));if(_0x27411e['error']){if(_0x27411e[_0xc6da('0x1b')][_0xc6da('0x1c')]===0x1f4){logger[_0xc6da('0x1b')](_0xc6da('0x16'),_0x48455d,_0x27411e[_0xc6da('0x1b')][_0xc6da('0x1d')]);return _0x414831(_0x27411e['error'][_0xc6da('0x1d')]);}logger[_0xc6da('0x1b')](_0xc6da('0x16'),_0x48455d,_0x27411e[_0xc6da('0x1b')][_0xc6da('0x1d')]);return _0x2e4eb7(_0x27411e['error'][_0xc6da('0x1d')]);}else{logger['info'](_0xc6da('0x16'),_0x48455d,_0xc6da('0x17'));_0x2e4eb7(_0x27411e[_0xc6da('0x1e')][_0xc6da('0x1d')]);}})['catch'](function(_0x232565){logger[_0xc6da('0x1b')](_0xc6da('0x16'),_0x48455d,_0x232565);_0x414831(_0x232565);});});} \ No newline at end of file +var _0x1cc7=['result','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','client','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','ChatGroup,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x1cc7,0x15a));var _0x71cc=function(_0x25f2a0,_0x93ce33){_0x25f2a0=_0x25f2a0-0x0;var _0x566d49=_0x1cc7[_0x25f2a0];return _0x566d49;};'use strict';var _=require(_0x71cc('0x0'));var util=require(_0x71cc('0x1'));var moment=require(_0x71cc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x71cc('0x3'))['db'];var utils=require(_0x71cc('0x4'));var logger=require(_0x71cc('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x71cc('0x6')]['http']({'port':0x232a});config[_0x71cc('0x7')]=_[_0x71cc('0x8')](config[_0x71cc('0x7')],{'host':_0x71cc('0x9'),'port':0x18eb});var socket=require(_0x71cc('0xa'))(new Redis(config['redis']));require(_0x71cc('0xb'))[_0x71cc('0xc')](socket);function respondWithRpcPromise(_0x47759a,_0x5ae8e7,_0x554044){return new BPromise(function(_0x50a7b7,_0x4b7514){return client[_0x71cc('0xd')](_0x47759a,_0x554044)[_0x71cc('0xe')](function(_0x37e34b){logger['info'](_0x71cc('0xf'),_0x5ae8e7,'request\x20sent');logger[_0x71cc('0x10')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x5ae8e7,_0x71cc('0x11'),JSON['stringify'](_0x37e34b));if(_0x37e34b[_0x71cc('0x12')]){if(_0x37e34b[_0x71cc('0x12')][_0x71cc('0x13')]===0x1f4){logger[_0x71cc('0x12')](_0x71cc('0xf'),_0x5ae8e7,_0x37e34b['error'][_0x71cc('0x14')]);return _0x4b7514(_0x37e34b[_0x71cc('0x12')][_0x71cc('0x14')]);}logger[_0x71cc('0x12')](_0x71cc('0xf'),_0x5ae8e7,_0x37e34b[_0x71cc('0x12')][_0x71cc('0x14')]);return _0x50a7b7(_0x37e34b['error'][_0x71cc('0x14')]);}else{logger[_0x71cc('0x15')](_0x71cc('0xf'),_0x5ae8e7,_0x71cc('0x11'));_0x50a7b7(_0x37e34b[_0x71cc('0x16')][_0x71cc('0x14')]);}})['catch'](function(_0x366690){logger[_0x71cc('0x12')]('ChatGroup,\x20%s,\x20%s',_0x5ae8e7,_0x366690);_0x4b7514(_0x366690);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 10a6ff7..7863088 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 _0x4c47=['emit','register','length','chatGroup:','./chatGroup.events','save','update'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x4c47,0x10e));var _0x74c4=function(_0x3a5358,_0x18a34e){_0x3a5358=_0x3a5358-0x0;var _0x2dfe15=_0x4c47[_0x3a5358];return _0x2dfe15;};'use strict';var ChatGroupEvents=require(_0x74c4('0x0'));var events=[_0x74c4('0x1'),'remove',_0x74c4('0x2')];function createListener(_0x2e310c,_0x23b554){return function(_0x473f84){_0x23b554[_0x74c4('0x3')](_0x2e310c,_0x473f84);};}function removeListener(_0x49cc33,_0x447567){return function(){ChatGroupEvents['removeListener'](_0x49cc33,_0x447567);};}exports[_0x74c4('0x4')]=function(_0x226d73){for(var _0x2e2a94=0x0,_0xbb0154=events[_0x74c4('0x5')];_0x2e2a94<_0xbb0154;_0x2e2a94++){var _0x5ee6e2=events[_0x2e2a94];var _0x1c477f=createListener(_0x74c4('0x6')+_0x5ee6e2,_0x226d73);ChatGroupEvents['on'](_0x5ee6e2,_0x1c477f);}}; \ No newline at end of file +var _0xfd12=['emit','removeListener','./chatGroup.events','save','remove','update'];(function(_0x370852,_0x2c7e62){var _0x40cc7e=function(_0x34a439){while(--_0x34a439){_0x370852['push'](_0x370852['shift']());}};_0x40cc7e(++_0x2c7e62);}(_0xfd12,0xf8));var _0x2fd1=function(_0x249e96,_0x3ea39d){_0x249e96=_0x249e96-0x0;var _0x17444c=_0xfd12[_0x249e96];return _0x17444c;};'use strict';var ChatGroupEvents=require(_0x2fd1('0x0'));var events=[_0x2fd1('0x1'),_0x2fd1('0x2'),_0x2fd1('0x3')];function createListener(_0x1889ae,_0x47c394){return function(_0x12bf5d){_0x47c394[_0x2fd1('0x4')](_0x1889ae,_0x12bf5d);};}function removeListener(_0x4a5aef,_0x58368d){return function(){ChatGroupEvents[_0x2fd1('0x5')](_0x4a5aef,_0x58368d);};}exports['register']=function(_0x238d53){for(var _0x3e6c6d=0x0,_0x1ed3ce=events['length'];_0x3e6c6d<_0x1ed3ce;_0x3e6c6d++){var _0x3fdf32=events[_0x3e6c6d];var _0x4df54d=createListener('chatGroup:'+_0x3fdf32,_0x238d53);ChatGroupEvents['on'](_0x3fdf32,_0x4df54d);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 6f77fcf..b29fed8 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 _0x8225=['removeMembers','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/describe','describe','show','/:id/unread','create','post','/:id/members','addMembers','addMessage','delete','/:id','destroy'];(function(_0x3c4682,_0x270dd2){var _0x102849=function(_0x27a6d2){while(--_0x27a6d2){_0x3c4682['push'](_0x3c4682['shift']());}};_0x102849(++_0x270dd2);}(_0x8225,0x152));var _0x5822=function(_0x3f19be,_0x5299ab){_0x3f19be=_0x3f19be-0x0;var _0x240471=_0x8225[_0x3f19be];return _0x240471;};'use strict';var multer=require('multer');var util=require(_0x5822('0x0'));var path=require(_0x5822('0x1'));var timeout=require('connect-timeout');var express=require(_0x5822('0x2'));var router=express['Router']();var fs_extra=require(_0x5822('0x3'));var auth=require(_0x5822('0x4'));var interaction=require(_0x5822('0x5'));var config=require(_0x5822('0x6'));var controller=require(_0x5822('0x7'));router[_0x5822('0x8')]('/',auth[_0x5822('0x9')](),controller['index']);router[_0x5822('0x8')](_0x5822('0xa'),auth[_0x5822('0x9')](),controller[_0x5822('0xb')]);router[_0x5822('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x5822('0xc')]);router[_0x5822('0x8')](_0x5822('0xd'),auth['isAuthenticated'](),controller['getUnread']);router[_0x5822('0x8')]('/:id/members',auth[_0x5822('0x9')](),controller['getMembers']);router['get']('/:id/messages',auth[_0x5822('0x9')](),controller['getMessages']);router['post']('/',auth[_0x5822('0x9')](),controller[_0x5822('0xe')]);router[_0x5822('0xf')](_0x5822('0x10'),auth['isAuthenticated'](),controller[_0x5822('0x11')]);router[_0x5822('0xf')]('/:id/messages',auth[_0x5822('0x9')](),controller[_0x5822('0x12')]);router['put']('/:id',auth[_0x5822('0x9')](),controller['update']);router[_0x5822('0x13')](_0x5822('0x14'),auth['isAuthenticated'](),controller[_0x5822('0x15')]);router[_0x5822('0x13')](_0x5822('0x10'),auth[_0x5822('0x9')](),controller[_0x5822('0x16')]);module[_0x5822('0x17')]=router; \ No newline at end of file +var _0xa127=['/describe','isAuthenticated','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','addMessage','/:id','update','delete','removeMembers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatGroup.controller','index','get'];(function(_0xbb8e1f,_0x2612f6){var _0x49172c=function(_0xb2b222){while(--_0xb2b222){_0xbb8e1f['push'](_0xbb8e1f['shift']());}};_0x49172c(++_0x2612f6);}(_0xa127,0x16c));var _0x7a12=function(_0x37c30d,_0x468ca2){_0x37c30d=_0x37c30d-0x0;var _0x3142ba=_0xa127[_0x37c30d];return _0x3142ba;};'use strict';var multer=require(_0x7a12('0x0'));var util=require(_0x7a12('0x1'));var path=require('path');var timeout=require(_0x7a12('0x2'));var express=require(_0x7a12('0x3'));var router=express[_0x7a12('0x4')]();var fs_extra=require(_0x7a12('0x5'));var auth=require(_0x7a12('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7a12('0x7'));var controller=require(_0x7a12('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7a12('0x9')]);router[_0x7a12('0xa')](_0x7a12('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x7a12('0xa')]('/:id',auth[_0x7a12('0xc')](),controller['show']);router[_0x7a12('0xa')](_0x7a12('0xd'),auth[_0x7a12('0xc')](),controller[_0x7a12('0xe')]);router[_0x7a12('0xa')](_0x7a12('0xf'),auth[_0x7a12('0xc')](),controller[_0x7a12('0x10')]);router[_0x7a12('0xa')](_0x7a12('0x11'),auth['isAuthenticated'](),controller['getMessages']);router[_0x7a12('0x12')]('/',auth[_0x7a12('0xc')](),controller['create']);router[_0x7a12('0x12')](_0x7a12('0xf'),auth[_0x7a12('0xc')](),controller['addMembers']);router[_0x7a12('0x12')](_0x7a12('0x11'),auth[_0x7a12('0xc')](),controller[_0x7a12('0x13')]);router['put'](_0x7a12('0x14'),auth[_0x7a12('0xc')](),controller[_0x7a12('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x7a12('0x16')]('/:id/members',auth[_0x7a12('0xc')](),controller[_0x7a12('0x17')]);module[_0x7a12('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index e23918f..52b4af4 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 _0xcf6f=['TEXT','STRING','long','DATE','out','INTEGER','sequelize','BOOLEAN','ENUM','thumb','star'];(function(_0x4464f3,_0x47ad4f){var _0x3f5311=function(_0x14980b){while(--_0x14980b){_0x4464f3['push'](_0x4464f3['shift']());}};_0x3f5311(++_0x47ad4f);}(_0xcf6f,0x12f));var _0xfcf6=function(_0xa53cd9,_0x2e2a8b){_0xa53cd9=_0xa53cd9-0x0;var _0x139dc7=_0xcf6f[_0xa53cd9];return _0x139dc7;};'use strict';var Sequelize=require(_0xfcf6('0x0'));module['exports']={'closed':{'type':Sequelize[_0xfcf6('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xfcf6('0x2')]('star',_0xfcf6('0x3')),'defaultValue':_0xfcf6('0x4')},'ratingMessage':{'type':Sequelize[_0xfcf6('0x5')]},'pathTranscript':{'type':Sequelize[_0xfcf6('0x5')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xfcf6('0x6')]},'secondDisposition':{'type':Sequelize[_0xfcf6('0x6')]},'thirdDisposition':{'type':Sequelize[_0xfcf6('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xfcf6('0x6')]},'browserVersion':{'type':Sequelize[_0xfcf6('0x6')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xfcf6('0x6')]},'deviceVendor':{'type':Sequelize[_0xfcf6('0x6')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xfcf6('0x5')]},'customerIp':{'type':Sequelize[_0xfcf6('0x6')]},'formData':{'type':Sequelize[_0xfcf6('0x5')](_0xfcf6('0x7'))},'read1stAt':{'type':Sequelize[_0xfcf6('0x8')]},'lastMsgAt':{'type':Sequelize[_0xfcf6('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xfcf6('0x2')]('in',_0xfcf6('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xfcf6('0x6')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xfcf6('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xfcf6('0xa')]}}; \ No newline at end of file +var _0x7bd8=['out','exports','BOOLEAN','INTEGER','ENUM','star','STRING','TEXT','DATE'];(function(_0x2df387,_0x1d3ea1){var _0x3b1708=function(_0x49c05b){while(--_0x49c05b){_0x2df387['push'](_0x2df387['shift']());}};_0x3b1708(++_0x1d3ea1);}(_0x7bd8,0xe2));var _0x87bd=function(_0x13665d,_0x55849d){_0x13665d=_0x13665d-0x0;var _0x2b55f4=_0x7bd8[_0x13665d];return _0x2b55f4;};'use strict';var Sequelize=require('sequelize');module[_0x87bd('0x0')]={'closed':{'type':Sequelize[_0x87bd('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x87bd('0x2')]},'ratingType':{'type':Sequelize[_0x87bd('0x3')]('star','thumb'),'defaultValue':_0x87bd('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x87bd('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x87bd('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x87bd('0x5')]},'note':{'type':Sequelize[_0x87bd('0x5')]},'browserName':{'type':Sequelize[_0x87bd('0x5')]},'browserVersion':{'type':Sequelize[_0x87bd('0x5')]},'osName':{'type':Sequelize[_0x87bd('0x5')]},'osVersion':{'type':Sequelize[_0x87bd('0x5')]},'deviceModel':{'type':Sequelize[_0x87bd('0x5')]},'deviceVendor':{'type':Sequelize[_0x87bd('0x5')]},'deviceType':{'type':Sequelize[_0x87bd('0x5')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x87bd('0x5')]},'formData':{'type':Sequelize[_0x87bd('0x6')]('long')},'read1stAt':{'type':Sequelize[_0x87bd('0x7')]},'lastMsgAt':{'type':Sequelize[_0x87bd('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x87bd('0x3')]('in',_0x87bd('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x87bd('0x5')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x87bd('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x87bd('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x87bd('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 1a64232..8a63861 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 _0x89e6=['client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','stack','name','render','merge','body','agent','interaction','account','map','rawAttributes','fieldName','type','getOptions','query','user','show','params','model','ChatInteraction','filters','intersection','attributes','fields','includeAll','include','options','find','create','update','describe','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','fullname','email','contact','POST','isNull','vidaooNote','follow','vidaooMetadata','parse','metadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','UserId','Sequelize','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','originalname','basename','mimetype','Attachment','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','User','ChatWebsiteId','length','System','customer','%s%d','Visitor','agentIdentifier','website_alias','alias','agent_fullname','agentAlias','[%s]\x20%s:\x20%s\x0a','createdAt','direction','secret','appendFileSync','MailAccount','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','ChatMessage','keys','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','includeAgent','addTags','setTags','spread','Tag','findAll','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','transcript-%d-%s.zip','Contact','lastName','push','read','Owner','mkdirSync','Chat','Account','N.A.','closedAt','browserName','osName','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','firstName','value','renderFile','transcript-','.pdf','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','jayson/promise'];(function(_0x318256,_0xa773f3){var _0xb1e352=function(_0x4bb14e){while(--_0x4bb14e){_0x318256['push'](_0x318256['shift']());}};_0xb1e352(++_0xa773f3);}(_0x89e6,0x18c));var _0x689e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x89e6[_0x14add3];return _0x4a174f;};'use strict';var rimraf=require(_0x689e('0x0'));var zipdir=require(_0x689e('0x1'));var rp=require(_0x689e('0x2'));var moment=require(_0x689e('0x3'));var BPromise=require(_0x689e('0x4'));var Mustache=require('mustache');var util=require(_0x689e('0x5'));var path=require(_0x689e('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x689e('0x7'));var Redis=require(_0x689e('0x8'));var interaction=require(_0x689e('0x9'));var qs=require(_0x689e('0xa'));var pdf=require(_0x689e('0xb'));var logger=require(_0x689e('0xc'))(_0x689e('0xd'));var config=require(_0x689e('0xe'));var db=require(_0x689e('0xf'))['db'];config[_0x689e('0x10')]=_[_0x689e('0x11')](config[_0x689e('0x10')],{'host':_0x689e('0x12'),'port':0x18eb});var socket=require(_0x689e('0x13'))(new Redis(config['redis']));require(_0x689e('0x14'))['register'](socket);var jayson=require(_0x689e('0x15'));var client=jayson[_0x689e('0x16')]['http']({'port':0x232b});var client9004=jayson[_0x689e('0x16')][_0x689e('0x17')]({'port':0x232c});function respondWithRpcPromise(_0x353c15,_0x39fe7d,_0x4c2624,_0x11a401){return new BPromise(function(_0x2aac49,_0x493606){var _0x5a8776=_0x11a401||client;return _0x5a8776['request'](_0x353c15,_0x4c2624)[_0x689e('0x18')](function(_0x3ecc30){logger[_0x689e('0x19')](_0x689e('0x1a'),_0x39fe7d,_0x689e('0x1b'));logger[_0x689e('0x1c')](_0x689e('0x1d'),_0x39fe7d,_0x689e('0x1b'),JSON[_0x689e('0x1e')](_0x3ecc30));if(_0x3ecc30[_0x689e('0x1f')]){if(_0x3ecc30[_0x689e('0x1f')][_0x689e('0x20')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x39fe7d,_0x3ecc30[_0x689e('0x1f')][_0x689e('0x21')]);return _0x493606(_0x3ecc30[_0x689e('0x1f')]['message']);}logger[_0x689e('0x1f')](_0x689e('0x1a'),_0x39fe7d,_0x3ecc30[_0x689e('0x1f')][_0x689e('0x21')]);return _0x2aac49(_0x3ecc30[_0x689e('0x1f')][_0x689e('0x21')]);}else{logger[_0x689e('0x19')](_0x689e('0x1a'),_0x39fe7d,_0x689e('0x1b'));_0x2aac49(_0x3ecc30[_0x689e('0x22')]['message']);}})[_0x689e('0x23')](function(_0x2f4028){logger[_0x689e('0x1f')](_0x689e('0x1a'),_0x39fe7d,_0x2f4028);_0x493606(_0x2f4028);});});}function respondWithStatusCode(_0xc16e80,_0x489b25){_0x489b25=_0x489b25||0xcc;return function(_0x136ad9){if(_0x136ad9){return _0xc16e80[_0x689e('0x24')](_0x489b25);}return _0xc16e80[_0x689e('0x25')](_0x489b25)[_0x689e('0x26')]();};}function respondWithResult(_0x59f58a,_0x533d4f){_0x533d4f=_0x533d4f||0xc8;return function(_0x33e202){if(_0x33e202){return _0x59f58a[_0x689e('0x25')](_0x533d4f)[_0x689e('0x27')](_0x33e202);}};}function respondWithFilteredResult(_0x2d1b59,_0x4fdc18){return function(_0x15d33f){if(_0x15d33f){var _0x4b5e9a=typeof _0x4fdc18[_0x689e('0x28')]===_0x689e('0x29')&&typeof _0x4fdc18[_0x689e('0x2a')]==='undefined';var _0x3650d7=_0x15d33f[_0x689e('0x2b')];var _0x1b7875=_0x4b5e9a?0x0:_0x4fdc18[_0x689e('0x28')];var _0x24ee82=_0x4b5e9a?_0x15d33f[_0x689e('0x2b')]:_0x4fdc18['offset']+_0x4fdc18['limit'];var _0x3a0248;if(_0x24ee82>=_0x3650d7){_0x24ee82=_0x3650d7;_0x3a0248=0xc8;}else{_0x3a0248=0xce;}_0x2d1b59[_0x689e('0x25')](_0x3a0248);return _0x2d1b59[_0x689e('0x2c')](_0x689e('0x2d'),_0x1b7875+'-'+_0x24ee82+'/'+_0x3650d7)['json'](_0x15d33f);}return null;};}function saveUpdates(_0x18046a){return function(_0x5278a4){if(_0x5278a4){return _0x5278a4['update'](_0x18046a)[_0x689e('0x18')](function(_0x3235d7){return _0x3235d7;});}return null;};}function removeEntity(_0x52f351){return function(_0x422f6b){if(_0x422f6b){return _0x422f6b[_0x689e('0x2e')]()[_0x689e('0x18')](function(){_0x52f351[_0x689e('0x25')](0xcc)[_0x689e('0x26')]();});}};}function handleEntityNotFound(_0x5573a9){return function(_0x3c2928){if(!_0x3c2928){_0x5573a9[_0x689e('0x24')](0x194);}return _0x3c2928;};}function handleError(_0x52c169,_0x241725){_0x241725=_0x241725||0x1f4;return function(_0x15c813){logger[_0x689e('0x1f')](_0x15c813[_0x689e('0x2f')]);if(_0x15c813[_0x689e('0x30')]){delete _0x15c813['name'];}_0x52c169[_0x689e('0x25')](_0x241725)['send'](_0x15c813);};}function getMustacheRender(_0x52b355,_0x17d5a1){return Mustache[_0x689e('0x31')](_0x52b355,_[_0x689e('0x32')](_0x17d5a1[_0x689e('0x33')],{'contact':_0x17d5a1['contact'],'message':_0x17d5a1['message'],'agent':_0x17d5a1[_0x689e('0x34')],'interaction':_0x17d5a1[_0x689e('0x35')],'account':_0x17d5a1[_0x689e('0x36')]}))||'';}exports['index']=function(_0x351d89,_0x3333b0){var _0x3d8c14={};var _0x370e9e=_[_0x689e('0x37')](db['ChatInteraction'][_0x689e('0x38')],function(_0x385cf1){return{'name':_0x385cf1[_0x689e('0x39')],'type':_0x385cf1[_0x689e('0x3a')]['key']};});_0x3d8c14=qs[_0x689e('0x3b')](_0x370e9e,_0x351d89);return interaction['findAll']('chat',_0x351d89[_0x689e('0x3c')],_0x351d89[_0x689e('0x3d')],_0x3d8c14,_0x370e9e)[_0x689e('0x18')](respondWithFilteredResult(_0x3333b0,_0x3d8c14))[_0x689e('0x23')](handleError(_0x3333b0,null));};exports[_0x689e('0x3e')]=function(_0x40e776,_0x7b66fb){var _0x3b7666={'raw':![],'where':{'id':_0x40e776[_0x689e('0x3f')]['id']}},_0x14e5fe={};_0x14e5fe[_0x689e('0x40')]=_['keys'](db[_0x689e('0x41')]['rawAttributes']);_0x14e5fe[_0x689e('0x3c')]=_['keys'](_0x40e776[_0x689e('0x3c')]);_0x14e5fe[_0x689e('0x42')]=_[_0x689e('0x43')](_0x14e5fe[_0x689e('0x40')],_0x14e5fe[_0x689e('0x3c')]);_0x3b7666[_0x689e('0x44')]=_['intersection'](_0x14e5fe[_0x689e('0x40')],qs[_0x689e('0x45')](_0x40e776[_0x689e('0x3c')]['fields']));_0x3b7666[_0x689e('0x44')]=_0x3b7666[_0x689e('0x44')]['length']?_0x3b7666[_0x689e('0x44')]:_0x14e5fe[_0x689e('0x40')];if(_0x40e776['query'][_0x689e('0x46')]){_0x3b7666[_0x689e('0x47')]=[{'all':!![]}];}_0x3b7666=_[_0x689e('0x32')]({},_0x3b7666,_0x40e776[_0x689e('0x48')]);return db[_0x689e('0x41')][_0x689e('0x49')](_0x3b7666)[_0x689e('0x18')](handleEntityNotFound(_0x7b66fb,null))['then'](respondWithResult(_0x7b66fb,null))['catch'](handleError(_0x7b66fb,null));};exports['create']=function(_0x25d6b8,_0x342f90){return db['ChatInteraction'][_0x689e('0x4a')](_0x25d6b8[_0x689e('0x33')],{})['then'](respondWithResult(_0x342f90,0xc9))['catch'](handleError(_0x342f90,null));};exports[_0x689e('0x4b')]=function(_0x47d35a,_0x5e2377){if(_0x47d35a[_0x689e('0x33')]['id']){delete _0x47d35a[_0x689e('0x33')]['id'];}return db[_0x689e('0x41')][_0x689e('0x49')]({'where':{'id':_0x47d35a['params']['id']}})[_0x689e('0x18')](handleEntityNotFound(_0x5e2377,null))[_0x689e('0x18')](saveUpdates(_0x47d35a[_0x689e('0x33')],null))[_0x689e('0x18')](respondWithResult(_0x5e2377,null))['catch'](handleError(_0x5e2377,null));};exports[_0x689e('0x2e')]=function(_0x433932,_0x38a488){return db[_0x689e('0x41')][_0x689e('0x49')]({'where':{'id':_0x433932[_0x689e('0x3f')]['id']}})[_0x689e('0x18')](handleEntityNotFound(_0x38a488,null))[_0x689e('0x18')](removeEntity(_0x38a488,null))[_0x689e('0x23')](handleError(_0x38a488,null));};exports[_0x689e('0x4c')]=function(_0x1d0273,_0xdbd1ce){return db[_0x689e('0x41')][_0x689e('0x4c')]()[_0x689e('0x18')](respondWithResult(_0xdbd1ce,null))['catch'](handleError(_0xdbd1ce,null));};exports['createVidaooSession']=function(_0x363cb9,_0x3f4513){var _0x748285=_0x363cb9[_0x689e('0x3f')]['id'];var _0xa33ab2;var _0x1dfe03;var _0x4bed94;return db[_0x689e('0x41')][_0x689e('0x4d')]({'where':{'id':_0x748285}})['then'](function(_0x3a3f20){_0xa33ab2=_0x3a3f20;return db[_0x689e('0x4e')][_0x689e('0x4d')]({'where':{'id':_0x3a3f20['ChatWebsiteId']},'attributes':['id',_0x689e('0x4f'),_0x689e('0x50'),_0x689e('0x51'),'vidaooNote','vidaooMetadata'],'raw':!![]});})[_0x689e('0x18')](function(_0x5b04b4){if(_0x5b04b4&&_0x5b04b4[_0x689e('0x4f')]&&_0x5b04b4['vidaooEscalation']){_0x1dfe03=_0x5b04b4;var _0x1ace3d={'interaction':{'id':_0x748285},'agent':{'id':_0x363cb9[_0x689e('0x3d')]['id'],'name':_0x363cb9[_0x689e('0x3d')]['name'],'fullname':_0x363cb9[_0x689e('0x3d')][_0x689e('0x52')],'email':_0x363cb9[_0x689e('0x3d')][_0x689e('0x53')]},'contact':_0x363cb9[_0x689e('0x33')][_0x689e('0x54')],'account':_0x363cb9[_0x689e('0x33')]['account']};var _0x2ec6ba={'rejectUnauthorized':![],'method':_0x689e('0x55'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x5b04b4[_0x689e('0x4f')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x363cb9[_0x689e('0x3d')][_0x689e('0x53')]],'buttons':null,'topic':_0x1dfe03['vidaooTopic'],'note':_[_0x689e('0x56')](_0x1dfe03[_0x689e('0x57')])?null:getMustacheRender(_0x1dfe03[_0x689e('0x57')],_0x1ace3d),'metadata':null},'redirect':_0x689e('0x58'),'json':!![]};try{if(!_['isNull'](_0x1dfe03[_0x689e('0x59')])){var _0x43de72=getMustacheRender(_0x1dfe03[_0x689e('0x59')],_0x1ace3d);var _0x511f2e=JSON[_0x689e('0x5a')](_0x43de72);_0x2ec6ba['body'][_0x689e('0x5b')]=_0x511f2e;}}catch(_0x484f74){throw new db['Sequelize'][(_0x689e('0x5c'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x2ec6ba);}else{throw new db['Sequelize'][(_0x689e('0x5c'))](_0x689e('0x5d'));}})[_0x689e('0x18')](function(_0x3185cf){_0x4bed94=_0x3185cf;if(_0x4bed94['id']){var _0x1f1ea7={'body':_0x4bed94[_0x689e('0x5e')],'ChatWebsiteId':_0x1dfe03['id'],'ChatInteractionId':_0xa33ab2['id'],'direction':_0x689e('0x5f'),'UserId':_0x363cb9[_0x689e('0x3d')]['id']};return db['ChatMessage'][_0x689e('0x4a')](_0x1f1ea7,{});}else{throw new db['Sequelize']['ValidationError'](_0x689e('0x60'));}})[_0x689e('0x18')](function(){return _0xa33ab2['updateAttributes']({'vidaooSessionId':_0x4bed94['id']});})[_0x689e('0x18')](respondWithResult(_0x3f4513,null))['catch'](handleError(_0x3f4513,null));};exports[_0x689e('0x61')]=function(_0x35ec05,_0x169378){if(_0x35ec05[_0x689e('0x33')]['id']){delete _0x35ec05[_0x689e('0x33')]['id'];}return db[_0x689e('0x41')][_0x689e('0x49')]({'where':{'id':_0x35ec05[_0x689e('0x3f')]['id']},'include':[{'model':db[_0x689e('0x62')],'as':'Contact'}]})[_0x689e('0x18')](handleEntityNotFound(_0x169378,null))[_0x689e('0x18')](saveUpdates(_0x35ec05[_0x689e('0x33')],null))[_0x689e('0x18')](respondWithResult(_0x169378,null))['catch'](handleError(_0x169378,null));};exports['abandon']=function(_0x2ba647,_0x16f21a){if(_0x2ba647[_0x689e('0x33')]['id']){delete _0x2ba647['body']['id'];}return db[_0x689e('0x41')][_0x689e('0x49')]({'where':{'id':_0x2ba647['params']['id']}})[_0x689e('0x18')](function(_0x5f1c9c){if(!_0x5f1c9c){logger[_0x689e('0x1f')](_0x689e('0x63'),_0x689e('0x64'),0x194,_0x689e('0x65'));_0x16f21a[_0x689e('0x24')](0x194);}else{if(_0x5f1c9c[_0x689e('0x66')]){throw new db[(_0x689e('0x67'))][(_0x689e('0x5c'))](_0x689e('0x68'));}}return _0x5f1c9c;})[_0x689e('0x18')](function(_0xe4ae1e){if(_0xe4ae1e){return _0xe4ae1e[_0x689e('0x4b')]({'closed':_0x2ba647[_0x689e('0x33')][_0x689e('0x69')],'disposition':_0x2ba647[_0x689e('0x33')][_0x689e('0x6a')]})[_0x689e('0x18')](function(_0x738c62){return _0x738c62;});}})[_0x689e('0x18')](function(){return respondWithRpcPromise(_0x689e('0x6b'),_0x689e('0x64'),_0x2ba647['body'],client9004);})[_0x689e('0x18')](respondWithResult(_0x16f21a,null))[_0x689e('0x23')](handleError(_0x16f21a,null));};exports['attachmentUpload']=function(_0x48a993,_0xb3ece){_0x48a993[_0x689e('0x33')][_0x689e('0x30')]=_0x48a993[_0x689e('0x6c')][_0x689e('0x6d')];_0x48a993[_0x689e('0x33')][_0x689e('0x6e')]=_0x48a993[_0x689e('0x6c')]['filename'];_0x48a993[_0x689e('0x33')][_0x689e('0x3a')]=_0x48a993['file'][_0x689e('0x6f')];return db[_0x689e('0x70')][_0x689e('0x4a')](_0x48a993[_0x689e('0x33')])['then'](respondWithResult(_0xb3ece,0xc9))[_0x689e('0x23')](handleError(_0xb3ece,null));};exports['attachmentDownload']=function(_0x435808,_0x1e2562){return db['ChatInteraction'][_0x689e('0x4d')]({'where':{'id':_0x435808[_0x689e('0x3f')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1e2562,null))['then'](function(_0x4c769d){if(_0x4c769d){if(_0x4c769d[_0x689e('0x69')]){return _0x1e2562[_0x689e('0x25')](0x193)['json']({'status':0x193,'message':_0x689e('0x71')});}return db[_0x689e('0x70')]['findOne']({'where':{'id':_0x435808[_0x689e('0x3c')][_0x689e('0x72')]},'raw':!![]})[_0x689e('0x18')](handleEntityNotFound(_0x1e2562,null));}})['then'](function(_0x55e369){if(_0x55e369){var _0x553a2e=_0x55e369[_0x689e('0x73')]!==null;var _0x529086=path[_0x689e('0x74')](config[_0x689e('0x75')],_0x689e('0x76'));if(_0x553a2e){_0x529086=path[_0x689e('0x74')](_0x529086,_0x689e('0x77'));}var _0x4043d5=path[_0x689e('0x74')](_0x529086,_0x55e369['basename']);return _0x1e2562[_0x689e('0x78')](_0x4043d5);}})[_0x689e('0x23')](handleError(_0x1e2562,null));};exports[_0x689e('0x79')]=function(_0x31f998,_0x1f6106){var _0x4d765e=null;var _0x30f459=null;var _0x55e66b=null;if(_0x31f998[_0x689e('0x33')]['id']){delete _0x31f998[_0x689e('0x33')]['id'];}if(_0x31f998['body'][_0x689e('0x7a')]){_0x55e66b=path['join'](config['root'],_0x689e('0x7b'),util[_0x689e('0x7c')](_0x689e('0x7d'),Date[_0x689e('0x7e')]()));_0x31f998['body'][_0x689e('0x7f')]=_0x55e66b;}return db[_0x689e('0x41')][_0x689e('0x49')]({'where':{'id':_0x31f998['params']['id']},'include':[{'model':db['ChatMessage'],'as':_0x689e('0x80'),'include':[{'model':db[_0x689e('0x81')],'as':'User'}]}]})[_0x689e('0x18')](handleEntityNotFound(_0x1f6106,null))[_0x689e('0x18')](saveUpdates(_0x31f998[_0x689e('0x33')],null))[_0x689e('0x18')](function(_0x6a63e){if(_0x6a63e){_0x4d765e=_0x6a63e;return db[_0x689e('0x4e')][_0x689e('0x49')]({'where':{'id':_0x4d765e[_0x689e('0x82')]}});}})[_0x689e('0x18')](function(_0xec6fe3){if(_0xec6fe3){_0x30f459=_0xec6fe3;return db['CmContact'][_0x689e('0x49')]({'where':{'id':_0x4d765e['ContactId']}});}})[_0x689e('0x18')](function(_0x6ccd06){if(_0x6ccd06){if(_0x55e66b){var _0x47a4b8=null;for(var _0x102e64=0x1;_0x102e64<_0x4d765e[_0x689e('0x80')][_0x689e('0x83')];++_0x102e64){_0x47a4b8=_0x4d765e['Messages'][_0x102e64];var _0x41ef16=_0x47a4b8[_0x689e('0x66')]?util[_0x689e('0x7c')]('%s%d',_0x30f459['agentAlias'],_0x47a4b8['UserId']):_0x689e('0x84');var _0x5b858f=_0x31f998[_0x689e('0x33')][_0x689e('0x85')]||util[_0x689e('0x7c')](_0x689e('0x86'),_0x689e('0x87'),_0x47a4b8['ContactId']);switch(_0x30f459[_0x689e('0x88')]){case _0x689e('0x89'):_0x41ef16=_0x47a4b8[_0x689e('0x66')]?util[_0x689e('0x7c')](_0x689e('0x86'),_0x30f459['agentAlias'],_0x47a4b8['UserId']):_0x689e('0x84');break;case'agent_alias':_0x41ef16=_0x47a4b8['UserId']?_0x47a4b8['User'][_0x689e('0x8a')]||_0x47a4b8['User'][_0x689e('0x52')]:_0x689e('0x84');break;case _0x689e('0x8b'):_0x41ef16=_0x47a4b8['UserId']?_0x47a4b8[_0x689e('0x81')]['fullname']:_0x689e('0x84');break;default:_0x41ef16=_0x47a4b8[_0x689e('0x66')]?util[_0x689e('0x7c')](_0x689e('0x86'),_0x30f459[_0x689e('0x8c')],_0x47a4b8[_0x689e('0x66')]):_0x689e('0x84');}var _0x4096dc=util[_0x689e('0x7c')](_0x689e('0x8d'),moment(_0x47a4b8[_0x689e('0x8e')])[_0x689e('0x7c')]('MM/DD/YYYY\x20HH:mm:ss'),_0x47a4b8[_0x689e('0x8f')]==='in'?_0x5b858f:_0x41ef16,_0x47a4b8['body']);if(!_0x47a4b8[_0x689e('0x90')]){fs[_0x689e('0x91')](_0x55e66b,_0x4096dc);}}return db[_0x689e('0x92')][_0x689e('0x4d')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x689e('0x93'),'raw':!![],'include':[{'model':db[_0x689e('0x94')],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x689e('0x18')](function(_0x243bf8){if(!_0x243bf8||!_0x243bf8[_0x689e('0x93')]||!_0x31f998[_0x689e('0x33')])return _0x4d765e;var _0x23f20e=_0x243bf8[_0x689e('0x95')]();return respondWithRpcPromise('SendMail',_0x689e('0x96'),{'account':_0x23f20e,'message':{'from':util[_0x689e('0x7c')](_0x689e('0x97'),_0x243bf8['name'],_0x243bf8['email']||_0x243bf8[_0x689e('0x93')][_0x689e('0x3d')]),'to':_0x31f998[_0x689e('0x33')][_0x689e('0x7a')],'subject':'Mail\x20Transcript','text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x31f998['body']['mailTranscript']),'attachments':[{'path':_0x55e66b}]}})['then'](function(){return _0x4d765e;})[_0x689e('0x23')](function(_0x40d0a3){logger['error'](_0x40d0a3);});})['then'](respondWithStatusCode(_0x1f6106,0xc8))[_0x689e('0x23')](handleError(_0x1f6106,null));};exports[_0x689e('0x98')]=function(_0x79f5fb,_0x4957b9){return db['ChatMessage']['find']({'where':{'id':_0x79f5fb[_0x689e('0x3f')]['id']}})[_0x689e('0x18')](handleEntityNotFound(_0x4957b9,null))[_0x689e('0x18')](function(_0x5d03be){if(_0x5d03be){return _0x5d03be[_0x689e('0x98')](_0x79f5fb[_0x689e('0x33')][_0x689e('0x99')],_[_0x689e('0x9a')](_0x79f5fb['body'],[_0x689e('0x99'),'id'])||{});}})['then'](respondWithResult(_0x4957b9,null))[_0x689e('0x23')](handleError(_0x4957b9,null));};exports['getMessages']=function(_0x260874,_0x508c12){var _0x380beb={'raw':![],'where':{}};var _0x4a3192={};var _0x573ebd={'count':0x0,'rows':[]};return db[_0x689e('0x41')]['findOne']({'where':{'id':_0x260874[_0x689e('0x3f')]['id']}})[_0x689e('0x18')](handleEntityNotFound(_0x508c12,null))[_0x689e('0x18')](function(_0x4f071a){if(_0x4f071a){_0x4a3192['model']=_['keys'](db[_0x689e('0x9b')][_0x689e('0x38')]);_0x4a3192['query']=_[_0x689e('0x9c')](_0x260874[_0x689e('0x3c')]);_0x4a3192[_0x689e('0x42')]=_['intersection'](_0x4a3192[_0x689e('0x40')],_0x4a3192[_0x689e('0x3c')]);_0x380beb['attributes']=_['intersection'](_0x4a3192[_0x689e('0x40')],qs[_0x689e('0x45')](_0x260874[_0x689e('0x3c')][_0x689e('0x45')]));_0x380beb['attributes']=_0x380beb[_0x689e('0x44')]['length']?_0x380beb[_0x689e('0x44')]:_0x4a3192['model'];if(!_0x260874[_0x689e('0x3c')][_0x689e('0x9d')](_0x689e('0x9e'))){_0x380beb['limit']=qs[_0x689e('0x2a')](_0x260874[_0x689e('0x3c')]['limit']);_0x380beb[_0x689e('0x28')]=qs[_0x689e('0x28')](_0x260874[_0x689e('0x3c')][_0x689e('0x28')]);}_0x380beb[_0x689e('0x9f')]=qs[_0x689e('0xa0')](_0x260874[_0x689e('0x3c')]['sort']);_0x380beb[_0x689e('0xa1')]=qs['filters'](_[_0x689e('0xa2')](_0x260874[_0x689e('0x3c')],_0x4a3192['filters']));_0x380beb[_0x689e('0xa1')][_0x689e('0xa3')]=_0x4f071a['id'];if(_0x260874[_0x689e('0x3c')]['filter']){_0x380beb[_0x689e('0xa1')]=_['merge'](_0x380beb[_0x689e('0xa1')],{'$or':_[_0x689e('0x37')](_0x380beb[_0x689e('0x44')],function(_0x191ebb){var _0x491d45={};_0x491d45[_0x191ebb]={'$like':'%'+_0x260874[_0x689e('0x3c')][_0x689e('0xa4')]+'%'};return _0x491d45;})});}if(_0x260874[_0x689e('0x3c')][_0x689e('0xa5')]){var _0x3eaab3=_0x260874['query'][_0x689e('0xa5')][_0x689e('0xa6')](',');var _0x16e6ba={};_0x16e6ba[_0x3eaab3[0x0]]={'$gte':moment(_0x3eaab3[0x1])[_0x689e('0x7c')](_0x689e('0xa7'))};_0x380beb[_0x689e('0xa1')]=_['merge'](_0x380beb['where'],_0x16e6ba);}_0x380beb=_['merge']({},_0x380beb,_0x260874[_0x689e('0x48')]);return db[_0x689e('0x9b')][_0x689e('0x2b')]({'where':_0x380beb[_0x689e('0xa1')]})[_0x689e('0x18')](function(_0x486289){_0x573ebd[_0x689e('0x2b')]=_0x486289;if(_0x260874[_0x689e('0x3c')]['includeAll']){_0x380beb[_0x689e('0x47')]=[{'all':!![]}];}return db[_0x689e('0x9b')]['findAll'](_0x380beb);})[_0x689e('0x18')](function(_0x5c74b7){_0x573ebd[_0x689e('0xa8')]=_0x5c74b7;return _0x573ebd;});}})[_0x689e('0x18')](respondWithFilteredResult(_0x508c12,_0x380beb))['catch'](handleError(_0x508c12,null));};exports[_0x689e('0xa9')]=function(_0x431b2e,_0x1fc26d){var _0x5baf9d={'where':{}},_0x101ffc={},_0x522bb6={'count':0x0,'rows':[]};return db[_0x689e('0x41')][_0x689e('0x4d')]({'where':{'id':_0x431b2e[_0x689e('0x3f')]['id']}})[_0x689e('0x18')](handleEntityNotFound(_0x1fc26d,null))[_0x689e('0x18')](function(_0x425296){if(_0x425296){_0x101ffc[_0x689e('0x40')]=_[_0x689e('0x9c')](db['ChatMessage']['rawAttributes']);_0x101ffc[_0x689e('0x3c')]=_[_0x689e('0x9c')](_0x431b2e[_0x689e('0x3c')]);_0x101ffc[_0x689e('0x42')]=_[_0x689e('0x43')](_0x101ffc[_0x689e('0x40')],_0x101ffc[_0x689e('0x3c')]);_0x5baf9d[_0x689e('0x44')]=_[_0x689e('0x43')](_0x101ffc[_0x689e('0x40')],qs[_0x689e('0x45')](_0x431b2e[_0x689e('0x3c')][_0x689e('0x45')]));_0x5baf9d[_0x689e('0x44')]=_0x5baf9d[_0x689e('0x44')][_0x689e('0x83')]?_0x5baf9d['attributes']:_0x101ffc[_0x689e('0x40')];if(!_0x431b2e['query'][_0x689e('0x9d')](_0x689e('0x9e'))){_0x5baf9d[_0x689e('0x2a')]=qs[_0x689e('0x2a')](_0x431b2e[_0x689e('0x3c')]['limit']);_0x5baf9d[_0x689e('0x28')]=qs[_0x689e('0x28')](_0x431b2e[_0x689e('0x3c')]['offset']);}_0x5baf9d[_0x689e('0x9f')]=qs['sort'](_0x431b2e[_0x689e('0x3c')]['sort']);_0x5baf9d[_0x689e('0xa1')]=qs[_0x689e('0x42')](_[_0x689e('0xa2')](_0x431b2e[_0x689e('0x3c')],_0x101ffc['filters']));_0x5baf9d[_0x689e('0xa1')][_0x689e('0xa3')]=_0x425296['id'];if(_0x431b2e['query'][_0x689e('0xa4')]){_0x5baf9d[_0x689e('0xa1')]=_[_0x689e('0x32')](_0x5baf9d['where'],{'$or':_[_0x689e('0x37')](_0x5baf9d[_0x689e('0x44')],function(_0x1d42f7){var _0x53f6e2={};_0x53f6e2[_0x1d42f7]={'$like':'%'+_0x431b2e[_0x689e('0x3c')][_0x689e('0xa4')]+'%'};return _0x53f6e2;})});}_0x5baf9d['where'][_0x689e('0x90')]=![];if(_0x431b2e['query']['id']){_0x5baf9d[_0x689e('0xa1')]['id']={'$gt':_0x431b2e[_0x689e('0x3c')]['id']};}_0x5baf9d=_[_0x689e('0x32')]({},_0x5baf9d,_0x431b2e['options']);return db[_0x689e('0x9b')][_0x689e('0x2b')]({'where':_0x5baf9d['where']})[_0x689e('0x18')](function(_0x1ee1ee){_0x522bb6[_0x689e('0x2b')]=_0x1ee1ee;_0x5baf9d[_0x689e('0x47')]=[];if(_0x431b2e[_0x689e('0x3c')][_0x689e('0xaa')]){_0x5baf9d['include']['push']({'model':db[_0x689e('0x81')],'as':_0x689e('0x81'),'attributes':['id',_0x689e('0x52'),'alias']});}if(_0x431b2e[_0x689e('0x3c')]['includeAll']){_0x5baf9d['include']=[{'all':!![]}];}return db[_0x689e('0x9b')]['findAll'](_0x5baf9d);})[_0x689e('0x18')](function(_0x4e7871){_0x522bb6[_0x689e('0xa8')]=_0x4e7871;return _0x522bb6;});}})[_0x689e('0x18')](respondWithFilteredResult(_0x1fc26d,_0x5baf9d))[_0x689e('0x23')](handleError(_0x1fc26d,null));};exports[_0x689e('0xab')]=function(_0x2c98f5,_0x577c82){return db[_0x689e('0x41')][_0x689e('0x49')]({'where':{'id':_0x2c98f5['params']['id']}})[_0x689e('0x18')](handleEntityNotFound(_0x577c82,null))[_0x689e('0x18')](function(_0x402109){if(_0x402109){return _0x402109[_0x689e('0xac')](_0x2c98f5[_0x689e('0x33')][_0x689e('0x99')],_[_0x689e('0x9a')](_0x2c98f5[_0x689e('0x33')],['ids','id'])||{})[_0x689e('0xad')](function(){return db[_0x689e('0xae')][_0x689e('0xaf')]({'attributes':['id',_0x689e('0x30'),'color'],'where':{'id':_0x2c98f5[_0x689e('0x33')][_0x689e('0x99')]}});})[_0x689e('0x18')](function(_0x47e7c9){socket[_0x689e('0xb0')](_0x689e('0xb1'),{'id':Number(_0x2c98f5[_0x689e('0x3f')]['id']),'tags':_0x47e7c9||[]});return{'id':Number(_0x2c98f5[_0x689e('0x3f')]['id']),'tags':_0x47e7c9||[]};});}})[_0x689e('0x18')](respondWithResult(_0x577c82,null))[_0x689e('0x23')](handleError(_0x577c82,null));};exports[_0x689e('0xb2')]=function(_0x2a52a2,_0x15e3d0){return db[_0x689e('0x41')]['find']({'where':{'id':_0x2a52a2[_0x689e('0x3f')]['id']}})[_0x689e('0x18')](handleEntityNotFound(_0x15e3d0,null))['then'](function(_0x3441c6){if(_0x3441c6){return _0x3441c6[_0x689e('0xb2')](_0x2a52a2[_0x689e('0x3c')][_0x689e('0x99')]);}})[_0x689e('0x18')](respondWithStatusCode(_0x15e3d0,null))[_0x689e('0x23')](handleError(_0x15e3d0,null));};exports[_0x689e('0x78')]=function(_0x2caf68,_0x2adf61){var _0x3a982c=moment()[_0x689e('0xb3')]()[_0x689e('0xb4')]();var _0x3babee=path['join'](config[_0x689e('0x75')],_0x689e('0xb5'),_0x689e('0xb6'),_0x689e('0xb7'));var _0x55941f=path['join'](config[_0x689e('0x75')],_0x689e('0xb5'),'files','attachments');var _0x364ca8=path[_0x689e('0x74')](_0x3babee,_0x3a982c);var _0xce3ba4=util[_0x689e('0x7c')](_0x689e('0xb8'),_0x2caf68['params']['id'],_0x3a982c);var _0x48ca6a=path['join'](_0x3babee,_0xce3ba4);var _0xa27384=[];_0xa27384['push']({'model':db[_0x689e('0x81')],'as':'User','attributes':['id',_0x689e('0x52')],'raw':!![]});_0xa27384['push']({'model':db['CmContact'],'as':_0x689e('0xb9'),'attributes':['id','firstName',_0x689e('0xba')],'raw':!![]});if(_0x2caf68[_0x689e('0x3c')]['attachments']){_0xa27384[_0x689e('0xbb')]({'model':db[_0x689e('0x70')],'as':_0x689e('0x70'),'raw':!![]});}var _0xb18ff5=[{'model':db[_0x689e('0x9b')],'as':'Messages','attributes':['id',_0x689e('0x33'),_0x689e('0x8e'),_0x689e('0x8f'),'secret',_0x689e('0xbc')],'include':_0xa27384}];_0xb18ff5[_0x689e('0xbb')]({'model':db['ChatWebsite'],'as':'Account','attributes':['id',_0x689e('0x30')]});_0xb18ff5[_0x689e('0xbb')]({'model':db['User'],'as':_0x689e('0xbd'),'attributes':['id',_0x689e('0x52')]});return db[_0x689e('0x41')][_0x689e('0x49')]({'where':{'id':_0x2caf68['params']['id']},'include':_0xb18ff5})[_0x689e('0x18')](handleEntityNotFound(_0x2adf61,null))[_0x689e('0x18')](function(_0x28516d){if(_0x28516d){var _0x554039=_0x28516d['get']({'plain':!![]});fs[_0x689e('0xbe')](_0x364ca8);var _0x3742bf={'channel':_0x689e('0xbf'),'account':_0x554039[_0x689e('0xc0')][_0x689e('0x30')],'agent':_0x554039['Owner']?_0x554039[_0x689e('0xbd')][_0x689e('0x52')]:_0x689e('0xc1'),'createdAt':moment(_0x554039[_0x689e('0x8e')])['format'](_0x689e('0xa7'))[_0x689e('0xb4')](),'closedAt':_0x554039[_0x689e('0x69')]?moment(_0x554039[_0x689e('0xc2')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x689e('0xb4')]():'','disposition':_0x554039['disposition'],'chatInfo':{'browser':_0x554039[_0x689e('0xc3')],'os':_0x554039[_0x689e('0xc4')],'referer':_0x554039['referer'],'customerIp':_0x554039[_0x689e('0xc5')],'customerPort':_0x554039[_0x689e('0xc6')]?_0x554039[_0x689e('0xc6')]:'N.A.'},'messages':_(_0x554039[_0x689e('0x80')])[_0x689e('0xc7')]()[_0x689e('0xa4')]({'secret':![]})['map'](function(_0x192160){if(_0x192160[_0x689e('0x70')]){var _0x11d71e=path['join'](_0x55941f,_0x192160[_0x689e('0x70')]['basename']);if(fs[_0x689e('0xc8')](_0x11d71e)){fs['createReadStream'](_0x11d71e)[_0x689e('0xc9')](fs[_0x689e('0xca')](path[_0x689e('0x74')](_0x364ca8,_0x192160[_0x689e('0x70')][_0x689e('0x6e')])));}}return{'date':moment(_0x192160[_0x689e('0x8e')])['format'](_0x689e('0xa7'))[_0x689e('0xb4')](),'sender':_0x192160[_0x689e('0x8f')]===_0x689e('0x5f')?_0x192160[_0x689e('0x81')]?_0x192160['User'][_0x689e('0x52')]:'System':_0x192160[_0x689e('0xb9')][_0x689e('0xcb')]+(_0x192160[_0x689e('0xb9')][_0x689e('0xba')]?'\x20'+_0x192160['Contact'][_0x689e('0xba')]:''),'body':_0x192160['Attachment']?_0x192160[_0x689e('0x70')]['basename']:_0x192160[_0x689e('0x33')],'direction':_0x192160[_0x689e('0x8f')]===_0x689e('0x5f')?'A':'C','secret':_0x192160[_0x689e('0x90')],'read':_0x192160[_0x689e('0xbc')],'attachment':_0x192160[_0x689e('0x70')]};})[_0x689e('0xcc')]()};return ejs[_0x689e('0xcd')](path['join'](config[_0x689e('0x75')],'server','views','downloadInteraction.ejs'),{'interaction':_0x3742bf})[_0x689e('0x18')](function(_0x41464a){var _0x32804c=path[_0x689e('0x74')](_0x364ca8,_0x689e('0xce')+_0x554039['id']+'-'+_0x3a982c+_0x689e('0xcf'));var _0x505e52={'path':_0x32804c,'channel':'Chat','interactionId':_0x554039['id']};return pdf['createPdfFromHTML'](_0x41464a,_0x505e52);})[_0x689e('0x18')](function(){return new Promise(function(_0x2ba195,_0x235d41){zipdir(_0x364ca8,{'saveTo':_0x48ca6a},function(_0x35780f,_0xcf7feb){if(_0x35780f)return _0x235d41(_0x35780f);return _0x2ba195(_0xcf7feb);});})[_0x689e('0x18')](function(){return new BPromise(function(_0x21b111,_0xca82b4){rimraf(_0x364ca8,function(_0x151e1f){if(_0x151e1f)_0xca82b4(_0x151e1f);return _0x21b111();});});})[_0x689e('0x18')](function(){return _0x2adf61[_0x689e('0x78')](_0x48ca6a,_0xce3ba4,function(_0x2edf95){if(_0x2edf95){logger[_0x689e('0x1f')]('err',_0x2edf95);}else{fs[_0x689e('0xd0')](_0x48ca6a);}});});});}else{return _0x2adf61[_0x689e('0x24')](0xc8);}})[_0x689e('0x23')](handleError(_0x2adf61,null));}; \ No newline at end of file +var _0x6be2=['keys','filters','intersection','fields','length','attributes','includeAll','options','ChatInteraction','find','create','update','describe','findOne','ChatWebsiteId','vidaooApiKey','vidaooNote','vidaooMetadata','fullname','email','contact','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooTopic','follow','isNull','parse','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','ValidationError','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','attachmentUpload','originalname','file','filename','type','mimetype','Attachment','attachmentDownload','closed','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','basename','download','close','mailTranscript','transcript-%s.txt','Messages','User','ChatWebsite','CmContact','ContactId','format','UserId','System','customer','Visitor','agentIdentifier','%s%d','agentAlias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','appendFileSync','Smtp','getSmtpOptions','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','order','sort','where','pick','ChatInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','include','rows','getMyMessages','hasOwnProperty','nolimit','secret','push','addTags','Tag','emit','chatInteractionTags:save','removeTags','server','tmp','files','transcript-%d-%s.zip','Contact','firstName','lastName','direction','Account','Owner','get','mkdirSync','N.A.','createdAt','toString','closedAt','osName','customerPort','tail','createReadStream','pipe','value','renderFile','downloadInteraction.ejs','.pdf','Chat','err','unlinkSync','rimraf','zip-dir','moment','mustache','util','path','ejs','ioredis','../../components/parsers/qs','api','../../mysqldb','redis','defaults','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','sendStatus','end','json','offset','undefined','limit','count','set','destroy','status','name','send','render','merge','body','agent','interaction','account','map','rawAttributes','key','getOptions','findAll','chat','query','user','catch','show','params','model'];(function(_0x290ced,_0x2ca190){var _0x39ceae=function(_0x1e3cdf){while(--_0x1e3cdf){_0x290ced['push'](_0x290ced['shift']());}};_0x39ceae(++_0x2ca190);}(_0x6be2,0x147));var _0x26be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6be2[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require(_0x26be('0x0'));var zipdir=require(_0x26be('0x1'));var rp=require('request-promise');var moment=require(_0x26be('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x26be('0x3'));var util=require(_0x26be('0x4'));var path=require(_0x26be('0x5'));var ejs=require(_0x26be('0x6'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x26be('0x7'));var interaction=require('../../components/interaction/service');var qs=require(_0x26be('0x8'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0x26be('0x9'));var config=require('../../config/environment');var db=require(_0x26be('0xa'))['db'];config[_0x26be('0xb')]=_[_0x26be('0xc')](config[_0x26be('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x26be('0xb')]));require(_0x26be('0xd'))[_0x26be('0xe')](socket);var jayson=require(_0x26be('0xf'));var client=jayson[_0x26be('0x10')][_0x26be('0x11')]({'port':0x232b});var client9004=jayson[_0x26be('0x10')][_0x26be('0x11')]({'port':0x232c});function respondWithRpcPromise(_0x227629,_0x2707b6,_0x1b34b3,_0x4ff5e9){return new BPromise(function(_0x12bd2d,_0x1f1ac0){var _0x18767a=_0x4ff5e9||client;return _0x18767a['request'](_0x227629,_0x1b34b3)[_0x26be('0x12')](function(_0x5eba44){logger[_0x26be('0x13')](_0x26be('0x14'),_0x2707b6,'request\x20sent');logger[_0x26be('0x15')](_0x26be('0x16'),_0x2707b6,'request\x20sent',JSON[_0x26be('0x17')](_0x5eba44));if(_0x5eba44['error']){if(_0x5eba44['error'][_0x26be('0x18')]===0x1f4){logger[_0x26be('0x19')](_0x26be('0x14'),_0x2707b6,_0x5eba44['error'][_0x26be('0x1a')]);return _0x1f1ac0(_0x5eba44[_0x26be('0x19')][_0x26be('0x1a')]);}logger[_0x26be('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x2707b6,_0x5eba44[_0x26be('0x19')][_0x26be('0x1a')]);return _0x12bd2d(_0x5eba44['error'][_0x26be('0x1a')]);}else{logger[_0x26be('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x2707b6,_0x26be('0x1b'));_0x12bd2d(_0x5eba44[_0x26be('0x1c')][_0x26be('0x1a')]);}})['catch'](function(_0x5d18f1){logger[_0x26be('0x19')](_0x26be('0x14'),_0x2707b6,_0x5d18f1);_0x1f1ac0(_0x5d18f1);});});}function respondWithStatusCode(_0x3a8639,_0x59bb01){_0x59bb01=_0x59bb01||0xcc;return function(_0x581c2b){if(_0x581c2b){return _0x3a8639[_0x26be('0x1d')](_0x59bb01);}return _0x3a8639['status'](_0x59bb01)[_0x26be('0x1e')]();};}function respondWithResult(_0x369d32,_0x262c94){_0x262c94=_0x262c94||0xc8;return function(_0x1db451){if(_0x1db451){return _0x369d32['status'](_0x262c94)[_0x26be('0x1f')](_0x1db451);}};}function respondWithFilteredResult(_0x3d0424,_0x56a983){return function(_0xf80e5d){if(_0xf80e5d){var _0x1fc1de=typeof _0x56a983[_0x26be('0x20')]===_0x26be('0x21')&&typeof _0x56a983[_0x26be('0x22')]==='undefined';var _0x2bb3e1=_0xf80e5d[_0x26be('0x23')];var _0x503bed=_0x1fc1de?0x0:_0x56a983[_0x26be('0x20')];var _0x5c4801=_0x1fc1de?_0xf80e5d[_0x26be('0x23')]:_0x56a983[_0x26be('0x20')]+_0x56a983[_0x26be('0x22')];var _0x31391c;if(_0x5c4801>=_0x2bb3e1){_0x5c4801=_0x2bb3e1;_0x31391c=0xc8;}else{_0x31391c=0xce;}_0x3d0424['status'](_0x31391c);return _0x3d0424[_0x26be('0x24')]('Content-Range',_0x503bed+'-'+_0x5c4801+'/'+_0x2bb3e1)[_0x26be('0x1f')](_0xf80e5d);}return null;};}function saveUpdates(_0x4feca1){return function(_0x556801){if(_0x556801){return _0x556801['update'](_0x4feca1)[_0x26be('0x12')](function(_0xe8215e){return _0xe8215e;});}return null;};}function removeEntity(_0x4b7a45){return function(_0x3fb781){if(_0x3fb781){return _0x3fb781[_0x26be('0x25')]()[_0x26be('0x12')](function(){_0x4b7a45[_0x26be('0x26')](0xcc)[_0x26be('0x1e')]();});}};}function handleEntityNotFound(_0x40caea){return function(_0x4635cd){if(!_0x4635cd){_0x40caea[_0x26be('0x1d')](0x194);}return _0x4635cd;};}function handleError(_0x4fdda1,_0x284b08){_0x284b08=_0x284b08||0x1f4;return function(_0x5bf73a){logger[_0x26be('0x19')](_0x5bf73a['stack']);if(_0x5bf73a[_0x26be('0x27')]){delete _0x5bf73a['name'];}_0x4fdda1[_0x26be('0x26')](_0x284b08)[_0x26be('0x28')](_0x5bf73a);};}function getMustacheRender(_0x4028ab,_0x9ec039){return Mustache[_0x26be('0x29')](_0x4028ab,_[_0x26be('0x2a')](_0x9ec039[_0x26be('0x2b')],{'contact':_0x9ec039['contact'],'message':_0x9ec039[_0x26be('0x1a')],'agent':_0x9ec039[_0x26be('0x2c')],'interaction':_0x9ec039[_0x26be('0x2d')],'account':_0x9ec039[_0x26be('0x2e')]}))||'';}exports['index']=function(_0x303104,_0xbdc6d2){var _0x574a46={};var _0x48f029=_[_0x26be('0x2f')](db['ChatInteraction'][_0x26be('0x30')],function(_0x2cf6fd){return{'name':_0x2cf6fd['fieldName'],'type':_0x2cf6fd['type'][_0x26be('0x31')]};});_0x574a46=qs[_0x26be('0x32')](_0x48f029,_0x303104);return interaction[_0x26be('0x33')](_0x26be('0x34'),_0x303104[_0x26be('0x35')],_0x303104[_0x26be('0x36')],_0x574a46,_0x48f029)[_0x26be('0x12')](respondWithFilteredResult(_0xbdc6d2,_0x574a46))[_0x26be('0x37')](handleError(_0xbdc6d2,null));};exports[_0x26be('0x38')]=function(_0xe4115c,_0x401d76){var _0x8d6858={'raw':![],'where':{'id':_0xe4115c[_0x26be('0x39')]['id']}},_0x1e27ba={};_0x1e27ba[_0x26be('0x3a')]=_[_0x26be('0x3b')](db['ChatInteraction'][_0x26be('0x30')]);_0x1e27ba['query']=_['keys'](_0xe4115c[_0x26be('0x35')]);_0x1e27ba[_0x26be('0x3c')]=_[_0x26be('0x3d')](_0x1e27ba[_0x26be('0x3a')],_0x1e27ba[_0x26be('0x35')]);_0x8d6858['attributes']=_[_0x26be('0x3d')](_0x1e27ba[_0x26be('0x3a')],qs[_0x26be('0x3e')](_0xe4115c[_0x26be('0x35')][_0x26be('0x3e')]));_0x8d6858['attributes']=_0x8d6858['attributes'][_0x26be('0x3f')]?_0x8d6858[_0x26be('0x40')]:_0x1e27ba[_0x26be('0x3a')];if(_0xe4115c[_0x26be('0x35')][_0x26be('0x41')]){_0x8d6858['include']=[{'all':!![]}];}_0x8d6858=_['merge']({},_0x8d6858,_0xe4115c[_0x26be('0x42')]);return db[_0x26be('0x43')][_0x26be('0x44')](_0x8d6858)[_0x26be('0x12')](handleEntityNotFound(_0x401d76,null))[_0x26be('0x12')](respondWithResult(_0x401d76,null))[_0x26be('0x37')](handleError(_0x401d76,null));};exports[_0x26be('0x45')]=function(_0x3771d8,_0x45ac59){return db[_0x26be('0x43')][_0x26be('0x45')](_0x3771d8['body'],{})[_0x26be('0x12')](respondWithResult(_0x45ac59,0xc9))['catch'](handleError(_0x45ac59,null));};exports[_0x26be('0x46')]=function(_0x39c9d8,_0xcc04de){if(_0x39c9d8[_0x26be('0x2b')]['id']){delete _0x39c9d8['body']['id'];}return db[_0x26be('0x43')]['find']({'where':{'id':_0x39c9d8['params']['id']}})[_0x26be('0x12')](handleEntityNotFound(_0xcc04de,null))[_0x26be('0x12')](saveUpdates(_0x39c9d8['body'],null))[_0x26be('0x12')](respondWithResult(_0xcc04de,null))[_0x26be('0x37')](handleError(_0xcc04de,null));};exports[_0x26be('0x25')]=function(_0x3552fe,_0x52c7a3){return db['ChatInteraction'][_0x26be('0x44')]({'where':{'id':_0x3552fe[_0x26be('0x39')]['id']}})[_0x26be('0x12')](handleEntityNotFound(_0x52c7a3,null))[_0x26be('0x12')](removeEntity(_0x52c7a3,null))[_0x26be('0x37')](handleError(_0x52c7a3,null));};exports[_0x26be('0x47')]=function(_0x64cec,_0x226b5b){return db['ChatInteraction'][_0x26be('0x47')]()[_0x26be('0x12')](respondWithResult(_0x226b5b,null))[_0x26be('0x37')](handleError(_0x226b5b,null));};exports['createVidaooSession']=function(_0x450090,_0xbc932e){var _0x1fb3a5=_0x450090[_0x26be('0x39')]['id'];var _0x93c47e;var _0x5e2284;var _0x4b7b5b;return db['ChatInteraction'][_0x26be('0x48')]({'where':{'id':_0x1fb3a5}})[_0x26be('0x12')](function(_0x1b4c9b){_0x93c47e=_0x1b4c9b;return db['ChatWebsite'][_0x26be('0x48')]({'where':{'id':_0x1b4c9b[_0x26be('0x49')]},'attributes':['id',_0x26be('0x4a'),'vidaooEscalation','vidaooTopic',_0x26be('0x4b'),_0x26be('0x4c')],'raw':!![]});})['then'](function(_0x520896){if(_0x520896&&_0x520896['vidaooApiKey']&&_0x520896['vidaooEscalation']){_0x5e2284=_0x520896;var _0x28c39e={'interaction':{'id':_0x1fb3a5},'agent':{'id':_0x450090[_0x26be('0x36')]['id'],'name':_0x450090[_0x26be('0x36')][_0x26be('0x27')],'fullname':_0x450090[_0x26be('0x36')][_0x26be('0x4d')],'email':_0x450090['user'][_0x26be('0x4e')]},'contact':_0x450090[_0x26be('0x2b')][_0x26be('0x4f')],'account':_0x450090[_0x26be('0x2b')][_0x26be('0x2e')]};var _0xf6cb84={'rejectUnauthorized':![],'method':'POST','url':_0x26be('0x50'),'headers':{'X-APIKEY':_0x520896[_0x26be('0x4a')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x450090[_0x26be('0x36')][_0x26be('0x4e')]],'buttons':null,'topic':_0x5e2284[_0x26be('0x51')],'note':_['isNull'](_0x5e2284['vidaooNote'])?null:getMustacheRender(_0x5e2284[_0x26be('0x4b')],_0x28c39e),'metadata':null},'redirect':_0x26be('0x52'),'json':!![]};try{if(!_[_0x26be('0x53')](_0x5e2284[_0x26be('0x4c')])){var _0x354243=getMustacheRender(_0x5e2284['vidaooMetadata'],_0x28c39e);var _0x304cd4=JSON[_0x26be('0x54')](_0x354243);_0xf6cb84[_0x26be('0x2b')]['metadata']=_0x304cd4;}}catch(_0x228679){throw new db[(_0x26be('0x55'))]['ValidationError']('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0xf6cb84);}else{throw new db[(_0x26be('0x55'))]['ValidationError'](_0x26be('0x56'));}})['then'](function(_0x5ca608){_0x4b7b5b=_0x5ca608;if(_0x4b7b5b['id']){var _0x1fa23c={'body':_0x4b7b5b[_0x26be('0x57')],'ChatWebsiteId':_0x5e2284['id'],'ChatInteractionId':_0x93c47e['id'],'direction':_0x26be('0x58'),'UserId':_0x450090[_0x26be('0x36')]['id']};return db[_0x26be('0x59')]['create'](_0x1fa23c,{});}else{throw new db[(_0x26be('0x55'))][(_0x26be('0x5a'))](_0x26be('0x5b'));}})[_0x26be('0x12')](function(){return _0x93c47e[_0x26be('0x5c')]({'vidaooSessionId':_0x4b7b5b['id']});})[_0x26be('0x12')](respondWithResult(_0xbc932e,null))[_0x26be('0x37')](handleError(_0xbc932e,null));};exports[_0x26be('0x5d')]=function(_0x5d9516,_0x28dece){if(_0x5d9516[_0x26be('0x2b')]['id']){delete _0x5d9516[_0x26be('0x2b')]['id'];}return db[_0x26be('0x43')]['find']({'where':{'id':_0x5d9516['params']['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0x26be('0x12')](handleEntityNotFound(_0x28dece,null))['then'](saveUpdates(_0x5d9516[_0x26be('0x2b')],null))[_0x26be('0x12')](respondWithResult(_0x28dece,null))['catch'](handleError(_0x28dece,null));};exports[_0x26be('0x5e')]=function(_0x16bf8b,_0x5500ce){if(_0x16bf8b[_0x26be('0x2b')]['id']){delete _0x16bf8b[_0x26be('0x2b')]['id'];}return db[_0x26be('0x43')][_0x26be('0x44')]({'where':{'id':_0x16bf8b[_0x26be('0x39')]['id']}})[_0x26be('0x12')](function(_0x22943c){if(!_0x22943c){logger[_0x26be('0x19')](_0x26be('0x5f'),'abandon',0x194,_0x26be('0x60'));_0x5500ce[_0x26be('0x1d')](0x194);}else{if(_0x22943c['UserId']){throw new db[(_0x26be('0x55'))][(_0x26be('0x5a'))](_0x26be('0x61'));}}return _0x22943c;})[_0x26be('0x12')](function(_0x46f9a1){if(_0x46f9a1){return _0x46f9a1['update']({'closed':_0x16bf8b[_0x26be('0x2b')]['closed'],'disposition':_0x16bf8b[_0x26be('0x2b')][_0x26be('0x62')]})[_0x26be('0x12')](function(_0x4977d5){return _0x4977d5;});}})['then'](function(){return respondWithRpcPromise('AbandonInteraction',_0x26be('0x5e'),_0x16bf8b[_0x26be('0x2b')],client9004);})[_0x26be('0x12')](respondWithResult(_0x5500ce,null))[_0x26be('0x37')](handleError(_0x5500ce,null));};exports[_0x26be('0x63')]=function(_0x3c806f,_0x1c1150){_0x3c806f[_0x26be('0x2b')][_0x26be('0x27')]=_0x3c806f['file'][_0x26be('0x64')];_0x3c806f['body']['basename']=_0x3c806f[_0x26be('0x65')][_0x26be('0x66')];_0x3c806f[_0x26be('0x2b')][_0x26be('0x67')]=_0x3c806f[_0x26be('0x65')][_0x26be('0x68')];return db[_0x26be('0x69')][_0x26be('0x45')](_0x3c806f[_0x26be('0x2b')])[_0x26be('0x12')](respondWithResult(_0x1c1150,0xc9))['catch'](handleError(_0x1c1150,null));};exports[_0x26be('0x6a')]=function(_0x2d645a,_0x525269){return db['ChatInteraction'][_0x26be('0x48')]({'where':{'id':_0x2d645a[_0x26be('0x39')]['id']},'raw':!![]})[_0x26be('0x12')](handleEntityNotFound(_0x525269,null))[_0x26be('0x12')](function(_0xb0dc1d){if(_0xb0dc1d){if(_0xb0dc1d[_0x26be('0x6b')]){return _0x525269[_0x26be('0x26')](0x193)[_0x26be('0x1f')]({'status':0x193,'message':'Unauthorized'});}return db[_0x26be('0x69')]['findOne']({'where':{'id':_0x2d645a[_0x26be('0x35')][_0x26be('0x6c')]},'raw':!![]})[_0x26be('0x12')](handleEntityNotFound(_0x525269,null));}})['then'](function(_0x39049e){if(_0x39049e){var _0x26ed51=_0x39049e[_0x26be('0x6d')]!==null;var _0x403f93=path[_0x26be('0x6e')](config[_0x26be('0x6f')],_0x26be('0x70'));if(_0x26ed51){_0x403f93=path[_0x26be('0x6e')](_0x403f93,'offline-chat/');}var _0x58be41=path[_0x26be('0x6e')](_0x403f93,_0x39049e[_0x26be('0x71')]);return _0x525269[_0x26be('0x72')](_0x58be41);}})[_0x26be('0x37')](handleError(_0x525269,null));};exports[_0x26be('0x73')]=function(_0x4b94e5,_0x536d7c){var _0x3513e2=null;var _0x168148=null;var _0xe2cfca=null;if(_0x4b94e5['body']['id']){delete _0x4b94e5[_0x26be('0x2b')]['id'];}if(_0x4b94e5[_0x26be('0x2b')][_0x26be('0x74')]){_0xe2cfca=path[_0x26be('0x6e')](config['root'],'server/files/chat/upload/',util['format'](_0x26be('0x75'),Date['now']()));_0x4b94e5[_0x26be('0x2b')]['pathTranscript']=_0xe2cfca;}return db[_0x26be('0x43')][_0x26be('0x44')]({'where':{'id':_0x4b94e5[_0x26be('0x39')]['id']},'include':[{'model':db[_0x26be('0x59')],'as':_0x26be('0x76'),'include':[{'model':db[_0x26be('0x77')],'as':'User'}]}]})[_0x26be('0x12')](handleEntityNotFound(_0x536d7c,null))[_0x26be('0x12')](saveUpdates(_0x4b94e5[_0x26be('0x2b')],null))[_0x26be('0x12')](function(_0x2eef68){if(_0x2eef68){_0x3513e2=_0x2eef68;return db[_0x26be('0x78')][_0x26be('0x44')]({'where':{'id':_0x3513e2['ChatWebsiteId']}});}})['then'](function(_0x2e2415){if(_0x2e2415){_0x168148=_0x2e2415;return db[_0x26be('0x79')][_0x26be('0x44')]({'where':{'id':_0x3513e2[_0x26be('0x7a')]}});}})[_0x26be('0x12')](function(_0x2f2e1c){if(_0x2f2e1c){if(_0xe2cfca){var _0x19ca4c=null;for(var _0xbf5ca5=0x1;_0xbf5ca5<_0x3513e2[_0x26be('0x76')]['length'];++_0xbf5ca5){_0x19ca4c=_0x3513e2['Messages'][_0xbf5ca5];var _0x415a8e=_0x19ca4c['UserId']?util[_0x26be('0x7b')]('%s%d',_0x168148['agentAlias'],_0x19ca4c[_0x26be('0x7c')]):_0x26be('0x7d');var _0x1a702f=_0x4b94e5[_0x26be('0x2b')][_0x26be('0x7e')]||util[_0x26be('0x7b')]('%s%d',_0x26be('0x7f'),_0x19ca4c[_0x26be('0x7a')]);switch(_0x168148[_0x26be('0x80')]){case'website_alias':_0x415a8e=_0x19ca4c['UserId']?util[_0x26be('0x7b')](_0x26be('0x81'),_0x168148[_0x26be('0x82')],_0x19ca4c['UserId']):_0x26be('0x7d');break;case _0x26be('0x83'):_0x415a8e=_0x19ca4c[_0x26be('0x7c')]?_0x19ca4c[_0x26be('0x77')][_0x26be('0x84')]||_0x19ca4c[_0x26be('0x77')][_0x26be('0x4d')]:_0x26be('0x7d');break;case _0x26be('0x85'):_0x415a8e=_0x19ca4c[_0x26be('0x7c')]?_0x19ca4c[_0x26be('0x77')][_0x26be('0x4d')]:_0x26be('0x7d');break;default:_0x415a8e=_0x19ca4c['UserId']?util[_0x26be('0x7b')]('%s%d',_0x168148[_0x26be('0x82')],_0x19ca4c[_0x26be('0x7c')]):_0x26be('0x7d');}var _0x2c322a=util['format'](_0x26be('0x86'),moment(_0x19ca4c['createdAt'])[_0x26be('0x7b')]('MM/DD/YYYY\x20HH:mm:ss'),_0x19ca4c['direction']==='in'?_0x1a702f:_0x415a8e,_0x19ca4c[_0x26be('0x2b')]);if(!_0x19ca4c['secret']){fs[_0x26be('0x87')](_0xe2cfca,_0x2c322a);}}return db['MailAccount'][_0x26be('0x48')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x26be('0x88'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x26be('0x12')](function(_0x4efbdc){if(!_0x4efbdc||!_0x4efbdc[_0x26be('0x88')]||!_0x4b94e5['body'])return _0x3513e2;var _0x3d3a28=_0x4efbdc[_0x26be('0x89')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x3d3a28,'message':{'from':util[_0x26be('0x7b')](_0x26be('0x8a'),_0x4efbdc[_0x26be('0x27')],_0x4efbdc['email']||_0x4efbdc['Smtp'][_0x26be('0x36')]),'to':_0x4b94e5['body'][_0x26be('0x74')],'subject':_0x26be('0x8b'),'text':util[_0x26be('0x7b')](_0x26be('0x8c'),_0x4b94e5[_0x26be('0x2b')]['mailTranscript']),'attachments':[{'path':_0xe2cfca}]}})[_0x26be('0x12')](function(){return _0x3513e2;})[_0x26be('0x37')](function(_0x67e664){logger[_0x26be('0x19')](_0x67e664);});})[_0x26be('0x12')](respondWithStatusCode(_0x536d7c,0xc8))[_0x26be('0x37')](handleError(_0x536d7c,null));};exports['addMessage']=function(_0x12a217,_0x5e150a){return db[_0x26be('0x59')][_0x26be('0x44')]({'where':{'id':_0x12a217[_0x26be('0x39')]['id']}})[_0x26be('0x12')](handleEntityNotFound(_0x5e150a,null))[_0x26be('0x12')](function(_0x2c6689){if(_0x2c6689){return _0x2c6689[_0x26be('0x8d')](_0x12a217['body'][_0x26be('0x8e')],_[_0x26be('0x8f')](_0x12a217['body'],[_0x26be('0x8e'),'id'])||{});}})['then'](respondWithResult(_0x5e150a,null))['catch'](handleError(_0x5e150a,null));};exports[_0x26be('0x90')]=function(_0x1e93d0,_0x41ec6e){var _0x3e2d84={'raw':![],'where':{}};var _0x576c4f={};var _0x1a8cc7={'count':0x0,'rows':[]};return db[_0x26be('0x43')]['findOne']({'where':{'id':_0x1e93d0['params']['id']}})[_0x26be('0x12')](handleEntityNotFound(_0x41ec6e,null))['then'](function(_0x355302){if(_0x355302){_0x576c4f[_0x26be('0x3a')]=_['keys'](db[_0x26be('0x59')][_0x26be('0x30')]);_0x576c4f[_0x26be('0x35')]=_[_0x26be('0x3b')](_0x1e93d0[_0x26be('0x35')]);_0x576c4f[_0x26be('0x3c')]=_[_0x26be('0x3d')](_0x576c4f['model'],_0x576c4f[_0x26be('0x35')]);_0x3e2d84[_0x26be('0x40')]=_[_0x26be('0x3d')](_0x576c4f[_0x26be('0x3a')],qs['fields'](_0x1e93d0[_0x26be('0x35')][_0x26be('0x3e')]));_0x3e2d84[_0x26be('0x40')]=_0x3e2d84['attributes'][_0x26be('0x3f')]?_0x3e2d84[_0x26be('0x40')]:_0x576c4f[_0x26be('0x3a')];if(!_0x1e93d0['query']['hasOwnProperty']('nolimit')){_0x3e2d84[_0x26be('0x22')]=qs[_0x26be('0x22')](_0x1e93d0['query'][_0x26be('0x22')]);_0x3e2d84[_0x26be('0x20')]=qs[_0x26be('0x20')](_0x1e93d0[_0x26be('0x35')][_0x26be('0x20')]);}_0x3e2d84[_0x26be('0x91')]=qs[_0x26be('0x92')](_0x1e93d0[_0x26be('0x35')][_0x26be('0x92')]);_0x3e2d84[_0x26be('0x93')]=qs[_0x26be('0x3c')](_[_0x26be('0x94')](_0x1e93d0[_0x26be('0x35')],_0x576c4f[_0x26be('0x3c')]));_0x3e2d84['where'][_0x26be('0x95')]=_0x355302['id'];if(_0x1e93d0[_0x26be('0x35')][_0x26be('0x96')]){_0x3e2d84[_0x26be('0x93')]=_[_0x26be('0x2a')](_0x3e2d84['where'],{'$or':_['map'](_0x3e2d84[_0x26be('0x40')],function(_0x187928){var _0x5b823d={};_0x5b823d[_0x187928]={'$like':'%'+_0x1e93d0['query']['filter']+'%'};return _0x5b823d;})});}if(_0x1e93d0[_0x26be('0x35')][_0x26be('0x97')]){var _0x5afe8d=_0x1e93d0[_0x26be('0x35')][_0x26be('0x97')]['split'](',');var _0x1bd6a2={};_0x1bd6a2[_0x5afe8d[0x0]]={'$gte':moment(_0x5afe8d[0x1])[_0x26be('0x7b')](_0x26be('0x98'))};_0x3e2d84[_0x26be('0x93')]=_[_0x26be('0x2a')](_0x3e2d84[_0x26be('0x93')],_0x1bd6a2);}_0x3e2d84=_[_0x26be('0x2a')]({},_0x3e2d84,_0x1e93d0[_0x26be('0x42')]);return db[_0x26be('0x59')]['count']({'where':_0x3e2d84['where']})[_0x26be('0x12')](function(_0x4b9a21){_0x1a8cc7[_0x26be('0x23')]=_0x4b9a21;if(_0x1e93d0[_0x26be('0x35')][_0x26be('0x41')]){_0x3e2d84[_0x26be('0x99')]=[{'all':!![]}];}return db[_0x26be('0x59')][_0x26be('0x33')](_0x3e2d84);})['then'](function(_0x1ee155){_0x1a8cc7[_0x26be('0x9a')]=_0x1ee155;return _0x1a8cc7;});}})['then'](respondWithFilteredResult(_0x41ec6e,_0x3e2d84))[_0x26be('0x37')](handleError(_0x41ec6e,null));};exports[_0x26be('0x9b')]=function(_0x377369,_0x5226ae){var _0x1b3573={'where':{}},_0x3096b4={},_0x4cdd91={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x377369[_0x26be('0x39')]['id']}})['then'](handleEntityNotFound(_0x5226ae,null))[_0x26be('0x12')](function(_0x2a71cc){if(_0x2a71cc){_0x3096b4[_0x26be('0x3a')]=_[_0x26be('0x3b')](db[_0x26be('0x59')][_0x26be('0x30')]);_0x3096b4[_0x26be('0x35')]=_[_0x26be('0x3b')](_0x377369[_0x26be('0x35')]);_0x3096b4['filters']=_[_0x26be('0x3d')](_0x3096b4[_0x26be('0x3a')],_0x3096b4['query']);_0x1b3573[_0x26be('0x40')]=_[_0x26be('0x3d')](_0x3096b4[_0x26be('0x3a')],qs['fields'](_0x377369['query'][_0x26be('0x3e')]));_0x1b3573[_0x26be('0x40')]=_0x1b3573['attributes']['length']?_0x1b3573[_0x26be('0x40')]:_0x3096b4[_0x26be('0x3a')];if(!_0x377369[_0x26be('0x35')][_0x26be('0x9c')](_0x26be('0x9d'))){_0x1b3573[_0x26be('0x22')]=qs[_0x26be('0x22')](_0x377369[_0x26be('0x35')][_0x26be('0x22')]);_0x1b3573[_0x26be('0x20')]=qs[_0x26be('0x20')](_0x377369[_0x26be('0x35')][_0x26be('0x20')]);}_0x1b3573[_0x26be('0x91')]=qs[_0x26be('0x92')](_0x377369[_0x26be('0x35')][_0x26be('0x92')]);_0x1b3573['where']=qs['filters'](_['pick'](_0x377369[_0x26be('0x35')],_0x3096b4['filters']));_0x1b3573['where'][_0x26be('0x95')]=_0x2a71cc['id'];if(_0x377369['query']['filter']){_0x1b3573[_0x26be('0x93')]=_[_0x26be('0x2a')](_0x1b3573[_0x26be('0x93')],{'$or':_[_0x26be('0x2f')](_0x1b3573['attributes'],function(_0x24fa9d){var _0x9698ff={};_0x9698ff[_0x24fa9d]={'$like':'%'+_0x377369[_0x26be('0x35')][_0x26be('0x96')]+'%'};return _0x9698ff;})});}_0x1b3573[_0x26be('0x93')][_0x26be('0x9e')]=![];if(_0x377369[_0x26be('0x35')]['id']){_0x1b3573['where']['id']={'$gt':_0x377369[_0x26be('0x35')]['id']};}_0x1b3573=_[_0x26be('0x2a')]({},_0x1b3573,_0x377369['options']);return db['ChatMessage'][_0x26be('0x23')]({'where':_0x1b3573[_0x26be('0x93')]})[_0x26be('0x12')](function(_0x293c58){_0x4cdd91[_0x26be('0x23')]=_0x293c58;_0x1b3573[_0x26be('0x99')]=[];if(_0x377369['query']['includeAgent']){_0x1b3573['include'][_0x26be('0x9f')]({'model':db[_0x26be('0x77')],'as':_0x26be('0x77'),'attributes':['id',_0x26be('0x4d'),'alias']});}if(_0x377369[_0x26be('0x35')][_0x26be('0x41')]){_0x1b3573[_0x26be('0x99')]=[{'all':!![]}];}return db[_0x26be('0x59')][_0x26be('0x33')](_0x1b3573);})[_0x26be('0x12')](function(_0x59ebe3){_0x4cdd91['rows']=_0x59ebe3;return _0x4cdd91;});}})[_0x26be('0x12')](respondWithFilteredResult(_0x5226ae,_0x1b3573))[_0x26be('0x37')](handleError(_0x5226ae,null));};exports[_0x26be('0xa0')]=function(_0x210614,_0x4c3927){return db[_0x26be('0x43')][_0x26be('0x44')]({'where':{'id':_0x210614[_0x26be('0x39')]['id']}})['then'](handleEntityNotFound(_0x4c3927,null))['then'](function(_0x4efbda){if(_0x4efbda){return _0x4efbda['setTags'](_0x210614[_0x26be('0x2b')][_0x26be('0x8e')],_[_0x26be('0x8f')](_0x210614[_0x26be('0x2b')],['ids','id'])||{})['spread'](function(){return db[_0x26be('0xa1')][_0x26be('0x33')]({'attributes':['id',_0x26be('0x27'),'color'],'where':{'id':_0x210614[_0x26be('0x2b')][_0x26be('0x8e')]}});})['then'](function(_0x37931e){socket[_0x26be('0xa2')](_0x26be('0xa3'),{'id':Number(_0x210614[_0x26be('0x39')]['id']),'tags':_0x37931e||[]});return{'id':Number(_0x210614[_0x26be('0x39')]['id']),'tags':_0x37931e||[]};});}})[_0x26be('0x12')](respondWithResult(_0x4c3927,null))[_0x26be('0x37')](handleError(_0x4c3927,null));};exports[_0x26be('0xa4')]=function(_0x5645b3,_0x2dce38){return db[_0x26be('0x43')][_0x26be('0x44')]({'where':{'id':_0x5645b3[_0x26be('0x39')]['id']}})[_0x26be('0x12')](handleEntityNotFound(_0x2dce38,null))['then'](function(_0xc8417d){if(_0xc8417d){return _0xc8417d['removeTags'](_0x5645b3['query'][_0x26be('0x8e')]);}})[_0x26be('0x12')](respondWithStatusCode(_0x2dce38,null))['catch'](handleError(_0x2dce38,null));};exports[_0x26be('0x72')]=function(_0x517c78,_0x19f33b){var _0x5ecdac=moment()['unix']()['toString']();var _0x2e8e01=path['join'](config['root'],_0x26be('0xa5'),'files',_0x26be('0xa6'));var _0x6778a7=path[_0x26be('0x6e')](config['root'],_0x26be('0xa5'),_0x26be('0xa7'),'attachments');var _0x4fb209=path[_0x26be('0x6e')](_0x2e8e01,_0x5ecdac);var _0x38bc3d=util[_0x26be('0x7b')](_0x26be('0xa8'),_0x517c78[_0x26be('0x39')]['id'],_0x5ecdac);var _0x3887cc=path[_0x26be('0x6e')](_0x2e8e01,_0x38bc3d);var _0xa91f20=[];_0xa91f20[_0x26be('0x9f')]({'model':db[_0x26be('0x77')],'as':_0x26be('0x77'),'attributes':['id',_0x26be('0x4d')],'raw':!![]});_0xa91f20[_0x26be('0x9f')]({'model':db['CmContact'],'as':_0x26be('0xa9'),'attributes':['id',_0x26be('0xaa'),_0x26be('0xab')],'raw':!![]});if(_0x517c78[_0x26be('0x35')]['attachments']){_0xa91f20['push']({'model':db[_0x26be('0x69')],'as':_0x26be('0x69'),'raw':!![]});}var _0x30a080=[{'model':db[_0x26be('0x59')],'as':'Messages','attributes':['id',_0x26be('0x2b'),'createdAt',_0x26be('0xac'),_0x26be('0x9e'),'read'],'include':_0xa91f20}];_0x30a080[_0x26be('0x9f')]({'model':db[_0x26be('0x78')],'as':_0x26be('0xad'),'attributes':['id',_0x26be('0x27')]});_0x30a080[_0x26be('0x9f')]({'model':db['User'],'as':_0x26be('0xae'),'attributes':['id',_0x26be('0x4d')]});return db[_0x26be('0x43')][_0x26be('0x44')]({'where':{'id':_0x517c78['params']['id']},'include':_0x30a080})[_0x26be('0x12')](handleEntityNotFound(_0x19f33b,null))[_0x26be('0x12')](function(_0x1e49e5){if(_0x1e49e5){var _0x1ee765=_0x1e49e5[_0x26be('0xaf')]({'plain':!![]});fs[_0x26be('0xb0')](_0x4fb209);var _0x11a958={'channel':'Chat','account':_0x1ee765[_0x26be('0xad')][_0x26be('0x27')],'agent':_0x1ee765[_0x26be('0xae')]?_0x1ee765[_0x26be('0xae')][_0x26be('0x4d')]:_0x26be('0xb1'),'createdAt':moment(_0x1ee765[_0x26be('0xb2')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x26be('0xb3')](),'closedAt':_0x1ee765['closed']?moment(_0x1ee765[_0x26be('0xb4')])[_0x26be('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x1ee765[_0x26be('0x62')],'chatInfo':{'browser':_0x1ee765['browserName'],'os':_0x1ee765[_0x26be('0xb5')],'referer':_0x1ee765['referer'],'customerIp':_0x1ee765['customerIp'],'customerPort':_0x1ee765[_0x26be('0xb6')]?_0x1ee765[_0x26be('0xb6')]:_0x26be('0xb1')},'messages':_(_0x1ee765[_0x26be('0x76')])[_0x26be('0xb7')]()[_0x26be('0x96')]({'secret':![]})[_0x26be('0x2f')](function(_0x1b6609){if(_0x1b6609[_0x26be('0x69')]){var _0x142af2=path[_0x26be('0x6e')](_0x6778a7,_0x1b6609['Attachment'][_0x26be('0x71')]);if(fs['existsSync'](_0x142af2)){fs[_0x26be('0xb8')](_0x142af2)[_0x26be('0xb9')](fs['createWriteStream'](path[_0x26be('0x6e')](_0x4fb209,_0x1b6609[_0x26be('0x69')][_0x26be('0x71')])));}}return{'date':moment(_0x1b6609[_0x26be('0xb2')])[_0x26be('0x7b')]('YYYY-MM-DD\x20HH:mm:ss')[_0x26be('0xb3')](),'sender':_0x1b6609[_0x26be('0xac')]===_0x26be('0x58')?_0x1b6609[_0x26be('0x77')]?_0x1b6609[_0x26be('0x77')]['fullname']:_0x26be('0x7d'):_0x1b6609['Contact'][_0x26be('0xaa')]+(_0x1b6609[_0x26be('0xa9')]['lastName']?'\x20'+_0x1b6609['Contact'][_0x26be('0xab')]:''),'body':_0x1b6609[_0x26be('0x69')]?_0x1b6609[_0x26be('0x69')][_0x26be('0x71')]:_0x1b6609['body'],'direction':_0x1b6609['direction']==='out'?'A':'C','secret':_0x1b6609[_0x26be('0x9e')],'read':_0x1b6609['read'],'attachment':_0x1b6609[_0x26be('0x69')]};})[_0x26be('0xba')]()};return ejs[_0x26be('0xbb')](path[_0x26be('0x6e')](config[_0x26be('0x6f')],_0x26be('0xa5'),'views',_0x26be('0xbc')),{'interaction':_0x11a958})[_0x26be('0x12')](function(_0x16f2fa){var _0x5b7a45=path['join'](_0x4fb209,'transcript-'+_0x1ee765['id']+'-'+_0x5ecdac+_0x26be('0xbd'));var _0x30c144={'path':_0x5b7a45,'channel':_0x26be('0xbe'),'interactionId':_0x1ee765['id']};return pdf['createPdfFromHTML'](_0x16f2fa,_0x30c144);})[_0x26be('0x12')](function(){return new Promise(function(_0x6b6235,_0x55e04f){zipdir(_0x4fb209,{'saveTo':_0x3887cc},function(_0x30c00d,_0xf1da64){if(_0x30c00d)return _0x55e04f(_0x30c00d);return _0x6b6235(_0xf1da64);});})[_0x26be('0x12')](function(){return new BPromise(function(_0x2ee780,_0xc957a6){rimraf(_0x4fb209,function(_0x1bf669){if(_0x1bf669)_0xc957a6(_0x1bf669);return _0x2ee780();});});})[_0x26be('0x12')](function(){return _0x19f33b[_0x26be('0x72')](_0x3887cc,_0x38bc3d,function(_0x23063f){if(_0x23063f){logger[_0x26be('0x19')](_0x26be('0xbf'),_0x23063f);}else{fs[_0x26be('0xc0')](_0x3887cc);}});});});}else{return _0x19f33b[_0x26be('0x1d')](0xc8);}})[_0x26be('0x37')](handleError(_0x19f33b,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 5a4d9bd..69e518b 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 _0xacc9=['exports','events','../../mysqldb','ChatMessage','setMaxListeners','remove','getUsers','then','map','emit','catch','hasOwnProperty','hook'];(function(_0x21b706,_0x1022f4){var _0x13b94a=function(_0x3116da){while(--_0x3116da){_0x21b706['push'](_0x21b706['shift']());}};_0x13b94a(++_0x1022f4);}(_0xacc9,0x139));var _0x9acc=function(_0x5a29a7,_0x3e59a8){_0x5a29a7=_0x5a29a7-0x0;var _0x172198=_0xacc9[_0x5a29a7];return _0x172198;};'use strict';var EventEmitter=require(_0x9acc('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require(_0x9acc('0x1'))['db'][_0x9acc('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x9acc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9acc('0x4')};function emitEvent(_0x1ffec4){return function(_0x2df10d,_0x57bbdd,_0xe56f18){_0x2df10d[_0x9acc('0x5')]({'attributes':['id'],'raw':!![]})[_0x9acc('0x6')](function(_0x36e69c){_0x2df10d['setDataValue']('Users',_0x36e69c[_0x9acc('0x7')](function(_0x5225c1){return{'id':_0x5225c1['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x2df10d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9acc('0x6')](function(_0x3d70a3){_0x2df10d['setDataValue']('unreadMessages',_0x3d70a3['length']);ChatInteractionEvents[_0x9acc('0x8')](_0x1ffec4+':'+_0x2df10d['id'],_0x2df10d);ChatInteractionEvents[_0x9acc('0x8')](_0x1ffec4,_0x2df10d);_0xe56f18(null);})[_0x9acc('0x9')](_0xe56f18(null));};}for(var e in events){if(events[_0x9acc('0xa')](e)){var event=events[e];ChatInteraction[_0x9acc('0xb')](e,emitEvent(event));}}module[_0x9acc('0xc')]=ChatInteractionEvents; \ No newline at end of file +var _0xce1c=['ChatInteraction','ChatMessage','save','update','remove','getUsers','then','setDataValue','map','findAll','length','emit','hook','events','../../mysqldb'];(function(_0x263039,_0x31b9a7){var _0x452e7b=function(_0x359a2c){while(--_0x359a2c){_0x263039['push'](_0x263039['shift']());}};_0x452e7b(++_0x31b9a7);}(_0xce1c,0x10c));var _0xcce1=function(_0x391f75,_0x40b55e){_0x391f75=_0x391f75-0x0;var _0x379e5b=_0xce1c[_0x391f75];return _0x379e5b;};'use strict';var EventEmitter=require(_0xcce1('0x0'));var ChatInteraction=require(_0xcce1('0x1'))['db'][_0xcce1('0x2')];var ChatMessage=require(_0xcce1('0x1'))['db'][_0xcce1('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcce1('0x4'),'afterUpdate':_0xcce1('0x5'),'afterDestroy':_0xcce1('0x6')};function emitEvent(_0x781c1f){return function(_0x4a9dd6,_0x4093c5,_0x2aa747){_0x4a9dd6[_0xcce1('0x7')]({'attributes':['id'],'raw':!![]})[_0xcce1('0x8')](function(_0x21da4f){_0x4a9dd6[_0xcce1('0x9')]('Users',_0x21da4f[_0xcce1('0xa')](function(_0x4c2e34){return{'id':_0x4c2e34['id']};}));return ChatMessage[_0xcce1('0xb')]({'where':{'ChatInteractionId':_0x4a9dd6['id'],'direction':'in','read':![]},'raw':!![]});})[_0xcce1('0x8')](function(_0x350de2){_0x4a9dd6[_0xcce1('0x9')]('unreadMessages',_0x350de2[_0xcce1('0xc')]);ChatInteractionEvents[_0xcce1('0xd')](_0x781c1f+':'+_0x4a9dd6['id'],_0x4a9dd6);ChatInteractionEvents[_0xcce1('0xd')](_0x781c1f,_0x4a9dd6);_0x2aa747(null);})['catch'](_0x2aa747(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0xcce1('0xe')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 61a240c..77080ca 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 _0xb8c9=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci'];(function(_0x247ffb,_0x4f5bcd){var _0xafc7af=function(_0x1e4335){while(--_0x1e4335){_0x247ffb['push'](_0x247ffb['shift']());}};_0xafc7af(++_0x4f5bcd);}(_0xb8c9,0xb4));var _0x9b8c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb8c9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9b8c('0x0'));var util=require(_0x9b8c('0x1'));var logger=require('../../config/logger')(_0x9b8c('0x2'));var moment=require(_0x9b8c('0x3'));var BPromise=require(_0x9b8c('0x4'));var rp=require(_0x9b8c('0x5'));var fs=require('fs');var path=require(_0x9b8c('0x6'));var rimraf=require(_0x9b8c('0x7'));var config=require(_0x9b8c('0x8'));var attributes=require('./chatInteraction.attributes');module['exports']=function(_0x3609c4,_0x5a417c){return _0x3609c4[_0x9b8c('0x9')](_0x9b8c('0xa'),attributes,{'tableName':_0x9b8c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x310aa4,_0x3c7c14,_0x130de1){if(_0x310aa4[_0x9b8c('0xc')](_0x9b8c('0xd'))){_0x310aa4['closedAt']=moment()[_0x9b8c('0xe')](_0x9b8c('0xf'));}_0x130de1(null,_0x310aa4);}},'charset':_0x9b8c('0x10'),'collate':_0x9b8c('0x11')});}; \ No newline at end of file +var _0xe53c=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','chat_interactions','changed','closed'];(function(_0x174752,_0x4d9f12){var _0xa311a0=function(_0x237b09){while(--_0x237b09){_0x174752['push'](_0x174752['shift']());}};_0xa311a0(++_0x4d9f12);}(_0xe53c,0x137));var _0xce53=function(_0x5c98ea,_0xa782aa){_0x5c98ea=_0x5c98ea-0x0;var _0x51e853=_0xe53c[_0x5c98ea];return _0x51e853;};'use strict';var _=require(_0xce53('0x0'));var util=require(_0xce53('0x1'));var logger=require(_0xce53('0x2'))('api');var moment=require(_0xce53('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xce53('0x4'));var config=require(_0xce53('0x5'));var attributes=require(_0xce53('0x6'));module['exports']=function(_0x44fb0e,_0x285fde){return _0x44fb0e[_0xce53('0x7')](_0xce53('0x8'),attributes,{'tableName':_0xce53('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x8817da,_0x3c7873,_0xd49c50){if(_0x8817da[_0xce53('0xa')](_0xce53('0xb'))){_0x8817da[_0xce53('0xc')]=moment()[_0xce53('0xd')](_0xce53('0xe'));}_0xd49c50(null,_0x8817da);}},'charset':_0xce53('0xf'),'collate':_0xce53('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 6a36509..6cfb7a3 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 _0xd646=['jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','raw','limit','find','omit','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x1cf730,_0x42c362){var _0x35bfee=function(_0x26ca67){while(--_0x26ca67){_0x1cf730['push'](_0x1cf730['shift']());}};_0x35bfee(++_0x42c362);}(_0xd646,0x191));var _0x6d64=function(_0x447a9f,_0x48619b){_0x447a9f=_0x447a9f-0x0;var _0x1286fc=_0xd646[_0x447a9f];return _0x1286fc;};'use strict';var _=require(_0x6d64('0x0'));var util=require(_0x6d64('0x1'));var moment=require(_0x6d64('0x2'));var BPromise=require(_0x6d64('0x3'));var rs=require(_0x6d64('0x4'));var fs=require('fs');var Redis=require(_0x6d64('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d64('0x6'));var logger=require(_0x6d64('0x7'))('rpc');var config=require(_0x6d64('0x8'));var jayson=require(_0x6d64('0x9'));var client=jayson[_0x6d64('0xa')][_0x6d64('0xb')]({'port':0x232a});config['redis']=_[_0x6d64('0xc')](config['redis'],{'host':_0x6d64('0xd'),'port':0x18eb});var socket=require(_0x6d64('0xe'))(new Redis(config[_0x6d64('0xf')]));require(_0x6d64('0x10'))[_0x6d64('0x11')](socket);function respondWithRpcPromise(_0x27e20b,_0x3a03fb,_0x33e032){return new BPromise(function(_0x1fbec9,_0x68010e){return client[_0x6d64('0x12')](_0x27e20b,_0x33e032)[_0x6d64('0x13')](function(_0x10f756){logger[_0x6d64('0x14')](_0x6d64('0x15'),_0x3a03fb,'request\x20sent');logger[_0x6d64('0x16')](_0x6d64('0x17'),_0x3a03fb,'request\x20sent',JSON[_0x6d64('0x18')](_0x10f756));if(_0x10f756[_0x6d64('0x19')]){if(_0x10f756[_0x6d64('0x19')][_0x6d64('0x1a')]===0x1f4){logger['error'](_0x6d64('0x15'),_0x3a03fb,_0x10f756[_0x6d64('0x19')][_0x6d64('0x1b')]);return _0x68010e(_0x10f756[_0x6d64('0x19')][_0x6d64('0x1b')]);}logger['error'](_0x6d64('0x15'),_0x3a03fb,_0x10f756[_0x6d64('0x19')][_0x6d64('0x1b')]);return _0x1fbec9(_0x10f756['error'][_0x6d64('0x1b')]);}else{logger[_0x6d64('0x14')](_0x6d64('0x15'),_0x3a03fb,'request\x20sent');_0x1fbec9(_0x10f756[_0x6d64('0x1c')][_0x6d64('0x1b')]);}})[_0x6d64('0x1d')](function(_0x1340a8){logger['error'](_0x6d64('0x15'),_0x3a03fb,_0x1340a8);_0x68010e(_0x1340a8);});});}exports[_0x6d64('0x1e')]=function(_0x14e9aa){var _0x1996a5=this;return new Promise(function(_0x2b2324,_0x2fdd0d){return db[_0x6d64('0x1f')][_0x6d64('0x20')](_0x14e9aa[_0x6d64('0x21')],{'raw':_0x14e9aa[_0x6d64('0x22')]?_0x14e9aa['options'][_0x6d64('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x14e9aa[_0x6d64('0x22')]?_0x14e9aa[_0x6d64('0x22')]['where']||null:null,'attributes':_0x14e9aa['options']?_0x14e9aa['options']['attributes']||null:null,'limit':_0x14e9aa[_0x6d64('0x22')]?_0x14e9aa[_0x6d64('0x22')][_0x6d64('0x24')]||null:null})[_0x6d64('0x13')](function(_0x45bf2c){logger[_0x6d64('0x14')](_0x6d64('0x1e'),_0x14e9aa);logger[_0x6d64('0x16')](_0x6d64('0x1e'),_0x14e9aa,JSON['stringify'](_0x45bf2c));_0x2b2324(_0x45bf2c);})[_0x6d64('0x1d')](function(_0xf56ad6){logger[_0x6d64('0x19')](_0x6d64('0x1e'),_0xf56ad6[_0x6d64('0x1b')],_0x14e9aa);_0x2fdd0d(_0x1996a5[_0x6d64('0x19')](0x1f4,_0xf56ad6[_0x6d64('0x1b')]));});});};exports['AddTagsToChatInteraction']=function(_0x492ce7){return new Promise(function(_0x7c8890,_0x3d0d7b){return db[_0x6d64('0x1f')][_0x6d64('0x25')]({'where':_0x492ce7[_0x6d64('0x22')]?_0x492ce7[_0x6d64('0x22')]['where']||null:null})['then'](function(_0x4f2448){if(_0x4f2448){return _0x4f2448['addTags'](_0x492ce7[_0x6d64('0x21')]['ids'],_[_0x6d64('0x26')](_0x492ce7[_0x6d64('0x21')],[_0x6d64('0x27'),'id'])||{});}})['spread'](function(_0x1a248b){logger[_0x6d64('0x14')](_0x6d64('0x28'),_0x492ce7);logger[_0x6d64('0x16')](_0x6d64('0x28'),_0x492ce7,JSON[_0x6d64('0x18')](_0x1a248b));_0x7c8890(_0x1a248b);})['catch'](function(_0x54dfb6){logger[_0x6d64('0x19')](_0x6d64('0x28'),_0x54dfb6['message'],_0x492ce7);_0x3d0d7b(_this[_0x6d64('0x19')](0x1f4,_0x54dfb6[_0x6d64('0x1b')]));});});}; \ No newline at end of file +var _0x2fb3=['lodash','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','request','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','attributes','limit','AddTagsToChatInteraction','where','then','addTags','ids','omit','spread','info','AddTags'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2fb3,0x9c));var _0x32fb=function(_0x567405,_0x4675dd){_0x567405=_0x567405-0x0;var _0x23079f=_0x2fb3[_0x567405];return _0x23079f;};'use strict';var _=require(_0x32fb('0x0'));var util=require('util');var moment=require(_0x32fb('0x1'));var BPromise=require(_0x32fb('0x2'));var rs=require(_0x32fb('0x3'));var fs=require('fs');var Redis=require(_0x32fb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x32fb('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x32fb('0x6'));var client=jayson['client'][_0x32fb('0x7')]({'port':0x232a});config[_0x32fb('0x8')]=_[_0x32fb('0x9')](config[_0x32fb('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x32fb('0xa'))(new Redis(config['redis']));require(_0x32fb('0xb'))['register'](socket);function respondWithRpcPromise(_0x4954be,_0x2648a5,_0x226845){return new BPromise(function(_0x5e1328,_0x149b60){return client[_0x32fb('0xc')](_0x4954be,_0x226845)['then'](function(_0x54a6a0){logger['info'](_0x32fb('0xd'),_0x2648a5,'request\x20sent');logger[_0x32fb('0xe')](_0x32fb('0xf'),_0x2648a5,'request\x20sent',JSON[_0x32fb('0x10')](_0x54a6a0));if(_0x54a6a0[_0x32fb('0x11')]){if(_0x54a6a0['error'][_0x32fb('0x12')]===0x1f4){logger['error'](_0x32fb('0xd'),_0x2648a5,_0x54a6a0[_0x32fb('0x11')][_0x32fb('0x13')]);return _0x149b60(_0x54a6a0[_0x32fb('0x11')][_0x32fb('0x13')]);}logger[_0x32fb('0x11')](_0x32fb('0xd'),_0x2648a5,_0x54a6a0[_0x32fb('0x11')][_0x32fb('0x13')]);return _0x5e1328(_0x54a6a0[_0x32fb('0x11')]['message']);}else{logger['info'](_0x32fb('0xd'),_0x2648a5,_0x32fb('0x14'));_0x5e1328(_0x54a6a0[_0x32fb('0x15')][_0x32fb('0x13')]);}})[_0x32fb('0x16')](function(_0x5d37e1){logger[_0x32fb('0x11')](_0x32fb('0xd'),_0x2648a5,_0x5d37e1);_0x149b60(_0x5d37e1);});});}exports[_0x32fb('0x17')]=function(_0x55610e){var _0x55fd45=this;return new Promise(function(_0x15b91f,_0x5c4974){return db[_0x32fb('0x18')][_0x32fb('0x19')](_0x55610e[_0x32fb('0x1a')],{'raw':_0x55610e[_0x32fb('0x1b')]?_0x55610e['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55610e[_0x32fb('0x1b')]?_0x55610e[_0x32fb('0x1b')]['where']||null:null,'attributes':_0x55610e['options']?_0x55610e[_0x32fb('0x1b')][_0x32fb('0x1c')]||null:null,'limit':_0x55610e[_0x32fb('0x1b')]?_0x55610e['options'][_0x32fb('0x1d')]||null:null})['then'](function(_0x3e2994){logger['info']('UpdateChatInteraction',_0x55610e);logger[_0x32fb('0xe')](_0x32fb('0x17'),_0x55610e,JSON[_0x32fb('0x10')](_0x3e2994));_0x15b91f(_0x3e2994);})['catch'](function(_0x120637){logger[_0x32fb('0x11')]('UpdateChatInteraction',_0x120637[_0x32fb('0x13')],_0x55610e);_0x5c4974(_0x55fd45[_0x32fb('0x11')](0x1f4,_0x120637[_0x32fb('0x13')]));});});};exports[_0x32fb('0x1e')]=function(_0x418b09){return new Promise(function(_0x37163c,_0x2b493e){return db[_0x32fb('0x18')]['find']({'where':_0x418b09[_0x32fb('0x1b')]?_0x418b09['options'][_0x32fb('0x1f')]||null:null})[_0x32fb('0x20')](function(_0x449798){if(_0x449798){return _0x449798[_0x32fb('0x21')](_0x418b09[_0x32fb('0x1a')][_0x32fb('0x22')],_[_0x32fb('0x23')](_0x418b09[_0x32fb('0x1a')],[_0x32fb('0x22'),'id'])||{});}})[_0x32fb('0x24')](function(_0x3335d4){logger[_0x32fb('0x25')]('AddTags',_0x418b09);logger[_0x32fb('0xe')](_0x32fb('0x26'),_0x418b09,JSON[_0x32fb('0x10')](_0x3335d4));_0x37163c(_0x3335d4);})[_0x32fb('0x16')](function(_0x55b7ee){logger[_0x32fb('0x11')]('AddTags',_0x55b7ee[_0x32fb('0x13')],_0x418b09);_0x2b493e(_this[_0x32fb('0x11')](0x1f4,_0x55b7ee['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index d1950f1..c362b7a 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 _0x83f1=['emit','removeListener','register','length','./chatInteraction.events','save','remove','update'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x83f1,0x1cc));var _0x183f=function(_0x137264,_0x163896){_0x137264=_0x137264-0x0;var _0x26d615=_0x83f1[_0x137264];return _0x26d615;};'use strict';var ChatInteractionEvents=require(_0x183f('0x0'));var events=[_0x183f('0x1'),_0x183f('0x2'),_0x183f('0x3')];function createListener(_0x40525d,_0x50f14d){return function(_0x52688c){_0x50f14d[_0x183f('0x4')](_0x40525d,_0x52688c);};}function removeListener(_0x2668ca,_0x7f265){return function(){ChatInteractionEvents[_0x183f('0x5')](_0x2668ca,_0x7f265);};}exports[_0x183f('0x6')]=function(_0x5381b2){for(var _0x5c1cbd=0x0,_0xf702f5=events[_0x183f('0x7')];_0x5c1cbd<_0xf702f5;_0x5c1cbd++){var _0x5c75c3=events[_0x5c1cbd];var _0x434be2=createListener('chatInteraction:'+_0x5c75c3,_0x5381b2);ChatInteractionEvents['on'](_0x5c75c3,_0x434be2);}}; \ No newline at end of file +var _0xd32d=['save','remove','emit','removeListener','register','./chatInteraction.events'];(function(_0x5b0332,_0x469074){var _0x55e280=function(_0x4619d9){while(--_0x4619d9){_0x5b0332['push'](_0x5b0332['shift']());}};_0x55e280(++_0x469074);}(_0xd32d,0x15b));var _0xdd32=function(_0x8f360c,_0x166c6e){_0x8f360c=_0x8f360c-0x0;var _0x37182b=_0xd32d[_0x8f360c];return _0x37182b;};'use strict';var ChatInteractionEvents=require(_0xdd32('0x0'));var events=[_0xdd32('0x1'),_0xdd32('0x2'),'update'];function createListener(_0x848a2b,_0x1df8ad){return function(_0x577087){_0x1df8ad[_0xdd32('0x3')](_0x848a2b,_0x577087);};}function removeListener(_0x4b36b2,_0x5089a1){return function(){ChatInteractionEvents[_0xdd32('0x4')](_0x4b36b2,_0x5089a1);};}exports[_0xdd32('0x5')]=function(_0xf87ad2){for(var _0x12f0a2=0x0,_0x179d27=events['length'];_0x12f0a2<_0x179d27;_0x12f0a2++){var _0x486537=events[_0x12f0a2];var _0x57e8b0=createListener('chatInteraction:'+_0x486537,_0xf87ad2);ChatInteractionEvents['on'](_0x486537,_0x57e8b0);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 4f4e25d..49677d6 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 _0xeb50=['post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','format','%s-%s','originalname','/:id/attachment_upload','file','/:id/tags','chatinteraction:addtags','addTags','put','tracked','chat','update','/:id/custom_update','customUpdate','abandon','/:id/close','close','chatinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xeb50,0x167));var _0x0eb5=function(_0xfdec06,_0x9fa2f4){_0xfdec06=_0xfdec06-0x0;var _0x58a539=_0xeb50[_0xfdec06];return _0x58a539;};'use strict';var multer=require(_0x0eb5('0x0'));var util=require(_0x0eb5('0x1'));var path=require(_0x0eb5('0x2'));var timeout=require(_0x0eb5('0x3'));var express=require(_0x0eb5('0x4'));var router=express[_0x0eb5('0x5')]();var fs_extra=require(_0x0eb5('0x6'));var auth=require(_0x0eb5('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x0eb5('0x8'));var controller=require(_0x0eb5('0x9'));router[_0x0eb5('0xa')]('/',auth[_0x0eb5('0xb')](),controller[_0x0eb5('0xc')]);router[_0x0eb5('0xa')](_0x0eb5('0xd'),auth[_0x0eb5('0xb')](),controller[_0x0eb5('0xe')]);router[_0x0eb5('0xa')](_0x0eb5('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x0eb5('0x10')]);router[_0x0eb5('0xa')](_0x0eb5('0x11'),auth[_0x0eb5('0x12')](),controller[_0x0eb5('0x13')]);router[_0x0eb5('0xa')](_0x0eb5('0x14'),auth['isAuthenticated'](),controller[_0x0eb5('0x15')]);router[_0x0eb5('0xa')](_0x0eb5('0x16'),auth[_0x0eb5('0x12')](),controller[_0x0eb5('0x17')]);router[_0x0eb5('0xa')](_0x0eb5('0x18'),auth[_0x0eb5('0xb')](),controller[_0x0eb5('0x19')]);router[_0x0eb5('0x1a')]('/',auth[_0x0eb5('0xb')](),controller[_0x0eb5('0x1b')]);router[_0x0eb5('0x1a')](_0x0eb5('0x1c'),auth[_0x0eb5('0xb')](),controller[_0x0eb5('0x1d')]);var upload=multer({'storage':multer[_0x0eb5('0x1e')]({'destination':function(_0x238265,_0x120cc4,_0x4f51e8){_0x4f51e8(null,path[_0x0eb5('0x1f')](config[_0x0eb5('0x20')],'server/files/attachments/'));},'filename':function(_0x47e1f0,_0x23799f,_0x1136f5){_0x1136f5(null,util[_0x0eb5('0x21')](_0x0eb5('0x22'),Date['now'](),_0x23799f[_0x0eb5('0x23')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x0eb5('0x1a')](_0x0eb5('0x24'),upload['single'](_0x0eb5('0x25')),controller['attachmentUpload']);router[_0x0eb5('0x1a')](_0x0eb5('0x14'),auth[_0x0eb5('0x12')](),controller['addMessage']);router[_0x0eb5('0x1a')](_0x0eb5('0x26'),auth[_0x0eb5('0xb')](),interaction['tracked']('chat',_0x0eb5('0x27')),controller[_0x0eb5('0x28')]);router[_0x0eb5('0x29')](_0x0eb5('0xf'),auth[_0x0eb5('0xb')](),interaction[_0x0eb5('0x2a')](_0x0eb5('0x2b'),'chatinteraction:update'),controller[_0x0eb5('0x2c')]);router[_0x0eb5('0x29')](_0x0eb5('0x2d'),controller[_0x0eb5('0x2e')]);router['put']('/:id/abandon',auth[_0x0eb5('0x12')](),controller[_0x0eb5('0x2f')]);router['put'](_0x0eb5('0x30'),controller[_0x0eb5('0x31')]);router['delete']('/:id',auth[_0x0eb5('0xb')](),interaction[_0x0eb5('0x2a')](_0x0eb5('0x2b'),_0x0eb5('0x32')),controller[_0x0eb5('0x33')]);router[_0x0eb5('0x34')](_0x0eb5('0x26'),auth['isAuthenticated'](),controller[_0x0eb5('0x35')]);module[_0x0eb5('0x36')]=router; \ No newline at end of file +var _0x337e=['connect-timeout','express','Router','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','/:id','isChatInteractionAuthorized','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','root','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','chat','chatinteraction:addtags','addTags','put','tracked','chatinteraction:update','update','/:id/custom_update','/:id/abandon','delete','chatinteraction:destroy','destroy','exports','multer','util','path'];(function(_0x4eb367,_0x45d85b){var _0x5aea99=function(_0x32d2e6){while(--_0x32d2e6){_0x4eb367['push'](_0x4eb367['shift']());}};_0x5aea99(++_0x45d85b);}(_0x337e,0x12f));var _0xe337=function(_0x250337,_0x54267b){_0x250337=_0x250337-0x0;var _0x10c225=_0x337e[_0x250337];return _0x10c225;};'use strict';var multer=require(_0xe337('0x0'));var util=require(_0xe337('0x1'));var path=require(_0xe337('0x2'));var timeout=require(_0xe337('0x3'));var express=require(_0xe337('0x4'));var router=express[_0xe337('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe337('0x6'));var controller=require(_0xe337('0x7'));router[_0xe337('0x8')]('/',auth[_0xe337('0x9')](),controller[_0xe337('0xa')]);router[_0xe337('0x8')](_0xe337('0xb'),auth[_0xe337('0x9')](),controller['describe']);router['get'](_0xe337('0xc'),auth['isChatInteractionAuthorized'](),controller['show']);router[_0xe337('0x8')]('/:id/attachment_download',auth[_0xe337('0xd')](),controller[_0xe337('0xe')]);router[_0xe337('0x8')]('/:id/messages',auth[_0xe337('0x9')](),controller[_0xe337('0xf')]);router[_0xe337('0x8')](_0xe337('0x10'),auth[_0xe337('0xd')](),controller[_0xe337('0x11')]);router['get'](_0xe337('0x12'),auth[_0xe337('0x9')](),controller[_0xe337('0x13')]);router[_0xe337('0x14')]('/',auth[_0xe337('0x9')](),controller[_0xe337('0x15')]);router[_0xe337('0x14')](_0xe337('0x16'),auth[_0xe337('0x9')](),controller[_0xe337('0x17')]);var upload=multer({'storage':multer[_0xe337('0x18')]({'destination':function(_0x1c8d89,_0x55d8bc,_0x47176e){_0x47176e(null,path['join'](config[_0xe337('0x19')],'server/files/attachments/'));},'filename':function(_0x47e1a7,_0x506cda,_0x6d181b){_0x6d181b(null,util[_0xe337('0x1a')](_0xe337('0x1b'),Date[_0xe337('0x1c')](),_0x506cda[_0xe337('0x1d')][_0xe337('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe337('0x14')](_0xe337('0x1f'),upload[_0xe337('0x20')](_0xe337('0x21')),controller[_0xe337('0x22')]);router['post'](_0xe337('0x23'),auth[_0xe337('0xd')](),controller[_0xe337('0x24')]);router['post'](_0xe337('0x25'),auth['isAuthenticated'](),interaction['tracked'](_0xe337('0x26'),_0xe337('0x27')),controller[_0xe337('0x28')]);router[_0xe337('0x29')](_0xe337('0xc'),auth['isAuthenticated'](),interaction[_0xe337('0x2a')](_0xe337('0x26'),_0xe337('0x2b')),controller[_0xe337('0x2c')]);router[_0xe337('0x29')](_0xe337('0x2d'),controller['customUpdate']);router[_0xe337('0x29')](_0xe337('0x2e'),auth[_0xe337('0xd')](),controller['abandon']);router[_0xe337('0x29')]('/:id/close',controller['close']);router[_0xe337('0x2f')]('/:id',auth[_0xe337('0x9')](),interaction[_0xe337('0x2a')](_0xe337('0x26'),_0xe337('0x30')),controller[_0xe337('0x31')]);router['delete'](_0xe337('0x25'),auth[_0xe337('0x9')](),controller['removeTags']);module[_0xe337('0x32')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 5ff9032..0734a9d 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 _0x6855=['TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x3a0512,_0x2f78ea){var _0x1a8fd7=function(_0x48cbaa){while(--_0x48cbaa){_0x3a0512['push'](_0x3a0512['shift']());}};_0x1a8fd7(++_0x2f78ea);}(_0x6855,0xe0));var _0x5685=function(_0x5cbf0e,_0x4cd140){_0x5cbf0e=_0x5cbf0e-0x0;var _0x1c76f8=_0x6855[_0x5cbf0e];return _0x1c76f8;};'use strict';var Sequelize=require(_0x5685('0x0'));module['exports']={'body':{'type':Sequelize[_0x5685('0x1')](_0x5685('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5685('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x5685('0x4')]}}; \ No newline at end of file +var _0xc8da=['medium','INTEGER','sequelize','exports'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0xc8da,0x1de));var _0xac8d=function(_0x42960a,_0x4932f0){_0x42960a=_0x42960a-0x0;var _0x44bcc5=_0xc8da[_0x42960a];return _0x44bcc5;};'use strict';var Sequelize=require(_0xac8d('0x0'));module[_0xac8d('0x1')]={'body':{'type':Sequelize['TEXT'](_0xac8d('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xac8d('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index ba06d89..11712e2 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 _0x6599=['VIRTUAL','options','ChatInternalMessage','count','includeAll','include','rows','catch','show','find','create','body','params','describe','get','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','findAll','agent','admin','user','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','messages','FromId','ToId','read','all','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type'];(function(_0x32ab63,_0x4d6d70){var _0x18af42=function(_0x25397a){while(--_0x25397a){_0x32ab63['push'](_0x32ab63['shift']());}};_0x18af42(++_0x4d6d70);}(_0x6599,0xa3));var _0x9659=function(_0x590a38,_0x2bc65c){_0x590a38=_0x590a38-0x0;var _0xf36626=_0x6599[_0x590a38];return _0xf36626;};'use strict';var emlformat=require(_0x9659('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9659('0x1'));var jsonpatch=require(_0x9659('0x2'));var rp=require(_0x9659('0x3'));var moment=require(_0x9659('0x4'));var BPromise=require(_0x9659('0x5'));var Mustache=require(_0x9659('0x6'));var util=require(_0x9659('0x7'));var path=require('path');var sox=require(_0x9659('0x8'));var csv=require(_0x9659('0x9'));var ejs=require(_0x9659('0xa'));var fs=require('fs');var fs_extra=require(_0x9659('0xb'));var _=require(_0x9659('0xc'));var squel=require(_0x9659('0xd'));var crypto=require(_0x9659('0xe'));var jsforce=require(_0x9659('0xf'));var deskjs=require(_0x9659('0x10'));var toCsv=require(_0x9659('0x9'));var querystring=require(_0x9659('0x11'));var Papa=require(_0x9659('0x12'));var Redis=require(_0x9659('0x13'));var authService=require(_0x9659('0x14'));var qs=require(_0x9659('0x15'));var as=require(_0x9659('0x16'));var hardwareService=require(_0x9659('0x17'));var logger=require(_0x9659('0x18'))(_0x9659('0x19'));var utils=require('../../config/utils');var config=require(_0x9659('0x1a'));var licenseUtil=require(_0x9659('0x1b'));var db=require(_0x9659('0x1c'))['db'];config[_0x9659('0x1d')]=_[_0x9659('0x1e')](config[_0x9659('0x1d')],{'host':_0x9659('0x1f'),'port':0x18eb});var socket=require(_0x9659('0x20'))(new Redis(config[_0x9659('0x1d')]));require(_0x9659('0x21'))['register'](socket);function respondWithStatusCode(_0x2223ed,_0x4db09e){_0x4db09e=_0x4db09e||0xcc;return function(_0x528ea3){if(_0x528ea3){return _0x2223ed[_0x9659('0x22')](_0x4db09e);}return _0x2223ed[_0x9659('0x23')](_0x4db09e)['end']();};}function respondWithResult(_0x3b0407,_0x192bea){_0x192bea=_0x192bea||0xc8;return function(_0x1c2dfb){if(_0x1c2dfb){return _0x3b0407[_0x9659('0x23')](_0x192bea)[_0x9659('0x24')](_0x1c2dfb);}};}function respondWithFilteredResult(_0x4fe3ed,_0x247e37){return function(_0x15080a){if(_0x15080a){var _0xb23d4d=typeof _0x247e37['offset']==='undefined'&&typeof _0x247e37['limit']==='undefined';var _0x54a632=_0x15080a['count'];var _0x46766b=_0xb23d4d?0x0:_0x247e37[_0x9659('0x25')];var _0x2e8f1c=_0xb23d4d?_0x15080a['count']:_0x247e37[_0x9659('0x25')]+_0x247e37['limit'];var _0x473875;if(_0x2e8f1c>=_0x54a632){_0x2e8f1c=_0x54a632;_0x473875=0xc8;}else{_0x473875=0xce;}_0x4fe3ed[_0x9659('0x23')](_0x473875);return _0x4fe3ed[_0x9659('0x26')](_0x9659('0x27'),_0x46766b+'-'+_0x2e8f1c+'/'+_0x54a632)['json'](_0x15080a);}return null;};}function patchUpdates(_0x340ac6){return function(_0x359ba6){try{jsonpatch[_0x9659('0x28')](_0x359ba6,_0x340ac6,!![]);}catch(_0x7fff1c){return BPromise[_0x9659('0x29')](_0x7fff1c);}return _0x359ba6[_0x9659('0x2a')]();};}function saveUpdates(_0x5f4400,_0x341eec){return function(_0x459e4f){if(_0x459e4f){return _0x459e4f[_0x9659('0x2b')](_0x5f4400)[_0x9659('0x2c')](function(_0x423986){return _0x423986;});}return null;};}function removeEntity(_0x500ecd,_0x566674){return function(_0x24e83c){if(_0x24e83c){return _0x24e83c[_0x9659('0x2d')]()[_0x9659('0x2c')](function(){_0x500ecd[_0x9659('0x23')](0xcc)[_0x9659('0x2e')]();});}};}function handleEntityNotFound(_0x2f5f48,_0x47e2f7){return function(_0xc3eb55){if(!_0xc3eb55){_0x2f5f48[_0x9659('0x22')](0x194);}return _0xc3eb55;};}function handleError(_0x565063,_0x32b593){_0x32b593=_0x32b593||0x1f4;return function(_0x14506f){logger[_0x9659('0x2f')](_0x14506f[_0x9659('0x30')]);if(_0x14506f['name']){delete _0x14506f[_0x9659('0x31')];}_0x565063[_0x9659('0x23')](_0x32b593)[_0x9659('0x32')](_0x14506f);};}exports['index']=function(_0x603430,_0x222396){var _0x239930={},_0x2d28a7={},_0x20e2dc={'count':0x0,'rows':[]};var _0x39a1ca=_[_0x9659('0x33')](db['ChatInternalMessage'][_0x9659('0x34')],function(_0x9a7c7d){return{'name':_0x9a7c7d[_0x9659('0x35')],'type':_0x9a7c7d['type'][_0x9659('0x36')]};});_0x2d28a7[_0x9659('0x37')]=_[_0x9659('0x33')](_0x39a1ca,_0x9659('0x31'));_0x2d28a7[_0x9659('0x38')]=_[_0x9659('0x39')](_0x603430[_0x9659('0x38')]);_0x2d28a7[_0x9659('0x3a')]=_[_0x9659('0x3b')](_0x2d28a7[_0x9659('0x37')],_0x2d28a7[_0x9659('0x38')]);_0x239930['attributes']=_[_0x9659('0x3b')](_0x2d28a7[_0x9659('0x37')],qs[_0x9659('0x3c')](_0x603430['query'][_0x9659('0x3c')]));_0x239930[_0x9659('0x3d')]=_0x239930[_0x9659('0x3d')][_0x9659('0x3e')]?_0x239930[_0x9659('0x3d')]:_0x2d28a7[_0x9659('0x37')];if(!_0x603430[_0x9659('0x38')][_0x9659('0x3f')](_0x9659('0x40'))){_0x239930['limit']=qs[_0x9659('0x41')](_0x603430['query']['limit']);_0x239930[_0x9659('0x25')]=qs[_0x9659('0x25')](_0x603430['query']['offset']);}_0x239930[_0x9659('0x42')]=qs[_0x9659('0x43')](_0x603430[_0x9659('0x38')][_0x9659('0x43')]);_0x239930[_0x9659('0x44')]=qs['filters'](_[_0x9659('0x45')](_0x603430[_0x9659('0x38')],_0x2d28a7[_0x9659('0x3a')]),_0x39a1ca);if(_0x603430['query'][_0x9659('0x46')]){_0x239930[_0x9659('0x44')]=_[_0x9659('0x47')](_0x239930['where'],{'$or':_[_0x9659('0x33')](_0x39a1ca,function(_0x9f21d4){if(_0x9f21d4[_0x9659('0x48')]!==_0x9659('0x49')){var _0x298bed={};_0x298bed[_0x9f21d4['name']]={'$like':'%'+_0x603430[_0x9659('0x38')][_0x9659('0x46')]+'%'};return _0x298bed;}})});}_0x239930=_[_0x9659('0x47')]({},_0x239930,_0x603430[_0x9659('0x4a')]);var _0x10aaa8={'where':_0x239930[_0x9659('0x44')]};return db[_0x9659('0x4b')][_0x9659('0x4c')](_0x10aaa8)[_0x9659('0x2c')](function(_0x1ce4a6){_0x20e2dc[_0x9659('0x4c')]=_0x1ce4a6;if(_0x603430['query'][_0x9659('0x4d')]){_0x239930[_0x9659('0x4e')]=[{'all':!![]}];}return db[_0x9659('0x4b')]['findAll'](_0x239930);})['then'](function(_0x273aa0){_0x20e2dc[_0x9659('0x4f')]=_0x273aa0;return _0x20e2dc;})[_0x9659('0x2c')](respondWithFilteredResult(_0x222396,_0x239930))[_0x9659('0x50')](handleError(_0x222396,null));};exports[_0x9659('0x51')]=function(_0x18cda7,_0x56f2c7){var _0x33c23b={'raw':!![],'where':{'id':_0x18cda7['params']['id']}},_0x3e72a9={};_0x3e72a9[_0x9659('0x37')]=_[_0x9659('0x39')](db[_0x9659('0x4b')][_0x9659('0x34')]);_0x3e72a9[_0x9659('0x38')]=_[_0x9659('0x39')](_0x18cda7[_0x9659('0x38')]);_0x3e72a9['filters']=_[_0x9659('0x3b')](_0x3e72a9[_0x9659('0x37')],_0x3e72a9[_0x9659('0x38')]);_0x33c23b[_0x9659('0x3d')]=_[_0x9659('0x3b')](_0x3e72a9['model'],qs[_0x9659('0x3c')](_0x18cda7[_0x9659('0x38')][_0x9659('0x3c')]));_0x33c23b['attributes']=_0x33c23b[_0x9659('0x3d')][_0x9659('0x3e')]?_0x33c23b[_0x9659('0x3d')]:_0x3e72a9[_0x9659('0x37')];if(_0x18cda7['query'][_0x9659('0x4d')]){_0x33c23b['include']=[{'all':!![]}];}_0x33c23b=_[_0x9659('0x47')]({},_0x33c23b,_0x18cda7[_0x9659('0x4a')]);return db[_0x9659('0x4b')][_0x9659('0x52')](_0x33c23b)['then'](handleEntityNotFound(_0x56f2c7,null))[_0x9659('0x2c')](respondWithResult(_0x56f2c7,null))['catch'](handleError(_0x56f2c7,null));};exports['create']=function(_0x1faecd,_0x10c367){return db[_0x9659('0x4b')][_0x9659('0x53')](_0x1faecd[_0x9659('0x54')],{})[_0x9659('0x2c')](respondWithResult(_0x10c367,0xc9))[_0x9659('0x50')](handleError(_0x10c367,null));};exports[_0x9659('0x2b')]=function(_0x222842,_0x39a1e1){if(_0x222842[_0x9659('0x54')]['id']){delete _0x222842[_0x9659('0x54')]['id'];}return db[_0x9659('0x4b')][_0x9659('0x52')]({'where':{'id':_0x222842[_0x9659('0x55')]['id']}})['then'](handleEntityNotFound(_0x39a1e1,null))[_0x9659('0x2c')](saveUpdates(_0x222842['body'],null))[_0x9659('0x2c')](respondWithResult(_0x39a1e1,null))[_0x9659('0x50')](handleError(_0x39a1e1,null));};exports[_0x9659('0x2d')]=function(_0x1dcb46,_0x39e998){return db[_0x9659('0x4b')][_0x9659('0x52')]({'where':{'id':_0x1dcb46['params']['id']}})[_0x9659('0x2c')](handleEntityNotFound(_0x39e998,null))[_0x9659('0x2c')](removeEntity(_0x39e998,null))[_0x9659('0x50')](handleError(_0x39e998,null));};exports[_0x9659('0x56')]=function(_0x5cad7d,_0x469c35){return db[_0x9659('0x4b')][_0x9659('0x56')]()['then'](respondWithResult(_0x469c35,null))[_0x9659('0x50')](handleError(_0x469c35,null));};function wrapUser(_0xe06b74){return function(_0x237321){var _0x4acd2a=_0xe06b74[_0x9659('0x57')]({'plain':!![]});_0x4acd2a['messages']=[];if(_0x237321){_0x4acd2a['lastMessageAt']=_0x237321['createdAt'];_0x4acd2a['lastMessage']=_0x237321;}else{_0x4acd2a[_0x9659('0x58')]=moment(0x0)[_0x9659('0x59')](_0x9659('0x5a'));_0x4acd2a[_0x9659('0x5b')]={};}return _0x4acd2a;};}exports[_0x9659('0x5c')]=function(_0x2c2a54,_0x131094,_0x5ce62b){var _0x28fea9=[];return db[_0x9659('0x5d')][_0x9659('0x5e')]({'where':{'role':[_0x9659('0x5f'),_0x9659('0x60'),_0x9659('0x61')]},'attributes':['id','fullname',_0x9659('0x31'),_0x9659('0x62'),_0x9659('0x63'),_0x9659('0x64'),_0x9659('0x65'),_0x9659('0x66'),_0x9659('0x67'),_0x9659('0x68')],'order':qs[_0x9659('0x43')](_0x9659('0x69')),'include':[{'model':db[_0x9659('0x6a')],'as':'VoiceQueues','attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0x9659('0x2c')](function(_0x5e80a0){if(_0x5e80a0){var _0x4caba1=_0x2c2a54['user'][_0x9659('0x57')]({'plain':!![]});if(!_0x4caba1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4caba1[_0x9659('0x62')]===_0x9659('0x61')){return db['UserProfileSection'][_0x9659('0x52')]({'where':{'name':_0x9659('0x6b'),'userProfileId':_0x4caba1[_0x9659('0x6c')]},'raw':!![]})[_0x9659('0x2c')](function(_0x51b656){if(_0x51b656){if(_0x51b656[_0x9659('0x6d')]===0x0){return db[_0x9659('0x6e')][_0x9659('0x5e')]({'where':{'sectionId':_0x51b656['id']},'raw':!![]})[_0x9659('0x2c')](function(_0x252e68){var _0x4a45b2=[];if(_[_0x9659('0x6f')](_0x252e68)){_0x4a45b2=_['filter'](_0x5e80a0,function(_0x33a432){if(_0x33a432[_0x9659('0x62')]!==_0x9659('0x5f')){return _0x33a432;}});return _0x4a45b2;}else{for(var _0x8357da=0x0;_0x8357da<_0x5e80a0[_0x9659('0x3e')];_0x8357da++){var _0x240e07=_0x5e80a0[_0x8357da];if(_0x240e07[_0x9659('0x62')]==='agent'){var _0x4aff2b=_[_0x9659('0x52')](_0x252e68,function(_0x17aee1){return _0x17aee1['resourceId']===_0x240e07['id'];});if(_0x4aff2b)_0x4a45b2[_0x9659('0x70')](_0x240e07);}else{_0x4a45b2[_0x9659('0x70')](_0x240e07);}}return _0x4a45b2;}});}else{return _0x5e80a0;}}else{var _0x5c6f78=_[_0x9659('0x46')](_0x5e80a0,function(_0x285a46){if(_0x285a46['role']!==_0x9659('0x5f')){return _0x285a46;}});return _0x5c6f78;}});}else{return _0x5e80a0;}}})['then'](function(_0x2fc04e){var _0x47228d=[];if(_0x2fc04e){_0x28fea9=_0x2fc04e;for(var _0x356f92=0x0;_0x356f92<_0x2fc04e[_0x9659('0x3e')];_0x356f92+=0x1){_0x28fea9[_0x356f92][_0x9659('0x71')]=[];_0x47228d[_0x9659('0x70')](db[_0x9659('0x4b')][_0x9659('0x52')]({'where':{'FromId':[_0x2c2a54['user']['id'],_0x2fc04e[_0x356f92]['id']],'ToId':[_0x2c2a54['user']['id'],_0x2fc04e[_0x356f92]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x9659('0x72'),_0x9659('0x73'),_0x9659('0x74'),'body'],'order':qs[_0x9659('0x43')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})['then'](wrapUser(_0x2fc04e[_0x356f92])));}return BPromise[_0x9659('0x75')](_0x47228d);}return[];})['then'](function(_0x5b9a7e){return{'rows':_0x5b9a7e,'count':_0x5b9a7e[_0x9659('0x3e')]};})['then'](respondWithResult(_0x131094,null))['catch'](handleError(_0x131094,null));}; \ No newline at end of file +var _0xc562=['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/environment','redis','defaults','localhost','register','status','json','offset','undefined','limit','count','set','apply','save','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','ChatInternalMessage','findAll','rows','catch','includeAll','include','create','body','find','params','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','agent','user','fullname','userpic','lastLoginAt','VoiceQueue','VoiceQueues','UserProfileSection','Agents','UserProfileResource','isEmpty','role','push','FromId','ToId','read','all','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv'];(function(_0x9f897b,_0x2bc0f7){var _0x595177=function(_0x45f07f){while(--_0x45f07f){_0x9f897b['push'](_0x9f897b['shift']());}};_0x595177(++_0x2bc0f7);}(_0xc562,0xcb));var _0x2c56=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc562[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x2c56('0x0'));var rimraf=require(_0x2c56('0x1'));var zipdir=require(_0x2c56('0x2'));var jsonpatch=require(_0x2c56('0x3'));var rp=require('request-promise');var moment=require(_0x2c56('0x4'));var BPromise=require(_0x2c56('0x5'));var Mustache=require(_0x2c56('0x6'));var util=require(_0x2c56('0x7'));var path=require(_0x2c56('0x8'));var sox=require(_0x2c56('0x9'));var csv=require(_0x2c56('0xa'));var ejs=require(_0x2c56('0xb'));var fs=require('fs');var fs_extra=require(_0x2c56('0xc'));var _=require('lodash');var squel=require(_0x2c56('0xd'));var crypto=require(_0x2c56('0xe'));var jsforce=require(_0x2c56('0xf'));var deskjs=require(_0x2c56('0x10'));var toCsv=require(_0x2c56('0xa'));var querystring=require(_0x2c56('0x11'));var Papa=require(_0x2c56('0x12'));var Redis=require(_0x2c56('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x2c56('0x14'));var as=require(_0x2c56('0x15'));var hardwareService=require(_0x2c56('0x16'));var logger=require(_0x2c56('0x17'))(_0x2c56('0x18'));var utils=require(_0x2c56('0x19'));var config=require(_0x2c56('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x2c56('0x1b')]=_[_0x2c56('0x1c')](config['redis'],{'host':_0x2c56('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2c56('0x1b')]));require('./chatInternalMessage.socket')[_0x2c56('0x1e')](socket);function respondWithStatusCode(_0x4ca55c,_0x336c11){_0x336c11=_0x336c11||0xcc;return function(_0x432d2f){if(_0x432d2f){return _0x4ca55c['sendStatus'](_0x336c11);}return _0x4ca55c[_0x2c56('0x1f')](_0x336c11)['end']();};}function respondWithResult(_0x5527bd,_0x49898d){_0x49898d=_0x49898d||0xc8;return function(_0x37cef5){if(_0x37cef5){return _0x5527bd[_0x2c56('0x1f')](_0x49898d)[_0x2c56('0x20')](_0x37cef5);}};}function respondWithFilteredResult(_0x2e019d,_0xd133a8){return function(_0x2bb6c5){if(_0x2bb6c5){var _0x3d05cd=typeof _0xd133a8[_0x2c56('0x21')]===_0x2c56('0x22')&&typeof _0xd133a8[_0x2c56('0x23')]==='undefined';var _0x452dc1=_0x2bb6c5['count'];var _0x358d5e=_0x3d05cd?0x0:_0xd133a8[_0x2c56('0x21')];var _0x334a92=_0x3d05cd?_0x2bb6c5[_0x2c56('0x24')]:_0xd133a8[_0x2c56('0x21')]+_0xd133a8[_0x2c56('0x23')];var _0x1b29a6;if(_0x334a92>=_0x452dc1){_0x334a92=_0x452dc1;_0x1b29a6=0xc8;}else{_0x1b29a6=0xce;}_0x2e019d[_0x2c56('0x1f')](_0x1b29a6);return _0x2e019d[_0x2c56('0x25')]('Content-Range',_0x358d5e+'-'+_0x334a92+'/'+_0x452dc1)[_0x2c56('0x20')](_0x2bb6c5);}return null;};}function patchUpdates(_0x3075e2){return function(_0x4cf47c){try{jsonpatch[_0x2c56('0x26')](_0x4cf47c,_0x3075e2,!![]);}catch(_0x817a76){return BPromise['reject'](_0x817a76);}return _0x4cf47c[_0x2c56('0x27')]();};}function saveUpdates(_0x523914,_0x4886b4){return function(_0x3a6591){if(_0x3a6591){return _0x3a6591[_0x2c56('0x28')](_0x523914)[_0x2c56('0x29')](function(_0x1d2972){return _0x1d2972;});}return null;};}function removeEntity(_0x4b8011,_0x3e7ed8){return function(_0x85a9df){if(_0x85a9df){return _0x85a9df['destroy']()[_0x2c56('0x29')](function(){_0x4b8011['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xfc83f3,_0x49e14b){return function(_0x46c210){if(!_0x46c210){_0xfc83f3[_0x2c56('0x2a')](0x194);}return _0x46c210;};}function handleError(_0x3553b2,_0x338e2f){_0x338e2f=_0x338e2f||0x1f4;return function(_0x1cfb11){logger[_0x2c56('0x2b')](_0x1cfb11[_0x2c56('0x2c')]);if(_0x1cfb11[_0x2c56('0x2d')]){delete _0x1cfb11[_0x2c56('0x2d')];}_0x3553b2['status'](_0x338e2f)[_0x2c56('0x2e')](_0x1cfb11);};}exports[_0x2c56('0x2f')]=function(_0x4d646d,_0x23390c){var _0x3bbfb7={},_0x127214={},_0x4831f5={'count':0x0,'rows':[]};var _0x4e2789=_[_0x2c56('0x30')](db['ChatInternalMessage'][_0x2c56('0x31')],function(_0x345857){return{'name':_0x345857[_0x2c56('0x32')],'type':_0x345857['type'][_0x2c56('0x33')]};});_0x127214['model']=_['map'](_0x4e2789,_0x2c56('0x2d'));_0x127214[_0x2c56('0x34')]=_[_0x2c56('0x35')](_0x4d646d[_0x2c56('0x34')]);_0x127214[_0x2c56('0x36')]=_[_0x2c56('0x37')](_0x127214[_0x2c56('0x38')],_0x127214['query']);_0x3bbfb7[_0x2c56('0x39')]=_[_0x2c56('0x37')](_0x127214[_0x2c56('0x38')],qs['fields'](_0x4d646d[_0x2c56('0x34')][_0x2c56('0x3a')]));_0x3bbfb7[_0x2c56('0x39')]=_0x3bbfb7[_0x2c56('0x39')][_0x2c56('0x3b')]?_0x3bbfb7['attributes']:_0x127214[_0x2c56('0x38')];if(!_0x4d646d[_0x2c56('0x34')][_0x2c56('0x3c')]('nolimit')){_0x3bbfb7['limit']=qs['limit'](_0x4d646d[_0x2c56('0x34')]['limit']);_0x3bbfb7[_0x2c56('0x21')]=qs[_0x2c56('0x21')](_0x4d646d[_0x2c56('0x34')][_0x2c56('0x21')]);}_0x3bbfb7[_0x2c56('0x3d')]=qs[_0x2c56('0x3e')](_0x4d646d[_0x2c56('0x34')]['sort']);_0x3bbfb7['where']=qs['filters'](_[_0x2c56('0x3f')](_0x4d646d[_0x2c56('0x34')],_0x127214[_0x2c56('0x36')]),_0x4e2789);if(_0x4d646d['query'][_0x2c56('0x40')]){_0x3bbfb7[_0x2c56('0x41')]=_[_0x2c56('0x42')](_0x3bbfb7[_0x2c56('0x41')],{'$or':_[_0x2c56('0x30')](_0x4e2789,function(_0x5a0b70){if(_0x5a0b70[_0x2c56('0x43')]!==_0x2c56('0x44')){var _0x42353c={};_0x42353c[_0x5a0b70['name']]={'$like':'%'+_0x4d646d[_0x2c56('0x34')][_0x2c56('0x40')]+'%'};return _0x42353c;}})});}_0x3bbfb7=_['merge']({},_0x3bbfb7,_0x4d646d[_0x2c56('0x45')]);var _0x2a9100={'where':_0x3bbfb7['where']};return db['ChatInternalMessage'][_0x2c56('0x24')](_0x2a9100)['then'](function(_0x2754e4){_0x4831f5[_0x2c56('0x24')]=_0x2754e4;if(_0x4d646d['query']['includeAll']){_0x3bbfb7['include']=[{'all':!![]}];}return db[_0x2c56('0x46')][_0x2c56('0x47')](_0x3bbfb7);})[_0x2c56('0x29')](function(_0x161c0e){_0x4831f5[_0x2c56('0x48')]=_0x161c0e;return _0x4831f5;})['then'](respondWithFilteredResult(_0x23390c,_0x3bbfb7))[_0x2c56('0x49')](handleError(_0x23390c,null));};exports['show']=function(_0x17ca5c,_0x37e386){var _0x22671e={'raw':!![],'where':{'id':_0x17ca5c['params']['id']}},_0x314641={};_0x314641[_0x2c56('0x38')]=_[_0x2c56('0x35')](db[_0x2c56('0x46')]['rawAttributes']);_0x314641['query']=_[_0x2c56('0x35')](_0x17ca5c['query']);_0x314641[_0x2c56('0x36')]=_['intersection'](_0x314641[_0x2c56('0x38')],_0x314641[_0x2c56('0x34')]);_0x22671e['attributes']=_[_0x2c56('0x37')](_0x314641[_0x2c56('0x38')],qs['fields'](_0x17ca5c[_0x2c56('0x34')][_0x2c56('0x3a')]));_0x22671e[_0x2c56('0x39')]=_0x22671e[_0x2c56('0x39')][_0x2c56('0x3b')]?_0x22671e['attributes']:_0x314641[_0x2c56('0x38')];if(_0x17ca5c[_0x2c56('0x34')][_0x2c56('0x4a')]){_0x22671e[_0x2c56('0x4b')]=[{'all':!![]}];}_0x22671e=_['merge']({},_0x22671e,_0x17ca5c[_0x2c56('0x45')]);return db[_0x2c56('0x46')]['find'](_0x22671e)[_0x2c56('0x29')](handleEntityNotFound(_0x37e386,null))[_0x2c56('0x29')](respondWithResult(_0x37e386,null))[_0x2c56('0x49')](handleError(_0x37e386,null));};exports[_0x2c56('0x4c')]=function(_0x5799a5,_0x3806e0){return db[_0x2c56('0x46')][_0x2c56('0x4c')](_0x5799a5['body'],{})[_0x2c56('0x29')](respondWithResult(_0x3806e0,0xc9))[_0x2c56('0x49')](handleError(_0x3806e0,null));};exports['update']=function(_0x554c94,_0x3cd0b5){if(_0x554c94['body']['id']){delete _0x554c94[_0x2c56('0x4d')]['id'];}return db[_0x2c56('0x46')][_0x2c56('0x4e')]({'where':{'id':_0x554c94[_0x2c56('0x4f')]['id']}})[_0x2c56('0x29')](handleEntityNotFound(_0x3cd0b5,null))[_0x2c56('0x29')](saveUpdates(_0x554c94[_0x2c56('0x4d')],null))[_0x2c56('0x29')](respondWithResult(_0x3cd0b5,null))[_0x2c56('0x49')](handleError(_0x3cd0b5,null));};exports[_0x2c56('0x50')]=function(_0x498d07,_0x4fb189){return db['ChatInternalMessage']['find']({'where':{'id':_0x498d07['params']['id']}})[_0x2c56('0x29')](handleEntityNotFound(_0x4fb189,null))[_0x2c56('0x29')](removeEntity(_0x4fb189,null))[_0x2c56('0x49')](handleError(_0x4fb189,null));};exports[_0x2c56('0x51')]=function(_0x27eac4,_0x462db9){return db[_0x2c56('0x46')][_0x2c56('0x51')]()[_0x2c56('0x29')](respondWithResult(_0x462db9,null))[_0x2c56('0x49')](handleError(_0x462db9,null));};function wrapUser(_0x3d82d4){return function(_0x404ca8){var _0x3a7b84=_0x3d82d4[_0x2c56('0x52')]({'plain':!![]});_0x3a7b84[_0x2c56('0x53')]=[];if(_0x404ca8){_0x3a7b84[_0x2c56('0x54')]=_0x404ca8[_0x2c56('0x55')];_0x3a7b84[_0x2c56('0x56')]=_0x404ca8;}else{_0x3a7b84['lastMessageAt']=moment(0x0)[_0x2c56('0x57')](_0x2c56('0x58'));_0x3a7b84[_0x2c56('0x56')]={};}return _0x3a7b84;};}exports['getUsers']=function(_0x1d2a13,_0x164e39,_0x3a1e37){var _0x32506e=[];return db[_0x2c56('0x59')]['findAll']({'where':{'role':[_0x2c56('0x5a'),'admin',_0x2c56('0x5b')]},'attributes':['id',_0x2c56('0x5c'),'name','role',_0x2c56('0x5d'),'internal','online',_0x2c56('0x5e'),'allowmessenger','showWebBar'],'order':qs[_0x2c56('0x3e')]('-online'),'include':[{'model':db[_0x2c56('0x5f')],'as':_0x2c56('0x60'),'attributes':['id',_0x2c56('0x2d'),_0x2c56('0x43')],'through':{'attributes':[]}}]})[_0x2c56('0x29')](function(_0x2fac1b){if(_0x2fac1b){var _0x2f6244=_0x1d2a13[_0x2c56('0x5b')][_0x2c56('0x52')]({'plain':!![]});if(!_0x2f6244)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f6244['role']===_0x2c56('0x5b')){return db[_0x2c56('0x61')][_0x2c56('0x4e')]({'where':{'name':_0x2c56('0x62'),'userProfileId':_0x2f6244['userProfileId']},'raw':!![]})[_0x2c56('0x29')](function(_0x1e6894){if(_0x1e6894){if(_0x1e6894['autoAssociation']===0x0){return db[_0x2c56('0x63')][_0x2c56('0x47')]({'where':{'sectionId':_0x1e6894['id']},'raw':!![]})[_0x2c56('0x29')](function(_0x1d8bcc){var _0x53883f=[];if(_[_0x2c56('0x64')](_0x1d8bcc)){_0x53883f=_[_0x2c56('0x40')](_0x2fac1b,function(_0x4f092f){if(_0x4f092f[_0x2c56('0x65')]!==_0x2c56('0x5a')){return _0x4f092f;}});return _0x53883f;}else{for(var _0x41d81a=0x0;_0x41d81a<_0x2fac1b[_0x2c56('0x3b')];_0x41d81a++){var _0x5d3873=_0x2fac1b[_0x41d81a];if(_0x5d3873[_0x2c56('0x65')]===_0x2c56('0x5a')){var _0x32c496=_['find'](_0x1d8bcc,function(_0x42bc09){return _0x42bc09['resourceId']===_0x5d3873['id'];});if(_0x32c496)_0x53883f[_0x2c56('0x66')](_0x5d3873);}else{_0x53883f['push'](_0x5d3873);}}return _0x53883f;}});}else{return _0x2fac1b;}}else{var _0x40a5db=_[_0x2c56('0x40')](_0x2fac1b,function(_0x54b06a){if(_0x54b06a[_0x2c56('0x65')]!=='agent'){return _0x54b06a;}});return _0x40a5db;}});}else{return _0x2fac1b;}}})[_0x2c56('0x29')](function(_0xa4a69){var _0x16af69=[];if(_0xa4a69){_0x32506e=_0xa4a69;for(var _0x738ddd=0x0;_0x738ddd<_0xa4a69[_0x2c56('0x3b')];_0x738ddd+=0x1){_0x32506e[_0x738ddd][_0x2c56('0x53')]=[];_0x16af69['push'](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x1d2a13[_0x2c56('0x5b')]['id'],_0xa4a69[_0x738ddd]['id']],'ToId':[_0x1d2a13[_0x2c56('0x5b')]['id'],_0xa4a69[_0x738ddd]['id']],'ChatGroupId':null},'attributes':['id',_0x2c56('0x55'),_0x2c56('0x67'),_0x2c56('0x68'),_0x2c56('0x69'),_0x2c56('0x4d')],'order':qs[_0x2c56('0x3e')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x2c56('0x29')](wrapUser(_0xa4a69[_0x738ddd])));}return BPromise[_0x2c56('0x6a')](_0x16af69);}return[];})[_0x2c56('0x29')](function(_0x2229d1){return{'rows':_0x2229d1,'count':_0x2229d1[_0x2c56('0x3b')]};})['then'](respondWithResult(_0x164e39,null))[_0x2c56('0x49')](handleError(_0x164e39,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 4126154..485a356 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 _0xb184=['exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','remove','emit','hook'];(function(_0x2f1e68,_0x38b8f5){var _0x79d7dd=function(_0x3ff36a){while(--_0x3ff36a){_0x2f1e68['push'](_0x2f1e68['shift']());}};_0x79d7dd(++_0x38b8f5);}(_0xb184,0x14e));var _0x4b18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb184[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x4b18('0x0'));var ChatInternalMessage=require(_0x4b18('0x1'))['db'][_0x4b18('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x4b18('0x3')](0x0);var events={'afterCreate':_0x4b18('0x4'),'afterUpdate':'update','afterDestroy':_0x4b18('0x5')};function emitEvent(_0x60cb1a){return function(_0x15fadb,_0x19500d,_0x1af7b5){ChatInternalMessageEvents[_0x4b18('0x6')](_0x60cb1a+':'+_0x15fadb['id'],_0x15fadb);ChatInternalMessageEvents['emit'](_0x60cb1a,_0x15fadb);_0x1af7b5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x4b18('0x7')](e,emitEvent(event));}}module[_0x4b18('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x4390=['exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','emit','hook'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x4390,0x88));var _0x0439=function(_0x89c25f,_0x447499){_0x89c25f=_0x89c25f-0x0;var _0x730ea5=_0x4390[_0x89c25f];return _0x730ea5;};'use strict';var EventEmitter=require(_0x0439('0x0'));var ChatInternalMessage=require(_0x0439('0x1'))['db'][_0x0439('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x0439('0x3')](0x0);var events={'afterCreate':_0x0439('0x4'),'afterUpdate':_0x0439('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4ac968){return function(_0x5c8030,_0x196901,_0x25142f){ChatInternalMessageEvents[_0x0439('0x6')](_0x4ac968+':'+_0x5c8030['id'],_0x5c8030);ChatInternalMessageEvents[_0x0439('0x6')](_0x4ac968,_0x5c8030);_0x25142f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x0439('0x7')](e,emitEvent(event));}}module[_0x0439('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 1245c9c..3579865 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 _0xb9d6=['exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatInternalMessage.attributes'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xb9d6,0xc9));var _0x6b9d=function(_0x42b3aa,_0x223f53){_0x42b3aa=_0x42b3aa-0x0;var _0x319157=_0xb9d6[_0x42b3aa];return _0x319157;};'use strict';var _=require(_0x6b9d('0x0'));var util=require('util');var logger=require(_0x6b9d('0x1'))(_0x6b9d('0x2'));var moment=require(_0x6b9d('0x3'));var BPromise=require(_0x6b9d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b9d('0x5'));var rimraf=require(_0x6b9d('0x6'));var config=require(_0x6b9d('0x7'));var attributes=require(_0x6b9d('0x8'));module[_0x6b9d('0x9')]=function(_0x5c0235,_0x570b7e){return _0x5c0235[_0x6b9d('0xa')](_0x6b9d('0xb'),attributes,{'tableName':_0x6b9d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6b9d('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4b53=['../../config/environment','exports','ChatInternalMessage','chat_internal_messages','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x4b53,0x1dd));var _0x34b5=function(_0xe23b4b,_0x208e2a){_0xe23b4b=_0xe23b4b-0x0;var _0x9a972a=_0x4b53[_0xe23b4b];return _0x9a972a;};'use strict';var _=require(_0x34b5('0x0'));var util=require(_0x34b5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x34b5('0x2'));var BPromise=require(_0x34b5('0x3'));var rp=require(_0x34b5('0x4'));var fs=require('fs');var path=require(_0x34b5('0x5'));var rimraf=require(_0x34b5('0x6'));var config=require(_0x34b5('0x7'));var attributes=require('./chatInternalMessage.attributes');module[_0x34b5('0x8')]=function(_0x57a948,_0x3d833c){return _0x57a948['define'](_0x34b5('0x9'),attributes,{'tableName':_0x34b5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index aa76047..c413853 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 _0x6d03=['./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x576ae7,_0x384abe){var _0x50b4c9=function(_0x199304){while(--_0x199304){_0x576ae7['push'](_0x576ae7['shift']());}};_0x50b4c9(++_0x384abe);}(_0x6d03,0x177));var _0x36d0=function(_0xaa7cc4,_0x46bdac){_0xaa7cc4=_0xaa7cc4-0x0;var _0x129f07=_0x6d03[_0xaa7cc4];return _0x129f07;};'use strict';var _=require(_0x36d0('0x0'));var util=require('util');var moment=require(_0x36d0('0x1'));var BPromise=require(_0x36d0('0x2'));var rs=require(_0x36d0('0x3'));var fs=require('fs');var Redis=require(_0x36d0('0x4'));var db=require(_0x36d0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x36d0('0x6'))(_0x36d0('0x7'));var config=require(_0x36d0('0x8'));var jayson=require(_0x36d0('0x9'));var client=jayson['client'][_0x36d0('0xa')]({'port':0x232a});config[_0x36d0('0xb')]=_[_0x36d0('0xc')](config[_0x36d0('0xb')],{'host':_0x36d0('0xd'),'port':0x18eb});var socket=require(_0x36d0('0xe'))(new Redis(config['redis']));require(_0x36d0('0xf'))[_0x36d0('0x10')](socket);function respondWithRpcPromise(_0x1cc21d,_0x285900,_0x3fa0fd){return new BPromise(function(_0x5e4666,_0x5b69ff){return client[_0x36d0('0x11')](_0x1cc21d,_0x3fa0fd)[_0x36d0('0x12')](function(_0x189792){logger[_0x36d0('0x13')](_0x36d0('0x14'),_0x285900,_0x36d0('0x15'));logger['debug'](_0x36d0('0x16'),_0x285900,'request\x20sent',JSON['stringify'](_0x189792));if(_0x189792['error']){if(_0x189792['error']['code']===0x1f4){logger[_0x36d0('0x17')](_0x36d0('0x14'),_0x285900,_0x189792[_0x36d0('0x17')][_0x36d0('0x18')]);return _0x5b69ff(_0x189792[_0x36d0('0x17')][_0x36d0('0x18')]);}logger[_0x36d0('0x17')](_0x36d0('0x14'),_0x285900,_0x189792[_0x36d0('0x17')][_0x36d0('0x18')]);return _0x5e4666(_0x189792[_0x36d0('0x17')]['message']);}else{logger['info'](_0x36d0('0x14'),_0x285900,_0x36d0('0x15'));_0x5e4666(_0x189792['result'][_0x36d0('0x18')]);}})[_0x36d0('0x19')](function(_0x20115c){logger[_0x36d0('0x17')](_0x36d0('0x14'),_0x285900,_0x20115c);_0x5b69ff(_0x20115c);});});} \ No newline at end of file +var _0xe95b=['bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash'];(function(_0x3247bd,_0x2bf86b){var _0x2fa768=function(_0xde652){while(--_0xde652){_0x3247bd['push'](_0x3247bd['shift']());}};_0x2fa768(++_0x2bf86b);}(_0xe95b,0x107));var _0xbe95=function(_0x2a3fc4,_0x3c038e){_0x2a3fc4=_0x2a3fc4-0x0;var _0x431759=_0xe95b[_0x2a3fc4];return _0x431759;};'use strict';var _=require(_0xbe95('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbe95('0x1'));var rs=require(_0xbe95('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbe95('0x3'));var logger=require(_0xbe95('0x4'))('rpc');var config=require(_0xbe95('0x5'));var jayson=require(_0xbe95('0x6'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xbe95('0x7')],{'host':_0xbe95('0x8'),'port':0x18eb});var socket=require(_0xbe95('0x9'))(new Redis(config[_0xbe95('0x7')]));require(_0xbe95('0xa'))[_0xbe95('0xb')](socket);function respondWithRpcPromise(_0x6442a2,_0xa9029d,_0xb3c5fd){return new BPromise(function(_0x53a02f,_0x37b226){return client[_0xbe95('0xc')](_0x6442a2,_0xb3c5fd)['then'](function(_0x1f1ac2){logger[_0xbe95('0xd')](_0xbe95('0xe'),_0xa9029d,_0xbe95('0xf'));logger[_0xbe95('0x10')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0xa9029d,_0xbe95('0xf'),JSON[_0xbe95('0x11')](_0x1f1ac2));if(_0x1f1ac2[_0xbe95('0x12')]){if(_0x1f1ac2['error']['code']===0x1f4){logger[_0xbe95('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0xa9029d,_0x1f1ac2[_0xbe95('0x12')][_0xbe95('0x13')]);return _0x37b226(_0x1f1ac2[_0xbe95('0x12')][_0xbe95('0x13')]);}logger[_0xbe95('0x12')](_0xbe95('0xe'),_0xa9029d,_0x1f1ac2[_0xbe95('0x12')][_0xbe95('0x13')]);return _0x53a02f(_0x1f1ac2['error'][_0xbe95('0x13')]);}else{logger[_0xbe95('0xd')]('ChatInternalMessage,\x20%s,\x20%s',_0xa9029d,_0xbe95('0xf'));_0x53a02f(_0x1f1ac2[_0xbe95('0x14')][_0xbe95('0x13')]);}})[_0xbe95('0x15')](function(_0x11827f){logger['error'](_0xbe95('0xe'),_0xa9029d,_0x11827f);_0x37b226(_0x11827f);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 7feb5da..247418d 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 _0x1ad9=['update','emit','removeListener','length','save','remove'];(function(_0x4f4f0f,_0x25c84f){var _0x2a0c8a=function(_0x2619c7){while(--_0x2619c7){_0x4f4f0f['push'](_0x4f4f0f['shift']());}};_0x2a0c8a(++_0x25c84f);}(_0x1ad9,0x94));var _0x91ad=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0x1ad9[_0x387777];return _0x3f84c0;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x91ad('0x0'),_0x91ad('0x1'),_0x91ad('0x2')];function createListener(_0x147c7d,_0x111094){return function(_0x3b6b22){_0x111094[_0x91ad('0x3')](_0x147c7d,_0x3b6b22);};}function removeListener(_0x150718,_0x1604c5){return function(){ChatInternalMessageEvents[_0x91ad('0x4')](_0x150718,_0x1604c5);};}exports['register']=function(_0xe13125){for(var _0xb8028a=0x0,_0x2f7496=events[_0x91ad('0x5')];_0xb8028a<_0x2f7496;_0xb8028a++){var _0x554314=events[_0xb8028a];var _0x2e153c=createListener('chatInternalMessage:'+_0x554314,_0xe13125);ChatInternalMessageEvents['on'](_0x554314,_0x2e153c);}}; \ No newline at end of file +var _0x503d=['remove','update','length','./chatInternalMessage.events','save'];(function(_0x1d50f2,_0x3c3ec6){var _0x3769b8=function(_0x50926a){while(--_0x50926a){_0x1d50f2['push'](_0x1d50f2['shift']());}};_0x3769b8(++_0x3c3ec6);}(_0x503d,0x161));var _0xd503=function(_0x4f6f84,_0x31e197){_0x4f6f84=_0x4f6f84-0x0;var _0x20d989=_0x503d[_0x4f6f84];return _0x20d989;};'use strict';var ChatInternalMessageEvents=require(_0xd503('0x0'));var events=[_0xd503('0x1'),_0xd503('0x2'),_0xd503('0x3')];function createListener(_0x58ea37,_0x10e0a5){return function(_0x4ca480){_0x10e0a5['emit'](_0x58ea37,_0x4ca480);};}function removeListener(_0x3413e0,_0x49140d){return function(){ChatInternalMessageEvents['removeListener'](_0x3413e0,_0x49140d);};}exports['register']=function(_0x3592b3){for(var _0x9ba85d=0x0,_0x4f131d=events[_0xd503('0x4')];_0x9ba85d<_0x4f131d;_0x9ba85d++){var _0x18d7f9=events[_0x9ba85d];var _0x4fad98=createListener('chatInternalMessage:'+_0x18d7f9,_0x3592b3);ChatInternalMessageEvents['on'](_0x18d7f9,_0x4fad98);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index f415a38..692a194 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 _0x29a5=['Router','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','/users','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x29a5,0x1e0));var _0x529a=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x29a5[_0x4a747d];return _0x3a5b5c;};'use strict';var multer=require(_0x529a('0x0'));var util=require(_0x529a('0x1'));var path=require(_0x529a('0x2'));var timeout=require('connect-timeout');var express=require(_0x529a('0x3'));var router=express[_0x529a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x529a('0x5'));var interaction=require(_0x529a('0x6'));var config=require('../../config/environment');var controller=require(_0x529a('0x7'));router[_0x529a('0x8')]('/',auth[_0x529a('0x9')](),controller[_0x529a('0xa')]);router[_0x529a('0x8')](_0x529a('0xb'),auth[_0x529a('0x9')](),controller['describe']);router[_0x529a('0x8')](_0x529a('0xc'),auth[_0x529a('0x9')](),controller['getUsers']);router[_0x529a('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x529a('0xd')]);router[_0x529a('0xe')]('/',auth[_0x529a('0x9')](),controller[_0x529a('0xf')]);router[_0x529a('0x10')](_0x529a('0x11'),controller[_0x529a('0x12')]);router[_0x529a('0x13')](_0x529a('0x11'),auth[_0x529a('0x9')](),controller[_0x529a('0x14')]);module[_0x529a('0x15')]=router; \ No newline at end of file +var _0x7dfa=['create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','getUsers','show','post'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x7dfa,0xa7));var _0xa7df=function(_0x3f3f40,_0x4c71f4){_0x3f3f40=_0x3f3f40-0x0;var _0x403b7a=_0x7dfa[_0x3f3f40];return _0x403b7a;};'use strict';var multer=require(_0xa7df('0x0'));var util=require(_0xa7df('0x1'));var path=require(_0xa7df('0x2'));var timeout=require(_0xa7df('0x3'));var express=require(_0xa7df('0x4'));var router=express['Router']();var fs_extra=require(_0xa7df('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa7df('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xa7df('0x7')]('/',auth[_0xa7df('0x8')](),controller[_0xa7df('0x9')]);router[_0xa7df('0x7')]('/describe',auth[_0xa7df('0x8')](),controller['describe']);router['get']('/users',auth[_0xa7df('0x8')](),controller[_0xa7df('0xa')]);router['get']('/:id',auth[_0xa7df('0x8')](),controller[_0xa7df('0xb')]);router[_0xa7df('0xc')]('/',auth['isAuthenticated'](),controller[_0xa7df('0xd')]);router[_0xa7df('0xe')](_0xa7df('0xf'),controller[_0xa7df('0x10')]);router[_0xa7df('0x11')](_0xa7df('0xf'),auth[_0xa7df('0x8')](),controller[_0xa7df('0x12')]);module[_0xa7df('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 86c9229..c450ece 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 _0xa062=['TEXT','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x116f1f,_0x504f9c){var _0x15d7ab=function(_0x27af2d){while(--_0x27af2d){_0x116f1f['push'](_0x116f1f['shift']());}};_0x15d7ab(++_0x504f9c);}(_0xa062,0x101));var _0x2a06=function(_0x510bc7,_0x540f0d){_0x510bc7=_0x510bc7-0x0;var _0x49e2cd=_0xa062[_0x510bc7];return _0x49e2cd;};'use strict';var Sequelize=require(_0x2a06('0x0'));module[_0x2a06('0x1')]={'body':{'type':Sequelize[_0x2a06('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x2a06('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x2a06('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2a06('0x4')]('in',_0x2a06('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x2a06('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x1c3d=['TEXT','medium','BOOLEAN','out','DATE','STRING','exports'];(function(_0x42152d,_0x27738d){var _0x7c79a5=function(_0xe78d9e){while(--_0xe78d9e){_0x42152d['push'](_0x42152d['shift']());}};_0x7c79a5(++_0x27738d);}(_0x1c3d,0x1b8));var _0xd1c3=function(_0x43c341,_0x4aa2ca){_0x43c341=_0x43c341-0x0;var _0xf8e420=_0x1c3d[_0x43c341];return _0xf8e420;};'use strict';var Sequelize=require('sequelize');module[_0xd1c3('0x0')]={'body':{'type':Sequelize[_0xd1c3('0x1')](_0xd1c3('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd1c3('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xd1c3('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0xd1c3('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd1c3('0x5')]},'providerName':{'type':Sequelize[_0xd1c3('0x6')]},'providerResponse':{'type':Sequelize[_0xd1c3('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 348849e..912b21f 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 _0x6c98=['bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','socket.io-emitter','./chatMessage.socket','register','client','http','request','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','set','Content-Range','apply','then','destroy','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','options','ChatMessage','count','findAll','show','params','includeAll','include','find','create','body','describe','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','update','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','motionChannel','channel','event','EventManager','acceptmessage','formData','chat-interactions','reject','ChatInteraction','ChatInteractionId','info','role','null','rejectMessage','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x112661,_0x3404c8){var _0x29dc36=function(_0x564408){while(--_0x564408){_0x112661['push'](_0x112661['shift']());}};_0x29dc36(++_0x3404c8);}(_0x6c98,0x7c));var _0x86c9=function(_0x47d39e,_0x945d10){_0x47d39e=_0x47d39e-0x0;var _0x47e00a=_0x6c98[_0x47d39e];return _0x47e00a;};'use strict';var emlformat=require(_0x86c9('0x0'));var rimraf=require(_0x86c9('0x1'));var zipdir=require(_0x86c9('0x2'));var jsonpatch=require(_0x86c9('0x3'));var rp=require(_0x86c9('0x4'));var moment=require(_0x86c9('0x5'));var BPromise=require(_0x86c9('0x6'));var Mustache=require(_0x86c9('0x7'));var util=require(_0x86c9('0x8'));var path=require(_0x86c9('0x9'));var sox=require('sox');var csv=require(_0x86c9('0xa'));var ejs=require(_0x86c9('0xb'));var fs=require('fs');var fs_extra=require(_0x86c9('0xc'));var _=require(_0x86c9('0xd'));var squel=require(_0x86c9('0xe'));var crypto=require('crypto');var jsforce=require(_0x86c9('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x86c9('0xa'));var querystring=require(_0x86c9('0x10'));var Papa=require(_0x86c9('0x11'));var Redis=require(_0x86c9('0x12'));var authService=require(_0x86c9('0x13'));var qs=require(_0x86c9('0x14'));var as=require(_0x86c9('0x15'));var hardwareService=require(_0x86c9('0x16'));var logger=require(_0x86c9('0x17'))('api');var utils=require(_0x86c9('0x18'));var config=require(_0x86c9('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x86c9('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x86c9('0x1b'))(new Redis(config[_0x86c9('0x1a')]));require(_0x86c9('0x1c'))[_0x86c9('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x86c9('0x1e')][_0x86c9('0x1f')]({'port':0x232c});var client9002=jayson[_0x86c9('0x1e')][_0x86c9('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2d8418,_0x3cf7b1,_0x21046e,_0x2c6e2c){return new BPromise(function(_0x5db56a,_0x3f1e87){var _0xe71fa3=_0x2c6e2c||client;return _0xe71fa3[_0x86c9('0x20')](_0x2d8418,_0x21046e)['then'](function(_0x25cc4a){logger['info'](_0x86c9('0x21'),_0x3cf7b1,_0x86c9('0x22'));logger['debug'](_0x86c9('0x23'),_0x3cf7b1,_0x86c9('0x22'),JSON[_0x86c9('0x24')](_0x25cc4a));if(_0x25cc4a[_0x86c9('0x25')]){if(_0x25cc4a[_0x86c9('0x25')][_0x86c9('0x26')]===0x1f4){logger[_0x86c9('0x25')]('ChatMessage,\x20%s,\x20%s',_0x3cf7b1,_0x25cc4a[_0x86c9('0x25')][_0x86c9('0x27')]);return _0x3f1e87(_0x25cc4a[_0x86c9('0x25')][_0x86c9('0x27')]);}logger[_0x86c9('0x25')](_0x86c9('0x21'),_0x3cf7b1,_0x25cc4a[_0x86c9('0x25')][_0x86c9('0x27')]);return _0x5db56a(_0x25cc4a[_0x86c9('0x25')]['message']);}else{logger['info'](_0x86c9('0x21'),_0x3cf7b1,'request\x20sent');_0x5db56a(_0x25cc4a[_0x86c9('0x28')]['message']);}})[_0x86c9('0x29')](function(_0x3c1b09){logger[_0x86c9('0x25')](_0x86c9('0x21'),_0x3cf7b1,_0x3c1b09);_0x3f1e87(_0x3c1b09);});});}function respondWithStatusCode(_0xa0c71a,_0x2e339e){_0x2e339e=_0x2e339e||0xcc;return function(_0x537884){if(_0x537884){return _0xa0c71a['sendStatus'](_0x2e339e);}return _0xa0c71a[_0x86c9('0x2a')](_0x2e339e)[_0x86c9('0x2b')]();};}function respondWithResult(_0x18519c,_0x487215){_0x487215=_0x487215||0xc8;return function(_0x3ed2ba){if(_0x3ed2ba){return _0x18519c[_0x86c9('0x2a')](_0x487215)[_0x86c9('0x2c')](_0x3ed2ba);}};}function respondWithFilteredResult(_0x5eead3,_0x553d8e){return function(_0x37ad40){if(_0x37ad40){var _0x41348b=typeof _0x553d8e[_0x86c9('0x2d')]===_0x86c9('0x2e')&&typeof _0x553d8e[_0x86c9('0x2f')]==='undefined';var _0x4aa290=_0x37ad40['count'];var _0x407b2c=_0x41348b?0x0:_0x553d8e[_0x86c9('0x2d')];var _0x27f017=_0x41348b?_0x37ad40['count']:_0x553d8e[_0x86c9('0x2d')]+_0x553d8e['limit'];var _0x3d09e8;if(_0x27f017>=_0x4aa290){_0x27f017=_0x4aa290;_0x3d09e8=0xc8;}else{_0x3d09e8=0xce;}_0x5eead3['status'](_0x3d09e8);return _0x5eead3[_0x86c9('0x30')](_0x86c9('0x31'),_0x407b2c+'-'+_0x27f017+'/'+_0x4aa290)[_0x86c9('0x2c')](_0x37ad40);}return null;};}function patchUpdates(_0x6c681d){return function(_0x27028b){try{jsonpatch[_0x86c9('0x32')](_0x27028b,_0x6c681d,!![]);}catch(_0x3a1bbd){return BPromise['reject'](_0x3a1bbd);}return _0x27028b['save']();};}function saveUpdates(_0x18d838,_0x5bbc39){return function(_0x170db9){if(_0x170db9){return _0x170db9['update'](_0x18d838)[_0x86c9('0x33')](function(_0x123fe3){return _0x123fe3;});}return null;};}function removeEntity(_0x3ec55f,_0x425f57){return function(_0x4509e9){if(_0x4509e9){return _0x4509e9[_0x86c9('0x34')]()[_0x86c9('0x33')](function(){_0x3ec55f[_0x86c9('0x2a')](0xcc)[_0x86c9('0x2b')]();});}};}function handleEntityNotFound(_0x16115b,_0x31b45f){return function(_0x357b82){if(!_0x357b82){_0x16115b[_0x86c9('0x35')](0x194);}return _0x357b82;};}function handleError(_0x8c778e,_0x39f28){_0x39f28=_0x39f28||0x1f4;return function(_0x322bb0){logger[_0x86c9('0x25')](_0x322bb0[_0x86c9('0x36')]);if(_0x322bb0[_0x86c9('0x37')]){delete _0x322bb0[_0x86c9('0x37')];}_0x8c778e[_0x86c9('0x2a')](_0x39f28)['send'](_0x322bb0);};}exports[_0x86c9('0x38')]=function(_0x322862,_0x30489a){var _0x264577={},_0x4cf751={},_0x1797b0={'count':0x0,'rows':[]};var _0x145aca=_[_0x86c9('0x39')](db['ChatMessage'][_0x86c9('0x3a')],function(_0x183b6e){return{'name':_0x183b6e[_0x86c9('0x3b')],'type':_0x183b6e[_0x86c9('0x3c')][_0x86c9('0x3d')]};});_0x4cf751['model']=_[_0x86c9('0x39')](_0x145aca,_0x86c9('0x37'));_0x4cf751[_0x86c9('0x3e')]=_[_0x86c9('0x3f')](_0x322862['query']);_0x4cf751['filters']=_[_0x86c9('0x40')](_0x4cf751[_0x86c9('0x41')],_0x4cf751[_0x86c9('0x3e')]);_0x264577[_0x86c9('0x42')]=_[_0x86c9('0x40')](_0x4cf751[_0x86c9('0x41')],qs[_0x86c9('0x43')](_0x322862['query'][_0x86c9('0x43')]));_0x264577['attributes']=_0x264577['attributes'][_0x86c9('0x44')]?_0x264577[_0x86c9('0x42')]:_0x4cf751['model'];if(!_0x322862[_0x86c9('0x3e')][_0x86c9('0x45')](_0x86c9('0x46'))){_0x264577[_0x86c9('0x2f')]=qs['limit'](_0x322862[_0x86c9('0x3e')][_0x86c9('0x2f')]);_0x264577[_0x86c9('0x2d')]=qs[_0x86c9('0x2d')](_0x322862[_0x86c9('0x3e')][_0x86c9('0x2d')]);}_0x264577[_0x86c9('0x47')]=qs[_0x86c9('0x48')](_0x322862[_0x86c9('0x3e')][_0x86c9('0x48')]);_0x264577[_0x86c9('0x49')]=qs[_0x86c9('0x4a')](_[_0x86c9('0x4b')](_0x322862[_0x86c9('0x3e')],_0x4cf751[_0x86c9('0x4a')]),_0x145aca);if(_0x322862['query']['filter']){_0x264577[_0x86c9('0x49')]=_[_0x86c9('0x4c')](_0x264577[_0x86c9('0x49')],{'$or':_[_0x86c9('0x39')](_0x145aca,function(_0x29c417){if(_0x29c417['type']!=='VIRTUAL'){var _0x47a5c6={};_0x47a5c6[_0x29c417[_0x86c9('0x37')]]={'$like':'%'+_0x322862[_0x86c9('0x3e')]['filter']+'%'};return _0x47a5c6;}})});}_0x264577=_[_0x86c9('0x4c')]({},_0x264577,_0x322862[_0x86c9('0x4d')]);var _0x27a14c={'where':_0x264577[_0x86c9('0x49')]};return db[_0x86c9('0x4e')][_0x86c9('0x4f')](_0x27a14c)[_0x86c9('0x33')](function(_0x1a7a23){_0x1797b0['count']=_0x1a7a23;if(_0x322862[_0x86c9('0x3e')]['includeAll']){_0x264577['include']=[{'all':!![]}];}return db[_0x86c9('0x4e')][_0x86c9('0x50')](_0x264577);})[_0x86c9('0x33')](function(_0x591802){_0x1797b0['rows']=_0x591802;return _0x1797b0;})[_0x86c9('0x33')](respondWithFilteredResult(_0x30489a,_0x264577))[_0x86c9('0x29')](handleError(_0x30489a,null));};exports[_0x86c9('0x51')]=function(_0x33dd94,_0x23fd6e){var _0x4b14a4={'raw':!![],'where':{'id':_0x33dd94[_0x86c9('0x52')]['id']}},_0x104141={};_0x104141['model']=_[_0x86c9('0x3f')](db[_0x86c9('0x4e')][_0x86c9('0x3a')]);_0x104141[_0x86c9('0x3e')]=_[_0x86c9('0x3f')](_0x33dd94['query']);_0x104141[_0x86c9('0x4a')]=_['intersection'](_0x104141['model'],_0x104141[_0x86c9('0x3e')]);_0x4b14a4[_0x86c9('0x42')]=_[_0x86c9('0x40')](_0x104141[_0x86c9('0x41')],qs[_0x86c9('0x43')](_0x33dd94['query']['fields']));_0x4b14a4[_0x86c9('0x42')]=_0x4b14a4['attributes'][_0x86c9('0x44')]?_0x4b14a4['attributes']:_0x104141[_0x86c9('0x41')];if(_0x33dd94[_0x86c9('0x3e')][_0x86c9('0x53')]){_0x4b14a4[_0x86c9('0x54')]=[{'all':!![]}];}_0x4b14a4=_[_0x86c9('0x4c')]({},_0x4b14a4,_0x33dd94[_0x86c9('0x4d')]);return db[_0x86c9('0x4e')][_0x86c9('0x55')](_0x4b14a4)[_0x86c9('0x33')](handleEntityNotFound(_0x23fd6e,null))['then'](respondWithResult(_0x23fd6e,null))[_0x86c9('0x29')](handleError(_0x23fd6e,null));};exports[_0x86c9('0x56')]=function(_0x50946b,_0x27d69f){return db[_0x86c9('0x4e')][_0x86c9('0x56')](_0x50946b[_0x86c9('0x57')],{})['then'](respondWithResult(_0x27d69f,0xc9))[_0x86c9('0x29')](handleError(_0x27d69f,null));};exports['update']=function(_0x44015f,_0x9f79b9){if(_0x44015f['body']['id']){delete _0x44015f['body']['id'];}return db[_0x86c9('0x4e')][_0x86c9('0x55')]({'where':{'id':_0x44015f[_0x86c9('0x52')]['id']}})[_0x86c9('0x33')](handleEntityNotFound(_0x9f79b9,null))[_0x86c9('0x33')](saveUpdates(_0x44015f['body'],null))[_0x86c9('0x33')](respondWithResult(_0x9f79b9,null))[_0x86c9('0x29')](handleError(_0x9f79b9,null));};exports['destroy']=function(_0x1e20bb,_0x38fabe){return db[_0x86c9('0x4e')][_0x86c9('0x55')]({'where':{'id':_0x1e20bb['params']['id']}})['then'](handleEntityNotFound(_0x38fabe,null))[_0x86c9('0x33')](removeEntity(_0x38fabe,null))[_0x86c9('0x29')](handleError(_0x38fabe,null));};exports['describe']=function(_0x4c0354,_0x7ac2ca){return db['ChatMessage'][_0x86c9('0x58')]()[_0x86c9('0x33')](respondWithResult(_0x7ac2ca,null))[_0x86c9('0x29')](handleError(_0x7ac2ca,null));};var interaction_log=require(_0x86c9('0x17'))('chat-interactions');exports[_0x86c9('0x59')]=function(_0x3ebb90,_0x1b3067,_0x5045a0){var _0x91685a={'agent':{},'channel':_0x86c9('0x5a')};if(_0x3ebb90[_0x86c9('0x57')]['id']){delete _0x3ebb90[_0x86c9('0x57')]['id'];}_0x3ebb90[_0x86c9('0x57')]['read']=!![];_0x3ebb90[_0x86c9('0x57')][_0x86c9('0x5b')]=moment()[_0x86c9('0x5c')](_0x86c9('0x5d'));_0x3ebb90[_0x86c9('0x57')][_0x86c9('0x5e')]=_0x3ebb90[_0x86c9('0x57')]['UserId']||_0x3ebb90['user']['id'];_0x91685a[_0x86c9('0x5f')]['id']=_0x3ebb90['body'][_0x86c9('0x5e')];return db[_0x86c9('0x4e')]['find']({'where':{'id':_0x3ebb90[_0x86c9('0x52')]['id'],'UserId':null}})[_0x86c9('0x33')](handleEntityNotFound(_0x1b3067,null))['then'](saveUpdates(_0x3ebb90[_0x86c9('0x57')],null))[_0x86c9('0x33')](function(_0x5e2c2e){if(_0x5e2c2e){_0x91685a[_0x86c9('0x27')]=_0x5e2c2e[_0x86c9('0x60')]({'plain':!![]});return db['ChatInteraction']['find']({'where':{'id':_0x5e2c2e['ChatInteractionId']}});}return null;})[_0x86c9('0x33')](handleEntityNotFound(_0x1b3067,null))[_0x86c9('0x33')](function(_0x25fe42){if(_0x25fe42){return _0x25fe42[_0x86c9('0x61')]({'UserId':_0x3ebb90[_0x86c9('0x57')][_0x86c9('0x5e')],'read1stAt':_['isNil'](_0x25fe42['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x86c9('0x33')](function(_0x32ab1b){if(_0x32ab1b){_0x91685a[_0x86c9('0x62')]=_0x32ab1b['get']({'plain':!![]});interaction_log['info'](_0x86c9('0x63'),_0x3ebb90[_0x86c9('0x64')]['id'],_0x3ebb90[_0x86c9('0x64')][_0x86c9('0x37')],_0x3ebb90[_0x86c9('0x64')]['role'],_0x91685a[_0x86c9('0x62')]['id'],_0x3ebb90[_0x86c9('0x57')]?JSON[_0x86c9('0x24')](_0x3ebb90['body']):'null');return respondWithRpcPromise('AcceptMessage',_0x86c9('0x65'),_0x91685a);}return null;})[_0x86c9('0x33')](function(_0x464437){var _0x1d8bd2=_0x86c9('0x66')+_0x464437[_0x86c9('0x27')][_0x86c9('0x67')];return db[_0x86c9('0x68')][_0x86c9('0x3e')](_0x1d8bd2,{'type':db[_0x86c9('0x69')][_0x86c9('0x6a')][_0x86c9('0x6b')],'raw':!![]})['then'](function(_0x20baaa){return _0x20baaa;});})[_0x86c9('0x33')](function(_0x3cb6bc){if(_0x3cb6bc){_0x91685a[_0x86c9('0x27')][_0x86c9('0x6c')]=_0x3cb6bc[0x0];if(!_0x3ebb90['body']['UserId'])return;return db[_0x86c9('0x6d')][_0x86c9('0x55')]({'where':{'id':_0x3ebb90[_0x86c9('0x57')]['UserId'],'role':_0x86c9('0x5f')},'attributes':['id',_0x86c9('0x37'),_0x86c9('0x6e'),_0x86c9('0x6f'),_0x86c9('0x70')],'raw':!![]});}return null;})[_0x86c9('0x33')](function(_0x11be9b){if(!_0x11be9b)return null;_0x91685a[_0x86c9('0x27')][_0x86c9('0x5f')]=_0x11be9b;return _0x91685a;})[_0x86c9('0x33')](function(_0x1c3d2b){if(_0x1c3d2b){if(_0x3ebb90[_0x86c9('0x57')][_0x86c9('0x71')]){_0x91685a[_0x86c9('0x27')][_0x86c9('0x72')]=util[_0x86c9('0x5c')]('SIP/%s',_0x3ebb90[_0x86c9('0x64')][_0x86c9('0x37')]);_0x91685a['message']['channel']=_0x91685a['channel'];_0x91685a[_0x86c9('0x27')][_0x86c9('0x73')]=_0x91685a[_0x86c9('0x74')];_0x91685a[_0x86c9('0x27')][_0x86c9('0x75')]=_0x86c9('0x59');return respondWithRpcPromise(_0x86c9('0x76'),_0x86c9('0x76'),{'event':_0x86c9('0x77'),'message':_['merge'](_0x91685a[_0x86c9('0x27')],JSON['parse'](_0x91685a[_0x86c9('0x62')][_0x86c9('0x78')]))},client9002)[_0x86c9('0x33')](function(){return _0x91685a;});}return _0x91685a;}return null;})[_0x86c9('0x33')](respondWithResult(_0x1b3067,null))[_0x86c9('0x29')](handleError(_0x1b3067,null));};var interaction_log=require(_0x86c9('0x17'))(_0x86c9('0x79'));exports[_0x86c9('0x7a')]=function(_0x457f04,_0x217eb3,_0x55cec7){var _0x2ae5de={'agent':{},'channel':_0x86c9('0x5a')};if(_0x457f04[_0x86c9('0x57')]['id']){delete _0x457f04['body']['id'];}_0x457f04[_0x86c9('0x57')]['UserId']=_0x457f04[_0x86c9('0x57')]['UserId']||_0x457f04['user']['id'];_0x2ae5de['agent']['id']=_0x457f04[_0x86c9('0x57')][_0x86c9('0x5e')];return db['ChatMessage']['find']({'where':{'id':_0x457f04['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x217eb3,null))[_0x86c9('0x33')](function(_0x3bbdc7){if(_0x3bbdc7){_0x2ae5de[_0x86c9('0x27')]=_0x3bbdc7[_0x86c9('0x60')]({'plain':!![]});return db[_0x86c9('0x7b')][_0x86c9('0x55')]({'where':{'id':_0x3bbdc7[_0x86c9('0x7c')]}});}return null;})[_0x86c9('0x33')](handleEntityNotFound(_0x217eb3,null))['then'](function(_0x26de3e){if(_0x26de3e){_0x2ae5de[_0x86c9('0x62')]=_0x26de3e[_0x86c9('0x60')]({'plain':!![]});interaction_log[_0x86c9('0x7d')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x457f04[_0x86c9('0x64')]['id'],_0x457f04[_0x86c9('0x64')]['name'],_0x457f04[_0x86c9('0x64')][_0x86c9('0x7e')],_0x2ae5de[_0x86c9('0x62')]['id'],_0x457f04[_0x86c9('0x57')]?JSON['stringify'](_0x457f04[_0x86c9('0x57')]):_0x86c9('0x7f'));return respondWithRpcPromise('RejectMessage',_0x86c9('0x80'),_0x2ae5de);}return null;})[_0x86c9('0x33')](function(_0x27b3aa){var _0x4bc3c4=_0x86c9('0x66')+_0x27b3aa[_0x86c9('0x27')][_0x86c9('0x67')];return db[_0x86c9('0x68')][_0x86c9('0x3e')](_0x4bc3c4,{'type':db['Sequelize']['QueryTypes'][_0x86c9('0x6b')],'raw':!![]})[_0x86c9('0x33')](function(_0x4bc4cc){return _0x4bc4cc;});})[_0x86c9('0x33')](function(_0xfb8b23){if(_0xfb8b23){_0x2ae5de[_0x86c9('0x27')][_0x86c9('0x6c')]=_0xfb8b23[0x0];if(!_0x457f04[_0x86c9('0x57')][_0x86c9('0x5e')])return;return db[_0x86c9('0x6d')][_0x86c9('0x55')]({'where':{'id':_0x457f04[_0x86c9('0x57')][_0x86c9('0x5e')],'role':'agent'},'attributes':['id',_0x86c9('0x37'),_0x86c9('0x6e'),'email',_0x86c9('0x70')],'raw':!![]});}return null;})[_0x86c9('0x33')](function(_0x4f084b){if(!_0x4f084b)return null;_0x2ae5de[_0x86c9('0x27')][_0x86c9('0x5f')]=_0x4f084b;return _0x2ae5de;})['then'](function(_0x4e91fe){if(_0x4e91fe){_0x4e91fe[_0x86c9('0x27')][_0x86c9('0x72')]=util['format']('SIP/%s',_0x457f04[_0x86c9('0x64')][_0x86c9('0x37')]);_0x4e91fe['message']['channel']=_0x2ae5de[_0x86c9('0x74')];_0x4e91fe['message'][_0x86c9('0x73')]=_0x2ae5de[_0x86c9('0x74')];_0x4e91fe[_0x86c9('0x27')][_0x86c9('0x75')]=_0x86c9('0x7a');respondWithRpcPromise(_0x86c9('0x76'),_0x86c9('0x76'),{'event':_0x86c9('0x81'),'message':_[_0x86c9('0x4c')](_0x2ae5de[_0x86c9('0x27')],JSON['parse'](_0x2ae5de[_0x86c9('0x62')]['formData']))},client9002);return _0x2ae5de;}return null;})[_0x86c9('0x33')](respondWithResult(_0x217eb3,null))['catch'](handleError(_0x217eb3,null));}; \ No newline at end of file +var _0x9cc4=['interface','channel','motionChannel','event','parse','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','User','email','SIP/%s','EventManager','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','../../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','register','jayson/promise','client','http','request','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','end','status','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','body','find','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','ChatInteraction','isNil','read1stAt','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','fullname','internal','manual'];(function(_0x3eedaf,_0x60001){var _0x123065=function(_0x2f0bc8){while(--_0x2f0bc8){_0x3eedaf['push'](_0x3eedaf['shift']());}};_0x123065(++_0x60001);}(_0x9cc4,0x1b4));var _0x49cc=function(_0x188a8c,_0x4b4ed0){_0x188a8c=_0x188a8c-0x0;var _0x5242af=_0x9cc4[_0x188a8c];return _0x5242af;};'use strict';var emlformat=require(_0x49cc('0x0'));var rimraf=require(_0x49cc('0x1'));var zipdir=require(_0x49cc('0x2'));var jsonpatch=require(_0x49cc('0x3'));var rp=require(_0x49cc('0x4'));var moment=require(_0x49cc('0x5'));var BPromise=require(_0x49cc('0x6'));var Mustache=require(_0x49cc('0x7'));var util=require(_0x49cc('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x49cc('0x9'));var ejs=require(_0x49cc('0xa'));var fs=require('fs');var fs_extra=require(_0x49cc('0xb'));var _=require('lodash');var squel=require(_0x49cc('0xc'));var crypto=require(_0x49cc('0xd'));var jsforce=require(_0x49cc('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x49cc('0x9'));var querystring=require(_0x49cc('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x49cc('0x10'));var qs=require(_0x49cc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x49cc('0x12'));var logger=require(_0x49cc('0x13'))(_0x49cc('0x14'));var utils=require(_0x49cc('0x15'));var config=require(_0x49cc('0x16'));var licenseUtil=require(_0x49cc('0x17'));var db=require(_0x49cc('0x18'))['db'];config[_0x49cc('0x19')]=_[_0x49cc('0x1a')](config[_0x49cc('0x19')],{'host':_0x49cc('0x1b'),'port':0x18eb});var socket=require(_0x49cc('0x1c'))(new Redis(config[_0x49cc('0x19')]));require('./chatMessage.socket')[_0x49cc('0x1d')](socket);var jayson=require(_0x49cc('0x1e'));var client=jayson[_0x49cc('0x1f')][_0x49cc('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x49cc('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x577866,_0x43410a,_0x211205,_0xcca17a){return new BPromise(function(_0x121dbe,_0x47528e){var _0xf98867=_0xcca17a||client;return _0xf98867[_0x49cc('0x21')](_0x577866,_0x211205)['then'](function(_0x4b6a0f){logger[_0x49cc('0x22')](_0x49cc('0x23'),_0x43410a,_0x49cc('0x24'));logger[_0x49cc('0x25')](_0x49cc('0x26'),_0x43410a,_0x49cc('0x24'),JSON['stringify'](_0x4b6a0f));if(_0x4b6a0f[_0x49cc('0x27')]){if(_0x4b6a0f[_0x49cc('0x27')][_0x49cc('0x28')]===0x1f4){logger[_0x49cc('0x27')](_0x49cc('0x23'),_0x43410a,_0x4b6a0f[_0x49cc('0x27')][_0x49cc('0x29')]);return _0x47528e(_0x4b6a0f['error'][_0x49cc('0x29')]);}logger['error']('ChatMessage,\x20%s,\x20%s',_0x43410a,_0x4b6a0f[_0x49cc('0x27')]['message']);return _0x121dbe(_0x4b6a0f['error'][_0x49cc('0x29')]);}else{logger[_0x49cc('0x22')](_0x49cc('0x23'),_0x43410a,'request\x20sent');_0x121dbe(_0x4b6a0f[_0x49cc('0x2a')][_0x49cc('0x29')]);}})[_0x49cc('0x2b')](function(_0x5a40c7){logger['error']('ChatMessage,\x20%s,\x20%s',_0x43410a,_0x5a40c7);_0x47528e(_0x5a40c7);});});}function respondWithStatusCode(_0x10c85f,_0x15965e){_0x15965e=_0x15965e||0xcc;return function(_0x2f76c0){if(_0x2f76c0){return _0x10c85f['sendStatus'](_0x15965e);}return _0x10c85f['status'](_0x15965e)[_0x49cc('0x2c')]();};}function respondWithResult(_0x36e76c,_0x2024a9){_0x2024a9=_0x2024a9||0xc8;return function(_0x4a44a0){if(_0x4a44a0){return _0x36e76c[_0x49cc('0x2d')](_0x2024a9)[_0x49cc('0x2e')](_0x4a44a0);}};}function respondWithFilteredResult(_0x50054b,_0x4162ec){return function(_0x41a0c0){if(_0x41a0c0){var _0x271216=typeof _0x4162ec[_0x49cc('0x2f')]===_0x49cc('0x30')&&typeof _0x4162ec['limit']===_0x49cc('0x30');var _0x7c067a=_0x41a0c0[_0x49cc('0x31')];var _0x1223e8=_0x271216?0x0:_0x4162ec[_0x49cc('0x2f')];var _0x5d3ee9=_0x271216?_0x41a0c0[_0x49cc('0x31')]:_0x4162ec[_0x49cc('0x2f')]+_0x4162ec[_0x49cc('0x32')];var _0x484da1;if(_0x5d3ee9>=_0x7c067a){_0x5d3ee9=_0x7c067a;_0x484da1=0xc8;}else{_0x484da1=0xce;}_0x50054b['status'](_0x484da1);return _0x50054b['set']('Content-Range',_0x1223e8+'-'+_0x5d3ee9+'/'+_0x7c067a)[_0x49cc('0x2e')](_0x41a0c0);}return null;};}function patchUpdates(_0x7edfc){return function(_0x41c2de){try{jsonpatch[_0x49cc('0x33')](_0x41c2de,_0x7edfc,!![]);}catch(_0x34adec){return BPromise[_0x49cc('0x34')](_0x34adec);}return _0x41c2de[_0x49cc('0x35')]();};}function saveUpdates(_0x5219a4,_0x55465b){return function(_0x598f72){if(_0x598f72){return _0x598f72[_0x49cc('0x36')](_0x5219a4)[_0x49cc('0x37')](function(_0xd3ac61){return _0xd3ac61;});}return null;};}function removeEntity(_0x7e0e7,_0x583b8e){return function(_0x578acb){if(_0x578acb){return _0x578acb[_0x49cc('0x38')]()[_0x49cc('0x37')](function(){_0x7e0e7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x48a0f3,_0x57b04b){return function(_0x398ce4){if(!_0x398ce4){_0x48a0f3[_0x49cc('0x39')](0x194);}return _0x398ce4;};}function handleError(_0x14c111,_0x563697){_0x563697=_0x563697||0x1f4;return function(_0x45135d){logger['error'](_0x45135d[_0x49cc('0x3a')]);if(_0x45135d[_0x49cc('0x3b')]){delete _0x45135d['name'];}_0x14c111['status'](_0x563697)[_0x49cc('0x3c')](_0x45135d);};}exports[_0x49cc('0x3d')]=function(_0x3955b0,_0x1f1ddd){var _0x16027f={},_0x5616e5={},_0x4793ab={'count':0x0,'rows':[]};var _0x472905=_[_0x49cc('0x3e')](db[_0x49cc('0x3f')][_0x49cc('0x40')],function(_0x4e4176){return{'name':_0x4e4176[_0x49cc('0x41')],'type':_0x4e4176[_0x49cc('0x42')]['key']};});_0x5616e5[_0x49cc('0x43')]=_['map'](_0x472905,_0x49cc('0x3b'));_0x5616e5[_0x49cc('0x44')]=_[_0x49cc('0x45')](_0x3955b0[_0x49cc('0x44')]);_0x5616e5[_0x49cc('0x46')]=_[_0x49cc('0x47')](_0x5616e5['model'],_0x5616e5[_0x49cc('0x44')]);_0x16027f[_0x49cc('0x48')]=_['intersection'](_0x5616e5[_0x49cc('0x43')],qs[_0x49cc('0x49')](_0x3955b0[_0x49cc('0x44')][_0x49cc('0x49')]));_0x16027f['attributes']=_0x16027f[_0x49cc('0x48')][_0x49cc('0x4a')]?_0x16027f[_0x49cc('0x48')]:_0x5616e5['model'];if(!_0x3955b0[_0x49cc('0x44')][_0x49cc('0x4b')](_0x49cc('0x4c'))){_0x16027f[_0x49cc('0x32')]=qs[_0x49cc('0x32')](_0x3955b0[_0x49cc('0x44')][_0x49cc('0x32')]);_0x16027f[_0x49cc('0x2f')]=qs[_0x49cc('0x2f')](_0x3955b0[_0x49cc('0x44')][_0x49cc('0x2f')]);}_0x16027f[_0x49cc('0x4d')]=qs['sort'](_0x3955b0[_0x49cc('0x44')][_0x49cc('0x4e')]);_0x16027f[_0x49cc('0x4f')]=qs[_0x49cc('0x46')](_[_0x49cc('0x50')](_0x3955b0['query'],_0x5616e5[_0x49cc('0x46')]),_0x472905);if(_0x3955b0['query'][_0x49cc('0x51')]){_0x16027f[_0x49cc('0x4f')]=_[_0x49cc('0x52')](_0x16027f[_0x49cc('0x4f')],{'$or':_[_0x49cc('0x3e')](_0x472905,function(_0x53f7ba){if(_0x53f7ba[_0x49cc('0x42')]!==_0x49cc('0x53')){var _0x5b5fdf={};_0x5b5fdf[_0x53f7ba['name']]={'$like':'%'+_0x3955b0['query'][_0x49cc('0x51')]+'%'};return _0x5b5fdf;}})});}_0x16027f=_[_0x49cc('0x52')]({},_0x16027f,_0x3955b0[_0x49cc('0x54')]);var _0x5b9670={'where':_0x16027f[_0x49cc('0x4f')]};return db[_0x49cc('0x3f')]['count'](_0x5b9670)[_0x49cc('0x37')](function(_0x241c5f){_0x4793ab[_0x49cc('0x31')]=_0x241c5f;if(_0x3955b0[_0x49cc('0x44')][_0x49cc('0x55')]){_0x16027f[_0x49cc('0x56')]=[{'all':!![]}];}return db[_0x49cc('0x3f')][_0x49cc('0x57')](_0x16027f);})[_0x49cc('0x37')](function(_0x239935){_0x4793ab[_0x49cc('0x58')]=_0x239935;return _0x4793ab;})[_0x49cc('0x37')](respondWithFilteredResult(_0x1f1ddd,_0x16027f))['catch'](handleError(_0x1f1ddd,null));};exports[_0x49cc('0x59')]=function(_0x26b1f1,_0x44faab){var _0x286b24={'raw':!![],'where':{'id':_0x26b1f1[_0x49cc('0x5a')]['id']}},_0x54ed68={};_0x54ed68[_0x49cc('0x43')]=_[_0x49cc('0x45')](db[_0x49cc('0x3f')][_0x49cc('0x40')]);_0x54ed68['query']=_[_0x49cc('0x45')](_0x26b1f1[_0x49cc('0x44')]);_0x54ed68['filters']=_[_0x49cc('0x47')](_0x54ed68['model'],_0x54ed68[_0x49cc('0x44')]);_0x286b24[_0x49cc('0x48')]=_[_0x49cc('0x47')](_0x54ed68[_0x49cc('0x43')],qs[_0x49cc('0x49')](_0x26b1f1[_0x49cc('0x44')][_0x49cc('0x49')]));_0x286b24['attributes']=_0x286b24[_0x49cc('0x48')][_0x49cc('0x4a')]?_0x286b24['attributes']:_0x54ed68['model'];if(_0x26b1f1[_0x49cc('0x44')]['includeAll']){_0x286b24[_0x49cc('0x56')]=[{'all':!![]}];}_0x286b24=_['merge']({},_0x286b24,_0x26b1f1[_0x49cc('0x54')]);return db[_0x49cc('0x3f')]['find'](_0x286b24)[_0x49cc('0x37')](handleEntityNotFound(_0x44faab,null))['then'](respondWithResult(_0x44faab,null))[_0x49cc('0x2b')](handleError(_0x44faab,null));};exports[_0x49cc('0x5b')]=function(_0x1067fd,_0x464c08){return db[_0x49cc('0x3f')][_0x49cc('0x5b')](_0x1067fd[_0x49cc('0x5c')],{})[_0x49cc('0x37')](respondWithResult(_0x464c08,0xc9))['catch'](handleError(_0x464c08,null));};exports[_0x49cc('0x36')]=function(_0x15e74f,_0x378791){if(_0x15e74f[_0x49cc('0x5c')]['id']){delete _0x15e74f[_0x49cc('0x5c')]['id'];}return db[_0x49cc('0x3f')][_0x49cc('0x5d')]({'where':{'id':_0x15e74f[_0x49cc('0x5a')]['id']}})['then'](handleEntityNotFound(_0x378791,null))[_0x49cc('0x37')](saveUpdates(_0x15e74f[_0x49cc('0x5c')],null))[_0x49cc('0x37')](respondWithResult(_0x378791,null))['catch'](handleError(_0x378791,null));};exports[_0x49cc('0x38')]=function(_0x1fd2e5,_0x3d9a12){return db[_0x49cc('0x3f')][_0x49cc('0x5d')]({'where':{'id':_0x1fd2e5[_0x49cc('0x5a')]['id']}})[_0x49cc('0x37')](handleEntityNotFound(_0x3d9a12,null))[_0x49cc('0x37')](removeEntity(_0x3d9a12,null))['catch'](handleError(_0x3d9a12,null));};exports[_0x49cc('0x5e')]=function(_0x2d5111,_0x1d9e76){return db[_0x49cc('0x3f')][_0x49cc('0x5e')]()['then'](respondWithResult(_0x1d9e76,null))['catch'](handleError(_0x1d9e76,null));};var interaction_log=require(_0x49cc('0x13'))(_0x49cc('0x5f'));exports[_0x49cc('0x60')]=function(_0x27144a,_0x36dc2a,_0x3fde5c){var _0x514c2b={'agent':{},'channel':_0x49cc('0x61')};if(_0x27144a['body']['id']){delete _0x27144a['body']['id'];}_0x27144a[_0x49cc('0x5c')][_0x49cc('0x62')]=!![];_0x27144a[_0x49cc('0x5c')][_0x49cc('0x63')]=moment()[_0x49cc('0x64')](_0x49cc('0x65'));_0x27144a['body'][_0x49cc('0x66')]=_0x27144a[_0x49cc('0x5c')][_0x49cc('0x66')]||_0x27144a['user']['id'];_0x514c2b[_0x49cc('0x67')]['id']=_0x27144a[_0x49cc('0x5c')]['UserId'];return db['ChatMessage'][_0x49cc('0x5d')]({'where':{'id':_0x27144a['params']['id'],'UserId':null}})[_0x49cc('0x37')](handleEntityNotFound(_0x36dc2a,null))[_0x49cc('0x37')](saveUpdates(_0x27144a['body'],null))[_0x49cc('0x37')](function(_0x4e0a06){if(_0x4e0a06){_0x514c2b[_0x49cc('0x29')]=_0x4e0a06['get']({'plain':!![]});return db[_0x49cc('0x68')][_0x49cc('0x5d')]({'where':{'id':_0x4e0a06['ChatInteractionId']}});}return null;})[_0x49cc('0x37')](handleEntityNotFound(_0x36dc2a,null))[_0x49cc('0x37')](function(_0x2c6329){if(_0x2c6329){return _0x2c6329[_0x49cc('0x36')]({'UserId':_0x27144a[_0x49cc('0x5c')]['UserId'],'read1stAt':_[_0x49cc('0x69')](_0x2c6329[_0x49cc('0x6a')])?moment()[_0x49cc('0x64')](_0x49cc('0x65')):undefined});}return null;})[_0x49cc('0x37')](function(_0x4d6f12){if(_0x4d6f12){_0x514c2b[_0x49cc('0x6b')]=_0x4d6f12[_0x49cc('0x6c')]({'plain':!![]});interaction_log[_0x49cc('0x22')](_0x49cc('0x6d'),_0x27144a[_0x49cc('0x6e')]['id'],_0x27144a[_0x49cc('0x6e')][_0x49cc('0x3b')],_0x27144a['user'][_0x49cc('0x6f')],_0x514c2b['interaction']['id'],_0x27144a[_0x49cc('0x5c')]?JSON[_0x49cc('0x70')](_0x27144a[_0x49cc('0x5c')]):_0x49cc('0x71'));return respondWithRpcPromise(_0x49cc('0x72'),_0x49cc('0x73'),_0x514c2b);}return null;})[_0x49cc('0x37')](function(_0x2c71d1){var _0x4ab23a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2c71d1[_0x49cc('0x29')][_0x49cc('0x74')];return db['sequelize'][_0x49cc('0x44')](_0x4ab23a,{'type':db[_0x49cc('0x75')][_0x49cc('0x76')][_0x49cc('0x77')],'raw':!![]})[_0x49cc('0x37')](function(_0x2c86ef){return _0x2c86ef;});})['then'](function(_0xf851ab){if(_0xf851ab){_0x514c2b['message'][_0x49cc('0x78')]=_0xf851ab[0x0];if(!_0x27144a[_0x49cc('0x5c')][_0x49cc('0x66')])return;return db['User'][_0x49cc('0x5d')]({'where':{'id':_0x27144a[_0x49cc('0x5c')][_0x49cc('0x66')],'role':_0x49cc('0x67')},'attributes':['id',_0x49cc('0x3b'),_0x49cc('0x79'),'email',_0x49cc('0x7a')],'raw':!![]});}return null;})[_0x49cc('0x37')](function(_0x1d407b){if(!_0x1d407b)return null;_0x514c2b[_0x49cc('0x29')][_0x49cc('0x67')]=_0x1d407b;return _0x514c2b;})[_0x49cc('0x37')](function(_0x313a6e){if(_0x313a6e){if(_0x27144a[_0x49cc('0x5c')][_0x49cc('0x7b')]){_0x514c2b[_0x49cc('0x29')][_0x49cc('0x7c')]=util[_0x49cc('0x64')]('SIP/%s',_0x27144a[_0x49cc('0x6e')]['name']);_0x514c2b['message']['channel']=_0x514c2b[_0x49cc('0x7d')];_0x514c2b[_0x49cc('0x29')][_0x49cc('0x7e')]=_0x514c2b[_0x49cc('0x7d')];_0x514c2b[_0x49cc('0x29')][_0x49cc('0x7f')]=_0x49cc('0x60');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_[_0x49cc('0x52')](_0x514c2b['message'],JSON[_0x49cc('0x80')](_0x514c2b[_0x49cc('0x6b')][_0x49cc('0x81')]))},client9002)[_0x49cc('0x37')](function(){return _0x514c2b;});}return _0x514c2b;}return null;})[_0x49cc('0x37')](respondWithResult(_0x36dc2a,null))[_0x49cc('0x2b')](handleError(_0x36dc2a,null));};var interaction_log=require('../../config/logger')(_0x49cc('0x5f'));exports[_0x49cc('0x34')]=function(_0x293fe2,_0x5b61d6,_0x4c8e5e){var _0x43eb79={'agent':{},'channel':_0x49cc('0x61')};if(_0x293fe2[_0x49cc('0x5c')]['id']){delete _0x293fe2[_0x49cc('0x5c')]['id'];}_0x293fe2[_0x49cc('0x5c')][_0x49cc('0x66')]=_0x293fe2['body']['UserId']||_0x293fe2['user']['id'];_0x43eb79[_0x49cc('0x67')]['id']=_0x293fe2['body'][_0x49cc('0x66')];return db[_0x49cc('0x3f')][_0x49cc('0x5d')]({'where':{'id':_0x293fe2['params']['id'],'UserId':null}})[_0x49cc('0x37')](handleEntityNotFound(_0x5b61d6,null))[_0x49cc('0x37')](function(_0x5377d9){if(_0x5377d9){_0x43eb79['message']=_0x5377d9[_0x49cc('0x6c')]({'plain':!![]});return db[_0x49cc('0x68')]['find']({'where':{'id':_0x5377d9[_0x49cc('0x82')]}});}return null;})[_0x49cc('0x37')](handleEntityNotFound(_0x5b61d6,null))[_0x49cc('0x37')](function(_0x5dda2b){if(_0x5dda2b){_0x43eb79[_0x49cc('0x6b')]=_0x5dda2b[_0x49cc('0x6c')]({'plain':!![]});interaction_log[_0x49cc('0x22')](_0x49cc('0x83'),_0x293fe2[_0x49cc('0x6e')]['id'],_0x293fe2[_0x49cc('0x6e')][_0x49cc('0x3b')],_0x293fe2[_0x49cc('0x6e')]['role'],_0x43eb79[_0x49cc('0x6b')]['id'],_0x293fe2[_0x49cc('0x5c')]?JSON[_0x49cc('0x70')](_0x293fe2[_0x49cc('0x5c')]):_0x49cc('0x71'));return respondWithRpcPromise(_0x49cc('0x84'),_0x49cc('0x85'),_0x43eb79);}return null;})[_0x49cc('0x37')](function(_0x28961b){var _0x1daf19='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x28961b[_0x49cc('0x29')][_0x49cc('0x74')];return db[_0x49cc('0x86')][_0x49cc('0x44')](_0x1daf19,{'type':db[_0x49cc('0x75')][_0x49cc('0x76')][_0x49cc('0x77')],'raw':!![]})[_0x49cc('0x37')](function(_0x3099df){return _0x3099df;});})[_0x49cc('0x37')](function(_0x38b231){if(_0x38b231){_0x43eb79['message']['contact']=_0x38b231[0x0];if(!_0x293fe2[_0x49cc('0x5c')][_0x49cc('0x66')])return;return db[_0x49cc('0x87')][_0x49cc('0x5d')]({'where':{'id':_0x293fe2[_0x49cc('0x5c')][_0x49cc('0x66')],'role':'agent'},'attributes':['id','name','fullname',_0x49cc('0x88'),_0x49cc('0x7a')],'raw':!![]});}return null;})[_0x49cc('0x37')](function(_0x4bc2eb){if(!_0x4bc2eb)return null;_0x43eb79[_0x49cc('0x29')][_0x49cc('0x67')]=_0x4bc2eb;return _0x43eb79;})[_0x49cc('0x37')](function(_0x535b76){if(_0x535b76){_0x535b76['message'][_0x49cc('0x7c')]=util[_0x49cc('0x64')](_0x49cc('0x89'),_0x293fe2[_0x49cc('0x6e')]['name']);_0x535b76[_0x49cc('0x29')]['channel']=_0x43eb79['channel'];_0x535b76[_0x49cc('0x29')][_0x49cc('0x7e')]=_0x43eb79[_0x49cc('0x7d')];_0x535b76['message']['event']=_0x49cc('0x34');respondWithRpcPromise(_0x49cc('0x8a'),_0x49cc('0x8a'),{'event':_0x49cc('0x8b'),'message':_[_0x49cc('0x52')](_0x43eb79[_0x49cc('0x29')],JSON[_0x49cc('0x80')](_0x43eb79[_0x49cc('0x6b')][_0x49cc('0x81')]))},client9002);return _0x43eb79;}return null;})[_0x49cc('0x37')](respondWithResult(_0x5b61d6,null))['catch'](handleError(_0x5b61d6,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 4a250b3..5db0ab9 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 _0x896c=['exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x15a489,_0x5c0b85){var _0x281fa4=function(_0xb1ee7){while(--_0xb1ee7){_0x15a489['push'](_0x15a489['shift']());}};_0x281fa4(++_0x5c0b85);}(_0x896c,0xd2));var _0xc896=function(_0x4b03c9,_0x17ce03){_0x4b03c9=_0x4b03c9-0x0;var _0x161ba2=_0x896c[_0x4b03c9];return _0x161ba2;};'use strict';var EventEmitter=require(_0xc896('0x0'));var ChatMessage=require(_0xc896('0x1'))['db'][_0xc896('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xc896('0x3')](0x0);var events={'afterCreate':_0xc896('0x4'),'afterUpdate':_0xc896('0x5'),'afterDestroy':_0xc896('0x6')};function emitEvent(_0x86afbe){return function(_0x58b2b7,_0x261b68,_0x3b5421){ChatMessageEvents[_0xc896('0x7')](_0x86afbe+':'+_0x58b2b7['id'],_0x58b2b7);ChatMessageEvents[_0xc896('0x7')](_0x86afbe,_0x58b2b7);_0x3b5421(null);};}for(var e in events){if(events[_0xc896('0x8')](e)){var event=events[e];ChatMessage[_0xc896('0x9')](e,emitEvent(event));}}module[_0xc896('0xa')]=ChatMessageEvents; \ No newline at end of file +var _0x55b2=['update','remove','emit','hasOwnProperty','hook','exports','ChatMessage','setMaxListeners'];(function(_0x1c8314,_0x512e7e){var _0x4bfc4b=function(_0x2d8410){while(--_0x2d8410){_0x1c8314['push'](_0x1c8314['shift']());}};_0x4bfc4b(++_0x512e7e);}(_0x55b2,0x186));var _0x255b=function(_0x2ac766,_0x514088){_0x2ac766=_0x2ac766-0x0;var _0x3b31c8=_0x55b2[_0x2ac766];return _0x3b31c8;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0x255b('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x255b('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x255b('0x2'),'afterDestroy':_0x255b('0x3')};function emitEvent(_0x1fefaf){return function(_0x1a741d,_0x5bd4ec,_0x549cc1){ChatMessageEvents[_0x255b('0x4')](_0x1fefaf+':'+_0x1a741d['id'],_0x1a741d);ChatMessageEvents[_0x255b('0x4')](_0x1fefaf,_0x1a741d);_0x549cc1(null);};}for(var e in events){if(events[_0x255b('0x5')](e)){var event=events[e];ChatMessage[_0x255b('0x6')](e,emitEvent(event));}}module[_0x255b('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 132dab7..a89f8e3 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 _0x3dfa=['models','get','direction','toLowerCase','out','ChatInteraction','findOne','ChatInteractionId','then','update','catch','utf8mb4','lodash','util','moment','request-promise','path','rimraf','../../config/environment','define','ChatMessage','chat_messages','fti_chat_messages','FULLTEXT'];(function(_0x472cfe,_0x161baf){var _0x22b3a2=function(_0x281466){while(--_0x281466){_0x472cfe['push'](_0x472cfe['shift']());}};_0x22b3a2(++_0x161baf);}(_0x3dfa,0x114));var _0xa3df=function(_0x17052c,_0x1c762d){_0x17052c=_0x17052c-0x0;var _0x3f436c=_0x3dfa[_0x17052c];return _0x3f436c;};'use strict';var _=require(_0xa3df('0x0'));var util=require(_0xa3df('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa3df('0x2'));var BPromise=require('bluebird');var rp=require(_0xa3df('0x3'));var fs=require('fs');var path=require(_0xa3df('0x4'));var rimraf=require(_0xa3df('0x5'));var config=require(_0xa3df('0x6'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x2af8b9,_0x39ed32){return _0x2af8b9[_0xa3df('0x7')](_0xa3df('0x8'),attributes,{'tableName':_0xa3df('0x9'),'paranoid':![],'indexes':[{'name':_0xa3df('0xa'),'fields':['body'],'type':_0xa3df('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3b74ed,_0x2a02a2,_0xa25eab){var _0x4adbe0=_0x2af8b9[_0xa3df('0xc')];var _0x3ce422=_0x3b74ed[_0xa3df('0xd')]({'plain':!![]});if(_0x3ce422[_0xa3df('0xe')][_0xa3df('0xf')]()==='in'||_0x3ce422[_0xa3df('0xe')]['toLowerCase']()===_0xa3df('0x10')&&!_0x3ce422['secret']&&!_['isNil'](_0x3ce422['UserId'])){_0x4adbe0[_0xa3df('0x11')][_0xa3df('0x12')]({'where':{'id':_0x3ce422[_0xa3df('0x13')]}})[_0xa3df('0x14')](function(_0x5dcb75){if(_0x5dcb75){_0x5dcb75[_0xa3df('0x15')]({'lastMsgAt':_0x3ce422['createdAt'],'lastMsgDirection':_0x3ce422[_0xa3df('0xe')][_0xa3df('0xf')]()});}})[_0xa3df('0x16')](function(_0x5dcfa1){console['error'](_0x5dcfa1);});}_0xa25eab();}},'charset':_0xa3df('0x17'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x9e93=['then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne'];(function(_0x51ddfe,_0x63fe43){var _0x17c2da=function(_0x124196){while(--_0x124196){_0x51ddfe['push'](_0x51ddfe['shift']());}};_0x17c2da(++_0x63fe43);}(_0x9e93,0xca));var _0x39e9=function(_0x22cc16,_0x1f4fa2){_0x22cc16=_0x22cc16-0x0;var _0x399b70=_0x9e93[_0x22cc16];return _0x399b70;};'use strict';var _=require(_0x39e9('0x0'));var util=require('util');var logger=require(_0x39e9('0x1'))('api');var moment=require(_0x39e9('0x2'));var BPromise=require(_0x39e9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x39e9('0x4'));var config=require(_0x39e9('0x5'));var attributes=require(_0x39e9('0x6'));module[_0x39e9('0x7')]=function(_0x4edb6,_0x4b8aa4){return _0x4edb6['define'](_0x39e9('0x8'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x39e9('0x9'),'fields':[_0x39e9('0xa')],'type':_0x39e9('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x58848f,_0xc4e8b0,_0x5d824f){var _0x46ce34=_0x4edb6[_0x39e9('0xc')];var _0x2a2607=_0x58848f[_0x39e9('0xd')]({'plain':!![]});if(_0x2a2607[_0x39e9('0xe')][_0x39e9('0xf')]()==='in'||_0x2a2607['direction'][_0x39e9('0xf')]()===_0x39e9('0x10')&&!_0x2a2607[_0x39e9('0x11')]&&!_[_0x39e9('0x12')](_0x2a2607[_0x39e9('0x13')])){_0x46ce34[_0x39e9('0x14')][_0x39e9('0x15')]({'where':{'id':_0x2a2607['ChatInteractionId']}})[_0x39e9('0x16')](function(_0x3f87a4){if(_0x3f87a4){_0x3f87a4['update']({'lastMsgAt':_0x2a2607[_0x39e9('0x17')],'lastMsgDirection':_0x2a2607[_0x39e9('0xe')]['toLowerCase']()});}})[_0x39e9('0x18')](function(_0x46e593){console[_0x39e9('0x19')](_0x46e593);});}_0x5d824f();}},'charset':_0x39e9('0x1a'),'collate':_0x39e9('0x1b')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index f1b474e..589a861 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 _0x961c=['ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','moment','bluebird','randomstring'];(function(_0x1534c3,_0x523f7a){var _0x3af905=function(_0x208c42){while(--_0x208c42){_0x1534c3['push'](_0x1534c3['shift']());}};_0x3af905(++_0x523f7a);}(_0x961c,0x15c));var _0xc961=function(_0x20255e,_0x2a615d){_0x20255e=_0x20255e-0x0;var _0x293046=_0x961c[_0x20255e];return _0x293046;};'use strict';var _=require(_0xc961('0x0'));var util=require('util');var moment=require(_0xc961('0x1'));var BPromise=require(_0xc961('0x2'));var rs=require(_0xc961('0x3'));var fs=require('fs');var Redis=require(_0xc961('0x4'));var db=require(_0xc961('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc961('0x6'))('rpc');var config=require(_0xc961('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc961('0x8')][_0xc961('0x9')]({'port':0x232a});config[_0xc961('0xa')]=_[_0xc961('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc961('0xc'))(new Redis(config[_0xc961('0xa')]));require('./chatMessage.socket')[_0xc961('0xd')](socket);function respondWithRpcPromise(_0x2890c9,_0x5d3789,_0x397033){return new BPromise(function(_0x34b028,_0x3315e1){return client[_0xc961('0xe')](_0x2890c9,_0x397033)[_0xc961('0xf')](function(_0x5c492e){logger[_0xc961('0x10')](_0xc961('0x11'),_0x5d3789,_0xc961('0x12'));logger[_0xc961('0x13')](_0xc961('0x14'),_0x5d3789,_0xc961('0x12'),JSON[_0xc961('0x15')](_0x5c492e));if(_0x5c492e[_0xc961('0x16')]){if(_0x5c492e[_0xc961('0x16')][_0xc961('0x17')]===0x1f4){logger[_0xc961('0x16')](_0xc961('0x11'),_0x5d3789,_0x5c492e[_0xc961('0x16')]['message']);return _0x3315e1(_0x5c492e[_0xc961('0x16')][_0xc961('0x18')]);}logger[_0xc961('0x16')](_0xc961('0x11'),_0x5d3789,_0x5c492e['error']['message']);return _0x34b028(_0x5c492e['error'][_0xc961('0x18')]);}else{logger[_0xc961('0x10')](_0xc961('0x11'),_0x5d3789,'request\x20sent');_0x34b028(_0x5c492e['result'][_0xc961('0x18')]);}})[_0xc961('0x19')](function(_0x799867){logger[_0xc961('0x16')](_0xc961('0x11'),_0x5d3789,_0x799867);_0x3315e1(_0x799867);});});}exports[_0xc961('0x1a')]=function(_0x259eff){var _0x422059=this;return new Promise(function(_0x39c74f,_0x100708){return db[_0xc961('0x1b')][_0xc961('0x1c')](_0x259eff[_0xc961('0x1d')],{'raw':_0x259eff['options']?_0x259eff[_0xc961('0x1e')][_0xc961('0x1f')]===undefined?!![]:![]:!![]})[_0xc961('0xf')](function(_0x14180e){logger['info']('CreateChatMessage',_0x259eff);logger[_0xc961('0x13')](_0xc961('0x1a'),_0x259eff,JSON[_0xc961('0x15')](_0x14180e));_0x39c74f(_0x14180e);})[_0xc961('0x19')](function(_0x75767e){logger[_0xc961('0x16')](_0xc961('0x1a'),_0x75767e[_0xc961('0x18')],_0x259eff);_0x100708(_0x422059[_0xc961('0x16')](0x1f4,_0x75767e[_0xc961('0x18')]));});});}; \ No newline at end of file +var _0x1014=['http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','debug','error','ChatMessage,\x20%s,\x20%s','message','request\x20sent','catch','CreateChatMessage','create','options','raw','stringify','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x31dcf3,_0x4536e7){var _0xdeb0ac=function(_0x3fb898){while(--_0x3fb898){_0x31dcf3['push'](_0x31dcf3['shift']());}};_0xdeb0ac(++_0x4536e7);}(_0x1014,0x1c7));var _0x4101=function(_0x379fb9,_0x487244){_0x379fb9=_0x379fb9-0x0;var _0x542669=_0x1014[_0x379fb9];return _0x542669;};'use strict';var _=require('lodash');var util=require(_0x4101('0x0'));var moment=require('moment');var BPromise=require(_0x4101('0x1'));var rs=require(_0x4101('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4101('0x3'))['db'];var utils=require(_0x4101('0x4'));var logger=require('../../config/logger')(_0x4101('0x5'));var config=require(_0x4101('0x6'));var jayson=require(_0x4101('0x7'));var client=jayson[_0x4101('0x8')][_0x4101('0x9')]({'port':0x232a});config[_0x4101('0xa')]=_[_0x4101('0xb')](config[_0x4101('0xa')],{'host':_0x4101('0xc'),'port':0x18eb});var socket=require(_0x4101('0xd'))(new Redis(config[_0x4101('0xa')]));require('./chatMessage.socket')[_0x4101('0xe')](socket);function respondWithRpcPromise(_0x2f98ed,_0x57728d,_0x769161){return new BPromise(function(_0x154aae,_0x27e99b){return client[_0x4101('0xf')](_0x2f98ed,_0x769161)[_0x4101('0x10')](function(_0x1f1471){logger[_0x4101('0x11')]('ChatMessage,\x20%s,\x20%s',_0x57728d,'request\x20sent');logger[_0x4101('0x12')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x57728d,'request\x20sent',JSON['stringify'](_0x1f1471));if(_0x1f1471[_0x4101('0x13')]){if(_0x1f1471[_0x4101('0x13')]['code']===0x1f4){logger[_0x4101('0x13')](_0x4101('0x14'),_0x57728d,_0x1f1471[_0x4101('0x13')][_0x4101('0x15')]);return _0x27e99b(_0x1f1471[_0x4101('0x13')][_0x4101('0x15')]);}logger[_0x4101('0x13')](_0x4101('0x14'),_0x57728d,_0x1f1471[_0x4101('0x13')][_0x4101('0x15')]);return _0x154aae(_0x1f1471[_0x4101('0x13')]['message']);}else{logger[_0x4101('0x11')](_0x4101('0x14'),_0x57728d,_0x4101('0x16'));_0x154aae(_0x1f1471['result'][_0x4101('0x15')]);}})[_0x4101('0x17')](function(_0x44f73e){logger[_0x4101('0x13')]('ChatMessage,\x20%s,\x20%s',_0x57728d,_0x44f73e);_0x27e99b(_0x44f73e);});});}exports[_0x4101('0x18')]=function(_0x2cb011){var _0x7f7e79=this;return new Promise(function(_0x13b129,_0xd88bcb){return db['ChatMessage'][_0x4101('0x19')](_0x2cb011['body'],{'raw':_0x2cb011[_0x4101('0x1a')]?_0x2cb011[_0x4101('0x1a')][_0x4101('0x1b')]===undefined?!![]:![]:!![]})[_0x4101('0x10')](function(_0x238134){logger[_0x4101('0x11')](_0x4101('0x18'),_0x2cb011);logger[_0x4101('0x12')](_0x4101('0x18'),_0x2cb011,JSON[_0x4101('0x1c')](_0x238134));_0x13b129(_0x238134);})[_0x4101('0x17')](function(_0x436a51){logger[_0x4101('0x13')]('CreateChatMessage',_0x436a51['message'],_0x2cb011);_0xd88bcb(_0x7f7e79[_0x4101('0x13')](0x1f4,_0x436a51['message']));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 9e9bb64..200259d 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 _0x0d4d=['remove','update','emit','removeListener','chatMessage:','./chatMessage.events','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0d4d,0x132));var _0xd0d4=function(_0x3c937a,_0x551cb8){_0x3c937a=_0x3c937a-0x0;var _0x2a74a6=_0x0d4d[_0x3c937a];return _0x2a74a6;};'use strict';var ChatMessageEvents=require(_0xd0d4('0x0'));var events=[_0xd0d4('0x1'),_0xd0d4('0x2'),_0xd0d4('0x3')];function createListener(_0x1f74ab,_0x1515e0){return function(_0x4d5c19){_0x1515e0[_0xd0d4('0x4')](_0x1f74ab,_0x4d5c19);};}function removeListener(_0x58909f,_0x2e99ee){return function(){ChatMessageEvents[_0xd0d4('0x5')](_0x58909f,_0x2e99ee);};}exports['register']=function(_0x34d93b){for(var _0x3db5ab=0x0,_0x1c5d01=events['length'];_0x3db5ab<_0x1c5d01;_0x3db5ab++){var _0x5bfae8=events[_0x3db5ab];var _0x5403c0=createListener(_0xd0d4('0x6')+_0x5bfae8,_0x34d93b);ChatMessageEvents['on'](_0x5bfae8,_0x5403c0);}}; \ No newline at end of file +var _0x9335=['register','length','chatMessage:','./chatMessage.events','save','update','emit'];(function(_0x261b8a,_0x553ec4){var _0x3455e8=function(_0xdf10d4){while(--_0xdf10d4){_0x261b8a['push'](_0x261b8a['shift']());}};_0x3455e8(++_0x553ec4);}(_0x9335,0xab));var _0x5933=function(_0x249e84,_0x4348b6){_0x249e84=_0x249e84-0x0;var _0x41115b=_0x9335[_0x249e84];return _0x41115b;};'use strict';var ChatMessageEvents=require(_0x5933('0x0'));var events=[_0x5933('0x1'),'remove',_0x5933('0x2')];function createListener(_0x407b89,_0x3617bd){return function(_0x1a529c){_0x3617bd[_0x5933('0x3')](_0x407b89,_0x1a529c);};}function removeListener(_0xc3fbd1,_0x310370){return function(){ChatMessageEvents['removeListener'](_0xc3fbd1,_0x310370);};}exports[_0x5933('0x4')]=function(_0x4de024){for(var _0x553710=0x0,_0x21f4c1=events[_0x5933('0x5')];_0x553710<_0x21f4c1;_0x553710++){var _0x21ab46=events[_0x553710];var _0x59c5cb=createListener(_0x5933('0x6')+_0x21ab46,_0x4de024);ChatMessageEvents['on'](_0x21ab46,_0x59c5cb);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index a44fd07..4708f2a 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 _0x2b96=['/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','put'];(function(_0x4bfac3,_0x58324d){var _0x15f0f2=function(_0xf0c511){while(--_0xf0c511){_0x4bfac3['push'](_0x4bfac3['shift']());}};_0x15f0f2(++_0x58324d);}(_0x2b96,0x18d));var _0x62b9=function(_0x38b575,_0x1f33cf){_0x38b575=_0x38b575-0x0;var _0x53f0c8=_0x2b96[_0x38b575];return _0x53f0c8;};'use strict';var multer=require(_0x62b9('0x0'));var util=require(_0x62b9('0x1'));var path=require(_0x62b9('0x2'));var timeout=require(_0x62b9('0x3'));var express=require(_0x62b9('0x4'));var router=express[_0x62b9('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x62b9('0x6'));var interaction=require(_0x62b9('0x7'));var config=require(_0x62b9('0x8'));var controller=require(_0x62b9('0x9'));router[_0x62b9('0xa')]('/',auth[_0x62b9('0xb')](),controller[_0x62b9('0xc')]);router['get'](_0x62b9('0xd'),auth[_0x62b9('0xb')](),controller[_0x62b9('0xe')]);router[_0x62b9('0xa')](_0x62b9('0xf'),auth['isAuthenticated'](),controller[_0x62b9('0x10')]);router[_0x62b9('0x11')]('/',auth[_0x62b9('0xb')](),interaction[_0x62b9('0x12')](_0x62b9('0x13'),_0x62b9('0x14')),controller[_0x62b9('0x15')]);router[_0x62b9('0x16')](_0x62b9('0xf'),controller['update']);router[_0x62b9('0x16')](_0x62b9('0x17'),auth[_0x62b9('0xb')](),controller[_0x62b9('0x18')]);router[_0x62b9('0x16')](_0x62b9('0x19'),auth[_0x62b9('0xb')](),controller[_0x62b9('0x1a')]);router[_0x62b9('0x1b')](_0x62b9('0xf'),auth[_0x62b9('0xb')](),controller[_0x62b9('0x1c')]);module[_0x62b9('0x1d')]=router; \ No newline at end of file +var _0x2d9a=['reject','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','get','isAuthenticated','/describe','describe','/:id','chat','create','update','put','/:id/reject'];(function(_0x5e89d2,_0x167d2c){var _0x2e81f3=function(_0x451fe1){while(--_0x451fe1){_0x5e89d2['push'](_0x5e89d2['shift']());}};_0x2e81f3(++_0x167d2c);}(_0x2d9a,0x128));var _0xa2d9=function(_0xb29bef,_0x45aff1){_0xb29bef=_0xb29bef-0x0;var _0x878163=_0x2d9a[_0xb29bef];return _0x878163;};'use strict';var multer=require(_0xa2d9('0x0'));var util=require('util');var path=require(_0xa2d9('0x1'));var timeout=require(_0xa2d9('0x2'));var express=require(_0xa2d9('0x3'));var router=express[_0xa2d9('0x4')]();var fs_extra=require(_0xa2d9('0x5'));var auth=require(_0xa2d9('0x6'));var interaction=require(_0xa2d9('0x7'));var config=require('../../config/environment');var controller=require(_0xa2d9('0x8'));router[_0xa2d9('0x9')]('/',auth[_0xa2d9('0xa')](),controller['index']);router['get'](_0xa2d9('0xb'),auth[_0xa2d9('0xa')](),controller[_0xa2d9('0xc')]);router[_0xa2d9('0x9')](_0xa2d9('0xd'),auth[_0xa2d9('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),interaction['tracked'](_0xa2d9('0xe'),'chatmessage:create'),controller[_0xa2d9('0xf')]);router['put']('/:id',controller[_0xa2d9('0x10')]);router[_0xa2d9('0x11')]('/:id/accept',auth[_0xa2d9('0xa')](),controller['accept']);router[_0xa2d9('0x11')](_0xa2d9('0x12'),auth['isAuthenticated'](),controller[_0xa2d9('0x13')]);router['delete'](_0xa2d9('0xd'),auth[_0xa2d9('0xa')](),controller[_0xa2d9('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 2d6dfb1..96ab9c0 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 _0x5f66=['medium','TEXT','exports'];(function(_0x20fb43,_0x2fff0b){var _0x3d31b8=function(_0x359930){while(--_0x359930){_0x20fb43['push'](_0x20fb43['shift']());}};_0x3d31b8(++_0x2fff0b);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2d48fa,_0x103065){_0x2d48fa=_0x2d48fa-0x0;var _0x4645b7=_0x0b0e[_0x2d48fa];return _0x4645b7;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index f24036a..32f2076 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x58e8f9,_0x25faae){var _0x2b02a2=function(_0x200979){while(--_0x200979){_0x58e8f9['push'](_0x58e8f9['shift']());}};_0x2b02a2(++_0x25faae);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x7a54,0x106));var _0x47a5=function(_0xa5e637,_0x1ac25e){_0xa5e637=_0xa5e637-0x0;var _0x31b55b=_0x7a54[_0xa5e637];return _0x31b55b;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index ba134d5..04010e2 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1033=['update','remove','emit','hasOwnProperty','hook','exports','ChatOfflineMessage','setMaxListeners','save'];(function(_0x4f4669,_0x5af05d){var _0x48b29d=function(_0x3609e1){while(--_0x3609e1){_0x4f4669['push'](_0x4f4669['shift']());}};_0x48b29d(++_0x5af05d);}(_0x1033,0x11d));var _0x3103=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x1033[_0x1b2ff7];return _0x31656a;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require('../../mysqldb')['db'][_0x3103('0x0')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x3103('0x1')](0x0);var events={'afterCreate':_0x3103('0x2'),'afterUpdate':_0x3103('0x3'),'afterDestroy':_0x3103('0x4')};function emitEvent(_0x4b7881){return function(_0x592134,_0x431007,_0x5b10c1){ChatOfflineMessageEvents['emit'](_0x4b7881+':'+_0x592134['id'],_0x592134);ChatOfflineMessageEvents[_0x3103('0x5')](_0x4b7881,_0x592134);_0x5b10c1(null);};}for(var e in events){if(events[_0x3103('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x3103('0x7')](e,emitEvent(event));}}module[_0x3103('0x8')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0xcf81=['exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x225134,_0x2ef082){var _0x470b2b=function(_0xd56bf8){while(--_0xd56bf8){_0x225134['push'](_0x225134['shift']());}};_0x470b2b(++_0x2ef082);}(_0xcf81,0x199));var _0x1cf8=function(_0x191b8b,_0x1c3fdd){_0x191b8b=_0x191b8b-0x0;var _0x128968=_0xcf81[_0x191b8b];return _0x128968;};'use strict';var EventEmitter=require(_0x1cf8('0x0'));var ChatOfflineMessage=require(_0x1cf8('0x1'))['db'][_0x1cf8('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x1cf8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1cf8('0x4')};function emitEvent(_0x56e81d){return function(_0x6d1583,_0x288172,_0x578612){ChatOfflineMessageEvents[_0x1cf8('0x5')](_0x56e81d+':'+_0x6d1583['id'],_0x6d1583);ChatOfflineMessageEvents[_0x1cf8('0x5')](_0x56e81d,_0x6d1583);_0x578612(null);};}for(var e in events){if(events[_0x1cf8('0x6')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x1cf8('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index f3caa96..5061964 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 _0x6617=['ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','exports','define'];(function(_0x552fce,_0x3f24bc){var _0x3e27a2=function(_0xc91154){while(--_0xc91154){_0x552fce['push'](_0x552fce['shift']());}};_0x3e27a2(++_0x3f24bc);}(_0x6617,0x1d2));var _0x7661=function(_0x5e238b,_0x17ae49){_0x5e238b=_0x5e238b-0x0;var _0x389bea=_0x6617[_0x5e238b];return _0x389bea;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x7661('0x0')]=function(_0x11c9e9){return _0x11c9e9[_0x7661('0x1')](_0x7661('0x2'),attributes,{'tableName':_0x7661('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7661('0x4'),'collate':_0x7661('0x5')});}; \ No newline at end of file +var _0xcbd7=['utf8mb4','utf8mb4_unicode_ci','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0x3e6a58,_0x4bbd5f){var _0xcb5ea4=function(_0x47ec63){while(--_0x47ec63){_0x3e6a58['push'](_0x3e6a58['shift']());}};_0xcb5ea4(++_0x4bbd5f);}(_0xcbd7,0x18e));var _0x7cbd=function(_0x30e62a,_0x254c90){_0x30e62a=_0x30e62a-0x0;var _0x20347d=_0xcbd7[_0x30e62a];return _0x20347d;};'use strict';var attributes=require('./chatOfflineMessage.attributes');module[_0x7cbd('0x0')]=function(_0x289e11){return _0x289e11[_0x7cbd('0x1')](_0x7cbd('0x2'),attributes,{'tableName':_0x7cbd('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7cbd('0x4'),'collate':_0x7cbd('0x5')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 230876a..98f079a 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 _0x5f79=['http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x108c1c,_0x5db8b3){var _0x3face4=function(_0x12da50){while(--_0x12da50){_0x108c1c['push'](_0x108c1c['shift']());}};_0x3face4(++_0x5db8b3);}(_0x5f79,0x92));var _0x95f7=function(_0x204eb7,_0x4974c3){_0x204eb7=_0x204eb7-0x0;var _0x37e444=_0x5f79[_0x204eb7];return _0x37e444;};'use strict';var _=require('lodash');var util=require(_0x95f7('0x0'));var moment=require(_0x95f7('0x1'));var BPromise=require(_0x95f7('0x2'));var rs=require(_0x95f7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x95f7('0x4'));var logger=require(_0x95f7('0x5'))(_0x95f7('0x6'));var config=require('../../config/environment');var jayson=require(_0x95f7('0x7'));var client=jayson['client'][_0x95f7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe91a6d,_0x5819a6,_0x4bf8de){return new BPromise(function(_0x229ab2,_0x3693ea){return client[_0x95f7('0x9')](_0xe91a6d,_0x4bf8de)[_0x95f7('0xa')](function(_0xb08c28){logger[_0x95f7('0xb')](_0x95f7('0xc'),_0x5819a6,'request\x20sent');logger[_0x95f7('0xd')](_0x95f7('0xe'),_0x5819a6,_0x95f7('0xf'),JSON[_0x95f7('0x10')](_0xb08c28));if(_0xb08c28[_0x95f7('0x11')]){if(_0xb08c28[_0x95f7('0x11')][_0x95f7('0x12')]===0x1f4){logger[_0x95f7('0x11')](_0x95f7('0xc'),_0x5819a6,_0xb08c28[_0x95f7('0x11')]['message']);return _0x3693ea(_0xb08c28['error'][_0x95f7('0x13')]);}logger[_0x95f7('0x11')](_0x95f7('0xc'),_0x5819a6,_0xb08c28[_0x95f7('0x11')]['message']);return _0x229ab2(_0xb08c28['error']['message']);}else{logger[_0x95f7('0xb')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5819a6,_0x95f7('0xf'));_0x229ab2(_0xb08c28[_0x95f7('0x14')][_0x95f7('0x13')]);}})[_0x95f7('0x15')](function(_0x50998e){logger[_0x95f7('0x11')](_0x95f7('0xc'),_0x5819a6,_0x50998e);_0x3693ea(_0x50998e);});});} \ No newline at end of file +var _0x2a9a=['lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','catch'];(function(_0x630336,_0x586598){var _0x7c6754=function(_0x5c054f){while(--_0x5c054f){_0x630336['push'](_0x630336['shift']());}};_0x7c6754(++_0x586598);}(_0x2a9a,0x64));var _0xa2a9=function(_0x376c6d,_0x40ac36){_0x376c6d=_0x376c6d-0x0;var _0x2c1dc1=_0x2a9a[_0x376c6d];return _0x2c1dc1;};'use strict';var _=require(_0xa2a9('0x0'));var util=require('util');var moment=require(_0xa2a9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa2a9('0x2'));var db=require(_0xa2a9('0x3'))['db'];var utils=require(_0xa2a9('0x4'));var logger=require(_0xa2a9('0x5'))(_0xa2a9('0x6'));var config=require('../../config/environment');var jayson=require(_0xa2a9('0x7'));var client=jayson[_0xa2a9('0x8')][_0xa2a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bd1f3,_0x5c1fb2,_0x5d933f){return new BPromise(function(_0x540979,_0x523164){return client[_0xa2a9('0xa')](_0x2bd1f3,_0x5d933f)[_0xa2a9('0xb')](function(_0x3eaaa6){logger[_0xa2a9('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5c1fb2,_0xa2a9('0xd'));logger[_0xa2a9('0xe')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x5c1fb2,_0xa2a9('0xd'),JSON[_0xa2a9('0xf')](_0x3eaaa6));if(_0x3eaaa6[_0xa2a9('0x10')]){if(_0x3eaaa6[_0xa2a9('0x10')]['code']===0x1f4){logger[_0xa2a9('0x10')](_0xa2a9('0x11'),_0x5c1fb2,_0x3eaaa6[_0xa2a9('0x10')][_0xa2a9('0x12')]);return _0x523164(_0x3eaaa6[_0xa2a9('0x10')][_0xa2a9('0x12')]);}logger['error'](_0xa2a9('0x11'),_0x5c1fb2,_0x3eaaa6[_0xa2a9('0x10')]['message']);return _0x540979(_0x3eaaa6['error']['message']);}else{logger[_0xa2a9('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5c1fb2,_0xa2a9('0xd'));_0x540979(_0x3eaaa6['result'][_0xa2a9('0x12')]);}})[_0xa2a9('0x13')](function(_0x657934){logger[_0xa2a9('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5c1fb2,_0x657934);_0x523164(_0x657934);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 3f8039a..0a46b9b 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 _0x8863=['/:id','isAuthenticated','post','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','describe'];(function(_0x2d0f4a,_0x4c32f3){var _0x5b9256=function(_0x2d7116){while(--_0x2d7116){_0x2d0f4a['push'](_0x2d0f4a['shift']());}};_0x5b9256(++_0x4c32f3);}(_0x8863,0xc5));var _0x3886=function(_0x5ed695,_0x4bf6bb){_0x5ed695=_0x5ed695-0x0;var _0x18a87f=_0x8863[_0x5ed695];return _0x18a87f;};'use strict';var multer=require('multer');var util=require(_0x3886('0x0'));var path=require(_0x3886('0x1'));var timeout=require(_0x3886('0x2'));var express=require(_0x3886('0x3'));var router=express[_0x3886('0x4')]();var fs_extra=require(_0x3886('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3886('0x6'));var config=require(_0x3886('0x7'));var controller=require(_0x3886('0x8'));router[_0x3886('0x9')]('/',auth['isAuthenticated'](),controller[_0x3886('0xa')]);router[_0x3886('0x9')](_0x3886('0xb'),auth['isAuthenticated'](),controller[_0x3886('0xc')]);router[_0x3886('0x9')](_0x3886('0xd'),auth[_0x3886('0xe')](),controller['show']);router[_0x3886('0xf')]('/',auth[_0x3886('0xe')](),controller[_0x3886('0x10')]);router[_0x3886('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x3886('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3886('0x13')]);module[_0x3886('0x14')]=router; \ No newline at end of file +var _0x4cba=['/describe','describe','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index'];(function(_0x94ae20,_0x1799f2){var _0x5edd9f=function(_0x5ad310){while(--_0x5ad310){_0x94ae20['push'](_0x94ae20['shift']());}};_0x5edd9f(++_0x1799f2);}(_0x4cba,0xf1));var _0xa4cb=function(_0x29467a,_0x405f73){_0x29467a=_0x29467a-0x0;var _0xaec2df=_0x4cba[_0x29467a];return _0xaec2df;};'use strict';var multer=require('multer');var util=require(_0xa4cb('0x0'));var path=require(_0xa4cb('0x1'));var timeout=require(_0xa4cb('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa4cb('0x3'));var auth=require(_0xa4cb('0x4'));var interaction=require(_0xa4cb('0x5'));var config=require(_0xa4cb('0x6'));var controller=require(_0xa4cb('0x7'));router[_0xa4cb('0x8')]('/',auth[_0xa4cb('0x9')](),controller[_0xa4cb('0xa')]);router[_0xa4cb('0x8')](_0xa4cb('0xb'),auth['isAuthenticated'](),controller[_0xa4cb('0xc')]);router[_0xa4cb('0x8')](_0xa4cb('0xd'),auth[_0xa4cb('0x9')](),controller[_0xa4cb('0xe')]);router[_0xa4cb('0xf')]('/',auth[_0xa4cb('0x9')](),controller[_0xa4cb('0x10')]);router[_0xa4cb('0x11')](_0xa4cb('0xd'),auth[_0xa4cb('0x9')](),controller['update']);router[_0xa4cb('0x12')](_0xa4cb('0xd'),auth['isAuthenticated'](),controller[_0xa4cb('0x13')]);module[_0xa4cb('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 61cb203..a4130ca 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 _0x8884=['STRING','mouseOver','timeout','INTEGER','sequelize','exports'];(function(_0x5503ef,_0x3587f1){var _0x1f5c6f=function(_0x210dbb){while(--_0x210dbb){_0x5503ef['push'](_0x5503ef['shift']());}};_0x1f5c6f(++_0x3587f1);}(_0x8884,0x9a));var _0x4888=function(_0x5edf38,_0x279ecf){_0x5edf38=_0x5edf38-0x0;var _0x13adc2=_0x8884[_0x5edf38];return _0x13adc2;};'use strict';var Sequelize=require(_0x4888('0x0'));module[_0x4888('0x1')]={'name':{'type':Sequelize[_0x4888('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x4888('0x3'),_0x4888('0x4')),'defaultValue':_0x4888('0x3')},'selector':{'type':Sequelize[_0x4888('0x2')]},'timeout':{'type':Sequelize[_0x4888('0x5')]}}; \ No newline at end of file +var _0x5738=['INTEGER','exports','STRING','ENUM','mouseOver','timeout'];(function(_0xf0cae2,_0x22a2bc){var _0x36f427=function(_0x4a8b4d){while(--_0x4a8b4d){_0xf0cae2['push'](_0xf0cae2['shift']());}};_0x36f427(++_0x22a2bc);}(_0x5738,0x7f));var _0x8573=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x5738[_0x173d7e];return _0x2220d6;};'use strict';var Sequelize=require('sequelize');module[_0x8573('0x0')]={'name':{'type':Sequelize[_0x8573('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x8573('0x2')](_0x8573('0x3'),_0x8573('0x4')),'defaultValue':_0x8573('0x3')},'selector':{'type':Sequelize[_0x8573('0x1')]},'timeout':{'type':Sequelize[_0x8573('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index e92ed4b..a31db03 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 _0x28aa=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','length','include','merge','options','find','catch','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x2fc8a8,_0x71c3a2){var _0x3597b4=function(_0x41c345){while(--_0x41c345){_0x2fc8a8['push'](_0x2fc8a8['shift']());}};_0x3597b4(++_0x71c3a2);}(_0x28aa,0xf8));var _0xa28a=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x28aa[_0x4d8ed9];return _0x1e2140;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa28a('0x0'));var zipdir=require(_0xa28a('0x1'));var jsonpatch=require(_0xa28a('0x2'));var rp=require(_0xa28a('0x3'));var moment=require(_0xa28a('0x4'));var BPromise=require(_0xa28a('0x5'));var Mustache=require('mustache');var util=require(_0xa28a('0x6'));var path=require(_0xa28a('0x7'));var sox=require(_0xa28a('0x8'));var csv=require(_0xa28a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa28a('0xa'));var _=require(_0xa28a('0xb'));var squel=require(_0xa28a('0xc'));var crypto=require(_0xa28a('0xd'));var jsforce=require(_0xa28a('0xe'));var deskjs=require(_0xa28a('0xf'));var toCsv=require(_0xa28a('0x9'));var querystring=require(_0xa28a('0x10'));var Papa=require(_0xa28a('0x11'));var Redis=require(_0xa28a('0x12'));var authService=require(_0xa28a('0x13'));var qs=require(_0xa28a('0x14'));var as=require(_0xa28a('0x15'));var hardwareService=require(_0xa28a('0x16'));var logger=require(_0xa28a('0x17'))('api');var utils=require(_0xa28a('0x18'));var config=require(_0xa28a('0x19'));var licenseUtil=require(_0xa28a('0x1a'));var db=require(_0xa28a('0x1b'))['db'];function respondWithStatusCode(_0x5c93d6,_0x94e91f){_0x94e91f=_0x94e91f||0xcc;return function(_0x3e254c){if(_0x3e254c){return _0x5c93d6['sendStatus'](_0x94e91f);}return _0x5c93d6[_0xa28a('0x1c')](_0x94e91f)[_0xa28a('0x1d')]();};}function respondWithResult(_0x69f85f,_0x412e0d){_0x412e0d=_0x412e0d||0xc8;return function(_0x52ee62){if(_0x52ee62){return _0x69f85f[_0xa28a('0x1c')](_0x412e0d)[_0xa28a('0x1e')](_0x52ee62);}};}function respondWithFilteredResult(_0x11ef7c,_0x1b4f6f){return function(_0x413d48){if(_0x413d48){var _0x56c1ae=typeof _0x1b4f6f[_0xa28a('0x1f')]===_0xa28a('0x20')&&typeof _0x1b4f6f[_0xa28a('0x21')]==='undefined';var _0x15d22f=_0x413d48[_0xa28a('0x22')];var _0x468672=_0x56c1ae?0x0:_0x1b4f6f[_0xa28a('0x1f')];var _0x1fc027=_0x56c1ae?_0x413d48['count']:_0x1b4f6f['offset']+_0x1b4f6f[_0xa28a('0x21')];var _0x516340;if(_0x1fc027>=_0x15d22f){_0x1fc027=_0x15d22f;_0x516340=0xc8;}else{_0x516340=0xce;}_0x11ef7c['status'](_0x516340);return _0x11ef7c[_0xa28a('0x23')](_0xa28a('0x24'),_0x468672+'-'+_0x1fc027+'/'+_0x15d22f)[_0xa28a('0x1e')](_0x413d48);}return null;};}function patchUpdates(_0x46173d){return function(_0x115d49){try{jsonpatch[_0xa28a('0x25')](_0x115d49,_0x46173d,!![]);}catch(_0x3b0c0f){return BPromise[_0xa28a('0x26')](_0x3b0c0f);}return _0x115d49[_0xa28a('0x27')]();};}function saveUpdates(_0x512e6c,_0x15b9cf){return function(_0x43bf00){if(_0x43bf00){return _0x43bf00['update'](_0x512e6c)[_0xa28a('0x28')](function(_0x187981){return _0x187981;});}return null;};}function removeEntity(_0x461ab4,_0x57cd58){return function(_0x3770e4){if(_0x3770e4){return _0x3770e4[_0xa28a('0x29')]()['then'](function(){_0x461ab4[_0xa28a('0x1c')](0xcc)[_0xa28a('0x1d')]();});}};}function handleEntityNotFound(_0xa3541b,_0x41c68b){return function(_0x3751b8){if(!_0x3751b8){_0xa3541b['sendStatus'](0x194);}return _0x3751b8;};}function handleError(_0x5df6e5,_0x2c93a1){_0x2c93a1=_0x2c93a1||0x1f4;return function(_0x5502bf){logger[_0xa28a('0x2a')](_0x5502bf['stack']);if(_0x5502bf['name']){delete _0x5502bf[_0xa28a('0x2b')];}_0x5df6e5[_0xa28a('0x1c')](_0x2c93a1)[_0xa28a('0x2c')](_0x5502bf);};}exports[_0xa28a('0x2d')]=function(_0x5514f5,_0x103b0b){var _0x54d26d={'raw':!![],'where':{'id':_0x5514f5[_0xa28a('0x2e')]['id']}},_0x26c998={};_0x26c998[_0xa28a('0x2f')]=_[_0xa28a('0x30')](db[_0xa28a('0x31')][_0xa28a('0x32')]);_0x26c998[_0xa28a('0x33')]=_[_0xa28a('0x30')](_0x5514f5[_0xa28a('0x33')]);_0x26c998[_0xa28a('0x34')]=_[_0xa28a('0x35')](_0x26c998['model'],_0x26c998[_0xa28a('0x33')]);_0x54d26d['attributes']=_[_0xa28a('0x35')](_0x26c998[_0xa28a('0x2f')],qs[_0xa28a('0x36')](_0x5514f5['query'][_0xa28a('0x36')]));_0x54d26d[_0xa28a('0x37')]=_0x54d26d[_0xa28a('0x37')][_0xa28a('0x38')]?_0x54d26d['attributes']:_0x26c998[_0xa28a('0x2f')];if(_0x5514f5[_0xa28a('0x33')]['includeAll']){_0x54d26d[_0xa28a('0x39')]=[{'all':!![]}];}_0x54d26d=_[_0xa28a('0x3a')]({},_0x54d26d,_0x5514f5[_0xa28a('0x3b')]);return db[_0xa28a('0x31')][_0xa28a('0x3c')](_0x54d26d)['then'](handleEntityNotFound(_0x103b0b,null))[_0xa28a('0x28')](respondWithResult(_0x103b0b,null))[_0xa28a('0x3d')](handleError(_0x103b0b,null));};exports[_0xa28a('0x3e')]=function(_0x501dbf,_0x451c05){return db[_0xa28a('0x31')]['create'](_0x501dbf[_0xa28a('0x3f')],{})[_0xa28a('0x28')](respondWithResult(_0x451c05,0xc9))[_0xa28a('0x3d')](handleError(_0x451c05,null));};exports[_0xa28a('0x40')]=function(_0x4f6968,_0x2d74d1){if(_0x4f6968[_0xa28a('0x3f')]['id']){delete _0x4f6968[_0xa28a('0x3f')]['id'];}return db[_0xa28a('0x31')][_0xa28a('0x3c')]({'where':{'id':_0x4f6968['params']['id']}})[_0xa28a('0x28')](handleEntityNotFound(_0x2d74d1,null))[_0xa28a('0x28')](saveUpdates(_0x4f6968[_0xa28a('0x3f')],null))['then'](respondWithResult(_0x2d74d1,null))[_0xa28a('0x3d')](handleError(_0x2d74d1,null));};exports['destroy']=function(_0x5cf3af,_0x119338){return db[_0xa28a('0x31')][_0xa28a('0x3c')]({'where':{'id':_0x5cf3af[_0xa28a('0x2e')]['id']}})['then'](handleEntityNotFound(_0x119338,null))[_0xa28a('0x28')](removeEntity(_0x119338,null))['catch'](handleError(_0x119338,null));}; \ No newline at end of file +var _0xc3b5=['jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','then','destroy','error','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','create','body','update','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto'];(function(_0x43b922,_0x5e33fd){var _0x9dba94=function(_0x39e138){while(--_0x39e138){_0x43b922['push'](_0x43b922['shift']());}};_0x9dba94(++_0x5e33fd);}(_0xc3b5,0x6f));var _0x5c3b=function(_0xffc2e7,_0x5bc33c){_0xffc2e7=_0xffc2e7-0x0;var _0x3bc22a=_0xc3b5[_0xffc2e7];return _0x3bc22a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5c3b('0x0'));var jsonpatch=require(_0x5c3b('0x1'));var rp=require(_0x5c3b('0x2'));var moment=require(_0x5c3b('0x3'));var BPromise=require(_0x5c3b('0x4'));var Mustache=require(_0x5c3b('0x5'));var util=require(_0x5c3b('0x6'));var path=require(_0x5c3b('0x7'));var sox=require('sox');var csv=require(_0x5c3b('0x8'));var ejs=require(_0x5c3b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5c3b('0xa'));var squel=require(_0x5c3b('0xb'));var crypto=require(_0x5c3b('0xc'));var jsforce=require(_0x5c3b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5c3b('0x8'));var querystring=require(_0x5c3b('0xe'));var Papa=require(_0x5c3b('0xf'));var Redis=require(_0x5c3b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5c3b('0x11'));var as=require(_0x5c3b('0x12'));var hardwareService=require(_0x5c3b('0x13'));var logger=require(_0x5c3b('0x14'))(_0x5c3b('0x15'));var utils=require('../../config/utils');var config=require(_0x5c3b('0x16'));var licenseUtil=require(_0x5c3b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b2815,_0x3b953d){_0x3b953d=_0x3b953d||0xcc;return function(_0x507c2e){if(_0x507c2e){return _0x1b2815[_0x5c3b('0x18')](_0x3b953d);}return _0x1b2815[_0x5c3b('0x19')](_0x3b953d)[_0x5c3b('0x1a')]();};}function respondWithResult(_0x2384b9,_0x315e68){_0x315e68=_0x315e68||0xc8;return function(_0x3fef28){if(_0x3fef28){return _0x2384b9[_0x5c3b('0x19')](_0x315e68)['json'](_0x3fef28);}};}function respondWithFilteredResult(_0x2f7ab2,_0x5b55be){return function(_0x4cf80d){if(_0x4cf80d){var _0x195c1e=typeof _0x5b55be[_0x5c3b('0x1b')]===_0x5c3b('0x1c')&&typeof _0x5b55be['limit']===_0x5c3b('0x1c');var _0x229e28=_0x4cf80d[_0x5c3b('0x1d')];var _0x59f71b=_0x195c1e?0x0:_0x5b55be[_0x5c3b('0x1b')];var _0x34144d=_0x195c1e?_0x4cf80d['count']:_0x5b55be[_0x5c3b('0x1b')]+_0x5b55be[_0x5c3b('0x1e')];var _0x2b2307;if(_0x34144d>=_0x229e28){_0x34144d=_0x229e28;_0x2b2307=0xc8;}else{_0x2b2307=0xce;}_0x2f7ab2[_0x5c3b('0x19')](_0x2b2307);return _0x2f7ab2[_0x5c3b('0x1f')](_0x5c3b('0x20'),_0x59f71b+'-'+_0x34144d+'/'+_0x229e28)[_0x5c3b('0x21')](_0x4cf80d);}return null;};}function patchUpdates(_0x1af39c){return function(_0xc63307){try{jsonpatch[_0x5c3b('0x22')](_0xc63307,_0x1af39c,!![]);}catch(_0x4ec8c1){return BPromise['reject'](_0x4ec8c1);}return _0xc63307[_0x5c3b('0x23')]();};}function saveUpdates(_0x143022,_0x5942f1){return function(_0x439d8e){if(_0x439d8e){return _0x439d8e['update'](_0x143022)[_0x5c3b('0x24')](function(_0xb8006){return _0xb8006;});}return null;};}function removeEntity(_0x2bb9dc,_0xe9261d){return function(_0x529c39){if(_0x529c39){return _0x529c39[_0x5c3b('0x25')]()[_0x5c3b('0x24')](function(){_0x2bb9dc['status'](0xcc)[_0x5c3b('0x1a')]();});}};}function handleEntityNotFound(_0x2c8682,_0x3a8141){return function(_0x3c3991){if(!_0x3c3991){_0x2c8682['sendStatus'](0x194);}return _0x3c3991;};}function handleError(_0x15ae38,_0x20469d){_0x20469d=_0x20469d||0x1f4;return function(_0x2099dc){logger[_0x5c3b('0x26')](_0x2099dc[_0x5c3b('0x27')]);if(_0x2099dc[_0x5c3b('0x28')]){delete _0x2099dc['name'];}_0x15ae38['status'](_0x20469d)['send'](_0x2099dc);};}exports[_0x5c3b('0x29')]=function(_0x3e6832,_0x59b640){var _0xd93418={'raw':!![],'where':{'id':_0x3e6832[_0x5c3b('0x2a')]['id']}},_0x15044e={};_0x15044e[_0x5c3b('0x2b')]=_[_0x5c3b('0x2c')](db[_0x5c3b('0x2d')][_0x5c3b('0x2e')]);_0x15044e[_0x5c3b('0x2f')]=_[_0x5c3b('0x2c')](_0x3e6832[_0x5c3b('0x2f')]);_0x15044e[_0x5c3b('0x30')]=_[_0x5c3b('0x31')](_0x15044e['model'],_0x15044e[_0x5c3b('0x2f')]);_0xd93418[_0x5c3b('0x32')]=_[_0x5c3b('0x31')](_0x15044e[_0x5c3b('0x2b')],qs[_0x5c3b('0x33')](_0x3e6832[_0x5c3b('0x2f')][_0x5c3b('0x33')]));_0xd93418[_0x5c3b('0x32')]=_0xd93418[_0x5c3b('0x32')][_0x5c3b('0x34')]?_0xd93418[_0x5c3b('0x32')]:_0x15044e[_0x5c3b('0x2b')];if(_0x3e6832[_0x5c3b('0x2f')][_0x5c3b('0x35')]){_0xd93418[_0x5c3b('0x36')]=[{'all':!![]}];}_0xd93418=_[_0x5c3b('0x37')]({},_0xd93418,_0x3e6832[_0x5c3b('0x38')]);return db['ChatProactiveAction'][_0x5c3b('0x39')](_0xd93418)[_0x5c3b('0x24')](handleEntityNotFound(_0x59b640,null))[_0x5c3b('0x24')](respondWithResult(_0x59b640,null))[_0x5c3b('0x3a')](handleError(_0x59b640,null));};exports['create']=function(_0x35939b,_0x39c159){return db['ChatProactiveAction'][_0x5c3b('0x3b')](_0x35939b[_0x5c3b('0x3c')],{})[_0x5c3b('0x24')](respondWithResult(_0x39c159,0xc9))[_0x5c3b('0x3a')](handleError(_0x39c159,null));};exports[_0x5c3b('0x3d')]=function(_0x27e7f7,_0x27b34d){if(_0x27e7f7[_0x5c3b('0x3c')]['id']){delete _0x27e7f7[_0x5c3b('0x3c')]['id'];}return db['ChatProactiveAction'][_0x5c3b('0x39')]({'where':{'id':_0x27e7f7[_0x5c3b('0x2a')]['id']}})['then'](handleEntityNotFound(_0x27b34d,null))['then'](saveUpdates(_0x27e7f7[_0x5c3b('0x3c')],null))[_0x5c3b('0x24')](respondWithResult(_0x27b34d,null))[_0x5c3b('0x3a')](handleError(_0x27b34d,null));};exports[_0x5c3b('0x25')]=function(_0x223dc8,_0x406bf9){return db[_0x5c3b('0x2d')]['find']({'where':{'id':_0x223dc8['params']['id']}})[_0x5c3b('0x24')](handleEntityNotFound(_0x406bf9,null))[_0x5c3b('0x24')](removeEntity(_0x406bf9,null))[_0x5c3b('0x3a')](handleError(_0x406bf9,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 274ca0c..fcf0969 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 _0x4783=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatProactiveAction','util'];(function(_0x5b8b0a,_0x2c50db){var _0x75fc0c=function(_0x4037d6){while(--_0x4037d6){_0x5b8b0a['push'](_0x5b8b0a['shift']());}};_0x75fc0c(++_0x2c50db);}(_0x4783,0x6d));var _0x3478=function(_0x318269,_0x3b83b7){_0x318269=_0x318269-0x0;var _0x4a4832=_0x4783[_0x318269];return _0x4a4832;};'use strict';var _=require('lodash');var util=require(_0x3478('0x0'));var logger=require(_0x3478('0x1'))(_0x3478('0x2'));var moment=require(_0x3478('0x3'));var BPromise=require(_0x3478('0x4'));var rp=require(_0x3478('0x5'));var fs=require('fs');var path=require(_0x3478('0x6'));var rimraf=require(_0x3478('0x7'));var config=require(_0x3478('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0x3478('0x9')]=function(_0x2bb969,_0x31b87d){return _0x2bb969['define'](_0x3478('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1160=['api','moment','bluebird','path','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x1160,0xfa));var _0x0116=function(_0x10e8ed,_0x384a0d){_0x10e8ed=_0x10e8ed-0x0;var _0x4aea4a=_0x1160[_0x10e8ed];return _0x4aea4a;};'use strict';var _=require(_0x0116('0x0'));var util=require(_0x0116('0x1'));var logger=require(_0x0116('0x2'))(_0x0116('0x3'));var moment=require(_0x0116('0x4'));var BPromise=require(_0x0116('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0116('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0116('0x7'));module[_0x0116('0x8')]=function(_0x23e3e1,_0x110dc7){return _0x23e3e1['define'](_0x0116('0x9'),attributes,{'tableName':_0x0116('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 53d2f83..42b58e2 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 _0xf04c=['client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x3c3710,_0x42b9ae){var _0x3d00db=function(_0x241e6b){while(--_0x241e6b){_0x3c3710['push'](_0x3c3710['shift']());}};_0x3d00db(++_0x42b9ae);}(_0xf04c,0x7c));var _0xcf04=function(_0x19680d,_0x4365e3){_0x19680d=_0x19680d-0x0;var _0x889d83=_0xf04c[_0x19680d];return _0x889d83;};'use strict';var _=require(_0xcf04('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcf04('0x1'));var rs=require(_0xcf04('0x2'));var fs=require('fs');var Redis=require(_0xcf04('0x3'));var db=require(_0xcf04('0x4'))['db'];var utils=require(_0xcf04('0x5'));var logger=require(_0xcf04('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcf04('0x7'));var client=jayson[_0xcf04('0x8')][_0xcf04('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x498fab,_0x4453f8,_0x38c36c){return new BPromise(function(_0x2200e6,_0x1e4f55){return client[_0xcf04('0xa')](_0x498fab,_0x38c36c)[_0xcf04('0xb')](function(_0x5ad9b1){logger[_0xcf04('0xc')](_0xcf04('0xd'),_0x4453f8,_0xcf04('0xe'));logger['debug'](_0xcf04('0xf'),_0x4453f8,_0xcf04('0xe'),JSON[_0xcf04('0x10')](_0x5ad9b1));if(_0x5ad9b1[_0xcf04('0x11')]){if(_0x5ad9b1['error'][_0xcf04('0x12')]===0x1f4){logger[_0xcf04('0x11')](_0xcf04('0xd'),_0x4453f8,_0x5ad9b1[_0xcf04('0x11')][_0xcf04('0x13')]);return _0x1e4f55(_0x5ad9b1['error']['message']);}logger['error'](_0xcf04('0xd'),_0x4453f8,_0x5ad9b1['error'][_0xcf04('0x13')]);return _0x2200e6(_0x5ad9b1['error'][_0xcf04('0x13')]);}else{logger['info'](_0xcf04('0xd'),_0x4453f8,_0xcf04('0xe'));_0x2200e6(_0x5ad9b1[_0xcf04('0x14')][_0xcf04('0x13')]);}})[_0xcf04('0x15')](function(_0x5ca5c0){logger[_0xcf04('0x11')]('ChatProactiveAction,\x20%s,\x20%s',_0x4453f8,_0x5ca5c0);_0x1e4f55(_0x5ca5c0);});});} \ No newline at end of file +var _0x20bc=['http','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1263c1,_0x287a24){var _0x59639e=function(_0xf1c73c){while(--_0xf1c73c){_0x1263c1['push'](_0x1263c1['shift']());}};_0x59639e(++_0x287a24);}(_0x20bc,0xb5));var _0xc20b=function(_0x56fb7d,_0x539ea1){_0x56fb7d=_0x56fb7d-0x0;var _0x3be1c3=_0x20bc[_0x56fb7d];return _0x3be1c3;};'use strict';var _=require(_0xc20b('0x0'));var util=require(_0xc20b('0x1'));var moment=require('moment');var BPromise=require(_0xc20b('0x2'));var rs=require(_0xc20b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc20b('0x4'))['db'];var utils=require(_0xc20b('0x5'));var logger=require(_0xc20b('0x6'))(_0xc20b('0x7'));var config=require(_0xc20b('0x8'));var jayson=require(_0xc20b('0x9'));var client=jayson[_0xc20b('0xa')][_0xc20b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c171b,_0x16db57,_0x30d929){return new BPromise(function(_0x15a272,_0x65d1f8){return client['request'](_0x3c171b,_0x30d929)[_0xc20b('0xc')](function(_0x974295){logger['info'](_0xc20b('0xd'),_0x16db57,_0xc20b('0xe'));logger[_0xc20b('0xf')](_0xc20b('0x10'),_0x16db57,'request\x20sent',JSON[_0xc20b('0x11')](_0x974295));if(_0x974295[_0xc20b('0x12')]){if(_0x974295['error'][_0xc20b('0x13')]===0x1f4){logger[_0xc20b('0x12')](_0xc20b('0xd'),_0x16db57,_0x974295[_0xc20b('0x12')][_0xc20b('0x14')]);return _0x65d1f8(_0x974295[_0xc20b('0x12')]['message']);}logger[_0xc20b('0x12')](_0xc20b('0xd'),_0x16db57,_0x974295[_0xc20b('0x12')][_0xc20b('0x14')]);return _0x15a272(_0x974295['error']['message']);}else{logger[_0xc20b('0x15')](_0xc20b('0xd'),_0x16db57,_0xc20b('0xe'));_0x15a272(_0x974295[_0xc20b('0x16')]['message']);}})[_0xc20b('0x17')](function(_0x37c42f){logger[_0xc20b('0x12')](_0xc20b('0xd'),_0x16db57,_0x37c42f);_0x65d1f8(_0x37c42f);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 69896f8..45ef55c 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 _0xac9d=['get','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x40462a,_0x470472){var _0x463c6d=function(_0x563fd5){while(--_0x563fd5){_0x40462a['push'](_0x40462a['shift']());}};_0x463c6d(++_0x470472);}(_0xac9d,0x14d));var _0xdac9=function(_0x2652ef,_0x234230){_0x2652ef=_0x2652ef-0x0;var _0x2db578=_0xac9d[_0x2652ef];return _0x2db578;};'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('./chatProactiveAction.controller');router[_0xdac9('0x9')](_0xdac9('0xa'),auth[_0xdac9('0xb')](),controller[_0xdac9('0xc')]);router[_0xdac9('0xd')]('/',auth[_0xdac9('0xb')](),controller['create']);router[_0xdac9('0xe')]('/:id',auth[_0xdac9('0xb')](),controller[_0xdac9('0xf')]);router[_0xdac9('0x10')](_0xdac9('0xa'),auth[_0xdac9('0xb')](),controller[_0xdac9('0x11')]);module[_0xdac9('0x12')]=router; \ No newline at end of file +var _0x326f=['../../config/environment','./chatProactiveAction.controller','get','/:id','show','post','isAuthenticated','create','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x471eec,_0x97e5f7){var _0x42818f=function(_0x3f90cf){while(--_0x3f90cf){_0x471eec['push'](_0x471eec['shift']());}};_0x42818f(++_0x97e5f7);}(_0x326f,0xd1));var _0xf326=function(_0xd84df2,_0x517955){_0xd84df2=_0xd84df2-0x0;var _0x3cf1e2=_0x326f[_0xd84df2];return _0x3cf1e2;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')](_0xf326('0xa'),auth['isAuthenticated'](),controller[_0xf326('0xb')]);router[_0xf326('0xc')]('/',auth[_0xf326('0xd')](),controller[_0xf326('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xf')]);router[_0xf326('0x10')](_0xf326('0xa'),auth[_0xf326('0xd')](),controller[_0xf326('0x11')]);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 1ba05b5..0acc2f6 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 _0x9f0d=['exports','STRING','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x467e07,_0x2ac167){var _0x13efd3=function(_0x21f602){while(--_0x21f602){_0x467e07['push'](_0x467e07['shift']());}};_0x13efd3(++_0x2ac167);}(_0x9f0d,0x148));var _0xd9f0=function(_0x137fdc,_0x350ef5){_0x137fdc=_0x137fdc-0x0;var _0x4594b8=_0x9f0d[_0x137fdc];return _0x4594b8;};'use strict';var Sequelize=require(_0xd9f0('0x0'));module[_0xd9f0('0x1')]={'name':{'type':Sequelize[_0xd9f0('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xd9f0('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd9f0('0x4')](_0xd9f0('0x5'),'beepall',_0xd9f0('0x6'))}}; \ No newline at end of file +var _0x4863=['beepall','sequelize','exports','name','STRING','INTEGER','ENUM','rrmemory'];(function(_0x1da2ad,_0x56f599){var _0x269367=function(_0x41e8c1){while(--_0x41e8c1){_0x1da2ad['push'](_0x1da2ad['shift']());}};_0x269367(++_0x56f599);}(_0x4863,0x1c1));var _0x3486=function(_0x2aea57,_0x2d9ab3){_0x2aea57=_0x2aea57-0x0;var _0x1ed997=_0x4863[_0x2aea57];return _0x1ed997;};'use strict';var Sequelize=require(_0x3486('0x0'));module[_0x3486('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3486('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3486('0x3')]},'timeout':{'type':Sequelize[_0x3486('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3486('0x5')](_0x3486('0x6'),_0x3486('0x7'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 6c6a222..ed40581 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 _0xffc6=['attributes','length','includeAll','merge','options','create','body','user','role','ChatQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserChatQueue','hasOwnProperty','nolimit','sort','pick','filter','findAndCountAll','UserId','agent','chatPause','createdAt','rows','format','%s/%s','SIP','updatedAt','Team','order','getTeams','ids','User','voicePause','interface','Agents','find','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','field','tq.TeamId','team_has_chat_queues','user_has_teams','ChatQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','includes','all','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','findOne','getAgents','bluebird','util','lodash','squel','ioredis','../../config/environment','redis','localhost','socket.io-emitter','./chatQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','where','ChatQueue','include','query','findAll','catch','show','params','keys','filters','intersection','model','fields'];(function(_0x2389bc,_0x167cd2){var _0x170548=function(_0x2da7f2){while(--_0x2da7f2){_0x2389bc['push'](_0x2389bc['shift']());}};_0x170548(++_0x167cd2);}(_0xffc6,0x1a8));var _0x6ffc=function(_0x463cbe,_0x539756){_0x463cbe=_0x463cbe-0x0;var _0x49907a=_0xffc6[_0x463cbe];return _0x49907a;};'use strict';var BPromise=require(_0x6ffc('0x0'));var util=require(_0x6ffc('0x1'));var _=require(_0x6ffc('0x2'));var squel=require(_0x6ffc('0x3'));var Redis=require(_0x6ffc('0x4'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0x6ffc('0x5'));var db=require('../../mysqldb')['db'];config[_0x6ffc('0x6')]=_['defaults'](config[_0x6ffc('0x6')],{'host':_0x6ffc('0x7'),'port':0x18eb});var socket=require(_0x6ffc('0x8'))(new Redis(config[_0x6ffc('0x6')]));require(_0x6ffc('0x9'))[_0x6ffc('0xa')](socket);function respondWithStatusCode(_0x5963cc,_0xfd6faa){_0xfd6faa=_0xfd6faa||0xcc;return function(_0x1db3b6){if(_0x1db3b6){return _0x5963cc[_0x6ffc('0xb')](_0xfd6faa);}return _0x5963cc[_0x6ffc('0xc')](_0xfd6faa)[_0x6ffc('0xd')]();};}function respondWithResult(_0x5e51f3,_0x1c87be){_0x1c87be=_0x1c87be||0xc8;return function(_0x1fd0b7){if(_0x1fd0b7){return _0x5e51f3[_0x6ffc('0xc')](_0x1c87be)[_0x6ffc('0xe')](_0x1fd0b7);}};}function respondWithFilteredResult(_0x351321,_0x564139){return function(_0x355a0b){if(_0x355a0b){var _0x275bb3=typeof _0x564139[_0x6ffc('0xf')]===_0x6ffc('0x10')&&typeof _0x564139[_0x6ffc('0x11')]===_0x6ffc('0x10');var _0x1dd693=_0x355a0b[_0x6ffc('0x12')];var _0x1c50a9=_0x275bb3?0x0:_0x564139[_0x6ffc('0xf')];var _0x250d09=_0x275bb3?_0x355a0b['count']:_0x564139[_0x6ffc('0xf')]+_0x564139[_0x6ffc('0x11')];var _0x25ba20;if(_0x250d09>=_0x1dd693){_0x250d09=_0x1dd693;_0x25ba20=0xc8;}else{_0x25ba20=0xce;}_0x351321['status'](_0x25ba20);return _0x351321[_0x6ffc('0x13')](_0x6ffc('0x14'),_0x1c50a9+'-'+_0x250d09+'/'+_0x1dd693)[_0x6ffc('0xe')](_0x355a0b);}return null;};}function saveUpdates(_0x348875){return function(_0x284229){if(_0x284229){return _0x284229[_0x6ffc('0x15')](_0x348875)[_0x6ffc('0x16')](function(_0x5cae01){return _0x5cae01;});}return null;};}function removeEntity(_0x2932cd){return function(_0x2a39ad){if(_0x2a39ad){return _0x2a39ad[_0x6ffc('0x17')]()['then'](function(){var _0x4992f5=_0x2a39ad[_0x6ffc('0x18')]({'plain':!![]});var _0x4bb2cc='ChatQueues';return db[_0x6ffc('0x19')]['destroy']({'where':{'type':_0x4bb2cc,'resourceId':_0x4992f5['id']}})[_0x6ffc('0x16')](function(){return _0x2a39ad;});})[_0x6ffc('0x16')](function(){_0x2932cd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fdb55){return function(_0x7969c9){if(!_0x7969c9){_0x4fdb55['sendStatus'](0x194);}return _0x7969c9;};}function handleError(_0x156655,_0x52fdf1){_0x52fdf1=_0x52fdf1||0x1f4;return function(_0x44ac79){logger[_0x6ffc('0x1a')](_0x44ac79['stack']);if(_0x44ac79['name']){delete _0x44ac79[_0x6ffc('0x1b')];}_0x156655['status'](_0x52fdf1)[_0x6ffc('0x1c')](_0x44ac79);};}exports[_0x6ffc('0x1d')]=function(_0x30f186,_0x4d0770){var _0x21b040={};var _0x517b64={'count':0x0,'rows':[]};var _0x367ce1=_[_0x6ffc('0x1e')](db['ChatQueue'][_0x6ffc('0x1f')],function(_0x115ab8){return{'name':_0x115ab8[_0x6ffc('0x20')],'type':_0x115ab8[_0x6ffc('0x21')][_0x6ffc('0x22')]};});_0x21b040=qs['getOptions'](_0x367ce1,_0x30f186);var _0x167010={'where':_0x21b040[_0x6ffc('0x23')]};return db[_0x6ffc('0x24')]['count'](_0x167010)['then'](function(_0x515ead){_0x517b64[_0x6ffc('0x12')]=_0x515ead;_0x21b040[_0x6ffc('0x25')]=qs['include'](_0x30f186[_0x6ffc('0x26')]);return db[_0x6ffc('0x24')][_0x6ffc('0x27')](_0x21b040);})[_0x6ffc('0x16')](function(_0x177d4c){_0x517b64['rows']=_0x177d4c;return _0x517b64;})[_0x6ffc('0x16')](respondWithFilteredResult(_0x4d0770,_0x21b040))[_0x6ffc('0x28')](handleError(_0x4d0770,null));};exports[_0x6ffc('0x29')]=function(_0x942ab2,_0xb641d2){var _0x3b18b5={'raw':!![],'where':{'id':_0x942ab2[_0x6ffc('0x2a')]['id']}},_0x2c0b46={};_0x2c0b46['model']=_[_0x6ffc('0x2b')](db['ChatQueue'][_0x6ffc('0x1f')]);_0x2c0b46[_0x6ffc('0x26')]=_[_0x6ffc('0x2b')](_0x942ab2[_0x6ffc('0x26')]);_0x2c0b46[_0x6ffc('0x2c')]=_['intersection'](_0x2c0b46['model'],_0x2c0b46[_0x6ffc('0x26')]);_0x3b18b5['attributes']=_[_0x6ffc('0x2d')](_0x2c0b46[_0x6ffc('0x2e')],qs[_0x6ffc('0x2f')](_0x942ab2[_0x6ffc('0x26')]['fields']));_0x3b18b5[_0x6ffc('0x30')]=_0x3b18b5[_0x6ffc('0x30')][_0x6ffc('0x31')]?_0x3b18b5[_0x6ffc('0x30')]:_0x2c0b46[_0x6ffc('0x2e')];if(_0x942ab2[_0x6ffc('0x26')][_0x6ffc('0x32')]){_0x3b18b5[_0x6ffc('0x25')]=[{'all':!![]}];}_0x3b18b5=_[_0x6ffc('0x33')]({},_0x3b18b5,_0x942ab2[_0x6ffc('0x34')]);return db[_0x6ffc('0x24')]['find'](_0x3b18b5)[_0x6ffc('0x16')](handleEntityNotFound(_0xb641d2,null))[_0x6ffc('0x16')](respondWithResult(_0xb641d2,null))[_0x6ffc('0x28')](handleError(_0xb641d2,null));};exports[_0x6ffc('0x35')]=function(_0x46d4ef,_0x962715){return db[_0x6ffc('0x24')][_0x6ffc('0x35')](_0x46d4ef[_0x6ffc('0x36')],{})['then'](function(_0x86aeb2){var _0x5421d9=_0x46d4ef[_0x6ffc('0x37')][_0x6ffc('0x18')]({'plain':!![]});if(!_0x5421d9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5421d9[_0x6ffc('0x38')]===_0x6ffc('0x37')){var _0x21df63=_0x86aeb2[_0x6ffc('0x18')]({'plain':!![]});var _0x5ea25d=_0x6ffc('0x39');return db['UserProfileSection']['find']({'where':{'name':_0x5ea25d,'userProfileId':_0x5421d9[_0x6ffc('0x3a')]},'raw':!![]})[_0x6ffc('0x16')](function(_0x5d654e){if(_0x5d654e&&_0x5d654e[_0x6ffc('0x3b')]===0x0){return db[_0x6ffc('0x19')]['create']({'name':_0x21df63[_0x6ffc('0x1b')],'resourceId':_0x21df63['id'],'type':_0x5d654e['name'],'sectionId':_0x5d654e['id']},{})[_0x6ffc('0x16')](function(){return _0x86aeb2;});}else{return _0x86aeb2;}})[_0x6ffc('0x28')](function(_0x5bc9de){logger[_0x6ffc('0x1a')](_0x6ffc('0x3c'),_0x5bc9de);throw _0x5bc9de;});}return _0x86aeb2;})[_0x6ffc('0x16')](respondWithResult(_0x962715,0xc9))[_0x6ffc('0x28')](handleError(_0x962715,null));};exports[_0x6ffc('0x15')]=function(_0x4392c6,_0x37fd7b){if(_0x4392c6['body']['id']){delete _0x4392c6[_0x6ffc('0x36')]['id'];}return db[_0x6ffc('0x24')]['find']({'where':{'id':_0x4392c6[_0x6ffc('0x2a')]['id']}})[_0x6ffc('0x16')](handleEntityNotFound(_0x37fd7b,null))[_0x6ffc('0x16')](saveUpdates(_0x4392c6[_0x6ffc('0x36')],null))[_0x6ffc('0x16')](respondWithResult(_0x37fd7b,null))[_0x6ffc('0x28')](handleError(_0x37fd7b,null));};exports[_0x6ffc('0x17')]=function(_0x15d2ad,_0x22bd15){return db[_0x6ffc('0x24')]['find']({'where':{'id':_0x15d2ad[_0x6ffc('0x2a')]['id']}})[_0x6ffc('0x16')](handleEntityNotFound(_0x22bd15,null))[_0x6ffc('0x16')](removeEntity(_0x22bd15,null))[_0x6ffc('0x28')](handleError(_0x22bd15,null));};exports[_0x6ffc('0x3d')]=function(_0x3a0f90,_0x445d5a){return db['ChatQueue'][_0x6ffc('0x3d')]()[_0x6ffc('0x16')](respondWithResult(_0x445d5a,null))[_0x6ffc('0x28')](handleError(_0x445d5a,null));};exports['getMembers']=function(_0x29bcd3,_0xec8fb5){var _0x36f26e={'raw':!![],'where':{}},_0x3e1bf3={},_0x54896b;return db['ChatQueue']['findOne']({'where':{'id':_0x29bcd3['params']['id']}})[_0x6ffc('0x16')](handleEntityNotFound(_0xec8fb5,null))[_0x6ffc('0x16')](function(_0x7fda96){if(_0x7fda96){_0x54896b=_0x7fda96[_0x6ffc('0x18')]({'plain':!![]});_0x3e1bf3[_0x6ffc('0x2e')]=_[_0x6ffc('0x2b')](db[_0x6ffc('0x3e')][_0x6ffc('0x1f')]);_0x3e1bf3[_0x6ffc('0x26')]=_['keys'](_0x29bcd3[_0x6ffc('0x26')]);_0x3e1bf3['filters']=_[_0x6ffc('0x2d')](_0x3e1bf3[_0x6ffc('0x2e')],_0x3e1bf3['query']);_0x36f26e[_0x6ffc('0x30')]=_[_0x6ffc('0x2d')](_0x3e1bf3[_0x6ffc('0x2e')],qs[_0x6ffc('0x2f')](_0x29bcd3[_0x6ffc('0x26')][_0x6ffc('0x2f')]));_0x36f26e[_0x6ffc('0x30')]=_0x36f26e['attributes'][_0x6ffc('0x31')]?_0x36f26e[_0x6ffc('0x30')]:_0x3e1bf3[_0x6ffc('0x2e')];if(!_0x29bcd3['query'][_0x6ffc('0x3f')](_0x6ffc('0x40'))){_0x36f26e[_0x6ffc('0x11')]=qs[_0x6ffc('0x11')](_0x29bcd3[_0x6ffc('0x26')]['limit']);_0x36f26e[_0x6ffc('0xf')]=qs[_0x6ffc('0xf')](_0x29bcd3[_0x6ffc('0x26')][_0x6ffc('0xf')]);}_0x36f26e['order']=qs[_0x6ffc('0x41')](_0x29bcd3[_0x6ffc('0x26')][_0x6ffc('0x41')]);_0x36f26e[_0x6ffc('0x23')]=qs[_0x6ffc('0x2c')](_[_0x6ffc('0x42')](_0x29bcd3[_0x6ffc('0x26')],_0x3e1bf3['filters']));_0x36f26e[_0x6ffc('0x23')]['ChatQueueId']=_0x7fda96['id'];if(_0x29bcd3[_0x6ffc('0x26')][_0x6ffc('0x43')]){_0x36f26e['where']=_['merge'](_0x36f26e[_0x6ffc('0x23')],{'$or':_[_0x6ffc('0x1e')](_0x36f26e[_0x6ffc('0x30')],function(_0x57563e){var _0x1b608a={};_0x1b608a[_0x57563e]={'$like':'%'+_0x29bcd3['query'][_0x6ffc('0x43')]+'%'};return _0x1b608a;})});}_0x36f26e=_['merge']({},_0x36f26e,_0x29bcd3[_0x6ffc('0x34')]);return db['UserChatQueue'][_0x6ffc('0x27')](_0x36f26e);}})[_0x6ffc('0x16')](function(_0x313b2d){if(_0x313b2d){return db['User'][_0x6ffc('0x44')]({'where':{'id':_[_0x6ffc('0x1e')](_0x313b2d,_0x6ffc('0x45')),'role':_0x6ffc('0x46')},'attributes':['id',_0x6ffc('0x1b'),_0x6ffc('0x47'),'updatedAt',_0x6ffc('0x48')]});}})[_0x6ffc('0x16')](function(_0x5c2428){if(_0x5c2428){return{'count':_0x5c2428[_0x6ffc('0x12')],'rows':_['map'](_0x5c2428[_0x6ffc('0x49')],function(_0x22915a){return{'membername':_0x22915a[_0x6ffc('0x1b')],'UserId':_0x22915a['id'],'queue_name':_0x54896b[_0x6ffc('0x1b')],'ChatQueueId':_0x54896b['id'],'interface':util[_0x6ffc('0x4a')](_0x6ffc('0x4b'),_0x6ffc('0x4c'),_0x22915a[_0x6ffc('0x1b')]),'penalty':0x0,'paused':_0x22915a['chatPause'],'createdAt':_0x22915a['createdAt'],'updatedAt':_0x22915a[_0x6ffc('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x6ffc('0x16')](respondWithFilteredResult(_0xec8fb5,_0x36f26e))[_0x6ffc('0x28')](handleError(_0xec8fb5,null));};exports['getTeams']=function(_0x37c280,_0x8af22f){var _0x313cf5={};var _0x152444={};var _0x3dc2e1;var _0x1efe6d;return db['ChatQueue']['findOne']({'where':{'id':_0x37c280[_0x6ffc('0x2a')]['id']}})[_0x6ffc('0x16')](handleEntityNotFound(_0x8af22f,null))[_0x6ffc('0x16')](function(_0x252ee7){if(_0x252ee7){_0x3dc2e1=_0x252ee7;_0x152444['model']=_[_0x6ffc('0x2b')](db[_0x6ffc('0x4e')]['rawAttributes']);_0x152444['query']=_[_0x6ffc('0x2b')](_0x37c280[_0x6ffc('0x26')]);_0x152444['filters']=_[_0x6ffc('0x2d')](_0x152444[_0x6ffc('0x2e')],_0x152444[_0x6ffc('0x26')]);_0x313cf5[_0x6ffc('0x30')]=_['intersection'](_0x152444[_0x6ffc('0x2e')],qs[_0x6ffc('0x2f')](_0x37c280[_0x6ffc('0x26')][_0x6ffc('0x2f')]));_0x313cf5[_0x6ffc('0x30')]=_0x313cf5[_0x6ffc('0x30')][_0x6ffc('0x31')]?_0x313cf5['attributes']:_0x152444['model'];_0x313cf5[_0x6ffc('0x4f')]=qs[_0x6ffc('0x41')](_0x37c280[_0x6ffc('0x26')]['sort']);_0x313cf5['where']=qs[_0x6ffc('0x2c')](_['pick'](_0x37c280[_0x6ffc('0x26')],_0x152444[_0x6ffc('0x2c')]));if(_0x37c280[_0x6ffc('0x26')][_0x6ffc('0x43')]){_0x313cf5['where']=_[_0x6ffc('0x33')](_0x313cf5[_0x6ffc('0x23')],{'$or':_[_0x6ffc('0x1e')](_0x313cf5[_0x6ffc('0x30')],function(_0x47a115){var _0x142fbe={};_0x142fbe[_0x47a115]={'$like':'%'+_0x37c280[_0x6ffc('0x26')][_0x6ffc('0x43')]+'%'};return _0x142fbe;})});}_0x313cf5=_[_0x6ffc('0x33')]({},_0x313cf5,_0x37c280[_0x6ffc('0x34')]);return _0x3dc2e1[_0x6ffc('0x50')](_0x313cf5);}})[_0x6ffc('0x16')](function(_0x3d78c3){if(_0x3d78c3){_0x1efe6d=_0x3d78c3['length'];if(!_0x37c280['query']['hasOwnProperty'](_0x6ffc('0x40'))){_0x313cf5['limit']=qs[_0x6ffc('0x11')](_0x37c280['query']['limit']);_0x313cf5[_0x6ffc('0xf')]=qs[_0x6ffc('0xf')](_0x37c280[_0x6ffc('0x26')][_0x6ffc('0xf')]);}return _0x3dc2e1[_0x6ffc('0x50')](_0x313cf5);}})[_0x6ffc('0x16')](function(_0x53a2bf){if(_0x53a2bf){return _0x53a2bf?{'count':_0x1efe6d,'rows':_0x53a2bf}:null;}})[_0x6ffc('0x16')](respondWithResult(_0x8af22f,null))[_0x6ffc('0x28')](handleError(_0x8af22f,null));};exports['addTeams']=function(_0x3730fe,_0x486215){var _0x47e0df=_0x3730fe['body'][_0x6ffc('0x51')];return db[_0x6ffc('0x4e')][_0x6ffc('0x27')]({'where':{'id':_0x47e0df},'attributes':['id'],'include':[{'model':db[_0x6ffc('0x52')],'as':'Agents','attributes':['id',_0x6ffc('0x1b'),'online',_0x6ffc('0x53'),_0x6ffc('0x54')],'raw':!![]}]})['then'](function(_0x5776d9){if(_0x5776d9){var _0x440489=_['flatMap'](_0x5776d9,function(_0xefb4c6){var _0x327bd9=_0xefb4c6[_0x6ffc('0x18')]({'plain':!![]});return _0x327bd9[_0x6ffc('0x55')];});return db[_0x6ffc('0x24')][_0x6ffc('0x56')]({'where':{'id':_0x3730fe[_0x6ffc('0x2a')]['id']}})['then'](function(_0x30a9be){return db[_0x6ffc('0x57')][_0x6ffc('0x58')](function(_0x2b201a){return _0x30a9be[_0x6ffc('0x59')](_0x47e0df,{'transaction':_0x2b201a})[_0x6ffc('0x16')](function(){return BPromise[_0x6ffc('0x5a')](_0x440489,function(_0x23ac96){return db[_0x6ffc('0x3e')][_0x6ffc('0x5b')]({'where':{'UserId':_0x23ac96['id'],'ChatQueueId':_0x3730fe[_0x6ffc('0x2a')]['id']},'transaction':_0x2b201a});});})['then'](function(){_0x440489[_0x6ffc('0x5c')](function(_0xeb6b15){socket[_0x6ffc('0x5d')](_0x6ffc('0x5e'),{'UserId':_0xeb6b15['id'],'ChatQueueId':_0x30a9be['id']});});});});});}})[_0x6ffc('0x16')](respondWithStatusCode(_0x486215,null))[_0x6ffc('0x28')](handleError(_0x486215,null));};exports[_0x6ffc('0x5f')]=function(_0x29654a,_0x3c61df){return db[_0x6ffc('0x4e')][_0x6ffc('0x27')]({'where':{'id':_0x29654a[_0x6ffc('0x26')][_0x6ffc('0x51')]},'attributes':['id'],'include':[{'model':db[_0x6ffc('0x52')],'as':_0x6ffc('0x55'),'attributes':['id'],'raw':!![]}]})[_0x6ffc('0x16')](handleEntityNotFound(_0x3c61df,null))['then'](function(_0x27751f){var _0x4c01fc=_[_0x6ffc('0x1e')](_0x27751f,'id');var _0x3fdae9=[];var _0x4c2095=[];var _0x195463=squel['select']();_0x195463[_0x6ffc('0x60')](_0x6ffc('0x61'))['from'](_0x6ffc('0x62'),'tq')['join'](_0x6ffc('0x63'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x6ffc('0x64'),_0x29654a['params']['id']);for(var _0x9f6a49=0x0;_0x9f6a49<_0x27751f[_0x6ffc('0x31')];_0x9f6a49+=0x1){let _0x3c680d=_0x27751f[_0x9f6a49];for(var _0x247458=0x0;_0x247458<_0x3c680d[_0x6ffc('0x55')][_0x6ffc('0x31')];_0x247458+=0x1){let _0x3c9de3=_0x3c680d['Agents'][_0x247458];var _0x45b91c=_0x195463['clone']();_0x45b91c[_0x6ffc('0x23')](_0x6ffc('0x65'),_0x3c9de3['id']);_0x4c2095[_0x6ffc('0x66')](db[_0x6ffc('0x57')][_0x6ffc('0x26')](_0x45b91c['toString'](),{'type':db[_0x6ffc('0x57')][_0x6ffc('0x67')][_0x6ffc('0x68')]})[_0x6ffc('0x16')](function(_0x4f0b9b){if(_0x4f0b9b[_0x6ffc('0x31')]===0x1){return _0x3c9de3['id'];}else{var _0x1ef497=_['every'](_['map'](_0x4f0b9b,_0x6ffc('0x69')),function(_0x12dc00){return _[_0x6ffc('0x6a')](_0x4c01fc,_0x12dc00);});if(_0x1ef497){return _0x3c9de3['id'];}}}));}}return BPromise[_0x6ffc('0x6b')](_0x4c2095)[_0x6ffc('0x16')](function(_0x335b03){_0x3fdae9=_(_0x3fdae9)['union'](_0x335b03)['compact']()[_0x6ffc('0x6c')]();return db[_0x6ffc('0x24')][_0x6ffc('0x56')]({'where':{'id':_0x29654a['params']['id']}})[_0x6ffc('0x16')](function(_0x1573d3){return db['sequelize']['transaction'](function(_0x355953){return _0x1573d3[_0x6ffc('0x5f')](_0x29654a[_0x6ffc('0x26')][_0x6ffc('0x51')],{'transaction':_0x355953})[_0x6ffc('0x16')](function(){if(!_[_0x6ffc('0x6d')](_0x3fdae9)){return _0x1573d3[_0x6ffc('0x6e')](_0x3fdae9,{'transaction':_0x355953});}})[_0x6ffc('0x16')](function(){_0x3fdae9[_0x6ffc('0x5c')](function(_0x3cb283){socket[_0x6ffc('0x5d')](_0x6ffc('0x6f'),{'UserId':_0x3cb283,'ChatQueueId':_0x1573d3['id']});});});});});});})[_0x6ffc('0x16')](respondWithStatusCode(_0x3c61df,null))[_0x6ffc('0x28')](handleError(_0x3c61df,null));};exports[_0x6ffc('0x70')]=function(_0x30ef9e,_0xa965e0){return db[_0x6ffc('0x24')][_0x6ffc('0x56')]({'where':{'id':_0x30ef9e['params']['id']}})['then'](handleEntityNotFound(_0xa965e0,null))[_0x6ffc('0x16')](function(_0x4e2d25){if(_0x4e2d25){return _0x4e2d25[_0x6ffc('0x70')](_0x30ef9e[_0x6ffc('0x36')][_0x6ffc('0x51')],_[_0x6ffc('0x71')](_0x30ef9e['body'],['ids','id'])||{})[_0x6ffc('0x72')](function(_0x49d5a7){for(var _0x14a24a=0x0;_0x14a24a<_0x30ef9e[_0x6ffc('0x36')][_0x6ffc('0x51')][_0x6ffc('0x31')];_0x14a24a+=0x1){socket[_0x6ffc('0x5d')](_0x6ffc('0x5e'),{'UserId':Number(_0x30ef9e['body'][_0x6ffc('0x51')][_0x14a24a]),'ChatQueueId':Number(_0x30ef9e[_0x6ffc('0x2a')]['id'])});}return _0x49d5a7;});}})[_0x6ffc('0x16')](respondWithResult(_0xa965e0,null))['catch'](handleError(_0xa965e0,null));};exports[_0x6ffc('0x6e')]=function(_0x59727e,_0x4cfabf){return db[_0x6ffc('0x24')][_0x6ffc('0x56')]({'where':{'id':_0x59727e[_0x6ffc('0x2a')]['id']}})[_0x6ffc('0x16')](handleEntityNotFound(_0x4cfabf,null))[_0x6ffc('0x16')](function(_0xc3b0fa){if(_0xc3b0fa){return _0xc3b0fa[_0x6ffc('0x6e')](_0x59727e['query'][_0x6ffc('0x51')])[_0x6ffc('0x16')](function(){if(_[_0x6ffc('0x73')](_0x59727e[_0x6ffc('0x26')]['ids'])){for(var _0x5634a0=0x0;_0x5634a0<_0x59727e[_0x6ffc('0x26')][_0x6ffc('0x51')][_0x6ffc('0x31')];_0x5634a0+=0x1){socket[_0x6ffc('0x5d')](_0x6ffc('0x6f'),{'UserId':Number(_0x59727e[_0x6ffc('0x26')][_0x6ffc('0x51')][_0x5634a0]),'ChatQueueId':Number(_0x59727e[_0x6ffc('0x2a')]['id'])});}}else{socket[_0x6ffc('0x5d')]('userChatQueue:remove',{'UserId':Number(_0x59727e[_0x6ffc('0x26')][_0x6ffc('0x51')]),'ChatQueueId':Number(_0x59727e[_0x6ffc('0x2a')]['id'])});}});}})['then'](respondWithStatusCode(_0x4cfabf,null))[_0x6ffc('0x28')](handleError(_0x4cfabf,null));};exports['getAgents']=function(_0x2c7f5c,_0x389c39){var _0xeb4681={};var _0x31e9f3={};var _0x18373b;var _0xa9d16c;return db[_0x6ffc('0x24')][_0x6ffc('0x74')]({'where':{'id':_0x2c7f5c[_0x6ffc('0x2a')]['id']}})[_0x6ffc('0x16')](handleEntityNotFound(_0x389c39,null))['then'](function(_0x4bfe33){if(_0x4bfe33){_0x18373b=_0x4bfe33;_0x31e9f3['model']=_[_0x6ffc('0x2b')](db['User'][_0x6ffc('0x1f')]);_0x31e9f3[_0x6ffc('0x26')]=_[_0x6ffc('0x2b')](_0x2c7f5c[_0x6ffc('0x26')]);_0x31e9f3[_0x6ffc('0x2c')]=_[_0x6ffc('0x2d')](_0x31e9f3[_0x6ffc('0x2e')],_0x31e9f3[_0x6ffc('0x26')]);_0xeb4681[_0x6ffc('0x30')]=_['intersection'](_0x31e9f3['model'],qs[_0x6ffc('0x2f')](_0x2c7f5c[_0x6ffc('0x26')][_0x6ffc('0x2f')]));_0xeb4681[_0x6ffc('0x30')]=_0xeb4681[_0x6ffc('0x30')][_0x6ffc('0x31')]?_0xeb4681['attributes']:_0x31e9f3[_0x6ffc('0x2e')];_0xeb4681[_0x6ffc('0x4f')]=qs[_0x6ffc('0x41')](_0x2c7f5c[_0x6ffc('0x26')][_0x6ffc('0x41')]);_0xeb4681[_0x6ffc('0x23')]=qs[_0x6ffc('0x2c')](_[_0x6ffc('0x42')](_0x2c7f5c[_0x6ffc('0x26')],_0x31e9f3[_0x6ffc('0x2c')]));if(_0x2c7f5c['query']['filter']){_0xeb4681[_0x6ffc('0x23')]=_[_0x6ffc('0x33')](_0xeb4681['where'],{'$or':_['map'](_0xeb4681[_0x6ffc('0x30')],function(_0x48062b){var _0x44de17={};_0x44de17[_0x48062b]={'$like':'%'+_0x2c7f5c[_0x6ffc('0x26')][_0x6ffc('0x43')]+'%'};return _0x44de17;})});}_0xeb4681=_[_0x6ffc('0x33')]({},_0xeb4681,_0x2c7f5c['options']);return _0x18373b[_0x6ffc('0x75')](_0xeb4681);}})['then'](function(_0x1f677d){if(_0x1f677d){_0xa9d16c=_0x1f677d[_0x6ffc('0x31')];if(!_0x2c7f5c['query']['hasOwnProperty'](_0x6ffc('0x40'))){_0xeb4681[_0x6ffc('0x11')]=qs[_0x6ffc('0x11')](_0x2c7f5c[_0x6ffc('0x26')]['limit']);_0xeb4681[_0x6ffc('0xf')]=qs[_0x6ffc('0xf')](_0x2c7f5c['query'][_0x6ffc('0xf')]);}return _0x18373b['getAgents'](_0xeb4681);}})[_0x6ffc('0x16')](function(_0x17a0e9){if(_0x17a0e9){return _0x17a0e9?{'count':_0xa9d16c,'rows':_0x17a0e9}:null;}})[_0x6ffc('0x16')](respondWithResult(_0x389c39,null))[_0x6ffc('0x28')](handleError(_0x389c39,null));}; \ No newline at end of file +var _0x271c=['where','include','query','findAll','rows','catch','show','model','keys','filters','intersection','fields','attributes','length','includeAll','merge','options','find','create','body','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','nolimit','limit','sort','ChatQueueId','filter','findAndCountAll','UserId','agent','format','%s/%s','SIP','chatPause','createdAt','updatedAt','Team','order','pick','getTeams','addTeams','User','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','ids','select','field','tq.TeamId','from','team_has_chat_queues','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','value','removeTeams','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','userChatQueue:save','isArray','getAgents','bluebird','util','squel','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatQueue.socket','register','sendStatus','status','end','undefined','count','offset','set','then','destroy','get','ChatQueues','UserProfileResource','error','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','getOptions'];(function(_0x261e36,_0x1d284f){var _0x40f5a5=function(_0xb53476){while(--_0xb53476){_0x261e36['push'](_0x261e36['shift']());}};_0x40f5a5(++_0x1d284f);}(_0x271c,0x156));var _0xc271=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x271c[_0x4565bf];return _0x5610ba;};'use strict';var BPromise=require(_0xc271('0x0'));var util=require(_0xc271('0x1'));var _=require('lodash');var squel=require(_0xc271('0x2'));var Redis=require(_0xc271('0x3'));var qs=require(_0xc271('0x4'));var logger=require(_0xc271('0x5'))('api');var config=require(_0xc271('0x6'));var db=require(_0xc271('0x7'))['db'];config[_0xc271('0x8')]=_['defaults'](config['redis'],{'host':_0xc271('0x9'),'port':0x18eb});var socket=require(_0xc271('0xa'))(new Redis(config[_0xc271('0x8')]));require(_0xc271('0xb'))[_0xc271('0xc')](socket);function respondWithStatusCode(_0x2b6169,_0x26102f){_0x26102f=_0x26102f||0xcc;return function(_0x5607b7){if(_0x5607b7){return _0x2b6169[_0xc271('0xd')](_0x26102f);}return _0x2b6169[_0xc271('0xe')](_0x26102f)[_0xc271('0xf')]();};}function respondWithResult(_0x5b79e3,_0x11d837){_0x11d837=_0x11d837||0xc8;return function(_0x10202c){if(_0x10202c){return _0x5b79e3[_0xc271('0xe')](_0x11d837)['json'](_0x10202c);}};}function respondWithFilteredResult(_0x36757b,_0x11d740){return function(_0x19d609){if(_0x19d609){var _0x4c1414=typeof _0x11d740['offset']===_0xc271('0x10')&&typeof _0x11d740['limit']===_0xc271('0x10');var _0x445c84=_0x19d609[_0xc271('0x11')];var _0x163fcc=_0x4c1414?0x0:_0x11d740['offset'];var _0x763f52=_0x4c1414?_0x19d609[_0xc271('0x11')]:_0x11d740[_0xc271('0x12')]+_0x11d740['limit'];var _0x54cab9;if(_0x763f52>=_0x445c84){_0x763f52=_0x445c84;_0x54cab9=0xc8;}else{_0x54cab9=0xce;}_0x36757b[_0xc271('0xe')](_0x54cab9);return _0x36757b[_0xc271('0x13')]('Content-Range',_0x163fcc+'-'+_0x763f52+'/'+_0x445c84)['json'](_0x19d609);}return null;};}function saveUpdates(_0x5c48d6){return function(_0x210a11){if(_0x210a11){return _0x210a11['update'](_0x5c48d6)[_0xc271('0x14')](function(_0x3f890f){return _0x3f890f;});}return null;};}function removeEntity(_0x40deec){return function(_0x3a8691){if(_0x3a8691){return _0x3a8691[_0xc271('0x15')]()[_0xc271('0x14')](function(){var _0x1132ee=_0x3a8691[_0xc271('0x16')]({'plain':!![]});var _0x48c591=_0xc271('0x17');return db[_0xc271('0x18')][_0xc271('0x15')]({'where':{'type':_0x48c591,'resourceId':_0x1132ee['id']}})[_0xc271('0x14')](function(){return _0x3a8691;});})[_0xc271('0x14')](function(){_0x40deec[_0xc271('0xe')](0xcc)[_0xc271('0xf')]();});}};}function handleEntityNotFound(_0x3909e8){return function(_0x5249f8){if(!_0x5249f8){_0x3909e8['sendStatus'](0x194);}return _0x5249f8;};}function handleError(_0x5c7d0b,_0x21254f){_0x21254f=_0x21254f||0x1f4;return function(_0x4e7320){logger[_0xc271('0x19')](_0x4e7320[_0xc271('0x1a')]);if(_0x4e7320[_0xc271('0x1b')]){delete _0x4e7320[_0xc271('0x1b')];}_0x5c7d0b['status'](_0x21254f)[_0xc271('0x1c')](_0x4e7320);};}exports[_0xc271('0x1d')]=function(_0x347c16,_0xbd806e){var _0x116bf1={};var _0x12048b={'count':0x0,'rows':[]};var _0x34bccc=_[_0xc271('0x1e')](db[_0xc271('0x1f')][_0xc271('0x20')],function(_0x356254){return{'name':_0x356254[_0xc271('0x21')],'type':_0x356254['type'][_0xc271('0x22')]};});_0x116bf1=qs[_0xc271('0x23')](_0x34bccc,_0x347c16);var _0x2bc7cc={'where':_0x116bf1[_0xc271('0x24')]};return db[_0xc271('0x1f')][_0xc271('0x11')](_0x2bc7cc)[_0xc271('0x14')](function(_0x44800a){_0x12048b[_0xc271('0x11')]=_0x44800a;_0x116bf1[_0xc271('0x25')]=qs['include'](_0x347c16[_0xc271('0x26')]);return db[_0xc271('0x1f')][_0xc271('0x27')](_0x116bf1);})['then'](function(_0x43aec7){_0x12048b[_0xc271('0x28')]=_0x43aec7;return _0x12048b;})[_0xc271('0x14')](respondWithFilteredResult(_0xbd806e,_0x116bf1))[_0xc271('0x29')](handleError(_0xbd806e,null));};exports[_0xc271('0x2a')]=function(_0x4f1140,_0x41501f){var _0x531d6f={'raw':!![],'where':{'id':_0x4f1140['params']['id']}},_0x5b3c9c={};_0x5b3c9c[_0xc271('0x2b')]=_['keys'](db[_0xc271('0x1f')]['rawAttributes']);_0x5b3c9c[_0xc271('0x26')]=_[_0xc271('0x2c')](_0x4f1140['query']);_0x5b3c9c[_0xc271('0x2d')]=_['intersection'](_0x5b3c9c[_0xc271('0x2b')],_0x5b3c9c[_0xc271('0x26')]);_0x531d6f['attributes']=_[_0xc271('0x2e')](_0x5b3c9c['model'],qs['fields'](_0x4f1140[_0xc271('0x26')][_0xc271('0x2f')]));_0x531d6f[_0xc271('0x30')]=_0x531d6f[_0xc271('0x30')][_0xc271('0x31')]?_0x531d6f[_0xc271('0x30')]:_0x5b3c9c[_0xc271('0x2b')];if(_0x4f1140[_0xc271('0x26')][_0xc271('0x32')]){_0x531d6f[_0xc271('0x25')]=[{'all':!![]}];}_0x531d6f=_[_0xc271('0x33')]({},_0x531d6f,_0x4f1140[_0xc271('0x34')]);return db[_0xc271('0x1f')][_0xc271('0x35')](_0x531d6f)['then'](handleEntityNotFound(_0x41501f,null))[_0xc271('0x14')](respondWithResult(_0x41501f,null))[_0xc271('0x29')](handleError(_0x41501f,null));};exports[_0xc271('0x36')]=function(_0x1f4dd2,_0xf3c77d){return db[_0xc271('0x1f')][_0xc271('0x36')](_0x1f4dd2[_0xc271('0x37')],{})[_0xc271('0x14')](function(_0x2b9fba){var _0x1e052=_0x1f4dd2[_0xc271('0x38')][_0xc271('0x16')]({'plain':!![]});if(!_0x1e052)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e052['role']===_0xc271('0x38')){var _0x3f79c2=_0x2b9fba['get']({'plain':!![]});var _0x482ea8='ChatQueues';return db[_0xc271('0x39')][_0xc271('0x35')]({'where':{'name':_0x482ea8,'userProfileId':_0x1e052['userProfileId']},'raw':!![]})[_0xc271('0x14')](function(_0x2cbc59){if(_0x2cbc59&&_0x2cbc59[_0xc271('0x3a')]===0x0){return db[_0xc271('0x18')][_0xc271('0x36')]({'name':_0x3f79c2['name'],'resourceId':_0x3f79c2['id'],'type':_0x2cbc59[_0xc271('0x1b')],'sectionId':_0x2cbc59['id']},{})[_0xc271('0x14')](function(){return _0x2b9fba;});}else{return _0x2b9fba;}})[_0xc271('0x29')](function(_0x224fb4){logger[_0xc271('0x19')](_0xc271('0x3b'),_0x224fb4);throw _0x224fb4;});}return _0x2b9fba;})[_0xc271('0x14')](respondWithResult(_0xf3c77d,0xc9))[_0xc271('0x29')](handleError(_0xf3c77d,null));};exports[_0xc271('0x3c')]=function(_0x48fce3,_0x227b9e){if(_0x48fce3[_0xc271('0x37')]['id']){delete _0x48fce3[_0xc271('0x37')]['id'];}return db['ChatQueue']['find']({'where':{'id':_0x48fce3[_0xc271('0x3d')]['id']}})[_0xc271('0x14')](handleEntityNotFound(_0x227b9e,null))[_0xc271('0x14')](saveUpdates(_0x48fce3[_0xc271('0x37')],null))[_0xc271('0x14')](respondWithResult(_0x227b9e,null))[_0xc271('0x29')](handleError(_0x227b9e,null));};exports[_0xc271('0x15')]=function(_0x186cd8,_0x5f1171){return db[_0xc271('0x1f')]['find']({'where':{'id':_0x186cd8['params']['id']}})[_0xc271('0x14')](handleEntityNotFound(_0x5f1171,null))[_0xc271('0x14')](removeEntity(_0x5f1171,null))['catch'](handleError(_0x5f1171,null));};exports[_0xc271('0x3e')]=function(_0x2affa8,_0x43233c){return db[_0xc271('0x1f')][_0xc271('0x3e')]()[_0xc271('0x14')](respondWithResult(_0x43233c,null))[_0xc271('0x29')](handleError(_0x43233c,null));};exports[_0xc271('0x3f')]=function(_0x51d3ac,_0x2c5c96){var _0x320db3={'raw':!![],'where':{}},_0x5898f5={},_0x3cc029;return db['ChatQueue'][_0xc271('0x40')]({'where':{'id':_0x51d3ac[_0xc271('0x3d')]['id']}})[_0xc271('0x14')](handleEntityNotFound(_0x2c5c96,null))[_0xc271('0x14')](function(_0x146e33){if(_0x146e33){_0x3cc029=_0x146e33['get']({'plain':!![]});_0x5898f5[_0xc271('0x2b')]=_[_0xc271('0x2c')](db[_0xc271('0x41')][_0xc271('0x20')]);_0x5898f5[_0xc271('0x26')]=_[_0xc271('0x2c')](_0x51d3ac['query']);_0x5898f5[_0xc271('0x2d')]=_['intersection'](_0x5898f5[_0xc271('0x2b')],_0x5898f5['query']);_0x320db3['attributes']=_[_0xc271('0x2e')](_0x5898f5[_0xc271('0x2b')],qs[_0xc271('0x2f')](_0x51d3ac[_0xc271('0x26')]['fields']));_0x320db3['attributes']=_0x320db3[_0xc271('0x30')]['length']?_0x320db3[_0xc271('0x30')]:_0x5898f5['model'];if(!_0x51d3ac[_0xc271('0x26')][_0xc271('0x42')](_0xc271('0x43'))){_0x320db3[_0xc271('0x44')]=qs[_0xc271('0x44')](_0x51d3ac[_0xc271('0x26')]['limit']);_0x320db3[_0xc271('0x12')]=qs[_0xc271('0x12')](_0x51d3ac[_0xc271('0x26')][_0xc271('0x12')]);}_0x320db3['order']=qs['sort'](_0x51d3ac[_0xc271('0x26')][_0xc271('0x45')]);_0x320db3[_0xc271('0x24')]=qs[_0xc271('0x2d')](_['pick'](_0x51d3ac['query'],_0x5898f5[_0xc271('0x2d')]));_0x320db3[_0xc271('0x24')][_0xc271('0x46')]=_0x146e33['id'];if(_0x51d3ac[_0xc271('0x26')][_0xc271('0x47')]){_0x320db3[_0xc271('0x24')]=_[_0xc271('0x33')](_0x320db3[_0xc271('0x24')],{'$or':_[_0xc271('0x1e')](_0x320db3[_0xc271('0x30')],function(_0xfa84b8){var _0x508b2f={};_0x508b2f[_0xfa84b8]={'$like':'%'+_0x51d3ac[_0xc271('0x26')][_0xc271('0x47')]+'%'};return _0x508b2f;})});}_0x320db3=_[_0xc271('0x33')]({},_0x320db3,_0x51d3ac[_0xc271('0x34')]);return db[_0xc271('0x41')]['findAll'](_0x320db3);}})['then'](function(_0xf8987e){if(_0xf8987e){return db['User'][_0xc271('0x48')]({'where':{'id':_[_0xc271('0x1e')](_0xf8987e,_0xc271('0x49')),'role':_0xc271('0x4a')},'attributes':['id',_0xc271('0x1b'),'chatPause','updatedAt','createdAt']});}})[_0xc271('0x14')](function(_0x61ed2f){if(_0x61ed2f){return{'count':_0x61ed2f[_0xc271('0x11')],'rows':_[_0xc271('0x1e')](_0x61ed2f['rows'],function(_0x2536d8){return{'membername':_0x2536d8['name'],'UserId':_0x2536d8['id'],'queue_name':_0x3cc029[_0xc271('0x1b')],'ChatQueueId':_0x3cc029['id'],'interface':util[_0xc271('0x4b')](_0xc271('0x4c'),_0xc271('0x4d'),_0x2536d8[_0xc271('0x1b')]),'penalty':0x0,'paused':_0x2536d8[_0xc271('0x4e')],'createdAt':_0x2536d8[_0xc271('0x4f')],'updatedAt':_0x2536d8[_0xc271('0x50')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc271('0x14')](respondWithFilteredResult(_0x2c5c96,_0x320db3))[_0xc271('0x29')](handleError(_0x2c5c96,null));};exports['getTeams']=function(_0x16ce6a,_0x4a02e2){var _0x208efe={};var _0x44519f={};var _0x351333;var _0x128291;return db[_0xc271('0x1f')]['findOne']({'where':{'id':_0x16ce6a[_0xc271('0x3d')]['id']}})[_0xc271('0x14')](handleEntityNotFound(_0x4a02e2,null))[_0xc271('0x14')](function(_0x3aa4d8){if(_0x3aa4d8){_0x351333=_0x3aa4d8;_0x44519f[_0xc271('0x2b')]=_[_0xc271('0x2c')](db[_0xc271('0x51')][_0xc271('0x20')]);_0x44519f[_0xc271('0x26')]=_[_0xc271('0x2c')](_0x16ce6a[_0xc271('0x26')]);_0x44519f['filters']=_[_0xc271('0x2e')](_0x44519f[_0xc271('0x2b')],_0x44519f[_0xc271('0x26')]);_0x208efe[_0xc271('0x30')]=_[_0xc271('0x2e')](_0x44519f[_0xc271('0x2b')],qs[_0xc271('0x2f')](_0x16ce6a['query'][_0xc271('0x2f')]));_0x208efe[_0xc271('0x30')]=_0x208efe['attributes'][_0xc271('0x31')]?_0x208efe[_0xc271('0x30')]:_0x44519f[_0xc271('0x2b')];_0x208efe[_0xc271('0x52')]=qs[_0xc271('0x45')](_0x16ce6a[_0xc271('0x26')][_0xc271('0x45')]);_0x208efe['where']=qs[_0xc271('0x2d')](_[_0xc271('0x53')](_0x16ce6a[_0xc271('0x26')],_0x44519f[_0xc271('0x2d')]));if(_0x16ce6a['query'][_0xc271('0x47')]){_0x208efe['where']=_['merge'](_0x208efe[_0xc271('0x24')],{'$or':_[_0xc271('0x1e')](_0x208efe[_0xc271('0x30')],function(_0x5ef708){var _0x1bf4d7={};_0x1bf4d7[_0x5ef708]={'$like':'%'+_0x16ce6a[_0xc271('0x26')][_0xc271('0x47')]+'%'};return _0x1bf4d7;})});}_0x208efe=_['merge']({},_0x208efe,_0x16ce6a['options']);return _0x351333[_0xc271('0x54')](_0x208efe);}})[_0xc271('0x14')](function(_0x387e8b){if(_0x387e8b){_0x128291=_0x387e8b[_0xc271('0x31')];if(!_0x16ce6a[_0xc271('0x26')][_0xc271('0x42')](_0xc271('0x43'))){_0x208efe[_0xc271('0x44')]=qs[_0xc271('0x44')](_0x16ce6a[_0xc271('0x26')][_0xc271('0x44')]);_0x208efe['offset']=qs[_0xc271('0x12')](_0x16ce6a[_0xc271('0x26')]['offset']);}return _0x351333['getTeams'](_0x208efe);}})[_0xc271('0x14')](function(_0x28a5fa){if(_0x28a5fa){return _0x28a5fa?{'count':_0x128291,'rows':_0x28a5fa}:null;}})[_0xc271('0x14')](respondWithResult(_0x4a02e2,null))[_0xc271('0x29')](handleError(_0x4a02e2,null));};exports[_0xc271('0x55')]=function(_0x15c561,_0x55394c){var _0x2c9e8b=_0x15c561[_0xc271('0x37')]['ids'];return db[_0xc271('0x51')]['findAll']({'where':{'id':_0x2c9e8b},'attributes':['id'],'include':[{'model':db[_0xc271('0x56')],'as':_0xc271('0x57'),'attributes':['id',_0xc271('0x1b'),_0xc271('0x58'),_0xc271('0x59'),_0xc271('0x5a')],'raw':!![]}]})[_0xc271('0x14')](function(_0x1440f2){if(_0x1440f2){var _0x18fa0d=_[_0xc271('0x5b')](_0x1440f2,function(_0x345b16){var _0x3d980c=_0x345b16['get']({'plain':!![]});return _0x3d980c[_0xc271('0x57')];});return db[_0xc271('0x1f')]['find']({'where':{'id':_0x15c561[_0xc271('0x3d')]['id']}})[_0xc271('0x14')](function(_0x19b19a){return db['sequelize'][_0xc271('0x5c')](function(_0x119d6b){return _0x19b19a[_0xc271('0x55')](_0x2c9e8b,{'transaction':_0x119d6b})[_0xc271('0x14')](function(){return BPromise[_0xc271('0x5d')](_0x18fa0d,function(_0x345075){return db[_0xc271('0x41')][_0xc271('0x5e')]({'where':{'UserId':_0x345075['id'],'ChatQueueId':_0x15c561['params']['id']},'transaction':_0x119d6b});});})[_0xc271('0x14')](function(){_0x18fa0d[_0xc271('0x5f')](function(_0x2c8726){socket['emit']('userChatQueue:save',{'UserId':_0x2c8726['id'],'ChatQueueId':_0x19b19a['id']});});});});});}})[_0xc271('0x14')](respondWithStatusCode(_0x55394c,null))[_0xc271('0x29')](handleError(_0x55394c,null));};exports['removeTeams']=function(_0x1da0c6,_0xe297a5){return db['Team'][_0xc271('0x27')]({'where':{'id':_0x1da0c6['query'][_0xc271('0x60')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc271('0x57'),'attributes':['id'],'raw':!![]}]})[_0xc271('0x14')](handleEntityNotFound(_0xe297a5,null))[_0xc271('0x14')](function(_0x3d9476){var _0x2d9be8=_['map'](_0x3d9476,'id');var _0x3f5575=[];var _0x3e2c39=[];var _0x22c1e8=squel[_0xc271('0x61')]();_0x22c1e8[_0xc271('0x62')](_0xc271('0x63'))[_0xc271('0x64')](_0xc271('0x65'),'tq')['join'](_0xc271('0x66'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc271('0x24')](_0xc271('0x67'),_0x1da0c6[_0xc271('0x3d')]['id']);for(var _0xe9989c=0x0;_0xe9989c<_0x3d9476[_0xc271('0x31')];_0xe9989c+=0x1){let _0x12257d=_0x3d9476[_0xe9989c];for(var _0x2f91e4=0x0;_0x2f91e4<_0x12257d['Agents'][_0xc271('0x31')];_0x2f91e4+=0x1){let _0x2f03c9=_0x12257d['Agents'][_0x2f91e4];var _0x1d41c8=_0x22c1e8[_0xc271('0x68')]();_0x1d41c8['where'](_0xc271('0x69'),_0x2f03c9['id']);_0x3e2c39['push'](db['sequelize'][_0xc271('0x26')](_0x1d41c8['toString'](),{'type':db[_0xc271('0x6a')][_0xc271('0x6b')][_0xc271('0x6c')]})[_0xc271('0x14')](function(_0x27c378){if(_0x27c378['length']===0x1){return _0x2f03c9['id'];}else{var _0x13aa51=_[_0xc271('0x6d')](_['map'](_0x27c378,_0xc271('0x6e')),function(_0x1fee1e){return _[_0xc271('0x6f')](_0x2d9be8,_0x1fee1e);});if(_0x13aa51){return _0x2f03c9['id'];}}}));}}return BPromise[_0xc271('0x70')](_0x3e2c39)[_0xc271('0x14')](function(_0x362ee3){_0x3f5575=_(_0x3f5575)[_0xc271('0x71')](_0x362ee3)['compact']()[_0xc271('0x72')]();return db[_0xc271('0x1f')][_0xc271('0x35')]({'where':{'id':_0x1da0c6[_0xc271('0x3d')]['id']}})[_0xc271('0x14')](function(_0x4a7dd3){return db['sequelize'][_0xc271('0x5c')](function(_0xa8332f){return _0x4a7dd3[_0xc271('0x73')](_0x1da0c6[_0xc271('0x26')][_0xc271('0x60')],{'transaction':_0xa8332f})[_0xc271('0x14')](function(){if(!_[_0xc271('0x74')](_0x3f5575)){return _0x4a7dd3[_0xc271('0x75')](_0x3f5575,{'transaction':_0xa8332f});}})[_0xc271('0x14')](function(){_0x3f5575[_0xc271('0x5f')](function(_0x2954f3){socket[_0xc271('0x76')](_0xc271('0x77'),{'UserId':_0x2954f3,'ChatQueueId':_0x4a7dd3['id']});});});});});});})['then'](respondWithStatusCode(_0xe297a5,null))[_0xc271('0x29')](handleError(_0xe297a5,null));};exports['addAgents']=function(_0x3ed1da,_0x3788b2){return db['ChatQueue'][_0xc271('0x35')]({'where':{'id':_0x3ed1da[_0xc271('0x3d')]['id']}})[_0xc271('0x14')](handleEntityNotFound(_0x3788b2,null))[_0xc271('0x14')](function(_0x358d6f){if(_0x358d6f){return _0x358d6f[_0xc271('0x78')](_0x3ed1da[_0xc271('0x37')][_0xc271('0x60')],_[_0xc271('0x79')](_0x3ed1da[_0xc271('0x37')],[_0xc271('0x60'),'id'])||{})[_0xc271('0x7a')](function(_0x3727da){for(var _0x4859b3=0x0;_0x4859b3<_0x3ed1da[_0xc271('0x37')][_0xc271('0x60')][_0xc271('0x31')];_0x4859b3+=0x1){socket[_0xc271('0x76')](_0xc271('0x7b'),{'UserId':Number(_0x3ed1da[_0xc271('0x37')]['ids'][_0x4859b3]),'ChatQueueId':Number(_0x3ed1da['params']['id'])});}return _0x3727da;});}})[_0xc271('0x14')](respondWithResult(_0x3788b2,null))[_0xc271('0x29')](handleError(_0x3788b2,null));};exports['removeAgents']=function(_0x5ed932,_0x3dcf22){return db[_0xc271('0x1f')][_0xc271('0x35')]({'where':{'id':_0x5ed932['params']['id']}})[_0xc271('0x14')](handleEntityNotFound(_0x3dcf22,null))[_0xc271('0x14')](function(_0x6baddc){if(_0x6baddc){return _0x6baddc[_0xc271('0x75')](_0x5ed932[_0xc271('0x26')][_0xc271('0x60')])[_0xc271('0x14')](function(){if(_[_0xc271('0x7c')](_0x5ed932['query'][_0xc271('0x60')])){for(var _0x1ab8a8=0x0;_0x1ab8a8<_0x5ed932[_0xc271('0x26')][_0xc271('0x60')]['length'];_0x1ab8a8+=0x1){socket[_0xc271('0x76')](_0xc271('0x77'),{'UserId':Number(_0x5ed932[_0xc271('0x26')][_0xc271('0x60')][_0x1ab8a8]),'ChatQueueId':Number(_0x5ed932[_0xc271('0x3d')]['id'])});}}else{socket[_0xc271('0x76')](_0xc271('0x77'),{'UserId':Number(_0x5ed932[_0xc271('0x26')]['ids']),'ChatQueueId':Number(_0x5ed932[_0xc271('0x3d')]['id'])});}});}})[_0xc271('0x14')](respondWithStatusCode(_0x3dcf22,null))['catch'](handleError(_0x3dcf22,null));};exports[_0xc271('0x7d')]=function(_0x23b120,_0x12eda0){var _0xf8a161={};var _0xe4f7b8={};var _0xad6455;var _0x552e75;return db[_0xc271('0x1f')][_0xc271('0x40')]({'where':{'id':_0x23b120['params']['id']}})[_0xc271('0x14')](handleEntityNotFound(_0x12eda0,null))[_0xc271('0x14')](function(_0x33fe7e){if(_0x33fe7e){_0xad6455=_0x33fe7e;_0xe4f7b8[_0xc271('0x2b')]=_[_0xc271('0x2c')](db[_0xc271('0x56')]['rawAttributes']);_0xe4f7b8[_0xc271('0x26')]=_[_0xc271('0x2c')](_0x23b120[_0xc271('0x26')]);_0xe4f7b8[_0xc271('0x2d')]=_[_0xc271('0x2e')](_0xe4f7b8[_0xc271('0x2b')],_0xe4f7b8[_0xc271('0x26')]);_0xf8a161[_0xc271('0x30')]=_['intersection'](_0xe4f7b8[_0xc271('0x2b')],qs[_0xc271('0x2f')](_0x23b120[_0xc271('0x26')][_0xc271('0x2f')]));_0xf8a161[_0xc271('0x30')]=_0xf8a161[_0xc271('0x30')][_0xc271('0x31')]?_0xf8a161[_0xc271('0x30')]:_0xe4f7b8['model'];_0xf8a161[_0xc271('0x52')]=qs[_0xc271('0x45')](_0x23b120[_0xc271('0x26')][_0xc271('0x45')]);_0xf8a161[_0xc271('0x24')]=qs[_0xc271('0x2d')](_[_0xc271('0x53')](_0x23b120[_0xc271('0x26')],_0xe4f7b8['filters']));if(_0x23b120[_0xc271('0x26')][_0xc271('0x47')]){_0xf8a161['where']=_[_0xc271('0x33')](_0xf8a161[_0xc271('0x24')],{'$or':_[_0xc271('0x1e')](_0xf8a161[_0xc271('0x30')],function(_0x3d890e){var _0x4f0c1d={};_0x4f0c1d[_0x3d890e]={'$like':'%'+_0x23b120['query'][_0xc271('0x47')]+'%'};return _0x4f0c1d;})});}_0xf8a161=_[_0xc271('0x33')]({},_0xf8a161,_0x23b120[_0xc271('0x34')]);return _0xad6455[_0xc271('0x7d')](_0xf8a161);}})[_0xc271('0x14')](function(_0x2e25ed){if(_0x2e25ed){_0x552e75=_0x2e25ed[_0xc271('0x31')];if(!_0x23b120['query']['hasOwnProperty'](_0xc271('0x43'))){_0xf8a161[_0xc271('0x44')]=qs['limit'](_0x23b120[_0xc271('0x26')][_0xc271('0x44')]);_0xf8a161['offset']=qs[_0xc271('0x12')](_0x23b120[_0xc271('0x26')][_0xc271('0x12')]);}return _0xad6455[_0xc271('0x7d')](_0xf8a161);}})['then'](function(_0x3b8d03){if(_0x3b8d03){return _0x3b8d03?{'count':_0x552e75,'rows':_0x3b8d03}:null;}})[_0xc271('0x14')](respondWithResult(_0x12eda0,null))[_0xc271('0x29')](handleError(_0x12eda0,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index e5cdd38..9cd08f4 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 _0xff16=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x641ccb,_0x311d8c){var _0xeb5d0f=function(_0x3f9072){while(--_0x3f9072){_0x641ccb['push'](_0x641ccb['shift']());}};_0xeb5d0f(++_0x311d8c);}(_0xff16,0x7f));var _0x6ff1=function(_0x3b4f53,_0x57620c){_0x3b4f53=_0x3b4f53-0x0;var _0x258204=_0xff16[_0x3b4f53];return _0x258204;};'use strict';var EventEmitter=require(_0x6ff1('0x0'));var ChatQueue=require(_0x6ff1('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x6ff1('0x2')](0x0);var events={'afterCreate':_0x6ff1('0x3'),'afterUpdate':_0x6ff1('0x4'),'afterDestroy':_0x6ff1('0x5')};function emitEvent(_0x3f3c60){return function(_0x3f53b2,_0x3e4c94,_0x18be1c){ChatQueueEvents['emit'](_0x3f3c60+':'+_0x3f53b2['id'],_0x3f53b2);ChatQueueEvents[_0x6ff1('0x6')](_0x3f3c60,_0x3f53b2);_0x18be1c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x6ff1('0x7')](e,emitEvent(event));}}module[_0x6ff1('0x8')]=ChatQueueEvents; \ No newline at end of file +var _0x7188=['hasOwnProperty','hook','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x7bf686,_0x4c445e){var _0x3c47bc=function(_0x2ecd47){while(--_0x2ecd47){_0x7bf686['push'](_0x7bf686['shift']());}};_0x3c47bc(++_0x4c445e);}(_0x7188,0x172));var _0x8718=function(_0x3da241,_0xeba26a){_0x3da241=_0x3da241-0x0;var _0x43e156=_0x7188[_0x3da241];return _0x43e156;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x8718('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x8718('0x1')](0x0);var events={'afterCreate':_0x8718('0x2'),'afterUpdate':_0x8718('0x3'),'afterDestroy':_0x8718('0x4')};function emitEvent(_0x1020ae){return function(_0x200595,_0x48fa22,_0xedcd4d){ChatQueueEvents[_0x8718('0x5')](_0x1020ae+':'+_0x200595['id'],_0x200595);ChatQueueEvents['emit'](_0x1020ae,_0x200595);_0xedcd4d(null);};}for(var e in events){if(events[_0x8718('0x6')](e)){var event=events[e];ChatQueue[_0x8718('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index d61fe99..a8197c6 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 _0xf1e1=['path','rimraf','../../config/environment','exports','define','ChatQueue','lodash','api','bluebird'];(function(_0x229105,_0x209fa6){var _0x28a88f=function(_0x40caf3){while(--_0x40caf3){_0x229105['push'](_0x229105['shift']());}};_0x28a88f(++_0x209fa6);}(_0xf1e1,0x192));var _0x1f1e=function(_0x3f994d,_0x249d72){_0x3f994d=_0x3f994d-0x0;var _0x5309b4=_0xf1e1[_0x3f994d];return _0x5309b4;};'use strict';var _=require(_0x1f1e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1f1e('0x1'));var moment=require('moment');var BPromise=require(_0x1f1e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1f1e('0x3'));var rimraf=require(_0x1f1e('0x4'));var config=require(_0x1f1e('0x5'));var attributes=require('./chatQueue.attributes');module[_0x1f1e('0x6')]=function(_0x4a7db9,_0x255deb){return _0x4a7db9[_0x1f1e('0x7')](_0x1f1e('0x8'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7fbd=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./chatQueue.attributes','define','ChatQueue','chat_queues'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7fbd,0xfc));var _0xd7fb=function(_0x1d4760,_0x5a58e7){_0x1d4760=_0x1d4760-0x0;var _0x233074=_0x7fbd[_0x1d4760];return _0x233074;};'use strict';var _=require(_0xd7fb('0x0'));var util=require(_0xd7fb('0x1'));var logger=require(_0xd7fb('0x2'))(_0xd7fb('0x3'));var moment=require(_0xd7fb('0x4'));var BPromise=require(_0xd7fb('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd7fb('0x6'));var rimraf=require(_0xd7fb('0x7'));var config=require('../../config/environment');var attributes=require(_0xd7fb('0x8'));module['exports']=function(_0x1eaa7a,_0x229e6f){return _0x1eaa7a[_0xd7fb('0x9')](_0xd7fb('0xa'),attributes,{'tableName':_0xd7fb('0xb'),'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 fb38eba..c6d531f 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 _0x47cb=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','ChatQueue','findAll','options','where','include','map','model','attributes','then','ShowChatQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x3bfdc0,_0x543c89){var _0x2b7446=function(_0x71cda5){while(--_0x71cda5){_0x3bfdc0['push'](_0x3bfdc0['shift']());}};_0x2b7446(++_0x543c89);}(_0x47cb,0x74));var _0xb47c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x47cb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb47c('0x0'));var util=require(_0xb47c('0x1'));var moment=require(_0xb47c('0x2'));var BPromise=require(_0xb47c('0x3'));var rs=require(_0xb47c('0x4'));var fs=require('fs');var Redis=require(_0xb47c('0x5'));var db=require(_0xb47c('0x6'))['db'];var utils=require(_0xb47c('0x7'));var logger=require('../../config/logger')(_0xb47c('0x8'));var config=require(_0xb47c('0x9'));var jayson=require(_0xb47c('0xa'));var client=jayson[_0xb47c('0xb')][_0xb47c('0xc')]({'port':0x232a});config[_0xb47c('0xd')]=_[_0xb47c('0xe')](config[_0xb47c('0xd')],{'host':_0xb47c('0xf'),'port':0x18eb});var socket=require(_0xb47c('0x10'))(new Redis(config[_0xb47c('0xd')]));require(_0xb47c('0x11'))[_0xb47c('0x12')](socket);function respondWithRpcPromise(_0x2e04d7,_0x336f67,_0x5a344c){return new BPromise(function(_0x76cc,_0x37a7d5){return client[_0xb47c('0x13')](_0x2e04d7,_0x5a344c)['then'](function(_0x22e56b){logger[_0xb47c('0x14')]('ChatQueue,\x20%s,\x20%s',_0x336f67,_0xb47c('0x15'));logger[_0xb47c('0x16')](_0xb47c('0x17'),_0x336f67,'request\x20sent',JSON[_0xb47c('0x18')](_0x22e56b));if(_0x22e56b[_0xb47c('0x19')]){if(_0x22e56b[_0xb47c('0x19')][_0xb47c('0x1a')]===0x1f4){logger[_0xb47c('0x19')](_0xb47c('0x1b'),_0x336f67,_0x22e56b[_0xb47c('0x19')][_0xb47c('0x1c')]);return _0x37a7d5(_0x22e56b[_0xb47c('0x19')][_0xb47c('0x1c')]);}logger[_0xb47c('0x19')]('ChatQueue,\x20%s,\x20%s',_0x336f67,_0x22e56b[_0xb47c('0x19')][_0xb47c('0x1c')]);return _0x76cc(_0x22e56b[_0xb47c('0x19')]['message']);}else{logger[_0xb47c('0x14')](_0xb47c('0x1b'),_0x336f67,_0xb47c('0x15'));_0x76cc(_0x22e56b[_0xb47c('0x1d')][_0xb47c('0x1c')]);}})[_0xb47c('0x1e')](function(_0x19867e){logger[_0xb47c('0x19')](_0xb47c('0x1b'),_0x336f67,_0x19867e);_0x37a7d5(_0x19867e);});});}exports[_0xb47c('0x1f')]=function(_0x21d6d8){var _0x292b4b=this;return new Promise(function(_0x51c30d,_0x3dfff2){return db[_0xb47c('0x20')][_0xb47c('0x21')]({'raw':_0x21d6d8['options']?_0x21d6d8['options']['raw']===undefined?!![]:![]:!![],'where':_0x21d6d8[_0xb47c('0x22')]?_0x21d6d8[_0xb47c('0x22')][_0xb47c('0x23')]||null:null,'attributes':_0x21d6d8['options']?_0x21d6d8[_0xb47c('0x22')]['attributes']||null:null,'limit':_0x21d6d8[_0xb47c('0x22')]?_0x21d6d8[_0xb47c('0x22')]['limit']||null:null,'include':_0x21d6d8['options']?_0x21d6d8[_0xb47c('0x22')][_0xb47c('0x24')]?_[_0xb47c('0x25')](_0x21d6d8[_0xb47c('0x22')][_0xb47c('0x24')],function(_0x1e55f7){return{'model':db[_0x1e55f7[_0xb47c('0x26')]],'as':_0x1e55f7['as'],'attributes':_0x1e55f7[_0xb47c('0x27')],'include':_0x1e55f7[_0xb47c('0x24')]?_[_0xb47c('0x25')](_0x1e55f7[_0xb47c('0x24')],function(_0x4d0076){return{'model':db[_0x4d0076[_0xb47c('0x26')]],'as':_0x4d0076['as'],'attributes':_0x4d0076[_0xb47c('0x27')],'include':_0x4d0076['include']?_['map'](_0x4d0076[_0xb47c('0x24')],function(_0x3722d4){return{'model':db[_0x3722d4[_0xb47c('0x26')]],'as':_0x3722d4['as'],'attributes':_0x3722d4[_0xb47c('0x27')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf3633){logger[_0xb47c('0x14')]('GetChatQueue',_0x21d6d8);logger[_0xb47c('0x16')]('GetChatQueue',_0x21d6d8,JSON[_0xb47c('0x18')](_0xf3633));_0x51c30d(_0xf3633);})[_0xb47c('0x1e')](function(_0x3b2a6e){logger[_0xb47c('0x19')](_0xb47c('0x1f'),_0x3b2a6e['message'],_0x21d6d8);_0x3dfff2(_0x292b4b['error'](0x1f4,_0x3b2a6e[_0xb47c('0x1c')]));});});};exports['ShowChatQueue']=function(_0x44818e){var _0x1a23f3=this;return new Promise(function(_0x4ca379,_0x5333cf){return db['ChatQueue']['find']({'raw':_0x44818e[_0xb47c('0x22')]?_0x44818e[_0xb47c('0x22')]['raw']===undefined?!![]:![]:!![],'where':_0x44818e[_0xb47c('0x22')]?_0x44818e['options'][_0xb47c('0x23')]||null:null,'attributes':_0x44818e[_0xb47c('0x22')]?_0x44818e[_0xb47c('0x22')][_0xb47c('0x27')]||null:null,'include':_0x44818e[_0xb47c('0x22')]?_0x44818e[_0xb47c('0x22')]['include']?_[_0xb47c('0x25')](_0x44818e[_0xb47c('0x22')][_0xb47c('0x24')],function(_0x18e2da){return{'model':db[_0x18e2da[_0xb47c('0x26')]],'as':_0x18e2da['as'],'attributes':_0x18e2da[_0xb47c('0x27')],'include':_0x18e2da['include']?_[_0xb47c('0x25')](_0x18e2da[_0xb47c('0x24')],function(_0x4e30c6){return{'model':db[_0x4e30c6[_0xb47c('0x26')]],'as':_0x4e30c6['as'],'attributes':_0x4e30c6[_0xb47c('0x27')],'include':_0x4e30c6['include']?_[_0xb47c('0x25')](_0x4e30c6[_0xb47c('0x24')],function(_0x545b0d){return{'model':db[_0x545b0d[_0xb47c('0x26')]],'as':_0x545b0d['as'],'attributes':_0x545b0d['attributes']};}):[]};}):[]};}):[]:[]})[_0xb47c('0x28')](function(_0x26157e){logger[_0xb47c('0x14')](_0xb47c('0x29'),_0x44818e);logger[_0xb47c('0x16')](_0xb47c('0x29'),_0x44818e,JSON[_0xb47c('0x18')](_0x26157e));_0x4ca379(_0x26157e);})[_0xb47c('0x1e')](function(_0xd228d0){logger[_0xb47c('0x19')](_0xb47c('0x29'),_0xd228d0[_0xb47c('0x1c')],_0x44818e);_0x5333cf(_0x1a23f3[_0xb47c('0x19')](0x1f4,_0xd228d0[_0xb47c('0x1c')]));});});}; \ No newline at end of file +var _0xab75=['lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetChatQueue','ChatQueue','options','raw','limit','include','map','model','attributes','catch','ShowChatQueue','find','where'];(function(_0x1ed116,_0x23bc80){var _0x574066=function(_0x424f9e){while(--_0x424f9e){_0x1ed116['push'](_0x1ed116['shift']());}};_0x574066(++_0x23bc80);}(_0xab75,0x11f));var _0x5ab7=function(_0x459a2d,_0x2aadbf){_0x459a2d=_0x459a2d-0x0;var _0x148a0c=_0xab75[_0x459a2d];return _0x148a0c;};'use strict';var _=require(_0x5ab7('0x0'));var util=require(_0x5ab7('0x1'));var moment=require(_0x5ab7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ab7('0x3'));var db=require(_0x5ab7('0x4'))['db'];var utils=require(_0x5ab7('0x5'));var logger=require('../../config/logger')(_0x5ab7('0x6'));var config=require(_0x5ab7('0x7'));var jayson=require(_0x5ab7('0x8'));var client=jayson[_0x5ab7('0x9')][_0x5ab7('0xa')]({'port':0x232a});config[_0x5ab7('0xb')]=_[_0x5ab7('0xc')](config[_0x5ab7('0xb')],{'host':_0x5ab7('0xd'),'port':0x18eb});var socket=require(_0x5ab7('0xe'))(new Redis(config[_0x5ab7('0xb')]));require('./chatQueue.socket')[_0x5ab7('0xf')](socket);function respondWithRpcPromise(_0x16bbf4,_0x523404,_0x33ffe3){return new BPromise(function(_0x12e9a2,_0x45a8b8){return client[_0x5ab7('0x10')](_0x16bbf4,_0x33ffe3)[_0x5ab7('0x11')](function(_0x4e8f14){logger['info'](_0x5ab7('0x12'),_0x523404,_0x5ab7('0x13'));logger[_0x5ab7('0x14')](_0x5ab7('0x15'),_0x523404,_0x5ab7('0x13'),JSON[_0x5ab7('0x16')](_0x4e8f14));if(_0x4e8f14[_0x5ab7('0x17')]){if(_0x4e8f14[_0x5ab7('0x17')][_0x5ab7('0x18')]===0x1f4){logger[_0x5ab7('0x17')](_0x5ab7('0x12'),_0x523404,_0x4e8f14['error'][_0x5ab7('0x19')]);return _0x45a8b8(_0x4e8f14[_0x5ab7('0x17')][_0x5ab7('0x19')]);}logger[_0x5ab7('0x17')](_0x5ab7('0x12'),_0x523404,_0x4e8f14[_0x5ab7('0x17')][_0x5ab7('0x19')]);return _0x12e9a2(_0x4e8f14[_0x5ab7('0x17')][_0x5ab7('0x19')]);}else{logger[_0x5ab7('0x1a')]('ChatQueue,\x20%s,\x20%s',_0x523404,_0x5ab7('0x13'));_0x12e9a2(_0x4e8f14[_0x5ab7('0x1b')][_0x5ab7('0x19')]);}})['catch'](function(_0x1522eb){logger[_0x5ab7('0x17')](_0x5ab7('0x12'),_0x523404,_0x1522eb);_0x45a8b8(_0x1522eb);});});}exports[_0x5ab7('0x1c')]=function(_0x4b9182){var _0x1167be=this;return new Promise(function(_0x20dc68,_0x38dc30){return db[_0x5ab7('0x1d')]['findAll']({'raw':_0x4b9182[_0x5ab7('0x1e')]?_0x4b9182['options'][_0x5ab7('0x1f')]===undefined?!![]:![]:!![],'where':_0x4b9182[_0x5ab7('0x1e')]?_0x4b9182[_0x5ab7('0x1e')]['where']||null:null,'attributes':_0x4b9182['options']?_0x4b9182[_0x5ab7('0x1e')]['attributes']||null:null,'limit':_0x4b9182[_0x5ab7('0x1e')]?_0x4b9182[_0x5ab7('0x1e')][_0x5ab7('0x20')]||null:null,'include':_0x4b9182[_0x5ab7('0x1e')]?_0x4b9182['options'][_0x5ab7('0x21')]?_[_0x5ab7('0x22')](_0x4b9182['options']['include'],function(_0x158235){return{'model':db[_0x158235['model']],'as':_0x158235['as'],'attributes':_0x158235['attributes'],'include':_0x158235[_0x5ab7('0x21')]?_[_0x5ab7('0x22')](_0x158235[_0x5ab7('0x21')],function(_0x25bf65){return{'model':db[_0x25bf65[_0x5ab7('0x23')]],'as':_0x25bf65['as'],'attributes':_0x25bf65[_0x5ab7('0x24')],'include':_0x25bf65[_0x5ab7('0x21')]?_['map'](_0x25bf65[_0x5ab7('0x21')],function(_0x20f930){return{'model':db[_0x20f930[_0x5ab7('0x23')]],'as':_0x20f930['as'],'attributes':_0x20f930[_0x5ab7('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e4b14){logger[_0x5ab7('0x1a')](_0x5ab7('0x1c'),_0x4b9182);logger[_0x5ab7('0x14')]('GetChatQueue',_0x4b9182,JSON[_0x5ab7('0x16')](_0x4e4b14));_0x20dc68(_0x4e4b14);})[_0x5ab7('0x25')](function(_0x51ae7a){logger[_0x5ab7('0x17')](_0x5ab7('0x1c'),_0x51ae7a[_0x5ab7('0x19')],_0x4b9182);_0x38dc30(_0x1167be['error'](0x1f4,_0x51ae7a[_0x5ab7('0x19')]));});});};exports[_0x5ab7('0x26')]=function(_0x1389a2){var _0x2bdc1e=this;return new Promise(function(_0x241f84,_0x51b08a){return db['ChatQueue'][_0x5ab7('0x27')]({'raw':_0x1389a2['options']?_0x1389a2['options']['raw']===undefined?!![]:![]:!![],'where':_0x1389a2[_0x5ab7('0x1e')]?_0x1389a2[_0x5ab7('0x1e')][_0x5ab7('0x28')]||null:null,'attributes':_0x1389a2[_0x5ab7('0x1e')]?_0x1389a2['options'][_0x5ab7('0x24')]||null:null,'include':_0x1389a2['options']?_0x1389a2[_0x5ab7('0x1e')][_0x5ab7('0x21')]?_['map'](_0x1389a2[_0x5ab7('0x1e')][_0x5ab7('0x21')],function(_0x13a54d){return{'model':db[_0x13a54d[_0x5ab7('0x23')]],'as':_0x13a54d['as'],'attributes':_0x13a54d['attributes'],'include':_0x13a54d[_0x5ab7('0x21')]?_[_0x5ab7('0x22')](_0x13a54d[_0x5ab7('0x21')],function(_0x24221){return{'model':db[_0x24221[_0x5ab7('0x23')]],'as':_0x24221['as'],'attributes':_0x24221['attributes'],'include':_0x24221[_0x5ab7('0x21')]?_[_0x5ab7('0x22')](_0x24221[_0x5ab7('0x21')],function(_0x520122){return{'model':db[_0x520122[_0x5ab7('0x23')]],'as':_0x520122['as'],'attributes':_0x520122['attributes']};}):[]};}):[]};}):[]:[]})[_0x5ab7('0x11')](function(_0x280b29){logger[_0x5ab7('0x1a')](_0x5ab7('0x26'),_0x1389a2);logger[_0x5ab7('0x14')](_0x5ab7('0x26'),_0x1389a2,JSON[_0x5ab7('0x16')](_0x280b29));_0x241f84(_0x280b29);})[_0x5ab7('0x25')](function(_0x5c5a03){logger[_0x5ab7('0x17')](_0x5ab7('0x26'),_0x5c5a03[_0x5ab7('0x19')],_0x1389a2);_0x51b08a(_0x2bdc1e['error'](0x1f4,_0x5c5a03['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 65f25e3..17afa26 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 _0x222f=['./chatQueue.events','save','remove','update','emit','register'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x222f,0x1a4));var _0xf222=function(_0x1d4e21,_0x4e8096){_0x1d4e21=_0x1d4e21-0x0;var _0x178fef=_0x222f[_0x1d4e21];return _0x178fef;};'use strict';var ChatQueueEvents=require(_0xf222('0x0'));var events=[_0xf222('0x1'),_0xf222('0x2'),_0xf222('0x3')];function createListener(_0x4d09ec,_0x4b4237){return function(_0x195de1){_0x4b4237[_0xf222('0x4')](_0x4d09ec,_0x195de1);};}function removeListener(_0x307791,_0x7b187d){return function(){ChatQueueEvents['removeListener'](_0x307791,_0x7b187d);};}exports[_0xf222('0x5')]=function(_0x54a758){for(var _0x112e6d=0x0,_0x26f129=events['length'];_0x112e6d<_0x26f129;_0x112e6d++){var _0xf5a105=events[_0x112e6d];var _0x302d7a=createListener('chatQueue:'+_0xf5a105,_0x54a758);ChatQueueEvents['on'](_0xf5a105,_0x302d7a);}}; \ No newline at end of file +var _0xdace=['remove','update','emit','register','length','./chatQueue.events'];(function(_0x42b4e2,_0x317256){var _0x39f763=function(_0x5e10e4){while(--_0x5e10e4){_0x42b4e2['push'](_0x42b4e2['shift']());}};_0x39f763(++_0x317256);}(_0xdace,0xc5));var _0xedac=function(_0x1f71d8,_0x278518){_0x1f71d8=_0x1f71d8-0x0;var _0x10b045=_0xdace[_0x1f71d8];return _0x10b045;};'use strict';var ChatQueueEvents=require(_0xedac('0x0'));var events=['save',_0xedac('0x1'),_0xedac('0x2')];function createListener(_0x46eba0,_0x518516){return function(_0x413d77){_0x518516[_0xedac('0x3')](_0x46eba0,_0x413d77);};}function removeListener(_0x15d3bd,_0xefb142){return function(){ChatQueueEvents['removeListener'](_0x15d3bd,_0xefb142);};}exports[_0xedac('0x4')]=function(_0x1cba89){for(var _0x39328a=0x0,_0x5ecbd3=events[_0xedac('0x5')];_0x39328a<_0x5ecbd3;_0x39328a++){var _0x21440e=events[_0x39328a];var _0x162eea=createListener('chatQueue:'+_0x21440e,_0x1cba89);ChatQueueEvents['on'](_0x21440e,_0x162eea);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 1be3a11..f9fa0e4 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4b7b69,_0x3ab075){_0x4b7b69=_0x4b7b69-0x0;var _0x173b4c=_0x5fc3[_0x4b7b69];return _0x173b4c;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router; \ No newline at end of file +var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3e74,0x175));var _0x43e7=function(_0x4b9ce5,_0x93f34d){_0x4b9ce5=_0x4b9ce5-0x0;var _0x862c13=_0x3e74[_0x4b9ce5];return _0x862c13;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index afeaa78..a64f6d9 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 _0x1bdf=['STRING','DATE','moment','exports'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x1bdf,0x15e));var _0xf1bd=function(_0x480e20,_0x37df7f){_0x480e20=_0x480e20-0x0;var _0x1fe6e3=_0x1bdf[_0x480e20];return _0x1fe6e3;};'use strict';var moment=require(_0xf1bd('0x0'));var Sequelize=require('sequelize');module[_0xf1bd('0x1')]={'uniqueid':{'type':Sequelize[_0xf1bd('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xf1bd('0x2')]},'joinAt':{'type':Sequelize[_0xf1bd('0x3')]},'leaveAt':{'type':Sequelize[_0xf1bd('0x3')]},'acceptAt':{'type':Sequelize[_0xf1bd('0x3')]},'exitAt':{'type':Sequelize[_0xf1bd('0x3')]},'reason':{'type':Sequelize[_0xf1bd('0x2')]}}; \ No newline at end of file +var _0x864a=['exports','STRING','DATE','moment','sequelize'];(function(_0x165189,_0x19a741){var _0x44826b=function(_0x25bf5a){while(--_0x25bf5a){_0x165189['push'](_0x165189['shift']());}};_0x44826b(++_0x19a741);}(_0x864a,0x8a));var _0xa864=function(_0xc537a4,_0x278e4e){_0xc537a4=_0xc537a4-0x0;var _0x2f67bd=_0x864a[_0xc537a4];return _0x2f67bd;};'use strict';var moment=require(_0xa864('0x0'));var Sequelize=require(_0xa864('0x1'));module[_0xa864('0x2')]={'uniqueid':{'type':Sequelize[_0xa864('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xa864('0x4')]},'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 230d2b6..5ac8b7d 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 _0x6b1b=['create','body','params','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../config/logger','api','../../config/environment','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','keys','options','find'];(function(_0x5b2d27,_0x5632aa){var _0x21c166=function(_0x33b22a){while(--_0x33b22a){_0x5b2d27['push'](_0x5b2d27['shift']());}};_0x21c166(++_0x5632aa);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x6b1b[_0x433a86];return _0x23000c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb6b1('0x0'));var zipdir=require(_0xb6b1('0x1'));var jsonpatch=require(_0xb6b1('0x2'));var rp=require('request-promise');var moment=require(_0xb6b1('0x3'));var BPromise=require(_0xb6b1('0x4'));var Mustache=require(_0xb6b1('0x5'));var util=require(_0xb6b1('0x6'));var path=require(_0xb6b1('0x7'));var sox=require(_0xb6b1('0x8'));var csv=require(_0xb6b1('0x9'));var ejs=require(_0xb6b1('0xa'));var fs=require('fs');var fs_extra=require(_0xb6b1('0xb'));var _=require(_0xb6b1('0xc'));var squel=require(_0xb6b1('0xd'));var crypto=require('crypto');var jsforce=require(_0xb6b1('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb6b1('0xf'));var Papa=require('papaparse');var Redis=require(_0xb6b1('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb6b1('0x11'))(_0xb6b1('0x12'));var utils=require('../../config/utils');var config=require(_0xb6b1('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x406dce,_0x2e5256){_0x2e5256=_0x2e5256||0xcc;return function(_0x12f3ff){if(_0x12f3ff){return _0x406dce[_0xb6b1('0x14')](_0x2e5256);}return _0x406dce[_0xb6b1('0x15')](_0x2e5256)[_0xb6b1('0x16')]();};}function respondWithResult(_0x360fc7,_0x429d0d){_0x429d0d=_0x429d0d||0xc8;return function(_0x2a4d72){if(_0x2a4d72){return _0x360fc7[_0xb6b1('0x15')](_0x429d0d)[_0xb6b1('0x17')](_0x2a4d72);}};}function respondWithFilteredResult(_0x14fef6,_0x4f770a){return function(_0x57572a){if(_0x57572a){var _0x513207=typeof _0x4f770a['offset']===_0xb6b1('0x18')&&typeof _0x4f770a[_0xb6b1('0x19')]===_0xb6b1('0x18');var _0x2b72e5=_0x57572a[_0xb6b1('0x1a')];var _0x51fb33=_0x513207?0x0:_0x4f770a['offset'];var _0x581e28=_0x513207?_0x57572a[_0xb6b1('0x1a')]:_0x4f770a[_0xb6b1('0x1b')]+_0x4f770a[_0xb6b1('0x19')];var _0x11e8ae;if(_0x581e28>=_0x2b72e5){_0x581e28=_0x2b72e5;_0x11e8ae=0xc8;}else{_0x11e8ae=0xce;}_0x14fef6[_0xb6b1('0x15')](_0x11e8ae);return _0x14fef6[_0xb6b1('0x1c')]('Content-Range',_0x51fb33+'-'+_0x581e28+'/'+_0x2b72e5)['json'](_0x57572a);}return null;};}function patchUpdates(_0x43312e){return function(_0x1067ea){try{jsonpatch['apply'](_0x1067ea,_0x43312e,!![]);}catch(_0x5ced4c){return BPromise[_0xb6b1('0x1d')](_0x5ced4c);}return _0x1067ea['save']();};}function saveUpdates(_0x509c55,_0x232157){return function(_0x2086ea){if(_0x2086ea){return _0x2086ea[_0xb6b1('0x1e')](_0x509c55)[_0xb6b1('0x1f')](function(_0x164952){return _0x164952;});}return null;};}function removeEntity(_0x3d0864,_0x1eb1b2){return function(_0x3b1ff7){if(_0x3b1ff7){return _0x3b1ff7[_0xb6b1('0x20')]()[_0xb6b1('0x1f')](function(){_0x3d0864['status'](0xcc)[_0xb6b1('0x16')]();});}};}function handleEntityNotFound(_0x4f1e2e,_0xd8e094){return function(_0x5864d6){if(!_0x5864d6){_0x4f1e2e[_0xb6b1('0x14')](0x194);}return _0x5864d6;};}function handleError(_0x48c1d2,_0x35a567){_0x35a567=_0x35a567||0x1f4;return function(_0x387603){logger[_0xb6b1('0x21')](_0x387603[_0xb6b1('0x22')]);if(_0x387603[_0xb6b1('0x23')]){delete _0x387603[_0xb6b1('0x23')];}_0x48c1d2[_0xb6b1('0x15')](_0x35a567)[_0xb6b1('0x24')](_0x387603);};}exports[_0xb6b1('0x25')]=function(_0x5a523c,_0xf40426){var _0x548f3f={},_0x427efb={},_0x2737f1={'count':0x0,'rows':[]};var _0x367d66=_[_0xb6b1('0x26')](db[_0xb6b1('0x27')][_0xb6b1('0x28')],function(_0x206b7f){return{'name':_0x206b7f['fieldName'],'type':_0x206b7f[_0xb6b1('0x29')][_0xb6b1('0x2a')]};});_0x427efb[_0xb6b1('0x2b')]=_['map'](_0x367d66,_0xb6b1('0x23'));_0x427efb[_0xb6b1('0x2c')]=_['keys'](_0x5a523c[_0xb6b1('0x2c')]);_0x427efb[_0xb6b1('0x2d')]=_[_0xb6b1('0x2e')](_0x427efb[_0xb6b1('0x2b')],_0x427efb[_0xb6b1('0x2c')]);_0x548f3f[_0xb6b1('0x2f')]=_['intersection'](_0x427efb[_0xb6b1('0x2b')],qs[_0xb6b1('0x30')](_0x5a523c['query'][_0xb6b1('0x30')]));_0x548f3f['attributes']=_0x548f3f[_0xb6b1('0x2f')][_0xb6b1('0x31')]?_0x548f3f[_0xb6b1('0x2f')]:_0x427efb[_0xb6b1('0x2b')];if(!_0x5a523c[_0xb6b1('0x2c')][_0xb6b1('0x32')]('nolimit')){_0x548f3f[_0xb6b1('0x19')]=qs[_0xb6b1('0x19')](_0x5a523c[_0xb6b1('0x2c')][_0xb6b1('0x19')]);_0x548f3f['offset']=qs['offset'](_0x5a523c['query'][_0xb6b1('0x1b')]);}_0x548f3f[_0xb6b1('0x33')]=qs[_0xb6b1('0x34')](_0x5a523c[_0xb6b1('0x2c')][_0xb6b1('0x34')]);_0x548f3f[_0xb6b1('0x35')]=qs[_0xb6b1('0x2d')](_[_0xb6b1('0x36')](_0x5a523c[_0xb6b1('0x2c')],_0x427efb[_0xb6b1('0x2d')]),_0x367d66);if(_0x5a523c[_0xb6b1('0x2c')][_0xb6b1('0x37')]){_0x548f3f['where']=_[_0xb6b1('0x38')](_0x548f3f[_0xb6b1('0x35')],{'$or':_[_0xb6b1('0x26')](_0x367d66,function(_0x453484){if(_0x453484[_0xb6b1('0x29')]!==_0xb6b1('0x39')){var _0xfe126={};_0xfe126[_0x453484[_0xb6b1('0x23')]]={'$like':'%'+_0x5a523c[_0xb6b1('0x2c')][_0xb6b1('0x37')]+'%'};return _0xfe126;}})});}_0x548f3f=_[_0xb6b1('0x38')]({},_0x548f3f,_0x5a523c['options']);var _0x45cb84={'where':_0x548f3f[_0xb6b1('0x35')]};return db[_0xb6b1('0x27')][_0xb6b1('0x1a')](_0x45cb84)[_0xb6b1('0x1f')](function(_0x2c583f){_0x2737f1[_0xb6b1('0x1a')]=_0x2c583f;if(_0x5a523c[_0xb6b1('0x2c')]['includeAll']){_0x548f3f['include']=[{'all':!![]}];}return db[_0xb6b1('0x27')][_0xb6b1('0x3a')](_0x548f3f);})[_0xb6b1('0x1f')](function(_0x541eb5){_0x2737f1[_0xb6b1('0x3b')]=_0x541eb5;return _0x2737f1;})[_0xb6b1('0x1f')](respondWithFilteredResult(_0xf40426,_0x548f3f))[_0xb6b1('0x3c')](handleError(_0xf40426,null));};exports[_0xb6b1('0x3d')]=function(_0xb6e8f5,_0x3c2780){var _0xa03b13={'raw':!![],'where':{'id':_0xb6e8f5['params']['id']}},_0x339edf={};_0x339edf[_0xb6b1('0x2b')]=_['keys'](db[_0xb6b1('0x27')][_0xb6b1('0x28')]);_0x339edf[_0xb6b1('0x2c')]=_[_0xb6b1('0x3e')](_0xb6e8f5[_0xb6b1('0x2c')]);_0x339edf[_0xb6b1('0x2d')]=_['intersection'](_0x339edf[_0xb6b1('0x2b')],_0x339edf[_0xb6b1('0x2c')]);_0xa03b13['attributes']=_[_0xb6b1('0x2e')](_0x339edf['model'],qs[_0xb6b1('0x30')](_0xb6e8f5[_0xb6b1('0x2c')][_0xb6b1('0x30')]));_0xa03b13[_0xb6b1('0x2f')]=_0xa03b13[_0xb6b1('0x2f')][_0xb6b1('0x31')]?_0xa03b13[_0xb6b1('0x2f')]:_0x339edf[_0xb6b1('0x2b')];if(_0xb6e8f5[_0xb6b1('0x2c')]['includeAll']){_0xa03b13['include']=[{'all':!![]}];}_0xa03b13=_[_0xb6b1('0x38')]({},_0xa03b13,_0xb6e8f5[_0xb6b1('0x3f')]);return db['ChatQueueReport'][_0xb6b1('0x40')](_0xa03b13)[_0xb6b1('0x1f')](handleEntityNotFound(_0x3c2780,null))[_0xb6b1('0x1f')](respondWithResult(_0x3c2780,null))[_0xb6b1('0x3c')](handleError(_0x3c2780,null));};exports[_0xb6b1('0x41')]=function(_0x505a80,_0x28f353){return db[_0xb6b1('0x27')][_0xb6b1('0x41')](_0x505a80[_0xb6b1('0x42')],{})['then'](respondWithResult(_0x28f353,0xc9))['catch'](handleError(_0x28f353,null));};exports[_0xb6b1('0x1e')]=function(_0x5bd5e9,_0x2be9e7){if(_0x5bd5e9[_0xb6b1('0x42')]['id']){delete _0x5bd5e9['body']['id'];}return db[_0xb6b1('0x27')]['find']({'where':{'id':_0x5bd5e9[_0xb6b1('0x43')]['id']}})[_0xb6b1('0x1f')](handleEntityNotFound(_0x2be9e7,null))[_0xb6b1('0x1f')](saveUpdates(_0x5bd5e9[_0xb6b1('0x42')],null))[_0xb6b1('0x1f')](respondWithResult(_0x2be9e7,null))[_0xb6b1('0x3c')](handleError(_0x2be9e7,null));};exports[_0xb6b1('0x20')]=function(_0x1c513c,_0x37bbbe){return db[_0xb6b1('0x27')]['find']({'where':{'id':_0x1c513c[_0xb6b1('0x43')]['id']}})[_0xb6b1('0x1f')](handleEntityNotFound(_0x37bbbe,null))[_0xb6b1('0x1f')](removeEntity(_0x37bbbe,null))[_0xb6b1('0x3c')](handleError(_0x37bbbe,null));};exports[_0xb6b1('0x44')]=function(_0x118ec3,_0x3eca0){return db[_0xb6b1('0x27')][_0xb6b1('0x44')]()['then'](respondWithResult(_0x3eca0,null))[_0xb6b1('0x3c')](handleError(_0x3eca0,null));}; \ No newline at end of file +var _0x7d10=['intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','ChatQueueReport','include','findAll','rows','catch','show','params','rawAttributes','create','body','update','find','describe','rimraf','zip-dir','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','error','stack','name','type','key','model','map','keys','query','filters'];(function(_0x378266,_0x11fd6a){var _0x20eb3e=function(_0x4b04c3){while(--_0x4b04c3){_0x378266['push'](_0x378266['shift']());}};_0x20eb3e(++_0x11fd6a);}(_0x7d10,0x1ce));var _0x07d1=function(_0xbe3f94,_0x2f2eee){_0xbe3f94=_0xbe3f94-0x0;var _0x5bb088=_0x7d10[_0xbe3f94];return _0x5bb088;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x07d1('0x0'));var zipdir=require(_0x07d1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x07d1('0x2'));var moment=require(_0x07d1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x07d1('0x4'));var util=require(_0x07d1('0x5'));var path=require('path');var sox=require(_0x07d1('0x6'));var csv=require(_0x07d1('0x7'));var ejs=require(_0x07d1('0x8'));var fs=require('fs');var fs_extra=require(_0x07d1('0x9'));var _=require('lodash');var squel=require(_0x07d1('0xa'));var crypto=require(_0x07d1('0xb'));var jsforce=require(_0x07d1('0xc'));var deskjs=require(_0x07d1('0xd'));var toCsv=require(_0x07d1('0x7'));var querystring=require(_0x07d1('0xe'));var Papa=require(_0x07d1('0xf'));var Redis=require(_0x07d1('0x10'));var authService=require(_0x07d1('0x11'));var qs=require(_0x07d1('0x12'));var as=require(_0x07d1('0x13'));var hardwareService=require(_0x07d1('0x14'));var logger=require(_0x07d1('0x15'))(_0x07d1('0x16'));var utils=require(_0x07d1('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x07d1('0x18'))['db'];function respondWithStatusCode(_0x427deb,_0x1625b4){_0x1625b4=_0x1625b4||0xcc;return function(_0x29c764){if(_0x29c764){return _0x427deb[_0x07d1('0x19')](_0x1625b4);}return _0x427deb[_0x07d1('0x1a')](_0x1625b4)[_0x07d1('0x1b')]();};}function respondWithResult(_0x19725b,_0x19ce74){_0x19ce74=_0x19ce74||0xc8;return function(_0x15bc80){if(_0x15bc80){return _0x19725b['status'](_0x19ce74)[_0x07d1('0x1c')](_0x15bc80);}};}function respondWithFilteredResult(_0x22fec9,_0x1c528d){return function(_0x3e1ee7){if(_0x3e1ee7){var _0x5f28f6=typeof _0x1c528d[_0x07d1('0x1d')]===_0x07d1('0x1e')&&typeof _0x1c528d[_0x07d1('0x1f')]==='undefined';var _0xd282ae=_0x3e1ee7[_0x07d1('0x20')];var _0x1e90dd=_0x5f28f6?0x0:_0x1c528d[_0x07d1('0x1d')];var _0x2f9a13=_0x5f28f6?_0x3e1ee7[_0x07d1('0x20')]:_0x1c528d[_0x07d1('0x1d')]+_0x1c528d['limit'];var _0x536f1b;if(_0x2f9a13>=_0xd282ae){_0x2f9a13=_0xd282ae;_0x536f1b=0xc8;}else{_0x536f1b=0xce;}_0x22fec9[_0x07d1('0x1a')](_0x536f1b);return _0x22fec9['set'](_0x07d1('0x21'),_0x1e90dd+'-'+_0x2f9a13+'/'+_0xd282ae)['json'](_0x3e1ee7);}return null;};}function patchUpdates(_0x2b5153){return function(_0x19e9de){try{jsonpatch[_0x07d1('0x22')](_0x19e9de,_0x2b5153,!![]);}catch(_0x42dd1f){return BPromise[_0x07d1('0x23')](_0x42dd1f);}return _0x19e9de[_0x07d1('0x24')]();};}function saveUpdates(_0x723829,_0xd9d94c){return function(_0x43b86c){if(_0x43b86c){return _0x43b86c['update'](_0x723829)['then'](function(_0x557e33){return _0x557e33;});}return null;};}function removeEntity(_0x3f5b53,_0x4f2e25){return function(_0x30755f){if(_0x30755f){return _0x30755f[_0x07d1('0x25')]()[_0x07d1('0x26')](function(){_0x3f5b53[_0x07d1('0x1a')](0xcc)[_0x07d1('0x1b')]();});}};}function handleEntityNotFound(_0x4d8b90,_0x1e9021){return function(_0x16b55c){if(!_0x16b55c){_0x4d8b90[_0x07d1('0x19')](0x194);}return _0x16b55c;};}function handleError(_0x3faa21,_0x2d717a){_0x2d717a=_0x2d717a||0x1f4;return function(_0x58e370){logger[_0x07d1('0x27')](_0x58e370[_0x07d1('0x28')]);if(_0x58e370[_0x07d1('0x29')]){delete _0x58e370[_0x07d1('0x29')];}_0x3faa21[_0x07d1('0x1a')](_0x2d717a)['send'](_0x58e370);};}exports['index']=function(_0x3a0254,_0x604380){var _0x513cf0={},_0x3ba5df={},_0x12cb9c={'count':0x0,'rows':[]};var _0x564b13=_['map'](db['ChatQueueReport']['rawAttributes'],function(_0x42a910){return{'name':_0x42a910['fieldName'],'type':_0x42a910[_0x07d1('0x2a')][_0x07d1('0x2b')]};});_0x3ba5df[_0x07d1('0x2c')]=_[_0x07d1('0x2d')](_0x564b13,_0x07d1('0x29'));_0x3ba5df['query']=_[_0x07d1('0x2e')](_0x3a0254[_0x07d1('0x2f')]);_0x3ba5df[_0x07d1('0x30')]=_[_0x07d1('0x31')](_0x3ba5df[_0x07d1('0x2c')],_0x3ba5df[_0x07d1('0x2f')]);_0x513cf0[_0x07d1('0x32')]=_[_0x07d1('0x31')](_0x3ba5df[_0x07d1('0x2c')],qs[_0x07d1('0x33')](_0x3a0254['query']['fields']));_0x513cf0['attributes']=_0x513cf0[_0x07d1('0x32')]['length']?_0x513cf0[_0x07d1('0x32')]:_0x3ba5df['model'];if(!_0x3a0254['query'][_0x07d1('0x34')](_0x07d1('0x35'))){_0x513cf0[_0x07d1('0x1f')]=qs[_0x07d1('0x1f')](_0x3a0254[_0x07d1('0x2f')][_0x07d1('0x1f')]);_0x513cf0[_0x07d1('0x1d')]=qs['offset'](_0x3a0254[_0x07d1('0x2f')][_0x07d1('0x1d')]);}_0x513cf0['order']=qs[_0x07d1('0x36')](_0x3a0254[_0x07d1('0x2f')][_0x07d1('0x36')]);_0x513cf0[_0x07d1('0x37')]=qs[_0x07d1('0x30')](_[_0x07d1('0x38')](_0x3a0254['query'],_0x3ba5df['filters']),_0x564b13);if(_0x3a0254[_0x07d1('0x2f')]['filter']){_0x513cf0['where']=_[_0x07d1('0x39')](_0x513cf0[_0x07d1('0x37')],{'$or':_[_0x07d1('0x2d')](_0x564b13,function(_0x1a6ea3){if(_0x1a6ea3[_0x07d1('0x2a')]!==_0x07d1('0x3a')){var _0x252718={};_0x252718[_0x1a6ea3['name']]={'$like':'%'+_0x3a0254[_0x07d1('0x2f')]['filter']+'%'};return _0x252718;}})});}_0x513cf0=_['merge']({},_0x513cf0,_0x3a0254[_0x07d1('0x3b')]);var _0x1529eb={'where':_0x513cf0[_0x07d1('0x37')]};return db[_0x07d1('0x3c')]['count'](_0x1529eb)['then'](function(_0x145775){_0x12cb9c[_0x07d1('0x20')]=_0x145775;if(_0x3a0254[_0x07d1('0x2f')]['includeAll']){_0x513cf0[_0x07d1('0x3d')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x07d1('0x3e')](_0x513cf0);})[_0x07d1('0x26')](function(_0xa4b063){_0x12cb9c[_0x07d1('0x3f')]=_0xa4b063;return _0x12cb9c;})[_0x07d1('0x26')](respondWithFilteredResult(_0x604380,_0x513cf0))[_0x07d1('0x40')](handleError(_0x604380,null));};exports[_0x07d1('0x41')]=function(_0x5836dd,_0x4e4154){var _0x2c3d91={'raw':!![],'where':{'id':_0x5836dd[_0x07d1('0x42')]['id']}},_0x3016cb={};_0x3016cb[_0x07d1('0x2c')]=_['keys'](db['ChatQueueReport'][_0x07d1('0x43')]);_0x3016cb[_0x07d1('0x2f')]=_[_0x07d1('0x2e')](_0x5836dd[_0x07d1('0x2f')]);_0x3016cb[_0x07d1('0x30')]=_['intersection'](_0x3016cb[_0x07d1('0x2c')],_0x3016cb[_0x07d1('0x2f')]);_0x2c3d91[_0x07d1('0x32')]=_[_0x07d1('0x31')](_0x3016cb[_0x07d1('0x2c')],qs[_0x07d1('0x33')](_0x5836dd[_0x07d1('0x2f')][_0x07d1('0x33')]));_0x2c3d91[_0x07d1('0x32')]=_0x2c3d91[_0x07d1('0x32')]['length']?_0x2c3d91['attributes']:_0x3016cb[_0x07d1('0x2c')];if(_0x5836dd[_0x07d1('0x2f')]['includeAll']){_0x2c3d91[_0x07d1('0x3d')]=[{'all':!![]}];}_0x2c3d91=_[_0x07d1('0x39')]({},_0x2c3d91,_0x5836dd[_0x07d1('0x3b')]);return db[_0x07d1('0x3c')]['find'](_0x2c3d91)[_0x07d1('0x26')](handleEntityNotFound(_0x4e4154,null))['then'](respondWithResult(_0x4e4154,null))[_0x07d1('0x40')](handleError(_0x4e4154,null));};exports[_0x07d1('0x44')]=function(_0x4918a9,_0xa0e6aa){return db[_0x07d1('0x3c')][_0x07d1('0x44')](_0x4918a9[_0x07d1('0x45')],{})['then'](respondWithResult(_0xa0e6aa,0xc9))[_0x07d1('0x40')](handleError(_0xa0e6aa,null));};exports[_0x07d1('0x46')]=function(_0x17e32c,_0x15da90){if(_0x17e32c[_0x07d1('0x45')]['id']){delete _0x17e32c['body']['id'];}return db[_0x07d1('0x3c')][_0x07d1('0x47')]({'where':{'id':_0x17e32c['params']['id']}})[_0x07d1('0x26')](handleEntityNotFound(_0x15da90,null))['then'](saveUpdates(_0x17e32c[_0x07d1('0x45')],null))[_0x07d1('0x26')](respondWithResult(_0x15da90,null))[_0x07d1('0x40')](handleError(_0x15da90,null));};exports[_0x07d1('0x25')]=function(_0x59bff2,_0x41d642){return db[_0x07d1('0x3c')][_0x07d1('0x47')]({'where':{'id':_0x59bff2[_0x07d1('0x42')]['id']}})[_0x07d1('0x26')](handleEntityNotFound(_0x41d642,null))[_0x07d1('0x26')](removeEntity(_0x41d642,null))[_0x07d1('0x40')](handleError(_0x41d642,null));};exports[_0x07d1('0x48')]=function(_0x513fad,_0x126b8a){return db[_0x07d1('0x3c')][_0x07d1('0x48')]()[_0x07d1('0x26')](respondWithResult(_0x126b8a,null))[_0x07d1('0x40')](handleError(_0x126b8a,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index f8bbd81..2413509 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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x56da28,_0x597cc0){var _0x4d5f1d=function(_0x554b94){while(--_0x554b94){_0x56da28['push'](_0x56da28['shift']());}};_0x4d5f1d(++_0x597cc0);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1fbd2b,_0xe9949d){var _0x46dece=function(_0x32dbcd){while(--_0x32dbcd){_0x1fbd2b['push'](_0x1fbd2b['shift']());}};_0x46dece(++_0xe9949d);}(_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('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index e00d6ea..efa0577 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 _0xba44=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateChatQueueReport','ChatQueueReport','create','body','options','UpdateChatQueueReport','update','raw','where','attributes','limit','catch','util','moment','bluebird'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0xba44,0x189));var _0x4ba4=function(_0x4ec334,_0x32e7c6){_0x4ec334=_0x4ec334-0x0;var _0xa0ed5f=_0xba44[_0x4ec334];return _0xa0ed5f;};'use strict';var _=require('lodash');var util=require(_0x4ba4('0x0'));var moment=require(_0x4ba4('0x1'));var BPromise=require(_0x4ba4('0x2'));var rs=require(_0x4ba4('0x3'));var fs=require('fs');var Redis=require(_0x4ba4('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba4('0x5'))(_0x4ba4('0x6'));var config=require(_0x4ba4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4ba4('0x8')][_0x4ba4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29e36b,_0xcabb3f,_0x12da47){return new BPromise(function(_0x33c00b,_0x2a54b7){return client[_0x4ba4('0xa')](_0x29e36b,_0x12da47)[_0x4ba4('0xb')](function(_0x47a2ed){logger[_0x4ba4('0xc')](_0x4ba4('0xd'),_0xcabb3f,_0x4ba4('0xe'));logger[_0x4ba4('0xf')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0xcabb3f,_0x4ba4('0xe'),JSON[_0x4ba4('0x10')](_0x47a2ed));if(_0x47a2ed[_0x4ba4('0x11')]){if(_0x47a2ed[_0x4ba4('0x11')][_0x4ba4('0x12')]===0x1f4){logger['error'](_0x4ba4('0xd'),_0xcabb3f,_0x47a2ed[_0x4ba4('0x11')]['message']);return _0x2a54b7(_0x47a2ed[_0x4ba4('0x11')][_0x4ba4('0x13')]);}logger[_0x4ba4('0x11')](_0x4ba4('0xd'),_0xcabb3f,_0x47a2ed[_0x4ba4('0x11')][_0x4ba4('0x13')]);return _0x33c00b(_0x47a2ed['error']['message']);}else{logger[_0x4ba4('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0xcabb3f,'request\x20sent');_0x33c00b(_0x47a2ed[_0x4ba4('0x14')][_0x4ba4('0x13')]);}})['catch'](function(_0xc2e13){logger[_0x4ba4('0x11')](_0x4ba4('0xd'),_0xcabb3f,_0xc2e13);_0x2a54b7(_0xc2e13);});});}exports[_0x4ba4('0x15')]=function(_0x262e1e){var _0x360764=this;return new Promise(function(_0x449635,_0x2fc10e){return db[_0x4ba4('0x16')][_0x4ba4('0x17')](_0x262e1e[_0x4ba4('0x18')],{'raw':_0x262e1e[_0x4ba4('0x19')]?_0x262e1e[_0x4ba4('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x4ba4('0xb')](function(_0x5d960a){logger[_0x4ba4('0xc')](_0x4ba4('0x15'),_0x262e1e);logger[_0x4ba4('0xf')]('CreateChatQueueReport',_0x262e1e,JSON[_0x4ba4('0x10')](_0x5d960a));_0x449635(_0x5d960a);})['catch'](function(_0x28a89b){logger[_0x4ba4('0x11')](_0x4ba4('0x15'),_0x28a89b[_0x4ba4('0x13')],_0x262e1e);_0x2fc10e(_0x360764[_0x4ba4('0x11')](0x1f4,_0x28a89b[_0x4ba4('0x13')]));});});};exports[_0x4ba4('0x1a')]=function(_0x34eb84){var _0xe28cb0=this;return new Promise(function(_0x42e0fd,_0x53d1dd){return db['ChatQueueReport'][_0x4ba4('0x1b')](_0x34eb84[_0x4ba4('0x18')],{'raw':_0x34eb84['options']?_0x34eb84['options'][_0x4ba4('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34eb84['options']?_0x34eb84[_0x4ba4('0x19')][_0x4ba4('0x1d')]||null:null,'attributes':_0x34eb84[_0x4ba4('0x19')]?_0x34eb84[_0x4ba4('0x19')][_0x4ba4('0x1e')]||null:null,'limit':_0x34eb84[_0x4ba4('0x19')]?_0x34eb84['options'][_0x4ba4('0x1f')]||null:null})[_0x4ba4('0xb')](function(_0x1babc1){logger[_0x4ba4('0xc')](_0x4ba4('0x1a'),_0x34eb84);logger[_0x4ba4('0xf')](_0x4ba4('0x1a'),_0x34eb84,JSON[_0x4ba4('0x10')](_0x1babc1));_0x42e0fd(_0x1babc1);})[_0x4ba4('0x20')](function(_0x305f08){logger[_0x4ba4('0x11')](_0x4ba4('0x1a'),_0x305f08[_0x4ba4('0x13')],_0x34eb84);_0x53d1dd(_0xe28cb0[_0x4ba4('0x11')](0x1f4,_0x305f08[_0x4ba4('0x13')]));});});}; \ No newline at end of file +var _0xa928=['create','options','update','raw','where','attributes','UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa928,0x93));var _0x8a92=function(_0x1a30ae,_0x517b4b){_0x1a30ae=_0x1a30ae-0x0;var _0x45fc2b=_0xa928[_0x1a30ae];return _0x45fc2b;};'use strict';var _=require(_0x8a92('0x0'));var util=require(_0x8a92('0x1'));var moment=require(_0x8a92('0x2'));var BPromise=require(_0x8a92('0x3'));var rs=require(_0x8a92('0x4'));var fs=require('fs');var Redis=require(_0x8a92('0x5'));var db=require(_0x8a92('0x6'))['db'];var utils=require(_0x8a92('0x7'));var logger=require(_0x8a92('0x8'))(_0x8a92('0x9'));var config=require(_0x8a92('0xa'));var jayson=require(_0x8a92('0xb'));var client=jayson[_0x8a92('0xc')][_0x8a92('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1eb32a,_0x238bc4,_0x41b83c){return new BPromise(function(_0x2d2336,_0x16290e){return client[_0x8a92('0xe')](_0x1eb32a,_0x41b83c)[_0x8a92('0xf')](function(_0x1e6ef0){logger[_0x8a92('0x10')](_0x8a92('0x11'),_0x238bc4,'request\x20sent');logger[_0x8a92('0x12')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x238bc4,_0x8a92('0x13'),JSON[_0x8a92('0x14')](_0x1e6ef0));if(_0x1e6ef0['error']){if(_0x1e6ef0[_0x8a92('0x15')][_0x8a92('0x16')]===0x1f4){logger['error'](_0x8a92('0x11'),_0x238bc4,_0x1e6ef0['error']['message']);return _0x16290e(_0x1e6ef0[_0x8a92('0x15')][_0x8a92('0x17')]);}logger[_0x8a92('0x15')](_0x8a92('0x11'),_0x238bc4,_0x1e6ef0[_0x8a92('0x15')][_0x8a92('0x17')]);return _0x2d2336(_0x1e6ef0[_0x8a92('0x15')][_0x8a92('0x17')]);}else{logger[_0x8a92('0x10')](_0x8a92('0x11'),_0x238bc4,_0x8a92('0x13'));_0x2d2336(_0x1e6ef0[_0x8a92('0x18')]['message']);}})[_0x8a92('0x19')](function(_0x4d2a34){logger[_0x8a92('0x15')](_0x8a92('0x11'),_0x238bc4,_0x4d2a34);_0x16290e(_0x4d2a34);});});}exports[_0x8a92('0x1a')]=function(_0x2ecd45){var _0x2e311a=this;return new Promise(function(_0xa455ec,_0x46ae4a){return db[_0x8a92('0x1b')][_0x8a92('0x1c')](_0x2ecd45['body'],{'raw':_0x2ecd45[_0x8a92('0x1d')]?_0x2ecd45[_0x8a92('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x8a92('0xf')](function(_0x2272fd){logger[_0x8a92('0x10')](_0x8a92('0x1a'),_0x2ecd45);logger[_0x8a92('0x12')](_0x8a92('0x1a'),_0x2ecd45,JSON['stringify'](_0x2272fd));_0xa455ec(_0x2272fd);})['catch'](function(_0x46ab31){logger[_0x8a92('0x15')]('CreateChatQueueReport',_0x46ab31['message'],_0x2ecd45);_0x46ae4a(_0x2e311a[_0x8a92('0x15')](0x1f4,_0x46ab31[_0x8a92('0x17')]));});});};exports['UpdateChatQueueReport']=function(_0x255699){var _0x21ce0a=this;return new Promise(function(_0x2c19a1,_0x134dfb){return db[_0x8a92('0x1b')][_0x8a92('0x1e')](_0x255699['body'],{'raw':_0x255699[_0x8a92('0x1d')]?_0x255699[_0x8a92('0x1d')][_0x8a92('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x255699[_0x8a92('0x1d')]?_0x255699[_0x8a92('0x1d')][_0x8a92('0x20')]||null:null,'attributes':_0x255699['options']?_0x255699['options'][_0x8a92('0x21')]||null:null,'limit':_0x255699['options']?_0x255699['options']['limit']||null:null})[_0x8a92('0xf')](function(_0x397158){logger[_0x8a92('0x10')](_0x8a92('0x22'),_0x255699);logger[_0x8a92('0x12')]('UpdateChatQueueReport',_0x255699,JSON[_0x8a92('0x14')](_0x397158));_0x2c19a1(_0x397158);})[_0x8a92('0x19')](function(_0x1eedae){logger[_0x8a92('0x15')](_0x8a92('0x22'),_0x1eedae[_0x8a92('0x17')],_0x255699);_0x134dfb(_0x21ce0a[_0x8a92('0x15')](0x1f4,_0x1eedae[_0x8a92('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 4a2fed4..f2dbbc5 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 _0xbb30=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','describe','post','put','delete','exports','multer'];(function(_0x359e4f,_0x25efbe){var _0x3d0d31=function(_0x5b9420){while(--_0x5b9420){_0x359e4f['push'](_0x359e4f['shift']());}};_0x3d0d31(++_0x25efbe);}(_0xbb30,0x8f));var _0x0bb3=function(_0x3a03cf,_0xf70834){_0x3a03cf=_0x3a03cf-0x0;var _0x2e943c=_0xbb30[_0x3a03cf];return _0x2e943c;};'use strict';var multer=require(_0x0bb3('0x0'));var util=require('util');var path=require(_0x0bb3('0x1'));var timeout=require(_0x0bb3('0x2'));var express=require('express');var router=express[_0x0bb3('0x3')]();var fs_extra=require(_0x0bb3('0x4'));var auth=require(_0x0bb3('0x5'));var interaction=require(_0x0bb3('0x6'));var config=require(_0x0bb3('0x7'));var controller=require(_0x0bb3('0x8'));router[_0x0bb3('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x0bb3('0xa')](),controller[_0x0bb3('0xb')]);router[_0x0bb3('0x9')]('/:id',auth[_0x0bb3('0xa')](),controller['show']);router[_0x0bb3('0xc')]('/',auth[_0x0bb3('0xa')](),controller['create']);router[_0x0bb3('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x0bb3('0xe')]('/:id',auth[_0x0bb3('0xa')](),controller['destroy']);module[_0x0bb3('0xf')]=router; \ No newline at end of file +var _0x31fb=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','index','get','/describe','isAuthenticated','/:id','show','create','put','update','delete','destroy'];(function(_0x3dc6a5,_0x44a6c1){var _0x8961d9=function(_0x4cf66c){while(--_0x4cf66c){_0x3dc6a5['push'](_0x3dc6a5['shift']());}};_0x8961d9(++_0x44a6c1);}(_0x31fb,0x17d));var _0xb31f=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x31fb[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0xb31f('0x0'));var util=require(_0xb31f('0x1'));var path=require('path');var timeout=require(_0xb31f('0x2'));var express=require(_0xb31f('0x3'));var router=express[_0xb31f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb31f('0x5'));var interaction=require(_0xb31f('0x6'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xb31f('0x7')]);router[_0xb31f('0x8')](_0xb31f('0x9'),auth[_0xb31f('0xa')](),controller['describe']);router[_0xb31f('0x8')](_0xb31f('0xb'),auth[_0xb31f('0xa')](),controller[_0xb31f('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb31f('0xd')]);router[_0xb31f('0xe')](_0xb31f('0xb'),auth[_0xb31f('0xa')](),controller[_0xb31f('0xf')]);router[_0xb31f('0x10')]('/:id',auth[_0xb31f('0xa')](),controller[_0xb31f('0x11')]);module[_0xb31f('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 97eba34..eef28f4 100644 --- a/server/api/chatTransferReport/chatTransferReport.attributes.js +++ b/server/api/chatTransferReport/chatTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x376256,_0x3d2caa){var _0x39b953=function(_0x57008e){while(--_0x57008e){_0x376256['push'](_0x376256['shift']());}};_0x39b953(++_0x3d2caa);}(_0xf4eb,0xec));var _0xbf4e=function(_0x2dc53b,_0x29b63f){_0x2dc53b=_0x2dc53b-0x0;var _0x1083f8=_0xf4eb[_0x2dc53b];return _0x1083f8;};'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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x5b5f67,_0x1cf60e){var _0x2191f9=function(_0x544235){while(--_0x544235){_0x5b5f67['push'](_0x5b5f67['shift']());}};_0x2191f9(++_0x1cf60e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x903228,_0x42c429){_0x903228=_0x903228-0x0;var _0xcec81d=_0xcb91[_0x903228];return _0xcec81d;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index ba0d790..7d6c8c8 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 _0x93ac=['mustache','util','path','sox','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','offset','count','set','Content-Range','json','save','update','then','destroy','send','index','map','rawAttributes','fieldName','type','model','name','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatTransferReport','includeAll','include','findAll','catch','show','keys','create','body','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x37baaf,_0xfe26d){var _0x2abbf0=function(_0x2a379b){while(--_0x2a379b){_0x37baaf['push'](_0x37baaf['shift']());}};_0x2abbf0(++_0xfe26d);}(_0x93ac,0x15d));var _0xc93a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x93ac[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc93a('0x0'));var zipdir=require(_0xc93a('0x1'));var jsonpatch=require(_0xc93a('0x2'));var rp=require(_0xc93a('0x3'));var moment=require(_0xc93a('0x4'));var BPromise=require(_0xc93a('0x5'));var Mustache=require(_0xc93a('0x6'));var util=require(_0xc93a('0x7'));var path=require(_0xc93a('0x8'));var sox=require(_0xc93a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc93a('0xa'));var _=require('lodash');var squel=require(_0xc93a('0xb'));var crypto=require(_0xc93a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc93a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc93a('0xe'));var Papa=require(_0xc93a('0xf'));var Redis=require(_0xc93a('0x10'));var authService=require(_0xc93a('0x11'));var qs=require(_0xc93a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc93a('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xc93a('0x14'));var licenseUtil=require(_0xc93a('0x15'));var db=require(_0xc93a('0x16'))['db'];function respondWithStatusCode(_0x1640d,_0x8f0bc1){_0x8f0bc1=_0x8f0bc1||0xcc;return function(_0x3c1f91){if(_0x3c1f91){return _0x1640d[_0xc93a('0x17')](_0x8f0bc1);}return _0x1640d[_0xc93a('0x18')](_0x8f0bc1)[_0xc93a('0x19')]();};}function respondWithResult(_0x326ed6,_0x16a7e2){_0x16a7e2=_0x16a7e2||0xc8;return function(_0x4f9d3b){if(_0x4f9d3b){return _0x326ed6[_0xc93a('0x18')](_0x16a7e2)['json'](_0x4f9d3b);}};}function respondWithFilteredResult(_0x1443bc,_0x3d512e){return function(_0x735098){if(_0x735098){var _0x55d927=typeof _0x3d512e['offset']==='undefined'&&typeof _0x3d512e[_0xc93a('0x1a')]===_0xc93a('0x1b');var _0x3ee21a=_0x735098['count'];var _0x43d092=_0x55d927?0x0:_0x3d512e[_0xc93a('0x1c')];var _0x297fce=_0x55d927?_0x735098[_0xc93a('0x1d')]:_0x3d512e[_0xc93a('0x1c')]+_0x3d512e[_0xc93a('0x1a')];var _0x4de28d;if(_0x297fce>=_0x3ee21a){_0x297fce=_0x3ee21a;_0x4de28d=0xc8;}else{_0x4de28d=0xce;}_0x1443bc[_0xc93a('0x18')](_0x4de28d);return _0x1443bc[_0xc93a('0x1e')](_0xc93a('0x1f'),_0x43d092+'-'+_0x297fce+'/'+_0x3ee21a)[_0xc93a('0x20')](_0x735098);}return null;};}function patchUpdates(_0xe135b6){return function(_0x20c4a8){try{jsonpatch['apply'](_0x20c4a8,_0xe135b6,!![]);}catch(_0x251712){return BPromise['reject'](_0x251712);}return _0x20c4a8[_0xc93a('0x21')]();};}function saveUpdates(_0x586e87,_0x5d3fb7){return function(_0xa98ec8){if(_0xa98ec8){return _0xa98ec8[_0xc93a('0x22')](_0x586e87)[_0xc93a('0x23')](function(_0x37b589){return _0x37b589;});}return null;};}function removeEntity(_0x548085,_0x4a3c41){return function(_0x14e578){if(_0x14e578){return _0x14e578[_0xc93a('0x24')]()[_0xc93a('0x23')](function(){_0x548085[_0xc93a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x330c45,_0x5d244a){return function(_0x40ccd7){if(!_0x40ccd7){_0x330c45['sendStatus'](0x194);}return _0x40ccd7;};}function handleError(_0x313e24,_0x7ff074){_0x7ff074=_0x7ff074||0x1f4;return function(_0x41a441){logger['error'](_0x41a441['stack']);if(_0x41a441['name']){delete _0x41a441['name'];}_0x313e24[_0xc93a('0x18')](_0x7ff074)[_0xc93a('0x25')](_0x41a441);};}exports[_0xc93a('0x26')]=function(_0x558265,_0x1b7346){var _0x2f6557={},_0x1e77d9={},_0x308c45={'count':0x0,'rows':[]};var _0xf0ccae=_[_0xc93a('0x27')](db['ChatTransferReport'][_0xc93a('0x28')],function(_0x428390){return{'name':_0x428390[_0xc93a('0x29')],'type':_0x428390[_0xc93a('0x2a')]['key']};});_0x1e77d9[_0xc93a('0x2b')]=_[_0xc93a('0x27')](_0xf0ccae,_0xc93a('0x2c'));_0x1e77d9[_0xc93a('0x2d')]=_['keys'](_0x558265[_0xc93a('0x2d')]);_0x1e77d9[_0xc93a('0x2e')]=_[_0xc93a('0x2f')](_0x1e77d9[_0xc93a('0x2b')],_0x1e77d9[_0xc93a('0x2d')]);_0x2f6557[_0xc93a('0x30')]=_[_0xc93a('0x2f')](_0x1e77d9[_0xc93a('0x2b')],qs['fields'](_0x558265[_0xc93a('0x2d')][_0xc93a('0x31')]));_0x2f6557['attributes']=_0x2f6557[_0xc93a('0x30')][_0xc93a('0x32')]?_0x2f6557[_0xc93a('0x30')]:_0x1e77d9[_0xc93a('0x2b')];if(!_0x558265[_0xc93a('0x2d')]['hasOwnProperty']('nolimit')){_0x2f6557[_0xc93a('0x1a')]=qs[_0xc93a('0x1a')](_0x558265[_0xc93a('0x2d')]['limit']);_0x2f6557[_0xc93a('0x1c')]=qs[_0xc93a('0x1c')](_0x558265[_0xc93a('0x2d')][_0xc93a('0x1c')]);}_0x2f6557[_0xc93a('0x33')]=qs['sort'](_0x558265['query'][_0xc93a('0x34')]);_0x2f6557[_0xc93a('0x35')]=qs[_0xc93a('0x2e')](_[_0xc93a('0x36')](_0x558265[_0xc93a('0x2d')],_0x1e77d9[_0xc93a('0x2e')]),_0xf0ccae);if(_0x558265['query'][_0xc93a('0x37')]){_0x2f6557[_0xc93a('0x35')]=_[_0xc93a('0x38')](_0x2f6557[_0xc93a('0x35')],{'$or':_[_0xc93a('0x27')](_0xf0ccae,function(_0x80a241){if(_0x80a241[_0xc93a('0x2a')]!==_0xc93a('0x39')){var _0x1609ca={};_0x1609ca[_0x80a241['name']]={'$like':'%'+_0x558265[_0xc93a('0x2d')][_0xc93a('0x37')]+'%'};return _0x1609ca;}})});}_0x2f6557=_[_0xc93a('0x38')]({},_0x2f6557,_0x558265[_0xc93a('0x3a')]);var _0x5e07ac={'where':_0x2f6557[_0xc93a('0x35')]};return db[_0xc93a('0x3b')][_0xc93a('0x1d')](_0x5e07ac)[_0xc93a('0x23')](function(_0x3b6aa9){_0x308c45[_0xc93a('0x1d')]=_0x3b6aa9;if(_0x558265[_0xc93a('0x2d')][_0xc93a('0x3c')]){_0x2f6557[_0xc93a('0x3d')]=[{'all':!![]}];}return db[_0xc93a('0x3b')][_0xc93a('0x3e')](_0x2f6557);})[_0xc93a('0x23')](function(_0x1ae442){_0x308c45['rows']=_0x1ae442;return _0x308c45;})[_0xc93a('0x23')](respondWithFilteredResult(_0x1b7346,_0x2f6557))[_0xc93a('0x3f')](handleError(_0x1b7346,null));};exports[_0xc93a('0x40')]=function(_0x21c32c,_0xccd9b0){var _0x1ea47e={'raw':!![],'where':{'id':_0x21c32c['params']['id']}},_0x176a55={};_0x176a55[_0xc93a('0x2b')]=_[_0xc93a('0x41')](db[_0xc93a('0x3b')][_0xc93a('0x28')]);_0x176a55['query']=_['keys'](_0x21c32c['query']);_0x176a55[_0xc93a('0x2e')]=_[_0xc93a('0x2f')](_0x176a55['model'],_0x176a55[_0xc93a('0x2d')]);_0x1ea47e[_0xc93a('0x30')]=_[_0xc93a('0x2f')](_0x176a55['model'],qs[_0xc93a('0x31')](_0x21c32c[_0xc93a('0x2d')][_0xc93a('0x31')]));_0x1ea47e[_0xc93a('0x30')]=_0x1ea47e[_0xc93a('0x30')]['length']?_0x1ea47e['attributes']:_0x176a55[_0xc93a('0x2b')];if(_0x21c32c[_0xc93a('0x2d')][_0xc93a('0x3c')]){_0x1ea47e[_0xc93a('0x3d')]=[{'all':!![]}];}_0x1ea47e=_['merge']({},_0x1ea47e,_0x21c32c[_0xc93a('0x3a')]);return db[_0xc93a('0x3b')]['find'](_0x1ea47e)[_0xc93a('0x23')](handleEntityNotFound(_0xccd9b0,null))[_0xc93a('0x23')](respondWithResult(_0xccd9b0,null))[_0xc93a('0x3f')](handleError(_0xccd9b0,null));};exports[_0xc93a('0x42')]=function(_0x5757b1,_0xa4e464){return db[_0xc93a('0x3b')][_0xc93a('0x42')](_0x5757b1[_0xc93a('0x43')],{})[_0xc93a('0x23')](respondWithResult(_0xa4e464,0xc9))[_0xc93a('0x3f')](handleError(_0xa4e464,null));};exports['update']=function(_0x2df92d,_0x23f833){if(_0x2df92d[_0xc93a('0x43')]['id']){delete _0x2df92d[_0xc93a('0x43')]['id'];}return db[_0xc93a('0x3b')][_0xc93a('0x44')]({'where':{'id':_0x2df92d[_0xc93a('0x45')]['id']}})[_0xc93a('0x23')](handleEntityNotFound(_0x23f833,null))[_0xc93a('0x23')](saveUpdates(_0x2df92d[_0xc93a('0x43')],null))[_0xc93a('0x23')](respondWithResult(_0x23f833,null))[_0xc93a('0x3f')](handleError(_0x23f833,null));};exports['destroy']=function(_0x17b2bd,_0x458c1a){return db[_0xc93a('0x3b')][_0xc93a('0x44')]({'where':{'id':_0x17b2bd[_0xc93a('0x45')]['id']}})[_0xc93a('0x23')](handleEntityNotFound(_0x458c1a,null))[_0xc93a('0x23')](removeEntity(_0x458c1a,null))['catch'](handleError(_0x458c1a,null));};exports[_0xc93a('0x46')]=function(_0x498fd8,_0xeb536c){return db[_0xc93a('0x3b')][_0xc93a('0x46')]()['then'](respondWithResult(_0xeb536c,null))[_0xc93a('0x3f')](handleError(_0xeb536c,null));}; \ No newline at end of file +var _0x78d2=['includeAll','include','findAll','rows','params','find','catch','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','then','error','stack','name','index','ChatTransferReport','rawAttributes','fieldName','type','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x78d2,0x17d));var _0x278d=function(_0x18d36f,_0x31b65f){_0x18d36f=_0x18d36f-0x0;var _0x10034d=_0x78d2[_0x18d36f];return _0x10034d;};'use strict';var emlformat=require(_0x278d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x278d('0x1'));var jsonpatch=require(_0x278d('0x2'));var rp=require(_0x278d('0x3'));var moment=require(_0x278d('0x4'));var BPromise=require(_0x278d('0x5'));var Mustache=require(_0x278d('0x6'));var util=require(_0x278d('0x7'));var path=require(_0x278d('0x8'));var sox=require(_0x278d('0x9'));var csv=require('to-csv');var ejs=require(_0x278d('0xa'));var fs=require('fs');var fs_extra=require(_0x278d('0xb'));var _=require(_0x278d('0xc'));var squel=require(_0x278d('0xd'));var crypto=require(_0x278d('0xe'));var jsforce=require(_0x278d('0xf'));var deskjs=require(_0x278d('0x10'));var toCsv=require('to-csv');var querystring=require(_0x278d('0x11'));var Papa=require('papaparse');var Redis=require(_0x278d('0x12'));var authService=require(_0x278d('0x13'));var qs=require(_0x278d('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x278d('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x278d('0x16'));var config=require(_0x278d('0x17'));var licenseUtil=require(_0x278d('0x18'));var db=require(_0x278d('0x19'))['db'];function respondWithStatusCode(_0x291e77,_0x58f780){_0x58f780=_0x58f780||0xcc;return function(_0x388895){if(_0x388895){return _0x291e77[_0x278d('0x1a')](_0x58f780);}return _0x291e77[_0x278d('0x1b')](_0x58f780)[_0x278d('0x1c')]();};}function respondWithResult(_0x1722fa,_0x2cd203){_0x2cd203=_0x2cd203||0xc8;return function(_0x3e55cd){if(_0x3e55cd){return _0x1722fa[_0x278d('0x1b')](_0x2cd203)[_0x278d('0x1d')](_0x3e55cd);}};}function respondWithFilteredResult(_0x19f1c8,_0x577220){return function(_0x3c3904){if(_0x3c3904){var _0x5e2880=typeof _0x577220[_0x278d('0x1e')]==='undefined'&&typeof _0x577220[_0x278d('0x1f')]===_0x278d('0x20');var _0x233cc0=_0x3c3904[_0x278d('0x21')];var _0x50cc5c=_0x5e2880?0x0:_0x577220[_0x278d('0x1e')];var _0x261c5d=_0x5e2880?_0x3c3904[_0x278d('0x21')]:_0x577220[_0x278d('0x1e')]+_0x577220['limit'];var _0x3eaa86;if(_0x261c5d>=_0x233cc0){_0x261c5d=_0x233cc0;_0x3eaa86=0xc8;}else{_0x3eaa86=0xce;}_0x19f1c8[_0x278d('0x1b')](_0x3eaa86);return _0x19f1c8[_0x278d('0x22')](_0x278d('0x23'),_0x50cc5c+'-'+_0x261c5d+'/'+_0x233cc0)[_0x278d('0x1d')](_0x3c3904);}return null;};}function patchUpdates(_0x2b10fa){return function(_0xb48aa0){try{jsonpatch['apply'](_0xb48aa0,_0x2b10fa,!![]);}catch(_0x42e5c3){return BPromise['reject'](_0x42e5c3);}return _0xb48aa0['save']();};}function saveUpdates(_0x41ce85,_0x5d92c1){return function(_0x2c4bd3){if(_0x2c4bd3){return _0x2c4bd3[_0x278d('0x24')](_0x41ce85)[_0x278d('0x25')](function(_0x34f16e){return _0x34f16e;});}return null;};}function removeEntity(_0x278c9b,_0x561829){return function(_0x60fed6){if(_0x60fed6){return _0x60fed6['destroy']()[_0x278d('0x25')](function(){_0x278c9b[_0x278d('0x1b')](0xcc)[_0x278d('0x1c')]();});}};}function handleEntityNotFound(_0x556087,_0x47328b){return function(_0x49d8b8){if(!_0x49d8b8){_0x556087[_0x278d('0x1a')](0x194);}return _0x49d8b8;};}function handleError(_0x206b1e,_0x487720){_0x487720=_0x487720||0x1f4;return function(_0x263425){logger[_0x278d('0x26')](_0x263425[_0x278d('0x27')]);if(_0x263425[_0x278d('0x28')]){delete _0x263425['name'];}_0x206b1e[_0x278d('0x1b')](_0x487720)['send'](_0x263425);};}exports[_0x278d('0x29')]=function(_0x1b16d9,_0x59bf85){var _0x4d3738={},_0x122c52={},_0x580915={'count':0x0,'rows':[]};var _0x3343fb=_['map'](db[_0x278d('0x2a')][_0x278d('0x2b')],function(_0x3dbf15){return{'name':_0x3dbf15[_0x278d('0x2c')],'type':_0x3dbf15[_0x278d('0x2d')]['key']};});_0x122c52[_0x278d('0x2e')]=_[_0x278d('0x2f')](_0x3343fb,_0x278d('0x28'));_0x122c52[_0x278d('0x30')]=_[_0x278d('0x31')](_0x1b16d9['query']);_0x122c52['filters']=_['intersection'](_0x122c52['model'],_0x122c52[_0x278d('0x30')]);_0x4d3738['attributes']=_[_0x278d('0x32')](_0x122c52['model'],qs[_0x278d('0x33')](_0x1b16d9['query'][_0x278d('0x33')]));_0x4d3738[_0x278d('0x34')]=_0x4d3738[_0x278d('0x34')][_0x278d('0x35')]?_0x4d3738[_0x278d('0x34')]:_0x122c52[_0x278d('0x2e')];if(!_0x1b16d9[_0x278d('0x30')][_0x278d('0x36')]('nolimit')){_0x4d3738[_0x278d('0x1f')]=qs['limit'](_0x1b16d9['query']['limit']);_0x4d3738[_0x278d('0x1e')]=qs['offset'](_0x1b16d9[_0x278d('0x30')][_0x278d('0x1e')]);}_0x4d3738[_0x278d('0x37')]=qs[_0x278d('0x38')](_0x1b16d9['query']['sort']);_0x4d3738[_0x278d('0x39')]=qs[_0x278d('0x3a')](_[_0x278d('0x3b')](_0x1b16d9[_0x278d('0x30')],_0x122c52[_0x278d('0x3a')]),_0x3343fb);if(_0x1b16d9['query'][_0x278d('0x3c')]){_0x4d3738['where']=_[_0x278d('0x3d')](_0x4d3738['where'],{'$or':_[_0x278d('0x2f')](_0x3343fb,function(_0x1f3712){if(_0x1f3712['type']!=='VIRTUAL'){var _0x2ab4f6={};_0x2ab4f6[_0x1f3712[_0x278d('0x28')]]={'$like':'%'+_0x1b16d9[_0x278d('0x30')]['filter']+'%'};return _0x2ab4f6;}})});}_0x4d3738=_[_0x278d('0x3d')]({},_0x4d3738,_0x1b16d9[_0x278d('0x3e')]);var _0x158660={'where':_0x4d3738[_0x278d('0x39')]};return db['ChatTransferReport'][_0x278d('0x21')](_0x158660)[_0x278d('0x25')](function(_0x24ade6){_0x580915[_0x278d('0x21')]=_0x24ade6;if(_0x1b16d9['query'][_0x278d('0x3f')]){_0x4d3738[_0x278d('0x40')]=[{'all':!![]}];}return db[_0x278d('0x2a')][_0x278d('0x41')](_0x4d3738);})['then'](function(_0x598f1a){_0x580915[_0x278d('0x42')]=_0x598f1a;return _0x580915;})[_0x278d('0x25')](respondWithFilteredResult(_0x59bf85,_0x4d3738))['catch'](handleError(_0x59bf85,null));};exports['show']=function(_0xf5b715,_0x329557){var _0x124f65={'raw':!![],'where':{'id':_0xf5b715[_0x278d('0x43')]['id']}},_0x9023ad={};_0x9023ad[_0x278d('0x2e')]=_['keys'](db['ChatTransferReport']['rawAttributes']);_0x9023ad[_0x278d('0x30')]=_['keys'](_0xf5b715['query']);_0x9023ad[_0x278d('0x3a')]=_[_0x278d('0x32')](_0x9023ad[_0x278d('0x2e')],_0x9023ad[_0x278d('0x30')]);_0x124f65[_0x278d('0x34')]=_['intersection'](_0x9023ad['model'],qs[_0x278d('0x33')](_0xf5b715[_0x278d('0x30')][_0x278d('0x33')]));_0x124f65[_0x278d('0x34')]=_0x124f65['attributes'][_0x278d('0x35')]?_0x124f65[_0x278d('0x34')]:_0x9023ad[_0x278d('0x2e')];if(_0xf5b715[_0x278d('0x30')][_0x278d('0x3f')]){_0x124f65[_0x278d('0x40')]=[{'all':!![]}];}_0x124f65=_[_0x278d('0x3d')]({},_0x124f65,_0xf5b715[_0x278d('0x3e')]);return db[_0x278d('0x2a')][_0x278d('0x44')](_0x124f65)[_0x278d('0x25')](handleEntityNotFound(_0x329557,null))[_0x278d('0x25')](respondWithResult(_0x329557,null))[_0x278d('0x45')](handleError(_0x329557,null));};exports[_0x278d('0x46')]=function(_0x245209,_0x53dfa1){return db['ChatTransferReport'][_0x278d('0x46')](_0x245209['body'],{})['then'](respondWithResult(_0x53dfa1,0xc9))[_0x278d('0x45')](handleError(_0x53dfa1,null));};exports[_0x278d('0x24')]=function(_0x4c7152,_0x2928e8){if(_0x4c7152[_0x278d('0x47')]['id']){delete _0x4c7152[_0x278d('0x47')]['id'];}return db['ChatTransferReport'][_0x278d('0x44')]({'where':{'id':_0x4c7152[_0x278d('0x43')]['id']}})[_0x278d('0x25')](handleEntityNotFound(_0x2928e8,null))[_0x278d('0x25')](saveUpdates(_0x4c7152['body'],null))[_0x278d('0x25')](respondWithResult(_0x2928e8,null))[_0x278d('0x45')](handleError(_0x2928e8,null));};exports[_0x278d('0x48')]=function(_0x8bb6c3,_0x3735e0){return db[_0x278d('0x2a')]['find']({'where':{'id':_0x8bb6c3[_0x278d('0x43')]['id']}})['then'](handleEntityNotFound(_0x3735e0,null))[_0x278d('0x25')](removeEntity(_0x3735e0,null))[_0x278d('0x45')](handleError(_0x3735e0,null));};exports[_0x278d('0x49')]=function(_0x3a0312,_0x3c309b){return db['ChatTransferReport']['describe']()[_0x278d('0x25')](respondWithResult(_0x3c309b,null))[_0x278d('0x45')](handleError(_0x3c309b,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 4af0b61..7aa8cf1 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 _0xa2b4=['ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','exports','define'];(function(_0x28198f,_0x4b1fb8){var _0x5eef0a=function(_0x26929a){while(--_0x26929a){_0x28198f['push'](_0x28198f['shift']());}};_0x5eef0a(++_0x4b1fb8);}(_0xa2b4,0xfc));var _0x4a2b=function(_0x10afad,_0x30da9d){_0x10afad=_0x10afad-0x0;var _0x588d7e=_0xa2b4[_0x10afad];return _0x588d7e;};'use strict';var _=require(_0x4a2b('0x0'));var util=require(_0x4a2b('0x1'));var logger=require(_0x4a2b('0x2'))(_0x4a2b('0x3'));var moment=require(_0x4a2b('0x4'));var BPromise=require('bluebird');var rp=require(_0x4a2b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatTransferReport.attributes');module[_0x4a2b('0x6')]=function(_0x856106,_0x3c14c2){return _0x856106[_0x4a2b('0x7')](_0x4a2b('0x8'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x4a2b('0x9'),'fields':[_0x4a2b('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x234f=['exports','define','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes'];(function(_0x4fd75e,_0x219e4a){var _0x5b6338=function(_0xf2969c){while(--_0xf2969c){_0x4fd75e['push'](_0x4fd75e['shift']());}};_0x5b6338(++_0x219e4a);}(_0x234f,0x87));var _0xf234=function(_0x3a42c2,_0x1860f5){_0x3a42c2=_0x3a42c2-0x0;var _0x525455=_0x234f[_0x3a42c2];return _0x525455;};'use strict';var _=require('lodash');var util=require(_0xf234('0x0'));var logger=require(_0xf234('0x1'))('api');var moment=require(_0xf234('0x2'));var BPromise=require(_0xf234('0x3'));var rp=require(_0xf234('0x4'));var fs=require('fs');var path=require(_0xf234('0x5'));var rimraf=require(_0xf234('0x6'));var config=require(_0xf234('0x7'));var attributes=require(_0xf234('0x8'));module[_0xf234('0x9')]=function(_0x397f4a,_0x5076af){return _0x397f4a[_0xf234('0xa')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0xf234('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index b1fc381..3f37643 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 _0x85a3=['info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','client','http'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x85a3,0x13a));var _0x385a=function(_0x413b15,_0x5bb73f){_0x413b15=_0x413b15-0x0;var _0x1debc7=_0x85a3[_0x413b15];return _0x1debc7;};'use strict';var _=require(_0x385a('0x0'));var util=require(_0x385a('0x1'));var moment=require(_0x385a('0x2'));var BPromise=require(_0x385a('0x3'));var rs=require(_0x385a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x385a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x385a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x385a('0x7')][_0x385a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5911be,_0x23e436,_0x271dd1){return new BPromise(function(_0x6d1790,_0x533153){return client['request'](_0x5911be,_0x271dd1)['then'](function(_0x50bfdf){logger[_0x385a('0x9')](_0x385a('0xa'),_0x23e436,'request\x20sent');logger[_0x385a('0xb')](_0x385a('0xc'),_0x23e436,'request\x20sent',JSON[_0x385a('0xd')](_0x50bfdf));if(_0x50bfdf[_0x385a('0xe')]){if(_0x50bfdf[_0x385a('0xe')][_0x385a('0xf')]===0x1f4){logger[_0x385a('0xe')](_0x385a('0xa'),_0x23e436,_0x50bfdf['error'][_0x385a('0x10')]);return _0x533153(_0x50bfdf[_0x385a('0xe')][_0x385a('0x10')]);}logger[_0x385a('0xe')](_0x385a('0xa'),_0x23e436,_0x50bfdf['error']['message']);return _0x6d1790(_0x50bfdf[_0x385a('0xe')][_0x385a('0x10')]);}else{logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x23e436,_0x385a('0x11'));_0x6d1790(_0x50bfdf[_0x385a('0x12')][_0x385a('0x10')]);}})['catch'](function(_0x3b4bad){logger[_0x385a('0xe')](_0x385a('0xa'),_0x23e436,_0x3b4bad);_0x533153(_0x3b4bad);});});} \ No newline at end of file +var _0x0b5b=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x520449,_0x45e8de){var _0x4d38ff=function(_0x4b2287){while(--_0x4b2287){_0x520449['push'](_0x520449['shift']());}};_0x4d38ff(++_0x45e8de);}(_0x0b5b,0xe9));var _0xb0b5=function(_0x1acf69,_0x2a6dea){_0x1acf69=_0x1acf69-0x0;var _0x17c66e=_0x0b5b[_0x1acf69];return _0x17c66e;};'use strict';var _=require(_0xb0b5('0x0'));var util=require(_0xb0b5('0x1'));var moment=require(_0xb0b5('0x2'));var BPromise=require('bluebird');var rs=require(_0xb0b5('0x3'));var fs=require('fs');var Redis=require(_0xb0b5('0x4'));var db=require(_0xb0b5('0x5'))['db'];var utils=require(_0xb0b5('0x6'));var logger=require(_0xb0b5('0x7'))(_0xb0b5('0x8'));var config=require(_0xb0b5('0x9'));var jayson=require(_0xb0b5('0xa'));var client=jayson[_0xb0b5('0xb')][_0xb0b5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1673cc,_0x444b22,_0x21022a){return new BPromise(function(_0x2bc935,_0xfb8d1d){return client[_0xb0b5('0xd')](_0x1673cc,_0x21022a)[_0xb0b5('0xe')](function(_0xa2d61e){logger[_0xb0b5('0xf')](_0xb0b5('0x10'),_0x444b22,_0xb0b5('0x11'));logger[_0xb0b5('0x12')](_0xb0b5('0x13'),_0x444b22,_0xb0b5('0x11'),JSON[_0xb0b5('0x14')](_0xa2d61e));if(_0xa2d61e[_0xb0b5('0x15')]){if(_0xa2d61e['error'][_0xb0b5('0x16')]===0x1f4){logger[_0xb0b5('0x15')](_0xb0b5('0x10'),_0x444b22,_0xa2d61e[_0xb0b5('0x15')][_0xb0b5('0x17')]);return _0xfb8d1d(_0xa2d61e[_0xb0b5('0x15')]['message']);}logger['error'](_0xb0b5('0x10'),_0x444b22,_0xa2d61e[_0xb0b5('0x15')][_0xb0b5('0x17')]);return _0x2bc935(_0xa2d61e[_0xb0b5('0x15')][_0xb0b5('0x17')]);}else{logger['info'](_0xb0b5('0x10'),_0x444b22,_0xb0b5('0x11'));_0x2bc935(_0xa2d61e[_0xb0b5('0x18')][_0xb0b5('0x17')]);}})[_0xb0b5('0x19')](function(_0x2b1f8c){logger[_0xb0b5('0x15')](_0xb0b5('0x10'),_0x444b22,_0x2b1f8c);_0xfb8d1d(_0x2b1f8c);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 829abe3..9c14514 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 _0xc43e=['put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','/describe','describe','/:id','isAuthenticated','show','post','create'];(function(_0x37d915,_0x4d8742){var _0x58e8b9=function(_0xdc5424){while(--_0xdc5424){_0x37d915['push'](_0x37d915['shift']());}};_0x58e8b9(++_0x4d8742);}(_0xc43e,0x1e8));var _0xec43=function(_0x23e100,_0x434387){_0x23e100=_0x23e100-0x0;var _0x58ed9a=_0xc43e[_0x23e100];return _0x58ed9a;};'use strict';var multer=require(_0xec43('0x0'));var util=require(_0xec43('0x1'));var path=require(_0xec43('0x2'));var timeout=require(_0xec43('0x3'));var express=require(_0xec43('0x4'));var router=express['Router']();var fs_extra=require(_0xec43('0x5'));var auth=require(_0xec43('0x6'));var interaction=require(_0xec43('0x7'));var config=require(_0xec43('0x8'));var controller=require(_0xec43('0x9'));router[_0xec43('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xec43('0xa')](_0xec43('0xb'),auth['isAuthenticated'](),controller[_0xec43('0xc')]);router[_0xec43('0xa')](_0xec43('0xd'),auth[_0xec43('0xe')](),controller[_0xec43('0xf')]);router[_0xec43('0x10')]('/',auth[_0xec43('0xe')](),controller[_0xec43('0x11')]);router[_0xec43('0x12')](_0xec43('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xec43('0x13')](_0xec43('0xd'),auth[_0xec43('0xe')](),controller[_0xec43('0x14')]);module[_0xec43('0x15')]=router; \ No newline at end of file +var _0x45b8=['isAuthenticated','index','/describe','describe','/:id','show','create','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x33c638,_0x462bff){var _0x18a079=function(_0x336610){while(--_0x336610){_0x33c638['push'](_0x33c638['shift']());}};_0x18a079(++_0x462bff);}(_0x45b8,0x1d7));var _0x845b=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x45b8[_0x9cd4c3];return _0x4c9025;};'use strict';var multer=require('multer');var util=require(_0x845b('0x0'));var path=require(_0x845b('0x1'));var timeout=require(_0x845b('0x2'));var express=require(_0x845b('0x3'));var router=express[_0x845b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x845b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x845b('0x6'));var controller=require(_0x845b('0x7'));router[_0x845b('0x8')]('/',auth[_0x845b('0x9')](),controller[_0x845b('0xa')]);router['get'](_0x845b('0xb'),auth[_0x845b('0x9')](),controller[_0x845b('0xc')]);router['get'](_0x845b('0xd'),auth[_0x845b('0x9')](),controller[_0x845b('0xe')]);router['post']('/',auth[_0x845b('0x9')](),controller[_0x845b('0xf')]);router[_0x845b('0x10')](_0x845b('0xd'),auth[_0x845b('0x9')](),controller[_0x845b('0x11')]);router[_0x845b('0x12')](_0x845b('0xd'),auth[_0x845b('0x9')](),controller['destroy']);module[_0x845b('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 30019b0..daa5925 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 _0xc06f=['#ffffff','INTEGER','rounded','We\x20are\x20here!','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','star','stringify','input','name','text','onlineForm','getDataValue','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.','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.','TEXT','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','address','STRING','email','Agent','#011F6A'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc06f,0x13c));var _0xfc06=function(_0x443f0c,_0x2696a5){_0x443f0c=_0x443f0c-0x0;var _0x1090eb=_0xc06f[_0x443f0c];return _0x1090eb;};'use strict';var Sequelize=require(_0xfc06('0x0'));var rs=require(_0xfc06('0x1'));module[_0xfc06('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfc06('0x3')},'description':{'type':Sequelize[_0xfc06('0x4')]},'mapKey':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x5')},'mapKeyOffline':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x5')},'key':{'type':Sequelize[_0xfc06('0x4')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x6')},'customerAlias':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xfc06('0x4')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xfc06('0x4')],'allowNull':![],'defaultValue':_0xfc06('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xfc06('0x4')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xfc06('0x4')],'allowNull':![],'defaultValue':_0xfc06('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xfc06('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0xfc06('0xa'),'squared'),'defaultValue':_0xfc06('0xa')},'header_online':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0xb')},'start_chat_button':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0xc')},'header_offline':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0xd')},'download_transcript':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xfc06('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xfc06('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xfc06('0x10')},'formSubmitSuccessMessage':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x12')},'noteTitle':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x13')},'placeholderMessage':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x14')},'closingMessage':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x15')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xfc06('0xc')},'skipMessageButton':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x16')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x17')},'ratingType':{'type':Sequelize[_0xfc06('0x18')]('star','thumb'),'defaultValue':_0xfc06('0x19')},'ratingStarsNumber':{'type':Sequelize[_0xfc06('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xfc06('0x1a')]({'items':[{'type':_0xfc06('0x1b'),'variable':null,'config':{'placeholder':_0xfc06('0x1c'),'type':_0xfc06('0x1d'),'required':!![]},'props':{'title':_0xfc06('0x1c'),'helpText':''}},{'type':_0xfc06('0x1b'),'props':{'title':_0xfc06('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xfc06('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xfc06('0x1e'))?JSON['parse'](this[_0xfc06('0x1f')](_0xfc06('0x1e'))):{};},'set':function(_0x19ea69){return this['setDataValue']('onlineForm',JSON[_0xfc06('0x1a')](_0x19ea69));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xfc06('0x1a')]({'items':[{'type':_0xfc06('0x1b'),'props':{'title':_0xfc06('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0xfc06('0x5'),'type':_0xfc06('0x5')},'variable':null},{'type':_0xfc06('0x20'),'config':{'placeholder':_0xfc06('0x21')},'props':{'title':_0xfc06('0x21'),'helpText':_0xfc06('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0xfc06('0x1f')](_0xfc06('0x23'))?JSON['parse'](this[_0xfc06('0x1f')](_0xfc06('0x23'))):{};},'set':function(_0x4d6b7b){return this[_0xfc06('0x24')](_0xfc06('0x23'),JSON[_0xfc06('0x1a')](_0x4d6b7b));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xfc06('0x4')]},'forwardOffline':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xfc06('0x4')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xfc06('0x25')},'waitingMessage':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x26')},'offlineMessageSubject':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x27')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xfc06('0x28')},'enableUnmanagedNote':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x29')},'skipUnmanaged':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x16')},'sendUnmanaged':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xfc06('0x2a')]},'showAgentAvatar':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xfc06('0x4')]},'notificationTemplate':{'type':Sequelize[_0xfc06('0x2a')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xfc06('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x2c')},'verticalAlignment':{'type':Sequelize[_0xfc06('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x2d')},'messagesAlignment':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':_0xfc06('0x2e')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xfc06('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xfc06('0x4')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfc06('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfc06('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0xfc06('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfc06('0x9')],'comment':_0xfc06('0x30')},'mandatoryDisposition':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':![],'comment':_0xfc06('0x31'),'set':function(_0x9c8728){if(!_0x9c8728)this[_0xfc06('0x24')](_0xfc06('0x32'),null);this['setDataValue'](_0xfc06('0x33'),_0x9c8728);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfc06('0x34')},'vidaooNote':{'type':Sequelize[_0xfc06('0x4')],'defaultValue':function(){return _0xfc06('0x35');}},'vidaooMetadata':{'type':Sequelize[_0xfc06('0x2a')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xfc06('0xe')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xfb50=['mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','star','input','name','text','getDataValue','onlineForm','setDataValue','stringify','textarea','Comments','offlineForm','parse','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.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId'];(function(_0x1ca993,_0x243c1e){var _0x150e5e=function(_0xaf1a3e){while(--_0xaf1a3e){_0x1ca993['push'](_0x1ca993['shift']());}};_0x150e5e(++_0x243c1e);}(_0xfb50,0x10b));var _0x0fb5=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0xfb50[_0x4914e2];return _0x2dcd07;};'use strict';var Sequelize=require(_0x0fb5('0x0'));var rs=require(_0x0fb5('0x1'));module[_0x0fb5('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x0fb5('0x3')],'allowNull':![],'unique':_0x0fb5('0x4')},'description':{'type':Sequelize[_0x0fb5('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x0fb5('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x0fb5('0x5')},'key':{'type':Sequelize[_0x0fb5('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0x6')},'customerAlias':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x0fb5('0x3')],'allowNull':![],'defaultValue':_0x0fb5('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x0fb5('0x3')],'allowNull':![],'defaultValue':_0x0fb5('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x0fb5('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0fb5('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x0fb5('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x0fb5('0x3')]},'animation':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x0fb5('0xb'),_0x0fb5('0xc')),'defaultValue':_0x0fb5('0xb')},'header_online':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0xd')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0xe')},'header_offline':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0xf')},'download_transcript':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x0fb5('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0fb5('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x0fb5('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0fb5('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0x13')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x0fb5('0x14')},'placeholderMessage':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0x15')},'closingMessage':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0x16')},'closingMessageButton':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0x17')},'conditionAgreement':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0x18')},'ratingType':{'type':Sequelize[_0x0fb5('0x19')](_0x0fb5('0x1a'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x0fb5('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x0fb5('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x0fb5('0x1b'),'variable':null,'config':{'placeholder':_0x0fb5('0x1c'),'type':_0x0fb5('0x1d'),'required':!![]},'props':{'title':_0x0fb5('0x1c'),'helpText':''}},{'type':_0x0fb5('0x1b'),'props':{'title':_0x0fb5('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x0fb5('0x5'),'type':_0x0fb5('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0fb5('0x1e')]('onlineForm')?JSON['parse'](this[_0x0fb5('0x1e')](_0x0fb5('0x1f'))):{};},'set':function(_0x50c3d9){return this[_0x0fb5('0x20')]('onlineForm',JSON['stringify'](_0x50c3d9));}},'offlineForm':{'type':Sequelize[_0x0fb5('0x10')],'defaultValue':function(){return JSON[_0x0fb5('0x21')]({'items':[{'type':_0x0fb5('0x1b'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x0fb5('0x5'),'type':'email'},'variable':null},{'type':_0x0fb5('0x22'),'config':{'placeholder':_0x0fb5('0x23')},'props':{'title':_0x0fb5('0x23'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x0fb5('0x24'))?JSON[_0x0fb5('0x25')](this[_0x0fb5('0x1e')]('offlineForm')):{};},'set':function(_0x43cb61){return this[_0x0fb5('0x20')](_0x0fb5('0x24'),JSON[_0x0fb5('0x21')](_0x43cb61));}},'token':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':function(){return rs[_0x0fb5('0x26')]();}},'autoclose':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x0fb5('0x3')]},'forwardOffline':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0fb5('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x0fb5('0x27')},'waitingMessage':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0x28')},'offlineMessageSubject':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x0fb5('0x29')},'enableUnmanagedNote':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0x2a')},'skipUnmanaged':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0x17')},'sendUnmanaged':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x0fb5('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x0fb5('0x3')]},'notificationTemplate':{'type':Sequelize[_0x0fb5('0x10')],'defaultValue':function(){return _0x0fb5('0x2b');}},'notificationSound':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0x0fb5('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x0fb5('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x0fb5('0x2d')},'verticalAlignment':{'type':Sequelize[_0x0fb5('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':_0x0fb5('0x2e')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x0fb5('0x10')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x0fb5('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x0fb5('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0fb5('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x0fb5('0x2f')},'systemAvatar':{'type':Sequelize[_0x0fb5('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0fb5('0x9')],'comment':_0x0fb5('0x30')},'mandatoryDisposition':{'type':Sequelize[_0x0fb5('0xa')],'defaultValue':![],'comment':_0x0fb5('0x31'),'set':function(_0x33134a){if(!_0x33134a)this[_0x0fb5('0x20')](_0x0fb5('0x32'),null);this[_0x0fb5('0x20')](_0x0fb5('0x33'),_0x33134a);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x0fb5('0x3')]},'vidaooTopic':{'type':Sequelize[_0x0fb5('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x0fb5('0x3')],'defaultValue':function(){return _0x0fb5('0x34');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x0fb5('0x10')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index c750ffa..1e53e6c 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 _0x7118=['headers','origin','http://localhost:9000','testWebsiteWithWildcard','connection','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','findAndCountAll','finally','getApplications','addProactiveActions','omit','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','path','ejs','lodash','querystring','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','../../config/environment','../../errors/api','APIBadRequestError','APINotFoundError','APIOutOfIntervalError','handleError','APIConflictError','URL','../../mysqldb','redis','localhost','socket.io-emitter','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','status','json','undefined','count','offset','limit','set','Content-Range','update','get','ChatWebsites','UserProfileResource','destroy','sendStatus','stack','name','send','setUA','user-agent','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','model','vendor','%s\x20%s\x20%s','type','index','Pause','map','ChatWebsite','fieldName','key','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','show','params','mandatoryDispositionPause','rawAttributes','length','find','create','body','address','forEach','trim','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','testWildcardValidity','describe','ChatWebsiteId','Disposition','getDispositions','keys','includeAll','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','rows','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','customerAvatar','addSystemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','existsSync','join','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','Interval','resolve','timezone','notify','chat','from','From\x20is\x20mandatory','Body\x20is\x20mandatory','CmContact','No\x20available\x20attributes','createdAt','updatedAt','includes','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','mapKey','DESC','ChatApplication','Applications','Intervals','interval','account','applications','orderBy','priority','asc','list','List','ListId','Contacts','defaults','contact','threadId','ChatInteraction','closed','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','messageId','created','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','forcedOwnership','queueId','ChatQueue','unshift','waitForTheAssignedQueue','offline','Sequelize','ValidationError','no\x20available\x20attributes','difference','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','CmList','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','subjectOffline','offlineMessageSubject','Chat','NotifyMailAccount','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','User','Owner','Tag','Tags','color','tag','getSnippet','getProactiveActions','virtual','License','increment','chatLicenseExceeded','ifTime','server/files/chat/iframe.ejs'];(function(_0x1bc504,_0x50a8bf){var _0x17656e=function(_0x16ca1b){while(--_0x16ca1b){_0x1bc504['push'](_0x1bc504['shift']());}};_0x17656e(++_0x50a8bf);}(_0x7118,0x159));var _0x8711=function(_0x32843c,_0x205bbf){_0x32843c=_0x32843c-0x0;var _0x5e2059=_0x7118[_0x32843c];return _0x5e2059;};'use strict';var Mustache=require('mustache');var util=require('util');var path=require(_0x8711('0x0'));var ejs=require(_0x8711('0x1'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8711('0x2'));var querystring=require(_0x8711('0x3'));var htmlToText=require(_0x8711('0x4'));var Redis=require(_0x8711('0x5'));var jayson=require(_0x8711('0x6'));var qs=require(_0x8711('0x7'));var logger=require(_0x8711('0x8'))('api');var config=require(_0x8711('0x9'));var APIBadRequestError=require(_0x8711('0xa'))[_0x8711('0xb')];var APINotFoundError=require(_0x8711('0xa'))[_0x8711('0xc')];var APIOutOfIntervalError=require(_0x8711('0xa'))[_0x8711('0xd')];var APIHandleError=require(_0x8711('0xa'))[_0x8711('0xe')];var APIConflictError=require(_0x8711('0xa'))[_0x8711('0xf')];var wildcardUtils=require('./helpers/wildcard-expressions');var URL=require('url')[_0x8711('0x10')];var db=require(_0x8711('0x11'))['db'];config[_0x8711('0x12')]=_['defaults'](config['redis'],{'host':_0x8711('0x13'),'port':0x18eb});var socket=require(_0x8711('0x14'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0x8711('0x15')](socket);var client=jayson[_0x8711('0x16')][_0x8711('0x17')]({'port':0x232c});var client9002=jayson[_0x8711('0x16')][_0x8711('0x17')]({'port':0x232a});var client9003=jayson[_0x8711('0x16')][_0x8711('0x17')]({'port':0x232b});var client9001=jayson['client'][_0x8711('0x17')]({'port':0x2329});function respondWithRpcPromise(_0x363bcd,_0x13f394,_0x2e12ec,_0x3ab905){return new Promise(function(_0x4628e9,_0x57fedb){var _0x2f96a0=_0x3ab905||client;return _0x2f96a0[_0x8711('0x18')](_0x363bcd,_0x2e12ec)[_0x8711('0x19')](function(_0xe1e9b3){logger[_0x8711('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x13f394,'request\x20sent');logger['debug'](_0x8711('0x1b'),_0x13f394,_0x8711('0x1c'),JSON[_0x8711('0x1d')](_0xe1e9b3));if(_0xe1e9b3['error']){if(_0xe1e9b3['error'][_0x8711('0x1e')]===0x1f4){logger[_0x8711('0x1f')](_0x8711('0x20'),_0x13f394,_0xe1e9b3[_0x8711('0x1f')][_0x8711('0x21')]);return _0x57fedb(_0xe1e9b3[_0x8711('0x1f')][_0x8711('0x21')]);}logger[_0x8711('0x1f')](_0x8711('0x20'),_0x13f394,_0xe1e9b3[_0x8711('0x1f')]['message']);return _0x4628e9(_0xe1e9b3[_0x8711('0x1f')][_0x8711('0x21')]);}else{logger[_0x8711('0x1a')](_0x8711('0x20'),_0x13f394,'request\x20sent');_0x4628e9(_0xe1e9b3[_0x8711('0x22')][_0x8711('0x21')]);}})[_0x8711('0x23')](function(_0x5ab925){logger[_0x8711('0x1f')](_0x8711('0x20'),_0x13f394,_0x5ab925);_0x57fedb(_0x5ab925);});});}function respondWithStatusCode(_0x3e8281,_0x217197){_0x217197=_0x217197||0xcc;return function(_0x3f937b){if(_0x3f937b){return _0x3e8281['sendStatus'](_0x217197);}return _0x3e8281['status'](_0x217197)['end']();};}function respondWithResult(_0x2ad1fa,_0x16ea3b){_0x16ea3b=_0x16ea3b||0xc8;return function(_0x2d0901){if(_0x2d0901){return _0x2ad1fa[_0x8711('0x24')](_0x16ea3b)[_0x8711('0x25')](_0x2d0901);}};}function respondWithFilteredResult(_0x254b35,_0x359093){return function(_0x3ca2b5){if(_0x3ca2b5){var _0x398097=typeof _0x359093['offset']===_0x8711('0x26')&&typeof _0x359093['limit']===_0x8711('0x26');var _0xd0c671=_0x3ca2b5[_0x8711('0x27')];var _0x5a11dd=_0x398097?0x0:_0x359093[_0x8711('0x28')];var _0x5e6111=_0x398097?_0x3ca2b5[_0x8711('0x27')]:_0x359093[_0x8711('0x28')]+_0x359093[_0x8711('0x29')];var _0x5c4fcc;if(_0x5e6111>=_0xd0c671){_0x5e6111=_0xd0c671;_0x5c4fcc=0xc8;}else{_0x5c4fcc=0xce;}_0x254b35['status'](_0x5c4fcc);return _0x254b35[_0x8711('0x2a')](_0x8711('0x2b'),_0x5a11dd+'-'+_0x5e6111+'/'+_0xd0c671)[_0x8711('0x25')](_0x3ca2b5);}return null;};}function saveUpdates(_0x6ab2c7){return function(_0x1c2fae){if(_0x1c2fae){return _0x1c2fae[_0x8711('0x2c')](_0x6ab2c7)[_0x8711('0x19')](function(_0x64cf25){return _0x64cf25;});}return null;};}function removeEntity(_0x356303){return function(_0x36f3bd){if(_0x36f3bd){return _0x36f3bd['destroy']()[_0x8711('0x19')](function(){var _0x11c1e9=_0x36f3bd[_0x8711('0x2d')]({'plain':!![]});var _0x285390=_0x8711('0x2e');return db[_0x8711('0x2f')][_0x8711('0x30')]({'where':{'type':_0x285390,'resourceId':_0x11c1e9['id']}})[_0x8711('0x19')](function(){return _0x36f3bd;});})[_0x8711('0x19')](function(){_0x356303[_0x8711('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18643f){return function(_0x318e5d){if(!_0x318e5d){_0x18643f[_0x8711('0x31')](0x194);}return _0x318e5d;};}function handleError(_0x33b1e7,_0x2ddf9f){_0x2ddf9f=_0x2ddf9f||0x1f4;return function(_0x4cbf06){logger[_0x8711('0x1f')](_0x4cbf06[_0x8711('0x32')]);if(_0x4cbf06[_0x8711('0x33')]){delete _0x4cbf06['name'];}_0x33b1e7[_0x8711('0x24')](_0x2ddf9f)[_0x8711('0x34')](_0x4cbf06);};}function createInteractionObject(_0x612a46,_0x1f2b1f,_0x1953ef,_0x14922d){var _0x263be0=require('user-agent-parser');var _0xd805b9=new _0x263be0();var _0x1c1f1b=_0xd805b9[_0x8711('0x35')](_0x1953ef[_0x8711('0x36')])['getResult']();var _0x5de511=_0x1f2b1f[_0x8711('0x37')];if(_0x1953ef[_0x8711('0x38')]){_0x5de511=_0x1953ef[_0x8711('0x38')];}else if(_0x1953ef[_0x8711('0x39')]){_0x5de511=_[_0x8711('0x3a')](_0x1953ef[_0x8711('0x39')][_0x8711('0x3b')](','));}return{'ContactId':_0x14922d['id'],'ChatWebsiteId':_0x612a46,'from':(_0x14922d[_0x8711('0x3c')]||'')+'\x20'+(_0x14922d[_0x8711('0x3d')]||''),'customerIp':_0x5de511,'customerPort':_0x1953ef[_0x8711('0x3e')]?_0x1953ef[_0x8711('0x3e')]:null,'referer':_0x1f2b1f[_0x8711('0x3f')],'browserName':_0x1c1f1b[_0x8711('0x40')][_0x8711('0x33')]&&_0x1c1f1b[_0x8711('0x40')][_0x8711('0x41')]?util[_0x8711('0x42')](_0x8711('0x43'),_0x1c1f1b[_0x8711('0x40')][_0x8711('0x33')],_0x1c1f1b[_0x8711('0x40')]['version']):_0x8711('0x44'),'browserVersion':_0x1c1f1b['browser'][_0x8711('0x41')]||_0x8711('0x44'),'osName':util[_0x8711('0x42')](_0x8711('0x43'),_0x1c1f1b['os']['name'],_0x1c1f1b['os'][_0x8711('0x41')]),'osVersion':_0x1c1f1b['os'][_0x8711('0x41')],'deviceModel':_0x1c1f1b[_0x8711('0x45')][_0x8711('0x46')]&&_0x1c1f1b[_0x8711('0x45')][_0x8711('0x47')]?util['format'](_0x8711('0x48'),_0x1c1f1b[_0x8711('0x45')][_0x8711('0x46')],_0x1c1f1b[_0x8711('0x45')]['vendor'],_0x1c1f1b[_0x8711('0x45')][_0x8711('0x49')]):null,'deviceVendor':_0x1c1f1b[_0x8711('0x45')][_0x8711('0x47')],'deviceType':_0x1c1f1b[_0x8711('0x45')]['type'],'formData':JSON['stringify'](_0x1f2b1f)};}exports[_0x8711('0x4a')]=function(_0x291d0e,_0x5579a6){var _0x9fba5c={'include':[{'model':db[_0x8711('0x4b')],'as':'mandatoryDispositionPause'}]},_0x22a256={},_0x344548={'count':0x0,'rows':[]};var _0x34ef5a=_[_0x8711('0x4c')](db[_0x8711('0x4d')]['rawAttributes'],function(_0x3cb781){return{'name':_0x3cb781[_0x8711('0x4e')],'type':_0x3cb781['type'][_0x8711('0x4f')]};});_0x22a256[_0x8711('0x46')]=_['map'](_0x34ef5a,_0x8711('0x33'));_0x22a256[_0x8711('0x50')]=_['keys'](_0x291d0e[_0x8711('0x50')]);_0x22a256[_0x8711('0x51')]=_[_0x8711('0x52')](_0x22a256[_0x8711('0x46')],_0x22a256['query']);_0x9fba5c[_0x8711('0x53')]=_[_0x8711('0x52')](_0x22a256['model'],qs[_0x8711('0x54')](_0x291d0e[_0x8711('0x50')]['fields']));_0x9fba5c['attributes']=_0x9fba5c['attributes']['length']?_0x9fba5c[_0x8711('0x53')]:_0x22a256[_0x8711('0x46')];if(!_0x291d0e[_0x8711('0x50')][_0x8711('0x55')](_0x8711('0x56'))){_0x9fba5c[_0x8711('0x29')]=qs[_0x8711('0x29')](_0x291d0e['query']['limit']);_0x9fba5c['offset']=qs[_0x8711('0x28')](_0x291d0e[_0x8711('0x50')][_0x8711('0x28')]);}_0x9fba5c[_0x8711('0x57')]=qs[_0x8711('0x58')](_0x291d0e[_0x8711('0x50')]['sort']);_0x9fba5c[_0x8711('0x59')]=qs[_0x8711('0x51')](_[_0x8711('0x5a')](_0x291d0e['query'],_0x22a256[_0x8711('0x51')]),_0x34ef5a);if(_0x291d0e[_0x8711('0x50')][_0x8711('0x5b')]){_0x9fba5c[_0x8711('0x59')]=_[_0x8711('0x5c')](_0x9fba5c[_0x8711('0x59')],{'$or':_[_0x8711('0x4c')](_0x34ef5a,function(_0x171f3f){if(_0x171f3f['type']!==_0x8711('0x5d')){var _0x55d8b7={};_0x55d8b7[_0x171f3f[_0x8711('0x33')]]={'$like':'%'+_0x291d0e['query']['filter']+'%'};return _0x55d8b7;}})});}_0x9fba5c=_['merge']({},_0x9fba5c,_0x291d0e[_0x8711('0x5e')]);var _0x1ee501={'where':_0x9fba5c['where']};return db[_0x8711('0x4d')]['count'](_0x1ee501)[_0x8711('0x19')](function(_0x152863){_0x344548['count']=_0x152863;if(_0x291d0e[_0x8711('0x50')]['includeAll']){_0x9fba5c[_0x8711('0x5f')]=[{'all':!![]}];}return db[_0x8711('0x4d')]['findAll'](_0x9fba5c);})['then'](function(_0x44e243){_0x344548['rows']=_0x44e243;return _0x344548;})[_0x8711('0x19')](respondWithFilteredResult(_0x5579a6,_0x9fba5c))[_0x8711('0x23')](handleError(_0x5579a6,null));};exports[_0x8711('0x60')]=function(_0x158d97,_0x3c03bf){var _0x5dfb08={'raw':![],'where':{'id':_0x158d97[_0x8711('0x61')]['id']},'include':[{'model':db[_0x8711('0x4b')],'as':_0x8711('0x62')}]},_0x20bceb={};_0x20bceb[_0x8711('0x46')]=_['keys'](db[_0x8711('0x4d')][_0x8711('0x63')]);_0x20bceb[_0x8711('0x50')]=_['keys'](_0x158d97['query']);_0x20bceb[_0x8711('0x51')]=_[_0x8711('0x52')](_0x20bceb['model'],_0x20bceb['query']);_0x5dfb08['attributes']=_[_0x8711('0x52')](_0x20bceb[_0x8711('0x46')],qs[_0x8711('0x54')](_0x158d97[_0x8711('0x50')][_0x8711('0x54')]));_0x5dfb08[_0x8711('0x53')]=_0x5dfb08[_0x8711('0x53')][_0x8711('0x64')]?_0x5dfb08[_0x8711('0x53')]:_0x20bceb[_0x8711('0x46')];if(_0x158d97[_0x8711('0x50')]['includeAll']){_0x5dfb08[_0x8711('0x5f')]=[{'all':!![]}];}_0x5dfb08=_[_0x8711('0x5c')]({},_0x5dfb08,_0x158d97[_0x8711('0x5e')]);return db[_0x8711('0x4d')][_0x8711('0x65')](_0x5dfb08)[_0x8711('0x19')](handleEntityNotFound(_0x3c03bf,null))[_0x8711('0x19')](respondWithResult(_0x3c03bf,null))[_0x8711('0x23')](handleError(_0x3c03bf,null));};exports[_0x8711('0x66')]=function(_0x397c02,_0x5706f5){var _0x2d4142=null;_0x397c02[_0x8711('0x67')][_0x8711('0x68')]['split'](',')[_0x8711('0x69')](_0x19f845=>{if(_0x19f845[_0x8711('0x6a')]()!==''&&!wildcardUtils['testWildcardValidity'](_0x19f845['trim']())){_0x2d4142=new APIBadRequestError('\x22'+_0x19f845['trim']()+_0x8711('0x6b'));}});if(_0x2d4142){return handleError(_0x5706f5,null)(_0x2d4142);}return db[_0x8711('0x4d')]['create'](_0x397c02[_0x8711('0x67')],{})[_0x8711('0x19')](function(_0x4e6d39){var _0x1c4c70=_0x397c02[_0x8711('0x6c')][_0x8711('0x2d')]({'plain':!![]});if(!_0x1c4c70)throw new Error(_0x8711('0x6d'));if(_0x1c4c70['role']===_0x8711('0x6c')){var _0xf5326c=_0x4e6d39['get']({'plain':!![]});var _0x3ceb32=_0x8711('0x2e');return db['UserProfileSection'][_0x8711('0x65')]({'where':{'name':_0x3ceb32,'userProfileId':_0x1c4c70['userProfileId']},'raw':!![]})[_0x8711('0x19')](function(_0x3c86d3){if(_0x3c86d3&&_0x3c86d3[_0x8711('0x6e')]===0x0){return db[_0x8711('0x2f')][_0x8711('0x66')]({'name':_0xf5326c[_0x8711('0x33')],'resourceId':_0xf5326c['id'],'type':_0x3c86d3[_0x8711('0x33')],'sectionId':_0x3c86d3['id']},{})[_0x8711('0x19')](function(){return _0x4e6d39;});}else{return _0x4e6d39;}})[_0x8711('0x23')](function(_0x320dae){logger[_0x8711('0x1f')](_0x8711('0x6f'),_0x320dae);throw _0x320dae;});}return _0x4e6d39;})[_0x8711('0x19')](respondWithResult(_0x5706f5,0xc9))[_0x8711('0x23')](handleError(_0x5706f5,null));};exports[_0x8711('0x2c')]=function(_0x368323,_0x3f5371){var _0x58a7ed=null;_0x368323[_0x8711('0x67')][_0x8711('0x68')][_0x8711('0x3b')](',')['forEach'](_0x4e3d63=>{if(_0x4e3d63[_0x8711('0x6a')]()!==''&&!wildcardUtils[_0x8711('0x70')](_0x4e3d63[_0x8711('0x6a')]())){_0x58a7ed=new APIBadRequestError('\x22'+_0x4e3d63['trim']()+_0x8711('0x6b'));}});if(_0x58a7ed){return handleError(_0x3f5371,null)(_0x58a7ed);}if(_0x368323['body']['id']){delete _0x368323[_0x8711('0x67')]['id'];}return db[_0x8711('0x4d')][_0x8711('0x65')]({'where':{'id':_0x368323[_0x8711('0x61')]['id']},'include':[{'model':db['Pause'],'as':_0x8711('0x62')}]})[_0x8711('0x19')](handleEntityNotFound(_0x3f5371,null))[_0x8711('0x19')](saveUpdates(_0x368323['body'],null))[_0x8711('0x19')](respondWithResult(_0x3f5371,null))['catch'](handleError(_0x3f5371,null));};exports[_0x8711('0x30')]=function(_0x1491e5,_0x5f5d85){return db[_0x8711('0x4d')][_0x8711('0x65')]({'where':{'id':_0x1491e5[_0x8711('0x61')]['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x5f5d85,null))[_0x8711('0x19')](removeEntity(_0x5f5d85,null))[_0x8711('0x23')](handleError(_0x5f5d85,null));};exports[_0x8711('0x71')]=function(_0x1db6b8,_0x3bb1e1){return db[_0x8711('0x4d')]['describe']()[_0x8711('0x19')](respondWithResult(_0x3bb1e1,null))['catch'](handleError(_0x3bb1e1,null));};exports['addDisposition']=function(_0x98beca,_0x550bf1){if(_0x98beca[_0x8711('0x67')]['id']){delete _0x98beca[_0x8711('0x67')]['id'];}return db[_0x8711('0x4d')][_0x8711('0x65')]({'where':{'id':_0x98beca[_0x8711('0x61')]['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x550bf1,null))[_0x8711('0x19')](function(_0x176ce0){if(_0x176ce0){_0x98beca[_0x8711('0x67')][_0x8711('0x72')]=_0x176ce0['id'];return db[_0x8711('0x73')][_0x8711('0x66')](_0x98beca[_0x8711('0x67')]);}})[_0x8711('0x19')](respondWithResult(_0x550bf1,null))[_0x8711('0x23')](handleError(_0x550bf1,null));};exports[_0x8711('0x74')]=function(_0x3d9432,_0x490d0c){var _0x71037d={'raw':![],'where':{}};var _0x438c4b={};var _0x449713={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x3d9432['params']['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x490d0c,null))[_0x8711('0x19')](function(_0x510081){if(_0x510081){_0x438c4b[_0x8711('0x46')]=_[_0x8711('0x75')](db['Disposition']['rawAttributes']);_0x438c4b[_0x8711('0x50')]=_[_0x8711('0x75')](_0x3d9432[_0x8711('0x50')]);_0x438c4b[_0x8711('0x51')]=_[_0x8711('0x52')](_0x438c4b[_0x8711('0x46')],_0x438c4b[_0x8711('0x50')]);_0x71037d[_0x8711('0x53')]=_[_0x8711('0x52')](_0x438c4b[_0x8711('0x46')],qs[_0x8711('0x54')](_0x3d9432[_0x8711('0x50')][_0x8711('0x54')]));_0x71037d[_0x8711('0x53')]=_0x71037d['attributes'][_0x8711('0x64')]?_0x71037d[_0x8711('0x53')]:_0x438c4b[_0x8711('0x46')];if(!_0x3d9432['query'][_0x8711('0x55')]('nolimit')){_0x71037d[_0x8711('0x29')]=qs[_0x8711('0x29')](_0x3d9432[_0x8711('0x50')][_0x8711('0x29')]);_0x71037d[_0x8711('0x28')]=qs[_0x8711('0x28')](_0x3d9432[_0x8711('0x50')][_0x8711('0x28')]);}_0x71037d[_0x8711('0x57')]=qs[_0x8711('0x58')](_0x3d9432[_0x8711('0x50')][_0x8711('0x58')]);_0x71037d[_0x8711('0x59')]=qs[_0x8711('0x51')](_[_0x8711('0x5a')](_0x3d9432['query'],_0x438c4b[_0x8711('0x51')]));_0x71037d[_0x8711('0x59')][_0x8711('0x72')]=_0x510081['id'];if(_0x3d9432['query'][_0x8711('0x5b')]){_0x71037d[_0x8711('0x59')]=_[_0x8711('0x5c')](_0x71037d['where'],{'$or':_[_0x8711('0x4c')](_0x71037d['attributes'],function(_0x189142){var _0x5e70ce={};_0x5e70ce[_0x189142]={'$like':'%'+_0x3d9432[_0x8711('0x50')][_0x8711('0x5b')]+'%'};return _0x5e70ce;})});}_0x71037d=_[_0x8711('0x5c')]({},_0x71037d,_0x3d9432[_0x8711('0x5e')]);return db[_0x8711('0x73')][_0x8711('0x27')]({'where':_0x71037d[_0x8711('0x59')]})[_0x8711('0x19')](function(_0x15eb24){_0x449713['count']=_0x15eb24;if(_0x3d9432['query'][_0x8711('0x76')]){_0x71037d['include']=[{'all':!![]}];}return db[_0x8711('0x73')][_0x8711('0x77')](_0x71037d);})[_0x8711('0x19')](function(_0x5151fb){_0x449713['rows']=_0x5151fb;return _0x449713;});}})['then'](respondWithFilteredResult(_0x490d0c,_0x71037d))[_0x8711('0x23')](handleError(_0x490d0c,null));};exports[_0x8711('0x78')]=function(_0x330ed1,_0x2fbe50){return db['ChatWebsite']['find']({'where':{'id':_0x330ed1[_0x8711('0x61')]['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x2fbe50,null))[_0x8711('0x19')](function(_0x5d77c8){if(_0x5d77c8){return _0x5d77c8[_0x8711('0x78')](_0x330ed1[_0x8711('0x50')][_0x8711('0x79')]);}})['then'](respondWithStatusCode(_0x2fbe50,null))[_0x8711('0x23')](handleError(_0x2fbe50,null));};exports[_0x8711('0x7a')]=function(_0x2d5491,_0x27e061){if(_0x2d5491[_0x8711('0x67')]['id']){delete _0x2d5491['body']['id'];}return db[_0x8711('0x4d')][_0x8711('0x65')]({'where':{'id':_0x2d5491[_0x8711('0x61')]['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x27e061,null))[_0x8711('0x19')](function(_0x4d1eaa){if(_0x4d1eaa){_0x2d5491[_0x8711('0x67')][_0x8711('0x72')]=_0x4d1eaa['id'];return db[_0x8711('0x7b')][_0x8711('0x66')](_0x2d5491[_0x8711('0x67')]);}})['then'](respondWithResult(_0x27e061,null))[_0x8711('0x23')](handleError(_0x27e061,null));};exports[_0x8711('0x7c')]=function(_0x1ee4db,_0xa49d38){var _0x42b60d={'raw':![],'where':{}};var _0x3547c1={};var _0x24e569={'count':0x0,'rows':[]};return db[_0x8711('0x4d')][_0x8711('0x7d')]({'where':{'id':_0x1ee4db[_0x8711('0x61')]['id']}})[_0x8711('0x19')](handleEntityNotFound(_0xa49d38,null))['then'](function(_0x4903b2){if(_0x4903b2){_0x3547c1[_0x8711('0x46')]=_[_0x8711('0x75')](db[_0x8711('0x7b')]['rawAttributes']);_0x3547c1['query']=_[_0x8711('0x75')](_0x1ee4db[_0x8711('0x50')]);_0x3547c1[_0x8711('0x51')]=_[_0x8711('0x52')](_0x3547c1[_0x8711('0x46')],_0x3547c1[_0x8711('0x50')]);_0x42b60d['attributes']=_[_0x8711('0x52')](_0x3547c1[_0x8711('0x46')],qs[_0x8711('0x54')](_0x1ee4db[_0x8711('0x50')][_0x8711('0x54')]));_0x42b60d[_0x8711('0x53')]=_0x42b60d[_0x8711('0x53')]['length']?_0x42b60d[_0x8711('0x53')]:_0x3547c1[_0x8711('0x46')];if(!_0x1ee4db[_0x8711('0x50')]['hasOwnProperty'](_0x8711('0x56'))){_0x42b60d[_0x8711('0x29')]=qs[_0x8711('0x29')](_0x1ee4db[_0x8711('0x50')][_0x8711('0x29')]);_0x42b60d[_0x8711('0x28')]=qs['offset'](_0x1ee4db[_0x8711('0x50')][_0x8711('0x28')]);}_0x42b60d['order']=qs[_0x8711('0x58')](_0x1ee4db[_0x8711('0x50')][_0x8711('0x58')]);_0x42b60d['where']=qs['filters'](_[_0x8711('0x5a')](_0x1ee4db['query'],_0x3547c1[_0x8711('0x51')]));_0x42b60d[_0x8711('0x59')][_0x8711('0x72')]=_0x4903b2['id'];if(_0x1ee4db['query'][_0x8711('0x5b')]){_0x42b60d[_0x8711('0x59')]=_[_0x8711('0x5c')](_0x42b60d[_0x8711('0x59')],{'$or':_[_0x8711('0x4c')](_0x42b60d[_0x8711('0x53')],function(_0x437ebb){var _0x167437={};_0x167437[_0x437ebb]={'$like':'%'+_0x1ee4db[_0x8711('0x50')][_0x8711('0x5b')]+'%'};return _0x167437;})});}_0x42b60d=_[_0x8711('0x5c')]({},_0x42b60d,_0x1ee4db[_0x8711('0x5e')]);return db['CannedAnswer'][_0x8711('0x27')]({'where':_0x42b60d['where']})[_0x8711('0x19')](function(_0x4ee3f3){_0x24e569[_0x8711('0x27')]=_0x4ee3f3;if(_0x1ee4db[_0x8711('0x50')][_0x8711('0x76')]){_0x42b60d[_0x8711('0x5f')]=[{'all':!![]}];}return db[_0x8711('0x7b')][_0x8711('0x77')](_0x42b60d);})[_0x8711('0x19')](function(_0x19391b){_0x24e569[_0x8711('0x7e')]=_0x19391b;return _0x24e569;});}})[_0x8711('0x19')](respondWithFilteredResult(_0xa49d38,_0x42b60d))[_0x8711('0x23')](handleError(_0xa49d38,null));};exports[_0x8711('0x7f')]=function(_0x2f120a,_0x58f6a1){return db[_0x8711('0x4d')]['find']({'where':{'id':_0x2f120a['params']['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x58f6a1,null))['then'](function(_0x42ac03){if(_0x42ac03){return _0x42ac03[_0x8711('0x7f')](_0x2f120a['query'][_0x8711('0x79')]);}})[_0x8711('0x19')](respondWithStatusCode(_0x58f6a1,null))[_0x8711('0x23')](handleError(_0x58f6a1,null));};exports[_0x8711('0x80')]=function(_0x2953fa,_0x32ddbc){_0x2953fa[_0x8711('0x67')][_0x8711('0x81')]=_0x2953fa[_0x8711('0x82')][_0x8711('0x83')];return db[_0x8711('0x4d')][_0x8711('0x65')]({'where':{'id':_0x2953fa['params']['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x32ddbc,null))[_0x8711('0x19')](saveUpdates(_0x2953fa[_0x8711('0x67')],null))[_0x8711('0x19')](respondWithResult(_0x32ddbc,null))[_0x8711('0x23')](handleError(_0x32ddbc,null));};exports['addAvatar']=function(_0x34f15b,_0x117bce){_0x34f15b[_0x8711('0x67')][_0x8711('0x84')]=_0x34f15b[_0x8711('0x82')][_0x8711('0x83')];return db[_0x8711('0x4d')][_0x8711('0x65')]({'where':{'id':_0x34f15b[_0x8711('0x61')]['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x117bce,null))['then'](saveUpdates(_0x34f15b[_0x8711('0x67')],null))[_0x8711('0x19')](respondWithResult(_0x117bce,null))['catch'](handleError(_0x117bce,null));};exports['addCustomerAvatar']=function(_0x4bd230,_0x1744ca){_0x4bd230['body'][_0x8711('0x85')]=_0x4bd230[_0x8711('0x82')][_0x8711('0x83')];return db[_0x8711('0x4d')][_0x8711('0x65')]({'where':{'id':_0x4bd230[_0x8711('0x61')]['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x1744ca,null))[_0x8711('0x19')](saveUpdates(_0x4bd230[_0x8711('0x67')],null))[_0x8711('0x19')](respondWithResult(_0x1744ca,null))['catch'](handleError(_0x1744ca,null));};exports[_0x8711('0x86')]=function(_0x2e867c,_0x26662c){_0x2e867c['body']['systemAvatar']=_0x2e867c[_0x8711('0x82')][_0x8711('0x83')];return db['ChatWebsite'][_0x8711('0x65')]({'where':{'id':_0x2e867c['params']['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x26662c,null))[_0x8711('0x19')](saveUpdates(_0x2e867c[_0x8711('0x67')],null))[_0x8711('0x19')](respondWithResult(_0x26662c,null))['catch'](handleError(_0x26662c,null));};exports[_0x8711('0x87')]=function(_0x9ed045,_0x2c379d){var _0x304c63=path['join'](config[_0x8711('0x88')],_0x8711('0x89'));var _0x34437={'where':{'id':_0x9ed045['params']['id']},'attributes':['id',_0x8711('0x81')],'raw':!![]};var _0x1ff6a3=![];return require(_0x8711('0x8a'))[_0x8711('0x8b')]()[_0x8711('0x19')](function(_0x304e15){if(_0x304e15){_0x1ff6a3=_0x304e15[_0x8711('0x8c')];}})[_0x8711('0x19')](function(){return db['ChatWebsite'][_0x8711('0x65')](_0x34437);})[_0x8711('0x19')](handleEntityNotFound(_0x2c379d,null))[_0x8711('0x19')](function(_0x47113a){if(_0x47113a){if(!_['isNil'](_0x47113a[_0x8711('0x81')])){if(fs[_0x8711('0x8d')](path[_0x8711('0x8e')](config[_0x8711('0x88')],_0x8711('0x8f'),_0x47113a[_0x8711('0x81')]))&&_0x1ff6a3){_0x304c63=path[_0x8711('0x8e')](config[_0x8711('0x88')],_0x8711('0x8f'),_0x47113a[_0x8711('0x81')]);}}return _0x2c379d[_0x8711('0x90')](_0x304c63);}})['catch'](handleError(_0x2c379d,null));};exports[_0x8711('0x91')]=function(_0x2c41c9,_0xb3b31e){var _0x2a5542=path[_0x8711('0x8e')](config[_0x8711('0x88')],_0x8711('0x92'));var _0x2927b9={'where':{'id':_0x2c41c9[_0x8711('0x61')]['id']},'attributes':['id',_0x8711('0x84')],'raw':!![]};return db[_0x8711('0x4d')][_0x8711('0x65')](_0x2927b9)['then'](handleEntityNotFound(_0xb3b31e,null))[_0x8711('0x19')](function(_0x99e198){if(_0x99e198){if(!_[_0x8711('0x93')](_0x99e198[_0x8711('0x84')])){if(fs[_0x8711('0x8d')](path['join'](config[_0x8711('0x88')],_0x8711('0x94'),_0x99e198[_0x8711('0x84')]))){_0x2a5542=path[_0x8711('0x8e')](config[_0x8711('0x88')],_0x8711('0x94'),_0x99e198[_0x8711('0x84')]);}}return _0xb3b31e[_0x8711('0x90')](_0x2a5542);}})[_0x8711('0x23')](handleError(_0xb3b31e,null));};exports[_0x8711('0x95')]=function(_0x1bfa18,_0x2c4cad){var _0xd59a3=path[_0x8711('0x8e')](config[_0x8711('0x88')],_0x8711('0x96'));var _0x4fca3c={'where':{'id':_0x1bfa18[_0x8711('0x61')]['id']},'attributes':['id',_0x8711('0x85'),'showCustomerAvatar'],'raw':!![]};return db[_0x8711('0x4d')][_0x8711('0x65')](_0x4fca3c)[_0x8711('0x19')](handleEntityNotFound(_0x2c4cad,null))[_0x8711('0x19')](function(_0x3ae1a0){if(_0x3ae1a0){if(!_[_0x8711('0x93')](_0x3ae1a0['customerAvatar'])){if(fs['existsSync'](path[_0x8711('0x8e')](config['root'],'server/files/images/avatars/',_0x3ae1a0[_0x8711('0x85')]))&&_0x3ae1a0[_0x8711('0x97')]){_0xd59a3=path['join'](config['root'],'server/files/images/avatars/',_0x3ae1a0[_0x8711('0x85')]);}}return _0x2c4cad[_0x8711('0x90')](_0xd59a3);}})[_0x8711('0x23')](handleError(_0x2c4cad,null));};exports[_0x8711('0x98')]=function(_0x21426d,_0x400835){var _0x2e991=path[_0x8711('0x8e')](config['root'],_0x8711('0x99'));var _0x389dee={'where':{'id':_0x21426d[_0x8711('0x61')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x8711('0x4d')][_0x8711('0x65')](_0x389dee)[_0x8711('0x19')](handleEntityNotFound(_0x400835,null))[_0x8711('0x19')](function(_0xc2cb37){if(_0xc2cb37){if(!_['isNil'](_0xc2cb37[_0x8711('0x9a')])){if(fs['existsSync'](path[_0x8711('0x8e')](config[_0x8711('0x88')],_0x8711('0x94'),_0xc2cb37['systemAvatar']))){_0x2e991=path[_0x8711('0x8e')](config['root'],_0x8711('0x94'),_0xc2cb37[_0x8711('0x9a')]);}}return _0x400835['download'](_0x2e991);}})['catch'](handleError(_0x400835,null));};function checkWebsiteInterval(_0x2b605e){var _0x1e9e0d=_0x2b605e[_0x8711('0x9b')];if(!_0x1e9e0d){return Promise[_0x8711('0x9c')](_0x2b605e);}var _0x437ed3=_0x2b605e[_0x8711('0x9d')]||undefined;return _0x1e9e0d['ifTime'](_0x437ed3)[_0x8711('0x19')](function(_0x10aee7){if(!_0x10aee7){throw new APIOutOfIntervalError();}return _0x2b605e;});}exports[_0x8711('0x9e')]=function(_0x39e55b,_0xc9bcb1){var _0x4a7c22={'body':_0x39e55b[_0x8711('0x67')],'channel':_0x8711('0x9f')};var _0x12b610=[];var _0x4fe28c=[];var _0x3c118c={};var _0x5aeaea=![];if(_0x39e55b['body']['id']){delete _0x39e55b['body']['id'];}if(_[_0x8711('0x93')](_0x39e55b[_0x8711('0x67')][_0x8711('0xa0')])){throw new APIBadRequestError(_0x8711('0xa1'));}if(_[_0x8711('0x93')](_0x39e55b[_0x8711('0x67')]['mapKey'])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_['isEmpty'](_0x39e55b[_0x8711('0x67')][_0x8711('0x67')])){throw new APIBadRequestError(_0x8711('0xa2'));}var _0x6452ab=_0x39e55b['body']['customerIp']&&_0x39e55b[_0x8711('0x67')][_0x8711('0x3f')];return db[_0x8711('0xa3')]['describe']()[_0x8711('0x19')](function(_0x435d5d){if(!_0x435d5d){throw new Error(_0x8711('0xa4'));}_0x12b610=Object[_0x8711('0x75')](_0x435d5d)['filter'](function(_0x11edd6){return![_0x8711('0xa5'),_0x8711('0xa6')]['includes'](_0x11edd6);});_0x4fe28c=Object[_0x8711('0x75')](_0x435d5d)[_0x8711('0x5b')](function(_0x1f308f){return!['createdAt',_0x8711('0xa6'),'CompanyId','ListId'][_0x8711('0xa7')](_0x1f308f);});if(!_[_0x8711('0xa7')](_0x4fe28c,_0x39e55b[_0x8711('0x67')]['mapKey'])){throw new APIBadRequestError(_0x8711('0xa8')+_0x4fe28c[_0x8711('0x8e')](',\x20'));}_0x3c118c[_0x39e55b[_0x8711('0x67')][_0x8711('0xa9')]]=_0x39e55b[_0x8711('0x67')]['from'];})[_0x8711('0x19')](function(){return db[_0x8711('0x4d')]['find']({'where':{'id':_0x39e55b[_0x8711('0x61')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x8711('0xa3')],'as':'Contacts','where':_0x3c118c,'limit':0x1,'order':[['updatedAt',_0x8711('0xaa')]]}]},{'model':db[_0x8711('0xab')],'as':_0x8711('0xac')},{'model':db[_0x8711('0x9b')],'as':'Interval','include':[{'model':db[_0x8711('0x9b')],'as':_0x8711('0xad'),'attributes':['id',_0x8711('0xae')],'raw':!![]}]}]});})[_0x8711('0x19')](function(_0x50bd4b){if(!_0x50bd4b){throw new APINotFoundError(util[_0x8711('0x42')]('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x39e55b[_0x8711('0x61')]['id']));}if(_0x6452ab){return checkWebsiteInterval(_0x50bd4b);}return _0x50bd4b;})[_0x8711('0x19')](function(_0x4e4e28){_0x4a7c22[_0x8711('0xaf')]=_0x4e4e28;_0x4a7c22[_0x8711('0xb0')]=_[_0x8711('0xb1')](_0x4e4e28[_0x8711('0xac')],[_0x8711('0xb2')],[_0x8711('0xb3')]);if(_0x4a7c22[_0x8711('0xaf')][_0x8711('0xac')]){delete _0x4a7c22[_0x8711('0xaf')][_0x8711('0xac')];}_0x4a7c22[_0x8711('0xb4')]=_0x4e4e28[_0x8711('0xb5')]||{'id':_0x4e4e28[_0x8711('0xb6')]};if(_0x4a7c22['list']&&_0x4a7c22[_0x8711('0xb4')][_0x8711('0xb7')][_0x8711('0x64')]){return _0x4a7c22[_0x8711('0xb4')][_0x8711('0xb7')][0x0];}var _0x2b26b2=_[_0x8711('0xb8')](_0x39e55b['body'],{'firstName':_0x39e55b[_0x8711('0x67')][_0x8711('0xa0')],'ListId':_0x4e4e28[_0x8711('0xb6')]});_0x2b26b2[_0x39e55b[_0x8711('0x67')][_0x8711('0xa9')]]=_0x39e55b[_0x8711('0x67')][_0x8711('0xa0')];return db['CmContact'][_0x8711('0x66')](_0x2b26b2,{'fields':_0x12b610,'raw':!![]});})['then'](function(_0x43fe92){_0x4a7c22[_0x8711('0xb9')]=_0x43fe92;var _0x8ce7ae=createInteractionObject(_0x39e55b[_0x8711('0x61')]['id'],_0x39e55b['body'],_0x39e55b['headers'],_0x43fe92);var _0x45dae9={'ChatWebsiteId':_0x39e55b['params']['id']};if(_0x39e55b[_0x8711('0x67')][_0x8711('0xba')]){_0x45dae9[_0x8711('0xba')]=_0x39e55b[_0x8711('0x67')]['threadId'];_0x45dae9['closed']=![];return db[_0x8711('0xbb')][_0x8711('0x65')]({'where':_0x45dae9})[_0x8711('0x19')](function(_0x40574a){var _0x8e3893=_0x39e55b[_0x8711('0x67')][_0x8711('0x37')]&&_0x39e55b['body'][_0x8711('0x3f')];if(_0x40574a){_0x5aeaea=!![];return _0x40574a;}else if(!_0x8e3893&&_0x40574a&&_0x40574a[_0x8711('0xbc')]){throw new APIConflictError(_0x8711('0xbd'));}_0x8ce7ae[_0x8711('0xba')]=_0x39e55b['body'][_0x8711('0xba')];_0x8ce7ae[_0x8711('0xbe')]=_0x39e55b['body'][_0x8711('0xbe')];return db[_0x8711('0xbb')][_0x8711('0x66')](_0x8ce7ae);});}_0x45dae9[_0x8711('0xbf')]=_0x43fe92['id'];if(_0x39e55b[_0x8711('0x67')]['interaction']&&_0x39e55b[_0x8711('0x67')][_0x8711('0xc0')]['id']){_0x45dae9['id']=_0x39e55b['body'][_0x8711('0xc0')]['id'];return db[_0x8711('0xbb')][_0x8711('0x65')]({'where':_0x45dae9})[_0x8711('0x19')](function(_0x11daaa){var _0x165430=_0x39e55b[_0x8711('0x67')][_0x8711('0x37')]&&_0x39e55b[_0x8711('0x67')][_0x8711('0x3f')];if(!_0x165430&&_0x11daaa&&_0x11daaa[_0x8711('0xbc')]){throw new APIConflictError(_0x8711('0xbd'));}else if(_0x11daaa){_0x5aeaea=!![];return _0x11daaa;}else{return db['ChatInteraction'][_0x8711('0x66')](_0x8ce7ae);}});}return db[_0x8711('0xbb')][_0x8711('0x66')](_0x8ce7ae);})['then'](function(_0x3b1f25){if(!_0x5aeaea){return _0x3b1f25;}var _0xd28f60={'from':(_0x4a7c22[_0x8711('0xb9')][_0x8711('0x3c')]||'')+'\x20'+(_0x4a7c22[_0x8711('0xb9')][_0x8711('0x3d')]||'')};if(_0x39e55b['body'][_0x8711('0xba')]&&_0x39e55b[_0x8711('0x67')][_0x8711('0xc1')]&&_0x39e55b['body']['threadId']!=_0x39e55b[_0x8711('0x67')][_0x8711('0xc1')]){_0xd28f60[_0x8711('0xba')]=_0x39e55b['body'][_0x8711('0xc1')];}return _0x3b1f25[_0x8711('0x2c')](_0xd28f60);})[_0x8711('0x19')](function(_0x229a6a){_0x4a7c22[_0x8711('0xc0')]=_0x229a6a[_0x8711('0x2d')]({'plain':!![]});_0x4a7c22[_0x8711('0xc0')][_0x8711('0xc2')]=!_0x5aeaea;if(_0x4a7c22[_0x8711('0xc0')][_0x8711('0xc2')]){if(_0x4a7c22[_0x8711('0xaf')]['autoclose']){_0x4a7c22[_0x8711('0xb0')]['push']({'id':0x0,'priority':_0x4a7c22[_0x8711('0xb0')][_0x8711('0x64')]+0x1,'app':_0x8711('0xc3'),'appdata':_0x8711('0xc4'),'interval':_0x8711('0xc5')});}}return db[_0x8711('0xc6')][_0x8711('0x66')]({'body':_0x39e55b[_0x8711('0x67')][_0x8711('0x67')],'ChatWebsiteId':_0x39e55b[_0x8711('0x61')]['id'],'ChatInteractionId':_0x229a6a['id'],'direction':'in','ContactId':_0x4a7c22[_0x8711('0xb9')]['id'],'AttachmentId':_0x39e55b['body'][_0x8711('0xc7')]});})[_0x8711('0x19')](function(_0x3263d9){_0x4a7c22[_0x8711('0x21')]=_0x3263d9;if(!_0x4a7c22['interaction'][_0x8711('0xc8')]){return;}return db['User'][_0x8711('0x65')]({'attributes':['id',_0x8711('0x33')],'where':{'id':_0x4a7c22[_0x8711('0xc0')][_0x8711('0xc8')]}});})[_0x8711('0x19')](function(_0x3788f6){if(_0x3788f6){_0x4a7c22['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3788f6[_0x8711('0x33')]+','+(_0x4a7c22[_0x8711('0xaf')]['waitForTheAssignedAgent']||0xa),'interval':_0x8711('0xc5')});_0x4a7c22[_0x8711('0xc9')]=!![];}if(!_0x4a7c22[_0x8711('0xc0')][_0x8711('0xca')]){return;}return db[_0x8711('0xcb')][_0x8711('0x65')]({'attributes':['id',_0x8711('0x33')],'where':{'id':_0x4a7c22[_0x8711('0xc0')]['queueId']}});})['then'](function(_0x3f643c){if(_0x3f643c){_0x4a7c22['applications'][_0x8711('0xcc')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x3f643c[_0x8711('0x33')]+','+(_0x4a7c22[_0x8711('0xaf')][_0x8711('0xcd')]||0x12c),'interval':_0x8711('0xc5')});}return respondWithRpcPromise('Start','startRouting',_0x4a7c22);})[_0x8711('0x19')](function(_0x480f73){respondWithRpcPromise('EventManager','EventManager',{'event':_0x8711('0x9e'),'message':_0x480f73},client9002);return _0x480f73;})[_0x8711('0x19')](respondWithResult(_0xc9bcb1,null))['catch'](APIHandleError(_0xc9bcb1));};exports[_0x8711('0xce')]=function(_0x2ee2ed,_0x4456f3){var _0x5a3bf4,_0x192b72,_0x45ac86;var _0xee0bdf=[];var _0x5f368a={};var _0x103139=_0x2ee2ed['files']||[];var _0x556546=[];var _0x3d0d45;return db[_0x8711('0xa3')][_0x8711('0x71')]()[_0x8711('0x19')](function(_0x5bad74){if(!_0x5bad74){throw new db[(_0x8711('0xcf'))][(_0x8711('0xd0'))](_0x8711('0xd1'));}_0xee0bdf=_[_0x8711('0xd2')](_[_0x8711('0x75')](_0x5bad74),[_0x8711('0xa5'),_0x8711('0xa6'),'CompanyId',_0x8711('0xb6')]);if(_0x2ee2ed['body']['id']){delete _0x2ee2ed[_0x8711('0x67')]['id'];}if(_[_0x8711('0x93')](_0x2ee2ed[_0x8711('0x67')][_0x8711('0xa0')])){throw _0x4456f3[_0x8711('0x24')](0x1f4)[_0x8711('0x34')](new db['Sequelize'][(_0x8711('0xd0'))](_0x8711('0xd3')));}if(_[_0x8711('0x93')](_0x2ee2ed[_0x8711('0x67')][_0x8711('0x67')])||_0x2ee2ed[_0x8711('0x67')]['body']===''){throw _0x4456f3[_0x8711('0x24')](0x1f4)[_0x8711('0x34')](new db[(_0x8711('0xcf'))][(_0x8711('0xd0'))](_0x8711('0xd4')));}if(_[_0x8711('0x93')](_0x2ee2ed['body']['mapKeyOffline'])){throw _0x4456f3['status'](0x1f4)[_0x8711('0x34')](new db['Sequelize']['ValidationError'](_0x8711('0xd5')+_0xee0bdf));}if(!_[_0x8711('0xa7')](_0xee0bdf,_0x2ee2ed['body']['mapKeyOffline'])){throw _0x4456f3[_0x8711('0x24')](0x1f4)[_0x8711('0x34')](new db[(_0x8711('0xcf'))][(_0x8711('0xd0'))](_0x8711('0xd6')+_0xee0bdf));}_0x5f368a[_0x2ee2ed[_0x8711('0x67')][_0x8711('0xd7')]]=_0x2ee2ed[_0x8711('0x67')][_0x8711('0xa0')];})[_0x8711('0x19')](function(){return db[_0x8711('0x4d')][_0x8711('0x65')]({'where':{'id':_0x2ee2ed[_0x8711('0x61')]['id']},'include':[{'model':db[_0x8711('0xd8')],'as':'List'},{'model':db[_0x8711('0xd9')],'as':_0x8711('0xd9')}]});})[_0x8711('0x19')](handleEntityNotFound(_0x4456f3,null))['then'](function(_0x508ae7){if(_0x508ae7&&_0x508ae7['List']){_0x192b72=_0x508ae7;var _0xb544de=_[_0x8711('0xb8')](_0x2ee2ed[_0x8711('0x67')],{'firstName':_0x2ee2ed[_0x8711('0x67')][_0x8711('0xa0')],'phone':_0x2ee2ed[_0x8711('0x67')][_0x8711('0xa0')],'ListId':_0x508ae7[_0x8711('0xb6')]});_0xb544de[_0x2ee2ed[_0x8711('0x67')][_0x8711('0xd7')]]=_0x2ee2ed['body'][_0x8711('0xa0')];return db[_0x8711('0xa3')][_0x8711('0xda')]({'where':_0x5f368a,'defaults':_0xb544de});}})[_0x8711('0xdb')](function(_0x4b764f){if(_0x4b764f){_0x45ac86=_0x4b764f;var _0x3f5efe=fs[_0x8711('0xdc')](path['join'](config[_0x8711('0x88')],_0x8711('0xdd')),_0x8711('0xde'));var _0x1dfdad=ejs[_0x8711('0xdf')](_0x3f5efe,{'body':_[_0x8711('0xe0')](_0x2ee2ed[_0x8711('0x67')][_0x8711('0x67')]),'bodyTitle':_0x192b72[_0x8711('0xe1')]});return db[_0x8711('0xe2')][_0x8711('0x66')]({'body':_0x1dfdad,'plainBody':htmlToText['fromString'](_0x1dfdad),'ContactId':_0x4b764f['id'],'ChatWebsiteId':_0x192b72['id']});}})[_0x8711('0x19')](function(_0x2ff225){_0x3d0d45=_0x2ff225;if(_0x103139['length']){var _0x567adb=_0x103139[_0x8711('0x4c')](function(_0x4c755f){return{'name':_0x4c755f[_0x8711('0xe3')],'basename':_0x4c755f['filename'],'type':_0x4c755f[_0x8711('0xe4')],'ChatOfflineMessageId':_0x2ff225['id']};});_0x556546=_0x567adb[_0x8711('0x4c')](_0x26f0e5=>{var _0x4ed2e3={'filename':_0x26f0e5[_0x8711('0x33')],'path':path[_0x8711('0x8e')](config[_0x8711('0x88')],_0x8711('0xe5'),'files',_0x8711('0xe6'),_0x8711('0xe7'),_0x26f0e5['basename'])};return _0x4ed2e3;});if(!_0x192b72[_0x8711('0xe8')]){return db[_0x8711('0xe9')][_0x8711('0xea')](function(_0x35cc7d){return db[_0x8711('0xeb')][_0x8711('0xec')](_0x567adb,{'transaction':_0x35cc7d});});}}})[_0x8711('0x19')](function(){if(_0x3d0d45){_0x5a3bf4=_0x3d0d45;return db['MailAccount'][_0x8711('0x7d')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x8711('0xed'),'raw':!![],'include':[{'model':db[_0x8711('0xee')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x8711('0x19')](function(_0x918e80){if(_0x918e80&&_0x918e80[_0x8711('0xed')]&&_0x192b72[_0x8711('0xef')]&&_0x192b72[_0x8711('0xf0')]){var _0x3c6f02=_0x918e80[_0x8711('0xf1')]();return respondWithRpcPromise(_0x8711('0xf2'),_0x8711('0xf3'),{'account':_0x3c6f02,'message':{'from':util[_0x8711('0x42')](_0x8711('0xf4'),_0x918e80[_0x8711('0x33')],_0x918e80[_0x8711('0xf5')]||_0x918e80[_0x8711('0xed')][_0x8711('0x6c')]),'to':_0x192b72[_0x8711('0xf0')],'subject':_0x192b72['offlineMessageSubject'],'html':_0x5a3bf4[_0x8711('0x67')],'attachments':_0x556546}},client9003)['then'](function(){return _0x5a3bf4;})[_0x8711('0x23')](function(_0x2c0ccb){logger[_0x8711('0x1f')](_0x2c0ccb);});}})[_0x8711('0x19')](function(){if(_0x192b72&&_0x192b72[_0x8711('0xe8')]&&_0x192b72[_0x8711('0xf6')]){var _0x5253ea=[];if(_0x103139['length']){_0x5253ea=_0x103139['map'](function(_0x43cc85){return{'name':_0x43cc85[_0x8711('0xe3')],'basename':_0x43cc85[_0x8711('0x83')],'type':_0x43cc85[_0x8711('0xe4')],'ChatOfflineMessageId':_0x3d0d45['id']};});}var _0x4476a2;if(!_['isNil'](_0x192b72['subjectOffline'])){var _0x5dd614=_[_0x8711('0x4c')](_0x2ee2ed[_0x8711('0x67')],function(_0x34d4e8){return _0x34d4e8;});var _0x16d6f0=_['toPairsIn'](_0x5dd614)[0x0];var _0x114a7c=_['mapValues'](_0x16d6f0,function(_0x392f22){return _0x392f22;});_0x4476a2=_0x114a7c[0x1][_0x192b72[_0x8711('0xf7')]];}var _0x3b4098={'from':_0x45ac86[_0x8711('0xf5')],'firstName':_0x45ac86[_0x8711('0x3c')],'lastName':_0x45ac86[_0x8711('0x3d')],'mapKey':_0x8711('0xf5'),'message':{'from':_0x45ac86[_0x8711('0xf5')],'to':_0x192b72['MailAccount'][_0x8711('0xf5')],'cc':'','subject':_[_0x8711('0x93')](_0x4476a2)?_0x192b72[_0x8711('0xf8')]:_0x4476a2,'messageId':'','sentAt':new Date(),'attach':_0x5253ea['length'],'attachments':_0x5253ea,'originChannel':_0x8711('0xf9'),'ChatWebsiteId':_0x192b72['id'],'ChatOfflineMessageId':_0x5a3bf4['id'],'originTo':_0x192b72[_0x8711('0xd9')][_0x8711('0xf5')]},'body':_0x5a3bf4[_0x8711('0x67')]};var _0x48e5ea={'account':{'id':_0x192b72[_0x8711('0xf6')]},'body':_0x3b4098,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x8711('0xfa'),'notifyMail',_0x48e5ea,client9001)['then'](function(){return _0x5a3bf4;})['catch'](function(_0x6826a0){logger[_0x8711('0x1f')](_0x6826a0);});}return;})[_0x8711('0x19')](function(){if(_0x5a3bf4){return _0x5a3bf4;}})['then'](respondWithResult(_0x4456f3,null))[_0x8711('0x23')](function(){for(var _0x2c7075 of _0x103139){var _0x3c1532=path['join'](config[_0x8711('0x88')],'server','files',_0x8711('0xe6'),_0x8711('0xe7'),_0x2c7075['filename']);fs_extra[_0x8711('0xfb')](_0x3c1532)[_0x8711('0x23')](function(_0x300256){logger[_0x8711('0x1f')](_0x8711('0xfc'),_0x3c1532,_0x300256);});}});};exports[_0x8711('0xfd')]=function(_0x50cd36,_0x23f318){return db['ChatInteraction']['find']({'where':{'id':_0x50cd36['params']['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x23f318,null))[_0x8711('0x19')](function(_0x4c939b){if(_0x4c939b){return _0x4c939b[_0x8711('0xfd')](_0x50cd36[_0x8711('0x67')][_0x8711('0x79')],_['omit'](_0x50cd36['body'],[_0x8711('0x79'),'id'])||{});}})[_0x8711('0x19')](respondWithResult(_0x23f318,null))[_0x8711('0x23')](handleError(_0x23f318,null));};exports[_0x8711('0xfe')]=function(_0x26c84c,_0x44a135){var _0x5ac2ba={'raw':![],'where':{}};var _0x4f8b93={};var _0x117616={'count':0x0,'rows':[]};return db[_0x8711('0x4d')][_0x8711('0x7d')]({'where':{'id':_0x26c84c['params']['id']}})['then'](handleEntityNotFound(_0x44a135,null))[_0x8711('0x19')](function(_0x451a44){if(_0x451a44){_0x4f8b93[_0x8711('0x46')]=_[_0x8711('0x75')](db[_0x8711('0xbb')][_0x8711('0x63')]);_0x4f8b93[_0x8711('0x50')]=_[_0x8711('0x75')](_0x26c84c[_0x8711('0x50')]);_0x4f8b93[_0x8711('0x51')]=_['intersection'](_0x4f8b93[_0x8711('0x46')],_0x4f8b93[_0x8711('0x50')]);_0x5ac2ba[_0x8711('0x53')]=_[_0x8711('0x52')](_0x4f8b93[_0x8711('0x46')],qs[_0x8711('0x54')](_0x26c84c[_0x8711('0x50')][_0x8711('0x54')]));_0x5ac2ba[_0x8711('0x53')]=_0x5ac2ba[_0x8711('0x53')][_0x8711('0x64')]?_0x5ac2ba[_0x8711('0x53')]:_0x4f8b93[_0x8711('0x46')];if(!_0x26c84c['query'][_0x8711('0x55')](_0x8711('0x56'))){_0x5ac2ba[_0x8711('0x29')]=qs[_0x8711('0x29')](_0x26c84c[_0x8711('0x50')][_0x8711('0x29')]);_0x5ac2ba['offset']=qs[_0x8711('0x28')](_0x26c84c[_0x8711('0x50')][_0x8711('0x28')]);}_0x5ac2ba['order']=qs[_0x8711('0x58')](_0x26c84c[_0x8711('0x50')][_0x8711('0x58')]);_0x5ac2ba['where']=qs[_0x8711('0x51')](_['pick'](_0x26c84c[_0x8711('0x50')],_0x4f8b93['filters']));_0x5ac2ba[_0x8711('0x59')][_0x8711('0x72')]=_0x451a44['id'];if(_0x26c84c[_0x8711('0x50')][_0x8711('0x5b')]){_0x5ac2ba[_0x8711('0x59')]=_[_0x8711('0x5c')](_0x5ac2ba[_0x8711('0x59')],{'$or':_[_0x8711('0x4c')](_0x5ac2ba[_0x8711('0x53')],function(_0x1ab1d9){var _0x4e0038={};_0x4e0038[_0x1ab1d9]={'$like':'%'+_0x26c84c[_0x8711('0x50')][_0x8711('0x5b')]+'%'};return _0x4e0038;})});}_0x5ac2ba=_[_0x8711('0x5c')]({},_0x5ac2ba,_0x26c84c['options']);return db[_0x8711('0xbb')][_0x8711('0x27')]({'where':_0x5ac2ba[_0x8711('0x59')]})[_0x8711('0x19')](function(_0x43c39c){_0x117616[_0x8711('0x27')]=_0x43c39c;if(_0x26c84c[_0x8711('0x50')][_0x8711('0x76')]){_0x5ac2ba[_0x8711('0x5f')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x8711('0xff')],'as':_0x8711('0x100'),'attributes':[_0x8711('0x33'),'fullname','internal'],'required':![]},{'model':db[_0x8711('0x101')],'as':_0x8711('0x102'),'attributes':['id',_0x8711('0x33'),_0x8711('0x103')],'where':_0x26c84c[_0x8711('0x50')][_0x8711('0x104')]?{'id':_0x26c84c[_0x8711('0x50')][_0x8711('0x104')]}:undefined,'required':_0x26c84c['query']['tag']?!![]:![]}];}return db[_0x8711('0xbb')][_0x8711('0x77')](_0x5ac2ba);})[_0x8711('0x19')](function(_0x1607f5){_0x117616[_0x8711('0x7e')]=_0x1607f5;return _0x117616;});}})[_0x8711('0x19')](respondWithFilteredResult(_0x44a135,_0x5ac2ba))[_0x8711('0x23')](handleError(_0x44a135,null));};exports[_0x8711('0x105')]=function(_0x4635bb,_0x69fe23){var _0x12c327=0x0;var _0x5656d4=0x0;var _0x498d54=![];var _0x496ef9;var _0x364c26;return db['ChatWebsite'][_0x8711('0x65')]({'where':{'id':_0x4635bb['params']['id']},'include':[{'model':db[_0x8711('0x9b')],'as':_0x8711('0x9b'),'include':[{'model':db[_0x8711('0x9b')],'as':_0x8711('0xad'),'attributes':['id',_0x8711('0xae')]}]}]})[_0x8711('0x19')](handleEntityNotFound(_0x69fe23,null))[_0x8711('0x19')](function(_0x453270){if(_0x453270){_0x496ef9=_0x453270;return _0x453270[_0x8711('0x106')]({'raw':!![]});}})['then'](function(_0x12a8fa){if(_0x496ef9){if(_0x12a8fa){_0x364c26=_0x12a8fa;}}return require(_0x8711('0x8a'))['getLicense']();})[_0x8711('0x19')](function(_0x5d83ab){if(_0x5d83ab){_0x5656d4=_0x5d83ab[_0x8711('0x107')];_0x498d54=_0x5d83ab['custom'];}})[_0x8711('0x19')](function(){return db[_0x8711('0xbb')]['count']({'where':{'closed':![]}});})['then'](function(_0x3d7a1c){_0x12c327=_0x3d7a1c;if(_0x5656d4&&_0x3d7a1c>_0x5656d4){return db[_0x8711('0x108')]['findOne']({'where':{'id':0x1}})[_0x8711('0x19')](function(_0x599431){if(_0x599431){_0x599431[_0x8711('0x109')](_0x8711('0x10a'));}});}})[_0x8711('0x19')](function(){var _0x4db598=_0x496ef9[_0x8711('0x9b')];var _0x6756e3=_0x496ef9[_0x8711('0x9d')]||undefined;return _0x4db598?_0x4db598[_0x8711('0x10b')](_0x6756e3):!![];})['then'](function(_0x4e828a){var _0x581b97=fs['readFileSync'](path['join'](config['root'],_0x8711('0x10c')),_0x8711('0xde'));var _0x34a20d='3.10.1';var _0x5f29c5=![];var _0x10757e,_0x45676b;if(_0x4635bb[_0x8711('0x10d')]['referer']){_0x10757e=new URL(_0x4635bb[_0x8711('0x10d')][_0x8711('0x3f')])[_0x8711('0x10e')];}else if(_0x4635bb[_0x8711('0x10d')]['origin']){_0x10757e=new URL(_0x4635bb[_0x8711('0x10d')]['origin'])[_0x8711('0x10e')];}else{_0x10757e=_0x8711('0x10f');}_0x45676b=typeof _0x496ef9[_0x8711('0x68')][_0x8711('0x3b')](',')[_0x8711('0x65')](function(_0x2cecbc){return wildcardUtils[_0x8711('0x110')](_0x2cecbc,_0x10757e);})!=='undefined';var _0x1e32f8={'chatVersion':_0x34a20d,'chatWebsiteAddressOrigin':_0x45676b?_0x10757e:_0x496ef9[_0x8711('0x68')],'remote':_0x496ef9['remote'],'query':querystring[_0x8711('0x1d')](_[_0x8711('0x5c')](_0x496ef9['get']({'plain':!![]}),{'customerIp':_0x4635bb[_0x8711('0x10d')]['x-forwarded-for']||_0x4635bb[_0x8711('0x10d')]['x-real-ip']||_0x4635bb[_0x8711('0x111')]['remoteAddress']||_0x4635bb['ip'],'referer':_0x4635bb['headers'][_0x8711('0x3f')],'openedInteractions':_0x12c327,'maxInteractions':_0x5656d4,'virtual':_0x498d54[_0x8711('0x107')],'online':_0x4e828a,'custom':_0x498d54,'address':_0x45676b?_0x10757e:null}))[_0x8711('0x112')](/'/g,'\x5c\x27')};_0x69fe23[_0x8711('0x34')](ejs[_0x8711('0xdf')](Mustache['render'](_0x581b97,_0x1e32f8),{'proactiveActions':_0x364c26,'alignment':_0x496ef9[_0x8711('0x113')],'verticalAlignment':_0x496ef9[_0x8711('0x114')],'div_color':_0x496ef9[_0x8711('0x103')],'labelText':_0x496ef9[_0x8711('0x115')],'text_color':_0x496ef9[_0x8711('0x116')],'text_button_color':_0x496ef9[_0x8711('0x117')],'button_color':_0x496ef9[_0x8711('0x118')],'background_color':_0x496ef9[_0x8711('0x119')],'hideWhenOffline':_0x496ef9[_0x8711('0x11a')],'intervalId':_0x496ef9[_0x8711('0x11b')],'isDevelopment':_0x5f29c5,'chatVersion':_0x34a20d}));})['catch'](handleError(_0x69fe23,null));};exports[_0x8711('0x11c')]=function(_0x44b35c,_0x865cec){var _0xa525a6=_0x44b35c[_0x8711('0x61')]['id'];var _0x168ff0=_0x44b35c[_0x8711('0x67')];var _0x3a347a=0xc8;var _0x152af9=null;return db['sequelize'][_0x8711('0xea')]({'isolationLevel':db[_0x8711('0xe9')][_0x8711('0x11d')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x23a174){return db[_0x8711('0x4d')][_0x8711('0x7d')]({'where':{'id':_0xa525a6},'transaction':_0x23a174})[_0x8711('0x19')](function(_0x30654f){if(_0x30654f){return db[_0x8711('0xab')][_0x8711('0x30')]({'where':{'ChatWebsiteId':_0xa525a6},'transaction':_0x23a174})[_0x8711('0x19')](function(){var _0x2819d1=_['map'](_0x168ff0,function(_0x1d9d6c){_0x1d9d6c[_0x8711('0x72')]=_0xa525a6;return _0x1d9d6c;});return db[_0x8711('0xab')][_0x8711('0xec')](_0x2819d1,{'transaction':_0x23a174});});}else{_0x3a347a=0x194;_0x152af9=[];}});})['then'](function(){if(_0x3a347a!==0x194){return db[_0x8711('0xab')][_0x8711('0x11e')]({'where':{'ChatWebsiteId':_0xa525a6},'order':_0x8711('0xb2')})['then'](function(_0x3d3d38){_0x152af9=_0x3d3d38;});}})[_0x8711('0x23')](function(_0x262ad5){_0x3a347a=0x1f4;logger[_0x8711('0x1f')](_0x262ad5[_0x8711('0x32')]);if(_0x262ad5[_0x8711('0x33')]){delete _0x262ad5[_0x8711('0x33')];}_0x152af9=_0x262ad5;})[_0x8711('0x11f')](function(){if(_0x152af9===null){_0x865cec[_0x8711('0x31')](_0x3a347a);}else{if(_0x3a347a===0x1f4){_0x865cec['status'](_0x3a347a)['send'](_0x152af9);}else{_0x865cec[_0x8711('0x24')](_0x3a347a)[_0x8711('0x25')](_0x152af9);}}});};exports[_0x8711('0x120')]=function(_0x355abe,_0x40923b){var _0x1f38e4={};var _0x3b8182={};var _0x522b07;var _0x4737a3;return db[_0x8711('0x4d')][_0x8711('0x7d')]({'where':{'id':_0x355abe['params']['id']}})['then'](handleEntityNotFound(_0x40923b,null))[_0x8711('0x19')](function(_0x11bc79){if(_0x11bc79){_0x522b07=_0x11bc79;_0x3b8182[_0x8711('0x46')]=_[_0x8711('0x75')](db['ChatApplication'][_0x8711('0x63')]);_0x3b8182[_0x8711('0x50')]=_[_0x8711('0x75')](_0x355abe[_0x8711('0x50')]);_0x3b8182[_0x8711('0x51')]=_[_0x8711('0x52')](_0x3b8182[_0x8711('0x46')],_0x3b8182[_0x8711('0x50')]);_0x1f38e4[_0x8711('0x53')]=_[_0x8711('0x52')](_0x3b8182[_0x8711('0x46')],qs[_0x8711('0x54')](_0x355abe[_0x8711('0x50')][_0x8711('0x54')]));_0x1f38e4['attributes']=_0x1f38e4[_0x8711('0x53')][_0x8711('0x64')]?_0x1f38e4[_0x8711('0x53')]:_0x3b8182['model'];_0x1f38e4[_0x8711('0x57')]=qs[_0x8711('0x58')](_0x355abe[_0x8711('0x50')][_0x8711('0x58')]);_0x1f38e4[_0x8711('0x59')]=qs[_0x8711('0x51')](_[_0x8711('0x5a')](_0x355abe[_0x8711('0x50')],_0x3b8182[_0x8711('0x51')]));if(_0x355abe[_0x8711('0x50')][_0x8711('0x5b')]){_0x1f38e4[_0x8711('0x59')]=_['merge'](_0x1f38e4[_0x8711('0x59')],{'$or':_[_0x8711('0x4c')](_0x1f38e4[_0x8711('0x53')],function(_0x15fb7d){var _0x42f6d6={};_0x42f6d6[_0x15fb7d]={'$like':'%'+_0x355abe[_0x8711('0x50')][_0x8711('0x5b')]+'%'};return _0x42f6d6;})});}_0x1f38e4=_['merge']({},_0x1f38e4,_0x355abe[_0x8711('0x5e')]);return _0x522b07[_0x8711('0x120')](_0x1f38e4);}})['then'](function(_0x490dfc){if(_0x490dfc){_0x4737a3=_0x490dfc[_0x8711('0x64')];if(!_0x355abe[_0x8711('0x50')][_0x8711('0x55')](_0x8711('0x56'))){_0x1f38e4[_0x8711('0x29')]=qs[_0x8711('0x29')](_0x355abe['query'][_0x8711('0x29')]);_0x1f38e4[_0x8711('0x28')]=qs[_0x8711('0x28')](_0x355abe[_0x8711('0x50')][_0x8711('0x28')]);}return _0x522b07[_0x8711('0x120')](_0x1f38e4);}})[_0x8711('0x19')](function(_0x4602ae){if(_0x4602ae){return _0x4602ae?{'count':_0x4737a3,'rows':_0x4602ae}:null;}})[_0x8711('0x19')](respondWithResult(_0x40923b,null))[_0x8711('0x23')](handleError(_0x40923b,null));};exports[_0x8711('0x121')]=function(_0x46abe9,_0x316d74){return db['chatProactiveAction'][_0x8711('0x65')]({'where':{'id':_0x46abe9['params']['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x316d74,null))[_0x8711('0x19')](function(_0x2b05cb){if(_0x2b05cb){return _0x2b05cb['addProactiveActions'](_0x46abe9['body'][_0x8711('0x79')],_[_0x8711('0x122')](_0x46abe9['body'],[_0x8711('0x79'),'id'])||{});}})['then'](respondWithResult(_0x316d74,null))[_0x8711('0x23')](handleError(_0x316d74,null));};exports[_0x8711('0x106')]=function(_0x4fd365,_0x41d14b){var _0x523515={};var _0x16e604={};var _0x423e17;var _0x3b4b04;return db['ChatWebsite'][_0x8711('0x7d')]({'where':{'id':_0x4fd365['params']['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x41d14b,null))[_0x8711('0x19')](function(_0x1bfc1a){if(_0x1bfc1a){_0x423e17=_0x1bfc1a;_0x16e604[_0x8711('0x46')]=_[_0x8711('0x75')](db[_0x8711('0x123')][_0x8711('0x63')]);_0x16e604[_0x8711('0x50')]=_['keys'](_0x4fd365[_0x8711('0x50')]);_0x16e604[_0x8711('0x51')]=_[_0x8711('0x52')](_0x16e604['model'],_0x16e604[_0x8711('0x50')]);_0x523515[_0x8711('0x53')]=_[_0x8711('0x52')](_0x16e604[_0x8711('0x46')],qs[_0x8711('0x54')](_0x4fd365[_0x8711('0x50')]['fields']));_0x523515['attributes']=_0x523515[_0x8711('0x53')][_0x8711('0x64')]?_0x523515[_0x8711('0x53')]:_0x16e604[_0x8711('0x46')];_0x523515[_0x8711('0x57')]=qs[_0x8711('0x58')](_0x4fd365[_0x8711('0x50')]['sort']);_0x523515[_0x8711('0x59')]=qs[_0x8711('0x51')](_[_0x8711('0x5a')](_0x4fd365[_0x8711('0x50')],_0x16e604[_0x8711('0x51')]));if(_0x4fd365[_0x8711('0x50')][_0x8711('0x5b')]){_0x523515[_0x8711('0x59')]=_[_0x8711('0x5c')](_0x523515[_0x8711('0x59')],{'$or':_[_0x8711('0x4c')](_0x523515[_0x8711('0x53')],function(_0x1dd734){var _0x2f9a08={};_0x2f9a08[_0x1dd734]={'$like':'%'+_0x4fd365[_0x8711('0x50')][_0x8711('0x5b')]+'%'};return _0x2f9a08;})});}_0x523515=_[_0x8711('0x5c')]({},_0x523515,_0x4fd365[_0x8711('0x5e')]);return _0x423e17[_0x8711('0x106')](_0x523515);}})[_0x8711('0x19')](function(_0x41ee87){if(_0x41ee87){_0x3b4b04=_0x41ee87['length'];if(!_0x4fd365[_0x8711('0x50')][_0x8711('0x55')](_0x8711('0x56'))){_0x523515[_0x8711('0x29')]=qs[_0x8711('0x29')](_0x4fd365[_0x8711('0x50')][_0x8711('0x29')]);_0x523515['offset']=qs[_0x8711('0x28')](_0x4fd365['query'][_0x8711('0x28')]);}return _0x423e17[_0x8711('0x106')](_0x523515);}})[_0x8711('0x19')](function(_0x218304){if(_0x218304){return _0x218304?{'count':_0x3b4b04,'rows':_0x218304}:null;}})[_0x8711('0x19')](respondWithResult(_0x41d14b,null))['catch'](handleError(_0x41d14b,null));};exports[_0x8711('0x124')]=function(_0x31f9f3,_0x416f56){var _0x374e46=_0x31f9f3['query'][_0x8711('0x125')]===_0x8711('0x126')?'offlineForm':_0x8711('0x127');return db['ChatWebsite'][_0x8711('0x65')]({'attributes':['id',_0x374e46],'where':{'id':_0x31f9f3[_0x8711('0x61')]['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x416f56,null))[_0x8711('0x19')](function(_0x2a94c1){if(_0x2a94c1){var _0x315c0f=_0x2a94c1[_0x374e46];var _0xfce89=_0x315c0f&&_0x315c0f[_0x8711('0x128')]?_0x315c0f[_0x8711('0x128')]:[];_0x416f56[_0x8711('0x34')]({'fromKey':_[_0x8711('0x93')](_0x315c0f[_0x8711('0x129')])?undefined:_0x315c0f[_0x8711('0x129')],'count':_0xfce89[_0x8711('0x64')],'rows':_0xfce89});}})[_0x8711('0x23')](handleError(_0x416f56,null));};exports[_0x8711('0x12a')]=function(_0xb22041,_0xa65247){var _0x27e5eb={'raw':![],'where':{}};var _0x7e4f82={};var _0x16c254={'count':0x0,'rows':[]};return db[_0x8711('0x4d')]['findOne']({'where':{'id':_0xb22041['params']['id']}})[_0x8711('0x19')](handleEntityNotFound(_0xa65247,null))[_0x8711('0x19')](function(_0x387cc9){if(_0x387cc9){_0x7e4f82[_0x8711('0x46')]=_['keys'](db[_0x8711('0xe2')]['rawAttributes']);_0x7e4f82[_0x8711('0x50')]=_[_0x8711('0x75')](_0xb22041[_0x8711('0x50')]);_0x7e4f82['filters']=_[_0x8711('0x52')](_0x7e4f82[_0x8711('0x46')],_0x7e4f82['query']);_0x27e5eb['attributes']=_[_0x8711('0x52')](_0x7e4f82[_0x8711('0x46')],qs[_0x8711('0x54')](_0xb22041['query']['fields']));_0x27e5eb[_0x8711('0x53')]=_0x27e5eb['attributes'][_0x8711('0x64')]?_0x27e5eb[_0x8711('0x53')]:_0x7e4f82[_0x8711('0x46')];if(!_0xb22041[_0x8711('0x50')][_0x8711('0x55')](_0x8711('0x56'))){_0x27e5eb['limit']=qs[_0x8711('0x29')](_0xb22041[_0x8711('0x50')][_0x8711('0x29')]);_0x27e5eb[_0x8711('0x28')]=qs['offset'](_0xb22041[_0x8711('0x50')]['offset']);}_0x27e5eb[_0x8711('0x57')]=qs[_0x8711('0x58')](_0xb22041[_0x8711('0x50')][_0x8711('0x58')]);_0x27e5eb[_0x8711('0x59')]=qs['filters'](_['pick'](_0xb22041[_0x8711('0x50')],_0x7e4f82[_0x8711('0x51')]));_0x27e5eb[_0x8711('0x59')]['ChatWebsiteId']=_0x387cc9['id'];if(_0xb22041['query']['filter']){_0x27e5eb[_0x8711('0x59')]=_[_0x8711('0x5c')](_0x27e5eb[_0x8711('0x59')],{'$or':_[_0x8711('0x4c')](_0x27e5eb[_0x8711('0x53')],function(_0x297c87){var _0x38f69f={};_0x38f69f[_0x297c87]={'$like':'%'+_0xb22041['query'][_0x8711('0x5b')]+'%'};return _0x38f69f;})});}_0x27e5eb=_[_0x8711('0x5c')]({},_0x27e5eb,_0xb22041[_0x8711('0x5e')]);return db[_0x8711('0xe2')]['count']({'where':_0x27e5eb['where']})[_0x8711('0x19')](function(_0x1f59be){_0x16c254['count']=_0x1f59be;if(_0xb22041[_0x8711('0x50')][_0x8711('0x76')]){_0x27e5eb['include']=[{'all':!![]}];}else{_0x27e5eb[_0x8711('0x5f')]=[{'model':db[_0x8711('0xa3')],'as':_0x8711('0x12b'),'required':![]},{'model':db[_0x8711('0xeb')],'as':_0x8711('0x12c'),'required':![]}];}return db[_0x8711('0xe2')][_0x8711('0x77')](_0x27e5eb);})[_0x8711('0x19')](function(_0x1814aa){_0x16c254[_0x8711('0x7e')]=_0x1814aa;return _0x16c254;});}})[_0x8711('0x19')](respondWithFilteredResult(_0xa65247,_0x27e5eb))[_0x8711('0x23')](handleError(_0xa65247,null));};exports[_0x8711('0x12d')]=function(_0x324484,_0x337c9f){return db[_0x8711('0x4d')][_0x8711('0x65')]({'where':{'id':_0x324484[_0x8711('0x61')]['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x337c9f,null))[_0x8711('0x19')](function(_0x34aab4){if(_0x34aab4){return _0x34aab4[_0x8711('0x12d')](_0x324484[_0x8711('0x67')][_0x8711('0x79')],_[_0x8711('0x122')](_0x324484[_0x8711('0x67')],[_0x8711('0x79'),'id'])||{})[_0x8711('0xdb')](function(_0x1b253c){for(var _0x4cc632=0x0;_0x4cc632<_0x324484[_0x8711('0x67')][_0x8711('0x79')]['length'];_0x4cc632+=0x1){socket[_0x8711('0x12e')](_0x8711('0x12f'),{'UserId':Number(_0x324484['body']['ids'][_0x4cc632]),'ChatWebsiteId':Number(_0x324484['params']['id'])});}return _0x1b253c;});}})[_0x8711('0x19')](respondWithResult(_0x337c9f,null))[_0x8711('0x23')](handleError(_0x337c9f,null));};exports[_0x8711('0x130')]=function(_0x26e74f,_0x3eb389){return db['ChatWebsite']['find']({'where':{'id':_0x26e74f[_0x8711('0x61')]['id']}})[_0x8711('0x19')](handleEntityNotFound(_0x3eb389,null))['then'](function(_0x49dab7){if(_0x49dab7){return _0x49dab7[_0x8711('0x130')](_0x26e74f[_0x8711('0x50')][_0x8711('0x79')])[_0x8711('0x19')](function(){if(_['isArray'](_0x26e74f[_0x8711('0x50')]['ids'])){for(var _0x284556=0x0;_0x284556<_0x26e74f[_0x8711('0x50')][_0x8711('0x79')]['length'];_0x284556+=0x1){socket[_0x8711('0x12e')](_0x8711('0x131'),{'UserId':Number(_0x26e74f[_0x8711('0x50')][_0x8711('0x79')][_0x284556]),'ChatWebsiteId':Number(_0x26e74f[_0x8711('0x61')]['id'])});}}else{socket['emit'](_0x8711('0x131'),{'UserId':Number(_0x26e74f[_0x8711('0x50')][_0x8711('0x79')]),'ChatWebsiteId':Number(_0x26e74f[_0x8711('0x61')]['id'])});}});}})[_0x8711('0x19')](respondWithStatusCode(_0x3eb389,null))[_0x8711('0x23')](handleError(_0x3eb389,null));};exports[_0x8711('0x132')]=function(_0x33fcac,_0x13ddd0){var _0x2e7cb5={};var _0x455c1f={};var _0x1a0191;var _0xc335ea;return db[_0x8711('0x4d')][_0x8711('0x7d')]({'where':{'id':_0x33fcac['params']['id']}})['then'](handleEntityNotFound(_0x13ddd0,null))[_0x8711('0x19')](function(_0x32b985){if(_0x32b985){_0x1a0191=_0x32b985;_0x455c1f[_0x8711('0x46')]=_[_0x8711('0x75')](db[_0x8711('0xff')][_0x8711('0x63')]);_0x455c1f[_0x8711('0x50')]=_[_0x8711('0x75')](_0x33fcac[_0x8711('0x50')]);_0x455c1f[_0x8711('0x51')]=_[_0x8711('0x52')](_0x455c1f['model'],_0x455c1f[_0x8711('0x50')]);_0x2e7cb5['attributes']=_['intersection'](_0x455c1f[_0x8711('0x46')],qs[_0x8711('0x54')](_0x33fcac['query']['fields']));_0x2e7cb5[_0x8711('0x53')]=_0x2e7cb5[_0x8711('0x53')][_0x8711('0x64')]?_0x2e7cb5[_0x8711('0x53')]:_0x455c1f['model'];_0x2e7cb5[_0x8711('0x57')]=qs[_0x8711('0x58')](_0x33fcac[_0x8711('0x50')]['sort']);_0x2e7cb5[_0x8711('0x59')]=qs[_0x8711('0x51')](_[_0x8711('0x5a')](_0x33fcac['query'],_0x455c1f[_0x8711('0x51')]));if(_0x33fcac[_0x8711('0x50')]['filter']){_0x2e7cb5[_0x8711('0x59')]=_['merge'](_0x2e7cb5[_0x8711('0x59')],{'$or':_['map'](_0x2e7cb5[_0x8711('0x53')],function(_0x363e16){var _0x12d40d={};_0x12d40d[_0x363e16]={'$like':'%'+_0x33fcac[_0x8711('0x50')][_0x8711('0x5b')]+'%'};return _0x12d40d;})});}_0x2e7cb5=_[_0x8711('0x5c')]({},_0x2e7cb5,_0x33fcac[_0x8711('0x5e')]);return _0x1a0191[_0x8711('0x132')](_0x2e7cb5);}})[_0x8711('0x19')](function(_0x6d4ce3){if(_0x6d4ce3){_0xc335ea=_0x6d4ce3[_0x8711('0x64')];if(!_0x33fcac['query'][_0x8711('0x55')](_0x8711('0x56'))){_0x2e7cb5[_0x8711('0x29')]=qs[_0x8711('0x29')](_0x33fcac[_0x8711('0x50')][_0x8711('0x29')]);_0x2e7cb5[_0x8711('0x28')]=qs[_0x8711('0x28')](_0x33fcac[_0x8711('0x50')][_0x8711('0x28')]);}return _0x1a0191[_0x8711('0x132')](_0x2e7cb5);}})[_0x8711('0x19')](function(_0x243a0e){if(_0x243a0e){return _0x243a0e?{'count':_0xc335ea,'rows':_0x243a0e}:null;}})['then'](respondWithResult(_0x13ddd0,null))[_0x8711('0x23')](handleError(_0x13ddd0,null));}; \ No newline at end of file +var _0x202c=['offlineMessageSubject','toPairsIn','subjectOffline','Chat','MailAccountId','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','fullname','internal','Tags','color','tag','getSnippet','interval','getProactiveActions','custom','increment','chatLicenseExceeded','readFileSync','origin','http://localhost:9000','address','remote','x-real-ip','connection','replace','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','bulkCreate','stack','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','online','false','onlineForm','items','fromKey','ChatOfflineMessage','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','emit','getAgents','mustache','ejs','fs-extra','lodash','html-to-text','ioredis','jayson/promise','../../components/parsers/qs','api','../../config/environment','APIBadRequestError','APINotFoundError','../../errors/api','APIOutOfIntervalError','handleError','APIConflictError','./helpers/wildcard-expressions','url','URL','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','result','message','sendStatus','status','json','undefined','limit','offset','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','name','send','user-agent-parser','setUA','user-agent','getResult','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','unknown','version','device','model','vendor','%s\x20%s\x20%s','type','stringify','index','Pause','ChatWebsite','rawAttributes','fieldName','key','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','show','length','find','catch','create','forEach','trim','\x22\x20is\x20not\x20a\x20valid\x20wildcard\x20expression','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','testWildcardValidity','params','mandatoryDispositionPause','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addCustomerAvatar','getLogo','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','isNil','existsSync','server/files/images/logos/','download','getAvatar','agentAvatar','join','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','customerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','Interval','resolve','timezone','ifTime','notify','chat','from','From\x20is\x20mandatory','mapKey','isEmpty','Body\x20is\x20mandatory','CmContact','createdAt','updatedAt','CompanyId','includes','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','List','Contacts','DESC','Intervals','account','orderBy','Applications','priority','list','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','applications','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','files','Sequelize','ValidationError','no\x20available\x20attributes','difference','ListId','from\x20is\x20mandatory','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','MailAccount','findOrCreate','spread','utf8','render','fromString','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','SendMail','sendMail','\x22%s\x22\x20<%s>','email','user','forwardOfflineAddress'];(function(_0x2365db,_0x4ea500){var _0x2bee41=function(_0x617f7b){while(--_0x617f7b){_0x2365db['push'](_0x2365db['shift']());}};_0x2bee41(++_0x4ea500);}(_0x202c,0x178));var _0xc202=function(_0x1c30bf,_0x68313b){_0x1c30bf=_0x1c30bf-0x0;var _0x5adc49=_0x202c[_0x1c30bf];return _0x5adc49;};'use strict';var Mustache=require(_0xc202('0x0'));var util=require('util');var path=require('path');var ejs=require(_0xc202('0x1'));var fs=require('fs');var fs_extra=require(_0xc202('0x2'));var _=require(_0xc202('0x3'));var querystring=require('querystring');var htmlToText=require(_0xc202('0x4'));var Redis=require(_0xc202('0x5'));var jayson=require(_0xc202('0x6'));var qs=require(_0xc202('0x7'));var logger=require('../../config/logger')(_0xc202('0x8'));var config=require(_0xc202('0x9'));var APIBadRequestError=require('../../errors/api')[_0xc202('0xa')];var APINotFoundError=require('../../errors/api')[_0xc202('0xb')];var APIOutOfIntervalError=require(_0xc202('0xc'))[_0xc202('0xd')];var APIHandleError=require(_0xc202('0xc'))[_0xc202('0xe')];var APIConflictError=require(_0xc202('0xc'))[_0xc202('0xf')];var wildcardUtils=require(_0xc202('0x10'));var URL=require(_0xc202('0x11'))[_0xc202('0x12')];var db=require(_0xc202('0x13'))['db'];config[_0xc202('0x14')]=_[_0xc202('0x15')](config['redis'],{'host':_0xc202('0x16'),'port':0x18eb});var socket=require(_0xc202('0x17'))(new Redis(config[_0xc202('0x14')]));require(_0xc202('0x18'))[_0xc202('0x19')](socket);var client=jayson[_0xc202('0x1a')][_0xc202('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0xc202('0x1b')]({'port':0x232a});var client9003=jayson[_0xc202('0x1a')]['http']({'port':0x232b});var client9001=jayson['client']['http']({'port':0x2329});function respondWithRpcPromise(_0x2dafa5,_0x4a333c,_0x2f18ec,_0x5971a6){return new Promise(function(_0x19af73,_0x1d580c){var _0x3018c8=_0x5971a6||client;return _0x3018c8[_0xc202('0x1c')](_0x2dafa5,_0x2f18ec)[_0xc202('0x1d')](function(_0x2419c5){logger[_0xc202('0x1e')]('ChatWebsite,\x20%s,\x20%s',_0x4a333c,_0xc202('0x1f'));logger[_0xc202('0x20')](_0xc202('0x21'),_0x4a333c,'request\x20sent',JSON['stringify'](_0x2419c5));if(_0x2419c5[_0xc202('0x22')]){if(_0x2419c5[_0xc202('0x22')][_0xc202('0x23')]===0x1f4){logger[_0xc202('0x22')](_0xc202('0x24'),_0x4a333c,_0x2419c5['error']['message']);return _0x1d580c(_0x2419c5[_0xc202('0x22')]['message']);}logger[_0xc202('0x22')](_0xc202('0x24'),_0x4a333c,_0x2419c5['error']['message']);return _0x19af73(_0x2419c5[_0xc202('0x22')]['message']);}else{logger[_0xc202('0x1e')](_0xc202('0x24'),_0x4a333c,_0xc202('0x1f'));_0x19af73(_0x2419c5[_0xc202('0x25')][_0xc202('0x26')]);}})['catch'](function(_0x59f84d){logger[_0xc202('0x22')](_0xc202('0x24'),_0x4a333c,_0x59f84d);_0x1d580c(_0x59f84d);});});}function respondWithStatusCode(_0x459bc2,_0x4ff3e3){_0x4ff3e3=_0x4ff3e3||0xcc;return function(_0xdd5798){if(_0xdd5798){return _0x459bc2[_0xc202('0x27')](_0x4ff3e3);}return _0x459bc2['status'](_0x4ff3e3)['end']();};}function respondWithResult(_0x257dfe,_0x2f8011){_0x2f8011=_0x2f8011||0xc8;return function(_0xd88a43){if(_0xd88a43){return _0x257dfe[_0xc202('0x28')](_0x2f8011)[_0xc202('0x29')](_0xd88a43);}};}function respondWithFilteredResult(_0x483357,_0x114abb){return function(_0x32f56c){if(_0x32f56c){var _0x4f01fa=typeof _0x114abb['offset']===_0xc202('0x2a')&&typeof _0x114abb[_0xc202('0x2b')]===_0xc202('0x2a');var _0x189211=_0x32f56c['count'];var _0x1f09cf=_0x4f01fa?0x0:_0x114abb[_0xc202('0x2c')];var _0x3c3f22=_0x4f01fa?_0x32f56c['count']:_0x114abb[_0xc202('0x2c')]+_0x114abb[_0xc202('0x2b')];var _0xf1fe4c;if(_0x3c3f22>=_0x189211){_0x3c3f22=_0x189211;_0xf1fe4c=0xc8;}else{_0xf1fe4c=0xce;}_0x483357[_0xc202('0x28')](_0xf1fe4c);return _0x483357[_0xc202('0x2d')](_0xc202('0x2e'),_0x1f09cf+'-'+_0x3c3f22+'/'+_0x189211)[_0xc202('0x29')](_0x32f56c);}return null;};}function saveUpdates(_0x358b35){return function(_0x561070){if(_0x561070){return _0x561070[_0xc202('0x2f')](_0x358b35)[_0xc202('0x1d')](function(_0x442653){return _0x442653;});}return null;};}function removeEntity(_0x50c547){return function(_0x38e439){if(_0x38e439){return _0x38e439[_0xc202('0x30')]()[_0xc202('0x1d')](function(){var _0x5a59a4=_0x38e439[_0xc202('0x31')]({'plain':!![]});var _0x501db2=_0xc202('0x32');return db[_0xc202('0x33')][_0xc202('0x30')]({'where':{'type':_0x501db2,'resourceId':_0x5a59a4['id']}})[_0xc202('0x1d')](function(){return _0x38e439;});})[_0xc202('0x1d')](function(){_0x50c547[_0xc202('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0xed50bd){return function(_0x5087e3){if(!_0x5087e3){_0xed50bd[_0xc202('0x27')](0x194);}return _0x5087e3;};}function handleError(_0x52e163,_0x244489){_0x244489=_0x244489||0x1f4;return function(_0x147272){logger[_0xc202('0x22')](_0x147272['stack']);if(_0x147272[_0xc202('0x34')]){delete _0x147272[_0xc202('0x34')];}_0x52e163[_0xc202('0x28')](_0x244489)[_0xc202('0x35')](_0x147272);};}function createInteractionObject(_0x306889,_0x2afa4e,_0x578344,_0x16608b){var _0x1e57c3=require(_0xc202('0x36'));var _0x4a8d2b=new _0x1e57c3();var _0x41e42b=_0x4a8d2b[_0xc202('0x37')](_0x578344[_0xc202('0x38')])[_0xc202('0x39')]();var _0x5bfaa2=_0x2afa4e['customerIp'];if(_0x578344[_0xc202('0x3a')]){_0x5bfaa2=_0x578344['cf-connecting-ip'];}else if(_0x578344[_0xc202('0x3b')]){_0x5bfaa2=_[_0xc202('0x3c')](_0x578344[_0xc202('0x3b')][_0xc202('0x3d')](','));}return{'ContactId':_0x16608b['id'],'ChatWebsiteId':_0x306889,'from':(_0x16608b[_0xc202('0x3e')]||'')+'\x20'+(_0x16608b[_0xc202('0x3f')]||''),'customerIp':_0x5bfaa2,'customerPort':_0x578344['x-real-port']?_0x578344[_0xc202('0x40')]:null,'referer':_0x2afa4e[_0xc202('0x41')],'browserName':_0x41e42b[_0xc202('0x42')][_0xc202('0x34')]&&_0x41e42b[_0xc202('0x42')]['version']?util[_0xc202('0x43')](_0xc202('0x44'),_0x41e42b[_0xc202('0x42')][_0xc202('0x34')],_0x41e42b[_0xc202('0x42')]['version']):_0xc202('0x45'),'browserVersion':_0x41e42b['browser'][_0xc202('0x46')]||'unknown','osName':util[_0xc202('0x43')](_0xc202('0x44'),_0x41e42b['os'][_0xc202('0x34')],_0x41e42b['os'][_0xc202('0x46')]),'osVersion':_0x41e42b['os']['version'],'deviceModel':_0x41e42b[_0xc202('0x47')][_0xc202('0x48')]&&_0x41e42b[_0xc202('0x47')][_0xc202('0x49')]?util[_0xc202('0x43')](_0xc202('0x4a'),_0x41e42b[_0xc202('0x47')][_0xc202('0x48')],_0x41e42b[_0xc202('0x47')][_0xc202('0x49')],_0x41e42b[_0xc202('0x47')][_0xc202('0x4b')]):null,'deviceVendor':_0x41e42b[_0xc202('0x47')][_0xc202('0x49')],'deviceType':_0x41e42b[_0xc202('0x47')][_0xc202('0x4b')],'formData':JSON[_0xc202('0x4c')](_0x2afa4e)};}exports[_0xc202('0x4d')]=function(_0x9f8ab3,_0x38e9c8){var _0x484013={'include':[{'model':db[_0xc202('0x4e')],'as':'mandatoryDispositionPause'}]},_0x39f2c1={},_0x187934={'count':0x0,'rows':[]};var _0x4ae64d=_['map'](db[_0xc202('0x4f')][_0xc202('0x50')],function(_0x1ae220){return{'name':_0x1ae220[_0xc202('0x51')],'type':_0x1ae220[_0xc202('0x4b')][_0xc202('0x52')]};});_0x39f2c1[_0xc202('0x48')]=_[_0xc202('0x53')](_0x4ae64d,_0xc202('0x34'));_0x39f2c1[_0xc202('0x54')]=_[_0xc202('0x55')](_0x9f8ab3[_0xc202('0x54')]);_0x39f2c1[_0xc202('0x56')]=_['intersection'](_0x39f2c1[_0xc202('0x48')],_0x39f2c1[_0xc202('0x54')]);_0x484013['attributes']=_[_0xc202('0x57')](_0x39f2c1[_0xc202('0x48')],qs[_0xc202('0x58')](_0x9f8ab3[_0xc202('0x54')][_0xc202('0x58')]));_0x484013['attributes']=_0x484013[_0xc202('0x59')]['length']?_0x484013[_0xc202('0x59')]:_0x39f2c1['model'];if(!_0x9f8ab3[_0xc202('0x54')][_0xc202('0x5a')]('nolimit')){_0x484013[_0xc202('0x2b')]=qs[_0xc202('0x2b')](_0x9f8ab3['query']['limit']);_0x484013['offset']=qs[_0xc202('0x2c')](_0x9f8ab3['query'][_0xc202('0x2c')]);}_0x484013[_0xc202('0x5b')]=qs[_0xc202('0x5c')](_0x9f8ab3[_0xc202('0x54')][_0xc202('0x5c')]);_0x484013[_0xc202('0x5d')]=qs[_0xc202('0x56')](_[_0xc202('0x5e')](_0x9f8ab3[_0xc202('0x54')],_0x39f2c1[_0xc202('0x56')]),_0x4ae64d);if(_0x9f8ab3[_0xc202('0x54')][_0xc202('0x5f')]){_0x484013[_0xc202('0x5d')]=_['merge'](_0x484013[_0xc202('0x5d')],{'$or':_['map'](_0x4ae64d,function(_0x5a7f2c){if(_0x5a7f2c[_0xc202('0x4b')]!==_0xc202('0x60')){var _0x40f55f={};_0x40f55f[_0x5a7f2c['name']]={'$like':'%'+_0x9f8ab3[_0xc202('0x54')]['filter']+'%'};return _0x40f55f;}})});}_0x484013=_[_0xc202('0x61')]({},_0x484013,_0x9f8ab3[_0xc202('0x62')]);var _0x5464ea={'where':_0x484013[_0xc202('0x5d')]};return db[_0xc202('0x4f')]['count'](_0x5464ea)[_0xc202('0x1d')](function(_0x499e75){_0x187934[_0xc202('0x63')]=_0x499e75;if(_0x9f8ab3[_0xc202('0x54')][_0xc202('0x64')]){_0x484013[_0xc202('0x65')]=[{'all':!![]}];}return db[_0xc202('0x4f')][_0xc202('0x66')](_0x484013);})[_0xc202('0x1d')](function(_0x5dc65f){_0x187934[_0xc202('0x67')]=_0x5dc65f;return _0x187934;})[_0xc202('0x1d')](respondWithFilteredResult(_0x38e9c8,_0x484013))['catch'](handleError(_0x38e9c8,null));};exports[_0xc202('0x68')]=function(_0x4860cf,_0x28ba39){var _0x4a2a48={'raw':![],'where':{'id':_0x4860cf['params']['id']},'include':[{'model':db[_0xc202('0x4e')],'as':'mandatoryDispositionPause'}]},_0x3642d2={};_0x3642d2['model']=_[_0xc202('0x55')](db[_0xc202('0x4f')][_0xc202('0x50')]);_0x3642d2[_0xc202('0x54')]=_[_0xc202('0x55')](_0x4860cf[_0xc202('0x54')]);_0x3642d2[_0xc202('0x56')]=_[_0xc202('0x57')](_0x3642d2[_0xc202('0x48')],_0x3642d2[_0xc202('0x54')]);_0x4a2a48['attributes']=_[_0xc202('0x57')](_0x3642d2[_0xc202('0x48')],qs['fields'](_0x4860cf[_0xc202('0x54')][_0xc202('0x58')]));_0x4a2a48[_0xc202('0x59')]=_0x4a2a48[_0xc202('0x59')][_0xc202('0x69')]?_0x4a2a48[_0xc202('0x59')]:_0x3642d2[_0xc202('0x48')];if(_0x4860cf[_0xc202('0x54')]['includeAll']){_0x4a2a48[_0xc202('0x65')]=[{'all':!![]}];}_0x4a2a48=_[_0xc202('0x61')]({},_0x4a2a48,_0x4860cf[_0xc202('0x62')]);return db[_0xc202('0x4f')][_0xc202('0x6a')](_0x4a2a48)['then'](handleEntityNotFound(_0x28ba39,null))[_0xc202('0x1d')](respondWithResult(_0x28ba39,null))[_0xc202('0x6b')](handleError(_0x28ba39,null));};exports[_0xc202('0x6c')]=function(_0x5ae21d,_0x7f638c){var _0x4dfb2f=null;_0x5ae21d['body']['address'][_0xc202('0x3d')](',')[_0xc202('0x6d')](_0x189884=>{if(_0x189884[_0xc202('0x6e')]()!==''&&!wildcardUtils['testWildcardValidity'](_0x189884[_0xc202('0x6e')]())){_0x4dfb2f=new APIBadRequestError('\x22'+_0x189884['trim']()+_0xc202('0x6f'));}});if(_0x4dfb2f){return handleError(_0x7f638c,null)(_0x4dfb2f);}return db[_0xc202('0x4f')]['create'](_0x5ae21d[_0xc202('0x70')],{})[_0xc202('0x1d')](function(_0xea479f){var _0x4d9423=_0x5ae21d['user']['get']({'plain':!![]});if(!_0x4d9423)throw new Error(_0xc202('0x71'));if(_0x4d9423[_0xc202('0x72')]==='user'){var _0x44d834=_0xea479f[_0xc202('0x31')]({'plain':!![]});var _0x5a97d5=_0xc202('0x32');return db['UserProfileSection'][_0xc202('0x6a')]({'where':{'name':_0x5a97d5,'userProfileId':_0x4d9423[_0xc202('0x73')]},'raw':!![]})[_0xc202('0x1d')](function(_0x436c8e){if(_0x436c8e&&_0x436c8e[_0xc202('0x74')]===0x0){return db['UserProfileResource']['create']({'name':_0x44d834[_0xc202('0x34')],'resourceId':_0x44d834['id'],'type':_0x436c8e[_0xc202('0x34')],'sectionId':_0x436c8e['id']},{})[_0xc202('0x1d')](function(){return _0xea479f;});}else{return _0xea479f;}})[_0xc202('0x6b')](function(_0x4171d8){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4171d8);throw _0x4171d8;});}return _0xea479f;})[_0xc202('0x1d')](respondWithResult(_0x7f638c,0xc9))[_0xc202('0x6b')](handleError(_0x7f638c,null));};exports[_0xc202('0x2f')]=function(_0x44cbd2,_0x6dc70e){var _0x1dd5c0=null;_0x44cbd2['body']['address'][_0xc202('0x3d')](',')[_0xc202('0x6d')](_0x16229b=>{if(_0x16229b['trim']()!==''&&!wildcardUtils[_0xc202('0x75')](_0x16229b[_0xc202('0x6e')]())){_0x1dd5c0=new APIBadRequestError('\x22'+_0x16229b['trim']()+_0xc202('0x6f'));}});if(_0x1dd5c0){return handleError(_0x6dc70e,null)(_0x1dd5c0);}if(_0x44cbd2[_0xc202('0x70')]['id']){delete _0x44cbd2['body']['id'];}return db[_0xc202('0x4f')][_0xc202('0x6a')]({'where':{'id':_0x44cbd2[_0xc202('0x76')]['id']},'include':[{'model':db[_0xc202('0x4e')],'as':_0xc202('0x77')}]})['then'](handleEntityNotFound(_0x6dc70e,null))[_0xc202('0x1d')](saveUpdates(_0x44cbd2['body'],null))[_0xc202('0x1d')](respondWithResult(_0x6dc70e,null))[_0xc202('0x6b')](handleError(_0x6dc70e,null));};exports['destroy']=function(_0x2d149a,_0x5b8a32){return db[_0xc202('0x4f')][_0xc202('0x6a')]({'where':{'id':_0x2d149a[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x5b8a32,null))['then'](removeEntity(_0x5b8a32,null))[_0xc202('0x6b')](handleError(_0x5b8a32,null));};exports[_0xc202('0x78')]=function(_0x3b8197,_0x3d33e5){return db[_0xc202('0x4f')][_0xc202('0x78')]()['then'](respondWithResult(_0x3d33e5,null))[_0xc202('0x6b')](handleError(_0x3d33e5,null));};exports[_0xc202('0x79')]=function(_0x4e4604,_0x1f7734){if(_0x4e4604[_0xc202('0x70')]['id']){delete _0x4e4604['body']['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x4e4604[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x1f7734,null))[_0xc202('0x1d')](function(_0x51e2df){if(_0x51e2df){_0x4e4604[_0xc202('0x70')][_0xc202('0x7a')]=_0x51e2df['id'];return db[_0xc202('0x7b')][_0xc202('0x6c')](_0x4e4604[_0xc202('0x70')]);}})['then'](respondWithResult(_0x1f7734,null))[_0xc202('0x6b')](handleError(_0x1f7734,null));};exports[_0xc202('0x7c')]=function(_0x963cc,_0x3b7c1c){var _0x20621b={'raw':![],'where':{}};var _0x291848={};var _0x429ebc={'count':0x0,'rows':[]};return db[_0xc202('0x4f')][_0xc202('0x7d')]({'where':{'id':_0x963cc[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x3b7c1c,null))['then'](function(_0x274c94){if(_0x274c94){_0x291848[_0xc202('0x48')]=_['keys'](db[_0xc202('0x7b')][_0xc202('0x50')]);_0x291848[_0xc202('0x54')]=_[_0xc202('0x55')](_0x963cc[_0xc202('0x54')]);_0x291848['filters']=_[_0xc202('0x57')](_0x291848['model'],_0x291848[_0xc202('0x54')]);_0x20621b[_0xc202('0x59')]=_[_0xc202('0x57')](_0x291848[_0xc202('0x48')],qs['fields'](_0x963cc[_0xc202('0x54')][_0xc202('0x58')]));_0x20621b[_0xc202('0x59')]=_0x20621b[_0xc202('0x59')][_0xc202('0x69')]?_0x20621b[_0xc202('0x59')]:_0x291848[_0xc202('0x48')];if(!_0x963cc[_0xc202('0x54')][_0xc202('0x5a')](_0xc202('0x7e'))){_0x20621b[_0xc202('0x2b')]=qs['limit'](_0x963cc['query'][_0xc202('0x2b')]);_0x20621b[_0xc202('0x2c')]=qs[_0xc202('0x2c')](_0x963cc[_0xc202('0x54')]['offset']);}_0x20621b[_0xc202('0x5b')]=qs['sort'](_0x963cc['query'][_0xc202('0x5c')]);_0x20621b[_0xc202('0x5d')]=qs['filters'](_['pick'](_0x963cc['query'],_0x291848[_0xc202('0x56')]));_0x20621b[_0xc202('0x5d')]['ChatWebsiteId']=_0x274c94['id'];if(_0x963cc[_0xc202('0x54')][_0xc202('0x5f')]){_0x20621b[_0xc202('0x5d')]=_[_0xc202('0x61')](_0x20621b['where'],{'$or':_[_0xc202('0x53')](_0x20621b[_0xc202('0x59')],function(_0x330f97){var _0x1c50cb={};_0x1c50cb[_0x330f97]={'$like':'%'+_0x963cc['query'][_0xc202('0x5f')]+'%'};return _0x1c50cb;})});}_0x20621b=_['merge']({},_0x20621b,_0x963cc['options']);return db[_0xc202('0x7b')][_0xc202('0x63')]({'where':_0x20621b[_0xc202('0x5d')]})[_0xc202('0x1d')](function(_0xaf2f5c){_0x429ebc['count']=_0xaf2f5c;if(_0x963cc[_0xc202('0x54')][_0xc202('0x64')]){_0x20621b[_0xc202('0x65')]=[{'all':!![]}];}return db['Disposition'][_0xc202('0x66')](_0x20621b);})[_0xc202('0x1d')](function(_0xe0c7b2){_0x429ebc['rows']=_0xe0c7b2;return _0x429ebc;});}})[_0xc202('0x1d')](respondWithFilteredResult(_0x3b7c1c,_0x20621b))[_0xc202('0x6b')](handleError(_0x3b7c1c,null));};exports[_0xc202('0x7f')]=function(_0x27fdb4,_0x558384){return db[_0xc202('0x4f')][_0xc202('0x6a')]({'where':{'id':_0x27fdb4[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x558384,null))['then'](function(_0x2a2f56){if(_0x2a2f56){return _0x2a2f56['removeDispositions'](_0x27fdb4[_0xc202('0x54')][_0xc202('0x80')]);}})[_0xc202('0x1d')](respondWithStatusCode(_0x558384,null))['catch'](handleError(_0x558384,null));};exports[_0xc202('0x81')]=function(_0xc3e1f6,_0x130c8b){if(_0xc3e1f6[_0xc202('0x70')]['id']){delete _0xc3e1f6[_0xc202('0x70')]['id'];}return db[_0xc202('0x4f')][_0xc202('0x6a')]({'where':{'id':_0xc3e1f6['params']['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x130c8b,null))[_0xc202('0x1d')](function(_0x4bb3fa){if(_0x4bb3fa){_0xc3e1f6[_0xc202('0x70')][_0xc202('0x7a')]=_0x4bb3fa['id'];return db[_0xc202('0x82')]['create'](_0xc3e1f6[_0xc202('0x70')]);}})[_0xc202('0x1d')](respondWithResult(_0x130c8b,null))['catch'](handleError(_0x130c8b,null));};exports['getAnswers']=function(_0x100ca6,_0xf3eda3){var _0x3f68ba={'raw':![],'where':{}};var _0x3c2d12={};var _0xf2094a={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xc202('0x7d')]({'where':{'id':_0x100ca6[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0xf3eda3,null))[_0xc202('0x1d')](function(_0x2a2a3e){if(_0x2a2a3e){_0x3c2d12[_0xc202('0x48')]=_['keys'](db['CannedAnswer']['rawAttributes']);_0x3c2d12[_0xc202('0x54')]=_[_0xc202('0x55')](_0x100ca6[_0xc202('0x54')]);_0x3c2d12[_0xc202('0x56')]=_['intersection'](_0x3c2d12['model'],_0x3c2d12[_0xc202('0x54')]);_0x3f68ba[_0xc202('0x59')]=_[_0xc202('0x57')](_0x3c2d12[_0xc202('0x48')],qs[_0xc202('0x58')](_0x100ca6[_0xc202('0x54')][_0xc202('0x58')]));_0x3f68ba[_0xc202('0x59')]=_0x3f68ba[_0xc202('0x59')][_0xc202('0x69')]?_0x3f68ba[_0xc202('0x59')]:_0x3c2d12[_0xc202('0x48')];if(!_0x100ca6[_0xc202('0x54')][_0xc202('0x5a')](_0xc202('0x7e'))){_0x3f68ba[_0xc202('0x2b')]=qs[_0xc202('0x2b')](_0x100ca6[_0xc202('0x54')][_0xc202('0x2b')]);_0x3f68ba[_0xc202('0x2c')]=qs['offset'](_0x100ca6[_0xc202('0x54')]['offset']);}_0x3f68ba['order']=qs[_0xc202('0x5c')](_0x100ca6['query']['sort']);_0x3f68ba[_0xc202('0x5d')]=qs[_0xc202('0x56')](_[_0xc202('0x5e')](_0x100ca6[_0xc202('0x54')],_0x3c2d12['filters']));_0x3f68ba[_0xc202('0x5d')][_0xc202('0x7a')]=_0x2a2a3e['id'];if(_0x100ca6[_0xc202('0x54')][_0xc202('0x5f')]){_0x3f68ba[_0xc202('0x5d')]=_['merge'](_0x3f68ba[_0xc202('0x5d')],{'$or':_['map'](_0x3f68ba[_0xc202('0x59')],function(_0x1b3c73){var _0x186b17={};_0x186b17[_0x1b3c73]={'$like':'%'+_0x100ca6['query']['filter']+'%'};return _0x186b17;})});}_0x3f68ba=_[_0xc202('0x61')]({},_0x3f68ba,_0x100ca6[_0xc202('0x62')]);return db[_0xc202('0x82')][_0xc202('0x63')]({'where':_0x3f68ba['where']})[_0xc202('0x1d')](function(_0x23e3f0){_0xf2094a['count']=_0x23e3f0;if(_0x100ca6[_0xc202('0x54')][_0xc202('0x64')]){_0x3f68ba[_0xc202('0x65')]=[{'all':!![]}];}return db[_0xc202('0x82')][_0xc202('0x66')](_0x3f68ba);})[_0xc202('0x1d')](function(_0x1b8507){_0xf2094a['rows']=_0x1b8507;return _0xf2094a;});}})[_0xc202('0x1d')](respondWithFilteredResult(_0xf3eda3,_0x3f68ba))[_0xc202('0x6b')](handleError(_0xf3eda3,null));};exports[_0xc202('0x83')]=function(_0x31bcfa,_0x3da1f6){return db[_0xc202('0x4f')]['find']({'where':{'id':_0x31bcfa[_0xc202('0x76')]['id']}})['then'](handleEntityNotFound(_0x3da1f6,null))['then'](function(_0x1cacd7){if(_0x1cacd7){return _0x1cacd7['removeAnswers'](_0x31bcfa[_0xc202('0x54')][_0xc202('0x80')]);}})[_0xc202('0x1d')](respondWithStatusCode(_0x3da1f6,null))[_0xc202('0x6b')](handleError(_0x3da1f6,null));};exports[_0xc202('0x84')]=function(_0x17c92f,_0x16c444){_0x17c92f[_0xc202('0x70')][_0xc202('0x85')]=_0x17c92f[_0xc202('0x86')][_0xc202('0x87')];return db['ChatWebsite'][_0xc202('0x6a')]({'where':{'id':_0x17c92f[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x16c444,null))[_0xc202('0x1d')](saveUpdates(_0x17c92f['body'],null))[_0xc202('0x1d')](respondWithResult(_0x16c444,null))[_0xc202('0x6b')](handleError(_0x16c444,null));};exports['addAvatar']=function(_0x3f09aa,_0x31bed9){_0x3f09aa[_0xc202('0x70')]['agentAvatar']=_0x3f09aa[_0xc202('0x86')][_0xc202('0x87')];return db[_0xc202('0x4f')]['find']({'where':{'id':_0x3f09aa[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x31bed9,null))['then'](saveUpdates(_0x3f09aa[_0xc202('0x70')],null))[_0xc202('0x1d')](respondWithResult(_0x31bed9,null))[_0xc202('0x6b')](handleError(_0x31bed9,null));};exports[_0xc202('0x88')]=function(_0x36def4,_0x22b25c){_0x36def4[_0xc202('0x70')]['customerAvatar']=_0x36def4[_0xc202('0x86')][_0xc202('0x87')];return db[_0xc202('0x4f')]['find']({'where':{'id':_0x36def4[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x22b25c,null))[_0xc202('0x1d')](saveUpdates(_0x36def4[_0xc202('0x70')],null))['then'](respondWithResult(_0x22b25c,null))['catch'](handleError(_0x22b25c,null));};exports['addSystemAvatar']=function(_0xb1d213,_0xa3293c){_0xb1d213[_0xc202('0x70')]['systemAvatar']=_0xb1d213['file']['filename'];return db['ChatWebsite'][_0xc202('0x6a')]({'where':{'id':_0xb1d213[_0xc202('0x76')]['id']}})['then'](handleEntityNotFound(_0xa3293c,null))['then'](saveUpdates(_0xb1d213[_0xc202('0x70')],null))[_0xc202('0x1d')](respondWithResult(_0xa3293c,null))[_0xc202('0x6b')](handleError(_0xa3293c,null));};exports[_0xc202('0x89')]=function(_0x416b2a,_0xa58f72){var _0x1f33dd=path['join'](config[_0xc202('0x8a')],_0xc202('0x8b'));var _0x161d84={'where':{'id':_0x416b2a['params']['id']},'attributes':['id',_0xc202('0x85')],'raw':!![]};var _0x236f7d=![];return require(_0xc202('0x8c'))[_0xc202('0x8d')]()['then'](function(_0xacffae){if(_0xacffae){_0x236f7d=_0xacffae['custom'];}})[_0xc202('0x1d')](function(){return db['ChatWebsite'][_0xc202('0x6a')](_0x161d84);})['then'](handleEntityNotFound(_0xa58f72,null))[_0xc202('0x1d')](function(_0x112b2e){if(_0x112b2e){if(!_[_0xc202('0x8e')](_0x112b2e[_0xc202('0x85')])){if(fs[_0xc202('0x8f')](path['join'](config[_0xc202('0x8a')],_0xc202('0x90'),_0x112b2e[_0xc202('0x85')]))&&_0x236f7d){_0x1f33dd=path['join'](config[_0xc202('0x8a')],_0xc202('0x90'),_0x112b2e[_0xc202('0x85')]);}}return _0xa58f72[_0xc202('0x91')](_0x1f33dd);}})['catch'](handleError(_0xa58f72,null));};exports[_0xc202('0x92')]=function(_0x37557a,_0x1d2f46){var _0x2fe360=path['join'](config[_0xc202('0x8a')],'server/files/images/avatars/default_avatar.png');var _0x2b4fd8={'where':{'id':_0x37557a[_0xc202('0x76')]['id']},'attributes':['id',_0xc202('0x93')],'raw':!![]};return db[_0xc202('0x4f')][_0xc202('0x6a')](_0x2b4fd8)['then'](handleEntityNotFound(_0x1d2f46,null))[_0xc202('0x1d')](function(_0x2892b2){if(_0x2892b2){if(!_['isNil'](_0x2892b2['agentAvatar'])){if(fs['existsSync'](path[_0xc202('0x94')](config[_0xc202('0x8a')],'server/files/images/avatars/',_0x2892b2['agentAvatar']))){_0x2fe360=path[_0xc202('0x94')](config[_0xc202('0x8a')],_0xc202('0x95'),_0x2892b2[_0xc202('0x93')]);}}return _0x1d2f46[_0xc202('0x91')](_0x2fe360);}})['catch'](handleError(_0x1d2f46,null));};exports[_0xc202('0x96')]=function(_0x7fe0e3,_0xc2e3de){var _0xcfb0cc=path[_0xc202('0x94')](config[_0xc202('0x8a')],'server/files/images/avatars/customer_avatar.png');var _0x462e41={'where':{'id':_0x7fe0e3[_0xc202('0x76')]['id']},'attributes':['id','customerAvatar',_0xc202('0x97')],'raw':!![]};return db[_0xc202('0x4f')]['find'](_0x462e41)[_0xc202('0x1d')](handleEntityNotFound(_0xc2e3de,null))[_0xc202('0x1d')](function(_0x55b895){if(_0x55b895){if(!_['isNil'](_0x55b895[_0xc202('0x98')])){if(fs[_0xc202('0x8f')](path[_0xc202('0x94')](config[_0xc202('0x8a')],_0xc202('0x95'),_0x55b895[_0xc202('0x98')]))&&_0x55b895['showCustomerAvatar']){_0xcfb0cc=path[_0xc202('0x94')](config['root'],'server/files/images/avatars/',_0x55b895['customerAvatar']);}}return _0xc2e3de[_0xc202('0x91')](_0xcfb0cc);}})['catch'](handleError(_0xc2e3de,null));};exports[_0xc202('0x99')]=function(_0x4b3d78,_0x335884){var _0x1271fd=path[_0xc202('0x94')](config[_0xc202('0x8a')],_0xc202('0x9a'));var _0xff16e2={'where':{'id':_0x4b3d78[_0xc202('0x76')]['id']},'attributes':['id',_0xc202('0x9b')],'raw':!![]};return db[_0xc202('0x4f')]['find'](_0xff16e2)[_0xc202('0x1d')](handleEntityNotFound(_0x335884,null))[_0xc202('0x1d')](function(_0x108dc5){if(_0x108dc5){if(!_['isNil'](_0x108dc5['systemAvatar'])){if(fs['existsSync'](path[_0xc202('0x94')](config['root'],_0xc202('0x95'),_0x108dc5[_0xc202('0x9b')]))){_0x1271fd=path[_0xc202('0x94')](config[_0xc202('0x8a')],_0xc202('0x95'),_0x108dc5[_0xc202('0x9b')]);}}return _0x335884[_0xc202('0x91')](_0x1271fd);}})[_0xc202('0x6b')](handleError(_0x335884,null));};function checkWebsiteInterval(_0x30b4de){var _0x379423=_0x30b4de[_0xc202('0x9c')];if(!_0x379423){return Promise[_0xc202('0x9d')](_0x30b4de);}var _0x3efa0b=_0x30b4de[_0xc202('0x9e')]||undefined;return _0x379423[_0xc202('0x9f')](_0x3efa0b)[_0xc202('0x1d')](function(_0x26351f){if(!_0x26351f){throw new APIOutOfIntervalError();}return _0x30b4de;});}exports[_0xc202('0xa0')]=function(_0x392125,_0x28b1cb){var _0x3a2e64={'body':_0x392125[_0xc202('0x70')],'channel':_0xc202('0xa1')};var _0x4cdcc8=[];var _0x2a12e1=[];var _0x3c1042={};var _0x180c0b=![];if(_0x392125[_0xc202('0x70')]['id']){delete _0x392125[_0xc202('0x70')]['id'];}if(_[_0xc202('0x8e')](_0x392125[_0xc202('0x70')][_0xc202('0xa2')])){throw new APIBadRequestError(_0xc202('0xa3'));}if(_[_0xc202('0x8e')](_0x392125[_0xc202('0x70')][_0xc202('0xa4')])){throw new APIBadRequestError('MapKey\x20is\x20mandatory');}if(_[_0xc202('0xa5')](_0x392125['body'][_0xc202('0x70')])){throw new APIBadRequestError(_0xc202('0xa6'));}var _0x52b876=_0x392125[_0xc202('0x70')]['customerIp']&&_0x392125['body'][_0xc202('0x41')];return db[_0xc202('0xa7')][_0xc202('0x78')]()[_0xc202('0x1d')](function(_0x1b5980){if(!_0x1b5980){throw new Error('No\x20available\x20attributes');}_0x4cdcc8=Object[_0xc202('0x55')](_0x1b5980)[_0xc202('0x5f')](function(_0x4332e1){return![_0xc202('0xa8'),'updatedAt']['includes'](_0x4332e1);});_0x2a12e1=Object[_0xc202('0x55')](_0x1b5980)['filter'](function(_0x4122fe){return![_0xc202('0xa8'),_0xc202('0xa9'),_0xc202('0xaa'),'ListId'][_0xc202('0xab')](_0x4122fe);});if(!_['includes'](_0x2a12e1,_0x392125[_0xc202('0x70')][_0xc202('0xa4')])){throw new APIBadRequestError(_0xc202('0xac')+_0x2a12e1[_0xc202('0x94')](',\x20'));}_0x3c1042[_0x392125[_0xc202('0x70')][_0xc202('0xa4')]]=_0x392125[_0xc202('0x70')][_0xc202('0xa2')];})[_0xc202('0x1d')](function(){return db['ChatWebsite'][_0xc202('0x6a')]({'where':{'id':_0x392125[_0xc202('0x76')]['id']},'include':[{'model':db['CmList'],'as':_0xc202('0xad'),'include':[{'model':db[_0xc202('0xa7')],'as':_0xc202('0xae'),'where':_0x3c1042,'limit':0x1,'order':[[_0xc202('0xa9'),_0xc202('0xaf')]]}]},{'model':db['ChatApplication'],'as':'Applications'},{'model':db['Interval'],'as':_0xc202('0x9c'),'include':[{'model':db[_0xc202('0x9c')],'as':_0xc202('0xb0'),'attributes':['id','interval'],'raw':!![]}]}]});})['then'](function(_0x552308){if(!_0x552308){throw new APINotFoundError(util[_0xc202('0x43')]('Chat\x20Website\x20with\x20id\x20%s\x20not\x20found',_0x392125[_0xc202('0x76')]['id']));}if(_0x52b876){return checkWebsiteInterval(_0x552308);}return _0x552308;})[_0xc202('0x1d')](function(_0x30c7ab){_0x3a2e64[_0xc202('0xb1')]=_0x30c7ab;_0x3a2e64['applications']=_[_0xc202('0xb2')](_0x30c7ab[_0xc202('0xb3')],[_0xc202('0xb4')],['asc']);if(_0x3a2e64[_0xc202('0xb1')][_0xc202('0xb3')]){delete _0x3a2e64[_0xc202('0xb1')]['Applications'];}_0x3a2e64[_0xc202('0xb5')]=_0x30c7ab[_0xc202('0xad')]||{'id':_0x30c7ab['ListId']};if(_0x3a2e64[_0xc202('0xb5')]&&_0x3a2e64['list'][_0xc202('0xae')]['length']){return _0x3a2e64[_0xc202('0xb5')][_0xc202('0xae')][0x0];}var _0x5bcab0=_[_0xc202('0x15')](_0x392125[_0xc202('0x70')],{'firstName':_0x392125[_0xc202('0x70')]['from'],'ListId':_0x30c7ab['ListId']});_0x5bcab0[_0x392125[_0xc202('0x70')][_0xc202('0xa4')]]=_0x392125[_0xc202('0x70')][_0xc202('0xa2')];return db['CmContact'][_0xc202('0x6c')](_0x5bcab0,{'fields':_0x4cdcc8,'raw':!![]});})['then'](function(_0x3fda23){_0x3a2e64[_0xc202('0xb6')]=_0x3fda23;var _0x35fdb5=createInteractionObject(_0x392125[_0xc202('0x76')]['id'],_0x392125['body'],_0x392125[_0xc202('0xb7')],_0x3fda23);var _0x3da9d6={'ChatWebsiteId':_0x392125['params']['id']};if(_0x392125[_0xc202('0x70')][_0xc202('0xb8')]){_0x3da9d6[_0xc202('0xb8')]=_0x392125[_0xc202('0x70')][_0xc202('0xb8')];_0x3da9d6[_0xc202('0xb9')]=![];return db[_0xc202('0xba')][_0xc202('0x6a')]({'where':_0x3da9d6})[_0xc202('0x1d')](function(_0x335ce5){var _0x1bdcd0=_0x392125[_0xc202('0x70')]['customerIp']&&_0x392125[_0xc202('0x70')]['referer'];if(_0x335ce5){_0x180c0b=!![];return _0x335ce5;}else if(!_0x1bdcd0&&_0x335ce5&&_0x335ce5['closed']){throw new APIConflictError(_0xc202('0xbb'));}_0x35fdb5[_0xc202('0xb8')]=_0x392125[_0xc202('0x70')][_0xc202('0xb8')];_0x35fdb5[_0xc202('0xbc')]=_0x392125['body']['externalUrl'];return db[_0xc202('0xba')][_0xc202('0x6c')](_0x35fdb5);});}_0x3da9d6[_0xc202('0xbd')]=_0x3fda23['id'];if(_0x392125[_0xc202('0x70')][_0xc202('0xbe')]&&_0x392125[_0xc202('0x70')]['interaction']['id']){_0x3da9d6['id']=_0x392125['body'][_0xc202('0xbe')]['id'];return db[_0xc202('0xba')][_0xc202('0x6a')]({'where':_0x3da9d6})['then'](function(_0x5a6d7e){var _0xe68860=_0x392125[_0xc202('0x70')]['customerIp']&&_0x392125[_0xc202('0x70')][_0xc202('0x41')];if(!_0xe68860&&_0x5a6d7e&&_0x5a6d7e['closed']){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}else if(_0x5a6d7e){_0x180c0b=!![];return _0x5a6d7e;}else{return db[_0xc202('0xba')]['create'](_0x35fdb5);}});}return db['ChatInteraction'][_0xc202('0x6c')](_0x35fdb5);})[_0xc202('0x1d')](function(_0xfdf0fd){if(!_0x180c0b){return _0xfdf0fd;}var _0x1367b7={'from':(_0x3a2e64['contact']['firstName']||'')+'\x20'+(_0x3a2e64[_0xc202('0xb6')][_0xc202('0x3f')]||'')};if(_0x392125[_0xc202('0x70')][_0xc202('0xb8')]&&_0x392125[_0xc202('0x70')]['messageId']&&_0x392125[_0xc202('0x70')][_0xc202('0xb8')]!=_0x392125[_0xc202('0x70')]['messageId']){_0x1367b7[_0xc202('0xb8')]=_0x392125['body'][_0xc202('0xbf')];}return _0xfdf0fd[_0xc202('0x2f')](_0x1367b7);})['then'](function(_0x32184b){_0x3a2e64['interaction']=_0x32184b[_0xc202('0x31')]({'plain':!![]});_0x3a2e64[_0xc202('0xbe')][_0xc202('0xc0')]=!_0x180c0b;if(_0x3a2e64[_0xc202('0xbe')]['created']){if(_0x3a2e64['account'][_0xc202('0xc1')]){_0x3a2e64['applications'][_0xc202('0xc2')]({'id':0x0,'priority':_0x3a2e64[_0xc202('0xc3')][_0xc202('0x69')]+0x1,'app':_0xc202('0xc4'),'appdata':_0xc202('0xc5'),'interval':_0xc202('0xc6')});}}return db[_0xc202('0xc7')][_0xc202('0x6c')]({'body':_0x392125[_0xc202('0x70')][_0xc202('0x70')],'ChatWebsiteId':_0x392125[_0xc202('0x76')]['id'],'ChatInteractionId':_0x32184b['id'],'direction':'in','ContactId':_0x3a2e64['contact']['id'],'AttachmentId':_0x392125[_0xc202('0x70')][_0xc202('0xc8')]});})[_0xc202('0x1d')](function(_0x59043d){_0x3a2e64[_0xc202('0x26')]=_0x59043d;if(!_0x3a2e64['interaction']['UserId']){return;}return db[_0xc202('0xc9')][_0xc202('0x6a')]({'attributes':['id',_0xc202('0x34')],'where':{'id':_0x3a2e64[_0xc202('0xbe')][_0xc202('0xca')]}});})[_0xc202('0x1d')](function(_0x4963da){if(_0x4963da){_0x3a2e64[_0xc202('0xc3')][_0xc202('0xcb')]({'id':0x0,'priority':0x0,'app':_0xc202('0xcc'),'appdata':_0x4963da[_0xc202('0x34')]+','+(_0x3a2e64[_0xc202('0xb1')][_0xc202('0xcd')]||0xa),'interval':_0xc202('0xc6')});_0x3a2e64[_0xc202('0xce')]=!![];}if(!_0x3a2e64['interaction'][_0xc202('0xcf')]){return;}return db[_0xc202('0xd0')][_0xc202('0x6a')]({'attributes':['id',_0xc202('0x34')],'where':{'id':_0x3a2e64[_0xc202('0xbe')][_0xc202('0xcf')]}});})[_0xc202('0x1d')](function(_0x569881){if(_0x569881){_0x3a2e64[_0xc202('0xc3')][_0xc202('0xcb')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x569881[_0xc202('0x34')]+','+(_0x3a2e64[_0xc202('0xb1')][_0xc202('0xd1')]||0x12c),'interval':_0xc202('0xc6')});}return respondWithRpcPromise(_0xc202('0xd2'),_0xc202('0xd3'),_0x3a2e64);})[_0xc202('0x1d')](function(_0x39679b){respondWithRpcPromise(_0xc202('0xd4'),_0xc202('0xd4'),{'event':'notify','message':_0x39679b},client9002);return _0x39679b;})[_0xc202('0x1d')](respondWithResult(_0x28b1cb,null))[_0xc202('0x6b')](APIHandleError(_0x28b1cb));};exports[_0xc202('0xd5')]=function(_0x45eab9,_0x3d5ea7){var _0x20f958,_0x4efa8e,_0x553dab;var _0x1ca42d=[];var _0xc5679f={};var _0x2b6b6b=_0x45eab9[_0xc202('0xd6')]||[];var _0x3cb323=[];var _0x56553b;return db[_0xc202('0xa7')][_0xc202('0x78')]()[_0xc202('0x1d')](function(_0x22c560){if(!_0x22c560){throw new db[(_0xc202('0xd7'))][(_0xc202('0xd8'))](_0xc202('0xd9'));}_0x1ca42d=_[_0xc202('0xda')](_['keys'](_0x22c560),[_0xc202('0xa8'),_0xc202('0xa9'),_0xc202('0xaa'),_0xc202('0xdb')]);if(_0x45eab9[_0xc202('0x70')]['id']){delete _0x45eab9[_0xc202('0x70')]['id'];}if(_[_0xc202('0x8e')](_0x45eab9[_0xc202('0x70')][_0xc202('0xa2')])){throw _0x3d5ea7[_0xc202('0x28')](0x1f4)[_0xc202('0x35')](new db[(_0xc202('0xd7'))][(_0xc202('0xd8'))](_0xc202('0xdc')));}if(_[_0xc202('0x8e')](_0x45eab9[_0xc202('0x70')][_0xc202('0x70')])||_0x45eab9[_0xc202('0x70')][_0xc202('0x70')]===''){throw _0x3d5ea7['status'](0x1f4)[_0xc202('0x35')](new db[(_0xc202('0xd7'))][(_0xc202('0xd8'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xc202('0x8e')](_0x45eab9['body'][_0xc202('0xdd')])){throw _0x3d5ea7['status'](0x1f4)[_0xc202('0x35')](new db[(_0xc202('0xd7'))][(_0xc202('0xd8'))](_0xc202('0xde')+_0x1ca42d));}if(!_[_0xc202('0xab')](_0x1ca42d,_0x45eab9['body']['mapKeyOffline'])){throw _0x3d5ea7['status'](0x1f4)[_0xc202('0x35')](new db['Sequelize'][(_0xc202('0xd8'))](_0xc202('0xdf')+_0x1ca42d));}_0xc5679f[_0x45eab9['body']['mapKeyOffline']]=_0x45eab9[_0xc202('0x70')][_0xc202('0xa2')];})['then'](function(){return db['ChatWebsite'][_0xc202('0x6a')]({'where':{'id':_0x45eab9[_0xc202('0x76')]['id']},'include':[{'model':db[_0xc202('0xe0')],'as':_0xc202('0xad')},{'model':db[_0xc202('0xe1')],'as':_0xc202('0xe1')}]});})[_0xc202('0x1d')](handleEntityNotFound(_0x3d5ea7,null))[_0xc202('0x1d')](function(_0x12b519){if(_0x12b519&&_0x12b519['List']){_0x4efa8e=_0x12b519;var _0x34538d=_[_0xc202('0x15')](_0x45eab9[_0xc202('0x70')],{'firstName':_0x45eab9[_0xc202('0x70')][_0xc202('0xa2')],'phone':_0x45eab9[_0xc202('0x70')][_0xc202('0xa2')],'ListId':_0x12b519[_0xc202('0xdb')]});_0x34538d[_0x45eab9[_0xc202('0x70')][_0xc202('0xdd')]]=_0x45eab9['body'][_0xc202('0xa2')];return db[_0xc202('0xa7')][_0xc202('0xe2')]({'where':_0xc5679f,'defaults':_0x34538d});}})[_0xc202('0xe3')](function(_0x58243f){if(_0x58243f){_0x553dab=_0x58243f;var _0x4b94f6=fs['readFileSync'](path[_0xc202('0x94')](config[_0xc202('0x8a')],'server/files/templates/chatOfflineMessage.ejs'),_0xc202('0xe4'));var _0x1fd98b=ejs[_0xc202('0xe5')](_0x4b94f6,{'body':_['toPairs'](_0x45eab9['body'][_0xc202('0x70')]),'bodyTitle':_0x4efa8e['offlineMessageBody']});return db['ChatOfflineMessage'][_0xc202('0x6c')]({'body':_0x1fd98b,'plainBody':htmlToText[_0xc202('0xe6')](_0x1fd98b),'ContactId':_0x58243f['id'],'ChatWebsiteId':_0x4efa8e['id']});}})[_0xc202('0x1d')](function(_0x417f99){_0x56553b=_0x417f99;if(_0x2b6b6b[_0xc202('0x69')]){var _0xd981a9=_0x2b6b6b[_0xc202('0x53')](function(_0x5438cf){return{'name':_0x5438cf[_0xc202('0xe7')],'basename':_0x5438cf[_0xc202('0x87')],'type':_0x5438cf[_0xc202('0xe8')],'ChatOfflineMessageId':_0x417f99['id']};});_0x3cb323=_0xd981a9['map'](_0x213a6d=>{var _0x5c3a6b={'filename':_0x213a6d['name'],'path':path[_0xc202('0x94')](config[_0xc202('0x8a')],_0xc202('0xe9'),_0xc202('0xd6'),_0xc202('0xea'),_0xc202('0xeb'),_0x213a6d['basename'])};return _0x5c3a6b;});if(!_0x4efa8e[_0xc202('0xec')]){return db[_0xc202('0xed')][_0xc202('0xee')](function(_0x54ee3e){return db[_0xc202('0xef')]['bulkCreate'](_0xd981a9,{'transaction':_0x54ee3e});});}}})[_0xc202('0x1d')](function(){if(_0x56553b){_0x20f958=_0x56553b;return db[_0xc202('0xe1')][_0xc202('0x7d')]({'where':{'service':!![]},'include':[{'model':db[_0xc202('0xf0')],'as':_0xc202('0xf1'),'raw':!![],'include':[{'model':db[_0xc202('0xf2')],'as':_0xc202('0xf2'),'raw':!![]}]}]});}})[_0xc202('0x1d')](function(_0x2e0f8c){if(_0x2e0f8c&&_0x2e0f8c[_0xc202('0xf1')]&&_0x4efa8e[_0xc202('0xf3')]&&_0x4efa8e['forwardOfflineAddress']){var _0x6f15d=_0x2e0f8c['getSmtpOptions']();return respondWithRpcPromise(_0xc202('0xf4'),_0xc202('0xf5'),{'account':_0x6f15d,'message':{'from':util[_0xc202('0x43')](_0xc202('0xf6'),_0x2e0f8c['name'],_0x2e0f8c[_0xc202('0xf7')]||_0x2e0f8c['Smtp'][_0xc202('0xf8')]),'to':_0x4efa8e[_0xc202('0xf9')],'subject':_0x4efa8e[_0xc202('0xfa')],'html':_0x20f958['body'],'attachments':_0x3cb323}},client9003)[_0xc202('0x1d')](function(){return _0x20f958;})[_0xc202('0x6b')](function(_0x4a1b1a){logger['error'](_0x4a1b1a);});}})[_0xc202('0x1d')](function(){if(_0x4efa8e&&_0x4efa8e[_0xc202('0xec')]&&_0x4efa8e['MailAccountId']){var _0x47963d=[];if(_0x2b6b6b[_0xc202('0x69')]){_0x47963d=_0x2b6b6b[_0xc202('0x53')](function(_0x1f62a0){return{'name':_0x1f62a0[_0xc202('0xe7')],'basename':_0x1f62a0['filename'],'type':_0x1f62a0[_0xc202('0xe8')],'ChatOfflineMessageId':_0x56553b['id']};});}var _0x2f5fd7;if(!_['isNil'](_0x4efa8e['subjectOffline'])){var _0x28e6e3=_[_0xc202('0x53')](_0x45eab9['body'],function(_0x5ae204){return _0x5ae204;});var _0x4e811d=_[_0xc202('0xfb')](_0x28e6e3)[0x0];var _0x1128b9=_['mapValues'](_0x4e811d,function(_0x2d1f45){return _0x2d1f45;});_0x2f5fd7=_0x1128b9[0x1][_0x4efa8e[_0xc202('0xfc')]];}var _0x329572={'from':_0x553dab[_0xc202('0xf7')],'firstName':_0x553dab[_0xc202('0x3e')],'lastName':_0x553dab[_0xc202('0x3f')],'mapKey':_0xc202('0xf7'),'message':{'from':_0x553dab[_0xc202('0xf7')],'to':_0x4efa8e[_0xc202('0xe1')][_0xc202('0xf7')],'cc':'','subject':_[_0xc202('0x8e')](_0x2f5fd7)?_0x4efa8e[_0xc202('0xfa')]:_0x2f5fd7,'messageId':'','sentAt':new Date(),'attach':_0x47963d[_0xc202('0x69')],'attachments':_0x47963d,'originChannel':_0xc202('0xfd'),'ChatWebsiteId':_0x4efa8e['id'],'ChatOfflineMessageId':_0x20f958['id'],'originTo':_0x4efa8e['MailAccount'][_0xc202('0xf7')]},'body':_0x20f958[_0xc202('0x70')]};var _0x5e91e4={'account':{'id':_0x4efa8e[_0xc202('0xfe')]},'body':_0x329572,'log':_0xc202('0xff')};return respondWithRpcPromise('NotifyMailAccount',_0xc202('0x100'),_0x5e91e4,client9001)['then'](function(){return _0x20f958;})[_0xc202('0x6b')](function(_0x349393){logger[_0xc202('0x22')](_0x349393);});}return;})[_0xc202('0x1d')](function(){if(_0x20f958){return _0x20f958;}})[_0xc202('0x1d')](respondWithResult(_0x3d5ea7,null))[_0xc202('0x6b')](function(){for(var _0x12f70f of _0x2b6b6b){var _0x432253=path[_0xc202('0x94')](config[_0xc202('0x8a')],_0xc202('0xe9'),_0xc202('0xd6'),_0xc202('0xea'),_0xc202('0xeb'),_0x12f70f[_0xc202('0x87')]);fs_extra[_0xc202('0x101')](_0x432253)['catch'](function(_0x109dc9){logger[_0xc202('0x22')](_0xc202('0x102'),_0x432253,_0x109dc9);});}});};exports['addInteraction']=function(_0x168281,_0x1c4245){return db[_0xc202('0xba')][_0xc202('0x6a')]({'where':{'id':_0x168281['params']['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x1c4245,null))['then'](function(_0x2033da){if(_0x2033da){return _0x2033da[_0xc202('0x103')](_0x168281[_0xc202('0x70')][_0xc202('0x80')],_[_0xc202('0x104')](_0x168281[_0xc202('0x70')],[_0xc202('0x80'),'id'])||{});}})[_0xc202('0x1d')](respondWithResult(_0x1c4245,null))[_0xc202('0x6b')](handleError(_0x1c4245,null));};exports['getInteractions']=function(_0x495314,_0x413380){var _0x431397={'raw':![],'where':{}};var _0x541fc4={};var _0xf9792={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x495314[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x413380,null))[_0xc202('0x1d')](function(_0x1ba783){if(_0x1ba783){_0x541fc4[_0xc202('0x48')]=_['keys'](db[_0xc202('0xba')][_0xc202('0x50')]);_0x541fc4['query']=_[_0xc202('0x55')](_0x495314[_0xc202('0x54')]);_0x541fc4[_0xc202('0x56')]=_['intersection'](_0x541fc4[_0xc202('0x48')],_0x541fc4['query']);_0x431397[_0xc202('0x59')]=_['intersection'](_0x541fc4[_0xc202('0x48')],qs[_0xc202('0x58')](_0x495314[_0xc202('0x54')][_0xc202('0x58')]));_0x431397[_0xc202('0x59')]=_0x431397[_0xc202('0x59')][_0xc202('0x69')]?_0x431397[_0xc202('0x59')]:_0x541fc4['model'];if(!_0x495314[_0xc202('0x54')][_0xc202('0x5a')](_0xc202('0x7e'))){_0x431397['limit']=qs[_0xc202('0x2b')](_0x495314[_0xc202('0x54')][_0xc202('0x2b')]);_0x431397[_0xc202('0x2c')]=qs[_0xc202('0x2c')](_0x495314[_0xc202('0x54')][_0xc202('0x2c')]);}_0x431397['order']=qs[_0xc202('0x5c')](_0x495314[_0xc202('0x54')][_0xc202('0x5c')]);_0x431397[_0xc202('0x5d')]=qs[_0xc202('0x56')](_[_0xc202('0x5e')](_0x495314[_0xc202('0x54')],_0x541fc4['filters']));_0x431397[_0xc202('0x5d')]['ChatWebsiteId']=_0x1ba783['id'];if(_0x495314[_0xc202('0x54')][_0xc202('0x5f')]){_0x431397[_0xc202('0x5d')]=_[_0xc202('0x61')](_0x431397[_0xc202('0x5d')],{'$or':_[_0xc202('0x53')](_0x431397[_0xc202('0x59')],function(_0x5e5522){var _0x3998ae={};_0x3998ae[_0x5e5522]={'$like':'%'+_0x495314[_0xc202('0x54')]['filter']+'%'};return _0x3998ae;})});}_0x431397=_[_0xc202('0x61')]({},_0x431397,_0x495314[_0xc202('0x62')]);return db[_0xc202('0xba')]['count']({'where':_0x431397[_0xc202('0x5d')]})[_0xc202('0x1d')](function(_0x2e1b42){_0xf9792['count']=_0x2e1b42;if(_0x495314[_0xc202('0x54')][_0xc202('0x64')]){_0x431397[_0xc202('0x65')]=[{'model':db[_0xc202('0xa7')],'as':_0xc202('0x105'),'required':![]},{'model':db[_0xc202('0xc9')],'as':'Owner','attributes':[_0xc202('0x34'),_0xc202('0x106'),_0xc202('0x107')],'required':![]},{'model':db['Tag'],'as':_0xc202('0x108'),'attributes':['id',_0xc202('0x34'),_0xc202('0x109')],'where':_0x495314[_0xc202('0x54')][_0xc202('0x10a')]?{'id':_0x495314[_0xc202('0x54')][_0xc202('0x10a')]}:undefined,'required':_0x495314[_0xc202('0x54')][_0xc202('0x10a')]?!![]:![]}];}return db[_0xc202('0xba')][_0xc202('0x66')](_0x431397);})[_0xc202('0x1d')](function(_0x10cb76){_0xf9792[_0xc202('0x67')]=_0x10cb76;return _0xf9792;});}})['then'](respondWithFilteredResult(_0x413380,_0x431397))[_0xc202('0x6b')](handleError(_0x413380,null));};exports[_0xc202('0x10b')]=function(_0x574c42,_0x1ce067){var _0x5398b2=0x0;var _0x1cad99=0x0;var _0x22fa07=![];var _0x11f203;var _0x5667e6;return db[_0xc202('0x4f')][_0xc202('0x6a')]({'where':{'id':_0x574c42[_0xc202('0x76')]['id']},'include':[{'model':db[_0xc202('0x9c')],'as':_0xc202('0x9c'),'include':[{'model':db[_0xc202('0x9c')],'as':_0xc202('0xb0'),'attributes':['id',_0xc202('0x10c')]}]}]})[_0xc202('0x1d')](handleEntityNotFound(_0x1ce067,null))[_0xc202('0x1d')](function(_0x21bb38){if(_0x21bb38){_0x11f203=_0x21bb38;return _0x21bb38[_0xc202('0x10d')]({'raw':!![]});}})['then'](function(_0x20c408){if(_0x11f203){if(_0x20c408){_0x5667e6=_0x20c408;}}return require(_0xc202('0x8c'))[_0xc202('0x8d')]();})[_0xc202('0x1d')](function(_0x4fa995){if(_0x4fa995){_0x1cad99=_0x4fa995['virtual'];_0x22fa07=_0x4fa995[_0xc202('0x10e')];}})[_0xc202('0x1d')](function(){return db['ChatInteraction'][_0xc202('0x63')]({'where':{'closed':![]}});})[_0xc202('0x1d')](function(_0x5645fe){_0x5398b2=_0x5645fe;if(_0x1cad99&&_0x5645fe>_0x1cad99){return db['License'][_0xc202('0x7d')]({'where':{'id':0x1}})['then'](function(_0x295345){if(_0x295345){_0x295345[_0xc202('0x10f')](_0xc202('0x110'));}});}})[_0xc202('0x1d')](function(){var _0x395aa7=_0x11f203[_0xc202('0x9c')];var _0x5842d0=_0x11f203[_0xc202('0x9e')]||undefined;return _0x395aa7?_0x395aa7['ifTime'](_0x5842d0):!![];})[_0xc202('0x1d')](function(_0x130542){var _0x43a30e=fs[_0xc202('0x111')](path[_0xc202('0x94')](config[_0xc202('0x8a')],'server/files/chat/iframe.ejs'),_0xc202('0xe4'));var _0x15cebb='3.10.1';var _0x3318f2=![];var _0x3df8a6,_0x271ac3;if(_0x574c42['headers']['referer']){_0x3df8a6=new URL(_0x574c42[_0xc202('0xb7')][_0xc202('0x41')])[_0xc202('0x112')];}else if(_0x574c42[_0xc202('0xb7')][_0xc202('0x112')]){_0x3df8a6=new URL(_0x574c42['headers']['origin'])[_0xc202('0x112')];}else{_0x3df8a6=_0xc202('0x113');}_0x271ac3=typeof _0x11f203[_0xc202('0x114')][_0xc202('0x3d')](',')[_0xc202('0x6a')](function(_0x5d435e){return wildcardUtils['testWebsiteWithWildcard'](_0x5d435e,_0x3df8a6);})!==_0xc202('0x2a');var _0x590be4={'chatVersion':_0x15cebb,'chatWebsiteAddressOrigin':_0x271ac3?_0x3df8a6:_0x11f203[_0xc202('0x114')],'remote':_0x11f203[_0xc202('0x115')],'query':querystring['stringify'](_[_0xc202('0x61')](_0x11f203[_0xc202('0x31')]({'plain':!![]}),{'customerIp':_0x574c42[_0xc202('0xb7')][_0xc202('0x3b')]||_0x574c42['headers'][_0xc202('0x116')]||_0x574c42[_0xc202('0x117')]['remoteAddress']||_0x574c42['ip'],'referer':_0x574c42[_0xc202('0xb7')][_0xc202('0x41')],'openedInteractions':_0x5398b2,'maxInteractions':_0x1cad99,'virtual':_0x22fa07['virtual'],'online':_0x130542,'custom':_0x22fa07,'address':_0x271ac3?_0x3df8a6:null}))[_0xc202('0x118')](/'/g,'\x5c\x27')};_0x1ce067['send'](ejs['render'](Mustache[_0xc202('0xe5')](_0x43a30e,_0x590be4),{'proactiveActions':_0x5667e6,'alignment':_0x11f203['alignment'],'verticalAlignment':_0x11f203['verticalAlignment'],'div_color':_0x11f203[_0xc202('0x109')],'labelText':_0x11f203[_0xc202('0x119')],'text_color':_0x11f203[_0xc202('0x11a')],'text_button_color':_0x11f203[_0xc202('0x11b')],'button_color':_0x11f203[_0xc202('0x11c')],'background_color':_0x11f203[_0xc202('0x11d')],'hideWhenOffline':_0x11f203[_0xc202('0x11e')],'intervalId':_0x11f203[_0xc202('0x11f')],'isDevelopment':_0x3318f2,'chatVersion':_0x15cebb}));})[_0xc202('0x6b')](handleError(_0x1ce067,null));};exports['addApplications']=function(_0x4c5ff1,_0x35c279){var _0x33c584=_0x4c5ff1['params']['id'];var _0x45da3e=_0x4c5ff1[_0xc202('0x70')];var _0x21bca1=0xc8;var _0x13e5ac=null;return db['sequelize'][_0xc202('0xee')]({'isolationLevel':db[_0xc202('0xed')][_0xc202('0x120')][_0xc202('0x121')][_0xc202('0x122')]},function(_0xda11ce){return db[_0xc202('0x4f')][_0xc202('0x7d')]({'where':{'id':_0x33c584},'transaction':_0xda11ce})['then'](function(_0xb1ad01){if(_0xb1ad01){return db[_0xc202('0x123')][_0xc202('0x30')]({'where':{'ChatWebsiteId':_0x33c584},'transaction':_0xda11ce})['then'](function(){var _0xfb699f=_['map'](_0x45da3e,function(_0x43f08c){_0x43f08c[_0xc202('0x7a')]=_0x33c584;return _0x43f08c;});return db[_0xc202('0x123')][_0xc202('0x124')](_0xfb699f,{'transaction':_0xda11ce});});}else{_0x21bca1=0x194;_0x13e5ac=[];}});})[_0xc202('0x1d')](function(){if(_0x21bca1!==0x194){return db[_0xc202('0x123')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x33c584},'order':_0xc202('0xb4')})['then'](function(_0x30581b){_0x13e5ac=_0x30581b;});}})[_0xc202('0x6b')](function(_0x50edd5){_0x21bca1=0x1f4;logger[_0xc202('0x22')](_0x50edd5[_0xc202('0x125')]);if(_0x50edd5[_0xc202('0x34')]){delete _0x50edd5['name'];}_0x13e5ac=_0x50edd5;})[_0xc202('0x126')](function(){if(_0x13e5ac===null){_0x35c279['sendStatus'](_0x21bca1);}else{if(_0x21bca1===0x1f4){_0x35c279[_0xc202('0x28')](_0x21bca1)['send'](_0x13e5ac);}else{_0x35c279[_0xc202('0x28')](_0x21bca1)['json'](_0x13e5ac);}}});};exports[_0xc202('0x127')]=function(_0x458e18,_0x241669){var _0x564f29={};var _0x3df3bf={};var _0x49e94d;var _0x51d4ec;return db[_0xc202('0x4f')][_0xc202('0x7d')]({'where':{'id':_0x458e18[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x241669,null))[_0xc202('0x1d')](function(_0x502ab3){if(_0x502ab3){_0x49e94d=_0x502ab3;_0x3df3bf[_0xc202('0x48')]=_['keys'](db['ChatApplication'][_0xc202('0x50')]);_0x3df3bf[_0xc202('0x54')]=_[_0xc202('0x55')](_0x458e18['query']);_0x3df3bf[_0xc202('0x56')]=_[_0xc202('0x57')](_0x3df3bf['model'],_0x3df3bf[_0xc202('0x54')]);_0x564f29[_0xc202('0x59')]=_[_0xc202('0x57')](_0x3df3bf[_0xc202('0x48')],qs[_0xc202('0x58')](_0x458e18[_0xc202('0x54')][_0xc202('0x58')]));_0x564f29['attributes']=_0x564f29[_0xc202('0x59')][_0xc202('0x69')]?_0x564f29['attributes']:_0x3df3bf[_0xc202('0x48')];_0x564f29[_0xc202('0x5b')]=qs[_0xc202('0x5c')](_0x458e18[_0xc202('0x54')][_0xc202('0x5c')]);_0x564f29['where']=qs[_0xc202('0x56')](_['pick'](_0x458e18['query'],_0x3df3bf[_0xc202('0x56')]));if(_0x458e18[_0xc202('0x54')]['filter']){_0x564f29[_0xc202('0x5d')]=_[_0xc202('0x61')](_0x564f29[_0xc202('0x5d')],{'$or':_[_0xc202('0x53')](_0x564f29[_0xc202('0x59')],function(_0x170c56){var _0x1df94e={};_0x1df94e[_0x170c56]={'$like':'%'+_0x458e18[_0xc202('0x54')][_0xc202('0x5f')]+'%'};return _0x1df94e;})});}_0x564f29=_[_0xc202('0x61')]({},_0x564f29,_0x458e18['options']);return _0x49e94d[_0xc202('0x127')](_0x564f29);}})[_0xc202('0x1d')](function(_0x3e23ca){if(_0x3e23ca){_0x51d4ec=_0x3e23ca[_0xc202('0x69')];if(!_0x458e18[_0xc202('0x54')][_0xc202('0x5a')]('nolimit')){_0x564f29['limit']=qs['limit'](_0x458e18[_0xc202('0x54')]['limit']);_0x564f29['offset']=qs[_0xc202('0x2c')](_0x458e18[_0xc202('0x54')]['offset']);}return _0x49e94d['getApplications'](_0x564f29);}})['then'](function(_0x1a523c){if(_0x1a523c){return _0x1a523c?{'count':_0x51d4ec,'rows':_0x1a523c}:null;}})['then'](respondWithResult(_0x241669,null))[_0xc202('0x6b')](handleError(_0x241669,null));};exports[_0xc202('0x128')]=function(_0x21aff8,_0x347fbb){return db[_0xc202('0x129')][_0xc202('0x6a')]({'where':{'id':_0x21aff8[_0xc202('0x76')]['id']}})['then'](handleEntityNotFound(_0x347fbb,null))[_0xc202('0x1d')](function(_0x5d23f7){if(_0x5d23f7){return _0x5d23f7[_0xc202('0x128')](_0x21aff8[_0xc202('0x70')][_0xc202('0x80')],_[_0xc202('0x104')](_0x21aff8[_0xc202('0x70')],[_0xc202('0x80'),'id'])||{});}})['then'](respondWithResult(_0x347fbb,null))[_0xc202('0x6b')](handleError(_0x347fbb,null));};exports[_0xc202('0x10d')]=function(_0x1cdf57,_0x1f3e6a){var _0xd9dd75={};var _0x17130d={};var _0x350b15;var _0x3d9c89;return db['ChatWebsite'][_0xc202('0x7d')]({'where':{'id':_0x1cdf57['params']['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x1f3e6a,null))['then'](function(_0x252772){if(_0x252772){_0x350b15=_0x252772;_0x17130d[_0xc202('0x48')]=_[_0xc202('0x55')](db[_0xc202('0x12a')][_0xc202('0x50')]);_0x17130d['query']=_[_0xc202('0x55')](_0x1cdf57[_0xc202('0x54')]);_0x17130d[_0xc202('0x56')]=_[_0xc202('0x57')](_0x17130d[_0xc202('0x48')],_0x17130d[_0xc202('0x54')]);_0xd9dd75[_0xc202('0x59')]=_['intersection'](_0x17130d['model'],qs['fields'](_0x1cdf57['query'][_0xc202('0x58')]));_0xd9dd75[_0xc202('0x59')]=_0xd9dd75[_0xc202('0x59')][_0xc202('0x69')]?_0xd9dd75[_0xc202('0x59')]:_0x17130d[_0xc202('0x48')];_0xd9dd75['order']=qs[_0xc202('0x5c')](_0x1cdf57[_0xc202('0x54')][_0xc202('0x5c')]);_0xd9dd75[_0xc202('0x5d')]=qs['filters'](_[_0xc202('0x5e')](_0x1cdf57[_0xc202('0x54')],_0x17130d['filters']));if(_0x1cdf57[_0xc202('0x54')]['filter']){_0xd9dd75[_0xc202('0x5d')]=_['merge'](_0xd9dd75['where'],{'$or':_[_0xc202('0x53')](_0xd9dd75['attributes'],function(_0x5b0e5b){var _0x26988d={};_0x26988d[_0x5b0e5b]={'$like':'%'+_0x1cdf57[_0xc202('0x54')][_0xc202('0x5f')]+'%'};return _0x26988d;})});}_0xd9dd75=_[_0xc202('0x61')]({},_0xd9dd75,_0x1cdf57[_0xc202('0x62')]);return _0x350b15['getProactiveActions'](_0xd9dd75);}})['then'](function(_0x31dc3c){if(_0x31dc3c){_0x3d9c89=_0x31dc3c[_0xc202('0x69')];if(!_0x1cdf57['query'][_0xc202('0x5a')]('nolimit')){_0xd9dd75[_0xc202('0x2b')]=qs['limit'](_0x1cdf57[_0xc202('0x54')][_0xc202('0x2b')]);_0xd9dd75['offset']=qs['offset'](_0x1cdf57[_0xc202('0x54')][_0xc202('0x2c')]);}return _0x350b15[_0xc202('0x10d')](_0xd9dd75);}})[_0xc202('0x1d')](function(_0x42b7b6){if(_0x42b7b6){return _0x42b7b6?{'count':_0x3d9c89,'rows':_0x42b7b6}:null;}})[_0xc202('0x1d')](respondWithResult(_0x1f3e6a,null))[_0xc202('0x6b')](handleError(_0x1f3e6a,null));};exports['getFields']=function(_0x3fd086,_0x422baf){var _0x4a7c78=_0x3fd086[_0xc202('0x54')][_0xc202('0x12b')]===_0xc202('0x12c')?'offlineForm':_0xc202('0x12d');return db[_0xc202('0x4f')][_0xc202('0x6a')]({'attributes':['id',_0x4a7c78],'where':{'id':_0x3fd086[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x422baf,null))['then'](function(_0x254d69){if(_0x254d69){var _0x599219=_0x254d69[_0x4a7c78];var _0x3b39a6=_0x599219&&_0x599219[_0xc202('0x12e')]?_0x599219[_0xc202('0x12e')]:[];_0x422baf['send']({'fromKey':_['isNil'](_0x599219[_0xc202('0x12f')])?undefined:_0x599219[_0xc202('0x12f')],'count':_0x3b39a6[_0xc202('0x69')],'rows':_0x3b39a6});}})['catch'](handleError(_0x422baf,null));};exports['getOfflineMessages']=function(_0x1d1b81,_0x5aa4b9){var _0x910f81={'raw':![],'where':{}};var _0x5e1225={};var _0x469bfe={'count':0x0,'rows':[]};return db[_0xc202('0x4f')][_0xc202('0x7d')]({'where':{'id':_0x1d1b81[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x5aa4b9,null))['then'](function(_0x562960){if(_0x562960){_0x5e1225[_0xc202('0x48')]=_['keys'](db[_0xc202('0x130')]['rawAttributes']);_0x5e1225['query']=_[_0xc202('0x55')](_0x1d1b81[_0xc202('0x54')]);_0x5e1225[_0xc202('0x56')]=_[_0xc202('0x57')](_0x5e1225['model'],_0x5e1225[_0xc202('0x54')]);_0x910f81[_0xc202('0x59')]=_[_0xc202('0x57')](_0x5e1225[_0xc202('0x48')],qs[_0xc202('0x58')](_0x1d1b81['query']['fields']));_0x910f81[_0xc202('0x59')]=_0x910f81[_0xc202('0x59')][_0xc202('0x69')]?_0x910f81[_0xc202('0x59')]:_0x5e1225[_0xc202('0x48')];if(!_0x1d1b81['query']['hasOwnProperty']('nolimit')){_0x910f81['limit']=qs[_0xc202('0x2b')](_0x1d1b81[_0xc202('0x54')][_0xc202('0x2b')]);_0x910f81[_0xc202('0x2c')]=qs['offset'](_0x1d1b81[_0xc202('0x54')][_0xc202('0x2c')]);}_0x910f81[_0xc202('0x5b')]=qs[_0xc202('0x5c')](_0x1d1b81['query'][_0xc202('0x5c')]);_0x910f81[_0xc202('0x5d')]=qs[_0xc202('0x56')](_[_0xc202('0x5e')](_0x1d1b81['query'],_0x5e1225['filters']));_0x910f81[_0xc202('0x5d')]['ChatWebsiteId']=_0x562960['id'];if(_0x1d1b81[_0xc202('0x54')][_0xc202('0x5f')]){_0x910f81[_0xc202('0x5d')]=_[_0xc202('0x61')](_0x910f81['where'],{'$or':_[_0xc202('0x53')](_0x910f81[_0xc202('0x59')],function(_0x29a9fc){var _0x28719a={};_0x28719a[_0x29a9fc]={'$like':'%'+_0x1d1b81[_0xc202('0x54')]['filter']+'%'};return _0x28719a;})});}_0x910f81=_[_0xc202('0x61')]({},_0x910f81,_0x1d1b81[_0xc202('0x62')]);return db[_0xc202('0x130')][_0xc202('0x63')]({'where':_0x910f81[_0xc202('0x5d')]})[_0xc202('0x1d')](function(_0x3a03e2){_0x469bfe[_0xc202('0x63')]=_0x3a03e2;if(_0x1d1b81[_0xc202('0x54')][_0xc202('0x64')]){_0x910f81[_0xc202('0x65')]=[{'all':!![]}];}else{_0x910f81[_0xc202('0x65')]=[{'model':db[_0xc202('0xa7')],'as':_0xc202('0x105'),'required':![]},{'model':db['Attachment'],'as':_0xc202('0x131'),'required':![]}];}return db['ChatOfflineMessage'][_0xc202('0x66')](_0x910f81);})[_0xc202('0x1d')](function(_0x11e865){_0x469bfe[_0xc202('0x67')]=_0x11e865;return _0x469bfe;});}})[_0xc202('0x1d')](respondWithFilteredResult(_0x5aa4b9,_0x910f81))[_0xc202('0x6b')](handleError(_0x5aa4b9,null));};exports[_0xc202('0x132')]=function(_0x54152a,_0x54f951){return db[_0xc202('0x4f')]['find']({'where':{'id':_0x54152a[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x54f951,null))['then'](function(_0x216405){if(_0x216405){return _0x216405[_0xc202('0x132')](_0x54152a[_0xc202('0x70')][_0xc202('0x80')],_['omit'](_0x54152a[_0xc202('0x70')],[_0xc202('0x80'),'id'])||{})['spread'](function(_0x55aea6){for(var _0x4ea2e1=0x0;_0x4ea2e1<_0x54152a[_0xc202('0x70')]['ids'][_0xc202('0x69')];_0x4ea2e1+=0x1){socket['emit'](_0xc202('0x133'),{'UserId':Number(_0x54152a[_0xc202('0x70')][_0xc202('0x80')][_0x4ea2e1]),'ChatWebsiteId':Number(_0x54152a[_0xc202('0x76')]['id'])});}return _0x55aea6;});}})['then'](respondWithResult(_0x54f951,null))['catch'](handleError(_0x54f951,null));};exports[_0xc202('0x134')]=function(_0x48c265,_0x2f0bfb){return db[_0xc202('0x4f')][_0xc202('0x6a')]({'where':{'id':_0x48c265[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x2f0bfb,null))['then'](function(_0xac55a1){if(_0xac55a1){return _0xac55a1[_0xc202('0x134')](_0x48c265[_0xc202('0x54')][_0xc202('0x80')])[_0xc202('0x1d')](function(){if(_[_0xc202('0x135')](_0x48c265[_0xc202('0x54')]['ids'])){for(var _0x511242=0x0;_0x511242<_0x48c265['query'][_0xc202('0x80')]['length'];_0x511242+=0x1){socket['emit'](_0xc202('0x136'),{'UserId':Number(_0x48c265[_0xc202('0x54')]['ids'][_0x511242]),'ChatWebsiteId':Number(_0x48c265[_0xc202('0x76')]['id'])});}}else{socket[_0xc202('0x137')](_0xc202('0x136'),{'UserId':Number(_0x48c265[_0xc202('0x54')]['ids']),'ChatWebsiteId':Number(_0x48c265[_0xc202('0x76')]['id'])});}});}})[_0xc202('0x1d')](respondWithStatusCode(_0x2f0bfb,null))[_0xc202('0x6b')](handleError(_0x2f0bfb,null));};exports[_0xc202('0x138')]=function(_0x764ea3,_0x43331c){var _0x43bb37={};var _0x41076d={};var _0x136a25;var _0x5dcf4b;return db[_0xc202('0x4f')]['findOne']({'where':{'id':_0x764ea3[_0xc202('0x76')]['id']}})[_0xc202('0x1d')](handleEntityNotFound(_0x43331c,null))[_0xc202('0x1d')](function(_0x525262){if(_0x525262){_0x136a25=_0x525262;_0x41076d['model']=_[_0xc202('0x55')](db[_0xc202('0xc9')]['rawAttributes']);_0x41076d[_0xc202('0x54')]=_[_0xc202('0x55')](_0x764ea3[_0xc202('0x54')]);_0x41076d['filters']=_[_0xc202('0x57')](_0x41076d[_0xc202('0x48')],_0x41076d[_0xc202('0x54')]);_0x43bb37[_0xc202('0x59')]=_[_0xc202('0x57')](_0x41076d[_0xc202('0x48')],qs['fields'](_0x764ea3[_0xc202('0x54')]['fields']));_0x43bb37[_0xc202('0x59')]=_0x43bb37[_0xc202('0x59')]['length']?_0x43bb37[_0xc202('0x59')]:_0x41076d[_0xc202('0x48')];_0x43bb37[_0xc202('0x5b')]=qs[_0xc202('0x5c')](_0x764ea3[_0xc202('0x54')][_0xc202('0x5c')]);_0x43bb37[_0xc202('0x5d')]=qs['filters'](_[_0xc202('0x5e')](_0x764ea3[_0xc202('0x54')],_0x41076d[_0xc202('0x56')]));if(_0x764ea3[_0xc202('0x54')][_0xc202('0x5f')]){_0x43bb37[_0xc202('0x5d')]=_['merge'](_0x43bb37[_0xc202('0x5d')],{'$or':_['map'](_0x43bb37[_0xc202('0x59')],function(_0x542a36){var _0x17de40={};_0x17de40[_0x542a36]={'$like':'%'+_0x764ea3[_0xc202('0x54')]['filter']+'%'};return _0x17de40;})});}_0x43bb37=_[_0xc202('0x61')]({},_0x43bb37,_0x764ea3[_0xc202('0x62')]);return _0x136a25['getAgents'](_0x43bb37);}})['then'](function(_0x4006ae){if(_0x4006ae){_0x5dcf4b=_0x4006ae[_0xc202('0x69')];if(!_0x764ea3[_0xc202('0x54')][_0xc202('0x5a')](_0xc202('0x7e'))){_0x43bb37[_0xc202('0x2b')]=qs[_0xc202('0x2b')](_0x764ea3[_0xc202('0x54')][_0xc202('0x2b')]);_0x43bb37[_0xc202('0x2c')]=qs[_0xc202('0x2c')](_0x764ea3[_0xc202('0x54')][_0xc202('0x2c')]);}return _0x136a25['getAgents'](_0x43bb37);}})[_0xc202('0x1d')](function(_0x5ebfd1){if(_0x5ebfd1){return _0x5ebfd1?{'count':_0x5dcf4b,'rows':_0x5ebfd1}:null;}})[_0xc202('0x1d')](respondWithResult(_0x43331c,null))[_0xc202('0x6b')](handleError(_0x43331c,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 92322ae..2297396 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 _0x99c9=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite'];(function(_0x3c569d,_0x13f97d){var _0x5f3326=function(_0xf005f3){while(--_0xf005f3){_0x3c569d['push'](_0x3c569d['shift']());}};_0x5f3326(++_0x13f97d);}(_0x99c9,0x13c));var _0x999c=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x99c9[_0x36ed48];return _0x51c63a;};'use strict';var EventEmitter=require(_0x999c('0x0'));var ChatWebsite=require(_0x999c('0x1'))['db'][_0x999c('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x999c('0x3')](0x0);var events={'afterCreate':_0x999c('0x4'),'afterUpdate':_0x999c('0x5'),'afterDestroy':_0x999c('0x6')};function emitEvent(_0x52dc75){return function(_0x2a4e06,_0x140cd5,_0x2d4f2d){ChatWebsiteEvents[_0x999c('0x7')](_0x52dc75+':'+_0x2a4e06['id'],_0x2a4e06);ChatWebsiteEvents[_0x999c('0x7')](_0x52dc75,_0x2a4e06);_0x2d4f2d(null);};}for(var e in events){if(events[_0x999c('0x8')](e)){var event=events[e];ChatWebsite[_0x999c('0x9')](e,emitEvent(event));}}module[_0x999c('0xa')]=ChatWebsiteEvents; \ No newline at end of file +var _0xb0b9=['emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update','remove'];(function(_0x4716ec,_0x34b4c9){var _0x6e31b0=function(_0x3dbf0a){while(--_0x3dbf0a){_0x4716ec['push'](_0x4716ec['shift']());}};_0x6e31b0(++_0x34b4c9);}(_0xb0b9,0x1f3));var _0x9b0b=function(_0x77d8b3,_0xbcb559){_0x77d8b3=_0x77d8b3-0x0;var _0x3306d4=_0xb0b9[_0x77d8b3];return _0x3306d4;};'use strict';var EventEmitter=require(_0x9b0b('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9b0b('0x1')](0x0);var events={'afterCreate':_0x9b0b('0x2'),'afterUpdate':_0x9b0b('0x3'),'afterDestroy':_0x9b0b('0x4')};function emitEvent(_0x1888ce){return function(_0xeb15c0,_0x311e29,_0x271b79){ChatWebsiteEvents[_0x9b0b('0x5')](_0x1888ce+':'+_0xeb15c0['id'],_0xeb15c0);ChatWebsiteEvents[_0x9b0b('0x5')](_0x1888ce,_0xeb15c0);_0x271b79(null);};}for(var e in events){if(events[_0x9b0b('0x6')](e)){var event=events[e];ChatWebsite[_0x9b0b('0x7')](e,emitEvent(event));}}module[_0x9b0b('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 32652b3..ae0f035 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 _0x993d=['../../config/environment','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x22c5df,_0x445b1a){var _0x193166=function(_0x43ef54){while(--_0x43ef54){_0x22c5df['push'](_0x22c5df['shift']());}};_0x193166(++_0x445b1a);}(_0x993d,0x7c));var _0xd993=function(_0x42203c,_0x448a8a){_0x42203c=_0x42203c-0x0;var _0x267a6d=_0x993d[_0x42203c];return _0x267a6d;};'use strict';var _=require(_0xd993('0x0'));var util=require(_0xd993('0x1'));var logger=require(_0xd993('0x2'))(_0xd993('0x3'));var moment=require(_0xd993('0x4'));var BPromise=require('bluebird');var rp=require(_0xd993('0x5'));var fs=require('fs');var path=require(_0xd993('0x6'));var rimraf=require(_0xd993('0x7'));var config=require(_0xd993('0x8'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0xa4c7da,_0x2bcf5a){return _0xa4c7da[_0xd993('0x9')](_0xd993('0xa'),attributes,{'tableName':_0xd993('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb2db=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','ChatWebsite','chat_websites','lodash','util'];(function(_0x208f5e,_0x466ecf){var _0x502ccc=function(_0x3a9071){while(--_0x3a9071){_0x208f5e['push'](_0x208f5e['shift']());}};_0x502ccc(++_0x466ecf);}(_0xb2db,0x15a));var _0xbb2d=function(_0x163cce,_0x688663){_0x163cce=_0x163cce-0x0;var _0x10bd6b=_0xb2db[_0x163cce];return _0x10bd6b;};'use strict';var _=require(_0xbb2d('0x0'));var util=require(_0xbb2d('0x1'));var logger=require('../../config/logger')(_0xbb2d('0x2'));var moment=require(_0xbb2d('0x3'));var BPromise=require(_0xbb2d('0x4'));var rp=require(_0xbb2d('0x5'));var fs=require('fs');var path=require(_0xbb2d('0x6'));var rimraf=require(_0xbb2d('0x7'));var config=require(_0xbb2d('0x8'));var attributes=require(_0xbb2d('0x9'));module['exports']=function(_0x1121a7,_0x554b0a){return _0x1121a7['define'](_0xbb2d('0xa'),attributes,{'tableName':_0xbb2d('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 58e5568..72234a2 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 _0xbe31=['stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x18a5b3,_0x4f4784){var _0x54b51c=function(_0x42773a){while(--_0x42773a){_0x18a5b3['push'](_0x18a5b3['shift']());}};_0x54b51c(++_0x4f4784);}(_0xbe31,0x103));var _0x1be3=function(_0x11e2f0,_0x150828){_0x11e2f0=_0x11e2f0-0x0;var _0x1d9680=_0xbe31[_0x11e2f0];return _0x1d9680;};'use strict';var _=require(_0x1be3('0x0'));var util=require(_0x1be3('0x1'));var moment=require(_0x1be3('0x2'));var BPromise=require(_0x1be3('0x3'));var rs=require(_0x1be3('0x4'));var fs=require('fs');var Redis=require(_0x1be3('0x5'));var db=require(_0x1be3('0x6'))['db'];var utils=require(_0x1be3('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x1be3('0x8'));var jayson=require(_0x1be3('0x9'));var client=jayson['client'][_0x1be3('0xa')]({'port':0x232a});config[_0x1be3('0xb')]=_[_0x1be3('0xc')](config[_0x1be3('0xb')],{'host':_0x1be3('0xd'),'port':0x18eb});var socket=require(_0x1be3('0xe'))(new Redis(config[_0x1be3('0xb')]));require('./chatWebsite.socket')[_0x1be3('0xf')](socket);function respondWithRpcPromise(_0x480651,_0x5362e4,_0x2ee1f0){return new BPromise(function(_0x4440bc,_0x370bce){return client[_0x1be3('0x10')](_0x480651,_0x2ee1f0)[_0x1be3('0x11')](function(_0x1f9c7b){logger['info'](_0x1be3('0x12'),_0x5362e4,'request\x20sent');logger['debug'](_0x1be3('0x13'),_0x5362e4,_0x1be3('0x14'),JSON[_0x1be3('0x15')](_0x1f9c7b));if(_0x1f9c7b['error']){if(_0x1f9c7b[_0x1be3('0x16')][_0x1be3('0x17')]===0x1f4){logger[_0x1be3('0x16')](_0x1be3('0x12'),_0x5362e4,_0x1f9c7b[_0x1be3('0x16')][_0x1be3('0x18')]);return _0x370bce(_0x1f9c7b[_0x1be3('0x16')]['message']);}logger[_0x1be3('0x16')](_0x1be3('0x12'),_0x5362e4,_0x1f9c7b[_0x1be3('0x16')][_0x1be3('0x18')]);return _0x4440bc(_0x1f9c7b[_0x1be3('0x16')]['message']);}else{logger[_0x1be3('0x19')](_0x1be3('0x12'),_0x5362e4,_0x1be3('0x14'));_0x4440bc(_0x1f9c7b[_0x1be3('0x1a')][_0x1be3('0x18')]);}})[_0x1be3('0x1b')](function(_0x466ab5){logger[_0x1be3('0x16')](_0x1be3('0x12'),_0x5362e4,_0x466ab5);_0x370bce(_0x466ab5);});});} \ No newline at end of file +var _0xabb0=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','request\x20sent','debug','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','util','moment'];(function(_0x36ac5e,_0x5a8b5d){var _0x4fadf2=function(_0x3bcb4e){while(--_0x3bcb4e){_0x36ac5e['push'](_0x36ac5e['shift']());}};_0x4fadf2(++_0x5a8b5d);}(_0xabb0,0x116));var _0x0abb=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xabb0[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x0abb('0x0'));var moment=require(_0x0abb('0x1'));var BPromise=require(_0x0abb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0abb('0x3'));var db=require(_0x0abb('0x4'))['db'];var utils=require(_0x0abb('0x5'));var logger=require(_0x0abb('0x6'))(_0x0abb('0x7'));var config=require(_0x0abb('0x8'));var jayson=require(_0x0abb('0x9'));var client=jayson[_0x0abb('0xa')][_0x0abb('0xb')]({'port':0x232a});config[_0x0abb('0xc')]=_[_0x0abb('0xd')](config[_0x0abb('0xc')],{'host':_0x0abb('0xe'),'port':0x18eb});var socket=require(_0x0abb('0xf'))(new Redis(config['redis']));require(_0x0abb('0x10'))['register'](socket);function respondWithRpcPromise(_0x2d9923,_0x138e05,_0x4946f7){return new BPromise(function(_0x47f595,_0x26b003){return client[_0x0abb('0x11')](_0x2d9923,_0x4946f7)[_0x0abb('0x12')](function(_0x5d800f){logger[_0x0abb('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x138e05,_0x0abb('0x14'));logger[_0x0abb('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x138e05,_0x0abb('0x14'),JSON[_0x0abb('0x16')](_0x5d800f));if(_0x5d800f[_0x0abb('0x17')]){if(_0x5d800f[_0x0abb('0x17')][_0x0abb('0x18')]===0x1f4){logger[_0x0abb('0x17')](_0x0abb('0x19'),_0x138e05,_0x5d800f['error'][_0x0abb('0x1a')]);return _0x26b003(_0x5d800f[_0x0abb('0x17')]['message']);}logger['error'](_0x0abb('0x19'),_0x138e05,_0x5d800f[_0x0abb('0x17')][_0x0abb('0x1a')]);return _0x47f595(_0x5d800f[_0x0abb('0x17')][_0x0abb('0x1a')]);}else{logger[_0x0abb('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x138e05,'request\x20sent');_0x47f595(_0x5d800f[_0x0abb('0x1b')][_0x0abb('0x1a')]);}})['catch'](function(_0x5d1460){logger[_0x0abb('0x17')](_0x0abb('0x19'),_0x138e05,_0x5d1460);_0x26b003(_0x5d1460);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index e6bfc05..2c6599b 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 _0x21ef=['remove','update','removeListener','register','length','chatWebsite:'];(function(_0x40e074,_0x391ad8){var _0x33014d=function(_0x3e1983){while(--_0x3e1983){_0x40e074['push'](_0x40e074['shift']());}};_0x33014d(++_0x391ad8);}(_0x21ef,0x108));var _0xf21e=function(_0x48d0d2,_0xa6a3ee){_0x48d0d2=_0x48d0d2-0x0;var _0x176c2b=_0x21ef[_0x48d0d2];return _0x176c2b;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save',_0xf21e('0x0'),_0xf21e('0x1')];function createListener(_0x2032b8,_0x208231){return function(_0x2aa165){_0x208231['emit'](_0x2032b8,_0x2aa165);};}function removeListener(_0x352bd7,_0x7c82ef){return function(){ChatWebsiteEvents[_0xf21e('0x2')](_0x352bd7,_0x7c82ef);};}exports[_0xf21e('0x3')]=function(_0x2ff04a){for(var _0x2b4fdc=0x0,_0x4384fe=events[_0xf21e('0x4')];_0x2b4fdc<_0x4384fe;_0x2b4fdc++){var _0x294e38=events[_0x2b4fdc];var _0x2dc2f2=createListener(_0xf21e('0x5')+_0x294e38,_0x2ff04a);ChatWebsiteEvents['on'](_0x294e38,_0x2dc2f2);}}; \ No newline at end of file +var _0x3ddd=['removeListener','register','chatWebsite:','save','update','emit'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x3ddd,0x1bf));var _0xd3dd=function(_0xa5e8d7,_0x2baefd){_0xa5e8d7=_0xa5e8d7-0x0;var _0x4e6b0c=_0x3ddd[_0xa5e8d7];return _0x4e6b0c;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0xd3dd('0x0'),'remove',_0xd3dd('0x1')];function createListener(_0x126f9a,_0x2bc8bf){return function(_0x1789aa){_0x2bc8bf[_0xd3dd('0x2')](_0x126f9a,_0x1789aa);};}function removeListener(_0x587612,_0xe4fabd){return function(){ChatWebsiteEvents[_0xd3dd('0x3')](_0x587612,_0xe4fabd);};}exports[_0xd3dd('0x4')]=function(_0x72f2a3){for(var _0x1e71b1=0x0,_0x57d15a=events['length'];_0x1e71b1<_0x57d15a;_0x1e71b1++){var _0x4c3aba=events[_0x1e71b1];var _0x195649=createListener(_0xd3dd('0x5')+_0x4c3aba,_0x72f2a3);ChatWebsiteEvents['on'](_0x4c3aba,_0x195649);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js index 96e14de..d7bb8ae 100644 --- a/server/api/chatWebsite/helpers/wildcard-expressions.js +++ b/server/api/chatWebsite/helpers/wildcard-expressions.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd991=['URL','replace','localhost','test','trim','([\x5cw]+)','exports','../../../utils/misc','escapeRegExp','url'];(function(_0x24a8f1,_0xafbff1){var _0x1bb3b2=function(_0x4d65c1){while(--_0x4d65c1){_0x24a8f1['push'](_0x24a8f1['shift']());}};_0x1bb3b2(++_0xafbff1);}(_0xd991,0x115));var _0x1d99=function(_0x45f2d6,_0x5df5ec){_0x45f2d6=_0x45f2d6-0x0;var _0x341361=_0xd991[_0x45f2d6];return _0x341361;};var escapeRegExp=require(_0x1d99('0x0'))[_0x1d99('0x1')];var URL=require(_0x1d99('0x2'))[_0x1d99('0x3')];function testWildcardValidity(_0x163bfb){var _0x5e7e82=!![];try{new URL(_0x163bfb[_0x1d99('0x4')]('*',_0x1d99('0x5')));}catch(_0xf03459){_0x5e7e82=![];}return _0x5e7e82&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x1d99('0x6')](_0x163bfb);}function testWebsiteWithWildcard(_0x300c32,_0x1474ff){var _0x5f3a37;var _0x1adbca=escapeRegExp(_0x300c32[_0x1d99('0x7')]()['replace'](/\/$/,''))[_0x1d99('0x4')]('\x5c*',_0x1d99('0x8'));try{new URL(_0x300c32[_0x1d99('0x4')]('\x5c*',_0x1d99('0x5')));_0x5f3a37=new RegExp(_0x1adbca)[_0x1d99('0x6')](_0x1474ff);}catch(_0x3d55b1){_0x5f3a37=![];}return _0x5f3a37;}module[_0x1d99('0x9')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity}; \ No newline at end of file +var _0xd6f9=['test','exports','../../../utils/misc','escapeRegExp','replace','localhost'];(function(_0x57928b,_0x29a111){var _0x49aad6=function(_0x34a268){while(--_0x34a268){_0x57928b['push'](_0x57928b['shift']());}};_0x49aad6(++_0x29a111);}(_0xd6f9,0x1ca));var _0x9d6f=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xd6f9[_0x513aa5];return _0x1a1a7c;};var escapeRegExp=require(_0x9d6f('0x0'))[_0x9d6f('0x1')];var URL=require('url')['URL'];function testWildcardValidity(_0x2ddc4a){var _0x2eb1a8=!![];try{new URL(_0x2ddc4a[_0x9d6f('0x2')]('*',_0x9d6f('0x3')));}catch(_0x5d8c7f){_0x2eb1a8=![];}return _0x2eb1a8&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0x9d6f('0x4')](_0x2ddc4a);}function testWebsiteWithWildcard(_0x39810d,_0x3ffd28){var _0x5ec60d;var _0x12d741=escapeRegExp(_0x39810d['trim']()['replace'](/\/$/,''))[_0x9d6f('0x2')]('\x5c*','([\x5cw]+)');try{new URL(_0x39810d[_0x9d6f('0x2')]('\x5c*',_0x9d6f('0x3')));_0x5ec60d=new RegExp(_0x12d741)[_0x9d6f('0x4')](_0x3ffd28);}catch(_0x5f7600){_0x5ec60d=![];}return _0x5ec60d;}module[_0x9d6f('0x5')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 5c61717..7b9d38e 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 _0x3c00=['attachments','offline-chat','ensureDir','extname','replace','/:id/offline','any','/:id/interactions','addInteraction','/:id/applications','addApplications','addProactiveActions','addAgents','/:id','update','delete','destroy','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','addDisposition','diskStorage','join','server/files/images/logos/','format','%s-%s','file','addLogo','server/files/images/avatars/','originalname','/:id/avatar','single','addAvatar','now','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files'];(function(_0x483463,_0x3e8519){var _0x740611=function(_0x5b6971){while(--_0x5b6971){_0x483463['push'](_0x483463['shift']());}};_0x740611(++_0x3e8519);}(_0x3c00,0x18b));var _0x03c0=function(_0x3d4677,_0x1e3dd8){_0x3d4677=_0x3d4677-0x0;var _0x2ea5a5=_0x3c00[_0x3d4677];return _0x2ea5a5;};'use strict';var multer=require('multer');var util=require(_0x03c0('0x0'));var path=require(_0x03c0('0x1'));var timeout=require(_0x03c0('0x2'));var express=require(_0x03c0('0x3'));var router=express[_0x03c0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x03c0('0x5'));var interaction=require(_0x03c0('0x6'));var config=require(_0x03c0('0x7'));var controller=require(_0x03c0('0x8'));router['get']('/',auth[_0x03c0('0x9')](),controller[_0x03c0('0xa')]);router[_0x03c0('0xb')](_0x03c0('0xc'),auth['isAuthenticated'](),controller[_0x03c0('0xd')]);router[_0x03c0('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x03c0('0xe')]);router['get'](_0x03c0('0xf'),auth[_0x03c0('0x9')](),controller[_0x03c0('0x10')]);router[_0x03c0('0xb')](_0x03c0('0x11'),auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x03c0('0x12'),controller[_0x03c0('0x13')]);router['get']('/:id/avatar',controller['getAvatar']);router[_0x03c0('0xb')](_0x03c0('0x14'),controller[_0x03c0('0x15')]);router[_0x03c0('0xb')](_0x03c0('0x16'),controller[_0x03c0('0x17')]);router[_0x03c0('0xb')]('/:id/interactions',auth[_0x03c0('0x9')](),controller[_0x03c0('0x18')]);router[_0x03c0('0xb')](_0x03c0('0x19'),controller[_0x03c0('0x1a')]);router[_0x03c0('0xb')]('/:id/applications',auth[_0x03c0('0x9')](),controller['getApplications']);router[_0x03c0('0xb')](_0x03c0('0x1b'),auth[_0x03c0('0x9')](),controller[_0x03c0('0x1c')]);router[_0x03c0('0xb')](_0x03c0('0x1d'),controller[_0x03c0('0x1e')]);router['get'](_0x03c0('0x1f'),auth[_0x03c0('0x9')](),controller[_0x03c0('0x20')]);router[_0x03c0('0xb')](_0x03c0('0x21'),auth['isAuthenticated'](),controller['getAgents']);router[_0x03c0('0x22')]('/',auth[_0x03c0('0x9')](),controller[_0x03c0('0x23')]);router['post'](_0x03c0('0xf'),auth[_0x03c0('0x9')](),controller[_0x03c0('0x24')]);router[_0x03c0('0x22')]('/:id/canned_answers',auth['isAuthenticated'](),controller['addAnswer']);var upload=multer({'storage':multer[_0x03c0('0x25')]({'destination':function(_0x5eec2c,_0x4617ee,_0x52be23){_0x52be23(null,path[_0x03c0('0x26')](config['root'],_0x03c0('0x27')));},'filename':function(_0xd3b7f,_0x13d55e,_0x374f61){_0x374f61(null,util[_0x03c0('0x28')](_0x03c0('0x29'),Date['now'](),_0x13d55e['originalname']));}})});router['post'](_0x03c0('0x12'),upload['single'](_0x03c0('0x2a')),controller[_0x03c0('0x2b')]);var upload=multer({'storage':multer[_0x03c0('0x25')]({'destination':function(_0x1adf32,_0x1e7c25,_0x3db049){_0x3db049(null,path[_0x03c0('0x26')](config['root'],_0x03c0('0x2c')));},'filename':function(_0x438c09,_0x37a6c4,_0x5cb558){_0x5cb558(null,util[_0x03c0('0x28')](_0x03c0('0x29'),Date['now'](),_0x37a6c4[_0x03c0('0x2d')]));}})});router[_0x03c0('0x22')](_0x03c0('0x2e'),upload[_0x03c0('0x2f')](_0x03c0('0x2a')),controller[_0x03c0('0x30')]);var upload=multer({'storage':multer[_0x03c0('0x25')]({'destination':function(_0x439200,_0x12f400,_0x1a288a){_0x1a288a(null,path[_0x03c0('0x26')](config['root'],_0x03c0('0x2c')));},'filename':function(_0x21eda3,_0x56ddb7,_0x16c2fc){_0x16c2fc(null,util[_0x03c0('0x28')]('%s-%s',Date[_0x03c0('0x31')](),_0x56ddb7['originalname']));}})});router[_0x03c0('0x22')](_0x03c0('0x14'),upload[_0x03c0('0x2f')](_0x03c0('0x2a')),controller[_0x03c0('0x32')]);var upload=multer({'storage':multer[_0x03c0('0x25')]({'destination':function(_0x1ad494,_0x25ebf7,_0x207423){_0x207423(null,path['join'](config['root'],_0x03c0('0x2c')));},'filename':function(_0x484e4b,_0x489dd8,_0x54db79){_0x54db79(null,util[_0x03c0('0x28')](_0x03c0('0x29'),Date['now'](),_0x489dd8[_0x03c0('0x2d')]));}})});router['post'](_0x03c0('0x16'),upload[_0x03c0('0x2f')](_0x03c0('0x2a')),controller[_0x03c0('0x33')]);router[_0x03c0('0x22')](_0x03c0('0x34'),controller[_0x03c0('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0x03c0('0x25')]({'destination':function(_0x396b7f,_0x5dfef4,_0x4630c1){const _0x470486=path[_0x03c0('0x26')](config['root'],_0x03c0('0x36'),_0x03c0('0x37'),_0x03c0('0x38'));fs_extra[_0x03c0('0x39')](_0x470486,function(){_0x4630c1(null,_0x470486);});},'filename':function(_0x43ef9b,_0xc63acd,_0x578f30){const _0x4a8131=_0xc63acd[_0x03c0('0x2d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x19cb5e=path[_0x03c0('0x3a')](_0x4a8131);const _0x14a213=Date[_0x03c0('0x31')]()+'-'+_0x4a8131[_0x03c0('0x3b')](_0x19cb5e,'')+_0x19cb5e;_0x578f30(null,_0x14a213);}})});router[_0x03c0('0x22')](_0x03c0('0x3c'),offlineUploadMulter[_0x03c0('0x3d')](),controller['offline']);router[_0x03c0('0x22')](_0x03c0('0x3e'),auth[_0x03c0('0x9')](),controller[_0x03c0('0x3f')]);router[_0x03c0('0x22')](_0x03c0('0x40'),auth[_0x03c0('0x9')](),controller[_0x03c0('0x41')]);router[_0x03c0('0x22')]('/:id/proactive_actions',auth[_0x03c0('0x9')](),controller[_0x03c0('0x42')]);router[_0x03c0('0x22')](_0x03c0('0x21'),auth['isAuthenticated'](),controller[_0x03c0('0x43')]);router['put'](_0x03c0('0x44'),auth[_0x03c0('0x9')](),controller[_0x03c0('0x45')]);router[_0x03c0('0x46')]('/:id',auth[_0x03c0('0x9')](),controller[_0x03c0('0x47')]);router['delete'](_0x03c0('0xf'),auth[_0x03c0('0x9')](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x03c0('0x48')]);router['delete'](_0x03c0('0x21'),auth[_0x03c0('0x9')](),controller[_0x03c0('0x49')]);module[_0x03c0('0x4a')]=router; \ No newline at end of file +var _0xb7d6=['get','/describe','isAuthenticated','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','/:id/applications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','root','format','now','file','addLogo','join','server/files/images/avatars/','%s-%s','originalname','/:id/avatar','single','addAvatar','addCustomerAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','/:id','update','delete','removeDispositions','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatWebsite.controller','index'];(function(_0x575057,_0x14baf3){var _0x49dbc8=function(_0x23599a){while(--_0x23599a){_0x575057['push'](_0x575057['shift']());}};_0x49dbc8(++_0x14baf3);}(_0xb7d6,0x8a));var _0x6b7d=function(_0x4d3d33,_0x450541){_0x4d3d33=_0x4d3d33-0x0;var _0x386f63=_0xb7d6[_0x4d3d33];return _0x386f63;};'use strict';var multer=require('multer');var util=require(_0x6b7d('0x0'));var path=require(_0x6b7d('0x1'));var timeout=require(_0x6b7d('0x2'));var express=require(_0x6b7d('0x3'));var router=express[_0x6b7d('0x4')]();var fs_extra=require(_0x6b7d('0x5'));var auth=require(_0x6b7d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6b7d('0x7'));var controller=require(_0x6b7d('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x6b7d('0x9')]);router[_0x6b7d('0xa')](_0x6b7d('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x6b7d('0xa')]('/:id',auth[_0x6b7d('0xc')](),controller[_0x6b7d('0xd')]);router[_0x6b7d('0xa')](_0x6b7d('0xe'),auth[_0x6b7d('0xc')](),controller['getDispositions']);router[_0x6b7d('0xa')](_0x6b7d('0xf'),auth[_0x6b7d('0xc')](),controller[_0x6b7d('0x10')]);router['get'](_0x6b7d('0x11'),controller[_0x6b7d('0x12')]);router['get']('/:id/avatar',controller[_0x6b7d('0x13')]);router[_0x6b7d('0xa')](_0x6b7d('0x14'),controller['getCustomerAvatar']);router[_0x6b7d('0xa')](_0x6b7d('0x15'),controller[_0x6b7d('0x16')]);router[_0x6b7d('0xa')](_0x6b7d('0x17'),auth[_0x6b7d('0xc')](),controller['getInteractions']);router[_0x6b7d('0xa')](_0x6b7d('0x18'),controller['getSnippet']);router[_0x6b7d('0xa')](_0x6b7d('0x19'),auth[_0x6b7d('0xc')](),controller['getApplications']);router[_0x6b7d('0xa')](_0x6b7d('0x1a'),auth['isAuthenticated'](),controller['getProactiveActions']);router['get'](_0x6b7d('0x1b'),controller[_0x6b7d('0x1c')]);router['get'](_0x6b7d('0x1d'),auth[_0x6b7d('0xc')](),controller[_0x6b7d('0x1e')]);router[_0x6b7d('0xa')](_0x6b7d('0x1f'),auth[_0x6b7d('0xc')](),controller[_0x6b7d('0x20')]);router[_0x6b7d('0x21')]('/',auth[_0x6b7d('0xc')](),controller[_0x6b7d('0x22')]);router[_0x6b7d('0x21')](_0x6b7d('0xe'),auth[_0x6b7d('0xc')](),controller[_0x6b7d('0x23')]);router[_0x6b7d('0x21')](_0x6b7d('0xf'),auth[_0x6b7d('0xc')](),controller[_0x6b7d('0x24')]);var upload=multer({'storage':multer[_0x6b7d('0x25')]({'destination':function(_0x59fac2,_0x15c1d1,_0x239ca8){_0x239ca8(null,path['join'](config[_0x6b7d('0x26')],'server/files/images/logos/'));},'filename':function(_0x4a4d0b,_0xbe47e9,_0x31001d){_0x31001d(null,util[_0x6b7d('0x27')]('%s-%s',Date[_0x6b7d('0x28')](),_0xbe47e9['originalname']));}})});router[_0x6b7d('0x21')]('/:id/logo',upload['single'](_0x6b7d('0x29')),controller[_0x6b7d('0x2a')]);var upload=multer({'storage':multer[_0x6b7d('0x25')]({'destination':function(_0x20db57,_0x3850d6,_0x1e613d){_0x1e613d(null,path[_0x6b7d('0x2b')](config[_0x6b7d('0x26')],_0x6b7d('0x2c')));},'filename':function(_0x141566,_0x5a997f,_0x5a3002){_0x5a3002(null,util[_0x6b7d('0x27')](_0x6b7d('0x2d'),Date[_0x6b7d('0x28')](),_0x5a997f[_0x6b7d('0x2e')]));}})});router[_0x6b7d('0x21')](_0x6b7d('0x2f'),upload[_0x6b7d('0x30')](_0x6b7d('0x29')),controller[_0x6b7d('0x31')]);var upload=multer({'storage':multer[_0x6b7d('0x25')]({'destination':function(_0x577f62,_0x273417,_0x2964df){_0x2964df(null,path[_0x6b7d('0x2b')](config[_0x6b7d('0x26')],'server/files/images/avatars/'));},'filename':function(_0xceb7fa,_0xace21e,_0x167756){_0x167756(null,util[_0x6b7d('0x27')](_0x6b7d('0x2d'),Date[_0x6b7d('0x28')](),_0xace21e[_0x6b7d('0x2e')]));}})});router[_0x6b7d('0x21')](_0x6b7d('0x14'),upload['single'](_0x6b7d('0x29')),controller[_0x6b7d('0x32')]);var upload=multer({'storage':multer[_0x6b7d('0x25')]({'destination':function(_0x38f6e3,_0x36f025,_0x145be3){_0x145be3(null,path[_0x6b7d('0x2b')](config[_0x6b7d('0x26')],'server/files/images/avatars/'));},'filename':function(_0x1f2119,_0x36c475,_0x586ad4){_0x586ad4(null,util['format'](_0x6b7d('0x2d'),Date[_0x6b7d('0x28')](),_0x36c475[_0x6b7d('0x2e')]));}})});router[_0x6b7d('0x21')](_0x6b7d('0x15'),upload[_0x6b7d('0x30')](_0x6b7d('0x29')),controller['addSystemAvatar']);router[_0x6b7d('0x21')](_0x6b7d('0x33'),controller[_0x6b7d('0x34')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x945392,_0x4acea9,_0x1a3166){const _0x1731b7=path[_0x6b7d('0x2b')](config['root'],_0x6b7d('0x35'),_0x6b7d('0x36'),_0x6b7d('0x37'));fs_extra[_0x6b7d('0x38')](_0x1731b7,function(){_0x1a3166(null,_0x1731b7);});},'filename':function(_0x1005da,_0x5d8c55,_0xe1f7b8){const _0x477cf2=_0x5d8c55[_0x6b7d('0x2e')][_0x6b7d('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x354b6e=path[_0x6b7d('0x3a')](_0x477cf2);const _0x576464=Date[_0x6b7d('0x28')]()+'-'+_0x477cf2[_0x6b7d('0x39')](_0x354b6e,'')+_0x354b6e;_0xe1f7b8(null,_0x576464);}})});router[_0x6b7d('0x21')](_0x6b7d('0x3b'),offlineUploadMulter[_0x6b7d('0x3c')](),controller[_0x6b7d('0x3d')]);router['post']('/:id/interactions',auth[_0x6b7d('0xc')](),controller[_0x6b7d('0x3e')]);router[_0x6b7d('0x21')](_0x6b7d('0x19'),auth['isAuthenticated'](),controller[_0x6b7d('0x3f')]);router[_0x6b7d('0x21')](_0x6b7d('0x1a'),auth[_0x6b7d('0xc')](),controller[_0x6b7d('0x40')]);router['post'](_0x6b7d('0x1f'),auth[_0x6b7d('0xc')](),controller[_0x6b7d('0x41')]);router[_0x6b7d('0x42')](_0x6b7d('0x43'),auth[_0x6b7d('0xc')](),controller[_0x6b7d('0x44')]);router['delete']('/:id',auth[_0x6b7d('0xc')](),controller['destroy']);router[_0x6b7d('0x45')](_0x6b7d('0xe'),auth[_0x6b7d('0xc')](),controller[_0x6b7d('0x46')]);router[_0x6b7d('0x45')](_0x6b7d('0xf'),auth[_0x6b7d('0xc')](),controller[_0x6b7d('0x47')]);router['delete']('/:id/users',auth[_0x6b7d('0xc')](),controller[_0x6b7d('0x48')]);module[_0x6b7d('0x49')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 71bdc61..9685c37 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7035=['app','get','client-side-logger','use','isAuthenticated','exports','beaver-logger/server','Router','production'];(function(_0x3e817f,_0x3d51df){var _0x2e90b3=function(_0x17c237){while(--_0x17c237){_0x3e817f['push'](_0x3e817f['shift']());}};_0x2e90b3(++_0x3d51df);}(_0x7035,0x69));var _0x5703=function(_0x2b25be,_0x599e51){_0x2b25be=_0x2b25be-0x0;var _0x37bbd4=_0x7035[_0x2b25be];return _0x37bbd4;};var beaverLogger=require(_0x5703('0x0'));var express=require('express');var auth=require('../components/auth/service');var config=require('../config/environment');var router=express[_0x5703('0x1')]();var isProduction=config['env']===_0x5703('0x2')||![];function clientSideLogs(_0x14b444,_0x55d7e6,_0x63ad31){var _0x24ccf7=_0x14b444[_0x5703('0x3')][_0x5703('0x4')](_0x5703('0x5'));if(!_0x24ccf7){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger['expressEndpoint']({'uri':'/client-logs','logger':_0x24ccf7,'enableCors':!isProduction})(_0x14b444,_0x55d7e6,_0x63ad31);}router[_0x5703('0x6')](auth[_0x5703('0x7')](),clientSideLogs);module[_0x5703('0x8')]=router; \ No newline at end of file +var _0x1653=['use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','Router','production','app','client-side-logger','expressEndpoint','/client-logs'];(function(_0x38e0c4,_0xe994c3){var _0x536e88=function(_0x150aee){while(--_0x150aee){_0x38e0c4['push'](_0x38e0c4['shift']());}};_0x536e88(++_0xe994c3);}(_0x1653,0x1cb));var _0x3165=function(_0x2e58c7,_0x23d092){_0x2e58c7=_0x2e58c7-0x0;var _0x26eb00=_0x1653[_0x2e58c7];return _0x26eb00;};var beaverLogger=require(_0x3165('0x0'));var express=require(_0x3165('0x1'));var auth=require(_0x3165('0x2'));var config=require('../config/environment');var router=express[_0x3165('0x3')]();var isProduction=config['env']===_0x3165('0x4')||![];function clientSideLogs(_0x5ba265,_0x1b4cc1,_0x21fba7){var _0x109cbe=_0x5ba265[_0x3165('0x5')]['get'](_0x3165('0x6'));if(!_0x109cbe){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x3165('0x7')]({'uri':_0x3165('0x8'),'logger':_0x109cbe,'enableCors':!isProduction})(_0x5ba265,_0x1b4cc1,_0x21fba7);}router[_0x3165('0x9')](auth[_0x3165('0xa')](),clientSideLogs);module[_0x3165('0xb')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 98fcfc8..eb6febd 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 _0xde4d=['ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','STRING','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports'];(function(_0x5b1c5c,_0x2f4f0a){var _0x26fba2=function(_0x4ffa7c){while(--_0x4ffa7c){_0x5b1c5c['push'](_0x5b1c5c['shift']());}};_0x26fba2(++_0x2f4f0a);}(_0xde4d,0x10f));var _0xdde4=function(_0xc47cc3,_0xace73c){_0xc47cc3=_0xc47cc3-0x0;var _0x55953b=_0xde4d[_0xc47cc3];return _0x55953b;};'use strict';var Sequelize=require(_0xdde4('0x0'));module[_0xdde4('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xdde4('0x2')](_0xdde4('0x3'),_0xdde4('0x4'),_0xdde4('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xdde4('0x2')](_0xdde4('0x6'),'Dynamics365')},'data1':{'type':Sequelize['STRING'],'comment':_0xdde4('0x7')},'data2':{'type':Sequelize[_0xdde4('0x8')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0xdde4('0x8')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0xdde4('0x8')],'comment':_0xdde4('0x9')},'data5':{'type':Sequelize[_0xdde4('0xa')],'comment':_0xdde4('0xb')},'data6':{'type':Sequelize[_0xdde4('0xa')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0xdde4('0xa')],'comment':_0xdde4('0xc')}}; \ No newline at end of file +var _0xbd61=['MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id'];(function(_0x54c080,_0x38a0c8){var _0x504070=function(_0x237922){while(--_0x237922){_0x54c080['push'](_0x54c080['shift']());}};_0x504070(++_0x38a0c8);}(_0xbd61,0xfc));var _0x1bd6=function(_0x34b1e4,_0x55c6f6){_0x34b1e4=_0x34b1e4-0x0;var _0x20da42=_0xbd61[_0x34b1e4];return _0x20da42;};'use strict';var Sequelize=require(_0x1bd6('0x0'));module[_0x1bd6('0x1')]={'name':{'type':Sequelize[_0x1bd6('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM']('AmazonAWS',_0x1bd6('0x3'),_0x1bd6('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x1bd6('0x5'),_0x1bd6('0x6'))},'data1':{'type':Sequelize[_0x1bd6('0x2')],'comment':_0x1bd6('0x7')},'data2':{'type':Sequelize[_0x1bd6('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x1bd6('0x2')],'comment':_0x1bd6('0x8')},'data4':{'type':Sequelize[_0x1bd6('0x2')],'comment':_0x1bd6('0x9')},'data5':{'type':Sequelize[_0x1bd6('0xa')],'comment':_0x1bd6('0xb')},'data6':{'type':Sequelize[_0x1bd6('0xa')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x1bd6('0xa')],'comment':_0x1bd6('0xc')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index edebe1e..a900d92 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 _0x046f=['Invalid\x20state\x20parameter','parse','from','state','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','access_token','data6','refresh_token','data5','startRefreshInterval','microsoftAuthorization:error','error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','defaults','status','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','sendStatus','stack','name','send','padEnd','slice','index','CloudProvider','fieldName','key','model','map','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','rows','service','data3','catch','show','keys','rawAttributes','length','find','MicrosoftAzure','Name\x20parameter\x20not\x20specified','body','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','create','params','findOne','generateMicrosoftAuthorizationUrl','user','get'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x046f,0x79));var _0xf046=function(_0xd2dc21,_0x4740b1){_0xd2dc21=_0xd2dc21-0x0;var _0x5ea404=_0x046f[_0xd2dc21];return _0x5ea404;};'use strict';var _=require(_0xf046('0x0'));var Redis=require(_0xf046('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xf046('0x2'));var config=require(_0xf046('0x3'));var logger=require(_0xf046('0x4'))(_0xf046('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0xf046('0x6'));config[_0xf046('0x7')]=_[_0xf046('0x8')](config[_0xf046('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf046('0x7')]));var redis=new Redis(config[_0xf046('0x7')]);function respondWithStatusCode(_0x1b6a6b,_0x2d5b21){_0x2d5b21=_0x2d5b21||0xcc;return function(_0x5d45dd){if(_0x5d45dd){return _0x1b6a6b['sendStatus'](_0x2d5b21);}return _0x1b6a6b[_0xf046('0x9')](_0x2d5b21)['end']();};}function respondWithResult(_0x258398,_0x1e995a){_0x1e995a=_0x1e995a||0xc8;return function(_0x185ed1){if(_0x185ed1){return _0x258398[_0xf046('0x9')](_0x1e995a)['json'](_0x185ed1);}};}function respondWithFilteredResult(_0x26842a,_0x776307){return function(_0x460276){if(_0x460276){var _0x17cbe6=typeof _0x776307[_0xf046('0xa')]===_0xf046('0xb')&&typeof _0x776307[_0xf046('0xc')]==='undefined';var _0x47ccd0=_0x460276[_0xf046('0xd')];var _0x3ccc00=_0x17cbe6?0x0:_0x776307[_0xf046('0xa')];var _0x3330fa=_0x17cbe6?_0x460276[_0xf046('0xd')]:_0x776307['offset']+_0x776307['limit'];var _0xae3ed6;if(_0x3330fa>=_0x47ccd0){_0x3330fa=_0x47ccd0;_0xae3ed6=0xc8;}else{_0xae3ed6=0xce;}_0x26842a[_0xf046('0x9')](_0xae3ed6);return _0x26842a[_0xf046('0xe')](_0xf046('0xf'),_0x3ccc00+'-'+_0x3330fa+'/'+_0x47ccd0)[_0xf046('0x10')](_0x460276);}return null;};}function saveUpdates(_0x52ea2f){return function(_0x3281c3){if(_0x3281c3){return _0x3281c3[_0xf046('0x11')](_0x52ea2f)[_0xf046('0x12')](function(_0x5c44b8){return _0x5c44b8;});}return null;};}function removeEntity(_0x117319){return function(_0x4885b6){if(_0x4885b6){return _0x4885b6[_0xf046('0x13')]()[_0xf046('0x12')](function(){_0x117319['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16aef7){return function(_0x27a938){if(!_0x27a938){_0x16aef7[_0xf046('0x14')](0x194);}return _0x27a938;};}function handleError(_0x291243,_0x1ee9d5){_0x1ee9d5=_0x1ee9d5||0x1f4;return function(_0x4a68bd){logger['error'](_0x4a68bd[_0xf046('0x15')]);if(_0x4a68bd[_0xf046('0x16')]){delete _0x4a68bd[_0xf046('0x16')];}_0x291243[_0xf046('0x9')](_0x1ee9d5)[_0xf046('0x17')](_0x4a68bd);};}function maskClientSecret(_0x525b79){return _[_0xf046('0x18')](_0x525b79[_0xf046('0x19')](0x0,0x3),0x14,'*');}exports[_0xf046('0x1a')]=function(_0x2abe12,_0x5c3599){var _0x481de2={},_0x1fc4a3={},_0x4dd992={'count':0x0,'rows':[]};var _0x7167c3=_['map'](db[_0xf046('0x1b')]['rawAttributes'],function(_0x5400c1){return{'name':_0x5400c1[_0xf046('0x1c')],'type':_0x5400c1['type'][_0xf046('0x1d')]};});_0x1fc4a3[_0xf046('0x1e')]=_[_0xf046('0x1f')](_0x7167c3,'name');_0x1fc4a3[_0xf046('0x20')]=_['keys'](_0x2abe12['query']);_0x1fc4a3[_0xf046('0x21')]=_[_0xf046('0x22')](_0x1fc4a3[_0xf046('0x1e')],_0x1fc4a3[_0xf046('0x20')]);_0x481de2[_0xf046('0x23')]=_[_0xf046('0x22')](_0x1fc4a3[_0xf046('0x1e')],qs['fields'](_0x2abe12[_0xf046('0x20')]['fields']));_0x481de2[_0xf046('0x23')]=_0x481de2[_0xf046('0x23')]['length']?_0x481de2[_0xf046('0x23')]:_0x1fc4a3[_0xf046('0x1e')];if(!_0x2abe12[_0xf046('0x20')][_0xf046('0x24')](_0xf046('0x25'))){_0x481de2[_0xf046('0xc')]=qs[_0xf046('0xc')](_0x2abe12[_0xf046('0x20')][_0xf046('0xc')]);_0x481de2[_0xf046('0xa')]=qs['offset'](_0x2abe12[_0xf046('0x20')][_0xf046('0xa')]);}_0x481de2[_0xf046('0x26')]=qs[_0xf046('0x27')](_0x2abe12['query'][_0xf046('0x27')]);_0x481de2[_0xf046('0x28')]=qs[_0xf046('0x21')](_['pick'](_0x2abe12[_0xf046('0x20')],_0x1fc4a3['filters']),_0x7167c3);if(_0x2abe12[_0xf046('0x20')][_0xf046('0x29')]){_0x481de2['where']=_['merge'](_0x481de2[_0xf046('0x28')],{'$or':_[_0xf046('0x1f')](_0x7167c3,function(_0xf1ab6d){if(_0xf1ab6d[_0xf046('0x2a')]!==_0xf046('0x2b')){var _0x352f8a={};_0x352f8a[_0xf1ab6d[_0xf046('0x16')]]={'$like':'%'+_0x2abe12['query'][_0xf046('0x29')]+'%'};return _0x352f8a;}})});}_0x481de2=_[_0xf046('0x2c')]({},_0x481de2,_0x2abe12[_0xf046('0x2d')]);var _0xc9fc47={'where':_0x481de2[_0xf046('0x28')]};return db['CloudProvider'][_0xf046('0xd')](_0xc9fc47)['then'](function(_0xcd4d57){_0x4dd992['count']=_0xcd4d57;if(_0x2abe12[_0xf046('0x20')][_0xf046('0x2e')]){_0x481de2[_0xf046('0x2f')]=[{'all':!![]}];}return db[_0xf046('0x1b')]['findAll'](_0x481de2);})[_0xf046('0x12')](function(_0x162d27){_0x4dd992[_0xf046('0x30')]=_['map'](_0x162d27,function(_0x5642a9){if(_0x5642a9[_0xf046('0x31')]==='MicrosoftAzure'){var _0x4186d4=encryptor['decryptString'](_0x5642a9[_0xf046('0x32')]);_0x5642a9[_0xf046('0x32')]=maskClientSecret(_0x4186d4);}return _0x5642a9;});return _0x4dd992;})['then'](respondWithFilteredResult(_0x5c3599,_0x481de2))[_0xf046('0x33')](handleError(_0x5c3599,null));};exports[_0xf046('0x34')]=function(_0x241f77,_0xb83d9f){var _0x12338e={'raw':!![],'where':{'id':_0x241f77['params']['id']}},_0x5df1fd={};_0x5df1fd[_0xf046('0x1e')]=_[_0xf046('0x35')](db[_0xf046('0x1b')][_0xf046('0x36')]);_0x5df1fd[_0xf046('0x20')]=_['keys'](_0x241f77[_0xf046('0x20')]);_0x5df1fd[_0xf046('0x21')]=_[_0xf046('0x22')](_0x5df1fd['model'],_0x5df1fd[_0xf046('0x20')]);_0x12338e['attributes']=_[_0xf046('0x22')](_0x5df1fd[_0xf046('0x1e')],qs['fields'](_0x241f77[_0xf046('0x20')]['fields']));_0x12338e[_0xf046('0x23')]=_0x12338e[_0xf046('0x23')][_0xf046('0x37')]?_0x12338e['attributes']:_0x5df1fd[_0xf046('0x1e')];if(_0x241f77[_0xf046('0x20')][_0xf046('0x2e')]){_0x12338e[_0xf046('0x2f')]=[{'all':!![]}];}_0x12338e=_[_0xf046('0x2c')]({},_0x12338e,_0x241f77[_0xf046('0x2d')]);return db[_0xf046('0x1b')][_0xf046('0x38')](_0x12338e)[_0xf046('0x12')](handleEntityNotFound(_0xb83d9f,null))[_0xf046('0x12')](function(_0x10f180){if(_0x10f180[_0xf046('0x31')]===_0xf046('0x39')){var _0x684fb1=encryptor['decryptString'](_0x10f180['data3']);_0x10f180[_0xf046('0x32')]=maskClientSecret(_0x684fb1);}return _0x10f180;})['then'](respondWithResult(_0xb83d9f,null))[_0xf046('0x33')](handleError(_0xb83d9f,null));};exports['create']=function(_0x4eaa1b,_0x14d324){if(!_0x4eaa1b['body'][_0xf046('0x16')])throw new Error(_0xf046('0x3a'));if(!_0x4eaa1b[_0xf046('0x3b')]['service'])throw new Error('Service\x20parameter\x20not\x20specified');var _0x594b35=db['CloudProvider'][_0xf046('0x36')][_0xf046('0x31')][_0xf046('0x3c')];if(!_0x594b35[_0xf046('0x3d')](_0x4eaa1b[_0xf046('0x3b')][_0xf046('0x31')]))throw new Error(_0xf046('0x3e')+_0x594b35[_0xf046('0x3f')](',\x20'));if(_0x4eaa1b['body'][_0xf046('0x31')]===_0xf046('0x39')&&_0x4eaa1b['body'][_0xf046('0x32')]){_0x4eaa1b[_0xf046('0x3b')]['data3']=encryptor[_0xf046('0x40')](_0x4eaa1b['body'][_0xf046('0x32')]);}return db[_0xf046('0x1b')][_0xf046('0x41')](_0x4eaa1b[_0xf046('0x3b')],{})[_0xf046('0x12')](respondWithResult(_0x14d324,0xc9))['catch'](handleError(_0x14d324,null));};exports[_0xf046('0x11')]=function(_0x9488c0,_0x1c72eb){if(_0x9488c0[_0xf046('0x3b')]['id']){delete _0x9488c0[_0xf046('0x3b')]['id'];}return db[_0xf046('0x1b')][_0xf046('0x38')]({'where':{'id':_0x9488c0[_0xf046('0x42')]['id']}})[_0xf046('0x12')](handleEntityNotFound(_0x1c72eb,null))[_0xf046('0x12')](function(_0x2ac3e0){if(_0x2ac3e0[_0xf046('0x31')]===_0xf046('0x39')&&_0x9488c0[_0xf046('0x3b')][_0xf046('0x32')]){_0x9488c0[_0xf046('0x3b')][_0xf046('0x32')]=encryptor[_0xf046('0x40')](_0x9488c0[_0xf046('0x3b')][_0xf046('0x32')]);}return _0x2ac3e0;})[_0xf046('0x12')](saveUpdates(_0x9488c0[_0xf046('0x3b')],null))[_0xf046('0x12')](respondWithResult(_0x1c72eb,null))['catch'](handleError(_0x1c72eb,null));};exports[_0xf046('0x13')]=function(_0x3a32ab,_0x59223b){return db[_0xf046('0x1b')][_0xf046('0x38')]({'where':{'id':_0x3a32ab[_0xf046('0x42')]['id']}})['then'](handleEntityNotFound(_0x59223b,null))[_0xf046('0x12')](removeEntity(_0x59223b,null))[_0xf046('0x33')](handleError(_0x59223b,null));};exports['oauth2MicrosoftAuthorize']=function(_0x50fc69,_0xc12404){return db[_0xf046('0x1b')][_0xf046('0x43')]({'where':{'id':_0x50fc69['params']['id']},'raw':!![]})[_0xf046('0x12')](function(_0xe004a4){if(!_0xe004a4)return _0xc12404['sendStatus'](0x194);return{'url':oauth[_0xf046('0x44')](_0xe004a4,_0x50fc69[_0xf046('0x45')]['id'])};})[_0xf046('0x12')](respondWithResult(_0xc12404,null))[_0xf046('0x33')](handleError(_0xc12404,null));};exports['oauth2MicrosoftCallback']=function(_0x35abd4,_0x156f93){var _0x1e7ed0=_0x35abd4[_0xf046('0x3b')];var _0x4766ed;var _0x308b21;if(_0x1e7ed0['error'])throw _0x1e7ed0;redis[_0xf046('0x46')](_0x1e7ed0['state'])[_0xf046('0x12')](function(_0x87e579){if(!_0x87e579)throw new Error(_0xf046('0x47'));_0x4766ed=JSON[_0xf046('0x48')](_0x87e579);var _0x2591cd=Buffer[_0xf046('0x49')](_0x1e7ed0[_0xf046('0x4a')],_0xf046('0x4b'))[_0xf046('0x4c')](_0xf046('0x4d'));_0x308b21=JSON['parse'](_0x2591cd);if(!oauth[_0xf046('0x4e')](_0x1e7ed0[_0xf046('0x4f')],_0x4766ed[_0xf046('0x50')]))throw new Error(_0xf046('0x51'));redis[_0xf046('0x52')](_0x1e7ed0[_0xf046('0x4a')]);return oauth[_0xf046('0x53')](_0x1e7ed0[_0xf046('0x54')],_0x4766ed);})['then'](function(_0x571357){_0x4766ed['data5']=_0x571357[_0xf046('0x55')];_0x4766ed[_0xf046('0x56')]=_0x571357[_0xf046('0x57')];return db[_0xf046('0x1b')][_0xf046('0x11')]({'data5':_0x4766ed[_0xf046('0x58')],'data6':_0x4766ed[_0xf046('0x56')]},{'where':{'id':_0x4766ed['id']}});})[_0xf046('0x12')](function(){oauth[_0xf046('0x59')](_0x4766ed);socket['emit']('microsoftAuthorization:success',{'id':_0x308b21['id']});return;})[_0xf046('0x12')](respondWithStatusCode(_0x156f93,null))[_0xf046('0x33')](function(_0x22d648){if(_0x308b21){socket['emit'](_0xf046('0x5a'),{'id':_0x308b21['id']});}if(!_0x4766ed){logger[_0xf046('0x5b')](_0xf046('0x5c'),_0x22d648);return _0x156f93[_0xf046('0x9')](0x1f4)[_0xf046('0x17')](_0x22d648[_0xf046('0x5d')]);}logger['error'](_0xf046('0x5e'),_0x4766ed['id'],JSON[_0xf046('0x5f')](_0x22d648));});}; \ No newline at end of file +var _0x991f=['CloudProvider','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','rows','MicrosoftAzure','decryptString','data3','show','keys','includeAll','service','catch','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','find','params','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','error','get','parse','base64','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','state','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','Invalid\x20authentication\x20state\x20parameter','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/encryptor','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','limit','undefined','set','update','then','stack','name','padEnd','index','map'];(function(_0x239065,_0x5bde46){var _0x4cda34=function(_0x3f0e4e){while(--_0x3f0e4e){_0x239065['push'](_0x239065['shift']());}};_0x4cda34(++_0x5bde46);}(_0x991f,0x15c));var _0xf991=function(_0x5d7beb,_0x12270){_0x5d7beb=_0x5d7beb-0x0;var _0xe2a97a=_0x991f[_0x5d7beb];return _0xe2a97a;};'use strict';var _=require(_0xf991('0x0'));var Redis=require(_0xf991('0x1'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xf991('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')('api');var db=require(_0xf991('0x3'))['db'];var oauth=require(_0xf991('0x4'));config[_0xf991('0x5')]=_[_0xf991('0x6')](config['redis'],{'host':_0xf991('0x7'),'port':0x18eb});var socket=require(_0xf991('0x8'))(new Redis(config[_0xf991('0x5')]));var redis=new Redis(config[_0xf991('0x5')]);function respondWithStatusCode(_0x3dd9ea,_0x58529f){_0x58529f=_0x58529f||0xcc;return function(_0x56df8f){if(_0x56df8f){return _0x3dd9ea[_0xf991('0x9')](_0x58529f);}return _0x3dd9ea[_0xf991('0xa')](_0x58529f)[_0xf991('0xb')]();};}function respondWithResult(_0x471a56,_0x1f330e){_0x1f330e=_0x1f330e||0xc8;return function(_0x49d4bf){if(_0x49d4bf){return _0x471a56[_0xf991('0xa')](_0x1f330e)[_0xf991('0xc')](_0x49d4bf);}};}function respondWithFilteredResult(_0x339e19,_0x443bf0){return function(_0x58ac17){if(_0x58ac17){var _0xdffa06=typeof _0x443bf0[_0xf991('0xd')]==='undefined'&&typeof _0x443bf0[_0xf991('0xe')]===_0xf991('0xf');var _0x3c9653=_0x58ac17['count'];var _0x154003=_0xdffa06?0x0:_0x443bf0['offset'];var _0x633cb5=_0xdffa06?_0x58ac17['count']:_0x443bf0[_0xf991('0xd')]+_0x443bf0[_0xf991('0xe')];var _0x3aa7ba;if(_0x633cb5>=_0x3c9653){_0x633cb5=_0x3c9653;_0x3aa7ba=0xc8;}else{_0x3aa7ba=0xce;}_0x339e19[_0xf991('0xa')](_0x3aa7ba);return _0x339e19[_0xf991('0x10')]('Content-Range',_0x154003+'-'+_0x633cb5+'/'+_0x3c9653)[_0xf991('0xc')](_0x58ac17);}return null;};}function saveUpdates(_0x2db03d){return function(_0x36ddb4){if(_0x36ddb4){return _0x36ddb4[_0xf991('0x11')](_0x2db03d)['then'](function(_0x4042d6){return _0x4042d6;});}return null;};}function removeEntity(_0x3b4a15){return function(_0x4d7cc9){if(_0x4d7cc9){return _0x4d7cc9['destroy']()[_0xf991('0x12')](function(){_0x3b4a15['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2db9f6){return function(_0x382a7b){if(!_0x382a7b){_0x2db9f6['sendStatus'](0x194);}return _0x382a7b;};}function handleError(_0x29eac3,_0x3c5e60){_0x3c5e60=_0x3c5e60||0x1f4;return function(_0x3e7472){logger['error'](_0x3e7472[_0xf991('0x13')]);if(_0x3e7472[_0xf991('0x14')]){delete _0x3e7472[_0xf991('0x14')];}_0x29eac3['status'](_0x3c5e60)['send'](_0x3e7472);};}function maskClientSecret(_0x12e785){return _[_0xf991('0x15')](_0x12e785['slice'](0x0,0x3),0x14,'*');}exports[_0xf991('0x16')]=function(_0x208d7b,_0x4c0edf){var _0x46ba23={},_0x358bc5={},_0x35b24d={'count':0x0,'rows':[]};var _0x491f61=_[_0xf991('0x17')](db[_0xf991('0x18')][_0xf991('0x19')],function(_0x84c901){return{'name':_0x84c901[_0xf991('0x1a')],'type':_0x84c901[_0xf991('0x1b')][_0xf991('0x1c')]};});_0x358bc5[_0xf991('0x1d')]=_[_0xf991('0x17')](_0x491f61,_0xf991('0x14'));_0x358bc5[_0xf991('0x1e')]=_['keys'](_0x208d7b[_0xf991('0x1e')]);_0x358bc5[_0xf991('0x1f')]=_[_0xf991('0x20')](_0x358bc5[_0xf991('0x1d')],_0x358bc5['query']);_0x46ba23[_0xf991('0x21')]=_[_0xf991('0x20')](_0x358bc5[_0xf991('0x1d')],qs[_0xf991('0x22')](_0x208d7b[_0xf991('0x1e')][_0xf991('0x22')]));_0x46ba23['attributes']=_0x46ba23['attributes'][_0xf991('0x23')]?_0x46ba23[_0xf991('0x21')]:_0x358bc5[_0xf991('0x1d')];if(!_0x208d7b[_0xf991('0x1e')][_0xf991('0x24')]('nolimit')){_0x46ba23[_0xf991('0xe')]=qs[_0xf991('0xe')](_0x208d7b['query'][_0xf991('0xe')]);_0x46ba23[_0xf991('0xd')]=qs['offset'](_0x208d7b[_0xf991('0x1e')][_0xf991('0xd')]);}_0x46ba23[_0xf991('0x25')]=qs['sort'](_0x208d7b[_0xf991('0x1e')][_0xf991('0x26')]);_0x46ba23[_0xf991('0x27')]=qs[_0xf991('0x1f')](_[_0xf991('0x28')](_0x208d7b[_0xf991('0x1e')],_0x358bc5[_0xf991('0x1f')]),_0x491f61);if(_0x208d7b['query'][_0xf991('0x29')]){_0x46ba23[_0xf991('0x27')]=_[_0xf991('0x2a')](_0x46ba23['where'],{'$or':_[_0xf991('0x17')](_0x491f61,function(_0x1c7fa8){if(_0x1c7fa8[_0xf991('0x1b')]!==_0xf991('0x2b')){var _0x324fa9={};_0x324fa9[_0x1c7fa8[_0xf991('0x14')]]={'$like':'%'+_0x208d7b[_0xf991('0x1e')][_0xf991('0x29')]+'%'};return _0x324fa9;}})});}_0x46ba23=_[_0xf991('0x2a')]({},_0x46ba23,_0x208d7b[_0xf991('0x2c')]);var _0xfde4d0={'where':_0x46ba23[_0xf991('0x27')]};return db[_0xf991('0x18')]['count'](_0xfde4d0)['then'](function(_0x268c90){_0x35b24d[_0xf991('0x2d')]=_0x268c90;if(_0x208d7b[_0xf991('0x1e')]['includeAll']){_0x46ba23[_0xf991('0x2e')]=[{'all':!![]}];}return db['CloudProvider']['findAll'](_0x46ba23);})[_0xf991('0x12')](function(_0xd5224e){_0x35b24d[_0xf991('0x2f')]=_[_0xf991('0x17')](_0xd5224e,function(_0x3f92fe){if(_0x3f92fe['service']===_0xf991('0x30')){var _0x1c9d24=encryptor[_0xf991('0x31')](_0x3f92fe[_0xf991('0x32')]);_0x3f92fe[_0xf991('0x32')]=maskClientSecret(_0x1c9d24);}return _0x3f92fe;});return _0x35b24d;})[_0xf991('0x12')](respondWithFilteredResult(_0x4c0edf,_0x46ba23))['catch'](handleError(_0x4c0edf,null));};exports[_0xf991('0x33')]=function(_0x1d2223,_0x3aa36f){var _0x1fe5cb={'raw':!![],'where':{'id':_0x1d2223['params']['id']}},_0x169737={};_0x169737[_0xf991('0x1d')]=_[_0xf991('0x34')](db[_0xf991('0x18')]['rawAttributes']);_0x169737['query']=_[_0xf991('0x34')](_0x1d2223[_0xf991('0x1e')]);_0x169737[_0xf991('0x1f')]=_[_0xf991('0x20')](_0x169737[_0xf991('0x1d')],_0x169737[_0xf991('0x1e')]);_0x1fe5cb['attributes']=_['intersection'](_0x169737['model'],qs[_0xf991('0x22')](_0x1d2223[_0xf991('0x1e')][_0xf991('0x22')]));_0x1fe5cb['attributes']=_0x1fe5cb[_0xf991('0x21')][_0xf991('0x23')]?_0x1fe5cb[_0xf991('0x21')]:_0x169737[_0xf991('0x1d')];if(_0x1d2223[_0xf991('0x1e')][_0xf991('0x35')]){_0x1fe5cb[_0xf991('0x2e')]=[{'all':!![]}];}_0x1fe5cb=_[_0xf991('0x2a')]({},_0x1fe5cb,_0x1d2223[_0xf991('0x2c')]);return db[_0xf991('0x18')]['find'](_0x1fe5cb)[_0xf991('0x12')](handleEntityNotFound(_0x3aa36f,null))[_0xf991('0x12')](function(_0x22aa89){if(_0x22aa89[_0xf991('0x36')]===_0xf991('0x30')){var _0x4c1007=encryptor['decryptString'](_0x22aa89['data3']);_0x22aa89['data3']=maskClientSecret(_0x4c1007);}return _0x22aa89;})[_0xf991('0x12')](respondWithResult(_0x3aa36f,null))[_0xf991('0x37')](handleError(_0x3aa36f,null));};exports[_0xf991('0x38')]=function(_0x407c0a,_0x3c9bc1){if(!_0x407c0a[_0xf991('0x39')][_0xf991('0x14')])throw new Error(_0xf991('0x3a'));if(!_0x407c0a[_0xf991('0x39')][_0xf991('0x36')])throw new Error(_0xf991('0x3b'));var _0x544ed7=db[_0xf991('0x18')][_0xf991('0x19')]['service'][_0xf991('0x3c')];if(!_0x544ed7[_0xf991('0x3d')](_0x407c0a[_0xf991('0x39')][_0xf991('0x36')]))throw new Error(_0xf991('0x3e')+_0x544ed7[_0xf991('0x3f')](',\x20'));if(_0x407c0a['body'][_0xf991('0x36')]===_0xf991('0x30')&&_0x407c0a[_0xf991('0x39')]['data3']){_0x407c0a[_0xf991('0x39')]['data3']=encryptor[_0xf991('0x40')](_0x407c0a['body'][_0xf991('0x32')]);}return db[_0xf991('0x18')][_0xf991('0x38')](_0x407c0a[_0xf991('0x39')],{})[_0xf991('0x12')](respondWithResult(_0x3c9bc1,0xc9))[_0xf991('0x37')](handleError(_0x3c9bc1,null));};exports[_0xf991('0x11')]=function(_0x1d48ef,_0x2a3ddd){if(_0x1d48ef['body']['id']){delete _0x1d48ef[_0xf991('0x39')]['id'];}return db[_0xf991('0x18')][_0xf991('0x41')]({'where':{'id':_0x1d48ef[_0xf991('0x42')]['id']}})['then'](handleEntityNotFound(_0x2a3ddd,null))[_0xf991('0x12')](function(_0x1f809e){if(_0x1f809e['service']===_0xf991('0x30')&&_0x1d48ef[_0xf991('0x39')]['data3']){_0x1d48ef[_0xf991('0x39')]['data3']=encryptor[_0xf991('0x40')](_0x1d48ef['body'][_0xf991('0x32')]);}return _0x1f809e;})[_0xf991('0x12')](saveUpdates(_0x1d48ef[_0xf991('0x39')],null))[_0xf991('0x12')](respondWithResult(_0x2a3ddd,null))[_0xf991('0x37')](handleError(_0x2a3ddd,null));};exports['destroy']=function(_0x3777e3,_0x3fa686){return db[_0xf991('0x18')][_0xf991('0x41')]({'where':{'id':_0x3777e3[_0xf991('0x42')]['id']}})[_0xf991('0x12')](handleEntityNotFound(_0x3fa686,null))['then'](removeEntity(_0x3fa686,null))['catch'](handleError(_0x3fa686,null));};exports[_0xf991('0x43')]=function(_0x404c53,_0x5937da){return db['CloudProvider']['findOne']({'where':{'id':_0x404c53[_0xf991('0x42')]['id']},'raw':!![]})[_0xf991('0x12')](function(_0x392bf7){if(!_0x392bf7)return _0x5937da['sendStatus'](0x194);return{'url':oauth[_0xf991('0x44')](_0x392bf7,_0x404c53[_0xf991('0x45')]['id'])};})[_0xf991('0x12')](respondWithResult(_0x5937da,null))[_0xf991('0x37')](handleError(_0x5937da,null));};exports['oauth2MicrosoftCallback']=function(_0x37af08,_0x1430f2){var _0x3e0d54=_0x37af08[_0xf991('0x39')];var _0x17fafd;var _0x456210;if(_0x3e0d54[_0xf991('0x46')])throw _0x3e0d54;redis[_0xf991('0x47')](_0x3e0d54['state'])[_0xf991('0x12')](function(_0x2c5d64){if(!_0x2c5d64)throw new Error('Invalid\x20state\x20parameter');_0x17fafd=JSON[_0xf991('0x48')](_0x2c5d64);var _0x2d7e57=Buffer['from'](_0x3e0d54['state'],_0xf991('0x49'))['toString']('ascii');_0x456210=JSON[_0xf991('0x48')](_0x2d7e57);if(!oauth[_0xf991('0x4a')](_0x3e0d54[_0xf991('0x4b')],_0x17fafd[_0xf991('0x4c')]))throw new Error(_0xf991('0x4d'));redis[_0xf991('0x4e')](_0x3e0d54[_0xf991('0x4f')]);return oauth[_0xf991('0x50')](_0x3e0d54[_0xf991('0x51')],_0x17fafd);})[_0xf991('0x12')](function(_0x726b33){_0x17fafd[_0xf991('0x52')]=_0x726b33['access_token'];_0x17fafd[_0xf991('0x53')]=_0x726b33[_0xf991('0x54')];return db[_0xf991('0x18')][_0xf991('0x11')]({'data5':_0x17fafd[_0xf991('0x52')],'data6':_0x17fafd[_0xf991('0x53')]},{'where':{'id':_0x17fafd['id']}});})[_0xf991('0x12')](function(){oauth[_0xf991('0x55')](_0x17fafd);socket[_0xf991('0x56')](_0xf991('0x57'),{'id':_0x456210['id']});return;})[_0xf991('0x12')](respondWithStatusCode(_0x1430f2,null))['catch'](function(_0x6fda83){if(_0x456210){socket[_0xf991('0x56')]('microsoftAuthorization:error',{'id':_0x456210['id']});}if(!_0x17fafd){logger['error'](_0xf991('0x58'),_0x6fda83);return _0x1430f2[_0xf991('0xa')](0x1f4)[_0xf991('0x59')](_0x6fda83[_0xf991('0x5a')]);}logger['error'](_0xf991('0x5b'),_0x17fafd['id'],JSON[_0xf991('0x5c')](_0x6fda83));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 0a34fe6..438380e 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 _0x65a8=['moment','request-promise','path','./cloudProvider.attributes','define','cloud_providers','../../config/logger'];(function(_0x55d7c2,_0x4ce6fb){var _0x1755ef=function(_0xddc25c){while(--_0xddc25c){_0x55d7c2['push'](_0x55d7c2['shift']());}};_0x1755ef(++_0x4ce6fb);}(_0x65a8,0x1d4));var _0x865a=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x65a8[_0x46e363];return _0x3fb059;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x865a('0x0'))('api');var moment=require(_0x865a('0x1'));var BPromise=require('bluebird');var rp=require(_0x865a('0x2'));var fs=require('fs');var path=require(_0x865a('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x865a('0x4'));module['exports']=function(_0x433ac3,_0x1e888e){return _0x433ac3[_0x865a('0x5')]('CloudProvider',attributes,{'tableName':_0x865a('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x895b=['moment','path','rimraf','../../config/environment','define','CloudProvider','cloud_providers','lodash','util','api'];(function(_0x426e3b,_0x2b013b){var _0x662459=function(_0x3d5280){while(--_0x3d5280){_0x426e3b['push'](_0x426e3b['shift']());}};_0x662459(++_0x2b013b);}(_0x895b,0x18d));var _0xb895=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x895b[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xb895('0x0'));var util=require(_0xb895('0x1'));var logger=require('../../config/logger')(_0xb895('0x2'));var moment=require(_0xb895('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb895('0x4'));var rimraf=require(_0xb895('0x5'));var config=require(_0xb895('0x6'));var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x1776b5,_0xb11b1b){return _0x1776b5[_0xb895('0x7')](_0xb895('0x8'),attributes,{'tableName':_0xb895('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index a19dd8f..aad91c5 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa06c=['type','Dynamics365','push','data7','/.default','Outlook365','replace','{TENANT_ID}','code','toString','base64','randomBytes','hex','client_id','redirect_uri','data4','response_mode','form_post','scope','state','prompt','login','oauth2Claims','oauth2/','data1','set','stringify','decode','payload','iss','issuer','aud','audience','nonce','isAfter','unix','exp','resolve','then','data3','findOne','refresh_token','POST','access_token','data6','CloudProvider','data5','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','decryptString','data2','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','moment','request-promise','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','/token','map'];(function(_0x388b47,_0x5cdac5){var _0x4859df=function(_0x466a16){while(--_0x466a16){_0x388b47['push'](_0x388b47['shift']());}};_0x4859df(++_0x5cdac5);}(_0xa06c,0xdb));var _0xca06=function(_0x2cd85a,_0x47d1ff){_0x2cd85a=_0x2cd85a-0x0;var _0x48e048=_0xa06c[_0x2cd85a];return _0x48e048;};'use strict';var _=require(_0xca06('0x0'));var crypto=require('crypto');var jwt=require('jsonwebtoken');var moment=require(_0xca06('0x1'));var Redis=require('ioredis');var rp=require(_0xca06('0x2'));var util=require('util');var encryptor=require(_0xca06('0x3'));var config=require('../../config/environment');var logger=require(_0xca06('0x4'))(_0xca06('0x5'));var schedule=require(_0xca06('0x6'));var db=require(_0xca06('0x7'))['db'];config[_0xca06('0x8')]=_[_0xca06('0x9')](config['redis'],{'host':_0xca06('0xa'),'port':0x18eb});var redis=new Redis(config[_0xca06('0x8')]);var MICROSOFT_AUTH_URL=_0xca06('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0xca06('0xc'),_0xca06('0xd'),_0xca06('0xe'),_0xca06('0xf'),_0xca06('0x10'),_0xca06('0x11'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':['openid',_0xca06('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0xca06('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0xca06('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x645655){var _0x2c7031=_[_0xca06('0x14')](AZURE_AUTH_SCOPES[_0x645655[_0xca06('0x15')]]);if(_0x645655[_0xca06('0x15')]===_0xca06('0x16'))_0x2c7031[_0xca06('0x17')](_0x645655[_0xca06('0x18')]+_0xca06('0x19'));return _0x2c7031['join']('\x20');}function getAccessTokenScope(_0x4357d2){if(_0x4357d2['type']===_0xca06('0x1a'))return _0xca06('0x10');if(_0x4357d2[_0xca06('0x15')]===_0xca06('0x16'))return _0x4357d2[_0xca06('0x18')]+_0xca06('0x19');}function generateMicrosoftAuthorizationUrl(_0x4ce842,_0x31381b){var _0x5cc750=MICROSOFT_AUTH_URL[_0xca06('0x1b')](_0xca06('0x1c'),_0x4ce842['data2']);var _0x2bc8f5=[_0xca06('0x1d'),'id_token'];var _0xc41d6b=Buffer['from'](JSON['stringify']({'id':_0x31381b}))[_0xca06('0x1e')](_0xca06('0x1f'));var _0x1f0b94=crypto[_0xca06('0x20')](0x10)[_0xca06('0x1e')](_0xca06('0x21'));var _0x2affa0=getAuthorizationScopes(_0x4ce842);var _0xd62267=[{'key':_0xca06('0x22'),'value':_0x4ce842['data1']},{'key':'response_type','value':encodeURIComponent(_0x2bc8f5['join']('\x20'))},{'key':_0xca06('0x23'),'value':_0x4ce842[_0xca06('0x24')]},{'key':_0xca06('0x25'),'value':_0xca06('0x26')},{'key':_0xca06('0x27'),'value':encodeURIComponent(_0x2affa0)},{'key':_0xca06('0x28'),'value':_0xc41d6b},{'key':'nonce','value':_0x1f0b94},{'key':_0xca06('0x29'),'value':_0xca06('0x2a')}];var _0x287151=_0x5cc750+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0xd62267,function(_0x13099b){return _0x13099b['key']+'='+_0x13099b['value'];})['join']('&');_0x4ce842[_0xca06('0x2b')]={'issuer':_0x5cc750[_0xca06('0x1b')](_0xca06('0x2c'),''),'audience':_0x4ce842[_0xca06('0x2d')],'state':_0xc41d6b,'nonce':_0x1f0b94};redis[_0xca06('0x2e')](_0xc41d6b,JSON[_0xca06('0x2f')](_0x4ce842));return _0x287151;}function isValidIdToken(_0x10ab4f,_0x201a65){try{var _0x5466fd=jwt[_0xca06('0x30')](_0x10ab4f,{'complete':!![]});var _0x6e1d01=_0x5466fd[_0xca06('0x31')];if(_0x6e1d01[_0xca06('0x32')]!==_0x201a65[_0xca06('0x33')])return![];if(_0x6e1d01[_0xca06('0x34')]!==_0x201a65[_0xca06('0x35')])return![];if(_0x6e1d01[_0xca06('0x36')]!==_0x201a65[_0xca06('0x36')])return![];if(moment()[_0xca06('0x37')](moment[_0xca06('0x38')](_0x6e1d01[_0xca06('0x39')])))return![];return!![];}catch(_0x7622dd){throw _0x7622dd;}}function refreshOauth2MicrosoftAccessToken(_0x2c84d9){return Promise[_0xca06('0x3a')]()[_0xca06('0x3b')](function(){if(_0x2c84d9[_0xca06('0x3c')])return _0x2c84d9;return db['CloudProvider'][_0xca06('0x3d')]({'where':{'id':_0x2c84d9['id']},'raw':!![]});})[_0xca06('0x3b')](function(_0x2c47f9){var _0x12af0f={'grant_type':_0xca06('0x3e'),'refresh_token':_0x2c47f9['data6'],'scope':getAccessTokenScope(_0x2c47f9),'redirect_uri':_0x2c47f9[_0xca06('0x24')],'client_id':_0x2c47f9[_0xca06('0x2d')],'client_secret':encryptor['decryptString'](_0x2c47f9[_0xca06('0x3c')])};var _0x125e1f={'method':_0xca06('0x3f'),'uri':MICROSOFT_AUTH_URL[_0xca06('0x1b')]('{TENANT_ID}',_0x2c47f9['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x12af0f,'json':!![]};return rp(_0x125e1f);})[_0xca06('0x3b')](function(_0x1c0095){_0x2c84d9['data5']=_0x1c0095[_0xca06('0x40')];_0x2c84d9[_0xca06('0x41')]=_0x1c0095['refresh_token'];return db[_0xca06('0x42')]['update']({'data5':_0x2c84d9[_0xca06('0x43')],'data6':_0x2c84d9[_0xca06('0x41')]},{'where':{'id':_0x2c84d9['id']}});})['then'](function(){return _0x2c84d9;})[_0xca06('0x44')](function(_0x34ed8a){logger[_0xca06('0x45')](_0xca06('0x46'),_0x2c84d9['id'],_0x34ed8a);});}function getOauth2MicrosoftAccessToken(_0xc0a62a,_0x14a017){var _0x498e15={'grant_type':'authorization_code','code':_0xc0a62a,'scope':getAccessTokenScope(_0x14a017),'redirect_uri':_0x14a017[_0xca06('0x24')],'client_id':_0x14a017[_0xca06('0x2d')],'client_secret':encryptor[_0xca06('0x47')](_0x14a017[_0xca06('0x3c')])};var _0x13c8ec={'method':_0xca06('0x3f'),'uri':MICROSOFT_AUTH_URL[_0xca06('0x1b')](_0xca06('0x1c'),_0x14a017[_0xca06('0x48')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x498e15,'json':!![]};return rp(_0x13c8ec);}function startRefreshInterval(_0xf659e9){var _0x42cb49=schedule[_0xca06('0x49')];if(_0x42cb49[_0xf659e9['id']])clearInterval(_0x42cb49[_0xf659e9['id']]);_0x42cb49[_0xf659e9['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xca06('0x4a')](this,{'id':_0xf659e9['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xca06('0x49')]=_0x42cb49;}function startAllRefreshIntervals(){return db[_0xca06('0x42')][_0xca06('0x4b')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xca06('0x3b')](function(_0x53bb9a){var _0x86232a=_0x53bb9a[_0xca06('0x14')](function(_0x5b053a){return refreshOauth2MicrosoftAccessToken(_0x5b053a)[_0xca06('0x3b')](function(_0x1cb17d){startRefreshInterval(_0x1cb17d);});});return Promise[_0xca06('0x4c')](_0x86232a);})[_0xca06('0x44')](function(_0x3adf5b){var _0x560ba1=_0x3adf5b?util[_0xca06('0x4d')](_0x3adf5b,{'showHidden':![],'depth':null}):'';logger[_0xca06('0x45')](_0xca06('0x4e'),_0x560ba1);});}module[_0xca06('0x4f')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x8d96=['authorization_code','intervals','bind','findAll','all','catch','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/logger','api','../../config/schedule/cloud-provider','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','offline_access','/authorize','map','type','Dynamics365','push','/.default','join','data7','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','randomBytes','client_id','response_type','redirect_uri','response_mode','form_post','state','nonce','login','value','oauth2Claims','oauth2/','data1','set','decode','iss','issuer','aud','audience','isAfter','unix','exp','then','CloudProvider','findOne','data6','data4','decryptString','data3','POST','access_token','update','data5','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s'];(function(_0x18c864,_0x5724b1){var _0x5c5373=function(_0x1e3d7b){while(--_0x1e3d7b){_0x18c864['push'](_0x18c864['shift']());}};_0x5c5373(++_0x5724b1);}(_0x8d96,0xa6));var _0x68d9=function(_0x470ada,_0x453059){_0x470ada=_0x470ada-0x0;var _0x5a71e0=_0x8d96[_0x470ada];return _0x5a71e0;};'use strict';var _=require(_0x68d9('0x0'));var crypto=require(_0x68d9('0x1'));var jwt=require(_0x68d9('0x2'));var moment=require(_0x68d9('0x3'));var Redis=require(_0x68d9('0x4'));var rp=require(_0x68d9('0x5'));var util=require(_0x68d9('0x6'));var encryptor=require(_0x68d9('0x7'));var config=require('../../config/environment');var logger=require(_0x68d9('0x8'))(_0x68d9('0x9'));var schedule=require(_0x68d9('0xa'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x68d9('0xb')],{'host':_0x68d9('0xc'),'port':0x18eb});var redis=new Redis(config[_0x68d9('0xb')]);var MICROSOFT_AUTH_URL=_0x68d9('0xd');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0x68d9('0xe'),'email','offline_access',_0x68d9('0xf'),'https://outlook.office.com/POP.AccessAsUser.All',_0x68d9('0x10')],'Dynamics365':[_0x68d9('0x11'),_0x68d9('0x12')]};var MICROSOFT_AUTH_ENDPOINT=_0x68d9('0x13');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4a9b27){var _0x116179=_[_0x68d9('0x14')](AZURE_AUTH_SCOPES[_0x4a9b27[_0x68d9('0x15')]]);if(_0x4a9b27[_0x68d9('0x15')]===_0x68d9('0x16'))_0x116179[_0x68d9('0x17')](_0x4a9b27['data7']+_0x68d9('0x18'));return _0x116179[_0x68d9('0x19')]('\x20');}function getAccessTokenScope(_0x257f6d){if(_0x257f6d[_0x68d9('0x15')]==='Outlook365')return _0x68d9('0xf');if(_0x257f6d[_0x68d9('0x15')]===_0x68d9('0x16'))return _0x257f6d[_0x68d9('0x1a')]+_0x68d9('0x18');}function generateMicrosoftAuthorizationUrl(_0x1d42ff,_0xd3feb5){var _0x399c2e=MICROSOFT_AUTH_URL[_0x68d9('0x1b')](_0x68d9('0x1c'),_0x1d42ff[_0x68d9('0x1d')]);var _0x51e3b5=[_0x68d9('0x1e'),_0x68d9('0x1f')];var _0x6e99f=Buffer[_0x68d9('0x20')](JSON[_0x68d9('0x21')]({'id':_0xd3feb5}))[_0x68d9('0x22')](_0x68d9('0x23'));var _0x4774a4=crypto[_0x68d9('0x24')](0x10)[_0x68d9('0x22')]('hex');var _0x3204e8=getAuthorizationScopes(_0x1d42ff);var _0x4a6dbf=[{'key':_0x68d9('0x25'),'value':_0x1d42ff['data1']},{'key':_0x68d9('0x26'),'value':encodeURIComponent(_0x51e3b5[_0x68d9('0x19')]('\x20'))},{'key':_0x68d9('0x27'),'value':_0x1d42ff['data4']},{'key':_0x68d9('0x28'),'value':_0x68d9('0x29')},{'key':'scope','value':encodeURIComponent(_0x3204e8)},{'key':_0x68d9('0x2a'),'value':_0x6e99f},{'key':_0x68d9('0x2b'),'value':_0x4774a4},{'key':'prompt','value':_0x68d9('0x2c')}];var _0x3b3fe2=_0x399c2e+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x68d9('0x14')](_0x4a6dbf,function(_0x586529){return _0x586529['key']+'='+_0x586529[_0x68d9('0x2d')];})[_0x68d9('0x19')]('&');_0x1d42ff[_0x68d9('0x2e')]={'issuer':_0x399c2e[_0x68d9('0x1b')](_0x68d9('0x2f'),''),'audience':_0x1d42ff[_0x68d9('0x30')],'state':_0x6e99f,'nonce':_0x4774a4};redis[_0x68d9('0x31')](_0x6e99f,JSON['stringify'](_0x1d42ff));return _0x3b3fe2;}function isValidIdToken(_0x3de123,_0x3c3b98){try{var _0x22b6e1=jwt[_0x68d9('0x32')](_0x3de123,{'complete':!![]});var _0x29b968=_0x22b6e1['payload'];if(_0x29b968[_0x68d9('0x33')]!==_0x3c3b98[_0x68d9('0x34')])return![];if(_0x29b968[_0x68d9('0x35')]!==_0x3c3b98[_0x68d9('0x36')])return![];if(_0x29b968[_0x68d9('0x2b')]!==_0x3c3b98[_0x68d9('0x2b')])return![];if(moment()[_0x68d9('0x37')](moment[_0x68d9('0x38')](_0x29b968[_0x68d9('0x39')])))return![];return!![];}catch(_0x521bcd){throw _0x521bcd;}}function refreshOauth2MicrosoftAccessToken(_0x4a1fa4){return Promise['resolve']()[_0x68d9('0x3a')](function(){if(_0x4a1fa4['data3'])return _0x4a1fa4;return db[_0x68d9('0x3b')][_0x68d9('0x3c')]({'where':{'id':_0x4a1fa4['id']},'raw':!![]});})['then'](function(_0x2c6534){var _0x4e3871={'grant_type':'refresh_token','refresh_token':_0x2c6534[_0x68d9('0x3d')],'scope':getAccessTokenScope(_0x2c6534),'redirect_uri':_0x2c6534[_0x68d9('0x3e')],'client_id':_0x2c6534['data1'],'client_secret':encryptor[_0x68d9('0x3f')](_0x2c6534[_0x68d9('0x40')])};var _0x2ff640={'method':_0x68d9('0x41'),'uri':MICROSOFT_AUTH_URL[_0x68d9('0x1b')](_0x68d9('0x1c'),_0x2c6534[_0x68d9('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4e3871,'json':!![]};return rp(_0x2ff640);})[_0x68d9('0x3a')](function(_0x507c5f){_0x4a1fa4['data5']=_0x507c5f[_0x68d9('0x42')];_0x4a1fa4[_0x68d9('0x3d')]=_0x507c5f['refresh_token'];return db[_0x68d9('0x3b')][_0x68d9('0x43')]({'data5':_0x4a1fa4[_0x68d9('0x44')],'data6':_0x4a1fa4[_0x68d9('0x3d')]},{'where':{'id':_0x4a1fa4['id']}});})['then'](function(){return _0x4a1fa4;})['catch'](function(_0x4e29e9){logger[_0x68d9('0x45')](_0x68d9('0x46'),_0x4a1fa4['id'],_0x4e29e9);});}function getOauth2MicrosoftAccessToken(_0x2e014a,_0x40221d){var _0x12de98={'grant_type':_0x68d9('0x47'),'code':_0x2e014a,'scope':getAccessTokenScope(_0x40221d),'redirect_uri':_0x40221d[_0x68d9('0x3e')],'client_id':_0x40221d['data1'],'client_secret':encryptor[_0x68d9('0x3f')](_0x40221d['data3'])};var _0x2939b0={'method':_0x68d9('0x41'),'uri':MICROSOFT_AUTH_URL[_0x68d9('0x1b')](_0x68d9('0x1c'),_0x40221d[_0x68d9('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x12de98,'json':!![]};return rp(_0x2939b0);}function startRefreshInterval(_0x96b677){var _0xb5ddf3=schedule[_0x68d9('0x48')];if(_0xb5ddf3[_0x96b677['id']])clearInterval(_0xb5ddf3[_0x96b677['id']]);_0xb5ddf3[_0x96b677['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x68d9('0x49')](this,{'id':_0x96b677['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x68d9('0x48')]=_0xb5ddf3;}function startAllRefreshIntervals(){return db[_0x68d9('0x3b')][_0x68d9('0x4a')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x68d9('0x3a')](function(_0x2aae20){var _0x3f0ce0=_0x2aae20[_0x68d9('0x14')](function(_0x11c616){return refreshOauth2MicrosoftAccessToken(_0x11c616)[_0x68d9('0x3a')](function(_0x53f47b){startRefreshInterval(_0x53f47b);});});return Promise[_0x68d9('0x4b')](_0x3f0ce0);})[_0x68d9('0x4c')](function(_0x394abd){var _0x2535a6=_0x394abd?util['inspect'](_0x394abd,{'showHidden':![],'depth':null}):'';logger[_0x68d9('0x45')](_0x68d9('0x4d'),_0x2535a6);});}module[_0x68d9('0x4e')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 6fd4c39..de729f5 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 _0x7096=['code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x5b34c0,_0x3ad403){var _0x242bd3=function(_0x51d0ce){while(--_0x51d0ce){_0x5b34c0['push'](_0x5b34c0['shift']());}};_0x242bd3(++_0x3ad403);}(_0x7096,0x10c));var _0x6709=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x7096[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var moment=require('moment');var BPromise=require(_0x6709('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6709('0x2'));var db=require(_0x6709('0x3'))['db'];var utils=require(_0x6709('0x4'));var logger=require(_0x6709('0x5'))(_0x6709('0x6'));var config=require(_0x6709('0x7'));var jayson=require(_0x6709('0x8'));var client=jayson[_0x6709('0x9')][_0x6709('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e2223,_0x11ad23,_0x985814){return new BPromise(function(_0x30147f,_0x513ab6){return client['request'](_0x3e2223,_0x985814)[_0x6709('0xb')](function(_0x2d8c0b){logger[_0x6709('0xc')](_0x6709('0xd'),_0x11ad23,_0x6709('0xe'));logger[_0x6709('0xf')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x11ad23,'request\x20sent',JSON[_0x6709('0x10')](_0x2d8c0b));if(_0x2d8c0b[_0x6709('0x11')]){if(_0x2d8c0b[_0x6709('0x11')][_0x6709('0x12')]===0x1f4){logger[_0x6709('0x11')](_0x6709('0xd'),_0x11ad23,_0x2d8c0b[_0x6709('0x11')][_0x6709('0x13')]);return _0x513ab6(_0x2d8c0b['error'][_0x6709('0x13')]);}logger[_0x6709('0x11')](_0x6709('0xd'),_0x11ad23,_0x2d8c0b[_0x6709('0x11')]['message']);return _0x30147f(_0x2d8c0b[_0x6709('0x11')]['message']);}else{logger[_0x6709('0xc')]('CloudProvider,\x20%s,\x20%s',_0x11ad23,_0x6709('0xe'));_0x30147f(_0x2d8c0b[_0x6709('0x14')][_0x6709('0x13')]);}})[_0x6709('0x15')](function(_0x4cab30){logger['error']('CloudProvider,\x20%s,\x20%s',_0x11ad23,_0x4cab30);_0x513ab6(_0x4cab30);});});} \ No newline at end of file +var _0xbd9e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','moment','randomstring'];(function(_0x10c45e,_0x3e5237){var _0x425d90=function(_0x1b9eb9){while(--_0x1b9eb9){_0x10c45e['push'](_0x10c45e['shift']());}};_0x425d90(++_0x3e5237);}(_0xbd9e,0x108));var _0xebd9=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xbd9e[_0x56482c];return _0x5aae7a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xebd9('0x0'));var BPromise=require('bluebird');var rs=require(_0xebd9('0x1'));var fs=require('fs');var Redis=require(_0xebd9('0x2'));var db=require(_0xebd9('0x3'))['db'];var utils=require(_0xebd9('0x4'));var logger=require(_0xebd9('0x5'))('rpc');var config=require(_0xebd9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xebd9('0x7')][_0xebd9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xe1bf09,_0x23c503,_0x285c28){return new BPromise(function(_0x1f7734,_0x55e858){return client[_0xebd9('0x9')](_0xe1bf09,_0x285c28)[_0xebd9('0xa')](function(_0x12d27a){logger[_0xebd9('0xb')](_0xebd9('0xc'),_0x23c503,'request\x20sent');logger[_0xebd9('0xd')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x23c503,_0xebd9('0xe'),JSON['stringify'](_0x12d27a));if(_0x12d27a[_0xebd9('0xf')]){if(_0x12d27a[_0xebd9('0xf')]['code']===0x1f4){logger[_0xebd9('0xf')](_0xebd9('0xc'),_0x23c503,_0x12d27a['error'][_0xebd9('0x10')]);return _0x55e858(_0x12d27a[_0xebd9('0xf')][_0xebd9('0x10')]);}logger[_0xebd9('0xf')]('CloudProvider,\x20%s,\x20%s',_0x23c503,_0x12d27a[_0xebd9('0xf')][_0xebd9('0x10')]);return _0x1f7734(_0x12d27a[_0xebd9('0xf')][_0xebd9('0x10')]);}else{logger[_0xebd9('0xb')](_0xebd9('0xc'),_0x23c503,_0xebd9('0xe'));_0x1f7734(_0x12d27a[_0xebd9('0x11')][_0xebd9('0x10')]);}})[_0xebd9('0x12')](function(_0x37cdf3){logger[_0xebd9('0xf')](_0xebd9('0xc'),_0x23c503,_0x37cdf3);_0x55e858(_0x37cdf3);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index c9306bb..f7decf4 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x4c80d7,_0x2bef29){var _0x3c5095=function(_0x1b0e67){while(--_0x1b0e67){_0x4c80d7['push'](_0x4c80d7['shift']());}};_0x3c5095(++_0x2bef29);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5528ce,_0x2a8c7b){_0x5528ce=_0x5528ce-0x0;var _0x30846b=_0x5f2f[_0x5528ce];return _0x30846b;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router; \ No newline at end of file +var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0xe31b33,_0x56e7c2){var _0x506ea6=function(_0x512c40){while(--_0x512c40){_0xe31b33['push'](_0xe31b33['shift']());}};_0x506ea6(++_0x56e7c2);}(_0x2ef3,0xba));var _0x32ef=function(_0x44a88c,_0x4eb614){_0x44a88c=_0x44a88c-0x0;var _0xa0f93d=_0x2ef3[_0x44a88c];return _0xa0f93d;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 9c11441..4865311 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 _0x2ff8=['sequelize','exports','name','STRING'];(function(_0x58ecb7,_0x3ce107){var _0xf8856=function(_0x5c0138){while(--_0x5c0138){_0x58ecb7['push'](_0x58ecb7['shift']());}};_0xf8856(++_0x3ce107);}(_0x2ff8,0x1b0));var _0x82ff=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x2ff8[_0x4154a6];return _0x3b2786;};'use strict';var Sequelize=require(_0x82ff('0x0'));module[_0x82ff('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x82ff('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x82ff('0x3')]},'companyId':{'type':Sequelize[_0x82ff('0x3')]},'website':{'type':Sequelize[_0x82ff('0x3')]},'phone':{'type':Sequelize[_0x82ff('0x3')]},'fax':{'type':Sequelize[_0x82ff('0x3')]},'type':{'type':Sequelize[_0x82ff('0x3')]},'street':{'type':Sequelize[_0x82ff('0x3')]},'postalCode':{'type':Sequelize[_0x82ff('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x82ff('0x3')]},'sStreet':{'type':Sequelize[_0x82ff('0x3')]},'sPostalCode':{'type':Sequelize[_0x82ff('0x3')]},'sCity':{'type':Sequelize[_0x82ff('0x3')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x82ff('0x3')]}}; \ No newline at end of file +var _0x0863=['STRING','name','sequelize','exports'];(function(_0x39475,_0xfc9d3e){var _0x58e849=function(_0x4fe977){while(--_0x4fe977){_0x39475['push'](_0x39475['shift']());}};_0x58e849(++_0xfc9d3e);}(_0x0863,0x126));var _0x3086=function(_0x1a085c,_0x5d0b09){_0x1a085c=_0x1a085c-0x0;var _0x2444db=_0x0863[_0x1a085c];return _0x2444db;};'use strict';var Sequelize=require(_0x3086('0x0'));module[_0x3086('0x1')]={'name':{'type':Sequelize[_0x3086('0x2')],'unique':_0x3086('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x3086('0x2')]},'companyId':{'type':Sequelize[_0x3086('0x2')]},'website':{'type':Sequelize[_0x3086('0x2')]},'phone':{'type':Sequelize[_0x3086('0x2')]},'fax':{'type':Sequelize[_0x3086('0x2')]},'type':{'type':Sequelize[_0x3086('0x2')]},'street':{'type':Sequelize[_0x3086('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x3086('0x2')]},'country':{'type':Sequelize[_0x3086('0x2')]},'email':{'type':Sequelize[_0x3086('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x3086('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x3086('0x2')]},'sCountry':{'type':Sequelize[_0x3086('0x2')]},'description':{'type':Sequelize[_0x3086('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 0023fa9..afc7d73 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 _0xb162=['nolimit','order','sort','pick','filter','where','merge','map','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','getContacts','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','reject','save','update','then','destroy','UserProfileResource','end','error','stack','name','send','index','CmCompany','describe','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty'];(function(_0x392485,_0x36a200){var _0xa34d31=function(_0x4a4dd6){while(--_0x4a4dd6){_0x392485['push'](_0x392485['shift']());}};_0xa34d31(++_0x36a200);}(_0xb162,0x7e));var _0x2b16=function(_0x5c273c,_0xe3517){_0x5c273c=_0x5c273c-0x0;var _0xfa1d67=_0xb162[_0x5c273c];return _0xfa1d67;};'use strict';var emlformat=require(_0x2b16('0x0'));var rimraf=require(_0x2b16('0x1'));var zipdir=require(_0x2b16('0x2'));var jsonpatch=require(_0x2b16('0x3'));var rp=require(_0x2b16('0x4'));var moment=require(_0x2b16('0x5'));var BPromise=require(_0x2b16('0x6'));var Mustache=require(_0x2b16('0x7'));var util=require(_0x2b16('0x8'));var path=require(_0x2b16('0x9'));var sox=require('sox');var csv=require(_0x2b16('0xa'));var ejs=require(_0x2b16('0xb'));var fs=require('fs');var fs_extra=require(_0x2b16('0xc'));var _=require(_0x2b16('0xd'));var squel=require(_0x2b16('0xe'));var crypto=require(_0x2b16('0xf'));var jsforce=require(_0x2b16('0x10'));var deskjs=require(_0x2b16('0x11'));var toCsv=require(_0x2b16('0xa'));var querystring=require('querystring');var Papa=require(_0x2b16('0x12'));var Redis=require(_0x2b16('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2b16('0x14'));var hardwareService=require(_0x2b16('0x15'));var logger=require(_0x2b16('0x16'))(_0x2b16('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2b16('0x18'))['db'];function respondWithStatusCode(_0x13dba2,_0x503442){_0x503442=_0x503442||0xcc;return function(_0x52e2a9){if(_0x52e2a9){return _0x13dba2[_0x2b16('0x19')](_0x503442);}return _0x13dba2['status'](_0x503442)['end']();};}function respondWithResult(_0x5921e5,_0x4a2be9){_0x4a2be9=_0x4a2be9||0xc8;return function(_0x112da9){if(_0x112da9){return _0x5921e5[_0x2b16('0x1a')](_0x4a2be9)['json'](_0x112da9);}};}function respondWithFilteredResult(_0x2e6120,_0x5beb86){return function(_0x44e526){if(_0x44e526){var _0x191b07=typeof _0x5beb86['offset']===_0x2b16('0x1b')&&typeof _0x5beb86[_0x2b16('0x1c')]===_0x2b16('0x1b');var _0x1406d5=_0x44e526[_0x2b16('0x1d')];var _0x49d59f=_0x191b07?0x0:_0x5beb86[_0x2b16('0x1e')];var _0x5a6e8a=_0x191b07?_0x44e526[_0x2b16('0x1d')]:_0x5beb86[_0x2b16('0x1e')]+_0x5beb86['limit'];var _0x5d9db5;if(_0x5a6e8a>=_0x1406d5){_0x5a6e8a=_0x1406d5;_0x5d9db5=0xc8;}else{_0x5d9db5=0xce;}_0x2e6120[_0x2b16('0x1a')](_0x5d9db5);return _0x2e6120[_0x2b16('0x1f')](_0x2b16('0x20'),_0x49d59f+'-'+_0x5a6e8a+'/'+_0x1406d5)[_0x2b16('0x21')](_0x44e526);}return null;};}function patchUpdates(_0x99c1e){return function(_0x154c2e){try{jsonpatch['apply'](_0x154c2e,_0x99c1e,!![]);}catch(_0x4b78ea){return BPromise[_0x2b16('0x22')](_0x4b78ea);}return _0x154c2e[_0x2b16('0x23')]();};}function saveUpdates(_0x3bc000,_0x43cd6e){return function(_0x54cb42){if(_0x54cb42){return _0x54cb42[_0x2b16('0x24')](_0x3bc000)[_0x2b16('0x25')](function(_0x1260ee){return _0x1260ee;});}return null;};}function removeEntity(_0x3df610,_0x4fd05d){return function(_0x44aeda){if(_0x44aeda){return _0x44aeda[_0x2b16('0x26')]()[_0x2b16('0x25')](function(){var _0x479627=_0x44aeda['get']({'plain':!![]});var _0x36ce19='Companies';return db[_0x2b16('0x27')][_0x2b16('0x26')]({'where':{'type':_0x36ce19,'resourceId':_0x479627['id']}})[_0x2b16('0x25')](function(){return _0x44aeda;});})[_0x2b16('0x25')](function(){_0x3df610[_0x2b16('0x1a')](0xcc)[_0x2b16('0x28')]();});}};}function handleEntityNotFound(_0xc3386d,_0x30345e){return function(_0x2411d7){if(!_0x2411d7){_0xc3386d[_0x2b16('0x19')](0x194);}return _0x2411d7;};}function handleError(_0x29c830,_0x422c63){_0x422c63=_0x422c63||0x1f4;return function(_0x430f86){logger[_0x2b16('0x29')](_0x430f86[_0x2b16('0x2a')]);if(_0x430f86['name']){delete _0x430f86[_0x2b16('0x2b')];}_0x29c830[_0x2b16('0x1a')](_0x422c63)[_0x2b16('0x2c')](_0x430f86);};}exports[_0x2b16('0x2d')]=function(_0x302443,_0x279ef3){var _0x5afd80={},_0x2830c0={},_0x50c74e={'count':0x0,'rows':[]};return db[_0x2b16('0x2e')][_0x2b16('0x2f')]()[_0x2b16('0x25')](function(_0x32e275){_0x2830c0[_0x2b16('0x30')]=_['keys'](_0x32e275);_0x2830c0[_0x2b16('0x31')]=_[_0x2b16('0x32')](_0x302443[_0x2b16('0x31')]);_0x2830c0[_0x2b16('0x33')]=_[_0x2b16('0x34')](_0x2830c0[_0x2b16('0x30')],_0x2830c0[_0x2b16('0x31')]);_0x5afd80['attributes']=_[_0x2b16('0x34')](_0x2830c0[_0x2b16('0x30')],qs[_0x2b16('0x35')](_0x302443[_0x2b16('0x31')][_0x2b16('0x35')]));_0x5afd80['attributes']=_0x5afd80[_0x2b16('0x36')]['length']?_0x5afd80[_0x2b16('0x36')]:_0x2830c0[_0x2b16('0x30')];if(!_0x302443[_0x2b16('0x31')][_0x2b16('0x37')](_0x2b16('0x38'))){_0x5afd80[_0x2b16('0x1c')]=qs['limit'](_0x302443[_0x2b16('0x31')][_0x2b16('0x1c')]);_0x5afd80[_0x2b16('0x1e')]=qs[_0x2b16('0x1e')](_0x302443[_0x2b16('0x31')][_0x2b16('0x1e')]);}_0x5afd80[_0x2b16('0x39')]=qs['sort'](_0x302443[_0x2b16('0x31')][_0x2b16('0x3a')]);_0x5afd80['where']=qs['filters'](_[_0x2b16('0x3b')](_0x302443[_0x2b16('0x31')],_0x2830c0[_0x2b16('0x33')]),_0x32e275);if(_0x302443[_0x2b16('0x31')][_0x2b16('0x3c')]){_0x5afd80[_0x2b16('0x3d')]=_[_0x2b16('0x3e')](_0x5afd80[_0x2b16('0x3d')],{'$or':_[_0x2b16('0x3f')](_0x5afd80['attributes'],function(_0x2ed1a0){var _0x449452={};_0x449452[_0x2ed1a0]={'$like':'%'+_0x302443[_0x2b16('0x31')]['filter']+'%'};return _0x449452;})});}_0x5afd80=_[_0x2b16('0x3e')]({},_0x5afd80,_0x302443['options']);var _0x5ce0e7={'where':_0x5afd80[_0x2b16('0x3d')]};return db[_0x2b16('0x2e')][_0x2b16('0x1d')](_0x5ce0e7)['then'](function(_0x44eb90){_0x50c74e[_0x2b16('0x1d')]=_0x44eb90;if(_0x302443[_0x2b16('0x31')][_0x2b16('0x40')]){_0x5afd80[_0x2b16('0x41')]=[{'all':!![]}];}return db[_0x2b16('0x2e')][_0x2b16('0x42')](_0x5afd80);})[_0x2b16('0x25')](function(_0x44511c){_0x50c74e[_0x2b16('0x43')]=_0x44511c;return _0x50c74e;})['then'](respondWithFilteredResult(_0x279ef3,_0x5afd80))[_0x2b16('0x44')](handleError(_0x279ef3,null));})[_0x2b16('0x44')](handleError(_0x279ef3,null));};exports[_0x2b16('0x45')]=function(_0x4ab1d5,_0x53ddf5){var _0x2573dc={'raw':![],'where':{'id':_0x4ab1d5[_0x2b16('0x46')]['id']}},_0x1caa44={};_0x1caa44['model']=_[_0x2b16('0x32')](db[_0x2b16('0x2e')][_0x2b16('0x47')]);_0x1caa44[_0x2b16('0x31')]=_[_0x2b16('0x32')](_0x4ab1d5[_0x2b16('0x31')]);_0x1caa44[_0x2b16('0x33')]=_[_0x2b16('0x34')](_0x1caa44[_0x2b16('0x30')],_0x1caa44[_0x2b16('0x31')]);_0x2573dc[_0x2b16('0x36')]=_['intersection'](_0x1caa44[_0x2b16('0x30')],qs[_0x2b16('0x35')](_0x4ab1d5['query']['fields']));_0x2573dc['attributes']=_0x2573dc[_0x2b16('0x36')][_0x2b16('0x48')]?_0x2573dc[_0x2b16('0x36')]:_0x1caa44['model'];if(_0x4ab1d5[_0x2b16('0x31')]['includeAll']){_0x2573dc[_0x2b16('0x41')]=[{'all':!![]}];}_0x2573dc=_[_0x2b16('0x3e')]({},_0x2573dc,_0x4ab1d5[_0x2b16('0x49')]);return db[_0x2b16('0x2e')][_0x2b16('0x4a')](_0x2573dc)[_0x2b16('0x25')](handleEntityNotFound(_0x53ddf5,null))[_0x2b16('0x25')](respondWithResult(_0x53ddf5,null))[_0x2b16('0x44')](handleError(_0x53ddf5,null));};exports[_0x2b16('0x4b')]=function(_0x53d8c4,_0x244317){return db['CmCompany'][_0x2b16('0x4b')](_0x53d8c4[_0x2b16('0x4c')],{})[_0x2b16('0x25')](function(_0x53055c){var _0x18dea3=_0x53d8c4[_0x2b16('0x4d')][_0x2b16('0x4e')]({'plain':!![]});if(!_0x18dea3)throw new Error(_0x2b16('0x4f'));if(_0x18dea3[_0x2b16('0x50')]===_0x2b16('0x4d')){var _0x512984=_0x53055c[_0x2b16('0x4e')]({'plain':!![]});var _0x3352bc=_0x2b16('0x51');return db[_0x2b16('0x52')][_0x2b16('0x4a')]({'where':{'name':_0x3352bc,'userProfileId':_0x18dea3[_0x2b16('0x53')]},'raw':!![]})['then'](function(_0x22b863){if(_0x22b863&&_0x22b863[_0x2b16('0x54')]===0x0){return db['UserProfileResource']['create']({'name':_0x512984[_0x2b16('0x2b')],'resourceId':_0x512984['id'],'type':_0x22b863[_0x2b16('0x2b')],'sectionId':_0x22b863['id']},{})[_0x2b16('0x25')](function(){return _0x53055c;});}else{return _0x53055c;}})[_0x2b16('0x44')](function(_0x2d0e3e){logger[_0x2b16('0x29')](_0x2b16('0x55'),_0x2d0e3e);throw _0x2d0e3e;});}return _0x53055c;})[_0x2b16('0x25')](respondWithResult(_0x244317,0xc9))[_0x2b16('0x44')](handleError(_0x244317,null));};exports[_0x2b16('0x24')]=function(_0x153bfc,_0x477765){if(_0x153bfc[_0x2b16('0x4c')]['id']){delete _0x153bfc[_0x2b16('0x4c')]['id'];}return db[_0x2b16('0x2e')]['find']({'where':{'id':_0x153bfc[_0x2b16('0x46')]['id']}})[_0x2b16('0x25')](handleEntityNotFound(_0x477765,null))[_0x2b16('0x25')](saveUpdates(_0x153bfc[_0x2b16('0x4c')],null))[_0x2b16('0x25')](respondWithResult(_0x477765,null))[_0x2b16('0x44')](handleError(_0x477765,null));};exports[_0x2b16('0x26')]=function(_0x55f558,_0x10a89e){return db[_0x2b16('0x2e')][_0x2b16('0x4a')]({'where':{'id':_0x55f558[_0x2b16('0x46')]['id']}})[_0x2b16('0x25')](handleEntityNotFound(_0x10a89e,null))['then'](removeEntity(_0x10a89e,null))[_0x2b16('0x44')](handleError(_0x10a89e,null));};exports[_0x2b16('0x2f')]=function(_0x1909ad,_0x40c94b){return db[_0x2b16('0x2e')][_0x2b16('0x2f')]()[_0x2b16('0x25')](respondWithResult(_0x40c94b,null))[_0x2b16('0x44')](handleError(_0x40c94b,null));};exports[_0x2b16('0x56')]=function(_0x1a5c0d,_0x397554,_0x5dd571){return db[_0x2b16('0x57')][_0x2b16('0x4a')]({'where':{'id':_0x1a5c0d[_0x2b16('0x46')]['id']}})[_0x2b16('0x25')](handleEntityNotFound(_0x397554,null))[_0x2b16('0x25')](function(_0x3925bd){if(_0x3925bd){return _0x3925bd[_0x2b16('0x56')](_0x1a5c0d[_0x2b16('0x4c')][_0x2b16('0x58')],_['omit'](_0x1a5c0d[_0x2b16('0x4c')],[_0x2b16('0x58'),'id'])||{});}})[_0x2b16('0x25')](respondWithResult(_0x397554,null))[_0x2b16('0x44')](handleError(_0x397554,null));};exports[_0x2b16('0x59')]=function(_0x4e7b6e,_0xe57d82,_0x2dc6ae){var _0x56a188={};var _0xc64734={};var _0x5c7314;var _0x314fa9;return db['CmCompany'][_0x2b16('0x5a')]({'where':{'id':_0x4e7b6e[_0x2b16('0x46')]['id']}})[_0x2b16('0x25')](handleEntityNotFound(_0xe57d82,null))[_0x2b16('0x25')](function(_0x50a10c){if(_0x50a10c){_0x5c7314=_0x50a10c;_0xc64734['model']=_['keys'](db[_0x2b16('0x57')][_0x2b16('0x47')]);_0xc64734[_0x2b16('0x31')]=_[_0x2b16('0x32')](_0x4e7b6e[_0x2b16('0x31')]);_0xc64734['filters']=_[_0x2b16('0x34')](_0xc64734[_0x2b16('0x30')],_0xc64734[_0x2b16('0x31')]);_0x56a188['attributes']=_[_0x2b16('0x34')](_0xc64734[_0x2b16('0x30')],qs['fields'](_0x4e7b6e['query'][_0x2b16('0x35')]));_0x56a188['attributes']=_0x56a188[_0x2b16('0x36')]['length']?_0x56a188[_0x2b16('0x36')]:_0xc64734[_0x2b16('0x30')];_0x56a188[_0x2b16('0x39')]=qs['sort'](_0x4e7b6e[_0x2b16('0x31')][_0x2b16('0x3a')]);_0x56a188[_0x2b16('0x3d')]=qs['filters'](_[_0x2b16('0x3b')](_0x4e7b6e['query'],_0xc64734[_0x2b16('0x33')]));if(_0x4e7b6e[_0x2b16('0x31')][_0x2b16('0x3c')]){_0x56a188[_0x2b16('0x3d')]=_[_0x2b16('0x3e')](_0x56a188['where'],{'$or':_['map'](_0x56a188['attributes'],function(_0x898c4c){var _0x2981b3={};_0x2981b3[_0x898c4c]={'$like':'%'+_0x4e7b6e[_0x2b16('0x31')][_0x2b16('0x3c')]+'%'};return _0x2981b3;})});}_0x56a188=_[_0x2b16('0x3e')]({},_0x56a188,_0x4e7b6e['options']);return _0x5c7314['getContacts'](_0x56a188);}})[_0x2b16('0x25')](function(_0x389475){if(_0x389475){_0x314fa9=_0x389475[_0x2b16('0x48')];if(!_0x4e7b6e['query']['hasOwnProperty'](_0x2b16('0x38'))){_0x56a188[_0x2b16('0x1c')]=qs[_0x2b16('0x1c')](_0x4e7b6e[_0x2b16('0x31')][_0x2b16('0x1c')]);_0x56a188[_0x2b16('0x1e')]=qs[_0x2b16('0x1e')](_0x4e7b6e[_0x2b16('0x31')]['offset']);}return _0x5c7314['getContacts'](_0x56a188);}})['then'](function(_0x5af2a5){if(_0x5af2a5){return _0x5af2a5?{'count':_0x314fa9,'rows':_0x5af2a5}:null;}})[_0x2b16('0x25')](respondWithResult(_0xe57d82,null))[_0x2b16('0x44')](handleError(_0xe57d82,null));}; \ No newline at end of file +var _0x7c41=['order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','CmContact','addContacts','ids','omit','getContacts','findOne','map','length','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','UserProfileResource','error','name','send','index','CmCompany','describe','model','keys','filters','attributes','intersection','fields','hasOwnProperty','query'];(function(_0x3cc1ef,_0x4d8511){var _0x4df6c8=function(_0x406a18){while(--_0x406a18){_0x3cc1ef['push'](_0x3cc1ef['shift']());}};_0x4df6c8(++_0x4d8511);}(_0x7c41,0x174));var _0x17c4=function(_0x259c9f,_0x447312){_0x259c9f=_0x259c9f-0x0;var _0x187ae4=_0x7c41[_0x259c9f];return _0x187ae4;};'use strict';var emlformat=require(_0x17c4('0x0'));var rimraf=require(_0x17c4('0x1'));var zipdir=require(_0x17c4('0x2'));var jsonpatch=require(_0x17c4('0x3'));var rp=require('request-promise');var moment=require(_0x17c4('0x4'));var BPromise=require(_0x17c4('0x5'));var Mustache=require(_0x17c4('0x6'));var util=require('util');var path=require(_0x17c4('0x7'));var sox=require('sox');var csv=require(_0x17c4('0x8'));var ejs=require(_0x17c4('0x9'));var fs=require('fs');var fs_extra=require(_0x17c4('0xa'));var _=require(_0x17c4('0xb'));var squel=require(_0x17c4('0xc'));var crypto=require(_0x17c4('0xd'));var jsforce=require(_0x17c4('0xe'));var deskjs=require(_0x17c4('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x17c4('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x17c4('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x17c4('0x12'));var logger=require(_0x17c4('0x13'))(_0x17c4('0x14'));var utils=require(_0x17c4('0x15'));var config=require(_0x17c4('0x16'));var licenseUtil=require(_0x17c4('0x17'));var db=require(_0x17c4('0x18'))['db'];function respondWithStatusCode(_0x421a92,_0x478c82){_0x478c82=_0x478c82||0xcc;return function(_0x4757fc){if(_0x4757fc){return _0x421a92['sendStatus'](_0x478c82);}return _0x421a92[_0x17c4('0x19')](_0x478c82)['end']();};}function respondWithResult(_0x564898,_0xb38b8a){_0xb38b8a=_0xb38b8a||0xc8;return function(_0x4e58d3){if(_0x4e58d3){return _0x564898[_0x17c4('0x19')](_0xb38b8a)[_0x17c4('0x1a')](_0x4e58d3);}};}function respondWithFilteredResult(_0x2a27ee,_0x3a9dc3){return function(_0x1ea27b){if(_0x1ea27b){var _0x167d34=typeof _0x3a9dc3[_0x17c4('0x1b')]===_0x17c4('0x1c')&&typeof _0x3a9dc3[_0x17c4('0x1d')]===_0x17c4('0x1c');var _0x1ea306=_0x1ea27b[_0x17c4('0x1e')];var _0x15916e=_0x167d34?0x0:_0x3a9dc3[_0x17c4('0x1b')];var _0x348f0c=_0x167d34?_0x1ea27b[_0x17c4('0x1e')]:_0x3a9dc3[_0x17c4('0x1b')]+_0x3a9dc3[_0x17c4('0x1d')];var _0x3d0cec;if(_0x348f0c>=_0x1ea306){_0x348f0c=_0x1ea306;_0x3d0cec=0xc8;}else{_0x3d0cec=0xce;}_0x2a27ee[_0x17c4('0x19')](_0x3d0cec);return _0x2a27ee['set'](_0x17c4('0x1f'),_0x15916e+'-'+_0x348f0c+'/'+_0x1ea306)[_0x17c4('0x1a')](_0x1ea27b);}return null;};}function patchUpdates(_0x1246f4){return function(_0x455766){try{jsonpatch[_0x17c4('0x20')](_0x455766,_0x1246f4,!![]);}catch(_0xddd813){return BPromise[_0x17c4('0x21')](_0xddd813);}return _0x455766[_0x17c4('0x22')]();};}function saveUpdates(_0xddddc8,_0x5d6b03){return function(_0x528658){if(_0x528658){return _0x528658[_0x17c4('0x23')](_0xddddc8)[_0x17c4('0x24')](function(_0x13ab21){return _0x13ab21;});}return null;};}function removeEntity(_0x4e7cf9,_0x5cf11a){return function(_0x4037d3){if(_0x4037d3){return _0x4037d3['destroy']()['then'](function(){var _0x14eb6d=_0x4037d3[_0x17c4('0x25')]({'plain':!![]});var _0x24ca20='Companies';return db[_0x17c4('0x26')]['destroy']({'where':{'type':_0x24ca20,'resourceId':_0x14eb6d['id']}})['then'](function(){return _0x4037d3;});})[_0x17c4('0x24')](function(){_0x4e7cf9[_0x17c4('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa54d50,_0x1cbe24){return function(_0x404bd9){if(!_0x404bd9){_0xa54d50['sendStatus'](0x194);}return _0x404bd9;};}function handleError(_0x214b2,_0x32762a){_0x32762a=_0x32762a||0x1f4;return function(_0x529f35){logger[_0x17c4('0x27')](_0x529f35['stack']);if(_0x529f35[_0x17c4('0x28')]){delete _0x529f35[_0x17c4('0x28')];}_0x214b2[_0x17c4('0x19')](_0x32762a)[_0x17c4('0x29')](_0x529f35);};}exports[_0x17c4('0x2a')]=function(_0x642f4d,_0x5b02ba){var _0x18265a={},_0x3bec97={},_0x24adf0={'count':0x0,'rows':[]};return db[_0x17c4('0x2b')][_0x17c4('0x2c')]()[_0x17c4('0x24')](function(_0x424cce){_0x3bec97[_0x17c4('0x2d')]=_[_0x17c4('0x2e')](_0x424cce);_0x3bec97['query']=_[_0x17c4('0x2e')](_0x642f4d['query']);_0x3bec97[_0x17c4('0x2f')]=_['intersection'](_0x3bec97[_0x17c4('0x2d')],_0x3bec97['query']);_0x18265a[_0x17c4('0x30')]=_[_0x17c4('0x31')](_0x3bec97[_0x17c4('0x2d')],qs[_0x17c4('0x32')](_0x642f4d['query']['fields']));_0x18265a[_0x17c4('0x30')]=_0x18265a[_0x17c4('0x30')]['length']?_0x18265a[_0x17c4('0x30')]:_0x3bec97['model'];if(!_0x642f4d['query'][_0x17c4('0x33')]('nolimit')){_0x18265a[_0x17c4('0x1d')]=qs[_0x17c4('0x1d')](_0x642f4d['query']['limit']);_0x18265a[_0x17c4('0x1b')]=qs['offset'](_0x642f4d[_0x17c4('0x34')][_0x17c4('0x1b')]);}_0x18265a[_0x17c4('0x35')]=qs['sort'](_0x642f4d[_0x17c4('0x34')][_0x17c4('0x36')]);_0x18265a[_0x17c4('0x37')]=qs[_0x17c4('0x2f')](_[_0x17c4('0x38')](_0x642f4d[_0x17c4('0x34')],_0x3bec97['filters']),_0x424cce);if(_0x642f4d[_0x17c4('0x34')][_0x17c4('0x39')]){_0x18265a[_0x17c4('0x37')]=_[_0x17c4('0x3a')](_0x18265a[_0x17c4('0x37')],{'$or':_['map'](_0x18265a[_0x17c4('0x30')],function(_0x37f08c){var _0x502484={};_0x502484[_0x37f08c]={'$like':'%'+_0x642f4d[_0x17c4('0x34')][_0x17c4('0x39')]+'%'};return _0x502484;})});}_0x18265a=_[_0x17c4('0x3a')]({},_0x18265a,_0x642f4d[_0x17c4('0x3b')]);var _0x3d7dc3={'where':_0x18265a['where']};return db[_0x17c4('0x2b')][_0x17c4('0x1e')](_0x3d7dc3)['then'](function(_0x48f30c){_0x24adf0[_0x17c4('0x1e')]=_0x48f30c;if(_0x642f4d[_0x17c4('0x34')][_0x17c4('0x3c')]){_0x18265a[_0x17c4('0x3d')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x18265a);})[_0x17c4('0x24')](function(_0x3543e6){_0x24adf0[_0x17c4('0x3e')]=_0x3543e6;return _0x24adf0;})[_0x17c4('0x24')](respondWithFilteredResult(_0x5b02ba,_0x18265a))[_0x17c4('0x3f')](handleError(_0x5b02ba,null));})['catch'](handleError(_0x5b02ba,null));};exports[_0x17c4('0x40')]=function(_0x168246,_0x60045d){var _0x220e3a={'raw':![],'where':{'id':_0x168246[_0x17c4('0x41')]['id']}},_0x59d0bb={};_0x59d0bb[_0x17c4('0x2d')]=_[_0x17c4('0x2e')](db[_0x17c4('0x2b')][_0x17c4('0x42')]);_0x59d0bb['query']=_[_0x17c4('0x2e')](_0x168246[_0x17c4('0x34')]);_0x59d0bb[_0x17c4('0x2f')]=_[_0x17c4('0x31')](_0x59d0bb[_0x17c4('0x2d')],_0x59d0bb[_0x17c4('0x34')]);_0x220e3a[_0x17c4('0x30')]=_[_0x17c4('0x31')](_0x59d0bb[_0x17c4('0x2d')],qs['fields'](_0x168246['query'][_0x17c4('0x32')]));_0x220e3a[_0x17c4('0x30')]=_0x220e3a[_0x17c4('0x30')]['length']?_0x220e3a[_0x17c4('0x30')]:_0x59d0bb[_0x17c4('0x2d')];if(_0x168246['query'][_0x17c4('0x3c')]){_0x220e3a[_0x17c4('0x3d')]=[{'all':!![]}];}_0x220e3a=_[_0x17c4('0x3a')]({},_0x220e3a,_0x168246[_0x17c4('0x3b')]);return db['CmCompany'][_0x17c4('0x43')](_0x220e3a)[_0x17c4('0x24')](handleEntityNotFound(_0x60045d,null))['then'](respondWithResult(_0x60045d,null))[_0x17c4('0x3f')](handleError(_0x60045d,null));};exports[_0x17c4('0x44')]=function(_0x4927e3,_0x4ebe26){return db[_0x17c4('0x2b')][_0x17c4('0x44')](_0x4927e3['body'],{})[_0x17c4('0x24')](function(_0x429e75){var _0x16a81c=_0x4927e3[_0x17c4('0x45')][_0x17c4('0x25')]({'plain':!![]});if(!_0x16a81c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16a81c[_0x17c4('0x46')]===_0x17c4('0x45')){var _0x2d093d=_0x429e75[_0x17c4('0x25')]({'plain':!![]});var _0x37590f='Companies';return db[_0x17c4('0x47')]['find']({'where':{'name':_0x37590f,'userProfileId':_0x16a81c['userProfileId']},'raw':!![]})[_0x17c4('0x24')](function(_0x4ed826){if(_0x4ed826&&_0x4ed826[_0x17c4('0x48')]===0x0){return db[_0x17c4('0x26')]['create']({'name':_0x2d093d[_0x17c4('0x28')],'resourceId':_0x2d093d['id'],'type':_0x4ed826['name'],'sectionId':_0x4ed826['id']},{})[_0x17c4('0x24')](function(){return _0x429e75;});}else{return _0x429e75;}})[_0x17c4('0x3f')](function(_0x413b4c){logger[_0x17c4('0x27')](_0x17c4('0x49'),_0x413b4c);throw _0x413b4c;});}return _0x429e75;})[_0x17c4('0x24')](respondWithResult(_0x4ebe26,0xc9))[_0x17c4('0x3f')](handleError(_0x4ebe26,null));};exports['update']=function(_0x40bfde,_0x148fd7){if(_0x40bfde[_0x17c4('0x4a')]['id']){delete _0x40bfde[_0x17c4('0x4a')]['id'];}return db[_0x17c4('0x2b')][_0x17c4('0x43')]({'where':{'id':_0x40bfde[_0x17c4('0x41')]['id']}})['then'](handleEntityNotFound(_0x148fd7,null))[_0x17c4('0x24')](saveUpdates(_0x40bfde['body'],null))['then'](respondWithResult(_0x148fd7,null))['catch'](handleError(_0x148fd7,null));};exports[_0x17c4('0x4b')]=function(_0x87e683,_0x27ab94){return db['CmCompany']['find']({'where':{'id':_0x87e683['params']['id']}})['then'](handleEntityNotFound(_0x27ab94,null))[_0x17c4('0x24')](removeEntity(_0x27ab94,null))[_0x17c4('0x3f')](handleError(_0x27ab94,null));};exports[_0x17c4('0x2c')]=function(_0x32eacf,_0x298930){return db[_0x17c4('0x2b')]['describe']()['then'](respondWithResult(_0x298930,null))[_0x17c4('0x3f')](handleError(_0x298930,null));};exports['addContacts']=function(_0x47d3ca,_0x545718,_0x118aae){return db[_0x17c4('0x4c')][_0x17c4('0x43')]({'where':{'id':_0x47d3ca[_0x17c4('0x41')]['id']}})[_0x17c4('0x24')](handleEntityNotFound(_0x545718,null))[_0x17c4('0x24')](function(_0x958d70){if(_0x958d70){return _0x958d70[_0x17c4('0x4d')](_0x47d3ca[_0x17c4('0x4a')][_0x17c4('0x4e')],_[_0x17c4('0x4f')](_0x47d3ca[_0x17c4('0x4a')],[_0x17c4('0x4e'),'id'])||{});}})[_0x17c4('0x24')](respondWithResult(_0x545718,null))[_0x17c4('0x3f')](handleError(_0x545718,null));};exports[_0x17c4('0x50')]=function(_0x43f093,_0x314030,_0x1ef938){var _0x1686ba={};var _0x1a5f84={};var _0x1f516b;var _0x2689d2;return db[_0x17c4('0x2b')][_0x17c4('0x51')]({'where':{'id':_0x43f093[_0x17c4('0x41')]['id']}})[_0x17c4('0x24')](handleEntityNotFound(_0x314030,null))['then'](function(_0x1baf5e){if(_0x1baf5e){_0x1f516b=_0x1baf5e;_0x1a5f84[_0x17c4('0x2d')]=_[_0x17c4('0x2e')](db['CmContact']['rawAttributes']);_0x1a5f84[_0x17c4('0x34')]=_['keys'](_0x43f093['query']);_0x1a5f84['filters']=_[_0x17c4('0x31')](_0x1a5f84['model'],_0x1a5f84['query']);_0x1686ba[_0x17c4('0x30')]=_['intersection'](_0x1a5f84['model'],qs['fields'](_0x43f093[_0x17c4('0x34')][_0x17c4('0x32')]));_0x1686ba[_0x17c4('0x30')]=_0x1686ba[_0x17c4('0x30')]['length']?_0x1686ba['attributes']:_0x1a5f84[_0x17c4('0x2d')];_0x1686ba['order']=qs['sort'](_0x43f093['query']['sort']);_0x1686ba['where']=qs[_0x17c4('0x2f')](_['pick'](_0x43f093['query'],_0x1a5f84['filters']));if(_0x43f093[_0x17c4('0x34')][_0x17c4('0x39')]){_0x1686ba[_0x17c4('0x37')]=_['merge'](_0x1686ba[_0x17c4('0x37')],{'$or':_[_0x17c4('0x52')](_0x1686ba[_0x17c4('0x30')],function(_0x2e44a3){var _0x1e4988={};_0x1e4988[_0x2e44a3]={'$like':'%'+_0x43f093['query']['filter']+'%'};return _0x1e4988;})});}_0x1686ba=_[_0x17c4('0x3a')]({},_0x1686ba,_0x43f093['options']);return _0x1f516b[_0x17c4('0x50')](_0x1686ba);}})['then'](function(_0x26ef04){if(_0x26ef04){_0x2689d2=_0x26ef04[_0x17c4('0x53')];if(!_0x43f093[_0x17c4('0x34')][_0x17c4('0x33')](_0x17c4('0x54'))){_0x1686ba[_0x17c4('0x1d')]=qs['limit'](_0x43f093[_0x17c4('0x34')][_0x17c4('0x1d')]);_0x1686ba[_0x17c4('0x1b')]=qs[_0x17c4('0x1b')](_0x43f093[_0x17c4('0x34')]['offset']);}return _0x1f516b['getContacts'](_0x1686ba);}})[_0x17c4('0x24')](function(_0x1929fe){if(_0x1929fe){return _0x1929fe?{'count':_0x2689d2,'rows':_0x1929fe}:null;}})['then'](respondWithResult(_0x314030,null))[_0x17c4('0x3f')](handleError(_0x314030,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 45a4d5d..76c4c57 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 _0xac1e=['path','rimraf','define','CmCompany','cm_companies','util','../../config/logger','api','moment','bluebird'];(function(_0x860e29,_0x2b30b8){var _0xc9f706=function(_0x5aa8f7){while(--_0x5aa8f7){_0x860e29['push'](_0x860e29['shift']());}};_0xc9f706(++_0x2b30b8);}(_0xac1e,0xf5));var _0xeac1=function(_0x330133,_0x5dfcab){_0x330133=_0x330133-0x0;var _0x16c2b1=_0xac1e[_0x330133];return _0x16c2b1;};'use strict';var _=require('lodash');var util=require(_0xeac1('0x0'));var logger=require(_0xeac1('0x1'))(_0xeac1('0x2'));var moment=require(_0xeac1('0x3'));var BPromise=require(_0xeac1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeac1('0x5'));var rimraf=require(_0xeac1('0x6'));var config=require('../../config/environment');var attributes=require('./cmCompany.attributes');module['exports']=function(_0x5c19fc,_0x53dc29){return _0x5c19fc[_0xeac1('0x7')](_0xeac1('0x8'),attributes,{'tableName':_0xeac1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd56=['api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define','CmCompany','cm_companies','util','../../config/logger'];(function(_0x4f921d,_0x5cf169){var _0x4382a8=function(_0x2a6721){while(--_0x2a6721){_0x4f921d['push'](_0x4f921d['shift']());}};_0x4382a8(++_0x5cf169);}(_0xcd56,0x66));var _0x6cd5=function(_0x3f883d,_0x28a22e){_0x3f883d=_0x3f883d-0x0;var _0x51bcb1=_0xcd56[_0x3f883d];return _0x51bcb1;};'use strict';var _=require('lodash');var util=require(_0x6cd5('0x0'));var logger=require(_0x6cd5('0x1'))(_0x6cd5('0x2'));var moment=require('moment');var BPromise=require(_0x6cd5('0x3'));var rp=require(_0x6cd5('0x4'));var fs=require('fs');var path=require(_0x6cd5('0x5'));var rimraf=require(_0x6cd5('0x6'));var config=require(_0x6cd5('0x7'));var attributes=require(_0x6cd5('0x8'));module[_0x6cd5('0x9')]=function(_0x196fb7,_0x163c9c){return _0x196fb7[_0x6cd5('0xa')](_0x6cd5('0xb'),attributes,{'tableName':_0x6cd5('0xc'),'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 14d9fca..3a12170 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 _0x5e36=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','info','request\x20sent','result','catch'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x5e36,0xc8));var _0x65e3=function(_0x5a3876,_0x397364){_0x5a3876=_0x5a3876-0x0;var _0x59af7a=_0x5e36[_0x5a3876];return _0x59af7a;};'use strict';var _=require(_0x65e3('0x0'));var util=require(_0x65e3('0x1'));var moment=require('moment');var BPromise=require(_0x65e3('0x2'));var rs=require(_0x65e3('0x3'));var fs=require('fs');var Redis=require(_0x65e3('0x4'));var db=require(_0x65e3('0x5'))['db'];var utils=require(_0x65e3('0x6'));var logger=require(_0x65e3('0x7'))(_0x65e3('0x8'));var config=require(_0x65e3('0x9'));var jayson=require(_0x65e3('0xa'));var client=jayson['client'][_0x65e3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a3b49,_0x3852cb,_0x32032d){return new BPromise(function(_0x46fb4e,_0x58f48b){return client[_0x65e3('0xc')](_0x1a3b49,_0x32032d)[_0x65e3('0xd')](function(_0x5aa062){logger['info']('CmCompany,\x20%s,\x20%s',_0x3852cb,'request\x20sent');logger[_0x65e3('0xe')](_0x65e3('0xf'),_0x3852cb,'request\x20sent',JSON[_0x65e3('0x10')](_0x5aa062));if(_0x5aa062['error']){if(_0x5aa062[_0x65e3('0x11')][_0x65e3('0x12')]===0x1f4){logger[_0x65e3('0x11')](_0x65e3('0x13'),_0x3852cb,_0x5aa062[_0x65e3('0x11')][_0x65e3('0x14')]);return _0x58f48b(_0x5aa062[_0x65e3('0x11')]['message']);}logger[_0x65e3('0x11')](_0x65e3('0x13'),_0x3852cb,_0x5aa062[_0x65e3('0x11')]['message']);return _0x46fb4e(_0x5aa062['error']['message']);}else{logger[_0x65e3('0x15')]('CmCompany,\x20%s,\x20%s',_0x3852cb,_0x65e3('0x16'));_0x46fb4e(_0x5aa062[_0x65e3('0x17')][_0x65e3('0x14')]);}})[_0x65e3('0x18')](function(_0x22728a){logger[_0x65e3('0x11')]('CmCompany,\x20%s,\x20%s',_0x3852cb,_0x22728a);_0x58f48b(_0x22728a);});});} \ No newline at end of file +var _0x702b=['lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x702b,0x168));var _0xb702=function(_0x3fa173,_0x40a115){_0x3fa173=_0x3fa173-0x0;var _0x554d4b=_0x702b[_0x3fa173];return _0x554d4b;};'use strict';var _=require(_0xb702('0x0'));var util=require('util');var moment=require(_0xb702('0x1'));var BPromise=require(_0xb702('0x2'));var rs=require(_0xb702('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb702('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb702('0x5'));var config=require(_0xb702('0x6'));var jayson=require(_0xb702('0x7'));var client=jayson[_0xb702('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8e8e52,_0x14d43e,_0xd1a309){return new BPromise(function(_0x6af90f,_0x3418b0){return client['request'](_0x8e8e52,_0xd1a309)['then'](function(_0x580e32){logger[_0xb702('0x9')](_0xb702('0xa'),_0x14d43e,_0xb702('0xb'));logger[_0xb702('0xc')](_0xb702('0xd'),_0x14d43e,_0xb702('0xb'),JSON['stringify'](_0x580e32));if(_0x580e32[_0xb702('0xe')]){if(_0x580e32[_0xb702('0xe')][_0xb702('0xf')]===0x1f4){logger[_0xb702('0xe')](_0xb702('0xa'),_0x14d43e,_0x580e32['error'][_0xb702('0x10')]);return _0x3418b0(_0x580e32[_0xb702('0xe')][_0xb702('0x10')]);}logger[_0xb702('0xe')](_0xb702('0xa'),_0x14d43e,_0x580e32[_0xb702('0xe')][_0xb702('0x10')]);return _0x6af90f(_0x580e32['error'][_0xb702('0x10')]);}else{logger['info'](_0xb702('0xa'),_0x14d43e,'request\x20sent');_0x6af90f(_0x580e32[_0xb702('0x11')][_0xb702('0x10')]);}})['catch'](function(_0x1c5afd){logger[_0xb702('0xe')]('CmCompany,\x20%s,\x20%s',_0x14d43e,_0x1c5afd);_0x3418b0(_0x1c5afd);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index f3730d0..ba81400 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 _0x3610=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/contacts','post','addContacts','put','delete','destroy','exports','util','path','connect-timeout'];(function(_0x529ead,_0x523759){var _0x10c7fb=function(_0x3aa1c3){while(--_0x3aa1c3){_0x529ead['push'](_0x529ead['shift']());}};_0x10c7fb(++_0x523759);}(_0x3610,0x156));var _0x0361=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x3610[_0x3740fe];return _0x55492b;};'use strict';var multer=require('multer');var util=require(_0x0361('0x0'));var path=require(_0x0361('0x1'));var timeout=require(_0x0361('0x2'));var express=require(_0x0361('0x3'));var router=express[_0x0361('0x4')]();var fs_extra=require(_0x0361('0x5'));var auth=require(_0x0361('0x6'));var interaction=require(_0x0361('0x7'));var config=require(_0x0361('0x8'));var controller=require(_0x0361('0x9'));router[_0x0361('0xa')]('/',auth[_0x0361('0xb')](),controller['index']);router[_0x0361('0xa')](_0x0361('0xc'),auth['isAuthenticated'](),controller[_0x0361('0xd')]);router[_0x0361('0xa')](_0x0361('0xe'),auth[_0x0361('0xb')](),controller[_0x0361('0xf')]);router[_0x0361('0xa')](_0x0361('0x10'),auth[_0x0361('0xb')](),controller['getContacts']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x0361('0x11')](_0x0361('0x10'),auth[_0x0361('0xb')](),controller[_0x0361('0x12')]);router[_0x0361('0x13')](_0x0361('0xe'),auth[_0x0361('0xb')](),controller['update']);router[_0x0361('0x14')]('/:id',auth[_0x0361('0xb')](),controller[_0x0361('0x15')]);module[_0x0361('0x16')]=router; \ No newline at end of file +var _0x79bf=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','index','/describe','describe','/:id','isAuthenticated','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','destroy','exports','util'];(function(_0x39bed8,_0xcf6104){var _0x5e4003=function(_0x445372){while(--_0x445372){_0x39bed8['push'](_0x39bed8['shift']());}};_0x5e4003(++_0xcf6104);}(_0x79bf,0x1df));var _0xf79b=function(_0x582210,_0x184c36){_0x582210=_0x582210-0x0;var _0x18cf58=_0x79bf[_0x582210];return _0x18cf58;};'use strict';var multer=require('multer');var util=require(_0xf79b('0x0'));var path=require('path');var timeout=require(_0xf79b('0x1'));var express=require('express');var router=express[_0xf79b('0x2')]();var fs_extra=require(_0xf79b('0x3'));var auth=require(_0xf79b('0x4'));var interaction=require(_0xf79b('0x5'));var config=require(_0xf79b('0x6'));var controller=require(_0xf79b('0x7'));router[_0xf79b('0x8')]('/',auth['isAuthenticated'](),controller[_0xf79b('0x9')]);router[_0xf79b('0x8')](_0xf79b('0xa'),auth['isAuthenticated'](),controller[_0xf79b('0xb')]);router[_0xf79b('0x8')](_0xf79b('0xc'),auth[_0xf79b('0xd')](),controller['show']);router['get'](_0xf79b('0xe'),auth[_0xf79b('0xd')](),controller[_0xf79b('0xf')]);router[_0xf79b('0x10')]('/',auth[_0xf79b('0xd')](),controller[_0xf79b('0x11')]);router[_0xf79b('0x10')]('/:id/contacts',auth[_0xf79b('0xd')](),controller[_0xf79b('0x12')]);router[_0xf79b('0x13')](_0xf79b('0xc'),auth[_0xf79b('0xd')](),controller[_0xf79b('0x14')]);router[_0xf79b('0x15')](_0xf79b('0xc'),auth[_0xf79b('0xd')](),controller[_0xf79b('0x16')]);module[_0xf79b('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 8cf61b0..611eeed 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 _0x663d=['INTEGER','UNSIGNED','NOW','lodash','sequelize','exports','STRING','TEXT'];(function(_0x2764c9,_0x3d5b79){var _0x158aee=function(_0x2b21ef){while(--_0x2b21ef){_0x2764c9['push'](_0x2764c9['shift']());}};_0x158aee(++_0x3d5b79);}(_0x663d,0xdb));var _0xd663=function(_0x3f1f08,_0x5e8f9f){_0x3f1f08=_0x3f1f08-0x0;var _0x51fa34=_0x663d[_0x3f1f08];return _0x51fa34;};'use strict';var _=require(_0xd663('0x0'));var Sequelize=require(_0xd663('0x1'));module[_0xd663('0x2')]={'firstName':{'type':Sequelize[_0xd663('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xd663('0x3')]},'street':{'type':Sequelize[_0xd663('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xd663('0x3')]},'dateOfBirth':{'type':Sequelize[_0xd663('0x3')]},'description':{'type':Sequelize[_0xd663('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xd663('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xd663('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xd663('0x3')]},'skype':{'type':Sequelize[_0xd663('0x3')]},'teams':{'type':Sequelize[_0xd663('0x3')]},'viber':{'type':Sequelize[_0xd663('0x3')]},'line':{'type':Sequelize[_0xd663('0x3')]},'wechat':{'type':Sequelize[_0xd663('0x3')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xd663('0x3')]},'priority':{'type':Sequelize[_0xd663('0x5')](0x2)[_0xd663('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xd663('0x7')]},'dialTimezone':{'type':Sequelize[_0xd663('0x3')]},'utcOffset':{'type':Sequelize[_0xd663('0x5')]}}; \ No newline at end of file +var _0x159f=['NOW','lodash','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x159f,0xf6));var _0xf159=function(_0x352f4b,_0xa59ba5){_0x352f4b=_0x352f4b-0x0;var _0xcb68c4=_0x159f[_0x352f4b];return _0xcb68c4;};'use strict';var _=require(_0xf159('0x0'));var Sequelize=require('sequelize');module[_0xf159('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xf159('0x2')]},'street':{'type':Sequelize[_0xf159('0x2')]},'postalCode':{'type':Sequelize[_0xf159('0x2')]},'city':{'type':Sequelize[_0xf159('0x2')]},'country':{'type':Sequelize[_0xf159('0x2')]},'dateOfBirth':{'type':Sequelize[_0xf159('0x2')]},'description':{'type':Sequelize[_0xf159('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xf159('0x2')]},'fax':{'type':Sequelize[_0xf159('0x2')]},'email':{'type':Sequelize[_0xf159('0x2')]},'url':{'type':Sequelize[_0xf159('0x2')]},'facebook':{'type':Sequelize[_0xf159('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xf159('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xf159('0x2')]},'viber':{'type':Sequelize[_0xf159('0x2')]},'line':{'type':Sequelize[_0xf159('0x2')]},'wechat':{'type':Sequelize[_0xf159('0x2')]},'telegram':{'type':Sequelize[_0xf159('0x2')]},'UserId':{'type':Sequelize[_0xf159('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xf159('0x4')](0x2)[_0xf159('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0xf159('0x6')]},'dialTimezone':{'type':Sequelize[_0xf159('0x2')]},'utcOffset':{'type':Sequelize[_0xf159('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 7c65b9e..3de4593 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 _0x779f=['stack','name','describe','findAll','query','destroy','CmContact','find','catch','tags','keys','startsWith','cf_','columnName','displayName','analytics','CmCustomField','length','alias','custom','type','values','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','hasOwnProperty','merge','body','from','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','contact','show','params','Tag','color','tag','Phones','ContactItemType','ItemType','sequelize','literal','Phones.OrderBy','$and','omit','format','cf_%d','map','table','cm_contacts','setFields','toParam','text','CmHopper','phone','findOne','model','rawAttributes','intersection','attributes','fields','sort','filters','pick','filter','options','getTags','nolimit','setTags','ids','setAdditionalPhones','all','OrderBy','items','item_types','ItemTypeId','CmHopperAdditionalPhone','item','PHONE','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','getHoppers','order','ContactId','includeAll','rows','getHopperHistories','include','getHopperFinals','getJscriptySessions','No\x20ListId\x20specified','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','root','file','filename','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','User','agent','No\x20firstName\x20column\x20specified','../../components/import/cm/csvUpdates','getJourney','openchannel','fax','whatsapp','-createdAt','resolve','channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','voice','uniqueid','source','destination','callerid','starttime','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','VoiceCallReport','findAndCountAll','startCase','chat','Website','Account','closed','closedAt','secondDisposition','key','Owner','Tags','DESC','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','mail','subject','threadId','Interaction','flatten','value','moment','bluebird','util','path','lodash','papaparse','ioredis','../../components/contacts','../../config/logger','../../config/environment','../../config/environment/shared','../../mysqldb','redis','localhost','socket.io-emitter','./cmContact.socket','register','json','offset','limit','undefined','count','status','set','then','end','sendStatus','error'];(function(_0x4ede04,_0x58132b){var _0x49ccfc=function(_0x51a704){while(--_0x51a704){_0x4ede04['push'](_0x4ede04['shift']());}};_0x49ccfc(++_0x58132b);}(_0x779f,0xe1));var _0xf779=function(_0x3e8fd7,_0x5628f4){_0x3e8fd7=_0x3e8fd7-0x0;var _0x452529=_0x779f[_0x3e8fd7];return _0x452529;};'use strict';var moment=require(_0xf779('0x0'));var BPromise=require(_0xf779('0x1'));var util=require(_0xf779('0x2'));var path=require(_0xf779('0x3'));var fs=require('fs');var _=require(_0xf779('0x4'));var squel=require('squel');var Papa=require(_0xf779('0x5'));var Redis=require(_0xf779('0x6'));var contacts=require(_0xf779('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0xf779('0x8'))('api');var config=require(_0xf779('0x9'));var shared=require(_0xf779('0xa'));var db=require(_0xf779('0xb'))['db'];config['redis']=_['defaults'](config[_0xf779('0xc')],{'host':_0xf779('0xd'),'port':0x18eb});var socket=require(_0xf779('0xe'))(new Redis(config['redis']));require(_0xf779('0xf'))[_0xf779('0x10')](socket);function respondWithResult(_0x2f55fb,_0x42e343){_0x42e343=_0x42e343||0xc8;return function(_0x57f411){if(_0x57f411){return _0x2f55fb['status'](_0x42e343)[_0xf779('0x11')](_0x57f411);}};}function respondWithFilteredResult(_0x847786,_0x5bf8e1){return function(_0x51cc89){if(_0x51cc89){var _0x403954=typeof _0x5bf8e1[_0xf779('0x12')]==='undefined'&&typeof _0x5bf8e1[_0xf779('0x13')]===_0xf779('0x14');var _0x435f1f=_0x51cc89['count'];var _0xbcf67b=_0x403954?0x0:_0x5bf8e1[_0xf779('0x12')];var _0x4e3962=_0x403954?_0x51cc89[_0xf779('0x15')]:_0x5bf8e1[_0xf779('0x12')]+_0x5bf8e1['limit'];var _0x2fddd3;if(_0x4e3962>=_0x435f1f){_0x4e3962=_0x435f1f;_0x2fddd3=0xc8;}else{_0x2fddd3=0xce;}_0x847786[_0xf779('0x16')](_0x2fddd3);return _0x847786[_0xf779('0x17')]('Content-Range',_0xbcf67b+'-'+_0x4e3962+'/'+_0x435f1f)[_0xf779('0x11')](_0x51cc89);}return null;};}function saveUpdates(_0x3579af){return function(_0x3eefce){if(_0x3eefce){return _0x3eefce['update'](_0x3579af)['then'](function(_0x1fc00a){return _0x1fc00a;});}return null;};}function removeEntity(_0x3ece54){return function(_0x4348da){if(_0x4348da){return _0x4348da['destroy']()[_0xf779('0x18')](function(){_0x3ece54[_0xf779('0x16')](0xcc)[_0xf779('0x19')]();});}};}function handleEntityNotFound(_0x1e0064){return function(_0xb41d50){if(!_0xb41d50){_0x1e0064[_0xf779('0x1a')](0x194);}return _0xb41d50;};}function handleError(_0x478913,_0x7e0927){_0x7e0927=_0x7e0927||0x1f4;return function(_0x3990e0){logger[_0xf779('0x1b')](_0x3990e0[_0xf779('0x1c')]);if(_0x3990e0[_0xf779('0x1d')]){delete _0x3990e0[_0xf779('0x1d')];}_0x478913[_0xf779('0x16')](_0x7e0927)['send'](_0x3990e0);};}exports['index']=function(_0x1ce74a,_0x5c9ec3){var _0x190bf5={};return contacts[_0xf779('0x1e')]()[_0xf779('0x18')](function(_0x2022f9){_0x190bf5=qs['getOptions'](_0x2022f9,_0x1ce74a);return contacts[_0xf779('0x1f')](_0x1ce74a[_0xf779('0x20')],_0x1ce74a['user'],_0x190bf5,_0x2022f9);})[_0xf779('0x18')](respondWithFilteredResult(_0x5c9ec3,_0x190bf5))['catch'](handleError(_0x5c9ec3,null));};exports[_0xf779('0x21')]=function(_0x53016d,_0x3aca3c){return db[_0xf779('0x22')][_0xf779('0x23')]({'where':{'id':_0x53016d['params']['id']}})['then'](handleEntityNotFound(_0x3aca3c,null))[_0xf779('0x18')](removeEntity(_0x3aca3c,null))[_0xf779('0x24')](handleError(_0x3aca3c,null));};exports[_0xf779('0x1e')]=function(_0x2417ed,_0xfce05){return db[_0xf779('0x22')][_0xf779('0x1e')]()['then'](function(_0x2a4fc9){delete _0x2a4fc9[_0xf779('0x25')];for(var _0xa97f12=0x0;_0xa97f120x0){return new Promise(function(_0x581be7){var _0x308d92=[];for(var _0x4d53a0=0x0;_0x4d53a0<_0x46fdb6[_0xf779('0x2d')];_0x4d53a0++){_0x308d92[_0xf779('0x5e')](insertAdditionalPhones(_0x46fdb6[_0x4d53a0][_0xf779('0x62')],_0x46fdb6[_0x4d53a0][_0xf779('0x59')]));}Promise['all'](_0x308d92)[_0xf779('0x18')](function(){_0x581be7(0x1);});})[_0xf779('0x18')](function(){return{'success':_0x2d9142,'failure':_0x168059,'duplicates':_0x26cc1f};});}else{return{'success':_0x2d9142,'failure':_0x168059,'duplicates':_0x26cc1f};}}})[_0xf779('0x18')](respondWithResult(_0x270c88,0xc9))[_0xf779('0x24')](handleError(_0x270c88,null));};exports[_0xf779('0x63')]=function(_0x451b29,_0x2562df){var _0x4ebad4;return db[_0xf779('0x22')][_0xf779('0x1e')]()[_0xf779('0x18')](function(_0x1e3e9e){return db[_0xf779('0x22')][_0xf779('0x23')]({'where':{'id':_0x451b29[_0xf779('0x64')]['id']},'include':[{'model':db[_0xf779('0x65')],'as':'Tags','attributes':['id','name',_0xf779('0x66')],'required':_0x451b29[_0xf779('0x20')][_0xf779('0x67')]?!![]:![]},{'model':db[_0xf779('0x4a')],'as':_0xf779('0x68'),'where':{'CmContactId':_0x451b29[_0xf779('0x64')]['id']},'required':![],'include':[{'model':db[_0xf779('0x69')],'as':_0xf779('0x6a')}]}],'order':[db[_0xf779('0x6b')][_0xf779('0x6c')](_0xf779('0x6d'))],'attributes':_[_0xf779('0x26')](_0x1e3e9e)});})[_0xf779('0x18')](function(_0x428653){if(!_[_0xf779('0x55')](_0x428653)){_0x4ebad4=_0x428653[_0xf779('0x38')]({'plain':!![]});var _0x32dc69={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x428653&&_0x428653[_0xf779('0x5f')]){if(_0x428653[_0xf779('0x5f')]){_0x32dc69['where'][_0xf779('0x6e')][_0xf779('0x5e')]({'ListId':{'$ne':_0x428653[_0xf779('0x5f')]}});}}return db[_0xf779('0x2c')][_0xf779('0x1f')](_0x32dc69);}})['then'](function(_0x30ed2b){if(!_['isNil'](_0x30ed2b)){return _[_0xf779('0x6f')](_0x4ebad4,_['map'](_0x30ed2b,function(_0x587595){return util[_0xf779('0x70')](_0xf779('0x71'),_0x587595['id']);}));}})['then'](handleEntityNotFound(_0x2562df,null))[_0xf779('0x18')](respondWithResult(_0x2562df,null))[_0xf779('0x24')](handleError(_0x2562df,null));};exports[_0xf779('0x40')]=function(_0x36616e,_0x33090d){var _0x2f0001;if(_0x36616e['body']['id']){delete _0x36616e[_0xf779('0x36')]['id'];}if(!_[_0xf779('0x55')](_0x36616e[_0xf779('0x36')][_0xf779('0x56')])){var _0x194aa0=_0x36616e[_0xf779('0x36')][_0xf779('0x56')];if(!_[_0xf779('0x55')](shared[_0xf779('0x57')][_0x194aa0]))_0x36616e[_0xf779('0x36')][_0xf779('0x58')]=shared[_0xf779('0x57')][_0x194aa0]['utcOffset'];}return db[_0xf779('0x22')]['find']({'where':{'id':_0x36616e[_0xf779('0x64')]['id']}})['then'](handleEntityNotFound(_0x33090d,null))[_0xf779('0x18')](saveUpdates(_0x36616e[_0xf779('0x36')],null))[_0xf779('0x18')](function(_0x594991){_0x2f0001=_0x594991;var _0x4ff2e5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x594991&&_0x594991[_0xf779('0x5f')]){if(_0x594991[_0xf779('0x5f')]){_0x4ff2e5[_0xf779('0x5c')][_0xf779('0x6e')][_0xf779('0x5e')]({'ListId':{'$ne':_0x594991[_0xf779('0x5f')]}});}}return db[_0xf779('0x2c')][_0xf779('0x1f')](_0x4ff2e5);})[_0xf779('0x18')](function(_0x365df7){if(_0x365df7){return _[_0xf779('0x6f')](_['pickBy'](_0x36616e[_0xf779('0x36')],function(_0xe496c,_0x305d48){return _[_0xf779('0x27')](_0x305d48,_0xf779('0x28'));}),_[_0xf779('0x72')](_0x365df7,function(_0x23c760){return util[_0xf779('0x70')](_0xf779('0x71'),_0x23c760['id']);}));}})[_0xf779('0x18')](function(_0x2e9e5b){if(_0x2e9e5b&&!_['isEmpty'](_0x2e9e5b)){var _0x17eecf=squel[_0xf779('0x40')]()[_0xf779('0x73')](_0xf779('0x74'))[_0xf779('0x75')](_0x2e9e5b)[_0xf779('0x5c')]('id\x20=\x20?',_0x36616e[_0xf779('0x64')]['id'])[_0xf779('0x76')]();return db['sequelize'][_0xf779('0x20')](_0x17eecf[_0xf779('0x77')],{'replacements':_0x17eecf[_0xf779('0x31')]});}})['then'](function(){if(_0x36616e['body']['phone']&&_0x2f0001){return db[_0xf779('0x78')][_0xf779('0x40')]({'phone':_0x36616e[_0xf779('0x36')][_0xf779('0x79')],'OrderBy':0x0},{'where':{'ContactId':_0x2f0001['id']}});}})[_0xf779('0x18')](function(){return _0x2f0001;})['then'](respondWithResult(_0x33090d,null))[_0xf779('0x24')](handleError(_0x33090d,null));};exports['getTags']=function(_0x18b16d,_0x5e7530){var _0x276573={};var _0x302cb4={};var _0x4056c4;var _0x2982eb;return db[_0xf779('0x22')][_0xf779('0x7a')]({'where':{'id':_0x18b16d[_0xf779('0x64')]['id']}})['then'](handleEntityNotFound(_0x5e7530,null))[_0xf779('0x18')](function(_0x176bde){if(_0x176bde){_0x4056c4=_0x176bde;_0x302cb4[_0xf779('0x7b')]=_['keys'](db[_0xf779('0x65')][_0xf779('0x7c')]);_0x302cb4[_0xf779('0x20')]=_[_0xf779('0x26')](_0x18b16d['query']);_0x302cb4['filters']=_[_0xf779('0x7d')](_0x302cb4[_0xf779('0x7b')],_0x302cb4['query']);_0x276573[_0xf779('0x7e')]=_[_0xf779('0x7d')](_0x302cb4[_0xf779('0x7b')],qs[_0xf779('0x7f')](_0x18b16d[_0xf779('0x20')][_0xf779('0x7f')]));_0x276573['attributes']=_0x276573['attributes'][_0xf779('0x2d')]?_0x276573[_0xf779('0x7e')]:_0x302cb4['model'];_0x276573['order']=qs[_0xf779('0x80')](_0x18b16d[_0xf779('0x20')][_0xf779('0x80')]);_0x276573['where']=qs[_0xf779('0x81')](_[_0xf779('0x82')](_0x18b16d['query'],_0x302cb4['filters']));if(_0x18b16d[_0xf779('0x20')][_0xf779('0x83')]){_0x276573[_0xf779('0x5c')]=_['merge'](_0x276573[_0xf779('0x5c')],{'$or':_['map'](_0x276573[_0xf779('0x7e')],function(_0x2dedbd){var _0x21baba={};_0x21baba[_0x2dedbd]={'$like':'%'+_0x18b16d[_0xf779('0x20')][_0xf779('0x83')]+'%'};return _0x21baba;})});}_0x276573=_[_0xf779('0x35')]({},_0x276573,_0x18b16d[_0xf779('0x84')]);return _0x4056c4[_0xf779('0x85')](_0x276573);}})[_0xf779('0x18')](function(_0x510fa4){if(_0x510fa4){_0x2982eb=_0x510fa4['length'];if(!_0x18b16d[_0xf779('0x20')]['hasOwnProperty'](_0xf779('0x86'))){_0x276573['limit']=qs[_0xf779('0x13')](_0x18b16d[_0xf779('0x20')][_0xf779('0x13')]);_0x276573[_0xf779('0x12')]=qs['offset'](_0x18b16d[_0xf779('0x20')][_0xf779('0x12')]);}return _0x4056c4[_0xf779('0x85')](_0x276573);}})[_0xf779('0x18')](function(_0xa941e4){if(_0xa941e4){return _0xa941e4?{'count':_0x2982eb,'rows':_0xa941e4}:null;}})[_0xf779('0x18')](respondWithResult(_0x5e7530,null))[_0xf779('0x24')](handleError(_0x5e7530,null));};exports['setTags']=function(_0x40711,_0x2c182c){if(_0x40711[_0xf779('0x36')]['id']){delete _0x40711[_0xf779('0x36')]['id'];}return db[_0xf779('0x22')]['findOne']({'where':{'id':_0x40711['params']['id']}})[_0xf779('0x18')](handleEntityNotFound(_0x2c182c,null))[_0xf779('0x18')](function(_0x1bb72f){if(_0x1bb72f){return _0x1bb72f[_0xf779('0x87')](_0x40711[_0xf779('0x36')][_0xf779('0x88')]||[]);}return null;})['then'](respondWithResult(_0x2c182c,null))[_0xf779('0x24')](handleError(_0x2c182c,null));};exports[_0xf779('0x89')]=function(_0x254497,_0x4a1f31){var _0xd397c5=[];_0xd397c5[_0xf779('0x5e')](addAdditionalPhones(_0x254497[_0xf779('0x36')]));Promise[_0xf779('0x8a')](_0xd397c5)['then'](function(){_0xd397c5=[];_0xd397c5[_0xf779('0x5e')](deleteCmHopperPhones(_0x254497[_0xf779('0x36')]['id']));_0xd397c5[_0xf779('0x5e')](addCmHopperPhones(_0x254497[_0xf779('0x36')]['id']));Promise[_0xf779('0x8a')](_0xd397c5)['then'](function(){return[0x1];})[_0xf779('0x18')](respondWithResult(_0x4a1f31,null));});};function addAdditionalPhones(_0x3b1699){var _0x580985;return new Promise(function(_0x2d659d){return db[_0xf779('0x4a')][_0xf779('0x21')]({'where':{'CmContactId':_0x3b1699['id']}})['then'](function(){db[_0xf779('0x69')][_0xf779('0x1f')]({'raw':!![],'attributes':['id',_0xf779('0x8b')]})['then'](function(_0x548a8f){var _0x36301b=[];for(var _0x4a7fc2=0x0;_0x4a7fc2<_0x3b1699[_0xf779('0x8c')][_0xf779('0x2d')];_0x4a7fc2++){var _0x19c298=_0x3b1699[_0xf779('0x8d')]?_[_0xf779('0x55')](_0x3b1699[_0xf779('0x8d')][_0x4a7fc2])?'':_0x3b1699[_0xf779('0x8d')][_0x4a7fc2]:_0x3b1699['items'][_0x4a7fc2][_0xf779('0x8e')]?_0x3b1699[_0xf779('0x8c')][_0x4a7fc2][_0xf779('0x8e')]:'';var _0x12513b=_[_0xf779('0x55')](_0x3b1699[_0xf779('0x8c')][_0x4a7fc2]['description'])?'':_0x3b1699['items'][_0x4a7fc2]['description'];var _0x2703d7=_0x19c298+':'+_0x3b1699['items'][_0x4a7fc2][_0xf779('0x79')]+'§'+_0x12513b;if(_[_0xf779('0x55')](_0x580985))_0x580985=_0x2703d7;else _0x580985+=';'+_0x2703d7;var _0x18e0aa=null;var _0x2397c2=null;if(_0x3b1699['item_types']){if(!_['isNil'](_0x3b1699['item_types'][_0x4a7fc2])){_0x2397c2=_[_0xf779('0x23')](_0x548a8f,function(_0x11c3f5){return _0x11c3f5['id']===_0x3b1699[_0xf779('0x8d')][_0x4a7fc2];});if(!_[_0xf779('0x55')](_0x2397c2)){_0x18e0aa=_0x2397c2[_0xf779('0x8b')];}}}else{if(!_[_0xf779('0x55')](_0x3b1699[_0xf779('0x8c')][_0x4a7fc2])){_0x2397c2=_[_0xf779('0x23')](_0x548a8f,function(_0x2382da){return _0x2382da['id']===_0x3b1699[_0xf779('0x8c')][_0x4a7fc2][_0xf779('0x8e')];});if(!_['isNil'](_0x2397c2)){_0x18e0aa=_0x4a7fc2;}}}if(_[_0xf779('0x55')](_0x18e0aa)){_0x18e0aa=0x64;}_0x36301b['push'](addAdditionalPhone(_0x3b1699['id'],_0x3b1699['items'][_0x4a7fc2][_0xf779('0x79')],_0x3b1699[_0xf779('0x8d')]?_[_0xf779('0x55')](_0x3b1699['item_types'][_0x4a7fc2])?null:_0x3b1699[_0xf779('0x8d')][_0x4a7fc2]:_0x3b1699['items'][_0x4a7fc2][_0xf779('0x8e')]?_0x3b1699['items'][_0x4a7fc2][_0xf779('0x8e')]:null,_0x18e0aa,_0x12513b));}Promise['all'](_0x36301b)[_0xf779('0x18')](function(){db['CmContact'][_0xf779('0x40')]({'AdditionalPhones':_0x580985},{'where':{'id':_0x3b1699['id']}})[_0xf779('0x18')](function(){_0x2d659d(0x1);});});});});});}function addAdditionalPhone(_0x20adaf,_0x26c8d3,_0x5df404,_0x427472,_0xb49703){return db['CmContactHasItem']['find']({'where':{'CmContactId':_0x20adaf,'item':_0x26c8d3}})[_0xf779('0x18')](function(_0x53dd73){if(_0x53dd73)logger['info']('contact\x20phone\x20exists',_0x53dd73);else{db[_0xf779('0x4a')][_0xf779('0x3f')]({'CmContactId':_0x20adaf,'item':_0x26c8d3,'ItemTypeId':_0x5df404,'OrderBy':_0x427472,'ItemClass':'PHONE','description':_0xb49703});}});}function deleteCmHopperPhones(_0x50fb71){return new Promise(function(_0x34e069){return db[_0xf779('0x78')][_0xf779('0x1f')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x50fb71}})[_0xf779('0x18')](function(_0x4c13a4){db[_0xf779('0x8f')][_0xf779('0x21')]({'where':{'CmHopperId':{'$in':_[_0xf779('0x72')](_0x4c13a4,'id')}}});})[_0xf779('0x18')](function(){_0x34e069(0x1);});});}function addCmHopperPhones(_0x5a8819){return new Promise(function(_0x1b75e0){return db[_0xf779('0x78')][_0xf779('0x1f')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x5a8819}})[_0xf779('0x18')](function(_0x4a7667){var _0x6c50c3=[];_[_0xf779('0x72')](_0x4a7667,function(_0x29fea8){_0x6c50c3[_0xf779('0x5e')](createCmHopperPhone(_0x5a8819,_0x29fea8['id']));});Promise['all'](_0x6c50c3)[_0xf779('0x18')](function(){_0x1b75e0(0x1);});});});}function createCmHopperPhone(_0x1a2e8b,_0x5197bc){return new Promise(function(_0x5e23b1){db[_0xf779('0x4a')]['findAll']({'raw':!![],'attributes':[_0xf779('0x90'),_0xf779('0x8b')],'where':{'CmContactId':_0x1a2e8b,'ItemClass':_0xf779('0x91')},'include':[{'model':db[_0xf779('0x69')],'attributes':['OrderBy'],'as':_0xf779('0x6a')}],'order':['OrderBy',db[_0xf779('0x6b')][_0xf779('0x6c')](_0xf779('0x92'))]})[_0xf779('0x18')](function(_0x1dba46){var _0x51b99f=0x1;var _0x53173b=_['map'](_0x1dba46,function(_0x1edbf6){_0x1edbf6[_0xf779('0x93')]=_0x5197bc;_0x1edbf6['phone']=_0x1edbf6[_0xf779('0x90')];_0x1edbf6[_0xf779('0x8b')]=_0x51b99f;delete _0x1edbf6[_0xf779('0x94')];_0x51b99f=_0x51b99f+0x1;return _0x1edbf6;});return db[_0xf779('0x8f')][_0xf779('0x5a')](_0x53173b,{});})[_0xf779('0x18')](function(){_0x5e23b1(0x1);});});}function insertAdditionalPhones(_0x8fde33,_0x1f4b8a){return new Promise(function(_0x580001){var _0x4e5608=[];for(var _0x5c2721=0x0;_0x5c2721<_0x1f4b8a[_0xf779('0x2d')];_0x5c2721++){var _0x4b37e9=_0x1f4b8a[_0x5c2721];_0x4e5608['push'](parseContactItemType(_0x4b37e9));}Promise[_0xf779('0x8a')](_0x4e5608)[_0xf779('0x18')](function(){var _0x410bef={'id':_0x8fde33['id'],'items':_0x1f4b8a};return addAdditionalPhones(_0x410bef)[_0xf779('0x18')](function(){return addCmHopperPhones(_0x8fde33['id']);});})[_0xf779('0x18')](function(){_0x580001(_0x8fde33);});});}function parseContactItemType(_0x25cb9a){return new Promise(function(_0x1106b6){if(_0x25cb9a[_0xf779('0x34')](_0xf779('0x8e'))){_0x1106b6(_0x25cb9a);}else{return db[_0xf779('0x69')][_0xf779('0x23')]({'where':{'name':_0x25cb9a[_0xf779('0x6a')]}})[_0xf779('0x18')](function(_0xc9eeca){if(_[_0xf779('0x55')](_0xc9eeca))_0x25cb9a[_0xf779('0x8e')]=null;else _0x25cb9a[_0xf779('0x8e')]=_0xc9eeca['id'];_0x1106b6(_0x25cb9a);});}});}exports[_0xf779('0x95')]=function(_0x50e3e5,_0x127de0){return db[_0xf779('0x4a')][_0xf779('0x1f')]({'raw':!![],'where':{'CmContactId':_0x50e3e5[_0xf779('0x64')]['id'],'ItemClass':_0xf779('0x91')},'include':[{'model':db[_0xf779('0x69')],'as':_0xf779('0x6a')}],'order':[['OrderBy'],[db[_0xf779('0x6b')][_0xf779('0x6c')]('`ItemType`.OrderBy')]]})[_0xf779('0x18')](function(_0x1ef077){return _0x1ef077;})[_0xf779('0x18')](respondWithResult(_0x127de0,null))[_0xf779('0x24')](handleError(_0x127de0,null));};exports[_0xf779('0x96')]=function(_0x50e078,_0x404d7d){return db[_0xf779('0x4a')][_0xf779('0x1f')]({'raw':!![],'where':{'CmContactId':_0x50e078[_0xf779('0x36')][_0xf779('0x97')]}})[_0xf779('0x18')](function(_0x3f1584){var _0x1c10d9=_['map'](_0x3f1584,function(_0x3c8fbd){_0x3c8fbd[_0xf779('0x98')]=_0x50e078[_0xf779('0x36')][_0xf779('0x99')];return _0x3c8fbd;});return db[_0xf779('0x4a')]['bulkCreate'](_0x1c10d9,{});})['then'](function(){return addCmHopperPhones(_0x50e078[_0xf779('0x36')][_0xf779('0x99')]);})[_0xf779('0x18')](function(){return['ok'];})[_0xf779('0x18')](respondWithResult(_0x404d7d,null))[_0xf779('0x24')](handleError(_0x404d7d,null));};exports['rescheduleAdditionalPhones']=function(_0x56ccc9,_0x3e085e){var _0x5c8277=[];_0x5c8277['push'](createCmHopperPhone(_0x56ccc9[_0xf779('0x36')]['id'],_0x56ccc9[_0xf779('0x36')]['hopperId']));Promise[_0xf779('0x8a')](_0x5c8277)[_0xf779('0x18')](function(){return[0x1];})[_0xf779('0x18')](respondWithResult(_0x3e085e,null));};exports[_0xf779('0x9a')]=function(_0x1b00ad,_0x2c53cd){var _0x8b5996={'raw':![],'where':{}};var _0x1a74b3={};var _0x5cdff={'count':0x0,'rows':[]};return db[_0xf779('0x22')]['findOne']({'where':{'id':_0x1b00ad[_0xf779('0x64')]['id']}})[_0xf779('0x18')](handleEntityNotFound(_0x2c53cd,null))[_0xf779('0x18')](function(_0xb48d89){if(_0xb48d89){_0x1a74b3['model']=_[_0xf779('0x26')](db['CmHopper'][_0xf779('0x7c')]);_0x1a74b3[_0xf779('0x20')]=_[_0xf779('0x26')](_0x1b00ad[_0xf779('0x20')]);_0x1a74b3[_0xf779('0x81')]=_[_0xf779('0x7d')](_0x1a74b3[_0xf779('0x7b')],_0x1a74b3[_0xf779('0x20')]);_0x8b5996[_0xf779('0x7e')]=_[_0xf779('0x7d')](_0x1a74b3['model'],qs[_0xf779('0x7f')](_0x1b00ad[_0xf779('0x20')][_0xf779('0x7f')]));_0x8b5996[_0xf779('0x7e')]=_0x8b5996[_0xf779('0x7e')][_0xf779('0x2d')]?_0x8b5996[_0xf779('0x7e')]:_0x1a74b3[_0xf779('0x7b')];if(!_0x1b00ad[_0xf779('0x20')][_0xf779('0x34')](_0xf779('0x86'))){_0x8b5996['limit']=qs[_0xf779('0x13')](_0x1b00ad['query']['limit']);_0x8b5996[_0xf779('0x12')]=qs[_0xf779('0x12')](_0x1b00ad[_0xf779('0x20')][_0xf779('0x12')]);}_0x8b5996[_0xf779('0x9b')]=qs[_0xf779('0x80')](_0x1b00ad['query']['sort']);_0x8b5996[_0xf779('0x5c')]=qs[_0xf779('0x81')](_[_0xf779('0x82')](_0x1b00ad['query'],_0x1a74b3[_0xf779('0x81')]));_0x8b5996[_0xf779('0x5c')][_0xf779('0x9c')]=_0xb48d89['id'];if(_0x1b00ad[_0xf779('0x20')]['filter']){_0x8b5996[_0xf779('0x5c')]=_[_0xf779('0x35')](_0x8b5996[_0xf779('0x5c')],{'$or':_[_0xf779('0x72')](_0x8b5996[_0xf779('0x7e')],function(_0x47a666){var _0x2ae7ea={};_0x2ae7ea[_0x47a666]={'$like':'%'+_0x1b00ad[_0xf779('0x20')][_0xf779('0x83')]+'%'};return _0x2ae7ea;})});}_0x8b5996=_['merge']({},_0x8b5996,_0x1b00ad[_0xf779('0x84')]);return db[_0xf779('0x78')][_0xf779('0x15')]({'where':_0x8b5996[_0xf779('0x5c')]})[_0xf779('0x18')](function(_0x1d0412){_0x5cdff[_0xf779('0x15')]=_0x1d0412;if(_0x1b00ad[_0xf779('0x20')][_0xf779('0x9d')]){_0x8b5996['include']=[{'all':!![]}];}return db[_0xf779('0x78')][_0xf779('0x1f')](_0x8b5996);})[_0xf779('0x18')](function(_0x1f8d6a){_0x5cdff[_0xf779('0x9e')]=_0x1f8d6a;return _0x5cdff;});}})[_0xf779('0x18')](respondWithFilteredResult(_0x2c53cd,_0x8b5996))[_0xf779('0x24')](handleError(_0x2c53cd,null));};exports[_0xf779('0x9f')]=function(_0x365c44,_0x497aee){var _0x29b3fc={'raw':!![],'where':{}};var _0x4f101c={};var _0x47948c={'count':0x0,'rows':[]};return db[_0xf779('0x22')]['findOne']({'where':{'id':_0x365c44[_0xf779('0x64')]['id']}})[_0xf779('0x18')](handleEntityNotFound(_0x497aee,null))[_0xf779('0x18')](function(_0x8bc9e0){if(_0x8bc9e0){_0x4f101c[_0xf779('0x7b')]=_[_0xf779('0x26')](db[_0xf779('0x4c')][_0xf779('0x7c')]);_0x4f101c[_0xf779('0x20')]=_[_0xf779('0x26')](_0x365c44[_0xf779('0x20')]);_0x4f101c['filters']=_[_0xf779('0x7d')](_0x4f101c[_0xf779('0x7b')],_0x4f101c[_0xf779('0x20')]);_0x29b3fc[_0xf779('0x7e')]=_[_0xf779('0x7d')](_0x4f101c[_0xf779('0x7b')],qs[_0xf779('0x7f')](_0x365c44[_0xf779('0x20')][_0xf779('0x7f')]));_0x29b3fc[_0xf779('0x7e')]=_0x29b3fc[_0xf779('0x7e')][_0xf779('0x2d')]?_0x29b3fc[_0xf779('0x7e')]:_0x4f101c[_0xf779('0x7b')];if(!_0x365c44['query']['hasOwnProperty'](_0xf779('0x86'))){_0x29b3fc['limit']=qs[_0xf779('0x13')](_0x365c44[_0xf779('0x20')][_0xf779('0x13')]);_0x29b3fc['offset']=qs[_0xf779('0x12')](_0x365c44[_0xf779('0x20')][_0xf779('0x12')]);}_0x29b3fc[_0xf779('0x9b')]=qs[_0xf779('0x80')](_0x365c44[_0xf779('0x20')][_0xf779('0x80')]);_0x29b3fc[_0xf779('0x5c')]=qs[_0xf779('0x81')](_[_0xf779('0x82')](_0x365c44[_0xf779('0x20')],_0x4f101c[_0xf779('0x81')]));_0x29b3fc[_0xf779('0x5c')][_0xf779('0x9c')]=_0x8bc9e0['id'];if(_0x365c44[_0xf779('0x20')][_0xf779('0x83')]){_0x29b3fc[_0xf779('0x5c')]=_[_0xf779('0x35')](_0x29b3fc['where'],{'$or':_[_0xf779('0x72')](_0x29b3fc[_0xf779('0x7e')],function(_0x5af600){var _0x1145e8={};_0x1145e8[_0x5af600]={'$like':'%'+_0x365c44[_0xf779('0x20')][_0xf779('0x83')]+'%'};return _0x1145e8;})});}_0x29b3fc=_[_0xf779('0x35')]({},_0x29b3fc,_0x365c44[_0xf779('0x84')]);return db[_0xf779('0x4c')]['count']({'where':_0x29b3fc['where']})[_0xf779('0x18')](function(_0x2fafe7){_0x47948c[_0xf779('0x15')]=_0x2fafe7;if(_0x365c44[_0xf779('0x20')][_0xf779('0x9d')]){_0x29b3fc[_0xf779('0xa0')]=[{'all':!![]}];}return db[_0xf779('0x4c')][_0xf779('0x1f')](_0x29b3fc);})[_0xf779('0x18')](function(_0x54e18e){_0x47948c[_0xf779('0x9e')]=_0x54e18e;return _0x47948c;});}})[_0xf779('0x18')](respondWithFilteredResult(_0x497aee,_0x29b3fc))[_0xf779('0x24')](handleError(_0x497aee,null));};exports[_0xf779('0xa1')]=function(_0x395683,_0x3c9b4b){var _0x6fdeeb={'raw':!![],'where':{}};var _0x1448fa={};var _0x36d439={'count':0x0,'rows':[]};return db[_0xf779('0x22')][_0xf779('0x7a')]({'where':{'id':_0x395683[_0xf779('0x64')]['id']}})[_0xf779('0x18')](handleEntityNotFound(_0x3c9b4b,null))[_0xf779('0x18')](function(_0x5f2c91){if(_0x5f2c91){_0x1448fa[_0xf779('0x7b')]=_['keys'](db[_0xf779('0x4b')]['rawAttributes']);_0x1448fa[_0xf779('0x20')]=_['keys'](_0x395683[_0xf779('0x20')]);_0x1448fa[_0xf779('0x81')]=_[_0xf779('0x7d')](_0x1448fa[_0xf779('0x7b')],_0x1448fa[_0xf779('0x20')]);_0x6fdeeb[_0xf779('0x7e')]=_[_0xf779('0x7d')](_0x1448fa['model'],qs[_0xf779('0x7f')](_0x395683[_0xf779('0x20')][_0xf779('0x7f')]));_0x6fdeeb[_0xf779('0x7e')]=_0x6fdeeb['attributes'][_0xf779('0x2d')]?_0x6fdeeb[_0xf779('0x7e')]:_0x1448fa['model'];if(!_0x395683[_0xf779('0x20')]['hasOwnProperty'](_0xf779('0x86'))){_0x6fdeeb[_0xf779('0x13')]=qs[_0xf779('0x13')](_0x395683['query'][_0xf779('0x13')]);_0x6fdeeb[_0xf779('0x12')]=qs[_0xf779('0x12')](_0x395683[_0xf779('0x20')]['offset']);}_0x6fdeeb[_0xf779('0x9b')]=qs[_0xf779('0x80')](_0x395683['query'][_0xf779('0x80')]);_0x6fdeeb['where']=qs[_0xf779('0x81')](_[_0xf779('0x82')](_0x395683[_0xf779('0x20')],_0x1448fa[_0xf779('0x81')]));_0x6fdeeb[_0xf779('0x5c')][_0xf779('0x9c')]=_0x5f2c91['id'];if(_0x395683[_0xf779('0x20')]['filter']){_0x6fdeeb[_0xf779('0x5c')]=_[_0xf779('0x35')](_0x6fdeeb[_0xf779('0x5c')],{'$or':_['map'](_0x6fdeeb[_0xf779('0x7e')],function(_0x230fee){var _0x1eac67={};_0x1eac67[_0x230fee]={'$like':'%'+_0x395683[_0xf779('0x20')]['filter']+'%'};return _0x1eac67;})});}_0x6fdeeb=_['merge']({},_0x6fdeeb,_0x395683['options']);return db[_0xf779('0x4b')][_0xf779('0x15')]({'where':_0x6fdeeb['where']})[_0xf779('0x18')](function(_0x32dc1d){_0x36d439[_0xf779('0x15')]=_0x32dc1d;if(_0x395683[_0xf779('0x20')][_0xf779('0x9d')]){_0x6fdeeb[_0xf779('0xa0')]=[{'all':!![]}];}return db[_0xf779('0x4b')][_0xf779('0x1f')](_0x6fdeeb);})[_0xf779('0x18')](function(_0x6c78f3){_0x36d439[_0xf779('0x9e')]=_0x6c78f3;return _0x36d439;});}})[_0xf779('0x18')](respondWithFilteredResult(_0x3c9b4b,_0x6fdeeb))['catch'](handleError(_0x3c9b4b,null));};exports[_0xf779('0xa2')]=function(_0x36c83f,_0x2d9fc0){var _0x1ab75a={'raw':!![],'where':{}};var _0x3ab382={};var _0x2c064c={'count':0x0,'rows':[]};return db['CmContact'][_0xf779('0x7a')]({'where':{'id':_0x36c83f['params']['id']}})['then'](handleEntityNotFound(_0x2d9fc0,null))[_0xf779('0x18')](function(_0x713d17){if(_0x713d17){_0x3ab382['model']=_[_0xf779('0x26')](db[_0xf779('0x52')][_0xf779('0x7c')]);_0x3ab382['query']=_[_0xf779('0x26')](_0x36c83f[_0xf779('0x20')]);_0x3ab382[_0xf779('0x81')]=_[_0xf779('0x7d')](_0x3ab382[_0xf779('0x7b')],_0x3ab382[_0xf779('0x20')]);_0x1ab75a[_0xf779('0x7e')]=_[_0xf779('0x7d')](_0x3ab382['model'],qs['fields'](_0x36c83f[_0xf779('0x20')][_0xf779('0x7f')]));_0x1ab75a[_0xf779('0x7e')]=_0x1ab75a[_0xf779('0x7e')][_0xf779('0x2d')]?_0x1ab75a[_0xf779('0x7e')]:_0x3ab382[_0xf779('0x7b')];if(!_0x36c83f[_0xf779('0x20')][_0xf779('0x34')]('nolimit')){_0x1ab75a['limit']=qs['limit'](_0x36c83f[_0xf779('0x20')][_0xf779('0x13')]);_0x1ab75a['offset']=qs['offset'](_0x36c83f[_0xf779('0x20')][_0xf779('0x12')]);}_0x1ab75a['order']=qs[_0xf779('0x80')](_0x36c83f[_0xf779('0x20')][_0xf779('0x80')]);_0x1ab75a[_0xf779('0x5c')]=qs[_0xf779('0x81')](_['pick'](_0x36c83f[_0xf779('0x20')],_0x3ab382[_0xf779('0x81')]));_0x1ab75a[_0xf779('0x5c')][_0xf779('0x9c')]=_0x713d17['id'];if(_0x36c83f[_0xf779('0x20')][_0xf779('0x83')]){_0x1ab75a['where']=_[_0xf779('0x35')](_0x1ab75a['where'],{'$or':_[_0xf779('0x72')](_0x1ab75a[_0xf779('0x7e')],function(_0x4a5591){var _0x2f70ee={};_0x2f70ee[_0x4a5591]={'$like':'%'+_0x36c83f[_0xf779('0x20')]['filter']+'%'};return _0x2f70ee;})});}_0x1ab75a=_['merge']({},_0x1ab75a,_0x36c83f[_0xf779('0x84')]);return db[_0xf779('0x52')][_0xf779('0x15')]({'where':_0x1ab75a[_0xf779('0x5c')]})[_0xf779('0x18')](function(_0x108fae){_0x2c064c[_0xf779('0x15')]=_0x108fae;if(_0x36c83f[_0xf779('0x20')][_0xf779('0x9d')]){_0x1ab75a[_0xf779('0xa0')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x1ab75a);})[_0xf779('0x18')](function(_0x482185){_0x2c064c[_0xf779('0x9e')]=_0x482185;return _0x2c064c;});}})[_0xf779('0x18')](respondWithFilteredResult(_0x2d9fc0,_0x1ab75a))[_0xf779('0x24')](handleError(_0x2d9fc0,null));};exports['uploadCsv']=function(_0x4e9ff6,_0x50f1cf){try{if(!_0x4e9ff6[_0xf779('0x36')][_0xf779('0x5f')]){throw new Error(_0xf779('0xa3'));}if(!_0x4e9ff6[_0xf779('0x36')][_0xf779('0xa4')]){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x4e9ff6[_0xf779('0x36')][_0xf779('0xa5')]){throw new Error(_0xf779('0xa6'));}if(!_0x4e9ff6[_0xf779('0x36')][_0xf779('0xa7')]){throw new Error(_0xf779('0xa8'));}var _0x1fc46d=_0x4e9ff6['body'][_0xf779('0xa4')]['split'](',');var _0x1d593d=_0x4e9ff6[_0xf779('0x36')]['binding_values'][_0xf779('0xa9')](',');if(!_0x1fc46d[_0xf779('0x2d')]||!_0x1d593d[_0xf779('0x2d')]||_0x1fc46d[_0xf779('0x2d')]!==_0x1d593d['length']){throw new Error(_0xf779('0xaa'));}_0x4e9ff6[_0xf779('0x36')][_0xf779('0x7f')]=_['zipObject'](_0x1fc46d,_0x1d593d);if(!_0x4e9ff6[_0xf779('0x36')][_0xf779('0x7f')]['phone']){throw new Error(_0xf779('0xab'));}if(!_0x4e9ff6['body'][_0xf779('0x7f')][_0xf779('0xac')]){throw new Error('No\x20firstName\x20column\x20specified');}var _0x116dda=path[_0xf779('0x3b')](config[_0xf779('0xad')],'server/files/tmp',_0x4e9ff6[_0xf779('0xae')][_0xf779('0xaf')]);fs['chmodSync'](_0x116dda,parseInt(_0xf779('0xb0'),0x8));var _0x5e8bfa=require(_0xf779('0xb1'))[_0xf779('0xb2')](path[_0xf779('0x3b')](__dirname,_0xf779('0xb3')),[_0x116dda,_0x4e9ff6['body'][_0xf779('0xa4')],_0x4e9ff6[_0xf779('0x36')][_0xf779('0xa5')],_0x4e9ff6[_0xf779('0x36')]['ListId'],_0x4e9ff6['body'][_0xf779('0xb4')],_0x4e9ff6['body'][_0xf779('0x5b')],_0x4e9ff6[_0xf779('0x36')]['socket_timestamp']]);return _0x50f1cf['status'](0xc8)['json']({'message':_0xf779('0xb5'),'pid':_0x5e8bfa[_0xf779('0xb6')]});}catch(_0x558c4e){return _0x50f1cf[_0xf779('0x16')](0x1f4)['send'](_0x558c4e);}};exports[_0xf779('0xb7')]=function(_0x18dd34,_0x260fc4){var _0x3f1254=fs[_0xf779('0xb8')](_0x18dd34[_0xf779('0xae')][_0xf779('0x3')]);Papa[_0xf779('0xb9')](_0x3f1254,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x254396){return _0x260fc4[_0xf779('0x16')](0xc8)[_0xf779('0x11')]({'file':_0x18dd34[_0xf779('0xae')],'fields':_0x254396[_0xf779('0xba')][_0xf779('0x7f')]});}});};exports['import']=function(_0x579e3c,_0x18b68e){return db['User'][_0xf779('0x1f')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0xf779('0x18')](function(_0x4d4f22){var _0x36b2df=![];if(!_0x579e3c[_0xf779('0x36')][_0xf779('0x5f')]){throw new Error('No\x20ListId\x20specified');}if(!_0x579e3c[_0xf779('0x36')]['binding'][_0xf779('0x79')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x579e3c['body'][_0xf779('0xbb')][_0xf779('0xac')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x579e3c['body'][_0xf779('0xa7')]){throw new Error(_0xf779('0xa8'));}var _0x329a0f=require(_0xf779('0xb1'))[_0xf779('0xb2')](path[_0xf779('0x3b')](__dirname,_0xf779('0xbc')),[_0x579e3c[_0xf779('0x64')]['id'],JSON[_0xf779('0xbd')](_0x579e3c[_0xf779('0x36')]),JSON[_0xf779('0xbd')](_0x4d4f22)]);_0x329a0f['on'](_0xf779('0xbe'),function(){_0x36b2df=!![];return _0x18b68e['status'](0xc8)[_0xf779('0x11')]({'message':_0xf779('0xbf'),'pid':_0x329a0f['pid']});});_0x329a0f['on'](_0xf779('0xc0'),function(_0x11c07d){if(_0x11c07d&&!_0x36b2df){return _0x18b68e[_0xf779('0x16')](0x1f4)['json']({'message':_0xf779('0xc1'),'pid':_0x329a0f[_0xf779('0xb6')]});}});})[_0xf779('0x24')](handleError(_0x18b68e,null));};exports[_0xf779('0xc2')]=function(_0x45901e,_0x4ac493){return db[_0xf779('0xc3')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0xf779('0xc4')}})[_0xf779('0x18')](function(_0x4043c8){var _0x304d9d=![];if(!_0x45901e[_0xf779('0x36')][_0xf779('0x5f')]){throw new Error(_0xf779('0xa3'));}if(!_0x45901e['body'][_0xf779('0xbb')][_0xf779('0x79')]){throw new Error(_0xf779('0xab'));}if(!_0x45901e[_0xf779('0x36')]['binding'][_0xf779('0xac')]){throw new Error(_0xf779('0xc5'));}if(!_0x45901e[_0xf779('0x36')][_0xf779('0xa7')]){throw new Error(_0xf779('0xa8'));}var _0x527c98=require(_0xf779('0xb1'))[_0xf779('0xb2')](path[_0xf779('0x3b')](__dirname,_0xf779('0xc6')),[_0x45901e[_0xf779('0x64')]['id'],JSON[_0xf779('0xbd')](_0x45901e['body']),JSON['stringify'](_0x4043c8)]);_0x527c98['on']('message',function(){_0x304d9d=!![];return _0x4ac493['status'](0xc8)['json']({'message':_0xf779('0xbf'),'pid':_0x527c98[_0xf779('0xb6')]});});_0x527c98['on'](_0xf779('0xc0'),function(_0x2bee4b){if(_0x2bee4b&&!_0x304d9d){return _0x4ac493['status'](0x1f4)[_0xf779('0x11')]({'message':_0xf779('0xc1'),'pid':_0x527c98[_0xf779('0xb6')]});}});})[_0xf779('0x24')](handleError(_0x4ac493,null));};exports[_0xf779('0xc7')]=function(_0x582415,_0x3e7e31){var _0x544978=['mail','chat','sms',_0xf779('0xc8'),_0xf779('0xc9'),_0xf779('0xca'),'voice'];var _0x2cb522={'offset':0x0,'order':qs[_0xf779('0x80')](_0xf779('0xcb'))},_0x21b926={'count':0x0,'rows':[]};Promise[_0xf779('0xcc')]()['then'](function(){if(_0x582415[_0xf779('0x20')][_0xf779('0xcd')]){if(!_['includes'](_0x544978,_0x582415[_0xf779('0x20')][_0xf779('0xcd')][_0xf779('0xce')]())){throw new Error('Invalid\x20channel');}_0x544978=[_0x582415[_0xf779('0x20')]['channel'][_0xf779('0xce')]()];}if(_0x582415[_0xf779('0x20')][_0xf779('0xcf')]){try{var _0x50336a=JSON[_0xf779('0xb9')](_0x582415[_0xf779('0x20')][_0xf779('0xcf')]);if(!moment(_0x50336a[_0xf779('0x37')])[_0xf779('0xd0')]()){throw new Error(_0xf779('0xd1'));}if(!moment(_0x50336a['to'])['isValid']()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x445ab9){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x582415['query'][_0xf779('0x34')](_0xf779('0x86'))){_0x2cb522['limit']=qs[_0xf779('0x13')](_0x582415[_0xf779('0x20')][_0xf779('0x13')]||0xa);_0x2cb522[_0xf779('0x12')]=qs[_0xf779('0x12')](_0x582415[_0xf779('0x20')][_0xf779('0x12')]);}var _0x4b0ee8=_0x544978['map'](function(_0x2db64c){if(_0x2db64c===_0xf779('0xd2')){var _0x25f38d={'attributes':['id',_0xf779('0xd3'),'type',_0xf779('0xd4'),_0xf779('0xd5'),_0xf779('0xd6'),_0xf779('0xd7'),_0xf779('0xd8'),_0xf779('0xd9'),_0xf779('0xda'),_0xf779('0xdb'),_0xf779('0xdc'),_0xf779('0xdd'),_0xf779('0xde'),_0xf779('0xdf')],'where':{'ContactId':_0x582415[_0xf779('0x64')]['id']},'include':[{'model':db[_0xf779('0xc3')],'as':'User','attributes':['id',_0xf779('0x1d'),_0xf779('0xe0'),_0xf779('0x2e')]}],'order':[[_0xf779('0xdb'),'DESC']]};if(_0x582415['query'][_0xf779('0xcf')]){_0x25f38d['where']['createdAt']={'$gte':_0x50336a[_0xf779('0x37')],'$lte':_0x50336a['to']};}return db[_0xf779('0xe1')][_0xf779('0xe2')](_0x25f38d)[_0xf779('0x18')](function(_0x5f0d5a){_0x21b926[_0xf779('0x15')]+=_0x5f0d5a[_0xf779('0x15')];return _['map'](_0x5f0d5a[_0xf779('0x9e')],function(_0x3c2a17){var _0xbe92f4=_0x3c2a17[_0xf779('0x38')]({'plain':!![]});_0xbe92f4['channel']=_0x2db64c;if(_0xbe92f4['User']){_0xbe92f4['User']={'id':_0xbe92f4[_0xf779('0xc3')]['id'],'name':_0xbe92f4[_0xf779('0xc3')][_0xf779('0x1d')],'fullname':_0xbe92f4[_0xf779('0xc3')]['fullname'],'alias':_0xbe92f4['User'][_0xf779('0x2e')]};}return _0xbe92f4;});});}else{var _0x1bc439=_[_0xf779('0xe3')](_0x2db64c)+(_0x2db64c===_0xf779('0xe4')?_0xf779('0xe5'):_0xf779('0xe6'));var _0x2686a={'attributes':['id',_0xf779('0xe7'),_0xf779('0xe8'),'createdAt',_0xf779('0xda'),'disposition',_0xf779('0xe9'),'thirdDisposition',_0xf779('0xdf'),_0x1bc439+'Id'],'where':{'ContactId':_0x582415[_0xf779('0x64')]['id']},'include':[{'model':db[_0x1bc439],'as':_0xf779('0xe6'),'attributes':['id','name',_0xf779('0xea')]},{'model':db['User'],'as':_0xf779('0xeb'),'attributes':['id','name',_0xf779('0xe0')]},{'model':db[_0xf779('0x65')],'as':_0xf779('0xec'),'attributes':['id',_0xf779('0x1d'),'color'],'through':{'attributes':[]}}],'order':[[_0xf779('0xdb'),_0xf779('0xed')]]};if(_0x582415[_0xf779('0x20')][_0xf779('0xcf')]){_0x2686a[_0xf779('0x5c')][_0xf779('0xdb')]={'$gte':_0x50336a[_0xf779('0x37')],'$lte':_0x50336a['to']};}switch(_0x2db64c){case _0xf779('0xe4'):_0x2686a['attributes'][_0xf779('0x5e')](_0xf779('0xee'),_0xf779('0xef'),_0xf779('0xf0'),_0xf779('0xf1'),_0xf779('0xf2'),_0xf779('0xf3'),_0xf779('0xf4'),_0xf779('0xf5'),_0xf779('0xf6'));break;case _0xf779('0xf7'):_0x2686a[_0xf779('0x7e')][_0xf779('0x5e')](_0xf779('0xf8'),'substatus');break;case _0xf779('0xc8'):_0x2686a[_0xf779('0x7e')][_0xf779('0x5e')]('externalUrl',_0xf779('0xf9'));break;}return db[_[_0xf779('0xe3')](_0x2db64c)+_0xf779('0xfa')][_0xf779('0xe2')](_0x2686a)[_0xf779('0x18')](function(_0x565296){_0x21b926[_0xf779('0x15')]+=_0x565296['count'];return _['map'](_0x565296[_0xf779('0x9e')],function(_0x429e39){var _0x2671a9=_0x429e39[_0xf779('0x38')]({'plain':!![]});_0x2671a9['channel']=_0x2db64c;if(_0x2671a9['Owner']){_0x2671a9[_0xf779('0xeb')]={'id':_0x2671a9['Owner']['id'],'name':_0x2671a9[_0xf779('0xeb')][_0xf779('0x1d')],'fullname':_0x2671a9[_0xf779('0xeb')][_0xf779('0xe0')]};}return _0x2671a9;});});}});return Promise['all'](_0x4b0ee8);})[_0xf779('0x18')](function(_0x583737){return _(_0x583737)[_0xf779('0xfb')]()['sortBy'](_0xf779('0xdb'))['reverse']()[_0xf779('0xfc')]();})[_0xf779('0x18')](function(_0x2ad5d7){_0x21b926[_0xf779('0x9e')]=_0x2cb522[_0xf779('0x13')]?_0x2ad5d7['slice'](_0x2cb522[_0xf779('0x12')],_0x2cb522[_0xf779('0x12')]+_0x2cb522['limit']):_0x2ad5d7;return _0x21b926;})[_0xf779('0x18')](respondWithFilteredResult(_0x3e7e31,_0x2cb522))[_0xf779('0x24')](handleError(_0x3e7e31,null));}; \ No newline at end of file +var _0xc1b0=['rescheduleAdditionalPhones','hopperId','getHoppers','ContactId','includeAll','rows','getHopperHistories','include','getHopperFinals','uploadCsv','No\x20association\x20keys\x20specified!','binding_values','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','parse','meta','User','agent','No\x20ListId\x20specified','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','importUpdates','error\x20child\x20process','getJourney','mail','chat','sms','fax','whatsapp','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20createdAt\x20filter','voice','uniqueid','type','destination','callerid','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','fullname','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','UserId','key','Owner','DESC','browserName','customerIp','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','openchannel','externalUrl','threadId','Interaction','findAndCountAll','reverse','value','slice','moment','bluebird','util','path','squel','papaparse','ioredis','../../components/contacts','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','offset','undefined','count','limit','status','set','Content-Range','json','update','destroy','then','end','sendStatus','stack','name','send','index','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','length','cf_','columnName','displayName','alias','custom','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','body','from','get','mergeWith','isArray','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','each','duplicates','$or','push','where','ListId','findOrCreate','spread','contact','all','Tag','Tags','color','tag','Phones','ContactItemType','sequelize','literal','$and','CmCustomField','omit','map','format','cf_%d','pickBy','startsWith','isEmpty','table','cm_contacts','text','values','phone','findOne','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','options','getTags','nolimit','setTags','ids','OrderBy','item_types','items','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','PHONE','ItemType','ItemType.OrderBy','bulkCreate','hasOwnProperty','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId'];(function(_0x11b47c,_0x27df19){var _0x3d2286=function(_0x383c54){while(--_0x383c54){_0x11b47c['push'](_0x11b47c['shift']());}};_0x3d2286(++_0x27df19);}(_0xc1b0,0x69));var _0x0c1b=function(_0x49e584,_0x2886f8){_0x49e584=_0x49e584-0x0;var _0x58b1be=_0xc1b0[_0x49e584];return _0x58b1be;};'use strict';var moment=require(_0x0c1b('0x0'));var BPromise=require(_0x0c1b('0x1'));var util=require(_0x0c1b('0x2'));var path=require(_0x0c1b('0x3'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0c1b('0x4'));var Papa=require(_0x0c1b('0x5'));var Redis=require(_0x0c1b('0x6'));var contacts=require(_0x0c1b('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0x0c1b('0x8'))(_0x0c1b('0x9'));var config=require('../../config/environment');var shared=require('../../config/environment/shared');var db=require('../../mysqldb')['db'];config[_0x0c1b('0xa')]=_[_0x0c1b('0xb')](config[_0x0c1b('0xa')],{'host':_0x0c1b('0xc'),'port':0x18eb});var socket=require(_0x0c1b('0xd'))(new Redis(config[_0x0c1b('0xa')]));require(_0x0c1b('0xe'))[_0x0c1b('0xf')](socket);function respondWithResult(_0x542834,_0x5ab570){_0x5ab570=_0x5ab570||0xc8;return function(_0x4851f4){if(_0x4851f4){return _0x542834['status'](_0x5ab570)['json'](_0x4851f4);}};}function respondWithFilteredResult(_0x25034d,_0x49e537){return function(_0x3d42d8){if(_0x3d42d8){var _0x1c3f64=typeof _0x49e537[_0x0c1b('0x10')]===_0x0c1b('0x11')&&typeof _0x49e537['limit']===_0x0c1b('0x11');var _0x2eb274=_0x3d42d8[_0x0c1b('0x12')];var _0x349280=_0x1c3f64?0x0:_0x49e537[_0x0c1b('0x10')];var _0x3c7dd9=_0x1c3f64?_0x3d42d8[_0x0c1b('0x12')]:_0x49e537['offset']+_0x49e537[_0x0c1b('0x13')];var _0x2e3e5f;if(_0x3c7dd9>=_0x2eb274){_0x3c7dd9=_0x2eb274;_0x2e3e5f=0xc8;}else{_0x2e3e5f=0xce;}_0x25034d[_0x0c1b('0x14')](_0x2e3e5f);return _0x25034d[_0x0c1b('0x15')](_0x0c1b('0x16'),_0x349280+'-'+_0x3c7dd9+'/'+_0x2eb274)[_0x0c1b('0x17')](_0x3d42d8);}return null;};}function saveUpdates(_0x3e5684){return function(_0x2037d6){if(_0x2037d6){return _0x2037d6[_0x0c1b('0x18')](_0x3e5684)['then'](function(_0x5a3d40){return _0x5a3d40;});}return null;};}function removeEntity(_0x3d64af){return function(_0x1ad683){if(_0x1ad683){return _0x1ad683[_0x0c1b('0x19')]()[_0x0c1b('0x1a')](function(){_0x3d64af[_0x0c1b('0x14')](0xcc)[_0x0c1b('0x1b')]();});}};}function handleEntityNotFound(_0xa5634f){return function(_0x243b50){if(!_0x243b50){_0xa5634f[_0x0c1b('0x1c')](0x194);}return _0x243b50;};}function handleError(_0x2bb0e2,_0x2911de){_0x2911de=_0x2911de||0x1f4;return function(_0x319be5){logger['error'](_0x319be5[_0x0c1b('0x1d')]);if(_0x319be5[_0x0c1b('0x1e')]){delete _0x319be5[_0x0c1b('0x1e')];}_0x2bb0e2[_0x0c1b('0x14')](_0x2911de)[_0x0c1b('0x1f')](_0x319be5);};}exports[_0x0c1b('0x20')]=function(_0x3e8e33,_0x2656f5){var _0x58bbb6={};return contacts[_0x0c1b('0x21')]()[_0x0c1b('0x1a')](function(_0x59d423){_0x58bbb6=qs[_0x0c1b('0x22')](_0x59d423,_0x3e8e33);return contacts[_0x0c1b('0x23')](_0x3e8e33[_0x0c1b('0x24')],_0x3e8e33[_0x0c1b('0x25')],_0x58bbb6,_0x59d423);})[_0x0c1b('0x1a')](respondWithFilteredResult(_0x2656f5,_0x58bbb6))[_0x0c1b('0x26')](handleError(_0x2656f5,null));};exports[_0x0c1b('0x19')]=function(_0x28be5c,_0x37b311){return db[_0x0c1b('0x27')][_0x0c1b('0x28')]({'where':{'id':_0x28be5c[_0x0c1b('0x29')]['id']}})['then'](handleEntityNotFound(_0x37b311,null))['then'](removeEntity(_0x37b311,null))[_0x0c1b('0x26')](handleError(_0x37b311,null));};exports[_0x0c1b('0x21')]=function(_0x2bfddd,_0x17fc7e){return db['CmContact'][_0x0c1b('0x21')]()[_0x0c1b('0x1a')](function(_0x1fc0b1){delete _0x1fc0b1[_0x0c1b('0x2a')];for(var _0x3b7bfa=0x0;_0x3b7bfa0x0){return new Promise(function(_0x1ed831){var _0x1f1408=[];for(var _0x5aacd5=0x0;_0x5aacd5<_0x1d16be['length'];_0x5aacd5++){_0x1f1408[_0x0c1b('0x5b')](insertAdditionalPhones(_0x1d16be[_0x5aacd5][_0x0c1b('0x60')],_0x1d16be[_0x5aacd5][_0x0c1b('0x57')]));}Promise[_0x0c1b('0x61')](_0x1f1408)['then'](function(){_0x1ed831(0x1);});})[_0x0c1b('0x1a')](function(){return{'success':_0x4924ad,'failure':_0x40c3c9,'duplicates':_0x137cfd};});}else{return{'success':_0x4924ad,'failure':_0x40c3c9,'duplicates':_0x137cfd};}}})[_0x0c1b('0x1a')](respondWithResult(_0x235e4f,0xc9))[_0x0c1b('0x26')](handleError(_0x235e4f,null));};exports['show']=function(_0x4771eb,_0x236966){var _0x29135f;return db[_0x0c1b('0x27')][_0x0c1b('0x21')]()[_0x0c1b('0x1a')](function(_0x8808f3){return db['CmContact']['find']({'where':{'id':_0x4771eb[_0x0c1b('0x29')]['id']},'include':[{'model':db[_0x0c1b('0x62')],'as':_0x0c1b('0x63'),'attributes':['id',_0x0c1b('0x1e'),_0x0c1b('0x64')],'required':_0x4771eb[_0x0c1b('0x24')][_0x0c1b('0x65')]?!![]:![]},{'model':db[_0x0c1b('0x49')],'as':_0x0c1b('0x66'),'where':{'CmContactId':_0x4771eb[_0x0c1b('0x29')]['id']},'required':![],'include':[{'model':db[_0x0c1b('0x67')],'as':'ItemType'}]}],'order':[db[_0x0c1b('0x68')][_0x0c1b('0x69')]('Phones.OrderBy')],'attributes':_[_0x0c1b('0x2b')](_0x8808f3)});})[_0x0c1b('0x1a')](function(_0x4e5ab1){if(!_[_0x0c1b('0x53')](_0x4e5ab1)){_0x29135f=_0x4e5ab1[_0x0c1b('0x37')]({'plain':!![]});var _0x359d9f={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4e5ab1&&_0x4e5ab1[_0x0c1b('0x5d')]){if(_0x4e5ab1['ListId']){_0x359d9f[_0x0c1b('0x5c')][_0x0c1b('0x6a')]['push']({'ListId':{'$ne':_0x4e5ab1[_0x0c1b('0x5d')]}});}}return db[_0x0c1b('0x6b')]['findAll'](_0x359d9f);}})[_0x0c1b('0x1a')](function(_0x86bf74){if(!_[_0x0c1b('0x53')](_0x86bf74)){return _[_0x0c1b('0x6c')](_0x29135f,_[_0x0c1b('0x6d')](_0x86bf74,function(_0x3c2ba8){return util[_0x0c1b('0x6e')](_0x0c1b('0x6f'),_0x3c2ba8['id']);}));}})[_0x0c1b('0x1a')](handleEntityNotFound(_0x236966,null))[_0x0c1b('0x1a')](respondWithResult(_0x236966,null))['catch'](handleError(_0x236966,null));};exports[_0x0c1b('0x18')]=function(_0x3ddec0,_0x24d505){var _0x1fe3ff;if(_0x3ddec0[_0x0c1b('0x35')]['id']){delete _0x3ddec0[_0x0c1b('0x35')]['id'];}if(!_['isNil'](_0x3ddec0[_0x0c1b('0x35')]['dialTimezone'])){var _0x105d2b=_0x3ddec0[_0x0c1b('0x35')][_0x0c1b('0x54')];if(!_[_0x0c1b('0x53')](shared['timezones'][_0x105d2b]))_0x3ddec0[_0x0c1b('0x35')][_0x0c1b('0x56')]=shared[_0x0c1b('0x55')][_0x105d2b]['utcOffset'];}return db['CmContact']['find']({'where':{'id':_0x3ddec0[_0x0c1b('0x29')]['id']}})[_0x0c1b('0x1a')](handleEntityNotFound(_0x24d505,null))[_0x0c1b('0x1a')](saveUpdates(_0x3ddec0[_0x0c1b('0x35')],null))[_0x0c1b('0x1a')](function(_0x992a96){_0x1fe3ff=_0x992a96;var _0x3de197={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x992a96&&_0x992a96[_0x0c1b('0x5d')]){if(_0x992a96[_0x0c1b('0x5d')]){_0x3de197[_0x0c1b('0x5c')]['$and']['push']({'ListId':{'$ne':_0x992a96[_0x0c1b('0x5d')]}});}}return db[_0x0c1b('0x6b')][_0x0c1b('0x23')](_0x3de197);})[_0x0c1b('0x1a')](function(_0x224001){if(_0x224001){return _['omit'](_[_0x0c1b('0x70')](_0x3ddec0[_0x0c1b('0x35')],function(_0x2e5483,_0x655430){return _[_0x0c1b('0x71')](_0x655430,_0x0c1b('0x2d'));}),_['map'](_0x224001,function(_0x27eb5f){return util[_0x0c1b('0x6e')]('cf_%d',_0x27eb5f['id']);}));}})[_0x0c1b('0x1a')](function(_0x10fb3c){if(_0x10fb3c&&!_[_0x0c1b('0x72')](_0x10fb3c)){var _0x3fb41d=squel[_0x0c1b('0x18')]()[_0x0c1b('0x73')](_0x0c1b('0x74'))['setFields'](_0x10fb3c)['where']('id\x20=\x20?',_0x3ddec0[_0x0c1b('0x29')]['id'])['toParam']();return db['sequelize']['query'](_0x3fb41d[_0x0c1b('0x75')],{'replacements':_0x3fb41d[_0x0c1b('0x76')]});}})[_0x0c1b('0x1a')](function(){if(_0x3ddec0['body'][_0x0c1b('0x77')]&&_0x1fe3ff){return db[_0x0c1b('0x3c')]['update']({'phone':_0x3ddec0[_0x0c1b('0x35')]['phone'],'OrderBy':0x0},{'where':{'ContactId':_0x1fe3ff['id']}});}})[_0x0c1b('0x1a')](function(){return _0x1fe3ff;})[_0x0c1b('0x1a')](respondWithResult(_0x24d505,null))[_0x0c1b('0x26')](handleError(_0x24d505,null));};exports['getTags']=function(_0x1b66f6,_0x355117){var _0x22d347={};var _0x1961da={};var _0x516bb1;var _0x1cae31;return db['CmContact'][_0x0c1b('0x78')]({'where':{'id':_0x1b66f6[_0x0c1b('0x29')]['id']}})[_0x0c1b('0x1a')](handleEntityNotFound(_0x355117,null))[_0x0c1b('0x1a')](function(_0x5b5790){if(_0x5b5790){_0x516bb1=_0x5b5790;_0x1961da[_0x0c1b('0x79')]=_[_0x0c1b('0x2b')](db[_0x0c1b('0x62')][_0x0c1b('0x7a')]);_0x1961da[_0x0c1b('0x24')]=_[_0x0c1b('0x2b')](_0x1b66f6[_0x0c1b('0x24')]);_0x1961da[_0x0c1b('0x7b')]=_[_0x0c1b('0x7c')](_0x1961da[_0x0c1b('0x79')],_0x1961da[_0x0c1b('0x24')]);_0x22d347[_0x0c1b('0x7d')]=_['intersection'](_0x1961da[_0x0c1b('0x79')],qs[_0x0c1b('0x7e')](_0x1b66f6[_0x0c1b('0x24')][_0x0c1b('0x7e')]));_0x22d347[_0x0c1b('0x7d')]=_0x22d347[_0x0c1b('0x7d')]['length']?_0x22d347['attributes']:_0x1961da[_0x0c1b('0x79')];_0x22d347[_0x0c1b('0x7f')]=qs[_0x0c1b('0x80')](_0x1b66f6[_0x0c1b('0x24')][_0x0c1b('0x80')]);_0x22d347['where']=qs[_0x0c1b('0x7b')](_[_0x0c1b('0x81')](_0x1b66f6[_0x0c1b('0x24')],_0x1961da['filters']));if(_0x1b66f6[_0x0c1b('0x24')][_0x0c1b('0x82')]){_0x22d347[_0x0c1b('0x5c')]=_[_0x0c1b('0x83')](_0x22d347['where'],{'$or':_[_0x0c1b('0x6d')](_0x22d347['attributes'],function(_0x286728){var _0x1e4bbe={};_0x1e4bbe[_0x286728]={'$like':'%'+_0x1b66f6['query'][_0x0c1b('0x82')]+'%'};return _0x1e4bbe;})});}_0x22d347=_[_0x0c1b('0x83')]({},_0x22d347,_0x1b66f6[_0x0c1b('0x84')]);return _0x516bb1[_0x0c1b('0x85')](_0x22d347);}})[_0x0c1b('0x1a')](function(_0x47c86e){if(_0x47c86e){_0x1cae31=_0x47c86e[_0x0c1b('0x2c')];if(!_0x1b66f6['query']['hasOwnProperty'](_0x0c1b('0x86'))){_0x22d347['limit']=qs[_0x0c1b('0x13')](_0x1b66f6[_0x0c1b('0x24')]['limit']);_0x22d347[_0x0c1b('0x10')]=qs[_0x0c1b('0x10')](_0x1b66f6['query'][_0x0c1b('0x10')]);}return _0x516bb1[_0x0c1b('0x85')](_0x22d347);}})['then'](function(_0x3cf5d0){if(_0x3cf5d0){return _0x3cf5d0?{'count':_0x1cae31,'rows':_0x3cf5d0}:null;}})[_0x0c1b('0x1a')](respondWithResult(_0x355117,null))[_0x0c1b('0x26')](handleError(_0x355117,null));};exports[_0x0c1b('0x87')]=function(_0x48c6a3,_0x540e09){if(_0x48c6a3['body']['id']){delete _0x48c6a3[_0x0c1b('0x35')]['id'];}return db[_0x0c1b('0x27')]['findOne']({'where':{'id':_0x48c6a3[_0x0c1b('0x29')]['id']}})[_0x0c1b('0x1a')](handleEntityNotFound(_0x540e09,null))[_0x0c1b('0x1a')](function(_0x257aae){if(_0x257aae){return _0x257aae[_0x0c1b('0x87')](_0x48c6a3[_0x0c1b('0x35')][_0x0c1b('0x88')]||[]);}return null;})[_0x0c1b('0x1a')](respondWithResult(_0x540e09,null))[_0x0c1b('0x26')](handleError(_0x540e09,null));};exports['setAdditionalPhones']=function(_0x521b6a,_0x513dbc){var _0x25c4a8=[];_0x25c4a8[_0x0c1b('0x5b')](addAdditionalPhones(_0x521b6a[_0x0c1b('0x35')]));Promise['all'](_0x25c4a8)[_0x0c1b('0x1a')](function(){_0x25c4a8=[];_0x25c4a8[_0x0c1b('0x5b')](deleteCmHopperPhones(_0x521b6a[_0x0c1b('0x35')]['id']));_0x25c4a8[_0x0c1b('0x5b')](addCmHopperPhones(_0x521b6a[_0x0c1b('0x35')]['id']));Promise['all'](_0x25c4a8)[_0x0c1b('0x1a')](function(){return[0x1];})[_0x0c1b('0x1a')](respondWithResult(_0x513dbc,null));});};function addAdditionalPhones(_0x48179b){var _0xb1c339;return new Promise(function(_0x4e29c5){return db[_0x0c1b('0x49')][_0x0c1b('0x19')]({'where':{'CmContactId':_0x48179b['id']}})[_0x0c1b('0x1a')](function(){db[_0x0c1b('0x67')][_0x0c1b('0x23')]({'raw':!![],'attributes':['id',_0x0c1b('0x89')]})[_0x0c1b('0x1a')](function(_0x31893c){var _0x154997=[];for(var _0x3546af=0x0;_0x3546af<_0x48179b['items']['length'];_0x3546af++){var _0xac015c=_0x48179b[_0x0c1b('0x8a')]?_[_0x0c1b('0x53')](_0x48179b['item_types'][_0x3546af])?'':_0x48179b['item_types'][_0x3546af]:_0x48179b[_0x0c1b('0x8b')][_0x3546af][_0x0c1b('0x8c')]?_0x48179b[_0x0c1b('0x8b')][_0x3546af][_0x0c1b('0x8c')]:'';var _0x5b834a=_[_0x0c1b('0x53')](_0x48179b[_0x0c1b('0x8b')][_0x3546af][_0x0c1b('0x8d')])?'':_0x48179b[_0x0c1b('0x8b')][_0x3546af][_0x0c1b('0x8d')];var _0x57065c=_0xac015c+':'+_0x48179b[_0x0c1b('0x8b')][_0x3546af][_0x0c1b('0x77')]+'§'+_0x5b834a;if(_[_0x0c1b('0x53')](_0xb1c339))_0xb1c339=_0x57065c;else _0xb1c339+=';'+_0x57065c;var _0x35ca73=null;var _0x2a4b7e=null;if(_0x48179b[_0x0c1b('0x8a')]){if(!_[_0x0c1b('0x53')](_0x48179b[_0x0c1b('0x8a')][_0x3546af])){_0x2a4b7e=_[_0x0c1b('0x28')](_0x31893c,function(_0x9b53c3){return _0x9b53c3['id']===_0x48179b[_0x0c1b('0x8a')][_0x3546af];});if(!_['isNil'](_0x2a4b7e)){_0x35ca73=_0x2a4b7e[_0x0c1b('0x89')];}}}else{if(!_[_0x0c1b('0x53')](_0x48179b['items'][_0x3546af])){_0x2a4b7e=_[_0x0c1b('0x28')](_0x31893c,function(_0x2488d1){return _0x2488d1['id']===_0x48179b[_0x0c1b('0x8b')][_0x3546af][_0x0c1b('0x8c')];});if(!_[_0x0c1b('0x53')](_0x2a4b7e)){_0x35ca73=_0x3546af;}}}if(_[_0x0c1b('0x53')](_0x35ca73)){_0x35ca73=0x64;}_0x154997['push'](addAdditionalPhone(_0x48179b['id'],_0x48179b[_0x0c1b('0x8b')][_0x3546af][_0x0c1b('0x77')],_0x48179b[_0x0c1b('0x8a')]?_[_0x0c1b('0x53')](_0x48179b[_0x0c1b('0x8a')][_0x3546af])?null:_0x48179b[_0x0c1b('0x8a')][_0x3546af]:_0x48179b[_0x0c1b('0x8b')][_0x3546af][_0x0c1b('0x8c')]?_0x48179b[_0x0c1b('0x8b')][_0x3546af][_0x0c1b('0x8c')]:null,_0x35ca73,_0x5b834a));}Promise[_0x0c1b('0x61')](_0x154997)[_0x0c1b('0x1a')](function(){db['CmContact'][_0x0c1b('0x18')]({'AdditionalPhones':_0xb1c339},{'where':{'id':_0x48179b['id']}})['then'](function(){_0x4e29c5(0x1);});});});});});}function addAdditionalPhone(_0x3204ee,_0x1a0ece,_0x32f393,_0x8efa38,_0x7b970c){return db[_0x0c1b('0x49')][_0x0c1b('0x28')]({'where':{'CmContactId':_0x3204ee,'item':_0x1a0ece}})[_0x0c1b('0x1a')](function(_0x41118f){if(_0x41118f)logger['info'](_0x0c1b('0x8e'),_0x41118f);else{db['CmContactHasItem'][_0x0c1b('0x40')]({'CmContactId':_0x3204ee,'item':_0x1a0ece,'ItemTypeId':_0x32f393,'OrderBy':_0x8efa38,'ItemClass':'PHONE','description':_0x7b970c});}});}function deleteCmHopperPhones(_0x1166de){return new Promise(function(_0x5a0b6f){return db[_0x0c1b('0x3c')][_0x0c1b('0x23')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1166de}})[_0x0c1b('0x1a')](function(_0x3523ab){db[_0x0c1b('0x8f')][_0x0c1b('0x19')]({'where':{'CmHopperId':{'$in':_[_0x0c1b('0x6d')](_0x3523ab,'id')}}});})['then'](function(){_0x5a0b6f(0x1);});});}function addCmHopperPhones(_0x5eec64){return new Promise(function(_0x510151){return db[_0x0c1b('0x3c')][_0x0c1b('0x23')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x5eec64}})[_0x0c1b('0x1a')](function(_0x48db9c){var _0x1685ee=[];_[_0x0c1b('0x6d')](_0x48db9c,function(_0x2b4f48){_0x1685ee[_0x0c1b('0x5b')](createCmHopperPhone(_0x5eec64,_0x2b4f48['id']));});Promise[_0x0c1b('0x61')](_0x1685ee)[_0x0c1b('0x1a')](function(){_0x510151(0x1);});});});}function createCmHopperPhone(_0x2c96b9,_0x43f999){return new Promise(function(_0x49af4e){db[_0x0c1b('0x49')]['findAll']({'raw':!![],'attributes':[_0x0c1b('0x90'),_0x0c1b('0x89')],'where':{'CmContactId':_0x2c96b9,'ItemClass':_0x0c1b('0x91')},'include':[{'model':db['ContactItemType'],'attributes':['OrderBy'],'as':_0x0c1b('0x92')}],'order':['OrderBy',db[_0x0c1b('0x68')][_0x0c1b('0x69')]('`ItemType`.OrderBy')]})[_0x0c1b('0x1a')](function(_0x7317b9){var _0x42a88c=0x1;var _0x1bee90=_[_0x0c1b('0x6d')](_0x7317b9,function(_0x564c03){_0x564c03['CmHopperId']=_0x43f999;_0x564c03[_0x0c1b('0x77')]=_0x564c03[_0x0c1b('0x90')];_0x564c03[_0x0c1b('0x89')]=_0x42a88c;delete _0x564c03[_0x0c1b('0x93')];_0x42a88c=_0x42a88c+0x1;return _0x564c03;});return db['CmHopperAdditionalPhone'][_0x0c1b('0x94')](_0x1bee90,{});})[_0x0c1b('0x1a')](function(){_0x49af4e(0x1);});});}function insertAdditionalPhones(_0x294f5a,_0xfc51f8){return new Promise(function(_0x446120){var _0x5603b8=[];for(var _0x74065d=0x0;_0x74065d<_0xfc51f8['length'];_0x74065d++){var _0x38f570=_0xfc51f8[_0x74065d];_0x5603b8[_0x0c1b('0x5b')](parseContactItemType(_0x38f570));}Promise['all'](_0x5603b8)[_0x0c1b('0x1a')](function(){var _0x1c1db1={'id':_0x294f5a['id'],'items':_0xfc51f8};return addAdditionalPhones(_0x1c1db1)[_0x0c1b('0x1a')](function(){return addCmHopperPhones(_0x294f5a['id']);});})['then'](function(){_0x446120(_0x294f5a);});});}function parseContactItemType(_0x3d4d39){return new Promise(function(_0x3a99fb){if(_0x3d4d39[_0x0c1b('0x95')](_0x0c1b('0x8c'))){_0x3a99fb(_0x3d4d39);}else{return db['ContactItemType'][_0x0c1b('0x28')]({'where':{'name':_0x3d4d39['ItemType']}})[_0x0c1b('0x1a')](function(_0x4e22cc){if(_[_0x0c1b('0x53')](_0x4e22cc))_0x3d4d39[_0x0c1b('0x8c')]=null;else _0x3d4d39[_0x0c1b('0x8c')]=_0x4e22cc['id'];_0x3a99fb(_0x3d4d39);});}});}exports[_0x0c1b('0x96')]=function(_0xe8d0c7,_0x4d1bc6){return db[_0x0c1b('0x49')][_0x0c1b('0x23')]({'raw':!![],'where':{'CmContactId':_0xe8d0c7['params']['id'],'ItemClass':_0x0c1b('0x91')},'include':[{'model':db[_0x0c1b('0x67')],'as':_0x0c1b('0x92')}],'order':[[_0x0c1b('0x89')],[db[_0x0c1b('0x68')][_0x0c1b('0x69')]('`ItemType`.OrderBy')]]})[_0x0c1b('0x1a')](function(_0x4821f3){return _0x4821f3;})[_0x0c1b('0x1a')](respondWithResult(_0x4d1bc6,null))[_0x0c1b('0x26')](handleError(_0x4d1bc6,null));};exports[_0x0c1b('0x97')]=function(_0x2463de,_0x21a124){return db[_0x0c1b('0x49')]['findAll']({'raw':!![],'where':{'CmContactId':_0x2463de['body'][_0x0c1b('0x98')]}})[_0x0c1b('0x1a')](function(_0x5e70d1){var _0x52e4d7=_[_0x0c1b('0x6d')](_0x5e70d1,function(_0x5520e9){_0x5520e9[_0x0c1b('0x99')]=_0x2463de['body'][_0x0c1b('0x9a')];return _0x5520e9;});return db[_0x0c1b('0x49')][_0x0c1b('0x94')](_0x52e4d7,{});})['then'](function(){return addCmHopperPhones(_0x2463de[_0x0c1b('0x35')][_0x0c1b('0x9a')]);})[_0x0c1b('0x1a')](function(){return['ok'];})[_0x0c1b('0x1a')](respondWithResult(_0x21a124,null))[_0x0c1b('0x26')](handleError(_0x21a124,null));};exports[_0x0c1b('0x9b')]=function(_0x36d8e5,_0x21f42a){var _0xebf63f=[];_0xebf63f[_0x0c1b('0x5b')](createCmHopperPhone(_0x36d8e5[_0x0c1b('0x35')]['id'],_0x36d8e5['body'][_0x0c1b('0x9c')]));Promise[_0x0c1b('0x61')](_0xebf63f)[_0x0c1b('0x1a')](function(){return[0x1];})[_0x0c1b('0x1a')](respondWithResult(_0x21f42a,null));};exports[_0x0c1b('0x9d')]=function(_0x44b138,_0x2be99d){var _0x2504a8={'raw':![],'where':{}};var _0x4aabf0={};var _0x3c38f6={'count':0x0,'rows':[]};return db[_0x0c1b('0x27')][_0x0c1b('0x78')]({'where':{'id':_0x44b138['params']['id']}})[_0x0c1b('0x1a')](handleEntityNotFound(_0x2be99d,null))['then'](function(_0x3694c5){if(_0x3694c5){_0x4aabf0['model']=_[_0x0c1b('0x2b')](db[_0x0c1b('0x3c')]['rawAttributes']);_0x4aabf0[_0x0c1b('0x24')]=_[_0x0c1b('0x2b')](_0x44b138['query']);_0x4aabf0[_0x0c1b('0x7b')]=_['intersection'](_0x4aabf0[_0x0c1b('0x79')],_0x4aabf0[_0x0c1b('0x24')]);_0x2504a8[_0x0c1b('0x7d')]=_[_0x0c1b('0x7c')](_0x4aabf0[_0x0c1b('0x79')],qs[_0x0c1b('0x7e')](_0x44b138['query'][_0x0c1b('0x7e')]));_0x2504a8[_0x0c1b('0x7d')]=_0x2504a8[_0x0c1b('0x7d')]['length']?_0x2504a8[_0x0c1b('0x7d')]:_0x4aabf0['model'];if(!_0x44b138[_0x0c1b('0x24')]['hasOwnProperty'](_0x0c1b('0x86'))){_0x2504a8[_0x0c1b('0x13')]=qs[_0x0c1b('0x13')](_0x44b138[_0x0c1b('0x24')]['limit']);_0x2504a8['offset']=qs[_0x0c1b('0x10')](_0x44b138[_0x0c1b('0x24')][_0x0c1b('0x10')]);}_0x2504a8[_0x0c1b('0x7f')]=qs['sort'](_0x44b138[_0x0c1b('0x24')][_0x0c1b('0x80')]);_0x2504a8[_0x0c1b('0x5c')]=qs[_0x0c1b('0x7b')](_['pick'](_0x44b138['query'],_0x4aabf0[_0x0c1b('0x7b')]));_0x2504a8[_0x0c1b('0x5c')][_0x0c1b('0x9e')]=_0x3694c5['id'];if(_0x44b138[_0x0c1b('0x24')]['filter']){_0x2504a8[_0x0c1b('0x5c')]=_[_0x0c1b('0x83')](_0x2504a8[_0x0c1b('0x5c')],{'$or':_[_0x0c1b('0x6d')](_0x2504a8['attributes'],function(_0x24f239){var _0x55ba21={};_0x55ba21[_0x24f239]={'$like':'%'+_0x44b138[_0x0c1b('0x24')][_0x0c1b('0x82')]+'%'};return _0x55ba21;})});}_0x2504a8=_[_0x0c1b('0x83')]({},_0x2504a8,_0x44b138[_0x0c1b('0x84')]);return db['CmHopper']['count']({'where':_0x2504a8['where']})[_0x0c1b('0x1a')](function(_0x4a58c8){_0x3c38f6[_0x0c1b('0x12')]=_0x4a58c8;if(_0x44b138[_0x0c1b('0x24')][_0x0c1b('0x9f')]){_0x2504a8['include']=[{'all':!![]}];}return db[_0x0c1b('0x3c')][_0x0c1b('0x23')](_0x2504a8);})[_0x0c1b('0x1a')](function(_0xd3969e){_0x3c38f6[_0x0c1b('0xa0')]=_0xd3969e;return _0x3c38f6;});}})[_0x0c1b('0x1a')](respondWithFilteredResult(_0x2be99d,_0x2504a8))[_0x0c1b('0x26')](handleError(_0x2be99d,null));};exports[_0x0c1b('0xa1')]=function(_0x33ba90,_0x24c5cb){var _0xa345c6={'raw':!![],'where':{}};var _0x7fb9cd={};var _0xbff65b={'count':0x0,'rows':[]};return db[_0x0c1b('0x27')][_0x0c1b('0x78')]({'where':{'id':_0x33ba90[_0x0c1b('0x29')]['id']}})[_0x0c1b('0x1a')](handleEntityNotFound(_0x24c5cb,null))[_0x0c1b('0x1a')](function(_0x21df18){if(_0x21df18){_0x7fb9cd['model']=_[_0x0c1b('0x2b')](db['CmHopperHistory'][_0x0c1b('0x7a')]);_0x7fb9cd[_0x0c1b('0x24')]=_[_0x0c1b('0x2b')](_0x33ba90[_0x0c1b('0x24')]);_0x7fb9cd[_0x0c1b('0x7b')]=_['intersection'](_0x7fb9cd[_0x0c1b('0x79')],_0x7fb9cd[_0x0c1b('0x24')]);_0xa345c6[_0x0c1b('0x7d')]=_[_0x0c1b('0x7c')](_0x7fb9cd['model'],qs[_0x0c1b('0x7e')](_0x33ba90[_0x0c1b('0x24')][_0x0c1b('0x7e')]));_0xa345c6[_0x0c1b('0x7d')]=_0xa345c6[_0x0c1b('0x7d')][_0x0c1b('0x2c')]?_0xa345c6['attributes']:_0x7fb9cd[_0x0c1b('0x79')];if(!_0x33ba90[_0x0c1b('0x24')]['hasOwnProperty'](_0x0c1b('0x86'))){_0xa345c6[_0x0c1b('0x13')]=qs[_0x0c1b('0x13')](_0x33ba90[_0x0c1b('0x24')]['limit']);_0xa345c6[_0x0c1b('0x10')]=qs['offset'](_0x33ba90['query'][_0x0c1b('0x10')]);}_0xa345c6[_0x0c1b('0x7f')]=qs[_0x0c1b('0x80')](_0x33ba90['query'][_0x0c1b('0x80')]);_0xa345c6['where']=qs[_0x0c1b('0x7b')](_[_0x0c1b('0x81')](_0x33ba90[_0x0c1b('0x24')],_0x7fb9cd[_0x0c1b('0x7b')]));_0xa345c6[_0x0c1b('0x5c')][_0x0c1b('0x9e')]=_0x21df18['id'];if(_0x33ba90[_0x0c1b('0x24')]['filter']){_0xa345c6[_0x0c1b('0x5c')]=_[_0x0c1b('0x83')](_0xa345c6[_0x0c1b('0x5c')],{'$or':_[_0x0c1b('0x6d')](_0xa345c6[_0x0c1b('0x7d')],function(_0xbc343c){var _0x693521={};_0x693521[_0xbc343c]={'$like':'%'+_0x33ba90['query']['filter']+'%'};return _0x693521;})});}_0xa345c6=_[_0x0c1b('0x83')]({},_0xa345c6,_0x33ba90[_0x0c1b('0x84')]);return db[_0x0c1b('0x4b')]['count']({'where':_0xa345c6[_0x0c1b('0x5c')]})[_0x0c1b('0x1a')](function(_0x43b8dd){_0xbff65b[_0x0c1b('0x12')]=_0x43b8dd;if(_0x33ba90[_0x0c1b('0x24')][_0x0c1b('0x9f')]){_0xa345c6[_0x0c1b('0xa2')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x0c1b('0x23')](_0xa345c6);})[_0x0c1b('0x1a')](function(_0x184fac){_0xbff65b[_0x0c1b('0xa0')]=_0x184fac;return _0xbff65b;});}})[_0x0c1b('0x1a')](respondWithFilteredResult(_0x24c5cb,_0xa345c6))['catch'](handleError(_0x24c5cb,null));};exports[_0x0c1b('0xa3')]=function(_0x45a680,_0xdb54f6){var _0x3e291d={'raw':!![],'where':{}};var _0x3aefe3={};var _0x455060={'count':0x0,'rows':[]};return db[_0x0c1b('0x27')][_0x0c1b('0x78')]({'where':{'id':_0x45a680['params']['id']}})[_0x0c1b('0x1a')](handleEntityNotFound(_0xdb54f6,null))[_0x0c1b('0x1a')](function(_0x33ee4a){if(_0x33ee4a){_0x3aefe3[_0x0c1b('0x79')]=_[_0x0c1b('0x2b')](db[_0x0c1b('0x4a')][_0x0c1b('0x7a')]);_0x3aefe3[_0x0c1b('0x24')]=_[_0x0c1b('0x2b')](_0x45a680[_0x0c1b('0x24')]);_0x3aefe3[_0x0c1b('0x7b')]=_[_0x0c1b('0x7c')](_0x3aefe3[_0x0c1b('0x79')],_0x3aefe3[_0x0c1b('0x24')]);_0x3e291d['attributes']=_['intersection'](_0x3aefe3[_0x0c1b('0x79')],qs[_0x0c1b('0x7e')](_0x45a680[_0x0c1b('0x24')][_0x0c1b('0x7e')]));_0x3e291d['attributes']=_0x3e291d[_0x0c1b('0x7d')][_0x0c1b('0x2c')]?_0x3e291d[_0x0c1b('0x7d')]:_0x3aefe3[_0x0c1b('0x79')];if(!_0x45a680[_0x0c1b('0x24')][_0x0c1b('0x95')](_0x0c1b('0x86'))){_0x3e291d[_0x0c1b('0x13')]=qs[_0x0c1b('0x13')](_0x45a680[_0x0c1b('0x24')][_0x0c1b('0x13')]);_0x3e291d[_0x0c1b('0x10')]=qs[_0x0c1b('0x10')](_0x45a680[_0x0c1b('0x24')][_0x0c1b('0x10')]);}_0x3e291d[_0x0c1b('0x7f')]=qs[_0x0c1b('0x80')](_0x45a680[_0x0c1b('0x24')][_0x0c1b('0x80')]);_0x3e291d['where']=qs[_0x0c1b('0x7b')](_[_0x0c1b('0x81')](_0x45a680[_0x0c1b('0x24')],_0x3aefe3['filters']));_0x3e291d['where']['ContactId']=_0x33ee4a['id'];if(_0x45a680[_0x0c1b('0x24')][_0x0c1b('0x82')]){_0x3e291d[_0x0c1b('0x5c')]=_[_0x0c1b('0x83')](_0x3e291d['where'],{'$or':_[_0x0c1b('0x6d')](_0x3e291d[_0x0c1b('0x7d')],function(_0x4ab320){var _0x1c0cec={};_0x1c0cec[_0x4ab320]={'$like':'%'+_0x45a680[_0x0c1b('0x24')][_0x0c1b('0x82')]+'%'};return _0x1c0cec;})});}_0x3e291d=_[_0x0c1b('0x83')]({},_0x3e291d,_0x45a680[_0x0c1b('0x84')]);return db['CmHopperFinal'][_0x0c1b('0x12')]({'where':_0x3e291d[_0x0c1b('0x5c')]})[_0x0c1b('0x1a')](function(_0x553379){_0x455060[_0x0c1b('0x12')]=_0x553379;if(_0x45a680[_0x0c1b('0x24')][_0x0c1b('0x9f')]){_0x3e291d[_0x0c1b('0xa2')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x0c1b('0x23')](_0x3e291d);})[_0x0c1b('0x1a')](function(_0x2d2843){_0x455060[_0x0c1b('0xa0')]=_0x2d2843;return _0x455060;});}})['then'](respondWithFilteredResult(_0xdb54f6,_0x3e291d))[_0x0c1b('0x26')](handleError(_0xdb54f6,null));};exports['getJscriptySessions']=function(_0x703387,_0x50d22c){var _0xc9c1bc={'raw':!![],'where':{}};var _0x2edfd7={};var _0x304303={'count':0x0,'rows':[]};return db[_0x0c1b('0x27')][_0x0c1b('0x78')]({'where':{'id':_0x703387['params']['id']}})[_0x0c1b('0x1a')](handleEntityNotFound(_0x50d22c,null))[_0x0c1b('0x1a')](function(_0x4fd9b9){if(_0x4fd9b9){_0x2edfd7[_0x0c1b('0x79')]=_[_0x0c1b('0x2b')](db[_0x0c1b('0x51')][_0x0c1b('0x7a')]);_0x2edfd7[_0x0c1b('0x24')]=_[_0x0c1b('0x2b')](_0x703387[_0x0c1b('0x24')]);_0x2edfd7[_0x0c1b('0x7b')]=_['intersection'](_0x2edfd7[_0x0c1b('0x79')],_0x2edfd7[_0x0c1b('0x24')]);_0xc9c1bc['attributes']=_[_0x0c1b('0x7c')](_0x2edfd7[_0x0c1b('0x79')],qs[_0x0c1b('0x7e')](_0x703387['query'][_0x0c1b('0x7e')]));_0xc9c1bc[_0x0c1b('0x7d')]=_0xc9c1bc[_0x0c1b('0x7d')][_0x0c1b('0x2c')]?_0xc9c1bc[_0x0c1b('0x7d')]:_0x2edfd7['model'];if(!_0x703387[_0x0c1b('0x24')][_0x0c1b('0x95')](_0x0c1b('0x86'))){_0xc9c1bc['limit']=qs[_0x0c1b('0x13')](_0x703387[_0x0c1b('0x24')][_0x0c1b('0x13')]);_0xc9c1bc[_0x0c1b('0x10')]=qs[_0x0c1b('0x10')](_0x703387['query'][_0x0c1b('0x10')]);}_0xc9c1bc[_0x0c1b('0x7f')]=qs[_0x0c1b('0x80')](_0x703387[_0x0c1b('0x24')][_0x0c1b('0x80')]);_0xc9c1bc['where']=qs['filters'](_[_0x0c1b('0x81')](_0x703387['query'],_0x2edfd7[_0x0c1b('0x7b')]));_0xc9c1bc[_0x0c1b('0x5c')][_0x0c1b('0x9e')]=_0x4fd9b9['id'];if(_0x703387[_0x0c1b('0x24')][_0x0c1b('0x82')]){_0xc9c1bc['where']=_[_0x0c1b('0x83')](_0xc9c1bc[_0x0c1b('0x5c')],{'$or':_[_0x0c1b('0x6d')](_0xc9c1bc[_0x0c1b('0x7d')],function(_0x23008b){var _0x21ce77={};_0x21ce77[_0x23008b]={'$like':'%'+_0x703387['query'][_0x0c1b('0x82')]+'%'};return _0x21ce77;})});}_0xc9c1bc=_[_0x0c1b('0x83')]({},_0xc9c1bc,_0x703387[_0x0c1b('0x84')]);return db['JscriptySessionReport'][_0x0c1b('0x12')]({'where':_0xc9c1bc[_0x0c1b('0x5c')]})[_0x0c1b('0x1a')](function(_0x22d06e){_0x304303['count']=_0x22d06e;if(_0x703387['query'][_0x0c1b('0x9f')]){_0xc9c1bc['include']=[{'all':!![]}];}return db[_0x0c1b('0x51')][_0x0c1b('0x23')](_0xc9c1bc);})[_0x0c1b('0x1a')](function(_0x13783c){_0x304303[_0x0c1b('0xa0')]=_0x13783c;return _0x304303;});}})[_0x0c1b('0x1a')](respondWithFilteredResult(_0x50d22c,_0xc9c1bc))['catch'](handleError(_0x50d22c,null));};exports[_0x0c1b('0xa4')]=function(_0x3f6bf2,_0x356b7f){try{if(!_0x3f6bf2[_0x0c1b('0x35')]['ListId']){throw new Error('No\x20ListId\x20specified');}if(!_0x3f6bf2[_0x0c1b('0x35')]['binding_keys']){throw new Error(_0x0c1b('0xa5'));}if(!_0x3f6bf2['body'][_0x0c1b('0xa6')]){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x3f6bf2[_0x0c1b('0x35')][_0x0c1b('0xa7')]){throw new Error(_0x0c1b('0xa8'));}var _0x56e91e=_0x3f6bf2[_0x0c1b('0x35')][_0x0c1b('0xa9')]['split'](',');var _0x239143=_0x3f6bf2[_0x0c1b('0x35')]['binding_values'][_0x0c1b('0xaa')](',');if(!_0x56e91e[_0x0c1b('0x2c')]||!_0x239143[_0x0c1b('0x2c')]||_0x56e91e[_0x0c1b('0x2c')]!==_0x239143[_0x0c1b('0x2c')]){throw new Error(_0x0c1b('0xab'));}_0x3f6bf2['body'][_0x0c1b('0x7e')]=_[_0x0c1b('0xac')](_0x56e91e,_0x239143);if(!_0x3f6bf2[_0x0c1b('0x35')]['fields'][_0x0c1b('0x77')]){throw new Error(_0x0c1b('0xad'));}if(!_0x3f6bf2[_0x0c1b('0x35')]['fields'][_0x0c1b('0xae')]){throw new Error(_0x0c1b('0xaf'));}var _0x2275d4=path['join'](config[_0x0c1b('0xb0')],_0x0c1b('0xb1'),_0x3f6bf2[_0x0c1b('0xb2')][_0x0c1b('0xb3')]);fs['chmodSync'](_0x2275d4,parseInt(_0x0c1b('0xb4'),0x8));var _0x4a6f3d=require(_0x0c1b('0xb5'))[_0x0c1b('0xb6')](path[_0x0c1b('0x3a')](__dirname,_0x0c1b('0xb7')),[_0x2275d4,_0x3f6bf2[_0x0c1b('0x35')][_0x0c1b('0xa9')],_0x3f6bf2[_0x0c1b('0x35')][_0x0c1b('0xa6')],_0x3f6bf2['body']['ListId'],_0x3f6bf2[_0x0c1b('0x35')][_0x0c1b('0xb8')],_0x3f6bf2[_0x0c1b('0x35')][_0x0c1b('0x59')],_0x3f6bf2[_0x0c1b('0x35')][_0x0c1b('0xa7')]]);return _0x356b7f[_0x0c1b('0x14')](0xc8)[_0x0c1b('0x17')]({'message':_0x0c1b('0xb9'),'pid':_0x4a6f3d[_0x0c1b('0xba')]});}catch(_0x69eea4){return _0x356b7f[_0x0c1b('0x14')](0x1f4)['send'](_0x69eea4);}};exports[_0x0c1b('0xbb')]=function(_0x3ea97b,_0x4b12db){var _0x5f32a6=fs[_0x0c1b('0xbc')](_0x3ea97b[_0x0c1b('0xb2')]['path']);Papa[_0x0c1b('0xbd')](_0x5f32a6,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x572933){return _0x4b12db[_0x0c1b('0x14')](0xc8)[_0x0c1b('0x17')]({'file':_0x3ea97b[_0x0c1b('0xb2')],'fields':_0x572933[_0x0c1b('0xbe')][_0x0c1b('0x7e')]});}});};exports['import']=function(_0x113e92,_0x3d7a9f){return db[_0x0c1b('0xbf')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0c1b('0xc0')}})[_0x0c1b('0x1a')](function(_0x529b0b){var _0x731874=![];if(!_0x113e92[_0x0c1b('0x35')][_0x0c1b('0x5d')]){throw new Error(_0x0c1b('0xc1'));}if(!_0x113e92[_0x0c1b('0x35')]['binding']['phone']){throw new Error(_0x0c1b('0xad'));}if(!_0x113e92[_0x0c1b('0x35')][_0x0c1b('0xc2')][_0x0c1b('0xae')]){throw new Error(_0x0c1b('0xaf'));}if(!_0x113e92[_0x0c1b('0x35')]['socket_timestamp']){throw new Error(_0x0c1b('0xa8'));}var _0x576cf7=require(_0x0c1b('0xb5'))['fork'](path[_0x0c1b('0x3a')](__dirname,_0x0c1b('0xc3')),[_0x113e92[_0x0c1b('0x29')]['id'],JSON['stringify'](_0x113e92[_0x0c1b('0x35')]),JSON[_0x0c1b('0xc4')](_0x529b0b)]);_0x576cf7['on'](_0x0c1b('0xc5'),function(){_0x731874=!![];return _0x3d7a9f[_0x0c1b('0x14')](0xc8)[_0x0c1b('0x17')]({'message':_0x0c1b('0xc6'),'pid':_0x576cf7['pid']});});_0x576cf7['on'](_0x0c1b('0xc7'),function(_0x453e88){if(_0x453e88&&!_0x731874){return _0x3d7a9f[_0x0c1b('0x14')](0x1f4)[_0x0c1b('0x17')]({'message':'error\x20child\x20process','pid':_0x576cf7[_0x0c1b('0xba')]});}});})[_0x0c1b('0x26')](handleError(_0x3d7a9f,null));};exports[_0x0c1b('0xc8')]=function(_0x4333d7,_0x33e259){return db[_0x0c1b('0xbf')][_0x0c1b('0x23')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0x0c1b('0x1a')](function(_0x1f82f0){var _0x10c62c=![];if(!_0x4333d7[_0x0c1b('0x35')][_0x0c1b('0x5d')]){throw new Error(_0x0c1b('0xc1'));}if(!_0x4333d7[_0x0c1b('0x35')][_0x0c1b('0xc2')][_0x0c1b('0x77')]){throw new Error(_0x0c1b('0xad'));}if(!_0x4333d7['body'][_0x0c1b('0xc2')][_0x0c1b('0xae')]){throw new Error(_0x0c1b('0xaf'));}if(!_0x4333d7[_0x0c1b('0x35')][_0x0c1b('0xa7')]){throw new Error(_0x0c1b('0xa8'));}var _0x2a3f81=require(_0x0c1b('0xb5'))['fork'](path[_0x0c1b('0x3a')](__dirname,'../../components/import/cm/csvUpdates'),[_0x4333d7[_0x0c1b('0x29')]['id'],JSON[_0x0c1b('0xc4')](_0x4333d7[_0x0c1b('0x35')]),JSON['stringify'](_0x1f82f0)]);_0x2a3f81['on']('message',function(){_0x10c62c=!![];return _0x33e259[_0x0c1b('0x14')](0xc8)[_0x0c1b('0x17')]({'message':_0x0c1b('0xc6'),'pid':_0x2a3f81[_0x0c1b('0xba')]});});_0x2a3f81['on'](_0x0c1b('0xc7'),function(_0x480b05){if(_0x480b05&&!_0x10c62c){return _0x33e259['status'](0x1f4)[_0x0c1b('0x17')]({'message':_0x0c1b('0xc9'),'pid':_0x2a3f81[_0x0c1b('0xba')]});}});})[_0x0c1b('0x26')](handleError(_0x33e259,null));};exports[_0x0c1b('0xca')]=function(_0x677981,_0x1d2b4c){var _0xe70c0c=[_0x0c1b('0xcb'),_0x0c1b('0xcc'),_0x0c1b('0xcd'),'openchannel',_0x0c1b('0xce'),_0x0c1b('0xcf'),'voice'];var _0x2fb5b0={'offset':0x0,'order':qs[_0x0c1b('0x80')](_0x0c1b('0xd0'))},_0x38d77c={'count':0x0,'rows':[]};Promise['resolve']()[_0x0c1b('0x1a')](function(){if(_0x677981[_0x0c1b('0x24')][_0x0c1b('0xd1')]){if(!_[_0x0c1b('0xd2')](_0xe70c0c,_0x677981['query'][_0x0c1b('0xd1')][_0x0c1b('0xd3')]())){throw new Error(_0x0c1b('0xd4'));}_0xe70c0c=[_0x677981[_0x0c1b('0x24')][_0x0c1b('0xd1')][_0x0c1b('0xd3')]()];}if(_0x677981[_0x0c1b('0x24')][_0x0c1b('0xd5')]){try{var _0x3cea0f=JSON[_0x0c1b('0xbd')](_0x677981[_0x0c1b('0x24')][_0x0c1b('0xd5')]);if(!moment(_0x3cea0f['from'])['isValid']()){throw new Error(_0x0c1b('0xd6'));}if(!moment(_0x3cea0f['to'])[_0x0c1b('0xd7')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x21f5bc){throw new Error(_0x0c1b('0xd8'));}}if(!_0x677981[_0x0c1b('0x24')]['hasOwnProperty'](_0x0c1b('0x86'))){_0x2fb5b0['limit']=qs[_0x0c1b('0x13')](_0x677981[_0x0c1b('0x24')][_0x0c1b('0x13')]||0xa);_0x2fb5b0[_0x0c1b('0x10')]=qs[_0x0c1b('0x10')](_0x677981[_0x0c1b('0x24')][_0x0c1b('0x10')]);}var _0x2dac0e=_0xe70c0c[_0x0c1b('0x6d')](function(_0x485e69){if(_0x485e69===_0x0c1b('0xd9')){var _0x4666e4={'attributes':['id',_0x0c1b('0xda'),_0x0c1b('0xdb'),'source',_0x0c1b('0xdc'),_0x0c1b('0xdd'),'starttime',_0x0c1b('0xde'),_0x0c1b('0xdf'),_0x0c1b('0xe0'),_0x0c1b('0xe1'),_0x0c1b('0xe2'),_0x0c1b('0xe3'),_0x0c1b('0xe4'),'UserId'],'where':{'ContactId':_0x677981[_0x0c1b('0x29')]['id']},'include':[{'model':db[_0x0c1b('0xbf')],'as':'User','attributes':['id','name','fullname',_0x0c1b('0x30')]}],'order':[[_0x0c1b('0xe1'),'DESC']]};if(_0x677981['query'][_0x0c1b('0xd5')]){_0x4666e4[_0x0c1b('0x5c')][_0x0c1b('0xe1')]={'$gte':_0x3cea0f[_0x0c1b('0x36')],'$lte':_0x3cea0f['to']};}return db['VoiceCallReport']['findAndCountAll'](_0x4666e4)['then'](function(_0x5346fa){_0x38d77c[_0x0c1b('0x12')]+=_0x5346fa['count'];return _['map'](_0x5346fa['rows'],function(_0x2bad13){var _0x3638ce=_0x2bad13[_0x0c1b('0x37')]({'plain':!![]});_0x3638ce[_0x0c1b('0xd1')]=_0x485e69;if(_0x3638ce[_0x0c1b('0xbf')]){_0x3638ce['User']={'id':_0x3638ce['User']['id'],'name':_0x3638ce['User'][_0x0c1b('0x1e')],'fullname':_0x3638ce[_0x0c1b('0xbf')][_0x0c1b('0xe5')],'alias':_0x3638ce[_0x0c1b('0xbf')][_0x0c1b('0x30')]};}return _0x3638ce;});});}else{var _0x808c7d=_[_0x0c1b('0xe6')](_0x485e69)+(_0x485e69===_0x0c1b('0xcc')?_0x0c1b('0xe7'):_0x0c1b('0xe8'));var _0x2629f2={'attributes':['id',_0x0c1b('0xe9'),_0x0c1b('0xea'),_0x0c1b('0xe1'),_0x0c1b('0xe0'),_0x0c1b('0xeb'),_0x0c1b('0xec'),_0x0c1b('0xed'),_0x0c1b('0xee'),_0x808c7d+'Id'],'where':{'ContactId':_0x677981[_0x0c1b('0x29')]['id']},'include':[{'model':db[_0x808c7d],'as':_0x0c1b('0xe8'),'attributes':['id','name',_0x0c1b('0xef')]},{'model':db[_0x0c1b('0xbf')],'as':_0x0c1b('0xf0'),'attributes':['id',_0x0c1b('0x1e'),_0x0c1b('0xe5')]},{'model':db[_0x0c1b('0x62')],'as':'Tags','attributes':['id',_0x0c1b('0x1e'),_0x0c1b('0x64')],'through':{'attributes':[]}}],'order':[[_0x0c1b('0xe1'),_0x0c1b('0xf1')]]};if(_0x677981[_0x0c1b('0x24')]['range']){_0x2629f2[_0x0c1b('0x5c')][_0x0c1b('0xe1')]={'$gte':_0x3cea0f['from'],'$lte':_0x3cea0f['to']};}switch(_0x485e69){case _0x0c1b('0xcc'):_0x2629f2[_0x0c1b('0x7d')]['push'](_0x0c1b('0xf2'),_0x0c1b('0xf3'),'customerPort',_0x0c1b('0xf4'),_0x0c1b('0xf5'),_0x0c1b('0xf6'),_0x0c1b('0xf7'),_0x0c1b('0xf8'),_0x0c1b('0xf9'));break;case _0x0c1b('0xcb'):_0x2629f2['attributes'][_0x0c1b('0x5b')](_0x0c1b('0xfa'),_0x0c1b('0xfb'));break;case _0x0c1b('0xfc'):_0x2629f2[_0x0c1b('0x7d')][_0x0c1b('0x5b')](_0x0c1b('0xfd'),_0x0c1b('0xfe'));break;}return db[_[_0x0c1b('0xe6')](_0x485e69)+_0x0c1b('0xff')][_0x0c1b('0x100')](_0x2629f2)[_0x0c1b('0x1a')](function(_0x3d798b){_0x38d77c[_0x0c1b('0x12')]+=_0x3d798b[_0x0c1b('0x12')];return _[_0x0c1b('0x6d')](_0x3d798b[_0x0c1b('0xa0')],function(_0x1a66e9){var _0x194a30=_0x1a66e9[_0x0c1b('0x37')]({'plain':!![]});_0x194a30[_0x0c1b('0xd1')]=_0x485e69;if(_0x194a30[_0x0c1b('0xf0')]){_0x194a30[_0x0c1b('0xf0')]={'id':_0x194a30[_0x0c1b('0xf0')]['id'],'name':_0x194a30[_0x0c1b('0xf0')]['name'],'fullname':_0x194a30[_0x0c1b('0xf0')][_0x0c1b('0xe5')]};}return _0x194a30;});});}});return Promise[_0x0c1b('0x61')](_0x2dac0e);})[_0x0c1b('0x1a')](function(_0x16cfaf){return _(_0x16cfaf)['flatten']()['sortBy'](_0x0c1b('0xe1'))[_0x0c1b('0x101')]()[_0x0c1b('0x102')]();})[_0x0c1b('0x1a')](function(_0x8700bd){_0x38d77c[_0x0c1b('0xa0')]=_0x2fb5b0['limit']?_0x8700bd[_0x0c1b('0x103')](_0x2fb5b0[_0x0c1b('0x10')],_0x2fb5b0[_0x0c1b('0x10')]+_0x2fb5b0[_0x0c1b('0x13')]):_0x8700bd;return _0x38d77c;})[_0x0c1b('0x1a')](respondWithFilteredResult(_0x1d2b4c,_0x2fb5b0))[_0x0c1b('0x26')](handleError(_0x1d2b4c,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index bf917b2..4db2d4a 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3b7b=['update','remove','emit','hasOwnProperty','events','../../mysqldb','CmContact','setMaxListeners','save'];(function(_0x31d92e,_0x30bdbc){var _0x4e348d=function(_0x3fe24c){while(--_0x3fe24c){_0x31d92e['push'](_0x31d92e['shift']());}};_0x4e348d(++_0x30bdbc);}(_0x3b7b,0x187));var _0xb3b7=function(_0x41376a,_0x849432){_0x41376a=_0x41376a-0x0;var _0x5bd0b6=_0x3b7b[_0x41376a];return _0x5bd0b6;};'use strict';var EventEmitter=require(_0xb3b7('0x0'));var CmContact=require(_0xb3b7('0x1'))['db'][_0xb3b7('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xb3b7('0x3')](0x0);var events={'afterCreate':_0xb3b7('0x4'),'afterUpdate':_0xb3b7('0x5'),'afterDestroy':_0xb3b7('0x6')};function emitEvent(_0x37fe9e){return function(_0x19d5b1,_0x31fcd3,_0x531dac){CmContactEvents[_0xb3b7('0x7')](_0x37fe9e+':'+_0x19d5b1['id'],_0x19d5b1);CmContactEvents[_0xb3b7('0x7')](_0x37fe9e,_0x19d5b1);_0x531dac(null);};}for(var e in events){if(events[_0xb3b7('0x8')](e)){var event=events[e];CmContact['hook'](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file +var _0xff67=['hasOwnProperty','hook','exports','events','../../mysqldb','CmContact','setMaxListeners','save','update','remove','emit'];(function(_0x5a2205,_0x372206){var _0xfbafee=function(_0x369f65){while(--_0x369f65){_0x5a2205['push'](_0x5a2205['shift']());}};_0xfbafee(++_0x372206);}(_0xff67,0x1c6));var _0x7ff6=function(_0x5eb3aa,_0x4ccea8){_0x5eb3aa=_0x5eb3aa-0x0;var _0x59a2d2=_0xff67[_0x5eb3aa];return _0x59a2d2;};'use strict';var EventEmitter=require(_0x7ff6('0x0'));var CmContact=require(_0x7ff6('0x1'))['db'][_0x7ff6('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x7ff6('0x3')](0x0);var events={'afterCreate':_0x7ff6('0x4'),'afterUpdate':_0x7ff6('0x5'),'afterDestroy':_0x7ff6('0x6')};function emitEvent(_0x2e8396){return function(_0x26517f,_0x462ec2,_0x34e858){CmContactEvents[_0x7ff6('0x7')](_0x2e8396+':'+_0x26517f['id'],_0x26517f);CmContactEvents['emit'](_0x2e8396,_0x26517f);_0x34e858(null);};}for(var e in events){if(events[_0x7ff6('0x8')](e)){var event=events[e];CmContact[_0x7ff6('0x9')](e,emitEvent(event));}}module[_0x7ff6('0xa')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index c02dfee..9a6606b 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfb21=['callbackUniqueid','phone','assign','[Always]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','\x20in\x20Campaign\x20with\x20id\x20','CmHopperFinal','[Always]\x20Hopper\x20Final\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','CampaignId','VoiceQueueId','create','CmHopper','[OnlyIfOpen]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','findAll','outbound','CmList','Lists','map','dialCheckDuplicateType','all','CmHopperBlack','exports','CmContact','cm_contacts','lastName','mobile','email','utf8mb4','utf8mb4_unicode_ci','models','get','[cmContact][afterCreate]\x20List\x20not\x20found\x20for\x20contact\x20with\x20id\x20','catch','error','message','isEmpty','length','destroy','ContactId','push','info','inspect','[CmContact][afterDestroy][Error]','lodash','util','api','moment','../../config/environment/shared','./cmContact.attributes','Campaign','VoiceQueue','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','dialTimezone','resolve','then','isNil','utcOffset','add','minutes','ListId','priority'];(function(_0x2bbe19,_0x2aeb07){var _0x51357e=function(_0x4c28f2){while(--_0x4c28f2){_0x2bbe19['push'](_0x2bbe19['shift']());}};_0x51357e(++_0x2aeb07);}(_0xfb21,0xe4));var _0x1fb2=function(_0x4fd996,_0xfd9dd5){_0x4fd996=_0x4fd996-0x0;var _0x336139=_0xfb21[_0x4fd996];return _0x336139;};'use strict';var _=require(_0x1fb2('0x0'));var util=require(_0x1fb2('0x1'));var logger=require('../../config/logger')(_0x1fb2('0x2'));var moment=require(_0x1fb2('0x3'));var shared=require(_0x1fb2('0x4'));var attributes=require(_0x1fb2('0x5'));function getTimezoneCallbackAt(_0x122542,_0x189056,_0x463caa,_0x3dde32){var _0x331155=_0x3dde32?_0x1fb2('0x6'):_0x1fb2('0x7');var _0x1b2bec=_0x463caa[_0x1fb2('0x8')]?_0x463caa[_0x1fb2('0x8')]:moment()[_0x1fb2('0x9')](_0x1fb2('0xa'));if(_['isNil'](_0x463caa[_0x1fb2('0xb')])){return Promise[_0x1fb2('0xc')](_0x1b2bec);}return _0x122542[_0x331155]['findOne']({'where':{'id':_0x189056}})[_0x1fb2('0xd')](function(_0x1aee1f){if(_[_0x1fb2('0xe')](_0x1aee1f)||_[_0x1fb2('0xe')](_0x1aee1f[_0x1fb2('0xb')])){return Promise[_0x1fb2('0xc')](_0x1b2bec);}var _0xbd20b1=shared['timezones'];var _0x1cb44a=_0xbd20b1[_0x1aee1f[_0x1fb2('0xb')]];var _0x5075e3=_0xbd20b1[_0x463caa[_0x1fb2('0xb')]];if(_['isNil'](_0x1cb44a)&&_[_0x1fb2('0xe')](_0x5075e3)){return Promise[_0x1fb2('0xc')](_0x1b2bec);}var _0x64bc=_0x1cb44a[_0x1fb2('0xf')]-_0x5075e3[_0x1fb2('0xf')];var _0x4fcd43=_0x463caa[_0x1fb2('0x8')]?_0x463caa[_0x1fb2('0x8')]:moment();_0x1b2bec=moment(_0x4fcd43)[_0x1fb2('0x10')](_0x64bc,_0x1fb2('0x11'))[_0x1fb2('0x9')](_0x1fb2('0xa'));return Promise[_0x1fb2('0xc')](_0x1b2bec);});}function getNewHopperPayload(_0xc4c4b7){return{'phone':_0xc4c4b7['phone'],'ContactId':_0xc4c4b7['id'],'ListId':_0xc4c4b7[_0x1fb2('0x12')],'scheduledat':_0xc4c4b7[_0x1fb2('0x8')]?_0xc4c4b7[_0x1fb2('0x8')]:moment()[_0x1fb2('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0xc4c4b7['priority']?_0xc4c4b7[_0x1fb2('0x13')]:0x2,'callback':_0xc4c4b7['callbackUniqueid']?!![]:![],'callbackuniqueid':_0xc4c4b7[_0x1fb2('0x14')]?_0xc4c4b7[_0x1fb2('0x14')]:undefined,'callbackat':_0xc4c4b7[_0x1fb2('0x14')]?moment()[_0x1fb2('0x9')]('YYYY-MM-DD\x20HH:mm:ss'):undefined};}function handleAlwaysCheckDuplicate(_0x869ab3,_0x2852aa,_0x54ed89,_0x5aaa90){var _0x2252fb={'phone':_0x54ed89[_0x1fb2('0x15')]};var _0x5f20c3={'calleridnum':_0x54ed89[_0x1fb2('0x15')]};if(_0x5aaa90){Object[_0x1fb2('0x16')](_0x2252fb,{'CampaignId':_0x2852aa['id']});Object[_0x1fb2('0x16')](_0x5f20c3,{'CampaignId':_0x2852aa['id']});}else{Object[_0x1fb2('0x16')](_0x2252fb,{'VoiceQueueId':_0x2852aa['id']});Object['assign'](_0x5f20c3,{'VoiceQueueId':_0x2852aa['id']});}return _0x869ab3['CmHopper']['findOne']({'where':_0x2252fb})['then'](function(_0x174b63){if(_0x174b63){throw new Error(_0x1fb2('0x17')+_0x54ed89[_0x1fb2('0x15')]+_0x1fb2('0x18')+_0x2852aa['id']);}return _0x869ab3[_0x1fb2('0x19')]['findOne']({'where':_0x5f20c3});})[_0x1fb2('0xd')](function(_0x3deb3d){if(_0x3deb3d){throw new Error(_0x1fb2('0x1a')+_0x54ed89[_0x1fb2('0x15')]+_0x1fb2('0x18')+_0x2852aa['id']);}var _0x4e0fd5=getNewHopperPayload(_0x54ed89);if(_0x5aaa90){_0x4e0fd5[_0x1fb2('0x1b')]=_0x2852aa['id'];}else{_0x4e0fd5[_0x1fb2('0x1c')]=_0x2852aa['id'];}return _0x869ab3['CmHopper'][_0x1fb2('0x1d')](_0x4e0fd5);});}function handleOnlyIfOpenCheckDuplicate(_0x1b5b4d,_0x49f638,_0xae7ed9,_0x26a060){var _0x5b560c={'phone':_0xae7ed9[_0x1fb2('0x15')]};if(_0x26a060){Object[_0x1fb2('0x16')](_0x5b560c,{'CampaignId':_0x49f638['id']});}else{Object['assign'](_0x5b560c,{'VoiceQueueId':_0x49f638['id']});}return _0x1b5b4d[_0x1fb2('0x1e')]['findOne']({'where':_0x5b560c})[_0x1fb2('0xd')](function(_0xb34c55){if(_0xb34c55){throw new Error(_0x1fb2('0x1f')+_0xae7ed9['phone']+_0x1fb2('0x18')+_0x49f638['id']);}var _0x4591d4=getNewHopperPayload(_0xae7ed9);if(_0x26a060){_0x4591d4['CampaignId']=_0x49f638['id'];}else{_0x4591d4[_0x1fb2('0x1c')]=_0x49f638['id'];}return _0x1b5b4d[_0x1fb2('0x1e')][_0x1fb2('0x1d')](_0x4591d4);});}function handleNeverCheckDuplicate(_0x4abaf8,_0x274c88,_0xc4597d){var _0x3e6d5e=getNewHopperPayload(_0xc4597d);_0x3e6d5e['VoiceQueueId']=_0x274c88['id'];return _0x4abaf8[_0x1fb2('0x1e')][_0x1fb2('0x1d')](_0x3e6d5e);}function handleCheckDuplicate(_0x31deed,_0xec2ca0,_0x353706,_0x1d4685){return getTimezoneCallbackAt(_0x31deed,_0xec2ca0,_0x353706,_0x1d4685)['then'](function(_0x3d453c){_0x353706[_0x1fb2('0x8')]=_0x3d453c;switch(_0xec2ca0['dialCheckDuplicateType']){case'always':return handleAlwaysCheckDuplicate(_0x31deed,_0xec2ca0,_0x353706,_0x1d4685);case'onlyIfOpen':return handleOnlyIfOpenCheckDuplicate(_0x31deed,_0xec2ca0,_0x353706,_0x1d4685);default:return handleNeverCheckDuplicate(_0x31deed,_0xec2ca0,_0x353706);}});}function createHopperForVoiceQueues(_0x3e2fbd,_0x44b584){return _0x3e2fbd[_0x1fb2('0x7')][_0x1fb2('0x20')]({'where':{'type':_0x1fb2('0x21')},'attributes':['id','dialCheckDuplicateType',_0x1fb2('0xb')],'include':[{'model':_0x3e2fbd[_0x1fb2('0x22')],'as':_0x1fb2('0x23'),'where':{'id':_0x44b584['ListId']}}],'raw':!![]})['then'](function(_0x10a5f5){var _0x488e8a=_0x10a5f5[_0x1fb2('0x24')](function(_0x18cf88){return handleCheckDuplicate(_0x3e2fbd,_0x18cf88,_0x44b584,![]);});return Promise['all'](_0x488e8a);});}function createHopperForCampaigns(_0x30bc32,_0xbd1a98){return _0x30bc32['Campaign']['findAll']({'attributes':['id',_0x1fb2('0x25'),_0x1fb2('0xb')],'include':[{'model':_0x30bc32[_0x1fb2('0x22')],'as':_0x1fb2('0x23'),'where':{'id':_0xbd1a98['ListId']}}],'raw':!![]})[_0x1fb2('0xd')](function(_0x49d5ec){var _0x13ed80=_0x49d5ec[_0x1fb2('0x24')](function(_0x501f73){return handleCheckDuplicate(_0x30bc32,_0x501f73,_0xbd1a98,!![]);});return Promise[_0x1fb2('0x26')](_0x13ed80);});}function createHopperBlackForVoiceQueues(_0xc545ee,_0x1f09e6){return _0xc545ee['VoiceQueue'][_0x1fb2('0x20')]({'where':{'type':_0x1fb2('0x21')},'attributes':['id'],'include':[{'model':_0xc545ee['CmList'],'as':'BlackLists','where':{'id':_0x1f09e6[_0x1fb2('0x12')]}}],'raw':!![]})[_0x1fb2('0xd')](function(_0x415fe2){var _0x341c92=_0x415fe2[_0x1fb2('0x24')](function(_0x27062d){return _0xc545ee[_0x1fb2('0x27')][_0x1fb2('0x1d')]({'phone':_0x1f09e6[_0x1fb2('0x15')],'ContactId':_0x1f09e6['id'],'ListId':_0x1f09e6[_0x1fb2('0x12')],'VoiceQueueId':_0x27062d['id']});});return Promise[_0x1fb2('0x26')](_0x341c92);});}function createHopperBlackForCampaigns(_0x32c923,_0x456db2){return _0x32c923[_0x1fb2('0x6')][_0x1fb2('0x20')]({'attributes':['id'],'include':[{'model':_0x32c923[_0x1fb2('0x22')],'as':'BlackLists','where':{'id':_0x456db2[_0x1fb2('0x12')]}}],'raw':!![]})['then'](function(_0xec7fd0){var _0x5f36a6=_0xec7fd0[_0x1fb2('0x24')](function(_0x1c8c10){return _0x32c923[_0x1fb2('0x27')][_0x1fb2('0x1d')]({'phone':_0x456db2[_0x1fb2('0x15')],'ContactId':_0x456db2['id'],'ListId':_0x456db2[_0x1fb2('0x12')],'CampaignId':_0x1c8c10['id']});});return Promise[_0x1fb2('0x26')](_0x5f36a6);});}module[_0x1fb2('0x28')]=function(_0x5996b9){return _0x5996b9['define'](_0x1fb2('0x29'),attributes,{'tableName':_0x1fb2('0x2a'),'paranoid':!![],'indexes':[{'name':'phone','fields':['phone']},{'name':'fti_cm_contacts','fields':['firstName',_0x1fb2('0x2b'),_0x1fb2('0x15'),_0x1fb2('0x2c'),'fax',_0x1fb2('0x2d')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0x1fb2('0x2e'),'collate':_0x1fb2('0x2f'),'hooks':{'afterCreate':function(_0x5e1fa1,_0x39b5c0,_0x448afd){var _0x208726=_0x5996b9[_0x1fb2('0x30')];var _0x23daf9=_0x5e1fa1[_0x1fb2('0x31')]({'plain':!![]});if(!_0x23daf9[_0x1fb2('0x12')]){logger['error'](_0x1fb2('0x32')+_0x23daf9['id']);return _0x448afd();}if(!_0x23daf9[_0x1fb2('0x15')]){return _0x448afd();}return createHopperForVoiceQueues(_0x208726,_0x23daf9)['then'](function(){return createHopperBlackForVoiceQueues(_0x208726,_0x23daf9);})[_0x1fb2('0xd')](function(){return createHopperForCampaigns(_0x208726,_0x23daf9);})[_0x1fb2('0xd')](function(){return createHopperBlackForCampaigns(_0x208726,_0x23daf9);})['then'](function(){return _0x448afd();})[_0x1fb2('0x33')](function(_0x43682b){logger[_0x1fb2('0x34')]('[cmContact][afterCreate]',_0x43682b[_0x1fb2('0x35')]);_0x448afd();});},'afterDestroy':function(_0x390602,_0x4e00ca,_0x20cc7a){var _0x49478f=_0x5996b9[_0x1fb2('0x30')];var _0x562654=_0x390602[_0x1fb2('0x31')]({'plain':!![]});return _0x49478f[_0x1fb2('0x1e')]['findAll']({'raw':!![],'where':{'ListId':_0x562654['ListId'],'ContactId':_0x562654['id']}})[_0x1fb2('0xd')](function(_0x110537){if(!_[_0x1fb2('0x36')](_0x110537)){var _0x5e6888=[];for(var _0x461678=0x0;_0x461678<_0x110537[_0x1fb2('0x37')];_0x461678+=0x1){var _0x3d0854=_0x49478f['CmHopper'][_0x1fb2('0x38')]({'where':{'ListId':_0x110537[_0x461678]['ListId'],'ContactId':_0x110537[_0x461678][_0x1fb2('0x39')],'VoiceQueueId':_0x110537[_0x461678][_0x1fb2('0x1c')],'CampaignId':_0x110537[_0x461678][_0x1fb2('0x1b')]}});_0x5e6888[_0x1fb2('0x3a')](_0x3d0854);}return Promise[_0x1fb2('0x26')](_0x5e6888);}})[_0x1fb2('0xd')](function(_0x3d068d){logger[_0x1fb2('0x3b')]('[CmContact][afterDestroy][Succesfull]',util[_0x1fb2('0x3c')](_0x3d068d,{'showHidden':![],'depth':null}));_0x20cc7a();})['catch'](function(_0x238d9a){logger[_0x1fb2('0x34')](_0x1fb2('0x3d'),util[_0x1fb2('0x3c')](_0x238d9a,{'showHidden':![],'depth':null}));_0x20cc7a(_0x238d9a);});}}});}; \ No newline at end of file +var _0x35e3=['dialCheckDuplicateType','CmList','Lists','ListId','map','all','Campaign','BlackLists','CmHopperBlack','exports','CmContact','fti_cm_contacts','lastName','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','[cmContact][afterCreate]\x20List\x20not\x20found\x20for\x20contact\x20with\x20id\x20','[cmContact][afterCreate]','message','isEmpty','length','destroy','ContactId','push','info','inspect','catch','lodash','util','../../config/logger','api','moment','./cmContact.attributes','YYYY-MM-DD\x20HH:mm:ss','resolve','findOne','then','isNil','dialTimezone','timezones','scheduledat','add','minutes','format','phone','priority','callbackUniqueid','assign','CmHopper','[Always]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','\x20in\x20Campaign\x20with\x20id\x20','CmHopperFinal','[Always]\x20Hopper\x20Final\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20','CampaignId','VoiceQueueId','create','always','onlyIfOpen','VoiceQueue','findAll','outbound'];(function(_0x395718,_0x20322d){var _0x3028b8=function(_0x416f5c){while(--_0x416f5c){_0x395718['push'](_0x395718['shift']());}};_0x3028b8(++_0x20322d);}(_0x35e3,0xe6));var _0x335e=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x35e3[_0x288f5e];return _0x476cc9;};'use strict';var _=require(_0x335e('0x0'));var util=require(_0x335e('0x1'));var logger=require(_0x335e('0x2'))(_0x335e('0x3'));var moment=require(_0x335e('0x4'));var shared=require('../../config/environment/shared');var attributes=require(_0x335e('0x5'));function getTimezoneCallbackAt(_0x2525e1,_0x316315,_0x1bfdf8,_0x210a7e){var _0x4427f7=_0x210a7e?'Campaign':'VoiceQueue';var _0x4cf0dd=_0x1bfdf8['scheduledat']?_0x1bfdf8['scheduledat']:moment()['format'](_0x335e('0x6'));if(_['isNil'](_0x1bfdf8['dialTimezone'])){return Promise[_0x335e('0x7')](_0x4cf0dd);}return _0x2525e1[_0x4427f7][_0x335e('0x8')]({'where':{'id':_0x316315}})[_0x335e('0x9')](function(_0x5a10f8){if(_[_0x335e('0xa')](_0x5a10f8)||_['isNil'](_0x5a10f8[_0x335e('0xb')])){return Promise[_0x335e('0x7')](_0x4cf0dd);}var _0x168fb8=shared[_0x335e('0xc')];var _0x20dcf7=_0x168fb8[_0x5a10f8[_0x335e('0xb')]];var _0x12df1f=_0x168fb8[_0x1bfdf8[_0x335e('0xb')]];if(_[_0x335e('0xa')](_0x20dcf7)&&_['isNil'](_0x12df1f)){return Promise[_0x335e('0x7')](_0x4cf0dd);}var _0x403fa7=_0x20dcf7['utcOffset']-_0x12df1f['utcOffset'];var _0x459923=_0x1bfdf8[_0x335e('0xd')]?_0x1bfdf8[_0x335e('0xd')]:moment();_0x4cf0dd=moment(_0x459923)[_0x335e('0xe')](_0x403fa7,_0x335e('0xf'))[_0x335e('0x10')](_0x335e('0x6'));return Promise[_0x335e('0x7')](_0x4cf0dd);});}function getNewHopperPayload(_0x851773){return{'phone':_0x851773[_0x335e('0x11')],'ContactId':_0x851773['id'],'ListId':_0x851773['ListId'],'scheduledat':_0x851773['scheduledat']?_0x851773[_0x335e('0xd')]:moment()[_0x335e('0x10')](_0x335e('0x6')),'priority':_0x851773[_0x335e('0x12')]?_0x851773[_0x335e('0x12')]:0x2,'callback':_0x851773[_0x335e('0x13')]?!![]:![],'callbackuniqueid':_0x851773[_0x335e('0x13')]?_0x851773[_0x335e('0x13')]:undefined,'callbackat':_0x851773['callbackUniqueid']?moment()[_0x335e('0x10')](_0x335e('0x6')):undefined};}function handleAlwaysCheckDuplicate(_0x3315b8,_0x58fa1b,_0x50dc83,_0x43ae79){var _0x392ac0={'phone':_0x50dc83[_0x335e('0x11')]};var _0x471cb9={'calleridnum':_0x50dc83[_0x335e('0x11')]};if(_0x43ae79){Object['assign'](_0x392ac0,{'CampaignId':_0x58fa1b['id']});Object[_0x335e('0x14')](_0x471cb9,{'CampaignId':_0x58fa1b['id']});}else{Object[_0x335e('0x14')](_0x392ac0,{'VoiceQueueId':_0x58fa1b['id']});Object[_0x335e('0x14')](_0x471cb9,{'VoiceQueueId':_0x58fa1b['id']});}return _0x3315b8[_0x335e('0x15')]['findOne']({'where':_0x392ac0})[_0x335e('0x9')](function(_0x5c9af1){if(_0x5c9af1){throw new Error(_0x335e('0x16')+_0x50dc83['phone']+_0x335e('0x17')+_0x58fa1b['id']);}return _0x3315b8[_0x335e('0x18')][_0x335e('0x8')]({'where':_0x471cb9});})[_0x335e('0x9')](function(_0x491312){if(_0x491312){throw new Error(_0x335e('0x19')+_0x50dc83[_0x335e('0x11')]+_0x335e('0x17')+_0x58fa1b['id']);}var _0x30247f=getNewHopperPayload(_0x50dc83);if(_0x43ae79){_0x30247f[_0x335e('0x1a')]=_0x58fa1b['id'];}else{_0x30247f['VoiceQueueId']=_0x58fa1b['id'];}return _0x3315b8[_0x335e('0x15')]['create'](_0x30247f);});}function handleOnlyIfOpenCheckDuplicate(_0x436f1b,_0x22f52d,_0x2c1408,_0x22a69f){var _0x1da7e4={'phone':_0x2c1408['phone']};if(_0x22a69f){Object['assign'](_0x1da7e4,{'CampaignId':_0x22f52d['id']});}else{Object['assign'](_0x1da7e4,{'VoiceQueueId':_0x22f52d['id']});}return _0x436f1b[_0x335e('0x15')][_0x335e('0x8')]({'where':_0x1da7e4})[_0x335e('0x9')](function(_0x1f24b2){if(_0x1f24b2){throw new Error('[OnlyIfOpen]\x20Hopper\x20already\x20exists\x20for\x20contact\x20with\x20phone\x20'+_0x2c1408['phone']+_0x335e('0x17')+_0x22f52d['id']);}var _0x42b33e=getNewHopperPayload(_0x2c1408);if(_0x22a69f){_0x42b33e[_0x335e('0x1a')]=_0x22f52d['id'];}else{_0x42b33e[_0x335e('0x1b')]=_0x22f52d['id'];}return _0x436f1b[_0x335e('0x15')][_0x335e('0x1c')](_0x42b33e);});}function handleNeverCheckDuplicate(_0xbbe068,_0x96647d,_0x26564d){var _0x360084=getNewHopperPayload(_0x26564d);_0x360084[_0x335e('0x1b')]=_0x96647d['id'];return _0xbbe068[_0x335e('0x15')]['create'](_0x360084);}function handleCheckDuplicate(_0x1ab7af,_0x88753e,_0x22a22b,_0x4a0c47){return getTimezoneCallbackAt(_0x1ab7af,_0x88753e,_0x22a22b,_0x4a0c47)[_0x335e('0x9')](function(_0xe2dbbf){_0x22a22b[_0x335e('0xd')]=_0xe2dbbf;switch(_0x88753e['dialCheckDuplicateType']){case _0x335e('0x1d'):return handleAlwaysCheckDuplicate(_0x1ab7af,_0x88753e,_0x22a22b,_0x4a0c47);case _0x335e('0x1e'):return handleOnlyIfOpenCheckDuplicate(_0x1ab7af,_0x88753e,_0x22a22b,_0x4a0c47);default:return handleNeverCheckDuplicate(_0x1ab7af,_0x88753e,_0x22a22b);}});}function createHopperForVoiceQueues(_0x3ef36f,_0x155f69){return _0x3ef36f[_0x335e('0x1f')][_0x335e('0x20')]({'where':{'type':_0x335e('0x21')},'attributes':['id',_0x335e('0x22'),_0x335e('0xb')],'include':[{'model':_0x3ef36f[_0x335e('0x23')],'as':_0x335e('0x24'),'where':{'id':_0x155f69[_0x335e('0x25')]}}],'raw':!![]})[_0x335e('0x9')](function(_0x1f5f05){var _0x26c29a=_0x1f5f05[_0x335e('0x26')](function(_0x2f7118){return handleCheckDuplicate(_0x3ef36f,_0x2f7118,_0x155f69,![]);});return Promise[_0x335e('0x27')](_0x26c29a);});}function createHopperForCampaigns(_0x4e63ca,_0x3397d3){return _0x4e63ca[_0x335e('0x28')][_0x335e('0x20')]({'attributes':['id','dialCheckDuplicateType',_0x335e('0xb')],'include':[{'model':_0x4e63ca[_0x335e('0x23')],'as':'Lists','where':{'id':_0x3397d3[_0x335e('0x25')]}}],'raw':!![]})[_0x335e('0x9')](function(_0x2f235c){var _0x53bec2=_0x2f235c[_0x335e('0x26')](function(_0x2e9bae){return handleCheckDuplicate(_0x4e63ca,_0x2e9bae,_0x3397d3,!![]);});return Promise[_0x335e('0x27')](_0x53bec2);});}function createHopperBlackForVoiceQueues(_0x4b9871,_0x32b29c){return _0x4b9871[_0x335e('0x1f')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x4b9871[_0x335e('0x23')],'as':_0x335e('0x29'),'where':{'id':_0x32b29c['ListId']}}],'raw':!![]})[_0x335e('0x9')](function(_0x5302d9){var _0x917c58=_0x5302d9[_0x335e('0x26')](function(_0x503c6f){return _0x4b9871[_0x335e('0x2a')]['create']({'phone':_0x32b29c[_0x335e('0x11')],'ContactId':_0x32b29c['id'],'ListId':_0x32b29c[_0x335e('0x25')],'VoiceQueueId':_0x503c6f['id']});});return Promise[_0x335e('0x27')](_0x917c58);});}function createHopperBlackForCampaigns(_0x127e2d,_0x537be4){return _0x127e2d['Campaign']['findAll']({'attributes':['id'],'include':[{'model':_0x127e2d[_0x335e('0x23')],'as':_0x335e('0x29'),'where':{'id':_0x537be4[_0x335e('0x25')]}}],'raw':!![]})[_0x335e('0x9')](function(_0x2a26f6){var _0x1ac79c=_0x2a26f6[_0x335e('0x26')](function(_0x70194b){return _0x127e2d[_0x335e('0x2a')][_0x335e('0x1c')]({'phone':_0x537be4[_0x335e('0x11')],'ContactId':_0x537be4['id'],'ListId':_0x537be4[_0x335e('0x25')],'CampaignId':_0x70194b['id']});});return Promise[_0x335e('0x27')](_0x1ac79c);});}module[_0x335e('0x2b')]=function(_0x495e4e){return _0x495e4e['define'](_0x335e('0x2c'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0x335e('0x11'),'fields':[_0x335e('0x11')]},{'name':_0x335e('0x2d'),'fields':['firstName',_0x335e('0x2e'),'phone','mobile',_0x335e('0x2f'),_0x335e('0x30')],'type':_0x335e('0x31')}],'timestamps':!![],'charset':_0x335e('0x32'),'collate':_0x335e('0x33'),'hooks':{'afterCreate':function(_0x532368,_0xae08f7,_0x2061e2){var _0x4164a3=_0x495e4e[_0x335e('0x34')];var _0x275dfb=_0x532368[_0x335e('0x35')]({'plain':!![]});if(!_0x275dfb['ListId']){logger[_0x335e('0x36')](_0x335e('0x37')+_0x275dfb['id']);return _0x2061e2();}if(!_0x275dfb[_0x335e('0x11')]){return _0x2061e2();}return createHopperForVoiceQueues(_0x4164a3,_0x275dfb)[_0x335e('0x9')](function(){return createHopperBlackForVoiceQueues(_0x4164a3,_0x275dfb);})[_0x335e('0x9')](function(){return createHopperForCampaigns(_0x4164a3,_0x275dfb);})[_0x335e('0x9')](function(){return createHopperBlackForCampaigns(_0x4164a3,_0x275dfb);})[_0x335e('0x9')](function(){return _0x2061e2();})['catch'](function(_0x25e351){logger['error'](_0x335e('0x38'),_0x25e351[_0x335e('0x39')]);_0x2061e2();});},'afterDestroy':function(_0x5471ff,_0x4c0960,_0xb1d959){var _0x12cccd=_0x495e4e['models'];var _0x4dbf8e=_0x5471ff[_0x335e('0x35')]({'plain':!![]});return _0x12cccd[_0x335e('0x15')]['findAll']({'raw':!![],'where':{'ListId':_0x4dbf8e[_0x335e('0x25')],'ContactId':_0x4dbf8e['id']}})[_0x335e('0x9')](function(_0x584844){if(!_[_0x335e('0x3a')](_0x584844)){var _0x39a25d=[];for(var _0x4bbe3b=0x0;_0x4bbe3b<_0x584844[_0x335e('0x3b')];_0x4bbe3b+=0x1){var _0x26fbf2=_0x12cccd[_0x335e('0x15')][_0x335e('0x3c')]({'where':{'ListId':_0x584844[_0x4bbe3b]['ListId'],'ContactId':_0x584844[_0x4bbe3b][_0x335e('0x3d')],'VoiceQueueId':_0x584844[_0x4bbe3b]['VoiceQueueId'],'CampaignId':_0x584844[_0x4bbe3b][_0x335e('0x1a')]}});_0x39a25d[_0x335e('0x3e')](_0x26fbf2);}return Promise[_0x335e('0x27')](_0x39a25d);}})[_0x335e('0x9')](function(_0x3e8fdc){logger[_0x335e('0x3f')]('[CmContact][afterDestroy][Succesfull]',util[_0x335e('0x40')](_0x3e8fdc,{'showHidden':![],'depth':null}));_0xb1d959();})[_0x335e('0x41')](function(_0x23b3c0){logger[_0x335e('0x36')]('[CmContact][afterDestroy][Error]',util[_0x335e('0x40')](_0x23b3c0,{'showHidden':![],'depth':null}));_0xb1d959(_0x23b3c0);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index f3b9de4..1c7057a 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x5ec012,_0x56682e){var _0x1778b0=function(_0xe6fc3a){while(--_0xe6fc3a){_0x5ec012['push'](_0x5ec012['shift']());}};_0x1778b0(++_0x56682e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index 5a573b2..1fb5919 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe920=['sequelize','exports','INTEGER','STRING','PHONE'];(function(_0x1e7ec4,_0x34c4a1){var _0xbe679f=function(_0x5bb6f1){while(--_0x5bb6f1){_0x1e7ec4['push'](_0x1e7ec4['shift']());}};_0xbe679f(++_0x34c4a1);}(_0xe920,0xbe));var _0x0e92=function(_0x3c487b,_0x44c5e2){_0x3c487b=_0x3c487b-0x0;var _0x1d65f6=_0xe920[_0x3c487b];return _0x1d65f6;};'use strict';var Sequelize=require(_0x0e92('0x0'));module[_0x0e92('0x1')]={'CmContactId':{'type':Sequelize[_0x0e92('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x0e92('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x0e92('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x0e92('0x3')],'defaultValue':_0x0e92('0x4')},'OrderBy':{'type':Sequelize[_0x0e92('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x0e92('0x3')],'defaultValue':null}}; \ No newline at end of file +var _0xbf5c=['exports','INTEGER','STRING','PHONE','sequelize'];(function(_0x1c2421,_0x1c152c){var _0x5867b2=function(_0x16e49c){while(--_0x16e49c){_0x1c2421['push'](_0x1c2421['shift']());}};_0x5867b2(++_0x1c152c);}(_0xbf5c,0xb8));var _0xcbf5=function(_0x13fb84,_0x4839f6){_0x13fb84=_0x13fb84-0x0;var _0x71607a=_0xbf5c[_0x13fb84];return _0x71607a;};'use strict';var Sequelize=require(_0xcbf5('0x0'));module[_0xcbf5('0x1')]={'CmContactId':{'type':Sequelize[_0xcbf5('0x2')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xcbf5('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xcbf5('0x3')],'defaultValue':_0xcbf5('0x4')},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':null},'description':{'type':Sequelize[_0xcbf5('0x3')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 1534a5f..4c01e01 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6bac=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','show','params','rawAttributes','include','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','CmContactHasItems','UserProfileSection','autoAssociation','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','UserProfileResource','sendStatus','error','stack','name','send','map','CmContactHasItem','fieldName','type','key','model'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6bac,0x72));var _0xc6ba=function(_0x1d0da9,_0x4ced7c){_0x1d0da9=_0x1d0da9-0x0;var _0x1ec980=_0x6bac[_0x1d0da9];return _0x1ec980;};'use strict';var emlformat=require(_0xc6ba('0x0'));var rimraf=require(_0xc6ba('0x1'));var zipdir=require(_0xc6ba('0x2'));var jsonpatch=require(_0xc6ba('0x3'));var rp=require('request-promise');var moment=require(_0xc6ba('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc6ba('0x5'));var sox=require(_0xc6ba('0x6'));var csv=require(_0xc6ba('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc6ba('0x8'));var _=require(_0xc6ba('0x9'));var squel=require(_0xc6ba('0xa'));var crypto=require(_0xc6ba('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc6ba('0x7'));var querystring=require(_0xc6ba('0xc'));var Papa=require(_0xc6ba('0xd'));var Redis=require(_0xc6ba('0xe'));var authService=require(_0xc6ba('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xc6ba('0x10'));var hardwareService=require(_0xc6ba('0x11'));var logger=require(_0xc6ba('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xc6ba('0x13'));var licenseUtil=require(_0xc6ba('0x14'));var db=require(_0xc6ba('0x15'))['db'];function respondWithStatusCode(_0x546ad9,_0x1a95f1){_0x1a95f1=_0x1a95f1||0xcc;return function(_0x271a78){if(_0x271a78){return _0x546ad9['sendStatus'](_0x1a95f1);}return _0x546ad9[_0xc6ba('0x16')](_0x1a95f1)[_0xc6ba('0x17')]();};}function respondWithResult(_0x204217,_0x4b4308){_0x4b4308=_0x4b4308||0xc8;return function(_0x515e5f){if(_0x515e5f){return _0x204217[_0xc6ba('0x16')](_0x4b4308)[_0xc6ba('0x18')](_0x515e5f);}};}function respondWithFilteredResult(_0x2531ca,_0x28dd38){return function(_0x3e679a){if(_0x3e679a){var _0x71f9f0=typeof _0x28dd38[_0xc6ba('0x19')]===_0xc6ba('0x1a')&&typeof _0x28dd38['limit']===_0xc6ba('0x1a');var _0x3bb0d2=_0x3e679a[_0xc6ba('0x1b')];var _0x4bda7e=_0x71f9f0?0x0:_0x28dd38[_0xc6ba('0x19')];var _0x43426c=_0x71f9f0?_0x3e679a['count']:_0x28dd38[_0xc6ba('0x19')]+_0x28dd38[_0xc6ba('0x1c')];var _0x153f28;if(_0x43426c>=_0x3bb0d2){_0x43426c=_0x3bb0d2;_0x153f28=0xc8;}else{_0x153f28=0xce;}_0x2531ca['status'](_0x153f28);return _0x2531ca[_0xc6ba('0x1d')](_0xc6ba('0x1e'),_0x4bda7e+'-'+_0x43426c+'/'+_0x3bb0d2)[_0xc6ba('0x18')](_0x3e679a);}return null;};}function patchUpdates(_0x494f63){return function(_0xa9af61){try{jsonpatch[_0xc6ba('0x1f')](_0xa9af61,_0x494f63,!![]);}catch(_0x513893){return BPromise[_0xc6ba('0x20')](_0x513893);}return _0xa9af61[_0xc6ba('0x21')]();};}function saveUpdates(_0x49f869,_0x1f7ce2){return function(_0x14b0c1){if(_0x14b0c1){return _0x14b0c1['update'](_0x49f869)[_0xc6ba('0x22')](function(_0x21968f){return _0x21968f;});}return null;};}function removeEntity(_0x1c5952,_0xeb3123){return function(_0x474da8){if(_0x474da8){return _0x474da8[_0xc6ba('0x23')]()[_0xc6ba('0x22')](function(){var _0x2ec946=_0x474da8['get']({'plain':!![]});var _0x3acbfd='CmContactHasItems';return db[_0xc6ba('0x24')][_0xc6ba('0x23')]({'where':{'type':_0x3acbfd,'resourceId':_0x2ec946['id']}})[_0xc6ba('0x22')](function(){return _0x474da8;});})[_0xc6ba('0x22')](function(){_0x1c5952[_0xc6ba('0x16')](0xcc)[_0xc6ba('0x17')]();});}};}function handleEntityNotFound(_0x259f11,_0x191575){return function(_0x5a8241){if(!_0x5a8241){_0x259f11[_0xc6ba('0x25')](0x194);}return _0x5a8241;};}function handleError(_0x149542,_0x4417ff){_0x4417ff=_0x4417ff||0x1f4;return function(_0x4ee457){logger[_0xc6ba('0x26')](_0x4ee457[_0xc6ba('0x27')]);if(_0x4ee457['name']){delete _0x4ee457[_0xc6ba('0x28')];}_0x149542[_0xc6ba('0x16')](_0x4417ff)[_0xc6ba('0x29')](_0x4ee457);};}exports['index']=function(_0x3cc7e2,_0x98c080){var _0x4408a5={},_0x5f0228={},_0x562c85={'count':0x0,'rows':[]};var _0x301f7d=_[_0xc6ba('0x2a')](db[_0xc6ba('0x2b')]['rawAttributes'],function(_0x3d0bde){return{'name':_0x3d0bde[_0xc6ba('0x2c')],'type':_0x3d0bde[_0xc6ba('0x2d')][_0xc6ba('0x2e')]};});_0x5f0228[_0xc6ba('0x2f')]=_[_0xc6ba('0x2a')](_0x301f7d,'name');_0x5f0228[_0xc6ba('0x30')]=_[_0xc6ba('0x31')](_0x3cc7e2[_0xc6ba('0x30')]);_0x5f0228[_0xc6ba('0x32')]=_[_0xc6ba('0x33')](_0x5f0228[_0xc6ba('0x2f')],_0x5f0228[_0xc6ba('0x30')]);_0x4408a5[_0xc6ba('0x34')]=_[_0xc6ba('0x33')](_0x5f0228['model'],qs[_0xc6ba('0x35')](_0x3cc7e2[_0xc6ba('0x30')]['fields']));_0x4408a5[_0xc6ba('0x34')]=_0x4408a5[_0xc6ba('0x34')][_0xc6ba('0x36')]?_0x4408a5[_0xc6ba('0x34')]:_0x5f0228[_0xc6ba('0x2f')];if(!_0x3cc7e2[_0xc6ba('0x30')][_0xc6ba('0x37')](_0xc6ba('0x38'))){_0x4408a5[_0xc6ba('0x1c')]=qs[_0xc6ba('0x1c')](_0x3cc7e2[_0xc6ba('0x30')][_0xc6ba('0x1c')]);_0x4408a5['offset']=qs[_0xc6ba('0x19')](_0x3cc7e2[_0xc6ba('0x30')][_0xc6ba('0x19')]);}_0x4408a5['order']=qs[_0xc6ba('0x39')](_0x3cc7e2['query'][_0xc6ba('0x39')]);_0x4408a5['where']=qs[_0xc6ba('0x32')](_[_0xc6ba('0x3a')](_0x3cc7e2[_0xc6ba('0x30')],_0x5f0228[_0xc6ba('0x32')]),_0x301f7d);if(_0x3cc7e2['query'][_0xc6ba('0x3b')]){_0x4408a5[_0xc6ba('0x3c')]=_[_0xc6ba('0x3d')](_0x4408a5['where'],{'$or':_['map'](_0x301f7d,function(_0xea2bc3){if(_0xea2bc3[_0xc6ba('0x2d')]!==_0xc6ba('0x3e')){var _0x29041e={};_0x29041e[_0xea2bc3[_0xc6ba('0x28')]]={'$like':'%'+_0x3cc7e2[_0xc6ba('0x30')][_0xc6ba('0x3b')]+'%'};return _0x29041e;}})});}_0x4408a5=_[_0xc6ba('0x3d')]({},_0x4408a5,_0x3cc7e2[_0xc6ba('0x3f')]);var _0x5b4003={'where':_0x4408a5[_0xc6ba('0x3c')]};return db[_0xc6ba('0x2b')]['count'](_0x5b4003)[_0xc6ba('0x22')](function(_0x692b51){_0x562c85[_0xc6ba('0x1b')]=_0x692b51;if(_0x3cc7e2['query'][_0xc6ba('0x40')]){_0x4408a5['include']=[{'all':!![]}];}return db[_0xc6ba('0x2b')]['findAll'](_0x4408a5);})[_0xc6ba('0x22')](function(_0x4aaac9){_0x562c85[_0xc6ba('0x41')]=_0x4aaac9;return _0x562c85;})[_0xc6ba('0x22')](respondWithFilteredResult(_0x98c080,_0x4408a5))['catch'](handleError(_0x98c080,null));};exports[_0xc6ba('0x42')]=function(_0x89b09b,_0x6444c7){var _0x44bb66={'raw':!![],'where':{'id':_0x89b09b[_0xc6ba('0x43')]['id']}},_0x2cce3d={};_0x2cce3d['model']=_[_0xc6ba('0x31')](db[_0xc6ba('0x2b')][_0xc6ba('0x44')]);_0x2cce3d[_0xc6ba('0x30')]=_[_0xc6ba('0x31')](_0x89b09b[_0xc6ba('0x30')]);_0x2cce3d[_0xc6ba('0x32')]=_[_0xc6ba('0x33')](_0x2cce3d[_0xc6ba('0x2f')],_0x2cce3d[_0xc6ba('0x30')]);_0x44bb66[_0xc6ba('0x34')]=_[_0xc6ba('0x33')](_0x2cce3d[_0xc6ba('0x2f')],qs[_0xc6ba('0x35')](_0x89b09b[_0xc6ba('0x30')][_0xc6ba('0x35')]));_0x44bb66[_0xc6ba('0x34')]=_0x44bb66[_0xc6ba('0x34')]['length']?_0x44bb66['attributes']:_0x2cce3d['model'];if(_0x89b09b[_0xc6ba('0x30')][_0xc6ba('0x40')]){_0x44bb66[_0xc6ba('0x45')]=[{'all':!![]}];}_0x44bb66=_[_0xc6ba('0x3d')]({},_0x44bb66,_0x89b09b[_0xc6ba('0x3f')]);return db[_0xc6ba('0x2b')][_0xc6ba('0x46')](_0x44bb66)['then'](handleEntityNotFound(_0x6444c7,null))[_0xc6ba('0x22')](respondWithResult(_0x6444c7,null))[_0xc6ba('0x47')](handleError(_0x6444c7,null));};exports[_0xc6ba('0x48')]=function(_0x252f06,_0x5574c6){return db['CmContactHasItem'][_0xc6ba('0x48')](_0x252f06[_0xc6ba('0x49')],{})[_0xc6ba('0x22')](function(_0x458600){var _0x5de6d1=_0x252f06[_0xc6ba('0x4a')][_0xc6ba('0x4b')]({'plain':!![]});if(!_0x5de6d1)throw new Error(_0xc6ba('0x4c'));if(_0x5de6d1['role']==='user'){var _0x456de6=_0x458600[_0xc6ba('0x4b')]({'plain':!![]});var _0x4c8c8d=_0xc6ba('0x4d');return db[_0xc6ba('0x4e')][_0xc6ba('0x46')]({'where':{'name':_0x4c8c8d,'userProfileId':_0x5de6d1['userProfileId']},'raw':!![]})[_0xc6ba('0x22')](function(_0x2cb17d){if(_0x2cb17d&&_0x2cb17d[_0xc6ba('0x4f')]===0x0){return db[_0xc6ba('0x24')][_0xc6ba('0x48')]({'name':_0x456de6['name'],'resourceId':_0x456de6['id'],'type':_0x2cb17d[_0xc6ba('0x28')],'sectionId':_0x2cb17d['id']},{})[_0xc6ba('0x22')](function(){return _0x458600;});}else{return _0x458600;}})[_0xc6ba('0x47')](function(_0x23aa40){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x23aa40);throw _0x23aa40;});}return _0x458600;})[_0xc6ba('0x22')](respondWithResult(_0x5574c6,0xc9))['catch'](handleError(_0x5574c6,null));};exports[_0xc6ba('0x50')]=function(_0x44a043,_0x57edb0){if(_0x44a043['body']['id']){delete _0x44a043[_0xc6ba('0x49')]['id'];}return db[_0xc6ba('0x2b')][_0xc6ba('0x46')]({'where':{'id':_0x44a043[_0xc6ba('0x43')]['id']}})[_0xc6ba('0x22')](handleEntityNotFound(_0x57edb0,null))[_0xc6ba('0x22')](saveUpdates(_0x44a043[_0xc6ba('0x49')],null))[_0xc6ba('0x22')](respondWithResult(_0x57edb0,null))[_0xc6ba('0x47')](handleError(_0x57edb0,null));};exports[_0xc6ba('0x23')]=function(_0x4e1ff9,_0x1a2251){return db[_0xc6ba('0x2b')][_0xc6ba('0x46')]({'where':{'id':_0x4e1ff9[_0xc6ba('0x43')]['id']}})['then'](handleEntityNotFound(_0x1a2251,null))[_0xc6ba('0x22')](removeEntity(_0x1a2251,null))['catch'](handleError(_0x1a2251,null));}; \ No newline at end of file +var _0x67df=['bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','CmContactHasItems','UserProfileResource','error','stack','name','send','index','CmContactHasItem','rawAttributes','fieldName','type','model','map','query','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','includeAll','include','findAll','rows','catch','params','keys','intersection','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x67df,0x1d4));var _0xf67d=function(_0x225207,_0x174002){_0x225207=_0x225207-0x0;var _0x5f9aad=_0x67df[_0x225207];return _0x5f9aad;};'use strict';var emlformat=require(_0xf67d('0x0'));var rimraf=require(_0xf67d('0x1'));var zipdir=require(_0xf67d('0x2'));var jsonpatch=require(_0xf67d('0x3'));var rp=require(_0xf67d('0x4'));var moment=require(_0xf67d('0x5'));var BPromise=require(_0xf67d('0x6'));var Mustache=require(_0xf67d('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf67d('0x8'));var csv=require(_0xf67d('0x9'));var ejs=require(_0xf67d('0xa'));var fs=require('fs');var fs_extra=require(_0xf67d('0xb'));var _=require(_0xf67d('0xc'));var squel=require(_0xf67d('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf67d('0xe'));var toCsv=require(_0xf67d('0x9'));var querystring=require(_0xf67d('0xf'));var Papa=require(_0xf67d('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf67d('0x11'));var logger=require(_0xf67d('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf67d('0x13'));var db=require(_0xf67d('0x14'))['db'];function respondWithStatusCode(_0x27b7bc,_0x515f8d){_0x515f8d=_0x515f8d||0xcc;return function(_0x1d5e8f){if(_0x1d5e8f){return _0x27b7bc[_0xf67d('0x15')](_0x515f8d);}return _0x27b7bc[_0xf67d('0x16')](_0x515f8d)[_0xf67d('0x17')]();};}function respondWithResult(_0x481080,_0x1a11a8){_0x1a11a8=_0x1a11a8||0xc8;return function(_0x147250){if(_0x147250){return _0x481080[_0xf67d('0x16')](_0x1a11a8)[_0xf67d('0x18')](_0x147250);}};}function respondWithFilteredResult(_0x321d64,_0x4722e5){return function(_0x35fb19){if(_0x35fb19){var _0x59420c=typeof _0x4722e5[_0xf67d('0x19')]===_0xf67d('0x1a')&&typeof _0x4722e5[_0xf67d('0x1b')]===_0xf67d('0x1a');var _0x423174=_0x35fb19[_0xf67d('0x1c')];var _0x19621c=_0x59420c?0x0:_0x4722e5['offset'];var _0x2362ef=_0x59420c?_0x35fb19['count']:_0x4722e5[_0xf67d('0x19')]+_0x4722e5[_0xf67d('0x1b')];var _0x4a9ed7;if(_0x2362ef>=_0x423174){_0x2362ef=_0x423174;_0x4a9ed7=0xc8;}else{_0x4a9ed7=0xce;}_0x321d64[_0xf67d('0x16')](_0x4a9ed7);return _0x321d64['set']('Content-Range',_0x19621c+'-'+_0x2362ef+'/'+_0x423174)['json'](_0x35fb19);}return null;};}function patchUpdates(_0x7b3e60){return function(_0x4c8298){try{jsonpatch[_0xf67d('0x1d')](_0x4c8298,_0x7b3e60,!![]);}catch(_0x2b3503){return BPromise[_0xf67d('0x1e')](_0x2b3503);}return _0x4c8298[_0xf67d('0x1f')]();};}function saveUpdates(_0x5c5441,_0x58a512){return function(_0x26dc02){if(_0x26dc02){return _0x26dc02[_0xf67d('0x20')](_0x5c5441)[_0xf67d('0x21')](function(_0x598424){return _0x598424;});}return null;};}function removeEntity(_0x252d9c,_0x53b0ac){return function(_0x5a2e28){if(_0x5a2e28){return _0x5a2e28[_0xf67d('0x22')]()[_0xf67d('0x21')](function(){var _0x4c7d52=_0x5a2e28['get']({'plain':!![]});var _0x44e1fe=_0xf67d('0x23');return db[_0xf67d('0x24')]['destroy']({'where':{'type':_0x44e1fe,'resourceId':_0x4c7d52['id']}})['then'](function(){return _0x5a2e28;});})[_0xf67d('0x21')](function(){_0x252d9c[_0xf67d('0x16')](0xcc)[_0xf67d('0x17')]();});}};}function handleEntityNotFound(_0x7a3bdb,_0x4b9542){return function(_0x2f52c2){if(!_0x2f52c2){_0x7a3bdb[_0xf67d('0x15')](0x194);}return _0x2f52c2;};}function handleError(_0x39cb8c,_0x47014b){_0x47014b=_0x47014b||0x1f4;return function(_0x30093c){logger[_0xf67d('0x25')](_0x30093c[_0xf67d('0x26')]);if(_0x30093c[_0xf67d('0x27')]){delete _0x30093c[_0xf67d('0x27')];}_0x39cb8c[_0xf67d('0x16')](_0x47014b)[_0xf67d('0x28')](_0x30093c);};}exports[_0xf67d('0x29')]=function(_0x44d385,_0x52afde){var _0x5286a7={},_0x30af65={},_0x275250={'count':0x0,'rows':[]};var _0x307903=_['map'](db[_0xf67d('0x2a')][_0xf67d('0x2b')],function(_0x15e2da){return{'name':_0x15e2da[_0xf67d('0x2c')],'type':_0x15e2da[_0xf67d('0x2d')]['key']};});_0x30af65[_0xf67d('0x2e')]=_[_0xf67d('0x2f')](_0x307903,'name');_0x30af65[_0xf67d('0x30')]=_['keys'](_0x44d385[_0xf67d('0x30')]);_0x30af65[_0xf67d('0x31')]=_['intersection'](_0x30af65['model'],_0x30af65['query']);_0x5286a7[_0xf67d('0x32')]=_['intersection'](_0x30af65[_0xf67d('0x2e')],qs['fields'](_0x44d385[_0xf67d('0x30')]['fields']));_0x5286a7[_0xf67d('0x32')]=_0x5286a7[_0xf67d('0x32')][_0xf67d('0x33')]?_0x5286a7[_0xf67d('0x32')]:_0x30af65[_0xf67d('0x2e')];if(!_0x44d385['query'][_0xf67d('0x34')](_0xf67d('0x35'))){_0x5286a7[_0xf67d('0x1b')]=qs[_0xf67d('0x1b')](_0x44d385[_0xf67d('0x30')][_0xf67d('0x1b')]);_0x5286a7[_0xf67d('0x19')]=qs[_0xf67d('0x19')](_0x44d385['query'][_0xf67d('0x19')]);}_0x5286a7[_0xf67d('0x36')]=qs[_0xf67d('0x37')](_0x44d385['query'][_0xf67d('0x37')]);_0x5286a7[_0xf67d('0x38')]=qs[_0xf67d('0x31')](_[_0xf67d('0x39')](_0x44d385[_0xf67d('0x30')],_0x30af65['filters']),_0x307903);if(_0x44d385['query']['filter']){_0x5286a7[_0xf67d('0x38')]=_[_0xf67d('0x3a')](_0x5286a7[_0xf67d('0x38')],{'$or':_[_0xf67d('0x2f')](_0x307903,function(_0x199710){if(_0x199710['type']!=='VIRTUAL'){var _0x1fa406={};_0x1fa406[_0x199710['name']]={'$like':'%'+_0x44d385['query']['filter']+'%'};return _0x1fa406;}})});}_0x5286a7=_[_0xf67d('0x3a')]({},_0x5286a7,_0x44d385['options']);var _0x266bcc={'where':_0x5286a7[_0xf67d('0x38')]};return db[_0xf67d('0x2a')][_0xf67d('0x1c')](_0x266bcc)[_0xf67d('0x21')](function(_0x3f0755){_0x275250[_0xf67d('0x1c')]=_0x3f0755;if(_0x44d385[_0xf67d('0x30')][_0xf67d('0x3b')]){_0x5286a7[_0xf67d('0x3c')]=[{'all':!![]}];}return db['CmContactHasItem'][_0xf67d('0x3d')](_0x5286a7);})[_0xf67d('0x21')](function(_0x5e6438){_0x275250[_0xf67d('0x3e')]=_0x5e6438;return _0x275250;})[_0xf67d('0x21')](respondWithFilteredResult(_0x52afde,_0x5286a7))[_0xf67d('0x3f')](handleError(_0x52afde,null));};exports['show']=function(_0x1d868f,_0x4c7d7e){var _0x4a59fa={'raw':!![],'where':{'id':_0x1d868f[_0xf67d('0x40')]['id']}},_0x51150e={};_0x51150e[_0xf67d('0x2e')]=_[_0xf67d('0x41')](db[_0xf67d('0x2a')][_0xf67d('0x2b')]);_0x51150e[_0xf67d('0x30')]=_['keys'](_0x1d868f['query']);_0x51150e[_0xf67d('0x31')]=_[_0xf67d('0x42')](_0x51150e[_0xf67d('0x2e')],_0x51150e[_0xf67d('0x30')]);_0x4a59fa[_0xf67d('0x32')]=_['intersection'](_0x51150e[_0xf67d('0x2e')],qs[_0xf67d('0x43')](_0x1d868f[_0xf67d('0x30')]['fields']));_0x4a59fa['attributes']=_0x4a59fa[_0xf67d('0x32')][_0xf67d('0x33')]?_0x4a59fa[_0xf67d('0x32')]:_0x51150e['model'];if(_0x1d868f['query'][_0xf67d('0x3b')]){_0x4a59fa[_0xf67d('0x3c')]=[{'all':!![]}];}_0x4a59fa=_['merge']({},_0x4a59fa,_0x1d868f['options']);return db['CmContactHasItem'][_0xf67d('0x44')](_0x4a59fa)[_0xf67d('0x21')](handleEntityNotFound(_0x4c7d7e,null))[_0xf67d('0x21')](respondWithResult(_0x4c7d7e,null))[_0xf67d('0x3f')](handleError(_0x4c7d7e,null));};exports[_0xf67d('0x45')]=function(_0xf0b8e,_0x37d0f1){return db['CmContactHasItem']['create'](_0xf0b8e[_0xf67d('0x46')],{})['then'](function(_0x805545){var _0x60f37c=_0xf0b8e[_0xf67d('0x47')]['get']({'plain':!![]});if(!_0x60f37c)throw new Error(_0xf67d('0x48'));if(_0x60f37c[_0xf67d('0x49')]===_0xf67d('0x47')){var _0x49e7d1=_0x805545[_0xf67d('0x4a')]({'plain':!![]});var _0x2f124f=_0xf67d('0x23');return db[_0xf67d('0x4b')]['find']({'where':{'name':_0x2f124f,'userProfileId':_0x60f37c[_0xf67d('0x4c')]},'raw':!![]})[_0xf67d('0x21')](function(_0x18064d){if(_0x18064d&&_0x18064d[_0xf67d('0x4d')]===0x0){return db[_0xf67d('0x24')][_0xf67d('0x45')]({'name':_0x49e7d1[_0xf67d('0x27')],'resourceId':_0x49e7d1['id'],'type':_0x18064d[_0xf67d('0x27')],'sectionId':_0x18064d['id']},{})[_0xf67d('0x21')](function(){return _0x805545;});}else{return _0x805545;}})['catch'](function(_0x31a83d){logger['error'](_0xf67d('0x4e'),_0x31a83d);throw _0x31a83d;});}return _0x805545;})[_0xf67d('0x21')](respondWithResult(_0x37d0f1,0xc9))[_0xf67d('0x3f')](handleError(_0x37d0f1,null));};exports[_0xf67d('0x20')]=function(_0x3e52d2,_0x2e8057){if(_0x3e52d2['body']['id']){delete _0x3e52d2[_0xf67d('0x46')]['id'];}return db[_0xf67d('0x2a')][_0xf67d('0x44')]({'where':{'id':_0x3e52d2[_0xf67d('0x40')]['id']}})[_0xf67d('0x21')](handleEntityNotFound(_0x2e8057,null))[_0xf67d('0x21')](saveUpdates(_0x3e52d2[_0xf67d('0x46')],null))[_0xf67d('0x21')](respondWithResult(_0x2e8057,null))[_0xf67d('0x3f')](handleError(_0x2e8057,null));};exports['destroy']=function(_0x4af150,_0x49f67c){return db['CmContactHasItem'][_0xf67d('0x44')]({'where':{'id':_0x4af150['params']['id']}})['then'](handleEntityNotFound(_0x49f67c,null))[_0xf67d('0x21')](removeEntity(_0x49f67c,null))[_0xf67d('0x3f')](handleError(_0x49f67c,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 368e3af..89c034e 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e72=['define','CmContactHasItem','cm_contact_has_items','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports'];(function(_0x291711,_0x32bd2b){var _0x4e9fc7=function(_0x420453){while(--_0x420453){_0x291711['push'](_0x291711['shift']());}};_0x4e9fc7(++_0x32bd2b);}(_0x3e72,0x6b));var _0x23e7=function(_0x46428c,_0x20ab75){_0x46428c=_0x46428c-0x0;var _0x16a677=_0x3e72[_0x46428c];return _0x16a677;};'use strict';var _=require(_0x23e7('0x0'));var util=require(_0x23e7('0x1'));var logger=require('../../config/logger')(_0x23e7('0x2'));var moment=require(_0x23e7('0x3'));var BPromise=require(_0x23e7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x23e7('0x5'));var rimraf=require(_0x23e7('0x6'));var config=require(_0x23e7('0x7'));var attributes=require(_0x23e7('0x8'));module[_0x23e7('0x9')]=function(_0x48927a,_0x4d53db){return _0x48927a[_0x23e7('0xa')](_0x23e7('0xb'),attributes,{'tableName':_0x23e7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x688f=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./cmContactHasItem.attributes','exports','cm_contact_has_items'];(function(_0x3753a4,_0x12108f){var _0x144233=function(_0x239733){while(--_0x239733){_0x3753a4['push'](_0x3753a4['shift']());}};_0x144233(++_0x12108f);}(_0x688f,0x78));var _0xf688=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x688f[_0x36884e];return _0x1cc367;};'use strict';var _=require(_0xf688('0x0'));var util=require('util');var logger=require(_0xf688('0x1'))('api');var moment=require(_0xf688('0x2'));var BPromise=require(_0xf688('0x3'));var rp=require(_0xf688('0x4'));var fs=require('fs');var path=require(_0xf688('0x5'));var rimraf=require(_0xf688('0x6'));var config=require('../../config/environment');var attributes=require(_0xf688('0x7'));module[_0xf688('0x8')]=function(_0x1c7621,_0x341946){return _0x1c7621['define']('CmContactHasItem',attributes,{'tableName':_0xf688('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index da26405..9d28fd0 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1451=['catch','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0xf2fbb0,_0x3fb728){var _0x52d46f=function(_0xed341b){while(--_0xed341b){_0xf2fbb0['push'](_0xf2fbb0['shift']());}};_0x52d46f(++_0x3fb728);}(_0x1451,0xa1));var _0x1145=function(_0xbefd3c,_0xbc56f0){_0xbefd3c=_0xbefd3c-0x0;var _0x253ad5=_0x1451[_0xbefd3c];return _0x253ad5;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1145('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1145('0x1'))['db'];var utils=require(_0x1145('0x2'));var logger=require(_0x1145('0x3'))(_0x1145('0x4'));var config=require('../../config/environment');var jayson=require(_0x1145('0x5'));var client=jayson[_0x1145('0x6')][_0x1145('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xfae597,_0x4508f5,_0x1dde88){return new BPromise(function(_0x40e4a7,_0x2efbfe){return client[_0x1145('0x8')](_0xfae597,_0x1dde88)[_0x1145('0x9')](function(_0xab9a75){logger[_0x1145('0xa')](_0x1145('0xb'),_0x4508f5,_0x1145('0xc'));logger[_0x1145('0xd')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x4508f5,_0x1145('0xc'),JSON[_0x1145('0xe')](_0xab9a75));if(_0xab9a75[_0x1145('0xf')]){if(_0xab9a75[_0x1145('0xf')][_0x1145('0x10')]===0x1f4){logger[_0x1145('0xf')](_0x1145('0xb'),_0x4508f5,_0xab9a75[_0x1145('0xf')][_0x1145('0x11')]);return _0x2efbfe(_0xab9a75['error'][_0x1145('0x11')]);}logger['error'](_0x1145('0xb'),_0x4508f5,_0xab9a75['error'][_0x1145('0x11')]);return _0x40e4a7(_0xab9a75[_0x1145('0xf')][_0x1145('0x11')]);}else{logger[_0x1145('0xa')]('CmContactHasItem,\x20%s,\x20%s',_0x4508f5,_0x1145('0xc'));_0x40e4a7(_0xab9a75[_0x1145('0x12')][_0x1145('0x11')]);}})[_0x1145('0x13')](function(_0x54f87d){logger[_0x1145('0xf')]('CmContactHasItem,\x20%s,\x20%s',_0x4508f5,_0x54f87d);_0x2efbfe(_0x54f87d);});});} \ No newline at end of file +var _0xb908=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','CmContactHasItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch'];(function(_0x4321d3,_0x29a3e1){var _0x4061ec=function(_0x492ead){while(--_0x492ead){_0x4321d3['push'](_0x4321d3['shift']());}};_0x4061ec(++_0x29a3e1);}(_0xb908,0x12c));var _0x8b90=function(_0x5280f4,_0x3c36d0){_0x5280f4=_0x5280f4-0x0;var _0xba93e7=_0xb908[_0x5280f4];return _0xba93e7;};'use strict';var _=require('lodash');var util=require(_0x8b90('0x0'));var moment=require(_0x8b90('0x1'));var BPromise=require(_0x8b90('0x2'));var rs=require(_0x8b90('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8b90('0x4'))['db'];var utils=require(_0x8b90('0x5'));var logger=require(_0x8b90('0x6'))(_0x8b90('0x7'));var config=require('../../config/environment');var jayson=require(_0x8b90('0x8'));var client=jayson[_0x8b90('0x9')][_0x8b90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ea36d,_0x532456,_0x59e7f3){return new BPromise(function(_0xe7106c,_0x5ab8cb){return client[_0x8b90('0xb')](_0x2ea36d,_0x59e7f3)['then'](function(_0x5159d9){logger[_0x8b90('0xc')](_0x8b90('0xd'),_0x532456,_0x8b90('0xe'));logger[_0x8b90('0xf')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x532456,_0x8b90('0xe'),JSON[_0x8b90('0x10')](_0x5159d9));if(_0x5159d9[_0x8b90('0x11')]){if(_0x5159d9[_0x8b90('0x11')]['code']===0x1f4){logger['error']('CmContactHasItem,\x20%s,\x20%s',_0x532456,_0x5159d9[_0x8b90('0x11')][_0x8b90('0x12')]);return _0x5ab8cb(_0x5159d9[_0x8b90('0x11')][_0x8b90('0x12')]);}logger[_0x8b90('0x11')]('CmContactHasItem,\x20%s,\x20%s',_0x532456,_0x5159d9['error']['message']);return _0xe7106c(_0x5159d9['error']['message']);}else{logger['info'](_0x8b90('0xd'),_0x532456,'request\x20sent');_0xe7106c(_0x5159d9['result'][_0x8b90('0x12')]);}})[_0x8b90('0x13')](function(_0x62379c){logger[_0x8b90('0x11')](_0x8b90('0xd'),_0x532456,_0x62379c);_0x5ab8cb(_0x62379c);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index e8c195f..4b1be9f 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb4a0=['index','show','post','create','put','/:id','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated'];(function(_0x5d60d1,_0x325ad0){var _0x5e94a7=function(_0x40fb9c){while(--_0x40fb9c){_0x5d60d1['push'](_0x5d60d1['shift']());}};_0x5e94a7(++_0x325ad0);}(_0xb4a0,0x128));var _0x0b4a=function(_0x125fdd,_0x5d5949){_0x125fdd=_0x125fdd-0x0;var _0x3173c4=_0xb4a0[_0x125fdd];return _0x3173c4;};'use strict';var multer=require('multer');var util=require(_0x0b4a('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0b4a('0x1'));var router=express[_0x0b4a('0x2')]();var fs_extra=require(_0x0b4a('0x3'));var auth=require(_0x0b4a('0x4'));var interaction=require(_0x0b4a('0x5'));var config=require(_0x0b4a('0x6'));var controller=require(_0x0b4a('0x7'));router[_0x0b4a('0x8')]('/',auth[_0x0b4a('0x9')](),controller[_0x0b4a('0xa')]);router['get']('/:id',auth[_0x0b4a('0x9')](),controller[_0x0b4a('0xb')]);router[_0x0b4a('0xc')]('/',auth[_0x0b4a('0x9')](),controller[_0x0b4a('0xd')]);router[_0x0b4a('0xe')](_0x0b4a('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x0b4a('0xf'),auth['isAuthenticated'](),controller[_0x0b4a('0x10')]);module[_0x0b4a('0x11')]=router; \ No newline at end of file +var _0x72a0=['delete','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x24ff84,_0x5ca84f){var _0x312638=function(_0x10fdc1){while(--_0x10fdc1){_0x24ff84['push'](_0x24ff84['shift']());}};_0x312638(++_0x5ca84f);}(_0x72a0,0x1ab));var _0x072a=function(_0x581ef8,_0x1afa03){_0x581ef8=_0x581ef8-0x0;var _0x31d532=_0x72a0[_0x581ef8];return _0x31d532;};'use strict';var multer=require('multer');var util=require(_0x072a('0x0'));var path=require(_0x072a('0x1'));var timeout=require(_0x072a('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x072a('0x3'));var auth=require(_0x072a('0x4'));var interaction=require(_0x072a('0x5'));var config=require(_0x072a('0x6'));var controller=require(_0x072a('0x7'));router[_0x072a('0x8')]('/',auth[_0x072a('0x9')](),controller[_0x072a('0xa')]);router[_0x072a('0x8')](_0x072a('0xb'),auth['isAuthenticated'](),controller[_0x072a('0xc')]);router[_0x072a('0xd')]('/',auth[_0x072a('0x9')](),controller[_0x072a('0xe')]);router['put'](_0x072a('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x072a('0xf')](_0x072a('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x072a('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 124841c..367bc7c 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 _0x75d0=['select','getDataValue','values','stringify','BOOLEAN','voice','sequelize','lodash','exports','VIRTUAL','alias','STRING','setDataValue','TEXT'];(function(_0x1ed2c0,_0x25f838){var _0x454831=function(_0x1eddbd){while(--_0x1eddbd){_0x1ed2c0['push'](_0x1ed2c0['shift']());}};_0x454831(++_0x25f838);}(_0x75d0,0x1e2));var _0x075d=function(_0x54ccd7,_0x3bc3ce){_0x54ccd7=_0x54ccd7-0x0;var _0x4e667b=_0x75d0[_0x54ccd7];return _0x4e667b;};'use strict';var Sequelize=require(_0x075d('0x0'));var _=require(_0x075d('0x1'));module[_0x075d('0x2')]={'name':{'type':Sequelize[_0x075d('0x3')],'get':function(_0x18dbd8){return this['getDataValue'](_0x075d('0x4'));}},'alias':{'type':Sequelize[_0x075d('0x5')],'allowNull':![],'set':function(_0x4713dc){this[_0x075d('0x6')](_0x075d('0x4'),_0x4713dc?_0x4713dc:this['getDataValue']('name'));}},'type':{'type':Sequelize[_0x075d('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x075d('0x7')]('long'),'get':function(){if(this['getDataValue']('type')===_0x075d('0x8')){return JSON['parse'](this[_0x075d('0x9')]('values'));}else{return this['getDataValue'](_0x075d('0xa'));}},'set':function(_0x159978){if(Array['isArray'](_0x159978)){this[_0x075d('0x6')](_0x075d('0xa'),JSON[_0x075d('0xb')](_0x159978));}else{this[_0x075d('0x6')](_0x075d('0xa'),_0x159978);}}},'required':{'type':Sequelize[_0x075d('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM'](_0x075d('0xd'))}}; \ No newline at end of file +var _0x04f3=['getDataValue','alias','STRING','TEXT','long','type','select','values','isArray','setDataValue','stringify','BOOLEAN','sequelize','lodash'];(function(_0x336a6e,_0x4c454f){var _0x4c0b21=function(_0x3590a0){while(--_0x3590a0){_0x336a6e['push'](_0x336a6e['shift']());}};_0x4c0b21(++_0x4c454f);}(_0x04f3,0x1e8));var _0x304f=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x04f3[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x304f('0x0'));var _=require(_0x304f('0x1'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x1c93d6){return this[_0x304f('0x2')](_0x304f('0x3'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x337791){this['setDataValue']('alias',_0x337791?_0x337791:this[_0x304f('0x2')]('name'));}},'type':{'type':Sequelize[_0x304f('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x304f('0x5')](_0x304f('0x6')),'get':function(){if(this['getDataValue'](_0x304f('0x7'))===_0x304f('0x8')){return JSON['parse'](this[_0x304f('0x2')](_0x304f('0x9')));}else{return this[_0x304f('0x2')](_0x304f('0x9'));}},'set':function(_0x3b157c){if(Array[_0x304f('0xa')](_0x3b157c)){this[_0x304f('0xb')](_0x304f('0x9'),JSON[_0x304f('0xc')](_0x3b157c));}else{this[_0x304f('0xb')]('values',_0x3b157c);}}},'required':{'type':Sequelize[_0x304f('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x304f('0xd')],'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 4667750..a03c540 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 _0xa17d=['query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','include','findAll','rows','catch','show','params','includeAll','find','body','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','model','keys'];(function(_0x5d7a4b,_0x1fb438){var _0x154f4d=function(_0x29c95a){while(--_0x29c95a){_0x5d7a4b['push'](_0x5d7a4b['shift']());}};_0x154f4d(++_0x1fb438);}(_0xa17d,0x79));var _0xda17=function(_0x1f7413,_0x3388c3){_0x1f7413=_0x1f7413-0x0;var _0x2d2775=_0xa17d[_0x1f7413];return _0x2d2775;};'use strict';var emlformat=require(_0xda17('0x0'));var rimraf=require(_0xda17('0x1'));var zipdir=require(_0xda17('0x2'));var jsonpatch=require(_0xda17('0x3'));var rp=require('request-promise');var moment=require(_0xda17('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xda17('0x5'));var sox=require('sox');var csv=require(_0xda17('0x6'));var ejs=require(_0xda17('0x7'));var fs=require('fs');var fs_extra=require(_0xda17('0x8'));var _=require(_0xda17('0x9'));var squel=require(_0xda17('0xa'));var crypto=require(_0xda17('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xda17('0xc'));var toCsv=require(_0xda17('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xda17('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xda17('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xda17('0xf'))(_0xda17('0x10'));var utils=require(_0xda17('0x11'));var config=require(_0xda17('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xda17('0x13'))['db'];function respondWithStatusCode(_0x55ef69,_0x4e8b29){_0x4e8b29=_0x4e8b29||0xcc;return function(_0x5bf959){if(_0x5bf959){return _0x55ef69[_0xda17('0x14')](_0x4e8b29);}return _0x55ef69['status'](_0x4e8b29)[_0xda17('0x15')]();};}function respondWithResult(_0x43403b,_0x516617){_0x516617=_0x516617||0xc8;return function(_0x16869c){if(_0x16869c){return _0x43403b['status'](_0x516617)[_0xda17('0x16')](_0x16869c);}};}function respondWithFilteredResult(_0x37850d,_0x552996){return function(_0xa6808e){if(_0xa6808e){var _0x1d5b74=typeof _0x552996[_0xda17('0x17')]===_0xda17('0x18')&&typeof _0x552996['limit']==='undefined';var _0x29d2d9=_0xa6808e[_0xda17('0x19')];var _0x2af800=_0x1d5b74?0x0:_0x552996[_0xda17('0x17')];var _0x2726b0=_0x1d5b74?_0xa6808e[_0xda17('0x19')]:_0x552996['offset']+_0x552996[_0xda17('0x1a')];var _0x4d8e24;if(_0x2726b0>=_0x29d2d9){_0x2726b0=_0x29d2d9;_0x4d8e24=0xc8;}else{_0x4d8e24=0xce;}_0x37850d['status'](_0x4d8e24);return _0x37850d[_0xda17('0x1b')](_0xda17('0x1c'),_0x2af800+'-'+_0x2726b0+'/'+_0x29d2d9)[_0xda17('0x16')](_0xa6808e);}return null;};}function patchUpdates(_0x579c1e){return function(_0x368c10){try{jsonpatch['apply'](_0x368c10,_0x579c1e,!![]);}catch(_0x1677d9){return BPromise[_0xda17('0x1d')](_0x1677d9);}return _0x368c10[_0xda17('0x1e')]();};}function saveUpdates(_0x3a5f33,_0x1ed362){return function(_0x19d80c){if(_0x19d80c){return _0x19d80c[_0xda17('0x1f')](_0x3a5f33)[_0xda17('0x20')](function(_0x2f599b){return _0x2f599b;});}return null;};}function removeEntity(_0x23f007,_0x4ac3d3){return function(_0x2020e7){if(_0x2020e7){return _0x2020e7[_0xda17('0x21')]()['then'](function(){_0x23f007['status'](0xcc)[_0xda17('0x15')]();});}};}function handleEntityNotFound(_0xb4f9e3,_0xa34ecf){return function(_0x45f41c){if(!_0x45f41c){_0xb4f9e3[_0xda17('0x14')](0x194);}return _0x45f41c;};}function handleError(_0x4725ec,_0x374622){_0x374622=_0x374622||0x1f4;return function(_0x43405e){logger[_0xda17('0x22')](_0x43405e[_0xda17('0x23')]);if(_0x43405e[_0xda17('0x24')]){delete _0x43405e['name'];}_0x4725ec['status'](_0x374622)[_0xda17('0x25')](_0x43405e);};}exports[_0xda17('0x26')]=function(_0x3d2d9d,_0xc2ff9c){var _0xa14807={},_0x1aabe6={},_0x458d5f={'count':0x0,'rows':[]};var _0x15daba=_[_0xda17('0x27')](db[_0xda17('0x28')][_0xda17('0x29')],function(_0x2626d0){return{'name':_0x2626d0[_0xda17('0x2a')],'type':_0x2626d0['type']['key']};});_0x1aabe6[_0xda17('0x2b')]=_['differenceBy'](_[_0xda17('0x27')](_0x15daba,'name'),[_0xda17('0x24')]);_0x1aabe6['query']=_[_0xda17('0x2c')](_0x3d2d9d[_0xda17('0x2d')]);_0x1aabe6[_0xda17('0x2e')]=_[_0xda17('0x2f')](_0x1aabe6[_0xda17('0x2b')],_0x1aabe6['query']);_0xa14807[_0xda17('0x30')]=_[_0xda17('0x2f')](_0x1aabe6['model'],qs[_0xda17('0x31')](_0x3d2d9d[_0xda17('0x2d')][_0xda17('0x31')]));_0xa14807[_0xda17('0x30')]=_0xa14807[_0xda17('0x30')][_0xda17('0x32')]?_0xa14807['attributes']:_0x1aabe6[_0xda17('0x2b')];if(!_0x3d2d9d[_0xda17('0x2d')][_0xda17('0x33')](_0xda17('0x34'))){_0xa14807[_0xda17('0x1a')]=qs[_0xda17('0x1a')](_0x3d2d9d['query'][_0xda17('0x1a')]);_0xa14807[_0xda17('0x17')]=qs[_0xda17('0x17')](_0x3d2d9d[_0xda17('0x2d')][_0xda17('0x17')]);}_0xa14807[_0xda17('0x35')]=qs[_0xda17('0x36')](_0x3d2d9d[_0xda17('0x2d')][_0xda17('0x36')]);_0xa14807[_0xda17('0x37')]=qs['filters'](_['pick'](_0x3d2d9d[_0xda17('0x2d')],_0x1aabe6[_0xda17('0x2e')]),_0x15daba);if(_0x3d2d9d[_0xda17('0x2d')][_0xda17('0x38')]){_0xa14807[_0xda17('0x37')]=_[_0xda17('0x39')](_0xa14807[_0xda17('0x37')],{'$or':_[_0xda17('0x27')](_0x15daba,function(_0x37bad7){if(_0x37bad7[_0xda17('0x3a')]!=='VIRTUAL'){var _0x3b51a7={};_0x3b51a7[_0x37bad7[_0xda17('0x24')]]={'$like':'%'+_0x3d2d9d[_0xda17('0x2d')]['filter']+'%'};return _0x3b51a7;}})});}_0xa14807=_['merge']({},_0xa14807,_0x3d2d9d[_0xda17('0x3b')]);var _0x5de19c={'where':_0xa14807[_0xda17('0x37')]};return db[_0xda17('0x28')][_0xda17('0x19')](_0x5de19c)[_0xda17('0x20')](function(_0x529080){_0x458d5f[_0xda17('0x19')]=_0x529080;if(_0x3d2d9d[_0xda17('0x2d')]['includeAll']){_0xa14807[_0xda17('0x3c')]=[{'all':!![]}];}return db['CmCustomField'][_0xda17('0x3d')](_0xa14807);})['then'](function(_0x58dd3e){_0x458d5f[_0xda17('0x3e')]=_0x58dd3e;return _0x458d5f;})['then'](respondWithFilteredResult(_0xc2ff9c,_0xa14807))[_0xda17('0x3f')](handleError(_0xc2ff9c,null));};exports[_0xda17('0x40')]=function(_0x1ec7f4,_0x3d26e8){var _0x36da01={'raw':!![],'where':{'id':_0x1ec7f4[_0xda17('0x41')]['id']}},_0x1f87ba={};_0x1f87ba[_0xda17('0x2b')]=_['keys'](db[_0xda17('0x28')][_0xda17('0x29')]);_0x1f87ba[_0xda17('0x2d')]=_['keys'](_0x1ec7f4[_0xda17('0x2d')]);_0x1f87ba[_0xda17('0x2e')]=_['intersection'](_0x1f87ba[_0xda17('0x2b')],_0x1f87ba[_0xda17('0x2d')]);_0x36da01[_0xda17('0x30')]=_[_0xda17('0x2f')](_0x1f87ba['model'],qs[_0xda17('0x31')](_0x1ec7f4[_0xda17('0x2d')][_0xda17('0x31')]));_0x36da01[_0xda17('0x30')]=_0x36da01[_0xda17('0x30')][_0xda17('0x32')]?_0x36da01[_0xda17('0x30')]:_0x1f87ba[_0xda17('0x2b')];if(_0x1ec7f4[_0xda17('0x2d')][_0xda17('0x42')]){_0x36da01[_0xda17('0x3c')]=[{'all':!![]}];}_0x36da01=_[_0xda17('0x39')]({},_0x36da01,_0x1ec7f4[_0xda17('0x3b')]);return db[_0xda17('0x28')][_0xda17('0x43')](_0x36da01)[_0xda17('0x20')](handleEntityNotFound(_0x3d26e8,null))[_0xda17('0x20')](respondWithResult(_0x3d26e8,null))['catch'](handleError(_0x3d26e8,null));};exports[_0xda17('0x1f')]=function(_0x15e527,_0x58695b){if(_0x15e527['body']['id']){delete _0x15e527[_0xda17('0x44')]['id'];}return db[_0xda17('0x28')][_0xda17('0x43')]({'where':{'id':_0x15e527[_0xda17('0x41')]['id']}})['then'](handleEntityNotFound(_0x58695b,null))[_0xda17('0x20')](saveUpdates(_0x15e527[_0xda17('0x44')],null))[_0xda17('0x20')](respondWithResult(_0x58695b,null))[_0xda17('0x3f')](handleError(_0x58695b,null));};exports[_0xda17('0x21')]=function(_0x2e6cea,_0xca2e61){return db['CmCustomField'][_0xda17('0x43')]({'where':{'id':_0x2e6cea[_0xda17('0x41')]['id']}})[_0xda17('0x20')](handleEntityNotFound(_0xca2e61,null))[_0xda17('0x20')](removeEntity(_0xca2e61,null))[_0xda17('0x3f')](handleError(_0xca2e61,null));};exports[_0xda17('0x45')]=function(_0x5a6379,_0x6b7116){var _0xe059d3;return db[_0xda17('0x46')][_0xda17('0x47')](function(_0x730683){return db[_0xda17('0x28')][_0xda17('0x45')](_0x5a6379[_0xda17('0x44')],{'transaction':_0x730683})[_0xda17('0x20')](function(_0x52f06a){_0xe059d3=_0x52f06a;var _0x451bf6={'type':db[_0xda17('0x48')][_0xda17('0x49')],'transaction':_0x730683};switch(_0x5a6379['body'][_0xda17('0x3a')]){case _0xda17('0x4a'):_0x451bf6[_0xda17('0x3a')]=db[_0xda17('0x48')][_0xda17('0x49')];break;case _0xda17('0x4b'):_0x451bf6['type']=db[_0xda17('0x48')][_0xda17('0x4c')];break;case'switch':_0x451bf6[_0xda17('0x3a')]=db[_0xda17('0x48')][_0xda17('0x4d')];_0x451bf6[_0xda17('0x4e')]=![];break;default:}return db['sequelize']['queryInterface'][_0xda17('0x4f')](_0xda17('0x50'),util[_0xda17('0x51')](_0xda17('0x52'),_0xe059d3['id']),_0x451bf6);})[_0xda17('0x20')](function(){return _0xe059d3;});})[_0xda17('0x20')](respondWithResult(_0x6b7116,0xc9))['catch'](handleError(_0x6b7116,null));}; \ No newline at end of file +var _0xff4c=['status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','CmCustomField','findAll','catch','show','find','update','params','body','sequelize','create','Sequelize','TEXT','text','INTEGER','switch','defaultValue','queryInterface','cm_contacts','cf_%d','eml-format','rimraf','zip-dir','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x188150,_0x4cb031){var _0x185ada=function(_0x1ce941){while(--_0x1ce941){_0x188150['push'](_0x188150['shift']());}};_0x185ada(++_0x4cb031);}(_0xff4c,0x1db));var _0xcff4=function(_0x16337a,_0x4789a1){_0x16337a=_0x16337a-0x0;var _0x422365=_0xff4c[_0x16337a];return _0x422365;};'use strict';var emlformat=require(_0xcff4('0x0'));var rimraf=require(_0xcff4('0x1'));var zipdir=require(_0xcff4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcff4('0x3'));var moment=require('moment');var BPromise=require(_0xcff4('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xcff4('0x5'));var csv=require(_0xcff4('0x6'));var ejs=require(_0xcff4('0x7'));var fs=require('fs');var fs_extra=require(_0xcff4('0x8'));var _=require(_0xcff4('0x9'));var squel=require(_0xcff4('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcff4('0x6'));var querystring=require('querystring');var Papa=require(_0xcff4('0xb'));var Redis=require(_0xcff4('0xc'));var authService=require(_0xcff4('0xd'));var qs=require(_0xcff4('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcff4('0xf'));var logger=require(_0xcff4('0x10'))(_0xcff4('0x11'));var utils=require(_0xcff4('0x12'));var config=require(_0xcff4('0x13'));var licenseUtil=require(_0xcff4('0x14'));var db=require(_0xcff4('0x15'))['db'];function respondWithStatusCode(_0x8b51e1,_0x1fe4df){_0x1fe4df=_0x1fe4df||0xcc;return function(_0x3ff076){if(_0x3ff076){return _0x8b51e1[_0xcff4('0x16')](_0x1fe4df);}return _0x8b51e1[_0xcff4('0x17')](_0x1fe4df)[_0xcff4('0x18')]();};}function respondWithResult(_0x10c511,_0x467288){_0x467288=_0x467288||0xc8;return function(_0x34f5a0){if(_0x34f5a0){return _0x10c511[_0xcff4('0x17')](_0x467288)[_0xcff4('0x19')](_0x34f5a0);}};}function respondWithFilteredResult(_0xd2cbf2,_0x3da1b0){return function(_0x58d53c){if(_0x58d53c){var _0x5326cc=typeof _0x3da1b0['offset']===_0xcff4('0x1a')&&typeof _0x3da1b0[_0xcff4('0x1b')]==='undefined';var _0x109257=_0x58d53c[_0xcff4('0x1c')];var _0x17c188=_0x5326cc?0x0:_0x3da1b0[_0xcff4('0x1d')];var _0x344990=_0x5326cc?_0x58d53c['count']:_0x3da1b0['offset']+_0x3da1b0[_0xcff4('0x1b')];var _0x5e7b41;if(_0x344990>=_0x109257){_0x344990=_0x109257;_0x5e7b41=0xc8;}else{_0x5e7b41=0xce;}_0xd2cbf2['status'](_0x5e7b41);return _0xd2cbf2[_0xcff4('0x1e')](_0xcff4('0x1f'),_0x17c188+'-'+_0x344990+'/'+_0x109257)['json'](_0x58d53c);}return null;};}function patchUpdates(_0x2ec37d){return function(_0x23d41a){try{jsonpatch['apply'](_0x23d41a,_0x2ec37d,!![]);}catch(_0x47235a){return BPromise[_0xcff4('0x20')](_0x47235a);}return _0x23d41a[_0xcff4('0x21')]();};}function saveUpdates(_0x578356,_0x2f3890){return function(_0x4359e7){if(_0x4359e7){return _0x4359e7['update'](_0x578356)[_0xcff4('0x22')](function(_0x4f4844){return _0x4f4844;});}return null;};}function removeEntity(_0x773ca0,_0xd50bad){return function(_0x3bbb58){if(_0x3bbb58){return _0x3bbb58[_0xcff4('0x23')]()[_0xcff4('0x22')](function(){_0x773ca0['status'](0xcc)[_0xcff4('0x18')]();});}};}function handleEntityNotFound(_0x4bde60,_0x337e5e){return function(_0x72ebcd){if(!_0x72ebcd){_0x4bde60[_0xcff4('0x16')](0x194);}return _0x72ebcd;};}function handleError(_0x3e0dfd,_0x3e6a01){_0x3e6a01=_0x3e6a01||0x1f4;return function(_0x3c5d9d){logger[_0xcff4('0x24')](_0x3c5d9d[_0xcff4('0x25')]);if(_0x3c5d9d[_0xcff4('0x26')]){delete _0x3c5d9d[_0xcff4('0x26')];}_0x3e0dfd['status'](_0x3e6a01)[_0xcff4('0x27')](_0x3c5d9d);};}exports[_0xcff4('0x28')]=function(_0x23cf9f,_0x3cf73f){var _0x14b2ee={},_0x3e476e={},_0x27aa35={'count':0x0,'rows':[]};var _0x492dd5=_[_0xcff4('0x29')](db['CmCustomField'][_0xcff4('0x2a')],function(_0x10116e){return{'name':_0x10116e[_0xcff4('0x2b')],'type':_0x10116e[_0xcff4('0x2c')][_0xcff4('0x2d')]};});_0x3e476e[_0xcff4('0x2e')]=_[_0xcff4('0x2f')](_[_0xcff4('0x29')](_0x492dd5,_0xcff4('0x26')),['name']);_0x3e476e[_0xcff4('0x30')]=_[_0xcff4('0x31')](_0x23cf9f[_0xcff4('0x30')]);_0x3e476e[_0xcff4('0x32')]=_[_0xcff4('0x33')](_0x3e476e[_0xcff4('0x2e')],_0x3e476e[_0xcff4('0x30')]);_0x14b2ee[_0xcff4('0x34')]=_[_0xcff4('0x33')](_0x3e476e[_0xcff4('0x2e')],qs[_0xcff4('0x35')](_0x23cf9f[_0xcff4('0x30')][_0xcff4('0x35')]));_0x14b2ee[_0xcff4('0x34')]=_0x14b2ee[_0xcff4('0x34')][_0xcff4('0x36')]?_0x14b2ee[_0xcff4('0x34')]:_0x3e476e['model'];if(!_0x23cf9f[_0xcff4('0x30')][_0xcff4('0x37')](_0xcff4('0x38'))){_0x14b2ee[_0xcff4('0x1b')]=qs[_0xcff4('0x1b')](_0x23cf9f['query'][_0xcff4('0x1b')]);_0x14b2ee[_0xcff4('0x1d')]=qs['offset'](_0x23cf9f['query'][_0xcff4('0x1d')]);}_0x14b2ee[_0xcff4('0x39')]=qs[_0xcff4('0x3a')](_0x23cf9f[_0xcff4('0x30')][_0xcff4('0x3a')]);_0x14b2ee[_0xcff4('0x3b')]=qs[_0xcff4('0x32')](_['pick'](_0x23cf9f[_0xcff4('0x30')],_0x3e476e['filters']),_0x492dd5);if(_0x23cf9f[_0xcff4('0x30')][_0xcff4('0x3c')]){_0x14b2ee[_0xcff4('0x3b')]=_[_0xcff4('0x3d')](_0x14b2ee[_0xcff4('0x3b')],{'$or':_[_0xcff4('0x29')](_0x492dd5,function(_0x4e62a8){if(_0x4e62a8[_0xcff4('0x2c')]!==_0xcff4('0x3e')){var _0x381fdb={};_0x381fdb[_0x4e62a8[_0xcff4('0x26')]]={'$like':'%'+_0x23cf9f[_0xcff4('0x30')][_0xcff4('0x3c')]+'%'};return _0x381fdb;}})});}_0x14b2ee=_[_0xcff4('0x3d')]({},_0x14b2ee,_0x23cf9f[_0xcff4('0x3f')]);var _0x4d94fb={'where':_0x14b2ee['where']};return db[_0xcff4('0x40')]['count'](_0x4d94fb)['then'](function(_0x3a8c89){_0x27aa35[_0xcff4('0x1c')]=_0x3a8c89;if(_0x23cf9f[_0xcff4('0x30')]['includeAll']){_0x14b2ee['include']=[{'all':!![]}];}return db['CmCustomField'][_0xcff4('0x41')](_0x14b2ee);})[_0xcff4('0x22')](function(_0x496830){_0x27aa35['rows']=_0x496830;return _0x27aa35;})[_0xcff4('0x22')](respondWithFilteredResult(_0x3cf73f,_0x14b2ee))[_0xcff4('0x42')](handleError(_0x3cf73f,null));};exports[_0xcff4('0x43')]=function(_0x51f8f2,_0xb96fe6){var _0x581068={'raw':!![],'where':{'id':_0x51f8f2['params']['id']}},_0x14ebf6={};_0x14ebf6['model']=_['keys'](db[_0xcff4('0x40')]['rawAttributes']);_0x14ebf6[_0xcff4('0x30')]=_['keys'](_0x51f8f2[_0xcff4('0x30')]);_0x14ebf6[_0xcff4('0x32')]=_['intersection'](_0x14ebf6[_0xcff4('0x2e')],_0x14ebf6[_0xcff4('0x30')]);_0x581068[_0xcff4('0x34')]=_[_0xcff4('0x33')](_0x14ebf6[_0xcff4('0x2e')],qs[_0xcff4('0x35')](_0x51f8f2[_0xcff4('0x30')]['fields']));_0x581068[_0xcff4('0x34')]=_0x581068['attributes'][_0xcff4('0x36')]?_0x581068[_0xcff4('0x34')]:_0x14ebf6['model'];if(_0x51f8f2['query']['includeAll']){_0x581068['include']=[{'all':!![]}];}_0x581068=_['merge']({},_0x581068,_0x51f8f2[_0xcff4('0x3f')]);return db['CmCustomField'][_0xcff4('0x44')](_0x581068)[_0xcff4('0x22')](handleEntityNotFound(_0xb96fe6,null))[_0xcff4('0x22')](respondWithResult(_0xb96fe6,null))[_0xcff4('0x42')](handleError(_0xb96fe6,null));};exports[_0xcff4('0x45')]=function(_0xaf9801,_0x31d1ec){if(_0xaf9801['body']['id']){delete _0xaf9801['body']['id'];}return db[_0xcff4('0x40')][_0xcff4('0x44')]({'where':{'id':_0xaf9801[_0xcff4('0x46')]['id']}})[_0xcff4('0x22')](handleEntityNotFound(_0x31d1ec,null))['then'](saveUpdates(_0xaf9801[_0xcff4('0x47')],null))[_0xcff4('0x22')](respondWithResult(_0x31d1ec,null))[_0xcff4('0x42')](handleError(_0x31d1ec,null));};exports['destroy']=function(_0x60f06,_0x2b9126){return db[_0xcff4('0x40')]['find']({'where':{'id':_0x60f06['params']['id']}})[_0xcff4('0x22')](handleEntityNotFound(_0x2b9126,null))[_0xcff4('0x22')](removeEntity(_0x2b9126,null))[_0xcff4('0x42')](handleError(_0x2b9126,null));};exports['create']=function(_0x9b7914,_0x5a8c50){var _0x537de1;return db[_0xcff4('0x48')]['transaction'](function(_0x294bd0){return db[_0xcff4('0x40')][_0xcff4('0x49')](_0x9b7914[_0xcff4('0x47')],{'transaction':_0x294bd0})['then'](function(_0x5e3643){_0x537de1=_0x5e3643;var _0x1045cc={'type':db[_0xcff4('0x4a')][_0xcff4('0x4b')],'transaction':_0x294bd0};switch(_0x9b7914[_0xcff4('0x47')][_0xcff4('0x2c')]){case _0xcff4('0x4c'):_0x1045cc[_0xcff4('0x2c')]=db[_0xcff4('0x4a')]['TEXT'];break;case'number':_0x1045cc[_0xcff4('0x2c')]=db[_0xcff4('0x4a')][_0xcff4('0x4d')];break;case _0xcff4('0x4e'):_0x1045cc['type']=db[_0xcff4('0x4a')]['BOOLEAN'];_0x1045cc[_0xcff4('0x4f')]=![];break;default:}return db[_0xcff4('0x48')][_0xcff4('0x50')]['addColumn'](_0xcff4('0x51'),util['format'](_0xcff4('0x52'),_0x537de1['id']),_0x1045cc);})[_0xcff4('0x22')](function(){return _0x537de1;});})[_0xcff4('0x22')](respondWithResult(_0x5a8c50,0xc9))[_0xcff4('0x42')](handleError(_0x5a8c50,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 3b9bf6c..7aa6311 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 _0x65cd=['request-promise','path','rimraf','../../config/environment','define','lodash','../../config/logger','api','moment','bluebird'];(function(_0x3164a6,_0x1fa6a4){var _0x4589ca=function(_0x3c99f9){while(--_0x3c99f9){_0x3164a6['push'](_0x3164a6['shift']());}};_0x4589ca(++_0x1fa6a4);}(_0x65cd,0x11d));var _0xd65c=function(_0x4008de,_0x15f2e9){_0x4008de=_0x4008de-0x0;var _0x596738=_0x65cd[_0x4008de];return _0x596738;};'use strict';var _=require(_0xd65c('0x0'));var util=require('util');var logger=require(_0xd65c('0x1'))(_0xd65c('0x2'));var moment=require(_0xd65c('0x3'));var BPromise=require(_0xd65c('0x4'));var rp=require(_0xd65c('0x5'));var fs=require('fs');var path=require(_0xd65c('0x6'));var rimraf=require(_0xd65c('0x7'));var config=require(_0xd65c('0x8'));var attributes=require('./cmCustomField.attributes');module['exports']=function(_0x706ab1,_0x3cbf19){return _0x706ab1[_0xd65c('0x9')]('CmCustomField',attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2774=['./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','rimraf','../../config/environment'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x2774,0xff));var _0x4277=function(_0x324664,_0x38852c){_0x324664=_0x324664-0x0;var _0x574899=_0x2774[_0x324664];return _0x574899;};'use strict';var _=require(_0x4277('0x0'));var util=require(_0x4277('0x1'));var logger=require(_0x4277('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4277('0x3'));var config=require(_0x4277('0x4'));var attributes=require(_0x4277('0x5'));module[_0x4277('0x6')]=function(_0x1e3f0b,_0x4871c6){return _0x1e3f0b[_0x4277('0x7')](_0x4277('0x8'),attributes,{'tableName':_0x4277('0x9'),'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 dbfb288..71a1425 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 _0xc0b3=['../../config/utils','rpc','../../config/environment','http','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x392274,_0x512cc1){var _0x12bdad=function(_0x5edd50){while(--_0x5edd50){_0x392274['push'](_0x392274['shift']());}};_0x12bdad(++_0x512cc1);}(_0xc0b3,0xea));var _0x3c0b=function(_0x39beb0,_0x542c24){_0x39beb0=_0x39beb0-0x0;var _0x58d92e=_0xc0b3[_0x39beb0];return _0x58d92e;};'use strict';var _=require('lodash');var util=require(_0x3c0b('0x0'));var moment=require(_0x3c0b('0x1'));var BPromise=require(_0x3c0b('0x2'));var rs=require(_0x3c0b('0x3'));var fs=require('fs');var Redis=require(_0x3c0b('0x4'));var db=require(_0x3c0b('0x5'))['db'];var utils=require(_0x3c0b('0x6'));var logger=require('../../config/logger')(_0x3c0b('0x7'));var config=require(_0x3c0b('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3c0b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8f35de,_0x65d115,_0x3b1ae9){return new BPromise(function(_0x310075,_0x4c0cef){return client['request'](_0x8f35de,_0x3b1ae9)[_0x3c0b('0xa')](function(_0x39fd76){logger[_0x3c0b('0xb')](_0x3c0b('0xc'),_0x65d115,_0x3c0b('0xd'));logger[_0x3c0b('0xe')](_0x3c0b('0xf'),_0x65d115,_0x3c0b('0xd'),JSON[_0x3c0b('0x10')](_0x39fd76));if(_0x39fd76[_0x3c0b('0x11')]){if(_0x39fd76[_0x3c0b('0x11')]['code']===0x1f4){logger[_0x3c0b('0x11')](_0x3c0b('0xc'),_0x65d115,_0x39fd76[_0x3c0b('0x11')]['message']);return _0x4c0cef(_0x39fd76[_0x3c0b('0x11')][_0x3c0b('0x12')]);}logger['error'](_0x3c0b('0xc'),_0x65d115,_0x39fd76[_0x3c0b('0x11')][_0x3c0b('0x12')]);return _0x310075(_0x39fd76[_0x3c0b('0x11')][_0x3c0b('0x12')]);}else{logger[_0x3c0b('0xb')](_0x3c0b('0xc'),_0x65d115,_0x3c0b('0xd'));_0x310075(_0x39fd76['result'][_0x3c0b('0x12')]);}})[_0x3c0b('0x13')](function(_0x58856b){logger[_0x3c0b('0x11')](_0x3c0b('0xc'),_0x65d115,_0x58856b);_0x4c0cef(_0x58856b);});});} \ No newline at end of file +var _0x5732=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result'];(function(_0x39c7bb,_0x4ee817){var _0x52af11=function(_0x2b7c61){while(--_0x2b7c61){_0x39c7bb['push'](_0x39c7bb['shift']());}};_0x52af11(++_0x4ee817);}(_0x5732,0x177));var _0x2573=function(_0x20207a,_0x500268){_0x20207a=_0x20207a-0x0;var _0x4fd528=_0x5732[_0x20207a];return _0x4fd528;};'use strict';var _=require(_0x2573('0x0'));var util=require(_0x2573('0x1'));var moment=require(_0x2573('0x2'));var BPromise=require(_0x2573('0x3'));var rs=require(_0x2573('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2573('0x5'))['db'];var utils=require(_0x2573('0x6'));var logger=require('../../config/logger')(_0x2573('0x7'));var config=require(_0x2573('0x8'));var jayson=require(_0x2573('0x9'));var client=jayson[_0x2573('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f3c94,_0x25d413,_0x2cccd9){return new BPromise(function(_0x572d75,_0xfe4a6d){return client['request'](_0x1f3c94,_0x2cccd9)[_0x2573('0xb')](function(_0x1777b7){logger[_0x2573('0xc')]('CmCustomField,\x20%s,\x20%s',_0x25d413,'request\x20sent');logger['debug'](_0x2573('0xd'),_0x25d413,_0x2573('0xe'),JSON[_0x2573('0xf')](_0x1777b7));if(_0x1777b7[_0x2573('0x10')]){if(_0x1777b7[_0x2573('0x10')][_0x2573('0x11')]===0x1f4){logger[_0x2573('0x10')](_0x2573('0x12'),_0x25d413,_0x1777b7[_0x2573('0x10')][_0x2573('0x13')]);return _0xfe4a6d(_0x1777b7[_0x2573('0x10')][_0x2573('0x13')]);}logger['error'](_0x2573('0x12'),_0x25d413,_0x1777b7[_0x2573('0x10')][_0x2573('0x13')]);return _0x572d75(_0x1777b7[_0x2573('0x10')]['message']);}else{logger[_0x2573('0xc')](_0x2573('0x12'),_0x25d413,'request\x20sent');_0x572d75(_0x1777b7[_0x2573('0x14')][_0x2573('0x13')]);}})[_0x2573('0x15')](function(_0x414228){logger[_0x2573('0x10')](_0x2573('0x12'),_0x25d413,_0x414228);_0xfe4a6d(_0x414228);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index c86cc5a..c3a4449 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 _0x5735=['update','exports','multer','connect-timeout','express','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','index','/:id','isAuthenticated','show','post','put'];(function(_0x489876,_0x27f8cb){var _0x45de84=function(_0x1d3e0c){while(--_0x1d3e0c){_0x489876['push'](_0x489876['shift']());}};_0x45de84(++_0x27f8cb);}(_0x5735,0x16a));var _0x5573=function(_0x1cc325,_0x537298){_0x1cc325=_0x1cc325-0x0;var _0x33d644=_0x5735[_0x1cc325];return _0x33d644;};'use strict';var multer=require(_0x5573('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5573('0x1'));var express=require(_0x5573('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5573('0x3'));var config=require(_0x5573('0x4'));var controller=require(_0x5573('0x5'));router[_0x5573('0x6')]('/',auth['isAuthenticated'](),controller[_0x5573('0x7')]);router[_0x5573('0x6')](_0x5573('0x8'),auth[_0x5573('0x9')](),controller[_0x5573('0xa')]);router[_0x5573('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5573('0xc')](_0x5573('0x8'),auth[_0x5573('0x9')](),controller[_0x5573('0xd')]);router['delete']('/:id',auth[_0x5573('0x9')](),controller['destroy']);module[_0x5573('0xe')]=router; \ No newline at end of file +var _0xf0db=['get','isAuthenticated','index','show','post','create','put','/:id','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x116f5f,_0x5ef066){var _0x2151cb=function(_0x4a0a4a){while(--_0x4a0a4a){_0x116f5f['push'](_0x116f5f['shift']());}};_0x2151cb(++_0x5ef066);}(_0xf0db,0x12b));var _0xbf0d=function(_0x25ec2b,_0x1a0b12){_0x25ec2b=_0x25ec2b-0x0;var _0x2eea15=_0xf0db[_0x25ec2b];return _0x2eea15;};'use strict';var multer=require(_0xbf0d('0x0'));var util=require(_0xbf0d('0x1'));var path=require('path');var timeout=require(_0xbf0d('0x2'));var express=require(_0xbf0d('0x3'));var router=express[_0xbf0d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbf0d('0x5'));var interaction=require(_0xbf0d('0x6'));var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router[_0xbf0d('0x7')]('/',auth[_0xbf0d('0x8')](),controller[_0xbf0d('0x9')]);router[_0xbf0d('0x7')]('/:id',auth[_0xbf0d('0x8')](),controller[_0xbf0d('0xa')]);router[_0xbf0d('0xb')]('/',auth[_0xbf0d('0x8')](),controller[_0xbf0d('0xc')]);router[_0xbf0d('0xd')](_0xbf0d('0xe'),auth[_0xbf0d('0x8')](),controller['update']);router['delete'](_0xbf0d('0xe'),auth[_0xbf0d('0x8')](),controller[_0xbf0d('0xf')]);module[_0xbf0d('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index a2b49eb..8a09496 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 _0xe133=['format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','DATE','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN'];(function(_0x36fba5,_0x434e11){var _0x3a348d=function(_0x3334ce){while(--_0x3334ce){_0x36fba5['push'](_0x36fba5['shift']());}};_0x3a348d(++_0x434e11);}(_0xe133,0x127));var _0x3e13=function(_0x302017,_0x146c48){_0x302017=_0x302017-0x0;var _0x239385=_0xe133[_0x302017];return _0x239385;};'use strict';var moment=require(_0x3e13('0x0'));var Sequelize=require(_0x3e13('0x1'));module[_0x3e13('0x2')]={'phone':{'type':Sequelize[_0x3e13('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0x3e13('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x3e13('0x5')](_0x3e13('0x6'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3e13('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x3e13('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3e13('0x8')]},'priority':{'type':Sequelize[_0x3e13('0x7')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x3e13('0x4')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x3e13('0x7')],'unique':_0x3e13('0x9')},'ListId':{'type':Sequelize[_0x3e13('0x7')],'unique':_0x3e13('0x9')},'UserId':{'type':Sequelize[_0x3e13('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x3e13('0x7')],'unique':_0x3e13('0x9')},'CampaignId':{'type':Sequelize[_0x3e13('0x7')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3e13('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x3e13('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x3e13('0x3')]},'recallmeNotifiedDate':{'type':Sequelize[_0x3e13('0x8')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xd44f=['exports','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','UNSIGNED','contactListQueue','moment','sequelize'];(function(_0x4bc9b2,_0x411ba4){var _0x4f7057=function(_0x176727){while(--_0x176727){_0x4bc9b2['push'](_0x4bc9b2['shift']());}};_0x4f7057(++_0x411ba4);}(_0xd44f,0x132));var _0xfd44=function(_0x3b67e4,_0x2a5d46){_0x3b67e4=_0x3b67e4-0x0;var _0x21adcf=_0xd44f[_0x3b67e4];return _0x21adcf;};'use strict';var moment=require(_0xfd44('0x0'));var Sequelize=require(_0xfd44('0x1'));module[_0xfd44('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xfd44('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xfd44('0x4')],'defaultValue':moment()[_0xfd44('0x5')](_0xfd44('0x6'))},'countbusyretry':{'type':Sequelize[_0xfd44('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xfd44('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xfd44('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xfd44('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xfd44('0x8')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xfd44('0x4')]},'priority':{'type':Sequelize[_0xfd44('0x7')](0x2)[_0xfd44('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xfd44('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xfd44('0xa')},'ListId':{'type':Sequelize[_0xfd44('0x7')],'unique':_0xfd44('0xa')},'UserId':{'type':Sequelize[_0xfd44('0x7')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xfd44('0xa')},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0xfd44('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xfd44('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xfd44('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xfd44('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xfd44('0x7')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xfd44('0x7')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xfd44('0x8')]},'recallmeNotifiedDate':{'type':Sequelize[_0xfd44('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index c14c457..54c7d8c 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 _0xaa7c=['$lte','$ne','$between','$notBetween','$in','$notIn','$like','$iLike','$overlap','$contained','$any','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','omit','dataValues','updatedAt','state','statedesc','campaign','membername','user','UserId','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','sequelize','transaction','direction','prev','isEmpty','hopperIds','priority','scheduledAt','dialOrderByScheduledAt','ASC','DESC','literal','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmList','List','dialActive','CmCompany','Company','isNumber','getOpenContacts','entity\x20not\x20found','sendStatus','timezones','getTimezone','moment','../../config/environment','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','update','then','error','name','send','index','map','CmHopper','rawAttributes','fieldName','key','model','query','keys','filters','intersection','concat','$and','$or','$gte','$lt'];(function(_0x1943d9,_0x245bb8){var _0x4b4f3f=function(_0x3bba90){while(--_0x3bba90){_0x1943d9['push'](_0x1943d9['shift']());}};_0x4b4f3f(++_0x245bb8);}(_0xaa7c,0x1ec));var _0xcaa7=function(_0x3ea5e1,_0x17c486){_0x3ea5e1=_0x3ea5e1-0x0;var _0x1b81d7=_0xaa7c[_0x3ea5e1];return _0x1b81d7;};'use strict';var moment=require(_0xcaa7('0x0'));var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var shared=require(_0xcaa7('0x1'));var db=require(_0xcaa7('0x2'))['db'];function respondWithResult(_0x4f837e,_0xd4ca36){_0xd4ca36=_0xd4ca36||0xc8;return function(_0xc85ba0){if(_0xc85ba0){return _0x4f837e[_0xcaa7('0x3')](_0xd4ca36)[_0xcaa7('0x4')](_0xc85ba0);}};}function respondWithFilteredResult(_0x27e610,_0x5a3674){return function(_0x4b9df0){if(_0x4b9df0){var _0x5bd940=typeof _0x5a3674['offset']===_0xcaa7('0x5')&&typeof _0x5a3674[_0xcaa7('0x6')]===_0xcaa7('0x5');var _0x5d2ca8=_0x4b9df0[_0xcaa7('0x7')];var _0x1de70a=_0x5bd940?0x0:_0x5a3674[_0xcaa7('0x8')];var _0x38a42d=_0x5bd940?_0x4b9df0[_0xcaa7('0x7')]:_0x5a3674['offset']+_0x5a3674[_0xcaa7('0x6')];var _0x39d53a;if(_0x38a42d>=_0x5d2ca8){_0x38a42d=_0x5d2ca8;_0x39d53a=0xc8;}else{_0x39d53a=0xce;}_0x27e610[_0xcaa7('0x3')](_0x39d53a);return _0x27e610[_0xcaa7('0x9')](_0xcaa7('0xa'),_0x1de70a+'-'+_0x38a42d+'/'+_0x5d2ca8)[_0xcaa7('0x4')](_0x4b9df0);}return null;};}function saveUpdates(_0x563f57,_0x24d3b0){return function(_0x128cfb){if(_0x128cfb){return _0x128cfb[_0xcaa7('0xb')](_0x563f57)[_0xcaa7('0xc')](function(_0x2bbc71){return _0x2bbc71;});}return null;};}function handleEntityNotFound(_0x2eb4ff,_0x299490){return function(_0x4a1d5a){if(!_0x4a1d5a){_0x2eb4ff['sendStatus'](0x194);}return _0x4a1d5a;};}function handleError(_0x314b7c,_0x1c1286){_0x1c1286=_0x1c1286||0x1f4;return function(_0x1155fb){logger[_0xcaa7('0xd')](_0x1155fb['stack']);if(_0x1155fb[_0xcaa7('0xe')]){delete _0x1155fb[_0xcaa7('0xe')];}_0x314b7c[_0xcaa7('0x3')](_0x1c1286)[_0xcaa7('0xf')](_0x1155fb);};}exports[_0xcaa7('0x10')]=function(_0xc46e37,_0x20ede0){var _0x5c2a74={},_0x53e1cb={},_0x4309e0={'count':0x0,'rows':[]};var _0x4491d1=_[_0xcaa7('0x11')](db[_0xcaa7('0x12')][_0xcaa7('0x13')],function(_0x2a0416){return{'name':_0x2a0416[_0xcaa7('0x14')],'type':_0x2a0416['type'][_0xcaa7('0x15')]};});_0x53e1cb[_0xcaa7('0x16')]=_[_0xcaa7('0x11')](_0x4491d1,_0xcaa7('0xe'));_0x53e1cb[_0xcaa7('0x17')]=_[_0xcaa7('0x18')](_0xc46e37[_0xcaa7('0x17')]);_0x53e1cb[_0xcaa7('0x19')]=_[_0xcaa7('0x1a')](_0x53e1cb[_0xcaa7('0x16')],_0x53e1cb[_0xcaa7('0x17')]);_0x53e1cb[_0xcaa7('0x19')]=_[_0xcaa7('0x1b')](_0x53e1cb['filters'],[_0xcaa7('0x1c'),_0xcaa7('0x1d'),'$gt',_0xcaa7('0x1e'),_0xcaa7('0x1f'),_0xcaa7('0x20'),_0xcaa7('0x21'),'$eq','$not',_0xcaa7('0x22'),_0xcaa7('0x23'),_0xcaa7('0x24'),_0xcaa7('0x25'),_0xcaa7('0x26'),'$notLike',_0xcaa7('0x27'),'$notILike','$like',_0xcaa7('0x28'),'$contains',_0xcaa7('0x29'),_0xcaa7('0x2a')]);_0x5c2a74[_0xcaa7('0x2b')]=_[_0xcaa7('0x1a')](_0x53e1cb[_0xcaa7('0x16')],qs[_0xcaa7('0x2c')](_0xc46e37[_0xcaa7('0x17')][_0xcaa7('0x2c')]));_0x5c2a74['attributes']=_0x5c2a74[_0xcaa7('0x2b')][_0xcaa7('0x2d')]?_0x5c2a74[_0xcaa7('0x2b')]:_0x53e1cb[_0xcaa7('0x16')];if(!_0xc46e37[_0xcaa7('0x17')]['hasOwnProperty'](_0xcaa7('0x2e'))){_0x5c2a74[_0xcaa7('0x6')]=qs[_0xcaa7('0x6')](_0xc46e37[_0xcaa7('0x17')][_0xcaa7('0x6')]);_0x5c2a74['offset']=qs[_0xcaa7('0x8')](_0xc46e37['query'][_0xcaa7('0x8')]);}_0x5c2a74[_0xcaa7('0x2f')]=qs[_0xcaa7('0x30')](_0xc46e37['query'][_0xcaa7('0x30')]);_0x5c2a74[_0xcaa7('0x31')]=qs[_0xcaa7('0x19')](_[_0xcaa7('0x32')](_0xc46e37[_0xcaa7('0x17')],_0x53e1cb[_0xcaa7('0x19')]),_0x4491d1);if(_0xc46e37['query'][_0xcaa7('0x33')]){_0x5c2a74[_0xcaa7('0x31')]=_['merge'](_0x5c2a74[_0xcaa7('0x31')],{'$or':_[_0xcaa7('0x11')](_0x4491d1,function(_0x444add){if(_0x444add[_0xcaa7('0x34')]!=='VIRTUAL'){var _0x16af20={};_0x16af20[_0x444add[_0xcaa7('0xe')]]={'$like':'%'+_0xc46e37[_0xcaa7('0x17')][_0xcaa7('0x33')]+'%'};return _0x16af20;}})});}_0x5c2a74=_[_0xcaa7('0x35')]({},_0x5c2a74,_0xc46e37[_0xcaa7('0x36')]);var _0xcb5439={'where':_0x5c2a74[_0xcaa7('0x31')]};return db[_0xcaa7('0x12')][_0xcaa7('0x7')](_0xcb5439)[_0xcaa7('0xc')](function(_0x266d5f){_0x4309e0['count']=_0x266d5f;if(_0xc46e37[_0xcaa7('0x17')][_0xcaa7('0x37')]){_0x5c2a74[_0xcaa7('0x38')]=[{'all':!![]}];}return db[_0xcaa7('0x12')][_0xcaa7('0x39')](_0x5c2a74);})['then'](function(_0x3d3c13){_0x4309e0[_0xcaa7('0x3a')]=_0x3d3c13;return _0x4309e0;})[_0xcaa7('0xc')](respondWithFilteredResult(_0x20ede0,_0x5c2a74))['catch'](handleError(_0x20ede0,null));};exports[_0xcaa7('0x3b')]=function(_0x3016f1,_0x320b46){var _0x1138a6={'raw':!![],'where':{'id':_0x3016f1[_0xcaa7('0x3c')]['id']}},_0x569c5f={};_0x569c5f['model']=_[_0xcaa7('0x18')](db['CmHopper'][_0xcaa7('0x13')]);_0x569c5f['query']=_['keys'](_0x3016f1[_0xcaa7('0x17')]);_0x569c5f[_0xcaa7('0x19')]=_['intersection'](_0x569c5f[_0xcaa7('0x16')],_0x569c5f[_0xcaa7('0x17')]);_0x1138a6[_0xcaa7('0x2b')]=_[_0xcaa7('0x1a')](_0x569c5f[_0xcaa7('0x16')],qs[_0xcaa7('0x2c')](_0x3016f1[_0xcaa7('0x17')][_0xcaa7('0x2c')]));_0x1138a6['attributes']=_0x1138a6[_0xcaa7('0x2b')][_0xcaa7('0x2d')]?_0x1138a6[_0xcaa7('0x2b')]:_0x569c5f[_0xcaa7('0x16')];if(_0x3016f1[_0xcaa7('0x17')][_0xcaa7('0x37')]){_0x1138a6['include']=[{'all':!![]}];}_0x1138a6=_[_0xcaa7('0x35')]({},_0x1138a6,_0x3016f1[_0xcaa7('0x36')]);return db[_0xcaa7('0x12')][_0xcaa7('0x3d')](_0x1138a6)[_0xcaa7('0xc')](handleEntityNotFound(_0x320b46,null))['then'](respondWithResult(_0x320b46,null))[_0xcaa7('0x3e')](handleError(_0x320b46,null));};exports[_0xcaa7('0x3f')]=function(_0x33c748,_0x490b0d){return db[_0xcaa7('0x12')]['create'](_0x33c748[_0xcaa7('0x40')],{})[_0xcaa7('0xc')](respondWithResult(_0x490b0d,0xc9))[_0xcaa7('0x3e')](handleError(_0x490b0d,null));};exports[_0xcaa7('0xb')]=function(_0x94e72d,_0x208495){if(_0x94e72d[_0xcaa7('0x40')]['id']){delete _0x94e72d['body']['id'];}return db['CmHopper'][_0xcaa7('0x3d')]({'where':{'id':_0x94e72d['params']['id']}})[_0xcaa7('0xc')](handleEntityNotFound(_0x208495,null))['then'](saveUpdates(_0x94e72d[_0xcaa7('0x40')],null))['then'](respondWithResult(_0x208495,null))[_0xcaa7('0x3e')](handleError(_0x208495,null));};exports[_0xcaa7('0x41')]=function(_0x1304a1,_0x32ec2d){return db[_0xcaa7('0x12')][_0xcaa7('0x41')]()['then'](respondWithResult(_0x32ec2d,null))['catch'](handleError(_0x32ec2d,null));};exports[_0xcaa7('0x42')]=function(_0x3a5f1f,_0x4f162c){var _0x417aaa;var _0x8a94a8=_0x3a5f1f[_0xcaa7('0x3c')]['id'];return db[_0xcaa7('0x12')][_0xcaa7('0x3d')]({'where':{'id':_0x3a5f1f[_0xcaa7('0x3c')]['id']}})[_0xcaa7('0xc')](handleEntityNotFound(_0x4f162c,null))[_0xcaa7('0xc')](function(_0x30d75c){if(_0x30d75c){return _0x30d75c[_0xcaa7('0x42')]()[_0xcaa7('0xc')](function(_0x3cc7ae){return _0x3cc7ae;});}})[_0xcaa7('0xc')](function(_0x3e77a9){_0x417aaa=_0x3e77a9;if(_0x3e77a9){if(_0x3e77a9[_0xcaa7('0x43')]||_0x3e77a9[_0xcaa7('0x44')]){return db[_0x3e77a9['VoiceQueueId']?_0xcaa7('0x45'):'Campaign'][_0xcaa7('0x3d')]({'where':{'id':_0x3e77a9[_0xcaa7('0x43')]?_0x3e77a9[_0xcaa7('0x43')]:_0x3e77a9[_0xcaa7('0x44')]},'attributes':['id',_0xcaa7('0xe')],'raw':!![]});}}})[_0xcaa7('0xc')](function(_0x1a2e55){var _0x2a263e={};if(_0x1a2e55){_[_0xcaa7('0x35')](_0x2a263e,_[_0xcaa7('0x46')](_0x417aaa[_0xcaa7('0x47')],['createdAt',_0xcaa7('0x48'),'id']));_0x2a263e[_0xcaa7('0x49')]=0x15;_0x2a263e[_0xcaa7('0x4a')]='deleted';_0x2a263e[_0xcaa7('0x4b')]=_0x1a2e55['name'];_0x2a263e[_0xcaa7('0x4c')]=_0x3a5f1f[_0xcaa7('0x4d')][_0xcaa7('0xe')];_0x2a263e[_0xcaa7('0x4e')]=_0x3a5f1f['user']['id'];_0x2a263e[_0xcaa7('0x4f')]=!![];_0x2a263e[_0xcaa7('0x50')]=moment()[_0xcaa7('0x51')](_0xcaa7('0x52'));_0x2a263e[_0xcaa7('0x53')]=_0x417aaa[_0xcaa7('0x54')];_0x2a263e[_0xcaa7('0x55')]=_0x417aaa[_0xcaa7('0x43')]?'queue':_0xcaa7('0x56');return db[_0xcaa7('0x57')][_0xcaa7('0x3d')]({'where':{'id':_0x2a263e[_0xcaa7('0x58')]},'attributes':[_0xcaa7('0x59'),_0xcaa7('0x5a')]})['then'](function(_0xcf623b){if(!_[_0xcaa7('0x5b')](_0x4f162c)&&!_['isNil'](_0xcf623b[_0xcaa7('0x59')])){_0x2a263e[_0xcaa7('0x5c')]=_0xcf623b[_0xcaa7('0x59')];if(!_['isNil'](_0xcf623b[_0xcaa7('0x5a')])){_0x2a263e[_0xcaa7('0x5c')]+='\x20'+_0xcf623b['lastName'];}}})[_0xcaa7('0x5d')](function(){return db[_0xcaa7('0x5e')][_0xcaa7('0x3f')](_0x2a263e);});}})[_0xcaa7('0xc')](function(_0xa6be83){return db[_0xcaa7('0x5f')][_0xcaa7('0x42')]({'where':{'CmHopperId':_0x8a94a8}});})[_0xcaa7('0xc')](function(){return _0x4f162c[_0xcaa7('0x3')](0xcc)[_0xcaa7('0x60')]();})[_0xcaa7('0x3e')](handleError(_0x4f162c,null));};exports[_0xcaa7('0x61')]=function(_0x3a6793,_0x1b494a){var _0x2c2df3=[];return db[_0xcaa7('0x57')][_0xcaa7('0x41')]()[_0xcaa7('0xc')](function(_0x596c65){_0x2c2df3=_[_0xcaa7('0x18')](_0x596c65);return _0x3a6793['user'][_0xcaa7('0x62')]({'where':{'type':_0xcaa7('0x63'),'dialActive':!![],'dialMethod':_0xcaa7('0x64')},'attributes':['id','dialOrderByScheduledAt',_0xcaa7('0x65')],'raw':!![]});})[_0xcaa7('0xc')](function(_0x1cf62d){if(_0x1cf62d&&_0x1cf62d[_0xcaa7('0x2d')]){return db[_0xcaa7('0x66')][_0xcaa7('0x67')](function(_0x322423){var _0x188480={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xcaa7('0x51')](_0xcaa7('0x52'))},'VoiceQueueId':{'$in':_['map'](_0x1cf62d,'id')},'$or':[{'UserId':null},{'UserId':_0x3a6793[_0xcaa7('0x4d')]['id']}]};var _0x22a605={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x1cf62d)['filter'](['dialPreviewAutoRecallMe',0x0])[_0xcaa7('0x11')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x3a6793[_0xcaa7('0x4d')]['id']}]};var _0x53c13c={'$or':[_0x188480,_0x22a605]};var _0x3dfb2d=[];if(_0x3a6793['body'][_0xcaa7('0x68')]&&_0x3a6793[_0xcaa7('0x40')][_0xcaa7('0x68')]===_0xcaa7('0x69')){if(!_[_0xcaa7('0x6a')](_0x3a6793[_0xcaa7('0x40')][_0xcaa7('0x6b')])){_0x53c13c['id']={'$in':_0x3a6793[_0xcaa7('0x40')][_0xcaa7('0x6b')]};}_0x3dfb2d=[[_0xcaa7('0x6c'),'ASC'],[_0xcaa7('0x6d'),_0x1cf62d[0x0][_0xcaa7('0x6e')]===_0xcaa7('0x6f')?_0xcaa7('0x70'):_0xcaa7('0x6f')],db[_0xcaa7('0x66')][_0xcaa7('0x71')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xcaa7('0x70')]];}else{if(!_[_0xcaa7('0x6a')](_0x3a6793[_0xcaa7('0x40')][_0xcaa7('0x6b')])){_0x53c13c['id']={'$notIn':_0x3a6793[_0xcaa7('0x40')]['hopperIds']};}_0x3dfb2d=[[_0xcaa7('0x6c'),'DESC'],['scheduledAt',_0x1cf62d[0x0][_0xcaa7('0x6e')]],db[_0xcaa7('0x66')][_0xcaa7('0x71')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0xcaa7('0x6f')]];}return db['CmHopper'][_0xcaa7('0x72')]({'attributes':['id',_0xcaa7('0x73'),'phone',_0xcaa7('0x74')],'where':_0x53c13c,'order':_0x3dfb2d,'transaction':_0x322423,'lock':_0x322423[_0xcaa7('0x75')][_0xcaa7('0x76')],'include':[{'model':db[_0xcaa7('0x57')],'as':_0xcaa7('0x77'),'attributes':_0x2c2df3,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0xcaa7('0xe')]}]},{'model':db[_0xcaa7('0x78')],'as':_0xcaa7('0x79'),'attributes':['id',_0xcaa7('0xe')]},{'model':db[_0xcaa7('0x45')],'as':'Queue','attributes':['id',_0xcaa7('0xe'),_0xcaa7('0x7a')]}]})['then'](function(_0x22841e){if(_0x22841e){return _0x22841e[_0xcaa7('0xb')]({'UserId':_0x3a6793[_0xcaa7('0x4d')]['id']},{'transaction':_0x322423});}});});}})[_0xcaa7('0xc')](handleEntityNotFound(_0x1b494a,null))[_0xcaa7('0xc')](respondWithResult(_0x1b494a,null))[_0xcaa7('0x3e')](handleError(_0x1b494a,null));};exports['getPreviewRecall']=function(_0x4af581,_0x3cbe09,_0x3ea57c){var _0x2b1e92=[];var _0x2381ce=_0x4af581['params']['id'];var _0x5c0380=_0x4af581[_0xcaa7('0x4d')]['id'];return db[_0xcaa7('0x57')][_0xcaa7('0x41')]()[_0xcaa7('0xc')](function(_0x30517b){_0x2b1e92=_['keys'](_0x30517b);return db[_0xcaa7('0x66')][_0xcaa7('0x67')](function(_0x273efe){const _0x2b4c26={'id':_0x2381ce};return db['CmHopper'][_0xcaa7('0x72')]({'attributes':['id',_0xcaa7('0x73'),_0xcaa7('0x74')],'where':_0x2b4c26,'transaction':_0x273efe,'lock':_0x273efe['LOCK'][_0xcaa7('0x76')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x2b1e92,'include':[{'model':db[_0xcaa7('0x7b')],'as':_0xcaa7('0x7c'),'attributes':['id',_0xcaa7('0xe')]}]},{'model':db[_0xcaa7('0x78')],'as':'List','attributes':['id',_0xcaa7('0xe')]},{'model':db[_0xcaa7('0x45')],'as':'Queue','attributes':['id',_0xcaa7('0xe'),_0xcaa7('0x7a')]}]})[_0xcaa7('0xc')](function(_0x5399d3){if(_0x5399d3){return _0x5399d3[_0xcaa7('0xb')]({'UserId':_0x5c0380},{'transaction':_0x273efe});}});});})[_0xcaa7('0xc')](handleEntityNotFound(_0x3cbe09,null))['then'](respondWithResult(_0x3cbe09,null))[_0xcaa7('0x3e')](handleError(_0x3cbe09,null));};exports['getOpenContacts']=function(_0xdc48b8,_0xa3fcb3){return _0xdc48b8['user'][_0xcaa7('0x62')]({'where':{'type':_0xcaa7('0x63'),'dialActive':!![],'dialMethod':_0xcaa7('0x64')},'attributes':['id'],'raw':!![]})['then'](function(_0x1499e9){if(_0x1499e9&&_0x1499e9[_0xcaa7('0x2d')]){return db[_0xcaa7('0x12')][_0xcaa7('0x7')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xcaa7('0x52'))},'VoiceQueueId':{'$in':_[_0xcaa7('0x11')](_0x1499e9,'id')},'$or':[{'UserId':null},{'UserId':_0xdc48b8[_0xcaa7('0x4d')]['id']}]}});}return 0x0;})['then'](function(_0x505d43){if(!_[_0xcaa7('0x5b')](_0x505d43)&&_[_0xcaa7('0x7d')](_0x505d43)){return _0xa3fcb3[_0xcaa7('0x3')](0xc8)[_0xcaa7('0x4')]({'contacts':_0x505d43});}else{logger[_0xcaa7('0xd')]('CmHopper,\x20%s,\x20%s,\x20%s',_0xcaa7('0x7e'),0x194,_0xcaa7('0x7f'));_0xa3fcb3[_0xcaa7('0x80')](0x194);}})[_0xcaa7('0x3e')](handleError(_0xa3fcb3,null));};exports['getTimezones']=function(_0x3e74be,_0x358643){var _0x332433=shared[_0xcaa7('0x81')];var _0x32c6bc=[];_[_0xcaa7('0x11')](_0x332433,function(_0x16559e){_0x32c6bc['push']({'id':_0x16559e[_0xcaa7('0xe')],'name':_0x16559e[_0xcaa7('0xe')],'utcOffset':_0x16559e['utcOffset']});});return _0x358643['status'](0xc8)[_0xcaa7('0x4')]({'tz':_0x32c6bc});};exports[_0xcaa7('0x82')]=function(_0x3797fc,_0x4dfb92){var _0x1a7f2a=shared[_0xcaa7('0x81')];var _0x28cfa4={};if(!_[_0xcaa7('0x5b')](_0x1a7f2a[_0x3797fc[_0xcaa7('0x40')]['id']]))_0x28cfa4=_0x1a7f2a[_0x3797fc[_0xcaa7('0x40')]['id']];return _0x4dfb92[_0xcaa7('0x3')](0xc8)[_0xcaa7('0x4')](_0x28cfa4);}; \ No newline at end of file +var _0x4c4e=['options','include','findAll','rows','show','params','includeAll','find','catch','create','body','update','describe','destroy','CampaignId','VoiceQueue','Campaign','VoiceQueueId','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','campaigntype','queue','ivr','CmContact','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','getPreview','outbound','dialOrderByScheduledAt','dialPreviewAutoRecallMe','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','DESC','literal','scheduledAt','sequelize','findOne','scheduledat','phone','LOCK','UPDATE','Company','CmList','List','Queue','dialActive','recallme','Contact','getOpenContacts','getVoiceQueues','preview','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','getTimezones','push','utcOffset','getTimezone','timezones','moment','../../components/parsers/qs','../../config/logger','api','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','then','error','stack','name','send','index','map','CmHopper','rawAttributes','type','key','model','query','keys','filters','intersection','concat','$gt','$lt','$ne','$not','$notBetween','$iLike','$overlap','$contains','attributes','fields','length','sort','where','pick','filter','merge'];(function(_0xf73c09,_0x4e424e){var _0xa8923c=function(_0x4831c1){while(--_0x4831c1){_0xf73c09['push'](_0xf73c09['shift']());}};_0xa8923c(++_0x4e424e);}(_0x4c4e,0x152));var _0xe4c4=function(_0x2537e2,_0x1f73a1){_0x2537e2=_0x2537e2-0x0;var _0x167aed=_0x4c4e[_0x2537e2];return _0x167aed;};'use strict';var moment=require(_0xe4c4('0x0'));var _=require('lodash');var qs=require(_0xe4c4('0x1'));var logger=require(_0xe4c4('0x2'))(_0xe4c4('0x3'));var shared=require('../../config/environment');var db=require(_0xe4c4('0x4'))['db'];function respondWithResult(_0x7d7655,_0x1a4483){_0x1a4483=_0x1a4483||0xc8;return function(_0x4cd652){if(_0x4cd652){return _0x7d7655[_0xe4c4('0x5')](_0x1a4483)['json'](_0x4cd652);}};}function respondWithFilteredResult(_0x177732,_0x1a12a6){return function(_0x262b64){if(_0x262b64){var _0xad105=typeof _0x1a12a6[_0xe4c4('0x6')]===_0xe4c4('0x7')&&typeof _0x1a12a6[_0xe4c4('0x8')]===_0xe4c4('0x7');var _0x4c953c=_0x262b64['count'];var _0x31f879=_0xad105?0x0:_0x1a12a6[_0xe4c4('0x6')];var _0x27ad42=_0xad105?_0x262b64[_0xe4c4('0x9')]:_0x1a12a6[_0xe4c4('0x6')]+_0x1a12a6[_0xe4c4('0x8')];var _0x50264f;if(_0x27ad42>=_0x4c953c){_0x27ad42=_0x4c953c;_0x50264f=0xc8;}else{_0x50264f=0xce;}_0x177732[_0xe4c4('0x5')](_0x50264f);return _0x177732[_0xe4c4('0xa')](_0xe4c4('0xb'),_0x31f879+'-'+_0x27ad42+'/'+_0x4c953c)[_0xe4c4('0xc')](_0x262b64);}return null;};}function saveUpdates(_0x50bfab,_0x262083){return function(_0x115802){if(_0x115802){return _0x115802['update'](_0x50bfab)[_0xe4c4('0xd')](function(_0x1a44e5){return _0x1a44e5;});}return null;};}function handleEntityNotFound(_0x5aa89b,_0x42ce9e){return function(_0x29766a){if(!_0x29766a){_0x5aa89b['sendStatus'](0x194);}return _0x29766a;};}function handleError(_0x307aa8,_0x465c9b){_0x465c9b=_0x465c9b||0x1f4;return function(_0x26ea05){logger[_0xe4c4('0xe')](_0x26ea05[_0xe4c4('0xf')]);if(_0x26ea05[_0xe4c4('0x10')]){delete _0x26ea05[_0xe4c4('0x10')];}_0x307aa8[_0xe4c4('0x5')](_0x465c9b)[_0xe4c4('0x11')](_0x26ea05);};}exports[_0xe4c4('0x12')]=function(_0x23b7e6,_0x42242c){var _0x3820c7={},_0x43a9ce={},_0x376585={'count':0x0,'rows':[]};var _0x5a32b5=_[_0xe4c4('0x13')](db[_0xe4c4('0x14')][_0xe4c4('0x15')],function(_0x317cc8){return{'name':_0x317cc8['fieldName'],'type':_0x317cc8[_0xe4c4('0x16')][_0xe4c4('0x17')]};});_0x43a9ce[_0xe4c4('0x18')]=_[_0xe4c4('0x13')](_0x5a32b5,_0xe4c4('0x10'));_0x43a9ce[_0xe4c4('0x19')]=_[_0xe4c4('0x1a')](_0x23b7e6[_0xe4c4('0x19')]);_0x43a9ce[_0xe4c4('0x1b')]=_[_0xe4c4('0x1c')](_0x43a9ce[_0xe4c4('0x18')],_0x43a9ce[_0xe4c4('0x19')]);_0x43a9ce[_0xe4c4('0x1b')]=_[_0xe4c4('0x1d')](_0x43a9ce[_0xe4c4('0x1b')],['$and','$or',_0xe4c4('0x1e'),'$gte',_0xe4c4('0x1f'),'$lte',_0xe4c4('0x20'),'$eq',_0xe4c4('0x21'),'$between',_0xe4c4('0x22'),'$in','$notIn','$like','$notLike',_0xe4c4('0x23'),'$notILike','$like',_0xe4c4('0x24'),_0xe4c4('0x25'),'$contained','$any']);_0x3820c7[_0xe4c4('0x26')]=_[_0xe4c4('0x1c')](_0x43a9ce['model'],qs[_0xe4c4('0x27')](_0x23b7e6[_0xe4c4('0x19')][_0xe4c4('0x27')]));_0x3820c7['attributes']=_0x3820c7['attributes'][_0xe4c4('0x28')]?_0x3820c7[_0xe4c4('0x26')]:_0x43a9ce[_0xe4c4('0x18')];if(!_0x23b7e6[_0xe4c4('0x19')]['hasOwnProperty']('nolimit')){_0x3820c7[_0xe4c4('0x8')]=qs[_0xe4c4('0x8')](_0x23b7e6['query'][_0xe4c4('0x8')]);_0x3820c7[_0xe4c4('0x6')]=qs[_0xe4c4('0x6')](_0x23b7e6['query'][_0xe4c4('0x6')]);}_0x3820c7['order']=qs[_0xe4c4('0x29')](_0x23b7e6[_0xe4c4('0x19')][_0xe4c4('0x29')]);_0x3820c7[_0xe4c4('0x2a')]=qs[_0xe4c4('0x1b')](_[_0xe4c4('0x2b')](_0x23b7e6[_0xe4c4('0x19')],_0x43a9ce[_0xe4c4('0x1b')]),_0x5a32b5);if(_0x23b7e6[_0xe4c4('0x19')][_0xe4c4('0x2c')]){_0x3820c7[_0xe4c4('0x2a')]=_[_0xe4c4('0x2d')](_0x3820c7['where'],{'$or':_[_0xe4c4('0x13')](_0x5a32b5,function(_0x25eb81){if(_0x25eb81[_0xe4c4('0x16')]!=='VIRTUAL'){var _0xac6cb4={};_0xac6cb4[_0x25eb81[_0xe4c4('0x10')]]={'$like':'%'+_0x23b7e6[_0xe4c4('0x19')]['filter']+'%'};return _0xac6cb4;}})});}_0x3820c7=_[_0xe4c4('0x2d')]({},_0x3820c7,_0x23b7e6[_0xe4c4('0x2e')]);var _0x4a3644={'where':_0x3820c7[_0xe4c4('0x2a')]};return db[_0xe4c4('0x14')][_0xe4c4('0x9')](_0x4a3644)[_0xe4c4('0xd')](function(_0x44f4eb){_0x376585[_0xe4c4('0x9')]=_0x44f4eb;if(_0x23b7e6[_0xe4c4('0x19')]['includeAll']){_0x3820c7[_0xe4c4('0x2f')]=[{'all':!![]}];}return db[_0xe4c4('0x14')][_0xe4c4('0x30')](_0x3820c7);})[_0xe4c4('0xd')](function(_0x4c5551){_0x376585[_0xe4c4('0x31')]=_0x4c5551;return _0x376585;})[_0xe4c4('0xd')](respondWithFilteredResult(_0x42242c,_0x3820c7))['catch'](handleError(_0x42242c,null));};exports[_0xe4c4('0x32')]=function(_0x185959,_0x4db15d){var _0x433f0c={'raw':!![],'where':{'id':_0x185959[_0xe4c4('0x33')]['id']}},_0x3cd4d3={};_0x3cd4d3[_0xe4c4('0x18')]=_[_0xe4c4('0x1a')](db[_0xe4c4('0x14')][_0xe4c4('0x15')]);_0x3cd4d3[_0xe4c4('0x19')]=_[_0xe4c4('0x1a')](_0x185959[_0xe4c4('0x19')]);_0x3cd4d3[_0xe4c4('0x1b')]=_[_0xe4c4('0x1c')](_0x3cd4d3['model'],_0x3cd4d3[_0xe4c4('0x19')]);_0x433f0c[_0xe4c4('0x26')]=_[_0xe4c4('0x1c')](_0x3cd4d3[_0xe4c4('0x18')],qs[_0xe4c4('0x27')](_0x185959[_0xe4c4('0x19')]['fields']));_0x433f0c[_0xe4c4('0x26')]=_0x433f0c['attributes'][_0xe4c4('0x28')]?_0x433f0c[_0xe4c4('0x26')]:_0x3cd4d3[_0xe4c4('0x18')];if(_0x185959[_0xe4c4('0x19')][_0xe4c4('0x34')]){_0x433f0c['include']=[{'all':!![]}];}_0x433f0c=_['merge']({},_0x433f0c,_0x185959[_0xe4c4('0x2e')]);return db[_0xe4c4('0x14')][_0xe4c4('0x35')](_0x433f0c)['then'](handleEntityNotFound(_0x4db15d,null))[_0xe4c4('0xd')](respondWithResult(_0x4db15d,null))[_0xe4c4('0x36')](handleError(_0x4db15d,null));};exports[_0xe4c4('0x37')]=function(_0x36e7b1,_0x54e073){return db[_0xe4c4('0x14')][_0xe4c4('0x37')](_0x36e7b1[_0xe4c4('0x38')],{})[_0xe4c4('0xd')](respondWithResult(_0x54e073,0xc9))[_0xe4c4('0x36')](handleError(_0x54e073,null));};exports[_0xe4c4('0x39')]=function(_0x1eda5e,_0x176712){if(_0x1eda5e[_0xe4c4('0x38')]['id']){delete _0x1eda5e['body']['id'];}return db[_0xe4c4('0x14')]['find']({'where':{'id':_0x1eda5e[_0xe4c4('0x33')]['id']}})[_0xe4c4('0xd')](handleEntityNotFound(_0x176712,null))[_0xe4c4('0xd')](saveUpdates(_0x1eda5e[_0xe4c4('0x38')],null))[_0xe4c4('0xd')](respondWithResult(_0x176712,null))[_0xe4c4('0x36')](handleError(_0x176712,null));};exports[_0xe4c4('0x3a')]=function(_0xeb6432,_0x36f8ad){return db[_0xe4c4('0x14')][_0xe4c4('0x3a')]()[_0xe4c4('0xd')](respondWithResult(_0x36f8ad,null))[_0xe4c4('0x36')](handleError(_0x36f8ad,null));};exports[_0xe4c4('0x3b')]=function(_0x535bcc,_0x4922f5){var _0xe0e351;var _0x198961=_0x535bcc['params']['id'];return db[_0xe4c4('0x14')][_0xe4c4('0x35')]({'where':{'id':_0x535bcc[_0xe4c4('0x33')]['id']}})[_0xe4c4('0xd')](handleEntityNotFound(_0x4922f5,null))[_0xe4c4('0xd')](function(_0x5587b2){if(_0x5587b2){return _0x5587b2[_0xe4c4('0x3b')]()[_0xe4c4('0xd')](function(_0x4f6e03){return _0x4f6e03;});}})[_0xe4c4('0xd')](function(_0x24b0e7){_0xe0e351=_0x24b0e7;if(_0x24b0e7){if(_0x24b0e7['VoiceQueueId']||_0x24b0e7[_0xe4c4('0x3c')]){return db[_0x24b0e7['VoiceQueueId']?_0xe4c4('0x3d'):_0xe4c4('0x3e')][_0xe4c4('0x35')]({'where':{'id':_0x24b0e7[_0xe4c4('0x3f')]?_0x24b0e7[_0xe4c4('0x3f')]:_0x24b0e7['CampaignId']},'attributes':['id',_0xe4c4('0x10')],'raw':!![]});}}})[_0xe4c4('0xd')](function(_0x33bcec){var _0x2350d7={};if(_0x33bcec){_[_0xe4c4('0x2d')](_0x2350d7,_[_0xe4c4('0x40')](_0xe0e351[_0xe4c4('0x41')],[_0xe4c4('0x42'),_0xe4c4('0x43'),'id']));_0x2350d7[_0xe4c4('0x44')]=0x15;_0x2350d7[_0xe4c4('0x45')]=_0xe4c4('0x46');_0x2350d7[_0xe4c4('0x47')]=_0x33bcec[_0xe4c4('0x10')];_0x2350d7[_0xe4c4('0x48')]=_0x535bcc[_0xe4c4('0x49')]['name'];_0x2350d7[_0xe4c4('0x4a')]=_0x535bcc[_0xe4c4('0x49')]['id'];_0x2350d7[_0xe4c4('0x46')]=!![];_0x2350d7['deletedat']=moment()[_0xe4c4('0x4b')](_0xe4c4('0x4c'));_0x2350d7[_0xe4c4('0x4d')]=_0xe0e351['phone'];_0x2350d7[_0xe4c4('0x4e')]=_0xe0e351['VoiceQueueId']?_0xe4c4('0x4f'):_0xe4c4('0x50');return db[_0xe4c4('0x51')]['find']({'where':{'id':_0x2350d7['ContactId']},'attributes':[_0xe4c4('0x52'),_0xe4c4('0x53')]})[_0xe4c4('0xd')](function(_0x5edcae){if(!_[_0xe4c4('0x54')](_0x4922f5)&&!_['isNil'](_0x5edcae['firstName'])){_0x2350d7['calleridname']=_0x5edcae['firstName'];if(!_[_0xe4c4('0x54')](_0x5edcae[_0xe4c4('0x53')])){_0x2350d7[_0xe4c4('0x55')]+='\x20'+_0x5edcae[_0xe4c4('0x53')];}}})[_0xe4c4('0x56')](function(){return db[_0xe4c4('0x57')]['create'](_0x2350d7);});}})[_0xe4c4('0xd')](function(_0x44eb3b){return db[_0xe4c4('0x58')][_0xe4c4('0x3b')]({'where':{'CmHopperId':_0x198961}});})[_0xe4c4('0xd')](function(){return _0x4922f5[_0xe4c4('0x5')](0xcc)['end']();})['catch'](handleError(_0x4922f5,null));};exports[_0xe4c4('0x59')]=function(_0x6f374e,_0x1986ab){var _0x3c8e44=[];return db[_0xe4c4('0x51')][_0xe4c4('0x3a')]()[_0xe4c4('0xd')](function(_0x24e1a2){_0x3c8e44=_[_0xe4c4('0x1a')](_0x24e1a2);return _0x6f374e['user']['getVoiceQueues']({'where':{'type':_0xe4c4('0x5a'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xe4c4('0x5b'),_0xe4c4('0x5c')],'raw':!![]});})[_0xe4c4('0xd')](function(_0x58f2dd){if(_0x58f2dd&&_0x58f2dd[_0xe4c4('0x28')]){return db['sequelize'][_0xe4c4('0x5d')](function(_0x56ead3){var _0x5d6c0a={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xe4c4('0x4b')](_0xe4c4('0x4c'))},'VoiceQueueId':{'$in':_[_0xe4c4('0x13')](_0x58f2dd,'id')},'$or':[{'UserId':null},{'UserId':_0x6f374e['user']['id']}]};var _0x57e38e={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x58f2dd)['filter']([_0xe4c4('0x5c'),0x0])[_0xe4c4('0x13')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x6f374e[_0xe4c4('0x49')]['id']}]};var _0x3850da={'$or':[_0x5d6c0a,_0x57e38e]};var _0x11115a=[];if(_0x6f374e['body']['direction']&&_0x6f374e[_0xe4c4('0x38')][_0xe4c4('0x5e')]===_0xe4c4('0x5f')){if(!_[_0xe4c4('0x60')](_0x6f374e[_0xe4c4('0x38')][_0xe4c4('0x61')])){_0x3850da['id']={'$in':_0x6f374e['body'][_0xe4c4('0x61')]};}_0x11115a=[[_0xe4c4('0x62'),_0xe4c4('0x63')],['scheduledAt',_0x58f2dd[0x0][_0xe4c4('0x5b')]===_0xe4c4('0x63')?_0xe4c4('0x64'):'ASC'],db['sequelize'][_0xe4c4('0x65')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id','DESC']];}else{if(!_[_0xe4c4('0x60')](_0x6f374e[_0xe4c4('0x38')][_0xe4c4('0x61')])){_0x3850da['id']={'$notIn':_0x6f374e[_0xe4c4('0x38')][_0xe4c4('0x61')]};}_0x11115a=[[_0xe4c4('0x62'),_0xe4c4('0x64')],[_0xe4c4('0x66'),_0x58f2dd[0x0]['dialOrderByScheduledAt']],db[_0xe4c4('0x67')][_0xe4c4('0x65')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0xe4c4('0x14')][_0xe4c4('0x68')]({'attributes':['id',_0xe4c4('0x69'),_0xe4c4('0x6a'),'recallme'],'where':_0x3850da,'order':_0x11115a,'transaction':_0x56ead3,'lock':_0x56ead3[_0xe4c4('0x6b')][_0xe4c4('0x6c')],'include':[{'model':db[_0xe4c4('0x51')],'as':'Contact','attributes':_0x3c8e44,'include':[{'model':db['CmCompany'],'as':_0xe4c4('0x6d'),'attributes':['id',_0xe4c4('0x10')]}]},{'model':db[_0xe4c4('0x6e')],'as':_0xe4c4('0x6f'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':_0xe4c4('0x70'),'attributes':['id',_0xe4c4('0x10'),_0xe4c4('0x71')]}]})[_0xe4c4('0xd')](function(_0x1c9f4b){if(_0x1c9f4b){return _0x1c9f4b['update']({'UserId':_0x6f374e[_0xe4c4('0x49')]['id']},{'transaction':_0x56ead3});}});});}})['then'](handleEntityNotFound(_0x1986ab,null))[_0xe4c4('0xd')](respondWithResult(_0x1986ab,null))[_0xe4c4('0x36')](handleError(_0x1986ab,null));};exports['getPreviewRecall']=function(_0x570f1f,_0x4eddfd,_0x279075){var _0x250bb8=[];var _0x1f880f=_0x570f1f[_0xe4c4('0x33')]['id'];var _0x5b41e6=_0x570f1f['user']['id'];return db['CmContact'][_0xe4c4('0x3a')]()[_0xe4c4('0xd')](function(_0x4c10ef){_0x250bb8=_[_0xe4c4('0x1a')](_0x4c10ef);return db[_0xe4c4('0x67')][_0xe4c4('0x5d')](function(_0xb0a006){const _0x5cbc28={'id':_0x1f880f};return db['CmHopper'][_0xe4c4('0x68')]({'attributes':['id',_0xe4c4('0x69'),_0xe4c4('0x72')],'where':_0x5cbc28,'transaction':_0xb0a006,'lock':_0xb0a006[_0xe4c4('0x6b')][_0xe4c4('0x6c')],'include':[{'model':db[_0xe4c4('0x51')],'as':_0xe4c4('0x73'),'attributes':_0x250bb8,'include':[{'model':db['CmCompany'],'as':_0xe4c4('0x6d'),'attributes':['id',_0xe4c4('0x10')]}]},{'model':db[_0xe4c4('0x6e')],'as':_0xe4c4('0x6f'),'attributes':['id','name']},{'model':db[_0xe4c4('0x3d')],'as':_0xe4c4('0x70'),'attributes':['id',_0xe4c4('0x10'),_0xe4c4('0x71')]}]})['then'](function(_0x209602){if(_0x209602){return _0x209602[_0xe4c4('0x39')]({'UserId':_0x5b41e6},{'transaction':_0xb0a006});}});});})['then'](handleEntityNotFound(_0x4eddfd,null))['then'](respondWithResult(_0x4eddfd,null))[_0xe4c4('0x36')](handleError(_0x4eddfd,null));};exports[_0xe4c4('0x74')]=function(_0x3314d6,_0xe30faf){return _0x3314d6[_0xe4c4('0x49')][_0xe4c4('0x75')]({'where':{'type':_0xe4c4('0x5a'),'dialActive':!![],'dialMethod':_0xe4c4('0x76')},'attributes':['id'],'raw':!![]})['then'](function(_0x5ae9f0){if(_0x5ae9f0&&_0x5ae9f0[_0xe4c4('0x28')]){return db[_0xe4c4('0x14')][_0xe4c4('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xe4c4('0x4b')](_0xe4c4('0x4c'))},'VoiceQueueId':{'$in':_['map'](_0x5ae9f0,'id')},'$or':[{'UserId':null},{'UserId':_0x3314d6[_0xe4c4('0x49')]['id']}]}});}return 0x0;})[_0xe4c4('0xd')](function(_0x425f38){if(!_[_0xe4c4('0x54')](_0x425f38)&&_[_0xe4c4('0x77')](_0x425f38)){return _0xe30faf[_0xe4c4('0x5')](0xc8)[_0xe4c4('0xc')]({'contacts':_0x425f38});}else{logger[_0xe4c4('0xe')](_0xe4c4('0x78'),_0xe4c4('0x74'),0x194,_0xe4c4('0x79'));_0xe30faf[_0xe4c4('0x7a')](0x194);}})[_0xe4c4('0x36')](handleError(_0xe30faf,null));};exports[_0xe4c4('0x7b')]=function(_0x1ccdb2,_0x1295a4){var _0x52c3e0=shared['timezones'];var _0x340983=[];_['map'](_0x52c3e0,function(_0x46de38){_0x340983[_0xe4c4('0x7c')]({'id':_0x46de38[_0xe4c4('0x10')],'name':_0x46de38[_0xe4c4('0x10')],'utcOffset':_0x46de38[_0xe4c4('0x7d')]});});return _0x1295a4[_0xe4c4('0x5')](0xc8)[_0xe4c4('0xc')]({'tz':_0x340983});};exports[_0xe4c4('0x7e')]=function(_0x371947,_0x1579fe){var _0x37bf48=shared[_0xe4c4('0x7f')];var _0x3030f6={};if(!_['isNil'](_0x37bf48[_0x371947[_0xe4c4('0x38')]['id']]))_0x3030f6=_0x37bf48[_0x371947[_0xe4c4('0x38')]['id']];return _0x1579fe[_0xe4c4('0x5')](0xc8)[_0xe4c4('0xc')](_0x3030f6);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index f9ecb19..4dddbd3 100644 --- a/server/api/cmHopper/cmHopper.model.js +++ b/server/api/cmHopper/cmHopper.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2a07=['api','moment','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger'];(function(_0x1304c6,_0x6bb485){var _0x2e6654=function(_0x2b623c){while(--_0x2b623c){_0x1304c6['push'](_0x1304c6['shift']());}};_0x2e6654(++_0x6bb485);}(_0x2a07,0x74));var _0x72a0=function(_0x32659d,_0x58ece9){_0x32659d=_0x32659d-0x0;var _0x10d610=_0x2a07[_0x32659d];return _0x10d610;};'use strict';var _=require(_0x72a0('0x0'));var util=require(_0x72a0('0x1'));var logger=require(_0x72a0('0x2'))(_0x72a0('0x3'));var moment=require(_0x72a0('0x4'));var BPromise=require('bluebird');var rp=require(_0x72a0('0x5'));var fs=require('fs');var path=require(_0x72a0('0x6'));var rimraf=require(_0x72a0('0x7'));var config=require(_0x72a0('0x8'));var attributes=require(_0x72a0('0x9'));module[_0x72a0('0xa')]=function(_0x3ccf6d,_0x20dab9){return _0x3ccf6d[_0x72a0('0xb')](_0x72a0('0xc'),attributes,{'tableName':_0x72a0('0xd'),'paranoid':![],'indexes':[{'name':_0x72a0('0xe'),'fields':[_0x72a0('0xe')]},{'name':_0x72a0('0xf'),'fields':[_0x72a0('0xf')]},{'name':_0x72a0('0x10'),'fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5d17=['define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x312aa4,_0x52aefc){var _0x218fbd=function(_0x15331d){while(--_0x15331d){_0x312aa4['push'](_0x312aa4['shift']());}};_0x218fbd(++_0x52aefc);}(_0x5d17,0x114));var _0x75d1=function(_0x2e2d89,_0x4bb615){_0x2e2d89=_0x2e2d89-0x0;var _0x3aba90=_0x5d17[_0x2e2d89];return _0x3aba90;};'use strict';var _=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x75d1('0x2'));var BPromise=require(_0x75d1('0x3'));var rp=require(_0x75d1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75d1('0x5'));var config=require(_0x75d1('0x6'));var attributes=require(_0x75d1('0x7'));module[_0x75d1('0x8')]=function(_0x56ac0a,_0x458681){return _0x56ac0a[_0x75d1('0x9')](_0x75d1('0xa'),attributes,{'tableName':_0x75d1('0xb'),'paranoid':![],'indexes':[{'name':_0x75d1('0xc'),'fields':[_0x75d1('0xc')]},{'name':_0x75d1('0xd'),'fields':['phone']},{'name':'priority','fields':[_0x75d1('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 72f9b91..27ae174 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 _0xf4b4=['stringify','catch','error','message','ShowCmHopper','find','debug','CreateCmHopper','create','UpdateCmHopper','update','body','limit','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','GetContactDialer','CmContact','describe','transaction','order','LOCK','UPDATE','Contact','keys','Agent','push','includes','all','length','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','MoveContactManagedDialer','sequelize','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','destroy','COUNT','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','CountReScheduled','GetContactRecallMe','UserId','GetCmHopperPreview','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','name','voicePause','CmList','List','CmHopperHandlePreviewRecallNotifications','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','include','map','model','then','info'];(function(_0x223792,_0x140f1c){var _0x97cb8f=function(_0x5536d6){while(--_0x5536d6){_0x223792['push'](_0x223792['shift']());}};_0x97cb8f(++_0x140f1c);}(_0xf4b4,0x92));var _0x4f4b=function(_0x4d0d85,_0x3250d3){_0x4d0d85=_0x4d0d85-0x0;var _0x290a74=_0xf4b4[_0x4d0d85];return _0x290a74;};'use strict';var _=require('lodash');var util=require(_0x4f4b('0x0'));var moment=require(_0x4f4b('0x1'));var BPromise=require(_0x4f4b('0x2'));var db=require(_0x4f4b('0x3'))['db'];var logger=require(_0x4f4b('0x4'))(_0x4f4b('0x5'));exports[_0x4f4b('0x6')]=function(_0x55c374){var _0x323c11=this;return new Promise(function(_0x5f00eb,_0xd1db7b){return db[_0x4f4b('0x7')][_0x4f4b('0x8')]({'raw':_0x55c374[_0x4f4b('0x9')]?_0x55c374[_0x4f4b('0x9')][_0x4f4b('0xa')]===undefined?!![]:![]:!![],'where':_0x55c374['options']?_0x55c374[_0x4f4b('0x9')][_0x4f4b('0xb')]||null:null,'attributes':_0x55c374[_0x4f4b('0x9')]?_0x55c374[_0x4f4b('0x9')][_0x4f4b('0xc')]||null:null,'limit':_0x55c374[_0x4f4b('0x9')]?_0x55c374[_0x4f4b('0x9')]['limit']||null:null,'include':_0x55c374[_0x4f4b('0x9')]?_0x55c374['options']['include']?_['map'](_0x55c374[_0x4f4b('0x9')][_0x4f4b('0xd')],function(_0x58e77e){return{'model':db[_0x58e77e['model']],'as':_0x58e77e['as'],'attributes':_0x58e77e[_0x4f4b('0xc')],'include':_0x58e77e['include']?_[_0x4f4b('0xe')](_0x58e77e['include'],function(_0x94a5d5){return{'model':db[_0x94a5d5[_0x4f4b('0xf')]],'as':_0x94a5d5['as'],'attributes':_0x94a5d5[_0x4f4b('0xc')],'include':_0x94a5d5[_0x4f4b('0xd')]?_['map'](_0x94a5d5[_0x4f4b('0xd')],function(_0x29a823){return{'model':db[_0x29a823[_0x4f4b('0xf')]],'as':_0x29a823['as'],'attributes':_0x29a823[_0x4f4b('0xc')]};}):[]};}):[]};}):[]:[]})[_0x4f4b('0x10')](function(_0x584e78){logger[_0x4f4b('0x11')](_0x4f4b('0x6'),_0x55c374);logger['debug'](_0x4f4b('0x6'),_0x55c374,JSON[_0x4f4b('0x12')](_0x584e78));_0x5f00eb(_0x584e78);})[_0x4f4b('0x13')](function(_0x5ee0d2){logger[_0x4f4b('0x14')](_0x4f4b('0x6'),_0x5ee0d2[_0x4f4b('0x15')],_0x55c374);_0xd1db7b(_0x323c11['error'](0x1f4,_0x5ee0d2[_0x4f4b('0x15')]));});});};exports[_0x4f4b('0x16')]=function(_0x6b6dcd){var _0x45ed1a=this;return new Promise(function(_0x3fbf8f,_0x8293f0){return db['CmHopper'][_0x4f4b('0x17')]({'raw':_0x6b6dcd[_0x4f4b('0x9')]?_0x6b6dcd[_0x4f4b('0x9')][_0x4f4b('0xa')]===undefined?!![]:![]:!![],'where':_0x6b6dcd[_0x4f4b('0x9')]?_0x6b6dcd['options'][_0x4f4b('0xb')]||null:null,'attributes':_0x6b6dcd[_0x4f4b('0x9')]?_0x6b6dcd[_0x4f4b('0x9')][_0x4f4b('0xc')]||null:null,'include':_0x6b6dcd[_0x4f4b('0x9')]?_0x6b6dcd[_0x4f4b('0x9')]['include']?_[_0x4f4b('0xe')](_0x6b6dcd[_0x4f4b('0x9')][_0x4f4b('0xd')],function(_0x293f5e){return{'model':db[_0x293f5e[_0x4f4b('0xf')]],'as':_0x293f5e['as'],'attributes':_0x293f5e[_0x4f4b('0xc')],'include':_0x293f5e[_0x4f4b('0xd')]?_['map'](_0x293f5e['include'],function(_0x2247a3){return{'model':db[_0x2247a3[_0x4f4b('0xf')]],'as':_0x2247a3['as'],'attributes':_0x2247a3[_0x4f4b('0xc')],'include':_0x2247a3[_0x4f4b('0xd')]?_[_0x4f4b('0xe')](_0x2247a3[_0x4f4b('0xd')],function(_0xd8416f){return{'model':db[_0xd8416f[_0x4f4b('0xf')]],'as':_0xd8416f['as'],'attributes':_0xd8416f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x23865a){logger[_0x4f4b('0x11')]('ShowCmHopper',_0x6b6dcd);logger[_0x4f4b('0x18')](_0x4f4b('0x16'),_0x6b6dcd,JSON[_0x4f4b('0x12')](_0x23865a));_0x3fbf8f(_0x23865a);})['catch'](function(_0x24b211){logger[_0x4f4b('0x14')](_0x4f4b('0x16'),_0x24b211['message'],_0x6b6dcd);_0x8293f0(_0x45ed1a[_0x4f4b('0x14')](0x1f4,_0x24b211[_0x4f4b('0x15')]));});});};exports[_0x4f4b('0x19')]=function(_0x1eff7a){var _0x2b2031=this;return new Promise(function(_0x4fefa6,_0x4072c4){return db['CmHopper'][_0x4f4b('0x1a')](_0x1eff7a['body'],{'raw':_0x1eff7a[_0x4f4b('0x9')]?_0x1eff7a['options'][_0x4f4b('0xa')]===undefined?!![]:![]:!![]})[_0x4f4b('0x10')](function(_0x35955a){logger[_0x4f4b('0x11')]('CreateCmHopper',_0x1eff7a);logger[_0x4f4b('0x18')](_0x4f4b('0x19'),_0x1eff7a,JSON[_0x4f4b('0x12')](_0x35955a));_0x4fefa6(_0x35955a);})['catch'](function(_0x19ca3f){logger['error'](_0x4f4b('0x19'),_0x19ca3f[_0x4f4b('0x15')],_0x1eff7a);_0x4072c4(_0x2b2031['error'](0x1f4,_0x19ca3f['message']));});});};exports[_0x4f4b('0x1b')]=function(_0x5e6448){var _0x1eacb0=this;return new Promise(function(_0x36d30e,_0x56d61c){return db['CmHopper'][_0x4f4b('0x1c')](_0x5e6448[_0x4f4b('0x1d')],{'raw':_0x5e6448['options']?_0x5e6448['options'][_0x4f4b('0xa')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e6448[_0x4f4b('0x9')]?_0x5e6448[_0x4f4b('0x9')][_0x4f4b('0xb')]||null:null,'attributes':_0x5e6448[_0x4f4b('0x9')]?_0x5e6448['options'][_0x4f4b('0xc')]||null:null,'limit':_0x5e6448[_0x4f4b('0x9')]?_0x5e6448[_0x4f4b('0x9')][_0x4f4b('0x1e')]||null:null})[_0x4f4b('0x10')](function(_0x8496c8){logger[_0x4f4b('0x11')](_0x4f4b('0x1b'),_0x5e6448);logger[_0x4f4b('0x11')](_0x4f4b('0x1f'),JSON['stringify'](_0x5e6448['options'][_0x4f4b('0xb')]),_0x5e6448['body'][_0x4f4b('0x20')]);logger[_0x4f4b('0x18')]('UpdateCmHopper',_0x5e6448,JSON[_0x4f4b('0x12')](_0x8496c8));_0x36d30e(_0x8496c8);})[_0x4f4b('0x13')](function(_0x47a2ab){logger[_0x4f4b('0x14')](_0x4f4b('0x1b'),_0x47a2ab[_0x4f4b('0x15')],_0x5e6448);_0x56d61c(_0x1eacb0['error'](0x1f4,_0x47a2ab['message']));});});};exports[_0x4f4b('0x21')]=function(_0x13a70c){var _0x29e180=this;return new Promise(function(_0x2c1a03,_0x2aff54){return db['CmHopper']['destroy']({'where':_0x13a70c[_0x4f4b('0x9')]?_0x13a70c[_0x4f4b('0x9')][_0x4f4b('0xb')]||null:null})[_0x4f4b('0x10')](function(_0x434f56){logger['info']('DestroyCmHopper',_0x13a70c);logger[_0x4f4b('0x18')](_0x4f4b('0x21'),_0x13a70c,JSON['stringify'](_0x434f56));_0x2c1a03(_0x434f56);})[_0x4f4b('0x13')](function(_0x510baa){logger['error'](_0x4f4b('0x21'),_0x510baa[_0x4f4b('0x15')],_0x13a70c);_0x2aff54(_0x29e180[_0x4f4b('0x14')](0x1f4,_0x510baa['message']));});});};exports[_0x4f4b('0x22')]=function(_0x311c83){var _0x4e144c=this;return new Promise(function(_0x5c85da,_0x8b7d83){return db[_0x4f4b('0x23')][_0x4f4b('0x24')]()[_0x4f4b('0x10')](function(_0x4b6c8b){return db['sequelize'][_0x4f4b('0x25')](function(_0x3b317e){return db[_0x4f4b('0x7')][_0x4f4b('0x8')]({'where':_0x311c83[_0x4f4b('0x9')]?_0x311c83[_0x4f4b('0x9')][_0x4f4b('0xb')]||null:null,'attributes':_0x311c83[_0x4f4b('0x9')]?_0x311c83['options'][_0x4f4b('0xc')]||null:null,'limit':_0x311c83['options']?_0x311c83[_0x4f4b('0x9')][_0x4f4b('0x1e')]||null:null,'order':_0x311c83['options']?_0x311c83[_0x4f4b('0x9')][_0x4f4b('0x26')]||null:null,'transaction':_0x3b317e,'lock':_0x3b317e[_0x4f4b('0x27')][_0x4f4b('0x28')],'include':[{'model':db['CmContact'],'as':_0x4f4b('0x29'),'attributes':_[_0x4f4b('0x2a')](_0x4b6c8b)},{'model':db['User'],'as':_0x4f4b('0x2b'),'attributes':['id','name','voicePause']}]})[_0x4f4b('0x10')](function(_0x373142){var _0x669dea=[];var _0x4acd32=[];for(var _0x470a06=0x0;_0x470a06<_0x373142['length'];_0x470a06+=0x1){var _0x4d898a=_0x373142[_0x470a06]['UserId'];if(_0x4d898a===null){_0x669dea[_0x4f4b('0x2c')](_0x373142[_0x470a06][_0x4f4b('0x1c')](_0x311c83['body'],{'transaction':_0x3b317e}));}else if(!_0x4acd32[_0x4f4b('0x2d')](_0x4d898a)){_0x4acd32[_0x4f4b('0x2c')](_0x4d898a);_0x669dea['push'](_0x373142[_0x470a06][_0x4f4b('0x1c')](_0x311c83[_0x4f4b('0x1d')],{'transaction':_0x3b317e}));}}return BPromise[_0x4f4b('0x2e')](_0x669dea);});})[_0x4f4b('0x10')](function(_0x5dd48c){logger[_0x4f4b('0x11')](_0x4f4b('0x22'),_0x311c83);if(_0x5dd48c[_0x4f4b('0x2f')]>0x0){logger[_0x4f4b('0x11')](_0x4f4b('0x30'),_0x5dd48c[0x0]['dataValues']['id'],_0x5dd48c[0x0][_0x4f4b('0x31')]['ContactId'],_0x5dd48c[0x0][_0x4f4b('0x31')][_0x4f4b('0x20')]);}logger[_0x4f4b('0x18')](_0x4f4b('0x22'),_0x311c83,JSON['stringify'](_0x5dd48c));_0x5c85da(_0x5dd48c);})[_0x4f4b('0x13')](function(_0x3e6883){logger[_0x4f4b('0x14')]('GetContactDialer',_0x3e6883['message'],_0x311c83);_0x8b7d83(_0x4e144c['error'](0x1f4,_0x3e6883[_0x4f4b('0x15')]));});});});};exports[_0x4f4b('0x32')]=function(_0x273de7){var _0x2b203f=this;return new Promise(function(_0x55ef5a,_0x3dd2f6){return db[_0x4f4b('0x33')][_0x4f4b('0x25')](function(_0x1677f4){return db[_0x4f4b('0x34')][_0x4f4b('0x1a')](_0x273de7[_0x4f4b('0x1d')],{'raw':_0x273de7[_0x4f4b('0x9')]?_0x273de7[_0x4f4b('0x9')][_0x4f4b('0xa')]===undefined?!![]:![]:!![],'transaction':_0x1677f4})[_0x4f4b('0x10')](function(){logger[_0x4f4b('0x11')](_0x4f4b('0x35'),JSON[_0x4f4b('0x12')](_0x273de7[_0x4f4b('0x9')][_0x4f4b('0xb')]),_0x273de7[_0x4f4b('0x9')]['where']['active']);return db[_0x4f4b('0x7')][_0x4f4b('0x36')]({'where':_0x273de7[_0x4f4b('0x9')]?_0x273de7[_0x4f4b('0x9')][_0x4f4b('0xb')]||null:null,'transaction':_0x1677f4});});})[_0x4f4b('0x10')](function(_0xbd29a6){logger[_0x4f4b('0x11')](_0x4f4b('0x32'),_0x273de7);logger['debug'](_0x4f4b('0x32'),_0x273de7,JSON[_0x4f4b('0x12')](_0xbd29a6));_0x55ef5a(_0xbd29a6);})[_0x4f4b('0x13')](function(_0x59fddc){logger['error'](_0x4f4b('0x32'),_0x59fddc['message'],_0x273de7);_0x3dd2f6(_0x2b203f[_0x4f4b('0x14')](0x1f4,_0x59fddc[_0x4f4b('0x15')]));});});};exports['CountReScheduled']=function(_0x34d610){var _0x155a44=this;return new Promise(function(_0x547001,_0x43c5ab){return db[_0x4f4b('0x7')][_0x4f4b('0x8')]({'raw':_0x34d610[_0x4f4b('0x9')]?_0x34d610[_0x4f4b('0x9')][_0x4f4b('0xa')]===undefined?!![]:![]:!![],'where':_0x34d610[_0x4f4b('0x9')]?_0x34d610[_0x4f4b('0x9')][_0x4f4b('0xb')]||null:null,'attributes':[[db[_0x4f4b('0x33')]['fn'](_0x4f4b('0x37'),db[_0x4f4b('0x33')]['fn']('IF',db[_0x4f4b('0x33')][_0x4f4b('0x38')](_0x4f4b('0x39')+util[_0x4f4b('0x3a')]('\x22%s\x22',moment()[_0x4f4b('0x3a')](_0x4f4b('0x3b')))+'\x20,\x201,\x20null'))),_0x4f4b('0x3c')]]})[_0x4f4b('0x10')](function(_0x44694b){logger['info'](_0x4f4b('0x3d'),_0x34d610);logger[_0x4f4b('0x18')](_0x4f4b('0x3d'),_0x34d610,JSON[_0x4f4b('0x12')](_0x44694b));_0x547001(_0x44694b);})['catch'](function(_0x35e762){logger[_0x4f4b('0x14')](_0x4f4b('0x3d'),_0x35e762[_0x4f4b('0x15')],_0x34d610);_0x43c5ab(_0x155a44[_0x4f4b('0x14')](0x1f4,_0x35e762[_0x4f4b('0x15')]));});});};exports[_0x4f4b('0x3e')]=function(_0x122789){var _0x391fbe=this;return new Promise(function(_0x24709f,_0x136584){return db[_0x4f4b('0x23')][_0x4f4b('0x24')]()[_0x4f4b('0x10')](function(){return db['sequelize'][_0x4f4b('0x25')](function(_0x3755da){return db[_0x4f4b('0x7')][_0x4f4b('0x8')]({'where':_0x122789[_0x4f4b('0x9')]?_0x122789[_0x4f4b('0x9')][_0x4f4b('0xb')]||null:null,'attributes':_0x122789['options']?_0x122789[_0x4f4b('0x9')][_0x4f4b('0xc')]||null:null,'limit':0x1,'order':_0x122789[_0x4f4b('0x9')]?_0x122789[_0x4f4b('0x9')][_0x4f4b('0x26')]||null:null,'group':db[_0x4f4b('0x7')][_0x4f4b('0x3f')],'transaction':_0x3755da,'lock':_0x3755da['LOCK'][_0x4f4b('0x28')],'include':_0x122789[_0x4f4b('0x9')]?_0x122789[_0x4f4b('0x9')][_0x4f4b('0xd')]?_[_0x4f4b('0xe')](_0x122789[_0x4f4b('0x9')][_0x4f4b('0xd')],function(_0x5b3c35){return{'model':db[_0x5b3c35[_0x4f4b('0xf')]],'as':_0x5b3c35['as'],'attributes':_0x5b3c35[_0x4f4b('0xc')],'include':_0x5b3c35[_0x4f4b('0xd')]?_[_0x4f4b('0xe')](_0x5b3c35[_0x4f4b('0xd')],function(_0x5b2389){return{'model':db[_0x5b2389[_0x4f4b('0xf')]],'as':_0x5b2389['as'],'attributes':_0x5b2389[_0x4f4b('0xc')],'include':_0x5b2389[_0x4f4b('0xd')]?_[_0x4f4b('0xe')](_0x5b2389[_0x4f4b('0xd')],function(_0x3c84b7){return{'model':db[_0x3c84b7[_0x4f4b('0xf')]],'as':_0x3c84b7['as'],'attributes':_0x3c84b7['attributes']};}):[]};}):[]};}):[]:[]})[_0x4f4b('0x10')](function(_0x471776){var _0x17baf0=[];for(var _0x102879=0x0;_0x102879<_0x471776[_0x4f4b('0x2f')];_0x102879+=0x1){_0x17baf0[_0x4f4b('0x2c')](_0x471776[_0x102879]['update'](_0x122789[_0x4f4b('0x1d')],{'transaction':_0x3755da}));}return BPromise['all'](_0x17baf0);});})['then'](function(_0x102feb){logger[_0x4f4b('0x11')]('GetContactRecallMe',_0x122789);logger['debug'](_0x4f4b('0x3e'),_0x122789,JSON[_0x4f4b('0x12')](_0x102feb));_0x24709f(_0x102feb);})[_0x4f4b('0x13')](function(_0x2a4b69){logger['error'](_0x4f4b('0x3e'),_0x2a4b69['message'],_0x122789);_0x136584(_0x391fbe['error'](0x1f4,_0x2a4b69['message']));});});});};exports[_0x4f4b('0x40')]=function(_0x316787){var _0x37e3e6=this;return new Promise(function(_0x2bb8e6,_0x3ba547){db[_0x4f4b('0x23')]['describe']()[_0x4f4b('0x10')](function(_0x12404e){return db[_0x4f4b('0x7')]['findAll']({'raw':_0x316787['options']?_0x316787[_0x4f4b('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x316787[_0x4f4b('0x9')]?_0x316787['options'][_0x4f4b('0xb')]||null:null,'attributes':_0x316787['options']?_0x316787[_0x4f4b('0x9')][_0x4f4b('0xc')]||null:null,'limit':_0x316787[_0x4f4b('0x9')]?_0x316787[_0x4f4b('0x9')][_0x4f4b('0x1e')]||null:null,'include':_0x316787['options']?_0x316787['options'][_0x4f4b('0xd')]?_['map'](_0x316787[_0x4f4b('0x9')][_0x4f4b('0xd')],function(_0x2526d8){return{'model':db[_0x2526d8[_0x4f4b('0xf')]],'as':_0x2526d8['as'],'attributes':_0x2526d8['as']===_0x4f4b('0x29')?_['keys'](_0x12404e):_0x2526d8[_0x4f4b('0xc')],'include':_0x2526d8['include']?_[_0x4f4b('0xe')](_0x2526d8['include'],function(_0xeca1c2){return{'model':db[_0xeca1c2[_0x4f4b('0xf')]],'as':_0xeca1c2['as'],'attributes':_0xeca1c2[_0x4f4b('0xc')],'include':_0xeca1c2[_0x4f4b('0xd')]?_[_0x4f4b('0xe')](_0xeca1c2[_0x4f4b('0xd')],function(_0x3cfd66){return{'model':db[_0x3cfd66[_0x4f4b('0xf')]],'as':_0x3cfd66['as'],'attributes':_0x3cfd66[_0x4f4b('0xc')]};}):[]};}):[]};}):[]:[]})[_0x4f4b('0x10')](function(_0x3d36c1){logger[_0x4f4b('0x11')](_0x4f4b('0x6'),_0x316787);logger[_0x4f4b('0x18')](_0x4f4b('0x6'),_0x316787,JSON[_0x4f4b('0x12')](_0x3d36c1));_0x2bb8e6(_0x3d36c1);})[_0x4f4b('0x13')](function(_0xdd56ce){logger[_0x4f4b('0x14')](_0x4f4b('0x6'),_0xdd56ce[_0x4f4b('0x15')],_0x316787);_0x3ba547(_0x37e3e6[_0x4f4b('0x14')](0x1f4,_0xdd56ce[_0x4f4b('0x15')]));});});});};exports[_0x4f4b('0x41')]=function(_0x2be889){var _0x1c6908=this;return new Promise(function(_0x3560be,_0x45d71c){return db[_0x4f4b('0x23')][_0x4f4b('0x42')]({'raw':!![],'where':{'phone':_0x2be889[_0x4f4b('0x9')]['where'][_0x4f4b('0x43')]},'attributes':['id',_0x4f4b('0x44')],'order':[['id',_0x4f4b('0x45')]]})[_0x4f4b('0x10')](function(_0xfeea38){logger[_0x4f4b('0x11')](_0x4f4b('0x46'),_0x2be889);logger[_0x4f4b('0x18')](_0x4f4b('0x46'),_0x2be889,JSON[_0x4f4b('0x12')](_0xfeea38));_0x3560be(_0xfeea38);})[_0x4f4b('0x13')](function(_0x35a2f2){logger[_0x4f4b('0x14')](_0x4f4b('0x46'),_0x35a2f2[_0x4f4b('0x15')],_0x2be889);_0x45d71c(_0x1c6908[_0x4f4b('0x14')](0x1f4,_0x35a2f2[_0x4f4b('0x15')]));});});};exports[_0x4f4b('0x47')]=function(_0x767f41){var _0x33875f=this;return new Promise(function(_0x1e48ba,_0x1b7c7d){return db[_0x4f4b('0x33')][_0x4f4b('0x25')](function(_0x12652b){var _0x3d83b8=_0x767f41['options']&&_0x767f41[_0x4f4b('0x9')][_0x4f4b('0xb')]?_0x767f41[_0x4f4b('0x9')][_0x4f4b('0xb')]:{};return db[_0x4f4b('0x7')]['update'](_0x767f41[_0x4f4b('0x1d')],{'where':_0x3d83b8,'transaction':_0x12652b})['then'](function(_0xf74542){logger[_0x4f4b('0x11')]('ResetActiveCalls',_0x767f41);logger[_0x4f4b('0x18')](_0x4f4b('0x47'),_0x767f41,JSON[_0x4f4b('0x12')](_0xf74542));_0x1e48ba(_0xf74542);})[_0x4f4b('0x13')](function(_0x3bb51b){logger['error'](_0x4f4b('0x47'),_0x3bb51b[_0x4f4b('0x15')],_0x767f41);_0x1b7c7d(_0x33875f[_0x4f4b('0x14')](0x1f4,_0x3bb51b[_0x4f4b('0x15')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x2a6295){var _0x44ed9e=this;var _0x58638c=_0x2a6295[_0x4f4b('0x1d')][_0x4f4b('0xb')]['voiceQueueIds'];var _0x261987=_0x2a6295['body']['where'][_0x4f4b('0x48')];var _0x1dc463=_0x2a6295['body'][_0x4f4b('0xb')][_0x4f4b('0x49')];return new Promise(function(_0x1ba94a,_0x45daa9){return db[_0x4f4b('0x7')]['findAll']({'where':{'voiceQueueId':{'$in':_0x58638c},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x4f4b('0x33')][_0x4f4b('0x38')](_0x4f4b('0x4a')+_0x261987+_0x4f4b('0x4b')),'$gt':db['sequelize'][_0x4f4b('0x38')](_0x4f4b('0x4c'))}},'UserId':{'$in':_0x1dc463}},'include':[{'model':db['CmContact'],'as':_0x4f4b('0x29')},{'model':db['User'],'as':_0x4f4b('0x2b'),'attributes':['id',_0x4f4b('0x4d'),_0x4f4b('0x4e')]},{'model':db[_0x4f4b('0x4f')],'as':_0x4f4b('0x50')}]})['then'](function(_0x1c1e6b){if(_0x1c1e6b[_0x4f4b('0x2f')]>0x0){return db['sequelize']['transaction'](function(_0x439fa0){return db['CmHopper']['update']({'recallmeNotifiedDate':db[_0x4f4b('0x33')][_0x4f4b('0x38')](_0x4f4b('0x4c'))},{'where':{'id':{'$in':_[_0x4f4b('0xe')](_0x1c1e6b,'id')}},'transaction':_0x439fa0})[_0x4f4b('0x10')](function(){_0x1ba94a(_0x1c1e6b);})[_0x4f4b('0x13')](function(_0x2c1775){logger[_0x4f4b('0x14')](_0x4f4b('0x51'),_0x2c1775[_0x4f4b('0x15')],_0x2a6295);_0x45daa9(_0x44ed9e[_0x4f4b('0x14')](0x1f4,_0x2c1775[_0x4f4b('0x15')]));});})[_0x4f4b('0x13')](function(_0x440804){logger[_0x4f4b('0x14')](_0x4f4b('0x51'),_0x440804[_0x4f4b('0x15')],_0x2a6295);_0x45daa9(_0x44ed9e['error'](0x1f4,_0x440804[_0x4f4b('0x15')]));});}else{_0x1ba94a(_0x1c1e6b);}});});}; \ No newline at end of file +var _0x6bd7=['push','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','CmHopperFinal','create','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','destroy','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','\x20,\x201,\x20null','GetContactRecallMe','findAll','UPDATE','all','GetCmHopperPreview','GetContactByPhone','findOne','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','interval','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','Agent','name','CmList','CmHopperHandlePreviewRecallNotifications','lodash','util','bluebird','../../config/logger','rpc','GetCmHopper','options','where','attributes','limit','include','map','model','then','info','debug','catch','message','ShowCmHopper','CmHopper','find','raw','stringify','error','CreateCmHopper','body','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','Contact','keys','User','voicePause','length','update','includes'];(function(_0x32bc56,_0x10faf7){var _0x1fda71=function(_0x21a9ec){while(--_0x21a9ec){_0x32bc56['push'](_0x32bc56['shift']());}};_0x1fda71(++_0x10faf7);}(_0x6bd7,0x71));var _0x76bd=function(_0x46b832,_0x454e18){_0x46b832=_0x46b832-0x0;var _0x42b328=_0x6bd7[_0x46b832];return _0x42b328;};'use strict';var _=require(_0x76bd('0x0'));var util=require(_0x76bd('0x1'));var moment=require('moment');var BPromise=require(_0x76bd('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x76bd('0x3'))(_0x76bd('0x4'));exports[_0x76bd('0x5')]=function(_0x1fafb0){var _0x1c1751=this;return new Promise(function(_0x5dd0e9,_0x262e56){return db['CmHopper']['findAll']({'raw':_0x1fafb0['options']?_0x1fafb0['options']['raw']===undefined?!![]:![]:!![],'where':_0x1fafb0[_0x76bd('0x6')]?_0x1fafb0[_0x76bd('0x6')][_0x76bd('0x7')]||null:null,'attributes':_0x1fafb0[_0x76bd('0x6')]?_0x1fafb0[_0x76bd('0x6')][_0x76bd('0x8')]||null:null,'limit':_0x1fafb0[_0x76bd('0x6')]?_0x1fafb0[_0x76bd('0x6')][_0x76bd('0x9')]||null:null,'include':_0x1fafb0[_0x76bd('0x6')]?_0x1fafb0['options'][_0x76bd('0xa')]?_[_0x76bd('0xb')](_0x1fafb0[_0x76bd('0x6')][_0x76bd('0xa')],function(_0x50a773){return{'model':db[_0x50a773[_0x76bd('0xc')]],'as':_0x50a773['as'],'attributes':_0x50a773[_0x76bd('0x8')],'include':_0x50a773[_0x76bd('0xa')]?_[_0x76bd('0xb')](_0x50a773[_0x76bd('0xa')],function(_0x9353da){return{'model':db[_0x9353da[_0x76bd('0xc')]],'as':_0x9353da['as'],'attributes':_0x9353da['attributes'],'include':_0x9353da[_0x76bd('0xa')]?_[_0x76bd('0xb')](_0x9353da[_0x76bd('0xa')],function(_0xee9a1b){return{'model':db[_0xee9a1b[_0x76bd('0xc')]],'as':_0xee9a1b['as'],'attributes':_0xee9a1b['attributes']};}):[]};}):[]};}):[]:[]})[_0x76bd('0xd')](function(_0x32091c){logger[_0x76bd('0xe')]('GetCmHopper',_0x1fafb0);logger[_0x76bd('0xf')]('GetCmHopper',_0x1fafb0,JSON['stringify'](_0x32091c));_0x5dd0e9(_0x32091c);})[_0x76bd('0x10')](function(_0x29b89c){logger['error'](_0x76bd('0x5'),_0x29b89c['message'],_0x1fafb0);_0x262e56(_0x1c1751['error'](0x1f4,_0x29b89c[_0x76bd('0x11')]));});});};exports[_0x76bd('0x12')]=function(_0x2881ab){var _0x17a7c5=this;return new Promise(function(_0x1e6092,_0x1e95c2){return db[_0x76bd('0x13')][_0x76bd('0x14')]({'raw':_0x2881ab[_0x76bd('0x6')]?_0x2881ab[_0x76bd('0x6')][_0x76bd('0x15')]===undefined?!![]:![]:!![],'where':_0x2881ab['options']?_0x2881ab[_0x76bd('0x6')][_0x76bd('0x7')]||null:null,'attributes':_0x2881ab[_0x76bd('0x6')]?_0x2881ab[_0x76bd('0x6')]['attributes']||null:null,'include':_0x2881ab[_0x76bd('0x6')]?_0x2881ab['options'][_0x76bd('0xa')]?_[_0x76bd('0xb')](_0x2881ab['options'][_0x76bd('0xa')],function(_0x49c0df){return{'model':db[_0x49c0df[_0x76bd('0xc')]],'as':_0x49c0df['as'],'attributes':_0x49c0df['attributes'],'include':_0x49c0df[_0x76bd('0xa')]?_['map'](_0x49c0df['include'],function(_0x43e58d){return{'model':db[_0x43e58d[_0x76bd('0xc')]],'as':_0x43e58d['as'],'attributes':_0x43e58d[_0x76bd('0x8')],'include':_0x43e58d['include']?_[_0x76bd('0xb')](_0x43e58d[_0x76bd('0xa')],function(_0x13b619){return{'model':db[_0x13b619[_0x76bd('0xc')]],'as':_0x13b619['as'],'attributes':_0x13b619[_0x76bd('0x8')]};}):[]};}):[]};}):[]:[]})[_0x76bd('0xd')](function(_0x138a9e){logger[_0x76bd('0xe')](_0x76bd('0x12'),_0x2881ab);logger[_0x76bd('0xf')](_0x76bd('0x12'),_0x2881ab,JSON[_0x76bd('0x16')](_0x138a9e));_0x1e6092(_0x138a9e);})[_0x76bd('0x10')](function(_0x5f594f){logger[_0x76bd('0x17')](_0x76bd('0x12'),_0x5f594f[_0x76bd('0x11')],_0x2881ab);_0x1e95c2(_0x17a7c5[_0x76bd('0x17')](0x1f4,_0x5f594f[_0x76bd('0x11')]));});});};exports[_0x76bd('0x18')]=function(_0x432947){var _0x260b0d=this;return new Promise(function(_0x1b774d,_0x5ce0d3){return db['CmHopper']['create'](_0x432947[_0x76bd('0x19')],{'raw':_0x432947[_0x76bd('0x6')]?_0x432947['options']['raw']===undefined?!![]:![]:!![]})[_0x76bd('0xd')](function(_0x523452){logger[_0x76bd('0xe')](_0x76bd('0x18'),_0x432947);logger[_0x76bd('0xf')](_0x76bd('0x18'),_0x432947,JSON[_0x76bd('0x16')](_0x523452));_0x1b774d(_0x523452);})[_0x76bd('0x10')](function(_0x4a3f47){logger[_0x76bd('0x17')]('CreateCmHopper',_0x4a3f47['message'],_0x432947);_0x5ce0d3(_0x260b0d[_0x76bd('0x17')](0x1f4,_0x4a3f47[_0x76bd('0x11')]));});});};exports['UpdateCmHopper']=function(_0x3c9538){var _0x556ba4=this;return new Promise(function(_0x223d5f,_0x4280c7){return db[_0x76bd('0x13')]['update'](_0x3c9538[_0x76bd('0x19')],{'raw':_0x3c9538[_0x76bd('0x6')]?_0x3c9538[_0x76bd('0x6')][_0x76bd('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c9538['options']?_0x3c9538[_0x76bd('0x6')][_0x76bd('0x7')]||null:null,'attributes':_0x3c9538[_0x76bd('0x6')]?_0x3c9538[_0x76bd('0x6')][_0x76bd('0x8')]||null:null,'limit':_0x3c9538['options']?_0x3c9538[_0x76bd('0x6')]['limit']||null:null})[_0x76bd('0xd')](function(_0x3543f0){logger[_0x76bd('0xe')](_0x76bd('0x1a'),_0x3c9538);logger[_0x76bd('0xe')](_0x76bd('0x1b'),JSON[_0x76bd('0x16')](_0x3c9538[_0x76bd('0x6')][_0x76bd('0x7')]),_0x3c9538[_0x76bd('0x19')]['active']);logger[_0x76bd('0xf')]('UpdateCmHopper',_0x3c9538,JSON[_0x76bd('0x16')](_0x3543f0));_0x223d5f(_0x3543f0);})['catch'](function(_0xf88b63){logger['error'](_0x76bd('0x1a'),_0xf88b63['message'],_0x3c9538);_0x4280c7(_0x556ba4[_0x76bd('0x17')](0x1f4,_0xf88b63[_0x76bd('0x11')]));});});};exports['DestroyCmHopper']=function(_0x2ce38b){var _0x2296fc=this;return new Promise(function(_0x10bc1c,_0x59e2a4){return db[_0x76bd('0x13')]['destroy']({'where':_0x2ce38b[_0x76bd('0x6')]?_0x2ce38b['options']['where']||null:null})[_0x76bd('0xd')](function(_0x3aa469){logger[_0x76bd('0xe')](_0x76bd('0x1c'),_0x2ce38b);logger[_0x76bd('0xf')](_0x76bd('0x1c'),_0x2ce38b,JSON['stringify'](_0x3aa469));_0x10bc1c(_0x3aa469);})['catch'](function(_0x3460ef){logger[_0x76bd('0x17')](_0x76bd('0x1c'),_0x3460ef[_0x76bd('0x11')],_0x2ce38b);_0x59e2a4(_0x2296fc[_0x76bd('0x17')](0x1f4,_0x3460ef[_0x76bd('0x11')]));});});};exports[_0x76bd('0x1d')]=function(_0x4d496f){var _0x4d7c2c=this;return new Promise(function(_0x502d11,_0x4b4a80){return db[_0x76bd('0x1e')][_0x76bd('0x1f')]()[_0x76bd('0xd')](function(_0x24b97d){return db[_0x76bd('0x20')][_0x76bd('0x21')](function(_0x2edf64){return db[_0x76bd('0x13')]['findAll']({'where':_0x4d496f[_0x76bd('0x6')]?_0x4d496f[_0x76bd('0x6')][_0x76bd('0x7')]||null:null,'attributes':_0x4d496f[_0x76bd('0x6')]?_0x4d496f['options'][_0x76bd('0x8')]||null:null,'limit':_0x4d496f[_0x76bd('0x6')]?_0x4d496f[_0x76bd('0x6')][_0x76bd('0x9')]||null:null,'order':_0x4d496f[_0x76bd('0x6')]?_0x4d496f[_0x76bd('0x6')][_0x76bd('0x22')]||null:null,'transaction':_0x2edf64,'lock':_0x2edf64[_0x76bd('0x23')]['UPDATE'],'include':[{'model':db[_0x76bd('0x1e')],'as':_0x76bd('0x24'),'attributes':_[_0x76bd('0x25')](_0x24b97d)},{'model':db[_0x76bd('0x26')],'as':'Agent','attributes':['id','name',_0x76bd('0x27')]}]})['then'](function(_0x2fc5ba){var _0x463019=[];var _0x176a4b=[];for(var _0xd3e383=0x0;_0xd3e383<_0x2fc5ba[_0x76bd('0x28')];_0xd3e383+=0x1){var _0x1ff4f2=_0x2fc5ba[_0xd3e383]['UserId'];if(_0x1ff4f2===null){_0x463019['push'](_0x2fc5ba[_0xd3e383][_0x76bd('0x29')](_0x4d496f[_0x76bd('0x19')],{'transaction':_0x2edf64}));}else if(!_0x176a4b[_0x76bd('0x2a')](_0x1ff4f2)){_0x176a4b[_0x76bd('0x2b')](_0x1ff4f2);_0x463019[_0x76bd('0x2b')](_0x2fc5ba[_0xd3e383][_0x76bd('0x29')](_0x4d496f[_0x76bd('0x19')],{'transaction':_0x2edf64}));}}return BPromise['all'](_0x463019);});})[_0x76bd('0xd')](function(_0x235684){logger[_0x76bd('0xe')](_0x76bd('0x1d'),_0x4d496f);if(_0x235684[_0x76bd('0x28')]>0x0){logger['info'](_0x76bd('0x2c'),_0x235684[0x0]['dataValues']['id'],_0x235684[0x0][_0x76bd('0x2d')][_0x76bd('0x2e')],_0x235684[0x0][_0x76bd('0x2d')]['active']);}logger[_0x76bd('0xf')](_0x76bd('0x1d'),_0x4d496f,JSON['stringify'](_0x235684));_0x502d11(_0x235684);})[_0x76bd('0x10')](function(_0x4ed770){logger[_0x76bd('0x17')](_0x76bd('0x1d'),_0x4ed770[_0x76bd('0x11')],_0x4d496f);_0x4b4a80(_0x4d7c2c[_0x76bd('0x17')](0x1f4,_0x4ed770['message']));});});});};exports['MoveContactManagedDialer']=function(_0x2cf83c){var _0x5dfb06=this;return new Promise(function(_0x2e7b7c,_0x35cc71){return db[_0x76bd('0x20')][_0x76bd('0x21')](function(_0x1b66dd){return db[_0x76bd('0x2f')][_0x76bd('0x30')](_0x2cf83c[_0x76bd('0x19')],{'raw':_0x2cf83c[_0x76bd('0x6')]?_0x2cf83c['options'][_0x76bd('0x15')]===undefined?!![]:![]:!![],'transaction':_0x1b66dd})[_0x76bd('0xd')](function(){logger[_0x76bd('0xe')](_0x76bd('0x31'),JSON[_0x76bd('0x16')](_0x2cf83c[_0x76bd('0x6')][_0x76bd('0x7')]),_0x2cf83c[_0x76bd('0x6')]['where'][_0x76bd('0x32')]);return db[_0x76bd('0x13')][_0x76bd('0x33')]({'where':_0x2cf83c[_0x76bd('0x6')]?_0x2cf83c[_0x76bd('0x6')]['where']||null:null,'transaction':_0x1b66dd});});})[_0x76bd('0xd')](function(_0x20db02){logger[_0x76bd('0xe')](_0x76bd('0x34'),_0x2cf83c);logger[_0x76bd('0xf')](_0x76bd('0x34'),_0x2cf83c,JSON[_0x76bd('0x16')](_0x20db02));_0x2e7b7c(_0x20db02);})[_0x76bd('0x10')](function(_0x3c6620){logger['error']('MoveContactManagedDialer',_0x3c6620[_0x76bd('0x11')],_0x2cf83c);_0x35cc71(_0x5dfb06[_0x76bd('0x17')](0x1f4,_0x3c6620[_0x76bd('0x11')]));});});};exports[_0x76bd('0x35')]=function(_0x36c3d9){var _0x5b954a=this;return new Promise(function(_0x1e2776,_0x14d38e){return db['CmHopper']['findAll']({'raw':_0x36c3d9['options']?_0x36c3d9[_0x76bd('0x6')][_0x76bd('0x15')]===undefined?!![]:![]:!![],'where':_0x36c3d9['options']?_0x36c3d9[_0x76bd('0x6')][_0x76bd('0x7')]||null:null,'attributes':[[db['sequelize']['fn'](_0x76bd('0x36'),db[_0x76bd('0x20')]['fn']('IF',db[_0x76bd('0x20')][_0x76bd('0x37')](_0x76bd('0x38')+util['format'](_0x76bd('0x39'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'))+_0x76bd('0x3a')))),'contactsRescheduled']]})[_0x76bd('0xd')](function(_0x16c5d2){logger[_0x76bd('0xe')](_0x76bd('0x35'),_0x36c3d9);logger['debug'](_0x76bd('0x35'),_0x36c3d9,JSON[_0x76bd('0x16')](_0x16c5d2));_0x1e2776(_0x16c5d2);})[_0x76bd('0x10')](function(_0x27582f){logger[_0x76bd('0x17')](_0x76bd('0x35'),_0x27582f[_0x76bd('0x11')],_0x36c3d9);_0x14d38e(_0x5b954a[_0x76bd('0x17')](0x1f4,_0x27582f[_0x76bd('0x11')]));});});};exports[_0x76bd('0x3b')]=function(_0x28cf48){var _0x21b8fd=this;return new Promise(function(_0xec0bf2,_0x5cd0b0){return db[_0x76bd('0x1e')][_0x76bd('0x1f')]()[_0x76bd('0xd')](function(){return db[_0x76bd('0x20')][_0x76bd('0x21')](function(_0x5cf2d6){return db['CmHopper'][_0x76bd('0x3c')]({'where':_0x28cf48[_0x76bd('0x6')]?_0x28cf48[_0x76bd('0x6')][_0x76bd('0x7')]||null:null,'attributes':_0x28cf48[_0x76bd('0x6')]?_0x28cf48[_0x76bd('0x6')]['attributes']||null:null,'limit':0x1,'order':_0x28cf48[_0x76bd('0x6')]?_0x28cf48[_0x76bd('0x6')][_0x76bd('0x22')]||null:null,'group':db[_0x76bd('0x13')]['UserId'],'transaction':_0x5cf2d6,'lock':_0x5cf2d6[_0x76bd('0x23')][_0x76bd('0x3d')],'include':_0x28cf48[_0x76bd('0x6')]?_0x28cf48[_0x76bd('0x6')][_0x76bd('0xa')]?_[_0x76bd('0xb')](_0x28cf48[_0x76bd('0x6')][_0x76bd('0xa')],function(_0x34a37d){return{'model':db[_0x34a37d['model']],'as':_0x34a37d['as'],'attributes':_0x34a37d[_0x76bd('0x8')],'include':_0x34a37d[_0x76bd('0xa')]?_['map'](_0x34a37d['include'],function(_0x116102){return{'model':db[_0x116102['model']],'as':_0x116102['as'],'attributes':_0x116102['attributes'],'include':_0x116102[_0x76bd('0xa')]?_[_0x76bd('0xb')](_0x116102[_0x76bd('0xa')],function(_0x4fa1cf){return{'model':db[_0x4fa1cf[_0x76bd('0xc')]],'as':_0x4fa1cf['as'],'attributes':_0x4fa1cf[_0x76bd('0x8')]};}):[]};}):[]};}):[]:[]})[_0x76bd('0xd')](function(_0x568a8b){var _0xff70cb=[];for(var _0x4dee8e=0x0;_0x4dee8e<_0x568a8b[_0x76bd('0x28')];_0x4dee8e+=0x1){_0xff70cb[_0x76bd('0x2b')](_0x568a8b[_0x4dee8e]['update'](_0x28cf48[_0x76bd('0x19')],{'transaction':_0x5cf2d6}));}return BPromise[_0x76bd('0x3e')](_0xff70cb);});})[_0x76bd('0xd')](function(_0x270b61){logger[_0x76bd('0xe')](_0x76bd('0x3b'),_0x28cf48);logger[_0x76bd('0xf')](_0x76bd('0x3b'),_0x28cf48,JSON['stringify'](_0x270b61));_0xec0bf2(_0x270b61);})['catch'](function(_0x103dea){logger[_0x76bd('0x17')](_0x76bd('0x3b'),_0x103dea[_0x76bd('0x11')],_0x28cf48);_0x5cd0b0(_0x21b8fd[_0x76bd('0x17')](0x1f4,_0x103dea['message']));});});});};exports[_0x76bd('0x3f')]=function(_0x2f0068){var _0x1d8e46=this;return new Promise(function(_0x44913e,_0xd485ba){db[_0x76bd('0x1e')][_0x76bd('0x1f')]()[_0x76bd('0xd')](function(_0x51c9b8){return db['CmHopper'][_0x76bd('0x3c')]({'raw':_0x2f0068[_0x76bd('0x6')]?_0x2f0068[_0x76bd('0x6')][_0x76bd('0x15')]===undefined?!![]:![]:!![],'where':_0x2f0068[_0x76bd('0x6')]?_0x2f0068['options']['where']||null:null,'attributes':_0x2f0068[_0x76bd('0x6')]?_0x2f0068[_0x76bd('0x6')][_0x76bd('0x8')]||null:null,'limit':_0x2f0068[_0x76bd('0x6')]?_0x2f0068[_0x76bd('0x6')][_0x76bd('0x9')]||null:null,'include':_0x2f0068['options']?_0x2f0068[_0x76bd('0x6')][_0x76bd('0xa')]?_['map'](_0x2f0068[_0x76bd('0x6')]['include'],function(_0x2ae70e){return{'model':db[_0x2ae70e[_0x76bd('0xc')]],'as':_0x2ae70e['as'],'attributes':_0x2ae70e['as']==='Contact'?_['keys'](_0x51c9b8):_0x2ae70e[_0x76bd('0x8')],'include':_0x2ae70e[_0x76bd('0xa')]?_[_0x76bd('0xb')](_0x2ae70e[_0x76bd('0xa')],function(_0x1f229c){return{'model':db[_0x1f229c[_0x76bd('0xc')]],'as':_0x1f229c['as'],'attributes':_0x1f229c[_0x76bd('0x8')],'include':_0x1f229c['include']?_[_0x76bd('0xb')](_0x1f229c['include'],function(_0x536d75){return{'model':db[_0x536d75[_0x76bd('0xc')]],'as':_0x536d75['as'],'attributes':_0x536d75[_0x76bd('0x8')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3dc9e8){logger['info']('GetCmHopper',_0x2f0068);logger['debug']('GetCmHopper',_0x2f0068,JSON[_0x76bd('0x16')](_0x3dc9e8));_0x44913e(_0x3dc9e8);})[_0x76bd('0x10')](function(_0x305af9){logger[_0x76bd('0x17')](_0x76bd('0x5'),_0x305af9['message'],_0x2f0068);_0xd485ba(_0x1d8e46['error'](0x1f4,_0x305af9['message']));});});});};exports[_0x76bd('0x40')]=function(_0x1f8eb9){var _0x69fe33=this;return new Promise(function(_0x1adca4,_0x835410){return db[_0x76bd('0x1e')][_0x76bd('0x41')]({'raw':!![],'where':{'phone':_0x1f8eb9[_0x76bd('0x6')][_0x76bd('0x7')]['phone']},'attributes':['id',_0x76bd('0x42')],'order':[['id',_0x76bd('0x43')]]})[_0x76bd('0xd')](function(_0x186bb4){logger['info'](_0x76bd('0x44'),_0x1f8eb9);logger[_0x76bd('0xf')](_0x76bd('0x44'),_0x1f8eb9,JSON['stringify'](_0x186bb4));_0x1adca4(_0x186bb4);})[_0x76bd('0x10')](function(_0x71ef19){logger[_0x76bd('0x17')](_0x76bd('0x44'),_0x71ef19[_0x76bd('0x11')],_0x1f8eb9);_0x835410(_0x69fe33['error'](0x1f4,_0x71ef19[_0x76bd('0x11')]));});});};exports[_0x76bd('0x45')]=function(_0x297f03){var _0x2d7fd4=this;return new Promise(function(_0x1258be,_0x141712){return db[_0x76bd('0x20')]['transaction'](function(_0x267ff3){var _0x4a15f9=_0x297f03[_0x76bd('0x6')]&&_0x297f03[_0x76bd('0x6')][_0x76bd('0x7')]?_0x297f03[_0x76bd('0x6')][_0x76bd('0x7')]:{};return db[_0x76bd('0x13')][_0x76bd('0x29')](_0x297f03['body'],{'where':_0x4a15f9,'transaction':_0x267ff3})[_0x76bd('0xd')](function(_0x11c949){logger[_0x76bd('0xe')](_0x76bd('0x45'),_0x297f03);logger[_0x76bd('0xf')](_0x76bd('0x45'),_0x297f03,JSON[_0x76bd('0x16')](_0x11c949));_0x1258be(_0x11c949);})[_0x76bd('0x10')](function(_0x8ad67c){logger[_0x76bd('0x17')](_0x76bd('0x45'),_0x8ad67c[_0x76bd('0x11')],_0x297f03);_0x141712(_0x2d7fd4[_0x76bd('0x17')](0x1f4,_0x8ad67c[_0x76bd('0x11')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x368ea3){var _0x1db16f=this;var _0x3559c4=_0x368ea3[_0x76bd('0x19')][_0x76bd('0x7')]['voiceQueueIds'];var _0x5a999c=_0x368ea3[_0x76bd('0x19')][_0x76bd('0x7')][_0x76bd('0x46')];var _0x5af4c6=_0x368ea3[_0x76bd('0x19')][_0x76bd('0x7')]['availableAgentsIds'];return new Promise(function(_0x4a0beb,_0x5cf1af){return db[_0x76bd('0x13')][_0x76bd('0x3c')]({'where':{'voiceQueueId':{'$in':_0x3559c4},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x76bd('0x20')][_0x76bd('0x37')](_0x76bd('0x47')+_0x5a999c+_0x76bd('0x48')),'$gt':db['sequelize'][_0x76bd('0x37')](_0x76bd('0x49'))}},'UserId':{'$in':_0x5af4c6}},'include':[{'model':db[_0x76bd('0x1e')],'as':_0x76bd('0x24')},{'model':db['User'],'as':_0x76bd('0x4a'),'attributes':['id',_0x76bd('0x4b'),_0x76bd('0x27')]},{'model':db[_0x76bd('0x4c')],'as':'List'}]})[_0x76bd('0xd')](function(_0x2a7f67){if(_0x2a7f67[_0x76bd('0x28')]>0x0){return db[_0x76bd('0x20')][_0x76bd('0x21')](function(_0x201485){return db[_0x76bd('0x13')]['update']({'recallmeNotifiedDate':db[_0x76bd('0x20')][_0x76bd('0x37')]('NOW()')},{'where':{'id':{'$in':_[_0x76bd('0xb')](_0x2a7f67,'id')}},'transaction':_0x201485})[_0x76bd('0xd')](function(){_0x4a0beb(_0x2a7f67);})['catch'](function(_0x58d97d){logger[_0x76bd('0x17')](_0x76bd('0x4d'),_0x58d97d[_0x76bd('0x11')],_0x368ea3);_0x5cf1af(_0x1db16f[_0x76bd('0x17')](0x1f4,_0x58d97d[_0x76bd('0x11')]));});})[_0x76bd('0x10')](function(_0x1ba13e){logger[_0x76bd('0x17')]('CmHopperHandlePreviewRecallNotifications',_0x1ba13e[_0x76bd('0x11')],_0x368ea3);_0x5cf1af(_0x1db16f['error'](0x1f4,_0x1ba13e[_0x76bd('0x11')]));});}else{_0x4a0beb(_0x2a7f67);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index a1d27dd..c7819cf 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 _0x9653=['index','/describe','isAuthenticated','describe','/opencontacts','/timezones','getTimezones','/:id','show','getPreviewRecall','post','/preview','getPreview','/timezone','put','update','delete','destroy','exports','express','Router','get'];(function(_0x3ebe57,_0x140457){var _0x91e8b0=function(_0x1d4f9e){while(--_0x1d4f9e){_0x3ebe57['push'](_0x3ebe57['shift']());}};_0x91e8b0(++_0x140457);}(_0x9653,0x1cb));var _0x3965=function(_0x152f4c,_0x3b66cf){_0x152f4c=_0x152f4c-0x0;var _0x42960e=_0x9653[_0x152f4c];return _0x42960e;};'use strict';var express=require(_0x3965('0x0'));var router=express[_0x3965('0x1')]();var auth=require('../../components/auth/service');var controller=require('./cmHopper.controller');router[_0x3965('0x2')]('/',auth['isAuthenticated'](),controller[_0x3965('0x3')]);router['get'](_0x3965('0x4'),auth[_0x3965('0x5')](),controller[_0x3965('0x6')]);router[_0x3965('0x2')](_0x3965('0x7'),auth[_0x3965('0x5')](),controller['getOpenContacts']);router[_0x3965('0x2')](_0x3965('0x8'),auth[_0x3965('0x5')](),controller[_0x3965('0x9')]);router[_0x3965('0x2')](_0x3965('0xa'),auth[_0x3965('0x5')](),controller[_0x3965('0xb')]);router[_0x3965('0x2')]('/:id/previewrecall',auth[_0x3965('0x5')](),controller[_0x3965('0xc')]);router['post']('/',auth[_0x3965('0x5')](),controller['create']);router[_0x3965('0xd')](_0x3965('0xe'),auth['isAuthenticated'](),controller[_0x3965('0xf')]);router[_0x3965('0xd')](_0x3965('0x10'),auth['isAuthenticated'](),controller['getTimezone']);router[_0x3965('0x11')]('/:id',auth[_0x3965('0x5')](),controller[_0x3965('0x12')]);router[_0x3965('0x13')](_0x3965('0xa'),auth[_0x3965('0x5')](),controller[_0x3965('0x14')]);module[_0x3965('0x15')]=router; \ No newline at end of file +var _0x3ed4=['describe','/opencontacts','isAuthenticated','getOpenContacts','/timezones','getTimezones','show','post','create','/preview','getPreview','/timezone','getTimezone','/:id','update','delete','exports','express','Router','../../components/auth/service','index','get','/describe'];(function(_0xfcfe92,_0x14ea66){var _0x166ba1=function(_0x45f01a){while(--_0x45f01a){_0xfcfe92['push'](_0xfcfe92['shift']());}};_0x166ba1(++_0x14ea66);}(_0x3ed4,0x198));var _0x43ed=function(_0x383446,_0x1e0c93){_0x383446=_0x383446-0x0;var _0x40e10d=_0x3ed4[_0x383446];return _0x40e10d;};'use strict';var express=require(_0x43ed('0x0'));var router=express[_0x43ed('0x1')]();var auth=require(_0x43ed('0x2'));var controller=require('./cmHopper.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x43ed('0x3')]);router[_0x43ed('0x4')](_0x43ed('0x5'),auth['isAuthenticated'](),controller[_0x43ed('0x6')]);router[_0x43ed('0x4')](_0x43ed('0x7'),auth[_0x43ed('0x8')](),controller[_0x43ed('0x9')]);router['get'](_0x43ed('0xa'),auth[_0x43ed('0x8')](),controller[_0x43ed('0xb')]);router[_0x43ed('0x4')]('/:id',auth[_0x43ed('0x8')](),controller[_0x43ed('0xc')]);router[_0x43ed('0x4')]('/:id/previewrecall',auth[_0x43ed('0x8')](),controller['getPreviewRecall']);router[_0x43ed('0xd')]('/',auth['isAuthenticated'](),controller[_0x43ed('0xe')]);router[_0x43ed('0xd')](_0x43ed('0xf'),auth[_0x43ed('0x8')](),controller[_0x43ed('0x10')]);router[_0x43ed('0xd')](_0x43ed('0x11'),auth['isAuthenticated'](),controller[_0x43ed('0x12')]);router['put'](_0x43ed('0x13'),auth['isAuthenticated'](),controller[_0x43ed('0x14')]);router[_0x43ed('0x15')](_0x43ed('0x13'),auth[_0x43ed('0x8')](),controller['destroy']);module[_0x43ed('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index e03d9d6..9a4be51 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0fe9=['format','INTEGER','STRING','DATE'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0x0fe9,0x1c9));var _0x90fe=function(_0x646368,_0x393682){_0x646368=_0x646368-0x0;var _0x1fe0c9=_0x0fe9[_0x646368];return _0x1fe0c9;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'CmHopperId':{'type':Sequelize[_0x90fe('0x0')]},'phone':{'type':Sequelize[_0x90fe('0x1')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x90fe('0x0')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x90fe('0x2')],'defaultValue':moment()[_0x90fe('0x3')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x90fe('0x0')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x90fe('0x0')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x90fe('0x0')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x90fe('0x0')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x90fe('0x0')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x90fe('0x0')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb4c1=['moment','exports','STRING','INTEGER','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x52d881,_0x3a47c9){var _0x41d8af=function(_0x43aa30){while(--_0x43aa30){_0x52d881['push'](_0x52d881['shift']());}};_0x41d8af(++_0x3a47c9);}(_0xb4c1,0xaf));var _0x1b4c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xb4c1[_0xfae23b];return _0x200640;};'use strict';var moment=require(_0x1b4c('0x0'));var Sequelize=require('sequelize');module[_0x1b4c('0x1')]={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x1b4c('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x1b4c('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x1b4c('0x4')],'defaultValue':moment()[_0x1b4c('0x5')](_0x1b4c('0x6'))},'countbusyretry':{'type':Sequelize[_0x1b4c('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1b4c('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x1b4c('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1b4c('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1b4c('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index c707d38..26c4601 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ce5=['end','json','offset','limit','count','set','apply','reject','save','update','then','destroy','get','CmHopperAdditionalPhones','error','stack','name','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x2b2a4c,_0x19eed6){var _0x3394e9=function(_0x26f8c9){while(--_0x26f8c9){_0x2b2a4c['push'](_0x2b2a4c['shift']());}};_0x3394e9(++_0x19eed6);}(_0x4ce5,0x17a));var _0x54ce=function(_0x20bad7,_0x412692){_0x20bad7=_0x20bad7-0x0;var _0x23504e=_0x4ce5[_0x20bad7];return _0x23504e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x54ce('0x0'));var zipdir=require(_0x54ce('0x1'));var jsonpatch=require(_0x54ce('0x2'));var rp=require(_0x54ce('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x54ce('0x4'));var util=require('util');var path=require(_0x54ce('0x5'));var sox=require(_0x54ce('0x6'));var csv=require(_0x54ce('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x54ce('0x8'));var _=require(_0x54ce('0x9'));var squel=require(_0x54ce('0xa'));var crypto=require('crypto');var jsforce=require(_0x54ce('0xb'));var deskjs=require(_0x54ce('0xc'));var toCsv=require(_0x54ce('0x7'));var querystring=require(_0x54ce('0xd'));var Papa=require(_0x54ce('0xe'));var Redis=require(_0x54ce('0xf'));var authService=require(_0x54ce('0x10'));var qs=require(_0x54ce('0x11'));var as=require(_0x54ce('0x12'));var hardwareService=require(_0x54ce('0x13'));var logger=require(_0x54ce('0x14'))(_0x54ce('0x15'));var utils=require('../../config/utils');var config=require(_0x54ce('0x16'));var licenseUtil=require(_0x54ce('0x17'));var db=require(_0x54ce('0x18'))['db'];function respondWithStatusCode(_0x12a70,_0x554d89){_0x554d89=_0x554d89||0xcc;return function(_0x10abac){if(_0x10abac){return _0x12a70[_0x54ce('0x19')](_0x554d89);}return _0x12a70[_0x54ce('0x1a')](_0x554d89)[_0x54ce('0x1b')]();};}function respondWithResult(_0x350fbe,_0x315b0a){_0x315b0a=_0x315b0a||0xc8;return function(_0x1cddee){if(_0x1cddee){return _0x350fbe[_0x54ce('0x1a')](_0x315b0a)[_0x54ce('0x1c')](_0x1cddee);}};}function respondWithFilteredResult(_0x355883,_0x13ffec){return function(_0x4c52d4){if(_0x4c52d4){var _0x51d721=typeof _0x13ffec[_0x54ce('0x1d')]==='undefined'&&typeof _0x13ffec[_0x54ce('0x1e')]==='undefined';var _0x1340b7=_0x4c52d4[_0x54ce('0x1f')];var _0x407eaa=_0x51d721?0x0:_0x13ffec[_0x54ce('0x1d')];var _0x29f504=_0x51d721?_0x4c52d4[_0x54ce('0x1f')]:_0x13ffec[_0x54ce('0x1d')]+_0x13ffec[_0x54ce('0x1e')];var _0x5e03c6;if(_0x29f504>=_0x1340b7){_0x29f504=_0x1340b7;_0x5e03c6=0xc8;}else{_0x5e03c6=0xce;}_0x355883[_0x54ce('0x1a')](_0x5e03c6);return _0x355883[_0x54ce('0x20')]('Content-Range',_0x407eaa+'-'+_0x29f504+'/'+_0x1340b7)[_0x54ce('0x1c')](_0x4c52d4);}return null;};}function patchUpdates(_0x356d7a){return function(_0x141341){try{jsonpatch[_0x54ce('0x21')](_0x141341,_0x356d7a,!![]);}catch(_0x260124){return BPromise[_0x54ce('0x22')](_0x260124);}return _0x141341[_0x54ce('0x23')]();};}function saveUpdates(_0x35bafd,_0x194449){return function(_0x1e24fa){if(_0x1e24fa){return _0x1e24fa[_0x54ce('0x24')](_0x35bafd)[_0x54ce('0x25')](function(_0x933cad){return _0x933cad;});}return null;};}function removeEntity(_0x47ed8d,_0xe31ebf){return function(_0x59357b){if(_0x59357b){return _0x59357b[_0x54ce('0x26')]()[_0x54ce('0x25')](function(){var _0x220cbf=_0x59357b[_0x54ce('0x27')]({'plain':!![]});var _0x52e76a=_0x54ce('0x28');return db['UserProfileResource'][_0x54ce('0x26')]({'where':{'type':_0x52e76a,'resourceId':_0x220cbf['id']}})['then'](function(){return _0x59357b;});})[_0x54ce('0x25')](function(){_0x47ed8d[_0x54ce('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d5021,_0x4ad6e0){return function(_0x666fe3){if(!_0x666fe3){_0x4d5021[_0x54ce('0x19')](0x194);}return _0x666fe3;};}function handleError(_0x3181f2,_0x976831){_0x976831=_0x976831||0x1f4;return function(_0x3d645e){logger[_0x54ce('0x29')](_0x3d645e[_0x54ce('0x2a')]);if(_0x3d645e[_0x54ce('0x2b')]){delete _0x3d645e['name'];}_0x3181f2[_0x54ce('0x1a')](_0x976831)['send'](_0x3d645e);};}exports[_0x54ce('0x2c')]=function(_0x44fc5a,_0x39593e){var _0x307ea6={},_0x2f8175={},_0x260c10={'count':0x0,'rows':[]};var _0x4d8efb=_[_0x54ce('0x2d')](db[_0x54ce('0x2e')][_0x54ce('0x2f')],function(_0x5e290f){return{'name':_0x5e290f[_0x54ce('0x30')],'type':_0x5e290f['type']['key']};});_0x2f8175[_0x54ce('0x31')]=_[_0x54ce('0x2d')](_0x4d8efb,_0x54ce('0x2b'));_0x2f8175[_0x54ce('0x32')]=_[_0x54ce('0x33')](_0x44fc5a[_0x54ce('0x32')]);_0x2f8175['filters']=_[_0x54ce('0x34')](_0x2f8175[_0x54ce('0x31')],_0x2f8175[_0x54ce('0x32')]);_0x307ea6[_0x54ce('0x35')]=_['intersection'](_0x2f8175[_0x54ce('0x31')],qs['fields'](_0x44fc5a['query'][_0x54ce('0x36')]));_0x307ea6[_0x54ce('0x35')]=_0x307ea6['attributes'][_0x54ce('0x37')]?_0x307ea6['attributes']:_0x2f8175[_0x54ce('0x31')];if(!_0x44fc5a[_0x54ce('0x32')][_0x54ce('0x38')](_0x54ce('0x39'))){_0x307ea6[_0x54ce('0x1e')]=qs['limit'](_0x44fc5a['query'][_0x54ce('0x1e')]);_0x307ea6[_0x54ce('0x1d')]=qs['offset'](_0x44fc5a[_0x54ce('0x32')][_0x54ce('0x1d')]);}_0x307ea6['order']=qs['sort'](_0x44fc5a[_0x54ce('0x32')][_0x54ce('0x3a')]);_0x307ea6[_0x54ce('0x3b')]=qs[_0x54ce('0x3c')](_[_0x54ce('0x3d')](_0x44fc5a[_0x54ce('0x32')],_0x2f8175['filters']),_0x4d8efb);if(_0x44fc5a[_0x54ce('0x32')][_0x54ce('0x3e')]){_0x307ea6[_0x54ce('0x3b')]=_[_0x54ce('0x3f')](_0x307ea6['where'],{'$or':_[_0x54ce('0x2d')](_0x4d8efb,function(_0x30c376){if(_0x30c376[_0x54ce('0x40')]!==_0x54ce('0x41')){var _0x58ac83={};_0x58ac83[_0x30c376[_0x54ce('0x2b')]]={'$like':'%'+_0x44fc5a[_0x54ce('0x32')]['filter']+'%'};return _0x58ac83;}})});}_0x307ea6=_[_0x54ce('0x3f')]({},_0x307ea6,_0x44fc5a[_0x54ce('0x42')]);var _0x19b2d9={'where':_0x307ea6['where']};return db['CmHopperAdditionalPhone']['count'](_0x19b2d9)[_0x54ce('0x25')](function(_0x2a5b3c){_0x260c10[_0x54ce('0x1f')]=_0x2a5b3c;if(_0x44fc5a['query'][_0x54ce('0x43')]){_0x307ea6['include']=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0x54ce('0x44')](_0x307ea6);})[_0x54ce('0x25')](function(_0x4e9569){_0x260c10['rows']=_0x4e9569;return _0x260c10;})['then'](respondWithFilteredResult(_0x39593e,_0x307ea6))[_0x54ce('0x45')](handleError(_0x39593e,null));};exports[_0x54ce('0x46')]=function(_0x172922,_0x4aaa4a){var _0x271528={'raw':!![],'where':{'id':_0x172922[_0x54ce('0x47')]['id']}},_0x289915={};_0x289915[_0x54ce('0x31')]=_[_0x54ce('0x33')](db[_0x54ce('0x2e')][_0x54ce('0x2f')]);_0x289915[_0x54ce('0x32')]=_['keys'](_0x172922['query']);_0x289915['filters']=_[_0x54ce('0x34')](_0x289915['model'],_0x289915[_0x54ce('0x32')]);_0x271528[_0x54ce('0x35')]=_[_0x54ce('0x34')](_0x289915[_0x54ce('0x31')],qs['fields'](_0x172922['query'][_0x54ce('0x36')]));_0x271528[_0x54ce('0x35')]=_0x271528[_0x54ce('0x35')]['length']?_0x271528['attributes']:_0x289915[_0x54ce('0x31')];if(_0x172922[_0x54ce('0x32')][_0x54ce('0x43')]){_0x271528['include']=[{'all':!![]}];}_0x271528=_[_0x54ce('0x3f')]({},_0x271528,_0x172922[_0x54ce('0x42')]);return db[_0x54ce('0x2e')]['find'](_0x271528)[_0x54ce('0x25')](handleEntityNotFound(_0x4aaa4a,null))[_0x54ce('0x25')](respondWithResult(_0x4aaa4a,null))[_0x54ce('0x45')](handleError(_0x4aaa4a,null));};exports[_0x54ce('0x48')]=function(_0x357984,_0x4a404f){return db[_0x54ce('0x2e')]['create'](_0x357984['body'],{})[_0x54ce('0x25')](function(_0xb32884){var _0x132f67=_0x357984[_0x54ce('0x49')][_0x54ce('0x27')]({'plain':!![]});if(!_0x132f67)throw new Error(_0x54ce('0x4a'));if(_0x132f67[_0x54ce('0x4b')]===_0x54ce('0x49')){var _0x1be162=_0xb32884[_0x54ce('0x27')]({'plain':!![]});var _0xf38741=_0x54ce('0x28');return db[_0x54ce('0x4c')]['find']({'where':{'name':_0xf38741,'userProfileId':_0x132f67['userProfileId']},'raw':!![]})[_0x54ce('0x25')](function(_0xaf8a23){if(_0xaf8a23&&_0xaf8a23['autoAssociation']===0x0){return db[_0x54ce('0x4d')]['create']({'name':_0x1be162['name'],'resourceId':_0x1be162['id'],'type':_0xaf8a23['name'],'sectionId':_0xaf8a23['id']},{})[_0x54ce('0x25')](function(){return _0xb32884;});}else{return _0xb32884;}})[_0x54ce('0x45')](function(_0xf418f){logger[_0x54ce('0x29')](_0x54ce('0x4e'),_0xf418f);throw _0xf418f;});}return _0xb32884;})[_0x54ce('0x25')](respondWithResult(_0x4a404f,0xc9))[_0x54ce('0x45')](handleError(_0x4a404f,null));};exports[_0x54ce('0x24')]=function(_0x5445fa,_0x513198){if(_0x5445fa[_0x54ce('0x4f')]['id']){delete _0x5445fa[_0x54ce('0x4f')]['id'];}return db[_0x54ce('0x2e')][_0x54ce('0x50')]({'where':{'id':_0x5445fa[_0x54ce('0x47')]['id']}})['then'](handleEntityNotFound(_0x513198,null))[_0x54ce('0x25')](saveUpdates(_0x5445fa[_0x54ce('0x4f')],null))[_0x54ce('0x25')](respondWithResult(_0x513198,null))[_0x54ce('0x45')](handleError(_0x513198,null));};exports[_0x54ce('0x26')]=function(_0x364bcf,_0x444f0b){return db[_0x54ce('0x2e')][_0x54ce('0x50')]({'where':{'id':_0x364bcf['params']['id']}})['then'](handleEntityNotFound(_0x444f0b,null))['then'](removeEntity(_0x444f0b,null))[_0x54ce('0x45')](handleError(_0x444f0b,null));}; \ No newline at end of file +var _0x25ce=['model','fields','attributes','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','create','user','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','index','map','CmHopperAdditionalPhone','type','key','query','keys','filters','intersection'];(function(_0x5c0ffe,_0x2d9b3b){var _0x2f2cec=function(_0x16eb67){while(--_0x16eb67){_0x5c0ffe['push'](_0x5c0ffe['shift']());}};_0x2f2cec(++_0x2d9b3b);}(_0x25ce,0x1bf));var _0xe25c=function(_0x327f41,_0x5c3672){_0x327f41=_0x327f41-0x0;var _0x3ffdae=_0x25ce[_0x327f41];return _0x3ffdae;};'use strict';var emlformat=require(_0xe25c('0x0'));var rimraf=require(_0xe25c('0x1'));var zipdir=require(_0xe25c('0x2'));var jsonpatch=require(_0xe25c('0x3'));var rp=require(_0xe25c('0x4'));var moment=require('moment');var BPromise=require(_0xe25c('0x5'));var Mustache=require(_0xe25c('0x6'));var util=require(_0xe25c('0x7'));var path=require(_0xe25c('0x8'));var sox=require(_0xe25c('0x9'));var csv=require(_0xe25c('0xa'));var ejs=require(_0xe25c('0xb'));var fs=require('fs');var fs_extra=require(_0xe25c('0xc'));var _=require(_0xe25c('0xd'));var squel=require(_0xe25c('0xe'));var crypto=require(_0xe25c('0xf'));var jsforce=require(_0xe25c('0x10'));var deskjs=require(_0xe25c('0x11'));var toCsv=require(_0xe25c('0xa'));var querystring=require(_0xe25c('0x12'));var Papa=require(_0xe25c('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe25c('0x14'));var as=require(_0xe25c('0x15'));var hardwareService=require(_0xe25c('0x16'));var logger=require(_0xe25c('0x17'))(_0xe25c('0x18'));var utils=require(_0xe25c('0x19'));var config=require(_0xe25c('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xe25c('0x1b'))['db'];function respondWithStatusCode(_0x16b225,_0x5c2339){_0x5c2339=_0x5c2339||0xcc;return function(_0x5edc5c){if(_0x5edc5c){return _0x16b225[_0xe25c('0x1c')](_0x5c2339);}return _0x16b225[_0xe25c('0x1d')](_0x5c2339)[_0xe25c('0x1e')]();};}function respondWithResult(_0x543a43,_0x9099d2){_0x9099d2=_0x9099d2||0xc8;return function(_0x2c11c1){if(_0x2c11c1){return _0x543a43['status'](_0x9099d2)[_0xe25c('0x1f')](_0x2c11c1);}};}function respondWithFilteredResult(_0x51f7d0,_0x558120){return function(_0x566071){if(_0x566071){var _0x1e2e53=typeof _0x558120[_0xe25c('0x20')]==='undefined'&&typeof _0x558120['limit']===_0xe25c('0x21');var _0x53c8c0=_0x566071[_0xe25c('0x22')];var _0x13a6c2=_0x1e2e53?0x0:_0x558120[_0xe25c('0x20')];var _0x52401b=_0x1e2e53?_0x566071[_0xe25c('0x22')]:_0x558120['offset']+_0x558120[_0xe25c('0x23')];var _0x2ecb66;if(_0x52401b>=_0x53c8c0){_0x52401b=_0x53c8c0;_0x2ecb66=0xc8;}else{_0x2ecb66=0xce;}_0x51f7d0['status'](_0x2ecb66);return _0x51f7d0['set'](_0xe25c('0x24'),_0x13a6c2+'-'+_0x52401b+'/'+_0x53c8c0)[_0xe25c('0x1f')](_0x566071);}return null;};}function patchUpdates(_0x395b36){return function(_0x4792cf){try{jsonpatch[_0xe25c('0x25')](_0x4792cf,_0x395b36,!![]);}catch(_0x283345){return BPromise[_0xe25c('0x26')](_0x283345);}return _0x4792cf['save']();};}function saveUpdates(_0x229744,_0x265195){return function(_0x4acbdf){if(_0x4acbdf){return _0x4acbdf[_0xe25c('0x27')](_0x229744)[_0xe25c('0x28')](function(_0x45cf69){return _0x45cf69;});}return null;};}function removeEntity(_0x1fd59e,_0x1f4c7a){return function(_0x23f875){if(_0x23f875){return _0x23f875[_0xe25c('0x29')]()['then'](function(){var _0x5cf7a4=_0x23f875[_0xe25c('0x2a')]({'plain':!![]});var _0x3acfe1=_0xe25c('0x2b');return db[_0xe25c('0x2c')]['destroy']({'where':{'type':_0x3acfe1,'resourceId':_0x5cf7a4['id']}})['then'](function(){return _0x23f875;});})[_0xe25c('0x28')](function(){_0x1fd59e[_0xe25c('0x1d')](0xcc)[_0xe25c('0x1e')]();});}};}function handleEntityNotFound(_0x945029,_0x5aeff6){return function(_0x528b56){if(!_0x528b56){_0x945029[_0xe25c('0x1c')](0x194);}return _0x528b56;};}function handleError(_0x5b1d07,_0x8d98ab){_0x8d98ab=_0x8d98ab||0x1f4;return function(_0x2e675c){logger[_0xe25c('0x2d')](_0x2e675c[_0xe25c('0x2e')]);if(_0x2e675c[_0xe25c('0x2f')]){delete _0x2e675c[_0xe25c('0x2f')];}_0x5b1d07[_0xe25c('0x1d')](_0x8d98ab)['send'](_0x2e675c);};}exports[_0xe25c('0x30')]=function(_0x30378f,_0x4e7d79){var _0x57942e={},_0x24f76b={},_0x262714={'count':0x0,'rows':[]};var _0x16d0d=_[_0xe25c('0x31')](db[_0xe25c('0x32')]['rawAttributes'],function(_0x1f782e){return{'name':_0x1f782e['fieldName'],'type':_0x1f782e[_0xe25c('0x33')][_0xe25c('0x34')]};});_0x24f76b['model']=_[_0xe25c('0x31')](_0x16d0d,_0xe25c('0x2f'));_0x24f76b[_0xe25c('0x35')]=_[_0xe25c('0x36')](_0x30378f['query']);_0x24f76b[_0xe25c('0x37')]=_[_0xe25c('0x38')](_0x24f76b[_0xe25c('0x39')],_0x24f76b[_0xe25c('0x35')]);_0x57942e['attributes']=_['intersection'](_0x24f76b[_0xe25c('0x39')],qs[_0xe25c('0x3a')](_0x30378f[_0xe25c('0x35')]['fields']));_0x57942e['attributes']=_0x57942e[_0xe25c('0x3b')]['length']?_0x57942e[_0xe25c('0x3b')]:_0x24f76b[_0xe25c('0x39')];if(!_0x30378f[_0xe25c('0x35')][_0xe25c('0x3c')]('nolimit')){_0x57942e[_0xe25c('0x23')]=qs['limit'](_0x30378f['query'][_0xe25c('0x23')]);_0x57942e[_0xe25c('0x20')]=qs[_0xe25c('0x20')](_0x30378f[_0xe25c('0x35')][_0xe25c('0x20')]);}_0x57942e[_0xe25c('0x3d')]=qs['sort'](_0x30378f[_0xe25c('0x35')][_0xe25c('0x3e')]);_0x57942e[_0xe25c('0x3f')]=qs[_0xe25c('0x37')](_[_0xe25c('0x40')](_0x30378f[_0xe25c('0x35')],_0x24f76b[_0xe25c('0x37')]),_0x16d0d);if(_0x30378f[_0xe25c('0x35')]['filter']){_0x57942e['where']=_['merge'](_0x57942e[_0xe25c('0x3f')],{'$or':_[_0xe25c('0x31')](_0x16d0d,function(_0x18ab40){if(_0x18ab40['type']!==_0xe25c('0x41')){var _0x2348a2={};_0x2348a2[_0x18ab40['name']]={'$like':'%'+_0x30378f[_0xe25c('0x35')][_0xe25c('0x42')]+'%'};return _0x2348a2;}})});}_0x57942e=_[_0xe25c('0x43')]({},_0x57942e,_0x30378f[_0xe25c('0x44')]);var _0x4f4e4e={'where':_0x57942e[_0xe25c('0x3f')]};return db[_0xe25c('0x32')][_0xe25c('0x22')](_0x4f4e4e)[_0xe25c('0x28')](function(_0x58b241){_0x262714[_0xe25c('0x22')]=_0x58b241;if(_0x30378f[_0xe25c('0x35')][_0xe25c('0x45')]){_0x57942e[_0xe25c('0x46')]=[{'all':!![]}];}return db['CmHopperAdditionalPhone'][_0xe25c('0x47')](_0x57942e);})['then'](function(_0x208f03){_0x262714[_0xe25c('0x48')]=_0x208f03;return _0x262714;})[_0xe25c('0x28')](respondWithFilteredResult(_0x4e7d79,_0x57942e))[_0xe25c('0x49')](handleError(_0x4e7d79,null));};exports[_0xe25c('0x4a')]=function(_0x151c4e,_0x36d711){var _0x40148f={'raw':!![],'where':{'id':_0x151c4e['params']['id']}},_0xb065d9={};_0xb065d9[_0xe25c('0x39')]=_[_0xe25c('0x36')](db['CmHopperAdditionalPhone'][_0xe25c('0x4b')]);_0xb065d9[_0xe25c('0x35')]=_[_0xe25c('0x36')](_0x151c4e['query']);_0xb065d9[_0xe25c('0x37')]=_[_0xe25c('0x38')](_0xb065d9['model'],_0xb065d9[_0xe25c('0x35')]);_0x40148f[_0xe25c('0x3b')]=_['intersection'](_0xb065d9[_0xe25c('0x39')],qs[_0xe25c('0x3a')](_0x151c4e[_0xe25c('0x35')][_0xe25c('0x3a')]));_0x40148f[_0xe25c('0x3b')]=_0x40148f[_0xe25c('0x3b')]['length']?_0x40148f['attributes']:_0xb065d9[_0xe25c('0x39')];if(_0x151c4e[_0xe25c('0x35')]['includeAll']){_0x40148f[_0xe25c('0x46')]=[{'all':!![]}];}_0x40148f=_['merge']({},_0x40148f,_0x151c4e['options']);return db[_0xe25c('0x32')]['find'](_0x40148f)['then'](handleEntityNotFound(_0x36d711,null))[_0xe25c('0x28')](respondWithResult(_0x36d711,null))['catch'](handleError(_0x36d711,null));};exports[_0xe25c('0x4c')]=function(_0x1b6ebf,_0x5414b7){return db[_0xe25c('0x32')]['create'](_0x1b6ebf['body'],{})[_0xe25c('0x28')](function(_0x5d203f){var _0x410c2f=_0x1b6ebf[_0xe25c('0x4d')][_0xe25c('0x2a')]({'plain':!![]});if(!_0x410c2f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x410c2f['role']===_0xe25c('0x4d')){var _0x57f690=_0x5d203f[_0xe25c('0x2a')]({'plain':!![]});var _0x575e87='CmHopperAdditionalPhones';return db[_0xe25c('0x4e')][_0xe25c('0x4f')]({'where':{'name':_0x575e87,'userProfileId':_0x410c2f[_0xe25c('0x50')]},'raw':!![]})['then'](function(_0x524721){if(_0x524721&&_0x524721['autoAssociation']===0x0){return db[_0xe25c('0x2c')][_0xe25c('0x4c')]({'name':_0x57f690[_0xe25c('0x2f')],'resourceId':_0x57f690['id'],'type':_0x524721[_0xe25c('0x2f')],'sectionId':_0x524721['id']},{})[_0xe25c('0x28')](function(){return _0x5d203f;});}else{return _0x5d203f;}})[_0xe25c('0x49')](function(_0x46a809){logger[_0xe25c('0x2d')](_0xe25c('0x51'),_0x46a809);throw _0x46a809;});}return _0x5d203f;})[_0xe25c('0x28')](respondWithResult(_0x5414b7,0xc9))[_0xe25c('0x49')](handleError(_0x5414b7,null));};exports['update']=function(_0x6f1fc2,_0x11adad){if(_0x6f1fc2[_0xe25c('0x52')]['id']){delete _0x6f1fc2['body']['id'];}return db[_0xe25c('0x32')]['find']({'where':{'id':_0x6f1fc2['params']['id']}})[_0xe25c('0x28')](handleEntityNotFound(_0x11adad,null))['then'](saveUpdates(_0x6f1fc2[_0xe25c('0x52')],null))[_0xe25c('0x28')](respondWithResult(_0x11adad,null))[_0xe25c('0x49')](handleError(_0x11adad,null));};exports[_0xe25c('0x29')]=function(_0x1d8175,_0x3c7826){return db['CmHopperAdditionalPhone'][_0xe25c('0x4f')]({'where':{'id':_0x1d8175[_0xe25c('0x53')]['id']}})[_0xe25c('0x28')](handleEntityNotFound(_0x3c7826,null))[_0xe25c('0x28')](removeEntity(_0x3c7826,null))[_0xe25c('0x49')](handleError(_0x3c7826,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 062c43c..e9df46e 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7543=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','define','cm_hopper_additional_phones','util','../../config/logger'];(function(_0x5da14d,_0x1ef57f){var _0x1e79ec=function(_0x53a7cf){while(--_0x53a7cf){_0x5da14d['push'](_0x5da14d['shift']());}};_0x1e79ec(++_0x1ef57f);}(_0x7543,0x148));var _0x3754=function(_0x1aadba,_0x1b407){_0x1aadba=_0x1aadba-0x0;var _0x4e78da=_0x7543[_0x1aadba];return _0x4e78da;};'use strict';var _=require('lodash');var util=require(_0x3754('0x0'));var logger=require(_0x3754('0x1'))(_0x3754('0x2'));var moment=require(_0x3754('0x3'));var BPromise=require(_0x3754('0x4'));var rp=require(_0x3754('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3754('0x6'));var config=require(_0x3754('0x7'));var attributes=require(_0x3754('0x8'));module['exports']=function(_0x553787,_0x403ca2){return _0x553787[_0x3754('0x9')]('CmHopperAdditionalPhone',attributes,{'tableName':_0x3754('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8828=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','define','CmHopperAdditionalPhone','cm_hopper_additional_phones'];(function(_0x3b157e,_0x3e021c){var _0x4a1dfb=function(_0x52597a){while(--_0x52597a){_0x3b157e['push'](_0x3b157e['shift']());}};_0x4a1dfb(++_0x3e021c);}(_0x8828,0x197));var _0x8882=function(_0x2573c6,_0x56ef90){_0x2573c6=_0x2573c6-0x0;var _0xad97d4=_0x8828[_0x2573c6];return _0xad97d4;};'use strict';var _=require('lodash');var util=require(_0x8882('0x0'));var logger=require('../../config/logger')(_0x8882('0x1'));var moment=require('moment');var BPromise=require(_0x8882('0x2'));var rp=require(_0x8882('0x3'));var fs=require('fs');var path=require(_0x8882('0x4'));var rimraf=require(_0x8882('0x5'));var config=require(_0x8882('0x6'));var attributes=require(_0x8882('0x7'));module['exports']=function(_0x28afb8,_0x42adc2){return _0x28afb8[_0x8882('0x8')](_0x8882('0x9'),attributes,{'tableName':_0x8882('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 4d50ce3..6bb14df 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd754=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','countnoanswerretry','countnosuchnumberretry','dialGlobalMaxRetry','VerifyAdditionalPhones','SwapAdditionalPhones','ASC','duration','waitTime','scheduledat','add','minutes','isNil','phone','updatedAt','sequelize','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','field','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','info','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CmHopper','body','ContactId','ListId','VoiceQueueId','CampaignId','then','CmHopperAdditionalPhone','findOne','OrderBy','countbusyretry','countcongestionretry'];(function(_0x4fa166,_0x58b7fb){var _0x5dd974=function(_0x342886){while(--_0x342886){_0x4fa166['push'](_0x4fa166['shift']());}};_0x5dd974(++_0x58b7fb);}(_0xd754,0x1f1));var _0x4d75=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0xd754[_0x174ef5];return _0x1cc379;};'use strict';var _=require(_0x4d75('0x0'));var util=require(_0x4d75('0x1'));var moment=require(_0x4d75('0x2'));var BPromise=require('bluebird');var rs=require(_0x4d75('0x3'));var fs=require('fs');var Redis=require(_0x4d75('0x4'));var db=require(_0x4d75('0x5'))['db'];var utils=require(_0x4d75('0x6'));var logger=require(_0x4d75('0x7'))(_0x4d75('0x8'));var config=require('../../config/environment');var jayson=require(_0x4d75('0x9'));var client=jayson[_0x4d75('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d7556,_0x462f33,_0x522b0d){return new BPromise(function(_0x41be88,_0x4bd012){return client['request'](_0x3d7556,_0x522b0d)['then'](function(_0x32012b){logger[_0x4d75('0xb')](_0x4d75('0xc'),_0x462f33,'request\x20sent');logger[_0x4d75('0xd')](_0x4d75('0xe'),_0x462f33,_0x4d75('0xf'),JSON[_0x4d75('0x10')](_0x32012b));if(_0x32012b[_0x4d75('0x11')]){if(_0x32012b[_0x4d75('0x11')][_0x4d75('0x12')]===0x1f4){logger[_0x4d75('0x11')](_0x4d75('0xc'),_0x462f33,_0x32012b[_0x4d75('0x11')][_0x4d75('0x13')]);return _0x4bd012(_0x32012b[_0x4d75('0x11')]['message']);}logger[_0x4d75('0x11')](_0x4d75('0xc'),_0x462f33,_0x32012b[_0x4d75('0x11')][_0x4d75('0x13')]);return _0x41be88(_0x32012b[_0x4d75('0x11')][_0x4d75('0x13')]);}else{logger['info'](_0x4d75('0xc'),_0x462f33,_0x4d75('0xf'));_0x41be88(_0x32012b[_0x4d75('0x14')][_0x4d75('0x13')]);}})[_0x4d75('0x15')](function(_0x5c9086){logger[_0x4d75('0x11')](_0x4d75('0xc'),_0x462f33,_0x5c9086);_0x4bd012(_0x5c9086);});});}exports['VerifyAdditionalPhones']=function(_0x3bdc03){var _0x11f852=this;return new Promise(function(_0x405fec,_0x11ec85){return db[_0x4d75('0x16')]['findOne']({'raw':!![],'where':{'ContactId':_0x3bdc03[_0x4d75('0x17')][_0x4d75('0x18')],'ListId':_0x3bdc03[_0x4d75('0x17')][_0x4d75('0x19')],'VoiceQueueId':_0x3bdc03['body'][_0x4d75('0x1a')]===undefined?null:_0x3bdc03[_0x4d75('0x17')][_0x4d75('0x1a')],'CampaignId':_0x3bdc03['body'][_0x4d75('0x1b')]===undefined?null:_0x3bdc03['body'][_0x4d75('0x1b')]}})[_0x4d75('0x1c')](function(_0x49fe23){if(_0x49fe23!=null){return db[_0x4d75('0x1d')][_0x4d75('0x1e')]({'raw':!![],'where':{'CmHopperId':_0x49fe23['id'],'OrderBy':{'$gt':_0x49fe23[_0x4d75('0x1f')]}},'order':[[_0x4d75('0x1f'),'ASC']]})[_0x4d75('0x1c')](function(_0x4832bb){var _0x5ece23=0x0;if(_0x4832bb){if(_0x4832bb[_0x4d75('0x20')]+_0x4832bb[_0x4d75('0x21')]+_0x4832bb['countnoanswerretry']+_0x4832bb['countnosuchnumberretry']+_0x4832bb[_0x4d75('0x22')]+_0x4832bb[_0x4d75('0x23')]+_0x4832bb[_0x4d75('0x24')]+_0x4832bb[_0x4d75('0x25')]<_0x3bdc03[_0x4d75('0x26')]['dialGlobalMaxRetry'])_0x5ece23=0x1;_0x405fec({'additional':_0x5ece23});}else{return db['CmHopperAdditionalPhone'][_0x4d75('0x1e')]({'raw':!![],'where':{'CmHopperId':_0x49fe23['id']},'order':[[_0x4d75('0x1f'),'ASC']]})[_0x4d75('0x1c')](function(_0x51adb0){var _0x37d046=0x0;if(_0x51adb0){if(_0x51adb0[_0x4d75('0x20')]+_0x51adb0[_0x4d75('0x21')]+_0x51adb0[_0x4d75('0x27')]+_0x51adb0[_0x4d75('0x28')]+_0x51adb0[_0x4d75('0x22')]+_0x51adb0[_0x4d75('0x23')]+_0x51adb0[_0x4d75('0x24')]+_0x51adb0[_0x4d75('0x25')]<_0x3bdc03[_0x4d75('0x26')][_0x4d75('0x29')])_0x37d046=0x1;_0x405fec({'additional':_0x37d046});}else{_0x405fec({'additional':0x0});}})[_0x4d75('0x15')](function(_0x1e83de){logger[_0x4d75('0x11')](_0x4d75('0x2a'),_0x1e83de[_0x4d75('0x13')]);_0x11ec85(_0x11f852[_0x4d75('0x11')](0x1f4,_0x1e83de[_0x4d75('0x13')]));});}})[_0x4d75('0x15')](function(_0x1c0241){logger[_0x4d75('0x11')]('VerifyAdditionalPhones',_0x1c0241['message']);_0x11ec85(_0x11f852[_0x4d75('0x11')](0x1f4,_0x1c0241[_0x4d75('0x13')]));});}else _0x405fec({'additional':0x0});});});};exports[_0x4d75('0x2b')]=function(_0x5f20f7){var _0x23f8b7=this;return new Promise(function(_0x1941ef,_0x49d9e3){return db[_0x4d75('0x16')][_0x4d75('0x1e')]({'raw':!![],'where':{'ContactId':_0x5f20f7['body']['ContactId'],'ListId':_0x5f20f7['body'][_0x4d75('0x19')],'VoiceQueueId':_0x5f20f7[_0x4d75('0x17')][_0x4d75('0x1a')]===undefined?null:_0x5f20f7[_0x4d75('0x17')][_0x4d75('0x1a')],'CampaignId':_0x5f20f7[_0x4d75('0x17')][_0x4d75('0x1b')]===undefined?null:_0x5f20f7[_0x4d75('0x17')][_0x4d75('0x1b')]}})[_0x4d75('0x1c')](function(_0x1e51a1){if(_0x1e51a1!=null){return db[_0x4d75('0x1d')][_0x4d75('0x1e')]({'raw':!![],'where':{'CmHopperId':_0x1e51a1['id'],'OrderBy':{'$gte':_0x1e51a1[_0x4d75('0x1f')]}},'order':[['OrderBy',_0x4d75('0x2c')]]})[_0x4d75('0x1c')](function(_0x5e58b2){if(_0x5e58b2)return activateAdditionalPhone(_0x1e51a1,_0x5f20f7['body'],_0x5e58b2,_0x5f20f7[_0x4d75('0x2d')],_0x5f20f7[_0x4d75('0x2e')])[_0x4d75('0x1c')](function(_0x4cd33a){_0x1941ef(_0x4cd33a);});else{return db['CmHopperAdditionalPhone'][_0x4d75('0x1e')]({'raw':!![],'where':{'CmHopperId':_0x1e51a1['id']},'order':[[_0x4d75('0x1f'),'ASC']]})['then'](function(_0x48b3ab){if(_0x48b3ab)return activateAdditionalPhone(_0x1e51a1,_0x5f20f7[_0x4d75('0x17')],_0x48b3ab,_0x5f20f7['duration'],_0x5f20f7[_0x4d75('0x2e')])['then'](function(_0x553f9d){_0x1941ef(_0x553f9d);});else{_0x1941ef({'id':_0x1e51a1['id'],'phone':''});}})['catch'](function(_0x54de6d){logger[_0x4d75('0x11')](_0x4d75('0x2a'),_0x54de6d['message']);_0x49d9e3(_0x23f8b7[_0x4d75('0x11')](0x1f4,_0x54de6d[_0x4d75('0x13')]));});}})[_0x4d75('0x15')](function(_0x3c0d7e){logger[_0x4d75('0x11')](_0x4d75('0x2a'),_0x3c0d7e[_0x4d75('0x13')]);_0x49d9e3(_0x23f8b7[_0x4d75('0x11')](0x1f4,_0x3c0d7e[_0x4d75('0x13')]));});}else _0x1941ef(0x1);});});};function activateAdditionalPhone(_0x48559c,_0x4683a8,_0x4da5ea,_0x308605,_0x5f2fc5){return new Promise(function(_0x2f87d6,_0x4e9e30){var _0xa4d047;if(_['isNil'](_0x4da5ea[_0x4d75('0x2f')])){_0x4da5ea[_0x4d75('0x2f')]=moment();}if(moment()>moment(_0x4da5ea[_0x4d75('0x2f')])){_0xa4d047=moment()[_0x4d75('0x30')](_0x5f2fc5||0x3,_0x4d75('0x31'));}else{if(_0x4da5ea[_0x4d75('0x1f')]==0x0){_0xa4d047=moment(_0x4da5ea[_0x4d75('0x2f')]);}else{_0xa4d047=moment()[_0x4d75('0x30')](_0x5f2fc5||0x3,_0x4d75('0x31'));}}if(_[_0x4d75('0x32')](_0xa4d047)){_0xa4d047=moment()[_0x4d75('0x30')](_0x5f2fc5||0x3,'minutes');}var _0x271032={'phone':_0x48559c[_0x4d75('0x33')],'active':0x0,'OrderBy':_[_0x4d75('0x32')](_0x48559c[_0x4d75('0x1f')])?0x0:_0x48559c[_0x4d75('0x1f')],'scheduledat':moment()[_0x4d75('0x30')](_0x308605||0x1,_0x4d75('0x31')),'countbusyretry':_0x4683a8[_0x4d75('0x20')],'countcongestionretry':_0x4683a8[_0x4d75('0x21')],'countnoanswerretry':_0x4683a8[_0x4d75('0x27')],'countnosuchnumberretry':_0x4683a8['countnosuchnumberretry'],'countdropretry':_0x4683a8['countdropretry'],'countabandonedretry':_0x4683a8[_0x4d75('0x23')],'countmachineretry':_0x4683a8[_0x4d75('0x24')],'countagentrejectretry':_0x4683a8[_0x4d75('0x25')],'createdAt':_0x4683a8['createdAt'],'updatedAt':_0x4683a8[_0x4d75('0x34')]};var _0x3cd3ba={'CmHopperId':_0x48559c['id'],'phone':_0x4da5ea[_0x4d75('0x33')],'active':0x0,'OrderBy':_[_0x4d75('0x32')](_0x4da5ea[_0x4d75('0x1f')])?0x0:_0x4da5ea[_0x4d75('0x1f')],'scheduledat':_0xa4d047,'countbusyretry':_0x4da5ea[_0x4d75('0x20')],'countcongestionretry':_0x4da5ea['countcongestionretry'],'countnoanswerretry':_0x4da5ea[_0x4d75('0x27')],'countnosuchnumberretry':_0x4da5ea[_0x4d75('0x28')],'countdropretry':_0x4da5ea[_0x4d75('0x22')],'countabandonedretry':_0x4da5ea[_0x4d75('0x23')],'countmachineretry':_0x4da5ea['countmachineretry'],'countagentrejectretry':_0x4da5ea[_0x4d75('0x25')],'createdAt':_0x4da5ea['createdAt'],'updatedAt':_0x4da5ea['updatedAt']};return db[_0x4d75('0x35')][_0x4d75('0x36')](function(_0x241d6c){return db[_0x4d75('0x1d')][_0x4d75('0x37')](_0x271032,{'where':{'id':_0x4da5ea['id']}},{'transaction':_0x241d6c})['then'](function(){return db[_0x4d75('0x16')][_0x4d75('0x37')](_0x3cd3ba,{'where':{'id':_0x48559c['id']}},{'transaction':_0x241d6c});});})[_0x4d75('0x1c')](function(_0x28f782){_0x2f87d6({'id':_0x48559c['id'],'phone':_0x4da5ea[_0x4d75('0x33')]});})[_0x4d75('0x15')](function(_0x566562){logger['error'](_0x4d75('0x38'),_0x566562['message']);_0x4e9e30({'error':_0x566562[_0x4d75('0x13')]});});});}exports[_0x4d75('0x39')]=function(_0x4ddfb3){var _0x2f0bd5=this;return new Promise(function(_0x1f8266,_0x53ddcc){return db[_0x4d75('0x16')][_0x4d75('0x37')](_0x4ddfb3['body'][_0x4d75('0x3a')],{'where':{'id':_0x4ddfb3[_0x4d75('0x17')]['id']}})[_0x4d75('0x1c')](function(_0x41ed4b){_0x1f8266(_0x41ed4b);})[_0x4d75('0x15')](function(_0xead7b9){logger['error']('IncrementPreviewCounters',_0xead7b9[_0x4d75('0x13')]);_0x53ddcc(_0x2f0bd5['error'](0x1f4,_0xead7b9['message']));});});}; \ No newline at end of file +var _0x7405=['countbusyretry','SwapAdditionalPhones','duration','waitTime','scheduledat','minutes','add','isNil','phone','createdAt','updatedAt','transaction','update','IncrementPreviewCounters','field','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/environment','client','http','request','info','CmHopperAdditionalPhone,\x20%s,\x20%s','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId','then','CmHopperAdditionalPhone','OrderBy','ASC','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry'];(function(_0x27b80c,_0x107e71){var _0x4cab2c=function(_0x3feb12){while(--_0x3feb12){_0x27b80c['push'](_0x27b80c['shift']());}};_0x4cab2c(++_0x107e71);}(_0x7405,0xb7));var _0x5740=function(_0x1b6311,_0x42ec20){_0x1b6311=_0x1b6311-0x0;var _0x25aab6=_0x7405[_0x1b6311];return _0x25aab6;};'use strict';var _=require(_0x5740('0x0'));var util=require(_0x5740('0x1'));var moment=require(_0x5740('0x2'));var BPromise=require('bluebird');var rs=require(_0x5740('0x3'));var fs=require('fs');var Redis=require(_0x5740('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5740('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x5740('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5740('0x7')][_0x5740('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x6952d1,_0x29bd5c,_0x2f6729){return new BPromise(function(_0x46e879,_0x3b0d27){return client[_0x5740('0x9')](_0x6952d1,_0x2f6729)['then'](function(_0x464f25){logger[_0x5740('0xa')](_0x5740('0xb'),_0x29bd5c,'request\x20sent');logger[_0x5740('0xc')](_0x5740('0xd'),_0x29bd5c,_0x5740('0xe'),JSON[_0x5740('0xf')](_0x464f25));if(_0x464f25['error']){if(_0x464f25[_0x5740('0x10')][_0x5740('0x11')]===0x1f4){logger[_0x5740('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x29bd5c,_0x464f25[_0x5740('0x10')]['message']);return _0x3b0d27(_0x464f25[_0x5740('0x10')][_0x5740('0x12')]);}logger[_0x5740('0x10')](_0x5740('0xb'),_0x29bd5c,_0x464f25['error'][_0x5740('0x12')]);return _0x46e879(_0x464f25[_0x5740('0x10')][_0x5740('0x12')]);}else{logger['info'](_0x5740('0xb'),_0x29bd5c,'request\x20sent');_0x46e879(_0x464f25['result'][_0x5740('0x12')]);}})[_0x5740('0x13')](function(_0x54af8a){logger['error'](_0x5740('0xb'),_0x29bd5c,_0x54af8a);_0x3b0d27(_0x54af8a);});});}exports[_0x5740('0x14')]=function(_0x20f031){var _0x873733=this;return new Promise(function(_0x53be76,_0x4d07ad){return db[_0x5740('0x15')][_0x5740('0x16')]({'raw':!![],'where':{'ContactId':_0x20f031[_0x5740('0x17')][_0x5740('0x18')],'ListId':_0x20f031['body'][_0x5740('0x19')],'VoiceQueueId':_0x20f031['body'][_0x5740('0x1a')]===undefined?null:_0x20f031[_0x5740('0x17')][_0x5740('0x1a')],'CampaignId':_0x20f031['body']['CampaignId']===undefined?null:_0x20f031['body'][_0x5740('0x1b')]}})[_0x5740('0x1c')](function(_0x16acfa){if(_0x16acfa!=null){return db[_0x5740('0x1d')][_0x5740('0x16')]({'raw':!![],'where':{'CmHopperId':_0x16acfa['id'],'OrderBy':{'$gt':_0x16acfa[_0x5740('0x1e')]}},'order':[[_0x5740('0x1e'),_0x5740('0x1f')]]})['then'](function(_0x2c9245){var _0x39fbb9=0x0;if(_0x2c9245){if(_0x2c9245['countbusyretry']+_0x2c9245[_0x5740('0x20')]+_0x2c9245[_0x5740('0x21')]+_0x2c9245[_0x5740('0x22')]+_0x2c9245[_0x5740('0x23')]+_0x2c9245[_0x5740('0x24')]+_0x2c9245[_0x5740('0x25')]+_0x2c9245[_0x5740('0x26')]<_0x20f031[_0x5740('0x27')][_0x5740('0x28')])_0x39fbb9=0x1;_0x53be76({'additional':_0x39fbb9});}else{return db[_0x5740('0x1d')][_0x5740('0x16')]({'raw':!![],'where':{'CmHopperId':_0x16acfa['id']},'order':[[_0x5740('0x1e'),'ASC']]})[_0x5740('0x1c')](function(_0x3a3358){var _0x49eaa2=0x0;if(_0x3a3358){if(_0x3a3358[_0x5740('0x29')]+_0x3a3358['countcongestionretry']+_0x3a3358['countnoanswerretry']+_0x3a3358[_0x5740('0x22')]+_0x3a3358[_0x5740('0x23')]+_0x3a3358[_0x5740('0x24')]+_0x3a3358[_0x5740('0x25')]+_0x3a3358['countagentrejectretry']<_0x20f031[_0x5740('0x27')]['dialGlobalMaxRetry'])_0x49eaa2=0x1;_0x53be76({'additional':_0x49eaa2});}else{_0x53be76({'additional':0x0});}})['catch'](function(_0x54c1ca){logger[_0x5740('0x10')](_0x5740('0x14'),_0x54c1ca[_0x5740('0x12')]);_0x4d07ad(_0x873733[_0x5740('0x10')](0x1f4,_0x54c1ca[_0x5740('0x12')]));});}})['catch'](function(_0x54a62d){logger[_0x5740('0x10')](_0x5740('0x14'),_0x54a62d[_0x5740('0x12')]);_0x4d07ad(_0x873733[_0x5740('0x10')](0x1f4,_0x54a62d[_0x5740('0x12')]));});}else _0x53be76({'additional':0x0});});});};exports[_0x5740('0x2a')]=function(_0x892e59){var _0x96c14=this;return new Promise(function(_0x8db521,_0xaa81cd){return db['CmHopper'][_0x5740('0x16')]({'raw':!![],'where':{'ContactId':_0x892e59[_0x5740('0x17')][_0x5740('0x18')],'ListId':_0x892e59['body']['ListId'],'VoiceQueueId':_0x892e59['body']['VoiceQueueId']===undefined?null:_0x892e59[_0x5740('0x17')][_0x5740('0x1a')],'CampaignId':_0x892e59[_0x5740('0x17')][_0x5740('0x1b')]===undefined?null:_0x892e59[_0x5740('0x17')]['CampaignId']}})['then'](function(_0x2ad735){if(_0x2ad735!=null){return db[_0x5740('0x1d')][_0x5740('0x16')]({'raw':!![],'where':{'CmHopperId':_0x2ad735['id'],'OrderBy':{'$gte':_0x2ad735[_0x5740('0x1e')]}},'order':[[_0x5740('0x1e'),'ASC']]})[_0x5740('0x1c')](function(_0x3cddd0){if(_0x3cddd0)return activateAdditionalPhone(_0x2ad735,_0x892e59[_0x5740('0x17')],_0x3cddd0,_0x892e59[_0x5740('0x2b')],_0x892e59[_0x5740('0x2c')])['then'](function(_0x585d27){_0x8db521(_0x585d27);});else{return db[_0x5740('0x1d')][_0x5740('0x16')]({'raw':!![],'where':{'CmHopperId':_0x2ad735['id']},'order':[['OrderBy','ASC']]})[_0x5740('0x1c')](function(_0x454eaf){if(_0x454eaf)return activateAdditionalPhone(_0x2ad735,_0x892e59[_0x5740('0x17')],_0x454eaf,_0x892e59[_0x5740('0x2b')],_0x892e59[_0x5740('0x2c')])[_0x5740('0x1c')](function(_0x1a0a80){_0x8db521(_0x1a0a80);});else{_0x8db521({'id':_0x2ad735['id'],'phone':''});}})[_0x5740('0x13')](function(_0x20f976){logger[_0x5740('0x10')](_0x5740('0x14'),_0x20f976[_0x5740('0x12')]);_0xaa81cd(_0x96c14['error'](0x1f4,_0x20f976[_0x5740('0x12')]));});}})[_0x5740('0x13')](function(_0x363283){logger[_0x5740('0x10')](_0x5740('0x14'),_0x363283[_0x5740('0x12')]);_0xaa81cd(_0x96c14['error'](0x1f4,_0x363283[_0x5740('0x12')]));});}else _0x8db521(0x1);});});};function activateAdditionalPhone(_0xb4b7f,_0x4c70db,_0x380a99,_0xf82afc,_0x30de79){return new Promise(function(_0x5c9027,_0xc2b45a){var _0x22ad5d;if(_['isNil'](_0x380a99[_0x5740('0x2d')])){_0x380a99['scheduledat']=moment();}if(moment()>moment(_0x380a99[_0x5740('0x2d')])){_0x22ad5d=moment()['add'](_0x30de79||0x3,_0x5740('0x2e'));}else{if(_0x380a99[_0x5740('0x1e')]==0x0){_0x22ad5d=moment(_0x380a99[_0x5740('0x2d')]);}else{_0x22ad5d=moment()[_0x5740('0x2f')](_0x30de79||0x3,_0x5740('0x2e'));}}if(_[_0x5740('0x30')](_0x22ad5d)){_0x22ad5d=moment()[_0x5740('0x2f')](_0x30de79||0x3,_0x5740('0x2e'));}var _0x3d5efb={'phone':_0xb4b7f[_0x5740('0x31')],'active':0x0,'OrderBy':_['isNil'](_0xb4b7f['OrderBy'])?0x0:_0xb4b7f['OrderBy'],'scheduledat':moment()[_0x5740('0x2f')](_0xf82afc||0x1,_0x5740('0x2e')),'countbusyretry':_0x4c70db['countbusyretry'],'countcongestionretry':_0x4c70db[_0x5740('0x20')],'countnoanswerretry':_0x4c70db['countnoanswerretry'],'countnosuchnumberretry':_0x4c70db['countnosuchnumberretry'],'countdropretry':_0x4c70db[_0x5740('0x23')],'countabandonedretry':_0x4c70db[_0x5740('0x24')],'countmachineretry':_0x4c70db[_0x5740('0x25')],'countagentrejectretry':_0x4c70db[_0x5740('0x26')],'createdAt':_0x4c70db[_0x5740('0x32')],'updatedAt':_0x4c70db[_0x5740('0x33')]};var _0x458b84={'CmHopperId':_0xb4b7f['id'],'phone':_0x380a99[_0x5740('0x31')],'active':0x0,'OrderBy':_['isNil'](_0x380a99[_0x5740('0x1e')])?0x0:_0x380a99[_0x5740('0x1e')],'scheduledat':_0x22ad5d,'countbusyretry':_0x380a99[_0x5740('0x29')],'countcongestionretry':_0x380a99['countcongestionretry'],'countnoanswerretry':_0x380a99['countnoanswerretry'],'countnosuchnumberretry':_0x380a99['countnosuchnumberretry'],'countdropretry':_0x380a99[_0x5740('0x23')],'countabandonedretry':_0x380a99[_0x5740('0x24')],'countmachineretry':_0x380a99['countmachineretry'],'countagentrejectretry':_0x380a99['countagentrejectretry'],'createdAt':_0x380a99[_0x5740('0x32')],'updatedAt':_0x380a99[_0x5740('0x33')]};return db['sequelize'][_0x5740('0x34')](function(_0x299c9e){return db[_0x5740('0x1d')][_0x5740('0x35')](_0x3d5efb,{'where':{'id':_0x380a99['id']}},{'transaction':_0x299c9e})[_0x5740('0x1c')](function(){return db['CmHopper'][_0x5740('0x35')](_0x458b84,{'where':{'id':_0xb4b7f['id']}},{'transaction':_0x299c9e});});})[_0x5740('0x1c')](function(_0xebc858){_0x5c9027({'id':_0xb4b7f['id'],'phone':_0x380a99[_0x5740('0x31')]});})[_0x5740('0x13')](function(_0x5f0e62){logger[_0x5740('0x10')]('activateAdditionalPhone',_0x5f0e62[_0x5740('0x12')]);_0xc2b45a({'error':_0x5f0e62[_0x5740('0x12')]});});});}exports[_0x5740('0x36')]=function(_0x29406c){var _0x4b0b86=this;return new Promise(function(_0x20a307,_0x149c60){return db['CmHopper']['update'](_0x29406c[_0x5740('0x17')][_0x5740('0x37')],{'where':{'id':_0x29406c[_0x5740('0x17')]['id']}})[_0x5740('0x1c')](function(_0x38c975){_0x20a307(_0x38c975);})[_0x5740('0x13')](function(_0x15653a){logger[_0x5740('0x10')]('IncrementPreviewCounters',_0x15653a[_0x5740('0x12')]);_0x149c60(_0x4b0b86[_0x5740('0x10')](0x1f4,_0x15653a[_0x5740('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index bc54729..2fa3438 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2412=['update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','post','put'];(function(_0x2d204d,_0x121ae3){var _0x458951=function(_0x295b09){while(--_0x295b09){_0x2d204d['push'](_0x2d204d['shift']());}};_0x458951(++_0x121ae3);}(_0x2412,0xa6));var _0x2241=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2412[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2241('0x0'));var timeout=require(_0x2241('0x1'));var express=require(_0x2241('0x2'));var router=express[_0x2241('0x3')]();var fs_extra=require(_0x2241('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2241('0x5'));var config=require('../../config/environment');var controller=require(_0x2241('0x6'));router[_0x2241('0x7')]('/',auth[_0x2241('0x8')](),controller[_0x2241('0x9')]);router[_0x2241('0x7')](_0x2241('0xa'),auth[_0x2241('0x8')](),controller[_0x2241('0xb')]);router[_0x2241('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2241('0xd')](_0x2241('0xa'),auth[_0x2241('0x8')](),controller[_0x2241('0xe')]);router[_0x2241('0xf')](_0x2241('0xa'),auth[_0x2241('0x8')](),controller[_0x2241('0x10')]);module[_0x2241('0x11')]=router; \ No newline at end of file +var _0x421e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0xa267d,_0x13b6e7){var _0x39898a=function(_0x1626a8){while(--_0x1626a8){_0xa267d['push'](_0xa267d['shift']());}};_0x39898a(++_0x13b6e7);}(_0x421e,0x1a1));var _0xe421=function(_0x7ad123,_0xeeeef3){_0x7ad123=_0x7ad123-0x0;var _0x37d073=_0x421e[_0x7ad123];return _0x37d073;};'use strict';var multer=require('multer');var util=require(_0xe421('0x0'));var path=require(_0xe421('0x1'));var timeout=require(_0xe421('0x2'));var express=require(_0xe421('0x3'));var router=express[_0xe421('0x4')]();var fs_extra=require(_0xe421('0x5'));var auth=require(_0xe421('0x6'));var interaction=require(_0xe421('0x7'));var config=require(_0xe421('0x8'));var controller=require(_0xe421('0x9'));router[_0xe421('0xa')]('/',auth[_0xe421('0xb')](),controller[_0xe421('0xc')]);router[_0xe421('0xa')](_0xe421('0xd'),auth['isAuthenticated'](),controller[_0xe421('0xe')]);router['post']('/',auth[_0xe421('0xb')](),controller[_0xe421('0xf')]);router[_0xe421('0x10')](_0xe421('0xd'),auth['isAuthenticated'](),controller[_0xe421('0x11')]);router[_0xe421('0x12')]('/:id',auth[_0xe421('0xb')](),controller[_0xe421('0x13')]);module[_0xe421('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 1d22cc9..4b7d66c 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 _0x82f8=['exports','INTEGER','contactListQueue','sequelize'];(function(_0x289212,_0x390ce4){var _0xe16322=function(_0x12b805){while(--_0x12b805){_0x289212['push'](_0x289212['shift']());}};_0xe16322(++_0x390ce4);}(_0x82f8,0x157));var _0x882f=function(_0x3f9094,_0x30e9f9){_0x3f9094=_0x3f9094-0x0;var _0x355639=_0x82f8[_0x3f9094];return _0x355639;};'use strict';var moment=require('moment');var Sequelize=require(_0x882f('0x0'));module[_0x882f('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x882f('0x2')],'unique':_0x882f('0x3')},'ListId':{'type':Sequelize[_0x882f('0x2')],'unique':_0x882f('0x3')},'VoiceQueueId':{'type':Sequelize[_0x882f('0x2')],'unique':_0x882f('0x3')}}; \ No newline at end of file +var _0x3d30=['contactListQueue','exports','INTEGER'];(function(_0x4089af,_0x392728){var _0x411ad8=function(_0x39d2f6){while(--_0x39d2f6){_0x4089af['push'](_0x4089af['shift']());}};_0x411ad8(++_0x392728);}(_0x3d30,0x6a));var _0x03d3=function(_0x4d5488,_0x3f5190){_0x4d5488=_0x4d5488-0x0;var _0x4d2d3e=_0x3d30[_0x4d5488];return _0x4d2d3e;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x03d3('0x0')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x03d3('0x1')],'unique':'contactListQueue'},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x03d3('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x03d3('0x2')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index dc60bbf..f5dbd31 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 _0xfb19=['send','index','model','map','query','fields','attributes','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','CmHopperBlack','includeAll','include','findAll','rows','show','params','keys','intersection','length','find','catch','body','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','json','offset','limit','count','set','reject','save','update','then','destroy','sendStatus','error','name'];(function(_0x5019af,_0x2daaef){var _0x51c0b1=function(_0x2ea3c1){while(--_0x2ea3c1){_0x5019af['push'](_0x5019af['shift']());}};_0x51c0b1(++_0x2daaef);}(_0xfb19,0x1b7));var _0x9fb1=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xfb19[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x9fb1('0x0'));var rimraf=require(_0x9fb1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9fb1('0x2'));var rp=require('request-promise');var moment=require(_0x9fb1('0x3'));var BPromise=require(_0x9fb1('0x4'));var Mustache=require(_0x9fb1('0x5'));var util=require(_0x9fb1('0x6'));var path=require(_0x9fb1('0x7'));var sox=require(_0x9fb1('0x8'));var csv=require(_0x9fb1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9fb1('0xa'));var squel=require(_0x9fb1('0xb'));var crypto=require(_0x9fb1('0xc'));var jsforce=require(_0x9fb1('0xd'));var deskjs=require(_0x9fb1('0xe'));var toCsv=require(_0x9fb1('0x9'));var querystring=require('querystring');var Papa=require(_0x9fb1('0xf'));var Redis=require(_0x9fb1('0x10'));var authService=require(_0x9fb1('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9fb1('0x12'));var logger=require(_0x9fb1('0x13'))(_0x9fb1('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x9fb1('0x15'));var db=require(_0x9fb1('0x16'))['db'];function respondWithStatusCode(_0x5216d1,_0x52edc1){_0x52edc1=_0x52edc1||0xcc;return function(_0x4e841e){if(_0x4e841e){return _0x5216d1['sendStatus'](_0x52edc1);}return _0x5216d1[_0x9fb1('0x17')](_0x52edc1)['end']();};}function respondWithResult(_0x5d5c84,_0x3d5e1a){_0x3d5e1a=_0x3d5e1a||0xc8;return function(_0x5b8d50){if(_0x5b8d50){return _0x5d5c84[_0x9fb1('0x17')](_0x3d5e1a)[_0x9fb1('0x18')](_0x5b8d50);}};}function respondWithFilteredResult(_0x180107,_0x412d84){return function(_0x3a5cad){if(_0x3a5cad){var _0x20e9fd=typeof _0x412d84[_0x9fb1('0x19')]==='undefined'&&typeof _0x412d84[_0x9fb1('0x1a')]==='undefined';var _0x54c28e=_0x3a5cad[_0x9fb1('0x1b')];var _0x41fea2=_0x20e9fd?0x0:_0x412d84['offset'];var _0x209cd7=_0x20e9fd?_0x3a5cad[_0x9fb1('0x1b')]:_0x412d84[_0x9fb1('0x19')]+_0x412d84[_0x9fb1('0x1a')];var _0x5abb02;if(_0x209cd7>=_0x54c28e){_0x209cd7=_0x54c28e;_0x5abb02=0xc8;}else{_0x5abb02=0xce;}_0x180107[_0x9fb1('0x17')](_0x5abb02);return _0x180107[_0x9fb1('0x1c')]('Content-Range',_0x41fea2+'-'+_0x209cd7+'/'+_0x54c28e)[_0x9fb1('0x18')](_0x3a5cad);}return null;};}function patchUpdates(_0xd9df65){return function(_0x597baa){try{jsonpatch['apply'](_0x597baa,_0xd9df65,!![]);}catch(_0x25982a){return BPromise[_0x9fb1('0x1d')](_0x25982a);}return _0x597baa[_0x9fb1('0x1e')]();};}function saveUpdates(_0x4410c0,_0x35c78b){return function(_0x4c694f){if(_0x4c694f){return _0x4c694f[_0x9fb1('0x1f')](_0x4410c0)[_0x9fb1('0x20')](function(_0x3d5443){return _0x3d5443;});}return null;};}function removeEntity(_0x2df213,_0x57e2da){return function(_0x3a90e9){if(_0x3a90e9){return _0x3a90e9[_0x9fb1('0x21')]()[_0x9fb1('0x20')](function(){_0x2df213['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a1c4e,_0x2eef8a){return function(_0x3faf9c){if(!_0x3faf9c){_0x4a1c4e[_0x9fb1('0x22')](0x194);}return _0x3faf9c;};}function handleError(_0x17127e,_0x27ad89){_0x27ad89=_0x27ad89||0x1f4;return function(_0x1b36d9){logger[_0x9fb1('0x23')](_0x1b36d9['stack']);if(_0x1b36d9[_0x9fb1('0x24')]){delete _0x1b36d9[_0x9fb1('0x24')];}_0x17127e[_0x9fb1('0x17')](_0x27ad89)[_0x9fb1('0x25')](_0x1b36d9);};}exports[_0x9fb1('0x26')]=function(_0x1706bc,_0x84eb2c){var _0x4c010e={},_0x327b2b={},_0x5822ad={'count':0x0,'rows':[]};var _0xe2f1bf=_['map'](db['CmHopperBlack']['rawAttributes'],function(_0xa444d5){return{'name':_0xa444d5['fieldName'],'type':_0xa444d5['type']['key']};});_0x327b2b[_0x9fb1('0x27')]=_[_0x9fb1('0x28')](_0xe2f1bf,_0x9fb1('0x24'));_0x327b2b[_0x9fb1('0x29')]=_['keys'](_0x1706bc[_0x9fb1('0x29')]);_0x327b2b['filters']=_['intersection'](_0x327b2b[_0x9fb1('0x27')],_0x327b2b[_0x9fb1('0x29')]);_0x4c010e['attributes']=_['intersection'](_0x327b2b[_0x9fb1('0x27')],qs[_0x9fb1('0x2a')](_0x1706bc[_0x9fb1('0x29')][_0x9fb1('0x2a')]));_0x4c010e[_0x9fb1('0x2b')]=_0x4c010e[_0x9fb1('0x2b')]['length']?_0x4c010e[_0x9fb1('0x2b')]:_0x327b2b[_0x9fb1('0x27')];if(!_0x1706bc[_0x9fb1('0x29')]['hasOwnProperty'](_0x9fb1('0x2c'))){_0x4c010e[_0x9fb1('0x1a')]=qs[_0x9fb1('0x1a')](_0x1706bc[_0x9fb1('0x29')][_0x9fb1('0x1a')]);_0x4c010e[_0x9fb1('0x19')]=qs[_0x9fb1('0x19')](_0x1706bc[_0x9fb1('0x29')][_0x9fb1('0x19')]);}_0x4c010e[_0x9fb1('0x2d')]=qs[_0x9fb1('0x2e')](_0x1706bc['query'][_0x9fb1('0x2e')]);_0x4c010e[_0x9fb1('0x2f')]=qs[_0x9fb1('0x30')](_[_0x9fb1('0x31')](_0x1706bc['query'],_0x327b2b[_0x9fb1('0x30')]),_0xe2f1bf);if(_0x1706bc['query'][_0x9fb1('0x32')]){_0x4c010e['where']=_[_0x9fb1('0x33')](_0x4c010e[_0x9fb1('0x2f')],{'$or':_['map'](_0xe2f1bf,function(_0x49832d){if(_0x49832d['type']!==_0x9fb1('0x34')){var _0x1071ce={};_0x1071ce[_0x49832d[_0x9fb1('0x24')]]={'$like':'%'+_0x1706bc[_0x9fb1('0x29')][_0x9fb1('0x32')]+'%'};return _0x1071ce;}})});}_0x4c010e=_[_0x9fb1('0x33')]({},_0x4c010e,_0x1706bc[_0x9fb1('0x35')]);var _0x212638={'where':_0x4c010e[_0x9fb1('0x2f')]};return db[_0x9fb1('0x36')]['count'](_0x212638)['then'](function(_0x364160){_0x5822ad[_0x9fb1('0x1b')]=_0x364160;if(_0x1706bc[_0x9fb1('0x29')][_0x9fb1('0x37')]){_0x4c010e[_0x9fb1('0x38')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x9fb1('0x39')](_0x4c010e);})[_0x9fb1('0x20')](function(_0x45b456){_0x5822ad[_0x9fb1('0x3a')]=_0x45b456;return _0x5822ad;})[_0x9fb1('0x20')](respondWithFilteredResult(_0x84eb2c,_0x4c010e))['catch'](handleError(_0x84eb2c,null));};exports[_0x9fb1('0x3b')]=function(_0x1998ea,_0x461131){var _0x121466={'raw':!![],'where':{'id':_0x1998ea[_0x9fb1('0x3c')]['id']}},_0x15c46e={};_0x15c46e[_0x9fb1('0x27')]=_[_0x9fb1('0x3d')](db[_0x9fb1('0x36')]['rawAttributes']);_0x15c46e['query']=_[_0x9fb1('0x3d')](_0x1998ea[_0x9fb1('0x29')]);_0x15c46e[_0x9fb1('0x30')]=_[_0x9fb1('0x3e')](_0x15c46e[_0x9fb1('0x27')],_0x15c46e[_0x9fb1('0x29')]);_0x121466[_0x9fb1('0x2b')]=_[_0x9fb1('0x3e')](_0x15c46e[_0x9fb1('0x27')],qs[_0x9fb1('0x2a')](_0x1998ea[_0x9fb1('0x29')]['fields']));_0x121466[_0x9fb1('0x2b')]=_0x121466[_0x9fb1('0x2b')][_0x9fb1('0x3f')]?_0x121466[_0x9fb1('0x2b')]:_0x15c46e['model'];if(_0x1998ea[_0x9fb1('0x29')][_0x9fb1('0x37')]){_0x121466['include']=[{'all':!![]}];}_0x121466=_[_0x9fb1('0x33')]({},_0x121466,_0x1998ea['options']);return db[_0x9fb1('0x36')][_0x9fb1('0x40')](_0x121466)[_0x9fb1('0x20')](handleEntityNotFound(_0x461131,null))[_0x9fb1('0x20')](respondWithResult(_0x461131,null))[_0x9fb1('0x41')](handleError(_0x461131,null));};exports[_0x9fb1('0x1f')]=function(_0x5b52fa,_0x39352d){if(_0x5b52fa[_0x9fb1('0x42')]['id']){delete _0x5b52fa['body']['id'];}return db[_0x9fb1('0x36')]['find']({'where':{'id':_0x5b52fa[_0x9fb1('0x3c')]['id']}})['then'](handleEntityNotFound(_0x39352d,null))[_0x9fb1('0x20')](saveUpdates(_0x5b52fa[_0x9fb1('0x42')],null))[_0x9fb1('0x20')](respondWithResult(_0x39352d,null))['catch'](handleError(_0x39352d,null));};exports[_0x9fb1('0x21')]=function(_0x293708,_0x2fb043){return db[_0x9fb1('0x36')][_0x9fb1('0x40')]({'where':{'id':_0x293708[_0x9fb1('0x3c')]['id']}})[_0x9fb1('0x20')](handleEntityNotFound(_0x2fb043,null))[_0x9fb1('0x20')](removeEntity(_0x2fb043,null))[_0x9fb1('0x41')](handleError(_0x2fb043,null));};exports[_0x9fb1('0x43')]=function(_0x58e19d,_0x1bc7b6){return db[_0x9fb1('0x36')]['describe']()[_0x9fb1('0x20')](respondWithResult(_0x1bc7b6,null))[_0x9fb1('0x41')](handleError(_0x1bc7b6,null));}; \ No newline at end of file +var _0x0cde=['undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','CmHopperBlack','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','params','keys','rawAttributes','catch','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','sendStatus','status','json'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x0cde,0x1df));var _0xe0cd=function(_0x43b6e9,_0x817765){_0x43b6e9=_0x43b6e9-0x0;var _0x46e8d5=_0x0cde[_0x43b6e9];return _0x46e8d5;};'use strict';var emlformat=require(_0xe0cd('0x0'));var rimraf=require(_0xe0cd('0x1'));var zipdir=require(_0xe0cd('0x2'));var jsonpatch=require(_0xe0cd('0x3'));var rp=require(_0xe0cd('0x4'));var moment=require(_0xe0cd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe0cd('0x6'));var util=require(_0xe0cd('0x7'));var path=require('path');var sox=require(_0xe0cd('0x8'));var csv=require('to-csv');var ejs=require(_0xe0cd('0x9'));var fs=require('fs');var fs_extra=require(_0xe0cd('0xa'));var _=require('lodash');var squel=require(_0xe0cd('0xb'));var crypto=require('crypto');var jsforce=require(_0xe0cd('0xc'));var deskjs=require(_0xe0cd('0xd'));var toCsv=require(_0xe0cd('0xe'));var querystring=require(_0xe0cd('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0cd('0x10'));var authService=require(_0xe0cd('0x11'));var qs=require(_0xe0cd('0x12'));var as=require(_0xe0cd('0x13'));var hardwareService=require(_0xe0cd('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe0cd('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x213f8b,_0x3a5225){_0x3a5225=_0x3a5225||0xcc;return function(_0x1fbe28){if(_0x1fbe28){return _0x213f8b[_0xe0cd('0x16')](_0x3a5225);}return _0x213f8b[_0xe0cd('0x17')](_0x3a5225)['end']();};}function respondWithResult(_0x4fb035,_0x5c1e6b){_0x5c1e6b=_0x5c1e6b||0xc8;return function(_0x5d8ccf){if(_0x5d8ccf){return _0x4fb035[_0xe0cd('0x17')](_0x5c1e6b)[_0xe0cd('0x18')](_0x5d8ccf);}};}function respondWithFilteredResult(_0x5409e6,_0x131719){return function(_0x4fb2a8){if(_0x4fb2a8){var _0x544fa3=typeof _0x131719['offset']===_0xe0cd('0x19')&&typeof _0x131719[_0xe0cd('0x1a')]===_0xe0cd('0x19');var _0x23b391=_0x4fb2a8[_0xe0cd('0x1b')];var _0x2a617d=_0x544fa3?0x0:_0x131719[_0xe0cd('0x1c')];var _0x55a0a5=_0x544fa3?_0x4fb2a8['count']:_0x131719[_0xe0cd('0x1c')]+_0x131719[_0xe0cd('0x1a')];var _0x3f66ae;if(_0x55a0a5>=_0x23b391){_0x55a0a5=_0x23b391;_0x3f66ae=0xc8;}else{_0x3f66ae=0xce;}_0x5409e6['status'](_0x3f66ae);return _0x5409e6[_0xe0cd('0x1d')](_0xe0cd('0x1e'),_0x2a617d+'-'+_0x55a0a5+'/'+_0x23b391)[_0xe0cd('0x18')](_0x4fb2a8);}return null;};}function patchUpdates(_0x50282b){return function(_0xa12945){try{jsonpatch[_0xe0cd('0x1f')](_0xa12945,_0x50282b,!![]);}catch(_0x4b4f7e){return BPromise[_0xe0cd('0x20')](_0x4b4f7e);}return _0xa12945[_0xe0cd('0x21')]();};}function saveUpdates(_0x170957,_0x248621){return function(_0x1705b2){if(_0x1705b2){return _0x1705b2[_0xe0cd('0x22')](_0x170957)[_0xe0cd('0x23')](function(_0xc13a86){return _0xc13a86;});}return null;};}function removeEntity(_0x5f1506,_0x93f876){return function(_0x28b69e){if(_0x28b69e){return _0x28b69e[_0xe0cd('0x24')]()[_0xe0cd('0x23')](function(){_0x5f1506[_0xe0cd('0x17')](0xcc)[_0xe0cd('0x25')]();});}};}function handleEntityNotFound(_0x381790,_0x33c90e){return function(_0x5783a4){if(!_0x5783a4){_0x381790['sendStatus'](0x194);}return _0x5783a4;};}function handleError(_0x3e6075,_0x4716e2){_0x4716e2=_0x4716e2||0x1f4;return function(_0x32ef6b){logger[_0xe0cd('0x26')](_0x32ef6b[_0xe0cd('0x27')]);if(_0x32ef6b[_0xe0cd('0x28')]){delete _0x32ef6b[_0xe0cd('0x28')];}_0x3e6075[_0xe0cd('0x17')](_0x4716e2)[_0xe0cd('0x29')](_0x32ef6b);};}exports[_0xe0cd('0x2a')]=function(_0x54628e,_0x153ce7){var _0x18241f={},_0x29f3d1={},_0x29186d={'count':0x0,'rows':[]};var _0x256735=_[_0xe0cd('0x2b')](db[_0xe0cd('0x2c')]['rawAttributes'],function(_0xfa3599){return{'name':_0xfa3599[_0xe0cd('0x2d')],'type':_0xfa3599[_0xe0cd('0x2e')]['key']};});_0x29f3d1['model']=_[_0xe0cd('0x2b')](_0x256735,_0xe0cd('0x28'));_0x29f3d1[_0xe0cd('0x2f')]=_['keys'](_0x54628e[_0xe0cd('0x2f')]);_0x29f3d1[_0xe0cd('0x30')]=_[_0xe0cd('0x31')](_0x29f3d1[_0xe0cd('0x32')],_0x29f3d1['query']);_0x18241f[_0xe0cd('0x33')]=_['intersection'](_0x29f3d1[_0xe0cd('0x32')],qs[_0xe0cd('0x34')](_0x54628e[_0xe0cd('0x2f')][_0xe0cd('0x34')]));_0x18241f[_0xe0cd('0x33')]=_0x18241f[_0xe0cd('0x33')][_0xe0cd('0x35')]?_0x18241f[_0xe0cd('0x33')]:_0x29f3d1[_0xe0cd('0x32')];if(!_0x54628e['query'][_0xe0cd('0x36')]('nolimit')){_0x18241f[_0xe0cd('0x1a')]=qs['limit'](_0x54628e[_0xe0cd('0x2f')]['limit']);_0x18241f['offset']=qs[_0xe0cd('0x1c')](_0x54628e[_0xe0cd('0x2f')][_0xe0cd('0x1c')]);}_0x18241f[_0xe0cd('0x37')]=qs[_0xe0cd('0x38')](_0x54628e[_0xe0cd('0x2f')][_0xe0cd('0x38')]);_0x18241f[_0xe0cd('0x39')]=qs[_0xe0cd('0x30')](_[_0xe0cd('0x3a')](_0x54628e['query'],_0x29f3d1[_0xe0cd('0x30')]),_0x256735);if(_0x54628e[_0xe0cd('0x2f')][_0xe0cd('0x3b')]){_0x18241f[_0xe0cd('0x39')]=_[_0xe0cd('0x3c')](_0x18241f[_0xe0cd('0x39')],{'$or':_[_0xe0cd('0x2b')](_0x256735,function(_0x10f384){if(_0x10f384[_0xe0cd('0x2e')]!==_0xe0cd('0x3d')){var _0x3dc521={};_0x3dc521[_0x10f384['name']]={'$like':'%'+_0x54628e[_0xe0cd('0x2f')][_0xe0cd('0x3b')]+'%'};return _0x3dc521;}})});}_0x18241f=_[_0xe0cd('0x3c')]({},_0x18241f,_0x54628e[_0xe0cd('0x3e')]);var _0x375ce6={'where':_0x18241f[_0xe0cd('0x39')]};return db[_0xe0cd('0x2c')][_0xe0cd('0x1b')](_0x375ce6)[_0xe0cd('0x23')](function(_0x1d7d97){_0x29186d[_0xe0cd('0x1b')]=_0x1d7d97;if(_0x54628e['query']['includeAll']){_0x18241f[_0xe0cd('0x3f')]=[{'all':!![]}];}return db[_0xe0cd('0x2c')][_0xe0cd('0x40')](_0x18241f);})[_0xe0cd('0x23')](function(_0xe1995){_0x29186d['rows']=_0xe1995;return _0x29186d;})[_0xe0cd('0x23')](respondWithFilteredResult(_0x153ce7,_0x18241f))['catch'](handleError(_0x153ce7,null));};exports['show']=function(_0xb7c91e,_0x2e2156){var _0x113aa1={'raw':!![],'where':{'id':_0xb7c91e[_0xe0cd('0x41')]['id']}},_0x127768={};_0x127768[_0xe0cd('0x32')]=_[_0xe0cd('0x42')](db['CmHopperBlack'][_0xe0cd('0x43')]);_0x127768[_0xe0cd('0x2f')]=_[_0xe0cd('0x42')](_0xb7c91e['query']);_0x127768[_0xe0cd('0x30')]=_['intersection'](_0x127768['model'],_0x127768[_0xe0cd('0x2f')]);_0x113aa1['attributes']=_['intersection'](_0x127768[_0xe0cd('0x32')],qs[_0xe0cd('0x34')](_0xb7c91e[_0xe0cd('0x2f')][_0xe0cd('0x34')]));_0x113aa1['attributes']=_0x113aa1[_0xe0cd('0x33')][_0xe0cd('0x35')]?_0x113aa1['attributes']:_0x127768[_0xe0cd('0x32')];if(_0xb7c91e[_0xe0cd('0x2f')]['includeAll']){_0x113aa1[_0xe0cd('0x3f')]=[{'all':!![]}];}_0x113aa1=_[_0xe0cd('0x3c')]({},_0x113aa1,_0xb7c91e['options']);return db[_0xe0cd('0x2c')]['find'](_0x113aa1)['then'](handleEntityNotFound(_0x2e2156,null))[_0xe0cd('0x23')](respondWithResult(_0x2e2156,null))[_0xe0cd('0x44')](handleError(_0x2e2156,null));};exports[_0xe0cd('0x22')]=function(_0x21c6f5,_0x402f23){if(_0x21c6f5[_0xe0cd('0x45')]['id']){delete _0x21c6f5[_0xe0cd('0x45')]['id'];}return db['CmHopperBlack'][_0xe0cd('0x46')]({'where':{'id':_0x21c6f5[_0xe0cd('0x41')]['id']}})[_0xe0cd('0x23')](handleEntityNotFound(_0x402f23,null))[_0xe0cd('0x23')](saveUpdates(_0x21c6f5[_0xe0cd('0x45')],null))[_0xe0cd('0x23')](respondWithResult(_0x402f23,null))[_0xe0cd('0x44')](handleError(_0x402f23,null));};exports[_0xe0cd('0x24')]=function(_0x5b9f02,_0x45c5ca){return db[_0xe0cd('0x2c')][_0xe0cd('0x46')]({'where':{'id':_0x5b9f02[_0xe0cd('0x41')]['id']}})['then'](handleEntityNotFound(_0x45c5ca,null))[_0xe0cd('0x23')](removeEntity(_0x45c5ca,null))[_0xe0cd('0x44')](handleError(_0x45c5ca,null));};exports[_0xe0cd('0x47')]=function(_0x397c13,_0x17f3fc){return db[_0xe0cd('0x2c')][_0xe0cd('0x47')]()['then'](respondWithResult(_0x17f3fc,null))['catch'](handleError(_0x17f3fc,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 0dafa21..ffb8f87 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 _0x47a8=['define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports'];(function(_0x1eaaf6,_0x24255e){var _0x5f4ce4=function(_0x497b73){while(--_0x497b73){_0x1eaaf6['push'](_0x1eaaf6['shift']());}};_0x5f4ce4(++_0x24255e);}(_0x47a8,0x1a7));var _0x847a=function(_0xa5e28e,_0x343827){_0xa5e28e=_0xa5e28e-0x0;var _0x49f20d=_0x47a8[_0xa5e28e];return _0x49f20d;};'use strict';var _=require(_0x847a('0x0'));var util=require(_0x847a('0x1'));var logger=require(_0x847a('0x2'))(_0x847a('0x3'));var moment=require(_0x847a('0x4'));var BPromise=require(_0x847a('0x5'));var rp=require(_0x847a('0x6'));var fs=require('fs');var path=require(_0x847a('0x7'));var rimraf=require(_0x847a('0x8'));var config=require(_0x847a('0x9'));var attributes=require(_0x847a('0xa'));module[_0x847a('0xb')]=function(_0x1ad579,_0x2b577b){return _0x1ad579[_0x847a('0xc')](_0x847a('0xd'),attributes,{'tableName':_0x847a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd38c=['path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1661f8,_0x3408e4){var _0x17ed20=function(_0x485964){while(--_0x485964){_0x1661f8['push'](_0x1661f8['shift']());}};_0x17ed20(++_0x3408e4);}(_0xd38c,0x166));var _0xcd38=function(_0xf8d01a,_0x2b713d){_0xf8d01a=_0xf8d01a-0x0;var _0x4d048d=_0xd38c[_0xf8d01a];return _0x4d048d;};'use strict';var _=require(_0xcd38('0x0'));var util=require('util');var logger=require(_0xcd38('0x1'))(_0xcd38('0x2'));var moment=require(_0xcd38('0x3'));var BPromise=require(_0xcd38('0x4'));var rp=require(_0xcd38('0x5'));var fs=require('fs');var path=require(_0xcd38('0x6'));var rimraf=require(_0xcd38('0x7'));var config=require(_0xcd38('0x8'));var attributes=require(_0xcd38('0x9'));module[_0xcd38('0xa')]=function(_0x360750,_0x52e0dd){return _0x360750[_0xcd38('0xb')](_0xcd38('0xc'),attributes,{'tableName':_0xcd38('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 432da70..d51f66f 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 _0xd313=['request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetCmHopperBlack','CmHopperBlack','raw','options','where','attributes','include','map','model','then','stringify','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','CmHopperBlack,\x20%s,\x20%s'];(function(_0x5bdfb2,_0x5eeb10){var _0x5f5240=function(_0x2cb9c6){while(--_0x2cb9c6){_0x5bdfb2['push'](_0x5bdfb2['shift']());}};_0x5f5240(++_0x5eeb10);}(_0xd313,0xd0));var _0x3d31=function(_0x10478d,_0x222fa){_0x10478d=_0x10478d-0x0;var _0x4a8484=_0xd313[_0x10478d];return _0x4a8484;};'use strict';var _=require(_0x3d31('0x0'));var util=require(_0x3d31('0x1'));var moment=require('moment');var BPromise=require(_0x3d31('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d31('0x3'));var db=require(_0x3d31('0x4'))['db'];var utils=require(_0x3d31('0x5'));var logger=require(_0x3d31('0x6'))(_0x3d31('0x7'));var config=require(_0x3d31('0x8'));var jayson=require(_0x3d31('0x9'));var client=jayson['client'][_0x3d31('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf526c5,_0x28c77a,_0x997447){return new BPromise(function(_0x3c1b13,_0x305a77){return client[_0x3d31('0xb')](_0xf526c5,_0x997447)['then'](function(_0x54973b){logger[_0x3d31('0xc')](_0x3d31('0xd'),_0x28c77a,_0x3d31('0xe'));logger[_0x3d31('0xf')](_0x3d31('0x10'),_0x28c77a,'request\x20sent',JSON['stringify'](_0x54973b));if(_0x54973b[_0x3d31('0x11')]){if(_0x54973b[_0x3d31('0x11')][_0x3d31('0x12')]===0x1f4){logger['error'](_0x3d31('0xd'),_0x28c77a,_0x54973b['error'][_0x3d31('0x13')]);return _0x305a77(_0x54973b[_0x3d31('0x11')][_0x3d31('0x13')]);}logger[_0x3d31('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x28c77a,_0x54973b['error'][_0x3d31('0x13')]);return _0x3c1b13(_0x54973b['error'][_0x3d31('0x13')]);}else{logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x28c77a,'request\x20sent');_0x3c1b13(_0x54973b['result']['message']);}})[_0x3d31('0x14')](function(_0x2e564a){logger['error']('CmHopperBlack,\x20%s,\x20%s',_0x28c77a,_0x2e564a);_0x305a77(_0x2e564a);});});}exports[_0x3d31('0x15')]=function(_0x54986c){var _0x3de0bf=this;return new Promise(function(_0x45081e,_0xb5ed32){return db[_0x3d31('0x16')]['findAll']({'raw':_0x54986c['options']?_0x54986c['options'][_0x3d31('0x17')]===undefined?!![]:![]:!![],'where':_0x54986c[_0x3d31('0x18')]?_0x54986c[_0x3d31('0x18')][_0x3d31('0x19')]||null:null,'attributes':_0x54986c['options']?_0x54986c[_0x3d31('0x18')][_0x3d31('0x1a')]||null:null,'limit':_0x54986c[_0x3d31('0x18')]?_0x54986c['options']['limit']||null:null,'include':_0x54986c[_0x3d31('0x18')]?_0x54986c[_0x3d31('0x18')][_0x3d31('0x1b')]?_[_0x3d31('0x1c')](_0x54986c['options']['include'],function(_0x1cab9d){return{'model':db[_0x1cab9d[_0x3d31('0x1d')]],'as':_0x1cab9d['as'],'attributes':_0x1cab9d[_0x3d31('0x1a')],'include':_0x1cab9d[_0x3d31('0x1b')]?_[_0x3d31('0x1c')](_0x1cab9d[_0x3d31('0x1b')],function(_0x61d9e0){return{'model':db[_0x61d9e0['model']],'as':_0x61d9e0['as'],'attributes':_0x61d9e0[_0x3d31('0x1a')],'include':_0x61d9e0['include']?_[_0x3d31('0x1c')](_0x61d9e0[_0x3d31('0x1b')],function(_0x5dadb9){return{'model':db[_0x5dadb9[_0x3d31('0x1d')]],'as':_0x5dadb9['as'],'attributes':_0x5dadb9['attributes']};}):[]};}):[]};}):[]:[]})[_0x3d31('0x1e')](function(_0x11d68e){logger['info']('GetCmHopperBlack',_0x54986c);logger[_0x3d31('0xf')]('GetCmHopperBlack',_0x54986c,JSON[_0x3d31('0x1f')](_0x11d68e));_0x45081e(_0x11d68e);})[_0x3d31('0x14')](function(_0x3fde73){logger[_0x3d31('0x11')]('GetCmHopperBlack',_0x3fde73['message'],_0x54986c);_0xb5ed32(_0x3de0bf[_0x3d31('0x11')](0x1f4,_0x3fde73[_0x3d31('0x13')]));});});};exports[_0x3d31('0x20')]=function(_0x1977ef){var _0x5e2a7f=this;return new Promise(function(_0x337fe3,_0x5da289){return db[_0x3d31('0x16')][_0x3d31('0x21')](_0x1977ef[_0x3d31('0x22')],{'raw':_0x1977ef[_0x3d31('0x18')]?_0x1977ef['options'][_0x3d31('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1977ef[_0x3d31('0x18')]?_0x1977ef['options'][_0x3d31('0x19')]||null:null,'attributes':_0x1977ef['options']?_0x1977ef[_0x3d31('0x18')]['attributes']||null:null,'limit':_0x1977ef[_0x3d31('0x18')]?_0x1977ef['options']['limit']||null:null})[_0x3d31('0x1e')](function(_0xf962d4){logger[_0x3d31('0xc')](_0x3d31('0x20'),_0x1977ef);logger[_0x3d31('0xf')](_0x3d31('0x20'),_0x1977ef,JSON[_0x3d31('0x1f')](_0xf962d4));_0x337fe3(_0xf962d4);})['catch'](function(_0x2ebdba){logger[_0x3d31('0x11')]('UpdateCmHopperBlack',_0x2ebdba[_0x3d31('0x13')],_0x1977ef);_0x5da289(_0x5e2a7f[_0x3d31('0x11')](0x1f4,_0x2ebdba[_0x3d31('0x13')]));});});};exports[_0x3d31('0x23')]=function(_0x3ac65c){var _0x2e2bd9=this;return new Promise(function(_0x356e5b,_0x1d19a9){return db['CmHopperBlack'][_0x3d31('0x24')]({'where':_0x3ac65c['options']?_0x3ac65c[_0x3d31('0x18')]['where']||null:null})[_0x3d31('0x1e')](function(_0x152a73){logger[_0x3d31('0xc')](_0x3d31('0x23'),_0x3ac65c);logger[_0x3d31('0xf')]('DestroyCmHopperBlack',_0x3ac65c,JSON[_0x3d31('0x1f')](_0x152a73));_0x356e5b(_0x152a73);})[_0x3d31('0x14')](function(_0x13db21){logger[_0x3d31('0x11')](_0x3d31('0x23'),_0x13db21[_0x3d31('0x13')],_0x3ac65c);_0x1d19a9(_0x2e2bd9[_0x3d31('0x11')](0x1f4,_0x13db21[_0x3d31('0x13')]));});});}; \ No newline at end of file +var _0x568f=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','update','body','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','lodash','util','moment'];(function(_0x23ed30,_0x116aff){var _0x9e6b82=function(_0x228702){while(--_0x228702){_0x23ed30['push'](_0x23ed30['shift']());}};_0x9e6b82(++_0x116aff);}(_0x568f,0xf3));var _0xf568=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x568f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf568('0x0'));var util=require(_0xf568('0x1'));var moment=require(_0xf568('0x2'));var BPromise=require('bluebird');var rs=require(_0xf568('0x3'));var fs=require('fs');var Redis=require(_0xf568('0x4'));var db=require(_0xf568('0x5'))['db'];var utils=require(_0xf568('0x6'));var logger=require(_0xf568('0x7'))(_0xf568('0x8'));var config=require(_0xf568('0x9'));var jayson=require(_0xf568('0xa'));var client=jayson[_0xf568('0xb')][_0xf568('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x52a099,_0x151074,_0x27056c){return new BPromise(function(_0x3b77f8,_0x19a251){return client['request'](_0x52a099,_0x27056c)[_0xf568('0xd')](function(_0x8df0e5){logger[_0xf568('0xe')](_0xf568('0xf'),_0x151074,'request\x20sent');logger[_0xf568('0x10')](_0xf568('0x11'),_0x151074,_0xf568('0x12'),JSON[_0xf568('0x13')](_0x8df0e5));if(_0x8df0e5['error']){if(_0x8df0e5[_0xf568('0x14')][_0xf568('0x15')]===0x1f4){logger[_0xf568('0x14')](_0xf568('0xf'),_0x151074,_0x8df0e5[_0xf568('0x14')][_0xf568('0x16')]);return _0x19a251(_0x8df0e5['error'][_0xf568('0x16')]);}logger[_0xf568('0x14')](_0xf568('0xf'),_0x151074,_0x8df0e5[_0xf568('0x14')]['message']);return _0x3b77f8(_0x8df0e5[_0xf568('0x14')][_0xf568('0x16')]);}else{logger[_0xf568('0xe')](_0xf568('0xf'),_0x151074,_0xf568('0x12'));_0x3b77f8(_0x8df0e5[_0xf568('0x17')][_0xf568('0x16')]);}})[_0xf568('0x18')](function(_0x2ecd74){logger['error'](_0xf568('0xf'),_0x151074,_0x2ecd74);_0x19a251(_0x2ecd74);});});}exports[_0xf568('0x19')]=function(_0x86b3e){var _0x22c500=this;return new Promise(function(_0x8c494b,_0x1198cc){return db[_0xf568('0x1a')][_0xf568('0x1b')]({'raw':_0x86b3e[_0xf568('0x1c')]?_0x86b3e[_0xf568('0x1c')][_0xf568('0x1d')]===undefined?!![]:![]:!![],'where':_0x86b3e[_0xf568('0x1c')]?_0x86b3e[_0xf568('0x1c')][_0xf568('0x1e')]||null:null,'attributes':_0x86b3e['options']?_0x86b3e['options'][_0xf568('0x1f')]||null:null,'limit':_0x86b3e[_0xf568('0x1c')]?_0x86b3e[_0xf568('0x1c')][_0xf568('0x20')]||null:null,'include':_0x86b3e[_0xf568('0x1c')]?_0x86b3e[_0xf568('0x1c')][_0xf568('0x21')]?_[_0xf568('0x22')](_0x86b3e[_0xf568('0x1c')]['include'],function(_0x3e12ce){return{'model':db[_0x3e12ce[_0xf568('0x23')]],'as':_0x3e12ce['as'],'attributes':_0x3e12ce[_0xf568('0x1f')],'include':_0x3e12ce['include']?_[_0xf568('0x22')](_0x3e12ce[_0xf568('0x21')],function(_0x3bac9e){return{'model':db[_0x3bac9e['model']],'as':_0x3bac9e['as'],'attributes':_0x3bac9e['attributes'],'include':_0x3bac9e[_0xf568('0x21')]?_[_0xf568('0x22')](_0x3bac9e['include'],function(_0x9126fc){return{'model':db[_0x9126fc[_0xf568('0x23')]],'as':_0x9126fc['as'],'attributes':_0x9126fc[_0xf568('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf568('0xd')](function(_0x400a1f){logger['info'](_0xf568('0x19'),_0x86b3e);logger['debug'](_0xf568('0x19'),_0x86b3e,JSON['stringify'](_0x400a1f));_0x8c494b(_0x400a1f);})[_0xf568('0x18')](function(_0x3114ab){logger['error'](_0xf568('0x19'),_0x3114ab[_0xf568('0x16')],_0x86b3e);_0x1198cc(_0x22c500[_0xf568('0x14')](0x1f4,_0x3114ab[_0xf568('0x16')]));});});};exports['UpdateCmHopperBlack']=function(_0x30e463){var _0x50a633=this;return new Promise(function(_0x25efe5,_0x19dc56){return db[_0xf568('0x1a')][_0xf568('0x24')](_0x30e463[_0xf568('0x25')],{'raw':_0x30e463[_0xf568('0x1c')]?_0x30e463[_0xf568('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30e463['options']?_0x30e463[_0xf568('0x1c')][_0xf568('0x1e')]||null:null,'attributes':_0x30e463['options']?_0x30e463[_0xf568('0x1c')][_0xf568('0x1f')]||null:null,'limit':_0x30e463[_0xf568('0x1c')]?_0x30e463[_0xf568('0x1c')][_0xf568('0x20')]||null:null})[_0xf568('0xd')](function(_0x36d089){logger[_0xf568('0xe')](_0xf568('0x26'),_0x30e463);logger[_0xf568('0x10')](_0xf568('0x26'),_0x30e463,JSON[_0xf568('0x13')](_0x36d089));_0x25efe5(_0x36d089);})['catch'](function(_0x520f7b){logger['error'](_0xf568('0x26'),_0x520f7b[_0xf568('0x16')],_0x30e463);_0x19dc56(_0x50a633[_0xf568('0x14')](0x1f4,_0x520f7b[_0xf568('0x16')]));});});};exports[_0xf568('0x27')]=function(_0x271541){var _0x53a7b1=this;return new Promise(function(_0x36bf17,_0x4e56e0){return db[_0xf568('0x1a')][_0xf568('0x28')]({'where':_0x271541[_0xf568('0x1c')]?_0x271541[_0xf568('0x1c')][_0xf568('0x1e')]||null:null})[_0xf568('0xd')](function(_0xa42a04){logger['info'](_0xf568('0x27'),_0x271541);logger[_0xf568('0x10')](_0xf568('0x27'),_0x271541,JSON['stringify'](_0xa42a04));_0x36bf17(_0xa42a04);})[_0xf568('0x18')](function(_0x445d8e){logger[_0xf568('0x14')](_0xf568('0x27'),_0x445d8e[_0xf568('0x16')],_0x271541);_0x4e56e0(_0x53a7b1[_0xf568('0x14')](0x1f4,_0x445d8e[_0xf568('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index cd65c75..c4dacf7 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 _0x2675=['../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','put','/:id','delete','exports','multer','express','Router'];(function(_0x1d2467,_0x41dfa8){var _0x23010b=function(_0x2dc9dc){while(--_0x2dc9dc){_0x1d2467['push'](_0x1d2467['shift']());}};_0x23010b(++_0x41dfa8);}(_0x2675,0x75));var _0x5267=function(_0x159f5d,_0x18c79c){_0x159f5d=_0x159f5d-0x0;var _0x5b0ae7=_0x2675[_0x159f5d];return _0x5b0ae7;};'use strict';var multer=require(_0x5267('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5267('0x1'));var router=express[_0x5267('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x5267('0x3'));var interaction=require(_0x5267('0x4'));var config=require('../../config/environment');var controller=require(_0x5267('0x5'));router[_0x5267('0x6')]('/',auth[_0x5267('0x7')](),controller[_0x5267('0x8')]);router[_0x5267('0x6')](_0x5267('0x9'),auth['isAuthenticated'](),controller[_0x5267('0xa')]);router[_0x5267('0x6')]('/:id',auth[_0x5267('0x7')](),controller['show']);router[_0x5267('0xb')](_0x5267('0xc'),auth[_0x5267('0x7')](),controller['update']);router[_0x5267('0xd')]('/:id',auth[_0x5267('0x7')](),controller['destroy']);module[_0x5267('0xe')]=router; \ No newline at end of file +var _0x4819=['show','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','/describe','describe','get','/:id'];(function(_0x47d563,_0x13d257){var _0x46f9d8=function(_0x11d8ca){while(--_0x11d8ca){_0x47d563['push'](_0x47d563['shift']());}};_0x46f9d8(++_0x13d257);}(_0x4819,0xcd));var _0x9481=function(_0x55456f,_0x3f561a){_0x55456f=_0x55456f-0x0;var _0x34d223=_0x4819[_0x55456f];return _0x34d223;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var fs_extra=require(_0x9481('0x5'));var auth=require(_0x9481('0x6'));var interaction=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var controller=require(_0x9481('0x9'));router['get']('/',auth[_0x9481('0xa')](),controller['index']);router['get'](_0x9481('0xb'),auth[_0x9481('0xa')](),controller[_0x9481('0xc')]);router[_0x9481('0xd')](_0x9481('0xe'),auth['isAuthenticated'](),controller[_0x9481('0xf')]);router['put'](_0x9481('0xe'),auth['isAuthenticated'](),controller[_0x9481('0x10')]);router[_0x9481('0x11')](_0x9481('0xe'),auth[_0x9481('0xa')](),controller[_0x9481('0x12')]);module[_0x9481('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 28f2e21..f761258 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 _0x4c08=['INTEGER','STRING','DATE','setDataValue','followuptime','diff','BOOLEAN','sequelize','moment','exports'];(function(_0x3d6599,_0x36c8a0){var _0x408f1a=function(_0x1644f3){while(--_0x1644f3){_0x3d6599['push'](_0x3d6599['shift']());}};_0x408f1a(++_0x36c8a0);}(_0x4c08,0x9d));var _0x84c0=function(_0x10b48a,_0x1a0a3f){_0x10b48a=_0x10b48a-0x0;var _0x2c4533=_0x4c08[_0x10b48a];return _0x2c4533;};'use strict';var Sequelize=require(_0x84c0('0x0'));var moment=require(_0x84c0('0x1'));module[_0x84c0('0x2')]={'state':{'type':Sequelize[_0x84c0('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x84c0('0x4')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x84c0('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x84c0('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x84c0('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x84c0('0x4')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x84c0('0x4')]},'calleridnum':{'type':Sequelize[_0x84c0('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x84c0('0x5')]},'responsetime':{'type':Sequelize[_0x84c0('0x5')]},'answertime':{'type':Sequelize[_0x84c0('0x5')]},'droptime':{'type':Sequelize[_0x84c0('0x5')]},'endtime':{'type':Sequelize[_0x84c0('0x5')]},'ringtime':{'type':Sequelize[_0x84c0('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x84c0('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x84c0('0x4')]},'campaigntype':{'type':Sequelize[_0x84c0('0x4')]},'membername':{'type':Sequelize[_0x84c0('0x4')]},'reason':{'type':Sequelize[_0x84c0('0x4')]},'disposition':{'type':Sequelize[_0x84c0('0x4')]},'secondDisposition':{'type':Sequelize[_0x84c0('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x5e0d08){var _0x15d105=this['getDataValue']('endtime');if(_0x15d105&&_0x5e0d08){this[_0x84c0('0x6')](_0x84c0('0x7'),moment(_0x5e0d08)[_0x84c0('0x8')](moment(_0x15d105),'seconds'));}}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0x84c0('0x9')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x84c0('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x84c0('0x5')]},'callback':{'type':Sequelize[_0x84c0('0x9')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x84c0('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x84c0('0x5')]},'deleted':{'type':Sequelize[_0x84c0('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x84c0('0x9')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x84c0('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x84c0('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x84c0('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x84c0('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x84c0('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1d1c=['diff','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime'];(function(_0x42a4b7,_0x2a8f76){var _0x44d32a=function(_0x2b7268){while(--_0x2b7268){_0x42a4b7['push'](_0x42a4b7['shift']());}};_0x44d32a(++_0x2a8f76);}(_0x1d1c,0xe0));var _0xc1d1=function(_0x108535,_0x4d2a30){_0x108535=_0x108535-0x0;var _0x51db74=_0x1d1c[_0x108535];return _0x51db74;};'use strict';var Sequelize=require(_0xc1d1('0x0'));var moment=require(_0xc1d1('0x1'));module[_0xc1d1('0x2')]={'state':{'type':Sequelize[_0xc1d1('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xc1d1('0x4')]},'scheduledat':{'type':Sequelize[_0xc1d1('0x5')]},'countbusyretry':{'type':Sequelize[_0xc1d1('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xc1d1('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc1d1('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xc1d1('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xc1d1('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xc1d1('0x4')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xc1d1('0x4')]},'starttime':{'type':Sequelize[_0xc1d1('0x5')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xc1d1('0x5')]},'ringtime':{'type':Sequelize[_0xc1d1('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xc1d1('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xc1d1('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xc1d1('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xc1d1('0x4')]},'campaigntype':{'type':Sequelize[_0xc1d1('0x4')]},'membername':{'type':Sequelize[_0xc1d1('0x4')]},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xc1d1('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xc1d1('0x4')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x36d531){var _0x185cc8=this[_0xc1d1('0x6')](_0xc1d1('0x7'));if(_0x185cc8&&_0x36d531){this[_0xc1d1('0x8')](_0xc1d1('0x9'),moment(_0x36d531)[_0xc1d1('0xa')](moment(_0x185cc8),_0xc1d1('0xb')));}}},'amd':{'type':Sequelize[_0xc1d1('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0xc1d1('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xc1d1('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xc1d1('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0xc1d1('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc1d1('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xc1d1('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xc1d1('0x5')]},'recallme':{'type':Sequelize[_0xc1d1('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0xc1d1('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc1d1('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc1d1('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc1d1('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xc1d1('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index cc121ec..c42ecca 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 _0x326f=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','merge','VIRTUAL','options','CmHopperFinal','includeAll','include','rows','catch','show','params','find','describe','uniqueid','body','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','scheduledAt','ContactId','createdAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','updatedAt','from','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','toString','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','fromQuery','phone','CampaignId','ANY_VALUE(CampaignId)','cm_hopper_final','calleridnum\x20IS\x20NOT\x20NULL','CampaignId\x20=\x20?','checkContactHopper','CmHopper','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','stack','name','send','map','rawAttributes','fieldName'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x326f,0xd1));var _0xf326=function(_0x295508,_0x20eb17){_0x295508=_0x295508-0x0;var _0xf4b75e=_0x326f[_0x295508];return _0xf4b75e;};'use strict';var emlformat=require(_0xf326('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf326('0x1'));var rp=require(_0xf326('0x2'));var moment=require(_0xf326('0x3'));var BPromise=require(_0xf326('0x4'));var Mustache=require(_0xf326('0x5'));var util=require(_0xf326('0x6'));var path=require(_0xf326('0x7'));var sox=require(_0xf326('0x8'));var csv=require(_0xf326('0x9'));var ejs=require(_0xf326('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf326('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3162f9,_0x9ed463){_0x9ed463=_0x9ed463||0xcc;return function(_0x4b3966){if(_0x4b3966){return _0x3162f9[_0xf326('0x17')](_0x9ed463);}return _0x3162f9[_0xf326('0x18')](_0x9ed463)[_0xf326('0x19')]();};}function respondWithResult(_0x17a098,_0x5c8483){_0x5c8483=_0x5c8483||0xc8;return function(_0x45c1b6){if(_0x45c1b6){return _0x17a098['status'](_0x5c8483)['json'](_0x45c1b6);}};}function respondWithFilteredResult(_0xdf21d9,_0x11f6d2){return function(_0x1f2e5a){if(_0x1f2e5a){var _0xa63d1a=typeof _0x11f6d2[_0xf326('0x1a')]===_0xf326('0x1b')&&typeof _0x11f6d2[_0xf326('0x1c')]===_0xf326('0x1b');var _0x5a682a=_0x1f2e5a[_0xf326('0x1d')];var _0x453100=_0xa63d1a?0x0:_0x11f6d2[_0xf326('0x1a')];var _0x31ffb9=_0xa63d1a?_0x1f2e5a[_0xf326('0x1d')]:_0x11f6d2[_0xf326('0x1a')]+_0x11f6d2['limit'];var _0x4a5b6c;if(_0x31ffb9>=_0x5a682a){_0x31ffb9=_0x5a682a;_0x4a5b6c=0xc8;}else{_0x4a5b6c=0xce;}_0xdf21d9['status'](_0x4a5b6c);return _0xdf21d9[_0xf326('0x1e')](_0xf326('0x1f'),_0x453100+'-'+_0x31ffb9+'/'+_0x5a682a)['json'](_0x1f2e5a);}return null;};}function patchUpdates(_0x4cabce){return function(_0x128c68){try{jsonpatch['apply'](_0x128c68,_0x4cabce,!![]);}catch(_0x5b6d3c){return BPromise[_0xf326('0x20')](_0x5b6d3c);}return _0x128c68[_0xf326('0x21')]();};}function saveUpdates(_0x549b46,_0x5aa184){return function(_0x19b8ba){if(_0x19b8ba){return _0x19b8ba[_0xf326('0x22')](_0x549b46)['then'](function(_0x337ed5){return _0x337ed5;});}return null;};}function removeEntity(_0x1b9039,_0x43c53e){return function(_0x295752){if(_0x295752){return _0x295752[_0xf326('0x23')]()[_0xf326('0x24')](function(){_0x1b9039['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f31f6,_0x520d85){return function(_0x1a2c4e){if(!_0x1a2c4e){_0x4f31f6[_0xf326('0x17')](0x194);}return _0x1a2c4e;};}function handleError(_0x1ff2b5,_0x148953){_0x148953=_0x148953||0x1f4;return function(_0x410237){logger['error'](_0x410237[_0xf326('0x25')]);if(_0x410237[_0xf326('0x26')]){delete _0x410237[_0xf326('0x26')];}_0x1ff2b5['status'](_0x148953)[_0xf326('0x27')](_0x410237);};}exports['index']=function(_0x4a9abf,_0x6a8e89){var _0x1ae23a={},_0x2fa28e={},_0x5dbe63={'count':0x0,'rows':[]};var _0xc115d9=_[_0xf326('0x28')](db['CmHopperFinal'][_0xf326('0x29')],function(_0x119ab8){return{'name':_0x119ab8[_0xf326('0x2a')],'type':_0x119ab8[_0xf326('0x2b')][_0xf326('0x2c')]};});_0x2fa28e[_0xf326('0x2d')]=_[_0xf326('0x28')](_0xc115d9,_0xf326('0x26'));_0x2fa28e[_0xf326('0x2e')]=_[_0xf326('0x2f')](_0x4a9abf['query']);_0x2fa28e[_0xf326('0x30')]=_[_0xf326('0x31')](_0x2fa28e[_0xf326('0x2d')],_0x2fa28e['query']);_0x1ae23a[_0xf326('0x32')]=_[_0xf326('0x31')](_0x2fa28e[_0xf326('0x2d')],qs['fields'](_0x4a9abf['query'][_0xf326('0x33')]));_0x1ae23a[_0xf326('0x32')]=_0x1ae23a[_0xf326('0x32')][_0xf326('0x34')]?_0x1ae23a[_0xf326('0x32')]:_0x2fa28e[_0xf326('0x2d')];if(!_0x4a9abf[_0xf326('0x2e')][_0xf326('0x35')]('nolimit')){_0x1ae23a[_0xf326('0x1c')]=qs[_0xf326('0x1c')](_0x4a9abf['query'][_0xf326('0x1c')]);_0x1ae23a['offset']=qs[_0xf326('0x1a')](_0x4a9abf['query']['offset']);}_0x1ae23a[_0xf326('0x36')]=qs['sort'](_0x4a9abf[_0xf326('0x2e')]['sort']);_0x1ae23a[_0xf326('0x37')]=qs[_0xf326('0x30')](_[_0xf326('0x38')](_0x4a9abf['query'],_0x2fa28e[_0xf326('0x30')]),_0xc115d9);if(_0x4a9abf[_0xf326('0x2e')]['filter']){_0x1ae23a[_0xf326('0x37')]=_[_0xf326('0x39')](_0x1ae23a[_0xf326('0x37')],{'$or':_[_0xf326('0x28')](_0xc115d9,function(_0x51076c){if(_0x51076c[_0xf326('0x2b')]!==_0xf326('0x3a')){var _0x1e69b1={};_0x1e69b1[_0x51076c[_0xf326('0x26')]]={'$like':'%'+_0x4a9abf[_0xf326('0x2e')]['filter']+'%'};return _0x1e69b1;}})});}_0x1ae23a=_[_0xf326('0x39')]({},_0x1ae23a,_0x4a9abf[_0xf326('0x3b')]);var _0x5cfb97={'where':_0x1ae23a['where']};return db[_0xf326('0x3c')]['count'](_0x5cfb97)['then'](function(_0x22d462){_0x5dbe63['count']=_0x22d462;if(_0x4a9abf[_0xf326('0x2e')][_0xf326('0x3d')]){_0x1ae23a[_0xf326('0x3e')]=[{'all':!![]}];}return db[_0xf326('0x3c')]['findAll'](_0x1ae23a);})[_0xf326('0x24')](function(_0x45d344){_0x5dbe63[_0xf326('0x3f')]=_0x45d344;return _0x5dbe63;})[_0xf326('0x24')](respondWithFilteredResult(_0x6a8e89,_0x1ae23a))[_0xf326('0x40')](handleError(_0x6a8e89,null));};exports[_0xf326('0x41')]=function(_0x2ad841,_0x224a32){var _0x31283b={'raw':!![],'where':{'id':_0x2ad841[_0xf326('0x42')]['id']}},_0x1227d3={};_0x1227d3[_0xf326('0x2d')]=_['keys'](db[_0xf326('0x3c')][_0xf326('0x29')]);_0x1227d3[_0xf326('0x2e')]=_[_0xf326('0x2f')](_0x2ad841[_0xf326('0x2e')]);_0x1227d3[_0xf326('0x30')]=_['intersection'](_0x1227d3[_0xf326('0x2d')],_0x1227d3[_0xf326('0x2e')]);_0x31283b['attributes']=_[_0xf326('0x31')](_0x1227d3[_0xf326('0x2d')],qs[_0xf326('0x33')](_0x2ad841[_0xf326('0x2e')][_0xf326('0x33')]));_0x31283b['attributes']=_0x31283b['attributes'][_0xf326('0x34')]?_0x31283b[_0xf326('0x32')]:_0x1227d3['model'];if(_0x2ad841['query'][_0xf326('0x3d')]){_0x31283b[_0xf326('0x3e')]=[{'all':!![]}];}_0x31283b=_[_0xf326('0x39')]({},_0x31283b,_0x2ad841['options']);return db[_0xf326('0x3c')][_0xf326('0x43')](_0x31283b)[_0xf326('0x24')](handleEntityNotFound(_0x224a32,null))[_0xf326('0x24')](respondWithResult(_0x224a32,null))[_0xf326('0x40')](handleError(_0x224a32,null));};exports[_0xf326('0x44')]=function(_0x12792c,_0x3b90dc){return db[_0xf326('0x3c')][_0xf326('0x44')]()[_0xf326('0x24')](respondWithResult(_0x3b90dc,null))[_0xf326('0x40')](handleError(_0x3b90dc,null));};exports[_0xf326('0x22')]=function(_0x395b1e,_0xeac1a1){if(_0x395b1e['body'][_0xf326('0x45')]){delete _0x395b1e[_0xf326('0x46')][_0xf326('0x45')];}return db[_0xf326('0x3c')]['find']({'where':{'uniqueid':_0x395b1e[_0xf326('0x42')]['id']}})[_0xf326('0x24')](handleEntityNotFound(_0xeac1a1,null))[_0xf326('0x24')](saveUpdates(_0x395b1e[_0xf326('0x46')],null))['then'](respondWithResult(_0xeac1a1,null))[_0xf326('0x40')](handleError(_0xeac1a1,null));};exports[_0xf326('0x47')]=function(_0x145a77,_0x451ac7,_0x39ba25){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x145a77[_0xf326('0x42')]['id']},'attributes':[[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db['sequelize']['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x4b')))),'noSuchContacts'],[db['sequelize']['fn'](_0xf326('0x49'),db['sequelize']['fn']('IF',db[_0xf326('0x48')]['literal'](_0xf326('0x4c')))),_0xf326('0x4d')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xf326('0x4e')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db['sequelize']['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x4f')))),_0xf326('0x50')],[db[_0xf326('0x48')]['fn']('COUNT',db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x51')))),'dropContacts'],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xf326('0x52')],[db[_0xf326('0x48')]['fn']('COUNT',db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x53')))),'reCallContacts'],[db[_0xf326('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf326('0x48')]['literal'](_0xf326('0x54')))),_0xf326('0x55')]]})[_0xf326('0x24')](handleEntityNotFound(_0x451ac7,null))['then'](respondWithResult(_0x451ac7,null))['catch'](handleError(_0x451ac7,null));};exports[_0xf326('0x56')]=function(_0xa85a42,_0x33b259,_0x5d0177){return db[_0xf326('0x3c')]['findAll']({'raw':![],'where':{'CampaignId':_0xa85a42[_0xf326('0x42')]['id']},'attributes':[[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x4b')))),_0xf326('0x57')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')]('`state`\x20=\x203,\x201,\x20null'))),_0xf326('0x4d')],[db['sequelize']['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db['sequelize'][_0xf326('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0xf326('0x4e')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xf326('0x50')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db[_0xf326('0x48')]['literal'](_0xf326('0x51')))),_0xf326('0x58')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xf326('0x48')][_0xf326('0x4a')](_0xf326('0x59')))),_0xf326('0x52')],[db[_0xf326('0x48')]['fn'](_0xf326('0x49'),db[_0xf326('0x48')]['fn']('IF',db['sequelize'][_0xf326('0x4a')](_0xf326('0x53')))),_0xf326('0x5a')],[db[_0xf326('0x48')]['fn']('COUNT',db[_0xf326('0x48')]['fn']('IF',db['sequelize']['literal'](_0xf326('0x54')))),'answeringMachine']]})[_0xf326('0x24')](handleEntityNotFound(_0x33b259,null))[_0xf326('0x24')](respondWithResult(_0x33b259,null))[_0xf326('0x40')](handleError(_0x33b259,null));};exports[_0xf326('0x5b')]=function(_0x17cd36,_0x541491,_0x4a053c){return db['VoiceQueue'][_0xf326('0x43')]({'where':{'id':_0x17cd36[_0xf326('0x42')]['id']}})[_0xf326('0x24')](handleEntityNotFound(_0x541491,null))[_0xf326('0x24')](function(_0xec5857){var _0x5e874b;if(_0xec5857){_0x5e874b=squel[_0xf326('0x5c')]()[_0xf326('0x5d')](_0xf326('0x5e'))['fromQuery'](['phone',_0xf326('0x5f'),_0xf326('0x60'),'ListId','VoiceQueueId',_0xf326('0x61'),'updatedAt'],squel[_0xf326('0x62')]()['field']('ANY_VALUE(calleridnum)','phone')[_0xf326('0x63')](_0xf326('0x64'),_0xf326('0x5f'))['field'](_0xf326('0x65'),_0xf326('0x60'))[_0xf326('0x63')](_0xf326('0x66'),_0xf326('0x67'))[_0xf326('0x63')](_0xf326('0x68'),_0xf326('0x69'))[_0xf326('0x63')]('NOW()',_0xf326('0x61'))['field'](_0xf326('0x64'),_0xf326('0x6a'))[_0xf326('0x6b')]('cm_hopper_final')[_0xf326('0x37')](_0xf326('0x6c'),_0x17cd36[_0xf326('0x42')]['id']['toString']())[_0xf326('0x37')](_0xf326('0x6d'),_0x17cd36[_0xf326('0x46')][_0xf326('0x6e')]['toString']())[_0xf326('0x37')]('calleridnum\x20IS\x20NOT\x20NULL')['where'](_0xf326('0x6f'),squel[_0xf326('0x62')]()['field']('phone')['from'](_0xf326('0x5e'))['where'](_0xf326('0x6c'),_0x17cd36[_0xf326('0x42')]['id'][_0xf326('0x70')]()))[_0xf326('0x37')](_0xf326('0x6f'),squel[_0xf326('0x62')]()['field'](_0xf326('0x71'))[_0xf326('0x6b')]('cm_hopper_final')['where'](_0xf326('0x6c'),_0x17cd36['params']['id'][_0xf326('0x70')]())[_0xf326('0x37')](_0xf326('0x72')))[_0xf326('0x73')](_0xf326('0x60')))[_0xf326('0x70')]();return db[_0xf326('0x48')][_0xf326('0x2e')](_0x5e874b);}return[];})[_0xf326('0x24')](respondWithResult(_0x541491,null))['catch'](handleError(_0x541491,null));};exports[_0xf326('0x74')]=function(_0x26bbb1,_0x4ac90e,_0x3c82cf){return db['Campaign'][_0xf326('0x43')]({'where':{'id':_0x26bbb1[_0xf326('0x42')]['id']}})[_0xf326('0x24')](handleEntityNotFound(_0x4ac90e,null))['then'](function(_0x2b4414){var _0x1c86c8;if(_0x2b4414){_0x1c86c8=squel[_0xf326('0x5c')]()[_0xf326('0x5d')](_0xf326('0x5e'))[_0xf326('0x75')]([_0xf326('0x76'),_0xf326('0x5f'),_0xf326('0x60'),_0xf326('0x67'),_0xf326('0x77'),_0xf326('0x61'),_0xf326('0x6a')],squel[_0xf326('0x62')]()[_0xf326('0x63')]('ANY_VALUE(calleridnum)',_0xf326('0x76'))[_0xf326('0x63')]('NOW()',_0xf326('0x5f'))[_0xf326('0x63')]('ANY_VALUE(ContactId)',_0xf326('0x60'))[_0xf326('0x63')](_0xf326('0x66'),_0xf326('0x67'))[_0xf326('0x63')](_0xf326('0x78'),_0xf326('0x77'))['field'](_0xf326('0x64'),_0xf326('0x61'))[_0xf326('0x63')](_0xf326('0x64'),_0xf326('0x6a'))[_0xf326('0x6b')](_0xf326('0x79'))[_0xf326('0x37')]('CampaignId\x20=\x20?',_0x26bbb1[_0xf326('0x42')]['id'][_0xf326('0x70')]())['where'](_0xf326('0x6d'),_0x26bbb1['body'][_0xf326('0x6e')][_0xf326('0x70')]())[_0xf326('0x37')](_0xf326('0x7a'))[_0xf326('0x37')](_0xf326('0x6f'),squel[_0xf326('0x62')]()[_0xf326('0x63')](_0xf326('0x76'))[_0xf326('0x6b')](_0xf326('0x5e'))[_0xf326('0x37')](_0xf326('0x7b'),_0x26bbb1[_0xf326('0x42')]['id']['toString']()))[_0xf326('0x37')](_0xf326('0x6f'),squel[_0xf326('0x62')]()[_0xf326('0x63')](_0xf326('0x71'))['from'](_0xf326('0x79'))[_0xf326('0x37')](_0xf326('0x7b'),_0x26bbb1[_0xf326('0x42')]['id'][_0xf326('0x70')]())['where']('state\x20=\x204'))[_0xf326('0x73')]('ContactId'))[_0xf326('0x70')]();return db[_0xf326('0x48')][_0xf326('0x2e')](_0x1c86c8);}return[];})['then'](respondWithResult(_0x4ac90e,null))['catch'](handleError(_0x4ac90e,null));};exports[_0xf326('0x7c')]=function(_0x2d92e4,_0x167ac9,_0x34870c){return db[_0xf326('0x7d')]['findOne']({'where':{'VoiceQueueId':_0x2d92e4[_0xf326('0x46')][_0xf326('0x69')],'CampaignId':_0x2d92e4[_0xf326('0x46')]['CampaignId'],'ContactId':_0x2d92e4['body']['ContactId']}})[_0xf326('0x24')](handleEntityNotFound(_0x167ac9,null))[_0xf326('0x24')](function(_0x2d275d){if(_0x2d275d){return _0x2d275d;}return null;})[_0xf326('0x24')](respondWithResult(_0x167ac9,null))[_0xf326('0x40')](handleError(_0x167ac9,null));}; \ No newline at end of file +var _0xfcf0=['noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','field','NOW()','ContactId','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','state\x20=\x20?','state','toString','VoiceQueueId\x20=\x20?','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','ListId','CampaignId','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','CmHopper','findOne','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','CmHopperFinal','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','includeAll','include','catch','params','merge','options','describe','body','uniqueid','find','findAll','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null'];(function(_0x401821,_0x4f1094){var _0x3bbd50=function(_0x267b7c){while(--_0x267b7c){_0x401821['push'](_0x401821['shift']());}};_0x3bbd50(++_0x4f1094);}(_0xfcf0,0x138));var _0x0fcf=function(_0x3fb030,_0x12aebe){_0x3fb030=_0x3fb030-0x0;var _0xd6899b=_0xfcf0[_0x3fb030];return _0xd6899b;};'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['CmHopperFinal']['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')]()[_0x0fcf('0x24')](respondWithResult(_0x345188,null))['catch'](handleError(_0x345188,null));};exports['update']=function(_0x259c91,_0x243699){if(_0x259c91[_0x0fcf('0x47')][_0x0fcf('0x48')]){delete _0x259c91[_0x0fcf('0x47')][_0x0fcf('0x48')];}return db['CmHopperFinal'][_0x0fcf('0x49')]({'where':{'uniqueid':_0x259c91[_0x0fcf('0x43')]['id']}})['then'](handleEntityNotFound(_0x243699,null))[_0x0fcf('0x24')](saveUpdates(_0x259c91[_0x0fcf('0x47')],null))[_0x0fcf('0x24')](respondWithResult(_0x243699,null))[_0x0fcf('0x42')](handleError(_0x243699,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0xc514bf,_0x382448,_0x1bb062){return db[_0x0fcf('0x2b')][_0x0fcf('0x4a')]({'raw':![],'where':{'VoiceQueueId':_0xc514bf[_0x0fcf('0x43')]['id']},'attributes':[[db[_0x0fcf('0x4b')]['fn'](_0x0fcf('0x4c'),db[_0x0fcf('0x4b')]['fn']('IF',db[_0x0fcf('0x4b')][_0x0fcf('0x4d')](_0x0fcf('0x4e')))),_0x0fcf('0x4f')],[db[_0x0fcf('0x4b')]['fn']('COUNT',db[_0x0fcf('0x4b')]['fn']('IF',db['sequelize'][_0x0fcf('0x4d')](_0x0fcf('0x50')))),_0x0fcf('0x51')],[db[_0x0fcf('0x4b')]['fn'](_0x0fcf('0x4c'),db['sequelize']['fn']('IF',db[_0x0fcf('0x4b')]['literal'](_0x0fcf('0x52')))),_0x0fcf('0x53')],[db['sequelize']['fn'](_0x0fcf('0x4c'),db[_0x0fcf('0x4b')]['fn']('IF',db['sequelize'][_0x0fcf('0x4d')](_0x0fcf('0x54')))),_0x0fcf('0x55')],[db[_0x0fcf('0x4b')]['fn'](_0x0fcf('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0x0fcf('0x4d')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x0fcf('0x56')],[db[_0x0fcf('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x0fcf('0x4b')][_0x0fcf('0x4d')](_0x0fcf('0x57')))),'abandonedContacts'],[db[_0x0fcf('0x4b')]['fn']('COUNT',db[_0x0fcf('0x4b')]['fn']('IF',db[_0x0fcf('0x4b')][_0x0fcf('0x4d')]('`state`\x20=\x2022,\x201,\x20null'))),_0x0fcf('0x58')],[db[_0x0fcf('0x4b')]['fn'](_0x0fcf('0x4c'),db[_0x0fcf('0x4b')]['fn']('IF',db[_0x0fcf('0x4b')][_0x0fcf('0x4d')](_0x0fcf('0x59')))),_0x0fcf('0x5a')]]})[_0x0fcf('0x24')](handleEntityNotFound(_0x382448,null))[_0x0fcf('0x24')](respondWithResult(_0x382448,null))[_0x0fcf('0x42')](handleError(_0x382448,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x62d12e,_0x1dda2e,_0x6af0f5){return db[_0x0fcf('0x2b')][_0x0fcf('0x4a')]({'raw':![],'where':{'CampaignId':_0x62d12e[_0x0fcf('0x43')]['id']},'attributes':[[db[_0x0fcf('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x0fcf('0x4b')][_0x0fcf('0x4d')]('`state`\x20=\x200,\x201,\x20null'))),_0x0fcf('0x4f')],[db[_0x0fcf('0x4b')]['fn'](_0x0fcf('0x4c'),db[_0x0fcf('0x4b')]['fn']('IF',db['sequelize'][_0x0fcf('0x4d')](_0x0fcf('0x50')))),_0x0fcf('0x51')],[db[_0x0fcf('0x4b')]['fn'](_0x0fcf('0x4c'),db[_0x0fcf('0x4b')]['fn']('IF',db['sequelize'][_0x0fcf('0x4d')](_0x0fcf('0x52')))),_0x0fcf('0x53')],[db[_0x0fcf('0x4b')]['fn'](_0x0fcf('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0x0fcf('0x4d')](_0x0fcf('0x54')))),_0x0fcf('0x55')],[db[_0x0fcf('0x4b')]['fn'](_0x0fcf('0x4c'),db[_0x0fcf('0x4b')]['fn']('IF',db[_0x0fcf('0x4b')][_0x0fcf('0x4d')](_0x0fcf('0x5b')))),_0x0fcf('0x56')],[db['sequelize']['fn'](_0x0fcf('0x4c'),db[_0x0fcf('0x4b')]['fn']('IF',db[_0x0fcf('0x4b')][_0x0fcf('0x4d')](_0x0fcf('0x57')))),_0x0fcf('0x5c')],[db[_0x0fcf('0x4b')]['fn'](_0x0fcf('0x4c'),db[_0x0fcf('0x4b')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2022,\x201,\x20null'))),'reCallContacts'],[db[_0x0fcf('0x4b')]['fn']('COUNT',db[_0x0fcf('0x4b')]['fn']('IF',db[_0x0fcf('0x4b')][_0x0fcf('0x4d')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0x0fcf('0x24')](handleEntityNotFound(_0x1dda2e,null))[_0x0fcf('0x24')](respondWithResult(_0x1dda2e,null))['catch'](handleError(_0x1dda2e,null));};exports[_0x0fcf('0x5d')]=function(_0x3cb75a,_0x5936a6,_0x3d02c1){return db[_0x0fcf('0x5e')][_0x0fcf('0x49')]({'where':{'id':_0x3cb75a[_0x0fcf('0x43')]['id']}})[_0x0fcf('0x24')](handleEntityNotFound(_0x5936a6,null))[_0x0fcf('0x24')](function(_0x4704c9){var _0x4b1f10;if(_0x4704c9){_0x4b1f10=squel[_0x0fcf('0x5f')]()[_0x0fcf('0x60')](_0x0fcf('0x61'))[_0x0fcf('0x62')]([_0x0fcf('0x63'),_0x0fcf('0x64'),'ContactId','ListId',_0x0fcf('0x65'),_0x0fcf('0x66'),_0x0fcf('0x67')],squel[_0x0fcf('0x68')]()['field'](_0x0fcf('0x69'),_0x0fcf('0x63'))[_0x0fcf('0x6a')](_0x0fcf('0x6b'),_0x0fcf('0x64'))['field']('ANY_VALUE(ContactId)',_0x0fcf('0x6c'))['field'](_0x0fcf('0x6d'),'ListId')[_0x0fcf('0x6a')](_0x0fcf('0x6e'),_0x0fcf('0x65'))[_0x0fcf('0x6a')](_0x0fcf('0x6b'),'createdAt')[_0x0fcf('0x6a')](_0x0fcf('0x6b'),_0x0fcf('0x67'))[_0x0fcf('0x6f')]('cm_hopper_final')[_0x0fcf('0x3d')]('VoiceQueueId\x20=\x20?',_0x3cb75a[_0x0fcf('0x43')]['id']['toString']())[_0x0fcf('0x3d')](_0x0fcf('0x70'),_0x3cb75a['body'][_0x0fcf('0x71')][_0x0fcf('0x72')]())[_0x0fcf('0x3d')]('calleridnum\x20IS\x20NOT\x20NULL')['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x0fcf('0x68')]()['field'](_0x0fcf('0x63'))[_0x0fcf('0x6f')](_0x0fcf('0x61'))[_0x0fcf('0x3d')](_0x0fcf('0x73'),_0x3cb75a[_0x0fcf('0x43')]['id'][_0x0fcf('0x72')]()))[_0x0fcf('0x3d')](_0x0fcf('0x74'),squel['select']()[_0x0fcf('0x6a')](_0x0fcf('0x75'))[_0x0fcf('0x6f')](_0x0fcf('0x76'))[_0x0fcf('0x3d')](_0x0fcf('0x73'),_0x3cb75a[_0x0fcf('0x43')]['id'][_0x0fcf('0x72')]())['where'](_0x0fcf('0x77')))[_0x0fcf('0x78')](_0x0fcf('0x6c')))[_0x0fcf('0x72')]();return db[_0x0fcf('0x4b')][_0x0fcf('0x33')](_0x4b1f10);}return[];})[_0x0fcf('0x24')](respondWithResult(_0x5936a6,null))['catch'](handleError(_0x5936a6,null));};exports[_0x0fcf('0x79')]=function(_0x489c6d,_0x18645d,_0x9e933e){return db[_0x0fcf('0x7a')]['find']({'where':{'id':_0x489c6d['params']['id']}})['then'](handleEntityNotFound(_0x18645d,null))['then'](function(_0x301991){var _0x46bcc2;if(_0x301991){_0x46bcc2=squel[_0x0fcf('0x5f')]()[_0x0fcf('0x60')](_0x0fcf('0x61'))[_0x0fcf('0x62')]([_0x0fcf('0x63'),_0x0fcf('0x64'),_0x0fcf('0x6c'),_0x0fcf('0x7b'),_0x0fcf('0x7c'),'createdAt',_0x0fcf('0x67')],squel[_0x0fcf('0x68')]()['field'](_0x0fcf('0x69'),'phone')[_0x0fcf('0x6a')](_0x0fcf('0x6b'),'scheduledAt')['field'](_0x0fcf('0x7d'),_0x0fcf('0x6c'))['field'](_0x0fcf('0x6d'),_0x0fcf('0x7b'))[_0x0fcf('0x6a')](_0x0fcf('0x7e'),_0x0fcf('0x7c'))[_0x0fcf('0x6a')](_0x0fcf('0x6b'),_0x0fcf('0x66'))['field'](_0x0fcf('0x6b'),_0x0fcf('0x67'))[_0x0fcf('0x6f')](_0x0fcf('0x76'))['where'](_0x0fcf('0x7f'),_0x489c6d['params']['id']['toString']())['where'](_0x0fcf('0x70'),_0x489c6d[_0x0fcf('0x47')][_0x0fcf('0x71')][_0x0fcf('0x72')]())[_0x0fcf('0x3d')](_0x0fcf('0x80'))[_0x0fcf('0x3d')](_0x0fcf('0x74'),squel[_0x0fcf('0x68')]()['field'](_0x0fcf('0x63'))[_0x0fcf('0x6f')](_0x0fcf('0x61'))[_0x0fcf('0x3d')](_0x0fcf('0x7f'),_0x489c6d[_0x0fcf('0x43')]['id'][_0x0fcf('0x72')]()))[_0x0fcf('0x3d')](_0x0fcf('0x74'),squel['select']()['field']('calleridnum')[_0x0fcf('0x6f')](_0x0fcf('0x76'))[_0x0fcf('0x3d')](_0x0fcf('0x7f'),_0x489c6d['params']['id']['toString']())['where'](_0x0fcf('0x77')))['group'](_0x0fcf('0x6c')))['toString']();return db[_0x0fcf('0x4b')]['query'](_0x46bcc2);}return[];})[_0x0fcf('0x24')](respondWithResult(_0x18645d,null))['catch'](handleError(_0x18645d,null));};exports['checkContactHopper']=function(_0x426625,_0x4ccae3,_0x2905fa){return db[_0x0fcf('0x81')][_0x0fcf('0x82')]({'where':{'VoiceQueueId':_0x426625[_0x0fcf('0x47')][_0x0fcf('0x65')],'CampaignId':_0x426625[_0x0fcf('0x47')][_0x0fcf('0x7c')],'ContactId':_0x426625[_0x0fcf('0x47')][_0x0fcf('0x6c')]}})[_0x0fcf('0x24')](handleEntityNotFound(_0x4ccae3,null))[_0x0fcf('0x24')](function(_0x274aa9){if(_0x274aa9){return _0x274aa9;}return null;})[_0x0fcf('0x24')](respondWithResult(_0x4ccae3,null))['catch'](handleError(_0x4ccae3,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 779fc30..14110c0 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 _0xdb1a=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid'];(function(_0x2acdd5,_0x23d2e7){var _0x212407=function(_0x18efb0){while(--_0x18efb0){_0x2acdd5['push'](_0x2acdd5['shift']());}};_0x212407(++_0x23d2e7);}(_0xdb1a,0x78));var _0xadb1=function(_0xffbc46,_0x406d99){_0xffbc46=_0xffbc46-0x0;var _0x4bebe4=_0xdb1a[_0xffbc46];return _0x4bebe4;};'use strict';var _=require(_0xadb1('0x0'));var util=require(_0xadb1('0x1'));var logger=require(_0xadb1('0x2'))(_0xadb1('0x3'));var moment=require(_0xadb1('0x4'));var BPromise=require(_0xadb1('0x5'));var rp=require(_0xadb1('0x6'));var fs=require('fs');var path=require(_0xadb1('0x7'));var rimraf=require(_0xadb1('0x8'));var config=require(_0xadb1('0x9'));var attributes=require('./cmHopperFinal.attributes');module['exports']=function(_0x3004a7,_0x32273d){return _0x3004a7[_0xadb1('0xa')](_0xadb1('0xb'),attributes,{'tableName':_0xadb1('0xc'),'paranoid':![],'indexes':[{'name':_0xadb1('0xd'),'fields':[_0xadb1('0xd')]},{'name':'uniqueid','fields':[_0xadb1('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x704f=['rimraf','./cmHopperFinal.attributes','exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x400aea,_0x593caf){var _0x519e98=function(_0x5052fa){while(--_0x5052fa){_0x400aea['push'](_0x400aea['shift']());}};_0x519e98(++_0x593caf);}(_0x704f,0x159));var _0xf704=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x704f[_0x4243a3];return _0x1b2a33;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf704('0x0'))(_0xf704('0x1'));var moment=require(_0xf704('0x2'));var BPromise=require(_0xf704('0x3'));var rp=require(_0xf704('0x4'));var fs=require('fs');var path=require(_0xf704('0x5'));var rimraf=require(_0xf704('0x6'));var config=require('../../config/environment');var attributes=require(_0xf704('0x7'));module[_0xf704('0x8')]=function(_0x2f37b3,_0x4acf38){return _0x2f37b3['define'](_0xf704('0x9'),attributes,{'tableName':_0xf704('0xa'),'paranoid':![],'indexes':[{'name':_0xf704('0xb'),'fields':[_0xf704('0xb')]},{'name':_0xf704('0xc'),'fields':[_0xf704('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 1be321a..98e38ac 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x9b19f,_0x249fb9){var _0x580272=function(_0x2b3196){while(--_0x2b3196){_0x9b19f['push'](_0x9b19f['shift']());}};_0x580272(++_0x249fb9);}(_0xb10b,0x12a));var _0xbb10=function(_0x903e7f,_0x3a8c45){_0x903e7f=_0x903e7f-0x0;var _0x2411f3=_0xb10b[_0x903e7f];return _0x2411f3;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _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(_0x15b986,_0xb23cb4){var _0x8ef479=function(_0x57c620){while(--_0x57c620){_0x15b986['push'](_0x15b986['shift']());}};_0x8ef479(++_0xb23cb4);}(_0xb10b,0x12a));var _0xbb10=function(_0x56a37a,_0xffb054){_0x56a37a=_0x56a37a-0x0;var _0x3a57ff=_0xb10b[_0x56a37a];return _0x3a57ff;};'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 b2d052e..7dacb94 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 _0xde7a=['countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','post','moveContactsIvrCampaignHopperFinal','checkContactHopper','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0xde7a,0xa6));var _0xade7=function(_0x88f9f7,_0x1753ff){_0x88f9f7=_0x88f9f7-0x0;var _0x5f3769=_0xde7a[_0x88f9f7];return _0x5f3769;};'use strict';var multer=require(_0xade7('0x0'));var util=require('util');var path=require(_0xade7('0x1'));var timeout=require(_0xade7('0x2'));var express=require(_0xade7('0x3'));var router=express[_0xade7('0x4')]();var fs_extra=require(_0xade7('0x5'));var auth=require(_0xade7('0x6'));var interaction=require(_0xade7('0x7'));var config=require(_0xade7('0x8'));var controller=require('./cmHopperFinal.controller');router[_0xade7('0x9')]('/',auth[_0xade7('0xa')](),controller[_0xade7('0xb')]);router[_0xade7('0x9')]('/describe',auth[_0xade7('0xa')](),controller[_0xade7('0xc')]);router[_0xade7('0x9')](_0xade7('0xd'),auth[_0xade7('0xa')](),controller[_0xade7('0xe')]);router[_0xade7('0x9')](_0xade7('0xf'),auth[_0xade7('0xa')](),controller[_0xade7('0x10')]);router['get'](_0xade7('0x11'),auth['isAuthenticated'](),controller[_0xade7('0x12')]);router['post'](_0xade7('0x13'),auth[_0xade7('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0xade7('0x14')]('/voice/campaign/moveContacts/:id',auth[_0xade7('0xa')](),controller[_0xade7('0x15')]);router[_0xade7('0x14')]('/checkContactHopper',auth[_0xade7('0xa')](),controller[_0xade7('0x16')]);router['put'](_0xade7('0xd'),auth['isAuthenticated'](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x450a=['post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','countContactsIvrCampaignHopperFinal'];(function(_0x249442,_0x374131){var _0x3922f1=function(_0x1b7da3){while(--_0x1b7da3){_0x249442['push'](_0x249442['shift']());}};_0x3922f1(++_0x374131);}(_0x450a,0x149));var _0xa450=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x450a[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0xa450('0x0'));var util=require(_0xa450('0x1'));var path=require(_0xa450('0x2'));var timeout=require(_0xa450('0x3'));var express=require(_0xa450('0x4'));var router=express[_0xa450('0x5')]();var fs_extra=require(_0xa450('0x6'));var auth=require(_0xa450('0x7'));var interaction=require(_0xa450('0x8'));var config=require(_0xa450('0x9'));var controller=require('./cmHopperFinal.controller');router[_0xa450('0xa')]('/',auth[_0xa450('0xb')](),controller['index']);router['get'](_0xa450('0xc'),auth['isAuthenticated'](),controller[_0xa450('0xd')]);router[_0xa450('0xa')](_0xa450('0xe'),auth[_0xa450('0xb')](),controller[_0xa450('0xf')]);router['get'](_0xa450('0x10'),auth[_0xa450('0xb')](),controller[_0xa450('0x11')]);router[_0xa450('0xa')]('/campaign/countAttributes/:id',auth['isAuthenticated'](),controller[_0xa450('0x12')]);router[_0xa450('0x13')](_0xa450('0x14'),auth[_0xa450('0xb')](),controller[_0xa450('0x15')]);router[_0xa450('0x13')](_0xa450('0x16'),auth[_0xa450('0xb')](),controller[_0xa450('0x17')]);router[_0xa450('0x13')](_0xa450('0x18'),auth['isAuthenticated'](),controller[_0xa450('0x19')]);router[_0xa450('0x1a')]('/:id',auth[_0xa450('0xb')](),controller[_0xa450('0x1b')]);module[_0xa450('0x1c')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 251ba0d..674077c 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 _0xca83=['STRING','DATE','BOOLEAN','sequelize','INTEGER'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0xca83,0x99));var _0x3ca8=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0xca83[_0x26f702];return _0x11417d;};'use strict';var Sequelize=require(_0x3ca8('0x0'));module['exports']={'state':{'type':Sequelize[_0x3ca8('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x3ca8('0x2')]},'scheduledat':{'type':Sequelize[_0x3ca8('0x3')]},'countbusyretry':{'type':Sequelize[_0x3ca8('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3ca8('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x3ca8('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x3ca8('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x3ca8('0x2')]},'calleridname':{'type':Sequelize[_0x3ca8('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x3ca8('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x3ca8('0x3')]},'endtime':{'type':Sequelize[_0x3ca8('0x3')]},'ringtime':{'type':Sequelize[_0x3ca8('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x3ca8('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x3ca8('0x2')]},'campaigntype':{'type':Sequelize[_0x3ca8('0x2')]},'membername':{'type':Sequelize[_0x3ca8('0x2')]},'reason':{'type':Sequelize[_0x3ca8('0x2')]},'amd':{'type':Sequelize[_0x3ca8('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x3ca8('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x3ca8('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3ca8('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x3ca8('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x3ca8('0x3')]},'edited':{'type':Sequelize[_0x3ca8('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x3ca8('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3ca8('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3ca8('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3ca8('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3ca8('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x3ca8('0x2')]}}; \ No newline at end of file +var _0xb679=['STRING','DATE','BOOLEAN','exports','INTEGER'];(function(_0x109d27,_0xde5397){var _0x236ecb=function(_0x192fe0){while(--_0x192fe0){_0x109d27['push'](_0x109d27['shift']());}};_0x236ecb(++_0xde5397);}(_0xb679,0x1e8));var _0x9b67=function(_0x1dc915,_0x5a5c97){_0x1dc915=_0x1dc915-0x0;var _0x5d90a4=_0xb679[_0x1dc915];return _0x5d90a4;};'use strict';var Sequelize=require('sequelize');module[_0x9b67('0x0')]={'state':{'type':Sequelize[_0x9b67('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x9b67('0x2')]},'scheduledat':{'type':Sequelize[_0x9b67('0x3')]},'countbusyretry':{'type':Sequelize[_0x9b67('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9b67('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9b67('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x9b67('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x9b67('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x9b67('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x9b67('0x3')]},'responsetime':{'type':Sequelize[_0x9b67('0x3')]},'answertime':{'type':Sequelize[_0x9b67('0x3')]},'droptime':{'type':Sequelize[_0x9b67('0x3')]},'endtime':{'type':Sequelize[_0x9b67('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x9b67('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x9b67('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x9b67('0x2')]},'campaign':{'type':Sequelize[_0x9b67('0x2')]},'campaigntype':{'type':Sequelize[_0x9b67('0x2')]},'membername':{'type':Sequelize[_0x9b67('0x2')]},'reason':{'type':Sequelize[_0x9b67('0x2')]},'amd':{'type':Sequelize[_0x9b67('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x9b67('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9b67('0x3')]},'recallme':{'type':Sequelize[_0x9b67('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x9b67('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9b67('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9b67('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9b67('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x9b67('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 988aabf..cbb149c 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 _0x5306=['rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','options','includeAll','findAll','rows','catch','show','params','intersection','include','find','create','body','describe','uniqueid'];(function(_0x44b3f6,_0x2f0b79){var _0x4a6207=function(_0x5835fb){while(--_0x5835fb){_0x44b3f6['push'](_0x44b3f6['shift']());}};_0x4a6207(++_0x2f0b79);}(_0x5306,0x16d));var _0x6530=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5306[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6530('0x0'));var zipdir=require(_0x6530('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6530('0x2'));var moment=require(_0x6530('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6530('0x4'));var path=require(_0x6530('0x5'));var sox=require(_0x6530('0x6'));var csv=require(_0x6530('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6530('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6530('0x9'));var jsforce=require(_0x6530('0xa'));var deskjs=require(_0x6530('0xb'));var toCsv=require(_0x6530('0x7'));var querystring=require(_0x6530('0xc'));var Papa=require(_0x6530('0xd'));var Redis=require(_0x6530('0xe'));var authService=require(_0x6530('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6530('0x10'));var logger=require(_0x6530('0x11'))('api');var utils=require(_0x6530('0x12'));var config=require(_0x6530('0x13'));var licenseUtil=require(_0x6530('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x537ee8,_0x22cd3e){_0x22cd3e=_0x22cd3e||0xcc;return function(_0x3539d5){if(_0x3539d5){return _0x537ee8[_0x6530('0x15')](_0x22cd3e);}return _0x537ee8[_0x6530('0x16')](_0x22cd3e)['end']();};}function respondWithResult(_0x30e39b,_0x3afe9d){_0x3afe9d=_0x3afe9d||0xc8;return function(_0x3215bc){if(_0x3215bc){return _0x30e39b[_0x6530('0x16')](_0x3afe9d)[_0x6530('0x17')](_0x3215bc);}};}function respondWithFilteredResult(_0x3a9ec3,_0x2af121){return function(_0x49d0ba){if(_0x49d0ba){var _0x2962a6=typeof _0x2af121[_0x6530('0x18')]===_0x6530('0x19')&&typeof _0x2af121[_0x6530('0x1a')]===_0x6530('0x19');var _0x1cc92b=_0x49d0ba[_0x6530('0x1b')];var _0x36d624=_0x2962a6?0x0:_0x2af121[_0x6530('0x18')];var _0x4f8ea4=_0x2962a6?_0x49d0ba[_0x6530('0x1b')]:_0x2af121[_0x6530('0x18')]+_0x2af121[_0x6530('0x1a')];var _0x3e1879;if(_0x4f8ea4>=_0x1cc92b){_0x4f8ea4=_0x1cc92b;_0x3e1879=0xc8;}else{_0x3e1879=0xce;}_0x3a9ec3['status'](_0x3e1879);return _0x3a9ec3[_0x6530('0x1c')](_0x6530('0x1d'),_0x36d624+'-'+_0x4f8ea4+'/'+_0x1cc92b)[_0x6530('0x17')](_0x49d0ba);}return null;};}function patchUpdates(_0x4e16d4){return function(_0x444a5b){try{jsonpatch[_0x6530('0x1e')](_0x444a5b,_0x4e16d4,!![]);}catch(_0x31c5da){return BPromise[_0x6530('0x1f')](_0x31c5da);}return _0x444a5b[_0x6530('0x20')]();};}function saveUpdates(_0x543bd0,_0x39a426){return function(_0x50fab2){if(_0x50fab2){return _0x50fab2[_0x6530('0x21')](_0x543bd0)[_0x6530('0x22')](function(_0x485a0d){return _0x485a0d;});}return null;};}function removeEntity(_0x406c1b,_0x538bc5){return function(_0x6cf167){if(_0x6cf167){return _0x6cf167[_0x6530('0x23')]()[_0x6530('0x22')](function(){_0x406c1b[_0x6530('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56c321,_0x3cab3f){return function(_0xcecbb3){if(!_0xcecbb3){_0x56c321[_0x6530('0x15')](0x194);}return _0xcecbb3;};}function handleError(_0x536079,_0x22ad55){_0x22ad55=_0x22ad55||0x1f4;return function(_0x4c023e){logger['error'](_0x4c023e[_0x6530('0x24')]);if(_0x4c023e[_0x6530('0x25')]){delete _0x4c023e['name'];}_0x536079[_0x6530('0x16')](_0x22ad55)[_0x6530('0x26')](_0x4c023e);};}exports[_0x6530('0x27')]=function(_0x29cc43,_0x1756fe){var _0x5124fe={},_0x3ce0b4={},_0x5902e8={'count':0x0,'rows':[]};var _0x4305d2=_[_0x6530('0x28')](db[_0x6530('0x29')][_0x6530('0x2a')],function(_0x208888){return{'name':_0x208888[_0x6530('0x2b')],'type':_0x208888['type'][_0x6530('0x2c')]};});_0x3ce0b4[_0x6530('0x2d')]=_[_0x6530('0x28')](_0x4305d2,_0x6530('0x25'));_0x3ce0b4[_0x6530('0x2e')]=_[_0x6530('0x2f')](_0x29cc43[_0x6530('0x2e')]);_0x3ce0b4['filters']=_['intersection'](_0x3ce0b4[_0x6530('0x2d')],_0x3ce0b4[_0x6530('0x2e')]);_0x5124fe[_0x6530('0x30')]=_['intersection'](_0x3ce0b4[_0x6530('0x2d')],qs[_0x6530('0x31')](_0x29cc43[_0x6530('0x2e')]['fields']));_0x5124fe[_0x6530('0x30')]=_0x5124fe[_0x6530('0x30')][_0x6530('0x32')]?_0x5124fe[_0x6530('0x30')]:_0x3ce0b4[_0x6530('0x2d')];if(!_0x29cc43[_0x6530('0x2e')][_0x6530('0x33')](_0x6530('0x34'))){_0x5124fe['limit']=qs[_0x6530('0x1a')](_0x29cc43['query'][_0x6530('0x1a')]);_0x5124fe['offset']=qs[_0x6530('0x18')](_0x29cc43[_0x6530('0x2e')]['offset']);}_0x5124fe['order']=qs[_0x6530('0x35')](_0x29cc43[_0x6530('0x2e')][_0x6530('0x35')]);_0x5124fe[_0x6530('0x36')]=qs[_0x6530('0x37')](_['pick'](_0x29cc43[_0x6530('0x2e')],_0x3ce0b4[_0x6530('0x37')]),_0x4305d2);if(_0x29cc43['query'][_0x6530('0x38')]){_0x5124fe[_0x6530('0x36')]=_[_0x6530('0x39')](_0x5124fe[_0x6530('0x36')],{'$or':_[_0x6530('0x28')](_0x4305d2,function(_0xce4186){if(_0xce4186[_0x6530('0x3a')]!=='VIRTUAL'){var _0x1e0ab6={};_0x1e0ab6[_0xce4186[_0x6530('0x25')]]={'$like':'%'+_0x29cc43[_0x6530('0x2e')][_0x6530('0x38')]+'%'};return _0x1e0ab6;}})});}_0x5124fe=_[_0x6530('0x39')]({},_0x5124fe,_0x29cc43[_0x6530('0x3b')]);var _0x30fd67={'where':_0x5124fe[_0x6530('0x36')]};return db[_0x6530('0x29')]['count'](_0x30fd67)[_0x6530('0x22')](function(_0x557c31){_0x5902e8['count']=_0x557c31;if(_0x29cc43[_0x6530('0x2e')][_0x6530('0x3c')]){_0x5124fe['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x6530('0x3d')](_0x5124fe);})[_0x6530('0x22')](function(_0x56f27c){_0x5902e8[_0x6530('0x3e')]=_0x56f27c;return _0x5902e8;})[_0x6530('0x22')](respondWithFilteredResult(_0x1756fe,_0x5124fe))[_0x6530('0x3f')](handleError(_0x1756fe,null));};exports[_0x6530('0x40')]=function(_0xfb443e,_0x59afe3){var _0xd390c2={'raw':!![],'where':{'id':_0xfb443e[_0x6530('0x41')]['id']}},_0x18d2d8={};_0x18d2d8[_0x6530('0x2d')]=_['keys'](db[_0x6530('0x29')][_0x6530('0x2a')]);_0x18d2d8[_0x6530('0x2e')]=_['keys'](_0xfb443e[_0x6530('0x2e')]);_0x18d2d8[_0x6530('0x37')]=_[_0x6530('0x42')](_0x18d2d8['model'],_0x18d2d8['query']);_0xd390c2['attributes']=_[_0x6530('0x42')](_0x18d2d8[_0x6530('0x2d')],qs[_0x6530('0x31')](_0xfb443e[_0x6530('0x2e')][_0x6530('0x31')]));_0xd390c2[_0x6530('0x30')]=_0xd390c2['attributes'][_0x6530('0x32')]?_0xd390c2['attributes']:_0x18d2d8[_0x6530('0x2d')];if(_0xfb443e[_0x6530('0x2e')][_0x6530('0x3c')]){_0xd390c2[_0x6530('0x43')]=[{'all':!![]}];}_0xd390c2=_[_0x6530('0x39')]({},_0xd390c2,_0xfb443e[_0x6530('0x3b')]);return db['CmHopperHistory'][_0x6530('0x44')](_0xd390c2)['then'](handleEntityNotFound(_0x59afe3,null))['then'](respondWithResult(_0x59afe3,null))[_0x6530('0x3f')](handleError(_0x59afe3,null));};exports[_0x6530('0x45')]=function(_0x1e16fd,_0x5a11ba){return db[_0x6530('0x29')][_0x6530('0x45')](_0x1e16fd[_0x6530('0x46')],{})[_0x6530('0x22')](respondWithResult(_0x5a11ba,0xc9))[_0x6530('0x3f')](handleError(_0x5a11ba,null));};exports[_0x6530('0x47')]=function(_0x22af2b,_0x523e7a){return db[_0x6530('0x29')][_0x6530('0x47')]()[_0x6530('0x22')](respondWithResult(_0x523e7a,null))[_0x6530('0x3f')](handleError(_0x523e7a,null));};exports[_0x6530('0x21')]=function(_0x5ce914,_0x347494){if(_0x5ce914[_0x6530('0x46')][_0x6530('0x48')]){delete _0x5ce914['body'][_0x6530('0x48')];}return db[_0x6530('0x29')][_0x6530('0x44')]({'where':{'uniqueid':_0x5ce914['params']['id']}})['then'](handleEntityNotFound(_0x347494,null))[_0x6530('0x22')](saveUpdates(_0x5ce914[_0x6530('0x46')],null))['then'](respondWithResult(_0x347494,null))[_0x6530('0x3f')](handleError(_0x347494,null));}; \ No newline at end of file +var _0x3ed6=['name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperHistory','findAll','rows','show','params','includeAll','include','catch','create','body','describe','update','uniqueid','eml-format','fast-json-patch','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/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','destroy','then','error','stack'];(function(_0x53b824,_0xe366b4){var _0x1f02a0=function(_0x4d3b4c){while(--_0x4d3b4c){_0x53b824['push'](_0x53b824['shift']());}};_0x1f02a0(++_0xe366b4);}(_0x3ed6,0x74));var _0x63ed=function(_0x337ebc,_0x4d4f12){_0x337ebc=_0x337ebc-0x0;var _0xef593b=_0x3ed6[_0x337ebc];return _0xef593b;};'use strict';var emlformat=require(_0x63ed('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x63ed('0x1'));var rp=require('request-promise');var moment=require(_0x63ed('0x2'));var BPromise=require(_0x63ed('0x3'));var Mustache=require(_0x63ed('0x4'));var util=require('util');var path=require(_0x63ed('0x5'));var sox=require(_0x63ed('0x6'));var csv=require(_0x63ed('0x7'));var ejs=require(_0x63ed('0x8'));var fs=require('fs');var fs_extra=require(_0x63ed('0x9'));var _=require('lodash');var squel=require(_0x63ed('0xa'));var crypto=require(_0x63ed('0xb'));var jsforce=require(_0x63ed('0xc'));var deskjs=require(_0x63ed('0xd'));var toCsv=require('to-csv');var querystring=require(_0x63ed('0xe'));var Papa=require(_0x63ed('0xf'));var Redis=require(_0x63ed('0x10'));var authService=require(_0x63ed('0x11'));var qs=require(_0x63ed('0x12'));var as=require(_0x63ed('0x13'));var hardwareService=require(_0x63ed('0x14'));var logger=require(_0x63ed('0x15'))(_0x63ed('0x16'));var utils=require(_0x63ed('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x63ed('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x181f88,_0x32803f){_0x32803f=_0x32803f||0xcc;return function(_0x203f80){if(_0x203f80){return _0x181f88[_0x63ed('0x19')](_0x32803f);}return _0x181f88[_0x63ed('0x1a')](_0x32803f)[_0x63ed('0x1b')]();};}function respondWithResult(_0x3c1d54,_0x12bf87){_0x12bf87=_0x12bf87||0xc8;return function(_0x50ef81){if(_0x50ef81){return _0x3c1d54[_0x63ed('0x1a')](_0x12bf87)[_0x63ed('0x1c')](_0x50ef81);}};}function respondWithFilteredResult(_0x33d06c,_0x52a972){return function(_0x48c0f7){if(_0x48c0f7){var _0x36b11a=typeof _0x52a972[_0x63ed('0x1d')]===_0x63ed('0x1e')&&typeof _0x52a972[_0x63ed('0x1f')]==='undefined';var _0x1ff19d=_0x48c0f7[_0x63ed('0x20')];var _0x1c353e=_0x36b11a?0x0:_0x52a972[_0x63ed('0x1d')];var _0x1b0b45=_0x36b11a?_0x48c0f7['count']:_0x52a972[_0x63ed('0x1d')]+_0x52a972[_0x63ed('0x1f')];var _0x5784a6;if(_0x1b0b45>=_0x1ff19d){_0x1b0b45=_0x1ff19d;_0x5784a6=0xc8;}else{_0x5784a6=0xce;}_0x33d06c[_0x63ed('0x1a')](_0x5784a6);return _0x33d06c['set']('Content-Range',_0x1c353e+'-'+_0x1b0b45+'/'+_0x1ff19d)['json'](_0x48c0f7);}return null;};}function patchUpdates(_0x283748){return function(_0x9bc097){try{jsonpatch[_0x63ed('0x21')](_0x9bc097,_0x283748,!![]);}catch(_0x3e876c){return BPromise[_0x63ed('0x22')](_0x3e876c);}return _0x9bc097[_0x63ed('0x23')]();};}function saveUpdates(_0x1c5bd1,_0x3356e9){return function(_0x56c156){if(_0x56c156){return _0x56c156['update'](_0x1c5bd1)['then'](function(_0xbd064a){return _0xbd064a;});}return null;};}function removeEntity(_0x4efd34,_0x2c4046){return function(_0x3d462e){if(_0x3d462e){return _0x3d462e[_0x63ed('0x24')]()[_0x63ed('0x25')](function(){_0x4efd34[_0x63ed('0x1a')](0xcc)[_0x63ed('0x1b')]();});}};}function handleEntityNotFound(_0x16f58e,_0x212dec){return function(_0x57b3ae){if(!_0x57b3ae){_0x16f58e[_0x63ed('0x19')](0x194);}return _0x57b3ae;};}function handleError(_0x2bf1bb,_0x5081e6){_0x5081e6=_0x5081e6||0x1f4;return function(_0x1c9af3){logger[_0x63ed('0x26')](_0x1c9af3[_0x63ed('0x27')]);if(_0x1c9af3[_0x63ed('0x28')]){delete _0x1c9af3[_0x63ed('0x28')];}_0x2bf1bb[_0x63ed('0x1a')](_0x5081e6)[_0x63ed('0x29')](_0x1c9af3);};}exports[_0x63ed('0x2a')]=function(_0x436d3f,_0x526f26){var _0x353a6a={},_0x570fc3={},_0x9b6140={'count':0x0,'rows':[]};var _0x211c93=_['map'](db['CmHopperHistory'][_0x63ed('0x2b')],function(_0x3319b7){return{'name':_0x3319b7[_0x63ed('0x2c')],'type':_0x3319b7[_0x63ed('0x2d')]['key']};});_0x570fc3[_0x63ed('0x2e')]=_[_0x63ed('0x2f')](_0x211c93,_0x63ed('0x28'));_0x570fc3[_0x63ed('0x30')]=_[_0x63ed('0x31')](_0x436d3f[_0x63ed('0x30')]);_0x570fc3[_0x63ed('0x32')]=_[_0x63ed('0x33')](_0x570fc3['model'],_0x570fc3[_0x63ed('0x30')]);_0x353a6a[_0x63ed('0x34')]=_[_0x63ed('0x33')](_0x570fc3[_0x63ed('0x2e')],qs[_0x63ed('0x35')](_0x436d3f[_0x63ed('0x30')][_0x63ed('0x35')]));_0x353a6a[_0x63ed('0x34')]=_0x353a6a['attributes'][_0x63ed('0x36')]?_0x353a6a[_0x63ed('0x34')]:_0x570fc3[_0x63ed('0x2e')];if(!_0x436d3f['query'][_0x63ed('0x37')](_0x63ed('0x38'))){_0x353a6a['limit']=qs[_0x63ed('0x1f')](_0x436d3f[_0x63ed('0x30')][_0x63ed('0x1f')]);_0x353a6a[_0x63ed('0x1d')]=qs[_0x63ed('0x1d')](_0x436d3f[_0x63ed('0x30')][_0x63ed('0x1d')]);}_0x353a6a[_0x63ed('0x39')]=qs[_0x63ed('0x3a')](_0x436d3f[_0x63ed('0x30')][_0x63ed('0x3a')]);_0x353a6a[_0x63ed('0x3b')]=qs[_0x63ed('0x32')](_[_0x63ed('0x3c')](_0x436d3f[_0x63ed('0x30')],_0x570fc3['filters']),_0x211c93);if(_0x436d3f['query'][_0x63ed('0x3d')]){_0x353a6a['where']=_[_0x63ed('0x3e')](_0x353a6a[_0x63ed('0x3b')],{'$or':_[_0x63ed('0x2f')](_0x211c93,function(_0x56bcfa){if(_0x56bcfa[_0x63ed('0x2d')]!==_0x63ed('0x3f')){var _0x3e46aa={};_0x3e46aa[_0x56bcfa[_0x63ed('0x28')]]={'$like':'%'+_0x436d3f[_0x63ed('0x30')]['filter']+'%'};return _0x3e46aa;}})});}_0x353a6a=_[_0x63ed('0x3e')]({},_0x353a6a,_0x436d3f[_0x63ed('0x40')]);var _0x4afd05={'where':_0x353a6a[_0x63ed('0x3b')]};return db[_0x63ed('0x41')][_0x63ed('0x20')](_0x4afd05)[_0x63ed('0x25')](function(_0x2bbe90){_0x9b6140[_0x63ed('0x20')]=_0x2bbe90;if(_0x436d3f[_0x63ed('0x30')]['includeAll']){_0x353a6a['include']=[{'all':!![]}];}return db[_0x63ed('0x41')][_0x63ed('0x42')](_0x353a6a);})[_0x63ed('0x25')](function(_0x131d1c){_0x9b6140[_0x63ed('0x43')]=_0x131d1c;return _0x9b6140;})[_0x63ed('0x25')](respondWithFilteredResult(_0x526f26,_0x353a6a))['catch'](handleError(_0x526f26,null));};exports[_0x63ed('0x44')]=function(_0x171e88,_0x3a4ecb){var _0x5c2958={'raw':!![],'where':{'id':_0x171e88[_0x63ed('0x45')]['id']}},_0x5d4419={};_0x5d4419[_0x63ed('0x2e')]=_[_0x63ed('0x31')](db[_0x63ed('0x41')][_0x63ed('0x2b')]);_0x5d4419[_0x63ed('0x30')]=_[_0x63ed('0x31')](_0x171e88[_0x63ed('0x30')]);_0x5d4419[_0x63ed('0x32')]=_['intersection'](_0x5d4419[_0x63ed('0x2e')],_0x5d4419[_0x63ed('0x30')]);_0x5c2958[_0x63ed('0x34')]=_[_0x63ed('0x33')](_0x5d4419[_0x63ed('0x2e')],qs[_0x63ed('0x35')](_0x171e88[_0x63ed('0x30')][_0x63ed('0x35')]));_0x5c2958[_0x63ed('0x34')]=_0x5c2958[_0x63ed('0x34')][_0x63ed('0x36')]?_0x5c2958[_0x63ed('0x34')]:_0x5d4419['model'];if(_0x171e88['query'][_0x63ed('0x46')]){_0x5c2958[_0x63ed('0x47')]=[{'all':!![]}];}_0x5c2958=_[_0x63ed('0x3e')]({},_0x5c2958,_0x171e88[_0x63ed('0x40')]);return db[_0x63ed('0x41')]['find'](_0x5c2958)[_0x63ed('0x25')](handleEntityNotFound(_0x3a4ecb,null))[_0x63ed('0x25')](respondWithResult(_0x3a4ecb,null))[_0x63ed('0x48')](handleError(_0x3a4ecb,null));};exports['create']=function(_0x5c1957,_0x1dd83e){return db[_0x63ed('0x41')][_0x63ed('0x49')](_0x5c1957[_0x63ed('0x4a')],{})['then'](respondWithResult(_0x1dd83e,0xc9))[_0x63ed('0x48')](handleError(_0x1dd83e,null));};exports[_0x63ed('0x4b')]=function(_0x2b2542,_0x427a2c){return db['CmHopperHistory'][_0x63ed('0x4b')]()['then'](respondWithResult(_0x427a2c,null))[_0x63ed('0x48')](handleError(_0x427a2c,null));};exports[_0x63ed('0x4c')]=function(_0x14a539,_0x20c813){if(_0x14a539[_0x63ed('0x4a')][_0x63ed('0x4d')]){delete _0x14a539['body'][_0x63ed('0x4d')];}return db[_0x63ed('0x41')]['find']({'where':{'uniqueid':_0x14a539[_0x63ed('0x45')]['id']}})[_0x63ed('0x25')](handleEntityNotFound(_0x20c813,null))['then'](saveUpdates(_0x14a539[_0x63ed('0x4a')],null))[_0x63ed('0x25')](respondWithResult(_0x20c813,null))['catch'](handleError(_0x20c813,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 8e3704f..9efbde4 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 _0x9e6d=['api','moment','request-promise','path','rimraf','../../config/environment','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','../../config/logger'];(function(_0x42c637,_0x1f1500){var _0x597ae8=function(_0x2f10a2){while(--_0x2f10a2){_0x42c637['push'](_0x42c637['shift']());}};_0x597ae8(++_0x1f1500);}(_0x9e6d,0x1d2));var _0xd9e6=function(_0x2d59b5,_0x22b077){_0x2d59b5=_0x2d59b5-0x0;var _0x36c0eb=_0x9e6d[_0x2d59b5];return _0x36c0eb;};'use strict';var _=require(_0xd9e6('0x0'));var util=require('util');var logger=require(_0xd9e6('0x1'))(_0xd9e6('0x2'));var moment=require(_0xd9e6('0x3'));var BPromise=require('bluebird');var rp=require(_0xd9e6('0x4'));var fs=require('fs');var path=require(_0xd9e6('0x5'));var rimraf=require(_0xd9e6('0x6'));var config=require(_0xd9e6('0x7'));var attributes=require('./cmHopperHistory.attributes');module[_0xd9e6('0x8')]=function(_0x167f8f,_0x525209){return _0x167f8f['define'](_0xd9e6('0x9'),attributes,{'tableName':_0xd9e6('0xa'),'paranoid':![],'indexes':[{'name':_0xd9e6('0xb'),'fields':['endtime']},{'name':_0xd9e6('0xc'),'fields':[_0xd9e6('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf65d=['cm_hopper_history','endtime','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','exports','define'];(function(_0x40724c,_0x19b98){var _0x2beff1=function(_0x13a654){while(--_0x13a654){_0x40724c['push'](_0x40724c['shift']());}};_0x2beff1(++_0x19b98);}(_0xf65d,0x9f));var _0xdf65=function(_0x5cf3c0,_0x4363c1){_0x5cf3c0=_0x5cf3c0-0x0;var _0x39a680=_0xf65d[_0x5cf3c0];return _0x39a680;};'use strict';var _=require(_0xdf65('0x0'));var util=require('util');var logger=require(_0xdf65('0x1'))(_0xdf65('0x2'));var moment=require(_0xdf65('0x3'));var BPromise=require(_0xdf65('0x4'));var rp=require(_0xdf65('0x5'));var fs=require('fs');var path=require(_0xdf65('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopperHistory.attributes');module[_0xdf65('0x7')]=function(_0x4ac44a,_0x254ddf){return _0x4ac44a[_0xdf65('0x8')]('CmHopperHistory',attributes,{'tableName':_0xdf65('0x9'),'paranoid':![],'indexes':[{'name':_0xdf65('0xa'),'fields':[_0xdf65('0xa')]},{'name':_0xdf65('0xb'),'fields':[_0xdf65('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 2af4dd7..6326b12 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 _0x97a8=['`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`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','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','then','col','ivrTotalCallsDays','GetCampaignHopperHistory','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','message','catch','CreateCmHopperHistory','body','options','raw','stringify','AvgHandleTime','CmHopperHistory','findAll','where','sequelize','COUNT','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls'];(function(_0xd9cd7c,_0x460b47){var _0x443175=function(_0x5e869a){while(--_0x5e869a){_0xd9cd7c['push'](_0xd9cd7c['shift']());}};_0x443175(++_0x460b47);}(_0x97a8,0xe3));var _0x897a=function(_0x1d5d94,_0x1291a2){_0x1d5d94=_0x1d5d94-0x0;var _0x4722fb=_0x97a8[_0x1d5d94];return _0x4722fb;};'use strict';var _=require('lodash');var util=require(_0x897a('0x0'));var moment=require(_0x897a('0x1'));var BPromise=require(_0x897a('0x2'));var rs=require(_0x897a('0x3'));var fs=require('fs');var Redis=require(_0x897a('0x4'));var db=require(_0x897a('0x5'))['db'];var utils=require(_0x897a('0x6'));var logger=require('../../config/logger')(_0x897a('0x7'));var config=require(_0x897a('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59b9f1,_0x3eb794,_0x128644){return new BPromise(function(_0x3cd748,_0x364c09){return client[_0x897a('0x9')](_0x59b9f1,_0x128644)['then'](function(_0x18ecde){logger[_0x897a('0xa')](_0x897a('0xb'),_0x3eb794,_0x897a('0xc'));logger[_0x897a('0xd')](_0x897a('0xe'),_0x3eb794,_0x897a('0xc'),JSON['stringify'](_0x18ecde));if(_0x18ecde['error']){if(_0x18ecde['error']['code']===0x1f4){logger[_0x897a('0xf')]('CmHopperHistory,\x20%s,\x20%s',_0x3eb794,_0x18ecde[_0x897a('0xf')][_0x897a('0x10')]);return _0x364c09(_0x18ecde[_0x897a('0xf')][_0x897a('0x10')]);}logger['error'](_0x897a('0xb'),_0x3eb794,_0x18ecde[_0x897a('0xf')][_0x897a('0x10')]);return _0x3cd748(_0x18ecde[_0x897a('0xf')]['message']);}else{logger['info'](_0x897a('0xb'),_0x3eb794,_0x897a('0xc'));_0x3cd748(_0x18ecde['result'][_0x897a('0x10')]);}})[_0x897a('0x11')](function(_0xaf826e){logger[_0x897a('0xf')](_0x897a('0xb'),_0x3eb794,_0xaf826e);_0x364c09(_0xaf826e);});});}exports[_0x897a('0x12')]=function(_0x10047d){var _0x1011b4=this;return new Promise(function(_0x2646cb,_0x2d96a){return db['CmHopperHistory']['create'](_0x10047d[_0x897a('0x13')],{'raw':_0x10047d[_0x897a('0x14')]?_0x10047d[_0x897a('0x14')][_0x897a('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x73e29d){logger[_0x897a('0xa')](_0x897a('0x12'),_0x10047d);logger[_0x897a('0xd')]('CreateCmHopperHistory',_0x10047d,JSON[_0x897a('0x16')](_0x73e29d));_0x2646cb(_0x73e29d);})[_0x897a('0x11')](function(_0x584b3b){logger[_0x897a('0xf')]('CreateCmHopperHistory',_0x584b3b[_0x897a('0x10')],_0x10047d);_0x2d96a(_0x1011b4[_0x897a('0xf')](0x1f4,_0x584b3b[_0x897a('0x10')]));});});};exports[_0x897a('0x17')]=function(_0x22e77a){var _0x48b8fd=this;return new Promise(function(_0x3873b7,_0x2feb39){return db[_0x897a('0x18')][_0x897a('0x19')]({'raw':_0x22e77a[_0x897a('0x14')]?_0x22e77a[_0x897a('0x14')][_0x897a('0x15')]===undefined?!![]:![]:!![],'where':_0x22e77a[_0x897a('0x14')]?_0x22e77a[_0x897a('0x14')][_0x897a('0x1a')]||null:null,'attributes':[[db[_0x897a('0x1b')]['fn'](_0x897a('0x1c'),db[_0x897a('0x1b')]['col']('id')),_0x897a('0x1d')],[db[_0x897a('0x1b')]['fn'](_0x897a('0x1c'),db[_0x897a('0x1b')]['fn']('IF',db[_0x897a('0x1b')][_0x897a('0x1e')](_0x897a('0x1f')))),_0x897a('0x20')],[db[_0x897a('0x1b')]['fn'](_0x897a('0x1c'),db[_0x897a('0x1b')]['fn']('IF',db[_0x897a('0x1b')]['literal'](_0x897a('0x21')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x897a('0x1b')]['fn'](_0x897a('0x1c'),db[_0x897a('0x1b')]['fn']('IF',db[_0x897a('0x1b')][_0x897a('0x1e')](_0x897a('0x22')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x897a('0x1b')]['fn'](_0x897a('0x23'),db[_0x897a('0x1b')]['fn']('IF',db[_0x897a('0x1b')][_0x897a('0x1e')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db[_0x897a('0x1b')]['fn'](_0x897a('0x23'),db[_0x897a('0x1b')]['fn']('IF',db['sequelize'][_0x897a('0x1e')](_0x897a('0x24')))),_0x897a('0x25')]]})['then'](function(_0x2eef3f){logger[_0x897a('0xa')]('AvgHandleTime',_0x22e77a);logger['debug'](_0x897a('0x17'),_0x22e77a,JSON['stringify'](_0x2eef3f));_0x3873b7(_0x2eef3f);})['catch'](function(_0x348d4a){logger[_0x897a('0xf')](_0x897a('0x17'),_0x348d4a[_0x897a('0x10')],_0x22e77a);_0x2feb39(_0x48b8fd['error'](0x1f4,_0x348d4a['message']));});});};exports[_0x897a('0x26')]=function(_0x1f2044){var _0x473191=this;return new Promise(function(_0x1cb85d,_0x388b76){return db['CmHopperHistory'][_0x897a('0x19')]({'raw':_0x1f2044[_0x897a('0x14')]?_0x1f2044['options'][_0x897a('0x15')]===undefined?!![]:![]:!![],'where':_0x1f2044['options']?_0x1f2044[_0x897a('0x14')][_0x897a('0x1a')]||null:null,'attributes':[[_0x897a('0x27'),_0x897a('0x28')],[db[_0x897a('0x1b')]['fn'](_0x897a('0x1c'),db['sequelize']['fn']('IF',db[_0x897a('0x1b')][_0x897a('0x1e')](_0x897a('0x29')))),'outboundNoSuchCallsDay'],[db[_0x897a('0x1b')]['fn'](_0x897a('0x1c'),db['sequelize']['fn']('IF',db[_0x897a('0x1b')]['literal'](_0x897a('0x2a')))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn'](_0x897a('0x1c'),db[_0x897a('0x1b')]['fn']('IF',db[_0x897a('0x1b')][_0x897a('0x1e')](_0x897a('0x1f')))),_0x897a('0x2b')],[db[_0x897a('0x1b')]['fn']('COUNT',db[_0x897a('0x1b')]['fn']('IF',db['sequelize'][_0x897a('0x1e')](_0x897a('0x2c')))),'outboundBusyCallsDay'],[db[_0x897a('0x1b')]['fn'](_0x897a('0x1c'),db['sequelize']['fn']('IF',db[_0x897a('0x1b')][_0x897a('0x1e')](_0x897a('0x2d')))),'outboundCongestionCallsDay'],[db['sequelize']['fn'](_0x897a('0x1c'),db['sequelize']['fn']('IF',db[_0x897a('0x1b')][_0x897a('0x1e')](_0x897a('0x2e')))),_0x897a('0x2f')],[db[_0x897a('0x1b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x897a('0x1b')][_0x897a('0x1e')](_0x897a('0x30')))),_0x897a('0x31')],[db[_0x897a('0x1b')]['fn'](_0x897a('0x1c'),db['sequelize']['fn']('IF',db[_0x897a('0x1b')][_0x897a('0x1e')](_0x897a('0x32')))),_0x897a('0x33')],[db[_0x897a('0x1b')]['fn'](_0x897a('0x1c'),db[_0x897a('0x1b')]['fn']('IF',db[_0x897a('0x1b')][_0x897a('0x1e')](_0x897a('0x34')))),_0x897a('0x35')],[db['sequelize']['fn'](_0x897a('0x1c'),db[_0x897a('0x1b')]['fn']('IF',db['sequelize']['literal'](_0x897a('0x36')))),_0x897a('0x37')],[db['sequelize']['fn']('COUNT',db[_0x897a('0x1b')]['fn']('IF',db[_0x897a('0x1b')]['literal'](_0x897a('0x38')))),_0x897a('0x39')],[db[_0x897a('0x1b')]['fn'](_0x897a('0x1c'),db['sequelize']['fn']('IF',db[_0x897a('0x1b')]['literal'](_0x897a('0x3a')))),_0x897a('0x3b')],[db[_0x897a('0x1b')]['fn'](_0x897a('0x1c'),db['sequelize']['fn']('IF',db[_0x897a('0x1b')]['literal'](_0x897a('0x3c')))),_0x897a('0x39')],[db[_0x897a('0x1b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x897a('0x1b')][_0x897a('0x1e')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0x897a('0x27')]})[_0x897a('0x3d')](function(_0x17e3eb){logger[_0x897a('0xa')](_0x897a('0x26'),_0x1f2044);logger['debug'](_0x897a('0x26'),_0x1f2044,JSON[_0x897a('0x16')](_0x17e3eb));_0x1cb85d(_0x17e3eb);})[_0x897a('0x11')](function(_0x2e9df4){logger[_0x897a('0xf')]('GetVoiceQueueHopperHistory',_0x2e9df4[_0x897a('0x10')],_0x1f2044);_0x388b76(_0x473191[_0x897a('0xf')](0x1f4,_0x2e9df4[_0x897a('0x10')]));});});};exports['GetCampaignHopperHistory']=function(_0x3cf53f){var _0x485cca=this;return new Promise(function(_0x181d71,_0x5165bd){return db[_0x897a('0x18')][_0x897a('0x19')]({'raw':_0x3cf53f[_0x897a('0x14')]?_0x3cf53f[_0x897a('0x14')][_0x897a('0x15')]===undefined?!![]:![]:!![],'where':_0x3cf53f[_0x897a('0x14')]?_0x3cf53f[_0x897a('0x14')][_0x897a('0x1a')]||null:null,'attributes':[[_0x897a('0x27'),_0x897a('0x28')],[db[_0x897a('0x1b')]['fn'](_0x897a('0x1c'),db[_0x897a('0x1b')][_0x897a('0x3e')]('id')),_0x897a('0x3f')],[db[_0x897a('0x1b')]['fn'](_0x897a('0x1c'),db['sequelize']['fn']('IF',db[_0x897a('0x1b')][_0x897a('0x1e')](_0x897a('0x1f')))),'ivrAnswerCallsDay']],'group':[_0x897a('0x27')]})[_0x897a('0x3d')](function(_0x5e6acd){logger['info'](_0x897a('0x40'),_0x3cf53f);logger['debug'](_0x897a('0x40'),_0x3cf53f,JSON[_0x897a('0x16')](_0x5e6acd));_0x181d71(_0x5e6acd);})['catch'](function(_0x426cab){logger[_0x897a('0xf')](_0x897a('0x40'),_0x426cab[_0x897a('0x10')],_0x3cf53f);_0x5165bd(_0x485cca[_0x897a('0xf')](0x1f4,_0x426cab[_0x897a('0x10')]));});});}; \ No newline at end of file +var _0xe706=['GetCampaignHopperHistory','findAll','name','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateCmHopperHistory','create','body','options','raw','stringify','AvgHandleTime','CmHopperHistory','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`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','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe706,0xa3));var _0x6e70=function(_0x44a94,_0x39f323){_0x44a94=_0x44a94-0x0;var _0x31ef56=_0xe706[_0x44a94];return _0x31ef56;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}exports[_0x6e70('0x19')]=function(_0x5ea7a5){var _0x28a21f=this;return new Promise(function(_0x173afe,_0x53acdc){return db['CmHopperHistory'][_0x6e70('0x1a')](_0x5ea7a5[_0x6e70('0x1b')],{'raw':_0x5ea7a5[_0x6e70('0x1c')]?_0x5ea7a5[_0x6e70('0x1c')][_0x6e70('0x1d')]===undefined?!![]:![]:!![]})[_0x6e70('0xe')](function(_0x1b2453){logger[_0x6e70('0xf')](_0x6e70('0x19'),_0x5ea7a5);logger[_0x6e70('0x12')]('CreateCmHopperHistory',_0x5ea7a5,JSON[_0x6e70('0x1e')](_0x1b2453));_0x173afe(_0x1b2453);})[_0x6e70('0x18')](function(_0x27b294){logger['error'](_0x6e70('0x19'),_0x27b294[_0x6e70('0x16')],_0x5ea7a5);_0x53acdc(_0x28a21f[_0x6e70('0x14')](0x1f4,_0x27b294['message']));});});};exports[_0x6e70('0x1f')]=function(_0x538b9c){var _0x50aec2=this;return new Promise(function(_0x4e97c7,_0x41e352){return db[_0x6e70('0x20')]['findAll']({'raw':_0x538b9c[_0x6e70('0x1c')]?_0x538b9c[_0x6e70('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x538b9c[_0x6e70('0x1c')]?_0x538b9c[_0x6e70('0x1c')][_0x6e70('0x21')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x6e70('0x22')][_0x6e70('0x23')]('id')),_0x6e70('0x24')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db['sequelize']['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x27')))),_0x6e70('0x28')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x29')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x6e70('0x22')]['fn']('COUNT',db[_0x6e70('0x22')]['fn']('IF',db['sequelize'][_0x6e70('0x26')](_0x6e70('0x2a')))),_0x6e70('0x2b')],[db['sequelize']['fn'](_0x6e70('0x2c'),db[_0x6e70('0x22')]['fn']('IF',db['sequelize'][_0x6e70('0x26')](_0x6e70('0x2d')))),'predictiveIntervalAvgHoldtime'],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x2c'),db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x2e')))),_0x6e70('0x2f')]]})[_0x6e70('0xe')](function(_0xf146fd){logger[_0x6e70('0xf')]('AvgHandleTime',_0x538b9c);logger[_0x6e70('0x12')]('AvgHandleTime',_0x538b9c,JSON[_0x6e70('0x1e')](_0xf146fd));_0x4e97c7(_0xf146fd);})[_0x6e70('0x18')](function(_0x98c683){logger[_0x6e70('0x14')](_0x6e70('0x1f'),_0x98c683[_0x6e70('0x16')],_0x538b9c);_0x41e352(_0x50aec2[_0x6e70('0x14')](0x1f4,_0x98c683[_0x6e70('0x16')]));});});};exports[_0x6e70('0x30')]=function(_0x198dd1){var _0x2a5444=this;return new Promise(function(_0x23d5e2,_0x5594d3){return db['CmHopperHistory']['findAll']({'raw':_0x198dd1['options']?_0x198dd1[_0x6e70('0x1c')][_0x6e70('0x1d')]===undefined?!![]:![]:!![],'where':_0x198dd1[_0x6e70('0x1c')]?_0x198dd1[_0x6e70('0x1c')][_0x6e70('0x21')]||null:null,'attributes':[[_0x6e70('0x31'),'name'],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x32')))),_0x6e70('0x33')],[db[_0x6e70('0x22')]['fn']('COUNT',db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x34')))),_0x6e70('0x35')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x6e70('0x27')))),_0x6e70('0x36')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db[_0x6e70('0x22')]['fn']('IF',db['sequelize'][_0x6e70('0x26')](_0x6e70('0x37')))),_0x6e70('0x38')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6e70('0x22')]['literal'](_0x6e70('0x39')))),_0x6e70('0x3a')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db['sequelize']['fn']('IF',db[_0x6e70('0x22')]['literal'](_0x6e70('0x3b')))),_0x6e70('0x3c')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db['sequelize']['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x3d')))),_0x6e70('0x3e')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db[_0x6e70('0x22')]['fn']('IF',db['sequelize'][_0x6e70('0x26')](_0x6e70('0x3f')))),_0x6e70('0x40')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')]['literal'](_0x6e70('0x41')))),'outboundBlacklistCallsDay'],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db['sequelize']['fn']('IF',db['sequelize'][_0x6e70('0x26')](_0x6e70('0x42')))),_0x6e70('0x43')],[db['sequelize']['fn']('COUNT',db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x44')))),_0x6e70('0x45')],[db[_0x6e70('0x22')]['fn']('COUNT',db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x46')))),_0x6e70('0x47')],[db['sequelize']['fn']('COUNT',db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x48')))),_0x6e70('0x45')],[db['sequelize']['fn'](_0x6e70('0x25'),db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')][_0x6e70('0x26')](_0x6e70('0x49')))),'outboundReCallsDay']],'group':[_0x6e70('0x31')]})[_0x6e70('0xe')](function(_0x2c20d3){logger[_0x6e70('0xf')](_0x6e70('0x30'),_0x198dd1);logger[_0x6e70('0x12')]('GetVoiceQueueHopperHistory',_0x198dd1,JSON[_0x6e70('0x1e')](_0x2c20d3));_0x23d5e2(_0x2c20d3);})[_0x6e70('0x18')](function(_0x5c2396){logger[_0x6e70('0x14')](_0x6e70('0x30'),_0x5c2396['message'],_0x198dd1);_0x5594d3(_0x2a5444[_0x6e70('0x14')](0x1f4,_0x5c2396[_0x6e70('0x16')]));});});};exports[_0x6e70('0x4a')]=function(_0x46d536){var _0xfcadfe=this;return new Promise(function(_0x53f8fc,_0x385825){return db[_0x6e70('0x20')][_0x6e70('0x4b')]({'raw':_0x46d536[_0x6e70('0x1c')]?_0x46d536[_0x6e70('0x1c')][_0x6e70('0x1d')]===undefined?!![]:![]:!![],'where':_0x46d536[_0x6e70('0x1c')]?_0x46d536[_0x6e70('0x1c')][_0x6e70('0x21')]||null:null,'attributes':[[_0x6e70('0x31'),_0x6e70('0x4c')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db[_0x6e70('0x22')][_0x6e70('0x23')]('id')),_0x6e70('0x4d')],[db[_0x6e70('0x22')]['fn'](_0x6e70('0x25'),db[_0x6e70('0x22')]['fn']('IF',db[_0x6e70('0x22')]['literal'](_0x6e70('0x27')))),_0x6e70('0x4e')]],'group':[_0x6e70('0x31')]})[_0x6e70('0xe')](function(_0x36757e){logger[_0x6e70('0xf')]('GetCampaignHopperHistory',_0x46d536);logger[_0x6e70('0x12')](_0x6e70('0x4a'),_0x46d536,JSON['stringify'](_0x36757e));_0x53f8fc(_0x36757e);})[_0x6e70('0x18')](function(_0x692205){logger[_0x6e70('0x14')]('GetCampaignHopperHistory',_0x692205['message'],_0x46d536);_0x385825(_0xfcadfe[_0x6e70('0x14')](0x1f4,_0x692205[_0x6e70('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 56b5c3e..7110516 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 _0xf2d4=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','exports','multer','path','connect-timeout','express','fs-extra'];(function(_0x19cf99,_0x2e2acd){var _0x42898b=function(_0x394d81){while(--_0x394d81){_0x19cf99['push'](_0x19cf99['shift']());}};_0x42898b(++_0x2e2acd);}(_0xf2d4,0x1ab));var _0x4f2d=function(_0x2185d3,_0x43154b){_0x2185d3=_0x2185d3-0x0;var _0xed50f=_0xf2d4[_0x2185d3];return _0xed50f;};'use strict';var multer=require(_0x4f2d('0x0'));var util=require('util');var path=require(_0x4f2d('0x1'));var timeout=require(_0x4f2d('0x2'));var express=require(_0x4f2d('0x3'));var router=express['Router']();var fs_extra=require(_0x4f2d('0x4'));var auth=require(_0x4f2d('0x5'));var interaction=require(_0x4f2d('0x6'));var config=require(_0x4f2d('0x7'));var controller=require(_0x4f2d('0x8'));router[_0x4f2d('0x9')]('/',auth[_0x4f2d('0xa')](),controller[_0x4f2d('0xb')]);router[_0x4f2d('0x9')](_0x4f2d('0xc'),auth['isAuthenticated'](),controller[_0x4f2d('0xd')]);router[_0x4f2d('0x9')](_0x4f2d('0xe'),auth[_0x4f2d('0xa')](),controller[_0x4f2d('0xf')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x4f2d('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);module[_0x4f2d('0x11')]=router; \ No newline at end of file +var _0x50c1=['./cmHopperHistory.controller','get','isAuthenticated','index','/describe','post','put','/:id','update','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xc973f8,_0x1759ec){var _0x5cd9d5=function(_0x582522){while(--_0x582522){_0xc973f8['push'](_0xc973f8['shift']());}};_0x5cd9d5(++_0x1759ec);}(_0x50c1,0x118));var _0x150c=function(_0x135e66,_0x21ab7e){_0x135e66=_0x135e66-0x0;var _0x3df15e=_0x50c1[_0x135e66];return _0x3df15e;};'use strict';var multer=require(_0x150c('0x0'));var util=require(_0x150c('0x1'));var path=require(_0x150c('0x2'));var timeout=require(_0x150c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x150c('0x4'));var auth=require(_0x150c('0x5'));var interaction=require(_0x150c('0x6'));var config=require(_0x150c('0x7'));var controller=require(_0x150c('0x8'));router[_0x150c('0x9')]('/',auth[_0x150c('0xa')](),controller[_0x150c('0xb')]);router[_0x150c('0x9')](_0x150c('0xc'),auth[_0x150c('0xa')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x150c('0xd')]('/',auth[_0x150c('0xa')](),controller['create']);router[_0x150c('0xe')](_0x150c('0xf'),auth['isAuthenticated'](),controller[_0x150c('0x10')]);module[_0x150c('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index e27da5b..f946b82 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 _0x1793=['STRING','name','sequelize','exports'];(function(_0x1724ad,_0x4afb5d){var _0x3187be=function(_0x4747a5){while(--_0x4747a5){_0x1724ad['push'](_0x1724ad['shift']());}};_0x3187be(++_0x4afb5d);}(_0x1793,0x1ce));var _0x3179=function(_0x518f9f,_0x1a6f19){_0x518f9f=_0x518f9f-0x0;var _0x274520=_0x1793[_0x518f9f];return _0x274520;};'use strict';var Sequelize=require(_0x3179('0x0'));module[_0x3179('0x1')]={'name':{'type':Sequelize[_0x3179('0x2')],'unique':_0x3179('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x3179('0x2')]}}; \ No newline at end of file +var _0x56e6=['exports','STRING','name','sequelize'];(function(_0x3a43f5,_0xb1e4d8){var _0x1400e7=function(_0x407166){while(--_0x407166){_0x3a43f5['push'](_0x3a43f5['shift']());}};_0x1400e7(++_0xb1e4d8);}(_0x56e6,0x6b));var _0x656e=function(_0xf91841,_0x182ae3){_0xf91841=_0xf91841-0x0;var _0x4b9c44=_0x56e6[_0xf91841];return _0x4b9c44;};'use strict';var Sequelize=require(_0x656e('0x0'));module[_0x656e('0x1')]={'name':{'type':Sequelize[_0x656e('0x2')],'unique':_0x656e('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x656e('0x2')]},'dialPrefix':{'type':Sequelize[_0x656e('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index b4f102a..e34e210 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 _0x58e4=['./cmList.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','get','Lists','end','error','stack','name','send','index','CmList','rawAttributes','key','map','query','keys','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ListId','Disposition','getDispositions','findOne','CmContact','tags','isArray','join','push','omit','ids','dataValues','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','cf_%d','getContactsCsv','alias','select','from','cm_contacts','c.deletedAt\x20is\x20null','field','c.cf_','customField_','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','toString','each','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','transaction','addCustomFields','Sequelize','TEXT','text','number','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','getCustomFields','findAndCountAll','addAgents','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost'];(function(_0x405c4a,_0x15fd70){var _0x45b9ff=function(_0x45d823){while(--_0x45d823){_0x405c4a['push'](_0x405c4a['shift']());}};_0x45b9ff(++_0x15fd70);}(_0x58e4,0x128));var _0x458e=function(_0x4b0eaf,_0x95c934){_0x4b0eaf=_0x4b0eaf-0x0;var _0x13e96a=_0x58e4[_0x4b0eaf];return _0x13e96a;};'use strict';var emlformat=require(_0x458e('0x0'));var rimraf=require(_0x458e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x458e('0x2'));var rp=require(_0x458e('0x3'));var moment=require('moment');var BPromise=require(_0x458e('0x4'));var Mustache=require('mustache');var util=require(_0x458e('0x5'));var path=require(_0x458e('0x6'));var sox=require('sox');var csv=require(_0x458e('0x7'));var ejs=require(_0x458e('0x8'));var fs=require('fs');var fs_extra=require(_0x458e('0x9'));var _=require(_0x458e('0xa'));var squel=require(_0x458e('0xb'));var crypto=require('crypto');var jsforce=require(_0x458e('0xc'));var deskjs=require(_0x458e('0xd'));var toCsv=require(_0x458e('0x7'));var querystring=require(_0x458e('0xe'));var Papa=require('papaparse');var Redis=require(_0x458e('0xf'));var authService=require(_0x458e('0x10'));var qs=require(_0x458e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x458e('0x12'));var logger=require('../../config/logger')(_0x458e('0x13'));var utils=require('../../config/utils');var config=require(_0x458e('0x14'));var licenseUtil=require(_0x458e('0x15'));var db=require(_0x458e('0x16'))['db'];var csv_results;config[_0x458e('0x17')]=_[_0x458e('0x18')](config[_0x458e('0x17')],{'host':_0x458e('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x458e('0x17')]));require(_0x458e('0x1a'))[_0x458e('0x1b')](socket);function respondWithStatusCode(_0x4f1b06,_0x53da91){_0x53da91=_0x53da91||0xcc;return function(_0x4eecef){if(_0x4eecef){return _0x4f1b06[_0x458e('0x1c')](_0x53da91);}return _0x4f1b06['status'](_0x53da91)['end']();};}function respondWithResult(_0x571357,_0x4e2d98){_0x4e2d98=_0x4e2d98||0xc8;return function(_0x354bfa){if(_0x354bfa){return _0x571357[_0x458e('0x1d')](_0x4e2d98)[_0x458e('0x1e')](_0x354bfa);}};}function respondWithFilteredResult(_0x13ba00,_0x650c19){return function(_0x444593){if(_0x444593){var _0x49eb09=typeof _0x650c19[_0x458e('0x1f')]===_0x458e('0x20')&&typeof _0x650c19[_0x458e('0x21')]===_0x458e('0x20');var _0x2447c7=_0x444593[_0x458e('0x22')];var _0xc447ee=_0x49eb09?0x0:_0x650c19['offset'];var _0xdab85d=_0x49eb09?_0x444593[_0x458e('0x22')]:_0x650c19[_0x458e('0x1f')]+_0x650c19[_0x458e('0x21')];var _0x43893e;if(_0xdab85d>=_0x2447c7){_0xdab85d=_0x2447c7;_0x43893e=0xc8;}else{_0x43893e=0xce;}_0x13ba00[_0x458e('0x1d')](_0x43893e);return _0x13ba00[_0x458e('0x23')](_0x458e('0x24'),_0xc447ee+'-'+_0xdab85d+'/'+_0x2447c7)[_0x458e('0x1e')](_0x444593);}return null;};}function patchUpdates(_0x5b062c){return function(_0x335135){try{jsonpatch[_0x458e('0x25')](_0x335135,_0x5b062c,!![]);}catch(_0x22bbed){return BPromise[_0x458e('0x26')](_0x22bbed);}return _0x335135[_0x458e('0x27')]();};}function saveUpdates(_0x16b996,_0x3668dd){return function(_0x47730c){if(_0x47730c){return _0x47730c['update'](_0x16b996)['then'](function(_0xbaf4df){return _0xbaf4df;});}return null;};}function removeEntity(_0x451ec5,_0x245416){return function(_0x738723){if(_0x738723){return _0x738723[_0x458e('0x28')]()[_0x458e('0x29')](function(){var _0x30923c=_0x738723[_0x458e('0x2a')]({'plain':!![]});var _0x2967e6=_0x458e('0x2b');return db['UserProfileResource'][_0x458e('0x28')]({'where':{'type':_0x2967e6,'resourceId':_0x30923c['id']}})[_0x458e('0x29')](function(){return _0x738723;});})[_0x458e('0x29')](function(){_0x451ec5[_0x458e('0x1d')](0xcc)[_0x458e('0x2c')]();});}};}function handleEntityNotFound(_0x3afb3a,_0x3cea37){return function(_0x548403){if(!_0x548403){_0x3afb3a['sendStatus'](0x194);}return _0x548403;};}function handleError(_0x7cfec2,_0x4cf6bd){_0x4cf6bd=_0x4cf6bd||0x1f4;return function(_0x4ad449){logger[_0x458e('0x2d')](_0x4ad449[_0x458e('0x2e')]);if(_0x4ad449[_0x458e('0x2f')]){delete _0x4ad449[_0x458e('0x2f')];}_0x7cfec2['status'](_0x4cf6bd)[_0x458e('0x30')](_0x4ad449);};}exports[_0x458e('0x31')]=function(_0x52de31,_0x327b7c){var _0x5f1701={},_0x157f0f={},_0x1e2fa6={'count':0x0,'rows':[]};var _0x15758a=_['map'](db[_0x458e('0x32')][_0x458e('0x33')],function(_0xf13bc8){return{'name':_0xf13bc8['fieldName'],'type':_0xf13bc8['type'][_0x458e('0x34')]};});_0x157f0f['model']=_[_0x458e('0x35')](_0x15758a,_0x458e('0x2f'));_0x157f0f[_0x458e('0x36')]=_[_0x458e('0x37')](_0x52de31[_0x458e('0x36')]);_0x157f0f[_0x458e('0x38')]=_['intersection'](_0x157f0f[_0x458e('0x39')],_0x157f0f[_0x458e('0x36')]);_0x5f1701['attributes']=_['intersection'](_0x157f0f[_0x458e('0x39')],qs[_0x458e('0x3a')](_0x52de31[_0x458e('0x36')][_0x458e('0x3a')]));_0x5f1701[_0x458e('0x3b')]=_0x5f1701[_0x458e('0x3b')][_0x458e('0x3c')]?_0x5f1701['attributes']:_0x157f0f[_0x458e('0x39')];if(!_0x52de31['query'][_0x458e('0x3d')](_0x458e('0x3e'))){_0x5f1701[_0x458e('0x21')]=qs[_0x458e('0x21')](_0x52de31[_0x458e('0x36')]['limit']);_0x5f1701[_0x458e('0x1f')]=qs[_0x458e('0x1f')](_0x52de31[_0x458e('0x36')][_0x458e('0x1f')]);}_0x5f1701[_0x458e('0x3f')]=qs[_0x458e('0x40')](_0x52de31[_0x458e('0x36')][_0x458e('0x40')]);_0x5f1701[_0x458e('0x41')]=qs[_0x458e('0x38')](_[_0x458e('0x42')](_0x52de31[_0x458e('0x36')],_0x157f0f[_0x458e('0x38')]),_0x15758a);if(_0x52de31[_0x458e('0x36')][_0x458e('0x43')]){_0x5f1701[_0x458e('0x41')]=_[_0x458e('0x44')](_0x5f1701['where'],{'$or':_[_0x458e('0x35')](_0x15758a,function(_0x5ce094){if(_0x5ce094[_0x458e('0x45')]!==_0x458e('0x46')){var _0x90255={};_0x90255[_0x5ce094['name']]={'$like':'%'+_0x52de31[_0x458e('0x36')][_0x458e('0x43')]+'%'};return _0x90255;}})});}_0x5f1701=_[_0x458e('0x44')]({},_0x5f1701,_0x52de31[_0x458e('0x47')]);var _0xf09778={'where':_0x5f1701['where']};return db[_0x458e('0x32')][_0x458e('0x22')](_0xf09778)[_0x458e('0x29')](function(_0x364e28){_0x1e2fa6[_0x458e('0x22')]=_0x364e28;if(_0x52de31['query'][_0x458e('0x48')]){_0x5f1701[_0x458e('0x49')]=[{'all':!![]}];}return db['CmList'][_0x458e('0x4a')](_0x5f1701);})['then'](function(_0x599a5a){_0x1e2fa6[_0x458e('0x4b')]=_0x599a5a;return _0x1e2fa6;})[_0x458e('0x29')](respondWithFilteredResult(_0x327b7c,_0x5f1701))[_0x458e('0x4c')](handleError(_0x327b7c,null));};exports[_0x458e('0x4d')]=function(_0x52458e,_0x3c62b0){var _0x3a85d3={'raw':![],'where':{'id':_0x52458e[_0x458e('0x4e')]['id']}},_0x36e8f3={};_0x36e8f3[_0x458e('0x39')]=_[_0x458e('0x37')](db[_0x458e('0x32')][_0x458e('0x33')]);_0x36e8f3[_0x458e('0x36')]=_[_0x458e('0x37')](_0x52458e[_0x458e('0x36')]);_0x36e8f3['filters']=_['intersection'](_0x36e8f3[_0x458e('0x39')],_0x36e8f3[_0x458e('0x36')]);_0x3a85d3['attributes']=_[_0x458e('0x4f')](_0x36e8f3[_0x458e('0x39')],qs[_0x458e('0x3a')](_0x52458e['query'][_0x458e('0x3a')]));_0x3a85d3[_0x458e('0x3b')]=_0x3a85d3[_0x458e('0x3b')][_0x458e('0x3c')]?_0x3a85d3[_0x458e('0x3b')]:_0x36e8f3[_0x458e('0x39')];if(_0x52458e[_0x458e('0x36')][_0x458e('0x48')]){_0x3a85d3[_0x458e('0x49')]=[{'all':!![]}];}_0x3a85d3=_['merge']({},_0x3a85d3,_0x52458e[_0x458e('0x47')]);return db[_0x458e('0x32')][_0x458e('0x50')](_0x3a85d3)['then'](handleEntityNotFound(_0x3c62b0,null))[_0x458e('0x29')](respondWithResult(_0x3c62b0,null))['catch'](handleError(_0x3c62b0,null));};exports[_0x458e('0x51')]=function(_0x4fe338,_0x382dc0){return db[_0x458e('0x32')][_0x458e('0x51')](_0x4fe338[_0x458e('0x52')],{})['then'](function(_0x2b3092){var _0x4e3344=_0x4fe338[_0x458e('0x53')][_0x458e('0x2a')]({'plain':!![]});if(!_0x4e3344)throw new Error(_0x458e('0x54'));if(_0x4e3344[_0x458e('0x55')]===_0x458e('0x53')){var _0x230654=_0x2b3092['get']({'plain':!![]});var _0x474cd9=_0x458e('0x2b');return db[_0x458e('0x56')][_0x458e('0x50')]({'where':{'name':_0x474cd9,'userProfileId':_0x4e3344[_0x458e('0x57')]},'raw':!![]})[_0x458e('0x29')](function(_0x10a614){if(_0x10a614&&_0x10a614[_0x458e('0x58')]===0x0){return db[_0x458e('0x59')]['create']({'name':_0x230654['name'],'resourceId':_0x230654['id'],'type':_0x10a614[_0x458e('0x2f')],'sectionId':_0x10a614['id']},{})['then'](function(){return _0x2b3092;});}else{return _0x2b3092;}})[_0x458e('0x4c')](function(_0xbfb5e9){logger[_0x458e('0x2d')](_0x458e('0x5a'),_0xbfb5e9);throw _0xbfb5e9;});}return _0x2b3092;})[_0x458e('0x29')](respondWithResult(_0x382dc0,0xc9))['catch'](handleError(_0x382dc0,null));};exports['update']=function(_0x12f35b,_0x86d798){if(_0x12f35b['body']['id']){delete _0x12f35b[_0x458e('0x52')]['id'];}return db['CmList']['find']({'where':{'id':_0x12f35b[_0x458e('0x4e')]['id']}})[_0x458e('0x29')](handleEntityNotFound(_0x86d798,null))['then'](saveUpdates(_0x12f35b['body'],null))[_0x458e('0x29')](respondWithResult(_0x86d798,null))[_0x458e('0x4c')](handleError(_0x86d798,null));};exports['destroy']=function(_0x2ff002,_0x947ea3){return db[_0x458e('0x32')][_0x458e('0x50')]({'where':{'id':_0x2ff002[_0x458e('0x4e')]['id']}})[_0x458e('0x29')](handleEntityNotFound(_0x947ea3,null))[_0x458e('0x29')](removeEntity(_0x947ea3,null))['catch'](handleError(_0x947ea3,null));};exports['describe']=function(_0x1df2ba,_0x153c90){return db[_0x458e('0x32')][_0x458e('0x5b')]()[_0x458e('0x29')](respondWithResult(_0x153c90,null))[_0x458e('0x4c')](handleError(_0x153c90,null));};exports['addDisposition']=function(_0x38fdb8,_0x4f3802,_0xdf152a){if(_0x38fdb8[_0x458e('0x52')]['id']){delete _0x38fdb8['body']['id'];}return db[_0x458e('0x32')][_0x458e('0x50')]({'where':{'id':_0x38fdb8[_0x458e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4f3802,null))[_0x458e('0x29')](function(_0x37b47e){if(_0x37b47e){_0x38fdb8['body'][_0x458e('0x5c')]=_0x37b47e['id'];return db[_0x458e('0x5d')][_0x458e('0x51')](_0x38fdb8[_0x458e('0x52')]);}})[_0x458e('0x29')](respondWithResult(_0x4f3802,null))[_0x458e('0x4c')](handleError(_0x4f3802,null));};exports[_0x458e('0x5e')]=function(_0x3b91ad,_0x3efe77,_0xe6df89){var _0xea2c48={'raw':![],'where':{}};var _0x105ffd={};var _0x11509a={'count':0x0,'rows':[]};return db[_0x458e('0x32')][_0x458e('0x5f')]({'where':{'id':_0x3b91ad[_0x458e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3efe77,null))['then'](function(_0x21c325){if(_0x21c325){_0x105ffd[_0x458e('0x39')]=_[_0x458e('0x37')](db[_0x458e('0x5d')][_0x458e('0x33')]);_0x105ffd['query']=_['keys'](_0x3b91ad[_0x458e('0x36')]);_0x105ffd[_0x458e('0x38')]=_[_0x458e('0x4f')](_0x105ffd['model'],_0x105ffd[_0x458e('0x36')]);_0xea2c48[_0x458e('0x3b')]=_[_0x458e('0x4f')](_0x105ffd[_0x458e('0x39')],qs[_0x458e('0x3a')](_0x3b91ad['query'][_0x458e('0x3a')]));_0xea2c48[_0x458e('0x3b')]=_0xea2c48[_0x458e('0x3b')][_0x458e('0x3c')]?_0xea2c48[_0x458e('0x3b')]:_0x105ffd[_0x458e('0x39')];if(!_0x3b91ad[_0x458e('0x36')][_0x458e('0x3d')](_0x458e('0x3e'))){_0xea2c48[_0x458e('0x21')]=qs['limit'](_0x3b91ad['query'][_0x458e('0x21')]);_0xea2c48[_0x458e('0x1f')]=qs[_0x458e('0x1f')](_0x3b91ad[_0x458e('0x36')][_0x458e('0x1f')]);}_0xea2c48['order']=qs[_0x458e('0x40')](_0x3b91ad[_0x458e('0x36')]['sort']);_0xea2c48[_0x458e('0x41')]=qs[_0x458e('0x38')](_['pick'](_0x3b91ad['query'],_0x105ffd[_0x458e('0x38')]));_0xea2c48['where'][_0x458e('0x5c')]=_0x21c325['id'];if(_0x3b91ad[_0x458e('0x36')][_0x458e('0x43')]){_0xea2c48['where']=_[_0x458e('0x44')](_0xea2c48[_0x458e('0x41')],{'$or':_[_0x458e('0x35')](_0xea2c48[_0x458e('0x3b')],function(_0x53c0ce){var _0x2122d5={};_0x2122d5[_0x53c0ce]={'$like':'%'+_0x3b91ad[_0x458e('0x36')][_0x458e('0x43')]+'%'};return _0x2122d5;})});}_0xea2c48=_[_0x458e('0x44')]({},_0xea2c48,_0x3b91ad['options']);return db['Disposition'][_0x458e('0x22')]({'where':_0xea2c48[_0x458e('0x41')]})[_0x458e('0x29')](function(_0x37bff9){_0x11509a[_0x458e('0x22')]=_0x37bff9;if(_0x3b91ad[_0x458e('0x36')]['includeAll']){_0xea2c48[_0x458e('0x49')]=[{'all':!![]}];}return db[_0x458e('0x5d')][_0x458e('0x4a')](_0xea2c48);})[_0x458e('0x29')](function(_0x181b7a){_0x11509a[_0x458e('0x4b')]=_0x181b7a;return _0x11509a;});}})[_0x458e('0x29')](respondWithFilteredResult(_0x3efe77,_0xea2c48))['catch'](handleError(_0x3efe77,null));};exports['removeDispositions']=function(_0x2b33b4,_0x59e550,_0x440dbe){return db[_0x458e('0x32')][_0x458e('0x50')]({'where':{'id':_0x2b33b4[_0x458e('0x4e')]['id']}})[_0x458e('0x29')](handleEntityNotFound(_0x59e550,null))[_0x458e('0x29')](function(_0x247209){if(_0x247209){return _0x247209['removeDispositions'](_0x2b33b4[_0x458e('0x36')]['ids']);}})[_0x458e('0x29')](respondWithStatusCode(_0x59e550,null))[_0x458e('0x4c')](handleError(_0x59e550,null));};exports['addContacts']=function(_0x12c306,_0x416644,_0x3606e1){return db[_0x458e('0x32')][_0x458e('0x50')]({'where':{'id':_0x12c306['params']['id']}})[_0x458e('0x29')](handleEntityNotFound(_0x416644,null))['then'](function(_0x571910){if(_0x571910){var _0x5d9eb2=[];var _0x24bc96={'success':[],'errors':[]};return db[_0x458e('0x60')]['describe']()[_0x458e('0x29')](function(_0x4be57e){if(_0x12c306[_0x458e('0x52')][_0x458e('0x61')]&&_[_0x458e('0x62')](_0x12c306[_0x458e('0x52')][_0x458e('0x61')])){if(_0x12c306[_0x458e('0x52')][_0x458e('0x61')][_0x458e('0x3c')]){_0x12c306[_0x458e('0x52')][_0x458e('0x61')]=_0x12c306['body']['tags'][_0x458e('0x63')](';')+';';}else{_0x12c306[_0x458e('0x52')]['tags']=null;}}else{_0x12c306['body']['tags']=null;}if(_0x12c306[_0x458e('0x52')]&&_[_0x458e('0x62')](_0x12c306[_0x458e('0x52')])){for(var _0x232135=0x0;_0x232135<_0x12c306['body'][_0x458e('0x3c')];_0x232135+=0x1){_0x12c306['body'][_0x232135]['ListId']=_0x12c306['params']['id'];_0x5d9eb2[_0x458e('0x64')](_0x12c306['body'][_0x232135]);}return BPromise['each'](_0x5d9eb2,function(_0xf081a4){return db[_0x458e('0x60')][_0x458e('0x51')](_[_0x458e('0x65')](_0xf081a4,[_0x458e('0x66'),'id'])||{},{'fields':_[_0x458e('0x37')](_0x4be57e),'raw':!![]})[_0x458e('0x29')](function(_0x5032a7){_0x24bc96['success']['push'](_0x5032a7[_0x458e('0x67')]);})[_0x458e('0x4c')](function(_0x4e1bea){_0x24bc96['errors']['push']({'data':_0xf081a4,'error':_0x4e1bea[_0x458e('0x68')]});});})[_0x458e('0x29')](function(_0x4f404a){return _0x24bc96;})[_0x458e('0x4c')](function(_0x230b99){return _0x230b99;});}else{_0x416644[_0x458e('0x1d')](0x190)[_0x458e('0x1e')]({'message':_0x458e('0x69')});}});}})[_0x458e('0x29')](respondWithResult(_0x416644,null))['catch'](handleError(_0x416644,null));};exports[_0x458e('0x6a')]=function(_0x106a1c,_0x2aeed9,_0x486407){var _0x1a1fca;return db['CmList'][_0x458e('0x50')]({'where':{'id':_0x106a1c[_0x458e('0x4e')]['id']},'include':[{'model':db[_0x458e('0x6b')],'as':_0x458e('0x6c')}]})[_0x458e('0x29')](handleEntityNotFound(_0x2aeed9,null))[_0x458e('0x29')](function(_0x5b8e4c){if(_0x5b8e4c){_0x1a1fca=_0x5b8e4c;return db['CmContact'][_0x458e('0x33')];}})[_0x458e('0x29')](function(_0x17e8e4){if(_0x17e8e4){var _0x364691={};var _0xddf92a={};_0xddf92a[_0x458e('0x39')]=_['concat'](_['keys'](_0x17e8e4),_[_0x458e('0x35')](_0x1a1fca[_0x458e('0x6c')],function(_0x4daefc){return util[_0x458e('0x6d')](_0x458e('0x6e'),_0x4daefc['id']);}));_0xddf92a[_0x458e('0x36')]=_[_0x458e('0x37')](_0x106a1c[_0x458e('0x36')]);_0xddf92a[_0x458e('0x38')]=_[_0x458e('0x4f')](_0xddf92a[_0x458e('0x39')],_0xddf92a[_0x458e('0x36')]);_0x364691[_0x458e('0x3b')]=_[_0x458e('0x4f')](_0xddf92a[_0x458e('0x39')],qs['fields'](_0x106a1c[_0x458e('0x36')][_0x458e('0x3a')]));_0x364691['attributes']=_0x364691['attributes'][_0x458e('0x3c')]?_0x364691['attributes']:_0xddf92a[_0x458e('0x39')];if(!_0x106a1c['query'][_0x458e('0x3d')](_0x458e('0x3e'))){_0x364691['limit']=qs[_0x458e('0x21')](_0x106a1c[_0x458e('0x36')]['limit']);_0x364691['offset']=qs[_0x458e('0x1f')](_0x106a1c[_0x458e('0x36')][_0x458e('0x1f')]);}_0x364691[_0x458e('0x3f')]=qs['sort'](_0x106a1c[_0x458e('0x36')][_0x458e('0x40')]);_0x364691[_0x458e('0x41')]=qs[_0x458e('0x38')](_['pick'](_0x106a1c['query'],_0xddf92a[_0x458e('0x38')]));_0x364691['raw']=!![];if(_0x106a1c[_0x458e('0x36')][_0x458e('0x43')]){_0x364691['where']=_['merge'](_0x364691[_0x458e('0x41')],{'$or':_[_0x458e('0x35')](_0x364691[_0x458e('0x3b')],function(_0x283451){var _0x3c0eaa={};_0x3c0eaa[_0x283451]={'$like':'%'+_0x106a1c[_0x458e('0x36')][_0x458e('0x43')]+'%'};return _0x3c0eaa;})});}_0x364691=_[_0x458e('0x44')]({},_0x364691,_0x106a1c[_0x458e('0x47')]);return _0x1a1fca[_0x458e('0x6a')](_0x364691);}})[_0x458e('0x29')](respondWithResult(_0x2aeed9,null))[_0x458e('0x4c')](handleError(_0x2aeed9,null));};exports[_0x458e('0x6f')]=function(_0x56e98d,_0x1e1746,_0x49755a){var _0x36aab0;var _0x3db0d1;var _0x58b4b8;var _0x17d85d=_0x56e98d['params']['id'];csv_results=[];return db['ContactItemType'][_0x458e('0x4a')]({'attributes':['id',_0x458e('0x2f')],'raw':!![],'order':['OrderBy']})[_0x458e('0x29')](function(_0x19fe81){_0x36aab0=_0x19fe81;var _0x223166=_['keys'](db[_0x458e('0x60')][_0x458e('0x33')]);return db[_0x458e('0x6b')]['findAll']({'raw':!![],'attributes':['id',_0x458e('0x70')]})['then'](function(_0x1bb653){_0x3db0d1=_0x1bb653;var _0x5bf2a1=squel[_0x458e('0x71')]()[_0x458e('0x3a')](_0x223166)[_0x458e('0x72')](_0x458e('0x73'),'c')[_0x458e('0x41')]('c.ListId\x20=\x20?',_0x17d85d)['where'](_0x458e('0x74'))['distinct']();for(var _0x51bfa5=0x0;_0x51bfa5<_0x3db0d1[_0x458e('0x3c')];_0x51bfa5++){_0x5bf2a1[_0x458e('0x75')](_0x458e('0x76')+_0x3db0d1[_0x51bfa5]['id'],_0x458e('0x77')+_0x3db0d1[_0x51bfa5]['alias']);}for(var _0x51bfa5=0x0;_0x51bfa5<_0x36aab0[_0x458e('0x3c')];_0x51bfa5++){_0x5bf2a1['field'](squel[_0x458e('0x71')]()[_0x458e('0x75')]('item')[_0x458e('0x72')](_0x458e('0x78'))[_0x458e('0x41')](_0x458e('0x79'),_0x36aab0[_0x51bfa5]['id'])['where'](_0x458e('0x7a')),_0x458e('0x7b')+_0x36aab0[_0x51bfa5]['name']);_0x5bf2a1[_0x458e('0x75')](squel[_0x458e('0x71')]()[_0x458e('0x75')](_0x458e('0x7c'))[_0x458e('0x72')](_0x458e('0x78'))['where'](_0x458e('0x79'),_0x36aab0[_0x51bfa5]['id'])[_0x458e('0x41')](_0x458e('0x7a')),'description_additionalPhone_'+_0x36aab0[_0x51bfa5][_0x458e('0x2f')]);}var _0x560b46=[];_0x560b46[_0x458e('0x64')](_0x5bf2a1[_0x458e('0x7d')]());BPromise[_0x458e('0x7e')](_0x560b46,handleQuery)[_0x458e('0x29')](function(_0x4e7d0f){handleQuery(_0x5bf2a1[_0x458e('0x7d')]());var _0x3955e0=csv_results[0x0];if(!_[_0x458e('0x7f')](_0x3955e0)){var _0x180985=toCsv(_0x3955e0);var _0x47424f=Date[_0x458e('0x80')]();fs[_0x458e('0x81')](util[_0x458e('0x6d')](_0x458e('0x82'),_0x17d85d,_0x47424f),_0x180985);_0x1e1746[_0x458e('0x83')](_0x458e('0x84'),_0x458e('0x85')+util[_0x458e('0x6d')](_0x458e('0x86'),_0x17d85d,_0x47424f));_0x1e1746[_0x458e('0x83')](_0x458e('0x87'),_0x458e('0x88'));return _0x1e1746[_0x458e('0x89')](util[_0x458e('0x6d')](_0x458e('0x82'),_0x17d85d,_0x47424f));}else{return _0x1e1746['sendStatus'](0xcc);}});});});};exports[_0x458e('0x8a')]=function(_0x1b239c,_0x479dc9,_0x46e2e5){var _0x1a4447;delete _0x1b239c[_0x458e('0x52')]['id'];return db[_0x458e('0x32')][_0x458e('0x5f')]({'where':{'id':_0x1b239c['params']['id']}})[_0x458e('0x29')](handleEntityNotFound(_0x479dc9,null))[_0x458e('0x29')](function(_0x26739e){if(_0x26739e){return db['sequelize'][_0x458e('0x8b')](function(_0x609ffb){return db[_0x458e('0x6b')][_0x458e('0x51')](_0x1b239c[_0x458e('0x52')],{'transaction':_0x609ffb})[_0x458e('0x29')](function(_0x1ccc64){_0x1a4447=_0x1ccc64;return _0x26739e[_0x458e('0x8c')](_0x1ccc64,{'transaction':_0x609ffb});})[_0x458e('0x29')](function(){var _0x5a78fa={'type':db[_0x458e('0x8d')][_0x458e('0x8e')],'transaction':_0x609ffb};switch(_0x1b239c[_0x458e('0x52')]['type']){case _0x458e('0x8f'):_0x5a78fa[_0x458e('0x45')]=db[_0x458e('0x8d')]['TEXT'];break;case _0x458e('0x90'):_0x5a78fa[_0x458e('0x45')]=db[_0x458e('0x8d')]['INTEGER'];break;case _0x458e('0x91'):_0x5a78fa['type']=db['Sequelize'][_0x458e('0x92')];_0x5a78fa[_0x458e('0x93')]=![];break;default:}return db[_0x458e('0x94')][_0x458e('0x95')][_0x458e('0x96')]('cm_contacts',util['format']('cf_%s',_0x1a4447['id']),_0x5a78fa);})['then'](function(){return _0x1a4447;});});}})['then'](respondWithResult(_0x479dc9,null))[_0x458e('0x4c')](handleError(_0x479dc9,null));};exports[_0x458e('0x97')]=function(_0x58bd94,_0x3be015,_0x3a43e4){var _0x23f20f={};var _0x33e7db={};var _0xf5e166;var _0x100669;return db['CmList']['findOne']({'where':{'id':_0x58bd94[_0x458e('0x4e')]['id']}})[_0x458e('0x29')](handleEntityNotFound(_0x3be015,null))['then'](function(_0x587d70){if(_0x587d70){_0xf5e166=_0x587d70;_0x33e7db[_0x458e('0x39')]=_[_0x458e('0x37')](db[_0x458e('0x6b')][_0x458e('0x33')]);_0x33e7db[_0x458e('0x36')]=_[_0x458e('0x37')](_0x58bd94[_0x458e('0x36')]);_0x33e7db[_0x458e('0x38')]=_[_0x458e('0x4f')](_0x33e7db[_0x458e('0x39')],_0x33e7db['query']);_0x23f20f[_0x458e('0x3b')]=_[_0x458e('0x4f')](_0x33e7db[_0x458e('0x39')],qs[_0x458e('0x3a')](_0x58bd94['query']['fields']));_0x23f20f[_0x458e('0x3b')]=_0x23f20f[_0x458e('0x3b')]['length']?_0x23f20f[_0x458e('0x3b')]:_0x33e7db[_0x458e('0x39')];_0x23f20f[_0x458e('0x3f')]=qs[_0x458e('0x40')](_0x58bd94[_0x458e('0x36')][_0x458e('0x40')]);_0x23f20f['where']=qs[_0x458e('0x38')](_[_0x458e('0x42')](_0x58bd94[_0x458e('0x36')],_0x33e7db[_0x458e('0x38')]));_0x23f20f['where']=_['merge'](_0x23f20f[_0x458e('0x41')],{'$or':[{'ListId':_0x587d70['id']},{'ListId':null}]});if(_0x58bd94[_0x458e('0x36')][_0x458e('0x43')]){_0x23f20f[_0x458e('0x41')]=_['merge'](_0x23f20f['where'],{'$or':_[_0x458e('0x35')](_0x23f20f[_0x458e('0x3b')],function(_0x5b5f14){var _0x5842a6={};_0x5842a6[_0x5b5f14]={'$like':'%'+_0x58bd94[_0x458e('0x36')]['filter']+'%'};return _0x5842a6;})});}_0x23f20f=_['merge']({},_0x23f20f,_0x58bd94['options']);return db[_0x458e('0x6b')]['findAndCountAll'](_0x23f20f);}})[_0x458e('0x29')](respondWithResult(_0x3be015,null))['catch'](handleError(_0x3be015,null));};exports['getGlobalCustomFields']=function(_0x8d5428,_0x46457b){return db[_0x458e('0x6b')][_0x458e('0x98')]({'where':{'ListId':null}})[_0x458e('0x29')](handleEntityNotFound(_0x46457b,null))[_0x458e('0x29')](function(_0x420490){return _0x420490;})[_0x458e('0x29')](respondWithResult(_0x46457b,null))[_0x458e('0x4c')](handleError(_0x46457b,null));};exports[_0x458e('0x99')]=function(_0x2bb25e,_0x4c5360,_0x1fe774){return db['CmList'][_0x458e('0x50')]({'where':{'id':_0x2bb25e[_0x458e('0x4e')]['id']}})[_0x458e('0x29')](handleEntityNotFound(_0x4c5360,null))['then'](function(_0x213c37){if(_0x213c37){return _0x213c37[_0x458e('0x99')](_0x2bb25e[_0x458e('0x52')][_0x458e('0x66')],_['omit'](_0x2bb25e[_0x458e('0x52')],[_0x458e('0x66'),'id'])||{})[_0x458e('0x9a')](function(_0x2bca30){for(var _0x35ada8=0x0;_0x35ada8<_0x2bb25e[_0x458e('0x52')][_0x458e('0x66')][_0x458e('0x3c')];_0x35ada8+=0x1){socket['emit'](_0x458e('0x9b'),{'UserId':Number(_0x2bb25e['body'][_0x458e('0x66')][_0x35ada8]),'CmListId':Number(_0x2bb25e[_0x458e('0x4e')]['id'])});}return _0x2bca30;});}})['then'](respondWithResult(_0x4c5360,null))[_0x458e('0x4c')](handleError(_0x4c5360,null));};exports[_0x458e('0x9c')]=function(_0x44edcd,_0x2f55a3,_0x659f6b){return db['CmList'][_0x458e('0x50')]({'where':{'id':_0x44edcd[_0x458e('0x4e')]['id']}})[_0x458e('0x29')](handleEntityNotFound(_0x2f55a3,null))[_0x458e('0x29')](function(_0x150fd5){if(_0x150fd5){return _0x150fd5[_0x458e('0x9c')](_0x44edcd[_0x458e('0x36')][_0x458e('0x66')])['then'](function(){if(_[_0x458e('0x62')](_0x44edcd[_0x458e('0x36')]['ids'])){for(var _0x50374b=0x0;_0x50374b<_0x44edcd[_0x458e('0x36')][_0x458e('0x66')][_0x458e('0x3c')];_0x50374b+=0x1){socket[_0x458e('0x9d')](_0x458e('0x9e'),{'UserId':Number(_0x44edcd['query'][_0x458e('0x66')][_0x50374b]),'CmListId':Number(_0x44edcd['params']['id'])});}}else{socket[_0x458e('0x9d')]('userCmList:remove',{'UserId':Number(_0x44edcd[_0x458e('0x36')][_0x458e('0x66')]),'CmListId':Number(_0x44edcd[_0x458e('0x4e')]['id'])});}});}})[_0x458e('0x29')](respondWithStatusCode(_0x2f55a3,null))[_0x458e('0x4c')](handleError(_0x2f55a3,null));};exports[_0x458e('0x9f')]=function(_0x44c5a1,_0x232003,_0x3a9f38){var _0x4ca3ad={};var _0x58b02a={};var _0x14f65a;var _0x35c374;return db[_0x458e('0x32')][_0x458e('0x5f')]({'where':{'id':_0x44c5a1[_0x458e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x232003,null))['then'](function(_0xbdb1f2){if(_0xbdb1f2){_0x14f65a=_0xbdb1f2;_0x58b02a['model']=_[_0x458e('0x37')](db[_0x458e('0xa0')][_0x458e('0x33')]);_0x58b02a['query']=_[_0x458e('0x37')](_0x44c5a1[_0x458e('0x36')]);_0x58b02a[_0x458e('0x38')]=_[_0x458e('0x4f')](_0x58b02a[_0x458e('0x39')],_0x58b02a[_0x458e('0x36')]);_0x4ca3ad[_0x458e('0x3b')]=_['intersection'](_0x58b02a[_0x458e('0x39')],qs[_0x458e('0x3a')](_0x44c5a1[_0x458e('0x36')]['fields']));_0x4ca3ad[_0x458e('0x3b')]=_0x4ca3ad[_0x458e('0x3b')][_0x458e('0x3c')]?_0x4ca3ad[_0x458e('0x3b')]:_0x58b02a[_0x458e('0x39')];_0x4ca3ad[_0x458e('0x3f')]=qs['sort'](_0x44c5a1[_0x458e('0x36')]['sort']);_0x4ca3ad['where']=qs['filters'](_['pick'](_0x44c5a1[_0x458e('0x36')],_0x58b02a[_0x458e('0x38')]));if(_0x44c5a1[_0x458e('0x36')][_0x458e('0x43')]){_0x4ca3ad[_0x458e('0x41')]=_[_0x458e('0x44')](_0x4ca3ad[_0x458e('0x41')],{'$or':_[_0x458e('0x35')](_0x4ca3ad[_0x458e('0x3b')],function(_0x3c3c38){var _0x45ab87={};_0x45ab87[_0x3c3c38]={'$like':'%'+_0x44c5a1[_0x458e('0x36')]['filter']+'%'};return _0x45ab87;})});}_0x4ca3ad=_[_0x458e('0x44')]({},_0x4ca3ad,_0x44c5a1[_0x458e('0x47')]);return _0x14f65a[_0x458e('0x9f')](_0x4ca3ad);}})[_0x458e('0x29')](function(_0x2cf1d0){if(_0x2cf1d0){_0x35c374=_0x2cf1d0[_0x458e('0x3c')];if(!_0x44c5a1[_0x458e('0x36')][_0x458e('0x3d')]('nolimit')){_0x4ca3ad[_0x458e('0x21')]=qs[_0x458e('0x21')](_0x44c5a1[_0x458e('0x36')]['limit']);_0x4ca3ad[_0x458e('0x1f')]=qs[_0x458e('0x1f')](_0x44c5a1[_0x458e('0x36')]['offset']);}return _0x14f65a[_0x458e('0x9f')](_0x4ca3ad);}})[_0x458e('0x29')](function(_0x22fa82){if(_0x22fa82){return _0x22fa82?{'count':_0x35c374,'rows':_0x22fa82}:null;}})['then'](respondWithResult(_0x232003,null))[_0x458e('0x4c')](handleError(_0x232003,null));};function handleQuery(_0x24457d){logger['info'](_0x24457d);return db[_0x458e('0x94')][_0x458e('0x36')](_0x24457d)[_0x458e('0x9a')](function(_0x335394){csv_results[_0x458e('0x64')](_0x335394);})['catch'](function(_0x343a4e){logger[_0x458e('0x2d')](_0x343a4e[_0x458e('0x68')]);});} \ No newline at end of file +var _0x9920=['status','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','error','stack','name','send','rawAttributes','type','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','CmList','includeAll','include','findAll','rows','show','params','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','describe','addDisposition','getDispositions','Disposition','removeDispositions','ids','CmContact','tags','isArray','join','push','each','omit','success','dataValues','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','cf_%d','order','raw','getContactsCsv','ContactItemType','OrderBy','select','cm_contacts','c.deletedAt\x20is\x20null','field','c.cf_','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','description','from','toString','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','text/csv','download','addCustomField','findOne','sequelize','transaction','addCustomFields','Sequelize','text','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','info','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','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','./cmList.socket','register','sendStatus','end'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9920,0x83));var _0x0992=function(_0x5ae5d2,_0x215e40){_0x5ae5d2=_0x5ae5d2-0x0;var _0x27c32b=_0x9920[_0x5ae5d2];return _0x27c32b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0992('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0992('0x1'));var rp=require(_0x0992('0x2'));var moment=require(_0x0992('0x3'));var BPromise=require(_0x0992('0x4'));var Mustache=require(_0x0992('0x5'));var util=require('util');var path=require(_0x0992('0x6'));var sox=require(_0x0992('0x7'));var csv=require(_0x0992('0x8'));var ejs=require(_0x0992('0x9'));var fs=require('fs');var fs_extra=require(_0x0992('0xa'));var _=require(_0x0992('0xb'));var squel=require(_0x0992('0xc'));var crypto=require('crypto');var jsforce=require(_0x0992('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0992('0x8'));var querystring=require(_0x0992('0xe'));var Papa=require('papaparse');var Redis=require(_0x0992('0xf'));var authService=require(_0x0992('0x10'));var qs=require(_0x0992('0x11'));var as=require(_0x0992('0x12'));var hardwareService=require(_0x0992('0x13'));var logger=require(_0x0992('0x14'))(_0x0992('0x15'));var utils=require(_0x0992('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0992('0x17'));var db=require(_0x0992('0x18'))['db'];var csv_results;config[_0x0992('0x19')]=_[_0x0992('0x1a')](config['redis'],{'host':_0x0992('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0992('0x19')]));require(_0x0992('0x1c'))[_0x0992('0x1d')](socket);function respondWithStatusCode(_0x621f9e,_0x5e3ad8){_0x5e3ad8=_0x5e3ad8||0xcc;return function(_0x5aa0e4){if(_0x5aa0e4){return _0x621f9e[_0x0992('0x1e')](_0x5e3ad8);}return _0x621f9e['status'](_0x5e3ad8)[_0x0992('0x1f')]();};}function respondWithResult(_0xf0cfa9,_0x31494f){_0x31494f=_0x31494f||0xc8;return function(_0x259101){if(_0x259101){return _0xf0cfa9[_0x0992('0x20')](_0x31494f)[_0x0992('0x21')](_0x259101);}};}function respondWithFilteredResult(_0x322c13,_0x5a9872){return function(_0x54da3e){if(_0x54da3e){var _0x41127b=typeof _0x5a9872['offset']===_0x0992('0x22')&&typeof _0x5a9872['limit']===_0x0992('0x22');var _0x43124c=_0x54da3e[_0x0992('0x23')];var _0xe0015c=_0x41127b?0x0:_0x5a9872[_0x0992('0x24')];var _0x34e57e=_0x41127b?_0x54da3e['count']:_0x5a9872['offset']+_0x5a9872[_0x0992('0x25')];var _0x554017;if(_0x34e57e>=_0x43124c){_0x34e57e=_0x43124c;_0x554017=0xc8;}else{_0x554017=0xce;}_0x322c13[_0x0992('0x20')](_0x554017);return _0x322c13[_0x0992('0x26')](_0x0992('0x27'),_0xe0015c+'-'+_0x34e57e+'/'+_0x43124c)[_0x0992('0x21')](_0x54da3e);}return null;};}function patchUpdates(_0x15ca81){return function(_0x4cccda){try{jsonpatch[_0x0992('0x28')](_0x4cccda,_0x15ca81,!![]);}catch(_0x2fb994){return BPromise['reject'](_0x2fb994);}return _0x4cccda[_0x0992('0x29')]();};}function saveUpdates(_0x46bf43,_0x3e591a){return function(_0x7be241){if(_0x7be241){return _0x7be241[_0x0992('0x2a')](_0x46bf43)[_0x0992('0x2b')](function(_0x599472){return _0x599472;});}return null;};}function removeEntity(_0x4b63d1,_0x2cef7b){return function(_0x5341c2){if(_0x5341c2){return _0x5341c2[_0x0992('0x2c')]()[_0x0992('0x2b')](function(){var _0x486d04=_0x5341c2[_0x0992('0x2d')]({'plain':!![]});var _0x668c31='Lists';return db['UserProfileResource']['destroy']({'where':{'type':_0x668c31,'resourceId':_0x486d04['id']}})[_0x0992('0x2b')](function(){return _0x5341c2;});})['then'](function(){_0x4b63d1[_0x0992('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58efb9,_0x387f4c){return function(_0x2bf5fd){if(!_0x2bf5fd){_0x58efb9['sendStatus'](0x194);}return _0x2bf5fd;};}function handleError(_0xb082ad,_0x371852){_0x371852=_0x371852||0x1f4;return function(_0x28d7e8){logger[_0x0992('0x2e')](_0x28d7e8[_0x0992('0x2f')]);if(_0x28d7e8[_0x0992('0x30')]){delete _0x28d7e8[_0x0992('0x30')];}_0xb082ad[_0x0992('0x20')](_0x371852)[_0x0992('0x31')](_0x28d7e8);};}exports['index']=function(_0x51a93a,_0x350731){var _0x225fcf={},_0x5e311d={},_0x1ed972={'count':0x0,'rows':[]};var _0x995c34=_['map'](db['CmList'][_0x0992('0x32')],function(_0x19166c){return{'name':_0x19166c['fieldName'],'type':_0x19166c[_0x0992('0x33')][_0x0992('0x34')]};});_0x5e311d['model']=_[_0x0992('0x35')](_0x995c34,'name');_0x5e311d['query']=_[_0x0992('0x36')](_0x51a93a[_0x0992('0x37')]);_0x5e311d[_0x0992('0x38')]=_[_0x0992('0x39')](_0x5e311d[_0x0992('0x3a')],_0x5e311d[_0x0992('0x37')]);_0x225fcf[_0x0992('0x3b')]=_[_0x0992('0x39')](_0x5e311d[_0x0992('0x3a')],qs[_0x0992('0x3c')](_0x51a93a['query']['fields']));_0x225fcf[_0x0992('0x3b')]=_0x225fcf['attributes'][_0x0992('0x3d')]?_0x225fcf[_0x0992('0x3b')]:_0x5e311d[_0x0992('0x3a')];if(!_0x51a93a['query'][_0x0992('0x3e')](_0x0992('0x3f'))){_0x225fcf['limit']=qs['limit'](_0x51a93a['query'][_0x0992('0x25')]);_0x225fcf['offset']=qs[_0x0992('0x24')](_0x51a93a[_0x0992('0x37')][_0x0992('0x24')]);}_0x225fcf['order']=qs[_0x0992('0x40')](_0x51a93a[_0x0992('0x37')]['sort']);_0x225fcf[_0x0992('0x41')]=qs['filters'](_[_0x0992('0x42')](_0x51a93a[_0x0992('0x37')],_0x5e311d[_0x0992('0x38')]),_0x995c34);if(_0x51a93a[_0x0992('0x37')][_0x0992('0x43')]){_0x225fcf[_0x0992('0x41')]=_['merge'](_0x225fcf['where'],{'$or':_[_0x0992('0x35')](_0x995c34,function(_0x227b64){if(_0x227b64[_0x0992('0x33')]!=='VIRTUAL'){var _0x575a7a={};_0x575a7a[_0x227b64[_0x0992('0x30')]]={'$like':'%'+_0x51a93a[_0x0992('0x37')][_0x0992('0x43')]+'%'};return _0x575a7a;}})});}_0x225fcf=_[_0x0992('0x44')]({},_0x225fcf,_0x51a93a[_0x0992('0x45')]);var _0x3c53d1={'where':_0x225fcf[_0x0992('0x41')]};return db[_0x0992('0x46')][_0x0992('0x23')](_0x3c53d1)[_0x0992('0x2b')](function(_0x288274){_0x1ed972[_0x0992('0x23')]=_0x288274;if(_0x51a93a[_0x0992('0x37')][_0x0992('0x47')]){_0x225fcf[_0x0992('0x48')]=[{'all':!![]}];}return db[_0x0992('0x46')][_0x0992('0x49')](_0x225fcf);})[_0x0992('0x2b')](function(_0x339c58){_0x1ed972[_0x0992('0x4a')]=_0x339c58;return _0x1ed972;})[_0x0992('0x2b')](respondWithFilteredResult(_0x350731,_0x225fcf))['catch'](handleError(_0x350731,null));};exports[_0x0992('0x4b')]=function(_0x13fa99,_0x3cb95){var _0x5da398={'raw':![],'where':{'id':_0x13fa99[_0x0992('0x4c')]['id']}},_0x1fc5fe={};_0x1fc5fe[_0x0992('0x3a')]=_[_0x0992('0x36')](db['CmList'][_0x0992('0x32')]);_0x1fc5fe['query']=_[_0x0992('0x36')](_0x13fa99[_0x0992('0x37')]);_0x1fc5fe[_0x0992('0x38')]=_[_0x0992('0x39')](_0x1fc5fe[_0x0992('0x3a')],_0x1fc5fe[_0x0992('0x37')]);_0x5da398['attributes']=_['intersection'](_0x1fc5fe[_0x0992('0x3a')],qs[_0x0992('0x3c')](_0x13fa99['query'][_0x0992('0x3c')]));_0x5da398['attributes']=_0x5da398[_0x0992('0x3b')]['length']?_0x5da398['attributes']:_0x1fc5fe[_0x0992('0x3a')];if(_0x13fa99[_0x0992('0x37')][_0x0992('0x47')]){_0x5da398[_0x0992('0x48')]=[{'all':!![]}];}_0x5da398=_[_0x0992('0x44')]({},_0x5da398,_0x13fa99['options']);return db[_0x0992('0x46')][_0x0992('0x4d')](_0x5da398)['then'](handleEntityNotFound(_0x3cb95,null))[_0x0992('0x2b')](respondWithResult(_0x3cb95,null))['catch'](handleError(_0x3cb95,null));};exports[_0x0992('0x4e')]=function(_0x20f7f4,_0x298f9a){return db[_0x0992('0x46')][_0x0992('0x4e')](_0x20f7f4[_0x0992('0x4f')],{})[_0x0992('0x2b')](function(_0x24a3cc){var _0x345bdf=_0x20f7f4[_0x0992('0x50')]['get']({'plain':!![]});if(!_0x345bdf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x345bdf[_0x0992('0x51')]===_0x0992('0x50')){var _0x1d5905=_0x24a3cc[_0x0992('0x2d')]({'plain':!![]});var _0x587cdb='Lists';return db[_0x0992('0x52')]['find']({'where':{'name':_0x587cdb,'userProfileId':_0x345bdf[_0x0992('0x53')]},'raw':!![]})[_0x0992('0x2b')](function(_0x523805){if(_0x523805&&_0x523805['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x1d5905[_0x0992('0x30')],'resourceId':_0x1d5905['id'],'type':_0x523805['name'],'sectionId':_0x523805['id']},{})[_0x0992('0x2b')](function(){return _0x24a3cc;});}else{return _0x24a3cc;}})['catch'](function(_0x469f9b){logger[_0x0992('0x2e')](_0x0992('0x54'),_0x469f9b);throw _0x469f9b;});}return _0x24a3cc;})[_0x0992('0x2b')](respondWithResult(_0x298f9a,0xc9))[_0x0992('0x55')](handleError(_0x298f9a,null));};exports[_0x0992('0x2a')]=function(_0x4d705d,_0x1a6ccc){if(_0x4d705d[_0x0992('0x4f')]['id']){delete _0x4d705d[_0x0992('0x4f')]['id'];}return db[_0x0992('0x46')][_0x0992('0x4d')]({'where':{'id':_0x4d705d[_0x0992('0x4c')]['id']}})[_0x0992('0x2b')](handleEntityNotFound(_0x1a6ccc,null))[_0x0992('0x2b')](saveUpdates(_0x4d705d[_0x0992('0x4f')],null))[_0x0992('0x2b')](respondWithResult(_0x1a6ccc,null))[_0x0992('0x55')](handleError(_0x1a6ccc,null));};exports[_0x0992('0x2c')]=function(_0x5600e9,_0x3415a3){return db[_0x0992('0x46')][_0x0992('0x4d')]({'where':{'id':_0x5600e9[_0x0992('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3415a3,null))['then'](removeEntity(_0x3415a3,null))['catch'](handleError(_0x3415a3,null));};exports['describe']=function(_0x39b51f,_0x509751){return db[_0x0992('0x46')][_0x0992('0x56')]()[_0x0992('0x2b')](respondWithResult(_0x509751,null))[_0x0992('0x55')](handleError(_0x509751,null));};exports[_0x0992('0x57')]=function(_0x39ecb0,_0x1ad0f8,_0x2a8df0){if(_0x39ecb0[_0x0992('0x4f')]['id']){delete _0x39ecb0[_0x0992('0x4f')]['id'];}return db['CmList']['find']({'where':{'id':_0x39ecb0[_0x0992('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1ad0f8,null))[_0x0992('0x2b')](function(_0x386d8c){if(_0x386d8c){_0x39ecb0['body']['ListId']=_0x386d8c['id'];return db['Disposition'][_0x0992('0x4e')](_0x39ecb0[_0x0992('0x4f')]);}})['then'](respondWithResult(_0x1ad0f8,null))[_0x0992('0x55')](handleError(_0x1ad0f8,null));};exports[_0x0992('0x58')]=function(_0x2ce784,_0x4449e4,_0x238e1a){var _0x37d3ac={'raw':![],'where':{}};var _0x2037d0={};var _0x578b3e={'count':0x0,'rows':[]};return db['CmList']['findOne']({'where':{'id':_0x2ce784[_0x0992('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4449e4,null))[_0x0992('0x2b')](function(_0x118dd8){if(_0x118dd8){_0x2037d0['model']=_['keys'](db['Disposition'][_0x0992('0x32')]);_0x2037d0['query']=_[_0x0992('0x36')](_0x2ce784[_0x0992('0x37')]);_0x2037d0[_0x0992('0x38')]=_['intersection'](_0x2037d0[_0x0992('0x3a')],_0x2037d0[_0x0992('0x37')]);_0x37d3ac['attributes']=_[_0x0992('0x39')](_0x2037d0[_0x0992('0x3a')],qs['fields'](_0x2ce784[_0x0992('0x37')]['fields']));_0x37d3ac['attributes']=_0x37d3ac[_0x0992('0x3b')][_0x0992('0x3d')]?_0x37d3ac['attributes']:_0x2037d0[_0x0992('0x3a')];if(!_0x2ce784['query']['hasOwnProperty'](_0x0992('0x3f'))){_0x37d3ac[_0x0992('0x25')]=qs[_0x0992('0x25')](_0x2ce784[_0x0992('0x37')][_0x0992('0x25')]);_0x37d3ac[_0x0992('0x24')]=qs['offset'](_0x2ce784[_0x0992('0x37')][_0x0992('0x24')]);}_0x37d3ac['order']=qs['sort'](_0x2ce784[_0x0992('0x37')][_0x0992('0x40')]);_0x37d3ac[_0x0992('0x41')]=qs[_0x0992('0x38')](_[_0x0992('0x42')](_0x2ce784['query'],_0x2037d0[_0x0992('0x38')]));_0x37d3ac[_0x0992('0x41')]['ListId']=_0x118dd8['id'];if(_0x2ce784[_0x0992('0x37')][_0x0992('0x43')]){_0x37d3ac[_0x0992('0x41')]=_[_0x0992('0x44')](_0x37d3ac['where'],{'$or':_[_0x0992('0x35')](_0x37d3ac[_0x0992('0x3b')],function(_0x4b566a){var _0x1deca1={};_0x1deca1[_0x4b566a]={'$like':'%'+_0x2ce784['query']['filter']+'%'};return _0x1deca1;})});}_0x37d3ac=_[_0x0992('0x44')]({},_0x37d3ac,_0x2ce784[_0x0992('0x45')]);return db[_0x0992('0x59')][_0x0992('0x23')]({'where':_0x37d3ac['where']})[_0x0992('0x2b')](function(_0x39539f){_0x578b3e[_0x0992('0x23')]=_0x39539f;if(_0x2ce784[_0x0992('0x37')][_0x0992('0x47')]){_0x37d3ac['include']=[{'all':!![]}];}return db[_0x0992('0x59')][_0x0992('0x49')](_0x37d3ac);})[_0x0992('0x2b')](function(_0x14c084){_0x578b3e[_0x0992('0x4a')]=_0x14c084;return _0x578b3e;});}})[_0x0992('0x2b')](respondWithFilteredResult(_0x4449e4,_0x37d3ac))[_0x0992('0x55')](handleError(_0x4449e4,null));};exports[_0x0992('0x5a')]=function(_0x3f4588,_0x4d5aa9,_0xd5d15e){return db['CmList'][_0x0992('0x4d')]({'where':{'id':_0x3f4588[_0x0992('0x4c')]['id']}})[_0x0992('0x2b')](handleEntityNotFound(_0x4d5aa9,null))[_0x0992('0x2b')](function(_0x14531a){if(_0x14531a){return _0x14531a[_0x0992('0x5a')](_0x3f4588[_0x0992('0x37')][_0x0992('0x5b')]);}})[_0x0992('0x2b')](respondWithStatusCode(_0x4d5aa9,null))[_0x0992('0x55')](handleError(_0x4d5aa9,null));};exports['addContacts']=function(_0x1c36b5,_0x239163,_0x3524e1){return db[_0x0992('0x46')]['find']({'where':{'id':_0x1c36b5[_0x0992('0x4c')]['id']}})[_0x0992('0x2b')](handleEntityNotFound(_0x239163,null))[_0x0992('0x2b')](function(_0x5f2e87){if(_0x5f2e87){var _0x4aaf15=[];var _0x41bfb5={'success':[],'errors':[]};return db[_0x0992('0x5c')]['describe']()[_0x0992('0x2b')](function(_0x25affd){if(_0x1c36b5['body'][_0x0992('0x5d')]&&_[_0x0992('0x5e')](_0x1c36b5['body']['tags'])){if(_0x1c36b5[_0x0992('0x4f')][_0x0992('0x5d')][_0x0992('0x3d')]){_0x1c36b5[_0x0992('0x4f')][_0x0992('0x5d')]=_0x1c36b5[_0x0992('0x4f')][_0x0992('0x5d')][_0x0992('0x5f')](';')+';';}else{_0x1c36b5[_0x0992('0x4f')][_0x0992('0x5d')]=null;}}else{_0x1c36b5[_0x0992('0x4f')][_0x0992('0x5d')]=null;}if(_0x1c36b5[_0x0992('0x4f')]&&_[_0x0992('0x5e')](_0x1c36b5[_0x0992('0x4f')])){for(var _0xddf7cb=0x0;_0xddf7cb<_0x1c36b5[_0x0992('0x4f')][_0x0992('0x3d')];_0xddf7cb+=0x1){_0x1c36b5['body'][_0xddf7cb]['ListId']=_0x1c36b5[_0x0992('0x4c')]['id'];_0x4aaf15[_0x0992('0x60')](_0x1c36b5[_0x0992('0x4f')][_0xddf7cb]);}return BPromise[_0x0992('0x61')](_0x4aaf15,function(_0x463a15){return db[_0x0992('0x5c')]['create'](_[_0x0992('0x62')](_0x463a15,[_0x0992('0x5b'),'id'])||{},{'fields':_[_0x0992('0x36')](_0x25affd),'raw':!![]})[_0x0992('0x2b')](function(_0x6ae55c){_0x41bfb5[_0x0992('0x63')]['push'](_0x6ae55c[_0x0992('0x64')]);})[_0x0992('0x55')](function(_0x65f312){_0x41bfb5['errors'][_0x0992('0x60')]({'data':_0x463a15,'error':_0x65f312[_0x0992('0x65')]});});})['then'](function(_0x48aed5){return _0x41bfb5;})[_0x0992('0x55')](function(_0x197c25){return _0x197c25;});}else{_0x239163['status'](0x190)['json']({'message':_0x0992('0x66')});}});}})[_0x0992('0x2b')](respondWithResult(_0x239163,null))[_0x0992('0x55')](handleError(_0x239163,null));};exports[_0x0992('0x67')]=function(_0x190be0,_0x237ab6,_0x574c92){var _0x582244;return db[_0x0992('0x46')][_0x0992('0x4d')]({'where':{'id':_0x190be0[_0x0992('0x4c')]['id']},'include':[{'model':db[_0x0992('0x68')],'as':_0x0992('0x69')}]})[_0x0992('0x2b')](handleEntityNotFound(_0x237ab6,null))[_0x0992('0x2b')](function(_0xacf4f1){if(_0xacf4f1){_0x582244=_0xacf4f1;return db['CmContact'][_0x0992('0x32')];}})[_0x0992('0x2b')](function(_0x291f1f){if(_0x291f1f){var _0x4e2a56={};var _0x525b84={};_0x525b84[_0x0992('0x3a')]=_['concat'](_['keys'](_0x291f1f),_[_0x0992('0x35')](_0x582244['CustomFields'],function(_0x3f2ea6){return util[_0x0992('0x6a')](_0x0992('0x6b'),_0x3f2ea6['id']);}));_0x525b84['query']=_[_0x0992('0x36')](_0x190be0[_0x0992('0x37')]);_0x525b84[_0x0992('0x38')]=_['intersection'](_0x525b84[_0x0992('0x3a')],_0x525b84['query']);_0x4e2a56['attributes']=_['intersection'](_0x525b84[_0x0992('0x3a')],qs['fields'](_0x190be0[_0x0992('0x37')][_0x0992('0x3c')]));_0x4e2a56[_0x0992('0x3b')]=_0x4e2a56[_0x0992('0x3b')][_0x0992('0x3d')]?_0x4e2a56['attributes']:_0x525b84['model'];if(!_0x190be0[_0x0992('0x37')]['hasOwnProperty'](_0x0992('0x3f'))){_0x4e2a56[_0x0992('0x25')]=qs[_0x0992('0x25')](_0x190be0[_0x0992('0x37')]['limit']);_0x4e2a56[_0x0992('0x24')]=qs[_0x0992('0x24')](_0x190be0[_0x0992('0x37')]['offset']);}_0x4e2a56[_0x0992('0x6c')]=qs[_0x0992('0x40')](_0x190be0[_0x0992('0x37')][_0x0992('0x40')]);_0x4e2a56[_0x0992('0x41')]=qs[_0x0992('0x38')](_[_0x0992('0x42')](_0x190be0[_0x0992('0x37')],_0x525b84['filters']));_0x4e2a56[_0x0992('0x6d')]=!![];if(_0x190be0[_0x0992('0x37')][_0x0992('0x43')]){_0x4e2a56[_0x0992('0x41')]=_[_0x0992('0x44')](_0x4e2a56['where'],{'$or':_[_0x0992('0x35')](_0x4e2a56['attributes'],function(_0x2311f4){var _0x42d900={};_0x42d900[_0x2311f4]={'$like':'%'+_0x190be0[_0x0992('0x37')][_0x0992('0x43')]+'%'};return _0x42d900;})});}_0x4e2a56=_[_0x0992('0x44')]({},_0x4e2a56,_0x190be0['options']);return _0x582244[_0x0992('0x67')](_0x4e2a56);}})[_0x0992('0x2b')](respondWithResult(_0x237ab6,null))['catch'](handleError(_0x237ab6,null));};exports[_0x0992('0x6e')]=function(_0x3a1539,_0x58d53e,_0x463af8){var _0xf4367f;var _0x2dc79f;var _0x12a64e;var _0x55ae1e=_0x3a1539[_0x0992('0x4c')]['id'];csv_results=[];return db[_0x0992('0x6f')][_0x0992('0x49')]({'attributes':['id','name'],'raw':!![],'order':[_0x0992('0x70')]})[_0x0992('0x2b')](function(_0x310bae){_0xf4367f=_0x310bae;var _0x1f91db=_[_0x0992('0x36')](db[_0x0992('0x5c')]['rawAttributes']);return db[_0x0992('0x68')][_0x0992('0x49')]({'raw':!![],'attributes':['id','alias']})[_0x0992('0x2b')](function(_0x1b406d){_0x2dc79f=_0x1b406d;var _0x40ffb3=squel[_0x0992('0x71')]()[_0x0992('0x3c')](_0x1f91db)['from'](_0x0992('0x72'),'c')[_0x0992('0x41')]('c.ListId\x20=\x20?',_0x55ae1e)[_0x0992('0x41')](_0x0992('0x73'))['distinct']();for(var _0x4d6e71=0x0;_0x4d6e71<_0x2dc79f[_0x0992('0x3d')];_0x4d6e71++){_0x40ffb3[_0x0992('0x74')](_0x0992('0x75')+_0x2dc79f[_0x4d6e71]['id'],_0x0992('0x76')+_0x2dc79f[_0x4d6e71]['alias']);}for(var _0x4d6e71=0x0;_0x4d6e71<_0xf4367f[_0x0992('0x3d')];_0x4d6e71++){_0x40ffb3[_0x0992('0x74')](squel[_0x0992('0x71')]()[_0x0992('0x74')](_0x0992('0x77'))['from'](_0x0992('0x78'))[_0x0992('0x41')](_0x0992('0x79'),_0xf4367f[_0x4d6e71]['id'])['where'](_0x0992('0x7a')),'additionalPhone_'+_0xf4367f[_0x4d6e71]['name']);_0x40ffb3[_0x0992('0x74')](squel[_0x0992('0x71')]()[_0x0992('0x74')](_0x0992('0x7b'))[_0x0992('0x7c')]('cm_contact_has_items')['where'](_0x0992('0x79'),_0xf4367f[_0x4d6e71]['id'])['where'](_0x0992('0x7a')),'description_additionalPhone_'+_0xf4367f[_0x4d6e71][_0x0992('0x30')]);}var _0x31480e=[];_0x31480e[_0x0992('0x60')](_0x40ffb3[_0x0992('0x7d')]());BPromise[_0x0992('0x61')](_0x31480e,handleQuery)[_0x0992('0x2b')](function(_0x59768c){handleQuery(_0x40ffb3[_0x0992('0x7d')]());var _0x2c816a=csv_results[0x0];if(!_[_0x0992('0x7e')](_0x2c816a)){var _0x48bf91=toCsv(_0x2c816a);var _0x1e0cbc=Date[_0x0992('0x7f')]();fs[_0x0992('0x80')](util[_0x0992('0x6a')](_0x0992('0x81'),_0x55ae1e,_0x1e0cbc),_0x48bf91);_0x58d53e[_0x0992('0x82')](_0x0992('0x83'),_0x0992('0x84')+util[_0x0992('0x6a')](_0x0992('0x85'),_0x55ae1e,_0x1e0cbc));_0x58d53e[_0x0992('0x82')]('Content-type',_0x0992('0x86'));return _0x58d53e[_0x0992('0x87')](util['format'](_0x0992('0x81'),_0x55ae1e,_0x1e0cbc));}else{return _0x58d53e['sendStatus'](0xcc);}});});});};exports[_0x0992('0x88')]=function(_0x3e1079,_0x337950,_0x581e80){var _0xef9ffd;delete _0x3e1079[_0x0992('0x4f')]['id'];return db[_0x0992('0x46')][_0x0992('0x89')]({'where':{'id':_0x3e1079[_0x0992('0x4c')]['id']}})[_0x0992('0x2b')](handleEntityNotFound(_0x337950,null))['then'](function(_0x2ffacc){if(_0x2ffacc){return db[_0x0992('0x8a')][_0x0992('0x8b')](function(_0x21616d){return db[_0x0992('0x68')][_0x0992('0x4e')](_0x3e1079['body'],{'transaction':_0x21616d})[_0x0992('0x2b')](function(_0xe574d7){_0xef9ffd=_0xe574d7;return _0x2ffacc[_0x0992('0x8c')](_0xe574d7,{'transaction':_0x21616d});})[_0x0992('0x2b')](function(){var _0x51f30b={'type':db[_0x0992('0x8d')]['TEXT'],'transaction':_0x21616d};switch(_0x3e1079[_0x0992('0x4f')][_0x0992('0x33')]){case _0x0992('0x8e'):_0x51f30b[_0x0992('0x33')]=db['Sequelize'][_0x0992('0x8f')];break;case _0x0992('0x90'):_0x51f30b['type']=db['Sequelize'][_0x0992('0x91')];break;case _0x0992('0x92'):_0x51f30b['type']=db[_0x0992('0x8d')][_0x0992('0x93')];_0x51f30b[_0x0992('0x94')]=![];break;default:}return db['sequelize'][_0x0992('0x95')]['addColumn']('cm_contacts',util[_0x0992('0x6a')](_0x0992('0x96'),_0xef9ffd['id']),_0x51f30b);})[_0x0992('0x2b')](function(){return _0xef9ffd;});});}})[_0x0992('0x2b')](respondWithResult(_0x337950,null))['catch'](handleError(_0x337950,null));};exports[_0x0992('0x97')]=function(_0x2b48ff,_0x4ac65c,_0x5c2e71){var _0x90696c={};var _0x2ae207={};var _0x455f9b;var _0x29246f;return db[_0x0992('0x46')][_0x0992('0x89')]({'where':{'id':_0x2b48ff['params']['id']}})[_0x0992('0x2b')](handleEntityNotFound(_0x4ac65c,null))['then'](function(_0xc14df5){if(_0xc14df5){_0x455f9b=_0xc14df5;_0x2ae207['model']=_['keys'](db[_0x0992('0x68')]['rawAttributes']);_0x2ae207[_0x0992('0x37')]=_[_0x0992('0x36')](_0x2b48ff[_0x0992('0x37')]);_0x2ae207[_0x0992('0x38')]=_[_0x0992('0x39')](_0x2ae207['model'],_0x2ae207[_0x0992('0x37')]);_0x90696c[_0x0992('0x3b')]=_['intersection'](_0x2ae207[_0x0992('0x3a')],qs[_0x0992('0x3c')](_0x2b48ff[_0x0992('0x37')][_0x0992('0x3c')]));_0x90696c[_0x0992('0x3b')]=_0x90696c[_0x0992('0x3b')]['length']?_0x90696c[_0x0992('0x3b')]:_0x2ae207[_0x0992('0x3a')];_0x90696c['order']=qs[_0x0992('0x40')](_0x2b48ff[_0x0992('0x37')][_0x0992('0x40')]);_0x90696c[_0x0992('0x41')]=qs[_0x0992('0x38')](_[_0x0992('0x42')](_0x2b48ff[_0x0992('0x37')],_0x2ae207['filters']));_0x90696c[_0x0992('0x41')]=_['merge'](_0x90696c[_0x0992('0x41')],{'$or':[{'ListId':_0xc14df5['id']},{'ListId':null}]});if(_0x2b48ff[_0x0992('0x37')]['filter']){_0x90696c['where']=_[_0x0992('0x44')](_0x90696c['where'],{'$or':_[_0x0992('0x35')](_0x90696c['attributes'],function(_0x10edd2){var _0x21d885={};_0x21d885[_0x10edd2]={'$like':'%'+_0x2b48ff[_0x0992('0x37')][_0x0992('0x43')]+'%'};return _0x21d885;})});}_0x90696c=_[_0x0992('0x44')]({},_0x90696c,_0x2b48ff[_0x0992('0x45')]);return db[_0x0992('0x68')][_0x0992('0x98')](_0x90696c);}})['then'](respondWithResult(_0x4ac65c,null))['catch'](handleError(_0x4ac65c,null));};exports[_0x0992('0x99')]=function(_0x3e5110,_0x1e3958){return db[_0x0992('0x68')][_0x0992('0x98')]({'where':{'ListId':null}})[_0x0992('0x2b')](handleEntityNotFound(_0x1e3958,null))[_0x0992('0x2b')](function(_0x5cfa12){return _0x5cfa12;})[_0x0992('0x2b')](respondWithResult(_0x1e3958,null))[_0x0992('0x55')](handleError(_0x1e3958,null));};exports[_0x0992('0x9a')]=function(_0x5ede0f,_0x218ac9,_0x1f5e95){return db[_0x0992('0x46')][_0x0992('0x4d')]({'where':{'id':_0x5ede0f[_0x0992('0x4c')]['id']}})[_0x0992('0x2b')](handleEntityNotFound(_0x218ac9,null))[_0x0992('0x2b')](function(_0x37bb03){if(_0x37bb03){return _0x37bb03[_0x0992('0x9a')](_0x5ede0f[_0x0992('0x4f')][_0x0992('0x5b')],_[_0x0992('0x62')](_0x5ede0f[_0x0992('0x4f')],[_0x0992('0x5b'),'id'])||{})[_0x0992('0x9b')](function(_0x8235d0){for(var _0x1ae667=0x0;_0x1ae667<_0x5ede0f['body'][_0x0992('0x5b')][_0x0992('0x3d')];_0x1ae667+=0x1){socket[_0x0992('0x9c')](_0x0992('0x9d'),{'UserId':Number(_0x5ede0f[_0x0992('0x4f')]['ids'][_0x1ae667]),'CmListId':Number(_0x5ede0f[_0x0992('0x4c')]['id'])});}return _0x8235d0;});}})[_0x0992('0x2b')](respondWithResult(_0x218ac9,null))[_0x0992('0x55')](handleError(_0x218ac9,null));};exports[_0x0992('0x9e')]=function(_0x7ae3a5,_0x1cd743,_0x15ef42){return db['CmList']['find']({'where':{'id':_0x7ae3a5[_0x0992('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1cd743,null))[_0x0992('0x2b')](function(_0x6fccc5){if(_0x6fccc5){return _0x6fccc5[_0x0992('0x9e')](_0x7ae3a5[_0x0992('0x37')][_0x0992('0x5b')])[_0x0992('0x2b')](function(){if(_[_0x0992('0x5e')](_0x7ae3a5[_0x0992('0x37')][_0x0992('0x5b')])){for(var _0x2c32a7=0x0;_0x2c32a7<_0x7ae3a5[_0x0992('0x37')]['ids'][_0x0992('0x3d')];_0x2c32a7+=0x1){socket[_0x0992('0x9c')](_0x0992('0x9f'),{'UserId':Number(_0x7ae3a5[_0x0992('0x37')][_0x0992('0x5b')][_0x2c32a7]),'CmListId':Number(_0x7ae3a5['params']['id'])});}}else{socket[_0x0992('0x9c')](_0x0992('0x9f'),{'UserId':Number(_0x7ae3a5[_0x0992('0x37')][_0x0992('0x5b')]),'CmListId':Number(_0x7ae3a5['params']['id'])});}});}})[_0x0992('0x2b')](respondWithStatusCode(_0x1cd743,null))[_0x0992('0x55')](handleError(_0x1cd743,null));};exports[_0x0992('0xa0')]=function(_0x47d412,_0x43fba6,_0x1e6ff4){var _0x43d544={};var _0x182085={};var _0x16793c;var _0x1b591d;return db[_0x0992('0x46')][_0x0992('0x89')]({'where':{'id':_0x47d412[_0x0992('0x4c')]['id']}})[_0x0992('0x2b')](handleEntityNotFound(_0x43fba6,null))[_0x0992('0x2b')](function(_0x56e5c6){if(_0x56e5c6){_0x16793c=_0x56e5c6;_0x182085[_0x0992('0x3a')]=_['keys'](db[_0x0992('0xa1')]['rawAttributes']);_0x182085[_0x0992('0x37')]=_['keys'](_0x47d412['query']);_0x182085['filters']=_[_0x0992('0x39')](_0x182085['model'],_0x182085[_0x0992('0x37')]);_0x43d544[_0x0992('0x3b')]=_[_0x0992('0x39')](_0x182085['model'],qs[_0x0992('0x3c')](_0x47d412[_0x0992('0x37')][_0x0992('0x3c')]));_0x43d544[_0x0992('0x3b')]=_0x43d544['attributes'][_0x0992('0x3d')]?_0x43d544[_0x0992('0x3b')]:_0x182085[_0x0992('0x3a')];_0x43d544['order']=qs[_0x0992('0x40')](_0x47d412[_0x0992('0x37')][_0x0992('0x40')]);_0x43d544[_0x0992('0x41')]=qs['filters'](_['pick'](_0x47d412[_0x0992('0x37')],_0x182085[_0x0992('0x38')]));if(_0x47d412[_0x0992('0x37')][_0x0992('0x43')]){_0x43d544[_0x0992('0x41')]=_['merge'](_0x43d544['where'],{'$or':_['map'](_0x43d544['attributes'],function(_0x4a79e3){var _0x56d92e={};_0x56d92e[_0x4a79e3]={'$like':'%'+_0x47d412[_0x0992('0x37')][_0x0992('0x43')]+'%'};return _0x56d92e;})});}_0x43d544=_['merge']({},_0x43d544,_0x47d412[_0x0992('0x45')]);return _0x16793c[_0x0992('0xa0')](_0x43d544);}})[_0x0992('0x2b')](function(_0x5c2823){if(_0x5c2823){_0x1b591d=_0x5c2823[_0x0992('0x3d')];if(!_0x47d412['query'][_0x0992('0x3e')](_0x0992('0x3f'))){_0x43d544[_0x0992('0x25')]=qs['limit'](_0x47d412['query'][_0x0992('0x25')]);_0x43d544[_0x0992('0x24')]=qs['offset'](_0x47d412[_0x0992('0x37')]['offset']);}return _0x16793c[_0x0992('0xa0')](_0x43d544);}})[_0x0992('0x2b')](function(_0x433f4f){if(_0x433f4f){return _0x433f4f?{'count':_0x1b591d,'rows':_0x433f4f}:null;}})['then'](respondWithResult(_0x43fba6,null))[_0x0992('0x55')](handleError(_0x43fba6,null));};function handleQuery(_0x125cea){logger[_0x0992('0xa2')](_0x125cea);return db[_0x0992('0x8a')][_0x0992('0x37')](_0x125cea)[_0x0992('0x9b')](function(_0x372eaf){csv_results['push'](_0x372eaf);})[_0x0992('0x55')](function(_0x1f5777){logger[_0x0992('0x2e')](_0x1f5777[_0x0992('0x65')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index a68b00b..3ec723a 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 _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x4fcf10,_0x2db1c9){var _0x474d90=function(_0x2997b7){while(--_0x2997b7){_0x4fcf10['push'](_0x4fcf10['shift']());}};_0x474d90(++_0x2db1c9);}(_0x814b,0x1a2));var _0xb814=function(_0x1f7839,_0x2a26e6){_0x1f7839=_0x1f7839-0x0;var _0x36b42e=_0x814b[_0x1f7839];return _0x36b42e;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file +var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0x5fc3,0xa8));var _0x35fc=function(_0x51bda1,_0x44f80d){_0x51bda1=_0x51bda1-0x0;var _0x1ce08c=_0x5fc3[_0x51bda1];return _0x1ce08c;};'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 6af2226..a140872 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 _0x5ff3=['cm_lists','util','api','bluebird','request-promise','path','rimraf','./cmList.attributes','exports','define'];(function(_0x5002a5,_0x3712fa){var _0x45a102=function(_0x1ec1aa){while(--_0x1ec1aa){_0x5002a5['push'](_0x5002a5['shift']());}};_0x45a102(++_0x3712fa);}(_0x5ff3,0x17d));var _0x35ff=function(_0x618459,_0x10e276){_0x618459=_0x618459-0x0;var _0x3ef948=_0x5ff3[_0x618459];return _0x3ef948;};'use strict';var _=require('lodash');var util=require(_0x35ff('0x0'));var logger=require('../../config/logger')(_0x35ff('0x1'));var moment=require('moment');var BPromise=require(_0x35ff('0x2'));var rp=require(_0x35ff('0x3'));var fs=require('fs');var path=require(_0x35ff('0x4'));var rimraf=require(_0x35ff('0x5'));var config=require('../../config/environment');var attributes=require(_0x35ff('0x6'));module[_0x35ff('0x7')]=function(_0x2e9873,_0x11e738){return _0x2e9873[_0x35ff('0x8')]('CmList',attributes,{'tableName':_0x35ff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa88=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','CmList','cm_lists','lodash'];(function(_0x296841,_0xf3266a){var _0x45718b=function(_0x2dcce4){while(--_0x2dcce4){_0x296841['push'](_0x296841['shift']());}};_0x45718b(++_0xf3266a);}(_0xaa88,0x137));var _0x8aa8=function(_0x3f465d,_0xbd2037){_0x3f465d=_0x3f465d-0x0;var _0x121ad1=_0xaa88[_0x3f465d];return _0x121ad1;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var moment=require('moment');var BPromise=require(_0x8aa8('0x4'));var rp=require(_0x8aa8('0x5'));var fs=require('fs');var path=require(_0x8aa8('0x6'));var rimraf=require(_0x8aa8('0x7'));var config=require(_0x8aa8('0x8'));var attributes=require(_0x8aa8('0x9'));module['exports']=function(_0x5bda0d,_0x460042){return _0x5bda0d['define'](_0x8aa8('0xa'),attributes,{'tableName':_0x8aa8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 591611a..30ef793 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 _0x8401=['request','info','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','CmList,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./cmList.socket','register'];(function(_0x1e70b4,_0x523e58){var _0x5a039b=function(_0x169661){while(--_0x169661){_0x1e70b4['push'](_0x1e70b4['shift']());}};_0x5a039b(++_0x523e58);}(_0x8401,0x14f));var _0x1840=function(_0x395257,_0x5a4e1a){_0x395257=_0x395257-0x0;var _0x318bb3=_0x8401[_0x395257];return _0x318bb3;};'use strict';var _=require(_0x1840('0x0'));var util=require('util');var moment=require(_0x1840('0x1'));var BPromise=require(_0x1840('0x2'));var rs=require(_0x1840('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1840('0x4'))['db'];var utils=require(_0x1840('0x5'));var logger=require('../../config/logger')(_0x1840('0x6'));var config=require(_0x1840('0x7'));var jayson=require(_0x1840('0x8'));var client=jayson['client'][_0x1840('0x9')]({'port':0x232a});config[_0x1840('0xa')]=_[_0x1840('0xb')](config['redis'],{'host':_0x1840('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1840('0xa')]));require(_0x1840('0xd'))[_0x1840('0xe')](socket);function respondWithRpcPromise(_0x4b9a74,_0xc64ca3,_0x54e56f){return new BPromise(function(_0x447429,_0x1aa5c9){return client[_0x1840('0xf')](_0x4b9a74,_0x54e56f)['then'](function(_0x198428){logger[_0x1840('0x10')]('CmList,\x20%s,\x20%s',_0xc64ca3,_0x1840('0x11'));logger['debug'](_0x1840('0x12'),_0xc64ca3,'request\x20sent',JSON[_0x1840('0x13')](_0x198428));if(_0x198428['error']){if(_0x198428[_0x1840('0x14')]['code']===0x1f4){logger['error'](_0x1840('0x15'),_0xc64ca3,_0x198428[_0x1840('0x14')][_0x1840('0x16')]);return _0x1aa5c9(_0x198428[_0x1840('0x14')][_0x1840('0x16')]);}logger['error'](_0x1840('0x15'),_0xc64ca3,_0x198428[_0x1840('0x14')][_0x1840('0x16')]);return _0x447429(_0x198428[_0x1840('0x14')][_0x1840('0x16')]);}else{logger[_0x1840('0x10')]('CmList,\x20%s,\x20%s',_0xc64ca3,_0x1840('0x11'));_0x447429(_0x198428[_0x1840('0x17')]['message']);}})[_0x1840('0x18')](function(_0x4b5fff){logger[_0x1840('0x14')]('CmList,\x20%s,\x20%s',_0xc64ca3,_0x4b5fff);_0x1aa5c9(_0x4b5fff);});});} \ No newline at end of file +var _0x6f3c=['message','info','request\x20sent','catch','util','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./cmList.socket','register','request','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','error'];(function(_0x3d17e0,_0x56e2b){var _0xb0f7ee=function(_0x54cfee){while(--_0x54cfee){_0x3d17e0['push'](_0x3d17e0['shift']());}};_0xb0f7ee(++_0x56e2b);}(_0x6f3c,0x12f));var _0xc6f3=function(_0x565a0c,_0x4ae44a){_0x565a0c=_0x565a0c-0x0;var _0x251fbf=_0x6f3c[_0x565a0c];return _0x251fbf;};'use strict';var _=require('lodash');var util=require(_0xc6f3('0x0'));var moment=require(_0xc6f3('0x1'));var BPromise=require(_0xc6f3('0x2'));var rs=require(_0xc6f3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc6f3('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc6f3('0x5'));var config=require('../../config/environment');var jayson=require(_0xc6f3('0x6'));var client=jayson[_0xc6f3('0x7')][_0xc6f3('0x8')]({'port':0x232a});config[_0xc6f3('0x9')]=_[_0xc6f3('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc6f3('0xb'))(new Redis(config['redis']));require(_0xc6f3('0xc'))[_0xc6f3('0xd')](socket);function respondWithRpcPromise(_0x1ffa0c,_0x48e879,_0x572f76){return new BPromise(function(_0x26f42f,_0x355a03){return client[_0xc6f3('0xe')](_0x1ffa0c,_0x572f76)['then'](function(_0x1f6117){logger['info'](_0xc6f3('0xf'),_0x48e879,'request\x20sent');logger[_0xc6f3('0x10')](_0xc6f3('0x11'),_0x48e879,'request\x20sent',JSON['stringify'](_0x1f6117));if(_0x1f6117['error']){if(_0x1f6117['error']['code']===0x1f4){logger[_0xc6f3('0x12')](_0xc6f3('0xf'),_0x48e879,_0x1f6117[_0xc6f3('0x12')]['message']);return _0x355a03(_0x1f6117[_0xc6f3('0x12')][_0xc6f3('0x13')]);}logger[_0xc6f3('0x12')](_0xc6f3('0xf'),_0x48e879,_0x1f6117[_0xc6f3('0x12')][_0xc6f3('0x13')]);return _0x26f42f(_0x1f6117['error'][_0xc6f3('0x13')]);}else{logger[_0xc6f3('0x14')]('CmList,\x20%s,\x20%s',_0x48e879,_0xc6f3('0x15'));_0x26f42f(_0x1f6117['result'][_0xc6f3('0x13')]);}})[_0xc6f3('0x16')](function(_0x36a2d0){logger[_0xc6f3('0x12')]('CmList,\x20%s,\x20%s',_0x48e879,_0x36a2d0);_0x355a03(_0x36a2d0);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index dfcc863..709fc35 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 _0x3d9a=['update','register','./cmList.events','save'];(function(_0x2a0496,_0x2dc51d){var _0x47c721=function(_0x29c514){while(--_0x29c514){_0x2a0496['push'](_0x2a0496['shift']());}};_0x47c721(++_0x2dc51d);}(_0x3d9a,0x11a));var _0xa3d9=function(_0x559616,_0x12d004){_0x559616=_0x559616-0x0;var _0x23de49=_0x3d9a[_0x559616];return _0x23de49;};'use strict';var CmListEvents=require(_0xa3d9('0x0'));var events=[_0xa3d9('0x1'),'remove',_0xa3d9('0x2')];function createListener(_0xa3c7be,_0x4ffa52){return function(_0xf8cf74){_0x4ffa52['emit'](_0xa3c7be,_0xf8cf74);};}function removeListener(_0x279c74,_0x6abe2d){return function(){CmListEvents['removeListener'](_0x279c74,_0x6abe2d);};}exports[_0xa3d9('0x3')]=function(_0x20c6de){for(var _0x1238e2=0x0,_0x182d90=events['length'];_0x1238e2<_0x182d90;_0x1238e2++){var _0x1b0534=events[_0x1238e2];var _0x471ccd=createListener('cmList:'+_0x1b0534,_0x20c6de);CmListEvents['on'](_0x1b0534,_0x471ccd);}}; \ No newline at end of file +var _0xdd3e=['./cmList.events','save','update','register','cmList:'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdd3e,0x11d));var _0xedd3=function(_0x14d45c,_0xd726f1){_0x14d45c=_0x14d45c-0x0;var _0x29005f=_0xdd3e[_0x14d45c];return _0x29005f;};'use strict';var CmListEvents=require(_0xedd3('0x0'));var events=[_0xedd3('0x1'),'remove',_0xedd3('0x2')];function createListener(_0x2d3725,_0x7d8deb){return function(_0x59bd18){_0x7d8deb['emit'](_0x2d3725,_0x59bd18);};}function removeListener(_0x10c2a4,_0x4f8870){return function(){CmListEvents['removeListener'](_0x10c2a4,_0x4f8870);};}exports[_0xedd3('0x3')]=function(_0x2831b7){for(var _0x2f29ce=0x0,_0x1706fa=events['length'];_0x2f29ce<_0x1706fa;_0x2f29ce++){var _0x2823de=events[_0x2f29ce];var _0x1b4bd9=createListener(_0xedd3('0x4')+_0x2823de,_0x2831b7);CmListEvents['on'](_0x2823de,_0x1b4bd9);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index d8fa486..8e3b65d 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 _0xf9f9=['update','destroy','delete','removeDispositions','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','getAgents','post','/:id/dispositions','addDisposition','addContacts','/:id/fields','addCustomField','/:id/users','addAgents','put'];(function(_0x3b76dd,_0x2f36fb){var _0x3d06d2=function(_0x253769){while(--_0x253769){_0x3b76dd['push'](_0x3b76dd['shift']());}};_0x3d06d2(++_0x2f36fb);}(_0xf9f9,0x15b));var _0x9f9f=function(_0x28706e,_0x1872a4){_0x28706e=_0x28706e-0x0;var _0x2b6b1f=_0xf9f9[_0x28706e];return _0x2b6b1f;};'use strict';var multer=require(_0x9f9f('0x0'));var util=require('util');var path=require(_0x9f9f('0x1'));var timeout=require(_0x9f9f('0x2'));var express=require(_0x9f9f('0x3'));var router=express['Router']();var fs_extra=require(_0x9f9f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9f9f('0x5'));var config=require(_0x9f9f('0x6'));var controller=require(_0x9f9f('0x7'));router[_0x9f9f('0x8')]('/',auth[_0x9f9f('0x9')](),controller[_0x9f9f('0xa')]);router['get'](_0x9f9f('0xb'),auth['isAuthenticated'](),controller[_0x9f9f('0xc')]);router[_0x9f9f('0x8')](_0x9f9f('0xd'),auth['isAuthenticated'](),controller[_0x9f9f('0xe')]);router[_0x9f9f('0x8')](_0x9f9f('0xf'),auth['isAuthenticated'](),controller[_0x9f9f('0x10')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x9f9f('0x11')]);router[_0x9f9f('0x8')](_0x9f9f('0x12'),auth[_0x9f9f('0x9')](),controller[_0x9f9f('0x13')]);router[_0x9f9f('0x8')](_0x9f9f('0x14'),auth['isAuthenticated'](),controller[_0x9f9f('0x15')]);router['get']('/:id/fields',auth[_0x9f9f('0x9')](),controller[_0x9f9f('0x16')]);router[_0x9f9f('0x8')]('/:id/users',auth[_0x9f9f('0x9')](),controller[_0x9f9f('0x17')]);router[_0x9f9f('0x18')]('/',auth[_0x9f9f('0x9')](),controller['create']);router['post'](_0x9f9f('0x19'),auth[_0x9f9f('0x9')](),controller[_0x9f9f('0x1a')]);router[_0x9f9f('0x18')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x9f9f('0x1b')]);router[_0x9f9f('0x18')](_0x9f9f('0x1c'),auth[_0x9f9f('0x9')](),controller[_0x9f9f('0x1d')]);router['post'](_0x9f9f('0x1e'),auth[_0x9f9f('0x9')](),controller[_0x9f9f('0x1f')]);router[_0x9f9f('0x20')](_0x9f9f('0xf'),auth['isAuthenticated'](),controller[_0x9f9f('0x21')]);router['delete'](_0x9f9f('0xf'),auth['isAuthenticated'](),controller[_0x9f9f('0x22')]);router[_0x9f9f('0x23')](_0x9f9f('0x19'),auth['isAuthenticated'](),controller[_0x9f9f('0x24')]);router[_0x9f9f('0x23')]('/:id/users',auth[_0x9f9f('0x9')](),controller['removeAgents']);module[_0x9f9f('0x25')]=router; \ No newline at end of file +var _0x3512=['addAgents','update','destroy','delete','removeAgents','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addContacts','addCustomField'];(function(_0x181433,_0x259e41){var _0x5b7885=function(_0x4ad875){while(--_0x4ad875){_0x181433['push'](_0x181433['shift']());}};_0x5b7885(++_0x259e41);}(_0x3512,0x9e));var _0x2351=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3512[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x2351('0x0'));var util=require(_0x2351('0x1'));var path=require(_0x2351('0x2'));var timeout=require(_0x2351('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2351('0x4'));var auth=require(_0x2351('0x5'));var interaction=require(_0x2351('0x6'));var config=require(_0x2351('0x7'));var controller=require(_0x2351('0x8'));router[_0x2351('0x9')]('/',auth[_0x2351('0xa')](),controller[_0x2351('0xb')]);router['get'](_0x2351('0xc'),auth[_0x2351('0xa')](),controller[_0x2351('0xd')]);router['get'](_0x2351('0xe'),auth[_0x2351('0xa')](),controller[_0x2351('0xf')]);router[_0x2351('0x9')](_0x2351('0x10'),auth[_0x2351('0xa')](),controller[_0x2351('0x11')]);router[_0x2351('0x9')](_0x2351('0x12'),auth[_0x2351('0xa')](),controller[_0x2351('0x13')]);router[_0x2351('0x9')](_0x2351('0x14'),auth['isAuthenticated'](),controller['getContacts']);router['get'](_0x2351('0x15'),auth[_0x2351('0xa')](),controller[_0x2351('0x16')]);router[_0x2351('0x9')](_0x2351('0x17'),auth['isAuthenticated'](),controller[_0x2351('0x18')]);router[_0x2351('0x9')](_0x2351('0x19'),auth['isAuthenticated'](),controller[_0x2351('0x1a')]);router[_0x2351('0x1b')]('/',auth[_0x2351('0xa')](),controller[_0x2351('0x1c')]);router[_0x2351('0x1b')](_0x2351('0x12'),auth[_0x2351('0xa')](),controller[_0x2351('0x1d')]);router['post'](_0x2351('0x14'),auth[_0x2351('0xa')](),controller[_0x2351('0x1e')]);router[_0x2351('0x1b')]('/:id/fields',auth[_0x2351('0xa')](),controller[_0x2351('0x1f')]);router[_0x2351('0x1b')](_0x2351('0x19'),auth[_0x2351('0xa')](),controller[_0x2351('0x20')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x2351('0x21')]);router['delete'](_0x2351('0x10'),auth[_0x2351('0xa')](),controller[_0x2351('0x22')]);router[_0x2351('0x23')](_0x2351('0x12'),auth[_0x2351('0xa')](),controller['removeDispositions']);router[_0x2351('0x23')]('/:id/users',auth['isAuthenticated'](),controller[_0x2351('0x24')]);module[_0x2351('0x25')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 5edd397..00a65a6 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 _0x88e6=['field','STRING','sequelize','VIRTUAL','getDataValue'];(function(_0x32b0c5,_0x4d752a){var _0x337bbf=function(_0x2c3960){while(--_0x2c3960){_0x32b0c5['push'](_0x32b0c5['shift']());}};_0x337bbf(++_0x4d752a);}(_0x88e6,0xe8));var _0x688e=function(_0x662cc7,_0xd76915){_0x662cc7=_0x662cc7-0x0;var _0x19351a=_0x88e6[_0x662cc7];return _0x19351a;};'use strict';var Sequelize=require(_0x688e('0x0'));module['exports']={'name':{'type':Sequelize[_0x688e('0x1')],'get':function(_0x5bb8e4){return this[_0x688e('0x2')](_0x688e('0x3'));}},'field':{'type':Sequelize[_0x688e('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x688e('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x1530=['getDataValue','field','STRING','sequelize','exports','VIRTUAL'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0x1530,0x81));var _0x0153=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x1530[_0xc6be3a];return _0x56a310;};'use strict';var Sequelize=require(_0x0153('0x0'));module[_0x0153('0x1')]={'name':{'type':Sequelize[_0x0153('0x2')],'get':function(_0x434145){return this[_0x0153('0x3')](_0x0153('0x4'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0153('0x5')],'allowNull':![]},'value':{'type':Sequelize[_0x0153('0x5')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 68470b2..61b8f89 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(_0x4c914b,_0x5d3cf4){var _0x57bea3=function(_0x2dd618){while(--_0x2dd618){_0x4c914b['push'](_0x4c914b['shift']());}};_0x57bea3(++_0x5d3cf4);}(_0x7a54,0x106));var _0x47a5=function(_0x37a15e,_0x4f65c2){_0x37a15e=_0x37a15e-0x0;var _0x26dbd8=_0x7a54[_0x37a15e];return _0x26dbd8;};'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(_0x3d584b,_0x258f5f){var _0x4d1532=function(_0x34cd7e){while(--_0x34cd7e){_0x3d584b['push'](_0x3d584b['shift']());}};_0x4d1532(++_0x258f5f);}(_0x7a54,0x106));var _0x47a5=function(_0x21da52,_0x6af29){_0x21da52=_0x21da52-0x0;var _0x51f168=_0x7a54[_0x21da52];return _0x51f168;};'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 b427b4b..a68aa56 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 _0xb51f=['bluebird','path','../../config/environment','./condition.attributes','define','lodash','util','../../config/logger','api','moment'];(function(_0x1a3243,_0x201872){var _0x33f2ca=function(_0x59d32e){while(--_0x59d32e){_0x1a3243['push'](_0x1a3243['shift']());}};_0x33f2ca(++_0x201872);}(_0xb51f,0xff));var _0xfb51=function(_0x26bc36,_0x95e54){_0x26bc36=_0x26bc36-0x0;var _0x173490=_0xb51f[_0x26bc36];return _0x173490;};'use strict';var _=require(_0xfb51('0x0'));var util=require(_0xfb51('0x1'));var logger=require(_0xfb51('0x2'))(_0xfb51('0x3'));var moment=require(_0xfb51('0x4'));var BPromise=require(_0xfb51('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb51('0x6'));var rimraf=require('rimraf');var config=require(_0xfb51('0x7'));var attributes=require(_0xfb51('0x8'));module['exports']=function(_0x135cc6,_0x1cd676){return _0x135cc6[_0xfb51('0x9')]('Condition',attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2aaf=['moment','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','Condition','lodash','util','api'];(function(_0x15105b,_0x37c016){var _0x131594=function(_0x569028){while(--_0x569028){_0x15105b['push'](_0x15105b['shift']());}};_0x131594(++_0x37c016);}(_0x2aaf,0xc3));var _0xf2aa=function(_0x56943e,_0x51c224){_0x56943e=_0x56943e-0x0;var _0x234a0b=_0x2aaf[_0x56943e];return _0x234a0b;};'use strict';var _=require(_0xf2aa('0x0'));var util=require(_0xf2aa('0x1'));var logger=require('../../config/logger')(_0xf2aa('0x2'));var moment=require(_0xf2aa('0x3'));var BPromise=require('bluebird');var rp=require(_0xf2aa('0x4'));var fs=require('fs');var path=require(_0xf2aa('0x5'));var rimraf=require(_0xf2aa('0x6'));var config=require(_0xf2aa('0x7'));var attributes=require(_0xf2aa('0x8'));module[_0xf2aa('0x9')]=function(_0x5c227c,_0x2854f2){return _0x5c227c['define'](_0xf2aa('0xa'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index cd1fb16..a7d5a0b 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 _0x30e4=['lodash','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x4b826e,_0x33b6b){var _0x10e06c=function(_0x842a7b){while(--_0x842a7b){_0x4b826e['push'](_0x4b826e['shift']());}};_0x10e06c(++_0x33b6b);}(_0x30e4,0x8c));var _0x430e=function(_0x33f5ca,_0x494131){_0x33f5ca=_0x33f5ca-0x0;var _0x288835=_0x30e4[_0x33f5ca];return _0x288835;};'use strict';var _=require(_0x430e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x430e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x430e('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x430e('0x3'))(_0x430e('0x4'));var config=require(_0x430e('0x5'));var jayson=require(_0x430e('0x6'));var client=jayson[_0x430e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xdba3b6,_0x24f335,_0x1fefe8){return new BPromise(function(_0x4d79f7,_0x75e55e){return client[_0x430e('0x8')](_0xdba3b6,_0x1fefe8)[_0x430e('0x9')](function(_0x552c8a){logger[_0x430e('0xa')](_0x430e('0xb'),_0x24f335,_0x430e('0xc'));logger[_0x430e('0xd')](_0x430e('0xe'),_0x24f335,'request\x20sent',JSON[_0x430e('0xf')](_0x552c8a));if(_0x552c8a[_0x430e('0x10')]){if(_0x552c8a[_0x430e('0x10')][_0x430e('0x11')]===0x1f4){logger[_0x430e('0x10')](_0x430e('0xb'),_0x24f335,_0x552c8a[_0x430e('0x10')][_0x430e('0x12')]);return _0x75e55e(_0x552c8a[_0x430e('0x10')][_0x430e('0x12')]);}logger[_0x430e('0x10')](_0x430e('0xb'),_0x24f335,_0x552c8a[_0x430e('0x10')][_0x430e('0x12')]);return _0x4d79f7(_0x552c8a[_0x430e('0x10')][_0x430e('0x12')]);}else{logger[_0x430e('0xa')](_0x430e('0xb'),_0x24f335,_0x430e('0xc'));_0x4d79f7(_0x552c8a['result'][_0x430e('0x12')]);}})[_0x430e('0x13')](function(_0x4584bb){logger[_0x430e('0x10')](_0x430e('0xb'),_0x24f335,_0x4584bb);_0x75e55e(_0x4584bb);});});} \ No newline at end of file +var _0x74f8=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','Condition,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Condition,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x74f8,0x1cd));var _0x874f=function(_0x277504,_0x41a682){_0x277504=_0x277504-0x0;var _0x1ff6a0=_0x74f8[_0x277504];return _0x1ff6a0;};'use strict';var _=require(_0x874f('0x0'));var util=require('util');var moment=require(_0x874f('0x1'));var BPromise=require('bluebird');var rs=require(_0x874f('0x2'));var fs=require('fs');var Redis=require(_0x874f('0x3'));var db=require(_0x874f('0x4'))['db'];var utils=require(_0x874f('0x5'));var logger=require(_0x874f('0x6'))(_0x874f('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x874f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5fc5f7,_0x50b275,_0x50074f){return new BPromise(function(_0x21a4b9,_0x3b5352){return client[_0x874f('0x9')](_0x5fc5f7,_0x50074f)[_0x874f('0xa')](function(_0x29976e){logger[_0x874f('0xb')]('Condition,\x20%s,\x20%s',_0x50b275,'request\x20sent');logger['debug'](_0x874f('0xc'),_0x50b275,_0x874f('0xd'),JSON[_0x874f('0xe')](_0x29976e));if(_0x29976e[_0x874f('0xf')]){if(_0x29976e['error'][_0x874f('0x10')]===0x1f4){logger['error'](_0x874f('0x11'),_0x50b275,_0x29976e[_0x874f('0xf')][_0x874f('0x12')]);return _0x3b5352(_0x29976e['error'][_0x874f('0x12')]);}logger['error'](_0x874f('0x11'),_0x50b275,_0x29976e[_0x874f('0xf')]['message']);return _0x21a4b9(_0x29976e[_0x874f('0xf')][_0x874f('0x12')]);}else{logger[_0x874f('0xb')](_0x874f('0x11'),_0x50b275,'request\x20sent');_0x21a4b9(_0x29976e[_0x874f('0x13')][_0x874f('0x12')]);}})[_0x874f('0x14')](function(_0x4db3d4){logger['error'](_0x874f('0x11'),_0x50b275,_0x4db3d4);_0x3b5352(_0x4db3d4);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 5f6c843..c2b3b60 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 _0xaab4=['multer','express','Router','../../components/auth/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','exports'];(function(_0xb9a306,_0x48ebcd){var _0x55c163=function(_0x26a8ee){while(--_0x26a8ee){_0xb9a306['push'](_0xb9a306['shift']());}};_0x55c163(++_0x48ebcd);}(_0xaab4,0x75));var _0x4aab=function(_0x27c65a,_0x21f698){_0x27c65a=_0x27c65a-0x0;var _0x466c67=_0xaab4[_0x27c65a];return _0x466c67;};'use strict';var multer=require(_0x4aab('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4aab('0x1'));var router=express[_0x4aab('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x4aab('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x4aab('0x4'));var controller=require(_0x4aab('0x5'));router[_0x4aab('0x6')](_0x4aab('0x7'),auth[_0x4aab('0x8')](),controller[_0x4aab('0x9')]);router[_0x4aab('0xa')](_0x4aab('0x7'),auth[_0x4aab('0x8')](),controller[_0x4aab('0xb')]);module[_0x4aab('0xc')]=router; \ No newline at end of file +var _0x69ee=['../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','destroy','exports','util','path','express','Router','fs-extra'];(function(_0x51a50c,_0x110ae4){var _0x3db3f3=function(_0x1de45c){while(--_0x1de45c){_0x51a50c['push'](_0x51a50c['shift']());}};_0x3db3f3(++_0x110ae4);}(_0x69ee,0x167));var _0xe69e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x69ee[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xe69e('0x0'));var path=require(_0xe69e('0x1'));var timeout=require('connect-timeout');var express=require(_0xe69e('0x2'));var router=express[_0xe69e('0x3')]();var fs_extra=require(_0xe69e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe69e('0x5'));var config=require(_0xe69e('0x6'));var controller=require(_0xe69e('0x7'));router[_0xe69e('0x8')](_0xe69e('0x9'),auth[_0xe69e('0xa')](),controller[_0xe69e('0xb')]);router['delete'](_0xe69e('0x9'),auth[_0xe69e('0xa')](),controller[_0xe69e('0xc')]);module[_0xe69e('0xd')]=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 066ec61..c892aec 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc1d8=['STRING','sequelize','exports','name','INTEGER'];(function(_0x164367,_0x2f212e){var _0x3e3e7e=function(_0x42d233){while(--_0x42d233){_0x164367['push'](_0x164367['shift']());}};_0x3e3e7e(++_0x2f212e);}(_0xc1d8,0xec));var _0x8c1d=function(_0x39b604,_0x44fde7){_0x39b604=_0x39b604-0x0;var _0x3fc4bc=_0xc1d8[_0x39b604];return _0x3fc4bc;};'use strict';var Sequelize=require(_0x8c1d('0x0'));module[_0x8c1d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x8c1d('0x2')},'OrderBy':{'type':Sequelize[_0x8c1d('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0x8c1d('0x4')],'allowNull':!![]}}; \ No newline at end of file +var _0x6244=['INTEGER','sequelize','exports','STRING'];(function(_0x548d29,_0x46dac4){var _0x1acb33=function(_0x53a057){while(--_0x53a057){_0x548d29['push'](_0x548d29['shift']());}};_0x1acb33(++_0x46dac4);}(_0x6244,0xcd));var _0x4624=function(_0x199cbc,_0x4b7676){_0x199cbc=_0x199cbc-0x0;var _0x42bb2b=_0x6244[_0x199cbc];return _0x42bb2b;};'use strict';var Sequelize=require(_0x4624('0x0'));module[_0x4624('0x1')]={'name':{'type':Sequelize[_0x4624('0x2')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0x4624('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 2e66bce..3b523b0 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d11=['intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','apply','reject','then','destroy','get','ContactItemTypes','UserProfileResource','error','stack','name','send','index','map','ContactItemType','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes'];(function(_0x314b41,_0x59661c){var _0x508fbb=function(_0xf6ab0a){while(--_0xf6ab0a){_0x314b41['push'](_0x314b41['shift']());}};_0x508fbb(++_0x59661c);}(_0x6d11,0xbf));var _0x16d1=function(_0x1e5083,_0x7284b0){_0x1e5083=_0x1e5083-0x0;var _0x3312ab=_0x6d11[_0x1e5083];return _0x3312ab;};'use strict';var emlformat=require(_0x16d1('0x0'));var rimraf=require(_0x16d1('0x1'));var zipdir=require(_0x16d1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x16d1('0x3'));var moment=require('moment');var BPromise=require(_0x16d1('0x4'));var Mustache=require(_0x16d1('0x5'));var util=require('util');var path=require('path');var sox=require(_0x16d1('0x6'));var csv=require(_0x16d1('0x7'));var ejs=require(_0x16d1('0x8'));var fs=require('fs');var fs_extra=require(_0x16d1('0x9'));var _=require(_0x16d1('0xa'));var squel=require(_0x16d1('0xb'));var crypto=require(_0x16d1('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x16d1('0xd'));var Papa=require(_0x16d1('0xe'));var Redis=require(_0x16d1('0xf'));var authService=require(_0x16d1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x16d1('0x11'));var hardwareService=require(_0x16d1('0x12'));var logger=require(_0x16d1('0x13'))(_0x16d1('0x14'));var utils=require(_0x16d1('0x15'));var config=require(_0x16d1('0x16'));var licenseUtil=require(_0x16d1('0x17'));var db=require(_0x16d1('0x18'))['db'];function respondWithStatusCode(_0x4de260,_0x32fa68){_0x32fa68=_0x32fa68||0xcc;return function(_0x2e71fa){if(_0x2e71fa){return _0x4de260[_0x16d1('0x19')](_0x32fa68);}return _0x4de260[_0x16d1('0x1a')](_0x32fa68)[_0x16d1('0x1b')]();};}function respondWithResult(_0x5a1429,_0xc034b7){_0xc034b7=_0xc034b7||0xc8;return function(_0x1b71d3){if(_0x1b71d3){return _0x5a1429[_0x16d1('0x1a')](_0xc034b7)[_0x16d1('0x1c')](_0x1b71d3);}};}function respondWithFilteredResult(_0x29ebba,_0x173e16){return function(_0x2d7e8a){if(_0x2d7e8a){var _0x4ee46c=typeof _0x173e16[_0x16d1('0x1d')]===_0x16d1('0x1e')&&typeof _0x173e16['limit']==='undefined';var _0x1a9ec8=_0x2d7e8a['count'];var _0x46a25e=_0x4ee46c?0x0:_0x173e16['offset'];var _0x1da1b8=_0x4ee46c?_0x2d7e8a['count']:_0x173e16[_0x16d1('0x1d')]+_0x173e16[_0x16d1('0x1f')];var _0x48cd70;if(_0x1da1b8>=_0x1a9ec8){_0x1da1b8=_0x1a9ec8;_0x48cd70=0xc8;}else{_0x48cd70=0xce;}_0x29ebba['status'](_0x48cd70);return _0x29ebba['set']('Content-Range',_0x46a25e+'-'+_0x1da1b8+'/'+_0x1a9ec8)[_0x16d1('0x1c')](_0x2d7e8a);}return null;};}function patchUpdates(_0x55a0e0){return function(_0x34b88f){try{jsonpatch[_0x16d1('0x20')](_0x34b88f,_0x55a0e0,!![]);}catch(_0x1f6add){return BPromise[_0x16d1('0x21')](_0x1f6add);}return _0x34b88f['save']();};}function saveUpdates(_0x2c7825,_0x58a03b){return function(_0x2a897d){if(_0x2a897d){return _0x2a897d['update'](_0x2c7825)[_0x16d1('0x22')](function(_0x8c7266){return _0x8c7266;});}return null;};}function removeEntity(_0x17e038,_0x47cad4){return function(_0x215c23){if(_0x215c23){return _0x215c23[_0x16d1('0x23')]()[_0x16d1('0x22')](function(){var _0x21e122=_0x215c23[_0x16d1('0x24')]({'plain':!![]});var _0x335c24=_0x16d1('0x25');return db[_0x16d1('0x26')][_0x16d1('0x23')]({'where':{'type':_0x335c24,'resourceId':_0x21e122['id']}})[_0x16d1('0x22')](function(){return _0x215c23;});})[_0x16d1('0x22')](function(){_0x17e038[_0x16d1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25ae4e,_0x440a47){return function(_0x4257f1){if(!_0x4257f1){_0x25ae4e['sendStatus'](0x194);}return _0x4257f1;};}function handleError(_0x28837c,_0x1deb1e){_0x1deb1e=_0x1deb1e||0x1f4;return function(_0x364bf7){logger[_0x16d1('0x27')](_0x364bf7[_0x16d1('0x28')]);if(_0x364bf7[_0x16d1('0x29')]){delete _0x364bf7[_0x16d1('0x29')];}_0x28837c['status'](_0x1deb1e)[_0x16d1('0x2a')](_0x364bf7);};}exports[_0x16d1('0x2b')]=function(_0x31c4e9,_0x30cd8f){var _0x55c021={},_0x4b27f6={},_0x2f16ee={'count':0x0,'rows':[]};var _0x4ab3d4=_[_0x16d1('0x2c')](db[_0x16d1('0x2d')][_0x16d1('0x2e')],function(_0x2b4dbd){return{'name':_0x2b4dbd[_0x16d1('0x2f')],'type':_0x2b4dbd[_0x16d1('0x30')][_0x16d1('0x31')]};});_0x4b27f6[_0x16d1('0x32')]=_[_0x16d1('0x2c')](_0x4ab3d4,_0x16d1('0x29'));_0x4b27f6[_0x16d1('0x33')]=_[_0x16d1('0x34')](_0x31c4e9['query']);_0x4b27f6[_0x16d1('0x35')]=_['intersection'](_0x4b27f6[_0x16d1('0x32')],_0x4b27f6[_0x16d1('0x33')]);_0x55c021[_0x16d1('0x36')]=_[_0x16d1('0x37')](_0x4b27f6[_0x16d1('0x32')],qs[_0x16d1('0x38')](_0x31c4e9['query']['fields']));_0x55c021['attributes']=_0x55c021[_0x16d1('0x36')][_0x16d1('0x39')]?_0x55c021[_0x16d1('0x36')]:_0x4b27f6[_0x16d1('0x32')];if(!_0x31c4e9['query'][_0x16d1('0x3a')](_0x16d1('0x3b'))){_0x55c021['limit']=qs['limit'](_0x31c4e9['query'][_0x16d1('0x1f')]);_0x55c021[_0x16d1('0x1d')]=qs[_0x16d1('0x1d')](_0x31c4e9['query'][_0x16d1('0x1d')]);}_0x55c021[_0x16d1('0x3c')]=qs[_0x16d1('0x3d')](_0x31c4e9[_0x16d1('0x33')][_0x16d1('0x3d')]);_0x55c021[_0x16d1('0x3e')]=qs[_0x16d1('0x35')](_['pick'](_0x31c4e9['query'],_0x4b27f6['filters']),_0x4ab3d4);if(_0x31c4e9[_0x16d1('0x33')][_0x16d1('0x3f')]){_0x55c021[_0x16d1('0x3e')]=_[_0x16d1('0x40')](_0x55c021[_0x16d1('0x3e')],{'$or':_[_0x16d1('0x2c')](_0x4ab3d4,function(_0x364c39){if(_0x364c39[_0x16d1('0x30')]!=='VIRTUAL'){var _0x180f55={};_0x180f55[_0x364c39['name']]={'$like':'%'+_0x31c4e9['query'][_0x16d1('0x3f')]+'%'};return _0x180f55;}})});}_0x55c021=_[_0x16d1('0x40')]({},_0x55c021,_0x31c4e9[_0x16d1('0x41')]);var _0x3a0343={'where':_0x55c021[_0x16d1('0x3e')]};return db[_0x16d1('0x2d')]['count'](_0x3a0343)[_0x16d1('0x22')](function(_0x525212){_0x2f16ee['count']=_0x525212;if(_0x31c4e9['query']['includeAll']){_0x55c021[_0x16d1('0x42')]=[{'all':!![]}];}return db[_0x16d1('0x2d')][_0x16d1('0x43')](_0x55c021);})[_0x16d1('0x22')](function(_0x53de06){_0x2f16ee[_0x16d1('0x44')]=_0x53de06;return _0x2f16ee;})['then'](respondWithFilteredResult(_0x30cd8f,_0x55c021))[_0x16d1('0x45')](handleError(_0x30cd8f,null));};exports[_0x16d1('0x46')]=function(_0x19ac7c,_0x2e4971){var _0x1a109d={'raw':!![],'where':{'id':_0x19ac7c[_0x16d1('0x47')]['id']}},_0x116f51={};_0x116f51[_0x16d1('0x32')]=_[_0x16d1('0x34')](db[_0x16d1('0x2d')][_0x16d1('0x2e')]);_0x116f51[_0x16d1('0x33')]=_[_0x16d1('0x34')](_0x19ac7c[_0x16d1('0x33')]);_0x116f51[_0x16d1('0x35')]=_['intersection'](_0x116f51['model'],_0x116f51[_0x16d1('0x33')]);_0x1a109d[_0x16d1('0x36')]=_[_0x16d1('0x37')](_0x116f51[_0x16d1('0x32')],qs[_0x16d1('0x38')](_0x19ac7c[_0x16d1('0x33')]['fields']));_0x1a109d[_0x16d1('0x36')]=_0x1a109d[_0x16d1('0x36')][_0x16d1('0x39')]?_0x1a109d['attributes']:_0x116f51['model'];if(_0x19ac7c[_0x16d1('0x33')][_0x16d1('0x48')]){_0x1a109d['include']=[{'all':!![]}];}_0x1a109d=_[_0x16d1('0x40')]({},_0x1a109d,_0x19ac7c['options']);return db[_0x16d1('0x2d')][_0x16d1('0x49')](_0x1a109d)[_0x16d1('0x22')](handleEntityNotFound(_0x2e4971,null))[_0x16d1('0x22')](respondWithResult(_0x2e4971,null))['catch'](handleError(_0x2e4971,null));};exports['create']=function(_0x1d92cd,_0x8bb0c1){return db['ContactItemType'][_0x16d1('0x4a')](_0x1d92cd[_0x16d1('0x4b')],{})[_0x16d1('0x22')](function(_0x117da5){var _0x3b77db=_0x1d92cd['user'][_0x16d1('0x24')]({'plain':!![]});if(!_0x3b77db)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3b77db[_0x16d1('0x4c')]===_0x16d1('0x4d')){var _0x5d384c=_0x117da5[_0x16d1('0x24')]({'plain':!![]});var _0xd3a7f8=_0x16d1('0x25');return db[_0x16d1('0x4e')]['find']({'where':{'name':_0xd3a7f8,'userProfileId':_0x3b77db['userProfileId']},'raw':!![]})['then'](function(_0x34e266){if(_0x34e266&&_0x34e266[_0x16d1('0x4f')]===0x0){return db[_0x16d1('0x26')][_0x16d1('0x4a')]({'name':_0x5d384c['name'],'resourceId':_0x5d384c['id'],'type':_0x34e266[_0x16d1('0x29')],'sectionId':_0x34e266['id']},{})[_0x16d1('0x22')](function(){return _0x117da5;});}else{return _0x117da5;}})['catch'](function(_0x1e1bbc){logger[_0x16d1('0x27')](_0x16d1('0x50'),_0x1e1bbc);throw _0x1e1bbc;});}return _0x117da5;})[_0x16d1('0x22')](respondWithResult(_0x8bb0c1,0xc9))['catch'](handleError(_0x8bb0c1,null));};exports[_0x16d1('0x51')]=function(_0x2b0aa7,_0xb9fb43){if(_0x2b0aa7['body']['id']){delete _0x2b0aa7['body']['id'];}return db[_0x16d1('0x2d')][_0x16d1('0x49')]({'where':{'id':_0x2b0aa7['params']['id']}})[_0x16d1('0x22')](handleEntityNotFound(_0xb9fb43,null))[_0x16d1('0x22')](saveUpdates(_0x2b0aa7[_0x16d1('0x4b')],null))['then'](respondWithResult(_0xb9fb43,null))[_0x16d1('0x45')](handleError(_0xb9fb43,null));};exports[_0x16d1('0x23')]=function(_0x11209f,_0x4b3079){return db[_0x16d1('0x2d')][_0x16d1('0x49')]({'where':{'id':_0x11209f['params']['id']}})[_0x16d1('0x22')](handleEntityNotFound(_0x4b3079,null))[_0x16d1('0x22')](db['CmContactHasItem'][_0x16d1('0x51')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x11209f[_0x16d1('0x47')]['id']}}))[_0x16d1('0x22')](removeEntity(_0x4b3079,null))[_0x16d1('0x45')](handleError(_0x4b3079,null));}; \ No newline at end of file +var _0xbbbc=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','ContactItemType','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','fields','include','options','create','body','user','ContactItemTypes','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x5e9772,_0x715f77){var _0x53fc45=function(_0x4bdc12){while(--_0x4bdc12){_0x5e9772['push'](_0x5e9772['shift']());}};_0x53fc45(++_0x715f77);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x57d45b,_0x4651d5){_0x57d45b=_0x57d45b-0x0;var _0x4ceefb=_0xbbbc[_0x57d45b];return _0x4ceefb;};'use strict';var emlformat=require(_0xcbbb('0x0'));var rimraf=require(_0xcbbb('0x1'));var zipdir=require(_0xcbbb('0x2'));var jsonpatch=require(_0xcbbb('0x3'));var rp=require(_0xcbbb('0x4'));var moment=require(_0xcbbb('0x5'));var BPromise=require(_0xcbbb('0x6'));var Mustache=require('mustache');var util=require(_0xcbbb('0x7'));var path=require(_0xcbbb('0x8'));var sox=require(_0xcbbb('0x9'));var csv=require(_0xcbbb('0xa'));var ejs=require(_0xcbbb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcbbb('0xc'));var squel=require(_0xcbbb('0xd'));var crypto=require(_0xcbbb('0xe'));var jsforce=require(_0xcbbb('0xf'));var deskjs=require(_0xcbbb('0x10'));var toCsv=require(_0xcbbb('0xa'));var querystring=require(_0xcbbb('0x11'));var Papa=require('papaparse');var Redis=require(_0xcbbb('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcbbb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcbbb('0x14'))('api');var utils=require(_0xcbbb('0x15'));var config=require(_0xcbbb('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcbbb('0x17'))['db'];function respondWithStatusCode(_0x53e651,_0x56f81){_0x56f81=_0x56f81||0xcc;return function(_0x523c50){if(_0x523c50){return _0x53e651[_0xcbbb('0x18')](_0x56f81);}return _0x53e651[_0xcbbb('0x19')](_0x56f81)[_0xcbbb('0x1a')]();};}function respondWithResult(_0x47ea6a,_0x27ba56){_0x27ba56=_0x27ba56||0xc8;return function(_0x3ff767){if(_0x3ff767){return _0x47ea6a[_0xcbbb('0x19')](_0x27ba56)[_0xcbbb('0x1b')](_0x3ff767);}};}function respondWithFilteredResult(_0x47e679,_0x5af226){return function(_0x1bba39){if(_0x1bba39){var _0x30297d=typeof _0x5af226[_0xcbbb('0x1c')]===_0xcbbb('0x1d')&&typeof _0x5af226['limit']===_0xcbbb('0x1d');var _0x4ff973=_0x1bba39[_0xcbbb('0x1e')];var _0x3436af=_0x30297d?0x0:_0x5af226[_0xcbbb('0x1c')];var _0x5052df=_0x30297d?_0x1bba39['count']:_0x5af226['offset']+_0x5af226[_0xcbbb('0x1f')];var _0x3ae91b;if(_0x5052df>=_0x4ff973){_0x5052df=_0x4ff973;_0x3ae91b=0xc8;}else{_0x3ae91b=0xce;}_0x47e679[_0xcbbb('0x19')](_0x3ae91b);return _0x47e679[_0xcbbb('0x20')](_0xcbbb('0x21'),_0x3436af+'-'+_0x5052df+'/'+_0x4ff973)[_0xcbbb('0x1b')](_0x1bba39);}return null;};}function patchUpdates(_0x45de5f){return function(_0x2be36c){try{jsonpatch[_0xcbbb('0x22')](_0x2be36c,_0x45de5f,!![]);}catch(_0x2d4335){return BPromise['reject'](_0x2d4335);}return _0x2be36c[_0xcbbb('0x23')]();};}function saveUpdates(_0xe07b0,_0x159c62){return function(_0x42aaf1){if(_0x42aaf1){return _0x42aaf1[_0xcbbb('0x24')](_0xe07b0)[_0xcbbb('0x25')](function(_0x297eae){return _0x297eae;});}return null;};}function removeEntity(_0xabb565,_0x3ca570){return function(_0x5e3970){if(_0x5e3970){return _0x5e3970[_0xcbbb('0x26')]()[_0xcbbb('0x25')](function(){var _0x4c543a=_0x5e3970[_0xcbbb('0x27')]({'plain':!![]});var _0x4ffa80='ContactItemTypes';return db[_0xcbbb('0x28')][_0xcbbb('0x26')]({'where':{'type':_0x4ffa80,'resourceId':_0x4c543a['id']}})['then'](function(){return _0x5e3970;});})['then'](function(){_0xabb565['status'](0xcc)[_0xcbbb('0x1a')]();});}};}function handleEntityNotFound(_0x55e1d8,_0x4da775){return function(_0x21e3b1){if(!_0x21e3b1){_0x55e1d8[_0xcbbb('0x18')](0x194);}return _0x21e3b1;};}function handleError(_0x38f1c6,_0x13121e){_0x13121e=_0x13121e||0x1f4;return function(_0x372024){logger[_0xcbbb('0x29')](_0x372024[_0xcbbb('0x2a')]);if(_0x372024[_0xcbbb('0x2b')]){delete _0x372024[_0xcbbb('0x2b')];}_0x38f1c6[_0xcbbb('0x19')](_0x13121e)[_0xcbbb('0x2c')](_0x372024);};}exports[_0xcbbb('0x2d')]=function(_0xfa973b,_0x1ce741){var _0x2a9639={},_0xcae72c={},_0x117739={'count':0x0,'rows':[]};var _0x21c560=_['map'](db[_0xcbbb('0x2e')][_0xcbbb('0x2f')],function(_0x5332f9){return{'name':_0x5332f9[_0xcbbb('0x30')],'type':_0x5332f9['type'][_0xcbbb('0x31')]};});_0xcae72c[_0xcbbb('0x32')]=_[_0xcbbb('0x33')](_0x21c560,'name');_0xcae72c[_0xcbbb('0x34')]=_[_0xcbbb('0x35')](_0xfa973b[_0xcbbb('0x34')]);_0xcae72c[_0xcbbb('0x36')]=_[_0xcbbb('0x37')](_0xcae72c[_0xcbbb('0x32')],_0xcae72c[_0xcbbb('0x34')]);_0x2a9639[_0xcbbb('0x38')]=_[_0xcbbb('0x37')](_0xcae72c[_0xcbbb('0x32')],qs['fields'](_0xfa973b['query']['fields']));_0x2a9639['attributes']=_0x2a9639[_0xcbbb('0x38')][_0xcbbb('0x39')]?_0x2a9639[_0xcbbb('0x38')]:_0xcae72c[_0xcbbb('0x32')];if(!_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x3a')](_0xcbbb('0x3b'))){_0x2a9639[_0xcbbb('0x1f')]=qs[_0xcbbb('0x1f')](_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x1f')]);_0x2a9639[_0xcbbb('0x1c')]=qs['offset'](_0xfa973b['query'][_0xcbbb('0x1c')]);}_0x2a9639['order']=qs['sort'](_0xfa973b['query'][_0xcbbb('0x3c')]);_0x2a9639[_0xcbbb('0x3d')]=qs[_0xcbbb('0x36')](_[_0xcbbb('0x3e')](_0xfa973b[_0xcbbb('0x34')],_0xcae72c[_0xcbbb('0x36')]),_0x21c560);if(_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x3f')]){_0x2a9639[_0xcbbb('0x3d')]=_[_0xcbbb('0x40')](_0x2a9639[_0xcbbb('0x3d')],{'$or':_['map'](_0x21c560,function(_0x21ec4b){if(_0x21ec4b['type']!==_0xcbbb('0x41')){var _0xf5b6f9={};_0xf5b6f9[_0x21ec4b[_0xcbbb('0x2b')]]={'$like':'%'+_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x3f')]+'%'};return _0xf5b6f9;}})});}_0x2a9639=_[_0xcbbb('0x40')]({},_0x2a9639,_0xfa973b['options']);var _0x4d31d2={'where':_0x2a9639['where']};return db[_0xcbbb('0x2e')][_0xcbbb('0x1e')](_0x4d31d2)[_0xcbbb('0x25')](function(_0x162979){_0x117739[_0xcbbb('0x1e')]=_0x162979;if(_0xfa973b[_0xcbbb('0x34')][_0xcbbb('0x42')]){_0x2a9639['include']=[{'all':!![]}];}return db[_0xcbbb('0x2e')][_0xcbbb('0x43')](_0x2a9639);})['then'](function(_0x15b3bc){_0x117739[_0xcbbb('0x44')]=_0x15b3bc;return _0x117739;})[_0xcbbb('0x25')](respondWithFilteredResult(_0x1ce741,_0x2a9639))[_0xcbbb('0x45')](handleError(_0x1ce741,null));};exports[_0xcbbb('0x46')]=function(_0x50adf5,_0x224682){var _0x58d5cb={'raw':!![],'where':{'id':_0x50adf5[_0xcbbb('0x47')]['id']}},_0x520448={};_0x520448[_0xcbbb('0x32')]=_[_0xcbbb('0x35')](db[_0xcbbb('0x2e')][_0xcbbb('0x2f')]);_0x520448[_0xcbbb('0x34')]=_[_0xcbbb('0x35')](_0x50adf5[_0xcbbb('0x34')]);_0x520448[_0xcbbb('0x36')]=_[_0xcbbb('0x37')](_0x520448[_0xcbbb('0x32')],_0x520448[_0xcbbb('0x34')]);_0x58d5cb[_0xcbbb('0x38')]=_[_0xcbbb('0x37')](_0x520448['model'],qs[_0xcbbb('0x48')](_0x50adf5[_0xcbbb('0x34')][_0xcbbb('0x48')]));_0x58d5cb[_0xcbbb('0x38')]=_0x58d5cb['attributes']['length']?_0x58d5cb['attributes']:_0x520448[_0xcbbb('0x32')];if(_0x50adf5[_0xcbbb('0x34')][_0xcbbb('0x42')]){_0x58d5cb[_0xcbbb('0x49')]=[{'all':!![]}];}_0x58d5cb=_[_0xcbbb('0x40')]({},_0x58d5cb,_0x50adf5[_0xcbbb('0x4a')]);return db[_0xcbbb('0x2e')]['find'](_0x58d5cb)[_0xcbbb('0x25')](handleEntityNotFound(_0x224682,null))[_0xcbbb('0x25')](respondWithResult(_0x224682,null))[_0xcbbb('0x45')](handleError(_0x224682,null));};exports[_0xcbbb('0x4b')]=function(_0x478c22,_0x3378cd){return db[_0xcbbb('0x2e')][_0xcbbb('0x4b')](_0x478c22[_0xcbbb('0x4c')],{})['then'](function(_0x5e0366){var _0x3e1fdc=_0x478c22[_0xcbbb('0x4d')][_0xcbbb('0x27')]({'plain':!![]});if(!_0x3e1fdc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e1fdc['role']==='user'){var _0x189a40=_0x5e0366[_0xcbbb('0x27')]({'plain':!![]});var _0x4b866e=_0xcbbb('0x4e');return db[_0xcbbb('0x4f')][_0xcbbb('0x50')]({'where':{'name':_0x4b866e,'userProfileId':_0x3e1fdc[_0xcbbb('0x51')]},'raw':!![]})['then'](function(_0x33d21c){if(_0x33d21c&&_0x33d21c[_0xcbbb('0x52')]===0x0){return db[_0xcbbb('0x28')][_0xcbbb('0x4b')]({'name':_0x189a40[_0xcbbb('0x2b')],'resourceId':_0x189a40['id'],'type':_0x33d21c[_0xcbbb('0x2b')],'sectionId':_0x33d21c['id']},{})[_0xcbbb('0x25')](function(){return _0x5e0366;});}else{return _0x5e0366;}})[_0xcbbb('0x45')](function(_0x2d3990){logger[_0xcbbb('0x29')](_0xcbbb('0x53'),_0x2d3990);throw _0x2d3990;});}return _0x5e0366;})['then'](respondWithResult(_0x3378cd,0xc9))['catch'](handleError(_0x3378cd,null));};exports[_0xcbbb('0x24')]=function(_0x1eb822,_0x354efc){if(_0x1eb822['body']['id']){delete _0x1eb822[_0xcbbb('0x4c')]['id'];}return db['ContactItemType'][_0xcbbb('0x50')]({'where':{'id':_0x1eb822[_0xcbbb('0x47')]['id']}})[_0xcbbb('0x25')](handleEntityNotFound(_0x354efc,null))[_0xcbbb('0x25')](saveUpdates(_0x1eb822[_0xcbbb('0x4c')],null))[_0xcbbb('0x25')](respondWithResult(_0x354efc,null))['catch'](handleError(_0x354efc,null));};exports['destroy']=function(_0x4cc098,_0x370e6d){return db[_0xcbbb('0x2e')][_0xcbbb('0x50')]({'where':{'id':_0x4cc098[_0xcbbb('0x47')]['id']}})[_0xcbbb('0x25')](handleEntityNotFound(_0x370e6d,null))[_0xcbbb('0x25')](db[_0xcbbb('0x54')][_0xcbbb('0x24')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x4cc098[_0xcbbb('0x47')]['id']}}))[_0xcbbb('0x25')](removeEntity(_0x370e6d,null))[_0xcbbb('0x45')](handleError(_0x370e6d,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index e841ca7..b4719e7 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4849=['rimraf','../../config/environment','./contactItemType.attributes','exports','define','ContactItemType','tools_contact_item_types','lodash','util','moment','path'];(function(_0x2c0be1,_0x1e88f2){var _0x3d4bd2=function(_0x2b5497){while(--_0x2b5497){_0x2c0be1['push'](_0x2c0be1['shift']());}};_0x3d4bd2(++_0x1e88f2);}(_0x4849,0x1eb));var _0x9484=function(_0x57ef07,_0x190b9a){_0x57ef07=_0x57ef07-0x0;var _0x5d9478=_0x4849[_0x57ef07];return _0x5d9478;};'use strict';var _=require(_0x9484('0x0'));var util=require(_0x9484('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9484('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9484('0x3'));var rimraf=require(_0x9484('0x4'));var config=require(_0x9484('0x5'));var attributes=require(_0x9484('0x6'));module[_0x9484('0x7')]=function(_0x1e0e31,_0x45a6d6){return _0x1e0e31[_0x9484('0x8')](_0x9484('0x9'),attributes,{'tableName':_0x9484('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb32f=['rimraf','../../config/environment','./contactItemType.attributes','tools_contact_item_types','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0xf58288,_0x35333c){var _0x196e87=function(_0x2f8a09){while(--_0x2f8a09){_0xf58288['push'](_0xf58288['shift']());}};_0x196e87(++_0x35333c);}(_0xb32f,0x109));var _0xfb32=function(_0x5d9e2d,_0x3b3408){_0x5d9e2d=_0x5d9e2d-0x0;var _0x54b88f=_0xb32f[_0x5d9e2d];return _0x54b88f;};'use strict';var _=require(_0xfb32('0x0'));var util=require('util');var logger=require(_0xfb32('0x1'))(_0xfb32('0x2'));var moment=require('moment');var BPromise=require(_0xfb32('0x3'));var rp=require(_0xfb32('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb32('0x5'));var config=require(_0xfb32('0x6'));var attributes=require(_0xfb32('0x7'));module['exports']=function(_0x3598ac,_0x2d5244){return _0x3598ac['define']('ContactItemType',attributes,{'tableName':_0xfb32('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index 23c28bf..f710369 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8c5c=['ContactItemType,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x91ec40,_0xa1ec3b){var _0x428c7a=function(_0x196f25){while(--_0x196f25){_0x91ec40['push'](_0x91ec40['shift']());}};_0x428c7a(++_0xa1ec3b);}(_0x8c5c,0x7f));var _0xc8c5=function(_0x47e615,_0x571378){_0x47e615=_0x47e615-0x0;var _0x1ba6cd=_0x8c5c[_0x47e615];return _0x1ba6cd;};'use strict';var _=require('lodash');var util=require(_0xc8c5('0x0'));var moment=require('moment');var BPromise=require(_0xc8c5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc8c5('0x2'));var db=require(_0xc8c5('0x3'))['db'];var utils=require(_0xc8c5('0x4'));var logger=require('../../config/logger')(_0xc8c5('0x5'));var config=require(_0xc8c5('0x6'));var jayson=require(_0xc8c5('0x7'));var client=jayson[_0xc8c5('0x8')][_0xc8c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25daf8,_0x177997,_0x4bb69f){return new BPromise(function(_0x811e50,_0x202481){return client[_0xc8c5('0xa')](_0x25daf8,_0x4bb69f)[_0xc8c5('0xb')](function(_0x53e806){logger[_0xc8c5('0xc')](_0xc8c5('0xd'),_0x177997,_0xc8c5('0xe'));logger[_0xc8c5('0xf')]('ContactItemType,\x20%s,\x20%s,\x20%s',_0x177997,_0xc8c5('0xe'),JSON['stringify'](_0x53e806));if(_0x53e806[_0xc8c5('0x10')]){if(_0x53e806[_0xc8c5('0x10')][_0xc8c5('0x11')]===0x1f4){logger['error']('ContactItemType,\x20%s,\x20%s',_0x177997,_0x53e806[_0xc8c5('0x10')][_0xc8c5('0x12')]);return _0x202481(_0x53e806[_0xc8c5('0x10')][_0xc8c5('0x12')]);}logger[_0xc8c5('0x10')](_0xc8c5('0xd'),_0x177997,_0x53e806[_0xc8c5('0x10')][_0xc8c5('0x12')]);return _0x811e50(_0x53e806['error'][_0xc8c5('0x12')]);}else{logger['info'](_0xc8c5('0xd'),_0x177997,_0xc8c5('0xe'));_0x811e50(_0x53e806[_0xc8c5('0x13')][_0xc8c5('0x12')]);}})['catch'](function(_0x2aab9b){logger[_0xc8c5('0x10')](_0xc8c5('0xd'),_0x177997,_0x2aab9b);_0x202481(_0x2aab9b);});});} \ No newline at end of file +var _0x354b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','ContactItemType,\x20%s,\x20%s','request\x20sent','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x5a2c49,_0x5d0e95){var _0x2c625f=function(_0x1d5bc2){while(--_0x1d5bc2){_0x5a2c49['push'](_0x5a2c49['shift']());}};_0x2c625f(++_0x5d0e95);}(_0x354b,0x85));var _0xb354=function(_0x56241c,_0x47eba5){_0x56241c=_0x56241c-0x0;var _0x35a07b=_0x354b[_0x56241c];return _0x35a07b;};'use strict';var _=require(_0xb354('0x0'));var util=require(_0xb354('0x1'));var moment=require(_0xb354('0x2'));var BPromise=require(_0xb354('0x3'));var rs=require(_0xb354('0x4'));var fs=require('fs');var Redis=require(_0xb354('0x5'));var db=require(_0xb354('0x6'))['db'];var utils=require(_0xb354('0x7'));var logger=require(_0xb354('0x8'))(_0xb354('0x9'));var config=require('../../config/environment');var jayson=require(_0xb354('0xa'));var client=jayson['client'][_0xb354('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xaad045,_0x330e68,_0x5c4498){return new BPromise(function(_0x4cf3ac,_0x19f71b){return client['request'](_0xaad045,_0x5c4498)[_0xb354('0xc')](function(_0x5c273b){logger[_0xb354('0xd')](_0xb354('0xe'),_0x330e68,_0xb354('0xf'));logger[_0xb354('0x10')](_0xb354('0x11'),_0x330e68,_0xb354('0xf'),JSON[_0xb354('0x12')](_0x5c273b));if(_0x5c273b['error']){if(_0x5c273b['error']['code']===0x1f4){logger['error'](_0xb354('0xe'),_0x330e68,_0x5c273b[_0xb354('0x13')][_0xb354('0x14')]);return _0x19f71b(_0x5c273b[_0xb354('0x13')][_0xb354('0x14')]);}logger[_0xb354('0x13')](_0xb354('0xe'),_0x330e68,_0x5c273b[_0xb354('0x13')][_0xb354('0x14')]);return _0x4cf3ac(_0x5c273b[_0xb354('0x13')][_0xb354('0x14')]);}else{logger['info'](_0xb354('0xe'),_0x330e68,_0xb354('0xf'));_0x4cf3ac(_0x5c273b[_0xb354('0x15')][_0xb354('0x14')]);}})[_0xb354('0x16')](function(_0x38ec60){logger[_0xb354('0x13')](_0xb354('0xe'),_0x330e68,_0x38ec60);_0x19f71b(_0x38ec60);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index 7e819e0..e925653 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd3d=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x46800d,_0x588500){var _0x3824cd=function(_0x14b132){while(--_0x14b132){_0x46800d['push'](_0x46800d['shift']());}};_0x3824cd(++_0x588500);}(_0xfd3d,0x107));var _0xdfd3=function(_0x5dfbfd,_0x1acb7e){_0x5dfbfd=_0x5dfbfd-0x0;var _0x4e8712=_0xfd3d[_0x5dfbfd];return _0x4e8712;};'use strict';var multer=require(_0xdfd3('0x0'));var util=require(_0xdfd3('0x1'));var path=require(_0xdfd3('0x2'));var timeout=require(_0xdfd3('0x3'));var express=require(_0xdfd3('0x4'));var router=express[_0xdfd3('0x5')]();var fs_extra=require(_0xdfd3('0x6'));var auth=require(_0xdfd3('0x7'));var interaction=require(_0xdfd3('0x8'));var config=require(_0xdfd3('0x9'));var controller=require(_0xdfd3('0xa'));router[_0xdfd3('0xb')]('/',auth[_0xdfd3('0xc')](),controller['index']);router['get']('/:id',auth[_0xdfd3('0xc')](),controller[_0xdfd3('0xd')]);router[_0xdfd3('0xe')]('/',auth[_0xdfd3('0xc')](),controller[_0xdfd3('0xf')]);router[_0xdfd3('0x10')](_0xdfd3('0x11'),auth[_0xdfd3('0xc')](),controller[_0xdfd3('0x12')]);router[_0xdfd3('0x13')](_0xdfd3('0x11'),auth['isAuthenticated'](),controller[_0xdfd3('0x14')]);module[_0xdfd3('0x15')]=router; \ No newline at end of file +var _0x78a2=['../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x2f9650,_0x1b395f){var _0x5ed3d5=function(_0x4d6131){while(--_0x4d6131){_0x2f9650['push'](_0x2f9650['shift']());}};_0x5ed3d5(++_0x1b395f);}(_0x78a2,0xad));var _0x278a=function(_0x65eaa3,_0x9f32d6){_0x65eaa3=_0x65eaa3-0x0;var _0x22fd01=_0x78a2[_0x65eaa3];return _0x22fd01;};'use strict';var multer=require(_0x278a('0x0'));var util=require(_0x278a('0x1'));var path=require(_0x278a('0x2'));var timeout=require(_0x278a('0x3'));var express=require(_0x278a('0x4'));var router=express[_0x278a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x278a('0x6'));var config=require(_0x278a('0x7'));var controller=require('./contactItemType.controller');router[_0x278a('0x8')]('/',auth[_0x278a('0x9')](),controller[_0x278a('0xa')]);router['get']('/:id',auth[_0x278a('0x9')](),controller[_0x278a('0xb')]);router[_0x278a('0xc')]('/',auth[_0x278a('0x9')](),controller[_0x278a('0xd')]);router[_0x278a('0xe')](_0x278a('0xf'),auth[_0x278a('0x9')](),controller[_0x278a('0x10')]);router[_0x278a('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x278a('0x12')]);module[_0x278a('0x13')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 0990714..02bf37d 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['STRING','name'];(function(_0x520f3e,_0x20c207){var _0x121914=function(_0x190a90){while(--_0x190a90){_0x520f3e['push'](_0x520f3e['shift']());}};_0x121914(++_0x20c207);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0x2032=['name','exports','STRING'];(function(_0x5d816a,_0x48b3f7){var _0x445415=function(_0x394276){while(--_0x394276){_0x5d816a['push'](_0x5d816a['shift']());}};_0x445415(++_0x48b3f7);}(_0x2032,0xd9));var _0x2203=function(_0x427335,_0x9e9eb1){_0x427335=_0x427335-0x0;var _0x17bacf=_0x2032[_0x427335];return _0x17bacf;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 9338df8..eba0462 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 _0x3f83=['count','set','Content-Range','apply','reject','save','then','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Dashboard','includeAll','include','rows','catch','show','params','fields','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','user','CustomDashboards','iframe','attrUrl','attrs','value','https://','custom','attrPath','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','status','end','json','offset','undefined','limit'];(function(_0x2d8434,_0x43d781){var _0x26b9e4=function(_0x54f5b8){while(--_0x54f5b8){_0x2d8434['push'](_0x2d8434['shift']());}};_0x26b9e4(++_0x43d781);}(_0x3f83,0xde));var _0x33f8=function(_0x5b940a,_0x3ae98c){_0x5b940a=_0x5b940a-0x0;var _0x113c20=_0x3f83[_0x5b940a];return _0x113c20;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x33f8('0x0'));var jsonpatch=require(_0x33f8('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x33f8('0x2'));var Mustache=require(_0x33f8('0x3'));var util=require('util');var path=require(_0x33f8('0x4'));var sox=require(_0x33f8('0x5'));var csv=require(_0x33f8('0x6'));var ejs=require(_0x33f8('0x7'));var fs=require('fs');var fs_extra=require(_0x33f8('0x8'));var _=require(_0x33f8('0x9'));var squel=require(_0x33f8('0xa'));var crypto=require(_0x33f8('0xb'));var jsforce=require(_0x33f8('0xc'));var deskjs=require(_0x33f8('0xd'));var toCsv=require('to-csv');var querystring=require(_0x33f8('0xe'));var Papa=require('papaparse');var Redis=require(_0x33f8('0xf'));var authService=require(_0x33f8('0x10'));var qs=require(_0x33f8('0x11'));var as=require(_0x33f8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x33f8('0x13'))(_0x33f8('0x14'));var utils=require(_0x33f8('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x33f8('0x16'));var db=require(_0x33f8('0x17'))['db'];config[_0x33f8('0x18')]=_[_0x33f8('0x19')](config[_0x33f8('0x18')],{'host':_0x33f8('0x1a'),'port':0x18eb});var socket=require(_0x33f8('0x1b'))(new Redis(config['redis']));require(_0x33f8('0x1c'))[_0x33f8('0x1d')](socket);function respondWithStatusCode(_0x49e5ab,_0x12a583){_0x12a583=_0x12a583||0xcc;return function(_0x2a7ea5){if(_0x2a7ea5){return _0x49e5ab['sendStatus'](_0x12a583);}return _0x49e5ab[_0x33f8('0x1e')](_0x12a583)[_0x33f8('0x1f')]();};}function respondWithResult(_0x263c13,_0x104664){_0x104664=_0x104664||0xc8;return function(_0x15e5b2){if(_0x15e5b2){return _0x263c13[_0x33f8('0x1e')](_0x104664)[_0x33f8('0x20')](_0x15e5b2);}};}function respondWithFilteredResult(_0x185c27,_0x40beba){return function(_0x44ab7f){if(_0x44ab7f){var _0x34f689=typeof _0x40beba[_0x33f8('0x21')]===_0x33f8('0x22')&&typeof _0x40beba[_0x33f8('0x23')]===_0x33f8('0x22');var _0x52d866=_0x44ab7f['count'];var _0x23e551=_0x34f689?0x0:_0x40beba['offset'];var _0x176a0a=_0x34f689?_0x44ab7f[_0x33f8('0x24')]:_0x40beba[_0x33f8('0x21')]+_0x40beba[_0x33f8('0x23')];var _0x27cb8e;if(_0x176a0a>=_0x52d866){_0x176a0a=_0x52d866;_0x27cb8e=0xc8;}else{_0x27cb8e=0xce;}_0x185c27['status'](_0x27cb8e);return _0x185c27[_0x33f8('0x25')](_0x33f8('0x26'),_0x23e551+'-'+_0x176a0a+'/'+_0x52d866)[_0x33f8('0x20')](_0x44ab7f);}return null;};}function patchUpdates(_0x1ba33b){return function(_0x35eacb){try{jsonpatch[_0x33f8('0x27')](_0x35eacb,_0x1ba33b,!![]);}catch(_0x5b2d70){return BPromise[_0x33f8('0x28')](_0x5b2d70);}return _0x35eacb[_0x33f8('0x29')]();};}function saveUpdates(_0x228389,_0x471a5f){return function(_0x202b8a){if(_0x202b8a){return _0x202b8a['update'](_0x228389)[_0x33f8('0x2a')](function(_0x1c9438){return _0x1c9438;});}return null;};}function removeEntity(_0x271f28,_0x5084e4){return function(_0x247db8){if(_0x247db8){return _0x247db8['destroy']()['then'](function(){var _0x4454f0=_0x247db8['get']({'plain':!![]});var _0x1b13c4='CustomDashboards';return db[_0x33f8('0x2b')][_0x33f8('0x2c')]({'where':{'type':_0x1b13c4,'resourceId':_0x4454f0['id']}})[_0x33f8('0x2a')](function(){return _0x247db8;});})[_0x33f8('0x2a')](function(){_0x271f28['status'](0xcc)[_0x33f8('0x1f')]();});}};}function handleEntityNotFound(_0x1eaa53,_0x51cd10){return function(_0x18ba6e){if(!_0x18ba6e){_0x1eaa53['sendStatus'](0x194);}return _0x18ba6e;};}function handleError(_0x38a1ea,_0x36b1c7){_0x36b1c7=_0x36b1c7||0x1f4;return function(_0x27ce4e){logger[_0x33f8('0x2d')](_0x27ce4e[_0x33f8('0x2e')]);if(_0x27ce4e[_0x33f8('0x2f')]){delete _0x27ce4e[_0x33f8('0x2f')];}_0x38a1ea[_0x33f8('0x1e')](_0x36b1c7)[_0x33f8('0x30')](_0x27ce4e);};}exports[_0x33f8('0x31')]=function(_0x4bf70b,_0x5013cc){var _0x19e323={},_0x1d9fca={},_0x9b6b3b={'count':0x0,'rows':[]};var _0x2e3601=_[_0x33f8('0x32')](db['Dashboard'][_0x33f8('0x33')],function(_0x21bb26){return{'name':_0x21bb26['fieldName'],'type':_0x21bb26[_0x33f8('0x34')][_0x33f8('0x35')]};});_0x1d9fca[_0x33f8('0x36')]=_[_0x33f8('0x32')](_0x2e3601,_0x33f8('0x2f'));_0x1d9fca[_0x33f8('0x37')]=_[_0x33f8('0x38')](_0x4bf70b[_0x33f8('0x37')]);_0x1d9fca['filters']=_[_0x33f8('0x39')](_0x1d9fca[_0x33f8('0x36')],_0x1d9fca[_0x33f8('0x37')]);_0x19e323[_0x33f8('0x3a')]=_['intersection'](_0x1d9fca[_0x33f8('0x36')],qs['fields'](_0x4bf70b[_0x33f8('0x37')]['fields']));_0x19e323[_0x33f8('0x3a')]=_0x19e323[_0x33f8('0x3a')][_0x33f8('0x3b')]?_0x19e323[_0x33f8('0x3a')]:_0x1d9fca[_0x33f8('0x36')];if(!_0x4bf70b[_0x33f8('0x37')]['hasOwnProperty'](_0x33f8('0x3c'))){_0x19e323['limit']=qs[_0x33f8('0x23')](_0x4bf70b[_0x33f8('0x37')][_0x33f8('0x23')]);_0x19e323['offset']=qs[_0x33f8('0x21')](_0x4bf70b[_0x33f8('0x37')][_0x33f8('0x21')]);}_0x19e323[_0x33f8('0x3d')]=qs[_0x33f8('0x3e')](_0x4bf70b[_0x33f8('0x37')][_0x33f8('0x3e')]);_0x19e323[_0x33f8('0x3f')]=qs[_0x33f8('0x40')](_[_0x33f8('0x41')](_0x4bf70b[_0x33f8('0x37')],_0x1d9fca[_0x33f8('0x40')]),_0x2e3601);if(_0x4bf70b[_0x33f8('0x37')][_0x33f8('0x42')]){_0x19e323[_0x33f8('0x3f')]=_[_0x33f8('0x43')](_0x19e323[_0x33f8('0x3f')],{'$or':_['map'](_0x2e3601,function(_0xdba9f9){if(_0xdba9f9[_0x33f8('0x34')]!==_0x33f8('0x44')){var _0x36f856={};_0x36f856[_0xdba9f9[_0x33f8('0x2f')]]={'$like':'%'+_0x4bf70b['query'][_0x33f8('0x42')]+'%'};return _0x36f856;}})});}_0x19e323=_[_0x33f8('0x43')]({},_0x19e323,_0x4bf70b[_0x33f8('0x45')]);var _0x491fc0={'where':_0x19e323[_0x33f8('0x3f')]};return db[_0x33f8('0x46')][_0x33f8('0x24')](_0x491fc0)[_0x33f8('0x2a')](function(_0x325332){_0x9b6b3b[_0x33f8('0x24')]=_0x325332;if(_0x4bf70b['query'][_0x33f8('0x47')]){_0x19e323[_0x33f8('0x48')]=[{'all':!![]}];}return db['Dashboard']['findAll'](_0x19e323);})['then'](function(_0x3d3dde){_0x9b6b3b[_0x33f8('0x49')]=_0x3d3dde;return _0x9b6b3b;})['then'](respondWithFilteredResult(_0x5013cc,_0x19e323))[_0x33f8('0x4a')](handleError(_0x5013cc,null));};exports[_0x33f8('0x4b')]=function(_0x216db1,_0x467e6d){var _0x36cfa4={'raw':![],'where':{'id':_0x216db1[_0x33f8('0x4c')]['id']}},_0x31961c={};_0x31961c[_0x33f8('0x36')]=_[_0x33f8('0x38')](db[_0x33f8('0x46')][_0x33f8('0x33')]);_0x31961c[_0x33f8('0x37')]=_[_0x33f8('0x38')](_0x216db1[_0x33f8('0x37')]);_0x31961c[_0x33f8('0x40')]=_[_0x33f8('0x39')](_0x31961c[_0x33f8('0x36')],_0x31961c[_0x33f8('0x37')]);_0x36cfa4[_0x33f8('0x3a')]=_[_0x33f8('0x39')](_0x31961c[_0x33f8('0x36')],qs[_0x33f8('0x4d')](_0x216db1[_0x33f8('0x37')][_0x33f8('0x4d')]));_0x36cfa4['attributes']=_0x36cfa4['attributes'][_0x33f8('0x3b')]?_0x36cfa4[_0x33f8('0x3a')]:_0x31961c[_0x33f8('0x36')];if(_0x216db1['query'][_0x33f8('0x47')]){_0x36cfa4[_0x33f8('0x48')]=[{'all':!![]}];}_0x36cfa4=_['merge']({},_0x36cfa4,_0x216db1[_0x33f8('0x45')]);return db[_0x33f8('0x46')][_0x33f8('0x4e')](_0x36cfa4)[_0x33f8('0x2a')](handleEntityNotFound(_0x467e6d,null))[_0x33f8('0x2a')](respondWithResult(_0x467e6d,null))[_0x33f8('0x4a')](handleError(_0x467e6d,null));};exports[_0x33f8('0x4f')]=function(_0x13d374,_0x1d357e){return db[_0x33f8('0x46')][_0x33f8('0x4f')](_0x13d374[_0x33f8('0x50')],{})['then'](function(_0x5934cf){var _0x456774=_0x13d374['user'][_0x33f8('0x51')]({'plain':!![]});if(!_0x456774)throw new Error(_0x33f8('0x52'));if(_0x456774[_0x33f8('0x53')]==='user'){var _0xe38911=_0x5934cf[_0x33f8('0x51')]({'plain':!![]});var _0x19d589='CustomDashboards';return db[_0x33f8('0x54')][_0x33f8('0x4e')]({'where':{'name':_0x19d589,'userProfileId':_0x456774[_0x33f8('0x55')]},'raw':!![]})[_0x33f8('0x2a')](function(_0x19790f){if(_0x19790f&&_0x19790f[_0x33f8('0x56')]===0x0){return db[_0x33f8('0x2b')][_0x33f8('0x4f')]({'name':_0xe38911[_0x33f8('0x2f')],'resourceId':_0xe38911['id'],'type':_0x19790f['name'],'sectionId':_0x19790f['id']},{})[_0x33f8('0x2a')](function(){return _0x5934cf;});}else{return _0x5934cf;}})[_0x33f8('0x4a')](function(_0x3e8cbf){logger[_0x33f8('0x2d')](_0x33f8('0x57'),_0x3e8cbf);throw _0x3e8cbf;});}return _0x5934cf;})['then'](respondWithResult(_0x1d357e,0xc9))['catch'](handleError(_0x1d357e,null));};exports[_0x33f8('0x58')]=function(_0x596027,_0x401ac7){var _0x599eb1={'where':{'id':_0x596027[_0x33f8('0x4c')]['id']}},_0x59db70={};_0x59db70[_0x33f8('0x36')]=_[_0x33f8('0x38')](db['Dashboard'][_0x33f8('0x33')]);_0x599eb1[_0x33f8('0x3a')]=_[_0x33f8('0x39')](_0x59db70[_0x33f8('0x36')],qs['fields'](_0x596027[_0x33f8('0x37')]['fields']));_0x599eb1[_0x33f8('0x3a')]=_0x599eb1[_0x33f8('0x3a')][_0x33f8('0x3b')]?_0x599eb1[_0x33f8('0x3a')]:_0x59db70['model'];if(_0x596027[_0x33f8('0x37')][_0x33f8('0x47')]){_0x599eb1[_0x33f8('0x48')]=[{'all':!![]}];}_0x599eb1=_[_0x33f8('0x43')]({},_0x599eb1,_0x596027[_0x33f8('0x45')]);return db[_0x33f8('0x46')][_0x33f8('0x4e')](_0x599eb1)[_0x33f8('0x2a')](handleEntityNotFound(_0x401ac7,null))[_0x33f8('0x2a')](function(_0x3d464d){if(_0x3d464d){var _0x15d971=_0x3d464d['get']({'plain':!![]});_0x15d971=qs[_0x33f8('0x59')](_0x15d971,['id',_0x33f8('0x5a'),'updatedAt']);_0x596027['body']=_[_0x33f8('0x59')](_0x596027[_0x33f8('0x50')],['id',_0x33f8('0x5a'),_0x33f8('0x5b')]);return db['Dashboard']['create'](_[_0x33f8('0x43')](_0x15d971,_0x596027['body']),{'include':_0x596027['query']['includeAll']?[{'all':!![]}]:undefined})[_0x33f8('0x2a')](function(_0x2eeb39){var _0x3938db=_0x596027[_0x33f8('0x5c')][_0x33f8('0x51')]({'plain':!![]});if(!_0x3938db)throw new Error(_0x33f8('0x52'));if(_0x3938db[_0x33f8('0x53')]===_0x33f8('0x5c')){var _0x23e568=_0x2eeb39[_0x33f8('0x51')]({'plain':!![]});var _0x356fd9=_0x33f8('0x5d');return db[_0x33f8('0x54')][_0x33f8('0x4e')]({'where':{'name':_0x356fd9,'userProfileId':_0x3938db['userProfileId']},'raw':!![]})[_0x33f8('0x2a')](function(_0x11b2ae){if(_0x11b2ae&&_0x11b2ae[_0x33f8('0x56')]===0x0){return db[_0x33f8('0x2b')]['create']({'name':_0x23e568[_0x33f8('0x2f')],'resourceId':_0x23e568['id'],'type':_0x11b2ae[_0x33f8('0x2f')],'sectionId':_0x11b2ae['id']},{})[_0x33f8('0x2a')](function(){return _0x2eeb39;});}else{return _0x2eeb39;}})['catch'](function(_0x5a44e7){logger[_0x33f8('0x2d')](_0x33f8('0x57'),_0x5a44e7);throw _0x5a44e7;});}return _0x2eeb39;});}})[_0x33f8('0x2a')](respondWithResult(_0x401ac7,0xc9))[_0x33f8('0x4a')](handleError(_0x401ac7,null));};exports['update']=function(_0x77bbc0,_0x3ab1cf){if(_0x77bbc0['body']['id']){delete _0x77bbc0['body']['id'];}return db['Dashboard'][_0x33f8('0x4e')]({'where':{'id':_0x77bbc0[_0x33f8('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3ab1cf,null))[_0x33f8('0x2a')](saveUpdates(_0x77bbc0['body'],null))[_0x33f8('0x2a')](respondWithResult(_0x3ab1cf,null))['catch'](handleError(_0x3ab1cf,null));};exports[_0x33f8('0x2c')]=function(_0x10eb31,_0x1c661e){return db['Dashboard'][_0x33f8('0x4e')]({'where':{'id':_0x10eb31['params']['id']}})[_0x33f8('0x2a')](handleEntityNotFound(_0x1c661e,null))['then'](removeEntity(_0x1c661e,null))['catch'](handleError(_0x1c661e,null));};function widgetAttributes(_0x3e0eb2){try{switch(_0x3e0eb2[_0x33f8('0x34')]){case _0x33f8('0x5e'):return[{'name':_0x33f8('0x5f'),'value':_0x3e0eb2[_0x33f8('0x5f')]||(_0x3e0eb2[_0x33f8('0x60')]&&_0x3e0eb2[_0x33f8('0x60')][0x0]?_0x3e0eb2[_0x33f8('0x60')][0x0][_0x33f8('0x61')]:undefined)||_0x33f8('0x62')}];case _0x33f8('0x63'):return[{'name':_0x33f8('0x64'),'value':_0x3e0eb2['attrPath']||(_0x3e0eb2['attrs']&&_0x3e0eb2['attrs'][0x0]?_0x3e0eb2[_0x33f8('0x60')][0x0][_0x33f8('0x61')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x3e0eb2['attrHourFormat']||(_0x3e0eb2[_0x33f8('0x60')]&&_0x3e0eb2[_0x33f8('0x60')][0x0]?_0x3e0eb2[_0x33f8('0x60')][0x0][_0x33f8('0x61')]:undefined)||_0x33f8('0x65')},{'name':_0x33f8('0x66'),'value':_0x3e0eb2[_0x33f8('0x66')]||(_0x3e0eb2[_0x33f8('0x60')]&&_0x3e0eb2['attrs'][0x1]?_0x3e0eb2[_0x33f8('0x60')][0x1][_0x33f8('0x61')]:undefined)||'0.00'},{'name':_0x33f8('0x67'),'value':_0x3e0eb2['attrFontSize']||(_0x3e0eb2[_0x33f8('0x60')]&&_0x3e0eb2[_0x33f8('0x60')][0x2]?_0x3e0eb2[_0x33f8('0x60')][0x2]['value']:undefined)||0xc}];case _0x33f8('0x68'):return[{'name':'attrMetric','value':_0x3e0eb2[_0x33f8('0x69')]||(_0x3e0eb2['attrs']&&_0x3e0eb2['attrs'][0x0]?_0x3e0eb2[_0x33f8('0x60')][0x0]['value']:undefined)||_0x33f8('0x6a')},{'name':_0x33f8('0x6b'),'value':_0x3e0eb2[_0x33f8('0x6b')]||(_0x3e0eb2[_0x33f8('0x60')]&&_0x3e0eb2[_0x33f8('0x60')][0x1]?_0x3e0eb2['attrs'][0x1][_0x33f8('0x61')]:undefined)||[]},{'name':'attrFontSize','value':_0x3e0eb2[_0x33f8('0x67')]||(_0x3e0eb2[_0x33f8('0x60')]&&_0x3e0eb2[_0x33f8('0x60')][0x2]?_0x3e0eb2[_0x33f8('0x60')][0x2][_0x33f8('0x61')]:undefined)||0x14},{'name':_0x33f8('0x6c'),'value':_0x3e0eb2['attrChannel']||(_0x3e0eb2[_0x33f8('0x60')]&&_0x3e0eb2[_0x33f8('0x60')][0x3]?_0x3e0eb2[_0x33f8('0x60')][0x3][_0x33f8('0x61')]:undefined)||_0x33f8('0x6d')},{'name':_0x33f8('0x6e'),'value':_0x3e0eb2[_0x33f8('0x6e')]||(_0x3e0eb2[_0x33f8('0x60')]&&_0x3e0eb2['attrs'][0x4]?_0x3e0eb2[_0x33f8('0x60')][0x4][_0x33f8('0x61')]:undefined)||''},{'name':_0x33f8('0x6f'),'value':_0x3e0eb2[_0x33f8('0x6f')]||(_0x3e0eb2['attrs']&&_0x3e0eb2[_0x33f8('0x60')][0x5]?_0x3e0eb2[_0x33f8('0x60')][0x5]['value']:undefined)||''},{'name':_0x33f8('0x70'),'value':_0x3e0eb2[_0x33f8('0x70')]||(_0x3e0eb2[_0x33f8('0x60')]&&_0x3e0eb2[_0x33f8('0x60')][0x6]?_0x3e0eb2[_0x33f8('0x60')][0x6]['value']:undefined)||''},{'name':_0x33f8('0x71'),'value':_0x3e0eb2[_0x33f8('0x71')]||(_0x3e0eb2[_0x33f8('0x60')]&&_0x3e0eb2[_0x33f8('0x60')][0x7]?_0x3e0eb2[_0x33f8('0x60')][0x7][_0x33f8('0x61')]:undefined)||''},{'name':_0x33f8('0x72'),'value':_0x3e0eb2['attrWhatsappAccounts']||(_0x3e0eb2[_0x33f8('0x60')]&&_0x3e0eb2[_0x33f8('0x60')][0x8]?_0x3e0eb2[_0x33f8('0x60')][0x8][_0x33f8('0x61')]:undefined)||''},{'name':_0x33f8('0x73'),'value':_0x3e0eb2[_0x33f8('0x73')]||(_0x3e0eb2[_0x33f8('0x60')]&&_0x3e0eb2[_0x33f8('0x60')][0x9]?_0x3e0eb2[_0x33f8('0x60')][0x9][_0x33f8('0x61')]:undefined)||''}];case _0x33f8('0x74'):case'pie-chart':return[{'name':_0x33f8('0x75'),'value':_0x3e0eb2[_0x33f8('0x75')]||(_0x3e0eb2[_0x33f8('0x60')]&&_0x3e0eb2['attrs'][0x0]?_0x3e0eb2[_0x33f8('0x60')][0x0][_0x33f8('0x61')]:undefined)||_0x33f8('0x6a')},{'name':_0x33f8('0x76'),'value':_0x3e0eb2[_0x33f8('0x76')]||(_0x3e0eb2['attrs']&&_0x3e0eb2['attrs'][0x1]?_0x3e0eb2[_0x33f8('0x60')][0x1][_0x33f8('0x61')]:undefined)||null},{'name':_0x33f8('0x77'),'value':_0x3e0eb2[_0x33f8('0x77')]||(_0x3e0eb2[_0x33f8('0x60')]&&_0x3e0eb2[_0x33f8('0x60')][0x2]?_0x3e0eb2[_0x33f8('0x60')][0x2][_0x33f8('0x61')]:undefined)||null},{'name':_0x33f8('0x6b'),'value':_0x3e0eb2[_0x33f8('0x6b')]||(_0x3e0eb2[_0x33f8('0x60')]&&_0x3e0eb2[_0x33f8('0x60')][0x3]?_0x3e0eb2['attrs'][0x3]['value']:undefined)||[]},{'name':_0x33f8('0x6c'),'value':_0x3e0eb2[_0x33f8('0x6c')]||(_0x3e0eb2[_0x33f8('0x60')]&&_0x3e0eb2[_0x33f8('0x60')][0x4]?_0x3e0eb2['attrs'][0x4][_0x33f8('0x61')]:undefined)||'voice'},{'name':_0x33f8('0x6e'),'value':_0x3e0eb2[_0x33f8('0x6e')]||(_0x3e0eb2['attrs']&&_0x3e0eb2[_0x33f8('0x60')][0x5]?_0x3e0eb2[_0x33f8('0x60')][0x5][_0x33f8('0x61')]:undefined)||''},{'name':_0x33f8('0x6f'),'value':_0x3e0eb2[_0x33f8('0x6f')]||(_0x3e0eb2[_0x33f8('0x60')]&&_0x3e0eb2['attrs'][0x6]?_0x3e0eb2[_0x33f8('0x60')][0x6][_0x33f8('0x61')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x3e0eb2[_0x33f8('0x70')]||(_0x3e0eb2[_0x33f8('0x60')]&&_0x3e0eb2[_0x33f8('0x60')][0x7]?_0x3e0eb2[_0x33f8('0x60')][0x7][_0x33f8('0x61')]:undefined)||''},{'name':_0x33f8('0x71'),'value':_0x3e0eb2[_0x33f8('0x71')]||(_0x3e0eb2[_0x33f8('0x60')]&&_0x3e0eb2[_0x33f8('0x60')][0x8]?_0x3e0eb2[_0x33f8('0x60')][0x8][_0x33f8('0x61')]:undefined)||''},{'name':_0x33f8('0x72'),'value':_0x3e0eb2['attrWhatsappAccounts']||(_0x3e0eb2['attrs']&&_0x3e0eb2[_0x33f8('0x60')][0x9]?_0x3e0eb2[_0x33f8('0x60')][0x9]['value']:undefined)||''},{'name':_0x33f8('0x73'),'value':_0x3e0eb2['attrChatWebsites']||(_0x3e0eb2[_0x33f8('0x60')]&&_0x3e0eb2[_0x33f8('0x60')][0xa]?_0x3e0eb2[_0x33f8('0x60')][0xa][_0x33f8('0x61')]:undefined)||''}];case _0x33f8('0x78'):return[{'name':_0x33f8('0x79'),'type':_0x3e0eb2['reportType']||(_0x3e0eb2[_0x33f8('0x60')]&&_0x3e0eb2['attrs'][0x0]?_0x3e0eb2['attrs'][0x0][_0x33f8('0x34')]:undefined)||null,'value':_0x3e0eb2[_0x33f8('0x79')]||(_0x3e0eb2[_0x33f8('0x60')]&&_0x3e0eb2['attrs'][0x0]?_0x3e0eb2[_0x33f8('0x60')][0x0]['value']:undefined)||null},{'name':_0x33f8('0x7a'),'value':_0x3e0eb2[_0x33f8('0x7a')]||(_0x3e0eb2[_0x33f8('0x60')]&&_0x3e0eb2['attrs'][0x1]?_0x3e0eb2[_0x33f8('0x60')][0x1][_0x33f8('0x61')]:undefined)||0x0}];default:return[];}}catch(_0x34e78c){logger[_0x33f8('0x2d')](_0x33f8('0x7b'),JSON[_0x33f8('0x7c')](_0x34e78c));return[];}}exports[_0x33f8('0x7d')]=function(_0x31643b,_0xbd7e9f,_0x4cc09f){if(_0x31643b['body']['id']){delete _0x31643b['body']['id'];}return db[_0x33f8('0x46')][_0x33f8('0x4e')]({'where':{'id':_0x31643b[_0x33f8('0x4c')]['id']}})[_0x33f8('0x2a')](handleEntityNotFound(_0xbd7e9f,null))[_0x33f8('0x2a')](function(_0x1106ea){if(_0x1106ea){_0x31643b[_0x33f8('0x50')][_0x33f8('0x7e')]=_0x1106ea['id'];_0x31643b[_0x33f8('0x50')][_0x33f8('0x60')]=widgetAttributes(_0x31643b[_0x33f8('0x50')]);return db[_0x33f8('0x7f')][_0x33f8('0x4f')](_0x31643b[_0x33f8('0x50')]);}})[_0x33f8('0x2a')](respondWithResult(_0xbd7e9f,null))['catch'](handleError(_0xbd7e9f,null));};exports['getItems']=function(_0x2a449f,_0x290ab8,_0x220331){var _0x2f7d4f={};var _0x51847a={};var _0x239f26;var _0x57c53b;return db[_0x33f8('0x46')]['findOne']({'where':{'id':_0x2a449f[_0x33f8('0x4c')]['id']}})[_0x33f8('0x2a')](handleEntityNotFound(_0x290ab8,null))['then'](function(_0x43d4ba){if(_0x43d4ba){_0x239f26=_0x43d4ba;_0x51847a[_0x33f8('0x36')]=_['keys'](db[_0x33f8('0x7f')][_0x33f8('0x33')]);_0x51847a['query']=_['keys'](_0x2a449f[_0x33f8('0x37')]);_0x51847a[_0x33f8('0x40')]=_[_0x33f8('0x39')](_0x51847a['model'],_0x51847a[_0x33f8('0x37')]);_0x2f7d4f[_0x33f8('0x3a')]=_['intersection'](_0x51847a[_0x33f8('0x36')],qs[_0x33f8('0x4d')](_0x2a449f['query'][_0x33f8('0x4d')]));_0x2f7d4f['attributes']=_0x2f7d4f[_0x33f8('0x3a')][_0x33f8('0x3b')]?_0x2f7d4f[_0x33f8('0x3a')]:_0x51847a[_0x33f8('0x36')];_0x2f7d4f[_0x33f8('0x3d')]=qs['sort'](_0x2a449f[_0x33f8('0x37')]['sort']);_0x2f7d4f['where']=qs[_0x33f8('0x40')](_[_0x33f8('0x41')](_0x2a449f[_0x33f8('0x37')],_0x51847a[_0x33f8('0x40')]));if(_0x2a449f[_0x33f8('0x37')]['filter']){_0x2f7d4f['where']=_[_0x33f8('0x43')](_0x2f7d4f[_0x33f8('0x3f')],{'$or':_[_0x33f8('0x32')](_0x2f7d4f[_0x33f8('0x3a')],function(_0x195bde){var _0x20b8de={};_0x20b8de[_0x195bde]={'$like':'%'+_0x2a449f[_0x33f8('0x37')][_0x33f8('0x42')]+'%'};return _0x20b8de;})});}_0x2f7d4f=_[_0x33f8('0x43')]({},_0x2f7d4f,_0x2a449f[_0x33f8('0x45')]);return _0x239f26[_0x33f8('0x80')](_0x2f7d4f);}})[_0x33f8('0x2a')](function(_0x20449c){if(_0x20449c){_0x57c53b=_0x20449c[_0x33f8('0x3b')];if(!_0x2a449f['query']['hasOwnProperty'](_0x33f8('0x3c'))){_0x2f7d4f[_0x33f8('0x23')]=qs[_0x33f8('0x23')](_0x2a449f['query'][_0x33f8('0x23')]);_0x2f7d4f[_0x33f8('0x21')]=qs[_0x33f8('0x21')](_0x2a449f['query'][_0x33f8('0x21')]);}return _0x239f26[_0x33f8('0x80')](_0x2f7d4f);}})['then'](function(_0x5c79ae){if(_0x5c79ae){return _0x5c79ae?{'count':_0x57c53b,'rows':_0x5c79ae}:null;}})[_0x33f8('0x2a')](respondWithResult(_0x290ab8,null))['catch'](handleError(_0x290ab8,null));}; \ No newline at end of file +var _0x3cd0=['web-report','attrReport','reportType','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','length','order','getItems','zip-dir','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','save','update','get','CustomDashboards','UserProfileResource','destroy','then','error','stack','name','send','index','map','Dashboard','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','iframe','attrUrl','attrs','custom','attrPath','clock','attrHourFormat','value','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrSmsAccounts','attrOpenchannelAccounts'];(function(_0x4b36b0,_0x13fdc6){var _0x39eeda=function(_0x4acc32){while(--_0x4acc32){_0x4b36b0['push'](_0x4b36b0['shift']());}};_0x39eeda(++_0x13fdc6);}(_0x3cd0,0x113));var _0x03cd=function(_0x3b2be5,_0x9c01ae){_0x3b2be5=_0x3b2be5-0x0;var _0x14cd8=_0x3cd0[_0x3b2be5];return _0x14cd8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x03cd('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x03cd('0x1'));var Mustache=require(_0x03cd('0x2'));var util=require(_0x03cd('0x3'));var path=require('path');var sox=require(_0x03cd('0x4'));var csv=require(_0x03cd('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x03cd('0x6'));var _=require(_0x03cd('0x7'));var squel=require(_0x03cd('0x8'));var crypto=require(_0x03cd('0x9'));var jsforce=require(_0x03cd('0xa'));var deskjs=require(_0x03cd('0xb'));var toCsv=require('to-csv');var querystring=require(_0x03cd('0xc'));var Papa=require(_0x03cd('0xd'));var Redis=require(_0x03cd('0xe'));var authService=require(_0x03cd('0xf'));var qs=require(_0x03cd('0x10'));var as=require(_0x03cd('0x11'));var hardwareService=require(_0x03cd('0x12'));var logger=require(_0x03cd('0x13'))(_0x03cd('0x14'));var utils=require(_0x03cd('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x03cd('0x16'));var db=require(_0x03cd('0x17'))['db'];config[_0x03cd('0x18')]=_[_0x03cd('0x19')](config[_0x03cd('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x03cd('0x1a'))(new Redis(config[_0x03cd('0x18')]));require('./dashboard.socket')[_0x03cd('0x1b')](socket);function respondWithStatusCode(_0x16d7e6,_0x584cb0){_0x584cb0=_0x584cb0||0xcc;return function(_0x16432f){if(_0x16432f){return _0x16d7e6[_0x03cd('0x1c')](_0x584cb0);}return _0x16d7e6['status'](_0x584cb0)[_0x03cd('0x1d')]();};}function respondWithResult(_0x1d1509,_0x413b04){_0x413b04=_0x413b04||0xc8;return function(_0x3862e6){if(_0x3862e6){return _0x1d1509['status'](_0x413b04)['json'](_0x3862e6);}};}function respondWithFilteredResult(_0xf38df4,_0x1d6abd){return function(_0xe24fbe){if(_0xe24fbe){var _0x143330=typeof _0x1d6abd[_0x03cd('0x1e')]===_0x03cd('0x1f')&&typeof _0x1d6abd[_0x03cd('0x20')]===_0x03cd('0x1f');var _0x5150d9=_0xe24fbe[_0x03cd('0x21')];var _0x2c1e34=_0x143330?0x0:_0x1d6abd['offset'];var _0x25ec3f=_0x143330?_0xe24fbe[_0x03cd('0x21')]:_0x1d6abd['offset']+_0x1d6abd[_0x03cd('0x20')];var _0x4fb153;if(_0x25ec3f>=_0x5150d9){_0x25ec3f=_0x5150d9;_0x4fb153=0xc8;}else{_0x4fb153=0xce;}_0xf38df4[_0x03cd('0x22')](_0x4fb153);return _0xf38df4[_0x03cd('0x23')](_0x03cd('0x24'),_0x2c1e34+'-'+_0x25ec3f+'/'+_0x5150d9)[_0x03cd('0x25')](_0xe24fbe);}return null;};}function patchUpdates(_0xaabda8){return function(_0x4633d7){try{jsonpatch[_0x03cd('0x26')](_0x4633d7,_0xaabda8,!![]);}catch(_0xad7201){return BPromise['reject'](_0xad7201);}return _0x4633d7[_0x03cd('0x27')]();};}function saveUpdates(_0x2051bb,_0x1be77d){return function(_0x2f703f){if(_0x2f703f){return _0x2f703f[_0x03cd('0x28')](_0x2051bb)['then'](function(_0x1ddfdf){return _0x1ddfdf;});}return null;};}function removeEntity(_0x2434e7,_0x564b3b){return function(_0x2fafc0){if(_0x2fafc0){return _0x2fafc0['destroy']()['then'](function(){var _0x265086=_0x2fafc0[_0x03cd('0x29')]({'plain':!![]});var _0x5ef7fa=_0x03cd('0x2a');return db[_0x03cd('0x2b')][_0x03cd('0x2c')]({'where':{'type':_0x5ef7fa,'resourceId':_0x265086['id']}})['then'](function(){return _0x2fafc0;});})[_0x03cd('0x2d')](function(){_0x2434e7[_0x03cd('0x22')](0xcc)[_0x03cd('0x1d')]();});}};}function handleEntityNotFound(_0x534810,_0x406492){return function(_0x2e001f){if(!_0x2e001f){_0x534810[_0x03cd('0x1c')](0x194);}return _0x2e001f;};}function handleError(_0x4fcabd,_0xab5ae9){_0xab5ae9=_0xab5ae9||0x1f4;return function(_0xa784b7){logger[_0x03cd('0x2e')](_0xa784b7[_0x03cd('0x2f')]);if(_0xa784b7[_0x03cd('0x30')]){delete _0xa784b7['name'];}_0x4fcabd['status'](_0xab5ae9)[_0x03cd('0x31')](_0xa784b7);};}exports[_0x03cd('0x32')]=function(_0x399cba,_0x2a8205){var _0x439e8e={},_0x3dd2e6={},_0x18a3fa={'count':0x0,'rows':[]};var _0x1ef62b=_[_0x03cd('0x33')](db[_0x03cd('0x34')]['rawAttributes'],function(_0x57e337){return{'name':_0x57e337['fieldName'],'type':_0x57e337['type'][_0x03cd('0x35')]};});_0x3dd2e6['model']=_[_0x03cd('0x33')](_0x1ef62b,_0x03cd('0x30'));_0x3dd2e6[_0x03cd('0x36')]=_[_0x03cd('0x37')](_0x399cba[_0x03cd('0x36')]);_0x3dd2e6[_0x03cd('0x38')]=_[_0x03cd('0x39')](_0x3dd2e6[_0x03cd('0x3a')],_0x3dd2e6[_0x03cd('0x36')]);_0x439e8e[_0x03cd('0x3b')]=_[_0x03cd('0x39')](_0x3dd2e6['model'],qs[_0x03cd('0x3c')](_0x399cba['query'][_0x03cd('0x3c')]));_0x439e8e[_0x03cd('0x3b')]=_0x439e8e[_0x03cd('0x3b')]['length']?_0x439e8e['attributes']:_0x3dd2e6[_0x03cd('0x3a')];if(!_0x399cba[_0x03cd('0x36')][_0x03cd('0x3d')](_0x03cd('0x3e'))){_0x439e8e[_0x03cd('0x20')]=qs['limit'](_0x399cba[_0x03cd('0x36')][_0x03cd('0x20')]);_0x439e8e[_0x03cd('0x1e')]=qs[_0x03cd('0x1e')](_0x399cba[_0x03cd('0x36')][_0x03cd('0x1e')]);}_0x439e8e['order']=qs[_0x03cd('0x3f')](_0x399cba[_0x03cd('0x36')][_0x03cd('0x3f')]);_0x439e8e[_0x03cd('0x40')]=qs['filters'](_[_0x03cd('0x41')](_0x399cba[_0x03cd('0x36')],_0x3dd2e6[_0x03cd('0x38')]),_0x1ef62b);if(_0x399cba[_0x03cd('0x36')][_0x03cd('0x42')]){_0x439e8e[_0x03cd('0x40')]=_[_0x03cd('0x43')](_0x439e8e[_0x03cd('0x40')],{'$or':_[_0x03cd('0x33')](_0x1ef62b,function(_0x288fd4){if(_0x288fd4[_0x03cd('0x44')]!==_0x03cd('0x45')){var _0x424c0b={};_0x424c0b[_0x288fd4[_0x03cd('0x30')]]={'$like':'%'+_0x399cba[_0x03cd('0x36')]['filter']+'%'};return _0x424c0b;}})});}_0x439e8e=_[_0x03cd('0x43')]({},_0x439e8e,_0x399cba[_0x03cd('0x46')]);var _0x2f0803={'where':_0x439e8e[_0x03cd('0x40')]};return db[_0x03cd('0x34')]['count'](_0x2f0803)[_0x03cd('0x2d')](function(_0x598096){_0x18a3fa[_0x03cd('0x21')]=_0x598096;if(_0x399cba['query'][_0x03cd('0x47')]){_0x439e8e['include']=[{'all':!![]}];}return db['Dashboard'][_0x03cd('0x48')](_0x439e8e);})['then'](function(_0x28a580){_0x18a3fa[_0x03cd('0x49')]=_0x28a580;return _0x18a3fa;})[_0x03cd('0x2d')](respondWithFilteredResult(_0x2a8205,_0x439e8e))[_0x03cd('0x4a')](handleError(_0x2a8205,null));};exports[_0x03cd('0x4b')]=function(_0x4438fb,_0x2a4109){var _0x237de7={'raw':![],'where':{'id':_0x4438fb[_0x03cd('0x4c')]['id']}},_0x45f23e={};_0x45f23e[_0x03cd('0x3a')]=_['keys'](db['Dashboard'][_0x03cd('0x4d')]);_0x45f23e['query']=_[_0x03cd('0x37')](_0x4438fb[_0x03cd('0x36')]);_0x45f23e[_0x03cd('0x38')]=_[_0x03cd('0x39')](_0x45f23e[_0x03cd('0x3a')],_0x45f23e[_0x03cd('0x36')]);_0x237de7['attributes']=_[_0x03cd('0x39')](_0x45f23e[_0x03cd('0x3a')],qs['fields'](_0x4438fb[_0x03cd('0x36')][_0x03cd('0x3c')]));_0x237de7[_0x03cd('0x3b')]=_0x237de7['attributes']['length']?_0x237de7['attributes']:_0x45f23e[_0x03cd('0x3a')];if(_0x4438fb[_0x03cd('0x36')][_0x03cd('0x47')]){_0x237de7[_0x03cd('0x4e')]=[{'all':!![]}];}_0x237de7=_[_0x03cd('0x43')]({},_0x237de7,_0x4438fb[_0x03cd('0x46')]);return db[_0x03cd('0x34')][_0x03cd('0x4f')](_0x237de7)['then'](handleEntityNotFound(_0x2a4109,null))[_0x03cd('0x2d')](respondWithResult(_0x2a4109,null))[_0x03cd('0x4a')](handleError(_0x2a4109,null));};exports['create']=function(_0x370546,_0x1ca36c){return db[_0x03cd('0x34')][_0x03cd('0x50')](_0x370546[_0x03cd('0x51')],{})[_0x03cd('0x2d')](function(_0x377a70){var _0x4d126f=_0x370546[_0x03cd('0x52')][_0x03cd('0x29')]({'plain':!![]});if(!_0x4d126f)throw new Error(_0x03cd('0x53'));if(_0x4d126f['role']==='user'){var _0x52cbf7=_0x377a70['get']({'plain':!![]});var _0x468d44=_0x03cd('0x2a');return db[_0x03cd('0x54')]['find']({'where':{'name':_0x468d44,'userProfileId':_0x4d126f[_0x03cd('0x55')]},'raw':!![]})[_0x03cd('0x2d')](function(_0x105492){if(_0x105492&&_0x105492[_0x03cd('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x52cbf7[_0x03cd('0x30')],'resourceId':_0x52cbf7['id'],'type':_0x105492[_0x03cd('0x30')],'sectionId':_0x105492['id']},{})[_0x03cd('0x2d')](function(){return _0x377a70;});}else{return _0x377a70;}})[_0x03cd('0x4a')](function(_0x2adc24){logger['error'](_0x03cd('0x57'),_0x2adc24);throw _0x2adc24;});}return _0x377a70;})['then'](respondWithResult(_0x1ca36c,0xc9))[_0x03cd('0x4a')](handleError(_0x1ca36c,null));};exports[_0x03cd('0x58')]=function(_0x29e46a,_0x235fa){var _0x156e48={'where':{'id':_0x29e46a[_0x03cd('0x4c')]['id']}},_0x5ddf25={};_0x5ddf25['model']=_[_0x03cd('0x37')](db['Dashboard'][_0x03cd('0x4d')]);_0x156e48[_0x03cd('0x3b')]=_[_0x03cd('0x39')](_0x5ddf25[_0x03cd('0x3a')],qs[_0x03cd('0x3c')](_0x29e46a[_0x03cd('0x36')][_0x03cd('0x3c')]));_0x156e48[_0x03cd('0x3b')]=_0x156e48[_0x03cd('0x3b')]['length']?_0x156e48['attributes']:_0x5ddf25[_0x03cd('0x3a')];if(_0x29e46a['query'][_0x03cd('0x47')]){_0x156e48[_0x03cd('0x4e')]=[{'all':!![]}];}_0x156e48=_['merge']({},_0x156e48,_0x29e46a['options']);return db[_0x03cd('0x34')][_0x03cd('0x4f')](_0x156e48)[_0x03cd('0x2d')](handleEntityNotFound(_0x235fa,null))[_0x03cd('0x2d')](function(_0x1e5c97){if(_0x1e5c97){var _0x2b5b90=_0x1e5c97[_0x03cd('0x29')]({'plain':!![]});_0x2b5b90=qs[_0x03cd('0x59')](_0x2b5b90,['id',_0x03cd('0x5a'),_0x03cd('0x5b')]);_0x29e46a[_0x03cd('0x51')]=_[_0x03cd('0x59')](_0x29e46a[_0x03cd('0x51')],['id',_0x03cd('0x5a'),_0x03cd('0x5b')]);return db[_0x03cd('0x34')][_0x03cd('0x50')](_['merge'](_0x2b5b90,_0x29e46a[_0x03cd('0x51')]),{'include':_0x29e46a[_0x03cd('0x36')]['includeAll']?[{'all':!![]}]:undefined})[_0x03cd('0x2d')](function(_0x240b43){var _0x4c0620=_0x29e46a[_0x03cd('0x52')]['get']({'plain':!![]});if(!_0x4c0620)throw new Error(_0x03cd('0x53'));if(_0x4c0620[_0x03cd('0x5c')]===_0x03cd('0x52')){var _0x532cdd=_0x240b43[_0x03cd('0x29')]({'plain':!![]});var _0x167087='CustomDashboards';return db[_0x03cd('0x54')][_0x03cd('0x4f')]({'where':{'name':_0x167087,'userProfileId':_0x4c0620[_0x03cd('0x55')]},'raw':!![]})[_0x03cd('0x2d')](function(_0x1b4f4a){if(_0x1b4f4a&&_0x1b4f4a[_0x03cd('0x56')]===0x0){return db['UserProfileResource'][_0x03cd('0x50')]({'name':_0x532cdd[_0x03cd('0x30')],'resourceId':_0x532cdd['id'],'type':_0x1b4f4a[_0x03cd('0x30')],'sectionId':_0x1b4f4a['id']},{})[_0x03cd('0x2d')](function(){return _0x240b43;});}else{return _0x240b43;}})[_0x03cd('0x4a')](function(_0x1f0abd){logger['error'](_0x03cd('0x57'),_0x1f0abd);throw _0x1f0abd;});}return _0x240b43;});}})[_0x03cd('0x2d')](respondWithResult(_0x235fa,0xc9))[_0x03cd('0x4a')](handleError(_0x235fa,null));};exports[_0x03cd('0x28')]=function(_0x9ffba,_0x58b3e6){if(_0x9ffba[_0x03cd('0x51')]['id']){delete _0x9ffba[_0x03cd('0x51')]['id'];}return db['Dashboard'][_0x03cd('0x4f')]({'where':{'id':_0x9ffba[_0x03cd('0x4c')]['id']}})[_0x03cd('0x2d')](handleEntityNotFound(_0x58b3e6,null))[_0x03cd('0x2d')](saveUpdates(_0x9ffba[_0x03cd('0x51')],null))[_0x03cd('0x2d')](respondWithResult(_0x58b3e6,null))['catch'](handleError(_0x58b3e6,null));};exports[_0x03cd('0x2c')]=function(_0x974d9d,_0x500261){return db['Dashboard']['find']({'where':{'id':_0x974d9d[_0x03cd('0x4c')]['id']}})[_0x03cd('0x2d')](handleEntityNotFound(_0x500261,null))[_0x03cd('0x2d')](removeEntity(_0x500261,null))[_0x03cd('0x4a')](handleError(_0x500261,null));};function widgetAttributes(_0x521af7){try{switch(_0x521af7['type']){case _0x03cd('0x5d'):return[{'name':_0x03cd('0x5e'),'value':_0x521af7[_0x03cd('0x5e')]||(_0x521af7[_0x03cd('0x5f')]&&_0x521af7[_0x03cd('0x5f')][0x0]?_0x521af7[_0x03cd('0x5f')][0x0]['value']:undefined)||'https://'}];case _0x03cd('0x60'):return[{'name':_0x03cd('0x61'),'value':_0x521af7['attrPath']||(_0x521af7[_0x03cd('0x5f')]&&_0x521af7['attrs'][0x0]?_0x521af7[_0x03cd('0x5f')][0x0]['value']:undefined)||''}];case _0x03cd('0x62'):return[{'name':'attrHourFormat','value':_0x521af7[_0x03cd('0x63')]||(_0x521af7['attrs']&&_0x521af7[_0x03cd('0x5f')][0x0]?_0x521af7[_0x03cd('0x5f')][0x0][_0x03cd('0x64')]:undefined)||_0x03cd('0x65')},{'name':_0x03cd('0x66'),'value':_0x521af7[_0x03cd('0x66')]||(_0x521af7[_0x03cd('0x5f')]&&_0x521af7['attrs'][0x1]?_0x521af7['attrs'][0x1][_0x03cd('0x64')]:undefined)||_0x03cd('0x67')},{'name':_0x03cd('0x68'),'value':_0x521af7[_0x03cd('0x68')]||(_0x521af7[_0x03cd('0x5f')]&&_0x521af7['attrs'][0x2]?_0x521af7[_0x03cd('0x5f')][0x2]['value']:undefined)||0xc}];case _0x03cd('0x69'):return[{'name':_0x03cd('0x6a'),'value':_0x521af7[_0x03cd('0x6a')]||(_0x521af7[_0x03cd('0x5f')]&&_0x521af7['attrs'][0x0]?_0x521af7[_0x03cd('0x5f')][0x0][_0x03cd('0x64')]:undefined)||_0x03cd('0x6b')},{'name':_0x03cd('0x6c'),'value':_0x521af7['attrVoiceQueues']||(_0x521af7[_0x03cd('0x5f')]&&_0x521af7[_0x03cd('0x5f')][0x1]?_0x521af7[_0x03cd('0x5f')][0x1][_0x03cd('0x64')]:undefined)||[]},{'name':_0x03cd('0x68'),'value':_0x521af7[_0x03cd('0x68')]||(_0x521af7[_0x03cd('0x5f')]&&_0x521af7[_0x03cd('0x5f')][0x2]?_0x521af7[_0x03cd('0x5f')][0x2][_0x03cd('0x64')]:undefined)||0x14},{'name':_0x03cd('0x6d'),'value':_0x521af7[_0x03cd('0x6d')]||(_0x521af7[_0x03cd('0x5f')]&&_0x521af7['attrs'][0x3]?_0x521af7[_0x03cd('0x5f')][0x3][_0x03cd('0x64')]:undefined)||_0x03cd('0x6e')},{'name':_0x03cd('0x6f'),'value':_0x521af7['attrEmailAccounts']||(_0x521af7[_0x03cd('0x5f')]&&_0x521af7['attrs'][0x4]?_0x521af7['attrs'][0x4][_0x03cd('0x64')]:undefined)||''},{'name':_0x03cd('0x70'),'value':_0x521af7[_0x03cd('0x70')]||(_0x521af7[_0x03cd('0x5f')]&&_0x521af7['attrs'][0x5]?_0x521af7[_0x03cd('0x5f')][0x5][_0x03cd('0x64')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x521af7['attrSmsAccounts']||(_0x521af7[_0x03cd('0x5f')]&&_0x521af7[_0x03cd('0x5f')][0x6]?_0x521af7[_0x03cd('0x5f')][0x6]['value']:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x521af7['attrOpenchannelAccounts']||(_0x521af7[_0x03cd('0x5f')]&&_0x521af7[_0x03cd('0x5f')][0x7]?_0x521af7[_0x03cd('0x5f')][0x7][_0x03cd('0x64')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x521af7[_0x03cd('0x71')]||(_0x521af7[_0x03cd('0x5f')]&&_0x521af7['attrs'][0x8]?_0x521af7['attrs'][0x8][_0x03cd('0x64')]:undefined)||''},{'name':_0x03cd('0x72'),'value':_0x521af7[_0x03cd('0x72')]||(_0x521af7[_0x03cd('0x5f')]&&_0x521af7[_0x03cd('0x5f')][0x9]?_0x521af7[_0x03cd('0x5f')][0x9]['value']:undefined)||''}];case _0x03cd('0x73'):case'pie-chart':return[{'name':_0x03cd('0x74'),'value':_0x521af7[_0x03cd('0x74')]||(_0x521af7[_0x03cd('0x5f')]&&_0x521af7[_0x03cd('0x5f')][0x0]?_0x521af7[_0x03cd('0x5f')][0x0][_0x03cd('0x64')]:undefined)||_0x03cd('0x6b')},{'name':_0x03cd('0x75'),'value':_0x521af7[_0x03cd('0x75')]||(_0x521af7[_0x03cd('0x5f')]&&_0x521af7[_0x03cd('0x5f')][0x1]?_0x521af7['attrs'][0x1][_0x03cd('0x64')]:undefined)||null},{'name':_0x03cd('0x76'),'value':_0x521af7[_0x03cd('0x76')]||(_0x521af7[_0x03cd('0x5f')]&&_0x521af7['attrs'][0x2]?_0x521af7['attrs'][0x2]['value']:undefined)||null},{'name':_0x03cd('0x6c'),'value':_0x521af7[_0x03cd('0x6c')]||(_0x521af7[_0x03cd('0x5f')]&&_0x521af7[_0x03cd('0x5f')][0x3]?_0x521af7[_0x03cd('0x5f')][0x3][_0x03cd('0x64')]:undefined)||[]},{'name':_0x03cd('0x6d'),'value':_0x521af7[_0x03cd('0x6d')]||(_0x521af7[_0x03cd('0x5f')]&&_0x521af7['attrs'][0x4]?_0x521af7[_0x03cd('0x5f')][0x4][_0x03cd('0x64')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x521af7['attrEmailAccounts']||(_0x521af7[_0x03cd('0x5f')]&&_0x521af7[_0x03cd('0x5f')][0x5]?_0x521af7[_0x03cd('0x5f')][0x5][_0x03cd('0x64')]:undefined)||''},{'name':_0x03cd('0x70'),'value':_0x521af7[_0x03cd('0x70')]||(_0x521af7[_0x03cd('0x5f')]&&_0x521af7[_0x03cd('0x5f')][0x6]?_0x521af7[_0x03cd('0x5f')][0x6][_0x03cd('0x64')]:undefined)||''},{'name':_0x03cd('0x77'),'value':_0x521af7['attrSmsAccounts']||(_0x521af7['attrs']&&_0x521af7[_0x03cd('0x5f')][0x7]?_0x521af7['attrs'][0x7][_0x03cd('0x64')]:undefined)||''},{'name':_0x03cd('0x78'),'value':_0x521af7[_0x03cd('0x78')]||(_0x521af7[_0x03cd('0x5f')]&&_0x521af7[_0x03cd('0x5f')][0x8]?_0x521af7['attrs'][0x8][_0x03cd('0x64')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x521af7[_0x03cd('0x71')]||(_0x521af7[_0x03cd('0x5f')]&&_0x521af7['attrs'][0x9]?_0x521af7[_0x03cd('0x5f')][0x9][_0x03cd('0x64')]:undefined)||''},{'name':_0x03cd('0x72'),'value':_0x521af7['attrChatWebsites']||(_0x521af7[_0x03cd('0x5f')]&&_0x521af7['attrs'][0xa]?_0x521af7[_0x03cd('0x5f')][0xa][_0x03cd('0x64')]:undefined)||''}];case _0x03cd('0x79'):return[{'name':_0x03cd('0x7a'),'type':_0x521af7[_0x03cd('0x7b')]||(_0x521af7[_0x03cd('0x5f')]&&_0x521af7[_0x03cd('0x5f')][0x0]?_0x521af7[_0x03cd('0x5f')][0x0][_0x03cd('0x44')]:undefined)||null,'value':_0x521af7[_0x03cd('0x7a')]||(_0x521af7[_0x03cd('0x5f')]&&_0x521af7['attrs'][0x0]?_0x521af7[_0x03cd('0x5f')][0x0][_0x03cd('0x64')]:undefined)||null},{'name':'attrRefresh','value':_0x521af7['attrRefresh']||(_0x521af7[_0x03cd('0x5f')]&&_0x521af7[_0x03cd('0x5f')][0x1]?_0x521af7[_0x03cd('0x5f')][0x1][_0x03cd('0x64')]:undefined)||0x0}];default:return[];}}catch(_0x44a922){logger['error'](_0x03cd('0x7c'),JSON[_0x03cd('0x7d')](_0x44a922));return[];}}exports[_0x03cd('0x7e')]=function(_0x5db586,_0x4724a6,_0x1dc806){if(_0x5db586[_0x03cd('0x51')]['id']){delete _0x5db586[_0x03cd('0x51')]['id'];}return db[_0x03cd('0x34')][_0x03cd('0x4f')]({'where':{'id':_0x5db586[_0x03cd('0x4c')]['id']}})[_0x03cd('0x2d')](handleEntityNotFound(_0x4724a6,null))[_0x03cd('0x2d')](function(_0x162610){if(_0x162610){_0x5db586['body'][_0x03cd('0x7f')]=_0x162610['id'];_0x5db586['body'][_0x03cd('0x5f')]=widgetAttributes(_0x5db586[_0x03cd('0x51')]);return db[_0x03cd('0x80')]['create'](_0x5db586[_0x03cd('0x51')]);}})[_0x03cd('0x2d')](respondWithResult(_0x4724a6,null))[_0x03cd('0x4a')](handleError(_0x4724a6,null));};exports['getItems']=function(_0x38cb42,_0x4c84aa,_0x28883a){var _0x271bc1={};var _0x43366d={};var _0x788b8;var _0x1e7684;return db[_0x03cd('0x34')]['findOne']({'where':{'id':_0x38cb42[_0x03cd('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4c84aa,null))[_0x03cd('0x2d')](function(_0x38753d){if(_0x38753d){_0x788b8=_0x38753d;_0x43366d[_0x03cd('0x3a')]=_[_0x03cd('0x37')](db[_0x03cd('0x80')][_0x03cd('0x4d')]);_0x43366d[_0x03cd('0x36')]=_[_0x03cd('0x37')](_0x38cb42[_0x03cd('0x36')]);_0x43366d['filters']=_[_0x03cd('0x39')](_0x43366d[_0x03cd('0x3a')],_0x43366d[_0x03cd('0x36')]);_0x271bc1['attributes']=_[_0x03cd('0x39')](_0x43366d[_0x03cd('0x3a')],qs[_0x03cd('0x3c')](_0x38cb42[_0x03cd('0x36')][_0x03cd('0x3c')]));_0x271bc1[_0x03cd('0x3b')]=_0x271bc1[_0x03cd('0x3b')][_0x03cd('0x81')]?_0x271bc1[_0x03cd('0x3b')]:_0x43366d['model'];_0x271bc1[_0x03cd('0x82')]=qs[_0x03cd('0x3f')](_0x38cb42[_0x03cd('0x36')][_0x03cd('0x3f')]);_0x271bc1['where']=qs[_0x03cd('0x38')](_['pick'](_0x38cb42[_0x03cd('0x36')],_0x43366d[_0x03cd('0x38')]));if(_0x38cb42[_0x03cd('0x36')][_0x03cd('0x42')]){_0x271bc1[_0x03cd('0x40')]=_[_0x03cd('0x43')](_0x271bc1[_0x03cd('0x40')],{'$or':_[_0x03cd('0x33')](_0x271bc1[_0x03cd('0x3b')],function(_0x2d708f){var _0x4577a2={};_0x4577a2[_0x2d708f]={'$like':'%'+_0x38cb42[_0x03cd('0x36')]['filter']+'%'};return _0x4577a2;})});}_0x271bc1=_[_0x03cd('0x43')]({},_0x271bc1,_0x38cb42[_0x03cd('0x46')]);return _0x788b8[_0x03cd('0x83')](_0x271bc1);}})['then'](function(_0x8f7ccf){if(_0x8f7ccf){_0x1e7684=_0x8f7ccf[_0x03cd('0x81')];if(!_0x38cb42[_0x03cd('0x36')][_0x03cd('0x3d')](_0x03cd('0x3e'))){_0x271bc1[_0x03cd('0x20')]=qs[_0x03cd('0x20')](_0x38cb42[_0x03cd('0x36')][_0x03cd('0x20')]);_0x271bc1[_0x03cd('0x1e')]=qs[_0x03cd('0x1e')](_0x38cb42[_0x03cd('0x36')][_0x03cd('0x1e')]);}return _0x788b8[_0x03cd('0x83')](_0x271bc1);}})[_0x03cd('0x2d')](function(_0x5729fb){if(_0x5729fb){return _0x5729fb?{'count':_0x1e7684,'rows':_0x5729fb}:null;}})[_0x03cd('0x2d')](respondWithResult(_0x4c84aa,null))[_0x03cd('0x4a')](handleError(_0x4c84aa,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 4618f02..2cbbe77 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 _0x2517=['remove','emit','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners','save','update'];(function(_0x127a60,_0x37f33a){var _0xc1f6a3=function(_0x8ed035){while(--_0x8ed035){_0x127a60['push'](_0x127a60['shift']());}};_0xc1f6a3(++_0x37f33a);}(_0x2517,0xfe));var _0x7251=function(_0x128a80,_0xf6c598){_0x128a80=_0x128a80-0x0;var _0x5a25eb=_0x2517[_0x128a80];return _0x5a25eb;};'use strict';var EventEmitter=require(_0x7251('0x0'));var Dashboard=require(_0x7251('0x1'))['db'][_0x7251('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x7251('0x3')](0x0);var events={'afterCreate':_0x7251('0x4'),'afterUpdate':_0x7251('0x5'),'afterDestroy':_0x7251('0x6')};function emitEvent(_0x16c580){return function(_0xbe40fe,_0x48d137,_0x3412dd){DashboardEvents[_0x7251('0x7')](_0x16c580+':'+_0xbe40fe['id'],_0xbe40fe);DashboardEvents[_0x7251('0x7')](_0x16c580,_0xbe40fe);_0x3412dd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x7251('0x8')](e,emitEvent(event));}}module[_0x7251('0x9')]=DashboardEvents; \ No newline at end of file +var _0x57e3=['../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x57e3,0xb3));var _0x357e=function(_0xf5d891,_0x32552e){_0xf5d891=_0xf5d891-0x0;var _0x559128=_0x57e3[_0xf5d891];return _0x559128;};'use strict';var EventEmitter=require(_0x357e('0x0'));var Dashboard=require(_0x357e('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x357e('0x2')](0x0);var events={'afterCreate':_0x357e('0x3'),'afterUpdate':'update','afterDestroy':_0x357e('0x4')};function emitEvent(_0x3990c9){return function(_0x27f0e7,_0xe2089e,_0xeb5135){DashboardEvents[_0x357e('0x5')](_0x3990c9+':'+_0x27f0e7['id'],_0x27f0e7);DashboardEvents['emit'](_0x3990c9,_0x27f0e7);_0xeb5135(null);};}for(var e in events){if(events[_0x357e('0x6')](e)){var event=events[e];Dashboard[_0x357e('0x7')](e,emitEvent(event));}}module[_0x357e('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 4adb979..b37d560 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 _0xa22b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','define','Dashboard','dashboards','lodash','util','api'];(function(_0x5bae64,_0x5062bd){var _0x45e8af=function(_0x227821){while(--_0x227821){_0x5bae64['push'](_0x5bae64['shift']());}};_0x45e8af(++_0x5062bd);}(_0xa22b,0x128));var _0xba22=function(_0x177cc9,_0x3f6fdd){_0x177cc9=_0x177cc9-0x0;var _0x2fe577=_0xa22b[_0x177cc9];return _0x2fe577;};'use strict';var _=require(_0xba22('0x0'));var util=require(_0xba22('0x1'));var logger=require('../../config/logger')(_0xba22('0x2'));var moment=require(_0xba22('0x3'));var BPromise=require(_0xba22('0x4'));var rp=require(_0xba22('0x5'));var fs=require('fs');var path=require(_0xba22('0x6'));var rimraf=require(_0xba22('0x7'));var config=require(_0xba22('0x8'));var attributes=require(_0xba22('0x9'));module['exports']=function(_0x43e0ae,_0xd0d921){return _0x43e0ae[_0xba22('0xa')](_0xba22('0xb'),attributes,{'tableName':_0xba22('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeba0=['path','rimraf','../../config/environment','./dashboard.attributes','dashboards','lodash','util','moment','request-promise'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0xeba0,0x1e2));var _0x0eba=function(_0x3cc29f,_0x353898){_0x3cc29f=_0x3cc29f-0x0;var _0x5609de=_0xeba0[_0x3cc29f];return _0x5609de;};'use strict';var _=require(_0x0eba('0x0'));var util=require(_0x0eba('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0eba('0x2'));var BPromise=require('bluebird');var rp=require(_0x0eba('0x3'));var fs=require('fs');var path=require(_0x0eba('0x4'));var rimraf=require(_0x0eba('0x5'));var config=require(_0x0eba('0x6'));var attributes=require(_0x0eba('0x7'));module['exports']=function(_0x414f33,_0x4e765b){return _0x414f33['define']('Dashboard',attributes,{'tableName':_0x0eba('0x8'),'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 910f015..1b3bb68 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 _0x8c73=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','then','info','request\x20sent','debug','stringify','error','code','Dashboard,\x20%s,\x20%s','message','result','lodash'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x8c73,0xbf));var _0x38c7=function(_0x5eb4cc,_0x15af2d){_0x5eb4cc=_0x5eb4cc-0x0;var _0x5e9e44=_0x8c73[_0x5eb4cc];return _0x5e9e44;};'use strict';var _=require(_0x38c7('0x0'));var util=require('util');var moment=require(_0x38c7('0x1'));var BPromise=require('bluebird');var rs=require(_0x38c7('0x2'));var fs=require('fs');var Redis=require(_0x38c7('0x3'));var db=require(_0x38c7('0x4'))['db'];var utils=require(_0x38c7('0x5'));var logger=require('../../config/logger')(_0x38c7('0x6'));var config=require(_0x38c7('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0x38c7('0x8')]=_[_0x38c7('0x9')](config['redis'],{'host':_0x38c7('0xa'),'port':0x18eb});var socket=require(_0x38c7('0xb'))(new Redis(config[_0x38c7('0x8')]));require(_0x38c7('0xc'))[_0x38c7('0xd')](socket);function respondWithRpcPromise(_0x27898b,_0x31473a,_0x4a8745){return new BPromise(function(_0x264b60,_0x102cd8){return client['request'](_0x27898b,_0x4a8745)[_0x38c7('0xe')](function(_0xfd3523){logger[_0x38c7('0xf')]('Dashboard,\x20%s,\x20%s',_0x31473a,_0x38c7('0x10'));logger[_0x38c7('0x11')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x31473a,'request\x20sent',JSON[_0x38c7('0x12')](_0xfd3523));if(_0xfd3523[_0x38c7('0x13')]){if(_0xfd3523[_0x38c7('0x13')][_0x38c7('0x14')]===0x1f4){logger['error'](_0x38c7('0x15'),_0x31473a,_0xfd3523[_0x38c7('0x13')][_0x38c7('0x16')]);return _0x102cd8(_0xfd3523[_0x38c7('0x13')][_0x38c7('0x16')]);}logger[_0x38c7('0x13')](_0x38c7('0x15'),_0x31473a,_0xfd3523[_0x38c7('0x13')]['message']);return _0x264b60(_0xfd3523['error'][_0x38c7('0x16')]);}else{logger[_0x38c7('0xf')](_0x38c7('0x15'),_0x31473a,'request\x20sent');_0x264b60(_0xfd3523[_0x38c7('0x17')][_0x38c7('0x16')]);}})['catch'](function(_0xf50f4f){logger[_0x38c7('0x13')](_0x38c7('0x15'),_0x31473a,_0xf50f4f);_0x102cd8(_0xf50f4f);});});} \ No newline at end of file +var _0x064c=['../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./dashboard.socket','register','then','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','bluebird','randomstring','ioredis'];(function(_0x192a81,_0x4b3e70){var _0x5721f9=function(_0x313c2a){while(--_0x313c2a){_0x192a81['push'](_0x192a81['shift']());}};_0x5721f9(++_0x4b3e70);}(_0x064c,0x87));var _0xc064=function(_0x5581ba,_0x268887){_0x5581ba=_0x5581ba-0x0;var _0x1e927f=_0x064c[_0x5581ba];return _0x1e927f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xc064('0x0'));var rs=require(_0xc064('0x1'));var fs=require('fs');var Redis=require(_0xc064('0x2'));var db=require(_0xc064('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc064('0x4'));var config=require(_0xc064('0x5'));var jayson=require(_0xc064('0x6'));var client=jayson['client'][_0xc064('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0xc064('0x8')],{'host':_0xc064('0x9'),'port':0x18eb});var socket=require(_0xc064('0xa'))(new Redis(config['redis']));require(_0xc064('0xb'))[_0xc064('0xc')](socket);function respondWithRpcPromise(_0x1ccb50,_0x43345f,_0x547a4f){return new BPromise(function(_0x549d21,_0x188ccf){return client['request'](_0x1ccb50,_0x547a4f)[_0xc064('0xd')](function(_0x4d4d4f){logger['info'](_0xc064('0xe'),_0x43345f,_0xc064('0xf'));logger[_0xc064('0x10')](_0xc064('0x11'),_0x43345f,_0xc064('0xf'),JSON[_0xc064('0x12')](_0x4d4d4f));if(_0x4d4d4f[_0xc064('0x13')]){if(_0x4d4d4f[_0xc064('0x13')][_0xc064('0x14')]===0x1f4){logger[_0xc064('0x13')](_0xc064('0xe'),_0x43345f,_0x4d4d4f[_0xc064('0x13')][_0xc064('0x15')]);return _0x188ccf(_0x4d4d4f['error']['message']);}logger[_0xc064('0x13')](_0xc064('0xe'),_0x43345f,_0x4d4d4f['error'][_0xc064('0x15')]);return _0x549d21(_0x4d4d4f[_0xc064('0x13')][_0xc064('0x15')]);}else{logger['info'](_0xc064('0xe'),_0x43345f,_0xc064('0xf'));_0x549d21(_0x4d4d4f[_0xc064('0x16')][_0xc064('0x15')]);}})['catch'](function(_0x1796c7){logger[_0xc064('0x13')](_0xc064('0xe'),_0x43345f,_0x1796c7);_0x188ccf(_0x1796c7);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index ce4308d..e616005 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 _0x729a=['remove','emit','register','length','./dashboard.events','save'];(function(_0x207140,_0x4c6556){var _0x39e8cf=function(_0x16b730){while(--_0x16b730){_0x207140['push'](_0x207140['shift']());}};_0x39e8cf(++_0x4c6556);}(_0x729a,0x112));var _0xa729=function(_0x15b3c1,_0x231df4){_0x15b3c1=_0x15b3c1-0x0;var _0x586273=_0x729a[_0x15b3c1];return _0x586273;};'use strict';var DashboardEvents=require(_0xa729('0x0'));var events=[_0xa729('0x1'),_0xa729('0x2'),'update'];function createListener(_0x2531ad,_0x381bbf){return function(_0x2d9a1a){_0x381bbf[_0xa729('0x3')](_0x2531ad,_0x2d9a1a);};}function removeListener(_0x19b30d,_0x1102b9){return function(){DashboardEvents['removeListener'](_0x19b30d,_0x1102b9);};}exports[_0xa729('0x4')]=function(_0xa880dc){for(var _0x4f177b=0x0,_0xd31f06=events[_0xa729('0x5')];_0x4f177b<_0xd31f06;_0x4f177b++){var _0x294243=events[_0x4f177b];var _0x6ed82=createListener('dashboard:'+_0x294243,_0xa880dc);DashboardEvents['on'](_0x294243,_0x6ed82);}}; \ No newline at end of file +var _0x5482=['dashboard:','save','update','emit','removeListener'];(function(_0x23648e,_0x13c6f9){var _0x6de7b1=function(_0x5551f7){while(--_0x5551f7){_0x23648e['push'](_0x23648e['shift']());}};_0x6de7b1(++_0x13c6f9);}(_0x5482,0x8d));var _0x2548=function(_0x510ee9,_0xfd8b59){_0x510ee9=_0x510ee9-0x0;var _0xc4e23=_0x5482[_0x510ee9];return _0xc4e23;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x2548('0x0'),'remove',_0x2548('0x1')];function createListener(_0x12d1ea,_0x5b25d9){return function(_0x504e73){_0x5b25d9[_0x2548('0x2')](_0x12d1ea,_0x504e73);};}function removeListener(_0x1caa8a,_0x253d89){return function(){DashboardEvents[_0x2548('0x3')](_0x1caa8a,_0x253d89);};}exports['register']=function(_0x2a2bf5){for(var _0x4b27b9=0x0,_0x75eeac=events['length'];_0x4b27b9<_0x75eeac;_0x4b27b9++){var _0x3b17f3=events[_0x4b27b9];var _0x55eb89=createListener(_0x2548('0x4')+_0x3b17f3,_0x2a2bf5);DashboardEvents['on'](_0x3b17f3,_0x55eb89);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 1620ccd..e0758fd 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 _0x8d23=['get','isAuthenticated','index','/:id','show','/:id/items','getItems','create','post','/:id/clone','clone','addItem','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller'];(function(_0xbabda3,_0x51e341){var _0x5bba7a=function(_0x388388){while(--_0x388388){_0xbabda3['push'](_0xbabda3['shift']());}};_0x5bba7a(++_0x51e341);}(_0x8d23,0x113));var _0x38d2=function(_0x4cc7f5,_0x3fa085){_0x4cc7f5=_0x4cc7f5-0x0;var _0x2c5f50=_0x8d23[_0x4cc7f5];return _0x2c5f50;};'use strict';var multer=require(_0x38d2('0x0'));var util=require(_0x38d2('0x1'));var path=require(_0x38d2('0x2'));var timeout=require(_0x38d2('0x3'));var express=require(_0x38d2('0x4'));var router=express[_0x38d2('0x5')]();var fs_extra=require(_0x38d2('0x6'));var auth=require(_0x38d2('0x7'));var interaction=require(_0x38d2('0x8'));var config=require(_0x38d2('0x9'));var controller=require(_0x38d2('0xa'));router[_0x38d2('0xb')]('/',auth[_0x38d2('0xc')](),controller[_0x38d2('0xd')]);router['get'](_0x38d2('0xe'),auth[_0x38d2('0xc')](),controller[_0x38d2('0xf')]);router[_0x38d2('0xb')](_0x38d2('0x10'),auth['isAuthenticated'](),controller[_0x38d2('0x11')]);router['post']('/',auth[_0x38d2('0xc')](),controller[_0x38d2('0x12')]);router[_0x38d2('0x13')](_0x38d2('0x14'),auth['isAuthenticated'](),controller[_0x38d2('0x15')]);router[_0x38d2('0x13')](_0x38d2('0x10'),auth['isAuthenticated'](),controller[_0x38d2('0x16')]);router['put'](_0x38d2('0xe'),auth['isAuthenticated'](),controller[_0x38d2('0x17')]);router[_0x38d2('0x18')](_0x38d2('0xe'),auth[_0x38d2('0xc')](),controller['destroy']);module[_0x38d2('0x19')]=router; \ No newline at end of file +var _0xb5c7=['put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','/:id','show','/:id/items','getItems','post','/:id/clone','clone','addItem'];(function(_0x434783,_0xff395d){var _0x13efcf=function(_0x235dac){while(--_0x235dac){_0x434783['push'](_0x434783['shift']());}};_0x13efcf(++_0xff395d);}(_0xb5c7,0x10c));var _0x7b5c=function(_0x5c8a7a,_0x13a31d){_0x5c8a7a=_0x5c8a7a-0x0;var _0x1e899a=_0xb5c7[_0x5c8a7a];return _0x1e899a;};'use strict';var multer=require(_0x7b5c('0x0'));var util=require(_0x7b5c('0x1'));var path=require(_0x7b5c('0x2'));var timeout=require(_0x7b5c('0x3'));var express=require('express');var router=express[_0x7b5c('0x4')]();var fs_extra=require(_0x7b5c('0x5'));var auth=require(_0x7b5c('0x6'));var interaction=require(_0x7b5c('0x7'));var config=require(_0x7b5c('0x8'));var controller=require(_0x7b5c('0x9'));router[_0x7b5c('0xa')]('/',auth[_0x7b5c('0xb')](),controller['index']);router['get'](_0x7b5c('0xc'),auth['isAuthenticated'](),controller[_0x7b5c('0xd')]);router['get'](_0x7b5c('0xe'),auth['isAuthenticated'](),controller[_0x7b5c('0xf')]);router[_0x7b5c('0x10')]('/',auth[_0x7b5c('0xb')](),controller['create']);router[_0x7b5c('0x10')](_0x7b5c('0x11'),auth[_0x7b5c('0xb')](),controller[_0x7b5c('0x12')]);router['post']('/:id/items',auth['isAuthenticated'](),controller[_0x7b5c('0x13')]);router[_0x7b5c('0x14')](_0x7b5c('0xc'),auth[_0x7b5c('0xb')](),controller[_0x7b5c('0x15')]);router[_0x7b5c('0x16')](_0x7b5c('0xc'),auth['isAuthenticated'](),controller[_0x7b5c('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 93808ca..ff365bb 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 _0x4819=['long','parse','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','#2196f3','squel','lodash','exports','STRING','TEXT'];(function(_0x6a734c,_0x1b2d9f){var _0x494d0d=function(_0x36fd39){while(--_0x36fd39){_0x6a734c['push'](_0x6a734c['shift']());}};_0x494d0d(++_0x1b2d9f);}(_0x4819,0xcd));var _0x9481=function(_0x28678d,_0x54324f){_0x28678d=_0x28678d-0x0;var _0x1643e9=_0x4819[_0x28678d];return _0x1643e9;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x9481('0x0'));var _=require(_0x9481('0x1'));module[_0x9481('0x2')]={'title':{'type':Sequelize[_0x9481('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x9481('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x9481('0x4')](_0x9481('0x5')),'get':function(){try{return JSON[_0x9481('0x6')](this[_0x9481('0x7')](_0x9481('0x8')));}catch(_0x5ac51c){return[];}},'set':function(_0x4d9e3a){try{this['setDataValue']('attrs',JSON[_0x9481('0x9')](_0x4d9e3a));}catch(_0x6c6a08){this[_0x9481('0xa')](_0x9481('0x8'),JSON[_0x9481('0x9')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x9481('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x9481('0xb')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x9481('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x9481('0x3')],'allowNull':![],'defaultValue':_0x9481('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x9481('0x3')]},'titleFontSize':{'type':Sequelize[_0x9481('0xb')],'defaultValue':0xc}}; \ No newline at end of file +var _0xbd51=['setDataValue','INTEGER','#ffffff','#2196f3','sequelize','lodash','exports','STRING','attrs','stringify'];(function(_0x50f87d,_0x4bdf62){var _0x265cae=function(_0x297a66){while(--_0x297a66){_0x50f87d['push'](_0x50f87d['shift']());}};_0x265cae(++_0x4bdf62);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x35b57e,_0x3c9998){_0x35b57e=_0x35b57e-0x0;var _0xafbdb1=_0xbd51[_0x35b57e];return _0xafbdb1;};'use strict';var Sequelize=require(_0x1bd5('0x0'));var squel=require('squel');var _=require(_0x1bd5('0x1'));module[_0x1bd5('0x2')]={'title':{'type':Sequelize[_0x1bd5('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x1bd5('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT']('long'),'get':function(){try{return JSON['parse'](this['getDataValue'](_0x1bd5('0x4')));}catch(_0x362b24){return[];}},'set':function(_0x43e6b6){try{this['setDataValue'](_0x1bd5('0x4'),JSON[_0x1bd5('0x5')](_0x43e6b6));}catch(_0x19077c){this[_0x1bd5('0x6')](_0x1bd5('0x4'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x1bd5('0x7')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x1bd5('0x7')]},'col':{'type':Sequelize[_0x1bd5('0x7')]},'background':{'type':Sequelize[_0x1bd5('0x3')],'allowNull':![],'defaultValue':_0x1bd5('0x8'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x1bd5('0x3')],'allowNull':![],'defaultValue':_0x1bd5('0x9'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0x1bd5('0x7')],'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 e68213e..8d12379 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 _0x6ec2=['attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrSmsAccounts','attrOpenchannelAccounts','web-report','attrReport','reportType','type','attrRefresh','error','widgetAttributes:\x20%s','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','json','limit','undefined','offset','count','set','Content-Range','reject','save','update','then','destroy','stack','name','show','params','keys','rawAttributes','query','intersection','model','attributes','length','includeAll','merge','options','DashboardItem','find','catch','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts'];(function(_0x7ad065,_0x3b9005){var _0x591984=function(_0x4a4e6a){while(--_0x4a4e6a){_0x7ad065['push'](_0x7ad065['shift']());}};_0x591984(++_0x3b9005);}(_0x6ec2,0x78));var _0x26ec=function(_0x421872,_0x3eff1b){_0x421872=_0x421872-0x0;var _0x1e5ab0=_0x6ec2[_0x421872];return _0x1e5ab0;};'use strict';var emlformat=require(_0x26ec('0x0'));var rimraf=require(_0x26ec('0x1'));var zipdir=require(_0x26ec('0x2'));var jsonpatch=require(_0x26ec('0x3'));var rp=require(_0x26ec('0x4'));var moment=require(_0x26ec('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x26ec('0x6'));var util=require(_0x26ec('0x7'));var path=require(_0x26ec('0x8'));var sox=require(_0x26ec('0x9'));var csv=require(_0x26ec('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x26ec('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x26ec('0xc'));var jsforce=require(_0x26ec('0xd'));var deskjs=require(_0x26ec('0xe'));var toCsv=require('to-csv');var querystring=require(_0x26ec('0xf'));var Papa=require('papaparse');var Redis=require(_0x26ec('0x10'));var authService=require(_0x26ec('0x11'));var qs=require(_0x26ec('0x12'));var as=require(_0x26ec('0x13'));var hardwareService=require(_0x26ec('0x14'));var logger=require(_0x26ec('0x15'))(_0x26ec('0x16'));var utils=require(_0x26ec('0x17'));var config=require(_0x26ec('0x18'));var licenseUtil=require(_0x26ec('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x26ec('0x1a')](config[_0x26ec('0x1b')],{'host':_0x26ec('0x1c'),'port':0x18eb});var socket=require(_0x26ec('0x1d'))(new Redis(config[_0x26ec('0x1b')]));require(_0x26ec('0x1e'))[_0x26ec('0x1f')](socket);function respondWithStatusCode(_0x49467a,_0xfe9aa9){_0xfe9aa9=_0xfe9aa9||0xcc;return function(_0x21a743){if(_0x21a743){return _0x49467a[_0x26ec('0x20')](_0xfe9aa9);}return _0x49467a[_0x26ec('0x21')](_0xfe9aa9)['end']();};}function respondWithResult(_0x4d366c,_0x438985){_0x438985=_0x438985||0xc8;return function(_0x127385){if(_0x127385){return _0x4d366c[_0x26ec('0x21')](_0x438985)[_0x26ec('0x22')](_0x127385);}};}function respondWithFilteredResult(_0x49dc68,_0x17282d){return function(_0x176613){if(_0x176613){var _0x50c9de=typeof _0x17282d['offset']==='undefined'&&typeof _0x17282d[_0x26ec('0x23')]===_0x26ec('0x24');var _0x60511e=_0x176613['count'];var _0x4ad50c=_0x50c9de?0x0:_0x17282d[_0x26ec('0x25')];var _0x125fca=_0x50c9de?_0x176613[_0x26ec('0x26')]:_0x17282d[_0x26ec('0x25')]+_0x17282d[_0x26ec('0x23')];var _0xe199f2;if(_0x125fca>=_0x60511e){_0x125fca=_0x60511e;_0xe199f2=0xc8;}else{_0xe199f2=0xce;}_0x49dc68['status'](_0xe199f2);return _0x49dc68[_0x26ec('0x27')](_0x26ec('0x28'),_0x4ad50c+'-'+_0x125fca+'/'+_0x60511e)[_0x26ec('0x22')](_0x176613);}return null;};}function patchUpdates(_0x46f766){return function(_0x2bcf3c){try{jsonpatch['apply'](_0x2bcf3c,_0x46f766,!![]);}catch(_0x5202e6){return BPromise[_0x26ec('0x29')](_0x5202e6);}return _0x2bcf3c[_0x26ec('0x2a')]();};}function saveUpdates(_0x65aea3,_0x50e4e8){return function(_0x480e5d){if(_0x480e5d){return _0x480e5d[_0x26ec('0x2b')](_0x65aea3)[_0x26ec('0x2c')](function(_0x16aba4){return _0x16aba4;});}return null;};}function removeEntity(_0x365fac,_0x4030ea){return function(_0x89bd5f){if(_0x89bd5f){return _0x89bd5f[_0x26ec('0x2d')]()['then'](function(){_0x365fac['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x45509f,_0xddd5fc){return function(_0x352bef){if(!_0x352bef){_0x45509f[_0x26ec('0x20')](0x194);}return _0x352bef;};}function handleError(_0x19e0fc,_0x2fb176){_0x2fb176=_0x2fb176||0x1f4;return function(_0x3268e9){logger['error'](_0x3268e9[_0x26ec('0x2e')]);if(_0x3268e9['name']){delete _0x3268e9[_0x26ec('0x2f')];}_0x19e0fc[_0x26ec('0x21')](_0x2fb176)['send'](_0x3268e9);};}exports[_0x26ec('0x30')]=function(_0x2d30e6,_0x139d24){var _0x18999a={'raw':![],'where':{'id':_0x2d30e6[_0x26ec('0x31')]['id']}},_0x272c40={};_0x272c40['model']=_[_0x26ec('0x32')](db['DashboardItem'][_0x26ec('0x33')]);_0x272c40['query']=_[_0x26ec('0x32')](_0x2d30e6[_0x26ec('0x34')]);_0x272c40['filters']=_[_0x26ec('0x35')](_0x272c40[_0x26ec('0x36')],_0x272c40[_0x26ec('0x34')]);_0x18999a[_0x26ec('0x37')]=_[_0x26ec('0x35')](_0x272c40[_0x26ec('0x36')],qs['fields'](_0x2d30e6['query']['fields']));_0x18999a['attributes']=_0x18999a['attributes'][_0x26ec('0x38')]?_0x18999a[_0x26ec('0x37')]:_0x272c40[_0x26ec('0x36')];if(_0x2d30e6[_0x26ec('0x34')][_0x26ec('0x39')]){_0x18999a['include']=[{'all':!![]}];}_0x18999a=_[_0x26ec('0x3a')]({},_0x18999a,_0x2d30e6[_0x26ec('0x3b')]);return db[_0x26ec('0x3c')][_0x26ec('0x3d')](_0x18999a)[_0x26ec('0x2c')](handleEntityNotFound(_0x139d24,null))['then'](respondWithResult(_0x139d24,null))[_0x26ec('0x3e')](handleError(_0x139d24,null));};exports[_0x26ec('0x2d')]=function(_0x15391c,_0x18a226){return db[_0x26ec('0x3c')][_0x26ec('0x3d')]({'where':{'id':_0x15391c[_0x26ec('0x31')]['id']}})[_0x26ec('0x2c')](handleEntityNotFound(_0x18a226,null))[_0x26ec('0x2c')](removeEntity(_0x18a226,null))[_0x26ec('0x3e')](handleError(_0x18a226,null));};function widgetAttributes(_0x48d7cf){try{switch(_0x48d7cf['type']){case _0x26ec('0x3f'):return[{'name':_0x26ec('0x40'),'value':_0x48d7cf['attrUrl']||(_0x48d7cf[_0x26ec('0x41')]&&_0x48d7cf['attrs'][0x0]?_0x48d7cf[_0x26ec('0x41')][0x0][_0x26ec('0x42')]:undefined)||_0x26ec('0x43')}];case _0x26ec('0x44'):return[{'name':_0x26ec('0x45'),'value':_0x48d7cf[_0x26ec('0x45')]||(_0x48d7cf['attrs']&&_0x48d7cf[_0x26ec('0x41')][0x0]?_0x48d7cf[_0x26ec('0x41')][0x0][_0x26ec('0x42')]:undefined)||''}];case _0x26ec('0x46'):return[{'name':_0x26ec('0x47'),'value':_0x48d7cf[_0x26ec('0x47')]||(_0x48d7cf[_0x26ec('0x41')]&&_0x48d7cf[_0x26ec('0x41')][0x0]?_0x48d7cf[_0x26ec('0x41')][0x0][_0x26ec('0x42')]:undefined)||_0x26ec('0x48')},{'name':_0x26ec('0x49'),'value':_0x48d7cf[_0x26ec('0x49')]||(_0x48d7cf[_0x26ec('0x41')]&&_0x48d7cf[_0x26ec('0x41')][0x1]?_0x48d7cf['attrs'][0x1][_0x26ec('0x42')]:undefined)||_0x26ec('0x4a')},{'name':_0x26ec('0x4b'),'value':_0x48d7cf[_0x26ec('0x4b')]||(_0x48d7cf[_0x26ec('0x41')]&&_0x48d7cf[_0x26ec('0x41')][0x2]?_0x48d7cf['attrs'][0x2]['value']:undefined)||0xc}];case _0x26ec('0x4c'):return[{'name':'attrMetric','value':_0x48d7cf[_0x26ec('0x4d')]||(_0x48d7cf[_0x26ec('0x41')]&&_0x48d7cf[_0x26ec('0x41')][0x0]?_0x48d7cf[_0x26ec('0x41')][0x0][_0x26ec('0x42')]:undefined)||_0x26ec('0x4e')},{'name':_0x26ec('0x4f'),'value':_0x48d7cf[_0x26ec('0x4f')]||(_0x48d7cf['attrs']&&_0x48d7cf[_0x26ec('0x41')][0x1]?_0x48d7cf[_0x26ec('0x41')][0x1][_0x26ec('0x42')]:undefined)||[]},{'name':'attrFontSize','value':_0x48d7cf[_0x26ec('0x4b')]||(_0x48d7cf[_0x26ec('0x41')]&&_0x48d7cf[_0x26ec('0x41')][0x2]?_0x48d7cf[_0x26ec('0x41')][0x2][_0x26ec('0x42')]:undefined)||0x14},{'name':_0x26ec('0x50'),'value':_0x48d7cf[_0x26ec('0x50')]||(_0x48d7cf[_0x26ec('0x41')]&&_0x48d7cf[_0x26ec('0x41')][0x3]?_0x48d7cf[_0x26ec('0x41')][0x3][_0x26ec('0x42')]:undefined)||_0x26ec('0x51')},{'name':_0x26ec('0x52'),'value':_0x48d7cf[_0x26ec('0x52')]||(_0x48d7cf['attrs']&&_0x48d7cf['attrs'][0x4]?_0x48d7cf[_0x26ec('0x41')][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x48d7cf[_0x26ec('0x53')]||(_0x48d7cf[_0x26ec('0x41')]&&_0x48d7cf[_0x26ec('0x41')][0x5]?_0x48d7cf['attrs'][0x5]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x48d7cf['attrSmsAccounts']||(_0x48d7cf[_0x26ec('0x41')]&&_0x48d7cf['attrs'][0x6]?_0x48d7cf[_0x26ec('0x41')][0x6][_0x26ec('0x42')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x48d7cf['attrOpenchannelAccounts']||(_0x48d7cf[_0x26ec('0x41')]&&_0x48d7cf[_0x26ec('0x41')][0x7]?_0x48d7cf['attrs'][0x7][_0x26ec('0x42')]:undefined)||''},{'name':_0x26ec('0x54'),'value':_0x48d7cf['attrWhatsappAccounts']||(_0x48d7cf['attrs']&&_0x48d7cf[_0x26ec('0x41')][0x8]?_0x48d7cf[_0x26ec('0x41')][0x8][_0x26ec('0x42')]:undefined)||''},{'name':'attrChatWebsites','value':_0x48d7cf[_0x26ec('0x55')]||(_0x48d7cf['attrs']&&_0x48d7cf[_0x26ec('0x41')][0x9]?_0x48d7cf[_0x26ec('0x41')][0x9][_0x26ec('0x42')]:undefined)||''}];case _0x26ec('0x56'):case _0x26ec('0x57'):return[{'name':_0x26ec('0x58'),'value':_0x48d7cf['attrSerie1']||(_0x48d7cf[_0x26ec('0x41')]&&_0x48d7cf[_0x26ec('0x41')][0x0]?_0x48d7cf['attrs'][0x0][_0x26ec('0x42')]:undefined)||_0x26ec('0x4e')},{'name':'attrSerie2','value':_0x48d7cf[_0x26ec('0x59')]||(_0x48d7cf['attrs']&&_0x48d7cf['attrs'][0x1]?_0x48d7cf[_0x26ec('0x41')][0x1][_0x26ec('0x42')]:undefined)||null},{'name':_0x26ec('0x5a'),'value':_0x48d7cf['attrSerie3']||(_0x48d7cf['attrs']&&_0x48d7cf[_0x26ec('0x41')][0x2]?_0x48d7cf[_0x26ec('0x41')][0x2][_0x26ec('0x42')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x48d7cf[_0x26ec('0x4f')]||(_0x48d7cf[_0x26ec('0x41')]&&_0x48d7cf['attrs'][0x3]?_0x48d7cf['attrs'][0x3][_0x26ec('0x42')]:undefined)||[]},{'name':'attrChannel','value':_0x48d7cf[_0x26ec('0x50')]||(_0x48d7cf[_0x26ec('0x41')]&&_0x48d7cf[_0x26ec('0x41')][0x4]?_0x48d7cf[_0x26ec('0x41')][0x4]['value']:undefined)||'voice'},{'name':_0x26ec('0x52'),'value':_0x48d7cf[_0x26ec('0x52')]||(_0x48d7cf[_0x26ec('0x41')]&&_0x48d7cf[_0x26ec('0x41')][0x5]?_0x48d7cf[_0x26ec('0x41')][0x5][_0x26ec('0x42')]:undefined)||''},{'name':_0x26ec('0x53'),'value':_0x48d7cf['attrFaxAccounts']||(_0x48d7cf[_0x26ec('0x41')]&&_0x48d7cf[_0x26ec('0x41')][0x6]?_0x48d7cf[_0x26ec('0x41')][0x6][_0x26ec('0x42')]:undefined)||''},{'name':_0x26ec('0x5b'),'value':_0x48d7cf[_0x26ec('0x5b')]||(_0x48d7cf[_0x26ec('0x41')]&&_0x48d7cf['attrs'][0x7]?_0x48d7cf[_0x26ec('0x41')][0x7][_0x26ec('0x42')]:undefined)||''},{'name':_0x26ec('0x5c'),'value':_0x48d7cf[_0x26ec('0x5c')]||(_0x48d7cf['attrs']&&_0x48d7cf[_0x26ec('0x41')][0x8]?_0x48d7cf[_0x26ec('0x41')][0x8]['value']:undefined)||''},{'name':_0x26ec('0x54'),'value':_0x48d7cf[_0x26ec('0x54')]||(_0x48d7cf[_0x26ec('0x41')]&&_0x48d7cf[_0x26ec('0x41')][0x9]?_0x48d7cf[_0x26ec('0x41')][0x9][_0x26ec('0x42')]:undefined)||''},{'name':_0x26ec('0x55'),'value':_0x48d7cf['attrChatWebsites']||(_0x48d7cf[_0x26ec('0x41')]&&_0x48d7cf[_0x26ec('0x41')][0xa]?_0x48d7cf['attrs'][0xa][_0x26ec('0x42')]:undefined)||''}];case _0x26ec('0x5d'):return[{'name':_0x26ec('0x5e'),'type':_0x48d7cf[_0x26ec('0x5f')]||(_0x48d7cf[_0x26ec('0x41')]&&_0x48d7cf[_0x26ec('0x41')][0x0]?_0x48d7cf[_0x26ec('0x41')][0x0][_0x26ec('0x60')]:undefined)||null,'value':_0x48d7cf[_0x26ec('0x5e')]||(_0x48d7cf[_0x26ec('0x41')]&&_0x48d7cf[_0x26ec('0x41')][0x0]?_0x48d7cf[_0x26ec('0x41')][0x0][_0x26ec('0x42')]:undefined)||null},{'name':_0x26ec('0x61'),'value':_0x48d7cf[_0x26ec('0x61')]||(_0x48d7cf['attrs']&&_0x48d7cf['attrs'][0x1]?_0x48d7cf['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x263bce){logger[_0x26ec('0x62')](_0x26ec('0x63'),JSON['stringify'](_0x263bce));return[];}}exports[_0x26ec('0x64')]=function(_0x57960c,_0x414be5){if(_0x57960c[_0x26ec('0x65')]){_0x57960c[_0x26ec('0x65')]['attrs']=widgetAttributes(_0x57960c[_0x26ec('0x65')]);}return db[_0x26ec('0x3c')][_0x26ec('0x64')](_0x57960c[_0x26ec('0x65')],{})[_0x26ec('0x2c')](respondWithResult(_0x414be5,0xc9))['catch'](handleError(_0x414be5,null));};exports[_0x26ec('0x2b')]=function(_0x311b55,_0x50e74b){if(_0x311b55[_0x26ec('0x65')]['id']){delete _0x311b55[_0x26ec('0x65')]['id'];}_0x311b55[_0x26ec('0x65')]['attrs']=widgetAttributes(_0x311b55[_0x26ec('0x65')]);return db[_0x26ec('0x3c')][_0x26ec('0x3d')]({'where':{'id':_0x311b55[_0x26ec('0x31')]['id']}})[_0x26ec('0x2c')](handleEntityNotFound(_0x50e74b,null))[_0x26ec('0x2c')](saveUpdates(_0x311b55[_0x26ec('0x65')],null))[_0x26ec('0x2c')](respondWithResult(_0x50e74b,null))[_0x26ec('0x3e')](handleError(_0x50e74b,null));}; \ No newline at end of file +var _0xb76d=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','show','params','model','DashboardItem','rawAttributes','query','keys','intersection','fields','attributes','length','includeAll','include','merge','find','catch','type','iframe','attrUrl','attrs','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','value','counter','attrMetric','total','attrVoiceQueues','attrFontSize','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x378fa0,_0x31a420){var _0x2b7056=function(_0x1e193e){while(--_0x1e193e){_0x378fa0['push'](_0x378fa0['shift']());}};_0x2b7056(++_0x31a420);}(_0xb76d,0x119));var _0xdb76=function(_0x2379ab,_0x319275){_0x2379ab=_0x2379ab-0x0;var _0x3c5c87=_0xb76d[_0x2379ab];return _0x3c5c87;};'use strict';var emlformat=require(_0xdb76('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdb76('0x1'));var jsonpatch=require(_0xdb76('0x2'));var rp=require(_0xdb76('0x3'));var moment=require('moment');var BPromise=require(_0xdb76('0x4'));var Mustache=require(_0xdb76('0x5'));var util=require(_0xdb76('0x6'));var path=require(_0xdb76('0x7'));var sox=require(_0xdb76('0x8'));var csv=require(_0xdb76('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdb76('0xa'));var _=require(_0xdb76('0xb'));var squel=require(_0xdb76('0xc'));var crypto=require(_0xdb76('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xdb76('0xe'));var toCsv=require(_0xdb76('0x9'));var querystring=require('querystring');var Papa=require(_0xdb76('0xf'));var Redis=require(_0xdb76('0x10'));var authService=require(_0xdb76('0x11'));var qs=require(_0xdb76('0x12'));var as=require(_0xdb76('0x13'));var hardwareService=require(_0xdb76('0x14'));var logger=require(_0xdb76('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xdb76('0x16'));var licenseUtil=require(_0xdb76('0x17'));var db=require(_0xdb76('0x18'))['db'];config['redis']=_['defaults'](config[_0xdb76('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xdb76('0x1a'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0xdb76('0x1b')](socket);function respondWithStatusCode(_0x28d3a5,_0x1196fb){_0x1196fb=_0x1196fb||0xcc;return function(_0x8d2de2){if(_0x8d2de2){return _0x28d3a5['sendStatus'](_0x1196fb);}return _0x28d3a5[_0xdb76('0x1c')](_0x1196fb)[_0xdb76('0x1d')]();};}function respondWithResult(_0x5a1017,_0x385416){_0x385416=_0x385416||0xc8;return function(_0x1a61cf){if(_0x1a61cf){return _0x5a1017[_0xdb76('0x1c')](_0x385416)[_0xdb76('0x1e')](_0x1a61cf);}};}function respondWithFilteredResult(_0x388fb0,_0x1e3c5e){return function(_0x557649){if(_0x557649){var _0x175567=typeof _0x1e3c5e[_0xdb76('0x1f')]===_0xdb76('0x20')&&typeof _0x1e3c5e['limit']===_0xdb76('0x20');var _0xf06f1c=_0x557649[_0xdb76('0x21')];var _0x5921d4=_0x175567?0x0:_0x1e3c5e[_0xdb76('0x1f')];var _0x3984e2=_0x175567?_0x557649[_0xdb76('0x21')]:_0x1e3c5e[_0xdb76('0x1f')]+_0x1e3c5e[_0xdb76('0x22')];var _0xa574d4;if(_0x3984e2>=_0xf06f1c){_0x3984e2=_0xf06f1c;_0xa574d4=0xc8;}else{_0xa574d4=0xce;}_0x388fb0[_0xdb76('0x1c')](_0xa574d4);return _0x388fb0[_0xdb76('0x23')](_0xdb76('0x24'),_0x5921d4+'-'+_0x3984e2+'/'+_0xf06f1c)[_0xdb76('0x1e')](_0x557649);}return null;};}function patchUpdates(_0x3718e1){return function(_0x1b1f71){try{jsonpatch[_0xdb76('0x25')](_0x1b1f71,_0x3718e1,!![]);}catch(_0x560433){return BPromise[_0xdb76('0x26')](_0x560433);}return _0x1b1f71['save']();};}function saveUpdates(_0x12f479,_0x2290ed){return function(_0x4504eb){if(_0x4504eb){return _0x4504eb[_0xdb76('0x27')](_0x12f479)[_0xdb76('0x28')](function(_0x25d904){return _0x25d904;});}return null;};}function removeEntity(_0xec9e4b,_0x168dc4){return function(_0x3de9ad){if(_0x3de9ad){return _0x3de9ad[_0xdb76('0x29')]()[_0xdb76('0x28')](function(){_0xec9e4b['status'](0xcc)[_0xdb76('0x1d')]();});}};}function handleEntityNotFound(_0x57549a,_0x295317){return function(_0x25d034){if(!_0x25d034){_0x57549a[_0xdb76('0x2a')](0x194);}return _0x25d034;};}function handleError(_0x55d8c4,_0x5960cb){_0x5960cb=_0x5960cb||0x1f4;return function(_0x1ffce7){logger[_0xdb76('0x2b')](_0x1ffce7[_0xdb76('0x2c')]);if(_0x1ffce7['name']){delete _0x1ffce7[_0xdb76('0x2d')];}_0x55d8c4[_0xdb76('0x1c')](_0x5960cb)[_0xdb76('0x2e')](_0x1ffce7);};}exports[_0xdb76('0x2f')]=function(_0x296ec5,_0x13b7a0){var _0x1f152d={'raw':![],'where':{'id':_0x296ec5[_0xdb76('0x30')]['id']}},_0x12c9b9={};_0x12c9b9[_0xdb76('0x31')]=_['keys'](db[_0xdb76('0x32')][_0xdb76('0x33')]);_0x12c9b9[_0xdb76('0x34')]=_[_0xdb76('0x35')](_0x296ec5['query']);_0x12c9b9['filters']=_[_0xdb76('0x36')](_0x12c9b9[_0xdb76('0x31')],_0x12c9b9[_0xdb76('0x34')]);_0x1f152d['attributes']=_['intersection'](_0x12c9b9[_0xdb76('0x31')],qs['fields'](_0x296ec5['query'][_0xdb76('0x37')]));_0x1f152d[_0xdb76('0x38')]=_0x1f152d[_0xdb76('0x38')][_0xdb76('0x39')]?_0x1f152d[_0xdb76('0x38')]:_0x12c9b9['model'];if(_0x296ec5['query'][_0xdb76('0x3a')]){_0x1f152d[_0xdb76('0x3b')]=[{'all':!![]}];}_0x1f152d=_[_0xdb76('0x3c')]({},_0x1f152d,_0x296ec5['options']);return db['DashboardItem'][_0xdb76('0x3d')](_0x1f152d)[_0xdb76('0x28')](handleEntityNotFound(_0x13b7a0,null))[_0xdb76('0x28')](respondWithResult(_0x13b7a0,null))[_0xdb76('0x3e')](handleError(_0x13b7a0,null));};exports[_0xdb76('0x29')]=function(_0x12d52d,_0x271220){return db[_0xdb76('0x32')][_0xdb76('0x3d')]({'where':{'id':_0x12d52d['params']['id']}})[_0xdb76('0x28')](handleEntityNotFound(_0x271220,null))[_0xdb76('0x28')](removeEntity(_0x271220,null))['catch'](handleError(_0x271220,null));};function widgetAttributes(_0x14c994){try{switch(_0x14c994[_0xdb76('0x3f')]){case _0xdb76('0x40'):return[{'name':_0xdb76('0x41'),'value':_0x14c994[_0xdb76('0x41')]||(_0x14c994[_0xdb76('0x42')]&&_0x14c994[_0xdb76('0x42')][0x0]?_0x14c994['attrs'][0x0]['value']:undefined)||_0xdb76('0x43')}];case _0xdb76('0x44'):return[{'name':'attrPath','value':_0x14c994[_0xdb76('0x45')]||(_0x14c994['attrs']&&_0x14c994[_0xdb76('0x42')][0x0]?_0x14c994[_0xdb76('0x42')][0x0]['value']:undefined)||''}];case _0xdb76('0x46'):return[{'name':_0xdb76('0x47'),'value':_0x14c994[_0xdb76('0x47')]||(_0x14c994[_0xdb76('0x42')]&&_0x14c994[_0xdb76('0x42')][0x0]?_0x14c994[_0xdb76('0x42')][0x0]['value']:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x14c994[_0xdb76('0x48')]||(_0x14c994[_0xdb76('0x42')]&&_0x14c994[_0xdb76('0x42')][0x1]?_0x14c994['attrs'][0x1]['value']:undefined)||_0xdb76('0x49')},{'name':'attrFontSize','value':_0x14c994['attrFontSize']||(_0x14c994['attrs']&&_0x14c994[_0xdb76('0x42')][0x2]?_0x14c994[_0xdb76('0x42')][0x2][_0xdb76('0x4a')]:undefined)||0xc}];case _0xdb76('0x4b'):return[{'name':'attrMetric','value':_0x14c994[_0xdb76('0x4c')]||(_0x14c994[_0xdb76('0x42')]&&_0x14c994[_0xdb76('0x42')][0x0]?_0x14c994['attrs'][0x0]['value']:undefined)||_0xdb76('0x4d')},{'name':_0xdb76('0x4e'),'value':_0x14c994[_0xdb76('0x4e')]||(_0x14c994['attrs']&&_0x14c994['attrs'][0x1]?_0x14c994[_0xdb76('0x42')][0x1][_0xdb76('0x4a')]:undefined)||[]},{'name':_0xdb76('0x4f'),'value':_0x14c994[_0xdb76('0x4f')]||(_0x14c994[_0xdb76('0x42')]&&_0x14c994[_0xdb76('0x42')][0x2]?_0x14c994[_0xdb76('0x42')][0x2]['value']:undefined)||0x14},{'name':_0xdb76('0x50'),'value':_0x14c994['attrChannel']||(_0x14c994[_0xdb76('0x42')]&&_0x14c994[_0xdb76('0x42')][0x3]?_0x14c994[_0xdb76('0x42')][0x3]['value']:undefined)||_0xdb76('0x51')},{'name':_0xdb76('0x52'),'value':_0x14c994['attrEmailAccounts']||(_0x14c994['attrs']&&_0x14c994[_0xdb76('0x42')][0x4]?_0x14c994[_0xdb76('0x42')][0x4][_0xdb76('0x4a')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x14c994[_0xdb76('0x53')]||(_0x14c994[_0xdb76('0x42')]&&_0x14c994[_0xdb76('0x42')][0x5]?_0x14c994['attrs'][0x5][_0xdb76('0x4a')]:undefined)||''},{'name':_0xdb76('0x54'),'value':_0x14c994[_0xdb76('0x54')]||(_0x14c994[_0xdb76('0x42')]&&_0x14c994[_0xdb76('0x42')][0x6]?_0x14c994['attrs'][0x6][_0xdb76('0x4a')]:undefined)||''},{'name':_0xdb76('0x55'),'value':_0x14c994[_0xdb76('0x55')]||(_0x14c994[_0xdb76('0x42')]&&_0x14c994[_0xdb76('0x42')][0x7]?_0x14c994['attrs'][0x7][_0xdb76('0x4a')]:undefined)||''},{'name':_0xdb76('0x56'),'value':_0x14c994[_0xdb76('0x56')]||(_0x14c994[_0xdb76('0x42')]&&_0x14c994[_0xdb76('0x42')][0x8]?_0x14c994[_0xdb76('0x42')][0x8]['value']:undefined)||''},{'name':_0xdb76('0x57'),'value':_0x14c994[_0xdb76('0x57')]||(_0x14c994[_0xdb76('0x42')]&&_0x14c994[_0xdb76('0x42')][0x9]?_0x14c994[_0xdb76('0x42')][0x9][_0xdb76('0x4a')]:undefined)||''}];case _0xdb76('0x58'):case _0xdb76('0x59'):return[{'name':_0xdb76('0x5a'),'value':_0x14c994[_0xdb76('0x5a')]||(_0x14c994[_0xdb76('0x42')]&&_0x14c994[_0xdb76('0x42')][0x0]?_0x14c994[_0xdb76('0x42')][0x0]['value']:undefined)||_0xdb76('0x4d')},{'name':_0xdb76('0x5b'),'value':_0x14c994[_0xdb76('0x5b')]||(_0x14c994['attrs']&&_0x14c994[_0xdb76('0x42')][0x1]?_0x14c994['attrs'][0x1]['value']:undefined)||null},{'name':_0xdb76('0x5c'),'value':_0x14c994[_0xdb76('0x5c')]||(_0x14c994['attrs']&&_0x14c994[_0xdb76('0x42')][0x2]?_0x14c994[_0xdb76('0x42')][0x2]['value']:undefined)||null},{'name':_0xdb76('0x4e'),'value':_0x14c994['attrVoiceQueues']||(_0x14c994[_0xdb76('0x42')]&&_0x14c994[_0xdb76('0x42')][0x3]?_0x14c994[_0xdb76('0x42')][0x3][_0xdb76('0x4a')]:undefined)||[]},{'name':_0xdb76('0x50'),'value':_0x14c994['attrChannel']||(_0x14c994[_0xdb76('0x42')]&&_0x14c994[_0xdb76('0x42')][0x4]?_0x14c994[_0xdb76('0x42')][0x4][_0xdb76('0x4a')]:undefined)||'voice'},{'name':_0xdb76('0x52'),'value':_0x14c994[_0xdb76('0x52')]||(_0x14c994['attrs']&&_0x14c994[_0xdb76('0x42')][0x5]?_0x14c994[_0xdb76('0x42')][0x5][_0xdb76('0x4a')]:undefined)||''},{'name':_0xdb76('0x53'),'value':_0x14c994[_0xdb76('0x53')]||(_0x14c994[_0xdb76('0x42')]&&_0x14c994['attrs'][0x6]?_0x14c994[_0xdb76('0x42')][0x6]['value']:undefined)||''},{'name':_0xdb76('0x54'),'value':_0x14c994[_0xdb76('0x54')]||(_0x14c994['attrs']&&_0x14c994[_0xdb76('0x42')][0x7]?_0x14c994['attrs'][0x7][_0xdb76('0x4a')]:undefined)||''},{'name':_0xdb76('0x55'),'value':_0x14c994[_0xdb76('0x55')]||(_0x14c994[_0xdb76('0x42')]&&_0x14c994[_0xdb76('0x42')][0x8]?_0x14c994[_0xdb76('0x42')][0x8]['value']:undefined)||''},{'name':_0xdb76('0x56'),'value':_0x14c994['attrWhatsappAccounts']||(_0x14c994[_0xdb76('0x42')]&&_0x14c994[_0xdb76('0x42')][0x9]?_0x14c994[_0xdb76('0x42')][0x9][_0xdb76('0x4a')]:undefined)||''},{'name':_0xdb76('0x57'),'value':_0x14c994[_0xdb76('0x57')]||(_0x14c994['attrs']&&_0x14c994[_0xdb76('0x42')][0xa]?_0x14c994['attrs'][0xa]['value']:undefined)||''}];case _0xdb76('0x5d'):return[{'name':_0xdb76('0x5e'),'type':_0x14c994[_0xdb76('0x5f')]||(_0x14c994[_0xdb76('0x42')]&&_0x14c994[_0xdb76('0x42')][0x0]?_0x14c994[_0xdb76('0x42')][0x0][_0xdb76('0x3f')]:undefined)||null,'value':_0x14c994['attrReport']||(_0x14c994[_0xdb76('0x42')]&&_0x14c994['attrs'][0x0]?_0x14c994[_0xdb76('0x42')][0x0]['value']:undefined)||null},{'name':_0xdb76('0x60'),'value':_0x14c994[_0xdb76('0x60')]||(_0x14c994[_0xdb76('0x42')]&&_0x14c994['attrs'][0x1]?_0x14c994[_0xdb76('0x42')][0x1][_0xdb76('0x4a')]:undefined)||0x0}];default:return[];}}catch(_0x53cf26){logger[_0xdb76('0x2b')](_0xdb76('0x61'),JSON['stringify'](_0x53cf26));return[];}}exports[_0xdb76('0x62')]=function(_0x5460f3,_0x16b40b){if(_0x5460f3[_0xdb76('0x63')]){_0x5460f3[_0xdb76('0x63')]['attrs']=widgetAttributes(_0x5460f3[_0xdb76('0x63')]);}return db[_0xdb76('0x32')]['create'](_0x5460f3[_0xdb76('0x63')],{})[_0xdb76('0x28')](respondWithResult(_0x16b40b,0xc9))['catch'](handleError(_0x16b40b,null));};exports['update']=function(_0x5dbf84,_0x3ccb95){if(_0x5dbf84[_0xdb76('0x63')]['id']){delete _0x5dbf84['body']['id'];}_0x5dbf84['body']['attrs']=widgetAttributes(_0x5dbf84['body']);return db[_0xdb76('0x32')][_0xdb76('0x3d')]({'where':{'id':_0x5dbf84['params']['id']}})[_0xdb76('0x28')](handleEntityNotFound(_0x3ccb95,null))[_0xdb76('0x28')](saveUpdates(_0x5dbf84[_0xdb76('0x63')],null))[_0xdb76('0x28')](respondWithResult(_0x3ccb95,null))[_0xdb76('0x3e')](handleError(_0x3ccb95,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index e56c8f1..6b2e4c4 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 _0xfcf9=['hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x554611,_0x11ced4){var _0x4fbc11=function(_0x5e34d5){while(--_0x5e34d5){_0x554611['push'](_0x554611['shift']());}};_0x4fbc11(++_0x11ced4);}(_0xfcf9,0xc8));var _0x9fcf=function(_0x42496b,_0x336459){_0x42496b=_0x42496b-0x0;var _0x41f015=_0xfcf9[_0x42496b];return _0x41f015;};'use strict';var EventEmitter=require(_0x9fcf('0x0'));var DashboardItem=require(_0x9fcf('0x1'))['db'][_0x9fcf('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x9fcf('0x3')](0x0);var events={'afterCreate':_0x9fcf('0x4'),'afterUpdate':_0x9fcf('0x5'),'afterDestroy':_0x9fcf('0x6')};function emitEvent(_0x4e747b){return function(_0x475d4b,_0x2eb5f2,_0x5e4f68){DashboardItemEvents[_0x9fcf('0x7')](_0x4e747b+':'+_0x475d4b['id'],_0x475d4b);DashboardItemEvents[_0x9fcf('0x7')](_0x4e747b,_0x475d4b);_0x5e4f68(null);};}for(var e in events){if(events[_0x9fcf('0x8')](e)){var event=events[e];DashboardItem[_0x9fcf('0x9')](e,emitEvent(event));}}module[_0x9fcf('0xa')]=DashboardItemEvents; \ No newline at end of file +var _0xbca0=['../../mysqldb','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x3a1961,_0x49061f){var _0xd2cfd0=function(_0x2a8711){while(--_0x2a8711){_0x3a1961['push'](_0x3a1961['shift']());}};_0xd2cfd0(++_0x49061f);}(_0xbca0,0x8b));var _0x0bca=function(_0x3aa560,_0x4a0351){_0x3aa560=_0x3aa560-0x0;var _0x4530e2=_0xbca0[_0x3aa560];return _0x4530e2;};'use strict';var EventEmitter=require(_0x0bca('0x0'));var DashboardItem=require(_0x0bca('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x0bca('0x2'),'afterDestroy':_0x0bca('0x3')};function emitEvent(_0x3ce28e){return function(_0x1a6cb5,_0x595711,_0x494f51){DashboardItemEvents[_0x0bca('0x4')](_0x3ce28e+':'+_0x1a6cb5['id'],_0x1a6cb5);DashboardItemEvents[_0x0bca('0x4')](_0x3ce28e,_0x1a6cb5);_0x494f51(null);};}for(var e in events){if(events[_0x0bca('0x5')](e)){var event=events[e];DashboardItem[_0x0bca('0x6')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 914c01b..af97b06 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 _0xb31a=['define','dashboard_items','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports'];(function(_0x4c7192,_0x526e25){var _0x113a26=function(_0x5ee384){while(--_0x5ee384){_0x4c7192['push'](_0x4c7192['shift']());}};_0x113a26(++_0x526e25);}(_0xb31a,0xd4));var _0xab31=function(_0x467a76,_0x1c1058){_0x467a76=_0x467a76-0x0;var _0x5773b7=_0xb31a[_0x467a76];return _0x5773b7;};'use strict';var _=require(_0xab31('0x0'));var util=require(_0xab31('0x1'));var logger=require(_0xab31('0x2'))(_0xab31('0x3'));var moment=require(_0xab31('0x4'));var BPromise=require(_0xab31('0x5'));var rp=require(_0xab31('0x6'));var fs=require('fs');var path=require(_0xab31('0x7'));var rimraf=require(_0xab31('0x8'));var config=require(_0xab31('0x9'));var attributes=require(_0xab31('0xa'));module[_0xab31('0xb')]=function(_0x9c6740,_0x2c336b){return _0x9c6740[_0xab31('0xc')]('DashboardItem',attributes,{'tableName':_0xab31('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf429=['define','DashboardItem','dashboard_items','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./dashboardItem.attributes'];(function(_0x2b05c6,_0x3de96e){var _0x136811=function(_0x441478){while(--_0x441478){_0x2b05c6['push'](_0x2b05c6['shift']());}};_0x136811(++_0x3de96e);}(_0xf429,0xd4));var _0x9f42=function(_0x1a1460,_0x539531){_0x1a1460=_0x1a1460-0x0;var _0x33ab03=_0xf429[_0x1a1460];return _0x33ab03;};'use strict';var _=require('lodash');var util=require(_0x9f42('0x0'));var logger=require(_0x9f42('0x1'))(_0x9f42('0x2'));var moment=require('moment');var BPromise=require(_0x9f42('0x3'));var rp=require(_0x9f42('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9f42('0x5'));var config=require(_0x9f42('0x6'));var attributes=require(_0x9f42('0x7'));module['exports']=function(_0x4d3ea7,_0x874a2b){return _0x4d3ea7[_0x9f42('0x8')](_0x9f42('0x9'),attributes,{'tableName':_0x9f42('0xa'),'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 7f2cfa5..2db7b01 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 _0x39fb=['info','DashboardItem,\x20%s,\x20%s','debug','stringify','error','message','request\x20sent','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','./dashboardItem.socket','register','request','then'];(function(_0x94bc1f,_0x1a3927){var _0x28f8e2=function(_0x511435){while(--_0x511435){_0x94bc1f['push'](_0x94bc1f['shift']());}};_0x28f8e2(++_0x1a3927);}(_0x39fb,0x1d0));var _0xb39f=function(_0x1e9827,_0x4c26e6){_0x1e9827=_0x1e9827-0x0;var _0x84e342=_0x39fb[_0x1e9827];return _0x84e342;};'use strict';var _=require(_0xb39f('0x0'));var util=require(_0xb39f('0x1'));var moment=require(_0xb39f('0x2'));var BPromise=require(_0xb39f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb39f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb39f('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xb39f('0x6'));var jayson=require(_0xb39f('0x7'));var client=jayson[_0xb39f('0x8')][_0xb39f('0x9')]({'port':0x232a});config[_0xb39f('0xa')]=_['defaults'](config[_0xb39f('0xa')],{'host':_0xb39f('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb39f('0xa')]));require(_0xb39f('0xc'))[_0xb39f('0xd')](socket);function respondWithRpcPromise(_0x5497a1,_0xa62f7,_0x497da3){return new BPromise(function(_0x212f21,_0x11a348){return client[_0xb39f('0xe')](_0x5497a1,_0x497da3)[_0xb39f('0xf')](function(_0x15e93c){logger[_0xb39f('0x10')](_0xb39f('0x11'),_0xa62f7,'request\x20sent');logger[_0xb39f('0x12')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0xa62f7,'request\x20sent',JSON[_0xb39f('0x13')](_0x15e93c));if(_0x15e93c[_0xb39f('0x14')]){if(_0x15e93c[_0xb39f('0x14')]['code']===0x1f4){logger[_0xb39f('0x14')]('DashboardItem,\x20%s,\x20%s',_0xa62f7,_0x15e93c[_0xb39f('0x14')][_0xb39f('0x15')]);return _0x11a348(_0x15e93c[_0xb39f('0x14')][_0xb39f('0x15')]);}logger[_0xb39f('0x14')]('DashboardItem,\x20%s,\x20%s',_0xa62f7,_0x15e93c['error']['message']);return _0x212f21(_0x15e93c['error'][_0xb39f('0x15')]);}else{logger[_0xb39f('0x10')](_0xb39f('0x11'),_0xa62f7,_0xb39f('0x16'));_0x212f21(_0x15e93c[_0xb39f('0x17')][_0xb39f('0x15')]);}})['catch'](function(_0x1fd6ff){logger[_0xb39f('0x14')](_0xb39f('0x11'),_0xa62f7,_0x1fd6ff);_0x11a348(_0x1fd6ff);});});} \ No newline at end of file +var _0x6218=['DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','defaults','localhost','socket.io-emitter','redis','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x6218,0xcb));var _0x8621=function(_0x44c844,_0x1e3d7d){_0x44c844=_0x44c844-0x0;var _0x1d51b7=_0x6218[_0x44c844];return _0x1d51b7;};'use strict';var _=require('lodash');var util=require(_0x8621('0x0'));var moment=require(_0x8621('0x1'));var BPromise=require('bluebird');var rs=require(_0x8621('0x2'));var fs=require('fs');var Redis=require(_0x8621('0x3'));var db=require(_0x8621('0x4'))['db'];var utils=require(_0x8621('0x5'));var logger=require(_0x8621('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8621('0x7'));var client=jayson[_0x8621('0x8')]['http']({'port':0x232a});config['redis']=_[_0x8621('0x9')](config['redis'],{'host':_0x8621('0xa'),'port':0x18eb});var socket=require(_0x8621('0xb'))(new Redis(config[_0x8621('0xc')]));require(_0x8621('0xd'))[_0x8621('0xe')](socket);function respondWithRpcPromise(_0x2e2a23,_0x1314f4,_0x44fa17){return new BPromise(function(_0x2bd6e3,_0x2e8cda){return client[_0x8621('0xf')](_0x2e2a23,_0x44fa17)[_0x8621('0x10')](function(_0x9fcd2b){logger[_0x8621('0x11')](_0x8621('0x12'),_0x1314f4,_0x8621('0x13'));logger[_0x8621('0x14')](_0x8621('0x15'),_0x1314f4,'request\x20sent',JSON[_0x8621('0x16')](_0x9fcd2b));if(_0x9fcd2b[_0x8621('0x17')]){if(_0x9fcd2b[_0x8621('0x17')][_0x8621('0x18')]===0x1f4){logger[_0x8621('0x17')](_0x8621('0x12'),_0x1314f4,_0x9fcd2b['error'][_0x8621('0x19')]);return _0x2e8cda(_0x9fcd2b[_0x8621('0x17')][_0x8621('0x19')]);}logger['error'](_0x8621('0x12'),_0x1314f4,_0x9fcd2b[_0x8621('0x17')][_0x8621('0x19')]);return _0x2bd6e3(_0x9fcd2b[_0x8621('0x17')]['message']);}else{logger[_0x8621('0x11')](_0x8621('0x12'),_0x1314f4,_0x8621('0x13'));_0x2bd6e3(_0x9fcd2b[_0x8621('0x1a')][_0x8621('0x19')]);}})[_0x8621('0x1b')](function(_0x5e4736){logger['error'](_0x8621('0x12'),_0x1314f4,_0x5e4736);_0x2e8cda(_0x5e4736);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 0a1c69b..a7c42ad 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 _0x9d65=['register','length','dashboardItem:','./dashboardItem.events','save','remove','emit','removeListener'];(function(_0xefd875,_0x373a64){var _0x4b1fd8=function(_0x4bb557){while(--_0x4bb557){_0xefd875['push'](_0xefd875['shift']());}};_0x4b1fd8(++_0x373a64);}(_0x9d65,0x153));var _0x59d6=function(_0x46b2e6,_0xc7bc10){_0x46b2e6=_0x46b2e6-0x0;var _0xf6aad2=_0x9d65[_0x46b2e6];return _0xf6aad2;};'use strict';var DashboardItemEvents=require(_0x59d6('0x0'));var events=[_0x59d6('0x1'),_0x59d6('0x2'),'update'];function createListener(_0x2514a7,_0x16a8f9){return function(_0x4a7ad7){_0x16a8f9[_0x59d6('0x3')](_0x2514a7,_0x4a7ad7);};}function removeListener(_0x514c54,_0x2b2e19){return function(){DashboardItemEvents[_0x59d6('0x4')](_0x514c54,_0x2b2e19);};}exports[_0x59d6('0x5')]=function(_0x3f3c42){for(var _0x4bfdf0=0x0,_0xe861cd=events[_0x59d6('0x6')];_0x4bfdf0<_0xe861cd;_0x4bfdf0++){var _0x518aa1=events[_0x4bfdf0];var _0x536c9e=createListener(_0x59d6('0x7')+_0x518aa1,_0x3f3c42);DashboardItemEvents['on'](_0x518aa1,_0x536c9e);}}; \ No newline at end of file +var _0xb4e5=['update','removeListener','register','length','dashboardItem:','./dashboardItem.events','save','remove'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xb4e5,0x17d));var _0x5b4e=function(_0x2c4e2c,_0x2e8246){_0x2c4e2c=_0x2c4e2c-0x0;var _0x11b193=_0xb4e5[_0x2c4e2c];return _0x11b193;};'use strict';var DashboardItemEvents=require(_0x5b4e('0x0'));var events=[_0x5b4e('0x1'),_0x5b4e('0x2'),_0x5b4e('0x3')];function createListener(_0x8ab05c,_0x22828f){return function(_0x2c0912){_0x22828f['emit'](_0x8ab05c,_0x2c0912);};}function removeListener(_0x17589,_0x5deb75){return function(){DashboardItemEvents[_0x5b4e('0x4')](_0x17589,_0x5deb75);};}exports[_0x5b4e('0x5')]=function(_0xb2af1e){for(var _0x41fe3a=0x0,_0x20108c=events[_0x5b4e('0x6')];_0x41fe3a<_0x20108c;_0x41fe3a++){var _0x407702=events[_0x41fe3a];var _0x346a99=createListener(_0x5b4e('0x7')+_0x407702,_0xb2af1e);DashboardItemEvents['on'](_0x407702,_0x346a99);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 90231e8..4e6ae19 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 _0x643a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','create','put','update','delete','destroy','multer','path','connect-timeout','Router'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x643a,0x95));var _0xa643=function(_0xeeb156,_0x5392f4){_0xeeb156=_0xeeb156-0x0;var _0x4b7c74=_0x643a[_0xeeb156];return _0x4b7c74;};'use strict';var multer=require(_0xa643('0x0'));var util=require('util');var path=require(_0xa643('0x1'));var timeout=require(_0xa643('0x2'));var express=require('express');var router=express[_0xa643('0x3')]();var fs_extra=require(_0xa643('0x4'));var auth=require(_0xa643('0x5'));var interaction=require(_0xa643('0x6'));var config=require(_0xa643('0x7'));var controller=require(_0xa643('0x8'));router[_0xa643('0x9')](_0xa643('0xa'),auth[_0xa643('0xb')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xa643('0xc')]);router[_0xa643('0xd')](_0xa643('0xa'),auth[_0xa643('0xb')](),controller[_0xa643('0xe')]);router[_0xa643('0xf')](_0xa643('0xa'),auth[_0xa643('0xb')](),controller[_0xa643('0x10')]);module['exports']=router; \ No newline at end of file +var _0x3772=['../../config/environment','./dashboardItem.controller','/:id','isAuthenticated','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x21edfa,_0x309ef2){var _0x286996=function(_0xe77b34){while(--_0xe77b34){_0x21edfa['push'](_0x21edfa['shift']());}};_0x286996(++_0x309ef2);}(_0x3772,0xbd));var _0x2377=function(_0x5d38c4,_0x451a17){_0x5d38c4=_0x5d38c4-0x0;var _0x2558eb=_0x3772[_0x5d38c4];return _0x2558eb;};'use strict';var multer=require(_0x2377('0x0'));var util=require(_0x2377('0x1'));var path=require(_0x2377('0x2'));var timeout=require(_0x2377('0x3'));var express=require(_0x2377('0x4'));var router=express[_0x2377('0x5')]();var fs_extra=require(_0x2377('0x6'));var auth=require(_0x2377('0x7'));var interaction=require(_0x2377('0x8'));var config=require(_0x2377('0x9'));var controller=require(_0x2377('0xa'));router['get'](_0x2377('0xb'),auth[_0x2377('0xc')](),controller['show']);router['post']('/',auth[_0x2377('0xc')](),controller[_0x2377('0xd')]);router[_0x2377('0xe')](_0x2377('0xb'),auth[_0x2377('0xc')](),controller[_0x2377('0xf')]);router[_0x2377('0x10')](_0x2377('0xb'),auth[_0x2377('0xc')](),controller[_0x2377('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 5f083c3..1fa79d5 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 _0x2c92=['ENUM','second','first','STRING','sequelize','exports'];(function(_0x5f5b7e,_0x2303a7){var _0x110118=function(_0x15105d){while(--_0x15105d){_0x5f5b7e['push'](_0x5f5b7e['shift']());}};_0x110118(++_0x2303a7);}(_0x2c92,0x1ba));var _0x22c9=function(_0x52f1e6,_0xf70489){_0x52f1e6=_0x52f1e6-0x0;var _0x21f104=_0x2c92[_0x52f1e6];return _0x21f104;};'use strict';var Sequelize=require(_0x22c9('0x0'));module[_0x22c9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x22c9('0x2')]('first',_0x22c9('0x3'),'third'),'allowNull':![],'defaultValue':_0x22c9('0x4')},'description':{'type':Sequelize[_0x22c9('0x5')]}}; \ No newline at end of file +var _0x2f78=['ENUM','first','second','third','sequelize','STRING'];(function(_0x3f20a5,_0x5bbeda){var _0x168ec6=function(_0x2a64f5){while(--_0x2a64f5){_0x3f20a5['push'](_0x3f20a5['shift']());}};_0x168ec6(++_0x5bbeda);}(_0x2f78,0x1ba));var _0x82f7=function(_0x763658,_0x21834c){_0x763658=_0x763658-0x0;var _0x7aece4=_0x2f78[_0x763658];return _0x7aece4;};'use strict';var Sequelize=require(_0x82f7('0x0'));module['exports']={'name':{'type':Sequelize[_0x82f7('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x82f7('0x2')](_0x82f7('0x3'),_0x82f7('0x4'),_0x82f7('0x5')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0x82f7('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index c2bf268..7b571b0 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 _0x9fe7=['sox','to-csv','fs-extra','lodash','squel','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','json','offset','undefined','limit','count','set','Content-Range','reject','save','get','Dispositions','UserProfileResource','error','name','map','Disposition','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','then','catch','show','params','keys','fields','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path'];(function(_0x5de40e,_0x53df81){var _0x4d8ab7=function(_0x182054){while(--_0x182054){_0x5de40e['push'](_0x5de40e['shift']());}};_0x4d8ab7(++_0x53df81);}(_0x9fe7,0x1df));var _0x79fe=function(_0x5d4070,_0x2f0d87){_0x5d4070=_0x5d4070-0x0;var _0xfadfa8=_0x9fe7[_0x5d4070];return _0xfadfa8;};'use strict';var emlformat=require(_0x79fe('0x0'));var rimraf=require(_0x79fe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x79fe('0x2'));var rp=require('request-promise');var moment=require(_0x79fe('0x3'));var BPromise=require(_0x79fe('0x4'));var Mustache=require(_0x79fe('0x5'));var util=require('util');var path=require(_0x79fe('0x6'));var sox=require(_0x79fe('0x7'));var csv=require(_0x79fe('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x79fe('0x9'));var _=require(_0x79fe('0xa'));var squel=require(_0x79fe('0xb'));var crypto=require('crypto');var jsforce=require(_0x79fe('0xc'));var deskjs=require(_0x79fe('0xd'));var toCsv=require(_0x79fe('0x8'));var querystring=require(_0x79fe('0xe'));var Papa=require(_0x79fe('0xf'));var Redis=require('ioredis');var authService=require(_0x79fe('0x10'));var qs=require(_0x79fe('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x79fe('0x12'));var logger=require(_0x79fe('0x13'))(_0x79fe('0x14'));var utils=require(_0x79fe('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x79fe('0x16'));var db=require(_0x79fe('0x17'))['db'];function respondWithStatusCode(_0x3e0ad8,_0x93c1a7){_0x93c1a7=_0x93c1a7||0xcc;return function(_0x1a83f2){if(_0x1a83f2){return _0x3e0ad8[_0x79fe('0x18')](_0x93c1a7);}return _0x3e0ad8[_0x79fe('0x19')](_0x93c1a7)[_0x79fe('0x1a')]();};}function respondWithResult(_0x4be1c4,_0x3bd14a){_0x3bd14a=_0x3bd14a||0xc8;return function(_0x238e60){if(_0x238e60){return _0x4be1c4[_0x79fe('0x19')](_0x3bd14a)[_0x79fe('0x1b')](_0x238e60);}};}function respondWithFilteredResult(_0x35fb79,_0x25e91b){return function(_0x58124b){if(_0x58124b){var _0x127ec4=typeof _0x25e91b[_0x79fe('0x1c')]===_0x79fe('0x1d')&&typeof _0x25e91b[_0x79fe('0x1e')]==='undefined';var _0x416b5b=_0x58124b[_0x79fe('0x1f')];var _0x39be95=_0x127ec4?0x0:_0x25e91b[_0x79fe('0x1c')];var _0x536641=_0x127ec4?_0x58124b['count']:_0x25e91b[_0x79fe('0x1c')]+_0x25e91b[_0x79fe('0x1e')];var _0x25e51f;if(_0x536641>=_0x416b5b){_0x536641=_0x416b5b;_0x25e51f=0xc8;}else{_0x25e51f=0xce;}_0x35fb79['status'](_0x25e51f);return _0x35fb79[_0x79fe('0x20')](_0x79fe('0x21'),_0x39be95+'-'+_0x536641+'/'+_0x416b5b)[_0x79fe('0x1b')](_0x58124b);}return null;};}function patchUpdates(_0x4c7062){return function(_0x203405){try{jsonpatch['apply'](_0x203405,_0x4c7062,!![]);}catch(_0x15f019){return BPromise[_0x79fe('0x22')](_0x15f019);}return _0x203405[_0x79fe('0x23')]();};}function saveUpdates(_0x191bd8,_0x1ac8d7){return function(_0x23bff8){if(_0x23bff8){return _0x23bff8['update'](_0x191bd8)['then'](function(_0x107641){return _0x107641;});}return null;};}function removeEntity(_0x4e9888,_0x16aa35){return function(_0x3721bc){if(_0x3721bc){return _0x3721bc['destroy']()['then'](function(){var _0x454e93=_0x3721bc[_0x79fe('0x24')]({'plain':!![]});var _0x59339b=_0x79fe('0x25');return db[_0x79fe('0x26')]['destroy']({'where':{'type':_0x59339b,'resourceId':_0x454e93['id']}})['then'](function(){return _0x3721bc;});})['then'](function(){_0x4e9888[_0x79fe('0x19')](0xcc)[_0x79fe('0x1a')]();});}};}function handleEntityNotFound(_0x36ead5,_0x4ac913){return function(_0x47786f){if(!_0x47786f){_0x36ead5[_0x79fe('0x18')](0x194);}return _0x47786f;};}function handleError(_0x3bc5bc,_0x4de5cc){_0x4de5cc=_0x4de5cc||0x1f4;return function(_0x4e2740){logger[_0x79fe('0x27')](_0x4e2740['stack']);if(_0x4e2740[_0x79fe('0x28')]){delete _0x4e2740['name'];}_0x3bc5bc['status'](_0x4de5cc)['send'](_0x4e2740);};}exports['index']=function(_0x13f8da,_0xd2ec88){var _0x4dff5f={},_0x2b6975={},_0x5745a8={'count':0x0,'rows':[]};var _0x42558d=_[_0x79fe('0x29')](db[_0x79fe('0x2a')][_0x79fe('0x2b')],function(_0x128ca3){return{'name':_0x128ca3['fieldName'],'type':_0x128ca3[_0x79fe('0x2c')][_0x79fe('0x2d')]};});_0x2b6975[_0x79fe('0x2e')]=_[_0x79fe('0x29')](_0x42558d,_0x79fe('0x28'));_0x2b6975[_0x79fe('0x2f')]=_['keys'](_0x13f8da[_0x79fe('0x2f')]);_0x2b6975[_0x79fe('0x30')]=_[_0x79fe('0x31')](_0x2b6975[_0x79fe('0x2e')],_0x2b6975[_0x79fe('0x2f')]);_0x4dff5f[_0x79fe('0x32')]=_['intersection'](_0x2b6975[_0x79fe('0x2e')],qs['fields'](_0x13f8da[_0x79fe('0x2f')]['fields']));_0x4dff5f[_0x79fe('0x32')]=_0x4dff5f['attributes'][_0x79fe('0x33')]?_0x4dff5f[_0x79fe('0x32')]:_0x2b6975[_0x79fe('0x2e')];if(!_0x13f8da['query'][_0x79fe('0x34')](_0x79fe('0x35'))){_0x4dff5f[_0x79fe('0x1e')]=qs[_0x79fe('0x1e')](_0x13f8da[_0x79fe('0x2f')]['limit']);_0x4dff5f['offset']=qs[_0x79fe('0x1c')](_0x13f8da['query'][_0x79fe('0x1c')]);}_0x4dff5f[_0x79fe('0x36')]=qs['sort'](_0x13f8da[_0x79fe('0x2f')][_0x79fe('0x37')]);_0x4dff5f[_0x79fe('0x38')]=qs[_0x79fe('0x30')](_[_0x79fe('0x39')](_0x13f8da[_0x79fe('0x2f')],_0x2b6975['filters']),_0x42558d);if(_0x13f8da[_0x79fe('0x2f')][_0x79fe('0x3a')]){_0x4dff5f[_0x79fe('0x38')]=_[_0x79fe('0x3b')](_0x4dff5f['where'],{'$or':_[_0x79fe('0x29')](_0x42558d,function(_0x49d107){if(_0x49d107[_0x79fe('0x2c')]!=='VIRTUAL'){var _0x400a36={};_0x400a36[_0x49d107['name']]={'$like':'%'+_0x13f8da[_0x79fe('0x2f')][_0x79fe('0x3a')]+'%'};return _0x400a36;}})});}_0x4dff5f=_['merge']({},_0x4dff5f,_0x13f8da['options']);var _0x4137a3={'where':_0x4dff5f[_0x79fe('0x38')]};return db[_0x79fe('0x2a')][_0x79fe('0x1f')](_0x4137a3)['then'](function(_0x5698a2){_0x5745a8[_0x79fe('0x1f')]=_0x5698a2;if(_0x13f8da[_0x79fe('0x2f')][_0x79fe('0x3c')]){_0x4dff5f[_0x79fe('0x3d')]=[{'all':!![]}];}return db[_0x79fe('0x2a')][_0x79fe('0x3e')](_0x4dff5f);})[_0x79fe('0x3f')](function(_0x43c316){_0x5745a8['rows']=_0x43c316;return _0x5745a8;})[_0x79fe('0x3f')](respondWithFilteredResult(_0xd2ec88,_0x4dff5f))[_0x79fe('0x40')](handleError(_0xd2ec88,null));};exports[_0x79fe('0x41')]=function(_0x18e8f9,_0x461f38){var _0xcf6deb={'raw':!![],'where':{'id':_0x18e8f9[_0x79fe('0x42')]['id']}},_0x5b0d66={};_0x5b0d66[_0x79fe('0x2e')]=_[_0x79fe('0x43')](db[_0x79fe('0x2a')][_0x79fe('0x2b')]);_0x5b0d66[_0x79fe('0x2f')]=_['keys'](_0x18e8f9[_0x79fe('0x2f')]);_0x5b0d66[_0x79fe('0x30')]=_[_0x79fe('0x31')](_0x5b0d66['model'],_0x5b0d66[_0x79fe('0x2f')]);_0xcf6deb['attributes']=_['intersection'](_0x5b0d66[_0x79fe('0x2e')],qs[_0x79fe('0x44')](_0x18e8f9[_0x79fe('0x2f')]['fields']));_0xcf6deb[_0x79fe('0x32')]=_0xcf6deb[_0x79fe('0x32')][_0x79fe('0x33')]?_0xcf6deb['attributes']:_0x5b0d66['model'];if(_0x18e8f9[_0x79fe('0x2f')][_0x79fe('0x3c')]){_0xcf6deb[_0x79fe('0x3d')]=[{'all':!![]}];}_0xcf6deb=_[_0x79fe('0x3b')]({},_0xcf6deb,_0x18e8f9[_0x79fe('0x45')]);return db[_0x79fe('0x2a')][_0x79fe('0x46')](_0xcf6deb)[_0x79fe('0x3f')](handleEntityNotFound(_0x461f38,null))[_0x79fe('0x3f')](respondWithResult(_0x461f38,null))['catch'](handleError(_0x461f38,null));};exports[_0x79fe('0x47')]=function(_0x3009a8,_0x496486){return db[_0x79fe('0x2a')]['create'](_0x3009a8[_0x79fe('0x48')],{})[_0x79fe('0x3f')](function(_0x1d2845){var _0x1761d7=_0x3009a8['user'][_0x79fe('0x24')]({'plain':!![]});if(!_0x1761d7)throw new Error(_0x79fe('0x49'));if(_0x1761d7[_0x79fe('0x4a')]==='user'){var _0x5cfd05=_0x1d2845[_0x79fe('0x24')]({'plain':!![]});var _0x1ce058='Dispositions';return db[_0x79fe('0x4b')][_0x79fe('0x46')]({'where':{'name':_0x1ce058,'userProfileId':_0x1761d7[_0x79fe('0x4c')]},'raw':!![]})[_0x79fe('0x3f')](function(_0x58c900){if(_0x58c900&&_0x58c900[_0x79fe('0x4d')]===0x0){return db[_0x79fe('0x26')][_0x79fe('0x47')]({'name':_0x5cfd05['name'],'resourceId':_0x5cfd05['id'],'type':_0x58c900['name'],'sectionId':_0x58c900['id']},{})['then'](function(){return _0x1d2845;});}else{return _0x1d2845;}})['catch'](function(_0x4946d3){logger[_0x79fe('0x27')](_0x79fe('0x4e'),_0x4946d3);throw _0x4946d3;});}return _0x1d2845;})['then'](respondWithResult(_0x496486,0xc9))[_0x79fe('0x40')](handleError(_0x496486,null));};exports[_0x79fe('0x4f')]=function(_0x167ab6,_0x4a2a42){if(_0x167ab6['body']['id']){delete _0x167ab6['body']['id'];}return db[_0x79fe('0x2a')]['find']({'where':{'id':_0x167ab6[_0x79fe('0x42')]['id']}})[_0x79fe('0x3f')](handleEntityNotFound(_0x4a2a42,null))[_0x79fe('0x3f')](saveUpdates(_0x167ab6[_0x79fe('0x48')],null))[_0x79fe('0x3f')](respondWithResult(_0x4a2a42,null))[_0x79fe('0x40')](handleError(_0x4a2a42,null));};exports[_0x79fe('0x50')]=function(_0x2578da,_0x230ed9){return db[_0x79fe('0x2a')][_0x79fe('0x46')]({'where':{'id':_0x2578da['params']['id']}})[_0x79fe('0x3f')](handleEntityNotFound(_0x230ed9,null))[_0x79fe('0x3f')](removeEntity(_0x230ed9,null))['catch'](handleError(_0x230ed9,null));}; \ No newline at end of file +var _0x3f54=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','Disposition','rawAttributes','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','findAll','rows','catch','show','params','includeAll','options','create','user','Dispositions','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x5aadaa,_0xbfd961){var _0x546a2f=function(_0x3f0518){while(--_0x3f0518){_0x5aadaa['push'](_0x5aadaa['shift']());}};_0x546a2f(++_0xbfd961);}(_0x3f54,0xe4));var _0x43f5=function(_0x58eec7,_0x2353db){_0x58eec7=_0x58eec7-0x0;var _0x25c5d3=_0x3f54[_0x58eec7];return _0x25c5d3;};'use strict';var emlformat=require(_0x43f5('0x0'));var rimraf=require(_0x43f5('0x1'));var zipdir=require(_0x43f5('0x2'));var jsonpatch=require(_0x43f5('0x3'));var rp=require(_0x43f5('0x4'));var moment=require('moment');var BPromise=require(_0x43f5('0x5'));var Mustache=require('mustache');var util=require(_0x43f5('0x6'));var path=require(_0x43f5('0x7'));var sox=require(_0x43f5('0x8'));var csv=require(_0x43f5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x43f5('0xa'));var _=require(_0x43f5('0xb'));var squel=require('squel');var crypto=require(_0x43f5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x43f5('0xd'));var toCsv=require(_0x43f5('0x9'));var querystring=require(_0x43f5('0xe'));var Papa=require(_0x43f5('0xf'));var Redis=require(_0x43f5('0x10'));var authService=require(_0x43f5('0x11'));var qs=require(_0x43f5('0x12'));var as=require(_0x43f5('0x13'));var hardwareService=require(_0x43f5('0x14'));var logger=require(_0x43f5('0x15'))(_0x43f5('0x16'));var utils=require(_0x43f5('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x43f5('0x18'));var db=require(_0x43f5('0x19'))['db'];function respondWithStatusCode(_0x3c9e06,_0xfc6d32){_0xfc6d32=_0xfc6d32||0xcc;return function(_0x345441){if(_0x345441){return _0x3c9e06[_0x43f5('0x1a')](_0xfc6d32);}return _0x3c9e06[_0x43f5('0x1b')](_0xfc6d32)[_0x43f5('0x1c')]();};}function respondWithResult(_0x2a2cf9,_0x4dfde7){_0x4dfde7=_0x4dfde7||0xc8;return function(_0x15fd30){if(_0x15fd30){return _0x2a2cf9[_0x43f5('0x1b')](_0x4dfde7)['json'](_0x15fd30);}};}function respondWithFilteredResult(_0x4fa42a,_0x138938){return function(_0x205027){if(_0x205027){var _0xf27d57=typeof _0x138938[_0x43f5('0x1d')]===_0x43f5('0x1e')&&typeof _0x138938[_0x43f5('0x1f')]===_0x43f5('0x1e');var _0x4ab3f3=_0x205027['count'];var _0x48452d=_0xf27d57?0x0:_0x138938[_0x43f5('0x1d')];var _0x38f86c=_0xf27d57?_0x205027[_0x43f5('0x20')]:_0x138938[_0x43f5('0x1d')]+_0x138938[_0x43f5('0x1f')];var _0x282b99;if(_0x38f86c>=_0x4ab3f3){_0x38f86c=_0x4ab3f3;_0x282b99=0xc8;}else{_0x282b99=0xce;}_0x4fa42a[_0x43f5('0x1b')](_0x282b99);return _0x4fa42a[_0x43f5('0x21')](_0x43f5('0x22'),_0x48452d+'-'+_0x38f86c+'/'+_0x4ab3f3)['json'](_0x205027);}return null;};}function patchUpdates(_0x575b39){return function(_0x15514c){try{jsonpatch['apply'](_0x15514c,_0x575b39,!![]);}catch(_0x1a0f8b){return BPromise[_0x43f5('0x23')](_0x1a0f8b);}return _0x15514c[_0x43f5('0x24')]();};}function saveUpdates(_0x18f7f7,_0x445808){return function(_0x378445){if(_0x378445){return _0x378445[_0x43f5('0x25')](_0x18f7f7)[_0x43f5('0x26')](function(_0x138fe7){return _0x138fe7;});}return null;};}function removeEntity(_0x824a6a,_0x17597d){return function(_0x4de839){if(_0x4de839){return _0x4de839['destroy']()[_0x43f5('0x26')](function(){var _0x4baf66=_0x4de839[_0x43f5('0x27')]({'plain':!![]});var _0x3b43ef='Dispositions';return db[_0x43f5('0x28')][_0x43f5('0x29')]({'where':{'type':_0x3b43ef,'resourceId':_0x4baf66['id']}})['then'](function(){return _0x4de839;});})['then'](function(){_0x824a6a[_0x43f5('0x1b')](0xcc)[_0x43f5('0x1c')]();});}};}function handleEntityNotFound(_0xbf947d,_0x499234){return function(_0x167c75){if(!_0x167c75){_0xbf947d[_0x43f5('0x1a')](0x194);}return _0x167c75;};}function handleError(_0x3ee150,_0x7672fa){_0x7672fa=_0x7672fa||0x1f4;return function(_0x5e65d0){logger[_0x43f5('0x2a')](_0x5e65d0[_0x43f5('0x2b')]);if(_0x5e65d0[_0x43f5('0x2c')]){delete _0x5e65d0[_0x43f5('0x2c')];}_0x3ee150['status'](_0x7672fa)[_0x43f5('0x2d')](_0x5e65d0);};}exports[_0x43f5('0x2e')]=function(_0x1acea9,_0x147a09){var _0x847339={},_0x2f9f9f={},_0x2a0df3={'count':0x0,'rows':[]};var _0x1feb4f=_[_0x43f5('0x2f')](db[_0x43f5('0x30')][_0x43f5('0x31')],function(_0x3c6bfb){return{'name':_0x3c6bfb['fieldName'],'type':_0x3c6bfb['type']['key']};});_0x2f9f9f[_0x43f5('0x32')]=_[_0x43f5('0x2f')](_0x1feb4f,_0x43f5('0x2c'));_0x2f9f9f[_0x43f5('0x33')]=_[_0x43f5('0x34')](_0x1acea9['query']);_0x2f9f9f[_0x43f5('0x35')]=_[_0x43f5('0x36')](_0x2f9f9f[_0x43f5('0x32')],_0x2f9f9f['query']);_0x847339['attributes']=_[_0x43f5('0x36')](_0x2f9f9f[_0x43f5('0x32')],qs[_0x43f5('0x37')](_0x1acea9[_0x43f5('0x33')]['fields']));_0x847339['attributes']=_0x847339['attributes'][_0x43f5('0x38')]?_0x847339[_0x43f5('0x39')]:_0x2f9f9f['model'];if(!_0x1acea9[_0x43f5('0x33')][_0x43f5('0x3a')]('nolimit')){_0x847339[_0x43f5('0x1f')]=qs[_0x43f5('0x1f')](_0x1acea9[_0x43f5('0x33')][_0x43f5('0x1f')]);_0x847339[_0x43f5('0x1d')]=qs[_0x43f5('0x1d')](_0x1acea9['query'][_0x43f5('0x1d')]);}_0x847339[_0x43f5('0x3b')]=qs['sort'](_0x1acea9['query'][_0x43f5('0x3c')]);_0x847339[_0x43f5('0x3d')]=qs[_0x43f5('0x35')](_['pick'](_0x1acea9[_0x43f5('0x33')],_0x2f9f9f['filters']),_0x1feb4f);if(_0x1acea9[_0x43f5('0x33')][_0x43f5('0x3e')]){_0x847339[_0x43f5('0x3d')]=_[_0x43f5('0x3f')](_0x847339[_0x43f5('0x3d')],{'$or':_[_0x43f5('0x2f')](_0x1feb4f,function(_0x2fd356){if(_0x2fd356[_0x43f5('0x40')]!==_0x43f5('0x41')){var _0x4ab3fd={};_0x4ab3fd[_0x2fd356[_0x43f5('0x2c')]]={'$like':'%'+_0x1acea9[_0x43f5('0x33')][_0x43f5('0x3e')]+'%'};return _0x4ab3fd;}})});}_0x847339=_[_0x43f5('0x3f')]({},_0x847339,_0x1acea9['options']);var _0x9bb8cb={'where':_0x847339[_0x43f5('0x3d')]};return db['Disposition'][_0x43f5('0x20')](_0x9bb8cb)[_0x43f5('0x26')](function(_0x523d46){_0x2a0df3[_0x43f5('0x20')]=_0x523d46;if(_0x1acea9['query']['includeAll']){_0x847339['include']=[{'all':!![]}];}return db['Disposition'][_0x43f5('0x42')](_0x847339);})[_0x43f5('0x26')](function(_0x3f715d){_0x2a0df3[_0x43f5('0x43')]=_0x3f715d;return _0x2a0df3;})[_0x43f5('0x26')](respondWithFilteredResult(_0x147a09,_0x847339))[_0x43f5('0x44')](handleError(_0x147a09,null));};exports[_0x43f5('0x45')]=function(_0x5173bb,_0x29baaa){var _0x224e65={'raw':!![],'where':{'id':_0x5173bb[_0x43f5('0x46')]['id']}},_0x2d7f6b={};_0x2d7f6b[_0x43f5('0x32')]=_[_0x43f5('0x34')](db[_0x43f5('0x30')][_0x43f5('0x31')]);_0x2d7f6b[_0x43f5('0x33')]=_[_0x43f5('0x34')](_0x5173bb['query']);_0x2d7f6b['filters']=_[_0x43f5('0x36')](_0x2d7f6b[_0x43f5('0x32')],_0x2d7f6b[_0x43f5('0x33')]);_0x224e65[_0x43f5('0x39')]=_[_0x43f5('0x36')](_0x2d7f6b[_0x43f5('0x32')],qs[_0x43f5('0x37')](_0x5173bb[_0x43f5('0x33')][_0x43f5('0x37')]));_0x224e65['attributes']=_0x224e65['attributes'][_0x43f5('0x38')]?_0x224e65['attributes']:_0x2d7f6b[_0x43f5('0x32')];if(_0x5173bb['query'][_0x43f5('0x47')]){_0x224e65['include']=[{'all':!![]}];}_0x224e65=_['merge']({},_0x224e65,_0x5173bb[_0x43f5('0x48')]);return db[_0x43f5('0x30')]['find'](_0x224e65)[_0x43f5('0x26')](handleEntityNotFound(_0x29baaa,null))[_0x43f5('0x26')](respondWithResult(_0x29baaa,null))[_0x43f5('0x44')](handleError(_0x29baaa,null));};exports[_0x43f5('0x49')]=function(_0x5d4cd5,_0xa9362){return db['Disposition']['create'](_0x5d4cd5['body'],{})[_0x43f5('0x26')](function(_0xf80e7d){var _0x58110a=_0x5d4cd5[_0x43f5('0x4a')][_0x43f5('0x27')]({'plain':!![]});if(!_0x58110a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58110a['role']===_0x43f5('0x4a')){var _0x16d4aa=_0xf80e7d[_0x43f5('0x27')]({'plain':!![]});var _0x42c336=_0x43f5('0x4b');return db[_0x43f5('0x4c')]['find']({'where':{'name':_0x42c336,'userProfileId':_0x58110a[_0x43f5('0x4d')]},'raw':!![]})[_0x43f5('0x26')](function(_0x46b22e){if(_0x46b22e&&_0x46b22e[_0x43f5('0x4e')]===0x0){return db[_0x43f5('0x28')][_0x43f5('0x49')]({'name':_0x16d4aa[_0x43f5('0x2c')],'resourceId':_0x16d4aa['id'],'type':_0x46b22e[_0x43f5('0x2c')],'sectionId':_0x46b22e['id']},{})[_0x43f5('0x26')](function(){return _0xf80e7d;});}else{return _0xf80e7d;}})[_0x43f5('0x44')](function(_0x1d2046){logger['error'](_0x43f5('0x4f'),_0x1d2046);throw _0x1d2046;});}return _0xf80e7d;})[_0x43f5('0x26')](respondWithResult(_0xa9362,0xc9))[_0x43f5('0x44')](handleError(_0xa9362,null));};exports['update']=function(_0x419804,_0x59a227){if(_0x419804[_0x43f5('0x50')]['id']){delete _0x419804[_0x43f5('0x50')]['id'];}return db[_0x43f5('0x30')]['find']({'where':{'id':_0x419804['params']['id']}})[_0x43f5('0x26')](handleEntityNotFound(_0x59a227,null))[_0x43f5('0x26')](saveUpdates(_0x419804[_0x43f5('0x50')],null))[_0x43f5('0x26')](respondWithResult(_0x59a227,null))[_0x43f5('0x44')](handleError(_0x59a227,null));};exports[_0x43f5('0x29')]=function(_0x4ecae0,_0xef0981){return db['Disposition'][_0x43f5('0x51')]({'where':{'id':_0x4ecae0['params']['id']}})['then'](handleEntityNotFound(_0xef0981,null))[_0x43f5('0x26')](removeEntity(_0xef0981,null))['catch'](handleError(_0xef0981,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index cf98ec7..edf2fe1 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 _0x2f11=['Disposition','name_voice','name','ListId','name_chat','ChatWebsiteId','MailAccountId','name_sms','SmsAccountId','name_fax','name_openchannel','name_whatsapp','lodash','util','../../config/logger','api','rimraf','../../config/environment','./disposition.attributes','define'];(function(_0x1e2080,_0x53283b){var _0x260111=function(_0x15da5e){while(--_0x15da5e){_0x1e2080['push'](_0x1e2080['shift']());}};_0x260111(++_0x53283b);}(_0x2f11,0x1ec));var _0x12f1=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x2f11[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x12f1('0x0'));var util=require(_0x12f1('0x1'));var logger=require(_0x12f1('0x2'))(_0x12f1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x12f1('0x4'));var config=require(_0x12f1('0x5'));var attributes=require(_0x12f1('0x6'));module['exports']=function(_0x228a47,_0x3fbb70){return _0x228a47[_0x12f1('0x7')](_0x12f1('0x8'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x12f1('0x9'),'fields':[_0x12f1('0xa'),_0x12f1('0xb')]},{'unique':!![],'name':_0x12f1('0xc'),'fields':[_0x12f1('0xa'),_0x12f1('0xd')]},{'unique':!![],'name':'name_mail','fields':[_0x12f1('0xa'),_0x12f1('0xe')]},{'unique':!![],'name':_0x12f1('0xf'),'fields':[_0x12f1('0xa'),_0x12f1('0x10')]},{'unique':!![],'name':_0x12f1('0x11'),'fields':[_0x12f1('0xa'),'FaxAccountId']},{'unique':!![],'name':_0x12f1('0x12'),'fields':[_0x12f1('0xa'),'OpenchannelAccountId']},{'unique':!![],'name':_0x12f1('0x13'),'fields':[_0x12f1('0xa'),'WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe855=['../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ChatWebsiteId','MailAccountId','name_sms','SmsAccountId','name_fax','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe855,0xb1));var _0x5e85=function(_0x66e8c6,_0x559e25){_0x66e8c6=_0x66e8c6-0x0;var _0x3af129=_0xe855[_0x66e8c6];return _0x3af129;};'use strict';var _=require(_0x5e85('0x0'));var util=require('util');var logger=require(_0x5e85('0x1'))(_0x5e85('0x2'));var moment=require(_0x5e85('0x3'));var BPromise=require(_0x5e85('0x4'));var rp=require(_0x5e85('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5e85('0x6'));var config=require(_0x5e85('0x7'));var attributes=require(_0x5e85('0x8'));module[_0x5e85('0x9')]=function(_0x3842eb,_0x38bb51){return _0x3842eb[_0x5e85('0xa')](_0x5e85('0xb'),attributes,{'tableName':_0x5e85('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x5e85('0xd'),'fields':[_0x5e85('0xe'),'ListId']},{'unique':!![],'name':'name_chat','fields':[_0x5e85('0xe'),_0x5e85('0xf')]},{'unique':!![],'name':'name_mail','fields':['name',_0x5e85('0x10')]},{'unique':!![],'name':_0x5e85('0x11'),'fields':[_0x5e85('0xe'),_0x5e85('0x12')]},{'unique':!![],'name':_0x5e85('0x13'),'fields':[_0x5e85('0xe'),'FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':['name',_0x5e85('0x14')]},{'unique':!![],'name':_0x5e85('0x15'),'fields':[_0x5e85('0xe'),_0x5e85('0x16')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 449e110..578a260 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(_0x256dd3,_0x4670e3){var _0x11a292=function(_0x177d4a){while(--_0x177d4a){_0x256dd3['push'](_0x256dd3['shift']());}};_0x11a292(++_0x4670e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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(_0x3a9656,_0x42b4aa){var _0x27c468=function(_0x25d1f2){while(--_0x25d1f2){_0x3a9656['push'](_0x3a9656['shift']());}};_0x27c468(++_0x42b4aa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 32ed345..e59cfae 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 _0x788c=['show','post','create','update','delete','destroy','util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./disposition.controller','index','get','/:id','isAuthenticated'];(function(_0x575818,_0xa55f3f){var _0x13bd05=function(_0x5eaabc){while(--_0x5eaabc){_0x575818['push'](_0x575818['shift']());}};_0x13bd05(++_0xa55f3f);}(_0x788c,0xf6));var _0xc788=function(_0x265b0,_0x435969){_0x265b0=_0x265b0-0x0;var _0x5dd68f=_0x788c[_0x265b0];return _0x5dd68f;};'use strict';var multer=require('multer');var util=require(_0xc788('0x0'));var path=require('path');var timeout=require(_0xc788('0x1'));var express=require('express');var router=express[_0xc788('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc788('0x3'));var config=require(_0xc788('0x4'));var controller=require(_0xc788('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xc788('0x6')]);router[_0xc788('0x7')](_0xc788('0x8'),auth[_0xc788('0x9')](),controller[_0xc788('0xa')]);router[_0xc788('0xb')]('/',auth['isAuthenticated'](),controller[_0xc788('0xc')]);router['put'](_0xc788('0x8'),auth[_0xc788('0x9')](),controller[_0xc788('0xd')]);router[_0xc788('0xe')](_0xc788('0x8'),auth[_0xc788('0x9')](),controller[_0xc788('0xf')]);module['exports']=router; \ No newline at end of file +var _0x2683=['../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','post','create','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x2683,0x78));var _0x3268=function(_0x3c2166,_0x41fc16){_0x3c2166=_0x3c2166-0x0;var _0x30ccc3=_0x2683[_0x3c2166];return _0x30ccc3;};'use strict';var multer=require('multer');var util=require(_0x3268('0x0'));var path=require(_0x3268('0x1'));var timeout=require(_0x3268('0x2'));var express=require(_0x3268('0x3'));var router=express[_0x3268('0x4')]();var fs_extra=require(_0x3268('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3268('0x6'));var controller=require(_0x3268('0x7'));router[_0x3268('0x8')]('/',auth[_0x3268('0x9')](),controller[_0x3268('0xa')]);router[_0x3268('0x8')](_0x3268('0xb'),auth[_0x3268('0x9')](),controller['show']);router[_0x3268('0xc')]('/',auth[_0x3268('0x9')](),controller[_0x3268('0xd')]);router['put']('/:id',auth[_0x3268('0x9')](),controller[_0x3268('0xe')]);router[_0x3268('0xf')](_0x3268('0xb'),auth['isAuthenticated'](),controller[_0x3268('0x10')]);module[_0x3268('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 0db1c19..f94dc00 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 _0x199c=['SIP','IAX','DADHI','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','2400','9600','12000','14400','4800','7200','v17,v27,v29','INTEGER'];(function(_0x5447aa,_0x3afc00){var _0xb21e53=function(_0x2d05f6){while(--_0x2d05f6){_0x5447aa['push'](_0x5447aa['shift']());}};_0xb21e53(++_0x3afc00);}(_0x199c,0x1d8));var _0xc199=function(_0x2a1233,_0x523c88){_0x2a1233=_0x2a1233-0x0;var _0x30cdd9=_0x199c[_0x2a1233];return _0x30cdd9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc199('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc199('0x0')]},'ecm':{'type':Sequelize[_0xc199('0x1')](_0xc199('0x2'),'no'),'defaultValue':_0xc199('0x2')},'headerinfo':{'type':Sequelize[_0xc199('0x0')],'defaultValue':_0xc199('0x3')},'localstationid':{'type':Sequelize[_0xc199('0x0')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0xc199('0x1')](_0xc199('0x4'),'4800','7200',_0xc199('0x5'),_0xc199('0x6'),_0xc199('0x7')),'defaultValue':_0xc199('0x8')},'maxrate':{'type':Sequelize[_0xc199('0x1')](_0xc199('0x4'),_0xc199('0x8'),_0xc199('0x9'),'9600',_0xc199('0x6'),_0xc199('0x7')),'defaultValue':_0xc199('0x7')},'modem':{'type':Sequelize[_0xc199('0x0')],'defaultValue':_0xc199('0xa')},'gateway':{'type':Sequelize[_0xc199('0x0')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xc199('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xc199('0x1')](_0xc199('0xc'),_0xc199('0xd'),_0xc199('0xe'),'KHOMP'),'defaultValue':_0xc199('0xc')},'key':{'type':Sequelize[_0xc199('0x0')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xc199('0xf')],'defaultValue':function(){return _0xc199('0x10');}},'notificationSound':{'type':Sequelize[_0xc199('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xc199('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc199('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc199('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc199('0xb')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xc199('0x11')],'defaultValue':![],'comment':_0xc199('0x12'),'set':function(_0x5ee3f8){if(!_0x5ee3f8)this[_0xc199('0x13')](_0xc199('0x14'),null);this[_0xc199('0x13')](_0xc199('0x15'),_0x5ee3f8);}}}; \ No newline at end of file +var _0x9f5a=['sequelize','exports','STRING','yes','ENUM','2400','7200','9600','12000','14400','4800','INTEGER','IAX','DADHI','KHOMP','TEXT','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x9f5a,0xbd));var _0xa9f5=function(_0x1560fa,_0x18b163){_0x1560fa=_0x1560fa-0x0;var _0x10b728=_0x9f5a[_0x1560fa];return _0x10b728;};'use strict';var Sequelize=require(_0xa9f5('0x0'));module[_0xa9f5('0x1')]={'name':{'type':Sequelize[_0xa9f5('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa9f5('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0xa9f5('0x3'),'no'),'defaultValue':_0xa9f5('0x3')},'headerinfo':{'type':Sequelize[_0xa9f5('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xa9f5('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0xa9f5('0x4')](_0xa9f5('0x5'),'4800',_0xa9f5('0x6'),_0xa9f5('0x7'),_0xa9f5('0x8'),_0xa9f5('0x9')),'defaultValue':_0xa9f5('0xa')},'maxrate':{'type':Sequelize[_0xa9f5('0x4')](_0xa9f5('0x5'),'4800',_0xa9f5('0x6'),_0xa9f5('0x7'),'12000',_0xa9f5('0x9')),'defaultValue':_0xa9f5('0x9')},'modem':{'type':Sequelize['STRING'],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xa9f5('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xa9f5('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xa9f5('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xa9f5('0x4')]('SIP',_0xa9f5('0xc'),_0xa9f5('0xd'),_0xa9f5('0xe')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0xa9f5('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xa9f5('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa9f5('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa9f5('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa9f5('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa9f5('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa9f5('0xb')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xa9f5('0x10')],'defaultValue':![],'comment':_0xa9f5('0x11'),'set':function(_0x230fc2){if(!_0x230fc2)this[_0xa9f5('0x12')](_0xa9f5('0x13'),null);this[_0xa9f5('0x12')](_0xa9f5('0x14'),_0x230fc2);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index e451c58..0175f27 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 _0x4302=['querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','status','json','offset','limit','undefined','count','set','reject','save','update','then','get','FaxAccounts','UserProfileResource','end','stack','name','index','mandatoryDispositionPause','map','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','type','VIRTUAL','options','where','FaxAccount','includeAll','findAll','rows','show','params','Pause','rawAttributes','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','Disposition','getDispositions','findOne','FaxAccountId','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Contact','Owner','internal','Tag','Tags','tag','addApplications','sequelize','transaction','Transaction','FaxApplication','findAndCountAll','priority','finally','send','getApplications','context','localstationid','app','system','description','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','FAXOPT(','Wait','addAccountApplications','VoiceExtension','bulkCreate','createdAt','TrunkId','findById','getMessages','FaxMessage','$gte','split','format','CmList','List','Contacts','updatedAt','DESC','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','from','fax','ListId','List\x20not\x20found','out','filename','Messages','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x2c984d,_0x5a6f2f){var _0x31df62=function(_0x180acd){while(--_0x180acd){_0x2c984d['push'](_0x2c984d['shift']());}};_0x31df62(++_0x5a6f2f);}(_0x4302,0x17a));var _0x2430=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x4302[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x2430('0x0'));var rimraf=require(_0x2430('0x1'));var zipdir=require(_0x2430('0x2'));var jsonpatch=require(_0x2430('0x3'));var rp=require(_0x2430('0x4'));var moment=require('moment');var BPromise=require(_0x2430('0x5'));var Mustache=require(_0x2430('0x6'));var util=require(_0x2430('0x7'));var path=require(_0x2430('0x8'));var sox=require(_0x2430('0x9'));var csv=require(_0x2430('0xa'));var ejs=require(_0x2430('0xb'));var fs=require('fs');var fs_extra=require(_0x2430('0xc'));var _=require(_0x2430('0xd'));var squel=require(_0x2430('0xe'));var crypto=require(_0x2430('0xf'));var jsforce=require(_0x2430('0x10'));var deskjs=require(_0x2430('0x11'));var toCsv=require('to-csv');var querystring=require(_0x2430('0x12'));var Papa=require('papaparse');var Redis=require(_0x2430('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x2430('0x14'));var as=require(_0x2430('0x15'));var hardwareService=require(_0x2430('0x16'));var logger=require(_0x2430('0x17'))('api');var utils=require(_0x2430('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2430('0x19'));var db=require(_0x2430('0x1a'))['db'];config[_0x2430('0x1b')]=_[_0x2430('0x1c')](config['redis'],{'host':_0x2430('0x1d'),'port':0x18eb});var socket=require(_0x2430('0x1e'))(new Redis(config[_0x2430('0x1b')]));require(_0x2430('0x1f'))[_0x2430('0x20')](socket);var jayson=require(_0x2430('0x21'));var client=jayson[_0x2430('0x22')][_0x2430('0x23')]({'port':0x232c});var client9002=jayson['client'][_0x2430('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x23cd5a,_0x1294e2,_0x4a02c6,_0x1feac7){return new BPromise(function(_0x1982cc,_0x4069de){var _0xf50ce6=_0x1feac7||client;return _0xf50ce6['request'](_0x23cd5a,_0x4a02c6)['then'](function(_0x4bdade){logger[_0x2430('0x24')]('FaxAccount,\x20%s,\x20%s',_0x1294e2,_0x2430('0x25'));logger[_0x2430('0x26')](_0x2430('0x27'),_0x1294e2,_0x2430('0x25'),JSON[_0x2430('0x28')](_0x4bdade));if(_0x4bdade[_0x2430('0x29')]){if(_0x4bdade[_0x2430('0x29')][_0x2430('0x2a')]===0x1f4){logger[_0x2430('0x29')](_0x2430('0x2b'),_0x1294e2,_0x4bdade[_0x2430('0x29')][_0x2430('0x2c')]);return _0x4069de(_0x4bdade[_0x2430('0x29')][_0x2430('0x2c')]);}logger[_0x2430('0x29')](_0x2430('0x2b'),_0x1294e2,_0x4bdade[_0x2430('0x29')][_0x2430('0x2c')]);return _0x1982cc(_0x4bdade[_0x2430('0x29')][_0x2430('0x2c')]);}else{logger[_0x2430('0x24')](_0x2430('0x2b'),_0x1294e2,'request\x20sent');_0x1982cc(_0x4bdade[_0x2430('0x2d')][_0x2430('0x2c')]);}})[_0x2430('0x2e')](function(_0x3b0ba6){logger[_0x2430('0x29')]('FaxAccount,\x20%s,\x20%s',_0x1294e2,_0x3b0ba6);_0x4069de(_0x3b0ba6);});});}function respondWithStatusCode(_0x3f9178,_0x2188e0){_0x2188e0=_0x2188e0||0xcc;return function(_0x593dec){if(_0x593dec){return _0x3f9178['sendStatus'](_0x2188e0);}return _0x3f9178[_0x2430('0x2f')](_0x2188e0)['end']();};}function respondWithResult(_0x5f0233,_0x193df9){_0x193df9=_0x193df9||0xc8;return function(_0x5f2995){if(_0x5f2995){return _0x5f0233[_0x2430('0x2f')](_0x193df9)[_0x2430('0x30')](_0x5f2995);}};}function respondWithFilteredResult(_0x57c97c,_0x156dbe){return function(_0x863a21){if(_0x863a21){var _0x4e958f=typeof _0x156dbe[_0x2430('0x31')]==='undefined'&&typeof _0x156dbe[_0x2430('0x32')]===_0x2430('0x33');var _0x33dd94=_0x863a21[_0x2430('0x34')];var _0x3390ce=_0x4e958f?0x0:_0x156dbe[_0x2430('0x31')];var _0x1e0395=_0x4e958f?_0x863a21['count']:_0x156dbe[_0x2430('0x31')]+_0x156dbe['limit'];var _0x35229a;if(_0x1e0395>=_0x33dd94){_0x1e0395=_0x33dd94;_0x35229a=0xc8;}else{_0x35229a=0xce;}_0x57c97c[_0x2430('0x2f')](_0x35229a);return _0x57c97c[_0x2430('0x35')]('Content-Range',_0x3390ce+'-'+_0x1e0395+'/'+_0x33dd94)['json'](_0x863a21);}return null;};}function patchUpdates(_0x1ab36c){return function(_0x2ce903){try{jsonpatch['apply'](_0x2ce903,_0x1ab36c,!![]);}catch(_0x1b74ac){return BPromise[_0x2430('0x36')](_0x1b74ac);}return _0x2ce903[_0x2430('0x37')]();};}function saveUpdates(_0x3ea004,_0x3d2d05){return function(_0x3e548e){if(_0x3e548e){return _0x3e548e[_0x2430('0x38')](_0x3ea004)[_0x2430('0x39')](function(_0x4aa6c2){return _0x4aa6c2;});}return null;};}function removeEntity(_0x245fbb,_0xe0cd16){return function(_0x32e3ea){if(_0x32e3ea){return _0x32e3ea['destroy']()[_0x2430('0x39')](function(){var _0x3c855b=_0x32e3ea[_0x2430('0x3a')]({'plain':!![]});var _0x219adf=_0x2430('0x3b');return db[_0x2430('0x3c')]['destroy']({'where':{'type':_0x219adf,'resourceId':_0x3c855b['id']}})['then'](function(){return _0x32e3ea;});})[_0x2430('0x39')](function(){_0x245fbb[_0x2430('0x2f')](0xcc)[_0x2430('0x3d')]();});}};}function handleEntityNotFound(_0xf997ef,_0x42ae21){return function(_0x5e1697){if(!_0x5e1697){_0xf997ef['sendStatus'](0x194);}return _0x5e1697;};}function handleError(_0xb59b5f,_0x5905e9){_0x5905e9=_0x5905e9||0x1f4;return function(_0x2a4c91){logger[_0x2430('0x29')](_0x2a4c91[_0x2430('0x3e')]);if(_0x2a4c91[_0x2430('0x3f')]){delete _0x2a4c91['name'];}_0xb59b5f[_0x2430('0x2f')](_0x5905e9)['send'](_0x2a4c91);};}exports[_0x2430('0x40')]=function(_0x14c6a4,_0x2389de){var _0x10800f={'include':[{'model':db['Pause'],'as':_0x2430('0x41')}]},_0x4d2a2d={},_0xa54753={'count':0x0,'rows':[]};var _0x5f2c23=_[_0x2430('0x42')](db['FaxAccount']['rawAttributes'],function(_0x49688d){return{'name':_0x49688d['fieldName'],'type':_0x49688d['type'][_0x2430('0x43')]};});_0x4d2a2d[_0x2430('0x44')]=_[_0x2430('0x42')](_0x5f2c23,'name');_0x4d2a2d[_0x2430('0x45')]=_[_0x2430('0x46')](_0x14c6a4[_0x2430('0x45')]);_0x4d2a2d[_0x2430('0x47')]=_[_0x2430('0x48')](_0x4d2a2d[_0x2430('0x44')],_0x4d2a2d[_0x2430('0x45')]);_0x10800f['attributes']=_[_0x2430('0x48')](_0x4d2a2d[_0x2430('0x44')],qs['fields'](_0x14c6a4[_0x2430('0x45')][_0x2430('0x49')]));_0x10800f[_0x2430('0x4a')]=_0x10800f[_0x2430('0x4a')][_0x2430('0x4b')]?_0x10800f[_0x2430('0x4a')]:_0x4d2a2d['model'];if(!_0x14c6a4[_0x2430('0x45')][_0x2430('0x4c')](_0x2430('0x4d'))){_0x10800f[_0x2430('0x32')]=qs['limit'](_0x14c6a4[_0x2430('0x45')][_0x2430('0x32')]);_0x10800f[_0x2430('0x31')]=qs['offset'](_0x14c6a4[_0x2430('0x45')]['offset']);}_0x10800f[_0x2430('0x4e')]=qs[_0x2430('0x4f')](_0x14c6a4[_0x2430('0x45')][_0x2430('0x4f')]);_0x10800f['where']=qs[_0x2430('0x47')](_[_0x2430('0x50')](_0x14c6a4['query'],_0x4d2a2d['filters']),_0x5f2c23);if(_0x14c6a4['query'][_0x2430('0x51')]){_0x10800f['where']=_[_0x2430('0x52')](_0x10800f['where'],{'$or':_[_0x2430('0x42')](_0x5f2c23,function(_0x521594){if(_0x521594[_0x2430('0x53')]!==_0x2430('0x54')){var _0x22a75d={};_0x22a75d[_0x521594['name']]={'$like':'%'+_0x14c6a4[_0x2430('0x45')][_0x2430('0x51')]+'%'};return _0x22a75d;}})});}_0x10800f=_[_0x2430('0x52')]({},_0x10800f,_0x14c6a4[_0x2430('0x55')]);var _0x5be751={'where':_0x10800f[_0x2430('0x56')]};return db[_0x2430('0x57')][_0x2430('0x34')](_0x5be751)[_0x2430('0x39')](function(_0x51abb6){_0xa54753[_0x2430('0x34')]=_0x51abb6;if(_0x14c6a4[_0x2430('0x45')][_0x2430('0x58')]){_0x10800f['include']=[{'all':!![]}];}return db['FaxAccount'][_0x2430('0x59')](_0x10800f);})[_0x2430('0x39')](function(_0x5b1fb5){_0xa54753[_0x2430('0x5a')]=_0x5b1fb5;return _0xa54753;})[_0x2430('0x39')](respondWithFilteredResult(_0x2389de,_0x10800f))[_0x2430('0x2e')](handleError(_0x2389de,null));};exports[_0x2430('0x5b')]=function(_0xc35aa7,_0x3e1474){var _0x279bbd={'raw':![],'where':{'id':_0xc35aa7[_0x2430('0x5c')]['id']},'include':[{'model':db[_0x2430('0x5d')],'as':'mandatoryDispositionPause'}]},_0x6dba5f={};_0x6dba5f['model']=_[_0x2430('0x46')](db[_0x2430('0x57')][_0x2430('0x5e')]);_0x6dba5f[_0x2430('0x45')]=_[_0x2430('0x46')](_0xc35aa7[_0x2430('0x45')]);_0x6dba5f[_0x2430('0x47')]=_[_0x2430('0x48')](_0x6dba5f[_0x2430('0x44')],_0x6dba5f[_0x2430('0x45')]);_0x279bbd[_0x2430('0x4a')]=_[_0x2430('0x48')](_0x6dba5f['model'],qs['fields'](_0xc35aa7[_0x2430('0x45')][_0x2430('0x49')]));_0x279bbd[_0x2430('0x4a')]=_0x279bbd['attributes'][_0x2430('0x4b')]?_0x279bbd[_0x2430('0x4a')]:_0x6dba5f['model'];if(_0xc35aa7[_0x2430('0x45')][_0x2430('0x58')]){_0x279bbd[_0x2430('0x5f')]=[{'all':!![]}];}_0x279bbd=_[_0x2430('0x52')]({},_0x279bbd,_0xc35aa7[_0x2430('0x55')]);return db['FaxAccount'][_0x2430('0x60')](_0x279bbd)[_0x2430('0x39')](handleEntityNotFound(_0x3e1474,null))[_0x2430('0x39')](respondWithResult(_0x3e1474,null))[_0x2430('0x2e')](handleError(_0x3e1474,null));};exports[_0x2430('0x61')]=function(_0x4934d5,_0x54f080){return db['FaxAccount'][_0x2430('0x61')](_0x4934d5[_0x2430('0x62')],{})[_0x2430('0x39')](function(_0xd7f19c){var _0x48964e=_0x4934d5['user'][_0x2430('0x3a')]({'plain':!![]});if(!_0x48964e)throw new Error(_0x2430('0x63'));if(_0x48964e['role']===_0x2430('0x64')){var _0x5786cd=_0xd7f19c[_0x2430('0x3a')]({'plain':!![]});var _0x28928f=_0x2430('0x3b');return db[_0x2430('0x65')][_0x2430('0x60')]({'where':{'name':_0x28928f,'userProfileId':_0x48964e[_0x2430('0x66')]},'raw':!![]})[_0x2430('0x39')](function(_0x299c10){if(_0x299c10&&_0x299c10[_0x2430('0x67')]===0x0){return db['UserProfileResource'][_0x2430('0x61')]({'name':_0x5786cd[_0x2430('0x3f')],'resourceId':_0x5786cd['id'],'type':_0x299c10['name'],'sectionId':_0x299c10['id']},{})[_0x2430('0x39')](function(){return _0xd7f19c;});}else{return _0xd7f19c;}})[_0x2430('0x2e')](function(_0x29a1a4){logger[_0x2430('0x29')](_0x2430('0x68'),_0x29a1a4);throw _0x29a1a4;});}return _0xd7f19c;})['then'](respondWithResult(_0x54f080,0xc9))[_0x2430('0x2e')](handleError(_0x54f080,null));};exports[_0x2430('0x38')]=function(_0x322819,_0x1ff142){if(_0x322819['body']['id']){delete _0x322819[_0x2430('0x62')]['id'];}return db[_0x2430('0x57')][_0x2430('0x60')]({'where':{'id':_0x322819[_0x2430('0x5c')]['id']},'include':[{'model':db[_0x2430('0x5d')],'as':_0x2430('0x41')}]})['then'](handleEntityNotFound(_0x1ff142,null))[_0x2430('0x39')](saveUpdates(_0x322819['body'],null))['then'](respondWithResult(_0x1ff142,null))[_0x2430('0x2e')](handleError(_0x1ff142,null));};exports[_0x2430('0x69')]=function(_0x54be30,_0xa1d2cd){return db['FaxAccount'][_0x2430('0x60')]({'where':{'id':_0x54be30[_0x2430('0x5c')]['id']}})[_0x2430('0x39')](handleEntityNotFound(_0xa1d2cd,null))[_0x2430('0x39')](removeEntity(_0xa1d2cd,null))['catch'](handleError(_0xa1d2cd,null));};exports[_0x2430('0x6a')]=function(_0x5c8312,_0x2cf3fb){return db[_0x2430('0x57')][_0x2430('0x6a')]()[_0x2430('0x39')](respondWithResult(_0x2cf3fb,null))[_0x2430('0x2e')](handleError(_0x2cf3fb,null));};exports[_0x2430('0x6b')]=function(_0x2babf6,_0xe9a777,_0x408fae){if(_0x2babf6['body']['id']){delete _0x2babf6[_0x2430('0x62')]['id'];}return db[_0x2430('0x57')]['find']({'where':{'id':_0x2babf6[_0x2430('0x5c')]['id']}})['then'](handleEntityNotFound(_0xe9a777,null))[_0x2430('0x39')](function(_0x3693a7){if(_0x3693a7){_0x2babf6[_0x2430('0x62')]['FaxAccountId']=_0x3693a7['id'];return db[_0x2430('0x6c')][_0x2430('0x61')](_0x2babf6['body']);}})[_0x2430('0x39')](respondWithResult(_0xe9a777,null))[_0x2430('0x2e')](handleError(_0xe9a777,null));};exports[_0x2430('0x6d')]=function(_0x3bcb48,_0x25b0ce,_0x262398){var _0x7a9af4={'raw':![],'where':{}};var _0x58c0c0={};var _0xe994af={'count':0x0,'rows':[]};return db[_0x2430('0x57')][_0x2430('0x6e')]({'where':{'id':_0x3bcb48[_0x2430('0x5c')]['id']}})['then'](handleEntityNotFound(_0x25b0ce,null))['then'](function(_0x1d43c1){if(_0x1d43c1){_0x58c0c0['model']=_[_0x2430('0x46')](db['Disposition']['rawAttributes']);_0x58c0c0[_0x2430('0x45')]=_[_0x2430('0x46')](_0x3bcb48[_0x2430('0x45')]);_0x58c0c0[_0x2430('0x47')]=_[_0x2430('0x48')](_0x58c0c0['model'],_0x58c0c0[_0x2430('0x45')]);_0x7a9af4[_0x2430('0x4a')]=_['intersection'](_0x58c0c0[_0x2430('0x44')],qs[_0x2430('0x49')](_0x3bcb48['query']['fields']));_0x7a9af4[_0x2430('0x4a')]=_0x7a9af4[_0x2430('0x4a')]['length']?_0x7a9af4[_0x2430('0x4a')]:_0x58c0c0[_0x2430('0x44')];if(!_0x3bcb48[_0x2430('0x45')]['hasOwnProperty'](_0x2430('0x4d'))){_0x7a9af4[_0x2430('0x32')]=qs[_0x2430('0x32')](_0x3bcb48[_0x2430('0x45')]['limit']);_0x7a9af4['offset']=qs['offset'](_0x3bcb48['query'][_0x2430('0x31')]);}_0x7a9af4['order']=qs[_0x2430('0x4f')](_0x3bcb48[_0x2430('0x45')][_0x2430('0x4f')]);_0x7a9af4[_0x2430('0x56')]=qs[_0x2430('0x47')](_['pick'](_0x3bcb48[_0x2430('0x45')],_0x58c0c0['filters']));_0x7a9af4['where'][_0x2430('0x6f')]=_0x1d43c1['id'];if(_0x3bcb48[_0x2430('0x45')][_0x2430('0x51')]){_0x7a9af4[_0x2430('0x56')]=_[_0x2430('0x52')](_0x7a9af4[_0x2430('0x56')],{'$or':_['map'](_0x7a9af4[_0x2430('0x4a')],function(_0x24a989){var _0x2bf185={};_0x2bf185[_0x24a989]={'$like':'%'+_0x3bcb48[_0x2430('0x45')][_0x2430('0x51')]+'%'};return _0x2bf185;})});}_0x7a9af4=_['merge']({},_0x7a9af4,_0x3bcb48['options']);return db[_0x2430('0x6c')][_0x2430('0x34')]({'where':_0x7a9af4[_0x2430('0x56')]})[_0x2430('0x39')](function(_0x42ed92){_0xe994af['count']=_0x42ed92;if(_0x3bcb48[_0x2430('0x45')][_0x2430('0x58')]){_0x7a9af4[_0x2430('0x5f')]=[{'all':!![]}];}return db[_0x2430('0x6c')][_0x2430('0x59')](_0x7a9af4);})['then'](function(_0x124b27){_0xe994af[_0x2430('0x5a')]=_0x124b27;return _0xe994af;});}})['then'](respondWithFilteredResult(_0x25b0ce,_0x7a9af4))[_0x2430('0x2e')](handleError(_0x25b0ce,null));};exports['removeDispositions']=function(_0x5e4316,_0x59d2ae,_0x44e1a1){return db['FaxAccount'][_0x2430('0x60')]({'where':{'id':_0x5e4316[_0x2430('0x5c')]['id']}})[_0x2430('0x39')](handleEntityNotFound(_0x59d2ae,null))[_0x2430('0x39')](function(_0x5063c9){if(_0x5063c9){return _0x5063c9[_0x2430('0x70')](_0x5e4316[_0x2430('0x45')][_0x2430('0x71')]);}})[_0x2430('0x39')](respondWithStatusCode(_0x59d2ae,null))[_0x2430('0x2e')](handleError(_0x59d2ae,null));};exports['addAnswer']=function(_0x2cb459,_0x67652,_0x5cf0eb){if(_0x2cb459[_0x2430('0x62')]['id']){delete _0x2cb459[_0x2430('0x62')]['id'];}return db['FaxAccount'][_0x2430('0x60')]({'where':{'id':_0x2cb459[_0x2430('0x5c')]['id']}})['then'](handleEntityNotFound(_0x67652,null))[_0x2430('0x39')](function(_0x4a7967){if(_0x4a7967){_0x2cb459['body'][_0x2430('0x6f')]=_0x4a7967['id'];return db[_0x2430('0x72')][_0x2430('0x61')](_0x2cb459[_0x2430('0x62')]);}})['then'](respondWithResult(_0x67652,null))['catch'](handleError(_0x67652,null));};exports[_0x2430('0x73')]=function(_0x454f2b,_0x2dd1d5,_0x3473e8){var _0x5258d6={'raw':![],'where':{}};var _0x14bf1a={};var _0x584aae={'count':0x0,'rows':[]};return db[_0x2430('0x57')]['findOne']({'where':{'id':_0x454f2b[_0x2430('0x5c')]['id']}})[_0x2430('0x39')](handleEntityNotFound(_0x2dd1d5,null))[_0x2430('0x39')](function(_0xf5d45){if(_0xf5d45){_0x14bf1a[_0x2430('0x44')]=_['keys'](db[_0x2430('0x72')][_0x2430('0x5e')]);_0x14bf1a[_0x2430('0x45')]=_['keys'](_0x454f2b[_0x2430('0x45')]);_0x14bf1a[_0x2430('0x47')]=_[_0x2430('0x48')](_0x14bf1a['model'],_0x14bf1a['query']);_0x5258d6[_0x2430('0x4a')]=_[_0x2430('0x48')](_0x14bf1a['model'],qs[_0x2430('0x49')](_0x454f2b[_0x2430('0x45')][_0x2430('0x49')]));_0x5258d6['attributes']=_0x5258d6[_0x2430('0x4a')][_0x2430('0x4b')]?_0x5258d6[_0x2430('0x4a')]:_0x14bf1a[_0x2430('0x44')];if(!_0x454f2b[_0x2430('0x45')][_0x2430('0x4c')](_0x2430('0x4d'))){_0x5258d6[_0x2430('0x32')]=qs[_0x2430('0x32')](_0x454f2b[_0x2430('0x45')][_0x2430('0x32')]);_0x5258d6[_0x2430('0x31')]=qs['offset'](_0x454f2b['query'][_0x2430('0x31')]);}_0x5258d6['order']=qs['sort'](_0x454f2b[_0x2430('0x45')][_0x2430('0x4f')]);_0x5258d6['where']=qs[_0x2430('0x47')](_[_0x2430('0x50')](_0x454f2b[_0x2430('0x45')],_0x14bf1a[_0x2430('0x47')]));_0x5258d6[_0x2430('0x56')]['FaxAccountId']=_0xf5d45['id'];if(_0x454f2b[_0x2430('0x45')]['filter']){_0x5258d6[_0x2430('0x56')]=_[_0x2430('0x52')](_0x5258d6[_0x2430('0x56')],{'$or':_[_0x2430('0x42')](_0x5258d6['attributes'],function(_0x1680d5){var _0x5c0055={};_0x5c0055[_0x1680d5]={'$like':'%'+_0x454f2b['query'][_0x2430('0x51')]+'%'};return _0x5c0055;})});}_0x5258d6=_['merge']({},_0x5258d6,_0x454f2b[_0x2430('0x55')]);return db[_0x2430('0x72')][_0x2430('0x34')]({'where':_0x5258d6[_0x2430('0x56')]})['then'](function(_0x261860){_0x584aae['count']=_0x261860;if(_0x454f2b[_0x2430('0x45')]['includeAll']){_0x5258d6[_0x2430('0x5f')]=[{'all':!![]}];}return db[_0x2430('0x72')]['findAll'](_0x5258d6);})['then'](function(_0x54c063){_0x584aae[_0x2430('0x5a')]=_0x54c063;return _0x584aae;});}})[_0x2430('0x39')](respondWithFilteredResult(_0x2dd1d5,_0x5258d6))[_0x2430('0x2e')](handleError(_0x2dd1d5,null));};exports[_0x2430('0x74')]=function(_0x1d5c8e,_0x59cf93,_0x457ce2){return db[_0x2430('0x57')]['find']({'where':{'id':_0x1d5c8e[_0x2430('0x5c')]['id']}})['then'](handleEntityNotFound(_0x59cf93,null))[_0x2430('0x39')](function(_0x5110d6){if(_0x5110d6){return _0x5110d6[_0x2430('0x74')](_0x1d5c8e[_0x2430('0x45')][_0x2430('0x71')]);}})[_0x2430('0x39')](respondWithStatusCode(_0x59cf93,null))[_0x2430('0x2e')](handleError(_0x59cf93,null));};exports[_0x2430('0x75')]=function(_0x178278,_0x5b22a5,_0x3a8739){return db[_0x2430('0x76')][_0x2430('0x60')]({'where':{'id':_0x178278[_0x2430('0x5c')]['id']}})[_0x2430('0x39')](handleEntityNotFound(_0x5b22a5,null))[_0x2430('0x39')](function(_0x515c3b){if(_0x515c3b){return _0x515c3b[_0x2430('0x75')](_0x178278[_0x2430('0x62')][_0x2430('0x71')],_[_0x2430('0x77')](_0x178278[_0x2430('0x62')],[_0x2430('0x71'),'id'])||{});}})['then'](respondWithResult(_0x5b22a5,null))['catch'](handleError(_0x5b22a5,null));};exports[_0x2430('0x78')]=function(_0x4a2fcd,_0x2e3aba,_0x128879){var _0x3b748b={'raw':![],'where':{}};var _0x85e3e7={};var _0x38f307={'count':0x0,'rows':[]};return db[_0x2430('0x57')][_0x2430('0x6e')]({'where':{'id':_0x4a2fcd['params']['id']}})[_0x2430('0x39')](handleEntityNotFound(_0x2e3aba,null))[_0x2430('0x39')](function(_0x374e20){if(_0x374e20){_0x85e3e7['model']=_[_0x2430('0x46')](db[_0x2430('0x76')][_0x2430('0x5e')]);_0x85e3e7[_0x2430('0x45')]=_[_0x2430('0x46')](_0x4a2fcd[_0x2430('0x45')]);_0x85e3e7[_0x2430('0x47')]=_[_0x2430('0x48')](_0x85e3e7[_0x2430('0x44')],_0x85e3e7['query']);_0x3b748b['attributes']=_[_0x2430('0x48')](_0x85e3e7[_0x2430('0x44')],qs[_0x2430('0x49')](_0x4a2fcd[_0x2430('0x45')][_0x2430('0x49')]));_0x3b748b[_0x2430('0x4a')]=_0x3b748b[_0x2430('0x4a')][_0x2430('0x4b')]?_0x3b748b[_0x2430('0x4a')]:_0x85e3e7[_0x2430('0x44')];if(!_0x4a2fcd[_0x2430('0x45')][_0x2430('0x4c')]('nolimit')){_0x3b748b['limit']=qs[_0x2430('0x32')](_0x4a2fcd[_0x2430('0x45')][_0x2430('0x32')]);_0x3b748b[_0x2430('0x31')]=qs[_0x2430('0x31')](_0x4a2fcd[_0x2430('0x45')][_0x2430('0x31')]);}_0x3b748b[_0x2430('0x4e')]=qs[_0x2430('0x4f')](_0x4a2fcd[_0x2430('0x45')][_0x2430('0x4f')]);_0x3b748b[_0x2430('0x56')]=qs[_0x2430('0x47')](_['pick'](_0x4a2fcd[_0x2430('0x45')],_0x85e3e7[_0x2430('0x47')]));_0x3b748b[_0x2430('0x56')][_0x2430('0x6f')]=_0x374e20['id'];if(_0x4a2fcd['query'][_0x2430('0x51')]){_0x3b748b[_0x2430('0x56')]=_[_0x2430('0x52')](_0x3b748b[_0x2430('0x56')],{'$or':_[_0x2430('0x42')](_0x3b748b['attributes'],function(_0x4d9fc7){var _0x27c99b={};_0x27c99b[_0x4d9fc7]={'$like':'%'+_0x4a2fcd[_0x2430('0x45')][_0x2430('0x51')]+'%'};return _0x27c99b;})});}_0x3b748b=_['merge']({},_0x3b748b,_0x4a2fcd[_0x2430('0x55')]);return db[_0x2430('0x76')]['count']({'where':_0x3b748b[_0x2430('0x56')]})[_0x2430('0x39')](function(_0x4f7a15){_0x38f307[_0x2430('0x34')]=_0x4f7a15;if(_0x4a2fcd[_0x2430('0x45')][_0x2430('0x58')]){_0x3b748b[_0x2430('0x5f')]=[{'model':db[_0x2430('0x79')],'as':_0x2430('0x7a'),'required':![]},{'model':db['User'],'as':_0x2430('0x7b'),'attributes':[_0x2430('0x3f'),'fullname',_0x2430('0x7c')],'required':![]},{'model':db[_0x2430('0x7d')],'as':_0x2430('0x7e'),'attributes':['id','name','color'],'where':_0x4a2fcd[_0x2430('0x45')][_0x2430('0x7f')]?{'id':_0x4a2fcd['query'][_0x2430('0x7f')]}:undefined,'required':_0x4a2fcd[_0x2430('0x45')]['tag']?!![]:![]}];}return db[_0x2430('0x76')][_0x2430('0x59')](_0x3b748b);})[_0x2430('0x39')](function(_0x4d2a3a){_0x38f307['rows']=_0x4d2a3a;return _0x38f307;});}})[_0x2430('0x39')](respondWithFilteredResult(_0x2e3aba,_0x3b748b))[_0x2430('0x2e')](handleError(_0x2e3aba,null));};exports[_0x2430('0x80')]=function(_0x1d6e29,_0x2e4853){var _0x17be37=_0x1d6e29[_0x2430('0x5c')]['id'];var _0x8df89a=_0x1d6e29['body'];var _0x14ae6d=0xc8;var _0x524633=null;return db[_0x2430('0x81')][_0x2430('0x82')]({'isolationLevel':db[_0x2430('0x81')][_0x2430('0x83')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x401ac8){return db[_0x2430('0x57')][_0x2430('0x6e')]({'where':{'id':_0x17be37},'transaction':_0x401ac8})[_0x2430('0x39')](function(_0x36a6aa){if(_0x36a6aa){return db[_0x2430('0x84')][_0x2430('0x69')]({'where':{'FaxAccountId':_0x17be37},'transaction':_0x401ac8})[_0x2430('0x39')](function(){var _0x3efdb9=_[_0x2430('0x42')](_0x8df89a,function(_0x37d352){_0x37d352[_0x2430('0x6f')]=_0x17be37;return _0x37d352;});return db[_0x2430('0x84')]['bulkCreate'](_0x3efdb9,{'transaction':_0x401ac8});});}else{_0x14ae6d=0x194;_0x524633=[];}});})[_0x2430('0x39')](function(){if(_0x14ae6d!==0x194){return db[_0x2430('0x84')][_0x2430('0x85')]({'where':{'FaxAccountId':_0x17be37},'order':_0x2430('0x86')})['then'](function(_0x5207d7){_0x524633=_0x5207d7;});}})[_0x2430('0x2e')](function(_0x323eb7){_0x14ae6d=0x1f4;logger[_0x2430('0x29')](_0x323eb7[_0x2430('0x3e')]);if(_0x323eb7[_0x2430('0x3f')]){delete _0x323eb7[_0x2430('0x3f')];}_0x524633=_0x323eb7;})[_0x2430('0x87')](function(){if(_0x524633===null){_0x2e4853['sendStatus'](_0x14ae6d);}else{if(_0x14ae6d===0x1f4){_0x2e4853[_0x2430('0x2f')](_0x14ae6d)[_0x2430('0x88')](_0x524633);}else{_0x2e4853[_0x2430('0x2f')](_0x14ae6d)[_0x2430('0x30')](_0x524633);}}});};exports[_0x2430('0x89')]=function(_0x4192ff,_0x5ea8f0,_0x32b57f){var _0x3eddbc={};var _0x2f4107={};var _0x1f04a0;var _0x53c82d;return db['FaxAccount'][_0x2430('0x6e')]({'where':{'id':_0x4192ff['params']['id']}})[_0x2430('0x39')](handleEntityNotFound(_0x5ea8f0,null))[_0x2430('0x39')](function(_0x2dc7f9){if(_0x2dc7f9){_0x1f04a0=_0x2dc7f9;_0x2f4107['model']=_['keys'](db[_0x2430('0x84')][_0x2430('0x5e')]);_0x2f4107[_0x2430('0x45')]=_[_0x2430('0x46')](_0x4192ff['query']);_0x2f4107[_0x2430('0x47')]=_['intersection'](_0x2f4107[_0x2430('0x44')],_0x2f4107[_0x2430('0x45')]);_0x3eddbc['attributes']=_[_0x2430('0x48')](_0x2f4107[_0x2430('0x44')],qs[_0x2430('0x49')](_0x4192ff[_0x2430('0x45')][_0x2430('0x49')]));_0x3eddbc['attributes']=_0x3eddbc[_0x2430('0x4a')][_0x2430('0x4b')]?_0x3eddbc[_0x2430('0x4a')]:_0x2f4107[_0x2430('0x44')];_0x3eddbc[_0x2430('0x4e')]=qs[_0x2430('0x4f')](_0x4192ff[_0x2430('0x45')]['sort']);_0x3eddbc[_0x2430('0x56')]=qs[_0x2430('0x47')](_[_0x2430('0x50')](_0x4192ff[_0x2430('0x45')],_0x2f4107[_0x2430('0x47')]));if(_0x4192ff[_0x2430('0x45')][_0x2430('0x51')]){_0x3eddbc[_0x2430('0x56')]=_['merge'](_0x3eddbc['where'],{'$or':_['map'](_0x3eddbc[_0x2430('0x4a')],function(_0x4e4931){var _0x538d54={};_0x538d54[_0x4e4931]={'$like':'%'+_0x4192ff['query'][_0x2430('0x51')]+'%'};return _0x538d54;})});}_0x3eddbc=_[_0x2430('0x52')]({},_0x3eddbc,_0x4192ff[_0x2430('0x55')]);return _0x1f04a0[_0x2430('0x89')](_0x3eddbc);}})['then'](function(_0x28bf50){if(_0x28bf50){_0x53c82d=_0x28bf50[_0x2430('0x4b')];if(!_0x4192ff[_0x2430('0x45')][_0x2430('0x4c')](_0x2430('0x4d'))){_0x3eddbc[_0x2430('0x32')]=qs[_0x2430('0x32')](_0x4192ff[_0x2430('0x45')]['limit']);_0x3eddbc[_0x2430('0x31')]=qs['offset'](_0x4192ff['query'][_0x2430('0x31')]);}return _0x1f04a0[_0x2430('0x89')](_0x3eddbc);}})[_0x2430('0x39')](function(_0x5eb5bd){if(_0x5eb5bd){return _0x5eb5bd?{'count':_0x53c82d,'rows':_0x5eb5bd}:null;}})['then'](respondWithResult(_0x5ea8f0,null))[_0x2430('0x2e')](handleError(_0x5ea8f0,null));};function Extension(_0x5d153a,_0x5cb700,_0x36f371,_0x1e6d3b){this[_0x2430('0x8a')]='from-voip-provider';this['exten']=_0x5d153a[_0x2430('0x8b')];this[_0x2430('0x8c')]=_0x1e6d3b;this[_0x2430('0x53')]=_0x2430('0x8d');this[_0x2430('0x8e')]='Fax\x20Extension';this[_0x2430('0x6f')]=_0x5d153a['id'];this[_0x2430('0x86')]=_0x5cb700;this[_0x2430('0x8f')]=_0x36f371;}function createExtensionsReciveFax(_0x45252d){var _0x5c0631=0x1;var _0x67eddd=[];_0x67eddd[_0x2430('0x90')](new Extension(_0x45252d,_0x5c0631,'',_0x2430('0x91')));_0x5c0631+=0x1;_0x67eddd[_0x2430('0x90')](new Extension(_0x45252d,_0x5c0631,_0x2430('0x92'),_0x2430('0x93')));_0x5c0631+=0x1;for(var _0x4512fd in _0x45252d){if(_0x45252d[_0x2430('0x4c')](_0x4512fd)&&(_0x4512fd===_0x2430('0x94')||_0x4512fd===_0x2430('0x8b')||_0x4512fd===_0x2430('0x95')||_0x4512fd===_0x2430('0x96')||_0x4512fd===_0x2430('0x97')||_0x4512fd===_0x2430('0x98')||_0x4512fd===_0x2430('0x99')||_0x4512fd===_0x2430('0x9a')||_0x4512fd==='t38timeout')){_0x67eddd[_0x2430('0x90')](new Extension(_0x45252d,_0x5c0631,_0x2430('0x9b')+_0x4512fd+')='+_0x45252d[_0x4512fd],'Set'));_0x5c0631+=0x1;}}_0x67eddd['push'](new Extension(_0x45252d,_0x5c0631,'6',_0x2430('0x9c')));_0x5c0631+=0x1;_0x67eddd[_0x2430('0x90')](new Extension(_0x45252d,_0x5c0631,'/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'));_0x5c0631=0x0;return _0x67eddd;}exports[_0x2430('0x9d')]=function(_0x52ee5a,_0x330c94,_0x5d9c20){var _0x3dbd1b;return db[_0x2430('0x81')][_0x2430('0x82')](function(_0x39b302){return db[_0x2430('0x57')]['create'](_0x52ee5a[_0x2430('0x62')],{'transaction':_0x39b302})[_0x2430('0x39')](function(_0x5a10c0){_0x3dbd1b=_0x5a10c0[_0x2430('0x3a')]({'plain':!![]});return db[_0x2430('0x9e')][_0x2430('0x9f')](createExtensionsReciveFax(_0x3dbd1b),{'transaction':_0x39b302});});})[_0x2430('0x39')](function(){return _0x3dbd1b;})[_0x2430('0x39')](respondWithResult(_0x330c94,null))[_0x2430('0x2e')](handleError(_0x330c94,null));};exports['updateAccountApplications']=function(_0x36581e,_0x544a6c,_0x2f71f2){var _0x540ecf;return db[_0x2430('0x81')]['transaction'](function(_0x551f3d){return db['FaxAccount'][_0x2430('0x38')](_0x36581e['body'],{'where':{'id':_0x36581e[_0x2430('0x62')]['id']},'transaction':_0x551f3d})['then'](function(_0x4c48ed){return db[_0x2430('0x9e')]['destroy']({'where':{'FaxAccountId':_0x36581e[_0x2430('0x62')]['id']},'transaction':_0x551f3d})['then'](function(_0x398b62){return db[_0x2430('0x9e')][_0x2430('0x9f')](createExtensionsReciveFax(_['omit'](_0x36581e[_0x2430('0x62')],['tech',_0x2430('0x43'),_0x2430('0xa0'),'updatedAt',_0x2430('0xa1'),'ListId'])),{'transaction':_0x551f3d});});});})[_0x2430('0x39')](function(){return db[_0x2430('0x57')][_0x2430('0xa2')](_0x36581e[_0x2430('0x62')]['id']);})['then'](respondWithResult(_0x544a6c,null))[_0x2430('0x2e')](handleError(_0x544a6c,null));};exports[_0x2430('0xa3')]=function(_0x4e7cec,_0x145477,_0x223136){var _0x1ab946={'raw':!![],'where':{}};var _0x31010b={};var _0x3d8610={'count':0x0,'rows':[]};return db[_0x2430('0x57')]['findOne']({'where':{'id':_0x4e7cec[_0x2430('0x5c')]['id']}})[_0x2430('0x39')](handleEntityNotFound(_0x145477,null))[_0x2430('0x39')](function(_0x26ba6e){if(_0x26ba6e){_0x31010b['model']=_[_0x2430('0x46')](db[_0x2430('0xa4')][_0x2430('0x5e')]);_0x31010b[_0x2430('0x45')]=_['keys'](_0x4e7cec[_0x2430('0x45')]);_0x31010b['filters']=_[_0x2430('0x48')](_0x31010b[_0x2430('0x44')],_0x31010b[_0x2430('0x45')]);_0x1ab946[_0x2430('0x4a')]=_['intersection'](_0x31010b[_0x2430('0x44')],qs['fields'](_0x4e7cec[_0x2430('0x45')][_0x2430('0x49')]));_0x1ab946['attributes']=_0x1ab946[_0x2430('0x4a')]['length']?_0x1ab946[_0x2430('0x4a')]:_0x31010b[_0x2430('0x44')];if(!_0x4e7cec['query']['hasOwnProperty']('nolimit')){_0x1ab946[_0x2430('0x32')]=qs['limit'](_0x4e7cec[_0x2430('0x45')]['limit']);_0x1ab946['offset']=qs[_0x2430('0x31')](_0x4e7cec[_0x2430('0x45')]['offset']);}_0x1ab946[_0x2430('0x4e')]=qs[_0x2430('0x4f')](_0x4e7cec[_0x2430('0x45')]['sort']);_0x1ab946[_0x2430('0x56')]=qs[_0x2430('0x47')](_['pick'](_0x4e7cec[_0x2430('0x45')],_0x31010b[_0x2430('0x47')]));_0x1ab946[_0x2430('0x56')][_0x2430('0x6f')]=_0x26ba6e['id'];if(_0x4e7cec['query'][_0x2430('0x51')]){_0x1ab946[_0x2430('0x56')]=_[_0x2430('0x52')](_0x1ab946['where'],{'$or':_[_0x2430('0x42')](_0x1ab946[_0x2430('0x4a')],function(_0x239a1c){var _0x2f34bc={};_0x2f34bc[_0x239a1c]={'$like':'%'+_0x4e7cec[_0x2430('0x45')][_0x2430('0x51')]+'%'};return _0x2f34bc;})});}if(_0x4e7cec[_0x2430('0x45')]['$gte']){var _0x5cabd3=_0x4e7cec[_0x2430('0x45')][_0x2430('0xa5')][_0x2430('0xa6')](',');var _0x54218c={};_0x54218c[_0x5cabd3[0x0]]={'$gte':moment(_0x5cabd3[0x1])[_0x2430('0xa7')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1ab946[_0x2430('0x56')]=_[_0x2430('0x52')](_0x1ab946['where'],_0x54218c);}_0x1ab946=_[_0x2430('0x52')]({},_0x1ab946,_0x4e7cec['options']);return db[_0x2430('0xa4')]['count']({'where':_0x1ab946[_0x2430('0x56')]})[_0x2430('0x39')](function(_0x57eaf8){_0x3d8610[_0x2430('0x34')]=_0x57eaf8;if(_0x4e7cec[_0x2430('0x45')]['includeAll']){_0x1ab946[_0x2430('0x5f')]=[{'all':!![]}];}return db[_0x2430('0xa4')][_0x2430('0x59')](_0x1ab946);})[_0x2430('0x39')](function(_0x22305d){_0x3d8610[_0x2430('0x5a')]=_0x22305d;return _0x3d8610;});}})[_0x2430('0x39')](respondWithFilteredResult(_0x145477,_0x1ab946))[_0x2430('0x2e')](handleError(_0x145477,null));};exports[_0x2430('0x88')]=function(_0x75a28b,_0x65690,_0x262f15){var _0x20a40f,_0x93cde8={},_0x4573c3;if(_0x75a28b[_0x2430('0x62')]['to']){_0x4573c3=_0x75a28b[_0x2430('0x62')]['to'][0x0];}return db[_0x2430('0x57')][_0x2430('0x60')]({'where':{'id':_0x75a28b['params']['id']},'include':[{'model':db[_0x2430('0xa8')],'as':_0x2430('0xa9'),'include':[{'model':db[_0x2430('0x79')],'as':_0x2430('0xaa'),'where':{'fax':_0x4573c3},'limit':0x1,'order':[[_0x2430('0xab'),_0x2430('0xac')]]}]}]})[_0x2430('0x39')](handleEntityNotFound(_0x65690,null))[_0x2430('0x39')](function(_0x38bdc4){_0x20a40f=_0x38bdc4;if(_0x75a28b['body'][_0x2430('0xad')]&&_0x75a28b['body'][_0x2430('0xad')][_0x2430('0x4b')]){for(var _0x3a3dca=0x0;_0x3a3dca<_0x75a28b[_0x2430('0x62')][_0x2430('0xad')][_0x2430('0x4b')];_0x3a3dca+=0x1){_0x75a28b[_0x2430('0x62')][_0x2430('0xad')][_0x3a3dca]={'filename':_0x75a28b[_0x2430('0x62')][_0x2430('0xad')][_0x3a3dca][_0x2430('0x3f')],'id':_0x75a28b[_0x2430('0x62')][_0x2430('0xad')][_0x3a3dca]['id'],'path':path[_0x2430('0xae')](config[_0x2430('0xaf')],_0x2430('0xb0'),_0x75a28b[_0x2430('0x62')][_0x2430('0xad')][_0x3a3dca]['basename'])};}}return respondWithRpcPromise('CheckAfterSend',_0x2430('0xb1'),{'FaxAccountId':_[_0x2430('0xb2')](_0x75a28b[_0x2430('0x5c')]['id'])?undefined:_0x75a28b[_0x2430('0x5c')]['id'],'path':_[_0x2430('0xb2')](_0x75a28b['body'][_0x2430('0xad')][0x0][_0x2430('0x8')])?undefined:_0x75a28b[_0x2430('0x62')][_0x2430('0xad')][0x0][_0x2430('0x8')],'fax':_[_0x2430('0xb2')](_0x75a28b[_0x2430('0x62')]['to'][0x0])?undefined:_0x75a28b['body']['to'][0x0]},client9002);})[_0x2430('0x39')](function(){if(_0x20a40f){if(_[_0x2430('0xb2')](_0x75a28b[_0x2430('0x62')][_0x2430('0xb3')])){_0x75a28b[_0x2430('0x62')][_0x2430('0xb3')]=util[_0x2430('0xa7')]('\x22%s\x22\x20<%s>',_0x20a40f['name'],_0x20a40f[_0x2430('0xb4')]);}if(_0x20a40f[_0x2430('0xa9')]){if(_0x20a40f[_0x2430('0xa9')][_0x2430('0xaa')][_0x2430('0x4b')]){return _0x20a40f['List'][_0x2430('0xaa')][0x0];}else{return db[_0x2430('0x79')]['create'](_[_0x2430('0x1c')](_0x75a28b[_0x2430('0x62')],{'firstName':_0x75a28b[_0x2430('0x62')]['to'][0x0],'phone':_0x75a28b['body']['to'][0x0],'fax':_0x75a28b[_0x2430('0x62')]['to'][0x0],'ListId':_0x20a40f[_0x2430('0xb5')]}));}}else{throw new Error(_0x2430('0xb6'));}}else{throw new Error('Send\x20Fax\x20failed');}})['then'](function(_0x49d204){if(_0x49d204){return db['FaxInteraction'][_0x2430('0x60')]({'where':{'ContactId':_0x49d204['id'],'closed':![],'FaxAccountId':_0x20a40f['id']}})[_0x2430('0x39')](function(_0x14b555){if(_0x14b555){return[_0x14b555,![]];}return db[_0x2430('0x76')][_0x2430('0x61')]({'UserId':_0x75a28b[_0x2430('0x64')]['id'],'ContactId':_0x49d204['id'],'FaxAccountId':_0x20a40f['id'],'fax':_0x75a28b[_0x2430('0x62')]['to'][0x0],'firstMsgDirection':_0x2430('0xb7'),'Messages':[_[_0x2430('0x52')](_0x75a28b[_0x2430('0x62')],{'read':![],'body':_0x75a28b[_0x2430('0x62')][_0x2430('0xad')][0x0][_0x2430('0xb8')],'FaxAccountId':_0x20a40f['id'],'UserId':_0x75a28b[_0x2430('0x64')]['id'],'ContactId':_0x49d204['id'],'AttachmentId':_0x75a28b['body'][_0x2430('0xad')][0x0]['id']})]},{'include':[{'model':db[_0x2430('0xa4')],'as':_0x2430('0xb9')}]})[_0x2430('0x39')](function(_0x2e6a14){return[_0x2e6a14,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x2430('0xba')](function(_0x11e59e,_0x17f904){if(_0x17f904){return _0x11e59e;}return db['FaxMessage'][_0x2430('0x61')]({'direction':'out','read':![],'body':_0x75a28b[_0x2430('0x62')]['attachments'][0x0][_0x2430('0xb8')],'FaxAccountId':_0x20a40f['id'],'FaxInteractionId':_0x11e59e['id'],'UserId':_0x75a28b[_0x2430('0x64')]['id'],'ContactId':_0x11e59e[_0x2430('0xbb')],'AttachmentId':_0x75a28b[_0x2430('0x62')][_0x2430('0xad')][0x0]['id']})[_0x2430('0x39')](function(_0xe84874){_0x11e59e[_0x2430('0xbc')][_0x2430('0xb9')]=[];_0x11e59e['dataValues'][_0x2430('0xb9')]['push'](_0xe84874[_0x2430('0xbc')]);return _0x11e59e;});})[_0x2430('0x39')](function(_0x44dca4){respondWithRpcPromise('SendFax',_0x2430('0xbd'),{'FaxAccountId':_[_0x2430('0xb2')](_0x75a28b[_0x2430('0x5c')]['id'])?undefined:_0x75a28b['params']['id'],'path':_[_0x2430('0xb2')](_0x75a28b['body']['attachments'][0x0][_0x2430('0x8')])?undefined:_0x75a28b[_0x2430('0x62')][_0x2430('0xad')][0x0][_0x2430('0x8')],'fax':_[_0x2430('0xb2')](_0x75a28b[_0x2430('0x62')]['to'][0x0])?undefined:_0x75a28b[_0x2430('0x62')]['to'][0x0],'AttachmentId':_0x75a28b[_0x2430('0x62')]['attachments'][0x0]['id']},client9002)['then'](function(_0x2a879f){logger[_0x2430('0x24')](_0x2430('0xbe'),_0x2a879f);})[_0x2430('0x2e')](function(_0x5c0c74){logger[_0x2430('0x24')](_0x2430('0xbe'),_0x5c0c74);});return _0x44dca4;})[_0x2430('0x39')](respondWithResult(_0x65690,null))['catch'](handleError(_0x65690,null));};exports['addAgents']=function(_0xbde8e9,_0x509057,_0x5023ca){return db[_0x2430('0x57')][_0x2430('0x60')]({'where':{'id':_0xbde8e9['params']['id']}})[_0x2430('0x39')](handleEntityNotFound(_0x509057,null))[_0x2430('0x39')](function(_0x15773f){if(_0x15773f){return _0x15773f[_0x2430('0xbf')](_0xbde8e9[_0x2430('0x62')]['ids'],_[_0x2430('0x77')](_0xbde8e9[_0x2430('0x62')],['ids','id'])||{})[_0x2430('0xba')](function(_0x982a6a){for(var _0x265426=0x0;_0x265426<_0xbde8e9[_0x2430('0x62')]['ids'][_0x2430('0x4b')];_0x265426+=0x1){socket[_0x2430('0xc0')]('userFaxAccount:save',{'UserId':Number(_0xbde8e9[_0x2430('0x62')][_0x2430('0x71')][_0x265426]),'FaxAccountId':Number(_0xbde8e9[_0x2430('0x5c')]['id'])});}return _0x982a6a;});}})[_0x2430('0x39')](respondWithResult(_0x509057,null))[_0x2430('0x2e')](handleError(_0x509057,null));};exports[_0x2430('0xc1')]=function(_0x313463,_0x45173d,_0x1bb24d){return db[_0x2430('0x57')][_0x2430('0x60')]({'where':{'id':_0x313463[_0x2430('0x5c')]['id']}})[_0x2430('0x39')](handleEntityNotFound(_0x45173d,null))[_0x2430('0x39')](function(_0x50d385){if(_0x50d385){return _0x50d385[_0x2430('0xc1')](_0x313463[_0x2430('0x45')][_0x2430('0x71')])['then'](function(){if(_[_0x2430('0xc2')](_0x313463[_0x2430('0x45')][_0x2430('0x71')])){for(var _0xb53e6c=0x0;_0xb53e6c<_0x313463[_0x2430('0x45')][_0x2430('0x71')][_0x2430('0x4b')];_0xb53e6c+=0x1){socket[_0x2430('0xc0')](_0x2430('0xc3'),{'UserId':Number(_0x313463['query']['ids'][_0xb53e6c]),'FaxAccountId':Number(_0x313463['params']['id'])});}}else{socket[_0x2430('0xc0')](_0x2430('0xc3'),{'UserId':Number(_0x313463[_0x2430('0x45')][_0x2430('0x71')]),'FaxAccountId':Number(_0x313463['params']['id'])});}});}})[_0x2430('0x39')](respondWithStatusCode(_0x45173d,null))['catch'](handleError(_0x45173d,null));};exports[_0x2430('0xc4')]=function(_0x36c551,_0x35f3a2,_0x4f5653){var _0x29786e={};var _0x253707={};var _0x16e764;var _0xbdd5e6;return db[_0x2430('0x57')][_0x2430('0x6e')]({'where':{'id':_0x36c551[_0x2430('0x5c')]['id']}})['then'](handleEntityNotFound(_0x35f3a2,null))[_0x2430('0x39')](function(_0x323208){if(_0x323208){_0x16e764=_0x323208;_0x253707[_0x2430('0x44')]=_[_0x2430('0x46')](db[_0x2430('0xc5')][_0x2430('0x5e')]);_0x253707[_0x2430('0x45')]=_[_0x2430('0x46')](_0x36c551['query']);_0x253707[_0x2430('0x47')]=_[_0x2430('0x48')](_0x253707[_0x2430('0x44')],_0x253707['query']);_0x29786e[_0x2430('0x4a')]=_[_0x2430('0x48')](_0x253707[_0x2430('0x44')],qs[_0x2430('0x49')](_0x36c551['query'][_0x2430('0x49')]));_0x29786e[_0x2430('0x4a')]=_0x29786e[_0x2430('0x4a')]['length']?_0x29786e['attributes']:_0x253707[_0x2430('0x44')];_0x29786e[_0x2430('0x4e')]=qs[_0x2430('0x4f')](_0x36c551['query'][_0x2430('0x4f')]);_0x29786e['where']=qs[_0x2430('0x47')](_[_0x2430('0x50')](_0x36c551[_0x2430('0x45')],_0x253707[_0x2430('0x47')]));if(_0x36c551[_0x2430('0x45')][_0x2430('0x51')]){_0x29786e[_0x2430('0x56')]=_[_0x2430('0x52')](_0x29786e[_0x2430('0x56')],{'$or':_['map'](_0x29786e[_0x2430('0x4a')],function(_0x4b1815){var _0x345352={};_0x345352[_0x4b1815]={'$like':'%'+_0x36c551[_0x2430('0x45')][_0x2430('0x51')]+'%'};return _0x345352;})});}_0x29786e=_['merge']({},_0x29786e,_0x36c551[_0x2430('0x55')]);return _0x16e764[_0x2430('0xc4')](_0x29786e);}})[_0x2430('0x39')](function(_0x366844){if(_0x366844){_0xbdd5e6=_0x366844[_0x2430('0x4b')];if(!_0x36c551['query']['hasOwnProperty'](_0x2430('0x4d'))){_0x29786e[_0x2430('0x32')]=qs[_0x2430('0x32')](_0x36c551[_0x2430('0x45')]['limit']);_0x29786e[_0x2430('0x31')]=qs[_0x2430('0x31')](_0x36c551[_0x2430('0x45')][_0x2430('0x31')]);}return _0x16e764[_0x2430('0xc4')](_0x29786e);}})[_0x2430('0x39')](function(_0x3db691){if(_0x3db691){return _0x3db691?{'count':_0xbdd5e6,'rows':_0x3db691}:null;}})[_0x2430('0x39')](respondWithResult(_0x35f3a2,null))[_0x2430('0x2e')](handleError(_0x35f3a2,null));}; \ No newline at end of file +var _0x113f=['Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','transaction','VoiceExtension','updateAccountApplications','tech','updatedAt','ListId','findById','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','Contacts','DESC','attachments','root','server/files/attachments','basename','CheckAfterSend','isNil','path','from','format','\x22%s\x22\x20<%s>','List','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','out','ContactId','SendFax','SendFaxRpc,\x20%s','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./faxAccount.socket','register','jayson/promise','http','client','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','UserProfileResource','destroy','end','stack','name','send','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','filter','map','type','merge','options','includeAll','include','rows','show','params','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','FaxAccounts','UserProfileSection','autoAssociation','update','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','order','removeAnswers','ids','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Owner','Tags','color','tag','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','from-voip-provider','exten','localstationid','app','system','description'];(function(_0x29e2af,_0x15e2b1){var _0x1ea06a=function(_0x34d736){while(--_0x34d736){_0x29e2af['push'](_0x29e2af['shift']());}};_0x1ea06a(++_0x15e2b1);}(_0x113f,0x102));var _0xf113=function(_0xf39e84,_0x825c93){_0xf39e84=_0xf39e84-0x0;var _0x58e41f=_0x113f[_0xf39e84];return _0x58e41f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf113('0x0'));var zipdir=require(_0xf113('0x1'));var jsonpatch=require(_0xf113('0x2'));var rp=require(_0xf113('0x3'));var moment=require(_0xf113('0x4'));var BPromise=require(_0xf113('0x5'));var Mustache=require(_0xf113('0x6'));var util=require(_0xf113('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf113('0x8'));var squel=require(_0xf113('0x9'));var crypto=require(_0xf113('0xa'));var jsforce=require(_0xf113('0xb'));var deskjs=require(_0xf113('0xc'));var toCsv=require(_0xf113('0xd'));var querystring=require(_0xf113('0xe'));var Papa=require(_0xf113('0xf'));var Redis=require(_0xf113('0x10'));var authService=require(_0xf113('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf113('0x12'));var hardwareService=require(_0xf113('0x13'));var logger=require(_0xf113('0x14'))(_0xf113('0x15'));var utils=require(_0xf113('0x16'));var config=require(_0xf113('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xf113('0x18')]=_[_0xf113('0x19')](config[_0xf113('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xf113('0x1a'))(new Redis(config[_0xf113('0x18')]));require(_0xf113('0x1b'))[_0xf113('0x1c')](socket);var jayson=require(_0xf113('0x1d'));var client=jayson['client'][_0xf113('0x1e')]({'port':0x232c});var client9002=jayson[_0xf113('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14075d,_0x5de3a2,_0x1e41cd,_0x112ea5){return new BPromise(function(_0x378440,_0x229e7d){var _0x243248=_0x112ea5||client;return _0x243248[_0xf113('0x20')](_0x14075d,_0x1e41cd)[_0xf113('0x21')](function(_0xddab09){logger[_0xf113('0x22')](_0xf113('0x23'),_0x5de3a2,'request\x20sent');logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x5de3a2,_0xf113('0x24'),JSON[_0xf113('0x25')](_0xddab09));if(_0xddab09[_0xf113('0x26')]){if(_0xddab09[_0xf113('0x26')][_0xf113('0x27')]===0x1f4){logger['error'](_0xf113('0x23'),_0x5de3a2,_0xddab09['error'][_0xf113('0x28')]);return _0x229e7d(_0xddab09['error']['message']);}logger[_0xf113('0x26')]('FaxAccount,\x20%s,\x20%s',_0x5de3a2,_0xddab09['error'][_0xf113('0x28')]);return _0x378440(_0xddab09[_0xf113('0x26')][_0xf113('0x28')]);}else{logger[_0xf113('0x22')](_0xf113('0x23'),_0x5de3a2,_0xf113('0x24'));_0x378440(_0xddab09[_0xf113('0x29')][_0xf113('0x28')]);}})[_0xf113('0x2a')](function(_0x448742){logger[_0xf113('0x26')]('FaxAccount,\x20%s,\x20%s',_0x5de3a2,_0x448742);_0x229e7d(_0x448742);});});}function respondWithStatusCode(_0xaed233,_0x236273){_0x236273=_0x236273||0xcc;return function(_0x2f9c5c){if(_0x2f9c5c){return _0xaed233[_0xf113('0x2b')](_0x236273);}return _0xaed233[_0xf113('0x2c')](_0x236273)['end']();};}function respondWithResult(_0x32f8db,_0x2d150d){_0x2d150d=_0x2d150d||0xc8;return function(_0x566a6e){if(_0x566a6e){return _0x32f8db['status'](_0x2d150d)[_0xf113('0x2d')](_0x566a6e);}};}function respondWithFilteredResult(_0x2a7a33,_0x1421e7){return function(_0x47ba5f){if(_0x47ba5f){var _0x2b36c5=typeof _0x1421e7[_0xf113('0x2e')]===_0xf113('0x2f')&&typeof _0x1421e7[_0xf113('0x30')]===_0xf113('0x2f');var _0x2d9700=_0x47ba5f['count'];var _0x25950e=_0x2b36c5?0x0:_0x1421e7[_0xf113('0x2e')];var _0x5d876e=_0x2b36c5?_0x47ba5f[_0xf113('0x31')]:_0x1421e7[_0xf113('0x2e')]+_0x1421e7[_0xf113('0x30')];var _0x43bd6e;if(_0x5d876e>=_0x2d9700){_0x5d876e=_0x2d9700;_0x43bd6e=0xc8;}else{_0x43bd6e=0xce;}_0x2a7a33[_0xf113('0x2c')](_0x43bd6e);return _0x2a7a33[_0xf113('0x32')]('Content-Range',_0x25950e+'-'+_0x5d876e+'/'+_0x2d9700)[_0xf113('0x2d')](_0x47ba5f);}return null;};}function patchUpdates(_0x21f9e3){return function(_0x31a75c){try{jsonpatch[_0xf113('0x33')](_0x31a75c,_0x21f9e3,!![]);}catch(_0x4a3129){return BPromise['reject'](_0x4a3129);}return _0x31a75c[_0xf113('0x34')]();};}function saveUpdates(_0x2c9ac7,_0x1d9f20){return function(_0x3f542b){if(_0x3f542b){return _0x3f542b['update'](_0x2c9ac7)['then'](function(_0x2213a1){return _0x2213a1;});}return null;};}function removeEntity(_0x58f217,_0x3f5270){return function(_0x5f28a5){if(_0x5f28a5){return _0x5f28a5['destroy']()[_0xf113('0x21')](function(){var _0x988914=_0x5f28a5['get']({'plain':!![]});var _0x465397='FaxAccounts';return db[_0xf113('0x35')][_0xf113('0x36')]({'where':{'type':_0x465397,'resourceId':_0x988914['id']}})['then'](function(){return _0x5f28a5;});})['then'](function(){_0x58f217['status'](0xcc)[_0xf113('0x37')]();});}};}function handleEntityNotFound(_0x55ce47,_0x3ab51c){return function(_0x12e2e5){if(!_0x12e2e5){_0x55ce47[_0xf113('0x2b')](0x194);}return _0x12e2e5;};}function handleError(_0x5b6517,_0xbc175){_0xbc175=_0xbc175||0x1f4;return function(_0x3b19ff){logger[_0xf113('0x26')](_0x3b19ff[_0xf113('0x38')]);if(_0x3b19ff[_0xf113('0x39')]){delete _0x3b19ff[_0xf113('0x39')];}_0x5b6517[_0xf113('0x2c')](_0xbc175)[_0xf113('0x3a')](_0x3b19ff);};}exports[_0xf113('0x3b')]=function(_0x109c9d,_0x57e8f6){var _0x4bc753={'include':[{'model':db[_0xf113('0x3c')],'as':_0xf113('0x3d')}]},_0x35859a={},_0x2fdf95={'count':0x0,'rows':[]};var _0x80a58f=_['map'](db[_0xf113('0x3e')][_0xf113('0x3f')],function(_0x2c13d1){return{'name':_0x2c13d1['fieldName'],'type':_0x2c13d1['type'][_0xf113('0x40')]};});_0x35859a['model']=_['map'](_0x80a58f,_0xf113('0x39'));_0x35859a[_0xf113('0x41')]=_[_0xf113('0x42')](_0x109c9d['query']);_0x35859a[_0xf113('0x43')]=_[_0xf113('0x44')](_0x35859a[_0xf113('0x45')],_0x35859a[_0xf113('0x41')]);_0x4bc753[_0xf113('0x46')]=_['intersection'](_0x35859a[_0xf113('0x45')],qs[_0xf113('0x47')](_0x109c9d[_0xf113('0x41')][_0xf113('0x47')]));_0x4bc753[_0xf113('0x46')]=_0x4bc753[_0xf113('0x46')][_0xf113('0x48')]?_0x4bc753['attributes']:_0x35859a['model'];if(!_0x109c9d[_0xf113('0x41')]['hasOwnProperty'](_0xf113('0x49'))){_0x4bc753[_0xf113('0x30')]=qs[_0xf113('0x30')](_0x109c9d[_0xf113('0x41')][_0xf113('0x30')]);_0x4bc753['offset']=qs['offset'](_0x109c9d[_0xf113('0x41')][_0xf113('0x2e')]);}_0x4bc753['order']=qs[_0xf113('0x4a')](_0x109c9d[_0xf113('0x41')]['sort']);_0x4bc753[_0xf113('0x4b')]=qs[_0xf113('0x43')](_[_0xf113('0x4c')](_0x109c9d[_0xf113('0x41')],_0x35859a[_0xf113('0x43')]),_0x80a58f);if(_0x109c9d[_0xf113('0x41')][_0xf113('0x4d')]){_0x4bc753['where']=_['merge'](_0x4bc753['where'],{'$or':_[_0xf113('0x4e')](_0x80a58f,function(_0x1c3bde){if(_0x1c3bde[_0xf113('0x4f')]!=='VIRTUAL'){var _0x10bf0a={};_0x10bf0a[_0x1c3bde[_0xf113('0x39')]]={'$like':'%'+_0x109c9d[_0xf113('0x41')][_0xf113('0x4d')]+'%'};return _0x10bf0a;}})});}_0x4bc753=_[_0xf113('0x50')]({},_0x4bc753,_0x109c9d[_0xf113('0x51')]);var _0x5cc396={'where':_0x4bc753[_0xf113('0x4b')]};return db[_0xf113('0x3e')][_0xf113('0x31')](_0x5cc396)[_0xf113('0x21')](function(_0x253b38){_0x2fdf95['count']=_0x253b38;if(_0x109c9d[_0xf113('0x41')][_0xf113('0x52')]){_0x4bc753[_0xf113('0x53')]=[{'all':!![]}];}return db[_0xf113('0x3e')]['findAll'](_0x4bc753);})[_0xf113('0x21')](function(_0x1dc67e){_0x2fdf95[_0xf113('0x54')]=_0x1dc67e;return _0x2fdf95;})[_0xf113('0x21')](respondWithFilteredResult(_0x57e8f6,_0x4bc753))[_0xf113('0x2a')](handleError(_0x57e8f6,null));};exports[_0xf113('0x55')]=function(_0x2fb503,_0x131f4b){var _0xbb4244={'raw':![],'where':{'id':_0x2fb503[_0xf113('0x56')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1f6a29={};_0x1f6a29[_0xf113('0x45')]=_[_0xf113('0x42')](db['FaxAccount'][_0xf113('0x3f')]);_0x1f6a29[_0xf113('0x41')]=_[_0xf113('0x42')](_0x2fb503[_0xf113('0x41')]);_0x1f6a29[_0xf113('0x43')]=_[_0xf113('0x44')](_0x1f6a29[_0xf113('0x45')],_0x1f6a29['query']);_0xbb4244[_0xf113('0x46')]=_[_0xf113('0x44')](_0x1f6a29['model'],qs[_0xf113('0x47')](_0x2fb503[_0xf113('0x41')]['fields']));_0xbb4244['attributes']=_0xbb4244['attributes'][_0xf113('0x48')]?_0xbb4244[_0xf113('0x46')]:_0x1f6a29[_0xf113('0x45')];if(_0x2fb503[_0xf113('0x41')][_0xf113('0x52')]){_0xbb4244[_0xf113('0x53')]=[{'all':!![]}];}_0xbb4244=_[_0xf113('0x50')]({},_0xbb4244,_0x2fb503[_0xf113('0x51')]);return db[_0xf113('0x3e')][_0xf113('0x57')](_0xbb4244)[_0xf113('0x21')](handleEntityNotFound(_0x131f4b,null))[_0xf113('0x21')](respondWithResult(_0x131f4b,null))[_0xf113('0x2a')](handleError(_0x131f4b,null));};exports[_0xf113('0x58')]=function(_0x371ea8,_0x78b9bf){return db[_0xf113('0x3e')][_0xf113('0x58')](_0x371ea8[_0xf113('0x59')],{})['then'](function(_0x358ff4){var _0x533bd9=_0x371ea8['user'][_0xf113('0x5a')]({'plain':!![]});if(!_0x533bd9)throw new Error(_0xf113('0x5b'));if(_0x533bd9[_0xf113('0x5c')]===_0xf113('0x5d')){var _0x88bcad=_0x358ff4['get']({'plain':!![]});var _0x10e749=_0xf113('0x5e');return db[_0xf113('0x5f')][_0xf113('0x57')]({'where':{'name':_0x10e749,'userProfileId':_0x533bd9['userProfileId']},'raw':!![]})[_0xf113('0x21')](function(_0x55292a){if(_0x55292a&&_0x55292a[_0xf113('0x60')]===0x0){return db[_0xf113('0x35')][_0xf113('0x58')]({'name':_0x88bcad['name'],'resourceId':_0x88bcad['id'],'type':_0x55292a[_0xf113('0x39')],'sectionId':_0x55292a['id']},{})['then'](function(){return _0x358ff4;});}else{return _0x358ff4;}})[_0xf113('0x2a')](function(_0x45b26c){logger[_0xf113('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45b26c);throw _0x45b26c;});}return _0x358ff4;})[_0xf113('0x21')](respondWithResult(_0x78b9bf,0xc9))['catch'](handleError(_0x78b9bf,null));};exports[_0xf113('0x61')]=function(_0x5f4050,_0x205bf2){if(_0x5f4050['body']['id']){delete _0x5f4050[_0xf113('0x59')]['id'];}return db[_0xf113('0x3e')][_0xf113('0x57')]({'where':{'id':_0x5f4050[_0xf113('0x56')]['id']},'include':[{'model':db[_0xf113('0x3c')],'as':_0xf113('0x3d')}]})['then'](handleEntityNotFound(_0x205bf2,null))[_0xf113('0x21')](saveUpdates(_0x5f4050[_0xf113('0x59')],null))['then'](respondWithResult(_0x205bf2,null))[_0xf113('0x2a')](handleError(_0x205bf2,null));};exports[_0xf113('0x36')]=function(_0xcd5aa2,_0x266ac7){return db[_0xf113('0x3e')][_0xf113('0x57')]({'where':{'id':_0xcd5aa2['params']['id']}})[_0xf113('0x21')](handleEntityNotFound(_0x266ac7,null))[_0xf113('0x21')](removeEntity(_0x266ac7,null))[_0xf113('0x2a')](handleError(_0x266ac7,null));};exports[_0xf113('0x62')]=function(_0x2dd962,_0x10aa12){return db[_0xf113('0x3e')][_0xf113('0x62')]()[_0xf113('0x21')](respondWithResult(_0x10aa12,null))['catch'](handleError(_0x10aa12,null));};exports[_0xf113('0x63')]=function(_0x445e05,_0x4e7ba1,_0xbfd073){if(_0x445e05[_0xf113('0x59')]['id']){delete _0x445e05[_0xf113('0x59')]['id'];}return db['FaxAccount'][_0xf113('0x57')]({'where':{'id':_0x445e05[_0xf113('0x56')]['id']}})['then'](handleEntityNotFound(_0x4e7ba1,null))[_0xf113('0x21')](function(_0x39c552){if(_0x39c552){_0x445e05[_0xf113('0x59')][_0xf113('0x64')]=_0x39c552['id'];return db[_0xf113('0x65')][_0xf113('0x58')](_0x445e05[_0xf113('0x59')]);}})[_0xf113('0x21')](respondWithResult(_0x4e7ba1,null))[_0xf113('0x2a')](handleError(_0x4e7ba1,null));};exports[_0xf113('0x66')]=function(_0x2d8684,_0xd6f73d,_0x23bf97){var _0x2c6ba5={'raw':![],'where':{}};var _0x1ba631={};var _0x2830ee={'count':0x0,'rows':[]};return db[_0xf113('0x3e')][_0xf113('0x67')]({'where':{'id':_0x2d8684[_0xf113('0x56')]['id']}})[_0xf113('0x21')](handleEntityNotFound(_0xd6f73d,null))[_0xf113('0x21')](function(_0x5720f2){if(_0x5720f2){_0x1ba631['model']=_[_0xf113('0x42')](db[_0xf113('0x65')]['rawAttributes']);_0x1ba631[_0xf113('0x41')]=_['keys'](_0x2d8684[_0xf113('0x41')]);_0x1ba631['filters']=_[_0xf113('0x44')](_0x1ba631[_0xf113('0x45')],_0x1ba631[_0xf113('0x41')]);_0x2c6ba5[_0xf113('0x46')]=_[_0xf113('0x44')](_0x1ba631[_0xf113('0x45')],qs[_0xf113('0x47')](_0x2d8684[_0xf113('0x41')][_0xf113('0x47')]));_0x2c6ba5[_0xf113('0x46')]=_0x2c6ba5[_0xf113('0x46')]['length']?_0x2c6ba5['attributes']:_0x1ba631[_0xf113('0x45')];if(!_0x2d8684[_0xf113('0x41')]['hasOwnProperty'](_0xf113('0x49'))){_0x2c6ba5[_0xf113('0x30')]=qs[_0xf113('0x30')](_0x2d8684['query'][_0xf113('0x30')]);_0x2c6ba5[_0xf113('0x2e')]=qs['offset'](_0x2d8684[_0xf113('0x41')]['offset']);}_0x2c6ba5['order']=qs['sort'](_0x2d8684[_0xf113('0x41')][_0xf113('0x4a')]);_0x2c6ba5[_0xf113('0x4b')]=qs[_0xf113('0x43')](_[_0xf113('0x4c')](_0x2d8684['query'],_0x1ba631['filters']));_0x2c6ba5[_0xf113('0x4b')][_0xf113('0x64')]=_0x5720f2['id'];if(_0x2d8684[_0xf113('0x41')][_0xf113('0x4d')]){_0x2c6ba5[_0xf113('0x4b')]=_[_0xf113('0x50')](_0x2c6ba5['where'],{'$or':_[_0xf113('0x4e')](_0x2c6ba5[_0xf113('0x46')],function(_0x409f99){var _0x57caaf={};_0x57caaf[_0x409f99]={'$like':'%'+_0x2d8684[_0xf113('0x41')][_0xf113('0x4d')]+'%'};return _0x57caaf;})});}_0x2c6ba5=_['merge']({},_0x2c6ba5,_0x2d8684[_0xf113('0x51')]);return db[_0xf113('0x65')][_0xf113('0x31')]({'where':_0x2c6ba5[_0xf113('0x4b')]})[_0xf113('0x21')](function(_0x9f37b9){_0x2830ee[_0xf113('0x31')]=_0x9f37b9;if(_0x2d8684[_0xf113('0x41')][_0xf113('0x52')]){_0x2c6ba5[_0xf113('0x53')]=[{'all':!![]}];}return db['Disposition'][_0xf113('0x68')](_0x2c6ba5);})['then'](function(_0x365366){_0x2830ee['rows']=_0x365366;return _0x2830ee;});}})[_0xf113('0x21')](respondWithFilteredResult(_0xd6f73d,_0x2c6ba5))[_0xf113('0x2a')](handleError(_0xd6f73d,null));};exports[_0xf113('0x69')]=function(_0x3a26c7,_0x5b792f,_0x18c442){return db[_0xf113('0x3e')]['find']({'where':{'id':_0x3a26c7[_0xf113('0x56')]['id']}})['then'](handleEntityNotFound(_0x5b792f,null))[_0xf113('0x21')](function(_0x3a098e){if(_0x3a098e){return _0x3a098e[_0xf113('0x69')](_0x3a26c7[_0xf113('0x41')]['ids']);}})[_0xf113('0x21')](respondWithStatusCode(_0x5b792f,null))['catch'](handleError(_0x5b792f,null));};exports[_0xf113('0x6a')]=function(_0x51dbd0,_0x1eda80,_0x1a59c4){if(_0x51dbd0['body']['id']){delete _0x51dbd0[_0xf113('0x59')]['id'];}return db[_0xf113('0x3e')]['find']({'where':{'id':_0x51dbd0[_0xf113('0x56')]['id']}})[_0xf113('0x21')](handleEntityNotFound(_0x1eda80,null))[_0xf113('0x21')](function(_0x14ad45){if(_0x14ad45){_0x51dbd0['body'][_0xf113('0x64')]=_0x14ad45['id'];return db[_0xf113('0x6b')][_0xf113('0x58')](_0x51dbd0[_0xf113('0x59')]);}})[_0xf113('0x21')](respondWithResult(_0x1eda80,null))['catch'](handleError(_0x1eda80,null));};exports[_0xf113('0x6c')]=function(_0xe9f468,_0x5792e1,_0x5570ef){var _0x272762={'raw':![],'where':{}};var _0x145e88={};var _0x246634={'count':0x0,'rows':[]};return db[_0xf113('0x3e')]['findOne']({'where':{'id':_0xe9f468['params']['id']}})[_0xf113('0x21')](handleEntityNotFound(_0x5792e1,null))['then'](function(_0xd29507){if(_0xd29507){_0x145e88['model']=_[_0xf113('0x42')](db[_0xf113('0x6b')]['rawAttributes']);_0x145e88[_0xf113('0x41')]=_[_0xf113('0x42')](_0xe9f468[_0xf113('0x41')]);_0x145e88[_0xf113('0x43')]=_[_0xf113('0x44')](_0x145e88['model'],_0x145e88['query']);_0x272762[_0xf113('0x46')]=_[_0xf113('0x44')](_0x145e88['model'],qs[_0xf113('0x47')](_0xe9f468[_0xf113('0x41')]['fields']));_0x272762[_0xf113('0x46')]=_0x272762[_0xf113('0x46')][_0xf113('0x48')]?_0x272762[_0xf113('0x46')]:_0x145e88[_0xf113('0x45')];if(!_0xe9f468[_0xf113('0x41')][_0xf113('0x6d')](_0xf113('0x49'))){_0x272762[_0xf113('0x30')]=qs['limit'](_0xe9f468[_0xf113('0x41')][_0xf113('0x30')]);_0x272762['offset']=qs[_0xf113('0x2e')](_0xe9f468[_0xf113('0x41')][_0xf113('0x2e')]);}_0x272762[_0xf113('0x6e')]=qs[_0xf113('0x4a')](_0xe9f468[_0xf113('0x41')]['sort']);_0x272762[_0xf113('0x4b')]=qs[_0xf113('0x43')](_[_0xf113('0x4c')](_0xe9f468[_0xf113('0x41')],_0x145e88['filters']));_0x272762[_0xf113('0x4b')][_0xf113('0x64')]=_0xd29507['id'];if(_0xe9f468['query'][_0xf113('0x4d')]){_0x272762['where']=_['merge'](_0x272762[_0xf113('0x4b')],{'$or':_[_0xf113('0x4e')](_0x272762[_0xf113('0x46')],function(_0x27fa4d){var _0x18c5e1={};_0x18c5e1[_0x27fa4d]={'$like':'%'+_0xe9f468[_0xf113('0x41')][_0xf113('0x4d')]+'%'};return _0x18c5e1;})});}_0x272762=_[_0xf113('0x50')]({},_0x272762,_0xe9f468[_0xf113('0x51')]);return db[_0xf113('0x6b')][_0xf113('0x31')]({'where':_0x272762['where']})[_0xf113('0x21')](function(_0x1f27cb){_0x246634[_0xf113('0x31')]=_0x1f27cb;if(_0xe9f468['query'][_0xf113('0x52')]){_0x272762[_0xf113('0x53')]=[{'all':!![]}];}return db[_0xf113('0x6b')][_0xf113('0x68')](_0x272762);})['then'](function(_0x4bcced){_0x246634[_0xf113('0x54')]=_0x4bcced;return _0x246634;});}})[_0xf113('0x21')](respondWithFilteredResult(_0x5792e1,_0x272762))[_0xf113('0x2a')](handleError(_0x5792e1,null));};exports[_0xf113('0x6f')]=function(_0x59fefe,_0x3d5f1e,_0x2ab1fb){return db[_0xf113('0x3e')][_0xf113('0x57')]({'where':{'id':_0x59fefe[_0xf113('0x56')]['id']}})[_0xf113('0x21')](handleEntityNotFound(_0x3d5f1e,null))[_0xf113('0x21')](function(_0x37fd77){if(_0x37fd77){return _0x37fd77[_0xf113('0x6f')](_0x59fefe['query'][_0xf113('0x70')]);}})[_0xf113('0x21')](respondWithStatusCode(_0x3d5f1e,null))[_0xf113('0x2a')](handleError(_0x3d5f1e,null));};exports[_0xf113('0x71')]=function(_0x4f19ff,_0x1ec1de,_0x263cba){return db['FaxInteraction'][_0xf113('0x57')]({'where':{'id':_0x4f19ff['params']['id']}})[_0xf113('0x21')](handleEntityNotFound(_0x1ec1de,null))[_0xf113('0x21')](function(_0x566e24){if(_0x566e24){return _0x566e24['addInteraction'](_0x4f19ff[_0xf113('0x59')][_0xf113('0x70')],_[_0xf113('0x72')](_0x4f19ff[_0xf113('0x59')],[_0xf113('0x70'),'id'])||{});}})[_0xf113('0x21')](respondWithResult(_0x1ec1de,null))[_0xf113('0x2a')](handleError(_0x1ec1de,null));};exports[_0xf113('0x73')]=function(_0x86550f,_0x293403,_0x5570b5){var _0x29b3ad={'raw':![],'where':{}};var _0x1c50de={};var _0x1f5bb0={'count':0x0,'rows':[]};return db[_0xf113('0x3e')][_0xf113('0x67')]({'where':{'id':_0x86550f[_0xf113('0x56')]['id']}})[_0xf113('0x21')](handleEntityNotFound(_0x293403,null))['then'](function(_0x5ec644){if(_0x5ec644){_0x1c50de['model']=_[_0xf113('0x42')](db[_0xf113('0x74')]['rawAttributes']);_0x1c50de[_0xf113('0x41')]=_[_0xf113('0x42')](_0x86550f[_0xf113('0x41')]);_0x1c50de[_0xf113('0x43')]=_[_0xf113('0x44')](_0x1c50de[_0xf113('0x45')],_0x1c50de[_0xf113('0x41')]);_0x29b3ad[_0xf113('0x46')]=_[_0xf113('0x44')](_0x1c50de[_0xf113('0x45')],qs[_0xf113('0x47')](_0x86550f['query'][_0xf113('0x47')]));_0x29b3ad[_0xf113('0x46')]=_0x29b3ad[_0xf113('0x46')]['length']?_0x29b3ad['attributes']:_0x1c50de['model'];if(!_0x86550f[_0xf113('0x41')]['hasOwnProperty']('nolimit')){_0x29b3ad['limit']=qs[_0xf113('0x30')](_0x86550f[_0xf113('0x41')][_0xf113('0x30')]);_0x29b3ad['offset']=qs[_0xf113('0x2e')](_0x86550f['query']['offset']);}_0x29b3ad[_0xf113('0x6e')]=qs[_0xf113('0x4a')](_0x86550f[_0xf113('0x41')][_0xf113('0x4a')]);_0x29b3ad[_0xf113('0x4b')]=qs[_0xf113('0x43')](_[_0xf113('0x4c')](_0x86550f[_0xf113('0x41')],_0x1c50de['filters']));_0x29b3ad['where'][_0xf113('0x64')]=_0x5ec644['id'];if(_0x86550f[_0xf113('0x41')]['filter']){_0x29b3ad[_0xf113('0x4b')]=_[_0xf113('0x50')](_0x29b3ad['where'],{'$or':_[_0xf113('0x4e')](_0x29b3ad[_0xf113('0x46')],function(_0x4d3a21){var _0x27ba1d={};_0x27ba1d[_0x4d3a21]={'$like':'%'+_0x86550f['query'][_0xf113('0x4d')]+'%'};return _0x27ba1d;})});}_0x29b3ad=_[_0xf113('0x50')]({},_0x29b3ad,_0x86550f[_0xf113('0x51')]);return db[_0xf113('0x74')][_0xf113('0x31')]({'where':_0x29b3ad[_0xf113('0x4b')]})[_0xf113('0x21')](function(_0x1d5310){_0x1f5bb0['count']=_0x1d5310;if(_0x86550f[_0xf113('0x41')][_0xf113('0x52')]){_0x29b3ad[_0xf113('0x53')]=[{'model':db[_0xf113('0x75')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xf113('0x76'),'attributes':[_0xf113('0x39'),'fullname','internal'],'required':![]},{'model':db['Tag'],'as':_0xf113('0x77'),'attributes':['id','name',_0xf113('0x78')],'where':_0x86550f[_0xf113('0x41')][_0xf113('0x79')]?{'id':_0x86550f['query'][_0xf113('0x79')]}:undefined,'required':_0x86550f[_0xf113('0x41')][_0xf113('0x79')]?!![]:![]}];}return db[_0xf113('0x74')][_0xf113('0x68')](_0x29b3ad);})['then'](function(_0x1d74e4){_0x1f5bb0['rows']=_0x1d74e4;return _0x1f5bb0;});}})[_0xf113('0x21')](respondWithFilteredResult(_0x293403,_0x29b3ad))[_0xf113('0x2a')](handleError(_0x293403,null));};exports['addApplications']=function(_0x22ab3b,_0x254f34){var _0x24c455=_0x22ab3b['params']['id'];var _0x20bf87=_0x22ab3b[_0xf113('0x59')];var _0x3174ad=0xc8;var _0x36bf48=null;return db[_0xf113('0x7a')]['transaction']({'isolationLevel':db[_0xf113('0x7a')][_0xf113('0x7b')][_0xf113('0x7c')][_0xf113('0x7d')]},function(_0x233789){return db[_0xf113('0x3e')][_0xf113('0x67')]({'where':{'id':_0x24c455},'transaction':_0x233789})[_0xf113('0x21')](function(_0x36308c){if(_0x36308c){return db[_0xf113('0x7e')][_0xf113('0x36')]({'where':{'FaxAccountId':_0x24c455},'transaction':_0x233789})[_0xf113('0x21')](function(){var _0x3cd3e2=_[_0xf113('0x4e')](_0x20bf87,function(_0x568de3){_0x568de3[_0xf113('0x64')]=_0x24c455;return _0x568de3;});return db['FaxApplication'][_0xf113('0x7f')](_0x3cd3e2,{'transaction':_0x233789});});}else{_0x3174ad=0x194;_0x36bf48=[];}});})['then'](function(){if(_0x3174ad!==0x194){return db['FaxApplication'][_0xf113('0x80')]({'where':{'FaxAccountId':_0x24c455},'order':_0xf113('0x81')})[_0xf113('0x21')](function(_0x5de449){_0x36bf48=_0x5de449;});}})[_0xf113('0x2a')](function(_0x33dce0){_0x3174ad=0x1f4;logger[_0xf113('0x26')](_0x33dce0['stack']);if(_0x33dce0[_0xf113('0x39')]){delete _0x33dce0[_0xf113('0x39')];}_0x36bf48=_0x33dce0;})[_0xf113('0x82')](function(){if(_0x36bf48===null){_0x254f34['sendStatus'](_0x3174ad);}else{if(_0x3174ad===0x1f4){_0x254f34[_0xf113('0x2c')](_0x3174ad)[_0xf113('0x3a')](_0x36bf48);}else{_0x254f34[_0xf113('0x2c')](_0x3174ad)[_0xf113('0x2d')](_0x36bf48);}}});};exports['getApplications']=function(_0x55b0df,_0x5c828e,_0x2dc135){var _0x4c4236={};var _0x1d9a5b={};var _0x4abac4;var _0x55f42c;return db[_0xf113('0x3e')][_0xf113('0x67')]({'where':{'id':_0x55b0df[_0xf113('0x56')]['id']}})[_0xf113('0x21')](handleEntityNotFound(_0x5c828e,null))[_0xf113('0x21')](function(_0x4cc457){if(_0x4cc457){_0x4abac4=_0x4cc457;_0x1d9a5b[_0xf113('0x45')]=_[_0xf113('0x42')](db['FaxApplication'][_0xf113('0x3f')]);_0x1d9a5b[_0xf113('0x41')]=_[_0xf113('0x42')](_0x55b0df[_0xf113('0x41')]);_0x1d9a5b[_0xf113('0x43')]=_[_0xf113('0x44')](_0x1d9a5b[_0xf113('0x45')],_0x1d9a5b[_0xf113('0x41')]);_0x4c4236[_0xf113('0x46')]=_[_0xf113('0x44')](_0x1d9a5b['model'],qs[_0xf113('0x47')](_0x55b0df['query']['fields']));_0x4c4236[_0xf113('0x46')]=_0x4c4236[_0xf113('0x46')][_0xf113('0x48')]?_0x4c4236[_0xf113('0x46')]:_0x1d9a5b['model'];_0x4c4236['order']=qs['sort'](_0x55b0df[_0xf113('0x41')][_0xf113('0x4a')]);_0x4c4236['where']=qs[_0xf113('0x43')](_[_0xf113('0x4c')](_0x55b0df[_0xf113('0x41')],_0x1d9a5b['filters']));if(_0x55b0df[_0xf113('0x41')][_0xf113('0x4d')]){_0x4c4236[_0xf113('0x4b')]=_[_0xf113('0x50')](_0x4c4236[_0xf113('0x4b')],{'$or':_[_0xf113('0x4e')](_0x4c4236[_0xf113('0x46')],function(_0x27d6c7){var _0x23f043={};_0x23f043[_0x27d6c7]={'$like':'%'+_0x55b0df[_0xf113('0x41')][_0xf113('0x4d')]+'%'};return _0x23f043;})});}_0x4c4236=_[_0xf113('0x50')]({},_0x4c4236,_0x55b0df[_0xf113('0x51')]);return _0x4abac4[_0xf113('0x83')](_0x4c4236);}})[_0xf113('0x21')](function(_0x181239){if(_0x181239){_0x55f42c=_0x181239[_0xf113('0x48')];if(!_0x55b0df[_0xf113('0x41')][_0xf113('0x6d')](_0xf113('0x49'))){_0x4c4236[_0xf113('0x30')]=qs[_0xf113('0x30')](_0x55b0df[_0xf113('0x41')]['limit']);_0x4c4236[_0xf113('0x2e')]=qs[_0xf113('0x2e')](_0x55b0df[_0xf113('0x41')][_0xf113('0x2e')]);}return _0x4abac4[_0xf113('0x83')](_0x4c4236);}})['then'](function(_0x25b662){if(_0x25b662){return _0x25b662?{'count':_0x55f42c,'rows':_0x25b662}:null;}})[_0xf113('0x21')](respondWithResult(_0x5c828e,null))[_0xf113('0x2a')](handleError(_0x5c828e,null));};function Extension(_0x2d3a24,_0x4a2fa2,_0x4699d6,_0xf5779d){this['context']=_0xf113('0x84');this[_0xf113('0x85')]=_0x2d3a24[_0xf113('0x86')];this[_0xf113('0x87')]=_0xf5779d;this[_0xf113('0x4f')]=_0xf113('0x88');this[_0xf113('0x89')]=_0xf113('0x8a');this[_0xf113('0x64')]=_0x2d3a24['id'];this[_0xf113('0x81')]=_0x4a2fa2;this[_0xf113('0x8b')]=_0x4699d6;}function createExtensionsReciveFax(_0x122696){var _0x143c7b=0x1;var _0x115d39=[];_0x115d39[_0xf113('0x8c')](new Extension(_0x122696,_0x143c7b,'',_0xf113('0x8d')));_0x143c7b+=0x1;_0x115d39[_0xf113('0x8c')](new Extension(_0x122696,_0x143c7b,_0xf113('0x8e'),_0xf113('0x8f')));_0x143c7b+=0x1;for(var _0x35722c in _0x122696){if(_0x122696[_0xf113('0x6d')](_0x35722c)&&(_0x35722c===_0xf113('0x90')||_0x35722c===_0xf113('0x86')||_0x35722c===_0xf113('0x91')||_0x35722c===_0xf113('0x92')||_0x35722c===_0xf113('0x93')||_0x35722c===_0xf113('0x94')||_0x35722c===_0xf113('0x95')||_0x35722c===_0xf113('0x96')||_0x35722c===_0xf113('0x97'))){_0x115d39['push'](new Extension(_0x122696,_0x143c7b,_0xf113('0x98')+_0x35722c+')='+_0x122696[_0x35722c],_0xf113('0x8f')));_0x143c7b+=0x1;}}_0x115d39[_0xf113('0x8c')](new Extension(_0x122696,_0x143c7b,'6',_0xf113('0x99')));_0x143c7b+=0x1;_0x115d39[_0xf113('0x8c')](new Extension(_0x122696,_0x143c7b,_0xf113('0x9a'),_0xf113('0x9b')));_0x143c7b=0x0;return _0x115d39;}exports[_0xf113('0x9c')]=function(_0x161a0f,_0x25c11c,_0xfbca){var _0x1b7dee;return db['sequelize'][_0xf113('0x9d')](function(_0x38ab45){return db[_0xf113('0x3e')][_0xf113('0x58')](_0x161a0f[_0xf113('0x59')],{'transaction':_0x38ab45})[_0xf113('0x21')](function(_0x3dd082){_0x1b7dee=_0x3dd082[_0xf113('0x5a')]({'plain':!![]});return db[_0xf113('0x9e')]['bulkCreate'](createExtensionsReciveFax(_0x1b7dee),{'transaction':_0x38ab45});});})[_0xf113('0x21')](function(){return _0x1b7dee;})[_0xf113('0x21')](respondWithResult(_0x25c11c,null))[_0xf113('0x2a')](handleError(_0x25c11c,null));};exports[_0xf113('0x9f')]=function(_0xef2655,_0x42cfb8,_0x22e631){var _0x188581;return db[_0xf113('0x7a')][_0xf113('0x9d')](function(_0x4674ad){return db[_0xf113('0x3e')][_0xf113('0x61')](_0xef2655[_0xf113('0x59')],{'where':{'id':_0xef2655[_0xf113('0x59')]['id']},'transaction':_0x4674ad})[_0xf113('0x21')](function(_0x5c2950){return db['VoiceExtension'][_0xf113('0x36')]({'where':{'FaxAccountId':_0xef2655[_0xf113('0x59')]['id']},'transaction':_0x4674ad})[_0xf113('0x21')](function(_0x387eae){return db[_0xf113('0x9e')]['bulkCreate'](createExtensionsReciveFax(_['omit'](_0xef2655[_0xf113('0x59')],[_0xf113('0xa0'),_0xf113('0x40'),'createdAt',_0xf113('0xa1'),'TrunkId',_0xf113('0xa2')])),{'transaction':_0x4674ad});});});})[_0xf113('0x21')](function(){return db[_0xf113('0x3e')][_0xf113('0xa3')](_0xef2655[_0xf113('0x59')]['id']);})[_0xf113('0x21')](respondWithResult(_0x42cfb8,null))[_0xf113('0x2a')](handleError(_0x42cfb8,null));};exports[_0xf113('0xa4')]=function(_0x537253,_0x2055ad,_0x428e2c){var _0x21d169={'raw':!![],'where':{}};var _0x5efe43={};var _0xba5085={'count':0x0,'rows':[]};return db[_0xf113('0x3e')]['findOne']({'where':{'id':_0x537253[_0xf113('0x56')]['id']}})[_0xf113('0x21')](handleEntityNotFound(_0x2055ad,null))[_0xf113('0x21')](function(_0x1f68f8){if(_0x1f68f8){_0x5efe43[_0xf113('0x45')]=_['keys'](db['FaxMessage'][_0xf113('0x3f')]);_0x5efe43[_0xf113('0x41')]=_[_0xf113('0x42')](_0x537253[_0xf113('0x41')]);_0x5efe43['filters']=_[_0xf113('0x44')](_0x5efe43[_0xf113('0x45')],_0x5efe43[_0xf113('0x41')]);_0x21d169[_0xf113('0x46')]=_[_0xf113('0x44')](_0x5efe43[_0xf113('0x45')],qs[_0xf113('0x47')](_0x537253['query'][_0xf113('0x47')]));_0x21d169[_0xf113('0x46')]=_0x21d169[_0xf113('0x46')][_0xf113('0x48')]?_0x21d169[_0xf113('0x46')]:_0x5efe43[_0xf113('0x45')];if(!_0x537253[_0xf113('0x41')]['hasOwnProperty'](_0xf113('0x49'))){_0x21d169[_0xf113('0x30')]=qs[_0xf113('0x30')](_0x537253[_0xf113('0x41')][_0xf113('0x30')]);_0x21d169['offset']=qs[_0xf113('0x2e')](_0x537253['query'][_0xf113('0x2e')]);}_0x21d169[_0xf113('0x6e')]=qs[_0xf113('0x4a')](_0x537253[_0xf113('0x41')][_0xf113('0x4a')]);_0x21d169['where']=qs['filters'](_['pick'](_0x537253[_0xf113('0x41')],_0x5efe43[_0xf113('0x43')]));_0x21d169[_0xf113('0x4b')][_0xf113('0x64')]=_0x1f68f8['id'];if(_0x537253[_0xf113('0x41')][_0xf113('0x4d')]){_0x21d169[_0xf113('0x4b')]=_[_0xf113('0x50')](_0x21d169[_0xf113('0x4b')],{'$or':_[_0xf113('0x4e')](_0x21d169[_0xf113('0x46')],function(_0x4d84d6){var _0x4585b9={};_0x4585b9[_0x4d84d6]={'$like':'%'+_0x537253[_0xf113('0x41')][_0xf113('0x4d')]+'%'};return _0x4585b9;})});}if(_0x537253[_0xf113('0x41')][_0xf113('0xa5')]){var _0x6297fc=_0x537253[_0xf113('0x41')][_0xf113('0xa5')]['split'](',');var _0x400176={};_0x400176[_0x6297fc[0x0]]={'$gte':moment(_0x6297fc[0x1])['format'](_0xf113('0xa6'))};_0x21d169[_0xf113('0x4b')]=_[_0xf113('0x50')](_0x21d169['where'],_0x400176);}_0x21d169=_[_0xf113('0x50')]({},_0x21d169,_0x537253['options']);return db[_0xf113('0xa7')]['count']({'where':_0x21d169['where']})[_0xf113('0x21')](function(_0x1b9df2){_0xba5085['count']=_0x1b9df2;if(_0x537253[_0xf113('0x41')]['includeAll']){_0x21d169['include']=[{'all':!![]}];}return db[_0xf113('0xa7')][_0xf113('0x68')](_0x21d169);})[_0xf113('0x21')](function(_0x50bf09){_0xba5085[_0xf113('0x54')]=_0x50bf09;return _0xba5085;});}})[_0xf113('0x21')](respondWithFilteredResult(_0x2055ad,_0x21d169))['catch'](handleError(_0x2055ad,null));};exports[_0xf113('0x3a')]=function(_0x4cf482,_0x18900f,_0x470471){var _0x11aa81,_0x545cc8={},_0x995ce4;if(_0x4cf482[_0xf113('0x59')]['to']){_0x995ce4=_0x4cf482[_0xf113('0x59')]['to'][0x0];}return db['FaxAccount'][_0xf113('0x57')]({'where':{'id':_0x4cf482[_0xf113('0x56')]['id']},'include':[{'model':db[_0xf113('0xa8')],'as':'List','include':[{'model':db[_0xf113('0x75')],'as':_0xf113('0xa9'),'where':{'fax':_0x995ce4},'limit':0x1,'order':[[_0xf113('0xa1'),_0xf113('0xaa')]]}]}]})[_0xf113('0x21')](handleEntityNotFound(_0x18900f,null))[_0xf113('0x21')](function(_0x499258){_0x11aa81=_0x499258;if(_0x4cf482[_0xf113('0x59')]['attachments']&&_0x4cf482[_0xf113('0x59')][_0xf113('0xab')]['length']){for(var _0x33dc3f=0x0;_0x33dc3f<_0x4cf482[_0xf113('0x59')][_0xf113('0xab')][_0xf113('0x48')];_0x33dc3f+=0x1){_0x4cf482[_0xf113('0x59')][_0xf113('0xab')][_0x33dc3f]={'filename':_0x4cf482[_0xf113('0x59')][_0xf113('0xab')][_0x33dc3f][_0xf113('0x39')],'id':_0x4cf482[_0xf113('0x59')][_0xf113('0xab')][_0x33dc3f]['id'],'path':path['join'](config[_0xf113('0xac')],_0xf113('0xad'),_0x4cf482[_0xf113('0x59')][_0xf113('0xab')][_0x33dc3f][_0xf113('0xae')])};}}return respondWithRpcPromise(_0xf113('0xaf'),_0xf113('0xaf'),{'FaxAccountId':_['isNil'](_0x4cf482[_0xf113('0x56')]['id'])?undefined:_0x4cf482[_0xf113('0x56')]['id'],'path':_[_0xf113('0xb0')](_0x4cf482[_0xf113('0x59')][_0xf113('0xab')][0x0][_0xf113('0xb1')])?undefined:_0x4cf482['body'][_0xf113('0xab')][0x0][_0xf113('0xb1')],'fax':_[_0xf113('0xb0')](_0x4cf482[_0xf113('0x59')]['to'][0x0])?undefined:_0x4cf482[_0xf113('0x59')]['to'][0x0]},client9002);})[_0xf113('0x21')](function(){if(_0x11aa81){if(_[_0xf113('0xb0')](_0x4cf482[_0xf113('0x59')][_0xf113('0xb2')])){_0x4cf482['body'][_0xf113('0xb2')]=util[_0xf113('0xb3')](_0xf113('0xb4'),_0x11aa81['name'],_0x11aa81['fax']);}if(_0x11aa81['List']){if(_0x11aa81[_0xf113('0xb5')]['Contacts'][_0xf113('0x48')]){return _0x11aa81[_0xf113('0xb5')]['Contacts'][0x0];}else{return db['CmContact']['create'](_[_0xf113('0x19')](_0x4cf482[_0xf113('0x59')],{'firstName':_0x4cf482[_0xf113('0x59')]['to'][0x0],'phone':_0x4cf482['body']['to'][0x0],'fax':_0x4cf482['body']['to'][0x0],'ListId':_0x11aa81[_0xf113('0xa2')]}));}}else{throw new Error(_0xf113('0xb6'));}}else{throw new Error(_0xf113('0xb7'));}})[_0xf113('0x21')](function(_0x3456f6){if(_0x3456f6){return db['FaxInteraction'][_0xf113('0x57')]({'where':{'ContactId':_0x3456f6['id'],'closed':![],'FaxAccountId':_0x11aa81['id']}})['then'](function(_0x5e9288){if(_0x5e9288){return[_0x5e9288,![]];}return db[_0xf113('0x74')][_0xf113('0x58')]({'UserId':_0x4cf482[_0xf113('0x5d')]['id'],'ContactId':_0x3456f6['id'],'FaxAccountId':_0x11aa81['id'],'fax':_0x4cf482['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xf113('0x50')](_0x4cf482[_0xf113('0x59')],{'read':![],'body':_0x4cf482[_0xf113('0x59')][_0xf113('0xab')][0x0][_0xf113('0xb8')],'FaxAccountId':_0x11aa81['id'],'UserId':_0x4cf482['user']['id'],'ContactId':_0x3456f6['id'],'AttachmentId':_0x4cf482[_0xf113('0x59')][_0xf113('0xab')][0x0]['id']})]},{'include':[{'model':db[_0xf113('0xa7')],'as':_0xf113('0xb9')}]})['then'](function(_0x50d6a2){return[_0x50d6a2,!![]];});});}else{throw new Error(_0xf113('0xba'));}})[_0xf113('0xbb')](function(_0x4360de,_0x57fbe5){if(_0x57fbe5){return _0x4360de;}return db['FaxMessage'][_0xf113('0x58')]({'direction':_0xf113('0xbc'),'read':![],'body':_0x4cf482[_0xf113('0x59')][_0xf113('0xab')][0x0][_0xf113('0xb8')],'FaxAccountId':_0x11aa81['id'],'FaxInteractionId':_0x4360de['id'],'UserId':_0x4cf482[_0xf113('0x5d')]['id'],'ContactId':_0x4360de[_0xf113('0xbd')],'AttachmentId':_0x4cf482[_0xf113('0x59')]['attachments'][0x0]['id']})['then'](function(_0x4d45ee){_0x4360de['dataValues'][_0xf113('0xb9')]=[];_0x4360de['dataValues'][_0xf113('0xb9')][_0xf113('0x8c')](_0x4d45ee['dataValues']);return _0x4360de;});})[_0xf113('0x21')](function(_0x1e5256){respondWithRpcPromise(_0xf113('0xbe'),_0xf113('0xbe'),{'FaxAccountId':_['isNil'](_0x4cf482[_0xf113('0x56')]['id'])?undefined:_0x4cf482[_0xf113('0x56')]['id'],'path':_['isNil'](_0x4cf482[_0xf113('0x59')][_0xf113('0xab')][0x0][_0xf113('0xb1')])?undefined:_0x4cf482['body'][_0xf113('0xab')][0x0][_0xf113('0xb1')],'fax':_[_0xf113('0xb0')](_0x4cf482[_0xf113('0x59')]['to'][0x0])?undefined:_0x4cf482['body']['to'][0x0],'AttachmentId':_0x4cf482[_0xf113('0x59')][_0xf113('0xab')][0x0]['id']},client9002)[_0xf113('0x21')](function(_0x535ba4){logger['info'](_0xf113('0xbf'),_0x535ba4);})[_0xf113('0x2a')](function(_0x463a8d){logger[_0xf113('0x22')]('SendFaxRpc,\x20%s',_0x463a8d);});return _0x1e5256;})['then'](respondWithResult(_0x18900f,null))['catch'](handleError(_0x18900f,null));};exports['addAgents']=function(_0x1c5191,_0x2101db,_0x9bb87c){return db[_0xf113('0x3e')]['find']({'where':{'id':_0x1c5191[_0xf113('0x56')]['id']}})[_0xf113('0x21')](handleEntityNotFound(_0x2101db,null))['then'](function(_0x45da39){if(_0x45da39){return _0x45da39['addAgents'](_0x1c5191[_0xf113('0x59')][_0xf113('0x70')],_[_0xf113('0x72')](_0x1c5191[_0xf113('0x59')],[_0xf113('0x70'),'id'])||{})['spread'](function(_0x55a008){for(var _0x420f7e=0x0;_0x420f7e<_0x1c5191[_0xf113('0x59')][_0xf113('0x70')][_0xf113('0x48')];_0x420f7e+=0x1){socket[_0xf113('0xc0')](_0xf113('0xc1'),{'UserId':Number(_0x1c5191[_0xf113('0x59')][_0xf113('0x70')][_0x420f7e]),'FaxAccountId':Number(_0x1c5191[_0xf113('0x56')]['id'])});}return _0x55a008;});}})[_0xf113('0x21')](respondWithResult(_0x2101db,null))[_0xf113('0x2a')](handleError(_0x2101db,null));};exports[_0xf113('0xc2')]=function(_0x45a901,_0x5791fb,_0x97ccc){return db['FaxAccount'][_0xf113('0x57')]({'where':{'id':_0x45a901['params']['id']}})[_0xf113('0x21')](handleEntityNotFound(_0x5791fb,null))[_0xf113('0x21')](function(_0x230586){if(_0x230586){return _0x230586[_0xf113('0xc2')](_0x45a901[_0xf113('0x41')]['ids'])[_0xf113('0x21')](function(){if(_[_0xf113('0xc3')](_0x45a901[_0xf113('0x41')][_0xf113('0x70')])){for(var _0x4fa791=0x0;_0x4fa791<_0x45a901[_0xf113('0x41')][_0xf113('0x70')]['length'];_0x4fa791+=0x1){socket['emit'](_0xf113('0xc4'),{'UserId':Number(_0x45a901['query']['ids'][_0x4fa791]),'FaxAccountId':Number(_0x45a901[_0xf113('0x56')]['id'])});}}else{socket[_0xf113('0xc0')](_0xf113('0xc4'),{'UserId':Number(_0x45a901['query'][_0xf113('0x70')]),'FaxAccountId':Number(_0x45a901[_0xf113('0x56')]['id'])});}});}})[_0xf113('0x21')](respondWithStatusCode(_0x5791fb,null))[_0xf113('0x2a')](handleError(_0x5791fb,null));};exports['getAgents']=function(_0x3dc5e4,_0x5d0a18,_0x228d8e){var _0x2f9771={};var _0x50247c={};var _0x548efd;var _0xb6843c;return db[_0xf113('0x3e')]['findOne']({'where':{'id':_0x3dc5e4[_0xf113('0x56')]['id']}})[_0xf113('0x21')](handleEntityNotFound(_0x5d0a18,null))['then'](function(_0x5c0681){if(_0x5c0681){_0x548efd=_0x5c0681;_0x50247c['model']=_[_0xf113('0x42')](db['User'][_0xf113('0x3f')]);_0x50247c[_0xf113('0x41')]=_['keys'](_0x3dc5e4[_0xf113('0x41')]);_0x50247c[_0xf113('0x43')]=_[_0xf113('0x44')](_0x50247c['model'],_0x50247c[_0xf113('0x41')]);_0x2f9771['attributes']=_[_0xf113('0x44')](_0x50247c[_0xf113('0x45')],qs['fields'](_0x3dc5e4[_0xf113('0x41')][_0xf113('0x47')]));_0x2f9771[_0xf113('0x46')]=_0x2f9771['attributes'][_0xf113('0x48')]?_0x2f9771[_0xf113('0x46')]:_0x50247c[_0xf113('0x45')];_0x2f9771[_0xf113('0x6e')]=qs[_0xf113('0x4a')](_0x3dc5e4['query'][_0xf113('0x4a')]);_0x2f9771[_0xf113('0x4b')]=qs['filters'](_[_0xf113('0x4c')](_0x3dc5e4[_0xf113('0x41')],_0x50247c['filters']));if(_0x3dc5e4[_0xf113('0x41')][_0xf113('0x4d')]){_0x2f9771[_0xf113('0x4b')]=_[_0xf113('0x50')](_0x2f9771[_0xf113('0x4b')],{'$or':_['map'](_0x2f9771[_0xf113('0x46')],function(_0x2acbf5){var _0x1f90ea={};_0x1f90ea[_0x2acbf5]={'$like':'%'+_0x3dc5e4[_0xf113('0x41')][_0xf113('0x4d')]+'%'};return _0x1f90ea;})});}_0x2f9771=_[_0xf113('0x50')]({},_0x2f9771,_0x3dc5e4[_0xf113('0x51')]);return _0x548efd['getAgents'](_0x2f9771);}})[_0xf113('0x21')](function(_0x49064f){if(_0x49064f){_0xb6843c=_0x49064f[_0xf113('0x48')];if(!_0x3dc5e4['query']['hasOwnProperty'](_0xf113('0x49'))){_0x2f9771[_0xf113('0x30')]=qs[_0xf113('0x30')](_0x3dc5e4[_0xf113('0x41')][_0xf113('0x30')]);_0x2f9771[_0xf113('0x2e')]=qs[_0xf113('0x2e')](_0x3dc5e4[_0xf113('0x41')][_0xf113('0x2e')]);}return _0x548efd[_0xf113('0xc5')](_0x2f9771);}})[_0xf113('0x21')](function(_0x3941be){if(_0x3941be){return _0x3941be?{'count':_0xb6843c,'rows':_0x3941be}:null;}})[_0xf113('0x21')](respondWithResult(_0x5d0a18,null))[_0xf113('0x2a')](handleError(_0x5d0a18,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index da11204..ccec7e1 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 _0xae7c=['FaxAccount','setMaxListeners','save','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x54dcc2,_0x2a265c){var _0x3cc135=function(_0x546a1f){while(--_0x546a1f){_0x54dcc2['push'](_0x54dcc2['shift']());}};_0x3cc135(++_0x2a265c);}(_0xae7c,0x167));var _0xcae7=function(_0x11d25c,_0x5a0fe5){_0x11d25c=_0x11d25c-0x0;var _0x2143e0=_0xae7c[_0x11d25c];return _0x2143e0;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0xcae7('0x0'))['db'][_0xcae7('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xcae7('0x2')](0x0);var events={'afterCreate':_0xcae7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2eff60){return function(_0x3c0478,_0x272111,_0x345a57){FaxAccountEvents[_0xcae7('0x4')](_0x2eff60+':'+_0x3c0478['id'],_0x3c0478);FaxAccountEvents[_0xcae7('0x4')](_0x2eff60,_0x3c0478);_0x345a57(null);};}for(var e in events){if(events[_0xcae7('0x5')](e)){var event=events[e];FaxAccount[_0xcae7('0x6')](e,emitEvent(event));}}module[_0xcae7('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0x228b=['../../mysqldb','FaxAccount','setMaxListeners','update','remove','emit','hook','events'];(function(_0x1fc7b5,_0x5d4779){var _0x3ef5db=function(_0x1622cf){while(--_0x1622cf){_0x1fc7b5['push'](_0x1fc7b5['shift']());}};_0x3ef5db(++_0x5d4779);}(_0x228b,0x1e7));var _0xb228=function(_0x1edf25,_0x10b2eb){_0x1edf25=_0x1edf25-0x0;var _0x3904d8=_0x228b[_0x1edf25];return _0x3904d8;};'use strict';var EventEmitter=require(_0xb228('0x0'));var FaxAccount=require(_0xb228('0x1'))['db'][_0xb228('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xb228('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb228('0x4'),'afterDestroy':_0xb228('0x5')};function emitEvent(_0x4b81b1){return function(_0x1e1f6f,_0x26edbe,_0x4bfaa3){FaxAccountEvents[_0xb228('0x6')](_0x4b81b1+':'+_0x1e1f6f['id'],_0x1e1f6f);FaxAccountEvents['emit'](_0x4b81b1,_0x1e1f6f);_0x4bfaa3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xb228('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 c5400b8..5672eab 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 _0x3f2e=['../../config/logger','api','moment','bluebird','request-promise','path','./faxAccount.attributes','exports','FaxAccount','fax_accounts','lodash'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3f2e,0x11d));var _0xe3f2=function(_0x38aeea,_0x57522a){_0x38aeea=_0x38aeea-0x0;var _0x5e8d2c=_0x3f2e[_0x38aeea];return _0x5e8d2c;};'use strict';var _=require(_0xe3f2('0x0'));var util=require('util');var logger=require(_0xe3f2('0x1'))(_0xe3f2('0x2'));var moment=require(_0xe3f2('0x3'));var BPromise=require(_0xe3f2('0x4'));var rp=require(_0xe3f2('0x5'));var fs=require('fs');var path=require(_0xe3f2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe3f2('0x7'));module[_0xe3f2('0x8')]=function(_0x11c7c0,_0x2a501d){return _0x11c7c0['define'](_0xe3f2('0x9'),attributes,{'tableName':_0xe3f2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f1f=['define','FaxAccount','fax_accounts','lodash','util','../../config/logger','request-promise','path','rimraf','./faxAccount.attributes'];(function(_0x5a979b,_0x17a473){var _0x1abd9a=function(_0x48e37c){while(--_0x48e37c){_0x5a979b['push'](_0x5a979b['shift']());}};_0x1abd9a(++_0x17a473);}(_0x6f1f,0xcb));var _0xf6f1=function(_0x2a58f0,_0x32f72c){_0x2a58f0=_0x2a58f0-0x0;var _0x5583f7=_0x6f1f[_0x2a58f0];return _0x5583f7;};'use strict';var _=require(_0xf6f1('0x0'));var util=require(_0xf6f1('0x1'));var logger=require(_0xf6f1('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf6f1('0x3'));var fs=require('fs');var path=require(_0xf6f1('0x4'));var rimraf=require(_0xf6f1('0x5'));var config=require('../../config/environment');var attributes=require(_0xf6f1('0x6'));module['exports']=function(_0x22fe69,_0x331109){return _0x22fe69[_0xf6f1('0x7')](_0xf6f1('0x8'),attributes,{'tableName':_0xf6f1('0x9'),'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 169499f..baace2f 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 _0x17bc=['created','interaction','FaxMessage','AttachmentId','UserId','agent','waitForTheAssignedAgent','queueId','FaxQueue','unshift','queue','name','waitForTheAssignedQueue','*,*,*,*','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','where','attributes','limit','include','model','map','NotifyFaxAccount','body','fax','describe','Sequelize','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','ValidationError','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','CmContact','Contacts','FaxApplication','Applications','List','applications','orderBy','priority','create','contact','FaxInteraction','Contact\x20not\x20found','get','autoclose','push','length','close','unmanaged'];(function(_0x1a0269,_0x5692f2){var _0x34887d=function(_0x40ab8b){while(--_0x40ab8b){_0x1a0269['push'](_0x1a0269['shift']());}};_0x34887d(++_0x5692f2);}(_0x17bc,0x1d0));var _0xc17b=function(_0x590d1a,_0x1b076){_0x590d1a=_0x590d1a-0x0;var _0x215ed7=_0x17bc[_0x590d1a];return _0x215ed7;};'use strict';var _=require(_0xc17b('0x0'));var util=require(_0xc17b('0x1'));var moment=require(_0xc17b('0x2'));var BPromise=require(_0xc17b('0x3'));var rs=require(_0xc17b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc17b('0x5'));var logger=require(_0xc17b('0x6'))(_0xc17b('0x7'));var config=require('../../config/environment');var jayson=require(_0xc17b('0x8'));var client=jayson[_0xc17b('0x9')][_0xc17b('0xa')]({'port':0x232c});config[_0xc17b('0xb')]=_[_0xc17b('0xc')](config[_0xc17b('0xb')],{'host':_0xc17b('0xd'),'port':0x18eb});var socket=require(_0xc17b('0xe'))(new Redis(config[_0xc17b('0xb')]));require(_0xc17b('0xf'))[_0xc17b('0x10')](socket);function respondWithRpcPromise(_0x5cd2e0,_0x3a7752,_0x4176aa){return new BPromise(function(_0x15a986,_0x1cf4af){return client['request'](_0x5cd2e0,_0x4176aa)[_0xc17b('0x11')](function(_0x8e996){logger[_0xc17b('0x12')](_0xc17b('0x13'),_0x3a7752,_0xc17b('0x14'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x3a7752,_0xc17b('0x14'),JSON[_0xc17b('0x15')](_0x8e996));if(_0x8e996[_0xc17b('0x16')]){if(_0x8e996[_0xc17b('0x16')]['code']===0x1f4){logger[_0xc17b('0x16')](_0xc17b('0x13'),_0x3a7752,_0x8e996[_0xc17b('0x16')][_0xc17b('0x17')]);return _0x1cf4af(_0x8e996[_0xc17b('0x16')]['message']);}logger['error'](_0xc17b('0x13'),_0x3a7752,_0x8e996['error']['message']);return _0x15a986(_0x8e996[_0xc17b('0x16')][_0xc17b('0x17')]);}else{logger[_0xc17b('0x12')](_0xc17b('0x13'),_0x3a7752,_0xc17b('0x14'));_0x15a986(_0x8e996[_0xc17b('0x18')][_0xc17b('0x17')]);}})[_0xc17b('0x19')](function(_0x12eae5){logger['error'](_0xc17b('0x13'),_0x3a7752,_0x12eae5);_0x1cf4af(_0x12eae5);});});}exports[_0xc17b('0x1a')]=function(_0x6168ff){var _0x275c76=this;return new Promise(function(_0x2ab23e,_0xa5ddf3){return db[_0xc17b('0x1b')][_0xc17b('0x1c')]({'raw':_0x6168ff['options']?_0x6168ff[_0xc17b('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x6168ff[_0xc17b('0x1d')]?_0x6168ff[_0xc17b('0x1d')][_0xc17b('0x1e')]||null:null,'attributes':_0x6168ff[_0xc17b('0x1d')]?_0x6168ff[_0xc17b('0x1d')][_0xc17b('0x1f')]||null:null,'limit':_0x6168ff['options']?_0x6168ff[_0xc17b('0x1d')][_0xc17b('0x20')]||null:null,'include':_0x6168ff[_0xc17b('0x1d')]?_0x6168ff['options'][_0xc17b('0x21')]?_['map'](_0x6168ff['options']['include'],function(_0xff2342){return{'model':db[_0xff2342[_0xc17b('0x22')]],'as':_0xff2342['as'],'attributes':_0xff2342['attributes'],'include':_0xff2342['include']?_[_0xc17b('0x23')](_0xff2342[_0xc17b('0x21')],function(_0x535819){return{'model':db[_0x535819[_0xc17b('0x22')]],'as':_0x535819['as'],'attributes':_0x535819['attributes'],'include':_0x535819[_0xc17b('0x21')]?_[_0xc17b('0x23')](_0x535819[_0xc17b('0x21')],function(_0x583ead){return{'model':db[_0x583ead['model']],'as':_0x583ead['as'],'attributes':_0x583ead[_0xc17b('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x43cbd6){logger[_0xc17b('0x12')](_0xc17b('0x1a'),_0x6168ff);logger['debug'](_0xc17b('0x1a'),_0x6168ff,JSON[_0xc17b('0x15')](_0x43cbd6));_0x2ab23e(_0x43cbd6);})[_0xc17b('0x19')](function(_0x533f3f){logger[_0xc17b('0x16')](_0xc17b('0x1a'),_0x533f3f[_0xc17b('0x17')],_0x6168ff);_0xa5ddf3(_0x275c76[_0xc17b('0x16')](0x1f4,_0x533f3f[_0xc17b('0x17')]));});});};exports[_0xc17b('0x24')]=function(_0x415d9a,_0x5a4c8d,_0x1ccfcf){var _0x48a072=this;return new Promise(function(_0x3753ae,_0x5748a2){var _0x160dab={'body':_0x415d9a[_0xc17b('0x25')],'channel':_0xc17b('0x26')};var _0x110f26=[];var _0x19ada4=[];var _0x44b6ea={};return db['CmContact'][_0xc17b('0x27')]()[_0xc17b('0x11')](function(_0x388b84){if(!_0x388b84){throw new db[(_0xc17b('0x28'))]['ValidationError'](_0xc17b('0x29'));}_0x110f26=_[_0xc17b('0x2a')](_[_0xc17b('0x2b')](_0x388b84),['createdAt','updatedAt']);_0x19ada4=_[_0xc17b('0x2a')](_[_0xc17b('0x2b')](_0x388b84),[_0xc17b('0x2c'),_0xc17b('0x2d'),_0xc17b('0x2e'),_0xc17b('0x2f')]);if(_0x415d9a['body']['id']){delete _0x415d9a[_0xc17b('0x25')]['id'];}if(_[_0xc17b('0x30')](_0x415d9a[_0xc17b('0x25')][_0xc17b('0x31')])){throw new db[(_0xc17b('0x28'))][(_0xc17b('0x32'))](_0xc17b('0x33'));}if(_['isNil'](_0x415d9a['body'][_0xc17b('0x25')])||_0x415d9a[_0xc17b('0x25')]['body']===''){throw new db[(_0xc17b('0x28'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xc17b('0x30')](_0x415d9a[_0xc17b('0x25')][_0xc17b('0x34')])){throw new db[(_0xc17b('0x28'))][(_0xc17b('0x32'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x19ada4);}if(!_[_0xc17b('0x35')](_0x19ada4,_0x415d9a[_0xc17b('0x25')][_0xc17b('0x34')])){throw new db[(_0xc17b('0x28'))]['ValidationError'](_0xc17b('0x36')+_0x19ada4);}_0x44b6ea[_0x415d9a[_0xc17b('0x25')][_0xc17b('0x34')]]=_0x415d9a['body'][_0xc17b('0x31')];})[_0xc17b('0x11')](function(){return db[_0xc17b('0x1b')][_0xc17b('0x37')]({'where':{'id':_0x415d9a[_0xc17b('0x38')]['id']},'include':[{'model':db[_0xc17b('0x39')],'as':'List','include':[{'model':db[_0xc17b('0x3a')],'as':_0xc17b('0x3b'),'where':_0x44b6ea,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xc17b('0x3c')],'as':_0xc17b('0x3d')}]});})[_0xc17b('0x11')](function(_0x57bc41){if(_0x57bc41&&_0x57bc41[_0xc17b('0x3e')]){var _0x45f979=_0x57bc41['get']({'plain':!![]});_0x160dab[_0xc17b('0x38')]=_0x45f979;_0x160dab[_0xc17b('0x3f')]=_0x45f979[_0xc17b('0x3d')];_0x160dab['list']=_0x45f979['List'];_0x160dab[_0xc17b('0x3f')]=_[_0xc17b('0x40')](_0x160dab['applications'],[_0xc17b('0x41')],['asc']);if(_0x160dab[_0xc17b('0x38')][_0xc17b('0x3d')]){delete _0x160dab[_0xc17b('0x38')][_0xc17b('0x3d')];}if(_0x160dab[_0xc17b('0x38')]['List']&&_0x160dab['account'][_0xc17b('0x3e')][_0xc17b('0x3b')]['length']){return _0x160dab[_0xc17b('0x38')][_0xc17b('0x3e')][_0xc17b('0x3b')][0x0];}var _0x105610=_[_0xc17b('0xc')](_0x415d9a[_0xc17b('0x25')],{'firstName':_0x415d9a['body'][_0xc17b('0x31')],'ListId':_0x45f979[_0xc17b('0x2f')]});_0x105610[_0x415d9a[_0xc17b('0x25')]['mapKey']]=_0x415d9a[_0xc17b('0x25')][_0xc17b('0x31')];return db['CmContact'][_0xc17b('0x42')](_0x105610,{'fields':_0x110f26,'raw':!![]});}})[_0xc17b('0x11')](function(_0x229ec6){_0x160dab[_0xc17b('0x43')]=_0x229ec6;if(_0x229ec6){var _0x3061af={'ContactId':_0x229ec6['id'],'FaxAccountId':_0x415d9a[_0xc17b('0x38')]['id'],'fax':_0x229ec6[_0xc17b('0x26')]};return db['FaxInteraction']['find']({'where':{'ContactId':_0x229ec6['id'],'closed':![],'FaxAccountId':_0x415d9a[_0xc17b('0x38')]['id']}})[_0xc17b('0x11')](function(_0x43f00){if(_0x43f00){return[_0x43f00,![]];}return db[_0xc17b('0x44')][_0xc17b('0x42')](_0x3061af)[_0xc17b('0x11')](function(_0x186e31){return[_0x186e31,!![]];});});}else{throw new Error(_0xc17b('0x45'));}})['spread'](function(_0x11c70b,_0xe2d8b9){var _0x50666f=_0x11c70b[_0xc17b('0x46')]({'plain':!![]});if(_0xe2d8b9){if(_0x160dab[_0xc17b('0x38')][_0xc17b('0x47')]){_0x160dab[_0xc17b('0x3f')][_0xc17b('0x48')]({'id':0x0,'priority':_0x160dab[_0xc17b('0x3f')][_0xc17b('0x49')]+0x1,'app':_0xc17b('0x4a'),'appdata':_0xc17b('0x4b'),'interval':'*,*,*,*'});}_0x50666f['created']=!![];}else{_0x50666f[_0xc17b('0x4c')]=![];}_0x160dab[_0xc17b('0x4d')]=_0x50666f;return db[_0xc17b('0x4e')]['create']({'body':_0x415d9a[_0xc17b('0x25')][_0xc17b('0x25')],'FaxAccountId':_0x415d9a['account']['id'],'FaxInteractionId':_0x11c70b['id'],'direction':'in','ContactId':_0x11c70b['ContactId'],'AttachmentId':_0x415d9a['body'][_0xc17b('0x4f')]});})[_0xc17b('0x11')](function(_0x10f50e){_0x160dab[_0xc17b('0x17')]=_0x10f50e;if(!_0x160dab[_0xc17b('0x4d')]['UserId'])return;return db['User'][_0xc17b('0x37')]({'attributes':['id','name'],'where':{'id':_0x160dab['interaction'][_0xc17b('0x50')]}});})[_0xc17b('0x11')](function(_0x54d4d3){if(_0x54d4d3){_0x160dab[_0xc17b('0x3f')]['unshift']({'id':0x0,'priority':0x0,'app':_0xc17b('0x51'),'appdata':_0x54d4d3['name']+','+(_0x160dab[_0xc17b('0x38')][_0xc17b('0x52')]||0xa),'interval':'*,*,*,*'});}if(!_0x160dab[_0xc17b('0x4d')][_0xc17b('0x53')])return;return db[_0xc17b('0x54')][_0xc17b('0x37')]({'attributes':['id','name'],'where':{'id':_0x160dab[_0xc17b('0x4d')][_0xc17b('0x53')]}});})[_0xc17b('0x11')](function(_0x578bc1){if(_0x578bc1){_0x160dab[_0xc17b('0x3f')][_0xc17b('0x55')]({'id':0x0,'priority':0x1,'app':_0xc17b('0x56'),'appdata':_0x578bc1[_0xc17b('0x57')]+','+(_0x160dab['account'][_0xc17b('0x58')]||0x12c),'interval':_0xc17b('0x59')});}return respondWithRpcPromise('Start','startRouting',_0x160dab);})['then'](function(_0x465ade){_0x3753ae(_0x465ade);})[_0xc17b('0x19')](function(_0x5f5269){_0x5748a2(_0x48a072[_0xc17b('0x16')](0x1f4,_0x5f5269['message']));});});}; \ No newline at end of file +var _0xe064=['client','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','request','info','FaxAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','GetFaxAccount','FaxAccount','options','raw','where','include','map','model','attributes','then','catch','NotifyFaxAccount','fax','CmContact','describe','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','body','from','Sequelize','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Contacts','DESC','FaxApplication','Applications','get','list','applications','orderBy','asc','List','length','create','contact','FaxInteraction','close','unmanaged','*,*,*,*','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name','unshift','agent','queueId','queue','waitForTheAssignedQueue','Start','startRouting','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x4f1b23,_0x1f9eb8){var _0x5b92f6=function(_0x5388d8){while(--_0x5388d8){_0x4f1b23['push'](_0x4f1b23['shift']());}};_0x5b92f6(++_0x1f9eb8);}(_0xe064,0x15b));var _0x4e06=function(_0x2952d5,_0x5a22e1){_0x2952d5=_0x2952d5-0x0;var _0x11a097=_0xe064[_0x2952d5];return _0x11a097;};'use strict';var _=require(_0x4e06('0x0'));var util=require(_0x4e06('0x1'));var moment=require('moment');var BPromise=require(_0x4e06('0x2'));var rs=require(_0x4e06('0x3'));var fs=require('fs');var Redis=require(_0x4e06('0x4'));var db=require(_0x4e06('0x5'))['db'];var utils=require(_0x4e06('0x6'));var logger=require(_0x4e06('0x7'))('rpc');var config=require(_0x4e06('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4e06('0x9')]['http']({'port':0x232c});config['redis']=_[_0x4e06('0xa')](config[_0x4e06('0xb')],{'host':_0x4e06('0xc'),'port':0x18eb});var socket=require(_0x4e06('0xd'))(new Redis(config[_0x4e06('0xb')]));require(_0x4e06('0xe'))['register'](socket);function respondWithRpcPromise(_0x44ffe7,_0x2f9743,_0x4cf90a){return new BPromise(function(_0x3c8f8d,_0x1cec43){return client[_0x4e06('0xf')](_0x44ffe7,_0x4cf90a)['then'](function(_0x42580f){logger[_0x4e06('0x10')](_0x4e06('0x11'),_0x2f9743,'request\x20sent');logger[_0x4e06('0x12')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x2f9743,_0x4e06('0x13'),JSON[_0x4e06('0x14')](_0x42580f));if(_0x42580f[_0x4e06('0x15')]){if(_0x42580f['error'][_0x4e06('0x16')]===0x1f4){logger[_0x4e06('0x15')](_0x4e06('0x11'),_0x2f9743,_0x42580f[_0x4e06('0x15')][_0x4e06('0x17')]);return _0x1cec43(_0x42580f['error'][_0x4e06('0x17')]);}logger[_0x4e06('0x15')]('FaxAccount,\x20%s,\x20%s',_0x2f9743,_0x42580f[_0x4e06('0x15')][_0x4e06('0x17')]);return _0x3c8f8d(_0x42580f['error'][_0x4e06('0x17')]);}else{logger['info'](_0x4e06('0x11'),_0x2f9743,'request\x20sent');_0x3c8f8d(_0x42580f['result'][_0x4e06('0x17')]);}})['catch'](function(_0x55f66d){logger[_0x4e06('0x15')]('FaxAccount,\x20%s,\x20%s',_0x2f9743,_0x55f66d);_0x1cec43(_0x55f66d);});});}exports[_0x4e06('0x18')]=function(_0x15d3f1){var _0x3d5e44=this;return new Promise(function(_0x31ae91,_0x15452c){return db[_0x4e06('0x19')]['findAll']({'raw':_0x15d3f1['options']?_0x15d3f1[_0x4e06('0x1a')][_0x4e06('0x1b')]===undefined?!![]:![]:!![],'where':_0x15d3f1[_0x4e06('0x1a')]?_0x15d3f1['options'][_0x4e06('0x1c')]||null:null,'attributes':_0x15d3f1['options']?_0x15d3f1[_0x4e06('0x1a')]['attributes']||null:null,'limit':_0x15d3f1[_0x4e06('0x1a')]?_0x15d3f1[_0x4e06('0x1a')]['limit']||null:null,'include':_0x15d3f1[_0x4e06('0x1a')]?_0x15d3f1[_0x4e06('0x1a')][_0x4e06('0x1d')]?_[_0x4e06('0x1e')](_0x15d3f1['options'][_0x4e06('0x1d')],function(_0x12be42){return{'model':db[_0x12be42[_0x4e06('0x1f')]],'as':_0x12be42['as'],'attributes':_0x12be42[_0x4e06('0x20')],'include':_0x12be42[_0x4e06('0x1d')]?_[_0x4e06('0x1e')](_0x12be42['include'],function(_0x2c47b1){return{'model':db[_0x2c47b1['model']],'as':_0x2c47b1['as'],'attributes':_0x2c47b1[_0x4e06('0x20')],'include':_0x2c47b1[_0x4e06('0x1d')]?_[_0x4e06('0x1e')](_0x2c47b1[_0x4e06('0x1d')],function(_0x318559){return{'model':db[_0x318559[_0x4e06('0x1f')]],'as':_0x318559['as'],'attributes':_0x318559[_0x4e06('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4e06('0x21')](function(_0x5b6cf5){logger[_0x4e06('0x10')](_0x4e06('0x18'),_0x15d3f1);logger['debug'](_0x4e06('0x18'),_0x15d3f1,JSON['stringify'](_0x5b6cf5));_0x31ae91(_0x5b6cf5);})[_0x4e06('0x22')](function(_0x346df4){logger[_0x4e06('0x15')](_0x4e06('0x18'),_0x346df4[_0x4e06('0x17')],_0x15d3f1);_0x15452c(_0x3d5e44[_0x4e06('0x15')](0x1f4,_0x346df4[_0x4e06('0x17')]));});});};exports[_0x4e06('0x23')]=function(_0x3a2fc3,_0x2368d8,_0x3eaa87){var _0xbe8d51=this;return new Promise(function(_0xa34152,_0x1880c7){var _0x4a5eee={'body':_0x3a2fc3['body'],'channel':_0x4e06('0x24')};var _0x2e6149=[];var _0x1a2746=[];var _0x59b64c={};return db[_0x4e06('0x25')][_0x4e06('0x26')]()['then'](function(_0x3f817b){if(!_0x3f817b){throw new db['Sequelize'][(_0x4e06('0x27'))](_0x4e06('0x28'));}_0x2e6149=_[_0x4e06('0x29')](_[_0x4e06('0x2a')](_0x3f817b),[_0x4e06('0x2b'),_0x4e06('0x2c')]);_0x1a2746=_[_0x4e06('0x29')](_[_0x4e06('0x2a')](_0x3f817b),[_0x4e06('0x2b'),'updatedAt',_0x4e06('0x2d'),_0x4e06('0x2e')]);if(_0x3a2fc3['body']['id']){delete _0x3a2fc3['body']['id'];}if(_[_0x4e06('0x2f')](_0x3a2fc3[_0x4e06('0x30')][_0x4e06('0x31')])){throw new db[(_0x4e06('0x32'))][(_0x4e06('0x27'))]('from\x20is\x20mandatory');}if(_[_0x4e06('0x2f')](_0x3a2fc3['body'][_0x4e06('0x30')])||_0x3a2fc3[_0x4e06('0x30')]['body']===''){throw new db[(_0x4e06('0x32'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x3a2fc3[_0x4e06('0x30')][_0x4e06('0x33')])){throw new db[(_0x4e06('0x32'))][(_0x4e06('0x27'))](_0x4e06('0x34')+_0x1a2746);}if(!_[_0x4e06('0x35')](_0x1a2746,_0x3a2fc3[_0x4e06('0x30')][_0x4e06('0x33')])){throw new db[(_0x4e06('0x32'))]['ValidationError'](_0x4e06('0x36')+_0x1a2746);}_0x59b64c[_0x3a2fc3['body'][_0x4e06('0x33')]]=_0x3a2fc3[_0x4e06('0x30')]['from'];})['then'](function(){return db[_0x4e06('0x19')][_0x4e06('0x37')]({'where':{'id':_0x3a2fc3[_0x4e06('0x38')]['id']},'include':[{'model':db[_0x4e06('0x39')],'as':'List','include':[{'model':db[_0x4e06('0x25')],'as':_0x4e06('0x3a'),'where':_0x59b64c,'limit':0x1,'order':[['updatedAt',_0x4e06('0x3b')]]}]},{'model':db[_0x4e06('0x3c')],'as':_0x4e06('0x3d')}]});})[_0x4e06('0x21')](function(_0x3ade3b){if(_0x3ade3b&&_0x3ade3b['List']){var _0x36b8e3=_0x3ade3b[_0x4e06('0x3e')]({'plain':!![]});_0x4a5eee[_0x4e06('0x38')]=_0x36b8e3;_0x4a5eee['applications']=_0x36b8e3[_0x4e06('0x3d')];_0x4a5eee[_0x4e06('0x3f')]=_0x36b8e3['List'];_0x4a5eee[_0x4e06('0x40')]=_[_0x4e06('0x41')](_0x4a5eee[_0x4e06('0x40')],['priority'],[_0x4e06('0x42')]);if(_0x4a5eee['account'][_0x4e06('0x3d')]){delete _0x4a5eee[_0x4e06('0x38')][_0x4e06('0x3d')];}if(_0x4a5eee['account'][_0x4e06('0x43')]&&_0x4a5eee[_0x4e06('0x38')][_0x4e06('0x43')]['Contacts'][_0x4e06('0x44')]){return _0x4a5eee['account'][_0x4e06('0x43')][_0x4e06('0x3a')][0x0];}var _0x4fc361=_[_0x4e06('0xa')](_0x3a2fc3['body'],{'firstName':_0x3a2fc3[_0x4e06('0x30')][_0x4e06('0x31')],'ListId':_0x36b8e3['ListId']});_0x4fc361[_0x3a2fc3[_0x4e06('0x30')][_0x4e06('0x33')]]=_0x3a2fc3['body'][_0x4e06('0x31')];return db[_0x4e06('0x25')][_0x4e06('0x45')](_0x4fc361,{'fields':_0x2e6149,'raw':!![]});}})['then'](function(_0x3b99ce){_0x4a5eee[_0x4e06('0x46')]=_0x3b99ce;if(_0x3b99ce){var _0x3dc95c={'ContactId':_0x3b99ce['id'],'FaxAccountId':_0x3a2fc3[_0x4e06('0x38')]['id'],'fax':_0x3b99ce['fax']};return db['FaxInteraction'][_0x4e06('0x37')]({'where':{'ContactId':_0x3b99ce['id'],'closed':![],'FaxAccountId':_0x3a2fc3[_0x4e06('0x38')]['id']}})[_0x4e06('0x21')](function(_0x6769e7){if(_0x6769e7){return[_0x6769e7,![]];}return db[_0x4e06('0x47')][_0x4e06('0x45')](_0x3dc95c)['then'](function(_0x323e52){return[_0x323e52,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})['spread'](function(_0x22dd74,_0x2b38a2){var _0x2ec091=_0x22dd74['get']({'plain':!![]});if(_0x2b38a2){if(_0x4a5eee[_0x4e06('0x38')]['autoclose']){_0x4a5eee[_0x4e06('0x40')]['push']({'id':0x0,'priority':_0x4a5eee['applications'][_0x4e06('0x44')]+0x1,'app':_0x4e06('0x48'),'appdata':_0x4e06('0x49'),'interval':_0x4e06('0x4a')});}_0x2ec091['created']=!![];}else{_0x2ec091['created']=![];}_0x4a5eee[_0x4e06('0x4b')]=_0x2ec091;return db[_0x4e06('0x4c')][_0x4e06('0x45')]({'body':_0x3a2fc3[_0x4e06('0x30')]['body'],'FaxAccountId':_0x3a2fc3[_0x4e06('0x38')]['id'],'FaxInteractionId':_0x22dd74['id'],'direction':'in','ContactId':_0x22dd74[_0x4e06('0x4d')],'AttachmentId':_0x3a2fc3[_0x4e06('0x30')][_0x4e06('0x4e')]});})[_0x4e06('0x21')](function(_0x297302){_0x4a5eee[_0x4e06('0x17')]=_0x297302;if(!_0x4a5eee['interaction'][_0x4e06('0x4f')])return;return db[_0x4e06('0x50')][_0x4e06('0x37')]({'attributes':['id',_0x4e06('0x51')],'where':{'id':_0x4a5eee[_0x4e06('0x4b')]['UserId']}});})[_0x4e06('0x21')](function(_0x3a0f87){if(_0x3a0f87){_0x4a5eee[_0x4e06('0x40')][_0x4e06('0x52')]({'id':0x0,'priority':0x0,'app':_0x4e06('0x53'),'appdata':_0x3a0f87['name']+','+(_0x4a5eee[_0x4e06('0x38')]['waitForTheAssignedAgent']||0xa),'interval':_0x4e06('0x4a')});}if(!_0x4a5eee['interaction'][_0x4e06('0x54')])return;return db['FaxQueue'][_0x4e06('0x37')]({'attributes':['id',_0x4e06('0x51')],'where':{'id':_0x4a5eee[_0x4e06('0x4b')]['queueId']}});})[_0x4e06('0x21')](function(_0x5021a0){if(_0x5021a0){_0x4a5eee[_0x4e06('0x40')]['unshift']({'id':0x0,'priority':0x1,'app':_0x4e06('0x55'),'appdata':_0x5021a0[_0x4e06('0x51')]+','+(_0x4a5eee[_0x4e06('0x38')][_0x4e06('0x56')]||0x12c),'interval':_0x4e06('0x4a')});}return respondWithRpcPromise(_0x4e06('0x57'),_0x4e06('0x58'),_0x4a5eee);})[_0x4e06('0x21')](function(_0x5211a7){_0xa34152(_0x5211a7);})[_0x4e06('0x22')](function(_0x2a5687){_0x1880c7(_0xbe8d51[_0x4e06('0x15')](0x1f4,_0x2a5687['message']));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index ffece96..b67d811 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 _0x5f03=['./faxAccount.events','save','remove','update','emit','removeListener','faxAccount:'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x5f03,0x1a4));var _0x35f0=function(_0x2907ae,_0x3fef0b){_0x2907ae=_0x2907ae-0x0;var _0x3f3849=_0x5f03[_0x2907ae];return _0x3f3849;};'use strict';var FaxAccountEvents=require(_0x35f0('0x0'));var events=[_0x35f0('0x1'),_0x35f0('0x2'),_0x35f0('0x3')];function createListener(_0x2514bb,_0xef522e){return function(_0x574b5f){_0xef522e[_0x35f0('0x4')](_0x2514bb,_0x574b5f);};}function removeListener(_0x307349,_0x27b725){return function(){FaxAccountEvents[_0x35f0('0x5')](_0x307349,_0x27b725);};}exports['register']=function(_0x5e41f2){for(var _0x38c3fd=0x0,_0x23e5a5=events['length'];_0x38c3fd<_0x23e5a5;_0x38c3fd++){var _0x2097a0=events[_0x38c3fd];var _0x1d9033=createListener(_0x35f0('0x6')+_0x2097a0,_0x5e41f2);FaxAccountEvents['on'](_0x2097a0,_0x1d9033);}}; \ No newline at end of file +var _0xdcf1=['emit','register','faxAccount:','./faxAccount.events','save','remove','update'];(function(_0x5e544c,_0x3d902a){var _0x44f61c=function(_0x6ebcb5){while(--_0x6ebcb5){_0x5e544c['push'](_0x5e544c['shift']());}};_0x44f61c(++_0x3d902a);}(_0xdcf1,0x106));var _0x1dcf=function(_0x206f4b,_0x346117){_0x206f4b=_0x206f4b-0x0;var _0x20599c=_0xdcf1[_0x206f4b];return _0x20599c;};'use strict';var FaxAccountEvents=require(_0x1dcf('0x0'));var events=[_0x1dcf('0x1'),_0x1dcf('0x2'),_0x1dcf('0x3')];function createListener(_0x17d828,_0x872980){return function(_0x598437){_0x872980[_0x1dcf('0x4')](_0x17d828,_0x598437);};}function removeListener(_0x3e50a5,_0x175344){return function(){FaxAccountEvents['removeListener'](_0x3e50a5,_0x175344);};}exports[_0x1dcf('0x5')]=function(_0x358c93){for(var _0x145a66=0x0,_0x2ce354=events['length'];_0x145a66<_0x2ce354;_0x145a66++){var _0x797f81=events[_0x145a66];var _0x2a3c72=createListener(_0x1dcf('0x6')+_0x797f81,_0x358c93);FaxAccountEvents['on'](_0x797f81,_0x2a3c72);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index e6a2d11..4c0a246 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 _0xf838=['getInteractions','/:id/messages','getAgents','create','post','addAnswer','/:id/applications','addApplications','/addaccountapplications','addAccountApplications','updateAccountApplications','/:id/users','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','multer','path','connect-timeout','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','/describe','describe','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/interactions'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf838,0x159));var _0x8f83=function(_0x162ebc,_0x55c0c6){_0x162ebc=_0x162ebc-0x0;var _0x133d96=_0xf838[_0x162ebc];return _0x133d96;};'use strict';var multer=require(_0x8f83('0x0'));var util=require('util');var path=require(_0x8f83('0x1'));var timeout=require(_0x8f83('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8f83('0x3'));var config=require(_0x8f83('0x4'));var controller=require(_0x8f83('0x5'));router[_0x8f83('0x6')]('/',auth[_0x8f83('0x7')](),controller[_0x8f83('0x8')]);router[_0x8f83('0x6')](_0x8f83('0x9'),auth[_0x8f83('0x7')](),controller[_0x8f83('0xa')]);router[_0x8f83('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x8f83('0x6')](_0x8f83('0xb'),auth[_0x8f83('0x7')](),controller[_0x8f83('0xc')]);router['get'](_0x8f83('0xd'),auth[_0x8f83('0x7')](),controller['getAnswers']);router[_0x8f83('0x6')](_0x8f83('0xe'),auth[_0x8f83('0x7')](),controller[_0x8f83('0xf')]);router[_0x8f83('0x6')]('/:id/applications',auth[_0x8f83('0x7')](),controller['getApplications']);router['get'](_0x8f83('0x10'),auth['isAuthenticated'](),controller['getMessages']);router[_0x8f83('0x6')]('/:id/users',auth[_0x8f83('0x7')](),controller[_0x8f83('0x11')]);router['post']('/',auth[_0x8f83('0x7')](),controller[_0x8f83('0x12')]);router[_0x8f83('0x13')]('/:id/dispositions',auth[_0x8f83('0x7')](),controller['addDisposition']);router[_0x8f83('0x13')]('/:id/canned_answers',auth[_0x8f83('0x7')](),controller[_0x8f83('0x14')]);router[_0x8f83('0x13')](_0x8f83('0xe'),auth[_0x8f83('0x7')](),controller['addInteraction']);router['post'](_0x8f83('0x15'),auth[_0x8f83('0x7')](),controller[_0x8f83('0x16')]);router[_0x8f83('0x13')](_0x8f83('0x17'),auth['isAuthenticated'](),controller[_0x8f83('0x18')]);router[_0x8f83('0x13')]('/updateaccountapplications',auth[_0x8f83('0x7')](),controller[_0x8f83('0x19')]);router[_0x8f83('0x13')]('/:id/send',auth['isAuthenticated'](),controller['send']);router[_0x8f83('0x13')](_0x8f83('0x1a'),auth[_0x8f83('0x7')](),controller[_0x8f83('0x1b')]);router[_0x8f83('0x1c')]('/:id',auth[_0x8f83('0x7')](),controller[_0x8f83('0x1d')]);router[_0x8f83('0x1e')](_0x8f83('0x1f'),auth[_0x8f83('0x7')](),controller[_0x8f83('0x20')]);router[_0x8f83('0x1e')](_0x8f83('0xb'),auth['isAuthenticated'](),controller[_0x8f83('0x21')]);router[_0x8f83('0x1e')](_0x8f83('0xd'),auth['isAuthenticated'](),controller[_0x8f83('0x22')]);router[_0x8f83('0x1e')](_0x8f83('0x1a'),auth['isAuthenticated'](),controller[_0x8f83('0x23')]);module['exports']=router; \ No newline at end of file +var _0xa147=['addInteraction','addApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','/describe','/:id','/:id/dispositions','getAnswers','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers'];(function(_0x1cd1c6,_0x22e9e9){var _0x13b566=function(_0x26a2ad){while(--_0x26a2ad){_0x1cd1c6['push'](_0x1cd1c6['shift']());}};_0x13b566(++_0x22e9e9);}(_0xa147,0x83));var _0x7a14=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa147[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require(_0x7a14('0x0'));var util=require(_0x7a14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7a14('0x2'));var router=express[_0x7a14('0x3')]();var fs_extra=require(_0x7a14('0x4'));var auth=require(_0x7a14('0x5'));var interaction=require(_0x7a14('0x6'));var config=require(_0x7a14('0x7'));var controller=require(_0x7a14('0x8'));router[_0x7a14('0x9')]('/',auth[_0x7a14('0xa')](),controller['index']);router['get'](_0x7a14('0xb'),auth[_0x7a14('0xa')](),controller['describe']);router['get'](_0x7a14('0xc'),auth[_0x7a14('0xa')](),controller['show']);router['get'](_0x7a14('0xd'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x7a14('0x9')]('/:id/canned_answers',auth[_0x7a14('0xa')](),controller[_0x7a14('0xe')]);router[_0x7a14('0x9')](_0x7a14('0xf'),auth[_0x7a14('0xa')](),controller['getInteractions']);router[_0x7a14('0x9')](_0x7a14('0x10'),auth[_0x7a14('0xa')](),controller[_0x7a14('0x11')]);router[_0x7a14('0x9')](_0x7a14('0x12'),auth[_0x7a14('0xa')](),controller[_0x7a14('0x13')]);router[_0x7a14('0x9')](_0x7a14('0x14'),auth[_0x7a14('0xa')](),controller[_0x7a14('0x15')]);router['post']('/',auth[_0x7a14('0xa')](),controller['create']);router[_0x7a14('0x16')](_0x7a14('0xd'),auth['isAuthenticated'](),controller[_0x7a14('0x17')]);router[_0x7a14('0x16')](_0x7a14('0x18'),auth[_0x7a14('0xa')](),controller['addAnswer']);router[_0x7a14('0x16')](_0x7a14('0xf'),auth[_0x7a14('0xa')](),controller[_0x7a14('0x19')]);router[_0x7a14('0x16')](_0x7a14('0x10'),auth[_0x7a14('0xa')](),controller[_0x7a14('0x1a')]);router[_0x7a14('0x16')]('/addaccountapplications',auth['isAuthenticated'](),controller['addAccountApplications']);router[_0x7a14('0x16')](_0x7a14('0x1b'),auth[_0x7a14('0xa')](),controller[_0x7a14('0x1c')]);router['post'](_0x7a14('0x1d'),auth[_0x7a14('0xa')](),controller[_0x7a14('0x1e')]);router[_0x7a14('0x16')](_0x7a14('0x14'),auth[_0x7a14('0xa')](),controller[_0x7a14('0x1f')]);router[_0x7a14('0x20')](_0x7a14('0xc'),auth[_0x7a14('0xa')](),controller[_0x7a14('0x21')]);router['delete'](_0x7a14('0xc'),auth[_0x7a14('0xa')](),controller[_0x7a14('0x22')]);router[_0x7a14('0x23')](_0x7a14('0xd'),auth[_0x7a14('0xa')](),controller[_0x7a14('0x24')]);router[_0x7a14('0x23')](_0x7a14('0x18'),auth[_0x7a14('0xa')](),controller[_0x7a14('0x25')]);router[_0x7a14('0x23')](_0x7a14('0x14'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x7a14('0x26')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 00df2f5..b30606e 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 _0xf9e5=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf9e5,0x164));var _0x5f9e=function(_0x2285b3,_0x1953a0){_0x2285b3=_0x2285b3-0x0;var _0x4a6da0=_0xf9e5[_0x2285b3];return _0x4a6da0;};'use strict';var Sequelize=require(_0x5f9e('0x0'));module[_0x5f9e('0x1')]={'priority':{'type':Sequelize[_0x5f9e('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x5f9e('0x3')],'allowNull':![],'defaultValue':_0x5f9e('0x4')},'appdata':{'type':Sequelize[_0x5f9e('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x5f9e('0x6')}}; \ No newline at end of file +var _0x7fe9=['*,*,*,*','exports','INTEGER','STRING','noop','TEXT'];(function(_0x642240,_0xd34510){var _0x5d89c9=function(_0x33e2c7){while(--_0x33e2c7){_0x642240['push'](_0x642240['shift']());}};_0x5d89c9(++_0xd34510);}(_0x7fe9,0x9d));var _0x97fe=function(_0x4463eb,_0x3cd3fb){_0x4463eb=_0x4463eb-0x0;var _0x1d20d5=_0x7fe9[_0x4463eb];return _0x1d20d5;};'use strict';var Sequelize=require('sequelize');module[_0x97fe('0x0')]={'priority':{'type':Sequelize[_0x97fe('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x97fe('0x2')],'allowNull':![],'defaultValue':_0x97fe('0x3')},'appdata':{'type':Sequelize[_0x97fe('0x4')]()},'description':{'type':Sequelize[_0x97fe('0x2')]},'interval':{'type':Sequelize[_0x97fe('0x2')],'defaultValue':_0x97fe('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index ee5268e..5aa7ed4 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 _0x4362=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','reject','update','then','destroy','send','index','FaxApplication','rawAttributes','fieldName','type','key','model','name','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL','options','rows','show','params','includeAll','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x2cb0b7,_0x263a9f){var _0x5366ea=function(_0x43c850){while(--_0x43c850){_0x2cb0b7['push'](_0x2cb0b7['shift']());}};_0x5366ea(++_0x263a9f);}(_0x4362,0x11d));var _0x2436=function(_0xb94e45,_0x519a7c){_0xb94e45=_0xb94e45-0x0;var _0x219d7b=_0x4362[_0xb94e45];return _0x219d7b;};'use strict';var emlformat=require(_0x2436('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2436('0x1'));var jsonpatch=require(_0x2436('0x2'));var rp=require(_0x2436('0x3'));var moment=require(_0x2436('0x4'));var BPromise=require(_0x2436('0x5'));var Mustache=require(_0x2436('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2436('0x7'));var fs=require('fs');var fs_extra=require(_0x2436('0x8'));var _=require(_0x2436('0x9'));var squel=require(_0x2436('0xa'));var crypto=require(_0x2436('0xb'));var jsforce=require(_0x2436('0xc'));var deskjs=require(_0x2436('0xd'));var toCsv=require(_0x2436('0xe'));var querystring=require(_0x2436('0xf'));var Papa=require(_0x2436('0x10'));var Redis=require(_0x2436('0x11'));var authService=require(_0x2436('0x12'));var qs=require(_0x2436('0x13'));var as=require(_0x2436('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2436('0x15'))(_0x2436('0x16'));var utils=require('../../config/utils');var config=require(_0x2436('0x17'));var licenseUtil=require(_0x2436('0x18'));var db=require(_0x2436('0x19'))['db'];function respondWithStatusCode(_0x4500f6,_0x233d77){_0x233d77=_0x233d77||0xcc;return function(_0x34f8f1){if(_0x34f8f1){return _0x4500f6[_0x2436('0x1a')](_0x233d77);}return _0x4500f6['status'](_0x233d77)[_0x2436('0x1b')]();};}function respondWithResult(_0xd96a36,_0x43c757){_0x43c757=_0x43c757||0xc8;return function(_0xa77cef){if(_0xa77cef){return _0xd96a36[_0x2436('0x1c')](_0x43c757)[_0x2436('0x1d')](_0xa77cef);}};}function respondWithFilteredResult(_0x337a7a,_0x220756){return function(_0x280636){if(_0x280636){var _0x3c6169=typeof _0x220756[_0x2436('0x1e')]===_0x2436('0x1f')&&typeof _0x220756[_0x2436('0x20')]===_0x2436('0x1f');var _0x346ef5=_0x280636[_0x2436('0x21')];var _0x1bb63a=_0x3c6169?0x0:_0x220756[_0x2436('0x1e')];var _0x4701f0=_0x3c6169?_0x280636[_0x2436('0x21')]:_0x220756[_0x2436('0x1e')]+_0x220756['limit'];var _0x323ceb;if(_0x4701f0>=_0x346ef5){_0x4701f0=_0x346ef5;_0x323ceb=0xc8;}else{_0x323ceb=0xce;}_0x337a7a[_0x2436('0x1c')](_0x323ceb);return _0x337a7a[_0x2436('0x22')]('Content-Range',_0x1bb63a+'-'+_0x4701f0+'/'+_0x346ef5)['json'](_0x280636);}return null;};}function patchUpdates(_0x196eb7){return function(_0x17437a){try{jsonpatch['apply'](_0x17437a,_0x196eb7,!![]);}catch(_0x31c85f){return BPromise[_0x2436('0x23')](_0x31c85f);}return _0x17437a['save']();};}function saveUpdates(_0x6556d3,_0x33a470){return function(_0x21a9f8){if(_0x21a9f8){return _0x21a9f8[_0x2436('0x24')](_0x6556d3)[_0x2436('0x25')](function(_0xa08b53){return _0xa08b53;});}return null;};}function removeEntity(_0x7879d9,_0x49e5e2){return function(_0x3957e6){if(_0x3957e6){return _0x3957e6[_0x2436('0x26')]()[_0x2436('0x25')](function(){_0x7879d9[_0x2436('0x1c')](0xcc)[_0x2436('0x1b')]();});}};}function handleEntityNotFound(_0x226fc9,_0x5e7bb9){return function(_0x6521ca){if(!_0x6521ca){_0x226fc9[_0x2436('0x1a')](0x194);}return _0x6521ca;};}function handleError(_0x45fc48,_0x553589){_0x553589=_0x553589||0x1f4;return function(_0x37cca8){logger['error'](_0x37cca8['stack']);if(_0x37cca8['name']){delete _0x37cca8['name'];}_0x45fc48['status'](_0x553589)[_0x2436('0x27')](_0x37cca8);};}exports[_0x2436('0x28')]=function(_0x4717f4,_0x1a2962){var _0x236c92={},_0x4ba0e8={},_0x59b89c={'count':0x0,'rows':[]};var _0x59b0a5=_['map'](db[_0x2436('0x29')][_0x2436('0x2a')],function(_0x482c69){return{'name':_0x482c69[_0x2436('0x2b')],'type':_0x482c69[_0x2436('0x2c')][_0x2436('0x2d')]};});_0x4ba0e8[_0x2436('0x2e')]=_['map'](_0x59b0a5,_0x2436('0x2f'));_0x4ba0e8['query']=_[_0x2436('0x30')](_0x4717f4[_0x2436('0x31')]);_0x4ba0e8[_0x2436('0x32')]=_[_0x2436('0x33')](_0x4ba0e8[_0x2436('0x2e')],_0x4ba0e8['query']);_0x236c92['attributes']=_[_0x2436('0x33')](_0x4ba0e8[_0x2436('0x2e')],qs[_0x2436('0x34')](_0x4717f4[_0x2436('0x31')][_0x2436('0x34')]));_0x236c92[_0x2436('0x35')]=_0x236c92[_0x2436('0x35')][_0x2436('0x36')]?_0x236c92[_0x2436('0x35')]:_0x4ba0e8[_0x2436('0x2e')];if(!_0x4717f4[_0x2436('0x31')]['hasOwnProperty'](_0x2436('0x37'))){_0x236c92[_0x2436('0x20')]=qs[_0x2436('0x20')](_0x4717f4[_0x2436('0x31')]['limit']);_0x236c92[_0x2436('0x1e')]=qs[_0x2436('0x1e')](_0x4717f4[_0x2436('0x31')][_0x2436('0x1e')]);}_0x236c92[_0x2436('0x38')]=qs[_0x2436('0x39')](_0x4717f4['query'][_0x2436('0x39')]);_0x236c92['where']=qs['filters'](_[_0x2436('0x3a')](_0x4717f4[_0x2436('0x31')],_0x4ba0e8[_0x2436('0x32')]),_0x59b0a5);if(_0x4717f4[_0x2436('0x31')][_0x2436('0x3b')]){_0x236c92[_0x2436('0x3c')]=_[_0x2436('0x3d')](_0x236c92['where'],{'$or':_[_0x2436('0x3e')](_0x59b0a5,function(_0x236d00){if(_0x236d00[_0x2436('0x2c')]!==_0x2436('0x3f')){var _0x453dd8={};_0x453dd8[_0x236d00[_0x2436('0x2f')]]={'$like':'%'+_0x4717f4[_0x2436('0x31')][_0x2436('0x3b')]+'%'};return _0x453dd8;}})});}_0x236c92=_[_0x2436('0x3d')]({},_0x236c92,_0x4717f4[_0x2436('0x40')]);var _0x150ad5={'where':_0x236c92[_0x2436('0x3c')]};return db[_0x2436('0x29')][_0x2436('0x21')](_0x150ad5)[_0x2436('0x25')](function(_0x9b412c){_0x59b89c['count']=_0x9b412c;if(_0x4717f4[_0x2436('0x31')]['includeAll']){_0x236c92['include']=[{'all':!![]}];}return db[_0x2436('0x29')]['findAll'](_0x236c92);})[_0x2436('0x25')](function(_0x4e13d2){_0x59b89c[_0x2436('0x41')]=_0x4e13d2;return _0x59b89c;})['then'](respondWithFilteredResult(_0x1a2962,_0x236c92))['catch'](handleError(_0x1a2962,null));};exports[_0x2436('0x42')]=function(_0x337fb3,_0x32e81b){var _0x57ee3a={'raw':!![],'where':{'id':_0x337fb3[_0x2436('0x43')]['id']}},_0x256a4e={};_0x256a4e[_0x2436('0x2e')]=_[_0x2436('0x30')](db['FaxApplication']['rawAttributes']);_0x256a4e['query']=_[_0x2436('0x30')](_0x337fb3['query']);_0x256a4e[_0x2436('0x32')]=_[_0x2436('0x33')](_0x256a4e[_0x2436('0x2e')],_0x256a4e[_0x2436('0x31')]);_0x57ee3a['attributes']=_[_0x2436('0x33')](_0x256a4e['model'],qs[_0x2436('0x34')](_0x337fb3[_0x2436('0x31')][_0x2436('0x34')]));_0x57ee3a['attributes']=_0x57ee3a[_0x2436('0x35')][_0x2436('0x36')]?_0x57ee3a[_0x2436('0x35')]:_0x256a4e[_0x2436('0x2e')];if(_0x337fb3[_0x2436('0x31')][_0x2436('0x44')]){_0x57ee3a['include']=[{'all':!![]}];}_0x57ee3a=_[_0x2436('0x3d')]({},_0x57ee3a,_0x337fb3[_0x2436('0x40')]);return db[_0x2436('0x29')][_0x2436('0x45')](_0x57ee3a)[_0x2436('0x25')](handleEntityNotFound(_0x32e81b,null))[_0x2436('0x25')](respondWithResult(_0x32e81b,null))[_0x2436('0x46')](handleError(_0x32e81b,null));};exports[_0x2436('0x47')]=function(_0x5b72ab,_0xcf13b9){return db['FaxApplication']['create'](_0x5b72ab[_0x2436('0x48')],{})[_0x2436('0x25')](respondWithResult(_0xcf13b9,0xc9))[_0x2436('0x46')](handleError(_0xcf13b9,null));};exports[_0x2436('0x24')]=function(_0x38309c,_0x12b5e0){if(_0x38309c[_0x2436('0x48')]['id']){delete _0x38309c[_0x2436('0x48')]['id'];}return db['FaxApplication'][_0x2436('0x45')]({'where':{'id':_0x38309c['params']['id']}})['then'](handleEntityNotFound(_0x12b5e0,null))[_0x2436('0x25')](saveUpdates(_0x38309c[_0x2436('0x48')],null))[_0x2436('0x25')](respondWithResult(_0x12b5e0,null))[_0x2436('0x46')](handleError(_0x12b5e0,null));};exports['destroy']=function(_0x30ef69,_0x204d89){return db[_0x2436('0x29')][_0x2436('0x45')]({'where':{'id':_0x30ef69['params']['id']}})[_0x2436('0x25')](handleEntityNotFound(_0x204d89,null))[_0x2436('0x25')](removeEntity(_0x204d89,null))['catch'](handleError(_0x204d89,null));}; \ No newline at end of file +var _0xe2ed=['Content-Range','apply','reject','save','update','then','destroy','name','send','map','FaxApplication','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','set'];(function(_0x21ec8c,_0x1e58c6){var _0x18f950=function(_0x4f08a3){while(--_0x4f08a3){_0x21ec8c['push'](_0x21ec8c['shift']());}};_0x18f950(++_0x1e58c6);}(_0xe2ed,0x14e));var _0xde2e=function(_0x43ee9d,_0x45bbf7){_0x43ee9d=_0x43ee9d-0x0;var _0x355ded=_0xe2ed[_0x43ee9d];return _0x355ded;};'use strict';var emlformat=require(_0xde2e('0x0'));var rimraf=require(_0xde2e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xde2e('0x2'));var rp=require(_0xde2e('0x3'));var moment=require(_0xde2e('0x4'));var BPromise=require(_0xde2e('0x5'));var Mustache=require(_0xde2e('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xde2e('0x7'));var fs=require('fs');var fs_extra=require(_0xde2e('0x8'));var _=require(_0xde2e('0x9'));var squel=require(_0xde2e('0xa'));var crypto=require(_0xde2e('0xb'));var jsforce=require(_0xde2e('0xc'));var deskjs=require(_0xde2e('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xde2e('0xe'));var Redis=require(_0xde2e('0xf'));var authService=require(_0xde2e('0x10'));var qs=require(_0xde2e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xde2e('0x12'));var logger=require('../../config/logger')(_0xde2e('0x13'));var utils=require(_0xde2e('0x14'));var config=require(_0xde2e('0x15'));var licenseUtil=require(_0xde2e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29a1de,_0x204bf5){_0x204bf5=_0x204bf5||0xcc;return function(_0x2648ac){if(_0x2648ac){return _0x29a1de['sendStatus'](_0x204bf5);}return _0x29a1de[_0xde2e('0x17')](_0x204bf5)[_0xde2e('0x18')]();};}function respondWithResult(_0x2137d7,_0x156de7){_0x156de7=_0x156de7||0xc8;return function(_0x3a590f){if(_0x3a590f){return _0x2137d7[_0xde2e('0x17')](_0x156de7)[_0xde2e('0x19')](_0x3a590f);}};}function respondWithFilteredResult(_0x11dd70,_0x11d0c6){return function(_0x1f76d9){if(_0x1f76d9){var _0x240ca1=typeof _0x11d0c6[_0xde2e('0x1a')]==='undefined'&&typeof _0x11d0c6[_0xde2e('0x1b')]===_0xde2e('0x1c');var _0x5dda20=_0x1f76d9[_0xde2e('0x1d')];var _0x4daf78=_0x240ca1?0x0:_0x11d0c6[_0xde2e('0x1a')];var _0xff7c11=_0x240ca1?_0x1f76d9[_0xde2e('0x1d')]:_0x11d0c6[_0xde2e('0x1a')]+_0x11d0c6[_0xde2e('0x1b')];var _0x38faf3;if(_0xff7c11>=_0x5dda20){_0xff7c11=_0x5dda20;_0x38faf3=0xc8;}else{_0x38faf3=0xce;}_0x11dd70[_0xde2e('0x17')](_0x38faf3);return _0x11dd70[_0xde2e('0x1e')](_0xde2e('0x1f'),_0x4daf78+'-'+_0xff7c11+'/'+_0x5dda20)['json'](_0x1f76d9);}return null;};}function patchUpdates(_0x36ffa0){return function(_0x4eacca){try{jsonpatch[_0xde2e('0x20')](_0x4eacca,_0x36ffa0,!![]);}catch(_0x25d66b){return BPromise[_0xde2e('0x21')](_0x25d66b);}return _0x4eacca[_0xde2e('0x22')]();};}function saveUpdates(_0x4400ef,_0x2b3f91){return function(_0x418136){if(_0x418136){return _0x418136[_0xde2e('0x23')](_0x4400ef)[_0xde2e('0x24')](function(_0x2e559c){return _0x2e559c;});}return null;};}function removeEntity(_0x44c065,_0x1dadc2){return function(_0x465028){if(_0x465028){return _0x465028[_0xde2e('0x25')]()[_0xde2e('0x24')](function(){_0x44c065['status'](0xcc)[_0xde2e('0x18')]();});}};}function handleEntityNotFound(_0x1c1b37,_0x5ee0e1){return function(_0x3403f6){if(!_0x3403f6){_0x1c1b37['sendStatus'](0x194);}return _0x3403f6;};}function handleError(_0x4991d1,_0x230525){_0x230525=_0x230525||0x1f4;return function(_0x3dfe25){logger['error'](_0x3dfe25['stack']);if(_0x3dfe25[_0xde2e('0x26')]){delete _0x3dfe25[_0xde2e('0x26')];}_0x4991d1[_0xde2e('0x17')](_0x230525)[_0xde2e('0x27')](_0x3dfe25);};}exports['index']=function(_0x5589af,_0x28762a){var _0x217cb4={},_0x4b6c6b={},_0x45b9be={'count':0x0,'rows':[]};var _0x5dbb18=_[_0xde2e('0x28')](db[_0xde2e('0x29')][_0xde2e('0x2a')],function(_0x18334a){return{'name':_0x18334a[_0xde2e('0x2b')],'type':_0x18334a[_0xde2e('0x2c')]['key']};});_0x4b6c6b[_0xde2e('0x2d')]=_['map'](_0x5dbb18,'name');_0x4b6c6b['query']=_[_0xde2e('0x2e')](_0x5589af[_0xde2e('0x2f')]);_0x4b6c6b[_0xde2e('0x30')]=_['intersection'](_0x4b6c6b[_0xde2e('0x2d')],_0x4b6c6b[_0xde2e('0x2f')]);_0x217cb4[_0xde2e('0x31')]=_[_0xde2e('0x32')](_0x4b6c6b[_0xde2e('0x2d')],qs[_0xde2e('0x33')](_0x5589af[_0xde2e('0x2f')]['fields']));_0x217cb4[_0xde2e('0x31')]=_0x217cb4[_0xde2e('0x31')]['length']?_0x217cb4[_0xde2e('0x31')]:_0x4b6c6b[_0xde2e('0x2d')];if(!_0x5589af[_0xde2e('0x2f')][_0xde2e('0x34')](_0xde2e('0x35'))){_0x217cb4['limit']=qs[_0xde2e('0x1b')](_0x5589af[_0xde2e('0x2f')][_0xde2e('0x1b')]);_0x217cb4[_0xde2e('0x1a')]=qs[_0xde2e('0x1a')](_0x5589af[_0xde2e('0x2f')][_0xde2e('0x1a')]);}_0x217cb4[_0xde2e('0x36')]=qs[_0xde2e('0x37')](_0x5589af[_0xde2e('0x2f')][_0xde2e('0x37')]);_0x217cb4[_0xde2e('0x38')]=qs[_0xde2e('0x30')](_[_0xde2e('0x39')](_0x5589af[_0xde2e('0x2f')],_0x4b6c6b[_0xde2e('0x30')]),_0x5dbb18);if(_0x5589af['query'][_0xde2e('0x3a')]){_0x217cb4[_0xde2e('0x38')]=_[_0xde2e('0x3b')](_0x217cb4[_0xde2e('0x38')],{'$or':_[_0xde2e('0x28')](_0x5dbb18,function(_0x3efc69){if(_0x3efc69['type']!==_0xde2e('0x3c')){var _0x286d47={};_0x286d47[_0x3efc69['name']]={'$like':'%'+_0x5589af[_0xde2e('0x2f')]['filter']+'%'};return _0x286d47;}})});}_0x217cb4=_[_0xde2e('0x3b')]({},_0x217cb4,_0x5589af['options']);var _0x41a6e9={'where':_0x217cb4[_0xde2e('0x38')]};return db['FaxApplication'][_0xde2e('0x1d')](_0x41a6e9)[_0xde2e('0x24')](function(_0x296e51){_0x45b9be[_0xde2e('0x1d')]=_0x296e51;if(_0x5589af[_0xde2e('0x2f')][_0xde2e('0x3d')]){_0x217cb4[_0xde2e('0x3e')]=[{'all':!![]}];}return db[_0xde2e('0x29')][_0xde2e('0x3f')](_0x217cb4);})['then'](function(_0x339547){_0x45b9be[_0xde2e('0x40')]=_0x339547;return _0x45b9be;})['then'](respondWithFilteredResult(_0x28762a,_0x217cb4))[_0xde2e('0x41')](handleError(_0x28762a,null));};exports[_0xde2e('0x42')]=function(_0x3d37b2,_0xa5d68a){var _0x3bbe18={'raw':!![],'where':{'id':_0x3d37b2[_0xde2e('0x43')]['id']}},_0x1562f1={};_0x1562f1[_0xde2e('0x2d')]=_[_0xde2e('0x2e')](db[_0xde2e('0x29')]['rawAttributes']);_0x1562f1['query']=_[_0xde2e('0x2e')](_0x3d37b2[_0xde2e('0x2f')]);_0x1562f1['filters']=_[_0xde2e('0x32')](_0x1562f1[_0xde2e('0x2d')],_0x1562f1[_0xde2e('0x2f')]);_0x3bbe18[_0xde2e('0x31')]=_['intersection'](_0x1562f1['model'],qs[_0xde2e('0x33')](_0x3d37b2[_0xde2e('0x2f')][_0xde2e('0x33')]));_0x3bbe18['attributes']=_0x3bbe18[_0xde2e('0x31')][_0xde2e('0x44')]?_0x3bbe18[_0xde2e('0x31')]:_0x1562f1['model'];if(_0x3d37b2['query'][_0xde2e('0x3d')]){_0x3bbe18[_0xde2e('0x3e')]=[{'all':!![]}];}_0x3bbe18=_['merge']({},_0x3bbe18,_0x3d37b2[_0xde2e('0x45')]);return db[_0xde2e('0x29')]['find'](_0x3bbe18)[_0xde2e('0x24')](handleEntityNotFound(_0xa5d68a,null))[_0xde2e('0x24')](respondWithResult(_0xa5d68a,null))[_0xde2e('0x41')](handleError(_0xa5d68a,null));};exports[_0xde2e('0x46')]=function(_0x3bcb2e,_0x239ac5){return db[_0xde2e('0x29')][_0xde2e('0x46')](_0x3bcb2e[_0xde2e('0x47')],{})[_0xde2e('0x24')](respondWithResult(_0x239ac5,0xc9))['catch'](handleError(_0x239ac5,null));};exports[_0xde2e('0x23')]=function(_0x31426a,_0x10b71e){if(_0x31426a[_0xde2e('0x47')]['id']){delete _0x31426a[_0xde2e('0x47')]['id'];}return db[_0xde2e('0x29')]['find']({'where':{'id':_0x31426a[_0xde2e('0x43')]['id']}})[_0xde2e('0x24')](handleEntityNotFound(_0x10b71e,null))['then'](saveUpdates(_0x31426a[_0xde2e('0x47')],null))[_0xde2e('0x24')](respondWithResult(_0x10b71e,null))['catch'](handleError(_0x10b71e,null));};exports[_0xde2e('0x25')]=function(_0x2a617e,_0xf838e3){return db[_0xde2e('0x29')][_0xde2e('0x48')]({'where':{'id':_0x2a617e[_0xde2e('0x43')]['id']}})['then'](handleEntityNotFound(_0xf838e3,null))[_0xde2e('0x24')](removeEntity(_0xf838e3,null))[_0xde2e('0x41')](handleError(_0xf838e3,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index f027768..351653f 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 _0x2148=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0xbe40ad,_0x44343c){var _0x50fac9=function(_0xdaed07){while(--_0xdaed07){_0xbe40ad['push'](_0xbe40ad['shift']());}};_0x50fac9(++_0x44343c);}(_0x2148,0x68));var _0x8214=function(_0x5517c0,_0x358609){_0x5517c0=_0x5517c0-0x0;var _0x33803b=_0x2148[_0x5517c0];return _0x33803b;};'use strict';var _=require(_0x8214('0x0'));var util=require(_0x8214('0x1'));var logger=require(_0x8214('0x2'))(_0x8214('0x3'));var moment=require(_0x8214('0x4'));var BPromise=require(_0x8214('0x5'));var rp=require(_0x8214('0x6'));var fs=require('fs');var path=require(_0x8214('0x7'));var rimraf=require('rimraf');var config=require(_0x8214('0x8'));var attributes=require('./faxApplication.attributes');module[_0x8214('0x9')]=function(_0x2d6dfa,_0x14463a){return _0x2d6dfa[_0x8214('0xa')](_0x8214('0xb'),attributes,{'tableName':_0x8214('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8214('0xd'),'collate':_0x8214('0xe')});}; \ No newline at end of file +var _0x1ee0=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x1ee0,0x1e8));var _0x01ee=function(_0x136f48,_0x14e54d){_0x136f48=_0x136f48-0x0;var _0x343726=_0x1ee0[_0x136f48];return _0x343726;};'use strict';var _=require(_0x01ee('0x0'));var util=require('util');var logger=require(_0x01ee('0x1'))('api');var moment=require(_0x01ee('0x2'));var BPromise=require(_0x01ee('0x3'));var rp=require(_0x01ee('0x4'));var fs=require('fs');var path=require(_0x01ee('0x5'));var rimraf=require(_0x01ee('0x6'));var config=require(_0x01ee('0x7'));var attributes=require(_0x01ee('0x8'));module[_0x01ee('0x9')]=function(_0x13a805,_0x1683f9){return _0x13a805[_0x01ee('0xa')]('FaxApplication',attributes,{'tableName':_0x01ee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x01ee('0xc'),'collate':_0x01ee('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 6908ac1..65f97e3 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 _0x41a1=['code','FaxApplication,\x20%s,\x20%s','message','request\x20sent','result','catch','UpdateFaxApplication','FaxApplication','body','options','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error'];(function(_0x438927,_0x18ec8b){var _0x41f65b=function(_0x2c779d){while(--_0x2c779d){_0x438927['push'](_0x438927['shift']());}};_0x41f65b(++_0x18ec8b);}(_0x41a1,0x107));var _0x141a=function(_0x45dc6b,_0x25321f){_0x45dc6b=_0x45dc6b-0x0;var _0x4535db=_0x41a1[_0x45dc6b];return _0x4535db;};'use strict';var _=require('lodash');var util=require(_0x141a('0x0'));var moment=require(_0x141a('0x1'));var BPromise=require(_0x141a('0x2'));var rs=require(_0x141a('0x3'));var fs=require('fs');var Redis=require(_0x141a('0x4'));var db=require(_0x141a('0x5'))['db'];var utils=require(_0x141a('0x6'));var logger=require(_0x141a('0x7'))(_0x141a('0x8'));var config=require(_0x141a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x141a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x277bbb,_0x23efad,_0x2f26d3){return new BPromise(function(_0x43e3e8,_0x277c4a){return client[_0x141a('0xb')](_0x277bbb,_0x2f26d3)[_0x141a('0xc')](function(_0x2a4bb7){logger[_0x141a('0xd')]('FaxApplication,\x20%s,\x20%s',_0x23efad,'request\x20sent');logger[_0x141a('0xe')](_0x141a('0xf'),_0x23efad,'request\x20sent',JSON['stringify'](_0x2a4bb7));if(_0x2a4bb7[_0x141a('0x10')]){if(_0x2a4bb7['error'][_0x141a('0x11')]===0x1f4){logger['error'](_0x141a('0x12'),_0x23efad,_0x2a4bb7['error'][_0x141a('0x13')]);return _0x277c4a(_0x2a4bb7[_0x141a('0x10')][_0x141a('0x13')]);}logger[_0x141a('0x10')](_0x141a('0x12'),_0x23efad,_0x2a4bb7['error'][_0x141a('0x13')]);return _0x43e3e8(_0x2a4bb7['error']['message']);}else{logger[_0x141a('0xd')](_0x141a('0x12'),_0x23efad,_0x141a('0x14'));_0x43e3e8(_0x2a4bb7[_0x141a('0x15')][_0x141a('0x13')]);}})[_0x141a('0x16')](function(_0x83f3bf){logger[_0x141a('0x10')](_0x141a('0x12'),_0x23efad,_0x83f3bf);_0x277c4a(_0x83f3bf);});});}exports[_0x141a('0x17')]=function(_0x128434){var _0x36591d=this;return new Promise(function(_0x3e76e0,_0x9d2d8a){return db[_0x141a('0x18')]['update'](_0x128434[_0x141a('0x19')],{'raw':_0x128434[_0x141a('0x1a')]?_0x128434[_0x141a('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x128434[_0x141a('0x1a')]?_0x128434['options']['where']||null:null,'attributes':_0x128434[_0x141a('0x1a')]?_0x128434[_0x141a('0x1a')]['attributes']||null:null,'limit':_0x128434[_0x141a('0x1a')]?_0x128434['options']['limit']||null:null})['then'](function(_0x3dc042){logger[_0x141a('0xd')](_0x141a('0x17'),_0x128434);logger[_0x141a('0xe')]('UpdateFaxApplication',_0x128434,JSON[_0x141a('0x1b')](_0x3dc042));_0x3e76e0(_0x3dc042);})[_0x141a('0x16')](function(_0x11225d){logger[_0x141a('0x10')](_0x141a('0x17'),_0x11225d['message'],_0x128434);_0x9d2d8a(_0x36591d[_0x141a('0x10')](0x1f4,_0x11225d[_0x141a('0x13')]));});});}; \ No newline at end of file +var _0xc791=['info','FaxApplication,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','FaxApplication','update','body','options','raw','where','attributes','limit','UpdateFaxApplication','stringify','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc791,0xa9));var _0x1c79=function(_0x41e393,_0x35417e){_0x41e393=_0x41e393-0x0;var _0x27db09=_0xc791[_0x41e393];return _0x27db09;};'use strict';var _=require(_0x1c79('0x0'));var util=require(_0x1c79('0x1'));var moment=require('moment');var BPromise=require(_0x1c79('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1c79('0x3'))['db'];var utils=require(_0x1c79('0x4'));var logger=require(_0x1c79('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1c79('0x6'));var client=jayson[_0x1c79('0x7')][_0x1c79('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x504bd2,_0x2f9d08,_0x3c3f15){return new BPromise(function(_0x3ccb6c,_0xd0f367){return client[_0x1c79('0x9')](_0x504bd2,_0x3c3f15)[_0x1c79('0xa')](function(_0x2c2b53){logger[_0x1c79('0xb')](_0x1c79('0xc'),_0x2f9d08,'request\x20sent');logger[_0x1c79('0xd')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x2f9d08,_0x1c79('0xe'),JSON['stringify'](_0x2c2b53));if(_0x2c2b53[_0x1c79('0xf')]){if(_0x2c2b53[_0x1c79('0xf')][_0x1c79('0x10')]===0x1f4){logger[_0x1c79('0xf')](_0x1c79('0xc'),_0x2f9d08,_0x2c2b53[_0x1c79('0xf')][_0x1c79('0x11')]);return _0xd0f367(_0x2c2b53[_0x1c79('0xf')][_0x1c79('0x11')]);}logger[_0x1c79('0xf')](_0x1c79('0xc'),_0x2f9d08,_0x2c2b53['error'][_0x1c79('0x11')]);return _0x3ccb6c(_0x2c2b53['error'][_0x1c79('0x11')]);}else{logger[_0x1c79('0xb')](_0x1c79('0xc'),_0x2f9d08,_0x1c79('0xe'));_0x3ccb6c(_0x2c2b53[_0x1c79('0x12')][_0x1c79('0x11')]);}})[_0x1c79('0x13')](function(_0x2aa740){logger[_0x1c79('0xf')](_0x1c79('0xc'),_0x2f9d08,_0x2aa740);_0xd0f367(_0x2aa740);});});}exports['UpdateFaxApplication']=function(_0x456b59){var _0x5893d6=this;return new Promise(function(_0x3a8544,_0x3a325e){return db[_0x1c79('0x14')][_0x1c79('0x15')](_0x456b59[_0x1c79('0x16')],{'raw':_0x456b59[_0x1c79('0x17')]?_0x456b59[_0x1c79('0x17')][_0x1c79('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x456b59[_0x1c79('0x17')]?_0x456b59[_0x1c79('0x17')][_0x1c79('0x19')]||null:null,'attributes':_0x456b59[_0x1c79('0x17')]?_0x456b59['options'][_0x1c79('0x1a')]||null:null,'limit':_0x456b59[_0x1c79('0x17')]?_0x456b59['options'][_0x1c79('0x1b')]||null:null})[_0x1c79('0xa')](function(_0x4ed65c){logger['info'](_0x1c79('0x1c'),_0x456b59);logger[_0x1c79('0xd')](_0x1c79('0x1c'),_0x456b59,JSON[_0x1c79('0x1d')](_0x4ed65c));_0x3a8544(_0x4ed65c);})[_0x1c79('0x13')](function(_0x3a6fe9){logger['error'](_0x1c79('0x1c'),_0x3a6fe9[_0x1c79('0x11')],_0x456b59);_0x3a325e(_0x5893d6[_0x1c79('0xf')](0x1f4,_0x3a6fe9['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 1ff32ca..94df6df 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 _0xf4f4=['../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x289e64,_0x5adb3c){var _0x30246c=function(_0x1bf7f6){while(--_0x1bf7f6){_0x289e64['push'](_0x289e64['shift']());}};_0x30246c(++_0x5adb3c);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x1867e3,_0x589b2d){_0x1867e3=_0x1867e3-0x0;var _0x4b22aa=_0xf4f4[_0x1867e3];return _0x4b22aa;};'use strict';var multer=require(_0x4f4f('0x0'));var util=require(_0x4f4f('0x1'));var path=require('path');var timeout=require(_0x4f4f('0x2'));var express=require(_0x4f4f('0x3'));var router=express[_0x4f4f('0x4')]();var fs_extra=require(_0x4f4f('0x5'));var auth=require(_0x4f4f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f4f('0x7'));var controller=require('./faxApplication.controller');router[_0x4f4f('0x8')]('/',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xa')]);router[_0x4f4f('0x8')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xc')]);router[_0x4f4f('0xd')]('/',auth['isAuthenticated'](),controller[_0x4f4f('0xe')]);router[_0x4f4f('0xf')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x10')]);router[_0x4f4f('0x11')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb688=['show','post','create','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xb688,0xcf));var _0x8b68=function(_0x4c4fb8,_0x1feb04){_0x4c4fb8=_0x4c4fb8-0x0;var _0x45e53c=_0xb688[_0x4c4fb8];return _0x45e53c;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0xe')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x10')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x12')](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller['destroy']);module[_0x8b68('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 390a6a5..f0dea30 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 _0x4bd3=['sequelize','BOOLEAN','DATE','STRING','out','INTEGER'];(function(_0x3ee251,_0xa53a01){var _0x5bb8f3=function(_0xd54c2d){while(--_0xd54c2d){_0x3ee251['push'](_0x3ee251['shift']());}};_0x5bb8f3(++_0xa53a01);}(_0x4bd3,0x174));var _0x34bd=function(_0x1ee2f7,_0x5012f7){_0x1ee2f7=_0x1ee2f7-0x0;var _0x1360f0=_0x4bd3[_0x1ee2f7];return _0x1360f0;};'use strict';var Sequelize=require(_0x34bd('0x0'));module['exports']={'closed':{'type':Sequelize[_0x34bd('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x34bd('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x34bd('0x3')]},'read1stAt':{'type':Sequelize[_0x34bd('0x2')]},'fax':{'type':Sequelize[_0x34bd('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x34bd('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x34bd('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x34bd('0x4')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0x34bd('0x5')]}}; \ No newline at end of file +var _0xa30a=['exports','BOOLEAN','STRING','DATE','ENUM','out','INTEGER','sequelize'];(function(_0x35d245,_0x5da6c1){var _0x490264=function(_0x577107){while(--_0x577107){_0x35d245['push'](_0x35d245['shift']());}};_0x490264(++_0x5da6c1);}(_0xa30a,0xd7));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xaa30('0x0'));module[_0xaa30('0x1')]={'closed':{'type':Sequelize[_0xaa30('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xaa30('0x3')]},'secondDisposition':{'type':Sequelize[_0xaa30('0x3')]},'thirdDisposition':{'type':Sequelize[_0xaa30('0x3')]},'note':{'type':Sequelize[_0xaa30('0x3')]},'read1stAt':{'type':Sequelize[_0xaa30('0x4')]},'fax':{'type':Sequelize[_0xaa30('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xaa30('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xaa30('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xaa30('0x6')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0xaa30('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index bc05375..b2dedc7 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 _0x350b=['addTags','setTags','spread','Tag','color','emit','removeTags','download','unix','join','root','server','tmp','files','attachments','push','Attachment','Messages','createdAt','mkdirSync','basename','existsSync','createReadStream','pipe','resolve','log','err','unlinkSync','zip-dir','moment','bluebird','path','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','findAll','fax','query','user','show','params','model','keys','FaxInteraction','filters','intersection','attributes','fields','length','includeAll','merge','options','find','catch','create','body','describe','addMessage','ids','omit','findOne','FaxMessage','hasOwnProperty','nolimit','order','sort','where','FaxInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','count','include'];(function(_0xf11327,_0x692278){var _0x331cf4=function(_0x336a4e){while(--_0x336a4e){_0xf11327['push'](_0xf11327['shift']());}};_0x331cf4(++_0x692278);}(_0x350b,0x15a));var _0xb350=function(_0x24dded,_0x519e23){_0x24dded=_0x24dded-0x0;var _0x5ea47a=_0x350b[_0x24dded];return _0x5ea47a;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xb350('0x0'));var moment=require(_0xb350('0x1'));var BPromise=require(_0xb350('0x2'));var util=require('util');var path=require(_0xb350('0x3'));var fs=require('fs');var _=require(_0xb350('0x4'));var Redis=require(_0xb350('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0xb350('0x6'));var logger=require('../../config/logger')(_0xb350('0x7'));var config=require(_0xb350('0x8'));var db=require(_0xb350('0x9'))['db'];config[_0xb350('0xa')]=_[_0xb350('0xb')](config[_0xb350('0xa')],{'host':_0xb350('0xc'),'port':0x18eb});var socket=require(_0xb350('0xd'))(new Redis(config[_0xb350('0xa')]));require(_0xb350('0xe'))[_0xb350('0xf')](socket);function respondWithStatusCode(_0x3e900c,_0x53e7ad){_0x53e7ad=_0x53e7ad||0xcc;return function(_0x92110){if(_0x92110){return _0x3e900c[_0xb350('0x10')](_0x53e7ad);}return _0x3e900c[_0xb350('0x11')](_0x53e7ad)[_0xb350('0x12')]();};}function respondWithResult(_0x256ceb,_0xc6552){_0xc6552=_0xc6552||0xc8;return function(_0x24522a){if(_0x24522a){return _0x256ceb[_0xb350('0x11')](_0xc6552)[_0xb350('0x13')](_0x24522a);}};}function respondWithFilteredResult(_0x466248,_0x49bc58){return function(_0xa49dcb){if(_0xa49dcb){var _0x3006d5=typeof _0x49bc58[_0xb350('0x14')]===_0xb350('0x15')&&typeof _0x49bc58[_0xb350('0x16')]===_0xb350('0x15');var _0x1b3825=_0xa49dcb['count'];var _0x2506ed=_0x3006d5?0x0:_0x49bc58[_0xb350('0x14')];var _0x4d50f7=_0x3006d5?_0xa49dcb['count']:_0x49bc58[_0xb350('0x14')]+_0x49bc58['limit'];var _0x5aba86;if(_0x4d50f7>=_0x1b3825){_0x4d50f7=_0x1b3825;_0x5aba86=0xc8;}else{_0x5aba86=0xce;}_0x466248[_0xb350('0x11')](_0x5aba86);return _0x466248[_0xb350('0x17')](_0xb350('0x18'),_0x2506ed+'-'+_0x4d50f7+'/'+_0x1b3825)[_0xb350('0x13')](_0xa49dcb);}return null;};}function saveUpdates(_0x50fd6d){return function(_0x54df0f){if(_0x54df0f){return _0x54df0f[_0xb350('0x19')](_0x50fd6d)[_0xb350('0x1a')](function(_0x3d64f3){return _0x3d64f3;});}return null;};}function removeEntity(_0x366d5a){return function(_0x438a23){if(_0x438a23){return _0x438a23[_0xb350('0x1b')]()[_0xb350('0x1a')](function(){_0x366d5a[_0xb350('0x11')](0xcc)[_0xb350('0x12')]();});}};}function handleEntityNotFound(_0x2da2cb){return function(_0x4d4039){if(!_0x4d4039){_0x2da2cb[_0xb350('0x10')](0x194);}return _0x4d4039;};}function handleError(_0x5954e5,_0x513f59){_0x513f59=_0x513f59||0x1f4;return function(_0x5b8aef){logger[_0xb350('0x1c')](_0x5b8aef[_0xb350('0x1d')]);if(_0x5b8aef['name']){delete _0x5b8aef[_0xb350('0x1e')];}_0x5954e5[_0xb350('0x11')](_0x513f59)[_0xb350('0x1f')](_0x5b8aef);};}exports[_0xb350('0x20')]=function(_0x18bc26,_0x3f9e4a){var _0x1a4873={};var _0x4302b9=_[_0xb350('0x21')](db['FaxInteraction'][_0xb350('0x22')],function(_0x4b60fb){return{'name':_0x4b60fb[_0xb350('0x23')],'type':_0x4b60fb[_0xb350('0x24')][_0xb350('0x25')]};});_0x1a4873=qs[_0xb350('0x26')](_0x4302b9,_0x18bc26);return interaction[_0xb350('0x27')](_0xb350('0x28'),_0x18bc26[_0xb350('0x29')],_0x18bc26[_0xb350('0x2a')],_0x1a4873,_0x4302b9)['then'](respondWithFilteredResult(_0x3f9e4a,_0x1a4873))['catch'](handleError(_0x3f9e4a,null));};exports[_0xb350('0x2b')]=function(_0xe21aaf,_0x1cd876){var _0x5ebecd={'raw':![],'where':{'id':_0xe21aaf[_0xb350('0x2c')]['id']}},_0x286cbe={};_0x286cbe[_0xb350('0x2d')]=_[_0xb350('0x2e')](db[_0xb350('0x2f')][_0xb350('0x22')]);_0x286cbe[_0xb350('0x29')]=_[_0xb350('0x2e')](_0xe21aaf[_0xb350('0x29')]);_0x286cbe[_0xb350('0x30')]=_[_0xb350('0x31')](_0x286cbe[_0xb350('0x2d')],_0x286cbe[_0xb350('0x29')]);_0x5ebecd[_0xb350('0x32')]=_[_0xb350('0x31')](_0x286cbe[_0xb350('0x2d')],qs[_0xb350('0x33')](_0xe21aaf[_0xb350('0x29')][_0xb350('0x33')]));_0x5ebecd[_0xb350('0x32')]=_0x5ebecd[_0xb350('0x32')][_0xb350('0x34')]?_0x5ebecd[_0xb350('0x32')]:_0x286cbe[_0xb350('0x2d')];if(_0xe21aaf[_0xb350('0x29')][_0xb350('0x35')]){_0x5ebecd['include']=[{'all':!![]}];}_0x5ebecd=_[_0xb350('0x36')]({},_0x5ebecd,_0xe21aaf[_0xb350('0x37')]);return db[_0xb350('0x2f')][_0xb350('0x38')](_0x5ebecd)[_0xb350('0x1a')](handleEntityNotFound(_0x1cd876,null))[_0xb350('0x1a')](respondWithResult(_0x1cd876,null))[_0xb350('0x39')](handleError(_0x1cd876,null));};exports[_0xb350('0x3a')]=function(_0x2a24ec,_0x58bacc){return db[_0xb350('0x2f')][_0xb350('0x3a')](_0x2a24ec['body'],{})[_0xb350('0x1a')](respondWithResult(_0x58bacc,0xc9))[_0xb350('0x39')](handleError(_0x58bacc,null));};exports[_0xb350('0x19')]=function(_0x4a9c87,_0x225860){if(_0x4a9c87[_0xb350('0x3b')]['id']){delete _0x4a9c87['body']['id'];}return db['FaxInteraction'][_0xb350('0x38')]({'where':{'id':_0x4a9c87['params']['id']}})[_0xb350('0x1a')](handleEntityNotFound(_0x225860,null))[_0xb350('0x1a')](saveUpdates(_0x4a9c87[_0xb350('0x3b')],null))[_0xb350('0x1a')](respondWithResult(_0x225860,null))['catch'](handleError(_0x225860,null));};exports[_0xb350('0x1b')]=function(_0x4291ca,_0x4e2a5a){return db[_0xb350('0x2f')][_0xb350('0x38')]({'where':{'id':_0x4291ca[_0xb350('0x2c')]['id']}})[_0xb350('0x1a')](handleEntityNotFound(_0x4e2a5a,null))['then'](removeEntity(_0x4e2a5a,null))['catch'](handleError(_0x4e2a5a,null));};exports[_0xb350('0x3c')]=function(_0x3499de,_0x423b0f){return db[_0xb350('0x2f')][_0xb350('0x3c')]()[_0xb350('0x1a')](respondWithResult(_0x423b0f,null))[_0xb350('0x39')](handleError(_0x423b0f,null));};exports[_0xb350('0x3d')]=function(_0x11f3ab,_0x32fe54){return db['FaxMessage']['find']({'where':{'id':_0x11f3ab[_0xb350('0x2c')]['id']}})[_0xb350('0x1a')](handleEntityNotFound(_0x32fe54,null))[_0xb350('0x1a')](function(_0x233778){if(_0x233778){return _0x233778[_0xb350('0x3d')](_0x11f3ab['body'][_0xb350('0x3e')],_[_0xb350('0x3f')](_0x11f3ab[_0xb350('0x3b')],[_0xb350('0x3e'),'id'])||{});}})[_0xb350('0x1a')](respondWithResult(_0x32fe54,null))[_0xb350('0x39')](handleError(_0x32fe54,null));};exports['getMessages']=function(_0x32473c,_0x385739){var _0x28b38d={'raw':![],'where':{}};var _0xfbcb57={};var _0xf148c5={'count':0x0,'rows':[]};return db[_0xb350('0x2f')][_0xb350('0x40')]({'where':{'id':_0x32473c[_0xb350('0x2c')]['id']}})[_0xb350('0x1a')](handleEntityNotFound(_0x385739,null))[_0xb350('0x1a')](function(_0xf5f654){if(_0xf5f654){_0xfbcb57[_0xb350('0x2d')]=_[_0xb350('0x2e')](db[_0xb350('0x41')][_0xb350('0x22')]);_0xfbcb57[_0xb350('0x29')]=_[_0xb350('0x2e')](_0x32473c['query']);_0xfbcb57[_0xb350('0x30')]=_[_0xb350('0x31')](_0xfbcb57['model'],_0xfbcb57['query']);_0x28b38d[_0xb350('0x32')]=_[_0xb350('0x31')](_0xfbcb57[_0xb350('0x2d')],qs[_0xb350('0x33')](_0x32473c[_0xb350('0x29')]['fields']));_0x28b38d[_0xb350('0x32')]=_0x28b38d['attributes'][_0xb350('0x34')]?_0x28b38d[_0xb350('0x32')]:_0xfbcb57[_0xb350('0x2d')];if(!_0x32473c[_0xb350('0x29')][_0xb350('0x42')](_0xb350('0x43'))){_0x28b38d['limit']=qs[_0xb350('0x16')](_0x32473c[_0xb350('0x29')][_0xb350('0x16')]);_0x28b38d['offset']=qs[_0xb350('0x14')](_0x32473c[_0xb350('0x29')][_0xb350('0x14')]);}_0x28b38d[_0xb350('0x44')]=qs[_0xb350('0x45')](_0x32473c[_0xb350('0x29')]['sort']);_0x28b38d[_0xb350('0x46')]=qs['filters'](_['pick'](_0x32473c['query'],_0xfbcb57['filters']));_0x28b38d[_0xb350('0x46')][_0xb350('0x47')]=_0xf5f654['id'];if(_0x32473c[_0xb350('0x29')][_0xb350('0x48')]){_0x28b38d[_0xb350('0x46')]=_[_0xb350('0x36')](_0x28b38d['where'],{'$or':_[_0xb350('0x21')](_0x28b38d[_0xb350('0x32')],function(_0x4487d6){var _0x139957={};_0x139957[_0x4487d6]={'$like':'%'+_0x32473c['query'][_0xb350('0x48')]+'%'};return _0x139957;})});}if(_0x32473c[_0xb350('0x29')][_0xb350('0x49')]){var _0x12f37e=_0x32473c[_0xb350('0x29')][_0xb350('0x49')]['split'](',');var _0x2632cd={};_0x2632cd[_0x12f37e[0x0]]={'$gte':moment(_0x12f37e[0x1])[_0xb350('0x4a')](_0xb350('0x4b'))};_0x28b38d[_0xb350('0x46')]=_[_0xb350('0x36')](_0x28b38d[_0xb350('0x46')],_0x2632cd);}_0x28b38d=_[_0xb350('0x36')]({},_0x28b38d,_0x32473c['options']);return db['FaxMessage'][_0xb350('0x4c')]({'where':_0x28b38d[_0xb350('0x46')]})[_0xb350('0x1a')](function(_0x223dce){_0xf148c5[_0xb350('0x4c')]=_0x223dce;if(_0x32473c[_0xb350('0x29')][_0xb350('0x35')]){_0x28b38d[_0xb350('0x4d')]=[{'all':!![]}];}return db[_0xb350('0x41')]['findAll'](_0x28b38d);})[_0xb350('0x1a')](function(_0x4cce11){_0xf148c5['rows']=_0x4cce11;return _0xf148c5;});}})[_0xb350('0x1a')](respondWithFilteredResult(_0x385739,_0x28b38d))[_0xb350('0x39')](handleError(_0x385739,null));};exports[_0xb350('0x4e')]=function(_0x1f189c,_0x5c4e65){return db[_0xb350('0x2f')]['find']({'where':{'id':_0x1f189c[_0xb350('0x2c')]['id']}})[_0xb350('0x1a')](handleEntityNotFound(_0x5c4e65,null))['then'](function(_0x4ea213){if(_0x4ea213){return _0x4ea213[_0xb350('0x4f')](_0x1f189c[_0xb350('0x3b')][_0xb350('0x3e')],_[_0xb350('0x3f')](_0x1f189c[_0xb350('0x3b')],[_0xb350('0x3e'),'id'])||{})[_0xb350('0x50')](function(){return db[_0xb350('0x51')][_0xb350('0x27')]({'attributes':['id','name',_0xb350('0x52')],'where':{'id':_0x1f189c['body'][_0xb350('0x3e')]}});})[_0xb350('0x1a')](function(_0x502d4e){socket[_0xb350('0x53')]('faxInteractionTags:save',{'id':Number(_0x1f189c[_0xb350('0x2c')]['id']),'tags':_0x502d4e||[]});return{'id':Number(_0x1f189c[_0xb350('0x2c')]['id']),'tags':_0x502d4e||[]};});}})['then'](respondWithResult(_0x5c4e65,null))['catch'](handleError(_0x5c4e65,null));};exports[_0xb350('0x54')]=function(_0x3620bd,_0x159f15){return db[_0xb350('0x2f')][_0xb350('0x38')]({'where':{'id':_0x3620bd[_0xb350('0x2c')]['id']}})[_0xb350('0x1a')](handleEntityNotFound(_0x159f15,null))[_0xb350('0x1a')](function(_0x5e7c36){if(_0x5e7c36){return _0x5e7c36[_0xb350('0x54')](_0x3620bd[_0xb350('0x29')][_0xb350('0x3e')]);}})['then'](respondWithStatusCode(_0x159f15,null))['catch'](handleError(_0x159f15,null));};exports[_0xb350('0x55')]=function(_0x2b7064,_0x430dd5){var _0x214902=moment()[_0xb350('0x56')]()['toString']();var _0x4f790b=path[_0xb350('0x57')](config[_0xb350('0x58')],_0xb350('0x59'),'files',_0xb350('0x5a'));var _0x2a67cd=path[_0xb350('0x57')](config[_0xb350('0x58')],_0xb350('0x59'),_0xb350('0x5b'),_0xb350('0x5c'));var _0xc8b774=path['join'](_0x4f790b,_0x214902);var _0x479b82=util[_0xb350('0x4a')]('transcript-%d-%s.zip',_0x2b7064[_0xb350('0x2c')]['id'],_0x214902);var _0x5b2a8d=path[_0xb350('0x57')](_0x4f790b,_0x479b82);var _0x23bf1d=[];_0x23bf1d[_0xb350('0x5d')]({'model':db[_0xb350('0x5e')],'as':_0xb350('0x5e'),'raw':!![]});var _0x5e1d6b=[{'model':db[_0xb350('0x41')],'as':_0xb350('0x5f'),'attributes':['id','body',_0xb350('0x60')],'include':_0x23bf1d}];return db[_0xb350('0x2f')]['find']({'where':{'id':_0x2b7064[_0xb350('0x2c')]['id']},'include':_0x5e1d6b})[_0xb350('0x1a')](handleEntityNotFound(_0x430dd5,null))['then'](function(_0x1e4c41){if(_0x1e4c41&&_0x1e4c41[_0xb350('0x5f')]){var _0x49f2b1=_0x1e4c41['get']({'plain':!![]});fs[_0xb350('0x61')](_0xc8b774);for(var _0x58c22f=0x0;_0x58c22f<_0x49f2b1['Messages'][_0xb350('0x34')];_0x58c22f++){var _0x265062=_0x49f2b1[_0xb350('0x5f')][_0x58c22f][_0xb350('0x5e')];if(_0x265062){var _0x51fa97=path['join'](_0x2a67cd,_0x265062[_0xb350('0x62')]);if(fs[_0xb350('0x63')](_0x51fa97)){fs[_0xb350('0x64')](_0x51fa97)[_0xb350('0x65')](fs['createWriteStream'](path[_0xb350('0x57')](_0xc8b774,_0x265062[_0xb350('0x62')])));}}}return BPromise[_0xb350('0x66')]()[_0xb350('0x1a')](function(){return new BPromise(function(_0x341bbf,_0x5d385c){zipdir(_0xc8b774,{'saveTo':_0x5b2a8d},function(_0x107758,_0x38e4e0){if(_0x107758)return _0x5d385c(_0x107758);return _0x341bbf(_0x38e4e0);});})[_0xb350('0x1a')](function(){return new BPromise(function(_0x5676fe,_0x25a6d5){rimraf(_0xc8b774,function(_0x276e10){if(_0x276e10)_0x25a6d5(_0x276e10);return _0x5676fe();});});})[_0xb350('0x1a')](function(){return _0x430dd5[_0xb350('0x55')](_0x5b2a8d,_0x479b82,function(_0x485410){if(_0x485410){console[_0xb350('0x67')](_0xb350('0x68'),_0x485410);}else{fs[_0xb350('0x69')](_0x5b2a8d);}});});});}else{return _0x430dd5['sendStatus'](0xc8);}})[_0xb350('0x39')](handleError(_0x430dd5,null));}; \ No newline at end of file +var _0x74fb=['intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','order','sort','where','FaxInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','spread','Tag','color','emit','faxInteractionTags:save','removeTags','download','toString','join','root','files','attachments','transcript-%d-%s.zip','Attachment','createdAt','Messages','mkdirSync','existsSync','createReadStream','pipe','createWriteStream','basename','resolve','log','err','zip-dir','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','./faxInteraction.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','error','stack','name','send','index','map','FaxInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','fax','user','catch','show','params','model','query','keys','filters'];(function(_0x6e1239,_0x3562ac){var _0x418150=function(_0x279f06){while(--_0x279f06){_0x6e1239['push'](_0x6e1239['shift']());}};_0x418150(++_0x3562ac);}(_0x74fb,0x9b));var _0xb74f=function(_0x31da2c,_0x276d4d){_0x31da2c=_0x31da2c-0x0;var _0x191df1=_0x74fb[_0x31da2c];return _0x191df1;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xb74f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require('util');var path=require(_0xb74f('0x1'));var fs=require('fs');var _=require(_0xb74f('0x2'));var Redis=require(_0xb74f('0x3'));var interaction=require('../../components/interaction/service');var qs=require(_0xb74f('0x4'));var logger=require(_0xb74f('0x5'))(_0xb74f('0x6'));var config=require('../../config/environment');var db=require(_0xb74f('0x7'))['db'];config[_0xb74f('0x8')]=_[_0xb74f('0x9')](config[_0xb74f('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xb74f('0xa'))(new Redis(config[_0xb74f('0x8')]));require(_0xb74f('0xb'))['register'](socket);function respondWithStatusCode(_0x2e14d2,_0x3273c9){_0x3273c9=_0x3273c9||0xcc;return function(_0x22543c){if(_0x22543c){return _0x2e14d2[_0xb74f('0xc')](_0x3273c9);}return _0x2e14d2[_0xb74f('0xd')](_0x3273c9)['end']();};}function respondWithResult(_0x25b25b,_0x3a055f){_0x3a055f=_0x3a055f||0xc8;return function(_0x5f566f){if(_0x5f566f){return _0x25b25b[_0xb74f('0xd')](_0x3a055f)[_0xb74f('0xe')](_0x5f566f);}};}function respondWithFilteredResult(_0x1fecb5,_0x52a53e){return function(_0x25e5a4){if(_0x25e5a4){var _0x479f60=typeof _0x52a53e[_0xb74f('0xf')]===_0xb74f('0x10')&&typeof _0x52a53e[_0xb74f('0x11')]===_0xb74f('0x10');var _0xa4af12=_0x25e5a4[_0xb74f('0x12')];var _0xd626bd=_0x479f60?0x0:_0x52a53e['offset'];var _0x405442=_0x479f60?_0x25e5a4[_0xb74f('0x12')]:_0x52a53e[_0xb74f('0xf')]+_0x52a53e[_0xb74f('0x11')];var _0x33b6b4;if(_0x405442>=_0xa4af12){_0x405442=_0xa4af12;_0x33b6b4=0xc8;}else{_0x33b6b4=0xce;}_0x1fecb5['status'](_0x33b6b4);return _0x1fecb5[_0xb74f('0x13')](_0xb74f('0x14'),_0xd626bd+'-'+_0x405442+'/'+_0xa4af12)['json'](_0x25e5a4);}return null;};}function saveUpdates(_0x4a0a22){return function(_0x3b1e09){if(_0x3b1e09){return _0x3b1e09[_0xb74f('0x15')](_0x4a0a22)[_0xb74f('0x16')](function(_0x254661){return _0x254661;});}return null;};}function removeEntity(_0x133772){return function(_0x451317){if(_0x451317){return _0x451317['destroy']()[_0xb74f('0x16')](function(){_0x133772[_0xb74f('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2c21b){return function(_0x2d9c39){if(!_0x2d9c39){_0xe2c21b['sendStatus'](0x194);}return _0x2d9c39;};}function handleError(_0x34dac0,_0xf49cb4){_0xf49cb4=_0xf49cb4||0x1f4;return function(_0xd30e75){logger[_0xb74f('0x17')](_0xd30e75[_0xb74f('0x18')]);if(_0xd30e75[_0xb74f('0x19')]){delete _0xd30e75[_0xb74f('0x19')];}_0x34dac0[_0xb74f('0xd')](_0xf49cb4)[_0xb74f('0x1a')](_0xd30e75);};}exports[_0xb74f('0x1b')]=function(_0x5d93c1,_0x24c5bc){var _0x51daa2={};var _0xfd7502=_[_0xb74f('0x1c')](db[_0xb74f('0x1d')][_0xb74f('0x1e')],function(_0x3d1500){return{'name':_0x3d1500[_0xb74f('0x1f')],'type':_0x3d1500[_0xb74f('0x20')][_0xb74f('0x21')]};});_0x51daa2=qs[_0xb74f('0x22')](_0xfd7502,_0x5d93c1);return interaction[_0xb74f('0x23')](_0xb74f('0x24'),_0x5d93c1['query'],_0x5d93c1[_0xb74f('0x25')],_0x51daa2,_0xfd7502)[_0xb74f('0x16')](respondWithFilteredResult(_0x24c5bc,_0x51daa2))[_0xb74f('0x26')](handleError(_0x24c5bc,null));};exports[_0xb74f('0x27')]=function(_0x36874c,_0x3edd9e){var _0x39e475={'raw':![],'where':{'id':_0x36874c[_0xb74f('0x28')]['id']}},_0x25b6c1={};_0x25b6c1[_0xb74f('0x29')]=_['keys'](db[_0xb74f('0x1d')][_0xb74f('0x1e')]);_0x25b6c1[_0xb74f('0x2a')]=_[_0xb74f('0x2b')](_0x36874c[_0xb74f('0x2a')]);_0x25b6c1[_0xb74f('0x2c')]=_[_0xb74f('0x2d')](_0x25b6c1['model'],_0x25b6c1['query']);_0x39e475[_0xb74f('0x2e')]=_['intersection'](_0x25b6c1[_0xb74f('0x29')],qs[_0xb74f('0x2f')](_0x36874c[_0xb74f('0x2a')][_0xb74f('0x2f')]));_0x39e475[_0xb74f('0x2e')]=_0x39e475['attributes'][_0xb74f('0x30')]?_0x39e475[_0xb74f('0x2e')]:_0x25b6c1[_0xb74f('0x29')];if(_0x36874c[_0xb74f('0x2a')][_0xb74f('0x31')]){_0x39e475[_0xb74f('0x32')]=[{'all':!![]}];}_0x39e475=_[_0xb74f('0x33')]({},_0x39e475,_0x36874c[_0xb74f('0x34')]);return db[_0xb74f('0x1d')][_0xb74f('0x35')](_0x39e475)['then'](handleEntityNotFound(_0x3edd9e,null))[_0xb74f('0x16')](respondWithResult(_0x3edd9e,null))[_0xb74f('0x26')](handleError(_0x3edd9e,null));};exports[_0xb74f('0x36')]=function(_0x1810fb,_0x3e8173){return db[_0xb74f('0x1d')][_0xb74f('0x36')](_0x1810fb[_0xb74f('0x37')],{})['then'](respondWithResult(_0x3e8173,0xc9))[_0xb74f('0x26')](handleError(_0x3e8173,null));};exports[_0xb74f('0x15')]=function(_0x2c7751,_0x2391ad){if(_0x2c7751['body']['id']){delete _0x2c7751[_0xb74f('0x37')]['id'];}return db[_0xb74f('0x1d')][_0xb74f('0x35')]({'where':{'id':_0x2c7751[_0xb74f('0x28')]['id']}})[_0xb74f('0x16')](handleEntityNotFound(_0x2391ad,null))[_0xb74f('0x16')](saveUpdates(_0x2c7751[_0xb74f('0x37')],null))[_0xb74f('0x16')](respondWithResult(_0x2391ad,null))[_0xb74f('0x26')](handleError(_0x2391ad,null));};exports['destroy']=function(_0x3a3bd9,_0x2f1ce5){return db['FaxInteraction'][_0xb74f('0x35')]({'where':{'id':_0x3a3bd9[_0xb74f('0x28')]['id']}})[_0xb74f('0x16')](handleEntityNotFound(_0x2f1ce5,null))[_0xb74f('0x16')](removeEntity(_0x2f1ce5,null))[_0xb74f('0x26')](handleError(_0x2f1ce5,null));};exports['describe']=function(_0x3e9e14,_0x5d6707){return db['FaxInteraction'][_0xb74f('0x38')]()['then'](respondWithResult(_0x5d6707,null))[_0xb74f('0x26')](handleError(_0x5d6707,null));};exports[_0xb74f('0x39')]=function(_0x56066e,_0x2e3006){return db[_0xb74f('0x3a')][_0xb74f('0x35')]({'where':{'id':_0x56066e['params']['id']}})['then'](handleEntityNotFound(_0x2e3006,null))[_0xb74f('0x16')](function(_0x522bd2){if(_0x522bd2){return _0x522bd2[_0xb74f('0x39')](_0x56066e[_0xb74f('0x37')][_0xb74f('0x3b')],_[_0xb74f('0x3c')](_0x56066e[_0xb74f('0x37')],[_0xb74f('0x3b'),'id'])||{});}})[_0xb74f('0x16')](respondWithResult(_0x2e3006,null))[_0xb74f('0x26')](handleError(_0x2e3006,null));};exports[_0xb74f('0x3d')]=function(_0x193f33,_0x227467){var _0x744202={'raw':![],'where':{}};var _0x344061={};var _0x477813={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xb74f('0x3e')]({'where':{'id':_0x193f33[_0xb74f('0x28')]['id']}})[_0xb74f('0x16')](handleEntityNotFound(_0x227467,null))[_0xb74f('0x16')](function(_0x4bcc9b){if(_0x4bcc9b){_0x344061[_0xb74f('0x29')]=_[_0xb74f('0x2b')](db[_0xb74f('0x3a')][_0xb74f('0x1e')]);_0x344061[_0xb74f('0x2a')]=_[_0xb74f('0x2b')](_0x193f33[_0xb74f('0x2a')]);_0x344061[_0xb74f('0x2c')]=_[_0xb74f('0x2d')](_0x344061['model'],_0x344061[_0xb74f('0x2a')]);_0x744202[_0xb74f('0x2e')]=_[_0xb74f('0x2d')](_0x344061[_0xb74f('0x29')],qs[_0xb74f('0x2f')](_0x193f33[_0xb74f('0x2a')][_0xb74f('0x2f')]));_0x744202['attributes']=_0x744202[_0xb74f('0x2e')][_0xb74f('0x30')]?_0x744202['attributes']:_0x344061['model'];if(!_0x193f33[_0xb74f('0x2a')]['hasOwnProperty']('nolimit')){_0x744202[_0xb74f('0x11')]=qs['limit'](_0x193f33['query'][_0xb74f('0x11')]);_0x744202['offset']=qs['offset'](_0x193f33['query']['offset']);}_0x744202[_0xb74f('0x3f')]=qs['sort'](_0x193f33[_0xb74f('0x2a')][_0xb74f('0x40')]);_0x744202[_0xb74f('0x41')]=qs[_0xb74f('0x2c')](_['pick'](_0x193f33[_0xb74f('0x2a')],_0x344061[_0xb74f('0x2c')]));_0x744202[_0xb74f('0x41')][_0xb74f('0x42')]=_0x4bcc9b['id'];if(_0x193f33[_0xb74f('0x2a')][_0xb74f('0x43')]){_0x744202[_0xb74f('0x41')]=_[_0xb74f('0x33')](_0x744202[_0xb74f('0x41')],{'$or':_[_0xb74f('0x1c')](_0x744202[_0xb74f('0x2e')],function(_0x3b771c){var _0x50dde9={};_0x50dde9[_0x3b771c]={'$like':'%'+_0x193f33['query'][_0xb74f('0x43')]+'%'};return _0x50dde9;})});}if(_0x193f33[_0xb74f('0x2a')][_0xb74f('0x44')]){var _0x4f48cf=_0x193f33['query'][_0xb74f('0x44')][_0xb74f('0x45')](',');var _0x5e1af0={};_0x5e1af0[_0x4f48cf[0x0]]={'$gte':moment(_0x4f48cf[0x1])[_0xb74f('0x46')](_0xb74f('0x47'))};_0x744202[_0xb74f('0x41')]=_[_0xb74f('0x33')](_0x744202[_0xb74f('0x41')],_0x5e1af0);}_0x744202=_[_0xb74f('0x33')]({},_0x744202,_0x193f33[_0xb74f('0x34')]);return db[_0xb74f('0x3a')][_0xb74f('0x12')]({'where':_0x744202[_0xb74f('0x41')]})[_0xb74f('0x16')](function(_0xd04c5){_0x477813[_0xb74f('0x12')]=_0xd04c5;if(_0x193f33[_0xb74f('0x2a')][_0xb74f('0x31')]){_0x744202[_0xb74f('0x32')]=[{'all':!![]}];}return db[_0xb74f('0x3a')][_0xb74f('0x23')](_0x744202);})[_0xb74f('0x16')](function(_0x389d94){_0x477813[_0xb74f('0x48')]=_0x389d94;return _0x477813;});}})[_0xb74f('0x16')](respondWithFilteredResult(_0x227467,_0x744202))[_0xb74f('0x26')](handleError(_0x227467,null));};exports[_0xb74f('0x49')]=function(_0x3fb914,_0x42ae8f){return db['FaxInteraction']['find']({'where':{'id':_0x3fb914['params']['id']}})[_0xb74f('0x16')](handleEntityNotFound(_0x42ae8f,null))[_0xb74f('0x16')](function(_0x255ad6){if(_0x255ad6){return _0x255ad6[_0xb74f('0x4a')](_0x3fb914[_0xb74f('0x37')]['ids'],_[_0xb74f('0x3c')](_0x3fb914[_0xb74f('0x37')],['ids','id'])||{})[_0xb74f('0x4b')](function(){return db[_0xb74f('0x4c')][_0xb74f('0x23')]({'attributes':['id',_0xb74f('0x19'),_0xb74f('0x4d')],'where':{'id':_0x3fb914[_0xb74f('0x37')][_0xb74f('0x3b')]}});})[_0xb74f('0x16')](function(_0x11ded3){socket[_0xb74f('0x4e')](_0xb74f('0x4f'),{'id':Number(_0x3fb914[_0xb74f('0x28')]['id']),'tags':_0x11ded3||[]});return{'id':Number(_0x3fb914['params']['id']),'tags':_0x11ded3||[]};});}})[_0xb74f('0x16')](respondWithResult(_0x42ae8f,null))[_0xb74f('0x26')](handleError(_0x42ae8f,null));};exports[_0xb74f('0x50')]=function(_0xa094ce,_0x1fd49f){return db[_0xb74f('0x1d')]['find']({'where':{'id':_0xa094ce[_0xb74f('0x28')]['id']}})[_0xb74f('0x16')](handleEntityNotFound(_0x1fd49f,null))[_0xb74f('0x16')](function(_0x211e25){if(_0x211e25){return _0x211e25[_0xb74f('0x50')](_0xa094ce[_0xb74f('0x2a')]['ids']);}})[_0xb74f('0x16')](respondWithStatusCode(_0x1fd49f,null))['catch'](handleError(_0x1fd49f,null));};exports[_0xb74f('0x51')]=function(_0x5c3bc9,_0x47662c){var _0x4adc3c=moment()['unix']()[_0xb74f('0x52')]();var _0x3c51a2=path[_0xb74f('0x53')](config['root'],'server','files','tmp');var _0x923495=path[_0xb74f('0x53')](config[_0xb74f('0x54')],'server',_0xb74f('0x55'),_0xb74f('0x56'));var _0x12b437=path[_0xb74f('0x53')](_0x3c51a2,_0x4adc3c);var _0x4750ed=util[_0xb74f('0x46')](_0xb74f('0x57'),_0x5c3bc9[_0xb74f('0x28')]['id'],_0x4adc3c);var _0x3b8679=path['join'](_0x3c51a2,_0x4750ed);var _0x42119e=[];_0x42119e['push']({'model':db['Attachment'],'as':_0xb74f('0x58'),'raw':!![]});var _0x1821f0=[{'model':db[_0xb74f('0x3a')],'as':'Messages','attributes':['id',_0xb74f('0x37'),_0xb74f('0x59')],'include':_0x42119e}];return db[_0xb74f('0x1d')][_0xb74f('0x35')]({'where':{'id':_0x5c3bc9[_0xb74f('0x28')]['id']},'include':_0x1821f0})[_0xb74f('0x16')](handleEntityNotFound(_0x47662c,null))['then'](function(_0xbb97f5){if(_0xbb97f5&&_0xbb97f5[_0xb74f('0x5a')]){var _0x5051bf=_0xbb97f5['get']({'plain':!![]});fs[_0xb74f('0x5b')](_0x12b437);for(var _0xbcc40b=0x0;_0xbcc40b<_0x5051bf['Messages'][_0xb74f('0x30')];_0xbcc40b++){var _0x5b400a=_0x5051bf[_0xb74f('0x5a')][_0xbcc40b]['Attachment'];if(_0x5b400a){var _0x2414ad=path['join'](_0x923495,_0x5b400a['basename']);if(fs[_0xb74f('0x5c')](_0x2414ad)){fs[_0xb74f('0x5d')](_0x2414ad)[_0xb74f('0x5e')](fs[_0xb74f('0x5f')](path[_0xb74f('0x53')](_0x12b437,_0x5b400a[_0xb74f('0x60')])));}}}return BPromise[_0xb74f('0x61')]()['then'](function(){return new BPromise(function(_0x3fdd6a,_0x42d10e){zipdir(_0x12b437,{'saveTo':_0x3b8679},function(_0x529756,_0x35443b){if(_0x529756)return _0x42d10e(_0x529756);return _0x3fdd6a(_0x35443b);});})[_0xb74f('0x16')](function(){return new BPromise(function(_0xc7c31f,_0xbca7f5){rimraf(_0x12b437,function(_0x4768a1){if(_0x4768a1)_0xbca7f5(_0x4768a1);return _0xc7c31f();});});})[_0xb74f('0x16')](function(){return _0x47662c[_0xb74f('0x51')](_0x3b8679,_0x4750ed,function(_0x5f448a){if(_0x5f448a){console[_0xb74f('0x62')](_0xb74f('0x63'),_0x5f448a);}else{fs['unlinkSync'](_0x3b8679);}});});});}else{return _0x47662c['sendStatus'](0xc8);}})[_0xb74f('0x26')](handleError(_0x47662c,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 9f36d29..ab9206e 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 _0x264b=['FaxMessage','setMaxListeners','update','remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x264b,0x179));var _0xb264=function(_0x545ce6,_0x3bd8af){_0x545ce6=_0x545ce6-0x0;var _0x252f5d=_0x264b[_0x545ce6];return _0x252f5d;};'use strict';var EventEmitter=require(_0xb264('0x0'));var FaxInteraction=require(_0xb264('0x1'))['db'][_0xb264('0x2')];var FaxMessage=require('../../mysqldb')['db'][_0xb264('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xb264('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb264('0x5'),'afterDestroy':_0xb264('0x6')};function emitEvent(_0x41a4d3){return function(_0x4c0f44,_0xcdde8c,_0x4307d0){_0x4c0f44[_0xb264('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1c6d79){_0x4c0f44[_0xb264('0x8')](_0xb264('0x9'),_0x1c6d79[_0xb264('0xa')](function(_0x5eb2ad){return{'id':_0x5eb2ad['id']};}));return FaxMessage[_0xb264('0xb')]({'where':{'FaxInteractionId':_0x4c0f44['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb264('0xc')](function(_0x5e84e3){_0x4c0f44[_0xb264('0x8')](_0xb264('0xd'),_0x5e84e3[_0xb264('0xe')]);FaxInteractionEvents[_0xb264('0xf')](_0x41a4d3+':'+_0x4c0f44['id'],_0x4c0f44);FaxInteractionEvents[_0xb264('0xf')](_0x41a4d3,_0x4c0f44);_0x4307d0(null);})['catch'](_0x4307d0(null));};}for(var e in events){if(events[_0xb264('0x10')](e)){var event=events[e];FaxInteraction[_0xb264('0x11')](e,emitEvent(event));}}module[_0xb264('0x12')]=FaxInteractionEvents; \ No newline at end of file +var _0xc276=['setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','FaxMessage','save','update','getUsers','then'];(function(_0x36f906,_0x259289){var _0x4cd5e9=function(_0xdced72){while(--_0xdced72){_0x36f906['push'](_0x36f906['shift']());}};_0x4cd5e9(++_0x259289);}(_0xc276,0x1de));var _0x6c27=function(_0xa58142,_0x4776ee){_0xa58142=_0xa58142-0x0;var _0x4a3ccc=_0xc276[_0xa58142];return _0x4a3ccc;};'use strict';var EventEmitter=require(_0x6c27('0x0'));var FaxInteraction=require(_0x6c27('0x1'))['db'][_0x6c27('0x2')];var FaxMessage=require(_0x6c27('0x1'))['db'][_0x6c27('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6c27('0x4'),'afterUpdate':_0x6c27('0x5'),'afterDestroy':'remove'};function emitEvent(_0x885231){return function(_0x1f910d,_0x231aa6,_0x54aede){_0x1f910d[_0x6c27('0x6')]({'attributes':['id'],'raw':!![]})[_0x6c27('0x7')](function(_0x4a3827){_0x1f910d[_0x6c27('0x8')]('Users',_0x4a3827[_0x6c27('0x9')](function(_0x24cb47){return{'id':_0x24cb47['id']};}));return FaxMessage[_0x6c27('0xa')]({'where':{'FaxInteractionId':_0x1f910d['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x16156c){_0x1f910d[_0x6c27('0x8')](_0x6c27('0xb'),_0x16156c[_0x6c27('0xc')]);FaxInteractionEvents[_0x6c27('0xd')](_0x885231+':'+_0x1f910d['id'],_0x1f910d);FaxInteractionEvents[_0x6c27('0xd')](_0x885231,_0x1f910d);_0x54aede(null);})[_0x6c27('0xe')](_0x54aede(null));};}for(var e in events){if(events[_0x6c27('0xf')](e)){var event=events[e];FaxInteraction[_0x6c27('0x10')](e,emitEvent(event));}}module[_0x6c27('0x11')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 66a6144..81b9efc 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 _0xfd33=['bluebird','request-promise','path','../../config/environment','define','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment'];(function(_0x52ff60,_0x3eccef){var _0x2f5846=function(_0xc6fccc){while(--_0xc6fccc){_0x52ff60['push'](_0x52ff60['shift']());}};_0x2f5846(++_0x3eccef);}(_0xfd33,0x154));var _0x3fd3=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xfd33[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x3fd3('0x0'));var util=require(_0x3fd3('0x1'));var logger=require(_0x3fd3('0x2'))(_0x3fd3('0x3'));var moment=require(_0x3fd3('0x4'));var BPromise=require(_0x3fd3('0x5'));var rp=require(_0x3fd3('0x6'));var fs=require('fs');var path=require(_0x3fd3('0x7'));var rimraf=require('rimraf');var config=require(_0x3fd3('0x8'));var attributes=require('./faxInteraction.attributes');module['exports']=function(_0x34f657,_0x50e459){return _0x34f657[_0x3fd3('0x9')]('FaxInteraction',attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4580c6,_0x9c5e43,_0x4e7f04){if(_0x4580c6[_0x3fd3('0xa')](_0x3fd3('0xb'))){_0x4580c6[_0x3fd3('0xc')]=moment()[_0x3fd3('0xd')](_0x3fd3('0xe'));}_0x4e7f04(null,_0x4580c6);}}});}; \ No newline at end of file +var _0xde3a=['fax_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','FaxInteraction'];(function(_0x10d670,_0x178996){var _0x20d6f8=function(_0x4a4b87){while(--_0x4a4b87){_0x10d670['push'](_0x10d670['shift']());}};_0x20d6f8(++_0x178996);}(_0xde3a,0x140));var _0xade3=function(_0x18f8aa,_0x2e0696){_0x18f8aa=_0x18f8aa-0x0;var _0x506b84=_0xde3a[_0x18f8aa];return _0x506b84;};'use strict';var _=require(_0xade3('0x0'));var util=require(_0xade3('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xade3('0x2'));var rp=require(_0xade3('0x3'));var fs=require('fs');var path=require(_0xade3('0x4'));var rimraf=require(_0xade3('0x5'));var config=require(_0xade3('0x6'));var attributes=require(_0xade3('0x7'));module[_0xade3('0x8')]=function(_0x3c5d92,_0x3a3078){return _0x3c5d92['define'](_0xade3('0x9'),attributes,{'tableName':_0xade3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42cb93,_0x364617,_0x11f798){if(_0x42cb93[_0xade3('0xb')](_0xade3('0xc'))){_0x42cb93['closedAt']=moment()[_0xade3('0xd')](_0xade3('0xe'));}_0x11f798(null,_0x42cb93);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 8af1a04..1beaf37 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 _0x25fd=['where','attributes','limit','then','info','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./faxInteraction.socket','request','FaxInteraction,\x20%s,\x20%s','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','UpdateFaxInteraction','FaxInteraction','update','body','raw','options'];(function(_0x342a03,_0x494f8d){var _0x3219c2=function(_0x3900a1){while(--_0x3900a1){_0x342a03['push'](_0x342a03['shift']());}};_0x3219c2(++_0x494f8d);}(_0x25fd,0x1f1));var _0xd25f=function(_0x7d3e40,_0x2e6e6){_0x7d3e40=_0x7d3e40-0x0;var _0x5b011a=_0x25fd[_0x7d3e40];return _0x5b011a;};'use strict';var _=require(_0xd25f('0x0'));var util=require(_0xd25f('0x1'));var moment=require(_0xd25f('0x2'));var BPromise=require(_0xd25f('0x3'));var rs=require(_0xd25f('0x4'));var fs=require('fs');var Redis=require(_0xd25f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd25f('0x6'));var logger=require(_0xd25f('0x7'))(_0xd25f('0x8'));var config=require(_0xd25f('0x9'));var jayson=require(_0xd25f('0xa'));var client=jayson[_0xd25f('0xb')][_0xd25f('0xc')]({'port':0x232a});config['redis']=_[_0xd25f('0xd')](config[_0xd25f('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd25f('0xe')]));require(_0xd25f('0xf'))['register'](socket);function respondWithRpcPromise(_0xc4aa60,_0x529a1b,_0x40648d){return new BPromise(function(_0x5086ab,_0x703657){return client[_0xd25f('0x10')](_0xc4aa60,_0x40648d)['then'](function(_0x4705a8){logger['info'](_0xd25f('0x11'),_0x529a1b,'request\x20sent');logger['debug'](_0xd25f('0x12'),_0x529a1b,_0xd25f('0x13'),JSON[_0xd25f('0x14')](_0x4705a8));if(_0x4705a8[_0xd25f('0x15')]){if(_0x4705a8[_0xd25f('0x15')][_0xd25f('0x16')]===0x1f4){logger['error'](_0xd25f('0x11'),_0x529a1b,_0x4705a8[_0xd25f('0x15')][_0xd25f('0x17')]);return _0x703657(_0x4705a8['error'][_0xd25f('0x17')]);}logger['error'](_0xd25f('0x11'),_0x529a1b,_0x4705a8['error']['message']);return _0x5086ab(_0x4705a8[_0xd25f('0x15')][_0xd25f('0x17')]);}else{logger['info'](_0xd25f('0x11'),_0x529a1b,_0xd25f('0x13'));_0x5086ab(_0x4705a8['result'][_0xd25f('0x17')]);}})[_0xd25f('0x18')](function(_0x1df3c4){logger[_0xd25f('0x15')](_0xd25f('0x11'),_0x529a1b,_0x1df3c4);_0x703657(_0x1df3c4);});});}exports[_0xd25f('0x19')]=function(_0x1ddda9){var _0x2667a8=this;return new Promise(function(_0x51699f,_0x5225d8){return db[_0xd25f('0x1a')][_0xd25f('0x1b')](_0x1ddda9[_0xd25f('0x1c')],{'raw':_0x1ddda9['options']?_0x1ddda9['options'][_0xd25f('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ddda9[_0xd25f('0x1e')]?_0x1ddda9[_0xd25f('0x1e')][_0xd25f('0x1f')]||null:null,'attributes':_0x1ddda9[_0xd25f('0x1e')]?_0x1ddda9[_0xd25f('0x1e')][_0xd25f('0x20')]||null:null,'limit':_0x1ddda9[_0xd25f('0x1e')]?_0x1ddda9[_0xd25f('0x1e')][_0xd25f('0x21')]||null:null})[_0xd25f('0x22')](function(_0x14e31e){logger[_0xd25f('0x23')](_0xd25f('0x19'),_0x1ddda9);logger['debug'](_0xd25f('0x19'),_0x1ddda9,JSON['stringify'](_0x14e31e));_0x51699f(_0x14e31e);})[_0xd25f('0x18')](function(_0x417045){logger[_0xd25f('0x15')](_0xd25f('0x19'),_0x417045[_0xd25f('0x17')],_0x1ddda9);_0x5225d8(_0x2667a8['error'](0x1f4,_0x417045[_0xd25f('0x17')]));});});};exports[_0xd25f('0x24')]=function(_0x267673){return new Promise(function(_0x3eae36,_0x280eec){return db[_0xd25f('0x1a')][_0xd25f('0x25')]({'where':_0x267673[_0xd25f('0x1e')]?_0x267673[_0xd25f('0x1e')][_0xd25f('0x1f')]||null:null})['then'](function(_0x3fd10f){if(_0x3fd10f){return _0x3fd10f[_0xd25f('0x26')](_0x267673[_0xd25f('0x1c')][_0xd25f('0x27')],_[_0xd25f('0x28')](_0x267673['body'],[_0xd25f('0x27'),'id'])||{});}})[_0xd25f('0x29')](function(_0x515c55){logger[_0xd25f('0x23')](_0xd25f('0x2a'),_0x267673);logger[_0xd25f('0x2b')](_0xd25f('0x2a'),_0x267673,JSON[_0xd25f('0x14')](_0x515c55));_0x3eae36(_0x515c55);})['catch'](function(_0x2e4c9b){logger[_0xd25f('0x15')](_0xd25f('0x2a'),_0x2e4c9b[_0xd25f('0x17')],_0x267673);_0x280eec(_this[_0xd25f('0x15')](0x1f4,_0x2e4c9b[_0xd25f('0x17')]));});});}; \ No newline at end of file +var _0x363a=['client','http','redis','defaults','socket.io-emitter','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','UpdateFaxInteraction','FaxInteraction','body','options','where','attributes','limit','catch','AddTagsToFaxInteraction','find','addTags','ids','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise'];(function(_0xaf41db,_0x2b713e){var _0x4c2398=function(_0x507eca){while(--_0x507eca){_0xaf41db['push'](_0xaf41db['shift']());}};_0x4c2398(++_0x2b713e);}(_0x363a,0x1af));var _0xa363=function(_0xe8360c,_0x4b51d5){_0xe8360c=_0xe8360c-0x0;var _0x377630=_0x363a[_0xe8360c];return _0x377630;};'use strict';var _=require('lodash');var util=require(_0xa363('0x0'));var moment=require(_0xa363('0x1'));var BPromise=require(_0xa363('0x2'));var rs=require(_0xa363('0x3'));var fs=require('fs');var Redis=require(_0xa363('0x4'));var db=require(_0xa363('0x5'))['db'];var utils=require(_0xa363('0x6'));var logger=require('../../config/logger')(_0xa363('0x7'));var config=require('../../config/environment');var jayson=require(_0xa363('0x8'));var client=jayson[_0xa363('0x9')][_0xa363('0xa')]({'port':0x232a});config[_0xa363('0xb')]=_[_0xa363('0xc')](config[_0xa363('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xa363('0xd'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0xa363('0xe')](socket);function respondWithRpcPromise(_0x5e101f,_0x59e7c6,_0x5dc1d5){return new BPromise(function(_0x1cf4b0,_0x487f34){return client[_0xa363('0xf')](_0x5e101f,_0x5dc1d5)[_0xa363('0x10')](function(_0x3f1ff3){logger[_0xa363('0x11')](_0xa363('0x12'),_0x59e7c6,_0xa363('0x13'));logger[_0xa363('0x14')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x59e7c6,_0xa363('0x13'),JSON[_0xa363('0x15')](_0x3f1ff3));if(_0x3f1ff3[_0xa363('0x16')]){if(_0x3f1ff3['error'][_0xa363('0x17')]===0x1f4){logger['error'](_0xa363('0x12'),_0x59e7c6,_0x3f1ff3[_0xa363('0x16')]['message']);return _0x487f34(_0x3f1ff3[_0xa363('0x16')]['message']);}logger['error'](_0xa363('0x12'),_0x59e7c6,_0x3f1ff3[_0xa363('0x16')][_0xa363('0x18')]);return _0x1cf4b0(_0x3f1ff3[_0xa363('0x16')]['message']);}else{logger[_0xa363('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x59e7c6,_0xa363('0x13'));_0x1cf4b0(_0x3f1ff3[_0xa363('0x19')][_0xa363('0x18')]);}})['catch'](function(_0x759066){logger[_0xa363('0x16')](_0xa363('0x12'),_0x59e7c6,_0x759066);_0x487f34(_0x759066);});});}exports[_0xa363('0x1a')]=function(_0x55121c){var _0x46f20e=this;return new Promise(function(_0x27865e,_0x23eb1b){return db[_0xa363('0x1b')]['update'](_0x55121c[_0xa363('0x1c')],{'raw':_0x55121c['options']?_0x55121c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55121c['options']?_0x55121c[_0xa363('0x1d')][_0xa363('0x1e')]||null:null,'attributes':_0x55121c[_0xa363('0x1d')]?_0x55121c[_0xa363('0x1d')][_0xa363('0x1f')]||null:null,'limit':_0x55121c['options']?_0x55121c['options'][_0xa363('0x20')]||null:null})['then'](function(_0x4fd27c){logger[_0xa363('0x11')](_0xa363('0x1a'),_0x55121c);logger['debug'](_0xa363('0x1a'),_0x55121c,JSON[_0xa363('0x15')](_0x4fd27c));_0x27865e(_0x4fd27c);})[_0xa363('0x21')](function(_0xe52c4a){logger[_0xa363('0x16')](_0xa363('0x1a'),_0xe52c4a['message'],_0x55121c);_0x23eb1b(_0x46f20e[_0xa363('0x16')](0x1f4,_0xe52c4a[_0xa363('0x18')]));});});};exports[_0xa363('0x22')]=function(_0x53eb1e){return new Promise(function(_0x5c7851,_0x41b9f0){return db[_0xa363('0x1b')][_0xa363('0x23')]({'where':_0x53eb1e[_0xa363('0x1d')]?_0x53eb1e[_0xa363('0x1d')][_0xa363('0x1e')]||null:null})[_0xa363('0x10')](function(_0x4f60b5){if(_0x4f60b5){return _0x4f60b5[_0xa363('0x24')](_0x53eb1e['body'][_0xa363('0x25')],_['omit'](_0x53eb1e['body'],[_0xa363('0x25'),'id'])||{});}})[_0xa363('0x26')](function(_0x1975e1){logger['info']('AddTags',_0x53eb1e);logger[_0xa363('0x14')](_0xa363('0x27'),_0x53eb1e,JSON[_0xa363('0x15')](_0x1975e1));_0x5c7851(_0x1975e1);})[_0xa363('0x21')](function(_0x46b987){logger[_0xa363('0x16')](_0xa363('0x27'),_0x46b987[_0xa363('0x18')],_0x53eb1e);_0x41b9f0(_this['error'](0x1f4,_0x46b987[_0xa363('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 125dcd7..f8c398b 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 _0x4a45=['faxInteraction:','./faxInteraction.events','save','remove','emit','register','length'];(function(_0x239ad4,_0x2ad596){var _0x29317b=function(_0x1fa511){while(--_0x1fa511){_0x239ad4['push'](_0x239ad4['shift']());}};_0x29317b(++_0x2ad596);}(_0x4a45,0xe1));var _0x54a4=function(_0x5ad51c,_0x3f3648){_0x5ad51c=_0x5ad51c-0x0;var _0x47fddf=_0x4a45[_0x5ad51c];return _0x47fddf;};'use strict';var FaxInteractionEvents=require(_0x54a4('0x0'));var events=[_0x54a4('0x1'),_0x54a4('0x2'),'update'];function createListener(_0x2b74d9,_0x4d3fe4){return function(_0x4f2289){_0x4d3fe4[_0x54a4('0x3')](_0x2b74d9,_0x4f2289);};}function removeListener(_0x52444c,_0x166001){return function(){FaxInteractionEvents['removeListener'](_0x52444c,_0x166001);};}exports[_0x54a4('0x4')]=function(_0x444e88){for(var _0x4cc5bf=0x0,_0x5d95aa=events[_0x54a4('0x5')];_0x4cc5bf<_0x5d95aa;_0x4cc5bf++){var _0x47646f=events[_0x4cc5bf];var _0x4d3bd2=createListener(_0x54a4('0x6')+_0x47646f,_0x444e88);FaxInteractionEvents['on'](_0x47646f,_0x4d3bd2);}}; \ No newline at end of file +var _0x70df=['remove','update','emit','register','./faxInteraction.events','save'];(function(_0x1f65f9,_0x28dca8){var _0x59d1b1=function(_0x5d1c3f){while(--_0x5d1c3f){_0x1f65f9['push'](_0x1f65f9['shift']());}};_0x59d1b1(++_0x28dca8);}(_0x70df,0xa6));var _0xf70d=function(_0x49f0b1,_0x2b9bd4){_0x49f0b1=_0x49f0b1-0x0;var _0xce6304=_0x70df[_0x49f0b1];return _0xce6304;};'use strict';var FaxInteractionEvents=require(_0xf70d('0x0'));var events=[_0xf70d('0x1'),_0xf70d('0x2'),_0xf70d('0x3')];function createListener(_0x15187d,_0x5d8582){return function(_0x5502ca){_0x5d8582[_0xf70d('0x4')](_0x15187d,_0x5502ca);};}function removeListener(_0xf25c9f,_0x1a7e14){return function(){FaxInteractionEvents['removeListener'](_0xf25c9f,_0x1a7e14);};}exports[_0xf70d('0x5')]=function(_0x5e71d6){for(var _0x14e56b=0x0,_0xf492cf=events['length'];_0x14e56b<_0xf492cf;_0x14e56b++){var _0x25d77b=events[_0x14e56b];var _0x30f382=createListener('faxInteraction:'+_0x25d77b,_0x5e71d6);FaxInteractionEvents['on'](_0x25d77b,_0x30f382);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index d74d263..51d6c80 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 _0x1cc7=['/:id/tags','tracked','fax','addTags','put','/:id','faxinteraction:update','delete','faxinteraction:destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','get','/describe','describe','show','/:id/download','download','post'];(function(_0x49ffda,_0x45ae69){var _0x3960ea=function(_0x238fd5){while(--_0x238fd5){_0x49ffda['push'](_0x49ffda['shift']());}};_0x3960ea(++_0x45ae69);}(_0x1cc7,0x15a));var _0x71cc=function(_0x3bff9a,_0xe7e88f){_0x3bff9a=_0x3bff9a-0x0;var _0x126265=_0x1cc7[_0x3bff9a];return _0x126265;};'use strict';var multer=require(_0x71cc('0x0'));var util=require(_0x71cc('0x1'));var path=require(_0x71cc('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x71cc('0x3'));var auth=require(_0x71cc('0x4'));var interaction=require(_0x71cc('0x5'));var config=require('../../config/environment');var controller=require('./faxInteraction.controller');router['get']('/',auth[_0x71cc('0x6')](),controller['index']);router[_0x71cc('0x7')](_0x71cc('0x8'),auth[_0x71cc('0x6')](),controller[_0x71cc('0x9')]);router[_0x71cc('0x7')]('/:id',auth[_0x71cc('0x6')](),controller[_0x71cc('0xa')]);router[_0x71cc('0x7')]('/:id/messages',auth['isAuthenticated'](),controller['getMessages']);router['get'](_0x71cc('0xb'),auth[_0x71cc('0x6')](),controller[_0x71cc('0xc')]);router['post']('/',auth[_0x71cc('0x6')](),controller['create']);router[_0x71cc('0xd')]('/:id/messages',auth[_0x71cc('0x6')](),controller['addMessage']);router[_0x71cc('0xd')](_0x71cc('0xe'),auth[_0x71cc('0x6')](),interaction[_0x71cc('0xf')](_0x71cc('0x10'),'faxinteraction:addtags'),controller[_0x71cc('0x11')]);router[_0x71cc('0x12')](_0x71cc('0x13'),auth[_0x71cc('0x6')](),interaction[_0x71cc('0xf')](_0x71cc('0x10'),_0x71cc('0x14')),controller['update']);router[_0x71cc('0x15')](_0x71cc('0x13'),auth[_0x71cc('0x6')](),interaction[_0x71cc('0xf')](_0x71cc('0x10'),_0x71cc('0x16')),controller['destroy']);router[_0x71cc('0x15')](_0x71cc('0xe'),auth['isAuthenticated'](),controller['removeTags']);module[_0x71cc('0x17')]=router; \ No newline at end of file +var _0xc0c8=['faxinteraction:destroy','destroy','removeTags','exports','util','path','fs-extra','../../components/auth/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','download','post','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','delete'];(function(_0x8a217e,_0x450bfc){var _0x3fc350=function(_0x55ed99){while(--_0x55ed99){_0x8a217e['push'](_0x8a217e['shift']());}};_0x3fc350(++_0x450bfc);}(_0xc0c8,0x109));var _0x8c0c=function(_0xd29265,_0x311ced){_0xd29265=_0xd29265-0x0;var _0xf4750c=_0xc0c8[_0xd29265];return _0xf4750c;};'use strict';var multer=require('multer');var util=require(_0x8c0c('0x0'));var path=require(_0x8c0c('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8c0c('0x2'));var auth=require(_0x8c0c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x8c0c('0x4'));var controller=require(_0x8c0c('0x5'));router[_0x8c0c('0x6')]('/',auth[_0x8c0c('0x7')](),controller['index']);router['get'](_0x8c0c('0x8'),auth[_0x8c0c('0x7')](),controller[_0x8c0c('0x9')]);router['get'](_0x8c0c('0xa'),auth['isAuthenticated'](),controller[_0x8c0c('0xb')]);router['get'](_0x8c0c('0xc'),auth[_0x8c0c('0x7')](),controller[_0x8c0c('0xd')]);router[_0x8c0c('0x6')]('/:id/download',auth[_0x8c0c('0x7')](),controller[_0x8c0c('0xe')]);router[_0x8c0c('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8c0c('0xf')](_0x8c0c('0xc'),auth[_0x8c0c('0x7')](),controller[_0x8c0c('0x10')]);router[_0x8c0c('0xf')](_0x8c0c('0x11'),auth[_0x8c0c('0x7')](),interaction[_0x8c0c('0x12')](_0x8c0c('0x13'),_0x8c0c('0x14')),controller[_0x8c0c('0x15')]);router[_0x8c0c('0x16')](_0x8c0c('0xa'),auth[_0x8c0c('0x7')](),interaction[_0x8c0c('0x12')](_0x8c0c('0x13'),_0x8c0c('0x17')),controller['update']);router[_0x8c0c('0x18')](_0x8c0c('0xa'),auth[_0x8c0c('0x7')](),interaction[_0x8c0c('0x12')](_0x8c0c('0x13'),_0x8c0c('0x19')),controller[_0x8c0c('0x1a')]);router[_0x8c0c('0x18')](_0x8c0c('0x11'),auth[_0x8c0c('0x7')](),controller[_0x8c0c('0x1b')]);module[_0x8c0c('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 6cc5095..e46112e 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 _0x21d1=['ENUM','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x2e2ce8,_0x436b78){var _0x1d92a7=function(_0x51e8d8){while(--_0x51e8d8){_0x2e2ce8['push'](_0x2e2ce8['shift']());}};_0x1d92a7(++_0x436b78);}(_0x21d1,0x1c9));var _0x121d=function(_0x4421c0,_0x27786c){_0x4421c0=_0x4421c0-0x0;var _0x2e1642=_0x21d1[_0x4421c0];return _0x2e1642;};'use strict';var Sequelize=require(_0x121d('0x0'));module[_0x121d('0x1')]={'body':{'type':Sequelize[_0x121d('0x2')](_0x121d('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x121d('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x121d('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x121d('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x121d('0x6')]}}; \ No newline at end of file +var _0x55d2=['ENUM','out','DATE','TEXT','medium','BOOLEAN'];(function(_0x41e961,_0x234d36){var _0x1ba461=function(_0xbd7d7){while(--_0xbd7d7){_0x41e961['push'](_0x41e961['shift']());}};_0x1ba461(++_0x234d36);}(_0x55d2,0x9f));var _0x255d=function(_0x177f03,_0x23208f){_0x177f03=_0x177f03-0x0;var _0x85dc43=_0x55d2[_0x177f03];return _0x85dc43;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x255d('0x0')](_0x255d('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x255d('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x255d('0x3')]('in',_0x255d('0x4')),'defaultValue':_0x255d('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x255d('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index fa5a6d2..b192670 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 _0x5042=['../../config/license/util','../../mysqldb','redis','localhost','./faxMessage.socket','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','end','stack','name','index','map','FaxMessage','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','findAll','show','params','includeAll','find','body','describe','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','interface','SIP/%s','channel','EventManager','reject','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','ContactId','contact','motionChannel','event','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','join','root','files','basename','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0xae9ab6,_0xb47077){var _0x1ae534=function(_0x5bfc41){while(--_0x5bfc41){_0xae9ab6['push'](_0xae9ab6['shift']());}};_0x1ae534(++_0xb47077);}(_0x5042,0x76));var _0x2504=function(_0xf14908,_0x43e1a8){_0xf14908=_0xf14908-0x0;var _0x217c53=_0x5042[_0xf14908];return _0x217c53;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2504('0x0'));var zipdir=require(_0x2504('0x1'));var jsonpatch=require(_0x2504('0x2'));var rp=require(_0x2504('0x3'));var moment=require(_0x2504('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2504('0x5'));var util=require('util');var path=require('path');var sox=require(_0x2504('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2504('0x7'));var squel=require(_0x2504('0x8'));var crypto=require(_0x2504('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x2504('0xa'));var toCsv=require(_0x2504('0xb'));var querystring=require(_0x2504('0xc'));var Papa=require(_0x2504('0xd'));var Redis=require(_0x2504('0xe'));var authService=require(_0x2504('0xf'));var qs=require(_0x2504('0x10'));var as=require(_0x2504('0x11'));var hardwareService=require(_0x2504('0x12'));var logger=require(_0x2504('0x13'))(_0x2504('0x14'));var utils=require(_0x2504('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2504('0x16'));var db=require(_0x2504('0x17'))['db'];config[_0x2504('0x18')]=_['defaults'](config[_0x2504('0x18')],{'host':_0x2504('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2504('0x1a'))['register'](socket);var jayson=require(_0x2504('0x1b'));var client=jayson[_0x2504('0x1c')][_0x2504('0x1d')]({'port':0x232c});var client9002=jayson[_0x2504('0x1c')][_0x2504('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x535dc2,_0x374850,_0x15d734,_0x53771f){return new BPromise(function(_0x15c3fb,_0x3c0ff3){var _0x41faf5=_0x53771f||client;return _0x41faf5[_0x2504('0x1e')](_0x535dc2,_0x15d734)[_0x2504('0x1f')](function(_0x416d3d){logger[_0x2504('0x20')](_0x2504('0x21'),_0x374850,_0x2504('0x22'));logger['debug'](_0x2504('0x23'),_0x374850,_0x2504('0x22'),JSON['stringify'](_0x416d3d));if(_0x416d3d['error']){if(_0x416d3d[_0x2504('0x24')]['code']===0x1f4){logger[_0x2504('0x24')]('FaxMessage,\x20%s,\x20%s',_0x374850,_0x416d3d[_0x2504('0x24')][_0x2504('0x25')]);return _0x3c0ff3(_0x416d3d['error'][_0x2504('0x25')]);}logger[_0x2504('0x24')](_0x2504('0x21'),_0x374850,_0x416d3d[_0x2504('0x24')][_0x2504('0x25')]);return _0x15c3fb(_0x416d3d['error'][_0x2504('0x25')]);}else{logger[_0x2504('0x20')](_0x2504('0x21'),_0x374850,_0x2504('0x22'));_0x15c3fb(_0x416d3d[_0x2504('0x26')][_0x2504('0x25')]);}})[_0x2504('0x27')](function(_0x2bbe42){logger[_0x2504('0x24')](_0x2504('0x21'),_0x374850,_0x2bbe42);_0x3c0ff3(_0x2bbe42);});});}function respondWithStatusCode(_0x31c46a,_0x64238c){_0x64238c=_0x64238c||0xcc;return function(_0x30c316){if(_0x30c316){return _0x31c46a[_0x2504('0x28')](_0x64238c);}return _0x31c46a[_0x2504('0x29')](_0x64238c)['end']();};}function respondWithResult(_0x47d4bf,_0x36f0d6){_0x36f0d6=_0x36f0d6||0xc8;return function(_0x398805){if(_0x398805){return _0x47d4bf['status'](_0x36f0d6)[_0x2504('0x2a')](_0x398805);}};}function respondWithFilteredResult(_0x43ddd8,_0x1533c5){return function(_0x4f29bd){if(_0x4f29bd){var _0x23aa63=typeof _0x1533c5[_0x2504('0x2b')]===_0x2504('0x2c')&&typeof _0x1533c5[_0x2504('0x2d')]==='undefined';var _0x1b3640=_0x4f29bd[_0x2504('0x2e')];var _0x1631bb=_0x23aa63?0x0:_0x1533c5['offset'];var _0x308da9=_0x23aa63?_0x4f29bd['count']:_0x1533c5[_0x2504('0x2b')]+_0x1533c5['limit'];var _0x2802f3;if(_0x308da9>=_0x1b3640){_0x308da9=_0x1b3640;_0x2802f3=0xc8;}else{_0x2802f3=0xce;}_0x43ddd8[_0x2504('0x29')](_0x2802f3);return _0x43ddd8['set'](_0x2504('0x2f'),_0x1631bb+'-'+_0x308da9+'/'+_0x1b3640)[_0x2504('0x2a')](_0x4f29bd);}return null;};}function patchUpdates(_0x224a11){return function(_0x1640c5){try{jsonpatch[_0x2504('0x30')](_0x1640c5,_0x224a11,!![]);}catch(_0x185d71){return BPromise['reject'](_0x185d71);}return _0x1640c5[_0x2504('0x31')]();};}function saveUpdates(_0xd1e907,_0x207105){return function(_0x1d624c){if(_0x1d624c){return _0x1d624c[_0x2504('0x32')](_0xd1e907)['then'](function(_0x176b17){return _0x176b17;});}return null;};}function removeEntity(_0x32fd8c,_0x338cf5){return function(_0x5c64e9){if(_0x5c64e9){return _0x5c64e9[_0x2504('0x33')]()[_0x2504('0x1f')](function(){_0x32fd8c['status'](0xcc)[_0x2504('0x34')]();});}};}function handleEntityNotFound(_0x585c06,_0x261a7e){return function(_0x33d886){if(!_0x33d886){_0x585c06['sendStatus'](0x194);}return _0x33d886;};}function handleError(_0x45a47a,_0x4f5bf8){_0x4f5bf8=_0x4f5bf8||0x1f4;return function(_0x4080dd){logger[_0x2504('0x24')](_0x4080dd[_0x2504('0x35')]);if(_0x4080dd[_0x2504('0x36')]){delete _0x4080dd['name'];}_0x45a47a[_0x2504('0x29')](_0x4f5bf8)['send'](_0x4080dd);};}exports[_0x2504('0x37')]=function(_0x30cba4,_0x4bb405){var _0x4763de={},_0x472a37={},_0x39ffda={'count':0x0,'rows':[]};var _0xe83ce3=_[_0x2504('0x38')](db[_0x2504('0x39')][_0x2504('0x3a')],function(_0x32cf25){return{'name':_0x32cf25[_0x2504('0x3b')],'type':_0x32cf25['type'][_0x2504('0x3c')]};});_0x472a37[_0x2504('0x3d')]=_[_0x2504('0x38')](_0xe83ce3,'name');_0x472a37[_0x2504('0x3e')]=_[_0x2504('0x3f')](_0x30cba4[_0x2504('0x3e')]);_0x472a37[_0x2504('0x40')]=_[_0x2504('0x41')](_0x472a37[_0x2504('0x3d')],_0x472a37[_0x2504('0x3e')]);_0x4763de[_0x2504('0x42')]=_[_0x2504('0x41')](_0x472a37[_0x2504('0x3d')],qs[_0x2504('0x43')](_0x30cba4[_0x2504('0x3e')][_0x2504('0x43')]));_0x4763de[_0x2504('0x42')]=_0x4763de[_0x2504('0x42')]['length']?_0x4763de[_0x2504('0x42')]:_0x472a37[_0x2504('0x3d')];if(!_0x30cba4[_0x2504('0x3e')][_0x2504('0x44')](_0x2504('0x45'))){_0x4763de[_0x2504('0x2d')]=qs[_0x2504('0x2d')](_0x30cba4['query'][_0x2504('0x2d')]);_0x4763de['offset']=qs[_0x2504('0x2b')](_0x30cba4[_0x2504('0x3e')][_0x2504('0x2b')]);}_0x4763de[_0x2504('0x46')]=qs[_0x2504('0x47')](_0x30cba4[_0x2504('0x3e')][_0x2504('0x47')]);_0x4763de[_0x2504('0x48')]=qs['filters'](_[_0x2504('0x49')](_0x30cba4[_0x2504('0x3e')],_0x472a37[_0x2504('0x40')]),_0xe83ce3);if(_0x30cba4[_0x2504('0x3e')][_0x2504('0x4a')]){_0x4763de[_0x2504('0x48')]=_[_0x2504('0x4b')](_0x4763de[_0x2504('0x48')],{'$or':_['map'](_0xe83ce3,function(_0x1e60e2){if(_0x1e60e2[_0x2504('0x4c')]!==_0x2504('0x4d')){var _0x339690={};_0x339690[_0x1e60e2[_0x2504('0x36')]]={'$like':'%'+_0x30cba4['query'][_0x2504('0x4a')]+'%'};return _0x339690;}})});}_0x4763de=_[_0x2504('0x4b')]({},_0x4763de,_0x30cba4[_0x2504('0x4e')]);var _0x2ceaa2={'where':_0x4763de[_0x2504('0x48')]};return db[_0x2504('0x39')]['count'](_0x2ceaa2)[_0x2504('0x1f')](function(_0x16baa6){_0x39ffda[_0x2504('0x2e')]=_0x16baa6;if(_0x30cba4[_0x2504('0x3e')]['includeAll']){_0x4763de['include']=[{'all':!![]}];}return db['FaxMessage'][_0x2504('0x4f')](_0x4763de);})['then'](function(_0x256bc3){_0x39ffda['rows']=_0x256bc3;return _0x39ffda;})[_0x2504('0x1f')](respondWithFilteredResult(_0x4bb405,_0x4763de))[_0x2504('0x27')](handleError(_0x4bb405,null));};exports[_0x2504('0x50')]=function(_0x278ad8,_0xe8935e){var _0x353a9f={'raw':!![],'where':{'id':_0x278ad8[_0x2504('0x51')]['id']}},_0x49c6dd={};_0x49c6dd['model']=_[_0x2504('0x3f')](db['FaxMessage'][_0x2504('0x3a')]);_0x49c6dd['query']=_[_0x2504('0x3f')](_0x278ad8[_0x2504('0x3e')]);_0x49c6dd[_0x2504('0x40')]=_[_0x2504('0x41')](_0x49c6dd['model'],_0x49c6dd['query']);_0x353a9f[_0x2504('0x42')]=_['intersection'](_0x49c6dd[_0x2504('0x3d')],qs[_0x2504('0x43')](_0x278ad8[_0x2504('0x3e')][_0x2504('0x43')]));_0x353a9f[_0x2504('0x42')]=_0x353a9f[_0x2504('0x42')]['length']?_0x353a9f['attributes']:_0x49c6dd['model'];if(_0x278ad8[_0x2504('0x3e')][_0x2504('0x52')]){_0x353a9f['include']=[{'all':!![]}];}_0x353a9f=_[_0x2504('0x4b')]({},_0x353a9f,_0x278ad8[_0x2504('0x4e')]);return db[_0x2504('0x39')][_0x2504('0x53')](_0x353a9f)[_0x2504('0x1f')](handleEntityNotFound(_0xe8935e,null))[_0x2504('0x1f')](respondWithResult(_0xe8935e,null))[_0x2504('0x27')](handleError(_0xe8935e,null));};exports[_0x2504('0x32')]=function(_0x1c6c9e,_0x511024){if(_0x1c6c9e['body']['id']){delete _0x1c6c9e[_0x2504('0x54')]['id'];}return db[_0x2504('0x39')]['find']({'where':{'id':_0x1c6c9e[_0x2504('0x51')]['id']}})[_0x2504('0x1f')](handleEntityNotFound(_0x511024,null))[_0x2504('0x1f')](saveUpdates(_0x1c6c9e['body'],null))[_0x2504('0x1f')](respondWithResult(_0x511024,null))['catch'](handleError(_0x511024,null));};exports['destroy']=function(_0x2500e9,_0x5124f3){return db[_0x2504('0x39')]['find']({'where':{'id':_0x2500e9['params']['id']}})[_0x2504('0x1f')](handleEntityNotFound(_0x5124f3,null))[_0x2504('0x1f')](removeEntity(_0x5124f3,null))[_0x2504('0x27')](handleError(_0x5124f3,null));};exports[_0x2504('0x55')]=function(_0x43ffe8,_0x3c0703){return db['FaxMessage'][_0x2504('0x55')]()[_0x2504('0x1f')](respondWithResult(_0x3c0703,null))[_0x2504('0x27')](handleError(_0x3c0703,null));};var interaction_log=require(_0x2504('0x13'))(_0x2504('0x56'));exports[_0x2504('0x57')]=function(_0x369f68,_0x482300,_0x3720d5){var _0x1393b2={'agent':{},'channel':_0x2504('0x58')};if(_0x369f68[_0x2504('0x54')]['id']){delete _0x369f68[_0x2504('0x54')]['id'];}_0x369f68[_0x2504('0x54')][_0x2504('0x59')]=!![];_0x369f68[_0x2504('0x54')][_0x2504('0x5a')]=moment()[_0x2504('0x5b')](_0x2504('0x5c'));_0x369f68['body'][_0x2504('0x5d')]=_0x369f68[_0x2504('0x54')]['UserId']||_0x369f68[_0x2504('0x5e')]['id'];_0x1393b2[_0x2504('0x5f')]['id']=_0x369f68[_0x2504('0x54')][_0x2504('0x5d')];return db[_0x2504('0x39')][_0x2504('0x53')]({'where':{'id':_0x369f68[_0x2504('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x482300,null))[_0x2504('0x1f')](saveUpdates(_0x369f68['body'],null))[_0x2504('0x1f')](function(_0x3f242e){if(_0x3f242e){_0x1393b2[_0x2504('0x25')]=_0x3f242e[_0x2504('0x60')]({'plain':!![]});return db[_0x2504('0x61')][_0x2504('0x53')]({'where':{'id':_0x3f242e[_0x2504('0x62')]}});}return null;})[_0x2504('0x1f')](handleEntityNotFound(_0x482300,null))[_0x2504('0x1f')](function(_0x12a842){if(_0x12a842){return _0x12a842[_0x2504('0x32')]({'UserId':_0x369f68[_0x2504('0x54')][_0x2504('0x5d')],'read1stAt':_[_0x2504('0x63')](_0x12a842[_0x2504('0x64')])?moment()[_0x2504('0x5b')](_0x2504('0x5c')):undefined});}return null;})[_0x2504('0x1f')](function(_0x1dbb6e){if(_0x1dbb6e){_0x1393b2[_0x2504('0x65')]=_0x1dbb6e[_0x2504('0x60')]({'plain':!![]});interaction_log['info'](_0x2504('0x66'),_0x369f68['user']['id'],_0x369f68[_0x2504('0x5e')][_0x2504('0x36')],_0x369f68[_0x2504('0x5e')][_0x2504('0x67')],_0x1393b2['interaction']['id'],_0x369f68['body']?JSON['stringify'](_0x369f68[_0x2504('0x54')]):'null');return respondWithRpcPromise(_0x2504('0x68'),_0x2504('0x69'),_0x1393b2);}return null;})['then'](function(_0x4f023b){var _0x107520=_0x2504('0x6a')+_0x4f023b[_0x2504('0x25')]['ContactId'];return db['sequelize'][_0x2504('0x3e')](_0x107520,{'type':db[_0x2504('0x6b')][_0x2504('0x6c')][_0x2504('0x6d')],'raw':!![]})['then'](function(_0x19c789){return _0x19c789;});})[_0x2504('0x1f')](function(_0x277863){if(_0x277863){_0x1393b2[_0x2504('0x25')]['contact']=_0x277863[0x0];if(!_0x369f68[_0x2504('0x54')]['UserId'])return;return db[_0x2504('0x6e')][_0x2504('0x53')]({'where':{'id':_0x369f68[_0x2504('0x54')][_0x2504('0x5d')],'role':_0x2504('0x5f')},'attributes':['id',_0x2504('0x36'),_0x2504('0x6f'),_0x2504('0x70'),_0x2504('0x71')],'raw':!![]});}return null;})[_0x2504('0x1f')](function(_0x2dfd28){if(!_0x2dfd28)return null;_0x1393b2[_0x2504('0x25')][_0x2504('0x5f')]=_0x2dfd28;return _0x1393b2;})[_0x2504('0x1f')](function(_0x230d15){if(_0x230d15){if(_0x369f68['body']['manual']){_0x1393b2[_0x2504('0x25')][_0x2504('0x72')]=util[_0x2504('0x5b')](_0x2504('0x73'),_0x369f68[_0x2504('0x5e')][_0x2504('0x36')]);_0x1393b2[_0x2504('0x25')]['channel']=_0x1393b2[_0x2504('0x74')];_0x1393b2[_0x2504('0x25')]['motionChannel']=_0x1393b2[_0x2504('0x74')];_0x1393b2[_0x2504('0x25')]['event']=_0x2504('0x57');return respondWithRpcPromise(_0x2504('0x75'),_0x2504('0x75'),{'event':'acceptmessage','message':_0x1393b2[_0x2504('0x25')]},client9002)['then'](function(){return _0x1393b2;});}return _0x1393b2;}return null;})[_0x2504('0x1f')](respondWithResult(_0x482300,null))['catch'](handleError(_0x482300,null));};var interaction_log=require(_0x2504('0x13'))('fax-interactions');exports[_0x2504('0x76')]=function(_0x35c263,_0x194c92,_0x6ee4ee){var _0x46ccae={'agent':{},'channel':_0x2504('0x58')};if(_0x35c263['body']['id']){delete _0x35c263['body']['id'];}_0x35c263[_0x2504('0x54')][_0x2504('0x5d')]=_0x35c263[_0x2504('0x54')]['UserId']||_0x35c263[_0x2504('0x5e')]['id'];_0x46ccae[_0x2504('0x5f')]['id']=_0x35c263['body'][_0x2504('0x5d')];return db[_0x2504('0x39')][_0x2504('0x53')]({'where':{'id':_0x35c263['params']['id'],'UserId':null}})[_0x2504('0x1f')](handleEntityNotFound(_0x194c92,null))[_0x2504('0x1f')](function(_0x5dfab4){if(_0x5dfab4){_0x46ccae[_0x2504('0x25')]=_0x5dfab4['get']({'plain':!![]});return db[_0x2504('0x61')][_0x2504('0x53')]({'where':{'id':_0x5dfab4[_0x2504('0x62')]}});}return null;})[_0x2504('0x1f')](handleEntityNotFound(_0x194c92,null))['then'](function(_0x4632ce){if(_0x4632ce){_0x46ccae[_0x2504('0x65')]=_0x4632ce[_0x2504('0x60')]({'plain':!![]});interaction_log[_0x2504('0x20')](_0x2504('0x77'),_0x35c263['user']['id'],_0x35c263[_0x2504('0x5e')][_0x2504('0x36')],_0x35c263['user'][_0x2504('0x67')],_0x46ccae[_0x2504('0x65')]['id'],_0x35c263[_0x2504('0x54')]?JSON['stringify'](_0x35c263[_0x2504('0x54')]):_0x2504('0x78'));return respondWithRpcPromise(_0x2504('0x79'),'rejectMessage',_0x46ccae);}return null;})[_0x2504('0x1f')](function(_0x2fa7fc){var _0x2bdbb7=_0x2504('0x6a')+_0x2fa7fc[_0x2504('0x25')][_0x2504('0x7a')];return db['sequelize'][_0x2504('0x3e')](_0x2bdbb7,{'type':db['Sequelize'][_0x2504('0x6c')][_0x2504('0x6d')],'raw':!![]})[_0x2504('0x1f')](function(_0x5e10f6){return _0x5e10f6;});})[_0x2504('0x1f')](function(_0x45c2cc){if(_0x45c2cc){_0x46ccae['message'][_0x2504('0x7b')]=_0x45c2cc[0x0];if(!_0x35c263[_0x2504('0x54')]['UserId'])return;return db['User'][_0x2504('0x53')]({'where':{'id':_0x35c263[_0x2504('0x54')]['UserId'],'role':_0x2504('0x5f')},'attributes':['id',_0x2504('0x36'),_0x2504('0x6f'),_0x2504('0x70'),_0x2504('0x71')],'raw':!![]});}return null;})[_0x2504('0x1f')](function(_0x29ab16){if(!_0x29ab16)return null;_0x46ccae['message'][_0x2504('0x5f')]=_0x29ab16;return _0x46ccae;})[_0x2504('0x1f')](function(_0x17e1dd){if(_0x17e1dd){_0x17e1dd[_0x2504('0x25')][_0x2504('0x72')]=util[_0x2504('0x5b')](_0x2504('0x73'),_0x35c263[_0x2504('0x5e')][_0x2504('0x36')]);_0x17e1dd[_0x2504('0x25')][_0x2504('0x74')]=_0x46ccae[_0x2504('0x74')];_0x17e1dd[_0x2504('0x25')][_0x2504('0x7c')]=_0x46ccae[_0x2504('0x74')];_0x17e1dd[_0x2504('0x25')][_0x2504('0x7d')]='reject';respondWithRpcPromise(_0x2504('0x75'),_0x2504('0x75'),{'event':_0x2504('0x7e'),'message':_0x17e1dd['message']},client9002);return _0x46ccae;}return null;})[_0x2504('0x1f')](respondWithResult(_0x194c92,null))[_0x2504('0x27')](handleError(_0x194c92,null));};exports[_0x2504('0x7f')]=function(_0x58b24e,_0x262840){var _0x2a65f3;return db[_0x2504('0x39')][_0x2504('0x7f')](_0x58b24e[_0x2504('0x54')],{})[_0x2504('0x1f')](function(_0x4843bc){_0x2a65f3=_0x4843bc;return db[_0x2504('0x80')][_0x2504('0x81')]({'where':{'id':_0x2a65f3[_0x2504('0x7a')]}});})[_0x2504('0x1f')](function(_0x55b3e1){if(_[_0x2504('0x63')](_0x55b3e1)){return;}else{_0x2a65f3[_0x2504('0x58')]=_0x55b3e1[_0x2504('0x58')];return db[_0x2504('0x82')][_0x2504('0x81')]({'where':{'id':_0x2a65f3[_0x2504('0x83')]}});}})[_0x2504('0x1f')](function(_0x4153ef){return respondWithRpcPromise('SendFax',_0x2504('0x84'),{'FaxAccountId':_[_0x2504('0x63')](_0x58b24e[_0x2504('0x54')])?undefined:_0x58b24e[_0x2504('0x54')][_0x2504('0x85')],'path':_[_0x2504('0x63')](_0x4153ef)?undefined:util[_0x2504('0x5b')](_0x2504('0x86'),_0x4153ef['basename']),'fax':_[_0x2504('0x63')](_0x2a65f3[_0x2504('0x58')])?undefined:_0x2a65f3['fax'],'AttachmentId':_0x2a65f3[_0x2504('0x83')]},client9002);})[_0x2504('0x1f')](respondWithResult(_0x262840,0xc9))[_0x2504('0x27')](handleError(_0x262840,null));};exports[_0x2504('0x87')]=function(_0x91aa9d,_0x52543b){var _0x1dfc5a=path[_0x2504('0x88')](config[_0x2504('0x89')],'server',_0x2504('0x8a'),'attachments');return db[_0x2504('0x39')][_0x2504('0x53')]({'where':{'id':_0x91aa9d[_0x2504('0x51')]['id']},'include':[{'model':db[_0x2504('0x82')],'as':_0x2504('0x82')}]})[_0x2504('0x1f')](handleEntityNotFound(_0x52543b,null))[_0x2504('0x1f')](function(_0x4c5c75){if(_0x4c5c75){return _0x52543b[_0x2504('0x87')](path['join'](_0x1dfc5a,_0x4c5c75[_0x2504('0x82')][_0x2504('0x8b')]));}})[_0x2504('0x27')](handleError(_0x52543b,null));}; \ No newline at end of file +var _0x297f=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','jayson/promise','client','http','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','code','message','FaxMessage,\x20%s,\x20%s','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','map','FaxMessage','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','show','rawAttributes','catch','body','find','params','describe','fax-interactions','accept','fax','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','FaxInteractionId','read1stAt','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','contact','EventManager','create','CmContact','findOne','isNil','Attachment','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','AttachmentId','download','join','root','server','files','attachments','basename','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x297f,0x10f));var _0xf297=function(_0x3e64e5,_0xa6abd0){_0x3e64e5=_0x3e64e5-0x0;var _0x4c34d1=_0x297f[_0x3e64e5];return _0x4c34d1;};'use strict';var emlformat=require(_0xf297('0x0'));var rimraf=require(_0xf297('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf297('0x2'));var rp=require(_0xf297('0x3'));var moment=require(_0xf297('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf297('0x5'));var util=require(_0xf297('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf297('0x7'));var fs=require('fs');var fs_extra=require(_0xf297('0x8'));var _=require(_0xf297('0x9'));var squel=require(_0xf297('0xa'));var crypto=require(_0xf297('0xb'));var jsforce=require(_0xf297('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf297('0xd'));var querystring=require(_0xf297('0xe'));var Papa=require(_0xf297('0xf'));var Redis=require(_0xf297('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf297('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf297('0x12'));var logger=require(_0xf297('0x13'))(_0xf297('0x14'));var utils=require(_0xf297('0x15'));var config=require(_0xf297('0x16'));var licenseUtil=require(_0xf297('0x17'));var db=require(_0xf297('0x18'))['db'];config[_0xf297('0x19')]=_[_0xf297('0x1a')](config[_0xf297('0x19')],{'host':_0xf297('0x1b'),'port':0x18eb});var socket=require(_0xf297('0x1c'))(new Redis(config[_0xf297('0x19')]));require(_0xf297('0x1d'))['register'](socket);var jayson=require(_0xf297('0x1e'));var client=jayson[_0xf297('0x1f')][_0xf297('0x20')]({'port':0x232c});var client9002=jayson[_0xf297('0x1f')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56829d,_0x1f3220,_0x232f87,_0x8154c8){return new BPromise(function(_0x562aad,_0x48fbfd){var _0x2e93fa=_0x8154c8||client;return _0x2e93fa['request'](_0x56829d,_0x232f87)['then'](function(_0x31eba2){logger[_0xf297('0x21')]('FaxMessage,\x20%s,\x20%s',_0x1f3220,_0xf297('0x22'));logger[_0xf297('0x23')](_0xf297('0x24'),_0x1f3220,_0xf297('0x22'),JSON['stringify'](_0x31eba2));if(_0x31eba2['error']){if(_0x31eba2[_0xf297('0x25')][_0xf297('0x26')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x1f3220,_0x31eba2[_0xf297('0x25')][_0xf297('0x27')]);return _0x48fbfd(_0x31eba2[_0xf297('0x25')][_0xf297('0x27')]);}logger[_0xf297('0x25')]('FaxMessage,\x20%s,\x20%s',_0x1f3220,_0x31eba2[_0xf297('0x25')][_0xf297('0x27')]);return _0x562aad(_0x31eba2['error'][_0xf297('0x27')]);}else{logger[_0xf297('0x21')](_0xf297('0x28'),_0x1f3220,_0xf297('0x22'));_0x562aad(_0x31eba2[_0xf297('0x29')][_0xf297('0x27')]);}})['catch'](function(_0x18c616){logger['error']('FaxMessage,\x20%s,\x20%s',_0x1f3220,_0x18c616);_0x48fbfd(_0x18c616);});});}function respondWithStatusCode(_0x43bd3d,_0x1355a7){_0x1355a7=_0x1355a7||0xcc;return function(_0x22c3f6){if(_0x22c3f6){return _0x43bd3d[_0xf297('0x2a')](_0x1355a7);}return _0x43bd3d[_0xf297('0x2b')](_0x1355a7)[_0xf297('0x2c')]();};}function respondWithResult(_0x506d6b,_0x3e202d){_0x3e202d=_0x3e202d||0xc8;return function(_0x392e77){if(_0x392e77){return _0x506d6b[_0xf297('0x2b')](_0x3e202d)[_0xf297('0x2d')](_0x392e77);}};}function respondWithFilteredResult(_0x444bd6,_0xc809fa){return function(_0x512cc2){if(_0x512cc2){var _0x112fa9=typeof _0xc809fa[_0xf297('0x2e')]===_0xf297('0x2f')&&typeof _0xc809fa[_0xf297('0x30')]===_0xf297('0x2f');var _0x4abc56=_0x512cc2[_0xf297('0x31')];var _0x4076ae=_0x112fa9?0x0:_0xc809fa[_0xf297('0x2e')];var _0x143918=_0x112fa9?_0x512cc2[_0xf297('0x31')]:_0xc809fa[_0xf297('0x2e')]+_0xc809fa['limit'];var _0x274661;if(_0x143918>=_0x4abc56){_0x143918=_0x4abc56;_0x274661=0xc8;}else{_0x274661=0xce;}_0x444bd6['status'](_0x274661);return _0x444bd6[_0xf297('0x32')](_0xf297('0x33'),_0x4076ae+'-'+_0x143918+'/'+_0x4abc56)[_0xf297('0x2d')](_0x512cc2);}return null;};}function patchUpdates(_0x255a6f){return function(_0x9aae5b){try{jsonpatch['apply'](_0x9aae5b,_0x255a6f,!![]);}catch(_0x58108c){return BPromise[_0xf297('0x34')](_0x58108c);}return _0x9aae5b[_0xf297('0x35')]();};}function saveUpdates(_0x3f835a,_0x3475c5){return function(_0x34ee06){if(_0x34ee06){return _0x34ee06[_0xf297('0x36')](_0x3f835a)[_0xf297('0x37')](function(_0x1c674e){return _0x1c674e;});}return null;};}function removeEntity(_0x3198b4,_0x258f7e){return function(_0x4bc0d9){if(_0x4bc0d9){return _0x4bc0d9[_0xf297('0x38')]()[_0xf297('0x37')](function(){_0x3198b4[_0xf297('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ed3b6,_0x4b25db){return function(_0x411144){if(!_0x411144){_0x3ed3b6['sendStatus'](0x194);}return _0x411144;};}function handleError(_0x51cc33,_0xb1a28f){_0xb1a28f=_0xb1a28f||0x1f4;return function(_0xc11b3c){logger[_0xf297('0x25')](_0xc11b3c[_0xf297('0x39')]);if(_0xc11b3c[_0xf297('0x3a')]){delete _0xc11b3c[_0xf297('0x3a')];}_0x51cc33['status'](_0xb1a28f)['send'](_0xc11b3c);};}exports['index']=function(_0x4732a0,_0x24e264){var _0x46ab63={},_0x508fdc={},_0x2a3ef1={'count':0x0,'rows':[]};var _0x23d4c6=_[_0xf297('0x3b')](db[_0xf297('0x3c')]['rawAttributes'],function(_0x27a66c){return{'name':_0x27a66c[_0xf297('0x3d')],'type':_0x27a66c[_0xf297('0x3e')]['key']};});_0x508fdc['model']=_[_0xf297('0x3b')](_0x23d4c6,_0xf297('0x3a'));_0x508fdc['query']=_[_0xf297('0x3f')](_0x4732a0[_0xf297('0x40')]);_0x508fdc[_0xf297('0x41')]=_[_0xf297('0x42')](_0x508fdc[_0xf297('0x43')],_0x508fdc['query']);_0x46ab63[_0xf297('0x44')]=_[_0xf297('0x42')](_0x508fdc[_0xf297('0x43')],qs[_0xf297('0x45')](_0x4732a0[_0xf297('0x40')]['fields']));_0x46ab63[_0xf297('0x44')]=_0x46ab63[_0xf297('0x44')][_0xf297('0x46')]?_0x46ab63[_0xf297('0x44')]:_0x508fdc[_0xf297('0x43')];if(!_0x4732a0['query'][_0xf297('0x47')](_0xf297('0x48'))){_0x46ab63[_0xf297('0x30')]=qs[_0xf297('0x30')](_0x4732a0['query'][_0xf297('0x30')]);_0x46ab63['offset']=qs[_0xf297('0x2e')](_0x4732a0[_0xf297('0x40')][_0xf297('0x2e')]);}_0x46ab63[_0xf297('0x49')]=qs[_0xf297('0x4a')](_0x4732a0[_0xf297('0x40')][_0xf297('0x4a')]);_0x46ab63[_0xf297('0x4b')]=qs[_0xf297('0x41')](_[_0xf297('0x4c')](_0x4732a0[_0xf297('0x40')],_0x508fdc[_0xf297('0x41')]),_0x23d4c6);if(_0x4732a0[_0xf297('0x40')][_0xf297('0x4d')]){_0x46ab63[_0xf297('0x4b')]=_[_0xf297('0x4e')](_0x46ab63[_0xf297('0x4b')],{'$or':_[_0xf297('0x3b')](_0x23d4c6,function(_0x2bdbe7){if(_0x2bdbe7[_0xf297('0x3e')]!==_0xf297('0x4f')){var _0x302c14={};_0x302c14[_0x2bdbe7[_0xf297('0x3a')]]={'$like':'%'+_0x4732a0[_0xf297('0x40')][_0xf297('0x4d')]+'%'};return _0x302c14;}})});}_0x46ab63=_[_0xf297('0x4e')]({},_0x46ab63,_0x4732a0[_0xf297('0x50')]);var _0x534134={'where':_0x46ab63[_0xf297('0x4b')]};return db['FaxMessage']['count'](_0x534134)[_0xf297('0x37')](function(_0x252af8){_0x2a3ef1['count']=_0x252af8;if(_0x4732a0[_0xf297('0x40')][_0xf297('0x51')]){_0x46ab63[_0xf297('0x52')]=[{'all':!![]}];}return db[_0xf297('0x3c')]['findAll'](_0x46ab63);})[_0xf297('0x37')](function(_0x4d3f96){_0x2a3ef1['rows']=_0x4d3f96;return _0x2a3ef1;})[_0xf297('0x37')](respondWithFilteredResult(_0x24e264,_0x46ab63))['catch'](handleError(_0x24e264,null));};exports[_0xf297('0x53')]=function(_0x261f52,_0x3b692d){var _0x35ec8a={'raw':!![],'where':{'id':_0x261f52['params']['id']}},_0x14e125={};_0x14e125[_0xf297('0x43')]=_[_0xf297('0x3f')](db['FaxMessage'][_0xf297('0x54')]);_0x14e125['query']=_['keys'](_0x261f52[_0xf297('0x40')]);_0x14e125[_0xf297('0x41')]=_[_0xf297('0x42')](_0x14e125['model'],_0x14e125['query']);_0x35ec8a[_0xf297('0x44')]=_[_0xf297('0x42')](_0x14e125['model'],qs['fields'](_0x261f52[_0xf297('0x40')][_0xf297('0x45')]));_0x35ec8a['attributes']=_0x35ec8a[_0xf297('0x44')][_0xf297('0x46')]?_0x35ec8a[_0xf297('0x44')]:_0x14e125['model'];if(_0x261f52['query'][_0xf297('0x51')]){_0x35ec8a[_0xf297('0x52')]=[{'all':!![]}];}_0x35ec8a=_[_0xf297('0x4e')]({},_0x35ec8a,_0x261f52['options']);return db[_0xf297('0x3c')]['find'](_0x35ec8a)['then'](handleEntityNotFound(_0x3b692d,null))[_0xf297('0x37')](respondWithResult(_0x3b692d,null))[_0xf297('0x55')](handleError(_0x3b692d,null));};exports[_0xf297('0x36')]=function(_0x3d42c4,_0x12ea62){if(_0x3d42c4[_0xf297('0x56')]['id']){delete _0x3d42c4[_0xf297('0x56')]['id'];}return db[_0xf297('0x3c')][_0xf297('0x57')]({'where':{'id':_0x3d42c4[_0xf297('0x58')]['id']}})[_0xf297('0x37')](handleEntityNotFound(_0x12ea62,null))[_0xf297('0x37')](saveUpdates(_0x3d42c4[_0xf297('0x56')],null))[_0xf297('0x37')](respondWithResult(_0x12ea62,null))[_0xf297('0x55')](handleError(_0x12ea62,null));};exports[_0xf297('0x38')]=function(_0x34b26f,_0x132a32){return db[_0xf297('0x3c')][_0xf297('0x57')]({'where':{'id':_0x34b26f[_0xf297('0x58')]['id']}})[_0xf297('0x37')](handleEntityNotFound(_0x132a32,null))['then'](removeEntity(_0x132a32,null))[_0xf297('0x55')](handleError(_0x132a32,null));};exports['describe']=function(_0x32b9f5,_0x4053e4){return db[_0xf297('0x3c')][_0xf297('0x59')]()[_0xf297('0x37')](respondWithResult(_0x4053e4,null))['catch'](handleError(_0x4053e4,null));};var interaction_log=require(_0xf297('0x13'))(_0xf297('0x5a'));exports[_0xf297('0x5b')]=function(_0x39f463,_0x29d0dc,_0x16a23e){var _0x172008={'agent':{},'channel':_0xf297('0x5c')};if(_0x39f463[_0xf297('0x56')]['id']){delete _0x39f463[_0xf297('0x56')]['id'];}_0x39f463[_0xf297('0x56')]['read']=!![];_0x39f463['body'][_0xf297('0x5d')]=moment()[_0xf297('0x5e')](_0xf297('0x5f'));_0x39f463[_0xf297('0x56')]['UserId']=_0x39f463[_0xf297('0x56')][_0xf297('0x60')]||_0x39f463[_0xf297('0x61')]['id'];_0x172008['agent']['id']=_0x39f463[_0xf297('0x56')]['UserId'];return db[_0xf297('0x3c')]['find']({'where':{'id':_0x39f463['params']['id'],'UserId':null}})[_0xf297('0x37')](handleEntityNotFound(_0x29d0dc,null))[_0xf297('0x37')](saveUpdates(_0x39f463['body'],null))[_0xf297('0x37')](function(_0x3907a3){if(_0x3907a3){_0x172008[_0xf297('0x27')]=_0x3907a3['get']({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0x3907a3[_0xf297('0x62')]}});}return null;})[_0xf297('0x37')](handleEntityNotFound(_0x29d0dc,null))[_0xf297('0x37')](function(_0x2a4bf7){if(_0x2a4bf7){return _0x2a4bf7['update']({'UserId':_0x39f463[_0xf297('0x56')]['UserId'],'read1stAt':_['isNil'](_0x2a4bf7[_0xf297('0x63')])?moment()[_0xf297('0x5e')](_0xf297('0x5f')):undefined});}return null;})[_0xf297('0x37')](function(_0x5cca92){if(_0x5cca92){_0x172008[_0xf297('0x64')]=_0x5cca92[_0xf297('0x65')]({'plain':!![]});interaction_log[_0xf297('0x21')](_0xf297('0x66'),_0x39f463['user']['id'],_0x39f463[_0xf297('0x61')]['name'],_0x39f463['user']['role'],_0x172008[_0xf297('0x64')]['id'],_0x39f463[_0xf297('0x56')]?JSON[_0xf297('0x67')](_0x39f463[_0xf297('0x56')]):'null');return respondWithRpcPromise(_0xf297('0x68'),_0xf297('0x69'),_0x172008);}return null;})[_0xf297('0x37')](function(_0x2f40bb){var _0x416423=_0xf297('0x6a')+_0x2f40bb[_0xf297('0x27')][_0xf297('0x6b')];return db[_0xf297('0x6c')][_0xf297('0x40')](_0x416423,{'type':db[_0xf297('0x6d')][_0xf297('0x6e')][_0xf297('0x6f')],'raw':!![]})[_0xf297('0x37')](function(_0x5dffa7){return _0x5dffa7;});})[_0xf297('0x37')](function(_0x5a0082){if(_0x5a0082){_0x172008['message']['contact']=_0x5a0082[0x0];if(!_0x39f463['body'][_0xf297('0x60')])return;return db[_0xf297('0x70')][_0xf297('0x57')]({'where':{'id':_0x39f463[_0xf297('0x56')]['UserId'],'role':_0xf297('0x71')},'attributes':['id',_0xf297('0x3a'),_0xf297('0x72'),_0xf297('0x73'),_0xf297('0x74')],'raw':!![]});}return null;})['then'](function(_0x5df7c4){if(!_0x5df7c4)return null;_0x172008[_0xf297('0x27')]['agent']=_0x5df7c4;return _0x172008;})['then'](function(_0x54ed85){if(_0x54ed85){if(_0x39f463[_0xf297('0x56')][_0xf297('0x75')]){_0x172008[_0xf297('0x27')][_0xf297('0x76')]=util[_0xf297('0x5e')](_0xf297('0x77'),_0x39f463[_0xf297('0x61')][_0xf297('0x3a')]);_0x172008['message'][_0xf297('0x78')]=_0x172008[_0xf297('0x78')];_0x172008['message'][_0xf297('0x79')]=_0x172008[_0xf297('0x78')];_0x172008[_0xf297('0x27')][_0xf297('0x7a')]='accept';return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x172008['message']},client9002)[_0xf297('0x37')](function(){return _0x172008;});}return _0x172008;}return null;})[_0xf297('0x37')](respondWithResult(_0x29d0dc,null))[_0xf297('0x55')](handleError(_0x29d0dc,null));};var interaction_log=require(_0xf297('0x13'))(_0xf297('0x5a'));exports[_0xf297('0x34')]=function(_0x347cf1,_0x3da588,_0x442c43){var _0x306278={'agent':{},'channel':_0xf297('0x5c')};if(_0x347cf1[_0xf297('0x56')]['id']){delete _0x347cf1[_0xf297('0x56')]['id'];}_0x347cf1[_0xf297('0x56')][_0xf297('0x60')]=_0x347cf1[_0xf297('0x56')]['UserId']||_0x347cf1[_0xf297('0x61')]['id'];_0x306278[_0xf297('0x71')]['id']=_0x347cf1[_0xf297('0x56')][_0xf297('0x60')];return db[_0xf297('0x3c')][_0xf297('0x57')]({'where':{'id':_0x347cf1[_0xf297('0x58')]['id'],'UserId':null}})[_0xf297('0x37')](handleEntityNotFound(_0x3da588,null))[_0xf297('0x37')](function(_0x4688dc){if(_0x4688dc){_0x306278[_0xf297('0x27')]=_0x4688dc[_0xf297('0x65')]({'plain':!![]});return db[_0xf297('0x7b')][_0xf297('0x57')]({'where':{'id':_0x4688dc['FaxInteractionId']}});}return null;})[_0xf297('0x37')](handleEntityNotFound(_0x3da588,null))[_0xf297('0x37')](function(_0x3c04d3){if(_0x3c04d3){_0x306278[_0xf297('0x64')]=_0x3c04d3['get']({'plain':!![]});interaction_log[_0xf297('0x21')](_0xf297('0x7c'),_0x347cf1[_0xf297('0x61')]['id'],_0x347cf1['user']['name'],_0x347cf1['user'][_0xf297('0x7d')],_0x306278[_0xf297('0x64')]['id'],_0x347cf1[_0xf297('0x56')]?JSON[_0xf297('0x67')](_0x347cf1[_0xf297('0x56')]):_0xf297('0x7e'));return respondWithRpcPromise(_0xf297('0x7f'),'rejectMessage',_0x306278);}return null;})[_0xf297('0x37')](function(_0x2d5e7e){var _0x5b9a54='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2d5e7e[_0xf297('0x27')][_0xf297('0x6b')];return db['sequelize'][_0xf297('0x40')](_0x5b9a54,{'type':db[_0xf297('0x6d')][_0xf297('0x6e')]['SELECT'],'raw':!![]})[_0xf297('0x37')](function(_0x5225a6){return _0x5225a6;});})[_0xf297('0x37')](function(_0xf34db1){if(_0xf34db1){_0x306278[_0xf297('0x27')][_0xf297('0x80')]=_0xf34db1[0x0];if(!_0x347cf1[_0xf297('0x56')]['UserId'])return;return db[_0xf297('0x70')]['find']({'where':{'id':_0x347cf1['body'][_0xf297('0x60')],'role':'agent'},'attributes':['id',_0xf297('0x3a'),_0xf297('0x72'),_0xf297('0x73'),_0xf297('0x74')],'raw':!![]});}return null;})[_0xf297('0x37')](function(_0x50796f){if(!_0x50796f)return null;_0x306278[_0xf297('0x27')][_0xf297('0x71')]=_0x50796f;return _0x306278;})[_0xf297('0x37')](function(_0x3d477c){if(_0x3d477c){_0x3d477c[_0xf297('0x27')][_0xf297('0x76')]=util['format'](_0xf297('0x77'),_0x347cf1['user'][_0xf297('0x3a')]);_0x3d477c[_0xf297('0x27')][_0xf297('0x78')]=_0x306278[_0xf297('0x78')];_0x3d477c[_0xf297('0x27')][_0xf297('0x79')]=_0x306278[_0xf297('0x78')];_0x3d477c[_0xf297('0x27')][_0xf297('0x7a')]=_0xf297('0x34');respondWithRpcPromise('EventManager',_0xf297('0x81'),{'event':'rejectmessage','message':_0x3d477c['message']},client9002);return _0x306278;}return null;})['then'](respondWithResult(_0x3da588,null))[_0xf297('0x55')](handleError(_0x3da588,null));};exports[_0xf297('0x82')]=function(_0x20105f,_0x4299b4){var _0x3817e0;return db[_0xf297('0x3c')][_0xf297('0x82')](_0x20105f[_0xf297('0x56')],{})['then'](function(_0x2659e0){_0x3817e0=_0x2659e0;return db[_0xf297('0x83')][_0xf297('0x84')]({'where':{'id':_0x3817e0['ContactId']}});})[_0xf297('0x37')](function(_0x4a1a80){if(_[_0xf297('0x85')](_0x4a1a80)){return;}else{_0x3817e0[_0xf297('0x5c')]=_0x4a1a80['fax'];return db[_0xf297('0x86')][_0xf297('0x84')]({'where':{'id':_0x3817e0['AttachmentId']}});}})['then'](function(_0x3d9200){return respondWithRpcPromise('SendFax',_0xf297('0x87'),{'FaxAccountId':_['isNil'](_0x20105f[_0xf297('0x56')])?undefined:_0x20105f[_0xf297('0x56')][_0xf297('0x88')],'path':_['isNil'](_0x3d9200)?undefined:util['format'](_0xf297('0x89'),_0x3d9200['basename']),'fax':_[_0xf297('0x85')](_0x3817e0[_0xf297('0x5c')])?undefined:_0x3817e0['fax'],'AttachmentId':_0x3817e0[_0xf297('0x8a')]},client9002);})[_0xf297('0x37')](respondWithResult(_0x4299b4,0xc9))[_0xf297('0x55')](handleError(_0x4299b4,null));};exports[_0xf297('0x8b')]=function(_0x661bed,_0x3932f3){var _0xe91d7e=path[_0xf297('0x8c')](config[_0xf297('0x8d')],_0xf297('0x8e'),_0xf297('0x8f'),_0xf297('0x90'));return db['FaxMessage'][_0xf297('0x57')]({'where':{'id':_0x661bed[_0xf297('0x58')]['id']},'include':[{'model':db[_0xf297('0x86')],'as':'Attachment'}]})[_0xf297('0x37')](handleEntityNotFound(_0x3932f3,null))[_0xf297('0x37')](function(_0x2e7c7d){if(_0x2e7c7d){return _0x3932f3[_0xf297('0x8b')](path[_0xf297('0x8c')](_0xe91d7e,_0x2e7c7d[_0xf297('0x86')][_0xf297('0x91')]));}})[_0xf297('0x55')](handleError(_0x3932f3,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index bd19b35..ae85e0a 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 _0x15ef=['../../mysqldb','FaxMessage','save','update','remove','emit','hook','exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x15ef,0x80));var _0xf15e=function(_0x42bb6d,_0x412255){_0x42bb6d=_0x42bb6d-0x0;var _0x1db89b=_0x15ef[_0x42bb6d];return _0x1db89b;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0xf15e('0x0'))['db'][_0xf15e('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf15e('0x2'),'afterUpdate':_0xf15e('0x3'),'afterDestroy':_0xf15e('0x4')};function emitEvent(_0x347c12){return function(_0x4e7241,_0x5d456b,_0x1b9a24){FaxMessageEvents[_0xf15e('0x5')](_0x347c12+':'+_0x4e7241['id'],_0x4e7241);FaxMessageEvents['emit'](_0x347c12,_0x4e7241);_0x1b9a24(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0xf15e('0x6')](e,emitEvent(event));}}module[_0xf15e('0x7')]=FaxMessageEvents; \ No newline at end of file +var _0x7c71=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxMessage','setMaxListeners','update'];(function(_0x23e54c,_0x22e97){var _0x5466cf=function(_0x5a310b){while(--_0x5a310b){_0x23e54c['push'](_0x23e54c['shift']());}};_0x5466cf(++_0x22e97);}(_0x7c71,0x177));var _0x17c7=function(_0x507403,_0x3f954d){_0x507403=_0x507403-0x0;var _0x1327c=_0x7c71[_0x507403];return _0x1327c;};'use strict';var EventEmitter=require(_0x17c7('0x0'));var FaxMessage=require(_0x17c7('0x1'))['db'][_0x17c7('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x17c7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x17c7('0x4'),'afterDestroy':_0x17c7('0x5')};function emitEvent(_0x3f9105){return function(_0x5a4923,_0x4fed29,_0xa4e319){FaxMessageEvents[_0x17c7('0x6')](_0x3f9105+':'+_0x5a4923['id'],_0x5a4923);FaxMessageEvents[_0x17c7('0x6')](_0x3f9105,_0x5a4923);_0xa4e319(null);};}for(var e in events){if(events[_0x17c7('0x7')](e)){var event=events[e];FaxMessage[_0x17c7('0x8')](e,emitEvent(event));}}module[_0x17c7('0x9')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index e7b466d..5cd0c1e 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 _0xcaa8=['request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','FaxInteractionId','then','update','createdAt','catch','utf8mb4','util','../../config/logger','api','moment','bluebird'];(function(_0x21fec0,_0x2f9a99){var _0xcf272e=function(_0x18e35d){while(--_0x18e35d){_0x21fec0['push'](_0x21fec0['shift']());}};_0xcf272e(++_0x2f9a99);}(_0xcaa8,0x91));var _0x8caa=function(_0x431b58,_0x55b217){_0x431b58=_0x431b58-0x0;var _0x354f15=_0xcaa8[_0x431b58];return _0x354f15;};'use strict';var _=require('lodash');var util=require(_0x8caa('0x0'));var logger=require(_0x8caa('0x1'))(_0x8caa('0x2'));var moment=require(_0x8caa('0x3'));var BPromise=require(_0x8caa('0x4'));var rp=require(_0x8caa('0x5'));var fs=require('fs');var path=require(_0x8caa('0x6'));var rimraf=require(_0x8caa('0x7'));var config=require(_0x8caa('0x8'));var attributes=require(_0x8caa('0x9'));module[_0x8caa('0xa')]=function(_0x1ce8b7,_0x4aeab2){return _0x1ce8b7[_0x8caa('0xb')](_0x8caa('0xc'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x8caa('0xd')],'type':_0x8caa('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x25f28c,_0x4db35d,_0x584f3c){var _0x29aa3b=_0x1ce8b7[_0x8caa('0xf')];var _0x23e385=_0x25f28c[_0x8caa('0x10')]({'plain':!![]});if(_0x23e385[_0x8caa('0x11')]['toLowerCase']()==='in'||_0x23e385['direction'][_0x8caa('0x12')]()===_0x8caa('0x13')&&!_0x23e385[_0x8caa('0x14')]&&!_[_0x8caa('0x15')](_0x23e385[_0x8caa('0x16')])){_0x29aa3b[_0x8caa('0x17')]['findOne']({'where':{'id':_0x23e385[_0x8caa('0x18')]}})[_0x8caa('0x19')](function(_0x36f518){if(_0x36f518){_0x36f518[_0x8caa('0x1a')]({'lastMsgAt':_0x23e385[_0x8caa('0x1b')],'lastMsgDirection':_0x23e385['direction'][_0x8caa('0x12')]()});}})[_0x8caa('0x1c')](function(_0x2db086){console['error'](_0x2db086);});}_0x584f3c();}},'charset':_0x8caa('0x1d'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x86fd=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./faxMessage.attributes','exports','define','FaxMessage','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','FaxInteraction','findOne','FaxInteractionId','update','createdAt','catch','error'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x86fd,0x195));var _0xd86f=function(_0x3e69ae,_0x366e8d){_0x3e69ae=_0x3e69ae-0x0;var _0x3d7f42=_0x86fd[_0x3e69ae];return _0x3d7f42;};'use strict';var _=require(_0xd86f('0x0'));var util=require(_0xd86f('0x1'));var logger=require(_0xd86f('0x2'))(_0xd86f('0x3'));var moment=require(_0xd86f('0x4'));var BPromise=require(_0xd86f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd86f('0x6'));var rimraf=require(_0xd86f('0x7'));var config=require('../../config/environment');var attributes=require(_0xd86f('0x8'));module[_0xd86f('0x9')]=function(_0x37363b,_0x2aa510){return _0x37363b[_0xd86f('0xa')](_0xd86f('0xb'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0xd86f('0xc'),'fields':[_0xd86f('0xd')],'type':_0xd86f('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x50d322,_0x54085d,_0xfeebd9){var _0x59be8b=_0x37363b[_0xd86f('0xf')];var _0x166cb0=_0x50d322[_0xd86f('0x10')]({'plain':!![]});if(_0x166cb0[_0xd86f('0x11')]['toLowerCase']()==='in'||_0x166cb0[_0xd86f('0x11')][_0xd86f('0x12')]()===_0xd86f('0x13')&&!_0x166cb0[_0xd86f('0x14')]&&!_['isNil'](_0x166cb0[_0xd86f('0x15')])){_0x59be8b[_0xd86f('0x16')][_0xd86f('0x17')]({'where':{'id':_0x166cb0[_0xd86f('0x18')]}})['then'](function(_0x49a150){if(_0x49a150){_0x49a150[_0xd86f('0x19')]({'lastMsgAt':_0x166cb0[_0xd86f('0x1a')],'lastMsgDirection':_0x166cb0[_0xd86f('0x11')][_0xd86f('0x12')]()});}})[_0xd86f('0x1b')](function(_0x3427de){console[_0xd86f('0x1c')](_0x3427de);});}_0xfeebd9();}},'charset':_0xd86f('0x1d'),'collate':_0xd86f('0x1e')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index b476112..6090d3f 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(_0x2cbb30,_0x74f546){var _0x534561=function(_0x33bc3b){while(--_0x33bc3b){_0x2cbb30['push'](_0x2cbb30['shift']());}};_0x534561(++_0x74f546);}(_0x81bd,0x7c));var _0xd81b=function(_0xd1cf76,_0x1e667d){_0xd1cf76=_0xd1cf76-0x0;var _0x580cbf=_0x81bd[_0xd1cf76];return _0x580cbf;};'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 _0xed1f=['jayson/promise','client','http','redis','defaults','localhost','./faxMessage.socket','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','CreateFaxMessage','FaxMessage','create','body','options','raw','info','catch','UpdateFaxMessage','update','attributes','limit','debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xed1f,0x6a));var _0xfed1=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0xed1f[_0x36ed3c];return _0x52a2e0;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var moment=require(_0xfed1('0x2'));var BPromise=require(_0xfed1('0x3'));var rs=require(_0xfed1('0x4'));var fs=require('fs');var Redis=require(_0xfed1('0x5'));var db=require(_0xfed1('0x6'))['db'];var utils=require(_0xfed1('0x7'));var logger=require(_0xfed1('0x8'))(_0xfed1('0x9'));var config=require(_0xfed1('0xa'));var jayson=require(_0xfed1('0xb'));var client=jayson[_0xfed1('0xc')][_0xfed1('0xd')]({'port':0x232a});config[_0xfed1('0xe')]=_[_0xfed1('0xf')](config[_0xfed1('0xe')],{'host':_0xfed1('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfed1('0xe')]));require(_0xfed1('0x11'))['register'](socket);function respondWithRpcPromise(_0x1414be,_0x7bf48c,_0x4a564e){return new BPromise(function(_0x3ce017,_0x48c338){return client[_0xfed1('0x12')](_0x1414be,_0x4a564e)[_0xfed1('0x13')](function(_0x4a8369){logger['info'](_0xfed1('0x14'),_0x7bf48c,_0xfed1('0x15'));logger['debug'](_0xfed1('0x16'),_0x7bf48c,'request\x20sent',JSON['stringify'](_0x4a8369));if(_0x4a8369[_0xfed1('0x17')]){if(_0x4a8369[_0xfed1('0x17')]['code']===0x1f4){logger[_0xfed1('0x17')]('FaxMessage,\x20%s,\x20%s',_0x7bf48c,_0x4a8369['error'][_0xfed1('0x18')]);return _0x48c338(_0x4a8369[_0xfed1('0x17')][_0xfed1('0x18')]);}logger[_0xfed1('0x17')]('FaxMessage,\x20%s,\x20%s',_0x7bf48c,_0x4a8369[_0xfed1('0x17')]['message']);return _0x3ce017(_0x4a8369[_0xfed1('0x17')][_0xfed1('0x18')]);}else{logger['info'](_0xfed1('0x14'),_0x7bf48c,_0xfed1('0x15'));_0x3ce017(_0x4a8369['result']['message']);}})['catch'](function(_0x1e5afb){logger['error'](_0xfed1('0x14'),_0x7bf48c,_0x1e5afb);_0x48c338(_0x1e5afb);});});}exports[_0xfed1('0x19')]=function(_0x51a860){var _0x94cb84=this;return new Promise(function(_0x65f14b,_0x59ee9d){return db[_0xfed1('0x1a')][_0xfed1('0x1b')](_0x51a860[_0xfed1('0x1c')],{'raw':_0x51a860[_0xfed1('0x1d')]?_0x51a860['options'][_0xfed1('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x446558){logger[_0xfed1('0x1f')](_0xfed1('0x19'),_0x51a860);logger['debug'](_0xfed1('0x19'),_0x51a860,JSON['stringify'](_0x446558));_0x65f14b(_0x446558);})[_0xfed1('0x20')](function(_0x2793b7){logger[_0xfed1('0x17')](_0xfed1('0x19'),_0x2793b7[_0xfed1('0x18')],_0x51a860);_0x59ee9d(_0x94cb84[_0xfed1('0x17')](0x1f4,_0x2793b7['message']));});});};exports[_0xfed1('0x21')]=function(_0xcb1cdc){var _0x49072b=this;return new Promise(function(_0x1d6c72,_0x2b9dd2){return db[_0xfed1('0x1a')][_0xfed1('0x22')](_0xcb1cdc[_0xfed1('0x1c')],{'raw':_0xcb1cdc[_0xfed1('0x1d')]?_0xcb1cdc['options'][_0xfed1('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcb1cdc['options']?_0xcb1cdc[_0xfed1('0x1d')]['where']||null:null,'attributes':_0xcb1cdc['options']?_0xcb1cdc[_0xfed1('0x1d')][_0xfed1('0x23')]||null:null,'limit':_0xcb1cdc[_0xfed1('0x1d')]?_0xcb1cdc['options'][_0xfed1('0x24')]||null:null})[_0xfed1('0x13')](function(_0x13f414){logger[_0xfed1('0x1f')](_0xfed1('0x21'),_0xcb1cdc);logger[_0xfed1('0x25')]('UpdateFaxMessage',_0xcb1cdc,JSON[_0xfed1('0x26')](_0x13f414));_0x1d6c72(_0x13f414);})[_0xfed1('0x20')](function(_0x4fc309){logger['error'](_0xfed1('0x21'),_0x4fc309[_0xfed1('0x18')],_0xcb1cdc);_0x2b9dd2(_0x49072b[_0xfed1('0x17')](0x1f4,_0x4fc309[_0xfed1('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index d04beb3..87a29eb 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 _0x690e=['emit','removeListener','length','faxMessage:','save'];(function(_0x420be7,_0x2c1b41){var _0x5ba75d=function(_0x5bbe1b){while(--_0x5bbe1b){_0x420be7['push'](_0x420be7['shift']());}};_0x5ba75d(++_0x2c1b41);}(_0x690e,0x13f));var _0xe690=function(_0x2754bb,_0x4b1cd5){_0x2754bb=_0x2754bb-0x0;var _0x5e0fea=_0x690e[_0x2754bb];return _0x5e0fea;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0xe690('0x0'),'remove','update'];function createListener(_0x363d2f,_0x351e6f){return function(_0x51f10f){_0x351e6f[_0xe690('0x1')](_0x363d2f,_0x51f10f);};}function removeListener(_0x38437e,_0x46de2e){return function(){FaxMessageEvents[_0xe690('0x2')](_0x38437e,_0x46de2e);};}exports['register']=function(_0x504fcd){for(var _0x38db4a=0x0,_0x352717=events[_0xe690('0x3')];_0x38db4a<_0x352717;_0x38db4a++){var _0x25dfdf=events[_0x38db4a];var _0x528eff=createListener(_0xe690('0x4')+_0x25dfdf,_0x504fcd);FaxMessageEvents['on'](_0x25dfdf,_0x528eff);}}; \ No newline at end of file +var _0x89d4=['length','faxMessage:','save','update','removeListener','register'];(function(_0x2ca02b,_0x375a3d){var _0x5f004c=function(_0x5d0997){while(--_0x5d0997){_0x2ca02b['push'](_0x2ca02b['shift']());}};_0x5f004c(++_0x375a3d);}(_0x89d4,0xb6));var _0x489d=function(_0x13b7fd,_0x4eaf7f){_0x13b7fd=_0x13b7fd-0x0;var _0x32a74a=_0x89d4[_0x13b7fd];return _0x32a74a;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0x489d('0x0'),'remove',_0x489d('0x1')];function createListener(_0xc695df,_0x55f054){return function(_0x5942a7){_0x55f054['emit'](_0xc695df,_0x5942a7);};}function removeListener(_0x53ebce,_0x17904f){return function(){FaxMessageEvents[_0x489d('0x2')](_0x53ebce,_0x17904f);};}exports[_0x489d('0x3')]=function(_0x2f39b0){for(var _0xe3adf9=0x0,_0x388787=events[_0x489d('0x4')];_0xe3adf9<_0x388787;_0xe3adf9++){var _0xe46962=events[_0xe3adf9];var _0xddb227=createListener(_0x489d('0x5')+_0xe46962,_0x2f39b0);FaxMessageEvents['on'](_0xe46962,_0xddb227);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index f6db995..04e3016 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 _0x6324=['path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','show','download','post','tracked','fax','faxmessage:create','create','/:id','update','put','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util'];(function(_0x409fcd,_0x25aef2){var _0x14dda3=function(_0x2557e6){while(--_0x2557e6){_0x409fcd['push'](_0x409fcd['shift']());}};_0x14dda3(++_0x25aef2);}(_0x6324,0x142));var _0x4632=function(_0x5be652,_0x129d44){_0x5be652=_0x5be652-0x0;var _0x3c89da=_0x6324[_0x5be652];return _0x3c89da;};'use strict';var multer=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var path=require(_0x4632('0x2'));var timeout=require(_0x4632('0x3'));var express=require('express');var router=express[_0x4632('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4632('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4632('0x6'));var controller=require('./faxMessage.controller');router[_0x4632('0x7')]('/',auth[_0x4632('0x8')](),controller[_0x4632('0x9')]);router[_0x4632('0x7')]('/describe',auth[_0x4632('0x8')](),controller[_0x4632('0xa')]);router[_0x4632('0x7')]('/:id',auth[_0x4632('0x8')](),controller[_0x4632('0xb')]);router['get']('/:id/download',auth[_0x4632('0x8')](),controller[_0x4632('0xc')]);router[_0x4632('0xd')]('/',auth[_0x4632('0x8')](),interaction[_0x4632('0xe')](_0x4632('0xf'),_0x4632('0x10')),controller[_0x4632('0x11')]);router['put'](_0x4632('0x12'),auth['isAuthenticated'](),controller[_0x4632('0x13')]);router[_0x4632('0x14')](_0x4632('0x15'),auth[_0x4632('0x8')](),controller['accept']);router[_0x4632('0x14')](_0x4632('0x16'),auth[_0x4632('0x8')](),controller[_0x4632('0x17')]);router[_0x4632('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x4632('0x19')]);module[_0x4632('0x1a')]=router; \ No newline at end of file +var _0xcea2=['create','put','update','/:id/accept','accept','reject','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxMessage.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/download','download','post','tracked'];(function(_0x33c70e,_0xd8cb0b){var _0x5a33e5=function(_0x3b7f9d){while(--_0x3b7f9d){_0x33c70e['push'](_0x33c70e['shift']());}};_0x5a33e5(++_0xd8cb0b);}(_0xcea2,0x15a));var _0x2cea=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xcea2[_0x1ccdf7];return _0x52a0ae;};'use strict';var multer=require(_0x2cea('0x0'));var util=require('util');var path=require(_0x2cea('0x1'));var timeout=require('connect-timeout');var express=require(_0x2cea('0x2'));var router=express[_0x2cea('0x3')]();var fs_extra=require(_0x2cea('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2cea('0x5'));var config=require(_0x2cea('0x6'));var controller=require(_0x2cea('0x7'));router['get']('/',auth[_0x2cea('0x8')](),controller['index']);router[_0x2cea('0x9')](_0x2cea('0xa'),auth[_0x2cea('0x8')](),controller[_0x2cea('0xb')]);router[_0x2cea('0x9')](_0x2cea('0xc'),auth['isAuthenticated'](),controller[_0x2cea('0xd')]);router[_0x2cea('0x9')](_0x2cea('0xe'),auth[_0x2cea('0x8')](),controller[_0x2cea('0xf')]);router[_0x2cea('0x10')]('/',auth[_0x2cea('0x8')](),interaction[_0x2cea('0x11')]('fax','faxmessage:create'),controller[_0x2cea('0x12')]);router[_0x2cea('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x2cea('0x14')]);router['put'](_0x2cea('0x15'),auth[_0x2cea('0x8')](),controller[_0x2cea('0x16')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0x2cea('0x17')]);router['delete'](_0x2cea('0xc'),auth[_0x2cea('0x8')](),controller[_0x2cea('0x18')]);module[_0x2cea('0x19')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index b398d7d..667bb19 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 _0x5eca=['name','ENUM','roundrobin','INTEGER','sequelize','exports','STRING'];(function(_0x35027d,_0x3d97c1){var _0x537880=function(_0xd691f5){while(--_0xd691f5){_0x35027d['push'](_0x35027d['shift']());}};_0x537880(++_0x3d97c1);}(_0x5eca,0x10e));var _0xa5ec=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5eca[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0xa5ec('0x0'));module[_0xa5ec('0x1')]={'name':{'type':Sequelize[_0xa5ec('0x2')],'unique':_0xa5ec('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa5ec('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa5ec('0x4')]('rrmemory','beepall',_0xa5ec('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xa5ec('0x6')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2c8f=['ENUM','rrmemory','exports','INTEGER'];(function(_0x503564,_0x55867e){var _0x4be9fd=function(_0x41c543){while(--_0x41c543){_0x503564['push'](_0x503564['shift']());}};_0x4be9fd(++_0x55867e);}(_0x2c8f,0x192));var _0xf2c8=function(_0x8d9771,_0x1a1d49){_0x8d9771=_0x8d9771-0x0;var _0x2d98f9=_0x2c8f[_0x8d9771];return _0x2d98f9;};'use strict';var Sequelize=require('sequelize');module[_0xf2c8('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xf2c8('0x1')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf2c8('0x2')](_0xf2c8('0x3'),'beepall','roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xf2c8('0x1')],'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 da0b303..34ecf21 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 _0x2d2c=['undefined','count','limit','set','Content-Range','json','update','destroy','get','FaxQueues','UserProfileResource','then','error','stack','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','getOptions','include','query','rows','catch','params','model','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','describe','findOne','nolimit','sort','where','pick','FaxQueueId','filter','findAll','User','agent','createdAt','%s/%s','SIP','faxPause','updatedAt','Team','order','getTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','UserFaxQueue','findOrCreate','emit','removeTeams','ids','select','field','tq.TeamId','from','team_has_fax_queues','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','all','union','compact','value','removeAgents','addAgents','omit','userFaxQueue:save','isArray','userFaxQueue:remove','getAgents','hasOwnProperty','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','api','../../mysqldb','redis','defaults','localhost','./faxQueue.socket','register','sendStatus','status','end','offset'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x2d2c,0x1d7));var _0xc2d2=function(_0x2d994d,_0x168a27){_0x2d994d=_0x2d994d-0x0;var _0xd54be4=_0x2d2c[_0x2d994d];return _0xd54be4;};'use strict';var BPromise=require(_0xc2d2('0x0'));var util=require(_0xc2d2('0x1'));var _=require(_0xc2d2('0x2'));var squel=require(_0xc2d2('0x3'));var Redis=require(_0xc2d2('0x4'));var qs=require(_0xc2d2('0x5'));var logger=require('../../config/logger')(_0xc2d2('0x6'));var config=require('../../config/environment');var db=require(_0xc2d2('0x7'))['db'];config[_0xc2d2('0x8')]=_[_0xc2d2('0x9')](config[_0xc2d2('0x8')],{'host':_0xc2d2('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc2d2('0xb'))[_0xc2d2('0xc')](socket);function respondWithStatusCode(_0x2ebe63,_0x40ce0d){_0x40ce0d=_0x40ce0d||0xcc;return function(_0x1819af){if(_0x1819af){return _0x2ebe63[_0xc2d2('0xd')](_0x40ce0d);}return _0x2ebe63[_0xc2d2('0xe')](_0x40ce0d)[_0xc2d2('0xf')]();};}function respondWithResult(_0x43ecff,_0x1c1d9a){_0x1c1d9a=_0x1c1d9a||0xc8;return function(_0x2f247a){if(_0x2f247a){return _0x43ecff[_0xc2d2('0xe')](_0x1c1d9a)['json'](_0x2f247a);}};}function respondWithFilteredResult(_0x27eb6b,_0x13a247){return function(_0x1e0cbc){if(_0x1e0cbc){var _0x57e318=typeof _0x13a247[_0xc2d2('0x10')]===_0xc2d2('0x11')&&typeof _0x13a247['limit']===_0xc2d2('0x11');var _0x1db3d2=_0x1e0cbc['count'];var _0xa6f836=_0x57e318?0x0:_0x13a247['offset'];var _0x5a1d24=_0x57e318?_0x1e0cbc[_0xc2d2('0x12')]:_0x13a247[_0xc2d2('0x10')]+_0x13a247[_0xc2d2('0x13')];var _0x4006f3;if(_0x5a1d24>=_0x1db3d2){_0x5a1d24=_0x1db3d2;_0x4006f3=0xc8;}else{_0x4006f3=0xce;}_0x27eb6b[_0xc2d2('0xe')](_0x4006f3);return _0x27eb6b[_0xc2d2('0x14')](_0xc2d2('0x15'),_0xa6f836+'-'+_0x5a1d24+'/'+_0x1db3d2)[_0xc2d2('0x16')](_0x1e0cbc);}return null;};}function saveUpdates(_0x34f5a9){return function(_0x19fd0d){if(_0x19fd0d){return _0x19fd0d[_0xc2d2('0x17')](_0x34f5a9)['then'](function(_0x2d4ec4){return _0x2d4ec4;});}return null;};}function removeEntity(_0x296ca3){return function(_0x34f750){if(_0x34f750){return _0x34f750[_0xc2d2('0x18')]()['then'](function(){var _0x31c213=_0x34f750[_0xc2d2('0x19')]({'plain':!![]});var _0x5c8e79=_0xc2d2('0x1a');return db[_0xc2d2('0x1b')][_0xc2d2('0x18')]({'where':{'type':_0x5c8e79,'resourceId':_0x31c213['id']}})[_0xc2d2('0x1c')](function(){return _0x34f750;});})[_0xc2d2('0x1c')](function(){_0x296ca3['status'](0xcc)[_0xc2d2('0xf')]();});}};}function handleEntityNotFound(_0x2af5b0){return function(_0x4c84e0){if(!_0x4c84e0){_0x2af5b0[_0xc2d2('0xd')](0x194);}return _0x4c84e0;};}function handleError(_0x4e3cb5,_0x5ecf78){_0x5ecf78=_0x5ecf78||0x1f4;return function(_0x588342){logger[_0xc2d2('0x1d')](_0x588342[_0xc2d2('0x1e')]);if(_0x588342[_0xc2d2('0x1f')]){delete _0x588342['name'];}_0x4e3cb5[_0xc2d2('0xe')](_0x5ecf78)[_0xc2d2('0x20')](_0x588342);};}exports[_0xc2d2('0x21')]=function(_0xbb46df,_0x5532cd){var _0x25b201={};var _0x25e6af={'count':0x0,'rows':[]};var _0xf2ba15=_[_0xc2d2('0x22')](db[_0xc2d2('0x23')][_0xc2d2('0x24')],function(_0x49e955){return{'name':_0x49e955[_0xc2d2('0x25')],'type':_0x49e955[_0xc2d2('0x26')][_0xc2d2('0x27')]};});_0x25b201=qs[_0xc2d2('0x28')](_0xf2ba15,_0xbb46df);var _0x5bdeee={'where':_0x25b201['where']};return db[_0xc2d2('0x23')][_0xc2d2('0x12')](_0x5bdeee)[_0xc2d2('0x1c')](function(_0x21ca37){_0x25e6af[_0xc2d2('0x12')]=_0x21ca37;_0x25b201[_0xc2d2('0x29')]=qs['include'](_0xbb46df[_0xc2d2('0x2a')]);return db[_0xc2d2('0x23')]['findAll'](_0x25b201);})[_0xc2d2('0x1c')](function(_0x4344c7){_0x25e6af[_0xc2d2('0x2b')]=_0x4344c7;return _0x25e6af;})[_0xc2d2('0x1c')](respondWithFilteredResult(_0x5532cd,_0x25b201))[_0xc2d2('0x2c')](handleError(_0x5532cd,null));};exports['show']=function(_0x481afa,_0xcfe3dc){var _0x57cdec={'raw':!![],'where':{'id':_0x481afa[_0xc2d2('0x2d')]['id']}},_0x207f25={};_0x207f25[_0xc2d2('0x2e')]=_[_0xc2d2('0x2f')](db[_0xc2d2('0x23')]['rawAttributes']);_0x207f25[_0xc2d2('0x2a')]=_[_0xc2d2('0x2f')](_0x481afa[_0xc2d2('0x2a')]);_0x207f25[_0xc2d2('0x30')]=_[_0xc2d2('0x31')](_0x207f25[_0xc2d2('0x2e')],_0x207f25['query']);_0x57cdec[_0xc2d2('0x32')]=_[_0xc2d2('0x31')](_0x207f25['model'],qs[_0xc2d2('0x33')](_0x481afa['query'][_0xc2d2('0x33')]));_0x57cdec[_0xc2d2('0x32')]=_0x57cdec[_0xc2d2('0x32')][_0xc2d2('0x34')]?_0x57cdec[_0xc2d2('0x32')]:_0x207f25[_0xc2d2('0x2e')];if(_0x481afa[_0xc2d2('0x2a')][_0xc2d2('0x35')]){_0x57cdec['include']=[{'all':!![]}];}_0x57cdec=_[_0xc2d2('0x36')]({},_0x57cdec,_0x481afa[_0xc2d2('0x37')]);return db[_0xc2d2('0x23')][_0xc2d2('0x38')](_0x57cdec)['then'](handleEntityNotFound(_0xcfe3dc,null))[_0xc2d2('0x1c')](respondWithResult(_0xcfe3dc,null))[_0xc2d2('0x2c')](handleError(_0xcfe3dc,null));};exports[_0xc2d2('0x39')]=function(_0xf08b85,_0x4d1f25){return db[_0xc2d2('0x23')]['create'](_0xf08b85[_0xc2d2('0x3a')],{})[_0xc2d2('0x1c')](function(_0x5797d8){var _0xdbdce0=_0xf08b85[_0xc2d2('0x3b')][_0xc2d2('0x19')]({'plain':!![]});if(!_0xdbdce0)throw new Error(_0xc2d2('0x3c'));if(_0xdbdce0[_0xc2d2('0x3d')]===_0xc2d2('0x3b')){var _0x16bf47=_0x5797d8[_0xc2d2('0x19')]({'plain':!![]});var _0x450b5=_0xc2d2('0x1a');return db['UserProfileSection'][_0xc2d2('0x38')]({'where':{'name':_0x450b5,'userProfileId':_0xdbdce0[_0xc2d2('0x3e')]},'raw':!![]})['then'](function(_0xfd3ad4){if(_0xfd3ad4&&_0xfd3ad4[_0xc2d2('0x3f')]===0x0){return db[_0xc2d2('0x1b')]['create']({'name':_0x16bf47['name'],'resourceId':_0x16bf47['id'],'type':_0xfd3ad4['name'],'sectionId':_0xfd3ad4['id']},{})[_0xc2d2('0x1c')](function(){return _0x5797d8;});}else{return _0x5797d8;}})[_0xc2d2('0x2c')](function(_0x4031d0){logger[_0xc2d2('0x1d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4031d0);throw _0x4031d0;});}return _0x5797d8;})[_0xc2d2('0x1c')](respondWithResult(_0x4d1f25,0xc9))['catch'](handleError(_0x4d1f25,null));};exports['update']=function(_0x24544e,_0x2a987a){if(_0x24544e[_0xc2d2('0x3a')]['id']){delete _0x24544e['body']['id'];}return db[_0xc2d2('0x23')][_0xc2d2('0x38')]({'where':{'id':_0x24544e[_0xc2d2('0x2d')]['id']}})['then'](handleEntityNotFound(_0x2a987a,null))[_0xc2d2('0x1c')](saveUpdates(_0x24544e['body'],null))[_0xc2d2('0x1c')](respondWithResult(_0x2a987a,null))[_0xc2d2('0x2c')](handleError(_0x2a987a,null));};exports[_0xc2d2('0x18')]=function(_0x14e98d,_0x32d82f){return db[_0xc2d2('0x23')]['find']({'where':{'id':_0x14e98d[_0xc2d2('0x2d')]['id']}})['then'](handleEntityNotFound(_0x32d82f,null))[_0xc2d2('0x1c')](removeEntity(_0x32d82f,null))[_0xc2d2('0x2c')](handleError(_0x32d82f,null));};exports[_0xc2d2('0x40')]=function(_0x236113,_0x28bdf0){return db['FaxQueue'][_0xc2d2('0x40')]()[_0xc2d2('0x1c')](respondWithResult(_0x28bdf0,null))['catch'](handleError(_0x28bdf0,null));};exports['getMembers']=function(_0x4b8e36,_0x484e69){var _0x24d542={'raw':!![],'where':{}},_0xdf685c={},_0x1d568d;return db[_0xc2d2('0x23')][_0xc2d2('0x41')]({'where':{'id':_0x4b8e36[_0xc2d2('0x2d')]['id']}})[_0xc2d2('0x1c')](handleEntityNotFound(_0x484e69,null))[_0xc2d2('0x1c')](function(_0x3aa6cb){if(_0x3aa6cb){_0x1d568d=_0x3aa6cb[_0xc2d2('0x19')]({'plain':!![]});_0xdf685c[_0xc2d2('0x2e')]=_[_0xc2d2('0x2f')](db['UserFaxQueue'][_0xc2d2('0x24')]);_0xdf685c[_0xc2d2('0x2a')]=_['keys'](_0x4b8e36[_0xc2d2('0x2a')]);_0xdf685c['filters']=_[_0xc2d2('0x31')](_0xdf685c[_0xc2d2('0x2e')],_0xdf685c[_0xc2d2('0x2a')]);_0x24d542[_0xc2d2('0x32')]=_['intersection'](_0xdf685c[_0xc2d2('0x2e')],qs[_0xc2d2('0x33')](_0x4b8e36[_0xc2d2('0x2a')][_0xc2d2('0x33')]));_0x24d542[_0xc2d2('0x32')]=_0x24d542[_0xc2d2('0x32')][_0xc2d2('0x34')]?_0x24d542[_0xc2d2('0x32')]:_0xdf685c[_0xc2d2('0x2e')];if(!_0x4b8e36['query']['hasOwnProperty'](_0xc2d2('0x42'))){_0x24d542[_0xc2d2('0x13')]=qs[_0xc2d2('0x13')](_0x4b8e36[_0xc2d2('0x2a')][_0xc2d2('0x13')]);_0x24d542['offset']=qs[_0xc2d2('0x10')](_0x4b8e36[_0xc2d2('0x2a')][_0xc2d2('0x10')]);}_0x24d542['order']=qs[_0xc2d2('0x43')](_0x4b8e36['query'][_0xc2d2('0x43')]);_0x24d542[_0xc2d2('0x44')]=qs[_0xc2d2('0x30')](_[_0xc2d2('0x45')](_0x4b8e36[_0xc2d2('0x2a')],_0xdf685c[_0xc2d2('0x30')]));_0x24d542[_0xc2d2('0x44')][_0xc2d2('0x46')]=_0x3aa6cb['id'];if(_0x4b8e36[_0xc2d2('0x2a')][_0xc2d2('0x47')]){_0x24d542[_0xc2d2('0x44')]=_[_0xc2d2('0x36')](_0x24d542[_0xc2d2('0x44')],{'$or':_[_0xc2d2('0x22')](_0x24d542[_0xc2d2('0x32')],function(_0x1619d7){var _0x367df7={};_0x367df7[_0x1619d7]={'$like':'%'+_0x4b8e36[_0xc2d2('0x2a')][_0xc2d2('0x47')]+'%'};return _0x367df7;})});}_0x24d542=_['merge']({},_0x24d542,_0x4b8e36['options']);return db['UserFaxQueue'][_0xc2d2('0x48')](_0x24d542);}})[_0xc2d2('0x1c')](function(_0x220a3a){if(_0x220a3a){return db[_0xc2d2('0x49')]['findAndCountAll']({'where':{'id':_['map'](_0x220a3a,'UserId'),'role':_0xc2d2('0x4a')},'attributes':['id',_0xc2d2('0x1f'),'faxPause','updatedAt',_0xc2d2('0x4b')]});}})[_0xc2d2('0x1c')](function(_0x263150){if(_0x263150){return{'count':_0x263150['count'],'rows':_[_0xc2d2('0x22')](_0x263150[_0xc2d2('0x2b')],function(_0x2978bd){return{'membername':_0x2978bd[_0xc2d2('0x1f')],'UserId':_0x2978bd['id'],'queue_name':_0x1d568d['name'],'FaxQueueId':_0x1d568d['id'],'interface':util['format'](_0xc2d2('0x4c'),_0xc2d2('0x4d'),_0x2978bd[_0xc2d2('0x1f')]),'penalty':0x0,'paused':_0x2978bd[_0xc2d2('0x4e')],'createdAt':_0x2978bd[_0xc2d2('0x4b')],'updatedAt':_0x2978bd[_0xc2d2('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc2d2('0x1c')](respondWithFilteredResult(_0x484e69,_0x24d542))['catch'](handleError(_0x484e69,null));};exports['getTeams']=function(_0x2a5672,_0x5a6da8){var _0x5e3587={};var _0x3cc143={};var _0x272867;var _0x597cfc;return db[_0xc2d2('0x23')]['findOne']({'where':{'id':_0x2a5672['params']['id']}})[_0xc2d2('0x1c')](handleEntityNotFound(_0x5a6da8,null))[_0xc2d2('0x1c')](function(_0x3121e1){if(_0x3121e1){_0x272867=_0x3121e1;_0x3cc143['model']=_[_0xc2d2('0x2f')](db[_0xc2d2('0x50')]['rawAttributes']);_0x3cc143[_0xc2d2('0x2a')]=_['keys'](_0x2a5672[_0xc2d2('0x2a')]);_0x3cc143[_0xc2d2('0x30')]=_[_0xc2d2('0x31')](_0x3cc143['model'],_0x3cc143['query']);_0x5e3587[_0xc2d2('0x32')]=_['intersection'](_0x3cc143[_0xc2d2('0x2e')],qs['fields'](_0x2a5672['query']['fields']));_0x5e3587[_0xc2d2('0x32')]=_0x5e3587['attributes'][_0xc2d2('0x34')]?_0x5e3587['attributes']:_0x3cc143[_0xc2d2('0x2e')];_0x5e3587[_0xc2d2('0x51')]=qs[_0xc2d2('0x43')](_0x2a5672[_0xc2d2('0x2a')][_0xc2d2('0x43')]);_0x5e3587[_0xc2d2('0x44')]=qs['filters'](_[_0xc2d2('0x45')](_0x2a5672[_0xc2d2('0x2a')],_0x3cc143['filters']));if(_0x2a5672[_0xc2d2('0x2a')][_0xc2d2('0x47')]){_0x5e3587[_0xc2d2('0x44')]=_['merge'](_0x5e3587[_0xc2d2('0x44')],{'$or':_[_0xc2d2('0x22')](_0x5e3587['attributes'],function(_0x473bcd){var _0x4f6801={};_0x4f6801[_0x473bcd]={'$like':'%'+_0x2a5672[_0xc2d2('0x2a')][_0xc2d2('0x47')]+'%'};return _0x4f6801;})});}_0x5e3587=_[_0xc2d2('0x36')]({},_0x5e3587,_0x2a5672[_0xc2d2('0x37')]);return _0x272867['getTeams'](_0x5e3587);}})['then'](function(_0x367d18){if(_0x367d18){_0x597cfc=_0x367d18[_0xc2d2('0x34')];if(!_0x2a5672[_0xc2d2('0x2a')]['hasOwnProperty']('nolimit')){_0x5e3587['limit']=qs[_0xc2d2('0x13')](_0x2a5672[_0xc2d2('0x2a')]['limit']);_0x5e3587[_0xc2d2('0x10')]=qs[_0xc2d2('0x10')](_0x2a5672[_0xc2d2('0x2a')][_0xc2d2('0x10')]);}return _0x272867[_0xc2d2('0x52')](_0x5e3587);}})[_0xc2d2('0x1c')](function(_0x8643f7){if(_0x8643f7){return _0x8643f7?{'count':_0x597cfc,'rows':_0x8643f7}:null;}})[_0xc2d2('0x1c')](respondWithResult(_0x5a6da8,null))['catch'](handleError(_0x5a6da8,null));};exports['addTeams']=function(_0x1f7758,_0x6158cc){var _0x92eca6=_0x1f7758['body']['ids'];return db['Team']['findAll']({'where':{'id':_0x92eca6},'attributes':['id'],'include':[{'model':db[_0xc2d2('0x49')],'as':_0xc2d2('0x53'),'attributes':['id',_0xc2d2('0x1f'),_0xc2d2('0x54'),_0xc2d2('0x55'),_0xc2d2('0x56')],'raw':!![]}]})[_0xc2d2('0x1c')](function(_0x19263c){if(_0x19263c){var _0x3584d4=_[_0xc2d2('0x57')](_0x19263c,function(_0xcdc0ad){var _0x72cfb2=_0xcdc0ad[_0xc2d2('0x19')]({'plain':!![]});return _0x72cfb2[_0xc2d2('0x53')];});return db[_0xc2d2('0x23')][_0xc2d2('0x38')]({'where':{'id':_0x1f7758['params']['id']}})[_0xc2d2('0x1c')](function(_0x5bd72b){return db[_0xc2d2('0x58')][_0xc2d2('0x59')](function(_0x31313e){return _0x5bd72b[_0xc2d2('0x5a')](_0x92eca6,{'transaction':_0x31313e})[_0xc2d2('0x1c')](function(){return BPromise[_0xc2d2('0x5b')](_0x3584d4,function(_0x35bb3c){return db[_0xc2d2('0x5c')][_0xc2d2('0x5d')]({'where':{'UserId':_0x35bb3c['id'],'FaxQueueId':_0x1f7758[_0xc2d2('0x2d')]['id']},'transaction':_0x31313e});});})['then'](function(){_0x3584d4['forEach'](function(_0x2d8f7d){socket[_0xc2d2('0x5e')]('userFaxQueue:save',{'UserId':_0x2d8f7d['id'],'FaxQueueId':_0x5bd72b['id']});});});});});}})[_0xc2d2('0x1c')](respondWithStatusCode(_0x6158cc,null))[_0xc2d2('0x2c')](handleError(_0x6158cc,null));};exports[_0xc2d2('0x5f')]=function(_0x5cb049,_0x269138){return db['Team'][_0xc2d2('0x48')]({'where':{'id':_0x5cb049['query'][_0xc2d2('0x60')]},'attributes':['id'],'include':[{'model':db[_0xc2d2('0x49')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc2d2('0x1c')](handleEntityNotFound(_0x269138,null))[_0xc2d2('0x1c')](function(_0x417837){var _0x35b34d=_[_0xc2d2('0x22')](_0x417837,'id');var _0x3ce167=[];var _0x4b27be=[];var _0x15cc48=squel[_0xc2d2('0x61')]();_0x15cc48[_0xc2d2('0x62')](_0xc2d2('0x63'))[_0xc2d2('0x64')](_0xc2d2('0x65'),'tq')['join']('user_has_teams','ut',_0xc2d2('0x66'))['where'](_0xc2d2('0x67'),_0x5cb049['params']['id']);for(var _0x3b63a0=0x0;_0x3b63a0<_0x417837['length'];_0x3b63a0+=0x1){let _0x20338b=_0x417837[_0x3b63a0];for(var _0x42fc6b=0x0;_0x42fc6b<_0x20338b['Agents'][_0xc2d2('0x34')];_0x42fc6b+=0x1){let _0x2e8674=_0x20338b[_0xc2d2('0x53')][_0x42fc6b];var _0x139b7f=_0x15cc48[_0xc2d2('0x68')]();_0x139b7f['where'](_0xc2d2('0x69'),_0x2e8674['id']);_0x4b27be['push'](db[_0xc2d2('0x58')]['query'](_0x139b7f[_0xc2d2('0x6a')](),{'type':db[_0xc2d2('0x58')][_0xc2d2('0x6b')][_0xc2d2('0x6c')]})[_0xc2d2('0x1c')](function(_0x38b1cf){if(_0x38b1cf[_0xc2d2('0x34')]===0x1){return _0x2e8674['id'];}else{var _0x168e52=_[_0xc2d2('0x6d')](_[_0xc2d2('0x22')](_0x38b1cf,'TeamId'),function(_0x1571c1){return _['includes'](_0x35b34d,_0x1571c1);});if(_0x168e52){return _0x2e8674['id'];}}}));}}return BPromise[_0xc2d2('0x6e')](_0x4b27be)[_0xc2d2('0x1c')](function(_0x335df3){_0x3ce167=_(_0x3ce167)[_0xc2d2('0x6f')](_0x335df3)[_0xc2d2('0x70')]()[_0xc2d2('0x71')]();return db[_0xc2d2('0x23')][_0xc2d2('0x38')]({'where':{'id':_0x5cb049[_0xc2d2('0x2d')]['id']}})[_0xc2d2('0x1c')](function(_0xbe6769){return db['sequelize'][_0xc2d2('0x59')](function(_0x20ed5b){return _0xbe6769['removeTeams'](_0x5cb049[_0xc2d2('0x2a')][_0xc2d2('0x60')],{'transaction':_0x20ed5b})[_0xc2d2('0x1c')](function(){if(!_['isEmpty'](_0x3ce167)){return _0xbe6769[_0xc2d2('0x72')](_0x3ce167,{'transaction':_0x20ed5b});}})[_0xc2d2('0x1c')](function(){_0x3ce167['forEach'](function(_0x12a86e){socket[_0xc2d2('0x5e')]('userFaxQueue:remove',{'UserId':_0x12a86e,'FaxQueueId':_0xbe6769['id']});});});});});});})[_0xc2d2('0x1c')](respondWithStatusCode(_0x269138,null))['catch'](handleError(_0x269138,null));};exports[_0xc2d2('0x73')]=function(_0x597f86,_0x555a4c){return db[_0xc2d2('0x23')][_0xc2d2('0x38')]({'where':{'id':_0x597f86['params']['id']}})[_0xc2d2('0x1c')](handleEntityNotFound(_0x555a4c,null))[_0xc2d2('0x1c')](function(_0x53cf68){if(_0x53cf68){return _0x53cf68['addAgents'](_0x597f86[_0xc2d2('0x3a')][_0xc2d2('0x60')],_[_0xc2d2('0x74')](_0x597f86['body'],[_0xc2d2('0x60'),'id'])||{})['spread'](function(_0x5ef458){for(var _0x28a163=0x0;_0x28a163<_0x597f86[_0xc2d2('0x3a')]['ids'][_0xc2d2('0x34')];_0x28a163+=0x1){socket['emit'](_0xc2d2('0x75'),{'UserId':Number(_0x597f86['body'][_0xc2d2('0x60')][_0x28a163]),'FaxQueueId':Number(_0x597f86['params']['id'])});}return _0x5ef458;});}})[_0xc2d2('0x1c')](respondWithResult(_0x555a4c,null))[_0xc2d2('0x2c')](handleError(_0x555a4c,null));};exports[_0xc2d2('0x72')]=function(_0x13c4f9,_0x39e789){return db[_0xc2d2('0x23')][_0xc2d2('0x38')]({'where':{'id':_0x13c4f9['params']['id']}})[_0xc2d2('0x1c')](handleEntityNotFound(_0x39e789,null))[_0xc2d2('0x1c')](function(_0xe1387f){if(_0xe1387f){return _0xe1387f[_0xc2d2('0x72')](_0x13c4f9[_0xc2d2('0x2a')][_0xc2d2('0x60')])[_0xc2d2('0x1c')](function(){if(_[_0xc2d2('0x76')](_0x13c4f9[_0xc2d2('0x2a')][_0xc2d2('0x60')])){for(var _0x4a6380=0x0;_0x4a6380<_0x13c4f9['query'][_0xc2d2('0x60')][_0xc2d2('0x34')];_0x4a6380+=0x1){socket[_0xc2d2('0x5e')](_0xc2d2('0x77'),{'UserId':Number(_0x13c4f9['query'][_0xc2d2('0x60')][_0x4a6380]),'FaxQueueId':Number(_0x13c4f9[_0xc2d2('0x2d')]['id'])});}}else{socket[_0xc2d2('0x5e')]('userFaxQueue:remove',{'UserId':Number(_0x13c4f9[_0xc2d2('0x2a')][_0xc2d2('0x60')]),'FaxQueueId':Number(_0x13c4f9[_0xc2d2('0x2d')]['id'])});}});}})[_0xc2d2('0x1c')](respondWithStatusCode(_0x39e789,null))[_0xc2d2('0x2c')](handleError(_0x39e789,null));};exports[_0xc2d2('0x78')]=function(_0x38d865,_0xd69f91){var _0x196715={};var _0x2048ac={};var _0x3b917e;var _0x2cd708;return db[_0xc2d2('0x23')]['findOne']({'where':{'id':_0x38d865[_0xc2d2('0x2d')]['id']}})['then'](handleEntityNotFound(_0xd69f91,null))['then'](function(_0x2decd8){if(_0x2decd8){_0x3b917e=_0x2decd8;_0x2048ac[_0xc2d2('0x2e')]=_['keys'](db['User'][_0xc2d2('0x24')]);_0x2048ac[_0xc2d2('0x2a')]=_[_0xc2d2('0x2f')](_0x38d865[_0xc2d2('0x2a')]);_0x2048ac[_0xc2d2('0x30')]=_[_0xc2d2('0x31')](_0x2048ac[_0xc2d2('0x2e')],_0x2048ac[_0xc2d2('0x2a')]);_0x196715[_0xc2d2('0x32')]=_[_0xc2d2('0x31')](_0x2048ac['model'],qs[_0xc2d2('0x33')](_0x38d865[_0xc2d2('0x2a')][_0xc2d2('0x33')]));_0x196715['attributes']=_0x196715[_0xc2d2('0x32')][_0xc2d2('0x34')]?_0x196715['attributes']:_0x2048ac[_0xc2d2('0x2e')];_0x196715['order']=qs[_0xc2d2('0x43')](_0x38d865[_0xc2d2('0x2a')][_0xc2d2('0x43')]);_0x196715[_0xc2d2('0x44')]=qs['filters'](_[_0xc2d2('0x45')](_0x38d865['query'],_0x2048ac['filters']));if(_0x38d865[_0xc2d2('0x2a')][_0xc2d2('0x47')]){_0x196715[_0xc2d2('0x44')]=_['merge'](_0x196715[_0xc2d2('0x44')],{'$or':_['map'](_0x196715[_0xc2d2('0x32')],function(_0x3a05b8){var _0x120b76={};_0x120b76[_0x3a05b8]={'$like':'%'+_0x38d865[_0xc2d2('0x2a')][_0xc2d2('0x47')]+'%'};return _0x120b76;})});}_0x196715=_[_0xc2d2('0x36')]({},_0x196715,_0x38d865['options']);return _0x3b917e['getAgents'](_0x196715);}})[_0xc2d2('0x1c')](function(_0x414019){if(_0x414019){_0x2cd708=_0x414019['length'];if(!_0x38d865[_0xc2d2('0x2a')][_0xc2d2('0x79')](_0xc2d2('0x42'))){_0x196715['limit']=qs[_0xc2d2('0x13')](_0x38d865[_0xc2d2('0x2a')]['limit']);_0x196715[_0xc2d2('0x10')]=qs[_0xc2d2('0x10')](_0x38d865[_0xc2d2('0x2a')][_0xc2d2('0x10')]);}return _0x3b917e[_0xc2d2('0x78')](_0x196715);}})['then'](function(_0x5270f7){if(_0x5270f7){return _0x5270f7?{'count':_0x2cd708,'rows':_0x5270f7}:null;}})[_0xc2d2('0x1c')](respondWithResult(_0xd69f91,null))[_0xc2d2('0x2c')](handleError(_0xd69f91,null));}; \ No newline at end of file +var _0xb182=['User','UserId','agent','faxPause','createdAt','format','%s/%s','SIP','getTeams','Team','length','ids','voicePause','interface','flatMap','addTeams','each','findOrCreate','emit','userFaxQueue:save','Agents','field','tq.TeamId','from','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','QueryTypes','SELECT','every','TeamId','value','transaction','removeTeams','isEmpty','removeAgents','forEach','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','util','lodash','squel','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','sendStatus','status','end','json','offset','undefined','count','set','then','destroy','FaxQueues','error','stack','name','index','map','FaxQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','findAll','rows','catch','show','params','keys','filters','intersection','model','attributes','fields','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','hasOwnProperty','nolimit','limit','order','sort','pick','FaxQueueId','filter','merge'];(function(_0x944bfd,_0x29d12c){var _0x5e7555=function(_0x47f006){while(--_0x47f006){_0x944bfd['push'](_0x944bfd['shift']());}};_0x5e7555(++_0x29d12c);}(_0xb182,0x121));var _0x2b18=function(_0xcf581b,_0x4359dd){_0xcf581b=_0xcf581b-0x0;var _0x4f454d=_0xb182[_0xcf581b];return _0x4f454d;};'use strict';var BPromise=require('bluebird');var util=require(_0x2b18('0x0'));var _=require(_0x2b18('0x1'));var squel=require(_0x2b18('0x2'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x2b18('0x3'))(_0x2b18('0x4'));var config=require(_0x2b18('0x5'));var db=require('../../mysqldb')['db'];config[_0x2b18('0x6')]=_[_0x2b18('0x7')](config[_0x2b18('0x6')],{'host':_0x2b18('0x8'),'port':0x18eb});var socket=require(_0x2b18('0x9'))(new Redis(config[_0x2b18('0x6')]));require(_0x2b18('0xa'))['register'](socket);function respondWithStatusCode(_0x264ae2,_0x193e13){_0x193e13=_0x193e13||0xcc;return function(_0xfe8a8d){if(_0xfe8a8d){return _0x264ae2[_0x2b18('0xb')](_0x193e13);}return _0x264ae2[_0x2b18('0xc')](_0x193e13)[_0x2b18('0xd')]();};}function respondWithResult(_0x1311ad,_0x261b64){_0x261b64=_0x261b64||0xc8;return function(_0x440d50){if(_0x440d50){return _0x1311ad[_0x2b18('0xc')](_0x261b64)[_0x2b18('0xe')](_0x440d50);}};}function respondWithFilteredResult(_0x36bea7,_0xdb11bf){return function(_0x5225bf){if(_0x5225bf){var _0x42d679=typeof _0xdb11bf[_0x2b18('0xf')]==='undefined'&&typeof _0xdb11bf['limit']===_0x2b18('0x10');var _0xf2643c=_0x5225bf[_0x2b18('0x11')];var _0x1d20a0=_0x42d679?0x0:_0xdb11bf[_0x2b18('0xf')];var _0x195a26=_0x42d679?_0x5225bf[_0x2b18('0x11')]:_0xdb11bf[_0x2b18('0xf')]+_0xdb11bf['limit'];var _0x2ef594;if(_0x195a26>=_0xf2643c){_0x195a26=_0xf2643c;_0x2ef594=0xc8;}else{_0x2ef594=0xce;}_0x36bea7[_0x2b18('0xc')](_0x2ef594);return _0x36bea7[_0x2b18('0x12')]('Content-Range',_0x1d20a0+'-'+_0x195a26+'/'+_0xf2643c)[_0x2b18('0xe')](_0x5225bf);}return null;};}function saveUpdates(_0x52754f){return function(_0x5346e5){if(_0x5346e5){return _0x5346e5['update'](_0x52754f)[_0x2b18('0x13')](function(_0xc4714f){return _0xc4714f;});}return null;};}function removeEntity(_0x7210b2){return function(_0x149ee0){if(_0x149ee0){return _0x149ee0[_0x2b18('0x14')]()[_0x2b18('0x13')](function(){var _0x279914=_0x149ee0['get']({'plain':!![]});var _0x349557=_0x2b18('0x15');return db['UserProfileResource']['destroy']({'where':{'type':_0x349557,'resourceId':_0x279914['id']}})[_0x2b18('0x13')](function(){return _0x149ee0;});})[_0x2b18('0x13')](function(){_0x7210b2['status'](0xcc)[_0x2b18('0xd')]();});}};}function handleEntityNotFound(_0x43912d){return function(_0x309633){if(!_0x309633){_0x43912d[_0x2b18('0xb')](0x194);}return _0x309633;};}function handleError(_0x4e45d0,_0x1b1635){_0x1b1635=_0x1b1635||0x1f4;return function(_0x50539e){logger[_0x2b18('0x16')](_0x50539e[_0x2b18('0x17')]);if(_0x50539e[_0x2b18('0x18')]){delete _0x50539e['name'];}_0x4e45d0['status'](_0x1b1635)['send'](_0x50539e);};}exports[_0x2b18('0x19')]=function(_0x446655,_0x184d30){var _0x38e879={};var _0x3e52c2={'count':0x0,'rows':[]};var _0x3f0425=_[_0x2b18('0x1a')](db[_0x2b18('0x1b')][_0x2b18('0x1c')],function(_0x4e600b){return{'name':_0x4e600b[_0x2b18('0x1d')],'type':_0x4e600b[_0x2b18('0x1e')][_0x2b18('0x1f')]};});_0x38e879=qs[_0x2b18('0x20')](_0x3f0425,_0x446655);var _0x23ca0e={'where':_0x38e879[_0x2b18('0x21')]};return db[_0x2b18('0x1b')][_0x2b18('0x11')](_0x23ca0e)[_0x2b18('0x13')](function(_0x26afc0){_0x3e52c2[_0x2b18('0x11')]=_0x26afc0;_0x38e879[_0x2b18('0x22')]=qs[_0x2b18('0x22')](_0x446655[_0x2b18('0x23')]);return db[_0x2b18('0x1b')][_0x2b18('0x24')](_0x38e879);})[_0x2b18('0x13')](function(_0x2990b2){_0x3e52c2[_0x2b18('0x25')]=_0x2990b2;return _0x3e52c2;})[_0x2b18('0x13')](respondWithFilteredResult(_0x184d30,_0x38e879))[_0x2b18('0x26')](handleError(_0x184d30,null));};exports[_0x2b18('0x27')]=function(_0x56d8de,_0x3d1ba0){var _0x47487c={'raw':!![],'where':{'id':_0x56d8de[_0x2b18('0x28')]['id']}},_0xcacfef={};_0xcacfef['model']=_['keys'](db['FaxQueue'][_0x2b18('0x1c')]);_0xcacfef[_0x2b18('0x23')]=_[_0x2b18('0x29')](_0x56d8de[_0x2b18('0x23')]);_0xcacfef[_0x2b18('0x2a')]=_[_0x2b18('0x2b')](_0xcacfef[_0x2b18('0x2c')],_0xcacfef[_0x2b18('0x23')]);_0x47487c[_0x2b18('0x2d')]=_[_0x2b18('0x2b')](_0xcacfef[_0x2b18('0x2c')],qs[_0x2b18('0x2e')](_0x56d8de[_0x2b18('0x23')][_0x2b18('0x2e')]));_0x47487c['attributes']=_0x47487c['attributes']['length']?_0x47487c[_0x2b18('0x2d')]:_0xcacfef[_0x2b18('0x2c')];if(_0x56d8de[_0x2b18('0x23')][_0x2b18('0x2f')]){_0x47487c['include']=[{'all':!![]}];}_0x47487c=_['merge']({},_0x47487c,_0x56d8de[_0x2b18('0x30')]);return db[_0x2b18('0x1b')][_0x2b18('0x31')](_0x47487c)[_0x2b18('0x13')](handleEntityNotFound(_0x3d1ba0,null))[_0x2b18('0x13')](respondWithResult(_0x3d1ba0,null))[_0x2b18('0x26')](handleError(_0x3d1ba0,null));};exports[_0x2b18('0x32')]=function(_0x2efea5,_0x43c666){return db[_0x2b18('0x1b')][_0x2b18('0x32')](_0x2efea5[_0x2b18('0x33')],{})[_0x2b18('0x13')](function(_0x13c5e9){var _0x139761=_0x2efea5[_0x2b18('0x34')]['get']({'plain':!![]});if(!_0x139761)throw new Error(_0x2b18('0x35'));if(_0x139761[_0x2b18('0x36')]===_0x2b18('0x34')){var _0x444fa6=_0x13c5e9[_0x2b18('0x37')]({'plain':!![]});var _0x175659=_0x2b18('0x15');return db[_0x2b18('0x38')][_0x2b18('0x31')]({'where':{'name':_0x175659,'userProfileId':_0x139761[_0x2b18('0x39')]},'raw':!![]})[_0x2b18('0x13')](function(_0xd192ca){if(_0xd192ca&&_0xd192ca[_0x2b18('0x3a')]===0x0){return db[_0x2b18('0x3b')][_0x2b18('0x32')]({'name':_0x444fa6[_0x2b18('0x18')],'resourceId':_0x444fa6['id'],'type':_0xd192ca[_0x2b18('0x18')],'sectionId':_0xd192ca['id']},{})[_0x2b18('0x13')](function(){return _0x13c5e9;});}else{return _0x13c5e9;}})[_0x2b18('0x26')](function(_0xffbf0a){logger[_0x2b18('0x16')](_0x2b18('0x3c'),_0xffbf0a);throw _0xffbf0a;});}return _0x13c5e9;})[_0x2b18('0x13')](respondWithResult(_0x43c666,0xc9))['catch'](handleError(_0x43c666,null));};exports['update']=function(_0x7a8181,_0x39db64){if(_0x7a8181[_0x2b18('0x33')]['id']){delete _0x7a8181[_0x2b18('0x33')]['id'];}return db[_0x2b18('0x1b')][_0x2b18('0x31')]({'where':{'id':_0x7a8181['params']['id']}})['then'](handleEntityNotFound(_0x39db64,null))[_0x2b18('0x13')](saveUpdates(_0x7a8181[_0x2b18('0x33')],null))[_0x2b18('0x13')](respondWithResult(_0x39db64,null))[_0x2b18('0x26')](handleError(_0x39db64,null));};exports[_0x2b18('0x14')]=function(_0x591790,_0x525148){return db[_0x2b18('0x1b')][_0x2b18('0x31')]({'where':{'id':_0x591790['params']['id']}})['then'](handleEntityNotFound(_0x525148,null))[_0x2b18('0x13')](removeEntity(_0x525148,null))[_0x2b18('0x26')](handleError(_0x525148,null));};exports[_0x2b18('0x3d')]=function(_0x143aa6,_0x39ebfc){return db[_0x2b18('0x1b')][_0x2b18('0x3d')]()[_0x2b18('0x13')](respondWithResult(_0x39ebfc,null))['catch'](handleError(_0x39ebfc,null));};exports[_0x2b18('0x3e')]=function(_0x90dc90,_0x4f1e50){var _0x2e2ab5={'raw':!![],'where':{}},_0x4ac135={},_0x485036;return db['FaxQueue'][_0x2b18('0x3f')]({'where':{'id':_0x90dc90['params']['id']}})['then'](handleEntityNotFound(_0x4f1e50,null))[_0x2b18('0x13')](function(_0x51b872){if(_0x51b872){_0x485036=_0x51b872[_0x2b18('0x37')]({'plain':!![]});_0x4ac135[_0x2b18('0x2c')]=_[_0x2b18('0x29')](db[_0x2b18('0x40')][_0x2b18('0x1c')]);_0x4ac135[_0x2b18('0x23')]=_['keys'](_0x90dc90[_0x2b18('0x23')]);_0x4ac135[_0x2b18('0x2a')]=_[_0x2b18('0x2b')](_0x4ac135[_0x2b18('0x2c')],_0x4ac135[_0x2b18('0x23')]);_0x2e2ab5[_0x2b18('0x2d')]=_[_0x2b18('0x2b')](_0x4ac135[_0x2b18('0x2c')],qs['fields'](_0x90dc90[_0x2b18('0x23')][_0x2b18('0x2e')]));_0x2e2ab5[_0x2b18('0x2d')]=_0x2e2ab5[_0x2b18('0x2d')]['length']?_0x2e2ab5[_0x2b18('0x2d')]:_0x4ac135[_0x2b18('0x2c')];if(!_0x90dc90['query'][_0x2b18('0x41')](_0x2b18('0x42'))){_0x2e2ab5[_0x2b18('0x43')]=qs[_0x2b18('0x43')](_0x90dc90['query'][_0x2b18('0x43')]);_0x2e2ab5['offset']=qs['offset'](_0x90dc90[_0x2b18('0x23')]['offset']);}_0x2e2ab5[_0x2b18('0x44')]=qs[_0x2b18('0x45')](_0x90dc90[_0x2b18('0x23')][_0x2b18('0x45')]);_0x2e2ab5[_0x2b18('0x21')]=qs[_0x2b18('0x2a')](_[_0x2b18('0x46')](_0x90dc90[_0x2b18('0x23')],_0x4ac135['filters']));_0x2e2ab5[_0x2b18('0x21')][_0x2b18('0x47')]=_0x51b872['id'];if(_0x90dc90['query'][_0x2b18('0x48')]){_0x2e2ab5['where']=_['merge'](_0x2e2ab5[_0x2b18('0x21')],{'$or':_['map'](_0x2e2ab5['attributes'],function(_0x1b8349){var _0x3e9a72={};_0x3e9a72[_0x1b8349]={'$like':'%'+_0x90dc90[_0x2b18('0x23')][_0x2b18('0x48')]+'%'};return _0x3e9a72;})});}_0x2e2ab5=_[_0x2b18('0x49')]({},_0x2e2ab5,_0x90dc90['options']);return db[_0x2b18('0x40')][_0x2b18('0x24')](_0x2e2ab5);}})[_0x2b18('0x13')](function(_0x59d9c9){if(_0x59d9c9){return db[_0x2b18('0x4a')]['findAndCountAll']({'where':{'id':_[_0x2b18('0x1a')](_0x59d9c9,_0x2b18('0x4b')),'role':_0x2b18('0x4c')},'attributes':['id',_0x2b18('0x18'),_0x2b18('0x4d'),'updatedAt',_0x2b18('0x4e')]});}})['then'](function(_0x3479f1){if(_0x3479f1){return{'count':_0x3479f1[_0x2b18('0x11')],'rows':_[_0x2b18('0x1a')](_0x3479f1[_0x2b18('0x25')],function(_0x5312cc){return{'membername':_0x5312cc[_0x2b18('0x18')],'UserId':_0x5312cc['id'],'queue_name':_0x485036[_0x2b18('0x18')],'FaxQueueId':_0x485036['id'],'interface':util[_0x2b18('0x4f')](_0x2b18('0x50'),_0x2b18('0x51'),_0x5312cc['name']),'penalty':0x0,'paused':_0x5312cc[_0x2b18('0x4d')],'createdAt':_0x5312cc['createdAt'],'updatedAt':_0x5312cc['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x2b18('0x13')](respondWithFilteredResult(_0x4f1e50,_0x2e2ab5))[_0x2b18('0x26')](handleError(_0x4f1e50,null));};exports[_0x2b18('0x52')]=function(_0x48a75b,_0x55d6aa){var _0x10701b={};var _0x37cf1e={};var _0x232955;var _0xae2206;return db[_0x2b18('0x1b')][_0x2b18('0x3f')]({'where':{'id':_0x48a75b['params']['id']}})[_0x2b18('0x13')](handleEntityNotFound(_0x55d6aa,null))[_0x2b18('0x13')](function(_0x2459d7){if(_0x2459d7){_0x232955=_0x2459d7;_0x37cf1e['model']=_[_0x2b18('0x29')](db[_0x2b18('0x53')][_0x2b18('0x1c')]);_0x37cf1e[_0x2b18('0x23')]=_[_0x2b18('0x29')](_0x48a75b[_0x2b18('0x23')]);_0x37cf1e[_0x2b18('0x2a')]=_[_0x2b18('0x2b')](_0x37cf1e[_0x2b18('0x2c')],_0x37cf1e[_0x2b18('0x23')]);_0x10701b[_0x2b18('0x2d')]=_[_0x2b18('0x2b')](_0x37cf1e[_0x2b18('0x2c')],qs[_0x2b18('0x2e')](_0x48a75b['query'][_0x2b18('0x2e')]));_0x10701b[_0x2b18('0x2d')]=_0x10701b[_0x2b18('0x2d')][_0x2b18('0x54')]?_0x10701b[_0x2b18('0x2d')]:_0x37cf1e['model'];_0x10701b[_0x2b18('0x44')]=qs[_0x2b18('0x45')](_0x48a75b['query'][_0x2b18('0x45')]);_0x10701b[_0x2b18('0x21')]=qs['filters'](_[_0x2b18('0x46')](_0x48a75b[_0x2b18('0x23')],_0x37cf1e[_0x2b18('0x2a')]));if(_0x48a75b['query'][_0x2b18('0x48')]){_0x10701b[_0x2b18('0x21')]=_[_0x2b18('0x49')](_0x10701b[_0x2b18('0x21')],{'$or':_[_0x2b18('0x1a')](_0x10701b['attributes'],function(_0x505afb){var _0x5432ba={};_0x5432ba[_0x505afb]={'$like':'%'+_0x48a75b['query'][_0x2b18('0x48')]+'%'};return _0x5432ba;})});}_0x10701b=_[_0x2b18('0x49')]({},_0x10701b,_0x48a75b[_0x2b18('0x30')]);return _0x232955[_0x2b18('0x52')](_0x10701b);}})['then'](function(_0x193af1){if(_0x193af1){_0xae2206=_0x193af1[_0x2b18('0x54')];if(!_0x48a75b[_0x2b18('0x23')][_0x2b18('0x41')](_0x2b18('0x42'))){_0x10701b[_0x2b18('0x43')]=qs['limit'](_0x48a75b[_0x2b18('0x23')][_0x2b18('0x43')]);_0x10701b[_0x2b18('0xf')]=qs[_0x2b18('0xf')](_0x48a75b[_0x2b18('0x23')][_0x2b18('0xf')]);}return _0x232955[_0x2b18('0x52')](_0x10701b);}})[_0x2b18('0x13')](function(_0x439259){if(_0x439259){return _0x439259?{'count':_0xae2206,'rows':_0x439259}:null;}})[_0x2b18('0x13')](respondWithResult(_0x55d6aa,null))[_0x2b18('0x26')](handleError(_0x55d6aa,null));};exports['addTeams']=function(_0x2b6c93,_0x42fa0d){var _0x819528=_0x2b6c93[_0x2b18('0x33')][_0x2b18('0x55')];return db[_0x2b18('0x53')][_0x2b18('0x24')]({'where':{'id':_0x819528},'attributes':['id'],'include':[{'model':db[_0x2b18('0x4a')],'as':'Agents','attributes':['id',_0x2b18('0x18'),'online',_0x2b18('0x56'),_0x2b18('0x57')],'raw':!![]}]})[_0x2b18('0x13')](function(_0x27c99d){if(_0x27c99d){var _0x533050=_[_0x2b18('0x58')](_0x27c99d,function(_0x2cec9e){var _0x22161e=_0x2cec9e[_0x2b18('0x37')]({'plain':!![]});return _0x22161e['Agents'];});return db['FaxQueue'][_0x2b18('0x31')]({'where':{'id':_0x2b6c93[_0x2b18('0x28')]['id']}})['then'](function(_0x1e3bdb){return db['sequelize']['transaction'](function(_0x1b647f){return _0x1e3bdb[_0x2b18('0x59')](_0x819528,{'transaction':_0x1b647f})['then'](function(){return BPromise[_0x2b18('0x5a')](_0x533050,function(_0x471ff4){return db[_0x2b18('0x40')][_0x2b18('0x5b')]({'where':{'UserId':_0x471ff4['id'],'FaxQueueId':_0x2b6c93[_0x2b18('0x28')]['id']},'transaction':_0x1b647f});});})[_0x2b18('0x13')](function(){_0x533050['forEach'](function(_0x2c18db){socket[_0x2b18('0x5c')](_0x2b18('0x5d'),{'UserId':_0x2c18db['id'],'FaxQueueId':_0x1e3bdb['id']});});});});});}})[_0x2b18('0x13')](respondWithStatusCode(_0x42fa0d,null))['catch'](handleError(_0x42fa0d,null));};exports['removeTeams']=function(_0x3ae081,_0x1855e1){return db['Team'][_0x2b18('0x24')]({'where':{'id':_0x3ae081[_0x2b18('0x23')][_0x2b18('0x55')]},'attributes':['id'],'include':[{'model':db[_0x2b18('0x4a')],'as':_0x2b18('0x5e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1855e1,null))[_0x2b18('0x13')](function(_0x4300e7){var _0x2fc8ec=_[_0x2b18('0x1a')](_0x4300e7,'id');var _0x3c5883=[];var _0xb9f6f8=[];var _0x5a471a=squel['select']();_0x5a471a[_0x2b18('0x5f')](_0x2b18('0x60'))[_0x2b18('0x61')](_0x2b18('0x62'),'tq')['join'](_0x2b18('0x63'),'ut',_0x2b18('0x64'))[_0x2b18('0x21')](_0x2b18('0x65'),_0x3ae081[_0x2b18('0x28')]['id']);for(var _0x5846f3=0x0;_0x5846f3<_0x4300e7[_0x2b18('0x54')];_0x5846f3+=0x1){let _0x1533f5=_0x4300e7[_0x5846f3];for(var _0x59b4ca=0x0;_0x59b4ca<_0x1533f5['Agents'][_0x2b18('0x54')];_0x59b4ca+=0x1){let _0xe16121=_0x1533f5[_0x2b18('0x5e')][_0x59b4ca];var _0x23fb88=_0x5a471a[_0x2b18('0x66')]();_0x23fb88['where'](_0x2b18('0x67'),_0xe16121['id']);_0xb9f6f8['push'](db['sequelize'][_0x2b18('0x23')](_0x23fb88['toString'](),{'type':db[_0x2b18('0x68')][_0x2b18('0x69')][_0x2b18('0x6a')]})[_0x2b18('0x13')](function(_0xd0db33){if(_0xd0db33[_0x2b18('0x54')]===0x1){return _0xe16121['id'];}else{var _0x1a8928=_[_0x2b18('0x6b')](_[_0x2b18('0x1a')](_0xd0db33,_0x2b18('0x6c')),function(_0x789c94){return _['includes'](_0x2fc8ec,_0x789c94);});if(_0x1a8928){return _0xe16121['id'];}}}));}}return BPromise['all'](_0xb9f6f8)[_0x2b18('0x13')](function(_0xc6b41b){_0x3c5883=_(_0x3c5883)['union'](_0xc6b41b)['compact']()[_0x2b18('0x6d')]();return db[_0x2b18('0x1b')][_0x2b18('0x31')]({'where':{'id':_0x3ae081['params']['id']}})[_0x2b18('0x13')](function(_0x4f0db9){return db['sequelize'][_0x2b18('0x6e')](function(_0x38298a){return _0x4f0db9[_0x2b18('0x6f')](_0x3ae081[_0x2b18('0x23')][_0x2b18('0x55')],{'transaction':_0x38298a})[_0x2b18('0x13')](function(){if(!_[_0x2b18('0x70')](_0x3c5883)){return _0x4f0db9[_0x2b18('0x71')](_0x3c5883,{'transaction':_0x38298a});}})[_0x2b18('0x13')](function(){_0x3c5883[_0x2b18('0x72')](function(_0x493beb){socket[_0x2b18('0x5c')](_0x2b18('0x73'),{'UserId':_0x493beb,'FaxQueueId':_0x4f0db9['id']});});});});});});})[_0x2b18('0x13')](respondWithStatusCode(_0x1855e1,null))[_0x2b18('0x26')](handleError(_0x1855e1,null));};exports[_0x2b18('0x74')]=function(_0x4ce8b1,_0x2f8c00){return db[_0x2b18('0x1b')][_0x2b18('0x31')]({'where':{'id':_0x4ce8b1['params']['id']}})['then'](handleEntityNotFound(_0x2f8c00,null))['then'](function(_0x38763d){if(_0x38763d){return _0x38763d[_0x2b18('0x74')](_0x4ce8b1[_0x2b18('0x33')][_0x2b18('0x55')],_[_0x2b18('0x75')](_0x4ce8b1[_0x2b18('0x33')],[_0x2b18('0x55'),'id'])||{})[_0x2b18('0x76')](function(_0x4f9b68){for(var _0x3a821f=0x0;_0x3a821f<_0x4ce8b1[_0x2b18('0x33')][_0x2b18('0x55')]['length'];_0x3a821f+=0x1){socket[_0x2b18('0x5c')](_0x2b18('0x5d'),{'UserId':Number(_0x4ce8b1[_0x2b18('0x33')][_0x2b18('0x55')][_0x3a821f]),'FaxQueueId':Number(_0x4ce8b1[_0x2b18('0x28')]['id'])});}return _0x4f9b68;});}})['then'](respondWithResult(_0x2f8c00,null))[_0x2b18('0x26')](handleError(_0x2f8c00,null));};exports['removeAgents']=function(_0x3f8a17,_0x1ad7e6){return db[_0x2b18('0x1b')][_0x2b18('0x31')]({'where':{'id':_0x3f8a17[_0x2b18('0x28')]['id']}})['then'](handleEntityNotFound(_0x1ad7e6,null))[_0x2b18('0x13')](function(_0x1a834c){if(_0x1a834c){return _0x1a834c[_0x2b18('0x71')](_0x3f8a17[_0x2b18('0x23')][_0x2b18('0x55')])[_0x2b18('0x13')](function(){if(_[_0x2b18('0x77')](_0x3f8a17['query'][_0x2b18('0x55')])){for(var _0x5b2922=0x0;_0x5b2922<_0x3f8a17[_0x2b18('0x23')][_0x2b18('0x55')]['length'];_0x5b2922+=0x1){socket[_0x2b18('0x5c')](_0x2b18('0x73'),{'UserId':Number(_0x3f8a17['query'][_0x2b18('0x55')][_0x5b2922]),'FaxQueueId':Number(_0x3f8a17['params']['id'])});}}else{socket[_0x2b18('0x5c')](_0x2b18('0x73'),{'UserId':Number(_0x3f8a17['query'][_0x2b18('0x55')]),'FaxQueueId':Number(_0x3f8a17[_0x2b18('0x28')]['id'])});}});}})[_0x2b18('0x13')](respondWithStatusCode(_0x1ad7e6,null))[_0x2b18('0x26')](handleError(_0x1ad7e6,null));};exports[_0x2b18('0x78')]=function(_0x13100d,_0x5d2717){var _0xf9f8d6={};var _0x4cba79={};var _0x4b5978;var _0x1ee1bb;return db[_0x2b18('0x1b')][_0x2b18('0x3f')]({'where':{'id':_0x13100d['params']['id']}})[_0x2b18('0x13')](handleEntityNotFound(_0x5d2717,null))['then'](function(_0x480258){if(_0x480258){_0x4b5978=_0x480258;_0x4cba79[_0x2b18('0x2c')]=_[_0x2b18('0x29')](db['User']['rawAttributes']);_0x4cba79['query']=_[_0x2b18('0x29')](_0x13100d[_0x2b18('0x23')]);_0x4cba79['filters']=_[_0x2b18('0x2b')](_0x4cba79[_0x2b18('0x2c')],_0x4cba79[_0x2b18('0x23')]);_0xf9f8d6[_0x2b18('0x2d')]=_[_0x2b18('0x2b')](_0x4cba79['model'],qs['fields'](_0x13100d[_0x2b18('0x23')][_0x2b18('0x2e')]));_0xf9f8d6['attributes']=_0xf9f8d6[_0x2b18('0x2d')]['length']?_0xf9f8d6['attributes']:_0x4cba79[_0x2b18('0x2c')];_0xf9f8d6[_0x2b18('0x44')]=qs[_0x2b18('0x45')](_0x13100d[_0x2b18('0x23')][_0x2b18('0x45')]);_0xf9f8d6['where']=qs[_0x2b18('0x2a')](_[_0x2b18('0x46')](_0x13100d[_0x2b18('0x23')],_0x4cba79[_0x2b18('0x2a')]));if(_0x13100d[_0x2b18('0x23')][_0x2b18('0x48')]){_0xf9f8d6[_0x2b18('0x21')]=_['merge'](_0xf9f8d6[_0x2b18('0x21')],{'$or':_['map'](_0xf9f8d6[_0x2b18('0x2d')],function(_0x39739e){var _0x22184f={};_0x22184f[_0x39739e]={'$like':'%'+_0x13100d[_0x2b18('0x23')][_0x2b18('0x48')]+'%'};return _0x22184f;})});}_0xf9f8d6=_[_0x2b18('0x49')]({},_0xf9f8d6,_0x13100d[_0x2b18('0x30')]);return _0x4b5978['getAgents'](_0xf9f8d6);}})['then'](function(_0x5cf22a){if(_0x5cf22a){_0x1ee1bb=_0x5cf22a['length'];if(!_0x13100d[_0x2b18('0x23')][_0x2b18('0x41')]('nolimit')){_0xf9f8d6[_0x2b18('0x43')]=qs[_0x2b18('0x43')](_0x13100d['query'][_0x2b18('0x43')]);_0xf9f8d6[_0x2b18('0xf')]=qs['offset'](_0x13100d[_0x2b18('0x23')][_0x2b18('0xf')]);}return _0x4b5978[_0x2b18('0x78')](_0xf9f8d6);}})['then'](function(_0x36362a){if(_0x36362a){return _0x36362a?{'count':_0x1ee1bb,'rows':_0x36362a}:null;}})[_0x2b18('0x13')](respondWithResult(_0x5d2717,null))[_0x2b18('0x26')](handleError(_0x5d2717,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 2322a10..599a755 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 _0x1093=['../../mysqldb','save','update','remove','emit','events'];(function(_0x416d60,_0x56dde9){var _0x286bd7=function(_0x38ba01){while(--_0x38ba01){_0x416d60['push'](_0x416d60['shift']());}};_0x286bd7(++_0x56dde9);}(_0x1093,0xc5));var _0x3109=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x1093[_0x1b828b];return _0x98da1a;};'use strict';var EventEmitter=require(_0x3109('0x0'));var FaxQueue=require(_0x3109('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3109('0x2'),'afterUpdate':_0x3109('0x3'),'afterDestroy':_0x3109('0x4')};function emitEvent(_0x32f558){return function(_0x2a497b,_0x23baa1,_0x14b672){FaxQueueEvents[_0x3109('0x5')](_0x32f558+':'+_0x2a497b['id'],_0x2a497b);FaxQueueEvents[_0x3109('0x5')](_0x32f558,_0x2a497b);_0x14b672(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x43aa=['emit','hasOwnProperty','exports','events','setMaxListeners','save','update'];(function(_0x42f3e4,_0x2646fd){var _0x1d7aa6=function(_0x4a721d){while(--_0x4a721d){_0x42f3e4['push'](_0x42f3e4['shift']());}};_0x1d7aa6(++_0x2646fd);}(_0x43aa,0xc0));var _0xa43a=function(_0x33cc3f,_0x1661f1){_0x33cc3f=_0x33cc3f-0x0;var _0x4fdc9c=_0x43aa[_0x33cc3f];return _0x4fdc9c;};'use strict';var EventEmitter=require(_0xa43a('0x0'));var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xa43a('0x1')](0x0);var events={'afterCreate':_0xa43a('0x2'),'afterUpdate':_0xa43a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2edfb3){return function(_0x5ca8dd,_0x1afdeb,_0x1fc4a7){FaxQueueEvents['emit'](_0x2edfb3+':'+_0x5ca8dd['id'],_0x5ca8dd);FaxQueueEvents[_0xa43a('0x4')](_0x2edfb3,_0x5ca8dd);_0x1fc4a7(null);};}for(var e in events){if(events[_0xa43a('0x5')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xa43a('0x6')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index ef985a9..10ece18 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 _0x5256=['moment','../../config/environment','exports','FaxQueue','fax_queues','lodash','../../config/logger','api'];(function(_0x1e1310,_0x3ec252){var _0x16c586=function(_0x24ba03){while(--_0x24ba03){_0x1e1310['push'](_0x1e1310['shift']());}};_0x16c586(++_0x3ec252);}(_0x5256,0x1ad));var _0x6525=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x5256[_0x24061a];return _0x82054e;};'use strict';var _=require(_0x6525('0x0'));var util=require('util');var logger=require(_0x6525('0x1'))(_0x6525('0x2'));var moment=require(_0x6525('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6525('0x4'));var attributes=require('./faxQueue.attributes');module[_0x6525('0x5')]=function(_0x267895,_0x4b8de9){return _0x267895['define'](_0x6525('0x6'),attributes,{'tableName':_0x6525('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x63bd=['request-promise','rimraf','../../config/environment','define','fax_queues','lodash','util','../../config/logger','api'];(function(_0x1eefed,_0x3f8717){var _0x37f295=function(_0x1d213f){while(--_0x1d213f){_0x1eefed['push'](_0x1eefed['shift']());}};_0x37f295(++_0x3f8717);}(_0x63bd,0x83));var _0xd63b=function(_0x479aa9,_0x58e131){_0x479aa9=_0x479aa9-0x0;var _0x3396d3=_0x63bd[_0x479aa9];return _0x3396d3;};'use strict';var _=require(_0xd63b('0x0'));var util=require(_0xd63b('0x1'));var logger=require(_0xd63b('0x2'))(_0xd63b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd63b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd63b('0x5'));var config=require(_0xd63b('0x6'));var attributes=require('./faxQueue.attributes');module['exports']=function(_0x469927,_0x38f251){return _0x469927[_0xd63b('0x7')]('FaxQueue',attributes,{'tableName':_0xd63b('0x8'),'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 07c5f39..365280d 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 _0x4b24=['FaxQueue','findAll','options','raw','where','include','map','model','attributes','ShowFaxQueue','find','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./faxQueue.socket','register','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetFaxQueue'];(function(_0x2e641b,_0x1b03ae){var _0x3f15a9=function(_0x2ba7db){while(--_0x2ba7db){_0x2e641b['push'](_0x2e641b['shift']());}};_0x3f15a9(++_0x1b03ae);}(_0x4b24,0x197));var _0x44b2=function(_0x20c474,_0x4b9323){_0x20c474=_0x20c474-0x0;var _0x284af2=_0x4b24[_0x20c474];return _0x284af2;};'use strict';var _=require(_0x44b2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x44b2('0x1'));var db=require(_0x44b2('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x44b2('0x3'))(_0x44b2('0x4'));var config=require(_0x44b2('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x44b2('0x6')][_0x44b2('0x7')]({'port':0x232a});config[_0x44b2('0x8')]=_[_0x44b2('0x9')](config[_0x44b2('0x8')],{'host':_0x44b2('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x44b2('0x8')]));require(_0x44b2('0xb'))[_0x44b2('0xc')](socket);function respondWithRpcPromise(_0x56404d,_0xe06a2c,_0x412f79){return new BPromise(function(_0x2116dd,_0x4bb339){return client['request'](_0x56404d,_0x412f79)[_0x44b2('0xd')](function(_0x1323f8){logger['info'](_0x44b2('0xe'),_0xe06a2c,_0x44b2('0xf'));logger[_0x44b2('0x10')](_0x44b2('0x11'),_0xe06a2c,_0x44b2('0xf'),JSON[_0x44b2('0x12')](_0x1323f8));if(_0x1323f8[_0x44b2('0x13')]){if(_0x1323f8[_0x44b2('0x13')]['code']===0x1f4){logger[_0x44b2('0x13')](_0x44b2('0xe'),_0xe06a2c,_0x1323f8['error'][_0x44b2('0x14')]);return _0x4bb339(_0x1323f8[_0x44b2('0x13')][_0x44b2('0x14')]);}logger[_0x44b2('0x13')](_0x44b2('0xe'),_0xe06a2c,_0x1323f8['error'][_0x44b2('0x14')]);return _0x2116dd(_0x1323f8[_0x44b2('0x13')][_0x44b2('0x14')]);}else{logger[_0x44b2('0x15')]('FaxQueue,\x20%s,\x20%s',_0xe06a2c,_0x44b2('0xf'));_0x2116dd(_0x1323f8[_0x44b2('0x16')][_0x44b2('0x14')]);}})[_0x44b2('0x17')](function(_0x346ee4){logger[_0x44b2('0x13')](_0x44b2('0xe'),_0xe06a2c,_0x346ee4);_0x4bb339(_0x346ee4);});});}exports[_0x44b2('0x18')]=function(_0x9934ef){var _0x2b4bb3=this;return new Promise(function(_0x86298a,_0x4fddf5){return db[_0x44b2('0x19')][_0x44b2('0x1a')]({'raw':_0x9934ef[_0x44b2('0x1b')]?_0x9934ef[_0x44b2('0x1b')][_0x44b2('0x1c')]===undefined?!![]:![]:!![],'where':_0x9934ef[_0x44b2('0x1b')]?_0x9934ef['options'][_0x44b2('0x1d')]||null:null,'attributes':_0x9934ef['options']?_0x9934ef['options']['attributes']||null:null,'limit':_0x9934ef['options']?_0x9934ef[_0x44b2('0x1b')]['limit']||null:null,'include':_0x9934ef[_0x44b2('0x1b')]?_0x9934ef['options'][_0x44b2('0x1e')]?_[_0x44b2('0x1f')](_0x9934ef[_0x44b2('0x1b')][_0x44b2('0x1e')],function(_0x35e66b){return{'model':db[_0x35e66b[_0x44b2('0x20')]],'as':_0x35e66b['as'],'attributes':_0x35e66b['attributes'],'include':_0x35e66b[_0x44b2('0x1e')]?_['map'](_0x35e66b['include'],function(_0x63ce2d){return{'model':db[_0x63ce2d[_0x44b2('0x20')]],'as':_0x63ce2d['as'],'attributes':_0x63ce2d[_0x44b2('0x21')],'include':_0x63ce2d['include']?_[_0x44b2('0x1f')](_0x63ce2d['include'],function(_0xed752a){return{'model':db[_0xed752a['model']],'as':_0xed752a['as'],'attributes':_0xed752a[_0x44b2('0x21')]};}):[]};}):[]};}):[]:[]})[_0x44b2('0xd')](function(_0x2c6adb){logger['info']('GetFaxQueue',_0x9934ef);logger[_0x44b2('0x10')](_0x44b2('0x18'),_0x9934ef,JSON[_0x44b2('0x12')](_0x2c6adb));_0x86298a(_0x2c6adb);})[_0x44b2('0x17')](function(_0x143b49){logger[_0x44b2('0x13')](_0x44b2('0x18'),_0x143b49[_0x44b2('0x14')],_0x9934ef);_0x4fddf5(_0x2b4bb3[_0x44b2('0x13')](0x1f4,_0x143b49[_0x44b2('0x14')]));});});};exports[_0x44b2('0x22')]=function(_0x53d872){var _0x134f0a=this;return new Promise(function(_0x361f03,_0x51ca6c){return db[_0x44b2('0x19')][_0x44b2('0x23')]({'raw':_0x53d872[_0x44b2('0x1b')]?_0x53d872['options'][_0x44b2('0x1c')]===undefined?!![]:![]:!![],'where':_0x53d872[_0x44b2('0x1b')]?_0x53d872['options'][_0x44b2('0x1d')]||null:null,'attributes':_0x53d872['options']?_0x53d872[_0x44b2('0x1b')][_0x44b2('0x21')]||null:null,'include':_0x53d872[_0x44b2('0x1b')]?_0x53d872['options'][_0x44b2('0x1e')]?_[_0x44b2('0x1f')](_0x53d872[_0x44b2('0x1b')][_0x44b2('0x1e')],function(_0x10e730){return{'model':db[_0x10e730['model']],'as':_0x10e730['as'],'attributes':_0x10e730['attributes'],'include':_0x10e730[_0x44b2('0x1e')]?_[_0x44b2('0x1f')](_0x10e730[_0x44b2('0x1e')],function(_0x599fb6){return{'model':db[_0x599fb6[_0x44b2('0x20')]],'as':_0x599fb6['as'],'attributes':_0x599fb6[_0x44b2('0x21')],'include':_0x599fb6[_0x44b2('0x1e')]?_[_0x44b2('0x1f')](_0x599fb6['include'],function(_0x567929){return{'model':db[_0x567929[_0x44b2('0x20')]],'as':_0x567929['as'],'attributes':_0x567929[_0x44b2('0x21')]};}):[]};}):[]};}):[]:[]})[_0x44b2('0xd')](function(_0x116db8){logger[_0x44b2('0x15')](_0x44b2('0x22'),_0x53d872);logger['debug'](_0x44b2('0x22'),_0x53d872,JSON[_0x44b2('0x12')](_0x116db8));_0x361f03(_0x116db8);})[_0x44b2('0x17')](function(_0x181eec){logger[_0x44b2('0x13')](_0x44b2('0x22'),_0x181eec[_0x44b2('0x14')],_0x53d872);_0x51ca6c(_0x134f0a[_0x44b2('0x13')](0x1f4,_0x181eec[_0x44b2('0x14')]));});});}; \ No newline at end of file +var _0xeafd=['localhost','socket.io-emitter','register','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','findAll','options','raw','attributes','limit','include','map','info','GetFaxQueue','debug','ShowFaxQueue','FaxQueue','find','where','model','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x41f29a,_0x11c7ec){var _0x326489=function(_0x2a2a9a){while(--_0x2a2a9a){_0x41f29a['push'](_0x41f29a['shift']());}};_0x326489(++_0x11c7ec);}(_0xeafd,0x111));var _0xdeaf=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0xeafd[_0x24259d];return _0x5a701;};'use strict';var _=require(_0xdeaf('0x0'));var util=require(_0xdeaf('0x1'));var moment=require(_0xdeaf('0x2'));var BPromise=require(_0xdeaf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdeaf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdeaf('0x5'));var logger=require(_0xdeaf('0x6'))(_0xdeaf('0x7'));var config=require(_0xdeaf('0x8'));var jayson=require(_0xdeaf('0x9'));var client=jayson[_0xdeaf('0xa')][_0xdeaf('0xb')]({'port':0x232a});config[_0xdeaf('0xc')]=_[_0xdeaf('0xd')](config[_0xdeaf('0xc')],{'host':_0xdeaf('0xe'),'port':0x18eb});var socket=require(_0xdeaf('0xf'))(new Redis(config['redis']));require('./faxQueue.socket')[_0xdeaf('0x10')](socket);function respondWithRpcPromise(_0x44af33,_0x194d81,_0x4c269d){return new BPromise(function(_0x54abca,_0x1065a5){return client[_0xdeaf('0x11')](_0x44af33,_0x4c269d)[_0xdeaf('0x12')](function(_0x529142){logger['info'](_0xdeaf('0x13'),_0x194d81,_0xdeaf('0x14'));logger['debug']('FaxQueue,\x20%s,\x20%s,\x20%s',_0x194d81,_0xdeaf('0x14'),JSON[_0xdeaf('0x15')](_0x529142));if(_0x529142[_0xdeaf('0x16')]){if(_0x529142[_0xdeaf('0x16')]['code']===0x1f4){logger[_0xdeaf('0x16')]('FaxQueue,\x20%s,\x20%s',_0x194d81,_0x529142['error'][_0xdeaf('0x17')]);return _0x1065a5(_0x529142[_0xdeaf('0x16')][_0xdeaf('0x17')]);}logger['error'](_0xdeaf('0x13'),_0x194d81,_0x529142[_0xdeaf('0x16')][_0xdeaf('0x17')]);return _0x54abca(_0x529142[_0xdeaf('0x16')][_0xdeaf('0x17')]);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x194d81,_0xdeaf('0x14'));_0x54abca(_0x529142[_0xdeaf('0x18')][_0xdeaf('0x17')]);}})[_0xdeaf('0x19')](function(_0x2ed304){logger['error'](_0xdeaf('0x13'),_0x194d81,_0x2ed304);_0x1065a5(_0x2ed304);});});}exports['GetFaxQueue']=function(_0x15a7d2){var _0x393408=this;return new Promise(function(_0x9dbfef,_0x53b7fc){return db['FaxQueue'][_0xdeaf('0x1a')]({'raw':_0x15a7d2[_0xdeaf('0x1b')]?_0x15a7d2[_0xdeaf('0x1b')][_0xdeaf('0x1c')]===undefined?!![]:![]:!![],'where':_0x15a7d2['options']?_0x15a7d2[_0xdeaf('0x1b')]['where']||null:null,'attributes':_0x15a7d2[_0xdeaf('0x1b')]?_0x15a7d2[_0xdeaf('0x1b')][_0xdeaf('0x1d')]||null:null,'limit':_0x15a7d2['options']?_0x15a7d2[_0xdeaf('0x1b')][_0xdeaf('0x1e')]||null:null,'include':_0x15a7d2[_0xdeaf('0x1b')]?_0x15a7d2[_0xdeaf('0x1b')][_0xdeaf('0x1f')]?_['map'](_0x15a7d2['options']['include'],function(_0x6a7cf6){return{'model':db[_0x6a7cf6['model']],'as':_0x6a7cf6['as'],'attributes':_0x6a7cf6[_0xdeaf('0x1d')],'include':_0x6a7cf6[_0xdeaf('0x1f')]?_['map'](_0x6a7cf6[_0xdeaf('0x1f')],function(_0x240d0b){return{'model':db[_0x240d0b['model']],'as':_0x240d0b['as'],'attributes':_0x240d0b['attributes'],'include':_0x240d0b[_0xdeaf('0x1f')]?_[_0xdeaf('0x20')](_0x240d0b['include'],function(_0x5266ad){return{'model':db[_0x5266ad['model']],'as':_0x5266ad['as'],'attributes':_0x5266ad[_0xdeaf('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x7d95b3){logger[_0xdeaf('0x21')](_0xdeaf('0x22'),_0x15a7d2);logger[_0xdeaf('0x23')](_0xdeaf('0x22'),_0x15a7d2,JSON[_0xdeaf('0x15')](_0x7d95b3));_0x9dbfef(_0x7d95b3);})[_0xdeaf('0x19')](function(_0x35aa0c){logger[_0xdeaf('0x16')](_0xdeaf('0x22'),_0x35aa0c['message'],_0x15a7d2);_0x53b7fc(_0x393408[_0xdeaf('0x16')](0x1f4,_0x35aa0c['message']));});});};exports[_0xdeaf('0x24')]=function(_0x5f3189){var _0x5e6e95=this;return new Promise(function(_0x4fd3c9,_0x56b529){return db[_0xdeaf('0x25')][_0xdeaf('0x26')]({'raw':_0x5f3189[_0xdeaf('0x1b')]?_0x5f3189[_0xdeaf('0x1b')][_0xdeaf('0x1c')]===undefined?!![]:![]:!![],'where':_0x5f3189[_0xdeaf('0x1b')]?_0x5f3189['options'][_0xdeaf('0x27')]||null:null,'attributes':_0x5f3189[_0xdeaf('0x1b')]?_0x5f3189[_0xdeaf('0x1b')][_0xdeaf('0x1d')]||null:null,'include':_0x5f3189[_0xdeaf('0x1b')]?_0x5f3189['options']['include']?_[_0xdeaf('0x20')](_0x5f3189[_0xdeaf('0x1b')]['include'],function(_0x19cce9){return{'model':db[_0x19cce9[_0xdeaf('0x28')]],'as':_0x19cce9['as'],'attributes':_0x19cce9['attributes'],'include':_0x19cce9[_0xdeaf('0x1f')]?_[_0xdeaf('0x20')](_0x19cce9[_0xdeaf('0x1f')],function(_0x21ed25){return{'model':db[_0x21ed25[_0xdeaf('0x28')]],'as':_0x21ed25['as'],'attributes':_0x21ed25[_0xdeaf('0x1d')],'include':_0x21ed25[_0xdeaf('0x1f')]?_[_0xdeaf('0x20')](_0x21ed25[_0xdeaf('0x1f')],function(_0x5c7d81){return{'model':db[_0x5c7d81[_0xdeaf('0x28')]],'as':_0x5c7d81['as'],'attributes':_0x5c7d81[_0xdeaf('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xdeaf('0x12')](function(_0x584b80){logger['info'](_0xdeaf('0x24'),_0x5f3189);logger[_0xdeaf('0x23')]('ShowFaxQueue',_0x5f3189,JSON[_0xdeaf('0x15')](_0x584b80));_0x4fd3c9(_0x584b80);})['catch'](function(_0x48159f){logger[_0xdeaf('0x16')](_0xdeaf('0x24'),_0x48159f[_0xdeaf('0x17')],_0x5f3189);_0x56b529(_0x5e6e95[_0xdeaf('0x16')](0x1f4,_0x48159f[_0xdeaf('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index f7d6546..1c98e96 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 _0x7756=['update','emit','removeListener','register','length','remove'];(function(_0x42e7fc,_0x11cd53){var _0x4bddf1=function(_0x290e53){while(--_0x290e53){_0x42e7fc['push'](_0x42e7fc['shift']());}};_0x4bddf1(++_0x11cd53);}(_0x7756,0x131));var _0x6775=function(_0x5b9b71,_0x323100){_0x5b9b71=_0x5b9b71-0x0;var _0x1655a5=_0x7756[_0x5b9b71];return _0x1655a5;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=['save',_0x6775('0x0'),_0x6775('0x1')];function createListener(_0x460c0a,_0x3dff65){return function(_0x1e018b){_0x3dff65[_0x6775('0x2')](_0x460c0a,_0x1e018b);};}function removeListener(_0x1a8369,_0xc65cb4){return function(){FaxQueueEvents[_0x6775('0x3')](_0x1a8369,_0xc65cb4);};}exports[_0x6775('0x4')]=function(_0x13edd3){for(var _0x188e1f=0x0,_0x17a5d2=events[_0x6775('0x5')];_0x188e1f<_0x17a5d2;_0x188e1f++){var _0x22cc26=events[_0x188e1f];var _0x426515=createListener('faxQueue:'+_0x22cc26,_0x13edd3);FaxQueueEvents['on'](_0x22cc26,_0x426515);}}; \ No newline at end of file +var _0x7958=['register','length','faxQueue:','./faxQueue.events','save','remove','removeListener'];(function(_0x962de1,_0x361057){var _0x14085a=function(_0x220dae){while(--_0x220dae){_0x962de1['push'](_0x962de1['shift']());}};_0x14085a(++_0x361057);}(_0x7958,0x88));var _0x8795=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7958[_0x3dd15e];return _0x231fd0;};'use strict';var FaxQueueEvents=require(_0x8795('0x0'));var events=[_0x8795('0x1'),_0x8795('0x2'),'update'];function createListener(_0xd7c663,_0x2c8f52){return function(_0x3d3b97){_0x2c8f52['emit'](_0xd7c663,_0x3d3b97);};}function removeListener(_0x3f9038,_0x2c0b67){return function(){FaxQueueEvents[_0x8795('0x3')](_0x3f9038,_0x2c0b67);};}exports[_0x8795('0x4')]=function(_0xe998eb){for(var _0x33466b=0x0,_0x31aafa=events[_0x8795('0x5')];_0x33466b<_0x31aafa;_0x33466b++){var _0x15245a=events[_0x33466b];var _0x2fcf69=createListener(_0x8795('0x6')+_0x15245a,_0xe998eb);FaxQueueEvents['on'](_0x15245a,_0x2fcf69);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 002f0ba..1276941 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 _0xdb28=['../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xdb28,0x106));var _0x8db2=function(_0x4f6bd3,_0x3b002c){_0x4f6bd3=_0x4f6bd3-0x0;var _0xedae5a=_0xdb28[_0x4f6bd3];return _0xedae5a;};'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('./faxQueue.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getTeams']);router[_0x8db2('0x9')](_0x8db2('0x12'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8db2('0x14')](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x15')]);router[_0x8db2('0x14')](_0x8db2('0x12'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);router[_0x8db2('0x17')](_0x8db2('0xd'),auth['isAuthenticated'](),controller[_0x8db2('0x18')]);router[_0x8db2('0x19')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1a')]);router[_0x8db2('0x19')](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x1b')]);router['delete']('/:id/users',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1c')]);module[_0x8db2('0x1d')]=router; \ No newline at end of file +var _0x5e0e=['get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addAgents','put','update','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x54a024,_0x56ace9){var _0x35d9f0=function(_0x44c08a){while(--_0x44c08a){_0x54a024['push'](_0x54a024['shift']());}};_0x35d9f0(++_0x56ace9);}(_0x5e0e,0x89));var _0xe5e0=function(_0x4a57b0,_0x3ee928){_0x4a57b0=_0x4a57b0-0x0;var _0x5e82c8=_0x5e0e[_0x4a57b0];return _0x5e82c8;};'use strict';var multer=require(_0xe5e0('0x0'));var util=require(_0xe5e0('0x1'));var path=require('path');var timeout=require(_0xe5e0('0x2'));var express=require(_0xe5e0('0x3'));var router=express[_0xe5e0('0x4')]();var fs_extra=require(_0xe5e0('0x5'));var auth=require(_0xe5e0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe5e0('0x7'));var controller=require('./faxQueue.controller');router[_0xe5e0('0x8')]('/',auth[_0xe5e0('0x9')](),controller[_0xe5e0('0xa')]);router[_0xe5e0('0x8')](_0xe5e0('0xb'),auth[_0xe5e0('0x9')](),controller['describe']);router[_0xe5e0('0x8')](_0xe5e0('0xc'),auth['isAuthenticated'](),controller[_0xe5e0('0xd')]);router[_0xe5e0('0x8')](_0xe5e0('0xe'),auth[_0xe5e0('0x9')](),controller[_0xe5e0('0xf')]);router[_0xe5e0('0x8')](_0xe5e0('0x10'),auth[_0xe5e0('0x9')](),controller[_0xe5e0('0x11')]);router[_0xe5e0('0x8')](_0xe5e0('0x12'),auth[_0xe5e0('0x9')](),controller[_0xe5e0('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe5e0('0x14')]);router[_0xe5e0('0x15')](_0xe5e0('0x10'),auth[_0xe5e0('0x9')](),controller['addTeams']);router[_0xe5e0('0x15')](_0xe5e0('0x12'),auth[_0xe5e0('0x9')](),controller[_0xe5e0('0x16')]);router[_0xe5e0('0x17')](_0xe5e0('0xc'),auth[_0xe5e0('0x9')](),controller[_0xe5e0('0x18')]);router[_0xe5e0('0x19')]('/:id',auth[_0xe5e0('0x9')](),controller['destroy']);router[_0xe5e0('0x19')]('/:id/teams',auth[_0xe5e0('0x9')](),controller[_0xe5e0('0x1a')]);router['delete'](_0xe5e0('0x12'),auth['isAuthenticated'](),controller[_0xe5e0('0x1b')]);module[_0xe5e0('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 12a13d5..ba24014 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 _0xe48a=['DATE','moment','exports','STRING'];(function(_0x4641d9,_0x3362db){var _0x58b071=function(_0x20b9ab){while(--_0x20b9ab){_0x4641d9['push'](_0x4641d9['shift']());}};_0x58b071(++_0x3362db);}(_0xe48a,0xad));var _0xae48=function(_0x1c1820,_0x18bb79){_0x1c1820=_0x1c1820-0x0;var _0x6690e6=_0xe48a[_0x1c1820];return _0x6690e6;};'use strict';var moment=require(_0xae48('0x0'));var Sequelize=require('sequelize');module[_0xae48('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xae48('0x2')]},'joinAt':{'type':Sequelize[_0xae48('0x3')]},'leaveAt':{'type':Sequelize[_0xae48('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xae48('0x3')]},'reason':{'type':Sequelize[_0xae48('0x2')]}}; \ No newline at end of file +var _0x6799=['DATE','STRING'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x6799,0x1ed));var _0x9679=function(_0xfa15c3,_0x1d216a){_0xfa15c3=_0xfa15c3-0x0;var _0x1bdcea=_0x6799[_0xfa15c3];return _0x1bdcea;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x9679('0x0')],'allowNull':![]},'from':{'type':Sequelize[_0x9679('0x0')]},'joinAt':{'type':Sequelize[_0x9679('0x1')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x9679('0x1')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 72c3793..7820f9f 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 _0x6658=['includeAll','find','catch','create','body','update','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','limit','set','Content-Range','save','then','destroy','end','sendStatus','stack','name','send','index','FaxQueueReport','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','show'];(function(_0x35fabd,_0x825452){var _0x61a8ee=function(_0x218f4c){while(--_0x218f4c){_0x35fabd['push'](_0x35fabd['shift']());}};_0x61a8ee(++_0x825452);}(_0x6658,0x198));var _0x8665=function(_0x10d19d,_0x1bc975){_0x10d19d=_0x10d19d-0x0;var _0x6ec46b=_0x6658[_0x10d19d];return _0x6ec46b;};'use strict';var emlformat=require(_0x8665('0x0'));var rimraf=require(_0x8665('0x1'));var zipdir=require(_0x8665('0x2'));var jsonpatch=require(_0x8665('0x3'));var rp=require(_0x8665('0x4'));var moment=require(_0x8665('0x5'));var BPromise=require(_0x8665('0x6'));var Mustache=require(_0x8665('0x7'));var util=require('util');var path=require(_0x8665('0x8'));var sox=require(_0x8665('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8665('0xa'));var _=require(_0x8665('0xb'));var squel=require(_0x8665('0xc'));var crypto=require(_0x8665('0xd'));var jsforce=require(_0x8665('0xe'));var deskjs=require(_0x8665('0xf'));var toCsv=require(_0x8665('0x10'));var querystring=require(_0x8665('0x11'));var Papa=require('papaparse');var Redis=require(_0x8665('0x12'));var authService=require(_0x8665('0x13'));var qs=require(_0x8665('0x14'));var as=require(_0x8665('0x15'));var hardwareService=require(_0x8665('0x16'));var logger=require(_0x8665('0x17'))(_0x8665('0x18'));var utils=require(_0x8665('0x19'));var config=require(_0x8665('0x1a'));var licenseUtil=require(_0x8665('0x1b'));var db=require(_0x8665('0x1c'))['db'];function respondWithStatusCode(_0x30d476,_0x26ffc9){_0x26ffc9=_0x26ffc9||0xcc;return function(_0x689905){if(_0x689905){return _0x30d476['sendStatus'](_0x26ffc9);}return _0x30d476[_0x8665('0x1d')](_0x26ffc9)['end']();};}function respondWithResult(_0x3d8f0b,_0x16452c){_0x16452c=_0x16452c||0xc8;return function(_0xfef706){if(_0xfef706){return _0x3d8f0b[_0x8665('0x1d')](_0x16452c)[_0x8665('0x1e')](_0xfef706);}};}function respondWithFilteredResult(_0x2a0507,_0x5186e4){return function(_0x222e87){if(_0x222e87){var _0xa2545a=typeof _0x5186e4['offset']===_0x8665('0x1f')&&typeof _0x5186e4['limit']===_0x8665('0x1f');var _0x383b79=_0x222e87[_0x8665('0x20')];var _0x50ba7d=_0xa2545a?0x0:_0x5186e4[_0x8665('0x21')];var _0x235617=_0xa2545a?_0x222e87['count']:_0x5186e4[_0x8665('0x21')]+_0x5186e4[_0x8665('0x22')];var _0x16f1f1;if(_0x235617>=_0x383b79){_0x235617=_0x383b79;_0x16f1f1=0xc8;}else{_0x16f1f1=0xce;}_0x2a0507['status'](_0x16f1f1);return _0x2a0507[_0x8665('0x23')](_0x8665('0x24'),_0x50ba7d+'-'+_0x235617+'/'+_0x383b79)[_0x8665('0x1e')](_0x222e87);}return null;};}function patchUpdates(_0x549a0a){return function(_0x519d5c){try{jsonpatch['apply'](_0x519d5c,_0x549a0a,!![]);}catch(_0x29154d){return BPromise['reject'](_0x29154d);}return _0x519d5c[_0x8665('0x25')]();};}function saveUpdates(_0x53d764,_0x34b622){return function(_0x4dc4f7){if(_0x4dc4f7){return _0x4dc4f7['update'](_0x53d764)[_0x8665('0x26')](function(_0x406e8a){return _0x406e8a;});}return null;};}function removeEntity(_0x512d8e,_0x38e3f5){return function(_0x1d7f74){if(_0x1d7f74){return _0x1d7f74[_0x8665('0x27')]()[_0x8665('0x26')](function(){_0x512d8e['status'](0xcc)[_0x8665('0x28')]();});}};}function handleEntityNotFound(_0x41394e,_0x4583f2){return function(_0x3eee64){if(!_0x3eee64){_0x41394e[_0x8665('0x29')](0x194);}return _0x3eee64;};}function handleError(_0x3c9fe3,_0x2f143f){_0x2f143f=_0x2f143f||0x1f4;return function(_0x172f47){logger['error'](_0x172f47[_0x8665('0x2a')]);if(_0x172f47[_0x8665('0x2b')]){delete _0x172f47[_0x8665('0x2b')];}_0x3c9fe3['status'](_0x2f143f)[_0x8665('0x2c')](_0x172f47);};}exports[_0x8665('0x2d')]=function(_0x149c8f,_0x1f4ebd){var _0xe34d5f={},_0x3b0302={},_0x313fca={'count':0x0,'rows':[]};var _0x183b4c=_['map'](db[_0x8665('0x2e')][_0x8665('0x2f')],function(_0x4ff80a){return{'name':_0x4ff80a[_0x8665('0x30')],'type':_0x4ff80a[_0x8665('0x31')][_0x8665('0x32')]};});_0x3b0302['model']=_[_0x8665('0x33')](_0x183b4c,'name');_0x3b0302['query']=_[_0x8665('0x34')](_0x149c8f[_0x8665('0x35')]);_0x3b0302[_0x8665('0x36')]=_[_0x8665('0x37')](_0x3b0302[_0x8665('0x38')],_0x3b0302[_0x8665('0x35')]);_0xe34d5f[_0x8665('0x39')]=_[_0x8665('0x37')](_0x3b0302['model'],qs[_0x8665('0x3a')](_0x149c8f[_0x8665('0x35')][_0x8665('0x3a')]));_0xe34d5f[_0x8665('0x39')]=_0xe34d5f[_0x8665('0x39')][_0x8665('0x3b')]?_0xe34d5f[_0x8665('0x39')]:_0x3b0302[_0x8665('0x38')];if(!_0x149c8f[_0x8665('0x35')][_0x8665('0x3c')](_0x8665('0x3d'))){_0xe34d5f[_0x8665('0x22')]=qs[_0x8665('0x22')](_0x149c8f[_0x8665('0x35')][_0x8665('0x22')]);_0xe34d5f[_0x8665('0x21')]=qs[_0x8665('0x21')](_0x149c8f[_0x8665('0x35')][_0x8665('0x21')]);}_0xe34d5f[_0x8665('0x3e')]=qs['sort'](_0x149c8f[_0x8665('0x35')][_0x8665('0x3f')]);_0xe34d5f[_0x8665('0x40')]=qs['filters'](_[_0x8665('0x41')](_0x149c8f[_0x8665('0x35')],_0x3b0302['filters']),_0x183b4c);if(_0x149c8f[_0x8665('0x35')][_0x8665('0x42')]){_0xe34d5f[_0x8665('0x40')]=_['merge'](_0xe34d5f['where'],{'$or':_[_0x8665('0x33')](_0x183b4c,function(_0xdbe67d){if(_0xdbe67d['type']!=='VIRTUAL'){var _0x8716c0={};_0x8716c0[_0xdbe67d[_0x8665('0x2b')]]={'$like':'%'+_0x149c8f[_0x8665('0x35')][_0x8665('0x42')]+'%'};return _0x8716c0;}})});}_0xe34d5f=_[_0x8665('0x43')]({},_0xe34d5f,_0x149c8f[_0x8665('0x44')]);var _0x315d3b={'where':_0xe34d5f[_0x8665('0x40')]};return db[_0x8665('0x2e')][_0x8665('0x20')](_0x315d3b)['then'](function(_0x4e3beb){_0x313fca[_0x8665('0x20')]=_0x4e3beb;if(_0x149c8f[_0x8665('0x35')]['includeAll']){_0xe34d5f[_0x8665('0x45')]=[{'all':!![]}];}return db[_0x8665('0x2e')][_0x8665('0x46')](_0xe34d5f);})[_0x8665('0x26')](function(_0xfeffde){_0x313fca['rows']=_0xfeffde;return _0x313fca;})[_0x8665('0x26')](respondWithFilteredResult(_0x1f4ebd,_0xe34d5f))['catch'](handleError(_0x1f4ebd,null));};exports[_0x8665('0x47')]=function(_0x584884,_0x524659){var _0x11fcc8={'raw':!![],'where':{'id':_0x584884['params']['id']}},_0x64c10f={};_0x64c10f['model']=_[_0x8665('0x34')](db[_0x8665('0x2e')][_0x8665('0x2f')]);_0x64c10f['query']=_['keys'](_0x584884[_0x8665('0x35')]);_0x64c10f[_0x8665('0x36')]=_[_0x8665('0x37')](_0x64c10f[_0x8665('0x38')],_0x64c10f[_0x8665('0x35')]);_0x11fcc8['attributes']=_[_0x8665('0x37')](_0x64c10f[_0x8665('0x38')],qs['fields'](_0x584884['query'][_0x8665('0x3a')]));_0x11fcc8[_0x8665('0x39')]=_0x11fcc8['attributes'][_0x8665('0x3b')]?_0x11fcc8[_0x8665('0x39')]:_0x64c10f[_0x8665('0x38')];if(_0x584884[_0x8665('0x35')][_0x8665('0x48')]){_0x11fcc8[_0x8665('0x45')]=[{'all':!![]}];}_0x11fcc8=_[_0x8665('0x43')]({},_0x11fcc8,_0x584884[_0x8665('0x44')]);return db[_0x8665('0x2e')][_0x8665('0x49')](_0x11fcc8)[_0x8665('0x26')](handleEntityNotFound(_0x524659,null))[_0x8665('0x26')](respondWithResult(_0x524659,null))[_0x8665('0x4a')](handleError(_0x524659,null));};exports['create']=function(_0x501de6,_0x3fa95f){return db['FaxQueueReport'][_0x8665('0x4b')](_0x501de6[_0x8665('0x4c')],{})['then'](respondWithResult(_0x3fa95f,0xc9))[_0x8665('0x4a')](handleError(_0x3fa95f,null));};exports[_0x8665('0x4d')]=function(_0x6ec1ff,_0x26240a){if(_0x6ec1ff[_0x8665('0x4c')]['id']){delete _0x6ec1ff[_0x8665('0x4c')]['id'];}return db['FaxQueueReport'][_0x8665('0x49')]({'where':{'id':_0x6ec1ff[_0x8665('0x4e')]['id']}})['then'](handleEntityNotFound(_0x26240a,null))['then'](saveUpdates(_0x6ec1ff[_0x8665('0x4c')],null))[_0x8665('0x26')](respondWithResult(_0x26240a,null))[_0x8665('0x4a')](handleError(_0x26240a,null));};exports[_0x8665('0x27')]=function(_0x46e6bd,_0x4f848a){return db['FaxQueueReport'][_0x8665('0x49')]({'where':{'id':_0x46e6bd[_0x8665('0x4e')]['id']}})[_0x8665('0x26')](handleEntityNotFound(_0x4f848a,null))[_0x8665('0x26')](removeEntity(_0x4f848a,null))['catch'](handleError(_0x4f848a,null));};exports[_0x8665('0x4f')]=function(_0x10ac24,_0x4c4c36){return db[_0x8665('0x2e')][_0x8665('0x4f')]()[_0x8665('0x26')](respondWithResult(_0x4c4c36,null))[_0x8665('0x4a')](handleError(_0x4c4c36,null));}; \ No newline at end of file +var _0xb11e=['ejs','squel','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','limit','count','then','destroy','sendStatus','stack','name','send','map','FaxQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','catch','params','include','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox'];(function(_0xc6b2ff,_0x1558d7){var _0x47f7a4=function(_0x1241f7){while(--_0x1241f7){_0xc6b2ff['push'](_0xc6b2ff['shift']());}};_0x47f7a4(++_0x1558d7);}(_0xb11e,0x7d));var _0xeb11=function(_0x34ca66,_0x42fa4d){_0x34ca66=_0x34ca66-0x0;var _0x450724=_0xb11e[_0x34ca66];return _0x450724;};'use strict';var emlformat=require(_0xeb11('0x0'));var rimraf=require(_0xeb11('0x1'));var zipdir=require(_0xeb11('0x2'));var jsonpatch=require(_0xeb11('0x3'));var rp=require(_0xeb11('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeb11('0x5'));var util=require(_0xeb11('0x6'));var path=require(_0xeb11('0x7'));var sox=require(_0xeb11('0x8'));var csv=require('to-csv');var ejs=require(_0xeb11('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xeb11('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xeb11('0xb'));var toCsv=require(_0xeb11('0xc'));var querystring=require(_0xeb11('0xd'));var Papa=require('papaparse');var Redis=require(_0xeb11('0xe'));var authService=require(_0xeb11('0xf'));var qs=require(_0xeb11('0x10'));var as=require(_0xeb11('0x11'));var hardwareService=require(_0xeb11('0x12'));var logger=require(_0xeb11('0x13'))(_0xeb11('0x14'));var utils=require(_0xeb11('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xeb11('0x16'));var db=require(_0xeb11('0x17'))['db'];function respondWithStatusCode(_0x15b1e4,_0x517962){_0x517962=_0x517962||0xcc;return function(_0x44b192){if(_0x44b192){return _0x15b1e4['sendStatus'](_0x517962);}return _0x15b1e4[_0xeb11('0x18')](_0x517962)['end']();};}function respondWithResult(_0x5d183d,_0x146cfa){_0x146cfa=_0x146cfa||0xc8;return function(_0x2e0d2c){if(_0x2e0d2c){return _0x5d183d[_0xeb11('0x18')](_0x146cfa)[_0xeb11('0x19')](_0x2e0d2c);}};}function respondWithFilteredResult(_0x4c6a67,_0x58d276){return function(_0x200730){if(_0x200730){var _0xd1a9bf=typeof _0x58d276[_0xeb11('0x1a')]==='undefined'&&typeof _0x58d276[_0xeb11('0x1b')]==='undefined';var _0x33a996=_0x200730[_0xeb11('0x1c')];var _0x139ff8=_0xd1a9bf?0x0:_0x58d276['offset'];var _0xf36770=_0xd1a9bf?_0x200730[_0xeb11('0x1c')]:_0x58d276['offset']+_0x58d276['limit'];var _0x1906db;if(_0xf36770>=_0x33a996){_0xf36770=_0x33a996;_0x1906db=0xc8;}else{_0x1906db=0xce;}_0x4c6a67[_0xeb11('0x18')](_0x1906db);return _0x4c6a67['set']('Content-Range',_0x139ff8+'-'+_0xf36770+'/'+_0x33a996)[_0xeb11('0x19')](_0x200730);}return null;};}function patchUpdates(_0xf057c){return function(_0x4dfe03){try{jsonpatch['apply'](_0x4dfe03,_0xf057c,!![]);}catch(_0x17af28){return BPromise['reject'](_0x17af28);}return _0x4dfe03['save']();};}function saveUpdates(_0x5779df,_0xeeb427){return function(_0x1caf4f){if(_0x1caf4f){return _0x1caf4f['update'](_0x5779df)[_0xeb11('0x1d')](function(_0x40a4cb){return _0x40a4cb;});}return null;};}function removeEntity(_0x53e48d,_0x1c526d){return function(_0x3b2e1a){if(_0x3b2e1a){return _0x3b2e1a[_0xeb11('0x1e')]()['then'](function(){_0x53e48d[_0xeb11('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b97b5,_0x8af064){return function(_0x2a4fc6){if(!_0x2a4fc6){_0x5b97b5[_0xeb11('0x1f')](0x194);}return _0x2a4fc6;};}function handleError(_0x59e3fb,_0x4d8cf8){_0x4d8cf8=_0x4d8cf8||0x1f4;return function(_0xca08dd){logger['error'](_0xca08dd[_0xeb11('0x20')]);if(_0xca08dd[_0xeb11('0x21')]){delete _0xca08dd[_0xeb11('0x21')];}_0x59e3fb[_0xeb11('0x18')](_0x4d8cf8)[_0xeb11('0x22')](_0xca08dd);};}exports['index']=function(_0x1d9bf7,_0x387fb7){var _0x4ee70a={},_0x104561={},_0x4bb5b8={'count':0x0,'rows':[]};var _0xa18410=_[_0xeb11('0x23')](db[_0xeb11('0x24')][_0xeb11('0x25')],function(_0x22e3d2){return{'name':_0x22e3d2[_0xeb11('0x26')],'type':_0x22e3d2[_0xeb11('0x27')][_0xeb11('0x28')]};});_0x104561[_0xeb11('0x29')]=_['map'](_0xa18410,_0xeb11('0x21'));_0x104561['query']=_[_0xeb11('0x2a')](_0x1d9bf7[_0xeb11('0x2b')]);_0x104561[_0xeb11('0x2c')]=_['intersection'](_0x104561['model'],_0x104561[_0xeb11('0x2b')]);_0x4ee70a[_0xeb11('0x2d')]=_[_0xeb11('0x2e')](_0x104561[_0xeb11('0x29')],qs['fields'](_0x1d9bf7[_0xeb11('0x2b')][_0xeb11('0x2f')]));_0x4ee70a[_0xeb11('0x2d')]=_0x4ee70a['attributes'][_0xeb11('0x30')]?_0x4ee70a['attributes']:_0x104561[_0xeb11('0x29')];if(!_0x1d9bf7['query'][_0xeb11('0x31')](_0xeb11('0x32'))){_0x4ee70a[_0xeb11('0x1b')]=qs[_0xeb11('0x1b')](_0x1d9bf7[_0xeb11('0x2b')][_0xeb11('0x1b')]);_0x4ee70a[_0xeb11('0x1a')]=qs['offset'](_0x1d9bf7[_0xeb11('0x2b')]['offset']);}_0x4ee70a[_0xeb11('0x33')]=qs['sort'](_0x1d9bf7[_0xeb11('0x2b')][_0xeb11('0x34')]);_0x4ee70a[_0xeb11('0x35')]=qs[_0xeb11('0x2c')](_['pick'](_0x1d9bf7[_0xeb11('0x2b')],_0x104561[_0xeb11('0x2c')]),_0xa18410);if(_0x1d9bf7[_0xeb11('0x2b')][_0xeb11('0x36')]){_0x4ee70a[_0xeb11('0x35')]=_[_0xeb11('0x37')](_0x4ee70a[_0xeb11('0x35')],{'$or':_[_0xeb11('0x23')](_0xa18410,function(_0x436aff){if(_0x436aff[_0xeb11('0x27')]!==_0xeb11('0x38')){var _0x25bc1a={};_0x25bc1a[_0x436aff[_0xeb11('0x21')]]={'$like':'%'+_0x1d9bf7[_0xeb11('0x2b')][_0xeb11('0x36')]+'%'};return _0x25bc1a;}})});}_0x4ee70a=_['merge']({},_0x4ee70a,_0x1d9bf7[_0xeb11('0x39')]);var _0x480bb9={'where':_0x4ee70a[_0xeb11('0x35')]};return db[_0xeb11('0x24')]['count'](_0x480bb9)['then'](function(_0x210dcc){_0x4bb5b8[_0xeb11('0x1c')]=_0x210dcc;if(_0x1d9bf7[_0xeb11('0x2b')][_0xeb11('0x3a')]){_0x4ee70a['include']=[{'all':!![]}];}return db[_0xeb11('0x24')][_0xeb11('0x3b')](_0x4ee70a);})[_0xeb11('0x1d')](function(_0xffa000){_0x4bb5b8['rows']=_0xffa000;return _0x4bb5b8;})['then'](respondWithFilteredResult(_0x387fb7,_0x4ee70a))[_0xeb11('0x3c')](handleError(_0x387fb7,null));};exports['show']=function(_0x7b589,_0xa750bf){var _0xfb67ee={'raw':!![],'where':{'id':_0x7b589[_0xeb11('0x3d')]['id']}},_0xdf32e7={};_0xdf32e7[_0xeb11('0x29')]=_['keys'](db['FaxQueueReport'][_0xeb11('0x25')]);_0xdf32e7[_0xeb11('0x2b')]=_[_0xeb11('0x2a')](_0x7b589['query']);_0xdf32e7[_0xeb11('0x2c')]=_[_0xeb11('0x2e')](_0xdf32e7[_0xeb11('0x29')],_0xdf32e7[_0xeb11('0x2b')]);_0xfb67ee[_0xeb11('0x2d')]=_['intersection'](_0xdf32e7['model'],qs[_0xeb11('0x2f')](_0x7b589['query'][_0xeb11('0x2f')]));_0xfb67ee[_0xeb11('0x2d')]=_0xfb67ee[_0xeb11('0x2d')][_0xeb11('0x30')]?_0xfb67ee[_0xeb11('0x2d')]:_0xdf32e7[_0xeb11('0x29')];if(_0x7b589['query'][_0xeb11('0x3a')]){_0xfb67ee[_0xeb11('0x3e')]=[{'all':!![]}];}_0xfb67ee=_[_0xeb11('0x37')]({},_0xfb67ee,_0x7b589[_0xeb11('0x39')]);return db[_0xeb11('0x24')]['find'](_0xfb67ee)[_0xeb11('0x1d')](handleEntityNotFound(_0xa750bf,null))[_0xeb11('0x1d')](respondWithResult(_0xa750bf,null))['catch'](handleError(_0xa750bf,null));};exports[_0xeb11('0x3f')]=function(_0x28d67a,_0x65e0ac){return db[_0xeb11('0x24')][_0xeb11('0x3f')](_0x28d67a['body'],{})['then'](respondWithResult(_0x65e0ac,0xc9))[_0xeb11('0x3c')](handleError(_0x65e0ac,null));};exports['update']=function(_0x355251,_0x2307ff){if(_0x355251[_0xeb11('0x40')]['id']){delete _0x355251[_0xeb11('0x40')]['id'];}return db['FaxQueueReport'][_0xeb11('0x41')]({'where':{'id':_0x355251[_0xeb11('0x3d')]['id']}})[_0xeb11('0x1d')](handleEntityNotFound(_0x2307ff,null))[_0xeb11('0x1d')](saveUpdates(_0x355251[_0xeb11('0x40')],null))['then'](respondWithResult(_0x2307ff,null))['catch'](handleError(_0x2307ff,null));};exports['destroy']=function(_0x315f87,_0x371513){return db['FaxQueueReport']['find']({'where':{'id':_0x315f87[_0xeb11('0x3d')]['id']}})['then'](handleEntityNotFound(_0x371513,null))[_0xeb11('0x1d')](removeEntity(_0x371513,null))[_0xeb11('0x3c')](handleError(_0x371513,null));};exports[_0xeb11('0x42')]=function(_0x3e2134,_0x24ecdc){return db[_0xeb11('0x24')][_0xeb11('0x42')]()[_0xeb11('0x1d')](respondWithResult(_0x24ecdc,null))[_0xeb11('0x3c')](handleError(_0x24ecdc,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index a763ae0..ae4dd4b 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 _0xc4aa=['bluebird','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','../../config/logger','api','moment'];(function(_0x7d824e,_0x1c17d8){var _0x44b2ac=function(_0x588c34){while(--_0x588c34){_0x7d824e['push'](_0x7d824e['shift']());}};_0x44b2ac(++_0x1c17d8);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xc4aa[_0x3d42d8];return _0x27fc41;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','../../config/logger','api','moment'];(function(_0x34a5cd,_0x21cfc8){var _0x50b81e=function(_0x1b44d7){while(--_0x1b44d7){_0x34a5cd['push'](_0x34a5cd['shift']());}};_0x50b81e(++_0x21cfc8);}(_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 56b6c95..0299c04 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 _0x61ee=['options','raw','UpdateFaxQueueReport','update','where','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateFaxQueueReport','FaxQueueReport','body'];(function(_0x53f851,_0x26a116){var _0x202366=function(_0x3e6f8a){while(--_0x3e6f8a){_0x53f851['push'](_0x53f851['shift']());}};_0x202366(++_0x26a116);}(_0x61ee,0x113));var _0xe61e=function(_0x2d8d69,_0x8e47ff){_0x2d8d69=_0x2d8d69-0x0;var _0x39ae22=_0x61ee[_0x2d8d69];return _0x39ae22;};'use strict';var _=require(_0xe61e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe61e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe61e('0x2'))['db'];var utils=require(_0xe61e('0x3'));var logger=require(_0xe61e('0x4'))(_0xe61e('0x5'));var config=require(_0xe61e('0x6'));var jayson=require(_0xe61e('0x7'));var client=jayson[_0xe61e('0x8')][_0xe61e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x34cea0,_0x2204be,_0x10901a){return new BPromise(function(_0x23f959,_0x5ea019){return client['request'](_0x34cea0,_0x10901a)[_0xe61e('0xa')](function(_0x3bc47a){logger[_0xe61e('0xb')](_0xe61e('0xc'),_0x2204be,'request\x20sent');logger[_0xe61e('0xd')](_0xe61e('0xe'),_0x2204be,_0xe61e('0xf'),JSON[_0xe61e('0x10')](_0x3bc47a));if(_0x3bc47a[_0xe61e('0x11')]){if(_0x3bc47a[_0xe61e('0x11')][_0xe61e('0x12')]===0x1f4){logger[_0xe61e('0x11')](_0xe61e('0xc'),_0x2204be,_0x3bc47a[_0xe61e('0x11')][_0xe61e('0x13')]);return _0x5ea019(_0x3bc47a[_0xe61e('0x11')][_0xe61e('0x13')]);}logger[_0xe61e('0x11')](_0xe61e('0xc'),_0x2204be,_0x3bc47a[_0xe61e('0x11')]['message']);return _0x23f959(_0x3bc47a[_0xe61e('0x11')][_0xe61e('0x13')]);}else{logger[_0xe61e('0xb')](_0xe61e('0xc'),_0x2204be,_0xe61e('0xf'));_0x23f959(_0x3bc47a[_0xe61e('0x14')][_0xe61e('0x13')]);}})[_0xe61e('0x15')](function(_0x5ad1d8){logger[_0xe61e('0x11')](_0xe61e('0xc'),_0x2204be,_0x5ad1d8);_0x5ea019(_0x5ad1d8);});});}exports[_0xe61e('0x16')]=function(_0x46709e){var _0x1c31ce=this;return new Promise(function(_0x3a67b1,_0x391f20){return db[_0xe61e('0x17')]['create'](_0x46709e[_0xe61e('0x18')],{'raw':_0x46709e[_0xe61e('0x19')]?_0x46709e['options'][_0xe61e('0x1a')]===undefined?!![]:![]:!![]})[_0xe61e('0xa')](function(_0x42a39d){logger['info'](_0xe61e('0x16'),_0x46709e);logger[_0xe61e('0xd')](_0xe61e('0x16'),_0x46709e,JSON[_0xe61e('0x10')](_0x42a39d));_0x3a67b1(_0x42a39d);})[_0xe61e('0x15')](function(_0x3ff69e){logger[_0xe61e('0x11')](_0xe61e('0x16'),_0x3ff69e[_0xe61e('0x13')],_0x46709e);_0x391f20(_0x1c31ce[_0xe61e('0x11')](0x1f4,_0x3ff69e[_0xe61e('0x13')]));});});};exports[_0xe61e('0x1b')]=function(_0x385870){var _0x3b237d=this;return new Promise(function(_0x3eec12,_0x27531c){return db[_0xe61e('0x17')][_0xe61e('0x1c')](_0x385870[_0xe61e('0x18')],{'raw':_0x385870[_0xe61e('0x19')]?_0x385870['options'][_0xe61e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x385870[_0xe61e('0x19')]?_0x385870[_0xe61e('0x19')][_0xe61e('0x1d')]||null:null,'attributes':_0x385870['options']?_0x385870[_0xe61e('0x19')]['attributes']||null:null,'limit':_0x385870[_0xe61e('0x19')]?_0x385870[_0xe61e('0x19')]['limit']||null:null})[_0xe61e('0xa')](function(_0x136cc2){logger[_0xe61e('0xb')](_0xe61e('0x1b'),_0x385870);logger[_0xe61e('0xd')](_0xe61e('0x1b'),_0x385870,JSON[_0xe61e('0x10')](_0x136cc2));_0x3eec12(_0x136cc2);})['catch'](function(_0x21d326){logger[_0xe61e('0x11')]('UpdateFaxQueueReport',_0x21d326[_0xe61e('0x13')],_0x385870);_0x27531c(_0x3b237d[_0xe61e('0x11')](0x1f4,_0x21d326['message']));});});}; \ No newline at end of file +var _0x689f=['options','raw','debug','stringify','UpdateFaxQueueReport','body','where','attributes','limit','then','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateFaxQueueReport','FaxQueueReport','create'];(function(_0x5ae1a1,_0x38c7c4){var _0x1034aa=function(_0x5d4bb8){while(--_0x5d4bb8){_0x5ae1a1['push'](_0x5ae1a1['shift']());}};_0x1034aa(++_0x38c7c4);}(_0x689f,0xaa));var _0xf689=function(_0x4de752,_0x48e4dc){_0x4de752=_0x4de752-0x0;var _0x56792d=_0x689f[_0x4de752];return _0x56792d;};'use strict';var _=require(_0xf689('0x0'));var util=require(_0xf689('0x1'));var moment=require(_0xf689('0x2'));var BPromise=require('bluebird');var rs=require(_0xf689('0x3'));var fs=require('fs');var Redis=require(_0xf689('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf689('0x5'));var logger=require(_0xf689('0x6'))(_0xf689('0x7'));var config=require(_0xf689('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf689('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf3d6c8,_0x257a69,_0x4772bd){return new BPromise(function(_0xdefc8b,_0x23d3e3){return client[_0xf689('0xa')](_0xf3d6c8,_0x4772bd)['then'](function(_0x2bd9ea){logger[_0xf689('0xb')](_0xf689('0xc'),_0x257a69,_0xf689('0xd'));logger['debug'](_0xf689('0xe'),_0x257a69,_0xf689('0xd'),JSON['stringify'](_0x2bd9ea));if(_0x2bd9ea['error']){if(_0x2bd9ea[_0xf689('0xf')][_0xf689('0x10')]===0x1f4){logger['error'](_0xf689('0xc'),_0x257a69,_0x2bd9ea[_0xf689('0xf')][_0xf689('0x11')]);return _0x23d3e3(_0x2bd9ea[_0xf689('0xf')][_0xf689('0x11')]);}logger[_0xf689('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x257a69,_0x2bd9ea[_0xf689('0xf')]['message']);return _0xdefc8b(_0x2bd9ea[_0xf689('0xf')][_0xf689('0x11')]);}else{logger['info'](_0xf689('0xc'),_0x257a69,_0xf689('0xd'));_0xdefc8b(_0x2bd9ea[_0xf689('0x12')][_0xf689('0x11')]);}})['catch'](function(_0x4d1870){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x257a69,_0x4d1870);_0x23d3e3(_0x4d1870);});});}exports[_0xf689('0x13')]=function(_0x468a63){var _0x15d299=this;return new Promise(function(_0x380e0d,_0x15ac5c){return db[_0xf689('0x14')][_0xf689('0x15')](_0x468a63['body'],{'raw':_0x468a63[_0xf689('0x16')]?_0x468a63[_0xf689('0x16')][_0xf689('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x3efc3a){logger[_0xf689('0xb')](_0xf689('0x13'),_0x468a63);logger[_0xf689('0x18')]('CreateFaxQueueReport',_0x468a63,JSON[_0xf689('0x19')](_0x3efc3a));_0x380e0d(_0x3efc3a);})['catch'](function(_0x245b3e){logger[_0xf689('0xf')](_0xf689('0x13'),_0x245b3e[_0xf689('0x11')],_0x468a63);_0x15ac5c(_0x15d299['error'](0x1f4,_0x245b3e[_0xf689('0x11')]));});});};exports[_0xf689('0x1a')]=function(_0xa2d901){var _0x17baaa=this;return new Promise(function(_0x957054,_0x447e42){return db['FaxQueueReport']['update'](_0xa2d901[_0xf689('0x1b')],{'raw':_0xa2d901['options']?_0xa2d901[_0xf689('0x16')][_0xf689('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa2d901[_0xf689('0x16')]?_0xa2d901[_0xf689('0x16')][_0xf689('0x1c')]||null:null,'attributes':_0xa2d901[_0xf689('0x16')]?_0xa2d901[_0xf689('0x16')][_0xf689('0x1d')]||null:null,'limit':_0xa2d901['options']?_0xa2d901[_0xf689('0x16')][_0xf689('0x1e')]||null:null})[_0xf689('0x1f')](function(_0x14f991){logger[_0xf689('0xb')](_0xf689('0x1a'),_0xa2d901);logger['debug'](_0xf689('0x1a'),_0xa2d901,JSON[_0xf689('0x19')](_0x14f991));_0x957054(_0x14f991);})['catch'](function(_0x6b38da){logger[_0xf689('0xf')](_0xf689('0x1a'),_0x6b38da[_0xf689('0x11')],_0xa2d901);_0x447e42(_0x17baaa[_0xf689('0xf')](0x1f4,_0x6b38da[_0xf689('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index b028138..a259213 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 _0x19bb=['/describe','/:id','show','post','create','put','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated'];(function(_0x5e3a57,_0x2d084c){var _0x127431=function(_0x3fd9fe){while(--_0x3fd9fe){_0x5e3a57['push'](_0x5e3a57['shift']());}};_0x127431(++_0x2d084c);}(_0x19bb,0xf8));var _0xb19b=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x19bb[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0xb19b('0x0'));var util=require(_0xb19b('0x1'));var path=require('path');var timeout=require(_0xb19b('0x2'));var express=require(_0xb19b('0x3'));var router=express[_0xb19b('0x4')]();var fs_extra=require(_0xb19b('0x5'));var auth=require(_0xb19b('0x6'));var interaction=require(_0xb19b('0x7'));var config=require(_0xb19b('0x8'));var controller=require(_0xb19b('0x9'));router[_0xb19b('0xa')]('/',auth[_0xb19b('0xb')](),controller['index']);router[_0xb19b('0xa')](_0xb19b('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xb19b('0xa')](_0xb19b('0xd'),auth[_0xb19b('0xb')](),controller[_0xb19b('0xe')]);router[_0xb19b('0xf')]('/',auth['isAuthenticated'](),controller[_0xb19b('0x10')]);router[_0xb19b('0x11')](_0xb19b('0xd'),auth[_0xb19b('0xb')](),controller['update']);router['delete'](_0xb19b('0xd'),auth[_0xb19b('0xb')](),controller[_0xb19b('0x12')]);module[_0xb19b('0x13')]=router; \ No newline at end of file +var _0x54e7=['delete','exports','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post','create'];(function(_0x2e382d,_0x2425d5){var _0x4be5ff=function(_0x427da6){while(--_0x427da6){_0x2e382d['push'](_0x2e382d['shift']());}};_0x4be5ff(++_0x2425d5);}(_0x54e7,0x82));var _0x754e=function(_0x1b435e,_0x435279){_0x1b435e=_0x1b435e-0x0;var _0x28f6c4=_0x54e7[_0x1b435e];return _0x28f6c4;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x754e('0x0'));var express=require('express');var router=express[_0x754e('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x754e('0x2'));var interaction=require(_0x754e('0x3'));var config=require(_0x754e('0x4'));var controller=require(_0x754e('0x5'));router['get']('/',auth[_0x754e('0x6')](),controller[_0x754e('0x7')]);router[_0x754e('0x8')](_0x754e('0x9'),auth[_0x754e('0x6')](),controller[_0x754e('0xa')]);router[_0x754e('0x8')](_0x754e('0xb'),auth[_0x754e('0x6')](),controller['show']);router[_0x754e('0xc')]('/',auth[_0x754e('0x6')](),controller[_0x754e('0xd')]);router['put']('/:id',auth[_0x754e('0x6')](),controller['update']);router[_0x754e('0xe')]('/:id',auth[_0x754e('0x6')](),controller['destroy']);module[_0x754e('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 0d01a8d..18c885e 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x361ad7,_0xf58507){var _0x5a6c95=function(_0x5f429f){while(--_0x5f429f){_0x361ad7['push'](_0x361ad7['shift']());}};_0x5a6c95(++_0xf58507);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x2fff83,_0x29d5fe){_0x2fff83=_0x2fff83-0x0;var _0xa2a722=_0xf3cd[_0x2fff83];return _0xa2a722;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x123e78,_0x5a9aee){var _0x1fb8b4=function(_0x52781e){while(--_0x52781e){_0x123e78['push'](_0x123e78['shift']());}};_0x1fb8b4(++_0x5a9aee);}(_0x00bb,0x1d8));var _0xb00b=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x00bb[_0x23e7c1];return _0x1add43;};'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 63fba44..32086b7 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 _0x6ba6=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','params','keys','includeAll','options','find','create','body','describe','eml-format','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','../../components/auth/service'];(function(_0x16d57e,_0x3e98c7){var _0x25e004=function(_0x11b8aa){while(--_0x11b8aa){_0x16d57e['push'](_0x16d57e['shift']());}};_0x25e004(++_0x3e98c7);}(_0x6ba6,0xd2));var _0x66ba=function(_0x1e1b83,_0x50d288){_0x1e1b83=_0x1e1b83-0x0;var _0x13a9fb=_0x6ba6[_0x1e1b83];return _0x13a9fb;};'use strict';var emlformat=require(_0x66ba('0x0'));var rimraf=require(_0x66ba('0x1'));var zipdir=require(_0x66ba('0x2'));var jsonpatch=require(_0x66ba('0x3'));var rp=require(_0x66ba('0x4'));var moment=require(_0x66ba('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x66ba('0x6'));var util=require(_0x66ba('0x7'));var path=require(_0x66ba('0x8'));var sox=require(_0x66ba('0x9'));var csv=require(_0x66ba('0xa'));var ejs=require(_0x66ba('0xb'));var fs=require('fs');var fs_extra=require(_0x66ba('0xc'));var _=require(_0x66ba('0xd'));var squel=require(_0x66ba('0xe'));var crypto=require(_0x66ba('0xf'));var jsforce=require(_0x66ba('0x10'));var deskjs=require(_0x66ba('0x11'));var toCsv=require(_0x66ba('0xa'));var querystring=require(_0x66ba('0x12'));var Papa=require(_0x66ba('0x13'));var Redis=require('ioredis');var authService=require(_0x66ba('0x14'));var qs=require(_0x66ba('0x15'));var as=require(_0x66ba('0x16'));var hardwareService=require(_0x66ba('0x17'));var logger=require(_0x66ba('0x18'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x66ba('0x19'))['db'];function respondWithStatusCode(_0x3ac57e,_0x164153){_0x164153=_0x164153||0xcc;return function(_0x10a1ea){if(_0x10a1ea){return _0x3ac57e[_0x66ba('0x1a')](_0x164153);}return _0x3ac57e[_0x66ba('0x1b')](_0x164153)[_0x66ba('0x1c')]();};}function respondWithResult(_0x468d4d,_0x5f5d39){_0x5f5d39=_0x5f5d39||0xc8;return function(_0x40ee4c){if(_0x40ee4c){return _0x468d4d['status'](_0x5f5d39)[_0x66ba('0x1d')](_0x40ee4c);}};}function respondWithFilteredResult(_0x54854d,_0x6e92d6){return function(_0x5c7083){if(_0x5c7083){var _0x5b96bb=typeof _0x6e92d6[_0x66ba('0x1e')]===_0x66ba('0x1f')&&typeof _0x6e92d6[_0x66ba('0x20')]===_0x66ba('0x1f');var _0xd23349=_0x5c7083[_0x66ba('0x21')];var _0xc5215e=_0x5b96bb?0x0:_0x6e92d6[_0x66ba('0x1e')];var _0x43fbe9=_0x5b96bb?_0x5c7083[_0x66ba('0x21')]:_0x6e92d6[_0x66ba('0x1e')]+_0x6e92d6[_0x66ba('0x20')];var _0x3ae091;if(_0x43fbe9>=_0xd23349){_0x43fbe9=_0xd23349;_0x3ae091=0xc8;}else{_0x3ae091=0xce;}_0x54854d[_0x66ba('0x1b')](_0x3ae091);return _0x54854d['set'](_0x66ba('0x22'),_0xc5215e+'-'+_0x43fbe9+'/'+_0xd23349)[_0x66ba('0x1d')](_0x5c7083);}return null;};}function patchUpdates(_0xd5b22e){return function(_0x252f9b){try{jsonpatch[_0x66ba('0x23')](_0x252f9b,_0xd5b22e,!![]);}catch(_0x1be60e){return BPromise[_0x66ba('0x24')](_0x1be60e);}return _0x252f9b[_0x66ba('0x25')]();};}function saveUpdates(_0x44a748,_0x3d26bb){return function(_0x1a7950){if(_0x1a7950){return _0x1a7950[_0x66ba('0x26')](_0x44a748)['then'](function(_0x269ea2){return _0x269ea2;});}return null;};}function removeEntity(_0x325a8f,_0xd1e97f){return function(_0x808fec){if(_0x808fec){return _0x808fec[_0x66ba('0x27')]()[_0x66ba('0x28')](function(){_0x325a8f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1baf23,_0x33f1bf){return function(_0x7e16bf){if(!_0x7e16bf){_0x1baf23[_0x66ba('0x1a')](0x194);}return _0x7e16bf;};}function handleError(_0x15b7d7,_0x446e5e){_0x446e5e=_0x446e5e||0x1f4;return function(_0x590c14){logger[_0x66ba('0x29')](_0x590c14[_0x66ba('0x2a')]);if(_0x590c14['name']){delete _0x590c14[_0x66ba('0x2b')];}_0x15b7d7[_0x66ba('0x1b')](_0x446e5e)[_0x66ba('0x2c')](_0x590c14);};}exports[_0x66ba('0x2d')]=function(_0x511201,_0x2d27af){var _0x39fa8d={},_0x2b33f9={},_0x5347e6={'count':0x0,'rows':[]};var _0x32b096=_[_0x66ba('0x2e')](db[_0x66ba('0x2f')][_0x66ba('0x30')],function(_0x2ac048){return{'name':_0x2ac048[_0x66ba('0x31')],'type':_0x2ac048[_0x66ba('0x32')]['key']};});_0x2b33f9['model']=_['map'](_0x32b096,_0x66ba('0x2b'));_0x2b33f9['query']=_['keys'](_0x511201[_0x66ba('0x33')]);_0x2b33f9[_0x66ba('0x34')]=_[_0x66ba('0x35')](_0x2b33f9[_0x66ba('0x36')],_0x2b33f9[_0x66ba('0x33')]);_0x39fa8d['attributes']=_[_0x66ba('0x35')](_0x2b33f9[_0x66ba('0x36')],qs[_0x66ba('0x37')](_0x511201[_0x66ba('0x33')][_0x66ba('0x37')]));_0x39fa8d[_0x66ba('0x38')]=_0x39fa8d[_0x66ba('0x38')][_0x66ba('0x39')]?_0x39fa8d['attributes']:_0x2b33f9['model'];if(!_0x511201[_0x66ba('0x33')][_0x66ba('0x3a')](_0x66ba('0x3b'))){_0x39fa8d[_0x66ba('0x20')]=qs['limit'](_0x511201[_0x66ba('0x33')][_0x66ba('0x20')]);_0x39fa8d[_0x66ba('0x1e')]=qs['offset'](_0x511201[_0x66ba('0x33')]['offset']);}_0x39fa8d['order']=qs['sort'](_0x511201['query']['sort']);_0x39fa8d[_0x66ba('0x3c')]=qs[_0x66ba('0x34')](_[_0x66ba('0x3d')](_0x511201[_0x66ba('0x33')],_0x2b33f9['filters']),_0x32b096);if(_0x511201[_0x66ba('0x33')][_0x66ba('0x3e')]){_0x39fa8d[_0x66ba('0x3c')]=_[_0x66ba('0x3f')](_0x39fa8d[_0x66ba('0x3c')],{'$or':_[_0x66ba('0x2e')](_0x32b096,function(_0x1e7fd4){if(_0x1e7fd4[_0x66ba('0x32')]!==_0x66ba('0x40')){var _0x42f971={};_0x42f971[_0x1e7fd4['name']]={'$like':'%'+_0x511201[_0x66ba('0x33')][_0x66ba('0x3e')]+'%'};return _0x42f971;}})});}_0x39fa8d=_[_0x66ba('0x3f')]({},_0x39fa8d,_0x511201['options']);var _0x3f33bf={'where':_0x39fa8d[_0x66ba('0x3c')]};return db[_0x66ba('0x2f')][_0x66ba('0x21')](_0x3f33bf)[_0x66ba('0x28')](function(_0x1a4086){_0x5347e6[_0x66ba('0x21')]=_0x1a4086;if(_0x511201[_0x66ba('0x33')]['includeAll']){_0x39fa8d[_0x66ba('0x41')]=[{'all':!![]}];}return db[_0x66ba('0x2f')][_0x66ba('0x42')](_0x39fa8d);})[_0x66ba('0x28')](function(_0x2051b5){_0x5347e6[_0x66ba('0x43')]=_0x2051b5;return _0x5347e6;})[_0x66ba('0x28')](respondWithFilteredResult(_0x2d27af,_0x39fa8d))[_0x66ba('0x44')](handleError(_0x2d27af,null));};exports['show']=function(_0x4ad15c,_0x4a5490){var _0x9f438b={'raw':!![],'where':{'id':_0x4ad15c[_0x66ba('0x45')]['id']}},_0x27c477={};_0x27c477['model']=_[_0x66ba('0x46')](db[_0x66ba('0x2f')]['rawAttributes']);_0x27c477[_0x66ba('0x33')]=_[_0x66ba('0x46')](_0x4ad15c[_0x66ba('0x33')]);_0x27c477[_0x66ba('0x34')]=_['intersection'](_0x27c477[_0x66ba('0x36')],_0x27c477[_0x66ba('0x33')]);_0x9f438b[_0x66ba('0x38')]=_[_0x66ba('0x35')](_0x27c477[_0x66ba('0x36')],qs[_0x66ba('0x37')](_0x4ad15c[_0x66ba('0x33')][_0x66ba('0x37')]));_0x9f438b[_0x66ba('0x38')]=_0x9f438b[_0x66ba('0x38')][_0x66ba('0x39')]?_0x9f438b[_0x66ba('0x38')]:_0x27c477[_0x66ba('0x36')];if(_0x4ad15c['query'][_0x66ba('0x47')]){_0x9f438b[_0x66ba('0x41')]=[{'all':!![]}];}_0x9f438b=_['merge']({},_0x9f438b,_0x4ad15c[_0x66ba('0x48')]);return db[_0x66ba('0x2f')][_0x66ba('0x49')](_0x9f438b)['then'](handleEntityNotFound(_0x4a5490,null))['then'](respondWithResult(_0x4a5490,null))[_0x66ba('0x44')](handleError(_0x4a5490,null));};exports['create']=function(_0x29bc3c,_0x1bff68){return db[_0x66ba('0x2f')][_0x66ba('0x4a')](_0x29bc3c[_0x66ba('0x4b')],{})[_0x66ba('0x28')](respondWithResult(_0x1bff68,0xc9))[_0x66ba('0x44')](handleError(_0x1bff68,null));};exports['update']=function(_0x532f92,_0x5b4d2b){if(_0x532f92[_0x66ba('0x4b')]['id']){delete _0x532f92[_0x66ba('0x4b')]['id'];}return db['FaxTransferReport']['find']({'where':{'id':_0x532f92['params']['id']}})['then'](handleEntityNotFound(_0x5b4d2b,null))[_0x66ba('0x28')](saveUpdates(_0x532f92[_0x66ba('0x4b')],null))[_0x66ba('0x28')](respondWithResult(_0x5b4d2b,null))['catch'](handleError(_0x5b4d2b,null));};exports[_0x66ba('0x27')]=function(_0x587e51,_0x1cbd22){return db[_0x66ba('0x2f')][_0x66ba('0x49')]({'where':{'id':_0x587e51['params']['id']}})[_0x66ba('0x28')](handleEntityNotFound(_0x1cbd22,null))[_0x66ba('0x28')](removeEntity(_0x1cbd22,null))['catch'](handleError(_0x1cbd22,null));};exports[_0x66ba('0x4c')]=function(_0x474cc0,_0x46d2b8){return db[_0x66ba('0x2f')][_0x66ba('0x4c')]()['then'](respondWithResult(_0x46d2b8,null))[_0x66ba('0x44')](handleError(_0x46d2b8,null));}; \ No newline at end of file +var _0xe3c7=['findAll','rows','catch','show','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','rawAttributes','query','keys','filters','model','intersection','fields','attributes','length','nolimit','order','sort','where','pick','map','type','VIRTUAL','filter','merge','FaxTransferReport','includeAll','include'];(function(_0xe25f69,_0x189354){var _0x4d4507=function(_0x55b1c3){while(--_0x55b1c3){_0xe25f69['push'](_0xe25f69['shift']());}};_0x4d4507(++_0x189354);}(_0xe3c7,0x1f0));var _0x7e3c=function(_0x44d9e8,_0x2f0bc2){_0x44d9e8=_0x44d9e8-0x0;var _0x64816e=_0xe3c7[_0x44d9e8];return _0x64816e;};'use strict';var emlformat=require(_0x7e3c('0x0'));var rimraf=require(_0x7e3c('0x1'));var zipdir=require(_0x7e3c('0x2'));var jsonpatch=require(_0x7e3c('0x3'));var rp=require(_0x7e3c('0x4'));var moment=require(_0x7e3c('0x5'));var BPromise=require(_0x7e3c('0x6'));var Mustache=require(_0x7e3c('0x7'));var util=require('util');var path=require(_0x7e3c('0x8'));var sox=require(_0x7e3c('0x9'));var csv=require(_0x7e3c('0xa'));var ejs=require(_0x7e3c('0xb'));var fs=require('fs');var fs_extra=require(_0x7e3c('0xc'));var _=require(_0x7e3c('0xd'));var squel=require(_0x7e3c('0xe'));var crypto=require(_0x7e3c('0xf'));var jsforce=require(_0x7e3c('0x10'));var deskjs=require(_0x7e3c('0x11'));var toCsv=require(_0x7e3c('0xa'));var querystring=require(_0x7e3c('0x12'));var Papa=require(_0x7e3c('0x13'));var Redis=require(_0x7e3c('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x7e3c('0x15'));var as=require(_0x7e3c('0x16'));var hardwareService=require(_0x7e3c('0x17'));var logger=require(_0x7e3c('0x18'))(_0x7e3c('0x19'));var utils=require(_0x7e3c('0x1a'));var config=require('../../config/environment');var licenseUtil=require(_0x7e3c('0x1b'));var db=require(_0x7e3c('0x1c'))['db'];function respondWithStatusCode(_0x5b3f00,_0x4381e2){_0x4381e2=_0x4381e2||0xcc;return function(_0x46c048){if(_0x46c048){return _0x5b3f00[_0x7e3c('0x1d')](_0x4381e2);}return _0x5b3f00[_0x7e3c('0x1e')](_0x4381e2)[_0x7e3c('0x1f')]();};}function respondWithResult(_0x50aa71,_0x14a33b){_0x14a33b=_0x14a33b||0xc8;return function(_0x36898c){if(_0x36898c){return _0x50aa71[_0x7e3c('0x1e')](_0x14a33b)[_0x7e3c('0x20')](_0x36898c);}};}function respondWithFilteredResult(_0x5d480a,_0x59679c){return function(_0x21278d){if(_0x21278d){var _0x1a3ed1=typeof _0x59679c['offset']==='undefined'&&typeof _0x59679c[_0x7e3c('0x21')]===_0x7e3c('0x22');var _0xfa4a3b=_0x21278d[_0x7e3c('0x23')];var _0x554b7a=_0x1a3ed1?0x0:_0x59679c[_0x7e3c('0x24')];var _0x1c585d=_0x1a3ed1?_0x21278d[_0x7e3c('0x23')]:_0x59679c[_0x7e3c('0x24')]+_0x59679c[_0x7e3c('0x21')];var _0x367e6c;if(_0x1c585d>=_0xfa4a3b){_0x1c585d=_0xfa4a3b;_0x367e6c=0xc8;}else{_0x367e6c=0xce;}_0x5d480a[_0x7e3c('0x1e')](_0x367e6c);return _0x5d480a[_0x7e3c('0x25')](_0x7e3c('0x26'),_0x554b7a+'-'+_0x1c585d+'/'+_0xfa4a3b)[_0x7e3c('0x20')](_0x21278d);}return null;};}function patchUpdates(_0x106ae2){return function(_0x24aa6e){try{jsonpatch[_0x7e3c('0x27')](_0x24aa6e,_0x106ae2,!![]);}catch(_0x28d77e){return BPromise['reject'](_0x28d77e);}return _0x24aa6e[_0x7e3c('0x28')]();};}function saveUpdates(_0x3eff6a,_0x3f0217){return function(_0x390430){if(_0x390430){return _0x390430[_0x7e3c('0x29')](_0x3eff6a)[_0x7e3c('0x2a')](function(_0x35b45a){return _0x35b45a;});}return null;};}function removeEntity(_0x105aa8,_0x39a3b6){return function(_0x1d38f9){if(_0x1d38f9){return _0x1d38f9[_0x7e3c('0x2b')]()[_0x7e3c('0x2a')](function(){_0x105aa8[_0x7e3c('0x1e')](0xcc)[_0x7e3c('0x1f')]();});}};}function handleEntityNotFound(_0x310758,_0xbe630c){return function(_0x1748d5){if(!_0x1748d5){_0x310758[_0x7e3c('0x1d')](0x194);}return _0x1748d5;};}function handleError(_0x27413b,_0xb70b2e){_0xb70b2e=_0xb70b2e||0x1f4;return function(_0xd7d925){logger[_0x7e3c('0x2c')](_0xd7d925[_0x7e3c('0x2d')]);if(_0xd7d925['name']){delete _0xd7d925[_0x7e3c('0x2e')];}_0x27413b[_0x7e3c('0x1e')](_0xb70b2e)[_0x7e3c('0x2f')](_0xd7d925);};}exports[_0x7e3c('0x30')]=function(_0x589b6c,_0x17c264){var _0x7bbe92={},_0x5b6a8c={},_0x3518b4={'count':0x0,'rows':[]};var _0x88159d=_['map'](db['FaxTransferReport'][_0x7e3c('0x31')],function(_0x5cb8e0){return{'name':_0x5cb8e0['fieldName'],'type':_0x5cb8e0['type']['key']};});_0x5b6a8c['model']=_['map'](_0x88159d,_0x7e3c('0x2e'));_0x5b6a8c[_0x7e3c('0x32')]=_[_0x7e3c('0x33')](_0x589b6c[_0x7e3c('0x32')]);_0x5b6a8c[_0x7e3c('0x34')]=_['intersection'](_0x5b6a8c[_0x7e3c('0x35')],_0x5b6a8c['query']);_0x7bbe92['attributes']=_[_0x7e3c('0x36')](_0x5b6a8c[_0x7e3c('0x35')],qs[_0x7e3c('0x37')](_0x589b6c['query'][_0x7e3c('0x37')]));_0x7bbe92[_0x7e3c('0x38')]=_0x7bbe92['attributes'][_0x7e3c('0x39')]?_0x7bbe92['attributes']:_0x5b6a8c[_0x7e3c('0x35')];if(!_0x589b6c[_0x7e3c('0x32')]['hasOwnProperty'](_0x7e3c('0x3a'))){_0x7bbe92[_0x7e3c('0x21')]=qs[_0x7e3c('0x21')](_0x589b6c[_0x7e3c('0x32')][_0x7e3c('0x21')]);_0x7bbe92['offset']=qs[_0x7e3c('0x24')](_0x589b6c['query'][_0x7e3c('0x24')]);}_0x7bbe92[_0x7e3c('0x3b')]=qs[_0x7e3c('0x3c')](_0x589b6c[_0x7e3c('0x32')][_0x7e3c('0x3c')]);_0x7bbe92[_0x7e3c('0x3d')]=qs['filters'](_[_0x7e3c('0x3e')](_0x589b6c[_0x7e3c('0x32')],_0x5b6a8c[_0x7e3c('0x34')]),_0x88159d);if(_0x589b6c['query']['filter']){_0x7bbe92[_0x7e3c('0x3d')]=_['merge'](_0x7bbe92[_0x7e3c('0x3d')],{'$or':_[_0x7e3c('0x3f')](_0x88159d,function(_0x2772ce){if(_0x2772ce[_0x7e3c('0x40')]!==_0x7e3c('0x41')){var _0x791445={};_0x791445[_0x2772ce['name']]={'$like':'%'+_0x589b6c[_0x7e3c('0x32')][_0x7e3c('0x42')]+'%'};return _0x791445;}})});}_0x7bbe92=_[_0x7e3c('0x43')]({},_0x7bbe92,_0x589b6c['options']);var _0x2b1c1a={'where':_0x7bbe92[_0x7e3c('0x3d')]};return db[_0x7e3c('0x44')][_0x7e3c('0x23')](_0x2b1c1a)['then'](function(_0x224863){_0x3518b4['count']=_0x224863;if(_0x589b6c[_0x7e3c('0x32')][_0x7e3c('0x45')]){_0x7bbe92[_0x7e3c('0x46')]=[{'all':!![]}];}return db[_0x7e3c('0x44')][_0x7e3c('0x47')](_0x7bbe92);})[_0x7e3c('0x2a')](function(_0x8b253c){_0x3518b4[_0x7e3c('0x48')]=_0x8b253c;return _0x3518b4;})['then'](respondWithFilteredResult(_0x17c264,_0x7bbe92))[_0x7e3c('0x49')](handleError(_0x17c264,null));};exports[_0x7e3c('0x4a')]=function(_0x54e7ec,_0x5162f8){var _0x2ca58a={'raw':!![],'where':{'id':_0x54e7ec['params']['id']}},_0x2f8d46={};_0x2f8d46[_0x7e3c('0x35')]=_[_0x7e3c('0x33')](db[_0x7e3c('0x44')]['rawAttributes']);_0x2f8d46[_0x7e3c('0x32')]=_[_0x7e3c('0x33')](_0x54e7ec[_0x7e3c('0x32')]);_0x2f8d46[_0x7e3c('0x34')]=_[_0x7e3c('0x36')](_0x2f8d46['model'],_0x2f8d46[_0x7e3c('0x32')]);_0x2ca58a[_0x7e3c('0x38')]=_['intersection'](_0x2f8d46['model'],qs['fields'](_0x54e7ec[_0x7e3c('0x32')][_0x7e3c('0x37')]));_0x2ca58a[_0x7e3c('0x38')]=_0x2ca58a[_0x7e3c('0x38')][_0x7e3c('0x39')]?_0x2ca58a['attributes']:_0x2f8d46[_0x7e3c('0x35')];if(_0x54e7ec['query'][_0x7e3c('0x45')]){_0x2ca58a[_0x7e3c('0x46')]=[{'all':!![]}];}_0x2ca58a=_[_0x7e3c('0x43')]({},_0x2ca58a,_0x54e7ec[_0x7e3c('0x4b')]);return db['FaxTransferReport'][_0x7e3c('0x4c')](_0x2ca58a)[_0x7e3c('0x2a')](handleEntityNotFound(_0x5162f8,null))['then'](respondWithResult(_0x5162f8,null))['catch'](handleError(_0x5162f8,null));};exports[_0x7e3c('0x4d')]=function(_0x4277bb,_0x55ef78){return db[_0x7e3c('0x44')]['create'](_0x4277bb['body'],{})[_0x7e3c('0x2a')](respondWithResult(_0x55ef78,0xc9))['catch'](handleError(_0x55ef78,null));};exports[_0x7e3c('0x29')]=function(_0x2e9d03,_0x2a1d4c){if(_0x2e9d03[_0x7e3c('0x4e')]['id']){delete _0x2e9d03['body']['id'];}return db[_0x7e3c('0x44')][_0x7e3c('0x4c')]({'where':{'id':_0x2e9d03[_0x7e3c('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2a1d4c,null))[_0x7e3c('0x2a')](saveUpdates(_0x2e9d03['body'],null))[_0x7e3c('0x2a')](respondWithResult(_0x2a1d4c,null))[_0x7e3c('0x49')](handleError(_0x2a1d4c,null));};exports[_0x7e3c('0x2b')]=function(_0x15e2e4,_0x1b9499){return db[_0x7e3c('0x44')][_0x7e3c('0x4c')]({'where':{'id':_0x15e2e4[_0x7e3c('0x4f')]['id']}})[_0x7e3c('0x2a')](handleEntityNotFound(_0x1b9499,null))['then'](removeEntity(_0x1b9499,null))[_0x7e3c('0x49')](handleError(_0x1b9499,null));};exports[_0x7e3c('0x50')]=function(_0x2b6b36,_0x2365f4){return db[_0x7e3c('0x44')][_0x7e3c('0x50')]()['then'](respondWithResult(_0x2365f4,null))[_0x7e3c('0x49')](handleError(_0x2365f4,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index f031d68..cf07711 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 _0x5217=['bluebird','request-promise','path','../../config/environment','define','report_fax_transfer','uniqueid','lodash','../../config/logger','moment'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x5217,0xbb));var _0x7521=function(_0x369ffd,_0x5a35e3){_0x369ffd=_0x369ffd-0x0;var _0x1cbdf2=_0x5217[_0x369ffd];return _0x1cbdf2;};'use strict';var _=require(_0x7521('0x0'));var util=require('util');var logger=require(_0x7521('0x1'))('api');var moment=require(_0x7521('0x2'));var BPromise=require(_0x7521('0x3'));var rp=require(_0x7521('0x4'));var fs=require('fs');var path=require(_0x7521('0x5'));var rimraf=require('rimraf');var config=require(_0x7521('0x6'));var attributes=require('./faxTransferReport.attributes');module['exports']=function(_0x4a8ecf,_0x1616b7){return _0x4a8ecf[_0x7521('0x7')]('FaxTransferReport',attributes,{'tableName':_0x7521('0x8'),'paranoid':![],'indexes':[{'name':_0x7521('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa4a9=['path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise'];(function(_0x2b6f59,_0x3e02a5){var _0x4541b0=function(_0x1f6b2e){while(--_0x1f6b2e){_0x2b6f59['push'](_0x2b6f59['shift']());}};_0x4541b0(++_0x3e02a5);}(_0xa4a9,0x126));var _0x9a4a=function(_0x28f153,_0x4852ed){_0x28f153=_0x28f153-0x0;var _0x56b861=_0xa4a9[_0x28f153];return _0x56b861;};'use strict';var _=require(_0x9a4a('0x0'));var util=require(_0x9a4a('0x1'));var logger=require('../../config/logger')(_0x9a4a('0x2'));var moment=require(_0x9a4a('0x3'));var BPromise=require(_0x9a4a('0x4'));var rp=require(_0x9a4a('0x5'));var fs=require('fs');var path=require(_0x9a4a('0x6'));var rimraf=require(_0x9a4a('0x7'));var config=require(_0x9a4a('0x8'));var attributes=require(_0x9a4a('0x9'));module[_0x9a4a('0xa')]=function(_0x31f124,_0x30eaa3){return _0x31f124[_0x9a4a('0xb')](_0x9a4a('0xc'),attributes,{'tableName':_0x9a4a('0xd'),'paranoid':![],'indexes':[{'name':_0x9a4a('0xe'),'fields':[_0x9a4a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 730be22..31f33ca 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 _0x4710=['code','message','result','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4710,0x16c));var _0x0471=function(_0x3fee43,_0x51b186){_0x3fee43=_0x3fee43-0x0;var _0x21db79=_0x4710[_0x3fee43];return _0x21db79;};'use strict';var _=require('lodash');var util=require(_0x0471('0x0'));var moment=require('moment');var BPromise=require(_0x0471('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0471('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x0471('0x3'));var logger=require(_0x0471('0x4'))('rpc');var config=require(_0x0471('0x5'));var jayson=require(_0x0471('0x6'));var client=jayson[_0x0471('0x7')][_0x0471('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7005a3,_0x2c5642,_0xabc647){return new BPromise(function(_0x44fb95,_0x81eb48){return client['request'](_0x7005a3,_0xabc647)[_0x0471('0x9')](function(_0x4679e6){logger[_0x0471('0xa')](_0x0471('0xb'),_0x2c5642,_0x0471('0xc'));logger[_0x0471('0xd')](_0x0471('0xe'),_0x2c5642,_0x0471('0xc'),JSON['stringify'](_0x4679e6));if(_0x4679e6[_0x0471('0xf')]){if(_0x4679e6['error'][_0x0471('0x10')]===0x1f4){logger[_0x0471('0xf')](_0x0471('0xb'),_0x2c5642,_0x4679e6[_0x0471('0xf')][_0x0471('0x11')]);return _0x81eb48(_0x4679e6[_0x0471('0xf')][_0x0471('0x11')]);}logger[_0x0471('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x2c5642,_0x4679e6[_0x0471('0xf')][_0x0471('0x11')]);return _0x44fb95(_0x4679e6['error']['message']);}else{logger[_0x0471('0xa')](_0x0471('0xb'),_0x2c5642,_0x0471('0xc'));_0x44fb95(_0x4679e6[_0x0471('0x12')][_0x0471('0x11')]);}})[_0x0471('0x13')](function(_0x2624c7){logger[_0x0471('0xf')](_0x0471('0xb'),_0x2c5642,_0x2624c7);_0x81eb48(_0x2624c7);});});} \ No newline at end of file +var _0x4b78=['FaxTransferReport,\x20%s,\x20%s','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1d86e7,_0x1c0fcc){var _0x59e023=function(_0x5d7b43){while(--_0x5d7b43){_0x1d86e7['push'](_0x1d86e7['shift']());}};_0x59e023(++_0x1c0fcc);}(_0x4b78,0x145));var _0x84b7=function(_0xc6ea63,_0x1212a1){_0xc6ea63=_0xc6ea63-0x0;var _0x54b41b=_0x4b78[_0xc6ea63];return _0x54b41b;};'use strict';var _=require(_0x84b7('0x0'));var util=require(_0x84b7('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x84b7('0x2'));var fs=require('fs');var Redis=require(_0x84b7('0x3'));var db=require(_0x84b7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x84b7('0x5'))(_0x84b7('0x6'));var config=require(_0x84b7('0x7'));var jayson=require(_0x84b7('0x8'));var client=jayson[_0x84b7('0x9')][_0x84b7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17c29a,_0x5e6685,_0x103e69){return new BPromise(function(_0xd179d6,_0x4cd0f5){return client[_0x84b7('0xb')](_0x17c29a,_0x103e69)[_0x84b7('0xc')](function(_0x35c3f4){logger[_0x84b7('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x5e6685,_0x84b7('0xe'));logger[_0x84b7('0xf')](_0x84b7('0x10'),_0x5e6685,_0x84b7('0xe'),JSON[_0x84b7('0x11')](_0x35c3f4));if(_0x35c3f4[_0x84b7('0x12')]){if(_0x35c3f4[_0x84b7('0x12')][_0x84b7('0x13')]===0x1f4){logger[_0x84b7('0x12')](_0x84b7('0x14'),_0x5e6685,_0x35c3f4[_0x84b7('0x12')][_0x84b7('0x15')]);return _0x4cd0f5(_0x35c3f4['error'][_0x84b7('0x15')]);}logger[_0x84b7('0x12')](_0x84b7('0x14'),_0x5e6685,_0x35c3f4['error']['message']);return _0xd179d6(_0x35c3f4['error'][_0x84b7('0x15')]);}else{logger[_0x84b7('0xd')](_0x84b7('0x14'),_0x5e6685,'request\x20sent');_0xd179d6(_0x35c3f4['result'][_0x84b7('0x15')]);}})[_0x84b7('0x16')](function(_0x5dea04){logger[_0x84b7('0x12')](_0x84b7('0x14'),_0x5e6685,_0x5dea04);_0x4cd0f5(_0x5dea04);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 6778518..4719550 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 _0x42ae=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x3a99b1,_0x506570){var _0x178dac=function(_0x32c1b1){while(--_0x32c1b1){_0x3a99b1['push'](_0x3a99b1['shift']());}};_0x178dac(++_0x506570);}(_0x42ae,0x89));var _0xe42a=function(_0x5650b0,_0x1d1dff){_0x5650b0=_0x5650b0-0x0;var _0x311f58=_0x42ae[_0x5650b0];return _0x311f58;};'use strict';var multer=require(_0xe42a('0x0'));var util=require(_0xe42a('0x1'));var path=require(_0xe42a('0x2'));var timeout=require(_0xe42a('0x3'));var express=require(_0xe42a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe42a('0x5'));var interaction=require(_0xe42a('0x6'));var config=require(_0xe42a('0x7'));var controller=require(_0xe42a('0x8'));router[_0xe42a('0x9')]('/',auth[_0xe42a('0xa')](),controller[_0xe42a('0xb')]);router[_0xe42a('0x9')](_0xe42a('0xc'),auth['isAuthenticated'](),controller[_0xe42a('0xd')]);router[_0xe42a('0x9')](_0xe42a('0xe'),auth['isAuthenticated'](),controller[_0xe42a('0xf')]);router[_0xe42a('0x10')]('/',auth[_0xe42a('0xa')](),controller[_0xe42a('0x11')]);router[_0xe42a('0x12')](_0xe42a('0xe'),auth[_0xe42a('0xa')](),controller[_0xe42a('0x13')]);router[_0xe42a('0x14')](_0xe42a('0xe'),auth[_0xe42a('0xa')](),controller[_0xe42a('0x15')]);module[_0xe42a('0x16')]=router; \ No newline at end of file +var _0xae3c=['/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x3fdcc5,_0x1c3d31){var _0x16a5ce=function(_0x49c6cb){while(--_0x49c6cb){_0x3fdcc5['push'](_0x3fdcc5['shift']());}};_0x16a5ce(++_0x1c3d31);}(_0xae3c,0x148));var _0xcae3=function(_0x55abd9,_0x1148af){_0x55abd9=_0x55abd9-0x0;var _0x3e5669=_0xae3c[_0x55abd9];return _0x3e5669;};'use strict';var multer=require(_0xcae3('0x0'));var util=require(_0xcae3('0x1'));var path=require(_0xcae3('0x2'));var timeout=require(_0xcae3('0x3'));var express=require(_0xcae3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcae3('0x5'));var interaction=require(_0xcae3('0x6'));var config=require(_0xcae3('0x7'));var controller=require('./faxTransferReport.controller');router[_0xcae3('0x8')]('/',auth[_0xcae3('0x9')](),controller[_0xcae3('0xa')]);router[_0xcae3('0x8')](_0xcae3('0xb'),auth[_0xcae3('0x9')](),controller['describe']);router[_0xcae3('0x8')](_0xcae3('0xc'),auth[_0xcae3('0x9')](),controller[_0xcae3('0xd')]);router[_0xcae3('0xe')]('/',auth[_0xcae3('0x9')](),controller['create']);router[_0xcae3('0xf')]('/:id',auth[_0xcae3('0x9')](),controller[_0xcae3('0x10')]);router[_0xcae3('0x11')](_0xcae3('0xc'),auth[_0xcae3('0x9')](),controller[_0xcae3('0x12')]);module[_0xcae3('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 61faf1a..01d2b03 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 _0xd488=['exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','destroy'];(function(_0x40f30e,_0x4729dc){var _0x2ea85a=function(_0x5e43e6){while(--_0x5e43e6){_0x40f30e['push'](_0x40f30e['shift']());}};_0x2ea85a(++_0x4729dc);}(_0xd488,0x166));var _0x8d48=function(_0x3d7de8,_0x2a2ec4){_0x3d7de8=_0x3d7de8-0x0;var _0x5e9a0c=_0xd488[_0x3d7de8];return _0x5e9a0c;};'use strict';var multer=require('multer');var util=require(_0x8d48('0x0'));var path=require('path');var timeout=require(_0x8d48('0x1'));var express=require(_0x8d48('0x2'));var router=express[_0x8d48('0x3')]();var fs_extra=require(_0x8d48('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8d48('0x5'));var config=require('../../config/environment');var controller=require(_0x8d48('0x6'));router[_0x8d48('0x7')]('/',auth[_0x8d48('0x8')](),controller[_0x8d48('0x9')]);router[_0x8d48('0x7')](_0x8d48('0xa'),auth[_0x8d48('0x8')](),controller[_0x8d48('0xb')]);router[_0x8d48('0x7')]('/:id/configurations',auth[_0x8d48('0x8')](),controller['getConfigurations']);router[_0x8d48('0x7')](_0x8d48('0xc'),auth['isAuthenticated'](),controller[_0x8d48('0xd')]);router[_0x8d48('0xe')]('/',auth[_0x8d48('0x8')](),controller[_0x8d48('0xf')]);router['post'](_0x8d48('0x10'),auth[_0x8d48('0x8')](),controller[_0x8d48('0x11')]);router[_0x8d48('0x12')]('/:id',auth[_0x8d48('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x8d48('0x13')]);module[_0x8d48('0x14')]=router; \ No newline at end of file +var _0x6519=['show','/:id/configurations','isAuthenticated','getConfigurations','getFields','post','addConfiguration','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id'];(function(_0x2f098c,_0x159232){var _0xe8f6ef=function(_0x3ae036){while(--_0x3ae036){_0x2f098c['push'](_0x2f098c['shift']());}};_0xe8f6ef(++_0x159232);}(_0x6519,0x163));var _0x9651=function(_0x43bc0e,_0x18864e){_0x43bc0e=_0x43bc0e-0x0;var _0x5b4081=_0x6519[_0x43bc0e];return _0x5b4081;};'use strict';var multer=require(_0x9651('0x0'));var util=require(_0x9651('0x1'));var path=require(_0x9651('0x2'));var timeout=require(_0x9651('0x3'));var express=require(_0x9651('0x4'));var router=express[_0x9651('0x5')]();var fs_extra=require(_0x9651('0x6'));var auth=require(_0x9651('0x7'));var interaction=require(_0x9651('0x8'));var config=require(_0x9651('0x9'));var controller=require('./intDeskAccount.controller');router[_0x9651('0xa')]('/',auth['isAuthenticated'](),controller[_0x9651('0xb')]);router[_0x9651('0xa')](_0x9651('0xc'),auth['isAuthenticated'](),controller[_0x9651('0xd')]);router[_0x9651('0xa')](_0x9651('0xe'),auth[_0x9651('0xf')](),controller[_0x9651('0x10')]);router[_0x9651('0xa')]('/:id/fields',auth[_0x9651('0xf')](),controller[_0x9651('0x11')]);router['post']('/',auth[_0x9651('0xf')](),controller['create']);router[_0x9651('0x12')](_0x9651('0xe'),auth[_0x9651('0xf')](),controller[_0x9651('0x13')]);router[_0x9651('0x14')]('/:id',auth[_0x9651('0xf')](),controller['update']);router[_0x9651('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x9651('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index c2bd50f..d2b8504 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 _0x4cc7=['exports','STRING','basic','integrationTab','newTab'];(function(_0x506734,_0x52bb68){var _0x3d84fa=function(_0x3d0258){while(--_0x3d0258){_0x506734['push'](_0x506734['shift']());}};_0x3d84fa(++_0x52bb68);}(_0x4cc7,0xe6));var _0x74cc=function(_0xc92b81,_0x1ba725){_0xc92b81=_0xc92b81-0x0;var _0x38d666=_0x4cc7[_0xc92b81];return _0x38d666;};'use strict';var Sequelize=require('sequelize');module[_0x74cc('0x0')]={'name':{'type':Sequelize[_0x74cc('0x1')]},'description':{'type':Sequelize[_0x74cc('0x1')]},'username':{'type':Sequelize[_0x74cc('0x1')]},'remoteUri':{'type':Sequelize[_0x74cc('0x1')]},'authType':{'type':Sequelize['ENUM']('basic'),'defaultValue':_0x74cc('0x2')},'password':{'type':Sequelize[_0x74cc('0x1')]},'consumerKey':{'type':Sequelize[_0x74cc('0x1')]},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x74cc('0x1')]},'tokenSecret':{'type':Sequelize[_0x74cc('0x1')]},'serverUrl':{'type':Sequelize[_0x74cc('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x74cc('0x3'),_0x74cc('0x4')),'defaultValue':_0x74cc('0x3')}}; \ No newline at end of file +var _0xfa4d=['sequelize','exports','STRING','basic','ENUM','integrationTab','newTab'];(function(_0x2fe853,_0x1891ef){var _0x424021=function(_0xd455cc){while(--_0xd455cc){_0x2fe853['push'](_0x2fe853['shift']());}};_0x424021(++_0x1891ef);}(_0xfa4d,0x1e3));var _0xdfa4=function(_0x5302ad,_0x1e9a92){_0x5302ad=_0x5302ad-0x0;var _0x96331f=_0xfa4d[_0x5302ad];return _0x96331f;};'use strict';var Sequelize=require(_0xdfa4('0x0'));module[_0xdfa4('0x1')]={'name':{'type':Sequelize[_0xdfa4('0x2')]},'description':{'type':Sequelize[_0xdfa4('0x2')]},'username':{'type':Sequelize[_0xdfa4('0x2')]},'remoteUri':{'type':Sequelize[_0xdfa4('0x2')]},'authType':{'type':Sequelize['ENUM'](_0xdfa4('0x3')),'defaultValue':_0xdfa4('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0xdfa4('0x2')]},'token':{'type':Sequelize[_0xdfa4('0x2')]},'tokenSecret':{'type':Sequelize[_0xdfa4('0x2')]},'serverUrl':{'type':Sequelize[_0xdfa4('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xdfa4('0x4')](_0xdfa4('0x5'),_0xdfa4('0x6')),'defaultValue':_0xdfa4('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 1fe9302..fc654bd 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 _0xfa1e=['merge','type','includeAll','findAll','rows','show','include','find','catch','create','body','destroy','params','getConfigurations','findOne','pick','options','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','DeskConfiguration','DeskField','Descriptions','getFields','priority','remoteUri','authType','password','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','Authorization','Basic\x20%s','%s:%s','username','toString','base64','concat','_embedded','entries','active','label','test','statusCode','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','map','DeskAccount','rawAttributes','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where'];(function(_0x549565,_0x54bdb0){var _0x23c3cd=function(_0x3a81e7){while(--_0x3a81e7){_0x549565['push'](_0x549565['shift']());}};_0x23c3cd(++_0x54bdb0);}(_0xfa1e,0xae));var _0xefa1=function(_0x4a5494,_0x3ad336){_0x4a5494=_0x4a5494-0x0;var _0x57cbb5=_0xfa1e[_0x4a5494];return _0x57cbb5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xefa1('0x0'));var zipdir=require(_0xefa1('0x1'));var jsonpatch=require(_0xefa1('0x2'));var rp=require(_0xefa1('0x3'));var moment=require(_0xefa1('0x4'));var BPromise=require(_0xefa1('0x5'));var Mustache=require(_0xefa1('0x6'));var util=require(_0xefa1('0x7'));var path=require(_0xefa1('0x8'));var sox=require(_0xefa1('0x9'));var csv=require(_0xefa1('0xa'));var ejs=require(_0xefa1('0xb'));var fs=require('fs');var fs_extra=require(_0xefa1('0xc'));var _=require(_0xefa1('0xd'));var squel=require(_0xefa1('0xe'));var crypto=require('crypto');var jsforce=require(_0xefa1('0xf'));var deskjs=require(_0xefa1('0x10'));var toCsv=require('to-csv');var querystring=require(_0xefa1('0x11'));var Papa=require('papaparse');var Redis=require(_0xefa1('0x12'));var authService=require(_0xefa1('0x13'));var qs=require(_0xefa1('0x14'));var as=require(_0xefa1('0x15'));var hardwareService=require(_0xefa1('0x16'));var logger=require(_0xefa1('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xefa1('0x18'));var licenseUtil=require(_0xefa1('0x19'));var db=require(_0xefa1('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x15bed2,_0x286a24){_0x286a24=_0x286a24||0xcc;return function(_0x105ce3){if(_0x105ce3){return _0x15bed2['sendStatus'](_0x286a24);}return _0x15bed2[_0xefa1('0x1b')](_0x286a24)[_0xefa1('0x1c')]();};}function respondWithResult(_0x52d3c0,_0x1f3d72){_0x1f3d72=_0x1f3d72||0xc8;return function(_0x10acbb){if(_0x10acbb){return _0x52d3c0[_0xefa1('0x1b')](_0x1f3d72)['json'](_0x10acbb);}};}function respondWithFilteredResult(_0x21b846,_0x11bdda){return function(_0x1c08c4){if(_0x1c08c4){var _0x283500=typeof _0x11bdda[_0xefa1('0x1d')]===_0xefa1('0x1e')&&typeof _0x11bdda[_0xefa1('0x1f')]==='undefined';var _0xb81f6a=_0x1c08c4[_0xefa1('0x20')];var _0xb05097=_0x283500?0x0:_0x11bdda[_0xefa1('0x1d')];var _0x236149=_0x283500?_0x1c08c4[_0xefa1('0x20')]:_0x11bdda[_0xefa1('0x1d')]+_0x11bdda['limit'];var _0x4cfc72;if(_0x236149>=_0xb81f6a){_0x236149=_0xb81f6a;_0x4cfc72=0xc8;}else{_0x4cfc72=0xce;}_0x21b846[_0xefa1('0x1b')](_0x4cfc72);return _0x21b846[_0xefa1('0x21')]('Content-Range',_0xb05097+'-'+_0x236149+'/'+_0xb81f6a)[_0xefa1('0x22')](_0x1c08c4);}return null;};}function patchUpdates(_0x32d906){return function(_0x40b21f){try{jsonpatch[_0xefa1('0x23')](_0x40b21f,_0x32d906,!![]);}catch(_0x58742c){return BPromise[_0xefa1('0x24')](_0x58742c);}return _0x40b21f[_0xefa1('0x25')]();};}function saveUpdates(_0xca3371,_0x3a631a){return function(_0x27bb84){if(_0x27bb84){return _0x27bb84[_0xefa1('0x26')](_0xca3371)[_0xefa1('0x27')](function(_0x2dd7b9){return _0x2dd7b9;});}return null;};}function removeEntity(_0x51611d,_0x1a457a){return function(_0x1f4ac7){if(_0x1f4ac7){return _0x1f4ac7['destroy']()[_0xefa1('0x27')](function(){_0x51611d['status'](0xcc)[_0xefa1('0x1c')]();});}};}function handleEntityNotFound(_0x29142f,_0x4886ac){return function(_0x883b3d){if(!_0x883b3d){_0x29142f[_0xefa1('0x28')](0x194);}return _0x883b3d;};}function handleError(_0x496c43,_0x530dae){_0x530dae=_0x530dae||0x1f4;return function(_0x720044){logger[_0xefa1('0x29')](_0x720044[_0xefa1('0x2a')]);if(_0x720044[_0xefa1('0x2b')]){delete _0x720044[_0xefa1('0x2b')];}_0x496c43[_0xefa1('0x1b')](_0x530dae)[_0xefa1('0x2c')](_0x720044);};}exports['index']=function(_0x5551dc,_0xeb2bc8){var _0x3f8ecc={},_0x3adefe={},_0x24546c={'count':0x0,'rows':[]};var _0x316ee2=_[_0xefa1('0x2d')](db[_0xefa1('0x2e')][_0xefa1('0x2f')],function(_0x481545){return{'name':_0x481545['fieldName'],'type':_0x481545['type']['key']};});_0x3adefe[_0xefa1('0x30')]=_[_0xefa1('0x2d')](_0x316ee2,_0xefa1('0x2b'));_0x3adefe[_0xefa1('0x31')]=_[_0xefa1('0x32')](_0x5551dc[_0xefa1('0x31')]);_0x3adefe['filters']=_[_0xefa1('0x33')](_0x3adefe[_0xefa1('0x30')],_0x3adefe[_0xefa1('0x31')]);_0x3f8ecc[_0xefa1('0x34')]=_[_0xefa1('0x33')](_0x3adefe[_0xefa1('0x30')],qs[_0xefa1('0x35')](_0x5551dc[_0xefa1('0x31')]['fields']));_0x3f8ecc[_0xefa1('0x34')]=_0x3f8ecc[_0xefa1('0x34')][_0xefa1('0x36')]?_0x3f8ecc['attributes']:_0x3adefe[_0xefa1('0x30')];if(!_0x5551dc[_0xefa1('0x31')][_0xefa1('0x37')](_0xefa1('0x38'))){_0x3f8ecc[_0xefa1('0x1f')]=qs[_0xefa1('0x1f')](_0x5551dc['query'][_0xefa1('0x1f')]);_0x3f8ecc[_0xefa1('0x1d')]=qs['offset'](_0x5551dc[_0xefa1('0x31')][_0xefa1('0x1d')]);}_0x3f8ecc[_0xefa1('0x39')]=qs[_0xefa1('0x3a')](_0x5551dc['query'][_0xefa1('0x3a')]);_0x3f8ecc['where']=qs[_0xefa1('0x3b')](_['pick'](_0x5551dc[_0xefa1('0x31')],_0x3adefe['filters']),_0x316ee2);if(_0x5551dc[_0xefa1('0x31')][_0xefa1('0x3c')]){_0x3f8ecc[_0xefa1('0x3d')]=_[_0xefa1('0x3e')](_0x3f8ecc[_0xefa1('0x3d')],{'$or':_[_0xefa1('0x2d')](_0x316ee2,function(_0x45f34e){if(_0x45f34e[_0xefa1('0x3f')]!=='VIRTUAL'){var _0x1a3174={};_0x1a3174[_0x45f34e['name']]={'$like':'%'+_0x5551dc[_0xefa1('0x31')][_0xefa1('0x3c')]+'%'};return _0x1a3174;}})});}_0x3f8ecc=_[_0xefa1('0x3e')]({},_0x3f8ecc,_0x5551dc['options']);var _0x45f5c6={'where':_0x3f8ecc[_0xefa1('0x3d')]};return db['DeskAccount']['count'](_0x45f5c6)[_0xefa1('0x27')](function(_0x1b0d58){_0x24546c[_0xefa1('0x20')]=_0x1b0d58;if(_0x5551dc[_0xefa1('0x31')][_0xefa1('0x40')]){_0x3f8ecc['include']=[{'all':!![]}];}return db[_0xefa1('0x2e')][_0xefa1('0x41')](_0x3f8ecc);})[_0xefa1('0x27')](function(_0x2b4d15){_0x24546c[_0xefa1('0x42')]=_0x2b4d15;return _0x24546c;})[_0xefa1('0x27')](respondWithFilteredResult(_0xeb2bc8,_0x3f8ecc))['catch'](handleError(_0xeb2bc8,null));};exports[_0xefa1('0x43')]=function(_0x2fe270,_0x51bfc6){var _0x5d9e8d={'raw':![],'where':{'id':_0x2fe270['params']['id']}},_0x429a65={};_0x429a65['model']=_[_0xefa1('0x32')](db[_0xefa1('0x2e')][_0xefa1('0x2f')]);_0x429a65[_0xefa1('0x31')]=_[_0xefa1('0x32')](_0x2fe270[_0xefa1('0x31')]);_0x429a65[_0xefa1('0x3b')]=_[_0xefa1('0x33')](_0x429a65[_0xefa1('0x30')],_0x429a65[_0xefa1('0x31')]);_0x5d9e8d[_0xefa1('0x34')]=_[_0xefa1('0x33')](_0x429a65[_0xefa1('0x30')],qs[_0xefa1('0x35')](_0x2fe270[_0xefa1('0x31')][_0xefa1('0x35')]));_0x5d9e8d['attributes']=_0x5d9e8d[_0xefa1('0x34')][_0xefa1('0x36')]?_0x5d9e8d[_0xefa1('0x34')]:_0x429a65[_0xefa1('0x30')];if(_0x2fe270[_0xefa1('0x31')][_0xefa1('0x40')]){_0x5d9e8d[_0xefa1('0x44')]=[{'all':!![]}];}_0x5d9e8d=_[_0xefa1('0x3e')]({},_0x5d9e8d,_0x2fe270['options']);return db[_0xefa1('0x2e')][_0xefa1('0x45')](_0x5d9e8d)['then'](handleEntityNotFound(_0x51bfc6,null))[_0xefa1('0x27')](respondWithResult(_0x51bfc6,null))[_0xefa1('0x46')](handleError(_0x51bfc6,null));};exports[_0xefa1('0x47')]=function(_0xbe987f,_0x57357e){return db['DeskAccount'][_0xefa1('0x47')](_0xbe987f['body'],{})[_0xefa1('0x27')](respondWithResult(_0x57357e,0xc9))[_0xefa1('0x46')](handleError(_0x57357e,null));};exports[_0xefa1('0x26')]=function(_0x35313a,_0x5b6fab){if(_0x35313a[_0xefa1('0x48')]['id']){delete _0x35313a[_0xefa1('0x48')]['id'];}return db[_0xefa1('0x2e')][_0xefa1('0x45')]({'where':{'id':_0x35313a['params']['id']}})[_0xefa1('0x27')](handleEntityNotFound(_0x5b6fab,null))[_0xefa1('0x27')](saveUpdates(_0x35313a['body'],null))[_0xefa1('0x27')](respondWithResult(_0x5b6fab,null))[_0xefa1('0x46')](handleError(_0x5b6fab,null));};exports[_0xefa1('0x49')]=function(_0x3f18c3,_0x48054e){return db[_0xefa1('0x2e')][_0xefa1('0x45')]({'where':{'id':_0x3f18c3[_0xefa1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x48054e,null))[_0xefa1('0x27')](removeEntity(_0x48054e,null))[_0xefa1('0x46')](handleError(_0x48054e,null));};exports[_0xefa1('0x4b')]=function(_0x299e89,_0x422f8b,_0x85d48e){var _0xb37035={};var _0x14dca5={};var _0x4af3b6;var _0x5e0766;return db[_0xefa1('0x2e')][_0xefa1('0x4c')]({'where':{'id':_0x299e89[_0xefa1('0x4a')]['id']}})[_0xefa1('0x27')](handleEntityNotFound(_0x422f8b,null))[_0xefa1('0x27')](function(_0x5ceefb){if(_0x5ceefb){_0x4af3b6=_0x5ceefb;_0x14dca5[_0xefa1('0x30')]=_[_0xefa1('0x32')](db['DeskConfiguration'][_0xefa1('0x2f')]);_0x14dca5['query']=_[_0xefa1('0x32')](_0x299e89[_0xefa1('0x31')]);_0x14dca5[_0xefa1('0x3b')]=_[_0xefa1('0x33')](_0x14dca5['model'],_0x14dca5[_0xefa1('0x31')]);_0xb37035['attributes']=_[_0xefa1('0x33')](_0x14dca5[_0xefa1('0x30')],qs[_0xefa1('0x35')](_0x299e89[_0xefa1('0x31')][_0xefa1('0x35')]));_0xb37035[_0xefa1('0x34')]=_0xb37035[_0xefa1('0x34')]['length']?_0xb37035['attributes']:_0x14dca5[_0xefa1('0x30')];_0xb37035['order']=qs[_0xefa1('0x3a')](_0x299e89[_0xefa1('0x31')]['sort']);_0xb37035[_0xefa1('0x3d')]=qs['filters'](_[_0xefa1('0x4d')](_0x299e89['query'],_0x14dca5['filters']));if(_0x299e89[_0xefa1('0x31')]['filter']){_0xb37035[_0xefa1('0x3d')]=_['merge'](_0xb37035[_0xefa1('0x3d')],{'$or':_['map'](_0xb37035[_0xefa1('0x34')],function(_0x26988a){var _0x104c39={};_0x104c39[_0x26988a]={'$like':'%'+_0x299e89[_0xefa1('0x31')]['filter']+'%'};return _0x104c39;})});}_0xb37035=_[_0xefa1('0x3e')]({},_0xb37035,_0x299e89[_0xefa1('0x4e')]);return _0x4af3b6[_0xefa1('0x4b')](_0xb37035);}})['then'](function(_0x2d780d){if(_0x2d780d){_0x5e0766=_0x2d780d[_0xefa1('0x36')];if(!_0x299e89[_0xefa1('0x31')]['hasOwnProperty'](_0xefa1('0x38'))){_0xb37035['limit']=qs[_0xefa1('0x1f')](_0x299e89['query'][_0xefa1('0x1f')]);_0xb37035[_0xefa1('0x1d')]=qs['offset'](_0x299e89[_0xefa1('0x31')][_0xefa1('0x1d')]);}return _0x4af3b6['getConfigurations'](_0xb37035);}})['then'](function(_0x53725f){if(_0x53725f){return _0x53725f?{'count':_0x5e0766,'rows':_0x53725f}:null;}})['then'](respondWithResult(_0x422f8b,null))[_0xefa1('0x46')](handleError(_0x422f8b,null));};exports[_0xefa1('0x4f')]=function(_0x4899ef,_0x98b83b,_0x275c7e){if(_0x4899ef['body']['id']){delete _0x4899ef[_0xefa1('0x48')]['id'];}return db[_0xefa1('0x2e')][_0xefa1('0x4c')]({'where':{'id':_0x4899ef[_0xefa1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x98b83b,null))[_0xefa1('0x27')](function(_0xd991c5){if(_0xd991c5){_0x4899ef[_0xefa1('0x48')][_0xefa1('0x50')]=_0xd991c5['id'];_0x4899ef[_0xefa1('0x48')][_0xefa1('0x51')]=integrations[_0xefa1('0x52')](_0x4899ef[_0xefa1('0x48')][_0xefa1('0x53')],_0x4899ef['body']['type']);_0x4899ef[_0xefa1('0x48')]['Descriptions']=integrations[_0xefa1('0x54')](_0x4899ef[_0xefa1('0x48')][_0xefa1('0x53')],_0x4899ef[_0xefa1('0x48')][_0xefa1('0x3f')]);return db[_0xefa1('0x55')]['create'](_0x4899ef['body'],{'include':[{'model':db['DeskField'],'as':'Subjects'},{'model':db[_0xefa1('0x56')],'as':_0xefa1('0x57')}]});}return null;})[_0xefa1('0x27')](respondWithResult(_0x98b83b,null))[_0xefa1('0x46')](handleError(_0x98b83b,null));};exports[_0xefa1('0x58')]=function(_0x3eb081,_0x1d1fd3,_0x2b1048){var _0x3e9d06=[{'name':_0xefa1('0x59'),'label':_0xefa1('0x59'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0xa75a96='';return db['DeskAccount'][_0xefa1('0x4c')]({'where':{'id':_0x3eb081['params']['id']},'attributes':['id',_0xefa1('0x5a'),_0xefa1('0x5b'),'username',_0xefa1('0x5c'),'consumerKey',_0xefa1('0x5d'),_0xefa1('0x5e'),_0xefa1('0x5f')]})[_0xefa1('0x27')](handleEntityNotFound(_0x1d1fd3,null))[_0xefa1('0x27')](function(_0x5a6f4e){if(_0x5a6f4e){_0xa75a96=_0x5a6f4e[_0xefa1('0x5a')];var _0x361095=_0xa75a96[_0xefa1('0x60')](-0x1);if(_0x361095==='/'){_0xa75a96=_0xa75a96[_0xefa1('0x61')](0x0,_0xa75a96[_0xefa1('0x62')](_0x361095));}var _0x5754d8={'method':_0xefa1('0x63'),'uri':util[_0xefa1('0x64')](_0xefa1('0x65'),_0xa75a96),'headers':{'Content-Type':_0xefa1('0x66'),'Accept':_0xefa1('0x66')},'json':!![]};if(_0x5a6f4e[_0xefa1('0x5b')]==='basic'){_0x5754d8['headers'][_0xefa1('0x67')]=util[_0xefa1('0x64')](_0xefa1('0x68'),new Buffer(util[_0xefa1('0x64')](_0xefa1('0x69'),_0x5a6f4e[_0xefa1('0x6a')],_0x5a6f4e['password']))[_0xefa1('0x6b')](_0xefa1('0x6c')));}return rp(_0x5754d8)[_0xefa1('0x27')](function(_0x52f067){return _0x3e9d06[_0xefa1('0x6d')](_['map'](_0x52f067[_0xefa1('0x6e')][_0xefa1('0x6f')],function(_0x33963a){return{'id':_0x33963a[_0xefa1('0x2b')],'name':_0x33963a['name'],'type':_0x33963a['type'],'active':_0x33963a[_0xefa1('0x70')],'label':_0x33963a[_0xefa1('0x71')],'custom':!![]};}));});}})['then'](function(_0x160737){return{'count':_0x160737[_0xefa1('0x36')],'rows':_0x160737};})[_0xefa1('0x27')](respondWithResult(_0x1d1fd3,null))['catch'](function(_0x49caab){var _0x43b8f9=_0x3eb081[_0xefa1('0x31')][_0xefa1('0x72')]?0x1f4:_0x49caab[_0xefa1('0x73')]||0x1f4;logger[_0xefa1('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0xefa1('0x58'),_0x43b8f9,JSON[_0xefa1('0x74')](_0x49caab));delete _0x49caab[_0xefa1('0x2b')];if(_0x43b8f9===0x191){_0x43b8f9=0x190;}_0x1d1fd3[_0xefa1('0x1b')](_0x43b8f9)[_0xefa1('0x2c')](_0x3eb081[_0xefa1('0x31')][_0xefa1('0x72')]?{'message':_0xefa1('0x75'),'statusCode':_0x49caab['statusCode']}:_0x49caab);});}; \ No newline at end of file +var _0xbffb=['DeskField','Descriptions','getFields','priority','remoteUri','username','consumerKey','consumerSecret','token','tokenSecret','substring','lastIndexOf','GET','%s/custom_fields','application/json','authType','basic','Authorization','Basic\x20%s','format','password','toString','concat','_embedded','entries','label','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','DeskAccount','includeAll','include','findAll','rows','show','params','options','find','body','catch','getConfigurations','findOne','DeskConfiguration','addConfiguration','Subjects','getSubjects','channel','create'];(function(_0x510b94,_0x4dbbc0){var _0xd3e601=function(_0x478d3a){while(--_0x478d3a){_0x510b94['push'](_0x510b94['shift']());}};_0xd3e601(++_0x4dbbc0);}(_0xbffb,0x17a));var _0xbbff=function(_0x35e205,_0x51285b){_0x35e205=_0x35e205-0x0;var _0x70425=_0xbffb[_0x35e205];return _0x70425;};'use strict';var emlformat=require(_0xbbff('0x0'));var rimraf=require(_0xbbff('0x1'));var zipdir=require(_0xbbff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbbff('0x3'));var Mustache=require('mustache');var util=require(_0xbbff('0x4'));var path=require(_0xbbff('0x5'));var sox=require(_0xbbff('0x6'));var csv=require('to-csv');var ejs=require(_0xbbff('0x7'));var fs=require('fs');var fs_extra=require(_0xbbff('0x8'));var _=require(_0xbbff('0x9'));var squel=require(_0xbbff('0xa'));var crypto=require('crypto');var jsforce=require(_0xbbff('0xb'));var deskjs=require(_0xbbff('0xc'));var toCsv=require(_0xbbff('0xd'));var querystring=require(_0xbbff('0xe'));var Papa=require(_0xbbff('0xf'));var Redis=require(_0xbbff('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbbff('0x11'));var as=require(_0xbbff('0x12'));var hardwareService=require(_0xbbff('0x13'));var logger=require(_0xbbff('0x14'))(_0xbbff('0x15'));var utils=require(_0xbbff('0x16'));var config=require(_0xbbff('0x17'));var licenseUtil=require(_0xbbff('0x18'));var db=require(_0xbbff('0x19'))['db'];var integrations=require(_0xbbff('0x1a'));function respondWithStatusCode(_0xb5a7f,_0x2f5e38){_0x2f5e38=_0x2f5e38||0xcc;return function(_0x1d6cba){if(_0x1d6cba){return _0xb5a7f[_0xbbff('0x1b')](_0x2f5e38);}return _0xb5a7f['status'](_0x2f5e38)[_0xbbff('0x1c')]();};}function respondWithResult(_0x347c13,_0x2e2a78){_0x2e2a78=_0x2e2a78||0xc8;return function(_0x1cff5a){if(_0x1cff5a){return _0x347c13[_0xbbff('0x1d')](_0x2e2a78)[_0xbbff('0x1e')](_0x1cff5a);}};}function respondWithFilteredResult(_0x47187b,_0x154234){return function(_0x1fbfee){if(_0x1fbfee){var _0x45dc4e=typeof _0x154234[_0xbbff('0x1f')]===_0xbbff('0x20')&&typeof _0x154234['limit']==='undefined';var _0x2fad2e=_0x1fbfee[_0xbbff('0x21')];var _0x5b7f78=_0x45dc4e?0x0:_0x154234[_0xbbff('0x1f')];var _0x5130ae=_0x45dc4e?_0x1fbfee[_0xbbff('0x21')]:_0x154234['offset']+_0x154234[_0xbbff('0x22')];var _0x16d041;if(_0x5130ae>=_0x2fad2e){_0x5130ae=_0x2fad2e;_0x16d041=0xc8;}else{_0x16d041=0xce;}_0x47187b[_0xbbff('0x1d')](_0x16d041);return _0x47187b['set'](_0xbbff('0x23'),_0x5b7f78+'-'+_0x5130ae+'/'+_0x2fad2e)[_0xbbff('0x1e')](_0x1fbfee);}return null;};}function patchUpdates(_0x4060c8){return function(_0xcd0b85){try{jsonpatch[_0xbbff('0x24')](_0xcd0b85,_0x4060c8,!![]);}catch(_0x34a01d){return BPromise['reject'](_0x34a01d);}return _0xcd0b85[_0xbbff('0x25')]();};}function saveUpdates(_0x34f198,_0x4a91de){return function(_0xe1e6fa){if(_0xe1e6fa){return _0xe1e6fa[_0xbbff('0x26')](_0x34f198)['then'](function(_0x23f728){return _0x23f728;});}return null;};}function removeEntity(_0x38a2a4,_0x34b13e){return function(_0x27d27e){if(_0x27d27e){return _0x27d27e[_0xbbff('0x27')]()[_0xbbff('0x28')](function(){_0x38a2a4[_0xbbff('0x1d')](0xcc)[_0xbbff('0x1c')]();});}};}function handleEntityNotFound(_0x225208,_0x563450){return function(_0x56f278){if(!_0x56f278){_0x225208[_0xbbff('0x1b')](0x194);}return _0x56f278;};}function handleError(_0x332178,_0x1d326e){_0x1d326e=_0x1d326e||0x1f4;return function(_0x228546){logger['error'](_0x228546[_0xbbff('0x29')]);if(_0x228546[_0xbbff('0x2a')]){delete _0x228546[_0xbbff('0x2a')];}_0x332178[_0xbbff('0x1d')](_0x1d326e)[_0xbbff('0x2b')](_0x228546);};}exports[_0xbbff('0x2c')]=function(_0x1f770a,_0x139a3d){var _0x3ac32a={},_0x33ae12={},_0x40b74c={'count':0x0,'rows':[]};var _0x319ad8=_[_0xbbff('0x2d')](db['DeskAccount'][_0xbbff('0x2e')],function(_0x31c864){return{'name':_0x31c864[_0xbbff('0x2f')],'type':_0x31c864[_0xbbff('0x30')][_0xbbff('0x31')]};});_0x33ae12['model']=_[_0xbbff('0x2d')](_0x319ad8,_0xbbff('0x2a'));_0x33ae12[_0xbbff('0x32')]=_[_0xbbff('0x33')](_0x1f770a[_0xbbff('0x32')]);_0x33ae12[_0xbbff('0x34')]=_[_0xbbff('0x35')](_0x33ae12[_0xbbff('0x36')],_0x33ae12[_0xbbff('0x32')]);_0x3ac32a[_0xbbff('0x37')]=_['intersection'](_0x33ae12['model'],qs[_0xbbff('0x38')](_0x1f770a['query'][_0xbbff('0x38')]));_0x3ac32a[_0xbbff('0x37')]=_0x3ac32a[_0xbbff('0x37')][_0xbbff('0x39')]?_0x3ac32a['attributes']:_0x33ae12[_0xbbff('0x36')];if(!_0x1f770a['query'][_0xbbff('0x3a')](_0xbbff('0x3b'))){_0x3ac32a['limit']=qs['limit'](_0x1f770a['query'][_0xbbff('0x22')]);_0x3ac32a['offset']=qs[_0xbbff('0x1f')](_0x1f770a[_0xbbff('0x32')][_0xbbff('0x1f')]);}_0x3ac32a[_0xbbff('0x3c')]=qs[_0xbbff('0x3d')](_0x1f770a[_0xbbff('0x32')]['sort']);_0x3ac32a[_0xbbff('0x3e')]=qs[_0xbbff('0x34')](_[_0xbbff('0x3f')](_0x1f770a[_0xbbff('0x32')],_0x33ae12[_0xbbff('0x34')]),_0x319ad8);if(_0x1f770a[_0xbbff('0x32')][_0xbbff('0x40')]){_0x3ac32a[_0xbbff('0x3e')]=_[_0xbbff('0x41')](_0x3ac32a[_0xbbff('0x3e')],{'$or':_[_0xbbff('0x2d')](_0x319ad8,function(_0x55d578){if(_0x55d578[_0xbbff('0x30')]!==_0xbbff('0x42')){var _0x2ad9b0={};_0x2ad9b0[_0x55d578[_0xbbff('0x2a')]]={'$like':'%'+_0x1f770a[_0xbbff('0x32')][_0xbbff('0x40')]+'%'};return _0x2ad9b0;}})});}_0x3ac32a=_[_0xbbff('0x41')]({},_0x3ac32a,_0x1f770a['options']);var _0x42e653={'where':_0x3ac32a['where']};return db[_0xbbff('0x43')]['count'](_0x42e653)[_0xbbff('0x28')](function(_0x5dd056){_0x40b74c[_0xbbff('0x21')]=_0x5dd056;if(_0x1f770a[_0xbbff('0x32')][_0xbbff('0x44')]){_0x3ac32a[_0xbbff('0x45')]=[{'all':!![]}];}return db[_0xbbff('0x43')][_0xbbff('0x46')](_0x3ac32a);})[_0xbbff('0x28')](function(_0x5dda93){_0x40b74c[_0xbbff('0x47')]=_0x5dda93;return _0x40b74c;})[_0xbbff('0x28')](respondWithFilteredResult(_0x139a3d,_0x3ac32a))['catch'](handleError(_0x139a3d,null));};exports[_0xbbff('0x48')]=function(_0x1e92d2,_0x4e5dd6){var _0x234010={'raw':![],'where':{'id':_0x1e92d2[_0xbbff('0x49')]['id']}},_0x2096c8={};_0x2096c8['model']=_[_0xbbff('0x33')](db[_0xbbff('0x43')]['rawAttributes']);_0x2096c8[_0xbbff('0x32')]=_[_0xbbff('0x33')](_0x1e92d2[_0xbbff('0x32')]);_0x2096c8[_0xbbff('0x34')]=_['intersection'](_0x2096c8[_0xbbff('0x36')],_0x2096c8[_0xbbff('0x32')]);_0x234010[_0xbbff('0x37')]=_[_0xbbff('0x35')](_0x2096c8['model'],qs['fields'](_0x1e92d2[_0xbbff('0x32')][_0xbbff('0x38')]));_0x234010[_0xbbff('0x37')]=_0x234010['attributes'][_0xbbff('0x39')]?_0x234010[_0xbbff('0x37')]:_0x2096c8[_0xbbff('0x36')];if(_0x1e92d2[_0xbbff('0x32')][_0xbbff('0x44')]){_0x234010[_0xbbff('0x45')]=[{'all':!![]}];}_0x234010=_[_0xbbff('0x41')]({},_0x234010,_0x1e92d2[_0xbbff('0x4a')]);return db[_0xbbff('0x43')][_0xbbff('0x4b')](_0x234010)[_0xbbff('0x28')](handleEntityNotFound(_0x4e5dd6,null))[_0xbbff('0x28')](respondWithResult(_0x4e5dd6,null))['catch'](handleError(_0x4e5dd6,null));};exports['create']=function(_0x1e73d0,_0xe85c85){return db[_0xbbff('0x43')]['create'](_0x1e73d0[_0xbbff('0x4c')],{})[_0xbbff('0x28')](respondWithResult(_0xe85c85,0xc9))[_0xbbff('0x4d')](handleError(_0xe85c85,null));};exports['update']=function(_0x3781f4,_0xd2ddd6){if(_0x3781f4[_0xbbff('0x4c')]['id']){delete _0x3781f4[_0xbbff('0x4c')]['id'];}return db[_0xbbff('0x43')]['find']({'where':{'id':_0x3781f4[_0xbbff('0x49')]['id']}})[_0xbbff('0x28')](handleEntityNotFound(_0xd2ddd6,null))[_0xbbff('0x28')](saveUpdates(_0x3781f4[_0xbbff('0x4c')],null))['then'](respondWithResult(_0xd2ddd6,null))[_0xbbff('0x4d')](handleError(_0xd2ddd6,null));};exports['destroy']=function(_0x4011b6,_0x440d88){return db['DeskAccount'][_0xbbff('0x4b')]({'where':{'id':_0x4011b6[_0xbbff('0x49')]['id']}})[_0xbbff('0x28')](handleEntityNotFound(_0x440d88,null))[_0xbbff('0x28')](removeEntity(_0x440d88,null))[_0xbbff('0x4d')](handleError(_0x440d88,null));};exports[_0xbbff('0x4e')]=function(_0x3aa03c,_0x49c7a5,_0x24daad){var _0x304c71={};var _0xeb74b1={};var _0x56e76b;var _0x4c32dd;return db[_0xbbff('0x43')][_0xbbff('0x4f')]({'where':{'id':_0x3aa03c[_0xbbff('0x49')]['id']}})[_0xbbff('0x28')](handleEntityNotFound(_0x49c7a5,null))[_0xbbff('0x28')](function(_0x208f85){if(_0x208f85){_0x56e76b=_0x208f85;_0xeb74b1[_0xbbff('0x36')]=_[_0xbbff('0x33')](db[_0xbbff('0x50')]['rawAttributes']);_0xeb74b1[_0xbbff('0x32')]=_[_0xbbff('0x33')](_0x3aa03c['query']);_0xeb74b1[_0xbbff('0x34')]=_[_0xbbff('0x35')](_0xeb74b1[_0xbbff('0x36')],_0xeb74b1['query']);_0x304c71[_0xbbff('0x37')]=_[_0xbbff('0x35')](_0xeb74b1[_0xbbff('0x36')],qs[_0xbbff('0x38')](_0x3aa03c[_0xbbff('0x32')][_0xbbff('0x38')]));_0x304c71[_0xbbff('0x37')]=_0x304c71[_0xbbff('0x37')][_0xbbff('0x39')]?_0x304c71[_0xbbff('0x37')]:_0xeb74b1[_0xbbff('0x36')];_0x304c71[_0xbbff('0x3c')]=qs[_0xbbff('0x3d')](_0x3aa03c[_0xbbff('0x32')][_0xbbff('0x3d')]);_0x304c71['where']=qs[_0xbbff('0x34')](_[_0xbbff('0x3f')](_0x3aa03c[_0xbbff('0x32')],_0xeb74b1[_0xbbff('0x34')]));if(_0x3aa03c[_0xbbff('0x32')][_0xbbff('0x40')]){_0x304c71[_0xbbff('0x3e')]=_[_0xbbff('0x41')](_0x304c71[_0xbbff('0x3e')],{'$or':_[_0xbbff('0x2d')](_0x304c71[_0xbbff('0x37')],function(_0x3bb4ca){var _0xe33dc8={};_0xe33dc8[_0x3bb4ca]={'$like':'%'+_0x3aa03c[_0xbbff('0x32')]['filter']+'%'};return _0xe33dc8;})});}_0x304c71=_[_0xbbff('0x41')]({},_0x304c71,_0x3aa03c[_0xbbff('0x4a')]);return _0x56e76b['getConfigurations'](_0x304c71);}})[_0xbbff('0x28')](function(_0xd7b2c6){if(_0xd7b2c6){_0x4c32dd=_0xd7b2c6[_0xbbff('0x39')];if(!_0x3aa03c[_0xbbff('0x32')][_0xbbff('0x3a')]('nolimit')){_0x304c71[_0xbbff('0x22')]=qs['limit'](_0x3aa03c[_0xbbff('0x32')][_0xbbff('0x22')]);_0x304c71[_0xbbff('0x1f')]=qs[_0xbbff('0x1f')](_0x3aa03c[_0xbbff('0x32')][_0xbbff('0x1f')]);}return _0x56e76b[_0xbbff('0x4e')](_0x304c71);}})['then'](function(_0x30a457){if(_0x30a457){return _0x30a457?{'count':_0x4c32dd,'rows':_0x30a457}:null;}})[_0xbbff('0x28')](respondWithResult(_0x49c7a5,null))[_0xbbff('0x4d')](handleError(_0x49c7a5,null));};exports[_0xbbff('0x51')]=function(_0x42aa29,_0x5e7441,_0x3d25de){if(_0x42aa29[_0xbbff('0x4c')]['id']){delete _0x42aa29[_0xbbff('0x4c')]['id'];}return db[_0xbbff('0x43')]['findOne']({'where':{'id':_0x42aa29['params']['id']}})[_0xbbff('0x28')](handleEntityNotFound(_0x5e7441,null))[_0xbbff('0x28')](function(_0x48f3e1){if(_0x48f3e1){_0x42aa29[_0xbbff('0x4c')]['AccountId']=_0x48f3e1['id'];_0x42aa29['body'][_0xbbff('0x52')]=integrations[_0xbbff('0x53')](_0x42aa29[_0xbbff('0x4c')][_0xbbff('0x54')],_0x42aa29['body'][_0xbbff('0x30')]);_0x42aa29[_0xbbff('0x4c')]['Descriptions']=integrations['getDescriptions'](_0x42aa29['body'][_0xbbff('0x54')],_0x42aa29[_0xbbff('0x4c')]['type']);return db[_0xbbff('0x50')][_0xbbff('0x55')](_0x42aa29[_0xbbff('0x4c')],{'include':[{'model':db[_0xbbff('0x56')],'as':_0xbbff('0x52')},{'model':db[_0xbbff('0x56')],'as':_0xbbff('0x57')}]});}return null;})[_0xbbff('0x28')](respondWithResult(_0x5e7441,null))['catch'](handleError(_0x5e7441,null));};exports[_0xbbff('0x58')]=function(_0x506a77,_0x505bb5,_0x50e41a){var _0x2c8527=[{'name':'priority','label':_0xbbff('0x59'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x1004b0='';return db[_0xbbff('0x43')][_0xbbff('0x4f')]({'where':{'id':_0x506a77[_0xbbff('0x49')]['id']},'attributes':['id',_0xbbff('0x5a'),'authType',_0xbbff('0x5b'),'password',_0xbbff('0x5c'),_0xbbff('0x5d'),_0xbbff('0x5e'),_0xbbff('0x5f')]})[_0xbbff('0x28')](handleEntityNotFound(_0x505bb5,null))['then'](function(_0x2980da){if(_0x2980da){_0x1004b0=_0x2980da[_0xbbff('0x5a')];var _0x3b84f3=_0x1004b0['slice'](-0x1);if(_0x3b84f3==='/'){_0x1004b0=_0x1004b0[_0xbbff('0x60')](0x0,_0x1004b0[_0xbbff('0x61')](_0x3b84f3));}var _0x397727={'method':_0xbbff('0x62'),'uri':util['format'](_0xbbff('0x63'),_0x1004b0),'headers':{'Content-Type':_0xbbff('0x64'),'Accept':'application/json'},'json':!![]};if(_0x2980da[_0xbbff('0x65')]===_0xbbff('0x66')){_0x397727['headers'][_0xbbff('0x67')]=util['format'](_0xbbff('0x68'),new Buffer(util[_0xbbff('0x69')]('%s:%s',_0x2980da[_0xbbff('0x5b')],_0x2980da[_0xbbff('0x6a')]))[_0xbbff('0x6b')]('base64'));}return rp(_0x397727)['then'](function(_0x1a0166){return _0x2c8527[_0xbbff('0x6c')](_['map'](_0x1a0166[_0xbbff('0x6d')][_0xbbff('0x6e')],function(_0x519081){return{'id':_0x519081['name'],'name':_0x519081[_0xbbff('0x2a')],'type':_0x519081[_0xbbff('0x30')],'active':_0x519081['active'],'label':_0x519081[_0xbbff('0x6f')],'custom':!![]};}));});}})[_0xbbff('0x28')](function(_0x2d65fd){return{'count':_0x2d65fd['length'],'rows':_0x2d65fd};})[_0xbbff('0x28')](respondWithResult(_0x505bb5,null))[_0xbbff('0x4d')](function(_0x30dc29){var _0x4619a0=_0x506a77[_0xbbff('0x32')][_0xbbff('0x70')]?0x1f4:_0x30dc29['statusCode']||0x1f4;logger['error'](_0xbbff('0x71'),_0xbbff('0x58'),_0x4619a0,JSON[_0xbbff('0x72')](_0x30dc29));delete _0x30dc29[_0xbbff('0x2a')];if(_0x4619a0===0x191){_0x4619a0=0x190;}_0x505bb5[_0xbbff('0x1d')](_0x4619a0)[_0xbbff('0x2b')](_0x506a77[_0xbbff('0x32')][_0xbbff('0x70')]?{'message':_0xbbff('0x73'),'statusCode':_0x30dc29['statusCode']}:_0x30dc29);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index c189d80..b1a1acd 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 _0x7fd5=['api','bluebird','request-promise','path','rimraf','./intDeskAccount.attributes','DeskAccount','int_desk_accounts','util'];(function(_0x1fb45d,_0x4a10c4){var _0x8a054=function(_0x4bd703){while(--_0x4bd703){_0x1fb45d['push'](_0x1fb45d['shift']());}};_0x8a054(++_0x4a10c4);}(_0x7fd5,0x128));var _0x57fd=function(_0x3fc97b,_0x20ca29){_0x3fc97b=_0x3fc97b-0x0;var _0x3a0c82=_0x7fd5[_0x3fc97b];return _0x3a0c82;};'use strict';var _=require('lodash');var util=require(_0x57fd('0x0'));var logger=require('../../config/logger')(_0x57fd('0x1'));var moment=require('moment');var BPromise=require(_0x57fd('0x2'));var rp=require(_0x57fd('0x3'));var fs=require('fs');var path=require(_0x57fd('0x4'));var rimraf=require(_0x57fd('0x5'));var config=require('../../config/environment');var attributes=require(_0x57fd('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x463138,_0x17207a){return _0x463138['define'](_0x57fd('0x7'),attributes,{'tableName':_0x57fd('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xecf8=['../../config/logger','api','moment','request-promise','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','DeskAccount','int_desk_accounts','util'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xecf8,0xfb));var _0x8ecf=function(_0xd50518,_0x255c1b){_0xd50518=_0xd50518-0x0;var _0x55f86f=_0xecf8[_0xd50518];return _0x55f86f;};'use strict';var _=require('lodash');var util=require(_0x8ecf('0x0'));var logger=require(_0x8ecf('0x1'))(_0x8ecf('0x2'));var moment=require(_0x8ecf('0x3'));var BPromise=require('bluebird');var rp=require(_0x8ecf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8ecf('0x5'));var attributes=require(_0x8ecf('0x6'));var integrations=require(_0x8ecf('0x7'));module[_0x8ecf('0x8')]=function(_0x342d1e,_0x2b9ddd){return _0x342d1e[_0x8ecf('0x9')](_0x8ecf('0xa'),attributes,{'tableName':_0x8ecf('0xb'),'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 14c35c4..1ce8ad5 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 _0x2922=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetDeskAccount','DeskAccount','options','raw','attributes','limit','map','include','model','ShowDeskAccount','find','where','debug','lodash','util','moment','bluebird','randomstring'];(function(_0x4c6d81,_0x280d3a){var _0x1882bc=function(_0x35f1f8){while(--_0x35f1f8){_0x4c6d81['push'](_0x4c6d81['shift']());}};_0x1882bc(++_0x280d3a);}(_0x2922,0x87));var _0x2292=function(_0x3ab540,_0x563273){_0x3ab540=_0x3ab540-0x0;var _0x9fce9e=_0x2922[_0x3ab540];return _0x9fce9e;};'use strict';var _=require(_0x2292('0x0'));var util=require(_0x2292('0x1'));var moment=require(_0x2292('0x2'));var BPromise=require(_0x2292('0x3'));var rs=require(_0x2292('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2292('0x5'))['db'];var utils=require(_0x2292('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2292('0x7'));var jayson=require(_0x2292('0x8'));var client=jayson[_0x2292('0x9')][_0x2292('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x280b5b,_0x2cfc29,_0x289b9d){return new BPromise(function(_0x269cdb,_0x5d9297){return client[_0x2292('0xb')](_0x280b5b,_0x289b9d)[_0x2292('0xc')](function(_0x3e175f){logger[_0x2292('0xd')](_0x2292('0xe'),_0x2cfc29,_0x2292('0xf'));logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x2cfc29,_0x2292('0xf'),JSON[_0x2292('0x10')](_0x3e175f));if(_0x3e175f[_0x2292('0x11')]){if(_0x3e175f[_0x2292('0x11')][_0x2292('0x12')]===0x1f4){logger[_0x2292('0x11')](_0x2292('0xe'),_0x2cfc29,_0x3e175f[_0x2292('0x11')][_0x2292('0x13')]);return _0x5d9297(_0x3e175f[_0x2292('0x11')][_0x2292('0x13')]);}logger[_0x2292('0x11')](_0x2292('0xe'),_0x2cfc29,_0x3e175f['error'][_0x2292('0x13')]);return _0x269cdb(_0x3e175f[_0x2292('0x11')][_0x2292('0x13')]);}else{logger[_0x2292('0xd')](_0x2292('0xe'),_0x2cfc29,_0x2292('0xf'));_0x269cdb(_0x3e175f[_0x2292('0x14')]['message']);}})[_0x2292('0x15')](function(_0x47a0df){logger[_0x2292('0x11')]('DeskAccount,\x20%s,\x20%s',_0x2cfc29,_0x47a0df);_0x5d9297(_0x47a0df);});});}exports[_0x2292('0x16')]=function(_0x1a9a06){var _0xd395aa=this;return new Promise(function(_0x42a4fd,_0x1a505f){return db[_0x2292('0x17')]['findAll']({'raw':_0x1a9a06[_0x2292('0x18')]?_0x1a9a06[_0x2292('0x18')][_0x2292('0x19')]===undefined?!![]:![]:!![],'where':_0x1a9a06[_0x2292('0x18')]?_0x1a9a06[_0x2292('0x18')]['where']||null:null,'attributes':_0x1a9a06[_0x2292('0x18')]?_0x1a9a06[_0x2292('0x18')][_0x2292('0x1a')]||null:null,'limit':_0x1a9a06['options']?_0x1a9a06[_0x2292('0x18')][_0x2292('0x1b')]||null:null,'include':_0x1a9a06[_0x2292('0x18')]?_0x1a9a06['options']['include']?_[_0x2292('0x1c')](_0x1a9a06[_0x2292('0x18')][_0x2292('0x1d')],function(_0x1bb470){return{'model':db[_0x1bb470[_0x2292('0x1e')]],'as':_0x1bb470['as'],'attributes':_0x1bb470[_0x2292('0x1a')],'include':_0x1bb470['include']?_[_0x2292('0x1c')](_0x1bb470[_0x2292('0x1d')],function(_0x143a38){return{'model':db[_0x143a38['model']],'as':_0x143a38['as'],'attributes':_0x143a38[_0x2292('0x1a')],'include':_0x143a38[_0x2292('0x1d')]?_['map'](_0x143a38[_0x2292('0x1d')],function(_0x372f61){return{'model':db[_0x372f61[_0x2292('0x1e')]],'as':_0x372f61['as'],'attributes':_0x372f61[_0x2292('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2292('0xc')](function(_0x429564){logger[_0x2292('0xd')](_0x2292('0x16'),_0x1a9a06);logger['debug'](_0x2292('0x16'),_0x1a9a06,JSON['stringify'](_0x429564));_0x42a4fd(_0x429564);})[_0x2292('0x15')](function(_0x33c0f9){logger[_0x2292('0x11')]('GetDeskAccount',_0x33c0f9[_0x2292('0x13')],_0x1a9a06);_0x1a505f(_0xd395aa[_0x2292('0x11')](0x1f4,_0x33c0f9[_0x2292('0x13')]));});});};exports[_0x2292('0x1f')]=function(_0x465937){var _0x5347b8=this;return new Promise(function(_0x2333e4,_0x33f6c4){return db[_0x2292('0x17')][_0x2292('0x20')]({'raw':_0x465937[_0x2292('0x18')]?_0x465937[_0x2292('0x18')][_0x2292('0x19')]===undefined?!![]:![]:!![],'where':_0x465937[_0x2292('0x18')]?_0x465937[_0x2292('0x18')][_0x2292('0x21')]||null:null,'attributes':_0x465937[_0x2292('0x18')]?_0x465937[_0x2292('0x18')]['attributes']||null:null,'include':_0x465937['options']?_0x465937['options'][_0x2292('0x1d')]?_[_0x2292('0x1c')](_0x465937[_0x2292('0x18')][_0x2292('0x1d')],function(_0x32f1d5){return{'model':db[_0x32f1d5[_0x2292('0x1e')]],'as':_0x32f1d5['as'],'attributes':_0x32f1d5[_0x2292('0x1a')],'include':_0x32f1d5[_0x2292('0x1d')]?_[_0x2292('0x1c')](_0x32f1d5[_0x2292('0x1d')],function(_0x410ff9){return{'model':db[_0x410ff9[_0x2292('0x1e')]],'as':_0x410ff9['as'],'attributes':_0x410ff9[_0x2292('0x1a')],'include':_0x410ff9[_0x2292('0x1d')]?_['map'](_0x410ff9['include'],function(_0x4a7b18){return{'model':db[_0x4a7b18['model']],'as':_0x4a7b18['as'],'attributes':_0x4a7b18[_0x2292('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2292('0xc')](function(_0x51ed24){logger[_0x2292('0xd')](_0x2292('0x1f'),_0x465937);logger[_0x2292('0x22')](_0x2292('0x1f'),_0x465937,JSON[_0x2292('0x10')](_0x51ed24));_0x2333e4(_0x51ed24);})[_0x2292('0x15')](function(_0xcbc869){logger[_0x2292('0x11')](_0x2292('0x1f'),_0xcbc869[_0x2292('0x13')],_0x465937);_0x33f6c4(_0x5347b8[_0x2292('0x11')](0x1f4,_0xcbc869[_0x2292('0x13')]));});});}; \ No newline at end of file +var _0x9d70=['include','map','model','catch','ShowDeskAccount','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','stringify','code','error','DeskAccount,\x20%s,\x20%s','message','result','GetDeskAccount','DeskAccount','findAll','options','raw','where','attributes','limit'];(function(_0x3d9918,_0x208cff){var _0xd9bb25=function(_0x1d922b){while(--_0x1d922b){_0x3d9918['push'](_0x3d9918['shift']());}};_0xd9bb25(++_0x208cff);}(_0x9d70,0x1e1));var _0x09d7=function(_0x12f688,_0x585c25){_0x12f688=_0x12f688-0x0;var _0x59c3de=_0x9d70[_0x12f688];return _0x59c3de;};'use strict';var _=require('lodash');var util=require(_0x09d7('0x0'));var moment=require(_0x09d7('0x1'));var BPromise=require(_0x09d7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x09d7('0x3'));var db=require(_0x09d7('0x4'))['db'];var utils=require(_0x09d7('0x5'));var logger=require(_0x09d7('0x6'))(_0x09d7('0x7'));var config=require(_0x09d7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x09d7('0x9')][_0x09d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4239f7,_0x59da6b,_0x210a87){return new BPromise(function(_0x3b604b,_0xb08386){return client['request'](_0x4239f7,_0x210a87)[_0x09d7('0xb')](function(_0xa3881f){logger[_0x09d7('0xc')]('DeskAccount,\x20%s,\x20%s',_0x59da6b,_0x09d7('0xd'));logger[_0x09d7('0xe')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x59da6b,'request\x20sent',JSON[_0x09d7('0xf')](_0xa3881f));if(_0xa3881f['error']){if(_0xa3881f['error'][_0x09d7('0x10')]===0x1f4){logger[_0x09d7('0x11')](_0x09d7('0x12'),_0x59da6b,_0xa3881f[_0x09d7('0x11')][_0x09d7('0x13')]);return _0xb08386(_0xa3881f[_0x09d7('0x11')][_0x09d7('0x13')]);}logger[_0x09d7('0x11')](_0x09d7('0x12'),_0x59da6b,_0xa3881f[_0x09d7('0x11')][_0x09d7('0x13')]);return _0x3b604b(_0xa3881f[_0x09d7('0x11')][_0x09d7('0x13')]);}else{logger[_0x09d7('0xc')](_0x09d7('0x12'),_0x59da6b,_0x09d7('0xd'));_0x3b604b(_0xa3881f[_0x09d7('0x14')]['message']);}})['catch'](function(_0xdeceb){logger[_0x09d7('0x11')](_0x09d7('0x12'),_0x59da6b,_0xdeceb);_0xb08386(_0xdeceb);});});}exports[_0x09d7('0x15')]=function(_0x9a1cfd){var _0x2423a9=this;return new Promise(function(_0x3b8814,_0x4008ce){return db[_0x09d7('0x16')][_0x09d7('0x17')]({'raw':_0x9a1cfd[_0x09d7('0x18')]?_0x9a1cfd['options'][_0x09d7('0x19')]===undefined?!![]:![]:!![],'where':_0x9a1cfd['options']?_0x9a1cfd[_0x09d7('0x18')][_0x09d7('0x1a')]||null:null,'attributes':_0x9a1cfd[_0x09d7('0x18')]?_0x9a1cfd[_0x09d7('0x18')][_0x09d7('0x1b')]||null:null,'limit':_0x9a1cfd[_0x09d7('0x18')]?_0x9a1cfd[_0x09d7('0x18')][_0x09d7('0x1c')]||null:null,'include':_0x9a1cfd[_0x09d7('0x18')]?_0x9a1cfd[_0x09d7('0x18')][_0x09d7('0x1d')]?_[_0x09d7('0x1e')](_0x9a1cfd[_0x09d7('0x18')][_0x09d7('0x1d')],function(_0x1ee895){return{'model':db[_0x1ee895[_0x09d7('0x1f')]],'as':_0x1ee895['as'],'attributes':_0x1ee895[_0x09d7('0x1b')],'include':_0x1ee895[_0x09d7('0x1d')]?_[_0x09d7('0x1e')](_0x1ee895[_0x09d7('0x1d')],function(_0x416bf2){return{'model':db[_0x416bf2[_0x09d7('0x1f')]],'as':_0x416bf2['as'],'attributes':_0x416bf2[_0x09d7('0x1b')],'include':_0x416bf2[_0x09d7('0x1d')]?_[_0x09d7('0x1e')](_0x416bf2[_0x09d7('0x1d')],function(_0x36201e){return{'model':db[_0x36201e['model']],'as':_0x36201e['as'],'attributes':_0x36201e[_0x09d7('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x09d7('0xb')](function(_0x2fe511){logger['info']('GetDeskAccount',_0x9a1cfd);logger[_0x09d7('0xe')]('GetDeskAccount',_0x9a1cfd,JSON[_0x09d7('0xf')](_0x2fe511));_0x3b8814(_0x2fe511);})[_0x09d7('0x20')](function(_0x24e7a7){logger[_0x09d7('0x11')](_0x09d7('0x15'),_0x24e7a7[_0x09d7('0x13')],_0x9a1cfd);_0x4008ce(_0x2423a9[_0x09d7('0x11')](0x1f4,_0x24e7a7[_0x09d7('0x13')]));});});};exports[_0x09d7('0x21')]=function(_0x58c3a6){var _0x48820f=this;return new Promise(function(_0x367395,_0x41a37e){return db[_0x09d7('0x16')]['find']({'raw':_0x58c3a6[_0x09d7('0x18')]?_0x58c3a6[_0x09d7('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x58c3a6[_0x09d7('0x18')]?_0x58c3a6[_0x09d7('0x18')][_0x09d7('0x1a')]||null:null,'attributes':_0x58c3a6[_0x09d7('0x18')]?_0x58c3a6['options'][_0x09d7('0x1b')]||null:null,'include':_0x58c3a6[_0x09d7('0x18')]?_0x58c3a6['options'][_0x09d7('0x1d')]?_[_0x09d7('0x1e')](_0x58c3a6[_0x09d7('0x18')][_0x09d7('0x1d')],function(_0x56a9cb){return{'model':db[_0x56a9cb[_0x09d7('0x1f')]],'as':_0x56a9cb['as'],'attributes':_0x56a9cb[_0x09d7('0x1b')],'include':_0x56a9cb[_0x09d7('0x1d')]?_['map'](_0x56a9cb['include'],function(_0x32d94e){return{'model':db[_0x32d94e[_0x09d7('0x1f')]],'as':_0x32d94e['as'],'attributes':_0x32d94e['attributes'],'include':_0x32d94e[_0x09d7('0x1d')]?_[_0x09d7('0x1e')](_0x32d94e[_0x09d7('0x1d')],function(_0x4351c2){return{'model':db[_0x4351c2[_0x09d7('0x1f')]],'as':_0x4351c2['as'],'attributes':_0x4351c2[_0x09d7('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x09d7('0xb')](function(_0x134330){logger[_0x09d7('0xc')](_0x09d7('0x21'),_0x58c3a6);logger[_0x09d7('0xe')](_0x09d7('0x21'),_0x58c3a6,JSON[_0x09d7('0xf')](_0x134330));_0x367395(_0x134330);})['catch'](function(_0x13bbeb){logger[_0x09d7('0x11')](_0x09d7('0x21'),_0x13bbeb[_0x09d7('0x13')],_0x58c3a6);_0x41a37e(_0x48820f['error'](0x1f4,_0x13bbeb[_0x09d7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 0488131..eb8e5e9 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 _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x3b8003,_0x38b259){var _0x534867=function(_0xc1ceec){while(--_0xc1ceec){_0x3b8003['push'](_0x3b8003['shift']());}};_0x534867(++_0x38b259);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',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/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file +var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x236f93,_0x374b6e){var _0x5eef36=function(_0x32173d){while(--_0x32173d){_0x236f93['push'](_0x236f93['shift']());}};_0x5eef36(++_0x374b6e);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',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/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('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 4c88b22..04ec686 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 _0x06cd=['sequelize','exports','STRING'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x06cd,0x132));var _0xd06c=function(_0x4e9a49,_0x56c62c){_0x4e9a49=_0x4e9a49-0x0;var _0x52f83c=_0x06cd[_0x4e9a49];return _0x52f83c;};'use strict';var Sequelize=require(_0xd06c('0x0'));module[_0xd06c('0x1')]={'name':{'type':Sequelize[_0xd06c('0x2')]},'description':{'type':Sequelize[_0xd06c('0x2')]}}; \ No newline at end of file +var _0xebd8=['STRING','sequelize','exports'];(function(_0x3f4ff9,_0x2f2483){var _0x297ad1=function(_0x1334c6){while(--_0x1334c6){_0x3f4ff9['push'](_0x3f4ff9['shift']());}};_0x297ad1(++_0x2f2483);}(_0xebd8,0x1d5));var _0x8ebd=function(_0x3faf32,_0x3fbf16){_0x3faf32=_0x3faf32-0x0;var _0x3aa981=_0xebd8[_0x3faf32];return _0x3aa981;};'use strict';var Sequelize=require(_0x8ebd('0x0'));module[_0x8ebd('0x1')]={'name':{'type':Sequelize[_0x8ebd('0x2')]},'description':{'type':Sequelize[_0x8ebd('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 40f81c3..150d335 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 _0xd77c=['crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','destroy','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','DeskField','getFields','hasOwnProperty','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd77c,0xfa));var _0xcd77=function(_0x184de3,_0x40aaa4){_0x184de3=_0x184de3-0x0;var _0x1b3646=_0xd77c[_0x184de3];return _0x1b3646;};'use strict';var emlformat=require(_0xcd77('0x0'));var rimraf=require(_0xcd77('0x1'));var zipdir=require(_0xcd77('0x2'));var jsonpatch=require(_0xcd77('0x3'));var rp=require('request-promise');var moment=require(_0xcd77('0x4'));var BPromise=require(_0xcd77('0x5'));var Mustache=require(_0xcd77('0x6'));var util=require(_0xcd77('0x7'));var path=require(_0xcd77('0x8'));var sox=require('sox');var csv=require(_0xcd77('0x9'));var ejs=require(_0xcd77('0xa'));var fs=require('fs');var fs_extra=require(_0xcd77('0xb'));var _=require(_0xcd77('0xc'));var squel=require(_0xcd77('0xd'));var crypto=require(_0xcd77('0xe'));var jsforce=require(_0xcd77('0xf'));var deskjs=require(_0xcd77('0x10'));var toCsv=require(_0xcd77('0x9'));var querystring=require(_0xcd77('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcd77('0x12'));var qs=require(_0xcd77('0x13'));var as=require(_0xcd77('0x14'));var hardwareService=require(_0xcd77('0x15'));var logger=require(_0xcd77('0x16'))('api');var utils=require(_0xcd77('0x17'));var config=require(_0xcd77('0x18'));var licenseUtil=require(_0xcd77('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14b67b,_0x2c1ffc){_0x2c1ffc=_0x2c1ffc||0xcc;return function(_0x1c7295){if(_0x1c7295){return _0x14b67b[_0xcd77('0x1a')](_0x2c1ffc);}return _0x14b67b[_0xcd77('0x1b')](_0x2c1ffc)[_0xcd77('0x1c')]();};}function respondWithResult(_0x211f3a,_0x29458a){_0x29458a=_0x29458a||0xc8;return function(_0x42b937){if(_0x42b937){return _0x211f3a[_0xcd77('0x1b')](_0x29458a)[_0xcd77('0x1d')](_0x42b937);}};}function respondWithFilteredResult(_0x10232b,_0x4ab6c4){return function(_0x5581b0){if(_0x5581b0){var _0x48b9dd=typeof _0x4ab6c4[_0xcd77('0x1e')]===_0xcd77('0x1f')&&typeof _0x4ab6c4['limit']===_0xcd77('0x1f');var _0x3c2133=_0x5581b0['count'];var _0x5d47d3=_0x48b9dd?0x0:_0x4ab6c4[_0xcd77('0x1e')];var _0x4bc938=_0x48b9dd?_0x5581b0[_0xcd77('0x20')]:_0x4ab6c4[_0xcd77('0x1e')]+_0x4ab6c4[_0xcd77('0x21')];var _0x1a7567;if(_0x4bc938>=_0x3c2133){_0x4bc938=_0x3c2133;_0x1a7567=0xc8;}else{_0x1a7567=0xce;}_0x10232b[_0xcd77('0x1b')](_0x1a7567);return _0x10232b[_0xcd77('0x22')](_0xcd77('0x23'),_0x5d47d3+'-'+_0x4bc938+'/'+_0x3c2133)[_0xcd77('0x1d')](_0x5581b0);}return null;};}function patchUpdates(_0x3650f2){return function(_0x34abfd){try{jsonpatch['apply'](_0x34abfd,_0x3650f2,!![]);}catch(_0x1532af){return BPromise[_0xcd77('0x24')](_0x1532af);}return _0x34abfd[_0xcd77('0x25')]();};}function saveUpdates(_0x5ab472,_0x9fb789){return function(_0x16ea4f){if(_0x16ea4f){return _0x16ea4f[_0xcd77('0x26')](_0x5ab472)['then'](function(_0x1cf1ec){return _0x1cf1ec;});}return null;};}function removeEntity(_0x4ff316,_0x1a95e5){return function(_0x21f981){if(_0x21f981){return _0x21f981[_0xcd77('0x27')]()['then'](function(){_0x4ff316['status'](0xcc)[_0xcd77('0x1c')]();});}};}function handleEntityNotFound(_0x4edc1b,_0x2d10cf){return function(_0xdfaac2){if(!_0xdfaac2){_0x4edc1b['sendStatus'](0x194);}return _0xdfaac2;};}function handleError(_0xbda2b9,_0x330086){_0x330086=_0x330086||0x1f4;return function(_0x2cc229){logger[_0xcd77('0x28')](_0x2cc229[_0xcd77('0x29')]);if(_0x2cc229[_0xcd77('0x2a')]){delete _0x2cc229[_0xcd77('0x2a')];}_0xbda2b9['status'](_0x330086)[_0xcd77('0x2b')](_0x2cc229);};}exports[_0xcd77('0x2c')]=function(_0x1220bb,_0x4093d4){var _0x55d073={},_0x2acdc0={},_0x809d0={'count':0x0,'rows':[]};var _0x35b047=_[_0xcd77('0x2d')](db[_0xcd77('0x2e')][_0xcd77('0x2f')],function(_0x4f968a){return{'name':_0x4f968a['fieldName'],'type':_0x4f968a[_0xcd77('0x30')][_0xcd77('0x31')]};});_0x2acdc0[_0xcd77('0x32')]=_[_0xcd77('0x2d')](_0x35b047,_0xcd77('0x2a'));_0x2acdc0[_0xcd77('0x33')]=_[_0xcd77('0x34')](_0x1220bb[_0xcd77('0x33')]);_0x2acdc0['filters']=_[_0xcd77('0x35')](_0x2acdc0[_0xcd77('0x32')],_0x2acdc0[_0xcd77('0x33')]);_0x55d073['attributes']=_['intersection'](_0x2acdc0[_0xcd77('0x32')],qs[_0xcd77('0x36')](_0x1220bb[_0xcd77('0x33')][_0xcd77('0x36')]));_0x55d073[_0xcd77('0x37')]=_0x55d073[_0xcd77('0x37')][_0xcd77('0x38')]?_0x55d073['attributes']:_0x2acdc0[_0xcd77('0x32')];if(!_0x1220bb['query']['hasOwnProperty'](_0xcd77('0x39'))){_0x55d073[_0xcd77('0x21')]=qs[_0xcd77('0x21')](_0x1220bb[_0xcd77('0x33')]['limit']);_0x55d073['offset']=qs['offset'](_0x1220bb[_0xcd77('0x33')][_0xcd77('0x1e')]);}_0x55d073[_0xcd77('0x3a')]=qs[_0xcd77('0x3b')](_0x1220bb[_0xcd77('0x33')][_0xcd77('0x3b')]);_0x55d073[_0xcd77('0x3c')]=qs[_0xcd77('0x3d')](_[_0xcd77('0x3e')](_0x1220bb[_0xcd77('0x33')],_0x2acdc0['filters']),_0x35b047);if(_0x1220bb[_0xcd77('0x33')][_0xcd77('0x3f')]){_0x55d073[_0xcd77('0x3c')]=_[_0xcd77('0x40')](_0x55d073[_0xcd77('0x3c')],{'$or':_[_0xcd77('0x2d')](_0x35b047,function(_0x5b6c3d){if(_0x5b6c3d['type']!==_0xcd77('0x41')){var _0x1c3be8={};_0x1c3be8[_0x5b6c3d['name']]={'$like':'%'+_0x1220bb[_0xcd77('0x33')][_0xcd77('0x3f')]+'%'};return _0x1c3be8;}})});}_0x55d073=_['merge']({},_0x55d073,_0x1220bb[_0xcd77('0x42')]);var _0x3563e5={'where':_0x55d073[_0xcd77('0x3c')]};return db[_0xcd77('0x2e')]['count'](_0x3563e5)[_0xcd77('0x43')](function(_0x83144a){_0x809d0[_0xcd77('0x20')]=_0x83144a;if(_0x1220bb['query'][_0xcd77('0x44')]){_0x55d073[_0xcd77('0x45')]=[{'all':!![]}];}return db['DeskConfiguration'][_0xcd77('0x46')](_0x55d073);})['then'](function(_0x4e339d){_0x809d0[_0xcd77('0x47')]=_0x4e339d;return _0x809d0;})[_0xcd77('0x43')](respondWithFilteredResult(_0x4093d4,_0x55d073))[_0xcd77('0x48')](handleError(_0x4093d4,null));};exports[_0xcd77('0x49')]=function(_0x980e94,_0x5cd2f3){var _0xbab124={'raw':![],'where':{'id':_0x980e94[_0xcd77('0x4a')]['id']}},_0xc6aae2={};_0xc6aae2[_0xcd77('0x32')]=_[_0xcd77('0x34')](db[_0xcd77('0x2e')][_0xcd77('0x2f')]);_0xc6aae2['query']=_['keys'](_0x980e94['query']);_0xc6aae2[_0xcd77('0x3d')]=_[_0xcd77('0x35')](_0xc6aae2[_0xcd77('0x32')],_0xc6aae2[_0xcd77('0x33')]);_0xbab124[_0xcd77('0x37')]=_[_0xcd77('0x35')](_0xc6aae2[_0xcd77('0x32')],qs[_0xcd77('0x36')](_0x980e94[_0xcd77('0x33')][_0xcd77('0x36')]));_0xbab124['attributes']=_0xbab124[_0xcd77('0x37')]['length']?_0xbab124['attributes']:_0xc6aae2[_0xcd77('0x32')];if(_0x980e94[_0xcd77('0x33')]['includeAll']){_0xbab124[_0xcd77('0x45')]=[{'all':!![]}];}_0xbab124=_[_0xcd77('0x40')]({},_0xbab124,_0x980e94['options']);return db[_0xcd77('0x2e')][_0xcd77('0x4b')](_0xbab124)[_0xcd77('0x43')](handleEntityNotFound(_0x5cd2f3,null))[_0xcd77('0x43')](respondWithResult(_0x5cd2f3,null))['catch'](handleError(_0x5cd2f3,null));};exports[_0xcd77('0x4c')]=function(_0x1e90b9,_0x3275a9){return db[_0xcd77('0x2e')][_0xcd77('0x4c')](_0x1e90b9[_0xcd77('0x4d')],{})[_0xcd77('0x43')](respondWithResult(_0x3275a9,0xc9))[_0xcd77('0x48')](handleError(_0x3275a9,null));};exports['update']=function(_0x5bef3f,_0x1c3677){if(_0x5bef3f[_0xcd77('0x4d')]['id']){delete _0x5bef3f[_0xcd77('0x4d')]['id'];}return db[_0xcd77('0x2e')][_0xcd77('0x4b')]({'where':{'id':_0x5bef3f['params']['id']}})[_0xcd77('0x43')](handleEntityNotFound(_0x1c3677,null))[_0xcd77('0x43')](saveUpdates(_0x5bef3f['body'],null))[_0xcd77('0x43')](respondWithResult(_0x1c3677,null))['catch'](handleError(_0x1c3677,null));};exports['destroy']=function(_0x316c86,_0x27a206){return db['DeskConfiguration']['find']({'where':{'id':_0x316c86['params']['id']}})[_0xcd77('0x43')](handleEntityNotFound(_0x27a206,null))[_0xcd77('0x43')](removeEntity(_0x27a206,null))[_0xcd77('0x48')](handleError(_0x27a206,null));};exports['getFields']=function(_0x2be4f1,_0x306506,_0xdeb373){var _0x2f2c6b={};var _0x437280={};var _0x262952;var _0x24a5f3;return db['DeskConfiguration'][_0xcd77('0x4e')]({'where':{'id':_0x2be4f1[_0xcd77('0x4a')]['id']}})[_0xcd77('0x43')](handleEntityNotFound(_0x306506,null))['then'](function(_0x2918e8){if(_0x2918e8){_0x262952=_0x2918e8;_0x437280['model']=_['keys'](db[_0xcd77('0x4f')]['rawAttributes']);_0x437280['query']=_['keys'](_0x2be4f1[_0xcd77('0x33')]);_0x437280[_0xcd77('0x3d')]=_[_0xcd77('0x35')](_0x437280[_0xcd77('0x32')],_0x437280[_0xcd77('0x33')]);_0x2f2c6b[_0xcd77('0x37')]=_[_0xcd77('0x35')](_0x437280['model'],qs[_0xcd77('0x36')](_0x2be4f1[_0xcd77('0x33')][_0xcd77('0x36')]));_0x2f2c6b['attributes']=_0x2f2c6b[_0xcd77('0x37')][_0xcd77('0x38')]?_0x2f2c6b[_0xcd77('0x37')]:_0x437280[_0xcd77('0x32')];_0x2f2c6b[_0xcd77('0x3a')]=qs[_0xcd77('0x3b')](_0x2be4f1[_0xcd77('0x33')][_0xcd77('0x3b')]);_0x2f2c6b[_0xcd77('0x3c')]=qs[_0xcd77('0x3d')](_[_0xcd77('0x3e')](_0x2be4f1[_0xcd77('0x33')],_0x437280[_0xcd77('0x3d')]));if(_0x2be4f1[_0xcd77('0x33')][_0xcd77('0x3f')]){_0x2f2c6b['where']=_[_0xcd77('0x40')](_0x2f2c6b[_0xcd77('0x3c')],{'$or':_[_0xcd77('0x2d')](_0x2f2c6b[_0xcd77('0x37')],function(_0x5dddff){var _0x3e4d24={};_0x3e4d24[_0x5dddff]={'$like':'%'+_0x2be4f1[_0xcd77('0x33')][_0xcd77('0x3f')]+'%'};return _0x3e4d24;})});}_0x2f2c6b=_[_0xcd77('0x40')]({},_0x2f2c6b,_0x2be4f1[_0xcd77('0x42')]);return _0x262952[_0xcd77('0x50')](_0x2f2c6b);}})['then'](function(_0x49bc71){if(_0x49bc71){_0x24a5f3=_0x49bc71[_0xcd77('0x38')];if(!_0x2be4f1[_0xcd77('0x33')][_0xcd77('0x51')](_0xcd77('0x39'))){_0x2f2c6b[_0xcd77('0x21')]=qs[_0xcd77('0x21')](_0x2be4f1[_0xcd77('0x33')][_0xcd77('0x21')]);_0x2f2c6b[_0xcd77('0x1e')]=qs[_0xcd77('0x1e')](_0x2be4f1[_0xcd77('0x33')][_0xcd77('0x1e')]);}return _0x262952[_0xcd77('0x50')](_0x2f2c6b);}})[_0xcd77('0x43')](function(_0x1dfafd){if(_0x1dfafd){return _0x1dfafd?{'count':_0x24a5f3,'rows':_0x1dfafd}:null;}})[_0xcd77('0x43')](respondWithResult(_0x306506,null))[_0xcd77('0x48')](handleError(_0x306506,null));};exports[_0xcd77('0x52')]=function(_0x48fd4b,_0x1cd2cc,_0x87401f){var _0x2aeef6={};var _0x45df83={};var _0x7b27e8;var _0x503a40;return db['DeskConfiguration'][_0xcd77('0x4e')]({'where':{'id':_0x48fd4b['params']['id']}})[_0xcd77('0x43')](handleEntityNotFound(_0x1cd2cc,null))[_0xcd77('0x43')](function(_0x125b6e){if(_0x125b6e){_0x7b27e8=_0x125b6e;_0x45df83[_0xcd77('0x32')]=_['keys'](db[_0xcd77('0x4f')][_0xcd77('0x2f')]);_0x45df83[_0xcd77('0x33')]=_['keys'](_0x48fd4b[_0xcd77('0x33')]);_0x45df83[_0xcd77('0x3d')]=_[_0xcd77('0x35')](_0x45df83[_0xcd77('0x32')],_0x45df83[_0xcd77('0x33')]);_0x2aeef6[_0xcd77('0x37')]=_[_0xcd77('0x35')](_0x45df83[_0xcd77('0x32')],qs[_0xcd77('0x36')](_0x48fd4b['query'][_0xcd77('0x36')]));_0x2aeef6[_0xcd77('0x37')]=_0x2aeef6[_0xcd77('0x37')][_0xcd77('0x38')]?_0x2aeef6[_0xcd77('0x37')]:_0x45df83[_0xcd77('0x32')];_0x2aeef6[_0xcd77('0x3a')]=qs[_0xcd77('0x3b')](_0x48fd4b[_0xcd77('0x33')][_0xcd77('0x3b')]);_0x2aeef6[_0xcd77('0x3c')]=qs['filters'](_[_0xcd77('0x3e')](_0x48fd4b[_0xcd77('0x33')],_0x45df83[_0xcd77('0x3d')]));if(_0x48fd4b['query'][_0xcd77('0x3f')]){_0x2aeef6['where']=_['merge'](_0x2aeef6[_0xcd77('0x3c')],{'$or':_[_0xcd77('0x2d')](_0x2aeef6[_0xcd77('0x37')],function(_0x404948){var _0x2ea55e={};_0x2ea55e[_0x404948]={'$like':'%'+_0x48fd4b['query'][_0xcd77('0x3f')]+'%'};return _0x2ea55e;})});}_0x2aeef6=_[_0xcd77('0x40')]({},_0x2aeef6,_0x48fd4b[_0xcd77('0x42')]);return _0x7b27e8[_0xcd77('0x52')](_0x2aeef6);}})[_0xcd77('0x43')](function(_0x1e9a1a){if(_0x1e9a1a){_0x503a40=_0x1e9a1a[_0xcd77('0x38')];if(!_0x48fd4b[_0xcd77('0x33')][_0xcd77('0x51')](_0xcd77('0x39'))){_0x2aeef6[_0xcd77('0x21')]=qs['limit'](_0x48fd4b['query']['limit']);_0x2aeef6[_0xcd77('0x1e')]=qs[_0xcd77('0x1e')](_0x48fd4b[_0xcd77('0x33')][_0xcd77('0x1e')]);}return _0x7b27e8[_0xcd77('0x52')](_0x2aeef6);}})[_0xcd77('0x43')](function(_0xb0ca75){if(_0xb0ca75){return _0xb0ca75?{'count':_0x503a40,'rows':_0xb0ca75}:null;}})[_0xcd77('0x43')](respondWithResult(_0x1cd2cc,null))[_0xcd77('0x48')](handleError(_0x1cd2cc,null));};exports[_0xcd77('0x53')]=function(_0x51b7bd,_0x493c95,_0x2d9fd6){var _0x570fc0={};var _0x59e15e={};var _0x558668;var _0x52e64b;return db[_0xcd77('0x2e')][_0xcd77('0x4e')]({'where':{'id':_0x51b7bd[_0xcd77('0x4a')]['id']}})[_0xcd77('0x43')](handleEntityNotFound(_0x493c95,null))[_0xcd77('0x43')](function(_0x562dd8){if(_0x562dd8){_0x558668=_0x562dd8;_0x59e15e[_0xcd77('0x32')]=_[_0xcd77('0x34')](db[_0xcd77('0x4f')][_0xcd77('0x2f')]);_0x59e15e['query']=_['keys'](_0x51b7bd[_0xcd77('0x33')]);_0x59e15e['filters']=_['intersection'](_0x59e15e['model'],_0x59e15e[_0xcd77('0x33')]);_0x570fc0[_0xcd77('0x37')]=_[_0xcd77('0x35')](_0x59e15e[_0xcd77('0x32')],qs[_0xcd77('0x36')](_0x51b7bd[_0xcd77('0x33')]['fields']));_0x570fc0[_0xcd77('0x37')]=_0x570fc0['attributes']['length']?_0x570fc0['attributes']:_0x59e15e[_0xcd77('0x32')];_0x570fc0[_0xcd77('0x3a')]=qs['sort'](_0x51b7bd['query'][_0xcd77('0x3b')]);_0x570fc0[_0xcd77('0x3c')]=qs[_0xcd77('0x3d')](_[_0xcd77('0x3e')](_0x51b7bd['query'],_0x59e15e[_0xcd77('0x3d')]));if(_0x51b7bd[_0xcd77('0x33')]['filter']){_0x570fc0[_0xcd77('0x3c')]=_[_0xcd77('0x40')](_0x570fc0[_0xcd77('0x3c')],{'$or':_[_0xcd77('0x2d')](_0x570fc0['attributes'],function(_0x301cee){var _0x2d1e91={};_0x2d1e91[_0x301cee]={'$like':'%'+_0x51b7bd['query'][_0xcd77('0x3f')]+'%'};return _0x2d1e91;})});}_0x570fc0=_[_0xcd77('0x40')]({},_0x570fc0,_0x51b7bd['options']);return _0x558668['getDescriptions'](_0x570fc0);}})[_0xcd77('0x43')](function(_0x146c98){if(_0x146c98){_0x52e64b=_0x146c98[_0xcd77('0x38')];if(!_0x51b7bd[_0xcd77('0x33')][_0xcd77('0x51')](_0xcd77('0x39'))){_0x570fc0[_0xcd77('0x21')]=qs[_0xcd77('0x21')](_0x51b7bd[_0xcd77('0x33')][_0xcd77('0x21')]);_0x570fc0[_0xcd77('0x1e')]=qs['offset'](_0x51b7bd[_0xcd77('0x33')][_0xcd77('0x1e')]);}return _0x558668[_0xcd77('0x53')](_0x570fc0);}})[_0xcd77('0x43')](function(_0x38e32e){if(_0x38e32e){return _0x38e32e?{'count':_0x52e64b,'rows':_0x38e32e}:null;}})[_0xcd77('0x43')](respondWithResult(_0x493c95,null))[_0xcd77('0x48')](handleError(_0x493c95,null));};exports[_0xcd77('0x54')]=function(_0x4fa47e,_0x3a2502,_0x7a1705){var _0x12cf86={};var _0x4ef01e={};var _0x51aa18;var _0x292de7;return db[_0xcd77('0x2e')][_0xcd77('0x4e')]({'where':{'id':_0x4fa47e['params']['id']}})[_0xcd77('0x43')](handleEntityNotFound(_0x3a2502,null))[_0xcd77('0x43')](function(_0x1b4bf3){if(_0x1b4bf3){_0x51aa18=_0x1b4bf3;_0x4ef01e[_0xcd77('0x32')]=_[_0xcd77('0x34')](db[_0xcd77('0x55')][_0xcd77('0x2f')]);_0x4ef01e[_0xcd77('0x33')]=_[_0xcd77('0x34')](_0x4fa47e['query']);_0x4ef01e['filters']=_[_0xcd77('0x35')](_0x4ef01e['model'],_0x4ef01e[_0xcd77('0x33')]);_0x12cf86[_0xcd77('0x37')]=_['intersection'](_0x4ef01e[_0xcd77('0x32')],qs[_0xcd77('0x36')](_0x4fa47e[_0xcd77('0x33')][_0xcd77('0x36')]));_0x12cf86[_0xcd77('0x37')]=_0x12cf86[_0xcd77('0x37')][_0xcd77('0x38')]?_0x12cf86[_0xcd77('0x37')]:_0x4ef01e['model'];_0x12cf86[_0xcd77('0x3a')]=qs[_0xcd77('0x3b')](_0x4fa47e['query'][_0xcd77('0x3b')]);_0x12cf86[_0xcd77('0x3c')]=qs[_0xcd77('0x3d')](_[_0xcd77('0x3e')](_0x4fa47e[_0xcd77('0x33')],_0x4ef01e[_0xcd77('0x3d')]));if(_0x4fa47e[_0xcd77('0x33')][_0xcd77('0x3f')]){_0x12cf86[_0xcd77('0x3c')]=_[_0xcd77('0x40')](_0x12cf86[_0xcd77('0x3c')],{'$or':_['map'](_0x12cf86[_0xcd77('0x37')],function(_0xfe7434){var _0x4b62ac={};_0x4b62ac[_0xfe7434]={'$like':'%'+_0x4fa47e['query'][_0xcd77('0x3f')]+'%'};return _0x4b62ac;})});}_0x12cf86=_[_0xcd77('0x40')]({},_0x12cf86,_0x4fa47e['options']);return _0x51aa18[_0xcd77('0x54')](_0x12cf86);}})[_0xcd77('0x43')](function(_0x19660b){if(_0x19660b){_0x292de7=_0x19660b[_0xcd77('0x38')];if(!_0x4fa47e[_0xcd77('0x33')][_0xcd77('0x51')](_0xcd77('0x39'))){_0x12cf86[_0xcd77('0x21')]=qs['limit'](_0x4fa47e[_0xcd77('0x33')]['limit']);_0x12cf86[_0xcd77('0x1e')]=qs['offset'](_0x4fa47e['query'][_0xcd77('0x1e')]);}return _0x51aa18[_0xcd77('0x54')](_0x12cf86);}})[_0xcd77('0x43')](function(_0x5758ab){if(_0x5758ab){return _0x5758ab?{'count':_0x292de7,'rows':_0x5758ab}:null;}})[_0xcd77('0x43')](respondWithResult(_0x3a2502,null))[_0xcd77('0x48')](handleError(_0x3a2502,null));};exports['setTags']=function(_0x400493,_0x58ee68,_0x5cd3b6){if(_0x400493[_0xcd77('0x4d')]['id']){delete _0x400493['body']['id'];}return db['DeskConfiguration'][_0xcd77('0x4e')]({'where':{'id':_0x400493[_0xcd77('0x4a')]['id']}})[_0xcd77('0x43')](handleEntityNotFound(_0x58ee68,null))[_0xcd77('0x43')](function(_0x3be9fa){if(_0x3be9fa){return _0x3be9fa[_0xcd77('0x56')](_0x400493[_0xcd77('0x4d')][_0xcd77('0x57')]||[]);}return null;})[_0xcd77('0x43')](respondWithResult(_0x58ee68,null))[_0xcd77('0x48')](handleError(_0x58ee68,null));}; \ No newline at end of file +var _0x6c27=['fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','index','map','DeskConfiguration','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','VIRTUAL','name','options','includeAll','findAll','catch','show','rawAttributes','include','merge','find','create','body','params','getFields','findOne','length','getSubjects','DeskField','getDescriptions','getTags','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x49b153,_0x194075){var _0x127ef2=function(_0x2338e1){while(--_0x2338e1){_0x49b153['push'](_0x49b153['shift']());}};_0x127ef2(++_0x194075);}(_0x6c27,0xf2));var _0x76c2=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x6c27[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require(_0x76c2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x76c2('0x1'));var jsonpatch=require(_0x76c2('0x2'));var rp=require(_0x76c2('0x3'));var moment=require(_0x76c2('0x4'));var BPromise=require(_0x76c2('0x5'));var Mustache=require(_0x76c2('0x6'));var util=require('util');var path=require(_0x76c2('0x7'));var sox=require(_0x76c2('0x8'));var csv=require(_0x76c2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x76c2('0xa'));var _=require(_0x76c2('0xb'));var squel=require(_0x76c2('0xc'));var crypto=require('crypto');var jsforce=require(_0x76c2('0xd'));var deskjs=require(_0x76c2('0xe'));var toCsv=require(_0x76c2('0x9'));var querystring=require(_0x76c2('0xf'));var Papa=require(_0x76c2('0x10'));var Redis=require(_0x76c2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x76c2('0x12'));var as=require(_0x76c2('0x13'));var hardwareService=require(_0x76c2('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x76c2('0x15'));var config=require(_0x76c2('0x16'));var licenseUtil=require(_0x76c2('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xae67f6,_0x266f40){_0x266f40=_0x266f40||0xcc;return function(_0x3b6942){if(_0x3b6942){return _0xae67f6[_0x76c2('0x18')](_0x266f40);}return _0xae67f6[_0x76c2('0x19')](_0x266f40)[_0x76c2('0x1a')]();};}function respondWithResult(_0x500f43,_0x2c08e9){_0x2c08e9=_0x2c08e9||0xc8;return function(_0x559d2f){if(_0x559d2f){return _0x500f43[_0x76c2('0x19')](_0x2c08e9)[_0x76c2('0x1b')](_0x559d2f);}};}function respondWithFilteredResult(_0x58b091,_0xb7015a){return function(_0x146eb4){if(_0x146eb4){var _0x47b1eb=typeof _0xb7015a[_0x76c2('0x1c')]===_0x76c2('0x1d')&&typeof _0xb7015a[_0x76c2('0x1e')]===_0x76c2('0x1d');var _0x4ca5bf=_0x146eb4[_0x76c2('0x1f')];var _0x1e0e24=_0x47b1eb?0x0:_0xb7015a[_0x76c2('0x1c')];var _0x4b5d1e=_0x47b1eb?_0x146eb4['count']:_0xb7015a[_0x76c2('0x1c')]+_0xb7015a[_0x76c2('0x1e')];var _0x383765;if(_0x4b5d1e>=_0x4ca5bf){_0x4b5d1e=_0x4ca5bf;_0x383765=0xc8;}else{_0x383765=0xce;}_0x58b091['status'](_0x383765);return _0x58b091[_0x76c2('0x20')](_0x76c2('0x21'),_0x1e0e24+'-'+_0x4b5d1e+'/'+_0x4ca5bf)[_0x76c2('0x1b')](_0x146eb4);}return null;};}function patchUpdates(_0x34d5b8){return function(_0x52fc0c){try{jsonpatch[_0x76c2('0x22')](_0x52fc0c,_0x34d5b8,!![]);}catch(_0x497567){return BPromise[_0x76c2('0x23')](_0x497567);}return _0x52fc0c[_0x76c2('0x24')]();};}function saveUpdates(_0x54565e,_0x39c007){return function(_0x23f6bf){if(_0x23f6bf){return _0x23f6bf[_0x76c2('0x25')](_0x54565e)[_0x76c2('0x26')](function(_0x3950f4){return _0x3950f4;});}return null;};}function removeEntity(_0x3c5bf3,_0x253d7c){return function(_0x43f768){if(_0x43f768){return _0x43f768[_0x76c2('0x27')]()[_0x76c2('0x26')](function(){_0x3c5bf3[_0x76c2('0x19')](0xcc)[_0x76c2('0x1a')]();});}};}function handleEntityNotFound(_0x5a6268,_0x4f0f88){return function(_0x522fa9){if(!_0x522fa9){_0x5a6268[_0x76c2('0x18')](0x194);}return _0x522fa9;};}function handleError(_0x4d8c07,_0x2a3744){_0x2a3744=_0x2a3744||0x1f4;return function(_0x95e512){logger[_0x76c2('0x28')](_0x95e512[_0x76c2('0x29')]);if(_0x95e512['name']){delete _0x95e512['name'];}_0x4d8c07['status'](_0x2a3744)['send'](_0x95e512);};}exports[_0x76c2('0x2a')]=function(_0x3951b3,_0x4c8555){var _0x12172c={},_0x22f440={},_0x5d67d7={'count':0x0,'rows':[]};var _0xa1cb78=_[_0x76c2('0x2b')](db[_0x76c2('0x2c')]['rawAttributes'],function(_0x18b635){return{'name':_0x18b635[_0x76c2('0x2d')],'type':_0x18b635['type'][_0x76c2('0x2e')]};});_0x22f440[_0x76c2('0x2f')]=_[_0x76c2('0x2b')](_0xa1cb78,'name');_0x22f440[_0x76c2('0x30')]=_[_0x76c2('0x31')](_0x3951b3[_0x76c2('0x30')]);_0x22f440['filters']=_[_0x76c2('0x32')](_0x22f440[_0x76c2('0x2f')],_0x22f440[_0x76c2('0x30')]);_0x12172c[_0x76c2('0x33')]=_[_0x76c2('0x32')](_0x22f440[_0x76c2('0x2f')],qs[_0x76c2('0x34')](_0x3951b3[_0x76c2('0x30')]['fields']));_0x12172c[_0x76c2('0x33')]=_0x12172c[_0x76c2('0x33')]['length']?_0x12172c['attributes']:_0x22f440[_0x76c2('0x2f')];if(!_0x3951b3[_0x76c2('0x30')][_0x76c2('0x35')](_0x76c2('0x36'))){_0x12172c[_0x76c2('0x1e')]=qs[_0x76c2('0x1e')](_0x3951b3[_0x76c2('0x30')]['limit']);_0x12172c[_0x76c2('0x1c')]=qs[_0x76c2('0x1c')](_0x3951b3['query'][_0x76c2('0x1c')]);}_0x12172c[_0x76c2('0x37')]=qs[_0x76c2('0x38')](_0x3951b3[_0x76c2('0x30')]['sort']);_0x12172c[_0x76c2('0x39')]=qs['filters'](_[_0x76c2('0x3a')](_0x3951b3[_0x76c2('0x30')],_0x22f440[_0x76c2('0x3b')]),_0xa1cb78);if(_0x3951b3['query'][_0x76c2('0x3c')]){_0x12172c[_0x76c2('0x39')]=_['merge'](_0x12172c[_0x76c2('0x39')],{'$or':_[_0x76c2('0x2b')](_0xa1cb78,function(_0x525a3d){if(_0x525a3d['type']!==_0x76c2('0x3d')){var _0x26d8be={};_0x26d8be[_0x525a3d[_0x76c2('0x3e')]]={'$like':'%'+_0x3951b3[_0x76c2('0x30')][_0x76c2('0x3c')]+'%'};return _0x26d8be;}})});}_0x12172c=_['merge']({},_0x12172c,_0x3951b3[_0x76c2('0x3f')]);var _0x3e328c={'where':_0x12172c['where']};return db[_0x76c2('0x2c')][_0x76c2('0x1f')](_0x3e328c)[_0x76c2('0x26')](function(_0x3536d9){_0x5d67d7[_0x76c2('0x1f')]=_0x3536d9;if(_0x3951b3['query'][_0x76c2('0x40')]){_0x12172c['include']=[{'all':!![]}];}return db['DeskConfiguration'][_0x76c2('0x41')](_0x12172c);})[_0x76c2('0x26')](function(_0x4ba32c){_0x5d67d7['rows']=_0x4ba32c;return _0x5d67d7;})[_0x76c2('0x26')](respondWithFilteredResult(_0x4c8555,_0x12172c))[_0x76c2('0x42')](handleError(_0x4c8555,null));};exports[_0x76c2('0x43')]=function(_0x4653a3,_0x29fbbe){var _0x7b1e10={'raw':![],'where':{'id':_0x4653a3['params']['id']}},_0x5d27ea={};_0x5d27ea['model']=_[_0x76c2('0x31')](db[_0x76c2('0x2c')][_0x76c2('0x44')]);_0x5d27ea[_0x76c2('0x30')]=_[_0x76c2('0x31')](_0x4653a3[_0x76c2('0x30')]);_0x5d27ea[_0x76c2('0x3b')]=_['intersection'](_0x5d27ea[_0x76c2('0x2f')],_0x5d27ea[_0x76c2('0x30')]);_0x7b1e10['attributes']=_[_0x76c2('0x32')](_0x5d27ea['model'],qs[_0x76c2('0x34')](_0x4653a3[_0x76c2('0x30')]['fields']));_0x7b1e10[_0x76c2('0x33')]=_0x7b1e10[_0x76c2('0x33')]['length']?_0x7b1e10['attributes']:_0x5d27ea[_0x76c2('0x2f')];if(_0x4653a3['query']['includeAll']){_0x7b1e10[_0x76c2('0x45')]=[{'all':!![]}];}_0x7b1e10=_[_0x76c2('0x46')]({},_0x7b1e10,_0x4653a3['options']);return db[_0x76c2('0x2c')][_0x76c2('0x47')](_0x7b1e10)[_0x76c2('0x26')](handleEntityNotFound(_0x29fbbe,null))[_0x76c2('0x26')](respondWithResult(_0x29fbbe,null))[_0x76c2('0x42')](handleError(_0x29fbbe,null));};exports[_0x76c2('0x48')]=function(_0x41901e,_0x59575f){return db[_0x76c2('0x2c')][_0x76c2('0x48')](_0x41901e[_0x76c2('0x49')],{})[_0x76c2('0x26')](respondWithResult(_0x59575f,0xc9))[_0x76c2('0x42')](handleError(_0x59575f,null));};exports[_0x76c2('0x25')]=function(_0x37da85,_0xa7dca4){if(_0x37da85[_0x76c2('0x49')]['id']){delete _0x37da85[_0x76c2('0x49')]['id'];}return db['DeskConfiguration'][_0x76c2('0x47')]({'where':{'id':_0x37da85[_0x76c2('0x4a')]['id']}})['then'](handleEntityNotFound(_0xa7dca4,null))[_0x76c2('0x26')](saveUpdates(_0x37da85[_0x76c2('0x49')],null))[_0x76c2('0x26')](respondWithResult(_0xa7dca4,null))[_0x76c2('0x42')](handleError(_0xa7dca4,null));};exports[_0x76c2('0x27')]=function(_0x5de819,_0x3caf4d){return db[_0x76c2('0x2c')][_0x76c2('0x47')]({'where':{'id':_0x5de819[_0x76c2('0x4a')]['id']}})[_0x76c2('0x26')](handleEntityNotFound(_0x3caf4d,null))[_0x76c2('0x26')](removeEntity(_0x3caf4d,null))[_0x76c2('0x42')](handleError(_0x3caf4d,null));};exports[_0x76c2('0x4b')]=function(_0x19579e,_0x1700eb,_0x512a7b){var _0x46a5b7={};var _0x9c02a2={};var _0x59ac94;var _0x21d8cc;return db[_0x76c2('0x2c')][_0x76c2('0x4c')]({'where':{'id':_0x19579e[_0x76c2('0x4a')]['id']}})[_0x76c2('0x26')](handleEntityNotFound(_0x1700eb,null))[_0x76c2('0x26')](function(_0x3aeda9){if(_0x3aeda9){_0x59ac94=_0x3aeda9;_0x9c02a2[_0x76c2('0x2f')]=_[_0x76c2('0x31')](db['DeskField'][_0x76c2('0x44')]);_0x9c02a2['query']=_[_0x76c2('0x31')](_0x19579e[_0x76c2('0x30')]);_0x9c02a2[_0x76c2('0x3b')]=_['intersection'](_0x9c02a2[_0x76c2('0x2f')],_0x9c02a2[_0x76c2('0x30')]);_0x46a5b7['attributes']=_[_0x76c2('0x32')](_0x9c02a2[_0x76c2('0x2f')],qs[_0x76c2('0x34')](_0x19579e['query']['fields']));_0x46a5b7[_0x76c2('0x33')]=_0x46a5b7[_0x76c2('0x33')][_0x76c2('0x4d')]?_0x46a5b7[_0x76c2('0x33')]:_0x9c02a2[_0x76c2('0x2f')];_0x46a5b7[_0x76c2('0x37')]=qs['sort'](_0x19579e[_0x76c2('0x30')]['sort']);_0x46a5b7[_0x76c2('0x39')]=qs[_0x76c2('0x3b')](_[_0x76c2('0x3a')](_0x19579e['query'],_0x9c02a2['filters']));if(_0x19579e[_0x76c2('0x30')][_0x76c2('0x3c')]){_0x46a5b7[_0x76c2('0x39')]=_['merge'](_0x46a5b7['where'],{'$or':_['map'](_0x46a5b7[_0x76c2('0x33')],function(_0x14d726){var _0x45c314={};_0x45c314[_0x14d726]={'$like':'%'+_0x19579e[_0x76c2('0x30')]['filter']+'%'};return _0x45c314;})});}_0x46a5b7=_[_0x76c2('0x46')]({},_0x46a5b7,_0x19579e[_0x76c2('0x3f')]);return _0x59ac94['getFields'](_0x46a5b7);}})[_0x76c2('0x26')](function(_0xb3bcef){if(_0xb3bcef){_0x21d8cc=_0xb3bcef[_0x76c2('0x4d')];if(!_0x19579e[_0x76c2('0x30')]['hasOwnProperty'](_0x76c2('0x36'))){_0x46a5b7[_0x76c2('0x1e')]=qs['limit'](_0x19579e[_0x76c2('0x30')][_0x76c2('0x1e')]);_0x46a5b7[_0x76c2('0x1c')]=qs[_0x76c2('0x1c')](_0x19579e[_0x76c2('0x30')][_0x76c2('0x1c')]);}return _0x59ac94[_0x76c2('0x4b')](_0x46a5b7);}})[_0x76c2('0x26')](function(_0x1c7d1d){if(_0x1c7d1d){return _0x1c7d1d?{'count':_0x21d8cc,'rows':_0x1c7d1d}:null;}})[_0x76c2('0x26')](respondWithResult(_0x1700eb,null))[_0x76c2('0x42')](handleError(_0x1700eb,null));};exports[_0x76c2('0x4e')]=function(_0x1ea947,_0x3d0a72,_0x556737){var _0x1fe7f={};var _0x1a1b94={};var _0x17639c;var _0x233f19;return db[_0x76c2('0x2c')][_0x76c2('0x4c')]({'where':{'id':_0x1ea947[_0x76c2('0x4a')]['id']}})[_0x76c2('0x26')](handleEntityNotFound(_0x3d0a72,null))[_0x76c2('0x26')](function(_0xd84046){if(_0xd84046){_0x17639c=_0xd84046;_0x1a1b94[_0x76c2('0x2f')]=_[_0x76c2('0x31')](db[_0x76c2('0x4f')][_0x76c2('0x44')]);_0x1a1b94[_0x76c2('0x30')]=_[_0x76c2('0x31')](_0x1ea947[_0x76c2('0x30')]);_0x1a1b94[_0x76c2('0x3b')]=_[_0x76c2('0x32')](_0x1a1b94[_0x76c2('0x2f')],_0x1a1b94[_0x76c2('0x30')]);_0x1fe7f[_0x76c2('0x33')]=_[_0x76c2('0x32')](_0x1a1b94[_0x76c2('0x2f')],qs[_0x76c2('0x34')](_0x1ea947[_0x76c2('0x30')][_0x76c2('0x34')]));_0x1fe7f['attributes']=_0x1fe7f[_0x76c2('0x33')][_0x76c2('0x4d')]?_0x1fe7f[_0x76c2('0x33')]:_0x1a1b94[_0x76c2('0x2f')];_0x1fe7f[_0x76c2('0x37')]=qs['sort'](_0x1ea947[_0x76c2('0x30')][_0x76c2('0x38')]);_0x1fe7f[_0x76c2('0x39')]=qs[_0x76c2('0x3b')](_[_0x76c2('0x3a')](_0x1ea947[_0x76c2('0x30')],_0x1a1b94[_0x76c2('0x3b')]));if(_0x1ea947['query']['filter']){_0x1fe7f[_0x76c2('0x39')]=_['merge'](_0x1fe7f[_0x76c2('0x39')],{'$or':_[_0x76c2('0x2b')](_0x1fe7f[_0x76c2('0x33')],function(_0x65ed38){var _0x77c4ed={};_0x77c4ed[_0x65ed38]={'$like':'%'+_0x1ea947[_0x76c2('0x30')][_0x76c2('0x3c')]+'%'};return _0x77c4ed;})});}_0x1fe7f=_[_0x76c2('0x46')]({},_0x1fe7f,_0x1ea947[_0x76c2('0x3f')]);return _0x17639c['getSubjects'](_0x1fe7f);}})['then'](function(_0x494e7f){if(_0x494e7f){_0x233f19=_0x494e7f[_0x76c2('0x4d')];if(!_0x1ea947[_0x76c2('0x30')][_0x76c2('0x35')]('nolimit')){_0x1fe7f[_0x76c2('0x1e')]=qs[_0x76c2('0x1e')](_0x1ea947[_0x76c2('0x30')]['limit']);_0x1fe7f[_0x76c2('0x1c')]=qs[_0x76c2('0x1c')](_0x1ea947[_0x76c2('0x30')][_0x76c2('0x1c')]);}return _0x17639c[_0x76c2('0x4e')](_0x1fe7f);}})[_0x76c2('0x26')](function(_0x3288fe){if(_0x3288fe){return _0x3288fe?{'count':_0x233f19,'rows':_0x3288fe}:null;}})['then'](respondWithResult(_0x3d0a72,null))[_0x76c2('0x42')](handleError(_0x3d0a72,null));};exports[_0x76c2('0x50')]=function(_0x43a9d5,_0x79f8f0,_0xea945a){var _0x20efc0={};var _0x158ac8={};var _0x147cf3;var _0x73e429;return db['DeskConfiguration'][_0x76c2('0x4c')]({'where':{'id':_0x43a9d5['params']['id']}})[_0x76c2('0x26')](handleEntityNotFound(_0x79f8f0,null))['then'](function(_0x51c434){if(_0x51c434){_0x147cf3=_0x51c434;_0x158ac8['model']=_[_0x76c2('0x31')](db[_0x76c2('0x4f')][_0x76c2('0x44')]);_0x158ac8[_0x76c2('0x30')]=_[_0x76c2('0x31')](_0x43a9d5['query']);_0x158ac8[_0x76c2('0x3b')]=_['intersection'](_0x158ac8[_0x76c2('0x2f')],_0x158ac8[_0x76c2('0x30')]);_0x20efc0[_0x76c2('0x33')]=_[_0x76c2('0x32')](_0x158ac8['model'],qs[_0x76c2('0x34')](_0x43a9d5[_0x76c2('0x30')][_0x76c2('0x34')]));_0x20efc0[_0x76c2('0x33')]=_0x20efc0[_0x76c2('0x33')][_0x76c2('0x4d')]?_0x20efc0[_0x76c2('0x33')]:_0x158ac8[_0x76c2('0x2f')];_0x20efc0[_0x76c2('0x37')]=qs['sort'](_0x43a9d5[_0x76c2('0x30')][_0x76c2('0x38')]);_0x20efc0[_0x76c2('0x39')]=qs[_0x76c2('0x3b')](_[_0x76c2('0x3a')](_0x43a9d5['query'],_0x158ac8[_0x76c2('0x3b')]));if(_0x43a9d5['query'][_0x76c2('0x3c')]){_0x20efc0['where']=_[_0x76c2('0x46')](_0x20efc0[_0x76c2('0x39')],{'$or':_[_0x76c2('0x2b')](_0x20efc0[_0x76c2('0x33')],function(_0x560947){var _0x16e43c={};_0x16e43c[_0x560947]={'$like':'%'+_0x43a9d5[_0x76c2('0x30')][_0x76c2('0x3c')]+'%'};return _0x16e43c;})});}_0x20efc0=_['merge']({},_0x20efc0,_0x43a9d5['options']);return _0x147cf3[_0x76c2('0x50')](_0x20efc0);}})['then'](function(_0x11e0fb){if(_0x11e0fb){_0x73e429=_0x11e0fb[_0x76c2('0x4d')];if(!_0x43a9d5[_0x76c2('0x30')]['hasOwnProperty'](_0x76c2('0x36'))){_0x20efc0[_0x76c2('0x1e')]=qs[_0x76c2('0x1e')](_0x43a9d5['query']['limit']);_0x20efc0[_0x76c2('0x1c')]=qs[_0x76c2('0x1c')](_0x43a9d5['query']['offset']);}return _0x147cf3[_0x76c2('0x50')](_0x20efc0);}})[_0x76c2('0x26')](function(_0xddcdf9){if(_0xddcdf9){return _0xddcdf9?{'count':_0x73e429,'rows':_0xddcdf9}:null;}})['then'](respondWithResult(_0x79f8f0,null))[_0x76c2('0x42')](handleError(_0x79f8f0,null));};exports[_0x76c2('0x51')]=function(_0x1052f1,_0x5effbd,_0x20a21b){var _0x3a8f04={};var _0x2d6538={};var _0x17de27;var _0x1adf9d;return db[_0x76c2('0x2c')][_0x76c2('0x4c')]({'where':{'id':_0x1052f1[_0x76c2('0x4a')]['id']}})[_0x76c2('0x26')](handleEntityNotFound(_0x5effbd,null))['then'](function(_0x159f62){if(_0x159f62){_0x17de27=_0x159f62;_0x2d6538[_0x76c2('0x2f')]=_[_0x76c2('0x31')](db['Tag'][_0x76c2('0x44')]);_0x2d6538[_0x76c2('0x30')]=_['keys'](_0x1052f1[_0x76c2('0x30')]);_0x2d6538[_0x76c2('0x3b')]=_[_0x76c2('0x32')](_0x2d6538[_0x76c2('0x2f')],_0x2d6538[_0x76c2('0x30')]);_0x3a8f04[_0x76c2('0x33')]=_['intersection'](_0x2d6538[_0x76c2('0x2f')],qs['fields'](_0x1052f1[_0x76c2('0x30')][_0x76c2('0x34')]));_0x3a8f04['attributes']=_0x3a8f04['attributes']['length']?_0x3a8f04['attributes']:_0x2d6538[_0x76c2('0x2f')];_0x3a8f04[_0x76c2('0x37')]=qs[_0x76c2('0x38')](_0x1052f1[_0x76c2('0x30')][_0x76c2('0x38')]);_0x3a8f04['where']=qs[_0x76c2('0x3b')](_[_0x76c2('0x3a')](_0x1052f1[_0x76c2('0x30')],_0x2d6538[_0x76c2('0x3b')]));if(_0x1052f1[_0x76c2('0x30')]['filter']){_0x3a8f04[_0x76c2('0x39')]=_[_0x76c2('0x46')](_0x3a8f04[_0x76c2('0x39')],{'$or':_[_0x76c2('0x2b')](_0x3a8f04[_0x76c2('0x33')],function(_0x31d9e8){var _0x817b93={};_0x817b93[_0x31d9e8]={'$like':'%'+_0x1052f1[_0x76c2('0x30')][_0x76c2('0x3c')]+'%'};return _0x817b93;})});}_0x3a8f04=_['merge']({},_0x3a8f04,_0x1052f1[_0x76c2('0x3f')]);return _0x17de27['getTags'](_0x3a8f04);}})[_0x76c2('0x26')](function(_0x1a37f6){if(_0x1a37f6){_0x1adf9d=_0x1a37f6['length'];if(!_0x1052f1[_0x76c2('0x30')]['hasOwnProperty'](_0x76c2('0x36'))){_0x3a8f04['limit']=qs[_0x76c2('0x1e')](_0x1052f1[_0x76c2('0x30')][_0x76c2('0x1e')]);_0x3a8f04[_0x76c2('0x1c')]=qs[_0x76c2('0x1c')](_0x1052f1[_0x76c2('0x30')][_0x76c2('0x1c')]);}return _0x17de27[_0x76c2('0x51')](_0x3a8f04);}})['then'](function(_0x1d6a9c){if(_0x1d6a9c){return _0x1d6a9c?{'count':_0x1adf9d,'rows':_0x1d6a9c}:null;}})[_0x76c2('0x26')](respondWithResult(_0x5effbd,null))['catch'](handleError(_0x5effbd,null));};exports[_0x76c2('0x52')]=function(_0x50333f,_0x5159d6,_0x2d9278){if(_0x50333f[_0x76c2('0x49')]['id']){delete _0x50333f['body']['id'];}return db[_0x76c2('0x2c')][_0x76c2('0x4c')]({'where':{'id':_0x50333f[_0x76c2('0x4a')]['id']}})[_0x76c2('0x26')](handleEntityNotFound(_0x5159d6,null))['then'](function(_0x447282){if(_0x447282){return _0x447282[_0x76c2('0x52')](_0x50333f[_0x76c2('0x49')][_0x76c2('0x53')]||[]);}return null;})[_0x76c2('0x26')](respondWithResult(_0x5159d6,null))[_0x76c2('0x42')](handleError(_0x5159d6,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 7d6c06c..5b37799 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 _0x81b1=['moment','bluebird','request-promise','path','../../config/environment','./intDeskConfiguration.attributes','DeskConfiguration','int_desk_configurations','util','api'];(function(_0x236c89,_0xd76ba9){var _0x3b2a15=function(_0x89e4f9){while(--_0x89e4f9){_0x236c89['push'](_0x236c89['shift']());}};_0x3b2a15(++_0xd76ba9);}(_0x81b1,0x10c));var _0x181b=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x81b1[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require(_0x181b('0x0'));var logger=require('../../config/logger')(_0x181b('0x1'));var moment=require(_0x181b('0x2'));var BPromise=require(_0x181b('0x3'));var rp=require(_0x181b('0x4'));var fs=require('fs');var path=require(_0x181b('0x5'));var rimraf=require('rimraf');var config=require(_0x181b('0x6'));var attributes=require(_0x181b('0x7'));module['exports']=function(_0x2861b0,_0xd6f9cb){return _0x2861b0['define'](_0x181b('0x8'),attributes,{'tableName':_0x181b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa8e1=['moment','bluebird','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','DeskConfiguration','lodash','util','api'];(function(_0x3fbe4d,_0x416d1c){var _0x20b31b=function(_0xf01c94){while(--_0xf01c94){_0x3fbe4d['push'](_0x3fbe4d['shift']());}};_0x20b31b(++_0x416d1c);}(_0xa8e1,0xe4));var _0x1a8e=function(_0xf79bae,_0x263b2a){_0xf79bae=_0xf79bae-0x0;var _0x5d2cb7=_0xa8e1[_0xf79bae];return _0x5d2cb7;};'use strict';var _=require(_0x1a8e('0x0'));var util=require(_0x1a8e('0x1'));var logger=require('../../config/logger')(_0x1a8e('0x2'));var moment=require(_0x1a8e('0x3'));var BPromise=require(_0x1a8e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a8e('0x5'));var rimraf=require(_0x1a8e('0x6'));var config=require(_0x1a8e('0x7'));var attributes=require(_0x1a8e('0x8'));module[_0x1a8e('0x9')]=function(_0x1c231a,_0x3450b4){return _0x1c231a['define'](_0x1a8e('0xa'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 680bc76..9f448f1 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 _0xd386=['DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x11859e,_0x3ed5bd){var _0x153628=function(_0x2e2a43){while(--_0x2e2a43){_0x11859e['push'](_0x11859e['shift']());}};_0x153628(++_0x3ed5bd);}(_0xd386,0x10c));var _0x6d38=function(_0x411289,_0x36dbc8){_0x411289=_0x411289-0x0;var _0x5e72ec=_0xd386[_0x411289];return _0x5e72ec;};'use strict';var _=require(_0x6d38('0x0'));var util=require(_0x6d38('0x1'));var moment=require(_0x6d38('0x2'));var BPromise=require('bluebird');var rs=require(_0x6d38('0x3'));var fs=require('fs');var Redis=require(_0x6d38('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d38('0x5'));var logger=require(_0x6d38('0x6'))(_0x6d38('0x7'));var config=require(_0x6d38('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6d38('0x9')][_0x6d38('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b2038,_0x83823e,_0x2b742c){return new BPromise(function(_0x44ef4e,_0x49d71a){return client[_0x6d38('0xb')](_0x1b2038,_0x2b742c)['then'](function(_0x274898){logger['info'](_0x6d38('0xc'),_0x83823e,_0x6d38('0xd'));logger[_0x6d38('0xe')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x83823e,_0x6d38('0xd'),JSON[_0x6d38('0xf')](_0x274898));if(_0x274898[_0x6d38('0x10')]){if(_0x274898['error']['code']===0x1f4){logger['error'](_0x6d38('0xc'),_0x83823e,_0x274898[_0x6d38('0x10')][_0x6d38('0x11')]);return _0x49d71a(_0x274898[_0x6d38('0x10')][_0x6d38('0x11')]);}logger['error'](_0x6d38('0xc'),_0x83823e,_0x274898[_0x6d38('0x10')][_0x6d38('0x11')]);return _0x44ef4e(_0x274898[_0x6d38('0x10')][_0x6d38('0x11')]);}else{logger[_0x6d38('0x12')](_0x6d38('0xc'),_0x83823e,'request\x20sent');_0x44ef4e(_0x274898['result']['message']);}})[_0x6d38('0x13')](function(_0x46e7d7){logger[_0x6d38('0x10')](_0x6d38('0xc'),_0x83823e,_0x46e7d7);_0x49d71a(_0x46e7d7);});});} \ No newline at end of file +var _0xd159=['rpc','../../config/environment','client','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x2d2ca2,_0x51873f){var _0x48489d=function(_0x1a2cf7){while(--_0x1a2cf7){_0x2d2ca2['push'](_0x2d2ca2['shift']());}};_0x48489d(++_0x51873f);}(_0xd159,0x19d));var _0x9d15=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xd159[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0x9d15('0x0'));var util=require(_0x9d15('0x1'));var moment=require(_0x9d15('0x2'));var BPromise=require(_0x9d15('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d15('0x4'));var db=require(_0x9d15('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9d15('0x6'))(_0x9d15('0x7'));var config=require(_0x9d15('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9d15('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x414cba,_0x849cd1,_0x23a702){return new BPromise(function(_0x5b1a6e,_0xcaa861){return client[_0x9d15('0xa')](_0x414cba,_0x23a702)[_0x9d15('0xb')](function(_0x2b51f7){logger[_0x9d15('0xc')](_0x9d15('0xd'),_0x849cd1,_0x9d15('0xe'));logger[_0x9d15('0xf')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x849cd1,_0x9d15('0xe'),JSON['stringify'](_0x2b51f7));if(_0x2b51f7[_0x9d15('0x10')]){if(_0x2b51f7[_0x9d15('0x10')][_0x9d15('0x11')]===0x1f4){logger[_0x9d15('0x10')](_0x9d15('0xd'),_0x849cd1,_0x2b51f7[_0x9d15('0x10')][_0x9d15('0x12')]);return _0xcaa861(_0x2b51f7[_0x9d15('0x10')]['message']);}logger[_0x9d15('0x10')](_0x9d15('0xd'),_0x849cd1,_0x2b51f7['error'][_0x9d15('0x12')]);return _0x5b1a6e(_0x2b51f7['error'][_0x9d15('0x12')]);}else{logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x849cd1,'request\x20sent');_0x5b1a6e(_0x2b51f7['result'][_0x9d15('0x12')]);}})[_0x9d15('0x13')](function(_0x5e4ba5){logger[_0x9d15('0x10')](_0x9d15('0xd'),_0x849cd1,_0x5e4ba5);_0xcaa861(_0x5e4ba5);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 6e05fa8..59468c2 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 _0x30c7=['index','/:id','show','create','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','isAuthenticated'];(function(_0x2ebdcf,_0x3c6698){var _0x450377=function(_0x48ea54){while(--_0x48ea54){_0x2ebdcf['push'](_0x2ebdcf['shift']());}};_0x450377(++_0x3c6698);}(_0x30c7,0x111));var _0x730c=function(_0x4b8ef4,_0x2d8656){_0x4b8ef4=_0x4b8ef4-0x0;var _0x4c7a35=_0x30c7[_0x4b8ef4];return _0x4c7a35;};'use strict';var multer=require(_0x730c('0x0'));var util=require('util');var path=require(_0x730c('0x1'));var timeout=require(_0x730c('0x2'));var express=require(_0x730c('0x3'));var router=express['Router']();var fs_extra=require(_0x730c('0x4'));var auth=require(_0x730c('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDeskField.controller');router['get']('/',auth[_0x730c('0x6')](),controller[_0x730c('0x7')]);router['get'](_0x730c('0x8'),auth[_0x730c('0x6')](),controller[_0x730c('0x9')]);router['post']('/',auth[_0x730c('0x6')](),controller[_0x730c('0xa')]);router['put'](_0x730c('0x8'),auth[_0x730c('0x6')](),controller[_0x730c('0xb')]);router[_0x730c('0xc')](_0x730c('0x8'),auth[_0x730c('0x6')](),controller[_0x730c('0xd')]);module['exports']=router; \ No newline at end of file +var _0xf44e=['/:id','show','post','isAuthenticated','create','put','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','index'];(function(_0xa93eec,_0x1a135e){var _0x1d1cb6=function(_0x44c7ef){while(--_0x44c7ef){_0xa93eec['push'](_0xa93eec['shift']());}};_0x1d1cb6(++_0x1a135e);}(_0xf44e,0x1d5));var _0xef44=function(_0x49a53d,_0x57cd3f){_0x49a53d=_0x49a53d-0x0;var _0x2e231e=_0xf44e[_0x49a53d];return _0x2e231e;};'use strict';var multer=require(_0xef44('0x0'));var util=require('util');var path=require(_0xef44('0x1'));var timeout=require(_0xef44('0x2'));var express=require('express');var router=express[_0xef44('0x3')]();var fs_extra=require(_0xef44('0x4'));var auth=require(_0xef44('0x5'));var interaction=require(_0xef44('0x6'));var config=require(_0xef44('0x7'));var controller=require(_0xef44('0x8'));router[_0xef44('0x9')]('/',auth['isAuthenticated'](),controller[_0xef44('0xa')]);router[_0xef44('0x9')](_0xef44('0xb'),auth['isAuthenticated'](),controller[_0xef44('0xc')]);router[_0xef44('0xd')]('/',auth[_0xef44('0xe')](),controller[_0xef44('0xf')]);router[_0xef44('0x10')](_0xef44('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xef44('0x11')]('/:id',auth[_0xef44('0xe')](),controller[_0xef44('0x12')]);module[_0xef44('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 01fd337..04e809e 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 _0x4e85=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x43320e,_0x10c966){var _0x446f2f=function(_0x4161da){while(--_0x4161da){_0x43320e['push'](_0x43320e['shift']());}};_0x446f2f(++_0x10c966);}(_0x4e85,0x1a1));var _0x54e8=function(_0x45bf39,_0x26f0f){_0x45bf39=_0x45bf39-0x0;var _0x382930=_0x4e85[_0x45bf39];return _0x382930;};'use strict';var Sequelize=require(_0x54e8('0x0'));module[_0x54e8('0x1')]={'type':{'type':Sequelize[_0x54e8('0x2')](_0x54e8('0x3'),_0x54e8('0x4'),_0x54e8('0x5'),'keyValue',_0x54e8('0x6')),'defaultValue':_0x54e8('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x54e8('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x54e8('0x4'),_0x54e8('0x5'))},'keyContent':{'type':Sequelize[_0x54e8('0x7')]},'idField':{'type':Sequelize[_0x54e8('0x7')]},'nameField':{'type':Sequelize[_0x54e8('0x7')]},'customField':{'type':Sequelize[_0x54e8('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x54e8('0x7')]}}; \ No newline at end of file +var _0xa896=['STRING','ENUM','BOOLEAN','sequelize','string','variable','customVariable','keyValue','picklist'];(function(_0x33fe5b,_0x3bd553){var _0x49fd5f=function(_0x57ae95){while(--_0x57ae95){_0x33fe5b['push'](_0x33fe5b['shift']());}};_0x49fd5f(++_0x3bd553);}(_0xa896,0x1a1));var _0x6a89=function(_0x2e8859,_0xd6b892){_0x2e8859=_0x2e8859-0x0;var _0x4f34bb=_0xa896[_0x2e8859];return _0x4f34bb;};'use strict';var Sequelize=require(_0x6a89('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x6a89('0x1'),_0x6a89('0x2'),_0x6a89('0x3'),_0x6a89('0x4'),_0x6a89('0x5')),'defaultValue':_0x6a89('0x1')},'content':{'type':Sequelize[_0x6a89('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6a89('0x7')](_0x6a89('0x1'),_0x6a89('0x2'),_0x6a89('0x3'))},'keyContent':{'type':Sequelize[_0x6a89('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6a89('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6a89('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 22465c5..780dca1 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 _0x14c5=['sort','where','merge','type','VIRTUAL','options','rows','show','params','keys','includeAll','include','find','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','DeskField','rawAttributes','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','order'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x14c5,0x1de));var _0x514c=function(_0x2284f9,_0x32a3f1){_0x2284f9=_0x2284f9-0x0;var _0x178b6b=_0x14c5[_0x2284f9];return _0x178b6b;};'use strict';var emlformat=require(_0x514c('0x0'));var rimraf=require(_0x514c('0x1'));var zipdir=require(_0x514c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x514c('0x3'));var moment=require(_0x514c('0x4'));var BPromise=require(_0x514c('0x5'));var Mustache=require(_0x514c('0x6'));var util=require(_0x514c('0x7'));var path=require(_0x514c('0x8'));var sox=require(_0x514c('0x9'));var csv=require(_0x514c('0xa'));var ejs=require(_0x514c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x514c('0xc'));var squel=require(_0x514c('0xd'));var crypto=require(_0x514c('0xe'));var jsforce=require(_0x514c('0xf'));var deskjs=require(_0x514c('0x10'));var toCsv=require(_0x514c('0xa'));var querystring=require(_0x514c('0x11'));var Papa=require(_0x514c('0x12'));var Redis=require('ioredis');var authService=require(_0x514c('0x13'));var qs=require(_0x514c('0x14'));var as=require(_0x514c('0x15'));var hardwareService=require(_0x514c('0x16'));var logger=require(_0x514c('0x17'))(_0x514c('0x18'));var utils=require(_0x514c('0x19'));var config=require(_0x514c('0x1a'));var licenseUtil=require(_0x514c('0x1b'));var db=require(_0x514c('0x1c'))['db'];function respondWithStatusCode(_0x5ee1b6,_0x168a84){_0x168a84=_0x168a84||0xcc;return function(_0x4c9af9){if(_0x4c9af9){return _0x5ee1b6[_0x514c('0x1d')](_0x168a84);}return _0x5ee1b6[_0x514c('0x1e')](_0x168a84)[_0x514c('0x1f')]();};}function respondWithResult(_0x5d7a19,_0x3ae9e2){_0x3ae9e2=_0x3ae9e2||0xc8;return function(_0x410998){if(_0x410998){return _0x5d7a19[_0x514c('0x1e')](_0x3ae9e2)[_0x514c('0x20')](_0x410998);}};}function respondWithFilteredResult(_0x48f095,_0x306b5b){return function(_0x28d9ff){if(_0x28d9ff){var _0xbead77=typeof _0x306b5b[_0x514c('0x21')]===_0x514c('0x22')&&typeof _0x306b5b[_0x514c('0x23')]===_0x514c('0x22');var _0x5ee383=_0x28d9ff[_0x514c('0x24')];var _0x23f6b7=_0xbead77?0x0:_0x306b5b[_0x514c('0x21')];var _0x4fc2ac=_0xbead77?_0x28d9ff[_0x514c('0x24')]:_0x306b5b[_0x514c('0x21')]+_0x306b5b['limit'];var _0x52ba4f;if(_0x4fc2ac>=_0x5ee383){_0x4fc2ac=_0x5ee383;_0x52ba4f=0xc8;}else{_0x52ba4f=0xce;}_0x48f095[_0x514c('0x1e')](_0x52ba4f);return _0x48f095[_0x514c('0x25')](_0x514c('0x26'),_0x23f6b7+'-'+_0x4fc2ac+'/'+_0x5ee383)[_0x514c('0x20')](_0x28d9ff);}return null;};}function patchUpdates(_0x1d7c8d){return function(_0xf9690c){try{jsonpatch[_0x514c('0x27')](_0xf9690c,_0x1d7c8d,!![]);}catch(_0x554cd0){return BPromise[_0x514c('0x28')](_0x554cd0);}return _0xf9690c['save']();};}function saveUpdates(_0x501772,_0x2900f7){return function(_0x4c25bd){if(_0x4c25bd){return _0x4c25bd[_0x514c('0x29')](_0x501772)[_0x514c('0x2a')](function(_0x2f3863){return _0x2f3863;});}return null;};}function removeEntity(_0x1be1fe,_0x39f5d4){return function(_0x23ee03){if(_0x23ee03){return _0x23ee03['destroy']()[_0x514c('0x2a')](function(){_0x1be1fe['status'](0xcc)[_0x514c('0x1f')]();});}};}function handleEntityNotFound(_0xa83e7c,_0x465865){return function(_0x25c5f5){if(!_0x25c5f5){_0xa83e7c[_0x514c('0x1d')](0x194);}return _0x25c5f5;};}function handleError(_0x34d4f4,_0x33aeb8){_0x33aeb8=_0x33aeb8||0x1f4;return function(_0x49d6b4){logger[_0x514c('0x2b')](_0x49d6b4[_0x514c('0x2c')]);if(_0x49d6b4['name']){delete _0x49d6b4[_0x514c('0x2d')];}_0x34d4f4[_0x514c('0x1e')](_0x33aeb8)[_0x514c('0x2e')](_0x49d6b4);};}exports[_0x514c('0x2f')]=function(_0x4b1801,_0x35fcec){var _0x419abb={},_0x2e2bec={},_0x10b427={'count':0x0,'rows':[]};var _0x27954d=_['map'](db[_0x514c('0x30')][_0x514c('0x31')],function(_0x19bc78){return{'name':_0x19bc78['fieldName'],'type':_0x19bc78['type'][_0x514c('0x32')]};});_0x2e2bec[_0x514c('0x33')]=_[_0x514c('0x34')](_0x27954d,_0x514c('0x2d'));_0x2e2bec[_0x514c('0x35')]=_['keys'](_0x4b1801[_0x514c('0x35')]);_0x2e2bec[_0x514c('0x36')]=_['intersection'](_0x2e2bec['model'],_0x2e2bec['query']);_0x419abb[_0x514c('0x37')]=_[_0x514c('0x38')](_0x2e2bec[_0x514c('0x33')],qs[_0x514c('0x39')](_0x4b1801[_0x514c('0x35')][_0x514c('0x39')]));_0x419abb['attributes']=_0x419abb[_0x514c('0x37')][_0x514c('0x3a')]?_0x419abb[_0x514c('0x37')]:_0x2e2bec[_0x514c('0x33')];if(!_0x4b1801[_0x514c('0x35')][_0x514c('0x3b')]('nolimit')){_0x419abb[_0x514c('0x23')]=qs[_0x514c('0x23')](_0x4b1801['query'][_0x514c('0x23')]);_0x419abb['offset']=qs[_0x514c('0x21')](_0x4b1801[_0x514c('0x35')][_0x514c('0x21')]);}_0x419abb[_0x514c('0x3c')]=qs[_0x514c('0x3d')](_0x4b1801[_0x514c('0x35')][_0x514c('0x3d')]);_0x419abb[_0x514c('0x3e')]=qs['filters'](_['pick'](_0x4b1801[_0x514c('0x35')],_0x2e2bec[_0x514c('0x36')]),_0x27954d);if(_0x4b1801[_0x514c('0x35')]['filter']){_0x419abb['where']=_[_0x514c('0x3f')](_0x419abb[_0x514c('0x3e')],{'$or':_['map'](_0x27954d,function(_0x43fa78){if(_0x43fa78[_0x514c('0x40')]!==_0x514c('0x41')){var _0x3272bc={};_0x3272bc[_0x43fa78[_0x514c('0x2d')]]={'$like':'%'+_0x4b1801['query']['filter']+'%'};return _0x3272bc;}})});}_0x419abb=_['merge']({},_0x419abb,_0x4b1801[_0x514c('0x42')]);var _0x5a2664={'where':_0x419abb[_0x514c('0x3e')]};return db[_0x514c('0x30')][_0x514c('0x24')](_0x5a2664)[_0x514c('0x2a')](function(_0x5114cd){_0x10b427[_0x514c('0x24')]=_0x5114cd;if(_0x4b1801[_0x514c('0x35')]['includeAll']){_0x419abb['include']=[{'all':!![]}];}return db[_0x514c('0x30')]['findAll'](_0x419abb);})[_0x514c('0x2a')](function(_0x29d2e6){_0x10b427[_0x514c('0x43')]=_0x29d2e6;return _0x10b427;})[_0x514c('0x2a')](respondWithFilteredResult(_0x35fcec,_0x419abb))['catch'](handleError(_0x35fcec,null));};exports[_0x514c('0x44')]=function(_0x28394a,_0x3a11a2){var _0x3effdf={'raw':!![],'where':{'id':_0x28394a[_0x514c('0x45')]['id']}},_0x25c1f1={};_0x25c1f1['model']=_[_0x514c('0x46')](db[_0x514c('0x30')][_0x514c('0x31')]);_0x25c1f1[_0x514c('0x35')]=_[_0x514c('0x46')](_0x28394a[_0x514c('0x35')]);_0x25c1f1['filters']=_[_0x514c('0x38')](_0x25c1f1[_0x514c('0x33')],_0x25c1f1['query']);_0x3effdf[_0x514c('0x37')]=_['intersection'](_0x25c1f1['model'],qs['fields'](_0x28394a[_0x514c('0x35')]['fields']));_0x3effdf['attributes']=_0x3effdf[_0x514c('0x37')][_0x514c('0x3a')]?_0x3effdf[_0x514c('0x37')]:_0x25c1f1[_0x514c('0x33')];if(_0x28394a[_0x514c('0x35')][_0x514c('0x47')]){_0x3effdf[_0x514c('0x48')]=[{'all':!![]}];}_0x3effdf=_['merge']({},_0x3effdf,_0x28394a[_0x514c('0x42')]);return db[_0x514c('0x30')][_0x514c('0x49')](_0x3effdf)[_0x514c('0x2a')](handleEntityNotFound(_0x3a11a2,null))['then'](respondWithResult(_0x3a11a2,null))[_0x514c('0x4a')](handleError(_0x3a11a2,null));};exports[_0x514c('0x4b')]=function(_0x137dc6,_0x5c8518){return db[_0x514c('0x30')]['create'](_0x137dc6['body'],{})['then'](respondWithResult(_0x5c8518,0xc9))[_0x514c('0x4a')](handleError(_0x5c8518,null));};exports[_0x514c('0x29')]=function(_0x14ae42,_0x3dd9b1){if(_0x14ae42[_0x514c('0x4c')]['id']){delete _0x14ae42[_0x514c('0x4c')]['id'];}return db[_0x514c('0x30')][_0x514c('0x49')]({'where':{'id':_0x14ae42[_0x514c('0x45')]['id']}})[_0x514c('0x2a')](handleEntityNotFound(_0x3dd9b1,null))['then'](saveUpdates(_0x14ae42[_0x514c('0x4c')],null))[_0x514c('0x2a')](respondWithResult(_0x3dd9b1,null))['catch'](handleError(_0x3dd9b1,null));};exports['destroy']=function(_0x2cfc55,_0x22e92f){return db[_0x514c('0x30')][_0x514c('0x49')]({'where':{'id':_0x2cfc55[_0x514c('0x45')]['id']}})[_0x514c('0x2a')](handleEntityNotFound(_0x22e92f,null))[_0x514c('0x2a')](removeEntity(_0x22e92f,null))[_0x514c('0x4a')](handleError(_0x22e92f,null));}; \ No newline at end of file +var _0x01d9=['map','DeskField','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','catch','show','params','includeAll','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','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','error','name','send','index'];(function(_0x547b78,_0x3fb16e){var _0x28f987=function(_0x59d284){while(--_0x59d284){_0x547b78['push'](_0x547b78['shift']());}};_0x28f987(++_0x3fb16e);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x901d('0x0'));var rimraf=require(_0x901d('0x1'));var zipdir=require(_0x901d('0x2'));var jsonpatch=require(_0x901d('0x3'));var rp=require('request-promise');var moment=require(_0x901d('0x4'));var BPromise=require(_0x901d('0x5'));var Mustache=require(_0x901d('0x6'));var util=require(_0x901d('0x7'));var path=require(_0x901d('0x8'));var sox=require(_0x901d('0x9'));var csv=require(_0x901d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x901d('0xb'));var _=require(_0x901d('0xc'));var squel=require(_0x901d('0xd'));var crypto=require(_0x901d('0xe'));var jsforce=require(_0x901d('0xf'));var deskjs=require(_0x901d('0x10'));var toCsv=require(_0x901d('0xa'));var querystring=require(_0x901d('0x11'));var Papa=require(_0x901d('0x12'));var Redis=require(_0x901d('0x13'));var authService=require(_0x901d('0x14'));var qs=require(_0x901d('0x15'));var as=require(_0x901d('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x901d('0x17'))('api');var utils=require(_0x901d('0x18'));var config=require(_0x901d('0x19'));var licenseUtil=require(_0x901d('0x1a'));var db=require(_0x901d('0x1b'))['db'];function respondWithStatusCode(_0x15ebaf,_0x5d2345){_0x5d2345=_0x5d2345||0xcc;return function(_0x1d8117){if(_0x1d8117){return _0x15ebaf[_0x901d('0x1c')](_0x5d2345);}return _0x15ebaf[_0x901d('0x1d')](_0x5d2345)[_0x901d('0x1e')]();};}function respondWithResult(_0xb8869a,_0x14d99b){_0x14d99b=_0x14d99b||0xc8;return function(_0x530a2b){if(_0x530a2b){return _0xb8869a[_0x901d('0x1d')](_0x14d99b)[_0x901d('0x1f')](_0x530a2b);}};}function respondWithFilteredResult(_0x11b0cc,_0x17d451){return function(_0x1aba97){if(_0x1aba97){var _0x7dd5f4=typeof _0x17d451[_0x901d('0x20')]===_0x901d('0x21')&&typeof _0x17d451[_0x901d('0x22')]===_0x901d('0x21');var _0x28caae=_0x1aba97[_0x901d('0x23')];var _0x285353=_0x7dd5f4?0x0:_0x17d451[_0x901d('0x20')];var _0x38f42b=_0x7dd5f4?_0x1aba97[_0x901d('0x23')]:_0x17d451[_0x901d('0x20')]+_0x17d451[_0x901d('0x22')];var _0x57d518;if(_0x38f42b>=_0x28caae){_0x38f42b=_0x28caae;_0x57d518=0xc8;}else{_0x57d518=0xce;}_0x11b0cc[_0x901d('0x1d')](_0x57d518);return _0x11b0cc[_0x901d('0x24')]('Content-Range',_0x285353+'-'+_0x38f42b+'/'+_0x28caae)['json'](_0x1aba97);}return null;};}function patchUpdates(_0x496a06){return function(_0x53f8ae){try{jsonpatch[_0x901d('0x25')](_0x53f8ae,_0x496a06,!![]);}catch(_0x44ea6f){return BPromise['reject'](_0x44ea6f);}return _0x53f8ae[_0x901d('0x26')]();};}function saveUpdates(_0x3ea3f6,_0x488e24){return function(_0x20778b){if(_0x20778b){return _0x20778b[_0x901d('0x27')](_0x3ea3f6)[_0x901d('0x28')](function(_0x3f80b9){return _0x3f80b9;});}return null;};}function removeEntity(_0x1e7d36,_0x1818d3){return function(_0x46e5c6){if(_0x46e5c6){return _0x46e5c6[_0x901d('0x29')]()['then'](function(){_0x1e7d36[_0x901d('0x1d')](0xcc)[_0x901d('0x1e')]();});}};}function handleEntityNotFound(_0xbc89a5,_0x1f0ee5){return function(_0x557809){if(!_0x557809){_0xbc89a5[_0x901d('0x1c')](0x194);}return _0x557809;};}function handleError(_0x23fd43,_0x27f4ca){_0x27f4ca=_0x27f4ca||0x1f4;return function(_0x3cbe43){logger[_0x901d('0x2a')](_0x3cbe43['stack']);if(_0x3cbe43[_0x901d('0x2b')]){delete _0x3cbe43[_0x901d('0x2b')];}_0x23fd43[_0x901d('0x1d')](_0x27f4ca)[_0x901d('0x2c')](_0x3cbe43);};}exports[_0x901d('0x2d')]=function(_0x3de9b9,_0x48e86e){var _0xae6dfe={},_0x533038={},_0x128830={'count':0x0,'rows':[]};var _0x389fd9=_[_0x901d('0x2e')](db[_0x901d('0x2f')][_0x901d('0x30')],function(_0x20df02){return{'name':_0x20df02[_0x901d('0x31')],'type':_0x20df02[_0x901d('0x32')][_0x901d('0x33')]};});_0x533038[_0x901d('0x34')]=_[_0x901d('0x2e')](_0x389fd9,_0x901d('0x2b'));_0x533038[_0x901d('0x35')]=_[_0x901d('0x36')](_0x3de9b9[_0x901d('0x35')]);_0x533038['filters']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],_0x533038[_0x901d('0x35')]);_0xae6dfe['attributes']=_[_0x901d('0x37')](_0x533038[_0x901d('0x34')],qs[_0x901d('0x38')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x38')]));_0xae6dfe[_0x901d('0x39')]=_0xae6dfe[_0x901d('0x39')][_0x901d('0x3a')]?_0xae6dfe[_0x901d('0x39')]:_0x533038[_0x901d('0x34')];if(!_0x3de9b9['query']['hasOwnProperty'](_0x901d('0x3b'))){_0xae6dfe['limit']=qs[_0x901d('0x22')](_0x3de9b9[_0x901d('0x35')]['limit']);_0xae6dfe[_0x901d('0x20')]=qs[_0x901d('0x20')](_0x3de9b9[_0x901d('0x35')]['offset']);}_0xae6dfe[_0x901d('0x3c')]=qs[_0x901d('0x3d')](_0x3de9b9[_0x901d('0x35')][_0x901d('0x3d')]);_0xae6dfe[_0x901d('0x3e')]=qs[_0x901d('0x3f')](_[_0x901d('0x40')](_0x3de9b9[_0x901d('0x35')],_0x533038[_0x901d('0x3f')]),_0x389fd9);if(_0x3de9b9[_0x901d('0x35')][_0x901d('0x41')]){_0xae6dfe[_0x901d('0x3e')]=_[_0x901d('0x42')](_0xae6dfe[_0x901d('0x3e')],{'$or':_[_0x901d('0x2e')](_0x389fd9,function(_0x1644d8){if(_0x1644d8['type']!==_0x901d('0x43')){var _0x423cab={};_0x423cab[_0x1644d8['name']]={'$like':'%'+_0x3de9b9['query'][_0x901d('0x41')]+'%'};return _0x423cab;}})});}_0xae6dfe=_['merge']({},_0xae6dfe,_0x3de9b9[_0x901d('0x44')]);var _0x3d0556={'where':_0xae6dfe[_0x901d('0x3e')]};return db[_0x901d('0x2f')][_0x901d('0x23')](_0x3d0556)[_0x901d('0x28')](function(_0x5df4cb){_0x128830['count']=_0x5df4cb;if(_0x3de9b9['query']['includeAll']){_0xae6dfe[_0x901d('0x45')]=[{'all':!![]}];}return db[_0x901d('0x2f')]['findAll'](_0xae6dfe);})[_0x901d('0x28')](function(_0x22fc44){_0x128830['rows']=_0x22fc44;return _0x128830;})[_0x901d('0x28')](respondWithFilteredResult(_0x48e86e,_0xae6dfe))[_0x901d('0x46')](handleError(_0x48e86e,null));};exports[_0x901d('0x47')]=function(_0x2c1895,_0x53663d){var _0x5aeb41={'raw':!![],'where':{'id':_0x2c1895[_0x901d('0x48')]['id']}},_0xa9c008={};_0xa9c008[_0x901d('0x34')]=_[_0x901d('0x36')](db[_0x901d('0x2f')][_0x901d('0x30')]);_0xa9c008[_0x901d('0x35')]=_[_0x901d('0x36')](_0x2c1895[_0x901d('0x35')]);_0xa9c008[_0x901d('0x3f')]=_[_0x901d('0x37')](_0xa9c008['model'],_0xa9c008[_0x901d('0x35')]);_0x5aeb41['attributes']=_[_0x901d('0x37')](_0xa9c008['model'],qs[_0x901d('0x38')](_0x2c1895['query'][_0x901d('0x38')]));_0x5aeb41[_0x901d('0x39')]=_0x5aeb41[_0x901d('0x39')][_0x901d('0x3a')]?_0x5aeb41[_0x901d('0x39')]:_0xa9c008[_0x901d('0x34')];if(_0x2c1895[_0x901d('0x35')][_0x901d('0x49')]){_0x5aeb41[_0x901d('0x45')]=[{'all':!![]}];}_0x5aeb41=_[_0x901d('0x42')]({},_0x5aeb41,_0x2c1895[_0x901d('0x44')]);return db['DeskField'][_0x901d('0x4a')](_0x5aeb41)[_0x901d('0x28')](handleEntityNotFound(_0x53663d,null))[_0x901d('0x28')](respondWithResult(_0x53663d,null))[_0x901d('0x46')](handleError(_0x53663d,null));};exports[_0x901d('0x4b')]=function(_0x24b6fa,_0x27459b){return db[_0x901d('0x2f')][_0x901d('0x4b')](_0x24b6fa[_0x901d('0x4c')],{})[_0x901d('0x28')](respondWithResult(_0x27459b,0xc9))[_0x901d('0x46')](handleError(_0x27459b,null));};exports[_0x901d('0x27')]=function(_0x23f2a9,_0x4888e8){if(_0x23f2a9['body']['id']){delete _0x23f2a9[_0x901d('0x4c')]['id'];}return db[_0x901d('0x2f')][_0x901d('0x4a')]({'where':{'id':_0x23f2a9[_0x901d('0x48')]['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x4888e8,null))['then'](saveUpdates(_0x23f2a9['body'],null))[_0x901d('0x28')](respondWithResult(_0x4888e8,null))[_0x901d('0x46')](handleError(_0x4888e8,null));};exports['destroy']=function(_0x23673d,_0x165207){return db['DeskField'][_0x901d('0x4a')]({'where':{'id':_0x23673d['params']['id']}})[_0x901d('0x28')](handleEntityNotFound(_0x165207,null))[_0x901d('0x28')](removeEntity(_0x165207,null))[_0x901d('0x46')](handleError(_0x165207,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index ff48035..da11d22 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 _0xa61e=['FieldId','lodash','api','bluebird','path','rimraf','./intDeskField.attributes','exports','define','int_desk_fields','desk_unique_index','idField'];(function(_0x2ed3a2,_0x5cc62a){var _0xf11bbc=function(_0x241d9d){while(--_0x241d9d){_0x2ed3a2['push'](_0x2ed3a2['shift']());}};_0xf11bbc(++_0x5cc62a);}(_0xa61e,0x79));var _0xea61=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa61e[_0x24237f];return _0x48298e;};'use strict';var _=require(_0xea61('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xea61('0x1'));var moment=require('moment');var BPromise=require(_0xea61('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea61('0x3'));var rimraf=require(_0xea61('0x4'));var config=require('../../config/environment');var attributes=require(_0xea61('0x5'));module[_0xea61('0x6')]=function(_0x2686cc,_0x6811a0){return _0x2686cc[_0xea61('0x7')]('DeskField',attributes,{'tableName':_0xea61('0x8'),'paranoid':![],'indexes':[{'name':_0xea61('0x9'),'fields':[_0xea61('0xa'),_0xea61('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x676a=['define','DeskField','FieldId','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes'];(function(_0x9fb085,_0x2251a3){var _0x400c75=function(_0x1455ed){while(--_0x1455ed){_0x9fb085['push'](_0x9fb085['shift']());}};_0x400c75(++_0x2251a3);}(_0x676a,0x1ef));var _0xa676=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x676a[_0x102e37];return _0x35a07c;};'use strict';var _=require(_0xa676('0x0'));var util=require(_0xa676('0x1'));var logger=require(_0xa676('0x2'))(_0xa676('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa676('0x4'));var fs=require('fs');var path=require(_0xa676('0x5'));var rimraf=require(_0xa676('0x6'));var config=require(_0xa676('0x7'));var attributes=require(_0xa676('0x8'));module['exports']=function(_0x2bf33c,_0x215f5f){return _0x2bf33c[_0xa676('0x9')](_0xa676('0xa'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':['idField',_0xa676('0xb')],'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 22ef106..7b83714 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 _0x0113=['../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x5a3e10,_0x95914d){var _0x51e1f8=function(_0x5d83bd){while(--_0x5d83bd){_0x5a3e10['push'](_0x5a3e10['shift']());}};_0x51e1f8(++_0x95914d);}(_0x0113,0x1b3));var _0x3011=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0113[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3011('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3011('0x1'));var rs=require(_0x3011('0x2'));var fs=require('fs');var Redis=require(_0x3011('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3011('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x3011('0x5'));var jayson=require(_0x3011('0x6'));var client=jayson[_0x3011('0x7')][_0x3011('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x392cda,_0x4f419b,_0x5bf697){return new BPromise(function(_0x570494,_0x5e2664){return client[_0x3011('0x9')](_0x392cda,_0x5bf697)[_0x3011('0xa')](function(_0x5cc8ca){logger[_0x3011('0xb')](_0x3011('0xc'),_0x4f419b,_0x3011('0xd'));logger[_0x3011('0xe')]('DeskField,\x20%s,\x20%s,\x20%s',_0x4f419b,'request\x20sent',JSON['stringify'](_0x5cc8ca));if(_0x5cc8ca['error']){if(_0x5cc8ca['error'][_0x3011('0xf')]===0x1f4){logger[_0x3011('0x10')](_0x3011('0xc'),_0x4f419b,_0x5cc8ca[_0x3011('0x10')][_0x3011('0x11')]);return _0x5e2664(_0x5cc8ca[_0x3011('0x10')][_0x3011('0x11')]);}logger[_0x3011('0x10')](_0x3011('0xc'),_0x4f419b,_0x5cc8ca[_0x3011('0x10')]['message']);return _0x570494(_0x5cc8ca['error'][_0x3011('0x11')]);}else{logger[_0x3011('0xb')]('DeskField,\x20%s,\x20%s',_0x4f419b,_0x3011('0xd'));_0x570494(_0x5cc8ca[_0x3011('0x12')][_0x3011('0x11')]);}})[_0x3011('0x13')](function(_0x4f607e){logger[_0x3011('0x10')](_0x3011('0xc'),_0x4f419b,_0x4f607e);_0x5e2664(_0x4f607e);});});} \ No newline at end of file +var _0xabca=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x1e1c0d,_0x3c0b66){var _0x40adc7=function(_0x43de95){while(--_0x43de95){_0x1e1c0d['push'](_0x1e1c0d['shift']());}};_0x40adc7(++_0x3c0b66);}(_0xabca,0x6f));var _0xaabc=function(_0x47df6a,_0x293395){_0x47df6a=_0x47df6a-0x0;var _0x2c9f47=_0xabca[_0x47df6a];return _0x2c9f47;};'use strict';var _=require(_0xaabc('0x0'));var util=require(_0xaabc('0x1'));var moment=require(_0xaabc('0x2'));var BPromise=require(_0xaabc('0x3'));var rs=require(_0xaabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaabc('0x5'))['db'];var utils=require(_0xaabc('0x6'));var logger=require(_0xaabc('0x7'))('rpc');var config=require(_0xaabc('0x8'));var jayson=require(_0xaabc('0x9'));var client=jayson[_0xaabc('0xa')][_0xaabc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19178f,_0x5015f4,_0x228ab9){return new BPromise(function(_0x56c71b,_0x12cda8){return client['request'](_0x19178f,_0x228ab9)[_0xaabc('0xc')](function(_0x2414a8){logger[_0xaabc('0xd')](_0xaabc('0xe'),_0x5015f4,'request\x20sent');logger[_0xaabc('0xf')](_0xaabc('0x10'),_0x5015f4,_0xaabc('0x11'),JSON[_0xaabc('0x12')](_0x2414a8));if(_0x2414a8[_0xaabc('0x13')]){if(_0x2414a8[_0xaabc('0x13')]['code']===0x1f4){logger[_0xaabc('0x13')](_0xaabc('0xe'),_0x5015f4,_0x2414a8[_0xaabc('0x13')][_0xaabc('0x14')]);return _0x12cda8(_0x2414a8[_0xaabc('0x13')][_0xaabc('0x14')]);}logger[_0xaabc('0x13')]('DeskField,\x20%s,\x20%s',_0x5015f4,_0x2414a8[_0xaabc('0x13')][_0xaabc('0x14')]);return _0x56c71b(_0x2414a8[_0xaabc('0x13')][_0xaabc('0x14')]);}else{logger[_0xaabc('0xd')](_0xaabc('0xe'),_0x5015f4,_0xaabc('0x11'));_0x56c71b(_0x2414a8['result']['message']);}})[_0xaabc('0x15')](function(_0x4afb20){logger[_0xaabc('0x13')](_0xaabc('0xe'),_0x5015f4,_0x4afb20);_0x12cda8(_0x4afb20);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index bd0d42b..cadf3ea 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 _0x7e46=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','getConfigurations','getFields','create','post','addConfiguration','put'];(function(_0x576512,_0x1e35af){var _0x5b1ec2=function(_0x1a38b2){while(--_0x1a38b2){_0x576512['push'](_0x576512['shift']());}};_0x5b1ec2(++_0x1e35af);}(_0x7e46,0x76));var _0x67e4=function(_0x2f078f,_0x3359ad){_0x2f078f=_0x2f078f-0x0;var _0xfb5d13=_0x7e46[_0x2f078f];return _0xfb5d13;};'use strict';var multer=require(_0x67e4('0x0'));var util=require(_0x67e4('0x1'));var path=require(_0x67e4('0x2'));var timeout=require(_0x67e4('0x3'));var express=require(_0x67e4('0x4'));var router=express[_0x67e4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x67e4('0x6'));var config=require(_0x67e4('0x7'));var controller=require(_0x67e4('0x8'));router[_0x67e4('0x9')]('/',auth[_0x67e4('0xa')](),controller[_0x67e4('0xb')]);router[_0x67e4('0x9')](_0x67e4('0xc'),auth['isAuthenticated'](),controller[_0x67e4('0xd')]);router[_0x67e4('0x9')]('/:id/configurations',auth[_0x67e4('0xa')](),controller[_0x67e4('0xe')]);router[_0x67e4('0x9')]('/:id/fields',auth[_0x67e4('0xa')](),controller[_0x67e4('0xf')]);router['post']('/',auth[_0x67e4('0xa')](),controller[_0x67e4('0x10')]);router[_0x67e4('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x67e4('0x12')]);router[_0x67e4('0x13')](_0x67e4('0xc'),auth[_0x67e4('0xa')](),controller['update']);router[_0x67e4('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x67e4('0x15')]);module[_0x67e4('0x16')]=router; \ No newline at end of file +var _0x63a8=['show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','/:id'];(function(_0x580647,_0x43d2c3){var _0x5f0792=function(_0x386cef){while(--_0x386cef){_0x580647['push'](_0x580647['shift']());}};_0x5f0792(++_0x43d2c3);}(_0x63a8,0x113));var _0x863a=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x63a8[_0x167cc1];return _0x10bc4b;};'use strict';var multer=require('multer');var util=require(_0x863a('0x0'));var path=require(_0x863a('0x1'));var timeout=require(_0x863a('0x2'));var express=require(_0x863a('0x3'));var router=express[_0x863a('0x4')]();var fs_extra=require(_0x863a('0x5'));var auth=require(_0x863a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x863a('0x7'));var controller=require('./intDynamics365Account.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x863a('0x8')]);router[_0x863a('0x9')](_0x863a('0xa'),auth['isAuthenticated'](),controller[_0x863a('0xb')]);router[_0x863a('0x9')](_0x863a('0xc'),auth[_0x863a('0xd')](),controller[_0x863a('0xe')]);router[_0x863a('0x9')](_0x863a('0xf'),auth['isAuthenticated'](),controller[_0x863a('0x10')]);router['post']('/',auth[_0x863a('0xd')](),controller[_0x863a('0x11')]);router['post'](_0x863a('0xc'),auth[_0x863a('0xd')](),controller['addConfiguration']);router[_0x863a('0x12')]('/:id',auth[_0x863a('0xd')](),controller[_0x863a('0x13')]);router['delete']('/:id',auth[_0x863a('0xd')](),controller[_0x863a('0x14')]);module[_0x863a('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index e517de0..5d7ed74 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 _0x7f3f=['sequelize','exports','STRING'];(function(_0xf4e841,_0x5c8499){var _0x27a2f3=function(_0xbe0b64){while(--_0xbe0b64){_0xf4e841['push'](_0xf4e841['shift']());}};_0x27a2f3(++_0x5c8499);}(_0x7f3f,0x1c8));var _0xf7f3=function(_0x454e6d,_0x1e1f38){_0x454e6d=_0x454e6d-0x0;var _0x4bc294=_0x7f3f[_0x454e6d];return _0x4bc294;};'use strict';var Sequelize=require(_0xf7f3('0x0'));module[_0xf7f3('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf7f3('0x2')]},'password':{'type':Sequelize[_0xf7f3('0x2')]},'remoteUri':{'type':Sequelize[_0xf7f3('0x2')]},'tenantId':{'type':Sequelize[_0xf7f3('0x2')]},'clientId':{'type':Sequelize[_0xf7f3('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xf7f3('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf7f3('0x2')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xbdb9=['sequelize','exports','STRING','BOOLEAN'];(function(_0x170353,_0x1e3129){var _0x715fcb=function(_0x52899b){while(--_0x52899b){_0x170353['push'](_0x170353['shift']());}};_0x715fcb(++_0x1e3129);}(_0xbdb9,0xac));var _0x9bdb=function(_0x2a683c,_0x5ef6bc){_0x2a683c=_0x2a683c-0x0;var _0x1c383d=_0xbdb9[_0x2a683c];return _0x1c383d;};'use strict';var Sequelize=require(_0x9bdb('0x0'));module[_0x9bdb('0x1')]={'name':{'type':Sequelize[_0x9bdb('0x2')]},'username':{'type':Sequelize[_0x9bdb('0x2')]},'password':{'type':Sequelize[_0x9bdb('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x9bdb('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x9bdb('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 631c261..8b03ec7 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 _0x1a5c=['contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slaname','socialprofileidname','statecode','statuscode','subjectidname','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','password','clientId','modernAuthentication','CloudProvider','data7','access_token','data5','remoteUri','POST','https://login.microsoftonline.com/','/oauth2/token','clientSecret','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','LogicalName','forEach','@odata.type','lastIndexOf','PicklistAttributeMetadata','all','isNil','push','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','Value','DisplayName','TrueOption','true','FalseOption','false',')/Attributes(',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','count','set','Content-Range','update','then','destroy','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','findOne','pick','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','Dynamics365Field','slice','substring','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','PhoneCall','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits'];(function(_0x4e11d5,_0x1ce514){var _0x5e4e4c=function(_0xbee63d){while(--_0xbee63d){_0x4e11d5['push'](_0x4e11d5['shift']());}};_0x5e4e4c(++_0x1ce514);}(_0x1a5c,0x12c));var _0xc1a5=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x1a5c[_0x9aada2];return _0x196dff;};'use strict';var rp=require(_0xc1a5('0x0'));var util=require(_0xc1a5('0x1'));var _=require(_0xc1a5('0x2'));var qs=require(_0xc1a5('0x3'));var logger=require(_0xc1a5('0x4'))(_0xc1a5('0x5'));var db=require(_0xc1a5('0x6'))['db'];var integrations=require(_0xc1a5('0x7'));function respondWithResult(_0x2b324b,_0x22243f){_0x22243f=_0x22243f||0xc8;return function(_0x49e60b){if(_0x49e60b){return _0x2b324b[_0xc1a5('0x8')](_0x22243f)[_0xc1a5('0x9')](_0x49e60b);}};}function respondWithFilteredResult(_0x411612,_0x510cf3){return function(_0x555a0){if(_0x555a0){var _0x1cf3d7=typeof _0x510cf3[_0xc1a5('0xa')]===_0xc1a5('0xb')&&typeof _0x510cf3['limit']===_0xc1a5('0xb');var _0x7167aa=_0x555a0['count'];var _0x176448=_0x1cf3d7?0x0:_0x510cf3['offset'];var _0x536121=_0x1cf3d7?_0x555a0[_0xc1a5('0xc')]:_0x510cf3[_0xc1a5('0xa')]+_0x510cf3['limit'];var _0x14ac4a;if(_0x536121>=_0x7167aa){_0x536121=_0x7167aa;_0x14ac4a=0xc8;}else{_0x14ac4a=0xce;}_0x411612[_0xc1a5('0x8')](_0x14ac4a);return _0x411612[_0xc1a5('0xd')](_0xc1a5('0xe'),_0x176448+'-'+_0x536121+'/'+_0x7167aa)[_0xc1a5('0x9')](_0x555a0);}return null;};}function saveUpdates(_0x52fe6d){return function(_0x428ccf){if(_0x428ccf){return _0x428ccf[_0xc1a5('0xf')](_0x52fe6d)[_0xc1a5('0x10')](function(_0x3a0b8e){return _0x3a0b8e;});}return null;};}function removeEntity(_0x1aec58){return function(_0x1dabb5){if(_0x1dabb5){return _0x1dabb5[_0xc1a5('0x11')]()[_0xc1a5('0x10')](function(){_0x1aec58[_0xc1a5('0x8')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b2590){return function(_0x1b2cfb){if(!_0x1b2cfb){_0x4b2590[_0xc1a5('0x12')](0x194);}return _0x1b2cfb;};}function handleError(_0x677442,_0x57d474){_0x57d474=_0x57d474||0x1f4;return function(_0x1f23c4){logger[_0xc1a5('0x13')](_0x1f23c4[_0xc1a5('0x14')]);if(_0x1f23c4['name']){delete _0x1f23c4[_0xc1a5('0x15')];}_0x677442['status'](_0x57d474)[_0xc1a5('0x16')](_0x1f23c4);};}exports[_0xc1a5('0x17')]=function(_0x367191,_0x5d73a7){var _0xcbdda5={},_0xbccfb9={},_0x307e5c={'count':0x0,'rows':[]};var _0x4591df=_[_0xc1a5('0x18')](db[_0xc1a5('0x19')][_0xc1a5('0x1a')],function(_0x267ee0){return{'name':_0x267ee0[_0xc1a5('0x1b')],'type':_0x267ee0[_0xc1a5('0x1c')]['key']};});_0xbccfb9[_0xc1a5('0x1d')]=_[_0xc1a5('0x18')](_0x4591df,'name');_0xbccfb9[_0xc1a5('0x1e')]=_[_0xc1a5('0x1f')](_0x367191[_0xc1a5('0x1e')]);_0xbccfb9[_0xc1a5('0x20')]=_[_0xc1a5('0x21')](_0xbccfb9[_0xc1a5('0x1d')],_0xbccfb9[_0xc1a5('0x1e')]);_0xcbdda5[_0xc1a5('0x22')]=_['intersection'](_0xbccfb9['model'],qs[_0xc1a5('0x23')](_0x367191[_0xc1a5('0x1e')][_0xc1a5('0x23')]));_0xcbdda5['attributes']=_0xcbdda5[_0xc1a5('0x22')]['length']?_0xcbdda5['attributes']:_0xbccfb9[_0xc1a5('0x1d')];if(!_0x367191[_0xc1a5('0x1e')][_0xc1a5('0x24')](_0xc1a5('0x25'))){_0xcbdda5['limit']=qs['limit'](_0x367191['query'][_0xc1a5('0x26')]);_0xcbdda5['offset']=qs[_0xc1a5('0xa')](_0x367191['query'][_0xc1a5('0xa')]);}_0xcbdda5[_0xc1a5('0x27')]=qs[_0xc1a5('0x28')](_0x367191[_0xc1a5('0x1e')]['sort']);_0xcbdda5['where']=qs[_0xc1a5('0x20')](_['pick'](_0x367191[_0xc1a5('0x1e')],_0xbccfb9[_0xc1a5('0x20')]),_0x4591df);if(_0x367191[_0xc1a5('0x1e')][_0xc1a5('0x29')]){_0xcbdda5['where']=_['merge'](_0xcbdda5[_0xc1a5('0x2a')],{'$or':_[_0xc1a5('0x18')](_0x4591df,function(_0x34e61b){if(_0x34e61b[_0xc1a5('0x1c')]!==_0xc1a5('0x2b')){var _0x12e3dc={};_0x12e3dc[_0x34e61b[_0xc1a5('0x15')]]={'$like':'%'+_0x367191[_0xc1a5('0x1e')][_0xc1a5('0x29')]+'%'};return _0x12e3dc;}})});}_0xcbdda5=_[_0xc1a5('0x2c')]({},_0xcbdda5,_0x367191[_0xc1a5('0x2d')]);var _0x42cfb2={'where':_0xcbdda5[_0xc1a5('0x2a')]};return db[_0xc1a5('0x19')]['count'](_0x42cfb2)[_0xc1a5('0x10')](function(_0x187803){_0x307e5c[_0xc1a5('0xc')]=_0x187803;if(_0x367191[_0xc1a5('0x1e')][_0xc1a5('0x2e')]){_0xcbdda5[_0xc1a5('0x2f')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xc1a5('0x30')](_0xcbdda5);})[_0xc1a5('0x10')](function(_0x1f5b51){_0x307e5c[_0xc1a5('0x31')]=_0x1f5b51;return _0x307e5c;})['then'](respondWithFilteredResult(_0x5d73a7,_0xcbdda5))[_0xc1a5('0x32')](handleError(_0x5d73a7,null));};exports[_0xc1a5('0x33')]=function(_0x2bca57,_0x4d76b5){var _0x4dc1e1={'raw':![],'where':{'id':_0x2bca57[_0xc1a5('0x34')]['id']}},_0x3329f0={};_0x3329f0['model']=_[_0xc1a5('0x1f')](db['Dynamics365Account']['rawAttributes']);_0x3329f0[_0xc1a5('0x1e')]=_[_0xc1a5('0x1f')](_0x2bca57[_0xc1a5('0x1e')]);_0x3329f0[_0xc1a5('0x20')]=_[_0xc1a5('0x21')](_0x3329f0['model'],_0x3329f0[_0xc1a5('0x1e')]);_0x4dc1e1[_0xc1a5('0x22')]=_[_0xc1a5('0x21')](_0x3329f0[_0xc1a5('0x1d')],qs['fields'](_0x2bca57[_0xc1a5('0x1e')][_0xc1a5('0x23')]));_0x4dc1e1[_0xc1a5('0x22')]=_0x4dc1e1[_0xc1a5('0x22')][_0xc1a5('0x35')]?_0x4dc1e1[_0xc1a5('0x22')]:_0x3329f0[_0xc1a5('0x1d')];if(_0x2bca57['query']['includeAll']){_0x4dc1e1[_0xc1a5('0x2f')]=[{'all':!![]}];}_0x4dc1e1=_[_0xc1a5('0x2c')]({},_0x4dc1e1,_0x2bca57[_0xc1a5('0x2d')]);return db[_0xc1a5('0x19')][_0xc1a5('0x36')](_0x4dc1e1)[_0xc1a5('0x10')](handleEntityNotFound(_0x4d76b5,null))[_0xc1a5('0x10')](respondWithResult(_0x4d76b5,null))[_0xc1a5('0x32')](handleError(_0x4d76b5,null));};exports['create']=function(_0x5bb9e5,_0x5a70a9){return db['Dynamics365Account'][_0xc1a5('0x37')](_0x5bb9e5[_0xc1a5('0x38')],{})[_0xc1a5('0x10')](respondWithResult(_0x5a70a9,0xc9))['catch'](handleError(_0x5a70a9,null));};exports[_0xc1a5('0xf')]=function(_0x5b9b16,_0x4abc59){if(_0x5b9b16['body']['id']){delete _0x5b9b16[_0xc1a5('0x38')]['id'];}return db[_0xc1a5('0x19')][_0xc1a5('0x36')]({'where':{'id':_0x5b9b16[_0xc1a5('0x34')]['id']}})[_0xc1a5('0x10')](handleEntityNotFound(_0x4abc59,null))[_0xc1a5('0x10')](saveUpdates(_0x5b9b16['body'],null))[_0xc1a5('0x10')](respondWithResult(_0x4abc59,null))[_0xc1a5('0x32')](handleError(_0x4abc59,null));};exports[_0xc1a5('0x11')]=function(_0xf10b3e,_0x1446d2){return db[_0xc1a5('0x19')]['find']({'where':{'id':_0xf10b3e[_0xc1a5('0x34')]['id']}})[_0xc1a5('0x10')](handleEntityNotFound(_0x1446d2,null))[_0xc1a5('0x10')](removeEntity(_0x1446d2,null))[_0xc1a5('0x32')](handleError(_0x1446d2,null));};exports['getConfigurations']=function(_0x5df3f6,_0x45abc1){var _0x4d04c4={};var _0x5d4336={};var _0x3aece1;var _0x15ef4e;return db['Dynamics365Account'][_0xc1a5('0x39')]({'where':{'id':_0x5df3f6[_0xc1a5('0x34')]['id']}})['then'](handleEntityNotFound(_0x45abc1,null))[_0xc1a5('0x10')](function(_0x509d44){if(_0x509d44){_0x3aece1=_0x509d44;_0x5d4336[_0xc1a5('0x1d')]=_[_0xc1a5('0x1f')](db['Dynamics365Configuration'][_0xc1a5('0x1a')]);_0x5d4336[_0xc1a5('0x1e')]=_[_0xc1a5('0x1f')](_0x5df3f6[_0xc1a5('0x1e')]);_0x5d4336[_0xc1a5('0x20')]=_[_0xc1a5('0x21')](_0x5d4336[_0xc1a5('0x1d')],_0x5d4336['query']);_0x4d04c4[_0xc1a5('0x22')]=_[_0xc1a5('0x21')](_0x5d4336[_0xc1a5('0x1d')],qs[_0xc1a5('0x23')](_0x5df3f6[_0xc1a5('0x1e')][_0xc1a5('0x23')]));_0x4d04c4['attributes']=_0x4d04c4[_0xc1a5('0x22')][_0xc1a5('0x35')]?_0x4d04c4['attributes']:_0x5d4336[_0xc1a5('0x1d')];_0x4d04c4[_0xc1a5('0x27')]=qs['sort'](_0x5df3f6[_0xc1a5('0x1e')][_0xc1a5('0x28')]);_0x4d04c4['where']=qs[_0xc1a5('0x20')](_[_0xc1a5('0x3a')](_0x5df3f6[_0xc1a5('0x1e')],_0x5d4336[_0xc1a5('0x20')]));if(_0x5df3f6[_0xc1a5('0x1e')][_0xc1a5('0x29')]){_0x4d04c4[_0xc1a5('0x2a')]=_['merge'](_0x4d04c4[_0xc1a5('0x2a')],{'$or':_[_0xc1a5('0x18')](_0x4d04c4[_0xc1a5('0x22')],function(_0x5d836f){var _0x263ccf={};_0x263ccf[_0x5d836f]={'$like':'%'+_0x5df3f6[_0xc1a5('0x1e')]['filter']+'%'};return _0x263ccf;})});}_0x4d04c4=_[_0xc1a5('0x2c')]({},_0x4d04c4,_0x5df3f6[_0xc1a5('0x2d')]);return _0x3aece1['getConfigurations'](_0x4d04c4);}})[_0xc1a5('0x10')](function(_0x52703c){if(_0x52703c){_0x15ef4e=_0x52703c[_0xc1a5('0x35')];if(!_0x5df3f6[_0xc1a5('0x1e')][_0xc1a5('0x24')](_0xc1a5('0x25'))){_0x4d04c4[_0xc1a5('0x26')]=qs[_0xc1a5('0x26')](_0x5df3f6[_0xc1a5('0x1e')]['limit']);_0x4d04c4['offset']=qs['offset'](_0x5df3f6[_0xc1a5('0x1e')][_0xc1a5('0xa')]);}return _0x3aece1[_0xc1a5('0x3b')](_0x4d04c4);}})['then'](function(_0x211a96){if(_0x211a96){return _0x211a96?{'count':_0x15ef4e,'rows':_0x211a96}:null;}})['then'](respondWithResult(_0x45abc1,null))['catch'](handleError(_0x45abc1,null));};exports['addConfiguration']=function(_0x53695d,_0x2a2a24){if(_0x53695d[_0xc1a5('0x38')]['id']){delete _0x53695d[_0xc1a5('0x38')]['id'];}return db[_0xc1a5('0x19')][_0xc1a5('0x39')]({'where':{'id':_0x53695d[_0xc1a5('0x34')]['id']}})[_0xc1a5('0x10')](handleEntityNotFound(_0x2a2a24,null))['then'](function(_0x19f4a2){if(_0x19f4a2){_0x53695d[_0xc1a5('0x38')][_0xc1a5('0x3c')]=_0x19f4a2['id'];_0x53695d[_0xc1a5('0x38')][_0xc1a5('0x3d')]=integrations[_0xc1a5('0x3e')](_0x53695d[_0xc1a5('0x38')][_0xc1a5('0x3f')],_0x53695d[_0xc1a5('0x38')][_0xc1a5('0x1c')]);_0x53695d[_0xc1a5('0x38')][_0xc1a5('0x40')]=integrations['getDescriptions'](_0x53695d[_0xc1a5('0x38')]['channel'],_0x53695d[_0xc1a5('0x38')]['type']);return db['Dynamics365Configuration']['create'](_0x53695d[_0xc1a5('0x38')],{'include':[{'model':db['Dynamics365Field'],'as':_0xc1a5('0x3d')},{'model':db[_0xc1a5('0x41')],'as':_0xc1a5('0x40')}]});}return null;})[_0xc1a5('0x10')](respondWithResult(_0x2a2a24,null))['catch'](handleError(_0x2a2a24,null));};function sanitizeRemoteUri(_0x210667){var _0x3ee2e4=_0x210667[_0xc1a5('0x42')](-0x1);if(_0x3ee2e4==='/')return _0x210667[_0xc1a5('0x43')](0x0,_0x210667['lastIndexOf'](_0x3ee2e4));return _0x210667;}function getWebApiUrl(_0x475f28){return util['format'](_0xc1a5('0x44'),_0x475f28);}exports[_0xc1a5('0x45')]=function(_0x147b70,_0x29a1f2){var _0x2307b4=_0x147b70[_0xc1a5('0x1e')][_0xc1a5('0x46')];var _0x49784b=_0x2307b4===_0xc1a5('0x47')?_0xc1a5('0x48'):_0xc1a5('0x49');var _0x2d3210='';var _0x45f641='';var _0x6afb0b='';var _0x231f4b='';var _0x542625='';var _0x414155='';var _0x23bbf='';var _0x6ef665='';var _0x1459fa=[_0xc1a5('0x4a'),_0xc1a5('0x4b'),_0xc1a5('0x4c'),_0xc1a5('0x4d'),_0xc1a5('0x4e'),_0xc1a5('0x4f'),_0xc1a5('0x50'),_0xc1a5('0x51'),_0xc1a5('0x52'),_0xc1a5('0x53')];var _0x2cf9ca=[_0xc1a5('0x54'),_0xc1a5('0x55'),_0xc1a5('0x56'),_0xc1a5('0x57'),_0xc1a5('0x58'),_0xc1a5('0x59'),_0xc1a5('0x5a'),'contractidname',_0xc1a5('0x5b'),_0xc1a5('0x5c'),_0xc1a5('0x5d'),_0xc1a5('0x5e'),'createdon',_0xc1a5('0x5f'),_0xc1a5('0x60'),_0xc1a5('0x61'),_0xc1a5('0x62'),_0xc1a5('0x63'),_0xc1a5('0x64'),_0xc1a5('0x65'),_0xc1a5('0x66'),'entityimage_url',_0xc1a5('0x67'),'exchangerate',_0xc1a5('0x68'),_0xc1a5('0x69'),_0xc1a5('0x6a'),_0xc1a5('0x6b'),'kbarticleidname','lastonholdtime',_0xc1a5('0x6c'),_0xc1a5('0x6d'),_0xc1a5('0x6e'),_0xc1a5('0x6f'),'modifiedbyyominame',_0xc1a5('0x70'),_0xc1a5('0x71'),'modifiedonbehalfbyyominame','msdyn_incidenttypename',_0xc1a5('0x72'),'numberofchildincidents',_0xc1a5('0x73'),_0xc1a5('0x74'),_0xc1a5('0x75'),_0xc1a5('0x76'),_0xc1a5('0x77'),_0xc1a5('0x78'),_0xc1a5('0x79'),_0xc1a5('0x7a'),_0xc1a5('0x7b'),'productidname',_0xc1a5('0x7c'),'resolveby',_0xc1a5('0x7d'),_0xc1a5('0x7e'),_0xc1a5('0x7f'),'responsiblecontactidyominame',_0xc1a5('0x80'),'slainvokedidname',_0xc1a5('0x81'),_0xc1a5('0x82'),_0xc1a5('0x83'),_0xc1a5('0x84'),_0xc1a5('0x85'),'ticketnumber',_0xc1a5('0x86'),_0xc1a5('0x87'),_0xc1a5('0x88'),_0xc1a5('0x89'),_0xc1a5('0x8a')];var _0x59d009=_0x1459fa[_0xc1a5('0x8b')](_0x2cf9ca);return db['Dynamics365Account'][_0xc1a5('0x39')]({'where':{'id':_0x147b70[_0xc1a5('0x34')]['id']},'attributes':['id','username',_0xc1a5('0x8c'),'remoteUri','tenantId',_0xc1a5('0x8d'),'clientSecret',_0xc1a5('0x8e')],'include':[{'model':db[_0xc1a5('0x8f')],'as':_0xc1a5('0x8f'),'attributes':['id','data5',_0xc1a5('0x90')]}]})['then'](handleEntityNotFound(_0x29a1f2,null))[_0xc1a5('0x10')](function(_0x1e7789){if(_0x1e7789){if(_0x1e7789[_0xc1a5('0x8e')]){_0x1e7789[_0xc1a5('0x91')]=_0x1e7789[_0xc1a5('0x8f')][_0xc1a5('0x92')];_0x6ef665=sanitizeRemoteUri(_0x1e7789[_0xc1a5('0x8f')][_0xc1a5('0x90')]);_0x23bbf=getWebApiUrl(_0x6ef665);return _0x1e7789;}_0x6ef665=sanitizeRemoteUri(_0x1e7789[_0xc1a5('0x93')]);_0x23bbf=getWebApiUrl(_0x6ef665);var _0xf86f6e={'method':_0xc1a5('0x94'),'uri':_0xc1a5('0x95')+_0x1e7789['tenantId']+_0xc1a5('0x96'),'form':{'client_id':_0x1e7789[_0xc1a5('0x8d')],'resource':_0x6ef665,'username':_0x1e7789['username'],'password':_0x1e7789[_0xc1a5('0x8c')],'grant_type':_0xc1a5('0x8c'),'client_secret':_0x1e7789[_0xc1a5('0x97')]},'json':!![]};return rp(_0xf86f6e);}})[_0xc1a5('0x10')](function(_0x2b9701){_0x414155=_0x2b9701['access_token'];var _0x120515={'method':_0xc1a5('0x98'),'uri':encodeURI(_0x23bbf+_0xc1a5('0x99')+_0x49784b+'\x27'),'headers':{'Authorization':_0xc1a5('0x9a')+_0x414155,'If-None-Match':null,'OData-Version':_0xc1a5('0x9b')},'json':!![]};return rp(_0x120515);})[_0xc1a5('0x10')](function(_0x37d344){var _0x45d608=_0x37d344[_0xc1a5('0x9c')][0x0];var _0x1efd89=_0x45d608[_0xc1a5('0x9d')];var _0x324a31={'method':'GET','uri':_0x23bbf+_0xc1a5('0x9e')+_0x1efd89+_0xc1a5('0x9f'),'headers':{'Authorization':'Bearer\x20'+_0x414155,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x324a31);})[_0xc1a5('0x10')](function(_0x13030b){_0x2d3210=_0x13030b;_0x45f641=_0x2d3210[_0xc1a5('0xa0')];_0x45f641=_[_0xc1a5('0xa1')](_0x45f641,function(_0x42375d){return!_0x59d009['includes'](_0x42375d[_0xc1a5('0xa2')]);});var _0x8f8329=[];var _0x2cccaf=[];_0x45f641[_0xc1a5('0xa3')](function(_0x4da9e3){if(_0x4da9e3['@odata.type']){var _0x1f8bb0=_0x4da9e3[_0xc1a5('0xa4')]['substring'](_0x4da9e3[_0xc1a5('0xa4')][_0xc1a5('0xa5')]('.')+0x1);if(_0x1f8bb0===_0xc1a5('0xa6')){_0x8f8329['push'](getSelectList(_0x23bbf,_0x2307b4,_0x2cccaf,_0x2d3210['MetadataId'],_0x4da9e3[_0xc1a5('0x9d')],_0x414155));}}});return Promise[_0xc1a5('0xa7')](_0x8f8329);})[_0xc1a5('0x10')](function(_0x2c80ab){_0x6afb0b=_0x2c80ab[0x0];var _0x3fba3e=[];var _0x4d4606=[];_0x45f641['forEach'](function(_0x400da1){if(!_[_0xc1a5('0xa8')](_0x400da1[_0xc1a5('0xa4')])){var _0x377c48=_0x400da1[_0xc1a5('0xa4')][_0xc1a5('0x43')](_0x400da1[_0xc1a5('0xa4')][_0xc1a5('0xa5')]('.')+0x1);if(_0x377c48==='BooleanAttributeMetadata'){_0x3fba3e[_0xc1a5('0xa9')](getBooleanList(_0x23bbf,_0x2307b4,_0x4d4606,_0x2d3210[_0xc1a5('0x9d')],_0x400da1['MetadataId'],_0x414155));}}});return Promise[_0xc1a5('0xa7')](_0x3fba3e);})['then'](function(_0x4c70b4){_0x231f4b=_0x4c70b4[0x0];var _0x47c853=[];var _0x4a4ee5=[];_0x45f641[_0xc1a5('0xa3')](function(_0x1fd339){if(_0x1fd339[_0xc1a5('0xa4')]){var _0x10ab16=_0x1fd339[_0xc1a5('0xa4')][_0xc1a5('0x43')](_0x1fd339[_0xc1a5('0xa4')][_0xc1a5('0xa5')]('.')+0x1);if(_0x10ab16===_0xc1a5('0xaa')||_0x10ab16===_0xc1a5('0xab')||_0x10ab16===_0xc1a5('0xac')||_0x10ab16==='IntegerAttributeMetadata'||_0x10ab16==='MemoAttributeMetadata'||_0x10ab16===_0xc1a5('0xad')||_0x10ab16==='StatusAttributeMetadata'||_0x10ab16===_0xc1a5('0xae')||_0x10ab16===_0xc1a5('0xaf')||_0x10ab16===_0xc1a5('0xb0')){_0x47c853['push'](getInputList(_0x23bbf,_0x2307b4,_0x10ab16,_0x4a4ee5,_0x2d3210[_0xc1a5('0x9d')],_0x1fd339[_0xc1a5('0x9d')],_0x414155));}}});return Promise[_0xc1a5('0xa7')](_0x47c853);})[_0xc1a5('0x10')](function(_0x359e22){_0x542625=_0x359e22[0x0];var _0x3cd73f=_0x6afb0b[_0xc1a5('0x8b')](_0x231f4b)['concat'](_0x542625);var _0x402e52={'count':_0x3cd73f[_0xc1a5('0x35')],'rows':_0x3cd73f};return _0x402e52;})[_0xc1a5('0x10')](respondWithResult(_0x29a1f2,null))[_0xc1a5('0x32')](function(_0x35fd06){var _0x455591=_0x147b70[_0xc1a5('0x1e')][_0xc1a5('0xb1')]?0x1f4:_0x35fd06['statusCode']||0x1f4;logger['error'](_0x35fd06[_0xc1a5('0x14')]);delete _0x35fd06[_0xc1a5('0x15')];if(_0x455591===0x191){_0x455591=0x190;}_0x29a1f2[_0xc1a5('0x8')](_0x455591)[_0xc1a5('0x16')](_0x147b70[_0xc1a5('0x1e')][_0xc1a5('0xb1')]?{'message':_0xc1a5('0xb2'),'statusCode':_0x35fd06['statusCode']}:_0x35fd06);});};function getSelectList(_0x10c010,_0x2515b8,_0x2cb6d9,_0x1edfaa,_0x50ee80,_0x224da2){var _0x27bf88={'method':_0xc1a5('0x98'),'uri':_0x10c010+'EntityDefinitions('+_0x1edfaa+')/Attributes('+_0x50ee80+_0xc1a5('0xb3')+_0xc1a5('0xb4'),'headers':{'Authorization':_0xc1a5('0x9a')+_0x224da2,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x27bf88)[_0xc1a5('0x10')](function(_0x301d4f){var _0x463012=[];var _0x4c197c=_0x301d4f[_0xc1a5('0xb5')][_0xc1a5('0xb6')];_0x4c197c['forEach'](function(_0x3ea80b){_0x463012['push']({'name':_0x3ea80b[_0xc1a5('0xb7')][_0xc1a5('0xb8')][_0xc1a5('0xb7')],'value':String(_0x3ea80b[_0xc1a5('0xb9')])});});var _0x31600e={'id':_0x2515b8+'_'+_0x301d4f[_0xc1a5('0xa2')],'name':_0x301d4f[_0xc1a5('0xba')][_0xc1a5('0xb8')][_0xc1a5('0xb7')],'custom':![],'options':_0x463012};_0x2cb6d9['push'](_0x31600e);return _0x2cb6d9;});}function getBooleanList(_0x55b4eb,_0x231b16,_0x4d4549,_0xe647a0,_0xe2e51f,_0x106414){var _0x4665e2={'method':_0xc1a5('0x98'),'uri':_0x55b4eb+_0xc1a5('0x9e')+_0xe647a0+')/Attributes('+_0xe2e51f+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xc1a5('0x9a')+_0x106414,'If-None-Match':null,'OData-Version':_0xc1a5('0x9b')},'json':!![]};return rp(_0x4665e2)[_0xc1a5('0x10')](function(_0x34d9f2){var _0x2a1f28=[];_0x2a1f28[_0xc1a5('0xa9')]({'name':_0x34d9f2['OptionSet'][_0xc1a5('0xbb')][_0xc1a5('0xb7')][_0xc1a5('0xb8')][_0xc1a5('0xb7')],'value':_0xc1a5('0xbc')},{'name':_0x34d9f2['OptionSet'][_0xc1a5('0xbd')]['Label'][_0xc1a5('0xb8')]['Label'],'value':_0xc1a5('0xbe')});var _0x3e58c6={'id':_0x231b16+'_'+_0x34d9f2[_0xc1a5('0xa2')],'name':_0x34d9f2[_0xc1a5('0xba')][_0xc1a5('0xb8')]['Label'],'custom':![],'options':_0x2a1f28};_0x4d4549['push'](_0x3e58c6);return _0x4d4549;});}function getInputList(_0x383d21,_0xd1be6b,_0x5c1aa5,_0x233dad,_0x1a6468,_0x1884b1,_0x4a3716){var _0x44ca32={'method':'GET','uri':_0x383d21+_0xc1a5('0x9e')+_0x1a6468+_0xc1a5('0xbf')+_0x1884b1+_0xc1a5('0xc0')+_0x5c1aa5+_0xc1a5('0xc1'),'headers':{'Authorization':_0xc1a5('0x9a')+_0x4a3716,'If-None-Match':null,'OData-Version':_0xc1a5('0x9b')},'json':!![]};return rp(_0x44ca32)['then'](function(_0x3fe345){var _0x5893f8={'id':_0xd1be6b+'_'+_0x3fe345['LogicalName'],'name':_0x3fe345[_0xc1a5('0xba')][_0xc1a5('0xb8')]?_0x3fe345['DisplayName'][_0xc1a5('0xb8')][_0xc1a5('0xb7')]:_0x3fe345['LogicalName'],'custom':![],'options':[]};_0x233dad[_0xc1a5('0xa9')](_0x5893f8);return _0x233dad;});} \ No newline at end of file +var _0x1ecf=['versionnumber','concat','findOne','username','remoteUri','tenantId','clientId','modernAuthentication','CloudProvider','data7','access_token','data5','POST','https://login.microsoftonline.com/','/oauth2/token','password','clientSecret','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId','EntityDefinitions(','4.0','Attributes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','all','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','push','statusCode','test','Wrong\x20credentials',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','UserLocalizedLabel','Label','Value','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','Content-Range','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','Dynamics365Account','includeAll','include','findAll','rows','catch','params','keys','length','options','create','body','find','getConfigurations','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','Dynamics365Field','substring','lastIndexOf','%s/api/data/v9.0/','getFields','incident','Incident','PhoneCall','title','customerid','ownerid','caseorigincode','subject','regardingobjectid','directioncode','phonecall_activity_parties','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','onholdtime','overriddencreatedon','owneridname','owneridtype','primarycontactidyominame','prioritycodename','productidname','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','socialprofileidname','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode'];(function(_0x17499b,_0x1b2ffd){var _0x5d2b45=function(_0x55f4e2){while(--_0x55f4e2){_0x17499b['push'](_0x17499b['shift']());}};_0x5d2b45(++_0x1b2ffd);}(_0x1ecf,0xf4));var _0xf1ec=function(_0x27dba4,_0x419253){_0x27dba4=_0x27dba4-0x0;var _0x35ec9d=_0x1ecf[_0x27dba4];return _0x35ec9d;};'use strict';var rp=require(_0xf1ec('0x0'));var util=require(_0xf1ec('0x1'));var _=require('lodash');var qs=require(_0xf1ec('0x2'));var logger=require(_0xf1ec('0x3'))(_0xf1ec('0x4'));var db=require(_0xf1ec('0x5'))['db'];var integrations=require(_0xf1ec('0x6'));function respondWithResult(_0x1401ef,_0x36ea01){_0x36ea01=_0x36ea01||0xc8;return function(_0x7a2992){if(_0x7a2992){return _0x1401ef[_0xf1ec('0x7')](_0x36ea01)[_0xf1ec('0x8')](_0x7a2992);}};}function respondWithFilteredResult(_0x61b052,_0x369ba3){return function(_0x1ea5c6){if(_0x1ea5c6){var _0x16db86=typeof _0x369ba3[_0xf1ec('0x9')]===_0xf1ec('0xa')&&typeof _0x369ba3[_0xf1ec('0xb')]===_0xf1ec('0xa');var _0xe57e36=_0x1ea5c6[_0xf1ec('0xc')];var _0x587a69=_0x16db86?0x0:_0x369ba3[_0xf1ec('0x9')];var _0x3635eb=_0x16db86?_0x1ea5c6[_0xf1ec('0xc')]:_0x369ba3['offset']+_0x369ba3[_0xf1ec('0xb')];var _0x34b0d6;if(_0x3635eb>=_0xe57e36){_0x3635eb=_0xe57e36;_0x34b0d6=0xc8;}else{_0x34b0d6=0xce;}_0x61b052[_0xf1ec('0x7')](_0x34b0d6);return _0x61b052['set'](_0xf1ec('0xd'),_0x587a69+'-'+_0x3635eb+'/'+_0xe57e36)[_0xf1ec('0x8')](_0x1ea5c6);}return null;};}function saveUpdates(_0x2d54af){return function(_0x5b9e0d){if(_0x5b9e0d){return _0x5b9e0d[_0xf1ec('0xe')](_0x2d54af)['then'](function(_0x38d6e5){return _0x38d6e5;});}return null;};}function removeEntity(_0xfb1e81){return function(_0x62d932){if(_0x62d932){return _0x62d932[_0xf1ec('0xf')]()[_0xf1ec('0x10')](function(){_0xfb1e81[_0xf1ec('0x7')](0xcc)[_0xf1ec('0x11')]();});}};}function handleEntityNotFound(_0x522cf3){return function(_0x112d7c){if(!_0x112d7c){_0x522cf3[_0xf1ec('0x12')](0x194);}return _0x112d7c;};}function handleError(_0x2e0f74,_0x2deb38){_0x2deb38=_0x2deb38||0x1f4;return function(_0x1199c2){logger[_0xf1ec('0x13')](_0x1199c2[_0xf1ec('0x14')]);if(_0x1199c2[_0xf1ec('0x15')]){delete _0x1199c2[_0xf1ec('0x15')];}_0x2e0f74[_0xf1ec('0x7')](_0x2deb38)[_0xf1ec('0x16')](_0x1199c2);};}exports[_0xf1ec('0x17')]=function(_0x534065,_0x300bb3){var _0x45fac0={},_0x39eaeb={},_0x2eb360={'count':0x0,'rows':[]};var _0x37808e=_[_0xf1ec('0x18')](db['Dynamics365Account'][_0xf1ec('0x19')],function(_0x134c5a){return{'name':_0x134c5a[_0xf1ec('0x1a')],'type':_0x134c5a[_0xf1ec('0x1b')]['key']};});_0x39eaeb[_0xf1ec('0x1c')]=_[_0xf1ec('0x18')](_0x37808e,_0xf1ec('0x15'));_0x39eaeb[_0xf1ec('0x1d')]=_['keys'](_0x534065[_0xf1ec('0x1d')]);_0x39eaeb[_0xf1ec('0x1e')]=_['intersection'](_0x39eaeb[_0xf1ec('0x1c')],_0x39eaeb[_0xf1ec('0x1d')]);_0x45fac0['attributes']=_[_0xf1ec('0x1f')](_0x39eaeb['model'],qs['fields'](_0x534065[_0xf1ec('0x1d')][_0xf1ec('0x20')]));_0x45fac0[_0xf1ec('0x21')]=_0x45fac0[_0xf1ec('0x21')]['length']?_0x45fac0[_0xf1ec('0x21')]:_0x39eaeb[_0xf1ec('0x1c')];if(!_0x534065[_0xf1ec('0x1d')][_0xf1ec('0x22')]('nolimit')){_0x45fac0['limit']=qs['limit'](_0x534065['query'][_0xf1ec('0xb')]);_0x45fac0[_0xf1ec('0x9')]=qs[_0xf1ec('0x9')](_0x534065[_0xf1ec('0x1d')][_0xf1ec('0x9')]);}_0x45fac0[_0xf1ec('0x23')]=qs['sort'](_0x534065[_0xf1ec('0x1d')][_0xf1ec('0x24')]);_0x45fac0[_0xf1ec('0x25')]=qs[_0xf1ec('0x1e')](_[_0xf1ec('0x26')](_0x534065[_0xf1ec('0x1d')],_0x39eaeb['filters']),_0x37808e);if(_0x534065[_0xf1ec('0x1d')]['filter']){_0x45fac0[_0xf1ec('0x25')]=_[_0xf1ec('0x27')](_0x45fac0[_0xf1ec('0x25')],{'$or':_[_0xf1ec('0x18')](_0x37808e,function(_0x448091){if(_0x448091[_0xf1ec('0x1b')]!==_0xf1ec('0x28')){var _0x5e0b3f={};_0x5e0b3f[_0x448091[_0xf1ec('0x15')]]={'$like':'%'+_0x534065[_0xf1ec('0x1d')][_0xf1ec('0x29')]+'%'};return _0x5e0b3f;}})});}_0x45fac0=_[_0xf1ec('0x27')]({},_0x45fac0,_0x534065['options']);var _0x21bd23={'where':_0x45fac0[_0xf1ec('0x25')]};return db[_0xf1ec('0x2a')]['count'](_0x21bd23)['then'](function(_0x15bde2){_0x2eb360[_0xf1ec('0xc')]=_0x15bde2;if(_0x534065[_0xf1ec('0x1d')][_0xf1ec('0x2b')]){_0x45fac0[_0xf1ec('0x2c')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xf1ec('0x2d')](_0x45fac0);})[_0xf1ec('0x10')](function(_0x4d867a){_0x2eb360[_0xf1ec('0x2e')]=_0x4d867a;return _0x2eb360;})[_0xf1ec('0x10')](respondWithFilteredResult(_0x300bb3,_0x45fac0))[_0xf1ec('0x2f')](handleError(_0x300bb3,null));};exports['show']=function(_0x521648,_0x3f384a){var _0x2475aa={'raw':![],'where':{'id':_0x521648[_0xf1ec('0x30')]['id']}},_0x3f3eb3={};_0x3f3eb3[_0xf1ec('0x1c')]=_[_0xf1ec('0x31')](db[_0xf1ec('0x2a')][_0xf1ec('0x19')]);_0x3f3eb3['query']=_[_0xf1ec('0x31')](_0x521648[_0xf1ec('0x1d')]);_0x3f3eb3[_0xf1ec('0x1e')]=_[_0xf1ec('0x1f')](_0x3f3eb3[_0xf1ec('0x1c')],_0x3f3eb3['query']);_0x2475aa[_0xf1ec('0x21')]=_[_0xf1ec('0x1f')](_0x3f3eb3[_0xf1ec('0x1c')],qs[_0xf1ec('0x20')](_0x521648[_0xf1ec('0x1d')][_0xf1ec('0x20')]));_0x2475aa[_0xf1ec('0x21')]=_0x2475aa['attributes'][_0xf1ec('0x32')]?_0x2475aa[_0xf1ec('0x21')]:_0x3f3eb3[_0xf1ec('0x1c')];if(_0x521648[_0xf1ec('0x1d')][_0xf1ec('0x2b')]){_0x2475aa[_0xf1ec('0x2c')]=[{'all':!![]}];}_0x2475aa=_[_0xf1ec('0x27')]({},_0x2475aa,_0x521648[_0xf1ec('0x33')]);return db[_0xf1ec('0x2a')]['find'](_0x2475aa)[_0xf1ec('0x10')](handleEntityNotFound(_0x3f384a,null))[_0xf1ec('0x10')](respondWithResult(_0x3f384a,null))[_0xf1ec('0x2f')](handleError(_0x3f384a,null));};exports[_0xf1ec('0x34')]=function(_0x48f7eb,_0x38702b){return db[_0xf1ec('0x2a')][_0xf1ec('0x34')](_0x48f7eb[_0xf1ec('0x35')],{})[_0xf1ec('0x10')](respondWithResult(_0x38702b,0xc9))[_0xf1ec('0x2f')](handleError(_0x38702b,null));};exports[_0xf1ec('0xe')]=function(_0x3ab8eb,_0x372a76){if(_0x3ab8eb[_0xf1ec('0x35')]['id']){delete _0x3ab8eb[_0xf1ec('0x35')]['id'];}return db[_0xf1ec('0x2a')][_0xf1ec('0x36')]({'where':{'id':_0x3ab8eb[_0xf1ec('0x30')]['id']}})[_0xf1ec('0x10')](handleEntityNotFound(_0x372a76,null))[_0xf1ec('0x10')](saveUpdates(_0x3ab8eb[_0xf1ec('0x35')],null))[_0xf1ec('0x10')](respondWithResult(_0x372a76,null))['catch'](handleError(_0x372a76,null));};exports[_0xf1ec('0xf')]=function(_0x158699,_0x144054){return db[_0xf1ec('0x2a')][_0xf1ec('0x36')]({'where':{'id':_0x158699['params']['id']}})[_0xf1ec('0x10')](handleEntityNotFound(_0x144054,null))[_0xf1ec('0x10')](removeEntity(_0x144054,null))['catch'](handleError(_0x144054,null));};exports[_0xf1ec('0x37')]=function(_0x8a2b63,_0x3c9d08){var _0x293e60={};var _0x2143cc={};var _0x18340e;var _0x6803a9;return db[_0xf1ec('0x2a')]['findOne']({'where':{'id':_0x8a2b63[_0xf1ec('0x30')]['id']}})[_0xf1ec('0x10')](handleEntityNotFound(_0x3c9d08,null))[_0xf1ec('0x10')](function(_0x24afbf){if(_0x24afbf){_0x18340e=_0x24afbf;_0x2143cc[_0xf1ec('0x1c')]=_[_0xf1ec('0x31')](db['Dynamics365Configuration'][_0xf1ec('0x19')]);_0x2143cc[_0xf1ec('0x1d')]=_[_0xf1ec('0x31')](_0x8a2b63[_0xf1ec('0x1d')]);_0x2143cc[_0xf1ec('0x1e')]=_[_0xf1ec('0x1f')](_0x2143cc['model'],_0x2143cc[_0xf1ec('0x1d')]);_0x293e60['attributes']=_[_0xf1ec('0x1f')](_0x2143cc[_0xf1ec('0x1c')],qs[_0xf1ec('0x20')](_0x8a2b63[_0xf1ec('0x1d')]['fields']));_0x293e60['attributes']=_0x293e60[_0xf1ec('0x21')]['length']?_0x293e60[_0xf1ec('0x21')]:_0x2143cc[_0xf1ec('0x1c')];_0x293e60[_0xf1ec('0x23')]=qs[_0xf1ec('0x24')](_0x8a2b63[_0xf1ec('0x1d')]['sort']);_0x293e60[_0xf1ec('0x25')]=qs[_0xf1ec('0x1e')](_['pick'](_0x8a2b63[_0xf1ec('0x1d')],_0x2143cc[_0xf1ec('0x1e')]));if(_0x8a2b63[_0xf1ec('0x1d')][_0xf1ec('0x29')]){_0x293e60['where']=_['merge'](_0x293e60[_0xf1ec('0x25')],{'$or':_['map'](_0x293e60[_0xf1ec('0x21')],function(_0x467819){var _0x27d943={};_0x27d943[_0x467819]={'$like':'%'+_0x8a2b63[_0xf1ec('0x1d')][_0xf1ec('0x29')]+'%'};return _0x27d943;})});}_0x293e60=_[_0xf1ec('0x27')]({},_0x293e60,_0x8a2b63[_0xf1ec('0x33')]);return _0x18340e[_0xf1ec('0x37')](_0x293e60);}})[_0xf1ec('0x10')](function(_0x4e4c10){if(_0x4e4c10){_0x6803a9=_0x4e4c10[_0xf1ec('0x32')];if(!_0x8a2b63[_0xf1ec('0x1d')]['hasOwnProperty'](_0xf1ec('0x38'))){_0x293e60[_0xf1ec('0xb')]=qs[_0xf1ec('0xb')](_0x8a2b63[_0xf1ec('0x1d')][_0xf1ec('0xb')]);_0x293e60[_0xf1ec('0x9')]=qs[_0xf1ec('0x9')](_0x8a2b63[_0xf1ec('0x1d')][_0xf1ec('0x9')]);}return _0x18340e[_0xf1ec('0x37')](_0x293e60);}})[_0xf1ec('0x10')](function(_0x10b69e){if(_0x10b69e){return _0x10b69e?{'count':_0x6803a9,'rows':_0x10b69e}:null;}})[_0xf1ec('0x10')](respondWithResult(_0x3c9d08,null))['catch'](handleError(_0x3c9d08,null));};exports['addConfiguration']=function(_0x4ab00a,_0x22af54){if(_0x4ab00a['body']['id']){delete _0x4ab00a['body']['id'];}return db[_0xf1ec('0x2a')]['findOne']({'where':{'id':_0x4ab00a[_0xf1ec('0x30')]['id']}})[_0xf1ec('0x10')](handleEntityNotFound(_0x22af54,null))['then'](function(_0x3ec095){if(_0x3ec095){_0x4ab00a['body'][_0xf1ec('0x39')]=_0x3ec095['id'];_0x4ab00a['body'][_0xf1ec('0x3a')]=integrations[_0xf1ec('0x3b')](_0x4ab00a[_0xf1ec('0x35')][_0xf1ec('0x3c')],_0x4ab00a['body'][_0xf1ec('0x1b')]);_0x4ab00a[_0xf1ec('0x35')][_0xf1ec('0x3d')]=integrations['getDescriptions'](_0x4ab00a[_0xf1ec('0x35')]['channel'],_0x4ab00a[_0xf1ec('0x35')]['type']);return db['Dynamics365Configuration'][_0xf1ec('0x34')](_0x4ab00a[_0xf1ec('0x35')],{'include':[{'model':db['Dynamics365Field'],'as':'Subjects'},{'model':db[_0xf1ec('0x3e')],'as':'Descriptions'}]});}return null;})[_0xf1ec('0x10')](respondWithResult(_0x22af54,null))[_0xf1ec('0x2f')](handleError(_0x22af54,null));};function sanitizeRemoteUri(_0xbb6508){var _0x44db83=_0xbb6508['slice'](-0x1);if(_0x44db83==='/')return _0xbb6508[_0xf1ec('0x3f')](0x0,_0xbb6508[_0xf1ec('0x40')](_0x44db83));return _0xbb6508;}function getWebApiUrl(_0x49ac2a){return util['format'](_0xf1ec('0x41'),_0x49ac2a);}exports[_0xf1ec('0x42')]=function(_0x2fbbef,_0xf89fb9){var _0x29f6bd=_0x2fbbef[_0xf1ec('0x1d')]['ticketType'];var _0x35ef40=_0x29f6bd===_0xf1ec('0x43')?_0xf1ec('0x44'):_0xf1ec('0x45');var _0x507e33='';var _0x26ebe6='';var _0x376471='';var _0x4c8885='';var _0x77facb='';var _0x7d9a64='';var _0x384423='';var _0x272ef3='';var _0x2fbfd2=[_0xf1ec('0x46'),'description',_0xf1ec('0x47'),_0xf1ec('0x48'),_0xf1ec('0x49'),_0xf1ec('0x4a'),'phonenumber',_0xf1ec('0x4b'),_0xf1ec('0x4c'),_0xf1ec('0x4d')];var _0x3dd326=['accountidname','accountidyominame','actualserviceunits','billedserviceunits',_0xf1ec('0x4e'),_0xf1ec('0x4f'),_0xf1ec('0x50'),_0xf1ec('0x51'),'createdbyexternalpartyname',_0xf1ec('0x52'),_0xf1ec('0x53'),_0xf1ec('0x54'),_0xf1ec('0x55'),_0xf1ec('0x56'),_0xf1ec('0x57'),'customeridname','customeridtype',_0xf1ec('0x58'),_0xf1ec('0x59'),_0xf1ec('0x5a'),_0xf1ec('0x5b'),'entityimage_url',_0xf1ec('0x5c'),'exchangerate',_0xf1ec('0x5d'),_0xf1ec('0x5e'),_0xf1ec('0x5f'),_0xf1ec('0x60'),'kbarticleidname',_0xf1ec('0x61'),_0xf1ec('0x62'),_0xf1ec('0x63'),_0xf1ec('0x64'),_0xf1ec('0x65'),_0xf1ec('0x66'),_0xf1ec('0x67'),_0xf1ec('0x68'),_0xf1ec('0x69'),_0xf1ec('0x6a'),'msdyn_iotalertname','numberofchildincidents',_0xf1ec('0x6b'),_0xf1ec('0x6c'),_0xf1ec('0x6d'),_0xf1ec('0x6e'),'owneridyominame','parentcaseidname','primarycontactidname',_0xf1ec('0x6f'),_0xf1ec('0x70'),_0xf1ec('0x71'),'productserialnumber','resolveby',_0xf1ec('0x72'),_0xf1ec('0x73'),_0xf1ec('0x74'),_0xf1ec('0x75'),'sentimentvalue',_0xf1ec('0x76'),'slaname',_0xf1ec('0x77'),'statecode','statuscode',_0xf1ec('0x78'),_0xf1ec('0x79'),_0xf1ec('0x7a'),_0xf1ec('0x7b'),_0xf1ec('0x7c'),_0xf1ec('0x7d'),_0xf1ec('0x7e')];var _0x78ee1=_0x2fbfd2[_0xf1ec('0x7f')](_0x3dd326);return db[_0xf1ec('0x2a')][_0xf1ec('0x80')]({'where':{'id':_0x2fbbef['params']['id']},'attributes':['id',_0xf1ec('0x81'),'password',_0xf1ec('0x82'),_0xf1ec('0x83'),_0xf1ec('0x84'),'clientSecret',_0xf1ec('0x85')],'include':[{'model':db[_0xf1ec('0x86')],'as':_0xf1ec('0x86'),'attributes':['id','data5',_0xf1ec('0x87')]}]})[_0xf1ec('0x10')](handleEntityNotFound(_0xf89fb9,null))[_0xf1ec('0x10')](function(_0x514c17){if(_0x514c17){if(_0x514c17[_0xf1ec('0x85')]){_0x514c17[_0xf1ec('0x88')]=_0x514c17[_0xf1ec('0x86')][_0xf1ec('0x89')];_0x272ef3=sanitizeRemoteUri(_0x514c17[_0xf1ec('0x86')][_0xf1ec('0x87')]);_0x384423=getWebApiUrl(_0x272ef3);return _0x514c17;}_0x272ef3=sanitizeRemoteUri(_0x514c17['remoteUri']);_0x384423=getWebApiUrl(_0x272ef3);var _0x41209d={'method':_0xf1ec('0x8a'),'uri':_0xf1ec('0x8b')+_0x514c17['tenantId']+_0xf1ec('0x8c'),'form':{'client_id':_0x514c17[_0xf1ec('0x84')],'resource':_0x272ef3,'username':_0x514c17[_0xf1ec('0x81')],'password':_0x514c17['password'],'grant_type':_0xf1ec('0x8d'),'client_secret':_0x514c17[_0xf1ec('0x8e')]},'json':!![]};return rp(_0x41209d);}})[_0xf1ec('0x10')](function(_0x12c829){_0x7d9a64=_0x12c829[_0xf1ec('0x88')];var _0x34faf5={'method':_0xf1ec('0x8f'),'uri':encodeURI(_0x384423+_0xf1ec('0x90')+_0x35ef40+'\x27'),'headers':{'Authorization':_0xf1ec('0x91')+_0x7d9a64,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x34faf5);})['then'](function(_0xb468){var _0x16805f=_0xb468[_0xf1ec('0x92')][0x0];var _0x205595=_0x16805f[_0xf1ec('0x93')];var _0x4e2e27={'method':_0xf1ec('0x8f'),'uri':_0x384423+_0xf1ec('0x94')+_0x205595+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xf1ec('0x91')+_0x7d9a64,'If-None-Match':null,'OData-Version':_0xf1ec('0x95')},'json':!![]};return rp(_0x4e2e27);})['then'](function(_0x43b362){_0x507e33=_0x43b362;_0x26ebe6=_0x507e33[_0xf1ec('0x96')];_0x26ebe6=_['remove'](_0x26ebe6,function(_0x2b11f5){return!_0x78ee1['includes'](_0x2b11f5[_0xf1ec('0x97')]);});var _0x47a3f6=[];var _0x604a05=[];_0x26ebe6[_0xf1ec('0x98')](function(_0x48c08c){if(_0x48c08c['@odata.type']){var _0x1c52cb=_0x48c08c[_0xf1ec('0x99')][_0xf1ec('0x3f')](_0x48c08c[_0xf1ec('0x99')][_0xf1ec('0x40')]('.')+0x1);if(_0x1c52cb===_0xf1ec('0x9a')){_0x47a3f6['push'](getSelectList(_0x384423,_0x29f6bd,_0x604a05,_0x507e33['MetadataId'],_0x48c08c[_0xf1ec('0x93')],_0x7d9a64));}}});return Promise[_0xf1ec('0x9b')](_0x47a3f6);})['then'](function(_0x3336b4){_0x376471=_0x3336b4[0x0];var _0x58c1b4=[];var _0x458bc7=[];_0x26ebe6[_0xf1ec('0x98')](function(_0x27e5b9){if(!_['isNil'](_0x27e5b9[_0xf1ec('0x99')])){var _0x5ebaca=_0x27e5b9[_0xf1ec('0x99')][_0xf1ec('0x3f')](_0x27e5b9[_0xf1ec('0x99')][_0xf1ec('0x40')]('.')+0x1);if(_0x5ebaca==='BooleanAttributeMetadata'){_0x58c1b4['push'](getBooleanList(_0x384423,_0x29f6bd,_0x458bc7,_0x507e33[_0xf1ec('0x93')],_0x27e5b9[_0xf1ec('0x93')],_0x7d9a64));}}});return Promise[_0xf1ec('0x9b')](_0x58c1b4);})['then'](function(_0x5222cd){_0x4c8885=_0x5222cd[0x0];var _0x287bbf=[];var _0x31b6ba=[];_0x26ebe6['forEach'](function(_0x41d2a2){if(_0x41d2a2['@odata.type']){var _0x5c3051=_0x41d2a2[_0xf1ec('0x99')][_0xf1ec('0x3f')](_0x41d2a2['@odata.type'][_0xf1ec('0x40')]('.')+0x1);if(_0x5c3051===_0xf1ec('0x9c')||_0x5c3051===_0xf1ec('0x9d')||_0x5c3051===_0xf1ec('0x9e')||_0x5c3051===_0xf1ec('0x9f')||_0x5c3051===_0xf1ec('0xa0')||_0x5c3051===_0xf1ec('0xa1')||_0x5c3051===_0xf1ec('0xa2')||_0x5c3051===_0xf1ec('0xa3')||_0x5c3051===_0xf1ec('0xa4')||_0x5c3051===_0xf1ec('0xa5')){_0x287bbf[_0xf1ec('0xa6')](getInputList(_0x384423,_0x29f6bd,_0x5c3051,_0x31b6ba,_0x507e33['MetadataId'],_0x41d2a2['MetadataId'],_0x7d9a64));}}});return Promise['all'](_0x287bbf);})[_0xf1ec('0x10')](function(_0x2d5f0d){_0x77facb=_0x2d5f0d[0x0];var _0x2c8c04=_0x376471['concat'](_0x4c8885)[_0xf1ec('0x7f')](_0x77facb);var _0x5d617b={'count':_0x2c8c04['length'],'rows':_0x2c8c04};return _0x5d617b;})[_0xf1ec('0x10')](respondWithResult(_0xf89fb9,null))[_0xf1ec('0x2f')](function(_0x382e9b){var _0x2a40ac=_0x2fbbef[_0xf1ec('0x1d')]['test']?0x1f4:_0x382e9b[_0xf1ec('0xa7')]||0x1f4;logger[_0xf1ec('0x13')](_0x382e9b[_0xf1ec('0x14')]);delete _0x382e9b[_0xf1ec('0x15')];if(_0x2a40ac===0x191){_0x2a40ac=0x190;}_0xf89fb9['status'](_0x2a40ac)[_0xf1ec('0x16')](_0x2fbbef[_0xf1ec('0x1d')][_0xf1ec('0xa8')]?{'message':_0xf1ec('0xa9'),'statusCode':_0x382e9b[_0xf1ec('0xa7')]}:_0x382e9b);});};function getSelectList(_0x560c44,_0x19b19d,_0x11a15a,_0x141b7b,_0x382560,_0x5483da){var _0x3f5de2={'method':_0xf1ec('0x8f'),'uri':_0x560c44+_0xf1ec('0x94')+_0x141b7b+')/Attributes('+_0x382560+_0xf1ec('0xaa')+_0xf1ec('0xab'),'headers':{'Authorization':'Bearer\x20'+_0x5483da,'If-None-Match':null,'OData-Version':_0xf1ec('0x95')},'json':!![]};return rp(_0x3f5de2)[_0xf1ec('0x10')](function(_0x121c22){var _0x573dd7=[];var _0x3f0f38=_0x121c22['OptionSet']['Options'];_0x3f0f38[_0xf1ec('0x98')](function(_0x38d583){_0x573dd7[_0xf1ec('0xa6')]({'name':_0x38d583['Label'][_0xf1ec('0xac')][_0xf1ec('0xad')],'value':String(_0x38d583[_0xf1ec('0xae')])});});var _0x374a48={'id':_0x19b19d+'_'+_0x121c22[_0xf1ec('0x97')],'name':_0x121c22[_0xf1ec('0xaf')][_0xf1ec('0xac')][_0xf1ec('0xad')],'custom':![],'options':_0x573dd7};_0x11a15a[_0xf1ec('0xa6')](_0x374a48);return _0x11a15a;});}function getBooleanList(_0x4a4d34,_0x3bca99,_0x36c198,_0x3da661,_0x5853cd,_0x2b5e12){var _0x499f68={'method':_0xf1ec('0x8f'),'uri':_0x4a4d34+_0xf1ec('0x94')+_0x3da661+_0xf1ec('0xb0')+_0x5853cd+_0xf1ec('0xb1'),'headers':{'Authorization':_0xf1ec('0x91')+_0x2b5e12,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x499f68)[_0xf1ec('0x10')](function(_0x55d3da){var _0x21cfd3=[];_0x21cfd3['push']({'name':_0x55d3da[_0xf1ec('0xb2')][_0xf1ec('0xb3')]['Label']['UserLocalizedLabel'][_0xf1ec('0xad')],'value':_0xf1ec('0xb4')},{'name':_0x55d3da[_0xf1ec('0xb2')][_0xf1ec('0xb5')]['Label'][_0xf1ec('0xac')]['Label'],'value':_0xf1ec('0xb6')});var _0x307697={'id':_0x3bca99+'_'+_0x55d3da[_0xf1ec('0x97')],'name':_0x55d3da[_0xf1ec('0xaf')][_0xf1ec('0xac')]['Label'],'custom':![],'options':_0x21cfd3};_0x36c198['push'](_0x307697);return _0x36c198;});}function getInputList(_0x4e3d65,_0x395983,_0x53231d,_0x6ee0cf,_0x321668,_0x340ac9,_0x476831){var _0xc77ca1={'method':_0xf1ec('0x8f'),'uri':_0x4e3d65+'EntityDefinitions('+_0x321668+')/Attributes('+_0x340ac9+_0xf1ec('0xb7')+_0x53231d+_0xf1ec('0xb8'),'headers':{'Authorization':'Bearer\x20'+_0x476831,'If-None-Match':null,'OData-Version':_0xf1ec('0x95')},'json':!![]};return rp(_0xc77ca1)[_0xf1ec('0x10')](function(_0x4289dc){var _0x16c58a={'id':_0x395983+'_'+_0x4289dc['LogicalName'],'name':_0x4289dc[_0xf1ec('0xaf')][_0xf1ec('0xac')]?_0x4289dc[_0xf1ec('0xaf')][_0xf1ec('0xac')][_0xf1ec('0xad')]:_0x4289dc[_0xf1ec('0x97')],'custom':![],'options':[]};_0x6ee0cf['push'](_0x16c58a);return _0x6ee0cf;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index a4d8e17..40db769 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(_0x3f8282,_0x11b607){var _0x50f918=function(_0x3a37de){while(--_0x3a37de){_0x3f8282['push'](_0x3f8282['shift']());}};_0x50f918(++_0x11b607);}(_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 _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x5233ec,_0x4a7573){var _0x2267b6=function(_0x5785c7){while(--_0x5785c7){_0x5233ec['push'](_0x5233ec['shift']());}};_0x2267b6(++_0x4a7573);}(_0x757a,0xde));var _0xa757=function(_0x10e0d0,_0x17a382){_0x10e0d0=_0x10e0d0-0x0;var _0x4c964a=_0x757a[_0x10e0d0];return _0x4c964a;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 1a59892..f2483ca 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 _0xf2de=['info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','include','map','model','debug','stringify','ShowDynamics365Account','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x54d76c,_0x786783){var _0x3422e3=function(_0x3ce30f){while(--_0x3ce30f){_0x54d76c['push'](_0x54d76c['shift']());}};_0x3422e3(++_0x786783);}(_0xf2de,0x197));var _0xef2d=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0xf2de[_0x13ce0c];return _0x4388fb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xef2d('0x0'));var BPromise=require(_0xef2d('0x1'));var rs=require(_0xef2d('0x2'));var fs=require('fs');var Redis=require(_0xef2d('0x3'));var db=require(_0xef2d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xef2d('0x5'))(_0xef2d('0x6'));var config=require(_0xef2d('0x7'));var jayson=require(_0xef2d('0x8'));var client=jayson[_0xef2d('0x9')][_0xef2d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37fad4,_0x28d0b2,_0x5bbebf){return new BPromise(function(_0x6b04f5,_0x36d10c){return client[_0xef2d('0xb')](_0x37fad4,_0x5bbebf)[_0xef2d('0xc')](function(_0x3f7c46){logger[_0xef2d('0xd')](_0xef2d('0xe'),_0x28d0b2,_0xef2d('0xf'));logger['debug'](_0xef2d('0x10'),_0x28d0b2,_0xef2d('0xf'),JSON['stringify'](_0x3f7c46));if(_0x3f7c46['error']){if(_0x3f7c46[_0xef2d('0x11')][_0xef2d('0x12')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x28d0b2,_0x3f7c46[_0xef2d('0x11')][_0xef2d('0x13')]);return _0x36d10c(_0x3f7c46['error'][_0xef2d('0x13')]);}logger[_0xef2d('0x11')](_0xef2d('0xe'),_0x28d0b2,_0x3f7c46[_0xef2d('0x11')]['message']);return _0x6b04f5(_0x3f7c46[_0xef2d('0x11')][_0xef2d('0x13')]);}else{logger[_0xef2d('0xd')]('Dynamics365Account,\x20%s,\x20%s',_0x28d0b2,_0xef2d('0xf'));_0x6b04f5(_0x3f7c46[_0xef2d('0x14')]['message']);}})[_0xef2d('0x15')](function(_0x4fd7f0){logger[_0xef2d('0x11')](_0xef2d('0xe'),_0x28d0b2,_0x4fd7f0);_0x36d10c(_0x4fd7f0);});});}exports[_0xef2d('0x16')]=function(_0x385d18){var _0x3f5ee6=this;return new Promise(function(_0x464a20,_0x418f42){return db[_0xef2d('0x17')][_0xef2d('0x18')]({'raw':_0x385d18[_0xef2d('0x19')]?_0x385d18['options'][_0xef2d('0x1a')]===undefined?!![]:![]:!![],'where':_0x385d18['options']?_0x385d18['options'][_0xef2d('0x1b')]||null:null,'attributes':_0x385d18[_0xef2d('0x19')]?_0x385d18['options'][_0xef2d('0x1c')]||null:null,'limit':_0x385d18[_0xef2d('0x19')]?_0x385d18[_0xef2d('0x19')]['limit']||null:null,'include':_0x385d18['options']?_0x385d18[_0xef2d('0x19')][_0xef2d('0x1d')]?_[_0xef2d('0x1e')](_0x385d18[_0xef2d('0x19')][_0xef2d('0x1d')],function(_0x239a97){return{'model':db[_0x239a97[_0xef2d('0x1f')]],'as':_0x239a97['as'],'attributes':_0x239a97[_0xef2d('0x1c')],'include':_0x239a97['include']?_['map'](_0x239a97[_0xef2d('0x1d')],function(_0xcb88cb){return{'model':db[_0xcb88cb[_0xef2d('0x1f')]],'as':_0xcb88cb['as'],'attributes':_0xcb88cb[_0xef2d('0x1c')],'include':_0xcb88cb[_0xef2d('0x1d')]?_[_0xef2d('0x1e')](_0xcb88cb['include'],function(_0x35d2dc){return{'model':db[_0x35d2dc['model']],'as':_0x35d2dc['as'],'attributes':_0x35d2dc[_0xef2d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xef2d('0xc')](function(_0x408721){logger[_0xef2d('0xd')](_0xef2d('0x16'),_0x385d18);logger[_0xef2d('0x20')](_0xef2d('0x16'),_0x385d18,JSON[_0xef2d('0x21')](_0x408721));_0x464a20(_0x408721);})['catch'](function(_0x5836f4){logger[_0xef2d('0x11')](_0xef2d('0x16'),_0x5836f4[_0xef2d('0x13')],_0x385d18);_0x418f42(_0x3f5ee6[_0xef2d('0x11')](0x1f4,_0x5836f4[_0xef2d('0x13')]));});});};exports[_0xef2d('0x22')]=function(_0x2979a3){var _0x39809a=this;return new Promise(function(_0x1efdf2,_0x5e1149){return db[_0xef2d('0x17')]['find']({'raw':_0x2979a3[_0xef2d('0x19')]?_0x2979a3[_0xef2d('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2979a3[_0xef2d('0x19')]?_0x2979a3[_0xef2d('0x19')][_0xef2d('0x1b')]||null:null,'attributes':_0x2979a3[_0xef2d('0x19')]?_0x2979a3['options'][_0xef2d('0x1c')]||null:null,'include':_0x2979a3[_0xef2d('0x19')]?_0x2979a3[_0xef2d('0x19')][_0xef2d('0x1d')]?_[_0xef2d('0x1e')](_0x2979a3['options'][_0xef2d('0x1d')],function(_0x2a5283){return{'model':db[_0x2a5283[_0xef2d('0x1f')]],'as':_0x2a5283['as'],'attributes':_0x2a5283['attributes'],'include':_0x2a5283[_0xef2d('0x1d')]?_[_0xef2d('0x1e')](_0x2a5283[_0xef2d('0x1d')],function(_0x274d78){return{'model':db[_0x274d78['model']],'as':_0x274d78['as'],'attributes':_0x274d78[_0xef2d('0x1c')],'include':_0x274d78[_0xef2d('0x1d')]?_[_0xef2d('0x1e')](_0x274d78[_0xef2d('0x1d')],function(_0x9b6dff){return{'model':db[_0x9b6dff[_0xef2d('0x1f')]],'as':_0x9b6dff['as'],'attributes':_0x9b6dff[_0xef2d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xef2d('0xc')](function(_0x16e178){logger['info'](_0xef2d('0x22'),_0x2979a3);logger['debug'](_0xef2d('0x22'),_0x2979a3,JSON[_0xef2d('0x21')](_0x16e178));_0x1efdf2(_0x16e178);})['catch'](function(_0xd219ad){logger['error']('ShowDynamics365Account',_0xd219ad['message'],_0x2979a3);_0x5e1149(_0x39809a[_0xef2d('0x11')](0x1f4,_0xd219ad[_0xef2d('0x13')]));});});}; \ No newline at end of file +var _0xa29e=['Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','raw','options','where','attributes','limit','include','map','model','ShowDynamics365Account','find','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x36939b,_0x533400){var _0x10a109=function(_0x32c7a1){while(--_0x32c7a1){_0x36939b['push'](_0x36939b['shift']());}};_0x10a109(++_0x533400);}(_0xa29e,0x85));var _0xea29=function(_0x217cfd,_0x1e3094){_0x217cfd=_0x217cfd-0x0;var _0x1e887f=_0xa29e[_0x217cfd];return _0x1e887f;};'use strict';var _=require(_0xea29('0x0'));var util=require(_0xea29('0x1'));var moment=require('moment');var BPromise=require(_0xea29('0x2'));var rs=require(_0xea29('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xea29('0x4'))['db'];var utils=require(_0xea29('0x5'));var logger=require(_0xea29('0x6'))(_0xea29('0x7'));var config=require(_0xea29('0x8'));var jayson=require(_0xea29('0x9'));var client=jayson[_0xea29('0xa')][_0xea29('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c34c0,_0x18e933,_0xcc4354){return new BPromise(function(_0x48d7c7,_0x9d264){return client[_0xea29('0xc')](_0x1c34c0,_0xcc4354)[_0xea29('0xd')](function(_0x42cec1){logger[_0xea29('0xe')](_0xea29('0xf'),_0x18e933,_0xea29('0x10'));logger[_0xea29('0x11')](_0xea29('0x12'),_0x18e933,_0xea29('0x10'),JSON[_0xea29('0x13')](_0x42cec1));if(_0x42cec1[_0xea29('0x14')]){if(_0x42cec1['error'][_0xea29('0x15')]===0x1f4){logger[_0xea29('0x14')]('Dynamics365Account,\x20%s,\x20%s',_0x18e933,_0x42cec1['error'][_0xea29('0x16')]);return _0x9d264(_0x42cec1['error'][_0xea29('0x16')]);}logger[_0xea29('0x14')](_0xea29('0xf'),_0x18e933,_0x42cec1[_0xea29('0x14')][_0xea29('0x16')]);return _0x48d7c7(_0x42cec1['error'][_0xea29('0x16')]);}else{logger['info'](_0xea29('0xf'),_0x18e933,'request\x20sent');_0x48d7c7(_0x42cec1[_0xea29('0x17')][_0xea29('0x16')]);}})[_0xea29('0x18')](function(_0x23b9c8){logger[_0xea29('0x14')]('Dynamics365Account,\x20%s,\x20%s',_0x18e933,_0x23b9c8);_0x9d264(_0x23b9c8);});});}exports[_0xea29('0x19')]=function(_0x3ed0df){var _0x534cf1=this;return new Promise(function(_0x369295,_0x40cb69){return db[_0xea29('0x1a')]['findAll']({'raw':_0x3ed0df['options']?_0x3ed0df['options'][_0xea29('0x1b')]===undefined?!![]:![]:!![],'where':_0x3ed0df['options']?_0x3ed0df[_0xea29('0x1c')][_0xea29('0x1d')]||null:null,'attributes':_0x3ed0df['options']?_0x3ed0df['options'][_0xea29('0x1e')]||null:null,'limit':_0x3ed0df[_0xea29('0x1c')]?_0x3ed0df['options'][_0xea29('0x1f')]||null:null,'include':_0x3ed0df['options']?_0x3ed0df[_0xea29('0x1c')][_0xea29('0x20')]?_[_0xea29('0x21')](_0x3ed0df[_0xea29('0x1c')]['include'],function(_0x748908){return{'model':db[_0x748908['model']],'as':_0x748908['as'],'attributes':_0x748908[_0xea29('0x1e')],'include':_0x748908[_0xea29('0x20')]?_['map'](_0x748908['include'],function(_0x450bdb){return{'model':db[_0x450bdb['model']],'as':_0x450bdb['as'],'attributes':_0x450bdb[_0xea29('0x1e')],'include':_0x450bdb[_0xea29('0x20')]?_['map'](_0x450bdb[_0xea29('0x20')],function(_0x2bc6ee){return{'model':db[_0x2bc6ee[_0xea29('0x22')]],'as':_0x2bc6ee['as'],'attributes':_0x2bc6ee['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x59b6c5){logger[_0xea29('0xe')](_0xea29('0x19'),_0x3ed0df);logger[_0xea29('0x11')]('GetDynamics365Account',_0x3ed0df,JSON[_0xea29('0x13')](_0x59b6c5));_0x369295(_0x59b6c5);})[_0xea29('0x18')](function(_0x260776){logger[_0xea29('0x14')](_0xea29('0x19'),_0x260776[_0xea29('0x16')],_0x3ed0df);_0x40cb69(_0x534cf1['error'](0x1f4,_0x260776[_0xea29('0x16')]));});});};exports[_0xea29('0x23')]=function(_0x514f4f){var _0x39ba84=this;return new Promise(function(_0x38d54d,_0x4386df){return db['Dynamics365Account'][_0xea29('0x24')]({'raw':_0x514f4f[_0xea29('0x1c')]?_0x514f4f[_0xea29('0x1c')][_0xea29('0x1b')]===undefined?!![]:![]:!![],'where':_0x514f4f[_0xea29('0x1c')]?_0x514f4f[_0xea29('0x1c')][_0xea29('0x1d')]||null:null,'attributes':_0x514f4f[_0xea29('0x1c')]?_0x514f4f[_0xea29('0x1c')][_0xea29('0x1e')]||null:null,'include':_0x514f4f[_0xea29('0x1c')]?_0x514f4f[_0xea29('0x1c')][_0xea29('0x20')]?_['map'](_0x514f4f[_0xea29('0x1c')][_0xea29('0x20')],function(_0x5ba1d1){return{'model':db[_0x5ba1d1[_0xea29('0x22')]],'as':_0x5ba1d1['as'],'attributes':_0x5ba1d1[_0xea29('0x1e')],'include':_0x5ba1d1[_0xea29('0x20')]?_[_0xea29('0x21')](_0x5ba1d1['include'],function(_0xb7aeec){return{'model':db[_0xb7aeec['model']],'as':_0xb7aeec['as'],'attributes':_0xb7aeec[_0xea29('0x1e')],'include':_0xb7aeec['include']?_[_0xea29('0x21')](_0xb7aeec[_0xea29('0x20')],function(_0x5c27b9){return{'model':db[_0x5c27b9[_0xea29('0x22')]],'as':_0x5c27b9['as'],'attributes':_0x5c27b9[_0xea29('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xea29('0xd')](function(_0x103e16){logger[_0xea29('0xe')](_0xea29('0x23'),_0x514f4f);logger[_0xea29('0x11')](_0xea29('0x23'),_0x514f4f,JSON[_0xea29('0x13')](_0x103e16));_0x38d54d(_0x103e16);})[_0xea29('0x18')](function(_0x7c2593){logger['error'](_0xea29('0x23'),_0x7c2593[_0xea29('0x16')],_0x514f4f);_0x4386df(_0x39ba84[_0xea29('0x14')](0x1f4,_0x7c2593['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 41ebbec..4e45632 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 _0x9e6b=['connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','exports','multer','util'];(function(_0x58c798,_0x2316b3){var _0x1c2c79=function(_0x463813){while(--_0x463813){_0x58c798['push'](_0x58c798['shift']());}};_0x1c2c79(++_0x2316b3);}(_0x9e6b,0x11c));var _0xb9e6=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x9e6b[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0xb9e6('0x0'));var util=require(_0xb9e6('0x1'));var path=require('path');var timeout=require(_0xb9e6('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb9e6('0x3'));var auth=require(_0xb9e6('0x4'));var interaction=require(_0xb9e6('0x5'));var config=require(_0xb9e6('0x6'));var controller=require('./intDynamics365Configuration.controller');router[_0xb9e6('0x7')]('/',auth[_0xb9e6('0x8')](),controller[_0xb9e6('0x9')]);router['get'](_0xb9e6('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0xb9e6('0xb'),auth['isAuthenticated'](),controller[_0xb9e6('0xc')]);router[_0xb9e6('0x7')](_0xb9e6('0xd'),auth[_0xb9e6('0x8')](),controller[_0xb9e6('0xe')]);router[_0xb9e6('0x7')](_0xb9e6('0xf'),auth[_0xb9e6('0x8')](),controller[_0xb9e6('0x10')]);router[_0xb9e6('0x11')]('/',auth['isAuthenticated'](),controller[_0xb9e6('0x12')]);router[_0xb9e6('0x13')](_0xb9e6('0xa'),auth[_0xb9e6('0x8')](),controller['update']);router[_0xb9e6('0x14')](_0xb9e6('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xb9e6('0x15')]=router; \ No newline at end of file +var _0xfbf1=['fs-extra','../../components/interaction/service','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','getDescriptions','delete','destroy','exports','util','connect-timeout','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfbf1,0x10b));var _0x1fbf=function(_0x1d4bd1,_0x14729b){_0x1d4bd1=_0x1d4bd1-0x0;var _0x3323fb=_0xfbf1[_0x1d4bd1];return _0x3323fb;};'use strict';var multer=require('multer');var util=require(_0x1fbf('0x0'));var path=require('path');var timeout=require(_0x1fbf('0x1'));var express=require('express');var router=express[_0x1fbf('0x2')]();var fs_extra=require(_0x1fbf('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1fbf('0x4'));var config=require('../../config/environment');var controller=require(_0x1fbf('0x5'));router[_0x1fbf('0x6')]('/',auth[_0x1fbf('0x7')](),controller[_0x1fbf('0x8')]);router[_0x1fbf('0x6')](_0x1fbf('0x9'),auth['isAuthenticated'](),controller[_0x1fbf('0xa')]);router['get'](_0x1fbf('0xb'),auth[_0x1fbf('0x7')](),controller[_0x1fbf('0xc')]);router[_0x1fbf('0x6')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x1fbf('0xd')]);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0x1fbf('0xe')]);router['post']('/',auth[_0x1fbf('0x7')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x1fbf('0xf')](_0x1fbf('0x9'),auth[_0x1fbf('0x7')](),controller[_0x1fbf('0x10')]);module[_0x1fbf('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 274199d..b568f35 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 _0xa3fd=['sequelize','exports','STRING','ENUM','nothing','contact'];(function(_0x5aefda,_0x1791d0){var _0x42caa8=function(_0x568c26){while(--_0x568c26){_0x5aefda['push'](_0x5aefda['shift']());}};_0x42caa8(++_0x1791d0);}(_0xa3fd,0x144));var _0xda3f=function(_0x47623f,_0x148f3a){_0x47623f=_0x47623f-0x0;var _0x282ce8=_0xa3fd[_0x47623f];return _0x282ce8;};'use strict';var Sequelize=require(_0xda3f('0x0'));module[_0xda3f('0x1')]={'name':{'type':Sequelize[_0xda3f('0x2')]},'description':{'type':Sequelize[_0xda3f('0x2')]},'ticketType':{'type':Sequelize[_0xda3f('0x3')]('incident','phonecall'),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0xda3f('0x3')]('contact',_0xda3f('0x4')),'defaultValue':_0xda3f('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xda3f('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xe4bf=['nothing','BOOLEAN','exports','STRING','ENUM','incident','contact'];(function(_0x3c8893,_0x3bb73e){var _0x3f9f4b=function(_0x427a21){while(--_0x427a21){_0x3c8893['push'](_0x3c8893['shift']());}};_0x3f9f4b(++_0x3bb73e);}(_0xe4bf,0xb1));var _0xfe4b=function(_0x68c4d9,_0x419b3c){_0x68c4d9=_0x68c4d9-0x0;var _0x62da93=_0xe4bf[_0x68c4d9];return _0x62da93;};'use strict';var Sequelize=require('sequelize');module[_0xfe4b('0x0')]={'name':{'type':Sequelize[_0xfe4b('0x1')]},'description':{'type':Sequelize[_0xfe4b('0x1')]},'ticketType':{'type':Sequelize[_0xfe4b('0x2')]('incident','phonecall'),'defaultValue':_0xfe4b('0x3')},'moduleCreate':{'type':Sequelize[_0xfe4b('0x2')](_0xfe4b('0x4'),_0xfe4b('0x5')),'defaultValue':_0xfe4b('0x4'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xfe4b('0x1')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xfe4b('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 0600422..6f5d99c 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 _0xe520=['model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','catch','find','create','body','update','params','getFields','Dynamics365Field','length','getSubjects','findOne','getDescriptions','hasOwnProperty','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','Dynamics365Configuration','rawAttributes','fieldName','type'];(function(_0x52d785,_0x274866){var _0x360cc5=function(_0x393127){while(--_0x393127){_0x52d785['push'](_0x52d785['shift']());}};_0x360cc5(++_0x274866);}(_0xe520,0x16d));var _0x0e52=function(_0x17f575,_0x475f2d){_0x17f575=_0x17f575-0x0;var _0x18c832=_0xe520[_0x17f575];return _0x18c832;};'use strict';var emlformat=require(_0x0e52('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0e52('0x1'));var moment=require(_0x0e52('0x2'));var BPromise=require(_0x0e52('0x3'));var Mustache=require(_0x0e52('0x4'));var util=require(_0x0e52('0x5'));var path=require(_0x0e52('0x6'));var sox=require(_0x0e52('0x7'));var csv=require(_0x0e52('0x8'));var ejs=require(_0x0e52('0x9'));var fs=require('fs');var fs_extra=require(_0x0e52('0xa'));var _=require(_0x0e52('0xb'));var squel=require(_0x0e52('0xc'));var crypto=require(_0x0e52('0xd'));var jsforce=require(_0x0e52('0xe'));var deskjs=require(_0x0e52('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0e52('0x10'));var Redis=require(_0x0e52('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0e52('0x12'));var as=require(_0x0e52('0x13'));var hardwareService=require(_0x0e52('0x14'));var logger=require(_0x0e52('0x15'))(_0x0e52('0x16'));var utils=require('../../config/utils');var config=require(_0x0e52('0x17'));var licenseUtil=require(_0x0e52('0x18'));var db=require(_0x0e52('0x19'))['db'];function respondWithStatusCode(_0x1e759c,_0x5c1780){_0x5c1780=_0x5c1780||0xcc;return function(_0x3a8c21){if(_0x3a8c21){return _0x1e759c[_0x0e52('0x1a')](_0x5c1780);}return _0x1e759c[_0x0e52('0x1b')](_0x5c1780)[_0x0e52('0x1c')]();};}function respondWithResult(_0x3c0e09,_0x4562aa){_0x4562aa=_0x4562aa||0xc8;return function(_0x1ccc9b){if(_0x1ccc9b){return _0x3c0e09['status'](_0x4562aa)[_0x0e52('0x1d')](_0x1ccc9b);}};}function respondWithFilteredResult(_0x20aa29,_0x13d88d){return function(_0x1c60bf){if(_0x1c60bf){var _0x30285f=typeof _0x13d88d[_0x0e52('0x1e')]===_0x0e52('0x1f')&&typeof _0x13d88d[_0x0e52('0x20')]===_0x0e52('0x1f');var _0x1fe5ac=_0x1c60bf[_0x0e52('0x21')];var _0x287cc2=_0x30285f?0x0:_0x13d88d[_0x0e52('0x1e')];var _0x12a69f=_0x30285f?_0x1c60bf[_0x0e52('0x21')]:_0x13d88d[_0x0e52('0x1e')]+_0x13d88d[_0x0e52('0x20')];var _0xd87f41;if(_0x12a69f>=_0x1fe5ac){_0x12a69f=_0x1fe5ac;_0xd87f41=0xc8;}else{_0xd87f41=0xce;}_0x20aa29[_0x0e52('0x1b')](_0xd87f41);return _0x20aa29[_0x0e52('0x22')](_0x0e52('0x23'),_0x287cc2+'-'+_0x12a69f+'/'+_0x1fe5ac)[_0x0e52('0x1d')](_0x1c60bf);}return null;};}function patchUpdates(_0x4c13c3){return function(_0x210ba2){try{jsonpatch[_0x0e52('0x24')](_0x210ba2,_0x4c13c3,!![]);}catch(_0x46ae09){return BPromise[_0x0e52('0x25')](_0x46ae09);}return _0x210ba2[_0x0e52('0x26')]();};}function saveUpdates(_0x7f75e6,_0x22b2f0){return function(_0x201a4e){if(_0x201a4e){return _0x201a4e['update'](_0x7f75e6)[_0x0e52('0x27')](function(_0x16a897){return _0x16a897;});}return null;};}function removeEntity(_0x183ecb,_0x417567){return function(_0x431afa){if(_0x431afa){return _0x431afa[_0x0e52('0x28')]()[_0x0e52('0x27')](function(){_0x183ecb[_0x0e52('0x1b')](0xcc)[_0x0e52('0x1c')]();});}};}function handleEntityNotFound(_0x3ce8f4,_0x2826bc){return function(_0x3b0e04){if(!_0x3b0e04){_0x3ce8f4[_0x0e52('0x1a')](0x194);}return _0x3b0e04;};}function handleError(_0x46c1c2,_0x5f3126){_0x5f3126=_0x5f3126||0x1f4;return function(_0x5e0acc){logger[_0x0e52('0x29')](_0x5e0acc[_0x0e52('0x2a')]);if(_0x5e0acc[_0x0e52('0x2b')]){delete _0x5e0acc[_0x0e52('0x2b')];}_0x46c1c2[_0x0e52('0x1b')](_0x5f3126)[_0x0e52('0x2c')](_0x5e0acc);};}exports[_0x0e52('0x2d')]=function(_0x31ed51,_0x42ecba){var _0x58045e={},_0x26b5fb={},_0x52a0f3={'count':0x0,'rows':[]};var _0x44917c=_['map'](db[_0x0e52('0x2e')][_0x0e52('0x2f')],function(_0x48e511){return{'name':_0x48e511[_0x0e52('0x30')],'type':_0x48e511[_0x0e52('0x31')]['key']};});_0x26b5fb[_0x0e52('0x32')]=_['map'](_0x44917c,_0x0e52('0x2b'));_0x26b5fb[_0x0e52('0x33')]=_[_0x0e52('0x34')](_0x31ed51[_0x0e52('0x33')]);_0x26b5fb[_0x0e52('0x35')]=_[_0x0e52('0x36')](_0x26b5fb[_0x0e52('0x32')],_0x26b5fb[_0x0e52('0x33')]);_0x58045e[_0x0e52('0x37')]=_[_0x0e52('0x36')](_0x26b5fb[_0x0e52('0x32')],qs[_0x0e52('0x38')](_0x31ed51[_0x0e52('0x33')][_0x0e52('0x38')]));_0x58045e['attributes']=_0x58045e[_0x0e52('0x37')]['length']?_0x58045e[_0x0e52('0x37')]:_0x26b5fb[_0x0e52('0x32')];if(!_0x31ed51[_0x0e52('0x33')]['hasOwnProperty'](_0x0e52('0x39'))){_0x58045e[_0x0e52('0x20')]=qs[_0x0e52('0x20')](_0x31ed51[_0x0e52('0x33')][_0x0e52('0x20')]);_0x58045e['offset']=qs[_0x0e52('0x1e')](_0x31ed51[_0x0e52('0x33')]['offset']);}_0x58045e[_0x0e52('0x3a')]=qs[_0x0e52('0x3b')](_0x31ed51[_0x0e52('0x33')][_0x0e52('0x3b')]);_0x58045e[_0x0e52('0x3c')]=qs['filters'](_[_0x0e52('0x3d')](_0x31ed51[_0x0e52('0x33')],_0x26b5fb[_0x0e52('0x35')]),_0x44917c);if(_0x31ed51[_0x0e52('0x33')][_0x0e52('0x3e')]){_0x58045e[_0x0e52('0x3c')]=_[_0x0e52('0x3f')](_0x58045e[_0x0e52('0x3c')],{'$or':_[_0x0e52('0x40')](_0x44917c,function(_0x4da418){if(_0x4da418[_0x0e52('0x31')]!==_0x0e52('0x41')){var _0x3bffc9={};_0x3bffc9[_0x4da418[_0x0e52('0x2b')]]={'$like':'%'+_0x31ed51[_0x0e52('0x33')]['filter']+'%'};return _0x3bffc9;}})});}_0x58045e=_[_0x0e52('0x3f')]({},_0x58045e,_0x31ed51[_0x0e52('0x42')]);var _0x24b5a0={'where':_0x58045e[_0x0e52('0x3c')]};return db[_0x0e52('0x2e')][_0x0e52('0x21')](_0x24b5a0)['then'](function(_0x162da9){_0x52a0f3[_0x0e52('0x21')]=_0x162da9;if(_0x31ed51[_0x0e52('0x33')][_0x0e52('0x43')]){_0x58045e[_0x0e52('0x44')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x0e52('0x45')](_0x58045e);})[_0x0e52('0x27')](function(_0xf7c758){_0x52a0f3['rows']=_0xf7c758;return _0x52a0f3;})[_0x0e52('0x27')](respondWithFilteredResult(_0x42ecba,_0x58045e))[_0x0e52('0x46')](handleError(_0x42ecba,null));};exports['show']=function(_0x2d4064,_0x19a044){var _0x321502={'raw':![],'where':{'id':_0x2d4064['params']['id']}},_0x2f7b70={};_0x2f7b70[_0x0e52('0x32')]=_[_0x0e52('0x34')](db[_0x0e52('0x2e')][_0x0e52('0x2f')]);_0x2f7b70['query']=_[_0x0e52('0x34')](_0x2d4064['query']);_0x2f7b70[_0x0e52('0x35')]=_[_0x0e52('0x36')](_0x2f7b70[_0x0e52('0x32')],_0x2f7b70['query']);_0x321502['attributes']=_['intersection'](_0x2f7b70[_0x0e52('0x32')],qs[_0x0e52('0x38')](_0x2d4064['query']['fields']));_0x321502[_0x0e52('0x37')]=_0x321502[_0x0e52('0x37')]['length']?_0x321502[_0x0e52('0x37')]:_0x2f7b70['model'];if(_0x2d4064[_0x0e52('0x33')][_0x0e52('0x43')]){_0x321502['include']=[{'all':!![]}];}_0x321502=_['merge']({},_0x321502,_0x2d4064[_0x0e52('0x42')]);return db[_0x0e52('0x2e')][_0x0e52('0x47')](_0x321502)[_0x0e52('0x27')](handleEntityNotFound(_0x19a044,null))[_0x0e52('0x27')](respondWithResult(_0x19a044,null))[_0x0e52('0x46')](handleError(_0x19a044,null));};exports[_0x0e52('0x48')]=function(_0x24f40e,_0x262669){return db['Dynamics365Configuration'][_0x0e52('0x48')](_0x24f40e[_0x0e52('0x49')],{})['then'](respondWithResult(_0x262669,0xc9))[_0x0e52('0x46')](handleError(_0x262669,null));};exports[_0x0e52('0x4a')]=function(_0x43b1af,_0x1d51da){if(_0x43b1af['body']['id']){delete _0x43b1af[_0x0e52('0x49')]['id'];}return db['Dynamics365Configuration'][_0x0e52('0x47')]({'where':{'id':_0x43b1af['params']['id']}})[_0x0e52('0x27')](handleEntityNotFound(_0x1d51da,null))[_0x0e52('0x27')](saveUpdates(_0x43b1af[_0x0e52('0x49')],null))[_0x0e52('0x27')](respondWithResult(_0x1d51da,null))['catch'](handleError(_0x1d51da,null));};exports[_0x0e52('0x28')]=function(_0x4c35ae,_0x19d5dd){return db[_0x0e52('0x2e')][_0x0e52('0x47')]({'where':{'id':_0x4c35ae[_0x0e52('0x4b')]['id']}})[_0x0e52('0x27')](handleEntityNotFound(_0x19d5dd,null))['then'](removeEntity(_0x19d5dd,null))['catch'](handleError(_0x19d5dd,null));};exports[_0x0e52('0x4c')]=function(_0x2b94c6,_0x36e06f,_0x3d0a3e){var _0x52d62f={};var _0x4aa685={};var _0x34c695;var _0x3ed56e;return db[_0x0e52('0x2e')]['findOne']({'where':{'id':_0x2b94c6[_0x0e52('0x4b')]['id']}})[_0x0e52('0x27')](handleEntityNotFound(_0x36e06f,null))[_0x0e52('0x27')](function(_0x16842b){if(_0x16842b){_0x34c695=_0x16842b;_0x4aa685[_0x0e52('0x32')]=_[_0x0e52('0x34')](db[_0x0e52('0x4d')][_0x0e52('0x2f')]);_0x4aa685[_0x0e52('0x33')]=_['keys'](_0x2b94c6[_0x0e52('0x33')]);_0x4aa685['filters']=_[_0x0e52('0x36')](_0x4aa685['model'],_0x4aa685['query']);_0x52d62f[_0x0e52('0x37')]=_[_0x0e52('0x36')](_0x4aa685[_0x0e52('0x32')],qs['fields'](_0x2b94c6['query'][_0x0e52('0x38')]));_0x52d62f[_0x0e52('0x37')]=_0x52d62f[_0x0e52('0x37')][_0x0e52('0x4e')]?_0x52d62f[_0x0e52('0x37')]:_0x4aa685['model'];_0x52d62f[_0x0e52('0x3a')]=qs[_0x0e52('0x3b')](_0x2b94c6['query'][_0x0e52('0x3b')]);_0x52d62f[_0x0e52('0x3c')]=qs[_0x0e52('0x35')](_[_0x0e52('0x3d')](_0x2b94c6[_0x0e52('0x33')],_0x4aa685[_0x0e52('0x35')]));if(_0x2b94c6[_0x0e52('0x33')][_0x0e52('0x3e')]){_0x52d62f['where']=_[_0x0e52('0x3f')](_0x52d62f['where'],{'$or':_[_0x0e52('0x40')](_0x52d62f[_0x0e52('0x37')],function(_0x5892c8){var _0x36a7f2={};_0x36a7f2[_0x5892c8]={'$like':'%'+_0x2b94c6[_0x0e52('0x33')][_0x0e52('0x3e')]+'%'};return _0x36a7f2;})});}_0x52d62f=_[_0x0e52('0x3f')]({},_0x52d62f,_0x2b94c6[_0x0e52('0x42')]);return _0x34c695[_0x0e52('0x4c')](_0x52d62f);}})['then'](function(_0x3a9cf2){if(_0x3a9cf2){_0x3ed56e=_0x3a9cf2[_0x0e52('0x4e')];if(!_0x2b94c6[_0x0e52('0x33')]['hasOwnProperty'](_0x0e52('0x39'))){_0x52d62f[_0x0e52('0x20')]=qs[_0x0e52('0x20')](_0x2b94c6['query'][_0x0e52('0x20')]);_0x52d62f[_0x0e52('0x1e')]=qs[_0x0e52('0x1e')](_0x2b94c6['query']['offset']);}return _0x34c695['getFields'](_0x52d62f);}})['then'](function(_0xb8e9dc){if(_0xb8e9dc){return _0xb8e9dc?{'count':_0x3ed56e,'rows':_0xb8e9dc}:null;}})['then'](respondWithResult(_0x36e06f,null))[_0x0e52('0x46')](handleError(_0x36e06f,null));};exports[_0x0e52('0x4f')]=function(_0x54271c,_0x1bab03,_0xcbb6d8){var _0x286a91={};var _0x1ca2ff={};var _0x2c898a;var _0x3cfb35;return db[_0x0e52('0x2e')][_0x0e52('0x50')]({'where':{'id':_0x54271c[_0x0e52('0x4b')]['id']}})[_0x0e52('0x27')](handleEntityNotFound(_0x1bab03,null))[_0x0e52('0x27')](function(_0x4bf3e3){if(_0x4bf3e3){_0x2c898a=_0x4bf3e3;_0x1ca2ff[_0x0e52('0x32')]=_[_0x0e52('0x34')](db[_0x0e52('0x4d')][_0x0e52('0x2f')]);_0x1ca2ff[_0x0e52('0x33')]=_[_0x0e52('0x34')](_0x54271c[_0x0e52('0x33')]);_0x1ca2ff['filters']=_[_0x0e52('0x36')](_0x1ca2ff['model'],_0x1ca2ff[_0x0e52('0x33')]);_0x286a91[_0x0e52('0x37')]=_[_0x0e52('0x36')](_0x1ca2ff['model'],qs[_0x0e52('0x38')](_0x54271c[_0x0e52('0x33')][_0x0e52('0x38')]));_0x286a91[_0x0e52('0x37')]=_0x286a91[_0x0e52('0x37')][_0x0e52('0x4e')]?_0x286a91[_0x0e52('0x37')]:_0x1ca2ff[_0x0e52('0x32')];_0x286a91[_0x0e52('0x3a')]=qs['sort'](_0x54271c[_0x0e52('0x33')][_0x0e52('0x3b')]);_0x286a91[_0x0e52('0x3c')]=qs[_0x0e52('0x35')](_['pick'](_0x54271c[_0x0e52('0x33')],_0x1ca2ff[_0x0e52('0x35')]));if(_0x54271c[_0x0e52('0x33')][_0x0e52('0x3e')]){_0x286a91[_0x0e52('0x3c')]=_[_0x0e52('0x3f')](_0x286a91['where'],{'$or':_[_0x0e52('0x40')](_0x286a91[_0x0e52('0x37')],function(_0x2e9fbb){var _0x491e1b={};_0x491e1b[_0x2e9fbb]={'$like':'%'+_0x54271c[_0x0e52('0x33')][_0x0e52('0x3e')]+'%'};return _0x491e1b;})});}_0x286a91=_['merge']({},_0x286a91,_0x54271c[_0x0e52('0x42')]);return _0x2c898a['getSubjects'](_0x286a91);}})[_0x0e52('0x27')](function(_0x26ea24){if(_0x26ea24){_0x3cfb35=_0x26ea24[_0x0e52('0x4e')];if(!_0x54271c[_0x0e52('0x33')]['hasOwnProperty']('nolimit')){_0x286a91[_0x0e52('0x20')]=qs[_0x0e52('0x20')](_0x54271c[_0x0e52('0x33')]['limit']);_0x286a91[_0x0e52('0x1e')]=qs[_0x0e52('0x1e')](_0x54271c[_0x0e52('0x33')][_0x0e52('0x1e')]);}return _0x2c898a[_0x0e52('0x4f')](_0x286a91);}})[_0x0e52('0x27')](function(_0x193929){if(_0x193929){return _0x193929?{'count':_0x3cfb35,'rows':_0x193929}:null;}})[_0x0e52('0x27')](respondWithResult(_0x1bab03,null))[_0x0e52('0x46')](handleError(_0x1bab03,null));};exports[_0x0e52('0x51')]=function(_0x305158,_0x430fef,_0x13aba9){var _0x1ead2b={};var _0x1213a1={};var _0x29ee6c;var _0x1b6d0a;return db[_0x0e52('0x2e')]['findOne']({'where':{'id':_0x305158[_0x0e52('0x4b')]['id']}})[_0x0e52('0x27')](handleEntityNotFound(_0x430fef,null))[_0x0e52('0x27')](function(_0x96c3bc){if(_0x96c3bc){_0x29ee6c=_0x96c3bc;_0x1213a1[_0x0e52('0x32')]=_['keys'](db[_0x0e52('0x4d')][_0x0e52('0x2f')]);_0x1213a1['query']=_[_0x0e52('0x34')](_0x305158[_0x0e52('0x33')]);_0x1213a1[_0x0e52('0x35')]=_[_0x0e52('0x36')](_0x1213a1[_0x0e52('0x32')],_0x1213a1[_0x0e52('0x33')]);_0x1ead2b['attributes']=_['intersection'](_0x1213a1[_0x0e52('0x32')],qs['fields'](_0x305158[_0x0e52('0x33')][_0x0e52('0x38')]));_0x1ead2b[_0x0e52('0x37')]=_0x1ead2b[_0x0e52('0x37')][_0x0e52('0x4e')]?_0x1ead2b[_0x0e52('0x37')]:_0x1213a1[_0x0e52('0x32')];_0x1ead2b[_0x0e52('0x3a')]=qs['sort'](_0x305158[_0x0e52('0x33')][_0x0e52('0x3b')]);_0x1ead2b[_0x0e52('0x3c')]=qs[_0x0e52('0x35')](_[_0x0e52('0x3d')](_0x305158['query'],_0x1213a1['filters']));if(_0x305158[_0x0e52('0x33')][_0x0e52('0x3e')]){_0x1ead2b[_0x0e52('0x3c')]=_[_0x0e52('0x3f')](_0x1ead2b['where'],{'$or':_[_0x0e52('0x40')](_0x1ead2b[_0x0e52('0x37')],function(_0x1be208){var _0x410761={};_0x410761[_0x1be208]={'$like':'%'+_0x305158['query'][_0x0e52('0x3e')]+'%'};return _0x410761;})});}_0x1ead2b=_[_0x0e52('0x3f')]({},_0x1ead2b,_0x305158['options']);return _0x29ee6c[_0x0e52('0x51')](_0x1ead2b);}})[_0x0e52('0x27')](function(_0x3db120){if(_0x3db120){_0x1b6d0a=_0x3db120[_0x0e52('0x4e')];if(!_0x305158['query'][_0x0e52('0x52')]('nolimit')){_0x1ead2b[_0x0e52('0x20')]=qs[_0x0e52('0x20')](_0x305158[_0x0e52('0x33')][_0x0e52('0x20')]);_0x1ead2b[_0x0e52('0x1e')]=qs[_0x0e52('0x1e')](_0x305158['query'][_0x0e52('0x1e')]);}return _0x29ee6c['getDescriptions'](_0x1ead2b);}})[_0x0e52('0x27')](function(_0x562900){if(_0x562900){return _0x562900?{'count':_0x1b6d0a,'rows':_0x562900}:null;}})['then'](respondWithResult(_0x430fef,null))[_0x0e52('0x46')](handleError(_0x430fef,null));}; \ No newline at end of file +var _0x6fe9=['intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','show','params','length','includeAll','find','catch','body','getFields','findOne','Dynamics365Field','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','save','then','destroy','sendStatus','stack','name','send','map','Dynamics365Configuration','rawAttributes','type','key','model','query','keys','filters'];(function(_0x5e4364,_0xddefe5){var _0x463eaa=function(_0x12a2e6){while(--_0x12a2e6){_0x5e4364['push'](_0x5e4364['shift']());}};_0x463eaa(++_0xddefe5);}(_0x6fe9,0x102));var _0x96fe=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x6fe9[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require(_0x96fe('0x0'));var rimraf=require(_0x96fe('0x1'));var zipdir=require(_0x96fe('0x2'));var jsonpatch=require(_0x96fe('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x96fe('0x4'));var util=require(_0x96fe('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x96fe('0x6'));var squel=require(_0x96fe('0x7'));var crypto=require(_0x96fe('0x8'));var jsforce=require(_0x96fe('0x9'));var deskjs=require(_0x96fe('0xa'));var toCsv=require('to-csv');var querystring=require(_0x96fe('0xb'));var Papa=require(_0x96fe('0xc'));var Redis=require(_0x96fe('0xd'));var authService=require(_0x96fe('0xe'));var qs=require(_0x96fe('0xf'));var as=require(_0x96fe('0x10'));var hardwareService=require(_0x96fe('0x11'));var logger=require(_0x96fe('0x12'))(_0x96fe('0x13'));var utils=require(_0x96fe('0x14'));var config=require(_0x96fe('0x15'));var licenseUtil=require(_0x96fe('0x16'));var db=require(_0x96fe('0x17'))['db'];function respondWithStatusCode(_0x3929c2,_0x2e169f){_0x2e169f=_0x2e169f||0xcc;return function(_0x67ae04){if(_0x67ae04){return _0x3929c2['sendStatus'](_0x2e169f);}return _0x3929c2['status'](_0x2e169f)[_0x96fe('0x18')]();};}function respondWithResult(_0x385cbe,_0xe16440){_0xe16440=_0xe16440||0xc8;return function(_0x544447){if(_0x544447){return _0x385cbe[_0x96fe('0x19')](_0xe16440)[_0x96fe('0x1a')](_0x544447);}};}function respondWithFilteredResult(_0x58e680,_0x9c8c36){return function(_0x4b314c){if(_0x4b314c){var _0x12b956=typeof _0x9c8c36['offset']===_0x96fe('0x1b')&&typeof _0x9c8c36['limit']===_0x96fe('0x1b');var _0x518488=_0x4b314c[_0x96fe('0x1c')];var _0x151813=_0x12b956?0x0:_0x9c8c36[_0x96fe('0x1d')];var _0x168f0f=_0x12b956?_0x4b314c['count']:_0x9c8c36[_0x96fe('0x1d')]+_0x9c8c36[_0x96fe('0x1e')];var _0x3d482c;if(_0x168f0f>=_0x518488){_0x168f0f=_0x518488;_0x3d482c=0xc8;}else{_0x3d482c=0xce;}_0x58e680[_0x96fe('0x19')](_0x3d482c);return _0x58e680[_0x96fe('0x1f')](_0x96fe('0x20'),_0x151813+'-'+_0x168f0f+'/'+_0x518488)[_0x96fe('0x1a')](_0x4b314c);}return null;};}function patchUpdates(_0x55617c){return function(_0x541d67){try{jsonpatch[_0x96fe('0x21')](_0x541d67,_0x55617c,!![]);}catch(_0x365991){return BPromise['reject'](_0x365991);}return _0x541d67[_0x96fe('0x22')]();};}function saveUpdates(_0x209b8f,_0x5d0107){return function(_0xf101d9){if(_0xf101d9){return _0xf101d9['update'](_0x209b8f)[_0x96fe('0x23')](function(_0x1505a5){return _0x1505a5;});}return null;};}function removeEntity(_0x572fe7,_0x382415){return function(_0x1a892f){if(_0x1a892f){return _0x1a892f[_0x96fe('0x24')]()[_0x96fe('0x23')](function(){_0x572fe7[_0x96fe('0x19')](0xcc)[_0x96fe('0x18')]();});}};}function handleEntityNotFound(_0x2deeca,_0xaa3e14){return function(_0x5c437d){if(!_0x5c437d){_0x2deeca[_0x96fe('0x25')](0x194);}return _0x5c437d;};}function handleError(_0x1f4386,_0x4d7721){_0x4d7721=_0x4d7721||0x1f4;return function(_0x32c7e1){logger['error'](_0x32c7e1[_0x96fe('0x26')]);if(_0x32c7e1['name']){delete _0x32c7e1[_0x96fe('0x27')];}_0x1f4386[_0x96fe('0x19')](_0x4d7721)[_0x96fe('0x28')](_0x32c7e1);};}exports['index']=function(_0x223ee1,_0x3e9b01){var _0x55b420={},_0x353e5a={},_0x21481c={'count':0x0,'rows':[]};var _0x5d18dd=_[_0x96fe('0x29')](db[_0x96fe('0x2a')][_0x96fe('0x2b')],function(_0x49c0e9){return{'name':_0x49c0e9['fieldName'],'type':_0x49c0e9[_0x96fe('0x2c')][_0x96fe('0x2d')]};});_0x353e5a[_0x96fe('0x2e')]=_[_0x96fe('0x29')](_0x5d18dd,_0x96fe('0x27'));_0x353e5a[_0x96fe('0x2f')]=_[_0x96fe('0x30')](_0x223ee1[_0x96fe('0x2f')]);_0x353e5a[_0x96fe('0x31')]=_[_0x96fe('0x32')](_0x353e5a[_0x96fe('0x2e')],_0x353e5a[_0x96fe('0x2f')]);_0x55b420['attributes']=_['intersection'](_0x353e5a[_0x96fe('0x2e')],qs[_0x96fe('0x33')](_0x223ee1[_0x96fe('0x2f')][_0x96fe('0x33')]));_0x55b420[_0x96fe('0x34')]=_0x55b420[_0x96fe('0x34')]['length']?_0x55b420[_0x96fe('0x34')]:_0x353e5a[_0x96fe('0x2e')];if(!_0x223ee1['query'][_0x96fe('0x35')](_0x96fe('0x36'))){_0x55b420['limit']=qs[_0x96fe('0x1e')](_0x223ee1[_0x96fe('0x2f')][_0x96fe('0x1e')]);_0x55b420[_0x96fe('0x1d')]=qs[_0x96fe('0x1d')](_0x223ee1[_0x96fe('0x2f')][_0x96fe('0x1d')]);}_0x55b420['order']=qs[_0x96fe('0x37')](_0x223ee1[_0x96fe('0x2f')][_0x96fe('0x37')]);_0x55b420[_0x96fe('0x38')]=qs[_0x96fe('0x31')](_[_0x96fe('0x39')](_0x223ee1[_0x96fe('0x2f')],_0x353e5a[_0x96fe('0x31')]),_0x5d18dd);if(_0x223ee1[_0x96fe('0x2f')]['filter']){_0x55b420[_0x96fe('0x38')]=_[_0x96fe('0x3a')](_0x55b420[_0x96fe('0x38')],{'$or':_[_0x96fe('0x29')](_0x5d18dd,function(_0x5909a4){if(_0x5909a4[_0x96fe('0x2c')]!==_0x96fe('0x3b')){var _0x3cd160={};_0x3cd160[_0x5909a4[_0x96fe('0x27')]]={'$like':'%'+_0x223ee1[_0x96fe('0x2f')][_0x96fe('0x3c')]+'%'};return _0x3cd160;}})});}_0x55b420=_[_0x96fe('0x3a')]({},_0x55b420,_0x223ee1[_0x96fe('0x3d')]);var _0x39ba35={'where':_0x55b420[_0x96fe('0x38')]};return db[_0x96fe('0x2a')][_0x96fe('0x1c')](_0x39ba35)[_0x96fe('0x23')](function(_0x3f13b7){_0x21481c[_0x96fe('0x1c')]=_0x3f13b7;if(_0x223ee1['query']['includeAll']){_0x55b420[_0x96fe('0x3e')]=[{'all':!![]}];}return db[_0x96fe('0x2a')][_0x96fe('0x3f')](_0x55b420);})[_0x96fe('0x23')](function(_0x4c1c18){_0x21481c['rows']=_0x4c1c18;return _0x21481c;})[_0x96fe('0x23')](respondWithFilteredResult(_0x3e9b01,_0x55b420))['catch'](handleError(_0x3e9b01,null));};exports[_0x96fe('0x40')]=function(_0x362beb,_0xfb4c5a){var _0x2112f2={'raw':![],'where':{'id':_0x362beb[_0x96fe('0x41')]['id']}},_0x42abc6={};_0x42abc6['model']=_[_0x96fe('0x30')](db['Dynamics365Configuration'][_0x96fe('0x2b')]);_0x42abc6['query']=_['keys'](_0x362beb[_0x96fe('0x2f')]);_0x42abc6[_0x96fe('0x31')]=_[_0x96fe('0x32')](_0x42abc6[_0x96fe('0x2e')],_0x42abc6[_0x96fe('0x2f')]);_0x2112f2['attributes']=_[_0x96fe('0x32')](_0x42abc6[_0x96fe('0x2e')],qs[_0x96fe('0x33')](_0x362beb[_0x96fe('0x2f')][_0x96fe('0x33')]));_0x2112f2[_0x96fe('0x34')]=_0x2112f2[_0x96fe('0x34')][_0x96fe('0x42')]?_0x2112f2[_0x96fe('0x34')]:_0x42abc6[_0x96fe('0x2e')];if(_0x362beb[_0x96fe('0x2f')][_0x96fe('0x43')]){_0x2112f2[_0x96fe('0x3e')]=[{'all':!![]}];}_0x2112f2=_[_0x96fe('0x3a')]({},_0x2112f2,_0x362beb[_0x96fe('0x3d')]);return db[_0x96fe('0x2a')][_0x96fe('0x44')](_0x2112f2)[_0x96fe('0x23')](handleEntityNotFound(_0xfb4c5a,null))[_0x96fe('0x23')](respondWithResult(_0xfb4c5a,null))[_0x96fe('0x45')](handleError(_0xfb4c5a,null));};exports['create']=function(_0x27745c,_0x5c6425){return db[_0x96fe('0x2a')]['create'](_0x27745c[_0x96fe('0x46')],{})[_0x96fe('0x23')](respondWithResult(_0x5c6425,0xc9))[_0x96fe('0x45')](handleError(_0x5c6425,null));};exports['update']=function(_0x40c61c,_0x93d4fd){if(_0x40c61c[_0x96fe('0x46')]['id']){delete _0x40c61c[_0x96fe('0x46')]['id'];}return db[_0x96fe('0x2a')]['find']({'where':{'id':_0x40c61c[_0x96fe('0x41')]['id']}})[_0x96fe('0x23')](handleEntityNotFound(_0x93d4fd,null))[_0x96fe('0x23')](saveUpdates(_0x40c61c[_0x96fe('0x46')],null))[_0x96fe('0x23')](respondWithResult(_0x93d4fd,null))[_0x96fe('0x45')](handleError(_0x93d4fd,null));};exports[_0x96fe('0x24')]=function(_0x444c65,_0x5bee3e){return db[_0x96fe('0x2a')]['find']({'where':{'id':_0x444c65['params']['id']}})[_0x96fe('0x23')](handleEntityNotFound(_0x5bee3e,null))[_0x96fe('0x23')](removeEntity(_0x5bee3e,null))[_0x96fe('0x45')](handleError(_0x5bee3e,null));};exports[_0x96fe('0x47')]=function(_0x402541,_0x41444c,_0x14f8d1){var _0x424c65={};var _0x16f45a={};var _0xec13d7;var _0xcec80f;return db[_0x96fe('0x2a')][_0x96fe('0x48')]({'where':{'id':_0x402541[_0x96fe('0x41')]['id']}})[_0x96fe('0x23')](handleEntityNotFound(_0x41444c,null))[_0x96fe('0x23')](function(_0x52c8d2){if(_0x52c8d2){_0xec13d7=_0x52c8d2;_0x16f45a[_0x96fe('0x2e')]=_[_0x96fe('0x30')](db[_0x96fe('0x49')]['rawAttributes']);_0x16f45a[_0x96fe('0x2f')]=_['keys'](_0x402541[_0x96fe('0x2f')]);_0x16f45a[_0x96fe('0x31')]=_[_0x96fe('0x32')](_0x16f45a[_0x96fe('0x2e')],_0x16f45a[_0x96fe('0x2f')]);_0x424c65[_0x96fe('0x34')]=_[_0x96fe('0x32')](_0x16f45a[_0x96fe('0x2e')],qs[_0x96fe('0x33')](_0x402541[_0x96fe('0x2f')][_0x96fe('0x33')]));_0x424c65[_0x96fe('0x34')]=_0x424c65[_0x96fe('0x34')][_0x96fe('0x42')]?_0x424c65['attributes']:_0x16f45a['model'];_0x424c65[_0x96fe('0x4a')]=qs['sort'](_0x402541[_0x96fe('0x2f')]['sort']);_0x424c65[_0x96fe('0x38')]=qs[_0x96fe('0x31')](_['pick'](_0x402541[_0x96fe('0x2f')],_0x16f45a[_0x96fe('0x31')]));if(_0x402541['query'][_0x96fe('0x3c')]){_0x424c65['where']=_['merge'](_0x424c65[_0x96fe('0x38')],{'$or':_[_0x96fe('0x29')](_0x424c65[_0x96fe('0x34')],function(_0x26aaaf){var _0x29a9b2={};_0x29a9b2[_0x26aaaf]={'$like':'%'+_0x402541['query'][_0x96fe('0x3c')]+'%'};return _0x29a9b2;})});}_0x424c65=_[_0x96fe('0x3a')]({},_0x424c65,_0x402541[_0x96fe('0x3d')]);return _0xec13d7['getFields'](_0x424c65);}})[_0x96fe('0x23')](function(_0x168122){if(_0x168122){_0xcec80f=_0x168122[_0x96fe('0x42')];if(!_0x402541['query'][_0x96fe('0x35')]('nolimit')){_0x424c65[_0x96fe('0x1e')]=qs['limit'](_0x402541[_0x96fe('0x2f')][_0x96fe('0x1e')]);_0x424c65[_0x96fe('0x1d')]=qs[_0x96fe('0x1d')](_0x402541[_0x96fe('0x2f')]['offset']);}return _0xec13d7[_0x96fe('0x47')](_0x424c65);}})[_0x96fe('0x23')](function(_0xba805e){if(_0xba805e){return _0xba805e?{'count':_0xcec80f,'rows':_0xba805e}:null;}})[_0x96fe('0x23')](respondWithResult(_0x41444c,null))[_0x96fe('0x45')](handleError(_0x41444c,null));};exports[_0x96fe('0x4b')]=function(_0x3f30e9,_0x21d460,_0x27235d){var _0x4d2644={};var _0x550bc6={};var _0xe18e6b;var _0x54fdfd;return db[_0x96fe('0x2a')][_0x96fe('0x48')]({'where':{'id':_0x3f30e9['params']['id']}})[_0x96fe('0x23')](handleEntityNotFound(_0x21d460,null))[_0x96fe('0x23')](function(_0x502752){if(_0x502752){_0xe18e6b=_0x502752;_0x550bc6[_0x96fe('0x2e')]=_['keys'](db[_0x96fe('0x49')][_0x96fe('0x2b')]);_0x550bc6[_0x96fe('0x2f')]=_[_0x96fe('0x30')](_0x3f30e9[_0x96fe('0x2f')]);_0x550bc6[_0x96fe('0x31')]=_[_0x96fe('0x32')](_0x550bc6[_0x96fe('0x2e')],_0x550bc6[_0x96fe('0x2f')]);_0x4d2644[_0x96fe('0x34')]=_[_0x96fe('0x32')](_0x550bc6['model'],qs['fields'](_0x3f30e9[_0x96fe('0x2f')][_0x96fe('0x33')]));_0x4d2644[_0x96fe('0x34')]=_0x4d2644[_0x96fe('0x34')][_0x96fe('0x42')]?_0x4d2644[_0x96fe('0x34')]:_0x550bc6[_0x96fe('0x2e')];_0x4d2644['order']=qs[_0x96fe('0x37')](_0x3f30e9[_0x96fe('0x2f')][_0x96fe('0x37')]);_0x4d2644[_0x96fe('0x38')]=qs[_0x96fe('0x31')](_[_0x96fe('0x39')](_0x3f30e9[_0x96fe('0x2f')],_0x550bc6[_0x96fe('0x31')]));if(_0x3f30e9[_0x96fe('0x2f')][_0x96fe('0x3c')]){_0x4d2644['where']=_[_0x96fe('0x3a')](_0x4d2644[_0x96fe('0x38')],{'$or':_[_0x96fe('0x29')](_0x4d2644[_0x96fe('0x34')],function(_0x46106c){var _0x12f33f={};_0x12f33f[_0x46106c]={'$like':'%'+_0x3f30e9[_0x96fe('0x2f')][_0x96fe('0x3c')]+'%'};return _0x12f33f;})});}_0x4d2644=_[_0x96fe('0x3a')]({},_0x4d2644,_0x3f30e9[_0x96fe('0x3d')]);return _0xe18e6b['getSubjects'](_0x4d2644);}})[_0x96fe('0x23')](function(_0x2cf124){if(_0x2cf124){_0x54fdfd=_0x2cf124['length'];if(!_0x3f30e9[_0x96fe('0x2f')][_0x96fe('0x35')]('nolimit')){_0x4d2644[_0x96fe('0x1e')]=qs[_0x96fe('0x1e')](_0x3f30e9[_0x96fe('0x2f')][_0x96fe('0x1e')]);_0x4d2644['offset']=qs[_0x96fe('0x1d')](_0x3f30e9[_0x96fe('0x2f')][_0x96fe('0x1d')]);}return _0xe18e6b['getSubjects'](_0x4d2644);}})[_0x96fe('0x23')](function(_0x351f27){if(_0x351f27){return _0x351f27?{'count':_0x54fdfd,'rows':_0x351f27}:null;}})[_0x96fe('0x23')](respondWithResult(_0x21d460,null))[_0x96fe('0x45')](handleError(_0x21d460,null));};exports['getDescriptions']=function(_0x268d02,_0x3b3e12,_0x15d8de){var _0x52caed={};var _0x483398={};var _0x2dacb6;var _0xa9c65;return db[_0x96fe('0x2a')][_0x96fe('0x48')]({'where':{'id':_0x268d02[_0x96fe('0x41')]['id']}})[_0x96fe('0x23')](handleEntityNotFound(_0x3b3e12,null))[_0x96fe('0x23')](function(_0x3a7b2c){if(_0x3a7b2c){_0x2dacb6=_0x3a7b2c;_0x483398[_0x96fe('0x2e')]=_[_0x96fe('0x30')](db[_0x96fe('0x49')][_0x96fe('0x2b')]);_0x483398['query']=_[_0x96fe('0x30')](_0x268d02[_0x96fe('0x2f')]);_0x483398['filters']=_[_0x96fe('0x32')](_0x483398[_0x96fe('0x2e')],_0x483398[_0x96fe('0x2f')]);_0x52caed['attributes']=_[_0x96fe('0x32')](_0x483398['model'],qs[_0x96fe('0x33')](_0x268d02[_0x96fe('0x2f')]['fields']));_0x52caed[_0x96fe('0x34')]=_0x52caed[_0x96fe('0x34')]['length']?_0x52caed['attributes']:_0x483398['model'];_0x52caed['order']=qs[_0x96fe('0x37')](_0x268d02[_0x96fe('0x2f')]['sort']);_0x52caed[_0x96fe('0x38')]=qs['filters'](_[_0x96fe('0x39')](_0x268d02['query'],_0x483398[_0x96fe('0x31')]));if(_0x268d02[_0x96fe('0x2f')][_0x96fe('0x3c')]){_0x52caed[_0x96fe('0x38')]=_[_0x96fe('0x3a')](_0x52caed['where'],{'$or':_[_0x96fe('0x29')](_0x52caed[_0x96fe('0x34')],function(_0x57ef60){var _0x18c7d6={};_0x18c7d6[_0x57ef60]={'$like':'%'+_0x268d02[_0x96fe('0x2f')]['filter']+'%'};return _0x18c7d6;})});}_0x52caed=_['merge']({},_0x52caed,_0x268d02[_0x96fe('0x3d')]);return _0x2dacb6[_0x96fe('0x4c')](_0x52caed);}})['then'](function(_0x2d53cb){if(_0x2d53cb){_0xa9c65=_0x2d53cb[_0x96fe('0x42')];if(!_0x268d02[_0x96fe('0x2f')][_0x96fe('0x35')](_0x96fe('0x36'))){_0x52caed['limit']=qs[_0x96fe('0x1e')](_0x268d02[_0x96fe('0x2f')][_0x96fe('0x1e')]);_0x52caed[_0x96fe('0x1d')]=qs[_0x96fe('0x1d')](_0x268d02[_0x96fe('0x2f')]['offset']);}return _0x2dacb6[_0x96fe('0x4c')](_0x52caed);}})[_0x96fe('0x23')](function(_0x2ba59c){if(_0x2ba59c){return _0x2ba59c?{'count':_0xa9c65,'rows':_0x2ba59c}:null;}})[_0x96fe('0x23')](respondWithResult(_0x3b3e12,null))[_0x96fe('0x45')](handleError(_0x3b3e12,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index ddfdd09..fc87f42 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(_0x350645,_0x6cd552){var _0x2b5240=function(_0x13f64d){while(--_0x13f64d){_0x350645['push'](_0x350645['shift']());}};_0x2b5240(++_0x6cd552);}(_0x54ef,0x112));var _0xf54e=function(_0x2ee4b5,_0x3ed073){_0x2ee4b5=_0x2ee4b5-0x0;var _0x329421=_0x54ef[_0x2ee4b5];return _0x329421;};'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 _0x54ef=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','lodash','util'];(function(_0x52d30e,_0x1b0809){var _0xfd52ef=function(_0x18499e){while(--_0x18499e){_0x52d30e['push'](_0x52d30e['shift']());}};_0xfd52ef(++_0x1b0809);}(_0x54ef,0x112));var _0xf54e=function(_0x1a278d,_0x4689a0){_0x1a278d=_0x1a278d-0x0;var _0x55d574=_0x54ef[_0x1a278d];return _0x55d574;};'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 diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index c08b7db..e8798e4 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 _0x9a09=['../../config/environment','jayson/promise','http','then','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','Dynamics365Configuration,\x20%s,\x20%s','message','info','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x5180c3,_0x4b35f7){var _0x55c975=function(_0x4746cb){while(--_0x4746cb){_0x5180c3['push'](_0x5180c3['shift']());}};_0x55c975(++_0x4b35f7);}(_0x9a09,0x6c));var _0x99a0=function(_0x467f7e,_0x9625ca){_0x467f7e=_0x467f7e-0x0;var _0x352aa8=_0x9a09[_0x467f7e];return _0x352aa8;};'use strict';var _=require('lodash');var util=require(_0x99a0('0x0'));var moment=require('moment');var BPromise=require(_0x99a0('0x1'));var rs=require(_0x99a0('0x2'));var fs=require('fs');var Redis=require(_0x99a0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x99a0('0x4'));var logger=require(_0x99a0('0x5'))('rpc');var config=require(_0x99a0('0x6'));var jayson=require(_0x99a0('0x7'));var client=jayson['client'][_0x99a0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xb97ad5,_0x20b2df,_0x47a889){return new BPromise(function(_0x46a47c,_0x44bc91){return client['request'](_0xb97ad5,_0x47a889)[_0x99a0('0x9')](function(_0xf9b898){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x20b2df,_0x99a0('0xa'));logger['debug'](_0x99a0('0xb'),_0x20b2df,'request\x20sent',JSON[_0x99a0('0xc')](_0xf9b898));if(_0xf9b898['error']){if(_0xf9b898[_0x99a0('0xd')][_0x99a0('0xe')]===0x1f4){logger['error'](_0x99a0('0xf'),_0x20b2df,_0xf9b898[_0x99a0('0xd')]['message']);return _0x44bc91(_0xf9b898[_0x99a0('0xd')]['message']);}logger[_0x99a0('0xd')](_0x99a0('0xf'),_0x20b2df,_0xf9b898[_0x99a0('0xd')]['message']);return _0x46a47c(_0xf9b898[_0x99a0('0xd')][_0x99a0('0x10')]);}else{logger[_0x99a0('0x11')](_0x99a0('0xf'),_0x20b2df,'request\x20sent');_0x46a47c(_0xf9b898['result'][_0x99a0('0x10')]);}})[_0x99a0('0x12')](function(_0x224220){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x20b2df,_0x224220);_0x44bc91(_0x224220);});});} \ No newline at end of file +var _0xed93=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','util','moment'];(function(_0x467946,_0x58d051){var _0x5be916=function(_0x163b83){while(--_0x163b83){_0x467946['push'](_0x467946['shift']());}};_0x5be916(++_0x58d051);}(_0xed93,0x1cc));var _0x3ed9=function(_0x260eb3,_0xe8c2b){_0x260eb3=_0x260eb3-0x0;var _0x283366=_0xed93[_0x260eb3];return _0x283366;};'use strict';var _=require('lodash');var util=require(_0x3ed9('0x0'));var moment=require(_0x3ed9('0x1'));var BPromise=require(_0x3ed9('0x2'));var rs=require(_0x3ed9('0x3'));var fs=require('fs');var Redis=require(_0x3ed9('0x4'));var db=require(_0x3ed9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3ed9('0x6'))(_0x3ed9('0x7'));var config=require(_0x3ed9('0x8'));var jayson=require(_0x3ed9('0x9'));var client=jayson[_0x3ed9('0xa')][_0x3ed9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2aac77,_0x124923,_0x1569c1){return new BPromise(function(_0x3b992b,_0x33a222){return client[_0x3ed9('0xc')](_0x2aac77,_0x1569c1)[_0x3ed9('0xd')](function(_0x17885a){logger[_0x3ed9('0xe')](_0x3ed9('0xf'),_0x124923,_0x3ed9('0x10'));logger[_0x3ed9('0x11')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x124923,'request\x20sent',JSON['stringify'](_0x17885a));if(_0x17885a['error']){if(_0x17885a['error']['code']===0x1f4){logger[_0x3ed9('0x12')](_0x3ed9('0xf'),_0x124923,_0x17885a['error']['message']);return _0x33a222(_0x17885a[_0x3ed9('0x12')][_0x3ed9('0x13')]);}logger['error'](_0x3ed9('0xf'),_0x124923,_0x17885a[_0x3ed9('0x12')][_0x3ed9('0x13')]);return _0x3b992b(_0x17885a[_0x3ed9('0x12')][_0x3ed9('0x13')]);}else{logger['info'](_0x3ed9('0xf'),_0x124923,'request\x20sent');_0x3b992b(_0x17885a[_0x3ed9('0x14')][_0x3ed9('0x13')]);}})[_0x3ed9('0x15')](function(_0x14bffd){logger[_0x3ed9('0x12')](_0x3ed9('0xf'),_0x124923,_0x14bffd);_0x33a222(_0x14bffd);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index e5bf172..f298f84 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 _0x6a17=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','show','post','create','put','update','exports'];(function(_0x2e6702,_0x542fc9){var _0x217a11=function(_0x39c3d7){while(--_0x39c3d7){_0x2e6702['push'](_0x2e6702['shift']());}};_0x217a11(++_0x542fc9);}(_0x6a17,0x140));var _0x76a1=function(_0x53539b,_0xe161b7){_0x53539b=_0x53539b-0x0;var _0x287b43=_0x6a17[_0x53539b];return _0x287b43;};'use strict';var multer=require(_0x76a1('0x0'));var util=require(_0x76a1('0x1'));var path=require(_0x76a1('0x2'));var timeout=require('connect-timeout');var express=require(_0x76a1('0x3'));var router=express[_0x76a1('0x4')]();var fs_extra=require(_0x76a1('0x5'));var auth=require(_0x76a1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x76a1('0x7'));var controller=require(_0x76a1('0x8'));router['get']('/',auth[_0x76a1('0x9')](),controller['index']);router['get']('/:id',auth[_0x76a1('0x9')](),controller[_0x76a1('0xa')]);router[_0x76a1('0xb')]('/',auth[_0x76a1('0x9')](),controller[_0x76a1('0xc')]);router[_0x76a1('0xd')]('/:id',auth[_0x76a1('0x9')](),controller[_0x76a1('0xe')]);router['delete']('/:id',auth[_0x76a1('0x9')](),controller['destroy']);module[_0x76a1('0xf')]=router; \ No newline at end of file +var _0x3c6a=['isAuthenticated','index','get','show','post','/:id','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller'];(function(_0x17546e,_0x16c9cf){var _0x5b2bc7=function(_0x5b65fd){while(--_0x5b65fd){_0x17546e['push'](_0x17546e['shift']());}};_0x5b2bc7(++_0x16c9cf);}(_0x3c6a,0x1ca));var _0xa3c6=function(_0x36bff5,_0x3156cb){_0x36bff5=_0x36bff5-0x0;var _0x80ade5=_0x3c6a[_0x36bff5];return _0x80ade5;};'use strict';var multer=require(_0xa3c6('0x0'));var util=require('util');var path=require(_0xa3c6('0x1'));var timeout=require(_0xa3c6('0x2'));var express=require(_0xa3c6('0x3'));var router=express[_0xa3c6('0x4')]();var fs_extra=require(_0xa3c6('0x5'));var auth=require(_0xa3c6('0x6'));var interaction=require(_0xa3c6('0x7'));var config=require(_0xa3c6('0x8'));var controller=require(_0xa3c6('0x9'));router['get']('/',auth[_0xa3c6('0xa')](),controller[_0xa3c6('0xb')]);router[_0xa3c6('0xc')]('/:id',auth[_0xa3c6('0xa')](),controller[_0xa3c6('0xd')]);router[_0xa3c6('0xe')]('/',auth[_0xa3c6('0xa')](),controller['create']);router['put'](_0xa3c6('0xf'),auth[_0xa3c6('0xa')](),controller['update']);router[_0xa3c6('0x10')]('/:id',auth[_0xa3c6('0xa')](),controller['destroy']);module[_0xa3c6('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 777b1a8..1ceafb7 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 _0x8bc2=['customVariable','keyValue','picklist','string','STRING','ENUM','BOOLEAN','sequelize','variable'];(function(_0x1abeb2,_0x79f462){var _0x48da20=function(_0x42a90b){while(--_0x42a90b){_0x1abeb2['push'](_0x1abeb2['shift']());}};_0x48da20(++_0x79f462);}(_0x8bc2,0x97));var _0x28bc=function(_0x9d147a,_0x519528){_0x9d147a=_0x9d147a-0x0;var _0x353931=_0x8bc2[_0x9d147a];return _0x353931;};'use strict';var Sequelize=require(_0x28bc('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x28bc('0x1'),_0x28bc('0x2'),_0x28bc('0x3'),_0x28bc('0x4')),'defaultValue':_0x28bc('0x5')},'content':{'type':Sequelize[_0x28bc('0x6')]},'key':{'type':Sequelize[_0x28bc('0x6')]},'keyType':{'type':Sequelize[_0x28bc('0x7')](_0x28bc('0x5'),_0x28bc('0x1'),_0x28bc('0x2'))},'keyContent':{'type':Sequelize[_0x28bc('0x6')]},'idField':{'type':Sequelize[_0x28bc('0x6')]},'nameField':{'type':Sequelize[_0x28bc('0x6')]},'customField':{'type':Sequelize[_0x28bc('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x28bc('0x6')]}}; \ No newline at end of file +var _0xc0ba=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x1eeaf9,_0x501459){var _0x12d4c2=function(_0x3e5d3b){while(--_0x3e5d3b){_0x1eeaf9['push'](_0x1eeaf9['shift']());}};_0x12d4c2(++_0x501459);}(_0xc0ba,0x1db));var _0xac0b=function(_0x499227,_0x3a8c2c){_0x499227=_0x499227-0x0;var _0xec1c0a=_0xc0ba[_0x499227];return _0xec1c0a;};'use strict';var Sequelize=require(_0xac0b('0x0'));module[_0xac0b('0x1')]={'type':{'type':Sequelize[_0xac0b('0x2')](_0xac0b('0x3'),_0xac0b('0x4'),_0xac0b('0x5'),_0xac0b('0x6'),_0xac0b('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0xac0b('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xac0b('0x2')](_0xac0b('0x3'),_0xac0b('0x4'),_0xac0b('0x5'))},'keyContent':{'type':Sequelize[_0xac0b('0x8')]},'idField':{'type':Sequelize[_0xac0b('0x8')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xac0b('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xac0b('0x8')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index f2275c8..a12590a 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 _0x3e71=['fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','Dynamics365Field','includeAll','include','rows','catch','show','params','options','create','body','find','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','error','stack','name','send','index','map','rawAttributes'];(function(_0x58dbb8,_0x43ff61){var _0x1e83c5=function(_0x299565){while(--_0x299565){_0x58dbb8['push'](_0x58dbb8['shift']());}};_0x1e83c5(++_0x43ff61);}(_0x3e71,0x68));var _0x13e7=function(_0x33be46,_0x216dc3){_0x33be46=_0x33be46-0x0;var _0x35bcda=_0x3e71[_0x33be46];return _0x35bcda;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x13e7('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x13e7('0x1'));var rp=require(_0x13e7('0x2'));var moment=require('moment');var BPromise=require(_0x13e7('0x3'));var Mustache=require(_0x13e7('0x4'));var util=require('util');var path=require(_0x13e7('0x5'));var sox=require(_0x13e7('0x6'));var csv=require(_0x13e7('0x7'));var ejs=require(_0x13e7('0x8'));var fs=require('fs');var fs_extra=require(_0x13e7('0x9'));var _=require('lodash');var squel=require(_0x13e7('0xa'));var crypto=require('crypto');var jsforce=require(_0x13e7('0xb'));var deskjs=require(_0x13e7('0xc'));var toCsv=require(_0x13e7('0x7'));var querystring=require(_0x13e7('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x13e7('0xe'));var logger=require(_0x13e7('0xf'))(_0x13e7('0x10'));var utils=require(_0x13e7('0x11'));var config=require(_0x13e7('0x12'));var licenseUtil=require(_0x13e7('0x13'));var db=require(_0x13e7('0x14'))['db'];function respondWithStatusCode(_0x5360ff,_0x59db22){_0x59db22=_0x59db22||0xcc;return function(_0x35f338){if(_0x35f338){return _0x5360ff[_0x13e7('0x15')](_0x59db22);}return _0x5360ff['status'](_0x59db22)[_0x13e7('0x16')]();};}function respondWithResult(_0xb558b1,_0x5823b8){_0x5823b8=_0x5823b8||0xc8;return function(_0x4e93f5){if(_0x4e93f5){return _0xb558b1[_0x13e7('0x17')](_0x5823b8)[_0x13e7('0x18')](_0x4e93f5);}};}function respondWithFilteredResult(_0x4ae3fc,_0x2832ea){return function(_0x3c44b0){if(_0x3c44b0){var _0x3dcf80=typeof _0x2832ea[_0x13e7('0x19')]===_0x13e7('0x1a')&&typeof _0x2832ea[_0x13e7('0x1b')]===_0x13e7('0x1a');var _0x2b6f07=_0x3c44b0[_0x13e7('0x1c')];var _0x2f97b3=_0x3dcf80?0x0:_0x2832ea['offset'];var _0x1a43aa=_0x3dcf80?_0x3c44b0['count']:_0x2832ea[_0x13e7('0x19')]+_0x2832ea['limit'];var _0x6430aa;if(_0x1a43aa>=_0x2b6f07){_0x1a43aa=_0x2b6f07;_0x6430aa=0xc8;}else{_0x6430aa=0xce;}_0x4ae3fc[_0x13e7('0x17')](_0x6430aa);return _0x4ae3fc[_0x13e7('0x1d')](_0x13e7('0x1e'),_0x2f97b3+'-'+_0x1a43aa+'/'+_0x2b6f07)[_0x13e7('0x18')](_0x3c44b0);}return null;};}function patchUpdates(_0x594629){return function(_0x145567){try{jsonpatch[_0x13e7('0x1f')](_0x145567,_0x594629,!![]);}catch(_0x441693){return BPromise['reject'](_0x441693);}return _0x145567['save']();};}function saveUpdates(_0x19c282,_0x8817b2){return function(_0x52090a){if(_0x52090a){return _0x52090a[_0x13e7('0x20')](_0x19c282)['then'](function(_0x232b1a){return _0x232b1a;});}return null;};}function removeEntity(_0x58a0ee,_0x1bf65d){return function(_0x48f0de){if(_0x48f0de){return _0x48f0de[_0x13e7('0x21')]()[_0x13e7('0x22')](function(){_0x58a0ee[_0x13e7('0x17')](0xcc)[_0x13e7('0x16')]();});}};}function handleEntityNotFound(_0x5cbf77,_0x4f2f5f){return function(_0x310134){if(!_0x310134){_0x5cbf77[_0x13e7('0x15')](0x194);}return _0x310134;};}function handleError(_0xe115ad,_0x3894db){_0x3894db=_0x3894db||0x1f4;return function(_0x10b409){logger[_0x13e7('0x23')](_0x10b409[_0x13e7('0x24')]);if(_0x10b409[_0x13e7('0x25')]){delete _0x10b409[_0x13e7('0x25')];}_0xe115ad['status'](_0x3894db)[_0x13e7('0x26')](_0x10b409);};}exports[_0x13e7('0x27')]=function(_0x3df28a,_0x58b040){var _0x478683={},_0x44074e={},_0x5d488a={'count':0x0,'rows':[]};var _0x1109de=_[_0x13e7('0x28')](db['Dynamics365Field'][_0x13e7('0x29')],function(_0x438ce3){return{'name':_0x438ce3[_0x13e7('0x2a')],'type':_0x438ce3[_0x13e7('0x2b')][_0x13e7('0x2c')]};});_0x44074e['model']=_['map'](_0x1109de,_0x13e7('0x25'));_0x44074e[_0x13e7('0x2d')]=_[_0x13e7('0x2e')](_0x3df28a['query']);_0x44074e['filters']=_['intersection'](_0x44074e[_0x13e7('0x2f')],_0x44074e[_0x13e7('0x2d')]);_0x478683[_0x13e7('0x30')]=_[_0x13e7('0x31')](_0x44074e[_0x13e7('0x2f')],qs['fields'](_0x3df28a[_0x13e7('0x2d')][_0x13e7('0x32')]));_0x478683[_0x13e7('0x30')]=_0x478683['attributes'][_0x13e7('0x33')]?_0x478683['attributes']:_0x44074e[_0x13e7('0x2f')];if(!_0x3df28a[_0x13e7('0x2d')][_0x13e7('0x34')](_0x13e7('0x35'))){_0x478683['limit']=qs[_0x13e7('0x1b')](_0x3df28a[_0x13e7('0x2d')]['limit']);_0x478683[_0x13e7('0x19')]=qs['offset'](_0x3df28a[_0x13e7('0x2d')]['offset']);}_0x478683[_0x13e7('0x36')]=qs[_0x13e7('0x37')](_0x3df28a['query'][_0x13e7('0x37')]);_0x478683[_0x13e7('0x38')]=qs[_0x13e7('0x39')](_[_0x13e7('0x3a')](_0x3df28a[_0x13e7('0x2d')],_0x44074e[_0x13e7('0x39')]),_0x1109de);if(_0x3df28a[_0x13e7('0x2d')]['filter']){_0x478683[_0x13e7('0x38')]=_[_0x13e7('0x3b')](_0x478683[_0x13e7('0x38')],{'$or':_[_0x13e7('0x28')](_0x1109de,function(_0xb7eae6){if(_0xb7eae6[_0x13e7('0x2b')]!==_0x13e7('0x3c')){var _0xdff89={};_0xdff89[_0xb7eae6[_0x13e7('0x25')]]={'$like':'%'+_0x3df28a['query'][_0x13e7('0x3d')]+'%'};return _0xdff89;}})});}_0x478683=_[_0x13e7('0x3b')]({},_0x478683,_0x3df28a['options']);var _0x17869d={'where':_0x478683[_0x13e7('0x38')]};return db[_0x13e7('0x3e')]['count'](_0x17869d)[_0x13e7('0x22')](function(_0x2212a5){_0x5d488a['count']=_0x2212a5;if(_0x3df28a['query'][_0x13e7('0x3f')]){_0x478683[_0x13e7('0x40')]=[{'all':!![]}];}return db[_0x13e7('0x3e')]['findAll'](_0x478683);})[_0x13e7('0x22')](function(_0x287d44){_0x5d488a[_0x13e7('0x41')]=_0x287d44;return _0x5d488a;})[_0x13e7('0x22')](respondWithFilteredResult(_0x58b040,_0x478683))[_0x13e7('0x42')](handleError(_0x58b040,null));};exports[_0x13e7('0x43')]=function(_0x237485,_0x162cf8){var _0x43f031={'raw':!![],'where':{'id':_0x237485[_0x13e7('0x44')]['id']}},_0x21a00c={};_0x21a00c[_0x13e7('0x2f')]=_['keys'](db[_0x13e7('0x3e')][_0x13e7('0x29')]);_0x21a00c[_0x13e7('0x2d')]=_['keys'](_0x237485['query']);_0x21a00c[_0x13e7('0x39')]=_[_0x13e7('0x31')](_0x21a00c[_0x13e7('0x2f')],_0x21a00c['query']);_0x43f031['attributes']=_[_0x13e7('0x31')](_0x21a00c['model'],qs[_0x13e7('0x32')](_0x237485['query'][_0x13e7('0x32')]));_0x43f031[_0x13e7('0x30')]=_0x43f031[_0x13e7('0x30')]['length']?_0x43f031[_0x13e7('0x30')]:_0x21a00c[_0x13e7('0x2f')];if(_0x237485['query'][_0x13e7('0x3f')]){_0x43f031[_0x13e7('0x40')]=[{'all':!![]}];}_0x43f031=_[_0x13e7('0x3b')]({},_0x43f031,_0x237485[_0x13e7('0x45')]);return db['Dynamics365Field']['find'](_0x43f031)['then'](handleEntityNotFound(_0x162cf8,null))[_0x13e7('0x22')](respondWithResult(_0x162cf8,null))['catch'](handleError(_0x162cf8,null));};exports[_0x13e7('0x46')]=function(_0x129b35,_0x16e580){return db[_0x13e7('0x3e')][_0x13e7('0x46')](_0x129b35[_0x13e7('0x47')],{})['then'](respondWithResult(_0x16e580,0xc9))[_0x13e7('0x42')](handleError(_0x16e580,null));};exports['update']=function(_0xfb49,_0x1f1c3c){if(_0xfb49[_0x13e7('0x47')]['id']){delete _0xfb49['body']['id'];}return db[_0x13e7('0x3e')]['find']({'where':{'id':_0xfb49[_0x13e7('0x44')]['id']}})[_0x13e7('0x22')](handleEntityNotFound(_0x1f1c3c,null))['then'](saveUpdates(_0xfb49[_0x13e7('0x47')],null))[_0x13e7('0x22')](respondWithResult(_0x1f1c3c,null))[_0x13e7('0x42')](handleError(_0x1f1c3c,null));};exports['destroy']=function(_0x1bbf64,_0x59a3ea){return db[_0x13e7('0x3e')][_0x13e7('0x48')]({'where':{'id':_0x1bbf64[_0x13e7('0x44')]['id']}})[_0x13e7('0x22')](handleEntityNotFound(_0x59a3ea,null))[_0x13e7('0x22')](removeEntity(_0x59a3ea,null))[_0x13e7('0x42')](handleError(_0x59a3ea,null));}; \ No newline at end of file +var _0xe3d4=['merge','options','includeAll','include','rows','catch','params','keys','Dynamics365Field','find','create','body','update','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','end','error','name','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL'];(function(_0x128495,_0x32ea3a){var _0x5323c1=function(_0x14911c){while(--_0x14911c){_0x128495['push'](_0x128495['shift']());}};_0x5323c1(++_0x32ea3a);}(_0xe3d4,0x99));var _0x4e3d=function(_0x101802,_0x11f913){_0x101802=_0x101802-0x0;var _0x5d61ce=_0xe3d4[_0x101802];return _0x5d61ce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4e3d('0x0'));var zipdir=require(_0x4e3d('0x1'));var jsonpatch=require(_0x4e3d('0x2'));var rp=require('request-promise');var moment=require(_0x4e3d('0x3'));var BPromise=require(_0x4e3d('0x4'));var Mustache=require(_0x4e3d('0x5'));var util=require(_0x4e3d('0x6'));var path=require(_0x4e3d('0x7'));var sox=require('sox');var csv=require(_0x4e3d('0x8'));var ejs=require(_0x4e3d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4e3d('0xa'));var crypto=require(_0x4e3d('0xb'));var jsforce=require(_0x4e3d('0xc'));var deskjs=require(_0x4e3d('0xd'));var toCsv=require(_0x4e3d('0x8'));var querystring=require(_0x4e3d('0xe'));var Papa=require(_0x4e3d('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4e3d('0x10'));var hardwareService=require(_0x4e3d('0x11'));var logger=require(_0x4e3d('0x12'))(_0x4e3d('0x13'));var utils=require('../../config/utils');var config=require(_0x4e3d('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e689e,_0x576acd){_0x576acd=_0x576acd||0xcc;return function(_0x2a9a44){if(_0x2a9a44){return _0x2e689e[_0x4e3d('0x15')](_0x576acd);}return _0x2e689e[_0x4e3d('0x16')](_0x576acd)['end']();};}function respondWithResult(_0x1dd9d1,_0x42ca3d){_0x42ca3d=_0x42ca3d||0xc8;return function(_0x393eb8){if(_0x393eb8){return _0x1dd9d1[_0x4e3d('0x16')](_0x42ca3d)[_0x4e3d('0x17')](_0x393eb8);}};}function respondWithFilteredResult(_0x512180,_0x546789){return function(_0xe6ae4){if(_0xe6ae4){var _0x788aa=typeof _0x546789[_0x4e3d('0x18')]===_0x4e3d('0x19')&&typeof _0x546789[_0x4e3d('0x1a')]==='undefined';var _0x2d87d9=_0xe6ae4[_0x4e3d('0x1b')];var _0x343fa1=_0x788aa?0x0:_0x546789['offset'];var _0x4902ed=_0x788aa?_0xe6ae4['count']:_0x546789['offset']+_0x546789[_0x4e3d('0x1a')];var _0x5734f8;if(_0x4902ed>=_0x2d87d9){_0x4902ed=_0x2d87d9;_0x5734f8=0xc8;}else{_0x5734f8=0xce;}_0x512180[_0x4e3d('0x16')](_0x5734f8);return _0x512180[_0x4e3d('0x1c')](_0x4e3d('0x1d'),_0x343fa1+'-'+_0x4902ed+'/'+_0x2d87d9)[_0x4e3d('0x17')](_0xe6ae4);}return null;};}function patchUpdates(_0x24278c){return function(_0x57c1d9){try{jsonpatch[_0x4e3d('0x1e')](_0x57c1d9,_0x24278c,!![]);}catch(_0x3442){return BPromise[_0x4e3d('0x1f')](_0x3442);}return _0x57c1d9[_0x4e3d('0x20')]();};}function saveUpdates(_0x37d635,_0x13419d){return function(_0x886df2){if(_0x886df2){return _0x886df2['update'](_0x37d635)['then'](function(_0xbb4e6d){return _0xbb4e6d;});}return null;};}function removeEntity(_0x2db4cd,_0x3c9330){return function(_0x28fa05){if(_0x28fa05){return _0x28fa05[_0x4e3d('0x21')]()[_0x4e3d('0x22')](function(){_0x2db4cd['status'](0xcc)[_0x4e3d('0x23')]();});}};}function handleEntityNotFound(_0x137f87,_0x26615b){return function(_0x259efb){if(!_0x259efb){_0x137f87['sendStatus'](0x194);}return _0x259efb;};}function handleError(_0x33b0b5,_0x872470){_0x872470=_0x872470||0x1f4;return function(_0x24f818){logger[_0x4e3d('0x24')](_0x24f818['stack']);if(_0x24f818['name']){delete _0x24f818[_0x4e3d('0x25')];}_0x33b0b5['status'](_0x872470)['send'](_0x24f818);};}exports[_0x4e3d('0x26')]=function(_0x45c6d2,_0x1ad6c2){var _0x59eb28={},_0x2b9b0f={},_0x55b4a6={'count':0x0,'rows':[]};var _0x265c14=_['map'](db['Dynamics365Field'][_0x4e3d('0x27')],function(_0x3262d9){return{'name':_0x3262d9[_0x4e3d('0x28')],'type':_0x3262d9[_0x4e3d('0x29')][_0x4e3d('0x2a')]};});_0x2b9b0f[_0x4e3d('0x2b')]=_[_0x4e3d('0x2c')](_0x265c14,_0x4e3d('0x25'));_0x2b9b0f[_0x4e3d('0x2d')]=_['keys'](_0x45c6d2[_0x4e3d('0x2d')]);_0x2b9b0f[_0x4e3d('0x2e')]=_[_0x4e3d('0x2f')](_0x2b9b0f['model'],_0x2b9b0f[_0x4e3d('0x2d')]);_0x59eb28[_0x4e3d('0x30')]=_[_0x4e3d('0x2f')](_0x2b9b0f[_0x4e3d('0x2b')],qs[_0x4e3d('0x31')](_0x45c6d2[_0x4e3d('0x2d')][_0x4e3d('0x31')]));_0x59eb28['attributes']=_0x59eb28[_0x4e3d('0x30')]['length']?_0x59eb28['attributes']:_0x2b9b0f[_0x4e3d('0x2b')];if(!_0x45c6d2['query'][_0x4e3d('0x32')](_0x4e3d('0x33'))){_0x59eb28[_0x4e3d('0x1a')]=qs['limit'](_0x45c6d2[_0x4e3d('0x2d')]['limit']);_0x59eb28[_0x4e3d('0x18')]=qs[_0x4e3d('0x18')](_0x45c6d2[_0x4e3d('0x2d')][_0x4e3d('0x18')]);}_0x59eb28[_0x4e3d('0x34')]=qs[_0x4e3d('0x35')](_0x45c6d2[_0x4e3d('0x2d')]['sort']);_0x59eb28[_0x4e3d('0x36')]=qs['filters'](_['pick'](_0x45c6d2[_0x4e3d('0x2d')],_0x2b9b0f[_0x4e3d('0x2e')]),_0x265c14);if(_0x45c6d2[_0x4e3d('0x2d')][_0x4e3d('0x37')]){_0x59eb28[_0x4e3d('0x36')]=_['merge'](_0x59eb28[_0x4e3d('0x36')],{'$or':_[_0x4e3d('0x2c')](_0x265c14,function(_0x14035e){if(_0x14035e[_0x4e3d('0x29')]!==_0x4e3d('0x38')){var _0x50f0dc={};_0x50f0dc[_0x14035e[_0x4e3d('0x25')]]={'$like':'%'+_0x45c6d2[_0x4e3d('0x2d')][_0x4e3d('0x37')]+'%'};return _0x50f0dc;}})});}_0x59eb28=_[_0x4e3d('0x39')]({},_0x59eb28,_0x45c6d2[_0x4e3d('0x3a')]);var _0x1a3920={'where':_0x59eb28[_0x4e3d('0x36')]};return db['Dynamics365Field'][_0x4e3d('0x1b')](_0x1a3920)['then'](function(_0x248831){_0x55b4a6[_0x4e3d('0x1b')]=_0x248831;if(_0x45c6d2[_0x4e3d('0x2d')][_0x4e3d('0x3b')]){_0x59eb28[_0x4e3d('0x3c')]=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0x59eb28);})[_0x4e3d('0x22')](function(_0x5da854){_0x55b4a6[_0x4e3d('0x3d')]=_0x5da854;return _0x55b4a6;})[_0x4e3d('0x22')](respondWithFilteredResult(_0x1ad6c2,_0x59eb28))[_0x4e3d('0x3e')](handleError(_0x1ad6c2,null));};exports['show']=function(_0x4aab0b,_0x5e98ec){var _0x1cf28a={'raw':!![],'where':{'id':_0x4aab0b[_0x4e3d('0x3f')]['id']}},_0x272614={};_0x272614['model']=_[_0x4e3d('0x40')](db[_0x4e3d('0x41')]['rawAttributes']);_0x272614[_0x4e3d('0x2d')]=_[_0x4e3d('0x40')](_0x4aab0b['query']);_0x272614[_0x4e3d('0x2e')]=_[_0x4e3d('0x2f')](_0x272614[_0x4e3d('0x2b')],_0x272614['query']);_0x1cf28a[_0x4e3d('0x30')]=_[_0x4e3d('0x2f')](_0x272614[_0x4e3d('0x2b')],qs[_0x4e3d('0x31')](_0x4aab0b[_0x4e3d('0x2d')][_0x4e3d('0x31')]));_0x1cf28a[_0x4e3d('0x30')]=_0x1cf28a[_0x4e3d('0x30')]['length']?_0x1cf28a[_0x4e3d('0x30')]:_0x272614[_0x4e3d('0x2b')];if(_0x4aab0b[_0x4e3d('0x2d')]['includeAll']){_0x1cf28a['include']=[{'all':!![]}];}_0x1cf28a=_[_0x4e3d('0x39')]({},_0x1cf28a,_0x4aab0b['options']);return db['Dynamics365Field'][_0x4e3d('0x42')](_0x1cf28a)[_0x4e3d('0x22')](handleEntityNotFound(_0x5e98ec,null))[_0x4e3d('0x22')](respondWithResult(_0x5e98ec,null))[_0x4e3d('0x3e')](handleError(_0x5e98ec,null));};exports[_0x4e3d('0x43')]=function(_0x313960,_0x14cac9){return db['Dynamics365Field'][_0x4e3d('0x43')](_0x313960[_0x4e3d('0x44')],{})[_0x4e3d('0x22')](respondWithResult(_0x14cac9,0xc9))[_0x4e3d('0x3e')](handleError(_0x14cac9,null));};exports[_0x4e3d('0x45')]=function(_0x59be59,_0x346997){if(_0x59be59[_0x4e3d('0x44')]['id']){delete _0x59be59[_0x4e3d('0x44')]['id'];}return db[_0x4e3d('0x41')]['find']({'where':{'id':_0x59be59['params']['id']}})[_0x4e3d('0x22')](handleEntityNotFound(_0x346997,null))[_0x4e3d('0x22')](saveUpdates(_0x59be59[_0x4e3d('0x44')],null))[_0x4e3d('0x22')](respondWithResult(_0x346997,null))[_0x4e3d('0x3e')](handleError(_0x346997,null));};exports[_0x4e3d('0x21')]=function(_0x1c8460,_0x283be4){return db[_0x4e3d('0x41')][_0x4e3d('0x42')]({'where':{'id':_0x1c8460[_0x4e3d('0x3f')]['id']}})['then'](handleEntityNotFound(_0x283be4,null))[_0x4e3d('0x22')](removeEntity(_0x283be4,null))['catch'](handleError(_0x283be4,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 0e3c3aa..e8289d6 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 _0xb0e3=['exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Field.attributes'];(function(_0x4533c4,_0x10cd99){var _0x2fd2aa=function(_0x44bdcd){while(--_0x44bdcd){_0x4533c4['push'](_0x4533c4['shift']());}};_0x2fd2aa(++_0x10cd99);}(_0xb0e3,0xf6));var _0x3b0e=function(_0x26ad2f,_0x471a63){_0x26ad2f=_0x26ad2f-0x0;var _0x5277d3=_0xb0e3[_0x26ad2f];return _0x5277d3;};'use strict';var _=require(_0x3b0e('0x0'));var util=require('util');var logger=require(_0x3b0e('0x1'))(_0x3b0e('0x2'));var moment=require(_0x3b0e('0x3'));var BPromise=require(_0x3b0e('0x4'));var rp=require(_0x3b0e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3b0e('0x6'));var config=require(_0x3b0e('0x7'));var attributes=require(_0x3b0e('0x8'));module[_0x3b0e('0x9')]=function(_0x2f4289,_0x5da566){return _0x2f4289[_0x3b0e('0xa')](_0x3b0e('0xb'),attributes,{'tableName':_0x3b0e('0xc'),'paranoid':![],'indexes':[{'name':_0x3b0e('0xd'),'fields':['idField',_0x3b0e('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7cb0=['Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes'];(function(_0x46588f,_0x2aa977){var _0xa10917=function(_0x2616bf){while(--_0x2616bf){_0x46588f['push'](_0x46588f['shift']());}};_0xa10917(++_0x2aa977);}(_0x7cb0,0x17c));var _0x07cb=function(_0x15165e,_0x47648c){_0x15165e=_0x15165e-0x0;var _0x3383e3=_0x7cb0[_0x15165e];return _0x3383e3;};'use strict';var _=require('lodash');var util=require(_0x07cb('0x0'));var logger=require(_0x07cb('0x1'))(_0x07cb('0x2'));var moment=require(_0x07cb('0x3'));var BPromise=require(_0x07cb('0x4'));var rp=require(_0x07cb('0x5'));var fs=require('fs');var path=require(_0x07cb('0x6'));var rimraf=require(_0x07cb('0x7'));var config=require(_0x07cb('0x8'));var attributes=require(_0x07cb('0x9'));module['exports']=function(_0x5da6e9,_0xa6b9c2){return _0x5da6e9['define'](_0x07cb('0xa'),attributes,{'tableName':_0x07cb('0xb'),'paranoid':![],'indexes':[{'name':_0x07cb('0xc'),'fields':[_0x07cb('0xd'),_0x07cb('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index 0b9e5ec..66091a7 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 _0xc880=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x47eb31,_0x33de43){var _0x568e09=function(_0x115893){while(--_0x115893){_0x47eb31['push'](_0x47eb31['shift']());}};_0x568e09(++_0x33de43);}(_0xc880,0x1a6));var _0x0c88=function(_0x1af4fd,_0x281909){_0x1af4fd=_0x1af4fd-0x0;var _0x3874e9=_0xc880[_0x1af4fd];return _0x3874e9;};'use strict';var _=require(_0x0c88('0x0'));var util=require(_0x0c88('0x1'));var moment=require(_0x0c88('0x2'));var BPromise=require(_0x0c88('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c88('0x4'));var db=require(_0x0c88('0x5'))['db'];var utils=require(_0x0c88('0x6'));var logger=require(_0x0c88('0x7'))('rpc');var config=require(_0x0c88('0x8'));var jayson=require(_0x0c88('0x9'));var client=jayson[_0x0c88('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58ab02,_0x2702c6,_0x1fa841){return new BPromise(function(_0x2e3aef,_0xd0dd89){return client['request'](_0x58ab02,_0x1fa841)[_0x0c88('0xb')](function(_0x1b6126){logger['info'](_0x0c88('0xc'),_0x2702c6,_0x0c88('0xd'));logger[_0x0c88('0xe')](_0x0c88('0xf'),_0x2702c6,'request\x20sent',JSON['stringify'](_0x1b6126));if(_0x1b6126['error']){if(_0x1b6126[_0x0c88('0x10')]['code']===0x1f4){logger['error'](_0x0c88('0xc'),_0x2702c6,_0x1b6126['error'][_0x0c88('0x11')]);return _0xd0dd89(_0x1b6126[_0x0c88('0x10')][_0x0c88('0x11')]);}logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x2702c6,_0x1b6126['error']['message']);return _0x2e3aef(_0x1b6126['error']['message']);}else{logger[_0x0c88('0x12')](_0x0c88('0xc'),_0x2702c6,_0x0c88('0xd'));_0x2e3aef(_0x1b6126[_0x0c88('0x13')][_0x0c88('0x11')]);}})[_0x0c88('0x14')](function(_0x7e7ec2){logger[_0x0c88('0x10')](_0x0c88('0xc'),_0x2702c6,_0x7e7ec2);_0xd0dd89(_0x7e7ec2);});});} \ No newline at end of file +var _0xcac0=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x218a78,_0x173e9d){var _0x4f4deb=function(_0x34ce17){while(--_0x34ce17){_0x218a78['push'](_0x218a78['shift']());}};_0x4f4deb(++_0x173e9d);}(_0xcac0,0x1cf));var _0x0cac=function(_0x365b0e,_0x3122d3){_0x365b0e=_0x365b0e-0x0;var _0x5ca753=_0xcac0[_0x365b0e];return _0x5ca753;};'use strict';var _=require(_0x0cac('0x0'));var util=require(_0x0cac('0x1'));var moment=require(_0x0cac('0x2'));var BPromise=require(_0x0cac('0x3'));var rs=require(_0x0cac('0x4'));var fs=require('fs');var Redis=require(_0x0cac('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0cac('0x6'));var logger=require('../../config/logger')(_0x0cac('0x7'));var config=require(_0x0cac('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0cac('0x9')][_0x0cac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19642a,_0x3af094,_0x2d1a09){return new BPromise(function(_0x32f743,_0x4a57ea){return client['request'](_0x19642a,_0x2d1a09)[_0x0cac('0xb')](function(_0x497bf4){logger['info'](_0x0cac('0xc'),_0x3af094,_0x0cac('0xd'));logger[_0x0cac('0xe')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x3af094,_0x0cac('0xd'),JSON[_0x0cac('0xf')](_0x497bf4));if(_0x497bf4['error']){if(_0x497bf4[_0x0cac('0x10')][_0x0cac('0x11')]===0x1f4){logger[_0x0cac('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x3af094,_0x497bf4['error']['message']);return _0x4a57ea(_0x497bf4[_0x0cac('0x10')][_0x0cac('0x12')]);}logger[_0x0cac('0x10')](_0x0cac('0xc'),_0x3af094,_0x497bf4[_0x0cac('0x10')][_0x0cac('0x12')]);return _0x32f743(_0x497bf4[_0x0cac('0x10')][_0x0cac('0x12')]);}else{logger[_0x0cac('0x13')]('Dynamics365Field,\x20%s,\x20%s',_0x3af094,_0x0cac('0xd'));_0x32f743(_0x497bf4['result'][_0x0cac('0x12')]);}})[_0x0cac('0x14')](function(_0x3e3bd7){logger[_0x0cac('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x3af094,_0x3e3bd7);_0x4a57ea(_0x3e3bd7);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index b8b4c6d..fd72b13 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 _0xa5c1=['/:id','show','/:id/configurations','isAuthenticated','/:id/fields','getFields','create','post','addConfiguration','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get'];(function(_0x440df5,_0x49237a){var _0x40e0d5=function(_0x5ad5a9){while(--_0x5ad5a9){_0x440df5['push'](_0x440df5['shift']());}};_0x40e0d5(++_0x49237a);}(_0xa5c1,0x95));var _0x1a5c=function(_0x3ed5df,_0x271c72){_0x3ed5df=_0x3ed5df-0x0;var _0x360d39=_0xa5c1[_0x3ed5df];return _0x360d39;};'use strict';var multer=require(_0x1a5c('0x0'));var util=require(_0x1a5c('0x1'));var path=require(_0x1a5c('0x2'));var timeout=require(_0x1a5c('0x3'));var express=require(_0x1a5c('0x4'));var router=express[_0x1a5c('0x5')]();var fs_extra=require(_0x1a5c('0x6'));var auth=require(_0x1a5c('0x7'));var interaction=require(_0x1a5c('0x8'));var config=require(_0x1a5c('0x9'));var controller=require('./intFreshdeskAccount.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x1a5c('0xa')]);router[_0x1a5c('0xb')](_0x1a5c('0xc'),auth['isAuthenticated'](),controller[_0x1a5c('0xd')]);router[_0x1a5c('0xb')](_0x1a5c('0xe'),auth[_0x1a5c('0xf')](),controller['getConfigurations']);router['get'](_0x1a5c('0x10'),auth[_0x1a5c('0xf')](),controller[_0x1a5c('0x11')]);router['post']('/',auth[_0x1a5c('0xf')](),controller[_0x1a5c('0x12')]);router[_0x1a5c('0x13')](_0x1a5c('0xe'),auth['isAuthenticated'](),controller[_0x1a5c('0x14')]);router['put']('/:id',auth[_0x1a5c('0xf')](),controller[_0x1a5c('0x15')]);router[_0x1a5c('0x16')](_0x1a5c('0xc'),auth[_0x1a5c('0xf')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xba29=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','isAuthenticated','index','get','show','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','/:id','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x4e9ea6,_0x346aee){var _0x94d7b=function(_0x4dc010){while(--_0x4dc010){_0x4e9ea6['push'](_0x4e9ea6['shift']());}};_0x94d7b(++_0x346aee);}(_0xba29,0x6e));var _0x9ba2=function(_0x214d89,_0x4b0bee){_0x214d89=_0x214d89-0x0;var _0x2577ee=_0xba29[_0x214d89];return _0x2577ee;};'use strict';var multer=require(_0x9ba2('0x0'));var util=require('util');var path=require(_0x9ba2('0x1'));var timeout=require(_0x9ba2('0x2'));var express=require(_0x9ba2('0x3'));var router=express[_0x9ba2('0x4')]();var fs_extra=require(_0x9ba2('0x5'));var auth=require(_0x9ba2('0x6'));var interaction=require(_0x9ba2('0x7'));var config=require(_0x9ba2('0x8'));var controller=require(_0x9ba2('0x9'));router['get']('/',auth[_0x9ba2('0xa')](),controller[_0x9ba2('0xb')]);router[_0x9ba2('0xc')]('/:id',auth[_0x9ba2('0xa')](),controller[_0x9ba2('0xd')]);router['get'](_0x9ba2('0xe'),auth['isAuthenticated'](),controller[_0x9ba2('0xf')]);router[_0x9ba2('0xc')](_0x9ba2('0x10'),auth[_0x9ba2('0xa')](),controller['getFields']);router[_0x9ba2('0x11')]('/',auth[_0x9ba2('0xa')](),controller['create']);router[_0x9ba2('0x11')](_0x9ba2('0xe'),auth['isAuthenticated'](),controller[_0x9ba2('0x12')]);router['put'](_0x9ba2('0x13'),auth[_0x9ba2('0xa')](),controller['update']);router[_0x9ba2('0x14')](_0x9ba2('0x13'),auth[_0x9ba2('0xa')](),controller[_0x9ba2('0x15')]);module[_0x9ba2('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 3db1c17..3dfbf8d 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 _0xf4f4=['exports','STRING','username','sequelize'];(function(_0x3bbd6b,_0x498df1){var _0x1d27fc=function(_0x2d7be7){while(--_0x2d7be7){_0x3bbd6b['push'](_0x3bbd6b['shift']());}};_0x1d27fc(++_0x498df1);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x7b3ebf,_0x58145b){_0x7b3ebf=_0x7b3ebf-0x0;var _0x2a8186=_0xf4f4[_0x7b3ebf];return _0x2a8186;};'use strict';var Sequelize=require(_0x4f4f('0x0'));module[_0x4f4f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4f4f('0x2')]},'username':{'type':Sequelize[_0x4f4f('0x2')],'unique':_0x4f4f('0x3')},'apiKey':{'type':Sequelize[_0x4f4f('0x2')]},'remoteUri':{'type':Sequelize[_0x4f4f('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x4f4f('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x056b=['username','remoteUri','exports','STRING'];(function(_0x10909e,_0x21281e){var _0x4e0a8a=function(_0x550cf4){while(--_0x550cf4){_0x10909e['push'](_0x10909e['shift']());}};_0x4e0a8a(++_0x21281e);}(_0x056b,0xb6));var _0xb056=function(_0x11cfca,_0x4f3bc6){_0x11cfca=_0x11cfca-0x0;var _0x2c8cd6=_0x056b[_0x11cfca];return _0x2c8cd6;};'use strict';var Sequelize=require('sequelize');module[_0xb056('0x0')]={'name':{'type':Sequelize[_0xb056('0x1')]},'description':{'type':Sequelize[_0xb056('0x1')]},'username':{'type':Sequelize[_0xb056('0x1')],'unique':_0xb056('0x2')},'apiKey':{'type':Sequelize[_0xb056('0x1')]},'remoteUri':{'type':Sequelize[_0xb056('0x1')],'unique':_0xb056('0x3')},'serverUrl':{'type':Sequelize[_0xb056('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 a0a2a5e..d0d73e9 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 _0x85ed=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','options','FreshdeskAccount','include','findAll','rows','catch','show','params','rawAttributes','fields','includeAll','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','%s:X','toString','base64','subject','agent','description','priority','group','source','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0x21d2e6,_0x5266d5){var _0x24e979=function(_0x513a98){while(--_0x513a98){_0x21d2e6['push'](_0x21d2e6['shift']());}};_0x24e979(++_0x5266d5);}(_0x85ed,0x66));var _0xd85e=function(_0x2a67fe,_0x295c09){_0x2a67fe=_0x2a67fe-0x0;var _0x57e726=_0x85ed[_0x2a67fe];return _0x57e726;};'use strict';var emlformat=require(_0xd85e('0x0'));var rimraf=require(_0xd85e('0x1'));var zipdir=require(_0xd85e('0x2'));var jsonpatch=require(_0xd85e('0x3'));var rp=require(_0xd85e('0x4'));var moment=require(_0xd85e('0x5'));var BPromise=require(_0xd85e('0x6'));var Mustache=require('mustache');var util=require(_0xd85e('0x7'));var path=require(_0xd85e('0x8'));var sox=require(_0xd85e('0x9'));var csv=require(_0xd85e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd85e('0xb'));var _=require(_0xd85e('0xc'));var squel=require('squel');var crypto=require(_0xd85e('0xd'));var jsforce=require(_0xd85e('0xe'));var deskjs=require(_0xd85e('0xf'));var toCsv=require(_0xd85e('0xa'));var querystring=require('querystring');var Papa=require(_0xd85e('0x10'));var Redis=require(_0xd85e('0x11'));var authService=require(_0xd85e('0x12'));var qs=require(_0xd85e('0x13'));var as=require(_0xd85e('0x14'));var hardwareService=require(_0xd85e('0x15'));var logger=require('../../config/logger')(_0xd85e('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd85e('0x17'));var db=require(_0xd85e('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x374652,_0x7d5918){_0x7d5918=_0x7d5918||0xcc;return function(_0x3fcc31){if(_0x3fcc31){return _0x374652['sendStatus'](_0x7d5918);}return _0x374652[_0xd85e('0x19')](_0x7d5918)[_0xd85e('0x1a')]();};}function respondWithResult(_0xe0c8df,_0x32a52c){_0x32a52c=_0x32a52c||0xc8;return function(_0x1765d5){if(_0x1765d5){return _0xe0c8df['status'](_0x32a52c)[_0xd85e('0x1b')](_0x1765d5);}};}function respondWithFilteredResult(_0x5ba31d,_0x3aa5f6){return function(_0x3123a3){if(_0x3123a3){var _0x398a7b=typeof _0x3aa5f6['offset']===_0xd85e('0x1c')&&typeof _0x3aa5f6[_0xd85e('0x1d')]==='undefined';var _0x425def=_0x3123a3[_0xd85e('0x1e')];var _0x25bbfd=_0x398a7b?0x0:_0x3aa5f6['offset'];var _0x3a5370=_0x398a7b?_0x3123a3[_0xd85e('0x1e')]:_0x3aa5f6[_0xd85e('0x1f')]+_0x3aa5f6[_0xd85e('0x1d')];var _0x45c1c0;if(_0x3a5370>=_0x425def){_0x3a5370=_0x425def;_0x45c1c0=0xc8;}else{_0x45c1c0=0xce;}_0x5ba31d[_0xd85e('0x19')](_0x45c1c0);return _0x5ba31d[_0xd85e('0x20')](_0xd85e('0x21'),_0x25bbfd+'-'+_0x3a5370+'/'+_0x425def)[_0xd85e('0x1b')](_0x3123a3);}return null;};}function patchUpdates(_0x3834ad){return function(_0x55b1f3){try{jsonpatch[_0xd85e('0x22')](_0x55b1f3,_0x3834ad,!![]);}catch(_0x10390a){return BPromise[_0xd85e('0x23')](_0x10390a);}return _0x55b1f3[_0xd85e('0x24')]();};}function saveUpdates(_0xe9991,_0x595199){return function(_0x33e48f){if(_0x33e48f){return _0x33e48f[_0xd85e('0x25')](_0xe9991)[_0xd85e('0x26')](function(_0x4f620e){return _0x4f620e;});}return null;};}function removeEntity(_0x45c727,_0x44168e){return function(_0x250dce){if(_0x250dce){return _0x250dce[_0xd85e('0x27')]()[_0xd85e('0x26')](function(){_0x45c727[_0xd85e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x176a58,_0x91b328){return function(_0x3826c5){if(!_0x3826c5){_0x176a58[_0xd85e('0x28')](0x194);}return _0x3826c5;};}function handleError(_0xe89be1,_0x400ffd){_0x400ffd=_0x400ffd||0x1f4;return function(_0x338445){logger[_0xd85e('0x29')](_0x338445['stack']);if(_0x338445['name']){delete _0x338445[_0xd85e('0x2a')];}_0xe89be1[_0xd85e('0x19')](_0x400ffd)[_0xd85e('0x2b')](_0x338445);};}exports['index']=function(_0x53b7da,_0x305891){var _0x5691a8={},_0x5826d5={},_0x1ede22={'count':0x0,'rows':[]};var _0x3f760e=_[_0xd85e('0x2c')](db['FreshdeskAccount']['rawAttributes'],function(_0x5c5d9e){return{'name':_0x5c5d9e['fieldName'],'type':_0x5c5d9e['type'][_0xd85e('0x2d')]};});_0x5826d5[_0xd85e('0x2e')]=_[_0xd85e('0x2c')](_0x3f760e,'name');_0x5826d5[_0xd85e('0x2f')]=_[_0xd85e('0x30')](_0x53b7da[_0xd85e('0x2f')]);_0x5826d5[_0xd85e('0x31')]=_['intersection'](_0x5826d5[_0xd85e('0x2e')],_0x5826d5[_0xd85e('0x2f')]);_0x5691a8[_0xd85e('0x32')]=_[_0xd85e('0x33')](_0x5826d5[_0xd85e('0x2e')],qs['fields'](_0x53b7da[_0xd85e('0x2f')]['fields']));_0x5691a8['attributes']=_0x5691a8[_0xd85e('0x32')][_0xd85e('0x34')]?_0x5691a8[_0xd85e('0x32')]:_0x5826d5['model'];if(!_0x53b7da['query'][_0xd85e('0x35')]('nolimit')){_0x5691a8[_0xd85e('0x1d')]=qs['limit'](_0x53b7da['query'][_0xd85e('0x1d')]);_0x5691a8[_0xd85e('0x1f')]=qs['offset'](_0x53b7da[_0xd85e('0x2f')][_0xd85e('0x1f')]);}_0x5691a8[_0xd85e('0x36')]=qs[_0xd85e('0x37')](_0x53b7da[_0xd85e('0x2f')][_0xd85e('0x37')]);_0x5691a8[_0xd85e('0x38')]=qs[_0xd85e('0x31')](_[_0xd85e('0x39')](_0x53b7da[_0xd85e('0x2f')],_0x5826d5[_0xd85e('0x31')]),_0x3f760e);if(_0x53b7da[_0xd85e('0x2f')][_0xd85e('0x3a')]){_0x5691a8[_0xd85e('0x38')]=_['merge'](_0x5691a8[_0xd85e('0x38')],{'$or':_[_0xd85e('0x2c')](_0x3f760e,function(_0x2b3ddb){if(_0x2b3ddb[_0xd85e('0x3b')]!==_0xd85e('0x3c')){var _0x16c90a={};_0x16c90a[_0x2b3ddb[_0xd85e('0x2a')]]={'$like':'%'+_0x53b7da[_0xd85e('0x2f')][_0xd85e('0x3a')]+'%'};return _0x16c90a;}})});}_0x5691a8=_[_0xd85e('0x3d')]({},_0x5691a8,_0x53b7da[_0xd85e('0x3e')]);var _0x24cda4={'where':_0x5691a8[_0xd85e('0x38')]};return db[_0xd85e('0x3f')]['count'](_0x24cda4)[_0xd85e('0x26')](function(_0x2b4ed9){_0x1ede22[_0xd85e('0x1e')]=_0x2b4ed9;if(_0x53b7da['query']['includeAll']){_0x5691a8[_0xd85e('0x40')]=[{'all':!![]}];}return db[_0xd85e('0x3f')][_0xd85e('0x41')](_0x5691a8);})['then'](function(_0xc7260f){_0x1ede22[_0xd85e('0x42')]=_0xc7260f;return _0x1ede22;})[_0xd85e('0x26')](respondWithFilteredResult(_0x305891,_0x5691a8))[_0xd85e('0x43')](handleError(_0x305891,null));};exports[_0xd85e('0x44')]=function(_0x4483ef,_0x1157ab){var _0x304fb2={'raw':![],'where':{'id':_0x4483ef[_0xd85e('0x45')]['id']}},_0x22a7f6={};_0x22a7f6['model']=_[_0xd85e('0x30')](db['FreshdeskAccount'][_0xd85e('0x46')]);_0x22a7f6[_0xd85e('0x2f')]=_[_0xd85e('0x30')](_0x4483ef[_0xd85e('0x2f')]);_0x22a7f6[_0xd85e('0x31')]=_[_0xd85e('0x33')](_0x22a7f6[_0xd85e('0x2e')],_0x22a7f6[_0xd85e('0x2f')]);_0x304fb2[_0xd85e('0x32')]=_[_0xd85e('0x33')](_0x22a7f6[_0xd85e('0x2e')],qs['fields'](_0x4483ef['query'][_0xd85e('0x47')]));_0x304fb2[_0xd85e('0x32')]=_0x304fb2[_0xd85e('0x32')][_0xd85e('0x34')]?_0x304fb2[_0xd85e('0x32')]:_0x22a7f6['model'];if(_0x4483ef['query'][_0xd85e('0x48')]){_0x304fb2[_0xd85e('0x40')]=[{'all':!![]}];}_0x304fb2=_[_0xd85e('0x3d')]({},_0x304fb2,_0x4483ef[_0xd85e('0x3e')]);return db[_0xd85e('0x3f')][_0xd85e('0x49')](_0x304fb2)[_0xd85e('0x26')](handleEntityNotFound(_0x1157ab,null))['then'](respondWithResult(_0x1157ab,null))[_0xd85e('0x43')](handleError(_0x1157ab,null));};exports[_0xd85e('0x4a')]=function(_0x17f3da,_0x1f85ca){return db[_0xd85e('0x3f')][_0xd85e('0x4a')](_0x17f3da[_0xd85e('0x4b')],{})[_0xd85e('0x26')](respondWithResult(_0x1f85ca,0xc9))[_0xd85e('0x43')](handleError(_0x1f85ca,null));};exports[_0xd85e('0x25')]=function(_0x11945f,_0x1336b2){if(_0x11945f[_0xd85e('0x4b')]['id']){delete _0x11945f[_0xd85e('0x4b')]['id'];}return db[_0xd85e('0x3f')][_0xd85e('0x49')]({'where':{'id':_0x11945f['params']['id']}})[_0xd85e('0x26')](handleEntityNotFound(_0x1336b2,null))[_0xd85e('0x26')](saveUpdates(_0x11945f[_0xd85e('0x4b')],null))[_0xd85e('0x26')](respondWithResult(_0x1336b2,null))['catch'](handleError(_0x1336b2,null));};exports[_0xd85e('0x27')]=function(_0x2588d6,_0x2a5bbb){return db['FreshdeskAccount'][_0xd85e('0x49')]({'where':{'id':_0x2588d6[_0xd85e('0x45')]['id']}})[_0xd85e('0x26')](handleEntityNotFound(_0x2a5bbb,null))['then'](removeEntity(_0x2a5bbb,null))[_0xd85e('0x43')](handleError(_0x2a5bbb,null));};exports[_0xd85e('0x4c')]=function(_0x54e005,_0x168178,_0xcf1098){var _0x56191c={};var _0x24e8aa={};var _0x10bca7;var _0x23b83a;return db[_0xd85e('0x3f')][_0xd85e('0x4d')]({'where':{'id':_0x54e005[_0xd85e('0x45')]['id']}})[_0xd85e('0x26')](handleEntityNotFound(_0x168178,null))['then'](function(_0x17049c){if(_0x17049c){_0x10bca7=_0x17049c;_0x24e8aa[_0xd85e('0x2e')]=_[_0xd85e('0x30')](db[_0xd85e('0x4e')][_0xd85e('0x46')]);_0x24e8aa['query']=_[_0xd85e('0x30')](_0x54e005['query']);_0x24e8aa[_0xd85e('0x31')]=_['intersection'](_0x24e8aa['model'],_0x24e8aa[_0xd85e('0x2f')]);_0x56191c[_0xd85e('0x32')]=_[_0xd85e('0x33')](_0x24e8aa['model'],qs[_0xd85e('0x47')](_0x54e005['query'][_0xd85e('0x47')]));_0x56191c['attributes']=_0x56191c['attributes'][_0xd85e('0x34')]?_0x56191c[_0xd85e('0x32')]:_0x24e8aa[_0xd85e('0x2e')];_0x56191c[_0xd85e('0x36')]=qs[_0xd85e('0x37')](_0x54e005[_0xd85e('0x2f')][_0xd85e('0x37')]);_0x56191c[_0xd85e('0x38')]=qs[_0xd85e('0x31')](_['pick'](_0x54e005['query'],_0x24e8aa[_0xd85e('0x31')]));if(_0x54e005[_0xd85e('0x2f')][_0xd85e('0x3a')]){_0x56191c['where']=_[_0xd85e('0x3d')](_0x56191c[_0xd85e('0x38')],{'$or':_[_0xd85e('0x2c')](_0x56191c[_0xd85e('0x32')],function(_0x52c605){var _0x91f67a={};_0x91f67a[_0x52c605]={'$like':'%'+_0x54e005[_0xd85e('0x2f')][_0xd85e('0x3a')]+'%'};return _0x91f67a;})});}_0x56191c=_['merge']({},_0x56191c,_0x54e005['options']);return _0x10bca7[_0xd85e('0x4c')](_0x56191c);}})[_0xd85e('0x26')](function(_0x1dca75){if(_0x1dca75){_0x23b83a=_0x1dca75['length'];if(!_0x54e005[_0xd85e('0x2f')][_0xd85e('0x35')]('nolimit')){_0x56191c[_0xd85e('0x1d')]=qs[_0xd85e('0x1d')](_0x54e005[_0xd85e('0x2f')][_0xd85e('0x1d')]);_0x56191c[_0xd85e('0x1f')]=qs[_0xd85e('0x1f')](_0x54e005['query']['offset']);}return _0x10bca7[_0xd85e('0x4c')](_0x56191c);}})['then'](function(_0x28988d){if(_0x28988d){return _0x28988d?{'count':_0x23b83a,'rows':_0x28988d}:null;}})[_0xd85e('0x26')](respondWithResult(_0x168178,null))[_0xd85e('0x43')](handleError(_0x168178,null));};exports[_0xd85e('0x4f')]=function(_0x147c7f,_0x568f3d,_0x1e7d32){if(_0x147c7f['body']['id']){delete _0x147c7f[_0xd85e('0x4b')]['id'];}return db[_0xd85e('0x3f')]['findOne']({'where':{'id':_0x147c7f[_0xd85e('0x45')]['id']}})[_0xd85e('0x26')](handleEntityNotFound(_0x568f3d,null))['then'](function(_0x14de94){if(_0x14de94){_0x147c7f[_0xd85e('0x4b')][_0xd85e('0x50')]=_0x14de94['id'];_0x147c7f['body'][_0xd85e('0x51')]=integrations[_0xd85e('0x52')](_0x147c7f[_0xd85e('0x4b')][_0xd85e('0x53')],_0x147c7f[_0xd85e('0x4b')][_0xd85e('0x3b')]);_0x147c7f[_0xd85e('0x4b')]['Descriptions']=integrations[_0xd85e('0x54')](_0x147c7f[_0xd85e('0x4b')]['channel'],_0x147c7f['body'][_0xd85e('0x3b')]);return db[_0xd85e('0x4e')]['create'](_0x147c7f[_0xd85e('0x4b')],{'include':[{'model':db[_0xd85e('0x55')],'as':_0xd85e('0x51')},{'model':db[_0xd85e('0x55')],'as':_0xd85e('0x56')}]});}return null;})['then'](respondWithResult(_0x568f3d,null))[_0xd85e('0x43')](handleError(_0x568f3d,null));};exports[_0xd85e('0x57')]=function(_0x15b741,_0x261d6c,_0x1e808f){var _0xe3bdfb='';return db[_0xd85e('0x3f')][_0xd85e('0x4d')]({'where':{'id':_0x15b741[_0xd85e('0x45')]['id']},'attributes':['id',_0xd85e('0x58'),_0xd85e('0x59')]})[_0xd85e('0x26')](handleEntityNotFound(_0x261d6c,null))[_0xd85e('0x26')](function(_0x12035f){if(_0x12035f){_0xe3bdfb=_0x12035f['remoteUri'];var _0x1cb869=_0xe3bdfb['slice'](-0x1);if(_0x1cb869==='/'){_0xe3bdfb=_0xe3bdfb[_0xd85e('0x5a')](0x0,_0xe3bdfb[_0xd85e('0x5b')](_0x1cb869));}return rp({'method':_0xd85e('0x5c'),'uri':util[_0xd85e('0x5d')](_0xd85e('0x5e'),_0xe3bdfb,_0xd85e('0x5f')),'headers':{'Authorization':util[_0xd85e('0x5d')]('Basic\x20%s',new Buffer(util[_0xd85e('0x5d')](_0xd85e('0x60'),_0x12035f[_0xd85e('0x59')]))[_0xd85e('0x61')](_0xd85e('0x62')))},'json':!![]});}})[_0xd85e('0x26')](function(_0x3d2d4d){if(_0x3d2d4d){var _0x40abc4=['requester',_0xd85e('0x63'),_0xd85e('0x64'),_0xd85e('0x65'),_0xd85e('0x19'),_0xd85e('0x66'),_0xd85e('0x67'),_0xd85e('0x68'),_0xd85e('0x69'),'group',_0xd85e('0x6a')];_[_0xd85e('0x6b')](_0x3d2d4d,function(_0x558e6d){return _0x40abc4[_0xd85e('0x6c')](_0x558e6d[_0xd85e('0x2a')])||!_0x558e6d[_0xd85e('0x6d')]&&_0x558e6d[_0xd85e('0x3b')]!==_0xd85e('0x6e')&&_0x558e6d[_0xd85e('0x3b')]!==_0xd85e('0x6f');});return{'count':_0x3d2d4d[_0xd85e('0x34')],'rows':_[_0xd85e('0x2c')](_0x3d2d4d,function(_0x4fb93c){return{'id':_0x4fb93c[_0xd85e('0x2a')],'name':_0x4fb93c[_0xd85e('0x70')],'custom':!_0x4fb93c[_0xd85e('0x6d')],'options':_0x4fb93c[_0xd85e('0x71')]?_['map'](_0x4fb93c[_0xd85e('0x71')],function(_0x5eb4f0){return{'name':_[_0xd85e('0x72')](_0x5eb4f0),'value':_0x5eb4f0};}):[]};})};}})[_0xd85e('0x26')](respondWithResult(_0x261d6c,null))['catch'](function(_0x2b4982){var _0x4145d2=_0x15b741[_0xd85e('0x2f')][_0xd85e('0x73')]?0x1f4:_0x2b4982[_0xd85e('0x74')]||0x1f4;logger[_0xd85e('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0xd85e('0x57'),_0x4145d2,JSON['stringify'](_0x2b4982));delete _0x2b4982['name'];if(_0x4145d2===0x191){_0x4145d2=0x190;}_0x261d6c[_0xd85e('0x19')](_0x4145d2)[_0xd85e('0x2b')](_0x15b741[_0xd85e('0x2f')][_0xd85e('0x73')]?{'message':_0xd85e('0x75'),'statusCode':_0x2b4982[_0xd85e('0x74')]}:_0x2b4982);});}; \ No newline at end of file +var _0xfbe2=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','stack','name','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','query','filters','model','attributes','intersection','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','length','find','catch','create','body','getConfigurations','findOne','hasOwnProperty','addConfiguration','AccountId','getSubjects','Descriptions','channel','FreshdeskConfiguration','FreshdeskField','Subjects','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','requester','subject','agent','priority','group','source','ticket_type','company','includes','default','custom_text','custom_dropdown','label','choices','capitalize','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0xfbe2,0x1da));var _0x2fbe=function(_0x1032bd,_0x263dcc){_0x1032bd=_0x1032bd-0x0;var _0x85db08=_0xfbe2[_0x1032bd];return _0x85db08;};'use strict';var emlformat=require(_0x2fbe('0x0'));var rimraf=require(_0x2fbe('0x1'));var zipdir=require(_0x2fbe('0x2'));var jsonpatch=require(_0x2fbe('0x3'));var rp=require('request-promise');var moment=require(_0x2fbe('0x4'));var BPromise=require(_0x2fbe('0x5'));var Mustache=require(_0x2fbe('0x6'));var util=require('util');var path=require(_0x2fbe('0x7'));var sox=require(_0x2fbe('0x8'));var csv=require(_0x2fbe('0x9'));var ejs=require(_0x2fbe('0xa'));var fs=require('fs');var fs_extra=require(_0x2fbe('0xb'));var _=require(_0x2fbe('0xc'));var squel=require(_0x2fbe('0xd'));var crypto=require(_0x2fbe('0xe'));var jsforce=require(_0x2fbe('0xf'));var deskjs=require(_0x2fbe('0x10'));var toCsv=require(_0x2fbe('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2fbe('0x11'));var authService=require(_0x2fbe('0x12'));var qs=require(_0x2fbe('0x13'));var as=require(_0x2fbe('0x14'));var hardwareService=require(_0x2fbe('0x15'));var logger=require(_0x2fbe('0x16'))(_0x2fbe('0x17'));var utils=require(_0x2fbe('0x18'));var config=require(_0x2fbe('0x19'));var licenseUtil=require(_0x2fbe('0x1a'));var db=require(_0x2fbe('0x1b'))['db'];var integrations=require(_0x2fbe('0x1c'));function respondWithStatusCode(_0x421387,_0x12be84){_0x12be84=_0x12be84||0xcc;return function(_0x511986){if(_0x511986){return _0x421387[_0x2fbe('0x1d')](_0x12be84);}return _0x421387[_0x2fbe('0x1e')](_0x12be84)[_0x2fbe('0x1f')]();};}function respondWithResult(_0x2dcfbb,_0x19777a){_0x19777a=_0x19777a||0xc8;return function(_0x1cff2a){if(_0x1cff2a){return _0x2dcfbb['status'](_0x19777a)[_0x2fbe('0x20')](_0x1cff2a);}};}function respondWithFilteredResult(_0x312970,_0x556a98){return function(_0x19d8fd){if(_0x19d8fd){var _0x56aa7d=typeof _0x556a98['offset']===_0x2fbe('0x21')&&typeof _0x556a98[_0x2fbe('0x22')]===_0x2fbe('0x21');var _0x7a2f2b=_0x19d8fd[_0x2fbe('0x23')];var _0x1dc730=_0x56aa7d?0x0:_0x556a98[_0x2fbe('0x24')];var _0x3fefe7=_0x56aa7d?_0x19d8fd[_0x2fbe('0x23')]:_0x556a98[_0x2fbe('0x24')]+_0x556a98[_0x2fbe('0x22')];var _0x4eed5a;if(_0x3fefe7>=_0x7a2f2b){_0x3fefe7=_0x7a2f2b;_0x4eed5a=0xc8;}else{_0x4eed5a=0xce;}_0x312970[_0x2fbe('0x1e')](_0x4eed5a);return _0x312970[_0x2fbe('0x25')](_0x2fbe('0x26'),_0x1dc730+'-'+_0x3fefe7+'/'+_0x7a2f2b)['json'](_0x19d8fd);}return null;};}function patchUpdates(_0x4c8f8f){return function(_0x451f1a){try{jsonpatch[_0x2fbe('0x27')](_0x451f1a,_0x4c8f8f,!![]);}catch(_0x2efbb3){return BPromise['reject'](_0x2efbb3);}return _0x451f1a[_0x2fbe('0x28')]();};}function saveUpdates(_0x1e3462,_0x30e978){return function(_0x489b46){if(_0x489b46){return _0x489b46[_0x2fbe('0x29')](_0x1e3462)[_0x2fbe('0x2a')](function(_0x5c1315){return _0x5c1315;});}return null;};}function removeEntity(_0x41f262,_0x5ba00e){return function(_0x14755c){if(_0x14755c){return _0x14755c[_0x2fbe('0x2b')]()[_0x2fbe('0x2a')](function(){_0x41f262[_0x2fbe('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e4255,_0x81e1fc){return function(_0x4590a2){if(!_0x4590a2){_0x5e4255[_0x2fbe('0x1d')](0x194);}return _0x4590a2;};}function handleError(_0x477e8c,_0x2a6bc8){_0x2a6bc8=_0x2a6bc8||0x1f4;return function(_0x5b52c0){logger['error'](_0x5b52c0[_0x2fbe('0x2c')]);if(_0x5b52c0[_0x2fbe('0x2d')]){delete _0x5b52c0[_0x2fbe('0x2d')];}_0x477e8c[_0x2fbe('0x1e')](_0x2a6bc8)['send'](_0x5b52c0);};}exports[_0x2fbe('0x2e')]=function(_0x5bf90c,_0x1fdf03){var _0x467760={},_0x37732d={},_0x1c9735={'count':0x0,'rows':[]};var _0x1d9376=_[_0x2fbe('0x2f')](db[_0x2fbe('0x30')][_0x2fbe('0x31')],function(_0xccf503){return{'name':_0xccf503[_0x2fbe('0x32')],'type':_0xccf503[_0x2fbe('0x33')][_0x2fbe('0x34')]};});_0x37732d['model']=_[_0x2fbe('0x2f')](_0x1d9376,_0x2fbe('0x2d'));_0x37732d[_0x2fbe('0x35')]=_['keys'](_0x5bf90c['query']);_0x37732d[_0x2fbe('0x36')]=_['intersection'](_0x37732d[_0x2fbe('0x37')],_0x37732d[_0x2fbe('0x35')]);_0x467760[_0x2fbe('0x38')]=_[_0x2fbe('0x39')](_0x37732d[_0x2fbe('0x37')],qs['fields'](_0x5bf90c[_0x2fbe('0x35')][_0x2fbe('0x3a')]));_0x467760['attributes']=_0x467760['attributes']['length']?_0x467760[_0x2fbe('0x38')]:_0x37732d[_0x2fbe('0x37')];if(!_0x5bf90c['query']['hasOwnProperty']('nolimit')){_0x467760['limit']=qs[_0x2fbe('0x22')](_0x5bf90c[_0x2fbe('0x35')][_0x2fbe('0x22')]);_0x467760[_0x2fbe('0x24')]=qs[_0x2fbe('0x24')](_0x5bf90c[_0x2fbe('0x35')][_0x2fbe('0x24')]);}_0x467760[_0x2fbe('0x3b')]=qs[_0x2fbe('0x3c')](_0x5bf90c['query'][_0x2fbe('0x3c')]);_0x467760[_0x2fbe('0x3d')]=qs[_0x2fbe('0x36')](_[_0x2fbe('0x3e')](_0x5bf90c[_0x2fbe('0x35')],_0x37732d[_0x2fbe('0x36')]),_0x1d9376);if(_0x5bf90c[_0x2fbe('0x35')][_0x2fbe('0x3f')]){_0x467760['where']=_[_0x2fbe('0x40')](_0x467760['where'],{'$or':_[_0x2fbe('0x2f')](_0x1d9376,function(_0x11bf78){if(_0x11bf78[_0x2fbe('0x33')]!==_0x2fbe('0x41')){var _0x5df9a2={};_0x5df9a2[_0x11bf78['name']]={'$like':'%'+_0x5bf90c[_0x2fbe('0x35')][_0x2fbe('0x3f')]+'%'};return _0x5df9a2;}})});}_0x467760=_[_0x2fbe('0x40')]({},_0x467760,_0x5bf90c[_0x2fbe('0x42')]);var _0x34bd86={'where':_0x467760[_0x2fbe('0x3d')]};return db[_0x2fbe('0x30')][_0x2fbe('0x23')](_0x34bd86)[_0x2fbe('0x2a')](function(_0x577b3f){_0x1c9735[_0x2fbe('0x23')]=_0x577b3f;if(_0x5bf90c[_0x2fbe('0x35')][_0x2fbe('0x43')]){_0x467760[_0x2fbe('0x44')]=[{'all':!![]}];}return db[_0x2fbe('0x30')][_0x2fbe('0x45')](_0x467760);})[_0x2fbe('0x2a')](function(_0x1b0bf0){_0x1c9735[_0x2fbe('0x46')]=_0x1b0bf0;return _0x1c9735;})[_0x2fbe('0x2a')](respondWithFilteredResult(_0x1fdf03,_0x467760))['catch'](handleError(_0x1fdf03,null));};exports[_0x2fbe('0x47')]=function(_0x3b4ffd,_0x1e4edd){var _0x414c0c={'raw':![],'where':{'id':_0x3b4ffd[_0x2fbe('0x48')]['id']}},_0x5b6f4a={};_0x5b6f4a[_0x2fbe('0x37')]=_[_0x2fbe('0x49')](db[_0x2fbe('0x30')][_0x2fbe('0x31')]);_0x5b6f4a['query']=_[_0x2fbe('0x49')](_0x3b4ffd[_0x2fbe('0x35')]);_0x5b6f4a[_0x2fbe('0x36')]=_[_0x2fbe('0x39')](_0x5b6f4a[_0x2fbe('0x37')],_0x5b6f4a[_0x2fbe('0x35')]);_0x414c0c[_0x2fbe('0x38')]=_[_0x2fbe('0x39')](_0x5b6f4a[_0x2fbe('0x37')],qs[_0x2fbe('0x3a')](_0x3b4ffd['query']['fields']));_0x414c0c['attributes']=_0x414c0c[_0x2fbe('0x38')][_0x2fbe('0x4a')]?_0x414c0c[_0x2fbe('0x38')]:_0x5b6f4a['model'];if(_0x3b4ffd['query']['includeAll']){_0x414c0c[_0x2fbe('0x44')]=[{'all':!![]}];}_0x414c0c=_[_0x2fbe('0x40')]({},_0x414c0c,_0x3b4ffd[_0x2fbe('0x42')]);return db[_0x2fbe('0x30')][_0x2fbe('0x4b')](_0x414c0c)[_0x2fbe('0x2a')](handleEntityNotFound(_0x1e4edd,null))[_0x2fbe('0x2a')](respondWithResult(_0x1e4edd,null))[_0x2fbe('0x4c')](handleError(_0x1e4edd,null));};exports['create']=function(_0x4597b0,_0xa6dceb){return db[_0x2fbe('0x30')][_0x2fbe('0x4d')](_0x4597b0['body'],{})[_0x2fbe('0x2a')](respondWithResult(_0xa6dceb,0xc9))[_0x2fbe('0x4c')](handleError(_0xa6dceb,null));};exports['update']=function(_0x4a213c,_0x2a3187){if(_0x4a213c['body']['id']){delete _0x4a213c[_0x2fbe('0x4e')]['id'];}return db[_0x2fbe('0x30')]['find']({'where':{'id':_0x4a213c['params']['id']}})[_0x2fbe('0x2a')](handleEntityNotFound(_0x2a3187,null))[_0x2fbe('0x2a')](saveUpdates(_0x4a213c[_0x2fbe('0x4e')],null))['then'](respondWithResult(_0x2a3187,null))['catch'](handleError(_0x2a3187,null));};exports[_0x2fbe('0x2b')]=function(_0x271a7f,_0x1dc755){return db[_0x2fbe('0x30')]['find']({'where':{'id':_0x271a7f[_0x2fbe('0x48')]['id']}})[_0x2fbe('0x2a')](handleEntityNotFound(_0x1dc755,null))['then'](removeEntity(_0x1dc755,null))[_0x2fbe('0x4c')](handleError(_0x1dc755,null));};exports[_0x2fbe('0x4f')]=function(_0x3f3151,_0x558ead,_0x3308f1){var _0x4fd22b={};var _0x4735a1={};var _0x17ce09;var _0x2bdfb0;return db[_0x2fbe('0x30')][_0x2fbe('0x50')]({'where':{'id':_0x3f3151[_0x2fbe('0x48')]['id']}})['then'](handleEntityNotFound(_0x558ead,null))[_0x2fbe('0x2a')](function(_0x5d5a5f){if(_0x5d5a5f){_0x17ce09=_0x5d5a5f;_0x4735a1[_0x2fbe('0x37')]=_[_0x2fbe('0x49')](db['FreshdeskConfiguration'][_0x2fbe('0x31')]);_0x4735a1[_0x2fbe('0x35')]=_['keys'](_0x3f3151['query']);_0x4735a1[_0x2fbe('0x36')]=_[_0x2fbe('0x39')](_0x4735a1[_0x2fbe('0x37')],_0x4735a1[_0x2fbe('0x35')]);_0x4fd22b[_0x2fbe('0x38')]=_[_0x2fbe('0x39')](_0x4735a1['model'],qs['fields'](_0x3f3151['query'][_0x2fbe('0x3a')]));_0x4fd22b[_0x2fbe('0x38')]=_0x4fd22b[_0x2fbe('0x38')][_0x2fbe('0x4a')]?_0x4fd22b[_0x2fbe('0x38')]:_0x4735a1[_0x2fbe('0x37')];_0x4fd22b[_0x2fbe('0x3b')]=qs[_0x2fbe('0x3c')](_0x3f3151[_0x2fbe('0x35')]['sort']);_0x4fd22b[_0x2fbe('0x3d')]=qs[_0x2fbe('0x36')](_[_0x2fbe('0x3e')](_0x3f3151[_0x2fbe('0x35')],_0x4735a1[_0x2fbe('0x36')]));if(_0x3f3151['query'][_0x2fbe('0x3f')]){_0x4fd22b['where']=_['merge'](_0x4fd22b[_0x2fbe('0x3d')],{'$or':_[_0x2fbe('0x2f')](_0x4fd22b[_0x2fbe('0x38')],function(_0x8a7a22){var _0x2df572={};_0x2df572[_0x8a7a22]={'$like':'%'+_0x3f3151[_0x2fbe('0x35')][_0x2fbe('0x3f')]+'%'};return _0x2df572;})});}_0x4fd22b=_[_0x2fbe('0x40')]({},_0x4fd22b,_0x3f3151[_0x2fbe('0x42')]);return _0x17ce09[_0x2fbe('0x4f')](_0x4fd22b);}})[_0x2fbe('0x2a')](function(_0x247c68){if(_0x247c68){_0x2bdfb0=_0x247c68[_0x2fbe('0x4a')];if(!_0x3f3151[_0x2fbe('0x35')][_0x2fbe('0x51')]('nolimit')){_0x4fd22b['limit']=qs[_0x2fbe('0x22')](_0x3f3151['query'][_0x2fbe('0x22')]);_0x4fd22b[_0x2fbe('0x24')]=qs['offset'](_0x3f3151[_0x2fbe('0x35')]['offset']);}return _0x17ce09[_0x2fbe('0x4f')](_0x4fd22b);}})[_0x2fbe('0x2a')](function(_0x415e76){if(_0x415e76){return _0x415e76?{'count':_0x2bdfb0,'rows':_0x415e76}:null;}})[_0x2fbe('0x2a')](respondWithResult(_0x558ead,null))[_0x2fbe('0x4c')](handleError(_0x558ead,null));};exports[_0x2fbe('0x52')]=function(_0x4b12be,_0x559682,_0x23d8c7){if(_0x4b12be[_0x2fbe('0x4e')]['id']){delete _0x4b12be[_0x2fbe('0x4e')]['id'];}return db[_0x2fbe('0x30')][_0x2fbe('0x50')]({'where':{'id':_0x4b12be[_0x2fbe('0x48')]['id']}})['then'](handleEntityNotFound(_0x559682,null))[_0x2fbe('0x2a')](function(_0x451626){if(_0x451626){_0x4b12be[_0x2fbe('0x4e')][_0x2fbe('0x53')]=_0x451626['id'];_0x4b12be['body']['Subjects']=integrations[_0x2fbe('0x54')](_0x4b12be['body']['channel'],_0x4b12be[_0x2fbe('0x4e')]['type']);_0x4b12be[_0x2fbe('0x4e')][_0x2fbe('0x55')]=integrations['getDescriptions'](_0x4b12be[_0x2fbe('0x4e')][_0x2fbe('0x56')],_0x4b12be[_0x2fbe('0x4e')][_0x2fbe('0x33')]);return db[_0x2fbe('0x57')][_0x2fbe('0x4d')](_0x4b12be[_0x2fbe('0x4e')],{'include':[{'model':db[_0x2fbe('0x58')],'as':_0x2fbe('0x59')},{'model':db[_0x2fbe('0x58')],'as':_0x2fbe('0x55')}]});}return null;})[_0x2fbe('0x2a')](respondWithResult(_0x559682,null))['catch'](handleError(_0x559682,null));};exports['getFields']=function(_0x48f2cc,_0x241796,_0x30c763){var _0x33cfe1='';return db['FreshdeskAccount'][_0x2fbe('0x50')]({'where':{'id':_0x48f2cc[_0x2fbe('0x48')]['id']},'attributes':['id',_0x2fbe('0x5a'),'apiKey']})[_0x2fbe('0x2a')](handleEntityNotFound(_0x241796,null))[_0x2fbe('0x2a')](function(_0x37b02f){if(_0x37b02f){_0x33cfe1=_0x37b02f[_0x2fbe('0x5a')];var _0x3c5a8b=_0x33cfe1[_0x2fbe('0x5b')](-0x1);if(_0x3c5a8b==='/'){_0x33cfe1=_0x33cfe1[_0x2fbe('0x5c')](0x0,_0x33cfe1[_0x2fbe('0x5d')](_0x3c5a8b));}return rp({'method':_0x2fbe('0x5e'),'uri':util[_0x2fbe('0x5f')](_0x2fbe('0x60'),_0x33cfe1,_0x2fbe('0x61')),'headers':{'Authorization':util[_0x2fbe('0x5f')](_0x2fbe('0x62'),new Buffer(util[_0x2fbe('0x5f')](_0x2fbe('0x63'),_0x37b02f['apiKey']))['toString']('base64'))},'json':!![]});}})['then'](function(_0x24d7ae){if(_0x24d7ae){var _0x2fbc02=[_0x2fbe('0x64'),_0x2fbe('0x65'),_0x2fbe('0x66'),'description',_0x2fbe('0x1e'),_0x2fbe('0x67'),_0x2fbe('0x68'),_0x2fbe('0x69'),_0x2fbe('0x6a'),_0x2fbe('0x68'),_0x2fbe('0x6b')];_['remove'](_0x24d7ae,function(_0x27634b){return _0x2fbc02[_0x2fbe('0x6c')](_0x27634b['name'])||!_0x27634b[_0x2fbe('0x6d')]&&_0x27634b['type']!==_0x2fbe('0x6e')&&_0x27634b[_0x2fbe('0x33')]!==_0x2fbe('0x6f');});return{'count':_0x24d7ae[_0x2fbe('0x4a')],'rows':_[_0x2fbe('0x2f')](_0x24d7ae,function(_0x3c72f2){return{'id':_0x3c72f2['name'],'name':_0x3c72f2[_0x2fbe('0x70')],'custom':!_0x3c72f2[_0x2fbe('0x6d')],'options':_0x3c72f2[_0x2fbe('0x71')]?_['map'](_0x3c72f2[_0x2fbe('0x71')],function(_0x2be9c4){return{'name':_[_0x2fbe('0x72')](_0x2be9c4),'value':_0x2be9c4};}):[]};})};}})[_0x2fbe('0x2a')](respondWithResult(_0x241796,null))[_0x2fbe('0x4c')](function(_0x4323f6){var _0x1ceddb=_0x48f2cc[_0x2fbe('0x35')]['test']?0x1f4:_0x4323f6[_0x2fbe('0x73')]||0x1f4;logger[_0x2fbe('0x74')](_0x2fbe('0x75'),_0x2fbe('0x76'),_0x1ceddb,JSON[_0x2fbe('0x77')](_0x4323f6));delete _0x4323f6[_0x2fbe('0x2d')];if(_0x1ceddb===0x191){_0x1ceddb=0x190;}_0x241796['status'](_0x1ceddb)[_0x2fbe('0x78')](_0x48f2cc[_0x2fbe('0x35')][_0x2fbe('0x79')]?{'message':_0x2fbe('0x7a'),'statusCode':_0x4323f6['statusCode']}:_0x4323f6);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 5178641..80ca2e9 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 _0x83db=['api','path','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger'];(function(_0x352713,_0x737610){var _0x46a4ea=function(_0x379929){while(--_0x379929){_0x352713['push'](_0x352713['shift']());}};_0x46a4ea(++_0x737610);}(_0x83db,0x1f1));var _0xb83d=function(_0x25cb76,_0x1f85e5){_0x25cb76=_0x25cb76-0x0;var _0x12b9ad=_0x83db[_0x25cb76];return _0x12b9ad;};'use strict';var _=require(_0xb83d('0x0'));var util=require(_0xb83d('0x1'));var logger=require(_0xb83d('0x2'))(_0xb83d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb83d('0x4'));var rimraf=require(_0xb83d('0x5'));var config=require('../../config/environment');var attributes=require(_0xb83d('0x6'));var integrations=require(_0xb83d('0x7'));module['exports']=function(_0x5f1de1,_0x203c2f){return _0x5f1de1['define'](_0xb83d('0x8'),attributes,{'tableName':_0xb83d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e38=['define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','moment','bluebird','request-promise','../../components/integrations/configuration','exports'];(function(_0x4f77bf,_0x5e9da7){var _0x2faf36=function(_0xcb6b88){while(--_0xcb6b88){_0x4f77bf['push'](_0x4f77bf['shift']());}};_0x2faf36(++_0x5e9da7);}(_0x5e38,0x1c5));var _0x85e3=function(_0x5425fa,_0x16459a){_0x5425fa=_0x5425fa-0x0;var _0x85e40f=_0x5e38[_0x5425fa];return _0x85e40f;};'use strict';var _=require(_0x85e3('0x0'));var util=require(_0x85e3('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x85e3('0x2'));var BPromise=require(_0x85e3('0x3'));var rp=require(_0x85e3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x85e3('0x5'));module[_0x85e3('0x6')]=function(_0x18fcf2,_0x912b46){return _0x18fcf2[_0x85e3('0x7')](_0x85e3('0x8'),attributes,{'tableName':_0x85e3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index cacdbd9..c51baef 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 _0x61b6=['attributes','map','include','model','then','ShowFreshdeskAccount','FreshdeskAccount','find','raw','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFreshdeskAccount','findAll','options','where'];(function(_0x221043,_0x82632e){var _0x26879a=function(_0x29e8eb){while(--_0x29e8eb){_0x221043['push'](_0x221043['shift']());}};_0x26879a(++_0x82632e);}(_0x61b6,0x17f));var _0x661b=function(_0xb0895d,_0xc497b8){_0xb0895d=_0xb0895d-0x0;var _0x3c2e0d=_0x61b6[_0xb0895d];return _0x3c2e0d;};'use strict';var _=require(_0x661b('0x0'));var util=require('util');var moment=require(_0x661b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x661b('0x2'));var db=require(_0x661b('0x3'))['db'];var utils=require(_0x661b('0x4'));var logger=require(_0x661b('0x5'))(_0x661b('0x6'));var config=require(_0x661b('0x7'));var jayson=require(_0x661b('0x8'));var client=jayson[_0x661b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35732e,_0x40a547,_0x7e6abb){return new BPromise(function(_0x33ebc2,_0x3fcc9d){return client['request'](_0x35732e,_0x7e6abb)['then'](function(_0x40b66b){logger[_0x661b('0xa')](_0x661b('0xb'),_0x40a547,_0x661b('0xc'));logger[_0x661b('0xd')](_0x661b('0xe'),_0x40a547,'request\x20sent',JSON[_0x661b('0xf')](_0x40b66b));if(_0x40b66b[_0x661b('0x10')]){if(_0x40b66b[_0x661b('0x10')][_0x661b('0x11')]===0x1f4){logger['error'](_0x661b('0xb'),_0x40a547,_0x40b66b[_0x661b('0x10')]['message']);return _0x3fcc9d(_0x40b66b[_0x661b('0x10')][_0x661b('0x12')]);}logger[_0x661b('0x10')](_0x661b('0xb'),_0x40a547,_0x40b66b['error'][_0x661b('0x12')]);return _0x33ebc2(_0x40b66b['error']['message']);}else{logger[_0x661b('0xa')](_0x661b('0xb'),_0x40a547,_0x661b('0xc'));_0x33ebc2(_0x40b66b[_0x661b('0x13')][_0x661b('0x12')]);}})[_0x661b('0x14')](function(_0x15b243){logger[_0x661b('0x10')](_0x661b('0xb'),_0x40a547,_0x15b243);_0x3fcc9d(_0x15b243);});});}exports[_0x661b('0x15')]=function(_0x3551fc){var _0x11a415=this;return new Promise(function(_0x5bef82,_0x182b6e){return db['FreshdeskAccount'][_0x661b('0x16')]({'raw':_0x3551fc[_0x661b('0x17')]?_0x3551fc['options']['raw']===undefined?!![]:![]:!![],'where':_0x3551fc[_0x661b('0x17')]?_0x3551fc[_0x661b('0x17')][_0x661b('0x18')]||null:null,'attributes':_0x3551fc[_0x661b('0x17')]?_0x3551fc['options'][_0x661b('0x19')]||null:null,'limit':_0x3551fc[_0x661b('0x17')]?_0x3551fc['options']['limit']||null:null,'include':_0x3551fc['options']?_0x3551fc[_0x661b('0x17')]['include']?_[_0x661b('0x1a')](_0x3551fc['options'][_0x661b('0x1b')],function(_0x5d9311){return{'model':db[_0x5d9311[_0x661b('0x1c')]],'as':_0x5d9311['as'],'attributes':_0x5d9311[_0x661b('0x19')],'include':_0x5d9311['include']?_['map'](_0x5d9311[_0x661b('0x1b')],function(_0xfa7b07){return{'model':db[_0xfa7b07[_0x661b('0x1c')]],'as':_0xfa7b07['as'],'attributes':_0xfa7b07['attributes'],'include':_0xfa7b07['include']?_[_0x661b('0x1a')](_0xfa7b07[_0x661b('0x1b')],function(_0x4408c7){return{'model':db[_0x4408c7[_0x661b('0x1c')]],'as':_0x4408c7['as'],'attributes':_0x4408c7[_0x661b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x661b('0x1d')](function(_0x1385d2){logger[_0x661b('0xa')](_0x661b('0x15'),_0x3551fc);logger[_0x661b('0xd')](_0x661b('0x15'),_0x3551fc,JSON[_0x661b('0xf')](_0x1385d2));_0x5bef82(_0x1385d2);})[_0x661b('0x14')](function(_0x19f3c0){logger[_0x661b('0x10')](_0x661b('0x15'),_0x19f3c0['message'],_0x3551fc);_0x182b6e(_0x11a415[_0x661b('0x10')](0x1f4,_0x19f3c0['message']));});});};exports[_0x661b('0x1e')]=function(_0x27b9ba){var _0x19c52d=this;return new Promise(function(_0x43ade1,_0x4ad7fc){return db[_0x661b('0x1f')][_0x661b('0x20')]({'raw':_0x27b9ba[_0x661b('0x17')]?_0x27b9ba[_0x661b('0x17')][_0x661b('0x21')]===undefined?!![]:![]:!![],'where':_0x27b9ba[_0x661b('0x17')]?_0x27b9ba['options'][_0x661b('0x18')]||null:null,'attributes':_0x27b9ba[_0x661b('0x17')]?_0x27b9ba['options']['attributes']||null:null,'include':_0x27b9ba[_0x661b('0x17')]?_0x27b9ba[_0x661b('0x17')]['include']?_['map'](_0x27b9ba['options']['include'],function(_0x4645bc){return{'model':db[_0x4645bc[_0x661b('0x1c')]],'as':_0x4645bc['as'],'attributes':_0x4645bc['attributes'],'include':_0x4645bc[_0x661b('0x1b')]?_[_0x661b('0x1a')](_0x4645bc[_0x661b('0x1b')],function(_0x311cf6){return{'model':db[_0x311cf6[_0x661b('0x1c')]],'as':_0x311cf6['as'],'attributes':_0x311cf6[_0x661b('0x19')],'include':_0x311cf6[_0x661b('0x1b')]?_[_0x661b('0x1a')](_0x311cf6[_0x661b('0x1b')],function(_0x2a7507){return{'model':db[_0x2a7507[_0x661b('0x1c')]],'as':_0x2a7507['as'],'attributes':_0x2a7507[_0x661b('0x19')]};}):[]};}):[]};}):[]:[]})[_0x661b('0x1d')](function(_0x13fa1a){logger[_0x661b('0xa')](_0x661b('0x1e'),_0x27b9ba);logger['debug'](_0x661b('0x1e'),_0x27b9ba,JSON[_0x661b('0xf')](_0x13fa1a));_0x43ade1(_0x13fa1a);})[_0x661b('0x14')](function(_0x32e59b){logger['error'](_0x661b('0x1e'),_0x32e59b[_0x661b('0x12')],_0x27b9ba);_0x4ad7fc(_0x19c52d[_0x661b('0x10')](0x1f4,_0x32e59b[_0x661b('0x12')]));});});}; \ No newline at end of file +var _0x0124=['rpc','../../config/environment','jayson/promise','http','then','info','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','FreshdeskAccount,\x20%s,\x20%s','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','include','model','map','stringify','catch','ShowFreshdeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2c574e,_0x491053){var _0x1101f7=function(_0x5285c2){while(--_0x5285c2){_0x2c574e['push'](_0x2c574e['shift']());}};_0x1101f7(++_0x491053);}(_0x0124,0x108));var _0x4012=function(_0x42ec8f,_0x43ac68){_0x42ec8f=_0x42ec8f-0x0;var _0x3475e5=_0x0124[_0x42ec8f];return _0x3475e5;};'use strict';var _=require(_0x4012('0x0'));var util=require(_0x4012('0x1'));var moment=require(_0x4012('0x2'));var BPromise=require(_0x4012('0x3'));var rs=require(_0x4012('0x4'));var fs=require('fs');var Redis=require(_0x4012('0x5'));var db=require(_0x4012('0x6'))['db'];var utils=require(_0x4012('0x7'));var logger=require('../../config/logger')(_0x4012('0x8'));var config=require(_0x4012('0x9'));var jayson=require(_0x4012('0xa'));var client=jayson['client'][_0x4012('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9b3f75,_0x45e58a,_0x48e0f4){return new BPromise(function(_0x32147f,_0x2b33a7){return client['request'](_0x9b3f75,_0x48e0f4)[_0x4012('0xc')](function(_0x1f2528){logger[_0x4012('0xd')]('FreshdeskAccount,\x20%s,\x20%s',_0x45e58a,'request\x20sent');logger[_0x4012('0xe')](_0x4012('0xf'),_0x45e58a,_0x4012('0x10'),JSON['stringify'](_0x1f2528));if(_0x1f2528[_0x4012('0x11')]){if(_0x1f2528[_0x4012('0x11')]['code']===0x1f4){logger[_0x4012('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x45e58a,_0x1f2528[_0x4012('0x11')][_0x4012('0x12')]);return _0x2b33a7(_0x1f2528[_0x4012('0x11')][_0x4012('0x12')]);}logger[_0x4012('0x11')](_0x4012('0x13'),_0x45e58a,_0x1f2528['error'][_0x4012('0x12')]);return _0x32147f(_0x1f2528['error'][_0x4012('0x12')]);}else{logger[_0x4012('0xd')](_0x4012('0x13'),_0x45e58a,'request\x20sent');_0x32147f(_0x1f2528[_0x4012('0x14')]['message']);}})['catch'](function(_0x1c708e){logger[_0x4012('0x11')](_0x4012('0x13'),_0x45e58a,_0x1c708e);_0x2b33a7(_0x1c708e);});});}exports[_0x4012('0x15')]=function(_0x2cfa08){var _0x9b786d=this;return new Promise(function(_0x2f59cd,_0x43ca84){return db[_0x4012('0x16')][_0x4012('0x17')]({'raw':_0x2cfa08['options']?_0x2cfa08[_0x4012('0x18')][_0x4012('0x19')]===undefined?!![]:![]:!![],'where':_0x2cfa08[_0x4012('0x18')]?_0x2cfa08[_0x4012('0x18')][_0x4012('0x1a')]||null:null,'attributes':_0x2cfa08[_0x4012('0x18')]?_0x2cfa08[_0x4012('0x18')][_0x4012('0x1b')]||null:null,'limit':_0x2cfa08[_0x4012('0x18')]?_0x2cfa08[_0x4012('0x18')]['limit']||null:null,'include':_0x2cfa08[_0x4012('0x18')]?_0x2cfa08[_0x4012('0x18')]['include']?_['map'](_0x2cfa08[_0x4012('0x18')][_0x4012('0x1c')],function(_0x168b4d){return{'model':db[_0x168b4d[_0x4012('0x1d')]],'as':_0x168b4d['as'],'attributes':_0x168b4d[_0x4012('0x1b')],'include':_0x168b4d['include']?_[_0x4012('0x1e')](_0x168b4d[_0x4012('0x1c')],function(_0x25ab11){return{'model':db[_0x25ab11[_0x4012('0x1d')]],'as':_0x25ab11['as'],'attributes':_0x25ab11['attributes'],'include':_0x25ab11[_0x4012('0x1c')]?_[_0x4012('0x1e')](_0x25ab11[_0x4012('0x1c')],function(_0x223245){return{'model':db[_0x223245['model']],'as':_0x223245['as'],'attributes':_0x223245[_0x4012('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4012('0xc')](function(_0x3c0101){logger['info'](_0x4012('0x15'),_0x2cfa08);logger['debug'](_0x4012('0x15'),_0x2cfa08,JSON[_0x4012('0x1f')](_0x3c0101));_0x2f59cd(_0x3c0101);})[_0x4012('0x20')](function(_0x119533){logger['error']('GetFreshdeskAccount',_0x119533[_0x4012('0x12')],_0x2cfa08);_0x43ca84(_0x9b786d['error'](0x1f4,_0x119533[_0x4012('0x12')]));});});};exports['ShowFreshdeskAccount']=function(_0x516233){var _0x25b160=this;return new Promise(function(_0x531eb8,_0x472c1a){return db['FreshdeskAccount']['find']({'raw':_0x516233[_0x4012('0x18')]?_0x516233[_0x4012('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x516233[_0x4012('0x18')]?_0x516233[_0x4012('0x18')][_0x4012('0x1a')]||null:null,'attributes':_0x516233[_0x4012('0x18')]?_0x516233[_0x4012('0x18')]['attributes']||null:null,'include':_0x516233[_0x4012('0x18')]?_0x516233[_0x4012('0x18')][_0x4012('0x1c')]?_['map'](_0x516233['options']['include'],function(_0x2689e8){return{'model':db[_0x2689e8[_0x4012('0x1d')]],'as':_0x2689e8['as'],'attributes':_0x2689e8[_0x4012('0x1b')],'include':_0x2689e8[_0x4012('0x1c')]?_[_0x4012('0x1e')](_0x2689e8[_0x4012('0x1c')],function(_0x3385ff){return{'model':db[_0x3385ff[_0x4012('0x1d')]],'as':_0x3385ff['as'],'attributes':_0x3385ff[_0x4012('0x1b')],'include':_0x3385ff[_0x4012('0x1c')]?_[_0x4012('0x1e')](_0x3385ff[_0x4012('0x1c')],function(_0x1ea79a){return{'model':db[_0x1ea79a[_0x4012('0x1d')]],'as':_0x1ea79a['as'],'attributes':_0x1ea79a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x475a59){logger[_0x4012('0xd')](_0x4012('0x21'),_0x516233);logger[_0x4012('0xe')](_0x4012('0x21'),_0x516233,JSON[_0x4012('0x1f')](_0x475a59));_0x531eb8(_0x475a59);})[_0x4012('0x20')](function(_0x500869){logger[_0x4012('0x11')](_0x4012('0x21'),_0x500869['message'],_0x516233);_0x472c1a(_0x25b160[_0x4012('0x11')](0x1f4,_0x500869[_0x4012('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index d0e9f76..6da622a 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 _0x3da1=['/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','setTags','delete','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','/:id','/:id/fields','getFields'];(function(_0x1ef565,_0x3ab6d7){var _0x26ca86=function(_0x2c77be){while(--_0x2c77be){_0x1ef565['push'](_0x1ef565['shift']());}};_0x26ca86(++_0x3ab6d7);}(_0x3da1,0x1e7));var _0x13da=function(_0x5b10cf,_0x2b1e47){_0x5b10cf=_0x5b10cf-0x0;var _0x359633=_0x3da1[_0x5b10cf];return _0x359633;};'use strict';var multer=require(_0x13da('0x0'));var util=require(_0x13da('0x1'));var path=require(_0x13da('0x2'));var timeout=require('connect-timeout');var express=require(_0x13da('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x13da('0x4'));var interaction=require(_0x13da('0x5'));var config=require(_0x13da('0x6'));var controller=require(_0x13da('0x7'));router[_0x13da('0x8')]('/',auth[_0x13da('0x9')](),controller['index']);router[_0x13da('0x8')](_0x13da('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x13da('0x8')](_0x13da('0xb'),auth['isAuthenticated'](),controller[_0x13da('0xc')]);router[_0x13da('0x8')](_0x13da('0xd'),auth[_0x13da('0x9')](),controller['getSubjects']);router[_0x13da('0x8')](_0x13da('0xe'),auth['isAuthenticated'](),controller[_0x13da('0xf')]);router['get'](_0x13da('0x10'),auth[_0x13da('0x9')](),controller[_0x13da('0x11')]);router['post']('/',auth[_0x13da('0x9')](),controller['create']);router['post']('/:id/tags',auth[_0x13da('0x9')](),controller[_0x13da('0x12')]);router['put'](_0x13da('0xa'),auth[_0x13da('0x9')](),controller['update']);router[_0x13da('0x13')](_0x13da('0xa'),auth[_0x13da('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc1ef=['update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','get','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getTags','post','create','/:id/tags','setTags'];(function(_0x4f4609,_0x44dea9){var _0x5c9ab3=function(_0x5cf14b){while(--_0x5cf14b){_0x4f4609['push'](_0x4f4609['shift']());}};_0x5c9ab3(++_0x44dea9);}(_0xc1ef,0xaa));var _0xfc1e=function(_0xf28b8,_0x186d5c){_0xf28b8=_0xf28b8-0x0;var _0x1c80ba=_0xc1ef[_0xf28b8];return _0x1c80ba;};'use strict';var multer=require(_0xfc1e('0x0'));var util=require(_0xfc1e('0x1'));var path=require('path');var timeout=require(_0xfc1e('0x2'));var express=require(_0xfc1e('0x3'));var router=express[_0xfc1e('0x4')]();var fs_extra=require(_0xfc1e('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xfc1e('0x6'));var config=require(_0xfc1e('0x7'));var controller=require(_0xfc1e('0x8'));router['get']('/',auth[_0xfc1e('0x9')](),controller['index']);router[_0xfc1e('0xa')](_0xfc1e('0xb'),auth[_0xfc1e('0x9')](),controller[_0xfc1e('0xc')]);router[_0xfc1e('0xa')](_0xfc1e('0xd'),auth[_0xfc1e('0x9')](),controller[_0xfc1e('0xe')]);router[_0xfc1e('0xa')](_0xfc1e('0xf'),auth[_0xfc1e('0x9')](),controller['getSubjects']);router[_0xfc1e('0xa')](_0xfc1e('0x10'),auth['isAuthenticated'](),controller['getDescriptions']);router['get']('/:id/tags',auth['isAuthenticated'](),controller[_0xfc1e('0x11')]);router[_0xfc1e('0x12')]('/',auth[_0xfc1e('0x9')](),controller[_0xfc1e('0x13')]);router['post'](_0xfc1e('0x14'),auth[_0xfc1e('0x9')](),controller[_0xfc1e('0x15')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xfc1e('0x16')]);router['delete'](_0xfc1e('0xb'),auth['isAuthenticated'](),controller[_0xfc1e('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index e828d67..92b0a5a 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 _0xee98=['exports','STRING'];(function(_0x3afa31,_0x374788){var _0x50e9d5=function(_0x2dab71){while(--_0x2dab71){_0x3afa31['push'](_0x3afa31['shift']());}};_0x50e9d5(++_0x374788);}(_0xee98,0xe0));var _0x8ee9=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0xee98[_0x580647];return _0x5f0792;};'use strict';var Sequelize=require('sequelize');module[_0x8ee9('0x0')]={'name':{'type':Sequelize[_0x8ee9('0x1')]},'description':{'type':Sequelize[_0x8ee9('0x1')]}}; \ No newline at end of file +var _0x0f11=['sequelize','exports','STRING'];(function(_0x44451e,_0x3e0201){var _0x2a4582=function(_0x57dac9){while(--_0x57dac9){_0x44451e['push'](_0x44451e['shift']());}};_0x2a4582(++_0x3e0201);}(_0x0f11,0x1c5));var _0x10f1=function(_0x27d9a9,_0x29bc13){_0x27d9a9=_0x27d9a9-0x0;var _0x39bea1=_0x0f11[_0x27d9a9];return _0x39bea1;};'use strict';var Sequelize=require(_0x10f1('0x0'));module[_0x10f1('0x1')]={'name':{'type':Sequelize[_0x10f1('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index e93bf59..73fb5a8 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 _0x5a19=['../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','end','error','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','keys','includeAll','find','create','body','update','getFields','findOne','FreshdeskField','pick','hasOwnProperty','getSubjects','getDescriptions','getTags','setTags','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x3170fc,_0x555526){var _0x583a21=function(_0xbeb069){while(--_0xbeb069){_0x3170fc['push'](_0x3170fc['shift']());}};_0x583a21(++_0x555526);}(_0x5a19,0x132));var _0x95a1=function(_0x55036a,_0x1e43dc){_0x55036a=_0x55036a-0x0;var _0x2ebe00=_0x5a19[_0x55036a];return _0x2ebe00;};'use strict';var emlformat=require(_0x95a1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x95a1('0x1'));var jsonpatch=require(_0x95a1('0x2'));var rp=require(_0x95a1('0x3'));var moment=require(_0x95a1('0x4'));var BPromise=require(_0x95a1('0x5'));var Mustache=require('mustache');var util=require(_0x95a1('0x6'));var path=require('path');var sox=require(_0x95a1('0x7'));var csv=require(_0x95a1('0x8'));var ejs=require(_0x95a1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x95a1('0xa'));var squel=require('squel');var crypto=require(_0x95a1('0xb'));var jsforce=require(_0x95a1('0xc'));var deskjs=require(_0x95a1('0xd'));var toCsv=require(_0x95a1('0x8'));var querystring=require(_0x95a1('0xe'));var Papa=require('papaparse');var Redis=require(_0x95a1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x95a1('0x10'));var as=require(_0x95a1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x95a1('0x12'));var utils=require(_0x95a1('0x13'));var config=require(_0x95a1('0x14'));var licenseUtil=require(_0x95a1('0x15'));var db=require(_0x95a1('0x16'))['db'];function respondWithStatusCode(_0x1428a4,_0x7ceb61){_0x7ceb61=_0x7ceb61||0xcc;return function(_0x35a817){if(_0x35a817){return _0x1428a4[_0x95a1('0x17')](_0x7ceb61);}return _0x1428a4[_0x95a1('0x18')](_0x7ceb61)['end']();};}function respondWithResult(_0x477c9c,_0x2f549d){_0x2f549d=_0x2f549d||0xc8;return function(_0x304742){if(_0x304742){return _0x477c9c[_0x95a1('0x18')](_0x2f549d)[_0x95a1('0x19')](_0x304742);}};}function respondWithFilteredResult(_0x41492f,_0x402f96){return function(_0x4f69a3){if(_0x4f69a3){var _0x84e36d=typeof _0x402f96[_0x95a1('0x1a')]===_0x95a1('0x1b')&&typeof _0x402f96[_0x95a1('0x1c')]==='undefined';var _0x102517=_0x4f69a3[_0x95a1('0x1d')];var _0x217aad=_0x84e36d?0x0:_0x402f96[_0x95a1('0x1a')];var _0x5eac99=_0x84e36d?_0x4f69a3[_0x95a1('0x1d')]:_0x402f96[_0x95a1('0x1a')]+_0x402f96[_0x95a1('0x1c')];var _0x136af2;if(_0x5eac99>=_0x102517){_0x5eac99=_0x102517;_0x136af2=0xc8;}else{_0x136af2=0xce;}_0x41492f[_0x95a1('0x18')](_0x136af2);return _0x41492f['set'](_0x95a1('0x1e'),_0x217aad+'-'+_0x5eac99+'/'+_0x102517)[_0x95a1('0x19')](_0x4f69a3);}return null;};}function patchUpdates(_0x50fd9c){return function(_0x3006af){try{jsonpatch[_0x95a1('0x1f')](_0x3006af,_0x50fd9c,!![]);}catch(_0x26878a){return BPromise[_0x95a1('0x20')](_0x26878a);}return _0x3006af[_0x95a1('0x21')]();};}function saveUpdates(_0x28dd94,_0x296c9c){return function(_0x432668){if(_0x432668){return _0x432668['update'](_0x28dd94)[_0x95a1('0x22')](function(_0x15ba50){return _0x15ba50;});}return null;};}function removeEntity(_0x4c87de,_0x31d53c){return function(_0x284982){if(_0x284982){return _0x284982[_0x95a1('0x23')]()['then'](function(){_0x4c87de[_0x95a1('0x18')](0xcc)[_0x95a1('0x24')]();});}};}function handleEntityNotFound(_0x4cdf2d,_0x557dbf){return function(_0x1cb62d){if(!_0x1cb62d){_0x4cdf2d['sendStatus'](0x194);}return _0x1cb62d;};}function handleError(_0x50b3db,_0x207632){_0x207632=_0x207632||0x1f4;return function(_0x59778c){logger[_0x95a1('0x25')](_0x59778c['stack']);if(_0x59778c[_0x95a1('0x26')]){delete _0x59778c[_0x95a1('0x26')];}_0x50b3db[_0x95a1('0x18')](_0x207632)[_0x95a1('0x27')](_0x59778c);};}exports[_0x95a1('0x28')]=function(_0x342d41,_0x374a0e){var _0x8b47b2={},_0x80769d={},_0xa5956a={'count':0x0,'rows':[]};var _0x11273b=_[_0x95a1('0x29')](db[_0x95a1('0x2a')][_0x95a1('0x2b')],function(_0x1649d3){return{'name':_0x1649d3[_0x95a1('0x2c')],'type':_0x1649d3[_0x95a1('0x2d')][_0x95a1('0x2e')]};});_0x80769d[_0x95a1('0x2f')]=_[_0x95a1('0x29')](_0x11273b,_0x95a1('0x26'));_0x80769d[_0x95a1('0x30')]=_['keys'](_0x342d41['query']);_0x80769d[_0x95a1('0x31')]=_[_0x95a1('0x32')](_0x80769d[_0x95a1('0x2f')],_0x80769d[_0x95a1('0x30')]);_0x8b47b2[_0x95a1('0x33')]=_[_0x95a1('0x32')](_0x80769d[_0x95a1('0x2f')],qs['fields'](_0x342d41[_0x95a1('0x30')][_0x95a1('0x34')]));_0x8b47b2[_0x95a1('0x33')]=_0x8b47b2['attributes'][_0x95a1('0x35')]?_0x8b47b2['attributes']:_0x80769d[_0x95a1('0x2f')];if(!_0x342d41[_0x95a1('0x30')]['hasOwnProperty'](_0x95a1('0x36'))){_0x8b47b2['limit']=qs[_0x95a1('0x1c')](_0x342d41[_0x95a1('0x30')]['limit']);_0x8b47b2[_0x95a1('0x1a')]=qs[_0x95a1('0x1a')](_0x342d41[_0x95a1('0x30')][_0x95a1('0x1a')]);}_0x8b47b2[_0x95a1('0x37')]=qs['sort'](_0x342d41[_0x95a1('0x30')][_0x95a1('0x38')]);_0x8b47b2[_0x95a1('0x39')]=qs['filters'](_['pick'](_0x342d41[_0x95a1('0x30')],_0x80769d[_0x95a1('0x31')]),_0x11273b);if(_0x342d41['query'][_0x95a1('0x3a')]){_0x8b47b2[_0x95a1('0x39')]=_[_0x95a1('0x3b')](_0x8b47b2[_0x95a1('0x39')],{'$or':_[_0x95a1('0x29')](_0x11273b,function(_0x220038){if(_0x220038[_0x95a1('0x2d')]!==_0x95a1('0x3c')){var _0x49e673={};_0x49e673[_0x220038['name']]={'$like':'%'+_0x342d41['query'][_0x95a1('0x3a')]+'%'};return _0x49e673;}})});}_0x8b47b2=_[_0x95a1('0x3b')]({},_0x8b47b2,_0x342d41[_0x95a1('0x3d')]);var _0x4bbe03={'where':_0x8b47b2[_0x95a1('0x39')]};return db[_0x95a1('0x2a')][_0x95a1('0x1d')](_0x4bbe03)[_0x95a1('0x22')](function(_0x560ac3){_0xa5956a['count']=_0x560ac3;if(_0x342d41[_0x95a1('0x30')]['includeAll']){_0x8b47b2['include']=[{'all':!![]}];}return db[_0x95a1('0x2a')][_0x95a1('0x3e')](_0x8b47b2);})[_0x95a1('0x22')](function(_0x2ada55){_0xa5956a[_0x95a1('0x3f')]=_0x2ada55;return _0xa5956a;})[_0x95a1('0x22')](respondWithFilteredResult(_0x374a0e,_0x8b47b2))[_0x95a1('0x40')](handleError(_0x374a0e,null));};exports[_0x95a1('0x41')]=function(_0x3639e4,_0x38780b){var _0x4d4347={'raw':![],'where':{'id':_0x3639e4[_0x95a1('0x42')]['id']}},_0x56ca5c={};_0x56ca5c[_0x95a1('0x2f')]=_[_0x95a1('0x43')](db[_0x95a1('0x2a')][_0x95a1('0x2b')]);_0x56ca5c[_0x95a1('0x30')]=_[_0x95a1('0x43')](_0x3639e4[_0x95a1('0x30')]);_0x56ca5c[_0x95a1('0x31')]=_[_0x95a1('0x32')](_0x56ca5c[_0x95a1('0x2f')],_0x56ca5c[_0x95a1('0x30')]);_0x4d4347[_0x95a1('0x33')]=_['intersection'](_0x56ca5c['model'],qs['fields'](_0x3639e4[_0x95a1('0x30')]['fields']));_0x4d4347[_0x95a1('0x33')]=_0x4d4347[_0x95a1('0x33')][_0x95a1('0x35')]?_0x4d4347[_0x95a1('0x33')]:_0x56ca5c[_0x95a1('0x2f')];if(_0x3639e4[_0x95a1('0x30')][_0x95a1('0x44')]){_0x4d4347['include']=[{'all':!![]}];}_0x4d4347=_[_0x95a1('0x3b')]({},_0x4d4347,_0x3639e4['options']);return db[_0x95a1('0x2a')][_0x95a1('0x45')](_0x4d4347)[_0x95a1('0x22')](handleEntityNotFound(_0x38780b,null))[_0x95a1('0x22')](respondWithResult(_0x38780b,null))['catch'](handleError(_0x38780b,null));};exports[_0x95a1('0x46')]=function(_0x48e01e,_0x23ad28){return db['FreshdeskConfiguration']['create'](_0x48e01e[_0x95a1('0x47')],{})['then'](respondWithResult(_0x23ad28,0xc9))[_0x95a1('0x40')](handleError(_0x23ad28,null));};exports[_0x95a1('0x48')]=function(_0x493796,_0x1cf4af){if(_0x493796[_0x95a1('0x47')]['id']){delete _0x493796[_0x95a1('0x47')]['id'];}return db[_0x95a1('0x2a')][_0x95a1('0x45')]({'where':{'id':_0x493796[_0x95a1('0x42')]['id']}})['then'](handleEntityNotFound(_0x1cf4af,null))['then'](saveUpdates(_0x493796[_0x95a1('0x47')],null))[_0x95a1('0x22')](respondWithResult(_0x1cf4af,null))[_0x95a1('0x40')](handleError(_0x1cf4af,null));};exports[_0x95a1('0x23')]=function(_0x41658a,_0x3e38b9){return db[_0x95a1('0x2a')][_0x95a1('0x45')]({'where':{'id':_0x41658a[_0x95a1('0x42')]['id']}})[_0x95a1('0x22')](handleEntityNotFound(_0x3e38b9,null))['then'](removeEntity(_0x3e38b9,null))['catch'](handleError(_0x3e38b9,null));};exports[_0x95a1('0x49')]=function(_0x358e9e,_0x39ab5d,_0x11ec54){var _0x9e3ab8={};var _0x16c919={};var _0x41a54e;var _0x75e60d;return db['FreshdeskConfiguration'][_0x95a1('0x4a')]({'where':{'id':_0x358e9e[_0x95a1('0x42')]['id']}})['then'](handleEntityNotFound(_0x39ab5d,null))[_0x95a1('0x22')](function(_0x3379ab){if(_0x3379ab){_0x41a54e=_0x3379ab;_0x16c919[_0x95a1('0x2f')]=_[_0x95a1('0x43')](db[_0x95a1('0x4b')][_0x95a1('0x2b')]);_0x16c919[_0x95a1('0x30')]=_[_0x95a1('0x43')](_0x358e9e[_0x95a1('0x30')]);_0x16c919[_0x95a1('0x31')]=_['intersection'](_0x16c919[_0x95a1('0x2f')],_0x16c919[_0x95a1('0x30')]);_0x9e3ab8['attributes']=_['intersection'](_0x16c919[_0x95a1('0x2f')],qs['fields'](_0x358e9e[_0x95a1('0x30')]['fields']));_0x9e3ab8['attributes']=_0x9e3ab8[_0x95a1('0x33')][_0x95a1('0x35')]?_0x9e3ab8['attributes']:_0x16c919['model'];_0x9e3ab8[_0x95a1('0x37')]=qs[_0x95a1('0x38')](_0x358e9e[_0x95a1('0x30')][_0x95a1('0x38')]);_0x9e3ab8[_0x95a1('0x39')]=qs[_0x95a1('0x31')](_[_0x95a1('0x4c')](_0x358e9e[_0x95a1('0x30')],_0x16c919['filters']));if(_0x358e9e[_0x95a1('0x30')][_0x95a1('0x3a')]){_0x9e3ab8[_0x95a1('0x39')]=_[_0x95a1('0x3b')](_0x9e3ab8[_0x95a1('0x39')],{'$or':_[_0x95a1('0x29')](_0x9e3ab8['attributes'],function(_0x853c4d){var _0x5d94b3={};_0x5d94b3[_0x853c4d]={'$like':'%'+_0x358e9e[_0x95a1('0x30')][_0x95a1('0x3a')]+'%'};return _0x5d94b3;})});}_0x9e3ab8=_[_0x95a1('0x3b')]({},_0x9e3ab8,_0x358e9e['options']);return _0x41a54e[_0x95a1('0x49')](_0x9e3ab8);}})[_0x95a1('0x22')](function(_0x1ad2a5){if(_0x1ad2a5){_0x75e60d=_0x1ad2a5['length'];if(!_0x358e9e[_0x95a1('0x30')][_0x95a1('0x4d')]('nolimit')){_0x9e3ab8[_0x95a1('0x1c')]=qs[_0x95a1('0x1c')](_0x358e9e[_0x95a1('0x30')][_0x95a1('0x1c')]);_0x9e3ab8[_0x95a1('0x1a')]=qs[_0x95a1('0x1a')](_0x358e9e[_0x95a1('0x30')][_0x95a1('0x1a')]);}return _0x41a54e['getFields'](_0x9e3ab8);}})['then'](function(_0x5aba74){if(_0x5aba74){return _0x5aba74?{'count':_0x75e60d,'rows':_0x5aba74}:null;}})[_0x95a1('0x22')](respondWithResult(_0x39ab5d,null))[_0x95a1('0x40')](handleError(_0x39ab5d,null));};exports[_0x95a1('0x4e')]=function(_0xf8760a,_0x30931b,_0x59ae88){var _0x14ed3e={};var _0x5248f6={};var _0x1c595f;var _0x4fb762;return db[_0x95a1('0x2a')][_0x95a1('0x4a')]({'where':{'id':_0xf8760a[_0x95a1('0x42')]['id']}})[_0x95a1('0x22')](handleEntityNotFound(_0x30931b,null))[_0x95a1('0x22')](function(_0x153f25){if(_0x153f25){_0x1c595f=_0x153f25;_0x5248f6[_0x95a1('0x2f')]=_[_0x95a1('0x43')](db['FreshdeskField']['rawAttributes']);_0x5248f6['query']=_[_0x95a1('0x43')](_0xf8760a['query']);_0x5248f6['filters']=_[_0x95a1('0x32')](_0x5248f6[_0x95a1('0x2f')],_0x5248f6[_0x95a1('0x30')]);_0x14ed3e['attributes']=_[_0x95a1('0x32')](_0x5248f6[_0x95a1('0x2f')],qs[_0x95a1('0x34')](_0xf8760a[_0x95a1('0x30')][_0x95a1('0x34')]));_0x14ed3e[_0x95a1('0x33')]=_0x14ed3e[_0x95a1('0x33')][_0x95a1('0x35')]?_0x14ed3e[_0x95a1('0x33')]:_0x5248f6[_0x95a1('0x2f')];_0x14ed3e[_0x95a1('0x37')]=qs[_0x95a1('0x38')](_0xf8760a[_0x95a1('0x30')][_0x95a1('0x38')]);_0x14ed3e[_0x95a1('0x39')]=qs['filters'](_[_0x95a1('0x4c')](_0xf8760a[_0x95a1('0x30')],_0x5248f6[_0x95a1('0x31')]));if(_0xf8760a[_0x95a1('0x30')][_0x95a1('0x3a')]){_0x14ed3e[_0x95a1('0x39')]=_[_0x95a1('0x3b')](_0x14ed3e[_0x95a1('0x39')],{'$or':_[_0x95a1('0x29')](_0x14ed3e[_0x95a1('0x33')],function(_0x52bc05){var _0x53ef72={};_0x53ef72[_0x52bc05]={'$like':'%'+_0xf8760a['query'][_0x95a1('0x3a')]+'%'};return _0x53ef72;})});}_0x14ed3e=_[_0x95a1('0x3b')]({},_0x14ed3e,_0xf8760a['options']);return _0x1c595f[_0x95a1('0x4e')](_0x14ed3e);}})[_0x95a1('0x22')](function(_0x45cb71){if(_0x45cb71){_0x4fb762=_0x45cb71[_0x95a1('0x35')];if(!_0xf8760a['query']['hasOwnProperty'](_0x95a1('0x36'))){_0x14ed3e['limit']=qs['limit'](_0xf8760a[_0x95a1('0x30')][_0x95a1('0x1c')]);_0x14ed3e['offset']=qs[_0x95a1('0x1a')](_0xf8760a['query'][_0x95a1('0x1a')]);}return _0x1c595f[_0x95a1('0x4e')](_0x14ed3e);}})[_0x95a1('0x22')](function(_0x19ce88){if(_0x19ce88){return _0x19ce88?{'count':_0x4fb762,'rows':_0x19ce88}:null;}})[_0x95a1('0x22')](respondWithResult(_0x30931b,null))[_0x95a1('0x40')](handleError(_0x30931b,null));};exports[_0x95a1('0x4f')]=function(_0x5483f3,_0x25f4de,_0x383c4d){var _0x4cab2b={};var _0x4531d3={};var _0xfe4699;var _0x404bb2;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x5483f3[_0x95a1('0x42')]['id']}})[_0x95a1('0x22')](handleEntityNotFound(_0x25f4de,null))['then'](function(_0x3abf46){if(_0x3abf46){_0xfe4699=_0x3abf46;_0x4531d3[_0x95a1('0x2f')]=_['keys'](db[_0x95a1('0x4b')]['rawAttributes']);_0x4531d3[_0x95a1('0x30')]=_[_0x95a1('0x43')](_0x5483f3['query']);_0x4531d3[_0x95a1('0x31')]=_[_0x95a1('0x32')](_0x4531d3[_0x95a1('0x2f')],_0x4531d3[_0x95a1('0x30')]);_0x4cab2b[_0x95a1('0x33')]=_[_0x95a1('0x32')](_0x4531d3['model'],qs[_0x95a1('0x34')](_0x5483f3['query'][_0x95a1('0x34')]));_0x4cab2b[_0x95a1('0x33')]=_0x4cab2b[_0x95a1('0x33')]['length']?_0x4cab2b['attributes']:_0x4531d3[_0x95a1('0x2f')];_0x4cab2b[_0x95a1('0x37')]=qs[_0x95a1('0x38')](_0x5483f3[_0x95a1('0x30')][_0x95a1('0x38')]);_0x4cab2b[_0x95a1('0x39')]=qs['filters'](_['pick'](_0x5483f3[_0x95a1('0x30')],_0x4531d3[_0x95a1('0x31')]));if(_0x5483f3[_0x95a1('0x30')][_0x95a1('0x3a')]){_0x4cab2b[_0x95a1('0x39')]=_[_0x95a1('0x3b')](_0x4cab2b[_0x95a1('0x39')],{'$or':_[_0x95a1('0x29')](_0x4cab2b[_0x95a1('0x33')],function(_0x16e86d){var _0x31095a={};_0x31095a[_0x16e86d]={'$like':'%'+_0x5483f3['query']['filter']+'%'};return _0x31095a;})});}_0x4cab2b=_['merge']({},_0x4cab2b,_0x5483f3[_0x95a1('0x3d')]);return _0xfe4699[_0x95a1('0x4f')](_0x4cab2b);}})[_0x95a1('0x22')](function(_0x339263){if(_0x339263){_0x404bb2=_0x339263['length'];if(!_0x5483f3['query'][_0x95a1('0x4d')](_0x95a1('0x36'))){_0x4cab2b[_0x95a1('0x1c')]=qs['limit'](_0x5483f3['query'][_0x95a1('0x1c')]);_0x4cab2b[_0x95a1('0x1a')]=qs[_0x95a1('0x1a')](_0x5483f3['query'][_0x95a1('0x1a')]);}return _0xfe4699[_0x95a1('0x4f')](_0x4cab2b);}})[_0x95a1('0x22')](function(_0x32d2eb){if(_0x32d2eb){return _0x32d2eb?{'count':_0x404bb2,'rows':_0x32d2eb}:null;}})['then'](respondWithResult(_0x25f4de,null))[_0x95a1('0x40')](handleError(_0x25f4de,null));};exports[_0x95a1('0x50')]=function(_0x34b153,_0xb56d89,_0x5a1d7e){var _0x4c4df8={};var _0x4c6108={};var _0x1206e4;var _0x3f5a45;return db[_0x95a1('0x2a')][_0x95a1('0x4a')]({'where':{'id':_0x34b153['params']['id']}})[_0x95a1('0x22')](handleEntityNotFound(_0xb56d89,null))[_0x95a1('0x22')](function(_0x290b70){if(_0x290b70){_0x1206e4=_0x290b70;_0x4c6108[_0x95a1('0x2f')]=_[_0x95a1('0x43')](db['Tag'][_0x95a1('0x2b')]);_0x4c6108[_0x95a1('0x30')]=_[_0x95a1('0x43')](_0x34b153['query']);_0x4c6108['filters']=_[_0x95a1('0x32')](_0x4c6108[_0x95a1('0x2f')],_0x4c6108[_0x95a1('0x30')]);_0x4c4df8[_0x95a1('0x33')]=_[_0x95a1('0x32')](_0x4c6108[_0x95a1('0x2f')],qs['fields'](_0x34b153[_0x95a1('0x30')][_0x95a1('0x34')]));_0x4c4df8['attributes']=_0x4c4df8[_0x95a1('0x33')]['length']?_0x4c4df8[_0x95a1('0x33')]:_0x4c6108['model'];_0x4c4df8[_0x95a1('0x37')]=qs['sort'](_0x34b153[_0x95a1('0x30')][_0x95a1('0x38')]);_0x4c4df8[_0x95a1('0x39')]=qs[_0x95a1('0x31')](_[_0x95a1('0x4c')](_0x34b153[_0x95a1('0x30')],_0x4c6108[_0x95a1('0x31')]));if(_0x34b153[_0x95a1('0x30')]['filter']){_0x4c4df8[_0x95a1('0x39')]=_[_0x95a1('0x3b')](_0x4c4df8[_0x95a1('0x39')],{'$or':_[_0x95a1('0x29')](_0x4c4df8[_0x95a1('0x33')],function(_0x4bd682){var _0xc09f5e={};_0xc09f5e[_0x4bd682]={'$like':'%'+_0x34b153[_0x95a1('0x30')][_0x95a1('0x3a')]+'%'};return _0xc09f5e;})});}_0x4c4df8=_[_0x95a1('0x3b')]({},_0x4c4df8,_0x34b153[_0x95a1('0x3d')]);return _0x1206e4[_0x95a1('0x50')](_0x4c4df8);}})[_0x95a1('0x22')](function(_0x45f25e){if(_0x45f25e){_0x3f5a45=_0x45f25e[_0x95a1('0x35')];if(!_0x34b153[_0x95a1('0x30')][_0x95a1('0x4d')]('nolimit')){_0x4c4df8[_0x95a1('0x1c')]=qs[_0x95a1('0x1c')](_0x34b153[_0x95a1('0x30')][_0x95a1('0x1c')]);_0x4c4df8[_0x95a1('0x1a')]=qs[_0x95a1('0x1a')](_0x34b153[_0x95a1('0x30')][_0x95a1('0x1a')]);}return _0x1206e4[_0x95a1('0x50')](_0x4c4df8);}})[_0x95a1('0x22')](function(_0x26aa33){if(_0x26aa33){return _0x26aa33?{'count':_0x3f5a45,'rows':_0x26aa33}:null;}})[_0x95a1('0x22')](respondWithResult(_0xb56d89,null))[_0x95a1('0x40')](handleError(_0xb56d89,null));};exports[_0x95a1('0x51')]=function(_0x373a7e,_0x1afc28,_0x3478ab){if(_0x373a7e[_0x95a1('0x47')]['id']){delete _0x373a7e[_0x95a1('0x47')]['id'];}return db[_0x95a1('0x2a')][_0x95a1('0x4a')]({'where':{'id':_0x373a7e['params']['id']}})[_0x95a1('0x22')](handleEntityNotFound(_0x1afc28,null))[_0x95a1('0x22')](function(_0x46194d){if(_0x46194d){return _0x46194d[_0x95a1('0x51')](_0x373a7e[_0x95a1('0x47')]['ids']||[]);}return null;})[_0x95a1('0x22')](respondWithResult(_0x1afc28,null))[_0x95a1('0x40')](handleError(_0x1afc28,null));}; \ No newline at end of file +var _0x5f1c=['limit','count','set','Content-Range','update','then','error','name','send','map','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','options','includeAll','include','FreshdeskConfiguration','findAll','rows','catch','show','params','keys','merge','find','create','body','destroy','getFields','rawAttributes','order','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x28c7a7,_0x55a356){var _0x50610f=function(_0x3a4038){while(--_0x3a4038){_0x28c7a7['push'](_0x28c7a7['shift']());}};_0x50610f(++_0x55a356);}(_0x5f1c,0x81));var _0xc5f1=function(_0x10818f,_0xb2057e){_0x10818f=_0x10818f-0x0;var _0x53900b=_0x5f1c[_0x10818f];return _0x53900b;};'use strict';var emlformat=require(_0xc5f1('0x0'));var rimraf=require(_0xc5f1('0x1'));var zipdir=require(_0xc5f1('0x2'));var jsonpatch=require(_0xc5f1('0x3'));var rp=require('request-promise');var moment=require(_0xc5f1('0x4'));var BPromise=require(_0xc5f1('0x5'));var Mustache=require('mustache');var util=require(_0xc5f1('0x6'));var path=require('path');var sox=require(_0xc5f1('0x7'));var csv=require(_0xc5f1('0x8'));var ejs=require(_0xc5f1('0x9'));var fs=require('fs');var fs_extra=require(_0xc5f1('0xa'));var _=require('lodash');var squel=require(_0xc5f1('0xb'));var crypto=require(_0xc5f1('0xc'));var jsforce=require(_0xc5f1('0xd'));var deskjs=require(_0xc5f1('0xe'));var toCsv=require(_0xc5f1('0x8'));var querystring=require(_0xc5f1('0xf'));var Papa=require(_0xc5f1('0x10'));var Redis=require(_0xc5f1('0x11'));var authService=require(_0xc5f1('0x12'));var qs=require(_0xc5f1('0x13'));var as=require(_0xc5f1('0x14'));var hardwareService=require(_0xc5f1('0x15'));var logger=require(_0xc5f1('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xc5f1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc5f1('0x18'))['db'];function respondWithStatusCode(_0xb3b169,_0x21bdea){_0x21bdea=_0x21bdea||0xcc;return function(_0x45cbc3){if(_0x45cbc3){return _0xb3b169[_0xc5f1('0x19')](_0x21bdea);}return _0xb3b169[_0xc5f1('0x1a')](_0x21bdea)[_0xc5f1('0x1b')]();};}function respondWithResult(_0x23040b,_0x81e6ca){_0x81e6ca=_0x81e6ca||0xc8;return function(_0x164c27){if(_0x164c27){return _0x23040b[_0xc5f1('0x1a')](_0x81e6ca)[_0xc5f1('0x1c')](_0x164c27);}};}function respondWithFilteredResult(_0x2990e8,_0x17571){return function(_0x4c4d09){if(_0x4c4d09){var _0x2c8ccf=typeof _0x17571[_0xc5f1('0x1d')]===_0xc5f1('0x1e')&&typeof _0x17571[_0xc5f1('0x1f')]===_0xc5f1('0x1e');var _0x1d6ef5=_0x4c4d09[_0xc5f1('0x20')];var _0xf0db6=_0x2c8ccf?0x0:_0x17571[_0xc5f1('0x1d')];var _0x212903=_0x2c8ccf?_0x4c4d09[_0xc5f1('0x20')]:_0x17571[_0xc5f1('0x1d')]+_0x17571[_0xc5f1('0x1f')];var _0x1773f8;if(_0x212903>=_0x1d6ef5){_0x212903=_0x1d6ef5;_0x1773f8=0xc8;}else{_0x1773f8=0xce;}_0x2990e8[_0xc5f1('0x1a')](_0x1773f8);return _0x2990e8[_0xc5f1('0x21')](_0xc5f1('0x22'),_0xf0db6+'-'+_0x212903+'/'+_0x1d6ef5)[_0xc5f1('0x1c')](_0x4c4d09);}return null;};}function patchUpdates(_0x4cc293){return function(_0x3958aa){try{jsonpatch['apply'](_0x3958aa,_0x4cc293,!![]);}catch(_0x5dbd76){return BPromise['reject'](_0x5dbd76);}return _0x3958aa['save']();};}function saveUpdates(_0x56bbc6,_0x3e2562){return function(_0x43dc18){if(_0x43dc18){return _0x43dc18[_0xc5f1('0x23')](_0x56bbc6)['then'](function(_0x327383){return _0x327383;});}return null;};}function removeEntity(_0x8ec966,_0xc926f5){return function(_0x36be2c){if(_0x36be2c){return _0x36be2c['destroy']()[_0xc5f1('0x24')](function(){_0x8ec966[_0xc5f1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25846c,_0x51fa24){return function(_0x491eff){if(!_0x491eff){_0x25846c['sendStatus'](0x194);}return _0x491eff;};}function handleError(_0x1c669a,_0x112d5c){_0x112d5c=_0x112d5c||0x1f4;return function(_0x276ac4){logger[_0xc5f1('0x25')](_0x276ac4['stack']);if(_0x276ac4['name']){delete _0x276ac4[_0xc5f1('0x26')];}_0x1c669a[_0xc5f1('0x1a')](_0x112d5c)[_0xc5f1('0x27')](_0x276ac4);};}exports['index']=function(_0x502b43,_0x1e6457){var _0x5a5a09={},_0x149f8d={},_0x5ab74f={'count':0x0,'rows':[]};var _0x7ac96d=_[_0xc5f1('0x28')](db['FreshdeskConfiguration']['rawAttributes'],function(_0x3dd1b7){return{'name':_0x3dd1b7['fieldName'],'type':_0x3dd1b7['type'][_0xc5f1('0x29')]};});_0x149f8d[_0xc5f1('0x2a')]=_[_0xc5f1('0x28')](_0x7ac96d,_0xc5f1('0x26'));_0x149f8d[_0xc5f1('0x2b')]=_['keys'](_0x502b43['query']);_0x149f8d['filters']=_[_0xc5f1('0x2c')](_0x149f8d[_0xc5f1('0x2a')],_0x149f8d[_0xc5f1('0x2b')]);_0x5a5a09[_0xc5f1('0x2d')]=_[_0xc5f1('0x2c')](_0x149f8d[_0xc5f1('0x2a')],qs[_0xc5f1('0x2e')](_0x502b43[_0xc5f1('0x2b')][_0xc5f1('0x2e')]));_0x5a5a09['attributes']=_0x5a5a09[_0xc5f1('0x2d')][_0xc5f1('0x2f')]?_0x5a5a09['attributes']:_0x149f8d['model'];if(!_0x502b43[_0xc5f1('0x2b')][_0xc5f1('0x30')](_0xc5f1('0x31'))){_0x5a5a09['limit']=qs['limit'](_0x502b43['query'][_0xc5f1('0x1f')]);_0x5a5a09['offset']=qs[_0xc5f1('0x1d')](_0x502b43[_0xc5f1('0x2b')][_0xc5f1('0x1d')]);}_0x5a5a09['order']=qs[_0xc5f1('0x32')](_0x502b43[_0xc5f1('0x2b')][_0xc5f1('0x32')]);_0x5a5a09['where']=qs[_0xc5f1('0x33')](_[_0xc5f1('0x34')](_0x502b43[_0xc5f1('0x2b')],_0x149f8d[_0xc5f1('0x33')]),_0x7ac96d);if(_0x502b43[_0xc5f1('0x2b')][_0xc5f1('0x35')]){_0x5a5a09['where']=_['merge'](_0x5a5a09[_0xc5f1('0x36')],{'$or':_[_0xc5f1('0x28')](_0x7ac96d,function(_0x2ba067){if(_0x2ba067['type']!=='VIRTUAL'){var _0x3a7b0f={};_0x3a7b0f[_0x2ba067[_0xc5f1('0x26')]]={'$like':'%'+_0x502b43['query'][_0xc5f1('0x35')]+'%'};return _0x3a7b0f;}})});}_0x5a5a09=_['merge']({},_0x5a5a09,_0x502b43[_0xc5f1('0x37')]);var _0x437c6a={'where':_0x5a5a09['where']};return db['FreshdeskConfiguration'][_0xc5f1('0x20')](_0x437c6a)['then'](function(_0x548a4d){_0x5ab74f['count']=_0x548a4d;if(_0x502b43['query'][_0xc5f1('0x38')]){_0x5a5a09[_0xc5f1('0x39')]=[{'all':!![]}];}return db[_0xc5f1('0x3a')][_0xc5f1('0x3b')](_0x5a5a09);})[_0xc5f1('0x24')](function(_0xcd9b08){_0x5ab74f[_0xc5f1('0x3c')]=_0xcd9b08;return _0x5ab74f;})[_0xc5f1('0x24')](respondWithFilteredResult(_0x1e6457,_0x5a5a09))[_0xc5f1('0x3d')](handleError(_0x1e6457,null));};exports[_0xc5f1('0x3e')]=function(_0x217545,_0x9e5bba){var _0x5c1cec={'raw':![],'where':{'id':_0x217545[_0xc5f1('0x3f')]['id']}},_0x3bd93c={};_0x3bd93c['model']=_['keys'](db[_0xc5f1('0x3a')]['rawAttributes']);_0x3bd93c['query']=_[_0xc5f1('0x40')](_0x217545[_0xc5f1('0x2b')]);_0x3bd93c['filters']=_[_0xc5f1('0x2c')](_0x3bd93c['model'],_0x3bd93c['query']);_0x5c1cec[_0xc5f1('0x2d')]=_[_0xc5f1('0x2c')](_0x3bd93c[_0xc5f1('0x2a')],qs[_0xc5f1('0x2e')](_0x217545[_0xc5f1('0x2b')]['fields']));_0x5c1cec[_0xc5f1('0x2d')]=_0x5c1cec[_0xc5f1('0x2d')]['length']?_0x5c1cec[_0xc5f1('0x2d')]:_0x3bd93c['model'];if(_0x217545[_0xc5f1('0x2b')]['includeAll']){_0x5c1cec['include']=[{'all':!![]}];}_0x5c1cec=_[_0xc5f1('0x41')]({},_0x5c1cec,_0x217545[_0xc5f1('0x37')]);return db[_0xc5f1('0x3a')][_0xc5f1('0x42')](_0x5c1cec)[_0xc5f1('0x24')](handleEntityNotFound(_0x9e5bba,null))[_0xc5f1('0x24')](respondWithResult(_0x9e5bba,null))[_0xc5f1('0x3d')](handleError(_0x9e5bba,null));};exports[_0xc5f1('0x43')]=function(_0x38c636,_0x1f3158){return db['FreshdeskConfiguration']['create'](_0x38c636['body'],{})[_0xc5f1('0x24')](respondWithResult(_0x1f3158,0xc9))[_0xc5f1('0x3d')](handleError(_0x1f3158,null));};exports['update']=function(_0x1733ff,_0x484863){if(_0x1733ff[_0xc5f1('0x44')]['id']){delete _0x1733ff['body']['id'];}return db[_0xc5f1('0x3a')][_0xc5f1('0x42')]({'where':{'id':_0x1733ff[_0xc5f1('0x3f')]['id']}})['then'](handleEntityNotFound(_0x484863,null))[_0xc5f1('0x24')](saveUpdates(_0x1733ff[_0xc5f1('0x44')],null))[_0xc5f1('0x24')](respondWithResult(_0x484863,null))['catch'](handleError(_0x484863,null));};exports[_0xc5f1('0x45')]=function(_0x4a62f6,_0x10aebc){return db[_0xc5f1('0x3a')][_0xc5f1('0x42')]({'where':{'id':_0x4a62f6[_0xc5f1('0x3f')]['id']}})[_0xc5f1('0x24')](handleEntityNotFound(_0x10aebc,null))[_0xc5f1('0x24')](removeEntity(_0x10aebc,null))['catch'](handleError(_0x10aebc,null));};exports[_0xc5f1('0x46')]=function(_0x1cd730,_0x320056,_0x545e70){var _0x5e54bd={};var _0x353cdf={};var _0x423877;var _0x4a9d33;return db[_0xc5f1('0x3a')]['findOne']({'where':{'id':_0x1cd730['params']['id']}})[_0xc5f1('0x24')](handleEntityNotFound(_0x320056,null))[_0xc5f1('0x24')](function(_0x314112){if(_0x314112){_0x423877=_0x314112;_0x353cdf[_0xc5f1('0x2a')]=_[_0xc5f1('0x40')](db['FreshdeskField'][_0xc5f1('0x47')]);_0x353cdf['query']=_[_0xc5f1('0x40')](_0x1cd730[_0xc5f1('0x2b')]);_0x353cdf[_0xc5f1('0x33')]=_['intersection'](_0x353cdf['model'],_0x353cdf[_0xc5f1('0x2b')]);_0x5e54bd['attributes']=_[_0xc5f1('0x2c')](_0x353cdf['model'],qs[_0xc5f1('0x2e')](_0x1cd730['query']['fields']));_0x5e54bd[_0xc5f1('0x2d')]=_0x5e54bd[_0xc5f1('0x2d')][_0xc5f1('0x2f')]?_0x5e54bd['attributes']:_0x353cdf[_0xc5f1('0x2a')];_0x5e54bd[_0xc5f1('0x48')]=qs[_0xc5f1('0x32')](_0x1cd730['query'][_0xc5f1('0x32')]);_0x5e54bd['where']=qs['filters'](_['pick'](_0x1cd730[_0xc5f1('0x2b')],_0x353cdf[_0xc5f1('0x33')]));if(_0x1cd730[_0xc5f1('0x2b')][_0xc5f1('0x35')]){_0x5e54bd[_0xc5f1('0x36')]=_[_0xc5f1('0x41')](_0x5e54bd[_0xc5f1('0x36')],{'$or':_[_0xc5f1('0x28')](_0x5e54bd[_0xc5f1('0x2d')],function(_0x18855c){var _0x1ec1bd={};_0x1ec1bd[_0x18855c]={'$like':'%'+_0x1cd730[_0xc5f1('0x2b')][_0xc5f1('0x35')]+'%'};return _0x1ec1bd;})});}_0x5e54bd=_[_0xc5f1('0x41')]({},_0x5e54bd,_0x1cd730[_0xc5f1('0x37')]);return _0x423877[_0xc5f1('0x46')](_0x5e54bd);}})['then'](function(_0x94e09a){if(_0x94e09a){_0x4a9d33=_0x94e09a[_0xc5f1('0x2f')];if(!_0x1cd730[_0xc5f1('0x2b')][_0xc5f1('0x30')](_0xc5f1('0x31'))){_0x5e54bd[_0xc5f1('0x1f')]=qs['limit'](_0x1cd730[_0xc5f1('0x2b')]['limit']);_0x5e54bd[_0xc5f1('0x1d')]=qs[_0xc5f1('0x1d')](_0x1cd730['query'][_0xc5f1('0x1d')]);}return _0x423877[_0xc5f1('0x46')](_0x5e54bd);}})[_0xc5f1('0x24')](function(_0x33143d){if(_0x33143d){return _0x33143d?{'count':_0x4a9d33,'rows':_0x33143d}:null;}})[_0xc5f1('0x24')](respondWithResult(_0x320056,null))[_0xc5f1('0x3d')](handleError(_0x320056,null));};exports['getSubjects']=function(_0x555095,_0x14dbbf,_0x25776b){var _0x2ea54a={};var _0x10187b={};var _0x5625df;var _0x123dc2;return db[_0xc5f1('0x3a')][_0xc5f1('0x49')]({'where':{'id':_0x555095[_0xc5f1('0x3f')]['id']}})[_0xc5f1('0x24')](handleEntityNotFound(_0x14dbbf,null))[_0xc5f1('0x24')](function(_0x3506f3){if(_0x3506f3){_0x5625df=_0x3506f3;_0x10187b[_0xc5f1('0x2a')]=_[_0xc5f1('0x40')](db[_0xc5f1('0x4a')]['rawAttributes']);_0x10187b[_0xc5f1('0x2b')]=_[_0xc5f1('0x40')](_0x555095['query']);_0x10187b[_0xc5f1('0x33')]=_[_0xc5f1('0x2c')](_0x10187b[_0xc5f1('0x2a')],_0x10187b['query']);_0x2ea54a[_0xc5f1('0x2d')]=_[_0xc5f1('0x2c')](_0x10187b['model'],qs[_0xc5f1('0x2e')](_0x555095[_0xc5f1('0x2b')][_0xc5f1('0x2e')]));_0x2ea54a['attributes']=_0x2ea54a[_0xc5f1('0x2d')][_0xc5f1('0x2f')]?_0x2ea54a[_0xc5f1('0x2d')]:_0x10187b['model'];_0x2ea54a[_0xc5f1('0x48')]=qs[_0xc5f1('0x32')](_0x555095[_0xc5f1('0x2b')]['sort']);_0x2ea54a[_0xc5f1('0x36')]=qs[_0xc5f1('0x33')](_[_0xc5f1('0x34')](_0x555095[_0xc5f1('0x2b')],_0x10187b[_0xc5f1('0x33')]));if(_0x555095[_0xc5f1('0x2b')]['filter']){_0x2ea54a[_0xc5f1('0x36')]=_[_0xc5f1('0x41')](_0x2ea54a[_0xc5f1('0x36')],{'$or':_['map'](_0x2ea54a['attributes'],function(_0x537b78){var _0x519c52={};_0x519c52[_0x537b78]={'$like':'%'+_0x555095[_0xc5f1('0x2b')][_0xc5f1('0x35')]+'%'};return _0x519c52;})});}_0x2ea54a=_[_0xc5f1('0x41')]({},_0x2ea54a,_0x555095['options']);return _0x5625df[_0xc5f1('0x4b')](_0x2ea54a);}})[_0xc5f1('0x24')](function(_0x10061c){if(_0x10061c){_0x123dc2=_0x10061c['length'];if(!_0x555095['query'][_0xc5f1('0x30')](_0xc5f1('0x31'))){_0x2ea54a['limit']=qs[_0xc5f1('0x1f')](_0x555095[_0xc5f1('0x2b')][_0xc5f1('0x1f')]);_0x2ea54a[_0xc5f1('0x1d')]=qs[_0xc5f1('0x1d')](_0x555095[_0xc5f1('0x2b')][_0xc5f1('0x1d')]);}return _0x5625df['getSubjects'](_0x2ea54a);}})[_0xc5f1('0x24')](function(_0x22468c){if(_0x22468c){return _0x22468c?{'count':_0x123dc2,'rows':_0x22468c}:null;}})[_0xc5f1('0x24')](respondWithResult(_0x14dbbf,null))['catch'](handleError(_0x14dbbf,null));};exports[_0xc5f1('0x4c')]=function(_0x56ed42,_0x18eada,_0x1e2869){var _0x30ef7a={};var _0x7e7928={};var _0xc2f9d2;var _0xacc892;return db[_0xc5f1('0x3a')][_0xc5f1('0x49')]({'where':{'id':_0x56ed42[_0xc5f1('0x3f')]['id']}})['then'](handleEntityNotFound(_0x18eada,null))['then'](function(_0x4cd16d){if(_0x4cd16d){_0xc2f9d2=_0x4cd16d;_0x7e7928[_0xc5f1('0x2a')]=_[_0xc5f1('0x40')](db['FreshdeskField'][_0xc5f1('0x47')]);_0x7e7928[_0xc5f1('0x2b')]=_[_0xc5f1('0x40')](_0x56ed42[_0xc5f1('0x2b')]);_0x7e7928[_0xc5f1('0x33')]=_['intersection'](_0x7e7928[_0xc5f1('0x2a')],_0x7e7928[_0xc5f1('0x2b')]);_0x30ef7a[_0xc5f1('0x2d')]=_[_0xc5f1('0x2c')](_0x7e7928['model'],qs['fields'](_0x56ed42['query'][_0xc5f1('0x2e')]));_0x30ef7a[_0xc5f1('0x2d')]=_0x30ef7a[_0xc5f1('0x2d')][_0xc5f1('0x2f')]?_0x30ef7a[_0xc5f1('0x2d')]:_0x7e7928[_0xc5f1('0x2a')];_0x30ef7a['order']=qs['sort'](_0x56ed42['query'][_0xc5f1('0x32')]);_0x30ef7a[_0xc5f1('0x36')]=qs[_0xc5f1('0x33')](_[_0xc5f1('0x34')](_0x56ed42[_0xc5f1('0x2b')],_0x7e7928[_0xc5f1('0x33')]));if(_0x56ed42['query'][_0xc5f1('0x35')]){_0x30ef7a['where']=_[_0xc5f1('0x41')](_0x30ef7a[_0xc5f1('0x36')],{'$or':_[_0xc5f1('0x28')](_0x30ef7a[_0xc5f1('0x2d')],function(_0x2bdd5a){var _0x2bf2fb={};_0x2bf2fb[_0x2bdd5a]={'$like':'%'+_0x56ed42[_0xc5f1('0x2b')][_0xc5f1('0x35')]+'%'};return _0x2bf2fb;})});}_0x30ef7a=_[_0xc5f1('0x41')]({},_0x30ef7a,_0x56ed42[_0xc5f1('0x37')]);return _0xc2f9d2[_0xc5f1('0x4c')](_0x30ef7a);}})[_0xc5f1('0x24')](function(_0x180009){if(_0x180009){_0xacc892=_0x180009[_0xc5f1('0x2f')];if(!_0x56ed42[_0xc5f1('0x2b')][_0xc5f1('0x30')](_0xc5f1('0x31'))){_0x30ef7a[_0xc5f1('0x1f')]=qs[_0xc5f1('0x1f')](_0x56ed42[_0xc5f1('0x2b')]['limit']);_0x30ef7a[_0xc5f1('0x1d')]=qs[_0xc5f1('0x1d')](_0x56ed42[_0xc5f1('0x2b')][_0xc5f1('0x1d')]);}return _0xc2f9d2[_0xc5f1('0x4c')](_0x30ef7a);}})[_0xc5f1('0x24')](function(_0x186593){if(_0x186593){return _0x186593?{'count':_0xacc892,'rows':_0x186593}:null;}})['then'](respondWithResult(_0x18eada,null))[_0xc5f1('0x3d')](handleError(_0x18eada,null));};exports[_0xc5f1('0x4d')]=function(_0x4e8586,_0x2276e3,_0x33d5f7){var _0x1cbcba={};var _0x2bcaee={};var _0x29c3c1;var _0x28d2c9;return db['FreshdeskConfiguration'][_0xc5f1('0x49')]({'where':{'id':_0x4e8586[_0xc5f1('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2276e3,null))[_0xc5f1('0x24')](function(_0x134a79){if(_0x134a79){_0x29c3c1=_0x134a79;_0x2bcaee['model']=_[_0xc5f1('0x40')](db[_0xc5f1('0x4e')][_0xc5f1('0x47')]);_0x2bcaee[_0xc5f1('0x2b')]=_[_0xc5f1('0x40')](_0x4e8586[_0xc5f1('0x2b')]);_0x2bcaee[_0xc5f1('0x33')]=_['intersection'](_0x2bcaee[_0xc5f1('0x2a')],_0x2bcaee[_0xc5f1('0x2b')]);_0x1cbcba[_0xc5f1('0x2d')]=_['intersection'](_0x2bcaee[_0xc5f1('0x2a')],qs[_0xc5f1('0x2e')](_0x4e8586[_0xc5f1('0x2b')][_0xc5f1('0x2e')]));_0x1cbcba[_0xc5f1('0x2d')]=_0x1cbcba['attributes']['length']?_0x1cbcba[_0xc5f1('0x2d')]:_0x2bcaee[_0xc5f1('0x2a')];_0x1cbcba[_0xc5f1('0x48')]=qs['sort'](_0x4e8586[_0xc5f1('0x2b')]['sort']);_0x1cbcba[_0xc5f1('0x36')]=qs[_0xc5f1('0x33')](_[_0xc5f1('0x34')](_0x4e8586[_0xc5f1('0x2b')],_0x2bcaee[_0xc5f1('0x33')]));if(_0x4e8586[_0xc5f1('0x2b')][_0xc5f1('0x35')]){_0x1cbcba[_0xc5f1('0x36')]=_[_0xc5f1('0x41')](_0x1cbcba['where'],{'$or':_[_0xc5f1('0x28')](_0x1cbcba['attributes'],function(_0x12c576){var _0xffb6c2={};_0xffb6c2[_0x12c576]={'$like':'%'+_0x4e8586[_0xc5f1('0x2b')][_0xc5f1('0x35')]+'%'};return _0xffb6c2;})});}_0x1cbcba=_[_0xc5f1('0x41')]({},_0x1cbcba,_0x4e8586['options']);return _0x29c3c1['getTags'](_0x1cbcba);}})[_0xc5f1('0x24')](function(_0x473fd9){if(_0x473fd9){_0x28d2c9=_0x473fd9[_0xc5f1('0x2f')];if(!_0x4e8586['query'][_0xc5f1('0x30')](_0xc5f1('0x31'))){_0x1cbcba[_0xc5f1('0x1f')]=qs[_0xc5f1('0x1f')](_0x4e8586[_0xc5f1('0x2b')][_0xc5f1('0x1f')]);_0x1cbcba[_0xc5f1('0x1d')]=qs['offset'](_0x4e8586[_0xc5f1('0x2b')][_0xc5f1('0x1d')]);}return _0x29c3c1[_0xc5f1('0x4d')](_0x1cbcba);}})[_0xc5f1('0x24')](function(_0x506664){if(_0x506664){return _0x506664?{'count':_0x28d2c9,'rows':_0x506664}:null;}})[_0xc5f1('0x24')](respondWithResult(_0x2276e3,null))[_0xc5f1('0x3d')](handleError(_0x2276e3,null));};exports[_0xc5f1('0x4f')]=function(_0x42b90d,_0xb52836,_0x40e01a){if(_0x42b90d[_0xc5f1('0x44')]['id']){delete _0x42b90d['body']['id'];}return db[_0xc5f1('0x3a')][_0xc5f1('0x49')]({'where':{'id':_0x42b90d[_0xc5f1('0x3f')]['id']}})[_0xc5f1('0x24')](handleEntityNotFound(_0xb52836,null))[_0xc5f1('0x24')](function(_0x1cced2){if(_0x1cced2){return _0x1cced2[_0xc5f1('0x4f')](_0x42b90d['body']['ids']||[]);}return null;})['then'](respondWithResult(_0xb52836,null))[_0xc5f1('0x3d')](handleError(_0xb52836,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 2043f0f..6f1376a 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 _0x4e84=['exports','define','FreshdeskConfiguration','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes'];(function(_0x2ce171,_0x5a2303){var _0x54a006=function(_0x2ad6e7){while(--_0x2ad6e7){_0x2ce171['push'](_0x2ce171['shift']());}};_0x54a006(++_0x5a2303);}(_0x4e84,0x92));var _0x44e8=function(_0x3c7ac3,_0x233375){_0x3c7ac3=_0x3c7ac3-0x0;var _0x4da424=_0x4e84[_0x3c7ac3];return _0x4da424;};'use strict';var _=require('lodash');var util=require(_0x44e8('0x0'));var logger=require(_0x44e8('0x1'))(_0x44e8('0x2'));var moment=require(_0x44e8('0x3'));var BPromise=require(_0x44e8('0x4'));var rp=require(_0x44e8('0x5'));var fs=require('fs');var path=require(_0x44e8('0x6'));var rimraf=require(_0x44e8('0x7'));var config=require(_0x44e8('0x8'));var attributes=require(_0x44e8('0x9'));module[_0x44e8('0xa')]=function(_0x51952a,_0x316ca6){return _0x51952a[_0x44e8('0xb')](_0x44e8('0xc'),attributes,{'tableName':'int_freshdesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8628=['../../config/environment','./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x8628,0x1cc));var _0x8862=function(_0x17e686,_0x30d14a){_0x17e686=_0x17e686-0x0;var _0x6a2f97=_0x8628[_0x17e686];return _0x6a2f97;};'use strict';var _=require(_0x8862('0x0'));var util=require(_0x8862('0x1'));var logger=require(_0x8862('0x2'))('api');var moment=require(_0x8862('0x3'));var BPromise=require(_0x8862('0x4'));var rp=require(_0x8862('0x5'));var fs=require('fs');var path=require(_0x8862('0x6'));var rimraf=require(_0x8862('0x7'));var config=require(_0x8862('0x8'));var attributes=require(_0x8862('0x9'));module[_0x8862('0xa')]=function(_0x437c89,_0x395f63){return _0x437c89['define'](_0x8862('0xb'),attributes,{'tableName':_0x8862('0xc'),'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 3a2d8e7..2ab3109 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 _0x21b7=['debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s'];(function(_0x1abcfa,_0x31757b){var _0x5d498c=function(_0x1ed0bc){while(--_0x1ed0bc){_0x1abcfa['push'](_0x1abcfa['shift']());}};_0x5d498c(++_0x31757b);}(_0x21b7,0x16d));var _0x721b=function(_0x3f9162,_0x48b6c7){_0x3f9162=_0x3f9162-0x0;var _0x2aae01=_0x21b7[_0x3f9162];return _0x2aae01;};'use strict';var _=require(_0x721b('0x0'));var util=require(_0x721b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x721b('0x2'));var fs=require('fs');var Redis=require(_0x721b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x721b('0x4'));var logger=require(_0x721b('0x5'))(_0x721b('0x6'));var config=require(_0x721b('0x7'));var jayson=require(_0x721b('0x8'));var client=jayson['client'][_0x721b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e1de5,_0x23ad06,_0x96f886){return new BPromise(function(_0x391804,_0x4bfdaa){return client['request'](_0x5e1de5,_0x96f886)[_0x721b('0xa')](function(_0x55f22e){logger[_0x721b('0xb')](_0x721b('0xc'),_0x23ad06,'request\x20sent');logger[_0x721b('0xd')](_0x721b('0xe'),_0x23ad06,_0x721b('0xf'),JSON['stringify'](_0x55f22e));if(_0x55f22e[_0x721b('0x10')]){if(_0x55f22e['error'][_0x721b('0x11')]===0x1f4){logger[_0x721b('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x23ad06,_0x55f22e[_0x721b('0x10')]['message']);return _0x4bfdaa(_0x55f22e[_0x721b('0x10')][_0x721b('0x12')]);}logger[_0x721b('0x10')](_0x721b('0xc'),_0x23ad06,_0x55f22e[_0x721b('0x10')][_0x721b('0x12')]);return _0x391804(_0x55f22e['error'][_0x721b('0x12')]);}else{logger[_0x721b('0xb')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x23ad06,_0x721b('0xf'));_0x391804(_0x55f22e[_0x721b('0x13')][_0x721b('0x12')]);}})[_0x721b('0x14')](function(_0x17da44){logger[_0x721b('0x10')](_0x721b('0xc'),_0x23ad06,_0x17da44);_0x4bfdaa(_0x17da44);});});} \ No newline at end of file +var _0x952a=['lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x1b594f,_0x36cdcc){var _0x2b691e=function(_0x5dcdf0){while(--_0x5dcdf0){_0x1b594f['push'](_0x1b594f['shift']());}};_0x2b691e(++_0x36cdcc);}(_0x952a,0x11e));var _0xa952=function(_0x4d970d,_0x4b9767){_0x4d970d=_0x4d970d-0x0;var _0xc3536c=_0x952a[_0x4d970d];return _0xc3536c;};'use strict';var _=require(_0xa952('0x0'));var util=require(_0xa952('0x1'));var moment=require('moment');var BPromise=require(_0xa952('0x2'));var rs=require(_0xa952('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa952('0x4'))['db'];var utils=require(_0xa952('0x5'));var logger=require(_0xa952('0x6'))(_0xa952('0x7'));var config=require(_0xa952('0x8'));var jayson=require(_0xa952('0x9'));var client=jayson[_0xa952('0xa')][_0xa952('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28e60f,_0x1ee957,_0x58176d){return new BPromise(function(_0x5abe52,_0x584d5a){return client[_0xa952('0xc')](_0x28e60f,_0x58176d)[_0xa952('0xd')](function(_0x3ffdd3){logger[_0xa952('0xe')](_0xa952('0xf'),_0x1ee957,_0xa952('0x10'));logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x1ee957,'request\x20sent',JSON[_0xa952('0x11')](_0x3ffdd3));if(_0x3ffdd3[_0xa952('0x12')]){if(_0x3ffdd3[_0xa952('0x12')][_0xa952('0x13')]===0x1f4){logger[_0xa952('0x12')](_0xa952('0xf'),_0x1ee957,_0x3ffdd3[_0xa952('0x12')][_0xa952('0x14')]);return _0x584d5a(_0x3ffdd3[_0xa952('0x12')][_0xa952('0x14')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x1ee957,_0x3ffdd3['error']['message']);return _0x5abe52(_0x3ffdd3['error']['message']);}else{logger[_0xa952('0xe')](_0xa952('0xf'),_0x1ee957,_0xa952('0x10'));_0x5abe52(_0x3ffdd3[_0xa952('0x15')][_0xa952('0x14')]);}})['catch'](function(_0x38866e){logger[_0xa952('0x12')](_0xa952('0xf'),_0x1ee957,_0x38866e);_0x584d5a(_0x38866e);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 9f39d38..6bd9c07 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 _0x7187=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','post','create','put','update','destroy','exports','multer','path'];(function(_0x1865fb,_0x3915f2){var _0x1dbe96=function(_0x325a0e){while(--_0x325a0e){_0x1865fb['push'](_0x1865fb['shift']());}};_0x1dbe96(++_0x3915f2);}(_0x7187,0x174));var _0x7718=function(_0x252691,_0x38d38b){_0x252691=_0x252691-0x0;var _0x5d0ce1=_0x7187[_0x252691];return _0x5d0ce1;};'use strict';var multer=require(_0x7718('0x0'));var util=require('util');var path=require(_0x7718('0x1'));var timeout=require(_0x7718('0x2'));var express=require(_0x7718('0x3'));var router=express[_0x7718('0x4')]();var fs_extra=require(_0x7718('0x5'));var auth=require(_0x7718('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7718('0x7'));var controller=require('./intFreshdeskField.controller');router[_0x7718('0x8')]('/',auth[_0x7718('0x9')](),controller['index']);router[_0x7718('0x8')](_0x7718('0xa'),auth[_0x7718('0x9')](),controller['show']);router[_0x7718('0xb')]('/',auth[_0x7718('0x9')](),controller[_0x7718('0xc')]);router[_0x7718('0xd')](_0x7718('0xa'),auth[_0x7718('0x9')](),controller[_0x7718('0xe')]);router['delete'](_0x7718('0xa'),auth[_0x7718('0x9')](),controller[_0x7718('0xf')]);module[_0x7718('0x10')]=router; \ No newline at end of file +var _0x0175=['exports','multer','util','path','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy'];(function(_0x37472d,_0x3deab9){var _0x36aa63=function(_0xba9460){while(--_0xba9460){_0x37472d['push'](_0x37472d['shift']());}};_0x36aa63(++_0x3deab9);}(_0x0175,0x91));var _0x5017=function(_0x4105a8,_0x198324){_0x4105a8=_0x4105a8-0x0;var _0x553f0c=_0x0175[_0x4105a8];return _0x553f0c;};'use strict';var multer=require(_0x5017('0x0'));var util=require(_0x5017('0x1'));var path=require(_0x5017('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x5017('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x5017('0x4'));var config=require(_0x5017('0x5'));var controller=require('./intFreshdeskField.controller');router[_0x5017('0x6')]('/',auth[_0x5017('0x7')](),controller[_0x5017('0x8')]);router[_0x5017('0x6')](_0x5017('0x9'),auth[_0x5017('0x7')](),controller[_0x5017('0xa')]);router[_0x5017('0xb')]('/',auth[_0x5017('0x7')](),controller[_0x5017('0xc')]);router[_0x5017('0xd')](_0x5017('0x9'),auth[_0x5017('0x7')](),controller[_0x5017('0xe')]);router[_0x5017('0xf')](_0x5017('0x9'),auth['isAuthenticated'](),controller[_0x5017('0x10')]);module[_0x5017('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 346d8bf..83dad81 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 _0x7069=['keyValue','string','STRING','variable','BOOLEAN','sequelize','exports','ENUM','customVariable'];(function(_0x2a92d5,_0x46d690){var _0x4d4356=function(_0x3033c7){while(--_0x3033c7){_0x2a92d5['push'](_0x2a92d5['shift']());}};_0x4d4356(++_0x46d690);}(_0x7069,0xcb));var _0x9706=function(_0x5d2bd6,_0x377005){_0x5d2bd6=_0x5d2bd6-0x0;var _0x796b32=_0x7069[_0x5d2bd6];return _0x796b32;};'use strict';var Sequelize=require(_0x9706('0x0'));module[_0x9706('0x1')]={'type':{'type':Sequelize[_0x9706('0x2')]('string','variable',_0x9706('0x3'),_0x9706('0x4'),'picklist'),'defaultValue':_0x9706('0x5')},'content':{'type':Sequelize[_0x9706('0x6')]},'key':{'type':Sequelize[_0x9706('0x6')]},'keyType':{'type':Sequelize[_0x9706('0x2')](_0x9706('0x5'),_0x9706('0x7'),_0x9706('0x3'))},'keyContent':{'type':Sequelize[_0x9706('0x6')]},'idField':{'type':Sequelize[_0x9706('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9706('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7300=['string','variable','customVariable','STRING','sequelize','ENUM'];(function(_0x211d41,_0x496467){var _0x39f43f=function(_0x52bc05){while(--_0x52bc05){_0x211d41['push'](_0x211d41['shift']());}};_0x39f43f(++_0x496467);}(_0x7300,0x1f0));var _0x0730=function(_0x4131b8,_0x3c4617){_0x4131b8=_0x4131b8-0x0;var _0x210598=_0x7300[_0x4131b8];return _0x210598;};'use strict';var Sequelize=require(_0x0730('0x0'));module['exports']={'type':{'type':Sequelize[_0x0730('0x1')](_0x0730('0x2'),_0x0730('0x3'),_0x0730('0x4'),'keyValue','picklist'),'defaultValue':_0x0730('0x2')},'content':{'type':Sequelize[_0x0730('0x5')]},'key':{'type':Sequelize[_0x0730('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x0730('0x2'),'variable',_0x0730('0x4'))},'keyContent':{'type':Sequelize[_0x0730('0x5')]},'idField':{'type':Sequelize[_0x0730('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index ee2d863..4a65ebe 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 _0xd757=['type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','FreshdeskField','rawAttributes','fieldName'];(function(_0x14e669,_0x23e972){var _0x44ea06=function(_0x3eca7b){while(--_0x3eca7b){_0x14e669['push'](_0x14e669['shift']());}};_0x44ea06(++_0x23e972);}(_0xd757,0x1e5));var _0x7d75=function(_0x1f19da,_0x4823c4){_0x1f19da=_0x1f19da-0x0;var _0x797b66=_0xd757[_0x1f19da];return _0x797b66;};'use strict';var emlformat=require(_0x7d75('0x0'));var rimraf=require(_0x7d75('0x1'));var zipdir=require(_0x7d75('0x2'));var jsonpatch=require(_0x7d75('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7d75('0x4'));var Mustache=require(_0x7d75('0x5'));var util=require('util');var path=require(_0x7d75('0x6'));var sox=require(_0x7d75('0x7'));var csv=require(_0x7d75('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7d75('0x9'));var squel=require(_0x7d75('0xa'));var crypto=require(_0x7d75('0xb'));var jsforce=require(_0x7d75('0xc'));var deskjs=require(_0x7d75('0xd'));var toCsv=require(_0x7d75('0x8'));var querystring=require(_0x7d75('0xe'));var Papa=require(_0x7d75('0xf'));var Redis=require(_0x7d75('0x10'));var authService=require(_0x7d75('0x11'));var qs=require(_0x7d75('0x12'));var as=require(_0x7d75('0x13'));var hardwareService=require(_0x7d75('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x7d75('0x15'));var config=require(_0x7d75('0x16'));var licenseUtil=require(_0x7d75('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e7b97,_0x3a5ca5){_0x3a5ca5=_0x3a5ca5||0xcc;return function(_0x5c9fcf){if(_0x5c9fcf){return _0x3e7b97[_0x7d75('0x18')](_0x3a5ca5);}return _0x3e7b97[_0x7d75('0x19')](_0x3a5ca5)[_0x7d75('0x1a')]();};}function respondWithResult(_0x43e546,_0x2b5d23){_0x2b5d23=_0x2b5d23||0xc8;return function(_0x3be8b2){if(_0x3be8b2){return _0x43e546['status'](_0x2b5d23)[_0x7d75('0x1b')](_0x3be8b2);}};}function respondWithFilteredResult(_0x1a460b,_0x14100f){return function(_0x1a9778){if(_0x1a9778){var _0x44041e=typeof _0x14100f[_0x7d75('0x1c')]==='undefined'&&typeof _0x14100f[_0x7d75('0x1d')]==='undefined';var _0x3896c3=_0x1a9778[_0x7d75('0x1e')];var _0x40edfc=_0x44041e?0x0:_0x14100f[_0x7d75('0x1c')];var _0x356b44=_0x44041e?_0x1a9778[_0x7d75('0x1e')]:_0x14100f[_0x7d75('0x1c')]+_0x14100f[_0x7d75('0x1d')];var _0x55b89d;if(_0x356b44>=_0x3896c3){_0x356b44=_0x3896c3;_0x55b89d=0xc8;}else{_0x55b89d=0xce;}_0x1a460b['status'](_0x55b89d);return _0x1a460b[_0x7d75('0x1f')](_0x7d75('0x20'),_0x40edfc+'-'+_0x356b44+'/'+_0x3896c3)[_0x7d75('0x1b')](_0x1a9778);}return null;};}function patchUpdates(_0xbb0322){return function(_0x47a5f0){try{jsonpatch[_0x7d75('0x21')](_0x47a5f0,_0xbb0322,!![]);}catch(_0x31bfa8){return BPromise[_0x7d75('0x22')](_0x31bfa8);}return _0x47a5f0[_0x7d75('0x23')]();};}function saveUpdates(_0x232c46,_0x187093){return function(_0x486ce1){if(_0x486ce1){return _0x486ce1[_0x7d75('0x24')](_0x232c46)[_0x7d75('0x25')](function(_0x1c0327){return _0x1c0327;});}return null;};}function removeEntity(_0x3be591,_0x21211b){return function(_0x323e20){if(_0x323e20){return _0x323e20[_0x7d75('0x26')]()[_0x7d75('0x25')](function(){_0x3be591[_0x7d75('0x19')](0xcc)[_0x7d75('0x1a')]();});}};}function handleEntityNotFound(_0x3103d6,_0x5a1218){return function(_0xec279d){if(!_0xec279d){_0x3103d6[_0x7d75('0x18')](0x194);}return _0xec279d;};}function handleError(_0x4f67e6,_0x19a230){_0x19a230=_0x19a230||0x1f4;return function(_0x50d798){logger[_0x7d75('0x27')](_0x50d798[_0x7d75('0x28')]);if(_0x50d798[_0x7d75('0x29')]){delete _0x50d798[_0x7d75('0x29')];}_0x4f67e6[_0x7d75('0x19')](_0x19a230)['send'](_0x50d798);};}exports[_0x7d75('0x2a')]=function(_0x31055c,_0x2f783b){var _0xb0c225={},_0x1121a6={},_0x11ba6c={'count':0x0,'rows':[]};var _0x5dd4f1=_[_0x7d75('0x2b')](db[_0x7d75('0x2c')][_0x7d75('0x2d')],function(_0x2a1c5b){return{'name':_0x2a1c5b[_0x7d75('0x2e')],'type':_0x2a1c5b[_0x7d75('0x2f')][_0x7d75('0x30')]};});_0x1121a6['model']=_['map'](_0x5dd4f1,'name');_0x1121a6[_0x7d75('0x31')]=_['keys'](_0x31055c[_0x7d75('0x31')]);_0x1121a6[_0x7d75('0x32')]=_[_0x7d75('0x33')](_0x1121a6[_0x7d75('0x34')],_0x1121a6[_0x7d75('0x31')]);_0xb0c225['attributes']=_[_0x7d75('0x33')](_0x1121a6[_0x7d75('0x34')],qs[_0x7d75('0x35')](_0x31055c[_0x7d75('0x31')][_0x7d75('0x35')]));_0xb0c225[_0x7d75('0x36')]=_0xb0c225[_0x7d75('0x36')][_0x7d75('0x37')]?_0xb0c225[_0x7d75('0x36')]:_0x1121a6[_0x7d75('0x34')];if(!_0x31055c['query'][_0x7d75('0x38')](_0x7d75('0x39'))){_0xb0c225[_0x7d75('0x1d')]=qs[_0x7d75('0x1d')](_0x31055c[_0x7d75('0x31')][_0x7d75('0x1d')]);_0xb0c225['offset']=qs[_0x7d75('0x1c')](_0x31055c[_0x7d75('0x31')]['offset']);}_0xb0c225['order']=qs[_0x7d75('0x3a')](_0x31055c[_0x7d75('0x31')][_0x7d75('0x3a')]);_0xb0c225[_0x7d75('0x3b')]=qs[_0x7d75('0x32')](_[_0x7d75('0x3c')](_0x31055c['query'],_0x1121a6[_0x7d75('0x32')]),_0x5dd4f1);if(_0x31055c[_0x7d75('0x31')]['filter']){_0xb0c225[_0x7d75('0x3b')]=_[_0x7d75('0x3d')](_0xb0c225[_0x7d75('0x3b')],{'$or':_[_0x7d75('0x2b')](_0x5dd4f1,function(_0x30aeab){if(_0x30aeab[_0x7d75('0x2f')]!==_0x7d75('0x3e')){var _0x815d03={};_0x815d03[_0x30aeab[_0x7d75('0x29')]]={'$like':'%'+_0x31055c[_0x7d75('0x31')][_0x7d75('0x3f')]+'%'};return _0x815d03;}})});}_0xb0c225=_[_0x7d75('0x3d')]({},_0xb0c225,_0x31055c[_0x7d75('0x40')]);var _0x35ac15={'where':_0xb0c225[_0x7d75('0x3b')]};return db[_0x7d75('0x2c')][_0x7d75('0x1e')](_0x35ac15)[_0x7d75('0x25')](function(_0x304c32){_0x11ba6c[_0x7d75('0x1e')]=_0x304c32;if(_0x31055c['query']['includeAll']){_0xb0c225[_0x7d75('0x41')]=[{'all':!![]}];}return db[_0x7d75('0x2c')][_0x7d75('0x42')](_0xb0c225);})[_0x7d75('0x25')](function(_0x222ece){_0x11ba6c[_0x7d75('0x43')]=_0x222ece;return _0x11ba6c;})[_0x7d75('0x25')](respondWithFilteredResult(_0x2f783b,_0xb0c225))['catch'](handleError(_0x2f783b,null));};exports[_0x7d75('0x44')]=function(_0x23e6f9,_0x42a57e){var _0x5edd82={'raw':!![],'where':{'id':_0x23e6f9[_0x7d75('0x45')]['id']}},_0x2e1f36={};_0x2e1f36[_0x7d75('0x34')]=_[_0x7d75('0x46')](db[_0x7d75('0x2c')][_0x7d75('0x2d')]);_0x2e1f36[_0x7d75('0x31')]=_[_0x7d75('0x46')](_0x23e6f9[_0x7d75('0x31')]);_0x2e1f36[_0x7d75('0x32')]=_[_0x7d75('0x33')](_0x2e1f36['model'],_0x2e1f36[_0x7d75('0x31')]);_0x5edd82['attributes']=_['intersection'](_0x2e1f36[_0x7d75('0x34')],qs['fields'](_0x23e6f9[_0x7d75('0x31')][_0x7d75('0x35')]));_0x5edd82['attributes']=_0x5edd82[_0x7d75('0x36')][_0x7d75('0x37')]?_0x5edd82[_0x7d75('0x36')]:_0x2e1f36[_0x7d75('0x34')];if(_0x23e6f9[_0x7d75('0x31')][_0x7d75('0x47')]){_0x5edd82[_0x7d75('0x41')]=[{'all':!![]}];}_0x5edd82=_[_0x7d75('0x3d')]({},_0x5edd82,_0x23e6f9['options']);return db[_0x7d75('0x2c')][_0x7d75('0x48')](_0x5edd82)[_0x7d75('0x25')](handleEntityNotFound(_0x42a57e,null))['then'](respondWithResult(_0x42a57e,null))[_0x7d75('0x49')](handleError(_0x42a57e,null));};exports[_0x7d75('0x4a')]=function(_0x34ff66,_0x277788){return db[_0x7d75('0x2c')][_0x7d75('0x4a')](_0x34ff66['body'],{})[_0x7d75('0x25')](respondWithResult(_0x277788,0xc9))[_0x7d75('0x49')](handleError(_0x277788,null));};exports[_0x7d75('0x24')]=function(_0x31b9be,_0x4cb900){if(_0x31b9be[_0x7d75('0x4b')]['id']){delete _0x31b9be['body']['id'];}return db[_0x7d75('0x2c')][_0x7d75('0x48')]({'where':{'id':_0x31b9be[_0x7d75('0x45')]['id']}})['then'](handleEntityNotFound(_0x4cb900,null))[_0x7d75('0x25')](saveUpdates(_0x31b9be['body'],null))[_0x7d75('0x25')](respondWithResult(_0x4cb900,null))['catch'](handleError(_0x4cb900,null));};exports[_0x7d75('0x26')]=function(_0x27a11f,_0x1009eb){return db['FreshdeskField'][_0x7d75('0x48')]({'where':{'id':_0x27a11f['params']['id']}})[_0x7d75('0x25')](handleEntityNotFound(_0x1009eb,null))[_0x7d75('0x25')](removeEntity(_0x1009eb,null))[_0x7d75('0x49')](handleError(_0x1009eb,null));}; \ No newline at end of file +var _0x49e9=['status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','error','name','send','index','FreshdeskField','rawAttributes','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','catch','params','include','options','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x49e9,0x10f));var _0x949e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x49e9[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x949e('0x0'));var rimraf=require(_0x949e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x949e('0x2'));var rp=require(_0x949e('0x3'));var moment=require(_0x949e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x949e('0x5'));var path=require('path');var sox=require(_0x949e('0x6'));var csv=require(_0x949e('0x7'));var ejs=require(_0x949e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x949e('0x9'));var squel=require(_0x949e('0xa'));var crypto=require(_0x949e('0xb'));var jsforce=require(_0x949e('0xc'));var deskjs=require(_0x949e('0xd'));var toCsv=require(_0x949e('0x7'));var querystring=require(_0x949e('0xe'));var Papa=require('papaparse');var Redis=require(_0x949e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x949e('0x10'));var as=require(_0x949e('0x11'));var hardwareService=require(_0x949e('0x12'));var logger=require('../../config/logger')(_0x949e('0x13'));var utils=require(_0x949e('0x14'));var config=require(_0x949e('0x15'));var licenseUtil=require(_0x949e('0x16'));var db=require(_0x949e('0x17'))['db'];function respondWithStatusCode(_0x253d5e,_0x1871a5){_0x1871a5=_0x1871a5||0xcc;return function(_0x17d1f3){if(_0x17d1f3){return _0x253d5e[_0x949e('0x18')](_0x1871a5);}return _0x253d5e[_0x949e('0x19')](_0x1871a5)[_0x949e('0x1a')]();};}function respondWithResult(_0x7a8954,_0x3e0e54){_0x3e0e54=_0x3e0e54||0xc8;return function(_0x7f8be2){if(_0x7f8be2){return _0x7a8954[_0x949e('0x19')](_0x3e0e54)['json'](_0x7f8be2);}};}function respondWithFilteredResult(_0x257981,_0x3d81cd){return function(_0x587bff){if(_0x587bff){var _0xf1f41a=typeof _0x3d81cd['offset']===_0x949e('0x1b')&&typeof _0x3d81cd[_0x949e('0x1c')]==='undefined';var _0x37fd96=_0x587bff[_0x949e('0x1d')];var _0x43498d=_0xf1f41a?0x0:_0x3d81cd[_0x949e('0x1e')];var _0x20333c=_0xf1f41a?_0x587bff['count']:_0x3d81cd[_0x949e('0x1e')]+_0x3d81cd[_0x949e('0x1c')];var _0x476fa8;if(_0x20333c>=_0x37fd96){_0x20333c=_0x37fd96;_0x476fa8=0xc8;}else{_0x476fa8=0xce;}_0x257981[_0x949e('0x19')](_0x476fa8);return _0x257981[_0x949e('0x1f')](_0x949e('0x20'),_0x43498d+'-'+_0x20333c+'/'+_0x37fd96)[_0x949e('0x21')](_0x587bff);}return null;};}function patchUpdates(_0x2f21bd){return function(_0x104740){try{jsonpatch[_0x949e('0x22')](_0x104740,_0x2f21bd,!![]);}catch(_0x23fc20){return BPromise[_0x949e('0x23')](_0x23fc20);}return _0x104740[_0x949e('0x24')]();};}function saveUpdates(_0x1927ab,_0x199d53){return function(_0x2e81f2){if(_0x2e81f2){return _0x2e81f2['update'](_0x1927ab)[_0x949e('0x25')](function(_0x44ffb4){return _0x44ffb4;});}return null;};}function removeEntity(_0x5572ae,_0x48a1d1){return function(_0x23b38e){if(_0x23b38e){return _0x23b38e[_0x949e('0x26')]()[_0x949e('0x25')](function(){_0x5572ae[_0x949e('0x19')](0xcc)[_0x949e('0x1a')]();});}};}function handleEntityNotFound(_0x1185b3,_0x29e07b){return function(_0x255b11){if(!_0x255b11){_0x1185b3[_0x949e('0x18')](0x194);}return _0x255b11;};}function handleError(_0x20258c,_0x5dcc46){_0x5dcc46=_0x5dcc46||0x1f4;return function(_0x212224){logger[_0x949e('0x27')](_0x212224['stack']);if(_0x212224[_0x949e('0x28')]){delete _0x212224[_0x949e('0x28')];}_0x20258c['status'](_0x5dcc46)[_0x949e('0x29')](_0x212224);};}exports[_0x949e('0x2a')]=function(_0x5b9f28,_0x1867d9){var _0x5b2b0b={},_0x5e6e34={},_0x4e169d={'count':0x0,'rows':[]};var _0x54ad5d=_['map'](db[_0x949e('0x2b')][_0x949e('0x2c')],function(_0x3051ec){return{'name':_0x3051ec['fieldName'],'type':_0x3051ec['type']['key']};});_0x5e6e34['model']=_[_0x949e('0x2d')](_0x54ad5d,_0x949e('0x28'));_0x5e6e34[_0x949e('0x2e')]=_[_0x949e('0x2f')](_0x5b9f28['query']);_0x5e6e34[_0x949e('0x30')]=_[_0x949e('0x31')](_0x5e6e34[_0x949e('0x32')],_0x5e6e34['query']);_0x5b2b0b[_0x949e('0x33')]=_[_0x949e('0x31')](_0x5e6e34[_0x949e('0x32')],qs['fields'](_0x5b9f28['query'][_0x949e('0x34')]));_0x5b2b0b[_0x949e('0x33')]=_0x5b2b0b[_0x949e('0x33')][_0x949e('0x35')]?_0x5b2b0b['attributes']:_0x5e6e34[_0x949e('0x32')];if(!_0x5b9f28[_0x949e('0x2e')][_0x949e('0x36')](_0x949e('0x37'))){_0x5b2b0b[_0x949e('0x1c')]=qs[_0x949e('0x1c')](_0x5b9f28[_0x949e('0x2e')][_0x949e('0x1c')]);_0x5b2b0b['offset']=qs['offset'](_0x5b9f28[_0x949e('0x2e')]['offset']);}_0x5b2b0b['order']=qs[_0x949e('0x38')](_0x5b9f28[_0x949e('0x2e')][_0x949e('0x38')]);_0x5b2b0b[_0x949e('0x39')]=qs[_0x949e('0x30')](_[_0x949e('0x3a')](_0x5b9f28[_0x949e('0x2e')],_0x5e6e34[_0x949e('0x30')]),_0x54ad5d);if(_0x5b9f28[_0x949e('0x2e')][_0x949e('0x3b')]){_0x5b2b0b[_0x949e('0x39')]=_[_0x949e('0x3c')](_0x5b2b0b[_0x949e('0x39')],{'$or':_[_0x949e('0x2d')](_0x54ad5d,function(_0x26ad2b){if(_0x26ad2b[_0x949e('0x3d')]!==_0x949e('0x3e')){var _0x498fa3={};_0x498fa3[_0x26ad2b[_0x949e('0x28')]]={'$like':'%'+_0x5b9f28['query'][_0x949e('0x3b')]+'%'};return _0x498fa3;}})});}_0x5b2b0b=_[_0x949e('0x3c')]({},_0x5b2b0b,_0x5b9f28['options']);var _0x5084dc={'where':_0x5b2b0b['where']};return db[_0x949e('0x2b')][_0x949e('0x1d')](_0x5084dc)['then'](function(_0x59c024){_0x4e169d['count']=_0x59c024;if(_0x5b9f28[_0x949e('0x2e')][_0x949e('0x3f')]){_0x5b2b0b['include']=[{'all':!![]}];}return db[_0x949e('0x2b')][_0x949e('0x40')](_0x5b2b0b);})['then'](function(_0x3a1bc7){_0x4e169d[_0x949e('0x41')]=_0x3a1bc7;return _0x4e169d;})[_0x949e('0x25')](respondWithFilteredResult(_0x1867d9,_0x5b2b0b))[_0x949e('0x42')](handleError(_0x1867d9,null));};exports['show']=function(_0x58b34b,_0x2bca69){var _0x590aa7={'raw':!![],'where':{'id':_0x58b34b[_0x949e('0x43')]['id']}},_0x7201da={};_0x7201da[_0x949e('0x32')]=_[_0x949e('0x2f')](db[_0x949e('0x2b')]['rawAttributes']);_0x7201da['query']=_[_0x949e('0x2f')](_0x58b34b['query']);_0x7201da[_0x949e('0x30')]=_[_0x949e('0x31')](_0x7201da[_0x949e('0x32')],_0x7201da[_0x949e('0x2e')]);_0x590aa7[_0x949e('0x33')]=_[_0x949e('0x31')](_0x7201da['model'],qs['fields'](_0x58b34b[_0x949e('0x2e')][_0x949e('0x34')]));_0x590aa7[_0x949e('0x33')]=_0x590aa7[_0x949e('0x33')][_0x949e('0x35')]?_0x590aa7['attributes']:_0x7201da[_0x949e('0x32')];if(_0x58b34b[_0x949e('0x2e')]['includeAll']){_0x590aa7[_0x949e('0x44')]=[{'all':!![]}];}_0x590aa7=_[_0x949e('0x3c')]({},_0x590aa7,_0x58b34b[_0x949e('0x45')]);return db[_0x949e('0x2b')][_0x949e('0x46')](_0x590aa7)[_0x949e('0x25')](handleEntityNotFound(_0x2bca69,null))[_0x949e('0x25')](respondWithResult(_0x2bca69,null))[_0x949e('0x42')](handleError(_0x2bca69,null));};exports[_0x949e('0x47')]=function(_0x4913f5,_0x1599ea){return db['FreshdeskField'][_0x949e('0x47')](_0x4913f5[_0x949e('0x48')],{})['then'](respondWithResult(_0x1599ea,0xc9))[_0x949e('0x42')](handleError(_0x1599ea,null));};exports[_0x949e('0x49')]=function(_0x121355,_0x2e2b6a){if(_0x121355[_0x949e('0x48')]['id']){delete _0x121355[_0x949e('0x48')]['id'];}return db[_0x949e('0x2b')][_0x949e('0x46')]({'where':{'id':_0x121355['params']['id']}})[_0x949e('0x25')](handleEntityNotFound(_0x2e2b6a,null))[_0x949e('0x25')](saveUpdates(_0x121355[_0x949e('0x48')],null))[_0x949e('0x25')](respondWithResult(_0x2e2b6a,null))[_0x949e('0x42')](handleError(_0x2e2b6a,null));};exports['destroy']=function(_0x5f23b2,_0x46a4fe){return db[_0x949e('0x2b')]['find']({'where':{'id':_0x5f23b2[_0x949e('0x43')]['id']}})[_0x949e('0x25')](handleEntityNotFound(_0x46a4fe,null))[_0x949e('0x25')](removeEntity(_0x46a4fe,null))[_0x949e('0x42')](handleError(_0x46a4fe,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index e4f7f96..5d410c1 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 _0x52cb=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','lodash','util'];(function(_0xdc6dcf,_0x4e9d7a){var _0x7cc8da=function(_0x2829a6){while(--_0x2829a6){_0xdc6dcf['push'](_0xdc6dcf['shift']());}};_0x7cc8da(++_0x4e9d7a);}(_0x52cb,0x1a2));var _0xb52c=function(_0x5bd50e,_0x4dee56){_0x5bd50e=_0x5bd50e-0x0;var _0x42f9e5=_0x52cb[_0x5bd50e];return _0x42f9e5;};'use strict';var _=require(_0xb52c('0x0'));var util=require(_0xb52c('0x1'));var logger=require('../../config/logger')(_0xb52c('0x2'));var moment=require(_0xb52c('0x3'));var BPromise=require(_0xb52c('0x4'));var rp=require(_0xb52c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb52c('0x6'));var config=require(_0xb52c('0x7'));var attributes=require(_0xb52c('0x8'));module[_0xb52c('0x9')]=function(_0x304783,_0x30fd4f){return _0x304783[_0xb52c('0xa')](_0xb52c('0xb'),attributes,{'tableName':_0xb52c('0xc'),'paranoid':![],'indexes':[{'name':_0xb52c('0xd'),'fields':[_0xb52c('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb73b=['rimraf','./intFreshdeskField.attributes','FreshdeskField','freshdesk_unique_index','idField','lodash','util','api','moment','bluebird','request-promise'];(function(_0x5af812,_0x43d252){var _0x1489f2=function(_0x1c7fa9){while(--_0x1c7fa9){_0x5af812['push'](_0x5af812['shift']());}};_0x1489f2(++_0x43d252);}(_0xb73b,0x14f));var _0xbb73=function(_0x2b1661,_0x12fb47){_0x2b1661=_0x2b1661-0x0;var _0x32ca92=_0xb73b[_0x2b1661];return _0x32ca92;};'use strict';var _=require(_0xbb73('0x0'));var util=require(_0xbb73('0x1'));var logger=require('../../config/logger')(_0xbb73('0x2'));var moment=require(_0xbb73('0x3'));var BPromise=require(_0xbb73('0x4'));var rp=require(_0xbb73('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbb73('0x6'));var config=require('../../config/environment');var attributes=require(_0xbb73('0x7'));module['exports']=function(_0x32262,_0x33b17c){return _0x32262['define'](_0xbb73('0x8'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0xbb73('0x9'),'fields':[_0xbb73('0xa'),'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 89efaef..887e1df 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 _0x11a4=['debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','FreshdeskField,\x20%s,\x20%s'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x11a4,0x1c0));var _0x411a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x11a4[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x411a('0x0'));var util=require(_0x411a('0x1'));var moment=require(_0x411a('0x2'));var BPromise=require(_0x411a('0x3'));var rs=require(_0x411a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x411a('0x5'))['db'];var utils=require(_0x411a('0x6'));var logger=require('../../config/logger')(_0x411a('0x7'));var config=require(_0x411a('0x8'));var jayson=require(_0x411a('0x9'));var client=jayson[_0x411a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2eeb92,_0x4a79b7,_0x2b3a58){return new BPromise(function(_0x455daa,_0x41602f){return client[_0x411a('0xb')](_0x2eeb92,_0x2b3a58)['then'](function(_0x4cfe5b){logger[_0x411a('0xc')](_0x411a('0xd'),_0x4a79b7,'request\x20sent');logger[_0x411a('0xe')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x4a79b7,_0x411a('0xf'),JSON[_0x411a('0x10')](_0x4cfe5b));if(_0x4cfe5b[_0x411a('0x11')]){if(_0x4cfe5b[_0x411a('0x11')][_0x411a('0x12')]===0x1f4){logger[_0x411a('0x11')](_0x411a('0xd'),_0x4a79b7,_0x4cfe5b['error'][_0x411a('0x13')]);return _0x41602f(_0x4cfe5b[_0x411a('0x11')]['message']);}logger[_0x411a('0x11')](_0x411a('0xd'),_0x4a79b7,_0x4cfe5b[_0x411a('0x11')][_0x411a('0x13')]);return _0x455daa(_0x4cfe5b[_0x411a('0x11')][_0x411a('0x13')]);}else{logger[_0x411a('0xc')](_0x411a('0xd'),_0x4a79b7,_0x411a('0xf'));_0x455daa(_0x4cfe5b[_0x411a('0x14')][_0x411a('0x13')]);}})[_0x411a('0x15')](function(_0x79a4c0){logger[_0x411a('0x11')]('FreshdeskField,\x20%s,\x20%s',_0x4a79b7,_0x79a4c0);_0x41602f(_0x79a4c0);});});} \ No newline at end of file +var _0x390e=['FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info'];(function(_0x4a6e60,_0x199e30){var _0x14f4cb=function(_0x4ea705){while(--_0x4ea705){_0x4a6e60['push'](_0x4a6e60['shift']());}};_0x14f4cb(++_0x199e30);}(_0x390e,0x106));var _0xe390=function(_0x15fe06,_0x41d46c){_0x15fe06=_0x15fe06-0x0;var _0x24aaa4=_0x390e[_0x15fe06];return _0x24aaa4;};'use strict';var _=require(_0xe390('0x0'));var util=require(_0xe390('0x1'));var moment=require('moment');var BPromise=require(_0xe390('0x2'));var rs=require(_0xe390('0x3'));var fs=require('fs');var Redis=require(_0xe390('0x4'));var db=require(_0xe390('0x5'))['db'];var utils=require(_0xe390('0x6'));var logger=require(_0xe390('0x7'))(_0xe390('0x8'));var config=require(_0xe390('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe390('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x446de5,_0x2aafa2,_0x494a6f){return new BPromise(function(_0x28fb19,_0x36be8b){return client[_0xe390('0xb')](_0x446de5,_0x494a6f)[_0xe390('0xc')](function(_0x3b9791){logger[_0xe390('0xd')](_0xe390('0xe'),_0x2aafa2,_0xe390('0xf'));logger[_0xe390('0x10')](_0xe390('0x11'),_0x2aafa2,'request\x20sent',JSON[_0xe390('0x12')](_0x3b9791));if(_0x3b9791[_0xe390('0x13')]){if(_0x3b9791['error'][_0xe390('0x14')]===0x1f4){logger['error'](_0xe390('0xe'),_0x2aafa2,_0x3b9791[_0xe390('0x13')][_0xe390('0x15')]);return _0x36be8b(_0x3b9791[_0xe390('0x13')][_0xe390('0x15')]);}logger['error'](_0xe390('0xe'),_0x2aafa2,_0x3b9791[_0xe390('0x13')]['message']);return _0x28fb19(_0x3b9791['error']['message']);}else{logger[_0xe390('0xd')](_0xe390('0xe'),_0x2aafa2,_0xe390('0xf'));_0x28fb19(_0x3b9791['result'][_0xe390('0x15')]);}})[_0xe390('0x16')](function(_0x120a91){logger[_0xe390('0x13')](_0xe390('0xe'),_0x2aafa2,_0x120a91);_0x36be8b(_0x120a91);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index d79801c..1de6708 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 _0x8f59=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','isAuthenticated','index','get','show','/:id/configurations','getConfigurations','/:id/fields','post','addConfiguration','put','/:id','update','delete','destroy','multer','util','path'];(function(_0x415b51,_0x1a29ee){var _0x1dd82c=function(_0x25afee){while(--_0x25afee){_0x415b51['push'](_0x415b51['shift']());}};_0x1dd82c(++_0x1a29ee);}(_0x8f59,0x11d));var _0x98f5=function(_0x5d0594,_0x3d8ede){_0x5d0594=_0x5d0594-0x0;var _0x179e9a=_0x8f59[_0x5d0594];return _0x179e9a;};'use strict';var multer=require(_0x98f5('0x0'));var util=require(_0x98f5('0x1'));var path=require(_0x98f5('0x2'));var timeout=require(_0x98f5('0x3'));var express=require(_0x98f5('0x4'));var router=express[_0x98f5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x98f5('0x6'));var interaction=require(_0x98f5('0x7'));var config=require(_0x98f5('0x8'));var controller=require(_0x98f5('0x9'));router['get']('/',auth[_0x98f5('0xa')](),controller[_0x98f5('0xb')]);router[_0x98f5('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x98f5('0xd')]);router[_0x98f5('0xc')](_0x98f5('0xe'),auth['isAuthenticated'](),controller[_0x98f5('0xf')]);router[_0x98f5('0xc')](_0x98f5('0x10'),auth[_0x98f5('0xa')](),controller['getFields']);router[_0x98f5('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x98f5('0x11')](_0x98f5('0xe'),auth['isAuthenticated'](),controller[_0x98f5('0x12')]);router[_0x98f5('0x13')](_0x98f5('0x14'),auth[_0x98f5('0xa')](),controller[_0x98f5('0x15')]);router[_0x98f5('0x16')]('/:id',auth[_0x98f5('0xa')](),controller[_0x98f5('0x17')]);module['exports']=router; \ No newline at end of file +var _0x0713=['destroy','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','delete'];(function(_0x17411f,_0x3067fb){var _0x4e0501=function(_0xd3105c){while(--_0xd3105c){_0x17411f['push'](_0x17411f['shift']());}};_0x4e0501(++_0x3067fb);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['getConfigurations']);router[_0x3071('0x8')](_0x3071('0xe'),auth[_0x3071('0x9')](),controller[_0x3071('0xf')]);router[_0x3071('0x10')]('/',auth['isAuthenticated'](),controller[_0x3071('0x11')]);router[_0x3071('0x10')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x12')]);router['put']('/:id',auth[_0x3071('0x9')](),controller['update']);router[_0x3071('0x13')](_0x3071('0xb'),auth['isAuthenticated'](),controller[_0x3071('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 53f6e5b..040ba34 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 _0xd4a2=['STRING','username','sequelize'];(function(_0x3aa5df,_0x243fbb){var _0x2eff2d=function(_0x5d3fc8){while(--_0x5d3fc8){_0x3aa5df['push'](_0x3aa5df['shift']());}};_0x2eff2d(++_0x243fbb);}(_0xd4a2,0x173));var _0x2d4a=function(_0xf3faf1,_0x445650){_0xf3faf1=_0xf3faf1-0x0;var _0x55b2c9=_0xd4a2[_0xf3faf1];return _0x55b2c9;};'use strict';var Sequelize=require(_0x2d4a('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2d4a('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x2d4a('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2d4a('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x2d4a('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xbbbc=['remoteUri','sequelize','exports','STRING','username'];(function(_0x4e46e4,_0x47e97d){var _0xa22824=function(_0xff0dd5){while(--_0xff0dd5){_0x4e46e4['push'](_0x4e46e4['shift']());}};_0xa22824(++_0x47e97d);}(_0xbbbc,0xf6));var _0xcbbb=function(_0x2a4aef,_0x4ab35d){_0x2a4aef=_0x2a4aef-0x0;var _0xdab266=_0xbbbc[_0x2a4aef];return _0xdab266;};'use strict';var Sequelize=require(_0xcbbb('0x0'));module[_0xcbbb('0x1')]={'name':{'type':Sequelize[_0xcbbb('0x2')]},'description':{'type':Sequelize[_0xcbbb('0x2')]},'username':{'type':Sequelize[_0xcbbb('0x2')],'unique':_0xcbbb('0x3')},'apiKey':{'type':Sequelize[_0xcbbb('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xcbbb('0x4')},'serverUrl':{'type':Sequelize[_0xcbbb('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 4e765f8..65b940d 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 _0x4c4a=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','set','apply','save','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','FreshsalesAccount','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','destroy','hasOwnProperty','getConfigurations','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s%s','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x36fbd1,_0x4cdf37){var _0x42ccd8=function(_0x454596){while(--_0x454596){_0x36fbd1['push'](_0x36fbd1['shift']());}};_0x42ccd8(++_0x4cdf37);}(_0x4c4a,0x190));var _0xa4c4=function(_0x2b9aa3,_0x30a813){_0x2b9aa3=_0x2b9aa3-0x0;var _0x37a144=_0x4c4a[_0x2b9aa3];return _0x37a144;};'use strict';var emlformat=require(_0xa4c4('0x0'));var rimraf=require(_0xa4c4('0x1'));var zipdir=require(_0xa4c4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa4c4('0x3'));var moment=require(_0xa4c4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa4c4('0x5'));var util=require(_0xa4c4('0x6'));var path=require(_0xa4c4('0x7'));var sox=require(_0xa4c4('0x8'));var csv=require(_0xa4c4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa4c4('0xa'));var _=require(_0xa4c4('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa4c4('0xc'));var deskjs=require(_0xa4c4('0xd'));var toCsv=require(_0xa4c4('0x9'));var querystring=require('querystring');var Papa=require(_0xa4c4('0xe'));var Redis=require(_0xa4c4('0xf'));var authService=require(_0xa4c4('0x10'));var qs=require(_0xa4c4('0x11'));var as=require(_0xa4c4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa4c4('0x13'))(_0xa4c4('0x14'));var utils=require(_0xa4c4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa4c4('0x16'));var db=require(_0xa4c4('0x17'))['db'];var integrations=require(_0xa4c4('0x18'));function respondWithStatusCode(_0x18dab8,_0x3bd145){_0x3bd145=_0x3bd145||0xcc;return function(_0x58f023){if(_0x58f023){return _0x18dab8[_0xa4c4('0x19')](_0x3bd145);}return _0x18dab8[_0xa4c4('0x1a')](_0x3bd145)[_0xa4c4('0x1b')]();};}function respondWithResult(_0x5df8b8,_0x33f67e){_0x33f67e=_0x33f67e||0xc8;return function(_0x3213d){if(_0x3213d){return _0x5df8b8[_0xa4c4('0x1a')](_0x33f67e)[_0xa4c4('0x1c')](_0x3213d);}};}function respondWithFilteredResult(_0x3e68bf,_0x14766c){return function(_0x4b8bc7){if(_0x4b8bc7){var _0x4d8d32=typeof _0x14766c[_0xa4c4('0x1d')]===_0xa4c4('0x1e')&&typeof _0x14766c['limit']===_0xa4c4('0x1e');var _0x215c53=_0x4b8bc7[_0xa4c4('0x1f')];var _0x2166cc=_0x4d8d32?0x0:_0x14766c[_0xa4c4('0x1d')];var _0x956d7e=_0x4d8d32?_0x4b8bc7['count']:_0x14766c[_0xa4c4('0x1d')]+_0x14766c['limit'];var _0x3fb316;if(_0x956d7e>=_0x215c53){_0x956d7e=_0x215c53;_0x3fb316=0xc8;}else{_0x3fb316=0xce;}_0x3e68bf[_0xa4c4('0x1a')](_0x3fb316);return _0x3e68bf[_0xa4c4('0x20')]('Content-Range',_0x2166cc+'-'+_0x956d7e+'/'+_0x215c53)[_0xa4c4('0x1c')](_0x4b8bc7);}return null;};}function patchUpdates(_0x2dc451){return function(_0x42ce5c){try{jsonpatch[_0xa4c4('0x21')](_0x42ce5c,_0x2dc451,!![]);}catch(_0x153e60){return BPromise['reject'](_0x153e60);}return _0x42ce5c[_0xa4c4('0x22')]();};}function saveUpdates(_0xd7d761,_0x587d72){return function(_0x594e04){if(_0x594e04){return _0x594e04[_0xa4c4('0x23')](_0xd7d761)[_0xa4c4('0x24')](function(_0x51c88b){return _0x51c88b;});}return null;};}function removeEntity(_0xaf8f2e,_0x462551){return function(_0x45cb60){if(_0x45cb60){return _0x45cb60['destroy']()[_0xa4c4('0x24')](function(){_0xaf8f2e[_0xa4c4('0x1a')](0xcc)[_0xa4c4('0x1b')]();});}};}function handleEntityNotFound(_0x15752d,_0x54b76c){return function(_0x406421){if(!_0x406421){_0x15752d[_0xa4c4('0x19')](0x194);}return _0x406421;};}function handleError(_0x181a5d,_0x177539){_0x177539=_0x177539||0x1f4;return function(_0x22a33b){logger['error'](_0x22a33b[_0xa4c4('0x25')]);if(_0x22a33b['name']){delete _0x22a33b[_0xa4c4('0x26')];}_0x181a5d[_0xa4c4('0x1a')](_0x177539)[_0xa4c4('0x27')](_0x22a33b);};}exports[_0xa4c4('0x28')]=function(_0x5019a3,_0xf5a184){var _0x110e8a={},_0x22d7b3={},_0x2bce47={'count':0x0,'rows':[]};var _0x23e5d2=_[_0xa4c4('0x29')](db['FreshsalesAccount'][_0xa4c4('0x2a')],function(_0x183681){return{'name':_0x183681[_0xa4c4('0x2b')],'type':_0x183681[_0xa4c4('0x2c')]['key']};});_0x22d7b3[_0xa4c4('0x2d')]=_[_0xa4c4('0x29')](_0x23e5d2,_0xa4c4('0x26'));_0x22d7b3[_0xa4c4('0x2e')]=_[_0xa4c4('0x2f')](_0x5019a3['query']);_0x22d7b3[_0xa4c4('0x30')]=_['intersection'](_0x22d7b3[_0xa4c4('0x2d')],_0x22d7b3[_0xa4c4('0x2e')]);_0x110e8a[_0xa4c4('0x31')]=_[_0xa4c4('0x32')](_0x22d7b3[_0xa4c4('0x2d')],qs[_0xa4c4('0x33')](_0x5019a3[_0xa4c4('0x2e')]['fields']));_0x110e8a[_0xa4c4('0x31')]=_0x110e8a['attributes']['length']?_0x110e8a[_0xa4c4('0x31')]:_0x22d7b3[_0xa4c4('0x2d')];if(!_0x5019a3['query']['hasOwnProperty'](_0xa4c4('0x34'))){_0x110e8a[_0xa4c4('0x35')]=qs[_0xa4c4('0x35')](_0x5019a3[_0xa4c4('0x2e')]['limit']);_0x110e8a['offset']=qs[_0xa4c4('0x1d')](_0x5019a3[_0xa4c4('0x2e')]['offset']);}_0x110e8a[_0xa4c4('0x36')]=qs[_0xa4c4('0x37')](_0x5019a3[_0xa4c4('0x2e')]['sort']);_0x110e8a[_0xa4c4('0x38')]=qs['filters'](_[_0xa4c4('0x39')](_0x5019a3[_0xa4c4('0x2e')],_0x22d7b3['filters']),_0x23e5d2);if(_0x5019a3['query'][_0xa4c4('0x3a')]){_0x110e8a[_0xa4c4('0x38')]=_[_0xa4c4('0x3b')](_0x110e8a[_0xa4c4('0x38')],{'$or':_['map'](_0x23e5d2,function(_0x2a69a1){if(_0x2a69a1['type']!==_0xa4c4('0x3c')){var _0x10961f={};_0x10961f[_0x2a69a1['name']]={'$like':'%'+_0x5019a3[_0xa4c4('0x2e')][_0xa4c4('0x3a')]+'%'};return _0x10961f;}})});}_0x110e8a=_[_0xa4c4('0x3b')]({},_0x110e8a,_0x5019a3[_0xa4c4('0x3d')]);var _0x1dae35={'where':_0x110e8a[_0xa4c4('0x38')]};return db[_0xa4c4('0x3e')]['count'](_0x1dae35)[_0xa4c4('0x24')](function(_0x1a833b){_0x2bce47[_0xa4c4('0x1f')]=_0x1a833b;if(_0x5019a3['query'][_0xa4c4('0x3f')]){_0x110e8a['include']=[{'all':!![]}];}return db['FreshsalesAccount'][_0xa4c4('0x40')](_0x110e8a);})['then'](function(_0x361743){_0x2bce47[_0xa4c4('0x41')]=_0x361743;return _0x2bce47;})[_0xa4c4('0x24')](respondWithFilteredResult(_0xf5a184,_0x110e8a))[_0xa4c4('0x42')](handleError(_0xf5a184,null));};exports[_0xa4c4('0x43')]=function(_0x25e6c6,_0x11c7d3){var _0x49643f={'raw':![],'where':{'id':_0x25e6c6[_0xa4c4('0x44')]['id']}},_0x166ffc={};_0x166ffc['model']=_[_0xa4c4('0x2f')](db[_0xa4c4('0x3e')]['rawAttributes']);_0x166ffc[_0xa4c4('0x2e')]=_['keys'](_0x25e6c6[_0xa4c4('0x2e')]);_0x166ffc['filters']=_[_0xa4c4('0x32')](_0x166ffc[_0xa4c4('0x2d')],_0x166ffc['query']);_0x49643f[_0xa4c4('0x31')]=_[_0xa4c4('0x32')](_0x166ffc[_0xa4c4('0x2d')],qs[_0xa4c4('0x33')](_0x25e6c6[_0xa4c4('0x2e')][_0xa4c4('0x33')]));_0x49643f[_0xa4c4('0x31')]=_0x49643f[_0xa4c4('0x31')][_0xa4c4('0x45')]?_0x49643f[_0xa4c4('0x31')]:_0x166ffc[_0xa4c4('0x2d')];if(_0x25e6c6[_0xa4c4('0x2e')][_0xa4c4('0x3f')]){_0x49643f[_0xa4c4('0x46')]=[{'all':!![]}];}_0x49643f=_[_0xa4c4('0x3b')]({},_0x49643f,_0x25e6c6[_0xa4c4('0x3d')]);return db[_0xa4c4('0x3e')][_0xa4c4('0x47')](_0x49643f)[_0xa4c4('0x24')](handleEntityNotFound(_0x11c7d3,null))[_0xa4c4('0x24')](respondWithResult(_0x11c7d3,null))[_0xa4c4('0x42')](handleError(_0x11c7d3,null));};exports[_0xa4c4('0x48')]=function(_0x2df4e7,_0x234041){return db[_0xa4c4('0x3e')][_0xa4c4('0x48')](_0x2df4e7['body'],{})[_0xa4c4('0x24')](respondWithResult(_0x234041,0xc9))[_0xa4c4('0x42')](handleError(_0x234041,null));};exports[_0xa4c4('0x23')]=function(_0x4812bd,_0x1a9097){if(_0x4812bd[_0xa4c4('0x49')]['id']){delete _0x4812bd[_0xa4c4('0x49')]['id'];}return db[_0xa4c4('0x3e')][_0xa4c4('0x47')]({'where':{'id':_0x4812bd[_0xa4c4('0x44')]['id']}})[_0xa4c4('0x24')](handleEntityNotFound(_0x1a9097,null))[_0xa4c4('0x24')](saveUpdates(_0x4812bd[_0xa4c4('0x49')],null))['then'](respondWithResult(_0x1a9097,null))[_0xa4c4('0x42')](handleError(_0x1a9097,null));};exports[_0xa4c4('0x4a')]=function(_0x36129d,_0x2b1e94){return db[_0xa4c4('0x3e')]['find']({'where':{'id':_0x36129d[_0xa4c4('0x44')]['id']}})[_0xa4c4('0x24')](handleEntityNotFound(_0x2b1e94,null))[_0xa4c4('0x24')](removeEntity(_0x2b1e94,null))[_0xa4c4('0x42')](handleError(_0x2b1e94,null));};exports['getConfigurations']=function(_0x49307e,_0x3efef6,_0x47f115){var _0x26be09={};var _0xea949d={};var _0x20038e;var _0x31df0e;return db[_0xa4c4('0x3e')]['findOne']({'where':{'id':_0x49307e[_0xa4c4('0x44')]['id']}})[_0xa4c4('0x24')](handleEntityNotFound(_0x3efef6,null))[_0xa4c4('0x24')](function(_0x3c3623){if(_0x3c3623){_0x20038e=_0x3c3623;_0xea949d[_0xa4c4('0x2d')]=_['keys'](db['FreshsalesConfiguration'][_0xa4c4('0x2a')]);_0xea949d[_0xa4c4('0x2e')]=_[_0xa4c4('0x2f')](_0x49307e[_0xa4c4('0x2e')]);_0xea949d[_0xa4c4('0x30')]=_[_0xa4c4('0x32')](_0xea949d[_0xa4c4('0x2d')],_0xea949d[_0xa4c4('0x2e')]);_0x26be09[_0xa4c4('0x31')]=_['intersection'](_0xea949d[_0xa4c4('0x2d')],qs[_0xa4c4('0x33')](_0x49307e[_0xa4c4('0x2e')]['fields']));_0x26be09[_0xa4c4('0x31')]=_0x26be09['attributes'][_0xa4c4('0x45')]?_0x26be09[_0xa4c4('0x31')]:_0xea949d[_0xa4c4('0x2d')];_0x26be09[_0xa4c4('0x36')]=qs['sort'](_0x49307e[_0xa4c4('0x2e')]['sort']);_0x26be09[_0xa4c4('0x38')]=qs[_0xa4c4('0x30')](_[_0xa4c4('0x39')](_0x49307e[_0xa4c4('0x2e')],_0xea949d[_0xa4c4('0x30')]));if(_0x49307e[_0xa4c4('0x2e')][_0xa4c4('0x3a')]){_0x26be09[_0xa4c4('0x38')]=_[_0xa4c4('0x3b')](_0x26be09[_0xa4c4('0x38')],{'$or':_[_0xa4c4('0x29')](_0x26be09[_0xa4c4('0x31')],function(_0x11c63e){var _0x1540e6={};_0x1540e6[_0x11c63e]={'$like':'%'+_0x49307e[_0xa4c4('0x2e')][_0xa4c4('0x3a')]+'%'};return _0x1540e6;})});}_0x26be09=_[_0xa4c4('0x3b')]({},_0x26be09,_0x49307e[_0xa4c4('0x3d')]);return _0x20038e['getConfigurations'](_0x26be09);}})[_0xa4c4('0x24')](function(_0x5efb44){if(_0x5efb44){_0x31df0e=_0x5efb44[_0xa4c4('0x45')];if(!_0x49307e[_0xa4c4('0x2e')][_0xa4c4('0x4b')](_0xa4c4('0x34'))){_0x26be09['limit']=qs[_0xa4c4('0x35')](_0x49307e['query'][_0xa4c4('0x35')]);_0x26be09[_0xa4c4('0x1d')]=qs[_0xa4c4('0x1d')](_0x49307e['query'][_0xa4c4('0x1d')]);}return _0x20038e[_0xa4c4('0x4c')](_0x26be09);}})['then'](function(_0x10abd2){if(_0x10abd2){return _0x10abd2?{'count':_0x31df0e,'rows':_0x10abd2}:null;}})[_0xa4c4('0x24')](respondWithResult(_0x3efef6,null))[_0xa4c4('0x42')](handleError(_0x3efef6,null));};exports[_0xa4c4('0x4d')]=function(_0x5a3c23,_0x5d5a68,_0x5265ed){if(_0x5a3c23[_0xa4c4('0x49')]['id']){delete _0x5a3c23['body']['id'];}return db[_0xa4c4('0x3e')][_0xa4c4('0x4e')]({'where':{'id':_0x5a3c23[_0xa4c4('0x44')]['id']}})['then'](handleEntityNotFound(_0x5d5a68,null))[_0xa4c4('0x24')](function(_0x559631){if(_0x559631){_0x5a3c23['body'][_0xa4c4('0x4f')]=_0x559631['id'];_0x5a3c23[_0xa4c4('0x49')][_0xa4c4('0x50')]=integrations[_0xa4c4('0x51')](_0x5a3c23[_0xa4c4('0x49')]['channel'],_0x5a3c23[_0xa4c4('0x49')][_0xa4c4('0x2c')]);_0x5a3c23[_0xa4c4('0x49')][_0xa4c4('0x52')]=integrations[_0xa4c4('0x53')](_0x5a3c23[_0xa4c4('0x49')][_0xa4c4('0x54')],_0x5a3c23[_0xa4c4('0x49')]['type']);return db['FreshsalesConfiguration']['create'](_0x5a3c23['body'],{'include':[{'model':db[_0xa4c4('0x55')],'as':_0xa4c4('0x50')},{'model':db[_0xa4c4('0x55')],'as':'Descriptions'}]});}return null;})[_0xa4c4('0x24')](respondWithResult(_0x5d5a68,null))[_0xa4c4('0x42')](handleError(_0x5d5a68,null));};exports[_0xa4c4('0x56')]=function(_0x5d65ba,_0x1e59c9,_0x38f280){var _0x587066='';var _0x233429='';return db['FreshsalesAccount'][_0xa4c4('0x4e')]({'where':{'id':_0x5d65ba[_0xa4c4('0x44')]['id']},'attributes':['id',_0xa4c4('0x57'),_0xa4c4('0x58'),_0xa4c4('0x59')]})[_0xa4c4('0x24')](handleEntityNotFound(_0x1e59c9,null))[_0xa4c4('0x24')](function(_0x5f3e85){if(_0x5f3e85){_0x233429=_0x5f3e85['username'];_0x587066=_0x5f3e85[_0xa4c4('0x58')];var _0x286c58=_0x5f3e85['remoteUri'][_0xa4c4('0x5a')](-0x1);if(_0x286c58==='/'){_0x587066=_0x587066[_0xa4c4('0x5b')](0x0,_0x587066[_0xa4c4('0x5c')](_0x286c58));}return rp({'method':_0xa4c4('0x5d'),'uri':util[_0xa4c4('0x5e')](_0xa4c4('0x5f'),_0x587066,'/api/selector/owners'),'headers':{'Authorization':_0xa4c4('0x60')+_0x5f3e85[_0xa4c4('0x59')]},'json':!![]});}})['then'](function(_0x3d7df5){if(_0x3d7df5){var _0x5ed5d6=_0x3d7df5['users'];var _0x228eef=![];var _0x3cd51b=null;for(_0x3cd51b=0x0;_0x3cd51b<_0x5ed5d6['length'];_0x3cd51b++){if(_0x5ed5d6[_0x3cd51b][_0xa4c4('0x61')]===_0x233429){_0x228eef=!![];}}if(_0x228eef){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xa4c4('0x62')});}}})['then'](respondWithResult(_0x1e59c9,null))[_0xa4c4('0x42')](function(_0xaf5ffd){var _0x2c0634=_0x5d65ba[_0xa4c4('0x2e')][_0xa4c4('0x63')]?0x1f4:_0xaf5ffd['statusCode']||0x1f4;logger[_0xa4c4('0x64')](_0xa4c4('0x65'),_0xa4c4('0x56'),_0x2c0634,JSON[_0xa4c4('0x66')](_0xaf5ffd));delete _0xaf5ffd[_0xa4c4('0x26')];if(_0x2c0634===0x191){_0x2c0634=0x190;}_0x1e59c9['status'](_0x2c0634)[_0xa4c4('0x27')](_0x5d65ba[_0xa4c4('0x2e')]['test']?{'message':'Wrong\x20credentials','statusCode':_0xaf5ffd['statusCode']}:_0xaf5ffd);});}; \ No newline at end of file +var _0x052b=['username','apiKey','remoteUri','slice','substring','lastIndexOf','GET','format','%s%s','users','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','request-promise','bluebird','mustache','util','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/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','apply','reject','save','update','then','destroy','error','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','nolimit','limit','where','pick','merge','VIRTUAL','filter','options','include','rows','show','params','keys','filters','includeAll','find','create','catch','body','getConfigurations','FreshsalesConfiguration','sort','hasOwnProperty','findOne','Subjects','getSubjects','channel','getDescriptions','FreshsalesField','Descriptions','getFields'];(function(_0x2904a8,_0x73180){var _0x4aae50=function(_0x491df9){while(--_0x491df9){_0x2904a8['push'](_0x2904a8['shift']());}};_0x4aae50(++_0x73180);}(_0x052b,0x1ab));var _0xb052=function(_0x138d07,_0x32371b){_0x138d07=_0x138d07-0x0;var _0x4bd240=_0x052b[_0x138d07];return _0x4bd240;};'use strict';var emlformat=require(_0xb052('0x0'));var rimraf=require(_0xb052('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb052('0x2'));var moment=require('moment');var BPromise=require(_0xb052('0x3'));var Mustache=require(_0xb052('0x4'));var util=require(_0xb052('0x5'));var path=require(_0xb052('0x6'));var sox=require('sox');var csv=require(_0xb052('0x7'));var ejs=require(_0xb052('0x8'));var fs=require('fs');var fs_extra=require(_0xb052('0x9'));var _=require('lodash');var squel=require(_0xb052('0xa'));var crypto=require(_0xb052('0xb'));var jsforce=require(_0xb052('0xc'));var deskjs=require(_0xb052('0xd'));var toCsv=require(_0xb052('0x7'));var querystring=require(_0xb052('0xe'));var Papa=require(_0xb052('0xf'));var Redis=require(_0xb052('0x10'));var authService=require(_0xb052('0x11'));var qs=require(_0xb052('0x12'));var as=require(_0xb052('0x13'));var hardwareService=require(_0xb052('0x14'));var logger=require(_0xb052('0x15'))(_0xb052('0x16'));var utils=require(_0xb052('0x17'));var config=require(_0xb052('0x18'));var licenseUtil=require(_0xb052('0x19'));var db=require(_0xb052('0x1a'))['db'];var integrations=require(_0xb052('0x1b'));function respondWithStatusCode(_0x419b9a,_0x563b79){_0x563b79=_0x563b79||0xcc;return function(_0x6112c){if(_0x6112c){return _0x419b9a[_0xb052('0x1c')](_0x563b79);}return _0x419b9a[_0xb052('0x1d')](_0x563b79)[_0xb052('0x1e')]();};}function respondWithResult(_0x2cd84c,_0x87767){_0x87767=_0x87767||0xc8;return function(_0x27f904){if(_0x27f904){return _0x2cd84c[_0xb052('0x1d')](_0x87767)[_0xb052('0x1f')](_0x27f904);}};}function respondWithFilteredResult(_0x39c2fb,_0x4e0d0d){return function(_0x150dc6){if(_0x150dc6){var _0xf07266=typeof _0x4e0d0d[_0xb052('0x20')]===_0xb052('0x21')&&typeof _0x4e0d0d['limit']===_0xb052('0x21');var _0x3fac4c=_0x150dc6[_0xb052('0x22')];var _0x10dba8=_0xf07266?0x0:_0x4e0d0d[_0xb052('0x20')];var _0x45d257=_0xf07266?_0x150dc6[_0xb052('0x22')]:_0x4e0d0d[_0xb052('0x20')]+_0x4e0d0d['limit'];var _0x1f9932;if(_0x45d257>=_0x3fac4c){_0x45d257=_0x3fac4c;_0x1f9932=0xc8;}else{_0x1f9932=0xce;}_0x39c2fb[_0xb052('0x1d')](_0x1f9932);return _0x39c2fb['set']('Content-Range',_0x10dba8+'-'+_0x45d257+'/'+_0x3fac4c)[_0xb052('0x1f')](_0x150dc6);}return null;};}function patchUpdates(_0x15e3d6){return function(_0x59c2b0){try{jsonpatch[_0xb052('0x23')](_0x59c2b0,_0x15e3d6,!![]);}catch(_0x417d78){return BPromise[_0xb052('0x24')](_0x417d78);}return _0x59c2b0[_0xb052('0x25')]();};}function saveUpdates(_0x893c0,_0x3fe1d7){return function(_0x41179f){if(_0x41179f){return _0x41179f[_0xb052('0x26')](_0x893c0)[_0xb052('0x27')](function(_0x90a34){return _0x90a34;});}return null;};}function removeEntity(_0x2d7696,_0xc40ca0){return function(_0x595b09){if(_0x595b09){return _0x595b09[_0xb052('0x28')]()[_0xb052('0x27')](function(){_0x2d7696[_0xb052('0x1d')](0xcc)[_0xb052('0x1e')]();});}};}function handleEntityNotFound(_0x1bcf5a,_0x22872b){return function(_0x57c5ae){if(!_0x57c5ae){_0x1bcf5a['sendStatus'](0x194);}return _0x57c5ae;};}function handleError(_0x17b5d6,_0x497cf8){_0x497cf8=_0x497cf8||0x1f4;return function(_0x218720){logger[_0xb052('0x29')](_0x218720['stack']);if(_0x218720[_0xb052('0x2a')]){delete _0x218720['name'];}_0x17b5d6[_0xb052('0x1d')](_0x497cf8)[_0xb052('0x2b')](_0x218720);};}exports[_0xb052('0x2c')]=function(_0x1059c2,_0x5989ce){var _0x2306a3={},_0x532ffb={},_0x358452={'count':0x0,'rows':[]};var _0x38e6cd=_[_0xb052('0x2d')](db[_0xb052('0x2e')][_0xb052('0x2f')],function(_0x3da85d){return{'name':_0x3da85d[_0xb052('0x30')],'type':_0x3da85d[_0xb052('0x31')][_0xb052('0x32')]};});_0x532ffb[_0xb052('0x33')]=_[_0xb052('0x2d')](_0x38e6cd,_0xb052('0x2a'));_0x532ffb['query']=_['keys'](_0x1059c2[_0xb052('0x34')]);_0x532ffb['filters']=_['intersection'](_0x532ffb[_0xb052('0x33')],_0x532ffb[_0xb052('0x34')]);_0x2306a3['attributes']=_[_0xb052('0x35')](_0x532ffb[_0xb052('0x33')],qs[_0xb052('0x36')](_0x1059c2[_0xb052('0x34')][_0xb052('0x36')]));_0x2306a3[_0xb052('0x37')]=_0x2306a3[_0xb052('0x37')][_0xb052('0x38')]?_0x2306a3['attributes']:_0x532ffb['model'];if(!_0x1059c2['query']['hasOwnProperty'](_0xb052('0x39'))){_0x2306a3['limit']=qs[_0xb052('0x3a')](_0x1059c2[_0xb052('0x34')][_0xb052('0x3a')]);_0x2306a3['offset']=qs[_0xb052('0x20')](_0x1059c2[_0xb052('0x34')][_0xb052('0x20')]);}_0x2306a3['order']=qs['sort'](_0x1059c2[_0xb052('0x34')]['sort']);_0x2306a3[_0xb052('0x3b')]=qs['filters'](_[_0xb052('0x3c')](_0x1059c2[_0xb052('0x34')],_0x532ffb['filters']),_0x38e6cd);if(_0x1059c2[_0xb052('0x34')]['filter']){_0x2306a3[_0xb052('0x3b')]=_[_0xb052('0x3d')](_0x2306a3['where'],{'$or':_['map'](_0x38e6cd,function(_0x3bda33){if(_0x3bda33[_0xb052('0x31')]!==_0xb052('0x3e')){var _0x2a9198={};_0x2a9198[_0x3bda33['name']]={'$like':'%'+_0x1059c2[_0xb052('0x34')][_0xb052('0x3f')]+'%'};return _0x2a9198;}})});}_0x2306a3=_[_0xb052('0x3d')]({},_0x2306a3,_0x1059c2[_0xb052('0x40')]);var _0x5c0c67={'where':_0x2306a3[_0xb052('0x3b')]};return db[_0xb052('0x2e')][_0xb052('0x22')](_0x5c0c67)[_0xb052('0x27')](function(_0x2f99dc){_0x358452[_0xb052('0x22')]=_0x2f99dc;if(_0x1059c2[_0xb052('0x34')]['includeAll']){_0x2306a3[_0xb052('0x41')]=[{'all':!![]}];}return db[_0xb052('0x2e')]['findAll'](_0x2306a3);})[_0xb052('0x27')](function(_0x29528e){_0x358452[_0xb052('0x42')]=_0x29528e;return _0x358452;})[_0xb052('0x27')](respondWithFilteredResult(_0x5989ce,_0x2306a3))['catch'](handleError(_0x5989ce,null));};exports[_0xb052('0x43')]=function(_0x4e8583,_0x74db7b){var _0x30c4f0={'raw':![],'where':{'id':_0x4e8583[_0xb052('0x44')]['id']}},_0xfe8e0b={};_0xfe8e0b[_0xb052('0x33')]=_[_0xb052('0x45')](db[_0xb052('0x2e')]['rawAttributes']);_0xfe8e0b['query']=_[_0xb052('0x45')](_0x4e8583[_0xb052('0x34')]);_0xfe8e0b[_0xb052('0x46')]=_[_0xb052('0x35')](_0xfe8e0b['model'],_0xfe8e0b[_0xb052('0x34')]);_0x30c4f0[_0xb052('0x37')]=_[_0xb052('0x35')](_0xfe8e0b[_0xb052('0x33')],qs[_0xb052('0x36')](_0x4e8583[_0xb052('0x34')][_0xb052('0x36')]));_0x30c4f0['attributes']=_0x30c4f0[_0xb052('0x37')][_0xb052('0x38')]?_0x30c4f0['attributes']:_0xfe8e0b[_0xb052('0x33')];if(_0x4e8583[_0xb052('0x34')][_0xb052('0x47')]){_0x30c4f0[_0xb052('0x41')]=[{'all':!![]}];}_0x30c4f0=_[_0xb052('0x3d')]({},_0x30c4f0,_0x4e8583[_0xb052('0x40')]);return db[_0xb052('0x2e')][_0xb052('0x48')](_0x30c4f0)['then'](handleEntityNotFound(_0x74db7b,null))[_0xb052('0x27')](respondWithResult(_0x74db7b,null))['catch'](handleError(_0x74db7b,null));};exports['create']=function(_0x2e7a26,_0x45353b){return db[_0xb052('0x2e')][_0xb052('0x49')](_0x2e7a26['body'],{})['then'](respondWithResult(_0x45353b,0xc9))[_0xb052('0x4a')](handleError(_0x45353b,null));};exports['update']=function(_0x33db30,_0x56ab9e){if(_0x33db30[_0xb052('0x4b')]['id']){delete _0x33db30[_0xb052('0x4b')]['id'];}return db[_0xb052('0x2e')][_0xb052('0x48')]({'where':{'id':_0x33db30[_0xb052('0x44')]['id']}})['then'](handleEntityNotFound(_0x56ab9e,null))[_0xb052('0x27')](saveUpdates(_0x33db30[_0xb052('0x4b')],null))[_0xb052('0x27')](respondWithResult(_0x56ab9e,null))[_0xb052('0x4a')](handleError(_0x56ab9e,null));};exports['destroy']=function(_0x5b6ac2,_0x4d39f9){return db[_0xb052('0x2e')][_0xb052('0x48')]({'where':{'id':_0x5b6ac2['params']['id']}})[_0xb052('0x27')](handleEntityNotFound(_0x4d39f9,null))[_0xb052('0x27')](removeEntity(_0x4d39f9,null))['catch'](handleError(_0x4d39f9,null));};exports[_0xb052('0x4c')]=function(_0x5d9e0a,_0x4718f3,_0xa25b1a){var _0x4f86ab={};var _0x600d7c={};var _0x3c5c65;var _0x3ec77e;return db[_0xb052('0x2e')]['findOne']({'where':{'id':_0x5d9e0a[_0xb052('0x44')]['id']}})[_0xb052('0x27')](handleEntityNotFound(_0x4718f3,null))['then'](function(_0xb623df){if(_0xb623df){_0x3c5c65=_0xb623df;_0x600d7c[_0xb052('0x33')]=_['keys'](db[_0xb052('0x4d')][_0xb052('0x2f')]);_0x600d7c[_0xb052('0x34')]=_[_0xb052('0x45')](_0x5d9e0a[_0xb052('0x34')]);_0x600d7c[_0xb052('0x46')]=_[_0xb052('0x35')](_0x600d7c[_0xb052('0x33')],_0x600d7c[_0xb052('0x34')]);_0x4f86ab[_0xb052('0x37')]=_['intersection'](_0x600d7c[_0xb052('0x33')],qs['fields'](_0x5d9e0a[_0xb052('0x34')]['fields']));_0x4f86ab[_0xb052('0x37')]=_0x4f86ab['attributes'][_0xb052('0x38')]?_0x4f86ab[_0xb052('0x37')]:_0x600d7c['model'];_0x4f86ab['order']=qs[_0xb052('0x4e')](_0x5d9e0a[_0xb052('0x34')][_0xb052('0x4e')]);_0x4f86ab[_0xb052('0x3b')]=qs[_0xb052('0x46')](_[_0xb052('0x3c')](_0x5d9e0a[_0xb052('0x34')],_0x600d7c['filters']));if(_0x5d9e0a[_0xb052('0x34')]['filter']){_0x4f86ab[_0xb052('0x3b')]=_[_0xb052('0x3d')](_0x4f86ab[_0xb052('0x3b')],{'$or':_[_0xb052('0x2d')](_0x4f86ab[_0xb052('0x37')],function(_0xa72cb8){var _0x1af636={};_0x1af636[_0xa72cb8]={'$like':'%'+_0x5d9e0a[_0xb052('0x34')][_0xb052('0x3f')]+'%'};return _0x1af636;})});}_0x4f86ab=_['merge']({},_0x4f86ab,_0x5d9e0a['options']);return _0x3c5c65[_0xb052('0x4c')](_0x4f86ab);}})[_0xb052('0x27')](function(_0x31b7c6){if(_0x31b7c6){_0x3ec77e=_0x31b7c6[_0xb052('0x38')];if(!_0x5d9e0a[_0xb052('0x34')][_0xb052('0x4f')](_0xb052('0x39'))){_0x4f86ab[_0xb052('0x3a')]=qs[_0xb052('0x3a')](_0x5d9e0a['query'][_0xb052('0x3a')]);_0x4f86ab['offset']=qs['offset'](_0x5d9e0a['query'][_0xb052('0x20')]);}return _0x3c5c65[_0xb052('0x4c')](_0x4f86ab);}})[_0xb052('0x27')](function(_0x2f6eae){if(_0x2f6eae){return _0x2f6eae?{'count':_0x3ec77e,'rows':_0x2f6eae}:null;}})[_0xb052('0x27')](respondWithResult(_0x4718f3,null))['catch'](handleError(_0x4718f3,null));};exports['addConfiguration']=function(_0x23866a,_0xe97a43,_0x4046cb){if(_0x23866a['body']['id']){delete _0x23866a[_0xb052('0x4b')]['id'];}return db[_0xb052('0x2e')][_0xb052('0x50')]({'where':{'id':_0x23866a['params']['id']}})['then'](handleEntityNotFound(_0xe97a43,null))[_0xb052('0x27')](function(_0x332534){if(_0x332534){_0x23866a[_0xb052('0x4b')]['AccountId']=_0x332534['id'];_0x23866a[_0xb052('0x4b')][_0xb052('0x51')]=integrations[_0xb052('0x52')](_0x23866a[_0xb052('0x4b')][_0xb052('0x53')],_0x23866a['body'][_0xb052('0x31')]);_0x23866a['body']['Descriptions']=integrations[_0xb052('0x54')](_0x23866a[_0xb052('0x4b')]['channel'],_0x23866a[_0xb052('0x4b')][_0xb052('0x31')]);return db[_0xb052('0x4d')][_0xb052('0x49')](_0x23866a[_0xb052('0x4b')],{'include':[{'model':db[_0xb052('0x55')],'as':_0xb052('0x51')},{'model':db[_0xb052('0x55')],'as':_0xb052('0x56')}]});}return null;})[_0xb052('0x27')](respondWithResult(_0xe97a43,null))['catch'](handleError(_0xe97a43,null));};exports[_0xb052('0x57')]=function(_0x66331d,_0x889730,_0x17e856){var _0x582ace='';var _0x1d8c1f='';return db['FreshsalesAccount'][_0xb052('0x50')]({'where':{'id':_0x66331d[_0xb052('0x44')]['id']},'attributes':['id',_0xb052('0x58'),'remoteUri',_0xb052('0x59')]})['then'](handleEntityNotFound(_0x889730,null))[_0xb052('0x27')](function(_0x1c3c2b){if(_0x1c3c2b){_0x1d8c1f=_0x1c3c2b[_0xb052('0x58')];_0x582ace=_0x1c3c2b[_0xb052('0x5a')];var _0x56d674=_0x1c3c2b[_0xb052('0x5a')][_0xb052('0x5b')](-0x1);if(_0x56d674==='/'){_0x582ace=_0x582ace[_0xb052('0x5c')](0x0,_0x582ace[_0xb052('0x5d')](_0x56d674));}return rp({'method':_0xb052('0x5e'),'uri':util[_0xb052('0x5f')](_0xb052('0x60'),_0x582ace,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0x1c3c2b[_0xb052('0x59')]},'json':!![]});}})[_0xb052('0x27')](function(_0x510134){if(_0x510134){var _0x557b97=_0x510134[_0xb052('0x61')];var _0x4a03c1=![];var _0x437ca7=null;for(_0x437ca7=0x0;_0x437ca7<_0x557b97[_0xb052('0x38')];_0x437ca7++){if(_0x557b97[_0x437ca7]['email']===_0x1d8c1f){_0x4a03c1=!![];}}if(_0x4a03c1){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xb052('0x27')](respondWithResult(_0x889730,null))[_0xb052('0x4a')](function(_0x56a6c4){var _0x5c7bd7=_0x66331d['query'][_0xb052('0x62')]?0x1f4:_0x56a6c4[_0xb052('0x63')]||0x1f4;logger[_0xb052('0x29')](_0xb052('0x64'),_0xb052('0x57'),_0x5c7bd7,JSON[_0xb052('0x65')](_0x56a6c4));delete _0x56a6c4[_0xb052('0x2a')];if(_0x5c7bd7===0x191){_0x5c7bd7=0x190;}_0x889730[_0xb052('0x1d')](_0x5c7bd7)[_0xb052('0x2b')](_0x66331d[_0xb052('0x34')][_0xb052('0x62')]?{'message':_0xb052('0x66'),'statusCode':_0x56a6c4[_0xb052('0x63')]}:_0x56a6c4);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 2fead49..c1e0ce5 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 _0x4bd3=['define','int_freshsales_accounts','lodash','../../config/logger','api','path','rimraf','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x4bd3,0x174));var _0x34bd=function(_0x516c29,_0x2360a9){_0x516c29=_0x516c29-0x0;var _0x4969c7=_0x4bd3[_0x516c29];return _0x4969c7;};'use strict';var _=require(_0x34bd('0x0'));var util=require('util');var logger=require(_0x34bd('0x1'))(_0x34bd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x34bd('0x3'));var rimraf=require(_0x34bd('0x4'));var config=require(_0x34bd('0x5'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x34bd('0x6'));module[_0x34bd('0x7')]=function(_0x5c2a7a,_0x3e8744){return _0x5c2a7a[_0x34bd('0x8')]('FreshsalesAccount',attributes,{'tableName':_0x34bd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5430=['../../components/integrations/configuration','exports','define','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird','rimraf'];(function(_0x263f9d,_0x3d854e){var _0x4c4efa=function(_0x48d506){while(--_0x48d506){_0x263f9d['push'](_0x263f9d['shift']());}};_0x4c4efa(++_0x3d854e);}(_0x5430,0x10c));var _0x0543=function(_0x4a5362,_0x40727f){_0x4a5362=_0x4a5362-0x0;var _0x536f67=_0x5430[_0x4a5362];return _0x536f67;};'use strict';var _=require(_0x0543('0x0'));var util=require(_0x0543('0x1'));var logger=require(_0x0543('0x2'))(_0x0543('0x3'));var moment=require(_0x0543('0x4'));var BPromise=require(_0x0543('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0543('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x0543('0x7'));module[_0x0543('0x8')]=function(_0x9754ba,_0x319568){return _0x9754ba[_0x0543('0x9')]('FreshsalesAccount',attributes,{'tableName':_0x0543('0xa'),'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 fa4041c..ce53293 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 _0x4bd3=['where','attributes','limit','include','model','map','stringify','find','ShowFreshsalesAccount','lodash','moment','bluebird','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x4bd3,0x174));var _0x34bd=function(_0x533606,_0x34961a){_0x533606=_0x533606-0x0;var _0x3467a5=_0x4bd3[_0x533606];return _0x3467a5;};'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')]('FreshsalesAccount,\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']('FreshsalesAccount,\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')]('GetFreshsalesAccount',_0x4500c8[_0x34bd('0x10')],_0x3b4bf8);_0x48d2ba(_0x72b197[_0x34bd('0xe')](0x1f4,_0x4500c8['message']));});});};exports['ShowFreshsalesAccount']=function(_0x38bdba){var _0xca9897=this;return new Promise(function(_0xd176f7,_0x536b2c){return db['FreshsalesAccount'][_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')]('ShowFreshsalesAccount',_0x38bdba);logger['debug']('ShowFreshsalesAccount',_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 _0x7278=['stringify','error','code','message','result','catch','GetFreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','ShowFreshsalesAccount','FreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s'];(function(_0x56a0e8,_0x4e35b6){var _0x264de3=function(_0x455505){while(--_0x455505){_0x56a0e8['push'](_0x56a0e8['shift']());}};_0x264de3(++_0x4e35b6);}(_0x7278,0x161));var _0x8727=function(_0x236e7f,_0x4491d4){_0x236e7f=_0x236e7f-0x0;var _0x55dc93=_0x7278[_0x236e7f];return _0x55dc93;};'use strict';var _=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var moment=require(_0x8727('0x2'));var BPromise=require(_0x8727('0x3'));var rs=require(_0x8727('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8727('0x5'))['db'];var utils=require(_0x8727('0x6'));var logger=require(_0x8727('0x7'))(_0x8727('0x8'));var config=require(_0x8727('0x9'));var jayson=require(_0x8727('0xa'));var client=jayson[_0x8727('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfd1902,_0x2f491c,_0xffd783){return new BPromise(function(_0x435911,_0x4160c3){return client['request'](_0xfd1902,_0xffd783)['then'](function(_0x4df6f8){logger[_0x8727('0xc')](_0x8727('0xd'),_0x2f491c,_0x8727('0xe'));logger[_0x8727('0xf')](_0x8727('0x10'),_0x2f491c,_0x8727('0xe'),JSON[_0x8727('0x11')](_0x4df6f8));if(_0x4df6f8[_0x8727('0x12')]){if(_0x4df6f8['error'][_0x8727('0x13')]===0x1f4){logger[_0x8727('0x12')](_0x8727('0xd'),_0x2f491c,_0x4df6f8['error'][_0x8727('0x14')]);return _0x4160c3(_0x4df6f8[_0x8727('0x12')]['message']);}logger[_0x8727('0x12')](_0x8727('0xd'),_0x2f491c,_0x4df6f8[_0x8727('0x12')][_0x8727('0x14')]);return _0x435911(_0x4df6f8[_0x8727('0x12')][_0x8727('0x14')]);}else{logger[_0x8727('0xc')](_0x8727('0xd'),_0x2f491c,_0x8727('0xe'));_0x435911(_0x4df6f8[_0x8727('0x15')]['message']);}})[_0x8727('0x16')](function(_0x1f9538){logger[_0x8727('0x12')](_0x8727('0xd'),_0x2f491c,_0x1f9538);_0x4160c3(_0x1f9538);});});}exports[_0x8727('0x17')]=function(_0xba0af5){var _0x533e6d=this;return new Promise(function(_0x575d29,_0x1a90ed){return db['FreshsalesAccount'][_0x8727('0x18')]({'raw':_0xba0af5[_0x8727('0x19')]?_0xba0af5[_0x8727('0x19')][_0x8727('0x1a')]===undefined?!![]:![]:!![],'where':_0xba0af5[_0x8727('0x19')]?_0xba0af5['options'][_0x8727('0x1b')]||null:null,'attributes':_0xba0af5[_0x8727('0x19')]?_0xba0af5[_0x8727('0x19')][_0x8727('0x1c')]||null:null,'limit':_0xba0af5[_0x8727('0x19')]?_0xba0af5[_0x8727('0x19')][_0x8727('0x1d')]||null:null,'include':_0xba0af5[_0x8727('0x19')]?_0xba0af5[_0x8727('0x19')][_0x8727('0x1e')]?_[_0x8727('0x1f')](_0xba0af5[_0x8727('0x19')]['include'],function(_0x464a32){return{'model':db[_0x464a32[_0x8727('0x20')]],'as':_0x464a32['as'],'attributes':_0x464a32['attributes'],'include':_0x464a32['include']?_[_0x8727('0x1f')](_0x464a32[_0x8727('0x1e')],function(_0x15e8bf){return{'model':db[_0x15e8bf['model']],'as':_0x15e8bf['as'],'attributes':_0x15e8bf[_0x8727('0x1c')],'include':_0x15e8bf[_0x8727('0x1e')]?_[_0x8727('0x1f')](_0x15e8bf[_0x8727('0x1e')],function(_0x2c8cd5){return{'model':db[_0x2c8cd5[_0x8727('0x20')]],'as':_0x2c8cd5['as'],'attributes':_0x2c8cd5[_0x8727('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8727('0x21')](function(_0x5d03f2){logger[_0x8727('0xc')](_0x8727('0x17'),_0xba0af5);logger['debug'](_0x8727('0x17'),_0xba0af5,JSON[_0x8727('0x11')](_0x5d03f2));_0x575d29(_0x5d03f2);})[_0x8727('0x16')](function(_0x228ca9){logger[_0x8727('0x12')](_0x8727('0x17'),_0x228ca9['message'],_0xba0af5);_0x1a90ed(_0x533e6d[_0x8727('0x12')](0x1f4,_0x228ca9['message']));});});};exports[_0x8727('0x22')]=function(_0x47e9f9){var _0x44ed83=this;return new Promise(function(_0x391d60,_0x152a53){return db[_0x8727('0x23')][_0x8727('0x24')]({'raw':_0x47e9f9[_0x8727('0x19')]?_0x47e9f9[_0x8727('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x47e9f9[_0x8727('0x19')]?_0x47e9f9[_0x8727('0x19')][_0x8727('0x1b')]||null:null,'attributes':_0x47e9f9[_0x8727('0x19')]?_0x47e9f9[_0x8727('0x19')][_0x8727('0x1c')]||null:null,'include':_0x47e9f9[_0x8727('0x19')]?_0x47e9f9[_0x8727('0x19')][_0x8727('0x1e')]?_[_0x8727('0x1f')](_0x47e9f9[_0x8727('0x19')][_0x8727('0x1e')],function(_0x54bff3){return{'model':db[_0x54bff3['model']],'as':_0x54bff3['as'],'attributes':_0x54bff3[_0x8727('0x1c')],'include':_0x54bff3[_0x8727('0x1e')]?_[_0x8727('0x1f')](_0x54bff3[_0x8727('0x1e')],function(_0x52220f){return{'model':db[_0x52220f[_0x8727('0x20')]],'as':_0x52220f['as'],'attributes':_0x52220f[_0x8727('0x1c')],'include':_0x52220f[_0x8727('0x1e')]?_[_0x8727('0x1f')](_0x52220f[_0x8727('0x1e')],function(_0x5b96cc){return{'model':db[_0x5b96cc[_0x8727('0x20')]],'as':_0x5b96cc['as'],'attributes':_0x5b96cc[_0x8727('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x8727('0x21')](function(_0x1b0e88){logger[_0x8727('0xc')](_0x8727('0x22'),_0x47e9f9);logger[_0x8727('0xf')](_0x8727('0x22'),_0x47e9f9,JSON[_0x8727('0x11')](_0x1b0e88));_0x391d60(_0x1b0e88);})[_0x8727('0x16')](function(_0x396f12){logger[_0x8727('0x12')]('ShowFreshsalesAccount',_0x396f12[_0x8727('0x14')],_0x47e9f9);_0x152a53(_0x44ed83[_0x8727('0x12')](0x1f4,_0x396f12[_0x8727('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index d09b168..c27952c 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 _0x4a0b=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','post','update','delete','destroy','exports'];(function(_0x2d3de0,_0x2fe05e){var _0x159010=function(_0x483ec8){while(--_0x483ec8){_0x2d3de0['push'](_0x2d3de0['shift']());}};_0x159010(++_0x2fe05e);}(_0x4a0b,0x12b));var _0xb4a0=function(_0x26f169,_0x2d01b2){_0x26f169=_0x26f169-0x0;var _0x43aad9=_0x4a0b[_0x26f169];return _0x43aad9;};'use strict';var multer=require(_0xb4a0('0x0'));var util=require(_0xb4a0('0x1'));var path=require(_0xb4a0('0x2'));var timeout=require('connect-timeout');var express=require(_0xb4a0('0x3'));var router=express[_0xb4a0('0x4')]();var fs_extra=require(_0xb4a0('0x5'));var auth=require(_0xb4a0('0x6'));var interaction=require(_0xb4a0('0x7'));var config=require('../../config/environment');var controller=require(_0xb4a0('0x8'));router[_0xb4a0('0x9')]('/',auth[_0xb4a0('0xa')](),controller[_0xb4a0('0xb')]);router[_0xb4a0('0x9')](_0xb4a0('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xb4a0('0x9')](_0xb4a0('0xd'),auth[_0xb4a0('0xa')](),controller[_0xb4a0('0xe')]);router[_0xb4a0('0x9')](_0xb4a0('0xf'),auth[_0xb4a0('0xa')](),controller[_0xb4a0('0x10')]);router['get'](_0xb4a0('0x11'),auth['isAuthenticated'](),controller['getFields']);router[_0xb4a0('0x12')]('/',auth[_0xb4a0('0xa')](),controller['create']);router['put'](_0xb4a0('0xc'),auth[_0xb4a0('0xa')](),controller[_0xb4a0('0x13')]);router[_0xb4a0('0x14')](_0xb4a0('0xc'),auth['isAuthenticated'](),controller[_0xb4a0('0x15')]);module[_0xb4a0('0x16')]=router; \ No newline at end of file +var _0x72e8=['getSubjects','/:id/descriptions','/:id/fields','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/subjects'];(function(_0x1cd47d,_0x55bc75){var _0x29d52f=function(_0x37737a){while(--_0x37737a){_0x1cd47d['push'](_0x1cd47d['shift']());}};_0x29d52f(++_0x55bc75);}(_0x72e8,0x13c));var _0x872e=function(_0x1dc56b,_0x51a505){_0x1dc56b=_0x1dc56b-0x0;var _0x4c3d8a=_0x72e8[_0x1dc56b];return _0x4c3d8a;};'use strict';var multer=require(_0x872e('0x0'));var util=require(_0x872e('0x1'));var path=require(_0x872e('0x2'));var timeout=require(_0x872e('0x3'));var express=require(_0x872e('0x4'));var router=express[_0x872e('0x5')]();var fs_extra=require(_0x872e('0x6'));var auth=require(_0x872e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x872e('0x8'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x872e('0x9')]('/',auth[_0x872e('0xa')](),controller['index']);router[_0x872e('0x9')](_0x872e('0xb'),auth[_0x872e('0xa')](),controller[_0x872e('0xc')]);router[_0x872e('0x9')](_0x872e('0xd'),auth['isAuthenticated'](),controller[_0x872e('0xe')]);router['get'](_0x872e('0xf'),auth[_0x872e('0xa')](),controller['getDescriptions']);router[_0x872e('0x9')](_0x872e('0x10'),auth[_0x872e('0xa')](),controller['getFields']);router[_0x872e('0x11')]('/',auth[_0x872e('0xa')](),controller[_0x872e('0x12')]);router[_0x872e('0x13')](_0x872e('0xb'),auth[_0x872e('0xa')](),controller['update']);router['delete'](_0x872e('0xb'),auth[_0x872e('0xa')](),controller[_0x872e('0x14')]);module[_0x872e('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 b8ba476..d1a8e9d 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 _0xc3d2=['STRING','sequelize','exports'];(function(_0x110b16,_0x87215a){var _0x11d24c=function(_0x4f9eeb){while(--_0x4f9eeb){_0x110b16['push'](_0x110b16['shift']());}};_0x11d24c(++_0x87215a);}(_0xc3d2,0x1e4));var _0x2c3d=function(_0x3118e7,_0x9d6add){_0x3118e7=_0x3118e7-0x0;var _0x4c2b0d=_0xc3d2[_0x3118e7];return _0x4c2b0d;};'use strict';var Sequelize=require(_0x2c3d('0x0'));module[_0x2c3d('0x1')]={'name':{'type':Sequelize[_0x2c3d('0x2')]},'description':{'type':Sequelize[_0x2c3d('0x2')]}}; \ No newline at end of file +var _0x0be0=['exports'];(function(_0xcb412e,_0x25e6a2){var _0x314a24=function(_0x2e4323){while(--_0x2e4323){_0xcb412e['push'](_0xcb412e['shift']());}};_0x314a24(++_0x25e6a2);}(_0x0be0,0x143));var _0x00be=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x0be0[_0x411add];return _0x238242;};'use strict';var Sequelize=require('sequelize');module[_0x00be('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 693e82a..df1c277 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 _0x462b=['fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','FreshsalesConfiguration','includeAll','include','findAll','rows','catch','show','params','length','create','body','update','find','getSubjects','findOne','getDescriptions','FreshsalesField','getFields','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','map','rawAttributes'];(function(_0x2a4d85,_0x2a01e4){var _0x4ef061=function(_0x2d6eb0){while(--_0x2d6eb0){_0x2a4d85['push'](_0x2a4d85['shift']());}};_0x4ef061(++_0x2a01e4);}(_0x462b,0x162));var _0xb462=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x462b[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0xb462('0x0'));var rimraf=require(_0xb462('0x1'));var zipdir=require(_0xb462('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb462('0x3'));var moment=require(_0xb462('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb462('0x5'));var util=require('util');var path=require(_0xb462('0x6'));var sox=require(_0xb462('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb462('0x8'));var _=require('lodash');var squel=require(_0xb462('0x9'));var crypto=require(_0xb462('0xa'));var jsforce=require(_0xb462('0xb'));var deskjs=require(_0xb462('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb462('0xd'));var Papa=require(_0xb462('0xe'));var Redis=require('ioredis');var authService=require(_0xb462('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb462('0x10'));var hardwareService=require(_0xb462('0x11'));var logger=require(_0xb462('0x12'))('api');var utils=require(_0xb462('0x13'));var config=require(_0xb462('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb462('0x15'))['db'];function respondWithStatusCode(_0x27d34b,_0x3881db){_0x3881db=_0x3881db||0xcc;return function(_0x15ae8a){if(_0x15ae8a){return _0x27d34b[_0xb462('0x16')](_0x3881db);}return _0x27d34b[_0xb462('0x17')](_0x3881db)[_0xb462('0x18')]();};}function respondWithResult(_0xb157da,_0x45228f){_0x45228f=_0x45228f||0xc8;return function(_0x34ad1b){if(_0x34ad1b){return _0xb157da[_0xb462('0x17')](_0x45228f)['json'](_0x34ad1b);}};}function respondWithFilteredResult(_0x399f81,_0x198b30){return function(_0x3b315e){if(_0x3b315e){var _0x119bf6=typeof _0x198b30[_0xb462('0x19')]===_0xb462('0x1a')&&typeof _0x198b30[_0xb462('0x1b')]===_0xb462('0x1a');var _0x3b0f72=_0x3b315e[_0xb462('0x1c')];var _0x18b7e8=_0x119bf6?0x0:_0x198b30[_0xb462('0x19')];var _0x4fda56=_0x119bf6?_0x3b315e['count']:_0x198b30['offset']+_0x198b30[_0xb462('0x1b')];var _0x132210;if(_0x4fda56>=_0x3b0f72){_0x4fda56=_0x3b0f72;_0x132210=0xc8;}else{_0x132210=0xce;}_0x399f81[_0xb462('0x17')](_0x132210);return _0x399f81[_0xb462('0x1d')](_0xb462('0x1e'),_0x18b7e8+'-'+_0x4fda56+'/'+_0x3b0f72)['json'](_0x3b315e);}return null;};}function patchUpdates(_0x4bfe67){return function(_0x5a1d2f){try{jsonpatch[_0xb462('0x1f')](_0x5a1d2f,_0x4bfe67,!![]);}catch(_0x19f85){return BPromise['reject'](_0x19f85);}return _0x5a1d2f[_0xb462('0x20')]();};}function saveUpdates(_0x8109a9,_0x4b8e11){return function(_0x22e70f){if(_0x22e70f){return _0x22e70f['update'](_0x8109a9)[_0xb462('0x21')](function(_0x50c09a){return _0x50c09a;});}return null;};}function removeEntity(_0x1e8aa5,_0x44477e){return function(_0x4bb9c5){if(_0x4bb9c5){return _0x4bb9c5[_0xb462('0x22')]()[_0xb462('0x21')](function(){_0x1e8aa5[_0xb462('0x17')](0xcc)[_0xb462('0x18')]();});}};}function handleEntityNotFound(_0x38da2b,_0x3a7797){return function(_0x1a8fdd){if(!_0x1a8fdd){_0x38da2b[_0xb462('0x16')](0x194);}return _0x1a8fdd;};}function handleError(_0x14769b,_0x306d03){_0x306d03=_0x306d03||0x1f4;return function(_0x1ee0fd){logger[_0xb462('0x23')](_0x1ee0fd[_0xb462('0x24')]);if(_0x1ee0fd[_0xb462('0x25')]){delete _0x1ee0fd[_0xb462('0x25')];}_0x14769b[_0xb462('0x17')](_0x306d03)[_0xb462('0x26')](_0x1ee0fd);};}exports['index']=function(_0xa79fcf,_0x4b7f62){var _0x43c3b6={},_0x3a6e62={},_0x313406={'count':0x0,'rows':[]};var _0x1cecd8=_[_0xb462('0x27')](db['FreshsalesConfiguration'][_0xb462('0x28')],function(_0x8ff049){return{'name':_0x8ff049[_0xb462('0x29')],'type':_0x8ff049['type'][_0xb462('0x2a')]};});_0x3a6e62['model']=_[_0xb462('0x27')](_0x1cecd8,'name');_0x3a6e62[_0xb462('0x2b')]=_[_0xb462('0x2c')](_0xa79fcf[_0xb462('0x2b')]);_0x3a6e62[_0xb462('0x2d')]=_[_0xb462('0x2e')](_0x3a6e62[_0xb462('0x2f')],_0x3a6e62[_0xb462('0x2b')]);_0x43c3b6[_0xb462('0x30')]=_['intersection'](_0x3a6e62['model'],qs[_0xb462('0x31')](_0xa79fcf[_0xb462('0x2b')]['fields']));_0x43c3b6[_0xb462('0x30')]=_0x43c3b6[_0xb462('0x30')]['length']?_0x43c3b6[_0xb462('0x30')]:_0x3a6e62['model'];if(!_0xa79fcf[_0xb462('0x2b')][_0xb462('0x32')](_0xb462('0x33'))){_0x43c3b6[_0xb462('0x1b')]=qs['limit'](_0xa79fcf[_0xb462('0x2b')][_0xb462('0x1b')]);_0x43c3b6['offset']=qs['offset'](_0xa79fcf[_0xb462('0x2b')][_0xb462('0x19')]);}_0x43c3b6[_0xb462('0x34')]=qs[_0xb462('0x35')](_0xa79fcf['query']['sort']);_0x43c3b6[_0xb462('0x36')]=qs[_0xb462('0x2d')](_[_0xb462('0x37')](_0xa79fcf[_0xb462('0x2b')],_0x3a6e62[_0xb462('0x2d')]),_0x1cecd8);if(_0xa79fcf[_0xb462('0x2b')][_0xb462('0x38')]){_0x43c3b6['where']=_['merge'](_0x43c3b6[_0xb462('0x36')],{'$or':_[_0xb462('0x27')](_0x1cecd8,function(_0x176c23){if(_0x176c23[_0xb462('0x39')]!==_0xb462('0x3a')){var _0x49ee12={};_0x49ee12[_0x176c23[_0xb462('0x25')]]={'$like':'%'+_0xa79fcf['query'][_0xb462('0x38')]+'%'};return _0x49ee12;}})});}_0x43c3b6=_[_0xb462('0x3b')]({},_0x43c3b6,_0xa79fcf[_0xb462('0x3c')]);var _0x4a3e4c={'where':_0x43c3b6[_0xb462('0x36')]};return db[_0xb462('0x3d')][_0xb462('0x1c')](_0x4a3e4c)[_0xb462('0x21')](function(_0x3ae23d){_0x313406[_0xb462('0x1c')]=_0x3ae23d;if(_0xa79fcf['query'][_0xb462('0x3e')]){_0x43c3b6[_0xb462('0x3f')]=[{'all':!![]}];}return db[_0xb462('0x3d')][_0xb462('0x40')](_0x43c3b6);})[_0xb462('0x21')](function(_0x3873b1){_0x313406[_0xb462('0x41')]=_0x3873b1;return _0x313406;})[_0xb462('0x21')](respondWithFilteredResult(_0x4b7f62,_0x43c3b6))[_0xb462('0x42')](handleError(_0x4b7f62,null));};exports[_0xb462('0x43')]=function(_0xe89d75,_0x22f4f9){var _0x1089e1={'raw':![],'where':{'id':_0xe89d75[_0xb462('0x44')]['id']}},_0x83567c={};_0x83567c['model']=_['keys'](db['FreshsalesConfiguration'][_0xb462('0x28')]);_0x83567c[_0xb462('0x2b')]=_[_0xb462('0x2c')](_0xe89d75[_0xb462('0x2b')]);_0x83567c[_0xb462('0x2d')]=_[_0xb462('0x2e')](_0x83567c[_0xb462('0x2f')],_0x83567c[_0xb462('0x2b')]);_0x1089e1[_0xb462('0x30')]=_['intersection'](_0x83567c[_0xb462('0x2f')],qs[_0xb462('0x31')](_0xe89d75[_0xb462('0x2b')][_0xb462('0x31')]));_0x1089e1['attributes']=_0x1089e1[_0xb462('0x30')][_0xb462('0x45')]?_0x1089e1[_0xb462('0x30')]:_0x83567c[_0xb462('0x2f')];if(_0xe89d75['query']['includeAll']){_0x1089e1[_0xb462('0x3f')]=[{'all':!![]}];}_0x1089e1=_[_0xb462('0x3b')]({},_0x1089e1,_0xe89d75[_0xb462('0x3c')]);return db[_0xb462('0x3d')]['find'](_0x1089e1)['then'](handleEntityNotFound(_0x22f4f9,null))[_0xb462('0x21')](respondWithResult(_0x22f4f9,null))['catch'](handleError(_0x22f4f9,null));};exports['create']=function(_0x3c41a4,_0x181f95){return db['FreshsalesConfiguration'][_0xb462('0x46')](_0x3c41a4[_0xb462('0x47')],{})[_0xb462('0x21')](respondWithResult(_0x181f95,0xc9))['catch'](handleError(_0x181f95,null));};exports[_0xb462('0x48')]=function(_0x2cbabb,_0x16fc9e){if(_0x2cbabb[_0xb462('0x47')]['id']){delete _0x2cbabb[_0xb462('0x47')]['id'];}return db['FreshsalesConfiguration'][_0xb462('0x49')]({'where':{'id':_0x2cbabb['params']['id']}})[_0xb462('0x21')](handleEntityNotFound(_0x16fc9e,null))[_0xb462('0x21')](saveUpdates(_0x2cbabb[_0xb462('0x47')],null))[_0xb462('0x21')](respondWithResult(_0x16fc9e,null))[_0xb462('0x42')](handleError(_0x16fc9e,null));};exports[_0xb462('0x22')]=function(_0x324417,_0x44c02e){return db[_0xb462('0x3d')][_0xb462('0x49')]({'where':{'id':_0x324417[_0xb462('0x44')]['id']}})[_0xb462('0x21')](handleEntityNotFound(_0x44c02e,null))[_0xb462('0x21')](removeEntity(_0x44c02e,null))['catch'](handleError(_0x44c02e,null));};exports[_0xb462('0x4a')]=function(_0x39cb13,_0x2e3d70,_0x2d7587){var _0x506897={};var _0x3ae8af={};var _0x5eda59;var _0x2404c9;return db[_0xb462('0x3d')][_0xb462('0x4b')]({'where':{'id':_0x39cb13['params']['id']}})[_0xb462('0x21')](handleEntityNotFound(_0x2e3d70,null))['then'](function(_0x171b69){if(_0x171b69){_0x5eda59=_0x171b69;_0x3ae8af[_0xb462('0x2f')]=_[_0xb462('0x2c')](db['FreshsalesField']['rawAttributes']);_0x3ae8af[_0xb462('0x2b')]=_[_0xb462('0x2c')](_0x39cb13['query']);_0x3ae8af['filters']=_[_0xb462('0x2e')](_0x3ae8af['model'],_0x3ae8af[_0xb462('0x2b')]);_0x506897[_0xb462('0x30')]=_[_0xb462('0x2e')](_0x3ae8af[_0xb462('0x2f')],qs[_0xb462('0x31')](_0x39cb13[_0xb462('0x2b')]['fields']));_0x506897['attributes']=_0x506897['attributes'][_0xb462('0x45')]?_0x506897[_0xb462('0x30')]:_0x3ae8af[_0xb462('0x2f')];_0x506897['order']=qs[_0xb462('0x35')](_0x39cb13['query'][_0xb462('0x35')]);_0x506897[_0xb462('0x36')]=qs[_0xb462('0x2d')](_['pick'](_0x39cb13['query'],_0x3ae8af['filters']));if(_0x39cb13[_0xb462('0x2b')][_0xb462('0x38')]){_0x506897['where']=_[_0xb462('0x3b')](_0x506897['where'],{'$or':_[_0xb462('0x27')](_0x506897[_0xb462('0x30')],function(_0x265da2){var _0x410e34={};_0x410e34[_0x265da2]={'$like':'%'+_0x39cb13[_0xb462('0x2b')]['filter']+'%'};return _0x410e34;})});}_0x506897=_['merge']({},_0x506897,_0x39cb13[_0xb462('0x3c')]);return _0x5eda59[_0xb462('0x4a')](_0x506897);}})['then'](function(_0x14edef){if(_0x14edef){_0x2404c9=_0x14edef['length'];if(!_0x39cb13[_0xb462('0x2b')][_0xb462('0x32')]('nolimit')){_0x506897[_0xb462('0x1b')]=qs[_0xb462('0x1b')](_0x39cb13['query'][_0xb462('0x1b')]);_0x506897[_0xb462('0x19')]=qs['offset'](_0x39cb13[_0xb462('0x2b')][_0xb462('0x19')]);}return _0x5eda59['getSubjects'](_0x506897);}})[_0xb462('0x21')](function(_0x5b4c52){if(_0x5b4c52){return _0x5b4c52?{'count':_0x2404c9,'rows':_0x5b4c52}:null;}})[_0xb462('0x21')](respondWithResult(_0x2e3d70,null))[_0xb462('0x42')](handleError(_0x2e3d70,null));};exports[_0xb462('0x4c')]=function(_0x21e86c,_0x580989,_0x3a9f72){var _0x51b466={};var _0x4e1cb2={};var _0x559915;var _0xa3e09b;return db[_0xb462('0x3d')]['findOne']({'where':{'id':_0x21e86c['params']['id']}})[_0xb462('0x21')](handleEntityNotFound(_0x580989,null))['then'](function(_0x49e6ef){if(_0x49e6ef){_0x559915=_0x49e6ef;_0x4e1cb2[_0xb462('0x2f')]=_[_0xb462('0x2c')](db[_0xb462('0x4d')][_0xb462('0x28')]);_0x4e1cb2[_0xb462('0x2b')]=_['keys'](_0x21e86c[_0xb462('0x2b')]);_0x4e1cb2[_0xb462('0x2d')]=_['intersection'](_0x4e1cb2[_0xb462('0x2f')],_0x4e1cb2[_0xb462('0x2b')]);_0x51b466[_0xb462('0x30')]=_['intersection'](_0x4e1cb2[_0xb462('0x2f')],qs[_0xb462('0x31')](_0x21e86c[_0xb462('0x2b')][_0xb462('0x31')]));_0x51b466['attributes']=_0x51b466[_0xb462('0x30')][_0xb462('0x45')]?_0x51b466[_0xb462('0x30')]:_0x4e1cb2[_0xb462('0x2f')];_0x51b466[_0xb462('0x34')]=qs[_0xb462('0x35')](_0x21e86c[_0xb462('0x2b')][_0xb462('0x35')]);_0x51b466['where']=qs[_0xb462('0x2d')](_[_0xb462('0x37')](_0x21e86c[_0xb462('0x2b')],_0x4e1cb2['filters']));if(_0x21e86c[_0xb462('0x2b')][_0xb462('0x38')]){_0x51b466[_0xb462('0x36')]=_[_0xb462('0x3b')](_0x51b466[_0xb462('0x36')],{'$or':_[_0xb462('0x27')](_0x51b466[_0xb462('0x30')],function(_0x3a738a){var _0x42d0ec={};_0x42d0ec[_0x3a738a]={'$like':'%'+_0x21e86c[_0xb462('0x2b')]['filter']+'%'};return _0x42d0ec;})});}_0x51b466=_[_0xb462('0x3b')]({},_0x51b466,_0x21e86c[_0xb462('0x3c')]);return _0x559915[_0xb462('0x4c')](_0x51b466);}})['then'](function(_0x5a8c2b){if(_0x5a8c2b){_0xa3e09b=_0x5a8c2b[_0xb462('0x45')];if(!_0x21e86c['query']['hasOwnProperty']('nolimit')){_0x51b466[_0xb462('0x1b')]=qs[_0xb462('0x1b')](_0x21e86c[_0xb462('0x2b')][_0xb462('0x1b')]);_0x51b466[_0xb462('0x19')]=qs[_0xb462('0x19')](_0x21e86c['query']['offset']);}return _0x559915[_0xb462('0x4c')](_0x51b466);}})['then'](function(_0x2fbb7f){if(_0x2fbb7f){return _0x2fbb7f?{'count':_0xa3e09b,'rows':_0x2fbb7f}:null;}})[_0xb462('0x21')](respondWithResult(_0x580989,null))['catch'](handleError(_0x580989,null));};exports[_0xb462('0x4e')]=function(_0x22e7da,_0x5bc902,_0x423eb6){var _0x12898f={};var _0x47ff8e={};var _0x2aa549;var _0x3a11b1;return db[_0xb462('0x3d')][_0xb462('0x4b')]({'where':{'id':_0x22e7da['params']['id']}})[_0xb462('0x21')](handleEntityNotFound(_0x5bc902,null))[_0xb462('0x21')](function(_0x189549){if(_0x189549){_0x2aa549=_0x189549;_0x47ff8e[_0xb462('0x2f')]=_[_0xb462('0x2c')](db['FreshsalesField'][_0xb462('0x28')]);_0x47ff8e[_0xb462('0x2b')]=_[_0xb462('0x2c')](_0x22e7da[_0xb462('0x2b')]);_0x47ff8e[_0xb462('0x2d')]=_['intersection'](_0x47ff8e[_0xb462('0x2f')],_0x47ff8e['query']);_0x12898f[_0xb462('0x30')]=_[_0xb462('0x2e')](_0x47ff8e['model'],qs[_0xb462('0x31')](_0x22e7da['query'][_0xb462('0x31')]));_0x12898f[_0xb462('0x30')]=_0x12898f[_0xb462('0x30')]['length']?_0x12898f[_0xb462('0x30')]:_0x47ff8e['model'];_0x12898f[_0xb462('0x34')]=qs[_0xb462('0x35')](_0x22e7da['query']['sort']);_0x12898f[_0xb462('0x36')]=qs[_0xb462('0x2d')](_[_0xb462('0x37')](_0x22e7da[_0xb462('0x2b')],_0x47ff8e['filters']));if(_0x22e7da[_0xb462('0x2b')]['filter']){_0x12898f[_0xb462('0x36')]=_['merge'](_0x12898f[_0xb462('0x36')],{'$or':_[_0xb462('0x27')](_0x12898f[_0xb462('0x30')],function(_0x1a4b0b){var _0x40dcb9={};_0x40dcb9[_0x1a4b0b]={'$like':'%'+_0x22e7da[_0xb462('0x2b')][_0xb462('0x38')]+'%'};return _0x40dcb9;})});}_0x12898f=_['merge']({},_0x12898f,_0x22e7da['options']);return _0x2aa549[_0xb462('0x4e')](_0x12898f);}})['then'](function(_0xcdd8ad){if(_0xcdd8ad){_0x3a11b1=_0xcdd8ad[_0xb462('0x45')];if(!_0x22e7da[_0xb462('0x2b')][_0xb462('0x32')](_0xb462('0x33'))){_0x12898f[_0xb462('0x1b')]=qs['limit'](_0x22e7da[_0xb462('0x2b')][_0xb462('0x1b')]);_0x12898f['offset']=qs[_0xb462('0x19')](_0x22e7da[_0xb462('0x2b')][_0xb462('0x19')]);}return _0x2aa549['getFields'](_0x12898f);}})[_0xb462('0x21')](function(_0x2322a3){if(_0x2322a3){return _0x2322a3?{'count':_0x3a11b1,'rows':_0x2322a3}:null;}})['then'](respondWithResult(_0x5bc902,null))['catch'](handleError(_0x5bc902,null));}; \ No newline at end of file +var _0x6cf9=['catch','getFields','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','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','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','update','destroy','then','stack','name','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','params','include','find','create','body','getSubjects','findOne','FreshsalesField','order','getDescriptions'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0x6cf9,0x192));var _0x96cf=function(_0x10bcc4,_0x4400e2){_0x10bcc4=_0x10bcc4-0x0;var _0x2da988=_0x6cf9[_0x10bcc4];return _0x2da988;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x96cf('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x96cf('0x1'));var moment=require(_0x96cf('0x2'));var BPromise=require(_0x96cf('0x3'));var Mustache=require(_0x96cf('0x4'));var util=require('util');var path=require(_0x96cf('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x96cf('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x96cf('0x7'));var squel=require(_0x96cf('0x8'));var crypto=require(_0x96cf('0x9'));var jsforce=require(_0x96cf('0xa'));var deskjs=require(_0x96cf('0xb'));var toCsv=require(_0x96cf('0xc'));var querystring=require(_0x96cf('0xd'));var Papa=require(_0x96cf('0xe'));var Redis=require(_0x96cf('0xf'));var authService=require(_0x96cf('0x10'));var qs=require(_0x96cf('0x11'));var as=require(_0x96cf('0x12'));var hardwareService=require(_0x96cf('0x13'));var logger=require(_0x96cf('0x14'))('api');var utils=require(_0x96cf('0x15'));var config=require(_0x96cf('0x16'));var licenseUtil=require(_0x96cf('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfdf161,_0x2d4a12){_0x2d4a12=_0x2d4a12||0xcc;return function(_0x30f80e){if(_0x30f80e){return _0xfdf161[_0x96cf('0x18')](_0x2d4a12);}return _0xfdf161[_0x96cf('0x19')](_0x2d4a12)[_0x96cf('0x1a')]();};}function respondWithResult(_0xd19b1,_0x402c43){_0x402c43=_0x402c43||0xc8;return function(_0x1b2d03){if(_0x1b2d03){return _0xd19b1[_0x96cf('0x19')](_0x402c43)[_0x96cf('0x1b')](_0x1b2d03);}};}function respondWithFilteredResult(_0x1ae1f2,_0x445339){return function(_0x5eb6d6){if(_0x5eb6d6){var _0x3cc4e7=typeof _0x445339['offset']===_0x96cf('0x1c')&&typeof _0x445339[_0x96cf('0x1d')]===_0x96cf('0x1c');var _0x2f827d=_0x5eb6d6['count'];var _0x59619c=_0x3cc4e7?0x0:_0x445339[_0x96cf('0x1e')];var _0x169f50=_0x3cc4e7?_0x5eb6d6['count']:_0x445339[_0x96cf('0x1e')]+_0x445339[_0x96cf('0x1d')];var _0x5431f1;if(_0x169f50>=_0x2f827d){_0x169f50=_0x2f827d;_0x5431f1=0xc8;}else{_0x5431f1=0xce;}_0x1ae1f2[_0x96cf('0x19')](_0x5431f1);return _0x1ae1f2[_0x96cf('0x1f')](_0x96cf('0x20'),_0x59619c+'-'+_0x169f50+'/'+_0x2f827d)['json'](_0x5eb6d6);}return null;};}function patchUpdates(_0x1a6c83){return function(_0x5f0e8d){try{jsonpatch[_0x96cf('0x21')](_0x5f0e8d,_0x1a6c83,!![]);}catch(_0x2a21eb){return BPromise[_0x96cf('0x22')](_0x2a21eb);}return _0x5f0e8d['save']();};}function saveUpdates(_0x38ad33,_0x6cd6a6){return function(_0x162d07){if(_0x162d07){return _0x162d07[_0x96cf('0x23')](_0x38ad33)['then'](function(_0x1cfe78){return _0x1cfe78;});}return null;};}function removeEntity(_0x596f14,_0x8f4c2a){return function(_0x212840){if(_0x212840){return _0x212840[_0x96cf('0x24')]()[_0x96cf('0x25')](function(){_0x596f14['status'](0xcc)[_0x96cf('0x1a')]();});}};}function handleEntityNotFound(_0x36866d,_0x1f084f){return function(_0x23398d){if(!_0x23398d){_0x36866d[_0x96cf('0x18')](0x194);}return _0x23398d;};}function handleError(_0x5593ce,_0x24f104){_0x24f104=_0x24f104||0x1f4;return function(_0x1489d1){logger['error'](_0x1489d1[_0x96cf('0x26')]);if(_0x1489d1[_0x96cf('0x27')]){delete _0x1489d1[_0x96cf('0x27')];}_0x5593ce[_0x96cf('0x19')](_0x24f104)['send'](_0x1489d1);};}exports[_0x96cf('0x28')]=function(_0x3ddc4a,_0x20feed){var _0x38d52b={},_0x5eeefe={},_0x117d7a={'count':0x0,'rows':[]};var _0x3a6c75=_[_0x96cf('0x29')](db[_0x96cf('0x2a')][_0x96cf('0x2b')],function(_0x2ea54f){return{'name':_0x2ea54f[_0x96cf('0x2c')],'type':_0x2ea54f[_0x96cf('0x2d')][_0x96cf('0x2e')]};});_0x5eeefe[_0x96cf('0x2f')]=_[_0x96cf('0x29')](_0x3a6c75,_0x96cf('0x27'));_0x5eeefe['query']=_[_0x96cf('0x30')](_0x3ddc4a[_0x96cf('0x31')]);_0x5eeefe[_0x96cf('0x32')]=_[_0x96cf('0x33')](_0x5eeefe['model'],_0x5eeefe['query']);_0x38d52b[_0x96cf('0x34')]=_[_0x96cf('0x33')](_0x5eeefe['model'],qs[_0x96cf('0x35')](_0x3ddc4a[_0x96cf('0x31')][_0x96cf('0x35')]));_0x38d52b['attributes']=_0x38d52b[_0x96cf('0x34')][_0x96cf('0x36')]?_0x38d52b[_0x96cf('0x34')]:_0x5eeefe[_0x96cf('0x2f')];if(!_0x3ddc4a[_0x96cf('0x31')][_0x96cf('0x37')](_0x96cf('0x38'))){_0x38d52b['limit']=qs[_0x96cf('0x1d')](_0x3ddc4a[_0x96cf('0x31')]['limit']);_0x38d52b['offset']=qs[_0x96cf('0x1e')](_0x3ddc4a[_0x96cf('0x31')][_0x96cf('0x1e')]);}_0x38d52b['order']=qs[_0x96cf('0x39')](_0x3ddc4a[_0x96cf('0x31')][_0x96cf('0x39')]);_0x38d52b[_0x96cf('0x3a')]=qs[_0x96cf('0x32')](_[_0x96cf('0x3b')](_0x3ddc4a[_0x96cf('0x31')],_0x5eeefe['filters']),_0x3a6c75);if(_0x3ddc4a[_0x96cf('0x31')][_0x96cf('0x3c')]){_0x38d52b['where']=_[_0x96cf('0x3d')](_0x38d52b[_0x96cf('0x3a')],{'$or':_[_0x96cf('0x29')](_0x3a6c75,function(_0x80661e){if(_0x80661e[_0x96cf('0x2d')]!==_0x96cf('0x3e')){var _0xcd6af2={};_0xcd6af2[_0x80661e[_0x96cf('0x27')]]={'$like':'%'+_0x3ddc4a[_0x96cf('0x31')][_0x96cf('0x3c')]+'%'};return _0xcd6af2;}})});}_0x38d52b=_[_0x96cf('0x3d')]({},_0x38d52b,_0x3ddc4a[_0x96cf('0x3f')]);var _0x5ed5cc={'where':_0x38d52b[_0x96cf('0x3a')]};return db[_0x96cf('0x2a')][_0x96cf('0x40')](_0x5ed5cc)[_0x96cf('0x25')](function(_0x184f83){_0x117d7a[_0x96cf('0x40')]=_0x184f83;if(_0x3ddc4a['query'][_0x96cf('0x41')]){_0x38d52b['include']=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x96cf('0x42')](_0x38d52b);})['then'](function(_0x1f958b){_0x117d7a[_0x96cf('0x43')]=_0x1f958b;return _0x117d7a;})[_0x96cf('0x25')](respondWithFilteredResult(_0x20feed,_0x38d52b))['catch'](handleError(_0x20feed,null));};exports['show']=function(_0x27cd0e,_0x44b82f){var _0x35c69d={'raw':![],'where':{'id':_0x27cd0e[_0x96cf('0x44')]['id']}},_0x576151={};_0x576151[_0x96cf('0x2f')]=_[_0x96cf('0x30')](db[_0x96cf('0x2a')][_0x96cf('0x2b')]);_0x576151[_0x96cf('0x31')]=_['keys'](_0x27cd0e[_0x96cf('0x31')]);_0x576151[_0x96cf('0x32')]=_[_0x96cf('0x33')](_0x576151['model'],_0x576151[_0x96cf('0x31')]);_0x35c69d[_0x96cf('0x34')]=_[_0x96cf('0x33')](_0x576151[_0x96cf('0x2f')],qs[_0x96cf('0x35')](_0x27cd0e[_0x96cf('0x31')][_0x96cf('0x35')]));_0x35c69d[_0x96cf('0x34')]=_0x35c69d[_0x96cf('0x34')][_0x96cf('0x36')]?_0x35c69d[_0x96cf('0x34')]:_0x576151[_0x96cf('0x2f')];if(_0x27cd0e['query']['includeAll']){_0x35c69d[_0x96cf('0x45')]=[{'all':!![]}];}_0x35c69d=_['merge']({},_0x35c69d,_0x27cd0e[_0x96cf('0x3f')]);return db[_0x96cf('0x2a')][_0x96cf('0x46')](_0x35c69d)[_0x96cf('0x25')](handleEntityNotFound(_0x44b82f,null))['then'](respondWithResult(_0x44b82f,null))['catch'](handleError(_0x44b82f,null));};exports[_0x96cf('0x47')]=function(_0x4e91e3,_0x534a21){return db[_0x96cf('0x2a')][_0x96cf('0x47')](_0x4e91e3['body'],{})[_0x96cf('0x25')](respondWithResult(_0x534a21,0xc9))['catch'](handleError(_0x534a21,null));};exports[_0x96cf('0x23')]=function(_0x5989c8,_0x5e3530){if(_0x5989c8[_0x96cf('0x48')]['id']){delete _0x5989c8[_0x96cf('0x48')]['id'];}return db[_0x96cf('0x2a')][_0x96cf('0x46')]({'where':{'id':_0x5989c8[_0x96cf('0x44')]['id']}})[_0x96cf('0x25')](handleEntityNotFound(_0x5e3530,null))['then'](saveUpdates(_0x5989c8[_0x96cf('0x48')],null))[_0x96cf('0x25')](respondWithResult(_0x5e3530,null))['catch'](handleError(_0x5e3530,null));};exports[_0x96cf('0x24')]=function(_0x39c8cb,_0x57a2e2){return db[_0x96cf('0x2a')][_0x96cf('0x46')]({'where':{'id':_0x39c8cb[_0x96cf('0x44')]['id']}})[_0x96cf('0x25')](handleEntityNotFound(_0x57a2e2,null))[_0x96cf('0x25')](removeEntity(_0x57a2e2,null))['catch'](handleError(_0x57a2e2,null));};exports[_0x96cf('0x49')]=function(_0x5ea11d,_0x21809f,_0x43bf45){var _0x396de4={};var _0x4fcd98={};var _0x9bccfd;var _0x2babe3;return db['FreshsalesConfiguration'][_0x96cf('0x4a')]({'where':{'id':_0x5ea11d[_0x96cf('0x44')]['id']}})['then'](handleEntityNotFound(_0x21809f,null))[_0x96cf('0x25')](function(_0x600d30){if(_0x600d30){_0x9bccfd=_0x600d30;_0x4fcd98[_0x96cf('0x2f')]=_[_0x96cf('0x30')](db[_0x96cf('0x4b')][_0x96cf('0x2b')]);_0x4fcd98['query']=_['keys'](_0x5ea11d[_0x96cf('0x31')]);_0x4fcd98[_0x96cf('0x32')]=_[_0x96cf('0x33')](_0x4fcd98[_0x96cf('0x2f')],_0x4fcd98[_0x96cf('0x31')]);_0x396de4[_0x96cf('0x34')]=_['intersection'](_0x4fcd98[_0x96cf('0x2f')],qs[_0x96cf('0x35')](_0x5ea11d[_0x96cf('0x31')]['fields']));_0x396de4[_0x96cf('0x34')]=_0x396de4[_0x96cf('0x34')][_0x96cf('0x36')]?_0x396de4['attributes']:_0x4fcd98[_0x96cf('0x2f')];_0x396de4[_0x96cf('0x4c')]=qs[_0x96cf('0x39')](_0x5ea11d[_0x96cf('0x31')][_0x96cf('0x39')]);_0x396de4[_0x96cf('0x3a')]=qs[_0x96cf('0x32')](_['pick'](_0x5ea11d[_0x96cf('0x31')],_0x4fcd98[_0x96cf('0x32')]));if(_0x5ea11d[_0x96cf('0x31')][_0x96cf('0x3c')]){_0x396de4['where']=_[_0x96cf('0x3d')](_0x396de4['where'],{'$or':_[_0x96cf('0x29')](_0x396de4[_0x96cf('0x34')],function(_0x15b5b5){var _0x160746={};_0x160746[_0x15b5b5]={'$like':'%'+_0x5ea11d['query']['filter']+'%'};return _0x160746;})});}_0x396de4=_['merge']({},_0x396de4,_0x5ea11d[_0x96cf('0x3f')]);return _0x9bccfd['getSubjects'](_0x396de4);}})[_0x96cf('0x25')](function(_0x3c1b60){if(_0x3c1b60){_0x2babe3=_0x3c1b60[_0x96cf('0x36')];if(!_0x5ea11d[_0x96cf('0x31')]['hasOwnProperty']('nolimit')){_0x396de4[_0x96cf('0x1d')]=qs[_0x96cf('0x1d')](_0x5ea11d[_0x96cf('0x31')][_0x96cf('0x1d')]);_0x396de4[_0x96cf('0x1e')]=qs['offset'](_0x5ea11d[_0x96cf('0x31')][_0x96cf('0x1e')]);}return _0x9bccfd[_0x96cf('0x49')](_0x396de4);}})[_0x96cf('0x25')](function(_0x342388){if(_0x342388){return _0x342388?{'count':_0x2babe3,'rows':_0x342388}:null;}})['then'](respondWithResult(_0x21809f,null))['catch'](handleError(_0x21809f,null));};exports[_0x96cf('0x4d')]=function(_0x131c79,_0x5f4a85,_0x49fcc4){var _0x5a7a85={};var _0x4ffc9c={};var _0x5120ea;var _0x1ab838;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x131c79[_0x96cf('0x44')]['id']}})[_0x96cf('0x25')](handleEntityNotFound(_0x5f4a85,null))[_0x96cf('0x25')](function(_0x5acd20){if(_0x5acd20){_0x5120ea=_0x5acd20;_0x4ffc9c['model']=_[_0x96cf('0x30')](db['FreshsalesField']['rawAttributes']);_0x4ffc9c['query']=_[_0x96cf('0x30')](_0x131c79[_0x96cf('0x31')]);_0x4ffc9c[_0x96cf('0x32')]=_[_0x96cf('0x33')](_0x4ffc9c['model'],_0x4ffc9c[_0x96cf('0x31')]);_0x5a7a85[_0x96cf('0x34')]=_[_0x96cf('0x33')](_0x4ffc9c[_0x96cf('0x2f')],qs[_0x96cf('0x35')](_0x131c79[_0x96cf('0x31')][_0x96cf('0x35')]));_0x5a7a85[_0x96cf('0x34')]=_0x5a7a85[_0x96cf('0x34')]['length']?_0x5a7a85[_0x96cf('0x34')]:_0x4ffc9c[_0x96cf('0x2f')];_0x5a7a85['order']=qs[_0x96cf('0x39')](_0x131c79[_0x96cf('0x31')][_0x96cf('0x39')]);_0x5a7a85[_0x96cf('0x3a')]=qs['filters'](_['pick'](_0x131c79['query'],_0x4ffc9c[_0x96cf('0x32')]));if(_0x131c79[_0x96cf('0x31')]['filter']){_0x5a7a85[_0x96cf('0x3a')]=_[_0x96cf('0x3d')](_0x5a7a85['where'],{'$or':_['map'](_0x5a7a85[_0x96cf('0x34')],function(_0x33ed89){var _0x361da7={};_0x361da7[_0x33ed89]={'$like':'%'+_0x131c79[_0x96cf('0x31')]['filter']+'%'};return _0x361da7;})});}_0x5a7a85=_[_0x96cf('0x3d')]({},_0x5a7a85,_0x131c79[_0x96cf('0x3f')]);return _0x5120ea[_0x96cf('0x4d')](_0x5a7a85);}})[_0x96cf('0x25')](function(_0x4b7b81){if(_0x4b7b81){_0x1ab838=_0x4b7b81[_0x96cf('0x36')];if(!_0x131c79[_0x96cf('0x31')]['hasOwnProperty'](_0x96cf('0x38'))){_0x5a7a85[_0x96cf('0x1d')]=qs['limit'](_0x131c79[_0x96cf('0x31')]['limit']);_0x5a7a85[_0x96cf('0x1e')]=qs[_0x96cf('0x1e')](_0x131c79[_0x96cf('0x31')][_0x96cf('0x1e')]);}return _0x5120ea[_0x96cf('0x4d')](_0x5a7a85);}})[_0x96cf('0x25')](function(_0x1ac2cb){if(_0x1ac2cb){return _0x1ac2cb?{'count':_0x1ab838,'rows':_0x1ac2cb}:null;}})[_0x96cf('0x25')](respondWithResult(_0x5f4a85,null))[_0x96cf('0x4e')](handleError(_0x5f4a85,null));};exports[_0x96cf('0x4f')]=function(_0x19ba24,_0x12a9aa,_0x420882){var _0x309139={};var _0x261d33={};var _0x4756e5;var _0x2d0cb5;return db[_0x96cf('0x2a')][_0x96cf('0x4a')]({'where':{'id':_0x19ba24['params']['id']}})[_0x96cf('0x25')](handleEntityNotFound(_0x12a9aa,null))[_0x96cf('0x25')](function(_0x490c2d){if(_0x490c2d){_0x4756e5=_0x490c2d;_0x261d33['model']=_[_0x96cf('0x30')](db[_0x96cf('0x4b')][_0x96cf('0x2b')]);_0x261d33['query']=_['keys'](_0x19ba24[_0x96cf('0x31')]);_0x261d33[_0x96cf('0x32')]=_['intersection'](_0x261d33[_0x96cf('0x2f')],_0x261d33[_0x96cf('0x31')]);_0x309139['attributes']=_[_0x96cf('0x33')](_0x261d33[_0x96cf('0x2f')],qs['fields'](_0x19ba24[_0x96cf('0x31')][_0x96cf('0x35')]));_0x309139['attributes']=_0x309139[_0x96cf('0x34')][_0x96cf('0x36')]?_0x309139[_0x96cf('0x34')]:_0x261d33[_0x96cf('0x2f')];_0x309139[_0x96cf('0x4c')]=qs['sort'](_0x19ba24['query'][_0x96cf('0x39')]);_0x309139[_0x96cf('0x3a')]=qs['filters'](_[_0x96cf('0x3b')](_0x19ba24[_0x96cf('0x31')],_0x261d33[_0x96cf('0x32')]));if(_0x19ba24[_0x96cf('0x31')][_0x96cf('0x3c')]){_0x309139[_0x96cf('0x3a')]=_['merge'](_0x309139['where'],{'$or':_[_0x96cf('0x29')](_0x309139[_0x96cf('0x34')],function(_0x4df5c8){var _0x348927={};_0x348927[_0x4df5c8]={'$like':'%'+_0x19ba24[_0x96cf('0x31')][_0x96cf('0x3c')]+'%'};return _0x348927;})});}_0x309139=_[_0x96cf('0x3d')]({},_0x309139,_0x19ba24[_0x96cf('0x3f')]);return _0x4756e5['getFields'](_0x309139);}})['then'](function(_0x374ba6){if(_0x374ba6){_0x2d0cb5=_0x374ba6['length'];if(!_0x19ba24['query']['hasOwnProperty'](_0x96cf('0x38'))){_0x309139[_0x96cf('0x1d')]=qs[_0x96cf('0x1d')](_0x19ba24[_0x96cf('0x31')]['limit']);_0x309139[_0x96cf('0x1e')]=qs[_0x96cf('0x1e')](_0x19ba24[_0x96cf('0x31')][_0x96cf('0x1e')]);}return _0x4756e5[_0x96cf('0x4f')](_0x309139);}})[_0x96cf('0x25')](function(_0x1aad8c){if(_0x1aad8c){return _0x1aad8c?{'count':_0x2d0cb5,'rows':_0x1aad8c}:null;}})[_0x96cf('0x25')](respondWithResult(_0x12a9aa,null))['catch'](handleError(_0x12a9aa,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index ea38172..d79e1e4 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 _0xc484=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','FreshsalesConfiguration','lodash','util','../../config/logger'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xc484,0xf4));var _0x4c48=function(_0x3c6a5e,_0x27f4e7){_0x3c6a5e=_0x3c6a5e-0x0;var _0x27104e=_0xc484[_0x3c6a5e];return _0x27104e;};'use strict';var _=require(_0x4c48('0x0'));var util=require(_0x4c48('0x1'));var logger=require(_0x4c48('0x2'))(_0x4c48('0x3'));var moment=require(_0x4c48('0x4'));var BPromise=require(_0x4c48('0x5'));var rp=require(_0x4c48('0x6'));var fs=require('fs');var path=require(_0x4c48('0x7'));var rimraf=require(_0x4c48('0x8'));var config=require(_0x4c48('0x9'));var attributes=require(_0x4c48('0xa'));module[_0x4c48('0xb')]=function(_0x293aec,_0x450178){return _0x293aec['define'](_0x4c48('0xc'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc235=['int_freshsales_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports','define','FreshsalesConfiguration'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xc235,0x145));var _0x5c23=function(_0x284240,_0x555b56){_0x284240=_0x284240-0x0;var _0x390667=_0xc235[_0x284240];return _0x390667;};'use strict';var _=require(_0x5c23('0x0'));var util=require(_0x5c23('0x1'));var logger=require('../../config/logger')(_0x5c23('0x2'));var moment=require(_0x5c23('0x3'));var BPromise=require(_0x5c23('0x4'));var rp=require(_0x5c23('0x5'));var fs=require('fs');var path=require(_0x5c23('0x6'));var rimraf=require(_0x5c23('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x5c23('0x8')]=function(_0x185b3a,_0x5ba033){return _0x185b3a[_0x5c23('0x9')](_0x5c23('0xa'),attributes,{'tableName':_0x5c23('0xb'),'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 0faf652..95e7755 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 _0xffdf=['http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client'];(function(_0x18ef09,_0x3ad6ad){var _0x48935b=function(_0x5a2cb4){while(--_0x5a2cb4){_0x18ef09['push'](_0x18ef09['shift']());}};_0x48935b(++_0x3ad6ad);}(_0xffdf,0xff));var _0xfffd=function(_0x42ca58,_0x423bf9){_0x42ca58=_0x42ca58-0x0;var _0x1a3a40=_0xffdf[_0x42ca58];return _0x1a3a40;};'use strict';var _=require(_0xfffd('0x0'));var util=require('util');var moment=require(_0xfffd('0x1'));var BPromise=require('bluebird');var rs=require(_0xfffd('0x2'));var fs=require('fs');var Redis=require(_0xfffd('0x3'));var db=require(_0xfffd('0x4'))['db'];var utils=require(_0xfffd('0x5'));var logger=require('../../config/logger')(_0xfffd('0x6'));var config=require('../../config/environment');var jayson=require(_0xfffd('0x7'));var client=jayson[_0xfffd('0x8')][_0xfffd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9d72ee,_0x4338f5,_0x2a0c36){return new BPromise(function(_0x30aa76,_0x5ee9a3){return client[_0xfffd('0xa')](_0x9d72ee,_0x2a0c36)[_0xfffd('0xb')](function(_0x4ffdda){logger[_0xfffd('0xc')](_0xfffd('0xd'),_0x4338f5,_0xfffd('0xe'));logger[_0xfffd('0xf')](_0xfffd('0x10'),_0x4338f5,'request\x20sent',JSON[_0xfffd('0x11')](_0x4ffdda));if(_0x4ffdda[_0xfffd('0x12')]){if(_0x4ffdda[_0xfffd('0x12')][_0xfffd('0x13')]===0x1f4){logger[_0xfffd('0x12')](_0xfffd('0xd'),_0x4338f5,_0x4ffdda[_0xfffd('0x12')]['message']);return _0x5ee9a3(_0x4ffdda[_0xfffd('0x12')][_0xfffd('0x14')]);}logger[_0xfffd('0x12')](_0xfffd('0xd'),_0x4338f5,_0x4ffdda['error'][_0xfffd('0x14')]);return _0x30aa76(_0x4ffdda[_0xfffd('0x12')][_0xfffd('0x14')]);}else{logger['info'](_0xfffd('0xd'),_0x4338f5,_0xfffd('0xe'));_0x30aa76(_0x4ffdda[_0xfffd('0x15')][_0xfffd('0x14')]);}})['catch'](function(_0x44e9fb){logger[_0xfffd('0x12')](_0xfffd('0xd'),_0x4338f5,_0x44e9fb);_0x5ee9a3(_0x44e9fb);});});} \ No newline at end of file +var _0x5f53=['jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment'];(function(_0x29112d,_0x4de18e){var _0x3bd2d9=function(_0x183399){while(--_0x183399){_0x29112d['push'](_0x29112d['shift']());}};_0x3bd2d9(++_0x4de18e);}(_0x5f53,0x7c));var _0x35f5=function(_0x45d6a9,_0x549ec9){_0x45d6a9=_0x45d6a9-0x0;var _0x3f42a2=_0x5f53[_0x45d6a9];return _0x3f42a2;};'use strict';var _=require(_0x35f5('0x0'));var util=require(_0x35f5('0x1'));var moment=require(_0x35f5('0x2'));var BPromise=require(_0x35f5('0x3'));var rs=require(_0x35f5('0x4'));var fs=require('fs');var Redis=require(_0x35f5('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x35f5('0x6'))('rpc');var config=require(_0x35f5('0x7'));var jayson=require(_0x35f5('0x8'));var client=jayson[_0x35f5('0x9')][_0x35f5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f5b34,_0x1e7ca2,_0x1600e8){return new BPromise(function(_0x3f0ce6,_0x1593af){return client[_0x35f5('0xb')](_0x3f5b34,_0x1600e8)[_0x35f5('0xc')](function(_0x2e53cf){logger[_0x35f5('0xd')](_0x35f5('0xe'),_0x1e7ca2,_0x35f5('0xf'));logger[_0x35f5('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x1e7ca2,_0x35f5('0xf'),JSON[_0x35f5('0x11')](_0x2e53cf));if(_0x2e53cf['error']){if(_0x2e53cf['error'][_0x35f5('0x12')]===0x1f4){logger[_0x35f5('0x13')](_0x35f5('0xe'),_0x1e7ca2,_0x2e53cf[_0x35f5('0x13')]['message']);return _0x1593af(_0x2e53cf[_0x35f5('0x13')][_0x35f5('0x14')]);}logger[_0x35f5('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1e7ca2,_0x2e53cf['error']['message']);return _0x3f0ce6(_0x2e53cf[_0x35f5('0x13')]['message']);}else{logger['info'](_0x35f5('0xe'),_0x1e7ca2,_0x35f5('0xf'));_0x3f0ce6(_0x2e53cf[_0x35f5('0x15')][_0x35f5('0x14')]);}})['catch'](function(_0x4e19ee){logger[_0x35f5('0x13')](_0x35f5('0xe'),_0x1e7ca2,_0x4e19ee);_0x1593af(_0x4e19ee);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 725d306..9808338 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 _0xf53f=['get','isAuthenticated','show','post','put','update','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller'];(function(_0x28c14f,_0x566182){var _0x2271c8=function(_0x1a3cde){while(--_0x1a3cde){_0x28c14f['push'](_0x28c14f['shift']());}};_0x2271c8(++_0x566182);}(_0xf53f,0x8d));var _0xff53=function(_0xc3f9ea,_0x2267f1){_0xc3f9ea=_0xc3f9ea-0x0;var _0x27a223=_0xf53f[_0xc3f9ea];return _0x27a223;};'use strict';var multer=require(_0xff53('0x0'));var util=require(_0xff53('0x1'));var path=require(_0xff53('0x2'));var timeout=require(_0xff53('0x3'));var express=require(_0xff53('0x4'));var router=express[_0xff53('0x5')]();var fs_extra=require(_0xff53('0x6'));var auth=require(_0xff53('0x7'));var interaction=require(_0xff53('0x8'));var config=require(_0xff53('0x9'));var controller=require(_0xff53('0xa'));router[_0xff53('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0xff53('0xb')]('/:id',auth[_0xff53('0xc')](),controller[_0xff53('0xd')]);router[_0xff53('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xff53('0xf')]('/:id',auth[_0xff53('0xc')](),controller[_0xff53('0x10')]);router['delete'](_0xff53('0x11'),auth[_0xff53('0xc')](),controller['destroy']);module[_0xff53('0x12')]=router; \ No newline at end of file +var _0xe5b3=['update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','index','isAuthenticated','show','post','/:id'];(function(_0x221b8c,_0x2c7afc){var _0x3fab9f=function(_0x28bab0){while(--_0x28bab0){_0x221b8c['push'](_0x221b8c['shift']());}};_0x3fab9f(++_0x2c7afc);}(_0xe5b3,0x133));var _0x3e5b=function(_0x2df56c,_0x26b29e){_0x2df56c=_0x2df56c-0x0;var _0x3ab486=_0xe5b3[_0x2df56c];return _0x3ab486;};'use strict';var multer=require('multer');var util=require(_0x3e5b('0x0'));var path=require(_0x3e5b('0x1'));var timeout=require(_0x3e5b('0x2'));var express=require(_0x3e5b('0x3'));var router=express[_0x3e5b('0x4')]();var fs_extra=require(_0x3e5b('0x5'));var auth=require(_0x3e5b('0x6'));var interaction=require(_0x3e5b('0x7'));var config=require(_0x3e5b('0x8'));var controller=require(_0x3e5b('0x9'));router[_0x3e5b('0xa')]('/',auth['isAuthenticated'](),controller[_0x3e5b('0xb')]);router[_0x3e5b('0xa')]('/:id',auth[_0x3e5b('0xc')](),controller[_0x3e5b('0xd')]);router[_0x3e5b('0xe')]('/',auth[_0x3e5b('0xc')](),controller['create']);router['put'](_0x3e5b('0xf'),auth[_0x3e5b('0xc')](),controller[_0x3e5b('0x10')]);router[_0x3e5b('0x11')](_0x3e5b('0xf'),auth['isAuthenticated'](),controller[_0x3e5b('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 13ee627..4d2efb0 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 _0xb55a=['keyValue','picklist','string','STRING','ENUM','BOOLEAN','sequelize','exports','variable','customVariable'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0xb55a,0x10a));var _0xab55=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xb55a[_0x4792c8];return _0x35edb1;};'use strict';var Sequelize=require(_0xab55('0x0'));module[_0xab55('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xab55('0x2'),_0xab55('0x3'),_0xab55('0x4'),_0xab55('0x5')),'defaultValue':_0xab55('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xab55('0x7')]},'keyType':{'type':Sequelize[_0xab55('0x8')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0xab55('0x7')]},'idField':{'type':Sequelize[_0xab55('0x7')]},'nameField':{'type':Sequelize[_0xab55('0x7')]},'customField':{'type':Sequelize[_0xab55('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xab55('0x7')]}}; \ No newline at end of file +var _0x9942=['exports','ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN'];(function(_0x6dd412,_0x3b5aec){var _0x2923fd=function(_0x2642e6){while(--_0x2642e6){_0x6dd412['push'](_0x6dd412['shift']());}};_0x2923fd(++_0x3b5aec);}(_0x9942,0xfc));var _0x2994=function(_0x5e2ac7,_0x45265d){_0x5e2ac7=_0x5e2ac7-0x0;var _0x4fb946=_0x9942[_0x5e2ac7];return _0x4fb946;};'use strict';var Sequelize=require('sequelize');module[_0x2994('0x0')]={'type':{'type':Sequelize[_0x2994('0x1')](_0x2994('0x2'),_0x2994('0x3'),_0x2994('0x4'),_0x2994('0x5'),_0x2994('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2994('0x7')]},'keyType':{'type':Sequelize[_0x2994('0x1')](_0x2994('0x2'),_0x2994('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2994('0x7')]},'nameField':{'type':Sequelize[_0x2994('0x7')]},'customField':{'type':Sequelize[_0x2994('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2994('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index abab138..6aa2fdd 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 _0x257f=['limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','status','error','name','send','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','FreshsalesField','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined'];(function(_0x376b6b,_0x1f5b49){var _0x5bb40d=function(_0x512e01){while(--_0x512e01){_0x376b6b['push'](_0x376b6b['shift']());}};_0x5bb40d(++_0x1f5b49);}(_0x257f,0x1f1));var _0xf257=function(_0x29e4a8,_0x4cbdca){_0x29e4a8=_0x29e4a8-0x0;var _0x35a5c8=_0x257f[_0x29e4a8];return _0x35a5c8;};'use strict';var emlformat=require(_0xf257('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf257('0x1'));var jsonpatch=require(_0xf257('0x2'));var rp=require('request-promise');var moment=require(_0xf257('0x3'));var BPromise=require(_0xf257('0x4'));var Mustache=require(_0xf257('0x5'));var util=require(_0xf257('0x6'));var path=require(_0xf257('0x7'));var sox=require('sox');var csv=require(_0xf257('0x8'));var ejs=require(_0xf257('0x9'));var fs=require('fs');var fs_extra=require(_0xf257('0xa'));var _=require(_0xf257('0xb'));var squel=require(_0xf257('0xc'));var crypto=require(_0xf257('0xd'));var jsforce=require(_0xf257('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf257('0xf'));var Redis=require(_0xf257('0x10'));var authService=require(_0xf257('0x11'));var qs=require(_0xf257('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf257('0x13'));var logger=require('../../config/logger')(_0xf257('0x14'));var utils=require(_0xf257('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf257('0x16'));var db=require(_0xf257('0x17'))['db'];function respondWithStatusCode(_0x3d0abb,_0x3ad374){_0x3ad374=_0x3ad374||0xcc;return function(_0x48b38f){if(_0x48b38f){return _0x3d0abb[_0xf257('0x18')](_0x3ad374);}return _0x3d0abb['status'](_0x3ad374)[_0xf257('0x19')]();};}function respondWithResult(_0x57266e,_0x650af9){_0x650af9=_0x650af9||0xc8;return function(_0x536e2a){if(_0x536e2a){return _0x57266e['status'](_0x650af9)[_0xf257('0x1a')](_0x536e2a);}};}function respondWithFilteredResult(_0x1caac2,_0x373773){return function(_0x183ccf){if(_0x183ccf){var _0x15011c=typeof _0x373773['offset']===_0xf257('0x1b')&&typeof _0x373773[_0xf257('0x1c')]===_0xf257('0x1b');var _0x3d5bb9=_0x183ccf[_0xf257('0x1d')];var _0x4bea60=_0x15011c?0x0:_0x373773[_0xf257('0x1e')];var _0x3714f9=_0x15011c?_0x183ccf[_0xf257('0x1d')]:_0x373773['offset']+_0x373773['limit'];var _0x550484;if(_0x3714f9>=_0x3d5bb9){_0x3714f9=_0x3d5bb9;_0x550484=0xc8;}else{_0x550484=0xce;}_0x1caac2['status'](_0x550484);return _0x1caac2[_0xf257('0x1f')](_0xf257('0x20'),_0x4bea60+'-'+_0x3714f9+'/'+_0x3d5bb9)[_0xf257('0x1a')](_0x183ccf);}return null;};}function patchUpdates(_0x3f82c3){return function(_0xf11d43){try{jsonpatch[_0xf257('0x21')](_0xf11d43,_0x3f82c3,!![]);}catch(_0x23286f){return BPromise[_0xf257('0x22')](_0x23286f);}return _0xf11d43[_0xf257('0x23')]();};}function saveUpdates(_0x2e202a,_0x4ceadd){return function(_0x762f6e){if(_0x762f6e){return _0x762f6e[_0xf257('0x24')](_0x2e202a)[_0xf257('0x25')](function(_0x2353b0){return _0x2353b0;});}return null;};}function removeEntity(_0x32f9d1,_0x889212){return function(_0x49db41){if(_0x49db41){return _0x49db41[_0xf257('0x26')]()[_0xf257('0x25')](function(){_0x32f9d1[_0xf257('0x27')](0xcc)[_0xf257('0x19')]();});}};}function handleEntityNotFound(_0x222c1b,_0x59c1a5){return function(_0x3e1436){if(!_0x3e1436){_0x222c1b[_0xf257('0x18')](0x194);}return _0x3e1436;};}function handleError(_0x515730,_0x431288){_0x431288=_0x431288||0x1f4;return function(_0x2cfd60){logger[_0xf257('0x28')](_0x2cfd60['stack']);if(_0x2cfd60['name']){delete _0x2cfd60[_0xf257('0x29')];}_0x515730['status'](_0x431288)[_0xf257('0x2a')](_0x2cfd60);};}exports[_0xf257('0x2b')]=function(_0x280b79,_0x47a3fc){var _0x3d64f9={},_0x94c418={},_0x1828a4={'count':0x0,'rows':[]};var _0x11ac0c=_[_0xf257('0x2c')](db['FreshsalesField']['rawAttributes'],function(_0x3777f4){return{'name':_0x3777f4[_0xf257('0x2d')],'type':_0x3777f4[_0xf257('0x2e')][_0xf257('0x2f')]};});_0x94c418[_0xf257('0x30')]=_[_0xf257('0x2c')](_0x11ac0c,_0xf257('0x29'));_0x94c418['query']=_[_0xf257('0x31')](_0x280b79[_0xf257('0x32')]);_0x94c418[_0xf257('0x33')]=_[_0xf257('0x34')](_0x94c418['model'],_0x94c418[_0xf257('0x32')]);_0x3d64f9[_0xf257('0x35')]=_['intersection'](_0x94c418['model'],qs['fields'](_0x280b79[_0xf257('0x32')][_0xf257('0x36')]));_0x3d64f9[_0xf257('0x35')]=_0x3d64f9[_0xf257('0x35')][_0xf257('0x37')]?_0x3d64f9[_0xf257('0x35')]:_0x94c418[_0xf257('0x30')];if(!_0x280b79['query'][_0xf257('0x38')](_0xf257('0x39'))){_0x3d64f9[_0xf257('0x1c')]=qs['limit'](_0x280b79[_0xf257('0x32')]['limit']);_0x3d64f9[_0xf257('0x1e')]=qs[_0xf257('0x1e')](_0x280b79[_0xf257('0x32')]['offset']);}_0x3d64f9[_0xf257('0x3a')]=qs[_0xf257('0x3b')](_0x280b79[_0xf257('0x32')][_0xf257('0x3b')]);_0x3d64f9[_0xf257('0x3c')]=qs[_0xf257('0x33')](_['pick'](_0x280b79[_0xf257('0x32')],_0x94c418[_0xf257('0x33')]),_0x11ac0c);if(_0x280b79[_0xf257('0x32')][_0xf257('0x3d')]){_0x3d64f9[_0xf257('0x3c')]=_[_0xf257('0x3e')](_0x3d64f9['where'],{'$or':_[_0xf257('0x2c')](_0x11ac0c,function(_0x44c073){if(_0x44c073['type']!==_0xf257('0x3f')){var _0x55e9df={};_0x55e9df[_0x44c073[_0xf257('0x29')]]={'$like':'%'+_0x280b79[_0xf257('0x32')][_0xf257('0x3d')]+'%'};return _0x55e9df;}})});}_0x3d64f9=_[_0xf257('0x3e')]({},_0x3d64f9,_0x280b79[_0xf257('0x40')]);var _0x1dc262={'where':_0x3d64f9[_0xf257('0x3c')]};return db[_0xf257('0x41')][_0xf257('0x1d')](_0x1dc262)[_0xf257('0x25')](function(_0x179f15){_0x1828a4['count']=_0x179f15;if(_0x280b79[_0xf257('0x32')][_0xf257('0x42')]){_0x3d64f9[_0xf257('0x43')]=[{'all':!![]}];}return db[_0xf257('0x41')][_0xf257('0x44')](_0x3d64f9);})[_0xf257('0x25')](function(_0x15cac3){_0x1828a4['rows']=_0x15cac3;return _0x1828a4;})[_0xf257('0x25')](respondWithFilteredResult(_0x47a3fc,_0x3d64f9))[_0xf257('0x45')](handleError(_0x47a3fc,null));};exports[_0xf257('0x46')]=function(_0x538f6e,_0x4086b7){var _0x1dcc79={'raw':!![],'where':{'id':_0x538f6e[_0xf257('0x47')]['id']}},_0x3ac6da={};_0x3ac6da[_0xf257('0x30')]=_[_0xf257('0x31')](db[_0xf257('0x41')]['rawAttributes']);_0x3ac6da['query']=_[_0xf257('0x31')](_0x538f6e[_0xf257('0x32')]);_0x3ac6da[_0xf257('0x33')]=_[_0xf257('0x34')](_0x3ac6da[_0xf257('0x30')],_0x3ac6da[_0xf257('0x32')]);_0x1dcc79[_0xf257('0x35')]=_[_0xf257('0x34')](_0x3ac6da['model'],qs[_0xf257('0x36')](_0x538f6e[_0xf257('0x32')][_0xf257('0x36')]));_0x1dcc79[_0xf257('0x35')]=_0x1dcc79[_0xf257('0x35')][_0xf257('0x37')]?_0x1dcc79['attributes']:_0x3ac6da['model'];if(_0x538f6e[_0xf257('0x32')][_0xf257('0x42')]){_0x1dcc79['include']=[{'all':!![]}];}_0x1dcc79=_[_0xf257('0x3e')]({},_0x1dcc79,_0x538f6e['options']);return db[_0xf257('0x41')][_0xf257('0x48')](_0x1dcc79)[_0xf257('0x25')](handleEntityNotFound(_0x4086b7,null))[_0xf257('0x25')](respondWithResult(_0x4086b7,null))['catch'](handleError(_0x4086b7,null));};exports[_0xf257('0x49')]=function(_0x2de7d6,_0x3666ee){return db['FreshsalesField'][_0xf257('0x49')](_0x2de7d6[_0xf257('0x4a')],{})['then'](respondWithResult(_0x3666ee,0xc9))[_0xf257('0x45')](handleError(_0x3666ee,null));};exports[_0xf257('0x24')]=function(_0x4d558f,_0x388679){if(_0x4d558f['body']['id']){delete _0x4d558f[_0xf257('0x4a')]['id'];}return db['FreshsalesField'][_0xf257('0x48')]({'where':{'id':_0x4d558f[_0xf257('0x47')]['id']}})[_0xf257('0x25')](handleEntityNotFound(_0x388679,null))['then'](saveUpdates(_0x4d558f[_0xf257('0x4a')],null))[_0xf257('0x25')](respondWithResult(_0x388679,null))['catch'](handleError(_0x388679,null));};exports['destroy']=function(_0x558b37,_0x264a77){return db[_0xf257('0x41')][_0xf257('0x48')]({'where':{'id':_0x558b37[_0xf257('0x47')]['id']}})[_0xf257('0x25')](handleEntityNotFound(_0x264a77,null))[_0xf257('0x25')](removeEntity(_0x264a77,null))['catch'](handleError(_0x264a77,null));}; \ No newline at end of file +var _0x0204=['attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','error','stack','name','send','map','FreshsalesField','rawAttributes','fieldName','query','keys','intersection','model','fields'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x0204,0xe9));var _0x4020=function(_0xd9d5d1,_0x1eb93a){_0xd9d5d1=_0xd9d5d1-0x0;var _0x41b8c0=_0x0204[_0xd9d5d1];return _0x41b8c0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4020('0x0'));var zipdir=require(_0x4020('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4020('0x2'));var moment=require('moment');var BPromise=require(_0x4020('0x3'));var Mustache=require(_0x4020('0x4'));var util=require(_0x4020('0x5'));var path=require('path');var sox=require(_0x4020('0x6'));var csv=require(_0x4020('0x7'));var ejs=require(_0x4020('0x8'));var fs=require('fs');var fs_extra=require(_0x4020('0x9'));var _=require(_0x4020('0xa'));var squel=require(_0x4020('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4020('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4020('0xd'));var Papa=require(_0x4020('0xe'));var Redis=require('ioredis');var authService=require(_0x4020('0xf'));var qs=require(_0x4020('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4020('0x11'));var logger=require(_0x4020('0x12'))('api');var utils=require(_0x4020('0x13'));var config=require(_0x4020('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x4020('0x15'))['db'];function respondWithStatusCode(_0x3383ef,_0x4422ef){_0x4422ef=_0x4422ef||0xcc;return function(_0x21d689){if(_0x21d689){return _0x3383ef[_0x4020('0x16')](_0x4422ef);}return _0x3383ef[_0x4020('0x17')](_0x4422ef)[_0x4020('0x18')]();};}function respondWithResult(_0xe62329,_0x5c1990){_0x5c1990=_0x5c1990||0xc8;return function(_0x1f1b79){if(_0x1f1b79){return _0xe62329[_0x4020('0x17')](_0x5c1990)[_0x4020('0x19')](_0x1f1b79);}};}function respondWithFilteredResult(_0x30175a,_0x10bb22){return function(_0x11d63f){if(_0x11d63f){var _0x1482d1=typeof _0x10bb22[_0x4020('0x1a')]===_0x4020('0x1b')&&typeof _0x10bb22[_0x4020('0x1c')]===_0x4020('0x1b');var _0x25ca21=_0x11d63f[_0x4020('0x1d')];var _0x3a702c=_0x1482d1?0x0:_0x10bb22[_0x4020('0x1a')];var _0xbabf43=_0x1482d1?_0x11d63f[_0x4020('0x1d')]:_0x10bb22[_0x4020('0x1a')]+_0x10bb22['limit'];var _0x1f388c;if(_0xbabf43>=_0x25ca21){_0xbabf43=_0x25ca21;_0x1f388c=0xc8;}else{_0x1f388c=0xce;}_0x30175a[_0x4020('0x17')](_0x1f388c);return _0x30175a[_0x4020('0x1e')](_0x4020('0x1f'),_0x3a702c+'-'+_0xbabf43+'/'+_0x25ca21)[_0x4020('0x19')](_0x11d63f);}return null;};}function patchUpdates(_0x43e358){return function(_0x3851b0){try{jsonpatch['apply'](_0x3851b0,_0x43e358,!![]);}catch(_0x54b766){return BPromise['reject'](_0x54b766);}return _0x3851b0['save']();};}function saveUpdates(_0x2ad65b,_0x2706bb){return function(_0x354b83){if(_0x354b83){return _0x354b83[_0x4020('0x20')](_0x2ad65b)[_0x4020('0x21')](function(_0x2fac8b){return _0x2fac8b;});}return null;};}function removeEntity(_0x103648,_0x4db58b){return function(_0x5d8730){if(_0x5d8730){return _0x5d8730['destroy']()[_0x4020('0x21')](function(){_0x103648[_0x4020('0x17')](0xcc)[_0x4020('0x18')]();});}};}function handleEntityNotFound(_0x1ebb6f,_0x410800){return function(_0x11325a){if(!_0x11325a){_0x1ebb6f['sendStatus'](0x194);}return _0x11325a;};}function handleError(_0x45b7c1,_0x5398a8){_0x5398a8=_0x5398a8||0x1f4;return function(_0x38c13a){logger[_0x4020('0x22')](_0x38c13a[_0x4020('0x23')]);if(_0x38c13a[_0x4020('0x24')]){delete _0x38c13a[_0x4020('0x24')];}_0x45b7c1[_0x4020('0x17')](_0x5398a8)[_0x4020('0x25')](_0x38c13a);};}exports['index']=function(_0x5ba550,_0x4fc917){var _0x3638b9={},_0x5dfab4={},_0x3dc43b={'count':0x0,'rows':[]};var _0x5ce3e6=_[_0x4020('0x26')](db[_0x4020('0x27')][_0x4020('0x28')],function(_0x413671){return{'name':_0x413671[_0x4020('0x29')],'type':_0x413671['type']['key']};});_0x5dfab4['model']=_[_0x4020('0x26')](_0x5ce3e6,_0x4020('0x24'));_0x5dfab4[_0x4020('0x2a')]=_[_0x4020('0x2b')](_0x5ba550[_0x4020('0x2a')]);_0x5dfab4['filters']=_[_0x4020('0x2c')](_0x5dfab4[_0x4020('0x2d')],_0x5dfab4[_0x4020('0x2a')]);_0x3638b9['attributes']=_[_0x4020('0x2c')](_0x5dfab4[_0x4020('0x2d')],qs['fields'](_0x5ba550[_0x4020('0x2a')][_0x4020('0x2e')]));_0x3638b9[_0x4020('0x2f')]=_0x3638b9[_0x4020('0x2f')][_0x4020('0x30')]?_0x3638b9[_0x4020('0x2f')]:_0x5dfab4[_0x4020('0x2d')];if(!_0x5ba550[_0x4020('0x2a')][_0x4020('0x31')]('nolimit')){_0x3638b9[_0x4020('0x1c')]=qs[_0x4020('0x1c')](_0x5ba550[_0x4020('0x2a')][_0x4020('0x1c')]);_0x3638b9[_0x4020('0x1a')]=qs['offset'](_0x5ba550[_0x4020('0x2a')]['offset']);}_0x3638b9[_0x4020('0x32')]=qs[_0x4020('0x33')](_0x5ba550[_0x4020('0x2a')]['sort']);_0x3638b9[_0x4020('0x34')]=qs[_0x4020('0x35')](_[_0x4020('0x36')](_0x5ba550[_0x4020('0x2a')],_0x5dfab4['filters']),_0x5ce3e6);if(_0x5ba550[_0x4020('0x2a')][_0x4020('0x37')]){_0x3638b9['where']=_['merge'](_0x3638b9['where'],{'$or':_[_0x4020('0x26')](_0x5ce3e6,function(_0x1bc95a){if(_0x1bc95a[_0x4020('0x38')]!==_0x4020('0x39')){var _0x24da8c={};_0x24da8c[_0x1bc95a[_0x4020('0x24')]]={'$like':'%'+_0x5ba550[_0x4020('0x2a')][_0x4020('0x37')]+'%'};return _0x24da8c;}})});}_0x3638b9=_['merge']({},_0x3638b9,_0x5ba550[_0x4020('0x3a')]);var _0x2bb983={'where':_0x3638b9[_0x4020('0x34')]};return db[_0x4020('0x27')][_0x4020('0x1d')](_0x2bb983)[_0x4020('0x21')](function(_0x20e997){_0x3dc43b[_0x4020('0x1d')]=_0x20e997;if(_0x5ba550[_0x4020('0x2a')][_0x4020('0x3b')]){_0x3638b9[_0x4020('0x3c')]=[{'all':!![]}];}return db['FreshsalesField'][_0x4020('0x3d')](_0x3638b9);})['then'](function(_0x5b933b){_0x3dc43b[_0x4020('0x3e')]=_0x5b933b;return _0x3dc43b;})['then'](respondWithFilteredResult(_0x4fc917,_0x3638b9))[_0x4020('0x3f')](handleError(_0x4fc917,null));};exports[_0x4020('0x40')]=function(_0x4d96cb,_0x3b3eb0){var _0x26659f={'raw':!![],'where':{'id':_0x4d96cb[_0x4020('0x41')]['id']}},_0x53b90b={};_0x53b90b[_0x4020('0x2d')]=_[_0x4020('0x2b')](db[_0x4020('0x27')][_0x4020('0x28')]);_0x53b90b[_0x4020('0x2a')]=_[_0x4020('0x2b')](_0x4d96cb[_0x4020('0x2a')]);_0x53b90b[_0x4020('0x35')]=_[_0x4020('0x2c')](_0x53b90b[_0x4020('0x2d')],_0x53b90b[_0x4020('0x2a')]);_0x26659f[_0x4020('0x2f')]=_['intersection'](_0x53b90b[_0x4020('0x2d')],qs[_0x4020('0x2e')](_0x4d96cb['query'][_0x4020('0x2e')]));_0x26659f[_0x4020('0x2f')]=_0x26659f['attributes']['length']?_0x26659f[_0x4020('0x2f')]:_0x53b90b[_0x4020('0x2d')];if(_0x4d96cb['query'][_0x4020('0x3b')]){_0x26659f[_0x4020('0x3c')]=[{'all':!![]}];}_0x26659f=_['merge']({},_0x26659f,_0x4d96cb[_0x4020('0x3a')]);return db['FreshsalesField'][_0x4020('0x42')](_0x26659f)[_0x4020('0x21')](handleEntityNotFound(_0x3b3eb0,null))[_0x4020('0x21')](respondWithResult(_0x3b3eb0,null))['catch'](handleError(_0x3b3eb0,null));};exports[_0x4020('0x43')]=function(_0x4710d2,_0x3dbcd6){return db[_0x4020('0x27')][_0x4020('0x43')](_0x4710d2[_0x4020('0x44')],{})[_0x4020('0x21')](respondWithResult(_0x3dbcd6,0xc9))['catch'](handleError(_0x3dbcd6,null));};exports[_0x4020('0x20')]=function(_0xb96af2,_0xe494ab){if(_0xb96af2[_0x4020('0x44')]['id']){delete _0xb96af2[_0x4020('0x44')]['id'];}return db[_0x4020('0x27')][_0x4020('0x42')]({'where':{'id':_0xb96af2[_0x4020('0x41')]['id']}})['then'](handleEntityNotFound(_0xe494ab,null))[_0x4020('0x21')](saveUpdates(_0xb96af2[_0x4020('0x44')],null))[_0x4020('0x21')](respondWithResult(_0xe494ab,null))['catch'](handleError(_0xe494ab,null));};exports[_0x4020('0x45')]=function(_0x231d1f,_0x242889){return db[_0x4020('0x27')][_0x4020('0x42')]({'where':{'id':_0x231d1f['params']['id']}})[_0x4020('0x21')](handleEntityNotFound(_0x242889,null))[_0x4020('0x21')](removeEntity(_0x242889,null))[_0x4020('0x3f')](handleError(_0x242889,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 5f429d6..6485955 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 _0x4123=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField'];(function(_0x3c70db,_0x89e4b3){var _0x47f199=function(_0x13ccb9){while(--_0x13ccb9){_0x3c70db['push'](_0x3c70db['shift']());}};_0x47f199(++_0x89e4b3);}(_0x4123,0x87));var _0x3412=function(_0x9a2f5,_0x6095ba){_0x9a2f5=_0x9a2f5-0x0;var _0x1b9757=_0x4123[_0x9a2f5];return _0x1b9757;};'use strict';var _=require(_0x3412('0x0'));var util=require(_0x3412('0x1'));var logger=require(_0x3412('0x2'))(_0x3412('0x3'));var moment=require(_0x3412('0x4'));var BPromise=require(_0x3412('0x5'));var rp=require(_0x3412('0x6'));var fs=require('fs');var path=require(_0x3412('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3412('0x8'));module[_0x3412('0x9')]=function(_0x48eb88,_0x11aa67){return _0x48eb88[_0x3412('0xa')](_0x3412('0xb'),attributes,{'tableName':_0x3412('0xc'),'paranoid':![],'indexes':[{'name':_0x3412('0xd'),'fields':[_0x3412('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8286=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','FreshsalesField','int_freshsales_fields','freshsales_unique_index','FieldId','lodash','util','../../config/logger'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x8286,0x66));var _0x6828=function(_0x53bcf2,_0x8ffd84){_0x53bcf2=_0x53bcf2-0x0;var _0x2841fc=_0x8286[_0x53bcf2];return _0x2841fc;};'use strict';var _=require(_0x6828('0x0'));var util=require(_0x6828('0x1'));var logger=require(_0x6828('0x2'))(_0x6828('0x3'));var moment=require(_0x6828('0x4'));var BPromise=require(_0x6828('0x5'));var rp=require(_0x6828('0x6'));var fs=require('fs');var path=require(_0x6828('0x7'));var rimraf=require(_0x6828('0x8'));var config=require(_0x6828('0x9'));var attributes=require(_0x6828('0xa'));module['exports']=function(_0x31c3d0,_0xe4b9bb){return _0x31c3d0['define'](_0x6828('0xb'),attributes,{'tableName':_0x6828('0xc'),'paranoid':![],'indexes':[{'name':_0x6828('0xd'),'fields':['idField',_0x6828('0xe')],'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 f7799ee..167ce96 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 _0x71ab=['http','request','then','info','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','message','FreshsalesField,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3a865d,_0x10c071){var _0x1b8411=function(_0x2b18cf){while(--_0x2b18cf){_0x3a865d['push'](_0x3a865d['shift']());}};_0x1b8411(++_0x10c071);}(_0x71ab,0x64));var _0xb71a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x71ab[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var moment=require('moment');var BPromise=require(_0xb71a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb71a('0x2'));var db=require(_0xb71a('0x3'))['db'];var utils=require(_0xb71a('0x4'));var logger=require(_0xb71a('0x5'))(_0xb71a('0x6'));var config=require(_0xb71a('0x7'));var jayson=require(_0xb71a('0x8'));var client=jayson[_0xb71a('0x9')][_0xb71a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35a84e,_0x4358ce,_0x2a4c86){return new BPromise(function(_0x43ca14,_0x471ab6){return client[_0xb71a('0xb')](_0x35a84e,_0x2a4c86)[_0xb71a('0xc')](function(_0x378c96){logger[_0xb71a('0xd')]('FreshsalesField,\x20%s,\x20%s',_0x4358ce,_0xb71a('0xe'));logger['debug'](_0xb71a('0xf'),_0x4358ce,_0xb71a('0xe'),JSON[_0xb71a('0x10')](_0x378c96));if(_0x378c96['error']){if(_0x378c96[_0xb71a('0x11')]['code']===0x1f4){logger[_0xb71a('0x11')]('FreshsalesField,\x20%s,\x20%s',_0x4358ce,_0x378c96['error'][_0xb71a('0x12')]);return _0x471ab6(_0x378c96[_0xb71a('0x11')][_0xb71a('0x12')]);}logger[_0xb71a('0x11')]('FreshsalesField,\x20%s,\x20%s',_0x4358ce,_0x378c96['error']['message']);return _0x43ca14(_0x378c96[_0xb71a('0x11')][_0xb71a('0x12')]);}else{logger[_0xb71a('0xd')](_0xb71a('0x13'),_0x4358ce,_0xb71a('0xe'));_0x43ca14(_0x378c96[_0xb71a('0x14')][_0xb71a('0x12')]);}})[_0xb71a('0x15')](function(_0x7710a8){logger['error'](_0xb71a('0x13'),_0x4358ce,_0x7710a8);_0x471ab6(_0x7710a8);});});} \ No newline at end of file +var _0x687b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x1e2080,_0x53283b){var _0x260111=function(_0x15da5e){while(--_0x15da5e){_0x1e2080['push'](_0x1e2080['shift']());}};_0x260111(++_0x53283b);}(_0x687b,0x14a));var _0xb687=function(_0x1658ad,_0x487c1f){_0x1658ad=_0x1658ad-0x0;var _0x3b1927=_0x687b[_0x1658ad];return _0x3b1927;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var moment=require(_0xb687('0x2'));var BPromise=require(_0xb687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb687('0x4'))['db'];var utils=require(_0xb687('0x5'));var logger=require(_0xb687('0x6'))(_0xb687('0x7'));var config=require(_0xb687('0x8'));var jayson=require(_0xb687('0x9'));var client=jayson[_0xb687('0xa')][_0xb687('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47ffea,_0x27b750,_0x48942b){return new BPromise(function(_0x2aea59,_0xd40346){return client['request'](_0x47ffea,_0x48942b)[_0xb687('0xc')](function(_0x21e3ab){logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));logger[_0xb687('0x10')](_0xb687('0x11'),_0x27b750,_0xb687('0xf'),JSON[_0xb687('0x12')](_0x21e3ab));if(_0x21e3ab['error']){if(_0x21e3ab[_0xb687('0x13')][_0xb687('0x14')]===0x1f4){logger[_0xb687('0x13')](_0xb687('0xe'),_0x27b750,_0x21e3ab['error']['message']);return _0xd40346(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}logger['error'](_0xb687('0xe'),_0x27b750,_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);return _0x2aea59(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}else{logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));_0x2aea59(_0x21e3ab[_0xb687('0x16')][_0xb687('0x15')]);}})[_0xb687('0x17')](function(_0x19bb29){logger['error'](_0xb687('0xe'),_0x27b750,_0x19bb29);_0xd40346(_0x19bb29);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index f19a5a7..a88806a 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(_0xefd6a8,_0x1d91b9){var _0xa18ee9=function(_0x58a933){while(--_0x58a933){_0xefd6a8['push'](_0xefd6a8['shift']());}};_0xa18ee9(++_0x1d91b9);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/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(_0x2c4910,_0x17775f){var _0x47939d=function(_0x53574d){while(--_0x53574d){_0x2c4910['push'](_0x2c4910['shift']());}};_0x47939d(++_0x17775f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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 9423d9b..196e4b8 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 _0x0c19=['sequelize','exports','STRING','username','ENUM','newTab','integrationTab'];(function(_0x4d427a,_0x24c23f){var _0x380dec=function(_0x6477be){while(--_0x6477be){_0x4d427a['push'](_0x4d427a['shift']());}};_0x380dec(++_0x24c23f);}(_0x0c19,0xf5));var _0x90c1=function(_0x2fa256,_0x12487e){_0x2fa256=_0x2fa256-0x0;var _0x408d14=_0x0c19[_0x2fa256];return _0x408d14;};'use strict';var Sequelize=require(_0x90c1('0x0'));module[_0x90c1('0x1')]={'name':{'type':Sequelize[_0x90c1('0x2')]},'description':{'type':Sequelize[_0x90c1('0x2')]},'username':{'type':Sequelize[_0x90c1('0x2')],'unique':_0x90c1('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x90c1('0x2')]},'clientId':{'type':Sequelize[_0x90c1('0x2')]},'clientSecret':{'type':Sequelize[_0x90c1('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x90c1('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x90c1('0x4')]('integrationTab',_0x90c1('0x5')),'defaultValue':_0x90c1('0x6')}}; \ No newline at end of file +var _0xbb8d=['newTab','sequelize','STRING','ENUM','integrationTab'];(function(_0x5a6eea,_0x21605e){var _0x54db97=function(_0x15e2c3){while(--_0x15e2c3){_0x5a6eea['push'](_0x5a6eea['shift']());}};_0x54db97(++_0x21605e);}(_0xbb8d,0x146));var _0xdbb8=function(_0x10fbf6,_0x16f543){_0x10fbf6=_0x10fbf6-0x0;var _0x276d11=_0xbb8d[_0x10fbf6];return _0x276d11;};'use strict';var Sequelize=require(_0xdbb8('0x0'));module['exports']={'name':{'type':Sequelize[_0xdbb8('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0xdbb8('0x1')]},'password':{'type':Sequelize[_0xdbb8('0x1')]},'clientId':{'type':Sequelize[_0xdbb8('0x1')]},'clientSecret':{'type':Sequelize[_0xdbb8('0x1')]},'securityToken':{'type':Sequelize[_0xdbb8('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xdbb8('0x2')](_0xdbb8('0x3'),_0xdbb8('0x4')),'defaultValue':_0xdbb8('0x3')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index f5eff3a..74d0df6 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 _0x255d=['params','merge','create','body','find','getConfigurations','pick','hasOwnProperty','findOne','AccountId','Descriptions','getDescriptions','channel','SalesforceField','Subjects','getFields','Task','username','password','securityToken','remoteUri','slice','substring','lastIndexOf','Connection','clientId','clientSecret','concat','isNil','ticketType','sobject','describe','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','picklist','boolean','textarea','phone','includes','label','picklistValues','value','True','true','False','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','set','apply','update','then','destroy','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','query','keys','attributes','intersection','model','fields','length','nolimit','order','sort','where','filters','filter','VIRTUAL','count','includeAll','include','findAll','rows','catch','show'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x255d,0xae));var _0xd255=function(_0x5caa69,_0x2bb84a){_0x5caa69=_0x5caa69-0x0;var _0x4d95c6=_0x255d[_0x5caa69];return _0x4d95c6;};'use strict';var emlformat=require(_0xd255('0x0'));var rimraf=require(_0xd255('0x1'));var zipdir=require(_0xd255('0x2'));var jsonpatch=require(_0xd255('0x3'));var rp=require(_0xd255('0x4'));var moment=require('moment');var BPromise=require(_0xd255('0x5'));var Mustache=require('mustache');var util=require(_0xd255('0x6'));var path=require(_0xd255('0x7'));var sox=require('sox');var csv=require(_0xd255('0x8'));var ejs=require(_0xd255('0x9'));var fs=require('fs');var fs_extra=require(_0xd255('0xa'));var _=require('lodash');var squel=require(_0xd255('0xb'));var crypto=require(_0xd255('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd255('0xd'));var toCsv=require(_0xd255('0x8'));var querystring=require(_0xd255('0xe'));var Papa=require(_0xd255('0xf'));var Redis=require(_0xd255('0x10'));var authService=require(_0xd255('0x11'));var qs=require(_0xd255('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd255('0x13'))(_0xd255('0x14'));var utils=require(_0xd255('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd255('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xd255('0x17'));function respondWithStatusCode(_0x346b19,_0x34c6d9){_0x34c6d9=_0x34c6d9||0xcc;return function(_0x244724){if(_0x244724){return _0x346b19[_0xd255('0x18')](_0x34c6d9);}return _0x346b19[_0xd255('0x19')](_0x34c6d9)[_0xd255('0x1a')]();};}function respondWithResult(_0xb66d84,_0x21683b){_0x21683b=_0x21683b||0xc8;return function(_0x4d97c0){if(_0x4d97c0){return _0xb66d84[_0xd255('0x19')](_0x21683b)[_0xd255('0x1b')](_0x4d97c0);}};}function respondWithFilteredResult(_0x12958e,_0x5b0c55){return function(_0x124efb){if(_0x124efb){var _0x6218fe=typeof _0x5b0c55[_0xd255('0x1c')]===_0xd255('0x1d')&&typeof _0x5b0c55[_0xd255('0x1e')]===_0xd255('0x1d');var _0x18daaa=_0x124efb['count'];var _0x4ab3eb=_0x6218fe?0x0:_0x5b0c55[_0xd255('0x1c')];var _0x257864=_0x6218fe?_0x124efb['count']:_0x5b0c55[_0xd255('0x1c')]+_0x5b0c55[_0xd255('0x1e')];var _0x463a12;if(_0x257864>=_0x18daaa){_0x257864=_0x18daaa;_0x463a12=0xc8;}else{_0x463a12=0xce;}_0x12958e['status'](_0x463a12);return _0x12958e[_0xd255('0x1f')]('Content-Range',_0x4ab3eb+'-'+_0x257864+'/'+_0x18daaa)[_0xd255('0x1b')](_0x124efb);}return null;};}function patchUpdates(_0x53e11d){return function(_0x3aff12){try{jsonpatch[_0xd255('0x20')](_0x3aff12,_0x53e11d,!![]);}catch(_0x269363){return BPromise['reject'](_0x269363);}return _0x3aff12['save']();};}function saveUpdates(_0x1bb37b,_0x433c2a){return function(_0xb5889e){if(_0xb5889e){return _0xb5889e[_0xd255('0x21')](_0x1bb37b)[_0xd255('0x22')](function(_0x173828){return _0x173828;});}return null;};}function removeEntity(_0x4abdb9,_0x540281){return function(_0x3a514c){if(_0x3a514c){return _0x3a514c[_0xd255('0x23')]()['then'](function(){_0x4abdb9[_0xd255('0x19')](0xcc)[_0xd255('0x1a')]();});}};}function handleEntityNotFound(_0x3df1f3,_0xd81a0b){return function(_0x31dce8){if(!_0x31dce8){_0x3df1f3[_0xd255('0x18')](0x194);}return _0x31dce8;};}function handleError(_0x5ed3d5,_0x5d57f9){_0x5d57f9=_0x5d57f9||0x1f4;return function(_0x5617da){logger[_0xd255('0x24')](_0x5617da[_0xd255('0x25')]);if(_0x5617da[_0xd255('0x26')]){delete _0x5617da[_0xd255('0x26')];}_0x5ed3d5[_0xd255('0x19')](_0x5d57f9)[_0xd255('0x27')](_0x5617da);};}exports[_0xd255('0x28')]=function(_0x16ae35,_0x1056c1){var _0x214210={},_0x13672a={},_0x20805e={'count':0x0,'rows':[]};var _0x103d24=_[_0xd255('0x29')](db[_0xd255('0x2a')][_0xd255('0x2b')],function(_0x524006){return{'name':_0x524006[_0xd255('0x2c')],'type':_0x524006[_0xd255('0x2d')][_0xd255('0x2e')]};});_0x13672a['model']=_[_0xd255('0x29')](_0x103d24,_0xd255('0x26'));_0x13672a[_0xd255('0x2f')]=_[_0xd255('0x30')](_0x16ae35['query']);_0x13672a['filters']=_['intersection'](_0x13672a['model'],_0x13672a['query']);_0x214210[_0xd255('0x31')]=_[_0xd255('0x32')](_0x13672a[_0xd255('0x33')],qs['fields'](_0x16ae35[_0xd255('0x2f')][_0xd255('0x34')]));_0x214210[_0xd255('0x31')]=_0x214210[_0xd255('0x31')][_0xd255('0x35')]?_0x214210[_0xd255('0x31')]:_0x13672a[_0xd255('0x33')];if(!_0x16ae35[_0xd255('0x2f')]['hasOwnProperty'](_0xd255('0x36'))){_0x214210[_0xd255('0x1e')]=qs[_0xd255('0x1e')](_0x16ae35[_0xd255('0x2f')][_0xd255('0x1e')]);_0x214210[_0xd255('0x1c')]=qs[_0xd255('0x1c')](_0x16ae35[_0xd255('0x2f')][_0xd255('0x1c')]);}_0x214210[_0xd255('0x37')]=qs[_0xd255('0x38')](_0x16ae35['query']['sort']);_0x214210[_0xd255('0x39')]=qs[_0xd255('0x3a')](_['pick'](_0x16ae35[_0xd255('0x2f')],_0x13672a[_0xd255('0x3a')]),_0x103d24);if(_0x16ae35[_0xd255('0x2f')][_0xd255('0x3b')]){_0x214210[_0xd255('0x39')]=_['merge'](_0x214210[_0xd255('0x39')],{'$or':_[_0xd255('0x29')](_0x103d24,function(_0x4be9fd){if(_0x4be9fd['type']!==_0xd255('0x3c')){var _0x1f3de8={};_0x1f3de8[_0x4be9fd[_0xd255('0x26')]]={'$like':'%'+_0x16ae35[_0xd255('0x2f')][_0xd255('0x3b')]+'%'};return _0x1f3de8;}})});}_0x214210=_['merge']({},_0x214210,_0x16ae35['options']);var _0x3190b9={'where':_0x214210[_0xd255('0x39')]};return db[_0xd255('0x2a')][_0xd255('0x3d')](_0x3190b9)[_0xd255('0x22')](function(_0x1bc772){_0x20805e[_0xd255('0x3d')]=_0x1bc772;if(_0x16ae35[_0xd255('0x2f')][_0xd255('0x3e')]){_0x214210[_0xd255('0x3f')]=[{'all':!![]}];}return db['SalesforceAccount'][_0xd255('0x40')](_0x214210);})[_0xd255('0x22')](function(_0x53a073){_0x20805e[_0xd255('0x41')]=_0x53a073;return _0x20805e;})[_0xd255('0x22')](respondWithFilteredResult(_0x1056c1,_0x214210))[_0xd255('0x42')](handleError(_0x1056c1,null));};exports[_0xd255('0x43')]=function(_0x33ead2,_0x4adaab){var _0x50337e={'raw':![],'where':{'id':_0x33ead2[_0xd255('0x44')]['id']}},_0x29ba9d={};_0x29ba9d[_0xd255('0x33')]=_[_0xd255('0x30')](db[_0xd255('0x2a')][_0xd255('0x2b')]);_0x29ba9d[_0xd255('0x2f')]=_[_0xd255('0x30')](_0x33ead2[_0xd255('0x2f')]);_0x29ba9d[_0xd255('0x3a')]=_[_0xd255('0x32')](_0x29ba9d['model'],_0x29ba9d[_0xd255('0x2f')]);_0x50337e['attributes']=_['intersection'](_0x29ba9d[_0xd255('0x33')],qs[_0xd255('0x34')](_0x33ead2[_0xd255('0x2f')]['fields']));_0x50337e[_0xd255('0x31')]=_0x50337e['attributes']['length']?_0x50337e['attributes']:_0x29ba9d[_0xd255('0x33')];if(_0x33ead2[_0xd255('0x2f')][_0xd255('0x3e')]){_0x50337e['include']=[{'all':!![]}];}_0x50337e=_[_0xd255('0x45')]({},_0x50337e,_0x33ead2['options']);return db[_0xd255('0x2a')]['find'](_0x50337e)[_0xd255('0x22')](handleEntityNotFound(_0x4adaab,null))[_0xd255('0x22')](respondWithResult(_0x4adaab,null))['catch'](handleError(_0x4adaab,null));};exports[_0xd255('0x46')]=function(_0x18be02,_0x55572d){return db[_0xd255('0x2a')][_0xd255('0x46')](_0x18be02[_0xd255('0x47')],{})[_0xd255('0x22')](respondWithResult(_0x55572d,0xc9))[_0xd255('0x42')](handleError(_0x55572d,null));};exports[_0xd255('0x21')]=function(_0x3279b,_0x3de2db){if(_0x3279b[_0xd255('0x47')]['id']){delete _0x3279b[_0xd255('0x47')]['id'];}return db['SalesforceAccount'][_0xd255('0x48')]({'where':{'id':_0x3279b['params']['id']}})[_0xd255('0x22')](handleEntityNotFound(_0x3de2db,null))['then'](saveUpdates(_0x3279b[_0xd255('0x47')],null))[_0xd255('0x22')](respondWithResult(_0x3de2db,null))[_0xd255('0x42')](handleError(_0x3de2db,null));};exports[_0xd255('0x23')]=function(_0x3e913f,_0x2b9b1){return db['SalesforceAccount'][_0xd255('0x48')]({'where':{'id':_0x3e913f[_0xd255('0x44')]['id']}})['then'](handleEntityNotFound(_0x2b9b1,null))['then'](removeEntity(_0x2b9b1,null))[_0xd255('0x42')](handleError(_0x2b9b1,null));};exports[_0xd255('0x49')]=function(_0x5d9e9f,_0x24ec8f,_0x45bff0){var _0x40c92d={};var _0x11e5dc={};var _0x370411;var _0x5af212;return db['SalesforceAccount']['findOne']({'where':{'id':_0x5d9e9f[_0xd255('0x44')]['id']}})[_0xd255('0x22')](handleEntityNotFound(_0x24ec8f,null))['then'](function(_0x50f7c8){if(_0x50f7c8){_0x370411=_0x50f7c8;_0x11e5dc[_0xd255('0x33')]=_[_0xd255('0x30')](db['SalesforceConfiguration'][_0xd255('0x2b')]);_0x11e5dc[_0xd255('0x2f')]=_['keys'](_0x5d9e9f['query']);_0x11e5dc['filters']=_[_0xd255('0x32')](_0x11e5dc[_0xd255('0x33')],_0x11e5dc[_0xd255('0x2f')]);_0x40c92d[_0xd255('0x31')]=_['intersection'](_0x11e5dc['model'],qs[_0xd255('0x34')](_0x5d9e9f[_0xd255('0x2f')][_0xd255('0x34')]));_0x40c92d[_0xd255('0x31')]=_0x40c92d[_0xd255('0x31')]['length']?_0x40c92d[_0xd255('0x31')]:_0x11e5dc[_0xd255('0x33')];_0x40c92d[_0xd255('0x37')]=qs[_0xd255('0x38')](_0x5d9e9f['query'][_0xd255('0x38')]);_0x40c92d[_0xd255('0x39')]=qs[_0xd255('0x3a')](_[_0xd255('0x4a')](_0x5d9e9f['query'],_0x11e5dc[_0xd255('0x3a')]));if(_0x5d9e9f[_0xd255('0x2f')][_0xd255('0x3b')]){_0x40c92d[_0xd255('0x39')]=_[_0xd255('0x45')](_0x40c92d[_0xd255('0x39')],{'$or':_[_0xd255('0x29')](_0x40c92d[_0xd255('0x31')],function(_0x5a8415){var _0x3f42be={};_0x3f42be[_0x5a8415]={'$like':'%'+_0x5d9e9f[_0xd255('0x2f')][_0xd255('0x3b')]+'%'};return _0x3f42be;})});}_0x40c92d=_['merge']({},_0x40c92d,_0x5d9e9f['options']);return _0x370411[_0xd255('0x49')](_0x40c92d);}})[_0xd255('0x22')](function(_0x219efc){if(_0x219efc){_0x5af212=_0x219efc[_0xd255('0x35')];if(!_0x5d9e9f[_0xd255('0x2f')][_0xd255('0x4b')](_0xd255('0x36'))){_0x40c92d['limit']=qs[_0xd255('0x1e')](_0x5d9e9f[_0xd255('0x2f')]['limit']);_0x40c92d['offset']=qs[_0xd255('0x1c')](_0x5d9e9f[_0xd255('0x2f')][_0xd255('0x1c')]);}return _0x370411[_0xd255('0x49')](_0x40c92d);}})[_0xd255('0x22')](function(_0x47bd79){if(_0x47bd79){return _0x47bd79?{'count':_0x5af212,'rows':_0x47bd79}:null;}})['then'](respondWithResult(_0x24ec8f,null))[_0xd255('0x42')](handleError(_0x24ec8f,null));};exports['addConfiguration']=function(_0x2be685,_0x3edbc9,_0x294981){if(_0x2be685['body']['id']){delete _0x2be685[_0xd255('0x47')]['id'];}return db[_0xd255('0x2a')][_0xd255('0x4c')]({'where':{'id':_0x2be685[_0xd255('0x44')]['id']}})[_0xd255('0x22')](handleEntityNotFound(_0x3edbc9,null))[_0xd255('0x22')](function(_0x212b16){if(_0x212b16){_0x2be685[_0xd255('0x47')][_0xd255('0x4d')]=_0x212b16['id'];_0x2be685[_0xd255('0x47')]['Subjects']=integrations['getSubjects'](_0x2be685['body']['channel'],_0x2be685[_0xd255('0x47')]['type']);_0x2be685[_0xd255('0x47')][_0xd255('0x4e')]=integrations[_0xd255('0x4f')](_0x2be685[_0xd255('0x47')][_0xd255('0x50')],_0x2be685[_0xd255('0x47')]['type']);return db['SalesforceConfiguration'][_0xd255('0x46')](_0x2be685[_0xd255('0x47')],{'include':[{'model':db[_0xd255('0x51')],'as':_0xd255('0x52')},{'model':db[_0xd255('0x51')],'as':_0xd255('0x4e')}]});}return null;})[_0xd255('0x22')](respondWithResult(_0x3edbc9,null))[_0xd255('0x42')](handleError(_0x3edbc9,null));};exports[_0xd255('0x53')]=function(_0x5e6c6d,_0xa8c191,_0x4eb70b){var _0x2cab79;var _0x4dcc39='';var _0x404993=_0xd255('0x54');return db['SalesforceAccount'][_0xd255('0x4c')]({'where':{'id':_0x5e6c6d[_0xd255('0x44')]['id']},'attributes':['id','remoteUri','clientId','clientSecret',_0xd255('0x55'),_0xd255('0x56'),_0xd255('0x57')]})[_0xd255('0x22')](handleEntityNotFound(_0xa8c191,null))['then'](function(_0x20eada){if(_0x20eada){_0x4dcc39=_0x20eada[_0xd255('0x58')];var _0x2e5609=_0x4dcc39[_0xd255('0x59')](-0x1);if(_0x2e5609==='/'){_0x4dcc39=_0x4dcc39[_0xd255('0x5a')](0x0,_0x4dcc39[_0xd255('0x5b')](_0x2e5609));}_0x2cab79=new jsforce[(_0xd255('0x5c'))]({'oauth2':{'loginUrl':_0x4dcc39,'clientId':_0x20eada[_0xd255('0x5d')],'clientSecret':_0x20eada[_0xd255('0x5e')]}});return _0x2cab79['login'](_0x20eada[_0xd255('0x55')],_0x20eada[_0xd255('0x56')][_0xd255('0x5f')](_0x20eada[_0xd255('0x57')]));}})[_0xd255('0x22')](function(_0x3f7e80){if(_0x3f7e80){if(!_[_0xd255('0x60')](_0x5e6c6d[_0xd255('0x2f')]['ticketType'])){_0x404993=_0x5e6c6d[_0xd255('0x2f')][_0xd255('0x61')];}return _0x2cab79[_0xd255('0x62')](_0x404993)[_0xd255('0x63')]();}})[_0xd255('0x22')](function(_0x4a6b8e){var _0xa1032c=['OwnerId',_0xd255('0x64'),_0xd255('0x65'),_0xd255('0x66'),_0xd255('0x67'),_0xd255('0x68')];var _0x197e20=[_0xd255('0x69'),'int',_0xd255('0x6a'),_0xd255('0x6b'),'email',_0xd255('0x6c'),_0xd255('0x6d')];if(_0x4a6b8e){_['remove'](_0x4a6b8e['fields'],function(_0x34b724){return _0xa1032c[_0xd255('0x6e')](_0x34b724[_0xd255('0x26')])||!_0x197e20[_0xd255('0x6e')](_0x34b724[_0xd255('0x2d')]);});return{'count':_0x4a6b8e[_0xd255('0x34')][_0xd255('0x35')],'rows':_[_0xd255('0x29')](_0x4a6b8e[_0xd255('0x34')],function(_0x516505){return{'id':_0x516505[_0xd255('0x26')],'name':_0x516505[_0xd255('0x6f')],'custom':_0x516505['custom'],'options':_0x516505[_0xd255('0x70')]['length']>0x0?_[_0xd255('0x29')](_0x516505[_0xd255('0x70')],function(_0x5bf296){return{'name':_0x5bf296['label'],'value':_0x5bf296[_0xd255('0x71')]};}):_0x516505[_0xd255('0x2d')]==_0xd255('0x6b')?[{'name':_0xd255('0x72'),'value':_0xd255('0x73')},{'name':_0xd255('0x74'),'value':'false'}]:[]};})};}})[_0xd255('0x22')](respondWithResult(_0xa8c191,null))[_0xd255('0x42')](function(_0x55fcbe){var _0x40af29=_0x5e6c6d['query'][_0xd255('0x75')]?0x1f4:_0x55fcbe[_0xd255('0x76')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xd255('0x53'),_0x40af29,JSON[_0xd255('0x77')](_0x55fcbe));delete _0x55fcbe[_0xd255('0x26')];if(_0x40af29===0x191){_0x40af29=0x190;}_0xa8c191[_0xd255('0x19')](_0x40af29)[_0xd255('0x27')](_0x5e6c6d[_0xd255('0x2f')][_0xd255('0x75')]?{'message':_0xd255('0x78'),'statusCode':_0x55fcbe[_0xd255('0x76')]}:_0x55fcbe);});}; \ No newline at end of file +var _0x196e=['Content-Range','apply','update','then','destroy','stack','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','SalesforceAccount','includeAll','include','rows','catch','show','find','create','body','params','getConfigurations','findOne','SalesforceConfiguration','length','hasOwnProperty','addConfiguration','Subjects','channel','Descriptions','getDescriptions','getFields','Task','remoteUri','clientId','clientSecret','password','securityToken','substring','Connection','login','username','concat','sobject','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','picklist','boolean','email','phone','remove','includes','name','custom','picklistValues','label','value','true','False','false','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','count','set'];(function(_0x40911a,_0x55ec99){var _0x27e8e3=function(_0x2ba910){while(--_0x2ba910){_0x40911a['push'](_0x40911a['shift']());}};_0x27e8e3(++_0x55ec99);}(_0x196e,0xcc));var _0xe196=function(_0x30b0d8,_0x57470c){_0x30b0d8=_0x30b0d8-0x0;var _0x459c09=_0x196e[_0x30b0d8];return _0x459c09;};'use strict';var emlformat=require(_0xe196('0x0'));var rimraf=require(_0xe196('0x1'));var zipdir=require(_0xe196('0x2'));var jsonpatch=require(_0xe196('0x3'));var rp=require(_0xe196('0x4'));var moment=require(_0xe196('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe196('0x6'));var util=require(_0xe196('0x7'));var path=require(_0xe196('0x8'));var sox=require(_0xe196('0x9'));var csv=require(_0xe196('0xa'));var ejs=require(_0xe196('0xb'));var fs=require('fs');var fs_extra=require(_0xe196('0xc'));var _=require(_0xe196('0xd'));var squel=require('squel');var crypto=require(_0xe196('0xe'));var jsforce=require(_0xe196('0xf'));var deskjs=require(_0xe196('0x10'));var toCsv=require(_0xe196('0xa'));var querystring=require(_0xe196('0x11'));var Papa=require(_0xe196('0x12'));var Redis=require(_0xe196('0x13'));var authService=require(_0xe196('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe196('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe196('0x16'));var licenseUtil=require(_0xe196('0x17'));var db=require(_0xe196('0x18'))['db'];var integrations=require(_0xe196('0x19'));function respondWithStatusCode(_0x2c4c6d,_0x1b4a79){_0x1b4a79=_0x1b4a79||0xcc;return function(_0x11d85f){if(_0x11d85f){return _0x2c4c6d[_0xe196('0x1a')](_0x1b4a79);}return _0x2c4c6d[_0xe196('0x1b')](_0x1b4a79)[_0xe196('0x1c')]();};}function respondWithResult(_0x42e9e3,_0x5e4d41){_0x5e4d41=_0x5e4d41||0xc8;return function(_0x47afeb){if(_0x47afeb){return _0x42e9e3['status'](_0x5e4d41)[_0xe196('0x1d')](_0x47afeb);}};}function respondWithFilteredResult(_0x284a51,_0x4c449d){return function(_0x48c507){if(_0x48c507){var _0x125dc8=typeof _0x4c449d[_0xe196('0x1e')]==='undefined'&&typeof _0x4c449d[_0xe196('0x1f')]==='undefined';var _0x3db84b=_0x48c507[_0xe196('0x20')];var _0x533bab=_0x125dc8?0x0:_0x4c449d['offset'];var _0x4d5a23=_0x125dc8?_0x48c507[_0xe196('0x20')]:_0x4c449d[_0xe196('0x1e')]+_0x4c449d[_0xe196('0x1f')];var _0x34b930;if(_0x4d5a23>=_0x3db84b){_0x4d5a23=_0x3db84b;_0x34b930=0xc8;}else{_0x34b930=0xce;}_0x284a51[_0xe196('0x1b')](_0x34b930);return _0x284a51[_0xe196('0x21')](_0xe196('0x22'),_0x533bab+'-'+_0x4d5a23+'/'+_0x3db84b)[_0xe196('0x1d')](_0x48c507);}return null;};}function patchUpdates(_0x26f9e3){return function(_0x31f533){try{jsonpatch[_0xe196('0x23')](_0x31f533,_0x26f9e3,!![]);}catch(_0x122290){return BPromise['reject'](_0x122290);}return _0x31f533['save']();};}function saveUpdates(_0x3d1f80,_0x304a43){return function(_0x46555f){if(_0x46555f){return _0x46555f[_0xe196('0x24')](_0x3d1f80)[_0xe196('0x25')](function(_0x4df32f){return _0x4df32f;});}return null;};}function removeEntity(_0x13dbc4,_0x14bfd1){return function(_0x32201f){if(_0x32201f){return _0x32201f[_0xe196('0x26')]()['then'](function(){_0x13dbc4['status'](0xcc)[_0xe196('0x1c')]();});}};}function handleEntityNotFound(_0x252911,_0xda4c0){return function(_0x49e420){if(!_0x49e420){_0x252911[_0xe196('0x1a')](0x194);}return _0x49e420;};}function handleError(_0x5a17fb,_0x5df99d){_0x5df99d=_0x5df99d||0x1f4;return function(_0xa1100f){logger['error'](_0xa1100f[_0xe196('0x27')]);if(_0xa1100f['name']){delete _0xa1100f['name'];}_0x5a17fb[_0xe196('0x1b')](_0x5df99d)[_0xe196('0x28')](_0xa1100f);};}exports[_0xe196('0x29')]=function(_0x91df38,_0x337b8f){var _0x4d02a0={},_0x499207={},_0x21e90f={'count':0x0,'rows':[]};var _0x573f74=_['map'](db['SalesforceAccount'][_0xe196('0x2a')],function(_0x352f11){return{'name':_0x352f11[_0xe196('0x2b')],'type':_0x352f11[_0xe196('0x2c')][_0xe196('0x2d')]};});_0x499207[_0xe196('0x2e')]=_[_0xe196('0x2f')](_0x573f74,'name');_0x499207[_0xe196('0x30')]=_[_0xe196('0x31')](_0x91df38[_0xe196('0x30')]);_0x499207[_0xe196('0x32')]=_[_0xe196('0x33')](_0x499207[_0xe196('0x2e')],_0x499207[_0xe196('0x30')]);_0x4d02a0[_0xe196('0x34')]=_[_0xe196('0x33')](_0x499207[_0xe196('0x2e')],qs['fields'](_0x91df38['query'][_0xe196('0x35')]));_0x4d02a0[_0xe196('0x34')]=_0x4d02a0[_0xe196('0x34')]['length']?_0x4d02a0[_0xe196('0x34')]:_0x499207[_0xe196('0x2e')];if(!_0x91df38['query']['hasOwnProperty'](_0xe196('0x36'))){_0x4d02a0['limit']=qs[_0xe196('0x1f')](_0x91df38['query'][_0xe196('0x1f')]);_0x4d02a0[_0xe196('0x1e')]=qs[_0xe196('0x1e')](_0x91df38['query'][_0xe196('0x1e')]);}_0x4d02a0[_0xe196('0x37')]=qs[_0xe196('0x38')](_0x91df38['query']['sort']);_0x4d02a0[_0xe196('0x39')]=qs[_0xe196('0x32')](_[_0xe196('0x3a')](_0x91df38['query'],_0x499207['filters']),_0x573f74);if(_0x91df38['query'][_0xe196('0x3b')]){_0x4d02a0['where']=_[_0xe196('0x3c')](_0x4d02a0['where'],{'$or':_[_0xe196('0x2f')](_0x573f74,function(_0x131e53){if(_0x131e53['type']!=='VIRTUAL'){var _0x3306c8={};_0x3306c8[_0x131e53['name']]={'$like':'%'+_0x91df38[_0xe196('0x30')]['filter']+'%'};return _0x3306c8;}})});}_0x4d02a0=_[_0xe196('0x3c')]({},_0x4d02a0,_0x91df38[_0xe196('0x3d')]);var _0xe5a502={'where':_0x4d02a0['where']};return db[_0xe196('0x3e')][_0xe196('0x20')](_0xe5a502)[_0xe196('0x25')](function(_0x581d83){_0x21e90f[_0xe196('0x20')]=_0x581d83;if(_0x91df38['query'][_0xe196('0x3f')]){_0x4d02a0[_0xe196('0x40')]=[{'all':!![]}];}return db[_0xe196('0x3e')]['findAll'](_0x4d02a0);})[_0xe196('0x25')](function(_0x437f86){_0x21e90f[_0xe196('0x41')]=_0x437f86;return _0x21e90f;})['then'](respondWithFilteredResult(_0x337b8f,_0x4d02a0))[_0xe196('0x42')](handleError(_0x337b8f,null));};exports[_0xe196('0x43')]=function(_0x5da8e2,_0x37d1cc){var _0x1bc411={'raw':![],'where':{'id':_0x5da8e2['params']['id']}},_0x568a2c={};_0x568a2c[_0xe196('0x2e')]=_[_0xe196('0x31')](db['SalesforceAccount'][_0xe196('0x2a')]);_0x568a2c[_0xe196('0x30')]=_[_0xe196('0x31')](_0x5da8e2[_0xe196('0x30')]);_0x568a2c[_0xe196('0x32')]=_[_0xe196('0x33')](_0x568a2c[_0xe196('0x2e')],_0x568a2c[_0xe196('0x30')]);_0x1bc411[_0xe196('0x34')]=_[_0xe196('0x33')](_0x568a2c[_0xe196('0x2e')],qs[_0xe196('0x35')](_0x5da8e2[_0xe196('0x30')][_0xe196('0x35')]));_0x1bc411[_0xe196('0x34')]=_0x1bc411[_0xe196('0x34')]['length']?_0x1bc411[_0xe196('0x34')]:_0x568a2c['model'];if(_0x5da8e2[_0xe196('0x30')]['includeAll']){_0x1bc411[_0xe196('0x40')]=[{'all':!![]}];}_0x1bc411=_['merge']({},_0x1bc411,_0x5da8e2['options']);return db[_0xe196('0x3e')][_0xe196('0x44')](_0x1bc411)['then'](handleEntityNotFound(_0x37d1cc,null))[_0xe196('0x25')](respondWithResult(_0x37d1cc,null))[_0xe196('0x42')](handleError(_0x37d1cc,null));};exports[_0xe196('0x45')]=function(_0x5a777b,_0xe766cf){return db[_0xe196('0x3e')]['create'](_0x5a777b[_0xe196('0x46')],{})['then'](respondWithResult(_0xe766cf,0xc9))[_0xe196('0x42')](handleError(_0xe766cf,null));};exports['update']=function(_0x4976c8,_0x5c91e5){if(_0x4976c8[_0xe196('0x46')]['id']){delete _0x4976c8[_0xe196('0x46')]['id'];}return db[_0xe196('0x3e')]['find']({'where':{'id':_0x4976c8['params']['id']}})[_0xe196('0x25')](handleEntityNotFound(_0x5c91e5,null))[_0xe196('0x25')](saveUpdates(_0x4976c8[_0xe196('0x46')],null))[_0xe196('0x25')](respondWithResult(_0x5c91e5,null))[_0xe196('0x42')](handleError(_0x5c91e5,null));};exports[_0xe196('0x26')]=function(_0x462e5c,_0x114de9){return db[_0xe196('0x3e')][_0xe196('0x44')]({'where':{'id':_0x462e5c[_0xe196('0x47')]['id']}})[_0xe196('0x25')](handleEntityNotFound(_0x114de9,null))[_0xe196('0x25')](removeEntity(_0x114de9,null))[_0xe196('0x42')](handleError(_0x114de9,null));};exports[_0xe196('0x48')]=function(_0x6fd809,_0x22090c,_0x54fc57){var _0x47a6c6={};var _0x1f942c={};var _0x496f1f;var _0x458b8b;return db[_0xe196('0x3e')][_0xe196('0x49')]({'where':{'id':_0x6fd809[_0xe196('0x47')]['id']}})[_0xe196('0x25')](handleEntityNotFound(_0x22090c,null))['then'](function(_0x115836){if(_0x115836){_0x496f1f=_0x115836;_0x1f942c[_0xe196('0x2e')]=_[_0xe196('0x31')](db[_0xe196('0x4a')][_0xe196('0x2a')]);_0x1f942c['query']=_[_0xe196('0x31')](_0x6fd809[_0xe196('0x30')]);_0x1f942c['filters']=_[_0xe196('0x33')](_0x1f942c[_0xe196('0x2e')],_0x1f942c[_0xe196('0x30')]);_0x47a6c6[_0xe196('0x34')]=_[_0xe196('0x33')](_0x1f942c[_0xe196('0x2e')],qs[_0xe196('0x35')](_0x6fd809[_0xe196('0x30')]['fields']));_0x47a6c6[_0xe196('0x34')]=_0x47a6c6['attributes'][_0xe196('0x4b')]?_0x47a6c6['attributes']:_0x1f942c['model'];_0x47a6c6['order']=qs[_0xe196('0x38')](_0x6fd809['query'][_0xe196('0x38')]);_0x47a6c6['where']=qs['filters'](_[_0xe196('0x3a')](_0x6fd809[_0xe196('0x30')],_0x1f942c[_0xe196('0x32')]));if(_0x6fd809[_0xe196('0x30')]['filter']){_0x47a6c6[_0xe196('0x39')]=_['merge'](_0x47a6c6[_0xe196('0x39')],{'$or':_[_0xe196('0x2f')](_0x47a6c6[_0xe196('0x34')],function(_0xb156c7){var _0x385438={};_0x385438[_0xb156c7]={'$like':'%'+_0x6fd809[_0xe196('0x30')][_0xe196('0x3b')]+'%'};return _0x385438;})});}_0x47a6c6=_['merge']({},_0x47a6c6,_0x6fd809['options']);return _0x496f1f['getConfigurations'](_0x47a6c6);}})['then'](function(_0x2df1c3){if(_0x2df1c3){_0x458b8b=_0x2df1c3[_0xe196('0x4b')];if(!_0x6fd809['query'][_0xe196('0x4c')]('nolimit')){_0x47a6c6[_0xe196('0x1f')]=qs[_0xe196('0x1f')](_0x6fd809[_0xe196('0x30')][_0xe196('0x1f')]);_0x47a6c6['offset']=qs[_0xe196('0x1e')](_0x6fd809[_0xe196('0x30')][_0xe196('0x1e')]);}return _0x496f1f[_0xe196('0x48')](_0x47a6c6);}})[_0xe196('0x25')](function(_0x4b6513){if(_0x4b6513){return _0x4b6513?{'count':_0x458b8b,'rows':_0x4b6513}:null;}})[_0xe196('0x25')](respondWithResult(_0x22090c,null))[_0xe196('0x42')](handleError(_0x22090c,null));};exports[_0xe196('0x4d')]=function(_0x1b5fc5,_0x13b11c,_0x19db7c){if(_0x1b5fc5[_0xe196('0x46')]['id']){delete _0x1b5fc5[_0xe196('0x46')]['id'];}return db[_0xe196('0x3e')][_0xe196('0x49')]({'where':{'id':_0x1b5fc5[_0xe196('0x47')]['id']}})['then'](handleEntityNotFound(_0x13b11c,null))[_0xe196('0x25')](function(_0x4b66d0){if(_0x4b66d0){_0x1b5fc5[_0xe196('0x46')]['AccountId']=_0x4b66d0['id'];_0x1b5fc5['body'][_0xe196('0x4e')]=integrations['getSubjects'](_0x1b5fc5['body'][_0xe196('0x4f')],_0x1b5fc5[_0xe196('0x46')][_0xe196('0x2c')]);_0x1b5fc5[_0xe196('0x46')][_0xe196('0x50')]=integrations[_0xe196('0x51')](_0x1b5fc5['body'][_0xe196('0x4f')],_0x1b5fc5['body'][_0xe196('0x2c')]);return db[_0xe196('0x4a')][_0xe196('0x45')](_0x1b5fc5[_0xe196('0x46')],{'include':[{'model':db['SalesforceField'],'as':_0xe196('0x4e')},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})[_0xe196('0x25')](respondWithResult(_0x13b11c,null))['catch'](handleError(_0x13b11c,null));};exports[_0xe196('0x52')]=function(_0x7c723f,_0x230c8f,_0x54760e){var _0x5ecc03;var _0x469b3e='';var _0x13f4bc=_0xe196('0x53');return db['SalesforceAccount']['findOne']({'where':{'id':_0x7c723f[_0xe196('0x47')]['id']},'attributes':['id',_0xe196('0x54'),_0xe196('0x55'),_0xe196('0x56'),'username',_0xe196('0x57'),_0xe196('0x58')]})[_0xe196('0x25')](handleEntityNotFound(_0x230c8f,null))[_0xe196('0x25')](function(_0x388fe6){if(_0x388fe6){_0x469b3e=_0x388fe6['remoteUri'];var _0x29c11f=_0x469b3e['slice'](-0x1);if(_0x29c11f==='/'){_0x469b3e=_0x469b3e[_0xe196('0x59')](0x0,_0x469b3e['lastIndexOf'](_0x29c11f));}_0x5ecc03=new jsforce[(_0xe196('0x5a'))]({'oauth2':{'loginUrl':_0x469b3e,'clientId':_0x388fe6[_0xe196('0x55')],'clientSecret':_0x388fe6[_0xe196('0x56')]}});return _0x5ecc03[_0xe196('0x5b')](_0x388fe6[_0xe196('0x5c')],_0x388fe6[_0xe196('0x57')][_0xe196('0x5d')](_0x388fe6[_0xe196('0x58')]));}})[_0xe196('0x25')](function(_0x4a2afd){if(_0x4a2afd){if(!_['isNil'](_0x7c723f[_0xe196('0x30')]['ticketType'])){_0x13f4bc=_0x7c723f[_0xe196('0x30')]['ticketType'];}return _0x5ecc03[_0xe196('0x5e')](_0x13f4bc)['describe']();}})['then'](function(_0x1c3337){var _0x45fa28=[_0xe196('0x5f'),_0xe196('0x60'),_0xe196('0x61'),_0xe196('0x62'),'Subject','Description'];var _0x2bc82e=['string','int',_0xe196('0x63'),_0xe196('0x64'),_0xe196('0x65'),'textarea',_0xe196('0x66')];if(_0x1c3337){_[_0xe196('0x67')](_0x1c3337[_0xe196('0x35')],function(_0x2ccaf3){return _0x45fa28[_0xe196('0x68')](_0x2ccaf3[_0xe196('0x69')])||!_0x2bc82e['includes'](_0x2ccaf3[_0xe196('0x2c')]);});return{'count':_0x1c3337[_0xe196('0x35')]['length'],'rows':_['map'](_0x1c3337['fields'],function(_0x4d36eb){return{'id':_0x4d36eb[_0xe196('0x69')],'name':_0x4d36eb['label'],'custom':_0x4d36eb[_0xe196('0x6a')],'options':_0x4d36eb[_0xe196('0x6b')][_0xe196('0x4b')]>0x0?_[_0xe196('0x2f')](_0x4d36eb[_0xe196('0x6b')],function(_0x35fb9c){return{'name':_0x35fb9c[_0xe196('0x6c')],'value':_0x35fb9c[_0xe196('0x6d')]};}):_0x4d36eb[_0xe196('0x2c')]==_0xe196('0x64')?[{'name':'True','value':_0xe196('0x6e')},{'name':_0xe196('0x6f'),'value':_0xe196('0x70')}]:[]};})};}})['then'](respondWithResult(_0x230c8f,null))[_0xe196('0x42')](function(_0x2f6511){var _0x5d833f=_0x7c723f[_0xe196('0x30')][_0xe196('0x71')]?0x1f4:_0x2f6511[_0xe196('0x72')]||0x1f4;logger[_0xe196('0x73')](_0xe196('0x74'),_0xe196('0x52'),_0x5d833f,JSON[_0xe196('0x75')](_0x2f6511));delete _0x2f6511[_0xe196('0x69')];if(_0x5d833f===0x191){_0x5d833f=0x190;}_0x230c8f[_0xe196('0x1b')](_0x5d833f)[_0xe196('0x28')](_0x7c723f[_0xe196('0x30')][_0xe196('0x71')]?{'message':_0xe196('0x76'),'statusCode':_0x2f6511['statusCode']}:_0x2f6511);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index a951899..c08ce60 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 _0x0fc2=['../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes'];(function(_0x55ed9c,_0x312431){var _0x43c649=function(_0x27441e){while(--_0x27441e){_0x55ed9c['push'](_0x55ed9c['shift']());}};_0x43c649(++_0x312431);}(_0x0fc2,0x6e));var _0x20fc=function(_0x55e2f8,_0x48de9e){_0x55e2f8=_0x55e2f8-0x0;var _0x7b9312=_0x0fc2[_0x55e2f8];return _0x7b9312;};'use strict';var _=require(_0x20fc('0x0'));var util=require(_0x20fc('0x1'));var logger=require(_0x20fc('0x2'))(_0x20fc('0x3'));var moment=require('moment');var BPromise=require(_0x20fc('0x4'));var rp=require(_0x20fc('0x5'));var fs=require('fs');var path=require(_0x20fc('0x6'));var rimraf=require(_0x20fc('0x7'));var config=require(_0x20fc('0x8'));var attributes=require(_0x20fc('0x9'));var integrations=require(_0x20fc('0xa'));module[_0x20fc('0xb')]=function(_0x10f6ad,_0xc556e8){return _0x10f6ad[_0x20fc('0xc')](_0x20fc('0xd'),attributes,{'tableName':_0x20fc('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2b87=['../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','lodash','util','../../config/logger','request-promise','path','rimraf'];(function(_0x147bcc,_0xa54aa8){var _0x29ab8e=function(_0x408c5b){while(--_0x408c5b){_0x147bcc['push'](_0x147bcc['shift']());}};_0x29ab8e(++_0xa54aa8);}(_0x2b87,0x186));var _0x72b8=function(_0xb29894,_0x240e96){_0xb29894=_0xb29894-0x0;var _0x13e3e9=_0x2b87[_0xb29894];return _0x13e3e9;};'use strict';var _=require(_0x72b8('0x0'));var util=require(_0x72b8('0x1'));var logger=require(_0x72b8('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x72b8('0x3'));var fs=require('fs');var path=require(_0x72b8('0x4'));var rimraf=require(_0x72b8('0x5'));var config=require(_0x72b8('0x6'));var attributes=require(_0x72b8('0x7'));var integrations=require(_0x72b8('0x8'));module[_0x72b8('0x9')]=function(_0x42c78b,_0x5a8ce8){return _0x42c78b[_0x72b8('0xa')](_0x72b8('0xb'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 7128c33..8f46fa4 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 _0xff20=['SalesforceAccount','findAll','options','raw','where','attributes','limit','map','include','model','then','GetSalesforceAccount','ShowSalesforceAccount','find','catch','bluebird','ioredis','../../config/utils','../../config/logger','rpc','http','request','info','request\x20sent','debug','stringify','SalesforceAccount,\x20%s,\x20%s','error','message','result'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xff20,0x87));var _0x0ff2=function(_0x4dc700,_0x10191b){_0x4dc700=_0x4dc700-0x0;var _0x484b91=_0xff20[_0x4dc700];return _0x484b91;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0ff2('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ff2('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x0ff2('0x2'));var logger=require(_0x0ff2('0x3'))(_0x0ff2('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0ff2('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x241a07,_0x372c42,_0x4700b0){return new BPromise(function(_0x3af208,_0x3ecf25){return client[_0x0ff2('0x6')](_0x241a07,_0x4700b0)['then'](function(_0x45487f){logger[_0x0ff2('0x7')]('SalesforceAccount,\x20%s,\x20%s',_0x372c42,_0x0ff2('0x8'));logger[_0x0ff2('0x9')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x372c42,_0x0ff2('0x8'),JSON[_0x0ff2('0xa')](_0x45487f));if(_0x45487f['error']){if(_0x45487f['error']['code']===0x1f4){logger['error'](_0x0ff2('0xb'),_0x372c42,_0x45487f[_0x0ff2('0xc')][_0x0ff2('0xd')]);return _0x3ecf25(_0x45487f['error'][_0x0ff2('0xd')]);}logger['error'](_0x0ff2('0xb'),_0x372c42,_0x45487f[_0x0ff2('0xc')][_0x0ff2('0xd')]);return _0x3af208(_0x45487f[_0x0ff2('0xc')][_0x0ff2('0xd')]);}else{logger[_0x0ff2('0x7')]('SalesforceAccount,\x20%s,\x20%s',_0x372c42,_0x0ff2('0x8'));_0x3af208(_0x45487f[_0x0ff2('0xe')][_0x0ff2('0xd')]);}})['catch'](function(_0x259256){logger[_0x0ff2('0xc')](_0x0ff2('0xb'),_0x372c42,_0x259256);_0x3ecf25(_0x259256);});});}exports['GetSalesforceAccount']=function(_0x4cab52){var _0x334668=this;return new Promise(function(_0x187225,_0x2192fe){return db[_0x0ff2('0xf')][_0x0ff2('0x10')]({'raw':_0x4cab52[_0x0ff2('0x11')]?_0x4cab52[_0x0ff2('0x11')][_0x0ff2('0x12')]===undefined?!![]:![]:!![],'where':_0x4cab52[_0x0ff2('0x11')]?_0x4cab52[_0x0ff2('0x11')][_0x0ff2('0x13')]||null:null,'attributes':_0x4cab52[_0x0ff2('0x11')]?_0x4cab52[_0x0ff2('0x11')][_0x0ff2('0x14')]||null:null,'limit':_0x4cab52[_0x0ff2('0x11')]?_0x4cab52[_0x0ff2('0x11')][_0x0ff2('0x15')]||null:null,'include':_0x4cab52[_0x0ff2('0x11')]?_0x4cab52[_0x0ff2('0x11')]['include']?_[_0x0ff2('0x16')](_0x4cab52[_0x0ff2('0x11')][_0x0ff2('0x17')],function(_0x39a1be){return{'model':db[_0x39a1be[_0x0ff2('0x18')]],'as':_0x39a1be['as'],'attributes':_0x39a1be[_0x0ff2('0x14')],'include':_0x39a1be[_0x0ff2('0x17')]?_['map'](_0x39a1be[_0x0ff2('0x17')],function(_0x525535){return{'model':db[_0x525535[_0x0ff2('0x18')]],'as':_0x525535['as'],'attributes':_0x525535[_0x0ff2('0x14')],'include':_0x525535[_0x0ff2('0x17')]?_[_0x0ff2('0x16')](_0x525535[_0x0ff2('0x17')],function(_0x1f36c8){return{'model':db[_0x1f36c8[_0x0ff2('0x18')]],'as':_0x1f36c8['as'],'attributes':_0x1f36c8[_0x0ff2('0x14')]};}):[]};}):[]};}):[]:[]})[_0x0ff2('0x19')](function(_0x591966){logger['info'](_0x0ff2('0x1a'),_0x4cab52);logger['debug'](_0x0ff2('0x1a'),_0x4cab52,JSON[_0x0ff2('0xa')](_0x591966));_0x187225(_0x591966);})['catch'](function(_0x2189db){logger['error']('GetSalesforceAccount',_0x2189db[_0x0ff2('0xd')],_0x4cab52);_0x2192fe(_0x334668[_0x0ff2('0xc')](0x1f4,_0x2189db['message']));});});};exports[_0x0ff2('0x1b')]=function(_0x1b601a){var _0x1f4333=this;return new Promise(function(_0x4dfb93,_0xa9db40){return db[_0x0ff2('0xf')][_0x0ff2('0x1c')]({'raw':_0x1b601a['options']?_0x1b601a[_0x0ff2('0x11')][_0x0ff2('0x12')]===undefined?!![]:![]:!![],'where':_0x1b601a[_0x0ff2('0x11')]?_0x1b601a[_0x0ff2('0x11')][_0x0ff2('0x13')]||null:null,'attributes':_0x1b601a[_0x0ff2('0x11')]?_0x1b601a[_0x0ff2('0x11')][_0x0ff2('0x14')]||null:null,'include':_0x1b601a[_0x0ff2('0x11')]?_0x1b601a[_0x0ff2('0x11')]['include']?_[_0x0ff2('0x16')](_0x1b601a[_0x0ff2('0x11')]['include'],function(_0x5deeb1){return{'model':db[_0x5deeb1['model']],'as':_0x5deeb1['as'],'attributes':_0x5deeb1[_0x0ff2('0x14')],'include':_0x5deeb1['include']?_[_0x0ff2('0x16')](_0x5deeb1['include'],function(_0x5f513e){return{'model':db[_0x5f513e[_0x0ff2('0x18')]],'as':_0x5f513e['as'],'attributes':_0x5f513e['attributes'],'include':_0x5f513e[_0x0ff2('0x17')]?_[_0x0ff2('0x16')](_0x5f513e[_0x0ff2('0x17')],function(_0x5813d7){return{'model':db[_0x5813d7[_0x0ff2('0x18')]],'as':_0x5813d7['as'],'attributes':_0x5813d7[_0x0ff2('0x14')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42c86e){logger[_0x0ff2('0x7')]('ShowSalesforceAccount',_0x1b601a);logger[_0x0ff2('0x9')](_0x0ff2('0x1b'),_0x1b601a,JSON[_0x0ff2('0xa')](_0x42c86e));_0x4dfb93(_0x42c86e);})[_0x0ff2('0x1d')](function(_0x24746a){logger['error']('ShowSalesforceAccount',_0x24746a['message'],_0x1b601a);_0xa9db40(_0x1f4333[_0x0ff2('0xc')](0x1f4,_0x24746a[_0x0ff2('0xd')]));});});}; \ No newline at end of file +var _0x5120=['http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetSalesforceAccount','options','where','attributes','limit','include','map','model','stringify','catch','ShowSalesforceAccount','SalesforceAccount','find','lodash','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x5d6444,_0x61898f){var _0x285429=function(_0x383b20){while(--_0x383b20){_0x5d6444['push'](_0x5d6444['shift']());}};_0x285429(++_0x61898f);}(_0x5120,0xdf));var _0x0512=function(_0xa911e,_0x1a9f9a){_0xa911e=_0xa911e-0x0;var _0x28bd6f=_0x5120[_0xa911e];return _0x28bd6f;};'use strict';var _=require(_0x0512('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0512('0x1'));var rs=require(_0x0512('0x2'));var fs=require('fs');var Redis=require(_0x0512('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0512('0x4'))('rpc');var config=require(_0x0512('0x5'));var jayson=require(_0x0512('0x6'));var client=jayson[_0x0512('0x7')][_0x0512('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xafc18e,_0x5d54e0,_0x5492a6){return new BPromise(function(_0x2a3e64,_0x189739){return client[_0x0512('0x9')](_0xafc18e,_0x5492a6)[_0x0512('0xa')](function(_0x4bcf40){logger[_0x0512('0xb')](_0x0512('0xc'),_0x5d54e0,_0x0512('0xd'));logger[_0x0512('0xe')](_0x0512('0xf'),_0x5d54e0,_0x0512('0xd'),JSON['stringify'](_0x4bcf40));if(_0x4bcf40[_0x0512('0x10')]){if(_0x4bcf40[_0x0512('0x10')][_0x0512('0x11')]===0x1f4){logger[_0x0512('0x10')](_0x0512('0xc'),_0x5d54e0,_0x4bcf40['error'][_0x0512('0x12')]);return _0x189739(_0x4bcf40[_0x0512('0x10')][_0x0512('0x12')]);}logger[_0x0512('0x10')](_0x0512('0xc'),_0x5d54e0,_0x4bcf40[_0x0512('0x10')][_0x0512('0x12')]);return _0x2a3e64(_0x4bcf40[_0x0512('0x10')]['message']);}else{logger[_0x0512('0xb')](_0x0512('0xc'),_0x5d54e0,_0x0512('0xd'));_0x2a3e64(_0x4bcf40[_0x0512('0x13')][_0x0512('0x12')]);}})['catch'](function(_0x1d28c9){logger[_0x0512('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x5d54e0,_0x1d28c9);_0x189739(_0x1d28c9);});});}exports[_0x0512('0x14')]=function(_0x478f85){var _0x2523ca=this;return new Promise(function(_0x236ea9,_0x37eac0){return db['SalesforceAccount']['findAll']({'raw':_0x478f85[_0x0512('0x15')]?_0x478f85[_0x0512('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x478f85['options']?_0x478f85[_0x0512('0x15')][_0x0512('0x16')]||null:null,'attributes':_0x478f85[_0x0512('0x15')]?_0x478f85[_0x0512('0x15')][_0x0512('0x17')]||null:null,'limit':_0x478f85[_0x0512('0x15')]?_0x478f85[_0x0512('0x15')][_0x0512('0x18')]||null:null,'include':_0x478f85[_0x0512('0x15')]?_0x478f85[_0x0512('0x15')][_0x0512('0x19')]?_[_0x0512('0x1a')](_0x478f85[_0x0512('0x15')][_0x0512('0x19')],function(_0x56a9be){return{'model':db[_0x56a9be[_0x0512('0x1b')]],'as':_0x56a9be['as'],'attributes':_0x56a9be[_0x0512('0x17')],'include':_0x56a9be[_0x0512('0x19')]?_['map'](_0x56a9be[_0x0512('0x19')],function(_0x3e229e){return{'model':db[_0x3e229e[_0x0512('0x1b')]],'as':_0x3e229e['as'],'attributes':_0x3e229e['attributes'],'include':_0x3e229e[_0x0512('0x19')]?_[_0x0512('0x1a')](_0x3e229e[_0x0512('0x19')],function(_0xb784f5){return{'model':db[_0xb784f5[_0x0512('0x1b')]],'as':_0xb784f5['as'],'attributes':_0xb784f5[_0x0512('0x17')]};}):[]};}):[]};}):[]:[]})[_0x0512('0xa')](function(_0x45130a){logger[_0x0512('0xb')](_0x0512('0x14'),_0x478f85);logger[_0x0512('0xe')](_0x0512('0x14'),_0x478f85,JSON[_0x0512('0x1c')](_0x45130a));_0x236ea9(_0x45130a);})[_0x0512('0x1d')](function(_0x4578a2){logger[_0x0512('0x10')]('GetSalesforceAccount',_0x4578a2[_0x0512('0x12')],_0x478f85);_0x37eac0(_0x2523ca[_0x0512('0x10')](0x1f4,_0x4578a2[_0x0512('0x12')]));});});};exports[_0x0512('0x1e')]=function(_0x1c9ef7){var _0xbdb841=this;return new Promise(function(_0x536aaa,_0xe31514){return db[_0x0512('0x1f')][_0x0512('0x20')]({'raw':_0x1c9ef7[_0x0512('0x15')]?_0x1c9ef7[_0x0512('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x1c9ef7['options']?_0x1c9ef7[_0x0512('0x15')]['where']||null:null,'attributes':_0x1c9ef7[_0x0512('0x15')]?_0x1c9ef7['options']['attributes']||null:null,'include':_0x1c9ef7[_0x0512('0x15')]?_0x1c9ef7[_0x0512('0x15')][_0x0512('0x19')]?_[_0x0512('0x1a')](_0x1c9ef7[_0x0512('0x15')]['include'],function(_0x4ad08a){return{'model':db[_0x4ad08a[_0x0512('0x1b')]],'as':_0x4ad08a['as'],'attributes':_0x4ad08a[_0x0512('0x17')],'include':_0x4ad08a[_0x0512('0x19')]?_['map'](_0x4ad08a[_0x0512('0x19')],function(_0x23647a){return{'model':db[_0x23647a[_0x0512('0x1b')]],'as':_0x23647a['as'],'attributes':_0x23647a[_0x0512('0x17')],'include':_0x23647a[_0x0512('0x19')]?_['map'](_0x23647a['include'],function(_0x5d7b6e){return{'model':db[_0x5d7b6e[_0x0512('0x1b')]],'as':_0x5d7b6e['as'],'attributes':_0x5d7b6e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x612848){logger[_0x0512('0xb')](_0x0512('0x1e'),_0x1c9ef7);logger[_0x0512('0xe')](_0x0512('0x1e'),_0x1c9ef7,JSON[_0x0512('0x1c')](_0x612848));_0x536aaa(_0x612848);})[_0x0512('0x1d')](function(_0x7052ab){logger[_0x0512('0x10')](_0x0512('0x1e'),_0x7052ab[_0x0512('0x12')],_0x1c9ef7);_0xe31514(_0xbdb841[_0x0512('0x10')](0x1f4,_0x7052ab['message']));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 855a476..1c19526 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 _0x7a54=['getSubjects','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','index','/:id','isAuthenticated','/:id/subjects'];(function(_0x186c81,_0x11d97d){var _0x43f7b3=function(_0x3f9a2b){while(--_0x3f9a2b){_0x186c81['push'](_0x186c81['shift']());}};_0x43f7b3(++_0x11d97d);}(_0x7a54,0x106));var _0x47a5=function(_0x3e7647,_0x24f809){_0x3e7647=_0x3e7647-0x0;var _0x5e02ca=_0x7a54[_0x3e7647];return _0x5e02ca;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router; \ No newline at end of file +var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','delete','destroy','exports','multer','util'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xdb28,0x106));var _0x8db2=function(_0x3938ed,_0x166d8f){_0x3938ed=_0x3938ed-0x0;var _0x537308=_0xdb28[_0x3938ed];return _0x537308;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./intSalesforceConfiguration.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['get'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);router['get'](_0x8db2('0x11'),auth[_0x8db2('0xa')](),controller['getDescriptions']);router[_0x8db2('0x12')]('/',auth[_0x8db2('0xa')](),controller[_0x8db2('0x13')]);router[_0x8db2('0x14')](_0x8db2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8db2('0x15')](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x16')]);module[_0x8db2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 569409e..fc3e057 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 _0x699c=['Case','contact_lead','contact','lead','account_contact_lead','nothing','account','sequelize','exports','STRING','ENUM','Task'];(function(_0x1bc62c,_0x4d8bd9){var _0x3275a2=function(_0x785c73){while(--_0x785c73){_0x1bc62c['push'](_0x1bc62c['shift']());}};_0x3275a2(++_0x4d8bd9);}(_0x699c,0x127));var _0xc699=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x699c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc699('0x0'));module[_0xc699('0x1')]={'name':{'type':Sequelize[_0xc699('0x2')]},'description':{'type':Sequelize[_0xc699('0x2')]},'ticketType':{'type':Sequelize[_0xc699('0x3')](_0xc699('0x4'),_0xc699('0x5')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0xc699('0x3')](_0xc699('0x6'),_0xc699('0x7'),_0xc699('0x8'),_0xc699('0x9'),'account'),'defaultValue':_0xc699('0x6')},'moduleCreate':{'type':Sequelize[_0xc699('0x3')](_0xc699('0xa'),'contact',_0xc699('0x8'),_0xc699('0xb')),'defaultValue':_0xc699('0x8')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0xc699('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xc699('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x53d6=['contact','lead','account_contact_lead','account','nothing','exports','STRING','ENUM','Task','contact_lead'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x53d6,0x113));var _0x653d=function(_0x3df871,_0xda2e11){_0x3df871=_0x3df871-0x0;var _0x570f7b=_0x53d6[_0x3df871];return _0x570f7b;};'use strict';var Sequelize=require('sequelize');module[_0x653d('0x0')]={'name':{'type':Sequelize[_0x653d('0x1')]},'description':{'type':Sequelize[_0x653d('0x1')]},'ticketType':{'type':Sequelize[_0x653d('0x2')]('Task','Case'),'defaultValue':_0x653d('0x3')},'moduleSearch':{'type':Sequelize[_0x653d('0x2')](_0x653d('0x4'),_0x653d('0x5'),_0x653d('0x6'),_0x653d('0x7'),_0x653d('0x8')),'defaultValue':_0x653d('0x4')},'moduleCreate':{'type':Sequelize[_0x653d('0x2')](_0x653d('0x9'),_0x653d('0x5'),_0x653d('0x6'),_0x653d('0x8')),'defaultValue':_0x653d('0x6')},'leadId':{'type':Sequelize[_0x653d('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x653d('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x653d('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x653d('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 876ea1d..3639442 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 _0xe20e=['sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','create','body','catch','find','params','getFields','SalesforceField','pick','getSubjects','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','reject','save','update','destroy','then','error','name','send','index','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x4f4679,_0x713087){var _0x2f7cd0=function(_0x8eaf53){while(--_0x8eaf53){_0x4f4679['push'](_0x4f4679['shift']());}};_0x2f7cd0(++_0x713087);}(_0xe20e,0x195));var _0xee20=function(_0x3ac0fd,_0x2dfb0c){_0x3ac0fd=_0x3ac0fd-0x0;var _0x2670a9=_0xe20e[_0x3ac0fd];return _0x2670a9;};'use strict';var emlformat=require(_0xee20('0x0'));var rimraf=require(_0xee20('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xee20('0x2'));var rp=require(_0xee20('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xee20('0x4'));var util=require('util');var path=require(_0xee20('0x5'));var sox=require(_0xee20('0x6'));var csv=require(_0xee20('0x7'));var ejs=require(_0xee20('0x8'));var fs=require('fs');var fs_extra=require(_0xee20('0x9'));var _=require(_0xee20('0xa'));var squel=require(_0xee20('0xb'));var crypto=require(_0xee20('0xc'));var jsforce=require(_0xee20('0xd'));var deskjs=require(_0xee20('0xe'));var toCsv=require(_0xee20('0x7'));var querystring=require(_0xee20('0xf'));var Papa=require('papaparse');var Redis=require(_0xee20('0x10'));var authService=require(_0xee20('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xee20('0x12'));var logger=require(_0xee20('0x13'))(_0xee20('0x14'));var utils=require(_0xee20('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xee20('0x16'));var db=require(_0xee20('0x17'))['db'];function respondWithStatusCode(_0x440b89,_0x195d17){_0x195d17=_0x195d17||0xcc;return function(_0x303dc6){if(_0x303dc6){return _0x440b89[_0xee20('0x18')](_0x195d17);}return _0x440b89[_0xee20('0x19')](_0x195d17)['end']();};}function respondWithResult(_0x3da816,_0x4e1e75){_0x4e1e75=_0x4e1e75||0xc8;return function(_0x3f6df3){if(_0x3f6df3){return _0x3da816[_0xee20('0x19')](_0x4e1e75)[_0xee20('0x1a')](_0x3f6df3);}};}function respondWithFilteredResult(_0x5d0563,_0x6a910e){return function(_0x413905){if(_0x413905){var _0xa0873e=typeof _0x6a910e[_0xee20('0x1b')]===_0xee20('0x1c')&&typeof _0x6a910e['limit']===_0xee20('0x1c');var _0x271413=_0x413905['count'];var _0x4ad007=_0xa0873e?0x0:_0x6a910e[_0xee20('0x1b')];var _0x4ea5fa=_0xa0873e?_0x413905[_0xee20('0x1d')]:_0x6a910e[_0xee20('0x1b')]+_0x6a910e[_0xee20('0x1e')];var _0x46c22e;if(_0x4ea5fa>=_0x271413){_0x4ea5fa=_0x271413;_0x46c22e=0xc8;}else{_0x46c22e=0xce;}_0x5d0563[_0xee20('0x19')](_0x46c22e);return _0x5d0563['set']('Content-Range',_0x4ad007+'-'+_0x4ea5fa+'/'+_0x271413)[_0xee20('0x1a')](_0x413905);}return null;};}function patchUpdates(_0x9ec152){return function(_0x2cf160){try{jsonpatch['apply'](_0x2cf160,_0x9ec152,!![]);}catch(_0x16941b){return BPromise[_0xee20('0x1f')](_0x16941b);}return _0x2cf160[_0xee20('0x20')]();};}function saveUpdates(_0x3f959b,_0x407215){return function(_0x534c6e){if(_0x534c6e){return _0x534c6e[_0xee20('0x21')](_0x3f959b)['then'](function(_0x181f25){return _0x181f25;});}return null;};}function removeEntity(_0x4b4134,_0x53a158){return function(_0xc9af6c){if(_0xc9af6c){return _0xc9af6c[_0xee20('0x22')]()[_0xee20('0x23')](function(){_0x4b4134['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d0db3,_0x1030de){return function(_0x96d369){if(!_0x96d369){_0x5d0db3['sendStatus'](0x194);}return _0x96d369;};}function handleError(_0x989704,_0x256250){_0x256250=_0x256250||0x1f4;return function(_0xc0e06b){logger[_0xee20('0x24')](_0xc0e06b['stack']);if(_0xc0e06b['name']){delete _0xc0e06b[_0xee20('0x25')];}_0x989704[_0xee20('0x19')](_0x256250)[_0xee20('0x26')](_0xc0e06b);};}exports[_0xee20('0x27')]=function(_0x1c3ccf,_0xc1462){var _0x5c2079={},_0x2e4090={},_0x32590b={'count':0x0,'rows':[]};var _0x148219=_['map'](db[_0xee20('0x28')][_0xee20('0x29')],function(_0x207b4c){return{'name':_0x207b4c[_0xee20('0x2a')],'type':_0x207b4c[_0xee20('0x2b')][_0xee20('0x2c')]};});_0x2e4090[_0xee20('0x2d')]=_[_0xee20('0x2e')](_0x148219,'name');_0x2e4090[_0xee20('0x2f')]=_[_0xee20('0x30')](_0x1c3ccf['query']);_0x2e4090[_0xee20('0x31')]=_[_0xee20('0x32')](_0x2e4090[_0xee20('0x2d')],_0x2e4090[_0xee20('0x2f')]);_0x5c2079[_0xee20('0x33')]=_['intersection'](_0x2e4090['model'],qs[_0xee20('0x34')](_0x1c3ccf['query'][_0xee20('0x34')]));_0x5c2079[_0xee20('0x33')]=_0x5c2079[_0xee20('0x33')][_0xee20('0x35')]?_0x5c2079[_0xee20('0x33')]:_0x2e4090[_0xee20('0x2d')];if(!_0x1c3ccf[_0xee20('0x2f')][_0xee20('0x36')](_0xee20('0x37'))){_0x5c2079['limit']=qs[_0xee20('0x1e')](_0x1c3ccf[_0xee20('0x2f')][_0xee20('0x1e')]);_0x5c2079[_0xee20('0x1b')]=qs['offset'](_0x1c3ccf[_0xee20('0x2f')][_0xee20('0x1b')]);}_0x5c2079[_0xee20('0x38')]=qs['sort'](_0x1c3ccf[_0xee20('0x2f')][_0xee20('0x39')]);_0x5c2079[_0xee20('0x3a')]=qs[_0xee20('0x31')](_['pick'](_0x1c3ccf['query'],_0x2e4090[_0xee20('0x31')]),_0x148219);if(_0x1c3ccf['query'][_0xee20('0x3b')]){_0x5c2079[_0xee20('0x3a')]=_[_0xee20('0x3c')](_0x5c2079[_0xee20('0x3a')],{'$or':_[_0xee20('0x2e')](_0x148219,function(_0xa9d42e){if(_0xa9d42e['type']!==_0xee20('0x3d')){var _0x647d7a={};_0x647d7a[_0xa9d42e['name']]={'$like':'%'+_0x1c3ccf[_0xee20('0x2f')][_0xee20('0x3b')]+'%'};return _0x647d7a;}})});}_0x5c2079=_['merge']({},_0x5c2079,_0x1c3ccf[_0xee20('0x3e')]);var _0x372560={'where':_0x5c2079[_0xee20('0x3a')]};return db['SalesforceConfiguration']['count'](_0x372560)['then'](function(_0x241283){_0x32590b['count']=_0x241283;if(_0x1c3ccf[_0xee20('0x2f')][_0xee20('0x3f')]){_0x5c2079[_0xee20('0x40')]=[{'all':!![]}];}return db[_0xee20('0x28')][_0xee20('0x41')](_0x5c2079);})[_0xee20('0x23')](function(_0x99fb51){_0x32590b[_0xee20('0x42')]=_0x99fb51;return _0x32590b;})['then'](respondWithFilteredResult(_0xc1462,_0x5c2079))['catch'](handleError(_0xc1462,null));};exports[_0xee20('0x43')]=function(_0x2e9152,_0x197a2c){var _0x8d8094={'raw':![],'where':{'id':_0x2e9152['params']['id']}},_0xa543f0={};_0xa543f0[_0xee20('0x2d')]=_[_0xee20('0x30')](db['SalesforceConfiguration'][_0xee20('0x29')]);_0xa543f0[_0xee20('0x2f')]=_[_0xee20('0x30')](_0x2e9152[_0xee20('0x2f')]);_0xa543f0[_0xee20('0x31')]=_[_0xee20('0x32')](_0xa543f0[_0xee20('0x2d')],_0xa543f0[_0xee20('0x2f')]);_0x8d8094[_0xee20('0x33')]=_['intersection'](_0xa543f0[_0xee20('0x2d')],qs[_0xee20('0x34')](_0x2e9152[_0xee20('0x2f')]['fields']));_0x8d8094[_0xee20('0x33')]=_0x8d8094[_0xee20('0x33')][_0xee20('0x35')]?_0x8d8094[_0xee20('0x33')]:_0xa543f0['model'];if(_0x2e9152['query'][_0xee20('0x3f')]){_0x8d8094[_0xee20('0x40')]=[{'all':!![]}];}_0x8d8094=_['merge']({},_0x8d8094,_0x2e9152[_0xee20('0x3e')]);return db[_0xee20('0x28')]['find'](_0x8d8094)[_0xee20('0x23')](handleEntityNotFound(_0x197a2c,null))['then'](respondWithResult(_0x197a2c,null))['catch'](handleError(_0x197a2c,null));};exports[_0xee20('0x44')]=function(_0xed0968,_0x597d10){return db[_0xee20('0x28')][_0xee20('0x44')](_0xed0968[_0xee20('0x45')],{})[_0xee20('0x23')](respondWithResult(_0x597d10,0xc9))[_0xee20('0x46')](handleError(_0x597d10,null));};exports[_0xee20('0x21')]=function(_0x4842aa,_0x177240){if(_0x4842aa[_0xee20('0x45')]['id']){delete _0x4842aa['body']['id'];}return db[_0xee20('0x28')][_0xee20('0x47')]({'where':{'id':_0x4842aa[_0xee20('0x48')]['id']}})[_0xee20('0x23')](handleEntityNotFound(_0x177240,null))['then'](saveUpdates(_0x4842aa['body'],null))[_0xee20('0x23')](respondWithResult(_0x177240,null))[_0xee20('0x46')](handleError(_0x177240,null));};exports[_0xee20('0x22')]=function(_0x2185cd,_0x14608b){return db[_0xee20('0x28')][_0xee20('0x47')]({'where':{'id':_0x2185cd[_0xee20('0x48')]['id']}})[_0xee20('0x23')](handleEntityNotFound(_0x14608b,null))[_0xee20('0x23')](removeEntity(_0x14608b,null))[_0xee20('0x46')](handleError(_0x14608b,null));};exports[_0xee20('0x49')]=function(_0x461ad4,_0x38581c,_0x51ff87){var _0x13e488={};var _0x3931d6={};var _0x31e22b;var _0xda40e0;return db[_0xee20('0x28')]['findOne']({'where':{'id':_0x461ad4[_0xee20('0x48')]['id']}})[_0xee20('0x23')](handleEntityNotFound(_0x38581c,null))[_0xee20('0x23')](function(_0x1c6adc){if(_0x1c6adc){_0x31e22b=_0x1c6adc;_0x3931d6[_0xee20('0x2d')]=_[_0xee20('0x30')](db[_0xee20('0x4a')][_0xee20('0x29')]);_0x3931d6['query']=_[_0xee20('0x30')](_0x461ad4[_0xee20('0x2f')]);_0x3931d6[_0xee20('0x31')]=_[_0xee20('0x32')](_0x3931d6[_0xee20('0x2d')],_0x3931d6[_0xee20('0x2f')]);_0x13e488['attributes']=_['intersection'](_0x3931d6[_0xee20('0x2d')],qs[_0xee20('0x34')](_0x461ad4['query']['fields']));_0x13e488[_0xee20('0x33')]=_0x13e488['attributes'][_0xee20('0x35')]?_0x13e488['attributes']:_0x3931d6['model'];_0x13e488[_0xee20('0x38')]=qs[_0xee20('0x39')](_0x461ad4[_0xee20('0x2f')]['sort']);_0x13e488[_0xee20('0x3a')]=qs[_0xee20('0x31')](_['pick'](_0x461ad4[_0xee20('0x2f')],_0x3931d6[_0xee20('0x31')]));if(_0x461ad4['query'][_0xee20('0x3b')]){_0x13e488[_0xee20('0x3a')]=_[_0xee20('0x3c')](_0x13e488[_0xee20('0x3a')],{'$or':_['map'](_0x13e488[_0xee20('0x33')],function(_0xf58381){var _0x3cea17={};_0x3cea17[_0xf58381]={'$like':'%'+_0x461ad4['query'][_0xee20('0x3b')]+'%'};return _0x3cea17;})});}_0x13e488=_[_0xee20('0x3c')]({},_0x13e488,_0x461ad4[_0xee20('0x3e')]);return _0x31e22b['getFields'](_0x13e488);}})[_0xee20('0x23')](function(_0x4153b6){if(_0x4153b6){_0xda40e0=_0x4153b6[_0xee20('0x35')];if(!_0x461ad4['query'][_0xee20('0x36')]('nolimit')){_0x13e488[_0xee20('0x1e')]=qs[_0xee20('0x1e')](_0x461ad4['query'][_0xee20('0x1e')]);_0x13e488[_0xee20('0x1b')]=qs[_0xee20('0x1b')](_0x461ad4['query']['offset']);}return _0x31e22b[_0xee20('0x49')](_0x13e488);}})[_0xee20('0x23')](function(_0x42e8f5){if(_0x42e8f5){return _0x42e8f5?{'count':_0xda40e0,'rows':_0x42e8f5}:null;}})[_0xee20('0x23')](respondWithResult(_0x38581c,null))[_0xee20('0x46')](handleError(_0x38581c,null));};exports['getSubjects']=function(_0x9e5798,_0x441129,_0x30dd4f){var _0x1b2786={};var _0x32b33f={};var _0x2489e0;var _0x262905;return db[_0xee20('0x28')]['findOne']({'where':{'id':_0x9e5798[_0xee20('0x48')]['id']}})[_0xee20('0x23')](handleEntityNotFound(_0x441129,null))[_0xee20('0x23')](function(_0x5b69ff){if(_0x5b69ff){_0x2489e0=_0x5b69ff;_0x32b33f[_0xee20('0x2d')]=_[_0xee20('0x30')](db['SalesforceField'][_0xee20('0x29')]);_0x32b33f[_0xee20('0x2f')]=_[_0xee20('0x30')](_0x9e5798[_0xee20('0x2f')]);_0x32b33f[_0xee20('0x31')]=_[_0xee20('0x32')](_0x32b33f[_0xee20('0x2d')],_0x32b33f['query']);_0x1b2786[_0xee20('0x33')]=_['intersection'](_0x32b33f['model'],qs['fields'](_0x9e5798['query'][_0xee20('0x34')]));_0x1b2786['attributes']=_0x1b2786[_0xee20('0x33')][_0xee20('0x35')]?_0x1b2786[_0xee20('0x33')]:_0x32b33f[_0xee20('0x2d')];_0x1b2786['order']=qs[_0xee20('0x39')](_0x9e5798[_0xee20('0x2f')][_0xee20('0x39')]);_0x1b2786[_0xee20('0x3a')]=qs[_0xee20('0x31')](_[_0xee20('0x4b')](_0x9e5798[_0xee20('0x2f')],_0x32b33f[_0xee20('0x31')]));if(_0x9e5798[_0xee20('0x2f')][_0xee20('0x3b')]){_0x1b2786[_0xee20('0x3a')]=_[_0xee20('0x3c')](_0x1b2786[_0xee20('0x3a')],{'$or':_[_0xee20('0x2e')](_0x1b2786[_0xee20('0x33')],function(_0x359a40){var _0xa72d01={};_0xa72d01[_0x359a40]={'$like':'%'+_0x9e5798[_0xee20('0x2f')][_0xee20('0x3b')]+'%'};return _0xa72d01;})});}_0x1b2786=_[_0xee20('0x3c')]({},_0x1b2786,_0x9e5798[_0xee20('0x3e')]);return _0x2489e0[_0xee20('0x4c')](_0x1b2786);}})['then'](function(_0x55238e){if(_0x55238e){_0x262905=_0x55238e['length'];if(!_0x9e5798[_0xee20('0x2f')][_0xee20('0x36')](_0xee20('0x37'))){_0x1b2786[_0xee20('0x1e')]=qs[_0xee20('0x1e')](_0x9e5798[_0xee20('0x2f')][_0xee20('0x1e')]);_0x1b2786['offset']=qs[_0xee20('0x1b')](_0x9e5798[_0xee20('0x2f')]['offset']);}return _0x2489e0['getSubjects'](_0x1b2786);}})['then'](function(_0x2129c0){if(_0x2129c0){return _0x2129c0?{'count':_0x262905,'rows':_0x2129c0}:null;}})[_0xee20('0x23')](respondWithResult(_0x441129,null))[_0xee20('0x46')](handleError(_0x441129,null));};exports['getDescriptions']=function(_0x5e602d,_0x546d1e,_0x163826){var _0x3b8150={};var _0xc0ed4c={};var _0x5b67db;var _0x5cdf49;return db[_0xee20('0x28')]['findOne']({'where':{'id':_0x5e602d[_0xee20('0x48')]['id']}})['then'](handleEntityNotFound(_0x546d1e,null))[_0xee20('0x23')](function(_0x2f016c){if(_0x2f016c){_0x5b67db=_0x2f016c;_0xc0ed4c[_0xee20('0x2d')]=_['keys'](db[_0xee20('0x4a')][_0xee20('0x29')]);_0xc0ed4c[_0xee20('0x2f')]=_[_0xee20('0x30')](_0x5e602d['query']);_0xc0ed4c[_0xee20('0x31')]=_[_0xee20('0x32')](_0xc0ed4c['model'],_0xc0ed4c['query']);_0x3b8150[_0xee20('0x33')]=_[_0xee20('0x32')](_0xc0ed4c['model'],qs['fields'](_0x5e602d[_0xee20('0x2f')][_0xee20('0x34')]));_0x3b8150[_0xee20('0x33')]=_0x3b8150[_0xee20('0x33')][_0xee20('0x35')]?_0x3b8150[_0xee20('0x33')]:_0xc0ed4c['model'];_0x3b8150[_0xee20('0x38')]=qs[_0xee20('0x39')](_0x5e602d['query'][_0xee20('0x39')]);_0x3b8150[_0xee20('0x3a')]=qs[_0xee20('0x31')](_[_0xee20('0x4b')](_0x5e602d[_0xee20('0x2f')],_0xc0ed4c[_0xee20('0x31')]));if(_0x5e602d[_0xee20('0x2f')][_0xee20('0x3b')]){_0x3b8150[_0xee20('0x3a')]=_['merge'](_0x3b8150[_0xee20('0x3a')],{'$or':_[_0xee20('0x2e')](_0x3b8150[_0xee20('0x33')],function(_0x55ae10){var _0x2d8866={};_0x2d8866[_0x55ae10]={'$like':'%'+_0x5e602d[_0xee20('0x2f')][_0xee20('0x3b')]+'%'};return _0x2d8866;})});}_0x3b8150=_[_0xee20('0x3c')]({},_0x3b8150,_0x5e602d[_0xee20('0x3e')]);return _0x5b67db['getDescriptions'](_0x3b8150);}})[_0xee20('0x23')](function(_0x5dba11){if(_0x5dba11){_0x5cdf49=_0x5dba11['length'];if(!_0x5e602d[_0xee20('0x2f')][_0xee20('0x36')](_0xee20('0x37'))){_0x3b8150[_0xee20('0x1e')]=qs[_0xee20('0x1e')](_0x5e602d[_0xee20('0x2f')][_0xee20('0x1e')]);_0x3b8150[_0xee20('0x1b')]=qs[_0xee20('0x1b')](_0x5e602d['query']['offset']);}return _0x5b67db['getDescriptions'](_0x3b8150);}})[_0xee20('0x23')](function(_0x235edd){if(_0x235edd){return _0x235edd?{'count':_0x5cdf49,'rows':_0x235edd}:null;}})['then'](respondWithResult(_0x546d1e,null))[_0xee20('0x46')](handleError(_0x546d1e,null));}; \ No newline at end of file +var _0x7a0f=['include','rows','params','includeAll','find','create','body','catch','getFields','findOne','SalesforceField','getSubjects','order','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','SalesforceConfiguration'];(function(_0x1c6179,_0x22db86){var _0x19a57b=function(_0x2fde3e){while(--_0x2fde3e){_0x1c6179['push'](_0x1c6179['shift']());}};_0x19a57b(++_0x22db86);}(_0x7a0f,0x199));var _0xf7a0=function(_0x1a8192,_0x5b5a38){_0x1a8192=_0x1a8192-0x0;var _0x3beeb8=_0x7a0f[_0x1a8192];return _0x3beeb8;};'use strict';var emlformat=require(_0xf7a0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf7a0('0x1'));var jsonpatch=require(_0xf7a0('0x2'));var rp=require(_0xf7a0('0x3'));var moment=require(_0xf7a0('0x4'));var BPromise=require(_0xf7a0('0x5'));var Mustache=require(_0xf7a0('0x6'));var util=require(_0xf7a0('0x7'));var path=require('path');var sox=require(_0xf7a0('0x8'));var csv=require(_0xf7a0('0x9'));var ejs=require(_0xf7a0('0xa'));var fs=require('fs');var fs_extra=require(_0xf7a0('0xb'));var _=require(_0xf7a0('0xc'));var squel=require('squel');var crypto=require(_0xf7a0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf7a0('0xe'));var toCsv=require(_0xf7a0('0x9'));var querystring=require(_0xf7a0('0xf'));var Papa=require(_0xf7a0('0x10'));var Redis=require('ioredis');var authService=require(_0xf7a0('0x11'));var qs=require(_0xf7a0('0x12'));var as=require(_0xf7a0('0x13'));var hardwareService=require(_0xf7a0('0x14'));var logger=require(_0xf7a0('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xf7a0('0x16'));var licenseUtil=require(_0xf7a0('0x17'));var db=require(_0xf7a0('0x18'))['db'];function respondWithStatusCode(_0x11dddf,_0x39f9be){_0x39f9be=_0x39f9be||0xcc;return function(_0x385fe7){if(_0x385fe7){return _0x11dddf[_0xf7a0('0x19')](_0x39f9be);}return _0x11dddf[_0xf7a0('0x1a')](_0x39f9be)[_0xf7a0('0x1b')]();};}function respondWithResult(_0xf8c8b6,_0x1eec5d){_0x1eec5d=_0x1eec5d||0xc8;return function(_0x379e6a){if(_0x379e6a){return _0xf8c8b6[_0xf7a0('0x1a')](_0x1eec5d)[_0xf7a0('0x1c')](_0x379e6a);}};}function respondWithFilteredResult(_0x5027b5,_0x51062d){return function(_0x4a352b){if(_0x4a352b){var _0x1e91de=typeof _0x51062d[_0xf7a0('0x1d')]===_0xf7a0('0x1e')&&typeof _0x51062d[_0xf7a0('0x1f')]==='undefined';var _0x3d7288=_0x4a352b['count'];var _0x5bafd8=_0x1e91de?0x0:_0x51062d[_0xf7a0('0x1d')];var _0x291da9=_0x1e91de?_0x4a352b[_0xf7a0('0x20')]:_0x51062d[_0xf7a0('0x1d')]+_0x51062d[_0xf7a0('0x1f')];var _0x4f0228;if(_0x291da9>=_0x3d7288){_0x291da9=_0x3d7288;_0x4f0228=0xc8;}else{_0x4f0228=0xce;}_0x5027b5[_0xf7a0('0x1a')](_0x4f0228);return _0x5027b5[_0xf7a0('0x21')](_0xf7a0('0x22'),_0x5bafd8+'-'+_0x291da9+'/'+_0x3d7288)[_0xf7a0('0x1c')](_0x4a352b);}return null;};}function patchUpdates(_0x2dda3c){return function(_0x530ae5){try{jsonpatch[_0xf7a0('0x23')](_0x530ae5,_0x2dda3c,!![]);}catch(_0x315f0f){return BPromise[_0xf7a0('0x24')](_0x315f0f);}return _0x530ae5[_0xf7a0('0x25')]();};}function saveUpdates(_0x1b094b,_0x83ca17){return function(_0x41c6f8){if(_0x41c6f8){return _0x41c6f8[_0xf7a0('0x26')](_0x1b094b)[_0xf7a0('0x27')](function(_0x14bcc4){return _0x14bcc4;});}return null;};}function removeEntity(_0x1613e0,_0x3a3f35){return function(_0x1204d6){if(_0x1204d6){return _0x1204d6[_0xf7a0('0x28')]()[_0xf7a0('0x27')](function(){_0x1613e0[_0xf7a0('0x1a')](0xcc)[_0xf7a0('0x1b')]();});}};}function handleEntityNotFound(_0x33ac90,_0x3cf1c1){return function(_0x4231d5){if(!_0x4231d5){_0x33ac90['sendStatus'](0x194);}return _0x4231d5;};}function handleError(_0x10acb3,_0x813305){_0x813305=_0x813305||0x1f4;return function(_0x32dc68){logger['error'](_0x32dc68['stack']);if(_0x32dc68['name']){delete _0x32dc68[_0xf7a0('0x29')];}_0x10acb3[_0xf7a0('0x1a')](_0x813305)['send'](_0x32dc68);};}exports['index']=function(_0x3d418a,_0x2038b3){var _0x218983={},_0x53bfe0={},_0x365cbd={'count':0x0,'rows':[]};var _0x3c5e51=_[_0xf7a0('0x2a')](db['SalesforceConfiguration'][_0xf7a0('0x2b')],function(_0x34e7f4){return{'name':_0x34e7f4[_0xf7a0('0x2c')],'type':_0x34e7f4[_0xf7a0('0x2d')][_0xf7a0('0x2e')]};});_0x53bfe0['model']=_['map'](_0x3c5e51,_0xf7a0('0x29'));_0x53bfe0[_0xf7a0('0x2f')]=_[_0xf7a0('0x30')](_0x3d418a['query']);_0x53bfe0[_0xf7a0('0x31')]=_[_0xf7a0('0x32')](_0x53bfe0[_0xf7a0('0x33')],_0x53bfe0[_0xf7a0('0x2f')]);_0x218983[_0xf7a0('0x34')]=_['intersection'](_0x53bfe0['model'],qs['fields'](_0x3d418a[_0xf7a0('0x2f')][_0xf7a0('0x35')]));_0x218983[_0xf7a0('0x34')]=_0x218983['attributes'][_0xf7a0('0x36')]?_0x218983[_0xf7a0('0x34')]:_0x53bfe0[_0xf7a0('0x33')];if(!_0x3d418a[_0xf7a0('0x2f')][_0xf7a0('0x37')](_0xf7a0('0x38'))){_0x218983['limit']=qs['limit'](_0x3d418a[_0xf7a0('0x2f')]['limit']);_0x218983[_0xf7a0('0x1d')]=qs[_0xf7a0('0x1d')](_0x3d418a['query'][_0xf7a0('0x1d')]);}_0x218983['order']=qs[_0xf7a0('0x39')](_0x3d418a['query'][_0xf7a0('0x39')]);_0x218983['where']=qs[_0xf7a0('0x31')](_[_0xf7a0('0x3a')](_0x3d418a[_0xf7a0('0x2f')],_0x53bfe0[_0xf7a0('0x31')]),_0x3c5e51);if(_0x3d418a['query'][_0xf7a0('0x3b')]){_0x218983[_0xf7a0('0x3c')]=_[_0xf7a0('0x3d')](_0x218983[_0xf7a0('0x3c')],{'$or':_['map'](_0x3c5e51,function(_0x2b4f37){if(_0x2b4f37[_0xf7a0('0x2d')]!==_0xf7a0('0x3e')){var _0x5e5452={};_0x5e5452[_0x2b4f37[_0xf7a0('0x29')]]={'$like':'%'+_0x3d418a[_0xf7a0('0x2f')][_0xf7a0('0x3b')]+'%'};return _0x5e5452;}})});}_0x218983=_[_0xf7a0('0x3d')]({},_0x218983,_0x3d418a[_0xf7a0('0x3f')]);var _0x51c165={'where':_0x218983[_0xf7a0('0x3c')]};return db[_0xf7a0('0x40')][_0xf7a0('0x20')](_0x51c165)[_0xf7a0('0x27')](function(_0x513b6b){_0x365cbd['count']=_0x513b6b;if(_0x3d418a['query']['includeAll']){_0x218983[_0xf7a0('0x41')]=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x218983);})[_0xf7a0('0x27')](function(_0x1a0d4c){_0x365cbd[_0xf7a0('0x42')]=_0x1a0d4c;return _0x365cbd;})[_0xf7a0('0x27')](respondWithFilteredResult(_0x2038b3,_0x218983))['catch'](handleError(_0x2038b3,null));};exports['show']=function(_0x280b97,_0xce25c0){var _0xc9dbb4={'raw':![],'where':{'id':_0x280b97[_0xf7a0('0x43')]['id']}},_0x477913={};_0x477913[_0xf7a0('0x33')]=_[_0xf7a0('0x30')](db[_0xf7a0('0x40')][_0xf7a0('0x2b')]);_0x477913[_0xf7a0('0x2f')]=_[_0xf7a0('0x30')](_0x280b97[_0xf7a0('0x2f')]);_0x477913[_0xf7a0('0x31')]=_[_0xf7a0('0x32')](_0x477913[_0xf7a0('0x33')],_0x477913[_0xf7a0('0x2f')]);_0xc9dbb4[_0xf7a0('0x34')]=_['intersection'](_0x477913[_0xf7a0('0x33')],qs['fields'](_0x280b97[_0xf7a0('0x2f')][_0xf7a0('0x35')]));_0xc9dbb4[_0xf7a0('0x34')]=_0xc9dbb4[_0xf7a0('0x34')][_0xf7a0('0x36')]?_0xc9dbb4[_0xf7a0('0x34')]:_0x477913['model'];if(_0x280b97[_0xf7a0('0x2f')][_0xf7a0('0x44')]){_0xc9dbb4[_0xf7a0('0x41')]=[{'all':!![]}];}_0xc9dbb4=_[_0xf7a0('0x3d')]({},_0xc9dbb4,_0x280b97[_0xf7a0('0x3f')]);return db['SalesforceConfiguration'][_0xf7a0('0x45')](_0xc9dbb4)[_0xf7a0('0x27')](handleEntityNotFound(_0xce25c0,null))[_0xf7a0('0x27')](respondWithResult(_0xce25c0,null))['catch'](handleError(_0xce25c0,null));};exports[_0xf7a0('0x46')]=function(_0x501f87,_0x5ade39){return db[_0xf7a0('0x40')][_0xf7a0('0x46')](_0x501f87[_0xf7a0('0x47')],{})[_0xf7a0('0x27')](respondWithResult(_0x5ade39,0xc9))[_0xf7a0('0x48')](handleError(_0x5ade39,null));};exports[_0xf7a0('0x26')]=function(_0xeb2e48,_0x33f53a){if(_0xeb2e48[_0xf7a0('0x47')]['id']){delete _0xeb2e48[_0xf7a0('0x47')]['id'];}return db[_0xf7a0('0x40')][_0xf7a0('0x45')]({'where':{'id':_0xeb2e48[_0xf7a0('0x43')]['id']}})['then'](handleEntityNotFound(_0x33f53a,null))[_0xf7a0('0x27')](saveUpdates(_0xeb2e48['body'],null))[_0xf7a0('0x27')](respondWithResult(_0x33f53a,null))['catch'](handleError(_0x33f53a,null));};exports['destroy']=function(_0x41978f,_0x4979d2){return db[_0xf7a0('0x40')]['find']({'where':{'id':_0x41978f[_0xf7a0('0x43')]['id']}})['then'](handleEntityNotFound(_0x4979d2,null))['then'](removeEntity(_0x4979d2,null))['catch'](handleError(_0x4979d2,null));};exports[_0xf7a0('0x49')]=function(_0x2584b3,_0x471d4b,_0x3e19a3){var _0xab7371={};var _0xe3e945={};var _0x40a286;var _0x129871;return db[_0xf7a0('0x40')][_0xf7a0('0x4a')]({'where':{'id':_0x2584b3[_0xf7a0('0x43')]['id']}})['then'](handleEntityNotFound(_0x471d4b,null))[_0xf7a0('0x27')](function(_0x23a6d0){if(_0x23a6d0){_0x40a286=_0x23a6d0;_0xe3e945['model']=_['keys'](db[_0xf7a0('0x4b')][_0xf7a0('0x2b')]);_0xe3e945[_0xf7a0('0x2f')]=_['keys'](_0x2584b3[_0xf7a0('0x2f')]);_0xe3e945[_0xf7a0('0x31')]=_['intersection'](_0xe3e945[_0xf7a0('0x33')],_0xe3e945[_0xf7a0('0x2f')]);_0xab7371[_0xf7a0('0x34')]=_[_0xf7a0('0x32')](_0xe3e945[_0xf7a0('0x33')],qs[_0xf7a0('0x35')](_0x2584b3[_0xf7a0('0x2f')][_0xf7a0('0x35')]));_0xab7371[_0xf7a0('0x34')]=_0xab7371[_0xf7a0('0x34')][_0xf7a0('0x36')]?_0xab7371['attributes']:_0xe3e945['model'];_0xab7371['order']=qs[_0xf7a0('0x39')](_0x2584b3[_0xf7a0('0x2f')][_0xf7a0('0x39')]);_0xab7371[_0xf7a0('0x3c')]=qs[_0xf7a0('0x31')](_[_0xf7a0('0x3a')](_0x2584b3['query'],_0xe3e945[_0xf7a0('0x31')]));if(_0x2584b3[_0xf7a0('0x2f')][_0xf7a0('0x3b')]){_0xab7371[_0xf7a0('0x3c')]=_['merge'](_0xab7371['where'],{'$or':_['map'](_0xab7371['attributes'],function(_0x321e91){var _0x25636e={};_0x25636e[_0x321e91]={'$like':'%'+_0x2584b3[_0xf7a0('0x2f')][_0xf7a0('0x3b')]+'%'};return _0x25636e;})});}_0xab7371=_['merge']({},_0xab7371,_0x2584b3['options']);return _0x40a286[_0xf7a0('0x49')](_0xab7371);}})[_0xf7a0('0x27')](function(_0x285187){if(_0x285187){_0x129871=_0x285187[_0xf7a0('0x36')];if(!_0x2584b3[_0xf7a0('0x2f')]['hasOwnProperty'](_0xf7a0('0x38'))){_0xab7371[_0xf7a0('0x1f')]=qs[_0xf7a0('0x1f')](_0x2584b3['query'][_0xf7a0('0x1f')]);_0xab7371[_0xf7a0('0x1d')]=qs[_0xf7a0('0x1d')](_0x2584b3[_0xf7a0('0x2f')]['offset']);}return _0x40a286[_0xf7a0('0x49')](_0xab7371);}})[_0xf7a0('0x27')](function(_0xdbede9){if(_0xdbede9){return _0xdbede9?{'count':_0x129871,'rows':_0xdbede9}:null;}})['then'](respondWithResult(_0x471d4b,null))[_0xf7a0('0x48')](handleError(_0x471d4b,null));};exports[_0xf7a0('0x4c')]=function(_0x5cb2e0,_0x4c7729,_0x5d55a6){var _0x2a9363={};var _0xce3d8c={};var _0x21c02f;var _0x49afe5;return db[_0xf7a0('0x40')]['findOne']({'where':{'id':_0x5cb2e0[_0xf7a0('0x43')]['id']}})[_0xf7a0('0x27')](handleEntityNotFound(_0x4c7729,null))['then'](function(_0x543aa3){if(_0x543aa3){_0x21c02f=_0x543aa3;_0xce3d8c[_0xf7a0('0x33')]=_[_0xf7a0('0x30')](db[_0xf7a0('0x4b')][_0xf7a0('0x2b')]);_0xce3d8c['query']=_[_0xf7a0('0x30')](_0x5cb2e0[_0xf7a0('0x2f')]);_0xce3d8c[_0xf7a0('0x31')]=_[_0xf7a0('0x32')](_0xce3d8c['model'],_0xce3d8c[_0xf7a0('0x2f')]);_0x2a9363['attributes']=_['intersection'](_0xce3d8c[_0xf7a0('0x33')],qs[_0xf7a0('0x35')](_0x5cb2e0['query']['fields']));_0x2a9363[_0xf7a0('0x34')]=_0x2a9363['attributes'][_0xf7a0('0x36')]?_0x2a9363[_0xf7a0('0x34')]:_0xce3d8c[_0xf7a0('0x33')];_0x2a9363['order']=qs['sort'](_0x5cb2e0[_0xf7a0('0x2f')][_0xf7a0('0x39')]);_0x2a9363['where']=qs[_0xf7a0('0x31')](_[_0xf7a0('0x3a')](_0x5cb2e0[_0xf7a0('0x2f')],_0xce3d8c[_0xf7a0('0x31')]));if(_0x5cb2e0[_0xf7a0('0x2f')][_0xf7a0('0x3b')]){_0x2a9363[_0xf7a0('0x3c')]=_[_0xf7a0('0x3d')](_0x2a9363[_0xf7a0('0x3c')],{'$or':_[_0xf7a0('0x2a')](_0x2a9363[_0xf7a0('0x34')],function(_0x3fabe6){var _0x166b77={};_0x166b77[_0x3fabe6]={'$like':'%'+_0x5cb2e0['query']['filter']+'%'};return _0x166b77;})});}_0x2a9363=_[_0xf7a0('0x3d')]({},_0x2a9363,_0x5cb2e0['options']);return _0x21c02f[_0xf7a0('0x4c')](_0x2a9363);}})['then'](function(_0x479b59){if(_0x479b59){_0x49afe5=_0x479b59['length'];if(!_0x5cb2e0[_0xf7a0('0x2f')]['hasOwnProperty'](_0xf7a0('0x38'))){_0x2a9363[_0xf7a0('0x1f')]=qs[_0xf7a0('0x1f')](_0x5cb2e0[_0xf7a0('0x2f')][_0xf7a0('0x1f')]);_0x2a9363['offset']=qs[_0xf7a0('0x1d')](_0x5cb2e0['query'][_0xf7a0('0x1d')]);}return _0x21c02f[_0xf7a0('0x4c')](_0x2a9363);}})[_0xf7a0('0x27')](function(_0x5ee8d8){if(_0x5ee8d8){return _0x5ee8d8?{'count':_0x49afe5,'rows':_0x5ee8d8}:null;}})[_0xf7a0('0x27')](respondWithResult(_0x4c7729,null))[_0xf7a0('0x48')](handleError(_0x4c7729,null));};exports['getDescriptions']=function(_0x2e75c4,_0x436d07,_0x3854c1){var _0x5719da={};var _0x240773={};var _0x3d46fd;var _0x13c61e;return db[_0xf7a0('0x40')]['findOne']({'where':{'id':_0x2e75c4[_0xf7a0('0x43')]['id']}})[_0xf7a0('0x27')](handleEntityNotFound(_0x436d07,null))[_0xf7a0('0x27')](function(_0x3d2c6d){if(_0x3d2c6d){_0x3d46fd=_0x3d2c6d;_0x240773['model']=_['keys'](db[_0xf7a0('0x4b')][_0xf7a0('0x2b')]);_0x240773[_0xf7a0('0x2f')]=_[_0xf7a0('0x30')](_0x2e75c4[_0xf7a0('0x2f')]);_0x240773[_0xf7a0('0x31')]=_[_0xf7a0('0x32')](_0x240773[_0xf7a0('0x33')],_0x240773[_0xf7a0('0x2f')]);_0x5719da[_0xf7a0('0x34')]=_[_0xf7a0('0x32')](_0x240773[_0xf7a0('0x33')],qs[_0xf7a0('0x35')](_0x2e75c4[_0xf7a0('0x2f')][_0xf7a0('0x35')]));_0x5719da[_0xf7a0('0x34')]=_0x5719da['attributes']['length']?_0x5719da[_0xf7a0('0x34')]:_0x240773[_0xf7a0('0x33')];_0x5719da[_0xf7a0('0x4d')]=qs[_0xf7a0('0x39')](_0x2e75c4[_0xf7a0('0x2f')][_0xf7a0('0x39')]);_0x5719da[_0xf7a0('0x3c')]=qs[_0xf7a0('0x31')](_[_0xf7a0('0x3a')](_0x2e75c4[_0xf7a0('0x2f')],_0x240773[_0xf7a0('0x31')]));if(_0x2e75c4['query'][_0xf7a0('0x3b')]){_0x5719da[_0xf7a0('0x3c')]=_[_0xf7a0('0x3d')](_0x5719da['where'],{'$or':_['map'](_0x5719da['attributes'],function(_0x8bfb1d){var _0x1f39e9={};_0x1f39e9[_0x8bfb1d]={'$like':'%'+_0x2e75c4[_0xf7a0('0x2f')][_0xf7a0('0x3b')]+'%'};return _0x1f39e9;})});}_0x5719da=_['merge']({},_0x5719da,_0x2e75c4[_0xf7a0('0x3f')]);return _0x3d46fd[_0xf7a0('0x4e')](_0x5719da);}})[_0xf7a0('0x27')](function(_0xe75d6c){if(_0xe75d6c){_0x13c61e=_0xe75d6c[_0xf7a0('0x36')];if(!_0x2e75c4[_0xf7a0('0x2f')][_0xf7a0('0x37')](_0xf7a0('0x38'))){_0x5719da[_0xf7a0('0x1f')]=qs[_0xf7a0('0x1f')](_0x2e75c4[_0xf7a0('0x2f')][_0xf7a0('0x1f')]);_0x5719da[_0xf7a0('0x1d')]=qs[_0xf7a0('0x1d')](_0x2e75c4[_0xf7a0('0x2f')][_0xf7a0('0x1d')]);}return _0x3d46fd[_0xf7a0('0x4e')](_0x5719da);}})[_0xf7a0('0x27')](function(_0x15189d){if(_0x15189d){return _0x15189d?{'count':_0x13c61e,'rows':_0x15189d}:null;}})[_0xf7a0('0x27')](respondWithResult(_0x436d07,null))[_0xf7a0('0x48')](handleError(_0x436d07,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 8936b1d..380508d 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 _0x3fe1=['path','../../config/environment','./intSalesforceConfiguration.attributes','define','int_salesforce_configurations','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x15a9a6,_0x248af4){var _0x31ac7d=function(_0x3e4805){while(--_0x3e4805){_0x15a9a6['push'](_0x15a9a6['shift']());}};_0x31ac7d(++_0x248af4);}(_0x3fe1,0x89));var _0x13fe=function(_0x2cf702,_0x333323){_0x2cf702=_0x2cf702-0x0;var _0x15f7a6=_0x3fe1[_0x2cf702];return _0x15f7a6;};'use strict';var _=require('lodash');var util=require(_0x13fe('0x0'));var logger=require(_0x13fe('0x1'))(_0x13fe('0x2'));var moment=require(_0x13fe('0x3'));var BPromise=require(_0x13fe('0x4'));var rp=require(_0x13fe('0x5'));var fs=require('fs');var path=require(_0x13fe('0x6'));var rimraf=require('rimraf');var config=require(_0x13fe('0x7'));var attributes=require(_0x13fe('0x8'));module['exports']=function(_0x3d9bd4,_0x5d9ad0){return _0x3d9bd4[_0x13fe('0x9')]('SalesforceConfiguration',attributes,{'tableName':_0x13fe('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5720=['../../config/environment','./intSalesforceConfiguration.attributes','exports','define','util','../../config/logger','api','moment','path'];(function(_0x3ee685,_0x1fa765){var _0x134805=function(_0x5131fe){while(--_0x5131fe){_0x3ee685['push'](_0x3ee685['shift']());}};_0x134805(++_0x1fa765);}(_0x5720,0x1e1));var _0x0572=function(_0x114a4c,_0x6fe14d){_0x114a4c=_0x114a4c-0x0;var _0x52b16a=_0x5720[_0x114a4c];return _0x52b16a;};'use strict';var _=require('lodash');var util=require(_0x0572('0x0'));var logger=require(_0x0572('0x1'))(_0x0572('0x2'));var moment=require(_0x0572('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0572('0x4'));var rimraf=require('rimraf');var config=require(_0x0572('0x5'));var attributes=require(_0x0572('0x6'));module[_0x0572('0x7')]=function(_0x2cba4e,_0x4879a5){return _0x2cba4e[_0x0572('0x8')]('SalesforceConfiguration',attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 0ac6fdb..e026521 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 _0x742d=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','bluebird'];(function(_0x5086cc,_0x1bb540){var _0x31f681=function(_0x8f77ad){while(--_0x8f77ad){_0x5086cc['push'](_0x5086cc['shift']());}};_0x31f681(++_0x1bb540);}(_0x742d,0x129));var _0xd742=function(_0x492ec1,_0x1b62bd){_0x492ec1=_0x492ec1-0x0;var _0x4cfb7e=_0x742d[_0x492ec1];return _0x4cfb7e;};'use strict';var _=require(_0xd742('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd742('0x1'));var rs=require(_0xd742('0x2'));var fs=require('fs');var Redis=require(_0xd742('0x3'));var db=require(_0xd742('0x4'))['db'];var utils=require(_0xd742('0x5'));var logger=require(_0xd742('0x6'))('rpc');var config=require(_0xd742('0x7'));var jayson=require(_0xd742('0x8'));var client=jayson[_0xd742('0x9')][_0xd742('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a033e,_0x1bd39f,_0x2a895e){return new BPromise(function(_0x4f7790,_0x5605cf){return client[_0xd742('0xb')](_0x1a033e,_0x2a895e)[_0xd742('0xc')](function(_0x2d1e77){logger[_0xd742('0xd')](_0xd742('0xe'),_0x1bd39f,_0xd742('0xf'));logger[_0xd742('0x10')](_0xd742('0x11'),_0x1bd39f,_0xd742('0xf'),JSON['stringify'](_0x2d1e77));if(_0x2d1e77[_0xd742('0x12')]){if(_0x2d1e77[_0xd742('0x12')][_0xd742('0x13')]===0x1f4){logger[_0xd742('0x12')](_0xd742('0xe'),_0x1bd39f,_0x2d1e77[_0xd742('0x12')][_0xd742('0x14')]);return _0x5605cf(_0x2d1e77['error'][_0xd742('0x14')]);}logger['error'](_0xd742('0xe'),_0x1bd39f,_0x2d1e77['error'][_0xd742('0x14')]);return _0x4f7790(_0x2d1e77[_0xd742('0x12')][_0xd742('0x14')]);}else{logger[_0xd742('0xd')](_0xd742('0xe'),_0x1bd39f,_0xd742('0xf'));_0x4f7790(_0x2d1e77[_0xd742('0x15')][_0xd742('0x14')]);}})[_0xd742('0x16')](function(_0x442f86){logger[_0xd742('0x12')](_0xd742('0xe'),_0x1bd39f,_0x442f86);_0x5605cf(_0x442f86);});});} \ No newline at end of file +var _0x3c7c=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x5e1d09,_0x4dc6d8){var _0x1f82e5=function(_0x5ed307){while(--_0x5ed307){_0x5e1d09['push'](_0x5e1d09['shift']());}};_0x1f82e5(++_0x4dc6d8);}(_0x3c7c,0xdd));var _0xc3c7=function(_0x47e92b,_0x29e3b5){_0x47e92b=_0x47e92b-0x0;var _0x2da694=_0x3c7c[_0x47e92b];return _0x2da694;};'use strict';var _=require(_0xc3c7('0x0'));var util=require(_0xc3c7('0x1'));var moment=require(_0xc3c7('0x2'));var BPromise=require(_0xc3c7('0x3'));var rs=require(_0xc3c7('0x4'));var fs=require('fs');var Redis=require(_0xc3c7('0x5'));var db=require(_0xc3c7('0x6'))['db'];var utils=require(_0xc3c7('0x7'));var logger=require(_0xc3c7('0x8'))(_0xc3c7('0x9'));var config=require(_0xc3c7('0xa'));var jayson=require(_0xc3c7('0xb'));var client=jayson[_0xc3c7('0xc')][_0xc3c7('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x448a48,_0x581559,_0x525fdf){return new BPromise(function(_0x3a2968,_0x2fe00e){return client['request'](_0x448a48,_0x525fdf)[_0xc3c7('0xe')](function(_0x2fb2bf){logger[_0xc3c7('0xf')](_0xc3c7('0x10'),_0x581559,_0xc3c7('0x11'));logger[_0xc3c7('0x12')](_0xc3c7('0x13'),_0x581559,_0xc3c7('0x11'),JSON[_0xc3c7('0x14')](_0x2fb2bf));if(_0x2fb2bf[_0xc3c7('0x15')]){if(_0x2fb2bf[_0xc3c7('0x15')][_0xc3c7('0x16')]===0x1f4){logger['error'](_0xc3c7('0x10'),_0x581559,_0x2fb2bf[_0xc3c7('0x15')][_0xc3c7('0x17')]);return _0x2fe00e(_0x2fb2bf[_0xc3c7('0x15')][_0xc3c7('0x17')]);}logger['error'](_0xc3c7('0x10'),_0x581559,_0x2fb2bf[_0xc3c7('0x15')][_0xc3c7('0x17')]);return _0x3a2968(_0x2fb2bf['error'][_0xc3c7('0x17')]);}else{logger[_0xc3c7('0xf')](_0xc3c7('0x10'),_0x581559,_0xc3c7('0x11'));_0x3a2968(_0x2fb2bf['result'][_0xc3c7('0x17')]);}})[_0xc3c7('0x18')](function(_0x68d1fd){logger[_0xc3c7('0x15')](_0xc3c7('0x10'),_0x581559,_0x68d1fd);_0x2fe00e(_0x68d1fd);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 173c81a..80517fc 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 _0x95e8=['post','create','put','update','delete','destroy','exports','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show'];(function(_0xa9eded,_0x5b8466){var _0x1d0bd4=function(_0x34b9fe){while(--_0x34b9fe){_0xa9eded['push'](_0xa9eded['shift']());}};_0x1d0bd4(++_0x5b8466);}(_0x95e8,0x1d3));var _0x895e=function(_0x43aa48,_0x598d9d){_0x43aa48=_0x43aa48-0x0;var _0x3977fc=_0x95e8[_0x43aa48];return _0x3977fc;};'use strict';var multer=require('multer');var util=require(_0x895e('0x0'));var path=require('path');var timeout=require(_0x895e('0x1'));var express=require(_0x895e('0x2'));var router=express['Router']();var fs_extra=require(_0x895e('0x3'));var auth=require(_0x895e('0x4'));var interaction=require(_0x895e('0x5'));var config=require(_0x895e('0x6'));var controller=require(_0x895e('0x7'));router[_0x895e('0x8')]('/',auth[_0x895e('0x9')](),controller[_0x895e('0xa')]);router[_0x895e('0x8')](_0x895e('0xb'),auth['isAuthenticated'](),controller[_0x895e('0xc')]);router[_0x895e('0xd')]('/',auth[_0x895e('0x9')](),controller[_0x895e('0xe')]);router[_0x895e('0xf')]('/:id',auth[_0x895e('0x9')](),controller[_0x895e('0x10')]);router[_0x895e('0x11')](_0x895e('0xb'),auth[_0x895e('0x9')](),controller[_0x895e('0x12')]);module[_0x895e('0x13')]=router; \ No newline at end of file +var _0x35ad=['isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get'];(function(_0x55c702,_0x4da20b){var _0x532488=function(_0xf16cf0){while(--_0xf16cf0){_0x55c702['push'](_0x55c702['shift']());}};_0x532488(++_0x4da20b);}(_0x35ad,0x1df));var _0xd35a=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x35ad[_0x3070dc];return _0x431489;};'use strict';var multer=require(_0xd35a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd35a('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd35a('0x2'));var interaction=require(_0xd35a('0x3'));var config=require(_0xd35a('0x4'));var controller=require(_0xd35a('0x5'));router[_0xd35a('0x6')]('/',auth[_0xd35a('0x7')](),controller[_0xd35a('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd35a('0x9')]);router[_0xd35a('0xa')]('/',auth[_0xd35a('0x7')](),controller[_0xd35a('0xb')]);router[_0xd35a('0xc')](_0xd35a('0xd'),auth[_0xd35a('0x7')](),controller[_0xd35a('0xe')]);router[_0xd35a('0xf')](_0xd35a('0xd'),auth[_0xd35a('0x7')](),controller[_0xd35a('0x10')]);module[_0xd35a('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index aa3e805..0628c50 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 _0xd7d1=['exports','ENUM','variable','customVariable','STRING','string'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd7d1,0x1c8));var _0x1d7d=function(_0x1d84db,_0x168501){_0x1d84db=_0x1d84db-0x0;var _0x3fdd4c=_0xd7d1[_0x1d84db];return _0x3fdd4c;};'use strict';var Sequelize=require('sequelize');module[_0x1d7d('0x0')]={'type':{'type':Sequelize[_0x1d7d('0x1')]('string',_0x1d7d('0x2'),_0x1d7d('0x3'),'keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x1d7d('0x4')]},'key':{'type':Sequelize[_0x1d7d('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0x1d7d('0x5'),_0x1d7d('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x1d7d('0x4')]},'idField':{'type':Sequelize[_0x1d7d('0x4')]},'variableName':{'type':Sequelize[_0x1d7d('0x4')]}}; \ No newline at end of file +var _0xcac0=['customVariable','keyValue','picklist','string','STRING','sequelize','exports','ENUM','variable'];(function(_0x1b6566,_0x1073ca){var _0x3d2fdd=function(_0x2e0028){while(--_0x2e0028){_0x1b6566['push'](_0x1b6566['shift']());}};_0x3d2fdd(++_0x1073ca);}(_0xcac0,0x137));var _0x0cac=function(_0x1cc7a7,_0xd98320){_0x1cc7a7=_0x1cc7a7-0x0;var _0x219b15=_0xcac0[_0x1cc7a7];return _0x219b15;};'use strict';var Sequelize=require(_0x0cac('0x0'));module[_0x0cac('0x1')]={'type':{'type':Sequelize[_0x0cac('0x2')]('string',_0x0cac('0x3'),_0x0cac('0x4'),_0x0cac('0x5'),_0x0cac('0x6')),'defaultValue':_0x0cac('0x7')},'content':{'type':Sequelize[_0x0cac('0x8')]},'key':{'type':Sequelize[_0x0cac('0x8')]},'keyType':{'type':Sequelize[_0x0cac('0x2')](_0x0cac('0x7'),_0x0cac('0x3'),_0x0cac('0x4'))},'keyContent':{'type':Sequelize[_0x0cac('0x8')]},'idField':{'type':Sequelize[_0x0cac('0x8')]},'variableName':{'type':Sequelize[_0x0cac('0x8')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 9bd2d6d..10371dc 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 _0x3140=['attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set','reject','update','then','destroy','end','stack','index','SalesforceField','rawAttributes','model','map','name','query','keys','filters','intersection'];(function(_0x41b875,_0x48a4f7){var _0x64b6ad=function(_0x1224e5){while(--_0x1224e5){_0x41b875['push'](_0x41b875['shift']());}};_0x64b6ad(++_0x48a4f7);}(_0x3140,0xee));var _0x0314=function(_0x24a15e,_0x4862ce){_0x24a15e=_0x24a15e-0x0;var _0x10256f=_0x3140[_0x24a15e];return _0x10256f;};'use strict';var emlformat=require(_0x0314('0x0'));var rimraf=require(_0x0314('0x1'));var zipdir=require(_0x0314('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0314('0x3'));var moment=require(_0x0314('0x4'));var BPromise=require(_0x0314('0x5'));var Mustache=require(_0x0314('0x6'));var util=require(_0x0314('0x7'));var path=require(_0x0314('0x8'));var sox=require(_0x0314('0x9'));var csv=require(_0x0314('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0314('0xb'));var _=require(_0x0314('0xc'));var squel=require(_0x0314('0xd'));var crypto=require(_0x0314('0xe'));var jsforce=require(_0x0314('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0314('0xa'));var querystring=require('querystring');var Papa=require(_0x0314('0x10'));var Redis=require(_0x0314('0x11'));var authService=require(_0x0314('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0314('0x13'));var hardwareService=require(_0x0314('0x14'));var logger=require(_0x0314('0x15'))(_0x0314('0x16'));var utils=require(_0x0314('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x0314('0x18'));var db=require(_0x0314('0x19'))['db'];function respondWithStatusCode(_0x192a28,_0x181feb){_0x181feb=_0x181feb||0xcc;return function(_0x2a9f94){if(_0x2a9f94){return _0x192a28[_0x0314('0x1a')](_0x181feb);}return _0x192a28[_0x0314('0x1b')](_0x181feb)['end']();};}function respondWithResult(_0x34b9c4,_0x40711a){_0x40711a=_0x40711a||0xc8;return function(_0x2e4791){if(_0x2e4791){return _0x34b9c4[_0x0314('0x1b')](_0x40711a)[_0x0314('0x1c')](_0x2e4791);}};}function respondWithFilteredResult(_0x3a7799,_0x10ef70){return function(_0x3bb321){if(_0x3bb321){var _0x17bcde=typeof _0x10ef70['offset']===_0x0314('0x1d')&&typeof _0x10ef70[_0x0314('0x1e')]==='undefined';var _0x430d1a=_0x3bb321['count'];var _0x3500a8=_0x17bcde?0x0:_0x10ef70[_0x0314('0x1f')];var _0x2f5a9f=_0x17bcde?_0x3bb321[_0x0314('0x20')]:_0x10ef70[_0x0314('0x1f')]+_0x10ef70[_0x0314('0x1e')];var _0x4878e2;if(_0x2f5a9f>=_0x430d1a){_0x2f5a9f=_0x430d1a;_0x4878e2=0xc8;}else{_0x4878e2=0xce;}_0x3a7799[_0x0314('0x1b')](_0x4878e2);return _0x3a7799[_0x0314('0x21')]('Content-Range',_0x3500a8+'-'+_0x2f5a9f+'/'+_0x430d1a)[_0x0314('0x1c')](_0x3bb321);}return null;};}function patchUpdates(_0x2e429e){return function(_0x545226){try{jsonpatch['apply'](_0x545226,_0x2e429e,!![]);}catch(_0x1fb214){return BPromise[_0x0314('0x22')](_0x1fb214);}return _0x545226['save']();};}function saveUpdates(_0x5958f6,_0x479c68){return function(_0x199b20){if(_0x199b20){return _0x199b20[_0x0314('0x23')](_0x5958f6)[_0x0314('0x24')](function(_0x5cd021){return _0x5cd021;});}return null;};}function removeEntity(_0x319e9d,_0x5298f8){return function(_0x502166){if(_0x502166){return _0x502166[_0x0314('0x25')]()[_0x0314('0x24')](function(){_0x319e9d[_0x0314('0x1b')](0xcc)[_0x0314('0x26')]();});}};}function handleEntityNotFound(_0x17eef1,_0x287d90){return function(_0x392189){if(!_0x392189){_0x17eef1[_0x0314('0x1a')](0x194);}return _0x392189;};}function handleError(_0x2afd67,_0x3766c6){_0x3766c6=_0x3766c6||0x1f4;return function(_0x55127a){logger['error'](_0x55127a[_0x0314('0x27')]);if(_0x55127a['name']){delete _0x55127a['name'];}_0x2afd67[_0x0314('0x1b')](_0x3766c6)['send'](_0x55127a);};}exports[_0x0314('0x28')]=function(_0x369a89,_0x5ac920){var _0x168cca={},_0x1efb37={},_0x4a85cd={'count':0x0,'rows':[]};var _0x1f890d=_['map'](db[_0x0314('0x29')][_0x0314('0x2a')],function(_0x13dc3f){return{'name':_0x13dc3f['fieldName'],'type':_0x13dc3f['type']['key']};});_0x1efb37[_0x0314('0x2b')]=_[_0x0314('0x2c')](_0x1f890d,_0x0314('0x2d'));_0x1efb37[_0x0314('0x2e')]=_[_0x0314('0x2f')](_0x369a89[_0x0314('0x2e')]);_0x1efb37[_0x0314('0x30')]=_[_0x0314('0x31')](_0x1efb37[_0x0314('0x2b')],_0x1efb37[_0x0314('0x2e')]);_0x168cca[_0x0314('0x32')]=_['intersection'](_0x1efb37[_0x0314('0x2b')],qs[_0x0314('0x33')](_0x369a89[_0x0314('0x2e')]['fields']));_0x168cca[_0x0314('0x32')]=_0x168cca[_0x0314('0x32')][_0x0314('0x34')]?_0x168cca[_0x0314('0x32')]:_0x1efb37[_0x0314('0x2b')];if(!_0x369a89[_0x0314('0x2e')][_0x0314('0x35')]('nolimit')){_0x168cca[_0x0314('0x1e')]=qs[_0x0314('0x1e')](_0x369a89[_0x0314('0x2e')][_0x0314('0x1e')]);_0x168cca[_0x0314('0x1f')]=qs[_0x0314('0x1f')](_0x369a89[_0x0314('0x2e')][_0x0314('0x1f')]);}_0x168cca[_0x0314('0x36')]=qs['sort'](_0x369a89['query'][_0x0314('0x37')]);_0x168cca['where']=qs['filters'](_[_0x0314('0x38')](_0x369a89[_0x0314('0x2e')],_0x1efb37[_0x0314('0x30')]),_0x1f890d);if(_0x369a89[_0x0314('0x2e')][_0x0314('0x39')]){_0x168cca['where']=_[_0x0314('0x3a')](_0x168cca[_0x0314('0x3b')],{'$or':_[_0x0314('0x2c')](_0x1f890d,function(_0x3cbe47){if(_0x3cbe47[_0x0314('0x3c')]!==_0x0314('0x3d')){var _0x117461={};_0x117461[_0x3cbe47[_0x0314('0x2d')]]={'$like':'%'+_0x369a89['query'][_0x0314('0x39')]+'%'};return _0x117461;}})});}_0x168cca=_[_0x0314('0x3a')]({},_0x168cca,_0x369a89[_0x0314('0x3e')]);var _0x39f7c5={'where':_0x168cca['where']};return db[_0x0314('0x29')][_0x0314('0x20')](_0x39f7c5)[_0x0314('0x24')](function(_0xd41234){_0x4a85cd[_0x0314('0x20')]=_0xd41234;if(_0x369a89[_0x0314('0x2e')][_0x0314('0x3f')]){_0x168cca[_0x0314('0x40')]=[{'all':!![]}];}return db['SalesforceField'][_0x0314('0x41')](_0x168cca);})[_0x0314('0x24')](function(_0x303f59){_0x4a85cd[_0x0314('0x42')]=_0x303f59;return _0x4a85cd;})['then'](respondWithFilteredResult(_0x5ac920,_0x168cca))[_0x0314('0x43')](handleError(_0x5ac920,null));};exports['show']=function(_0x1759c7,_0x337746){var _0x2c3a6c={'raw':!![],'where':{'id':_0x1759c7['params']['id']}},_0x5c8ffa={};_0x5c8ffa[_0x0314('0x2b')]=_[_0x0314('0x2f')](db[_0x0314('0x29')][_0x0314('0x2a')]);_0x5c8ffa[_0x0314('0x2e')]=_[_0x0314('0x2f')](_0x1759c7[_0x0314('0x2e')]);_0x5c8ffa[_0x0314('0x30')]=_[_0x0314('0x31')](_0x5c8ffa[_0x0314('0x2b')],_0x5c8ffa[_0x0314('0x2e')]);_0x2c3a6c['attributes']=_[_0x0314('0x31')](_0x5c8ffa[_0x0314('0x2b')],qs[_0x0314('0x33')](_0x1759c7[_0x0314('0x2e')]['fields']));_0x2c3a6c[_0x0314('0x32')]=_0x2c3a6c[_0x0314('0x32')]['length']?_0x2c3a6c[_0x0314('0x32')]:_0x5c8ffa['model'];if(_0x1759c7[_0x0314('0x2e')]['includeAll']){_0x2c3a6c[_0x0314('0x40')]=[{'all':!![]}];}_0x2c3a6c=_[_0x0314('0x3a')]({},_0x2c3a6c,_0x1759c7[_0x0314('0x3e')]);return db['SalesforceField'][_0x0314('0x44')](_0x2c3a6c)[_0x0314('0x24')](handleEntityNotFound(_0x337746,null))['then'](respondWithResult(_0x337746,null))[_0x0314('0x43')](handleError(_0x337746,null));};exports[_0x0314('0x45')]=function(_0x123adb,_0x285591){return db['SalesforceField'][_0x0314('0x45')](_0x123adb[_0x0314('0x46')],{})[_0x0314('0x24')](respondWithResult(_0x285591,0xc9))[_0x0314('0x43')](handleError(_0x285591,null));};exports[_0x0314('0x23')]=function(_0x4e7fc7,_0x3c44f3){if(_0x4e7fc7[_0x0314('0x46')]['id']){delete _0x4e7fc7[_0x0314('0x46')]['id'];}return db[_0x0314('0x29')][_0x0314('0x44')]({'where':{'id':_0x4e7fc7[_0x0314('0x47')]['id']}})[_0x0314('0x24')](handleEntityNotFound(_0x3c44f3,null))[_0x0314('0x24')](saveUpdates(_0x4e7fc7['body'],null))[_0x0314('0x24')](respondWithResult(_0x3c44f3,null))['catch'](handleError(_0x3c44f3,null));};exports[_0x0314('0x25')]=function(_0x51d671,_0x3f4644){return db['SalesforceField'][_0x0314('0x44')]({'where':{'id':_0x51d671[_0x0314('0x47')]['id']}})['then'](handleEntityNotFound(_0x3f4644,null))[_0x0314('0x24')](removeEntity(_0x3f4644,null))[_0x0314('0x43')](handleError(_0x3f4644,null));}; \ No newline at end of file +var _0x5238=['index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','SalesforceField','findAll','params','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','then','destroy','error','stack','name','send'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5238,0x6e));var _0x8523=function(_0x46048a,_0x42962a){_0x46048a=_0x46048a-0x0;var _0x279ed8=_0x5238[_0x46048a];return _0x279ed8;};'use strict';var emlformat=require(_0x8523('0x0'));var rimraf=require(_0x8523('0x1'));var zipdir=require(_0x8523('0x2'));var jsonpatch=require(_0x8523('0x3'));var rp=require(_0x8523('0x4'));var moment=require(_0x8523('0x5'));var BPromise=require(_0x8523('0x6'));var Mustache=require('mustache');var util=require(_0x8523('0x7'));var path=require(_0x8523('0x8'));var sox=require('sox');var csv=require(_0x8523('0x9'));var ejs=require(_0x8523('0xa'));var fs=require('fs');var fs_extra=require(_0x8523('0xb'));var _=require(_0x8523('0xc'));var squel=require(_0x8523('0xd'));var crypto=require(_0x8523('0xe'));var jsforce=require(_0x8523('0xf'));var deskjs=require(_0x8523('0x10'));var toCsv=require(_0x8523('0x9'));var querystring=require(_0x8523('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8523('0x12'));var qs=require(_0x8523('0x13'));var as=require(_0x8523('0x14'));var hardwareService=require(_0x8523('0x15'));var logger=require(_0x8523('0x16'))(_0x8523('0x17'));var utils=require('../../config/utils');var config=require(_0x8523('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8523('0x19'))['db'];function respondWithStatusCode(_0x4ea529,_0x3885d0){_0x3885d0=_0x3885d0||0xcc;return function(_0x2adf70){if(_0x2adf70){return _0x4ea529[_0x8523('0x1a')](_0x3885d0);}return _0x4ea529['status'](_0x3885d0)[_0x8523('0x1b')]();};}function respondWithResult(_0x4e0219,_0x5d5291){_0x5d5291=_0x5d5291||0xc8;return function(_0x2179a8){if(_0x2179a8){return _0x4e0219[_0x8523('0x1c')](_0x5d5291)['json'](_0x2179a8);}};}function respondWithFilteredResult(_0x40eb82,_0x31b975){return function(_0x16aee1){if(_0x16aee1){var _0x24f54e=typeof _0x31b975[_0x8523('0x1d')]===_0x8523('0x1e')&&typeof _0x31b975['limit']===_0x8523('0x1e');var _0x2d7769=_0x16aee1['count'];var _0x1315cc=_0x24f54e?0x0:_0x31b975[_0x8523('0x1d')];var _0x8e5ed7=_0x24f54e?_0x16aee1[_0x8523('0x1f')]:_0x31b975[_0x8523('0x1d')]+_0x31b975[_0x8523('0x20')];var _0x1fec9a;if(_0x8e5ed7>=_0x2d7769){_0x8e5ed7=_0x2d7769;_0x1fec9a=0xc8;}else{_0x1fec9a=0xce;}_0x40eb82[_0x8523('0x1c')](_0x1fec9a);return _0x40eb82[_0x8523('0x21')](_0x8523('0x22'),_0x1315cc+'-'+_0x8e5ed7+'/'+_0x2d7769)[_0x8523('0x23')](_0x16aee1);}return null;};}function patchUpdates(_0x231e3e){return function(_0x3449a5){try{jsonpatch['apply'](_0x3449a5,_0x231e3e,!![]);}catch(_0x5a28ef){return BPromise[_0x8523('0x24')](_0x5a28ef);}return _0x3449a5[_0x8523('0x25')]();};}function saveUpdates(_0x2d0886,_0x4c0d40){return function(_0x438186){if(_0x438186){return _0x438186['update'](_0x2d0886)[_0x8523('0x26')](function(_0x3e1351){return _0x3e1351;});}return null;};}function removeEntity(_0x5f25b8,_0x32a4c6){return function(_0x21250e){if(_0x21250e){return _0x21250e[_0x8523('0x27')]()['then'](function(){_0x5f25b8[_0x8523('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50c276,_0x17413c){return function(_0x4e4d82){if(!_0x4e4d82){_0x50c276[_0x8523('0x1a')](0x194);}return _0x4e4d82;};}function handleError(_0xf860a9,_0x4ab56d){_0x4ab56d=_0x4ab56d||0x1f4;return function(_0x378848){logger[_0x8523('0x28')](_0x378848[_0x8523('0x29')]);if(_0x378848[_0x8523('0x2a')]){delete _0x378848[_0x8523('0x2a')];}_0xf860a9[_0x8523('0x1c')](_0x4ab56d)[_0x8523('0x2b')](_0x378848);};}exports[_0x8523('0x2c')]=function(_0x5160d8,_0x2a9e8d){var _0x2781bd={},_0x1e3286={},_0x421b6a={'count':0x0,'rows':[]};var _0xf6c8bc=_[_0x8523('0x2d')](db['SalesforceField'][_0x8523('0x2e')],function(_0x49b261){return{'name':_0x49b261[_0x8523('0x2f')],'type':_0x49b261[_0x8523('0x30')][_0x8523('0x31')]};});_0x1e3286[_0x8523('0x32')]=_[_0x8523('0x2d')](_0xf6c8bc,_0x8523('0x2a'));_0x1e3286[_0x8523('0x33')]=_[_0x8523('0x34')](_0x5160d8[_0x8523('0x33')]);_0x1e3286[_0x8523('0x35')]=_['intersection'](_0x1e3286[_0x8523('0x32')],_0x1e3286[_0x8523('0x33')]);_0x2781bd['attributes']=_[_0x8523('0x36')](_0x1e3286[_0x8523('0x32')],qs[_0x8523('0x37')](_0x5160d8[_0x8523('0x33')]['fields']));_0x2781bd[_0x8523('0x38')]=_0x2781bd[_0x8523('0x38')][_0x8523('0x39')]?_0x2781bd['attributes']:_0x1e3286['model'];if(!_0x5160d8[_0x8523('0x33')]['hasOwnProperty'](_0x8523('0x3a'))){_0x2781bd['limit']=qs[_0x8523('0x20')](_0x5160d8[_0x8523('0x33')][_0x8523('0x20')]);_0x2781bd[_0x8523('0x1d')]=qs['offset'](_0x5160d8[_0x8523('0x33')][_0x8523('0x1d')]);}_0x2781bd[_0x8523('0x3b')]=qs[_0x8523('0x3c')](_0x5160d8['query'][_0x8523('0x3c')]);_0x2781bd[_0x8523('0x3d')]=qs[_0x8523('0x35')](_[_0x8523('0x3e')](_0x5160d8[_0x8523('0x33')],_0x1e3286[_0x8523('0x35')]),_0xf6c8bc);if(_0x5160d8[_0x8523('0x33')][_0x8523('0x3f')]){_0x2781bd['where']=_[_0x8523('0x40')](_0x2781bd[_0x8523('0x3d')],{'$or':_[_0x8523('0x2d')](_0xf6c8bc,function(_0x14fce8){if(_0x14fce8[_0x8523('0x30')]!==_0x8523('0x41')){var _0x2416e0={};_0x2416e0[_0x14fce8[_0x8523('0x2a')]]={'$like':'%'+_0x5160d8[_0x8523('0x33')][_0x8523('0x3f')]+'%'};return _0x2416e0;}})});}_0x2781bd=_[_0x8523('0x40')]({},_0x2781bd,_0x5160d8[_0x8523('0x42')]);var _0xcea44d={'where':_0x2781bd[_0x8523('0x3d')]};return db['SalesforceField']['count'](_0xcea44d)[_0x8523('0x26')](function(_0xd9befe){_0x421b6a[_0x8523('0x1f')]=_0xd9befe;if(_0x5160d8[_0x8523('0x33')][_0x8523('0x43')]){_0x2781bd[_0x8523('0x44')]=[{'all':!![]}];}return db[_0x8523('0x45')][_0x8523('0x46')](_0x2781bd);})['then'](function(_0x39820b){_0x421b6a['rows']=_0x39820b;return _0x421b6a;})[_0x8523('0x26')](respondWithFilteredResult(_0x2a9e8d,_0x2781bd))['catch'](handleError(_0x2a9e8d,null));};exports['show']=function(_0x4d7057,_0x5def51){var _0x34e0a8={'raw':!![],'where':{'id':_0x4d7057[_0x8523('0x47')]['id']}},_0x43b718={};_0x43b718[_0x8523('0x32')]=_[_0x8523('0x34')](db['SalesforceField'][_0x8523('0x2e')]);_0x43b718[_0x8523('0x33')]=_['keys'](_0x4d7057[_0x8523('0x33')]);_0x43b718[_0x8523('0x35')]=_[_0x8523('0x36')](_0x43b718[_0x8523('0x32')],_0x43b718[_0x8523('0x33')]);_0x34e0a8[_0x8523('0x38')]=_[_0x8523('0x36')](_0x43b718[_0x8523('0x32')],qs[_0x8523('0x37')](_0x4d7057[_0x8523('0x33')][_0x8523('0x37')]));_0x34e0a8[_0x8523('0x38')]=_0x34e0a8[_0x8523('0x38')]['length']?_0x34e0a8[_0x8523('0x38')]:_0x43b718[_0x8523('0x32')];if(_0x4d7057[_0x8523('0x33')][_0x8523('0x43')]){_0x34e0a8[_0x8523('0x44')]=[{'all':!![]}];}_0x34e0a8=_[_0x8523('0x40')]({},_0x34e0a8,_0x4d7057[_0x8523('0x42')]);return db[_0x8523('0x45')][_0x8523('0x48')](_0x34e0a8)[_0x8523('0x26')](handleEntityNotFound(_0x5def51,null))[_0x8523('0x26')](respondWithResult(_0x5def51,null))[_0x8523('0x49')](handleError(_0x5def51,null));};exports[_0x8523('0x4a')]=function(_0x4b535a,_0x32cbd1){return db['SalesforceField'][_0x8523('0x4a')](_0x4b535a[_0x8523('0x4b')],{})[_0x8523('0x26')](respondWithResult(_0x32cbd1,0xc9))[_0x8523('0x49')](handleError(_0x32cbd1,null));};exports[_0x8523('0x4c')]=function(_0x51ce83,_0xdc2b62){if(_0x51ce83[_0x8523('0x4b')]['id']){delete _0x51ce83[_0x8523('0x4b')]['id'];}return db['SalesforceField'][_0x8523('0x48')]({'where':{'id':_0x51ce83['params']['id']}})[_0x8523('0x26')](handleEntityNotFound(_0xdc2b62,null))[_0x8523('0x26')](saveUpdates(_0x51ce83[_0x8523('0x4b')],null))[_0x8523('0x26')](respondWithResult(_0xdc2b62,null))['catch'](handleError(_0xdc2b62,null));};exports[_0x8523('0x27')]=function(_0x2cb6cc,_0x1db42b){return db['SalesforceField']['find']({'where':{'id':_0x2cb6cc[_0x8523('0x47')]['id']}})[_0x8523('0x26')](handleEntityNotFound(_0x1db42b,null))[_0x8523('0x26')](removeEntity(_0x1db42b,null))[_0x8523('0x49')](handleError(_0x1db42b,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index e3fb3f2..def562f 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 _0x801a=['rimraf','../../config/environment','exports','SalesforceField','int_salesforce_fields','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x5ab5bd,_0x12c446){var _0x3dddd8=function(_0x5ea7d0){while(--_0x5ea7d0){_0x5ab5bd['push'](_0x5ab5bd['shift']());}};_0x3dddd8(++_0x12c446);}(_0x801a,0x65));var _0xa801=function(_0x530a2e,_0x4c17aa){_0x530a2e=_0x530a2e-0x0;var _0x1fd8a7=_0x801a[_0x530a2e];return _0x1fd8a7;};'use strict';var _=require(_0xa801('0x0'));var util=require(_0xa801('0x1'));var logger=require('../../config/logger')(_0xa801('0x2'));var moment=require(_0xa801('0x3'));var BPromise=require(_0xa801('0x4'));var rp=require(_0xa801('0x5'));var fs=require('fs');var path=require(_0xa801('0x6'));var rimraf=require(_0xa801('0x7'));var config=require(_0xa801('0x8'));var attributes=require('./intSalesforceField.attributes');module[_0xa801('0x9')]=function(_0xfc0fe8,_0x12c268){return _0xfc0fe8['define'](_0xa801('0xa'),attributes,{'tableName':_0xa801('0xb'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9ea1=['rimraf','../../config/environment','exports','define','SalesforceField','int_salesforce_fields','idField','FieldId','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x9ea1,0xb1));var _0x19ea=function(_0x397a92,_0x4c0449){_0x397a92=_0x397a92-0x0;var _0x4d8638=_0x9ea1[_0x397a92];return _0x4d8638;};'use strict';var _=require('lodash');var util=require(_0x19ea('0x0'));var logger=require(_0x19ea('0x1'))(_0x19ea('0x2'));var moment=require('moment');var BPromise=require(_0x19ea('0x3'));var rp=require(_0x19ea('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x19ea('0x5'));var config=require(_0x19ea('0x6'));var attributes=require('./intSalesforceField.attributes');module[_0x19ea('0x7')]=function(_0x3cf27a,_0x20073b){return _0x3cf27a[_0x19ea('0x8')](_0x19ea('0x9'),attributes,{'tableName':_0x19ea('0xa'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x19ea('0xb'),_0x19ea('0xc')],'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 62b333c..d774e48 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 _0x4099=['moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util'];(function(_0x42aec1,_0x95b2bc){var _0x2edb01=function(_0x353b6f){while(--_0x353b6f){_0x42aec1['push'](_0x42aec1['shift']());}};_0x2edb01(++_0x95b2bc);}(_0x4099,0x1b4));var _0x9409=function(_0xb301d4,_0x27ed18){_0xb301d4=_0xb301d4-0x0;var _0x3b5bde=_0x4099[_0xb301d4];return _0x3b5bde;};'use strict';var _=require('lodash');var util=require(_0x9409('0x0'));var moment=require(_0x9409('0x1'));var BPromise=require(_0x9409('0x2'));var rs=require(_0x9409('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9409('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9409('0x5'))(_0x9409('0x6'));var config=require(_0x9409('0x7'));var jayson=require(_0x9409('0x8'));var client=jayson[_0x9409('0x9')][_0x9409('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bee41,_0x2df2e6,_0x3a9ecc){return new BPromise(function(_0x3633ec,_0x3ec1b3){return client[_0x9409('0xb')](_0x3bee41,_0x3a9ecc)[_0x9409('0xc')](function(_0x28cead){logger[_0x9409('0xd')](_0x9409('0xe'),_0x2df2e6,_0x9409('0xf'));logger[_0x9409('0x10')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x2df2e6,_0x9409('0xf'),JSON[_0x9409('0x11')](_0x28cead));if(_0x28cead[_0x9409('0x12')]){if(_0x28cead[_0x9409('0x12')][_0x9409('0x13')]===0x1f4){logger['error'](_0x9409('0xe'),_0x2df2e6,_0x28cead[_0x9409('0x12')][_0x9409('0x14')]);return _0x3ec1b3(_0x28cead[_0x9409('0x12')][_0x9409('0x14')]);}logger[_0x9409('0x12')]('SalesforceField,\x20%s,\x20%s',_0x2df2e6,_0x28cead[_0x9409('0x12')][_0x9409('0x14')]);return _0x3633ec(_0x28cead['error'][_0x9409('0x14')]);}else{logger[_0x9409('0xd')](_0x9409('0xe'),_0x2df2e6,_0x9409('0xf'));_0x3633ec(_0x28cead[_0x9409('0x15')]['message']);}})[_0x9409('0x16')](function(_0x5072c8){logger[_0x9409('0x12')]('SalesforceField,\x20%s,\x20%s',_0x2df2e6,_0x5072c8);_0x3ec1b3(_0x5072c8);});});} \ No newline at end of file +var _0xfd24=['SalesforceField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info'];(function(_0x59a5d0,_0x4b3308){var _0x6840ac=function(_0x2dadf5){while(--_0x2dadf5){_0x59a5d0['push'](_0x59a5d0['shift']());}};_0x6840ac(++_0x4b3308);}(_0xfd24,0x148));var _0x4fd2=function(_0xd22d95,_0xc59f8f){_0xd22d95=_0xd22d95-0x0;var _0x15d7a3=_0xfd24[_0xd22d95];return _0x15d7a3;};'use strict';var _=require('lodash');var util=require(_0x4fd2('0x0'));var moment=require(_0x4fd2('0x1'));var BPromise=require(_0x4fd2('0x2'));var rs=require(_0x4fd2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4fd2('0x4'))['db'];var utils=require(_0x4fd2('0x5'));var logger=require('../../config/logger')(_0x4fd2('0x6'));var config=require(_0x4fd2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4fd2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x480612,_0x273e63,_0x29772f){return new BPromise(function(_0xf2bdfd,_0x568577){return client[_0x4fd2('0x9')](_0x480612,_0x29772f)[_0x4fd2('0xa')](function(_0x57dd61){logger[_0x4fd2('0xb')](_0x4fd2('0xc'),_0x273e63,_0x4fd2('0xd'));logger[_0x4fd2('0xe')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x273e63,'request\x20sent',JSON['stringify'](_0x57dd61));if(_0x57dd61['error']){if(_0x57dd61[_0x4fd2('0xf')][_0x4fd2('0x10')]===0x1f4){logger[_0x4fd2('0xf')](_0x4fd2('0xc'),_0x273e63,_0x57dd61[_0x4fd2('0xf')][_0x4fd2('0x11')]);return _0x568577(_0x57dd61[_0x4fd2('0xf')][_0x4fd2('0x11')]);}logger['error'](_0x4fd2('0xc'),_0x273e63,_0x57dd61[_0x4fd2('0xf')][_0x4fd2('0x11')]);return _0xf2bdfd(_0x57dd61[_0x4fd2('0xf')][_0x4fd2('0x11')]);}else{logger[_0x4fd2('0xb')]('SalesforceField,\x20%s,\x20%s',_0x273e63,_0x4fd2('0xd'));_0xf2bdfd(_0x57dd61[_0x4fd2('0x12')][_0x4fd2('0x11')]);}})[_0x4fd2('0x13')](function(_0x59ad73){logger[_0x4fd2('0xf')]('SalesforceField,\x20%s,\x20%s',_0x273e63,_0x59ad73);_0x568577(_0x59ad73);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 9673f6a..6ae908f 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 _0x9965=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x9965,0xf4));var _0x5996=function(_0x1c37e7,_0x389d80){_0x1c37e7=_0x1c37e7-0x0;var _0x245086=_0x9965[_0x1c37e7];return _0x245086;};'use strict';var multer=require(_0x5996('0x0'));var util=require(_0x5996('0x1'));var path=require(_0x5996('0x2'));var timeout=require(_0x5996('0x3'));var express=require(_0x5996('0x4'));var router=express['Router']();var fs_extra=require(_0x5996('0x5'));var auth=require(_0x5996('0x6'));var interaction=require(_0x5996('0x7'));var config=require(_0x5996('0x8'));var controller=require(_0x5996('0x9'));router[_0x5996('0xa')]('/',auth['isAuthenticated'](),controller[_0x5996('0xb')]);router[_0x5996('0xa')](_0x5996('0xc'),auth[_0x5996('0xd')](),controller[_0x5996('0xe')]);router[_0x5996('0xa')](_0x5996('0xf'),auth[_0x5996('0xd')](),controller[_0x5996('0x10')]);router[_0x5996('0xa')](_0x5996('0x11'),auth['isAuthenticated'](),controller[_0x5996('0x12')]);router[_0x5996('0x13')]('/',auth[_0x5996('0xd')](),controller[_0x5996('0x14')]);router[_0x5996('0x13')](_0x5996('0xf'),auth[_0x5996('0xd')](),controller[_0x5996('0x15')]);router[_0x5996('0x16')]('/:id',auth[_0x5996('0xd')](),controller[_0x5996('0x17')]);router[_0x5996('0x18')](_0x5996('0xc'),auth[_0x5996('0xd')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8bc8=['Router','./intServicenowAccount.controller','isAuthenticated','get','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x277cbd,_0x2cd973){var _0x2231ec=function(_0x2a19a8){while(--_0x2a19a8){_0x277cbd['push'](_0x277cbd['shift']());}};_0x2231ec(++_0x2cd973);}(_0x8bc8,0xc4));var _0x88bc=function(_0x5e9590,_0x390b30){_0x5e9590=_0x5e9590-0x0;var _0x3d0ecd=_0x8bc8[_0x5e9590];return _0x3d0ecd;};'use strict';var multer=require(_0x88bc('0x0'));var util=require(_0x88bc('0x1'));var path=require(_0x88bc('0x2'));var timeout=require(_0x88bc('0x3'));var express=require('express');var router=express[_0x88bc('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x88bc('0x5'));router['get']('/',auth[_0x88bc('0x6')](),controller['index']);router[_0x88bc('0x7')](_0x88bc('0x8'),auth[_0x88bc('0x6')](),controller[_0x88bc('0x9')]);router[_0x88bc('0x7')]('/:id/configurations',auth[_0x88bc('0x6')](),controller[_0x88bc('0xa')]);router['get'](_0x88bc('0xb'),auth[_0x88bc('0x6')](),controller[_0x88bc('0xc')]);router[_0x88bc('0xd')]('/',auth[_0x88bc('0x6')](),controller[_0x88bc('0xe')]);router[_0x88bc('0xd')](_0x88bc('0xf'),auth[_0x88bc('0x6')](),controller['addConfiguration']);router[_0x88bc('0x10')](_0x88bc('0x8'),auth[_0x88bc('0x6')](),controller[_0x88bc('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x88bc('0x12')]);module[_0x88bc('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 112753d..3b2c48f 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 _0x3b58=['username','exports','STRING'];(function(_0x2e5190,_0x411127){var _0x21f04e=function(_0x40baf6){while(--_0x40baf6){_0x2e5190['push'](_0x2e5190['shift']());}};_0x21f04e(++_0x411127);}(_0x3b58,0x8b));var _0x83b5=function(_0x42a6f4,_0x495631){_0x42a6f4=_0x42a6f4-0x0;var _0x3d1d00=_0x3b58[_0x42a6f4];return _0x3d1d00;};'use strict';var Sequelize=require('sequelize');module[_0x83b5('0x0')]={'name':{'type':Sequelize[_0x83b5('0x1')]},'description':{'type':Sequelize[_0x83b5('0x1')]},'username':{'type':Sequelize[_0x83b5('0x1')],'unique':_0x83b5('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x83b5('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x83b5('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x78da=['STRING','remoteUri','sequelize','exports'];(function(_0x579de7,_0x16df8d){var _0x5351ee=function(_0x3e55d3){while(--_0x3e55d3){_0x579de7['push'](_0x579de7['shift']());}};_0x5351ee(++_0x16df8d);}(_0x78da,0x11a));var _0xa78d=function(_0x426bb4,_0x263bc4){_0x426bb4=_0x426bb4-0x0;var _0x4eeed4=_0x78da[_0x426bb4];return _0x4eeed4;};'use strict';var Sequelize=require(_0xa78d('0x0'));module[_0xa78d('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa78d('0x2')]},'username':{'type':Sequelize[_0xa78d('0x2')],'unique':'username'},'password':{'type':Sequelize[_0xa78d('0x2')]},'email':{'type':Sequelize[_0xa78d('0x2')]},'remoteUri':{'type':Sequelize[_0xa78d('0x2')],'unique':_0xa78d('0x3')},'serverUrl':{'type':Sequelize[_0xa78d('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 5de7d3e..5354d39 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 _0x1b1c=['correlation_display','delivery_task','work_start','description','calendar_duration','sys_class_name','close_notes','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','activity_due','comments','sla_due','approval','comments_and_work_notes','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','email','remoteUri','serverUrl','slice','%s/api/now/doc/table/schema/','format','%s/api/now/table/','password','GET','result','log','incident\x20table\x20objects','assign','push','TCL:\x20_object','remove','forEach','internalType','label','all','concat','test','statusCode','send','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','limit','count','offset','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','filter','where','VIRTUAL','merge','ServicenowAccount','includeAll','findAll','rows','catch','show','length','include','options','find','create','body','params','destroy','findOne','ServicenowConfiguration','order','pick','getConfigurations','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','subcategory','close_code','notify','incident_state','severity','parent','caused_by','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','time_worked','opened_at','business_duration','group_list','reopened_time','caller_id','approval_set','work_notes','short_description'];(function(_0x43e830,_0x4d23d2){var _0x251875=function(_0x9e09bd){while(--_0x9e09bd){_0x43e830['push'](_0x43e830['shift']());}};_0x251875(++_0x4d23d2);}(_0x1b1c,0xf6));var _0xc1b1=function(_0xb598fd,_0x57515c){_0xb598fd=_0xb598fd-0x0;var _0x17bbb8=_0x1b1c[_0xb598fd];return _0x17bbb8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc1b1('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc1b1('0x1'));var moment=require('moment');var BPromise=require(_0xc1b1('0x2'));var Mustache=require(_0xc1b1('0x3'));var util=require(_0xc1b1('0x4'));var path=require(_0xc1b1('0x5'));var sox=require(_0xc1b1('0x6'));var csv=require(_0xc1b1('0x7'));var ejs=require(_0xc1b1('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc1b1('0x9'));var squel=require(_0xc1b1('0xa'));var crypto=require(_0xc1b1('0xb'));var jsforce=require(_0xc1b1('0xc'));var deskjs=require(_0xc1b1('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc1b1('0xe'));var Papa=require(_0xc1b1('0xf'));var Redis=require(_0xc1b1('0x10'));var authService=require(_0xc1b1('0x11'));var qs=require(_0xc1b1('0x12'));var as=require(_0xc1b1('0x13'));var hardwareService=require(_0xc1b1('0x14'));var logger=require(_0xc1b1('0x15'))(_0xc1b1('0x16'));var utils=require(_0xc1b1('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc1b1('0x18'));var db=require(_0xc1b1('0x19'))['db'];var integrations=require(_0xc1b1('0x1a'));function respondWithStatusCode(_0x18c822,_0x3e2170){_0x3e2170=_0x3e2170||0xcc;return function(_0x5205a5){if(_0x5205a5){return _0x18c822[_0xc1b1('0x1b')](_0x3e2170);}return _0x18c822['status'](_0x3e2170)[_0xc1b1('0x1c')]();};}function respondWithResult(_0x47e459,_0x2cc852){_0x2cc852=_0x2cc852||0xc8;return function(_0x34b2b5){if(_0x34b2b5){return _0x47e459[_0xc1b1('0x1d')](_0x2cc852)['json'](_0x34b2b5);}};}function respondWithFilteredResult(_0x46d9d7,_0x24479d){return function(_0x5c3051){if(_0x5c3051){var _0x192bd8=typeof _0x24479d['offset']==='undefined'&&typeof _0x24479d[_0xc1b1('0x1e')]==='undefined';var _0x45c39f=_0x5c3051[_0xc1b1('0x1f')];var _0x22b852=_0x192bd8?0x0:_0x24479d[_0xc1b1('0x20')];var _0x124800=_0x192bd8?_0x5c3051[_0xc1b1('0x1f')]:_0x24479d[_0xc1b1('0x20')]+_0x24479d[_0xc1b1('0x1e')];var _0x5bb270;if(_0x124800>=_0x45c39f){_0x124800=_0x45c39f;_0x5bb270=0xc8;}else{_0x5bb270=0xce;}_0x46d9d7['status'](_0x5bb270);return _0x46d9d7['set'](_0xc1b1('0x21'),_0x22b852+'-'+_0x124800+'/'+_0x45c39f)['json'](_0x5c3051);}return null;};}function patchUpdates(_0x42effe){return function(_0x1e49a4){try{jsonpatch[_0xc1b1('0x22')](_0x1e49a4,_0x42effe,!![]);}catch(_0x188851){return BPromise[_0xc1b1('0x23')](_0x188851);}return _0x1e49a4[_0xc1b1('0x24')]();};}function saveUpdates(_0x4ce230,_0x288bcd){return function(_0x3f119e){if(_0x3f119e){return _0x3f119e[_0xc1b1('0x25')](_0x4ce230)[_0xc1b1('0x26')](function(_0x42768a){return _0x42768a;});}return null;};}function removeEntity(_0x106fe9,_0x5ba499){return function(_0x2e83bf){if(_0x2e83bf){return _0x2e83bf['destroy']()[_0xc1b1('0x26')](function(){_0x106fe9[_0xc1b1('0x1d')](0xcc)[_0xc1b1('0x1c')]();});}};}function handleEntityNotFound(_0x29754e,_0x232189){return function(_0x2afcda){if(!_0x2afcda){_0x29754e[_0xc1b1('0x1b')](0x194);}return _0x2afcda;};}function handleError(_0x5e7d12,_0xd85d31){_0xd85d31=_0xd85d31||0x1f4;return function(_0x1db724){logger[_0xc1b1('0x27')](_0x1db724[_0xc1b1('0x28')]);if(_0x1db724[_0xc1b1('0x29')]){delete _0x1db724['name'];}_0x5e7d12['status'](_0xd85d31)['send'](_0x1db724);};}exports[_0xc1b1('0x2a')]=function(_0x33a2d9,_0x27696e){var _0x270f08={},_0x5700fd={},_0x3fde20={'count':0x0,'rows':[]};var _0x9a33fa=_[_0xc1b1('0x2b')](db['ServicenowAccount'][_0xc1b1('0x2c')],function(_0x1ea9be){return{'name':_0x1ea9be[_0xc1b1('0x2d')],'type':_0x1ea9be[_0xc1b1('0x2e')][_0xc1b1('0x2f')]};});_0x5700fd[_0xc1b1('0x30')]=_[_0xc1b1('0x2b')](_0x9a33fa,_0xc1b1('0x29'));_0x5700fd[_0xc1b1('0x31')]=_[_0xc1b1('0x32')](_0x33a2d9[_0xc1b1('0x31')]);_0x5700fd[_0xc1b1('0x33')]=_[_0xc1b1('0x34')](_0x5700fd[_0xc1b1('0x30')],_0x5700fd[_0xc1b1('0x31')]);_0x270f08['attributes']=_['intersection'](_0x5700fd['model'],qs[_0xc1b1('0x35')](_0x33a2d9['query'][_0xc1b1('0x35')]));_0x270f08[_0xc1b1('0x36')]=_0x270f08[_0xc1b1('0x36')]['length']?_0x270f08[_0xc1b1('0x36')]:_0x5700fd[_0xc1b1('0x30')];if(!_0x33a2d9[_0xc1b1('0x31')][_0xc1b1('0x37')]('nolimit')){_0x270f08[_0xc1b1('0x1e')]=qs['limit'](_0x33a2d9['query'][_0xc1b1('0x1e')]);_0x270f08['offset']=qs[_0xc1b1('0x20')](_0x33a2d9[_0xc1b1('0x31')][_0xc1b1('0x20')]);}_0x270f08['order']=qs[_0xc1b1('0x38')](_0x33a2d9['query'][_0xc1b1('0x38')]);_0x270f08['where']=qs['filters'](_['pick'](_0x33a2d9[_0xc1b1('0x31')],_0x5700fd[_0xc1b1('0x33')]),_0x9a33fa);if(_0x33a2d9['query'][_0xc1b1('0x39')]){_0x270f08[_0xc1b1('0x3a')]=_['merge'](_0x270f08['where'],{'$or':_[_0xc1b1('0x2b')](_0x9a33fa,function(_0x5367b6){if(_0x5367b6['type']!==_0xc1b1('0x3b')){var _0x47cfb6={};_0x47cfb6[_0x5367b6['name']]={'$like':'%'+_0x33a2d9[_0xc1b1('0x31')][_0xc1b1('0x39')]+'%'};return _0x47cfb6;}})});}_0x270f08=_[_0xc1b1('0x3c')]({},_0x270f08,_0x33a2d9['options']);var _0xe99e50={'where':_0x270f08[_0xc1b1('0x3a')]};return db[_0xc1b1('0x3d')][_0xc1b1('0x1f')](_0xe99e50)[_0xc1b1('0x26')](function(_0x534c64){_0x3fde20[_0xc1b1('0x1f')]=_0x534c64;if(_0x33a2d9['query'][_0xc1b1('0x3e')]){_0x270f08['include']=[{'all':!![]}];}return db[_0xc1b1('0x3d')][_0xc1b1('0x3f')](_0x270f08);})[_0xc1b1('0x26')](function(_0x32206e){_0x3fde20[_0xc1b1('0x40')]=_0x32206e;return _0x3fde20;})[_0xc1b1('0x26')](respondWithFilteredResult(_0x27696e,_0x270f08))[_0xc1b1('0x41')](handleError(_0x27696e,null));};exports[_0xc1b1('0x42')]=function(_0xb4d05c,_0x1070e7){var _0xf2cd8f={'raw':![],'where':{'id':_0xb4d05c['params']['id']}},_0xb83f1e={};_0xb83f1e[_0xc1b1('0x30')]=_[_0xc1b1('0x32')](db['ServicenowAccount']['rawAttributes']);_0xb83f1e[_0xc1b1('0x31')]=_['keys'](_0xb4d05c['query']);_0xb83f1e['filters']=_[_0xc1b1('0x34')](_0xb83f1e[_0xc1b1('0x30')],_0xb83f1e[_0xc1b1('0x31')]);_0xf2cd8f[_0xc1b1('0x36')]=_[_0xc1b1('0x34')](_0xb83f1e['model'],qs[_0xc1b1('0x35')](_0xb4d05c[_0xc1b1('0x31')]['fields']));_0xf2cd8f[_0xc1b1('0x36')]=_0xf2cd8f[_0xc1b1('0x36')][_0xc1b1('0x43')]?_0xf2cd8f[_0xc1b1('0x36')]:_0xb83f1e['model'];if(_0xb4d05c[_0xc1b1('0x31')][_0xc1b1('0x3e')]){_0xf2cd8f[_0xc1b1('0x44')]=[{'all':!![]}];}_0xf2cd8f=_['merge']({},_0xf2cd8f,_0xb4d05c[_0xc1b1('0x45')]);return db[_0xc1b1('0x3d')][_0xc1b1('0x46')](_0xf2cd8f)['then'](handleEntityNotFound(_0x1070e7,null))[_0xc1b1('0x26')](respondWithResult(_0x1070e7,null))['catch'](handleError(_0x1070e7,null));};exports[_0xc1b1('0x47')]=function(_0x3b84a4,_0x369e57){return db['ServicenowAccount'][_0xc1b1('0x47')](_0x3b84a4[_0xc1b1('0x48')],{})[_0xc1b1('0x26')](respondWithResult(_0x369e57,0xc9))[_0xc1b1('0x41')](handleError(_0x369e57,null));};exports[_0xc1b1('0x25')]=function(_0x21b406,_0x48f0ec){if(_0x21b406[_0xc1b1('0x48')]['id']){delete _0x21b406['body']['id'];}return db[_0xc1b1('0x3d')][_0xc1b1('0x46')]({'where':{'id':_0x21b406[_0xc1b1('0x49')]['id']}})[_0xc1b1('0x26')](handleEntityNotFound(_0x48f0ec,null))[_0xc1b1('0x26')](saveUpdates(_0x21b406[_0xc1b1('0x48')],null))[_0xc1b1('0x26')](respondWithResult(_0x48f0ec,null))[_0xc1b1('0x41')](handleError(_0x48f0ec,null));};exports[_0xc1b1('0x4a')]=function(_0x218beb,_0x1d5f52){return db[_0xc1b1('0x3d')][_0xc1b1('0x46')]({'where':{'id':_0x218beb['params']['id']}})[_0xc1b1('0x26')](handleEntityNotFound(_0x1d5f52,null))[_0xc1b1('0x26')](removeEntity(_0x1d5f52,null))[_0xc1b1('0x41')](handleError(_0x1d5f52,null));};exports['getConfigurations']=function(_0x3dda83,_0xc350d8,_0x5c170f){var _0x50ef13={};var _0x16419f={};var _0x3a6321;var _0x46299b;return db[_0xc1b1('0x3d')][_0xc1b1('0x4b')]({'where':{'id':_0x3dda83['params']['id']}})[_0xc1b1('0x26')](handleEntityNotFound(_0xc350d8,null))['then'](function(_0x4a4b67){if(_0x4a4b67){_0x3a6321=_0x4a4b67;_0x16419f[_0xc1b1('0x30')]=_[_0xc1b1('0x32')](db[_0xc1b1('0x4c')][_0xc1b1('0x2c')]);_0x16419f[_0xc1b1('0x31')]=_[_0xc1b1('0x32')](_0x3dda83[_0xc1b1('0x31')]);_0x16419f[_0xc1b1('0x33')]=_['intersection'](_0x16419f[_0xc1b1('0x30')],_0x16419f[_0xc1b1('0x31')]);_0x50ef13[_0xc1b1('0x36')]=_[_0xc1b1('0x34')](_0x16419f[_0xc1b1('0x30')],qs[_0xc1b1('0x35')](_0x3dda83[_0xc1b1('0x31')][_0xc1b1('0x35')]));_0x50ef13['attributes']=_0x50ef13['attributes']['length']?_0x50ef13[_0xc1b1('0x36')]:_0x16419f[_0xc1b1('0x30')];_0x50ef13[_0xc1b1('0x4d')]=qs[_0xc1b1('0x38')](_0x3dda83[_0xc1b1('0x31')][_0xc1b1('0x38')]);_0x50ef13[_0xc1b1('0x3a')]=qs[_0xc1b1('0x33')](_[_0xc1b1('0x4e')](_0x3dda83[_0xc1b1('0x31')],_0x16419f[_0xc1b1('0x33')]));if(_0x3dda83[_0xc1b1('0x31')][_0xc1b1('0x39')]){_0x50ef13[_0xc1b1('0x3a')]=_[_0xc1b1('0x3c')](_0x50ef13['where'],{'$or':_[_0xc1b1('0x2b')](_0x50ef13['attributes'],function(_0x142ed4){var _0x294cc1={};_0x294cc1[_0x142ed4]={'$like':'%'+_0x3dda83[_0xc1b1('0x31')][_0xc1b1('0x39')]+'%'};return _0x294cc1;})});}_0x50ef13=_[_0xc1b1('0x3c')]({},_0x50ef13,_0x3dda83[_0xc1b1('0x45')]);return _0x3a6321[_0xc1b1('0x4f')](_0x50ef13);}})[_0xc1b1('0x26')](function(_0x59254b){if(_0x59254b){_0x46299b=_0x59254b[_0xc1b1('0x43')];if(!_0x3dda83[_0xc1b1('0x31')]['hasOwnProperty'](_0xc1b1('0x50'))){_0x50ef13[_0xc1b1('0x1e')]=qs[_0xc1b1('0x1e')](_0x3dda83['query']['limit']);_0x50ef13[_0xc1b1('0x20')]=qs[_0xc1b1('0x20')](_0x3dda83[_0xc1b1('0x31')][_0xc1b1('0x20')]);}return _0x3a6321[_0xc1b1('0x4f')](_0x50ef13);}})[_0xc1b1('0x26')](function(_0x11267b){if(_0x11267b){return _0x11267b?{'count':_0x46299b,'rows':_0x11267b}:null;}})[_0xc1b1('0x26')](respondWithResult(_0xc350d8,null))[_0xc1b1('0x41')](handleError(_0xc350d8,null));};exports[_0xc1b1('0x51')]=function(_0x383129,_0xe12508,_0x44da6a){if(_0x383129[_0xc1b1('0x48')]['id']){delete _0x383129[_0xc1b1('0x48')]['id'];}return db[_0xc1b1('0x3d')][_0xc1b1('0x4b')]({'where':{'id':_0x383129[_0xc1b1('0x49')]['id']}})[_0xc1b1('0x26')](handleEntityNotFound(_0xe12508,null))[_0xc1b1('0x26')](function(_0x129bfd){if(_0x129bfd){_0x383129['body']['AccountId']=_0x129bfd['id'];_0x383129[_0xc1b1('0x48')][_0xc1b1('0x52')]=integrations[_0xc1b1('0x53')](_0x383129['body'][_0xc1b1('0x54')],_0x383129[_0xc1b1('0x48')]['type']);_0x383129['body'][_0xc1b1('0x55')]=integrations[_0xc1b1('0x56')](_0x383129[_0xc1b1('0x48')][_0xc1b1('0x54')],_0x383129[_0xc1b1('0x48')][_0xc1b1('0x2e')]);return db[_0xc1b1('0x4c')]['create'](_0x383129[_0xc1b1('0x48')],{'include':[{'model':db['ServicenowField'],'as':_0xc1b1('0x52')},{'model':db[_0xc1b1('0x57')],'as':'Descriptions'}]});}return null;})[_0xc1b1('0x26')](respondWithResult(_0xe12508,null))[_0xc1b1('0x41')](handleError(_0xe12508,null));};exports[_0xc1b1('0x58')]=function(_0x3243cd,_0x1e0e67,_0x372eeb){var _0x1d1b40=[_0xc1b1('0x59'),_0xc1b1('0x5a'),'knowledge',_0xc1b1('0x5b'),_0xc1b1('0x5c'),_0xc1b1('0x5d'),_0xc1b1('0x5e'),_0xc1b1('0x5f'),'category'];var _0x41e595=[_0xc1b1('0x60'),'made_sla',_0xc1b1('0x61'),'watch_list',_0xc1b1('0x62'),_0xc1b1('0x63'),_0xc1b1('0x64'),'hold_reason',_0xc1b1('0x65'),_0xc1b1('0x66'),_0xc1b1('0x67'),_0xc1b1('0x68'),_0xc1b1('0x69'),_0xc1b1('0x6a'),'sys_created_on','sys_domain','state','sys_created_by','knowledge','order',_0xc1b1('0x6b'),_0xc1b1('0x6c'),_0xc1b1('0x6d'),_0xc1b1('0x6e'),_0xc1b1('0x6f'),_0xc1b1('0x70'),_0xc1b1('0x71'),_0xc1b1('0x72'),_0xc1b1('0x73'),_0xc1b1('0x74'),'rfc',_0xc1b1('0x75'),'expected_start',_0xc1b1('0x76'),_0xc1b1('0x77'),_0xc1b1('0x78'),'work_end',_0xc1b1('0x79'),'resolved_at',_0xc1b1('0x7a'),_0xc1b1('0x7b'),'subcategory',_0xc1b1('0x7c'),_0xc1b1('0x7d'),_0xc1b1('0x5c'),_0xc1b1('0x7e'),_0xc1b1('0x7f'),_0xc1b1('0x80'),'assignment_group','business_stc','additional_assignee_list',_0xc1b1('0x81'),_0xc1b1('0x82'),_0xc1b1('0x5d'),_0xc1b1('0x83'),_0xc1b1('0x84'),'closed_by',_0xc1b1('0x85'),_0xc1b1('0x86'),_0xc1b1('0x87'),_0xc1b1('0x88'),_0xc1b1('0x89'),_0xc1b1('0x5e'),_0xc1b1('0x8a'),_0xc1b1('0x8b'),_0xc1b1('0x8c'),'reassignment_count',_0xc1b1('0x8d'),'assigned_to',_0xc1b1('0x5f'),_0xc1b1('0x8e'),_0xc1b1('0x8f'),_0xc1b1('0x90'),_0xc1b1('0x91'),'due_date','sys_mod_count',_0xc1b1('0x92'),_0xc1b1('0x93'),_0xc1b1('0x94'),_0xc1b1('0x95'),_0xc1b1('0x96'),_0xc1b1('0x97'),'category'];var _0x20cd7b='';var _0x147438='';var _0x4fea9f=[];var _0x3b970e='';var _0x24d49a='';var _0x707c54=[];var _0x268fb9='';var _0xd369ac='';var _0x1c19de={};var _0x59f45f='';return db[_0xc1b1('0x3d')][_0xc1b1('0x4b')]({'where':{'id':_0x3243cd[_0xc1b1('0x49')]['id']},'attributes':['id',_0xc1b1('0x98'),'password',_0xc1b1('0x99'),_0xc1b1('0x9a'),_0xc1b1('0x9b')]})[_0xc1b1('0x26')](handleEntityNotFound(_0x1e0e67,null))[_0xc1b1('0x26')](function(_0x2e2397){if(_0x2e2397){_0x59f45f=_0x2e2397[_0xc1b1('0x9a')];var _0x27e6a7=_0x59f45f[_0xc1b1('0x9c')](-0x1);if(_0x27e6a7==='/'){_0x59f45f=_0x59f45f['substring'](0x0,_0x59f45f['lastIndexOf'](_0x27e6a7));}_0xd369ac=util['format'](_0xc1b1('0x9d'),_0x59f45f);_0x268fb9=util[_0xc1b1('0x9e')](_0xc1b1('0x9f'),_0x59f45f);_0x1c19de={'user':_0x2e2397['username'],'pass':_0x2e2397[_0xc1b1('0xa0')]};var _0x599ac2={'method':_0xc1b1('0xa1'),'uri':_0xd369ac+'incident?sysparm_display_value=all','auth':_0x1c19de,'json':!![]};return rp(_0x599ac2);}})[_0xc1b1('0x26')](function(_0x20e25c){if(_0x20e25c[_0xc1b1('0xa2')][_0xc1b1('0x43')]>0x0){_0x20cd7b=_0x20e25c[_0xc1b1('0xa2')];}console[_0xc1b1('0xa3')](_0xc1b1('0xa4'),_0x20cd7b);_0x707c54=[];_0x147438=Object[_0xc1b1('0xa5')]([],_0x20cd7b);_['remove'](_0x147438,function(_0x36d1b7){return!_0x1d1b40['includes'](_0x36d1b7[_0xc1b1('0x29')]);});_0x147438['forEach'](function(_0x5779b1){var _0x2c4b9e=createFieldObject(_0x268fb9,_0x1c19de,_0x5779b1['internalType'],_0x5779b1[_0xc1b1('0x29')],_0x5779b1['label'],![]);_0x707c54[_0xc1b1('0xa6')](_0x2c4b9e);});return Promise['all'](_0x707c54);})[_0xc1b1('0x26')](function(_0x522b29){_0x4fea9f=_0x522b29;_0x3b970e=Object[_0xc1b1('0xa5')]([],_0x20cd7b);console[_0xc1b1('0xa3')](_0xc1b1('0xa7'),_0x20cd7b);_[_0xc1b1('0xa8')](_0x3b970e,function(_0xb21762){return _0x41e595['includes'](_0xb21762[_0xc1b1('0x29')]);});console[_0xc1b1('0xa3')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x3b970e);_0x707c54=[];_0x3b970e[_0xc1b1('0xa9')](function(_0x46ec60){var _0x573098=createFieldObject(_0x268fb9,_0x1c19de,_0x46ec60[_0xc1b1('0xaa')],_0x46ec60[_0xc1b1('0x29')],_0x46ec60[_0xc1b1('0xab')],!![]);_0x707c54[_0xc1b1('0xa6')](_0x573098);});return Promise[_0xc1b1('0xac')](_0x707c54);})[_0xc1b1('0x26')](function(_0x31156a){_0x24d49a=_0x31156a;var _0x2eacd6=_0x4fea9f[_0xc1b1('0xad')](_0x24d49a);return{'count':_0x2eacd6[_0xc1b1('0x43')],'rows':_0x2eacd6};})[_0xc1b1('0x26')](respondWithResult(_0x1e0e67,null))['catch'](function(_0x422fa5){console[_0xc1b1('0xa3')]('ServiceNow\x20error:\x20'+_0x422fa5);var _0x8d41f7=_0x3243cd['query'][_0xc1b1('0xae')]?0x1f4:_0x422fa5[_0xc1b1('0xaf')]||0x1f4;logger[_0xc1b1('0x27')](_0x422fa5[_0xc1b1('0x28')]);delete _0x422fa5['name'];if(_0x8d41f7===0x191){_0x8d41f7=0x190;}_0x1e0e67[_0xc1b1('0x1d')](_0x8d41f7)[_0xc1b1('0xb0')](_0x3243cd[_0xc1b1('0x31')][_0xc1b1('0xae')]?{'message':_0xc1b1('0xb1'),'statusCode':_0x422fa5['statusCode']}:_0x422fa5);});};function createFieldObject(_0x547d9a,_0x549e76,_0x36ff4f,_0x4afc86,_0xc5aebe,_0x16cd3b){return new Promise(function(_0x2087ec,_0x443bb6){var _0x3e3e48={'id':_0x4afc86,'name':_0xc5aebe,'custom':_0x16cd3b};if(_0x36ff4f===_0xc1b1('0xb2')){_0x3e3e48[_0xc1b1('0x45')]=[{'name':_0xc1b1('0xb3'),'value':_0xc1b1('0xb4')},{'name':_0xc1b1('0xb5'),'value':_0xc1b1('0xb6')}];_0x2087ec(_0x3e3e48);}else{var _0x125f00={'method':_0xc1b1('0xa1'),'uri':_0x547d9a+_0xc1b1('0xb7')+_0x4afc86,'auth':_0x549e76,'json':!![]};return rp(_0x125f00)[_0xc1b1('0x26')](function(_0x291ca0){var _0x1f44f6=[];if(_0x291ca0[_0xc1b1('0xa2')][_0xc1b1('0x43')]>0x0){_0x291ca0[_0xc1b1('0xa2')][_0xc1b1('0xa9')](function(_0x53f926){if(_0x53f926[_0xc1b1('0xb8')]===_0xc1b1('0xb6')){var _0x4585b0={'name':_0x53f926[_0xc1b1('0xab')],'value':_0x53f926[_0xc1b1('0xb9')]};_0x1f44f6['push'](_0x4585b0);}});}_0x3e3e48[_0xc1b1('0x45')]=_0x1f44f6;if(_0x3e3e48[_0xc1b1('0x45')]['length']>0x0){_0x2087ec(_0x3e3e48);}else{if(_0x16cd3b==![]){_0x2087ec();}else{_0x2087ec(_0x3e3e48);}}});}});} \ No newline at end of file +var _0x3631=['merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','getConfigurations','keys','ServicenowConfiguration','nolimit','addConfiguration','findOne','Subjects','channel','getDescriptions','getFields','made_sla','hold_reason','subcategory','close_code','incident_state','severity','category','parent','caused_by','watch_list','upon_reject','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','calendar_stc','closed_at','impact','work_notes_list','business_service','priority','sys_domain_path','rfc','opened_at','work_end','reopened_time','resolved_at','caller_id','work_notes','short_description','correlation_display','delivery_task','work_start','business_stc','additional_assignee_list','description','calendar_duration','close_notes','closed_by','parent_incident','sys_id','urgency','problem_id','company','reassignment_count','assigned_to','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','escalation','upon_approval','correlation_id','username','password','email','remoteUri','serverUrl','substring','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','error','Wrong\x20credentials','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter'];(function(_0x211b68,_0x3d6148){var _0x42ed49=function(_0x2ce171){while(--_0x2ce171){_0x211b68['push'](_0x211b68['shift']());}};_0x42ed49(++_0x3d6148);}(_0x3631,0x121));var _0x1363=function(_0x5530a9,_0x48e4c2){_0x5530a9=_0x5530a9-0x0;var _0x1c69f4=_0x3631[_0x5530a9];return _0x1c69f4;};'use strict';var emlformat=require(_0x1363('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1363('0x1'));var jsonpatch=require(_0x1363('0x2'));var rp=require(_0x1363('0x3'));var moment=require('moment');var BPromise=require(_0x1363('0x4'));var Mustache=require(_0x1363('0x5'));var util=require('util');var path=require(_0x1363('0x6'));var sox=require(_0x1363('0x7'));var csv=require(_0x1363('0x8'));var ejs=require(_0x1363('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1363('0xa'));var squel=require('squel');var crypto=require(_0x1363('0xb'));var jsforce=require(_0x1363('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1363('0x8'));var querystring=require(_0x1363('0xd'));var Papa=require(_0x1363('0xe'));var Redis=require(_0x1363('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1363('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1363('0x11'))('api');var utils=require(_0x1363('0x12'));var config=require(_0x1363('0x13'));var licenseUtil=require(_0x1363('0x14'));var db=require(_0x1363('0x15'))['db'];var integrations=require(_0x1363('0x16'));function respondWithStatusCode(_0x397abc,_0x415366){_0x415366=_0x415366||0xcc;return function(_0x229b86){if(_0x229b86){return _0x397abc['sendStatus'](_0x415366);}return _0x397abc[_0x1363('0x17')](_0x415366)[_0x1363('0x18')]();};}function respondWithResult(_0x56d267,_0x48e83a){_0x48e83a=_0x48e83a||0xc8;return function(_0x361d70){if(_0x361d70){return _0x56d267[_0x1363('0x17')](_0x48e83a)[_0x1363('0x19')](_0x361d70);}};}function respondWithFilteredResult(_0x3d60df,_0x4bcb96){return function(_0x1a6984){if(_0x1a6984){var _0x16f168=typeof _0x4bcb96[_0x1363('0x1a')]===_0x1363('0x1b')&&typeof _0x4bcb96['limit']===_0x1363('0x1b');var _0x5dc04d=_0x1a6984[_0x1363('0x1c')];var _0x41b99b=_0x16f168?0x0:_0x4bcb96[_0x1363('0x1a')];var _0x23840b=_0x16f168?_0x1a6984[_0x1363('0x1c')]:_0x4bcb96['offset']+_0x4bcb96[_0x1363('0x1d')];var _0x4ea154;if(_0x23840b>=_0x5dc04d){_0x23840b=_0x5dc04d;_0x4ea154=0xc8;}else{_0x4ea154=0xce;}_0x3d60df['status'](_0x4ea154);return _0x3d60df[_0x1363('0x1e')](_0x1363('0x1f'),_0x41b99b+'-'+_0x23840b+'/'+_0x5dc04d)[_0x1363('0x19')](_0x1a6984);}return null;};}function patchUpdates(_0x34dd5e){return function(_0x22fd6e){try{jsonpatch[_0x1363('0x20')](_0x22fd6e,_0x34dd5e,!![]);}catch(_0x208cd5){return BPromise[_0x1363('0x21')](_0x208cd5);}return _0x22fd6e[_0x1363('0x22')]();};}function saveUpdates(_0x5185eb,_0x2cbf54){return function(_0x45de70){if(_0x45de70){return _0x45de70[_0x1363('0x23')](_0x5185eb)[_0x1363('0x24')](function(_0x19af82){return _0x19af82;});}return null;};}function removeEntity(_0x679b53,_0x3d967c){return function(_0x28a9af){if(_0x28a9af){return _0x28a9af[_0x1363('0x25')]()[_0x1363('0x24')](function(){_0x679b53[_0x1363('0x17')](0xcc)[_0x1363('0x18')]();});}};}function handleEntityNotFound(_0x802abe,_0xeda736){return function(_0x11072a){if(!_0x11072a){_0x802abe[_0x1363('0x26')](0x194);}return _0x11072a;};}function handleError(_0x111120,_0x42d4d6){_0x42d4d6=_0x42d4d6||0x1f4;return function(_0x5173e8){logger['error'](_0x5173e8[_0x1363('0x27')]);if(_0x5173e8[_0x1363('0x28')]){delete _0x5173e8[_0x1363('0x28')];}_0x111120['status'](_0x42d4d6)[_0x1363('0x29')](_0x5173e8);};}exports['index']=function(_0x469a82,_0x56d3a8){var _0x588409={},_0x58b420={},_0x351905={'count':0x0,'rows':[]};var _0x1b6895=_[_0x1363('0x2a')](db[_0x1363('0x2b')][_0x1363('0x2c')],function(_0xeb45fa){return{'name':_0xeb45fa[_0x1363('0x2d')],'type':_0xeb45fa[_0x1363('0x2e')][_0x1363('0x2f')]};});_0x58b420[_0x1363('0x30')]=_[_0x1363('0x2a')](_0x1b6895,'name');_0x58b420[_0x1363('0x31')]=_['keys'](_0x469a82[_0x1363('0x31')]);_0x58b420['filters']=_[_0x1363('0x32')](_0x58b420[_0x1363('0x30')],_0x58b420[_0x1363('0x31')]);_0x588409[_0x1363('0x33')]=_[_0x1363('0x32')](_0x58b420[_0x1363('0x30')],qs[_0x1363('0x34')](_0x469a82[_0x1363('0x31')]['fields']));_0x588409[_0x1363('0x33')]=_0x588409[_0x1363('0x33')][_0x1363('0x35')]?_0x588409['attributes']:_0x58b420['model'];if(!_0x469a82[_0x1363('0x31')][_0x1363('0x36')]('nolimit')){_0x588409[_0x1363('0x1d')]=qs[_0x1363('0x1d')](_0x469a82[_0x1363('0x31')][_0x1363('0x1d')]);_0x588409['offset']=qs['offset'](_0x469a82[_0x1363('0x31')][_0x1363('0x1a')]);}_0x588409[_0x1363('0x37')]=qs['sort'](_0x469a82[_0x1363('0x31')][_0x1363('0x38')]);_0x588409[_0x1363('0x39')]=qs[_0x1363('0x3a')](_[_0x1363('0x3b')](_0x469a82[_0x1363('0x31')],_0x58b420[_0x1363('0x3a')]),_0x1b6895);if(_0x469a82[_0x1363('0x31')][_0x1363('0x3c')]){_0x588409[_0x1363('0x39')]=_['merge'](_0x588409[_0x1363('0x39')],{'$or':_[_0x1363('0x2a')](_0x1b6895,function(_0x3e3b46){if(_0x3e3b46[_0x1363('0x2e')]!=='VIRTUAL'){var _0x525d0f={};_0x525d0f[_0x3e3b46[_0x1363('0x28')]]={'$like':'%'+_0x469a82['query']['filter']+'%'};return _0x525d0f;}})});}_0x588409=_[_0x1363('0x3d')]({},_0x588409,_0x469a82[_0x1363('0x3e')]);var _0x421c51={'where':_0x588409[_0x1363('0x39')]};return db[_0x1363('0x2b')][_0x1363('0x1c')](_0x421c51)[_0x1363('0x24')](function(_0x40b1b1){_0x351905[_0x1363('0x1c')]=_0x40b1b1;if(_0x469a82[_0x1363('0x31')][_0x1363('0x3f')]){_0x588409[_0x1363('0x40')]=[{'all':!![]}];}return db[_0x1363('0x2b')][_0x1363('0x41')](_0x588409);})[_0x1363('0x24')](function(_0x6f0cc4){_0x351905[_0x1363('0x42')]=_0x6f0cc4;return _0x351905;})[_0x1363('0x24')](respondWithFilteredResult(_0x56d3a8,_0x588409))[_0x1363('0x43')](handleError(_0x56d3a8,null));};exports['show']=function(_0x41abdc,_0x31de07){var _0x419d45={'raw':![],'where':{'id':_0x41abdc[_0x1363('0x44')]['id']}},_0x2e857c={};_0x2e857c['model']=_['keys'](db['ServicenowAccount'][_0x1363('0x2c')]);_0x2e857c[_0x1363('0x31')]=_['keys'](_0x41abdc['query']);_0x2e857c['filters']=_[_0x1363('0x32')](_0x2e857c[_0x1363('0x30')],_0x2e857c[_0x1363('0x31')]);_0x419d45[_0x1363('0x33')]=_['intersection'](_0x2e857c[_0x1363('0x30')],qs[_0x1363('0x34')](_0x41abdc['query'][_0x1363('0x34')]));_0x419d45[_0x1363('0x33')]=_0x419d45['attributes'][_0x1363('0x35')]?_0x419d45[_0x1363('0x33')]:_0x2e857c[_0x1363('0x30')];if(_0x41abdc[_0x1363('0x31')]['includeAll']){_0x419d45['include']=[{'all':!![]}];}_0x419d45=_[_0x1363('0x3d')]({},_0x419d45,_0x41abdc[_0x1363('0x3e')]);return db['ServicenowAccount'][_0x1363('0x45')](_0x419d45)[_0x1363('0x24')](handleEntityNotFound(_0x31de07,null))['then'](respondWithResult(_0x31de07,null))['catch'](handleError(_0x31de07,null));};exports[_0x1363('0x46')]=function(_0x3ed733,_0x34a66a){return db[_0x1363('0x2b')]['create'](_0x3ed733[_0x1363('0x47')],{})[_0x1363('0x24')](respondWithResult(_0x34a66a,0xc9))[_0x1363('0x43')](handleError(_0x34a66a,null));};exports['update']=function(_0x2ba166,_0x5cad31){if(_0x2ba166[_0x1363('0x47')]['id']){delete _0x2ba166['body']['id'];}return db['ServicenowAccount'][_0x1363('0x45')]({'where':{'id':_0x2ba166[_0x1363('0x44')]['id']}})['then'](handleEntityNotFound(_0x5cad31,null))[_0x1363('0x24')](saveUpdates(_0x2ba166['body'],null))[_0x1363('0x24')](respondWithResult(_0x5cad31,null))[_0x1363('0x43')](handleError(_0x5cad31,null));};exports['destroy']=function(_0x1e29bc,_0x17f03d){return db['ServicenowAccount']['find']({'where':{'id':_0x1e29bc[_0x1363('0x44')]['id']}})[_0x1363('0x24')](handleEntityNotFound(_0x17f03d,null))[_0x1363('0x24')](removeEntity(_0x17f03d,null))['catch'](handleError(_0x17f03d,null));};exports[_0x1363('0x48')]=function(_0x1bf65a,_0x1eb8f6,_0x4c3334){var _0x46dff2={};var _0x4169d6={};var _0x28ac3f;var _0x5429fe;return db[_0x1363('0x2b')]['findOne']({'where':{'id':_0x1bf65a[_0x1363('0x44')]['id']}})[_0x1363('0x24')](handleEntityNotFound(_0x1eb8f6,null))[_0x1363('0x24')](function(_0x54b5c6){if(_0x54b5c6){_0x28ac3f=_0x54b5c6;_0x4169d6[_0x1363('0x30')]=_[_0x1363('0x49')](db[_0x1363('0x4a')]['rawAttributes']);_0x4169d6[_0x1363('0x31')]=_[_0x1363('0x49')](_0x1bf65a[_0x1363('0x31')]);_0x4169d6[_0x1363('0x3a')]=_[_0x1363('0x32')](_0x4169d6['model'],_0x4169d6['query']);_0x46dff2[_0x1363('0x33')]=_[_0x1363('0x32')](_0x4169d6[_0x1363('0x30')],qs['fields'](_0x1bf65a[_0x1363('0x31')]['fields']));_0x46dff2[_0x1363('0x33')]=_0x46dff2['attributes'][_0x1363('0x35')]?_0x46dff2['attributes']:_0x4169d6[_0x1363('0x30')];_0x46dff2[_0x1363('0x37')]=qs[_0x1363('0x38')](_0x1bf65a[_0x1363('0x31')][_0x1363('0x38')]);_0x46dff2[_0x1363('0x39')]=qs[_0x1363('0x3a')](_['pick'](_0x1bf65a[_0x1363('0x31')],_0x4169d6[_0x1363('0x3a')]));if(_0x1bf65a[_0x1363('0x31')]['filter']){_0x46dff2[_0x1363('0x39')]=_[_0x1363('0x3d')](_0x46dff2[_0x1363('0x39')],{'$or':_['map'](_0x46dff2['attributes'],function(_0x3cc709){var _0x4a1230={};_0x4a1230[_0x3cc709]={'$like':'%'+_0x1bf65a[_0x1363('0x31')][_0x1363('0x3c')]+'%'};return _0x4a1230;})});}_0x46dff2=_['merge']({},_0x46dff2,_0x1bf65a['options']);return _0x28ac3f[_0x1363('0x48')](_0x46dff2);}})[_0x1363('0x24')](function(_0x3c7fe0){if(_0x3c7fe0){_0x5429fe=_0x3c7fe0[_0x1363('0x35')];if(!_0x1bf65a[_0x1363('0x31')][_0x1363('0x36')](_0x1363('0x4b'))){_0x46dff2['limit']=qs[_0x1363('0x1d')](_0x1bf65a[_0x1363('0x31')][_0x1363('0x1d')]);_0x46dff2[_0x1363('0x1a')]=qs[_0x1363('0x1a')](_0x1bf65a[_0x1363('0x31')]['offset']);}return _0x28ac3f['getConfigurations'](_0x46dff2);}})[_0x1363('0x24')](function(_0x5a632d){if(_0x5a632d){return _0x5a632d?{'count':_0x5429fe,'rows':_0x5a632d}:null;}})['then'](respondWithResult(_0x1eb8f6,null))['catch'](handleError(_0x1eb8f6,null));};exports[_0x1363('0x4c')]=function(_0x170dfb,_0x59924a,_0x5ed1eb){if(_0x170dfb[_0x1363('0x47')]['id']){delete _0x170dfb['body']['id'];}return db['ServicenowAccount'][_0x1363('0x4d')]({'where':{'id':_0x170dfb[_0x1363('0x44')]['id']}})['then'](handleEntityNotFound(_0x59924a,null))[_0x1363('0x24')](function(_0x2ba1cc){if(_0x2ba1cc){_0x170dfb['body']['AccountId']=_0x2ba1cc['id'];_0x170dfb['body'][_0x1363('0x4e')]=integrations['getSubjects'](_0x170dfb[_0x1363('0x47')][_0x1363('0x4f')],_0x170dfb[_0x1363('0x47')][_0x1363('0x2e')]);_0x170dfb['body']['Descriptions']=integrations[_0x1363('0x50')](_0x170dfb['body'][_0x1363('0x4f')],_0x170dfb[_0x1363('0x47')][_0x1363('0x2e')]);return db[_0x1363('0x4a')][_0x1363('0x46')](_0x170dfb[_0x1363('0x47')],{'include':[{'model':db['ServicenowField'],'as':'Subjects'},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})[_0x1363('0x24')](respondWithResult(_0x59924a,null))[_0x1363('0x43')](handleError(_0x59924a,null));};exports[_0x1363('0x51')]=function(_0x211cb4,_0x589b23,_0x58b4de){var _0x2ce2ac=[_0x1363('0x52'),_0x1363('0x53'),'knowledge',_0x1363('0x54'),_0x1363('0x55'),'notify',_0x1363('0x56'),_0x1363('0x57'),_0x1363('0x58')];var _0x14b170=[_0x1363('0x59'),_0x1363('0x52'),_0x1363('0x5a'),_0x1363('0x5b'),_0x1363('0x5c'),'sys_updated_on','child_incidents','hold_reason',_0x1363('0x5d'),_0x1363('0x5e'),_0x1363('0x5f'),_0x1363('0x60'),_0x1363('0x61'),_0x1363('0x62'),_0x1363('0x63'),'sys_domain','state','sys_created_by','knowledge',_0x1363('0x37'),_0x1363('0x64'),_0x1363('0x65'),'cmdb_ci','delivery_plan',_0x1363('0x66'),'active',_0x1363('0x67'),_0x1363('0x68'),_0x1363('0x69'),_0x1363('0x6a'),_0x1363('0x6b'),'time_worked','expected_start',_0x1363('0x6c'),'business_duration','group_list',_0x1363('0x6d'),_0x1363('0x6e'),_0x1363('0x6f'),_0x1363('0x70'),'approval_set',_0x1363('0x54'),_0x1363('0x71'),_0x1363('0x72'),_0x1363('0x55'),_0x1363('0x73'),_0x1363('0x74'),_0x1363('0x75'),'assignment_group',_0x1363('0x76'),_0x1363('0x77'),_0x1363('0x78'),_0x1363('0x79'),'notify','sys_class_name',_0x1363('0x7a'),_0x1363('0x7b'),'follow_up',_0x1363('0x7c'),_0x1363('0x7d'),'contact_type','reopened_by','incident_state',_0x1363('0x7e'),_0x1363('0x7f'),_0x1363('0x80'),_0x1363('0x81'),'activity_due',_0x1363('0x82'),_0x1363('0x57'),_0x1363('0x83'),_0x1363('0x84'),_0x1363('0x85'),_0x1363('0x86'),'due_date',_0x1363('0x87'),_0x1363('0x88'),'sys_tags',_0x1363('0x89'),_0x1363('0x8a'),_0x1363('0x8b'),'location',_0x1363('0x58')];var _0x3de90a='';var _0x571549='';var _0x5f5d00=[];var _0x26883d='';var _0x2c581e='';var _0x22482f=[];var _0x599fc0='';var _0x286e68='';var _0x48708d={};var _0x41633c='';return db[_0x1363('0x2b')]['findOne']({'where':{'id':_0x211cb4[_0x1363('0x44')]['id']},'attributes':['id',_0x1363('0x8c'),_0x1363('0x8d'),_0x1363('0x8e'),_0x1363('0x8f'),_0x1363('0x90')]})[_0x1363('0x24')](handleEntityNotFound(_0x589b23,null))['then'](function(_0x320a7e){if(_0x320a7e){_0x41633c=_0x320a7e['remoteUri'];var _0x12cb50=_0x41633c['slice'](-0x1);if(_0x12cb50==='/'){_0x41633c=_0x41633c[_0x1363('0x91')](0x0,_0x41633c[_0x1363('0x92')](_0x12cb50));}_0x286e68=util[_0x1363('0x93')]('%s/api/now/doc/table/schema/',_0x41633c);_0x599fc0=util['format'](_0x1363('0x94'),_0x41633c);_0x48708d={'user':_0x320a7e['username'],'pass':_0x320a7e[_0x1363('0x8d')]};var _0x1d1764={'method':_0x1363('0x95'),'uri':_0x286e68+_0x1363('0x96'),'auth':_0x48708d,'json':!![]};return rp(_0x1d1764);}})[_0x1363('0x24')](function(_0x2a252c){if(_0x2a252c[_0x1363('0x97')][_0x1363('0x35')]>0x0){_0x3de90a=_0x2a252c[_0x1363('0x97')];}console[_0x1363('0x98')](_0x1363('0x99'),_0x3de90a);_0x22482f=[];_0x571549=Object[_0x1363('0x9a')]([],_0x3de90a);_[_0x1363('0x9b')](_0x571549,function(_0x708528){return!_0x2ce2ac[_0x1363('0x9c')](_0x708528[_0x1363('0x28')]);});_0x571549[_0x1363('0x9d')](function(_0x5bcadd){var _0x3b7426=createFieldObject(_0x599fc0,_0x48708d,_0x5bcadd[_0x1363('0x9e')],_0x5bcadd[_0x1363('0x28')],_0x5bcadd['label'],![]);_0x22482f[_0x1363('0x9f')](_0x3b7426);});return Promise[_0x1363('0xa0')](_0x22482f);})[_0x1363('0x24')](function(_0x77cf6c){_0x5f5d00=_0x77cf6c;_0x26883d=Object[_0x1363('0x9a')]([],_0x3de90a);console[_0x1363('0x98')](_0x1363('0xa1'),_0x3de90a);_[_0x1363('0x9b')](_0x26883d,function(_0x528e91){return _0x14b170['includes'](_0x528e91[_0x1363('0x28')]);});console[_0x1363('0x98')](_0x1363('0xa2'),_0x26883d);_0x22482f=[];_0x26883d[_0x1363('0x9d')](function(_0x4756a6){var _0x6385a7=createFieldObject(_0x599fc0,_0x48708d,_0x4756a6[_0x1363('0x9e')],_0x4756a6['name'],_0x4756a6['label'],!![]);_0x22482f[_0x1363('0x9f')](_0x6385a7);});return Promise[_0x1363('0xa0')](_0x22482f);})[_0x1363('0x24')](function(_0x4a70f3){_0x2c581e=_0x4a70f3;var _0x4ee7fc=_0x5f5d00[_0x1363('0xa3')](_0x2c581e);return{'count':_0x4ee7fc['length'],'rows':_0x4ee7fc};})[_0x1363('0x24')](respondWithResult(_0x589b23,null))[_0x1363('0x43')](function(_0x58f78b){console['log'](_0x1363('0xa4')+_0x58f78b);var _0xfb1959=_0x211cb4[_0x1363('0x31')][_0x1363('0xa5')]?0x1f4:_0x58f78b['statusCode']||0x1f4;logger[_0x1363('0xa6')](_0x58f78b[_0x1363('0x27')]);delete _0x58f78b[_0x1363('0x28')];if(_0xfb1959===0x191){_0xfb1959=0x190;}_0x589b23[_0x1363('0x17')](_0xfb1959)[_0x1363('0x29')](_0x211cb4[_0x1363('0x31')][_0x1363('0xa5')]?{'message':_0x1363('0xa7'),'statusCode':_0x58f78b['statusCode']}:_0x58f78b);});};function createFieldObject(_0x384a04,_0xc163f6,_0x49e4d7,_0x1350dc,_0x423216,_0x9a58b7){return new Promise(function(_0x4f6dd1,_0x675ca9){var _0x9af933={'id':_0x1350dc,'name':_0x423216,'custom':_0x9a58b7};if(_0x49e4d7==='boolean'){_0x9af933[_0x1363('0x3e')]=[{'name':_0x1363('0xa8'),'value':_0x1363('0xa9')},{'name':_0x1363('0xaa'),'value':_0x1363('0xab')}];_0x4f6dd1(_0x9af933);}else{var _0x142a74={'method':'GET','uri':_0x384a04+_0x1363('0xac')+_0x1350dc,'auth':_0xc163f6,'json':!![]};return rp(_0x142a74)[_0x1363('0x24')](function(_0x5550e3){var _0x37c603=[];if(_0x5550e3[_0x1363('0x97')][_0x1363('0x35')]>0x0){_0x5550e3[_0x1363('0x97')][_0x1363('0x9d')](function(_0x37d4e6){if(_0x37d4e6[_0x1363('0xad')]==='false'){var _0x188cf9={'name':_0x37d4e6['label'],'value':_0x37d4e6[_0x1363('0xae')]};_0x37c603['push'](_0x188cf9);}});}_0x9af933[_0x1363('0x3e')]=_0x37c603;if(_0x9af933[_0x1363('0x3e')][_0x1363('0x35')]>0x0){_0x4f6dd1(_0x9af933);}else{if(_0x9a58b7==![]){_0x4f6dd1();}else{_0x4f6dd1(_0x9af933);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 22241ca..f6e2178 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 _0xbd51=['./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','api','moment','bluebird'];(function(_0xcb0a3,_0x2ec62b){var _0x117b9f=function(_0x2eeb70){while(--_0x2eeb70){_0xcb0a3['push'](_0xcb0a3['shift']());}};_0x117b9f(++_0x2ec62b);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x428934,_0x534027){_0x428934=_0x428934-0x0;var _0x529b59=_0xbd51[_0x428934];return _0x529b59;};'use strict';var _=require(_0x1bd5('0x0'));var util=require('util');var logger=require(_0x1bd5('0x1'))(_0x1bd5('0x2'));var moment=require(_0x1bd5('0x3'));var BPromise=require(_0x1bd5('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(_0x1bd5('0x5'));var integrations=require(_0x1bd5('0x6'));module[_0x1bd5('0x7')]=function(_0x59ddfb,_0x29abea){return _0x59ddfb[_0x1bd5('0x8')](_0x1bd5('0x9'),attributes,{'tableName':_0x1bd5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeda8=['path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','lodash','util','api','moment','bluebird','request-promise'];(function(_0xb11278,_0x226f2b){var _0x3a7b4d=function(_0x2732eb){while(--_0x2732eb){_0xb11278['push'](_0xb11278['shift']());}};_0x3a7b4d(++_0x226f2b);}(_0xeda8,0x104));var _0x8eda=function(_0x1c1231,_0x53139e){_0x1c1231=_0x1c1231-0x0;var _0x1baa33=_0xeda8[_0x1c1231];return _0x1baa33;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var logger=require('../../config/logger')(_0x8eda('0x2'));var moment=require(_0x8eda('0x3'));var BPromise=require(_0x8eda('0x4'));var rp=require(_0x8eda('0x5'));var fs=require('fs');var path=require(_0x8eda('0x6'));var rimraf=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var attributes=require(_0x8eda('0x9'));var integrations=require(_0x8eda('0xa'));module[_0x8eda('0xb')]=function(_0x349361,_0x32abe8){return _0x349361['define'](_0x8eda('0xc'),attributes,{'tableName':_0x8eda('0xd'),'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 255dce5..b2d665b 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 _0x554e=['message','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','find','then','ShowServicenowAccount','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3b2a51,_0x1cecdc){var _0x55f1e6=function(_0x1d784a){while(--_0x1d784a){_0x3b2a51['push'](_0x3b2a51['shift']());}};_0x55f1e6(++_0x1cecdc);}(_0x554e,0x165));var _0xe554=function(_0x174202,_0x5c5292){_0x174202=_0x174202-0x0;var _0x4daa4a=_0x554e[_0x174202];return _0x4daa4a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe554('0x0'));var BPromise=require(_0xe554('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe554('0x2'));var db=require(_0xe554('0x3'))['db'];var utils=require(_0xe554('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xe554('0x5'));var jayson=require(_0xe554('0x6'));var client=jayson[_0xe554('0x7')][_0xe554('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x25c1f7,_0x416de3,_0x3afa10){return new BPromise(function(_0x3d10c7,_0x2cff02){return client[_0xe554('0x9')](_0x25c1f7,_0x3afa10)['then'](function(_0x3e74a9){logger[_0xe554('0xa')](_0xe554('0xb'),_0x416de3,_0xe554('0xc'));logger['debug'](_0xe554('0xd'),_0x416de3,_0xe554('0xc'),JSON[_0xe554('0xe')](_0x3e74a9));if(_0x3e74a9[_0xe554('0xf')]){if(_0x3e74a9['error'][_0xe554('0x10')]===0x1f4){logger['error'](_0xe554('0xb'),_0x416de3,_0x3e74a9[_0xe554('0xf')][_0xe554('0x11')]);return _0x2cff02(_0x3e74a9['error'][_0xe554('0x11')]);}logger['error'](_0xe554('0xb'),_0x416de3,_0x3e74a9[_0xe554('0xf')][_0xe554('0x11')]);return _0x3d10c7(_0x3e74a9[_0xe554('0xf')]['message']);}else{logger[_0xe554('0xa')](_0xe554('0xb'),_0x416de3,'request\x20sent');_0x3d10c7(_0x3e74a9['result']['message']);}})[_0xe554('0x12')](function(_0x50a2f8){logger['error'](_0xe554('0xb'),_0x416de3,_0x50a2f8);_0x2cff02(_0x50a2f8);});});}exports[_0xe554('0x13')]=function(_0x4c99ce){var _0x28263c=this;return new Promise(function(_0x484629,_0x2451ea){return db[_0xe554('0x14')][_0xe554('0x15')]({'raw':_0x4c99ce['options']?_0x4c99ce[_0xe554('0x16')][_0xe554('0x17')]===undefined?!![]:![]:!![],'where':_0x4c99ce['options']?_0x4c99ce[_0xe554('0x16')][_0xe554('0x18')]||null:null,'attributes':_0x4c99ce['options']?_0x4c99ce[_0xe554('0x16')][_0xe554('0x19')]||null:null,'limit':_0x4c99ce[_0xe554('0x16')]?_0x4c99ce[_0xe554('0x16')][_0xe554('0x1a')]||null:null,'include':_0x4c99ce[_0xe554('0x16')]?_0x4c99ce[_0xe554('0x16')][_0xe554('0x1b')]?_[_0xe554('0x1c')](_0x4c99ce[_0xe554('0x16')]['include'],function(_0x452c94){return{'model':db[_0x452c94[_0xe554('0x1d')]],'as':_0x452c94['as'],'attributes':_0x452c94[_0xe554('0x19')],'include':_0x452c94[_0xe554('0x1b')]?_[_0xe554('0x1c')](_0x452c94['include'],function(_0x28d376){return{'model':db[_0x28d376[_0xe554('0x1d')]],'as':_0x28d376['as'],'attributes':_0x28d376[_0xe554('0x19')],'include':_0x28d376[_0xe554('0x1b')]?_[_0xe554('0x1c')](_0x28d376[_0xe554('0x1b')],function(_0xda8002){return{'model':db[_0xda8002[_0xe554('0x1d')]],'as':_0xda8002['as'],'attributes':_0xda8002[_0xe554('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5dfff5){logger[_0xe554('0xa')](_0xe554('0x13'),_0x4c99ce);logger[_0xe554('0x1e')](_0xe554('0x13'),_0x4c99ce,JSON['stringify'](_0x5dfff5));_0x484629(_0x5dfff5);})[_0xe554('0x12')](function(_0x4dc751){logger['error'](_0xe554('0x13'),_0x4dc751['message'],_0x4c99ce);_0x2451ea(_0x28263c[_0xe554('0xf')](0x1f4,_0x4dc751[_0xe554('0x11')]));});});};exports['ShowServicenowAccount']=function(_0x22c58a){var _0x3b87c9=this;return new Promise(function(_0x4545e2,_0xf41b1f){return db[_0xe554('0x14')][_0xe554('0x1f')]({'raw':_0x22c58a['options']?_0x22c58a[_0xe554('0x16')][_0xe554('0x17')]===undefined?!![]:![]:!![],'where':_0x22c58a[_0xe554('0x16')]?_0x22c58a['options']['where']||null:null,'attributes':_0x22c58a['options']?_0x22c58a[_0xe554('0x16')][_0xe554('0x19')]||null:null,'include':_0x22c58a[_0xe554('0x16')]?_0x22c58a[_0xe554('0x16')][_0xe554('0x1b')]?_[_0xe554('0x1c')](_0x22c58a[_0xe554('0x16')][_0xe554('0x1b')],function(_0x41fa8e){return{'model':db[_0x41fa8e[_0xe554('0x1d')]],'as':_0x41fa8e['as'],'attributes':_0x41fa8e[_0xe554('0x19')],'include':_0x41fa8e[_0xe554('0x1b')]?_[_0xe554('0x1c')](_0x41fa8e[_0xe554('0x1b')],function(_0x3bb432){return{'model':db[_0x3bb432['model']],'as':_0x3bb432['as'],'attributes':_0x3bb432[_0xe554('0x19')],'include':_0x3bb432[_0xe554('0x1b')]?_[_0xe554('0x1c')](_0x3bb432[_0xe554('0x1b')],function(_0x2ca053){return{'model':db[_0x2ca053[_0xe554('0x1d')]],'as':_0x2ca053['as'],'attributes':_0x2ca053['attributes']};}):[]};}):[]};}):[]:[]})[_0xe554('0x20')](function(_0x35e6d7){logger[_0xe554('0xa')](_0xe554('0x21'),_0x22c58a);logger[_0xe554('0x1e')](_0xe554('0x21'),_0x22c58a,JSON[_0xe554('0xe')](_0x35e6d7));_0x4545e2(_0x35e6d7);})['catch'](function(_0x3f1066){logger[_0xe554('0xf')](_0xe554('0x21'),_0x3f1066[_0xe554('0x11')],_0x22c58a);_0xf41b1f(_0x3b87c9[_0xe554('0xf')](0x1f4,_0x3f1066[_0xe554('0x11')]));});});}; \ No newline at end of file +var _0x970b=['model','attributes','ShowServicenowAccount','ServicenowAccount','find','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetServicenowAccount','findAll','options','raw','where','limit','include','map'];(function(_0x2046eb,_0x567d7d){var _0x1bced9=function(_0x4894ce){while(--_0x4894ce){_0x2046eb['push'](_0x2046eb['shift']());}};_0x1bced9(++_0x567d7d);}(_0x970b,0xcb));var _0xb970=function(_0x3a0ebd,_0x47f368){_0x3a0ebd=_0x3a0ebd-0x0;var _0x51a660=_0x970b[_0x3a0ebd];return _0x51a660;};'use strict';var _=require('lodash');var util=require(_0xb970('0x0'));var moment=require(_0xb970('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb970('0x2'));var db=require(_0xb970('0x3'))['db'];var utils=require(_0xb970('0x4'));var logger=require('../../config/logger')(_0xb970('0x5'));var config=require('../../config/environment');var jayson=require(_0xb970('0x6'));var client=jayson[_0xb970('0x7')][_0xb970('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x493e8a,_0x4f033b,_0x4abc8c){return new BPromise(function(_0x14d6cf,_0x1b5021){return client['request'](_0x493e8a,_0x4abc8c)[_0xb970('0x9')](function(_0x3920b8){logger[_0xb970('0xa')](_0xb970('0xb'),_0x4f033b,_0xb970('0xc'));logger[_0xb970('0xd')](_0xb970('0xe'),_0x4f033b,_0xb970('0xc'),JSON[_0xb970('0xf')](_0x3920b8));if(_0x3920b8[_0xb970('0x10')]){if(_0x3920b8[_0xb970('0x10')][_0xb970('0x11')]===0x1f4){logger[_0xb970('0x10')](_0xb970('0xb'),_0x4f033b,_0x3920b8[_0xb970('0x10')][_0xb970('0x12')]);return _0x1b5021(_0x3920b8[_0xb970('0x10')][_0xb970('0x12')]);}logger[_0xb970('0x10')](_0xb970('0xb'),_0x4f033b,_0x3920b8[_0xb970('0x10')][_0xb970('0x12')]);return _0x14d6cf(_0x3920b8[_0xb970('0x10')][_0xb970('0x12')]);}else{logger[_0xb970('0xa')](_0xb970('0xb'),_0x4f033b,_0xb970('0xc'));_0x14d6cf(_0x3920b8['result'][_0xb970('0x12')]);}})[_0xb970('0x13')](function(_0x47e568){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x4f033b,_0x47e568);_0x1b5021(_0x47e568);});});}exports[_0xb970('0x14')]=function(_0x4cd4f7){var _0xcc2486=this;return new Promise(function(_0xedf495,_0x4720ac){return db['ServicenowAccount'][_0xb970('0x15')]({'raw':_0x4cd4f7[_0xb970('0x16')]?_0x4cd4f7['options'][_0xb970('0x17')]===undefined?!![]:![]:!![],'where':_0x4cd4f7[_0xb970('0x16')]?_0x4cd4f7['options'][_0xb970('0x18')]||null:null,'attributes':_0x4cd4f7[_0xb970('0x16')]?_0x4cd4f7[_0xb970('0x16')]['attributes']||null:null,'limit':_0x4cd4f7[_0xb970('0x16')]?_0x4cd4f7[_0xb970('0x16')][_0xb970('0x19')]||null:null,'include':_0x4cd4f7[_0xb970('0x16')]?_0x4cd4f7[_0xb970('0x16')][_0xb970('0x1a')]?_[_0xb970('0x1b')](_0x4cd4f7[_0xb970('0x16')][_0xb970('0x1a')],function(_0x23c9d2){return{'model':db[_0x23c9d2[_0xb970('0x1c')]],'as':_0x23c9d2['as'],'attributes':_0x23c9d2[_0xb970('0x1d')],'include':_0x23c9d2[_0xb970('0x1a')]?_[_0xb970('0x1b')](_0x23c9d2[_0xb970('0x1a')],function(_0x4efcc8){return{'model':db[_0x4efcc8['model']],'as':_0x4efcc8['as'],'attributes':_0x4efcc8[_0xb970('0x1d')],'include':_0x4efcc8[_0xb970('0x1a')]?_[_0xb970('0x1b')](_0x4efcc8[_0xb970('0x1a')],function(_0xa7a6fc){return{'model':db[_0xa7a6fc[_0xb970('0x1c')]],'as':_0xa7a6fc['as'],'attributes':_0xa7a6fc['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x507cbe){logger[_0xb970('0xa')](_0xb970('0x14'),_0x4cd4f7);logger[_0xb970('0xd')](_0xb970('0x14'),_0x4cd4f7,JSON[_0xb970('0xf')](_0x507cbe));_0xedf495(_0x507cbe);})[_0xb970('0x13')](function(_0x29122b){logger[_0xb970('0x10')](_0xb970('0x14'),_0x29122b[_0xb970('0x12')],_0x4cd4f7);_0x4720ac(_0xcc2486[_0xb970('0x10')](0x1f4,_0x29122b['message']));});});};exports[_0xb970('0x1e')]=function(_0x11901d){var _0x163b6f=this;return new Promise(function(_0x21f370,_0x28cc4d){return db[_0xb970('0x1f')][_0xb970('0x20')]({'raw':_0x11901d[_0xb970('0x16')]?_0x11901d['options'][_0xb970('0x17')]===undefined?!![]:![]:!![],'where':_0x11901d[_0xb970('0x16')]?_0x11901d[_0xb970('0x16')][_0xb970('0x18')]||null:null,'attributes':_0x11901d[_0xb970('0x16')]?_0x11901d[_0xb970('0x16')][_0xb970('0x1d')]||null:null,'include':_0x11901d[_0xb970('0x16')]?_0x11901d['options'][_0xb970('0x1a')]?_[_0xb970('0x1b')](_0x11901d[_0xb970('0x16')][_0xb970('0x1a')],function(_0x52975f){return{'model':db[_0x52975f['model']],'as':_0x52975f['as'],'attributes':_0x52975f[_0xb970('0x1d')],'include':_0x52975f['include']?_[_0xb970('0x1b')](_0x52975f[_0xb970('0x1a')],function(_0x519c27){return{'model':db[_0x519c27[_0xb970('0x1c')]],'as':_0x519c27['as'],'attributes':_0x519c27[_0xb970('0x1d')],'include':_0x519c27[_0xb970('0x1a')]?_['map'](_0x519c27[_0xb970('0x1a')],function(_0x1ee71c){return{'model':db[_0x1ee71c[_0xb970('0x1c')]],'as':_0x1ee71c['as'],'attributes':_0x1ee71c[_0xb970('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xb970('0x9')](function(_0x1a0a0c){logger[_0xb970('0xa')](_0xb970('0x1e'),_0x11901d);logger['debug']('ShowServicenowAccount',_0x11901d,JSON['stringify'](_0x1a0a0c));_0x21f370(_0x1a0a0c);})[_0xb970('0x13')](function(_0x27c048){logger[_0xb970('0x10')](_0xb970('0x1e'),_0x27c048[_0xb970('0x12')],_0x11901d);_0x28cc4d(_0x163b6f[_0xb970('0x10')](0x1f4,_0x27c048['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 1ffb957..76af9b2 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 _0x2d7b=['./intServicenowConfiguration.controller','isAuthenticated','index','get','/:id','/:id/subjects','getSubjects','getDescriptions','post','create','delete','destroy','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x5d3afa,_0x584768){var _0x230dd9=function(_0x5ca224){while(--_0x5ca224){_0x5d3afa['push'](_0x5d3afa['shift']());}};_0x230dd9(++_0x584768);}(_0x2d7b,0x174));var _0xb2d7=function(_0x1f0da2,_0x258e33){_0x1f0da2=_0x1f0da2-0x0;var _0x28e3e5=_0x2d7b[_0x1f0da2];return _0x28e3e5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb2d7('0x0'));var timeout=require(_0xb2d7('0x1'));var express=require(_0xb2d7('0x2'));var router=express['Router']();var fs_extra=require(_0xb2d7('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xb2d7('0x4'));var config=require(_0xb2d7('0x5'));var controller=require(_0xb2d7('0x6'));router['get']('/',auth[_0xb2d7('0x7')](),controller[_0xb2d7('0x8')]);router[_0xb2d7('0x9')](_0xb2d7('0xa'),auth[_0xb2d7('0x7')](),controller['show']);router[_0xb2d7('0x9')]('/:id/fields',auth[_0xb2d7('0x7')](),controller['getFields']);router[_0xb2d7('0x9')](_0xb2d7('0xb'),auth[_0xb2d7('0x7')](),controller[_0xb2d7('0xc')]);router[_0xb2d7('0x9')]('/:id/descriptions',auth[_0xb2d7('0x7')](),controller[_0xb2d7('0xd')]);router[_0xb2d7('0xe')]('/',auth[_0xb2d7('0x7')](),controller[_0xb2d7('0xf')]);router['put'](_0xb2d7('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xb2d7('0x10')](_0xb2d7('0xa'),auth[_0xb2d7('0x7')](),controller[_0xb2d7('0x11')]);module['exports']=router; \ No newline at end of file +var _0x053a=['../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra'];(function(_0x2892da,_0x191a40){var _0x28cff2=function(_0x57023d){while(--_0x57023d){_0x2892da['push'](_0x2892da['shift']());}};_0x28cff2(++_0x191a40);}(_0x053a,0x9c));var _0xa053=function(_0x3fd2af,_0x1f4699){_0x3fd2af=_0x3fd2af-0x0;var _0x5b00f2=_0x053a[_0x3fd2af];return _0x5b00f2;};'use strict';var multer=require('multer');var util=require(_0xa053('0x0'));var path=require('path');var timeout=require(_0xa053('0x1'));var express=require(_0xa053('0x2'));var router=express[_0xa053('0x3')]();var fs_extra=require(_0xa053('0x4'));var auth=require(_0xa053('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa053('0x6'));var controller=require(_0xa053('0x7'));router[_0xa053('0x8')]('/',auth[_0xa053('0x9')](),controller[_0xa053('0xa')]);router[_0xa053('0x8')](_0xa053('0xb'),auth['isAuthenticated'](),controller[_0xa053('0xc')]);router['get'](_0xa053('0xd'),auth[_0xa053('0x9')](),controller['getFields']);router[_0xa053('0x8')](_0xa053('0xe'),auth[_0xa053('0x9')](),controller[_0xa053('0xf')]);router[_0xa053('0x8')](_0xa053('0x10'),auth[_0xa053('0x9')](),controller[_0xa053('0x11')]);router[_0xa053('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa053('0x13')](_0xa053('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xa053('0x14')]('/:id',auth[_0xa053('0x9')](),controller[_0xa053('0x15')]);module[_0xa053('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 0e84ed5..f6ee95d 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 _0x25a9=['exports','STRING','sequelize'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x25a9,0x65));var _0x925a=function(_0x5e7ee9,_0x4dbc4b){_0x5e7ee9=_0x5e7ee9-0x0;var _0xadb900=_0x25a9[_0x5e7ee9];return _0xadb900;};'use strict';var Sequelize=require(_0x925a('0x0'));module[_0x925a('0x1')]={'name':{'type':Sequelize[_0x925a('0x2')]},'description':{'type':Sequelize[_0x925a('0x2')]}}; \ No newline at end of file +var _0x79f1=['STRING','exports'];(function(_0x41bac1,_0x4614d0){var _0x5112d8=function(_0x1d8d7e){while(--_0x1d8d7e){_0x41bac1['push'](_0x41bac1['shift']());}};_0x5112d8(++_0x4614d0);}(_0x79f1,0xf1));var _0x179f=function(_0xa4b8e1,_0x49d30b){_0xa4b8e1=_0xa4b8e1-0x0;var _0x507e42=_0x79f1[_0xa4b8e1];return _0x507e42;};'use strict';var Sequelize=require('sequelize');module[_0x179f('0x0')]={'name':{'type':Sequelize[_0x179f('0x1')]},'description':{'type':Sequelize[_0x179f('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 3a2d350..dc2f9d7 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 _0xc130=['name','send','index','type','key','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ServicenowConfiguration','includeAll','include','findAll','rows','params','rawAttributes','length','find','catch','create','body','getFields','hasOwnProperty','getSubjects','getDescriptions','findOne','ServicenowField','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy'];(function(_0x28e4d3,_0x53e75c){var _0x135a27=function(_0x4a7d84){while(--_0x4a7d84){_0x28e4d3['push'](_0x28e4d3['shift']());}};_0x135a27(++_0x53e75c);}(_0xc130,0x170));var _0x0c13=function(_0x189c2d,_0x442da0){_0x189c2d=_0x189c2d-0x0;var _0x40c7b8=_0xc130[_0x189c2d];return _0x40c7b8;};'use strict';var emlformat=require(_0x0c13('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0c13('0x1'));var jsonpatch=require(_0x0c13('0x2'));var rp=require('request-promise');var moment=require(_0x0c13('0x3'));var BPromise=require(_0x0c13('0x4'));var Mustache=require(_0x0c13('0x5'));var util=require(_0x0c13('0x6'));var path=require(_0x0c13('0x7'));var sox=require(_0x0c13('0x8'));var csv=require(_0x0c13('0x9'));var ejs=require(_0x0c13('0xa'));var fs=require('fs');var fs_extra=require(_0x0c13('0xb'));var _=require(_0x0c13('0xc'));var squel=require('squel');var crypto=require(_0x0c13('0xd'));var jsforce=require(_0x0c13('0xe'));var deskjs=require(_0x0c13('0xf'));var toCsv=require(_0x0c13('0x9'));var querystring=require(_0x0c13('0x10'));var Papa=require('papaparse');var Redis=require(_0x0c13('0x11'));var authService=require(_0x0c13('0x12'));var qs=require(_0x0c13('0x13'));var as=require(_0x0c13('0x14'));var hardwareService=require(_0x0c13('0x15'));var logger=require(_0x0c13('0x16'))(_0x0c13('0x17'));var utils=require(_0x0c13('0x18'));var config=require(_0x0c13('0x19'));var licenseUtil=require(_0x0c13('0x1a'));var db=require(_0x0c13('0x1b'))['db'];function respondWithStatusCode(_0x6ede08,_0x2bd7a2){_0x2bd7a2=_0x2bd7a2||0xcc;return function(_0x3f298a){if(_0x3f298a){return _0x6ede08['sendStatus'](_0x2bd7a2);}return _0x6ede08[_0x0c13('0x1c')](_0x2bd7a2)[_0x0c13('0x1d')]();};}function respondWithResult(_0x112107,_0x3dbff4){_0x3dbff4=_0x3dbff4||0xc8;return function(_0x1e8bea){if(_0x1e8bea){return _0x112107[_0x0c13('0x1c')](_0x3dbff4)[_0x0c13('0x1e')](_0x1e8bea);}};}function respondWithFilteredResult(_0x4fa851,_0x2a8930){return function(_0x5bc799){if(_0x5bc799){var _0xfb9b01=typeof _0x2a8930[_0x0c13('0x1f')]===_0x0c13('0x20')&&typeof _0x2a8930['limit']===_0x0c13('0x20');var _0x12daec=_0x5bc799[_0x0c13('0x21')];var _0x245384=_0xfb9b01?0x0:_0x2a8930[_0x0c13('0x1f')];var _0x47fb0a=_0xfb9b01?_0x5bc799['count']:_0x2a8930[_0x0c13('0x1f')]+_0x2a8930[_0x0c13('0x22')];var _0x2edd0f;if(_0x47fb0a>=_0x12daec){_0x47fb0a=_0x12daec;_0x2edd0f=0xc8;}else{_0x2edd0f=0xce;}_0x4fa851[_0x0c13('0x1c')](_0x2edd0f);return _0x4fa851[_0x0c13('0x23')](_0x0c13('0x24'),_0x245384+'-'+_0x47fb0a+'/'+_0x12daec)['json'](_0x5bc799);}return null;};}function patchUpdates(_0x407cc0){return function(_0x55467d){try{jsonpatch[_0x0c13('0x25')](_0x55467d,_0x407cc0,!![]);}catch(_0xe1670c){return BPromise['reject'](_0xe1670c);}return _0x55467d[_0x0c13('0x26')]();};}function saveUpdates(_0x2be050,_0x213891){return function(_0x28a786){if(_0x28a786){return _0x28a786[_0x0c13('0x27')](_0x2be050)[_0x0c13('0x28')](function(_0x49078a){return _0x49078a;});}return null;};}function removeEntity(_0x15bc40,_0x56ede5){return function(_0x1c9ee1){if(_0x1c9ee1){return _0x1c9ee1[_0x0c13('0x29')]()[_0x0c13('0x28')](function(){_0x15bc40[_0x0c13('0x1c')](0xcc)[_0x0c13('0x1d')]();});}};}function handleEntityNotFound(_0x426026,_0x936e2d){return function(_0x1b2b4e){if(!_0x1b2b4e){_0x426026['sendStatus'](0x194);}return _0x1b2b4e;};}function handleError(_0x2fc0af,_0x516b57){_0x516b57=_0x516b57||0x1f4;return function(_0x43e169){logger['error'](_0x43e169['stack']);if(_0x43e169['name']){delete _0x43e169[_0x0c13('0x2a')];}_0x2fc0af[_0x0c13('0x1c')](_0x516b57)[_0x0c13('0x2b')](_0x43e169);};}exports[_0x0c13('0x2c')]=function(_0x38a965,_0x58c1a7){var _0x31a4c7={},_0x1476f4={},_0x5dac22={'count':0x0,'rows':[]};var _0x3dedb6=_['map'](db['ServicenowConfiguration']['rawAttributes'],function(_0x2dadd3){return{'name':_0x2dadd3['fieldName'],'type':_0x2dadd3[_0x0c13('0x2d')][_0x0c13('0x2e')]};});_0x1476f4[_0x0c13('0x2f')]=_[_0x0c13('0x30')](_0x3dedb6,_0x0c13('0x2a'));_0x1476f4[_0x0c13('0x31')]=_[_0x0c13('0x32')](_0x38a965['query']);_0x1476f4[_0x0c13('0x33')]=_[_0x0c13('0x34')](_0x1476f4[_0x0c13('0x2f')],_0x1476f4[_0x0c13('0x31')]);_0x31a4c7[_0x0c13('0x35')]=_[_0x0c13('0x34')](_0x1476f4[_0x0c13('0x2f')],qs[_0x0c13('0x36')](_0x38a965['query']['fields']));_0x31a4c7[_0x0c13('0x35')]=_0x31a4c7[_0x0c13('0x35')]['length']?_0x31a4c7[_0x0c13('0x35')]:_0x1476f4['model'];if(!_0x38a965['query']['hasOwnProperty'](_0x0c13('0x37'))){_0x31a4c7[_0x0c13('0x22')]=qs[_0x0c13('0x22')](_0x38a965['query'][_0x0c13('0x22')]);_0x31a4c7[_0x0c13('0x1f')]=qs[_0x0c13('0x1f')](_0x38a965[_0x0c13('0x31')][_0x0c13('0x1f')]);}_0x31a4c7[_0x0c13('0x38')]=qs[_0x0c13('0x39')](_0x38a965[_0x0c13('0x31')]['sort']);_0x31a4c7[_0x0c13('0x3a')]=qs[_0x0c13('0x33')](_[_0x0c13('0x3b')](_0x38a965[_0x0c13('0x31')],_0x1476f4[_0x0c13('0x33')]),_0x3dedb6);if(_0x38a965[_0x0c13('0x31')][_0x0c13('0x3c')]){_0x31a4c7[_0x0c13('0x3a')]=_[_0x0c13('0x3d')](_0x31a4c7[_0x0c13('0x3a')],{'$or':_[_0x0c13('0x30')](_0x3dedb6,function(_0x575b8b){if(_0x575b8b[_0x0c13('0x2d')]!==_0x0c13('0x3e')){var _0x139311={};_0x139311[_0x575b8b[_0x0c13('0x2a')]]={'$like':'%'+_0x38a965[_0x0c13('0x31')][_0x0c13('0x3c')]+'%'};return _0x139311;}})});}_0x31a4c7=_[_0x0c13('0x3d')]({},_0x31a4c7,_0x38a965[_0x0c13('0x3f')]);var _0x37fc98={'where':_0x31a4c7[_0x0c13('0x3a')]};return db[_0x0c13('0x40')][_0x0c13('0x21')](_0x37fc98)[_0x0c13('0x28')](function(_0x4ad7e5){_0x5dac22[_0x0c13('0x21')]=_0x4ad7e5;if(_0x38a965[_0x0c13('0x31')][_0x0c13('0x41')]){_0x31a4c7[_0x0c13('0x42')]=[{'all':!![]}];}return db[_0x0c13('0x40')][_0x0c13('0x43')](_0x31a4c7);})['then'](function(_0x2ab6fd){_0x5dac22[_0x0c13('0x44')]=_0x2ab6fd;return _0x5dac22;})[_0x0c13('0x28')](respondWithFilteredResult(_0x58c1a7,_0x31a4c7))['catch'](handleError(_0x58c1a7,null));};exports['show']=function(_0x425dbb,_0x2e036f){var _0x2999ee={'raw':![],'where':{'id':_0x425dbb[_0x0c13('0x45')]['id']}},_0x2f51f6={};_0x2f51f6[_0x0c13('0x2f')]=_[_0x0c13('0x32')](db[_0x0c13('0x40')][_0x0c13('0x46')]);_0x2f51f6[_0x0c13('0x31')]=_[_0x0c13('0x32')](_0x425dbb[_0x0c13('0x31')]);_0x2f51f6[_0x0c13('0x33')]=_[_0x0c13('0x34')](_0x2f51f6[_0x0c13('0x2f')],_0x2f51f6[_0x0c13('0x31')]);_0x2999ee[_0x0c13('0x35')]=_['intersection'](_0x2f51f6[_0x0c13('0x2f')],qs[_0x0c13('0x36')](_0x425dbb['query'][_0x0c13('0x36')]));_0x2999ee['attributes']=_0x2999ee['attributes'][_0x0c13('0x47')]?_0x2999ee[_0x0c13('0x35')]:_0x2f51f6[_0x0c13('0x2f')];if(_0x425dbb[_0x0c13('0x31')]['includeAll']){_0x2999ee[_0x0c13('0x42')]=[{'all':!![]}];}_0x2999ee=_['merge']({},_0x2999ee,_0x425dbb[_0x0c13('0x3f')]);return db['ServicenowConfiguration'][_0x0c13('0x48')](_0x2999ee)[_0x0c13('0x28')](handleEntityNotFound(_0x2e036f,null))[_0x0c13('0x28')](respondWithResult(_0x2e036f,null))[_0x0c13('0x49')](handleError(_0x2e036f,null));};exports[_0x0c13('0x4a')]=function(_0x4aefbd,_0x2a6d89){return db[_0x0c13('0x40')][_0x0c13('0x4a')](_0x4aefbd[_0x0c13('0x4b')],{})[_0x0c13('0x28')](respondWithResult(_0x2a6d89,0xc9))[_0x0c13('0x49')](handleError(_0x2a6d89,null));};exports[_0x0c13('0x27')]=function(_0x24f2fb,_0x118b00){if(_0x24f2fb[_0x0c13('0x4b')]['id']){delete _0x24f2fb[_0x0c13('0x4b')]['id'];}return db[_0x0c13('0x40')][_0x0c13('0x48')]({'where':{'id':_0x24f2fb[_0x0c13('0x45')]['id']}})[_0x0c13('0x28')](handleEntityNotFound(_0x118b00,null))[_0x0c13('0x28')](saveUpdates(_0x24f2fb[_0x0c13('0x4b')],null))[_0x0c13('0x28')](respondWithResult(_0x118b00,null))['catch'](handleError(_0x118b00,null));};exports[_0x0c13('0x29')]=function(_0x687dc8,_0x482c3a){return db[_0x0c13('0x40')][_0x0c13('0x48')]({'where':{'id':_0x687dc8['params']['id']}})[_0x0c13('0x28')](handleEntityNotFound(_0x482c3a,null))[_0x0c13('0x28')](removeEntity(_0x482c3a,null))[_0x0c13('0x49')](handleError(_0x482c3a,null));};exports[_0x0c13('0x4c')]=function(_0x27a28f,_0x53d093,_0x2bf3b7){var _0x758547={};var _0x4fef5a={};var _0x8e52c;var _0x50dd8d;return db[_0x0c13('0x40')]['findOne']({'where':{'id':_0x27a28f[_0x0c13('0x45')]['id']}})[_0x0c13('0x28')](handleEntityNotFound(_0x53d093,null))[_0x0c13('0x28')](function(_0x4a4a69){if(_0x4a4a69){_0x8e52c=_0x4a4a69;_0x4fef5a['model']=_[_0x0c13('0x32')](db['ServicenowField']['rawAttributes']);_0x4fef5a['query']=_[_0x0c13('0x32')](_0x27a28f[_0x0c13('0x31')]);_0x4fef5a[_0x0c13('0x33')]=_[_0x0c13('0x34')](_0x4fef5a['model'],_0x4fef5a[_0x0c13('0x31')]);_0x758547['attributes']=_['intersection'](_0x4fef5a[_0x0c13('0x2f')],qs[_0x0c13('0x36')](_0x27a28f[_0x0c13('0x31')][_0x0c13('0x36')]));_0x758547[_0x0c13('0x35')]=_0x758547['attributes'][_0x0c13('0x47')]?_0x758547[_0x0c13('0x35')]:_0x4fef5a[_0x0c13('0x2f')];_0x758547[_0x0c13('0x38')]=qs['sort'](_0x27a28f[_0x0c13('0x31')][_0x0c13('0x39')]);_0x758547[_0x0c13('0x3a')]=qs[_0x0c13('0x33')](_[_0x0c13('0x3b')](_0x27a28f['query'],_0x4fef5a[_0x0c13('0x33')]));if(_0x27a28f[_0x0c13('0x31')][_0x0c13('0x3c')]){_0x758547[_0x0c13('0x3a')]=_['merge'](_0x758547[_0x0c13('0x3a')],{'$or':_['map'](_0x758547[_0x0c13('0x35')],function(_0x141757){var _0x165d9f={};_0x165d9f[_0x141757]={'$like':'%'+_0x27a28f['query'][_0x0c13('0x3c')]+'%'};return _0x165d9f;})});}_0x758547=_['merge']({},_0x758547,_0x27a28f['options']);return _0x8e52c[_0x0c13('0x4c')](_0x758547);}})['then'](function(_0x3ff5d9){if(_0x3ff5d9){_0x50dd8d=_0x3ff5d9[_0x0c13('0x47')];if(!_0x27a28f[_0x0c13('0x31')][_0x0c13('0x4d')](_0x0c13('0x37'))){_0x758547[_0x0c13('0x22')]=qs[_0x0c13('0x22')](_0x27a28f[_0x0c13('0x31')]['limit']);_0x758547['offset']=qs[_0x0c13('0x1f')](_0x27a28f['query'][_0x0c13('0x1f')]);}return _0x8e52c[_0x0c13('0x4c')](_0x758547);}})['then'](function(_0x3b4510){if(_0x3b4510){return _0x3b4510?{'count':_0x50dd8d,'rows':_0x3b4510}:null;}})[_0x0c13('0x28')](respondWithResult(_0x53d093,null))[_0x0c13('0x49')](handleError(_0x53d093,null));};exports['getSubjects']=function(_0x251985,_0xae5ee,_0x21e62d){var _0xdbacd={};var _0x5e80e4={};var _0x3793b4;var _0x2ca1f8;return db[_0x0c13('0x40')]['findOne']({'where':{'id':_0x251985[_0x0c13('0x45')]['id']}})[_0x0c13('0x28')](handleEntityNotFound(_0xae5ee,null))[_0x0c13('0x28')](function(_0x658911){if(_0x658911){_0x3793b4=_0x658911;_0x5e80e4[_0x0c13('0x2f')]=_[_0x0c13('0x32')](db['ServicenowField'][_0x0c13('0x46')]);_0x5e80e4[_0x0c13('0x31')]=_[_0x0c13('0x32')](_0x251985['query']);_0x5e80e4[_0x0c13('0x33')]=_[_0x0c13('0x34')](_0x5e80e4[_0x0c13('0x2f')],_0x5e80e4[_0x0c13('0x31')]);_0xdbacd['attributes']=_[_0x0c13('0x34')](_0x5e80e4[_0x0c13('0x2f')],qs['fields'](_0x251985[_0x0c13('0x31')]['fields']));_0xdbacd[_0x0c13('0x35')]=_0xdbacd[_0x0c13('0x35')][_0x0c13('0x47')]?_0xdbacd[_0x0c13('0x35')]:_0x5e80e4[_0x0c13('0x2f')];_0xdbacd[_0x0c13('0x38')]=qs[_0x0c13('0x39')](_0x251985[_0x0c13('0x31')][_0x0c13('0x39')]);_0xdbacd[_0x0c13('0x3a')]=qs['filters'](_[_0x0c13('0x3b')](_0x251985[_0x0c13('0x31')],_0x5e80e4[_0x0c13('0x33')]));if(_0x251985[_0x0c13('0x31')][_0x0c13('0x3c')]){_0xdbacd[_0x0c13('0x3a')]=_['merge'](_0xdbacd[_0x0c13('0x3a')],{'$or':_[_0x0c13('0x30')](_0xdbacd[_0x0c13('0x35')],function(_0x47cd08){var _0xb63a30={};_0xb63a30[_0x47cd08]={'$like':'%'+_0x251985['query']['filter']+'%'};return _0xb63a30;})});}_0xdbacd=_[_0x0c13('0x3d')]({},_0xdbacd,_0x251985[_0x0c13('0x3f')]);return _0x3793b4[_0x0c13('0x4e')](_0xdbacd);}})[_0x0c13('0x28')](function(_0x28b88e){if(_0x28b88e){_0x2ca1f8=_0x28b88e[_0x0c13('0x47')];if(!_0x251985[_0x0c13('0x31')][_0x0c13('0x4d')]('nolimit')){_0xdbacd[_0x0c13('0x22')]=qs[_0x0c13('0x22')](_0x251985[_0x0c13('0x31')][_0x0c13('0x22')]);_0xdbacd[_0x0c13('0x1f')]=qs[_0x0c13('0x1f')](_0x251985['query'][_0x0c13('0x1f')]);}return _0x3793b4['getSubjects'](_0xdbacd);}})[_0x0c13('0x28')](function(_0xd4e5b5){if(_0xd4e5b5){return _0xd4e5b5?{'count':_0x2ca1f8,'rows':_0xd4e5b5}:null;}})[_0x0c13('0x28')](respondWithResult(_0xae5ee,null))[_0x0c13('0x49')](handleError(_0xae5ee,null));};exports[_0x0c13('0x4f')]=function(_0x5da08f,_0x313511,_0x53d2d5){var _0x5896ab={};var _0x1a012d={};var _0x36aa0e;var _0x39be52;return db['ServicenowConfiguration'][_0x0c13('0x50')]({'where':{'id':_0x5da08f[_0x0c13('0x45')]['id']}})[_0x0c13('0x28')](handleEntityNotFound(_0x313511,null))[_0x0c13('0x28')](function(_0x57c252){if(_0x57c252){_0x36aa0e=_0x57c252;_0x1a012d[_0x0c13('0x2f')]=_[_0x0c13('0x32')](db[_0x0c13('0x51')][_0x0c13('0x46')]);_0x1a012d['query']=_[_0x0c13('0x32')](_0x5da08f[_0x0c13('0x31')]);_0x1a012d[_0x0c13('0x33')]=_[_0x0c13('0x34')](_0x1a012d[_0x0c13('0x2f')],_0x1a012d['query']);_0x5896ab[_0x0c13('0x35')]=_[_0x0c13('0x34')](_0x1a012d['model'],qs[_0x0c13('0x36')](_0x5da08f['query'][_0x0c13('0x36')]));_0x5896ab[_0x0c13('0x35')]=_0x5896ab[_0x0c13('0x35')][_0x0c13('0x47')]?_0x5896ab[_0x0c13('0x35')]:_0x1a012d[_0x0c13('0x2f')];_0x5896ab[_0x0c13('0x38')]=qs[_0x0c13('0x39')](_0x5da08f[_0x0c13('0x31')]['sort']);_0x5896ab[_0x0c13('0x3a')]=qs[_0x0c13('0x33')](_[_0x0c13('0x3b')](_0x5da08f[_0x0c13('0x31')],_0x1a012d[_0x0c13('0x33')]));if(_0x5da08f[_0x0c13('0x31')][_0x0c13('0x3c')]){_0x5896ab[_0x0c13('0x3a')]=_[_0x0c13('0x3d')](_0x5896ab[_0x0c13('0x3a')],{'$or':_[_0x0c13('0x30')](_0x5896ab[_0x0c13('0x35')],function(_0x1c9862){var _0x1ac615={};_0x1ac615[_0x1c9862]={'$like':'%'+_0x5da08f[_0x0c13('0x31')][_0x0c13('0x3c')]+'%'};return _0x1ac615;})});}_0x5896ab=_[_0x0c13('0x3d')]({},_0x5896ab,_0x5da08f[_0x0c13('0x3f')]);return _0x36aa0e[_0x0c13('0x4f')](_0x5896ab);}})[_0x0c13('0x28')](function(_0x4e2f74){if(_0x4e2f74){_0x39be52=_0x4e2f74['length'];if(!_0x5da08f[_0x0c13('0x31')]['hasOwnProperty'](_0x0c13('0x37'))){_0x5896ab[_0x0c13('0x22')]=qs[_0x0c13('0x22')](_0x5da08f[_0x0c13('0x31')]['limit']);_0x5896ab[_0x0c13('0x1f')]=qs[_0x0c13('0x1f')](_0x5da08f[_0x0c13('0x31')][_0x0c13('0x1f')]);}return _0x36aa0e[_0x0c13('0x4f')](_0x5896ab);}})[_0x0c13('0x28')](function(_0x249785){if(_0x249785){return _0x249785?{'count':_0x39be52,'rows':_0x249785}:null;}})[_0x0c13('0x28')](respondWithResult(_0x313511,null))['catch'](handleError(_0x313511,null));}; \ No newline at end of file +var _0xb979=['includeAll','find','create','body','update','getFields','findOne','ServicenowField','sort','nolimit','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','order','where','pick','merge','VIRTUAL','filter','options','include','findAll','catch','show','params'];(function(_0x47cc5b,_0x568584){var _0x2efe35=function(_0x454831){while(--_0x454831){_0x47cc5b['push'](_0x47cc5b['shift']());}};_0x2efe35(++_0x568584);}(_0xb979,0x19d));var _0x9b97=function(_0x453f0b,_0x347eba){_0x453f0b=_0x453f0b-0x0;var _0xacc07f=_0xb979[_0x453f0b];return _0xacc07f;};'use strict';var emlformat=require(_0x9b97('0x0'));var rimraf=require(_0x9b97('0x1'));var zipdir=require(_0x9b97('0x2'));var jsonpatch=require(_0x9b97('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9b97('0x4'));var Mustache=require(_0x9b97('0x5'));var util=require(_0x9b97('0x6'));var path=require('path');var sox=require(_0x9b97('0x7'));var csv=require(_0x9b97('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9b97('0x9'));var _=require('lodash');var squel=require(_0x9b97('0xa'));var crypto=require(_0x9b97('0xb'));var jsforce=require(_0x9b97('0xc'));var deskjs=require(_0x9b97('0xd'));var toCsv=require(_0x9b97('0x8'));var querystring=require('querystring');var Papa=require(_0x9b97('0xe'));var Redis=require(_0x9b97('0xf'));var authService=require(_0x9b97('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9b97('0x11'))(_0x9b97('0x12'));var utils=require(_0x9b97('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9b97('0x14'))['db'];function respondWithStatusCode(_0x4c064b,_0x201f69){_0x201f69=_0x201f69||0xcc;return function(_0x20271d){if(_0x20271d){return _0x4c064b[_0x9b97('0x15')](_0x201f69);}return _0x4c064b[_0x9b97('0x16')](_0x201f69)[_0x9b97('0x17')]();};}function respondWithResult(_0x582a4c,_0x5c88ac){_0x5c88ac=_0x5c88ac||0xc8;return function(_0x591a49){if(_0x591a49){return _0x582a4c['status'](_0x5c88ac)['json'](_0x591a49);}};}function respondWithFilteredResult(_0x1a5541,_0x273789){return function(_0x6681f){if(_0x6681f){var _0x16ea71=typeof _0x273789['offset']===_0x9b97('0x18')&&typeof _0x273789[_0x9b97('0x19')]===_0x9b97('0x18');var _0x4188ad=_0x6681f[_0x9b97('0x1a')];var _0x240b5c=_0x16ea71?0x0:_0x273789[_0x9b97('0x1b')];var _0x1b84a4=_0x16ea71?_0x6681f[_0x9b97('0x1a')]:_0x273789[_0x9b97('0x1b')]+_0x273789[_0x9b97('0x19')];var _0x33994b;if(_0x1b84a4>=_0x4188ad){_0x1b84a4=_0x4188ad;_0x33994b=0xc8;}else{_0x33994b=0xce;}_0x1a5541[_0x9b97('0x16')](_0x33994b);return _0x1a5541[_0x9b97('0x1c')](_0x9b97('0x1d'),_0x240b5c+'-'+_0x1b84a4+'/'+_0x4188ad)[_0x9b97('0x1e')](_0x6681f);}return null;};}function patchUpdates(_0xeddea8){return function(_0x4fe289){try{jsonpatch[_0x9b97('0x1f')](_0x4fe289,_0xeddea8,!![]);}catch(_0x4a2a3c){return BPromise[_0x9b97('0x20')](_0x4a2a3c);}return _0x4fe289[_0x9b97('0x21')]();};}function saveUpdates(_0x225c50,_0x2c5d05){return function(_0xe201d9){if(_0xe201d9){return _0xe201d9['update'](_0x225c50)[_0x9b97('0x22')](function(_0x551b6a){return _0x551b6a;});}return null;};}function removeEntity(_0x11a35f,_0x545f55){return function(_0x47a8e7){if(_0x47a8e7){return _0x47a8e7[_0x9b97('0x23')]()[_0x9b97('0x22')](function(){_0x11a35f[_0x9b97('0x16')](0xcc)[_0x9b97('0x17')]();});}};}function handleEntityNotFound(_0x4aca0d,_0x6d115f){return function(_0x1e59ac){if(!_0x1e59ac){_0x4aca0d['sendStatus'](0x194);}return _0x1e59ac;};}function handleError(_0x123991,_0x4f46e8){_0x4f46e8=_0x4f46e8||0x1f4;return function(_0x44aa2a){logger[_0x9b97('0x24')](_0x44aa2a[_0x9b97('0x25')]);if(_0x44aa2a[_0x9b97('0x26')]){delete _0x44aa2a['name'];}_0x123991['status'](_0x4f46e8)[_0x9b97('0x27')](_0x44aa2a);};}exports[_0x9b97('0x28')]=function(_0x49b61b,_0x3964e7){var _0x54af91={},_0x196a0c={},_0xeccb01={'count':0x0,'rows':[]};var _0x5a34fd=_['map'](db[_0x9b97('0x29')][_0x9b97('0x2a')],function(_0x17f457){return{'name':_0x17f457[_0x9b97('0x2b')],'type':_0x17f457[_0x9b97('0x2c')][_0x9b97('0x2d')]};});_0x196a0c[_0x9b97('0x2e')]=_[_0x9b97('0x2f')](_0x5a34fd,_0x9b97('0x26'));_0x196a0c[_0x9b97('0x30')]=_[_0x9b97('0x31')](_0x49b61b[_0x9b97('0x30')]);_0x196a0c[_0x9b97('0x32')]=_[_0x9b97('0x33')](_0x196a0c['model'],_0x196a0c['query']);_0x54af91[_0x9b97('0x34')]=_[_0x9b97('0x33')](_0x196a0c['model'],qs[_0x9b97('0x35')](_0x49b61b['query'][_0x9b97('0x35')]));_0x54af91[_0x9b97('0x34')]=_0x54af91[_0x9b97('0x34')][_0x9b97('0x36')]?_0x54af91[_0x9b97('0x34')]:_0x196a0c[_0x9b97('0x2e')];if(!_0x49b61b[_0x9b97('0x30')]['hasOwnProperty']('nolimit')){_0x54af91['limit']=qs[_0x9b97('0x19')](_0x49b61b[_0x9b97('0x30')][_0x9b97('0x19')]);_0x54af91[_0x9b97('0x1b')]=qs[_0x9b97('0x1b')](_0x49b61b[_0x9b97('0x30')][_0x9b97('0x1b')]);}_0x54af91[_0x9b97('0x37')]=qs['sort'](_0x49b61b['query']['sort']);_0x54af91[_0x9b97('0x38')]=qs['filters'](_[_0x9b97('0x39')](_0x49b61b[_0x9b97('0x30')],_0x196a0c[_0x9b97('0x32')]),_0x5a34fd);if(_0x49b61b['query']['filter']){_0x54af91['where']=_[_0x9b97('0x3a')](_0x54af91[_0x9b97('0x38')],{'$or':_[_0x9b97('0x2f')](_0x5a34fd,function(_0x4b1bf1){if(_0x4b1bf1[_0x9b97('0x2c')]!==_0x9b97('0x3b')){var _0x492f32={};_0x492f32[_0x4b1bf1['name']]={'$like':'%'+_0x49b61b[_0x9b97('0x30')][_0x9b97('0x3c')]+'%'};return _0x492f32;}})});}_0x54af91=_[_0x9b97('0x3a')]({},_0x54af91,_0x49b61b[_0x9b97('0x3d')]);var _0x2a6f83={'where':_0x54af91['where']};return db[_0x9b97('0x29')][_0x9b97('0x1a')](_0x2a6f83)[_0x9b97('0x22')](function(_0x3aea6b){_0xeccb01[_0x9b97('0x1a')]=_0x3aea6b;if(_0x49b61b[_0x9b97('0x30')]['includeAll']){_0x54af91[_0x9b97('0x3e')]=[{'all':!![]}];}return db[_0x9b97('0x29')][_0x9b97('0x3f')](_0x54af91);})[_0x9b97('0x22')](function(_0x554c64){_0xeccb01['rows']=_0x554c64;return _0xeccb01;})[_0x9b97('0x22')](respondWithFilteredResult(_0x3964e7,_0x54af91))[_0x9b97('0x40')](handleError(_0x3964e7,null));};exports[_0x9b97('0x41')]=function(_0x925d12,_0x157c61){var _0xd0ab1f={'raw':![],'where':{'id':_0x925d12[_0x9b97('0x42')]['id']}},_0x9dc1c6={};_0x9dc1c6[_0x9b97('0x2e')]=_[_0x9b97('0x31')](db[_0x9b97('0x29')]['rawAttributes']);_0x9dc1c6[_0x9b97('0x30')]=_[_0x9b97('0x31')](_0x925d12[_0x9b97('0x30')]);_0x9dc1c6[_0x9b97('0x32')]=_['intersection'](_0x9dc1c6[_0x9b97('0x2e')],_0x9dc1c6[_0x9b97('0x30')]);_0xd0ab1f[_0x9b97('0x34')]=_[_0x9b97('0x33')](_0x9dc1c6['model'],qs[_0x9b97('0x35')](_0x925d12['query'][_0x9b97('0x35')]));_0xd0ab1f[_0x9b97('0x34')]=_0xd0ab1f['attributes'][_0x9b97('0x36')]?_0xd0ab1f[_0x9b97('0x34')]:_0x9dc1c6[_0x9b97('0x2e')];if(_0x925d12[_0x9b97('0x30')][_0x9b97('0x43')]){_0xd0ab1f[_0x9b97('0x3e')]=[{'all':!![]}];}_0xd0ab1f=_[_0x9b97('0x3a')]({},_0xd0ab1f,_0x925d12['options']);return db[_0x9b97('0x29')][_0x9b97('0x44')](_0xd0ab1f)[_0x9b97('0x22')](handleEntityNotFound(_0x157c61,null))['then'](respondWithResult(_0x157c61,null))[_0x9b97('0x40')](handleError(_0x157c61,null));};exports[_0x9b97('0x45')]=function(_0x499f08,_0x5bc4bc){return db[_0x9b97('0x29')]['create'](_0x499f08[_0x9b97('0x46')],{})['then'](respondWithResult(_0x5bc4bc,0xc9))[_0x9b97('0x40')](handleError(_0x5bc4bc,null));};exports[_0x9b97('0x47')]=function(_0x4ff0f7,_0x4cf365){if(_0x4ff0f7['body']['id']){delete _0x4ff0f7['body']['id'];}return db[_0x9b97('0x29')][_0x9b97('0x44')]({'where':{'id':_0x4ff0f7['params']['id']}})['then'](handleEntityNotFound(_0x4cf365,null))[_0x9b97('0x22')](saveUpdates(_0x4ff0f7[_0x9b97('0x46')],null))[_0x9b97('0x22')](respondWithResult(_0x4cf365,null))[_0x9b97('0x40')](handleError(_0x4cf365,null));};exports['destroy']=function(_0x26e517,_0x40fdc7){return db[_0x9b97('0x29')][_0x9b97('0x44')]({'where':{'id':_0x26e517[_0x9b97('0x42')]['id']}})[_0x9b97('0x22')](handleEntityNotFound(_0x40fdc7,null))[_0x9b97('0x22')](removeEntity(_0x40fdc7,null))['catch'](handleError(_0x40fdc7,null));};exports[_0x9b97('0x48')]=function(_0x87c380,_0x28feec,_0x5a1721){var _0x318a39={};var _0x48620b={};var _0x412473;var _0x4c95dd;return db[_0x9b97('0x29')][_0x9b97('0x49')]({'where':{'id':_0x87c380[_0x9b97('0x42')]['id']}})[_0x9b97('0x22')](handleEntityNotFound(_0x28feec,null))['then'](function(_0x10e8a9){if(_0x10e8a9){_0x412473=_0x10e8a9;_0x48620b[_0x9b97('0x2e')]=_['keys'](db[_0x9b97('0x4a')][_0x9b97('0x2a')]);_0x48620b[_0x9b97('0x30')]=_['keys'](_0x87c380[_0x9b97('0x30')]);_0x48620b['filters']=_[_0x9b97('0x33')](_0x48620b[_0x9b97('0x2e')],_0x48620b[_0x9b97('0x30')]);_0x318a39[_0x9b97('0x34')]=_[_0x9b97('0x33')](_0x48620b[_0x9b97('0x2e')],qs[_0x9b97('0x35')](_0x87c380[_0x9b97('0x30')][_0x9b97('0x35')]));_0x318a39['attributes']=_0x318a39['attributes']['length']?_0x318a39[_0x9b97('0x34')]:_0x48620b[_0x9b97('0x2e')];_0x318a39['order']=qs[_0x9b97('0x4b')](_0x87c380[_0x9b97('0x30')][_0x9b97('0x4b')]);_0x318a39[_0x9b97('0x38')]=qs[_0x9b97('0x32')](_['pick'](_0x87c380[_0x9b97('0x30')],_0x48620b[_0x9b97('0x32')]));if(_0x87c380[_0x9b97('0x30')][_0x9b97('0x3c')]){_0x318a39['where']=_[_0x9b97('0x3a')](_0x318a39[_0x9b97('0x38')],{'$or':_[_0x9b97('0x2f')](_0x318a39[_0x9b97('0x34')],function(_0x4c407a){var _0x1c64bd={};_0x1c64bd[_0x4c407a]={'$like':'%'+_0x87c380[_0x9b97('0x30')]['filter']+'%'};return _0x1c64bd;})});}_0x318a39=_[_0x9b97('0x3a')]({},_0x318a39,_0x87c380[_0x9b97('0x3d')]);return _0x412473[_0x9b97('0x48')](_0x318a39);}})[_0x9b97('0x22')](function(_0x47cca1){if(_0x47cca1){_0x4c95dd=_0x47cca1[_0x9b97('0x36')];if(!_0x87c380['query']['hasOwnProperty'](_0x9b97('0x4c'))){_0x318a39[_0x9b97('0x19')]=qs[_0x9b97('0x19')](_0x87c380[_0x9b97('0x30')][_0x9b97('0x19')]);_0x318a39[_0x9b97('0x1b')]=qs[_0x9b97('0x1b')](_0x87c380[_0x9b97('0x30')][_0x9b97('0x1b')]);}return _0x412473[_0x9b97('0x48')](_0x318a39);}})[_0x9b97('0x22')](function(_0x59f8b7){if(_0x59f8b7){return _0x59f8b7?{'count':_0x4c95dd,'rows':_0x59f8b7}:null;}})['then'](respondWithResult(_0x28feec,null))[_0x9b97('0x40')](handleError(_0x28feec,null));};exports[_0x9b97('0x4d')]=function(_0x31be87,_0x558622,_0xe7bda6){var _0x4d5ee4={};var _0x4e0394={};var _0x1ec985;var _0x3caae7;return db['ServicenowConfiguration'][_0x9b97('0x49')]({'where':{'id':_0x31be87[_0x9b97('0x42')]['id']}})[_0x9b97('0x22')](handleEntityNotFound(_0x558622,null))[_0x9b97('0x22')](function(_0x2cc641){if(_0x2cc641){_0x1ec985=_0x2cc641;_0x4e0394[_0x9b97('0x2e')]=_[_0x9b97('0x31')](db['ServicenowField'][_0x9b97('0x2a')]);_0x4e0394[_0x9b97('0x30')]=_[_0x9b97('0x31')](_0x31be87['query']);_0x4e0394['filters']=_[_0x9b97('0x33')](_0x4e0394[_0x9b97('0x2e')],_0x4e0394[_0x9b97('0x30')]);_0x4d5ee4[_0x9b97('0x34')]=_['intersection'](_0x4e0394[_0x9b97('0x2e')],qs['fields'](_0x31be87[_0x9b97('0x30')][_0x9b97('0x35')]));_0x4d5ee4[_0x9b97('0x34')]=_0x4d5ee4[_0x9b97('0x34')][_0x9b97('0x36')]?_0x4d5ee4['attributes']:_0x4e0394[_0x9b97('0x2e')];_0x4d5ee4[_0x9b97('0x37')]=qs[_0x9b97('0x4b')](_0x31be87[_0x9b97('0x30')][_0x9b97('0x4b')]);_0x4d5ee4[_0x9b97('0x38')]=qs[_0x9b97('0x32')](_[_0x9b97('0x39')](_0x31be87[_0x9b97('0x30')],_0x4e0394[_0x9b97('0x32')]));if(_0x31be87[_0x9b97('0x30')][_0x9b97('0x3c')]){_0x4d5ee4['where']=_['merge'](_0x4d5ee4[_0x9b97('0x38')],{'$or':_[_0x9b97('0x2f')](_0x4d5ee4['attributes'],function(_0x47ce98){var _0x1b9aac={};_0x1b9aac[_0x47ce98]={'$like':'%'+_0x31be87['query'][_0x9b97('0x3c')]+'%'};return _0x1b9aac;})});}_0x4d5ee4=_[_0x9b97('0x3a')]({},_0x4d5ee4,_0x31be87[_0x9b97('0x3d')]);return _0x1ec985[_0x9b97('0x4d')](_0x4d5ee4);}})[_0x9b97('0x22')](function(_0xfc36bd){if(_0xfc36bd){_0x3caae7=_0xfc36bd['length'];if(!_0x31be87['query'][_0x9b97('0x4e')](_0x9b97('0x4c'))){_0x4d5ee4[_0x9b97('0x19')]=qs[_0x9b97('0x19')](_0x31be87[_0x9b97('0x30')][_0x9b97('0x19')]);_0x4d5ee4[_0x9b97('0x1b')]=qs[_0x9b97('0x1b')](_0x31be87[_0x9b97('0x30')][_0x9b97('0x1b')]);}return _0x1ec985['getSubjects'](_0x4d5ee4);}})[_0x9b97('0x22')](function(_0x5d217c){if(_0x5d217c){return _0x5d217c?{'count':_0x3caae7,'rows':_0x5d217c}:null;}})[_0x9b97('0x22')](respondWithResult(_0x558622,null))['catch'](handleError(_0x558622,null));};exports[_0x9b97('0x4f')]=function(_0x1305c2,_0x242083,_0x3b6e85){var _0x2799d1={};var _0x5a643={};var _0x16b0c1;var _0x329ab6;return db['ServicenowConfiguration'][_0x9b97('0x49')]({'where':{'id':_0x1305c2[_0x9b97('0x42')]['id']}})['then'](handleEntityNotFound(_0x242083,null))['then'](function(_0x50fd03){if(_0x50fd03){_0x16b0c1=_0x50fd03;_0x5a643[_0x9b97('0x2e')]=_[_0x9b97('0x31')](db[_0x9b97('0x4a')][_0x9b97('0x2a')]);_0x5a643[_0x9b97('0x30')]=_['keys'](_0x1305c2[_0x9b97('0x30')]);_0x5a643[_0x9b97('0x32')]=_[_0x9b97('0x33')](_0x5a643[_0x9b97('0x2e')],_0x5a643[_0x9b97('0x30')]);_0x2799d1[_0x9b97('0x34')]=_[_0x9b97('0x33')](_0x5a643[_0x9b97('0x2e')],qs['fields'](_0x1305c2[_0x9b97('0x30')][_0x9b97('0x35')]));_0x2799d1[_0x9b97('0x34')]=_0x2799d1[_0x9b97('0x34')]['length']?_0x2799d1[_0x9b97('0x34')]:_0x5a643[_0x9b97('0x2e')];_0x2799d1['order']=qs[_0x9b97('0x4b')](_0x1305c2['query'][_0x9b97('0x4b')]);_0x2799d1[_0x9b97('0x38')]=qs[_0x9b97('0x32')](_[_0x9b97('0x39')](_0x1305c2[_0x9b97('0x30')],_0x5a643[_0x9b97('0x32')]));if(_0x1305c2[_0x9b97('0x30')][_0x9b97('0x3c')]){_0x2799d1['where']=_[_0x9b97('0x3a')](_0x2799d1[_0x9b97('0x38')],{'$or':_['map'](_0x2799d1[_0x9b97('0x34')],function(_0x1790b2){var _0x348696={};_0x348696[_0x1790b2]={'$like':'%'+_0x1305c2[_0x9b97('0x30')][_0x9b97('0x3c')]+'%'};return _0x348696;})});}_0x2799d1=_[_0x9b97('0x3a')]({},_0x2799d1,_0x1305c2[_0x9b97('0x3d')]);return _0x16b0c1['getDescriptions'](_0x2799d1);}})['then'](function(_0x5e0d04){if(_0x5e0d04){_0x329ab6=_0x5e0d04[_0x9b97('0x36')];if(!_0x1305c2[_0x9b97('0x30')][_0x9b97('0x4e')](_0x9b97('0x4c'))){_0x2799d1[_0x9b97('0x19')]=qs[_0x9b97('0x19')](_0x1305c2[_0x9b97('0x30')][_0x9b97('0x19')]);_0x2799d1['offset']=qs[_0x9b97('0x1b')](_0x1305c2[_0x9b97('0x30')][_0x9b97('0x1b')]);}return _0x16b0c1[_0x9b97('0x4f')](_0x2799d1);}})[_0x9b97('0x22')](function(_0x23dff2){if(_0x23dff2){return _0x23dff2?{'count':_0x329ab6,'rows':_0x23dff2}:null;}})[_0x9b97('0x22')](respondWithResult(_0x242083,null))['catch'](handleError(_0x242083,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 91821b4..0cdc792 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 _0x83e1=['bluebird','rimraf','../../config/environment','define','ServicenowConfiguration','lodash','util','api'];(function(_0x442408,_0xad4811){var _0x368770=function(_0x27420c){while(--_0x27420c){_0x442408['push'](_0x442408['shift']());}};_0x368770(++_0xad4811);}(_0x83e1,0x1ad));var _0x183e=function(_0x5b9439,_0x1e100d){_0x5b9439=_0x5b9439-0x0;var _0x4fa417=_0x83e1[_0x5b9439];return _0x4fa417;};'use strict';var _=require(_0x183e('0x0'));var util=require(_0x183e('0x1'));var logger=require('../../config/logger')(_0x183e('0x2'));var moment=require('moment');var BPromise=require(_0x183e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x183e('0x4'));var config=require(_0x183e('0x5'));var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0x4d7710,_0x2e3bbd){return _0x4d7710[_0x183e('0x6')](_0x183e('0x7'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e1=['int_servicenow_configurations','lodash','util','api','moment','bluebird','path','../../config/environment','exports','define','ServicenowConfiguration'];(function(_0x5ed5f2,_0x4d984c){var _0x34166a=function(_0x1d01c7){while(--_0x1d01c7){_0x5ed5f2['push'](_0x5ed5f2['shift']());}};_0x34166a(++_0x4d984c);}(_0xa9e1,0x7a));var _0x1a9e=function(_0x581249,_0x483f03){_0x581249=_0x581249-0x0;var _0x284bae=_0xa9e1[_0x581249];return _0x284bae;};'use strict';var _=require(_0x1a9e('0x0'));var util=require(_0x1a9e('0x1'));var logger=require('../../config/logger')(_0x1a9e('0x2'));var moment=require(_0x1a9e('0x3'));var BPromise=require(_0x1a9e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a9e('0x5'));var rimraf=require('rimraf');var config=require(_0x1a9e('0x6'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x1a9e('0x7')]=function(_0x40c9b0,_0x1bdcd9){return _0x40c9b0[_0x1a9e('0x8')](_0x1a9e('0x9'),attributes,{'tableName':_0x1a9e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index fd9126f..5286a3e 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 _0xb1af=['ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x397fc0,_0x26002e){var _0xfefc78=function(_0x1cd3f7){while(--_0x1cd3f7){_0x397fc0['push'](_0x397fc0['shift']());}};_0xfefc78(++_0x26002e);}(_0xb1af,0x156));var _0xfb1a=function(_0x15bb96,_0x183000){_0x15bb96=_0x15bb96-0x0;var _0x48568e=_0xb1af[_0x15bb96];return _0x48568e;};'use strict';var _=require('lodash');var util=require(_0xfb1a('0x0'));var moment=require(_0xfb1a('0x1'));var BPromise=require(_0xfb1a('0x2'));var rs=require(_0xfb1a('0x3'));var fs=require('fs');var Redis=require(_0xfb1a('0x4'));var db=require(_0xfb1a('0x5'))['db'];var utils=require(_0xfb1a('0x6'));var logger=require(_0xfb1a('0x7'))(_0xfb1a('0x8'));var config=require(_0xfb1a('0x9'));var jayson=require(_0xfb1a('0xa'));var client=jayson['client'][_0xfb1a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x571e35,_0x412366,_0x3a76a3){return new BPromise(function(_0xebf42c,_0x3446a3){return client[_0xfb1a('0xc')](_0x571e35,_0x3a76a3)[_0xfb1a('0xd')](function(_0x4e72f3){logger[_0xfb1a('0xe')](_0xfb1a('0xf'),_0x412366,_0xfb1a('0x10'));logger[_0xfb1a('0x11')](_0xfb1a('0x12'),_0x412366,_0xfb1a('0x10'),JSON[_0xfb1a('0x13')](_0x4e72f3));if(_0x4e72f3[_0xfb1a('0x14')]){if(_0x4e72f3['error']['code']===0x1f4){logger[_0xfb1a('0x14')]('ServicenowConfiguration,\x20%s,\x20%s',_0x412366,_0x4e72f3[_0xfb1a('0x14')][_0xfb1a('0x15')]);return _0x3446a3(_0x4e72f3[_0xfb1a('0x14')][_0xfb1a('0x15')]);}logger[_0xfb1a('0x14')](_0xfb1a('0xf'),_0x412366,_0x4e72f3[_0xfb1a('0x14')]['message']);return _0xebf42c(_0x4e72f3[_0xfb1a('0x14')][_0xfb1a('0x15')]);}else{logger[_0xfb1a('0xe')](_0xfb1a('0xf'),_0x412366,_0xfb1a('0x10'));_0xebf42c(_0x4e72f3[_0xfb1a('0x16')][_0xfb1a('0x15')]);}})[_0xfb1a('0x17')](function(_0x137fdf){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x412366,_0x137fdf);_0x3446a3(_0x137fdf);});});} \ No newline at end of file +var _0xf40b=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb'];(function(_0xf0ab7c,_0x23bbc2){var _0x198144=function(_0x1c3a40){while(--_0x1c3a40){_0xf0ab7c['push'](_0xf0ab7c['shift']());}};_0x198144(++_0x23bbc2);}(_0xf40b,0xf7));var _0xbf40=function(_0x2d8db5,_0x3c9c8d){_0x2d8db5=_0x2d8db5-0x0;var _0xdc5579=_0xf40b[_0x2d8db5];return _0xdc5579;};'use strict';var _=require(_0xbf40('0x0'));var util=require('util');var moment=require(_0xbf40('0x1'));var BPromise=require('bluebird');var rs=require(_0xbf40('0x2'));var fs=require('fs');var Redis=require(_0xbf40('0x3'));var db=require(_0xbf40('0x4'))['db'];var utils=require(_0xbf40('0x5'));var logger=require(_0xbf40('0x6'))(_0xbf40('0x7'));var config=require(_0xbf40('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbf40('0x9')][_0xbf40('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2cf99,_0xe904db,_0x195365){return new BPromise(function(_0x249cf0,_0x1901ba){return client[_0xbf40('0xb')](_0x2cf99,_0x195365)[_0xbf40('0xc')](function(_0x386422){logger[_0xbf40('0xd')](_0xbf40('0xe'),_0xe904db,_0xbf40('0xf'));logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0xe904db,_0xbf40('0xf'),JSON[_0xbf40('0x10')](_0x386422));if(_0x386422[_0xbf40('0x11')]){if(_0x386422[_0xbf40('0x11')]['code']===0x1f4){logger[_0xbf40('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0xe904db,_0x386422[_0xbf40('0x11')][_0xbf40('0x12')]);return _0x1901ba(_0x386422[_0xbf40('0x11')]['message']);}logger[_0xbf40('0x11')](_0xbf40('0xe'),_0xe904db,_0x386422[_0xbf40('0x11')][_0xbf40('0x12')]);return _0x249cf0(_0x386422[_0xbf40('0x11')][_0xbf40('0x12')]);}else{logger['info']('ServicenowConfiguration,\x20%s,\x20%s',_0xe904db,'request\x20sent');_0x249cf0(_0x386422[_0xbf40('0x13')][_0xbf40('0x12')]);}})[_0xbf40('0x14')](function(_0x1a76d3){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0xe904db,_0x1a76d3);_0x1901ba(_0x1a76d3);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 8a3027e..3cee74d 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 _0x3c10=['multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','index','isAuthenticated','show','create','put','/:id','update','delete','destroy','exports'];(function(_0x2ab297,_0x2d6ea0){var _0x519b07=function(_0x323355){while(--_0x323355){_0x2ab297['push'](_0x2ab297['shift']());}};_0x519b07(++_0x2d6ea0);}(_0x3c10,0x1b8));var _0x03c1=function(_0x19be0e,_0x207bdd){_0x19be0e=_0x19be0e-0x0;var _0x5c24cd=_0x3c10[_0x19be0e];return _0x5c24cd;};'use strict';var multer=require(_0x03c1('0x0'));var util=require(_0x03c1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x03c1('0x2'));var router=express[_0x03c1('0x3')]();var fs_extra=require(_0x03c1('0x4'));var auth=require(_0x03c1('0x5'));var interaction=require(_0x03c1('0x6'));var config=require(_0x03c1('0x7'));var controller=require(_0x03c1('0x8'));router[_0x03c1('0x9')]('/',auth['isAuthenticated'](),controller[_0x03c1('0xa')]);router[_0x03c1('0x9')]('/:id',auth[_0x03c1('0xb')](),controller[_0x03c1('0xc')]);router['post']('/',auth[_0x03c1('0xb')](),controller[_0x03c1('0xd')]);router[_0x03c1('0xe')](_0x03c1('0xf'),auth[_0x03c1('0xb')](),controller[_0x03c1('0x10')]);router[_0x03c1('0x11')]('/:id',auth[_0x03c1('0xb')](),controller[_0x03c1('0x12')]);module[_0x03c1('0x13')]=router; \ No newline at end of file +var _0x931a=['Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','/:id','post','put','update','delete','multer','path','connect-timeout','express'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x931a,0x1ec));var _0xa931=function(_0x5dd6cf,_0x5aecf8){_0x5dd6cf=_0x5dd6cf-0x0;var _0x252ff7=_0x931a[_0x5dd6cf];return _0x252ff7;};'use strict';var multer=require(_0xa931('0x0'));var util=require('util');var path=require(_0xa931('0x1'));var timeout=require(_0xa931('0x2'));var express=require(_0xa931('0x3'));var router=express[_0xa931('0x4')]();var fs_extra=require(_0xa931('0x5'));var auth=require(_0xa931('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa931('0x7'));var controller=require(_0xa931('0x8'));router[_0xa931('0x9')]('/',auth[_0xa931('0xa')](),controller['index']);router[_0xa931('0x9')](_0xa931('0xb'),auth[_0xa931('0xa')](),controller['show']);router[_0xa931('0xc')]('/',auth[_0xa931('0xa')](),controller['create']);router[_0xa931('0xd')](_0xa931('0xb'),auth[_0xa931('0xa')](),controller[_0xa931('0xe')]);router[_0xa931('0xf')]('/:id',auth[_0xa931('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 0545834..13e5a4f 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 _0x0d6d=['sequelize','exports','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x5bbf34,_0x104de9){var _0x4b1f8d=function(_0x3494e8){while(--_0x3494e8){_0x5bbf34['push'](_0x5bbf34['shift']());}};_0x4b1f8d(++_0x104de9);}(_0x0d6d,0x188));var _0xd0d6=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x0d6d[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require(_0xd0d6('0x0'));module[_0xd0d6('0x1')]={'type':{'type':Sequelize['ENUM'](_0xd0d6('0x2'),_0xd0d6('0x3'),_0xd0d6('0x4'),_0xd0d6('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xd0d6('0x6')]},'key':{'type':Sequelize[_0xd0d6('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xd0d6('0x2'),_0xd0d6('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xd0d6('0x6')]},'idField':{'type':Sequelize[_0xd0d6('0x6')]},'nameField':{'type':Sequelize[_0xd0d6('0x6')]},'customField':{'type':Sequelize[_0xd0d6('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd0d6('0x6')]}}; \ No newline at end of file +var _0x5f1d=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','string'];(function(_0x15942a,_0x13b58c){var _0x36a9fb=function(_0x549c27){while(--_0x549c27){_0x15942a['push'](_0x15942a['shift']());}};_0x36a9fb(++_0x13b58c);}(_0x5f1d,0x180));var _0xd5f1=function(_0x581bef,_0x55ca24){_0x581bef=_0x581bef-0x0;var _0x303bf4=_0x5f1d[_0x581bef];return _0x303bf4;};'use strict';var Sequelize=require(_0xd5f1('0x0'));module[_0xd5f1('0x1')]={'type':{'type':Sequelize['ENUM'](_0xd5f1('0x2'),_0xd5f1('0x3'),_0xd5f1('0x4'),_0xd5f1('0x5'),_0xd5f1('0x6')),'defaultValue':_0xd5f1('0x2')},'content':{'type':Sequelize[_0xd5f1('0x7')]},'key':{'type':Sequelize[_0xd5f1('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xd5f1('0x2'),_0xd5f1('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xd5f1('0x7')]},'nameField':{'type':Sequelize[_0xd5f1('0x7')]},'customField':{'type':Sequelize[_0xd5f1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index c0d0d90..6cc5982 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 _0x685e=['params','intersection','include','find','create','update','body','eml-format','zip-dir','bluebird','mustache','util','path','sox','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','apply','reject','then','destroy','error','stack','name','send','index','ServicenowField','rawAttributes','model','map','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','includeAll','findAll','rows','catch'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x685e,0x1ea));var _0xe685=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0x685e[_0x34843e];return _0x598f7f;};'use strict';var emlformat=require(_0xe685('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe685('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe685('0x2'));var Mustache=require(_0xe685('0x3'));var util=require(_0xe685('0x4'));var path=require(_0xe685('0x5'));var sox=require(_0xe685('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe685('0x7'));var _=require('lodash');var squel=require(_0xe685('0x8'));var crypto=require('crypto');var jsforce=require(_0xe685('0x9'));var deskjs=require(_0xe685('0xa'));var toCsv=require('to-csv');var querystring=require(_0xe685('0xb'));var Papa=require(_0xe685('0xc'));var Redis=require(_0xe685('0xd'));var authService=require(_0xe685('0xe'));var qs=require(_0xe685('0xf'));var as=require(_0xe685('0x10'));var hardwareService=require(_0xe685('0x11'));var logger=require('../../config/logger')(_0xe685('0x12'));var utils=require(_0xe685('0x13'));var config=require(_0xe685('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xe685('0x15'))['db'];function respondWithStatusCode(_0x55c5e2,_0xc97e74){_0xc97e74=_0xc97e74||0xcc;return function(_0x25f1e7){if(_0x25f1e7){return _0x55c5e2['sendStatus'](_0xc97e74);}return _0x55c5e2[_0xe685('0x16')](_0xc97e74)[_0xe685('0x17')]();};}function respondWithResult(_0x160977,_0x20f1df){_0x20f1df=_0x20f1df||0xc8;return function(_0x5b9c51){if(_0x5b9c51){return _0x160977[_0xe685('0x16')](_0x20f1df)[_0xe685('0x18')](_0x5b9c51);}};}function respondWithFilteredResult(_0x22689b,_0x2031b0){return function(_0x53b6cc){if(_0x53b6cc){var _0x53461e=typeof _0x2031b0[_0xe685('0x19')]==='undefined'&&typeof _0x2031b0[_0xe685('0x1a')]===_0xe685('0x1b');var _0x4a8456=_0x53b6cc[_0xe685('0x1c')];var _0x205824=_0x53461e?0x0:_0x2031b0[_0xe685('0x19')];var _0x3b202d=_0x53461e?_0x53b6cc[_0xe685('0x1c')]:_0x2031b0['offset']+_0x2031b0[_0xe685('0x1a')];var _0x2f8989;if(_0x3b202d>=_0x4a8456){_0x3b202d=_0x4a8456;_0x2f8989=0xc8;}else{_0x2f8989=0xce;}_0x22689b[_0xe685('0x16')](_0x2f8989);return _0x22689b[_0xe685('0x1d')]('Content-Range',_0x205824+'-'+_0x3b202d+'/'+_0x4a8456)['json'](_0x53b6cc);}return null;};}function patchUpdates(_0x3fe10a){return function(_0xce3c43){try{jsonpatch[_0xe685('0x1e')](_0xce3c43,_0x3fe10a,!![]);}catch(_0x2f672c){return BPromise[_0xe685('0x1f')](_0x2f672c);}return _0xce3c43['save']();};}function saveUpdates(_0x4d1930,_0x370e9d){return function(_0x4707fe){if(_0x4707fe){return _0x4707fe['update'](_0x4d1930)[_0xe685('0x20')](function(_0x3e7885){return _0x3e7885;});}return null;};}function removeEntity(_0x20bf19,_0x4b27da){return function(_0x3cc3f9){if(_0x3cc3f9){return _0x3cc3f9[_0xe685('0x21')]()[_0xe685('0x20')](function(){_0x20bf19[_0xe685('0x16')](0xcc)[_0xe685('0x17')]();});}};}function handleEntityNotFound(_0x32f0fa,_0xe01825){return function(_0xd44b4e){if(!_0xd44b4e){_0x32f0fa['sendStatus'](0x194);}return _0xd44b4e;};}function handleError(_0xdcdfb7,_0x3e608c){_0x3e608c=_0x3e608c||0x1f4;return function(_0x5a195e){logger[_0xe685('0x22')](_0x5a195e[_0xe685('0x23')]);if(_0x5a195e[_0xe685('0x24')]){delete _0x5a195e[_0xe685('0x24')];}_0xdcdfb7[_0xe685('0x16')](_0x3e608c)[_0xe685('0x25')](_0x5a195e);};}exports[_0xe685('0x26')]=function(_0x4481ea,_0xf31734){var _0x5d4495={},_0x51c1cc={},_0x5e1a98={'count':0x0,'rows':[]};var _0x16e4b9=_['map'](db[_0xe685('0x27')][_0xe685('0x28')],function(_0x49cf59){return{'name':_0x49cf59['fieldName'],'type':_0x49cf59['type']['key']};});_0x51c1cc[_0xe685('0x29')]=_[_0xe685('0x2a')](_0x16e4b9,_0xe685('0x24'));_0x51c1cc[_0xe685('0x2b')]=_['keys'](_0x4481ea[_0xe685('0x2b')]);_0x51c1cc['filters']=_['intersection'](_0x51c1cc[_0xe685('0x29')],_0x51c1cc[_0xe685('0x2b')]);_0x5d4495[_0xe685('0x2c')]=_['intersection'](_0x51c1cc[_0xe685('0x29')],qs['fields'](_0x4481ea[_0xe685('0x2b')][_0xe685('0x2d')]));_0x5d4495[_0xe685('0x2c')]=_0x5d4495[_0xe685('0x2c')][_0xe685('0x2e')]?_0x5d4495[_0xe685('0x2c')]:_0x51c1cc['model'];if(!_0x4481ea[_0xe685('0x2b')][_0xe685('0x2f')](_0xe685('0x30'))){_0x5d4495[_0xe685('0x1a')]=qs['limit'](_0x4481ea[_0xe685('0x2b')][_0xe685('0x1a')]);_0x5d4495['offset']=qs[_0xe685('0x19')](_0x4481ea['query'][_0xe685('0x19')]);}_0x5d4495[_0xe685('0x31')]=qs['sort'](_0x4481ea[_0xe685('0x2b')][_0xe685('0x32')]);_0x5d4495['where']=qs[_0xe685('0x33')](_[_0xe685('0x34')](_0x4481ea[_0xe685('0x2b')],_0x51c1cc[_0xe685('0x33')]),_0x16e4b9);if(_0x4481ea['query'][_0xe685('0x35')]){_0x5d4495[_0xe685('0x36')]=_[_0xe685('0x37')](_0x5d4495[_0xe685('0x36')],{'$or':_[_0xe685('0x2a')](_0x16e4b9,function(_0x47f78a){if(_0x47f78a[_0xe685('0x38')]!==_0xe685('0x39')){var _0x5e8037={};_0x5e8037[_0x47f78a['name']]={'$like':'%'+_0x4481ea[_0xe685('0x2b')][_0xe685('0x35')]+'%'};return _0x5e8037;}})});}_0x5d4495=_['merge']({},_0x5d4495,_0x4481ea['options']);var _0x571135={'where':_0x5d4495[_0xe685('0x36')]};return db['ServicenowField']['count'](_0x571135)[_0xe685('0x20')](function(_0xa779b0){_0x5e1a98[_0xe685('0x1c')]=_0xa779b0;if(_0x4481ea[_0xe685('0x2b')][_0xe685('0x3a')]){_0x5d4495['include']=[{'all':!![]}];}return db[_0xe685('0x27')][_0xe685('0x3b')](_0x5d4495);})[_0xe685('0x20')](function(_0xddd2c6){_0x5e1a98[_0xe685('0x3c')]=_0xddd2c6;return _0x5e1a98;})[_0xe685('0x20')](respondWithFilteredResult(_0xf31734,_0x5d4495))[_0xe685('0x3d')](handleError(_0xf31734,null));};exports['show']=function(_0x8d2eef,_0x4843d9){var _0x4a6615={'raw':!![],'where':{'id':_0x8d2eef[_0xe685('0x3e')]['id']}},_0x83a88a={};_0x83a88a[_0xe685('0x29')]=_['keys'](db['ServicenowField'][_0xe685('0x28')]);_0x83a88a[_0xe685('0x2b')]=_['keys'](_0x8d2eef[_0xe685('0x2b')]);_0x83a88a[_0xe685('0x33')]=_[_0xe685('0x3f')](_0x83a88a[_0xe685('0x29')],_0x83a88a[_0xe685('0x2b')]);_0x4a6615[_0xe685('0x2c')]=_[_0xe685('0x3f')](_0x83a88a[_0xe685('0x29')],qs['fields'](_0x8d2eef[_0xe685('0x2b')][_0xe685('0x2d')]));_0x4a6615['attributes']=_0x4a6615[_0xe685('0x2c')]['length']?_0x4a6615[_0xe685('0x2c')]:_0x83a88a['model'];if(_0x8d2eef[_0xe685('0x2b')][_0xe685('0x3a')]){_0x4a6615[_0xe685('0x40')]=[{'all':!![]}];}_0x4a6615=_['merge']({},_0x4a6615,_0x8d2eef['options']);return db['ServicenowField'][_0xe685('0x41')](_0x4a6615)[_0xe685('0x20')](handleEntityNotFound(_0x4843d9,null))[_0xe685('0x20')](respondWithResult(_0x4843d9,null))[_0xe685('0x3d')](handleError(_0x4843d9,null));};exports[_0xe685('0x42')]=function(_0x217baf,_0x2d1818){return db['ServicenowField'][_0xe685('0x42')](_0x217baf['body'],{})['then'](respondWithResult(_0x2d1818,0xc9))[_0xe685('0x3d')](handleError(_0x2d1818,null));};exports[_0xe685('0x43')]=function(_0x432e10,_0x589b60){if(_0x432e10[_0xe685('0x44')]['id']){delete _0x432e10['body']['id'];}return db[_0xe685('0x27')][_0xe685('0x41')]({'where':{'id':_0x432e10['params']['id']}})['then'](handleEntityNotFound(_0x589b60,null))[_0xe685('0x20')](saveUpdates(_0x432e10[_0xe685('0x44')],null))['then'](respondWithResult(_0x589b60,null))[_0xe685('0x3d')](handleError(_0x589b60,null));};exports['destroy']=function(_0x43564f,_0x1896ad){return db[_0xe685('0x27')][_0xe685('0x41')]({'where':{'id':_0x43564f[_0xe685('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1896ad,null))[_0xe685('0x20')](removeEntity(_0x1896ad,null))[_0xe685('0x3d')](handleError(_0x1896ad,null));}; \ No newline at end of file +var _0xc90d=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','destroy','then','error','stack','name','send','ServicenowField','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','params','rawAttributes','fields','find','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x29f5e8,_0x56d13d){var _0x3fc4db=function(_0x1bb796){while(--_0x1bb796){_0x29f5e8['push'](_0x29f5e8['shift']());}};_0x3fc4db(++_0x56d13d);}(_0xc90d,0x11e));var _0xdc90=function(_0x5550b3,_0x2d0ee0){_0x5550b3=_0x5550b3-0x0;var _0x4b8fc4=_0xc90d[_0x5550b3];return _0x4b8fc4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdc90('0x0'));var zipdir=require(_0xdc90('0x1'));var jsonpatch=require(_0xdc90('0x2'));var rp=require(_0xdc90('0x3'));var moment=require(_0xdc90('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdc90('0x5'));var util=require('util');var path=require('path');var sox=require(_0xdc90('0x6'));var csv=require('to-csv');var ejs=require(_0xdc90('0x7'));var fs=require('fs');var fs_extra=require(_0xdc90('0x8'));var _=require(_0xdc90('0x9'));var squel=require('squel');var crypto=require(_0xdc90('0xa'));var jsforce=require(_0xdc90('0xb'));var deskjs=require(_0xdc90('0xc'));var toCsv=require(_0xdc90('0xd'));var querystring=require(_0xdc90('0xe'));var Papa=require(_0xdc90('0xf'));var Redis=require(_0xdc90('0x10'));var authService=require(_0xdc90('0x11'));var qs=require(_0xdc90('0x12'));var as=require(_0xdc90('0x13'));var hardwareService=require(_0xdc90('0x14'));var logger=require(_0xdc90('0x15'))(_0xdc90('0x16'));var utils=require(_0xdc90('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xdc90('0x18'));var db=require(_0xdc90('0x19'))['db'];function respondWithStatusCode(_0x5a51d8,_0x2f98c5){_0x2f98c5=_0x2f98c5||0xcc;return function(_0x45c035){if(_0x45c035){return _0x5a51d8[_0xdc90('0x1a')](_0x2f98c5);}return _0x5a51d8[_0xdc90('0x1b')](_0x2f98c5)[_0xdc90('0x1c')]();};}function respondWithResult(_0x4541a3,_0x1c97c8){_0x1c97c8=_0x1c97c8||0xc8;return function(_0x1c10f9){if(_0x1c10f9){return _0x4541a3[_0xdc90('0x1b')](_0x1c97c8)[_0xdc90('0x1d')](_0x1c10f9);}};}function respondWithFilteredResult(_0x5498d4,_0x106b7b){return function(_0x52fdf0){if(_0x52fdf0){var _0x228158=typeof _0x106b7b[_0xdc90('0x1e')]===_0xdc90('0x1f')&&typeof _0x106b7b[_0xdc90('0x20')]===_0xdc90('0x1f');var _0x2efca7=_0x52fdf0[_0xdc90('0x21')];var _0x375e23=_0x228158?0x0:_0x106b7b[_0xdc90('0x1e')];var _0x37c84e=_0x228158?_0x52fdf0[_0xdc90('0x21')]:_0x106b7b[_0xdc90('0x1e')]+_0x106b7b[_0xdc90('0x20')];var _0x3ff02a;if(_0x37c84e>=_0x2efca7){_0x37c84e=_0x2efca7;_0x3ff02a=0xc8;}else{_0x3ff02a=0xce;}_0x5498d4[_0xdc90('0x1b')](_0x3ff02a);return _0x5498d4[_0xdc90('0x22')]('Content-Range',_0x375e23+'-'+_0x37c84e+'/'+_0x2efca7)[_0xdc90('0x1d')](_0x52fdf0);}return null;};}function patchUpdates(_0x340771){return function(_0xbf0943){try{jsonpatch[_0xdc90('0x23')](_0xbf0943,_0x340771,!![]);}catch(_0x4cc942){return BPromise[_0xdc90('0x24')](_0x4cc942);}return _0xbf0943['save']();};}function saveUpdates(_0x7d446d,_0x8a62f7){return function(_0x2ebff4){if(_0x2ebff4){return _0x2ebff4['update'](_0x7d446d)['then'](function(_0x41b5dd){return _0x41b5dd;});}return null;};}function removeEntity(_0x26bd0f,_0x441115){return function(_0x978526){if(_0x978526){return _0x978526[_0xdc90('0x25')]()[_0xdc90('0x26')](function(){_0x26bd0f['status'](0xcc)[_0xdc90('0x1c')]();});}};}function handleEntityNotFound(_0x1c6607,_0x44261c){return function(_0x1a799f){if(!_0x1a799f){_0x1c6607['sendStatus'](0x194);}return _0x1a799f;};}function handleError(_0xce0f92,_0x48eb07){_0x48eb07=_0x48eb07||0x1f4;return function(_0x139f87){logger[_0xdc90('0x27')](_0x139f87[_0xdc90('0x28')]);if(_0x139f87['name']){delete _0x139f87[_0xdc90('0x29')];}_0xce0f92[_0xdc90('0x1b')](_0x48eb07)[_0xdc90('0x2a')](_0x139f87);};}exports['index']=function(_0x4752f4,_0x13dff5){var _0x1db0d2={},_0x2b16fc={},_0x120499={'count':0x0,'rows':[]};var _0x6803d8=_['map'](db[_0xdc90('0x2b')]['rawAttributes'],function(_0x3caec5){return{'name':_0x3caec5[_0xdc90('0x2c')],'type':_0x3caec5[_0xdc90('0x2d')][_0xdc90('0x2e')]};});_0x2b16fc['model']=_[_0xdc90('0x2f')](_0x6803d8,_0xdc90('0x29'));_0x2b16fc[_0xdc90('0x30')]=_[_0xdc90('0x31')](_0x4752f4['query']);_0x2b16fc[_0xdc90('0x32')]=_[_0xdc90('0x33')](_0x2b16fc[_0xdc90('0x34')],_0x2b16fc[_0xdc90('0x30')]);_0x1db0d2[_0xdc90('0x35')]=_[_0xdc90('0x33')](_0x2b16fc[_0xdc90('0x34')],qs['fields'](_0x4752f4[_0xdc90('0x30')]['fields']));_0x1db0d2[_0xdc90('0x35')]=_0x1db0d2['attributes'][_0xdc90('0x36')]?_0x1db0d2['attributes']:_0x2b16fc[_0xdc90('0x34')];if(!_0x4752f4[_0xdc90('0x30')][_0xdc90('0x37')](_0xdc90('0x38'))){_0x1db0d2[_0xdc90('0x20')]=qs[_0xdc90('0x20')](_0x4752f4[_0xdc90('0x30')][_0xdc90('0x20')]);_0x1db0d2[_0xdc90('0x1e')]=qs[_0xdc90('0x1e')](_0x4752f4[_0xdc90('0x30')][_0xdc90('0x1e')]);}_0x1db0d2[_0xdc90('0x39')]=qs[_0xdc90('0x3a')](_0x4752f4[_0xdc90('0x30')][_0xdc90('0x3a')]);_0x1db0d2[_0xdc90('0x3b')]=qs[_0xdc90('0x32')](_[_0xdc90('0x3c')](_0x4752f4[_0xdc90('0x30')],_0x2b16fc[_0xdc90('0x32')]),_0x6803d8);if(_0x4752f4['query']['filter']){_0x1db0d2[_0xdc90('0x3b')]=_['merge'](_0x1db0d2[_0xdc90('0x3b')],{'$or':_['map'](_0x6803d8,function(_0x5945be){if(_0x5945be[_0xdc90('0x2d')]!==_0xdc90('0x3d')){var _0x3822e4={};_0x3822e4[_0x5945be[_0xdc90('0x29')]]={'$like':'%'+_0x4752f4[_0xdc90('0x30')][_0xdc90('0x3e')]+'%'};return _0x3822e4;}})});}_0x1db0d2=_[_0xdc90('0x3f')]({},_0x1db0d2,_0x4752f4[_0xdc90('0x40')]);var _0x346e82={'where':_0x1db0d2[_0xdc90('0x3b')]};return db[_0xdc90('0x2b')][_0xdc90('0x21')](_0x346e82)[_0xdc90('0x26')](function(_0x3c2b78){_0x120499[_0xdc90('0x21')]=_0x3c2b78;if(_0x4752f4[_0xdc90('0x30')][_0xdc90('0x41')]){_0x1db0d2[_0xdc90('0x42')]=[{'all':!![]}];}return db['ServicenowField']['findAll'](_0x1db0d2);})[_0xdc90('0x26')](function(_0x569b53){_0x120499[_0xdc90('0x43')]=_0x569b53;return _0x120499;})[_0xdc90('0x26')](respondWithFilteredResult(_0x13dff5,_0x1db0d2))[_0xdc90('0x44')](handleError(_0x13dff5,null));};exports['show']=function(_0x58a39d,_0x327843){var _0x470c22={'raw':!![],'where':{'id':_0x58a39d[_0xdc90('0x45')]['id']}},_0x3a95a3={};_0x3a95a3[_0xdc90('0x34')]=_[_0xdc90('0x31')](db['ServicenowField'][_0xdc90('0x46')]);_0x3a95a3[_0xdc90('0x30')]=_[_0xdc90('0x31')](_0x58a39d[_0xdc90('0x30')]);_0x3a95a3[_0xdc90('0x32')]=_['intersection'](_0x3a95a3[_0xdc90('0x34')],_0x3a95a3[_0xdc90('0x30')]);_0x470c22[_0xdc90('0x35')]=_[_0xdc90('0x33')](_0x3a95a3[_0xdc90('0x34')],qs[_0xdc90('0x47')](_0x58a39d[_0xdc90('0x30')]['fields']));_0x470c22['attributes']=_0x470c22[_0xdc90('0x35')]['length']?_0x470c22[_0xdc90('0x35')]:_0x3a95a3['model'];if(_0x58a39d['query'][_0xdc90('0x41')]){_0x470c22[_0xdc90('0x42')]=[{'all':!![]}];}_0x470c22=_[_0xdc90('0x3f')]({},_0x470c22,_0x58a39d[_0xdc90('0x40')]);return db[_0xdc90('0x2b')][_0xdc90('0x48')](_0x470c22)['then'](handleEntityNotFound(_0x327843,null))['then'](respondWithResult(_0x327843,null))[_0xdc90('0x44')](handleError(_0x327843,null));};exports[_0xdc90('0x49')]=function(_0x4e32d9,_0x1866ab){return db[_0xdc90('0x2b')][_0xdc90('0x49')](_0x4e32d9[_0xdc90('0x4a')],{})[_0xdc90('0x26')](respondWithResult(_0x1866ab,0xc9))['catch'](handleError(_0x1866ab,null));};exports[_0xdc90('0x4b')]=function(_0x268656,_0x3c3346){if(_0x268656[_0xdc90('0x4a')]['id']){delete _0x268656[_0xdc90('0x4a')]['id'];}return db[_0xdc90('0x2b')][_0xdc90('0x48')]({'where':{'id':_0x268656['params']['id']}})[_0xdc90('0x26')](handleEntityNotFound(_0x3c3346,null))[_0xdc90('0x26')](saveUpdates(_0x268656['body'],null))[_0xdc90('0x26')](respondWithResult(_0x3c3346,null))[_0xdc90('0x44')](handleError(_0x3c3346,null));};exports[_0xdc90('0x25')]=function(_0xc6f454,_0x1baf55){return db['ServicenowField'][_0xdc90('0x48')]({'where':{'id':_0xc6f454[_0xdc90('0x45')]['id']}})[_0xdc90('0x26')](handleEntityNotFound(_0x1baf55,null))[_0xdc90('0x26')](removeEntity(_0x1baf55,null))['catch'](handleError(_0x1baf55,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 9ffc754..60b01b1 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 _0xba2a=['ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','lodash','moment','bluebird','path','rimraf','../../config/environment','./intServicenowField.attributes','exports'];(function(_0x89548e,_0x1eeddf){var _0x142951=function(_0x358a4e){while(--_0x358a4e){_0x89548e['push'](_0x89548e['shift']());}};_0x142951(++_0x1eeddf);}(_0xba2a,0x94));var _0xaba2=function(_0x5843d2,_0x121877){_0x5843d2=_0x5843d2-0x0;var _0x6dd37=_0xba2a[_0x5843d2];return _0x6dd37;};'use strict';var _=require(_0xaba2('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xaba2('0x1'));var BPromise=require(_0xaba2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaba2('0x3'));var rimraf=require(_0xaba2('0x4'));var config=require(_0xaba2('0x5'));var attributes=require(_0xaba2('0x6'));module[_0xaba2('0x7')]=function(_0x222b28,_0xad8625){return _0x222b28['define'](_0xaba2('0x8'),attributes,{'tableName':_0xaba2('0x9'),'paranoid':![],'indexes':[{'name':_0xaba2('0xa'),'fields':[_0xaba2('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x71af=['../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','idField','FieldId','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x31172e,_0xa59e5){var _0x414ada=function(_0x37ede4){while(--_0x37ede4){_0x31172e['push'](_0x31172e['shift']());}};_0x414ada(++_0xa59e5);}(_0x71af,0x19d));var _0xf71a=function(_0x3f8b6c,_0x4483e2){_0x3f8b6c=_0x3f8b6c-0x0;var _0x1e041f=_0x71af[_0x3f8b6c];return _0x1e041f;};'use strict';var _=require('lodash');var util=require(_0xf71a('0x0'));var logger=require('../../config/logger')(_0xf71a('0x1'));var moment=require(_0xf71a('0x2'));var BPromise=require(_0xf71a('0x3'));var rp=require(_0xf71a('0x4'));var fs=require('fs');var path=require(_0xf71a('0x5'));var rimraf=require(_0xf71a('0x6'));var config=require(_0xf71a('0x7'));var attributes=require(_0xf71a('0x8'));module[_0xf71a('0x9')]=function(_0x4fb615,_0x3a5547){return _0x4fb615[_0xf71a('0xa')](_0xf71a('0xb'),attributes,{'tableName':_0xf71a('0xc'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xf71a('0xd'),_0xf71a('0xe')],'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 ab6bb5f..1867326 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbdb7=['request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','ServicenowField,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x5a9776,_0x4b5ab3){_0x5a9776=_0x5a9776-0x0;var _0x454edb=_0xbdb7[_0x5a9776];return _0x454edb;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});} \ No newline at end of file +var _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(_0x45ae0d,_0x1ea3b9){var _0x371826=function(_0x20e757){while(--_0x20e757){_0x45ae0d['push'](_0x45ae0d['shift']());}};_0x371826(++_0x1ea3b9);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbaf0[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 5e4565d..0d65949 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(_0x22bea9,_0x26d3a8){var _0x432864=function(_0x2aa3c9){while(--_0x2aa3c9){_0x22bea9['push'](_0x22bea9['shift']());}};_0x432864(++_0x26d3a8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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(_0x2a77a6,_0x3fc382){var _0x4e2ebc=function(_0x442f24){while(--_0x442f24){_0x2a77a6['push'](_0x2a77a6['shift']());}};_0x4e2ebc(++_0x3fc382);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index d92e569..6bf0b72 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(_0x43027c,_0x103078){var _0x2a4900=function(_0x504745){while(--_0x504745){_0x43027c['push'](_0x43027c['shift']());}};_0x2a4900(++_0x103078);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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(_0x81f105,_0x29ed27){var _0x1d07f6=function(_0xa8b226){while(--_0xa8b226){_0x81f105['push'](_0x81f105['shift']());}};_0x1d07f6(++_0x29ed27);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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 eabd918..8570c38 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 _0x7332=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','merge','type','VIRTUAL','options','findAll','catch','show','params','includeAll','include','find','create','body','findOne','sort','getConfigurations','AccountId','Subjects','getSubjects','channel','getDescriptions','SugarcrmConfiguration','SugarcrmField','Descriptions','getFields','assigned_user_id','description','date_start','duration_hours','parent_id','parent_type','parent_name','direction','username','password','remoteUri','substring','lastIndexOf','POST','format','%s%s','login','JSON','stringify','PLAIN','Invalid\x20Login','Calls','module_fields','remove','includes','label','endsWith','values','value','statusCode','test','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0x7332,0x67));var _0x2733=function(_0x3f5f71,_0x42d36b){_0x3f5f71=_0x3f5f71-0x0;var _0x289757=_0x7332[_0x3f5f71];return _0x289757;};'use strict';var emlformat=require(_0x2733('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2733('0x1'));var jsonpatch=require(_0x2733('0x2'));var rp=require(_0x2733('0x3'));var moment=require(_0x2733('0x4'));var BPromise=require(_0x2733('0x5'));var Mustache=require(_0x2733('0x6'));var util=require(_0x2733('0x7'));var path=require(_0x2733('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2733('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2733('0xa'));var squel=require(_0x2733('0xb'));var crypto=require(_0x2733('0xc'));var jsforce=require(_0x2733('0xd'));var deskjs=require(_0x2733('0xe'));var toCsv=require(_0x2733('0xf'));var querystring=require('querystring');var Papa=require(_0x2733('0x10'));var Redis=require('ioredis');var authService=require(_0x2733('0x11'));var qs=require(_0x2733('0x12'));var as=require(_0x2733('0x13'));var hardwareService=require(_0x2733('0x14'));var logger=require(_0x2733('0x15'))(_0x2733('0x16'));var utils=require(_0x2733('0x17'));var config=require(_0x2733('0x18'));var licenseUtil=require(_0x2733('0x19'));var db=require(_0x2733('0x1a'))['db'];var integrations=require(_0x2733('0x1b'));function respondWithStatusCode(_0x2919aa,_0x34a7f3){_0x34a7f3=_0x34a7f3||0xcc;return function(_0x144757){if(_0x144757){return _0x2919aa[_0x2733('0x1c')](_0x34a7f3);}return _0x2919aa[_0x2733('0x1d')](_0x34a7f3)[_0x2733('0x1e')]();};}function respondWithResult(_0x5e93f8,_0x18c447){_0x18c447=_0x18c447||0xc8;return function(_0xec97c3){if(_0xec97c3){return _0x5e93f8[_0x2733('0x1d')](_0x18c447)[_0x2733('0x1f')](_0xec97c3);}};}function respondWithFilteredResult(_0x3d7e81,_0x1466df){return function(_0x4470d9){if(_0x4470d9){var _0x5373b4=typeof _0x1466df[_0x2733('0x20')]===_0x2733('0x21')&&typeof _0x1466df['limit']===_0x2733('0x21');var _0xbe6ed5=_0x4470d9['count'];var _0x101ae7=_0x5373b4?0x0:_0x1466df[_0x2733('0x20')];var _0x16ff94=_0x5373b4?_0x4470d9[_0x2733('0x22')]:_0x1466df[_0x2733('0x20')]+_0x1466df[_0x2733('0x23')];var _0x3a07f2;if(_0x16ff94>=_0xbe6ed5){_0x16ff94=_0xbe6ed5;_0x3a07f2=0xc8;}else{_0x3a07f2=0xce;}_0x3d7e81['status'](_0x3a07f2);return _0x3d7e81[_0x2733('0x24')](_0x2733('0x25'),_0x101ae7+'-'+_0x16ff94+'/'+_0xbe6ed5)['json'](_0x4470d9);}return null;};}function patchUpdates(_0x5e5a83){return function(_0x4fd18b){try{jsonpatch['apply'](_0x4fd18b,_0x5e5a83,!![]);}catch(_0x500bf3){return BPromise[_0x2733('0x26')](_0x500bf3);}return _0x4fd18b[_0x2733('0x27')]();};}function saveUpdates(_0x333e4d,_0x227539){return function(_0x1f7037){if(_0x1f7037){return _0x1f7037[_0x2733('0x28')](_0x333e4d)[_0x2733('0x29')](function(_0x41cec3){return _0x41cec3;});}return null;};}function removeEntity(_0x5ecc08,_0x4c137c){return function(_0x455e83){if(_0x455e83){return _0x455e83[_0x2733('0x2a')]()[_0x2733('0x29')](function(){_0x5ecc08[_0x2733('0x1d')](0xcc)[_0x2733('0x1e')]();});}};}function handleEntityNotFound(_0x4d0a48,_0x5c78ad){return function(_0x259ca0){if(!_0x259ca0){_0x4d0a48[_0x2733('0x1c')](0x194);}return _0x259ca0;};}function handleError(_0x1f0dbd,_0x2c5e40){_0x2c5e40=_0x2c5e40||0x1f4;return function(_0x4ea523){logger[_0x2733('0x2b')](_0x4ea523[_0x2733('0x2c')]);if(_0x4ea523[_0x2733('0x2d')]){delete _0x4ea523['name'];}_0x1f0dbd[_0x2733('0x1d')](_0x2c5e40)[_0x2733('0x2e')](_0x4ea523);};}exports[_0x2733('0x2f')]=function(_0x57bc65,_0xc4ec47){var _0x34d8bf={},_0x4fd9b4={},_0x3388ef={'count':0x0,'rows':[]};var _0x5e6dde=_[_0x2733('0x30')](db[_0x2733('0x31')][_0x2733('0x32')],function(_0x5d9c29){return{'name':_0x5d9c29[_0x2733('0x33')],'type':_0x5d9c29['type'][_0x2733('0x34')]};});_0x4fd9b4[_0x2733('0x35')]=_[_0x2733('0x30')](_0x5e6dde,'name');_0x4fd9b4['query']=_[_0x2733('0x36')](_0x57bc65[_0x2733('0x37')]);_0x4fd9b4[_0x2733('0x38')]=_[_0x2733('0x39')](_0x4fd9b4[_0x2733('0x35')],_0x4fd9b4['query']);_0x34d8bf[_0x2733('0x3a')]=_['intersection'](_0x4fd9b4[_0x2733('0x35')],qs[_0x2733('0x3b')](_0x57bc65[_0x2733('0x37')]['fields']));_0x34d8bf[_0x2733('0x3a')]=_0x34d8bf[_0x2733('0x3a')][_0x2733('0x3c')]?_0x34d8bf[_0x2733('0x3a')]:_0x4fd9b4[_0x2733('0x35')];if(!_0x57bc65[_0x2733('0x37')][_0x2733('0x3d')]('nolimit')){_0x34d8bf[_0x2733('0x23')]=qs['limit'](_0x57bc65['query'][_0x2733('0x23')]);_0x34d8bf[_0x2733('0x20')]=qs[_0x2733('0x20')](_0x57bc65[_0x2733('0x37')]['offset']);}_0x34d8bf[_0x2733('0x3e')]=qs['sort'](_0x57bc65['query']['sort']);_0x34d8bf[_0x2733('0x3f')]=qs['filters'](_[_0x2733('0x40')](_0x57bc65[_0x2733('0x37')],_0x4fd9b4[_0x2733('0x38')]),_0x5e6dde);if(_0x57bc65[_0x2733('0x37')][_0x2733('0x41')]){_0x34d8bf[_0x2733('0x3f')]=_[_0x2733('0x42')](_0x34d8bf['where'],{'$or':_[_0x2733('0x30')](_0x5e6dde,function(_0x4a1ef7){if(_0x4a1ef7[_0x2733('0x43')]!==_0x2733('0x44')){var _0x57d8b1={};_0x57d8b1[_0x4a1ef7['name']]={'$like':'%'+_0x57bc65[_0x2733('0x37')][_0x2733('0x41')]+'%'};return _0x57d8b1;}})});}_0x34d8bf=_['merge']({},_0x34d8bf,_0x57bc65[_0x2733('0x45')]);var _0x4260c3={'where':_0x34d8bf[_0x2733('0x3f')]};return db[_0x2733('0x31')][_0x2733('0x22')](_0x4260c3)['then'](function(_0x396deb){_0x3388ef['count']=_0x396deb;if(_0x57bc65[_0x2733('0x37')]['includeAll']){_0x34d8bf['include']=[{'all':!![]}];}return db[_0x2733('0x31')][_0x2733('0x46')](_0x34d8bf);})['then'](function(_0x428529){_0x3388ef['rows']=_0x428529;return _0x3388ef;})[_0x2733('0x29')](respondWithFilteredResult(_0xc4ec47,_0x34d8bf))[_0x2733('0x47')](handleError(_0xc4ec47,null));};exports[_0x2733('0x48')]=function(_0x5145f5,_0x2824c4){var _0x5aee3b={'raw':![],'where':{'id':_0x5145f5[_0x2733('0x49')]['id']}},_0x54dab9={};_0x54dab9[_0x2733('0x35')]=_[_0x2733('0x36')](db[_0x2733('0x31')][_0x2733('0x32')]);_0x54dab9[_0x2733('0x37')]=_['keys'](_0x5145f5['query']);_0x54dab9[_0x2733('0x38')]=_['intersection'](_0x54dab9[_0x2733('0x35')],_0x54dab9[_0x2733('0x37')]);_0x5aee3b[_0x2733('0x3a')]=_['intersection'](_0x54dab9[_0x2733('0x35')],qs[_0x2733('0x3b')](_0x5145f5[_0x2733('0x37')][_0x2733('0x3b')]));_0x5aee3b[_0x2733('0x3a')]=_0x5aee3b[_0x2733('0x3a')][_0x2733('0x3c')]?_0x5aee3b[_0x2733('0x3a')]:_0x54dab9[_0x2733('0x35')];if(_0x5145f5[_0x2733('0x37')][_0x2733('0x4a')]){_0x5aee3b[_0x2733('0x4b')]=[{'all':!![]}];}_0x5aee3b=_[_0x2733('0x42')]({},_0x5aee3b,_0x5145f5[_0x2733('0x45')]);return db[_0x2733('0x31')][_0x2733('0x4c')](_0x5aee3b)[_0x2733('0x29')](handleEntityNotFound(_0x2824c4,null))[_0x2733('0x29')](respondWithResult(_0x2824c4,null))[_0x2733('0x47')](handleError(_0x2824c4,null));};exports[_0x2733('0x4d')]=function(_0x2f8984,_0x31b53f){return db[_0x2733('0x31')][_0x2733('0x4d')](_0x2f8984[_0x2733('0x4e')],{})[_0x2733('0x29')](respondWithResult(_0x31b53f,0xc9))[_0x2733('0x47')](handleError(_0x31b53f,null));};exports[_0x2733('0x28')]=function(_0x4ee4eb,_0x3aa53e){if(_0x4ee4eb[_0x2733('0x4e')]['id']){delete _0x4ee4eb[_0x2733('0x4e')]['id'];}return db[_0x2733('0x31')]['find']({'where':{'id':_0x4ee4eb['params']['id']}})[_0x2733('0x29')](handleEntityNotFound(_0x3aa53e,null))['then'](saveUpdates(_0x4ee4eb[_0x2733('0x4e')],null))['then'](respondWithResult(_0x3aa53e,null))[_0x2733('0x47')](handleError(_0x3aa53e,null));};exports[_0x2733('0x2a')]=function(_0x4e4ae0,_0x57b764){return db[_0x2733('0x31')][_0x2733('0x4c')]({'where':{'id':_0x4e4ae0[_0x2733('0x49')]['id']}})[_0x2733('0x29')](handleEntityNotFound(_0x57b764,null))[_0x2733('0x29')](removeEntity(_0x57b764,null))['catch'](handleError(_0x57b764,null));};exports['getConfigurations']=function(_0x294223,_0x52065c,_0x14b129){var _0x395f49={};var _0x268b6a={};var _0x453824;var _0x355a73;return db[_0x2733('0x31')][_0x2733('0x4f')]({'where':{'id':_0x294223[_0x2733('0x49')]['id']}})[_0x2733('0x29')](handleEntityNotFound(_0x52065c,null))[_0x2733('0x29')](function(_0x52eebf){if(_0x52eebf){_0x453824=_0x52eebf;_0x268b6a[_0x2733('0x35')]=_[_0x2733('0x36')](db['SugarcrmConfiguration'][_0x2733('0x32')]);_0x268b6a[_0x2733('0x37')]=_['keys'](_0x294223[_0x2733('0x37')]);_0x268b6a[_0x2733('0x38')]=_['intersection'](_0x268b6a[_0x2733('0x35')],_0x268b6a[_0x2733('0x37')]);_0x395f49[_0x2733('0x3a')]=_[_0x2733('0x39')](_0x268b6a[_0x2733('0x35')],qs[_0x2733('0x3b')](_0x294223[_0x2733('0x37')][_0x2733('0x3b')]));_0x395f49[_0x2733('0x3a')]=_0x395f49[_0x2733('0x3a')][_0x2733('0x3c')]?_0x395f49['attributes']:_0x268b6a[_0x2733('0x35')];_0x395f49[_0x2733('0x3e')]=qs[_0x2733('0x50')](_0x294223[_0x2733('0x37')][_0x2733('0x50')]);_0x395f49[_0x2733('0x3f')]=qs[_0x2733('0x38')](_[_0x2733('0x40')](_0x294223['query'],_0x268b6a[_0x2733('0x38')]));if(_0x294223[_0x2733('0x37')][_0x2733('0x41')]){_0x395f49[_0x2733('0x3f')]=_[_0x2733('0x42')](_0x395f49[_0x2733('0x3f')],{'$or':_[_0x2733('0x30')](_0x395f49[_0x2733('0x3a')],function(_0x38ce16){var _0x5a7cae={};_0x5a7cae[_0x38ce16]={'$like':'%'+_0x294223[_0x2733('0x37')][_0x2733('0x41')]+'%'};return _0x5a7cae;})});}_0x395f49=_[_0x2733('0x42')]({},_0x395f49,_0x294223[_0x2733('0x45')]);return _0x453824[_0x2733('0x51')](_0x395f49);}})[_0x2733('0x29')](function(_0x517cc3){if(_0x517cc3){_0x355a73=_0x517cc3[_0x2733('0x3c')];if(!_0x294223['query']['hasOwnProperty']('nolimit')){_0x395f49[_0x2733('0x23')]=qs[_0x2733('0x23')](_0x294223[_0x2733('0x37')][_0x2733('0x23')]);_0x395f49['offset']=qs[_0x2733('0x20')](_0x294223[_0x2733('0x37')][_0x2733('0x20')]);}return _0x453824[_0x2733('0x51')](_0x395f49);}})[_0x2733('0x29')](function(_0x172060){if(_0x172060){return _0x172060?{'count':_0x355a73,'rows':_0x172060}:null;}})[_0x2733('0x29')](respondWithResult(_0x52065c,null))[_0x2733('0x47')](handleError(_0x52065c,null));};exports['addConfiguration']=function(_0xb967af,_0x5485c0,_0x42802c){if(_0xb967af[_0x2733('0x4e')]['id']){delete _0xb967af[_0x2733('0x4e')]['id'];}return db[_0x2733('0x31')]['findOne']({'where':{'id':_0xb967af[_0x2733('0x49')]['id']}})['then'](handleEntityNotFound(_0x5485c0,null))[_0x2733('0x29')](function(_0x2e75c6){if(_0x2e75c6){_0xb967af['body'][_0x2733('0x52')]=_0x2e75c6['id'];_0xb967af['body'][_0x2733('0x53')]=integrations[_0x2733('0x54')](_0xb967af[_0x2733('0x4e')][_0x2733('0x55')],_0xb967af[_0x2733('0x4e')]['type']);_0xb967af[_0x2733('0x4e')]['Descriptions']=integrations[_0x2733('0x56')](_0xb967af['body']['channel'],_0xb967af[_0x2733('0x4e')][_0x2733('0x43')]);return db[_0x2733('0x57')]['create'](_0xb967af[_0x2733('0x4e')],{'include':[{'model':db[_0x2733('0x58')],'as':_0x2733('0x53')},{'model':db['SugarcrmField'],'as':_0x2733('0x59')}]});}return null;})[_0x2733('0x29')](respondWithResult(_0x5485c0,null))['catch'](handleError(_0x5485c0,null));};exports[_0x2733('0x5a')]=function(_0x11c7af,_0x1cfbd4,_0x598977){var _0x5e96bc='';var _0x693cec=['id',_0x2733('0x2d'),_0x2733('0x5b'),'created_by',_0x2733('0x5c'),_0x2733('0x5d'),_0x2733('0x5e'),'duration_minutes',_0x2733('0x5f'),_0x2733('0x60'),_0x2733('0x61'),_0x2733('0x62')];return db[_0x2733('0x31')][_0x2733('0x4f')]({'where':{'id':_0x11c7af[_0x2733('0x49')]['id']},'attributes':['id',_0x2733('0x63'),_0x2733('0x64'),_0x2733('0x65')]})['then'](handleEntityNotFound(_0x1cfbd4,null))['then'](function(_0x1b1391){if(_0x1b1391){_0x5e96bc=_0x1b1391[_0x2733('0x65')];var _0x43f393=_0x5e96bc['slice'](-0x1);if(_0x43f393==='/'){_0x5e96bc=_0x5e96bc[_0x2733('0x66')](0x0,_0x5e96bc[_0x2733('0x67')](_0x43f393));}return rp({'method':_0x2733('0x68'),'uri':util[_0x2733('0x69')](_0x2733('0x6a'),_0x5e96bc,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x2733('0x6b'),'input_type':_0x2733('0x6c'),'response_type':_0x2733('0x6c'),'rest_data':JSON[_0x2733('0x6d')]({'user_auth':{'user_name':_0x1b1391[_0x2733('0x63')],'password':_0x1b1391[_0x2733('0x64')],'encryption':_0x2733('0x6e')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x2733('0x29')](function(_0x362546){if(_0x362546&&_0x362546[_0x2733('0x2d')]!==_0x2733('0x6f')&&_0x362546['name']!=='Password\x20Expired'){return rp({'method':_0x2733('0x68'),'uri':util['format'](_0x2733('0x6a'),_0x5e96bc,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':_0x2733('0x6c'),'response_type':'JSON','rest_data':JSON[_0x2733('0x6d')]({'session':_0x362546['id'],'module_name':_0x2733('0x70')})}})[_0x2733('0x29')](function(_0x128eb3){if(_0x128eb3){var _0x4dabe8=_['values'](_0x128eb3[_0x2733('0x71')]);_[_0x2733('0x72')](_0x4dabe8,function(_0x398a51){return _0x693cec[_0x2733('0x73')](_0x398a51[_0x2733('0x2d')]);});return{'count':_0x4dabe8['length'],'rows':_[_0x2733('0x30')](_0x4dabe8,function(_0x508872){return{'id':_0x508872[_0x2733('0x2d')],'name':_0x508872[_0x2733('0x74')],'custom':_[_0x2733('0x75')](_0x508872[_0x2733('0x2d')],'_c')?!![]:![],'options':_0x508872[_0x2733('0x45')]?_[_0x2733('0x30')](_[_0x2733('0x76')](_0x508872[_0x2733('0x45')]),function(_0x1ee0f9){return{'name':_0x1ee0f9[_0x2733('0x77')],'value':_0x1ee0f9[_0x2733('0x2d')]};}):[]};})};}})[_0x2733('0x29')](respondWithResult(_0x1cfbd4,null))[_0x2733('0x47')](function(_0x4723c4){var _0xfc2c31=_0x11c7af[_0x2733('0x37')]['test']?0x1f4:_0x4723c4[_0x2733('0x78')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x2733('0x5a'),_0xfc2c31,JSON['stringify'](_0x4723c4));delete _0x4723c4['name'];if(_0xfc2c31===0x191){_0xfc2c31=0x190;}_0x1cfbd4['status'](_0xfc2c31)[_0x2733('0x2e')](_0x11c7af[_0x2733('0x37')][_0x2733('0x79')]?{'message':_0x2733('0x7a'),'statusCode':_0x4723c4[_0x2733('0x78')]}:_0x4723c4);});}else{var _0xbf8805=0x1f4;_0x1cfbd4[_0x2733('0x1d')](_0xbf8805)[_0x2733('0x2e')]({'message':_0x2733('0x7a'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x0fea=['value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','limit','undefined','offset','Content-Range','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','SugarcrmAccount','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','count','includeAll','findAll','catch','params','include','find','create','body','findOne','getConfigurations','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','SugarcrmConfiguration','SugarcrmField','Subjects','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','direction','username','password','remoteUri','slice','lastIndexOf','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','get_module_fields','Calls','values','module_fields','remove','includes','endsWith'];(function(_0x3eb754,_0x723dbf){var _0x19e338=function(_0x5ed376){while(--_0x5ed376){_0x3eb754['push'](_0x3eb754['shift']());}};_0x19e338(++_0x723dbf);}(_0x0fea,0x80));var _0xa0fe=function(_0x3a14ac,_0x55403f){_0x3a14ac=_0x3a14ac-0x0;var _0x5e3bc3=_0x0fea[_0x3a14ac];return _0x5e3bc3;};'use strict';var emlformat=require(_0xa0fe('0x0'));var rimraf=require(_0xa0fe('0x1'));var zipdir=require(_0xa0fe('0x2'));var jsonpatch=require(_0xa0fe('0x3'));var rp=require(_0xa0fe('0x4'));var moment=require(_0xa0fe('0x5'));var BPromise=require(_0xa0fe('0x6'));var Mustache=require(_0xa0fe('0x7'));var util=require(_0xa0fe('0x8'));var path=require(_0xa0fe('0x9'));var sox=require(_0xa0fe('0xa'));var csv=require('to-csv');var ejs=require(_0xa0fe('0xb'));var fs=require('fs');var fs_extra=require(_0xa0fe('0xc'));var _=require(_0xa0fe('0xd'));var squel=require(_0xa0fe('0xe'));var crypto=require('crypto');var jsforce=require(_0xa0fe('0xf'));var deskjs=require(_0xa0fe('0x10'));var toCsv=require(_0xa0fe('0x11'));var querystring=require('querystring');var Papa=require(_0xa0fe('0x12'));var Redis=require(_0xa0fe('0x13'));var authService=require(_0xa0fe('0x14'));var qs=require(_0xa0fe('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa0fe('0x16'));var logger=require('../../config/logger')(_0xa0fe('0x17'));var utils=require(_0xa0fe('0x18'));var config=require(_0xa0fe('0x19'));var licenseUtil=require(_0xa0fe('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x18be66,_0x149f2e){_0x149f2e=_0x149f2e||0xcc;return function(_0x35a9db){if(_0x35a9db){return _0x18be66['sendStatus'](_0x149f2e);}return _0x18be66[_0xa0fe('0x1b')](_0x149f2e)[_0xa0fe('0x1c')]();};}function respondWithResult(_0x572158,_0x5700c2){_0x5700c2=_0x5700c2||0xc8;return function(_0x438b4f){if(_0x438b4f){return _0x572158[_0xa0fe('0x1b')](_0x5700c2)[_0xa0fe('0x1d')](_0x438b4f);}};}function respondWithFilteredResult(_0x220b5a,_0x52ff2d){return function(_0x3eb700){if(_0x3eb700){var _0x5b7900=typeof _0x52ff2d['offset']==='undefined'&&typeof _0x52ff2d[_0xa0fe('0x1e')]===_0xa0fe('0x1f');var _0x23a29b=_0x3eb700['count'];var _0x172859=_0x5b7900?0x0:_0x52ff2d['offset'];var _0x447b9d=_0x5b7900?_0x3eb700['count']:_0x52ff2d[_0xa0fe('0x20')]+_0x52ff2d[_0xa0fe('0x1e')];var _0x27f5c7;if(_0x447b9d>=_0x23a29b){_0x447b9d=_0x23a29b;_0x27f5c7=0xc8;}else{_0x27f5c7=0xce;}_0x220b5a['status'](_0x27f5c7);return _0x220b5a['set'](_0xa0fe('0x21'),_0x172859+'-'+_0x447b9d+'/'+_0x23a29b)[_0xa0fe('0x1d')](_0x3eb700);}return null;};}function patchUpdates(_0xc53cad){return function(_0x427019){try{jsonpatch['apply'](_0x427019,_0xc53cad,!![]);}catch(_0x364518){return BPromise[_0xa0fe('0x22')](_0x364518);}return _0x427019[_0xa0fe('0x23')]();};}function saveUpdates(_0x2e2cff,_0x3c1d5c){return function(_0x33e199){if(_0x33e199){return _0x33e199[_0xa0fe('0x24')](_0x2e2cff)[_0xa0fe('0x25')](function(_0x57929a){return _0x57929a;});}return null;};}function removeEntity(_0x36c56d,_0x2bd6a8){return function(_0x26e8c2){if(_0x26e8c2){return _0x26e8c2[_0xa0fe('0x26')]()[_0xa0fe('0x25')](function(){_0x36c56d[_0xa0fe('0x1b')](0xcc)[_0xa0fe('0x1c')]();});}};}function handleEntityNotFound(_0x25be36,_0x66e04d){return function(_0x5317c7){if(!_0x5317c7){_0x25be36[_0xa0fe('0x27')](0x194);}return _0x5317c7;};}function handleError(_0x230edf,_0x6fda6d){_0x6fda6d=_0x6fda6d||0x1f4;return function(_0x4025c7){logger[_0xa0fe('0x28')](_0x4025c7['stack']);if(_0x4025c7[_0xa0fe('0x29')]){delete _0x4025c7[_0xa0fe('0x29')];}_0x230edf['status'](_0x6fda6d)[_0xa0fe('0x2a')](_0x4025c7);};}exports[_0xa0fe('0x2b')]=function(_0x397f75,_0x5b6363){var _0x24b1c0={},_0x34ad53={},_0x2f734c={'count':0x0,'rows':[]};var _0x58586a=_[_0xa0fe('0x2c')](db[_0xa0fe('0x2d')]['rawAttributes'],function(_0x234f48){return{'name':_0x234f48[_0xa0fe('0x2e')],'type':_0x234f48['type'][_0xa0fe('0x2f')]};});_0x34ad53[_0xa0fe('0x30')]=_['map'](_0x58586a,_0xa0fe('0x29'));_0x34ad53[_0xa0fe('0x31')]=_[_0xa0fe('0x32')](_0x397f75['query']);_0x34ad53[_0xa0fe('0x33')]=_[_0xa0fe('0x34')](_0x34ad53[_0xa0fe('0x30')],_0x34ad53['query']);_0x24b1c0[_0xa0fe('0x35')]=_[_0xa0fe('0x34')](_0x34ad53[_0xa0fe('0x30')],qs[_0xa0fe('0x36')](_0x397f75[_0xa0fe('0x31')][_0xa0fe('0x36')]));_0x24b1c0[_0xa0fe('0x35')]=_0x24b1c0[_0xa0fe('0x35')][_0xa0fe('0x37')]?_0x24b1c0['attributes']:_0x34ad53[_0xa0fe('0x30')];if(!_0x397f75[_0xa0fe('0x31')][_0xa0fe('0x38')](_0xa0fe('0x39'))){_0x24b1c0[_0xa0fe('0x1e')]=qs[_0xa0fe('0x1e')](_0x397f75[_0xa0fe('0x31')][_0xa0fe('0x1e')]);_0x24b1c0[_0xa0fe('0x20')]=qs[_0xa0fe('0x20')](_0x397f75[_0xa0fe('0x31')][_0xa0fe('0x20')]);}_0x24b1c0[_0xa0fe('0x3a')]=qs[_0xa0fe('0x3b')](_0x397f75['query'][_0xa0fe('0x3b')]);_0x24b1c0[_0xa0fe('0x3c')]=qs['filters'](_[_0xa0fe('0x3d')](_0x397f75['query'],_0x34ad53['filters']),_0x58586a);if(_0x397f75['query'][_0xa0fe('0x3e')]){_0x24b1c0['where']=_['merge'](_0x24b1c0[_0xa0fe('0x3c')],{'$or':_['map'](_0x58586a,function(_0x89396d){if(_0x89396d[_0xa0fe('0x3f')]!==_0xa0fe('0x40')){var _0x147252={};_0x147252[_0x89396d[_0xa0fe('0x29')]]={'$like':'%'+_0x397f75['query'][_0xa0fe('0x3e')]+'%'};return _0x147252;}})});}_0x24b1c0=_[_0xa0fe('0x41')]({},_0x24b1c0,_0x397f75[_0xa0fe('0x42')]);var _0xa38c48={'where':_0x24b1c0[_0xa0fe('0x3c')]};return db[_0xa0fe('0x2d')][_0xa0fe('0x43')](_0xa38c48)[_0xa0fe('0x25')](function(_0x4000cf){_0x2f734c[_0xa0fe('0x43')]=_0x4000cf;if(_0x397f75[_0xa0fe('0x31')][_0xa0fe('0x44')]){_0x24b1c0['include']=[{'all':!![]}];}return db[_0xa0fe('0x2d')][_0xa0fe('0x45')](_0x24b1c0);})['then'](function(_0x5ac4fb){_0x2f734c['rows']=_0x5ac4fb;return _0x2f734c;})[_0xa0fe('0x25')](respondWithFilteredResult(_0x5b6363,_0x24b1c0))[_0xa0fe('0x46')](handleError(_0x5b6363,null));};exports['show']=function(_0x28bae0,_0x225b27){var _0x10d110={'raw':![],'where':{'id':_0x28bae0[_0xa0fe('0x47')]['id']}},_0x56a8e8={};_0x56a8e8[_0xa0fe('0x30')]=_[_0xa0fe('0x32')](db[_0xa0fe('0x2d')]['rawAttributes']);_0x56a8e8['query']=_[_0xa0fe('0x32')](_0x28bae0[_0xa0fe('0x31')]);_0x56a8e8['filters']=_['intersection'](_0x56a8e8['model'],_0x56a8e8[_0xa0fe('0x31')]);_0x10d110['attributes']=_[_0xa0fe('0x34')](_0x56a8e8[_0xa0fe('0x30')],qs[_0xa0fe('0x36')](_0x28bae0[_0xa0fe('0x31')][_0xa0fe('0x36')]));_0x10d110[_0xa0fe('0x35')]=_0x10d110[_0xa0fe('0x35')][_0xa0fe('0x37')]?_0x10d110[_0xa0fe('0x35')]:_0x56a8e8[_0xa0fe('0x30')];if(_0x28bae0[_0xa0fe('0x31')][_0xa0fe('0x44')]){_0x10d110[_0xa0fe('0x48')]=[{'all':!![]}];}_0x10d110=_[_0xa0fe('0x41')]({},_0x10d110,_0x28bae0['options']);return db['SugarcrmAccount'][_0xa0fe('0x49')](_0x10d110)[_0xa0fe('0x25')](handleEntityNotFound(_0x225b27,null))['then'](respondWithResult(_0x225b27,null))[_0xa0fe('0x46')](handleError(_0x225b27,null));};exports[_0xa0fe('0x4a')]=function(_0x508075,_0x59eede){return db[_0xa0fe('0x2d')][_0xa0fe('0x4a')](_0x508075['body'],{})[_0xa0fe('0x25')](respondWithResult(_0x59eede,0xc9))['catch'](handleError(_0x59eede,null));};exports[_0xa0fe('0x24')]=function(_0x226840,_0x3194fd){if(_0x226840[_0xa0fe('0x4b')]['id']){delete _0x226840[_0xa0fe('0x4b')]['id'];}return db[_0xa0fe('0x2d')][_0xa0fe('0x49')]({'where':{'id':_0x226840[_0xa0fe('0x47')]['id']}})['then'](handleEntityNotFound(_0x3194fd,null))[_0xa0fe('0x25')](saveUpdates(_0x226840[_0xa0fe('0x4b')],null))[_0xa0fe('0x25')](respondWithResult(_0x3194fd,null))[_0xa0fe('0x46')](handleError(_0x3194fd,null));};exports['destroy']=function(_0x4cf2ed,_0x45ffba){return db[_0xa0fe('0x2d')][_0xa0fe('0x49')]({'where':{'id':_0x4cf2ed[_0xa0fe('0x47')]['id']}})[_0xa0fe('0x25')](handleEntityNotFound(_0x45ffba,null))[_0xa0fe('0x25')](removeEntity(_0x45ffba,null))[_0xa0fe('0x46')](handleError(_0x45ffba,null));};exports['getConfigurations']=function(_0x3e46de,_0x31e0ec,_0xb45e34){var _0x2089be={};var _0x552bad={};var _0x35539c;var _0x4b4b84;return db[_0xa0fe('0x2d')][_0xa0fe('0x4c')]({'where':{'id':_0x3e46de['params']['id']}})['then'](handleEntityNotFound(_0x31e0ec,null))[_0xa0fe('0x25')](function(_0x52322e){if(_0x52322e){_0x35539c=_0x52322e;_0x552bad[_0xa0fe('0x30')]=_[_0xa0fe('0x32')](db['SugarcrmConfiguration']['rawAttributes']);_0x552bad['query']=_[_0xa0fe('0x32')](_0x3e46de[_0xa0fe('0x31')]);_0x552bad[_0xa0fe('0x33')]=_[_0xa0fe('0x34')](_0x552bad[_0xa0fe('0x30')],_0x552bad[_0xa0fe('0x31')]);_0x2089be['attributes']=_[_0xa0fe('0x34')](_0x552bad[_0xa0fe('0x30')],qs[_0xa0fe('0x36')](_0x3e46de[_0xa0fe('0x31')][_0xa0fe('0x36')]));_0x2089be['attributes']=_0x2089be[_0xa0fe('0x35')]['length']?_0x2089be[_0xa0fe('0x35')]:_0x552bad[_0xa0fe('0x30')];_0x2089be[_0xa0fe('0x3a')]=qs['sort'](_0x3e46de[_0xa0fe('0x31')]['sort']);_0x2089be[_0xa0fe('0x3c')]=qs['filters'](_[_0xa0fe('0x3d')](_0x3e46de[_0xa0fe('0x31')],_0x552bad['filters']));if(_0x3e46de[_0xa0fe('0x31')]['filter']){_0x2089be[_0xa0fe('0x3c')]=_[_0xa0fe('0x41')](_0x2089be['where'],{'$or':_['map'](_0x2089be['attributes'],function(_0x15e056){var _0x5658f0={};_0x5658f0[_0x15e056]={'$like':'%'+_0x3e46de['query']['filter']+'%'};return _0x5658f0;})});}_0x2089be=_[_0xa0fe('0x41')]({},_0x2089be,_0x3e46de[_0xa0fe('0x42')]);return _0x35539c[_0xa0fe('0x4d')](_0x2089be);}})[_0xa0fe('0x25')](function(_0x48e75f){if(_0x48e75f){_0x4b4b84=_0x48e75f[_0xa0fe('0x37')];if(!_0x3e46de[_0xa0fe('0x31')][_0xa0fe('0x38')](_0xa0fe('0x39'))){_0x2089be['limit']=qs[_0xa0fe('0x1e')](_0x3e46de[_0xa0fe('0x31')][_0xa0fe('0x1e')]);_0x2089be[_0xa0fe('0x20')]=qs[_0xa0fe('0x20')](_0x3e46de[_0xa0fe('0x31')][_0xa0fe('0x20')]);}return _0x35539c[_0xa0fe('0x4d')](_0x2089be);}})['then'](function(_0x54fbe1){if(_0x54fbe1){return _0x54fbe1?{'count':_0x4b4b84,'rows':_0x54fbe1}:null;}})['then'](respondWithResult(_0x31e0ec,null))['catch'](handleError(_0x31e0ec,null));};exports[_0xa0fe('0x4e')]=function(_0x50b772,_0x7890ab,_0x292ffa){if(_0x50b772[_0xa0fe('0x4b')]['id']){delete _0x50b772[_0xa0fe('0x4b')]['id'];}return db[_0xa0fe('0x2d')][_0xa0fe('0x4c')]({'where':{'id':_0x50b772['params']['id']}})[_0xa0fe('0x25')](handleEntityNotFound(_0x7890ab,null))[_0xa0fe('0x25')](function(_0x19f027){if(_0x19f027){_0x50b772['body'][_0xa0fe('0x4f')]=_0x19f027['id'];_0x50b772['body']['Subjects']=integrations[_0xa0fe('0x50')](_0x50b772[_0xa0fe('0x4b')]['channel'],_0x50b772[_0xa0fe('0x4b')][_0xa0fe('0x3f')]);_0x50b772[_0xa0fe('0x4b')][_0xa0fe('0x51')]=integrations[_0xa0fe('0x52')](_0x50b772['body'][_0xa0fe('0x53')],_0x50b772[_0xa0fe('0x4b')][_0xa0fe('0x3f')]);return db[_0xa0fe('0x54')]['create'](_0x50b772[_0xa0fe('0x4b')],{'include':[{'model':db[_0xa0fe('0x55')],'as':_0xa0fe('0x56')},{'model':db[_0xa0fe('0x55')],'as':_0xa0fe('0x51')}]});}return null;})[_0xa0fe('0x25')](respondWithResult(_0x7890ab,null))[_0xa0fe('0x46')](handleError(_0x7890ab,null));};exports['getFields']=function(_0x46d36b,_0x2eff4d,_0x77bfdb){var _0x4bcc44='';var _0x4cbb64=['id',_0xa0fe('0x29'),_0xa0fe('0x57'),_0xa0fe('0x58'),_0xa0fe('0x59'),_0xa0fe('0x5a'),_0xa0fe('0x5b'),_0xa0fe('0x5c'),_0xa0fe('0x5d'),'parent_type','parent_name',_0xa0fe('0x5e')];return db[_0xa0fe('0x2d')][_0xa0fe('0x4c')]({'where':{'id':_0x46d36b[_0xa0fe('0x47')]['id']},'attributes':['id',_0xa0fe('0x5f'),_0xa0fe('0x60'),_0xa0fe('0x61')]})[_0xa0fe('0x25')](handleEntityNotFound(_0x2eff4d,null))['then'](function(_0x16564a){if(_0x16564a){_0x4bcc44=_0x16564a[_0xa0fe('0x61')];var _0x10a644=_0x4bcc44[_0xa0fe('0x62')](-0x1);if(_0x10a644==='/'){_0x4bcc44=_0x4bcc44['substring'](0x0,_0x4bcc44[_0xa0fe('0x63')](_0x10a644));}return rp({'method':'POST','uri':util[_0xa0fe('0x64')](_0xa0fe('0x65'),_0x4bcc44,_0xa0fe('0x66')),'json':!![],'form':{'method':_0xa0fe('0x67'),'input_type':_0xa0fe('0x68'),'response_type':_0xa0fe('0x68'),'rest_data':JSON[_0xa0fe('0x69')]({'user_auth':{'user_name':_0x16564a[_0xa0fe('0x5f')],'password':_0x16564a[_0xa0fe('0x60')],'encryption':_0xa0fe('0x6a')},'application':_0xa0fe('0x6b')})}});}})[_0xa0fe('0x25')](function(_0x7d7f4f){if(_0x7d7f4f&&_0x7d7f4f['name']!==_0xa0fe('0x6c')&&_0x7d7f4f['name']!==_0xa0fe('0x6d')){return rp({'method':_0xa0fe('0x6e'),'uri':util['format']('%s%s',_0x4bcc44,_0xa0fe('0x66')),'json':!![],'form':{'method':_0xa0fe('0x6f'),'input_type':_0xa0fe('0x68'),'response_type':_0xa0fe('0x68'),'rest_data':JSON['stringify']({'session':_0x7d7f4f['id'],'module_name':_0xa0fe('0x70')})}})['then'](function(_0x288c61){if(_0x288c61){var _0x125e33=_[_0xa0fe('0x71')](_0x288c61[_0xa0fe('0x72')]);_[_0xa0fe('0x73')](_0x125e33,function(_0x187f1e){return _0x4cbb64[_0xa0fe('0x74')](_0x187f1e[_0xa0fe('0x29')]);});return{'count':_0x125e33[_0xa0fe('0x37')],'rows':_[_0xa0fe('0x2c')](_0x125e33,function(_0x51c087){return{'id':_0x51c087['name'],'name':_0x51c087['label'],'custom':_[_0xa0fe('0x75')](_0x51c087[_0xa0fe('0x29')],'_c')?!![]:![],'options':_0x51c087[_0xa0fe('0x42')]?_['map'](_[_0xa0fe('0x71')](_0x51c087[_0xa0fe('0x42')]),function(_0x597f74){return{'name':_0x597f74[_0xa0fe('0x76')],'value':_0x597f74[_0xa0fe('0x29')]};}):[]};})};}})[_0xa0fe('0x25')](respondWithResult(_0x2eff4d,null))[_0xa0fe('0x46')](function(_0x52286e){var _0x20ea40=_0x46d36b[_0xa0fe('0x31')][_0xa0fe('0x77')]?0x1f4:_0x52286e[_0xa0fe('0x78')]||0x1f4;logger[_0xa0fe('0x28')](_0xa0fe('0x79'),'getFields',_0x20ea40,JSON[_0xa0fe('0x69')](_0x52286e));delete _0x52286e['name'];if(_0x20ea40===0x191){_0x20ea40=0x190;}_0x2eff4d['status'](_0x20ea40)[_0xa0fe('0x2a')](_0x46d36b[_0xa0fe('0x31')][_0xa0fe('0x77')]?{'message':_0xa0fe('0x7a'),'statusCode':_0x52286e[_0xa0fe('0x78')]}:_0x52286e);});}else{var _0x505331=0x1f4;_0x2eff4d['status'](_0x505331)[_0xa0fe('0x2a')]({'message':_0xa0fe('0x7a'),'statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index 5138cb0..d8a1363 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 _0xe4f4=['../../config/environment','./intSugarcrmAccount.attributes','exports','define','SugarcrmAccount','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x56d231,_0x1d39ec){var _0x1727f0=function(_0x1ed52e){while(--_0x1ed52e){_0x56d231['push'](_0x56d231['shift']());}};_0x1727f0(++_0x1d39ec);}(_0xe4f4,0x89));var _0x4e4f=function(_0x4dd2d3,_0x264f72){_0x4dd2d3=_0x4dd2d3-0x0;var _0x269be2=_0xe4f4[_0x4dd2d3];return _0x269be2;};'use strict';var _=require('lodash');var util=require(_0x4e4f('0x0'));var logger=require(_0x4e4f('0x1'))('api');var moment=require(_0x4e4f('0x2'));var BPromise=require(_0x4e4f('0x3'));var rp=require(_0x4e4f('0x4'));var fs=require('fs');var path=require(_0x4e4f('0x5'));var rimraf=require(_0x4e4f('0x6'));var config=require(_0x4e4f('0x7'));var attributes=require(_0x4e4f('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x4e4f('0x9')]=function(_0x1de125,_0x50afc4){return _0x1de125[_0x4e4f('0xa')](_0x4e4f('0xb'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d7f=['lodash','util','../../config/logger','moment','request-promise','rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','define','SugarcrmAccount','int_sugarcrm_accounts'];(function(_0x55b5a9,_0x52a732){var _0x4435e7=function(_0x5121ce){while(--_0x5121ce){_0x55b5a9['push'](_0x55b5a9['shift']());}};_0x4435e7(++_0x52a732);}(_0x7d7f,0x1c3));var _0xf7d7=function(_0x2c46bb,_0x5afa06){_0x2c46bb=_0x2c46bb-0x0;var _0x25b76e=_0x7d7f[_0x2c46bb];return _0x25b76e;};'use strict';var _=require(_0xf7d7('0x0'));var util=require(_0xf7d7('0x1'));var logger=require(_0xf7d7('0x2'))('api');var moment=require(_0xf7d7('0x3'));var BPromise=require('bluebird');var rp=require(_0xf7d7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf7d7('0x5'));var config=require('../../config/environment');var attributes=require(_0xf7d7('0x6'));var integrations=require(_0xf7d7('0x7'));module['exports']=function(_0x562184,_0x9a9f91){return _0x562184[_0xf7d7('0x8')](_0xf7d7('0x9'),attributes,{'tableName':_0xf7d7('0xa'),'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 0718675..afb0531 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 _0x75a2=['../../mysqldb','rpc','../../config/environment','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSugarcrmAccount','options','where','limit','include','map','attributes','model','ShowSugarcrmAccount','find','raw','lodash','moment','randomstring','ioredis'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x75a2,0x19c));var _0x275a=function(_0xa6efaa,_0x4c4efc){_0xa6efaa=_0xa6efaa-0x0;var _0x3344e9=_0x75a2[_0xa6efaa];return _0x3344e9;};'use strict';var _=require(_0x275a('0x0'));var util=require('util');var moment=require(_0x275a('0x1'));var BPromise=require('bluebird');var rs=require(_0x275a('0x2'));var fs=require('fs');var Redis=require(_0x275a('0x3'));var db=require(_0x275a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x275a('0x5'));var config=require(_0x275a('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x275a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5c993c,_0x178fc7,_0x9e1559){return new BPromise(function(_0x517dc1,_0x565840){return client[_0x275a('0x8')](_0x5c993c,_0x9e1559)[_0x275a('0x9')](function(_0x103a0b){logger[_0x275a('0xa')](_0x275a('0xb'),_0x178fc7,_0x275a('0xc'));logger[_0x275a('0xd')](_0x275a('0xe'),_0x178fc7,'request\x20sent',JSON[_0x275a('0xf')](_0x103a0b));if(_0x103a0b[_0x275a('0x10')]){if(_0x103a0b[_0x275a('0x10')][_0x275a('0x11')]===0x1f4){logger['error'](_0x275a('0xb'),_0x178fc7,_0x103a0b[_0x275a('0x10')][_0x275a('0x12')]);return _0x565840(_0x103a0b[_0x275a('0x10')][_0x275a('0x12')]);}logger[_0x275a('0x10')](_0x275a('0xb'),_0x178fc7,_0x103a0b['error'][_0x275a('0x12')]);return _0x517dc1(_0x103a0b[_0x275a('0x10')][_0x275a('0x12')]);}else{logger[_0x275a('0xa')](_0x275a('0xb'),_0x178fc7,'request\x20sent');_0x517dc1(_0x103a0b[_0x275a('0x13')][_0x275a('0x12')]);}})[_0x275a('0x14')](function(_0x21b6e9){logger[_0x275a('0x10')](_0x275a('0xb'),_0x178fc7,_0x21b6e9);_0x565840(_0x21b6e9);});});}exports[_0x275a('0x15')]=function(_0x2504f1){var _0x23cacb=this;return new Promise(function(_0xec7d49,_0x392de8){return db['SugarcrmAccount']['findAll']({'raw':_0x2504f1[_0x275a('0x16')]?_0x2504f1[_0x275a('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2504f1['options']?_0x2504f1[_0x275a('0x16')][_0x275a('0x17')]||null:null,'attributes':_0x2504f1['options']?_0x2504f1[_0x275a('0x16')]['attributes']||null:null,'limit':_0x2504f1[_0x275a('0x16')]?_0x2504f1[_0x275a('0x16')][_0x275a('0x18')]||null:null,'include':_0x2504f1[_0x275a('0x16')]?_0x2504f1['options'][_0x275a('0x19')]?_[_0x275a('0x1a')](_0x2504f1[_0x275a('0x16')][_0x275a('0x19')],function(_0x484ad2){return{'model':db[_0x484ad2['model']],'as':_0x484ad2['as'],'attributes':_0x484ad2[_0x275a('0x1b')],'include':_0x484ad2[_0x275a('0x19')]?_['map'](_0x484ad2[_0x275a('0x19')],function(_0x1aa7f9){return{'model':db[_0x1aa7f9[_0x275a('0x1c')]],'as':_0x1aa7f9['as'],'attributes':_0x1aa7f9[_0x275a('0x1b')],'include':_0x1aa7f9[_0x275a('0x19')]?_[_0x275a('0x1a')](_0x1aa7f9[_0x275a('0x19')],function(_0xfa59f5){return{'model':db[_0xfa59f5[_0x275a('0x1c')]],'as':_0xfa59f5['as'],'attributes':_0xfa59f5[_0x275a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x275a('0x9')](function(_0xfea8b8){logger['info']('GetSugarcrmAccount',_0x2504f1);logger[_0x275a('0xd')]('GetSugarcrmAccount',_0x2504f1,JSON[_0x275a('0xf')](_0xfea8b8));_0xec7d49(_0xfea8b8);})[_0x275a('0x14')](function(_0x172f83){logger['error'](_0x275a('0x15'),_0x172f83[_0x275a('0x12')],_0x2504f1);_0x392de8(_0x23cacb[_0x275a('0x10')](0x1f4,_0x172f83[_0x275a('0x12')]));});});};exports[_0x275a('0x1d')]=function(_0x3e2aa5){var _0x27bc37=this;return new Promise(function(_0x3dd362,_0x1625b0){return db['SugarcrmAccount'][_0x275a('0x1e')]({'raw':_0x3e2aa5[_0x275a('0x16')]?_0x3e2aa5[_0x275a('0x16')][_0x275a('0x1f')]===undefined?!![]:![]:!![],'where':_0x3e2aa5[_0x275a('0x16')]?_0x3e2aa5['options'][_0x275a('0x17')]||null:null,'attributes':_0x3e2aa5['options']?_0x3e2aa5[_0x275a('0x16')][_0x275a('0x1b')]||null:null,'include':_0x3e2aa5['options']?_0x3e2aa5[_0x275a('0x16')][_0x275a('0x19')]?_[_0x275a('0x1a')](_0x3e2aa5['options'][_0x275a('0x19')],function(_0x34bec2){return{'model':db[_0x34bec2[_0x275a('0x1c')]],'as':_0x34bec2['as'],'attributes':_0x34bec2[_0x275a('0x1b')],'include':_0x34bec2['include']?_[_0x275a('0x1a')](_0x34bec2[_0x275a('0x19')],function(_0x27ba53){return{'model':db[_0x27ba53[_0x275a('0x1c')]],'as':_0x27ba53['as'],'attributes':_0x27ba53[_0x275a('0x1b')],'include':_0x27ba53[_0x275a('0x19')]?_[_0x275a('0x1a')](_0x27ba53[_0x275a('0x19')],function(_0x487241){return{'model':db[_0x487241[_0x275a('0x1c')]],'as':_0x487241['as'],'attributes':_0x487241[_0x275a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x275a('0x9')](function(_0x46e66d){logger[_0x275a('0xa')]('ShowSugarcrmAccount',_0x3e2aa5);logger[_0x275a('0xd')]('ShowSugarcrmAccount',_0x3e2aa5,JSON[_0x275a('0xf')](_0x46e66d));_0x3dd362(_0x46e66d);})[_0x275a('0x14')](function(_0x2b9736){logger[_0x275a('0x10')](_0x275a('0x1d'),_0x2b9736[_0x275a('0x12')],_0x3e2aa5);_0x1625b0(_0x27bc37[_0x275a('0x10')](0x1f4,_0x2b9736['message']));});});}; \ No newline at end of file +var _0x51f2=['limit','map','include','model','then','stringify','ShowSugarcrmAccount','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','options','where','attributes'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x51f2,0xe7));var _0x251f=function(_0x13fa1f,_0x49695f){_0x13fa1f=_0x13fa1f-0x0;var _0x3ecc48=_0x51f2[_0x13fa1f];return _0x3ecc48;};'use strict';var _=require(_0x251f('0x0'));var util=require(_0x251f('0x1'));var moment=require(_0x251f('0x2'));var BPromise=require(_0x251f('0x3'));var rs=require(_0x251f('0x4'));var fs=require('fs');var Redis=require(_0x251f('0x5'));var db=require(_0x251f('0x6'))['db'];var utils=require(_0x251f('0x7'));var logger=require(_0x251f('0x8'))(_0x251f('0x9'));var config=require('../../config/environment');var jayson=require(_0x251f('0xa'));var client=jayson[_0x251f('0xb')][_0x251f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x118051,_0x2d0f8e,_0x2c66b4){return new BPromise(function(_0xe3fe95,_0x44be9e){return client[_0x251f('0xd')](_0x118051,_0x2c66b4)['then'](function(_0x47659b){logger[_0x251f('0xe')](_0x251f('0xf'),_0x2d0f8e,_0x251f('0x10'));logger[_0x251f('0x11')](_0x251f('0x12'),_0x2d0f8e,'request\x20sent',JSON['stringify'](_0x47659b));if(_0x47659b[_0x251f('0x13')]){if(_0x47659b[_0x251f('0x13')]['code']===0x1f4){logger[_0x251f('0x13')]('SugarcrmAccount,\x20%s,\x20%s',_0x2d0f8e,_0x47659b[_0x251f('0x13')][_0x251f('0x14')]);return _0x44be9e(_0x47659b[_0x251f('0x13')]['message']);}logger[_0x251f('0x13')](_0x251f('0xf'),_0x2d0f8e,_0x47659b[_0x251f('0x13')][_0x251f('0x14')]);return _0xe3fe95(_0x47659b[_0x251f('0x13')][_0x251f('0x14')]);}else{logger['info'](_0x251f('0xf'),_0x2d0f8e,'request\x20sent');_0xe3fe95(_0x47659b[_0x251f('0x15')][_0x251f('0x14')]);}})[_0x251f('0x16')](function(_0x395b3f){logger[_0x251f('0x13')](_0x251f('0xf'),_0x2d0f8e,_0x395b3f);_0x44be9e(_0x395b3f);});});}exports[_0x251f('0x17')]=function(_0x3f8593){var _0xe553d5=this;return new Promise(function(_0x14f69c,_0x5cd1ea){return db[_0x251f('0x18')]['findAll']({'raw':_0x3f8593[_0x251f('0x19')]?_0x3f8593[_0x251f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3f8593[_0x251f('0x19')]?_0x3f8593['options'][_0x251f('0x1a')]||null:null,'attributes':_0x3f8593[_0x251f('0x19')]?_0x3f8593[_0x251f('0x19')][_0x251f('0x1b')]||null:null,'limit':_0x3f8593[_0x251f('0x19')]?_0x3f8593[_0x251f('0x19')][_0x251f('0x1c')]||null:null,'include':_0x3f8593[_0x251f('0x19')]?_0x3f8593[_0x251f('0x19')]['include']?_[_0x251f('0x1d')](_0x3f8593[_0x251f('0x19')][_0x251f('0x1e')],function(_0x1ebcf0){return{'model':db[_0x1ebcf0[_0x251f('0x1f')]],'as':_0x1ebcf0['as'],'attributes':_0x1ebcf0[_0x251f('0x1b')],'include':_0x1ebcf0[_0x251f('0x1e')]?_[_0x251f('0x1d')](_0x1ebcf0['include'],function(_0x5b06ce){return{'model':db[_0x5b06ce[_0x251f('0x1f')]],'as':_0x5b06ce['as'],'attributes':_0x5b06ce[_0x251f('0x1b')],'include':_0x5b06ce[_0x251f('0x1e')]?_[_0x251f('0x1d')](_0x5b06ce[_0x251f('0x1e')],function(_0x39bccf){return{'model':db[_0x39bccf[_0x251f('0x1f')]],'as':_0x39bccf['as'],'attributes':_0x39bccf[_0x251f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x251f('0x20')](function(_0x207661){logger[_0x251f('0xe')](_0x251f('0x17'),_0x3f8593);logger['debug']('GetSugarcrmAccount',_0x3f8593,JSON[_0x251f('0x21')](_0x207661));_0x14f69c(_0x207661);})[_0x251f('0x16')](function(_0x497ce7){logger[_0x251f('0x13')]('GetSugarcrmAccount',_0x497ce7['message'],_0x3f8593);_0x5cd1ea(_0xe553d5[_0x251f('0x13')](0x1f4,_0x497ce7[_0x251f('0x14')]));});});};exports[_0x251f('0x22')]=function(_0x5b0b68){var _0x586f5d=this;return new Promise(function(_0x4d0079,_0x442712){return db[_0x251f('0x18')][_0x251f('0x23')]({'raw':_0x5b0b68[_0x251f('0x19')]?_0x5b0b68['options'][_0x251f('0x24')]===undefined?!![]:![]:!![],'where':_0x5b0b68['options']?_0x5b0b68[_0x251f('0x19')][_0x251f('0x1a')]||null:null,'attributes':_0x5b0b68['options']?_0x5b0b68['options'][_0x251f('0x1b')]||null:null,'include':_0x5b0b68[_0x251f('0x19')]?_0x5b0b68[_0x251f('0x19')][_0x251f('0x1e')]?_[_0x251f('0x1d')](_0x5b0b68[_0x251f('0x19')]['include'],function(_0x35bf48){return{'model':db[_0x35bf48['model']],'as':_0x35bf48['as'],'attributes':_0x35bf48[_0x251f('0x1b')],'include':_0x35bf48[_0x251f('0x1e')]?_[_0x251f('0x1d')](_0x35bf48[_0x251f('0x1e')],function(_0x58bf3b){return{'model':db[_0x58bf3b[_0x251f('0x1f')]],'as':_0x58bf3b['as'],'attributes':_0x58bf3b[_0x251f('0x1b')],'include':_0x58bf3b[_0x251f('0x1e')]?_[_0x251f('0x1d')](_0x58bf3b['include'],function(_0x197f73){return{'model':db[_0x197f73[_0x251f('0x1f')]],'as':_0x197f73['as'],'attributes':_0x197f73[_0x251f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x251f('0x20')](function(_0x3e7675){logger[_0x251f('0xe')](_0x251f('0x22'),_0x5b0b68);logger[_0x251f('0x11')]('ShowSugarcrmAccount',_0x5b0b68,JSON[_0x251f('0x21')](_0x3e7675));_0x4d0079(_0x3e7675);})[_0x251f('0x16')](function(_0x4317d8){logger[_0x251f('0x13')]('ShowSugarcrmAccount',_0x4317d8['message'],_0x5b0b68);_0x442712(_0x586f5d[_0x251f('0x13')](0x1f4,_0x4317d8[_0x251f('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 02e1c25..4f2b34d 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 _0x9b05=['express','Router','fs-extra','../../components/auth/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','delete','destroy','util','path','connect-timeout'];(function(_0x49dea0,_0x253428){var _0x5b2309=function(_0x3665b8){while(--_0x3665b8){_0x49dea0['push'](_0x49dea0['shift']());}};_0x5b2309(++_0x253428);}(_0x9b05,0x1cb));var _0x59b0=function(_0x146beb,_0x57b1f4){_0x146beb=_0x146beb-0x0;var _0x404c81=_0x9b05[_0x146beb];return _0x404c81;};'use strict';var multer=require('multer');var util=require(_0x59b0('0x0'));var path=require(_0x59b0('0x1'));var timeout=require(_0x59b0('0x2'));var express=require(_0x59b0('0x3'));var router=express[_0x59b0('0x4')]();var fs_extra=require(_0x59b0('0x5'));var auth=require(_0x59b0('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x59b0('0x7'));router[_0x59b0('0x8')]('/',auth[_0x59b0('0x9')](),controller[_0x59b0('0xa')]);router['get'](_0x59b0('0xb'),auth[_0x59b0('0x9')](),controller[_0x59b0('0xc')]);router['get'](_0x59b0('0xd'),auth[_0x59b0('0x9')](),controller[_0x59b0('0xe')]);router['get'](_0x59b0('0xf'),auth[_0x59b0('0x9')](),controller[_0x59b0('0x10')]);router[_0x59b0('0x8')]('/:id/descriptions',auth[_0x59b0('0x9')](),controller[_0x59b0('0x11')]);router[_0x59b0('0x12')]('/',auth[_0x59b0('0x9')](),controller[_0x59b0('0x13')]);router['put']('/:id',auth[_0x59b0('0x9')](),controller['update']);router[_0x59b0('0x14')]('/:id',auth[_0x59b0('0x9')](),controller[_0x59b0('0x15')]);module['exports']=router; \ No newline at end of file +var _0x2139=['show','/:id/fields','isAuthenticated','getFields','getSubjects','/:id/descriptions','post','put','exports','multer','util','path','connect-timeout','../../config/environment','./intSugarcrmConfiguration.controller','get','/:id'];(function(_0x62371,_0x5abc21){var _0x1d6dcc=function(_0x5f2b36){while(--_0x5f2b36){_0x62371['push'](_0x62371['shift']());}};_0x1d6dcc(++_0x5abc21);}(_0x2139,0xd5));var _0x9213=function(_0x4f3561,_0x4ec3a8){_0x4f3561=_0x4f3561-0x0;var _0x51fe42=_0x2139[_0x4f3561];return _0x51fe42;};'use strict';var multer=require(_0x9213('0x0'));var util=require(_0x9213('0x1'));var path=require(_0x9213('0x2'));var timeout=require(_0x9213('0x3'));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(_0x9213('0x4'));var controller=require(_0x9213('0x5'));router[_0x9213('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9213('0x6')](_0x9213('0x7'),auth['isAuthenticated'](),controller[_0x9213('0x8')]);router[_0x9213('0x6')](_0x9213('0x9'),auth[_0x9213('0xa')](),controller[_0x9213('0xb')]);router[_0x9213('0x6')]('/:id/subjects',auth[_0x9213('0xa')](),controller[_0x9213('0xc')]);router[_0x9213('0x6')](_0x9213('0xd'),auth[_0x9213('0xa')](),controller['getDescriptions']);router[_0x9213('0xe')]('/',auth[_0x9213('0xa')](),controller['create']);router[_0x9213('0xf')](_0x9213('0x7'),auth[_0x9213('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x9213('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index ca55a45..4aac5c8 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 _0x928c=['exports','STRING'];(function(_0x13e2d4,_0x1593a3){var _0x48146c=function(_0x5eae48){while(--_0x5eae48){_0x13e2d4['push'](_0x13e2d4['shift']());}};_0x48146c(++_0x1593a3);}(_0x928c,0xca));var _0xc928=function(_0x3a1d19,_0x24bfc3){_0x3a1d19=_0x3a1d19-0x0;var _0x3486ff=_0x928c[_0x3a1d19];return _0x3486ff;};'use strict';var Sequelize=require('sequelize');module[_0xc928('0x0')]={'name':{'type':Sequelize[_0xc928('0x1')]},'description':{'type':Sequelize[_0xc928('0x1')]}}; \ No newline at end of file +var _0x0bb5=['STRING','sequelize','exports'];(function(_0x1bbef4,_0x173c3e){var _0x2f2fd4=function(_0x5db998){while(--_0x5db998){_0x1bbef4['push'](_0x1bbef4['shift']());}};_0x2f2fd4(++_0x173c3e);}(_0x0bb5,0x7f));var _0x50bb=function(_0xff1be8,_0x44ab6e){_0xff1be8=_0xff1be8-0x0;var _0x3c0750=_0x0bb5[_0xff1be8];return _0x3c0750;};'use strict';var Sequelize=require(_0x50bb('0x0'));module[_0x50bb('0x1')]={'name':{'type':Sequelize[_0x50bb('0x2')]},'description':{'type':Sequelize[_0x50bb('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 4a732a0..652357f 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 _0x25d6=['update','then','error','name','send','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','SugarcrmConfiguration','rows','catch','params','keys','length','include','find','create','body','destroy','hasOwnProperty','nolimit','getFields','getSubjects','findOne','SugarcrmField','getDescriptions','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save'];(function(_0x26a9c9,_0x56139b){var _0x2f0727=function(_0x1d95f3){while(--_0x1d95f3){_0x26a9c9['push'](_0x26a9c9['shift']());}};_0x2f0727(++_0x56139b);}(_0x25d6,0x1ba));var _0x625d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x25d6[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x625d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x625d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x625d('0x2'));var moment=require(_0x625d('0x3'));var BPromise=require(_0x625d('0x4'));var Mustache=require(_0x625d('0x5'));var util=require(_0x625d('0x6'));var path=require(_0x625d('0x7'));var sox=require(_0x625d('0x8'));var csv=require(_0x625d('0x9'));var ejs=require(_0x625d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x625d('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x625d('0xc'));var deskjs=require(_0x625d('0xd'));var toCsv=require(_0x625d('0x9'));var querystring=require(_0x625d('0xe'));var Papa=require(_0x625d('0xf'));var Redis=require(_0x625d('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x625d('0x11'));var hardwareService=require(_0x625d('0x12'));var logger=require(_0x625d('0x13'))(_0x625d('0x14'));var utils=require(_0x625d('0x15'));var config=require(_0x625d('0x16'));var licenseUtil=require(_0x625d('0x17'));var db=require(_0x625d('0x18'))['db'];function respondWithStatusCode(_0x5a9a58,_0x5699f0){_0x5699f0=_0x5699f0||0xcc;return function(_0x364510){if(_0x364510){return _0x5a9a58[_0x625d('0x19')](_0x5699f0);}return _0x5a9a58[_0x625d('0x1a')](_0x5699f0)[_0x625d('0x1b')]();};}function respondWithResult(_0xb1b8ff,_0x1009b1){_0x1009b1=_0x1009b1||0xc8;return function(_0x296001){if(_0x296001){return _0xb1b8ff[_0x625d('0x1a')](_0x1009b1)['json'](_0x296001);}};}function respondWithFilteredResult(_0xeae2bf,_0x353608){return function(_0x4db3a3){if(_0x4db3a3){var _0xecaf01=typeof _0x353608['offset']===_0x625d('0x1c')&&typeof _0x353608[_0x625d('0x1d')]===_0x625d('0x1c');var _0x3dd1ce=_0x4db3a3['count'];var _0x1324a5=_0xecaf01?0x0:_0x353608[_0x625d('0x1e')];var _0x588ad1=_0xecaf01?_0x4db3a3[_0x625d('0x1f')]:_0x353608[_0x625d('0x1e')]+_0x353608['limit'];var _0xd8476d;if(_0x588ad1>=_0x3dd1ce){_0x588ad1=_0x3dd1ce;_0xd8476d=0xc8;}else{_0xd8476d=0xce;}_0xeae2bf[_0x625d('0x1a')](_0xd8476d);return _0xeae2bf[_0x625d('0x20')](_0x625d('0x21'),_0x1324a5+'-'+_0x588ad1+'/'+_0x3dd1ce)[_0x625d('0x22')](_0x4db3a3);}return null;};}function patchUpdates(_0x485639){return function(_0x2b8936){try{jsonpatch[_0x625d('0x23')](_0x2b8936,_0x485639,!![]);}catch(_0x2dc5cb){return BPromise[_0x625d('0x24')](_0x2dc5cb);}return _0x2b8936[_0x625d('0x25')]();};}function saveUpdates(_0x5a0711,_0x3bf777){return function(_0x5032ae){if(_0x5032ae){return _0x5032ae[_0x625d('0x26')](_0x5a0711)[_0x625d('0x27')](function(_0x4b819c){return _0x4b819c;});}return null;};}function removeEntity(_0x2e9c18,_0x5f30d2){return function(_0xde5660){if(_0xde5660){return _0xde5660['destroy']()[_0x625d('0x27')](function(){_0x2e9c18[_0x625d('0x1a')](0xcc)[_0x625d('0x1b')]();});}};}function handleEntityNotFound(_0x308e7b,_0x4001a5){return function(_0x8f7c4d){if(!_0x8f7c4d){_0x308e7b[_0x625d('0x19')](0x194);}return _0x8f7c4d;};}function handleError(_0x11700b,_0x5e5b16){_0x5e5b16=_0x5e5b16||0x1f4;return function(_0x30b640){logger[_0x625d('0x28')](_0x30b640['stack']);if(_0x30b640[_0x625d('0x29')]){delete _0x30b640['name'];}_0x11700b[_0x625d('0x1a')](_0x5e5b16)[_0x625d('0x2a')](_0x30b640);};}exports['index']=function(_0x4bc0f4,_0x16ef5d){var _0x7e392e={},_0x2c3cbc={},_0x593421={'count':0x0,'rows':[]};var _0x1482eb=_[_0x625d('0x2b')](db['SugarcrmConfiguration'][_0x625d('0x2c')],function(_0x563867){return{'name':_0x563867[_0x625d('0x2d')],'type':_0x563867['type'][_0x625d('0x2e')]};});_0x2c3cbc[_0x625d('0x2f')]=_[_0x625d('0x2b')](_0x1482eb,_0x625d('0x29'));_0x2c3cbc[_0x625d('0x30')]=_['keys'](_0x4bc0f4[_0x625d('0x30')]);_0x2c3cbc[_0x625d('0x31')]=_[_0x625d('0x32')](_0x2c3cbc[_0x625d('0x2f')],_0x2c3cbc[_0x625d('0x30')]);_0x7e392e['attributes']=_['intersection'](_0x2c3cbc[_0x625d('0x2f')],qs[_0x625d('0x33')](_0x4bc0f4[_0x625d('0x30')][_0x625d('0x33')]));_0x7e392e[_0x625d('0x34')]=_0x7e392e['attributes']['length']?_0x7e392e[_0x625d('0x34')]:_0x2c3cbc['model'];if(!_0x4bc0f4[_0x625d('0x30')]['hasOwnProperty']('nolimit')){_0x7e392e[_0x625d('0x1d')]=qs[_0x625d('0x1d')](_0x4bc0f4[_0x625d('0x30')][_0x625d('0x1d')]);_0x7e392e[_0x625d('0x1e')]=qs[_0x625d('0x1e')](_0x4bc0f4[_0x625d('0x30')][_0x625d('0x1e')]);}_0x7e392e[_0x625d('0x35')]=qs[_0x625d('0x36')](_0x4bc0f4[_0x625d('0x30')][_0x625d('0x36')]);_0x7e392e[_0x625d('0x37')]=qs[_0x625d('0x31')](_[_0x625d('0x38')](_0x4bc0f4['query'],_0x2c3cbc[_0x625d('0x31')]),_0x1482eb);if(_0x4bc0f4['query'][_0x625d('0x39')]){_0x7e392e[_0x625d('0x37')]=_[_0x625d('0x3a')](_0x7e392e[_0x625d('0x37')],{'$or':_[_0x625d('0x2b')](_0x1482eb,function(_0x53d88c){if(_0x53d88c['type']!==_0x625d('0x3b')){var _0x14fc42={};_0x14fc42[_0x53d88c[_0x625d('0x29')]]={'$like':'%'+_0x4bc0f4[_0x625d('0x30')][_0x625d('0x39')]+'%'};return _0x14fc42;}})});}_0x7e392e=_[_0x625d('0x3a')]({},_0x7e392e,_0x4bc0f4[_0x625d('0x3c')]);var _0x44deb7={'where':_0x7e392e[_0x625d('0x37')]};return db['SugarcrmConfiguration']['count'](_0x44deb7)[_0x625d('0x27')](function(_0x50abea){_0x593421[_0x625d('0x1f')]=_0x50abea;if(_0x4bc0f4[_0x625d('0x30')][_0x625d('0x3d')]){_0x7e392e['include']=[{'all':!![]}];}return db[_0x625d('0x3e')]['findAll'](_0x7e392e);})['then'](function(_0x463031){_0x593421[_0x625d('0x3f')]=_0x463031;return _0x593421;})['then'](respondWithFilteredResult(_0x16ef5d,_0x7e392e))[_0x625d('0x40')](handleError(_0x16ef5d,null));};exports['show']=function(_0x3b1f6e,_0x18c54a){var _0x2f317f={'raw':![],'where':{'id':_0x3b1f6e[_0x625d('0x41')]['id']}},_0x4176cb={};_0x4176cb[_0x625d('0x2f')]=_[_0x625d('0x42')](db[_0x625d('0x3e')][_0x625d('0x2c')]);_0x4176cb['query']=_[_0x625d('0x42')](_0x3b1f6e['query']);_0x4176cb[_0x625d('0x31')]=_[_0x625d('0x32')](_0x4176cb[_0x625d('0x2f')],_0x4176cb['query']);_0x2f317f[_0x625d('0x34')]=_[_0x625d('0x32')](_0x4176cb['model'],qs[_0x625d('0x33')](_0x3b1f6e[_0x625d('0x30')]['fields']));_0x2f317f[_0x625d('0x34')]=_0x2f317f[_0x625d('0x34')][_0x625d('0x43')]?_0x2f317f['attributes']:_0x4176cb[_0x625d('0x2f')];if(_0x3b1f6e[_0x625d('0x30')]['includeAll']){_0x2f317f[_0x625d('0x44')]=[{'all':!![]}];}_0x2f317f=_[_0x625d('0x3a')]({},_0x2f317f,_0x3b1f6e[_0x625d('0x3c')]);return db[_0x625d('0x3e')][_0x625d('0x45')](_0x2f317f)['then'](handleEntityNotFound(_0x18c54a,null))[_0x625d('0x27')](respondWithResult(_0x18c54a,null))[_0x625d('0x40')](handleError(_0x18c54a,null));};exports[_0x625d('0x46')]=function(_0x3f1022,_0x5d337e){return db[_0x625d('0x3e')]['create'](_0x3f1022['body'],{})[_0x625d('0x27')](respondWithResult(_0x5d337e,0xc9))[_0x625d('0x40')](handleError(_0x5d337e,null));};exports[_0x625d('0x26')]=function(_0x51ef68,_0x949b1){if(_0x51ef68['body']['id']){delete _0x51ef68['body']['id'];}return db[_0x625d('0x3e')][_0x625d('0x45')]({'where':{'id':_0x51ef68[_0x625d('0x41')]['id']}})['then'](handleEntityNotFound(_0x949b1,null))['then'](saveUpdates(_0x51ef68[_0x625d('0x47')],null))['then'](respondWithResult(_0x949b1,null))[_0x625d('0x40')](handleError(_0x949b1,null));};exports[_0x625d('0x48')]=function(_0x22e350,_0x1a057b){return db[_0x625d('0x3e')][_0x625d('0x45')]({'where':{'id':_0x22e350[_0x625d('0x41')]['id']}})[_0x625d('0x27')](handleEntityNotFound(_0x1a057b,null))['then'](removeEntity(_0x1a057b,null))[_0x625d('0x40')](handleError(_0x1a057b,null));};exports['getFields']=function(_0x3049f1,_0x193d69,_0x1c34e8){var _0x295c8e={};var _0x339d14={};var _0x4e5326;var _0x531204;return db[_0x625d('0x3e')]['findOne']({'where':{'id':_0x3049f1[_0x625d('0x41')]['id']}})[_0x625d('0x27')](handleEntityNotFound(_0x193d69,null))[_0x625d('0x27')](function(_0x9cee3e){if(_0x9cee3e){_0x4e5326=_0x9cee3e;_0x339d14['model']=_['keys'](db['SugarcrmField'][_0x625d('0x2c')]);_0x339d14[_0x625d('0x30')]=_[_0x625d('0x42')](_0x3049f1['query']);_0x339d14[_0x625d('0x31')]=_[_0x625d('0x32')](_0x339d14[_0x625d('0x2f')],_0x339d14['query']);_0x295c8e[_0x625d('0x34')]=_[_0x625d('0x32')](_0x339d14[_0x625d('0x2f')],qs[_0x625d('0x33')](_0x3049f1[_0x625d('0x30')]['fields']));_0x295c8e[_0x625d('0x34')]=_0x295c8e['attributes'][_0x625d('0x43')]?_0x295c8e[_0x625d('0x34')]:_0x339d14[_0x625d('0x2f')];_0x295c8e[_0x625d('0x35')]=qs[_0x625d('0x36')](_0x3049f1[_0x625d('0x30')][_0x625d('0x36')]);_0x295c8e[_0x625d('0x37')]=qs[_0x625d('0x31')](_[_0x625d('0x38')](_0x3049f1[_0x625d('0x30')],_0x339d14['filters']));if(_0x3049f1[_0x625d('0x30')][_0x625d('0x39')]){_0x295c8e[_0x625d('0x37')]=_[_0x625d('0x3a')](_0x295c8e['where'],{'$or':_['map'](_0x295c8e[_0x625d('0x34')],function(_0x3a6895){var _0x28d4f9={};_0x28d4f9[_0x3a6895]={'$like':'%'+_0x3049f1[_0x625d('0x30')]['filter']+'%'};return _0x28d4f9;})});}_0x295c8e=_[_0x625d('0x3a')]({},_0x295c8e,_0x3049f1[_0x625d('0x3c')]);return _0x4e5326['getFields'](_0x295c8e);}})['then'](function(_0x383a82){if(_0x383a82){_0x531204=_0x383a82[_0x625d('0x43')];if(!_0x3049f1[_0x625d('0x30')][_0x625d('0x49')](_0x625d('0x4a'))){_0x295c8e['limit']=qs[_0x625d('0x1d')](_0x3049f1[_0x625d('0x30')][_0x625d('0x1d')]);_0x295c8e[_0x625d('0x1e')]=qs['offset'](_0x3049f1[_0x625d('0x30')][_0x625d('0x1e')]);}return _0x4e5326[_0x625d('0x4b')](_0x295c8e);}})[_0x625d('0x27')](function(_0x2f449d){if(_0x2f449d){return _0x2f449d?{'count':_0x531204,'rows':_0x2f449d}:null;}})[_0x625d('0x27')](respondWithResult(_0x193d69,null))[_0x625d('0x40')](handleError(_0x193d69,null));};exports[_0x625d('0x4c')]=function(_0x4fa432,_0x1b96bf,_0x581b82){var _0x56b0f0={};var _0x54e9d7={};var _0xea2d74;var _0x470fc0;return db[_0x625d('0x3e')][_0x625d('0x4d')]({'where':{'id':_0x4fa432[_0x625d('0x41')]['id']}})[_0x625d('0x27')](handleEntityNotFound(_0x1b96bf,null))[_0x625d('0x27')](function(_0x1f1d4b){if(_0x1f1d4b){_0xea2d74=_0x1f1d4b;_0x54e9d7[_0x625d('0x2f')]=_[_0x625d('0x42')](db[_0x625d('0x4e')]['rawAttributes']);_0x54e9d7['query']=_[_0x625d('0x42')](_0x4fa432[_0x625d('0x30')]);_0x54e9d7[_0x625d('0x31')]=_[_0x625d('0x32')](_0x54e9d7[_0x625d('0x2f')],_0x54e9d7[_0x625d('0x30')]);_0x56b0f0['attributes']=_[_0x625d('0x32')](_0x54e9d7[_0x625d('0x2f')],qs['fields'](_0x4fa432['query']['fields']));_0x56b0f0[_0x625d('0x34')]=_0x56b0f0['attributes'][_0x625d('0x43')]?_0x56b0f0['attributes']:_0x54e9d7[_0x625d('0x2f')];_0x56b0f0[_0x625d('0x35')]=qs[_0x625d('0x36')](_0x4fa432[_0x625d('0x30')][_0x625d('0x36')]);_0x56b0f0[_0x625d('0x37')]=qs['filters'](_['pick'](_0x4fa432[_0x625d('0x30')],_0x54e9d7[_0x625d('0x31')]));if(_0x4fa432[_0x625d('0x30')]['filter']){_0x56b0f0[_0x625d('0x37')]=_[_0x625d('0x3a')](_0x56b0f0[_0x625d('0x37')],{'$or':_[_0x625d('0x2b')](_0x56b0f0[_0x625d('0x34')],function(_0x397bbc){var _0x525b73={};_0x525b73[_0x397bbc]={'$like':'%'+_0x4fa432[_0x625d('0x30')]['filter']+'%'};return _0x525b73;})});}_0x56b0f0=_[_0x625d('0x3a')]({},_0x56b0f0,_0x4fa432[_0x625d('0x3c')]);return _0xea2d74[_0x625d('0x4c')](_0x56b0f0);}})[_0x625d('0x27')](function(_0x1ba390){if(_0x1ba390){_0x470fc0=_0x1ba390['length'];if(!_0x4fa432[_0x625d('0x30')]['hasOwnProperty'](_0x625d('0x4a'))){_0x56b0f0[_0x625d('0x1d')]=qs[_0x625d('0x1d')](_0x4fa432[_0x625d('0x30')][_0x625d('0x1d')]);_0x56b0f0['offset']=qs[_0x625d('0x1e')](_0x4fa432['query'][_0x625d('0x1e')]);}return _0xea2d74['getSubjects'](_0x56b0f0);}})[_0x625d('0x27')](function(_0x52b6bc){if(_0x52b6bc){return _0x52b6bc?{'count':_0x470fc0,'rows':_0x52b6bc}:null;}})[_0x625d('0x27')](respondWithResult(_0x1b96bf,null))['catch'](handleError(_0x1b96bf,null));};exports[_0x625d('0x4f')]=function(_0x2d3f3d,_0x125daf,_0x56d545){var _0x47638c={};var _0x44c0d2={};var _0xbc0a1a;var _0xf6ed57;return db[_0x625d('0x3e')]['findOne']({'where':{'id':_0x2d3f3d[_0x625d('0x41')]['id']}})['then'](handleEntityNotFound(_0x125daf,null))[_0x625d('0x27')](function(_0x2488aa){if(_0x2488aa){_0xbc0a1a=_0x2488aa;_0x44c0d2['model']=_['keys'](db[_0x625d('0x4e')][_0x625d('0x2c')]);_0x44c0d2[_0x625d('0x30')]=_[_0x625d('0x42')](_0x2d3f3d['query']);_0x44c0d2[_0x625d('0x31')]=_[_0x625d('0x32')](_0x44c0d2[_0x625d('0x2f')],_0x44c0d2[_0x625d('0x30')]);_0x47638c[_0x625d('0x34')]=_[_0x625d('0x32')](_0x44c0d2[_0x625d('0x2f')],qs[_0x625d('0x33')](_0x2d3f3d[_0x625d('0x30')][_0x625d('0x33')]));_0x47638c[_0x625d('0x34')]=_0x47638c[_0x625d('0x34')]['length']?_0x47638c[_0x625d('0x34')]:_0x44c0d2[_0x625d('0x2f')];_0x47638c[_0x625d('0x35')]=qs[_0x625d('0x36')](_0x2d3f3d[_0x625d('0x30')][_0x625d('0x36')]);_0x47638c['where']=qs[_0x625d('0x31')](_[_0x625d('0x38')](_0x2d3f3d[_0x625d('0x30')],_0x44c0d2[_0x625d('0x31')]));if(_0x2d3f3d['query'][_0x625d('0x39')]){_0x47638c[_0x625d('0x37')]=_[_0x625d('0x3a')](_0x47638c['where'],{'$or':_[_0x625d('0x2b')](_0x47638c[_0x625d('0x34')],function(_0x1d6831){var _0x24094d={};_0x24094d[_0x1d6831]={'$like':'%'+_0x2d3f3d[_0x625d('0x30')][_0x625d('0x39')]+'%'};return _0x24094d;})});}_0x47638c=_[_0x625d('0x3a')]({},_0x47638c,_0x2d3f3d['options']);return _0xbc0a1a[_0x625d('0x4f')](_0x47638c);}})[_0x625d('0x27')](function(_0x467706){if(_0x467706){_0xf6ed57=_0x467706['length'];if(!_0x2d3f3d[_0x625d('0x30')][_0x625d('0x49')](_0x625d('0x4a'))){_0x47638c[_0x625d('0x1d')]=qs['limit'](_0x2d3f3d[_0x625d('0x30')][_0x625d('0x1d')]);_0x47638c[_0x625d('0x1e')]=qs[_0x625d('0x1e')](_0x2d3f3d[_0x625d('0x30')][_0x625d('0x1e')]);}return _0xbc0a1a[_0x625d('0x4f')](_0x47638c);}})[_0x625d('0x27')](function(_0xf8c043){if(_0xf8c043){return _0xf8c043?{'count':_0xf6ed57,'rows':_0xf8c043}:null;}})[_0x625d('0x27')](respondWithResult(_0x125daf,null))[_0x625d('0x40')](handleError(_0x125daf,null));}; \ No newline at end of file +var _0x1ca2=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','SugarcrmConfiguration','findAll','rows','catch','params','includeAll','include','find','create','body','destroy','getFields','SugarcrmField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','moment','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection'];(function(_0x55dc17,_0x1eccc2){var _0x5c8fa9=function(_0x5a5b90){while(--_0x5a5b90){_0x55dc17['push'](_0x55dc17['shift']());}};_0x5c8fa9(++_0x1eccc2);}(_0x1ca2,0x1e9));var _0x21ca=function(_0x3d20d1,_0x5bdb8a){_0x3d20d1=_0x3d20d1-0x0;var _0x4d28a0=_0x1ca2[_0x3d20d1];return _0x4d28a0;};'use strict';var emlformat=require(_0x21ca('0x0'));var rimraf=require(_0x21ca('0x1'));var zipdir=require(_0x21ca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x21ca('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x21ca('0x4'));var util=require(_0x21ca('0x5'));var path=require(_0x21ca('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x21ca('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x21ca('0x8'));var squel=require(_0x21ca('0x9'));var crypto=require(_0x21ca('0xa'));var jsforce=require(_0x21ca('0xb'));var deskjs=require(_0x21ca('0xc'));var toCsv=require(_0x21ca('0xd'));var querystring=require(_0x21ca('0xe'));var Papa=require(_0x21ca('0xf'));var Redis=require(_0x21ca('0x10'));var authService=require(_0x21ca('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x21ca('0x12'));var hardwareService=require(_0x21ca('0x13'));var logger=require('../../config/logger')(_0x21ca('0x14'));var utils=require(_0x21ca('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x21ca('0x16'));var db=require(_0x21ca('0x17'))['db'];function respondWithStatusCode(_0x18389e,_0x10d519){_0x10d519=_0x10d519||0xcc;return function(_0x119028){if(_0x119028){return _0x18389e[_0x21ca('0x18')](_0x10d519);}return _0x18389e['status'](_0x10d519)[_0x21ca('0x19')]();};}function respondWithResult(_0x1d69d6,_0x109ef4){_0x109ef4=_0x109ef4||0xc8;return function(_0x50f0ef){if(_0x50f0ef){return _0x1d69d6[_0x21ca('0x1a')](_0x109ef4)[_0x21ca('0x1b')](_0x50f0ef);}};}function respondWithFilteredResult(_0x2d7e1c,_0x25490b){return function(_0x4a6ae2){if(_0x4a6ae2){var _0x21ad66=typeof _0x25490b[_0x21ca('0x1c')]===_0x21ca('0x1d')&&typeof _0x25490b[_0x21ca('0x1e')]===_0x21ca('0x1d');var _0x147dd4=_0x4a6ae2['count'];var _0x42b20b=_0x21ad66?0x0:_0x25490b[_0x21ca('0x1c')];var _0x3c4cc2=_0x21ad66?_0x4a6ae2[_0x21ca('0x1f')]:_0x25490b[_0x21ca('0x1c')]+_0x25490b[_0x21ca('0x1e')];var _0x19d6a1;if(_0x3c4cc2>=_0x147dd4){_0x3c4cc2=_0x147dd4;_0x19d6a1=0xc8;}else{_0x19d6a1=0xce;}_0x2d7e1c[_0x21ca('0x1a')](_0x19d6a1);return _0x2d7e1c[_0x21ca('0x20')](_0x21ca('0x21'),_0x42b20b+'-'+_0x3c4cc2+'/'+_0x147dd4)[_0x21ca('0x1b')](_0x4a6ae2);}return null;};}function patchUpdates(_0x54fc92){return function(_0x3771a8){try{jsonpatch[_0x21ca('0x22')](_0x3771a8,_0x54fc92,!![]);}catch(_0xff2ead){return BPromise[_0x21ca('0x23')](_0xff2ead);}return _0x3771a8[_0x21ca('0x24')]();};}function saveUpdates(_0x39c2cc,_0x23d92e){return function(_0x23375f){if(_0x23375f){return _0x23375f[_0x21ca('0x25')](_0x39c2cc)[_0x21ca('0x26')](function(_0x5136e6){return _0x5136e6;});}return null;};}function removeEntity(_0x3654a2,_0x54dc69){return function(_0x602be6){if(_0x602be6){return _0x602be6['destroy']()['then'](function(){_0x3654a2['status'](0xcc)[_0x21ca('0x19')]();});}};}function handleEntityNotFound(_0x1223c7,_0xd26aca){return function(_0x4378e0){if(!_0x4378e0){_0x1223c7[_0x21ca('0x18')](0x194);}return _0x4378e0;};}function handleError(_0x571c13,_0x31fae4){_0x31fae4=_0x31fae4||0x1f4;return function(_0x36cde6){logger['error'](_0x36cde6['stack']);if(_0x36cde6[_0x21ca('0x27')]){delete _0x36cde6[_0x21ca('0x27')];}_0x571c13['status'](_0x31fae4)[_0x21ca('0x28')](_0x36cde6);};}exports[_0x21ca('0x29')]=function(_0x2e747b,_0x36ba8b){var _0x3f3fd1={},_0x404ee2={},_0x585492={'count':0x0,'rows':[]};var _0x123251=_[_0x21ca('0x2a')](db['SugarcrmConfiguration'][_0x21ca('0x2b')],function(_0x40ec16){return{'name':_0x40ec16['fieldName'],'type':_0x40ec16[_0x21ca('0x2c')]['key']};});_0x404ee2[_0x21ca('0x2d')]=_[_0x21ca('0x2a')](_0x123251,'name');_0x404ee2[_0x21ca('0x2e')]=_[_0x21ca('0x2f')](_0x2e747b[_0x21ca('0x2e')]);_0x404ee2[_0x21ca('0x30')]=_[_0x21ca('0x31')](_0x404ee2[_0x21ca('0x2d')],_0x404ee2[_0x21ca('0x2e')]);_0x3f3fd1[_0x21ca('0x32')]=_['intersection'](_0x404ee2[_0x21ca('0x2d')],qs[_0x21ca('0x33')](_0x2e747b[_0x21ca('0x2e')]['fields']));_0x3f3fd1[_0x21ca('0x32')]=_0x3f3fd1['attributes'][_0x21ca('0x34')]?_0x3f3fd1[_0x21ca('0x32')]:_0x404ee2[_0x21ca('0x2d')];if(!_0x2e747b[_0x21ca('0x2e')][_0x21ca('0x35')](_0x21ca('0x36'))){_0x3f3fd1[_0x21ca('0x1e')]=qs['limit'](_0x2e747b[_0x21ca('0x2e')][_0x21ca('0x1e')]);_0x3f3fd1['offset']=qs[_0x21ca('0x1c')](_0x2e747b[_0x21ca('0x2e')][_0x21ca('0x1c')]);}_0x3f3fd1[_0x21ca('0x37')]=qs['sort'](_0x2e747b[_0x21ca('0x2e')][_0x21ca('0x38')]);_0x3f3fd1[_0x21ca('0x39')]=qs[_0x21ca('0x30')](_[_0x21ca('0x3a')](_0x2e747b[_0x21ca('0x2e')],_0x404ee2[_0x21ca('0x30')]),_0x123251);if(_0x2e747b[_0x21ca('0x2e')][_0x21ca('0x3b')]){_0x3f3fd1[_0x21ca('0x39')]=_[_0x21ca('0x3c')](_0x3f3fd1[_0x21ca('0x39')],{'$or':_[_0x21ca('0x2a')](_0x123251,function(_0x2ca681){if(_0x2ca681[_0x21ca('0x2c')]!=='VIRTUAL'){var _0xf8b5e2={};_0xf8b5e2[_0x2ca681[_0x21ca('0x27')]]={'$like':'%'+_0x2e747b[_0x21ca('0x2e')][_0x21ca('0x3b')]+'%'};return _0xf8b5e2;}})});}_0x3f3fd1=_['merge']({},_0x3f3fd1,_0x2e747b[_0x21ca('0x3d')]);var _0x4811f5={'where':_0x3f3fd1['where']};return db[_0x21ca('0x3e')][_0x21ca('0x1f')](_0x4811f5)['then'](function(_0x53148f){_0x585492['count']=_0x53148f;if(_0x2e747b['query']['includeAll']){_0x3f3fd1['include']=[{'all':!![]}];}return db[_0x21ca('0x3e')][_0x21ca('0x3f')](_0x3f3fd1);})[_0x21ca('0x26')](function(_0x33cb1f){_0x585492[_0x21ca('0x40')]=_0x33cb1f;return _0x585492;})[_0x21ca('0x26')](respondWithFilteredResult(_0x36ba8b,_0x3f3fd1))[_0x21ca('0x41')](handleError(_0x36ba8b,null));};exports['show']=function(_0x2663e6,_0x1839fc){var _0x339723={'raw':![],'where':{'id':_0x2663e6[_0x21ca('0x42')]['id']}},_0x55a2b3={};_0x55a2b3['model']=_[_0x21ca('0x2f')](db[_0x21ca('0x3e')][_0x21ca('0x2b')]);_0x55a2b3['query']=_[_0x21ca('0x2f')](_0x2663e6[_0x21ca('0x2e')]);_0x55a2b3['filters']=_[_0x21ca('0x31')](_0x55a2b3[_0x21ca('0x2d')],_0x55a2b3[_0x21ca('0x2e')]);_0x339723[_0x21ca('0x32')]=_[_0x21ca('0x31')](_0x55a2b3[_0x21ca('0x2d')],qs[_0x21ca('0x33')](_0x2663e6[_0x21ca('0x2e')][_0x21ca('0x33')]));_0x339723[_0x21ca('0x32')]=_0x339723[_0x21ca('0x32')][_0x21ca('0x34')]?_0x339723[_0x21ca('0x32')]:_0x55a2b3[_0x21ca('0x2d')];if(_0x2663e6[_0x21ca('0x2e')][_0x21ca('0x43')]){_0x339723[_0x21ca('0x44')]=[{'all':!![]}];}_0x339723=_[_0x21ca('0x3c')]({},_0x339723,_0x2663e6[_0x21ca('0x3d')]);return db[_0x21ca('0x3e')][_0x21ca('0x45')](_0x339723)[_0x21ca('0x26')](handleEntityNotFound(_0x1839fc,null))[_0x21ca('0x26')](respondWithResult(_0x1839fc,null))[_0x21ca('0x41')](handleError(_0x1839fc,null));};exports[_0x21ca('0x46')]=function(_0x55e637,_0x3e9272){return db['SugarcrmConfiguration']['create'](_0x55e637[_0x21ca('0x47')],{})[_0x21ca('0x26')](respondWithResult(_0x3e9272,0xc9))[_0x21ca('0x41')](handleError(_0x3e9272,null));};exports[_0x21ca('0x25')]=function(_0x1a48cb,_0x4d91b7){if(_0x1a48cb[_0x21ca('0x47')]['id']){delete _0x1a48cb[_0x21ca('0x47')]['id'];}return db['SugarcrmConfiguration'][_0x21ca('0x45')]({'where':{'id':_0x1a48cb[_0x21ca('0x42')]['id']}})[_0x21ca('0x26')](handleEntityNotFound(_0x4d91b7,null))[_0x21ca('0x26')](saveUpdates(_0x1a48cb[_0x21ca('0x47')],null))[_0x21ca('0x26')](respondWithResult(_0x4d91b7,null))['catch'](handleError(_0x4d91b7,null));};exports[_0x21ca('0x48')]=function(_0x2e3bb5,_0xe1d71f){return db[_0x21ca('0x3e')][_0x21ca('0x45')]({'where':{'id':_0x2e3bb5[_0x21ca('0x42')]['id']}})['then'](handleEntityNotFound(_0xe1d71f,null))[_0x21ca('0x26')](removeEntity(_0xe1d71f,null))['catch'](handleError(_0xe1d71f,null));};exports['getFields']=function(_0x347c8e,_0x9e47e2,_0x5debc3){var _0x466ac7={};var _0x36c925={};var _0x5a0d48;var _0xdd6ba1;return db[_0x21ca('0x3e')]['findOne']({'where':{'id':_0x347c8e[_0x21ca('0x42')]['id']}})[_0x21ca('0x26')](handleEntityNotFound(_0x9e47e2,null))[_0x21ca('0x26')](function(_0x23c83b){if(_0x23c83b){_0x5a0d48=_0x23c83b;_0x36c925[_0x21ca('0x2d')]=_[_0x21ca('0x2f')](db['SugarcrmField'][_0x21ca('0x2b')]);_0x36c925[_0x21ca('0x2e')]=_[_0x21ca('0x2f')](_0x347c8e[_0x21ca('0x2e')]);_0x36c925['filters']=_['intersection'](_0x36c925[_0x21ca('0x2d')],_0x36c925['query']);_0x466ac7['attributes']=_['intersection'](_0x36c925['model'],qs['fields'](_0x347c8e[_0x21ca('0x2e')]['fields']));_0x466ac7['attributes']=_0x466ac7[_0x21ca('0x32')][_0x21ca('0x34')]?_0x466ac7['attributes']:_0x36c925['model'];_0x466ac7[_0x21ca('0x37')]=qs['sort'](_0x347c8e[_0x21ca('0x2e')][_0x21ca('0x38')]);_0x466ac7[_0x21ca('0x39')]=qs[_0x21ca('0x30')](_[_0x21ca('0x3a')](_0x347c8e['query'],_0x36c925['filters']));if(_0x347c8e[_0x21ca('0x2e')]['filter']){_0x466ac7[_0x21ca('0x39')]=_[_0x21ca('0x3c')](_0x466ac7['where'],{'$or':_[_0x21ca('0x2a')](_0x466ac7[_0x21ca('0x32')],function(_0x54cebe){var _0x435e2e={};_0x435e2e[_0x54cebe]={'$like':'%'+_0x347c8e[_0x21ca('0x2e')]['filter']+'%'};return _0x435e2e;})});}_0x466ac7=_['merge']({},_0x466ac7,_0x347c8e[_0x21ca('0x3d')]);return _0x5a0d48[_0x21ca('0x49')](_0x466ac7);}})[_0x21ca('0x26')](function(_0x1cf33e){if(_0x1cf33e){_0xdd6ba1=_0x1cf33e['length'];if(!_0x347c8e[_0x21ca('0x2e')][_0x21ca('0x35')](_0x21ca('0x36'))){_0x466ac7[_0x21ca('0x1e')]=qs[_0x21ca('0x1e')](_0x347c8e['query'][_0x21ca('0x1e')]);_0x466ac7['offset']=qs[_0x21ca('0x1c')](_0x347c8e[_0x21ca('0x2e')][_0x21ca('0x1c')]);}return _0x5a0d48[_0x21ca('0x49')](_0x466ac7);}})[_0x21ca('0x26')](function(_0x552a44){if(_0x552a44){return _0x552a44?{'count':_0xdd6ba1,'rows':_0x552a44}:null;}})[_0x21ca('0x26')](respondWithResult(_0x9e47e2,null))[_0x21ca('0x41')](handleError(_0x9e47e2,null));};exports['getSubjects']=function(_0x3e6383,_0x582b0d,_0x5abd26){var _0x3419cb={};var _0x59d603={};var _0x27eeb0;var _0x3b037d;return db[_0x21ca('0x3e')]['findOne']({'where':{'id':_0x3e6383[_0x21ca('0x42')]['id']}})[_0x21ca('0x26')](handleEntityNotFound(_0x582b0d,null))[_0x21ca('0x26')](function(_0x452722){if(_0x452722){_0x27eeb0=_0x452722;_0x59d603[_0x21ca('0x2d')]=_[_0x21ca('0x2f')](db[_0x21ca('0x4a')][_0x21ca('0x2b')]);_0x59d603['query']=_['keys'](_0x3e6383[_0x21ca('0x2e')]);_0x59d603[_0x21ca('0x30')]=_[_0x21ca('0x31')](_0x59d603[_0x21ca('0x2d')],_0x59d603['query']);_0x3419cb[_0x21ca('0x32')]=_[_0x21ca('0x31')](_0x59d603[_0x21ca('0x2d')],qs[_0x21ca('0x33')](_0x3e6383[_0x21ca('0x2e')][_0x21ca('0x33')]));_0x3419cb['attributes']=_0x3419cb[_0x21ca('0x32')][_0x21ca('0x34')]?_0x3419cb[_0x21ca('0x32')]:_0x59d603['model'];_0x3419cb['order']=qs[_0x21ca('0x38')](_0x3e6383[_0x21ca('0x2e')]['sort']);_0x3419cb[_0x21ca('0x39')]=qs[_0x21ca('0x30')](_[_0x21ca('0x3a')](_0x3e6383['query'],_0x59d603['filters']));if(_0x3e6383[_0x21ca('0x2e')][_0x21ca('0x3b')]){_0x3419cb[_0x21ca('0x39')]=_[_0x21ca('0x3c')](_0x3419cb[_0x21ca('0x39')],{'$or':_[_0x21ca('0x2a')](_0x3419cb['attributes'],function(_0x46c164){var _0x40090b={};_0x40090b[_0x46c164]={'$like':'%'+_0x3e6383['query'][_0x21ca('0x3b')]+'%'};return _0x40090b;})});}_0x3419cb=_[_0x21ca('0x3c')]({},_0x3419cb,_0x3e6383[_0x21ca('0x3d')]);return _0x27eeb0['getSubjects'](_0x3419cb);}})[_0x21ca('0x26')](function(_0x5159a2){if(_0x5159a2){_0x3b037d=_0x5159a2['length'];if(!_0x3e6383[_0x21ca('0x2e')][_0x21ca('0x35')](_0x21ca('0x36'))){_0x3419cb['limit']=qs[_0x21ca('0x1e')](_0x3e6383['query'][_0x21ca('0x1e')]);_0x3419cb[_0x21ca('0x1c')]=qs[_0x21ca('0x1c')](_0x3e6383[_0x21ca('0x2e')][_0x21ca('0x1c')]);}return _0x27eeb0[_0x21ca('0x4b')](_0x3419cb);}})[_0x21ca('0x26')](function(_0x2e5490){if(_0x2e5490){return _0x2e5490?{'count':_0x3b037d,'rows':_0x2e5490}:null;}})['then'](respondWithResult(_0x582b0d,null))['catch'](handleError(_0x582b0d,null));};exports[_0x21ca('0x4c')]=function(_0x3bc754,_0x49be95,_0x58bd00){var _0x7ea04d={};var _0x5b2ba1={};var _0x22ad16;var _0x49143d;return db[_0x21ca('0x3e')]['findOne']({'where':{'id':_0x3bc754[_0x21ca('0x42')]['id']}})[_0x21ca('0x26')](handleEntityNotFound(_0x49be95,null))['then'](function(_0xfc93c7){if(_0xfc93c7){_0x22ad16=_0xfc93c7;_0x5b2ba1[_0x21ca('0x2d')]=_[_0x21ca('0x2f')](db[_0x21ca('0x4a')]['rawAttributes']);_0x5b2ba1['query']=_[_0x21ca('0x2f')](_0x3bc754[_0x21ca('0x2e')]);_0x5b2ba1['filters']=_[_0x21ca('0x31')](_0x5b2ba1[_0x21ca('0x2d')],_0x5b2ba1[_0x21ca('0x2e')]);_0x7ea04d[_0x21ca('0x32')]=_[_0x21ca('0x31')](_0x5b2ba1[_0x21ca('0x2d')],qs['fields'](_0x3bc754[_0x21ca('0x2e')][_0x21ca('0x33')]));_0x7ea04d[_0x21ca('0x32')]=_0x7ea04d[_0x21ca('0x32')][_0x21ca('0x34')]?_0x7ea04d[_0x21ca('0x32')]:_0x5b2ba1['model'];_0x7ea04d[_0x21ca('0x37')]=qs[_0x21ca('0x38')](_0x3bc754['query'][_0x21ca('0x38')]);_0x7ea04d[_0x21ca('0x39')]=qs[_0x21ca('0x30')](_[_0x21ca('0x3a')](_0x3bc754[_0x21ca('0x2e')],_0x5b2ba1[_0x21ca('0x30')]));if(_0x3bc754['query'][_0x21ca('0x3b')]){_0x7ea04d[_0x21ca('0x39')]=_[_0x21ca('0x3c')](_0x7ea04d[_0x21ca('0x39')],{'$or':_['map'](_0x7ea04d[_0x21ca('0x32')],function(_0x5076b0){var _0x5c582c={};_0x5c582c[_0x5076b0]={'$like':'%'+_0x3bc754[_0x21ca('0x2e')]['filter']+'%'};return _0x5c582c;})});}_0x7ea04d=_[_0x21ca('0x3c')]({},_0x7ea04d,_0x3bc754[_0x21ca('0x3d')]);return _0x22ad16['getDescriptions'](_0x7ea04d);}})[_0x21ca('0x26')](function(_0x11d44f){if(_0x11d44f){_0x49143d=_0x11d44f[_0x21ca('0x34')];if(!_0x3bc754[_0x21ca('0x2e')][_0x21ca('0x35')](_0x21ca('0x36'))){_0x7ea04d[_0x21ca('0x1e')]=qs['limit'](_0x3bc754[_0x21ca('0x2e')][_0x21ca('0x1e')]);_0x7ea04d[_0x21ca('0x1c')]=qs[_0x21ca('0x1c')](_0x3bc754[_0x21ca('0x2e')][_0x21ca('0x1c')]);}return _0x22ad16[_0x21ca('0x4c')](_0x7ea04d);}})[_0x21ca('0x26')](function(_0x4c2059){if(_0x4c2059){return _0x4c2059?{'count':_0x49143d,'rows':_0x4c2059}:null;}})[_0x21ca('0x26')](respondWithResult(_0x49be95,null))[_0x21ca('0x41')](handleError(_0x49be95,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index e181a00..9fb91cd 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 _0x9fde=['request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','lodash','../../config/logger','api','bluebird'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x9fde,0x11c));var _0xe9fd=function(_0x4d7a70,_0x2d3bfa){_0x4d7a70=_0x4d7a70-0x0;var _0x3aafbb=_0x9fde[_0x4d7a70];return _0x3aafbb;};'use strict';var _=require(_0xe9fd('0x0'));var util=require('util');var logger=require(_0xe9fd('0x1'))(_0xe9fd('0x2'));var moment=require('moment');var BPromise=require(_0xe9fd('0x3'));var rp=require(_0xe9fd('0x4'));var fs=require('fs');var path=require(_0xe9fd('0x5'));var rimraf=require(_0xe9fd('0x6'));var config=require(_0xe9fd('0x7'));var attributes=require(_0xe9fd('0x8'));module[_0xe9fd('0x9')]=function(_0x3b64c3,_0x49b7d0){return _0x3b64c3[_0xe9fd('0xa')](_0xe9fd('0xb'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab12=['SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./intSugarcrmConfiguration.attributes'];(function(_0x23c5b5,_0x37895d){var _0x1df501=function(_0x580814){while(--_0x580814){_0x23c5b5['push'](_0x23c5b5['shift']());}};_0x1df501(++_0x37895d);}(_0xab12,0x84));var _0x2ab1=function(_0x41f48b,_0x2d57ca){_0x41f48b=_0x41f48b-0x0;var _0x1b8941=_0xab12[_0x41f48b];return _0x1b8941;};'use strict';var _=require(_0x2ab1('0x0'));var util=require(_0x2ab1('0x1'));var logger=require(_0x2ab1('0x2'))(_0x2ab1('0x3'));var moment=require('moment');var BPromise=require(_0x2ab1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2ab1('0x5'));var rimraf=require('rimraf');var config=require(_0x2ab1('0x6'));var attributes=require(_0x2ab1('0x7'));module['exports']=function(_0x2557d2,_0x5487a4){return _0x2557d2['define'](_0x2ab1('0x8'),attributes,{'tableName':_0x2ab1('0x9'),'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 5020391..4b58a30 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 _0x3754=['client','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x40fcd2,_0x2f6ae8){var _0x203eeb=function(_0x1a0ef6){while(--_0x1a0ef6){_0x40fcd2['push'](_0x40fcd2['shift']());}};_0x203eeb(++_0x2f6ae8);}(_0x3754,0x175));var _0x4375=function(_0x1fbc79,_0x28b174){_0x1fbc79=_0x1fbc79-0x0;var _0xe701c6=_0x3754[_0x1fbc79];return _0xe701c6;};'use strict';var _=require('lodash');var util=require(_0x4375('0x0'));var moment=require(_0x4375('0x1'));var BPromise=require(_0x4375('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4375('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4375('0x4'))(_0x4375('0x5'));var config=require('../../config/environment');var jayson=require(_0x4375('0x6'));var client=jayson[_0x4375('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ebaee,_0x530dd1,_0x2475e3){return new BPromise(function(_0xd24f71,_0xb9ebc3){return client['request'](_0x2ebaee,_0x2475e3)[_0x4375('0x8')](function(_0x2fbd41){logger[_0x4375('0x9')](_0x4375('0xa'),_0x530dd1,_0x4375('0xb'));logger[_0x4375('0xc')](_0x4375('0xd'),_0x530dd1,_0x4375('0xb'),JSON[_0x4375('0xe')](_0x2fbd41));if(_0x2fbd41[_0x4375('0xf')]){if(_0x2fbd41[_0x4375('0xf')][_0x4375('0x10')]===0x1f4){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x530dd1,_0x2fbd41[_0x4375('0xf')][_0x4375('0x11')]);return _0xb9ebc3(_0x2fbd41[_0x4375('0xf')][_0x4375('0x11')]);}logger[_0x4375('0xf')](_0x4375('0xa'),_0x530dd1,_0x2fbd41[_0x4375('0xf')][_0x4375('0x11')]);return _0xd24f71(_0x2fbd41['error'][_0x4375('0x11')]);}else{logger[_0x4375('0x9')](_0x4375('0xa'),_0x530dd1,_0x4375('0xb'));_0xd24f71(_0x2fbd41[_0x4375('0x12')][_0x4375('0x11')]);}})[_0x4375('0x13')](function(_0x277727){logger[_0x4375('0xf')](_0x4375('0xa'),_0x530dd1,_0x277727);_0xb9ebc3(_0x277727);});});} \ No newline at end of file +var _0x2693=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x3d43cb,_0x3d7050){var _0x3f7599=function(_0xd85ade){while(--_0xd85ade){_0x3d43cb['push'](_0x3d43cb['shift']());}};_0x3f7599(++_0x3d7050);}(_0x2693,0x1c9));var _0x3269=function(_0x39afd3,_0x4a7ed8){_0x39afd3=_0x39afd3-0x0;var _0x2a614a=_0x2693[_0x39afd3];return _0x2a614a;};'use strict';var _=require(_0x3269('0x0'));var util=require(_0x3269('0x1'));var moment=require(_0x3269('0x2'));var BPromise=require(_0x3269('0x3'));var rs=require(_0x3269('0x4'));var fs=require('fs');var Redis=require(_0x3269('0x5'));var db=require(_0x3269('0x6'))['db'];var utils=require(_0x3269('0x7'));var logger=require(_0x3269('0x8'))(_0x3269('0x9'));var config=require(_0x3269('0xa'));var jayson=require(_0x3269('0xb'));var client=jayson[_0x3269('0xc')][_0x3269('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x49115d,_0x458814,_0x262407){return new BPromise(function(_0x59aa3e,_0x35edff){return client['request'](_0x49115d,_0x262407)[_0x3269('0xe')](function(_0x48ee41){logger[_0x3269('0xf')](_0x3269('0x10'),_0x458814,_0x3269('0x11'));logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x458814,_0x3269('0x11'),JSON[_0x3269('0x12')](_0x48ee41));if(_0x48ee41[_0x3269('0x13')]){if(_0x48ee41['error'][_0x3269('0x14')]===0x1f4){logger['error'](_0x3269('0x10'),_0x458814,_0x48ee41[_0x3269('0x13')][_0x3269('0x15')]);return _0x35edff(_0x48ee41['error']['message']);}logger[_0x3269('0x13')](_0x3269('0x10'),_0x458814,_0x48ee41['error'][_0x3269('0x15')]);return _0x59aa3e(_0x48ee41[_0x3269('0x13')][_0x3269('0x15')]);}else{logger[_0x3269('0xf')](_0x3269('0x10'),_0x458814,_0x3269('0x11'));_0x59aa3e(_0x48ee41[_0x3269('0x16')]['message']);}})[_0x3269('0x17')](function(_0x5d78fb){logger[_0x3269('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x458814,_0x5d78fb);_0x35edff(_0x5d78fb);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 7c0ae26..326c226 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 _0xf903=['/:id','show','post','create','put','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller','get','isAuthenticated','index'];(function(_0x316db7,_0x4b3a55){var _0x5cfa1d=function(_0x395462){while(--_0x395462){_0x316db7['push'](_0x316db7['shift']());}};_0x5cfa1d(++_0x4b3a55);}(_0xf903,0x104));var _0x3f90=function(_0x474791,_0x3a2e1a){_0x474791=_0x474791-0x0;var _0x20cca5=_0xf903[_0x474791];return _0x20cca5;};'use strict';var multer=require(_0x3f90('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3f90('0x1'));var router=express[_0x3f90('0x2')]();var fs_extra=require(_0x3f90('0x3'));var auth=require(_0x3f90('0x4'));var interaction=require(_0x3f90('0x5'));var config=require('../../config/environment');var controller=require(_0x3f90('0x6'));router[_0x3f90('0x7')]('/',auth[_0x3f90('0x8')](),controller[_0x3f90('0x9')]);router[_0x3f90('0x7')](_0x3f90('0xa'),auth[_0x3f90('0x8')](),controller[_0x3f90('0xb')]);router[_0x3f90('0xc')]('/',auth[_0x3f90('0x8')](),controller[_0x3f90('0xd')]);router[_0x3f90('0xe')](_0x3f90('0xa'),auth[_0x3f90('0x8')](),controller['update']);router[_0x3f90('0xf')]('/:id',auth[_0x3f90('0x8')](),controller[_0x3f90('0x10')]);module[_0x3f90('0x11')]=router; \ No newline at end of file +var _0x3434=['put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','/:id','isAuthenticated','show','post'];(function(_0x75726c,_0x1032fb){var _0x5083d6=function(_0x1a61a9){while(--_0x1a61a9){_0x75726c['push'](_0x75726c['shift']());}};_0x5083d6(++_0x1032fb);}(_0x3434,0xd5));var _0x4343=function(_0x4c966e,_0x1fa276){_0x4c966e=_0x4c966e-0x0;var _0x49bfad=_0x3434[_0x4c966e];return _0x49bfad;};'use strict';var multer=require(_0x4343('0x0'));var util=require(_0x4343('0x1'));var path=require('path');var timeout=require(_0x4343('0x2'));var express=require(_0x4343('0x3'));var router=express[_0x4343('0x4')]();var fs_extra=require(_0x4343('0x5'));var auth=require(_0x4343('0x6'));var interaction=require(_0x4343('0x7'));var config=require(_0x4343('0x8'));var controller=require(_0x4343('0x9'));router[_0x4343('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4343('0xa')](_0x4343('0xb'),auth[_0x4343('0xc')](),controller[_0x4343('0xd')]);router[_0x4343('0xe')]('/',auth[_0x4343('0xc')](),controller['create']);router[_0x4343('0xf')](_0x4343('0xb'),auth[_0x4343('0xc')](),controller[_0x4343('0x10')]);router[_0x4343('0x11')]('/:id',auth[_0x4343('0xc')](),controller['destroy']);module[_0x4343('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index e69ad60..2ca38fe 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 _0x7985=['exports','ENUM','string','variable','customVariable','picklist','STRING','BOOLEAN','sequelize'];(function(_0x44010b,_0x50bdd2){var _0x36ea57=function(_0xf43064){while(--_0xf43064){_0x44010b['push'](_0x44010b['shift']());}};_0x36ea57(++_0x50bdd2);}(_0x7985,0x179));var _0x5798=function(_0x279229,_0x1d69d9){_0x279229=_0x279229-0x0;var _0x195ca7=_0x7985[_0x279229];return _0x195ca7;};'use strict';var Sequelize=require(_0x5798('0x0'));module[_0x5798('0x1')]={'type':{'type':Sequelize[_0x5798('0x2')](_0x5798('0x3'),_0x5798('0x4'),_0x5798('0x5'),'keyValue',_0x5798('0x6')),'defaultValue':_0x5798('0x3')},'content':{'type':Sequelize[_0x5798('0x7')]},'key':{'type':Sequelize[_0x5798('0x7')]},'keyType':{'type':Sequelize[_0x5798('0x2')](_0x5798('0x3'),_0x5798('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x5798('0x7')]},'idField':{'type':Sequelize[_0x5798('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x5798('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x98e2=['ENUM','string','keyValue','STRING','variable','customVariable','BOOLEAN','sequelize'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0x98e2,0x8f));var _0x298e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x98e2[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x298e('0x0'));module['exports']={'type':{'type':Sequelize[_0x298e('0x1')](_0x298e('0x2'),'variable','customVariable',_0x298e('0x3'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x298e('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x298e('0x2'),_0x298e('0x5'),_0x298e('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x298e('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x298e('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index dd0968e..fa48d58 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 _0xc7ad=['Content-Range','json','apply','update','then','destroy','error','stack','name','send','index','SugarcrmField','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','filters','include','create','body','find','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count'];(function(_0x478ba9,_0x139e36){var _0x311d06=function(_0x2b8d75){while(--_0x2b8d75){_0x478ba9['push'](_0x478ba9['shift']());}};_0x311d06(++_0x139e36);}(_0xc7ad,0x1e3));var _0xdc7a=function(_0x331c1a,_0xc4596c){_0x331c1a=_0x331c1a-0x0;var _0x5009c7=_0xc7ad[_0x331c1a];return _0x5009c7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdc7a('0x0'));var zipdir=require(_0xdc7a('0x1'));var jsonpatch=require(_0xdc7a('0x2'));var rp=require('request-promise');var moment=require(_0xdc7a('0x3'));var BPromise=require(_0xdc7a('0x4'));var Mustache=require(_0xdc7a('0x5'));var util=require(_0xdc7a('0x6'));var path=require(_0xdc7a('0x7'));var sox=require(_0xdc7a('0x8'));var csv=require(_0xdc7a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdc7a('0xa'));var crypto=require('crypto');var jsforce=require(_0xdc7a('0xb'));var deskjs=require(_0xdc7a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xdc7a('0xd'));var Papa=require(_0xdc7a('0xe'));var Redis=require('ioredis');var authService=require(_0xdc7a('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdc7a('0x10'));var logger=require('../../config/logger')(_0xdc7a('0x11'));var utils=require(_0xdc7a('0x12'));var config=require(_0xdc7a('0x13'));var licenseUtil=require(_0xdc7a('0x14'));var db=require(_0xdc7a('0x15'))['db'];function respondWithStatusCode(_0x534c88,_0x237ac3){_0x237ac3=_0x237ac3||0xcc;return function(_0x187b08){if(_0x187b08){return _0x534c88[_0xdc7a('0x16')](_0x237ac3);}return _0x534c88[_0xdc7a('0x17')](_0x237ac3)[_0xdc7a('0x18')]();};}function respondWithResult(_0x1bad4a,_0x5cb140){_0x5cb140=_0x5cb140||0xc8;return function(_0x47c656){if(_0x47c656){return _0x1bad4a['status'](_0x5cb140)['json'](_0x47c656);}};}function respondWithFilteredResult(_0x27e9b8,_0x5bf6f2){return function(_0x348bc9){if(_0x348bc9){var _0x4539df=typeof _0x5bf6f2[_0xdc7a('0x19')]==='undefined'&&typeof _0x5bf6f2[_0xdc7a('0x1a')]==='undefined';var _0x5d0db0=_0x348bc9[_0xdc7a('0x1b')];var _0x46fa59=_0x4539df?0x0:_0x5bf6f2['offset'];var _0xf762d2=_0x4539df?_0x348bc9[_0xdc7a('0x1b')]:_0x5bf6f2[_0xdc7a('0x19')]+_0x5bf6f2['limit'];var _0x564950;if(_0xf762d2>=_0x5d0db0){_0xf762d2=_0x5d0db0;_0x564950=0xc8;}else{_0x564950=0xce;}_0x27e9b8[_0xdc7a('0x17')](_0x564950);return _0x27e9b8['set'](_0xdc7a('0x1c'),_0x46fa59+'-'+_0xf762d2+'/'+_0x5d0db0)[_0xdc7a('0x1d')](_0x348bc9);}return null;};}function patchUpdates(_0x425bb0){return function(_0x251556){try{jsonpatch[_0xdc7a('0x1e')](_0x251556,_0x425bb0,!![]);}catch(_0x3dbb39){return BPromise['reject'](_0x3dbb39);}return _0x251556['save']();};}function saveUpdates(_0x57c2e3,_0x29c30a){return function(_0x4c149e){if(_0x4c149e){return _0x4c149e[_0xdc7a('0x1f')](_0x57c2e3)[_0xdc7a('0x20')](function(_0x54f207){return _0x54f207;});}return null;};}function removeEntity(_0x1df092,_0x4a1203){return function(_0xb5f7cd){if(_0xb5f7cd){return _0xb5f7cd[_0xdc7a('0x21')]()[_0xdc7a('0x20')](function(){_0x1df092['status'](0xcc)[_0xdc7a('0x18')]();});}};}function handleEntityNotFound(_0x503293,_0x59dbbf){return function(_0x382f3c){if(!_0x382f3c){_0x503293[_0xdc7a('0x16')](0x194);}return _0x382f3c;};}function handleError(_0xca8818,_0x4646b2){_0x4646b2=_0x4646b2||0x1f4;return function(_0x19d041){logger[_0xdc7a('0x22')](_0x19d041[_0xdc7a('0x23')]);if(_0x19d041[_0xdc7a('0x24')]){delete _0x19d041['name'];}_0xca8818[_0xdc7a('0x17')](_0x4646b2)[_0xdc7a('0x25')](_0x19d041);};}exports[_0xdc7a('0x26')]=function(_0x81d539,_0xdebef2){var _0x53a5cc={},_0x34cbc2={},_0x13b898={'count':0x0,'rows':[]};var _0x418993=_['map'](db[_0xdc7a('0x27')][_0xdc7a('0x28')],function(_0x3992e3){return{'name':_0x3992e3[_0xdc7a('0x29')],'type':_0x3992e3[_0xdc7a('0x2a')][_0xdc7a('0x2b')]};});_0x34cbc2[_0xdc7a('0x2c')]=_[_0xdc7a('0x2d')](_0x418993,'name');_0x34cbc2[_0xdc7a('0x2e')]=_[_0xdc7a('0x2f')](_0x81d539[_0xdc7a('0x2e')]);_0x34cbc2['filters']=_[_0xdc7a('0x30')](_0x34cbc2['model'],_0x34cbc2['query']);_0x53a5cc[_0xdc7a('0x31')]=_[_0xdc7a('0x30')](_0x34cbc2[_0xdc7a('0x2c')],qs[_0xdc7a('0x32')](_0x81d539[_0xdc7a('0x2e')][_0xdc7a('0x32')]));_0x53a5cc[_0xdc7a('0x31')]=_0x53a5cc[_0xdc7a('0x31')][_0xdc7a('0x33')]?_0x53a5cc[_0xdc7a('0x31')]:_0x34cbc2[_0xdc7a('0x2c')];if(!_0x81d539[_0xdc7a('0x2e')][_0xdc7a('0x34')](_0xdc7a('0x35'))){_0x53a5cc[_0xdc7a('0x1a')]=qs['limit'](_0x81d539[_0xdc7a('0x2e')][_0xdc7a('0x1a')]);_0x53a5cc[_0xdc7a('0x19')]=qs[_0xdc7a('0x19')](_0x81d539[_0xdc7a('0x2e')][_0xdc7a('0x19')]);}_0x53a5cc[_0xdc7a('0x36')]=qs[_0xdc7a('0x37')](_0x81d539[_0xdc7a('0x2e')][_0xdc7a('0x37')]);_0x53a5cc[_0xdc7a('0x38')]=qs['filters'](_[_0xdc7a('0x39')](_0x81d539[_0xdc7a('0x2e')],_0x34cbc2['filters']),_0x418993);if(_0x81d539[_0xdc7a('0x2e')][_0xdc7a('0x3a')]){_0x53a5cc['where']=_[_0xdc7a('0x3b')](_0x53a5cc[_0xdc7a('0x38')],{'$or':_['map'](_0x418993,function(_0x495ed1){if(_0x495ed1[_0xdc7a('0x2a')]!==_0xdc7a('0x3c')){var _0x2d5405={};_0x2d5405[_0x495ed1[_0xdc7a('0x24')]]={'$like':'%'+_0x81d539[_0xdc7a('0x2e')][_0xdc7a('0x3a')]+'%'};return _0x2d5405;}})});}_0x53a5cc=_['merge']({},_0x53a5cc,_0x81d539[_0xdc7a('0x3d')]);var _0x2a0275={'where':_0x53a5cc[_0xdc7a('0x38')]};return db[_0xdc7a('0x27')][_0xdc7a('0x1b')](_0x2a0275)[_0xdc7a('0x20')](function(_0x2b79fc){_0x13b898['count']=_0x2b79fc;if(_0x81d539[_0xdc7a('0x2e')][_0xdc7a('0x3e')]){_0x53a5cc['include']=[{'all':!![]}];}return db[_0xdc7a('0x27')][_0xdc7a('0x3f')](_0x53a5cc);})['then'](function(_0x51f821){_0x13b898[_0xdc7a('0x40')]=_0x51f821;return _0x13b898;})[_0xdc7a('0x20')](respondWithFilteredResult(_0xdebef2,_0x53a5cc))[_0xdc7a('0x41')](handleError(_0xdebef2,null));};exports[_0xdc7a('0x42')]=function(_0x468db4,_0x41ac4d){var _0x35c7ba={'raw':!![],'where':{'id':_0x468db4[_0xdc7a('0x43')]['id']}},_0x43a703={};_0x43a703[_0xdc7a('0x2c')]=_[_0xdc7a('0x2f')](db[_0xdc7a('0x27')][_0xdc7a('0x28')]);_0x43a703[_0xdc7a('0x2e')]=_[_0xdc7a('0x2f')](_0x468db4[_0xdc7a('0x2e')]);_0x43a703[_0xdc7a('0x44')]=_[_0xdc7a('0x30')](_0x43a703['model'],_0x43a703['query']);_0x35c7ba['attributes']=_[_0xdc7a('0x30')](_0x43a703['model'],qs[_0xdc7a('0x32')](_0x468db4[_0xdc7a('0x2e')][_0xdc7a('0x32')]));_0x35c7ba['attributes']=_0x35c7ba['attributes'][_0xdc7a('0x33')]?_0x35c7ba[_0xdc7a('0x31')]:_0x43a703['model'];if(_0x468db4[_0xdc7a('0x2e')][_0xdc7a('0x3e')]){_0x35c7ba[_0xdc7a('0x45')]=[{'all':!![]}];}_0x35c7ba=_[_0xdc7a('0x3b')]({},_0x35c7ba,_0x468db4[_0xdc7a('0x3d')]);return db[_0xdc7a('0x27')]['find'](_0x35c7ba)[_0xdc7a('0x20')](handleEntityNotFound(_0x41ac4d,null))['then'](respondWithResult(_0x41ac4d,null))[_0xdc7a('0x41')](handleError(_0x41ac4d,null));};exports[_0xdc7a('0x46')]=function(_0x8c07b,_0x2d6bad){return db[_0xdc7a('0x27')][_0xdc7a('0x46')](_0x8c07b[_0xdc7a('0x47')],{})[_0xdc7a('0x20')](respondWithResult(_0x2d6bad,0xc9))[_0xdc7a('0x41')](handleError(_0x2d6bad,null));};exports[_0xdc7a('0x1f')]=function(_0x37b414,_0x904147){if(_0x37b414[_0xdc7a('0x47')]['id']){delete _0x37b414[_0xdc7a('0x47')]['id'];}return db[_0xdc7a('0x27')][_0xdc7a('0x48')]({'where':{'id':_0x37b414[_0xdc7a('0x43')]['id']}})[_0xdc7a('0x20')](handleEntityNotFound(_0x904147,null))[_0xdc7a('0x20')](saveUpdates(_0x37b414[_0xdc7a('0x47')],null))[_0xdc7a('0x20')](respondWithResult(_0x904147,null))['catch'](handleError(_0x904147,null));};exports[_0xdc7a('0x21')]=function(_0x4af405,_0x400e1f){return db[_0xdc7a('0x27')][_0xdc7a('0x48')]({'where':{'id':_0x4af405[_0xdc7a('0x43')]['id']}})[_0xdc7a('0x20')](handleEntityNotFound(_0x400e1f,null))[_0xdc7a('0x20')](removeEntity(_0x400e1f,null))['catch'](handleError(_0x400e1f,null));}; \ No newline at end of file +var _0x00b4=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','destroy','end','stack','name','send','index','map','SugarcrmField','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x221731,_0x148761){var _0x4935a2=function(_0x47cc8c){while(--_0x47cc8c){_0x221731['push'](_0x221731['shift']());}};_0x4935a2(++_0x148761);}(_0x00b4,0x19a));var _0x400b=function(_0x1613ae,_0x29ba48){_0x1613ae=_0x1613ae-0x0;var _0x30ffd2=_0x00b4[_0x1613ae];return _0x30ffd2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x400b('0x0'));var zipdir=require(_0x400b('0x1'));var jsonpatch=require(_0x400b('0x2'));var rp=require(_0x400b('0x3'));var moment=require(_0x400b('0x4'));var BPromise=require(_0x400b('0x5'));var Mustache=require(_0x400b('0x6'));var util=require(_0x400b('0x7'));var path=require(_0x400b('0x8'));var sox=require(_0x400b('0x9'));var csv=require(_0x400b('0xa'));var ejs=require(_0x400b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x400b('0xc'));var squel=require(_0x400b('0xd'));var crypto=require(_0x400b('0xe'));var jsforce=require(_0x400b('0xf'));var deskjs=require(_0x400b('0x10'));var toCsv=require(_0x400b('0xa'));var querystring=require('querystring');var Papa=require(_0x400b('0x11'));var Redis=require(_0x400b('0x12'));var authService=require(_0x400b('0x13'));var qs=require(_0x400b('0x14'));var as=require(_0x400b('0x15'));var hardwareService=require(_0x400b('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x400b('0x17'));var config=require(_0x400b('0x18'));var licenseUtil=require(_0x400b('0x19'));var db=require(_0x400b('0x1a'))['db'];function respondWithStatusCode(_0x37703e,_0x4e5980){_0x4e5980=_0x4e5980||0xcc;return function(_0x200018){if(_0x200018){return _0x37703e[_0x400b('0x1b')](_0x4e5980);}return _0x37703e[_0x400b('0x1c')](_0x4e5980)['end']();};}function respondWithResult(_0x216056,_0x31f38f){_0x31f38f=_0x31f38f||0xc8;return function(_0x5a300f){if(_0x5a300f){return _0x216056[_0x400b('0x1c')](_0x31f38f)[_0x400b('0x1d')](_0x5a300f);}};}function respondWithFilteredResult(_0x170017,_0x4fa410){return function(_0x3219ff){if(_0x3219ff){var _0x29c504=typeof _0x4fa410[_0x400b('0x1e')]==='undefined'&&typeof _0x4fa410[_0x400b('0x1f')]===_0x400b('0x20');var _0x4c01d3=_0x3219ff[_0x400b('0x21')];var _0x478a52=_0x29c504?0x0:_0x4fa410[_0x400b('0x1e')];var _0xbbdaaf=_0x29c504?_0x3219ff[_0x400b('0x21')]:_0x4fa410[_0x400b('0x1e')]+_0x4fa410[_0x400b('0x1f')];var _0x84609d;if(_0xbbdaaf>=_0x4c01d3){_0xbbdaaf=_0x4c01d3;_0x84609d=0xc8;}else{_0x84609d=0xce;}_0x170017[_0x400b('0x1c')](_0x84609d);return _0x170017['set'](_0x400b('0x22'),_0x478a52+'-'+_0xbbdaaf+'/'+_0x4c01d3)['json'](_0x3219ff);}return null;};}function patchUpdates(_0x37c25e){return function(_0x1a6fe5){try{jsonpatch[_0x400b('0x23')](_0x1a6fe5,_0x37c25e,!![]);}catch(_0x35543c){return BPromise['reject'](_0x35543c);}return _0x1a6fe5[_0x400b('0x24')]();};}function saveUpdates(_0x4878ec,_0xa558b7){return function(_0x5841d3){if(_0x5841d3){return _0x5841d3[_0x400b('0x25')](_0x4878ec)[_0x400b('0x26')](function(_0x4bc5f6){return _0x4bc5f6;});}return null;};}function removeEntity(_0x51d6ba,_0x88c280){return function(_0x3c366a){if(_0x3c366a){return _0x3c366a[_0x400b('0x27')]()[_0x400b('0x26')](function(){_0x51d6ba[_0x400b('0x1c')](0xcc)[_0x400b('0x28')]();});}};}function handleEntityNotFound(_0x1aba61,_0x3d18d5){return function(_0x828252){if(!_0x828252){_0x1aba61[_0x400b('0x1b')](0x194);}return _0x828252;};}function handleError(_0x5868ad,_0x1790db){_0x1790db=_0x1790db||0x1f4;return function(_0x5c9f7a){logger['error'](_0x5c9f7a[_0x400b('0x29')]);if(_0x5c9f7a[_0x400b('0x2a')]){delete _0x5c9f7a[_0x400b('0x2a')];}_0x5868ad[_0x400b('0x1c')](_0x1790db)[_0x400b('0x2b')](_0x5c9f7a);};}exports[_0x400b('0x2c')]=function(_0x4789dd,_0x35444e){var _0x30e802={},_0x3719e0={},_0x22fe90={'count':0x0,'rows':[]};var _0x593f64=_[_0x400b('0x2d')](db[_0x400b('0x2e')]['rawAttributes'],function(_0x430606){return{'name':_0x430606['fieldName'],'type':_0x430606[_0x400b('0x2f')][_0x400b('0x30')]};});_0x3719e0[_0x400b('0x31')]=_[_0x400b('0x2d')](_0x593f64,'name');_0x3719e0['query']=_[_0x400b('0x32')](_0x4789dd[_0x400b('0x33')]);_0x3719e0[_0x400b('0x34')]=_[_0x400b('0x35')](_0x3719e0[_0x400b('0x31')],_0x3719e0[_0x400b('0x33')]);_0x30e802[_0x400b('0x36')]=_[_0x400b('0x35')](_0x3719e0[_0x400b('0x31')],qs['fields'](_0x4789dd[_0x400b('0x33')][_0x400b('0x37')]));_0x30e802[_0x400b('0x36')]=_0x30e802[_0x400b('0x36')][_0x400b('0x38')]?_0x30e802['attributes']:_0x3719e0[_0x400b('0x31')];if(!_0x4789dd['query'][_0x400b('0x39')](_0x400b('0x3a'))){_0x30e802['limit']=qs[_0x400b('0x1f')](_0x4789dd['query']['limit']);_0x30e802['offset']=qs[_0x400b('0x1e')](_0x4789dd[_0x400b('0x33')]['offset']);}_0x30e802[_0x400b('0x3b')]=qs[_0x400b('0x3c')](_0x4789dd[_0x400b('0x33')]['sort']);_0x30e802[_0x400b('0x3d')]=qs[_0x400b('0x34')](_[_0x400b('0x3e')](_0x4789dd['query'],_0x3719e0['filters']),_0x593f64);if(_0x4789dd[_0x400b('0x33')][_0x400b('0x3f')]){_0x30e802[_0x400b('0x3d')]=_[_0x400b('0x40')](_0x30e802['where'],{'$or':_[_0x400b('0x2d')](_0x593f64,function(_0x11a496){if(_0x11a496[_0x400b('0x2f')]!==_0x400b('0x41')){var _0x28cf75={};_0x28cf75[_0x11a496[_0x400b('0x2a')]]={'$like':'%'+_0x4789dd[_0x400b('0x33')]['filter']+'%'};return _0x28cf75;}})});}_0x30e802=_['merge']({},_0x30e802,_0x4789dd[_0x400b('0x42')]);var _0x2e9914={'where':_0x30e802[_0x400b('0x3d')]};return db[_0x400b('0x2e')][_0x400b('0x21')](_0x2e9914)[_0x400b('0x26')](function(_0x34175e){_0x22fe90[_0x400b('0x21')]=_0x34175e;if(_0x4789dd[_0x400b('0x33')][_0x400b('0x43')]){_0x30e802['include']=[{'all':!![]}];}return db[_0x400b('0x2e')][_0x400b('0x44')](_0x30e802);})[_0x400b('0x26')](function(_0x1733a5){_0x22fe90[_0x400b('0x45')]=_0x1733a5;return _0x22fe90;})['then'](respondWithFilteredResult(_0x35444e,_0x30e802))[_0x400b('0x46')](handleError(_0x35444e,null));};exports[_0x400b('0x47')]=function(_0x4de5ca,_0xece314){var _0x12a0bf={'raw':!![],'where':{'id':_0x4de5ca['params']['id']}},_0xca697c={};_0xca697c[_0x400b('0x31')]=_[_0x400b('0x32')](db[_0x400b('0x2e')][_0x400b('0x48')]);_0xca697c[_0x400b('0x33')]=_[_0x400b('0x32')](_0x4de5ca[_0x400b('0x33')]);_0xca697c['filters']=_[_0x400b('0x35')](_0xca697c[_0x400b('0x31')],_0xca697c[_0x400b('0x33')]);_0x12a0bf['attributes']=_[_0x400b('0x35')](_0xca697c[_0x400b('0x31')],qs[_0x400b('0x37')](_0x4de5ca[_0x400b('0x33')][_0x400b('0x37')]));_0x12a0bf[_0x400b('0x36')]=_0x12a0bf[_0x400b('0x36')][_0x400b('0x38')]?_0x12a0bf[_0x400b('0x36')]:_0xca697c[_0x400b('0x31')];if(_0x4de5ca[_0x400b('0x33')][_0x400b('0x43')]){_0x12a0bf[_0x400b('0x49')]=[{'all':!![]}];}_0x12a0bf=_[_0x400b('0x40')]({},_0x12a0bf,_0x4de5ca[_0x400b('0x42')]);return db['SugarcrmField'][_0x400b('0x4a')](_0x12a0bf)[_0x400b('0x26')](handleEntityNotFound(_0xece314,null))[_0x400b('0x26')](respondWithResult(_0xece314,null))[_0x400b('0x46')](handleError(_0xece314,null));};exports[_0x400b('0x4b')]=function(_0x214d6e,_0x58a2b0){return db[_0x400b('0x2e')][_0x400b('0x4b')](_0x214d6e[_0x400b('0x4c')],{})[_0x400b('0x26')](respondWithResult(_0x58a2b0,0xc9))[_0x400b('0x46')](handleError(_0x58a2b0,null));};exports['update']=function(_0x2a305a,_0x325bc9){if(_0x2a305a['body']['id']){delete _0x2a305a[_0x400b('0x4c')]['id'];}return db['SugarcrmField'][_0x400b('0x4a')]({'where':{'id':_0x2a305a[_0x400b('0x4d')]['id']}})['then'](handleEntityNotFound(_0x325bc9,null))[_0x400b('0x26')](saveUpdates(_0x2a305a[_0x400b('0x4c')],null))[_0x400b('0x26')](respondWithResult(_0x325bc9,null))[_0x400b('0x46')](handleError(_0x325bc9,null));};exports[_0x400b('0x27')]=function(_0x1c091e,_0x16de42){return db[_0x400b('0x2e')][_0x400b('0x4a')]({'where':{'id':_0x1c091e[_0x400b('0x4d')]['id']}})[_0x400b('0x26')](handleEntityNotFound(_0x16de42,null))['then'](removeEntity(_0x16de42,null))['catch'](handleError(_0x16de42,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index b721fba..e6c08b0 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 _0x0092=['api','moment','bluebird','path','rimraf','../../config/environment','./intSugarcrmField.attributes','SugarcrmField','int_sugarcrm_fields','idField','FieldId','../../config/logger'];(function(_0x3cd4fa,_0x578f7f){var _0xc731aa=function(_0x15a401){while(--_0x15a401){_0x3cd4fa['push'](_0x3cd4fa['shift']());}};_0xc731aa(++_0x578f7f);}(_0x0092,0x17f));var _0x2009=function(_0x4032e3,_0x6d6449){_0x4032e3=_0x4032e3-0x0;var _0x34f51a=_0x0092[_0x4032e3];return _0x34f51a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2009('0x0'))(_0x2009('0x1'));var moment=require(_0x2009('0x2'));var BPromise=require(_0x2009('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2009('0x4'));var rimraf=require(_0x2009('0x5'));var config=require(_0x2009('0x6'));var attributes=require(_0x2009('0x7'));module['exports']=function(_0x570c8f,_0xdeaf5){return _0x570c8f['define'](_0x2009('0x8'),attributes,{'tableName':_0x2009('0x9'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x2009('0xa'),_0x2009('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5b31=['rimraf','../../config/environment','./intSugarcrmField.attributes','exports','int_sugarcrm_fields','idField','FieldId','lodash','util','api','moment','bluebird','request-promise'];(function(_0x77cb50,_0x5af067){var _0x1124fb=function(_0x46bbf5){while(--_0x46bbf5){_0x77cb50['push'](_0x77cb50['shift']());}};_0x1124fb(++_0x5af067);}(_0x5b31,0xb0));var _0x15b3=function(_0x5050d7,_0x5812bf){_0x5050d7=_0x5050d7-0x0;var _0x1626f5=_0x5b31[_0x5050d7];return _0x1626f5;};'use strict';var _=require(_0x15b3('0x0'));var util=require(_0x15b3('0x1'));var logger=require('../../config/logger')(_0x15b3('0x2'));var moment=require(_0x15b3('0x3'));var BPromise=require(_0x15b3('0x4'));var rp=require(_0x15b3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x15b3('0x6'));var config=require(_0x15b3('0x7'));var attributes=require(_0x15b3('0x8'));module[_0x15b3('0x9')]=function(_0x58bca0,_0x516fe7){return _0x58bca0['define']('SugarcrmField',attributes,{'tableName':_0x15b3('0xa'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x15b3('0xb'),_0x15b3('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 e132aaa..b5d4fce 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 _0x03c5=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util'];(function(_0x3684ce,_0x560c7e){var _0x4e1278=function(_0x5999a0){while(--_0x5999a0){_0x3684ce['push'](_0x3684ce['shift']());}};_0x4e1278(++_0x560c7e);}(_0x03c5,0xd6));var _0x503c=function(_0x2a18b7,_0x5041c8){_0x2a18b7=_0x2a18b7-0x0;var _0x45e74e=_0x03c5[_0x2a18b7];return _0x45e74e;};'use strict';var _=require(_0x503c('0x0'));var util=require(_0x503c('0x1'));var moment=require('moment');var BPromise=require(_0x503c('0x2'));var rs=require(_0x503c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x503c('0x4'))['db'];var utils=require(_0x503c('0x5'));var logger=require(_0x503c('0x6'))(_0x503c('0x7'));var config=require(_0x503c('0x8'));var jayson=require(_0x503c('0x9'));var client=jayson[_0x503c('0xa')][_0x503c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c1dc6,_0x4ab4cf,_0x5213e4){return new BPromise(function(_0x5d1ac3,_0x536599){return client['request'](_0x3c1dc6,_0x5213e4)[_0x503c('0xc')](function(_0x5e4dd4){logger['info'](_0x503c('0xd'),_0x4ab4cf,_0x503c('0xe'));logger[_0x503c('0xf')](_0x503c('0x10'),_0x4ab4cf,'request\x20sent',JSON[_0x503c('0x11')](_0x5e4dd4));if(_0x5e4dd4[_0x503c('0x12')]){if(_0x5e4dd4['error'][_0x503c('0x13')]===0x1f4){logger[_0x503c('0x12')](_0x503c('0xd'),_0x4ab4cf,_0x5e4dd4[_0x503c('0x12')]['message']);return _0x536599(_0x5e4dd4[_0x503c('0x12')][_0x503c('0x14')]);}logger[_0x503c('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x4ab4cf,_0x5e4dd4[_0x503c('0x12')]['message']);return _0x5d1ac3(_0x5e4dd4['error'][_0x503c('0x14')]);}else{logger[_0x503c('0x15')](_0x503c('0xd'),_0x4ab4cf,'request\x20sent');_0x5d1ac3(_0x5e4dd4[_0x503c('0x16')]['message']);}})[_0x503c('0x17')](function(_0x2b7ba3){logger[_0x503c('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x4ab4cf,_0x2b7ba3);_0x536599(_0x2b7ba3);});});} \ No newline at end of file +var _0x3147=['rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x29570a,_0x124a5b){var _0x7be1a2=function(_0x44faaf){while(--_0x44faaf){_0x29570a['push'](_0x29570a['shift']());}};_0x7be1a2(++_0x124a5b);}(_0x3147,0x1f3));var _0x7314=function(_0x4932db,_0x3e7ba7){_0x4932db=_0x4932db-0x0;var _0x5abce8=_0x3147[_0x4932db];return _0x5abce8;};'use strict';var _=require(_0x7314('0x0'));var util=require('util');var moment=require(_0x7314('0x1'));var BPromise=require(_0x7314('0x2'));var rs=require(_0x7314('0x3'));var fs=require('fs');var Redis=require(_0x7314('0x4'));var db=require(_0x7314('0x5'))['db'];var utils=require(_0x7314('0x6'));var logger=require('../../config/logger')(_0x7314('0x7'));var config=require(_0x7314('0x8'));var jayson=require(_0x7314('0x9'));var client=jayson[_0x7314('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d37fd,_0x277118,_0x2ef3e1){return new BPromise(function(_0x8a096a,_0x5108c0){return client[_0x7314('0xb')](_0x3d37fd,_0x2ef3e1)[_0x7314('0xc')](function(_0xd0c107){logger[_0x7314('0xd')](_0x7314('0xe'),_0x277118,_0x7314('0xf'));logger[_0x7314('0x10')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x277118,'request\x20sent',JSON[_0x7314('0x11')](_0xd0c107));if(_0xd0c107[_0x7314('0x12')]){if(_0xd0c107[_0x7314('0x12')]['code']===0x1f4){logger[_0x7314('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x277118,_0xd0c107['error']['message']);return _0x5108c0(_0xd0c107[_0x7314('0x12')][_0x7314('0x13')]);}logger[_0x7314('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x277118,_0xd0c107['error'][_0x7314('0x13')]);return _0x8a096a(_0xd0c107[_0x7314('0x12')][_0x7314('0x13')]);}else{logger[_0x7314('0xd')](_0x7314('0xe'),_0x277118,_0x7314('0xf'));_0x8a096a(_0xd0c107[_0x7314('0x14')]['message']);}})[_0x7314('0x15')](function(_0x10b192){logger['error'](_0x7314('0xe'),_0x277118,_0x10b192);_0x5108c0(_0x10b192);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 8ce32be..742fc19 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 _0xecd0=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','put'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xecd0,0x162));var _0x0ecd=function(_0x1f1fb4,_0x15a561){_0x1f1fb4=_0x1f1fb4-0x0;var _0x12fa15=_0xecd0[_0x1f1fb4];return _0x12fa15;};'use strict';var multer=require(_0x0ecd('0x0'));var util=require(_0x0ecd('0x1'));var path=require(_0x0ecd('0x2'));var timeout=require(_0x0ecd('0x3'));var express=require(_0x0ecd('0x4'));var router=express['Router']();var fs_extra=require(_0x0ecd('0x5'));var auth=require(_0x0ecd('0x6'));var interaction=require(_0x0ecd('0x7'));var config=require(_0x0ecd('0x8'));var controller=require('./intVtigerAccount.controller');router[_0x0ecd('0x9')]('/',auth[_0x0ecd('0xa')](),controller[_0x0ecd('0xb')]);router[_0x0ecd('0x9')](_0x0ecd('0xc'),auth[_0x0ecd('0xa')](),controller[_0x0ecd('0xd')]);router[_0x0ecd('0x9')](_0x0ecd('0xe'),auth[_0x0ecd('0xa')](),controller[_0x0ecd('0xf')]);router[_0x0ecd('0x9')](_0x0ecd('0x10'),auth[_0x0ecd('0xa')](),controller[_0x0ecd('0x11')]);router['post']('/',auth[_0x0ecd('0xa')](),controller[_0x0ecd('0x12')]);router[_0x0ecd('0x13')](_0x0ecd('0xe'),auth[_0x0ecd('0xa')](),controller['addConfiguration']);router[_0x0ecd('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x0ecd('0x15')]);router[_0x0ecd('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x0ecd('0x17')]);module[_0x0ecd('0x18')]=router; \ No newline at end of file +var _0xb708=['show','get','getConfigurations','/:id/fields','post','create','/:id/configurations','addConfiguration','put','update','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','/:id'];(function(_0x4cddf9,_0x2bc65e){var _0x5d4c5c=function(_0x4509c0){while(--_0x4509c0){_0x4cddf9['push'](_0x4cddf9['shift']());}};_0x5d4c5c(++_0x2bc65e);}(_0xb708,0xe7));var _0x8b70=function(_0x5c1345,_0x40116e){_0x5c1345=_0x5c1345-0x0;var _0x1c070d=_0xb708[_0x5c1345];return _0x1c070d;};'use strict';var multer=require(_0x8b70('0x0'));var util=require('util');var path=require(_0x8b70('0x1'));var timeout=require('connect-timeout');var express=require(_0x8b70('0x2'));var router=express[_0x8b70('0x3')]();var fs_extra=require(_0x8b70('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8b70('0x5'));var config=require(_0x8b70('0x6'));var controller=require(_0x8b70('0x7'));router['get']('/',auth[_0x8b70('0x8')](),controller[_0x8b70('0x9')]);router['get'](_0x8b70('0xa'),auth[_0x8b70('0x8')](),controller[_0x8b70('0xb')]);router[_0x8b70('0xc')]('/:id/configurations',auth[_0x8b70('0x8')](),controller[_0x8b70('0xd')]);router['get'](_0x8b70('0xe'),auth[_0x8b70('0x8')](),controller['getFields']);router[_0x8b70('0xf')]('/',auth['isAuthenticated'](),controller[_0x8b70('0x10')]);router[_0x8b70('0xf')](_0x8b70('0x11'),auth['isAuthenticated'](),controller[_0x8b70('0x12')]);router[_0x8b70('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x8b70('0x14')]);router['delete'](_0x8b70('0xa'),auth[_0x8b70('0x8')](),controller['destroy']);module[_0x8b70('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 19f1554..695f941 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 _0x2baf=['STRING','HelpDesk','sequelize','exports'];(function(_0x5f55b0,_0x3a9b9e){var _0x4228fa=function(_0x5547fe){while(--_0x5547fe){_0x5f55b0['push'](_0x5f55b0['shift']());}};_0x4228fa(++_0x3a9b9e);}(_0x2baf,0x106));var _0xf2ba=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x2baf[_0xdea41a];return _0x15d0d8;};'use strict';var Sequelize=require(_0xf2ba('0x0'));module[_0xf2ba('0x1')]={'name':{'type':Sequelize[_0xf2ba('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0xf2ba('0x2')],'allowNull':![],'defaultValue':_0xf2ba('0x3')},'remoteUri':{'type':Sequelize[_0xf2ba('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xf2ba('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xf2ba('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x65a8=['HelpDesk','sequelize','exports','STRING'];(function(_0x543c51,_0xff0084){var _0x360555=function(_0x2a0801){while(--_0x2a0801){_0x543c51['push'](_0x543c51['shift']());}};_0x360555(++_0xff0084);}(_0x65a8,0x151));var _0x865a=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x65a8[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x865a('0x0'));module[_0x865a('0x1')]={'name':{'type':Sequelize[_0x865a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x865a('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x865a('0x2')],'allowNull':![],'defaultValue':_0x865a('0x3')},'remoteUri':{'type':Sequelize[_0x865a('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x865a('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x865a('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 5de0e22..f2ef651 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 _0x7ef6=['startsWith','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','index','map','type','key','model','query','keys','intersection','attributes','fields','length','sort','where','filters','pick','filter','merge','VIRTUAL','VtigerAccount','findAll','rows','catch','show','params','rawAttributes','includeAll','include','options','find','create','body','getConfigurations','findOne','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','VtigerConfiguration','VtigerField','md5','description','moduleName','remoteUri','accessKey','username','slice','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','describe','sessionName','autogenerated','reference','owner','remove','label'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7ef6,0x1e3));var _0x67ef=function(_0x82880a,_0x226960){_0x82880a=_0x82880a-0x0;var _0x46790e=_0x7ef6[_0x82880a];return _0x46790e;};'use strict';var emlformat=require(_0x67ef('0x0'));var rimraf=require(_0x67ef('0x1'));var zipdir=require(_0x67ef('0x2'));var jsonpatch=require(_0x67ef('0x3'));var rp=require(_0x67ef('0x4'));var moment=require(_0x67ef('0x5'));var BPromise=require(_0x67ef('0x6'));var Mustache=require(_0x67ef('0x7'));var util=require(_0x67ef('0x8'));var path=require(_0x67ef('0x9'));var sox=require('sox');var csv=require(_0x67ef('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x67ef('0xb'));var crypto=require(_0x67ef('0xc'));var jsforce=require(_0x67ef('0xd'));var deskjs=require(_0x67ef('0xe'));var toCsv=require(_0x67ef('0xa'));var querystring=require('querystring');var Papa=require(_0x67ef('0xf'));var Redis=require(_0x67ef('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x67ef('0x11'));var as=require(_0x67ef('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x67ef('0x13'))(_0x67ef('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x67ef('0x15'));var db=require(_0x67ef('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xf7075d,_0x10d336){_0x10d336=_0x10d336||0xcc;return function(_0x4273b6){if(_0x4273b6){return _0xf7075d['sendStatus'](_0x10d336);}return _0xf7075d[_0x67ef('0x17')](_0x10d336)['end']();};}function respondWithResult(_0x2e774a,_0x107f81){_0x107f81=_0x107f81||0xc8;return function(_0xf00847){if(_0xf00847){return _0x2e774a[_0x67ef('0x17')](_0x107f81)[_0x67ef('0x18')](_0xf00847);}};}function respondWithFilteredResult(_0x208c68,_0x16c8b6){return function(_0x4797ec){if(_0x4797ec){var _0x11b8a0=typeof _0x16c8b6[_0x67ef('0x19')]===_0x67ef('0x1a')&&typeof _0x16c8b6['limit']===_0x67ef('0x1a');var _0x5af480=_0x4797ec['count'];var _0x2b6df0=_0x11b8a0?0x0:_0x16c8b6[_0x67ef('0x19')];var _0x418f7b=_0x11b8a0?_0x4797ec[_0x67ef('0x1b')]:_0x16c8b6[_0x67ef('0x19')]+_0x16c8b6[_0x67ef('0x1c')];var _0x4ecf36;if(_0x418f7b>=_0x5af480){_0x418f7b=_0x5af480;_0x4ecf36=0xc8;}else{_0x4ecf36=0xce;}_0x208c68[_0x67ef('0x17')](_0x4ecf36);return _0x208c68[_0x67ef('0x1d')](_0x67ef('0x1e'),_0x2b6df0+'-'+_0x418f7b+'/'+_0x5af480)[_0x67ef('0x18')](_0x4797ec);}return null;};}function patchUpdates(_0x1774b4){return function(_0x256bdd){try{jsonpatch[_0x67ef('0x1f')](_0x256bdd,_0x1774b4,!![]);}catch(_0x5d2f8e){return BPromise[_0x67ef('0x20')](_0x5d2f8e);}return _0x256bdd['save']();};}function saveUpdates(_0x45ac43,_0x4a504e){return function(_0x5da15d){if(_0x5da15d){return _0x5da15d[_0x67ef('0x21')](_0x45ac43)[_0x67ef('0x22')](function(_0x4f043f){return _0x4f043f;});}return null;};}function removeEntity(_0x1fb57d,_0x11d6c0){return function(_0x321987){if(_0x321987){return _0x321987[_0x67ef('0x23')]()[_0x67ef('0x22')](function(){_0x1fb57d['status'](0xcc)[_0x67ef('0x24')]();});}};}function handleEntityNotFound(_0x59dbb0,_0x22af88){return function(_0x2c2ddf){if(!_0x2c2ddf){_0x59dbb0[_0x67ef('0x25')](0x194);}return _0x2c2ddf;};}function handleError(_0x79f51c,_0x3a42c7){_0x3a42c7=_0x3a42c7||0x1f4;return function(_0x35c83e){logger[_0x67ef('0x26')](_0x35c83e[_0x67ef('0x27')]);if(_0x35c83e[_0x67ef('0x28')]){delete _0x35c83e['name'];}_0x79f51c[_0x67ef('0x17')](_0x3a42c7)['send'](_0x35c83e);};}exports[_0x67ef('0x29')]=function(_0x3f192d,_0x58fd82){var _0x47277d={},_0x2e852e={},_0x5808d0={'count':0x0,'rows':[]};var _0x5691c6=_[_0x67ef('0x2a')](db['VtigerAccount']['rawAttributes'],function(_0x5802ee){return{'name':_0x5802ee['fieldName'],'type':_0x5802ee[_0x67ef('0x2b')][_0x67ef('0x2c')]};});_0x2e852e[_0x67ef('0x2d')]=_['map'](_0x5691c6,'name');_0x2e852e[_0x67ef('0x2e')]=_[_0x67ef('0x2f')](_0x3f192d['query']);_0x2e852e['filters']=_[_0x67ef('0x30')](_0x2e852e[_0x67ef('0x2d')],_0x2e852e[_0x67ef('0x2e')]);_0x47277d[_0x67ef('0x31')]=_[_0x67ef('0x30')](_0x2e852e[_0x67ef('0x2d')],qs[_0x67ef('0x32')](_0x3f192d[_0x67ef('0x2e')][_0x67ef('0x32')]));_0x47277d['attributes']=_0x47277d['attributes'][_0x67ef('0x33')]?_0x47277d['attributes']:_0x2e852e[_0x67ef('0x2d')];if(!_0x3f192d['query']['hasOwnProperty']('nolimit')){_0x47277d['limit']=qs['limit'](_0x3f192d[_0x67ef('0x2e')][_0x67ef('0x1c')]);_0x47277d[_0x67ef('0x19')]=qs[_0x67ef('0x19')](_0x3f192d[_0x67ef('0x2e')][_0x67ef('0x19')]);}_0x47277d['order']=qs['sort'](_0x3f192d[_0x67ef('0x2e')][_0x67ef('0x34')]);_0x47277d[_0x67ef('0x35')]=qs[_0x67ef('0x36')](_[_0x67ef('0x37')](_0x3f192d[_0x67ef('0x2e')],_0x2e852e[_0x67ef('0x36')]),_0x5691c6);if(_0x3f192d['query'][_0x67ef('0x38')]){_0x47277d[_0x67ef('0x35')]=_[_0x67ef('0x39')](_0x47277d['where'],{'$or':_['map'](_0x5691c6,function(_0x2a8020){if(_0x2a8020['type']!==_0x67ef('0x3a')){var _0x18bead={};_0x18bead[_0x2a8020[_0x67ef('0x28')]]={'$like':'%'+_0x3f192d[_0x67ef('0x2e')]['filter']+'%'};return _0x18bead;}})});}_0x47277d=_[_0x67ef('0x39')]({},_0x47277d,_0x3f192d['options']);var _0x58d561={'where':_0x47277d['where']};return db[_0x67ef('0x3b')]['count'](_0x58d561)[_0x67ef('0x22')](function(_0xf980a4){_0x5808d0[_0x67ef('0x1b')]=_0xf980a4;if(_0x3f192d['query']['includeAll']){_0x47277d['include']=[{'all':!![]}];}return db[_0x67ef('0x3b')][_0x67ef('0x3c')](_0x47277d);})['then'](function(_0x5d7cb9){_0x5808d0[_0x67ef('0x3d')]=_0x5d7cb9;return _0x5808d0;})[_0x67ef('0x22')](respondWithFilteredResult(_0x58fd82,_0x47277d))[_0x67ef('0x3e')](handleError(_0x58fd82,null));};exports[_0x67ef('0x3f')]=function(_0x59b234,_0x503d20){var _0x4f733a={'raw':![],'where':{'id':_0x59b234[_0x67ef('0x40')]['id']}},_0xf940b9={};_0xf940b9[_0x67ef('0x2d')]=_['keys'](db[_0x67ef('0x3b')][_0x67ef('0x41')]);_0xf940b9['query']=_[_0x67ef('0x2f')](_0x59b234['query']);_0xf940b9[_0x67ef('0x36')]=_[_0x67ef('0x30')](_0xf940b9[_0x67ef('0x2d')],_0xf940b9['query']);_0x4f733a[_0x67ef('0x31')]=_['intersection'](_0xf940b9['model'],qs['fields'](_0x59b234[_0x67ef('0x2e')][_0x67ef('0x32')]));_0x4f733a[_0x67ef('0x31')]=_0x4f733a[_0x67ef('0x31')]['length']?_0x4f733a['attributes']:_0xf940b9[_0x67ef('0x2d')];if(_0x59b234[_0x67ef('0x2e')][_0x67ef('0x42')]){_0x4f733a[_0x67ef('0x43')]=[{'all':!![]}];}_0x4f733a=_[_0x67ef('0x39')]({},_0x4f733a,_0x59b234[_0x67ef('0x44')]);return db[_0x67ef('0x3b')][_0x67ef('0x45')](_0x4f733a)[_0x67ef('0x22')](handleEntityNotFound(_0x503d20,null))['then'](respondWithResult(_0x503d20,null))[_0x67ef('0x3e')](handleError(_0x503d20,null));};exports[_0x67ef('0x46')]=function(_0x47bd20,_0x4afa90){return db[_0x67ef('0x3b')][_0x67ef('0x46')](_0x47bd20[_0x67ef('0x47')],{})[_0x67ef('0x22')](respondWithResult(_0x4afa90,0xc9))[_0x67ef('0x3e')](handleError(_0x4afa90,null));};exports[_0x67ef('0x21')]=function(_0x4cc3d7,_0x37753f){if(_0x4cc3d7[_0x67ef('0x47')]['id']){delete _0x4cc3d7[_0x67ef('0x47')]['id'];}return db['VtigerAccount'][_0x67ef('0x45')]({'where':{'id':_0x4cc3d7[_0x67ef('0x40')]['id']}})[_0x67ef('0x22')](handleEntityNotFound(_0x37753f,null))[_0x67ef('0x22')](saveUpdates(_0x4cc3d7[_0x67ef('0x47')],null))[_0x67ef('0x22')](respondWithResult(_0x37753f,null))[_0x67ef('0x3e')](handleError(_0x37753f,null));};exports[_0x67ef('0x23')]=function(_0x2eb74a,_0x440c28){return db[_0x67ef('0x3b')][_0x67ef('0x45')]({'where':{'id':_0x2eb74a['params']['id']}})[_0x67ef('0x22')](handleEntityNotFound(_0x440c28,null))[_0x67ef('0x22')](removeEntity(_0x440c28,null))[_0x67ef('0x3e')](handleError(_0x440c28,null));};exports[_0x67ef('0x48')]=function(_0x4d164f,_0x35d7ee,_0x3bb0ff){var _0x4863d6={};var _0x54b3da={};var _0x35629c;var _0x47416f;return db[_0x67ef('0x3b')][_0x67ef('0x49')]({'where':{'id':_0x4d164f['params']['id']}})['then'](handleEntityNotFound(_0x35d7ee,null))[_0x67ef('0x22')](function(_0x2f8134){if(_0x2f8134){_0x35629c=_0x2f8134;_0x54b3da[_0x67ef('0x2d')]=_[_0x67ef('0x2f')](db['VtigerConfiguration']['rawAttributes']);_0x54b3da[_0x67ef('0x2e')]=_[_0x67ef('0x2f')](_0x4d164f[_0x67ef('0x2e')]);_0x54b3da[_0x67ef('0x36')]=_[_0x67ef('0x30')](_0x54b3da[_0x67ef('0x2d')],_0x54b3da['query']);_0x4863d6[_0x67ef('0x31')]=_['intersection'](_0x54b3da[_0x67ef('0x2d')],qs['fields'](_0x4d164f[_0x67ef('0x2e')][_0x67ef('0x32')]));_0x4863d6[_0x67ef('0x31')]=_0x4863d6[_0x67ef('0x31')][_0x67ef('0x33')]?_0x4863d6['attributes']:_0x54b3da[_0x67ef('0x2d')];_0x4863d6['order']=qs['sort'](_0x4d164f['query'][_0x67ef('0x34')]);_0x4863d6[_0x67ef('0x35')]=qs['filters'](_[_0x67ef('0x37')](_0x4d164f[_0x67ef('0x2e')],_0x54b3da[_0x67ef('0x36')]));if(_0x4d164f[_0x67ef('0x2e')][_0x67ef('0x38')]){_0x4863d6['where']=_[_0x67ef('0x39')](_0x4863d6['where'],{'$or':_['map'](_0x4863d6[_0x67ef('0x31')],function(_0x3ac1d2){var _0x5111e9={};_0x5111e9[_0x3ac1d2]={'$like':'%'+_0x4d164f[_0x67ef('0x2e')][_0x67ef('0x38')]+'%'};return _0x5111e9;})});}_0x4863d6=_['merge']({},_0x4863d6,_0x4d164f[_0x67ef('0x44')]);return _0x35629c['getConfigurations'](_0x4863d6);}})[_0x67ef('0x22')](function(_0xf3afc){if(_0xf3afc){_0x47416f=_0xf3afc[_0x67ef('0x33')];if(!_0x4d164f['query'][_0x67ef('0x4a')]('nolimit')){_0x4863d6[_0x67ef('0x1c')]=qs[_0x67ef('0x1c')](_0x4d164f['query'][_0x67ef('0x1c')]);_0x4863d6[_0x67ef('0x19')]=qs[_0x67ef('0x19')](_0x4d164f['query'][_0x67ef('0x19')]);}return _0x35629c[_0x67ef('0x48')](_0x4863d6);}})[_0x67ef('0x22')](function(_0x337a65){if(_0x337a65){return _0x337a65?{'count':_0x47416f,'rows':_0x337a65}:null;}})[_0x67ef('0x22')](respondWithResult(_0x35d7ee,null))[_0x67ef('0x3e')](handleError(_0x35d7ee,null));};exports[_0x67ef('0x4b')]=function(_0x5e41d8,_0x27b5cf,_0x53105c){if(_0x5e41d8[_0x67ef('0x47')]['id']){delete _0x5e41d8[_0x67ef('0x47')]['id'];}return db[_0x67ef('0x3b')][_0x67ef('0x49')]({'where':{'id':_0x5e41d8[_0x67ef('0x40')]['id']}})[_0x67ef('0x22')](handleEntityNotFound(_0x27b5cf,null))[_0x67ef('0x22')](function(_0x4550c8){if(_0x4550c8){_0x5e41d8[_0x67ef('0x47')][_0x67ef('0x4c')]=_0x4550c8['id'];_0x5e41d8[_0x67ef('0x47')][_0x67ef('0x4d')]=integrations[_0x67ef('0x4e')](_0x5e41d8[_0x67ef('0x47')][_0x67ef('0x4f')],_0x5e41d8[_0x67ef('0x47')][_0x67ef('0x2b')]);_0x5e41d8[_0x67ef('0x47')]['Descriptions']=integrations[_0x67ef('0x50')](_0x5e41d8['body'][_0x67ef('0x4f')],_0x5e41d8['body']['type']);return db[_0x67ef('0x51')][_0x67ef('0x46')](_0x5e41d8[_0x67ef('0x47')],{'include':[{'model':db['VtigerField'],'as':_0x67ef('0x4d')},{'model':db[_0x67ef('0x52')],'as':'Descriptions'}]});}return null;})[_0x67ef('0x22')](respondWithResult(_0x27b5cf,null))[_0x67ef('0x3e')](handleError(_0x27b5cf,null));};var md5=require(_0x67ef('0x53'));exports['getFields']=function(_0xcc9bec,_0x3a2ada,_0x2f5683){var _0x30b05e=null;var _0xaf329=null;var _0x410320=null;var _0xb3f1e4=null;var _0x6df168='';return db['VtigerAccount'][_0x67ef('0x49')]({'where':{'id':_0xcc9bec[_0x67ef('0x40')]['id']},'attributes':['id',_0x67ef('0x28'),'username',_0x67ef('0x54'),_0x67ef('0x55'),_0x67ef('0x56'),'serverUrl',_0x67ef('0x57')]})[_0x67ef('0x22')](handleEntityNotFound(_0x3a2ada,null))[_0x67ef('0x22')](function(_0x2ff1dd){if(_0x2ff1dd){_0x30b05e=_0x2ff1dd[_0x67ef('0x58')];_0xaf329=_0x2ff1dd['accessKey'];_0x410320=_0x2ff1dd[_0x67ef('0x55')];_0x6df168=_0x2ff1dd[_0x67ef('0x56')];var _0x1a8567=_0x6df168[_0x67ef('0x59')](-0x1);if(_0x1a8567==='/'){_0x6df168=_0x6df168['substring'](0x0,_0x6df168[_0x67ef('0x5a')](_0x1a8567));}_0xb3f1e4=util[_0x67ef('0x5b')](_0x67ef('0x5c'),_0x6df168);var _0x4f6d45={'method':_0x67ef('0x5d'),'uri':_0xb3f1e4,'qs':{'operation':_0x67ef('0x5e'),'username':_0x2ff1dd[_0x67ef('0x58')]},'json':!![]};return rp(_0x4f6d45);}})[_0x67ef('0x22')](function(_0x495488){if(_0x495488[_0x67ef('0x5f')]){var _0x573e2a={'method':_0x67ef('0x60'),'uri':_0xb3f1e4,'form':{'operation':_0x67ef('0x61'),'username':_0x30b05e,'accessKey':md5(_0x495488[_0x67ef('0x62')][_0x67ef('0x63')]+_0xaf329)},'json':!![]};return rp(_0x573e2a);}})[_0x67ef('0x22')](function(_0xb7af5c){if(_0xb7af5c['success']){var _0x48c6bf={'method':_0x67ef('0x5d'),'uri':_0xb3f1e4,'qs':{'operation':_0x67ef('0x64'),'username':_0x30b05e,'sessionName':_0xb7af5c[_0x67ef('0x62')][_0x67ef('0x65')],'elementType':_0x410320},'json':!![]};return rp(_0x48c6bf);}})[_0x67ef('0x22')](function(_0xa06b3){if(_0xa06b3[_0x67ef('0x5f')]){var _0xbe55bb=[_0x67ef('0x66'),_0x67ef('0x67'),_0x67ef('0x68')];_[_0x67ef('0x69')](_0xa06b3['result'][_0x67ef('0x32')],function(_0x41e94a){return _0xbe55bb['includes'](_0x41e94a[_0x67ef('0x2b')][_0x67ef('0x28')]);});_[_0x67ef('0x69')](_0xa06b3[_0x67ef('0x62')][_0x67ef('0x32')],function(_0x54ead8){return _0x54ead8['editable']==='false';});return{'count':_0xa06b3[_0x67ef('0x62')][_0x67ef('0x32')][_0x67ef('0x33')],'rows':_['map'](_0xa06b3[_0x67ef('0x62')][_0x67ef('0x32')],function(_0x3112b7){return{'id':_0x3112b7[_0x67ef('0x28')],'name':_0x3112b7[_0x67ef('0x6a')],'custom':_[_0x67ef('0x6b')](_0x3112b7['name'],'cf_')?!![]:![],'options':_0x3112b7['type'][_0x67ef('0x28')]===_0x67ef('0x6c')&&_0x3112b7[_0x67ef('0x2b')]['picklistValues'][_0x67ef('0x33')]>0x0?_['map'](_0x3112b7[_0x67ef('0x2b')][_0x67ef('0x6d')],function(_0x20d3c5){return{'name':_0x20d3c5[_0x67ef('0x6a')],'value':_0x20d3c5[_0x67ef('0x6e')]};}):[]};})};}})[_0x67ef('0x22')](respondWithResult(_0x3a2ada,null))[_0x67ef('0x3e')](function(_0x47a140){console[_0x67ef('0x6f')](_0x67ef('0x70')+_0x47a140);var _0x588a47=_0xcc9bec[_0x67ef('0x2e')][_0x67ef('0x71')]?0x1f4:_0x47a140['statusCode']||0x1f4;logger[_0x67ef('0x26')](_0x67ef('0x72'),'getFields',_0x588a47,JSON[_0x67ef('0x73')](_0x47a140));delete _0x47a140[_0x67ef('0x28')];if(_0x588a47===0x191){_0x588a47=0x190;}_0x3a2ada[_0x67ef('0x17')](_0x588a47)[_0x67ef('0x74')](_0xcc9bec[_0x67ef('0x2e')][_0x67ef('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x47a140[_0x67ef('0x75')]}:_0x47a140);});}; \ No newline at end of file +var _0x3901=['nolimit','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','VtigerConfiguration','VtigerField','Descriptions','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','format','%s/webservice.php','GET','success','POST','login','result','token','describe','sessionName','autogenerated','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','test','getFields,\x20%s,\x20%s,\x20%s','stringify','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','hasOwnProperty','order','where','pick','VIRTUAL','filter','merge','VtigerAccount','findAll','rows','catch','show','params','fields','length','includeAll','include','find','create','body','getConfigurations','sort','options'];(function(_0x185cb0,_0x341d05){var _0x313f11=function(_0x3c5a60){while(--_0x3c5a60){_0x185cb0['push'](_0x185cb0['shift']());}};_0x313f11(++_0x341d05);}(_0x3901,0x12a));var _0x1390=function(_0x3e705b,_0x461287){_0x3e705b=_0x3e705b-0x0;var _0x111d59=_0x3901[_0x3e705b];return _0x111d59;};'use strict';var emlformat=require(_0x1390('0x0'));var rimraf=require(_0x1390('0x1'));var zipdir=require(_0x1390('0x2'));var jsonpatch=require(_0x1390('0x3'));var rp=require(_0x1390('0x4'));var moment=require(_0x1390('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1390('0x6'));var path=require(_0x1390('0x7'));var sox=require(_0x1390('0x8'));var csv=require(_0x1390('0x9'));var ejs=require(_0x1390('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1390('0xb'));var squel=require(_0x1390('0xc'));var crypto=require(_0x1390('0xd'));var jsforce=require(_0x1390('0xe'));var deskjs=require(_0x1390('0xf'));var toCsv=require(_0x1390('0x9'));var querystring=require('querystring');var Papa=require(_0x1390('0x10'));var Redis=require(_0x1390('0x11'));var authService=require(_0x1390('0x12'));var qs=require(_0x1390('0x13'));var as=require(_0x1390('0x14'));var hardwareService=require(_0x1390('0x15'));var logger=require(_0x1390('0x16'))(_0x1390('0x17'));var utils=require(_0x1390('0x18'));var config=require(_0x1390('0x19'));var licenseUtil=require(_0x1390('0x1a'));var db=require(_0x1390('0x1b'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4e1877,_0x436fe0){_0x436fe0=_0x436fe0||0xcc;return function(_0x2127ef){if(_0x2127ef){return _0x4e1877[_0x1390('0x1c')](_0x436fe0);}return _0x4e1877[_0x1390('0x1d')](_0x436fe0)[_0x1390('0x1e')]();};}function respondWithResult(_0x29ce2a,_0x497c41){_0x497c41=_0x497c41||0xc8;return function(_0x416fba){if(_0x416fba){return _0x29ce2a[_0x1390('0x1d')](_0x497c41)[_0x1390('0x1f')](_0x416fba);}};}function respondWithFilteredResult(_0x4c81e6,_0x32c98f){return function(_0x342447){if(_0x342447){var _0x19a663=typeof _0x32c98f[_0x1390('0x20')]===_0x1390('0x21')&&typeof _0x32c98f['limit']==='undefined';var _0x4f82ed=_0x342447[_0x1390('0x22')];var _0x2faaca=_0x19a663?0x0:_0x32c98f['offset'];var _0x33455d=_0x19a663?_0x342447[_0x1390('0x22')]:_0x32c98f[_0x1390('0x20')]+_0x32c98f[_0x1390('0x23')];var _0x3d51f0;if(_0x33455d>=_0x4f82ed){_0x33455d=_0x4f82ed;_0x3d51f0=0xc8;}else{_0x3d51f0=0xce;}_0x4c81e6['status'](_0x3d51f0);return _0x4c81e6[_0x1390('0x24')]('Content-Range',_0x2faaca+'-'+_0x33455d+'/'+_0x4f82ed)['json'](_0x342447);}return null;};}function patchUpdates(_0xdabe33){return function(_0x316708){try{jsonpatch['apply'](_0x316708,_0xdabe33,!![]);}catch(_0x585737){return BPromise[_0x1390('0x25')](_0x585737);}return _0x316708[_0x1390('0x26')]();};}function saveUpdates(_0x38702d,_0x563fd3){return function(_0x481d78){if(_0x481d78){return _0x481d78[_0x1390('0x27')](_0x38702d)[_0x1390('0x28')](function(_0x5646fb){return _0x5646fb;});}return null;};}function removeEntity(_0x58457a,_0x1bd0c7){return function(_0x1f7f8a){if(_0x1f7f8a){return _0x1f7f8a[_0x1390('0x29')]()['then'](function(){_0x58457a[_0x1390('0x1d')](0xcc)[_0x1390('0x1e')]();});}};}function handleEntityNotFound(_0x451f0b,_0x555691){return function(_0x3e2a9b){if(!_0x3e2a9b){_0x451f0b['sendStatus'](0x194);}return _0x3e2a9b;};}function handleError(_0x26e5a5,_0x4bebd5){_0x4bebd5=_0x4bebd5||0x1f4;return function(_0x58c0c7){logger[_0x1390('0x2a')](_0x58c0c7[_0x1390('0x2b')]);if(_0x58c0c7['name']){delete _0x58c0c7[_0x1390('0x2c')];}_0x26e5a5['status'](_0x4bebd5)['send'](_0x58c0c7);};}exports[_0x1390('0x2d')]=function(_0x4d03b0,_0x2d3e61){var _0x55ee29={},_0x253a4d={},_0x22e5fc={'count':0x0,'rows':[]};var _0x2aa491=_[_0x1390('0x2e')](db['VtigerAccount'][_0x1390('0x2f')],function(_0x470de0){return{'name':_0x470de0[_0x1390('0x30')],'type':_0x470de0[_0x1390('0x31')][_0x1390('0x32')]};});_0x253a4d[_0x1390('0x33')]=_['map'](_0x2aa491,'name');_0x253a4d[_0x1390('0x34')]=_[_0x1390('0x35')](_0x4d03b0[_0x1390('0x34')]);_0x253a4d[_0x1390('0x36')]=_['intersection'](_0x253a4d[_0x1390('0x33')],_0x253a4d['query']);_0x55ee29[_0x1390('0x37')]=_[_0x1390('0x38')](_0x253a4d['model'],qs['fields'](_0x4d03b0[_0x1390('0x34')]['fields']));_0x55ee29[_0x1390('0x37')]=_0x55ee29[_0x1390('0x37')]['length']?_0x55ee29[_0x1390('0x37')]:_0x253a4d[_0x1390('0x33')];if(!_0x4d03b0['query'][_0x1390('0x39')]('nolimit')){_0x55ee29[_0x1390('0x23')]=qs['limit'](_0x4d03b0[_0x1390('0x34')][_0x1390('0x23')]);_0x55ee29['offset']=qs['offset'](_0x4d03b0[_0x1390('0x34')][_0x1390('0x20')]);}_0x55ee29[_0x1390('0x3a')]=qs['sort'](_0x4d03b0[_0x1390('0x34')]['sort']);_0x55ee29[_0x1390('0x3b')]=qs['filters'](_[_0x1390('0x3c')](_0x4d03b0[_0x1390('0x34')],_0x253a4d[_0x1390('0x36')]),_0x2aa491);if(_0x4d03b0[_0x1390('0x34')]['filter']){_0x55ee29[_0x1390('0x3b')]=_['merge'](_0x55ee29[_0x1390('0x3b')],{'$or':_[_0x1390('0x2e')](_0x2aa491,function(_0x5a95ef){if(_0x5a95ef[_0x1390('0x31')]!==_0x1390('0x3d')){var _0x4adaf5={};_0x4adaf5[_0x5a95ef[_0x1390('0x2c')]]={'$like':'%'+_0x4d03b0[_0x1390('0x34')][_0x1390('0x3e')]+'%'};return _0x4adaf5;}})});}_0x55ee29=_[_0x1390('0x3f')]({},_0x55ee29,_0x4d03b0['options']);var _0x197dea={'where':_0x55ee29['where']};return db[_0x1390('0x40')][_0x1390('0x22')](_0x197dea)[_0x1390('0x28')](function(_0x427480){_0x22e5fc[_0x1390('0x22')]=_0x427480;if(_0x4d03b0['query']['includeAll']){_0x55ee29['include']=[{'all':!![]}];}return db[_0x1390('0x40')][_0x1390('0x41')](_0x55ee29);})[_0x1390('0x28')](function(_0x5d8f68){_0x22e5fc[_0x1390('0x42')]=_0x5d8f68;return _0x22e5fc;})['then'](respondWithFilteredResult(_0x2d3e61,_0x55ee29))[_0x1390('0x43')](handleError(_0x2d3e61,null));};exports[_0x1390('0x44')]=function(_0x402ff1,_0x2ea5d7){var _0x3f41a7={'raw':![],'where':{'id':_0x402ff1[_0x1390('0x45')]['id']}},_0x340862={};_0x340862[_0x1390('0x33')]=_[_0x1390('0x35')](db[_0x1390('0x40')][_0x1390('0x2f')]);_0x340862[_0x1390('0x34')]=_['keys'](_0x402ff1['query']);_0x340862[_0x1390('0x36')]=_[_0x1390('0x38')](_0x340862[_0x1390('0x33')],_0x340862[_0x1390('0x34')]);_0x3f41a7[_0x1390('0x37')]=_[_0x1390('0x38')](_0x340862[_0x1390('0x33')],qs[_0x1390('0x46')](_0x402ff1['query']['fields']));_0x3f41a7[_0x1390('0x37')]=_0x3f41a7['attributes'][_0x1390('0x47')]?_0x3f41a7[_0x1390('0x37')]:_0x340862[_0x1390('0x33')];if(_0x402ff1[_0x1390('0x34')][_0x1390('0x48')]){_0x3f41a7[_0x1390('0x49')]=[{'all':!![]}];}_0x3f41a7=_[_0x1390('0x3f')]({},_0x3f41a7,_0x402ff1['options']);return db[_0x1390('0x40')][_0x1390('0x4a')](_0x3f41a7)[_0x1390('0x28')](handleEntityNotFound(_0x2ea5d7,null))[_0x1390('0x28')](respondWithResult(_0x2ea5d7,null))['catch'](handleError(_0x2ea5d7,null));};exports[_0x1390('0x4b')]=function(_0x2b1d42,_0x9184dc){return db['VtigerAccount'][_0x1390('0x4b')](_0x2b1d42['body'],{})['then'](respondWithResult(_0x9184dc,0xc9))[_0x1390('0x43')](handleError(_0x9184dc,null));};exports['update']=function(_0x3cacfc,_0x276e7b){if(_0x3cacfc[_0x1390('0x4c')]['id']){delete _0x3cacfc[_0x1390('0x4c')]['id'];}return db['VtigerAccount'][_0x1390('0x4a')]({'where':{'id':_0x3cacfc[_0x1390('0x45')]['id']}})[_0x1390('0x28')](handleEntityNotFound(_0x276e7b,null))['then'](saveUpdates(_0x3cacfc[_0x1390('0x4c')],null))[_0x1390('0x28')](respondWithResult(_0x276e7b,null))[_0x1390('0x43')](handleError(_0x276e7b,null));};exports[_0x1390('0x29')]=function(_0x1915a9,_0x473dcc){return db[_0x1390('0x40')][_0x1390('0x4a')]({'where':{'id':_0x1915a9[_0x1390('0x45')]['id']}})[_0x1390('0x28')](handleEntityNotFound(_0x473dcc,null))[_0x1390('0x28')](removeEntity(_0x473dcc,null))[_0x1390('0x43')](handleError(_0x473dcc,null));};exports[_0x1390('0x4d')]=function(_0xaecfd3,_0x3cd3a3,_0x956704){var _0x23f4f5={};var _0x14e959={};var _0x19f20f;var _0x3d78e7;return db[_0x1390('0x40')]['findOne']({'where':{'id':_0xaecfd3[_0x1390('0x45')]['id']}})[_0x1390('0x28')](handleEntityNotFound(_0x3cd3a3,null))[_0x1390('0x28')](function(_0x430117){if(_0x430117){_0x19f20f=_0x430117;_0x14e959[_0x1390('0x33')]=_[_0x1390('0x35')](db['VtigerConfiguration'][_0x1390('0x2f')]);_0x14e959[_0x1390('0x34')]=_[_0x1390('0x35')](_0xaecfd3[_0x1390('0x34')]);_0x14e959[_0x1390('0x36')]=_[_0x1390('0x38')](_0x14e959[_0x1390('0x33')],_0x14e959['query']);_0x23f4f5[_0x1390('0x37')]=_['intersection'](_0x14e959[_0x1390('0x33')],qs['fields'](_0xaecfd3[_0x1390('0x34')][_0x1390('0x46')]));_0x23f4f5[_0x1390('0x37')]=_0x23f4f5[_0x1390('0x37')][_0x1390('0x47')]?_0x23f4f5[_0x1390('0x37')]:_0x14e959['model'];_0x23f4f5['order']=qs[_0x1390('0x4e')](_0xaecfd3[_0x1390('0x34')][_0x1390('0x4e')]);_0x23f4f5[_0x1390('0x3b')]=qs[_0x1390('0x36')](_[_0x1390('0x3c')](_0xaecfd3[_0x1390('0x34')],_0x14e959['filters']));if(_0xaecfd3[_0x1390('0x34')][_0x1390('0x3e')]){_0x23f4f5[_0x1390('0x3b')]=_[_0x1390('0x3f')](_0x23f4f5[_0x1390('0x3b')],{'$or':_[_0x1390('0x2e')](_0x23f4f5[_0x1390('0x37')],function(_0x1e1b0f){var _0x4f8572={};_0x4f8572[_0x1e1b0f]={'$like':'%'+_0xaecfd3['query']['filter']+'%'};return _0x4f8572;})});}_0x23f4f5=_[_0x1390('0x3f')]({},_0x23f4f5,_0xaecfd3[_0x1390('0x4f')]);return _0x19f20f['getConfigurations'](_0x23f4f5);}})['then'](function(_0x54a2bc){if(_0x54a2bc){_0x3d78e7=_0x54a2bc[_0x1390('0x47')];if(!_0xaecfd3[_0x1390('0x34')][_0x1390('0x39')](_0x1390('0x50'))){_0x23f4f5['limit']=qs[_0x1390('0x23')](_0xaecfd3['query'][_0x1390('0x23')]);_0x23f4f5[_0x1390('0x20')]=qs[_0x1390('0x20')](_0xaecfd3['query'][_0x1390('0x20')]);}return _0x19f20f[_0x1390('0x4d')](_0x23f4f5);}})[_0x1390('0x28')](function(_0x1e3086){if(_0x1e3086){return _0x1e3086?{'count':_0x3d78e7,'rows':_0x1e3086}:null;}})[_0x1390('0x28')](respondWithResult(_0x3cd3a3,null))[_0x1390('0x43')](handleError(_0x3cd3a3,null));};exports[_0x1390('0x51')]=function(_0x2eb0d2,_0x52b4e5,_0x8dbcde){if(_0x2eb0d2[_0x1390('0x4c')]['id']){delete _0x2eb0d2[_0x1390('0x4c')]['id'];}return db[_0x1390('0x40')][_0x1390('0x52')]({'where':{'id':_0x2eb0d2[_0x1390('0x45')]['id']}})[_0x1390('0x28')](handleEntityNotFound(_0x52b4e5,null))[_0x1390('0x28')](function(_0x40f575){if(_0x40f575){_0x2eb0d2[_0x1390('0x4c')][_0x1390('0x53')]=_0x40f575['id'];_0x2eb0d2[_0x1390('0x4c')][_0x1390('0x54')]=integrations[_0x1390('0x55')](_0x2eb0d2['body'][_0x1390('0x56')],_0x2eb0d2[_0x1390('0x4c')][_0x1390('0x31')]);_0x2eb0d2['body']['Descriptions']=integrations[_0x1390('0x57')](_0x2eb0d2[_0x1390('0x4c')][_0x1390('0x56')],_0x2eb0d2[_0x1390('0x4c')][_0x1390('0x31')]);return db[_0x1390('0x58')]['create'](_0x2eb0d2[_0x1390('0x4c')],{'include':[{'model':db['VtigerField'],'as':_0x1390('0x54')},{'model':db[_0x1390('0x59')],'as':_0x1390('0x5a')}]});}return null;})[_0x1390('0x28')](respondWithResult(_0x52b4e5,null))[_0x1390('0x43')](handleError(_0x52b4e5,null));};var md5=require(_0x1390('0x5b'));exports[_0x1390('0x5c')]=function(_0x32168c,_0x428083,_0x3ea6b7){var _0x2ad60b=null;var _0x3df232=null;var _0x40219d=null;var _0x521ff7=null;var _0x5cfedf='';return db[_0x1390('0x40')][_0x1390('0x52')]({'where':{'id':_0x32168c[_0x1390('0x45')]['id']},'attributes':['id',_0x1390('0x2c'),_0x1390('0x5d'),_0x1390('0x5e'),_0x1390('0x5f'),_0x1390('0x60'),_0x1390('0x61'),_0x1390('0x62')]})['then'](handleEntityNotFound(_0x428083,null))[_0x1390('0x28')](function(_0x756837){if(_0x756837){_0x2ad60b=_0x756837['username'];_0x3df232=_0x756837[_0x1390('0x62')];_0x40219d=_0x756837[_0x1390('0x5f')];_0x5cfedf=_0x756837[_0x1390('0x60')];var _0xfbef8c=_0x5cfedf[_0x1390('0x63')](-0x1);if(_0xfbef8c==='/'){_0x5cfedf=_0x5cfedf['substring'](0x0,_0x5cfedf['lastIndexOf'](_0xfbef8c));}_0x521ff7=util[_0x1390('0x64')](_0x1390('0x65'),_0x5cfedf);var _0x4aab6e={'method':_0x1390('0x66'),'uri':_0x521ff7,'qs':{'operation':'getchallenge','username':_0x756837[_0x1390('0x5d')]},'json':!![]};return rp(_0x4aab6e);}})[_0x1390('0x28')](function(_0x92673d){if(_0x92673d[_0x1390('0x67')]){var _0x5ed5df={'method':_0x1390('0x68'),'uri':_0x521ff7,'form':{'operation':_0x1390('0x69'),'username':_0x2ad60b,'accessKey':md5(_0x92673d[_0x1390('0x6a')][_0x1390('0x6b')]+_0x3df232)},'json':!![]};return rp(_0x5ed5df);}})[_0x1390('0x28')](function(_0x33cc31){if(_0x33cc31[_0x1390('0x67')]){var _0x4ec5cf={'method':_0x1390('0x66'),'uri':_0x521ff7,'qs':{'operation':_0x1390('0x6c'),'username':_0x2ad60b,'sessionName':_0x33cc31[_0x1390('0x6a')][_0x1390('0x6d')],'elementType':_0x40219d},'json':!![]};return rp(_0x4ec5cf);}})[_0x1390('0x28')](function(_0x1e8fc5){if(_0x1e8fc5[_0x1390('0x67')]){var _0x809ce7=[_0x1390('0x6e'),_0x1390('0x6f'),_0x1390('0x70')];_[_0x1390('0x71')](_0x1e8fc5[_0x1390('0x6a')][_0x1390('0x46')],function(_0x3971e9){return _0x809ce7[_0x1390('0x72')](_0x3971e9[_0x1390('0x31')][_0x1390('0x2c')]);});_['remove'](_0x1e8fc5['result'][_0x1390('0x46')],function(_0x945ab5){return _0x945ab5[_0x1390('0x73')]===_0x1390('0x74');});return{'count':_0x1e8fc5[_0x1390('0x6a')][_0x1390('0x46')]['length'],'rows':_['map'](_0x1e8fc5[_0x1390('0x6a')][_0x1390('0x46')],function(_0x36c5ab){return{'id':_0x36c5ab[_0x1390('0x2c')],'name':_0x36c5ab[_0x1390('0x75')],'custom':_[_0x1390('0x76')](_0x36c5ab[_0x1390('0x2c')],_0x1390('0x77'))?!![]:![],'options':_0x36c5ab[_0x1390('0x31')][_0x1390('0x2c')]===_0x1390('0x78')&&_0x36c5ab[_0x1390('0x31')][_0x1390('0x79')][_0x1390('0x47')]>0x0?_['map'](_0x36c5ab[_0x1390('0x31')][_0x1390('0x79')],function(_0x415d16){return{'name':_0x415d16['label'],'value':_0x415d16['value']};}):[]};})};}})['then'](respondWithResult(_0x428083,null))[_0x1390('0x43')](function(_0x588c98){console['log']('vTiger\x20error:\x20'+_0x588c98);var _0x3985f8=_0x32168c[_0x1390('0x34')][_0x1390('0x7a')]?0x1f4:_0x588c98['statusCode']||0x1f4;logger['error'](_0x1390('0x7b'),_0x1390('0x5c'),_0x3985f8,JSON[_0x1390('0x7c')](_0x588c98));delete _0x588c98[_0x1390('0x2c')];if(_0x3985f8===0x191){_0x3985f8=0x190;}_0x428083[_0x1390('0x1d')](_0x3985f8)['send'](_0x32168c[_0x1390('0x34')][_0x1390('0x7a')]?{'message':'Wrong\x20credentials','statusCode':_0x588c98[_0x1390('0x7d')]}:_0x588c98);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index c1262d8..b32a6e9 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 _0xbce7=['api','bluebird','path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','lodash','util','../../config/logger'];(function(_0x582783,_0x15bd71){var _0x1fa86e=function(_0x21e9b7){while(--_0x21e9b7){_0x582783['push'](_0x582783['shift']());}};_0x1fa86e(++_0x15bd71);}(_0xbce7,0x15b));var _0x7bce=function(_0x4985af,_0x1ac7db){_0x4985af=_0x4985af-0x0;var _0x5ccae6=_0xbce7[_0x4985af];return _0x5ccae6;};'use strict';var _=require(_0x7bce('0x0'));var util=require(_0x7bce('0x1'));var logger=require(_0x7bce('0x2'))(_0x7bce('0x3'));var moment=require('moment');var BPromise=require(_0x7bce('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7bce('0x5'));var rimraf=require('rimraf');var config=require(_0x7bce('0x6'));var attributes=require(_0x7bce('0x7'));var integrations=require(_0x7bce('0x8'));module['exports']=function(_0x38c49b,_0x3887ee){return _0x38c49b[_0x7bce('0x9')]('VtigerAccount',attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xca83=['../../config/logger','api','moment','bluebird','path','../../config/environment','./intVtigerAccount.attributes','exports','define','int_vtiger_accounts','lodash'];(function(_0x475181,_0x413858){var _0x496f65=function(_0x36f8c4){while(--_0x36f8c4){_0x475181['push'](_0x475181['shift']());}};_0x496f65(++_0x413858);}(_0xca83,0x99));var _0x3ca8=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0xca83[_0x2adbeb];return _0x5e18a6;};'use strict';var _=require(_0x3ca8('0x0'));var util=require('util');var logger=require(_0x3ca8('0x1'))(_0x3ca8('0x2'));var moment=require(_0x3ca8('0x3'));var BPromise=require(_0x3ca8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3ca8('0x5'));var rimraf=require('rimraf');var config=require(_0x3ca8('0x6'));var attributes=require(_0x3ca8('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x3ca8('0x8')]=function(_0x2a2c0b,_0x5272ae){return _0x2a2c0b[_0x3ca8('0x9')]('VtigerAccount',attributes,{'tableName':_0x3ca8('0xa'),'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 55595a9..4be6d55 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 _0xc788=['request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','error','message','VtigerAccount,\x20%s,\x20%s','result','catch','GetVtigerAccount','options','raw','where','attributes','limit','include','map','model','debug','stringify','ShowVtigerAccount','VtigerAccount','find','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x40b2c8,_0x2fc5d8){var _0x242ccf=function(_0x37c867){while(--_0x37c867){_0x40b2c8['push'](_0x40b2c8['shift']());}};_0x242ccf(++_0x2fc5d8);}(_0xc788,0xc4));var _0x8c78=function(_0x310a1b,_0x4c9129){_0x310a1b=_0x310a1b-0x0;var _0xdea206=_0xc788[_0x310a1b];return _0xdea206;};'use strict';var _=require(_0x8c78('0x0'));var util=require(_0x8c78('0x1'));var moment=require(_0x8c78('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c78('0x3'));var db=require(_0x8c78('0x4'))['db'];var utils=require(_0x8c78('0x5'));var logger=require(_0x8c78('0x6'))(_0x8c78('0x7'));var config=require('../../config/environment');var jayson=require(_0x8c78('0x8'));var client=jayson[_0x8c78('0x9')][_0x8c78('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ac27f,_0x205cc1,_0x4d54a5){return new BPromise(function(_0x247188,_0x299d9d){return client[_0x8c78('0xb')](_0x1ac27f,_0x4d54a5)[_0x8c78('0xc')](function(_0xdb0c17){logger[_0x8c78('0xd')]('VtigerAccount,\x20%s,\x20%s',_0x205cc1,_0x8c78('0xe'));logger['debug'](_0x8c78('0xf'),_0x205cc1,_0x8c78('0xe'),JSON['stringify'](_0xdb0c17));if(_0xdb0c17[_0x8c78('0x10')]){if(_0xdb0c17[_0x8c78('0x10')]['code']===0x1f4){logger[_0x8c78('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x205cc1,_0xdb0c17['error'][_0x8c78('0x11')]);return _0x299d9d(_0xdb0c17[_0x8c78('0x10')][_0x8c78('0x11')]);}logger[_0x8c78('0x10')](_0x8c78('0x12'),_0x205cc1,_0xdb0c17[_0x8c78('0x10')][_0x8c78('0x11')]);return _0x247188(_0xdb0c17[_0x8c78('0x10')][_0x8c78('0x11')]);}else{logger[_0x8c78('0xd')]('VtigerAccount,\x20%s,\x20%s',_0x205cc1,_0x8c78('0xe'));_0x247188(_0xdb0c17[_0x8c78('0x13')]['message']);}})[_0x8c78('0x14')](function(_0x554464){logger[_0x8c78('0x10')](_0x8c78('0x12'),_0x205cc1,_0x554464);_0x299d9d(_0x554464);});});}exports[_0x8c78('0x15')]=function(_0x461eff){var _0x54eafa=this;return new Promise(function(_0x4f7bf9,_0x339d04){return db['VtigerAccount']['findAll']({'raw':_0x461eff[_0x8c78('0x16')]?_0x461eff['options'][_0x8c78('0x17')]===undefined?!![]:![]:!![],'where':_0x461eff[_0x8c78('0x16')]?_0x461eff['options'][_0x8c78('0x18')]||null:null,'attributes':_0x461eff['options']?_0x461eff[_0x8c78('0x16')][_0x8c78('0x19')]||null:null,'limit':_0x461eff['options']?_0x461eff[_0x8c78('0x16')][_0x8c78('0x1a')]||null:null,'include':_0x461eff['options']?_0x461eff[_0x8c78('0x16')][_0x8c78('0x1b')]?_[_0x8c78('0x1c')](_0x461eff[_0x8c78('0x16')][_0x8c78('0x1b')],function(_0x20f483){return{'model':db[_0x20f483[_0x8c78('0x1d')]],'as':_0x20f483['as'],'attributes':_0x20f483[_0x8c78('0x19')],'include':_0x20f483[_0x8c78('0x1b')]?_['map'](_0x20f483[_0x8c78('0x1b')],function(_0x458763){return{'model':db[_0x458763[_0x8c78('0x1d')]],'as':_0x458763['as'],'attributes':_0x458763['attributes'],'include':_0x458763[_0x8c78('0x1b')]?_['map'](_0x458763[_0x8c78('0x1b')],function(_0x24f9a7){return{'model':db[_0x24f9a7[_0x8c78('0x1d')]],'as':_0x24f9a7['as'],'attributes':_0x24f9a7['attributes']};}):[]};}):[]};}):[]:[]})[_0x8c78('0xc')](function(_0x2568d5){logger['info'](_0x8c78('0x15'),_0x461eff);logger[_0x8c78('0x1e')](_0x8c78('0x15'),_0x461eff,JSON[_0x8c78('0x1f')](_0x2568d5));_0x4f7bf9(_0x2568d5);})[_0x8c78('0x14')](function(_0x2ab5cc){logger['error'](_0x8c78('0x15'),_0x2ab5cc['message'],_0x461eff);_0x339d04(_0x54eafa[_0x8c78('0x10')](0x1f4,_0x2ab5cc[_0x8c78('0x11')]));});});};exports[_0x8c78('0x20')]=function(_0x4e764f){var _0x1f1a0c=this;return new Promise(function(_0x3816d2,_0x4f0005){return db[_0x8c78('0x21')][_0x8c78('0x22')]({'raw':_0x4e764f[_0x8c78('0x16')]?_0x4e764f['options'][_0x8c78('0x17')]===undefined?!![]:![]:!![],'where':_0x4e764f[_0x8c78('0x16')]?_0x4e764f[_0x8c78('0x16')]['where']||null:null,'attributes':_0x4e764f[_0x8c78('0x16')]?_0x4e764f[_0x8c78('0x16')]['attributes']||null:null,'include':_0x4e764f[_0x8c78('0x16')]?_0x4e764f[_0x8c78('0x16')][_0x8c78('0x1b')]?_[_0x8c78('0x1c')](_0x4e764f[_0x8c78('0x16')][_0x8c78('0x1b')],function(_0x1218f4){return{'model':db[_0x1218f4[_0x8c78('0x1d')]],'as':_0x1218f4['as'],'attributes':_0x1218f4[_0x8c78('0x19')],'include':_0x1218f4[_0x8c78('0x1b')]?_['map'](_0x1218f4[_0x8c78('0x1b')],function(_0x45e673){return{'model':db[_0x45e673[_0x8c78('0x1d')]],'as':_0x45e673['as'],'attributes':_0x45e673[_0x8c78('0x19')],'include':_0x45e673[_0x8c78('0x1b')]?_['map'](_0x45e673[_0x8c78('0x1b')],function(_0xc4d0cf){return{'model':db[_0xc4d0cf[_0x8c78('0x1d')]],'as':_0xc4d0cf['as'],'attributes':_0xc4d0cf['attributes']};}):[]};}):[]};}):[]:[]})[_0x8c78('0xc')](function(_0x25ea2f){logger['info'](_0x8c78('0x20'),_0x4e764f);logger['debug'](_0x8c78('0x20'),_0x4e764f,JSON[_0x8c78('0x1f')](_0x25ea2f));_0x3816d2(_0x25ea2f);})[_0x8c78('0x14')](function(_0x157b81){logger['error'](_0x8c78('0x20'),_0x157b81['message'],_0x4e764f);_0x4f0005(_0x1f1a0c[_0x8c78('0x10')](0x1f4,_0x157b81[_0x8c78('0x11')]));});});}; \ No newline at end of file +var _0x0bb5=['VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','options','raw','where','limit','map','include','model','attributes','GetVtigerAccount','ShowVtigerAccount','VtigerAccount','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info'];(function(_0x284258,_0x41159b){var _0x1231fc=function(_0x13683d){while(--_0x13683d){_0x284258['push'](_0x284258['shift']());}};_0x1231fc(++_0x41159b);}(_0x0bb5,0x148));var _0x50bb=function(_0x2db808,_0x5d92fb){_0x2db808=_0x2db808-0x0;var _0xbe5637=_0x0bb5[_0x2db808];return _0xbe5637;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x50bb('0x2'));var fs=require('fs');var Redis=require(_0x50bb('0x3'));var db=require(_0x50bb('0x4'))['db'];var utils=require(_0x50bb('0x5'));var logger=require(_0x50bb('0x6'))(_0x50bb('0x7'));var config=require(_0x50bb('0x8'));var jayson=require(_0x50bb('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xfd7aeb,_0x35de5d,_0x2e5463){return new BPromise(function(_0x33ff54,_0x4f9172){return client['request'](_0xfd7aeb,_0x2e5463)[_0x50bb('0xa')](function(_0x1c2174){logger[_0x50bb('0xb')](_0x50bb('0xc'),_0x35de5d,'request\x20sent');logger[_0x50bb('0xd')](_0x50bb('0xe'),_0x35de5d,_0x50bb('0xf'),JSON[_0x50bb('0x10')](_0x1c2174));if(_0x1c2174[_0x50bb('0x11')]){if(_0x1c2174[_0x50bb('0x11')][_0x50bb('0x12')]===0x1f4){logger['error'](_0x50bb('0xc'),_0x35de5d,_0x1c2174['error'][_0x50bb('0x13')]);return _0x4f9172(_0x1c2174[_0x50bb('0x11')][_0x50bb('0x13')]);}logger['error'](_0x50bb('0xc'),_0x35de5d,_0x1c2174[_0x50bb('0x11')][_0x50bb('0x13')]);return _0x33ff54(_0x1c2174['error'][_0x50bb('0x13')]);}else{logger['info'](_0x50bb('0xc'),_0x35de5d,_0x50bb('0xf'));_0x33ff54(_0x1c2174[_0x50bb('0x14')][_0x50bb('0x13')]);}})[_0x50bb('0x15')](function(_0x4f2897){logger[_0x50bb('0x11')](_0x50bb('0xc'),_0x35de5d,_0x4f2897);_0x4f9172(_0x4f2897);});});}exports['GetVtigerAccount']=function(_0x24ba19){var _0x4796ec=this;return new Promise(function(_0x301f61,_0x431ed4){return db['VtigerAccount']['findAll']({'raw':_0x24ba19[_0x50bb('0x16')]?_0x24ba19[_0x50bb('0x16')][_0x50bb('0x17')]===undefined?!![]:![]:!![],'where':_0x24ba19[_0x50bb('0x16')]?_0x24ba19['options'][_0x50bb('0x18')]||null:null,'attributes':_0x24ba19[_0x50bb('0x16')]?_0x24ba19[_0x50bb('0x16')]['attributes']||null:null,'limit':_0x24ba19[_0x50bb('0x16')]?_0x24ba19[_0x50bb('0x16')][_0x50bb('0x19')]||null:null,'include':_0x24ba19['options']?_0x24ba19[_0x50bb('0x16')]['include']?_[_0x50bb('0x1a')](_0x24ba19[_0x50bb('0x16')][_0x50bb('0x1b')],function(_0x2ee87a){return{'model':db[_0x2ee87a[_0x50bb('0x1c')]],'as':_0x2ee87a['as'],'attributes':_0x2ee87a[_0x50bb('0x1d')],'include':_0x2ee87a['include']?_[_0x50bb('0x1a')](_0x2ee87a[_0x50bb('0x1b')],function(_0x284a76){return{'model':db[_0x284a76[_0x50bb('0x1c')]],'as':_0x284a76['as'],'attributes':_0x284a76['attributes'],'include':_0x284a76[_0x50bb('0x1b')]?_['map'](_0x284a76['include'],function(_0x2befd9){return{'model':db[_0x2befd9['model']],'as':_0x2befd9['as'],'attributes':_0x2befd9['attributes']};}):[]};}):[]};}):[]:[]})[_0x50bb('0xa')](function(_0x12ee2c){logger[_0x50bb('0xb')](_0x50bb('0x1e'),_0x24ba19);logger[_0x50bb('0xd')](_0x50bb('0x1e'),_0x24ba19,JSON[_0x50bb('0x10')](_0x12ee2c));_0x301f61(_0x12ee2c);})[_0x50bb('0x15')](function(_0x4f7514){logger[_0x50bb('0x11')](_0x50bb('0x1e'),_0x4f7514[_0x50bb('0x13')],_0x24ba19);_0x431ed4(_0x4796ec[_0x50bb('0x11')](0x1f4,_0x4f7514['message']));});});};exports[_0x50bb('0x1f')]=function(_0x1a62fb){var _0xc38da5=this;return new Promise(function(_0xb3c3ba,_0x3fd5f6){return db[_0x50bb('0x20')][_0x50bb('0x21')]({'raw':_0x1a62fb[_0x50bb('0x16')]?_0x1a62fb[_0x50bb('0x16')][_0x50bb('0x17')]===undefined?!![]:![]:!![],'where':_0x1a62fb[_0x50bb('0x16')]?_0x1a62fb[_0x50bb('0x16')]['where']||null:null,'attributes':_0x1a62fb[_0x50bb('0x16')]?_0x1a62fb[_0x50bb('0x16')][_0x50bb('0x1d')]||null:null,'include':_0x1a62fb[_0x50bb('0x16')]?_0x1a62fb[_0x50bb('0x16')][_0x50bb('0x1b')]?_[_0x50bb('0x1a')](_0x1a62fb[_0x50bb('0x16')][_0x50bb('0x1b')],function(_0x1cc4e2){return{'model':db[_0x1cc4e2[_0x50bb('0x1c')]],'as':_0x1cc4e2['as'],'attributes':_0x1cc4e2['attributes'],'include':_0x1cc4e2[_0x50bb('0x1b')]?_[_0x50bb('0x1a')](_0x1cc4e2[_0x50bb('0x1b')],function(_0x2bfb54){return{'model':db[_0x2bfb54[_0x50bb('0x1c')]],'as':_0x2bfb54['as'],'attributes':_0x2bfb54[_0x50bb('0x1d')],'include':_0x2bfb54['include']?_['map'](_0x2bfb54[_0x50bb('0x1b')],function(_0x5ed0b4){return{'model':db[_0x5ed0b4[_0x50bb('0x1c')]],'as':_0x5ed0b4['as'],'attributes':_0x5ed0b4[_0x50bb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x50bb('0xa')](function(_0x171c6b){logger[_0x50bb('0xb')]('ShowVtigerAccount',_0x1a62fb);logger[_0x50bb('0xd')]('ShowVtigerAccount',_0x1a62fb,JSON[_0x50bb('0x10')](_0x171c6b));_0xb3c3ba(_0x171c6b);})[_0x50bb('0x15')](function(_0x280e5a){logger['error']('ShowVtigerAccount',_0x280e5a[_0x50bb('0x13')],_0x1a62fb);_0x3fd5f6(_0xc38da5[_0x50bb('0x11')](0x1f4,_0x280e5a[_0x50bb('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 681e855..2447040 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 _0x7e88=['show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index'];(function(_0x527733,_0x16051c){var _0x5400ba=function(_0x265d39){while(--_0x265d39){_0x527733['push'](_0x527733['shift']());}};_0x5400ba(++_0x16051c);}(_0x7e88,0xcb));var _0x87e8=function(_0x18ca4f,_0x37bde0){_0x18ca4f=_0x18ca4f-0x0;var _0x5d55be=_0x7e88[_0x18ca4f];return _0x5d55be;};'use strict';var multer=require(_0x87e8('0x0'));var util=require(_0x87e8('0x1'));var path=require('path');var timeout=require(_0x87e8('0x2'));var express=require(_0x87e8('0x3'));var router=express[_0x87e8('0x4')]();var fs_extra=require(_0x87e8('0x5'));var auth=require(_0x87e8('0x6'));var interaction=require(_0x87e8('0x7'));var config=require(_0x87e8('0x8'));var controller=require(_0x87e8('0x9'));router[_0x87e8('0xa')]('/',auth[_0x87e8('0xb')](),controller[_0x87e8('0xc')]);router[_0x87e8('0xa')]('/:id',auth[_0x87e8('0xb')](),controller[_0x87e8('0xd')]);router[_0x87e8('0xa')](_0x87e8('0xe'),auth['isAuthenticated'](),controller[_0x87e8('0xf')]);router[_0x87e8('0xa')](_0x87e8('0x10'),auth[_0x87e8('0xb')](),controller[_0x87e8('0x11')]);router[_0x87e8('0xa')](_0x87e8('0x12'),auth['isAuthenticated'](),controller[_0x87e8('0x13')]);router[_0x87e8('0x14')]('/',auth[_0x87e8('0xb')](),controller[_0x87e8('0x15')]);router[_0x87e8('0x16')](_0x87e8('0x17'),auth[_0x87e8('0xb')](),controller[_0x87e8('0x18')]);router[_0x87e8('0x19')](_0x87e8('0x17'),auth[_0x87e8('0xb')](),controller['destroy']);module[_0x87e8('0x1a')]=router; \ No newline at end of file +var _0xa358=['/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','show','getFields'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xa358,0xac));var _0x8a35=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa358[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x8a35('0x0'));var util=require(_0x8a35('0x1'));var path=require(_0x8a35('0x2'));var timeout=require(_0x8a35('0x3'));var express=require('express');var router=express[_0x8a35('0x4')]();var fs_extra=require(_0x8a35('0x5'));var auth=require(_0x8a35('0x6'));var interaction=require(_0x8a35('0x7'));var config=require('../../config/environment');var controller=require('./intVtigerConfiguration.controller');router[_0x8a35('0x8')]('/',auth[_0x8a35('0x9')](),controller['index']);router[_0x8a35('0x8')]('/:id',auth[_0x8a35('0x9')](),controller[_0x8a35('0xa')]);router[_0x8a35('0x8')]('/:id/fields',auth[_0x8a35('0x9')](),controller[_0x8a35('0xb')]);router[_0x8a35('0x8')](_0x8a35('0xc'),auth['isAuthenticated'](),controller[_0x8a35('0xd')]);router[_0x8a35('0x8')](_0x8a35('0xe'),auth[_0x8a35('0x9')](),controller[_0x8a35('0xf')]);router[_0x8a35('0x10')]('/',auth[_0x8a35('0x9')](),controller[_0x8a35('0x11')]);router[_0x8a35('0x12')](_0x8a35('0x13'),auth[_0x8a35('0x9')](),controller[_0x8a35('0x14')]);router[_0x8a35('0x15')](_0x8a35('0x13'),auth['isAuthenticated'](),controller[_0x8a35('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 b78cd9e..a3faa6f 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 _0x3297=['sequelize','STRING'];(function(_0x5e3701,_0x596265){var _0x345dcf=function(_0x5eb12a){while(--_0x5eb12a){_0x5e3701['push'](_0x5e3701['shift']());}};_0x345dcf(++_0x596265);}(_0x3297,0x1c4));var _0x7329=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x3297[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require(_0x7329('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7329('0x1')]}}; \ No newline at end of file +var _0x9db0=['sequelize','exports','STRING'];(function(_0x1c3a1a,_0xfa88ee){var _0x37eb4e=function(_0x48c7c0){while(--_0x48c7c0){_0x1c3a1a['push'](_0x1c3a1a['shift']());}};_0x37eb4e(++_0xfa88ee);}(_0x9db0,0xd8));var _0x09db=function(_0x31041b,_0x5885b6){_0x31041b=_0x31041b-0x0;var _0xd57c7c=_0x9db0[_0x31041b];return _0xd57c7c;};'use strict';var Sequelize=require(_0x09db('0x0'));module[_0x09db('0x1')]={'name':{'type':Sequelize[_0x09db('0x2')]},'description':{'type':Sequelize[_0x09db('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 0120e4f..f7bb5f2 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 _0xb522=['getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','end','error','name','send','index','map','VtigerConfiguration','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','body','update','destroy','findOne','VtigerField','getFields','hasOwnProperty'];(function(_0x578c1f,_0x5c52fc){var _0x39bef2=function(_0x4c9e78){while(--_0x4c9e78){_0x578c1f['push'](_0x578c1f['shift']());}};_0x39bef2(++_0x5c52fc);}(_0xb522,0x188));var _0x2b52=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb522[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x2b52('0x0'));var rimraf=require(_0x2b52('0x1'));var zipdir=require(_0x2b52('0x2'));var jsonpatch=require(_0x2b52('0x3'));var rp=require('request-promise');var moment=require(_0x2b52('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2b52('0x5'));var util=require('util');var path=require(_0x2b52('0x6'));var sox=require('sox');var csv=require(_0x2b52('0x7'));var ejs=require(_0x2b52('0x8'));var fs=require('fs');var fs_extra=require(_0x2b52('0x9'));var _=require(_0x2b52('0xa'));var squel=require(_0x2b52('0xb'));var crypto=require('crypto');var jsforce=require(_0x2b52('0xc'));var deskjs=require(_0x2b52('0xd'));var toCsv=require(_0x2b52('0x7'));var querystring=require(_0x2b52('0xe'));var Papa=require(_0x2b52('0xf'));var Redis=require(_0x2b52('0x10'));var authService=require(_0x2b52('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2b52('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2b52('0x13'));var utils=require(_0x2b52('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ff160,_0x59d7f1){_0x59d7f1=_0x59d7f1||0xcc;return function(_0x4d7680){if(_0x4d7680){return _0x1ff160[_0x2b52('0x15')](_0x59d7f1);}return _0x1ff160[_0x2b52('0x16')](_0x59d7f1)['end']();};}function respondWithResult(_0x351899,_0x4353b2){_0x4353b2=_0x4353b2||0xc8;return function(_0x1a2ecd){if(_0x1a2ecd){return _0x351899[_0x2b52('0x16')](_0x4353b2)['json'](_0x1a2ecd);}};}function respondWithFilteredResult(_0xed9210,_0x1bfc21){return function(_0x47a656){if(_0x47a656){var _0x5c3f57=typeof _0x1bfc21[_0x2b52('0x17')]===_0x2b52('0x18')&&typeof _0x1bfc21[_0x2b52('0x19')]==='undefined';var _0x6a0430=_0x47a656[_0x2b52('0x1a')];var _0xff206=_0x5c3f57?0x0:_0x1bfc21['offset'];var _0xc39d4e=_0x5c3f57?_0x47a656[_0x2b52('0x1a')]:_0x1bfc21[_0x2b52('0x17')]+_0x1bfc21[_0x2b52('0x19')];var _0x30293c;if(_0xc39d4e>=_0x6a0430){_0xc39d4e=_0x6a0430;_0x30293c=0xc8;}else{_0x30293c=0xce;}_0xed9210[_0x2b52('0x16')](_0x30293c);return _0xed9210[_0x2b52('0x1b')](_0x2b52('0x1c'),_0xff206+'-'+_0xc39d4e+'/'+_0x6a0430)[_0x2b52('0x1d')](_0x47a656);}return null;};}function patchUpdates(_0x81af1a){return function(_0x4080a0){try{jsonpatch['apply'](_0x4080a0,_0x81af1a,!![]);}catch(_0x438e9e){return BPromise[_0x2b52('0x1e')](_0x438e9e);}return _0x4080a0[_0x2b52('0x1f')]();};}function saveUpdates(_0x48002d,_0x356d9d){return function(_0x32de11){if(_0x32de11){return _0x32de11['update'](_0x48002d)[_0x2b52('0x20')](function(_0x38b580){return _0x38b580;});}return null;};}function removeEntity(_0x22a742,_0x320d6d){return function(_0x232cfd){if(_0x232cfd){return _0x232cfd['destroy']()[_0x2b52('0x20')](function(){_0x22a742[_0x2b52('0x16')](0xcc)[_0x2b52('0x21')]();});}};}function handleEntityNotFound(_0x4c2d9c,_0x179cde){return function(_0x39880c){if(!_0x39880c){_0x4c2d9c[_0x2b52('0x15')](0x194);}return _0x39880c;};}function handleError(_0x3cf360,_0x36b449){_0x36b449=_0x36b449||0x1f4;return function(_0x50249f){logger[_0x2b52('0x22')](_0x50249f['stack']);if(_0x50249f[_0x2b52('0x23')]){delete _0x50249f[_0x2b52('0x23')];}_0x3cf360[_0x2b52('0x16')](_0x36b449)[_0x2b52('0x24')](_0x50249f);};}exports[_0x2b52('0x25')]=function(_0x4e20e6,_0x2ef34f){var _0xda0f48={},_0x55652e={},_0x509d82={'count':0x0,'rows':[]};var _0x87f6b=_[_0x2b52('0x26')](db[_0x2b52('0x27')]['rawAttributes'],function(_0x21984c){return{'name':_0x21984c[_0x2b52('0x28')],'type':_0x21984c[_0x2b52('0x29')][_0x2b52('0x2a')]};});_0x55652e['model']=_[_0x2b52('0x26')](_0x87f6b,_0x2b52('0x23'));_0x55652e[_0x2b52('0x2b')]=_[_0x2b52('0x2c')](_0x4e20e6[_0x2b52('0x2b')]);_0x55652e[_0x2b52('0x2d')]=_['intersection'](_0x55652e[_0x2b52('0x2e')],_0x55652e[_0x2b52('0x2b')]);_0xda0f48['attributes']=_[_0x2b52('0x2f')](_0x55652e[_0x2b52('0x2e')],qs[_0x2b52('0x30')](_0x4e20e6['query'][_0x2b52('0x30')]));_0xda0f48['attributes']=_0xda0f48[_0x2b52('0x31')][_0x2b52('0x32')]?_0xda0f48[_0x2b52('0x31')]:_0x55652e[_0x2b52('0x2e')];if(!_0x4e20e6['query']['hasOwnProperty'](_0x2b52('0x33'))){_0xda0f48[_0x2b52('0x19')]=qs[_0x2b52('0x19')](_0x4e20e6['query'][_0x2b52('0x19')]);_0xda0f48['offset']=qs['offset'](_0x4e20e6[_0x2b52('0x2b')][_0x2b52('0x17')]);}_0xda0f48[_0x2b52('0x34')]=qs[_0x2b52('0x35')](_0x4e20e6[_0x2b52('0x2b')][_0x2b52('0x35')]);_0xda0f48['where']=qs[_0x2b52('0x2d')](_[_0x2b52('0x36')](_0x4e20e6[_0x2b52('0x2b')],_0x55652e[_0x2b52('0x2d')]),_0x87f6b);if(_0x4e20e6[_0x2b52('0x2b')][_0x2b52('0x37')]){_0xda0f48[_0x2b52('0x38')]=_[_0x2b52('0x39')](_0xda0f48[_0x2b52('0x38')],{'$or':_[_0x2b52('0x26')](_0x87f6b,function(_0x191045){if(_0x191045[_0x2b52('0x29')]!==_0x2b52('0x3a')){var _0x3be6e2={};_0x3be6e2[_0x191045[_0x2b52('0x23')]]={'$like':'%'+_0x4e20e6[_0x2b52('0x2b')][_0x2b52('0x37')]+'%'};return _0x3be6e2;}})});}_0xda0f48=_[_0x2b52('0x39')]({},_0xda0f48,_0x4e20e6[_0x2b52('0x3b')]);var _0x221de0={'where':_0xda0f48[_0x2b52('0x38')]};return db[_0x2b52('0x27')]['count'](_0x221de0)[_0x2b52('0x20')](function(_0x27d673){_0x509d82[_0x2b52('0x1a')]=_0x27d673;if(_0x4e20e6[_0x2b52('0x2b')]['includeAll']){_0xda0f48[_0x2b52('0x3c')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x2b52('0x3d')](_0xda0f48);})[_0x2b52('0x20')](function(_0x3ad883){_0x509d82['rows']=_0x3ad883;return _0x509d82;})['then'](respondWithFilteredResult(_0x2ef34f,_0xda0f48))[_0x2b52('0x3e')](handleError(_0x2ef34f,null));};exports[_0x2b52('0x3f')]=function(_0x4d3a67,_0x42c64f){var _0x2695cc={'raw':![],'where':{'id':_0x4d3a67[_0x2b52('0x40')]['id']}},_0x5d917e={};_0x5d917e[_0x2b52('0x2e')]=_['keys'](db[_0x2b52('0x27')][_0x2b52('0x41')]);_0x5d917e[_0x2b52('0x2b')]=_[_0x2b52('0x2c')](_0x4d3a67[_0x2b52('0x2b')]);_0x5d917e[_0x2b52('0x2d')]=_[_0x2b52('0x2f')](_0x5d917e[_0x2b52('0x2e')],_0x5d917e[_0x2b52('0x2b')]);_0x2695cc['attributes']=_[_0x2b52('0x2f')](_0x5d917e['model'],qs[_0x2b52('0x30')](_0x4d3a67[_0x2b52('0x2b')]['fields']));_0x2695cc[_0x2b52('0x31')]=_0x2695cc[_0x2b52('0x31')][_0x2b52('0x32')]?_0x2695cc['attributes']:_0x5d917e[_0x2b52('0x2e')];if(_0x4d3a67[_0x2b52('0x2b')][_0x2b52('0x42')]){_0x2695cc['include']=[{'all':!![]}];}_0x2695cc=_[_0x2b52('0x39')]({},_0x2695cc,_0x4d3a67[_0x2b52('0x3b')]);return db['VtigerConfiguration'][_0x2b52('0x43')](_0x2695cc)[_0x2b52('0x20')](handleEntityNotFound(_0x42c64f,null))['then'](respondWithResult(_0x42c64f,null))[_0x2b52('0x3e')](handleError(_0x42c64f,null));};exports[_0x2b52('0x44')]=function(_0x5efa8a,_0x380a11){return db[_0x2b52('0x27')]['create'](_0x5efa8a[_0x2b52('0x45')],{})['then'](respondWithResult(_0x380a11,0xc9))[_0x2b52('0x3e')](handleError(_0x380a11,null));};exports[_0x2b52('0x46')]=function(_0x1c5537,_0x1adaf9){if(_0x1c5537['body']['id']){delete _0x1c5537[_0x2b52('0x45')]['id'];}return db[_0x2b52('0x27')][_0x2b52('0x43')]({'where':{'id':_0x1c5537[_0x2b52('0x40')]['id']}})[_0x2b52('0x20')](handleEntityNotFound(_0x1adaf9,null))[_0x2b52('0x20')](saveUpdates(_0x1c5537[_0x2b52('0x45')],null))['then'](respondWithResult(_0x1adaf9,null))['catch'](handleError(_0x1adaf9,null));};exports[_0x2b52('0x47')]=function(_0x2cd16e,_0x202c1b){return db['VtigerConfiguration'][_0x2b52('0x43')]({'where':{'id':_0x2cd16e[_0x2b52('0x40')]['id']}})[_0x2b52('0x20')](handleEntityNotFound(_0x202c1b,null))[_0x2b52('0x20')](removeEntity(_0x202c1b,null))[_0x2b52('0x3e')](handleError(_0x202c1b,null));};exports['getFields']=function(_0x15de8a,_0x8b373b,_0x304c6a){var _0x28273f={};var _0x1a3d1f={};var _0x35c769;var _0x298098;return db[_0x2b52('0x27')][_0x2b52('0x48')]({'where':{'id':_0x15de8a[_0x2b52('0x40')]['id']}})[_0x2b52('0x20')](handleEntityNotFound(_0x8b373b,null))['then'](function(_0x4d4638){if(_0x4d4638){_0x35c769=_0x4d4638;_0x1a3d1f['model']=_['keys'](db[_0x2b52('0x49')][_0x2b52('0x41')]);_0x1a3d1f['query']=_[_0x2b52('0x2c')](_0x15de8a[_0x2b52('0x2b')]);_0x1a3d1f['filters']=_[_0x2b52('0x2f')](_0x1a3d1f['model'],_0x1a3d1f[_0x2b52('0x2b')]);_0x28273f[_0x2b52('0x31')]=_[_0x2b52('0x2f')](_0x1a3d1f[_0x2b52('0x2e')],qs[_0x2b52('0x30')](_0x15de8a[_0x2b52('0x2b')][_0x2b52('0x30')]));_0x28273f[_0x2b52('0x31')]=_0x28273f[_0x2b52('0x31')][_0x2b52('0x32')]?_0x28273f[_0x2b52('0x31')]:_0x1a3d1f[_0x2b52('0x2e')];_0x28273f[_0x2b52('0x34')]=qs['sort'](_0x15de8a[_0x2b52('0x2b')][_0x2b52('0x35')]);_0x28273f[_0x2b52('0x38')]=qs[_0x2b52('0x2d')](_[_0x2b52('0x36')](_0x15de8a[_0x2b52('0x2b')],_0x1a3d1f[_0x2b52('0x2d')]));if(_0x15de8a[_0x2b52('0x2b')][_0x2b52('0x37')]){_0x28273f['where']=_[_0x2b52('0x39')](_0x28273f[_0x2b52('0x38')],{'$or':_[_0x2b52('0x26')](_0x28273f[_0x2b52('0x31')],function(_0x137a84){var _0x49fd0e={};_0x49fd0e[_0x137a84]={'$like':'%'+_0x15de8a[_0x2b52('0x2b')][_0x2b52('0x37')]+'%'};return _0x49fd0e;})});}_0x28273f=_[_0x2b52('0x39')]({},_0x28273f,_0x15de8a[_0x2b52('0x3b')]);return _0x35c769[_0x2b52('0x4a')](_0x28273f);}})[_0x2b52('0x20')](function(_0x5d2253){if(_0x5d2253){_0x298098=_0x5d2253[_0x2b52('0x32')];if(!_0x15de8a['query'][_0x2b52('0x4b')]('nolimit')){_0x28273f[_0x2b52('0x19')]=qs[_0x2b52('0x19')](_0x15de8a[_0x2b52('0x2b')][_0x2b52('0x19')]);_0x28273f[_0x2b52('0x17')]=qs[_0x2b52('0x17')](_0x15de8a[_0x2b52('0x2b')][_0x2b52('0x17')]);}return _0x35c769[_0x2b52('0x4a')](_0x28273f);}})[_0x2b52('0x20')](function(_0x217d8d){if(_0x217d8d){return _0x217d8d?{'count':_0x298098,'rows':_0x217d8d}:null;}})['then'](respondWithResult(_0x8b373b,null))['catch'](handleError(_0x8b373b,null));};exports[_0x2b52('0x4c')]=function(_0x529d69,_0x4ba012,_0x50897c){var _0x210c20={};var _0x4d7dfa={};var _0x4ce3a9;var _0x149b1f;return db[_0x2b52('0x27')][_0x2b52('0x48')]({'where':{'id':_0x529d69[_0x2b52('0x40')]['id']}})[_0x2b52('0x20')](handleEntityNotFound(_0x4ba012,null))[_0x2b52('0x20')](function(_0x15edb5){if(_0x15edb5){_0x4ce3a9=_0x15edb5;_0x4d7dfa[_0x2b52('0x2e')]=_['keys'](db[_0x2b52('0x49')][_0x2b52('0x41')]);_0x4d7dfa[_0x2b52('0x2b')]=_[_0x2b52('0x2c')](_0x529d69['query']);_0x4d7dfa[_0x2b52('0x2d')]=_[_0x2b52('0x2f')](_0x4d7dfa[_0x2b52('0x2e')],_0x4d7dfa[_0x2b52('0x2b')]);_0x210c20[_0x2b52('0x31')]=_[_0x2b52('0x2f')](_0x4d7dfa[_0x2b52('0x2e')],qs['fields'](_0x529d69['query'][_0x2b52('0x30')]));_0x210c20[_0x2b52('0x31')]=_0x210c20['attributes'][_0x2b52('0x32')]?_0x210c20['attributes']:_0x4d7dfa[_0x2b52('0x2e')];_0x210c20['order']=qs['sort'](_0x529d69['query']['sort']);_0x210c20[_0x2b52('0x38')]=qs[_0x2b52('0x2d')](_[_0x2b52('0x36')](_0x529d69[_0x2b52('0x2b')],_0x4d7dfa[_0x2b52('0x2d')]));if(_0x529d69[_0x2b52('0x2b')][_0x2b52('0x37')]){_0x210c20[_0x2b52('0x38')]=_['merge'](_0x210c20[_0x2b52('0x38')],{'$or':_[_0x2b52('0x26')](_0x210c20[_0x2b52('0x31')],function(_0x33f372){var _0xb060b0={};_0xb060b0[_0x33f372]={'$like':'%'+_0x529d69[_0x2b52('0x2b')][_0x2b52('0x37')]+'%'};return _0xb060b0;})});}_0x210c20=_[_0x2b52('0x39')]({},_0x210c20,_0x529d69[_0x2b52('0x3b')]);return _0x4ce3a9[_0x2b52('0x4c')](_0x210c20);}})[_0x2b52('0x20')](function(_0xb24f14){if(_0xb24f14){_0x149b1f=_0xb24f14[_0x2b52('0x32')];if(!_0x529d69['query'][_0x2b52('0x4b')](_0x2b52('0x33'))){_0x210c20[_0x2b52('0x19')]=qs[_0x2b52('0x19')](_0x529d69['query'][_0x2b52('0x19')]);_0x210c20[_0x2b52('0x17')]=qs[_0x2b52('0x17')](_0x529d69[_0x2b52('0x2b')][_0x2b52('0x17')]);}return _0x4ce3a9[_0x2b52('0x4c')](_0x210c20);}})[_0x2b52('0x20')](function(_0x35046d){if(_0x35046d){return _0x35046d?{'count':_0x149b1f,'rows':_0x35046d}:null;}})[_0x2b52('0x20')](respondWithResult(_0x4ba012,null))[_0x2b52('0x3e')](handleError(_0x4ba012,null));};exports[_0x2b52('0x4d')]=function(_0xa2df2d,_0x119a93,_0x554223){var _0x565a30={};var _0x2feaff={};var _0x52b286;var _0x3375c0;return db[_0x2b52('0x27')][_0x2b52('0x48')]({'where':{'id':_0xa2df2d[_0x2b52('0x40')]['id']}})[_0x2b52('0x20')](handleEntityNotFound(_0x119a93,null))[_0x2b52('0x20')](function(_0x11788d){if(_0x11788d){_0x52b286=_0x11788d;_0x2feaff[_0x2b52('0x2e')]=_['keys'](db[_0x2b52('0x49')][_0x2b52('0x41')]);_0x2feaff[_0x2b52('0x2b')]=_[_0x2b52('0x2c')](_0xa2df2d[_0x2b52('0x2b')]);_0x2feaff['filters']=_[_0x2b52('0x2f')](_0x2feaff['model'],_0x2feaff[_0x2b52('0x2b')]);_0x565a30['attributes']=_['intersection'](_0x2feaff[_0x2b52('0x2e')],qs[_0x2b52('0x30')](_0xa2df2d['query'][_0x2b52('0x30')]));_0x565a30[_0x2b52('0x31')]=_0x565a30[_0x2b52('0x31')]['length']?_0x565a30[_0x2b52('0x31')]:_0x2feaff[_0x2b52('0x2e')];_0x565a30['order']=qs[_0x2b52('0x35')](_0xa2df2d[_0x2b52('0x2b')][_0x2b52('0x35')]);_0x565a30[_0x2b52('0x38')]=qs[_0x2b52('0x2d')](_[_0x2b52('0x36')](_0xa2df2d[_0x2b52('0x2b')],_0x2feaff[_0x2b52('0x2d')]));if(_0xa2df2d[_0x2b52('0x2b')][_0x2b52('0x37')]){_0x565a30['where']=_[_0x2b52('0x39')](_0x565a30['where'],{'$or':_[_0x2b52('0x26')](_0x565a30[_0x2b52('0x31')],function(_0x96417d){var _0xc06563={};_0xc06563[_0x96417d]={'$like':'%'+_0xa2df2d['query'][_0x2b52('0x37')]+'%'};return _0xc06563;})});}_0x565a30=_[_0x2b52('0x39')]({},_0x565a30,_0xa2df2d[_0x2b52('0x3b')]);return _0x52b286[_0x2b52('0x4d')](_0x565a30);}})[_0x2b52('0x20')](function(_0x16ad8b){if(_0x16ad8b){_0x3375c0=_0x16ad8b[_0x2b52('0x32')];if(!_0xa2df2d[_0x2b52('0x2b')][_0x2b52('0x4b')](_0x2b52('0x33'))){_0x565a30['limit']=qs[_0x2b52('0x19')](_0xa2df2d[_0x2b52('0x2b')][_0x2b52('0x19')]);_0x565a30[_0x2b52('0x17')]=qs[_0x2b52('0x17')](_0xa2df2d['query'][_0x2b52('0x17')]);}return _0x52b286['getDescriptions'](_0x565a30);}})[_0x2b52('0x20')](function(_0x19146d){if(_0x19146d){return _0x19146d?{'count':_0x3375c0,'rows':_0x19146d}:null;}})[_0x2b52('0x20')](respondWithResult(_0x119a93,null))['catch'](handleError(_0x119a93,null));}; \ No newline at end of file +var _0xeed7=['../../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','apply','reject','destroy','then','end','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','getFields','findOne','VtigerField','length','getSubjects','getDescriptions','hasOwnProperty','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','ioredis'];(function(_0x28c884,_0x2dfffd){var _0x30fbe1=function(_0x48f168){while(--_0x48f168){_0x28c884['push'](_0x28c884['shift']());}};_0x30fbe1(++_0x2dfffd);}(_0xeed7,0xdf));var _0x7eed=function(_0x1a32bd,_0x5f5c45){_0x1a32bd=_0x1a32bd-0x0;var _0x20811e=_0xeed7[_0x1a32bd];return _0x20811e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7eed('0x0'));var jsonpatch=require(_0x7eed('0x1'));var rp=require('request-promise');var moment=require(_0x7eed('0x2'));var BPromise=require(_0x7eed('0x3'));var Mustache=require(_0x7eed('0x4'));var util=require(_0x7eed('0x5'));var path=require('path');var sox=require(_0x7eed('0x6'));var csv=require(_0x7eed('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7eed('0x8'));var _=require(_0x7eed('0x9'));var squel=require(_0x7eed('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7eed('0xb'));var toCsv=require(_0x7eed('0x7'));var querystring=require(_0x7eed('0xc'));var Papa=require('papaparse');var Redis=require(_0x7eed('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7eed('0xe'));var hardwareService=require(_0x7eed('0xf'));var logger=require(_0x7eed('0x10'))(_0x7eed('0x11'));var utils=require(_0x7eed('0x12'));var config=require(_0x7eed('0x13'));var licenseUtil=require(_0x7eed('0x14'));var db=require(_0x7eed('0x15'))['db'];function respondWithStatusCode(_0x9e5978,_0x4ddcb2){_0x4ddcb2=_0x4ddcb2||0xcc;return function(_0x7f5aa4){if(_0x7f5aa4){return _0x9e5978[_0x7eed('0x16')](_0x4ddcb2);}return _0x9e5978[_0x7eed('0x17')](_0x4ddcb2)['end']();};}function respondWithResult(_0x5a9490,_0x2d3f7d){_0x2d3f7d=_0x2d3f7d||0xc8;return function(_0x2255c8){if(_0x2255c8){return _0x5a9490[_0x7eed('0x17')](_0x2d3f7d)[_0x7eed('0x18')](_0x2255c8);}};}function respondWithFilteredResult(_0x431738,_0x55426b){return function(_0x55db88){if(_0x55db88){var _0x598165=typeof _0x55426b[_0x7eed('0x19')]==='undefined'&&typeof _0x55426b['limit']==='undefined';var _0x2a2783=_0x55db88[_0x7eed('0x1a')];var _0x5143db=_0x598165?0x0:_0x55426b[_0x7eed('0x19')];var _0x3ab3e2=_0x598165?_0x55db88[_0x7eed('0x1a')]:_0x55426b[_0x7eed('0x19')]+_0x55426b[_0x7eed('0x1b')];var _0x2c9dea;if(_0x3ab3e2>=_0x2a2783){_0x3ab3e2=_0x2a2783;_0x2c9dea=0xc8;}else{_0x2c9dea=0xce;}_0x431738[_0x7eed('0x17')](_0x2c9dea);return _0x431738[_0x7eed('0x1c')](_0x7eed('0x1d'),_0x5143db+'-'+_0x3ab3e2+'/'+_0x2a2783)[_0x7eed('0x18')](_0x55db88);}return null;};}function patchUpdates(_0x45357c){return function(_0x5c8d86){try{jsonpatch[_0x7eed('0x1e')](_0x5c8d86,_0x45357c,!![]);}catch(_0x5e9835){return BPromise[_0x7eed('0x1f')](_0x5e9835);}return _0x5c8d86['save']();};}function saveUpdates(_0x3252aa,_0x36a112){return function(_0x578cf2){if(_0x578cf2){return _0x578cf2['update'](_0x3252aa)['then'](function(_0x2bd3f6){return _0x2bd3f6;});}return null;};}function removeEntity(_0x451e71,_0x1a2736){return function(_0xf50d35){if(_0xf50d35){return _0xf50d35[_0x7eed('0x20')]()[_0x7eed('0x21')](function(){_0x451e71[_0x7eed('0x17')](0xcc)[_0x7eed('0x22')]();});}};}function handleEntityNotFound(_0x1f2f8c,_0x3e4824){return function(_0x2fc47f){if(!_0x2fc47f){_0x1f2f8c[_0x7eed('0x16')](0x194);}return _0x2fc47f;};}function handleError(_0x291b7c,_0x21f740){_0x21f740=_0x21f740||0x1f4;return function(_0x19c47d){logger[_0x7eed('0x23')](_0x19c47d[_0x7eed('0x24')]);if(_0x19c47d[_0x7eed('0x25')]){delete _0x19c47d[_0x7eed('0x25')];}_0x291b7c[_0x7eed('0x17')](_0x21f740)[_0x7eed('0x26')](_0x19c47d);};}exports[_0x7eed('0x27')]=function(_0x34e625,_0x764ea3){var _0x38faff={},_0x37ace1={},_0x4016ca={'count':0x0,'rows':[]};var _0x1a1a71=_[_0x7eed('0x28')](db[_0x7eed('0x29')][_0x7eed('0x2a')],function(_0x3d6e09){return{'name':_0x3d6e09[_0x7eed('0x2b')],'type':_0x3d6e09[_0x7eed('0x2c')][_0x7eed('0x2d')]};});_0x37ace1[_0x7eed('0x2e')]=_['map'](_0x1a1a71,_0x7eed('0x25'));_0x37ace1[_0x7eed('0x2f')]=_[_0x7eed('0x30')](_0x34e625[_0x7eed('0x2f')]);_0x37ace1[_0x7eed('0x31')]=_['intersection'](_0x37ace1['model'],_0x37ace1['query']);_0x38faff[_0x7eed('0x32')]=_[_0x7eed('0x33')](_0x37ace1[_0x7eed('0x2e')],qs[_0x7eed('0x34')](_0x34e625['query'][_0x7eed('0x34')]));_0x38faff[_0x7eed('0x32')]=_0x38faff['attributes']['length']?_0x38faff[_0x7eed('0x32')]:_0x37ace1[_0x7eed('0x2e')];if(!_0x34e625[_0x7eed('0x2f')]['hasOwnProperty'](_0x7eed('0x35'))){_0x38faff['limit']=qs[_0x7eed('0x1b')](_0x34e625[_0x7eed('0x2f')][_0x7eed('0x1b')]);_0x38faff[_0x7eed('0x19')]=qs[_0x7eed('0x19')](_0x34e625[_0x7eed('0x2f')][_0x7eed('0x19')]);}_0x38faff[_0x7eed('0x36')]=qs['sort'](_0x34e625[_0x7eed('0x2f')][_0x7eed('0x37')]);_0x38faff[_0x7eed('0x38')]=qs[_0x7eed('0x31')](_[_0x7eed('0x39')](_0x34e625[_0x7eed('0x2f')],_0x37ace1[_0x7eed('0x31')]),_0x1a1a71);if(_0x34e625[_0x7eed('0x2f')][_0x7eed('0x3a')]){_0x38faff[_0x7eed('0x38')]=_[_0x7eed('0x3b')](_0x38faff['where'],{'$or':_[_0x7eed('0x28')](_0x1a1a71,function(_0x213b38){if(_0x213b38[_0x7eed('0x2c')]!=='VIRTUAL'){var _0xf13c2f={};_0xf13c2f[_0x213b38['name']]={'$like':'%'+_0x34e625[_0x7eed('0x2f')][_0x7eed('0x3a')]+'%'};return _0xf13c2f;}})});}_0x38faff=_[_0x7eed('0x3b')]({},_0x38faff,_0x34e625[_0x7eed('0x3c')]);var _0x23d50b={'where':_0x38faff[_0x7eed('0x38')]};return db[_0x7eed('0x29')][_0x7eed('0x1a')](_0x23d50b)[_0x7eed('0x21')](function(_0x438dd3){_0x4016ca[_0x7eed('0x1a')]=_0x438dd3;if(_0x34e625['query'][_0x7eed('0x3d')]){_0x38faff[_0x7eed('0x3e')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x7eed('0x3f')](_0x38faff);})[_0x7eed('0x21')](function(_0xada32c){_0x4016ca[_0x7eed('0x40')]=_0xada32c;return _0x4016ca;})[_0x7eed('0x21')](respondWithFilteredResult(_0x764ea3,_0x38faff))[_0x7eed('0x41')](handleError(_0x764ea3,null));};exports[_0x7eed('0x42')]=function(_0xda9e12,_0x342869){var _0x88f618={'raw':![],'where':{'id':_0xda9e12[_0x7eed('0x43')]['id']}},_0x497a8c={};_0x497a8c[_0x7eed('0x2e')]=_[_0x7eed('0x30')](db[_0x7eed('0x29')][_0x7eed('0x2a')]);_0x497a8c[_0x7eed('0x2f')]=_[_0x7eed('0x30')](_0xda9e12[_0x7eed('0x2f')]);_0x497a8c[_0x7eed('0x31')]=_[_0x7eed('0x33')](_0x497a8c[_0x7eed('0x2e')],_0x497a8c[_0x7eed('0x2f')]);_0x88f618[_0x7eed('0x32')]=_[_0x7eed('0x33')](_0x497a8c[_0x7eed('0x2e')],qs['fields'](_0xda9e12['query'][_0x7eed('0x34')]));_0x88f618[_0x7eed('0x32')]=_0x88f618[_0x7eed('0x32')]['length']?_0x88f618['attributes']:_0x497a8c[_0x7eed('0x2e')];if(_0xda9e12[_0x7eed('0x2f')][_0x7eed('0x3d')]){_0x88f618['include']=[{'all':!![]}];}_0x88f618=_[_0x7eed('0x3b')]({},_0x88f618,_0xda9e12[_0x7eed('0x3c')]);return db[_0x7eed('0x29')][_0x7eed('0x44')](_0x88f618)[_0x7eed('0x21')](handleEntityNotFound(_0x342869,null))['then'](respondWithResult(_0x342869,null))[_0x7eed('0x41')](handleError(_0x342869,null));};exports[_0x7eed('0x45')]=function(_0x49bd34,_0x5ad3b0){return db['VtigerConfiguration'][_0x7eed('0x45')](_0x49bd34['body'],{})[_0x7eed('0x21')](respondWithResult(_0x5ad3b0,0xc9))[_0x7eed('0x41')](handleError(_0x5ad3b0,null));};exports[_0x7eed('0x46')]=function(_0x2c508c,_0x208da4){if(_0x2c508c[_0x7eed('0x47')]['id']){delete _0x2c508c[_0x7eed('0x47')]['id'];}return db[_0x7eed('0x29')][_0x7eed('0x44')]({'where':{'id':_0x2c508c[_0x7eed('0x43')]['id']}})[_0x7eed('0x21')](handleEntityNotFound(_0x208da4,null))['then'](saveUpdates(_0x2c508c[_0x7eed('0x47')],null))[_0x7eed('0x21')](respondWithResult(_0x208da4,null))[_0x7eed('0x41')](handleError(_0x208da4,null));};exports['destroy']=function(_0x386744,_0x2be206){return db['VtigerConfiguration'][_0x7eed('0x44')]({'where':{'id':_0x386744[_0x7eed('0x43')]['id']}})[_0x7eed('0x21')](handleEntityNotFound(_0x2be206,null))[_0x7eed('0x21')](removeEntity(_0x2be206,null))['catch'](handleError(_0x2be206,null));};exports[_0x7eed('0x48')]=function(_0x3994aa,_0x4c7ea1,_0x2bf79f){var _0x3b9cd7={};var _0x384f74={};var _0x3953ee;var _0x15d46e;return db[_0x7eed('0x29')][_0x7eed('0x49')]({'where':{'id':_0x3994aa[_0x7eed('0x43')]['id']}})['then'](handleEntityNotFound(_0x4c7ea1,null))[_0x7eed('0x21')](function(_0xf65a44){if(_0xf65a44){_0x3953ee=_0xf65a44;_0x384f74[_0x7eed('0x2e')]=_['keys'](db[_0x7eed('0x4a')][_0x7eed('0x2a')]);_0x384f74[_0x7eed('0x2f')]=_[_0x7eed('0x30')](_0x3994aa[_0x7eed('0x2f')]);_0x384f74['filters']=_['intersection'](_0x384f74[_0x7eed('0x2e')],_0x384f74[_0x7eed('0x2f')]);_0x3b9cd7['attributes']=_[_0x7eed('0x33')](_0x384f74[_0x7eed('0x2e')],qs['fields'](_0x3994aa[_0x7eed('0x2f')]['fields']));_0x3b9cd7[_0x7eed('0x32')]=_0x3b9cd7['attributes']['length']?_0x3b9cd7[_0x7eed('0x32')]:_0x384f74[_0x7eed('0x2e')];_0x3b9cd7[_0x7eed('0x36')]=qs[_0x7eed('0x37')](_0x3994aa['query'][_0x7eed('0x37')]);_0x3b9cd7['where']=qs[_0x7eed('0x31')](_['pick'](_0x3994aa[_0x7eed('0x2f')],_0x384f74[_0x7eed('0x31')]));if(_0x3994aa['query']['filter']){_0x3b9cd7[_0x7eed('0x38')]=_[_0x7eed('0x3b')](_0x3b9cd7[_0x7eed('0x38')],{'$or':_[_0x7eed('0x28')](_0x3b9cd7[_0x7eed('0x32')],function(_0x37612b){var _0x1ebff5={};_0x1ebff5[_0x37612b]={'$like':'%'+_0x3994aa['query'][_0x7eed('0x3a')]+'%'};return _0x1ebff5;})});}_0x3b9cd7=_['merge']({},_0x3b9cd7,_0x3994aa[_0x7eed('0x3c')]);return _0x3953ee[_0x7eed('0x48')](_0x3b9cd7);}})['then'](function(_0x4075ba){if(_0x4075ba){_0x15d46e=_0x4075ba['length'];if(!_0x3994aa[_0x7eed('0x2f')]['hasOwnProperty']('nolimit')){_0x3b9cd7[_0x7eed('0x1b')]=qs['limit'](_0x3994aa[_0x7eed('0x2f')][_0x7eed('0x1b')]);_0x3b9cd7[_0x7eed('0x19')]=qs[_0x7eed('0x19')](_0x3994aa[_0x7eed('0x2f')][_0x7eed('0x19')]);}return _0x3953ee[_0x7eed('0x48')](_0x3b9cd7);}})[_0x7eed('0x21')](function(_0x35ea4c){if(_0x35ea4c){return _0x35ea4c?{'count':_0x15d46e,'rows':_0x35ea4c}:null;}})[_0x7eed('0x21')](respondWithResult(_0x4c7ea1,null))[_0x7eed('0x41')](handleError(_0x4c7ea1,null));};exports['getSubjects']=function(_0x4c7379,_0x355ae4,_0x522aad){var _0x355221={};var _0x82928b={};var _0xb851c3;var _0x26ec14;return db[_0x7eed('0x29')][_0x7eed('0x49')]({'where':{'id':_0x4c7379[_0x7eed('0x43')]['id']}})[_0x7eed('0x21')](handleEntityNotFound(_0x355ae4,null))[_0x7eed('0x21')](function(_0xfe9caf){if(_0xfe9caf){_0xb851c3=_0xfe9caf;_0x82928b[_0x7eed('0x2e')]=_['keys'](db['VtigerField']['rawAttributes']);_0x82928b[_0x7eed('0x2f')]=_['keys'](_0x4c7379['query']);_0x82928b[_0x7eed('0x31')]=_[_0x7eed('0x33')](_0x82928b[_0x7eed('0x2e')],_0x82928b['query']);_0x355221[_0x7eed('0x32')]=_[_0x7eed('0x33')](_0x82928b[_0x7eed('0x2e')],qs[_0x7eed('0x34')](_0x4c7379[_0x7eed('0x2f')]['fields']));_0x355221[_0x7eed('0x32')]=_0x355221['attributes'][_0x7eed('0x4b')]?_0x355221[_0x7eed('0x32')]:_0x82928b[_0x7eed('0x2e')];_0x355221['order']=qs[_0x7eed('0x37')](_0x4c7379[_0x7eed('0x2f')][_0x7eed('0x37')]);_0x355221['where']=qs[_0x7eed('0x31')](_[_0x7eed('0x39')](_0x4c7379[_0x7eed('0x2f')],_0x82928b[_0x7eed('0x31')]));if(_0x4c7379[_0x7eed('0x2f')]['filter']){_0x355221[_0x7eed('0x38')]=_[_0x7eed('0x3b')](_0x355221[_0x7eed('0x38')],{'$or':_[_0x7eed('0x28')](_0x355221[_0x7eed('0x32')],function(_0x42cb5c){var _0x312450={};_0x312450[_0x42cb5c]={'$like':'%'+_0x4c7379[_0x7eed('0x2f')][_0x7eed('0x3a')]+'%'};return _0x312450;})});}_0x355221=_[_0x7eed('0x3b')]({},_0x355221,_0x4c7379[_0x7eed('0x3c')]);return _0xb851c3[_0x7eed('0x4c')](_0x355221);}})[_0x7eed('0x21')](function(_0x5777de){if(_0x5777de){_0x26ec14=_0x5777de[_0x7eed('0x4b')];if(!_0x4c7379[_0x7eed('0x2f')]['hasOwnProperty'](_0x7eed('0x35'))){_0x355221[_0x7eed('0x1b')]=qs[_0x7eed('0x1b')](_0x4c7379[_0x7eed('0x2f')][_0x7eed('0x1b')]);_0x355221[_0x7eed('0x19')]=qs[_0x7eed('0x19')](_0x4c7379[_0x7eed('0x2f')][_0x7eed('0x19')]);}return _0xb851c3[_0x7eed('0x4c')](_0x355221);}})[_0x7eed('0x21')](function(_0x7519e5){if(_0x7519e5){return _0x7519e5?{'count':_0x26ec14,'rows':_0x7519e5}:null;}})['then'](respondWithResult(_0x355ae4,null))[_0x7eed('0x41')](handleError(_0x355ae4,null));};exports['getDescriptions']=function(_0x181955,_0x57b685,_0x19e5dd){var _0x1df8f7={};var _0x397094={};var _0x1c2cc2;var _0x269355;return db['VtigerConfiguration'][_0x7eed('0x49')]({'where':{'id':_0x181955['params']['id']}})[_0x7eed('0x21')](handleEntityNotFound(_0x57b685,null))[_0x7eed('0x21')](function(_0x55e79a){if(_0x55e79a){_0x1c2cc2=_0x55e79a;_0x397094[_0x7eed('0x2e')]=_[_0x7eed('0x30')](db['VtigerField'][_0x7eed('0x2a')]);_0x397094['query']=_[_0x7eed('0x30')](_0x181955[_0x7eed('0x2f')]);_0x397094[_0x7eed('0x31')]=_[_0x7eed('0x33')](_0x397094[_0x7eed('0x2e')],_0x397094[_0x7eed('0x2f')]);_0x1df8f7['attributes']=_['intersection'](_0x397094[_0x7eed('0x2e')],qs['fields'](_0x181955['query'][_0x7eed('0x34')]));_0x1df8f7[_0x7eed('0x32')]=_0x1df8f7[_0x7eed('0x32')][_0x7eed('0x4b')]?_0x1df8f7['attributes']:_0x397094[_0x7eed('0x2e')];_0x1df8f7[_0x7eed('0x36')]=qs['sort'](_0x181955[_0x7eed('0x2f')]['sort']);_0x1df8f7[_0x7eed('0x38')]=qs[_0x7eed('0x31')](_['pick'](_0x181955[_0x7eed('0x2f')],_0x397094['filters']));if(_0x181955['query']['filter']){_0x1df8f7[_0x7eed('0x38')]=_[_0x7eed('0x3b')](_0x1df8f7['where'],{'$or':_['map'](_0x1df8f7[_0x7eed('0x32')],function(_0x83d3c1){var _0x15364b={};_0x15364b[_0x83d3c1]={'$like':'%'+_0x181955['query'][_0x7eed('0x3a')]+'%'};return _0x15364b;})});}_0x1df8f7=_[_0x7eed('0x3b')]({},_0x1df8f7,_0x181955[_0x7eed('0x3c')]);return _0x1c2cc2[_0x7eed('0x4d')](_0x1df8f7);}})[_0x7eed('0x21')](function(_0xfbdf0e){if(_0xfbdf0e){_0x269355=_0xfbdf0e[_0x7eed('0x4b')];if(!_0x181955[_0x7eed('0x2f')][_0x7eed('0x4e')](_0x7eed('0x35'))){_0x1df8f7[_0x7eed('0x1b')]=qs['limit'](_0x181955[_0x7eed('0x2f')][_0x7eed('0x1b')]);_0x1df8f7[_0x7eed('0x19')]=qs[_0x7eed('0x19')](_0x181955[_0x7eed('0x2f')][_0x7eed('0x19')]);}return _0x1c2cc2[_0x7eed('0x4d')](_0x1df8f7);}})['then'](function(_0x3710f9){if(_0x3710f9){return _0x3710f9?{'count':_0x269355,'rows':_0x3710f9}:null;}})[_0x7eed('0x21')](respondWithResult(_0x57b685,null))[_0x7eed('0x41')](handleError(_0x57b685,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 4bccc26..7515bdb 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 _0xc6bd=['../../config/environment','exports','int_vtiger_configurations','lodash','util','api','moment','bluebird','path'];(function(_0x382cd0,_0x26979b){var _0x321aa3=function(_0xcf0fd1){while(--_0xcf0fd1){_0x382cd0['push'](_0x382cd0['shift']());}};_0x321aa3(++_0x26979b);}(_0xc6bd,0x17d));var _0xdc6b=function(_0x217b21,_0x53d0d5){_0x217b21=_0x217b21-0x0;var _0x449d78=_0xc6bd[_0x217b21];return _0x449d78;};'use strict';var _=require(_0xdc6b('0x0'));var util=require(_0xdc6b('0x1'));var logger=require('../../config/logger')(_0xdc6b('0x2'));var moment=require(_0xdc6b('0x3'));var BPromise=require(_0xdc6b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc6b('0x5'));var rimraf=require('rimraf');var config=require(_0xdc6b('0x6'));var attributes=require('./intVtigerConfiguration.attributes');module[_0xdc6b('0x7')]=function(_0x59748a,_0x1e6e1f){return _0x59748a['define']('VtigerConfiguration',attributes,{'tableName':_0xdc6b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d82=['rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','bluebird','request-promise','path'];(function(_0x46fc6c,_0x297637){var _0x18694f=function(_0x34e1e0){while(--_0x34e1e0){_0x46fc6c['push'](_0x46fc6c['shift']());}};_0x18694f(++_0x297637);}(_0x5d82,0x13d));var _0x25d8=function(_0x230778,_0x20068a){_0x230778=_0x230778-0x0;var _0x120686=_0x5d82[_0x230778];return _0x120686;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x25d8('0x0'));var rp=require(_0x25d8('0x1'));var fs=require('fs');var path=require(_0x25d8('0x2'));var rimraf=require(_0x25d8('0x3'));var config=require(_0x25d8('0x4'));var attributes=require(_0x25d8('0x5'));module[_0x25d8('0x6')]=function(_0x5a0aef,_0x576556){return _0x5a0aef[_0x25d8('0x7')](_0x25d8('0x8'),attributes,{'tableName':_0x25d8('0x9'),'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 72f3041..a05c642 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 _0xef81=['error','code','VtigerConfiguration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x23a673,_0x31e4bc){var _0x2213b7=function(_0x3c5dcc){while(--_0x3c5dcc){_0x23a673['push'](_0x23a673['shift']());}};_0x2213b7(++_0x31e4bc);}(_0xef81,0x95));var _0x1ef8=function(_0x19d1ee,_0x2b689c){_0x19d1ee=_0x19d1ee-0x0;var _0x55d624=_0xef81[_0x19d1ee];return _0x55d624;};'use strict';var _=require(_0x1ef8('0x0'));var util=require(_0x1ef8('0x1'));var moment=require(_0x1ef8('0x2'));var BPromise=require(_0x1ef8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1ef8('0x4'));var db=require(_0x1ef8('0x5'))['db'];var utils=require(_0x1ef8('0x6'));var logger=require(_0x1ef8('0x7'))(_0x1ef8('0x8'));var config=require(_0x1ef8('0x9'));var jayson=require(_0x1ef8('0xa'));var client=jayson[_0x1ef8('0xb')][_0x1ef8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x300e97,_0x118a78,_0x1636f7){return new BPromise(function(_0x42071d,_0xdef971){return client[_0x1ef8('0xd')](_0x300e97,_0x1636f7)[_0x1ef8('0xe')](function(_0x37a6a1){logger[_0x1ef8('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x118a78,_0x1ef8('0x10'));logger[_0x1ef8('0x11')](_0x1ef8('0x12'),_0x118a78,_0x1ef8('0x10'),JSON['stringify'](_0x37a6a1));if(_0x37a6a1[_0x1ef8('0x13')]){if(_0x37a6a1[_0x1ef8('0x13')][_0x1ef8('0x14')]===0x1f4){logger['error'](_0x1ef8('0x15'),_0x118a78,_0x37a6a1['error'][_0x1ef8('0x16')]);return _0xdef971(_0x37a6a1[_0x1ef8('0x13')][_0x1ef8('0x16')]);}logger[_0x1ef8('0x13')](_0x1ef8('0x15'),_0x118a78,_0x37a6a1['error'][_0x1ef8('0x16')]);return _0x42071d(_0x37a6a1['error'][_0x1ef8('0x16')]);}else{logger[_0x1ef8('0xf')](_0x1ef8('0x15'),_0x118a78,_0x1ef8('0x10'));_0x42071d(_0x37a6a1['result'][_0x1ef8('0x16')]);}})[_0x1ef8('0x17')](function(_0x43cb59){logger[_0x1ef8('0x13')]('VtigerConfiguration,\x20%s,\x20%s',_0x118a78,_0x43cb59);_0xdef971(_0x43cb59);});});} \ No newline at end of file +var _0x3277=['rpc','../../config/environment','jayson/promise','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x288371,_0x35f999){var _0x5a1ad1=function(_0xc35a07){while(--_0xc35a07){_0x288371['push'](_0x288371['shift']());}};_0x5a1ad1(++_0x35f999);}(_0x3277,0x169));var _0x7327=function(_0x6a01bd,_0xa69c9d){_0x6a01bd=_0x6a01bd-0x0;var _0x1b9bfe=_0x3277[_0x6a01bd];return _0x1b9bfe;};'use strict';var _=require(_0x7327('0x0'));var util=require(_0x7327('0x1'));var moment=require(_0x7327('0x2'));var BPromise=require(_0x7327('0x3'));var rs=require(_0x7327('0x4'));var fs=require('fs');var Redis=require(_0x7327('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7327('0x6'))(_0x7327('0x7'));var config=require(_0x7327('0x8'));var jayson=require(_0x7327('0x9'));var client=jayson['client'][_0x7327('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3825a9,_0x5b1f94,_0xd6324a){return new BPromise(function(_0x341280,_0x281c03){return client[_0x7327('0xb')](_0x3825a9,_0xd6324a)[_0x7327('0xc')](function(_0xecf3ba){logger[_0x7327('0xd')](_0x7327('0xe'),_0x5b1f94,_0x7327('0xf'));logger[_0x7327('0x10')](_0x7327('0x11'),_0x5b1f94,'request\x20sent',JSON[_0x7327('0x12')](_0xecf3ba));if(_0xecf3ba[_0x7327('0x13')]){if(_0xecf3ba[_0x7327('0x13')]['code']===0x1f4){logger['error'](_0x7327('0xe'),_0x5b1f94,_0xecf3ba[_0x7327('0x13')]['message']);return _0x281c03(_0xecf3ba['error'][_0x7327('0x14')]);}logger[_0x7327('0x13')](_0x7327('0xe'),_0x5b1f94,_0xecf3ba[_0x7327('0x13')]['message']);return _0x341280(_0xecf3ba[_0x7327('0x13')][_0x7327('0x14')]);}else{logger[_0x7327('0xd')](_0x7327('0xe'),_0x5b1f94,_0x7327('0xf'));_0x341280(_0xecf3ba[_0x7327('0x15')]['message']);}})[_0x7327('0x16')](function(_0x47fcf5){logger['error'](_0x7327('0xe'),_0x5b1f94,_0x47fcf5);_0x281c03(_0x47fcf5);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index d3ccf4a..7a03130 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 _0xc9c4=['get','isAuthenticated','/:id','post','create','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xc9c4,0x137));var _0x4c9c=function(_0x47b4f7,_0x1033e1){_0x47b4f7=_0x47b4f7-0x0;var _0x246f35=_0xc9c4[_0x47b4f7];return _0x246f35;};'use strict';var multer=require(_0x4c9c('0x0'));var util=require(_0x4c9c('0x1'));var path=require(_0x4c9c('0x2'));var timeout=require(_0x4c9c('0x3'));var express=require('express');var router=express[_0x4c9c('0x4')]();var fs_extra=require(_0x4c9c('0x5'));var auth=require(_0x4c9c('0x6'));var interaction=require(_0x4c9c('0x7'));var config=require(_0x4c9c('0x8'));var controller=require('./intVtigerField.controller');router[_0x4c9c('0x9')]('/',auth[_0x4c9c('0xa')](),controller['index']);router[_0x4c9c('0x9')](_0x4c9c('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x4c9c('0xc')]('/',auth[_0x4c9c('0xa')](),controller[_0x4c9c('0xd')]);router['put'](_0x4c9c('0xb'),auth['isAuthenticated'](),controller[_0x4c9c('0xe')]);router[_0x4c9c('0xf')](_0x4c9c('0xb'),auth[_0x4c9c('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x73b7=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x37dec8,_0x18d522){var _0x4d1d31=function(_0xceae09){while(--_0xceae09){_0x37dec8['push'](_0x37dec8['shift']());}};_0x4d1d31(++_0x18d522);}(_0x73b7,0x10b));var _0x773b=function(_0x3415a2,_0x1e901b){_0x3415a2=_0x3415a2-0x0;var _0x353036=_0x73b7[_0x3415a2];return _0x353036;};'use strict';var multer=require(_0x773b('0x0'));var util=require(_0x773b('0x1'));var path=require(_0x773b('0x2'));var timeout=require(_0x773b('0x3'));var express=require(_0x773b('0x4'));var router=express[_0x773b('0x5')]();var fs_extra=require(_0x773b('0x6'));var auth=require(_0x773b('0x7'));var interaction=require(_0x773b('0x8'));var config=require(_0x773b('0x9'));var controller=require('./intVtigerField.controller');router['get']('/',auth[_0x773b('0xa')](),controller[_0x773b('0xb')]);router[_0x773b('0xc')](_0x773b('0xd'),auth[_0x773b('0xa')](),controller[_0x773b('0xe')]);router[_0x773b('0xf')]('/',auth['isAuthenticated'](),controller[_0x773b('0x10')]);router['put']('/:id',auth[_0x773b('0xa')](),controller[_0x773b('0x11')]);router[_0x773b('0x12')](_0x773b('0xd'),auth[_0x773b('0xa')](),controller[_0x773b('0x13')]);module[_0x773b('0x14')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 0901c2b..7cf9ddc 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 _0x7af3=['STRING','ENUM','BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue','picklist'];(function(_0x450bf9,_0x1895de){var _0x268350=function(_0xebafa7){while(--_0xebafa7){_0x450bf9['push'](_0x450bf9['shift']());}};_0x268350(++_0x1895de);}(_0x7af3,0x143));var _0x37af=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x7af3[_0x279d37];return _0x530173;};'use strict';var Sequelize=require(_0x37af('0x0'));module[_0x37af('0x1')]={'type':{'type':Sequelize['ENUM'](_0x37af('0x2'),_0x37af('0x3'),_0x37af('0x4'),_0x37af('0x5'),_0x37af('0x6')),'defaultValue':_0x37af('0x2')},'content':{'type':Sequelize[_0x37af('0x7')]},'key':{'type':Sequelize[_0x37af('0x7')]},'keyType':{'type':Sequelize[_0x37af('0x8')](_0x37af('0x2'),'variable',_0x37af('0x4'))},'keyContent':{'type':Sequelize[_0x37af('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x37af('0x7')]},'customField':{'type':Sequelize[_0x37af('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x37af('0x7')]}}; \ No newline at end of file +var _0xe0a3=['keyValue','picklist','STRING','variable','BOOLEAN','exports','ENUM','string','customVariable'];(function(_0x29c342,_0x212b03){var _0x4416f7=function(_0x4df6c6){while(--_0x4df6c6){_0x29c342['push'](_0x29c342['shift']());}};_0x4416f7(++_0x212b03);}(_0xe0a3,0xb0));var _0x3e0a=function(_0x4a04de,_0x2e342c){_0x4a04de=_0x4a04de-0x0;var _0xbbe018=_0xe0a3[_0x4a04de];return _0xbbe018;};'use strict';var Sequelize=require('sequelize');module[_0x3e0a('0x0')]={'type':{'type':Sequelize[_0x3e0a('0x1')](_0x3e0a('0x2'),'variable',_0x3e0a('0x3'),_0x3e0a('0x4'),_0x3e0a('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3e0a('0x6')]},'keyType':{'type':Sequelize[_0x3e0a('0x1')](_0x3e0a('0x2'),_0x3e0a('0x7'),_0x3e0a('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3e0a('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x3e0a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3e0a('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 6b276e0..84b3174 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 _0xc774=['../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','then','destroy','sendStatus','error','stack','name','map','VtigerField','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xc774,0x19b));var _0x4c77=function(_0x4b447a,_0x4c3db4){_0x4b447a=_0x4b447a-0x0;var _0xef8968=_0xc774[_0x4b447a];return _0xef8968;};'use strict';var emlformat=require(_0x4c77('0x0'));var rimraf=require(_0x4c77('0x1'));var zipdir=require(_0x4c77('0x2'));var jsonpatch=require(_0x4c77('0x3'));var rp=require(_0x4c77('0x4'));var moment=require('moment');var BPromise=require(_0x4c77('0x5'));var Mustache=require('mustache');var util=require(_0x4c77('0x6'));var path=require(_0x4c77('0x7'));var sox=require(_0x4c77('0x8'));var csv=require(_0x4c77('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4c77('0xa'));var _=require(_0x4c77('0xb'));var squel=require(_0x4c77('0xc'));var crypto=require('crypto');var jsforce=require(_0x4c77('0xd'));var deskjs=require(_0x4c77('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4c77('0xf'));var Redis=require(_0x4c77('0x10'));var authService=require(_0x4c77('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4c77('0x12'))(_0x4c77('0x13'));var utils=require(_0x4c77('0x14'));var config=require(_0x4c77('0x15'));var licenseUtil=require(_0x4c77('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a585b,_0x10ffda){_0x10ffda=_0x10ffda||0xcc;return function(_0x51a328){if(_0x51a328){return _0x1a585b['sendStatus'](_0x10ffda);}return _0x1a585b[_0x4c77('0x17')](_0x10ffda)[_0x4c77('0x18')]();};}function respondWithResult(_0xb49aaa,_0x52ca35){_0x52ca35=_0x52ca35||0xc8;return function(_0x4ea3b5){if(_0x4ea3b5){return _0xb49aaa[_0x4c77('0x17')](_0x52ca35)[_0x4c77('0x19')](_0x4ea3b5);}};}function respondWithFilteredResult(_0x4030bc,_0x2e60e5){return function(_0x1a37fc){if(_0x1a37fc){var _0x336074=typeof _0x2e60e5[_0x4c77('0x1a')]===_0x4c77('0x1b')&&typeof _0x2e60e5[_0x4c77('0x1c')]===_0x4c77('0x1b');var _0x5da5f9=_0x1a37fc[_0x4c77('0x1d')];var _0x30c9d6=_0x336074?0x0:_0x2e60e5[_0x4c77('0x1a')];var _0x2e0c2e=_0x336074?_0x1a37fc[_0x4c77('0x1d')]:_0x2e60e5[_0x4c77('0x1a')]+_0x2e60e5['limit'];var _0x361f66;if(_0x2e0c2e>=_0x5da5f9){_0x2e0c2e=_0x5da5f9;_0x361f66=0xc8;}else{_0x361f66=0xce;}_0x4030bc[_0x4c77('0x17')](_0x361f66);return _0x4030bc['set'](_0x4c77('0x1e'),_0x30c9d6+'-'+_0x2e0c2e+'/'+_0x5da5f9)[_0x4c77('0x19')](_0x1a37fc);}return null;};}function patchUpdates(_0x35aceb){return function(_0x3f0070){try{jsonpatch[_0x4c77('0x1f')](_0x3f0070,_0x35aceb,!![]);}catch(_0xbc0c9){return BPromise[_0x4c77('0x20')](_0xbc0c9);}return _0x3f0070['save']();};}function saveUpdates(_0x5ed301,_0x542264){return function(_0x49e13b){if(_0x49e13b){return _0x49e13b['update'](_0x5ed301)[_0x4c77('0x21')](function(_0xbb1c31){return _0xbb1c31;});}return null;};}function removeEntity(_0x25bf8c,_0x5eb458){return function(_0x5828e8){if(_0x5828e8){return _0x5828e8[_0x4c77('0x22')]()[_0x4c77('0x21')](function(){_0x25bf8c[_0x4c77('0x17')](0xcc)[_0x4c77('0x18')]();});}};}function handleEntityNotFound(_0xf953ad,_0x4b34d3){return function(_0x59216c){if(!_0x59216c){_0xf953ad[_0x4c77('0x23')](0x194);}return _0x59216c;};}function handleError(_0xf198b1,_0x4fdb2e){_0x4fdb2e=_0x4fdb2e||0x1f4;return function(_0x5614d0){logger[_0x4c77('0x24')](_0x5614d0[_0x4c77('0x25')]);if(_0x5614d0[_0x4c77('0x26')]){delete _0x5614d0['name'];}_0xf198b1[_0x4c77('0x17')](_0x4fdb2e)['send'](_0x5614d0);};}exports['index']=function(_0x419d30,_0x39abf2){var _0x55ef04={},_0x5a6d16={},_0x326a2b={'count':0x0,'rows':[]};var _0x1ed15b=_[_0x4c77('0x27')](db[_0x4c77('0x28')]['rawAttributes'],function(_0x5551a0){return{'name':_0x5551a0[_0x4c77('0x29')],'type':_0x5551a0[_0x4c77('0x2a')][_0x4c77('0x2b')]};});_0x5a6d16[_0x4c77('0x2c')]=_['map'](_0x1ed15b,'name');_0x5a6d16[_0x4c77('0x2d')]=_[_0x4c77('0x2e')](_0x419d30[_0x4c77('0x2d')]);_0x5a6d16['filters']=_[_0x4c77('0x2f')](_0x5a6d16[_0x4c77('0x2c')],_0x5a6d16['query']);_0x55ef04[_0x4c77('0x30')]=_[_0x4c77('0x2f')](_0x5a6d16['model'],qs['fields'](_0x419d30[_0x4c77('0x2d')][_0x4c77('0x31')]));_0x55ef04[_0x4c77('0x30')]=_0x55ef04[_0x4c77('0x30')][_0x4c77('0x32')]?_0x55ef04[_0x4c77('0x30')]:_0x5a6d16['model'];if(!_0x419d30[_0x4c77('0x2d')][_0x4c77('0x33')]('nolimit')){_0x55ef04[_0x4c77('0x1c')]=qs[_0x4c77('0x1c')](_0x419d30['query'][_0x4c77('0x1c')]);_0x55ef04['offset']=qs[_0x4c77('0x1a')](_0x419d30[_0x4c77('0x2d')][_0x4c77('0x1a')]);}_0x55ef04[_0x4c77('0x34')]=qs[_0x4c77('0x35')](_0x419d30[_0x4c77('0x2d')]['sort']);_0x55ef04[_0x4c77('0x36')]=qs[_0x4c77('0x37')](_[_0x4c77('0x38')](_0x419d30[_0x4c77('0x2d')],_0x5a6d16[_0x4c77('0x37')]),_0x1ed15b);if(_0x419d30['query'][_0x4c77('0x39')]){_0x55ef04[_0x4c77('0x36')]=_[_0x4c77('0x3a')](_0x55ef04['where'],{'$or':_[_0x4c77('0x27')](_0x1ed15b,function(_0x2ca08e){if(_0x2ca08e[_0x4c77('0x2a')]!==_0x4c77('0x3b')){var _0x57905c={};_0x57905c[_0x2ca08e[_0x4c77('0x26')]]={'$like':'%'+_0x419d30[_0x4c77('0x2d')][_0x4c77('0x39')]+'%'};return _0x57905c;}})});}_0x55ef04=_[_0x4c77('0x3a')]({},_0x55ef04,_0x419d30[_0x4c77('0x3c')]);var _0x29dbd8={'where':_0x55ef04[_0x4c77('0x36')]};return db[_0x4c77('0x28')][_0x4c77('0x1d')](_0x29dbd8)[_0x4c77('0x21')](function(_0x38b55c){_0x326a2b[_0x4c77('0x1d')]=_0x38b55c;if(_0x419d30[_0x4c77('0x2d')][_0x4c77('0x3d')]){_0x55ef04[_0x4c77('0x3e')]=[{'all':!![]}];}return db[_0x4c77('0x28')][_0x4c77('0x3f')](_0x55ef04);})[_0x4c77('0x21')](function(_0x253b93){_0x326a2b[_0x4c77('0x40')]=_0x253b93;return _0x326a2b;})['then'](respondWithFilteredResult(_0x39abf2,_0x55ef04))['catch'](handleError(_0x39abf2,null));};exports[_0x4c77('0x41')]=function(_0x477697,_0x48e022){var _0x158a78={'raw':!![],'where':{'id':_0x477697[_0x4c77('0x42')]['id']}},_0x2f2cfa={};_0x2f2cfa[_0x4c77('0x2c')]=_[_0x4c77('0x2e')](db[_0x4c77('0x28')]['rawAttributes']);_0x2f2cfa[_0x4c77('0x2d')]=_[_0x4c77('0x2e')](_0x477697[_0x4c77('0x2d')]);_0x2f2cfa[_0x4c77('0x37')]=_['intersection'](_0x2f2cfa['model'],_0x2f2cfa[_0x4c77('0x2d')]);_0x158a78[_0x4c77('0x30')]=_['intersection'](_0x2f2cfa[_0x4c77('0x2c')],qs[_0x4c77('0x31')](_0x477697['query'][_0x4c77('0x31')]));_0x158a78[_0x4c77('0x30')]=_0x158a78[_0x4c77('0x30')][_0x4c77('0x32')]?_0x158a78[_0x4c77('0x30')]:_0x2f2cfa[_0x4c77('0x2c')];if(_0x477697[_0x4c77('0x2d')][_0x4c77('0x3d')]){_0x158a78[_0x4c77('0x3e')]=[{'all':!![]}];}_0x158a78=_[_0x4c77('0x3a')]({},_0x158a78,_0x477697[_0x4c77('0x3c')]);return db[_0x4c77('0x28')][_0x4c77('0x43')](_0x158a78)[_0x4c77('0x21')](handleEntityNotFound(_0x48e022,null))['then'](respondWithResult(_0x48e022,null))[_0x4c77('0x44')](handleError(_0x48e022,null));};exports['create']=function(_0x1d94af,_0x22edb9){return db[_0x4c77('0x28')][_0x4c77('0x45')](_0x1d94af[_0x4c77('0x46')],{})[_0x4c77('0x21')](respondWithResult(_0x22edb9,0xc9))[_0x4c77('0x44')](handleError(_0x22edb9,null));};exports[_0x4c77('0x47')]=function(_0x4a2e4e,_0x3d58fd){if(_0x4a2e4e[_0x4c77('0x46')]['id']){delete _0x4a2e4e[_0x4c77('0x46')]['id'];}return db['VtigerField'][_0x4c77('0x43')]({'where':{'id':_0x4a2e4e[_0x4c77('0x42')]['id']}})[_0x4c77('0x21')](handleEntityNotFound(_0x3d58fd,null))[_0x4c77('0x21')](saveUpdates(_0x4a2e4e[_0x4c77('0x46')],null))['then'](respondWithResult(_0x3d58fd,null))['catch'](handleError(_0x3d58fd,null));};exports[_0x4c77('0x22')]=function(_0x38656c,_0xd601da){return db[_0x4c77('0x28')][_0x4c77('0x43')]({'where':{'id':_0x38656c['params']['id']}})[_0x4c77('0x21')](handleEntityNotFound(_0xd601da,null))[_0x4c77('0x21')](removeEntity(_0xd601da,null))['catch'](handleError(_0xd601da,null));}; \ No newline at end of file +var _0x07a4=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','error','name','index','map','VtigerField','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','keys','rawAttributes','include','find','create','body','params','destroy','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js'];(function(_0x2c6fb9,_0xc7d7c0){var _0x49fd5e=function(_0x3dcbaf){while(--_0x3dcbaf){_0x2c6fb9['push'](_0x2c6fb9['shift']());}};_0x49fd5e(++_0xc7d7c0);}(_0x07a4,0x1ef));var _0x407a=function(_0x448be6,_0xb6213e){_0x448be6=_0x448be6-0x0;var _0x15d039=_0x07a4[_0x448be6];return _0x15d039;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x407a('0x0'));var zipdir=require(_0x407a('0x1'));var jsonpatch=require(_0x407a('0x2'));var rp=require('request-promise');var moment=require(_0x407a('0x3'));var BPromise=require(_0x407a('0x4'));var Mustache=require(_0x407a('0x5'));var util=require(_0x407a('0x6'));var path=require(_0x407a('0x7'));var sox=require(_0x407a('0x8'));var csv=require(_0x407a('0x9'));var ejs=require(_0x407a('0xa'));var fs=require('fs');var fs_extra=require(_0x407a('0xb'));var _=require(_0x407a('0xc'));var squel=require(_0x407a('0xd'));var crypto=require(_0x407a('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x407a('0xf'));var toCsv=require(_0x407a('0x9'));var querystring=require('querystring');var Papa=require(_0x407a('0x10'));var Redis=require(_0x407a('0x11'));var authService=require(_0x407a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x407a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x407a('0x14'))(_0x407a('0x15'));var utils=require('../../config/utils');var config=require(_0x407a('0x16'));var licenseUtil=require(_0x407a('0x17'));var db=require(_0x407a('0x18'))['db'];function respondWithStatusCode(_0x4ae7ef,_0x53f6d6){_0x53f6d6=_0x53f6d6||0xcc;return function(_0x3f575a){if(_0x3f575a){return _0x4ae7ef[_0x407a('0x19')](_0x53f6d6);}return _0x4ae7ef['status'](_0x53f6d6)[_0x407a('0x1a')]();};}function respondWithResult(_0x324901,_0x629221){_0x629221=_0x629221||0xc8;return function(_0x5e912c){if(_0x5e912c){return _0x324901[_0x407a('0x1b')](_0x629221)[_0x407a('0x1c')](_0x5e912c);}};}function respondWithFilteredResult(_0x3081df,_0x22960d){return function(_0xd764e6){if(_0xd764e6){var _0x25cf1a=typeof _0x22960d[_0x407a('0x1d')]===_0x407a('0x1e')&&typeof _0x22960d[_0x407a('0x1f')]==='undefined';var _0x22ae07=_0xd764e6[_0x407a('0x20')];var _0x129737=_0x25cf1a?0x0:_0x22960d[_0x407a('0x1d')];var _0x175321=_0x25cf1a?_0xd764e6[_0x407a('0x20')]:_0x22960d['offset']+_0x22960d[_0x407a('0x1f')];var _0x105a66;if(_0x175321>=_0x22ae07){_0x175321=_0x22ae07;_0x105a66=0xc8;}else{_0x105a66=0xce;}_0x3081df['status'](_0x105a66);return _0x3081df['set'](_0x407a('0x21'),_0x129737+'-'+_0x175321+'/'+_0x22ae07)['json'](_0xd764e6);}return null;};}function patchUpdates(_0x14cb85){return function(_0x4c9df6){try{jsonpatch[_0x407a('0x22')](_0x4c9df6,_0x14cb85,!![]);}catch(_0x444430){return BPromise['reject'](_0x444430);}return _0x4c9df6[_0x407a('0x23')]();};}function saveUpdates(_0x231617,_0x5b3780){return function(_0x1e0c64){if(_0x1e0c64){return _0x1e0c64['update'](_0x231617)[_0x407a('0x24')](function(_0xd30ef6){return _0xd30ef6;});}return null;};}function removeEntity(_0x4bdbd0,_0x22c649){return function(_0x5cdcc9){if(_0x5cdcc9){return _0x5cdcc9['destroy']()[_0x407a('0x24')](function(){_0x4bdbd0[_0x407a('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x957be2,_0x580647){return function(_0x5f2586){if(!_0x5f2586){_0x957be2[_0x407a('0x19')](0x194);}return _0x5f2586;};}function handleError(_0x1387b9,_0xde8c65){_0xde8c65=_0xde8c65||0x1f4;return function(_0x2ad01c){logger[_0x407a('0x25')](_0x2ad01c['stack']);if(_0x2ad01c[_0x407a('0x26')]){delete _0x2ad01c[_0x407a('0x26')];}_0x1387b9[_0x407a('0x1b')](_0xde8c65)['send'](_0x2ad01c);};}exports[_0x407a('0x27')]=function(_0x1062e0,_0x1baaf3){var _0x452a46={},_0x186b67={},_0x7b665a={'count':0x0,'rows':[]};var _0x167317=_[_0x407a('0x28')](db[_0x407a('0x29')]['rawAttributes'],function(_0x731bf2){return{'name':_0x731bf2[_0x407a('0x2a')],'type':_0x731bf2[_0x407a('0x2b')][_0x407a('0x2c')]};});_0x186b67['model']=_[_0x407a('0x28')](_0x167317,_0x407a('0x26'));_0x186b67[_0x407a('0x2d')]=_['keys'](_0x1062e0[_0x407a('0x2d')]);_0x186b67[_0x407a('0x2e')]=_[_0x407a('0x2f')](_0x186b67[_0x407a('0x30')],_0x186b67[_0x407a('0x2d')]);_0x452a46[_0x407a('0x31')]=_['intersection'](_0x186b67['model'],qs[_0x407a('0x32')](_0x1062e0[_0x407a('0x2d')][_0x407a('0x32')]));_0x452a46[_0x407a('0x31')]=_0x452a46[_0x407a('0x31')][_0x407a('0x33')]?_0x452a46[_0x407a('0x31')]:_0x186b67[_0x407a('0x30')];if(!_0x1062e0[_0x407a('0x2d')][_0x407a('0x34')]('nolimit')){_0x452a46[_0x407a('0x1f')]=qs[_0x407a('0x1f')](_0x1062e0[_0x407a('0x2d')][_0x407a('0x1f')]);_0x452a46[_0x407a('0x1d')]=qs['offset'](_0x1062e0['query'][_0x407a('0x1d')]);}_0x452a46[_0x407a('0x35')]=qs[_0x407a('0x36')](_0x1062e0[_0x407a('0x2d')]['sort']);_0x452a46[_0x407a('0x37')]=qs['filters'](_['pick'](_0x1062e0[_0x407a('0x2d')],_0x186b67[_0x407a('0x2e')]),_0x167317);if(_0x1062e0[_0x407a('0x2d')][_0x407a('0x38')]){_0x452a46[_0x407a('0x37')]=_[_0x407a('0x39')](_0x452a46[_0x407a('0x37')],{'$or':_['map'](_0x167317,function(_0x424be2){if(_0x424be2[_0x407a('0x2b')]!==_0x407a('0x3a')){var _0x493fc6={};_0x493fc6[_0x424be2[_0x407a('0x26')]]={'$like':'%'+_0x1062e0[_0x407a('0x2d')][_0x407a('0x38')]+'%'};return _0x493fc6;}})});}_0x452a46=_[_0x407a('0x39')]({},_0x452a46,_0x1062e0[_0x407a('0x3b')]);var _0x49a603={'where':_0x452a46[_0x407a('0x37')]};return db[_0x407a('0x29')][_0x407a('0x20')](_0x49a603)[_0x407a('0x24')](function(_0x260246){_0x7b665a['count']=_0x260246;if(_0x1062e0[_0x407a('0x2d')][_0x407a('0x3c')]){_0x452a46['include']=[{'all':!![]}];}return db[_0x407a('0x29')][_0x407a('0x3d')](_0x452a46);})[_0x407a('0x24')](function(_0x1597f4){_0x7b665a[_0x407a('0x3e')]=_0x1597f4;return _0x7b665a;})[_0x407a('0x24')](respondWithFilteredResult(_0x1baaf3,_0x452a46))[_0x407a('0x3f')](handleError(_0x1baaf3,null));};exports[_0x407a('0x40')]=function(_0x4c5bcd,_0x571aec){var _0xd67be8={'raw':!![],'where':{'id':_0x4c5bcd['params']['id']}},_0x220795={};_0x220795[_0x407a('0x30')]=_[_0x407a('0x41')](db['VtigerField'][_0x407a('0x42')]);_0x220795[_0x407a('0x2d')]=_[_0x407a('0x41')](_0x4c5bcd[_0x407a('0x2d')]);_0x220795[_0x407a('0x2e')]=_[_0x407a('0x2f')](_0x220795[_0x407a('0x30')],_0x220795[_0x407a('0x2d')]);_0xd67be8[_0x407a('0x31')]=_['intersection'](_0x220795['model'],qs[_0x407a('0x32')](_0x4c5bcd[_0x407a('0x2d')][_0x407a('0x32')]));_0xd67be8['attributes']=_0xd67be8['attributes'][_0x407a('0x33')]?_0xd67be8[_0x407a('0x31')]:_0x220795[_0x407a('0x30')];if(_0x4c5bcd['query'][_0x407a('0x3c')]){_0xd67be8[_0x407a('0x43')]=[{'all':!![]}];}_0xd67be8=_[_0x407a('0x39')]({},_0xd67be8,_0x4c5bcd[_0x407a('0x3b')]);return db['VtigerField'][_0x407a('0x44')](_0xd67be8)['then'](handleEntityNotFound(_0x571aec,null))[_0x407a('0x24')](respondWithResult(_0x571aec,null))[_0x407a('0x3f')](handleError(_0x571aec,null));};exports[_0x407a('0x45')]=function(_0x3ebd92,_0x530bfb){return db[_0x407a('0x29')][_0x407a('0x45')](_0x3ebd92[_0x407a('0x46')],{})[_0x407a('0x24')](respondWithResult(_0x530bfb,0xc9))['catch'](handleError(_0x530bfb,null));};exports['update']=function(_0x179253,_0x1c624c){if(_0x179253[_0x407a('0x46')]['id']){delete _0x179253[_0x407a('0x46')]['id'];}return db['VtigerField'][_0x407a('0x44')]({'where':{'id':_0x179253[_0x407a('0x47')]['id']}})['then'](handleEntityNotFound(_0x1c624c,null))[_0x407a('0x24')](saveUpdates(_0x179253[_0x407a('0x46')],null))['then'](respondWithResult(_0x1c624c,null))[_0x407a('0x3f')](handleError(_0x1c624c,null));};exports[_0x407a('0x48')]=function(_0x37d723,_0x3f5814){return db[_0x407a('0x29')][_0x407a('0x44')]({'where':{'id':_0x37d723['params']['id']}})[_0x407a('0x24')](handleEntityNotFound(_0x3f5814,null))[_0x407a('0x24')](removeEntity(_0x3f5814,null))['catch'](handleError(_0x3f5814,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index c7d4f78..52902ae 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 _0xc6c3=['api','moment','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','VtigerField','vtiger_unique_index','idField','../../config/logger'];(function(_0xb61211,_0x2a2adc){var _0x1868b2=function(_0x4c5496){while(--_0x4c5496){_0xb61211['push'](_0xb61211['shift']());}};_0x1868b2(++_0x2a2adc);}(_0xc6c3,0x6d));var _0x3c6c=function(_0x655a56,_0x3c369c){_0x655a56=_0x655a56-0x0;var _0x4dafce=_0xc6c3[_0x655a56];return _0x4dafce;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3c6c('0x0'))(_0x3c6c('0x1'));var moment=require(_0x3c6c('0x2'));var BPromise=require('bluebird');var rp=require(_0x3c6c('0x3'));var fs=require('fs');var path=require(_0x3c6c('0x4'));var rimraf=require(_0x3c6c('0x5'));var config=require(_0x3c6c('0x6'));var attributes=require(_0x3c6c('0x7'));module['exports']=function(_0x5b623a,_0x24a926){return _0x5b623a['define'](_0x3c6c('0x8'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x3c6c('0x9'),'fields':[_0x3c6c('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x04fc=['api','moment','../../config/environment','./intVtigerField.attributes','exports','define','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','util'];(function(_0xf5d391,_0x26e948){var _0x2cb522=function(_0x93d46f){while(--_0x93d46f){_0xf5d391['push'](_0xf5d391['shift']());}};_0x2cb522(++_0x26e948);}(_0x04fc,0xbe));var _0xc04f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x04fc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc04f('0x0'));var util=require(_0xc04f('0x1'));var logger=require('../../config/logger')(_0xc04f('0x2'));var moment=require(_0xc04f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc04f('0x4'));var attributes=require(_0xc04f('0x5'));module[_0xc04f('0x6')]=function(_0x25ba06,_0xd84d7b){return _0x25ba06[_0xc04f('0x7')]('VtigerField',attributes,{'tableName':_0xc04f('0x8'),'paranoid':![],'indexes':[{'name':_0xc04f('0x9'),'fields':[_0xc04f('0xa'),_0xc04f('0xb')],'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 54e28ef..4cad4df 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 _0x4a04=['../../config/logger','jayson/promise','client','then','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','error','VtigerField,\x20%s,\x20%s','message','result','moment','bluebird','randomstring','ioredis'];(function(_0x4e928c,_0x509f7a){var _0x4cb2cf=function(_0x17db67){while(--_0x17db67){_0x4e928c['push'](_0x4e928c['shift']());}};_0x4cb2cf(++_0x509f7a);}(_0x4a04,0x18c));var _0x44a0=function(_0x737a1f,_0x235fef){_0x737a1f=_0x737a1f-0x0;var _0x16eba1=_0x4a04[_0x737a1f];return _0x16eba1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x44a0('0x0'));var BPromise=require(_0x44a0('0x1'));var rs=require(_0x44a0('0x2'));var fs=require('fs');var Redis=require(_0x44a0('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x44a0('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x44a0('0x5'));var client=jayson[_0x44a0('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x551d57,_0x25ffa1,_0x36d4db){return new BPromise(function(_0x52d9bb,_0x482432){return client['request'](_0x551d57,_0x36d4db)[_0x44a0('0x7')](function(_0x304eab){logger[_0x44a0('0x8')]('VtigerField,\x20%s,\x20%s',_0x25ffa1,_0x44a0('0x9'));logger[_0x44a0('0xa')](_0x44a0('0xb'),_0x25ffa1,'request\x20sent',JSON['stringify'](_0x304eab));if(_0x304eab[_0x44a0('0xc')]){if(_0x304eab[_0x44a0('0xc')]['code']===0x1f4){logger['error'](_0x44a0('0xd'),_0x25ffa1,_0x304eab['error']['message']);return _0x482432(_0x304eab[_0x44a0('0xc')]['message']);}logger[_0x44a0('0xc')]('VtigerField,\x20%s,\x20%s',_0x25ffa1,_0x304eab[_0x44a0('0xc')]['message']);return _0x52d9bb(_0x304eab[_0x44a0('0xc')][_0x44a0('0xe')]);}else{logger[_0x44a0('0x8')](_0x44a0('0xd'),_0x25ffa1,'request\x20sent');_0x52d9bb(_0x304eab[_0x44a0('0xf')][_0x44a0('0xe')]);}})['catch'](function(_0x52971b){logger[_0x44a0('0xc')](_0x44a0('0xd'),_0x25ffa1,_0x52971b);_0x482432(_0x52971b);});});} \ No newline at end of file +var _0xd420=['client','http','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x57d47a,_0xe25f3a){var _0x7a3652=function(_0x1c7c97){while(--_0x1c7c97){_0x57d47a['push'](_0x57d47a['shift']());}};_0x7a3652(++_0xe25f3a);}(_0xd420,0x1d9));var _0x0d42=function(_0x6851de,_0x1c6df7){_0x6851de=_0x6851de-0x0;var _0x228361=_0xd420[_0x6851de];return _0x228361;};'use strict';var _=require(_0x0d42('0x0'));var util=require(_0x0d42('0x1'));var moment=require('moment');var BPromise=require(_0x0d42('0x2'));var rs=require(_0x0d42('0x3'));var fs=require('fs');var Redis=require(_0x0d42('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0d42('0x5'));var logger=require(_0x0d42('0x6'))(_0x0d42('0x7'));var config=require(_0x0d42('0x8'));var jayson=require(_0x0d42('0x9'));var client=jayson[_0x0d42('0xa')][_0x0d42('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46be19,_0x2649d5,_0x494507){return new BPromise(function(_0x3fa332,_0x55063e){return client['request'](_0x46be19,_0x494507)['then'](function(_0x54ea8b){logger['info'](_0x0d42('0xc'),_0x2649d5,_0x0d42('0xd'));logger[_0x0d42('0xe')](_0x0d42('0xf'),_0x2649d5,_0x0d42('0xd'),JSON[_0x0d42('0x10')](_0x54ea8b));if(_0x54ea8b['error']){if(_0x54ea8b[_0x0d42('0x11')][_0x0d42('0x12')]===0x1f4){logger[_0x0d42('0x11')](_0x0d42('0xc'),_0x2649d5,_0x54ea8b[_0x0d42('0x11')][_0x0d42('0x13')]);return _0x55063e(_0x54ea8b[_0x0d42('0x11')][_0x0d42('0x13')]);}logger[_0x0d42('0x11')](_0x0d42('0xc'),_0x2649d5,_0x54ea8b[_0x0d42('0x11')][_0x0d42('0x13')]);return _0x3fa332(_0x54ea8b['error'][_0x0d42('0x13')]);}else{logger[_0x0d42('0x14')](_0x0d42('0xc'),_0x2649d5,_0x0d42('0xd'));_0x3fa332(_0x54ea8b['result'][_0x0d42('0x13')]);}})['catch'](function(_0x132c4e){logger[_0x0d42('0x11')]('VtigerField,\x20%s,\x20%s',_0x2649d5,_0x132c4e);_0x55063e(_0x132c4e);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 31e7e12..de71fd2 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 _0xff5b=['isAuthenticated','index','/:id','show','getConfigurations','getFields','post','create','/:id/configurations','put','delete','destroy','path','express','../../components/auth/service','../../config/environment','get'];(function(_0x1947d7,_0x2d4f06){var _0x3a949f=function(_0x451c25){while(--_0x451c25){_0x1947d7['push'](_0x1947d7['shift']());}};_0x3a949f(++_0x2d4f06);}(_0xff5b,0x1e8));var _0xbff5=function(_0x36d14c,_0x1c2ef8){_0x36d14c=_0x36d14c-0x0;var _0x24cd2d=_0xff5b[_0x36d14c];return _0x24cd2d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xbff5('0x0'));var timeout=require('connect-timeout');var express=require(_0xbff5('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbff5('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xbff5('0x3'));var controller=require('./intZendeskAccount.controller');router[_0xbff5('0x4')]('/',auth[_0xbff5('0x5')](),controller[_0xbff5('0x6')]);router[_0xbff5('0x4')](_0xbff5('0x7'),auth[_0xbff5('0x5')](),controller[_0xbff5('0x8')]);router[_0xbff5('0x4')]('/:id/configurations',auth[_0xbff5('0x5')](),controller[_0xbff5('0x9')]);router[_0xbff5('0x4')]('/:id/fields',auth[_0xbff5('0x5')](),controller[_0xbff5('0xa')]);router[_0xbff5('0xb')]('/',auth[_0xbff5('0x5')](),controller[_0xbff5('0xc')]);router[_0xbff5('0xb')](_0xbff5('0xd'),auth[_0xbff5('0x5')](),controller['addConfiguration']);router[_0xbff5('0xe')](_0xbff5('0x7'),auth[_0xbff5('0x5')](),controller['update']);router[_0xbff5('0xf')](_0xbff5('0x7'),auth[_0xbff5('0x5')](),controller[_0xbff5('0x10')]);module['exports']=router; \ No newline at end of file +var _0x5453=['isAuthenticated','getConfigurations','getFields','post','create','addConfiguration','/:id','destroy','exports','util','path','express','Router','fs-extra','../../config/environment','./intZendeskAccount.controller','get','/:id/configurations'];(function(_0x303444,_0x48e416){var _0x3c73cf=function(_0x2853a0){while(--_0x2853a0){_0x303444['push'](_0x303444['shift']());}};_0x3c73cf(++_0x48e416);}(_0x5453,0x117));var _0x3545=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x5453[_0x1cc8fe];return _0x230054;};'use strict';var multer=require('multer');var util=require(_0x3545('0x0'));var path=require(_0x3545('0x1'));var timeout=require('connect-timeout');var express=require(_0x3545('0x2'));var router=express[_0x3545('0x3')]();var fs_extra=require(_0x3545('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3545('0x5'));var controller=require(_0x3545('0x6'));router[_0x3545('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3545('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x3545('0x7')](_0x3545('0x8'),auth[_0x3545('0x9')](),controller[_0x3545('0xa')]);router[_0x3545('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0x3545('0xb')]);router[_0x3545('0xc')]('/',auth['isAuthenticated'](),controller[_0x3545('0xd')]);router[_0x3545('0xc')](_0x3545('0x8'),auth[_0x3545('0x9')](),controller[_0x3545('0xe')]);router['put'](_0x3545('0xf'),auth[_0x3545('0x9')](),controller['update']);router['delete'](_0x3545('0xf'),auth['isAuthenticated'](),controller[_0x3545('0x10')]);module[_0x3545('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 426948f..eb3816a 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 _0x1751=['STRING','username','remoteUri','ENUM','password','token','integrationTab','newTab','sequelize','exports'];(function(_0x4e8d4f,_0x111b0c){var _0x28fe1c=function(_0xcd6396){while(--_0xcd6396){_0x4e8d4f['push'](_0x4e8d4f['shift']());}};_0x28fe1c(++_0x111b0c);}(_0x1751,0x76));var _0x1175=function(_0x3789a6,_0x3656fe){_0x3789a6=_0x3789a6-0x0;var _0x585a6e=_0x1751[_0x3789a6];return _0x585a6e;};'use strict';var Sequelize=require(_0x1175('0x0'));module[_0x1175('0x1')]={'name':{'type':Sequelize[_0x1175('0x2')]},'description':{'type':Sequelize[_0x1175('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x1175('0x3')},'password':{'type':Sequelize[_0x1175('0x2')]},'token':{'type':Sequelize[_0x1175('0x2')]},'remoteUri':{'type':Sequelize[_0x1175('0x2')],'unique':_0x1175('0x4')},'authType':{'type':Sequelize[_0x1175('0x5')](_0x1175('0x6'),_0x1175('0x7')),'defaultValue':_0x1175('0x6')},'serverUrl':{'type':Sequelize[_0x1175('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1175('0x5')](_0x1175('0x8'),_0x1175('0x9')),'defaultValue':_0x1175('0x8')}}; \ No newline at end of file +var _0x1d11=['STRING','username','remoteUri','ENUM','token','integrationTab','sequelize','exports'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x1d11,0xb6));var _0x11d1=function(_0x225a65,_0x106e43){_0x225a65=_0x225a65-0x0;var _0x240f37=_0x1d11[_0x225a65];return _0x240f37;};'use strict';var Sequelize=require(_0x11d1('0x0'));module[_0x11d1('0x1')]={'name':{'type':Sequelize[_0x11d1('0x2')]},'description':{'type':Sequelize[_0x11d1('0x2')]},'username':{'type':Sequelize[_0x11d1('0x2')],'unique':_0x11d1('0x3')},'password':{'type':Sequelize[_0x11d1('0x2')]},'token':{'type':Sequelize[_0x11d1('0x2')]},'remoteUri':{'type':Sequelize[_0x11d1('0x2')],'unique':_0x11d1('0x4')},'authType':{'type':Sequelize[_0x11d1('0x5')]('password',_0x11d1('0x6')),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x11d1('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x11d1('0x5')]('integrationTab','newTab'),'defaultValue':_0x11d1('0x7')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 3e94cea..183764e 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 _0xe5b5=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','getConfigurations','findOne','ZendeskConfiguration','pick','map','addConfiguration','channel','Descriptions','getDescriptions','ZendeskField','Subjects','getFields','username','password','token','authType','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','Basic\x20%s','base64','%s/token:%s','toString','Sequelize','Unknown\x20authentication\x20type','group','assignee','remove','position','title','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','ZendeskAccount','rawAttributes','fieldName','type','model','query','keys','intersection'];(function(_0x2cfe2,_0x3b2e20){var _0x287633=function(_0x52f550){while(--_0x52f550){_0x2cfe2['push'](_0x2cfe2['shift']());}};_0x287633(++_0x3b2e20);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0xe5b5[_0x490be3];return _0x3f5140;};'use strict';var emlformat=require(_0x5e5b('0x0'));var rimraf=require(_0x5e5b('0x1'));var zipdir=require(_0x5e5b('0x2'));var jsonpatch=require(_0x5e5b('0x3'));var rp=require(_0x5e5b('0x4'));var moment=require(_0x5e5b('0x5'));var BPromise=require(_0x5e5b('0x6'));var Mustache=require(_0x5e5b('0x7'));var util=require(_0x5e5b('0x8'));var path=require(_0x5e5b('0x9'));var sox=require(_0x5e5b('0xa'));var csv=require(_0x5e5b('0xb'));var ejs=require(_0x5e5b('0xc'));var fs=require('fs');var fs_extra=require(_0x5e5b('0xd'));var _=require(_0x5e5b('0xe'));var squel=require(_0x5e5b('0xf'));var crypto=require(_0x5e5b('0x10'));var jsforce=require(_0x5e5b('0x11'));var deskjs=require(_0x5e5b('0x12'));var toCsv=require(_0x5e5b('0xb'));var querystring=require(_0x5e5b('0x13'));var Papa=require(_0x5e5b('0x14'));var Redis=require(_0x5e5b('0x15'));var authService=require('../../components/auth/service');var qs=require(_0x5e5b('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5e5b('0x17'));var logger=require(_0x5e5b('0x18'))(_0x5e5b('0x19'));var utils=require(_0x5e5b('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x5e5b('0x1b'));function respondWithStatusCode(_0x18434e,_0x4559a0){_0x4559a0=_0x4559a0||0xcc;return function(_0x1694ff){if(_0x1694ff){return _0x18434e[_0x5e5b('0x1c')](_0x4559a0);}return _0x18434e[_0x5e5b('0x1d')](_0x4559a0)[_0x5e5b('0x1e')]();};}function respondWithResult(_0x49edd0,_0x2b37fa){_0x2b37fa=_0x2b37fa||0xc8;return function(_0x2e92c3){if(_0x2e92c3){return _0x49edd0['status'](_0x2b37fa)[_0x5e5b('0x1f')](_0x2e92c3);}};}function respondWithFilteredResult(_0x578c14,_0x4e9509){return function(_0x13a1cb){if(_0x13a1cb){var _0x444435=typeof _0x4e9509[_0x5e5b('0x20')]==='undefined'&&typeof _0x4e9509[_0x5e5b('0x21')]==='undefined';var _0x1796af=_0x13a1cb[_0x5e5b('0x22')];var _0x4c5f9a=_0x444435?0x0:_0x4e9509[_0x5e5b('0x20')];var _0x1560e1=_0x444435?_0x13a1cb[_0x5e5b('0x22')]:_0x4e9509['offset']+_0x4e9509[_0x5e5b('0x21')];var _0x3f1103;if(_0x1560e1>=_0x1796af){_0x1560e1=_0x1796af;_0x3f1103=0xc8;}else{_0x3f1103=0xce;}_0x578c14['status'](_0x3f1103);return _0x578c14[_0x5e5b('0x23')](_0x5e5b('0x24'),_0x4c5f9a+'-'+_0x1560e1+'/'+_0x1796af)[_0x5e5b('0x1f')](_0x13a1cb);}return null;};}function patchUpdates(_0x2d8252){return function(_0x2cb0bb){try{jsonpatch[_0x5e5b('0x25')](_0x2cb0bb,_0x2d8252,!![]);}catch(_0x93df5c){return BPromise[_0x5e5b('0x26')](_0x93df5c);}return _0x2cb0bb['save']();};}function saveUpdates(_0x512e46,_0x256a00){return function(_0x3326fb){if(_0x3326fb){return _0x3326fb[_0x5e5b('0x27')](_0x512e46)[_0x5e5b('0x28')](function(_0x2e38ed){return _0x2e38ed;});}return null;};}function removeEntity(_0x28cd95,_0x135c6c){return function(_0x18903e){if(_0x18903e){return _0x18903e[_0x5e5b('0x29')]()[_0x5e5b('0x28')](function(){_0x28cd95[_0x5e5b('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ebb11,_0x75800d){return function(_0x3527a8){if(!_0x3527a8){_0x1ebb11['sendStatus'](0x194);}return _0x3527a8;};}function handleError(_0x988e5d,_0xdb2863){_0xdb2863=_0xdb2863||0x1f4;return function(_0x5ee866){logger[_0x5e5b('0x2a')](_0x5ee866[_0x5e5b('0x2b')]);if(_0x5ee866[_0x5e5b('0x2c')]){delete _0x5ee866[_0x5e5b('0x2c')];}_0x988e5d[_0x5e5b('0x1d')](_0xdb2863)[_0x5e5b('0x2d')](_0x5ee866);};}exports[_0x5e5b('0x2e')]=function(_0x2b4351,_0x3f6b25){var _0x42da3b={},_0xcb272c={},_0x28157a={'count':0x0,'rows':[]};var _0x4ed688=_['map'](db[_0x5e5b('0x2f')][_0x5e5b('0x30')],function(_0xb68419){return{'name':_0xb68419[_0x5e5b('0x31')],'type':_0xb68419[_0x5e5b('0x32')]['key']};});_0xcb272c[_0x5e5b('0x33')]=_['map'](_0x4ed688,_0x5e5b('0x2c'));_0xcb272c[_0x5e5b('0x34')]=_[_0x5e5b('0x35')](_0x2b4351[_0x5e5b('0x34')]);_0xcb272c['filters']=_[_0x5e5b('0x36')](_0xcb272c[_0x5e5b('0x33')],_0xcb272c['query']);_0x42da3b[_0x5e5b('0x37')]=_[_0x5e5b('0x36')](_0xcb272c[_0x5e5b('0x33')],qs[_0x5e5b('0x38')](_0x2b4351[_0x5e5b('0x34')][_0x5e5b('0x38')]));_0x42da3b[_0x5e5b('0x37')]=_0x42da3b[_0x5e5b('0x37')]['length']?_0x42da3b[_0x5e5b('0x37')]:_0xcb272c[_0x5e5b('0x33')];if(!_0x2b4351[_0x5e5b('0x34')][_0x5e5b('0x39')](_0x5e5b('0x3a'))){_0x42da3b[_0x5e5b('0x21')]=qs['limit'](_0x2b4351['query'][_0x5e5b('0x21')]);_0x42da3b[_0x5e5b('0x20')]=qs[_0x5e5b('0x20')](_0x2b4351['query'][_0x5e5b('0x20')]);}_0x42da3b[_0x5e5b('0x3b')]=qs[_0x5e5b('0x3c')](_0x2b4351[_0x5e5b('0x34')]['sort']);_0x42da3b[_0x5e5b('0x3d')]=qs[_0x5e5b('0x3e')](_['pick'](_0x2b4351['query'],_0xcb272c[_0x5e5b('0x3e')]),_0x4ed688);if(_0x2b4351[_0x5e5b('0x34')][_0x5e5b('0x3f')]){_0x42da3b['where']=_[_0x5e5b('0x40')](_0x42da3b['where'],{'$or':_['map'](_0x4ed688,function(_0x261057){if(_0x261057[_0x5e5b('0x32')]!==_0x5e5b('0x41')){var _0xc666f7={};_0xc666f7[_0x261057[_0x5e5b('0x2c')]]={'$like':'%'+_0x2b4351[_0x5e5b('0x34')][_0x5e5b('0x3f')]+'%'};return _0xc666f7;}})});}_0x42da3b=_[_0x5e5b('0x40')]({},_0x42da3b,_0x2b4351[_0x5e5b('0x42')]);var _0x53b88f={'where':_0x42da3b[_0x5e5b('0x3d')]};return db[_0x5e5b('0x2f')]['count'](_0x53b88f)[_0x5e5b('0x28')](function(_0x4b54b0){_0x28157a[_0x5e5b('0x22')]=_0x4b54b0;if(_0x2b4351[_0x5e5b('0x34')][_0x5e5b('0x43')]){_0x42da3b[_0x5e5b('0x44')]=[{'all':!![]}];}return db[_0x5e5b('0x2f')][_0x5e5b('0x45')](_0x42da3b);})[_0x5e5b('0x28')](function(_0x24d81f){_0x28157a[_0x5e5b('0x46')]=_0x24d81f;return _0x28157a;})[_0x5e5b('0x28')](respondWithFilteredResult(_0x3f6b25,_0x42da3b))[_0x5e5b('0x47')](handleError(_0x3f6b25,null));};exports['show']=function(_0x2b81dd,_0x40e8ce){var _0x46fec9={'raw':![],'where':{'id':_0x2b81dd[_0x5e5b('0x48')]['id']}},_0x570413={};_0x570413[_0x5e5b('0x33')]=_['keys'](db[_0x5e5b('0x2f')][_0x5e5b('0x30')]);_0x570413['query']=_[_0x5e5b('0x35')](_0x2b81dd['query']);_0x570413['filters']=_['intersection'](_0x570413[_0x5e5b('0x33')],_0x570413['query']);_0x46fec9[_0x5e5b('0x37')]=_['intersection'](_0x570413[_0x5e5b('0x33')],qs[_0x5e5b('0x38')](_0x2b81dd[_0x5e5b('0x34')][_0x5e5b('0x38')]));_0x46fec9[_0x5e5b('0x37')]=_0x46fec9[_0x5e5b('0x37')][_0x5e5b('0x49')]?_0x46fec9['attributes']:_0x570413['model'];if(_0x2b81dd[_0x5e5b('0x34')]['includeAll']){_0x46fec9['include']=[{'all':!![]}];}_0x46fec9=_['merge']({},_0x46fec9,_0x2b81dd[_0x5e5b('0x42')]);return db['ZendeskAccount'][_0x5e5b('0x4a')](_0x46fec9)[_0x5e5b('0x28')](handleEntityNotFound(_0x40e8ce,null))[_0x5e5b('0x28')](respondWithResult(_0x40e8ce,null))[_0x5e5b('0x47')](handleError(_0x40e8ce,null));};exports[_0x5e5b('0x4b')]=function(_0x192445,_0x4fd265){return db[_0x5e5b('0x2f')][_0x5e5b('0x4b')](_0x192445['body'],{})[_0x5e5b('0x28')](respondWithResult(_0x4fd265,0xc9))['catch'](handleError(_0x4fd265,null));};exports[_0x5e5b('0x27')]=function(_0x36d8fa,_0x42ebaf){if(_0x36d8fa[_0x5e5b('0x4c')]['id']){delete _0x36d8fa['body']['id'];}return db[_0x5e5b('0x2f')][_0x5e5b('0x4a')]({'where':{'id':_0x36d8fa['params']['id']}})[_0x5e5b('0x28')](handleEntityNotFound(_0x42ebaf,null))[_0x5e5b('0x28')](saveUpdates(_0x36d8fa[_0x5e5b('0x4c')],null))[_0x5e5b('0x28')](respondWithResult(_0x42ebaf,null))[_0x5e5b('0x47')](handleError(_0x42ebaf,null));};exports[_0x5e5b('0x29')]=function(_0x50fc9c,_0x690f8c){return db[_0x5e5b('0x2f')]['find']({'where':{'id':_0x50fc9c[_0x5e5b('0x48')]['id']}})[_0x5e5b('0x28')](handleEntityNotFound(_0x690f8c,null))[_0x5e5b('0x28')](removeEntity(_0x690f8c,null))['catch'](handleError(_0x690f8c,null));};exports[_0x5e5b('0x4d')]=function(_0x3e0ce5,_0x1f32f2,_0x4844ec){var _0x3877e9={};var _0x2e04d6={};var _0x239804;var _0x4a4e0f;return db['ZendeskAccount'][_0x5e5b('0x4e')]({'where':{'id':_0x3e0ce5['params']['id']}})['then'](handleEntityNotFound(_0x1f32f2,null))[_0x5e5b('0x28')](function(_0x13eee9){if(_0x13eee9){_0x239804=_0x13eee9;_0x2e04d6[_0x5e5b('0x33')]=_['keys'](db[_0x5e5b('0x4f')][_0x5e5b('0x30')]);_0x2e04d6[_0x5e5b('0x34')]=_[_0x5e5b('0x35')](_0x3e0ce5[_0x5e5b('0x34')]);_0x2e04d6[_0x5e5b('0x3e')]=_['intersection'](_0x2e04d6['model'],_0x2e04d6[_0x5e5b('0x34')]);_0x3877e9[_0x5e5b('0x37')]=_[_0x5e5b('0x36')](_0x2e04d6[_0x5e5b('0x33')],qs['fields'](_0x3e0ce5[_0x5e5b('0x34')]['fields']));_0x3877e9[_0x5e5b('0x37')]=_0x3877e9[_0x5e5b('0x37')][_0x5e5b('0x49')]?_0x3877e9[_0x5e5b('0x37')]:_0x2e04d6[_0x5e5b('0x33')];_0x3877e9[_0x5e5b('0x3b')]=qs[_0x5e5b('0x3c')](_0x3e0ce5[_0x5e5b('0x34')]['sort']);_0x3877e9[_0x5e5b('0x3d')]=qs[_0x5e5b('0x3e')](_[_0x5e5b('0x50')](_0x3e0ce5[_0x5e5b('0x34')],_0x2e04d6[_0x5e5b('0x3e')]));if(_0x3e0ce5['query'][_0x5e5b('0x3f')]){_0x3877e9[_0x5e5b('0x3d')]=_[_0x5e5b('0x40')](_0x3877e9[_0x5e5b('0x3d')],{'$or':_[_0x5e5b('0x51')](_0x3877e9['attributes'],function(_0x13fb51){var _0x5d9ff9={};_0x5d9ff9[_0x13fb51]={'$like':'%'+_0x3e0ce5[_0x5e5b('0x34')]['filter']+'%'};return _0x5d9ff9;})});}_0x3877e9=_[_0x5e5b('0x40')]({},_0x3877e9,_0x3e0ce5[_0x5e5b('0x42')]);return _0x239804[_0x5e5b('0x4d')](_0x3877e9);}})[_0x5e5b('0x28')](function(_0x229a2d){if(_0x229a2d){_0x4a4e0f=_0x229a2d[_0x5e5b('0x49')];if(!_0x3e0ce5['query'][_0x5e5b('0x39')](_0x5e5b('0x3a'))){_0x3877e9[_0x5e5b('0x21')]=qs[_0x5e5b('0x21')](_0x3e0ce5['query']['limit']);_0x3877e9[_0x5e5b('0x20')]=qs[_0x5e5b('0x20')](_0x3e0ce5['query'][_0x5e5b('0x20')]);}return _0x239804[_0x5e5b('0x4d')](_0x3877e9);}})[_0x5e5b('0x28')](function(_0x470042){if(_0x470042){return _0x470042?{'count':_0x4a4e0f,'rows':_0x470042}:null;}})[_0x5e5b('0x28')](respondWithResult(_0x1f32f2,null))['catch'](handleError(_0x1f32f2,null));};exports[_0x5e5b('0x52')]=function(_0x61faf2,_0x494b1d,_0x4795a7){if(_0x61faf2['body']['id']){delete _0x61faf2[_0x5e5b('0x4c')]['id'];}return db[_0x5e5b('0x2f')][_0x5e5b('0x4e')]({'where':{'id':_0x61faf2[_0x5e5b('0x48')]['id']}})[_0x5e5b('0x28')](handleEntityNotFound(_0x494b1d,null))['then'](function(_0x28d834){if(_0x28d834){_0x61faf2[_0x5e5b('0x4c')]['AccountId']=_0x28d834['id'];_0x61faf2[_0x5e5b('0x4c')]['Subjects']=integrations['getSubjects'](_0x61faf2[_0x5e5b('0x4c')][_0x5e5b('0x53')],_0x61faf2[_0x5e5b('0x4c')][_0x5e5b('0x32')]);_0x61faf2[_0x5e5b('0x4c')][_0x5e5b('0x54')]=integrations[_0x5e5b('0x55')](_0x61faf2['body'][_0x5e5b('0x53')],_0x61faf2[_0x5e5b('0x4c')][_0x5e5b('0x32')]);return db[_0x5e5b('0x4f')][_0x5e5b('0x4b')](_0x61faf2[_0x5e5b('0x4c')],{'include':[{'model':db[_0x5e5b('0x56')],'as':_0x5e5b('0x57')},{'model':db[_0x5e5b('0x56')],'as':_0x5e5b('0x54')}]});}return null;})[_0x5e5b('0x28')](respondWithResult(_0x494b1d,null))['catch'](handleError(_0x494b1d,null));};exports[_0x5e5b('0x58')]=function(_0x1a3d7b,_0x3c57ad,_0x271af6){var _0xc7171a='';return db['ZendeskAccount'][_0x5e5b('0x4e')]({'where':{'id':_0x1a3d7b[_0x5e5b('0x48')]['id']},'attributes':['id',_0x5e5b('0x59'),_0x5e5b('0x5a'),_0x5e5b('0x5b'),_0x5e5b('0x5c'),'remoteUri']})[_0x5e5b('0x28')](handleEntityNotFound(_0x3c57ad,null))[_0x5e5b('0x28')](function(_0x359c04){if(_0x359c04){_0xc7171a=_0x359c04['remoteUri'];var _0xc8316a=_0xc7171a[_0x5e5b('0x5d')](-0x1);if(_0xc8316a==='/'){_0xc7171a=_0xc7171a[_0x5e5b('0x5e')](0x0,_0xc7171a[_0x5e5b('0x5f')](_0xc8316a));}var _0x344c25={'method':_0x5e5b('0x60'),'uri':util[_0x5e5b('0x61')](_0x5e5b('0x62'),_0xc7171a,_0x5e5b('0x63')),'json':!![]};switch(_0x359c04['authType']){case _0x5e5b('0x5a'):_0x344c25['headers']={'Authorization':util[_0x5e5b('0x61')](_0x5e5b('0x64'),new Buffer(util['format']('%s:%s',_0x359c04[_0x5e5b('0x59')],_0x359c04[_0x5e5b('0x5a')]))['toString'](_0x5e5b('0x65')))};break;case'token':_0x344c25['headers']={'Authorization':util[_0x5e5b('0x61')]('Basic\x20%s',new Buffer(util[_0x5e5b('0x61')](_0x5e5b('0x66'),_0x359c04[_0x5e5b('0x59')],_0x359c04['token']))[_0x5e5b('0x67')](_0x5e5b('0x65')))};break;default:throw new db[(_0x5e5b('0x68'))]['ValidationError'](_0x5e5b('0x69'));}return rp(_0x344c25);}})[_0x5e5b('0x28')](function(_0x58aef4){if(_0x58aef4){var _0x388dbe=['subject','description',_0x5e5b('0x6a'),_0x5e5b('0x6b')];_[_0x5e5b('0x6c')](_0x58aef4[_0x5e5b('0x63')],function(_0x1a7c5c){return _0x388dbe['includes'](_0x1a7c5c[_0x5e5b('0x32')]);});return{'count':_0x58aef4[_0x5e5b('0x63')]['length'],'rows':_['map'](_0x58aef4[_0x5e5b('0x63')],function(_0x467c6b){return{'id':_0x467c6b['id'],'name':_0x467c6b[_0x5e5b('0x6d')]>0x7?_0x467c6b[_0x5e5b('0x6e')]:_0x467c6b[_0x5e5b('0x32')],'custom':_0x467c6b[_0x5e5b('0x6d')]>0x7?!![]:![],'options':_0x467c6b['system_field_options']?_0x467c6b[_0x5e5b('0x6f')]:_0x467c6b[_0x5e5b('0x70')]?_0x467c6b[_0x5e5b('0x70')]:[]};})};}})['then'](respondWithResult(_0x3c57ad,null))['catch'](function(_0x24bcc9){var _0x1eb8cd=_0x1a3d7b[_0x5e5b('0x34')]['test']?0x1f4:_0x24bcc9[_0x5e5b('0x71')]||0x1f4;logger[_0x5e5b('0x2a')](_0x5e5b('0x72'),'getFields',_0x1eb8cd,JSON[_0x5e5b('0x73')](_0x24bcc9));delete _0x24bcc9[_0x5e5b('0x2c')];if(_0x1eb8cd===0x191){_0x1eb8cd=0x190;}_0x3c57ad[_0x5e5b('0x1d')](_0x1eb8cd)['send'](_0x1a3d7b[_0x5e5b('0x34')][_0x5e5b('0x74')]?{'message':_0x5e5b('0x75'),'statusCode':_0x24bcc9[_0x5e5b('0x71')]}:_0x24bcc9);});}; \ No newline at end of file +var _0x282b=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','end','offset','undefined','count','limit','status','set','Content-Range','json','apply','reject','update','then','stack','name','index','ZendeskAccount','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','getConfigurations','findOne','ZendeskConfiguration','map','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','channel','Descriptions','ZendeskField','getFields','username','password','token','authType','remoteUri','slice','substring','lastIndexOf','%s/%s','ticket_fields','headers','format','Basic\x20%s','%s/token:%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials'];(function(_0x1f9968,_0x2fb30f){var _0x525de7=function(_0x3778a6){while(--_0x3778a6){_0x1f9968['push'](_0x1f9968['shift']());}};_0x525de7(++_0x2fb30f);}(_0x282b,0xec));var _0xb282=function(_0xd0dd59,_0x1594bd){_0xd0dd59=_0xd0dd59-0x0;var _0x4c0635=_0x282b[_0xd0dd59];return _0x4c0635;};'use strict';var emlformat=require(_0xb282('0x0'));var rimraf=require(_0xb282('0x1'));var zipdir=require(_0xb282('0x2'));var jsonpatch=require(_0xb282('0x3'));var rp=require(_0xb282('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb282('0x5'));var util=require('util');var path=require(_0xb282('0x6'));var sox=require(_0xb282('0x7'));var csv=require(_0xb282('0x8'));var ejs=require(_0xb282('0x9'));var fs=require('fs');var fs_extra=require(_0xb282('0xa'));var _=require(_0xb282('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb282('0xc'));var deskjs=require(_0xb282('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb282('0xe'));var Papa=require(_0xb282('0xf'));var Redis=require(_0xb282('0x10'));var authService=require(_0xb282('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb282('0x12'));var logger=require(_0xb282('0x13'))(_0xb282('0x14'));var utils=require(_0xb282('0x15'));var config=require(_0xb282('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xb282('0x17'));function respondWithStatusCode(_0xc08746,_0x40d7b8){_0x40d7b8=_0x40d7b8||0xcc;return function(_0x9e9072){if(_0x9e9072){return _0xc08746[_0xb282('0x18')](_0x40d7b8);}return _0xc08746['status'](_0x40d7b8)[_0xb282('0x19')]();};}function respondWithResult(_0x5adf7f,_0xe1d53){_0xe1d53=_0xe1d53||0xc8;return function(_0x211862){if(_0x211862){return _0x5adf7f['status'](_0xe1d53)['json'](_0x211862);}};}function respondWithFilteredResult(_0x5bc7c3,_0x13cea1){return function(_0x350676){if(_0x350676){var _0x7c20df=typeof _0x13cea1[_0xb282('0x1a')]===_0xb282('0x1b')&&typeof _0x13cea1['limit']===_0xb282('0x1b');var _0x5519bf=_0x350676[_0xb282('0x1c')];var _0x45b070=_0x7c20df?0x0:_0x13cea1[_0xb282('0x1a')];var _0x492d20=_0x7c20df?_0x350676['count']:_0x13cea1[_0xb282('0x1a')]+_0x13cea1[_0xb282('0x1d')];var _0x599f9e;if(_0x492d20>=_0x5519bf){_0x492d20=_0x5519bf;_0x599f9e=0xc8;}else{_0x599f9e=0xce;}_0x5bc7c3[_0xb282('0x1e')](_0x599f9e);return _0x5bc7c3[_0xb282('0x1f')](_0xb282('0x20'),_0x45b070+'-'+_0x492d20+'/'+_0x5519bf)[_0xb282('0x21')](_0x350676);}return null;};}function patchUpdates(_0x1c3084){return function(_0x533147){try{jsonpatch[_0xb282('0x22')](_0x533147,_0x1c3084,!![]);}catch(_0x16a656){return BPromise[_0xb282('0x23')](_0x16a656);}return _0x533147['save']();};}function saveUpdates(_0x437d66,_0x2a7ef8){return function(_0x3c55ad){if(_0x3c55ad){return _0x3c55ad[_0xb282('0x24')](_0x437d66)[_0xb282('0x25')](function(_0x56645f){return _0x56645f;});}return null;};}function removeEntity(_0x4d624f,_0x360f15){return function(_0x3c7f1f){if(_0x3c7f1f){return _0x3c7f1f['destroy']()['then'](function(){_0x4d624f[_0xb282('0x1e')](0xcc)[_0xb282('0x19')]();});}};}function handleEntityNotFound(_0x3451e5,_0x3c4018){return function(_0x211cc1){if(!_0x211cc1){_0x3451e5[_0xb282('0x18')](0x194);}return _0x211cc1;};}function handleError(_0x5b1d3d,_0xa0d7fb){_0xa0d7fb=_0xa0d7fb||0x1f4;return function(_0x42015c){logger['error'](_0x42015c[_0xb282('0x26')]);if(_0x42015c[_0xb282('0x27')]){delete _0x42015c[_0xb282('0x27')];}_0x5b1d3d[_0xb282('0x1e')](_0xa0d7fb)['send'](_0x42015c);};}exports[_0xb282('0x28')]=function(_0x1fb89f,_0xe337b8){var _0x433ad5={},_0x4cee93={},_0xfddd2e={'count':0x0,'rows':[]};var _0x22f657=_['map'](db[_0xb282('0x29')][_0xb282('0x2a')],function(_0x3eb294){return{'name':_0x3eb294[_0xb282('0x2b')],'type':_0x3eb294[_0xb282('0x2c')]['key']};});_0x4cee93[_0xb282('0x2d')]=_['map'](_0x22f657,_0xb282('0x27'));_0x4cee93[_0xb282('0x2e')]=_[_0xb282('0x2f')](_0x1fb89f['query']);_0x4cee93[_0xb282('0x30')]=_['intersection'](_0x4cee93[_0xb282('0x2d')],_0x4cee93[_0xb282('0x2e')]);_0x433ad5[_0xb282('0x31')]=_[_0xb282('0x32')](_0x4cee93[_0xb282('0x2d')],qs[_0xb282('0x33')](_0x1fb89f['query'][_0xb282('0x33')]));_0x433ad5[_0xb282('0x31')]=_0x433ad5['attributes']['length']?_0x433ad5[_0xb282('0x31')]:_0x4cee93[_0xb282('0x2d')];if(!_0x1fb89f[_0xb282('0x2e')]['hasOwnProperty']('nolimit')){_0x433ad5['limit']=qs[_0xb282('0x1d')](_0x1fb89f[_0xb282('0x2e')][_0xb282('0x1d')]);_0x433ad5[_0xb282('0x1a')]=qs[_0xb282('0x1a')](_0x1fb89f[_0xb282('0x2e')][_0xb282('0x1a')]);}_0x433ad5['order']=qs[_0xb282('0x34')](_0x1fb89f['query'][_0xb282('0x34')]);_0x433ad5[_0xb282('0x35')]=qs[_0xb282('0x30')](_['pick'](_0x1fb89f[_0xb282('0x2e')],_0x4cee93['filters']),_0x22f657);if(_0x1fb89f[_0xb282('0x2e')][_0xb282('0x36')]){_0x433ad5[_0xb282('0x35')]=_[_0xb282('0x37')](_0x433ad5['where'],{'$or':_['map'](_0x22f657,function(_0x397fa1){if(_0x397fa1[_0xb282('0x2c')]!==_0xb282('0x38')){var _0x20d56c={};_0x20d56c[_0x397fa1['name']]={'$like':'%'+_0x1fb89f[_0xb282('0x2e')]['filter']+'%'};return _0x20d56c;}})});}_0x433ad5=_[_0xb282('0x37')]({},_0x433ad5,_0x1fb89f[_0xb282('0x39')]);var _0x482ff9={'where':_0x433ad5[_0xb282('0x35')]};return db[_0xb282('0x29')][_0xb282('0x1c')](_0x482ff9)[_0xb282('0x25')](function(_0x3c1e6c){_0xfddd2e[_0xb282('0x1c')]=_0x3c1e6c;if(_0x1fb89f[_0xb282('0x2e')][_0xb282('0x3a')]){_0x433ad5[_0xb282('0x3b')]=[{'all':!![]}];}return db[_0xb282('0x29')][_0xb282('0x3c')](_0x433ad5);})[_0xb282('0x25')](function(_0x1caff0){_0xfddd2e[_0xb282('0x3d')]=_0x1caff0;return _0xfddd2e;})[_0xb282('0x25')](respondWithFilteredResult(_0xe337b8,_0x433ad5))[_0xb282('0x3e')](handleError(_0xe337b8,null));};exports[_0xb282('0x3f')]=function(_0x7332d2,_0x573da7){var _0x310ad1={'raw':![],'where':{'id':_0x7332d2[_0xb282('0x40')]['id']}},_0x58109a={};_0x58109a[_0xb282('0x2d')]=_[_0xb282('0x2f')](db[_0xb282('0x29')][_0xb282('0x2a')]);_0x58109a[_0xb282('0x2e')]=_['keys'](_0x7332d2['query']);_0x58109a[_0xb282('0x30')]=_['intersection'](_0x58109a[_0xb282('0x2d')],_0x58109a[_0xb282('0x2e')]);_0x310ad1['attributes']=_[_0xb282('0x32')](_0x58109a[_0xb282('0x2d')],qs[_0xb282('0x33')](_0x7332d2['query']['fields']));_0x310ad1[_0xb282('0x31')]=_0x310ad1['attributes'][_0xb282('0x41')]?_0x310ad1[_0xb282('0x31')]:_0x58109a[_0xb282('0x2d')];if(_0x7332d2[_0xb282('0x2e')][_0xb282('0x3a')]){_0x310ad1[_0xb282('0x3b')]=[{'all':!![]}];}_0x310ad1=_['merge']({},_0x310ad1,_0x7332d2[_0xb282('0x39')]);return db[_0xb282('0x29')][_0xb282('0x42')](_0x310ad1)['then'](handleEntityNotFound(_0x573da7,null))[_0xb282('0x25')](respondWithResult(_0x573da7,null))['catch'](handleError(_0x573da7,null));};exports[_0xb282('0x43')]=function(_0x4b0822,_0x1bf51c){return db['ZendeskAccount']['create'](_0x4b0822['body'],{})[_0xb282('0x25')](respondWithResult(_0x1bf51c,0xc9))[_0xb282('0x3e')](handleError(_0x1bf51c,null));};exports[_0xb282('0x24')]=function(_0x7a5aa4,_0x4a2d0e){if(_0x7a5aa4['body']['id']){delete _0x7a5aa4['body']['id'];}return db[_0xb282('0x29')][_0xb282('0x42')]({'where':{'id':_0x7a5aa4[_0xb282('0x40')]['id']}})[_0xb282('0x25')](handleEntityNotFound(_0x4a2d0e,null))['then'](saveUpdates(_0x7a5aa4[_0xb282('0x44')],null))[_0xb282('0x25')](respondWithResult(_0x4a2d0e,null))['catch'](handleError(_0x4a2d0e,null));};exports[_0xb282('0x45')]=function(_0x9f4d79,_0x16f66b){return db[_0xb282('0x29')][_0xb282('0x42')]({'where':{'id':_0x9f4d79['params']['id']}})[_0xb282('0x25')](handleEntityNotFound(_0x16f66b,null))[_0xb282('0x25')](removeEntity(_0x16f66b,null))[_0xb282('0x3e')](handleError(_0x16f66b,null));};exports[_0xb282('0x46')]=function(_0x308aa8,_0x112d4d,_0x4cde65){var _0x87d777={};var _0x574653={};var _0x4554f1;var _0x1e6ade;return db['ZendeskAccount'][_0xb282('0x47')]({'where':{'id':_0x308aa8[_0xb282('0x40')]['id']}})[_0xb282('0x25')](handleEntityNotFound(_0x112d4d,null))['then'](function(_0x51cbb0){if(_0x51cbb0){_0x4554f1=_0x51cbb0;_0x574653[_0xb282('0x2d')]=_[_0xb282('0x2f')](db[_0xb282('0x48')]['rawAttributes']);_0x574653[_0xb282('0x2e')]=_['keys'](_0x308aa8[_0xb282('0x2e')]);_0x574653[_0xb282('0x30')]=_['intersection'](_0x574653[_0xb282('0x2d')],_0x574653['query']);_0x87d777[_0xb282('0x31')]=_[_0xb282('0x32')](_0x574653[_0xb282('0x2d')],qs[_0xb282('0x33')](_0x308aa8[_0xb282('0x2e')][_0xb282('0x33')]));_0x87d777['attributes']=_0x87d777[_0xb282('0x31')]['length']?_0x87d777[_0xb282('0x31')]:_0x574653[_0xb282('0x2d')];_0x87d777['order']=qs['sort'](_0x308aa8[_0xb282('0x2e')][_0xb282('0x34')]);_0x87d777[_0xb282('0x35')]=qs['filters'](_['pick'](_0x308aa8[_0xb282('0x2e')],_0x574653[_0xb282('0x30')]));if(_0x308aa8[_0xb282('0x2e')]['filter']){_0x87d777[_0xb282('0x35')]=_['merge'](_0x87d777[_0xb282('0x35')],{'$or':_[_0xb282('0x49')](_0x87d777[_0xb282('0x31')],function(_0x27bac8){var _0x178b6a={};_0x178b6a[_0x27bac8]={'$like':'%'+_0x308aa8[_0xb282('0x2e')][_0xb282('0x36')]+'%'};return _0x178b6a;})});}_0x87d777=_['merge']({},_0x87d777,_0x308aa8[_0xb282('0x39')]);return _0x4554f1[_0xb282('0x46')](_0x87d777);}})[_0xb282('0x25')](function(_0x58116b){if(_0x58116b){_0x1e6ade=_0x58116b['length'];if(!_0x308aa8[_0xb282('0x2e')][_0xb282('0x4a')](_0xb282('0x4b'))){_0x87d777['limit']=qs['limit'](_0x308aa8[_0xb282('0x2e')][_0xb282('0x1d')]);_0x87d777['offset']=qs[_0xb282('0x1a')](_0x308aa8[_0xb282('0x2e')][_0xb282('0x1a')]);}return _0x4554f1['getConfigurations'](_0x87d777);}})[_0xb282('0x25')](function(_0x2fb4e4){if(_0x2fb4e4){return _0x2fb4e4?{'count':_0x1e6ade,'rows':_0x2fb4e4}:null;}})['then'](respondWithResult(_0x112d4d,null))[_0xb282('0x3e')](handleError(_0x112d4d,null));};exports[_0xb282('0x4c')]=function(_0x33b5ec,_0x26c9a6,_0x4ea7a6){if(_0x33b5ec['body']['id']){delete _0x33b5ec[_0xb282('0x44')]['id'];}return db[_0xb282('0x29')]['findOne']({'where':{'id':_0x33b5ec[_0xb282('0x40')]['id']}})[_0xb282('0x25')](handleEntityNotFound(_0x26c9a6,null))[_0xb282('0x25')](function(_0x364b77){if(_0x364b77){_0x33b5ec[_0xb282('0x44')][_0xb282('0x4d')]=_0x364b77['id'];_0x33b5ec[_0xb282('0x44')][_0xb282('0x4e')]=integrations['getSubjects'](_0x33b5ec[_0xb282('0x44')][_0xb282('0x4f')],_0x33b5ec[_0xb282('0x44')]['type']);_0x33b5ec[_0xb282('0x44')][_0xb282('0x50')]=integrations['getDescriptions'](_0x33b5ec['body'][_0xb282('0x4f')],_0x33b5ec[_0xb282('0x44')][_0xb282('0x2c')]);return db[_0xb282('0x48')][_0xb282('0x43')](_0x33b5ec[_0xb282('0x44')],{'include':[{'model':db[_0xb282('0x51')],'as':_0xb282('0x4e')},{'model':db[_0xb282('0x51')],'as':_0xb282('0x50')}]});}return null;})[_0xb282('0x25')](respondWithResult(_0x26c9a6,null))[_0xb282('0x3e')](handleError(_0x26c9a6,null));};exports[_0xb282('0x52')]=function(_0x2eae62,_0x3c1579,_0x3a87ce){var _0x4ccef5='';return db[_0xb282('0x29')][_0xb282('0x47')]({'where':{'id':_0x2eae62[_0xb282('0x40')]['id']},'attributes':['id',_0xb282('0x53'),_0xb282('0x54'),_0xb282('0x55'),_0xb282('0x56'),_0xb282('0x57')]})[_0xb282('0x25')](handleEntityNotFound(_0x3c1579,null))[_0xb282('0x25')](function(_0x21b3f6){if(_0x21b3f6){_0x4ccef5=_0x21b3f6['remoteUri'];var _0x10bed7=_0x4ccef5[_0xb282('0x58')](-0x1);if(_0x10bed7==='/'){_0x4ccef5=_0x4ccef5[_0xb282('0x59')](0x0,_0x4ccef5[_0xb282('0x5a')](_0x10bed7));}var _0x1e5c3a={'method':'GET','uri':util['format'](_0xb282('0x5b'),_0x4ccef5,_0xb282('0x5c')),'json':!![]};switch(_0x21b3f6[_0xb282('0x56')]){case _0xb282('0x54'):_0x1e5c3a[_0xb282('0x5d')]={'Authorization':util[_0xb282('0x5e')](_0xb282('0x5f'),new Buffer(util['format']('%s:%s',_0x21b3f6[_0xb282('0x53')],_0x21b3f6[_0xb282('0x54')]))['toString']('base64'))};break;case _0xb282('0x55'):_0x1e5c3a[_0xb282('0x5d')]={'Authorization':util[_0xb282('0x5e')](_0xb282('0x5f'),new Buffer(util[_0xb282('0x5e')](_0xb282('0x60'),_0x21b3f6[_0xb282('0x53')],_0x21b3f6['token']))[_0xb282('0x61')](_0xb282('0x62')))};break;default:throw new db[(_0xb282('0x63'))][(_0xb282('0x64'))](_0xb282('0x65'));}return rp(_0x1e5c3a);}})[_0xb282('0x25')](function(_0x11f255){if(_0x11f255){var _0x3c37e0=[_0xb282('0x66'),_0xb282('0x67'),'group',_0xb282('0x68')];_[_0xb282('0x69')](_0x11f255[_0xb282('0x5c')],function(_0x227e66){return _0x3c37e0[_0xb282('0x6a')](_0x227e66[_0xb282('0x2c')]);});return{'count':_0x11f255[_0xb282('0x5c')][_0xb282('0x41')],'rows':_['map'](_0x11f255[_0xb282('0x5c')],function(_0x400f2a){return{'id':_0x400f2a['id'],'name':_0x400f2a[_0xb282('0x6b')]>0x7?_0x400f2a[_0xb282('0x6c')]:_0x400f2a[_0xb282('0x2c')],'custom':_0x400f2a[_0xb282('0x6b')]>0x7?!![]:![],'options':_0x400f2a['system_field_options']?_0x400f2a[_0xb282('0x6d')]:_0x400f2a[_0xb282('0x6e')]?_0x400f2a[_0xb282('0x6e')]:[]};})};}})['then'](respondWithResult(_0x3c1579,null))[_0xb282('0x3e')](function(_0x28677e){var _0x4e894e=_0x2eae62[_0xb282('0x2e')][_0xb282('0x6f')]?0x1f4:_0x28677e[_0xb282('0x70')]||0x1f4;logger[_0xb282('0x71')](_0xb282('0x72'),_0xb282('0x52'),_0x4e894e,JSON[_0xb282('0x73')](_0x28677e));delete _0x28677e['name'];if(_0x4e894e===0x191){_0x4e894e=0x190;}_0x3c1579['status'](_0x4e894e)[_0xb282('0x74')](_0x2eae62['query'][_0xb282('0x6f')]?{'message':_0xb282('0x75'),'statusCode':_0x28677e[_0xb282('0x70')]}:_0x28677e);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index f815eaa..7583fcf 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 _0x54a7=['ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','moment','bluebird','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x2977e9,_0x318cc8){var _0x106417=function(_0x3ef6db){while(--_0x3ef6db){_0x2977e9['push'](_0x2977e9['shift']());}};_0x106417(++_0x318cc8);}(_0x54a7,0x157));var _0x754a=function(_0x43f33a,_0x254b15){_0x43f33a=_0x43f33a-0x0;var _0x2a3a91=_0x54a7[_0x43f33a];return _0x2a3a91;};'use strict';var _=require(_0x754a('0x0'));var util=require(_0x754a('0x1'));var logger=require(_0x754a('0x2'))('api');var moment=require(_0x754a('0x3'));var BPromise=require(_0x754a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x754a('0x5'));var attributes=require(_0x754a('0x6'));var integrations=require(_0x754a('0x7'));module[_0x754a('0x8')]=function(_0x33e696,_0x458e8c){return _0x33e696['define'](_0x754a('0x9'),attributes,{'tableName':_0x754a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x421d=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','util'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x421d,0x137));var _0xd421=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x421d[_0x1035c1];return _0x308d67;};'use strict';var _=require('lodash');var util=require(_0xd421('0x0'));var logger=require(_0xd421('0x1'))(_0xd421('0x2'));var moment=require(_0xd421('0x3'));var BPromise=require(_0xd421('0x4'));var rp=require(_0xd421('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd421('0x6'));var attributes=require(_0xd421('0x7'));var integrations=require(_0xd421('0x8'));module[_0xd421('0x9')]=function(_0x18b304,_0xd69e4a){return _0x18b304[_0xd421('0xa')](_0xd421('0xb'),attributes,{'tableName':'int_zendesk_accounts','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 3a8788f..6f2a26e 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 _0xef1e=['rpc','jayson/promise','request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','catch','GetZendeskAccount','ZendeskAccount','options','raw','include','model','attributes','map','ShowZendeskAccount','where','lodash','moment','randomstring','../../mysqldb','../../config/utils'];(function(_0x49a2ed,_0x1af563){var _0x1352ad=function(_0x25b63f){while(--_0x25b63f){_0x49a2ed['push'](_0x49a2ed['shift']());}};_0x1352ad(++_0x1af563);}(_0xef1e,0x1ab));var _0xeef1=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xef1e[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xeef1('0x0'));var util=require('util');var moment=require(_0xeef1('0x1'));var BPromise=require('bluebird');var rs=require(_0xeef1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeef1('0x3'))['db'];var utils=require(_0xeef1('0x4'));var logger=require('../../config/logger')(_0xeef1('0x5'));var config=require('../../config/environment');var jayson=require(_0xeef1('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4bb542,_0x151050,_0xeed18c){return new BPromise(function(_0x306591,_0x3217a1){return client[_0xeef1('0x7')](_0x4bb542,_0xeed18c)[_0xeef1('0x8')](function(_0x43566a){logger[_0xeef1('0x9')](_0xeef1('0xa'),_0x151050,'request\x20sent');logger[_0xeef1('0xb')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x151050,_0xeef1('0xc'),JSON[_0xeef1('0xd')](_0x43566a));if(_0x43566a[_0xeef1('0xe')]){if(_0x43566a[_0xeef1('0xe')]['code']===0x1f4){logger[_0xeef1('0xe')](_0xeef1('0xa'),_0x151050,_0x43566a[_0xeef1('0xe')]['message']);return _0x3217a1(_0x43566a[_0xeef1('0xe')][_0xeef1('0xf')]);}logger[_0xeef1('0xe')](_0xeef1('0xa'),_0x151050,_0x43566a[_0xeef1('0xe')][_0xeef1('0xf')]);return _0x306591(_0x43566a['error'][_0xeef1('0xf')]);}else{logger[_0xeef1('0x9')](_0xeef1('0xa'),_0x151050,_0xeef1('0xc'));_0x306591(_0x43566a['result'][_0xeef1('0xf')]);}})[_0xeef1('0x10')](function(_0x2416a1){logger[_0xeef1('0xe')](_0xeef1('0xa'),_0x151050,_0x2416a1);_0x3217a1(_0x2416a1);});});}exports[_0xeef1('0x11')]=function(_0x429fb7){var _0x4a5393=this;return new Promise(function(_0x44189f,_0x252000){return db[_0xeef1('0x12')]['findAll']({'raw':_0x429fb7[_0xeef1('0x13')]?_0x429fb7[_0xeef1('0x13')][_0xeef1('0x14')]===undefined?!![]:![]:!![],'where':_0x429fb7['options']?_0x429fb7['options']['where']||null:null,'attributes':_0x429fb7[_0xeef1('0x13')]?_0x429fb7[_0xeef1('0x13')]['attributes']||null:null,'limit':_0x429fb7['options']?_0x429fb7[_0xeef1('0x13')]['limit']||null:null,'include':_0x429fb7[_0xeef1('0x13')]?_0x429fb7['options'][_0xeef1('0x15')]?_['map'](_0x429fb7[_0xeef1('0x13')]['include'],function(_0x52e4e5){return{'model':db[_0x52e4e5[_0xeef1('0x16')]],'as':_0x52e4e5['as'],'attributes':_0x52e4e5[_0xeef1('0x17')],'include':_0x52e4e5[_0xeef1('0x15')]?_[_0xeef1('0x18')](_0x52e4e5[_0xeef1('0x15')],function(_0x1a9c48){return{'model':db[_0x1a9c48[_0xeef1('0x16')]],'as':_0x1a9c48['as'],'attributes':_0x1a9c48[_0xeef1('0x17')],'include':_0x1a9c48[_0xeef1('0x15')]?_['map'](_0x1a9c48[_0xeef1('0x15')],function(_0x15037a){return{'model':db[_0x15037a[_0xeef1('0x16')]],'as':_0x15037a['as'],'attributes':_0x15037a[_0xeef1('0x17')]};}):[]};}):[]};}):[]:[]})[_0xeef1('0x8')](function(_0x5861ac){logger[_0xeef1('0x9')](_0xeef1('0x11'),_0x429fb7);logger[_0xeef1('0xb')]('GetZendeskAccount',_0x429fb7,JSON[_0xeef1('0xd')](_0x5861ac));_0x44189f(_0x5861ac);})[_0xeef1('0x10')](function(_0x30c117){logger['error'](_0xeef1('0x11'),_0x30c117[_0xeef1('0xf')],_0x429fb7);_0x252000(_0x4a5393[_0xeef1('0xe')](0x1f4,_0x30c117[_0xeef1('0xf')]));});});};exports[_0xeef1('0x19')]=function(_0x2b659e){var _0x2006c4=this;return new Promise(function(_0x49c570,_0x4dd9c9){return db[_0xeef1('0x12')]['find']({'raw':_0x2b659e[_0xeef1('0x13')]?_0x2b659e[_0xeef1('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x2b659e[_0xeef1('0x13')]?_0x2b659e['options'][_0xeef1('0x1a')]||null:null,'attributes':_0x2b659e[_0xeef1('0x13')]?_0x2b659e[_0xeef1('0x13')][_0xeef1('0x17')]||null:null,'include':_0x2b659e[_0xeef1('0x13')]?_0x2b659e['options'][_0xeef1('0x15')]?_[_0xeef1('0x18')](_0x2b659e[_0xeef1('0x13')]['include'],function(_0xe51374){return{'model':db[_0xe51374[_0xeef1('0x16')]],'as':_0xe51374['as'],'attributes':_0xe51374[_0xeef1('0x17')],'include':_0xe51374[_0xeef1('0x15')]?_[_0xeef1('0x18')](_0xe51374[_0xeef1('0x15')],function(_0x25dec9){return{'model':db[_0x25dec9[_0xeef1('0x16')]],'as':_0x25dec9['as'],'attributes':_0x25dec9['attributes'],'include':_0x25dec9[_0xeef1('0x15')]?_['map'](_0x25dec9[_0xeef1('0x15')],function(_0x587f56){return{'model':db[_0x587f56[_0xeef1('0x16')]],'as':_0x587f56['as'],'attributes':_0x587f56[_0xeef1('0x17')]};}):[]};}):[]};}):[]:[]})[_0xeef1('0x8')](function(_0x2a4b72){logger['info'](_0xeef1('0x19'),_0x2b659e);logger[_0xeef1('0xb')](_0xeef1('0x19'),_0x2b659e,JSON['stringify'](_0x2a4b72));_0x49c570(_0x2a4b72);})[_0xeef1('0x10')](function(_0x19447c){logger[_0xeef1('0xe')](_0xeef1('0x19'),_0x19447c[_0xeef1('0xf')],_0x2b659e);_0x4dd9c9(_0x2006c4[_0xeef1('0xe')](0x1f4,_0x19447c['message']));});});}; \ No newline at end of file +var _0x360c=['catch','ShowZendeskAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','limit','include','model','attributes','map','find'];(function(_0x65fd4c,_0x26cc9e){var _0x3d8074=function(_0x236598){while(--_0x236598){_0x65fd4c['push'](_0x65fd4c['shift']());}};_0x3d8074(++_0x26cc9e);}(_0x360c,0xac));var _0xc360=function(_0x30819c,_0xeb856e){_0x30819c=_0x30819c-0x0;var _0x436d6a=_0x360c[_0x30819c];return _0x436d6a;};'use strict';var _=require(_0xc360('0x0'));var util=require(_0xc360('0x1'));var moment=require('moment');var BPromise=require(_0xc360('0x2'));var rs=require(_0xc360('0x3'));var fs=require('fs');var Redis=require(_0xc360('0x4'));var db=require(_0xc360('0x5'))['db'];var utils=require(_0xc360('0x6'));var logger=require('../../config/logger')(_0xc360('0x7'));var config=require('../../config/environment');var jayson=require(_0xc360('0x8'));var client=jayson['client'][_0xc360('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f8b66,_0x275353,_0x40dc85){return new BPromise(function(_0xa61c9e,_0x4de737){return client[_0xc360('0xa')](_0x4f8b66,_0x40dc85)[_0xc360('0xb')](function(_0x15e1e7){logger[_0xc360('0xc')](_0xc360('0xd'),_0x275353,'request\x20sent');logger[_0xc360('0xe')](_0xc360('0xf'),_0x275353,_0xc360('0x10'),JSON[_0xc360('0x11')](_0x15e1e7));if(_0x15e1e7['error']){if(_0x15e1e7[_0xc360('0x12')]['code']===0x1f4){logger['error'](_0xc360('0xd'),_0x275353,_0x15e1e7[_0xc360('0x12')][_0xc360('0x13')]);return _0x4de737(_0x15e1e7[_0xc360('0x12')][_0xc360('0x13')]);}logger[_0xc360('0x12')](_0xc360('0xd'),_0x275353,_0x15e1e7[_0xc360('0x12')][_0xc360('0x13')]);return _0xa61c9e(_0x15e1e7[_0xc360('0x12')][_0xc360('0x13')]);}else{logger['info'](_0xc360('0xd'),_0x275353,_0xc360('0x10'));_0xa61c9e(_0x15e1e7['result'][_0xc360('0x13')]);}})['catch'](function(_0x136ba1){logger[_0xc360('0x12')](_0xc360('0xd'),_0x275353,_0x136ba1);_0x4de737(_0x136ba1);});});}exports[_0xc360('0x14')]=function(_0x4c0021){var _0x321256=this;return new Promise(function(_0x4ddc6c,_0x226526){return db[_0xc360('0x15')][_0xc360('0x16')]({'raw':_0x4c0021[_0xc360('0x17')]?_0x4c0021[_0xc360('0x17')][_0xc360('0x18')]===undefined?!![]:![]:!![],'where':_0x4c0021[_0xc360('0x17')]?_0x4c0021['options'][_0xc360('0x19')]||null:null,'attributes':_0x4c0021[_0xc360('0x17')]?_0x4c0021[_0xc360('0x17')]['attributes']||null:null,'limit':_0x4c0021[_0xc360('0x17')]?_0x4c0021['options'][_0xc360('0x1a')]||null:null,'include':_0x4c0021['options']?_0x4c0021['options'][_0xc360('0x1b')]?_['map'](_0x4c0021[_0xc360('0x17')]['include'],function(_0x4c8b20){return{'model':db[_0x4c8b20[_0xc360('0x1c')]],'as':_0x4c8b20['as'],'attributes':_0x4c8b20[_0xc360('0x1d')],'include':_0x4c8b20[_0xc360('0x1b')]?_['map'](_0x4c8b20['include'],function(_0xea967f){return{'model':db[_0xea967f[_0xc360('0x1c')]],'as':_0xea967f['as'],'attributes':_0xea967f[_0xc360('0x1d')],'include':_0xea967f[_0xc360('0x1b')]?_[_0xc360('0x1e')](_0xea967f[_0xc360('0x1b')],function(_0x35946f){return{'model':db[_0x35946f[_0xc360('0x1c')]],'as':_0x35946f['as'],'attributes':_0x35946f[_0xc360('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc360('0xb')](function(_0xd61923){logger['info']('GetZendeskAccount',_0x4c0021);logger[_0xc360('0xe')]('GetZendeskAccount',_0x4c0021,JSON[_0xc360('0x11')](_0xd61923));_0x4ddc6c(_0xd61923);})['catch'](function(_0x5387c8){logger[_0xc360('0x12')](_0xc360('0x14'),_0x5387c8['message'],_0x4c0021);_0x226526(_0x321256[_0xc360('0x12')](0x1f4,_0x5387c8['message']));});});};exports['ShowZendeskAccount']=function(_0x41b1d4){var _0x5b0936=this;return new Promise(function(_0x25a3eb,_0x5f0673){return db['ZendeskAccount'][_0xc360('0x1f')]({'raw':_0x41b1d4[_0xc360('0x17')]?_0x41b1d4[_0xc360('0x17')][_0xc360('0x18')]===undefined?!![]:![]:!![],'where':_0x41b1d4[_0xc360('0x17')]?_0x41b1d4[_0xc360('0x17')][_0xc360('0x19')]||null:null,'attributes':_0x41b1d4[_0xc360('0x17')]?_0x41b1d4['options'][_0xc360('0x1d')]||null:null,'include':_0x41b1d4[_0xc360('0x17')]?_0x41b1d4[_0xc360('0x17')][_0xc360('0x1b')]?_[_0xc360('0x1e')](_0x41b1d4['options'][_0xc360('0x1b')],function(_0x392b12){return{'model':db[_0x392b12[_0xc360('0x1c')]],'as':_0x392b12['as'],'attributes':_0x392b12[_0xc360('0x1d')],'include':_0x392b12[_0xc360('0x1b')]?_[_0xc360('0x1e')](_0x392b12[_0xc360('0x1b')],function(_0x49275d){return{'model':db[_0x49275d[_0xc360('0x1c')]],'as':_0x49275d['as'],'attributes':_0x49275d[_0xc360('0x1d')],'include':_0x49275d[_0xc360('0x1b')]?_[_0xc360('0x1e')](_0x49275d[_0xc360('0x1b')],function(_0x300860){return{'model':db[_0x300860[_0xc360('0x1c')]],'as':_0x300860['as'],'attributes':_0x300860['attributes']};}):[]};}):[]};}):[]:[]})[_0xc360('0xb')](function(_0x1b9d52){logger[_0xc360('0xc')]('ShowZendeskAccount',_0x41b1d4);logger[_0xc360('0xe')]('ShowZendeskAccount',_0x41b1d4,JSON['stringify'](_0x1b9d52));_0x25a3eb(_0x1b9d52);})[_0xc360('0x20')](function(_0x2d247c){logger[_0xc360('0x12')](_0xc360('0x21'),_0x2d247c['message'],_0x41b1d4);_0x5f0673(_0x5b0936[_0xc360('0x12')](0x1f4,_0x2d247c['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 4ef5bae..1e87d4c 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 _0x4483=['getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects'];(function(_0x4f47d5,_0x14bac5){var _0x507cc5=function(_0x53d62f){while(--_0x53d62f){_0x4f47d5['push'](_0x4f47d5['shift']());}};_0x507cc5(++_0x14bac5);}(_0x4483,0x1a3));var _0x3448=function(_0x54ad81,_0x37f42c){_0x54ad81=_0x54ad81-0x0;var _0x2d47cc=_0x4483[_0x54ad81];return _0x2d47cc;};'use strict';var multer=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var path=require(_0x3448('0x2'));var timeout=require('connect-timeout');var express=require(_0x3448('0x3'));var router=express[_0x3448('0x4')]();var fs_extra=require(_0x3448('0x5'));var auth=require(_0x3448('0x6'));var interaction=require(_0x3448('0x7'));var config=require('../../config/environment');var controller=require(_0x3448('0x8'));router[_0x3448('0x9')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0xb')]);router[_0x3448('0x9')](_0x3448('0xc'),auth[_0x3448('0xa')](),controller[_0x3448('0xd')]);router['get']('/:id/fields',auth[_0x3448('0xa')](),controller[_0x3448('0xe')]);router[_0x3448('0x9')](_0x3448('0xf'),auth[_0x3448('0xa')](),controller[_0x3448('0x10')]);router[_0x3448('0x9')](_0x3448('0x11'),auth[_0x3448('0xa')](),controller[_0x3448('0x12')]);router[_0x3448('0x9')]('/:id/tags',auth['isAuthenticated'](),controller[_0x3448('0x13')]);router[_0x3448('0x14')]('/',auth['isAuthenticated'](),controller[_0x3448('0x15')]);router[_0x3448('0x14')](_0x3448('0x16'),auth['isAuthenticated'](),controller[_0x3448('0x17')]);router[_0x3448('0x18')]('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0x19')]);router[_0x3448('0x1a')]('/:id',auth[_0x3448('0xa')](),controller[_0x3448('0x1b')]);module[_0x3448('0x1c')]=router; \ No newline at end of file +var _0x878f=['../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','/:id','/:id/fields','/:id/subjects','isAuthenticated','/:id/descriptions','getDescriptions','/:id/tags','getTags','create','post','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2b0f81,_0x3917f0){var _0x5ce74c=function(_0x12dc0d){while(--_0x12dc0d){_0x2b0f81['push'](_0x2b0f81['shift']());}};_0x5ce74c(++_0x3917f0);}(_0x878f,0x173));var _0xf878=function(_0x641685,_0x868183){_0x641685=_0x641685-0x0;var _0x53da36=_0x878f[_0x641685];return _0x53da36;};'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['getFields']);router[_0xf878('0xa')](_0xf878('0xd'),auth[_0xf878('0xe')](),controller['getSubjects']);router[_0xf878('0xa')](_0xf878('0xf'),auth['isAuthenticated'](),controller[_0xf878('0x10')]);router['get'](_0xf878('0x11'),auth[_0xf878('0xe')](),controller[_0xf878('0x12')]);router['post']('/',auth[_0xf878('0xe')](),controller[_0xf878('0x13')]);router[_0xf878('0x14')]('/:id/tags',auth[_0xf878('0xe')](),controller[_0xf878('0x15')]);router[_0xf878('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xf878('0x17')]);router[_0xf878('0x18')](_0xf878('0xb'),auth[_0xf878('0xe')](),controller[_0xf878('0x19')]);module[_0xf878('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index ae5ab0b..3536a44 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 _0x1ed3=['sequelize','exports','STRING'];(function(_0xa03edd,_0x10c680){var _0x4d59df=function(_0x480a90){while(--_0x480a90){_0xa03edd['push'](_0xa03edd['shift']());}};_0x4d59df(++_0x10c680);}(_0x1ed3,0x6f));var _0x31ed=function(_0x1ea726,_0x2eed82){_0x1ea726=_0x1ea726-0x0;var _0x24af9e=_0x1ed3[_0x1ea726];return _0x24af9e;};'use strict';var Sequelize=require(_0x31ed('0x0'));module[_0x31ed('0x1')]={'name':{'type':Sequelize[_0x31ed('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6dc0=['STRING'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x6dc0,0xd8));var _0x06dc=function(_0xecafad,_0x67899f){_0xecafad=_0xecafad-0x0;var _0x1c578e=_0x6dc0[_0xecafad];return _0x1c578e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x06dc('0x0')]},'description':{'type':Sequelize[_0x06dc('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 214eefa..139daf6 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 _0xbfcd=['count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','ZendeskConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','map','type','options','findAll','rows','catch','show','params','includeAll','include','find','create','body','getFields','findOne','ZendeskField','length','hasOwnProperty','getSubjects','order','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0xbfcd,0x133));var _0xdbfc=function(_0x397e5d,_0x305c03){_0x397e5d=_0x397e5d-0x0;var _0x5bf49d=_0xbfcd[_0x397e5d];return _0x5bf49d;};'use strict';var emlformat=require(_0xdbfc('0x0'));var rimraf=require(_0xdbfc('0x1'));var zipdir=require(_0xdbfc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdbfc('0x3'));var moment=require(_0xdbfc('0x4'));var BPromise=require(_0xdbfc('0x5'));var Mustache=require(_0xdbfc('0x6'));var util=require(_0xdbfc('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xdbfc('0x8'));var ejs=require(_0xdbfc('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdbfc('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xdbfc('0xb'));var deskjs=require(_0xdbfc('0xc'));var toCsv=require(_0xdbfc('0x8'));var querystring=require(_0xdbfc('0xd'));var Papa=require(_0xdbfc('0xe'));var Redis=require(_0xdbfc('0xf'));var authService=require(_0xdbfc('0x10'));var qs=require(_0xdbfc('0x11'));var as=require(_0xdbfc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdbfc('0x13'))('api');var utils=require(_0xdbfc('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xdbfc('0x15'));var db=require(_0xdbfc('0x16'))['db'];function respondWithStatusCode(_0x27601f,_0x28e5cb){_0x28e5cb=_0x28e5cb||0xcc;return function(_0x135b6c){if(_0x135b6c){return _0x27601f['sendStatus'](_0x28e5cb);}return _0x27601f['status'](_0x28e5cb)[_0xdbfc('0x17')]();};}function respondWithResult(_0x124dc9,_0x35247b){_0x35247b=_0x35247b||0xc8;return function(_0x57d73a){if(_0x57d73a){return _0x124dc9[_0xdbfc('0x18')](_0x35247b)[_0xdbfc('0x19')](_0x57d73a);}};}function respondWithFilteredResult(_0x26dd96,_0x22da78){return function(_0x338dc2){if(_0x338dc2){var _0x3230da=typeof _0x22da78[_0xdbfc('0x1a')]===_0xdbfc('0x1b')&&typeof _0x22da78[_0xdbfc('0x1c')]===_0xdbfc('0x1b');var _0x1c6651=_0x338dc2[_0xdbfc('0x1d')];var _0x26127b=_0x3230da?0x0:_0x22da78['offset'];var _0x4d55ef=_0x3230da?_0x338dc2[_0xdbfc('0x1d')]:_0x22da78[_0xdbfc('0x1a')]+_0x22da78['limit'];var _0x5c6cbd;if(_0x4d55ef>=_0x1c6651){_0x4d55ef=_0x1c6651;_0x5c6cbd=0xc8;}else{_0x5c6cbd=0xce;}_0x26dd96[_0xdbfc('0x18')](_0x5c6cbd);return _0x26dd96[_0xdbfc('0x1e')](_0xdbfc('0x1f'),_0x26127b+'-'+_0x4d55ef+'/'+_0x1c6651)[_0xdbfc('0x19')](_0x338dc2);}return null;};}function patchUpdates(_0x91843b){return function(_0x2df205){try{jsonpatch[_0xdbfc('0x20')](_0x2df205,_0x91843b,!![]);}catch(_0x5f036a){return BPromise[_0xdbfc('0x21')](_0x5f036a);}return _0x2df205[_0xdbfc('0x22')]();};}function saveUpdates(_0xf6919d,_0x560d36){return function(_0xaaea9d){if(_0xaaea9d){return _0xaaea9d[_0xdbfc('0x23')](_0xf6919d)[_0xdbfc('0x24')](function(_0xd6de34){return _0xd6de34;});}return null;};}function removeEntity(_0x58fcbf,_0x84b39d){return function(_0x43a87c){if(_0x43a87c){return _0x43a87c[_0xdbfc('0x25')]()[_0xdbfc('0x24')](function(){_0x58fcbf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36dd16,_0x55ba9c){return function(_0x330d13){if(!_0x330d13){_0x36dd16['sendStatus'](0x194);}return _0x330d13;};}function handleError(_0x52772e,_0x324b5a){_0x324b5a=_0x324b5a||0x1f4;return function(_0x474ebb){logger['error'](_0x474ebb[_0xdbfc('0x26')]);if(_0x474ebb[_0xdbfc('0x27')]){delete _0x474ebb[_0xdbfc('0x27')];}_0x52772e[_0xdbfc('0x18')](_0x324b5a)[_0xdbfc('0x28')](_0x474ebb);};}exports[_0xdbfc('0x29')]=function(_0x540486,_0x25c4c0){var _0x147f6f={},_0x508518={},_0x3e01aa={'count':0x0,'rows':[]};var _0x71f413=_['map'](db[_0xdbfc('0x2a')][_0xdbfc('0x2b')],function(_0x3be04e){return{'name':_0x3be04e[_0xdbfc('0x2c')],'type':_0x3be04e['type'][_0xdbfc('0x2d')]};});_0x508518[_0xdbfc('0x2e')]=_['map'](_0x71f413,'name');_0x508518[_0xdbfc('0x2f')]=_[_0xdbfc('0x30')](_0x540486['query']);_0x508518[_0xdbfc('0x31')]=_[_0xdbfc('0x32')](_0x508518['model'],_0x508518[_0xdbfc('0x2f')]);_0x147f6f[_0xdbfc('0x33')]=_['intersection'](_0x508518[_0xdbfc('0x2e')],qs[_0xdbfc('0x34')](_0x540486[_0xdbfc('0x2f')][_0xdbfc('0x34')]));_0x147f6f['attributes']=_0x147f6f[_0xdbfc('0x33')]['length']?_0x147f6f[_0xdbfc('0x33')]:_0x508518[_0xdbfc('0x2e')];if(!_0x540486[_0xdbfc('0x2f')]['hasOwnProperty'](_0xdbfc('0x35'))){_0x147f6f[_0xdbfc('0x1c')]=qs['limit'](_0x540486[_0xdbfc('0x2f')][_0xdbfc('0x1c')]);_0x147f6f[_0xdbfc('0x1a')]=qs['offset'](_0x540486[_0xdbfc('0x2f')]['offset']);}_0x147f6f['order']=qs[_0xdbfc('0x36')](_0x540486[_0xdbfc('0x2f')][_0xdbfc('0x36')]);_0x147f6f[_0xdbfc('0x37')]=qs['filters'](_[_0xdbfc('0x38')](_0x540486['query'],_0x508518[_0xdbfc('0x31')]),_0x71f413);if(_0x540486[_0xdbfc('0x2f')][_0xdbfc('0x39')]){_0x147f6f['where']=_[_0xdbfc('0x3a')](_0x147f6f['where'],{'$or':_[_0xdbfc('0x3b')](_0x71f413,function(_0x21bd39){if(_0x21bd39[_0xdbfc('0x3c')]!=='VIRTUAL'){var _0x2906b9={};_0x2906b9[_0x21bd39[_0xdbfc('0x27')]]={'$like':'%'+_0x540486[_0xdbfc('0x2f')][_0xdbfc('0x39')]+'%'};return _0x2906b9;}})});}_0x147f6f=_[_0xdbfc('0x3a')]({},_0x147f6f,_0x540486[_0xdbfc('0x3d')]);var _0x48dadb={'where':_0x147f6f[_0xdbfc('0x37')]};return db[_0xdbfc('0x2a')]['count'](_0x48dadb)[_0xdbfc('0x24')](function(_0x124534){_0x3e01aa[_0xdbfc('0x1d')]=_0x124534;if(_0x540486['query']['includeAll']){_0x147f6f['include']=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xdbfc('0x3e')](_0x147f6f);})[_0xdbfc('0x24')](function(_0x3ab716){_0x3e01aa[_0xdbfc('0x3f')]=_0x3ab716;return _0x3e01aa;})['then'](respondWithFilteredResult(_0x25c4c0,_0x147f6f))[_0xdbfc('0x40')](handleError(_0x25c4c0,null));};exports[_0xdbfc('0x41')]=function(_0x14057f,_0x12eb7b){var _0x394271={'raw':![],'where':{'id':_0x14057f[_0xdbfc('0x42')]['id']}},_0x11cb30={};_0x11cb30['model']=_[_0xdbfc('0x30')](db[_0xdbfc('0x2a')][_0xdbfc('0x2b')]);_0x11cb30[_0xdbfc('0x2f')]=_[_0xdbfc('0x30')](_0x14057f[_0xdbfc('0x2f')]);_0x11cb30[_0xdbfc('0x31')]=_[_0xdbfc('0x32')](_0x11cb30['model'],_0x11cb30[_0xdbfc('0x2f')]);_0x394271[_0xdbfc('0x33')]=_[_0xdbfc('0x32')](_0x11cb30[_0xdbfc('0x2e')],qs['fields'](_0x14057f[_0xdbfc('0x2f')][_0xdbfc('0x34')]));_0x394271['attributes']=_0x394271['attributes']['length']?_0x394271[_0xdbfc('0x33')]:_0x11cb30[_0xdbfc('0x2e')];if(_0x14057f[_0xdbfc('0x2f')][_0xdbfc('0x43')]){_0x394271[_0xdbfc('0x44')]=[{'all':!![]}];}_0x394271=_[_0xdbfc('0x3a')]({},_0x394271,_0x14057f[_0xdbfc('0x3d')]);return db['ZendeskConfiguration'][_0xdbfc('0x45')](_0x394271)['then'](handleEntityNotFound(_0x12eb7b,null))['then'](respondWithResult(_0x12eb7b,null))['catch'](handleError(_0x12eb7b,null));};exports[_0xdbfc('0x46')]=function(_0x473270,_0x1d7081){return db[_0xdbfc('0x2a')]['create'](_0x473270[_0xdbfc('0x47')],{})[_0xdbfc('0x24')](respondWithResult(_0x1d7081,0xc9))[_0xdbfc('0x40')](handleError(_0x1d7081,null));};exports[_0xdbfc('0x23')]=function(_0x572ba7,_0x4bceed){if(_0x572ba7[_0xdbfc('0x47')]['id']){delete _0x572ba7['body']['id'];}return db['ZendeskConfiguration']['find']({'where':{'id':_0x572ba7[_0xdbfc('0x42')]['id']}})[_0xdbfc('0x24')](handleEntityNotFound(_0x4bceed,null))[_0xdbfc('0x24')](saveUpdates(_0x572ba7[_0xdbfc('0x47')],null))[_0xdbfc('0x24')](respondWithResult(_0x4bceed,null))[_0xdbfc('0x40')](handleError(_0x4bceed,null));};exports[_0xdbfc('0x25')]=function(_0x1037cb,_0x1973cb){return db[_0xdbfc('0x2a')]['find']({'where':{'id':_0x1037cb[_0xdbfc('0x42')]['id']}})[_0xdbfc('0x24')](handleEntityNotFound(_0x1973cb,null))[_0xdbfc('0x24')](removeEntity(_0x1973cb,null))['catch'](handleError(_0x1973cb,null));};exports[_0xdbfc('0x48')]=function(_0xa1a2bc,_0x4708af,_0x1bde43){var _0x2cfc57={};var _0x10acf4={};var _0x5a0753;var _0xcd4886;return db[_0xdbfc('0x2a')][_0xdbfc('0x49')]({'where':{'id':_0xa1a2bc[_0xdbfc('0x42')]['id']}})[_0xdbfc('0x24')](handleEntityNotFound(_0x4708af,null))[_0xdbfc('0x24')](function(_0x2569d7){if(_0x2569d7){_0x5a0753=_0x2569d7;_0x10acf4[_0xdbfc('0x2e')]=_[_0xdbfc('0x30')](db[_0xdbfc('0x4a')][_0xdbfc('0x2b')]);_0x10acf4[_0xdbfc('0x2f')]=_[_0xdbfc('0x30')](_0xa1a2bc[_0xdbfc('0x2f')]);_0x10acf4[_0xdbfc('0x31')]=_[_0xdbfc('0x32')](_0x10acf4[_0xdbfc('0x2e')],_0x10acf4[_0xdbfc('0x2f')]);_0x2cfc57[_0xdbfc('0x33')]=_[_0xdbfc('0x32')](_0x10acf4[_0xdbfc('0x2e')],qs['fields'](_0xa1a2bc['query'][_0xdbfc('0x34')]));_0x2cfc57[_0xdbfc('0x33')]=_0x2cfc57[_0xdbfc('0x33')]['length']?_0x2cfc57[_0xdbfc('0x33')]:_0x10acf4[_0xdbfc('0x2e')];_0x2cfc57['order']=qs['sort'](_0xa1a2bc[_0xdbfc('0x2f')][_0xdbfc('0x36')]);_0x2cfc57[_0xdbfc('0x37')]=qs[_0xdbfc('0x31')](_['pick'](_0xa1a2bc[_0xdbfc('0x2f')],_0x10acf4[_0xdbfc('0x31')]));if(_0xa1a2bc['query'][_0xdbfc('0x39')]){_0x2cfc57[_0xdbfc('0x37')]=_['merge'](_0x2cfc57[_0xdbfc('0x37')],{'$or':_[_0xdbfc('0x3b')](_0x2cfc57[_0xdbfc('0x33')],function(_0x5767d5){var _0x1056da={};_0x1056da[_0x5767d5]={'$like':'%'+_0xa1a2bc[_0xdbfc('0x2f')][_0xdbfc('0x39')]+'%'};return _0x1056da;})});}_0x2cfc57=_[_0xdbfc('0x3a')]({},_0x2cfc57,_0xa1a2bc['options']);return _0x5a0753['getFields'](_0x2cfc57);}})['then'](function(_0x193838){if(_0x193838){_0xcd4886=_0x193838[_0xdbfc('0x4b')];if(!_0xa1a2bc[_0xdbfc('0x2f')][_0xdbfc('0x4c')]('nolimit')){_0x2cfc57[_0xdbfc('0x1c')]=qs[_0xdbfc('0x1c')](_0xa1a2bc[_0xdbfc('0x2f')][_0xdbfc('0x1c')]);_0x2cfc57[_0xdbfc('0x1a')]=qs[_0xdbfc('0x1a')](_0xa1a2bc[_0xdbfc('0x2f')][_0xdbfc('0x1a')]);}return _0x5a0753[_0xdbfc('0x48')](_0x2cfc57);}})[_0xdbfc('0x24')](function(_0x17adae){if(_0x17adae){return _0x17adae?{'count':_0xcd4886,'rows':_0x17adae}:null;}})[_0xdbfc('0x24')](respondWithResult(_0x4708af,null))['catch'](handleError(_0x4708af,null));};exports[_0xdbfc('0x4d')]=function(_0x3b957e,_0x541161,_0x5860f3){var _0x3268c0={};var _0x440daa={};var _0x2c6c7d;var _0x8fdc8c;return db['ZendeskConfiguration'][_0xdbfc('0x49')]({'where':{'id':_0x3b957e[_0xdbfc('0x42')]['id']}})[_0xdbfc('0x24')](handleEntityNotFound(_0x541161,null))[_0xdbfc('0x24')](function(_0x146efb){if(_0x146efb){_0x2c6c7d=_0x146efb;_0x440daa[_0xdbfc('0x2e')]=_[_0xdbfc('0x30')](db[_0xdbfc('0x4a')][_0xdbfc('0x2b')]);_0x440daa[_0xdbfc('0x2f')]=_[_0xdbfc('0x30')](_0x3b957e['query']);_0x440daa[_0xdbfc('0x31')]=_[_0xdbfc('0x32')](_0x440daa['model'],_0x440daa['query']);_0x3268c0[_0xdbfc('0x33')]=_[_0xdbfc('0x32')](_0x440daa[_0xdbfc('0x2e')],qs[_0xdbfc('0x34')](_0x3b957e[_0xdbfc('0x2f')]['fields']));_0x3268c0[_0xdbfc('0x33')]=_0x3268c0[_0xdbfc('0x33')][_0xdbfc('0x4b')]?_0x3268c0[_0xdbfc('0x33')]:_0x440daa[_0xdbfc('0x2e')];_0x3268c0['order']=qs['sort'](_0x3b957e[_0xdbfc('0x2f')][_0xdbfc('0x36')]);_0x3268c0[_0xdbfc('0x37')]=qs[_0xdbfc('0x31')](_['pick'](_0x3b957e['query'],_0x440daa['filters']));if(_0x3b957e[_0xdbfc('0x2f')][_0xdbfc('0x39')]){_0x3268c0[_0xdbfc('0x37')]=_[_0xdbfc('0x3a')](_0x3268c0[_0xdbfc('0x37')],{'$or':_[_0xdbfc('0x3b')](_0x3268c0[_0xdbfc('0x33')],function(_0xc4c997){var _0x4ac4cc={};_0x4ac4cc[_0xc4c997]={'$like':'%'+_0x3b957e[_0xdbfc('0x2f')][_0xdbfc('0x39')]+'%'};return _0x4ac4cc;})});}_0x3268c0=_['merge']({},_0x3268c0,_0x3b957e[_0xdbfc('0x3d')]);return _0x2c6c7d['getSubjects'](_0x3268c0);}})[_0xdbfc('0x24')](function(_0x360de2){if(_0x360de2){_0x8fdc8c=_0x360de2['length'];if(!_0x3b957e[_0xdbfc('0x2f')]['hasOwnProperty'](_0xdbfc('0x35'))){_0x3268c0[_0xdbfc('0x1c')]=qs[_0xdbfc('0x1c')](_0x3b957e[_0xdbfc('0x2f')][_0xdbfc('0x1c')]);_0x3268c0['offset']=qs['offset'](_0x3b957e['query']['offset']);}return _0x2c6c7d[_0xdbfc('0x4d')](_0x3268c0);}})[_0xdbfc('0x24')](function(_0x1d8bfb){if(_0x1d8bfb){return _0x1d8bfb?{'count':_0x8fdc8c,'rows':_0x1d8bfb}:null;}})[_0xdbfc('0x24')](respondWithResult(_0x541161,null))['catch'](handleError(_0x541161,null));};exports['getDescriptions']=function(_0x400bf0,_0x260004,_0x143974){var _0x40dbfc={};var _0xdc435e={};var _0x536bc7;var _0x1b27d2;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x400bf0['params']['id']}})['then'](handleEntityNotFound(_0x260004,null))['then'](function(_0x2b9f50){if(_0x2b9f50){_0x536bc7=_0x2b9f50;_0xdc435e[_0xdbfc('0x2e')]=_[_0xdbfc('0x30')](db[_0xdbfc('0x4a')][_0xdbfc('0x2b')]);_0xdc435e[_0xdbfc('0x2f')]=_['keys'](_0x400bf0['query']);_0xdc435e[_0xdbfc('0x31')]=_['intersection'](_0xdc435e['model'],_0xdc435e[_0xdbfc('0x2f')]);_0x40dbfc['attributes']=_['intersection'](_0xdc435e['model'],qs[_0xdbfc('0x34')](_0x400bf0[_0xdbfc('0x2f')][_0xdbfc('0x34')]));_0x40dbfc['attributes']=_0x40dbfc['attributes'][_0xdbfc('0x4b')]?_0x40dbfc[_0xdbfc('0x33')]:_0xdc435e[_0xdbfc('0x2e')];_0x40dbfc[_0xdbfc('0x4e')]=qs[_0xdbfc('0x36')](_0x400bf0['query'][_0xdbfc('0x36')]);_0x40dbfc[_0xdbfc('0x37')]=qs['filters'](_[_0xdbfc('0x38')](_0x400bf0[_0xdbfc('0x2f')],_0xdc435e['filters']));if(_0x400bf0['query'][_0xdbfc('0x39')]){_0x40dbfc[_0xdbfc('0x37')]=_['merge'](_0x40dbfc['where'],{'$or':_['map'](_0x40dbfc[_0xdbfc('0x33')],function(_0x4131ae){var _0x233bb9={};_0x233bb9[_0x4131ae]={'$like':'%'+_0x400bf0[_0xdbfc('0x2f')][_0xdbfc('0x39')]+'%'};return _0x233bb9;})});}_0x40dbfc=_[_0xdbfc('0x3a')]({},_0x40dbfc,_0x400bf0[_0xdbfc('0x3d')]);return _0x536bc7['getDescriptions'](_0x40dbfc);}})[_0xdbfc('0x24')](function(_0x806637){if(_0x806637){_0x1b27d2=_0x806637[_0xdbfc('0x4b')];if(!_0x400bf0['query'][_0xdbfc('0x4c')](_0xdbfc('0x35'))){_0x40dbfc[_0xdbfc('0x1c')]=qs['limit'](_0x400bf0['query'][_0xdbfc('0x1c')]);_0x40dbfc[_0xdbfc('0x1a')]=qs[_0xdbfc('0x1a')](_0x400bf0['query']['offset']);}return _0x536bc7[_0xdbfc('0x4f')](_0x40dbfc);}})['then'](function(_0x20cceb){if(_0x20cceb){return _0x20cceb?{'count':_0x1b27d2,'rows':_0x20cceb}:null;}})['then'](respondWithResult(_0x260004,null))[_0xdbfc('0x40')](handleError(_0x260004,null));};exports['getTags']=function(_0x1604ad,_0x4249af,_0x38e196){var _0x397b1b={};var _0x52a762={};var _0x400a5f;var _0x59087a;return db[_0xdbfc('0x2a')][_0xdbfc('0x49')]({'where':{'id':_0x1604ad[_0xdbfc('0x42')]['id']}})[_0xdbfc('0x24')](handleEntityNotFound(_0x4249af,null))[_0xdbfc('0x24')](function(_0x4a7cf1){if(_0x4a7cf1){_0x400a5f=_0x4a7cf1;_0x52a762[_0xdbfc('0x2e')]=_['keys'](db[_0xdbfc('0x50')]['rawAttributes']);_0x52a762[_0xdbfc('0x2f')]=_[_0xdbfc('0x30')](_0x1604ad[_0xdbfc('0x2f')]);_0x52a762[_0xdbfc('0x31')]=_[_0xdbfc('0x32')](_0x52a762[_0xdbfc('0x2e')],_0x52a762[_0xdbfc('0x2f')]);_0x397b1b[_0xdbfc('0x33')]=_['intersection'](_0x52a762[_0xdbfc('0x2e')],qs[_0xdbfc('0x34')](_0x1604ad[_0xdbfc('0x2f')][_0xdbfc('0x34')]));_0x397b1b['attributes']=_0x397b1b[_0xdbfc('0x33')][_0xdbfc('0x4b')]?_0x397b1b[_0xdbfc('0x33')]:_0x52a762[_0xdbfc('0x2e')];_0x397b1b[_0xdbfc('0x4e')]=qs[_0xdbfc('0x36')](_0x1604ad['query']['sort']);_0x397b1b['where']=qs['filters'](_[_0xdbfc('0x38')](_0x1604ad[_0xdbfc('0x2f')],_0x52a762[_0xdbfc('0x31')]));if(_0x1604ad[_0xdbfc('0x2f')][_0xdbfc('0x39')]){_0x397b1b[_0xdbfc('0x37')]=_[_0xdbfc('0x3a')](_0x397b1b[_0xdbfc('0x37')],{'$or':_[_0xdbfc('0x3b')](_0x397b1b[_0xdbfc('0x33')],function(_0x2b0fc4){var _0x319bf3={};_0x319bf3[_0x2b0fc4]={'$like':'%'+_0x1604ad[_0xdbfc('0x2f')]['filter']+'%'};return _0x319bf3;})});}_0x397b1b=_[_0xdbfc('0x3a')]({},_0x397b1b,_0x1604ad[_0xdbfc('0x3d')]);return _0x400a5f[_0xdbfc('0x51')](_0x397b1b);}})[_0xdbfc('0x24')](function(_0x10fd70){if(_0x10fd70){_0x59087a=_0x10fd70[_0xdbfc('0x4b')];if(!_0x1604ad[_0xdbfc('0x2f')][_0xdbfc('0x4c')](_0xdbfc('0x35'))){_0x397b1b[_0xdbfc('0x1c')]=qs[_0xdbfc('0x1c')](_0x1604ad[_0xdbfc('0x2f')][_0xdbfc('0x1c')]);_0x397b1b[_0xdbfc('0x1a')]=qs[_0xdbfc('0x1a')](_0x1604ad[_0xdbfc('0x2f')][_0xdbfc('0x1a')]);}return _0x400a5f[_0xdbfc('0x51')](_0x397b1b);}})['then'](function(_0x21bd67){if(_0x21bd67){return _0x21bd67?{'count':_0x59087a,'rows':_0x21bd67}:null;}})['then'](respondWithResult(_0x4249af,null))[_0xdbfc('0x40')](handleError(_0x4249af,null));};exports[_0xdbfc('0x52')]=function(_0x8523fc,_0x354810,_0x281196){if(_0x8523fc[_0xdbfc('0x47')]['id']){delete _0x8523fc[_0xdbfc('0x47')]['id'];}return db[_0xdbfc('0x2a')]['findOne']({'where':{'id':_0x8523fc['params']['id']}})[_0xdbfc('0x24')](handleEntityNotFound(_0x354810,null))[_0xdbfc('0x24')](function(_0x1ea1a9){if(_0x1ea1a9){return _0x1ea1a9[_0xdbfc('0x52')](_0x8523fc[_0xdbfc('0x47')][_0xdbfc('0x53')]||[]);}return null;})[_0xdbfc('0x24')](respondWithResult(_0x354810,null))[_0xdbfc('0x40')](handleError(_0x354810,null));}; \ No newline at end of file +var _0x7812=['getTags','Tag','setTags','ids','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','keys','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','ZendeskField','getFields','getSubjects','getDescriptions'];(function(_0x15298e,_0x591c53){var _0x2d1d1a=function(_0x2c4cc0){while(--_0x2c4cc0){_0x15298e['push'](_0x15298e['shift']());}};_0x2d1d1a(++_0x591c53);}(_0x7812,0x194));var _0x2781=function(_0x35cba9,_0x3fa8c6){_0x35cba9=_0x35cba9-0x0;var _0x57820b=_0x7812[_0x35cba9];return _0x57820b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2781('0x0'));var zipdir=require(_0x2781('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2781('0x2'));var moment=require(_0x2781('0x3'));var BPromise=require(_0x2781('0x4'));var Mustache=require('mustache');var util=require(_0x2781('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x2781('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2781('0x7'));var squel=require('squel');var crypto=require(_0x2781('0x8'));var jsforce=require(_0x2781('0x9'));var deskjs=require(_0x2781('0xa'));var toCsv=require(_0x2781('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2781('0xb'));var qs=require(_0x2781('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2781('0xd'));var logger=require('../../config/logger')(_0x2781('0xe'));var utils=require(_0x2781('0xf'));var config=require(_0x2781('0x10'));var licenseUtil=require(_0x2781('0x11'));var db=require(_0x2781('0x12'))['db'];function respondWithStatusCode(_0x3dccbf,_0x21c04b){_0x21c04b=_0x21c04b||0xcc;return function(_0x3f0ed9){if(_0x3f0ed9){return _0x3dccbf[_0x2781('0x13')](_0x21c04b);}return _0x3dccbf[_0x2781('0x14')](_0x21c04b)[_0x2781('0x15')]();};}function respondWithResult(_0x2ae133,_0x57b69a){_0x57b69a=_0x57b69a||0xc8;return function(_0x433c69){if(_0x433c69){return _0x2ae133['status'](_0x57b69a)['json'](_0x433c69);}};}function respondWithFilteredResult(_0x5467d2,_0x1644f0){return function(_0x4ce949){if(_0x4ce949){var _0x3330bf=typeof _0x1644f0['offset']===_0x2781('0x16')&&typeof _0x1644f0['limit']==='undefined';var _0x10b6f8=_0x4ce949[_0x2781('0x17')];var _0x4ed08b=_0x3330bf?0x0:_0x1644f0['offset'];var _0x5dded1=_0x3330bf?_0x4ce949['count']:_0x1644f0[_0x2781('0x18')]+_0x1644f0['limit'];var _0x8da19e;if(_0x5dded1>=_0x10b6f8){_0x5dded1=_0x10b6f8;_0x8da19e=0xc8;}else{_0x8da19e=0xce;}_0x5467d2[_0x2781('0x14')](_0x8da19e);return _0x5467d2[_0x2781('0x19')](_0x2781('0x1a'),_0x4ed08b+'-'+_0x5dded1+'/'+_0x10b6f8)['json'](_0x4ce949);}return null;};}function patchUpdates(_0x2d31d9){return function(_0x5d947d){try{jsonpatch[_0x2781('0x1b')](_0x5d947d,_0x2d31d9,!![]);}catch(_0x54eec4){return BPromise[_0x2781('0x1c')](_0x54eec4);}return _0x5d947d[_0x2781('0x1d')]();};}function saveUpdates(_0x5b8cdd,_0x4375a4){return function(_0x50f98c){if(_0x50f98c){return _0x50f98c['update'](_0x5b8cdd)[_0x2781('0x1e')](function(_0x1e92f3){return _0x1e92f3;});}return null;};}function removeEntity(_0x305a17,_0x9561aa){return function(_0x499d18){if(_0x499d18){return _0x499d18[_0x2781('0x1f')]()['then'](function(){_0x305a17[_0x2781('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f370f,_0x42b772){return function(_0x50e178){if(!_0x50e178){_0x5f370f[_0x2781('0x13')](0x194);}return _0x50e178;};}function handleError(_0x1973b1,_0x34519d){_0x34519d=_0x34519d||0x1f4;return function(_0x1eb8e6){logger[_0x2781('0x20')](_0x1eb8e6[_0x2781('0x21')]);if(_0x1eb8e6[_0x2781('0x22')]){delete _0x1eb8e6[_0x2781('0x22')];}_0x1973b1['status'](_0x34519d)[_0x2781('0x23')](_0x1eb8e6);};}exports[_0x2781('0x24')]=function(_0x18ce81,_0x49988c){var _0x34b4e6={},_0x1ecbaf={},_0x3b4296={'count':0x0,'rows':[]};var _0x4fdcd6=_[_0x2781('0x25')](db[_0x2781('0x26')][_0x2781('0x27')],function(_0x38a52c){return{'name':_0x38a52c[_0x2781('0x28')],'type':_0x38a52c[_0x2781('0x29')][_0x2781('0x2a')]};});_0x1ecbaf['model']=_[_0x2781('0x25')](_0x4fdcd6,_0x2781('0x22'));_0x1ecbaf['query']=_[_0x2781('0x2b')](_0x18ce81[_0x2781('0x2c')]);_0x1ecbaf[_0x2781('0x2d')]=_['intersection'](_0x1ecbaf['model'],_0x1ecbaf['query']);_0x34b4e6[_0x2781('0x2e')]=_[_0x2781('0x2f')](_0x1ecbaf[_0x2781('0x30')],qs[_0x2781('0x31')](_0x18ce81[_0x2781('0x2c')][_0x2781('0x31')]));_0x34b4e6['attributes']=_0x34b4e6['attributes'][_0x2781('0x32')]?_0x34b4e6[_0x2781('0x2e')]:_0x1ecbaf[_0x2781('0x30')];if(!_0x18ce81[_0x2781('0x2c')][_0x2781('0x33')](_0x2781('0x34'))){_0x34b4e6['limit']=qs['limit'](_0x18ce81['query'][_0x2781('0x35')]);_0x34b4e6[_0x2781('0x18')]=qs['offset'](_0x18ce81['query']['offset']);}_0x34b4e6[_0x2781('0x36')]=qs[_0x2781('0x37')](_0x18ce81[_0x2781('0x2c')]['sort']);_0x34b4e6[_0x2781('0x38')]=qs[_0x2781('0x2d')](_[_0x2781('0x39')](_0x18ce81[_0x2781('0x2c')],_0x1ecbaf[_0x2781('0x2d')]),_0x4fdcd6);if(_0x18ce81[_0x2781('0x2c')][_0x2781('0x3a')]){_0x34b4e6[_0x2781('0x38')]=_[_0x2781('0x3b')](_0x34b4e6[_0x2781('0x38')],{'$or':_[_0x2781('0x25')](_0x4fdcd6,function(_0x267df2){if(_0x267df2['type']!=='VIRTUAL'){var _0x53632c={};_0x53632c[_0x267df2[_0x2781('0x22')]]={'$like':'%'+_0x18ce81[_0x2781('0x2c')][_0x2781('0x3a')]+'%'};return _0x53632c;}})});}_0x34b4e6=_[_0x2781('0x3b')]({},_0x34b4e6,_0x18ce81[_0x2781('0x3c')]);var _0x4b5e41={'where':_0x34b4e6[_0x2781('0x38')]};return db[_0x2781('0x26')]['count'](_0x4b5e41)[_0x2781('0x1e')](function(_0x3f8fb4){_0x3b4296[_0x2781('0x17')]=_0x3f8fb4;if(_0x18ce81[_0x2781('0x2c')][_0x2781('0x3d')]){_0x34b4e6[_0x2781('0x3e')]=[{'all':!![]}];}return db[_0x2781('0x26')][_0x2781('0x3f')](_0x34b4e6);})['then'](function(_0x46e1c8){_0x3b4296[_0x2781('0x40')]=_0x46e1c8;return _0x3b4296;})[_0x2781('0x1e')](respondWithFilteredResult(_0x49988c,_0x34b4e6))[_0x2781('0x41')](handleError(_0x49988c,null));};exports[_0x2781('0x42')]=function(_0x2e39b0,_0x522bd9){var _0x1af5b9={'raw':![],'where':{'id':_0x2e39b0[_0x2781('0x43')]['id']}},_0x30f6a8={};_0x30f6a8[_0x2781('0x30')]=_['keys'](db[_0x2781('0x26')][_0x2781('0x27')]);_0x30f6a8[_0x2781('0x2c')]=_[_0x2781('0x2b')](_0x2e39b0[_0x2781('0x2c')]);_0x30f6a8[_0x2781('0x2d')]=_[_0x2781('0x2f')](_0x30f6a8[_0x2781('0x30')],_0x30f6a8[_0x2781('0x2c')]);_0x1af5b9[_0x2781('0x2e')]=_[_0x2781('0x2f')](_0x30f6a8[_0x2781('0x30')],qs[_0x2781('0x31')](_0x2e39b0[_0x2781('0x2c')][_0x2781('0x31')]));_0x1af5b9['attributes']=_0x1af5b9[_0x2781('0x2e')][_0x2781('0x32')]?_0x1af5b9[_0x2781('0x2e')]:_0x30f6a8[_0x2781('0x30')];if(_0x2e39b0[_0x2781('0x2c')][_0x2781('0x3d')]){_0x1af5b9[_0x2781('0x3e')]=[{'all':!![]}];}_0x1af5b9=_['merge']({},_0x1af5b9,_0x2e39b0[_0x2781('0x3c')]);return db[_0x2781('0x26')][_0x2781('0x44')](_0x1af5b9)[_0x2781('0x1e')](handleEntityNotFound(_0x522bd9,null))['then'](respondWithResult(_0x522bd9,null))[_0x2781('0x41')](handleError(_0x522bd9,null));};exports[_0x2781('0x45')]=function(_0x41dec8,_0x2df310){return db['ZendeskConfiguration'][_0x2781('0x45')](_0x41dec8[_0x2781('0x46')],{})[_0x2781('0x1e')](respondWithResult(_0x2df310,0xc9))[_0x2781('0x41')](handleError(_0x2df310,null));};exports['update']=function(_0xffd50f,_0x48bd5b){if(_0xffd50f[_0x2781('0x46')]['id']){delete _0xffd50f[_0x2781('0x46')]['id'];}return db[_0x2781('0x26')][_0x2781('0x44')]({'where':{'id':_0xffd50f[_0x2781('0x43')]['id']}})[_0x2781('0x1e')](handleEntityNotFound(_0x48bd5b,null))[_0x2781('0x1e')](saveUpdates(_0xffd50f[_0x2781('0x46')],null))[_0x2781('0x1e')](respondWithResult(_0x48bd5b,null))[_0x2781('0x41')](handleError(_0x48bd5b,null));};exports['destroy']=function(_0x786b7b,_0x35671e){return db['ZendeskConfiguration'][_0x2781('0x44')]({'where':{'id':_0x786b7b[_0x2781('0x43')]['id']}})[_0x2781('0x1e')](handleEntityNotFound(_0x35671e,null))[_0x2781('0x1e')](removeEntity(_0x35671e,null))['catch'](handleError(_0x35671e,null));};exports['getFields']=function(_0x321de9,_0x501dae,_0x3d2470){var _0x47aa2c={};var _0x4204ca={};var _0x2023f4;var _0x2e2664;return db[_0x2781('0x26')][_0x2781('0x47')]({'where':{'id':_0x321de9['params']['id']}})[_0x2781('0x1e')](handleEntityNotFound(_0x501dae,null))[_0x2781('0x1e')](function(_0x32693f){if(_0x32693f){_0x2023f4=_0x32693f;_0x4204ca[_0x2781('0x30')]=_[_0x2781('0x2b')](db[_0x2781('0x48')]['rawAttributes']);_0x4204ca[_0x2781('0x2c')]=_[_0x2781('0x2b')](_0x321de9[_0x2781('0x2c')]);_0x4204ca[_0x2781('0x2d')]=_[_0x2781('0x2f')](_0x4204ca[_0x2781('0x30')],_0x4204ca[_0x2781('0x2c')]);_0x47aa2c[_0x2781('0x2e')]=_[_0x2781('0x2f')](_0x4204ca[_0x2781('0x30')],qs[_0x2781('0x31')](_0x321de9['query'][_0x2781('0x31')]));_0x47aa2c[_0x2781('0x2e')]=_0x47aa2c['attributes'][_0x2781('0x32')]?_0x47aa2c[_0x2781('0x2e')]:_0x4204ca[_0x2781('0x30')];_0x47aa2c[_0x2781('0x36')]=qs[_0x2781('0x37')](_0x321de9['query'][_0x2781('0x37')]);_0x47aa2c['where']=qs[_0x2781('0x2d')](_[_0x2781('0x39')](_0x321de9[_0x2781('0x2c')],_0x4204ca[_0x2781('0x2d')]));if(_0x321de9[_0x2781('0x2c')][_0x2781('0x3a')]){_0x47aa2c[_0x2781('0x38')]=_[_0x2781('0x3b')](_0x47aa2c[_0x2781('0x38')],{'$or':_['map'](_0x47aa2c[_0x2781('0x2e')],function(_0x23b946){var _0x51565a={};_0x51565a[_0x23b946]={'$like':'%'+_0x321de9[_0x2781('0x2c')][_0x2781('0x3a')]+'%'};return _0x51565a;})});}_0x47aa2c=_[_0x2781('0x3b')]({},_0x47aa2c,_0x321de9[_0x2781('0x3c')]);return _0x2023f4[_0x2781('0x49')](_0x47aa2c);}})[_0x2781('0x1e')](function(_0x527485){if(_0x527485){_0x2e2664=_0x527485[_0x2781('0x32')];if(!_0x321de9[_0x2781('0x2c')][_0x2781('0x33')]('nolimit')){_0x47aa2c['limit']=qs[_0x2781('0x35')](_0x321de9[_0x2781('0x2c')][_0x2781('0x35')]);_0x47aa2c[_0x2781('0x18')]=qs[_0x2781('0x18')](_0x321de9['query'][_0x2781('0x18')]);}return _0x2023f4['getFields'](_0x47aa2c);}})[_0x2781('0x1e')](function(_0x50d1b0){if(_0x50d1b0){return _0x50d1b0?{'count':_0x2e2664,'rows':_0x50d1b0}:null;}})[_0x2781('0x1e')](respondWithResult(_0x501dae,null))['catch'](handleError(_0x501dae,null));};exports[_0x2781('0x4a')]=function(_0x35cafe,_0x205fe6,_0xbf10fe){var _0x2df49e={};var _0x47a2fe={};var _0x3817e7;var _0x1890e3;return db[_0x2781('0x26')][_0x2781('0x47')]({'where':{'id':_0x35cafe[_0x2781('0x43')]['id']}})[_0x2781('0x1e')](handleEntityNotFound(_0x205fe6,null))['then'](function(_0x5ad3fb){if(_0x5ad3fb){_0x3817e7=_0x5ad3fb;_0x47a2fe[_0x2781('0x30')]=_[_0x2781('0x2b')](db[_0x2781('0x48')][_0x2781('0x27')]);_0x47a2fe['query']=_[_0x2781('0x2b')](_0x35cafe[_0x2781('0x2c')]);_0x47a2fe[_0x2781('0x2d')]=_[_0x2781('0x2f')](_0x47a2fe[_0x2781('0x30')],_0x47a2fe['query']);_0x2df49e[_0x2781('0x2e')]=_[_0x2781('0x2f')](_0x47a2fe[_0x2781('0x30')],qs[_0x2781('0x31')](_0x35cafe[_0x2781('0x2c')][_0x2781('0x31')]));_0x2df49e['attributes']=_0x2df49e[_0x2781('0x2e')][_0x2781('0x32')]?_0x2df49e[_0x2781('0x2e')]:_0x47a2fe['model'];_0x2df49e[_0x2781('0x36')]=qs[_0x2781('0x37')](_0x35cafe['query'][_0x2781('0x37')]);_0x2df49e[_0x2781('0x38')]=qs[_0x2781('0x2d')](_[_0x2781('0x39')](_0x35cafe[_0x2781('0x2c')],_0x47a2fe[_0x2781('0x2d')]));if(_0x35cafe[_0x2781('0x2c')]['filter']){_0x2df49e[_0x2781('0x38')]=_[_0x2781('0x3b')](_0x2df49e[_0x2781('0x38')],{'$or':_[_0x2781('0x25')](_0x2df49e[_0x2781('0x2e')],function(_0x3904a2){var _0x29c22c={};_0x29c22c[_0x3904a2]={'$like':'%'+_0x35cafe['query'][_0x2781('0x3a')]+'%'};return _0x29c22c;})});}_0x2df49e=_[_0x2781('0x3b')]({},_0x2df49e,_0x35cafe[_0x2781('0x3c')]);return _0x3817e7[_0x2781('0x4a')](_0x2df49e);}})[_0x2781('0x1e')](function(_0x4add22){if(_0x4add22){_0x1890e3=_0x4add22[_0x2781('0x32')];if(!_0x35cafe['query']['hasOwnProperty'](_0x2781('0x34'))){_0x2df49e['limit']=qs[_0x2781('0x35')](_0x35cafe[_0x2781('0x2c')]['limit']);_0x2df49e['offset']=qs[_0x2781('0x18')](_0x35cafe[_0x2781('0x2c')][_0x2781('0x18')]);}return _0x3817e7['getSubjects'](_0x2df49e);}})[_0x2781('0x1e')](function(_0x40ce85){if(_0x40ce85){return _0x40ce85?{'count':_0x1890e3,'rows':_0x40ce85}:null;}})['then'](respondWithResult(_0x205fe6,null))[_0x2781('0x41')](handleError(_0x205fe6,null));};exports['getDescriptions']=function(_0x22764c,_0x53179f,_0x258a50){var _0x34ca21={};var _0x4332df={};var _0x32bb5c;var _0x1a4e22;return db[_0x2781('0x26')]['findOne']({'where':{'id':_0x22764c[_0x2781('0x43')]['id']}})['then'](handleEntityNotFound(_0x53179f,null))[_0x2781('0x1e')](function(_0xae4ab0){if(_0xae4ab0){_0x32bb5c=_0xae4ab0;_0x4332df[_0x2781('0x30')]=_[_0x2781('0x2b')](db['ZendeskField'][_0x2781('0x27')]);_0x4332df[_0x2781('0x2c')]=_[_0x2781('0x2b')](_0x22764c['query']);_0x4332df[_0x2781('0x2d')]=_[_0x2781('0x2f')](_0x4332df['model'],_0x4332df[_0x2781('0x2c')]);_0x34ca21[_0x2781('0x2e')]=_[_0x2781('0x2f')](_0x4332df[_0x2781('0x30')],qs[_0x2781('0x31')](_0x22764c[_0x2781('0x2c')][_0x2781('0x31')]));_0x34ca21['attributes']=_0x34ca21['attributes']['length']?_0x34ca21[_0x2781('0x2e')]:_0x4332df[_0x2781('0x30')];_0x34ca21[_0x2781('0x36')]=qs[_0x2781('0x37')](_0x22764c[_0x2781('0x2c')][_0x2781('0x37')]);_0x34ca21[_0x2781('0x38')]=qs[_0x2781('0x2d')](_[_0x2781('0x39')](_0x22764c[_0x2781('0x2c')],_0x4332df[_0x2781('0x2d')]));if(_0x22764c[_0x2781('0x2c')][_0x2781('0x3a')]){_0x34ca21[_0x2781('0x38')]=_[_0x2781('0x3b')](_0x34ca21['where'],{'$or':_[_0x2781('0x25')](_0x34ca21[_0x2781('0x2e')],function(_0x10cad8){var _0x6f2400={};_0x6f2400[_0x10cad8]={'$like':'%'+_0x22764c[_0x2781('0x2c')][_0x2781('0x3a')]+'%'};return _0x6f2400;})});}_0x34ca21=_['merge']({},_0x34ca21,_0x22764c[_0x2781('0x3c')]);return _0x32bb5c[_0x2781('0x4b')](_0x34ca21);}})[_0x2781('0x1e')](function(_0x3d761b){if(_0x3d761b){_0x1a4e22=_0x3d761b['length'];if(!_0x22764c[_0x2781('0x2c')][_0x2781('0x33')](_0x2781('0x34'))){_0x34ca21[_0x2781('0x35')]=qs[_0x2781('0x35')](_0x22764c[_0x2781('0x2c')][_0x2781('0x35')]);_0x34ca21[_0x2781('0x18')]=qs['offset'](_0x22764c['query'][_0x2781('0x18')]);}return _0x32bb5c[_0x2781('0x4b')](_0x34ca21);}})[_0x2781('0x1e')](function(_0x27de8e){if(_0x27de8e){return _0x27de8e?{'count':_0x1a4e22,'rows':_0x27de8e}:null;}})['then'](respondWithResult(_0x53179f,null))[_0x2781('0x41')](handleError(_0x53179f,null));};exports[_0x2781('0x4c')]=function(_0x201b12,_0x6db5cb,_0x22fa8e){var _0x4ad3a7={};var _0x1664cf={};var _0x593b3c;var _0x38d124;return db[_0x2781('0x26')][_0x2781('0x47')]({'where':{'id':_0x201b12[_0x2781('0x43')]['id']}})['then'](handleEntityNotFound(_0x6db5cb,null))['then'](function(_0x3efdb6){if(_0x3efdb6){_0x593b3c=_0x3efdb6;_0x1664cf[_0x2781('0x30')]=_[_0x2781('0x2b')](db[_0x2781('0x4d')][_0x2781('0x27')]);_0x1664cf[_0x2781('0x2c')]=_[_0x2781('0x2b')](_0x201b12[_0x2781('0x2c')]);_0x1664cf[_0x2781('0x2d')]=_[_0x2781('0x2f')](_0x1664cf[_0x2781('0x30')],_0x1664cf['query']);_0x4ad3a7[_0x2781('0x2e')]=_[_0x2781('0x2f')](_0x1664cf[_0x2781('0x30')],qs[_0x2781('0x31')](_0x201b12[_0x2781('0x2c')][_0x2781('0x31')]));_0x4ad3a7[_0x2781('0x2e')]=_0x4ad3a7[_0x2781('0x2e')][_0x2781('0x32')]?_0x4ad3a7[_0x2781('0x2e')]:_0x1664cf[_0x2781('0x30')];_0x4ad3a7['order']=qs['sort'](_0x201b12[_0x2781('0x2c')][_0x2781('0x37')]);_0x4ad3a7[_0x2781('0x38')]=qs[_0x2781('0x2d')](_[_0x2781('0x39')](_0x201b12[_0x2781('0x2c')],_0x1664cf[_0x2781('0x2d')]));if(_0x201b12[_0x2781('0x2c')][_0x2781('0x3a')]){_0x4ad3a7['where']=_['merge'](_0x4ad3a7[_0x2781('0x38')],{'$or':_['map'](_0x4ad3a7['attributes'],function(_0x1daacd){var _0x3dbedb={};_0x3dbedb[_0x1daacd]={'$like':'%'+_0x201b12[_0x2781('0x2c')][_0x2781('0x3a')]+'%'};return _0x3dbedb;})});}_0x4ad3a7=_[_0x2781('0x3b')]({},_0x4ad3a7,_0x201b12[_0x2781('0x3c')]);return _0x593b3c[_0x2781('0x4c')](_0x4ad3a7);}})['then'](function(_0x4897bf){if(_0x4897bf){_0x38d124=_0x4897bf['length'];if(!_0x201b12['query']['hasOwnProperty']('nolimit')){_0x4ad3a7[_0x2781('0x35')]=qs[_0x2781('0x35')](_0x201b12[_0x2781('0x2c')][_0x2781('0x35')]);_0x4ad3a7[_0x2781('0x18')]=qs['offset'](_0x201b12[_0x2781('0x2c')][_0x2781('0x18')]);}return _0x593b3c[_0x2781('0x4c')](_0x4ad3a7);}})[_0x2781('0x1e')](function(_0x5653e9){if(_0x5653e9){return _0x5653e9?{'count':_0x38d124,'rows':_0x5653e9}:null;}})[_0x2781('0x1e')](respondWithResult(_0x6db5cb,null))['catch'](handleError(_0x6db5cb,null));};exports['setTags']=function(_0x4df532,_0x444953,_0x57f148){if(_0x4df532[_0x2781('0x46')]['id']){delete _0x4df532[_0x2781('0x46')]['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x4df532['params']['id']}})[_0x2781('0x1e')](handleEntityNotFound(_0x444953,null))['then'](function(_0x202382){if(_0x202382){return _0x202382[_0x2781('0x4e')](_0x4df532['body'][_0x2781('0x4f')]||[]);}return null;})[_0x2781('0x1e')](respondWithResult(_0x444953,null))[_0x2781('0x41')](handleError(_0x444953,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 15eb628..57b5910 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 _0xdb94=['lodash','util','../../config/logger','api','moment','request-promise','path','./intZendeskConfiguration.attributes','ZendeskConfiguration'];(function(_0x486922,_0x17e739){var _0x54bd2b=function(_0x44305f){while(--_0x44305f){_0x486922['push'](_0x486922['shift']());}};_0x54bd2b(++_0x17e739);}(_0xdb94,0xab));var _0x4db9=function(_0x46ddd3,_0x2f4887){_0x46ddd3=_0x46ddd3-0x0;var _0x3f7c8c=_0xdb94[_0x46ddd3];return _0x3f7c8c;};'use strict';var _=require(_0x4db9('0x0'));var util=require(_0x4db9('0x1'));var logger=require(_0x4db9('0x2'))(_0x4db9('0x3'));var moment=require(_0x4db9('0x4'));var BPromise=require('bluebird');var rp=require(_0x4db9('0x5'));var fs=require('fs');var path=require(_0x4db9('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4db9('0x7'));module['exports']=function(_0x47a3f5,_0x31dd9f){return _0x47a3f5['define'](_0x4db9('0x8'),attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e81=['lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x305c31,_0x466b17){var _0x17f39f=function(_0x53ae03){while(--_0x53ae03){_0x305c31['push'](_0x305c31['shift']());}};_0x17f39f(++_0x466b17);}(_0x4e81,0x1bc));var _0x14e8=function(_0x2cc569,_0x4e9568){_0x2cc569=_0x2cc569-0x0;var _0x1bfc2e=_0x4e81[_0x2cc569];return _0x1bfc2e;};'use strict';var _=require(_0x14e8('0x0'));var util=require(_0x14e8('0x1'));var logger=require(_0x14e8('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x14e8('0x3'));var fs=require('fs');var path=require(_0x14e8('0x4'));var rimraf=require(_0x14e8('0x5'));var config=require(_0x14e8('0x6'));var attributes=require(_0x14e8('0x7'));module[_0x14e8('0x8')]=function(_0x56a266,_0x57c79b){return _0x56a266[_0x14e8('0x9')](_0x14e8('0xa'),attributes,{'tableName':_0x14e8('0xb'),'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 2524f13..433c5b0 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 _0x7a67=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','lodash','moment'];(function(_0x1f8d25,_0x36cc4d){var _0x330b34=function(_0x211bf0){while(--_0x211bf0){_0x1f8d25['push'](_0x1f8d25['shift']());}};_0x330b34(++_0x36cc4d);}(_0x7a67,0x76));var _0x77a6=function(_0x1ce2bd,_0x4506fa){_0x1ce2bd=_0x1ce2bd-0x0;var _0x28062b=_0x7a67[_0x1ce2bd];return _0x28062b;};'use strict';var _=require(_0x77a6('0x0'));var util=require('util');var moment=require(_0x77a6('0x1'));var BPromise=require(_0x77a6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77a6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x77a6('0x4'));var logger=require(_0x77a6('0x5'))(_0x77a6('0x6'));var config=require(_0x77a6('0x7'));var jayson=require(_0x77a6('0x8'));var client=jayson[_0x77a6('0x9')][_0x77a6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34b3f4,_0x54ac98,_0x51dc34){return new BPromise(function(_0x5baa8d,_0x13fc3f){return client[_0x77a6('0xb')](_0x34b3f4,_0x51dc34)[_0x77a6('0xc')](function(_0x2b7c68){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x54ac98,_0x77a6('0xd'));logger['debug'](_0x77a6('0xe'),_0x54ac98,_0x77a6('0xd'),JSON[_0x77a6('0xf')](_0x2b7c68));if(_0x2b7c68[_0x77a6('0x10')]){if(_0x2b7c68[_0x77a6('0x10')][_0x77a6('0x11')]===0x1f4){logger[_0x77a6('0x10')](_0x77a6('0x12'),_0x54ac98,_0x2b7c68[_0x77a6('0x10')][_0x77a6('0x13')]);return _0x13fc3f(_0x2b7c68[_0x77a6('0x10')][_0x77a6('0x13')]);}logger[_0x77a6('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x54ac98,_0x2b7c68[_0x77a6('0x10')][_0x77a6('0x13')]);return _0x5baa8d(_0x2b7c68[_0x77a6('0x10')][_0x77a6('0x13')]);}else{logger['info'](_0x77a6('0x12'),_0x54ac98,_0x77a6('0xd'));_0x5baa8d(_0x2b7c68['result']['message']);}})['catch'](function(_0x2141e2){logger['error'](_0x77a6('0x12'),_0x54ac98,_0x2141e2);_0x13fc3f(_0x2141e2);});});} \ No newline at end of file +var _0xcac1=['rpc','../../config/environment','client','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5c67d1,_0x26c6d8){var _0x447875=function(_0x36f532){while(--_0x36f532){_0x5c67d1['push'](_0x5c67d1['shift']());}};_0x447875(++_0x26c6d8);}(_0xcac1,0x1ec));var _0x1cac=function(_0x5e28c2,_0x1e48ab){_0x5e28c2=_0x5e28c2-0x0;var _0x1a8cc6=_0xcac1[_0x5e28c2];return _0x1a8cc6;};'use strict';var _=require(_0x1cac('0x0'));var util=require(_0x1cac('0x1'));var moment=require(_0x1cac('0x2'));var BPromise=require(_0x1cac('0x3'));var rs=require(_0x1cac('0x4'));var fs=require('fs');var Redis=require(_0x1cac('0x5'));var db=require(_0x1cac('0x6'))['db'];var utils=require(_0x1cac('0x7'));var logger=require('../../config/logger')(_0x1cac('0x8'));var config=require(_0x1cac('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1cac('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x322825,_0x274ffd,_0x40ea3e){return new BPromise(function(_0x3a5839,_0x2c5b0c){return client['request'](_0x322825,_0x40ea3e)['then'](function(_0x53286d){logger[_0x1cac('0xb')](_0x1cac('0xc'),_0x274ffd,_0x1cac('0xd'));logger['debug'](_0x1cac('0xe'),_0x274ffd,_0x1cac('0xd'),JSON[_0x1cac('0xf')](_0x53286d));if(_0x53286d[_0x1cac('0x10')]){if(_0x53286d[_0x1cac('0x10')][_0x1cac('0x11')]===0x1f4){logger[_0x1cac('0x10')](_0x1cac('0xc'),_0x274ffd,_0x53286d['error'][_0x1cac('0x12')]);return _0x2c5b0c(_0x53286d[_0x1cac('0x10')][_0x1cac('0x12')]);}logger[_0x1cac('0x10')](_0x1cac('0xc'),_0x274ffd,_0x53286d['error'][_0x1cac('0x12')]);return _0x3a5839(_0x53286d[_0x1cac('0x10')]['message']);}else{logger[_0x1cac('0xb')](_0x1cac('0xc'),_0x274ffd,_0x1cac('0xd'));_0x3a5839(_0x53286d[_0x1cac('0x13')][_0x1cac('0x12')]);}})['catch'](function(_0x2642d4){logger[_0x1cac('0x10')](_0x1cac('0xc'),_0x274ffd,_0x2642d4);_0x2c5b0c(_0x2642d4);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 789aaa0..1f65e1f 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 _0xba0b=['path','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','show','update','multer','util'];(function(_0x56026d,_0x4f42e8){var _0x1c19fe=function(_0x53d1a1){while(--_0x53d1a1){_0x56026d['push'](_0x56026d['shift']());}};_0x1c19fe(++_0x4f42e8);}(_0xba0b,0x143));var _0xbba0=function(_0x2ec662,_0x4edf37){_0x2ec662=_0x2ec662-0x0;var _0x1bbcb6=_0xba0b[_0x2ec662];return _0x1bbcb6;};'use strict';var multer=require(_0xbba0('0x0'));var util=require(_0xbba0('0x1'));var path=require(_0xbba0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbba0('0x3')]();var fs_extra=require(_0xbba0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xbba0('0x5'));var config=require(_0xbba0('0x6'));var controller=require(_0xbba0('0x7'));router[_0xbba0('0x8')]('/',auth[_0xbba0('0x9')](),controller[_0xbba0('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xbba0('0xb')]);router['post']('/',auth[_0xbba0('0x9')](),controller['create']);router['put']('/:id',auth[_0xbba0('0x9')](),controller[_0xbba0('0xc')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xbf39=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','show','post','put','/:id','update','delete','multer'];(function(_0x1e9947,_0x9ea565){var _0x1e2c2f=function(_0x25735e){while(--_0x25735e){_0x1e9947['push'](_0x1e9947['shift']());}};_0x1e2c2f(++_0x9ea565);}(_0xbf39,0x167));var _0x9bf3=function(_0x596a8b,_0xd275d7){_0x596a8b=_0x596a8b-0x0;var _0x52920b=_0xbf39[_0x596a8b];return _0x52920b;};'use strict';var multer=require(_0x9bf3('0x0'));var util=require('util');var path=require(_0x9bf3('0x1'));var timeout=require(_0x9bf3('0x2'));var express=require(_0x9bf3('0x3'));var router=express[_0x9bf3('0x4')]();var fs_extra=require(_0x9bf3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9bf3('0x6'));var config=require(_0x9bf3('0x7'));var controller=require(_0x9bf3('0x8'));router[_0x9bf3('0x9')]('/',auth[_0x9bf3('0xa')](),controller[_0x9bf3('0xb')]);router[_0x9bf3('0x9')]('/:id',auth[_0x9bf3('0xa')](),controller[_0x9bf3('0xc')]);router[_0x9bf3('0xd')]('/',auth[_0x9bf3('0xa')](),controller['create']);router[_0x9bf3('0xe')](_0x9bf3('0xf'),auth['isAuthenticated'](),controller[_0x9bf3('0x10')]);router[_0x9bf3('0x11')]('/:id',auth[_0x9bf3('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index f25f6d5..035984d 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 _0x7995=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x8c2e4e,_0x3c105b){var _0x2286bb=function(_0x31bef7){while(--_0x31bef7){_0x8c2e4e['push'](_0x8c2e4e['shift']());}};_0x2286bb(++_0x3c105b);}(_0x7995,0x181));var _0x5799=function(_0x3067a2,_0x4c109b){_0x3067a2=_0x3067a2-0x0;var _0x21a324=_0x7995[_0x3067a2];return _0x21a324;};'use strict';var Sequelize=require(_0x5799('0x0'));module[_0x5799('0x1')]={'type':{'type':Sequelize[_0x5799('0x2')](_0x5799('0x3'),_0x5799('0x4'),_0x5799('0x5'),_0x5799('0x6'),_0x5799('0x7')),'defaultValue':_0x5799('0x3')},'content':{'type':Sequelize[_0x5799('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x5799('0x2')](_0x5799('0x3'),_0x5799('0x4'),_0x5799('0x5'))},'keyContent':{'type':Sequelize[_0x5799('0x8')]},'idField':{'type':Sequelize[_0x5799('0x8')]},'nameField':{'type':Sequelize[_0x5799('0x8')]},'customField':{'type':Sequelize[_0x5799('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5799('0x8')]}}; \ No newline at end of file +var _0x2117=['variable','customVariable','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x140ed5,_0x1c22f8){var _0x3120ac=function(_0x32e820){while(--_0x32e820){_0x140ed5['push'](_0x140ed5['shift']());}};_0x3120ac(++_0x1c22f8);}(_0x2117,0x1d0));var _0x7211=function(_0x1cf49b,_0x3ea7c3){_0x1cf49b=_0x1cf49b-0x0;var _0x2e30c9=_0x2117[_0x1cf49b];return _0x2e30c9;};'use strict';var Sequelize=require(_0x7211('0x0'));module[_0x7211('0x1')]={'type':{'type':Sequelize[_0x7211('0x2')](_0x7211('0x3'),_0x7211('0x4'),_0x7211('0x5'),'keyValue',_0x7211('0x6')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x7211('0x7')]},'keyType':{'type':Sequelize[_0x7211('0x2')](_0x7211('0x3'),_0x7211('0x4'),_0x7211('0x5'))},'keyContent':{'type':Sequelize[_0x7211('0x7')]},'idField':{'type':Sequelize[_0x7211('0x7')]},'nameField':{'type':Sequelize[_0x7211('0x7')]},'customField':{'type':Sequelize[_0x7211('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index b2058b7..e62f282 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 _0xd562=['limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','ZendeskField','includeAll','include','findAll','rows','show','rawAttributes','keys','length','catch','create','body','find','params','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset'];(function(_0x5e8d3e,_0x18ed2e){var _0x1348c0=function(_0x5a889f){while(--_0x5a889f){_0x5e8d3e['push'](_0x5e8d3e['shift']());}};_0x1348c0(++_0x18ed2e);}(_0xd562,0x165));var _0x2d56=function(_0x5c94cc,_0x4eee3b){_0x5c94cc=_0x5c94cc-0x0;var _0x4a4912=_0xd562[_0x5c94cc];return _0x4a4912;};'use strict';var emlformat=require(_0x2d56('0x0'));var rimraf=require(_0x2d56('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2d56('0x2'));var rp=require(_0x2d56('0x3'));var moment=require(_0x2d56('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2d56('0x5'));var path=require(_0x2d56('0x6'));var sox=require(_0x2d56('0x7'));var csv=require(_0x2d56('0x8'));var ejs=require(_0x2d56('0x9'));var fs=require('fs');var fs_extra=require(_0x2d56('0xa'));var _=require(_0x2d56('0xb'));var squel=require(_0x2d56('0xc'));var crypto=require(_0x2d56('0xd'));var jsforce=require(_0x2d56('0xe'));var deskjs=require(_0x2d56('0xf'));var toCsv=require(_0x2d56('0x8'));var querystring=require(_0x2d56('0x10'));var Papa=require('papaparse');var Redis=require(_0x2d56('0x11'));var authService=require(_0x2d56('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2d56('0x13'));var logger=require(_0x2d56('0x14'))(_0x2d56('0x15'));var utils=require('../../config/utils');var config=require(_0x2d56('0x16'));var licenseUtil=require(_0x2d56('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7732c1,_0x5ca5d3){_0x5ca5d3=_0x5ca5d3||0xcc;return function(_0x199279){if(_0x199279){return _0x7732c1[_0x2d56('0x18')](_0x5ca5d3);}return _0x7732c1[_0x2d56('0x19')](_0x5ca5d3)['end']();};}function respondWithResult(_0x4b2362,_0x8433aa){_0x8433aa=_0x8433aa||0xc8;return function(_0x148608){if(_0x148608){return _0x4b2362[_0x2d56('0x19')](_0x8433aa)[_0x2d56('0x1a')](_0x148608);}};}function respondWithFilteredResult(_0x3f1b56,_0x2eec96){return function(_0x50a335){if(_0x50a335){var _0x573a1b=typeof _0x2eec96[_0x2d56('0x1b')]==='undefined'&&typeof _0x2eec96[_0x2d56('0x1c')]===_0x2d56('0x1d');var _0x51300e=_0x50a335[_0x2d56('0x1e')];var _0x599825=_0x573a1b?0x0:_0x2eec96[_0x2d56('0x1b')];var _0x41f586=_0x573a1b?_0x50a335['count']:_0x2eec96[_0x2d56('0x1b')]+_0x2eec96[_0x2d56('0x1c')];var _0x5238f8;if(_0x41f586>=_0x51300e){_0x41f586=_0x51300e;_0x5238f8=0xc8;}else{_0x5238f8=0xce;}_0x3f1b56[_0x2d56('0x19')](_0x5238f8);return _0x3f1b56[_0x2d56('0x1f')](_0x2d56('0x20'),_0x599825+'-'+_0x41f586+'/'+_0x51300e)[_0x2d56('0x1a')](_0x50a335);}return null;};}function patchUpdates(_0x593005){return function(_0x546d96){try{jsonpatch[_0x2d56('0x21')](_0x546d96,_0x593005,!![]);}catch(_0x28cd58){return BPromise[_0x2d56('0x22')](_0x28cd58);}return _0x546d96[_0x2d56('0x23')]();};}function saveUpdates(_0x287d21,_0x54ac78){return function(_0x4a3197){if(_0x4a3197){return _0x4a3197[_0x2d56('0x24')](_0x287d21)[_0x2d56('0x25')](function(_0x11703d){return _0x11703d;});}return null;};}function removeEntity(_0x42c02c,_0x1210b0){return function(_0x1ef7d1){if(_0x1ef7d1){return _0x1ef7d1[_0x2d56('0x26')]()['then'](function(){_0x42c02c[_0x2d56('0x19')](0xcc)[_0x2d56('0x27')]();});}};}function handleEntityNotFound(_0x252b67,_0x1dd4c9){return function(_0x51ba0e){if(!_0x51ba0e){_0x252b67[_0x2d56('0x18')](0x194);}return _0x51ba0e;};}function handleError(_0x3f432a,_0x5ac1ef){_0x5ac1ef=_0x5ac1ef||0x1f4;return function(_0x3c4dce){logger[_0x2d56('0x28')](_0x3c4dce[_0x2d56('0x29')]);if(_0x3c4dce[_0x2d56('0x2a')]){delete _0x3c4dce[_0x2d56('0x2a')];}_0x3f432a[_0x2d56('0x19')](_0x5ac1ef)[_0x2d56('0x2b')](_0x3c4dce);};}exports[_0x2d56('0x2c')]=function(_0x55eb47,_0x2d5332){var _0x90e985={},_0x1e4a5b={},_0x49a062={'count':0x0,'rows':[]};var _0x150aa2=_[_0x2d56('0x2d')](db['ZendeskField']['rawAttributes'],function(_0x1780c7){return{'name':_0x1780c7[_0x2d56('0x2e')],'type':_0x1780c7[_0x2d56('0x2f')][_0x2d56('0x30')]};});_0x1e4a5b[_0x2d56('0x31')]=_['map'](_0x150aa2,'name');_0x1e4a5b[_0x2d56('0x32')]=_['keys'](_0x55eb47[_0x2d56('0x32')]);_0x1e4a5b['filters']=_[_0x2d56('0x33')](_0x1e4a5b['model'],_0x1e4a5b[_0x2d56('0x32')]);_0x90e985[_0x2d56('0x34')]=_[_0x2d56('0x33')](_0x1e4a5b['model'],qs[_0x2d56('0x35')](_0x55eb47[_0x2d56('0x32')][_0x2d56('0x35')]));_0x90e985['attributes']=_0x90e985[_0x2d56('0x34')]['length']?_0x90e985[_0x2d56('0x34')]:_0x1e4a5b[_0x2d56('0x31')];if(!_0x55eb47['query'][_0x2d56('0x36')](_0x2d56('0x37'))){_0x90e985['limit']=qs[_0x2d56('0x1c')](_0x55eb47['query']['limit']);_0x90e985[_0x2d56('0x1b')]=qs[_0x2d56('0x1b')](_0x55eb47[_0x2d56('0x32')][_0x2d56('0x1b')]);}_0x90e985[_0x2d56('0x38')]=qs['sort'](_0x55eb47['query'][_0x2d56('0x39')]);_0x90e985[_0x2d56('0x3a')]=qs[_0x2d56('0x3b')](_['pick'](_0x55eb47[_0x2d56('0x32')],_0x1e4a5b[_0x2d56('0x3b')]),_0x150aa2);if(_0x55eb47[_0x2d56('0x32')][_0x2d56('0x3c')]){_0x90e985[_0x2d56('0x3a')]=_[_0x2d56('0x3d')](_0x90e985[_0x2d56('0x3a')],{'$or':_['map'](_0x150aa2,function(_0x36440f){if(_0x36440f[_0x2d56('0x2f')]!=='VIRTUAL'){var _0x4a34dc={};_0x4a34dc[_0x36440f['name']]={'$like':'%'+_0x55eb47[_0x2d56('0x32')][_0x2d56('0x3c')]+'%'};return _0x4a34dc;}})});}_0x90e985=_['merge']({},_0x90e985,_0x55eb47[_0x2d56('0x3e')]);var _0x3f3a29={'where':_0x90e985['where']};return db[_0x2d56('0x3f')][_0x2d56('0x1e')](_0x3f3a29)['then'](function(_0x4ea993){_0x49a062[_0x2d56('0x1e')]=_0x4ea993;if(_0x55eb47[_0x2d56('0x32')][_0x2d56('0x40')]){_0x90e985[_0x2d56('0x41')]=[{'all':!![]}];}return db[_0x2d56('0x3f')][_0x2d56('0x42')](_0x90e985);})[_0x2d56('0x25')](function(_0x14175f){_0x49a062[_0x2d56('0x43')]=_0x14175f;return _0x49a062;})[_0x2d56('0x25')](respondWithFilteredResult(_0x2d5332,_0x90e985))['catch'](handleError(_0x2d5332,null));};exports[_0x2d56('0x44')]=function(_0x252142,_0xae9cd){var _0xa8c848={'raw':!![],'where':{'id':_0x252142['params']['id']}},_0x548830={};_0x548830[_0x2d56('0x31')]=_['keys'](db[_0x2d56('0x3f')][_0x2d56('0x45')]);_0x548830[_0x2d56('0x32')]=_[_0x2d56('0x46')](_0x252142[_0x2d56('0x32')]);_0x548830[_0x2d56('0x3b')]=_[_0x2d56('0x33')](_0x548830['model'],_0x548830['query']);_0xa8c848[_0x2d56('0x34')]=_[_0x2d56('0x33')](_0x548830[_0x2d56('0x31')],qs[_0x2d56('0x35')](_0x252142[_0x2d56('0x32')][_0x2d56('0x35')]));_0xa8c848[_0x2d56('0x34')]=_0xa8c848['attributes'][_0x2d56('0x47')]?_0xa8c848['attributes']:_0x548830[_0x2d56('0x31')];if(_0x252142[_0x2d56('0x32')]['includeAll']){_0xa8c848['include']=[{'all':!![]}];}_0xa8c848=_['merge']({},_0xa8c848,_0x252142[_0x2d56('0x3e')]);return db[_0x2d56('0x3f')]['find'](_0xa8c848)[_0x2d56('0x25')](handleEntityNotFound(_0xae9cd,null))['then'](respondWithResult(_0xae9cd,null))[_0x2d56('0x48')](handleError(_0xae9cd,null));};exports[_0x2d56('0x49')]=function(_0x3e47f8,_0x334947){return db[_0x2d56('0x3f')][_0x2d56('0x49')](_0x3e47f8[_0x2d56('0x4a')],{})[_0x2d56('0x25')](respondWithResult(_0x334947,0xc9))['catch'](handleError(_0x334947,null));};exports[_0x2d56('0x24')]=function(_0x143a0d,_0x1dbd72){if(_0x143a0d['body']['id']){delete _0x143a0d['body']['id'];}return db[_0x2d56('0x3f')][_0x2d56('0x4b')]({'where':{'id':_0x143a0d['params']['id']}})[_0x2d56('0x25')](handleEntityNotFound(_0x1dbd72,null))[_0x2d56('0x25')](saveUpdates(_0x143a0d['body'],null))[_0x2d56('0x25')](respondWithResult(_0x1dbd72,null))[_0x2d56('0x48')](handleError(_0x1dbd72,null));};exports['destroy']=function(_0x17959d,_0x596722){return db[_0x2d56('0x3f')][_0x2d56('0x4b')]({'where':{'id':_0x17959d[_0x2d56('0x4c')]['id']}})['then'](handleEntityNotFound(_0x596722,null))[_0x2d56('0x25')](removeEntity(_0x596722,null))[_0x2d56('0x48')](handleError(_0x596722,null));}; \ No newline at end of file +var _0x88c9=['name','send','index','map','rawAttributes','filters','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','ZendeskField','includeAll','findAll','rows','catch','show','keys','intersection','length','include','find','create','body','update','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','then','destroy','sendStatus','error'];(function(_0xd6675b,_0x353dda){var _0x4e98aa=function(_0x391372){while(--_0x391372){_0xd6675b['push'](_0xd6675b['shift']());}};_0x4e98aa(++_0x353dda);}(_0x88c9,0x1f2));var _0x988c=function(_0x301add,_0x3c2d76){_0x301add=_0x301add-0x0;var _0x4458d9=_0x88c9[_0x301add];return _0x4458d9;};'use strict';var emlformat=require(_0x988c('0x0'));var rimraf=require(_0x988c('0x1'));var zipdir=require(_0x988c('0x2'));var jsonpatch=require(_0x988c('0x3'));var rp=require(_0x988c('0x4'));var moment=require('moment');var BPromise=require(_0x988c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x988c('0x6'));var sox=require(_0x988c('0x7'));var csv=require(_0x988c('0x8'));var ejs=require(_0x988c('0x9'));var fs=require('fs');var fs_extra=require(_0x988c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x988c('0xb'));var jsforce=require(_0x988c('0xc'));var deskjs=require(_0x988c('0xd'));var toCsv=require(_0x988c('0x8'));var querystring=require(_0x988c('0xe'));var Papa=require(_0x988c('0xf'));var Redis=require(_0x988c('0x10'));var authService=require(_0x988c('0x11'));var qs=require(_0x988c('0x12'));var as=require(_0x988c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x988c('0x14'))(_0x988c('0x15'));var utils=require(_0x988c('0x16'));var config=require(_0x988c('0x17'));var licenseUtil=require(_0x988c('0x18'));var db=require(_0x988c('0x19'))['db'];function respondWithStatusCode(_0x185782,_0x528dd4){_0x528dd4=_0x528dd4||0xcc;return function(_0x4ed9f2){if(_0x4ed9f2){return _0x185782['sendStatus'](_0x528dd4);}return _0x185782['status'](_0x528dd4)[_0x988c('0x1a')]();};}function respondWithResult(_0x4a5bb3,_0x4b4343){_0x4b4343=_0x4b4343||0xc8;return function(_0x4331cf){if(_0x4331cf){return _0x4a5bb3['status'](_0x4b4343)[_0x988c('0x1b')](_0x4331cf);}};}function respondWithFilteredResult(_0xe30832,_0x182d3c){return function(_0x5a6410){if(_0x5a6410){var _0x1c67b4=typeof _0x182d3c[_0x988c('0x1c')]===_0x988c('0x1d')&&typeof _0x182d3c[_0x988c('0x1e')]===_0x988c('0x1d');var _0x1edd02=_0x5a6410[_0x988c('0x1f')];var _0x1e73c1=_0x1c67b4?0x0:_0x182d3c[_0x988c('0x1c')];var _0x2d2281=_0x1c67b4?_0x5a6410['count']:_0x182d3c[_0x988c('0x1c')]+_0x182d3c[_0x988c('0x1e')];var _0x5cadf1;if(_0x2d2281>=_0x1edd02){_0x2d2281=_0x1edd02;_0x5cadf1=0xc8;}else{_0x5cadf1=0xce;}_0xe30832[_0x988c('0x20')](_0x5cadf1);return _0xe30832[_0x988c('0x21')](_0x988c('0x22'),_0x1e73c1+'-'+_0x2d2281+'/'+_0x1edd02)['json'](_0x5a6410);}return null;};}function patchUpdates(_0x506d21){return function(_0x6e5a70){try{jsonpatch[_0x988c('0x23')](_0x6e5a70,_0x506d21,!![]);}catch(_0x317f72){return BPromise[_0x988c('0x24')](_0x317f72);}return _0x6e5a70['save']();};}function saveUpdates(_0x2c539d,_0x216d3e){return function(_0x48c62f){if(_0x48c62f){return _0x48c62f['update'](_0x2c539d)[_0x988c('0x25')](function(_0xbb5203){return _0xbb5203;});}return null;};}function removeEntity(_0x57173b,_0x537e23){return function(_0x11656a){if(_0x11656a){return _0x11656a[_0x988c('0x26')]()[_0x988c('0x25')](function(){_0x57173b[_0x988c('0x20')](0xcc)[_0x988c('0x1a')]();});}};}function handleEntityNotFound(_0x2316c7,_0x3ea40d){return function(_0x304e83){if(!_0x304e83){_0x2316c7[_0x988c('0x27')](0x194);}return _0x304e83;};}function handleError(_0x111211,_0x239dc2){_0x239dc2=_0x239dc2||0x1f4;return function(_0x665c6){logger[_0x988c('0x28')](_0x665c6['stack']);if(_0x665c6[_0x988c('0x29')]){delete _0x665c6[_0x988c('0x29')];}_0x111211[_0x988c('0x20')](_0x239dc2)[_0x988c('0x2a')](_0x665c6);};}exports[_0x988c('0x2b')]=function(_0x5e320a,_0x3be720){var _0x156e9d={},_0x509f99={},_0x53c1a7={'count':0x0,'rows':[]};var _0x5d5992=_[_0x988c('0x2c')](db['ZendeskField'][_0x988c('0x2d')],function(_0x1bc081){return{'name':_0x1bc081['fieldName'],'type':_0x1bc081['type']['key']};});_0x509f99['model']=_[_0x988c('0x2c')](_0x5d5992,'name');_0x509f99['query']=_['keys'](_0x5e320a['query']);_0x509f99[_0x988c('0x2e')]=_['intersection'](_0x509f99[_0x988c('0x2f')],_0x509f99[_0x988c('0x30')]);_0x156e9d[_0x988c('0x31')]=_['intersection'](_0x509f99[_0x988c('0x2f')],qs[_0x988c('0x32')](_0x5e320a[_0x988c('0x30')][_0x988c('0x32')]));_0x156e9d[_0x988c('0x31')]=_0x156e9d[_0x988c('0x31')]['length']?_0x156e9d[_0x988c('0x31')]:_0x509f99['model'];if(!_0x5e320a[_0x988c('0x30')][_0x988c('0x33')](_0x988c('0x34'))){_0x156e9d[_0x988c('0x1e')]=qs[_0x988c('0x1e')](_0x5e320a['query'][_0x988c('0x1e')]);_0x156e9d[_0x988c('0x1c')]=qs['offset'](_0x5e320a[_0x988c('0x30')][_0x988c('0x1c')]);}_0x156e9d[_0x988c('0x35')]=qs[_0x988c('0x36')](_0x5e320a[_0x988c('0x30')]['sort']);_0x156e9d[_0x988c('0x37')]=qs[_0x988c('0x2e')](_[_0x988c('0x38')](_0x5e320a[_0x988c('0x30')],_0x509f99[_0x988c('0x2e')]),_0x5d5992);if(_0x5e320a[_0x988c('0x30')][_0x988c('0x39')]){_0x156e9d[_0x988c('0x37')]=_['merge'](_0x156e9d[_0x988c('0x37')],{'$or':_[_0x988c('0x2c')](_0x5d5992,function(_0x4c421b){if(_0x4c421b[_0x988c('0x3a')]!==_0x988c('0x3b')){var _0x217b18={};_0x217b18[_0x4c421b['name']]={'$like':'%'+_0x5e320a[_0x988c('0x30')][_0x988c('0x39')]+'%'};return _0x217b18;}})});}_0x156e9d=_[_0x988c('0x3c')]({},_0x156e9d,_0x5e320a[_0x988c('0x3d')]);var _0x3a21a2={'where':_0x156e9d['where']};return db[_0x988c('0x3e')][_0x988c('0x1f')](_0x3a21a2)[_0x988c('0x25')](function(_0x37856f){_0x53c1a7[_0x988c('0x1f')]=_0x37856f;if(_0x5e320a[_0x988c('0x30')][_0x988c('0x3f')]){_0x156e9d['include']=[{'all':!![]}];}return db['ZendeskField'][_0x988c('0x40')](_0x156e9d);})[_0x988c('0x25')](function(_0x54c075){_0x53c1a7[_0x988c('0x41')]=_0x54c075;return _0x53c1a7;})[_0x988c('0x25')](respondWithFilteredResult(_0x3be720,_0x156e9d))[_0x988c('0x42')](handleError(_0x3be720,null));};exports[_0x988c('0x43')]=function(_0x3266b0,_0x58c768){var _0x4a83d3={'raw':!![],'where':{'id':_0x3266b0['params']['id']}},_0x1adb68={};_0x1adb68['model']=_[_0x988c('0x44')](db[_0x988c('0x3e')]['rawAttributes']);_0x1adb68[_0x988c('0x30')]=_[_0x988c('0x44')](_0x3266b0[_0x988c('0x30')]);_0x1adb68[_0x988c('0x2e')]=_[_0x988c('0x45')](_0x1adb68[_0x988c('0x2f')],_0x1adb68[_0x988c('0x30')]);_0x4a83d3['attributes']=_['intersection'](_0x1adb68[_0x988c('0x2f')],qs['fields'](_0x3266b0[_0x988c('0x30')][_0x988c('0x32')]));_0x4a83d3[_0x988c('0x31')]=_0x4a83d3[_0x988c('0x31')][_0x988c('0x46')]?_0x4a83d3[_0x988c('0x31')]:_0x1adb68['model'];if(_0x3266b0[_0x988c('0x30')][_0x988c('0x3f')]){_0x4a83d3[_0x988c('0x47')]=[{'all':!![]}];}_0x4a83d3=_[_0x988c('0x3c')]({},_0x4a83d3,_0x3266b0[_0x988c('0x3d')]);return db[_0x988c('0x3e')][_0x988c('0x48')](_0x4a83d3)['then'](handleEntityNotFound(_0x58c768,null))['then'](respondWithResult(_0x58c768,null))[_0x988c('0x42')](handleError(_0x58c768,null));};exports[_0x988c('0x49')]=function(_0x4246bf,_0x382030){return db['ZendeskField']['create'](_0x4246bf[_0x988c('0x4a')],{})[_0x988c('0x25')](respondWithResult(_0x382030,0xc9))[_0x988c('0x42')](handleError(_0x382030,null));};exports[_0x988c('0x4b')]=function(_0x4b59dc,_0x32cdb6){if(_0x4b59dc[_0x988c('0x4a')]['id']){delete _0x4b59dc[_0x988c('0x4a')]['id'];}return db[_0x988c('0x3e')]['find']({'where':{'id':_0x4b59dc[_0x988c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x32cdb6,null))[_0x988c('0x25')](saveUpdates(_0x4b59dc[_0x988c('0x4a')],null))['then'](respondWithResult(_0x32cdb6,null))[_0x988c('0x42')](handleError(_0x32cdb6,null));};exports[_0x988c('0x26')]=function(_0x9993f4,_0x3dc5c5){return db[_0x988c('0x3e')][_0x988c('0x48')]({'where':{'id':_0x9993f4[_0x988c('0x4c')]['id']}})[_0x988c('0x25')](handleEntityNotFound(_0x3dc5c5,null))['then'](removeEntity(_0x3dc5c5,null))[_0x988c('0x42')](handleError(_0x3dc5c5,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 8cf9a7a..3de7e5b 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 _0xb39c=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','ZendeskField','int_zendesk_fields','idField','FieldId','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb39c,0xec));var _0xcb39=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb39c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xcb39('0x0'));var util=require(_0xcb39('0x1'));var logger=require(_0xcb39('0x2'))(_0xcb39('0x3'));var moment=require(_0xcb39('0x4'));var BPromise=require(_0xcb39('0x5'));var rp=require(_0xcb39('0x6'));var fs=require('fs');var path=require(_0xcb39('0x7'));var rimraf=require(_0xcb39('0x8'));var config=require(_0xcb39('0x9'));var attributes=require('./intZendeskField.attributes');module['exports']=function(_0x550874,_0x5df4b5){return _0x550874['define'](_0xcb39('0xa'),attributes,{'tableName':_0xcb39('0xb'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xcb39('0xc'),_0xcb39('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfd3c=['rimraf','./intZendeskField.attributes','exports','define','ZendeskField','zendesk_unique_index','idField','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x472648,_0x2dd92b){var _0x24088f=function(_0x1cc10f){while(--_0x1cc10f){_0x472648['push'](_0x472648['shift']());}};_0x24088f(++_0x2dd92b);}(_0xfd3c,0x103));var _0xcfd3=function(_0x1cbd7b,_0x4da717){_0x1cbd7b=_0x1cbd7b-0x0;var _0xa37553=_0xfd3c[_0x1cbd7b];return _0xa37553;};'use strict';var _=require(_0xcfd3('0x0'));var util=require(_0xcfd3('0x1'));var logger=require(_0xcfd3('0x2'))('api');var moment=require(_0xcfd3('0x3'));var BPromise=require(_0xcfd3('0x4'));var rp=require(_0xcfd3('0x5'));var fs=require('fs');var path=require(_0xcfd3('0x6'));var rimraf=require(_0xcfd3('0x7'));var config=require('../../config/environment');var attributes=require(_0xcfd3('0x8'));module[_0xcfd3('0x9')]=function(_0x336964,_0x4e49a9){return _0x336964[_0xcfd3('0xa')](_0xcfd3('0xb'),attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0xcfd3('0xc'),'fields':[_0xcfd3('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index de03842..58fbbe6 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 _0xb7ac=['then','info','request\x20sent','debug','stringify','error','code','ZendeskField,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x55610c,_0x5e6294){var _0x30c800=function(_0x15e1c7){while(--_0x15e1c7){_0x55610c['push'](_0x55610c['shift']());}};_0x30c800(++_0x5e6294);}(_0xb7ac,0x96));var _0xcb7a=function(_0x1d2c27,_0x41c293){_0x1d2c27=_0x1d2c27-0x0;var _0xc6612f=_0xb7ac[_0x1d2c27];return _0xc6612f;};'use strict';var _=require(_0xcb7a('0x0'));var util=require('util');var moment=require(_0xcb7a('0x1'));var BPromise=require(_0xcb7a('0x2'));var rs=require(_0xcb7a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcb7a('0x4'));var logger=require(_0xcb7a('0x5'))(_0xcb7a('0x6'));var config=require(_0xcb7a('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcb7a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51cfc6,_0x33c36a,_0x251979){return new BPromise(function(_0x4f5520,_0x653611){return client[_0xcb7a('0x9')](_0x51cfc6,_0x251979)[_0xcb7a('0xa')](function(_0x26a70d){logger[_0xcb7a('0xb')]('ZendeskField,\x20%s,\x20%s',_0x33c36a,_0xcb7a('0xc'));logger[_0xcb7a('0xd')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x33c36a,_0xcb7a('0xc'),JSON[_0xcb7a('0xe')](_0x26a70d));if(_0x26a70d[_0xcb7a('0xf')]){if(_0x26a70d[_0xcb7a('0xf')][_0xcb7a('0x10')]===0x1f4){logger['error'](_0xcb7a('0x11'),_0x33c36a,_0x26a70d[_0xcb7a('0xf')][_0xcb7a('0x12')]);return _0x653611(_0x26a70d[_0xcb7a('0xf')][_0xcb7a('0x12')]);}logger[_0xcb7a('0xf')](_0xcb7a('0x11'),_0x33c36a,_0x26a70d[_0xcb7a('0xf')][_0xcb7a('0x12')]);return _0x4f5520(_0x26a70d[_0xcb7a('0xf')][_0xcb7a('0x12')]);}else{logger['info'](_0xcb7a('0x11'),_0x33c36a,_0xcb7a('0xc'));_0x4f5520(_0x26a70d[_0xcb7a('0x13')]['message']);}})['catch'](function(_0x3690bd){logger[_0xcb7a('0xf')](_0xcb7a('0x11'),_0x33c36a,_0x3690bd);_0x653611(_0x3690bd);});});} \ No newline at end of file +var _0x0990=['info','ZendeskField,\x20%s,\x20%s','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then'];(function(_0x55e1f9,_0x2545e9){var _0x27909c=function(_0x2c7139){while(--_0x2c7139){_0x55e1f9['push'](_0x55e1f9['shift']());}};_0x27909c(++_0x2545e9);}(_0x0990,0xa3));var _0x0099=function(_0x175a55,_0x4082fd){_0x175a55=_0x175a55-0x0;var _0x167adf=_0x0990[_0x175a55];return _0x167adf;};'use strict';var _=require(_0x0099('0x0'));var util=require(_0x0099('0x1'));var moment=require(_0x0099('0x2'));var BPromise=require(_0x0099('0x3'));var rs=require(_0x0099('0x4'));var fs=require('fs');var Redis=require(_0x0099('0x5'));var db=require(_0x0099('0x6'))['db'];var utils=require(_0x0099('0x7'));var logger=require(_0x0099('0x8'))(_0x0099('0x9'));var config=require(_0x0099('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x0099('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39e2c5,_0x54ca39,_0xe15498){return new BPromise(function(_0x23cc0e,_0x3aa541){return client['request'](_0x39e2c5,_0xe15498)[_0x0099('0xc')](function(_0x1e2c12){logger[_0x0099('0xd')](_0x0099('0xe'),_0x54ca39,'request\x20sent');logger['debug'](_0x0099('0xf'),_0x54ca39,_0x0099('0x10'),JSON['stringify'](_0x1e2c12));if(_0x1e2c12[_0x0099('0x11')]){if(_0x1e2c12['error'][_0x0099('0x12')]===0x1f4){logger[_0x0099('0x11')](_0x0099('0xe'),_0x54ca39,_0x1e2c12[_0x0099('0x11')]['message']);return _0x3aa541(_0x1e2c12[_0x0099('0x11')]['message']);}logger[_0x0099('0x11')](_0x0099('0xe'),_0x54ca39,_0x1e2c12[_0x0099('0x11')][_0x0099('0x13')]);return _0x23cc0e(_0x1e2c12['error'][_0x0099('0x13')]);}else{logger[_0x0099('0xd')](_0x0099('0xe'),_0x54ca39,'request\x20sent');_0x23cc0e(_0x1e2c12[_0x0099('0x14')][_0x0099('0x13')]);}})[_0x0099('0x15')](function(_0x53e71c){logger[_0x0099('0x11')]('ZendeskField,\x20%s,\x20%s',_0x54ca39,_0x53e71c);_0x3aa541(_0x53e71c);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 505aee2..07d6931 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 _0x17e2=['post','create','addConfiguration','put','destroy','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields'];(function(_0x19fab3,_0x2379c7){var _0x3ed5f7=function(_0x1e2b75){while(--_0x1e2b75){_0x19fab3['push'](_0x19fab3['shift']());}};_0x3ed5f7(++_0x2379c7);}(_0x17e2,0x99));var _0x217e=function(_0x34d921,_0xd1dfba){_0x34d921=_0x34d921-0x0;var _0x8591f1=_0x17e2[_0x34d921];return _0x8591f1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x217e('0x0'));var timeout=require('connect-timeout');var express=require(_0x217e('0x1'));var router=express[_0x217e('0x2')]();var fs_extra=require(_0x217e('0x3'));var auth=require(_0x217e('0x4'));var interaction=require(_0x217e('0x5'));var config=require('../../config/environment');var controller=require(_0x217e('0x6'));router[_0x217e('0x7')]('/',auth[_0x217e('0x8')](),controller[_0x217e('0x9')]);router[_0x217e('0x7')](_0x217e('0xa'),auth[_0x217e('0x8')](),controller[_0x217e('0xb')]);router[_0x217e('0x7')](_0x217e('0xc'),auth[_0x217e('0x8')](),controller['getConfigurations']);router[_0x217e('0x7')](_0x217e('0xd'),auth[_0x217e('0x8')](),controller[_0x217e('0xe')]);router[_0x217e('0xf')]('/',auth[_0x217e('0x8')](),controller[_0x217e('0x10')]);router[_0x217e('0xf')]('/:id/configurations',auth[_0x217e('0x8')](),controller[_0x217e('0x11')]);router[_0x217e('0x12')](_0x217e('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x217e('0xa'),auth[_0x217e('0x8')](),controller[_0x217e('0x13')]);module[_0x217e('0x14')]=router; \ No newline at end of file +var _0xc229=['put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./intZohoAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration'];(function(_0x2cf2af,_0x420b50){var _0x1b70ed=function(_0x2a885e){while(--_0x2a885e){_0x2cf2af['push'](_0x2cf2af['shift']());}};_0x1b70ed(++_0x420b50);}(_0xc229,0xa6));var _0x9c22=function(_0x590b09,_0x529595){_0x590b09=_0x590b09-0x0;var _0xd9ebb=_0xc229[_0x590b09];return _0xd9ebb;};'use strict';var multer=require(_0x9c22('0x0'));var util=require('util');var path=require(_0x9c22('0x1'));var timeout=require(_0x9c22('0x2'));var express=require(_0x9c22('0x3'));var router=express[_0x9c22('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9c22('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9c22('0x6'));router[_0x9c22('0x7')]('/',auth[_0x9c22('0x8')](),controller['index']);router[_0x9c22('0x7')](_0x9c22('0x9'),auth[_0x9c22('0x8')](),controller[_0x9c22('0xa')]);router[_0x9c22('0x7')](_0x9c22('0xb'),auth['isAuthenticated'](),controller[_0x9c22('0xc')]);router[_0x9c22('0x7')](_0x9c22('0xd'),auth[_0x9c22('0x8')](),controller[_0x9c22('0xe')]);router['post']('/',auth[_0x9c22('0x8')](),controller[_0x9c22('0xf')]);router[_0x9c22('0x10')]('/:id/configurations',auth[_0x9c22('0x8')](),controller[_0x9c22('0x11')]);router[_0x9c22('0x12')](_0x9c22('0x9'),auth['isAuthenticated'](),controller[_0x9c22('0x13')]);router[_0x9c22('0x14')](_0x9c22('0x9'),auth['isAuthenticated'](),controller[_0x9c22('0x15')]);module[_0x9c22('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 6d8a551..b3edaf8 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 _0x91a7=['STRING','exports'];(function(_0x3a60c8,_0x332652){var _0x22d2c6=function(_0x418dcb){while(--_0x418dcb){_0x3a60c8['push'](_0x3a60c8['shift']());}};_0x22d2c6(++_0x332652);}(_0x91a7,0xe7));var _0x791a=function(_0x598c4c,_0x3dfeb2){_0x598c4c=_0x598c4c-0x0;var _0x4facdb=_0x91a7[_0x598c4c];return _0x4facdb;};'use strict';var Sequelize=require('sequelize');module[_0x791a('0x0')]={'name':{'type':Sequelize[_0x791a('0x1')]},'description':{'type':Sequelize[_0x791a('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x791a('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x791a('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x791a('0x1')]}}; \ No newline at end of file +var _0xb4e6=['sequelize','STRING'];(function(_0x11e1cb,_0x537e1b){var _0x576b0f=function(_0x31a012){while(--_0x31a012){_0x11e1cb['push'](_0x11e1cb['shift']());}};_0x576b0f(++_0x537e1b);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x3902c1,_0x1c9eb2){_0x3902c1=_0x3902c1-0x0;var _0x1266cc=_0xb4e6[_0x3902c1];return _0x1266cc;};'use strict';var Sequelize=require(_0x6b4e('0x0'));module['exports']={'name':{'type':Sequelize[_0x6b4e('0x1')]},'description':{'type':Sequelize[_0x6b4e('0x1')]},'host':{'type':Sequelize[_0x6b4e('0x1')]},'zone':{'type':Sequelize[_0x6b4e('0x1')]},'clientId':{'type':Sequelize[_0x6b4e('0x1')]},'clientSecret':{'type':Sequelize[_0x6b4e('0x1')]},'serverUrl':{'type':Sequelize[_0x6b4e('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x6b4e('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index dab0002..c1e1f72 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 _0x7226=['keys','filters','intersection','model','fields','attributes','length','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','update','destroy','getConfigurations','findOne','ZohoConfiguration','rawAttributes','hasOwnProperty','nolimit','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','refreshToken','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','Zoho-oauthtoken\x20','response','message','Subject','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','remove','api_name','system_mandatory','push','custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','then','error','name','index','map','ZohoAccount','type','key','query'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7226,0x1dc));var _0x6722=function(_0x26f57f,_0x64e3df){_0x26f57f=_0x26f57f-0x0;var _0x3473ba=_0x7226[_0x26f57f];return _0x3473ba;};'use strict';var emlformat=require(_0x6722('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6722('0x1'));var jsonpatch=require(_0x6722('0x2'));var rp=require(_0x6722('0x3'));var moment=require(_0x6722('0x4'));var BPromise=require(_0x6722('0x5'));var Mustache=require(_0x6722('0x6'));var util=require('util');var path=require(_0x6722('0x7'));var sox=require(_0x6722('0x8'));var csv=require(_0x6722('0x9'));var ejs=require(_0x6722('0xa'));var fs=require('fs');var fs_extra=require(_0x6722('0xb'));var _=require(_0x6722('0xc'));var squel=require(_0x6722('0xd'));var crypto=require(_0x6722('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x6722('0xf'));var toCsv=require(_0x6722('0x9'));var querystring=require('querystring');var Papa=require(_0x6722('0x10'));var Redis=require(_0x6722('0x11'));var authService=require(_0x6722('0x12'));var qs=require(_0x6722('0x13'));var as=require(_0x6722('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6722('0x15'));var utils=require(_0x6722('0x16'));var config=require(_0x6722('0x17'));var licenseUtil=require(_0x6722('0x18'));var db=require(_0x6722('0x19'))['db'];var integrations=require(_0x6722('0x1a'));function respondWithStatusCode(_0x31a2db,_0x5bcdb3){_0x5bcdb3=_0x5bcdb3||0xcc;return function(_0x489dc9){if(_0x489dc9){return _0x31a2db[_0x6722('0x1b')](_0x5bcdb3);}return _0x31a2db[_0x6722('0x1c')](_0x5bcdb3)[_0x6722('0x1d')]();};}function respondWithResult(_0x4b6996,_0x570cbb){_0x570cbb=_0x570cbb||0xc8;return function(_0x4589e7){if(_0x4589e7){return _0x4b6996[_0x6722('0x1c')](_0x570cbb)[_0x6722('0x1e')](_0x4589e7);}};}function respondWithFilteredResult(_0x3f1f6e,_0x53e46b){return function(_0x5af46a){if(_0x5af46a){var _0x6d9c5=typeof _0x53e46b[_0x6722('0x1f')]==='undefined'&&typeof _0x53e46b['limit']===_0x6722('0x20');var _0x4085a2=_0x5af46a[_0x6722('0x21')];var _0x5e2d6c=_0x6d9c5?0x0:_0x53e46b[_0x6722('0x1f')];var _0x5986b3=_0x6d9c5?_0x5af46a['count']:_0x53e46b[_0x6722('0x1f')]+_0x53e46b[_0x6722('0x22')];var _0x186a59;if(_0x5986b3>=_0x4085a2){_0x5986b3=_0x4085a2;_0x186a59=0xc8;}else{_0x186a59=0xce;}_0x3f1f6e[_0x6722('0x1c')](_0x186a59);return _0x3f1f6e[_0x6722('0x23')]('Content-Range',_0x5e2d6c+'-'+_0x5986b3+'/'+_0x4085a2)[_0x6722('0x1e')](_0x5af46a);}return null;};}function patchUpdates(_0x4e98e8){return function(_0x2fc047){try{jsonpatch[_0x6722('0x24')](_0x2fc047,_0x4e98e8,!![]);}catch(_0x7d56fd){return BPromise[_0x6722('0x25')](_0x7d56fd);}return _0x2fc047[_0x6722('0x26')]();};}function saveUpdates(_0x49861e,_0x1f85dd){return function(_0x41b372){if(_0x41b372){return _0x41b372['update'](_0x49861e)[_0x6722('0x27')](function(_0x51f644){return _0x51f644;});}return null;};}function removeEntity(_0x2c1ea8,_0x2a5d56){return function(_0x389025){if(_0x389025){return _0x389025['destroy']()['then'](function(){_0x2c1ea8['status'](0xcc)[_0x6722('0x1d')]();});}};}function handleEntityNotFound(_0x53f8eb,_0x2b0bbd){return function(_0x42afd4){if(!_0x42afd4){_0x53f8eb[_0x6722('0x1b')](0x194);}return _0x42afd4;};}function handleError(_0x191397,_0x422a26){_0x422a26=_0x422a26||0x1f4;return function(_0x52dad6){logger[_0x6722('0x28')](_0x52dad6['stack']);if(_0x52dad6[_0x6722('0x29')]){delete _0x52dad6[_0x6722('0x29')];}_0x191397['status'](_0x422a26)['send'](_0x52dad6);};}exports[_0x6722('0x2a')]=function(_0x57b0bd,_0x5147e5){var _0x1df811={},_0x22040c={},_0x1a44fb={'count':0x0,'rows':[]};var _0x4a136e=_[_0x6722('0x2b')](db[_0x6722('0x2c')]['rawAttributes'],function(_0x3c1009){return{'name':_0x3c1009['fieldName'],'type':_0x3c1009[_0x6722('0x2d')][_0x6722('0x2e')]};});_0x22040c['model']=_[_0x6722('0x2b')](_0x4a136e,_0x6722('0x29'));_0x22040c[_0x6722('0x2f')]=_[_0x6722('0x30')](_0x57b0bd[_0x6722('0x2f')]);_0x22040c[_0x6722('0x31')]=_['intersection'](_0x22040c['model'],_0x22040c[_0x6722('0x2f')]);_0x1df811['attributes']=_[_0x6722('0x32')](_0x22040c[_0x6722('0x33')],qs['fields'](_0x57b0bd[_0x6722('0x2f')][_0x6722('0x34')]));_0x1df811['attributes']=_0x1df811[_0x6722('0x35')][_0x6722('0x36')]?_0x1df811[_0x6722('0x35')]:_0x22040c[_0x6722('0x33')];if(!_0x57b0bd['query']['hasOwnProperty']('nolimit')){_0x1df811[_0x6722('0x22')]=qs[_0x6722('0x22')](_0x57b0bd[_0x6722('0x2f')]['limit']);_0x1df811['offset']=qs[_0x6722('0x1f')](_0x57b0bd[_0x6722('0x2f')]['offset']);}_0x1df811['order']=qs[_0x6722('0x37')](_0x57b0bd[_0x6722('0x2f')][_0x6722('0x37')]);_0x1df811[_0x6722('0x38')]=qs[_0x6722('0x31')](_[_0x6722('0x39')](_0x57b0bd[_0x6722('0x2f')],_0x22040c[_0x6722('0x31')]),_0x4a136e);if(_0x57b0bd['query']['filter']){_0x1df811['where']=_[_0x6722('0x3a')](_0x1df811['where'],{'$or':_[_0x6722('0x2b')](_0x4a136e,function(_0x3469a6){if(_0x3469a6['type']!==_0x6722('0x3b')){var _0x343a03={};_0x343a03[_0x3469a6[_0x6722('0x29')]]={'$like':'%'+_0x57b0bd['query'][_0x6722('0x3c')]+'%'};return _0x343a03;}})});}_0x1df811=_['merge']({},_0x1df811,_0x57b0bd['options']);var _0x39d331={'where':_0x1df811[_0x6722('0x38')]};return db['ZohoAccount'][_0x6722('0x21')](_0x39d331)[_0x6722('0x27')](function(_0x4eed71){_0x1a44fb['count']=_0x4eed71;if(_0x57b0bd[_0x6722('0x2f')][_0x6722('0x3d')]){_0x1df811[_0x6722('0x3e')]=[{'all':!![]}];}return db['ZohoAccount'][_0x6722('0x3f')](_0x1df811);})[_0x6722('0x27')](function(_0x415fb9){_0x1a44fb[_0x6722('0x40')]=_0x415fb9;return _0x1a44fb;})['then'](respondWithFilteredResult(_0x5147e5,_0x1df811))['catch'](handleError(_0x5147e5,null));};exports[_0x6722('0x41')]=function(_0x153a08,_0x60d5aa){var _0x4301e0={'raw':![],'where':{'id':_0x153a08[_0x6722('0x42')]['id']}},_0x3db99c={};_0x3db99c[_0x6722('0x33')]=_[_0x6722('0x30')](db[_0x6722('0x2c')]['rawAttributes']);_0x3db99c[_0x6722('0x2f')]=_[_0x6722('0x30')](_0x153a08[_0x6722('0x2f')]);_0x3db99c[_0x6722('0x31')]=_[_0x6722('0x32')](_0x3db99c['model'],_0x3db99c['query']);_0x4301e0[_0x6722('0x35')]=_['intersection'](_0x3db99c[_0x6722('0x33')],qs[_0x6722('0x34')](_0x153a08[_0x6722('0x2f')]['fields']));_0x4301e0[_0x6722('0x35')]=_0x4301e0[_0x6722('0x35')][_0x6722('0x36')]?_0x4301e0[_0x6722('0x35')]:_0x3db99c[_0x6722('0x33')];if(_0x153a08['query']['includeAll']){_0x4301e0[_0x6722('0x3e')]=[{'all':!![]}];}_0x4301e0=_[_0x6722('0x3a')]({},_0x4301e0,_0x153a08[_0x6722('0x43')]);return db['ZohoAccount'][_0x6722('0x44')](_0x4301e0)[_0x6722('0x27')](handleEntityNotFound(_0x60d5aa,null))['then'](respondWithResult(_0x60d5aa,null))[_0x6722('0x45')](handleError(_0x60d5aa,null));};exports[_0x6722('0x46')]=function(_0xd5953f,_0x5e5bc1){return db['ZohoAccount'][_0x6722('0x46')](_0xd5953f[_0x6722('0x47')],{})[_0x6722('0x27')](respondWithResult(_0x5e5bc1,0xc9))[_0x6722('0x45')](handleError(_0x5e5bc1,null));};exports[_0x6722('0x48')]=function(_0x41e352,_0x463b13){if(_0x41e352[_0x6722('0x47')]['id']){delete _0x41e352[_0x6722('0x47')]['id'];}return db[_0x6722('0x2c')][_0x6722('0x44')]({'where':{'id':_0x41e352[_0x6722('0x42')]['id']}})[_0x6722('0x27')](handleEntityNotFound(_0x463b13,null))[_0x6722('0x27')](saveUpdates(_0x41e352[_0x6722('0x47')],null))[_0x6722('0x27')](respondWithResult(_0x463b13,null))[_0x6722('0x45')](handleError(_0x463b13,null));};exports[_0x6722('0x49')]=function(_0x270766,_0x1a7bce){return db[_0x6722('0x2c')]['find']({'where':{'id':_0x270766[_0x6722('0x42')]['id']}})[_0x6722('0x27')](handleEntityNotFound(_0x1a7bce,null))[_0x6722('0x27')](removeEntity(_0x1a7bce,null))[_0x6722('0x45')](handleError(_0x1a7bce,null));};exports[_0x6722('0x4a')]=function(_0x1ecea1,_0x41b55f,_0x253ccb){var _0x1c5ab9={};var _0x5e27dd={};var _0x574ae;var _0x2c8b6b;return db[_0x6722('0x2c')][_0x6722('0x4b')]({'where':{'id':_0x1ecea1[_0x6722('0x42')]['id']}})[_0x6722('0x27')](handleEntityNotFound(_0x41b55f,null))[_0x6722('0x27')](function(_0xe4b39e){if(_0xe4b39e){_0x574ae=_0xe4b39e;_0x5e27dd[_0x6722('0x33')]=_[_0x6722('0x30')](db[_0x6722('0x4c')][_0x6722('0x4d')]);_0x5e27dd[_0x6722('0x2f')]=_[_0x6722('0x30')](_0x1ecea1[_0x6722('0x2f')]);_0x5e27dd[_0x6722('0x31')]=_['intersection'](_0x5e27dd[_0x6722('0x33')],_0x5e27dd[_0x6722('0x2f')]);_0x1c5ab9[_0x6722('0x35')]=_[_0x6722('0x32')](_0x5e27dd[_0x6722('0x33')],qs[_0x6722('0x34')](_0x1ecea1[_0x6722('0x2f')][_0x6722('0x34')]));_0x1c5ab9[_0x6722('0x35')]=_0x1c5ab9[_0x6722('0x35')][_0x6722('0x36')]?_0x1c5ab9[_0x6722('0x35')]:_0x5e27dd[_0x6722('0x33')];_0x1c5ab9['order']=qs[_0x6722('0x37')](_0x1ecea1[_0x6722('0x2f')][_0x6722('0x37')]);_0x1c5ab9[_0x6722('0x38')]=qs[_0x6722('0x31')](_[_0x6722('0x39')](_0x1ecea1[_0x6722('0x2f')],_0x5e27dd[_0x6722('0x31')]));if(_0x1ecea1[_0x6722('0x2f')][_0x6722('0x3c')]){_0x1c5ab9[_0x6722('0x38')]=_[_0x6722('0x3a')](_0x1c5ab9['where'],{'$or':_[_0x6722('0x2b')](_0x1c5ab9[_0x6722('0x35')],function(_0x32218e){var _0x19ee56={};_0x19ee56[_0x32218e]={'$like':'%'+_0x1ecea1[_0x6722('0x2f')][_0x6722('0x3c')]+'%'};return _0x19ee56;})});}_0x1c5ab9=_[_0x6722('0x3a')]({},_0x1c5ab9,_0x1ecea1[_0x6722('0x43')]);return _0x574ae['getConfigurations'](_0x1c5ab9);}})[_0x6722('0x27')](function(_0x4ec2da){if(_0x4ec2da){_0x2c8b6b=_0x4ec2da[_0x6722('0x36')];if(!_0x1ecea1[_0x6722('0x2f')][_0x6722('0x4e')](_0x6722('0x4f'))){_0x1c5ab9['limit']=qs[_0x6722('0x22')](_0x1ecea1[_0x6722('0x2f')][_0x6722('0x22')]);_0x1c5ab9['offset']=qs[_0x6722('0x1f')](_0x1ecea1[_0x6722('0x2f')]['offset']);}return _0x574ae[_0x6722('0x4a')](_0x1c5ab9);}})[_0x6722('0x27')](function(_0x53ff85){if(_0x53ff85){return _0x53ff85?{'count':_0x2c8b6b,'rows':_0x53ff85}:null;}})['then'](respondWithResult(_0x41b55f,null))['catch'](handleError(_0x41b55f,null));};exports[_0x6722('0x50')]=function(_0x29356f,_0x393200,_0x1df042){if(_0x29356f[_0x6722('0x47')]['id']){delete _0x29356f['body']['id'];}return db[_0x6722('0x2c')][_0x6722('0x4b')]({'where':{'id':_0x29356f[_0x6722('0x42')]['id']}})[_0x6722('0x27')](handleEntityNotFound(_0x393200,null))[_0x6722('0x27')](function(_0xa3868){if(_0xa3868){_0x29356f[_0x6722('0x47')]['AccountId']=_0xa3868['id'];_0x29356f['body'][_0x6722('0x51')]=integrations[_0x6722('0x52')](_0x29356f['body'][_0x6722('0x53')],_0x29356f[_0x6722('0x47')]['type']);_0x29356f[_0x6722('0x47')][_0x6722('0x54')]=integrations[_0x6722('0x55')](_0x29356f[_0x6722('0x47')][_0x6722('0x53')],_0x29356f[_0x6722('0x47')]['type']);return db[_0x6722('0x4c')][_0x6722('0x46')](_0x29356f['body'],{'include':[{'model':db['ZohoField'],'as':'Subjects'},{'model':db[_0x6722('0x56')],'as':_0x6722('0x54')}]});}return null;})[_0x6722('0x27')](respondWithResult(_0x393200,null))[_0x6722('0x45')](handleError(_0x393200,null));};function getAccessToken(_0x218610){return new Promise(function(_0x1165ac,_0x43f510){var _0x2e2ab5;switch(_0x218610[_0x6722('0x57')]){case'US':_0x2e2ab5=_0x6722('0x58');break;case'AU':_0x2e2ab5=_0x6722('0x59');break;case'EU':_0x2e2ab5=_0x6722('0x5a');break;case'IN':_0x2e2ab5=_0x6722('0x5b');break;case'CN':_0x2e2ab5=_0x6722('0x5c');break;default:_0x2e2ab5=_0x6722('0x5a');break;}var _0x2bce0c={'method':_0x6722('0x5d'),'uri':_0x2e2ab5+_0x6722('0x5e'),'qs':{'refresh_token':_0x218610['refreshToken'],'client_id':_0x218610[_0x6722('0x5f')],'client_secret':_0x218610[_0x6722('0x60')],'grant_type':_0x6722('0x61')},'json':!![]};return rp(_0x2bce0c)['then'](function(_0x5be2b6){if(_0x5be2b6['access_token']){_0x1165ac(_0x5be2b6[_0x6722('0x62')]);}else{_0x43f510(_0x6722('0x63'));}})[_0x6722('0x45')](function(_0x554a7d){_0x43f510(_0x554a7d);});});}exports[_0x6722('0x64')]=function(_0x46f3a0,_0x1cd133,_0x178e96){var _0x1023d5,_0x414cbb,_0x42125a,_0xba446b,_0x5b31bc;return db[_0x6722('0x2c')]['findOne']({'where':{'id':_0x46f3a0['params']['id']},'attributes':['id',_0x6722('0x65'),_0x6722('0x57'),'clientId',_0x6722('0x60'),_0x6722('0x66'),'code',_0x6722('0x67')]})[_0x6722('0x27')](handleEntityNotFound(_0x1cd133,null))['then'](function(_0x52787e){_0x5b31bc=_0x52787e;_0x1023d5=_0x5b31bc[_0x6722('0x65')];_0x414cbb=_0x1023d5===_0x6722('0x68')?'eu':_0x6722('0x69');_0x42125a=_0x5b31bc[_0x6722('0x66')];var _0x2b0dc9=_0x42125a[_0x6722('0x6a')](-0x1);if(_0x2b0dc9==='/'||_0x2b0dc9==='\x5c'||_0x2b0dc9===':'){_0x42125a=_0x42125a[_0x6722('0x6b')](0x0,_0x42125a[_0x6722('0x6c')](_0x2b0dc9));}if(!_0x5b31bc['refreshToken']){throw new Error(_0x6722('0x6d'));}return getAccessToken(_0x5b31bc);})['then'](function(_0x1678e7){if(_0x1678e7){return rp({'method':'GET','uri':util[_0x6722('0x6e')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x414cbb),'qs':{'module':'Calls'},'headers':{'Authorization':_0x6722('0x6f')+_0x1678e7},'json':!![]});}})[_0x6722('0x27')](function(_0x5b7d5c){if(_0x5b7d5c){if(_0x5b7d5c['response']&&_0x5b7d5c[_0x6722('0x70')][_0x6722('0x28')]){throw new Error(_0x5b7d5c[_0x6722('0x70')][_0x6722('0x28')][_0x6722('0x71')]);}var _0x2b6d1d=[];var _0x152b94=[];var _0x43488e=['Owner',_0x6722('0x72'),_0x6722('0x73'),_0x6722('0x74'),'Call_Duration',_0x6722('0x75'),_0x6722('0x76'),_0x6722('0x77')];_0x152b94=_[_0x6722('0x78')](_0x5b7d5c[_0x6722('0x34')],function(_0x34874e){return _0x43488e['includes'](_0x34874e[_0x6722('0x79')]);});for(var _0x1d4366=0x0;_0x1d4366<_0x152b94[_0x6722('0x36')];_0x1d4366++){if(_0x152b94[_0x1d4366][_0x6722('0x7a')]===![]){_0x2b6d1d[_0x6722('0x7b')]({'id':_0x152b94[_0x1d4366]['id'],'name':_0x152b94[_0x1d4366]['display_label'],'custom':_0x152b94[_0x1d4366][_0x6722('0x7c')],'options':_0x152b94[_0x1d4366][_0x6722('0x7d')]===_0x6722('0x7e')&&_0x152b94[_0x1d4366][_0x6722('0x7f')][_0x6722('0x36')]>-0x1?_[_0x6722('0x2b')](_0x152b94[_0x1d4366][_0x6722('0x7f')],function(_0x143e56){return{'name':_0x143e56,'value':_0x143e56};}):[]});}}return{'count':_0x2b6d1d[_0x6722('0x36')],'rows':_0x2b6d1d};}else{return{'count':0x0,'rows':[]};}})[_0x6722('0x27')](respondWithResult(_0x1cd133,null))[_0x6722('0x45')](function(_0x4d24ce){var _0x50e7b6=_0x46f3a0['query'][_0x6722('0x80')]?0x1f4:_0x4d24ce[_0x6722('0x81')]||0x1f4;logger['error'](_0x6722('0x82'),_0x6722('0x64'),_0x50e7b6,JSON['stringify'](_0x4d24ce));delete _0x4d24ce[_0x6722('0x29')];if(_0x50e7b6===0x191){_0x50e7b6=0x190;}_0x1cd133['status'](_0x50e7b6)['send'](_0x46f3a0[_0x6722('0x2f')][_0x6722('0x80')]?{'message':'Wrong\x20credentials','statusCode':_0x4d24ce[_0x6722('0x81')]}:_0x4d24ce);});}; \ No newline at end of file +var _0xc2f1=['display_label','custom_field','data_type','picklist','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','ZohoAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','fields','length','find','catch','body','params','getConfigurations','findOne','ZohoConfiguration','order','getSubjects','channel','type','Descriptions','create','ZohoField','Subjects','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','clientSecret','serverUrl','code','zoho.eu','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Zoho-oauthtoken\x20','response','Owner','Subject','WhoId','Call_Start_Time','remove','includes','api_name','system_mandatory'];(function(_0x12fcbd,_0x884804){var _0x28ec2a=function(_0xa5ff99){while(--_0xa5ff99){_0x12fcbd['push'](_0x12fcbd['shift']());}};_0x28ec2a(++_0x884804);}(_0xc2f1,0x88));var _0x1c2f=function(_0x288f54,_0x57d4e3){_0x288f54=_0x288f54-0x0;var _0xb740ff=_0xc2f1[_0x288f54];return _0xb740ff;};'use strict';var emlformat=require(_0x1c2f('0x0'));var rimraf=require(_0x1c2f('0x1'));var zipdir=require(_0x1c2f('0x2'));var jsonpatch=require(_0x1c2f('0x3'));var rp=require(_0x1c2f('0x4'));var moment=require(_0x1c2f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x1c2f('0x6'));var sox=require(_0x1c2f('0x7'));var csv=require(_0x1c2f('0x8'));var ejs=require(_0x1c2f('0x9'));var fs=require('fs');var fs_extra=require(_0x1c2f('0xa'));var _=require(_0x1c2f('0xb'));var squel=require(_0x1c2f('0xc'));var crypto=require(_0x1c2f('0xd'));var jsforce=require(_0x1c2f('0xe'));var deskjs=require(_0x1c2f('0xf'));var toCsv=require(_0x1c2f('0x8'));var querystring=require(_0x1c2f('0x10'));var Papa=require(_0x1c2f('0x11'));var Redis=require('ioredis');var authService=require(_0x1c2f('0x12'));var qs=require(_0x1c2f('0x13'));var as=require(_0x1c2f('0x14'));var hardwareService=require(_0x1c2f('0x15'));var logger=require('../../config/logger')(_0x1c2f('0x16'));var utils=require(_0x1c2f('0x17'));var config=require(_0x1c2f('0x18'));var licenseUtil=require(_0x1c2f('0x19'));var db=require('../../mysqldb')['db'];var integrations=require(_0x1c2f('0x1a'));function respondWithStatusCode(_0x52e0b6,_0x4d40ba){_0x4d40ba=_0x4d40ba||0xcc;return function(_0x2ab7e8){if(_0x2ab7e8){return _0x52e0b6['sendStatus'](_0x4d40ba);}return _0x52e0b6[_0x1c2f('0x1b')](_0x4d40ba)['end']();};}function respondWithResult(_0x362873,_0x25bd47){_0x25bd47=_0x25bd47||0xc8;return function(_0x1fb6a7){if(_0x1fb6a7){return _0x362873[_0x1c2f('0x1b')](_0x25bd47)[_0x1c2f('0x1c')](_0x1fb6a7);}};}function respondWithFilteredResult(_0x2475d7,_0x56c89d){return function(_0x3bae7a){if(_0x3bae7a){var _0xb749ab=typeof _0x56c89d[_0x1c2f('0x1d')]===_0x1c2f('0x1e')&&typeof _0x56c89d[_0x1c2f('0x1f')]===_0x1c2f('0x1e');var _0x3c8fe8=_0x3bae7a['count'];var _0x192c6a=_0xb749ab?0x0:_0x56c89d[_0x1c2f('0x1d')];var _0x53ed0e=_0xb749ab?_0x3bae7a[_0x1c2f('0x20')]:_0x56c89d['offset']+_0x56c89d[_0x1c2f('0x1f')];var _0x397286;if(_0x53ed0e>=_0x3c8fe8){_0x53ed0e=_0x3c8fe8;_0x397286=0xc8;}else{_0x397286=0xce;}_0x2475d7[_0x1c2f('0x1b')](_0x397286);return _0x2475d7[_0x1c2f('0x21')](_0x1c2f('0x22'),_0x192c6a+'-'+_0x53ed0e+'/'+_0x3c8fe8)[_0x1c2f('0x1c')](_0x3bae7a);}return null;};}function patchUpdates(_0x390cc0){return function(_0x277ced){try{jsonpatch[_0x1c2f('0x23')](_0x277ced,_0x390cc0,!![]);}catch(_0x2cf7ca){return BPromise[_0x1c2f('0x24')](_0x2cf7ca);}return _0x277ced[_0x1c2f('0x25')]();};}function saveUpdates(_0x2d7cc5,_0xfd7181){return function(_0x51de7e){if(_0x51de7e){return _0x51de7e[_0x1c2f('0x26')](_0x2d7cc5)[_0x1c2f('0x27')](function(_0x5b287b){return _0x5b287b;});}return null;};}function removeEntity(_0x70e6b3,_0x1c58a5){return function(_0x5a40e5){if(_0x5a40e5){return _0x5a40e5[_0x1c2f('0x28')]()[_0x1c2f('0x27')](function(){_0x70e6b3[_0x1c2f('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11d98c,_0x1d660c){return function(_0x484d32){if(!_0x484d32){_0x11d98c['sendStatus'](0x194);}return _0x484d32;};}function handleError(_0x323254,_0x4b04a0){_0x4b04a0=_0x4b04a0||0x1f4;return function(_0x1c052e){logger[_0x1c2f('0x29')](_0x1c052e['stack']);if(_0x1c052e['name']){delete _0x1c052e[_0x1c2f('0x2a')];}_0x323254['status'](_0x4b04a0)[_0x1c2f('0x2b')](_0x1c052e);};}exports[_0x1c2f('0x2c')]=function(_0x3f90b5,_0x1f372d){var _0x5291b1={},_0x2c9cde={},_0x4a46eb={'count':0x0,'rows':[]};var _0x179864=_[_0x1c2f('0x2d')](db[_0x1c2f('0x2e')][_0x1c2f('0x2f')],function(_0xb7c9ee){return{'name':_0xb7c9ee[_0x1c2f('0x30')],'type':_0xb7c9ee['type']['key']};});_0x2c9cde[_0x1c2f('0x31')]=_['map'](_0x179864,'name');_0x2c9cde[_0x1c2f('0x32')]=_[_0x1c2f('0x33')](_0x3f90b5[_0x1c2f('0x32')]);_0x2c9cde[_0x1c2f('0x34')]=_[_0x1c2f('0x35')](_0x2c9cde[_0x1c2f('0x31')],_0x2c9cde['query']);_0x5291b1[_0x1c2f('0x36')]=_['intersection'](_0x2c9cde[_0x1c2f('0x31')],qs['fields'](_0x3f90b5[_0x1c2f('0x32')]['fields']));_0x5291b1['attributes']=_0x5291b1[_0x1c2f('0x36')]['length']?_0x5291b1[_0x1c2f('0x36')]:_0x2c9cde[_0x1c2f('0x31')];if(!_0x3f90b5[_0x1c2f('0x32')][_0x1c2f('0x37')](_0x1c2f('0x38'))){_0x5291b1[_0x1c2f('0x1f')]=qs[_0x1c2f('0x1f')](_0x3f90b5[_0x1c2f('0x32')]['limit']);_0x5291b1[_0x1c2f('0x1d')]=qs[_0x1c2f('0x1d')](_0x3f90b5[_0x1c2f('0x32')]['offset']);}_0x5291b1['order']=qs['sort'](_0x3f90b5[_0x1c2f('0x32')][_0x1c2f('0x39')]);_0x5291b1[_0x1c2f('0x3a')]=qs[_0x1c2f('0x34')](_[_0x1c2f('0x3b')](_0x3f90b5[_0x1c2f('0x32')],_0x2c9cde['filters']),_0x179864);if(_0x3f90b5[_0x1c2f('0x32')][_0x1c2f('0x3c')]){_0x5291b1[_0x1c2f('0x3a')]=_[_0x1c2f('0x3d')](_0x5291b1[_0x1c2f('0x3a')],{'$or':_[_0x1c2f('0x2d')](_0x179864,function(_0x520f5d){if(_0x520f5d['type']!==_0x1c2f('0x3e')){var _0x268248={};_0x268248[_0x520f5d['name']]={'$like':'%'+_0x3f90b5[_0x1c2f('0x32')][_0x1c2f('0x3c')]+'%'};return _0x268248;}})});}_0x5291b1=_['merge']({},_0x5291b1,_0x3f90b5[_0x1c2f('0x3f')]);var _0x5a60e2={'where':_0x5291b1['where']};return db[_0x1c2f('0x2e')][_0x1c2f('0x20')](_0x5a60e2)['then'](function(_0x483338){_0x4a46eb['count']=_0x483338;if(_0x3f90b5['query'][_0x1c2f('0x40')]){_0x5291b1[_0x1c2f('0x41')]=[{'all':!![]}];}return db[_0x1c2f('0x2e')][_0x1c2f('0x42')](_0x5291b1);})['then'](function(_0x476f5b){_0x4a46eb[_0x1c2f('0x43')]=_0x476f5b;return _0x4a46eb;})['then'](respondWithFilteredResult(_0x1f372d,_0x5291b1))['catch'](handleError(_0x1f372d,null));};exports[_0x1c2f('0x44')]=function(_0x1d1445,_0x5ee5ef){var _0x163a5b={'raw':![],'where':{'id':_0x1d1445['params']['id']}},_0x39c223={};_0x39c223[_0x1c2f('0x31')]=_[_0x1c2f('0x33')](db[_0x1c2f('0x2e')]['rawAttributes']);_0x39c223[_0x1c2f('0x32')]=_[_0x1c2f('0x33')](_0x1d1445[_0x1c2f('0x32')]);_0x39c223[_0x1c2f('0x34')]=_[_0x1c2f('0x35')](_0x39c223[_0x1c2f('0x31')],_0x39c223['query']);_0x163a5b['attributes']=_[_0x1c2f('0x35')](_0x39c223[_0x1c2f('0x31')],qs[_0x1c2f('0x45')](_0x1d1445['query']['fields']));_0x163a5b[_0x1c2f('0x36')]=_0x163a5b['attributes'][_0x1c2f('0x46')]?_0x163a5b[_0x1c2f('0x36')]:_0x39c223[_0x1c2f('0x31')];if(_0x1d1445[_0x1c2f('0x32')][_0x1c2f('0x40')]){_0x163a5b['include']=[{'all':!![]}];}_0x163a5b=_[_0x1c2f('0x3d')]({},_0x163a5b,_0x1d1445[_0x1c2f('0x3f')]);return db['ZohoAccount'][_0x1c2f('0x47')](_0x163a5b)[_0x1c2f('0x27')](handleEntityNotFound(_0x5ee5ef,null))['then'](respondWithResult(_0x5ee5ef,null))[_0x1c2f('0x48')](handleError(_0x5ee5ef,null));};exports['create']=function(_0x269ee6,_0x1afc40){return db[_0x1c2f('0x2e')]['create'](_0x269ee6[_0x1c2f('0x49')],{})[_0x1c2f('0x27')](respondWithResult(_0x1afc40,0xc9))[_0x1c2f('0x48')](handleError(_0x1afc40,null));};exports[_0x1c2f('0x26')]=function(_0x4beeb9,_0x21995a){if(_0x4beeb9[_0x1c2f('0x49')]['id']){delete _0x4beeb9[_0x1c2f('0x49')]['id'];}return db[_0x1c2f('0x2e')][_0x1c2f('0x47')]({'where':{'id':_0x4beeb9[_0x1c2f('0x4a')]['id']}})[_0x1c2f('0x27')](handleEntityNotFound(_0x21995a,null))[_0x1c2f('0x27')](saveUpdates(_0x4beeb9[_0x1c2f('0x49')],null))[_0x1c2f('0x27')](respondWithResult(_0x21995a,null))[_0x1c2f('0x48')](handleError(_0x21995a,null));};exports[_0x1c2f('0x28')]=function(_0x98f298,_0x3e0e21){return db[_0x1c2f('0x2e')][_0x1c2f('0x47')]({'where':{'id':_0x98f298[_0x1c2f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3e0e21,null))[_0x1c2f('0x27')](removeEntity(_0x3e0e21,null))[_0x1c2f('0x48')](handleError(_0x3e0e21,null));};exports[_0x1c2f('0x4b')]=function(_0x36231a,_0x5438e4,_0x2a1091){var _0x594263={};var _0x5d3d11={};var _0x55a633;var _0x2c53b9;return db['ZohoAccount'][_0x1c2f('0x4c')]({'where':{'id':_0x36231a[_0x1c2f('0x4a')]['id']}})[_0x1c2f('0x27')](handleEntityNotFound(_0x5438e4,null))[_0x1c2f('0x27')](function(_0x330f15){if(_0x330f15){_0x55a633=_0x330f15;_0x5d3d11[_0x1c2f('0x31')]=_[_0x1c2f('0x33')](db[_0x1c2f('0x4d')]['rawAttributes']);_0x5d3d11[_0x1c2f('0x32')]=_[_0x1c2f('0x33')](_0x36231a[_0x1c2f('0x32')]);_0x5d3d11['filters']=_['intersection'](_0x5d3d11['model'],_0x5d3d11[_0x1c2f('0x32')]);_0x594263[_0x1c2f('0x36')]=_[_0x1c2f('0x35')](_0x5d3d11[_0x1c2f('0x31')],qs[_0x1c2f('0x45')](_0x36231a[_0x1c2f('0x32')][_0x1c2f('0x45')]));_0x594263['attributes']=_0x594263['attributes'][_0x1c2f('0x46')]?_0x594263[_0x1c2f('0x36')]:_0x5d3d11[_0x1c2f('0x31')];_0x594263[_0x1c2f('0x4e')]=qs[_0x1c2f('0x39')](_0x36231a[_0x1c2f('0x32')][_0x1c2f('0x39')]);_0x594263[_0x1c2f('0x3a')]=qs[_0x1c2f('0x34')](_[_0x1c2f('0x3b')](_0x36231a[_0x1c2f('0x32')],_0x5d3d11['filters']));if(_0x36231a[_0x1c2f('0x32')][_0x1c2f('0x3c')]){_0x594263[_0x1c2f('0x3a')]=_[_0x1c2f('0x3d')](_0x594263[_0x1c2f('0x3a')],{'$or':_[_0x1c2f('0x2d')](_0x594263[_0x1c2f('0x36')],function(_0x2125ec){var _0x387b99={};_0x387b99[_0x2125ec]={'$like':'%'+_0x36231a[_0x1c2f('0x32')][_0x1c2f('0x3c')]+'%'};return _0x387b99;})});}_0x594263=_[_0x1c2f('0x3d')]({},_0x594263,_0x36231a[_0x1c2f('0x3f')]);return _0x55a633['getConfigurations'](_0x594263);}})[_0x1c2f('0x27')](function(_0x30f68b){if(_0x30f68b){_0x2c53b9=_0x30f68b[_0x1c2f('0x46')];if(!_0x36231a[_0x1c2f('0x32')]['hasOwnProperty'](_0x1c2f('0x38'))){_0x594263[_0x1c2f('0x1f')]=qs['limit'](_0x36231a[_0x1c2f('0x32')][_0x1c2f('0x1f')]);_0x594263['offset']=qs[_0x1c2f('0x1d')](_0x36231a[_0x1c2f('0x32')][_0x1c2f('0x1d')]);}return _0x55a633[_0x1c2f('0x4b')](_0x594263);}})['then'](function(_0x957b2a){if(_0x957b2a){return _0x957b2a?{'count':_0x2c53b9,'rows':_0x957b2a}:null;}})[_0x1c2f('0x27')](respondWithResult(_0x5438e4,null))[_0x1c2f('0x48')](handleError(_0x5438e4,null));};exports['addConfiguration']=function(_0xb8a643,_0x57e021,_0x1bd9c9){if(_0xb8a643[_0x1c2f('0x49')]['id']){delete _0xb8a643['body']['id'];}return db[_0x1c2f('0x2e')][_0x1c2f('0x4c')]({'where':{'id':_0xb8a643[_0x1c2f('0x4a')]['id']}})[_0x1c2f('0x27')](handleEntityNotFound(_0x57e021,null))['then'](function(_0x568455){if(_0x568455){_0xb8a643[_0x1c2f('0x49')]['AccountId']=_0x568455['id'];_0xb8a643[_0x1c2f('0x49')]['Subjects']=integrations[_0x1c2f('0x4f')](_0xb8a643[_0x1c2f('0x49')][_0x1c2f('0x50')],_0xb8a643['body'][_0x1c2f('0x51')]);_0xb8a643[_0x1c2f('0x49')][_0x1c2f('0x52')]=integrations['getDescriptions'](_0xb8a643[_0x1c2f('0x49')][_0x1c2f('0x50')],_0xb8a643[_0x1c2f('0x49')][_0x1c2f('0x51')]);return db[_0x1c2f('0x4d')][_0x1c2f('0x53')](_0xb8a643['body'],{'include':[{'model':db[_0x1c2f('0x54')],'as':_0x1c2f('0x55')},{'model':db[_0x1c2f('0x54')],'as':_0x1c2f('0x52')}]});}return null;})[_0x1c2f('0x27')](respondWithResult(_0x57e021,null))[_0x1c2f('0x48')](handleError(_0x57e021,null));};function getAccessToken(_0x3066ef){return new Promise(function(_0x299f52,_0x561aee){var _0x2f2e85;switch(_0x3066ef[_0x1c2f('0x56')]){case'US':_0x2f2e85=_0x1c2f('0x57');break;case'AU':_0x2f2e85=_0x1c2f('0x58');break;case'EU':_0x2f2e85=_0x1c2f('0x59');break;case'IN':_0x2f2e85=_0x1c2f('0x5a');break;case'CN':_0x2f2e85='https://accounts.zoho.com.cn';break;default:_0x2f2e85=_0x1c2f('0x59');break;}var _0x229180={'method':_0x1c2f('0x5b'),'uri':_0x2f2e85+_0x1c2f('0x5c'),'qs':{'refresh_token':_0x3066ef[_0x1c2f('0x5d')],'client_id':_0x3066ef[_0x1c2f('0x5e')],'client_secret':_0x3066ef['clientSecret'],'grant_type':_0x1c2f('0x5f')},'json':!![]};return rp(_0x229180)[_0x1c2f('0x27')](function(_0x4a820a){if(_0x4a820a[_0x1c2f('0x60')]){_0x299f52(_0x4a820a['access_token']);}else{_0x561aee(_0x1c2f('0x61'));}})[_0x1c2f('0x48')](function(_0x35e908){_0x561aee(_0x35e908);});});}exports[_0x1c2f('0x62')]=function(_0x483888,_0xb46706,_0x237b63){var _0x11fb03,_0x4611e7,_0x5de0cc,_0x18e92,_0x5c2769;return db[_0x1c2f('0x2e')]['findOne']({'where':{'id':_0x483888[_0x1c2f('0x4a')]['id']},'attributes':['id',_0x1c2f('0x63'),_0x1c2f('0x56'),'clientId',_0x1c2f('0x64'),_0x1c2f('0x65'),_0x1c2f('0x66'),_0x1c2f('0x5d')]})['then'](handleEntityNotFound(_0xb46706,null))[_0x1c2f('0x27')](function(_0x46f167){_0x5c2769=_0x46f167;_0x11fb03=_0x5c2769[_0x1c2f('0x63')];_0x4611e7=_0x11fb03===_0x1c2f('0x67')?'eu':'com';_0x5de0cc=_0x5c2769['serverUrl'];var _0x1491f4=_0x5de0cc[_0x1c2f('0x68')](-0x1);if(_0x1491f4==='/'||_0x1491f4==='\x5c'||_0x1491f4===':'){_0x5de0cc=_0x5de0cc[_0x1c2f('0x69')](0x0,_0x5de0cc[_0x1c2f('0x6a')](_0x1491f4));}if(!_0x5c2769[_0x1c2f('0x5d')]){throw new Error(_0x1c2f('0x6b'));}return getAccessToken(_0x5c2769);})[_0x1c2f('0x27')](function(_0x12e933){if(_0x12e933){return rp({'method':_0x1c2f('0x6c'),'uri':util['format'](_0x1c2f('0x6d'),_0x4611e7),'qs':{'module':'Calls'},'headers':{'Authorization':_0x1c2f('0x6e')+_0x12e933},'json':!![]});}})['then'](function(_0x49da68){if(_0x49da68){if(_0x49da68[_0x1c2f('0x6f')]&&_0x49da68[_0x1c2f('0x6f')][_0x1c2f('0x29')]){throw new Error(_0x49da68[_0x1c2f('0x6f')][_0x1c2f('0x29')]['message']);}var _0x13028a=[];var _0x168f71=[];var _0xa85033=[_0x1c2f('0x70'),_0x1c2f('0x71'),'Description',_0x1c2f('0x72'),'Call_Duration','Call_Result',_0x1c2f('0x73'),'Call_Type'];_0x168f71=_[_0x1c2f('0x74')](_0x49da68['fields'],function(_0x43ae73){return _0xa85033[_0x1c2f('0x75')](_0x43ae73[_0x1c2f('0x76')]);});for(var _0x268aa3=0x0;_0x268aa3<_0x168f71[_0x1c2f('0x46')];_0x268aa3++){if(_0x168f71[_0x268aa3][_0x1c2f('0x77')]===![]){_0x13028a['push']({'id':_0x168f71[_0x268aa3]['id'],'name':_0x168f71[_0x268aa3][_0x1c2f('0x78')],'custom':_0x168f71[_0x268aa3][_0x1c2f('0x79')],'options':_0x168f71[_0x268aa3][_0x1c2f('0x7a')]===_0x1c2f('0x7b')&&_0x168f71[_0x268aa3]['pick_list_values'][_0x1c2f('0x46')]>-0x1?_[_0x1c2f('0x2d')](_0x168f71[_0x268aa3]['pick_list_values'],function(_0xdb2643){return{'name':_0xdb2643,'value':_0xdb2643};}):[]});}}return{'count':_0x13028a[_0x1c2f('0x46')],'rows':_0x13028a};}else{return{'count':0x0,'rows':[]};}})[_0x1c2f('0x27')](respondWithResult(_0xb46706,null))[_0x1c2f('0x48')](function(_0x102b14){var _0x4da68c=_0x483888['query'][_0x1c2f('0x7c')]?0x1f4:_0x102b14[_0x1c2f('0x7d')]||0x1f4;logger['error'](_0x1c2f('0x7e'),'getFields',_0x4da68c,JSON[_0x1c2f('0x7f')](_0x102b14));delete _0x102b14[_0x1c2f('0x2a')];if(_0x4da68c===0x191){_0x4da68c=0x190;}_0xb46706[_0x1c2f('0x1b')](_0x4da68c)[_0x1c2f('0x2b')](_0x483888[_0x1c2f('0x32')][_0x1c2f('0x7c')]?{'message':'Wrong\x20credentials','statusCode':_0x102b14[_0x1c2f('0x7d')]}:_0x102b14);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 3d51eb2..6212241 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 _0x8cec=['application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','lastIndexOf','https://accounts.zoho.com','error','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','exports','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','host','substring','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x8cec,0x1f3));var _0xc8ce=function(_0x16a3d3,_0x58a6f7){_0x16a3d3=_0x16a3d3-0x0;var _0x4e83e3=_0x8cec[_0x16a3d3];return _0x4e83e3;};'use strict';var _=require(_0xc8ce('0x0'));var util=require(_0xc8ce('0x1'));var logger=require(_0xc8ce('0x2'))(_0xc8ce('0x3'));var moment=require(_0xc8ce('0x4'));var BPromise=require(_0xc8ce('0x5'));var rp=require(_0xc8ce('0x6'));var fs=require('fs');var path=require(_0xc8ce('0x7'));var rimraf=require(_0xc8ce('0x8'));var config=require(_0xc8ce('0x9'));var attributes=require(_0xc8ce('0xa'));var integrations=require('../../components/integrations/configuration');module[_0xc8ce('0xb')]=function(_0x14d084,_0x4bac6b){return _0x14d084['define'](_0xc8ce('0xc'),attributes,{'tableName':_0xc8ce('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2f25ac,_0x201013,_0xe49d1b){if(_0x2f25ac[_0xc8ce('0xe')](_0xc8ce('0xf'))||_0x2f25ac[_0xc8ce('0xe')](_0xc8ce('0x10'))||_0x2f25ac[_0xc8ce('0xe')](_0xc8ce('0x11'))||_0x2f25ac['changed'](_0xc8ce('0x12'))||_0x2f25ac[_0xc8ce('0xe')](_0xc8ce('0x13'))||_0x2f25ac[_0xc8ce('0xe')](_0xc8ce('0x14'))){var _0x36cd48,_0x30812d;_0x36cd48=_0x2f25ac[_0xc8ce('0x10')];var _0x4034da=_0x36cd48['slice'](-0x1);if(_0x4034da==='/'||_0x4034da==='\x5c'||_0x4034da===':'){_0x36cd48=_0x36cd48[_0xc8ce('0x15')](0x0,_0x36cd48['lastIndexOf'](_0x4034da));}switch(_0x2f25ac[_0xc8ce('0xf')]){case'US':_0x30812d='https://accounts.zoho.com';break;case'AU':_0x30812d=_0xc8ce('0x16');break;case'IN':_0x30812d=_0xc8ce('0x17');break;case'CN':_0x30812d=_0xc8ce('0x18');break;default:_0x30812d=_0xc8ce('0x19');break;}var _0x3ce415={'method':_0xc8ce('0x1a'),'uri':_0x30812d+_0xc8ce('0x1b'),'form':{'grant_type':_0xc8ce('0x1c'),'client_id':_0x2f25ac[_0xc8ce('0x11')],'client_secret':_0x2f25ac[_0xc8ce('0x12')],'redirect_uri':_0x2f25ac['serverUrl'],'code':_0x2f25ac[_0xc8ce('0x13')]},'headers':{'Content-Type':_0xc8ce('0x1d')}};return rp(_0x3ce415)[_0xc8ce('0x1e')](function(_0x3ff73e){var _0x43ad68=JSON[_0xc8ce('0x1f')](_0x3ff73e);if(_0x43ad68[_0xc8ce('0x20')]){_0x2f25ac[_0xc8ce('0x21')]=_0x43ad68['refresh_token'];logger[_0xc8ce('0x22')](util[_0xc8ce('0x23')](_0xc8ce('0x24'),_0x2f25ac['name'],_0x2f25ac['id']));}else{logger['error'](util['format'](_0xc8ce('0x25'),_0x2f25ac[_0xc8ce('0x26')],_0x2f25ac['id']),util[_0xc8ce('0x27')](_0x43ad68,{'showHidden':![],'depth':null}));}return _0xe49d1b(null,_0x201013);})[_0xc8ce('0x28')](function(_0x1d028b){logger['error'](util['format'](_0xc8ce('0x25'),_0x2f25ac['name'],_0x2f25ac['id']),util[_0xc8ce('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0xe49d1b(_0x1d028b);});}else{return _0xe49d1b(null,_0x201013);}},'beforeUpdate':function(_0x5cee12,_0x58271a,_0x40a6fd){if(_0x5cee12[_0xc8ce('0xe')](_0xc8ce('0xf'))||_0x5cee12[_0xc8ce('0xe')](_0xc8ce('0x10'))||_0x5cee12[_0xc8ce('0xe')](_0xc8ce('0x11'))||_0x5cee12[_0xc8ce('0xe')](_0xc8ce('0x12'))||_0x5cee12[_0xc8ce('0xe')](_0xc8ce('0x13'))||_0x5cee12['changed']('host')){var _0x2706cd,_0x46ca7e;_0x2706cd=_0x5cee12['serverUrl'];var _0x2284cd=_0x2706cd['slice'](-0x1);if(_0x2284cd==='/'||_0x2284cd==='\x5c'||_0x2284cd===':'){_0x2706cd=_0x2706cd['substring'](0x0,_0x2706cd[_0xc8ce('0x29')](_0x2284cd));}switch(_0x5cee12['zone']){case'US':_0x46ca7e=_0xc8ce('0x2a');break;case'AU':_0x46ca7e='https://accounts.zoho.com.au';break;case'IN':_0x46ca7e=_0xc8ce('0x17');break;case'CN':_0x46ca7e=_0xc8ce('0x18');break;default:_0x46ca7e=_0xc8ce('0x19');break;}var _0x364e66={'method':_0xc8ce('0x1a'),'uri':_0x46ca7e+'/oauth/v2/token','form':{'grant_type':_0xc8ce('0x1c'),'client_id':_0x5cee12[_0xc8ce('0x11')],'client_secret':_0x5cee12[_0xc8ce('0x12')],'redirect_uri':_0x5cee12[_0xc8ce('0x10')],'code':_0x5cee12[_0xc8ce('0x13')]},'headers':{'Content-Type':_0xc8ce('0x1d')}};return rp(_0x364e66)[_0xc8ce('0x1e')](function(_0x3af44d){var _0x34a9e6=JSON[_0xc8ce('0x1f')](_0x3af44d);if(_0x34a9e6['refresh_token']){_0x5cee12[_0xc8ce('0x21')]=_0x34a9e6[_0xc8ce('0x20')];logger[_0xc8ce('0x22')](util['format'](_0xc8ce('0x24'),_0x5cee12['name'],_0x5cee12['id']));}else{logger[_0xc8ce('0x2b')](util[_0xc8ce('0x23')](_0xc8ce('0x25'),_0x5cee12['name'],_0x5cee12['id']),util[_0xc8ce('0x27')](_0x34a9e6,{'showHidden':![],'depth':null}));}return _0x40a6fd(null,_0x58271a);})['catch'](function(_0x20d8f7){logger[_0xc8ce('0x2b')](util['format']('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5cee12[_0xc8ce('0x26')],_0x5cee12['id']),util[_0xc8ce('0x27')](parsedResult,{'showHidden':![],'depth':null}));return _0x40a6fd(_0x20d8f7);});}else{return _0x40a6fd(null,_0x58271a);}}}});}; \ No newline at end of file +var _0x5085=['bluebird','path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','changed','serverUrl','clientId','clientSecret','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','code','application/x-www-form-urlencoded','then','parse','refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','error','https://accounts.zoho.com.cn','util','../../config/logger','api','moment'];(function(_0x2f0811,_0x589ce){var _0x18ff83=function(_0x4c269a){while(--_0x4c269a){_0x2f0811['push'](_0x2f0811['shift']());}};_0x18ff83(++_0x589ce);}(_0x5085,0x164));var _0x5508=function(_0x8f541c,_0x5eae07){_0x8f541c=_0x8f541c-0x0;var _0xd37cf5=_0x5085[_0x8f541c];return _0xd37cf5;};'use strict';var _=require('lodash');var util=require(_0x5508('0x0'));var logger=require(_0x5508('0x1'))(_0x5508('0x2'));var moment=require(_0x5508('0x3'));var BPromise=require(_0x5508('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5508('0x5'));var rimraf=require(_0x5508('0x6'));var config=require('../../config/environment');var attributes=require(_0x5508('0x7'));var integrations=require(_0x5508('0x8'));module[_0x5508('0x9')]=function(_0x20fb9c,_0x18979d){return _0x20fb9c[_0x5508('0xa')]('ZohoAccount',attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2117ef,_0x43b980,_0x41503f){if(_0x2117ef['changed']('zone')||_0x2117ef[_0x5508('0xb')](_0x5508('0xc'))||_0x2117ef[_0x5508('0xb')](_0x5508('0xd'))||_0x2117ef[_0x5508('0xb')](_0x5508('0xe'))||_0x2117ef[_0x5508('0xb')]('code')||_0x2117ef['changed'](_0x5508('0xf'))){var _0x498f84,_0x39a968;_0x498f84=_0x2117ef[_0x5508('0xc')];var _0x3846d2=_0x498f84[_0x5508('0x10')](-0x1);if(_0x3846d2==='/'||_0x3846d2==='\x5c'||_0x3846d2===':'){_0x498f84=_0x498f84[_0x5508('0x11')](0x0,_0x498f84[_0x5508('0x12')](_0x3846d2));}switch(_0x2117ef['zone']){case'US':_0x39a968=_0x5508('0x13');break;case'AU':_0x39a968=_0x5508('0x14');break;case'IN':_0x39a968=_0x5508('0x15');break;case'CN':_0x39a968='https://accounts.zoho.com.cn';break;default:_0x39a968=_0x5508('0x16');break;}var _0x37f91b={'method':_0x5508('0x17'),'uri':_0x39a968+_0x5508('0x18'),'form':{'grant_type':_0x5508('0x19'),'client_id':_0x2117ef[_0x5508('0xd')],'client_secret':_0x2117ef[_0x5508('0xe')],'redirect_uri':_0x2117ef[_0x5508('0xc')],'code':_0x2117ef[_0x5508('0x1a')]},'headers':{'Content-Type':_0x5508('0x1b')}};return rp(_0x37f91b)[_0x5508('0x1c')](function(_0x2cf6a3){var _0x380891=JSON[_0x5508('0x1d')](_0x2cf6a3);if(_0x380891[_0x5508('0x1e')]){_0x2117ef['refreshToken']=_0x380891[_0x5508('0x1e')];logger[_0x5508('0x1f')](util[_0x5508('0x20')](_0x5508('0x21'),_0x2117ef['name'],_0x2117ef['id']));}else{logger['error'](util[_0x5508('0x20')](_0x5508('0x22'),_0x2117ef[_0x5508('0x23')],_0x2117ef['id']),util[_0x5508('0x24')](_0x380891,{'showHidden':![],'depth':null}));}return _0x41503f(null,_0x43b980);})[_0x5508('0x25')](function(_0x280e6c){logger[_0x5508('0x26')](util[_0x5508('0x20')](_0x5508('0x22'),_0x2117ef[_0x5508('0x23')],_0x2117ef['id']),util[_0x5508('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x41503f(_0x280e6c);});}else{return _0x41503f(null,_0x43b980);}},'beforeUpdate':function(_0x54fb95,_0x1e720b,_0x532b28){if(_0x54fb95[_0x5508('0xb')]('zone')||_0x54fb95['changed']('serverUrl')||_0x54fb95[_0x5508('0xb')](_0x5508('0xd'))||_0x54fb95['changed'](_0x5508('0xe'))||_0x54fb95[_0x5508('0xb')](_0x5508('0x1a'))||_0x54fb95[_0x5508('0xb')](_0x5508('0xf'))){var _0x22e69a,_0x369c82;_0x22e69a=_0x54fb95[_0x5508('0xc')];var _0x3c521d=_0x22e69a['slice'](-0x1);if(_0x3c521d==='/'||_0x3c521d==='\x5c'||_0x3c521d===':'){_0x22e69a=_0x22e69a[_0x5508('0x11')](0x0,_0x22e69a[_0x5508('0x12')](_0x3c521d));}switch(_0x54fb95['zone']){case'US':_0x369c82='https://accounts.zoho.com';break;case'AU':_0x369c82=_0x5508('0x14');break;case'IN':_0x369c82=_0x5508('0x15');break;case'CN':_0x369c82=_0x5508('0x27');break;default:_0x369c82='https://accounts.zoho.eu';break;}var _0x4c3273={'method':_0x5508('0x17'),'uri':_0x369c82+_0x5508('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x54fb95[_0x5508('0xd')],'client_secret':_0x54fb95[_0x5508('0xe')],'redirect_uri':_0x54fb95[_0x5508('0xc')],'code':_0x54fb95[_0x5508('0x1a')]},'headers':{'Content-Type':_0x5508('0x1b')}};return rp(_0x4c3273)[_0x5508('0x1c')](function(_0x278058){var _0x2da95b=JSON['parse'](_0x278058);if(_0x2da95b[_0x5508('0x1e')]){_0x54fb95['refreshToken']=_0x2da95b[_0x5508('0x1e')];logger['info'](util[_0x5508('0x20')](_0x5508('0x21'),_0x54fb95[_0x5508('0x23')],_0x54fb95['id']));}else{logger[_0x5508('0x26')](util[_0x5508('0x20')](_0x5508('0x22'),_0x54fb95[_0x5508('0x23')],_0x54fb95['id']),util[_0x5508('0x24')](_0x2da95b,{'showHidden':![],'depth':null}));}return _0x532b28(null,_0x1e720b);})[_0x5508('0x25')](function(_0x20689a){logger['error'](util[_0x5508('0x20')](_0x5508('0x22'),_0x54fb95['name'],_0x54fb95['id']),util[_0x5508('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x532b28(_0x20689a);});}else{return _0x532b28(null,_0x1e720b);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 423c252..8977409 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 _0xce04=['options','raw','where','attributes','limit','include','map','model','stringify','catch','ZohoAccount','ShowZohoAccount','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','http','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','code','error','message','GetZohoAccount','findAll'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xce04,0xc0));var _0x4ce0=function(_0x1ffb85,_0x2c8450){_0x1ffb85=_0x1ffb85-0x0;var _0x313616=_0xce04[_0x1ffb85];return _0x313616;};'use strict';var _=require(_0x4ce0('0x0'));var util=require('util');var moment=require(_0x4ce0('0x1'));var BPromise=require(_0x4ce0('0x2'));var rs=require(_0x4ce0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4ce0('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x4ce0('0x5'));var jayson=require(_0x4ce0('0x6'));var client=jayson['client'][_0x4ce0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x462871,_0x5377ab,_0x3a0dca){return new BPromise(function(_0x3b7238,_0x709a46){return client['request'](_0x462871,_0x3a0dca)[_0x4ce0('0x8')](function(_0x29c627){logger[_0x4ce0('0x9')](_0x4ce0('0xa'),_0x5377ab,_0x4ce0('0xb'));logger[_0x4ce0('0xc')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x5377ab,_0x4ce0('0xb'),JSON['stringify'](_0x29c627));if(_0x29c627['error']){if(_0x29c627['error'][_0x4ce0('0xd')]===0x1f4){logger[_0x4ce0('0xe')](_0x4ce0('0xa'),_0x5377ab,_0x29c627['error'][_0x4ce0('0xf')]);return _0x709a46(_0x29c627[_0x4ce0('0xe')]['message']);}logger[_0x4ce0('0xe')]('ZohoAccount,\x20%s,\x20%s',_0x5377ab,_0x29c627[_0x4ce0('0xe')][_0x4ce0('0xf')]);return _0x3b7238(_0x29c627[_0x4ce0('0xe')]['message']);}else{logger[_0x4ce0('0x9')](_0x4ce0('0xa'),_0x5377ab,_0x4ce0('0xb'));_0x3b7238(_0x29c627['result'][_0x4ce0('0xf')]);}})['catch'](function(_0x4d1fd2){logger[_0x4ce0('0xe')](_0x4ce0('0xa'),_0x5377ab,_0x4d1fd2);_0x709a46(_0x4d1fd2);});});}exports[_0x4ce0('0x10')]=function(_0x38917c){var _0x328ec2=this;return new Promise(function(_0x368ccb,_0x1e3135){return db['ZohoAccount'][_0x4ce0('0x11')]({'raw':_0x38917c[_0x4ce0('0x12')]?_0x38917c['options'][_0x4ce0('0x13')]===undefined?!![]:![]:!![],'where':_0x38917c['options']?_0x38917c[_0x4ce0('0x12')][_0x4ce0('0x14')]||null:null,'attributes':_0x38917c['options']?_0x38917c[_0x4ce0('0x12')][_0x4ce0('0x15')]||null:null,'limit':_0x38917c[_0x4ce0('0x12')]?_0x38917c[_0x4ce0('0x12')][_0x4ce0('0x16')]||null:null,'include':_0x38917c[_0x4ce0('0x12')]?_0x38917c[_0x4ce0('0x12')][_0x4ce0('0x17')]?_[_0x4ce0('0x18')](_0x38917c[_0x4ce0('0x12')][_0x4ce0('0x17')],function(_0x27024e){return{'model':db[_0x27024e[_0x4ce0('0x19')]],'as':_0x27024e['as'],'attributes':_0x27024e[_0x4ce0('0x15')],'include':_0x27024e[_0x4ce0('0x17')]?_['map'](_0x27024e[_0x4ce0('0x17')],function(_0x318a7a){return{'model':db[_0x318a7a['model']],'as':_0x318a7a['as'],'attributes':_0x318a7a[_0x4ce0('0x15')],'include':_0x318a7a[_0x4ce0('0x17')]?_[_0x4ce0('0x18')](_0x318a7a[_0x4ce0('0x17')],function(_0x1f3b9d){return{'model':db[_0x1f3b9d[_0x4ce0('0x19')]],'as':_0x1f3b9d['as'],'attributes':_0x1f3b9d[_0x4ce0('0x15')]};}):[]};}):[]};}):[]:[]})[_0x4ce0('0x8')](function(_0x2e0dae){logger[_0x4ce0('0x9')]('GetZohoAccount',_0x38917c);logger[_0x4ce0('0xc')](_0x4ce0('0x10'),_0x38917c,JSON[_0x4ce0('0x1a')](_0x2e0dae));_0x368ccb(_0x2e0dae);})[_0x4ce0('0x1b')](function(_0x59e8df){logger['error'](_0x4ce0('0x10'),_0x59e8df[_0x4ce0('0xf')],_0x38917c);_0x1e3135(_0x328ec2['error'](0x1f4,_0x59e8df[_0x4ce0('0xf')]));});});};exports['ShowZohoAccount']=function(_0x36644e){var _0x1b4b0c=this;return new Promise(function(_0x33b284,_0x220032){return db[_0x4ce0('0x1c')]['find']({'raw':_0x36644e[_0x4ce0('0x12')]?_0x36644e[_0x4ce0('0x12')][_0x4ce0('0x13')]===undefined?!![]:![]:!![],'where':_0x36644e[_0x4ce0('0x12')]?_0x36644e[_0x4ce0('0x12')][_0x4ce0('0x14')]||null:null,'attributes':_0x36644e[_0x4ce0('0x12')]?_0x36644e[_0x4ce0('0x12')]['attributes']||null:null,'include':_0x36644e[_0x4ce0('0x12')]?_0x36644e[_0x4ce0('0x12')][_0x4ce0('0x17')]?_[_0x4ce0('0x18')](_0x36644e['options'][_0x4ce0('0x17')],function(_0x430ac1){return{'model':db[_0x430ac1['model']],'as':_0x430ac1['as'],'attributes':_0x430ac1[_0x4ce0('0x15')],'include':_0x430ac1['include']?_[_0x4ce0('0x18')](_0x430ac1[_0x4ce0('0x17')],function(_0x588327){return{'model':db[_0x588327[_0x4ce0('0x19')]],'as':_0x588327['as'],'attributes':_0x588327[_0x4ce0('0x15')],'include':_0x588327['include']?_['map'](_0x588327['include'],function(_0x110b2e){return{'model':db[_0x110b2e[_0x4ce0('0x19')]],'as':_0x110b2e['as'],'attributes':_0x110b2e[_0x4ce0('0x15')]};}):[]};}):[]};}):[]:[]})[_0x4ce0('0x8')](function(_0x58dee6){logger[_0x4ce0('0x9')](_0x4ce0('0x1d'),_0x36644e);logger[_0x4ce0('0xc')](_0x4ce0('0x1d'),_0x36644e,JSON['stringify'](_0x58dee6));_0x33b284(_0x58dee6);})[_0x4ce0('0x1b')](function(_0x58b11f){logger[_0x4ce0('0xe')](_0x4ce0('0x1d'),_0x58b11f['message'],_0x36644e);_0x220032(_0x1b4b0c['error'](0x1f4,_0x58b11f[_0x4ce0('0xf')]));});});}; \ No newline at end of file +var _0x6da9=['find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','findAll','options','raw','where','attributes','include','model','map','then','GetZohoAccount','debug','ShowZohoAccount','ZohoAccount'];(function(_0x280de6,_0x278a85){var _0x9debd5=function(_0x60b632){while(--_0x60b632){_0x280de6['push'](_0x280de6['shift']());}};_0x9debd5(++_0x278a85);}(_0x6da9,0x161));var _0x96da=function(_0x8dbb3d,_0x844338){_0x8dbb3d=_0x8dbb3d-0x0;var _0x117d4e=_0x6da9[_0x8dbb3d];return _0x117d4e;};'use strict';var _=require(_0x96da('0x0'));var util=require(_0x96da('0x1'));var moment=require(_0x96da('0x2'));var BPromise=require(_0x96da('0x3'));var rs=require(_0x96da('0x4'));var fs=require('fs');var Redis=require(_0x96da('0x5'));var db=require(_0x96da('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x96da('0x7'));var jayson=require(_0x96da('0x8'));var client=jayson[_0x96da('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bc4b0,_0x5d7737,_0x161249){return new BPromise(function(_0x45ee2f,_0x3b0883){return client['request'](_0x1bc4b0,_0x161249)['then'](function(_0x4ed0c1){logger[_0x96da('0xa')](_0x96da('0xb'),_0x5d7737,_0x96da('0xc'));logger['debug'](_0x96da('0xd'),_0x5d7737,_0x96da('0xc'),JSON['stringify'](_0x4ed0c1));if(_0x4ed0c1[_0x96da('0xe')]){if(_0x4ed0c1[_0x96da('0xe')][_0x96da('0xf')]===0x1f4){logger[_0x96da('0xe')](_0x96da('0xb'),_0x5d7737,_0x4ed0c1[_0x96da('0xe')][_0x96da('0x10')]);return _0x3b0883(_0x4ed0c1[_0x96da('0xe')][_0x96da('0x10')]);}logger['error'](_0x96da('0xb'),_0x5d7737,_0x4ed0c1[_0x96da('0xe')]['message']);return _0x45ee2f(_0x4ed0c1['error'][_0x96da('0x10')]);}else{logger[_0x96da('0xa')]('ZohoAccount,\x20%s,\x20%s',_0x5d7737,_0x96da('0xc'));_0x45ee2f(_0x4ed0c1['result'][_0x96da('0x10')]);}})[_0x96da('0x11')](function(_0x2d6d15){logger[_0x96da('0xe')](_0x96da('0xb'),_0x5d7737,_0x2d6d15);_0x3b0883(_0x2d6d15);});});}exports['GetZohoAccount']=function(_0x2bfd0c){var _0xd1fef8=this;return new Promise(function(_0x7ac4a5,_0x30834c){return db['ZohoAccount'][_0x96da('0x12')]({'raw':_0x2bfd0c['options']?_0x2bfd0c[_0x96da('0x13')][_0x96da('0x14')]===undefined?!![]:![]:!![],'where':_0x2bfd0c[_0x96da('0x13')]?_0x2bfd0c['options'][_0x96da('0x15')]||null:null,'attributes':_0x2bfd0c[_0x96da('0x13')]?_0x2bfd0c[_0x96da('0x13')][_0x96da('0x16')]||null:null,'limit':_0x2bfd0c[_0x96da('0x13')]?_0x2bfd0c[_0x96da('0x13')]['limit']||null:null,'include':_0x2bfd0c[_0x96da('0x13')]?_0x2bfd0c[_0x96da('0x13')][_0x96da('0x17')]?_['map'](_0x2bfd0c[_0x96da('0x13')][_0x96da('0x17')],function(_0x4a9232){return{'model':db[_0x4a9232[_0x96da('0x18')]],'as':_0x4a9232['as'],'attributes':_0x4a9232['attributes'],'include':_0x4a9232[_0x96da('0x17')]?_[_0x96da('0x19')](_0x4a9232[_0x96da('0x17')],function(_0x1b29ae){return{'model':db[_0x1b29ae[_0x96da('0x18')]],'as':_0x1b29ae['as'],'attributes':_0x1b29ae[_0x96da('0x16')],'include':_0x1b29ae[_0x96da('0x17')]?_[_0x96da('0x19')](_0x1b29ae[_0x96da('0x17')],function(_0x2d197f){return{'model':db[_0x2d197f['model']],'as':_0x2d197f['as'],'attributes':_0x2d197f[_0x96da('0x16')]};}):[]};}):[]};}):[]:[]})[_0x96da('0x1a')](function(_0x2e7a34){logger[_0x96da('0xa')](_0x96da('0x1b'),_0x2bfd0c);logger[_0x96da('0x1c')](_0x96da('0x1b'),_0x2bfd0c,JSON['stringify'](_0x2e7a34));_0x7ac4a5(_0x2e7a34);})[_0x96da('0x11')](function(_0x4241ba){logger[_0x96da('0xe')]('GetZohoAccount',_0x4241ba['message'],_0x2bfd0c);_0x30834c(_0xd1fef8['error'](0x1f4,_0x4241ba['message']));});});};exports[_0x96da('0x1d')]=function(_0x480169){var _0x31110d=this;return new Promise(function(_0x156469,_0x2ddc62){return db[_0x96da('0x1e')][_0x96da('0x1f')]({'raw':_0x480169[_0x96da('0x13')]?_0x480169[_0x96da('0x13')][_0x96da('0x14')]===undefined?!![]:![]:!![],'where':_0x480169[_0x96da('0x13')]?_0x480169['options']['where']||null:null,'attributes':_0x480169[_0x96da('0x13')]?_0x480169[_0x96da('0x13')]['attributes']||null:null,'include':_0x480169[_0x96da('0x13')]?_0x480169[_0x96da('0x13')][_0x96da('0x17')]?_[_0x96da('0x19')](_0x480169[_0x96da('0x13')][_0x96da('0x17')],function(_0x3a6f6a){return{'model':db[_0x3a6f6a[_0x96da('0x18')]],'as':_0x3a6f6a['as'],'attributes':_0x3a6f6a[_0x96da('0x16')],'include':_0x3a6f6a['include']?_[_0x96da('0x19')](_0x3a6f6a['include'],function(_0x4daf81){return{'model':db[_0x4daf81[_0x96da('0x18')]],'as':_0x4daf81['as'],'attributes':_0x4daf81[_0x96da('0x16')],'include':_0x4daf81[_0x96da('0x17')]?_[_0x96da('0x19')](_0x4daf81[_0x96da('0x17')],function(_0x1147e4){return{'model':db[_0x1147e4[_0x96da('0x18')]],'as':_0x1147e4['as'],'attributes':_0x1147e4[_0x96da('0x16')]};}):[]};}):[]};}):[]:[]})[_0x96da('0x1a')](function(_0x35db80){logger[_0x96da('0xa')]('ShowZohoAccount',_0x480169);logger[_0x96da('0x1c')](_0x96da('0x1d'),_0x480169,JSON['stringify'](_0x35db80));_0x156469(_0x35db80);})['catch'](function(_0x41e123){logger[_0x96da('0xe')](_0x96da('0x1d'),_0x41e123[_0x96da('0x10')],_0x480169);_0x2ddc62(_0x31110d[_0x96da('0xe')](0x1f4,_0x41e123['message']));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 503b79f..5f59eab 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 _0xd769=['/:id/descriptions','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x5a8c71,_0x2f8398){var _0x1ca071=function(_0x3128fc){while(--_0x3128fc){_0x5a8c71['push'](_0x5a8c71['shift']());}};_0x1ca071(++_0x2f8398);}(_0xd769,0x14d));var _0x9d76=function(_0x262a0b,_0x20d859){_0x262a0b=_0x262a0b-0x0;var _0x15f521=_0xd769[_0x262a0b];return _0x15f521;};'use strict';var multer=require(_0x9d76('0x0'));var util=require(_0x9d76('0x1'));var path=require('path');var timeout=require(_0x9d76('0x2'));var express=require(_0x9d76('0x3'));var router=express[_0x9d76('0x4')]();var fs_extra=require(_0x9d76('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9d76('0x6'));var config=require('../../config/environment');var controller=require(_0x9d76('0x7'));router[_0x9d76('0x8')]('/',auth[_0x9d76('0x9')](),controller[_0x9d76('0xa')]);router['get'](_0x9d76('0xb'),auth['isAuthenticated'](),controller[_0x9d76('0xc')]);router[_0x9d76('0x8')](_0x9d76('0xd'),auth[_0x9d76('0x9')](),controller[_0x9d76('0xe')]);router[_0x9d76('0x8')](_0x9d76('0xf'),auth[_0x9d76('0x9')](),controller[_0x9d76('0x10')]);router[_0x9d76('0x8')](_0x9d76('0x11'),auth[_0x9d76('0x9')](),controller['getDescriptions']);router[_0x9d76('0x12')]('/',auth[_0x9d76('0x9')](),controller[_0x9d76('0x13')]);router[_0x9d76('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x9d76('0x15')]);router[_0x9d76('0x16')](_0x9d76('0xb'),auth[_0x9d76('0x9')](),controller[_0x9d76('0x17')]);module[_0x9d76('0x18')]=router; \ No newline at end of file +var _0xc741=['exports','util','path','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy'];(function(_0x46aac,_0x2374ee){var _0x3cbc73=function(_0x2b9080){while(--_0x2b9080){_0x46aac['push'](_0x46aac['shift']());}};_0x3cbc73(++_0x2374ee);}(_0xc741,0x135));var _0x1c74=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xc741[_0x2d2c16];return _0x53f2fb;};'use strict';var multer=require('multer');var util=require(_0x1c74('0x0'));var path=require(_0x1c74('0x1'));var timeout=require('connect-timeout');var express=require(_0x1c74('0x2'));var router=express[_0x1c74('0x3')]();var fs_extra=require(_0x1c74('0x4'));var auth=require(_0x1c74('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intZohoConfiguration.controller');router[_0x1c74('0x6')]('/',auth[_0x1c74('0x7')](),controller[_0x1c74('0x8')]);router[_0x1c74('0x6')](_0x1c74('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x1c74('0x6')](_0x1c74('0xa'),auth[_0x1c74('0x7')](),controller[_0x1c74('0xb')]);router[_0x1c74('0x6')](_0x1c74('0xc'),auth[_0x1c74('0x7')](),controller[_0x1c74('0xd')]);router[_0x1c74('0x6')](_0x1c74('0xe'),auth[_0x1c74('0x7')](),controller[_0x1c74('0xf')]);router[_0x1c74('0x10')]('/',auth['isAuthenticated'](),controller[_0x1c74('0x11')]);router[_0x1c74('0x12')]('/:id',auth[_0x1c74('0x7')](),controller[_0x1c74('0x13')]);router['delete'](_0x1c74('0x9'),auth['isAuthenticated'](),controller[_0x1c74('0x14')]);module[_0x1c74('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 9fccbcd..2afa957 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 _0x40b9=['ENUM','contact_lead','contact','STRING','lead','nothing'];(function(_0x49b193,_0x2abf8b){var _0x20691b=function(_0xe77e39){while(--_0xe77e39){_0x49b193['push'](_0x49b193['shift']());}};_0x20691b(++_0x2abf8b);}(_0x40b9,0x1de));var _0x940b=function(_0x17dcd5,_0x5c5b24){_0x17dcd5=_0x17dcd5-0x0;var _0x214160=_0x40b9[_0x17dcd5];return _0x214160;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize['ENUM'](_0x940b('0x0'),'contact',_0x940b('0x1')),'defaultValue':_0x940b('0x0')},'moduleSearch':{'type':Sequelize[_0x940b('0x2')](_0x940b('0x3'),_0x940b('0x4'),_0x940b('0x0')),'defaultValue':_0x940b('0x3')},'description':{'type':Sequelize[_0x940b('0x5')]}}; \ No newline at end of file +var _0x4685=['contact_lead','contact','sequelize','exports','STRING','ENUM','lead','nothing'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4685,0x6a));var _0x5468=function(_0xa352f,_0x33c458){_0xa352f=_0xa352f-0x0;var _0x2945c8=_0x4685[_0xa352f];return _0x2945c8;};'use strict';var Sequelize=require(_0x5468('0x0'));module[_0x5468('0x1')]={'name':{'type':Sequelize[_0x5468('0x2')]},'moduleCreate':{'type':Sequelize[_0x5468('0x3')](_0x5468('0x4'),'contact',_0x5468('0x5')),'defaultValue':_0x5468('0x4')},'moduleSearch':{'type':Sequelize['ENUM'](_0x5468('0x6'),_0x5468('0x7'),'lead'),'defaultValue':_0x5468('0x6')},'description':{'type':Sequelize[_0x5468('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 31f3de9..66199db 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 _0x1cc0=['fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','send','index','type','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','ZohoConfiguration','findAll','rows','show','params','rawAttributes','catch','create','body','update','find','getFields','findOne','ZohoField','getSubjects','getDescriptions','eml-format','zip-dir'];(function(_0x4e2cd7,_0x371fc4){var _0xc65f02=function(_0x2f55b2){while(--_0x2f55b2){_0x4e2cd7['push'](_0x4e2cd7['shift']());}};_0xc65f02(++_0x371fc4);}(_0x1cc0,0x19d));var _0x01cc=function(_0xd48152,_0x15de72){_0xd48152=_0xd48152-0x0;var _0x3145b9=_0x1cc0[_0xd48152];return _0x3145b9;};'use strict';var emlformat=require(_0x01cc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x01cc('0x1'));var jsonpatch=require(_0x01cc('0x2'));var rp=require(_0x01cc('0x3'));var moment=require(_0x01cc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x01cc('0x5'));var util=require(_0x01cc('0x6'));var path=require(_0x01cc('0x7'));var sox=require('sox');var csv=require(_0x01cc('0x8'));var ejs=require(_0x01cc('0x9'));var fs=require('fs');var fs_extra=require(_0x01cc('0xa'));var _=require(_0x01cc('0xb'));var squel=require(_0x01cc('0xc'));var crypto=require('crypto');var jsforce=require(_0x01cc('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x01cc('0xe'));var Papa=require(_0x01cc('0xf'));var Redis=require(_0x01cc('0x10'));var authService=require(_0x01cc('0x11'));var qs=require(_0x01cc('0x12'));var as=require(_0x01cc('0x13'));var hardwareService=require(_0x01cc('0x14'));var logger=require(_0x01cc('0x15'))(_0x01cc('0x16'));var utils=require(_0x01cc('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x01cc('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x279f67,_0x39926b){_0x39926b=_0x39926b||0xcc;return function(_0x93e772){if(_0x93e772){return _0x279f67[_0x01cc('0x19')](_0x39926b);}return _0x279f67[_0x01cc('0x1a')](_0x39926b)[_0x01cc('0x1b')]();};}function respondWithResult(_0x1fd5b9,_0x5a28a0){_0x5a28a0=_0x5a28a0||0xc8;return function(_0x569153){if(_0x569153){return _0x1fd5b9['status'](_0x5a28a0)['json'](_0x569153);}};}function respondWithFilteredResult(_0x14f60b,_0x3e5ca1){return function(_0x1e0937){if(_0x1e0937){var _0x3a0e73=typeof _0x3e5ca1[_0x01cc('0x1c')]===_0x01cc('0x1d')&&typeof _0x3e5ca1[_0x01cc('0x1e')]==='undefined';var _0x47f3e0=_0x1e0937[_0x01cc('0x1f')];var _0x4a8c4b=_0x3a0e73?0x0:_0x3e5ca1[_0x01cc('0x1c')];var _0x5e209a=_0x3a0e73?_0x1e0937[_0x01cc('0x1f')]:_0x3e5ca1[_0x01cc('0x1c')]+_0x3e5ca1['limit'];var _0x224873;if(_0x5e209a>=_0x47f3e0){_0x5e209a=_0x47f3e0;_0x224873=0xc8;}else{_0x224873=0xce;}_0x14f60b[_0x01cc('0x1a')](_0x224873);return _0x14f60b[_0x01cc('0x20')](_0x01cc('0x21'),_0x4a8c4b+'-'+_0x5e209a+'/'+_0x47f3e0)[_0x01cc('0x22')](_0x1e0937);}return null;};}function patchUpdates(_0x5d4917){return function(_0x2d84c3){try{jsonpatch[_0x01cc('0x23')](_0x2d84c3,_0x5d4917,!![]);}catch(_0x5031a4){return BPromise[_0x01cc('0x24')](_0x5031a4);}return _0x2d84c3[_0x01cc('0x25')]();};}function saveUpdates(_0x28d770,_0x12dc5f){return function(_0x47b9e9){if(_0x47b9e9){return _0x47b9e9['update'](_0x28d770)[_0x01cc('0x26')](function(_0x56f1d5){return _0x56f1d5;});}return null;};}function removeEntity(_0x2d4f0a,_0x379587){return function(_0x25136d){if(_0x25136d){return _0x25136d[_0x01cc('0x27')]()[_0x01cc('0x26')](function(){_0x2d4f0a[_0x01cc('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x254092,_0x24ad95){return function(_0x2b2654){if(!_0x2b2654){_0x254092[_0x01cc('0x19')](0x194);}return _0x2b2654;};}function handleError(_0x5f30b6,_0x5eea8b){_0x5eea8b=_0x5eea8b||0x1f4;return function(_0xf9c4f3){logger[_0x01cc('0x28')](_0xf9c4f3[_0x01cc('0x29')]);if(_0xf9c4f3[_0x01cc('0x2a')]){delete _0xf9c4f3[_0x01cc('0x2a')];}_0x5f30b6[_0x01cc('0x1a')](_0x5eea8b)[_0x01cc('0x2b')](_0xf9c4f3);};}exports[_0x01cc('0x2c')]=function(_0xbcfb46,_0x456d38){var _0x9f3d75={},_0x5ba5de={},_0x378c5d={'count':0x0,'rows':[]};var _0x5b1403=_['map'](db['ZohoConfiguration']['rawAttributes'],function(_0x2671ae){return{'name':_0x2671ae['fieldName'],'type':_0x2671ae[_0x01cc('0x2d')]['key']};});_0x5ba5de[_0x01cc('0x2e')]=_[_0x01cc('0x2f')](_0x5b1403,_0x01cc('0x2a'));_0x5ba5de[_0x01cc('0x30')]=_[_0x01cc('0x31')](_0xbcfb46[_0x01cc('0x30')]);_0x5ba5de['filters']=_[_0x01cc('0x32')](_0x5ba5de[_0x01cc('0x2e')],_0x5ba5de['query']);_0x9f3d75['attributes']=_[_0x01cc('0x32')](_0x5ba5de['model'],qs[_0x01cc('0x33')](_0xbcfb46[_0x01cc('0x30')][_0x01cc('0x33')]));_0x9f3d75[_0x01cc('0x34')]=_0x9f3d75[_0x01cc('0x34')][_0x01cc('0x35')]?_0x9f3d75[_0x01cc('0x34')]:_0x5ba5de[_0x01cc('0x2e')];if(!_0xbcfb46[_0x01cc('0x30')][_0x01cc('0x36')](_0x01cc('0x37'))){_0x9f3d75[_0x01cc('0x1e')]=qs[_0x01cc('0x1e')](_0xbcfb46[_0x01cc('0x30')][_0x01cc('0x1e')]);_0x9f3d75[_0x01cc('0x1c')]=qs['offset'](_0xbcfb46[_0x01cc('0x30')]['offset']);}_0x9f3d75[_0x01cc('0x38')]=qs[_0x01cc('0x39')](_0xbcfb46[_0x01cc('0x30')][_0x01cc('0x39')]);_0x9f3d75[_0x01cc('0x3a')]=qs[_0x01cc('0x3b')](_[_0x01cc('0x3c')](_0xbcfb46[_0x01cc('0x30')],_0x5ba5de['filters']),_0x5b1403);if(_0xbcfb46['query'][_0x01cc('0x3d')]){_0x9f3d75['where']=_['merge'](_0x9f3d75[_0x01cc('0x3a')],{'$or':_[_0x01cc('0x2f')](_0x5b1403,function(_0x1972f2){if(_0x1972f2[_0x01cc('0x2d')]!==_0x01cc('0x3e')){var _0x2f8bab={};_0x2f8bab[_0x1972f2[_0x01cc('0x2a')]]={'$like':'%'+_0xbcfb46[_0x01cc('0x30')][_0x01cc('0x3d')]+'%'};return _0x2f8bab;}})});}_0x9f3d75=_[_0x01cc('0x3f')]({},_0x9f3d75,_0xbcfb46[_0x01cc('0x40')]);var _0x5c3518={'where':_0x9f3d75['where']};return db['ZohoConfiguration'][_0x01cc('0x1f')](_0x5c3518)[_0x01cc('0x26')](function(_0x2902e8){_0x378c5d[_0x01cc('0x1f')]=_0x2902e8;if(_0xbcfb46[_0x01cc('0x30')][_0x01cc('0x41')]){_0x9f3d75[_0x01cc('0x42')]=[{'all':!![]}];}return db[_0x01cc('0x43')][_0x01cc('0x44')](_0x9f3d75);})[_0x01cc('0x26')](function(_0x825977){_0x378c5d[_0x01cc('0x45')]=_0x825977;return _0x378c5d;})[_0x01cc('0x26')](respondWithFilteredResult(_0x456d38,_0x9f3d75))['catch'](handleError(_0x456d38,null));};exports[_0x01cc('0x46')]=function(_0x1f6e56,_0x42f98c){var _0x23a821={'raw':![],'where':{'id':_0x1f6e56[_0x01cc('0x47')]['id']}},_0x50aea4={};_0x50aea4[_0x01cc('0x2e')]=_['keys'](db['ZohoConfiguration'][_0x01cc('0x48')]);_0x50aea4['query']=_[_0x01cc('0x31')](_0x1f6e56[_0x01cc('0x30')]);_0x50aea4[_0x01cc('0x3b')]=_[_0x01cc('0x32')](_0x50aea4[_0x01cc('0x2e')],_0x50aea4[_0x01cc('0x30')]);_0x23a821[_0x01cc('0x34')]=_[_0x01cc('0x32')](_0x50aea4[_0x01cc('0x2e')],qs[_0x01cc('0x33')](_0x1f6e56[_0x01cc('0x30')][_0x01cc('0x33')]));_0x23a821[_0x01cc('0x34')]=_0x23a821[_0x01cc('0x34')][_0x01cc('0x35')]?_0x23a821['attributes']:_0x50aea4[_0x01cc('0x2e')];if(_0x1f6e56[_0x01cc('0x30')][_0x01cc('0x41')]){_0x23a821['include']=[{'all':!![]}];}_0x23a821=_['merge']({},_0x23a821,_0x1f6e56[_0x01cc('0x40')]);return db[_0x01cc('0x43')]['find'](_0x23a821)['then'](handleEntityNotFound(_0x42f98c,null))[_0x01cc('0x26')](respondWithResult(_0x42f98c,null))[_0x01cc('0x49')](handleError(_0x42f98c,null));};exports[_0x01cc('0x4a')]=function(_0x5b7d14,_0x5d6b6f){return db[_0x01cc('0x43')][_0x01cc('0x4a')](_0x5b7d14[_0x01cc('0x4b')],{})['then'](respondWithResult(_0x5d6b6f,0xc9))[_0x01cc('0x49')](handleError(_0x5d6b6f,null));};exports[_0x01cc('0x4c')]=function(_0x544aad,_0x2dea70){if(_0x544aad[_0x01cc('0x4b')]['id']){delete _0x544aad[_0x01cc('0x4b')]['id'];}return db[_0x01cc('0x43')][_0x01cc('0x4d')]({'where':{'id':_0x544aad[_0x01cc('0x47')]['id']}})[_0x01cc('0x26')](handleEntityNotFound(_0x2dea70,null))[_0x01cc('0x26')](saveUpdates(_0x544aad[_0x01cc('0x4b')],null))['then'](respondWithResult(_0x2dea70,null))[_0x01cc('0x49')](handleError(_0x2dea70,null));};exports[_0x01cc('0x27')]=function(_0x18a553,_0x3d424a){return db['ZohoConfiguration'][_0x01cc('0x4d')]({'where':{'id':_0x18a553[_0x01cc('0x47')]['id']}})[_0x01cc('0x26')](handleEntityNotFound(_0x3d424a,null))[_0x01cc('0x26')](removeEntity(_0x3d424a,null))['catch'](handleError(_0x3d424a,null));};exports[_0x01cc('0x4e')]=function(_0x112ed1,_0x4f2995,_0x3d562d){var _0x36849d={};var _0x1d98b5={};var _0x114dc3;var _0x5894de;return db[_0x01cc('0x43')][_0x01cc('0x4f')]({'where':{'id':_0x112ed1[_0x01cc('0x47')]['id']}})[_0x01cc('0x26')](handleEntityNotFound(_0x4f2995,null))['then'](function(_0x80cf43){if(_0x80cf43){_0x114dc3=_0x80cf43;_0x1d98b5[_0x01cc('0x2e')]=_['keys'](db[_0x01cc('0x50')][_0x01cc('0x48')]);_0x1d98b5[_0x01cc('0x30')]=_[_0x01cc('0x31')](_0x112ed1[_0x01cc('0x30')]);_0x1d98b5[_0x01cc('0x3b')]=_[_0x01cc('0x32')](_0x1d98b5['model'],_0x1d98b5[_0x01cc('0x30')]);_0x36849d[_0x01cc('0x34')]=_[_0x01cc('0x32')](_0x1d98b5['model'],qs[_0x01cc('0x33')](_0x112ed1[_0x01cc('0x30')]['fields']));_0x36849d[_0x01cc('0x34')]=_0x36849d[_0x01cc('0x34')][_0x01cc('0x35')]?_0x36849d[_0x01cc('0x34')]:_0x1d98b5['model'];_0x36849d[_0x01cc('0x38')]=qs[_0x01cc('0x39')](_0x112ed1[_0x01cc('0x30')][_0x01cc('0x39')]);_0x36849d[_0x01cc('0x3a')]=qs['filters'](_[_0x01cc('0x3c')](_0x112ed1[_0x01cc('0x30')],_0x1d98b5['filters']));if(_0x112ed1[_0x01cc('0x30')][_0x01cc('0x3d')]){_0x36849d['where']=_['merge'](_0x36849d[_0x01cc('0x3a')],{'$or':_[_0x01cc('0x2f')](_0x36849d[_0x01cc('0x34')],function(_0x9161da){var _0x2e08c3={};_0x2e08c3[_0x9161da]={'$like':'%'+_0x112ed1[_0x01cc('0x30')][_0x01cc('0x3d')]+'%'};return _0x2e08c3;})});}_0x36849d=_[_0x01cc('0x3f')]({},_0x36849d,_0x112ed1[_0x01cc('0x40')]);return _0x114dc3[_0x01cc('0x4e')](_0x36849d);}})['then'](function(_0x469986){if(_0x469986){_0x5894de=_0x469986[_0x01cc('0x35')];if(!_0x112ed1['query']['hasOwnProperty'](_0x01cc('0x37'))){_0x36849d[_0x01cc('0x1e')]=qs['limit'](_0x112ed1[_0x01cc('0x30')][_0x01cc('0x1e')]);_0x36849d[_0x01cc('0x1c')]=qs[_0x01cc('0x1c')](_0x112ed1[_0x01cc('0x30')][_0x01cc('0x1c')]);}return _0x114dc3[_0x01cc('0x4e')](_0x36849d);}})[_0x01cc('0x26')](function(_0x2d0e4e){if(_0x2d0e4e){return _0x2d0e4e?{'count':_0x5894de,'rows':_0x2d0e4e}:null;}})[_0x01cc('0x26')](respondWithResult(_0x4f2995,null))[_0x01cc('0x49')](handleError(_0x4f2995,null));};exports[_0x01cc('0x51')]=function(_0x4535d7,_0x39201e,_0x24f19b){var _0x5e484e={};var _0x403b27={};var _0x55c2c0;var _0x5c752c;return db[_0x01cc('0x43')]['findOne']({'where':{'id':_0x4535d7['params']['id']}})['then'](handleEntityNotFound(_0x39201e,null))['then'](function(_0x3608dc){if(_0x3608dc){_0x55c2c0=_0x3608dc;_0x403b27[_0x01cc('0x2e')]=_[_0x01cc('0x31')](db[_0x01cc('0x50')][_0x01cc('0x48')]);_0x403b27[_0x01cc('0x30')]=_[_0x01cc('0x31')](_0x4535d7[_0x01cc('0x30')]);_0x403b27[_0x01cc('0x3b')]=_[_0x01cc('0x32')](_0x403b27[_0x01cc('0x2e')],_0x403b27['query']);_0x5e484e[_0x01cc('0x34')]=_[_0x01cc('0x32')](_0x403b27['model'],qs['fields'](_0x4535d7[_0x01cc('0x30')][_0x01cc('0x33')]));_0x5e484e[_0x01cc('0x34')]=_0x5e484e[_0x01cc('0x34')][_0x01cc('0x35')]?_0x5e484e[_0x01cc('0x34')]:_0x403b27[_0x01cc('0x2e')];_0x5e484e[_0x01cc('0x38')]=qs[_0x01cc('0x39')](_0x4535d7[_0x01cc('0x30')][_0x01cc('0x39')]);_0x5e484e[_0x01cc('0x3a')]=qs[_0x01cc('0x3b')](_[_0x01cc('0x3c')](_0x4535d7['query'],_0x403b27[_0x01cc('0x3b')]));if(_0x4535d7[_0x01cc('0x30')][_0x01cc('0x3d')]){_0x5e484e[_0x01cc('0x3a')]=_[_0x01cc('0x3f')](_0x5e484e[_0x01cc('0x3a')],{'$or':_['map'](_0x5e484e[_0x01cc('0x34')],function(_0xaae580){var _0x4b76eb={};_0x4b76eb[_0xaae580]={'$like':'%'+_0x4535d7[_0x01cc('0x30')][_0x01cc('0x3d')]+'%'};return _0x4b76eb;})});}_0x5e484e=_[_0x01cc('0x3f')]({},_0x5e484e,_0x4535d7[_0x01cc('0x40')]);return _0x55c2c0['getSubjects'](_0x5e484e);}})[_0x01cc('0x26')](function(_0xaf3e86){if(_0xaf3e86){_0x5c752c=_0xaf3e86[_0x01cc('0x35')];if(!_0x4535d7[_0x01cc('0x30')][_0x01cc('0x36')](_0x01cc('0x37'))){_0x5e484e[_0x01cc('0x1e')]=qs['limit'](_0x4535d7[_0x01cc('0x30')][_0x01cc('0x1e')]);_0x5e484e[_0x01cc('0x1c')]=qs[_0x01cc('0x1c')](_0x4535d7[_0x01cc('0x30')][_0x01cc('0x1c')]);}return _0x55c2c0[_0x01cc('0x51')](_0x5e484e);}})[_0x01cc('0x26')](function(_0x41b8d1){if(_0x41b8d1){return _0x41b8d1?{'count':_0x5c752c,'rows':_0x41b8d1}:null;}})[_0x01cc('0x26')](respondWithResult(_0x39201e,null))[_0x01cc('0x49')](handleError(_0x39201e,null));};exports[_0x01cc('0x52')]=function(_0xc026c8,_0x3321a9,_0x5928d7){var _0x36c903={};var _0x11832f={};var _0x134170;var _0x272ad2;return db[_0x01cc('0x43')][_0x01cc('0x4f')]({'where':{'id':_0xc026c8[_0x01cc('0x47')]['id']}})['then'](handleEntityNotFound(_0x3321a9,null))[_0x01cc('0x26')](function(_0x388611){if(_0x388611){_0x134170=_0x388611;_0x11832f[_0x01cc('0x2e')]=_['keys'](db[_0x01cc('0x50')][_0x01cc('0x48')]);_0x11832f['query']=_[_0x01cc('0x31')](_0xc026c8[_0x01cc('0x30')]);_0x11832f[_0x01cc('0x3b')]=_[_0x01cc('0x32')](_0x11832f[_0x01cc('0x2e')],_0x11832f[_0x01cc('0x30')]);_0x36c903['attributes']=_[_0x01cc('0x32')](_0x11832f[_0x01cc('0x2e')],qs[_0x01cc('0x33')](_0xc026c8[_0x01cc('0x30')]['fields']));_0x36c903['attributes']=_0x36c903[_0x01cc('0x34')][_0x01cc('0x35')]?_0x36c903['attributes']:_0x11832f[_0x01cc('0x2e')];_0x36c903[_0x01cc('0x38')]=qs[_0x01cc('0x39')](_0xc026c8[_0x01cc('0x30')]['sort']);_0x36c903[_0x01cc('0x3a')]=qs[_0x01cc('0x3b')](_[_0x01cc('0x3c')](_0xc026c8[_0x01cc('0x30')],_0x11832f[_0x01cc('0x3b')]));if(_0xc026c8[_0x01cc('0x30')][_0x01cc('0x3d')]){_0x36c903[_0x01cc('0x3a')]=_['merge'](_0x36c903[_0x01cc('0x3a')],{'$or':_[_0x01cc('0x2f')](_0x36c903['attributes'],function(_0x355c40){var _0x1b2402={};_0x1b2402[_0x355c40]={'$like':'%'+_0xc026c8[_0x01cc('0x30')][_0x01cc('0x3d')]+'%'};return _0x1b2402;})});}_0x36c903=_[_0x01cc('0x3f')]({},_0x36c903,_0xc026c8[_0x01cc('0x40')]);return _0x134170[_0x01cc('0x52')](_0x36c903);}})[_0x01cc('0x26')](function(_0x44c6a7){if(_0x44c6a7){_0x272ad2=_0x44c6a7['length'];if(!_0xc026c8[_0x01cc('0x30')]['hasOwnProperty'](_0x01cc('0x37'))){_0x36c903['limit']=qs['limit'](_0xc026c8[_0x01cc('0x30')][_0x01cc('0x1e')]);_0x36c903[_0x01cc('0x1c')]=qs['offset'](_0xc026c8[_0x01cc('0x30')][_0x01cc('0x1c')]);}return _0x134170[_0x01cc('0x52')](_0x36c903);}})[_0x01cc('0x26')](function(_0x5e3c18){if(_0x5e3c18){return _0x5e3c18?{'count':_0x272ad2,'rows':_0x5e3c18}:null;}})[_0x01cc('0x26')](respondWithResult(_0x3321a9,null))[_0x01cc('0x49')](handleError(_0x3321a9,null));}; \ No newline at end of file +var _0xd411=['sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','stack','name','index','map','ZohoConfiguration','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','getFields','findOne','pick','getSubjects','ZohoField','rawAttributes','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x5360a7,_0x5e86e8){var _0x4d5b24=function(_0x57706c){while(--_0x57706c){_0x5360a7['push'](_0x5360a7['shift']());}};_0x4d5b24(++_0x5e86e8);}(_0xd411,0x138));var _0x1d41=function(_0xffb37f,_0x2f1c46){_0xffb37f=_0xffb37f-0x0;var _0x211dc9=_0xd411[_0xffb37f];return _0x211dc9;};'use strict';var emlformat=require(_0x1d41('0x0'));var rimraf=require(_0x1d41('0x1'));var zipdir=require(_0x1d41('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1d41('0x3'));var moment=require(_0x1d41('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1d41('0x5'));var util=require(_0x1d41('0x6'));var path=require(_0x1d41('0x7'));var sox=require(_0x1d41('0x8'));var csv=require(_0x1d41('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1d41('0xa'));var crypto=require(_0x1d41('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1d41('0xc'));var toCsv=require(_0x1d41('0x9'));var querystring=require(_0x1d41('0xd'));var Papa=require(_0x1d41('0xe'));var Redis=require(_0x1d41('0xf'));var authService=require(_0x1d41('0x10'));var qs=require(_0x1d41('0x11'));var as=require(_0x1d41('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d41('0x13'))(_0x1d41('0x14'));var utils=require(_0x1d41('0x15'));var config=require(_0x1d41('0x16'));var licenseUtil=require(_0x1d41('0x17'));var db=require(_0x1d41('0x18'))['db'];function respondWithStatusCode(_0x1c9b7a,_0x240b5a){_0x240b5a=_0x240b5a||0xcc;return function(_0x1b17fd){if(_0x1b17fd){return _0x1c9b7a[_0x1d41('0x19')](_0x240b5a);}return _0x1c9b7a[_0x1d41('0x1a')](_0x240b5a)['end']();};}function respondWithResult(_0xaa34fe,_0x3f9f57){_0x3f9f57=_0x3f9f57||0xc8;return function(_0x22ced8){if(_0x22ced8){return _0xaa34fe['status'](_0x3f9f57)['json'](_0x22ced8);}};}function respondWithFilteredResult(_0x157139,_0xf7d66f){return function(_0x4a6bc0){if(_0x4a6bc0){var _0x2adfc8=typeof _0xf7d66f['offset']===_0x1d41('0x1b')&&typeof _0xf7d66f['limit']===_0x1d41('0x1b');var _0x134eca=_0x4a6bc0[_0x1d41('0x1c')];var _0x3a9c83=_0x2adfc8?0x0:_0xf7d66f['offset'];var _0x261dd0=_0x2adfc8?_0x4a6bc0[_0x1d41('0x1c')]:_0xf7d66f[_0x1d41('0x1d')]+_0xf7d66f[_0x1d41('0x1e')];var _0x1cc3bc;if(_0x261dd0>=_0x134eca){_0x261dd0=_0x134eca;_0x1cc3bc=0xc8;}else{_0x1cc3bc=0xce;}_0x157139[_0x1d41('0x1a')](_0x1cc3bc);return _0x157139[_0x1d41('0x1f')](_0x1d41('0x20'),_0x3a9c83+'-'+_0x261dd0+'/'+_0x134eca)[_0x1d41('0x21')](_0x4a6bc0);}return null;};}function patchUpdates(_0x5c7208){return function(_0x592d2b){try{jsonpatch['apply'](_0x592d2b,_0x5c7208,!![]);}catch(_0x2957a9){return BPromise[_0x1d41('0x22')](_0x2957a9);}return _0x592d2b[_0x1d41('0x23')]();};}function saveUpdates(_0x56a5f2,_0xcb0947){return function(_0x5a252b){if(_0x5a252b){return _0x5a252b[_0x1d41('0x24')](_0x56a5f2)[_0x1d41('0x25')](function(_0x152f19){return _0x152f19;});}return null;};}function removeEntity(_0xa69012,_0x51dabf){return function(_0x9e45cf){if(_0x9e45cf){return _0x9e45cf[_0x1d41('0x26')]()[_0x1d41('0x25')](function(){_0xa69012['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55ece2,_0x412783){return function(_0x6bbe74){if(!_0x6bbe74){_0x55ece2['sendStatus'](0x194);}return _0x6bbe74;};}function handleError(_0x12bf87,_0x2d1ecd){_0x2d1ecd=_0x2d1ecd||0x1f4;return function(_0x54fd9c){logger['error'](_0x54fd9c[_0x1d41('0x27')]);if(_0x54fd9c['name']){delete _0x54fd9c[_0x1d41('0x28')];}_0x12bf87[_0x1d41('0x1a')](_0x2d1ecd)['send'](_0x54fd9c);};}exports[_0x1d41('0x29')]=function(_0x17dfab,_0x3e9652){var _0x365fc1={},_0x13f141={},_0x596ca4={'count':0x0,'rows':[]};var _0x25df27=_[_0x1d41('0x2a')](db[_0x1d41('0x2b')]['rawAttributes'],function(_0x16f918){return{'name':_0x16f918[_0x1d41('0x2c')],'type':_0x16f918[_0x1d41('0x2d')][_0x1d41('0x2e')]};});_0x13f141['model']=_[_0x1d41('0x2a')](_0x25df27,_0x1d41('0x28'));_0x13f141[_0x1d41('0x2f')]=_[_0x1d41('0x30')](_0x17dfab[_0x1d41('0x2f')]);_0x13f141['filters']=_[_0x1d41('0x31')](_0x13f141[_0x1d41('0x32')],_0x13f141['query']);_0x365fc1[_0x1d41('0x33')]=_['intersection'](_0x13f141[_0x1d41('0x32')],qs[_0x1d41('0x34')](_0x17dfab[_0x1d41('0x2f')][_0x1d41('0x34')]));_0x365fc1[_0x1d41('0x33')]=_0x365fc1[_0x1d41('0x33')][_0x1d41('0x35')]?_0x365fc1[_0x1d41('0x33')]:_0x13f141['model'];if(!_0x17dfab[_0x1d41('0x2f')][_0x1d41('0x36')](_0x1d41('0x37'))){_0x365fc1[_0x1d41('0x1e')]=qs[_0x1d41('0x1e')](_0x17dfab['query'][_0x1d41('0x1e')]);_0x365fc1[_0x1d41('0x1d')]=qs[_0x1d41('0x1d')](_0x17dfab[_0x1d41('0x2f')][_0x1d41('0x1d')]);}_0x365fc1[_0x1d41('0x38')]=qs[_0x1d41('0x39')](_0x17dfab[_0x1d41('0x2f')][_0x1d41('0x39')]);_0x365fc1[_0x1d41('0x3a')]=qs[_0x1d41('0x3b')](_['pick'](_0x17dfab['query'],_0x13f141[_0x1d41('0x3b')]),_0x25df27);if(_0x17dfab[_0x1d41('0x2f')][_0x1d41('0x3c')]){_0x365fc1[_0x1d41('0x3a')]=_[_0x1d41('0x3d')](_0x365fc1['where'],{'$or':_[_0x1d41('0x2a')](_0x25df27,function(_0x1ab758){if(_0x1ab758['type']!=='VIRTUAL'){var _0x557339={};_0x557339[_0x1ab758[_0x1d41('0x28')]]={'$like':'%'+_0x17dfab[_0x1d41('0x2f')][_0x1d41('0x3c')]+'%'};return _0x557339;}})});}_0x365fc1=_[_0x1d41('0x3d')]({},_0x365fc1,_0x17dfab[_0x1d41('0x3e')]);var _0x5d27f8={'where':_0x365fc1['where']};return db[_0x1d41('0x2b')][_0x1d41('0x1c')](_0x5d27f8)[_0x1d41('0x25')](function(_0x3c8fb6){_0x596ca4['count']=_0x3c8fb6;if(_0x17dfab[_0x1d41('0x2f')]['includeAll']){_0x365fc1[_0x1d41('0x3f')]=[{'all':!![]}];}return db[_0x1d41('0x2b')][_0x1d41('0x40')](_0x365fc1);})[_0x1d41('0x25')](function(_0x5b0f57){_0x596ca4[_0x1d41('0x41')]=_0x5b0f57;return _0x596ca4;})[_0x1d41('0x25')](respondWithFilteredResult(_0x3e9652,_0x365fc1))[_0x1d41('0x42')](handleError(_0x3e9652,null));};exports[_0x1d41('0x43')]=function(_0x483564,_0x3dad84){var _0x2aba45={'raw':![],'where':{'id':_0x483564[_0x1d41('0x44')]['id']}},_0x38b446={};_0x38b446['model']=_[_0x1d41('0x30')](db[_0x1d41('0x2b')]['rawAttributes']);_0x38b446[_0x1d41('0x2f')]=_[_0x1d41('0x30')](_0x483564[_0x1d41('0x2f')]);_0x38b446[_0x1d41('0x3b')]=_[_0x1d41('0x31')](_0x38b446['model'],_0x38b446[_0x1d41('0x2f')]);_0x2aba45['attributes']=_['intersection'](_0x38b446[_0x1d41('0x32')],qs[_0x1d41('0x34')](_0x483564[_0x1d41('0x2f')][_0x1d41('0x34')]));_0x2aba45[_0x1d41('0x33')]=_0x2aba45[_0x1d41('0x33')][_0x1d41('0x35')]?_0x2aba45[_0x1d41('0x33')]:_0x38b446['model'];if(_0x483564[_0x1d41('0x2f')][_0x1d41('0x45')]){_0x2aba45[_0x1d41('0x3f')]=[{'all':!![]}];}_0x2aba45=_[_0x1d41('0x3d')]({},_0x2aba45,_0x483564[_0x1d41('0x3e')]);return db['ZohoConfiguration'][_0x1d41('0x46')](_0x2aba45)[_0x1d41('0x25')](handleEntityNotFound(_0x3dad84,null))[_0x1d41('0x25')](respondWithResult(_0x3dad84,null))[_0x1d41('0x42')](handleError(_0x3dad84,null));};exports[_0x1d41('0x47')]=function(_0x5bb69b,_0x2c2a5d){return db[_0x1d41('0x2b')][_0x1d41('0x47')](_0x5bb69b[_0x1d41('0x48')],{})[_0x1d41('0x25')](respondWithResult(_0x2c2a5d,0xc9))[_0x1d41('0x42')](handleError(_0x2c2a5d,null));};exports[_0x1d41('0x24')]=function(_0xc0d063,_0x650a2a){if(_0xc0d063[_0x1d41('0x48')]['id']){delete _0xc0d063[_0x1d41('0x48')]['id'];}return db[_0x1d41('0x2b')][_0x1d41('0x46')]({'where':{'id':_0xc0d063[_0x1d41('0x44')]['id']}})[_0x1d41('0x25')](handleEntityNotFound(_0x650a2a,null))[_0x1d41('0x25')](saveUpdates(_0xc0d063['body'],null))['then'](respondWithResult(_0x650a2a,null))[_0x1d41('0x42')](handleError(_0x650a2a,null));};exports['destroy']=function(_0x482150,_0x1ce279){return db['ZohoConfiguration']['find']({'where':{'id':_0x482150['params']['id']}})[_0x1d41('0x25')](handleEntityNotFound(_0x1ce279,null))[_0x1d41('0x25')](removeEntity(_0x1ce279,null))['catch'](handleError(_0x1ce279,null));};exports[_0x1d41('0x49')]=function(_0x5b3462,_0x5d716a,_0x4db0a9){var _0x181d0e={};var _0x2fcf9e={};var _0x277f04;var _0x51c181;return db[_0x1d41('0x2b')][_0x1d41('0x4a')]({'where':{'id':_0x5b3462[_0x1d41('0x44')]['id']}})['then'](handleEntityNotFound(_0x5d716a,null))['then'](function(_0x2c41a8){if(_0x2c41a8){_0x277f04=_0x2c41a8;_0x2fcf9e[_0x1d41('0x32')]=_['keys'](db['ZohoField']['rawAttributes']);_0x2fcf9e[_0x1d41('0x2f')]=_[_0x1d41('0x30')](_0x5b3462['query']);_0x2fcf9e[_0x1d41('0x3b')]=_[_0x1d41('0x31')](_0x2fcf9e[_0x1d41('0x32')],_0x2fcf9e[_0x1d41('0x2f')]);_0x181d0e[_0x1d41('0x33')]=_[_0x1d41('0x31')](_0x2fcf9e[_0x1d41('0x32')],qs[_0x1d41('0x34')](_0x5b3462[_0x1d41('0x2f')]['fields']));_0x181d0e[_0x1d41('0x33')]=_0x181d0e['attributes'][_0x1d41('0x35')]?_0x181d0e[_0x1d41('0x33')]:_0x2fcf9e[_0x1d41('0x32')];_0x181d0e[_0x1d41('0x38')]=qs[_0x1d41('0x39')](_0x5b3462[_0x1d41('0x2f')][_0x1d41('0x39')]);_0x181d0e[_0x1d41('0x3a')]=qs[_0x1d41('0x3b')](_[_0x1d41('0x4b')](_0x5b3462['query'],_0x2fcf9e['filters']));if(_0x5b3462['query'][_0x1d41('0x3c')]){_0x181d0e[_0x1d41('0x3a')]=_[_0x1d41('0x3d')](_0x181d0e[_0x1d41('0x3a')],{'$or':_[_0x1d41('0x2a')](_0x181d0e[_0x1d41('0x33')],function(_0x5192c5){var _0xf08d18={};_0xf08d18[_0x5192c5]={'$like':'%'+_0x5b3462['query'][_0x1d41('0x3c')]+'%'};return _0xf08d18;})});}_0x181d0e=_['merge']({},_0x181d0e,_0x5b3462['options']);return _0x277f04[_0x1d41('0x49')](_0x181d0e);}})[_0x1d41('0x25')](function(_0x589c8f){if(_0x589c8f){_0x51c181=_0x589c8f[_0x1d41('0x35')];if(!_0x5b3462[_0x1d41('0x2f')][_0x1d41('0x36')](_0x1d41('0x37'))){_0x181d0e[_0x1d41('0x1e')]=qs[_0x1d41('0x1e')](_0x5b3462[_0x1d41('0x2f')][_0x1d41('0x1e')]);_0x181d0e[_0x1d41('0x1d')]=qs[_0x1d41('0x1d')](_0x5b3462[_0x1d41('0x2f')][_0x1d41('0x1d')]);}return _0x277f04[_0x1d41('0x49')](_0x181d0e);}})[_0x1d41('0x25')](function(_0x1d1744){if(_0x1d1744){return _0x1d1744?{'count':_0x51c181,'rows':_0x1d1744}:null;}})[_0x1d41('0x25')](respondWithResult(_0x5d716a,null))[_0x1d41('0x42')](handleError(_0x5d716a,null));};exports[_0x1d41('0x4c')]=function(_0x2972d1,_0x459e1f,_0x43864b){var _0xd4682e={};var _0x1ff662={};var _0x119891;var _0x462d6b;return db['ZohoConfiguration'][_0x1d41('0x4a')]({'where':{'id':_0x2972d1['params']['id']}})['then'](handleEntityNotFound(_0x459e1f,null))[_0x1d41('0x25')](function(_0x449d14){if(_0x449d14){_0x119891=_0x449d14;_0x1ff662['model']=_[_0x1d41('0x30')](db[_0x1d41('0x4d')][_0x1d41('0x4e')]);_0x1ff662[_0x1d41('0x2f')]=_[_0x1d41('0x30')](_0x2972d1[_0x1d41('0x2f')]);_0x1ff662[_0x1d41('0x3b')]=_[_0x1d41('0x31')](_0x1ff662[_0x1d41('0x32')],_0x1ff662['query']);_0xd4682e[_0x1d41('0x33')]=_[_0x1d41('0x31')](_0x1ff662['model'],qs['fields'](_0x2972d1[_0x1d41('0x2f')]['fields']));_0xd4682e['attributes']=_0xd4682e['attributes'][_0x1d41('0x35')]?_0xd4682e['attributes']:_0x1ff662[_0x1d41('0x32')];_0xd4682e['order']=qs[_0x1d41('0x39')](_0x2972d1[_0x1d41('0x2f')]['sort']);_0xd4682e[_0x1d41('0x3a')]=qs['filters'](_['pick'](_0x2972d1[_0x1d41('0x2f')],_0x1ff662[_0x1d41('0x3b')]));if(_0x2972d1['query'][_0x1d41('0x3c')]){_0xd4682e[_0x1d41('0x3a')]=_[_0x1d41('0x3d')](_0xd4682e['where'],{'$or':_[_0x1d41('0x2a')](_0xd4682e[_0x1d41('0x33')],function(_0x354302){var _0x23791e={};_0x23791e[_0x354302]={'$like':'%'+_0x2972d1[_0x1d41('0x2f')]['filter']+'%'};return _0x23791e;})});}_0xd4682e=_['merge']({},_0xd4682e,_0x2972d1[_0x1d41('0x3e')]);return _0x119891[_0x1d41('0x4c')](_0xd4682e);}})[_0x1d41('0x25')](function(_0x15b877){if(_0x15b877){_0x462d6b=_0x15b877['length'];if(!_0x2972d1[_0x1d41('0x2f')][_0x1d41('0x36')]('nolimit')){_0xd4682e[_0x1d41('0x1e')]=qs[_0x1d41('0x1e')](_0x2972d1[_0x1d41('0x2f')][_0x1d41('0x1e')]);_0xd4682e[_0x1d41('0x1d')]=qs[_0x1d41('0x1d')](_0x2972d1[_0x1d41('0x2f')]['offset']);}return _0x119891[_0x1d41('0x4c')](_0xd4682e);}})[_0x1d41('0x25')](function(_0x2984cc){if(_0x2984cc){return _0x2984cc?{'count':_0x462d6b,'rows':_0x2984cc}:null;}})['then'](respondWithResult(_0x459e1f,null))[_0x1d41('0x42')](handleError(_0x459e1f,null));};exports[_0x1d41('0x4f')]=function(_0x235be1,_0x5daab9,_0x34f012){var _0x3e6b31={};var _0x51f5a8={};var _0x1a535b;var _0x4e4096;return db['ZohoConfiguration'][_0x1d41('0x4a')]({'where':{'id':_0x235be1[_0x1d41('0x44')]['id']}})[_0x1d41('0x25')](handleEntityNotFound(_0x5daab9,null))['then'](function(_0x5e1f29){if(_0x5e1f29){_0x1a535b=_0x5e1f29;_0x51f5a8[_0x1d41('0x32')]=_[_0x1d41('0x30')](db['ZohoField'][_0x1d41('0x4e')]);_0x51f5a8[_0x1d41('0x2f')]=_[_0x1d41('0x30')](_0x235be1[_0x1d41('0x2f')]);_0x51f5a8[_0x1d41('0x3b')]=_[_0x1d41('0x31')](_0x51f5a8['model'],_0x51f5a8[_0x1d41('0x2f')]);_0x3e6b31[_0x1d41('0x33')]=_[_0x1d41('0x31')](_0x51f5a8[_0x1d41('0x32')],qs[_0x1d41('0x34')](_0x235be1[_0x1d41('0x2f')][_0x1d41('0x34')]));_0x3e6b31[_0x1d41('0x33')]=_0x3e6b31[_0x1d41('0x33')][_0x1d41('0x35')]?_0x3e6b31['attributes']:_0x51f5a8['model'];_0x3e6b31[_0x1d41('0x38')]=qs[_0x1d41('0x39')](_0x235be1[_0x1d41('0x2f')][_0x1d41('0x39')]);_0x3e6b31[_0x1d41('0x3a')]=qs['filters'](_['pick'](_0x235be1[_0x1d41('0x2f')],_0x51f5a8[_0x1d41('0x3b')]));if(_0x235be1[_0x1d41('0x2f')][_0x1d41('0x3c')]){_0x3e6b31[_0x1d41('0x3a')]=_[_0x1d41('0x3d')](_0x3e6b31[_0x1d41('0x3a')],{'$or':_[_0x1d41('0x2a')](_0x3e6b31[_0x1d41('0x33')],function(_0x13983c){var _0x49d32f={};_0x49d32f[_0x13983c]={'$like':'%'+_0x235be1[_0x1d41('0x2f')][_0x1d41('0x3c')]+'%'};return _0x49d32f;})});}_0x3e6b31=_[_0x1d41('0x3d')]({},_0x3e6b31,_0x235be1[_0x1d41('0x3e')]);return _0x1a535b[_0x1d41('0x4f')](_0x3e6b31);}})[_0x1d41('0x25')](function(_0x563f79){if(_0x563f79){_0x4e4096=_0x563f79[_0x1d41('0x35')];if(!_0x235be1[_0x1d41('0x2f')]['hasOwnProperty'](_0x1d41('0x37'))){_0x3e6b31[_0x1d41('0x1e')]=qs[_0x1d41('0x1e')](_0x235be1[_0x1d41('0x2f')][_0x1d41('0x1e')]);_0x3e6b31['offset']=qs[_0x1d41('0x1d')](_0x235be1['query'][_0x1d41('0x1d')]);}return _0x1a535b[_0x1d41('0x4f')](_0x3e6b31);}})['then'](function(_0x41358a){if(_0x41358a){return _0x41358a?{'count':_0x4e4096,'rows':_0x41358a}:null;}})[_0x1d41('0x25')](respondWithResult(_0x5daab9,null))[_0x1d41('0x42')](handleError(_0x5daab9,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 80b394a..d332161 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 _0x5583=['define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intZohoConfiguration.attributes','exports'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x5583,0x1f1));var _0x3558=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x5583[_0x26b80e];return _0x84a8a8;};'use strict';var _=require(_0x3558('0x0'));var util=require(_0x3558('0x1'));var logger=require(_0x3558('0x2'))('api');var moment=require(_0x3558('0x3'));var BPromise=require(_0x3558('0x4'));var rp=require(_0x3558('0x5'));var fs=require('fs');var path=require(_0x3558('0x6'));var rimraf=require(_0x3558('0x7'));var config=require('../../config/environment');var attributes=require(_0x3558('0x8'));module[_0x3558('0x9')]=function(_0x1fffb1,_0x9cd74f){return _0x1fffb1[_0x3558('0xa')](_0x3558('0xb'),attributes,{'tableName':_0x3558('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3708=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger'];(function(_0x28c791,_0x32de4b){var _0x24eb17=function(_0x105e5b){while(--_0x105e5b){_0x28c791['push'](_0x28c791['shift']());}};_0x24eb17(++_0x32de4b);}(_0x3708,0xcf));var _0x8370=function(_0x5874ad,_0x3b22bb){_0x5874ad=_0x5874ad-0x0;var _0x5cdde9=_0x3708[_0x5874ad];return _0x5cdde9;};'use strict';var _=require(_0x8370('0x0'));var util=require(_0x8370('0x1'));var logger=require(_0x8370('0x2'))('api');var moment=require(_0x8370('0x3'));var BPromise=require(_0x8370('0x4'));var rp=require(_0x8370('0x5'));var fs=require('fs');var path=require(_0x8370('0x6'));var rimraf=require(_0x8370('0x7'));var config=require(_0x8370('0x8'));var attributes=require(_0x8370('0x9'));module[_0x8370('0xa')]=function(_0xf50e0f,_0x35e893){return _0xf50e0f[_0x8370('0xb')](_0x8370('0xc'),attributes,{'tableName':_0x8370('0xd'),'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 aa8259e..8efac23 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 _0xc29e=['../../config/environment','jayson/promise','client','http','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc29e,0xad));var _0xec29=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xc29e[_0x122096];return _0x3d1966;};'use strict';var _=require('lodash');var util=require(_0xec29('0x0'));var moment=require(_0xec29('0x1'));var BPromise=require(_0xec29('0x2'));var rs=require(_0xec29('0x3'));var fs=require('fs');var Redis=require(_0xec29('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xec29('0x5'));var logger=require('../../config/logger')(_0xec29('0x6'));var config=require(_0xec29('0x7'));var jayson=require(_0xec29('0x8'));var client=jayson[_0xec29('0x9')][_0xec29('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22d4c3,_0x3c66cd,_0x8f637c){return new BPromise(function(_0x2ba768,_0x559923){return client['request'](_0x22d4c3,_0x8f637c)[_0xec29('0xb')](function(_0x1cc619){logger['info'](_0xec29('0xc'),_0x3c66cd,_0xec29('0xd'));logger['debug'](_0xec29('0xe'),_0x3c66cd,_0xec29('0xd'),JSON[_0xec29('0xf')](_0x1cc619));if(_0x1cc619[_0xec29('0x10')]){if(_0x1cc619[_0xec29('0x10')][_0xec29('0x11')]===0x1f4){logger[_0xec29('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x3c66cd,_0x1cc619[_0xec29('0x10')][_0xec29('0x12')]);return _0x559923(_0x1cc619[_0xec29('0x10')][_0xec29('0x12')]);}logger['error'](_0xec29('0xc'),_0x3c66cd,_0x1cc619[_0xec29('0x10')][_0xec29('0x12')]);return _0x2ba768(_0x1cc619['error'][_0xec29('0x12')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x3c66cd,_0xec29('0xd'));_0x2ba768(_0x1cc619['result'][_0xec29('0x12')]);}})[_0xec29('0x13')](function(_0x3d35ec){logger[_0xec29('0x10')](_0xec29('0xc'),_0x3c66cd,_0x3d35ec);_0x559923(_0x3d35ec);});});} \ No newline at end of file +var _0x9bae=['http','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x354cac,_0x1f24ee){var _0x1dfca8=function(_0x4642f3){while(--_0x4642f3){_0x354cac['push'](_0x354cac['shift']());}};_0x1dfca8(++_0x1f24ee);}(_0x9bae,0xd1));var _0xe9ba=function(_0x324455,_0x470f56){_0x324455=_0x324455-0x0;var _0x1e21b3=_0x9bae[_0x324455];return _0x1e21b3;};'use strict';var _=require(_0xe9ba('0x0'));var util=require(_0xe9ba('0x1'));var moment=require('moment');var BPromise=require(_0xe9ba('0x2'));var rs=require(_0xe9ba('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe9ba('0x4'))['db'];var utils=require(_0xe9ba('0x5'));var logger=require(_0xe9ba('0x6'))(_0xe9ba('0x7'));var config=require(_0xe9ba('0x8'));var jayson=require(_0xe9ba('0x9'));var client=jayson[_0xe9ba('0xa')][_0xe9ba('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x67f2c7,_0x114f22,_0x4caf23){return new BPromise(function(_0x222bcf,_0x1d5add){return client[_0xe9ba('0xc')](_0x67f2c7,_0x4caf23)[_0xe9ba('0xd')](function(_0x37e5c){logger['info'](_0xe9ba('0xe'),_0x114f22,_0xe9ba('0xf'));logger['debug'](_0xe9ba('0x10'),_0x114f22,'request\x20sent',JSON[_0xe9ba('0x11')](_0x37e5c));if(_0x37e5c[_0xe9ba('0x12')]){if(_0x37e5c[_0xe9ba('0x12')][_0xe9ba('0x13')]===0x1f4){logger[_0xe9ba('0x12')](_0xe9ba('0xe'),_0x114f22,_0x37e5c[_0xe9ba('0x12')]['message']);return _0x1d5add(_0x37e5c['error'][_0xe9ba('0x14')]);}logger[_0xe9ba('0x12')](_0xe9ba('0xe'),_0x114f22,_0x37e5c[_0xe9ba('0x12')][_0xe9ba('0x14')]);return _0x222bcf(_0x37e5c[_0xe9ba('0x12')]['message']);}else{logger[_0xe9ba('0x15')](_0xe9ba('0xe'),_0x114f22,_0xe9ba('0xf'));_0x222bcf(_0x37e5c['result'][_0xe9ba('0x14')]);}})['catch'](function(_0x50b205){logger['error'](_0xe9ba('0xe'),_0x114f22,_0x50b205);_0x1d5add(_0x50b205);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 05bc53c..d2a5f8d 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 _0xc8e7=['../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xa3cdb4,_0x5c0cf0){var _0x5dc569=function(_0x1d770a){while(--_0x1d770a){_0xa3cdb4['push'](_0xa3cdb4['shift']());}};_0x5dc569(++_0x5c0cf0);}(_0xc8e7,0x1e6));var _0x7c8e=function(_0x4f4757,_0x44241a){_0x4f4757=_0x4f4757-0x0;var _0x549c37=_0xc8e7[_0x4f4757];return _0x549c37;};'use strict';var multer=require(_0x7c8e('0x0'));var util=require(_0x7c8e('0x1'));var path=require(_0x7c8e('0x2'));var timeout=require(_0x7c8e('0x3'));var express=require(_0x7c8e('0x4'));var router=express[_0x7c8e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7c8e('0x6'));var interaction=require(_0x7c8e('0x7'));var config=require(_0x7c8e('0x8'));var controller=require(_0x7c8e('0x9'));router[_0x7c8e('0xa')]('/',auth[_0x7c8e('0xb')](),controller[_0x7c8e('0xc')]);router[_0x7c8e('0xa')](_0x7c8e('0xd'),auth[_0x7c8e('0xb')](),controller['show']);router['post']('/',auth[_0x7c8e('0xb')](),controller[_0x7c8e('0xe')]);router[_0x7c8e('0xf')](_0x7c8e('0xd'),auth[_0x7c8e('0xb')](),controller['update']);router[_0x7c8e('0x10')](_0x7c8e('0xd'),auth['isAuthenticated'](),controller[_0x7c8e('0x11')]);module[_0x7c8e('0x12')]=router; \ No newline at end of file +var _0xcce6=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./intZohoField.controller','get','index','/:id','isAuthenticated','create','put','update','delete','destroy','exports'];(function(_0x438d04,_0x180a0b){var _0x597901=function(_0x3d4fd7){while(--_0x3d4fd7){_0x438d04['push'](_0x438d04['shift']());}};_0x597901(++_0x180a0b);}(_0xcce6,0x17a));var _0x6cce=function(_0x1ac6ec,_0x1f81fc){_0x1ac6ec=_0x1ac6ec-0x0;var _0x48a489=_0xcce6[_0x1ac6ec];return _0x48a489;};'use strict';var multer=require(_0x6cce('0x0'));var util=require(_0x6cce('0x1'));var path=require(_0x6cce('0x2'));var timeout=require(_0x6cce('0x3'));var express=require('express');var router=express[_0x6cce('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6cce('0x5'));var interaction=require(_0x6cce('0x6'));var config=require('../../config/environment');var controller=require(_0x6cce('0x7'));router[_0x6cce('0x8')]('/',auth['isAuthenticated'](),controller[_0x6cce('0x9')]);router['get'](_0x6cce('0xa'),auth[_0x6cce('0xb')](),controller['show']);router['post']('/',auth[_0x6cce('0xb')](),controller[_0x6cce('0xc')]);router[_0x6cce('0xd')](_0x6cce('0xa'),auth[_0x6cce('0xb')](),controller[_0x6cce('0xe')]);router[_0x6cce('0xf')](_0x6cce('0xa'),auth[_0x6cce('0xb')](),controller[_0x6cce('0x10')]);module[_0x6cce('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index cc10d43..64cca9b 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 _0xb3f3=['string','STRING','variable','BOOLEAN','exports','ENUM','customVariable','keyValue','picklist'];(function(_0xb8412c,_0x2ae5a6){var _0x26ac6a=function(_0x1d4cf3){while(--_0x1d4cf3){_0xb8412c['push'](_0xb8412c['shift']());}};_0x26ac6a(++_0x2ae5a6);}(_0xb3f3,0x82));var _0x3b3f=function(_0x114ae4,_0x14bdc9){_0x114ae4=_0x114ae4-0x0;var _0x32f566=_0xb3f3[_0x114ae4];return _0x32f566;};'use strict';var Sequelize=require('sequelize');module[_0x3b3f('0x0')]={'type':{'type':Sequelize[_0x3b3f('0x1')]('string','variable',_0x3b3f('0x2'),_0x3b3f('0x3'),_0x3b3f('0x4')),'defaultValue':_0x3b3f('0x5')},'content':{'type':Sequelize[_0x3b3f('0x6')]},'key':{'type':Sequelize[_0x3b3f('0x6')]},'keyType':{'type':Sequelize[_0x3b3f('0x1')](_0x3b3f('0x5'),_0x3b3f('0x7'),_0x3b3f('0x2'))},'keyContent':{'type':Sequelize[_0x3b3f('0x6')]},'idField':{'type':Sequelize[_0x3b3f('0x6')]},'nameField':{'type':Sequelize[_0x3b3f('0x6')]},'customField':{'type':Sequelize[_0x3b3f('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcc58=['customVariable','BOOLEAN','sequelize','exports','ENUM','string','keyValue','picklist','STRING'];(function(_0x51bbeb,_0x54a938){var _0x120f02=function(_0x57d900){while(--_0x57d900){_0x51bbeb['push'](_0x51bbeb['shift']());}};_0x120f02(++_0x54a938);}(_0xcc58,0x119));var _0x8cc5=function(_0x49974e,_0x4facfc){_0x49974e=_0x49974e-0x0;var _0x33b143=_0xcc58[_0x49974e];return _0x33b143;};'use strict';var Sequelize=require(_0x8cc5('0x0'));module[_0x8cc5('0x1')]={'type':{'type':Sequelize[_0x8cc5('0x2')](_0x8cc5('0x3'),'variable','customVariable',_0x8cc5('0x4'),_0x8cc5('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8cc5('0x6')]},'key':{'type':Sequelize[_0x8cc5('0x6')]},'keyType':{'type':Sequelize[_0x8cc5('0x2')](_0x8cc5('0x3'),'variable',_0x8cc5('0x7'))},'keyContent':{'type':Sequelize[_0x8cc5('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8cc5('0x6')]},'customField':{'type':Sequelize[_0x8cc5('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8cc5('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 04c7088..fa77895 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 _0x8ce6=['sox','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','end','error','stack','name','send','ZohoField','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','rows','catch','show','params','length','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path'];(function(_0x53e826,_0x513c59){var _0x5d4184=function(_0x1c47e6){while(--_0x1c47e6){_0x53e826['push'](_0x53e826['shift']());}};_0x5d4184(++_0x513c59);}(_0x8ce6,0xcf));var _0x68ce=function(_0x1c2fb4,_0x426a64){_0x1c2fb4=_0x1c2fb4-0x0;var _0x1b2b1b=_0x8ce6[_0x1c2fb4];return _0x1b2b1b;};'use strict';var emlformat=require(_0x68ce('0x0'));var rimraf=require(_0x68ce('0x1'));var zipdir=require(_0x68ce('0x2'));var jsonpatch=require(_0x68ce('0x3'));var rp=require(_0x68ce('0x4'));var moment=require(_0x68ce('0x5'));var BPromise=require(_0x68ce('0x6'));var Mustache=require('mustache');var util=require(_0x68ce('0x7'));var path=require(_0x68ce('0x8'));var sox=require(_0x68ce('0x9'));var csv=require('to-csv');var ejs=require(_0x68ce('0xa'));var fs=require('fs');var fs_extra=require(_0x68ce('0xb'));var _=require(_0x68ce('0xc'));var squel=require(_0x68ce('0xd'));var crypto=require(_0x68ce('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x68ce('0xf'));var Redis=require(_0x68ce('0x10'));var authService=require(_0x68ce('0x11'));var qs=require(_0x68ce('0x12'));var as=require(_0x68ce('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x68ce('0x14'))('api');var utils=require(_0x68ce('0x15'));var config=require(_0x68ce('0x16'));var licenseUtil=require(_0x68ce('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a66aa,_0x5a6193){_0x5a6193=_0x5a6193||0xcc;return function(_0x586735){if(_0x586735){return _0x1a66aa[_0x68ce('0x18')](_0x5a6193);}return _0x1a66aa[_0x68ce('0x19')](_0x5a6193)['end']();};}function respondWithResult(_0x36ba93,_0x4315a6){_0x4315a6=_0x4315a6||0xc8;return function(_0x25d882){if(_0x25d882){return _0x36ba93[_0x68ce('0x19')](_0x4315a6)[_0x68ce('0x1a')](_0x25d882);}};}function respondWithFilteredResult(_0x305d60,_0x54ffd4){return function(_0x84f5d5){if(_0x84f5d5){var _0x2f1cd8=typeof _0x54ffd4[_0x68ce('0x1b')]==='undefined'&&typeof _0x54ffd4[_0x68ce('0x1c')]===_0x68ce('0x1d');var _0xcccf9=_0x84f5d5[_0x68ce('0x1e')];var _0x542a81=_0x2f1cd8?0x0:_0x54ffd4[_0x68ce('0x1b')];var _0x21f4b8=_0x2f1cd8?_0x84f5d5[_0x68ce('0x1e')]:_0x54ffd4[_0x68ce('0x1b')]+_0x54ffd4[_0x68ce('0x1c')];var _0x5ccbb8;if(_0x21f4b8>=_0xcccf9){_0x21f4b8=_0xcccf9;_0x5ccbb8=0xc8;}else{_0x5ccbb8=0xce;}_0x305d60[_0x68ce('0x19')](_0x5ccbb8);return _0x305d60[_0x68ce('0x1f')](_0x68ce('0x20'),_0x542a81+'-'+_0x21f4b8+'/'+_0xcccf9)[_0x68ce('0x1a')](_0x84f5d5);}return null;};}function patchUpdates(_0x2b3e8c){return function(_0x51c6a7){try{jsonpatch['apply'](_0x51c6a7,_0x2b3e8c,!![]);}catch(_0x26d4fe){return BPromise[_0x68ce('0x21')](_0x26d4fe);}return _0x51c6a7[_0x68ce('0x22')]();};}function saveUpdates(_0x56b70b,_0x3f53d4){return function(_0x3fb683){if(_0x3fb683){return _0x3fb683[_0x68ce('0x23')](_0x56b70b)['then'](function(_0x45187b){return _0x45187b;});}return null;};}function removeEntity(_0x14216f,_0x477cb3){return function(_0x4378d6){if(_0x4378d6){return _0x4378d6[_0x68ce('0x24')]()[_0x68ce('0x25')](function(){_0x14216f[_0x68ce('0x19')](0xcc)[_0x68ce('0x26')]();});}};}function handleEntityNotFound(_0x589d96,_0xaa215){return function(_0x33c4df){if(!_0x33c4df){_0x589d96[_0x68ce('0x18')](0x194);}return _0x33c4df;};}function handleError(_0x280516,_0x1d777c){_0x1d777c=_0x1d777c||0x1f4;return function(_0x2a8a3c){logger[_0x68ce('0x27')](_0x2a8a3c[_0x68ce('0x28')]);if(_0x2a8a3c['name']){delete _0x2a8a3c[_0x68ce('0x29')];}_0x280516[_0x68ce('0x19')](_0x1d777c)[_0x68ce('0x2a')](_0x2a8a3c);};}exports['index']=function(_0x714a8d,_0x4b841b){var _0x1746e6={},_0x15ec49={},_0x566a09={'count':0x0,'rows':[]};var _0x37a29f=_['map'](db[_0x68ce('0x2b')][_0x68ce('0x2c')],function(_0x43ea6f){return{'name':_0x43ea6f[_0x68ce('0x2d')],'type':_0x43ea6f[_0x68ce('0x2e')]['key']};});_0x15ec49[_0x68ce('0x2f')]=_[_0x68ce('0x30')](_0x37a29f,_0x68ce('0x29'));_0x15ec49[_0x68ce('0x31')]=_[_0x68ce('0x32')](_0x714a8d[_0x68ce('0x31')]);_0x15ec49[_0x68ce('0x33')]=_[_0x68ce('0x34')](_0x15ec49['model'],_0x15ec49['query']);_0x1746e6[_0x68ce('0x35')]=_[_0x68ce('0x34')](_0x15ec49[_0x68ce('0x2f')],qs[_0x68ce('0x36')](_0x714a8d['query'][_0x68ce('0x36')]));_0x1746e6[_0x68ce('0x35')]=_0x1746e6[_0x68ce('0x35')]['length']?_0x1746e6[_0x68ce('0x35')]:_0x15ec49[_0x68ce('0x2f')];if(!_0x714a8d[_0x68ce('0x31')][_0x68ce('0x37')]('nolimit')){_0x1746e6[_0x68ce('0x1c')]=qs[_0x68ce('0x1c')](_0x714a8d[_0x68ce('0x31')][_0x68ce('0x1c')]);_0x1746e6[_0x68ce('0x1b')]=qs[_0x68ce('0x1b')](_0x714a8d['query'][_0x68ce('0x1b')]);}_0x1746e6['order']=qs['sort'](_0x714a8d[_0x68ce('0x31')][_0x68ce('0x38')]);_0x1746e6[_0x68ce('0x39')]=qs[_0x68ce('0x33')](_[_0x68ce('0x3a')](_0x714a8d[_0x68ce('0x31')],_0x15ec49[_0x68ce('0x33')]),_0x37a29f);if(_0x714a8d['query'][_0x68ce('0x3b')]){_0x1746e6[_0x68ce('0x39')]=_[_0x68ce('0x3c')](_0x1746e6['where'],{'$or':_[_0x68ce('0x30')](_0x37a29f,function(_0x3947bf){if(_0x3947bf['type']!==_0x68ce('0x3d')){var _0x5bbb44={};_0x5bbb44[_0x3947bf[_0x68ce('0x29')]]={'$like':'%'+_0x714a8d[_0x68ce('0x31')][_0x68ce('0x3b')]+'%'};return _0x5bbb44;}})});}_0x1746e6=_[_0x68ce('0x3c')]({},_0x1746e6,_0x714a8d[_0x68ce('0x3e')]);var _0x3bc565={'where':_0x1746e6[_0x68ce('0x39')]};return db[_0x68ce('0x2b')][_0x68ce('0x1e')](_0x3bc565)[_0x68ce('0x25')](function(_0x4579f0){_0x566a09[_0x68ce('0x1e')]=_0x4579f0;if(_0x714a8d[_0x68ce('0x31')]['includeAll']){_0x1746e6['include']=[{'all':!![]}];}return db[_0x68ce('0x2b')]['findAll'](_0x1746e6);})['then'](function(_0x501b7d){_0x566a09[_0x68ce('0x3f')]=_0x501b7d;return _0x566a09;})[_0x68ce('0x25')](respondWithFilteredResult(_0x4b841b,_0x1746e6))[_0x68ce('0x40')](handleError(_0x4b841b,null));};exports[_0x68ce('0x41')]=function(_0x182cf2,_0x3a09cf){var _0x5ebae3={'raw':!![],'where':{'id':_0x182cf2[_0x68ce('0x42')]['id']}},_0x48be66={};_0x48be66['model']=_['keys'](db['ZohoField'][_0x68ce('0x2c')]);_0x48be66['query']=_[_0x68ce('0x32')](_0x182cf2['query']);_0x48be66['filters']=_[_0x68ce('0x34')](_0x48be66[_0x68ce('0x2f')],_0x48be66[_0x68ce('0x31')]);_0x5ebae3[_0x68ce('0x35')]=_['intersection'](_0x48be66[_0x68ce('0x2f')],qs[_0x68ce('0x36')](_0x182cf2[_0x68ce('0x31')][_0x68ce('0x36')]));_0x5ebae3['attributes']=_0x5ebae3['attributes'][_0x68ce('0x43')]?_0x5ebae3[_0x68ce('0x35')]:_0x48be66[_0x68ce('0x2f')];if(_0x182cf2[_0x68ce('0x31')]['includeAll']){_0x5ebae3[_0x68ce('0x44')]=[{'all':!![]}];}_0x5ebae3=_[_0x68ce('0x3c')]({},_0x5ebae3,_0x182cf2[_0x68ce('0x3e')]);return db['ZohoField'][_0x68ce('0x45')](_0x5ebae3)['then'](handleEntityNotFound(_0x3a09cf,null))[_0x68ce('0x25')](respondWithResult(_0x3a09cf,null))[_0x68ce('0x40')](handleError(_0x3a09cf,null));};exports['create']=function(_0x4e5e8d,_0x5aea6f){return db[_0x68ce('0x2b')][_0x68ce('0x46')](_0x4e5e8d[_0x68ce('0x47')],{})[_0x68ce('0x25')](respondWithResult(_0x5aea6f,0xc9))[_0x68ce('0x40')](handleError(_0x5aea6f,null));};exports[_0x68ce('0x23')]=function(_0x4796e6,_0x51eb68){if(_0x4796e6[_0x68ce('0x47')]['id']){delete _0x4796e6['body']['id'];}return db['ZohoField'][_0x68ce('0x45')]({'where':{'id':_0x4796e6[_0x68ce('0x42')]['id']}})[_0x68ce('0x25')](handleEntityNotFound(_0x51eb68,null))['then'](saveUpdates(_0x4796e6[_0x68ce('0x47')],null))[_0x68ce('0x25')](respondWithResult(_0x51eb68,null))[_0x68ce('0x40')](handleError(_0x51eb68,null));};exports['destroy']=function(_0x455e4c,_0x59a4e3){return db[_0x68ce('0x2b')]['find']({'where':{'id':_0x455e4c['params']['id']}})[_0x68ce('0x25')](handleEntityNotFound(_0x59a4e3,null))[_0x68ce('0x25')](removeEntity(_0x59a4e3,null))[_0x68ce('0x40')](handleError(_0x59a4e3,null));}; \ No newline at end of file +var _0xad04=['eml-format','rimraf','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','ZohoField','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','rawAttributes','include','find','body'];(function(_0x3f7716,_0x506fa5){var _0x5ea40f=function(_0x116ed6){while(--_0x116ed6){_0x3f7716['push'](_0x3f7716['shift']());}};_0x5ea40f(++_0x506fa5);}(_0xad04,0x96));var _0x4ad0=function(_0xd17fc2,_0xa9c5){_0xd17fc2=_0xd17fc2-0x0;var _0x4ddd6f=_0xad04[_0xd17fc2];return _0x4ddd6f;};'use strict';var emlformat=require(_0x4ad0('0x0'));var rimraf=require(_0x4ad0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4ad0('0x2'));var Mustache=require(_0x4ad0('0x3'));var util=require(_0x4ad0('0x4'));var path=require('path');var sox=require(_0x4ad0('0x5'));var csv=require(_0x4ad0('0x6'));var ejs=require(_0x4ad0('0x7'));var fs=require('fs');var fs_extra=require(_0x4ad0('0x8'));var _=require(_0x4ad0('0x9'));var squel=require(_0x4ad0('0xa'));var crypto=require(_0x4ad0('0xb'));var jsforce=require(_0x4ad0('0xc'));var deskjs=require(_0x4ad0('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4ad0('0xe'));var Redis=require(_0x4ad0('0xf'));var authService=require(_0x4ad0('0x10'));var qs=require(_0x4ad0('0x11'));var as=require(_0x4ad0('0x12'));var hardwareService=require(_0x4ad0('0x13'));var logger=require(_0x4ad0('0x14'))(_0x4ad0('0x15'));var utils=require('../../config/utils');var config=require(_0x4ad0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x4ad0('0x17'))['db'];function respondWithStatusCode(_0x260652,_0x1449a8){_0x1449a8=_0x1449a8||0xcc;return function(_0x552e9f){if(_0x552e9f){return _0x260652[_0x4ad0('0x18')](_0x1449a8);}return _0x260652[_0x4ad0('0x19')](_0x1449a8)['end']();};}function respondWithResult(_0x12d818,_0x447d18){_0x447d18=_0x447d18||0xc8;return function(_0x1ee87f){if(_0x1ee87f){return _0x12d818[_0x4ad0('0x19')](_0x447d18)['json'](_0x1ee87f);}};}function respondWithFilteredResult(_0x130f6b,_0x10c4b4){return function(_0x28479c){if(_0x28479c){var _0x3b5001=typeof _0x10c4b4[_0x4ad0('0x1a')]===_0x4ad0('0x1b')&&typeof _0x10c4b4['limit']===_0x4ad0('0x1b');var _0x3a634c=_0x28479c['count'];var _0xcadde5=_0x3b5001?0x0:_0x10c4b4[_0x4ad0('0x1a')];var _0x3b45db=_0x3b5001?_0x28479c[_0x4ad0('0x1c')]:_0x10c4b4['offset']+_0x10c4b4[_0x4ad0('0x1d')];var _0x34317e;if(_0x3b45db>=_0x3a634c){_0x3b45db=_0x3a634c;_0x34317e=0xc8;}else{_0x34317e=0xce;}_0x130f6b['status'](_0x34317e);return _0x130f6b['set'](_0x4ad0('0x1e'),_0xcadde5+'-'+_0x3b45db+'/'+_0x3a634c)[_0x4ad0('0x1f')](_0x28479c);}return null;};}function patchUpdates(_0x16790d){return function(_0x28235a){try{jsonpatch[_0x4ad0('0x20')](_0x28235a,_0x16790d,!![]);}catch(_0x2a45f6){return BPromise[_0x4ad0('0x21')](_0x2a45f6);}return _0x28235a[_0x4ad0('0x22')]();};}function saveUpdates(_0x25e52c,_0x4a8b37){return function(_0x5af5cf){if(_0x5af5cf){return _0x5af5cf[_0x4ad0('0x23')](_0x25e52c)['then'](function(_0x1299ea){return _0x1299ea;});}return null;};}function removeEntity(_0x230e5b,_0x4151b7){return function(_0x1f2398){if(_0x1f2398){return _0x1f2398[_0x4ad0('0x24')]()[_0x4ad0('0x25')](function(){_0x230e5b[_0x4ad0('0x19')](0xcc)[_0x4ad0('0x26')]();});}};}function handleEntityNotFound(_0x3b880c,_0x56012d){return function(_0x305cbc){if(!_0x305cbc){_0x3b880c[_0x4ad0('0x18')](0x194);}return _0x305cbc;};}function handleError(_0x57c77f,_0x26ca18){_0x26ca18=_0x26ca18||0x1f4;return function(_0x550f35){logger[_0x4ad0('0x27')](_0x550f35[_0x4ad0('0x28')]);if(_0x550f35[_0x4ad0('0x29')]){delete _0x550f35[_0x4ad0('0x29')];}_0x57c77f[_0x4ad0('0x19')](_0x26ca18)[_0x4ad0('0x2a')](_0x550f35);};}exports[_0x4ad0('0x2b')]=function(_0xec40c,_0x3bada2){var _0x692799={},_0x4ec496={},_0x5df6c6={'count':0x0,'rows':[]};var _0x37b2d6=_['map'](db[_0x4ad0('0x2c')]['rawAttributes'],function(_0x13f6b3){return{'name':_0x13f6b3[_0x4ad0('0x2d')],'type':_0x13f6b3[_0x4ad0('0x2e')][_0x4ad0('0x2f')]};});_0x4ec496[_0x4ad0('0x30')]=_[_0x4ad0('0x31')](_0x37b2d6,_0x4ad0('0x29'));_0x4ec496[_0x4ad0('0x32')]=_[_0x4ad0('0x33')](_0xec40c[_0x4ad0('0x32')]);_0x4ec496[_0x4ad0('0x34')]=_[_0x4ad0('0x35')](_0x4ec496['model'],_0x4ec496[_0x4ad0('0x32')]);_0x692799[_0x4ad0('0x36')]=_[_0x4ad0('0x35')](_0x4ec496['model'],qs['fields'](_0xec40c[_0x4ad0('0x32')][_0x4ad0('0x37')]));_0x692799['attributes']=_0x692799[_0x4ad0('0x36')][_0x4ad0('0x38')]?_0x692799[_0x4ad0('0x36')]:_0x4ec496['model'];if(!_0xec40c[_0x4ad0('0x32')][_0x4ad0('0x39')]('nolimit')){_0x692799[_0x4ad0('0x1d')]=qs['limit'](_0xec40c['query'][_0x4ad0('0x1d')]);_0x692799[_0x4ad0('0x1a')]=qs[_0x4ad0('0x1a')](_0xec40c[_0x4ad0('0x32')][_0x4ad0('0x1a')]);}_0x692799[_0x4ad0('0x3a')]=qs[_0x4ad0('0x3b')](_0xec40c[_0x4ad0('0x32')][_0x4ad0('0x3b')]);_0x692799['where']=qs[_0x4ad0('0x34')](_[_0x4ad0('0x3c')](_0xec40c[_0x4ad0('0x32')],_0x4ec496['filters']),_0x37b2d6);if(_0xec40c[_0x4ad0('0x32')]['filter']){_0x692799[_0x4ad0('0x3d')]=_[_0x4ad0('0x3e')](_0x692799[_0x4ad0('0x3d')],{'$or':_[_0x4ad0('0x31')](_0x37b2d6,function(_0x1f09d4){if(_0x1f09d4['type']!==_0x4ad0('0x3f')){var _0x1dd546={};_0x1dd546[_0x1f09d4[_0x4ad0('0x29')]]={'$like':'%'+_0xec40c[_0x4ad0('0x32')][_0x4ad0('0x40')]+'%'};return _0x1dd546;}})});}_0x692799=_[_0x4ad0('0x3e')]({},_0x692799,_0xec40c[_0x4ad0('0x41')]);var _0x5462f4={'where':_0x692799[_0x4ad0('0x3d')]};return db[_0x4ad0('0x2c')][_0x4ad0('0x1c')](_0x5462f4)[_0x4ad0('0x25')](function(_0x2731a5){_0x5df6c6['count']=_0x2731a5;if(_0xec40c[_0x4ad0('0x32')][_0x4ad0('0x42')]){_0x692799['include']=[{'all':!![]}];}return db[_0x4ad0('0x2c')][_0x4ad0('0x43')](_0x692799);})['then'](function(_0x28b059){_0x5df6c6['rows']=_0x28b059;return _0x5df6c6;})[_0x4ad0('0x25')](respondWithFilteredResult(_0x3bada2,_0x692799))[_0x4ad0('0x44')](handleError(_0x3bada2,null));};exports[_0x4ad0('0x45')]=function(_0x413c42,_0x119405){var _0x40bb79={'raw':!![],'where':{'id':_0x413c42[_0x4ad0('0x46')]['id']}},_0x417ef8={};_0x417ef8[_0x4ad0('0x30')]=_[_0x4ad0('0x33')](db['ZohoField'][_0x4ad0('0x47')]);_0x417ef8[_0x4ad0('0x32')]=_['keys'](_0x413c42['query']);_0x417ef8[_0x4ad0('0x34')]=_[_0x4ad0('0x35')](_0x417ef8[_0x4ad0('0x30')],_0x417ef8[_0x4ad0('0x32')]);_0x40bb79['attributes']=_[_0x4ad0('0x35')](_0x417ef8[_0x4ad0('0x30')],qs[_0x4ad0('0x37')](_0x413c42['query'][_0x4ad0('0x37')]));_0x40bb79[_0x4ad0('0x36')]=_0x40bb79[_0x4ad0('0x36')]['length']?_0x40bb79[_0x4ad0('0x36')]:_0x417ef8['model'];if(_0x413c42[_0x4ad0('0x32')]['includeAll']){_0x40bb79[_0x4ad0('0x48')]=[{'all':!![]}];}_0x40bb79=_[_0x4ad0('0x3e')]({},_0x40bb79,_0x413c42[_0x4ad0('0x41')]);return db[_0x4ad0('0x2c')][_0x4ad0('0x49')](_0x40bb79)['then'](handleEntityNotFound(_0x119405,null))['then'](respondWithResult(_0x119405,null))[_0x4ad0('0x44')](handleError(_0x119405,null));};exports['create']=function(_0x225d09,_0xdf0a29){return db[_0x4ad0('0x2c')]['create'](_0x225d09[_0x4ad0('0x4a')],{})[_0x4ad0('0x25')](respondWithResult(_0xdf0a29,0xc9))['catch'](handleError(_0xdf0a29,null));};exports[_0x4ad0('0x23')]=function(_0x5249f1,_0x106c0d){if(_0x5249f1[_0x4ad0('0x4a')]['id']){delete _0x5249f1['body']['id'];}return db[_0x4ad0('0x2c')][_0x4ad0('0x49')]({'where':{'id':_0x5249f1[_0x4ad0('0x46')]['id']}})[_0x4ad0('0x25')](handleEntityNotFound(_0x106c0d,null))[_0x4ad0('0x25')](saveUpdates(_0x5249f1[_0x4ad0('0x4a')],null))[_0x4ad0('0x25')](respondWithResult(_0x106c0d,null))[_0x4ad0('0x44')](handleError(_0x106c0d,null));};exports[_0x4ad0('0x24')]=function(_0x47d3d8,_0x37d816){return db['ZohoField'][_0x4ad0('0x49')]({'where':{'id':_0x47d3d8['params']['id']}})[_0x4ad0('0x25')](handleEntityNotFound(_0x37d816,null))[_0x4ad0('0x25')](removeEntity(_0x37d816,null))[_0x4ad0('0x44')](handleError(_0x37d816,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 660779b..6cbe193 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 _0x4325=['../../config/environment','./intZohoField.attributes','ZohoField','zoho_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','rimraf'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0x4325,0x1da));var _0x5432=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4325[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x5432('0x0'));var util=require(_0x5432('0x1'));var logger=require('../../config/logger')(_0x5432('0x2'));var moment=require(_0x5432('0x3'));var BPromise=require(_0x5432('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5432('0x5'));var config=require(_0x5432('0x6'));var attributes=require(_0x5432('0x7'));module['exports']=function(_0x209e2e,_0xbb0075){return _0x209e2e['define'](_0x5432('0x8'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x5432('0x9'),'fields':[_0x5432('0xa'),_0x5432('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x47c5=['ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./intZohoField.attributes','exports','define'];(function(_0x572743,_0x2cc13c){var _0x3abb61=function(_0x47d6fb){while(--_0x47d6fb){_0x572743['push'](_0x572743['shift']());}};_0x3abb61(++_0x2cc13c);}(_0x47c5,0x165));var _0x547c=function(_0x31ce33,_0x1a7f94){_0x31ce33=_0x31ce33-0x0;var _0x32d860=_0x47c5[_0x31ce33];return _0x32d860;};'use strict';var _=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var logger=require(_0x547c('0x2'))(_0x547c('0x3'));var moment=require(_0x547c('0x4'));var BPromise=require(_0x547c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x547c('0x6'));var rimraf=require(_0x547c('0x7'));var config=require('../../config/environment');var attributes=require(_0x547c('0x8'));module[_0x547c('0x9')]=function(_0x51ab7f,_0x2e5b57){return _0x51ab7f[_0x547c('0xa')](_0x547c('0xb'),attributes,{'tableName':_0x547c('0xc'),'paranoid':![],'indexes':[{'name':_0x547c('0xd'),'fields':[_0x547c('0xe'),_0x547c('0xf')],'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 2be0efa..0782562 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 _0x59cd=['http','request','then','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoField,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x31b458,_0x244fd8){var _0x3f3ddb=function(_0xdeae73){while(--_0xdeae73){_0x31b458['push'](_0x31b458['shift']());}};_0x3f3ddb(++_0x244fd8);}(_0x59cd,0x194));var _0xd59c=function(_0x31c796,_0x2e3c7f){_0x31c796=_0x31c796-0x0;var _0x128356=_0x59cd[_0x31c796];return _0x128356;};'use strict';var _=require('lodash');var util=require(_0xd59c('0x0'));var moment=require(_0xd59c('0x1'));var BPromise=require(_0xd59c('0x2'));var rs=require(_0xd59c('0x3'));var fs=require('fs');var Redis=require(_0xd59c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd59c('0x5'));var logger=require(_0xd59c('0x6'))(_0xd59c('0x7'));var config=require('../../config/environment');var jayson=require(_0xd59c('0x8'));var client=jayson[_0xd59c('0x9')][_0xd59c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e1cce,_0x224f3d,_0x575df5){return new BPromise(function(_0x327358,_0xd209f8){return client[_0xd59c('0xb')](_0x5e1cce,_0x575df5)[_0xd59c('0xc')](function(_0x411394){logger[_0xd59c('0xd')]('ZohoField,\x20%s,\x20%s',_0x224f3d,_0xd59c('0xe'));logger[_0xd59c('0xf')](_0xd59c('0x10'),_0x224f3d,'request\x20sent',JSON[_0xd59c('0x11')](_0x411394));if(_0x411394[_0xd59c('0x12')]){if(_0x411394[_0xd59c('0x12')][_0xd59c('0x13')]===0x1f4){logger[_0xd59c('0x12')](_0xd59c('0x14'),_0x224f3d,_0x411394['error'][_0xd59c('0x15')]);return _0xd209f8(_0x411394['error'][_0xd59c('0x15')]);}logger[_0xd59c('0x12')]('ZohoField,\x20%s,\x20%s',_0x224f3d,_0x411394['error'][_0xd59c('0x15')]);return _0x327358(_0x411394[_0xd59c('0x12')][_0xd59c('0x15')]);}else{logger[_0xd59c('0xd')](_0xd59c('0x14'),_0x224f3d,_0xd59c('0xe'));_0x327358(_0x411394[_0xd59c('0x16')][_0xd59c('0x15')]);}})['catch'](function(_0x5dcf0b){logger[_0xd59c('0x12')]('ZohoField,\x20%s,\x20%s',_0x224f3d,_0x5dcf0b);_0xd209f8(_0x5dcf0b);});});} \ No newline at end of file +var _0x644f=['stringify','error','code','message','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3c2601,_0x34b84a){var _0x236d89=function(_0x5b837e){while(--_0x5b837e){_0x3c2601['push'](_0x3c2601['shift']());}};_0x236d89(++_0x34b84a);}(_0x644f,0x125));var _0xf644=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x644f[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0xf644('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf644('0x1'));var db=require(_0xf644('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xf644('0x3'))(_0xf644('0x4'));var config=require(_0xf644('0x5'));var jayson=require(_0xf644('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x38247b,_0x49a8db,_0x3248fc){return new BPromise(function(_0x1f9ced,_0x3e94a6){return client[_0xf644('0x7')](_0x38247b,_0x3248fc)[_0xf644('0x8')](function(_0x4997c6){logger[_0xf644('0x9')](_0xf644('0xa'),_0x49a8db,_0xf644('0xb'));logger[_0xf644('0xc')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x49a8db,_0xf644('0xb'),JSON[_0xf644('0xd')](_0x4997c6));if(_0x4997c6[_0xf644('0xe')]){if(_0x4997c6[_0xf644('0xe')][_0xf644('0xf')]===0x1f4){logger[_0xf644('0xe')](_0xf644('0xa'),_0x49a8db,_0x4997c6[_0xf644('0xe')][_0xf644('0x10')]);return _0x3e94a6(_0x4997c6[_0xf644('0xe')][_0xf644('0x10')]);}logger[_0xf644('0xe')](_0xf644('0xa'),_0x49a8db,_0x4997c6[_0xf644('0xe')][_0xf644('0x10')]);return _0x1f9ced(_0x4997c6[_0xf644('0xe')][_0xf644('0x10')]);}else{logger[_0xf644('0x9')](_0xf644('0xa'),_0x49a8db,'request\x20sent');_0x1f9ced(_0x4997c6['result'][_0xf644('0x10')]);}})['catch'](function(_0x365249){logger[_0xf644('0xe')](_0xf644('0xa'),_0x49a8db,_0x365249);_0x3e94a6(_0x365249);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index e50d134..5d1e6cb 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5f185d,_0x54f79b){var _0x5b5294=function(_0x534843){while(--_0x534843){_0x5f185d['push'](_0x5f185d['shift']());}};_0x5b5294(++_0x54f79b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3c4e4c,_0x36ff70){_0x3c4e4c=_0x3c4e4c-0x0;var _0x144a87=_0xcb91[_0x3c4e4c];return _0x144a87;};'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(_0x23d288,_0x524d6d){var _0x3a67d4=function(_0x2702c0){while(--_0x2702c0){_0x23d288['push'](_0x23d288['shift']());}};_0x3a67d4(++_0x524d6d);}(_0xedd9,0xfc));var _0x9edd=function(_0x2399bc,_0x475e0d){_0x2399bc=_0x2399bc-0x0;var _0x3f230a=_0xedd9[_0x2399bc];return _0x3f230a;};'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/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 7734514..c5948ba 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 _0x828b=['BOOLEAN','sequelize','unique_name_and_version','STRING','app.js'];(function(_0xb6e87e,_0x3f69a2){var _0x3bf909=function(_0xfb60e3){while(--_0xfb60e3){_0xb6e87e['push'](_0xb6e87e['shift']());}};_0x3bf909(++_0x3f69a2);}(_0x828b,0x182));var _0xb828=function(_0x2a6fd5,_0x3d6deb){_0x2a6fd5=_0x2a6fd5-0x0;var _0x43c6a4=_0x828b[_0x2a6fd5];return _0x43c6a4;};'use strict';var Sequelize=require(_0xb828('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb828('0x1')},'version':{'type':Sequelize[_0xb828('0x2')],'allowNull':![],'unique':_0xb828('0x1')},'main':{'type':Sequelize[_0xb828('0x2')],'defaultValue':_0xb828('0x3')},'filename':{'type':Sequelize[_0xb828('0x2')]},'path':{'type':Sequelize[_0xb828('0x2')]},'type':{'type':Sequelize[_0xb828('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0xb828('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0xb828('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0xb828('0x2')],'unique':'state'},'description':{'type':Sequelize[_0xb828('0x2')]},'title':{'type':Sequelize[_0xb828('0x2')]},'remoteUri':{'type':Sequelize[_0xb828('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file +var _0x1535=['app.js','BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x1535,0x9d));var _0x5153=function(_0x514bb2,_0xc9f588){_0x514bb2=_0x514bb2-0x0;var _0x4e4679=_0x1535[_0x514bb2];return _0x4e4679;};'use strict';var Sequelize=require(_0x5153('0x0'));module[_0x5153('0x1')]={'name':{'type':Sequelize[_0x5153('0x2')],'allowNull':![],'unique':_0x5153('0x3')},'version':{'type':Sequelize[_0x5153('0x2')],'allowNull':![],'unique':_0x5153('0x3')},'main':{'type':Sequelize[_0x5153('0x2')],'defaultValue':_0x5153('0x4')},'filename':{'type':Sequelize[_0x5153('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5153('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x5153('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x5153('0x2')]},'logo':{'type':Sequelize[_0x5153('0x2')]},'state':{'type':Sequelize[_0x5153('0x2')],'unique':_0x5153('0x6')},'description':{'type':Sequelize[_0x5153('0x2')]},'title':{'type':Sequelize[_0x5153('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x5153('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index ac013c4..5f33ad2 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(_0x2bc400,_0x27208f){var _0x36ab53=function(_0x257660){while(--_0x257660){_0x2bc400['push'](_0x2bc400['shift']());}};_0x36ab53(++_0x27208f);}(_0x9582,0x95));var _0x2958=function(_0xcc40fc,_0x3b4408){_0xcc40fc=_0xcc40fc-0x0;var _0x21f6fe=_0x9582[_0xcc40fc];return _0x21f6fe;};'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 _0x1261=['../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','Integration','model','map','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filters','where','type','VIRTUAL','filter','merge','options','findAll','rows','params','include','find','create','catch','body','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','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x1261,0x144));var _0x1126=function(_0xff6ae1,_0x5c13e2){_0xff6ae1=_0xff6ae1-0x0;var _0x389fa2=_0x1261[_0xff6ae1];return _0x389fa2;};'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);};}exports['index']=function(_0x2fb797,_0x23d2bc){var _0x4a334a={},_0x3fa694={},_0x4bf807={'count':0x0,'rows':[]};var _0xc62460=_['map'](db[_0x1126('0x29')]['rawAttributes'],function(_0x378f4d){return{'name':_0x378f4d['fieldName'],'type':_0x378f4d['type']['key']};});_0x3fa694[_0x1126('0x2a')]=_[_0x1126('0x2b')](_0xc62460,_0x1126('0x2c'));_0x3fa694['query']=_[_0x1126('0x2d')](_0x2fb797[_0x1126('0x2e')]);_0x3fa694['filters']=_[_0x1126('0x2f')](_0x3fa694[_0x1126('0x2a')],_0x3fa694[_0x1126('0x2e')]);_0x4a334a[_0x1126('0x30')]=_['intersection'](_0x3fa694['model'],qs[_0x1126('0x31')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x31')]));_0x4a334a[_0x1126('0x30')]=_0x4a334a['attributes'][_0x1126('0x32')]?_0x4a334a[_0x1126('0x30')]:_0x3fa694[_0x1126('0x2a')];if(!_0x2fb797[_0x1126('0x2e')][_0x1126('0x33')]('nolimit')){_0x4a334a[_0x1126('0x1e')]=qs[_0x1126('0x1e')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1e')]);_0x4a334a['offset']=qs['offset'](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1c')]);}_0x4a334a['order']=qs[_0x1126('0x34')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x34')]);_0x4a334a['where']=qs['filters'](_[_0x1126('0x35')](_0x2fb797[_0x1126('0x2e')],_0x3fa694[_0x1126('0x36')]),_0xc62460);if(_0x2fb797[_0x1126('0x2e')]['filter']){_0x4a334a[_0x1126('0x37')]=_['merge'](_0x4a334a[_0x1126('0x37')],{'$or':_[_0x1126('0x2b')](_0xc62460,function(_0xfa96e0){if(_0xfa96e0[_0x1126('0x38')]!==_0x1126('0x39')){var _0x5746f6={};_0x5746f6[_0xfa96e0[_0x1126('0x2c')]]={'$like':'%'+_0x2fb797[_0x1126('0x2e')][_0x1126('0x3a')]+'%'};return _0x5746f6;}})});}_0x4a334a=_[_0x1126('0x3b')]({},_0x4a334a,_0x2fb797[_0x1126('0x3c')]);var _0x3442b8={'where':_0x4a334a[_0x1126('0x37')]};return db['Integration'][_0x1126('0x1f')](_0x3442b8)[_0x1126('0x25')](function(_0x227a6b){_0x4bf807[_0x1126('0x1f')]=_0x227a6b;if(_0x2fb797[_0x1126('0x2e')]['includeAll']){_0x4a334a['include']=[{'all':!![]}];}return db[_0x1126('0x29')][_0x1126('0x3d')](_0x4a334a);})[_0x1126('0x25')](function(_0x21c38e){_0x4bf807[_0x1126('0x3e')]=_0x21c38e;return _0x4bf807;})[_0x1126('0x25')](respondWithFilteredResult(_0x23d2bc,_0x4a334a))['catch'](handleError(_0x23d2bc,null));};exports['show']=function(_0x4cb1db,_0xb8054e){var _0x5d4194={'raw':![],'where':{'id':_0x4cb1db[_0x1126('0x3f')]['id']}},_0xf84005={};_0xf84005[_0x1126('0x2a')]=_[_0x1126('0x2d')](db['Integration']['rawAttributes']);_0xf84005[_0x1126('0x2e')]=_[_0x1126('0x2d')](_0x4cb1db[_0x1126('0x2e')]);_0xf84005['filters']=_[_0x1126('0x2f')](_0xf84005['model'],_0xf84005[_0x1126('0x2e')]);_0x5d4194['attributes']=_[_0x1126('0x2f')](_0xf84005[_0x1126('0x2a')],qs[_0x1126('0x31')](_0x4cb1db['query'][_0x1126('0x31')]));_0x5d4194[_0x1126('0x30')]=_0x5d4194[_0x1126('0x30')]['length']?_0x5d4194['attributes']:_0xf84005['model'];if(_0x4cb1db[_0x1126('0x2e')]['includeAll']){_0x5d4194[_0x1126('0x40')]=[{'all':!![]}];}_0x5d4194=_['merge']({},_0x5d4194,_0x4cb1db[_0x1126('0x3c')]);return db[_0x1126('0x29')][_0x1126('0x41')](_0x5d4194)[_0x1126('0x25')](handleEntityNotFound(_0xb8054e,null))[_0x1126('0x25')](respondWithResult(_0xb8054e,null))['catch'](handleError(_0xb8054e,null));};exports[_0x1126('0x42')]=function(_0x512f60,_0x5111d3){return db[_0x1126('0x29')][_0x1126('0x42')](_0x512f60['body'],{})[_0x1126('0x25')](respondWithResult(_0x5111d3,0xc9))[_0x1126('0x43')](handleError(_0x5111d3,null));};exports['update']=function(_0x3e4eeb,_0xbdde58){if(_0x3e4eeb[_0x1126('0x44')]['id']){delete _0x3e4eeb['body']['id'];}return db[_0x1126('0x29')][_0x1126('0x41')]({'where':{'id':_0x3e4eeb[_0x1126('0x3f')]['id']}})[_0x1126('0x25')](handleEntityNotFound(_0xbdde58,null))[_0x1126('0x25')](saveUpdates(_0x3e4eeb[_0x1126('0x44')],null))[_0x1126('0x25')](respondWithResult(_0xbdde58,null))[_0x1126('0x43')](handleError(_0xbdde58,null));};exports['destroy']=function(_0x1b8b83,_0x5a2287){return db[_0x1126('0x29')][_0x1126('0x41')]({'where':{'id':_0x1b8b83['params']['id']}})['then'](handleEntityNotFound(_0x5a2287,null))[_0x1126('0x25')](removeEntity(_0x5a2287,null))[_0x1126('0x43')](handleError(_0x5a2287,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 21d12d7..7a1e2ca 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 _0x85bf=['bluebird','request-promise','define','util','../../config/logger','api','moment'];(function(_0x4bf83b,_0x495566){var _0x382713=function(_0x3c47fe){while(--_0x3c47fe){_0x4bf83b['push'](_0x4bf83b['shift']());}};_0x382713(++_0x495566);}(_0x85bf,0x1d1));var _0xf85b=function(_0x14f8ef,_0x1b1107){_0x14f8ef=_0x14f8ef-0x0;var _0x3b97f6=_0x85bf[_0x14f8ef];return _0x3b97f6;};'use strict';var _=require('lodash');var util=require(_0xf85b('0x0'));var logger=require(_0xf85b('0x1'))(_0xf85b('0x2'));var moment=require(_0xf85b('0x3'));var BPromise=require(_0xf85b('0x4'));var rp=require(_0xf85b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./integration.attributes');module['exports']=function(_0x1c8065,_0x1cc582){return _0x1c8065[_0xf85b('0x6')]('Integration',attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0271=['bluebird','request-promise','path','../../config/environment','./integration.attributes','exports','Integration','integrations','lodash','util','../../config/logger','moment'];(function(_0x376724,_0x11ee70){var _0x223818=function(_0x17d905){while(--_0x17d905){_0x376724['push'](_0x376724['shift']());}};_0x223818(++_0x11ee70);}(_0x0271,0x1f4));var _0x1027=function(_0x38d334,_0x24be8b){_0x38d334=_0x38d334-0x0;var _0x296015=_0x0271[_0x38d334];return _0x296015;};'use strict';var _=require(_0x1027('0x0'));var util=require(_0x1027('0x1'));var logger=require(_0x1027('0x2'))('api');var moment=require(_0x1027('0x3'));var BPromise=require(_0x1027('0x4'));var rp=require(_0x1027('0x5'));var fs=require('fs');var path=require(_0x1027('0x6'));var rimraf=require('rimraf');var config=require(_0x1027('0x7'));var attributes=require(_0x1027('0x8'));module[_0x1027('0x9')]=function(_0x46d089,_0x1f4357){return _0x46d089['define'](_0x1027('0xa'),attributes,{'tableName':_0x1027('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index c8c2c6b..7e66ab9 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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','Integration,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0xb07400,_0x43fc5b){var _0xe2fd8b=function(_0x29b8c3){while(--_0x29b8c3){_0xb07400['push'](_0xb07400['shift']());}};_0xe2fd8b(++_0x43fc5b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x11f926,_0x26af58){_0x11f926=_0x11f926-0x0;var _0x355bf6=_0x5f2f[_0x11f926];return _0x355bf6;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('Integration,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x1cc7fa,_0x59d298){var _0x7da606=function(_0x1da5d1){while(--_0x1da5d1){_0x1cc7fa['push'](_0x1cc7fa['shift']());}};_0x7da606(++_0x59d298);}(_0xdb28,0x106));var _0x8db2=function(_0x5e8e72,_0x41e45c){_0x5e8e72=_0x5e8e72-0x0;var _0x13799a=_0xdb28[_0x5e8e72];return _0x13799a;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('Integration,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 49732cb..eb3bd62 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 _0x955f=['post','create','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x3e4739,_0x8cc336){var _0x36742d=function(_0x2a9b56){while(--_0x2a9b56){_0x3e4739['push'](_0x3e4739['shift']());}};_0x36742d(++_0x8cc336);}(_0x955f,0x1eb));var _0xf955=function(_0x3cecfe,_0x316a6e){_0x3cecfe=_0x3cecfe-0x0;var _0x1fba24=_0x955f[_0x3cecfe];return _0x1fba24;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./integrationReport.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['describe']);router[_0xf955('0x7')](_0xf955('0xb'),auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0xd')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router['put'](_0xf955('0xb'),auth['isAuthenticated'](),controller[_0xf955('0xf')]);router[_0xf955('0x10')](_0xf955('0xb'),auth['isAuthenticated'](),controller[_0xf955('0x11')]);module['exports']=router; \ No newline at end of file +var _0x66fa=['index','get','/describe','post','/:id','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x17e735,_0x328f40){var _0x1824d6=function(_0x4460fe){while(--_0x4460fe){_0x17e735['push'](_0x17e735['shift']());}};_0x1824d6(++_0x328f40);}(_0x66fa,0x117));var _0xa66f=function(_0x357159,_0x5e3be9){_0x357159=_0x357159-0x0;var _0x35e3f6=_0x66fa[_0x357159];return _0x35e3f6;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require('path');var timeout=require(_0xa66f('0x2'));var express=require(_0xa66f('0x3'));var router=express[_0xa66f('0x4')]();var fs_extra=require(_0xa66f('0x5'));var auth=require(_0xa66f('0x6'));var interaction=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var controller=require('./integrationReport.controller');router['get']('/',auth[_0xa66f('0x9')](),controller[_0xa66f('0xa')]);router[_0xa66f('0xb')](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['describe']);router[_0xa66f('0xb')]('/:id',auth[_0xa66f('0x9')](),controller['show']);router[_0xa66f('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xa66f('0xe'),auth[_0xa66f('0x9')](),controller['update']);router[_0xa66f('0xf')]('/:id',auth[_0xa66f('0x9')](),controller['destroy']);module[_0xa66f('0x10')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 932d60d..20360e6 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 _0x072e=['STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize'];(function(_0x2784fe,_0xae664f){var _0x415be2=function(_0xf6802f){while(--_0xf6802f){_0x2784fe['push'](_0x2784fe['shift']());}};_0x415be2(++_0xae664f);}(_0x072e,0x11d));var _0xe072=function(_0x53fde8,_0x58037f){_0x53fde8=_0x53fde8-0x0;var _0x18decb=_0x072e[_0x53fde8];return _0x18decb;};'use strict';var Sequelize=require(_0xe072('0x0'));module['exports']={'integration':{'type':Sequelize[_0xe072('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xe072('0x1')]},'integrationId':{'type':Sequelize[_0xe072('0x2')]},'contacts':{'type':Sequelize[_0xe072('0x1')]},'uniqueid':{'type':Sequelize[_0xe072('0x1')]},'calleridnum':{'type':Sequelize[_0xe072('0x1')]},'calleridname':{'type':Sequelize[_0xe072('0x1')]},'queue':{'type':Sequelize[_0xe072('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xe072('0x1')]},'agentcalledAt':{'type':Sequelize[_0xe072('0x3')]},'agentconnectAt':{'type':Sequelize[_0xe072('0x3')]},'holdtime':{'type':Sequelize[_0xe072('0x2')]},'agentcomplete':{'type':Sequelize[_0xe072('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xe072('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe072('0x2')]},'reason':{'type':Sequelize[_0xe072('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xe072('0x3')]},'agentdump':{'type':Sequelize[_0xe072('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xe072('0x3')]},'lastevent':{'type':Sequelize[_0xe072('0x1')]},'channel':{'type':Sequelize[_0xe072('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xe072('0x1')]},'connectedlinenum':{'type':Sequelize[_0xe072('0x1')]},'connectedlinename':{'type':Sequelize[_0xe072('0x1')]},'language':{'type':Sequelize[_0xe072('0x1')]},'accountcode':{'type':Sequelize[_0xe072('0x1')]},'context':{'type':Sequelize[_0xe072('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xe072('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xe072('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xe072('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xe072('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xe072('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xe072('0x1')]},'destcontext':{'type':Sequelize[_0xe072('0x1')]},'destexten':{'type':Sequelize[_0xe072('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0xe072('0x1')]},'inReplyTo':{'type':Sequelize[_0xe072('0x1')]},'subject':{'type':Sequelize[_0xe072('0x1')]},'from':{'type':Sequelize[_0xe072('0x1')]},'to':{'type':Sequelize[_0xe072('0x1')]},'cc':{'type':Sequelize[_0xe072('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0xe072('0x5')]},'text':{'type':Sequelize[_0xe072('0x5')]},'status':{'type':Sequelize[_0xe072('0x6')](_0xe072('0x7'),_0xe072('0x8'),_0xe072('0x9'),_0xe072('0xa'))},'url':{'type':Sequelize[_0xe072('0x1')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0xe072('0x2')]}}; \ No newline at end of file +var _0xaf4e=['BOOLEAN','TEXT','ENUM','SENT','SENDING','FAILED','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x22cc4e,_0xba93df){var _0x58269a=function(_0x8f95ad){while(--_0x8f95ad){_0x22cc4e['push'](_0x22cc4e['shift']());}};_0x58269a(++_0xba93df);}(_0xaf4e,0x74));var _0xeaf4=function(_0x119060,_0x148c65){_0x119060=_0x119060-0x0;var _0x3be718=_0xaf4e[_0x119060];return _0x3be718;};'use strict';var Sequelize=require(_0xeaf4('0x0'));module[_0xeaf4('0x1')]={'integration':{'type':Sequelize[_0xeaf4('0x2')]},'eventChannel':{'type':Sequelize[_0xeaf4('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xeaf4('0x2')]},'integrationId':{'type':Sequelize[_0xeaf4('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xeaf4('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xeaf4('0x2')]},'queue':{'type':Sequelize[_0xeaf4('0x2')]},'interface':{'type':Sequelize[_0xeaf4('0x2')]},'membername':{'type':Sequelize[_0xeaf4('0x2')]},'agentcalledAt':{'type':Sequelize[_0xeaf4('0x4')]},'agentconnectAt':{'type':Sequelize[_0xeaf4('0x4')]},'holdtime':{'type':Sequelize[_0xeaf4('0x3')]},'agentcomplete':{'type':Sequelize[_0xeaf4('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0xeaf4('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xeaf4('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0xeaf4('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xeaf4('0x4')]},'agentdump':{'type':Sequelize[_0xeaf4('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xeaf4('0x4')]},'lastevent':{'type':Sequelize[_0xeaf4('0x2')]},'channel':{'type':Sequelize[_0xeaf4('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xeaf4('0x2')]},'connectedlinenum':{'type':Sequelize[_0xeaf4('0x2')]},'connectedlinename':{'type':Sequelize[_0xeaf4('0x2')]},'language':{'type':Sequelize[_0xeaf4('0x2')]},'accountcode':{'type':Sequelize[_0xeaf4('0x2')]},'context':{'type':Sequelize[_0xeaf4('0x2')]},'exten':{'type':Sequelize[_0xeaf4('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xeaf4('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xeaf4('0x2')]},'destcalleridnum':{'type':Sequelize[_0xeaf4('0x2')]},'destcalleridname':{'type':Sequelize[_0xeaf4('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xeaf4('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xeaf4('0x2')]},'destlanguage':{'type':Sequelize[_0xeaf4('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xeaf4('0x2')]},'destexten':{'type':Sequelize[_0xeaf4('0x2')]},'destpriority':{'type':Sequelize[_0xeaf4('0x2')]},'destuniqueid':{'type':Sequelize[_0xeaf4('0x2')]},'messageId':{'type':Sequelize[_0xeaf4('0x2')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0xeaf4('0x2')]},'from':{'type':Sequelize[_0xeaf4('0x2')]},'to':{'type':Sequelize[_0xeaf4('0x2')]},'cc':{'type':Sequelize[_0xeaf4('0x2')]},'attachment':{'type':Sequelize[_0xeaf4('0x6')]},'html':{'type':Sequelize[_0xeaf4('0x6')]},'text':{'type':Sequelize[_0xeaf4('0x6')]},'status':{'type':Sequelize[_0xeaf4('0x7')](_0xeaf4('0x8'),_0xeaf4('0x9'),'RECEIVED',_0xeaf4('0xa'))},'url':{'type':Sequelize[_0xeaf4('0x2')]},'app':{'type':Sequelize[_0xeaf4('0x2')]},'appdata':{'type':Sequelize[_0xeaf4('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 78866da..4a2cd08 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 _0x3213=['include','findAll','rows','catch','show','params','fields','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','json','undefined','offset','count','limit','status','set','Content-Range','reject','save','update','then','destroy','error','stack','name','map','IntegrationReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll'];(function(_0x5225c4,_0x488ac7){var _0x4a845f=function(_0x2e85ed){while(--_0x2e85ed){_0x5225c4['push'](_0x5225c4['shift']());}};_0x4a845f(++_0x488ac7);}(_0x3213,0x182));var _0x3321=function(_0x144af5,_0x1e78e8){_0x144af5=_0x144af5-0x0;var _0x3bbcb8=_0x3213[_0x144af5];return _0x3bbcb8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3321('0x0'));var zipdir=require(_0x3321('0x1'));var jsonpatch=require(_0x3321('0x2'));var rp=require(_0x3321('0x3'));var moment=require(_0x3321('0x4'));var BPromise=require(_0x3321('0x5'));var Mustache=require(_0x3321('0x6'));var util=require(_0x3321('0x7'));var path=require(_0x3321('0x8'));var sox=require(_0x3321('0x9'));var csv=require(_0x3321('0xa'));var ejs=require(_0x3321('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3321('0xc'));var crypto=require(_0x3321('0xd'));var jsforce=require(_0x3321('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3321('0xf'));var Papa=require(_0x3321('0x10'));var Redis=require(_0x3321('0x11'));var authService=require(_0x3321('0x12'));var qs=require(_0x3321('0x13'));var as=require(_0x3321('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3321('0x15'))(_0x3321('0x16'));var utils=require(_0x3321('0x17'));var config=require(_0x3321('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13f819,_0x2c36fd){_0x2c36fd=_0x2c36fd||0xcc;return function(_0x55d3eb){if(_0x55d3eb){return _0x13f819[_0x3321('0x19')](_0x2c36fd);}return _0x13f819['status'](_0x2c36fd)[_0x3321('0x1a')]();};}function respondWithResult(_0x4fcc9c,_0x4e6c94){_0x4e6c94=_0x4e6c94||0xc8;return function(_0x344255){if(_0x344255){return _0x4fcc9c['status'](_0x4e6c94)[_0x3321('0x1b')](_0x344255);}};}function respondWithFilteredResult(_0x4f5233,_0x4c9ae2){return function(_0x10e40e){if(_0x10e40e){var _0x15d9c1=typeof _0x4c9ae2['offset']===_0x3321('0x1c')&&typeof _0x4c9ae2['limit']===_0x3321('0x1c');var _0x6635b4=_0x10e40e['count'];var _0x3adefc=_0x15d9c1?0x0:_0x4c9ae2[_0x3321('0x1d')];var _0x3c8870=_0x15d9c1?_0x10e40e[_0x3321('0x1e')]:_0x4c9ae2[_0x3321('0x1d')]+_0x4c9ae2[_0x3321('0x1f')];var _0x3965b8;if(_0x3c8870>=_0x6635b4){_0x3c8870=_0x6635b4;_0x3965b8=0xc8;}else{_0x3965b8=0xce;}_0x4f5233[_0x3321('0x20')](_0x3965b8);return _0x4f5233[_0x3321('0x21')](_0x3321('0x22'),_0x3adefc+'-'+_0x3c8870+'/'+_0x6635b4)[_0x3321('0x1b')](_0x10e40e);}return null;};}function patchUpdates(_0x33da30){return function(_0x21b4d6){try{jsonpatch['apply'](_0x21b4d6,_0x33da30,!![]);}catch(_0x5af3ea){return BPromise[_0x3321('0x23')](_0x5af3ea);}return _0x21b4d6[_0x3321('0x24')]();};}function saveUpdates(_0x3ae963,_0x627b04){return function(_0x44c65a){if(_0x44c65a){return _0x44c65a[_0x3321('0x25')](_0x3ae963)[_0x3321('0x26')](function(_0x3b6ebc){return _0x3b6ebc;});}return null;};}function removeEntity(_0x5d3287,_0x21a34c){return function(_0x1dcdcf){if(_0x1dcdcf){return _0x1dcdcf[_0x3321('0x27')]()[_0x3321('0x26')](function(){_0x5d3287[_0x3321('0x20')](0xcc)[_0x3321('0x1a')]();});}};}function handleEntityNotFound(_0x187e83,_0x4b76e7){return function(_0x160d10){if(!_0x160d10){_0x187e83[_0x3321('0x19')](0x194);}return _0x160d10;};}function handleError(_0x36e88a,_0x3697a1){_0x3697a1=_0x3697a1||0x1f4;return function(_0x307840){logger[_0x3321('0x28')](_0x307840[_0x3321('0x29')]);if(_0x307840['name']){delete _0x307840[_0x3321('0x2a')];}_0x36e88a[_0x3321('0x20')](_0x3697a1)['send'](_0x307840);};}exports['index']=function(_0x233b74,_0x5eda36){var _0x3dbb59={},_0x1b0612={},_0x4186cd={'count':0x0,'rows':[]};var _0x23bd74=_[_0x3321('0x2b')](db[_0x3321('0x2c')][_0x3321('0x2d')],function(_0x293c2f){return{'name':_0x293c2f[_0x3321('0x2e')],'type':_0x293c2f[_0x3321('0x2f')]['key']};});_0x1b0612[_0x3321('0x30')]=_['map'](_0x23bd74,'name');_0x1b0612[_0x3321('0x31')]=_[_0x3321('0x32')](_0x233b74[_0x3321('0x31')]);_0x1b0612[_0x3321('0x33')]=_[_0x3321('0x34')](_0x1b0612[_0x3321('0x30')],_0x1b0612[_0x3321('0x31')]);_0x3dbb59[_0x3321('0x35')]=_['intersection'](_0x1b0612[_0x3321('0x30')],qs['fields'](_0x233b74[_0x3321('0x31')]['fields']));_0x3dbb59[_0x3321('0x35')]=_0x3dbb59['attributes'][_0x3321('0x36')]?_0x3dbb59[_0x3321('0x35')]:_0x1b0612[_0x3321('0x30')];if(!_0x233b74['query']['hasOwnProperty']('nolimit')){_0x3dbb59[_0x3321('0x1f')]=qs[_0x3321('0x1f')](_0x233b74[_0x3321('0x31')]['limit']);_0x3dbb59[_0x3321('0x1d')]=qs[_0x3321('0x1d')](_0x233b74['query'][_0x3321('0x1d')]);}_0x3dbb59[_0x3321('0x37')]=qs[_0x3321('0x38')](_0x233b74['query'][_0x3321('0x38')]);_0x3dbb59['where']=qs[_0x3321('0x33')](_[_0x3321('0x39')](_0x233b74[_0x3321('0x31')],_0x1b0612[_0x3321('0x33')]),_0x23bd74);if(_0x233b74['query']['filter']){_0x3dbb59[_0x3321('0x3a')]=_[_0x3321('0x3b')](_0x3dbb59[_0x3321('0x3a')],{'$or':_[_0x3321('0x2b')](_0x23bd74,function(_0x255e72){if(_0x255e72[_0x3321('0x2f')]!==_0x3321('0x3c')){var _0x525904={};_0x525904[_0x255e72[_0x3321('0x2a')]]={'$like':'%'+_0x233b74[_0x3321('0x31')][_0x3321('0x3d')]+'%'};return _0x525904;}})});}_0x3dbb59=_[_0x3321('0x3b')]({},_0x3dbb59,_0x233b74[_0x3321('0x3e')]);var _0xcfbeb={'where':_0x3dbb59[_0x3321('0x3a')]};return db[_0x3321('0x2c')]['count'](_0xcfbeb)[_0x3321('0x26')](function(_0x4fd655){_0x4186cd[_0x3321('0x1e')]=_0x4fd655;if(_0x233b74[_0x3321('0x31')][_0x3321('0x3f')]){_0x3dbb59[_0x3321('0x40')]=[{'all':!![]}];}return db[_0x3321('0x2c')][_0x3321('0x41')](_0x3dbb59);})[_0x3321('0x26')](function(_0x3fea75){_0x4186cd[_0x3321('0x42')]=_0x3fea75;return _0x4186cd;})[_0x3321('0x26')](respondWithFilteredResult(_0x5eda36,_0x3dbb59))[_0x3321('0x43')](handleError(_0x5eda36,null));};exports[_0x3321('0x44')]=function(_0x2d0483,_0x4fc968){var _0x2154a5={'raw':![],'where':{'id':_0x2d0483[_0x3321('0x45')]['id']}},_0x5d261a={};_0x5d261a[_0x3321('0x30')]=_[_0x3321('0x32')](db[_0x3321('0x2c')]['rawAttributes']);_0x5d261a[_0x3321('0x31')]=_['keys'](_0x2d0483['query']);_0x5d261a[_0x3321('0x33')]=_['intersection'](_0x5d261a[_0x3321('0x30')],_0x5d261a[_0x3321('0x31')]);_0x2154a5['attributes']=_[_0x3321('0x34')](_0x5d261a['model'],qs[_0x3321('0x46')](_0x2d0483[_0x3321('0x31')][_0x3321('0x46')]));_0x2154a5[_0x3321('0x35')]=_0x2154a5[_0x3321('0x35')][_0x3321('0x36')]?_0x2154a5['attributes']:_0x5d261a[_0x3321('0x30')];if(_0x2d0483[_0x3321('0x31')]['includeAll']){_0x2154a5['include']=[{'all':!![]}];}_0x2154a5=_[_0x3321('0x3b')]({},_0x2154a5,_0x2d0483['options']);return db[_0x3321('0x2c')][_0x3321('0x47')](_0x2154a5)[_0x3321('0x26')](handleEntityNotFound(_0x4fc968,null))[_0x3321('0x26')](respondWithResult(_0x4fc968,null))['catch'](handleError(_0x4fc968,null));};exports[_0x3321('0x48')]=function(_0x1d551a,_0x1986be){return db['IntegrationReport']['create'](_0x1d551a['body'],{})[_0x3321('0x26')](respondWithResult(_0x1986be,0xc9))[_0x3321('0x43')](handleError(_0x1986be,null));};exports[_0x3321('0x25')]=function(_0x116d52,_0x2e8318){if(_0x116d52[_0x3321('0x49')]['id']){delete _0x116d52[_0x3321('0x49')]['id'];}return db['IntegrationReport'][_0x3321('0x47')]({'where':{'id':_0x116d52['params']['id']}})[_0x3321('0x26')](handleEntityNotFound(_0x2e8318,null))['then'](saveUpdates(_0x116d52[_0x3321('0x49')],null))[_0x3321('0x26')](respondWithResult(_0x2e8318,null))[_0x3321('0x43')](handleError(_0x2e8318,null));};exports[_0x3321('0x27')]=function(_0x3474d9,_0x456363){return db[_0x3321('0x2c')]['find']({'where':{'id':_0x3474d9[_0x3321('0x45')]['id']}})[_0x3321('0x26')](handleEntityNotFound(_0x456363,null))['then'](removeEntity(_0x456363,null))[_0x3321('0x43')](handleError(_0x456363,null));};exports[_0x3321('0x4a')]=function(_0x480585,_0x2a358a){return db['IntegrationReport'][_0x3321('0x4a')]()[_0x3321('0x26')](respondWithResult(_0x2a358a,null))[_0x3321('0x43')](handleError(_0x2a358a,null));}; \ No newline at end of file +var _0x4198=['index','map','IntegrationReport','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','merge','find','create','body','update','describe','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','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','end','json','offset','limit','undefined','count','status','set','apply','reject','save','then','destroy','error','name','send'];(function(_0x409a4e,_0x144bee){var _0x2e9d12=function(_0x5c1486){while(--_0x5c1486){_0x409a4e['push'](_0x409a4e['shift']());}};_0x2e9d12(++_0x144bee);}(_0x4198,0x10a));var _0x8419=function(_0x2ec992,_0x2ebbac){_0x2ec992=_0x2ec992-0x0;var _0x385b8c=_0x4198[_0x2ec992];return _0x385b8c;};'use strict';var emlformat=require(_0x8419('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8419('0x1'));var rp=require('request-promise');var moment=require(_0x8419('0x2'));var BPromise=require(_0x8419('0x3'));var Mustache=require(_0x8419('0x4'));var util=require('util');var path=require(_0x8419('0x5'));var sox=require(_0x8419('0x6'));var csv=require(_0x8419('0x7'));var ejs=require(_0x8419('0x8'));var fs=require('fs');var fs_extra=require(_0x8419('0x9'));var _=require(_0x8419('0xa'));var squel=require(_0x8419('0xb'));var crypto=require(_0x8419('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8419('0xd'));var toCsv=require(_0x8419('0x7'));var querystring=require(_0x8419('0xe'));var Papa=require(_0x8419('0xf'));var Redis=require('ioredis');var authService=require(_0x8419('0x10'));var qs=require(_0x8419('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8419('0x12'));var logger=require(_0x8419('0x13'))(_0x8419('0x14'));var utils=require(_0x8419('0x15'));var config=require(_0x8419('0x16'));var licenseUtil=require(_0x8419('0x17'));var db=require(_0x8419('0x18'))['db'];function respondWithStatusCode(_0x144e23,_0x3cb763){_0x3cb763=_0x3cb763||0xcc;return function(_0x55c690){if(_0x55c690){return _0x144e23[_0x8419('0x19')](_0x3cb763);}return _0x144e23['status'](_0x3cb763)[_0x8419('0x1a')]();};}function respondWithResult(_0x1ae301,_0x27974b){_0x27974b=_0x27974b||0xc8;return function(_0x3cd9d9){if(_0x3cd9d9){return _0x1ae301['status'](_0x27974b)[_0x8419('0x1b')](_0x3cd9d9);}};}function respondWithFilteredResult(_0xec5324,_0x30c989){return function(_0x39a6d0){if(_0x39a6d0){var _0x24bde6=typeof _0x30c989[_0x8419('0x1c')]==='undefined'&&typeof _0x30c989[_0x8419('0x1d')]===_0x8419('0x1e');var _0x2609d9=_0x39a6d0[_0x8419('0x1f')];var _0xffbe0d=_0x24bde6?0x0:_0x30c989[_0x8419('0x1c')];var _0x1d3283=_0x24bde6?_0x39a6d0['count']:_0x30c989[_0x8419('0x1c')]+_0x30c989[_0x8419('0x1d')];var _0xfd9807;if(_0x1d3283>=_0x2609d9){_0x1d3283=_0x2609d9;_0xfd9807=0xc8;}else{_0xfd9807=0xce;}_0xec5324[_0x8419('0x20')](_0xfd9807);return _0xec5324[_0x8419('0x21')]('Content-Range',_0xffbe0d+'-'+_0x1d3283+'/'+_0x2609d9)[_0x8419('0x1b')](_0x39a6d0);}return null;};}function patchUpdates(_0x4619a6){return function(_0x18f2c7){try{jsonpatch[_0x8419('0x22')](_0x18f2c7,_0x4619a6,!![]);}catch(_0x1a0946){return BPromise[_0x8419('0x23')](_0x1a0946);}return _0x18f2c7[_0x8419('0x24')]();};}function saveUpdates(_0x4b0d03,_0x254b70){return function(_0x52f328){if(_0x52f328){return _0x52f328['update'](_0x4b0d03)[_0x8419('0x25')](function(_0x2c9dc5){return _0x2c9dc5;});}return null;};}function removeEntity(_0x2ad3a7,_0x26bf0d){return function(_0x2a3777){if(_0x2a3777){return _0x2a3777[_0x8419('0x26')]()[_0x8419('0x25')](function(){_0x2ad3a7[_0x8419('0x20')](0xcc)[_0x8419('0x1a')]();});}};}function handleEntityNotFound(_0x5d9d58,_0x14947e){return function(_0x164b0d){if(!_0x164b0d){_0x5d9d58[_0x8419('0x19')](0x194);}return _0x164b0d;};}function handleError(_0xd1340c,_0x23def2){_0x23def2=_0x23def2||0x1f4;return function(_0xe9b541){logger[_0x8419('0x27')](_0xe9b541['stack']);if(_0xe9b541[_0x8419('0x28')]){delete _0xe9b541[_0x8419('0x28')];}_0xd1340c[_0x8419('0x20')](_0x23def2)[_0x8419('0x29')](_0xe9b541);};}exports[_0x8419('0x2a')]=function(_0x48777e,_0x495ad0){var _0x430e25={},_0xdfc6e9={},_0x4d9351={'count':0x0,'rows':[]};var _0x17f1e1=_[_0x8419('0x2b')](db[_0x8419('0x2c')][_0x8419('0x2d')],function(_0x16bd8b){return{'name':_0x16bd8b[_0x8419('0x2e')],'type':_0x16bd8b[_0x8419('0x2f')]['key']};});_0xdfc6e9[_0x8419('0x30')]=_['map'](_0x17f1e1,'name');_0xdfc6e9['query']=_['keys'](_0x48777e[_0x8419('0x31')]);_0xdfc6e9[_0x8419('0x32')]=_[_0x8419('0x33')](_0xdfc6e9[_0x8419('0x30')],_0xdfc6e9[_0x8419('0x31')]);_0x430e25['attributes']=_[_0x8419('0x33')](_0xdfc6e9['model'],qs['fields'](_0x48777e[_0x8419('0x31')][_0x8419('0x34')]));_0x430e25['attributes']=_0x430e25[_0x8419('0x35')][_0x8419('0x36')]?_0x430e25[_0x8419('0x35')]:_0xdfc6e9[_0x8419('0x30')];if(!_0x48777e[_0x8419('0x31')][_0x8419('0x37')](_0x8419('0x38'))){_0x430e25['limit']=qs[_0x8419('0x1d')](_0x48777e[_0x8419('0x31')]['limit']);_0x430e25['offset']=qs[_0x8419('0x1c')](_0x48777e[_0x8419('0x31')]['offset']);}_0x430e25[_0x8419('0x39')]=qs['sort'](_0x48777e['query'][_0x8419('0x3a')]);_0x430e25[_0x8419('0x3b')]=qs[_0x8419('0x32')](_[_0x8419('0x3c')](_0x48777e[_0x8419('0x31')],_0xdfc6e9[_0x8419('0x32')]),_0x17f1e1);if(_0x48777e[_0x8419('0x31')][_0x8419('0x3d')]){_0x430e25[_0x8419('0x3b')]=_['merge'](_0x430e25[_0x8419('0x3b')],{'$or':_['map'](_0x17f1e1,function(_0x501f74){if(_0x501f74[_0x8419('0x2f')]!==_0x8419('0x3e')){var _0x138d14={};_0x138d14[_0x501f74[_0x8419('0x28')]]={'$like':'%'+_0x48777e[_0x8419('0x31')][_0x8419('0x3d')]+'%'};return _0x138d14;}})});}_0x430e25=_['merge']({},_0x430e25,_0x48777e[_0x8419('0x3f')]);var _0x4a62fa={'where':_0x430e25[_0x8419('0x3b')]};return db[_0x8419('0x2c')][_0x8419('0x1f')](_0x4a62fa)[_0x8419('0x25')](function(_0xcf023){_0x4d9351[_0x8419('0x1f')]=_0xcf023;if(_0x48777e['query'][_0x8419('0x40')]){_0x430e25[_0x8419('0x41')]=[{'all':!![]}];}return db[_0x8419('0x2c')][_0x8419('0x42')](_0x430e25);})[_0x8419('0x25')](function(_0x25d959){_0x4d9351['rows']=_0x25d959;return _0x4d9351;})[_0x8419('0x25')](respondWithFilteredResult(_0x495ad0,_0x430e25))[_0x8419('0x43')](handleError(_0x495ad0,null));};exports[_0x8419('0x44')]=function(_0x24d221,_0x56419a){var _0x5d8650={'raw':![],'where':{'id':_0x24d221[_0x8419('0x45')]['id']}},_0x3fdb04={};_0x3fdb04[_0x8419('0x30')]=_[_0x8419('0x46')](db[_0x8419('0x2c')]['rawAttributes']);_0x3fdb04[_0x8419('0x31')]=_[_0x8419('0x46')](_0x24d221['query']);_0x3fdb04[_0x8419('0x32')]=_[_0x8419('0x33')](_0x3fdb04['model'],_0x3fdb04[_0x8419('0x31')]);_0x5d8650[_0x8419('0x35')]=_[_0x8419('0x33')](_0x3fdb04[_0x8419('0x30')],qs['fields'](_0x24d221[_0x8419('0x31')][_0x8419('0x34')]));_0x5d8650['attributes']=_0x5d8650[_0x8419('0x35')][_0x8419('0x36')]?_0x5d8650[_0x8419('0x35')]:_0x3fdb04[_0x8419('0x30')];if(_0x24d221['query'][_0x8419('0x40')]){_0x5d8650[_0x8419('0x41')]=[{'all':!![]}];}_0x5d8650=_[_0x8419('0x47')]({},_0x5d8650,_0x24d221[_0x8419('0x3f')]);return db[_0x8419('0x2c')][_0x8419('0x48')](_0x5d8650)[_0x8419('0x25')](handleEntityNotFound(_0x56419a,null))[_0x8419('0x25')](respondWithResult(_0x56419a,null))[_0x8419('0x43')](handleError(_0x56419a,null));};exports[_0x8419('0x49')]=function(_0x43dea6,_0x5e99e3){return db[_0x8419('0x2c')]['create'](_0x43dea6[_0x8419('0x4a')],{})[_0x8419('0x25')](respondWithResult(_0x5e99e3,0xc9))['catch'](handleError(_0x5e99e3,null));};exports[_0x8419('0x4b')]=function(_0x4d02a9,_0xac93f9){if(_0x4d02a9['body']['id']){delete _0x4d02a9[_0x8419('0x4a')]['id'];}return db['IntegrationReport'][_0x8419('0x48')]({'where':{'id':_0x4d02a9[_0x8419('0x45')]['id']}})[_0x8419('0x25')](handleEntityNotFound(_0xac93f9,null))['then'](saveUpdates(_0x4d02a9[_0x8419('0x4a')],null))[_0x8419('0x25')](respondWithResult(_0xac93f9,null))[_0x8419('0x43')](handleError(_0xac93f9,null));};exports[_0x8419('0x26')]=function(_0x18ae49,_0x54c842){return db['IntegrationReport']['find']({'where':{'id':_0x18ae49['params']['id']}})[_0x8419('0x25')](handleEntityNotFound(_0x54c842,null))[_0x8419('0x25')](removeEntity(_0x54c842,null))[_0x8419('0x43')](handleError(_0x54c842,null));};exports[_0x8419('0x4c')]=function(_0x3c3004,_0x24ac5a){return db[_0x8419('0x2c')][_0x8419('0x4c')]()[_0x8419('0x25')](respondWithResult(_0x24ac5a,null))[_0x8419('0x43')](handleError(_0x24ac5a,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 6ced90d..5f01bc2 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 _0xf074=['util','api','moment','bluebird','request-promise','path','rimraf','./integrationReport.attributes','exports','define','IntegrationReport','report_integration','lodash'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xf074,0x185));var _0x4f07=function(_0x374f83,_0x21fb70){_0x374f83=_0x374f83-0x0;var _0x145058=_0xf074[_0x374f83];return _0x145058;};'use strict';var _=require(_0x4f07('0x0'));var util=require(_0x4f07('0x1'));var logger=require('../../config/logger')(_0x4f07('0x2'));var moment=require(_0x4f07('0x3'));var BPromise=require(_0x4f07('0x4'));var rp=require(_0x4f07('0x5'));var fs=require('fs');var path=require(_0x4f07('0x6'));var rimraf=require(_0x4f07('0x7'));var config=require('../../config/environment');var attributes=require(_0x4f07('0x8'));module[_0x4f07('0x9')]=function(_0x4fa269,_0x17d005){return _0x4fa269[_0x4f07('0xa')](_0x4f07('0xb'),attributes,{'tableName':_0x4f07('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ab6=['path','rimraf','../../config/environment','./integrationReport.attributes','define','IntegrationReport','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4c852a,_0x528403){var _0x20b14d=function(_0x3e41e7){while(--_0x3e41e7){_0x4c852a['push'](_0x4c852a['shift']());}};_0x20b14d(++_0x528403);}(_0x2ab6,0xae));var _0x62ab=function(_0x5e6523,_0x4771e7){_0x5e6523=_0x5e6523-0x0;var _0x360b00=_0x2ab6[_0x5e6523];return _0x360b00;};'use strict';var _=require(_0x62ab('0x0'));var util=require(_0x62ab('0x1'));var logger=require(_0x62ab('0x2'))(_0x62ab('0x3'));var moment=require('moment');var BPromise=require(_0x62ab('0x4'));var rp=require(_0x62ab('0x5'));var fs=require('fs');var path=require(_0x62ab('0x6'));var rimraf=require(_0x62ab('0x7'));var config=require(_0x62ab('0x8'));var attributes=require(_0x62ab('0x9'));module['exports']=function(_0x290fac,_0x549c10){return _0x290fac[_0x62ab('0xa')](_0x62ab('0xb'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index bd24f32..d849344 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 _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x334fea,_0x1f1e18){var _0x3c5829=function(_0x4fd6ac){while(--_0x4fd6ac){_0x334fea['push'](_0x334fea['shift']());}};_0x3c5829(++_0x1f1e18);}(_0xf494,0x1c6));var _0x4f49=function(_0x5b79dc,_0x23a5ad){_0x5b79dc=_0x5b79dc-0x0;var _0x3d8485=_0xf494[_0x5b79dc];return _0x3d8485;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});} \ No newline at end of file +var _0x1967=['then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\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(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0x1967,0x173));var _0x7196=function(_0x56428a,_0x5710b4){_0x56428a=_0x56428a-0x0;var _0x36e063=_0x1967[_0x56428a];return _0x36e063;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index b33edf5..5c86048 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 _0x812d=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./interval.controller','get','isAuthenticated','/:id','/:id/sub_intervals','getIntervals','post','addInterval','addIntervals','put','update','delete','destroy','exports'];(function(_0x2aa6cf,_0x46b0b4){var _0x489483=function(_0x177549){while(--_0x177549){_0x2aa6cf['push'](_0x2aa6cf['shift']());}};_0x489483(++_0x46b0b4);}(_0x812d,0x6e));var _0xd812=function(_0x458eb4,_0x45a484){_0x458eb4=_0x458eb4-0x0;var _0xb08454=_0x812d[_0x458eb4];return _0xb08454;};'use strict';var multer=require('multer');var util=require(_0xd812('0x0'));var path=require(_0xd812('0x1'));var timeout=require(_0xd812('0x2'));var express=require(_0xd812('0x3'));var router=express[_0xd812('0x4')]();var fs_extra=require(_0xd812('0x5'));var auth=require(_0xd812('0x6'));var interaction=require(_0xd812('0x7'));var config=require('../../config/environment');var controller=require(_0xd812('0x8'));router[_0xd812('0x9')]('/',auth[_0xd812('0xa')](),controller['index']);router['get'](_0xd812('0xb'),auth[_0xd812('0xa')](),controller['show']);router[_0xd812('0x9')](_0xd812('0xc'),auth['isAuthenticated'](),controller[_0xd812('0xd')]);router[_0xd812('0xe')]('/',auth[_0xd812('0xa')](),controller['create']);router[_0xd812('0xe')]('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0xd812('0xf')]);router['post']('/:id/sub_intervals/create_many',auth[_0xd812('0xa')](),controller[_0xd812('0x10')]);router[_0xd812('0x11')]('/:id',auth[_0xd812('0xa')](),controller[_0xd812('0x12')]);router[_0xd812('0x13')](_0xd812('0xb'),auth[_0xd812('0xa')](),controller[_0xd812('0x14')]);module[_0xd812('0x15')]=router; \ No newline at end of file +var _0xfa9f=['delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./interval.controller','isAuthenticated','/:id','show','get','getIntervals','post','create','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update'];(function(_0x2536cc,_0x301663){var _0xfb9bab=function(_0x1f1c20){while(--_0x1f1c20){_0x2536cc['push'](_0x2536cc['shift']());}};_0xfb9bab(++_0x301663);}(_0xfa9f,0x93));var _0xffa9=function(_0x553150,_0x589ff3){_0x553150=_0x553150-0x0;var _0x18193d=_0xfa9f[_0x553150];return _0x18193d;};'use strict';var multer=require('multer');var util=require(_0xffa9('0x0'));var path=require(_0xffa9('0x1'));var timeout=require(_0xffa9('0x2'));var express=require(_0xffa9('0x3'));var router=express[_0xffa9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xffa9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xffa9('0x6'));var controller=require(_0xffa9('0x7'));router['get']('/',auth[_0xffa9('0x8')](),controller['index']);router['get'](_0xffa9('0x9'),auth[_0xffa9('0x8')](),controller[_0xffa9('0xa')]);router[_0xffa9('0xb')]('/:id/sub_intervals',auth[_0xffa9('0x8')](),controller[_0xffa9('0xc')]);router[_0xffa9('0xd')]('/',auth[_0xffa9('0x8')](),controller[_0xffa9('0xe')]);router[_0xffa9('0xd')](_0xffa9('0xf'),auth[_0xffa9('0x8')](),controller[_0xffa9('0x10')]);router[_0xffa9('0xd')](_0xffa9('0x11'),auth['isAuthenticated'](),controller[_0xffa9('0x12')]);router[_0xffa9('0x13')](_0xffa9('0x9'),auth[_0xffa9('0x8')](),controller[_0xffa9('0x14')]);router[_0xffa9('0x15')](_0xffa9('0x9'),auth[_0xffa9('0x8')](),controller[_0xffa9('0x16')]);module[_0xffa9('0x17')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 69817f9..4b1ff98 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 _0x8ad4=['STRING','sequelize','exports'];(function(_0x35b87c,_0x166a8c){var _0x24795b=function(_0x2cb112){while(--_0x2cb112){_0x35b87c['push'](_0x35b87c['shift']());}};_0x24795b(++_0x166a8c);}(_0x8ad4,0x19c));var _0x48ad=function(_0x1e7384,_0x1f0239){_0x1e7384=_0x1e7384-0x0;var _0x3d83a8=_0x8ad4[_0x1e7384];return _0x3d83a8;};'use strict';var Sequelize=require(_0x48ad('0x0'));module[_0x48ad('0x1')]={'name':{'type':Sequelize[_0x48ad('0x2')]},'description':{'type':Sequelize[_0x48ad('0x2')]},'interval':{'type':Sequelize[_0x48ad('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0xfdf6=['STRING','sequelize'];(function(_0x1118f3,_0x553c42){var _0x184c3c=function(_0x414838){while(--_0x414838){_0x1118f3['push'](_0x1118f3['shift']());}};_0x184c3c(++_0x553c42);}(_0xfdf6,0x1df));var _0x6fdf=function(_0x40b918,_0x3ff794){_0x40b918=_0x40b918-0x0;var _0xa0e480=_0xfdf6[_0x40b918];return _0xa0e480;};'use strict';var Sequelize=require(_0x6fdf('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6fdf('0x1')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 9f601c7..9a7ef00 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 _0x3f2b=['role','user','Intervals','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','IntervalId','getIntervals','findOne','order','options','hasOwnProperty','sequelize','transaction','bulkCreate','findAll','eml-format','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','destroy','then','get','UserProfileResource','error','stack','name','send','index','map','Interval','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','include','rows','catch','params','fields','includeAll','create','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x3f2b,0x12a));var _0xb3f2=function(_0x12ea29,_0x1848a2){_0x12ea29=_0x12ea29-0x0;var _0x329021=_0x3f2b[_0x12ea29];return _0x329021;};'use strict';var emlformat=require(_0xb3f2('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb3f2('0x1'));var moment=require(_0xb3f2('0x2'));var BPromise=require(_0xb3f2('0x3'));var Mustache=require('mustache');var util=require(_0xb3f2('0x4'));var path=require(_0xb3f2('0x5'));var sox=require(_0xb3f2('0x6'));var csv=require('to-csv');var ejs=require(_0xb3f2('0x7'));var fs=require('fs');var fs_extra=require(_0xb3f2('0x8'));var _=require(_0xb3f2('0x9'));var squel=require(_0xb3f2('0xa'));var crypto=require(_0xb3f2('0xb'));var jsforce=require(_0xb3f2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb3f2('0xd'));var querystring=require('querystring');var Papa=require(_0xb3f2('0xe'));var Redis=require(_0xb3f2('0xf'));var authService=require(_0xb3f2('0x10'));var qs=require(_0xb3f2('0x11'));var as=require(_0xb3f2('0x12'));var hardwareService=require(_0xb3f2('0x13'));var logger=require(_0xb3f2('0x14'))(_0xb3f2('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb3f2('0x16'));var db=require(_0xb3f2('0x17'))['db'];var extensions=require(_0xb3f2('0x18'));function respondWithStatusCode(_0x313c4d,_0xf104bb){_0xf104bb=_0xf104bb||0xcc;return function(_0x4a917c){if(_0x4a917c){return _0x313c4d[_0xb3f2('0x19')](_0xf104bb);}return _0x313c4d[_0xb3f2('0x1a')](_0xf104bb)[_0xb3f2('0x1b')]();};}function respondWithResult(_0x35f9de,_0x5f2066){_0x5f2066=_0x5f2066||0xc8;return function(_0x4bd8c5){if(_0x4bd8c5){return _0x35f9de[_0xb3f2('0x1a')](_0x5f2066)['json'](_0x4bd8c5);}};}function respondWithFilteredResult(_0x5aaadb,_0x5acd97){return function(_0x2caeb0){if(_0x2caeb0){var _0x382421=typeof _0x5acd97['offset']===_0xb3f2('0x1c')&&typeof _0x5acd97[_0xb3f2('0x1d')]===_0xb3f2('0x1c');var _0xa12705=_0x2caeb0[_0xb3f2('0x1e')];var _0x5bea26=_0x382421?0x0:_0x5acd97[_0xb3f2('0x1f')];var _0x6b9413=_0x382421?_0x2caeb0[_0xb3f2('0x1e')]:_0x5acd97[_0xb3f2('0x1f')]+_0x5acd97[_0xb3f2('0x1d')];var _0x3a67fa;if(_0x6b9413>=_0xa12705){_0x6b9413=_0xa12705;_0x3a67fa=0xc8;}else{_0x3a67fa=0xce;}_0x5aaadb[_0xb3f2('0x1a')](_0x3a67fa);return _0x5aaadb[_0xb3f2('0x20')]('Content-Range',_0x5bea26+'-'+_0x6b9413+'/'+_0xa12705)[_0xb3f2('0x21')](_0x2caeb0);}return null;};}function patchUpdates(_0x12d3b7){return function(_0x46fa39){try{jsonpatch[_0xb3f2('0x22')](_0x46fa39,_0x12d3b7,!![]);}catch(_0x4fb454){return BPromise['reject'](_0x4fb454);}return _0x46fa39[_0xb3f2('0x23')]();};}function saveUpdates(_0x3742cf,_0x2a35b5){return function(_0x47d990){if(_0x47d990){return _0x47d990[_0xb3f2('0x24')](_0x3742cf)['then'](function(_0x4e5fcb){return _0x4e5fcb;});}return null;};}function removeEntity(_0x15ab2f,_0x1f1a32){return function(_0x1481c4){if(_0x1481c4){return _0x1481c4[_0xb3f2('0x25')]()[_0xb3f2('0x26')](function(){var _0x1118b1=_0x1481c4[_0xb3f2('0x27')]({'plain':!![]});var _0x154c33='Intervals';return db[_0xb3f2('0x28')]['destroy']({'where':{'type':_0x154c33,'resourceId':_0x1118b1['id']}})[_0xb3f2('0x26')](function(){return _0x1481c4;});})[_0xb3f2('0x26')](function(){_0x15ab2f['status'](0xcc)[_0xb3f2('0x1b')]();});}};}function handleEntityNotFound(_0xa7f795,_0x3b9231){return function(_0x258ae0){if(!_0x258ae0){_0xa7f795[_0xb3f2('0x19')](0x194);}return _0x258ae0;};}function handleError(_0x2573a5,_0x5771e1){_0x5771e1=_0x5771e1||0x1f4;return function(_0x1c2478){logger[_0xb3f2('0x29')](_0x1c2478[_0xb3f2('0x2a')]);if(_0x1c2478[_0xb3f2('0x2b')]){delete _0x1c2478[_0xb3f2('0x2b')];}_0x2573a5[_0xb3f2('0x1a')](_0x5771e1)[_0xb3f2('0x2c')](_0x1c2478);};}exports[_0xb3f2('0x2d')]=function(_0x4799f6,_0x3382a5){var _0x2cacf0={},_0x25626f={},_0x1f1c82={'count':0x0,'rows':[]};var _0x24468b=_[_0xb3f2('0x2e')](db[_0xb3f2('0x2f')][_0xb3f2('0x30')],function(_0x3d10ad){return{'name':_0x3d10ad[_0xb3f2('0x31')],'type':_0x3d10ad['type'][_0xb3f2('0x32')]};});_0x25626f[_0xb3f2('0x33')]=_[_0xb3f2('0x2e')](_0x24468b,'name');_0x25626f[_0xb3f2('0x34')]=_[_0xb3f2('0x35')](_0x4799f6[_0xb3f2('0x34')]);_0x25626f[_0xb3f2('0x36')]=_['intersection'](_0x25626f['model'],_0x25626f[_0xb3f2('0x34')]);_0x2cacf0['attributes']=_[_0xb3f2('0x37')](_0x25626f['model'],qs['fields'](_0x4799f6[_0xb3f2('0x34')]['fields']));_0x2cacf0[_0xb3f2('0x38')]=_0x2cacf0[_0xb3f2('0x38')][_0xb3f2('0x39')]?_0x2cacf0['attributes']:_0x25626f['model'];if(!_0x4799f6[_0xb3f2('0x34')]['hasOwnProperty'](_0xb3f2('0x3a'))){_0x2cacf0[_0xb3f2('0x1d')]=qs['limit'](_0x4799f6['query'][_0xb3f2('0x1d')]);_0x2cacf0['offset']=qs[_0xb3f2('0x1f')](_0x4799f6['query']['offset']);}_0x2cacf0['order']=qs[_0xb3f2('0x3b')](_0x4799f6[_0xb3f2('0x34')]['sort']);_0x2cacf0[_0xb3f2('0x3c')]=qs[_0xb3f2('0x36')](_[_0xb3f2('0x3d')](_0x4799f6[_0xb3f2('0x34')],_0x25626f[_0xb3f2('0x36')]),_0x24468b);if(_0x4799f6[_0xb3f2('0x34')][_0xb3f2('0x3e')]){_0x2cacf0['where']=_[_0xb3f2('0x3f')](_0x2cacf0['where'],{'$or':_[_0xb3f2('0x2e')](_0x24468b,function(_0x583dd1){if(_0x583dd1[_0xb3f2('0x40')]!==_0xb3f2('0x41')){var _0x20bad8={};_0x20bad8[_0x583dd1['name']]={'$like':'%'+_0x4799f6['query']['filter']+'%'};return _0x20bad8;}})});}_0x2cacf0=_[_0xb3f2('0x3f')]({},_0x2cacf0,_0x4799f6['options']);var _0x3e7c2d={'where':_0x2cacf0[_0xb3f2('0x3c')]};return db[_0xb3f2('0x2f')][_0xb3f2('0x1e')](_0x3e7c2d)['then'](function(_0x5753aa){_0x1f1c82['count']=_0x5753aa;if(_0x4799f6[_0xb3f2('0x34')]['includeAll']){_0x2cacf0[_0xb3f2('0x42')]=[{'all':!![]}];}return db[_0xb3f2('0x2f')]['findAll'](_0x2cacf0);})['then'](function(_0x52754b){_0x1f1c82[_0xb3f2('0x43')]=_0x52754b;return _0x1f1c82;})[_0xb3f2('0x26')](respondWithFilteredResult(_0x3382a5,_0x2cacf0))[_0xb3f2('0x44')](handleError(_0x3382a5,null));};exports['show']=function(_0x247f36,_0x6cfa3b){var _0x1ea3b9={'raw':!![],'where':{'id':_0x247f36[_0xb3f2('0x45')]['id']}},_0x4d4c7a={};_0x4d4c7a['model']=_[_0xb3f2('0x35')](db[_0xb3f2('0x2f')]['rawAttributes']);_0x4d4c7a[_0xb3f2('0x34')]=_[_0xb3f2('0x35')](_0x247f36[_0xb3f2('0x34')]);_0x4d4c7a[_0xb3f2('0x36')]=_[_0xb3f2('0x37')](_0x4d4c7a[_0xb3f2('0x33')],_0x4d4c7a['query']);_0x1ea3b9[_0xb3f2('0x38')]=_[_0xb3f2('0x37')](_0x4d4c7a[_0xb3f2('0x33')],qs[_0xb3f2('0x46')](_0x247f36[_0xb3f2('0x34')][_0xb3f2('0x46')]));_0x1ea3b9[_0xb3f2('0x38')]=_0x1ea3b9[_0xb3f2('0x38')][_0xb3f2('0x39')]?_0x1ea3b9[_0xb3f2('0x38')]:_0x4d4c7a[_0xb3f2('0x33')];if(_0x247f36[_0xb3f2('0x34')][_0xb3f2('0x47')]){_0x1ea3b9[_0xb3f2('0x42')]=[{'all':!![]}];}_0x1ea3b9=_[_0xb3f2('0x3f')]({},_0x1ea3b9,_0x247f36['options']);return db[_0xb3f2('0x2f')]['find'](_0x1ea3b9)[_0xb3f2('0x26')](handleEntityNotFound(_0x6cfa3b,null))[_0xb3f2('0x26')](respondWithResult(_0x6cfa3b,null))[_0xb3f2('0x44')](handleError(_0x6cfa3b,null));};exports['create']=function(_0x19f76e,_0x1e1dff){return db['Interval'][_0xb3f2('0x48')](_0x19f76e['body'],{})[_0xb3f2('0x26')](function(_0xcf4b86){var _0x22b065=_0x19f76e['user'][_0xb3f2('0x27')]({'plain':!![]});if(!_0x22b065)throw new Error(_0xb3f2('0x49'));if(_0x22b065[_0xb3f2('0x4a')]===_0xb3f2('0x4b')){var _0x2b01a3=_0xcf4b86[_0xb3f2('0x27')]({'plain':!![]});var _0x305ee7=_0xb3f2('0x4c');return db[_0xb3f2('0x4d')][_0xb3f2('0x4e')]({'where':{'name':_0x305ee7,'userProfileId':_0x22b065[_0xb3f2('0x4f')]},'raw':!![]})[_0xb3f2('0x26')](function(_0x1b811c){if(_0x1b811c&&_0x1b811c['autoAssociation']===0x0){return db[_0xb3f2('0x28')][_0xb3f2('0x48')]({'name':_0x2b01a3[_0xb3f2('0x2b')],'resourceId':_0x2b01a3['id'],'type':_0x1b811c[_0xb3f2('0x2b')],'sectionId':_0x1b811c['id']},{})[_0xb3f2('0x26')](function(){return _0xcf4b86;});}else{return _0xcf4b86;}})[_0xb3f2('0x44')](function(_0x2ae028){logger[_0xb3f2('0x29')](_0xb3f2('0x50'),_0x2ae028);throw _0x2ae028;});}return _0xcf4b86;})[_0xb3f2('0x26')](respondWithResult(_0x1e1dff,0xc9))[_0xb3f2('0x44')](handleError(_0x1e1dff,null));};exports['update']=function(_0x240215,_0x6dc667){if(_0x240215['body']['id']){delete _0x240215['body']['id'];}return db[_0xb3f2('0x2f')][_0xb3f2('0x4e')]({'where':{'id':_0x240215[_0xb3f2('0x45')]['id']}})[_0xb3f2('0x26')](handleEntityNotFound(_0x6dc667,null))[_0xb3f2('0x26')](saveUpdates(_0x240215[_0xb3f2('0x51')],null))[_0xb3f2('0x26')](respondWithResult(_0x6dc667,null))[_0xb3f2('0x44')](handleError(_0x6dc667,null));};exports[_0xb3f2('0x25')]=function(_0xab11d8,_0x49726d){return db['Interval'][_0xb3f2('0x4e')]({'where':{'id':_0xab11d8['params']['id']}})[_0xb3f2('0x26')](handleEntityNotFound(_0x49726d,null))[_0xb3f2('0x26')](removeEntity(_0x49726d,null))['catch'](handleError(_0x49726d,null));};exports[_0xb3f2('0x52')]=function(_0x36d328,_0xb7d21,_0x52c817){if(_0x36d328[_0xb3f2('0x51')]['id']){delete _0x36d328[_0xb3f2('0x51')]['id'];}return db['Interval']['find']({'where':{'id':_0x36d328['params']['id']}})[_0xb3f2('0x26')](handleEntityNotFound(_0xb7d21,null))[_0xb3f2('0x26')](function(_0x78f37a){if(_0x78f37a){_0x36d328[_0xb3f2('0x51')][_0xb3f2('0x53')]=_0x78f37a['id'];return db[_0xb3f2('0x2f')][_0xb3f2('0x48')](_0x36d328[_0xb3f2('0x51')]);}})[_0xb3f2('0x26')](respondWithResult(_0xb7d21,null))[_0xb3f2('0x44')](handleError(_0xb7d21,null));};exports[_0xb3f2('0x54')]=function(_0x5026dd,_0x3bda75,_0x3f88ea){var _0x4d745b={};var _0x42fbe3={};var _0x19e806;var _0x48ab80;return db[_0xb3f2('0x2f')][_0xb3f2('0x55')]({'where':{'id':_0x5026dd['params']['id']}})[_0xb3f2('0x26')](handleEntityNotFound(_0x3bda75,null))[_0xb3f2('0x26')](function(_0x8b73d6){if(_0x8b73d6){_0x19e806=_0x8b73d6;_0x42fbe3[_0xb3f2('0x33')]=_[_0xb3f2('0x35')](db[_0xb3f2('0x2f')]['rawAttributes']);_0x42fbe3[_0xb3f2('0x34')]=_[_0xb3f2('0x35')](_0x5026dd[_0xb3f2('0x34')]);_0x42fbe3['filters']=_[_0xb3f2('0x37')](_0x42fbe3[_0xb3f2('0x33')],_0x42fbe3[_0xb3f2('0x34')]);_0x4d745b[_0xb3f2('0x38')]=_['intersection'](_0x42fbe3[_0xb3f2('0x33')],qs[_0xb3f2('0x46')](_0x5026dd['query'][_0xb3f2('0x46')]));_0x4d745b[_0xb3f2('0x38')]=_0x4d745b[_0xb3f2('0x38')][_0xb3f2('0x39')]?_0x4d745b['attributes']:_0x42fbe3['model'];_0x4d745b[_0xb3f2('0x56')]=qs[_0xb3f2('0x3b')](_0x5026dd[_0xb3f2('0x34')][_0xb3f2('0x3b')]);_0x4d745b[_0xb3f2('0x3c')]=qs[_0xb3f2('0x36')](_['pick'](_0x5026dd[_0xb3f2('0x34')],_0x42fbe3[_0xb3f2('0x36')]));if(_0x5026dd[_0xb3f2('0x34')][_0xb3f2('0x3e')]){_0x4d745b[_0xb3f2('0x3c')]=_[_0xb3f2('0x3f')](_0x4d745b[_0xb3f2('0x3c')],{'$or':_[_0xb3f2('0x2e')](_0x4d745b[_0xb3f2('0x38')],function(_0x25ffce){var _0x3b938b={};_0x3b938b[_0x25ffce]={'$like':'%'+_0x5026dd[_0xb3f2('0x34')][_0xb3f2('0x3e')]+'%'};return _0x3b938b;})});}_0x4d745b=_[_0xb3f2('0x3f')]({},_0x4d745b,_0x5026dd[_0xb3f2('0x57')]);return _0x19e806[_0xb3f2('0x54')](_0x4d745b);}})[_0xb3f2('0x26')](function(_0x46958a){if(_0x46958a){_0x48ab80=_0x46958a[_0xb3f2('0x39')];if(!_0x5026dd['query'][_0xb3f2('0x58')](_0xb3f2('0x3a'))){_0x4d745b[_0xb3f2('0x1d')]=qs[_0xb3f2('0x1d')](_0x5026dd[_0xb3f2('0x34')][_0xb3f2('0x1d')]);_0x4d745b[_0xb3f2('0x1f')]=qs[_0xb3f2('0x1f')](_0x5026dd['query'][_0xb3f2('0x1f')]);}return _0x19e806[_0xb3f2('0x54')](_0x4d745b);}})[_0xb3f2('0x26')](function(_0x4151b7){if(_0x4151b7){return _0x4151b7?{'count':_0x48ab80,'rows':_0x4151b7}:null;}})['then'](respondWithResult(_0x3bda75,null))[_0xb3f2('0x44')](handleError(_0x3bda75,null));};exports['addIntervals']=function(_0x7b51db,_0xdd3e9b,_0x5ca360){return db[_0xb3f2('0x2f')][_0xb3f2('0x55')]({'where':{'id':_0x7b51db[_0xb3f2('0x45')]['id']}})['then'](handleEntityNotFound(_0xdd3e9b,null))[_0xb3f2('0x26')](function(_0x3c05d0){if(_0x3c05d0){return db[_0xb3f2('0x59')][_0xb3f2('0x5a')](function(_0x419dfb){return db['Interval'][_0xb3f2('0x25')]({'where':{'IntervalId':_0x7b51db['params']['id']},'transaction':_0x419dfb})[_0xb3f2('0x26')](function(_0x2cbca5){var _0x2b4624=_[_0xb3f2('0x2e')](_0x7b51db[_0xb3f2('0x51')],function(_0x3569cc){delete _0x3569cc['id'];_0x3569cc[_0xb3f2('0x53')]=_0x7b51db[_0xb3f2('0x45')]['id'];return _0x3569cc;});return db[_0xb3f2('0x2f')][_0xb3f2('0x5b')](_0x2b4624,{'transaction':_0x419dfb});});})['then'](function(){return db['Interval'][_0xb3f2('0x5c')]({'where':{'IntervalId':_0x7b51db[_0xb3f2('0x45')]['id']}});});}})[_0xb3f2('0x26')](respondWithResult(_0xdd3e9b,null))['catch'](handleError(_0xdd3e9b,null));}; \ No newline at end of file +var _0xde7a=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','nolimit','addIntervals','findOne','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','map','Interval','fieldName','key','query','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','count','findAll','rows','catch','show','params','keys','rawAttributes','filters','length','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Intervals','UserProfileSection','autoAssociation'];(function(_0x2de778,_0x4cb6f1){var _0x3c6112=function(_0x32045d){while(--_0x32045d){_0x2de778['push'](_0x2de778['shift']());}};_0x3c6112(++_0x4cb6f1);}(_0xde7a,0x1ef));var _0xade7=function(_0x4ecd76,_0x79f1f3){_0x4ecd76=_0x4ecd76-0x0;var _0x240f34=_0xde7a[_0x4ecd76];return _0x240f34;};'use strict';var emlformat=require(_0xade7('0x0'));var rimraf=require(_0xade7('0x1'));var zipdir=require(_0xade7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xade7('0x3'));var moment=require(_0xade7('0x4'));var BPromise=require(_0xade7('0x5'));var Mustache=require(_0xade7('0x6'));var util=require(_0xade7('0x7'));var path=require(_0xade7('0x8'));var sox=require(_0xade7('0x9'));var csv=require(_0xade7('0xa'));var ejs=require(_0xade7('0xb'));var fs=require('fs');var fs_extra=require(_0xade7('0xc'));var _=require(_0xade7('0xd'));var squel=require(_0xade7('0xe'));var crypto=require(_0xade7('0xf'));var jsforce=require(_0xade7('0x10'));var deskjs=require(_0xade7('0x11'));var toCsv=require(_0xade7('0xa'));var querystring=require(_0xade7('0x12'));var Papa=require(_0xade7('0x13'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xade7('0x14'));var as=require(_0xade7('0x15'));var hardwareService=require(_0xade7('0x16'));var logger=require(_0xade7('0x17'))(_0xade7('0x18'));var utils=require(_0xade7('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xade7('0x1a'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x24abe4,_0x2c6369){_0x2c6369=_0x2c6369||0xcc;return function(_0x6cafd4){if(_0x6cafd4){return _0x24abe4[_0xade7('0x1b')](_0x2c6369);}return _0x24abe4[_0xade7('0x1c')](_0x2c6369)[_0xade7('0x1d')]();};}function respondWithResult(_0x44addc,_0x3d10eb){_0x3d10eb=_0x3d10eb||0xc8;return function(_0x56cfc4){if(_0x56cfc4){return _0x44addc[_0xade7('0x1c')](_0x3d10eb)[_0xade7('0x1e')](_0x56cfc4);}};}function respondWithFilteredResult(_0x391d07,_0x9fc73e){return function(_0x15a926){if(_0x15a926){var _0x2c9bc7=typeof _0x9fc73e[_0xade7('0x1f')]===_0xade7('0x20')&&typeof _0x9fc73e[_0xade7('0x21')]===_0xade7('0x20');var _0x427870=_0x15a926['count'];var _0x5e478c=_0x2c9bc7?0x0:_0x9fc73e[_0xade7('0x1f')];var _0x3f9163=_0x2c9bc7?_0x15a926['count']:_0x9fc73e[_0xade7('0x1f')]+_0x9fc73e[_0xade7('0x21')];var _0x28351b;if(_0x3f9163>=_0x427870){_0x3f9163=_0x427870;_0x28351b=0xc8;}else{_0x28351b=0xce;}_0x391d07['status'](_0x28351b);return _0x391d07[_0xade7('0x22')](_0xade7('0x23'),_0x5e478c+'-'+_0x3f9163+'/'+_0x427870)[_0xade7('0x1e')](_0x15a926);}return null;};}function patchUpdates(_0x5bdfa5){return function(_0x33ab45){try{jsonpatch['apply'](_0x33ab45,_0x5bdfa5,!![]);}catch(_0x3e7d03){return BPromise[_0xade7('0x24')](_0x3e7d03);}return _0x33ab45[_0xade7('0x25')]();};}function saveUpdates(_0x1920ca,_0x40a076){return function(_0xcf1047){if(_0xcf1047){return _0xcf1047[_0xade7('0x26')](_0x1920ca)[_0xade7('0x27')](function(_0x46140a){return _0x46140a;});}return null;};}function removeEntity(_0x3296e1,_0x2f0aec){return function(_0x1a5fa9){if(_0x1a5fa9){return _0x1a5fa9['destroy']()[_0xade7('0x27')](function(){var _0x16c1bb=_0x1a5fa9[_0xade7('0x28')]({'plain':!![]});var _0x39080c='Intervals';return db[_0xade7('0x29')][_0xade7('0x2a')]({'where':{'type':_0x39080c,'resourceId':_0x16c1bb['id']}})['then'](function(){return _0x1a5fa9;});})[_0xade7('0x27')](function(){_0x3296e1['status'](0xcc)[_0xade7('0x1d')]();});}};}function handleEntityNotFound(_0x1acd67,_0x19b2ae){return function(_0x377921){if(!_0x377921){_0x1acd67[_0xade7('0x1b')](0x194);}return _0x377921;};}function handleError(_0x216d37,_0x27930d){_0x27930d=_0x27930d||0x1f4;return function(_0x104a1c){logger[_0xade7('0x2b')](_0x104a1c[_0xade7('0x2c')]);if(_0x104a1c['name']){delete _0x104a1c[_0xade7('0x2d')];}_0x216d37['status'](_0x27930d)[_0xade7('0x2e')](_0x104a1c);};}exports[_0xade7('0x2f')]=function(_0x1dc51e,_0x4e56d4){var _0xbbc6ad={},_0x48c33b={},_0x562555={'count':0x0,'rows':[]};var _0x3ddfb5=_[_0xade7('0x30')](db[_0xade7('0x31')]['rawAttributes'],function(_0x389555){return{'name':_0x389555[_0xade7('0x32')],'type':_0x389555['type'][_0xade7('0x33')]};});_0x48c33b['model']=_[_0xade7('0x30')](_0x3ddfb5,'name');_0x48c33b[_0xade7('0x34')]=_['keys'](_0x1dc51e['query']);_0x48c33b['filters']=_[_0xade7('0x35')](_0x48c33b[_0xade7('0x36')],_0x48c33b['query']);_0xbbc6ad['attributes']=_[_0xade7('0x35')](_0x48c33b['model'],qs[_0xade7('0x37')](_0x1dc51e['query'][_0xade7('0x37')]));_0xbbc6ad[_0xade7('0x38')]=_0xbbc6ad[_0xade7('0x38')]['length']?_0xbbc6ad[_0xade7('0x38')]:_0x48c33b[_0xade7('0x36')];if(!_0x1dc51e[_0xade7('0x34')][_0xade7('0x39')]('nolimit')){_0xbbc6ad[_0xade7('0x21')]=qs['limit'](_0x1dc51e[_0xade7('0x34')][_0xade7('0x21')]);_0xbbc6ad[_0xade7('0x1f')]=qs['offset'](_0x1dc51e[_0xade7('0x34')]['offset']);}_0xbbc6ad[_0xade7('0x3a')]=qs[_0xade7('0x3b')](_0x1dc51e['query'][_0xade7('0x3b')]);_0xbbc6ad[_0xade7('0x3c')]=qs['filters'](_[_0xade7('0x3d')](_0x1dc51e[_0xade7('0x34')],_0x48c33b['filters']),_0x3ddfb5);if(_0x1dc51e['query']['filter']){_0xbbc6ad['where']=_[_0xade7('0x3e')](_0xbbc6ad[_0xade7('0x3c')],{'$or':_[_0xade7('0x30')](_0x3ddfb5,function(_0x2960f8){if(_0x2960f8[_0xade7('0x3f')]!==_0xade7('0x40')){var _0x468fac={};_0x468fac[_0x2960f8[_0xade7('0x2d')]]={'$like':'%'+_0x1dc51e[_0xade7('0x34')][_0xade7('0x41')]+'%'};return _0x468fac;}})});}_0xbbc6ad=_['merge']({},_0xbbc6ad,_0x1dc51e[_0xade7('0x42')]);var _0x107cf4={'where':_0xbbc6ad[_0xade7('0x3c')]};return db[_0xade7('0x31')][_0xade7('0x43')](_0x107cf4)[_0xade7('0x27')](function(_0x51a6ea){_0x562555[_0xade7('0x43')]=_0x51a6ea;if(_0x1dc51e[_0xade7('0x34')]['includeAll']){_0xbbc6ad['include']=[{'all':!![]}];}return db[_0xade7('0x31')][_0xade7('0x44')](_0xbbc6ad);})[_0xade7('0x27')](function(_0x498b97){_0x562555[_0xade7('0x45')]=_0x498b97;return _0x562555;})[_0xade7('0x27')](respondWithFilteredResult(_0x4e56d4,_0xbbc6ad))[_0xade7('0x46')](handleError(_0x4e56d4,null));};exports[_0xade7('0x47')]=function(_0x497af9,_0x7f727b){var _0x2fc375={'raw':!![],'where':{'id':_0x497af9[_0xade7('0x48')]['id']}},_0x3c1332={};_0x3c1332[_0xade7('0x36')]=_[_0xade7('0x49')](db[_0xade7('0x31')][_0xade7('0x4a')]);_0x3c1332[_0xade7('0x34')]=_['keys'](_0x497af9[_0xade7('0x34')]);_0x3c1332[_0xade7('0x4b')]=_[_0xade7('0x35')](_0x3c1332['model'],_0x3c1332[_0xade7('0x34')]);_0x2fc375[_0xade7('0x38')]=_[_0xade7('0x35')](_0x3c1332[_0xade7('0x36')],qs['fields'](_0x497af9['query'][_0xade7('0x37')]));_0x2fc375['attributes']=_0x2fc375[_0xade7('0x38')][_0xade7('0x4c')]?_0x2fc375[_0xade7('0x38')]:_0x3c1332[_0xade7('0x36')];if(_0x497af9[_0xade7('0x34')]['includeAll']){_0x2fc375[_0xade7('0x4d')]=[{'all':!![]}];}_0x2fc375=_[_0xade7('0x3e')]({},_0x2fc375,_0x497af9[_0xade7('0x42')]);return db[_0xade7('0x31')][_0xade7('0x4e')](_0x2fc375)['then'](handleEntityNotFound(_0x7f727b,null))[_0xade7('0x27')](respondWithResult(_0x7f727b,null))['catch'](handleError(_0x7f727b,null));};exports['create']=function(_0x2c2067,_0x5321a){return db['Interval'][_0xade7('0x4f')](_0x2c2067[_0xade7('0x50')],{})[_0xade7('0x27')](function(_0x5c56bf){var _0x41ceb3=_0x2c2067['user'][_0xade7('0x28')]({'plain':!![]});if(!_0x41ceb3)throw new Error(_0xade7('0x51'));if(_0x41ceb3[_0xade7('0x52')]===_0xade7('0x53')){var _0x3b0438=_0x5c56bf['get']({'plain':!![]});var _0x510ec9=_0xade7('0x54');return db[_0xade7('0x55')][_0xade7('0x4e')]({'where':{'name':_0x510ec9,'userProfileId':_0x41ceb3['userProfileId']},'raw':!![]})[_0xade7('0x27')](function(_0x7f8e30){if(_0x7f8e30&&_0x7f8e30[_0xade7('0x56')]===0x0){return db[_0xade7('0x29')]['create']({'name':_0x3b0438[_0xade7('0x2d')],'resourceId':_0x3b0438['id'],'type':_0x7f8e30['name'],'sectionId':_0x7f8e30['id']},{})[_0xade7('0x27')](function(){return _0x5c56bf;});}else{return _0x5c56bf;}})['catch'](function(_0x348032){logger[_0xade7('0x2b')](_0xade7('0x57'),_0x348032);throw _0x348032;});}return _0x5c56bf;})[_0xade7('0x27')](respondWithResult(_0x5321a,0xc9))[_0xade7('0x46')](handleError(_0x5321a,null));};exports['update']=function(_0x85ef47,_0x89c80e){if(_0x85ef47[_0xade7('0x50')]['id']){delete _0x85ef47[_0xade7('0x50')]['id'];}return db[_0xade7('0x31')][_0xade7('0x4e')]({'where':{'id':_0x85ef47[_0xade7('0x48')]['id']}})['then'](handleEntityNotFound(_0x89c80e,null))[_0xade7('0x27')](saveUpdates(_0x85ef47[_0xade7('0x50')],null))[_0xade7('0x27')](respondWithResult(_0x89c80e,null))[_0xade7('0x46')](handleError(_0x89c80e,null));};exports[_0xade7('0x2a')]=function(_0x2fea8b,_0x2039b8){return db[_0xade7('0x31')]['find']({'where':{'id':_0x2fea8b[_0xade7('0x48')]['id']}})[_0xade7('0x27')](handleEntityNotFound(_0x2039b8,null))['then'](removeEntity(_0x2039b8,null))[_0xade7('0x46')](handleError(_0x2039b8,null));};exports[_0xade7('0x58')]=function(_0x2b16e4,_0x2758e5,_0x3a5a51){if(_0x2b16e4[_0xade7('0x50')]['id']){delete _0x2b16e4[_0xade7('0x50')]['id'];}return db['Interval'][_0xade7('0x4e')]({'where':{'id':_0x2b16e4['params']['id']}})[_0xade7('0x27')](handleEntityNotFound(_0x2758e5,null))['then'](function(_0xfc4e22){if(_0xfc4e22){_0x2b16e4[_0xade7('0x50')][_0xade7('0x59')]=_0xfc4e22['id'];return db[_0xade7('0x31')][_0xade7('0x4f')](_0x2b16e4[_0xade7('0x50')]);}})['then'](respondWithResult(_0x2758e5,null))[_0xade7('0x46')](handleError(_0x2758e5,null));};exports[_0xade7('0x5a')]=function(_0x1848c9,_0x56eaa8,_0x2bb747){var _0x3ce24b={};var _0xe5c50f={};var _0x5f5a64;var _0x5d7f4e;return db[_0xade7('0x31')]['findOne']({'where':{'id':_0x1848c9[_0xade7('0x48')]['id']}})[_0xade7('0x27')](handleEntityNotFound(_0x56eaa8,null))[_0xade7('0x27')](function(_0x5cda7e){if(_0x5cda7e){_0x5f5a64=_0x5cda7e;_0xe5c50f[_0xade7('0x36')]=_[_0xade7('0x49')](db[_0xade7('0x31')][_0xade7('0x4a')]);_0xe5c50f[_0xade7('0x34')]=_[_0xade7('0x49')](_0x1848c9[_0xade7('0x34')]);_0xe5c50f[_0xade7('0x4b')]=_['intersection'](_0xe5c50f['model'],_0xe5c50f[_0xade7('0x34')]);_0x3ce24b[_0xade7('0x38')]=_[_0xade7('0x35')](_0xe5c50f[_0xade7('0x36')],qs[_0xade7('0x37')](_0x1848c9[_0xade7('0x34')][_0xade7('0x37')]));_0x3ce24b[_0xade7('0x38')]=_0x3ce24b[_0xade7('0x38')][_0xade7('0x4c')]?_0x3ce24b['attributes']:_0xe5c50f[_0xade7('0x36')];_0x3ce24b[_0xade7('0x3a')]=qs['sort'](_0x1848c9[_0xade7('0x34')][_0xade7('0x3b')]);_0x3ce24b[_0xade7('0x3c')]=qs[_0xade7('0x4b')](_['pick'](_0x1848c9[_0xade7('0x34')],_0xe5c50f['filters']));if(_0x1848c9[_0xade7('0x34')][_0xade7('0x41')]){_0x3ce24b['where']=_[_0xade7('0x3e')](_0x3ce24b[_0xade7('0x3c')],{'$or':_['map'](_0x3ce24b[_0xade7('0x38')],function(_0x3b4336){var _0xb46138={};_0xb46138[_0x3b4336]={'$like':'%'+_0x1848c9[_0xade7('0x34')][_0xade7('0x41')]+'%'};return _0xb46138;})});}_0x3ce24b=_[_0xade7('0x3e')]({},_0x3ce24b,_0x1848c9[_0xade7('0x42')]);return _0x5f5a64['getIntervals'](_0x3ce24b);}})[_0xade7('0x27')](function(_0x1340f3){if(_0x1340f3){_0x5d7f4e=_0x1340f3['length'];if(!_0x1848c9['query'][_0xade7('0x39')](_0xade7('0x5b'))){_0x3ce24b[_0xade7('0x21')]=qs[_0xade7('0x21')](_0x1848c9['query'][_0xade7('0x21')]);_0x3ce24b[_0xade7('0x1f')]=qs[_0xade7('0x1f')](_0x1848c9[_0xade7('0x34')]['offset']);}return _0x5f5a64[_0xade7('0x5a')](_0x3ce24b);}})[_0xade7('0x27')](function(_0xdb2413){if(_0xdb2413){return _0xdb2413?{'count':_0x5d7f4e,'rows':_0xdb2413}:null;}})[_0xade7('0x27')](respondWithResult(_0x56eaa8,null))['catch'](handleError(_0x56eaa8,null));};exports[_0xade7('0x5c')]=function(_0x32b069,_0x47a878,_0x2ce49c){return db[_0xade7('0x31')][_0xade7('0x5d')]({'where':{'id':_0x32b069[_0xade7('0x48')]['id']}})[_0xade7('0x27')](handleEntityNotFound(_0x47a878,null))['then'](function(_0x4403f8){if(_0x4403f8){return db[_0xade7('0x5e')][_0xade7('0x5f')](function(_0x2372ff){return db[_0xade7('0x31')][_0xade7('0x2a')]({'where':{'IntervalId':_0x32b069[_0xade7('0x48')]['id']},'transaction':_0x2372ff})['then'](function(_0x2e122b){var _0x122f68=_[_0xade7('0x30')](_0x32b069[_0xade7('0x50')],function(_0x1ccd13){delete _0x1ccd13['id'];_0x1ccd13[_0xade7('0x59')]=_0x32b069[_0xade7('0x48')]['id'];return _0x1ccd13;});return db[_0xade7('0x31')][_0xade7('0x60')](_0x122f68,{'transaction':_0x2372ff});});})[_0xade7('0x27')](function(){return db['Interval'][_0xade7('0x44')]({'where':{'IntervalId':_0x32b069[_0xade7('0x48')]['id']}});});}})[_0xade7('0x27')](respondWithResult(_0x47a878,null))['catch'](handleError(_0x47a878,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 3da1a89..007eaa9 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 _0xdc2e=['string','then','all','ifTime','reduce','../../components/extensions/rewrite','../../utils/iftime','exports','define','Interval','tools_intervals','rewrite','interval'];(function(_0xab5df3,_0x7c88b9){var _0x4f06ce=function(_0x1de8cc){while(--_0x1de8cc){_0xab5df3['push'](_0xab5df3['shift']());}};_0x4f06ce(++_0x7c88b9);}(_0xdc2e,0x94));var _0xedc2=function(_0x187718,_0x427383){_0x187718=_0x187718-0x0;var _0x29ddf4=_0xdc2e[_0x187718];return _0x29ddf4;};'use strict';var attributes=require('./interval.attributes');var extensions=require(_0xedc2('0x0'));var iftime=require(_0xedc2('0x1'))['iftime'];module[_0xedc2('0x2')]=function(_0x29070a){return _0x29070a[_0xedc2('0x3')](_0xedc2('0x4'),attributes,{'tableName':_0xedc2('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x311a1d){extensions['rewrite'](_0x29070a,_0x311a1d);},'afterBulkCreate':function(_0x222de0,_0x31dbb6,_0x443460){_0x443460();extensions[_0xedc2('0x6')](_0x29070a,_0x222de0[0x0]);},'afterUpdate':function(_0x2b6c61){extensions[_0xedc2('0x6')](_0x29070a,_0x2b6c61);},'afterDestroy':function(_0x5a2788){extensions[_0xedc2('0x6')](_0x29070a,_0x5a2788);}},'instanceMethods':{'ifTime':function(_0x237729=undefined,_0x50b3af=new Date()){if(typeof this[_0xedc2('0x7')]===_0xedc2('0x8')){return iftime(this[_0xedc2('0x7')],_0x237729,_0x50b3af);}else{return this['getIntervals']()[_0xedc2('0x9')](function(_0x26fc91){return Promise[_0xedc2('0xa')](_0x26fc91['map'](function(_0x27fc62){return _0x27fc62[_0xedc2('0xb')](_0x237729,_0x50b3af);}));})['then'](function(_0x3fcf23){return _0x3fcf23[_0xedc2('0xc')](function(_0x41db77,_0x3c1740){return _0x41db77||_0x3c1740;},![]);});}}}});}; \ No newline at end of file +var _0x10ea=['iftime','exports','define','rewrite','interval','getIntervals','then','map','ifTime','./interval.attributes','../../utils/iftime'];(function(_0x191413,_0x193c45){var _0x3fcfdb=function(_0x115398){while(--_0x115398){_0x191413['push'](_0x191413['shift']());}};_0x3fcfdb(++_0x193c45);}(_0x10ea,0x132));var _0xa10e=function(_0x4f8f3b,_0x43281b){_0x4f8f3b=_0x4f8f3b-0x0;var _0x4c250c=_0x10ea[_0x4f8f3b];return _0x4c250c;};'use strict';var attributes=require(_0xa10e('0x0'));var extensions=require('../../components/extensions/rewrite');var iftime=require(_0xa10e('0x1'))[_0xa10e('0x2')];module[_0xa10e('0x3')]=function(_0x23285b){return _0x23285b[_0xa10e('0x4')]('Interval',attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xec512e){extensions[_0xa10e('0x5')](_0x23285b,_0xec512e);},'afterBulkCreate':function(_0x56348f,_0x19b436,_0x5617cf){_0x5617cf();extensions[_0xa10e('0x5')](_0x23285b,_0x56348f[0x0]);},'afterUpdate':function(_0x312bb2){extensions[_0xa10e('0x5')](_0x23285b,_0x312bb2);},'afterDestroy':function(_0x27c340){extensions[_0xa10e('0x5')](_0x23285b,_0x27c340);}},'instanceMethods':{'ifTime':function(_0x325412=undefined,_0x147a95=new Date()){if(typeof this[_0xa10e('0x6')]==='string'){return iftime(this['interval'],_0x325412,_0x147a95);}else{return this[_0xa10e('0x7')]()[_0xa10e('0x8')](function(_0x4caa91){return Promise['all'](_0x4caa91[_0xa10e('0x9')](function(_0x4279f2){return _0x4279f2[_0xa10e('0xa')](_0x325412,_0x147a95);}));})[_0xa10e('0x8')](function(_0x54579e){return _0x54579e['reduce'](function(_0x31f181,_0x5203db){return _0x31f181||_0x5203db;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 71330f8..e1e5697 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 _0x5314=['include','model','then','info','debug','catch','error','message','ShowInterval','where','stringify','findAll','all','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervalIds','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','silly','resolve','isArray','util','../../mysqldb','iftime','rpc','GetInterval','Interval','raw','options','attributes','map'];(function(_0x20481c,_0x3fa0fc){var _0x510e01=function(_0x1e20f6){while(--_0x1e20f6){_0x20481c['push'](_0x20481c['shift']());}};_0x510e01(++_0x3fa0fc);}(_0x5314,0xf2));var _0x4531=function(_0x158f43,_0x32da3f){_0x158f43=_0x158f43-0x0;var _0x16f61f=_0x5314[_0x158f43];return _0x16f61f;};'use strict';var _=require('lodash');var util=require(_0x4531('0x0'));var db=require(_0x4531('0x1'))['db'];var iftime=require('../../utils/iftime')[_0x4531('0x2')];var logger=require('../../config/logger')(_0x4531('0x3'));exports[_0x4531('0x4')]=function(_0x5def97){var _0x1e3470=this;return new Promise(function(_0x20c27b,_0xc968c8){return db[_0x4531('0x5')]['findAll']({'raw':_0x5def97['options']?_0x5def97['options'][_0x4531('0x6')]===undefined?!![]:![]:!![],'where':_0x5def97[_0x4531('0x7')]?_0x5def97[_0x4531('0x7')]['where']||null:null,'attributes':_0x5def97[_0x4531('0x7')]?_0x5def97[_0x4531('0x7')][_0x4531('0x8')]||null:null,'limit':_0x5def97[_0x4531('0x7')]?_0x5def97[_0x4531('0x7')]['limit']||null:null,'include':_0x5def97[_0x4531('0x7')]?_0x5def97[_0x4531('0x7')]['include']?_[_0x4531('0x9')](_0x5def97[_0x4531('0x7')]['include'],function(_0xdac7ab){return{'model':db[_0xdac7ab['model']],'as':_0xdac7ab['as'],'attributes':_0xdac7ab[_0x4531('0x8')],'include':_0xdac7ab['include']?_[_0x4531('0x9')](_0xdac7ab[_0x4531('0xa')],function(_0x227a3d){return{'model':db[_0x227a3d[_0x4531('0xb')]],'as':_0x227a3d['as'],'attributes':_0x227a3d[_0x4531('0x8')],'include':_0x227a3d['include']?_[_0x4531('0x9')](_0x227a3d[_0x4531('0xa')],function(_0x130c7c){return{'model':db[_0x130c7c[_0x4531('0xb')]],'as':_0x130c7c['as'],'attributes':_0x130c7c[_0x4531('0x8')]};}):[]};}):[]};}):[]:[]})[_0x4531('0xc')](function(_0x4bee6a){logger[_0x4531('0xd')](_0x4531('0x4'),_0x5def97);logger[_0x4531('0xe')](_0x4531('0x4'),_0x5def97,JSON['stringify'](_0x4bee6a));_0x20c27b(_0x4bee6a);})[_0x4531('0xf')](function(_0x1fb2c8){logger[_0x4531('0x10')](_0x4531('0x4'),_0x1fb2c8[_0x4531('0x11')],_0x5def97);_0xc968c8(_0x1e3470[_0x4531('0x10')](0x1f4,_0x1fb2c8[_0x4531('0x11')]));});});};exports[_0x4531('0x12')]=function(_0x55d29d){var _0x31f4b0=this;return new Promise(function(_0x525982,_0x40d28a){return db[_0x4531('0x5')]['find']({'raw':_0x55d29d[_0x4531('0x7')]?_0x55d29d[_0x4531('0x7')][_0x4531('0x6')]===undefined?!![]:![]:!![],'where':_0x55d29d[_0x4531('0x7')]?_0x55d29d[_0x4531('0x7')][_0x4531('0x13')]||null:null,'attributes':_0x55d29d[_0x4531('0x7')]?_0x55d29d[_0x4531('0x7')][_0x4531('0x8')]||null:null,'include':_0x55d29d[_0x4531('0x7')]?_0x55d29d[_0x4531('0x7')][_0x4531('0xa')]?_[_0x4531('0x9')](_0x55d29d['options'][_0x4531('0xa')],function(_0x879839){return{'model':db[_0x879839[_0x4531('0xb')]],'as':_0x879839['as'],'attributes':_0x879839[_0x4531('0x8')],'include':_0x879839['include']?_[_0x4531('0x9')](_0x879839[_0x4531('0xa')],function(_0x10846d){return{'model':db[_0x10846d[_0x4531('0xb')]],'as':_0x10846d['as'],'attributes':_0x10846d[_0x4531('0x8')],'include':_0x10846d[_0x4531('0xa')]?_['map'](_0x10846d[_0x4531('0xa')],function(_0x4d79a7){return{'model':db[_0x4d79a7[_0x4531('0xb')]],'as':_0x4d79a7['as'],'attributes':_0x4d79a7[_0x4531('0x8')]};}):[]};}):[]};}):[]:[]})[_0x4531('0xc')](function(_0x51acec){logger['info'](_0x4531('0x12'),_0x55d29d);logger[_0x4531('0xe')]('ShowInterval',_0x55d29d,JSON[_0x4531('0x14')](_0x51acec));_0x525982(_0x51acec);})[_0x4531('0xf')](function(_0x1d8964){logger[_0x4531('0x10')](_0x4531('0x12'),_0x1d8964['message'],_0x55d29d);_0x40d28a(_0x31f4b0[_0x4531('0x10')](0x1f4,_0x1d8964[_0x4531('0x11')]));});});};function checkArrayOfIntervals(_0x5006b6,_0x432d8c){var _0x20ea69=[];return db[_0x4531('0x5')][_0x4531('0x15')]({'where':{'id':_0x5006b6}})['then'](function(_0x1db01a){_0x20ea69=_0x1db01a;return Promise[_0x4531('0x16')](_0x20ea69[_0x4531('0x9')](function(_0x3199a7){return _0x3199a7[_0x4531('0x17')](_0x432d8c);}));})[_0x4531('0xc')](function(_0x509dbb){var _0x3af26d=_0x509dbb[_0x4531('0x18')](function(_0x279dbb,_0x2a7280){return _0x279dbb||_0x2a7280;},![]);logger[_0x4531('0xd')](util[_0x4531('0x19')](_0x4531('0x1a'),_0x20ea69[_0x4531('0x9')](function(_0xe1f8a){return _0xe1f8a[_0x4531('0x1b')];})[_0x4531('0x1c')](',\x20'),_0x20ea69['map'](function(_0x454fb9){return _0x454fb9['id'];})[_0x4531('0x1c')](',\x20')));return _0x3af26d;});}function checkSingleInterval(_0x45ed7b,_0x24d1fa){return db[_0x4531('0x5')][_0x4531('0x1d')](_0x45ed7b)['then'](function(_0x1455c4){if(_0x1455c4){logger[_0x4531('0xd')](util[_0x4531('0x19')](_0x4531('0x1e'),_0x1455c4[_0x4531('0x1b')],_0x1455c4['id']));return _0x1455c4[_0x4531('0x17')](_0x24d1fa);}});}exports[_0x4531('0x1f')]=function(_0x58bbfa){var _0x660100=_0x58bbfa[_0x4531('0x20')];var _0x255708=Array['isArray'](_0x58bbfa['intervals'])?_0x58bbfa[_0x4531('0x21')]:typeof _0x58bbfa[_0x4531('0x21')]===_0x4531('0x22')?[_0x58bbfa[_0x4531('0x21')]]:[];var _0x282230=_0x58bbfa[_0x4531('0x23')]||undefined;var _0x5b0657=![];if(_0x255708[_0x4531('0x24')]){logger['info'](util['format'](_0x4531('0x25'),_0x255708[_0x4531('0x1c')](';\x20')));}if(_0x282230){logger[_0x4531('0xd')](util[_0x4531('0x19')](_0x4531('0x26'),_0x282230));}logger[_0x4531('0xe')]('Iftime',_0x5b0657);logger[_0x4531('0x27')](_0x4531('0x1f'),_0x58bbfa);return Promise[_0x4531('0x28')]()[_0x4531('0xc')](function(){if(Array[_0x4531('0x29')](_0x660100)){return checkArrayOfIntervals(_0x660100,_0x282230);}else if(_0x660100){return checkSingleInterval(_0x660100,_0x282230);}})['then'](function(_0x9bc419){var _0x1e38a2=_0x255708[_0x4531('0x18')](function(_0x1997cc,_0x3ab5a0){return _0x1997cc||iftime(_0x3ab5a0,_0x282230);},![]);_0x5b0657=_0x9bc419||_0x1e38a2;return _0x5b0657;})[_0x4531('0xf')](function(_0x250b63){logger[_0x4531('0x10')](_0x4531('0x1f'),_0x58bbfa,_0x250b63);throw this[_0x4531('0x10')](0x1f4,_0x250b63[_0x4531('0x11')]);});}; \ No newline at end of file +var _0x808f=['resolve','reduce','../../mysqldb','../../utils/iftime','../../config/logger','rpc','GetInterval','Interval','findAll','options','raw','where','limit','include','model','attributes','map','then','info','debug','stringify','error','message','ShowInterval','catch','ifTime','format','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervalIds','intervals','string','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','Iftime','silly'];(function(_0x549fb0,_0x39f4f7){var _0x35a436=function(_0x4fecd2){while(--_0x4fecd2){_0x549fb0['push'](_0x549fb0['shift']());}};_0x35a436(++_0x39f4f7);}(_0x808f,0x161));var _0xf808=function(_0x2b7e60,_0x4ad15d){_0x2b7e60=_0x2b7e60-0x0;var _0x5d6165=_0x808f[_0x2b7e60];return _0x5d6165;};'use strict';var _=require('lodash');var util=require('util');var db=require(_0xf808('0x0'))['db'];var iftime=require(_0xf808('0x1'))['iftime'];var logger=require(_0xf808('0x2'))(_0xf808('0x3'));exports[_0xf808('0x4')]=function(_0x55e524){var _0x2c4895=this;return new Promise(function(_0x4a28e4,_0x5d7002){return db[_0xf808('0x5')][_0xf808('0x6')]({'raw':_0x55e524[_0xf808('0x7')]?_0x55e524[_0xf808('0x7')][_0xf808('0x8')]===undefined?!![]:![]:!![],'where':_0x55e524[_0xf808('0x7')]?_0x55e524[_0xf808('0x7')][_0xf808('0x9')]||null:null,'attributes':_0x55e524[_0xf808('0x7')]?_0x55e524['options']['attributes']||null:null,'limit':_0x55e524[_0xf808('0x7')]?_0x55e524['options'][_0xf808('0xa')]||null:null,'include':_0x55e524['options']?_0x55e524['options'][_0xf808('0xb')]?_['map'](_0x55e524[_0xf808('0x7')]['include'],function(_0x18e8d0){return{'model':db[_0x18e8d0[_0xf808('0xc')]],'as':_0x18e8d0['as'],'attributes':_0x18e8d0[_0xf808('0xd')],'include':_0x18e8d0['include']?_[_0xf808('0xe')](_0x18e8d0[_0xf808('0xb')],function(_0x3546f5){return{'model':db[_0x3546f5[_0xf808('0xc')]],'as':_0x3546f5['as'],'attributes':_0x3546f5[_0xf808('0xd')],'include':_0x3546f5[_0xf808('0xb')]?_[_0xf808('0xe')](_0x3546f5[_0xf808('0xb')],function(_0x1e3d77){return{'model':db[_0x1e3d77['model']],'as':_0x1e3d77['as'],'attributes':_0x1e3d77[_0xf808('0xd')]};}):[]};}):[]};}):[]:[]})[_0xf808('0xf')](function(_0x584877){logger[_0xf808('0x10')](_0xf808('0x4'),_0x55e524);logger[_0xf808('0x11')](_0xf808('0x4'),_0x55e524,JSON[_0xf808('0x12')](_0x584877));_0x4a28e4(_0x584877);})['catch'](function(_0x10b33e){logger[_0xf808('0x13')](_0xf808('0x4'),_0x10b33e[_0xf808('0x14')],_0x55e524);_0x5d7002(_0x2c4895[_0xf808('0x13')](0x1f4,_0x10b33e[_0xf808('0x14')]));});});};exports[_0xf808('0x15')]=function(_0x409698){var _0x42a2aa=this;return new Promise(function(_0x380f0d,_0x489a0e){return db[_0xf808('0x5')]['find']({'raw':_0x409698['options']?_0x409698[_0xf808('0x7')][_0xf808('0x8')]===undefined?!![]:![]:!![],'where':_0x409698[_0xf808('0x7')]?_0x409698[_0xf808('0x7')][_0xf808('0x9')]||null:null,'attributes':_0x409698['options']?_0x409698['options'][_0xf808('0xd')]||null:null,'include':_0x409698[_0xf808('0x7')]?_0x409698[_0xf808('0x7')]['include']?_[_0xf808('0xe')](_0x409698[_0xf808('0x7')][_0xf808('0xb')],function(_0x4426a5){return{'model':db[_0x4426a5[_0xf808('0xc')]],'as':_0x4426a5['as'],'attributes':_0x4426a5[_0xf808('0xd')],'include':_0x4426a5[_0xf808('0xb')]?_[_0xf808('0xe')](_0x4426a5['include'],function(_0x2be5e8){return{'model':db[_0x2be5e8['model']],'as':_0x2be5e8['as'],'attributes':_0x2be5e8[_0xf808('0xd')],'include':_0x2be5e8['include']?_[_0xf808('0xe')](_0x2be5e8[_0xf808('0xb')],function(_0x360c10){return{'model':db[_0x360c10['model']],'as':_0x360c10['as'],'attributes':_0x360c10['attributes']};}):[]};}):[]};}):[]:[]})[_0xf808('0xf')](function(_0x2f8431){logger['info'](_0xf808('0x15'),_0x409698);logger[_0xf808('0x11')]('ShowInterval',_0x409698,JSON[_0xf808('0x12')](_0x2f8431));_0x380f0d(_0x2f8431);})[_0xf808('0x16')](function(_0x15d387){logger['error'](_0xf808('0x15'),_0x15d387[_0xf808('0x14')],_0x409698);_0x489a0e(_0x42a2aa[_0xf808('0x13')](0x1f4,_0x15d387[_0xf808('0x14')]));});});};function checkArrayOfIntervals(_0x59b324,_0x5d0cc8){var _0x58c7ac=[];return db[_0xf808('0x5')][_0xf808('0x6')]({'where':{'id':_0x59b324}})[_0xf808('0xf')](function(_0x4eba85){_0x58c7ac=_0x4eba85;return Promise['all'](_0x58c7ac['map'](function(_0x36d5f5){return _0x36d5f5[_0xf808('0x17')](_0x5d0cc8);}));})[_0xf808('0xf')](function(_0x592247){var _0x17cef2=_0x592247['reduce'](function(_0x2801b0,_0x5e547a){return _0x2801b0||_0x5e547a;},![]);logger['info'](util[_0xf808('0x18')]('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x58c7ac[_0xf808('0xe')](function(_0x344b2e){return _0x344b2e[_0xf808('0x19')];})[_0xf808('0x1a')](',\x20'),_0x58c7ac[_0xf808('0xe')](function(_0xd9255f){return _0xd9255f['id'];})[_0xf808('0x1a')](',\x20')));return _0x17cef2;});}function checkSingleInterval(_0x48d3dd,_0x38e28a){return db[_0xf808('0x5')][_0xf808('0x1b')](_0x48d3dd)[_0xf808('0xf')](function(_0x386612){if(_0x386612){logger[_0xf808('0x10')](util[_0xf808('0x18')](_0xf808('0x1c'),_0x386612[_0xf808('0x19')],_0x386612['id']));return _0x386612[_0xf808('0x17')](_0x38e28a);}});}exports[_0xf808('0x1d')]=function(_0x526680){var _0x444fb9=_0x526680[_0xf808('0x1e')];var _0x1ed19d=Array['isArray'](_0x526680['intervals'])?_0x526680[_0xf808('0x1f')]:typeof _0x526680[_0xf808('0x1f')]===_0xf808('0x20')?[_0x526680[_0xf808('0x1f')]]:[];var _0xb58be0=_0x526680['timezone']||undefined;var _0xd55c6b=![];if(_0x1ed19d[_0xf808('0x21')]){logger[_0xf808('0x10')](util['format'](_0xf808('0x22'),_0x1ed19d[_0xf808('0x1a')](';\x20')));}if(_0xb58be0){logger[_0xf808('0x10')](util[_0xf808('0x18')]('IntervalIftime:\x20timezone\x20=\x20%s',_0xb58be0));}logger[_0xf808('0x11')](_0xf808('0x23'),_0xd55c6b);logger[_0xf808('0x24')](_0xf808('0x1d'),_0x526680);return Promise[_0xf808('0x25')]()[_0xf808('0xf')](function(){if(Array['isArray'](_0x444fb9)){return checkArrayOfIntervals(_0x444fb9,_0xb58be0);}else if(_0x444fb9){return checkSingleInterval(_0x444fb9,_0xb58be0);}})[_0xf808('0xf')](function(_0x48cffd){var _0xcb1089=_0x1ed19d[_0xf808('0x26')](function(_0x5bb73b,_0x227ca2){return _0x5bb73b||iftime(_0x227ca2,_0xb58be0);},![]);_0xd55c6b=_0x48cffd||_0xcb1089;return _0xd55c6b;})[_0xf808('0x16')](function(_0x3e58a0){logger[_0xf808('0x13')](_0xf808('0x1d'),_0x526680,_0x3e58a0);throw this['error'](0x1f4,_0x3e58a0['message']);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index ba36487..d8c9f04 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 _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x4dbbfd,_0x36a14c){var _0x132ab7=function(_0x36624c){while(--_0x36624c){_0x4dbbfd['push'](_0x4dbbfd['shift']());}};_0x132ab7(++_0x36a14c);}(_0xdb28,0x106));var _0x8db2=function(_0x42ec7f,_0x4c12f9){_0x42ec7f=_0x42ec7f-0x0;var _0x2fc3e3=_0xdb28[_0x42ec7f];return _0x2fc3e3;};'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 +var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x2a23dd,_0x49f0fa){var _0x5f241b=function(_0x21b6bf){while(--_0x21b6bf){_0x2a23dd['push'](_0x2a23dd['shift']());}};_0x5f241b(++_0x49f0fa);}(_0x2ef3,0xba));var _0x32ef=function(_0x25b250,_0x3fea32){_0x25b250=_0x25b250-0x0;var _0x1c2adb=_0x2ef3[_0x25b250];return _0x1c2adb;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 8f947e5..a7da81b 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 _0xccf3=['name','customfield_11504','reason','customfield_10102','/rest/api/2/issue','POST','Basic\x20','toString','base64','setEncoding','end','status','json','error','api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection','socket','remoteAddress','3eAmWpBVP0','key','MOTGUI','summary','Report','stringify','issuetype','Bug','customfield_11500','email','fields','customfield_11501','oldToken','customfield_11502','customfield_11503'];(function(_0x449b53,_0x25c4bb){var _0x31990b=function(_0x5bee77){while(--_0x5bee77){_0x449b53['push'](_0x449b53['shift']());}};_0x31990b(++_0x25c4bb);}(_0xccf3,0x177));var _0x3ccf=function(_0x1328a0,_0x39dcbf){_0x1328a0=_0x1328a0-0x0;var _0x53f4f9=_0xccf3[_0x1328a0];return _0x53f4f9;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require('../../config/logger')('api');var USERNAME='support';var PASSWORD=_0x3ccf('0x0');function openIssue(_0x1739c0,_0x104cac){var _0x592f2c={'fields':{'project':{'key':_0x1739c0[_0x3ccf('0x1')]||_0x3ccf('0x2')},'summary':(_0x1739c0[_0x3ccf('0x3')]||_0x3ccf('0x4'))+'\x20from\x20'+_0x1739c0['ip'],'description':_0x1739c0['description']||JSON[_0x3ccf('0x5')](_0x1739c0),'issuetype':{'name':_0x1739c0[_0x3ccf('0x6')]||_0x3ccf('0x7')}}};_0x592f2c['fields'][_0x3ccf('0x8')]=_0x1739c0[_0x3ccf('0x9')];_0x592f2c[_0x3ccf('0xa')][_0x3ccf('0xb')]=_0x1739c0[_0x3ccf('0xc')];_0x592f2c[_0x3ccf('0xa')][_0x3ccf('0xd')]=_0x1739c0['newToken'];_0x592f2c[_0x3ccf('0xa')][_0x3ccf('0xe')]=_0x1739c0[_0x3ccf('0xf')];_0x592f2c[_0x3ccf('0xa')][_0x3ccf('0x10')]=_0x1739c0[_0x3ccf('0x11')];_0x592f2c[_0x3ccf('0xa')][_0x3ccf('0x12')]=_0x1739c0['ip'];var _0x101212={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x3ccf('0x13'),'method':_0x3ccf('0x14'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x3ccf('0x15')+new Buffer(USERNAME+':'+PASSWORD)[_0x3ccf('0x16')](_0x3ccf('0x17'))}};var _0x20b485=JSON['stringify'](_0x592f2c);var _0x1838e5=https['request'](_0x101212,function(_0xb26065){_0xb26065[_0x3ccf('0x18')]('utf8');var _0x4a0e23='';_0xb26065['on']('data',function(_0x1fc83b){_0x4a0e23+=_0x1fc83b;});_0xb26065['on'](_0x3ccf('0x19'),function(){if(_0x104cac){return _0x104cac[_0x3ccf('0x1a')](_0xb26065['statusCode'])[_0x3ccf('0x1b')](JSON['parse'](_0x4a0e23));}});});_0x1838e5['on'](_0x3ccf('0x1c'),function(_0x21ea4e){if(_0x104cac){return _0x104cac[_0x3ccf('0x1a')](0x1f4)[_0x3ccf('0x1b')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x3ccf('0x1d')}]});}});_0x1838e5[_0x3ccf('0x1e')](_0x20b485);_0x1838e5[_0x3ccf('0x19')]();}exports[_0x3ccf('0x1f')]=openIssue;exports[_0x3ccf('0x20')]=function(_0x616cd5,_0x2ebe08){_0x616cd5[_0x3ccf('0x21')]['ip']=_0x616cd5[_0x3ccf('0x22')][_0x3ccf('0x23')]||_0x616cd5[_0x3ccf('0x24')]['remoteAddress']||_0x616cd5[_0x3ccf('0x25')][_0x3ccf('0x26')]||_0x616cd5[_0x3ccf('0x24')][_0x3ccf('0x25')][_0x3ccf('0x26')];return openIssue(_0x616cd5[_0x3ccf('0x21')],_0x2ebe08);}; \ No newline at end of file +var _0x0e74=['description','stringify','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','Basic\x20','toString','base64','request','utf8','data','end','statusCode','json','parse','error','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','body','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','summary','\x20from\x20'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x0e74,0xeb));var _0x40e7=function(_0x386fd2,_0x4c929e){_0x386fd2=_0x386fd2-0x0;var _0x3ce545=_0x0e74[_0x386fd2];return _0x3ce545;};'use strict';var BPromise=require(_0x40e7('0x0'));var https=require(_0x40e7('0x1'));var logger=require(_0x40e7('0x2'))(_0x40e7('0x3'));var USERNAME=_0x40e7('0x4');var PASSWORD=_0x40e7('0x5');function openIssue(_0x4dc967,_0x32f18f){var _0x128488={'fields':{'project':{'key':_0x4dc967[_0x40e7('0x6')]||_0x40e7('0x7')},'summary':(_0x4dc967[_0x40e7('0x8')]||'Report')+_0x40e7('0x9')+_0x4dc967['ip'],'description':_0x4dc967[_0x40e7('0xa')]||JSON[_0x40e7('0xb')](_0x4dc967),'issuetype':{'name':_0x4dc967['issuetype']||_0x40e7('0xc')}}};_0x128488[_0x40e7('0xd')][_0x40e7('0xe')]=_0x4dc967[_0x40e7('0xf')];_0x128488[_0x40e7('0xd')][_0x40e7('0x10')]=_0x4dc967[_0x40e7('0x11')];_0x128488[_0x40e7('0xd')][_0x40e7('0x12')]=_0x4dc967[_0x40e7('0x13')];_0x128488[_0x40e7('0xd')][_0x40e7('0x14')]=_0x4dc967[_0x40e7('0x15')];_0x128488[_0x40e7('0xd')][_0x40e7('0x16')]=_0x4dc967[_0x40e7('0x17')];_0x128488['fields'][_0x40e7('0x18')]=_0x4dc967['ip'];var _0x186823={'host':_0x40e7('0x19'),'port':0x1bb,'path':_0x40e7('0x1a'),'method':_0x40e7('0x1b'),'timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x40e7('0x1c')+new Buffer(USERNAME+':'+PASSWORD)[_0x40e7('0x1d')](_0x40e7('0x1e'))}};var _0x18f8c3=JSON[_0x40e7('0xb')](_0x128488);var _0x564aec=https[_0x40e7('0x1f')](_0x186823,function(_0xce3c01){_0xce3c01['setEncoding'](_0x40e7('0x20'));var _0x271e73='';_0xce3c01['on'](_0x40e7('0x21'),function(_0x33058b){_0x271e73+=_0x33058b;});_0xce3c01['on'](_0x40e7('0x22'),function(){if(_0x32f18f){return _0x32f18f['status'](_0xce3c01[_0x40e7('0x23')])[_0x40e7('0x24')](JSON[_0x40e7('0x25')](_0x271e73));}});});_0x564aec['on'](_0x40e7('0x26'),function(_0x1af0e9){if(_0x32f18f){return _0x32f18f[_0x40e7('0x27')](0x1f4)[_0x40e7('0x24')]({'errors':[{'message':_0x40e7('0x28'),'type':_0x40e7('0x29')}]});}});_0x564aec[_0x40e7('0x2a')](_0x18f8c3);_0x564aec[_0x40e7('0x22')]();}exports[_0x40e7('0x2b')]=openIssue;exports['send']=function(_0x5f5069,_0x331b47){_0x5f5069[_0x40e7('0x2c')]['ip']=_0x5f5069['headers'][_0x40e7('0x2d')]||_0x5f5069[_0x40e7('0x2e')]['remoteAddress']||_0x5f5069['socket'][_0x40e7('0x2f')]||_0x5f5069[_0x40e7('0x2e')][_0x40e7('0x30')][_0x40e7('0x2f')];return openIssue(_0x5f5069[_0x40e7('0x2c')],_0x331b47);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 51ae887..0cd8b72 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 _0x1be1=['fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','describe','/:id','post','put','update','destroy','path','connect-timeout','Router'];(function(_0x3fc2c0,_0x459cae){var _0x210004=function(_0x40d1bf){while(--_0x40d1bf){_0x3fc2c0['push'](_0x3fc2c0['shift']());}};_0x210004(++_0x459cae);}(_0x1be1,0x192));var _0x11be=function(_0x119ffb,_0xbb7485){_0x119ffb=_0x119ffb-0x0;var _0x1f1889=_0x1be1[_0x119ffb];return _0x1f1889;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x11be('0x0'));var timeout=require(_0x11be('0x1'));var express=require('express');var router=express[_0x11be('0x2')]();var fs_extra=require(_0x11be('0x3'));var auth=require(_0x11be('0x4'));var interaction=require(_0x11be('0x5'));var config=require('../../config/environment');var controller=require(_0x11be('0x6'));router[_0x11be('0x7')]('/',auth[_0x11be('0x8')](),controller['index']);router[_0x11be('0x7')]('/describe',auth[_0x11be('0x8')](),controller[_0x11be('0x9')]);router[_0x11be('0x7')](_0x11be('0xa'),auth[_0x11be('0x8')](),controller['show']);router[_0x11be('0xb')]('/',auth[_0x11be('0x8')](),controller['create']);router[_0x11be('0xc')](_0x11be('0xa'),auth[_0x11be('0x8')](),controller[_0x11be('0xd')]);router['delete'](_0x11be('0xa'),auth[_0x11be('0x8')](),controller[_0x11be('0xe')]);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','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','destroy','exports'];(function(_0x49ffb4,_0x5150b6){var _0x16259e=function(_0xbcc7b3){while(--_0xbcc7b3){_0x49ffb4['push'](_0x49ffb4['shift']());}};_0x16259e(++_0x5150b6);}(_0xedd9,0xfc));var _0x9edd=function(_0xda279d,_0xb7d510){_0xda279d=_0xda279d-0x0;var _0x1db2d3=_0xedd9[_0xda279d];return _0x1db2d3;};'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'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router['delete'](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x13')]);module[_0x9edd('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 3e3deaf..524c356 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(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x7a54,0x106));var _0x47a5=function(_0x5e1241,_0x5844d4){_0x5e1241=_0x5e1241-0x0;var _0x4eb6c7=_0x7a54[_0x5e1241];return _0x4eb6c7;};'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(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x7a54,0x106));var _0x47a5=function(_0x533cb9,_0x102015){_0x533cb9=_0x533cb9-0x0;var _0x59218d=_0x7a54[_0x533cb9];return _0x59218d;};'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 08b5e8f..30410df 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 _0x1b65=['crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','end','status','json','undefined','count','offset','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel'];(function(_0x23f555,_0x11aa29){var _0x1c3b90=function(_0x532777){while(--_0x532777){_0x23f555['push'](_0x23f555['shift']());}};_0x1c3b90(++_0x11aa29);}(_0x1b65,0x1b4));var _0x51b6=function(_0x3a023f,_0x3a0789){_0x3a023f=_0x3a023f-0x0;var _0x1de363=_0x1b65[_0x3a023f];return _0x1de363;};'use strict';var emlformat=require(_0x51b6('0x0'));var rimraf=require(_0x51b6('0x1'));var zipdir=require(_0x51b6('0x2'));var jsonpatch=require(_0x51b6('0x3'));var rp=require('request-promise');var moment=require(_0x51b6('0x4'));var BPromise=require(_0x51b6('0x5'));var Mustache=require(_0x51b6('0x6'));var util=require(_0x51b6('0x7'));var path=require(_0x51b6('0x8'));var sox=require(_0x51b6('0x9'));var csv=require(_0x51b6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51b6('0xb'));var _=require(_0x51b6('0xc'));var squel=require(_0x51b6('0xd'));var crypto=require(_0x51b6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x51b6('0xf'));var toCsv=require(_0x51b6('0xa'));var querystring=require('querystring');var Papa=require(_0x51b6('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x51b6('0x11'));var as=require(_0x51b6('0x12'));var hardwareService=require(_0x51b6('0x13'));var logger=require(_0x51b6('0x14'))(_0x51b6('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x51b6('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cd605,_0x422bd4){_0x422bd4=_0x422bd4||0xcc;return function(_0x4ca143){if(_0x4ca143){return _0x4cd605[_0x51b6('0x17')](_0x422bd4);}return _0x4cd605['status'](_0x422bd4)[_0x51b6('0x18')]();};}function respondWithResult(_0x24a386,_0x2890ee){_0x2890ee=_0x2890ee||0xc8;return function(_0x235d8c){if(_0x235d8c){return _0x24a386[_0x51b6('0x19')](_0x2890ee)[_0x51b6('0x1a')](_0x235d8c);}};}function respondWithFilteredResult(_0x4c6cd0,_0x23549b){return function(_0x596863){if(_0x596863){var _0x39583d=typeof _0x23549b['offset']===_0x51b6('0x1b')&&typeof _0x23549b['limit']===_0x51b6('0x1b');var _0x22ffa3=_0x596863[_0x51b6('0x1c')];var _0x3ae3c7=_0x39583d?0x0:_0x23549b[_0x51b6('0x1d')];var _0x22c6da=_0x39583d?_0x596863['count']:_0x23549b[_0x51b6('0x1d')]+_0x23549b['limit'];var _0x2974f0;if(_0x22c6da>=_0x22ffa3){_0x22c6da=_0x22ffa3;_0x2974f0=0xc8;}else{_0x2974f0=0xce;}_0x4c6cd0[_0x51b6('0x19')](_0x2974f0);return _0x4c6cd0['set'](_0x51b6('0x1e'),_0x3ae3c7+'-'+_0x22c6da+'/'+_0x22ffa3)[_0x51b6('0x1a')](_0x596863);}return null;};}function patchUpdates(_0x3fee21){return function(_0x471783){try{jsonpatch[_0x51b6('0x1f')](_0x471783,_0x3fee21,!![]);}catch(_0x663b44){return BPromise[_0x51b6('0x20')](_0x663b44);}return _0x471783[_0x51b6('0x21')]();};}function saveUpdates(_0x4ab876,_0x35d2ab){return function(_0x11db4e){if(_0x11db4e){return _0x11db4e[_0x51b6('0x22')](_0x4ab876)[_0x51b6('0x23')](function(_0x53e709){return _0x53e709;});}return null;};}function removeEntity(_0x3d3456,_0x3680af){return function(_0x51c013){if(_0x51c013){return _0x51c013['destroy']()[_0x51b6('0x23')](function(){_0x3d3456[_0x51b6('0x19')](0xcc)[_0x51b6('0x18')]();});}};}function handleEntityNotFound(_0x59193e,_0x4c1825){return function(_0x22b91b){if(!_0x22b91b){_0x59193e[_0x51b6('0x17')](0x194);}return _0x22b91b;};}function handleError(_0x8c0881,_0x4a5ff8){_0x4a5ff8=_0x4a5ff8||0x1f4;return function(_0x2842b2){logger[_0x51b6('0x24')](_0x2842b2[_0x51b6('0x25')]);if(_0x2842b2[_0x51b6('0x26')]){delete _0x2842b2[_0x51b6('0x26')];}_0x8c0881[_0x51b6('0x19')](_0x4a5ff8)[_0x51b6('0x27')](_0x2842b2);};}exports[_0x51b6('0x28')]=function(_0x51b505,_0x2dc770){var _0x226018={},_0x276443={},_0x48eb13={'count':0x0,'rows':[]};var _0x38f855=_[_0x51b6('0x29')](db[_0x51b6('0x2a')][_0x51b6('0x2b')],function(_0x5c7c35){return{'name':_0x5c7c35[_0x51b6('0x2c')],'type':_0x5c7c35['type'][_0x51b6('0x2d')]};});_0x276443[_0x51b6('0x2e')]=_['map'](_0x38f855,'name');_0x276443[_0x51b6('0x2f')]=_[_0x51b6('0x30')](_0x51b505['query']);_0x276443[_0x51b6('0x31')]=_[_0x51b6('0x32')](_0x276443['model'],_0x276443[_0x51b6('0x2f')]);_0x226018[_0x51b6('0x33')]=_[_0x51b6('0x32')](_0x276443['model'],qs[_0x51b6('0x34')](_0x51b505['query'][_0x51b6('0x34')]));_0x226018[_0x51b6('0x33')]=_0x226018[_0x51b6('0x33')][_0x51b6('0x35')]?_0x226018[_0x51b6('0x33')]:_0x276443[_0x51b6('0x2e')];if(!_0x51b505[_0x51b6('0x2f')][_0x51b6('0x36')]('nolimit')){_0x226018[_0x51b6('0x37')]=qs[_0x51b6('0x37')](_0x51b505['query'][_0x51b6('0x37')]);_0x226018['offset']=qs[_0x51b6('0x1d')](_0x51b505[_0x51b6('0x2f')][_0x51b6('0x1d')]);}_0x226018['order']=qs[_0x51b6('0x38')](_0x51b505[_0x51b6('0x2f')]['sort']);_0x226018[_0x51b6('0x39')]=qs[_0x51b6('0x31')](_[_0x51b6('0x3a')](_0x51b505[_0x51b6('0x2f')],_0x276443[_0x51b6('0x31')]),_0x38f855);if(_0x51b505[_0x51b6('0x2f')][_0x51b6('0x3b')]){_0x226018[_0x51b6('0x39')]=_[_0x51b6('0x3c')](_0x226018[_0x51b6('0x39')],{'$or':_[_0x51b6('0x29')](_0x38f855,function(_0x234d5e){if(_0x234d5e[_0x51b6('0x3d')]!==_0x51b6('0x3e')){var _0x28d14f={};_0x28d14f[_0x234d5e[_0x51b6('0x26')]]={'$like':'%'+_0x51b505['query'][_0x51b6('0x3b')]+'%'};return _0x28d14f;}})});}_0x226018=_['merge']({},_0x226018,_0x51b505[_0x51b6('0x3f')]);var _0x4ad444={'where':_0x226018[_0x51b6('0x39')]};return db[_0x51b6('0x2a')]['count'](_0x4ad444)[_0x51b6('0x23')](function(_0x2b6dd6){_0x48eb13['count']=_0x2b6dd6;if(_0x51b505[_0x51b6('0x2f')][_0x51b6('0x40')]){_0x226018[_0x51b6('0x41')]=[{'all':!![]}];}return db[_0x51b6('0x2a')][_0x51b6('0x42')](_0x226018);})['then'](function(_0x588a05){_0x48eb13['rows']=_0x588a05;return _0x48eb13;})[_0x51b6('0x23')](respondWithFilteredResult(_0x2dc770,_0x226018))[_0x51b6('0x43')](handleError(_0x2dc770,null));};exports[_0x51b6('0x44')]=function(_0xda309d,_0x2c3f6e){var _0x588fc6={'raw':!![],'where':{'id':_0xda309d[_0x51b6('0x45')]['id']}},_0x498717={};_0x498717[_0x51b6('0x2e')]=_[_0x51b6('0x30')](db['JscriptyAnswerReport'][_0x51b6('0x2b')]);_0x498717['query']=_[_0x51b6('0x30')](_0xda309d['query']);_0x498717[_0x51b6('0x31')]=_[_0x51b6('0x32')](_0x498717[_0x51b6('0x2e')],_0x498717['query']);_0x588fc6[_0x51b6('0x33')]=_[_0x51b6('0x32')](_0x498717[_0x51b6('0x2e')],qs[_0x51b6('0x34')](_0xda309d[_0x51b6('0x2f')]['fields']));_0x588fc6[_0x51b6('0x33')]=_0x588fc6[_0x51b6('0x33')]['length']?_0x588fc6[_0x51b6('0x33')]:_0x498717[_0x51b6('0x2e')];if(_0xda309d['query']['includeAll']){_0x588fc6['include']=[{'all':!![]}];}_0x588fc6=_['merge']({},_0x588fc6,_0xda309d['options']);return db['JscriptyAnswerReport'][_0x51b6('0x46')](_0x588fc6)['then'](handleEntityNotFound(_0x2c3f6e,null))[_0x51b6('0x23')](respondWithResult(_0x2c3f6e,null))[_0x51b6('0x43')](handleError(_0x2c3f6e,null));};exports[_0x51b6('0x47')]=function(_0x21a7ab,_0x4562c6){return db[_0x51b6('0x2a')]['create'](_0x21a7ab[_0x51b6('0x48')],{})['then'](respondWithResult(_0x4562c6,0xc9))[_0x51b6('0x43')](handleError(_0x4562c6,null));};exports[_0x51b6('0x22')]=function(_0x594bb2,_0x44f9d4){if(_0x594bb2[_0x51b6('0x48')]['id']){delete _0x594bb2[_0x51b6('0x48')]['id'];}return db[_0x51b6('0x2a')]['find']({'where':{'id':_0x594bb2[_0x51b6('0x45')]['id']}})[_0x51b6('0x23')](handleEntityNotFound(_0x44f9d4,null))[_0x51b6('0x23')](saveUpdates(_0x594bb2[_0x51b6('0x48')],null))[_0x51b6('0x23')](respondWithResult(_0x44f9d4,null))[_0x51b6('0x43')](handleError(_0x44f9d4,null));};exports[_0x51b6('0x49')]=function(_0x3c977a,_0x27a4e4){return db[_0x51b6('0x2a')][_0x51b6('0x46')]({'where':{'id':_0x3c977a['params']['id']}})[_0x51b6('0x23')](handleEntityNotFound(_0x27a4e4,null))[_0x51b6('0x23')](removeEntity(_0x27a4e4,null))[_0x51b6('0x43')](handleError(_0x27a4e4,null));};exports[_0x51b6('0x4a')]=function(_0x75e143,_0xe6e07a){return db[_0x51b6('0x2a')][_0x51b6('0x4a')]()[_0x51b6('0x23')](respondWithResult(_0xe6e07a,null))[_0x51b6('0x43')](handleError(_0xe6e07a,null));}; \ No newline at end of file +var _0x044a=['describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','limit','count','offset','set','apply','reject','update','then','stack','name','index','map','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','JscriptyAnswerReport','includeAll','include','findAll','rows','catch','show','rawAttributes','keys','options','find','create','body','params','destroy'];(function(_0x10be57,_0x2f2f90){var _0x2aa263=function(_0x5774db){while(--_0x5774db){_0x10be57['push'](_0x10be57['shift']());}};_0x2aa263(++_0x2f2f90);}(_0x044a,0x173));var _0xa044=function(_0x4d7cb5,_0x295cab){_0x4d7cb5=_0x4d7cb5-0x0;var _0x527a05=_0x044a[_0x4d7cb5];return _0x527a05;};'use strict';var emlformat=require(_0xa044('0x0'));var rimraf=require(_0xa044('0x1'));var zipdir=require(_0xa044('0x2'));var jsonpatch=require(_0xa044('0x3'));var rp=require(_0xa044('0x4'));var moment=require(_0xa044('0x5'));var BPromise=require(_0xa044('0x6'));var Mustache=require(_0xa044('0x7'));var util=require(_0xa044('0x8'));var path=require(_0xa044('0x9'));var sox=require('sox');var csv=require(_0xa044('0xa'));var ejs=require(_0xa044('0xb'));var fs=require('fs');var fs_extra=require(_0xa044('0xc'));var _=require(_0xa044('0xd'));var squel=require('squel');var crypto=require(_0xa044('0xe'));var jsforce=require(_0xa044('0xf'));var deskjs=require(_0xa044('0x10'));var toCsv=require(_0xa044('0xa'));var querystring=require('querystring');var Papa=require(_0xa044('0x11'));var Redis=require(_0xa044('0x12'));var authService=require(_0xa044('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa044('0x14'));var hardwareService=require(_0xa044('0x15'));var logger=require(_0xa044('0x16'))(_0xa044('0x17'));var utils=require('../../config/utils');var config=require(_0xa044('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ee43,_0x3e05cf){_0x3e05cf=_0x3e05cf||0xcc;return function(_0x2b73a1){if(_0x2b73a1){return _0x1ee43[_0xa044('0x19')](_0x3e05cf);}return _0x1ee43[_0xa044('0x1a')](_0x3e05cf)[_0xa044('0x1b')]();};}function respondWithResult(_0xe9a838,_0x4bec52){_0x4bec52=_0x4bec52||0xc8;return function(_0x31c5ae){if(_0x31c5ae){return _0xe9a838['status'](_0x4bec52)[_0xa044('0x1c')](_0x31c5ae);}};}function respondWithFilteredResult(_0x44c658,_0x141d1a){return function(_0x3bc2c9){if(_0x3bc2c9){var _0xeb7e4e=typeof _0x141d1a['offset']==='undefined'&&typeof _0x141d1a[_0xa044('0x1d')]==='undefined';var _0x3ca144=_0x3bc2c9[_0xa044('0x1e')];var _0x1b43c1=_0xeb7e4e?0x0:_0x141d1a[_0xa044('0x1f')];var _0x3ccbd3=_0xeb7e4e?_0x3bc2c9['count']:_0x141d1a['offset']+_0x141d1a['limit'];var _0x39422b;if(_0x3ccbd3>=_0x3ca144){_0x3ccbd3=_0x3ca144;_0x39422b=0xc8;}else{_0x39422b=0xce;}_0x44c658[_0xa044('0x1a')](_0x39422b);return _0x44c658[_0xa044('0x20')]('Content-Range',_0x1b43c1+'-'+_0x3ccbd3+'/'+_0x3ca144)[_0xa044('0x1c')](_0x3bc2c9);}return null;};}function patchUpdates(_0x19854d){return function(_0x4e0202){try{jsonpatch[_0xa044('0x21')](_0x4e0202,_0x19854d,!![]);}catch(_0x40999a){return BPromise[_0xa044('0x22')](_0x40999a);}return _0x4e0202['save']();};}function saveUpdates(_0x2e3468,_0x966548){return function(_0x26747b){if(_0x26747b){return _0x26747b[_0xa044('0x23')](_0x2e3468)[_0xa044('0x24')](function(_0x3f4d03){return _0x3f4d03;});}return null;};}function removeEntity(_0x18af4c,_0x46f14c){return function(_0x36c237){if(_0x36c237){return _0x36c237['destroy']()['then'](function(){_0x18af4c[_0xa044('0x1a')](0xcc)[_0xa044('0x1b')]();});}};}function handleEntityNotFound(_0x228d5e,_0x4c3d4b){return function(_0x418756){if(!_0x418756){_0x228d5e[_0xa044('0x19')](0x194);}return _0x418756;};}function handleError(_0x4e9357,_0x38bdd7){_0x38bdd7=_0x38bdd7||0x1f4;return function(_0x6746e8){logger['error'](_0x6746e8[_0xa044('0x25')]);if(_0x6746e8[_0xa044('0x26')]){delete _0x6746e8['name'];}_0x4e9357['status'](_0x38bdd7)['send'](_0x6746e8);};}exports[_0xa044('0x27')]=function(_0x159519,_0x1362ef){var _0x4c72f3={},_0x267512={},_0x300b6e={'count':0x0,'rows':[]};var _0x485212=_[_0xa044('0x28')](db['JscriptyAnswerReport']['rawAttributes'],function(_0x1cb1be){return{'name':_0x1cb1be['fieldName'],'type':_0x1cb1be[_0xa044('0x29')][_0xa044('0x2a')]};});_0x267512[_0xa044('0x2b')]=_[_0xa044('0x28')](_0x485212,_0xa044('0x26'));_0x267512[_0xa044('0x2c')]=_['keys'](_0x159519[_0xa044('0x2c')]);_0x267512[_0xa044('0x2d')]=_[_0xa044('0x2e')](_0x267512[_0xa044('0x2b')],_0x267512['query']);_0x4c72f3[_0xa044('0x2f')]=_[_0xa044('0x2e')](_0x267512['model'],qs['fields'](_0x159519[_0xa044('0x2c')][_0xa044('0x30')]));_0x4c72f3['attributes']=_0x4c72f3[_0xa044('0x2f')][_0xa044('0x31')]?_0x4c72f3[_0xa044('0x2f')]:_0x267512['model'];if(!_0x159519[_0xa044('0x2c')][_0xa044('0x32')](_0xa044('0x33'))){_0x4c72f3[_0xa044('0x1d')]=qs[_0xa044('0x1d')](_0x159519['query'][_0xa044('0x1d')]);_0x4c72f3[_0xa044('0x1f')]=qs[_0xa044('0x1f')](_0x159519['query'][_0xa044('0x1f')]);}_0x4c72f3[_0xa044('0x34')]=qs['sort'](_0x159519[_0xa044('0x2c')][_0xa044('0x35')]);_0x4c72f3[_0xa044('0x36')]=qs[_0xa044('0x2d')](_[_0xa044('0x37')](_0x159519[_0xa044('0x2c')],_0x267512[_0xa044('0x2d')]),_0x485212);if(_0x159519[_0xa044('0x2c')]['filter']){_0x4c72f3[_0xa044('0x36')]=_[_0xa044('0x38')](_0x4c72f3[_0xa044('0x36')],{'$or':_[_0xa044('0x28')](_0x485212,function(_0x20509c){if(_0x20509c['type']!==_0xa044('0x39')){var _0x529be2={};_0x529be2[_0x20509c[_0xa044('0x26')]]={'$like':'%'+_0x159519[_0xa044('0x2c')]['filter']+'%'};return _0x529be2;}})});}_0x4c72f3=_['merge']({},_0x4c72f3,_0x159519['options']);var _0x22386d={'where':_0x4c72f3[_0xa044('0x36')]};return db[_0xa044('0x3a')][_0xa044('0x1e')](_0x22386d)[_0xa044('0x24')](function(_0x73aa8b){_0x300b6e[_0xa044('0x1e')]=_0x73aa8b;if(_0x159519[_0xa044('0x2c')][_0xa044('0x3b')]){_0x4c72f3[_0xa044('0x3c')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xa044('0x3d')](_0x4c72f3);})[_0xa044('0x24')](function(_0x1e84c1){_0x300b6e[_0xa044('0x3e')]=_0x1e84c1;return _0x300b6e;})[_0xa044('0x24')](respondWithFilteredResult(_0x1362ef,_0x4c72f3))[_0xa044('0x3f')](handleError(_0x1362ef,null));};exports[_0xa044('0x40')]=function(_0xc9246f,_0x2863a5){var _0x1f1c35={'raw':!![],'where':{'id':_0xc9246f['params']['id']}},_0x4b9cf6={};_0x4b9cf6[_0xa044('0x2b')]=_['keys'](db[_0xa044('0x3a')][_0xa044('0x41')]);_0x4b9cf6[_0xa044('0x2c')]=_[_0xa044('0x42')](_0xc9246f[_0xa044('0x2c')]);_0x4b9cf6[_0xa044('0x2d')]=_['intersection'](_0x4b9cf6[_0xa044('0x2b')],_0x4b9cf6['query']);_0x1f1c35[_0xa044('0x2f')]=_[_0xa044('0x2e')](_0x4b9cf6[_0xa044('0x2b')],qs['fields'](_0xc9246f['query'][_0xa044('0x30')]));_0x1f1c35[_0xa044('0x2f')]=_0x1f1c35[_0xa044('0x2f')][_0xa044('0x31')]?_0x1f1c35[_0xa044('0x2f')]:_0x4b9cf6[_0xa044('0x2b')];if(_0xc9246f['query'][_0xa044('0x3b')]){_0x1f1c35[_0xa044('0x3c')]=[{'all':!![]}];}_0x1f1c35=_[_0xa044('0x38')]({},_0x1f1c35,_0xc9246f[_0xa044('0x43')]);return db[_0xa044('0x3a')][_0xa044('0x44')](_0x1f1c35)[_0xa044('0x24')](handleEntityNotFound(_0x2863a5,null))[_0xa044('0x24')](respondWithResult(_0x2863a5,null))[_0xa044('0x3f')](handleError(_0x2863a5,null));};exports[_0xa044('0x45')]=function(_0x13e4e3,_0x3d303a){return db[_0xa044('0x3a')]['create'](_0x13e4e3[_0xa044('0x46')],{})[_0xa044('0x24')](respondWithResult(_0x3d303a,0xc9))[_0xa044('0x3f')](handleError(_0x3d303a,null));};exports[_0xa044('0x23')]=function(_0x6bf8a0,_0x230ecf){if(_0x6bf8a0[_0xa044('0x46')]['id']){delete _0x6bf8a0['body']['id'];}return db['JscriptyAnswerReport'][_0xa044('0x44')]({'where':{'id':_0x6bf8a0[_0xa044('0x47')]['id']}})[_0xa044('0x24')](handleEntityNotFound(_0x230ecf,null))[_0xa044('0x24')](saveUpdates(_0x6bf8a0['body'],null))[_0xa044('0x24')](respondWithResult(_0x230ecf,null))[_0xa044('0x3f')](handleError(_0x230ecf,null));};exports[_0xa044('0x48')]=function(_0x390d24,_0x1b7877){return db[_0xa044('0x3a')]['find']({'where':{'id':_0x390d24[_0xa044('0x47')]['id']}})['then'](handleEntityNotFound(_0x1b7877,null))['then'](removeEntity(_0x1b7877,null))[_0xa044('0x3f')](handleError(_0x1b7877,null));};exports[_0xa044('0x49')]=function(_0x3ea870,_0x187ebd){return db['JscriptyAnswerReport']['describe']()['then'](respondWithResult(_0x187ebd,null))[_0xa044('0x3f')](handleError(_0x187ebd,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 471d4c2..33603c3 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 _0x6ef9=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash'];(function(_0x4b0e2d,_0x5e06b9){var _0x2703c2=function(_0x5b2bef){while(--_0x5b2bef){_0x4b0e2d['push'](_0x4b0e2d['shift']());}};_0x2703c2(++_0x5e06b9);}(_0x6ef9,0x7d));var _0x96ef=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6ef9[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x96ef('0x0'));var util=require(_0x96ef('0x1'));var logger=require(_0x96ef('0x2'))(_0x96ef('0x3'));var moment=require(_0x96ef('0x4'));var BPromise=require(_0x96ef('0x5'));var rp=require(_0x96ef('0x6'));var fs=require('fs');var path=require(_0x96ef('0x7'));var rimraf=require('rimraf');var config=require(_0x96ef('0x8'));var attributes=require(_0x96ef('0x9'));module[_0x96ef('0xa')]=function(_0x54adb0,_0x537b55){return _0x54adb0[_0x96ef('0xb')](_0x96ef('0xc'),attributes,{'tableName':_0x96ef('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd638=['JscriptyAnswerReport','lodash','util','bluebird','request-promise','path','rimraf','./jscriptyAnswerReport.attributes','exports','define'];(function(_0x53cc3e,_0x5937e2){var _0x1fec08=function(_0x167d0b){while(--_0x167d0b){_0x53cc3e['push'](_0x53cc3e['shift']());}};_0x1fec08(++_0x5937e2);}(_0xd638,0x12d));var _0x8d63=function(_0x1f4e10,_0x1db2a1){_0x1f4e10=_0x1f4e10-0x0;var _0x4c9c4d=_0xd638[_0x1f4e10];return _0x4c9c4d;};'use strict';var _=require(_0x8d63('0x0'));var util=require(_0x8d63('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8d63('0x2'));var rp=require(_0x8d63('0x3'));var fs=require('fs');var path=require(_0x8d63('0x4'));var rimraf=require(_0x8d63('0x5'));var config=require('../../config/environment');var attributes=require(_0x8d63('0x6'));module[_0x8d63('0x7')]=function(_0x16202b,_0x2624e5){return _0x16202b[_0x8d63('0x8')](_0x8d63('0x9'),attributes,{'tableName':'report_jscripty_answers','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 8e8a55b..67c0f1d 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 _0xef48=['info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x4dc0bc,_0x490bf0){var _0x470317=function(_0x324033){while(--_0x324033){_0x4dc0bc['push'](_0x4dc0bc['shift']());}};_0x470317(++_0x490bf0);}(_0xef48,0x17f));var _0x8ef4=function(_0x27e66c,_0x1379b8){_0x27e66c=_0x27e66c-0x0;var _0x358be1=_0xef48[_0x27e66c];return _0x358be1;};'use strict';var _=require(_0x8ef4('0x0'));var util=require(_0x8ef4('0x1'));var moment=require('moment');var BPromise=require(_0x8ef4('0x2'));var rs=require(_0x8ef4('0x3'));var fs=require('fs');var Redis=require(_0x8ef4('0x4'));var db=require(_0x8ef4('0x5'))['db'];var utils=require(_0x8ef4('0x6'));var logger=require(_0x8ef4('0x7'))('rpc');var config=require(_0x8ef4('0x8'));var jayson=require(_0x8ef4('0x9'));var client=jayson[_0x8ef4('0xa')][_0x8ef4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ac172,_0x78709d,_0x594f31){return new BPromise(function(_0x261dd6,_0x5770e7){return client[_0x8ef4('0xc')](_0x2ac172,_0x594f31)['then'](function(_0x13165f){logger[_0x8ef4('0xd')](_0x8ef4('0xe'),_0x78709d,_0x8ef4('0xf'));logger['debug'](_0x8ef4('0x10'),_0x78709d,_0x8ef4('0xf'),JSON[_0x8ef4('0x11')](_0x13165f));if(_0x13165f[_0x8ef4('0x12')]){if(_0x13165f[_0x8ef4('0x12')][_0x8ef4('0x13')]===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x78709d,_0x13165f[_0x8ef4('0x12')][_0x8ef4('0x14')]);return _0x5770e7(_0x13165f[_0x8ef4('0x12')]['message']);}logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x78709d,_0x13165f[_0x8ef4('0x12')][_0x8ef4('0x14')]);return _0x261dd6(_0x13165f[_0x8ef4('0x12')][_0x8ef4('0x14')]);}else{logger[_0x8ef4('0xd')](_0x8ef4('0xe'),_0x78709d,'request\x20sent');_0x261dd6(_0x13165f[_0x8ef4('0x15')]['message']);}})['catch'](function(_0x141bdc){logger['error'](_0x8ef4('0xe'),_0x78709d,_0x141bdc);_0x5770e7(_0x141bdc);});});} \ No newline at end of file +var _0x06aa=['moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','util'];(function(_0x368f45,_0x56bd0f){var _0x1e7198=function(_0x38355e){while(--_0x38355e){_0x368f45['push'](_0x368f45['shift']());}};_0x1e7198(++_0x56bd0f);}(_0x06aa,0x1da));var _0xa06a=function(_0x151884,_0x5819f9){_0x151884=_0x151884-0x0;var _0x5653ab=_0x06aa[_0x151884];return _0x5653ab;};'use strict';var _=require('lodash');var util=require(_0xa06a('0x0'));var moment=require(_0xa06a('0x1'));var BPromise=require(_0xa06a('0x2'));var rs=require(_0xa06a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa06a('0x4'));var logger=require(_0xa06a('0x5'))(_0xa06a('0x6'));var config=require('../../config/environment');var jayson=require(_0xa06a('0x7'));var client=jayson['client'][_0xa06a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x44d4a1,_0x319bf9,_0x3a9771){return new BPromise(function(_0x1c82b7,_0x1e1b3b){return client['request'](_0x44d4a1,_0x3a9771)[_0xa06a('0x9')](function(_0xa27503){logger[_0xa06a('0xa')](_0xa06a('0xb'),_0x319bf9,_0xa06a('0xc'));logger[_0xa06a('0xd')](_0xa06a('0xe'),_0x319bf9,_0xa06a('0xc'),JSON['stringify'](_0xa27503));if(_0xa27503[_0xa06a('0xf')]){if(_0xa27503[_0xa06a('0xf')]['code']===0x1f4){logger[_0xa06a('0xf')](_0xa06a('0xb'),_0x319bf9,_0xa27503[_0xa06a('0xf')][_0xa06a('0x10')]);return _0x1e1b3b(_0xa27503[_0xa06a('0xf')][_0xa06a('0x10')]);}logger[_0xa06a('0xf')](_0xa06a('0xb'),_0x319bf9,_0xa27503[_0xa06a('0xf')][_0xa06a('0x10')]);return _0x1c82b7(_0xa27503['error'][_0xa06a('0x10')]);}else{logger[_0xa06a('0xa')](_0xa06a('0xb'),_0x319bf9,_0xa06a('0xc'));_0x1c82b7(_0xa27503[_0xa06a('0x11')]['message']);}})[_0xa06a('0x12')](function(_0x28f70d){logger['error'](_0xa06a('0xb'),_0x319bf9,_0x28f70d);_0x1e1b3b(_0x28f70d);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 9bfc5fb..955c986 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 _0x2be5=['getSummary','post','/:id/clone','clone','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','./jscriptyProject.controller','get','isAuthenticated','index','show','/:id/sessions','/:id/answers','/:id/summary'];(function(_0x8bb4c1,_0x2d6e53){var _0x67a6e1=function(_0x1155e5){while(--_0x1155e5){_0x8bb4c1['push'](_0x8bb4c1['shift']());}};_0x67a6e1(++_0x2d6e53);}(_0x2be5,0x19a));var _0x52be=function(_0x4a8c11,_0x51c921){_0x4a8c11=_0x4a8c11-0x0;var _0x117508=_0x2be5[_0x4a8c11];return _0x117508;};'use strict';var multer=require(_0x52be('0x0'));var util=require(_0x52be('0x1'));var path=require(_0x52be('0x2'));var timeout=require(_0x52be('0x3'));var express=require(_0x52be('0x4'));var router=express[_0x52be('0x5')]();var fs_extra=require(_0x52be('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x52be('0x7'));router[_0x52be('0x8')]('/',auth[_0x52be('0x9')](),controller[_0x52be('0xa')]);router[_0x52be('0x8')]('/:id',auth[_0x52be('0x9')](),controller[_0x52be('0xb')]);router[_0x52be('0x8')](_0x52be('0xc'),auth['isAuthenticated'](),controller['getSessions']);router[_0x52be('0x8')](_0x52be('0xd'),auth[_0x52be('0x9')](),controller['getAnswers']);router[_0x52be('0x8')](_0x52be('0xe'),auth[_0x52be('0x9')](),timeout('30s'),controller[_0x52be('0xf')]);router[_0x52be('0x10')]('/',auth[_0x52be('0x9')](),controller['create']);router[_0x52be('0x10')](_0x52be('0x11'),auth[_0x52be('0x9')](),controller[_0x52be('0x12')]);router[_0x52be('0x13')](_0x52be('0x14'),auth[_0x52be('0x9')](),controller[_0x52be('0x15')]);router[_0x52be('0x16')]('/:id',auth[_0x52be('0x9')](),controller[_0x52be('0x17')]);module[_0x52be('0x18')]=router; \ No newline at end of file +var _0xf9c4=['/:id/summary','30s','getSummary','post','create','put','update','delete','exports','multer','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','index','/:id','show','/:id/sessions','isAuthenticated','getSessions','/:id/answers','getAnswers'];(function(_0x4f9467,_0x1b479e){var _0x13c8c0=function(_0x46cf0a){while(--_0x46cf0a){_0x4f9467['push'](_0x4f9467['shift']());}};_0x13c8c0(++_0x1b479e);}(_0xf9c4,0x86));var _0x4f9c=function(_0x2b744e,_0x3de5c7){_0x2b744e=_0x2b744e-0x0;var _0x8da216=_0xf9c4[_0x2b744e];return _0x8da216;};'use strict';var multer=require(_0x4f9c('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4f9c('0x1'));var router=express[_0x4f9c('0x2')]();var fs_extra=require(_0x4f9c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4f9c('0x4'));var config=require(_0x4f9c('0x5'));var controller=require(_0x4f9c('0x6'));router[_0x4f9c('0x7')]('/',auth['isAuthenticated'](),controller[_0x4f9c('0x8')]);router['get'](_0x4f9c('0x9'),auth['isAuthenticated'](),controller[_0x4f9c('0xa')]);router[_0x4f9c('0x7')](_0x4f9c('0xb'),auth[_0x4f9c('0xc')](),controller[_0x4f9c('0xd')]);router[_0x4f9c('0x7')](_0x4f9c('0xe'),auth[_0x4f9c('0xc')](),controller[_0x4f9c('0xf')]);router['get'](_0x4f9c('0x10'),auth[_0x4f9c('0xc')](),timeout(_0x4f9c('0x11')),controller[_0x4f9c('0x12')]);router[_0x4f9c('0x13')]('/',auth[_0x4f9c('0xc')](),controller[_0x4f9c('0x14')]);router[_0x4f9c('0x13')]('/:id/clone',auth[_0x4f9c('0xc')](),controller['clone']);router[_0x4f9c('0x15')](_0x4f9c('0x9'),auth[_0x4f9c('0xc')](),controller[_0x4f9c('0x16')]);router[_0x4f9c('0x17')](_0x4f9c('0x9'),auth[_0x4f9c('0xc')](),controller['destroy']);module[_0x4f9c('0x18')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index b617574..fb0ac8f 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 _0x0d53=['lodash','util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize'];(function(_0xbe40ad,_0x44343c){var _0x50fac9=function(_0xdaed07){while(--_0xdaed07){_0xbe40ad['push'](_0xbe40ad['shift']());}};_0x50fac9(++_0x44343c);}(_0x0d53,0x11c));var _0x30d5=function(_0x3fb034,_0x5a12fe){_0x3fb034=_0x3fb034-0x0;var _0x21dd32=_0x0d53[_0x3fb034];return _0x21dd32;};'use strict';var Sequelize=require(_0x30d5('0x0'));var _=require(_0x30d5('0x1'));var util=require(_0x30d5('0x2'));module[_0x30d5('0x3')]={'name':{'type':Sequelize[_0x30d5('0x4')],'unique':_0x30d5('0x5')},'description':{'type':Sequelize[_0x30d5('0x4')]},'formData':{'type':Sequelize[_0x30d5('0x6')](_0x30d5('0x7')),'set':function(_0x1c856d){if(_[_0x30d5('0x8')](_0x1c856d)){this[_0x30d5('0x9')](_0x30d5('0xa'),JSON['stringify'](_0x1c856d));}else if(_['isString'](_0x1c856d)){this[_0x30d5('0x9')](_0x30d5('0xa'),_0x1c856d);}else{this[_0x30d5('0x9')](_0x30d5('0xa'),util[_0x30d5('0xb')](_0x30d5('0xc'),this[_0x30d5('0xd')](_0x30d5('0x5'))||'',this[_0x30d5('0xd')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x30d5('0xe')],'defaultValue':![]}}; \ No newline at end of file +var _0x01e8=['exports','name','TEXT','long','setDataValue','formData','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize','lodash','util'];(function(_0x141f74,_0x420286){var _0x3a462f=function(_0x4e0c27){while(--_0x4e0c27){_0x141f74['push'](_0x141f74['shift']());}};_0x3a462f(++_0x420286);}(_0x01e8,0xc9));var _0x801e=function(_0x736eb,_0x345088){_0x736eb=_0x736eb-0x0;var _0x30ea13=_0x01e8[_0x736eb];return _0x30ea13;};'use strict';var Sequelize=require(_0x801e('0x0'));var _=require(_0x801e('0x1'));var util=require(_0x801e('0x2'));module[_0x801e('0x3')]={'name':{'type':Sequelize['STRING'],'unique':_0x801e('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x801e('0x5')](_0x801e('0x6')),'set':function(_0x4418e2){if(_['isObjectLike'](_0x4418e2)){this[_0x801e('0x7')]('formData',JSON['stringify'](_0x4418e2));}else if(_['isString'](_0x4418e2)){this[_0x801e('0x7')](_0x801e('0x8'),_0x4418e2);}else{this[_0x801e('0x7')](_0x801e('0x8'),util['format'](_0x801e('0x9'),this[_0x801e('0xa')](_0x801e('0x4'))||'',this['getDataValue']('description')||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x801e('0xb')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 748134b..def31d4 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 _0x723c=['nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','length','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','getSessions','findOne','JscriptySessionReport','order','pick','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','startTime','starttime','parse','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','Projects','error','stack','name','send','index','map','JscriptyProject','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x9e5cfb,_0x5e1a0f){var _0x5a3140=function(_0x287290){while(--_0x287290){_0x9e5cfb['push'](_0x9e5cfb['shift']());}};_0x5a3140(++_0x5e1a0f);}(_0x723c,0x1ad));var _0xc723=function(_0x3dc3fa,_0x39be5d){_0x3dc3fa=_0x3dc3fa-0x0;var _0x1df78e=_0x723c[_0x3dc3fa];return _0x1df78e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc723('0x0'));var zipdir=require(_0xc723('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc723('0x2'));var moment=require('moment');var BPromise=require(_0xc723('0x3'));var Mustache=require(_0xc723('0x4'));var util=require(_0xc723('0x5'));var path=require(_0xc723('0x6'));var sox=require(_0xc723('0x7'));var csv=require(_0xc723('0x8'));var ejs=require(_0xc723('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc723('0xa'));var squel=require(_0xc723('0xb'));var crypto=require('crypto');var jsforce=require(_0xc723('0xc'));var deskjs=require(_0xc723('0xd'));var toCsv=require(_0xc723('0x8'));var querystring=require(_0xc723('0xe'));var Papa=require(_0xc723('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc723('0x10'));var as=require(_0xc723('0x11'));var hardwareService=require(_0xc723('0x12'));var logger=require(_0xc723('0x13'))('api');var utils=require(_0xc723('0x14'));var config=require(_0xc723('0x15'));var licenseUtil=require(_0xc723('0x16'));var db=require(_0xc723('0x17'))['db'];function respondWithStatusCode(_0x3f4842,_0x5cffb4){_0x5cffb4=_0x5cffb4||0xcc;return function(_0x605b42){if(_0x605b42){return _0x3f4842[_0xc723('0x18')](_0x5cffb4);}return _0x3f4842[_0xc723('0x19')](_0x5cffb4)[_0xc723('0x1a')]();};}function respondWithResult(_0x2c7596,_0x4a3d86){_0x4a3d86=_0x4a3d86||0xc8;return function(_0x2e8be7){if(_0x2e8be7){return _0x2c7596['status'](_0x4a3d86)['json'](_0x2e8be7);}};}function respondWithFilteredResult(_0x1bb1ba,_0x110d83){return function(_0x212a77){if(_0x212a77){var _0x309574=typeof _0x110d83[_0xc723('0x1b')]===_0xc723('0x1c')&&typeof _0x110d83[_0xc723('0x1d')]===_0xc723('0x1c');var _0x5345a4=_0x212a77[_0xc723('0x1e')];var _0x41b4af=_0x309574?0x0:_0x110d83[_0xc723('0x1b')];var _0x100410=_0x309574?_0x212a77['count']:_0x110d83['offset']+_0x110d83[_0xc723('0x1d')];var _0x298470;if(_0x100410>=_0x5345a4){_0x100410=_0x5345a4;_0x298470=0xc8;}else{_0x298470=0xce;}_0x1bb1ba[_0xc723('0x19')](_0x298470);return _0x1bb1ba[_0xc723('0x1f')](_0xc723('0x20'),_0x41b4af+'-'+_0x100410+'/'+_0x5345a4)['json'](_0x212a77);}return null;};}function patchUpdates(_0x341584){return function(_0x23988a){try{jsonpatch[_0xc723('0x21')](_0x23988a,_0x341584,!![]);}catch(_0x172cf0){return BPromise[_0xc723('0x22')](_0x172cf0);}return _0x23988a[_0xc723('0x23')]();};}function saveUpdates(_0x38b980,_0x26b307){return function(_0x1de575){if(_0x1de575){return _0x1de575[_0xc723('0x24')](_0x38b980)[_0xc723('0x25')](function(_0xf77cc5){return _0xf77cc5;});}return null;};}function removeEntity(_0x545309,_0x16ae56){return function(_0x4cd1ee){if(_0x4cd1ee){return _0x4cd1ee[_0xc723('0x26')]()[_0xc723('0x25')](function(){var _0x1296e5=_0x4cd1ee['get']({'plain':!![]});var _0x41fb45=_0xc723('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x41fb45,'resourceId':_0x1296e5['id']}})[_0xc723('0x25')](function(){return _0x4cd1ee;});})[_0xc723('0x25')](function(){_0x545309[_0xc723('0x19')](0xcc)[_0xc723('0x1a')]();});}};}function handleEntityNotFound(_0x4066cd,_0x40a594){return function(_0x1670cf){if(!_0x1670cf){_0x4066cd[_0xc723('0x18')](0x194);}return _0x1670cf;};}function handleError(_0x5b9cb6,_0x567895){_0x567895=_0x567895||0x1f4;return function(_0x2ccef6){logger[_0xc723('0x28')](_0x2ccef6[_0xc723('0x29')]);if(_0x2ccef6['name']){delete _0x2ccef6[_0xc723('0x2a')];}_0x5b9cb6[_0xc723('0x19')](_0x567895)[_0xc723('0x2b')](_0x2ccef6);};}exports[_0xc723('0x2c')]=function(_0x4e874b,_0x14186d){var _0x13407b={},_0x81801={},_0x5acc14={'count':0x0,'rows':[]};var _0x35f71e=_[_0xc723('0x2d')](db[_0xc723('0x2e')]['rawAttributes'],function(_0x25f85d){return{'name':_0x25f85d['fieldName'],'type':_0x25f85d['type']['key']};});_0x81801[_0xc723('0x2f')]=_[_0xc723('0x2d')](_0x35f71e,'name');_0x81801[_0xc723('0x30')]=_[_0xc723('0x31')](_0x4e874b[_0xc723('0x30')]);_0x81801[_0xc723('0x32')]=_[_0xc723('0x33')](_0x81801[_0xc723('0x2f')],_0x81801[_0xc723('0x30')]);_0x13407b[_0xc723('0x34')]=_[_0xc723('0x33')](_0x81801[_0xc723('0x2f')],qs[_0xc723('0x35')](_0x4e874b[_0xc723('0x30')]['fields']));_0x13407b[_0xc723('0x34')]=_0x13407b['attributes']['length']?_0x13407b[_0xc723('0x34')]:_0x81801['model'];if(!_0x4e874b['query'][_0xc723('0x36')](_0xc723('0x37'))){_0x13407b[_0xc723('0x1d')]=qs[_0xc723('0x1d')](_0x4e874b['query'][_0xc723('0x1d')]);_0x13407b[_0xc723('0x1b')]=qs[_0xc723('0x1b')](_0x4e874b[_0xc723('0x30')][_0xc723('0x1b')]);}_0x13407b['order']=qs[_0xc723('0x38')](_0x4e874b[_0xc723('0x30')][_0xc723('0x38')]);_0x13407b[_0xc723('0x39')]=qs[_0xc723('0x32')](_['pick'](_0x4e874b[_0xc723('0x30')],_0x81801['filters']),_0x35f71e);if(_0x4e874b[_0xc723('0x30')][_0xc723('0x3a')]){_0x13407b[_0xc723('0x39')]=_[_0xc723('0x3b')](_0x13407b[_0xc723('0x39')],{'$or':_['map'](_0x35f71e,function(_0x41e738){if(_0x41e738[_0xc723('0x3c')]!==_0xc723('0x3d')){var _0x11682b={};_0x11682b[_0x41e738[_0xc723('0x2a')]]={'$like':'%'+_0x4e874b[_0xc723('0x30')]['filter']+'%'};return _0x11682b;}})});}_0x13407b=_['merge']({},_0x13407b,_0x4e874b[_0xc723('0x3e')]);var _0x17926b={'where':_0x13407b[_0xc723('0x39')]};return db[_0xc723('0x2e')][_0xc723('0x1e')](_0x17926b)['then'](function(_0x435b3b){_0x5acc14[_0xc723('0x1e')]=_0x435b3b;if(_0x4e874b[_0xc723('0x30')][_0xc723('0x3f')]){_0x13407b[_0xc723('0x40')]=[{'all':!![]}];}return db[_0xc723('0x2e')][_0xc723('0x41')](_0x13407b);})[_0xc723('0x25')](function(_0x3fd3ee){_0x5acc14[_0xc723('0x42')]=_0x3fd3ee;return _0x5acc14;})['then'](respondWithFilteredResult(_0x14186d,_0x13407b))['catch'](handleError(_0x14186d,null));};exports['show']=function(_0x379c5a,_0x50f4b7){var _0x926e98={'raw':![],'where':{'id':_0x379c5a[_0xc723('0x43')]['id']}},_0x26ad1e={};_0x26ad1e['model']=_['keys'](db['JscriptyProject'][_0xc723('0x44')]);_0x26ad1e[_0xc723('0x30')]=_[_0xc723('0x31')](_0x379c5a[_0xc723('0x30')]);_0x26ad1e['filters']=_[_0xc723('0x33')](_0x26ad1e[_0xc723('0x2f')],_0x26ad1e[_0xc723('0x30')]);_0x926e98[_0xc723('0x34')]=_[_0xc723('0x33')](_0x26ad1e['model'],qs[_0xc723('0x35')](_0x379c5a[_0xc723('0x30')][_0xc723('0x35')]));_0x926e98[_0xc723('0x34')]=_0x926e98[_0xc723('0x34')][_0xc723('0x45')]?_0x926e98[_0xc723('0x34')]:_0x26ad1e['model'];if(_0x379c5a[_0xc723('0x30')][_0xc723('0x3f')]){_0x926e98[_0xc723('0x40')]=[{'all':!![]}];}_0x926e98=_['merge']({},_0x926e98,_0x379c5a[_0xc723('0x3e')]);return db[_0xc723('0x2e')][_0xc723('0x46')](_0x926e98)[_0xc723('0x25')](handleEntityNotFound(_0x50f4b7,null))[_0xc723('0x25')](respondWithResult(_0x50f4b7,null))[_0xc723('0x47')](handleError(_0x50f4b7,null));};exports[_0xc723('0x48')]=function(_0x306b59,_0x21b2d3){return db[_0xc723('0x2e')][_0xc723('0x48')](_0x306b59[_0xc723('0x49')],{})['then'](function(_0x4968cd){var _0xed589a=_0x306b59['user'][_0xc723('0x4a')]({'plain':!![]});if(!_0xed589a)throw new Error(_0xc723('0x4b'));if(_0xed589a[_0xc723('0x4c')]===_0xc723('0x4d')){var _0x5ac977=_0x4968cd[_0xc723('0x4a')]({'plain':!![]});var _0x1dbe41=_0xc723('0x27');return db[_0xc723('0x4e')][_0xc723('0x46')]({'where':{'name':_0x1dbe41,'userProfileId':_0xed589a[_0xc723('0x4f')]},'raw':!![]})[_0xc723('0x25')](function(_0x5ad852){if(_0x5ad852&&_0x5ad852[_0xc723('0x50')]===0x0){return db[_0xc723('0x51')][_0xc723('0x48')]({'name':_0x5ac977[_0xc723('0x2a')],'resourceId':_0x5ac977['id'],'type':_0x5ad852[_0xc723('0x2a')],'sectionId':_0x5ad852['id']},{})[_0xc723('0x25')](function(){return _0x4968cd;});}else{return _0x4968cd;}})['catch'](function(_0x4ab440){logger[_0xc723('0x28')](_0xc723('0x52'),_0x4ab440);throw _0x4ab440;});}return _0x4968cd;})['then'](respondWithResult(_0x21b2d3,0xc9))[_0xc723('0x47')](handleError(_0x21b2d3,null));};exports[_0xc723('0x53')]=function(_0x106904,_0x9ad9d8){var _0x3c0dfa={'where':{'id':_0x106904[_0xc723('0x43')]['id']}},_0x3a5fc2={};_0x3a5fc2[_0xc723('0x2f')]=_['keys'](db[_0xc723('0x2e')][_0xc723('0x44')]);_0x3c0dfa['attributes']=_[_0xc723('0x33')](_0x3a5fc2[_0xc723('0x2f')],qs[_0xc723('0x35')](_0x106904['query']['fields']));_0x3c0dfa[_0xc723('0x34')]=_0x3c0dfa[_0xc723('0x34')]['length']?_0x3c0dfa['attributes']:_0x3a5fc2['model'];if(_0x106904[_0xc723('0x30')]['includeAll']){_0x3c0dfa['include']=[{'all':!![]}];}_0x3c0dfa=_['merge']({},_0x3c0dfa,_0x106904[_0xc723('0x3e')]);return db[_0xc723('0x2e')][_0xc723('0x46')](_0x3c0dfa)[_0xc723('0x25')](handleEntityNotFound(_0x9ad9d8,null))['then'](function(_0x1b0fad){if(_0x1b0fad){var _0x64beb=_0x1b0fad['get']({'plain':!![]});_0x64beb=qs['omit'](_0x64beb,['id',_0xc723('0x54'),_0xc723('0x55')]);_0x106904[_0xc723('0x49')]=_[_0xc723('0x56')](_0x106904[_0xc723('0x49')],['id','createdAt',_0xc723('0x55')]);return db['JscriptyProject'][_0xc723('0x48')](_[_0xc723('0x3b')](_0x64beb,_0x106904['body']),{'include':_0x106904['query'][_0xc723('0x3f')]?[{'all':!![]}]:undefined})[_0xc723('0x25')](function(_0x58b772){var _0x4830f4=_0x106904[_0xc723('0x4d')]['get']({'plain':!![]});if(!_0x4830f4)throw new Error(_0xc723('0x4b'));if(_0x4830f4[_0xc723('0x4c')]===_0xc723('0x4d')){var _0x2a1a1e=_0x58b772[_0xc723('0x4a')]({'plain':!![]});var _0x42c410=_0xc723('0x27');return db[_0xc723('0x4e')][_0xc723('0x46')]({'where':{'name':_0x42c410,'userProfileId':_0x4830f4[_0xc723('0x4f')]},'raw':!![]})[_0xc723('0x25')](function(_0x50c40e){if(_0x50c40e&&_0x50c40e[_0xc723('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x2a1a1e[_0xc723('0x2a')],'resourceId':_0x2a1a1e['id'],'type':_0x50c40e[_0xc723('0x2a')],'sectionId':_0x50c40e['id']},{})['then'](function(){return _0x58b772;});}else{return _0x58b772;}})['catch'](function(_0x38cc10){logger[_0xc723('0x28')](_0xc723('0x52'),_0x38cc10);throw _0x38cc10;});}return _0x58b772;});}})[_0xc723('0x25')](respondWithResult(_0x9ad9d8,0xc9))['catch'](handleError(_0x9ad9d8,null));};exports[_0xc723('0x24')]=function(_0x140217,_0x253143){if(_0x140217[_0xc723('0x49')]['id']){delete _0x140217[_0xc723('0x49')]['id'];}return db[_0xc723('0x2e')][_0xc723('0x46')]({'where':{'id':_0x140217[_0xc723('0x43')]['id']}})[_0xc723('0x25')](handleEntityNotFound(_0x253143,null))['then'](saveUpdates(_0x140217[_0xc723('0x49')],null))[_0xc723('0x25')](respondWithResult(_0x253143,null))['catch'](handleError(_0x253143,null));};exports[_0xc723('0x26')]=function(_0x3a4d5c,_0x1f3698){return db[_0xc723('0x2e')][_0xc723('0x46')]({'where':{'id':_0x3a4d5c[_0xc723('0x43')]['id']}})['then'](handleEntityNotFound(_0x1f3698,null))[_0xc723('0x25')](removeEntity(_0x1f3698,null))['catch'](handleError(_0x1f3698,null));};exports[_0xc723('0x57')]=function(_0x4126e7,_0x161c6e,_0x3cbf88){var _0xfc5900={'raw':!![],'where':{}};var _0x9c54dd={};var _0x13dc98={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xc723('0x58')]({'where':{'id':_0x4126e7[_0xc723('0x43')]['id']}})[_0xc723('0x25')](handleEntityNotFound(_0x161c6e,null))[_0xc723('0x25')](function(_0x2f22be){if(_0x2f22be){_0x9c54dd[_0xc723('0x2f')]=_['keys'](db[_0xc723('0x59')][_0xc723('0x44')]);_0x9c54dd[_0xc723('0x30')]=_[_0xc723('0x31')](_0x4126e7['query']);_0x9c54dd['filters']=_[_0xc723('0x33')](_0x9c54dd[_0xc723('0x2f')],_0x9c54dd['query']);_0xfc5900['attributes']=_['intersection'](_0x9c54dd[_0xc723('0x2f')],qs[_0xc723('0x35')](_0x4126e7[_0xc723('0x30')][_0xc723('0x35')]));_0xfc5900[_0xc723('0x34')]=_0xfc5900[_0xc723('0x34')]['length']?_0xfc5900[_0xc723('0x34')]:_0x9c54dd['model'];if(!_0x4126e7[_0xc723('0x30')][_0xc723('0x36')](_0xc723('0x37'))){_0xfc5900[_0xc723('0x1d')]=qs[_0xc723('0x1d')](_0x4126e7['query']['limit']);_0xfc5900[_0xc723('0x1b')]=qs[_0xc723('0x1b')](_0x4126e7[_0xc723('0x30')][_0xc723('0x1b')]);}_0xfc5900[_0xc723('0x5a')]=qs['sort'](_0x4126e7['query'][_0xc723('0x38')]);_0xfc5900[_0xc723('0x39')]=qs[_0xc723('0x32')](_[_0xc723('0x5b')](_0x4126e7[_0xc723('0x30')],_0x9c54dd[_0xc723('0x32')]));_0xfc5900[_0xc723('0x39')][_0xc723('0x5c')]=_0x2f22be['id'];if(_0x4126e7['query'][_0xc723('0x3a')]){_0xfc5900[_0xc723('0x39')]=_['merge'](_0xfc5900['where'],{'$or':_[_0xc723('0x2d')](_0xfc5900[_0xc723('0x34')],function(_0x16bfa0){var _0x1120dc={};_0x1120dc[_0x16bfa0]={'$like':'%'+_0x4126e7[_0xc723('0x30')]['filter']+'%'};return _0x1120dc;})});}_0xfc5900=_[_0xc723('0x3b')]({},_0xfc5900,_0x4126e7[_0xc723('0x3e')]);return db[_0xc723('0x59')][_0xc723('0x1e')]({'where':_0xfc5900[_0xc723('0x39')]})[_0xc723('0x25')](function(_0x246e59){_0x13dc98[_0xc723('0x1e')]=_0x246e59;if(_0x4126e7[_0xc723('0x30')]['includeAll']){_0xfc5900[_0xc723('0x40')]=[{'all':!![]}];}return db[_0xc723('0x59')][_0xc723('0x41')](_0xfc5900);})[_0xc723('0x25')](function(_0x21daa8){_0x13dc98[_0xc723('0x42')]=_0x21daa8;return _0x13dc98;});}})[_0xc723('0x25')](respondWithFilteredResult(_0x161c6e,_0xfc5900))[_0xc723('0x47')](handleError(_0x161c6e,null));};exports[_0xc723('0x5d')]=function(_0x3e0006,_0xd73d21,_0x1fd012){var _0x271e8b={'raw':!![],'where':{}};var _0x4662f9={};var _0x4bab1a={'count':0x0,'rows':[]};return db[_0xc723('0x2e')][_0xc723('0x58')]({'where':{'id':_0x3e0006[_0xc723('0x43')]['id']}})['then'](handleEntityNotFound(_0xd73d21,null))[_0xc723('0x25')](function(_0x54070b){if(_0x54070b){_0x4662f9['model']=_[_0xc723('0x31')](db[_0xc723('0x5e')][_0xc723('0x44')]);_0x4662f9['query']=_['keys'](_0x3e0006['query']);_0x4662f9[_0xc723('0x32')]=_[_0xc723('0x33')](_0x4662f9[_0xc723('0x2f')],_0x4662f9[_0xc723('0x30')]);_0x271e8b[_0xc723('0x34')]=_[_0xc723('0x33')](_0x4662f9[_0xc723('0x2f')],qs[_0xc723('0x35')](_0x3e0006['query']['fields']));_0x271e8b[_0xc723('0x34')]=_0x271e8b[_0xc723('0x34')][_0xc723('0x45')]?_0x271e8b[_0xc723('0x34')]:_0x4662f9['model'];if(!_0x3e0006[_0xc723('0x30')][_0xc723('0x36')]('nolimit')){_0x271e8b[_0xc723('0x1d')]=qs[_0xc723('0x1d')](_0x3e0006[_0xc723('0x30')]['limit']);_0x271e8b[_0xc723('0x1b')]=qs[_0xc723('0x1b')](_0x3e0006['query'][_0xc723('0x1b')]);}_0x271e8b['order']=qs[_0xc723('0x38')](_0x3e0006['query']['sort']);_0x271e8b[_0xc723('0x39')]=qs['filters'](_['pick'](_0x3e0006[_0xc723('0x30')],_0x4662f9['filters']));_0x271e8b[_0xc723('0x39')][_0xc723('0x5c')]=_0x54070b['id'];if(_0x3e0006[_0xc723('0x30')][_0xc723('0x3a')]){_0x271e8b['where']=_[_0xc723('0x3b')](_0x271e8b[_0xc723('0x39')],{'$or':_[_0xc723('0x2d')](_0x271e8b['attributes'],function(_0x4d351b){var _0x4b6a5f={};_0x4b6a5f[_0x4d351b]={'$like':'%'+_0x3e0006['query'][_0xc723('0x3a')]+'%'};return _0x4b6a5f;})});}_0x271e8b=_['merge']({},_0x271e8b,_0x3e0006[_0xc723('0x3e')]);return db['JscriptyAnswerReport']['count']({'where':_0x271e8b[_0xc723('0x39')]})['then'](function(_0x2880e1){_0x4bab1a['count']=_0x2880e1;if(_0x3e0006[_0xc723('0x30')][_0xc723('0x3f')]){_0x271e8b['include']=[{'all':!![]}];}return db[_0xc723('0x5e')][_0xc723('0x41')](_0x271e8b);})[_0xc723('0x25')](function(_0x5438cc){_0x4bab1a[_0xc723('0x42')]=_0x5438cc;return _0x4bab1a;});}})[_0xc723('0x25')](respondWithFilteredResult(_0xd73d21,_0x271e8b))[_0xc723('0x47')](handleError(_0xd73d21,null));};function char(_0x3efe2e){return _0xc723('0x5f')===typeof _0x3efe2e?String[_0xc723('0x60')][_0xc723('0x21')](null,arguments):_0x3efe2e;}function needsEncapsulation(_0xaeff02){return!!_0xaeff02&&(_0xaeff02[_0xc723('0x61')]()[_0xc723('0x62')](char(0xd))>=0x0||_0xaeff02[_0xc723('0x61')]()[_0xc723('0x62')](char(0xa))>=0x0||_0xaeff02['toString']()['indexOf'](char(0x2c))>=0x0||_0xaeff02['toString']()[_0xc723('0x62')](char(0x22))>=0x0);}function encapsulate(_0x4f1804){var _0x24f65f=char(0x22),_0x21b35d='\x5c'+char(0x22),_0x207b02=_0x4f1804[_0xc723('0x61')]()[_0xc723('0x63')](new RegExp(_0x24f65f,'g'),_0x21b35d);return _0x24f65f+_0x207b02+_0x24f65f;}exports['getSummary']=function(_0x5855ed,_0x1d3356,_0x15d8f9){var _0x3552fe,_0x23f206;var _0x24b6a2={'where':{'ProjectId':_0x5855ed[_0xc723('0x43')]['id']}};if(_0x5855ed[_0xc723('0x30')][_0xc723('0x64')]){_0x24b6a2[_0xc723('0x39')][_0xc723('0x65')]=JSON[_0xc723('0x66')](_0x5855ed[_0xc723('0x30')]['startTime']);}return db['JscriptySessionReport'][_0xc723('0x41')](_0x24b6a2)['then'](handleEntityNotFound(_0x1d3356,null))[_0xc723('0x25')](function(_0x4f596d){if(_0x4f596d){_0x3552fe=_0x4f596d;return db['JscriptyQuestionReport'][_0xc723('0x41')]({'where':{'SessionId':{'$in':_[_0xc723('0x2d')](_0x3552fe,'id')},'ProjectId':_0x5855ed['params']['id']},'order':_0xc723('0x67')});}})[_0xc723('0x25')](handleEntityNotFound(_0x1d3356,null))[_0xc723('0x25')](function(_0x58247b){if(_0x58247b){_0x23f206=_0x58247b;var _0x96a83b={};for(var _0x3c07ff=0x0,_0x29b5c2=_0x23f206[_0xc723('0x45')];_0x3c07ff<_0x29b5c2;_0x3c07ff++){if(!_0x96a83b[_0xc723('0x36')](_0x23f206[_0x3c07ff][_0xc723('0x68')])){_0x96a83b[_0x23f206[_0x3c07ff][_0xc723('0x68')]]=needsEncapsulation(_0x23f206[_0x3c07ff][_0xc723('0x69')])?encapsulate(_0x23f206[_0x3c07ff][_0xc723('0x69')]):_0x23f206[_0x3c07ff][_0xc723('0x69')];}}var _0x2cabd5=[],_0x5d2f81={};for(var _0x2693fd=0x0,_0x9109d0=_0x3552fe[_0xc723('0x45')];_0x2693fd<_0x9109d0;_0x2693fd++){_0x5d2f81={'ProjectId':_0x5855ed[_0xc723('0x43')]['id'],'SessionId':_0x3552fe[_0x2693fd]['id'],'StartTime':moment(_0x3552fe[_0x2693fd][_0xc723('0x65')])[_0xc723('0x6a')](_0xc723('0x6b'))};for(var _0x3fe7d4=0x0,_0x430ec2=_0x23f206[_0xc723('0x45')];_0x3fe7d4<_0x430ec2;_0x3fe7d4++){if(_0x23f206[_0x3fe7d4][_0xc723('0x6c')]==_0x3552fe[_0x2693fd]['id']&&_0x96a83b[_0xc723('0x36')](_0x23f206[_0x3fe7d4]['questionId'])){_0x5d2f81[_0x96a83b[_0x23f206[_0x3fe7d4][_0xc723('0x68')]]]=_0x23f206[_0x3fe7d4][_0xc723('0x6d')];}}for(var _0x34dc9a in _0x96a83b){if(!_0x5d2f81[_0xc723('0x36')](_0x96a83b[_0x34dc9a])){_0x5d2f81[_0x96a83b[_0x34dc9a]]=null;}}_0x2cabd5[_0xc723('0x6e')](_0x5d2f81);}return _0x2cabd5;}})[_0xc723('0x25')](function(_0x4a775e){if(!_['isEmpty'](_0x4a775e)){var _0x4b79e6=toCsv(_0x4a775e);var _0x4be1bc=Date[_0xc723('0x6f')]();fs[_0xc723('0x70')](util['format'](_0xc723('0x71'),_0x5855ed['params']['id'],_0x4be1bc),_0x4b79e6);_0x1d3356[_0xc723('0x72')](_0xc723('0x73'),_0xc723('0x74')+util[_0xc723('0x6a')](_0xc723('0x75'),_0x5855ed[_0xc723('0x43')]['id'],_0x4be1bc));_0x1d3356[_0xc723('0x72')](_0xc723('0x76'),_0xc723('0x77'));return _0x1d3356[_0xc723('0x78')](util[_0xc723('0x6a')](_0xc723('0x71'),_0x5855ed[_0xc723('0x43')]['id'],_0x4be1bc));}else{return _0x1d3356['sendStatus'](0xcc);}})[_0xc723('0x47')](handleError(_0x1d3356,null));}; \ No newline at end of file +var _0xedd7=['lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','destroy','then','get','UserProfileResource','error','stack','name','send','index','JscriptyProject','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Projects','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','UserProfileSection','autoAssociation','JscriptySessionReport','nolimit','ProjectId','findAll','getAnswers','findOne','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now','writeFileSync','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra'];(function(_0x27530d,_0x46480a){var _0x59e561=function(_0x395fe9){while(--_0x395fe9){_0x27530d['push'](_0x27530d['shift']());}};_0x59e561(++_0x46480a);}(_0xedd7,0x6f));var _0x7edd=function(_0x21eef2,_0x1480ea){_0x21eef2=_0x21eef2-0x0;var _0x32f106=_0xedd7[_0x21eef2];return _0x32f106;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7edd('0x0'));var zipdir=require(_0x7edd('0x1'));var jsonpatch=require(_0x7edd('0x2'));var rp=require(_0x7edd('0x3'));var moment=require(_0x7edd('0x4'));var BPromise=require(_0x7edd('0x5'));var Mustache=require(_0x7edd('0x6'));var util=require('util');var path=require(_0x7edd('0x7'));var sox=require(_0x7edd('0x8'));var csv=require(_0x7edd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7edd('0xa'));var _=require(_0x7edd('0xb'));var squel=require('squel');var crypto=require(_0x7edd('0xc'));var jsforce=require(_0x7edd('0xd'));var deskjs=require(_0x7edd('0xe'));var toCsv=require(_0x7edd('0x9'));var querystring=require(_0x7edd('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7edd('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7edd('0x11'));var logger=require(_0x7edd('0x12'))(_0x7edd('0x13'));var utils=require(_0x7edd('0x14'));var config=require(_0x7edd('0x15'));var licenseUtil=require(_0x7edd('0x16'));var db=require(_0x7edd('0x17'))['db'];function respondWithStatusCode(_0x175c0f,_0xac17dd){_0xac17dd=_0xac17dd||0xcc;return function(_0x47e451){if(_0x47e451){return _0x175c0f[_0x7edd('0x18')](_0xac17dd);}return _0x175c0f[_0x7edd('0x19')](_0xac17dd)[_0x7edd('0x1a')]();};}function respondWithResult(_0x247779,_0x388cdb){_0x388cdb=_0x388cdb||0xc8;return function(_0x29260c){if(_0x29260c){return _0x247779[_0x7edd('0x19')](_0x388cdb)['json'](_0x29260c);}};}function respondWithFilteredResult(_0x29d096,_0x5b207e){return function(_0xb51f73){if(_0xb51f73){var _0x2bdb01=typeof _0x5b207e[_0x7edd('0x1b')]===_0x7edd('0x1c')&&typeof _0x5b207e[_0x7edd('0x1d')]===_0x7edd('0x1c');var _0x3bee63=_0xb51f73[_0x7edd('0x1e')];var _0x3999ee=_0x2bdb01?0x0:_0x5b207e[_0x7edd('0x1b')];var _0x268950=_0x2bdb01?_0xb51f73[_0x7edd('0x1e')]:_0x5b207e[_0x7edd('0x1b')]+_0x5b207e[_0x7edd('0x1d')];var _0x108266;if(_0x268950>=_0x3bee63){_0x268950=_0x3bee63;_0x108266=0xc8;}else{_0x108266=0xce;}_0x29d096[_0x7edd('0x19')](_0x108266);return _0x29d096[_0x7edd('0x1f')](_0x7edd('0x20'),_0x3999ee+'-'+_0x268950+'/'+_0x3bee63)[_0x7edd('0x21')](_0xb51f73);}return null;};}function patchUpdates(_0x5ee727){return function(_0x2b137c){try{jsonpatch[_0x7edd('0x22')](_0x2b137c,_0x5ee727,!![]);}catch(_0x47944f){return BPromise['reject'](_0x47944f);}return _0x2b137c[_0x7edd('0x23')]();};}function saveUpdates(_0x152e78,_0x3634e0){return function(_0x39d4fb){if(_0x39d4fb){return _0x39d4fb[_0x7edd('0x24')](_0x152e78)['then'](function(_0x19b046){return _0x19b046;});}return null;};}function removeEntity(_0xebbb32,_0x2847a1){return function(_0x4d7bf2){if(_0x4d7bf2){return _0x4d7bf2[_0x7edd('0x25')]()[_0x7edd('0x26')](function(){var _0x48c970=_0x4d7bf2[_0x7edd('0x27')]({'plain':!![]});var _0x45ed35='Projects';return db[_0x7edd('0x28')]['destroy']({'where':{'type':_0x45ed35,'resourceId':_0x48c970['id']}})[_0x7edd('0x26')](function(){return _0x4d7bf2;});})[_0x7edd('0x26')](function(){_0xebbb32[_0x7edd('0x19')](0xcc)[_0x7edd('0x1a')]();});}};}function handleEntityNotFound(_0x446332,_0x153323){return function(_0x244f3c){if(!_0x244f3c){_0x446332['sendStatus'](0x194);}return _0x244f3c;};}function handleError(_0x4dc746,_0x410742){_0x410742=_0x410742||0x1f4;return function(_0x33fa6d){logger[_0x7edd('0x29')](_0x33fa6d[_0x7edd('0x2a')]);if(_0x33fa6d['name']){delete _0x33fa6d[_0x7edd('0x2b')];}_0x4dc746[_0x7edd('0x19')](_0x410742)[_0x7edd('0x2c')](_0x33fa6d);};}exports[_0x7edd('0x2d')]=function(_0x3ce616,_0x3a6188){var _0x385018={},_0x541845={},_0x396b3a={'count':0x0,'rows':[]};var _0x295e24=_['map'](db[_0x7edd('0x2e')][_0x7edd('0x2f')],function(_0x39ed81){return{'name':_0x39ed81[_0x7edd('0x30')],'type':_0x39ed81[_0x7edd('0x31')][_0x7edd('0x32')]};});_0x541845[_0x7edd('0x33')]=_[_0x7edd('0x34')](_0x295e24,'name');_0x541845[_0x7edd('0x35')]=_[_0x7edd('0x36')](_0x3ce616[_0x7edd('0x35')]);_0x541845[_0x7edd('0x37')]=_[_0x7edd('0x38')](_0x541845[_0x7edd('0x33')],_0x541845['query']);_0x385018[_0x7edd('0x39')]=_[_0x7edd('0x38')](_0x541845[_0x7edd('0x33')],qs[_0x7edd('0x3a')](_0x3ce616[_0x7edd('0x35')][_0x7edd('0x3a')]));_0x385018[_0x7edd('0x39')]=_0x385018[_0x7edd('0x39')][_0x7edd('0x3b')]?_0x385018[_0x7edd('0x39')]:_0x541845['model'];if(!_0x3ce616[_0x7edd('0x35')][_0x7edd('0x3c')]('nolimit')){_0x385018[_0x7edd('0x1d')]=qs[_0x7edd('0x1d')](_0x3ce616[_0x7edd('0x35')]['limit']);_0x385018[_0x7edd('0x1b')]=qs['offset'](_0x3ce616[_0x7edd('0x35')][_0x7edd('0x1b')]);}_0x385018[_0x7edd('0x3d')]=qs[_0x7edd('0x3e')](_0x3ce616['query'][_0x7edd('0x3e')]);_0x385018[_0x7edd('0x3f')]=qs[_0x7edd('0x37')](_[_0x7edd('0x40')](_0x3ce616[_0x7edd('0x35')],_0x541845[_0x7edd('0x37')]),_0x295e24);if(_0x3ce616['query'][_0x7edd('0x41')]){_0x385018[_0x7edd('0x3f')]=_[_0x7edd('0x42')](_0x385018['where'],{'$or':_[_0x7edd('0x34')](_0x295e24,function(_0x1dbca2){if(_0x1dbca2[_0x7edd('0x31')]!=='VIRTUAL'){var _0x512f12={};_0x512f12[_0x1dbca2['name']]={'$like':'%'+_0x3ce616[_0x7edd('0x35')][_0x7edd('0x41')]+'%'};return _0x512f12;}})});}_0x385018=_['merge']({},_0x385018,_0x3ce616[_0x7edd('0x43')]);var _0x4d04e1={'where':_0x385018[_0x7edd('0x3f')]};return db['JscriptyProject'][_0x7edd('0x1e')](_0x4d04e1)['then'](function(_0x307d87){_0x396b3a[_0x7edd('0x1e')]=_0x307d87;if(_0x3ce616['query'][_0x7edd('0x44')]){_0x385018[_0x7edd('0x45')]=[{'all':!![]}];}return db[_0x7edd('0x2e')]['findAll'](_0x385018);})['then'](function(_0x925654){_0x396b3a[_0x7edd('0x46')]=_0x925654;return _0x396b3a;})['then'](respondWithFilteredResult(_0x3a6188,_0x385018))[_0x7edd('0x47')](handleError(_0x3a6188,null));};exports[_0x7edd('0x48')]=function(_0x193a1f,_0x18e73e){var _0x32d77c={'raw':![],'where':{'id':_0x193a1f[_0x7edd('0x49')]['id']}},_0x319f11={};_0x319f11['model']=_[_0x7edd('0x36')](db[_0x7edd('0x2e')][_0x7edd('0x2f')]);_0x319f11[_0x7edd('0x35')]=_[_0x7edd('0x36')](_0x193a1f[_0x7edd('0x35')]);_0x319f11['filters']=_['intersection'](_0x319f11[_0x7edd('0x33')],_0x319f11[_0x7edd('0x35')]);_0x32d77c['attributes']=_[_0x7edd('0x38')](_0x319f11[_0x7edd('0x33')],qs[_0x7edd('0x3a')](_0x193a1f[_0x7edd('0x35')][_0x7edd('0x3a')]));_0x32d77c[_0x7edd('0x39')]=_0x32d77c[_0x7edd('0x39')][_0x7edd('0x3b')]?_0x32d77c['attributes']:_0x319f11[_0x7edd('0x33')];if(_0x193a1f[_0x7edd('0x35')]['includeAll']){_0x32d77c[_0x7edd('0x45')]=[{'all':!![]}];}_0x32d77c=_['merge']({},_0x32d77c,_0x193a1f['options']);return db[_0x7edd('0x2e')][_0x7edd('0x4a')](_0x32d77c)[_0x7edd('0x26')](handleEntityNotFound(_0x18e73e,null))[_0x7edd('0x26')](respondWithResult(_0x18e73e,null))['catch'](handleError(_0x18e73e,null));};exports[_0x7edd('0x4b')]=function(_0x24735f,_0x326230){return db[_0x7edd('0x2e')][_0x7edd('0x4b')](_0x24735f[_0x7edd('0x4c')],{})[_0x7edd('0x26')](function(_0x48ded2){var _0x2fb9c8=_0x24735f['user'][_0x7edd('0x27')]({'plain':!![]});if(!_0x2fb9c8)throw new Error(_0x7edd('0x4d'));if(_0x2fb9c8[_0x7edd('0x4e')]===_0x7edd('0x4f')){var _0x438c27=_0x48ded2[_0x7edd('0x27')]({'plain':!![]});var _0x34d3e4=_0x7edd('0x50');return db['UserProfileSection'][_0x7edd('0x4a')]({'where':{'name':_0x34d3e4,'userProfileId':_0x2fb9c8[_0x7edd('0x51')]},'raw':!![]})[_0x7edd('0x26')](function(_0x572146){if(_0x572146&&_0x572146['autoAssociation']===0x0){return db[_0x7edd('0x28')]['create']({'name':_0x438c27['name'],'resourceId':_0x438c27['id'],'type':_0x572146[_0x7edd('0x2b')],'sectionId':_0x572146['id']},{})[_0x7edd('0x26')](function(){return _0x48ded2;});}else{return _0x48ded2;}})[_0x7edd('0x47')](function(_0x4830d6){logger[_0x7edd('0x29')](_0x7edd('0x52'),_0x4830d6);throw _0x4830d6;});}return _0x48ded2;})[_0x7edd('0x26')](respondWithResult(_0x326230,0xc9))[_0x7edd('0x47')](handleError(_0x326230,null));};exports[_0x7edd('0x53')]=function(_0x13b461,_0x3b6d43){var _0x48b4eb={'where':{'id':_0x13b461['params']['id']}},_0x7ab3af={};_0x7ab3af[_0x7edd('0x33')]=_['keys'](db[_0x7edd('0x2e')][_0x7edd('0x2f')]);_0x48b4eb['attributes']=_[_0x7edd('0x38')](_0x7ab3af[_0x7edd('0x33')],qs[_0x7edd('0x3a')](_0x13b461[_0x7edd('0x35')][_0x7edd('0x3a')]));_0x48b4eb[_0x7edd('0x39')]=_0x48b4eb['attributes']['length']?_0x48b4eb['attributes']:_0x7ab3af['model'];if(_0x13b461[_0x7edd('0x35')]['includeAll']){_0x48b4eb[_0x7edd('0x45')]=[{'all':!![]}];}_0x48b4eb=_['merge']({},_0x48b4eb,_0x13b461[_0x7edd('0x43')]);return db[_0x7edd('0x2e')]['find'](_0x48b4eb)[_0x7edd('0x26')](handleEntityNotFound(_0x3b6d43,null))[_0x7edd('0x26')](function(_0x464d5e){if(_0x464d5e){var _0xcbcb5c=_0x464d5e[_0x7edd('0x27')]({'plain':!![]});_0xcbcb5c=qs[_0x7edd('0x54')](_0xcbcb5c,['id','createdAt','updatedAt']);_0x13b461['body']=_[_0x7edd('0x54')](_0x13b461[_0x7edd('0x4c')],['id',_0x7edd('0x55'),_0x7edd('0x56')]);return db['JscriptyProject']['create'](_[_0x7edd('0x42')](_0xcbcb5c,_0x13b461['body']),{'include':_0x13b461[_0x7edd('0x35')][_0x7edd('0x44')]?[{'all':!![]}]:undefined})[_0x7edd('0x26')](function(_0x2b984b){var _0x11d55d=_0x13b461['user']['get']({'plain':!![]});if(!_0x11d55d)throw new Error(_0x7edd('0x4d'));if(_0x11d55d[_0x7edd('0x4e')]===_0x7edd('0x4f')){var _0x2a29ec=_0x2b984b[_0x7edd('0x27')]({'plain':!![]});var _0x4ddad1=_0x7edd('0x50');return db[_0x7edd('0x57')][_0x7edd('0x4a')]({'where':{'name':_0x4ddad1,'userProfileId':_0x11d55d[_0x7edd('0x51')]},'raw':!![]})['then'](function(_0x53eae4){if(_0x53eae4&&_0x53eae4[_0x7edd('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x2a29ec[_0x7edd('0x2b')],'resourceId':_0x2a29ec['id'],'type':_0x53eae4[_0x7edd('0x2b')],'sectionId':_0x53eae4['id']},{})[_0x7edd('0x26')](function(){return _0x2b984b;});}else{return _0x2b984b;}})[_0x7edd('0x47')](function(_0x4335f8){logger[_0x7edd('0x29')](_0x7edd('0x52'),_0x4335f8);throw _0x4335f8;});}return _0x2b984b;});}})[_0x7edd('0x26')](respondWithResult(_0x3b6d43,0xc9))[_0x7edd('0x47')](handleError(_0x3b6d43,null));};exports[_0x7edd('0x24')]=function(_0x34c668,_0x4dd06b){if(_0x34c668[_0x7edd('0x4c')]['id']){delete _0x34c668['body']['id'];}return db[_0x7edd('0x2e')][_0x7edd('0x4a')]({'where':{'id':_0x34c668['params']['id']}})[_0x7edd('0x26')](handleEntityNotFound(_0x4dd06b,null))['then'](saveUpdates(_0x34c668[_0x7edd('0x4c')],null))[_0x7edd('0x26')](respondWithResult(_0x4dd06b,null))['catch'](handleError(_0x4dd06b,null));};exports[_0x7edd('0x25')]=function(_0x40c71a,_0x2fb0d6){return db[_0x7edd('0x2e')][_0x7edd('0x4a')]({'where':{'id':_0x40c71a['params']['id']}})[_0x7edd('0x26')](handleEntityNotFound(_0x2fb0d6,null))[_0x7edd('0x26')](removeEntity(_0x2fb0d6,null))[_0x7edd('0x47')](handleError(_0x2fb0d6,null));};exports['getSessions']=function(_0x1c2961,_0x476470,_0xba7946){var _0x60a16={'raw':!![],'where':{}};var _0x40c680={};var _0x459a8c={'count':0x0,'rows':[]};return db[_0x7edd('0x2e')]['findOne']({'where':{'id':_0x1c2961[_0x7edd('0x49')]['id']}})[_0x7edd('0x26')](handleEntityNotFound(_0x476470,null))[_0x7edd('0x26')](function(_0xc05a22){if(_0xc05a22){_0x40c680[_0x7edd('0x33')]=_[_0x7edd('0x36')](db[_0x7edd('0x59')]['rawAttributes']);_0x40c680[_0x7edd('0x35')]=_[_0x7edd('0x36')](_0x1c2961[_0x7edd('0x35')]);_0x40c680[_0x7edd('0x37')]=_[_0x7edd('0x38')](_0x40c680[_0x7edd('0x33')],_0x40c680[_0x7edd('0x35')]);_0x60a16[_0x7edd('0x39')]=_[_0x7edd('0x38')](_0x40c680[_0x7edd('0x33')],qs[_0x7edd('0x3a')](_0x1c2961[_0x7edd('0x35')][_0x7edd('0x3a')]));_0x60a16[_0x7edd('0x39')]=_0x60a16[_0x7edd('0x39')][_0x7edd('0x3b')]?_0x60a16['attributes']:_0x40c680[_0x7edd('0x33')];if(!_0x1c2961['query']['hasOwnProperty'](_0x7edd('0x5a'))){_0x60a16[_0x7edd('0x1d')]=qs['limit'](_0x1c2961[_0x7edd('0x35')]['limit']);_0x60a16['offset']=qs[_0x7edd('0x1b')](_0x1c2961[_0x7edd('0x35')][_0x7edd('0x1b')]);}_0x60a16['order']=qs[_0x7edd('0x3e')](_0x1c2961['query'][_0x7edd('0x3e')]);_0x60a16[_0x7edd('0x3f')]=qs[_0x7edd('0x37')](_[_0x7edd('0x40')](_0x1c2961[_0x7edd('0x35')],_0x40c680[_0x7edd('0x37')]));_0x60a16['where'][_0x7edd('0x5b')]=_0xc05a22['id'];if(_0x1c2961['query']['filter']){_0x60a16[_0x7edd('0x3f')]=_[_0x7edd('0x42')](_0x60a16['where'],{'$or':_['map'](_0x60a16['attributes'],function(_0x14c41b){var _0x242f0e={};_0x242f0e[_0x14c41b]={'$like':'%'+_0x1c2961[_0x7edd('0x35')][_0x7edd('0x41')]+'%'};return _0x242f0e;})});}_0x60a16=_['merge']({},_0x60a16,_0x1c2961[_0x7edd('0x43')]);return db[_0x7edd('0x59')][_0x7edd('0x1e')]({'where':_0x60a16[_0x7edd('0x3f')]})[_0x7edd('0x26')](function(_0x265691){_0x459a8c[_0x7edd('0x1e')]=_0x265691;if(_0x1c2961['query'][_0x7edd('0x44')]){_0x60a16[_0x7edd('0x45')]=[{'all':!![]}];}return db[_0x7edd('0x59')][_0x7edd('0x5c')](_0x60a16);})['then'](function(_0x6f8e0){_0x459a8c[_0x7edd('0x46')]=_0x6f8e0;return _0x459a8c;});}})[_0x7edd('0x26')](respondWithFilteredResult(_0x476470,_0x60a16))[_0x7edd('0x47')](handleError(_0x476470,null));};exports[_0x7edd('0x5d')]=function(_0x290b33,_0x2ce896,_0x46e6d9){var _0x59eafd={'raw':!![],'where':{}};var _0x5787c1={};var _0xe49a77={'count':0x0,'rows':[]};return db[_0x7edd('0x2e')][_0x7edd('0x5e')]({'where':{'id':_0x290b33['params']['id']}})['then'](handleEntityNotFound(_0x2ce896,null))['then'](function(_0x16ed46){if(_0x16ed46){_0x5787c1[_0x7edd('0x33')]=_[_0x7edd('0x36')](db['JscriptyAnswerReport']['rawAttributes']);_0x5787c1[_0x7edd('0x35')]=_['keys'](_0x290b33[_0x7edd('0x35')]);_0x5787c1[_0x7edd('0x37')]=_[_0x7edd('0x38')](_0x5787c1[_0x7edd('0x33')],_0x5787c1['query']);_0x59eafd[_0x7edd('0x39')]=_[_0x7edd('0x38')](_0x5787c1[_0x7edd('0x33')],qs[_0x7edd('0x3a')](_0x290b33[_0x7edd('0x35')][_0x7edd('0x3a')]));_0x59eafd[_0x7edd('0x39')]=_0x59eafd[_0x7edd('0x39')][_0x7edd('0x3b')]?_0x59eafd[_0x7edd('0x39')]:_0x5787c1['model'];if(!_0x290b33[_0x7edd('0x35')][_0x7edd('0x3c')](_0x7edd('0x5a'))){_0x59eafd['limit']=qs[_0x7edd('0x1d')](_0x290b33[_0x7edd('0x35')][_0x7edd('0x1d')]);_0x59eafd['offset']=qs[_0x7edd('0x1b')](_0x290b33[_0x7edd('0x35')][_0x7edd('0x1b')]);}_0x59eafd[_0x7edd('0x3d')]=qs['sort'](_0x290b33['query'][_0x7edd('0x3e')]);_0x59eafd[_0x7edd('0x3f')]=qs['filters'](_['pick'](_0x290b33[_0x7edd('0x35')],_0x5787c1[_0x7edd('0x37')]));_0x59eafd[_0x7edd('0x3f')][_0x7edd('0x5b')]=_0x16ed46['id'];if(_0x290b33[_0x7edd('0x35')]['filter']){_0x59eafd[_0x7edd('0x3f')]=_[_0x7edd('0x42')](_0x59eafd[_0x7edd('0x3f')],{'$or':_[_0x7edd('0x34')](_0x59eafd['attributes'],function(_0x404faf){var _0x3f1bdd={};_0x3f1bdd[_0x404faf]={'$like':'%'+_0x290b33[_0x7edd('0x35')]['filter']+'%'};return _0x3f1bdd;})});}_0x59eafd=_[_0x7edd('0x42')]({},_0x59eafd,_0x290b33[_0x7edd('0x43')]);return db[_0x7edd('0x5f')][_0x7edd('0x1e')]({'where':_0x59eafd[_0x7edd('0x3f')]})[_0x7edd('0x26')](function(_0x3622d2){_0xe49a77[_0x7edd('0x1e')]=_0x3622d2;if(_0x290b33['query'][_0x7edd('0x44')]){_0x59eafd[_0x7edd('0x45')]=[{'all':!![]}];}return db[_0x7edd('0x5f')][_0x7edd('0x5c')](_0x59eafd);})['then'](function(_0x20f98c){_0xe49a77['rows']=_0x20f98c;return _0xe49a77;});}})['then'](respondWithFilteredResult(_0x2ce896,_0x59eafd))['catch'](handleError(_0x2ce896,null));};function char(_0x2d74fe){return _0x7edd('0x60')===typeof _0x2d74fe?String[_0x7edd('0x61')]['apply'](null,arguments):_0x2d74fe;}function needsEncapsulation(_0x49b08c){return!!_0x49b08c&&(_0x49b08c['toString']()['indexOf'](char(0xd))>=0x0||_0x49b08c[_0x7edd('0x62')]()[_0x7edd('0x63')](char(0xa))>=0x0||_0x49b08c[_0x7edd('0x62')]()[_0x7edd('0x63')](char(0x2c))>=0x0||_0x49b08c['toString']()[_0x7edd('0x63')](char(0x22))>=0x0);}function encapsulate(_0x44ef9f){var _0x1b1857=char(0x22),_0x21247d='\x5c'+char(0x22),_0x1eae3b=_0x44ef9f[_0x7edd('0x62')]()[_0x7edd('0x64')](new RegExp(_0x1b1857,'g'),_0x21247d);return _0x1b1857+_0x1eae3b+_0x1b1857;}exports[_0x7edd('0x65')]=function(_0x4bc6c0,_0x204189,_0x3b19e0){var _0x3cbd09,_0x400835;var _0x28b0f8={'where':{'ProjectId':_0x4bc6c0[_0x7edd('0x49')]['id']}};if(_0x4bc6c0[_0x7edd('0x35')][_0x7edd('0x66')]){_0x28b0f8[_0x7edd('0x3f')][_0x7edd('0x67')]=JSON[_0x7edd('0x68')](_0x4bc6c0[_0x7edd('0x35')][_0x7edd('0x66')]);}return db['JscriptySessionReport'][_0x7edd('0x5c')](_0x28b0f8)[_0x7edd('0x26')](handleEntityNotFound(_0x204189,null))['then'](function(_0x156273){if(_0x156273){_0x3cbd09=_0x156273;return db[_0x7edd('0x69')][_0x7edd('0x5c')]({'where':{'SessionId':{'$in':_[_0x7edd('0x34')](_0x3cbd09,'id')},'ProjectId':_0x4bc6c0['params']['id']},'order':_0x7edd('0x6a')});}})[_0x7edd('0x26')](handleEntityNotFound(_0x204189,null))[_0x7edd('0x26')](function(_0x4724d1){if(_0x4724d1){_0x400835=_0x4724d1;var _0x3bb6bc={};for(var _0x10bf19=0x0,_0x44932c=_0x400835[_0x7edd('0x3b')];_0x10bf19<_0x44932c;_0x10bf19++){if(!_0x3bb6bc[_0x7edd('0x3c')](_0x400835[_0x10bf19]['questionId'])){_0x3bb6bc[_0x400835[_0x10bf19][_0x7edd('0x6b')]]=needsEncapsulation(_0x400835[_0x10bf19][_0x7edd('0x6c')])?encapsulate(_0x400835[_0x10bf19][_0x7edd('0x6c')]):_0x400835[_0x10bf19]['question'];}}var _0x4935dc=[],_0x35f717={};for(var _0x3ab389=0x0,_0x362805=_0x3cbd09['length'];_0x3ab389<_0x362805;_0x3ab389++){_0x35f717={'ProjectId':_0x4bc6c0[_0x7edd('0x49')]['id'],'SessionId':_0x3cbd09[_0x3ab389]['id'],'StartTime':moment(_0x3cbd09[_0x3ab389][_0x7edd('0x67')])[_0x7edd('0x6d')](_0x7edd('0x6e'))};for(var _0x5ab972=0x0,_0x3eeb52=_0x400835[_0x7edd('0x3b')];_0x5ab972<_0x3eeb52;_0x5ab972++){if(_0x400835[_0x5ab972][_0x7edd('0x6f')]==_0x3cbd09[_0x3ab389]['id']&&_0x3bb6bc[_0x7edd('0x3c')](_0x400835[_0x5ab972]['questionId'])){_0x35f717[_0x3bb6bc[_0x400835[_0x5ab972][_0x7edd('0x6b')]]]=_0x400835[_0x5ab972][_0x7edd('0x70')];}}for(var _0x303e6a in _0x3bb6bc){if(!_0x35f717[_0x7edd('0x3c')](_0x3bb6bc[_0x303e6a])){_0x35f717[_0x3bb6bc[_0x303e6a]]=null;}}_0x4935dc[_0x7edd('0x71')](_0x35f717);}return _0x4935dc;}})[_0x7edd('0x26')](function(_0x3729a6){if(!_[_0x7edd('0x72')](_0x3729a6)){var _0x279271=toCsv(_0x3729a6);var _0xbdf8dd=Date[_0x7edd('0x73')]();fs[_0x7edd('0x74')](util[_0x7edd('0x6d')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x4bc6c0['params']['id'],_0xbdf8dd),_0x279271);_0x204189['setHeader']('Content-disposition','attachment;\x20filename='+util[_0x7edd('0x6d')](_0x7edd('0x75'),_0x4bc6c0[_0x7edd('0x49')]['id'],_0xbdf8dd));_0x204189['setHeader'](_0x7edd('0x76'),_0x7edd('0x77'));return _0x204189[_0x7edd('0x78')](util[_0x7edd('0x6d')](_0x7edd('0x79'),_0x4bc6c0[_0x7edd('0x49')]['id'],_0xbdf8dd));}else{return _0x204189[_0x7edd('0x18')](0xcc);}})[_0x7edd('0x47')](handleError(_0x204189,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index d856baf..198a577 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 _0x83d3=['define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x118f23,_0x214305){var _0x57e66b=function(_0x99c3be){while(--_0x99c3be){_0x118f23['push'](_0x118f23['shift']());}};_0x57e66b(++_0x214305);}(_0x83d3,0x17c));var _0x383d=function(_0x266e57,_0x41125b){_0x266e57=_0x266e57-0x0;var _0x4cdc1d=_0x83d3[_0x266e57];return _0x4cdc1d;};'use strict';var _=require(_0x383d('0x0'));var util=require(_0x383d('0x1'));var logger=require(_0x383d('0x2'))(_0x383d('0x3'));var moment=require(_0x383d('0x4'));var BPromise=require('bluebird');var rp=require(_0x383d('0x5'));var fs=require('fs');var path=require(_0x383d('0x6'));var rimraf=require(_0x383d('0x7'));var config=require(_0x383d('0x8'));var attributes=require('./jscriptyProject.attributes');module[_0x383d('0x9')]=function(_0x4f3c10,_0x50eaff){return _0x4f3c10[_0x383d('0xa')](_0x383d('0xb'),attributes,{'tableName':_0x383d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdbbe=['./jscriptyProject.attributes','exports','define','jscripty_projects','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x49d4f9,_0x3e89c9){var _0x446d07=function(_0x4c1804){while(--_0x4c1804){_0x49d4f9['push'](_0x49d4f9['shift']());}};_0x446d07(++_0x3e89c9);}(_0xdbbe,0x148));var _0xedbb=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0xdbbe[_0x349367];return _0x14179b;};'use strict';var _=require('lodash');var util=require(_0xedbb('0x0'));var logger=require(_0xedbb('0x1'))(_0xedbb('0x2'));var moment=require(_0xedbb('0x3'));var BPromise=require(_0xedbb('0x4'));var rp=require(_0xedbb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xedbb('0x6'));var config=require(_0xedbb('0x7'));var attributes=require(_0xedbb('0x8'));module[_0xedbb('0x9')]=function(_0x8022ef,_0x87ee1e){return _0x8022ef[_0xedbb('0xa')]('JscriptyProject',attributes,{'tableName':_0xedbb('0xb'),'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 34b0051..b04f7c1 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 _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyProject,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x2e8104,_0x206e23){var _0x103a3e=function(_0x27ed0d){while(--_0x27ed0d){_0x2e8104['push'](_0x2e8104['shift']());}};_0x103a3e(++_0x206e23);}(_0xb43b,0x1b2));var _0xbb43=function(_0x13c5e3,_0x43cf42){_0x13c5e3=_0x13c5e3-0x0;var _0x18264b=_0xb43b[_0x13c5e3];return _0x18264b;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file +var _0xda3f=['rpc','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x2fff83,_0x29d5fe){var _0xa2a722=function(_0x18b6b0){while(--_0x18b6b0){_0x2fff83['push'](_0x2fff83['shift']());}};_0xa2a722(++_0x29d5fe);}(_0xda3f,0xec));var _0xfda3=function(_0x548858,_0x1069f6){_0x548858=_0x548858-0x0;var _0x4c4dd1=_0xda3f[_0x548858];return _0x4c4dd1;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 2221c2e..fb130b4 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 _0x4830=['multer','util','Router','../../components/auth/service','../../components/interaction/service','./jscriptyQuestionReport.controller','isAuthenticated','index','describe','get','show','post','create','put','update','delete','/:id','destroy'];(function(_0x1f4c96,_0x3b0a4d){var _0x389019=function(_0x473d7b){while(--_0x473d7b){_0x1f4c96['push'](_0x1f4c96['shift']());}};_0x389019(++_0x3b0a4d);}(_0x4830,0xb4));var _0x0483=function(_0x57fbe1,_0x4282ff){_0x57fbe1=_0x57fbe1-0x0;var _0x3dbc2c=_0x4830[_0x57fbe1];return _0x3dbc2c;};'use strict';var multer=require(_0x0483('0x0'));var util=require(_0x0483('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0483('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0483('0x3'));var interaction=require(_0x0483('0x4'));var config=require('../../config/environment');var controller=require(_0x0483('0x5'));router['get']('/',auth[_0x0483('0x6')](),controller[_0x0483('0x7')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x0483('0x8')]);router[_0x0483('0x9')]('/:id',auth[_0x0483('0x6')](),controller[_0x0483('0xa')]);router[_0x0483('0xb')]('/',auth['isAuthenticated'](),controller[_0x0483('0xc')]);router[_0x0483('0xd')]('/:id',auth[_0x0483('0x6')](),controller[_0x0483('0xe')]);router[_0x0483('0xf')](_0x0483('0x10'),auth[_0x0483('0x6')](),controller[_0x0483('0x11')]);module['exports']=router; \ No newline at end of file +var _0xb9e0=['/describe','describe','/:id','post','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index'];(function(_0x86c6d6,_0x447798){var _0x4f4741=function(_0x17a6a2){while(--_0x17a6a2){_0x86c6d6['push'](_0x86c6d6['shift']());}};_0x4f4741(++_0x447798);}(_0xb9e0,0x1a9));var _0x0b9e=function(_0x4dad31,_0x2fc06a){_0x4dad31=_0x4dad31-0x0;var _0x48cccd=_0xb9e0[_0x4dad31];return _0x48cccd;};'use strict';var multer=require(_0x0b9e('0x0'));var util=require(_0x0b9e('0x1'));var path=require(_0x0b9e('0x2'));var timeout=require(_0x0b9e('0x3'));var express=require('express');var router=express[_0x0b9e('0x4')]();var fs_extra=require(_0x0b9e('0x5'));var auth=require(_0x0b9e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0b9e('0x7'));var controller=require(_0x0b9e('0x8'));router[_0x0b9e('0x9')]('/',auth[_0x0b9e('0xa')](),controller[_0x0b9e('0xb')]);router[_0x0b9e('0x9')](_0x0b9e('0xc'),auth[_0x0b9e('0xa')](),controller[_0x0b9e('0xd')]);router[_0x0b9e('0x9')](_0x0b9e('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x0b9e('0xf')]('/',auth[_0x0b9e('0xa')](),controller['create']);router['put']('/:id',auth[_0x0b9e('0xa')](),controller[_0x0b9e('0x10')]);router['delete'](_0x0b9e('0xe'),auth[_0x0b9e('0xa')](),controller[_0x0b9e('0x11')]);module[_0x0b9e('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 40b15d7..f6882cb 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(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7a54,0x106));var _0x47a5=function(_0x268d15,_0xd21c02){_0x268d15=_0x268d15-0x0;var _0x52b3ee=_0x7a54[_0x268d15];return _0x52b3ee;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x7a54,0x106));var _0x47a5=function(_0x28c198,_0x478659){_0x28c198=_0x28c198-0x0;var _0x572936=_0x7a54[_0x28c198];return _0x572936;};'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 dd342de..fcccaa3 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 _0x2cd4=['rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','update','then','destroy','stack','name','send','index','JscriptyQuestionReport'];(function(_0x48b810,_0x173a5e){var _0x23c17d=function(_0x38531e){while(--_0x38531e){_0x48b810['push'](_0x48b810['shift']());}};_0x23c17d(++_0x173a5e);}(_0x2cd4,0x6d));var _0x42cd=function(_0x450689,_0x3b857c){_0x450689=_0x450689-0x0;var _0x46ffb0=_0x2cd4[_0x450689];return _0x46ffb0;};'use strict';var emlformat=require(_0x42cd('0x0'));var rimraf=require(_0x42cd('0x1'));var zipdir=require(_0x42cd('0x2'));var jsonpatch=require(_0x42cd('0x3'));var rp=require(_0x42cd('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x42cd('0x5'));var util=require(_0x42cd('0x6'));var path=require('path');var sox=require(_0x42cd('0x7'));var csv=require(_0x42cd('0x8'));var ejs=require(_0x42cd('0x9'));var fs=require('fs');var fs_extra=require(_0x42cd('0xa'));var _=require(_0x42cd('0xb'));var squel=require(_0x42cd('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x42cd('0xd'));var toCsv=require(_0x42cd('0x8'));var querystring=require(_0x42cd('0xe'));var Papa=require(_0x42cd('0xf'));var Redis=require(_0x42cd('0x10'));var authService=require(_0x42cd('0x11'));var qs=require(_0x42cd('0x12'));var as=require(_0x42cd('0x13'));var hardwareService=require(_0x42cd('0x14'));var logger=require(_0x42cd('0x15'))(_0x42cd('0x16'));var utils=require(_0x42cd('0x17'));var config=require(_0x42cd('0x18'));var licenseUtil=require(_0x42cd('0x19'));var db=require(_0x42cd('0x1a'))['db'];function respondWithStatusCode(_0x3cd590,_0x216538){_0x216538=_0x216538||0xcc;return function(_0x8a1291){if(_0x8a1291){return _0x3cd590[_0x42cd('0x1b')](_0x216538);}return _0x3cd590[_0x42cd('0x1c')](_0x216538)[_0x42cd('0x1d')]();};}function respondWithResult(_0x3e6544,_0x2dd339){_0x2dd339=_0x2dd339||0xc8;return function(_0x41a4ec){if(_0x41a4ec){return _0x3e6544[_0x42cd('0x1c')](_0x2dd339)[_0x42cd('0x1e')](_0x41a4ec);}};}function respondWithFilteredResult(_0x43be25,_0x324008){return function(_0x18c241){if(_0x18c241){var _0xe49b6c=typeof _0x324008['offset']===_0x42cd('0x1f')&&typeof _0x324008['limit']===_0x42cd('0x1f');var _0x5f4d52=_0x18c241[_0x42cd('0x20')];var _0x2c6c80=_0xe49b6c?0x0:_0x324008[_0x42cd('0x21')];var _0x1843c7=_0xe49b6c?_0x18c241[_0x42cd('0x20')]:_0x324008[_0x42cd('0x21')]+_0x324008[_0x42cd('0x22')];var _0x48a90e;if(_0x1843c7>=_0x5f4d52){_0x1843c7=_0x5f4d52;_0x48a90e=0xc8;}else{_0x48a90e=0xce;}_0x43be25[_0x42cd('0x1c')](_0x48a90e);return _0x43be25[_0x42cd('0x23')]('Content-Range',_0x2c6c80+'-'+_0x1843c7+'/'+_0x5f4d52)[_0x42cd('0x1e')](_0x18c241);}return null;};}function patchUpdates(_0x52ade6){return function(_0x9743d2){try{jsonpatch[_0x42cd('0x24')](_0x9743d2,_0x52ade6,!![]);}catch(_0x31a610){return BPromise['reject'](_0x31a610);}return _0x9743d2['save']();};}function saveUpdates(_0x1b40e5,_0x5485cd){return function(_0x25759f){if(_0x25759f){return _0x25759f[_0x42cd('0x25')](_0x1b40e5)[_0x42cd('0x26')](function(_0x4e4c4e){return _0x4e4c4e;});}return null;};}function removeEntity(_0x5ecc9f,_0x4d67e9){return function(_0x5af124){if(_0x5af124){return _0x5af124[_0x42cd('0x27')]()['then'](function(){_0x5ecc9f[_0x42cd('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bcc20,_0x27f573){return function(_0x1a6571){if(!_0x1a6571){_0x1bcc20[_0x42cd('0x1b')](0x194);}return _0x1a6571;};}function handleError(_0x419c12,_0x3adfc9){_0x3adfc9=_0x3adfc9||0x1f4;return function(_0x5de67d){logger['error'](_0x5de67d[_0x42cd('0x28')]);if(_0x5de67d[_0x42cd('0x29')]){delete _0x5de67d[_0x42cd('0x29')];}_0x419c12[_0x42cd('0x1c')](_0x3adfc9)[_0x42cd('0x2a')](_0x5de67d);};}exports[_0x42cd('0x2b')]=function(_0x203af3,_0x6a3fac){var _0x5da44a={},_0xb48717={},_0x30cdc8={'count':0x0,'rows':[]};var _0x399dd2=_['map'](db[_0x42cd('0x2c')][_0x42cd('0x2d')],function(_0xb3175b){return{'name':_0xb3175b[_0x42cd('0x2e')],'type':_0xb3175b[_0x42cd('0x2f')][_0x42cd('0x30')]};});_0xb48717[_0x42cd('0x31')]=_[_0x42cd('0x32')](_0x399dd2,_0x42cd('0x29'));_0xb48717[_0x42cd('0x33')]=_[_0x42cd('0x34')](_0x203af3[_0x42cd('0x33')]);_0xb48717[_0x42cd('0x35')]=_[_0x42cd('0x36')](_0xb48717['model'],_0xb48717['query']);_0x5da44a[_0x42cd('0x37')]=_[_0x42cd('0x36')](_0xb48717[_0x42cd('0x31')],qs[_0x42cd('0x38')](_0x203af3[_0x42cd('0x33')][_0x42cd('0x38')]));_0x5da44a[_0x42cd('0x37')]=_0x5da44a[_0x42cd('0x37')][_0x42cd('0x39')]?_0x5da44a[_0x42cd('0x37')]:_0xb48717['model'];if(!_0x203af3[_0x42cd('0x33')][_0x42cd('0x3a')](_0x42cd('0x3b'))){_0x5da44a['limit']=qs['limit'](_0x203af3[_0x42cd('0x33')]['limit']);_0x5da44a[_0x42cd('0x21')]=qs[_0x42cd('0x21')](_0x203af3[_0x42cd('0x33')][_0x42cd('0x21')]);}_0x5da44a['order']=qs[_0x42cd('0x3c')](_0x203af3['query'][_0x42cd('0x3c')]);_0x5da44a['where']=qs['filters'](_['pick'](_0x203af3[_0x42cd('0x33')],_0xb48717['filters']),_0x399dd2);if(_0x203af3['query'][_0x42cd('0x3d')]){_0x5da44a[_0x42cd('0x3e')]=_['merge'](_0x5da44a['where'],{'$or':_[_0x42cd('0x32')](_0x399dd2,function(_0x4a67a1){if(_0x4a67a1[_0x42cd('0x2f')]!==_0x42cd('0x3f')){var _0x2b84ad={};_0x2b84ad[_0x4a67a1[_0x42cd('0x29')]]={'$like':'%'+_0x203af3[_0x42cd('0x33')][_0x42cd('0x3d')]+'%'};return _0x2b84ad;}})});}_0x5da44a=_[_0x42cd('0x40')]({},_0x5da44a,_0x203af3[_0x42cd('0x41')]);var _0x10c2b4={'where':_0x5da44a['where']};return db[_0x42cd('0x2c')][_0x42cd('0x20')](_0x10c2b4)[_0x42cd('0x26')](function(_0x20338e){_0x30cdc8['count']=_0x20338e;if(_0x203af3[_0x42cd('0x33')][_0x42cd('0x42')]){_0x5da44a[_0x42cd('0x43')]=[{'all':!![]}];}return db[_0x42cd('0x2c')][_0x42cd('0x44')](_0x5da44a);})['then'](function(_0x1c8001){_0x30cdc8[_0x42cd('0x45')]=_0x1c8001;return _0x30cdc8;})[_0x42cd('0x26')](respondWithFilteredResult(_0x6a3fac,_0x5da44a))['catch'](handleError(_0x6a3fac,null));};exports[_0x42cd('0x46')]=function(_0x5c24cd,_0x33c777){var _0x159010={'raw':!![],'where':{'id':_0x5c24cd['params']['id']}},_0x473278={};_0x473278[_0x42cd('0x31')]=_[_0x42cd('0x34')](db[_0x42cd('0x2c')]['rawAttributes']);_0x473278[_0x42cd('0x33')]=_[_0x42cd('0x34')](_0x5c24cd[_0x42cd('0x33')]);_0x473278[_0x42cd('0x35')]=_[_0x42cd('0x36')](_0x473278[_0x42cd('0x31')],_0x473278['query']);_0x159010[_0x42cd('0x37')]=_['intersection'](_0x473278[_0x42cd('0x31')],qs[_0x42cd('0x38')](_0x5c24cd['query'][_0x42cd('0x38')]));_0x159010[_0x42cd('0x37')]=_0x159010[_0x42cd('0x37')][_0x42cd('0x39')]?_0x159010[_0x42cd('0x37')]:_0x473278[_0x42cd('0x31')];if(_0x5c24cd[_0x42cd('0x33')][_0x42cd('0x42')]){_0x159010[_0x42cd('0x43')]=[{'all':!![]}];}_0x159010=_[_0x42cd('0x40')]({},_0x159010,_0x5c24cd[_0x42cd('0x41')]);return db[_0x42cd('0x2c')][_0x42cd('0x47')](_0x159010)[_0x42cd('0x26')](handleEntityNotFound(_0x33c777,null))[_0x42cd('0x26')](respondWithResult(_0x33c777,null))[_0x42cd('0x48')](handleError(_0x33c777,null));};exports[_0x42cd('0x49')]=function(_0x1b8579,_0x203551){return db[_0x42cd('0x2c')][_0x42cd('0x49')](_0x1b8579['body'],{})[_0x42cd('0x26')](respondWithResult(_0x203551,0xc9))[_0x42cd('0x48')](handleError(_0x203551,null));};exports[_0x42cd('0x25')]=function(_0x2600f3,_0x397832){if(_0x2600f3['body']['id']){delete _0x2600f3[_0x42cd('0x4a')]['id'];}return db[_0x42cd('0x2c')]['find']({'where':{'id':_0x2600f3[_0x42cd('0x4b')]['id']}})[_0x42cd('0x26')](handleEntityNotFound(_0x397832,null))[_0x42cd('0x26')](saveUpdates(_0x2600f3['body'],null))['then'](respondWithResult(_0x397832,null))['catch'](handleError(_0x397832,null));};exports[_0x42cd('0x27')]=function(_0x105823,_0x3e1f18){return db[_0x42cd('0x2c')][_0x42cd('0x47')]({'where':{'id':_0x105823[_0x42cd('0x4b')]['id']}})[_0x42cd('0x26')](handleEntityNotFound(_0x3e1f18,null))[_0x42cd('0x26')](removeEntity(_0x3e1f18,null))[_0x42cd('0x48')](handleError(_0x3e1f18,null));};exports[_0x42cd('0x4c')]=function(_0x71a023,_0x568fce){return db[_0x42cd('0x2c')][_0x42cd('0x4c')]()[_0x42cd('0x26')](respondWithResult(_0x568fce,null))[_0x42cd('0x48')](handleError(_0x568fce,null));}; \ No newline at end of file +var _0x70f5=['includeAll','include','rows','catch','params','fields','length','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','error','name','send','index','map','JscriptyQuestionReport','fieldName','type','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options'];(function(_0x26ee38,_0x1c4de5){var _0x23fadc=function(_0x4710d8){while(--_0x4710d8){_0x26ee38['push'](_0x26ee38['shift']());}};_0x23fadc(++_0x1c4de5);}(_0x70f5,0xed));var _0x570f=function(_0x39b0d0,_0x1be95e){_0x39b0d0=_0x39b0d0-0x0;var _0x5b659e=_0x70f5[_0x39b0d0];return _0x5b659e;};'use strict';var emlformat=require(_0x570f('0x0'));var rimraf=require(_0x570f('0x1'));var zipdir=require(_0x570f('0x2'));var jsonpatch=require(_0x570f('0x3'));var rp=require(_0x570f('0x4'));var moment=require(_0x570f('0x5'));var BPromise=require(_0x570f('0x6'));var Mustache=require(_0x570f('0x7'));var util=require('util');var path=require(_0x570f('0x8'));var sox=require(_0x570f('0x9'));var csv=require(_0x570f('0xa'));var ejs=require(_0x570f('0xb'));var fs=require('fs');var fs_extra=require(_0x570f('0xc'));var _=require(_0x570f('0xd'));var squel=require('squel');var crypto=require(_0x570f('0xe'));var jsforce=require(_0x570f('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x570f('0xa'));var querystring=require(_0x570f('0x10'));var Papa=require('papaparse');var Redis=require(_0x570f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x570f('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x570f('0x13'));var logger=require(_0x570f('0x14'))(_0x570f('0x15'));var utils=require(_0x570f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x570f('0x17'));var db=require(_0x570f('0x18'))['db'];function respondWithStatusCode(_0x1ecfb8,_0x1e727b){_0x1e727b=_0x1e727b||0xcc;return function(_0x1eadba){if(_0x1eadba){return _0x1ecfb8[_0x570f('0x19')](_0x1e727b);}return _0x1ecfb8[_0x570f('0x1a')](_0x1e727b)[_0x570f('0x1b')]();};}function respondWithResult(_0x1a0c15,_0xdf4a0e){_0xdf4a0e=_0xdf4a0e||0xc8;return function(_0x21bf63){if(_0x21bf63){return _0x1a0c15['status'](_0xdf4a0e)[_0x570f('0x1c')](_0x21bf63);}};}function respondWithFilteredResult(_0x4f8033,_0x1d8630){return function(_0x51451e){if(_0x51451e){var _0x2122cd=typeof _0x1d8630[_0x570f('0x1d')]==='undefined'&&typeof _0x1d8630['limit']===_0x570f('0x1e');var _0x317f24=_0x51451e[_0x570f('0x1f')];var _0x4eded5=_0x2122cd?0x0:_0x1d8630[_0x570f('0x1d')];var _0x289a60=_0x2122cd?_0x51451e[_0x570f('0x1f')]:_0x1d8630['offset']+_0x1d8630[_0x570f('0x20')];var _0x18a8ce;if(_0x289a60>=_0x317f24){_0x289a60=_0x317f24;_0x18a8ce=0xc8;}else{_0x18a8ce=0xce;}_0x4f8033[_0x570f('0x1a')](_0x18a8ce);return _0x4f8033[_0x570f('0x21')](_0x570f('0x22'),_0x4eded5+'-'+_0x289a60+'/'+_0x317f24)[_0x570f('0x1c')](_0x51451e);}return null;};}function patchUpdates(_0x2c12dc){return function(_0x124566){try{jsonpatch[_0x570f('0x23')](_0x124566,_0x2c12dc,!![]);}catch(_0x206bcd){return BPromise['reject'](_0x206bcd);}return _0x124566[_0x570f('0x24')]();};}function saveUpdates(_0x56c2a3,_0x1b156f){return function(_0x4f29f9){if(_0x4f29f9){return _0x4f29f9[_0x570f('0x25')](_0x56c2a3)[_0x570f('0x26')](function(_0x50ac87){return _0x50ac87;});}return null;};}function removeEntity(_0x2dfc8c,_0x295b3f){return function(_0x17ab28){if(_0x17ab28){return _0x17ab28['destroy']()[_0x570f('0x26')](function(){_0x2dfc8c[_0x570f('0x1a')](0xcc)[_0x570f('0x1b')]();});}};}function handleEntityNotFound(_0x49f4bb,_0x5a9d5b){return function(_0x275357){if(!_0x275357){_0x49f4bb[_0x570f('0x19')](0x194);}return _0x275357;};}function handleError(_0x377032,_0x5eea75){_0x5eea75=_0x5eea75||0x1f4;return function(_0x49d02e){logger[_0x570f('0x27')](_0x49d02e['stack']);if(_0x49d02e['name']){delete _0x49d02e[_0x570f('0x28')];}_0x377032[_0x570f('0x1a')](_0x5eea75)[_0x570f('0x29')](_0x49d02e);};}exports[_0x570f('0x2a')]=function(_0x3a988b,_0x59d936){var _0x5e3ac6={},_0x2b39d2={},_0xbf1aa7={'count':0x0,'rows':[]};var _0x34b765=_[_0x570f('0x2b')](db[_0x570f('0x2c')]['rawAttributes'],function(_0x44f823){return{'name':_0x44f823[_0x570f('0x2d')],'type':_0x44f823[_0x570f('0x2e')]['key']};});_0x2b39d2[_0x570f('0x2f')]=_['map'](_0x34b765,_0x570f('0x28'));_0x2b39d2[_0x570f('0x30')]=_[_0x570f('0x31')](_0x3a988b[_0x570f('0x30')]);_0x2b39d2[_0x570f('0x32')]=_[_0x570f('0x33')](_0x2b39d2[_0x570f('0x2f')],_0x2b39d2[_0x570f('0x30')]);_0x5e3ac6[_0x570f('0x34')]=_[_0x570f('0x33')](_0x2b39d2['model'],qs['fields'](_0x3a988b['query']['fields']));_0x5e3ac6['attributes']=_0x5e3ac6[_0x570f('0x34')]['length']?_0x5e3ac6[_0x570f('0x34')]:_0x2b39d2[_0x570f('0x2f')];if(!_0x3a988b[_0x570f('0x30')][_0x570f('0x35')](_0x570f('0x36'))){_0x5e3ac6['limit']=qs[_0x570f('0x20')](_0x3a988b[_0x570f('0x30')]['limit']);_0x5e3ac6[_0x570f('0x1d')]=qs[_0x570f('0x1d')](_0x3a988b[_0x570f('0x30')]['offset']);}_0x5e3ac6[_0x570f('0x37')]=qs[_0x570f('0x38')](_0x3a988b[_0x570f('0x30')][_0x570f('0x38')]);_0x5e3ac6['where']=qs[_0x570f('0x32')](_[_0x570f('0x39')](_0x3a988b[_0x570f('0x30')],_0x2b39d2['filters']),_0x34b765);if(_0x3a988b[_0x570f('0x30')]['filter']){_0x5e3ac6[_0x570f('0x3a')]=_[_0x570f('0x3b')](_0x5e3ac6[_0x570f('0x3a')],{'$or':_[_0x570f('0x2b')](_0x34b765,function(_0x35ef03){if(_0x35ef03[_0x570f('0x2e')]!==_0x570f('0x3c')){var _0x2fe217={};_0x2fe217[_0x35ef03['name']]={'$like':'%'+_0x3a988b['query'][_0x570f('0x3d')]+'%'};return _0x2fe217;}})});}_0x5e3ac6=_['merge']({},_0x5e3ac6,_0x3a988b[_0x570f('0x3e')]);var _0x13e9a9={'where':_0x5e3ac6['where']};return db[_0x570f('0x2c')][_0x570f('0x1f')](_0x13e9a9)[_0x570f('0x26')](function(_0x5bbc80){_0xbf1aa7[_0x570f('0x1f')]=_0x5bbc80;if(_0x3a988b[_0x570f('0x30')][_0x570f('0x3f')]){_0x5e3ac6[_0x570f('0x40')]=[{'all':!![]}];}return db[_0x570f('0x2c')]['findAll'](_0x5e3ac6);})['then'](function(_0x46c988){_0xbf1aa7[_0x570f('0x41')]=_0x46c988;return _0xbf1aa7;})[_0x570f('0x26')](respondWithFilteredResult(_0x59d936,_0x5e3ac6))[_0x570f('0x42')](handleError(_0x59d936,null));};exports['show']=function(_0x3aa818,_0x1ac050){var _0x28b216={'raw':!![],'where':{'id':_0x3aa818[_0x570f('0x43')]['id']}},_0x3288d7={};_0x3288d7[_0x570f('0x2f')]=_['keys'](db[_0x570f('0x2c')]['rawAttributes']);_0x3288d7[_0x570f('0x30')]=_[_0x570f('0x31')](_0x3aa818[_0x570f('0x30')]);_0x3288d7[_0x570f('0x32')]=_['intersection'](_0x3288d7[_0x570f('0x2f')],_0x3288d7['query']);_0x28b216[_0x570f('0x34')]=_[_0x570f('0x33')](_0x3288d7[_0x570f('0x2f')],qs[_0x570f('0x44')](_0x3aa818[_0x570f('0x30')][_0x570f('0x44')]));_0x28b216[_0x570f('0x34')]=_0x28b216[_0x570f('0x34')][_0x570f('0x45')]?_0x28b216[_0x570f('0x34')]:_0x3288d7['model'];if(_0x3aa818[_0x570f('0x30')][_0x570f('0x3f')]){_0x28b216[_0x570f('0x40')]=[{'all':!![]}];}_0x28b216=_['merge']({},_0x28b216,_0x3aa818[_0x570f('0x3e')]);return db['JscriptyQuestionReport'][_0x570f('0x46')](_0x28b216)[_0x570f('0x26')](handleEntityNotFound(_0x1ac050,null))[_0x570f('0x26')](respondWithResult(_0x1ac050,null))[_0x570f('0x42')](handleError(_0x1ac050,null));};exports[_0x570f('0x47')]=function(_0xa5209f,_0x1dfba3){return db[_0x570f('0x2c')]['create'](_0xa5209f[_0x570f('0x48')],{})[_0x570f('0x26')](respondWithResult(_0x1dfba3,0xc9))[_0x570f('0x42')](handleError(_0x1dfba3,null));};exports[_0x570f('0x25')]=function(_0x318cec,_0x39a0d1){if(_0x318cec[_0x570f('0x48')]['id']){delete _0x318cec[_0x570f('0x48')]['id'];}return db[_0x570f('0x2c')][_0x570f('0x46')]({'where':{'id':_0x318cec[_0x570f('0x43')]['id']}})['then'](handleEntityNotFound(_0x39a0d1,null))[_0x570f('0x26')](saveUpdates(_0x318cec[_0x570f('0x48')],null))[_0x570f('0x26')](respondWithResult(_0x39a0d1,null))[_0x570f('0x42')](handleError(_0x39a0d1,null));};exports[_0x570f('0x49')]=function(_0x4ec29c,_0x2ea7c7){return db[_0x570f('0x2c')][_0x570f('0x46')]({'where':{'id':_0x4ec29c[_0x570f('0x43')]['id']}})['then'](handleEntityNotFound(_0x2ea7c7,null))[_0x570f('0x26')](removeEntity(_0x2ea7c7,null))[_0x570f('0x42')](handleError(_0x2ea7c7,null));};exports[_0x570f('0x4a')]=function(_0xf0de43,_0x5299b3){return db[_0x570f('0x2c')]['describe']()[_0x570f('0x26')](respondWithResult(_0x5299b3,null))['catch'](handleError(_0x5299b3,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 4154b13..b35a384 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 _0x0ea2=['path','rimraf','../../config/environment','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x3c8960,_0x58e3cf){var _0xf4dd88=function(_0x716587){while(--_0x716587){_0x3c8960['push'](_0x3c8960['shift']());}};_0xf4dd88(++_0x58e3cf);}(_0x0ea2,0x96));var _0x20ea=function(_0x28eabf,_0x5bc9a4){_0x28eabf=_0x28eabf-0x0;var _0x11cb05=_0x0ea2[_0x28eabf];return _0x11cb05;};'use strict';var _=require(_0x20ea('0x0'));var util=require(_0x20ea('0x1'));var logger=require(_0x20ea('0x2'))(_0x20ea('0x3'));var moment=require('moment');var BPromise=require(_0x20ea('0x4'));var rp=require(_0x20ea('0x5'));var fs=require('fs');var path=require(_0x20ea('0x6'));var rimraf=require(_0x20ea('0x7'));var config=require(_0x20ea('0x8'));var attributes=require('./jscriptyQuestionReport.attributes');module['exports']=function(_0x2cb1d2,_0xb52ec4){return _0x2cb1d2[_0x20ea('0x9')](_0x20ea('0xa'),attributes,{'tableName':_0x20ea('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x70ba=['bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','api','moment'];(function(_0x2028b9,_0x31ce50){var _0x560506=function(_0x2039c3){while(--_0x2039c3){_0x2028b9['push'](_0x2028b9['shift']());}};_0x560506(++_0x31ce50);}(_0x70ba,0xcd));var _0xa70b=function(_0x155d71,_0x1ec033){_0x155d71=_0x155d71-0x0;var _0x5e8704=_0x70ba[_0x155d71];return _0x5e8704;};'use strict';var _=require(_0xa70b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa70b('0x1'));var moment=require(_0xa70b('0x2'));var BPromise=require(_0xa70b('0x3'));var rp=require(_0xa70b('0x4'));var fs=require('fs');var path=require(_0xa70b('0x5'));var rimraf=require(_0xa70b('0x6'));var config=require(_0xa70b('0x7'));var attributes=require(_0xa70b('0x8'));module[_0xa70b('0x9')]=function(_0x3e7681,_0x4b7010){return _0x3e7681[_0xa70b('0xa')](_0xa70b('0xb'),attributes,{'tableName':_0xa70b('0xc'),'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 6318658..64cdb99 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 _0x6a7a=['JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x840dd7,_0x4db359){var _0x2f6fda=function(_0xaf9197){while(--_0xaf9197){_0x840dd7['push'](_0x840dd7['shift']());}};_0x2f6fda(++_0x4db359);}(_0x6a7a,0x1a6));var _0xa6a7=function(_0x2bd6c0,_0x55b913){_0x2bd6c0=_0x2bd6c0-0x0;var _0x49f3a3=_0x6a7a[_0x2bd6c0];return _0x49f3a3;};'use strict';var _=require(_0xa6a7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa6a7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa6a7('0x2'))['db'];var utils=require(_0xa6a7('0x3'));var logger=require(_0xa6a7('0x4'))(_0xa6a7('0x5'));var config=require('../../config/environment');var jayson=require(_0xa6a7('0x6'));var client=jayson[_0xa6a7('0x7')][_0xa6a7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x48bdb5,_0x1e983e,_0x296a03){return new BPromise(function(_0x4bc1b1,_0x11cfe8){return client[_0xa6a7('0x9')](_0x48bdb5,_0x296a03)[_0xa6a7('0xa')](function(_0x4027a2){logger[_0xa6a7('0xb')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x1e983e,_0xa6a7('0xc'));logger[_0xa6a7('0xd')](_0xa6a7('0xe'),_0x1e983e,_0xa6a7('0xc'),JSON[_0xa6a7('0xf')](_0x4027a2));if(_0x4027a2[_0xa6a7('0x10')]){if(_0x4027a2[_0xa6a7('0x10')][_0xa6a7('0x11')]===0x1f4){logger[_0xa6a7('0x10')](_0xa6a7('0x12'),_0x1e983e,_0x4027a2[_0xa6a7('0x10')][_0xa6a7('0x13')]);return _0x11cfe8(_0x4027a2[_0xa6a7('0x10')][_0xa6a7('0x13')]);}logger[_0xa6a7('0x10')](_0xa6a7('0x12'),_0x1e983e,_0x4027a2[_0xa6a7('0x10')][_0xa6a7('0x13')]);return _0x4bc1b1(_0x4027a2['error'][_0xa6a7('0x13')]);}else{logger['info'](_0xa6a7('0x12'),_0x1e983e,'request\x20sent');_0x4bc1b1(_0x4027a2[_0xa6a7('0x14')]['message']);}})[_0xa6a7('0x15')](function(_0x41d01e){logger[_0xa6a7('0x10')](_0xa6a7('0x12'),_0x1e983e,_0x41d01e);_0x11cfe8(_0x41d01e);});});} \ No newline at end of file +var _0xc105=['error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify'];(function(_0x434804,_0x415f68){var _0x573fc8=function(_0x3ce265){while(--_0x3ce265){_0x434804['push'](_0x434804['shift']());}};_0x573fc8(++_0x415f68);}(_0xc105,0x1ce));var _0x5c10=function(_0x5a6d11,_0x3f443b){_0x5a6d11=_0x5a6d11-0x0;var _0x2512ff=_0xc105[_0x5a6d11];return _0x2512ff;};'use strict';var _=require(_0x5c10('0x0'));var util=require(_0x5c10('0x1'));var moment=require(_0x5c10('0x2'));var BPromise=require(_0x5c10('0x3'));var rs=require(_0x5c10('0x4'));var fs=require('fs');var Redis=require(_0x5c10('0x5'));var db=require(_0x5c10('0x6'))['db'];var utils=require(_0x5c10('0x7'));var logger=require(_0x5c10('0x8'))(_0x5c10('0x9'));var config=require(_0x5c10('0xa'));var jayson=require(_0x5c10('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xf89e2b,_0x36bb61,_0x126d8f){return new BPromise(function(_0x288dc7,_0x33b16f){return client[_0x5c10('0xc')](_0xf89e2b,_0x126d8f)[_0x5c10('0xd')](function(_0x473087){logger[_0x5c10('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x36bb61,_0x5c10('0xf'));logger[_0x5c10('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x36bb61,_0x5c10('0xf'),JSON[_0x5c10('0x11')](_0x473087));if(_0x473087[_0x5c10('0x12')]){if(_0x473087['error'][_0x5c10('0x13')]===0x1f4){logger[_0x5c10('0x12')](_0x5c10('0x14'),_0x36bb61,_0x473087['error'][_0x5c10('0x15')]);return _0x33b16f(_0x473087[_0x5c10('0x12')][_0x5c10('0x15')]);}logger['error'](_0x5c10('0x14'),_0x36bb61,_0x473087['error'][_0x5c10('0x15')]);return _0x288dc7(_0x473087[_0x5c10('0x12')][_0x5c10('0x15')]);}else{logger['info'](_0x5c10('0x14'),_0x36bb61,_0x5c10('0xf'));_0x288dc7(_0x473087[_0x5c10('0x16')][_0x5c10('0x15')]);}})[_0x5c10('0x17')](function(_0x2083ee){logger['error'](_0x5c10('0x14'),_0x36bb61,_0x2083ee);_0x33b16f(_0x2083ee);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 7a86dcb..35dfbde 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 _0x6701=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/questions','post','create','put','update','delete','multer','util','path','connect-timeout','express'];(function(_0x8cb2f9,_0x2b8706){var _0x164887=function(_0x1812cc){while(--_0x1812cc){_0x8cb2f9['push'](_0x8cb2f9['shift']());}};_0x164887(++_0x2b8706);}(_0x6701,0x1de));var _0x1670=function(_0x46eb54,_0x4f1eac){_0x46eb54=_0x46eb54-0x0;var _0x3902b2=_0x6701[_0x46eb54];return _0x3902b2;};'use strict';var multer=require(_0x1670('0x0'));var util=require(_0x1670('0x1'));var path=require(_0x1670('0x2'));var timeout=require(_0x1670('0x3'));var express=require(_0x1670('0x4'));var router=express[_0x1670('0x5')]();var fs_extra=require(_0x1670('0x6'));var auth=require(_0x1670('0x7'));var interaction=require(_0x1670('0x8'));var config=require(_0x1670('0x9'));var controller=require(_0x1670('0xa'));router[_0x1670('0xb')]('/',auth[_0x1670('0xc')](),controller['index']);router[_0x1670('0xb')](_0x1670('0xd'),auth['isAuthenticated'](),controller[_0x1670('0xe')]);router[_0x1670('0xb')](_0x1670('0xf'),auth[_0x1670('0xc')](),controller[_0x1670('0x10')]);router[_0x1670('0xb')](_0x1670('0x11'),auth[_0x1670('0xc')](),controller['getQuestions']);router[_0x1670('0x12')]('/',auth[_0x1670('0xc')](),controller[_0x1670('0x13')]);router[_0x1670('0x14')](_0x1670('0xf'),auth[_0x1670('0xc')](),controller[_0x1670('0x15')]);router[_0x1670('0x16')](_0x1670('0xf'),auth[_0x1670('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x5806=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','/describe','isAuthenticated','describe','/:id/questions','post','create','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5806,0xfb));var _0x6580=function(_0x45fc6a,_0x166adb){_0x45fc6a=_0x45fc6a-0x0;var _0x14bcfd=_0x5806[_0x45fc6a];return _0x14bcfd;};'use strict';var multer=require(_0x6580('0x0'));var util=require(_0x6580('0x1'));var path=require(_0x6580('0x2'));var timeout=require('connect-timeout');var express=require(_0x6580('0x3'));var router=express[_0x6580('0x4')]();var fs_extra=require(_0x6580('0x5'));var auth=require(_0x6580('0x6'));var interaction=require(_0x6580('0x7'));var config=require(_0x6580('0x8'));var controller=require(_0x6580('0x9'));router[_0x6580('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6580('0xa')](_0x6580('0xb'),auth[_0x6580('0xc')](),controller[_0x6580('0xd')]);router[_0x6580('0xa')]('/:id',auth[_0x6580('0xc')](),controller['show']);router['get'](_0x6580('0xe'),auth[_0x6580('0xc')](),controller['getQuestions']);router[_0x6580('0xf')]('/',auth[_0x6580('0xc')](),controller[_0x6580('0x10')]);router[_0x6580('0x11')](_0x6580('0x12'),auth[_0x6580('0xc')](),controller[_0x6580('0x13')]);router[_0x6580('0x14')](_0x6580('0x12'),auth['isAuthenticated'](),controller[_0x6580('0x15')]);module[_0x6580('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 173cfe4..851dd09 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 _0xbd19=['moment','sequelize','DATE','starttime','setDataValue','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN'];(function(_0x34a075,_0x414612){var _0x158200=function(_0xe21105){while(--_0xe21105){_0x34a075['push'](_0x34a075['shift']());}};_0x158200(++_0x414612);}(_0xbd19,0x1f0));var _0x9bd1=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0xbd19[_0x616290];return _0x453879;};'use strict';var moment=require(_0x9bd1('0x0'));var Sequelize=require(_0x9bd1('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x9bd1('0x2')],'set':function(_0x51693a){this['setDataValue'](_0x9bd1('0x3'),_0x51693a);this[_0x9bd1('0x4')]('endtime',moment()['format'](_0x9bd1('0x5')));}},'endtime':{'type':Sequelize[_0x9bd1('0x2')]},'membername':{'type':Sequelize[_0x9bd1('0x6')]},'projectname':{'type':Sequelize[_0x9bd1('0x6')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x9bd1('0x6')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x9bd1('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x8b6b=['setDataValue','starttime','endtime','STRING','BOOLEAN','sequelize','exports','DATE'];(function(_0x55ddb1,_0x3b6ca2){var _0x56337d=function(_0xf2b4c4){while(--_0xf2b4c4){_0x55ddb1['push'](_0x55ddb1['shift']());}};_0x56337d(++_0x3b6ca2);}(_0x8b6b,0x13d));var _0xb8b6=function(_0x4a7bac,_0x1a8719){_0x4a7bac=_0x4a7bac-0x0;var _0x284a73=_0x8b6b[_0x4a7bac];return _0x284a73;};'use strict';var moment=require('moment');var Sequelize=require(_0xb8b6('0x0'));module[_0xb8b6('0x1')]={'starttime':{'type':Sequelize[_0xb8b6('0x2')],'set':function(_0x8aff99){this[_0xb8b6('0x3')](_0xb8b6('0x4'),_0x8aff99);this[_0xb8b6('0x3')](_0xb8b6('0x5'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0xb8b6('0x2')]},'membername':{'type':Sequelize[_0xb8b6('0x6')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xb8b6('0x6')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb8b6('0x6')]},'completed':{'type':Sequelize[_0xb8b6('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index d205ab7..bb9c903 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 _0x4004=['body','update','params','destroy','find','describe','getQuestions','JscriptyQuestionReport','SessionId','findAll','zip-dir','request-promise','moment','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','offset','count','apply','save','then','stack','name','send','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','include','create'];(function(_0x4a27eb,_0x3bb58f){var _0x515047=function(_0x3c82f4){while(--_0x3c82f4){_0x4a27eb['push'](_0x4a27eb['shift']());}};_0x515047(++_0x3bb58f);}(_0x4004,0x1ba));var _0x4400=function(_0x43b1fb,_0x22e01e){_0x43b1fb=_0x43b1fb-0x0;var _0x2eb5bc=_0x4004[_0x43b1fb];return _0x2eb5bc;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4400('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4400('0x1'));var moment=require(_0x4400('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x4400('0x3'));var sox=require('sox');var csv=require(_0x4400('0x4'));var ejs=require(_0x4400('0x5'));var fs=require('fs');var fs_extra=require(_0x4400('0x6'));var _=require(_0x4400('0x7'));var squel=require(_0x4400('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4400('0x9'));var toCsv=require('to-csv');var querystring=require(_0x4400('0xa'));var Papa=require(_0x4400('0xb'));var Redis=require(_0x4400('0xc'));var authService=require(_0x4400('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x4400('0xe'));var hardwareService=require(_0x4400('0xf'));var logger=require('../../config/logger')(_0x4400('0x10'));var utils=require(_0x4400('0x11'));var config=require(_0x4400('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27900a,_0x475dac){_0x475dac=_0x475dac||0xcc;return function(_0xdcba46){if(_0xdcba46){return _0x27900a[_0x4400('0x13')](_0x475dac);}return _0x27900a[_0x4400('0x14')](_0x475dac)[_0x4400('0x15')]();};}function respondWithResult(_0xc77b4d,_0x2190fa){_0x2190fa=_0x2190fa||0xc8;return function(_0x4463a6){if(_0x4463a6){return _0xc77b4d[_0x4400('0x14')](_0x2190fa)[_0x4400('0x16')](_0x4463a6);}};}function respondWithFilteredResult(_0x46a150,_0x14ffee){return function(_0x5a622e){if(_0x5a622e){var _0x591254=typeof _0x14ffee['offset']===_0x4400('0x17')&&typeof _0x14ffee[_0x4400('0x18')]===_0x4400('0x17');var _0x9909b2=_0x5a622e['count'];var _0x3e9cf5=_0x591254?0x0:_0x14ffee[_0x4400('0x19')];var _0x4fbd62=_0x591254?_0x5a622e[_0x4400('0x1a')]:_0x14ffee[_0x4400('0x19')]+_0x14ffee[_0x4400('0x18')];var _0x527fda;if(_0x4fbd62>=_0x9909b2){_0x4fbd62=_0x9909b2;_0x527fda=0xc8;}else{_0x527fda=0xce;}_0x46a150[_0x4400('0x14')](_0x527fda);return _0x46a150['set']('Content-Range',_0x3e9cf5+'-'+_0x4fbd62+'/'+_0x9909b2)[_0x4400('0x16')](_0x5a622e);}return null;};}function patchUpdates(_0x2e9602){return function(_0x1c96b8){try{jsonpatch[_0x4400('0x1b')](_0x1c96b8,_0x2e9602,!![]);}catch(_0x458dd2){return BPromise['reject'](_0x458dd2);}return _0x1c96b8[_0x4400('0x1c')]();};}function saveUpdates(_0xb6c2e9,_0x1aec66){return function(_0x83fcb4){if(_0x83fcb4){return _0x83fcb4['update'](_0xb6c2e9)[_0x4400('0x1d')](function(_0x1a0c6f){return _0x1a0c6f;});}return null;};}function removeEntity(_0x53702b,_0x4ba599){return function(_0x140b1e){if(_0x140b1e){return _0x140b1e['destroy']()['then'](function(){_0x53702b['status'](0xcc)[_0x4400('0x15')]();});}};}function handleEntityNotFound(_0x250819,_0x460395){return function(_0x3b84b7){if(!_0x3b84b7){_0x250819[_0x4400('0x13')](0x194);}return _0x3b84b7;};}function handleError(_0xbf4f46,_0x59121b){_0x59121b=_0x59121b||0x1f4;return function(_0xe1075){logger['error'](_0xe1075[_0x4400('0x1e')]);if(_0xe1075[_0x4400('0x1f')]){delete _0xe1075['name'];}_0xbf4f46[_0x4400('0x14')](_0x59121b)[_0x4400('0x20')](_0xe1075);};}exports['index']=function(_0x2b6fff,_0x168aaf){var _0x15142c={},_0x25cf9a={},_0x9ddf84={'count':0x0,'rows':[]};var _0x34c4e9=_[_0x4400('0x21')](db[_0x4400('0x22')][_0x4400('0x23')],function(_0x4821a5){return{'name':_0x4821a5[_0x4400('0x24')],'type':_0x4821a5[_0x4400('0x25')][_0x4400('0x26')]};});_0x25cf9a[_0x4400('0x27')]=_[_0x4400('0x21')](_0x34c4e9,_0x4400('0x1f'));_0x25cf9a[_0x4400('0x28')]=_[_0x4400('0x29')](_0x2b6fff[_0x4400('0x28')]);_0x25cf9a[_0x4400('0x2a')]=_[_0x4400('0x2b')](_0x25cf9a[_0x4400('0x27')],_0x25cf9a[_0x4400('0x28')]);_0x15142c[_0x4400('0x2c')]=_['intersection'](_0x25cf9a[_0x4400('0x27')],qs[_0x4400('0x2d')](_0x2b6fff[_0x4400('0x28')][_0x4400('0x2d')]));_0x15142c[_0x4400('0x2c')]=_0x15142c[_0x4400('0x2c')][_0x4400('0x2e')]?_0x15142c[_0x4400('0x2c')]:_0x25cf9a[_0x4400('0x27')];if(!_0x2b6fff[_0x4400('0x28')][_0x4400('0x2f')](_0x4400('0x30'))){_0x15142c[_0x4400('0x18')]=qs[_0x4400('0x18')](_0x2b6fff[_0x4400('0x28')][_0x4400('0x18')]);_0x15142c[_0x4400('0x19')]=qs[_0x4400('0x19')](_0x2b6fff[_0x4400('0x28')]['offset']);}_0x15142c[_0x4400('0x31')]=qs['sort'](_0x2b6fff[_0x4400('0x28')][_0x4400('0x32')]);_0x15142c[_0x4400('0x33')]=qs[_0x4400('0x2a')](_[_0x4400('0x34')](_0x2b6fff['query'],_0x25cf9a[_0x4400('0x2a')]),_0x34c4e9);if(_0x2b6fff[_0x4400('0x28')][_0x4400('0x35')]){_0x15142c[_0x4400('0x33')]=_[_0x4400('0x36')](_0x15142c[_0x4400('0x33')],{'$or':_[_0x4400('0x21')](_0x34c4e9,function(_0x43fdf6){if(_0x43fdf6[_0x4400('0x25')]!==_0x4400('0x37')){var _0x2ff8ae={};_0x2ff8ae[_0x43fdf6[_0x4400('0x1f')]]={'$like':'%'+_0x2b6fff[_0x4400('0x28')][_0x4400('0x35')]+'%'};return _0x2ff8ae;}})});}_0x15142c=_[_0x4400('0x36')]({},_0x15142c,_0x2b6fff[_0x4400('0x38')]);var _0x375b50={'where':_0x15142c[_0x4400('0x33')]};return db[_0x4400('0x22')]['count'](_0x375b50)[_0x4400('0x1d')](function(_0x23a6b7){_0x9ddf84['count']=_0x23a6b7;if(_0x2b6fff[_0x4400('0x28')][_0x4400('0x39')]){_0x15142c['include']=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x15142c);})[_0x4400('0x1d')](function(_0x5b5e17){_0x9ddf84[_0x4400('0x3a')]=_0x5b5e17;return _0x9ddf84;})[_0x4400('0x1d')](respondWithFilteredResult(_0x168aaf,_0x15142c))[_0x4400('0x3b')](handleError(_0x168aaf,null));};exports['show']=function(_0x291f38,_0x327bc9){var _0x219837={'raw':!![],'where':{'id':_0x291f38['params']['id']}},_0x2e01b2={};_0x2e01b2[_0x4400('0x27')]=_['keys'](db[_0x4400('0x22')][_0x4400('0x23')]);_0x2e01b2[_0x4400('0x28')]=_['keys'](_0x291f38[_0x4400('0x28')]);_0x2e01b2['filters']=_[_0x4400('0x2b')](_0x2e01b2[_0x4400('0x27')],_0x2e01b2[_0x4400('0x28')]);_0x219837[_0x4400('0x2c')]=_['intersection'](_0x2e01b2[_0x4400('0x27')],qs[_0x4400('0x2d')](_0x291f38[_0x4400('0x28')][_0x4400('0x2d')]));_0x219837[_0x4400('0x2c')]=_0x219837[_0x4400('0x2c')][_0x4400('0x2e')]?_0x219837[_0x4400('0x2c')]:_0x2e01b2[_0x4400('0x27')];if(_0x291f38[_0x4400('0x28')][_0x4400('0x39')]){_0x219837[_0x4400('0x3c')]=[{'all':!![]}];}_0x219837=_['merge']({},_0x219837,_0x291f38[_0x4400('0x38')]);return db[_0x4400('0x22')]['find'](_0x219837)[_0x4400('0x1d')](handleEntityNotFound(_0x327bc9,null))['then'](respondWithResult(_0x327bc9,null))[_0x4400('0x3b')](handleError(_0x327bc9,null));};exports[_0x4400('0x3d')]=function(_0x31f17c,_0x5980b0){return db[_0x4400('0x22')][_0x4400('0x3d')](_0x31f17c[_0x4400('0x3e')],{})[_0x4400('0x1d')](respondWithResult(_0x5980b0,0xc9))[_0x4400('0x3b')](handleError(_0x5980b0,null));};exports[_0x4400('0x3f')]=function(_0x2324cd,_0x53d46a){if(_0x2324cd[_0x4400('0x3e')]['id']){delete _0x2324cd[_0x4400('0x3e')]['id'];}return db[_0x4400('0x22')]['find']({'where':{'id':_0x2324cd[_0x4400('0x40')]['id']}})[_0x4400('0x1d')](handleEntityNotFound(_0x53d46a,null))[_0x4400('0x1d')](saveUpdates(_0x2324cd['body'],null))[_0x4400('0x1d')](respondWithResult(_0x53d46a,null))[_0x4400('0x3b')](handleError(_0x53d46a,null));};exports[_0x4400('0x41')]=function(_0x2c9fcc,_0x376ad8){return db[_0x4400('0x22')][_0x4400('0x42')]({'where':{'id':_0x2c9fcc['params']['id']}})['then'](handleEntityNotFound(_0x376ad8,null))['then'](removeEntity(_0x376ad8,null))['catch'](handleError(_0x376ad8,null));};exports[_0x4400('0x43')]=function(_0x577fec,_0xaf0b35){return db[_0x4400('0x22')][_0x4400('0x43')]()[_0x4400('0x1d')](respondWithResult(_0xaf0b35,null))[_0x4400('0x3b')](handleError(_0xaf0b35,null));};exports[_0x4400('0x44')]=function(_0x2143e7,_0x41f10b,_0x4836cd){var _0xa13b8={'raw':!![],'where':{}};var _0xe196={};var _0x56e57d={'count':0x0,'rows':[]};return db[_0x4400('0x22')]['findOne']({'where':{'id':_0x2143e7[_0x4400('0x40')]['id']}})[_0x4400('0x1d')](handleEntityNotFound(_0x41f10b,null))[_0x4400('0x1d')](function(_0x4618ef){if(_0x4618ef){_0xe196[_0x4400('0x27')]=_[_0x4400('0x29')](db[_0x4400('0x45')]['rawAttributes']);_0xe196[_0x4400('0x28')]=_[_0x4400('0x29')](_0x2143e7[_0x4400('0x28')]);_0xe196['filters']=_[_0x4400('0x2b')](_0xe196[_0x4400('0x27')],_0xe196['query']);_0xa13b8['attributes']=_[_0x4400('0x2b')](_0xe196[_0x4400('0x27')],qs[_0x4400('0x2d')](_0x2143e7['query'][_0x4400('0x2d')]));_0xa13b8[_0x4400('0x2c')]=_0xa13b8['attributes'][_0x4400('0x2e')]?_0xa13b8[_0x4400('0x2c')]:_0xe196[_0x4400('0x27')];if(!_0x2143e7[_0x4400('0x28')][_0x4400('0x2f')](_0x4400('0x30'))){_0xa13b8['limit']=qs[_0x4400('0x18')](_0x2143e7['query'][_0x4400('0x18')]);_0xa13b8[_0x4400('0x19')]=qs[_0x4400('0x19')](_0x2143e7[_0x4400('0x28')]['offset']);}_0xa13b8[_0x4400('0x31')]=qs[_0x4400('0x32')](_0x2143e7[_0x4400('0x28')][_0x4400('0x32')]);_0xa13b8['where']=qs['filters'](_[_0x4400('0x34')](_0x2143e7[_0x4400('0x28')],_0xe196['filters']));_0xa13b8[_0x4400('0x33')][_0x4400('0x46')]=_0x4618ef['id'];if(_0x2143e7[_0x4400('0x28')][_0x4400('0x35')]){_0xa13b8[_0x4400('0x33')]=_['merge'](_0xa13b8['where'],{'$or':_[_0x4400('0x21')](_0xa13b8[_0x4400('0x2c')],function(_0x72e175){var _0x531f6b={};_0x531f6b[_0x72e175]={'$like':'%'+_0x2143e7[_0x4400('0x28')][_0x4400('0x35')]+'%'};return _0x531f6b;})});}_0xa13b8=_[_0x4400('0x36')]({},_0xa13b8,_0x2143e7['options']);return db[_0x4400('0x45')][_0x4400('0x1a')]({'where':_0xa13b8[_0x4400('0x33')]})[_0x4400('0x1d')](function(_0x218184){_0x56e57d[_0x4400('0x1a')]=_0x218184;if(_0x2143e7[_0x4400('0x28')]['includeAll']){_0xa13b8[_0x4400('0x3c')]=[{'all':!![]}];}return db[_0x4400('0x45')][_0x4400('0x47')](_0xa13b8);})['then'](function(_0x147250){_0x56e57d[_0x4400('0x3a')]=_0x147250;return _0x56e57d;});}})[_0x4400('0x1d')](respondWithFilteredResult(_0x41f10b,_0xa13b8))[_0x4400('0x3b')](handleError(_0x41f10b,null));}; \ No newline at end of file +var _0x8df8=['getQuestions','findOne','JscriptyQuestionReport','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','then','destroy','error','stack','name','send','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','JscriptySessionReport','includeAll','include','findAll','rows','show','params','find','catch','create','body','update','describe'];(function(_0x26ddbf,_0x38a762){var _0x119938=function(_0x2bd128){while(--_0x2bd128){_0x26ddbf['push'](_0x26ddbf['shift']());}};_0x119938(++_0x38a762);}(_0x8df8,0x1f0));var _0x88df=function(_0x4fffcf,_0x49b324){_0x4fffcf=_0x4fffcf-0x0;var _0x544752=_0x8df8[_0x4fffcf];return _0x544752;};'use strict';var emlformat=require(_0x88df('0x0'));var rimraf=require(_0x88df('0x1'));var zipdir=require(_0x88df('0x2'));var jsonpatch=require(_0x88df('0x3'));var rp=require(_0x88df('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x88df('0x5'));var util=require(_0x88df('0x6'));var path=require('path');var sox=require(_0x88df('0x7'));var csv=require(_0x88df('0x8'));var ejs=require(_0x88df('0x9'));var fs=require('fs');var fs_extra=require(_0x88df('0xa'));var _=require(_0x88df('0xb'));var squel=require(_0x88df('0xc'));var crypto=require(_0x88df('0xd'));var jsforce=require(_0x88df('0xe'));var deskjs=require(_0x88df('0xf'));var toCsv=require(_0x88df('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x88df('0x10'));var authService=require(_0x88df('0x11'));var qs=require(_0x88df('0x12'));var as=require(_0x88df('0x13'));var hardwareService=require(_0x88df('0x14'));var logger=require(_0x88df('0x15'))(_0x88df('0x16'));var utils=require(_0x88df('0x17'));var config=require(_0x88df('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3028c9,_0x45ae3e){_0x45ae3e=_0x45ae3e||0xcc;return function(_0x388206){if(_0x388206){return _0x3028c9[_0x88df('0x19')](_0x45ae3e);}return _0x3028c9[_0x88df('0x1a')](_0x45ae3e)[_0x88df('0x1b')]();};}function respondWithResult(_0x4af69a,_0x3b33bc){_0x3b33bc=_0x3b33bc||0xc8;return function(_0x425368){if(_0x425368){return _0x4af69a[_0x88df('0x1a')](_0x3b33bc)['json'](_0x425368);}};}function respondWithFilteredResult(_0x5d6746,_0x2f08e4){return function(_0x35ddf1){if(_0x35ddf1){var _0x4d81ab=typeof _0x2f08e4[_0x88df('0x1c')]==='undefined'&&typeof _0x2f08e4[_0x88df('0x1d')]===_0x88df('0x1e');var _0x2d17ef=_0x35ddf1[_0x88df('0x1f')];var _0x3a43e7=_0x4d81ab?0x0:_0x2f08e4['offset'];var _0x517321=_0x4d81ab?_0x35ddf1[_0x88df('0x1f')]:_0x2f08e4[_0x88df('0x1c')]+_0x2f08e4[_0x88df('0x1d')];var _0x17fc1a;if(_0x517321>=_0x2d17ef){_0x517321=_0x2d17ef;_0x17fc1a=0xc8;}else{_0x17fc1a=0xce;}_0x5d6746[_0x88df('0x1a')](_0x17fc1a);return _0x5d6746[_0x88df('0x20')](_0x88df('0x21'),_0x3a43e7+'-'+_0x517321+'/'+_0x2d17ef)[_0x88df('0x22')](_0x35ddf1);}return null;};}function patchUpdates(_0x31e440){return function(_0x40b04c){try{jsonpatch[_0x88df('0x23')](_0x40b04c,_0x31e440,!![]);}catch(_0x1c7da8){return BPromise['reject'](_0x1c7da8);}return _0x40b04c[_0x88df('0x24')]();};}function saveUpdates(_0x1eca4a,_0x42bb58){return function(_0x569e90){if(_0x569e90){return _0x569e90['update'](_0x1eca4a)[_0x88df('0x25')](function(_0x2ec563){return _0x2ec563;});}return null;};}function removeEntity(_0x1cb53c,_0x675998){return function(_0x109fff){if(_0x109fff){return _0x109fff[_0x88df('0x26')]()['then'](function(){_0x1cb53c['status'](0xcc)[_0x88df('0x1b')]();});}};}function handleEntityNotFound(_0x1b9b86,_0xdd8082){return function(_0x5af774){if(!_0x5af774){_0x1b9b86[_0x88df('0x19')](0x194);}return _0x5af774;};}function handleError(_0x351c7e,_0x45647e){_0x45647e=_0x45647e||0x1f4;return function(_0x318ad4){logger[_0x88df('0x27')](_0x318ad4[_0x88df('0x28')]);if(_0x318ad4[_0x88df('0x29')]){delete _0x318ad4['name'];}_0x351c7e[_0x88df('0x1a')](_0x45647e)[_0x88df('0x2a')](_0x318ad4);};}exports['index']=function(_0x5a2565,_0x24f4f3){var _0x4e9e66={},_0x37f4ec={},_0x3391c2={'count':0x0,'rows':[]};var _0x2a1090=_['map'](db['JscriptySessionReport'][_0x88df('0x2b')],function(_0x176335){return{'name':_0x176335[_0x88df('0x2c')],'type':_0x176335[_0x88df('0x2d')][_0x88df('0x2e')]};});_0x37f4ec[_0x88df('0x2f')]=_[_0x88df('0x30')](_0x2a1090,_0x88df('0x29'));_0x37f4ec[_0x88df('0x31')]=_[_0x88df('0x32')](_0x5a2565['query']);_0x37f4ec[_0x88df('0x33')]=_[_0x88df('0x34')](_0x37f4ec['model'],_0x37f4ec[_0x88df('0x31')]);_0x4e9e66['attributes']=_[_0x88df('0x34')](_0x37f4ec[_0x88df('0x2f')],qs[_0x88df('0x35')](_0x5a2565[_0x88df('0x31')][_0x88df('0x35')]));_0x4e9e66['attributes']=_0x4e9e66[_0x88df('0x36')]['length']?_0x4e9e66['attributes']:_0x37f4ec['model'];if(!_0x5a2565[_0x88df('0x31')][_0x88df('0x37')](_0x88df('0x38'))){_0x4e9e66[_0x88df('0x1d')]=qs['limit'](_0x5a2565[_0x88df('0x31')][_0x88df('0x1d')]);_0x4e9e66[_0x88df('0x1c')]=qs[_0x88df('0x1c')](_0x5a2565['query'][_0x88df('0x1c')]);}_0x4e9e66[_0x88df('0x39')]=qs[_0x88df('0x3a')](_0x5a2565[_0x88df('0x31')][_0x88df('0x3a')]);_0x4e9e66['where']=qs['filters'](_[_0x88df('0x3b')](_0x5a2565['query'],_0x37f4ec[_0x88df('0x33')]),_0x2a1090);if(_0x5a2565[_0x88df('0x31')]['filter']){_0x4e9e66[_0x88df('0x3c')]=_['merge'](_0x4e9e66[_0x88df('0x3c')],{'$or':_[_0x88df('0x30')](_0x2a1090,function(_0x47f669){if(_0x47f669[_0x88df('0x2d')]!==_0x88df('0x3d')){var _0x13b6f1={};_0x13b6f1[_0x47f669[_0x88df('0x29')]]={'$like':'%'+_0x5a2565[_0x88df('0x31')][_0x88df('0x3e')]+'%'};return _0x13b6f1;}})});}_0x4e9e66=_[_0x88df('0x3f')]({},_0x4e9e66,_0x5a2565[_0x88df('0x40')]);var _0x25e498={'where':_0x4e9e66[_0x88df('0x3c')]};return db[_0x88df('0x41')][_0x88df('0x1f')](_0x25e498)['then'](function(_0x357202){_0x3391c2['count']=_0x357202;if(_0x5a2565[_0x88df('0x31')][_0x88df('0x42')]){_0x4e9e66[_0x88df('0x43')]=[{'all':!![]}];}return db[_0x88df('0x41')][_0x88df('0x44')](_0x4e9e66);})[_0x88df('0x25')](function(_0x202c1a){_0x3391c2[_0x88df('0x45')]=_0x202c1a;return _0x3391c2;})['then'](respondWithFilteredResult(_0x24f4f3,_0x4e9e66))['catch'](handleError(_0x24f4f3,null));};exports[_0x88df('0x46')]=function(_0x5cac6c,_0x163642){var _0x23e0fc={'raw':!![],'where':{'id':_0x5cac6c[_0x88df('0x47')]['id']}},_0x454ac4={};_0x454ac4[_0x88df('0x2f')]=_['keys'](db[_0x88df('0x41')][_0x88df('0x2b')]);_0x454ac4[_0x88df('0x31')]=_['keys'](_0x5cac6c[_0x88df('0x31')]);_0x454ac4[_0x88df('0x33')]=_[_0x88df('0x34')](_0x454ac4['model'],_0x454ac4[_0x88df('0x31')]);_0x23e0fc['attributes']=_[_0x88df('0x34')](_0x454ac4[_0x88df('0x2f')],qs[_0x88df('0x35')](_0x5cac6c[_0x88df('0x31')][_0x88df('0x35')]));_0x23e0fc[_0x88df('0x36')]=_0x23e0fc[_0x88df('0x36')]['length']?_0x23e0fc[_0x88df('0x36')]:_0x454ac4[_0x88df('0x2f')];if(_0x5cac6c[_0x88df('0x31')][_0x88df('0x42')]){_0x23e0fc[_0x88df('0x43')]=[{'all':!![]}];}_0x23e0fc=_['merge']({},_0x23e0fc,_0x5cac6c[_0x88df('0x40')]);return db[_0x88df('0x41')][_0x88df('0x48')](_0x23e0fc)[_0x88df('0x25')](handleEntityNotFound(_0x163642,null))[_0x88df('0x25')](respondWithResult(_0x163642,null))[_0x88df('0x49')](handleError(_0x163642,null));};exports[_0x88df('0x4a')]=function(_0x20391f,_0x5639e1){return db[_0x88df('0x41')][_0x88df('0x4a')](_0x20391f[_0x88df('0x4b')],{})[_0x88df('0x25')](respondWithResult(_0x5639e1,0xc9))[_0x88df('0x49')](handleError(_0x5639e1,null));};exports[_0x88df('0x4c')]=function(_0xae27ae,_0x3f7aa9){if(_0xae27ae[_0x88df('0x4b')]['id']){delete _0xae27ae[_0x88df('0x4b')]['id'];}return db[_0x88df('0x41')][_0x88df('0x48')]({'where':{'id':_0xae27ae[_0x88df('0x47')]['id']}})['then'](handleEntityNotFound(_0x3f7aa9,null))['then'](saveUpdates(_0xae27ae[_0x88df('0x4b')],null))[_0x88df('0x25')](respondWithResult(_0x3f7aa9,null))[_0x88df('0x49')](handleError(_0x3f7aa9,null));};exports[_0x88df('0x26')]=function(_0x2a9c7f,_0xefc0cf){return db['JscriptySessionReport'][_0x88df('0x48')]({'where':{'id':_0x2a9c7f[_0x88df('0x47')]['id']}})['then'](handleEntityNotFound(_0xefc0cf,null))[_0x88df('0x25')](removeEntity(_0xefc0cf,null))[_0x88df('0x49')](handleError(_0xefc0cf,null));};exports[_0x88df('0x4d')]=function(_0x1379f6,_0x53f191){return db[_0x88df('0x41')]['describe']()[_0x88df('0x25')](respondWithResult(_0x53f191,null))['catch'](handleError(_0x53f191,null));};exports[_0x88df('0x4e')]=function(_0x4839c0,_0x1bf86c,_0x17a9d8){var _0x59b648={'raw':!![],'where':{}};var _0x274bd1={};var _0x43f03c={'count':0x0,'rows':[]};return db[_0x88df('0x41')][_0x88df('0x4f')]({'where':{'id':_0x4839c0['params']['id']}})[_0x88df('0x25')](handleEntityNotFound(_0x1bf86c,null))[_0x88df('0x25')](function(_0x26ee67){if(_0x26ee67){_0x274bd1[_0x88df('0x2f')]=_[_0x88df('0x32')](db[_0x88df('0x50')][_0x88df('0x2b')]);_0x274bd1['query']=_[_0x88df('0x32')](_0x4839c0['query']);_0x274bd1[_0x88df('0x33')]=_[_0x88df('0x34')](_0x274bd1['model'],_0x274bd1['query']);_0x59b648[_0x88df('0x36')]=_[_0x88df('0x34')](_0x274bd1[_0x88df('0x2f')],qs[_0x88df('0x35')](_0x4839c0[_0x88df('0x31')][_0x88df('0x35')]));_0x59b648[_0x88df('0x36')]=_0x59b648[_0x88df('0x36')]['length']?_0x59b648[_0x88df('0x36')]:_0x274bd1[_0x88df('0x2f')];if(!_0x4839c0[_0x88df('0x31')]['hasOwnProperty'](_0x88df('0x38'))){_0x59b648[_0x88df('0x1d')]=qs[_0x88df('0x1d')](_0x4839c0[_0x88df('0x31')][_0x88df('0x1d')]);_0x59b648[_0x88df('0x1c')]=qs[_0x88df('0x1c')](_0x4839c0[_0x88df('0x31')][_0x88df('0x1c')]);}_0x59b648[_0x88df('0x39')]=qs[_0x88df('0x3a')](_0x4839c0[_0x88df('0x31')][_0x88df('0x3a')]);_0x59b648[_0x88df('0x3c')]=qs[_0x88df('0x33')](_[_0x88df('0x3b')](_0x4839c0[_0x88df('0x31')],_0x274bd1[_0x88df('0x33')]));_0x59b648[_0x88df('0x3c')][_0x88df('0x51')]=_0x26ee67['id'];if(_0x4839c0['query'][_0x88df('0x3e')]){_0x59b648[_0x88df('0x3c')]=_['merge'](_0x59b648[_0x88df('0x3c')],{'$or':_[_0x88df('0x30')](_0x59b648['attributes'],function(_0x53d4fe){var _0x393a55={};_0x393a55[_0x53d4fe]={'$like':'%'+_0x4839c0[_0x88df('0x31')][_0x88df('0x3e')]+'%'};return _0x393a55;})});}_0x59b648=_['merge']({},_0x59b648,_0x4839c0[_0x88df('0x40')]);return db[_0x88df('0x50')]['count']({'where':_0x59b648[_0x88df('0x3c')]})[_0x88df('0x25')](function(_0xeea123){_0x43f03c[_0x88df('0x1f')]=_0xeea123;if(_0x4839c0['query'][_0x88df('0x42')]){_0x59b648[_0x88df('0x43')]=[{'all':!![]}];}return db[_0x88df('0x50')][_0x88df('0x44')](_0x59b648);})[_0x88df('0x25')](function(_0x46c033){_0x43f03c[_0x88df('0x45')]=_0x46c033;return _0x43f03c;});}})['then'](respondWithFilteredResult(_0x1bf86c,_0x59b648))[_0x88df('0x49')](handleError(_0x1bf86c,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 355affd..0dc71d7 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 _0x2d72=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','JscriptySessionReport','report_jscripty_sessions'];(function(_0x7f8db5,_0x5c6518){var _0x2146ec=function(_0x1b2521){while(--_0x1b2521){_0x7f8db5['push'](_0x7f8db5['shift']());}};_0x2146ec(++_0x5c6518);}(_0x2d72,0xa8));var _0x22d7=function(_0x5e48fd,_0xb0671f){_0x5e48fd=_0x5e48fd-0x0;var _0x27d122=_0x2d72[_0x5e48fd];return _0x27d122;};'use strict';var _=require(_0x22d7('0x0'));var util=require(_0x22d7('0x1'));var logger=require(_0x22d7('0x2'))(_0x22d7('0x3'));var moment=require(_0x22d7('0x4'));var BPromise=require(_0x22d7('0x5'));var rp=require(_0x22d7('0x6'));var fs=require('fs');var path=require(_0x22d7('0x7'));var rimraf=require(_0x22d7('0x8'));var config=require(_0x22d7('0x9'));var attributes=require(_0x22d7('0xa'));module[_0x22d7('0xb')]=function(_0x208b5b,_0x100426){return _0x208b5b['define'](_0x22d7('0xc'),attributes,{'tableName':_0x22d7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5496=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','define','report_jscripty_sessions','lodash'];(function(_0x1a219d,_0x4b232c){var _0x56cf0d=function(_0x5edc25){while(--_0x5edc25){_0x1a219d['push'](_0x1a219d['shift']());}};_0x56cf0d(++_0x4b232c);}(_0x5496,0x175));var _0x6549=function(_0x2d1f16,_0x263565){_0x2d1f16=_0x2d1f16-0x0;var _0x2992c8=_0x5496[_0x2d1f16];return _0x2992c8;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var logger=require(_0x6549('0x2'))(_0x6549('0x3'));var moment=require(_0x6549('0x4'));var BPromise=require('bluebird');var rp=require(_0x6549('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var attributes=require(_0x6549('0x8'));module['exports']=function(_0x5a4658,_0x43cb17){return _0x5a4658[_0x6549('0x9')]('JscriptySessionReport',attributes,{'tableName':_0x6549('0xa'),'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 b6ce7cd..6da27a9 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 _0xe5af=['jayson/promise','client','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x208e52,_0x295c8c){var _0x21f03b=function(_0x5da2db){while(--_0x5da2db){_0x208e52['push'](_0x208e52['shift']());}};_0x21f03b(++_0x295c8c);}(_0xe5af,0x9c));var _0xfe5a=function(_0xfdfc3,_0x50066e){_0xfdfc3=_0xfdfc3-0x0;var _0x375878=_0xe5af[_0xfdfc3];return _0x375878;};'use strict';var _=require('lodash');var util=require(_0xfe5a('0x0'));var moment=require(_0xfe5a('0x1'));var BPromise=require('bluebird');var rs=require(_0xfe5a('0x2'));var fs=require('fs');var Redis=require(_0xfe5a('0x3'));var db=require(_0xfe5a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xfe5a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfe5a('0x6'));var client=jayson[_0xfe5a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5eea2e,_0x356c69,_0x106492){return new BPromise(function(_0xfb4357,_0x3e683c){return client['request'](_0x5eea2e,_0x106492)[_0xfe5a('0x8')](function(_0x5a48ff){logger['info'](_0xfe5a('0x9'),_0x356c69,_0xfe5a('0xa'));logger['debug'](_0xfe5a('0xb'),_0x356c69,_0xfe5a('0xa'),JSON[_0xfe5a('0xc')](_0x5a48ff));if(_0x5a48ff[_0xfe5a('0xd')]){if(_0x5a48ff[_0xfe5a('0xd')]['code']===0x1f4){logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);return _0x3e683c(_0x5a48ff[_0xfe5a('0xd')]['message']);}logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);return _0xfb4357(_0x5a48ff[_0xfe5a('0xd')][_0xfe5a('0xe')]);}else{logger[_0xfe5a('0xf')](_0xfe5a('0x9'),_0x356c69,_0xfe5a('0xa'));_0xfb4357(_0x5a48ff[_0xfe5a('0x10')][_0xfe5a('0xe')]);}})[_0xfe5a('0x11')](function(_0x22afa7){logger[_0xfe5a('0xd')](_0xfe5a('0x9'),_0x356c69,_0x22afa7);_0x3e683c(_0x22afa7);});});} \ No newline at end of file +var _0x4c60=['client','http','request','then','debug','request\x20sent','stringify','error','code','JscriptySessionReport,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','ioredis','../../config/environment','jayson/promise'];(function(_0x4b1173,_0x3bd17e){var _0x535050=function(_0x28a7b5){while(--_0x28a7b5){_0x4b1173['push'](_0x4b1173['shift']());}};_0x535050(++_0x3bd17e);}(_0x4c60,0xc1));var _0x04c6=function(_0x5c832a,_0x1495d9){_0x5c832a=_0x5c832a-0x0;var _0x1ffacc=_0x4c60[_0x5c832a];return _0x1ffacc;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var moment=require(_0x04c6('0x2'));var BPromise=require(_0x04c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04c6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x04c6('0x5'));var jayson=require(_0x04c6('0x6'));var client=jayson[_0x04c6('0x7')][_0x04c6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b9041,_0x39be2d,_0x8f9b13){return new BPromise(function(_0x530a48,_0x2a4b51){return client[_0x04c6('0x9')](_0x2b9041,_0x8f9b13)[_0x04c6('0xa')](function(_0x30b901){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x39be2d,'request\x20sent');logger[_0x04c6('0xb')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x39be2d,_0x04c6('0xc'),JSON[_0x04c6('0xd')](_0x30b901));if(_0x30b901['error']){if(_0x30b901[_0x04c6('0xe')][_0x04c6('0xf')]===0x1f4){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x30b901['error'][_0x04c6('0x11')]);return _0x2a4b51(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}logger['error'](_0x04c6('0x10'),_0x39be2d,_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);return _0x530a48(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}else{logger[_0x04c6('0x12')](_0x04c6('0x10'),_0x39be2d,_0x04c6('0xc'));_0x530a48(_0x30b901['result'][_0x04c6('0x11')]);}})[_0x04c6('0x13')](function(_0x382e58){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x382e58);_0x2a4b51(_0x382e58);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 401b5b1..3233bdd 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 _0x5f16=['get','/download_log_file','downloadLogFile','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./license.controller','index','put','/:id','isAuthenticated','update'];(function(_0x21b960,_0x52676a){var _0x4f0c18=function(_0x10813b){while(--_0x10813b){_0x21b960['push'](_0x21b960['shift']());}};_0x4f0c18(++_0x52676a);}(_0x5f16,0x16c));var _0x65f1=function(_0x4e4be7,_0x49619e){_0x4e4be7=_0x4e4be7-0x0;var _0x1fac55=_0x5f16[_0x4e4be7];return _0x1fac55;};'use strict';var multer=require('multer');var util=require(_0x65f1('0x0'));var path=require(_0x65f1('0x1'));var timeout=require(_0x65f1('0x2'));var express=require(_0x65f1('0x3'));var router=express[_0x65f1('0x4')]();var fs_extra=require(_0x65f1('0x5'));var auth=require(_0x65f1('0x6'));var interaction=require(_0x65f1('0x7'));var config=require('../../config/environment');var controller=require(_0x65f1('0x8'));router['get']('/',controller[_0x65f1('0x9')]);router[_0x65f1('0xa')](_0x65f1('0xb'),auth[_0x65f1('0xc')](),controller[_0x65f1('0xd')]);router[_0x65f1('0xe')](_0x65f1('0xf'),auth[_0x65f1('0xc')](),controller[_0x65f1('0x10')]);module[_0x65f1('0x11')]=router; \ No newline at end of file +var _0x3a22=['util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','update','/download_log_file','isAuthenticated','exports','multer'];(function(_0x23ec06,_0x561142){var _0x2831d4=function(_0x3802bc){while(--_0x3802bc){_0x23ec06['push'](_0x23ec06['shift']());}};_0x2831d4(++_0x561142);}(_0x3a22,0x11c));var _0x23a2=function(_0xdb61b6,_0x500152){_0xdb61b6=_0xdb61b6-0x0;var _0x4a9c61=_0x3a22[_0xdb61b6];return _0x4a9c61;};'use strict';var multer=require(_0x23a2('0x0'));var util=require(_0x23a2('0x1'));var path=require(_0x23a2('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x23a2('0x3')]();var fs_extra=require(_0x23a2('0x4'));var auth=require(_0x23a2('0x5'));var interaction=require(_0x23a2('0x6'));var config=require(_0x23a2('0x7'));var controller=require('./license.controller');router[_0x23a2('0x8')]('/',controller[_0x23a2('0x9')]);router['put'](_0x23a2('0xa'),auth['isAuthenticated'](),controller[_0x23a2('0xb')]);router[_0x23a2('0x8')](_0x23a2('0xc'),auth[_0x23a2('0xd')](),controller['downloadLogFile']);module[_0x23a2('0xe')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 0820a26..a271999 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 _0x862e=['STRING','INTEGER','exports','TEXT'];(function(_0xda7c64,_0x6e05d8){var _0x5cb2c8=function(_0x5c9166){while(--_0x5c9166){_0xda7c64['push'](_0xda7c64['shift']());}};_0x5cb2c8(++_0x6e05d8);}(_0x862e,0x1ea));var _0xe862=function(_0x3068c8,_0x1f5504){_0x3068c8=_0x3068c8-0x0;var _0x40c6e4=_0x862e[_0x3068c8];return _0x40c6e4;};'use strict';var Sequelize=require('sequelize');module[_0xe862('0x0')]={'license':{'type':Sequelize[_0xe862('0x1')]},'data1':{'type':Sequelize[_0xe862('0x2')]},'data2':{'type':Sequelize[_0xe862('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xe862('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x1151=['exports','TEXT','STRING','sequelize'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x1151,0xab));var _0x1115=function(_0x404957,_0x5192a4){_0x404957=_0x404957-0x0;var _0x4e0365=_0x1151[_0x404957];return _0x4e0365;};'use strict';var Sequelize=require(_0x1115('0x0'));module[_0x1115('0x1')]={'license':{'type':Sequelize[_0x1115('0x2')]},'data1':{'type':Sequelize[_0x1115('0x3')]},'data2':{'type':Sequelize[_0x1115('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 552eb4a..add2c7e 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 _0x618a=['update','destroy','then','sendStatus','error','stack','name','index','model','keys','rawAttributes','query','intersection','attributes','fields','length','merge','options','catch','body','License','find','params','get','checkLicense','key','demo','downloadLogFile','join','/var','log','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0x618a,0x19c));var _0xa618=function(_0x4a4fb8,_0x1c8af){_0x4a4fb8=_0x4a4fb8-0x0;var _0x1d27c8=_0x618a[_0x4a4fb8];return _0x1d27c8;};'use strict';var emlformat=require(_0xa618('0x0'));var rimraf=require(_0xa618('0x1'));var zipdir=require(_0xa618('0x2'));var jsonpatch=require(_0xa618('0x3'));var rp=require(_0xa618('0x4'));var moment=require('moment');var BPromise=require(_0xa618('0x5'));var Mustache=require(_0xa618('0x6'));var util=require(_0xa618('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xa618('0x8'));var ejs=require(_0xa618('0x9'));var fs=require('fs');var fs_extra=require(_0xa618('0xa'));var _=require(_0xa618('0xb'));var squel=require(_0xa618('0xc'));var crypto=require(_0xa618('0xd'));var jsforce=require(_0xa618('0xe'));var deskjs=require(_0xa618('0xf'));var toCsv=require('to-csv');var querystring=require(_0xa618('0x10'));var Papa=require(_0xa618('0x11'));var Redis=require(_0xa618('0x12'));var authService=require(_0xa618('0x13'));var qs=require(_0xa618('0x14'));var as=require(_0xa618('0x15'));var hardwareService=require(_0xa618('0x16'));var logger=require(_0xa618('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xa618('0x18'));var licenseUtil=require(_0xa618('0x19'));var db=require(_0xa618('0x1a'))['db'];function respondWithStatusCode(_0x4d7b2e,_0x1da57b){_0x1da57b=_0x1da57b||0xcc;return function(_0xaf7d03){if(_0xaf7d03){return _0x4d7b2e['sendStatus'](_0x1da57b);}return _0x4d7b2e[_0xa618('0x1b')](_0x1da57b)[_0xa618('0x1c')]();};}function respondWithResult(_0x52cf1d,_0x3e73a0){_0x3e73a0=_0x3e73a0||0xc8;return function(_0x336de9){if(_0x336de9){return _0x52cf1d[_0xa618('0x1b')](_0x3e73a0)[_0xa618('0x1d')](_0x336de9);}};}function respondWithFilteredResult(_0x3cebb1,_0x2bd04d){return function(_0x5cad85){if(_0x5cad85){var _0x5af13f=typeof _0x2bd04d[_0xa618('0x1e')]===_0xa618('0x1f')&&typeof _0x2bd04d['limit']===_0xa618('0x1f');var _0x3878c6=_0x5cad85[_0xa618('0x20')];var _0x5cc451=_0x5af13f?0x0:_0x2bd04d['offset'];var _0x542fc0=_0x5af13f?_0x5cad85['count']:_0x2bd04d[_0xa618('0x1e')]+_0x2bd04d[_0xa618('0x21')];var _0x11cd95;if(_0x542fc0>=_0x3878c6){_0x542fc0=_0x3878c6;_0x11cd95=0xc8;}else{_0x11cd95=0xce;}_0x3cebb1['status'](_0x11cd95);return _0x3cebb1[_0xa618('0x22')](_0xa618('0x23'),_0x5cc451+'-'+_0x542fc0+'/'+_0x3878c6)[_0xa618('0x1d')](_0x5cad85);}return null;};}function patchUpdates(_0x839bd2){return function(_0x1d30cf){try{jsonpatch[_0xa618('0x24')](_0x1d30cf,_0x839bd2,!![]);}catch(_0x2c4674){return BPromise['reject'](_0x2c4674);}return _0x1d30cf[_0xa618('0x25')]();};}function saveUpdates(_0x443774,_0x16b070){return function(_0x20dcbe){if(_0x20dcbe){return _0x20dcbe[_0xa618('0x26')](_0x443774)['then'](function(_0x25471b){return _0x25471b;});}return null;};}function removeEntity(_0x5aa45d,_0x151acb){return function(_0x42c07e){if(_0x42c07e){return _0x42c07e[_0xa618('0x27')]()[_0xa618('0x28')](function(){_0x5aa45d[_0xa618('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d8ba7,_0x33786a){return function(_0x5478d3){if(!_0x5478d3){_0x4d8ba7[_0xa618('0x29')](0x194);}return _0x5478d3;};}function handleError(_0x3a643f,_0x4dbab0){_0x4dbab0=_0x4dbab0||0x1f4;return function(_0x3e4090){logger[_0xa618('0x2a')](_0x3e4090[_0xa618('0x2b')]);if(_0x3e4090[_0xa618('0x2c')]){delete _0x3e4090[_0xa618('0x2c')];}_0x3a643f[_0xa618('0x1b')](_0x4dbab0)['send'](_0x3e4090);};}var utilLicense=require(_0xa618('0x19'));exports[_0xa618('0x2d')]=function(_0x257741,_0xbb46aa){var _0x326d1e={'raw':!![],'where':{'id':0x1}},_0x4e761c={};_0x4e761c[_0xa618('0x2e')]=_[_0xa618('0x2f')](db['License'][_0xa618('0x30')]);_0x4e761c[_0xa618('0x31')]=_['keys'](_0x257741['query']);_0x4e761c['filters']=_[_0xa618('0x32')](_0x4e761c['model'],_0x4e761c[_0xa618('0x31')]);_0x326d1e[_0xa618('0x33')]=_[_0xa618('0x32')](_0x4e761c[_0xa618('0x2e')],qs[_0xa618('0x34')](_0x257741[_0xa618('0x31')][_0xa618('0x34')]));_0x326d1e[_0xa618('0x33')]=_0x326d1e[_0xa618('0x33')][_0xa618('0x35')]?_0x326d1e['attributes']:_0x4e761c[_0xa618('0x2e')];_0x326d1e=_[_0xa618('0x36')]({},_0x326d1e,_0x257741[_0xa618('0x37')]);return utilLicense['getLicense'](_0x326d1e)[_0xa618('0x28')](respondWithResult(_0xbb46aa,null))[_0xa618('0x38')](handleError(_0xbb46aa,null));};exports[_0xa618('0x26')]=function(_0x479ed8,_0x20c804){if(_0x479ed8[_0xa618('0x39')]['id']){delete _0x479ed8[_0xa618('0x39')]['id'];}return db[_0xa618('0x3a')][_0xa618('0x3b')]({'where':{'id':_0x479ed8[_0xa618('0x3c')]['id']}})[_0xa618('0x28')](handleEntityNotFound(_0x20c804,null))[_0xa618('0x28')](function(_0x2b1e84){var _0x597306=_0x2b1e84[_0xa618('0x3d')]({'plain':!![]});return utilLicense[_0xa618('0x3e')](_0x597306,_0x479ed8['body'][_0xa618('0x3f')]);})[_0xa618('0x28')](function(_0x15eb37){if(!_0x15eb37[_0xa618('0x40')]){return saveUpdates(_0x479ed8[_0xa618('0x39')],null);}return _0x15eb37;})[_0xa618('0x28')](respondWithResult(_0x20c804,null))[_0xa618('0x38')](handleError(_0x20c804,null));};exports[_0xa618('0x41')]=function(_0x3aad2c,_0x4f3464){var _0x152744='license-info.log';var _0x1c7109=path[_0xa618('0x42')](_0xa618('0x43'),_0xa618('0x44'),'xcally',_0x152744);_0x4f3464[_0xa618('0x45')](_0xa618('0x46'),_0xa618('0x47')+_0x152744);_0x4f3464[_0xa618('0x22')](_0xa618('0x48'),_0xa618('0x49'));_0x4f3464[_0xa618('0x4a')](_0x1c7109);}; \ No newline at end of file +var _0x6b98=['Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','model','keys','License','rawAttributes','query','filters','attributes','intersection','fields','length','merge','getLicense','catch','find','params','get','checkLicense','body','demo','downloadLogFile','join','/var','xcally','setHeader','Content-disposition','attachment;\x20filename=','text/plain','zip-dir','fast-json-patch','request-promise','moment','bluebird','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0xf8f965,_0x3b29b1){var _0x1520fc=function(_0xef795f){while(--_0xef795f){_0xf8f965['push'](_0xf8f965['shift']());}};_0x1520fc(++_0x3b29b1);}(_0x6b98,0x13a));var _0x86b9=function(_0x2354f1,_0xabfc06){_0x2354f1=_0x2354f1-0x0;var _0x2274ca=_0x6b98[_0x2354f1];return _0x2274ca;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x86b9('0x0'));var jsonpatch=require(_0x86b9('0x1'));var rp=require(_0x86b9('0x2'));var moment=require(_0x86b9('0x3'));var BPromise=require(_0x86b9('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x86b9('0x5'));var fs=require('fs');var fs_extra=require(_0x86b9('0x6'));var _=require(_0x86b9('0x7'));var squel=require(_0x86b9('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86b9('0x9'));var toCsv=require(_0x86b9('0xa'));var querystring=require(_0x86b9('0xb'));var Papa=require(_0x86b9('0xc'));var Redis=require(_0x86b9('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x86b9('0xe'));var as=require(_0x86b9('0xf'));var hardwareService=require(_0x86b9('0x10'));var logger=require(_0x86b9('0x11'))(_0x86b9('0x12'));var utils=require(_0x86b9('0x13'));var config=require(_0x86b9('0x14'));var licenseUtil=require(_0x86b9('0x15'));var db=require(_0x86b9('0x16'))['db'];function respondWithStatusCode(_0x45da5d,_0xb4c47a){_0xb4c47a=_0xb4c47a||0xcc;return function(_0x432123){if(_0x432123){return _0x45da5d[_0x86b9('0x17')](_0xb4c47a);}return _0x45da5d[_0x86b9('0x18')](_0xb4c47a)[_0x86b9('0x19')]();};}function respondWithResult(_0x4f823e,_0x4170d8){_0x4170d8=_0x4170d8||0xc8;return function(_0xb9daa3){if(_0xb9daa3){return _0x4f823e[_0x86b9('0x18')](_0x4170d8)[_0x86b9('0x1a')](_0xb9daa3);}};}function respondWithFilteredResult(_0x5957a3,_0xdd398d){return function(_0xbfe28){if(_0xbfe28){var _0x26c04c=typeof _0xdd398d[_0x86b9('0x1b')]===_0x86b9('0x1c')&&typeof _0xdd398d[_0x86b9('0x1d')]===_0x86b9('0x1c');var _0x609c89=_0xbfe28[_0x86b9('0x1e')];var _0x542b9a=_0x26c04c?0x0:_0xdd398d[_0x86b9('0x1b')];var _0x257b44=_0x26c04c?_0xbfe28[_0x86b9('0x1e')]:_0xdd398d[_0x86b9('0x1b')]+_0xdd398d[_0x86b9('0x1d')];var _0x2ca9ac;if(_0x257b44>=_0x609c89){_0x257b44=_0x609c89;_0x2ca9ac=0xc8;}else{_0x2ca9ac=0xce;}_0x5957a3[_0x86b9('0x18')](_0x2ca9ac);return _0x5957a3['set'](_0x86b9('0x1f'),_0x542b9a+'-'+_0x257b44+'/'+_0x609c89)['json'](_0xbfe28);}return null;};}function patchUpdates(_0x13f9e3){return function(_0x42b904){try{jsonpatch[_0x86b9('0x20')](_0x42b904,_0x13f9e3,!![]);}catch(_0x55ed4a){return BPromise[_0x86b9('0x21')](_0x55ed4a);}return _0x42b904[_0x86b9('0x22')]();};}function saveUpdates(_0x532f01,_0x18cc1e){return function(_0x2e180e){if(_0x2e180e){return _0x2e180e[_0x86b9('0x23')](_0x532f01)[_0x86b9('0x24')](function(_0x4133d2){return _0x4133d2;});}return null;};}function removeEntity(_0x1bf4de,_0x519e90){return function(_0x460f54){if(_0x460f54){return _0x460f54[_0x86b9('0x25')]()[_0x86b9('0x24')](function(){_0x1bf4de['status'](0xcc)[_0x86b9('0x19')]();});}};}function handleEntityNotFound(_0x2e3023,_0x273d38){return function(_0x5168cb){if(!_0x5168cb){_0x2e3023[_0x86b9('0x17')](0x194);}return _0x5168cb;};}function handleError(_0x3ae5a2,_0x528fdf){_0x528fdf=_0x528fdf||0x1f4;return function(_0x4f925e){logger[_0x86b9('0x26')](_0x4f925e[_0x86b9('0x27')]);if(_0x4f925e[_0x86b9('0x28')]){delete _0x4f925e[_0x86b9('0x28')];}_0x3ae5a2['status'](_0x528fdf)[_0x86b9('0x29')](_0x4f925e);};}var utilLicense=require(_0x86b9('0x15'));exports['index']=function(_0x3343d9,_0x444d23){var _0x34a6a7={'raw':!![],'where':{'id':0x1}},_0x336673={};_0x336673[_0x86b9('0x2a')]=_[_0x86b9('0x2b')](db[_0x86b9('0x2c')][_0x86b9('0x2d')]);_0x336673[_0x86b9('0x2e')]=_['keys'](_0x3343d9[_0x86b9('0x2e')]);_0x336673[_0x86b9('0x2f')]=_['intersection'](_0x336673[_0x86b9('0x2a')],_0x336673['query']);_0x34a6a7[_0x86b9('0x30')]=_[_0x86b9('0x31')](_0x336673[_0x86b9('0x2a')],qs[_0x86b9('0x32')](_0x3343d9[_0x86b9('0x2e')][_0x86b9('0x32')]));_0x34a6a7['attributes']=_0x34a6a7[_0x86b9('0x30')][_0x86b9('0x33')]?_0x34a6a7[_0x86b9('0x30')]:_0x336673[_0x86b9('0x2a')];_0x34a6a7=_[_0x86b9('0x34')]({},_0x34a6a7,_0x3343d9['options']);return utilLicense[_0x86b9('0x35')](_0x34a6a7)[_0x86b9('0x24')](respondWithResult(_0x444d23,null))[_0x86b9('0x36')](handleError(_0x444d23,null));};exports[_0x86b9('0x23')]=function(_0x155530,_0x52c066){if(_0x155530['body']['id']){delete _0x155530['body']['id'];}return db['License'][_0x86b9('0x37')]({'where':{'id':_0x155530[_0x86b9('0x38')]['id']}})[_0x86b9('0x24')](handleEntityNotFound(_0x52c066,null))[_0x86b9('0x24')](function(_0x372b5b){var _0x481e28=_0x372b5b[_0x86b9('0x39')]({'plain':!![]});return utilLicense[_0x86b9('0x3a')](_0x481e28,_0x155530[_0x86b9('0x3b')]['key']);})['then'](function(_0xb47e53){if(!_0xb47e53[_0x86b9('0x3c')]){return saveUpdates(_0x155530['body'],null);}return _0xb47e53;})[_0x86b9('0x24')](respondWithResult(_0x52c066,null))['catch'](handleError(_0x52c066,null));};exports[_0x86b9('0x3d')]=function(_0x33d94e,_0x46c756){var _0xae2a95='license-info.log';var _0x16b364=path[_0x86b9('0x3e')](_0x86b9('0x3f'),'log',_0x86b9('0x40'),_0xae2a95);_0x46c756[_0x86b9('0x41')](_0x86b9('0x42'),_0x86b9('0x43')+_0xae2a95);_0x46c756['set']('Content-Type',_0x86b9('0x44'));_0x46c756['download'](_0x16b364);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 3705a80..b44a535 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 _0x59f6=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./license.attributes','License','license'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x59f6,0x1ef));var _0x659f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x59f6[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x659f('0x0'));var util=require(_0x659f('0x1'));var logger=require(_0x659f('0x2'))(_0x659f('0x3'));var moment=require(_0x659f('0x4'));var BPromise=require(_0x659f('0x5'));var rp=require(_0x659f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x659f('0x7'));var attributes=require(_0x659f('0x8'));module['exports']=function(_0xf801f5,_0x318625){return _0xf801f5['define'](_0x659f('0x9'),attributes,{'tableName':_0x659f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9bed=['path','./license.attributes','exports','define','License','license','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2bdf3c,_0x574faf){var _0x2b53a4=function(_0x14625c){while(--_0x14625c){_0x2bdf3c['push'](_0x2bdf3c['shift']());}};_0x2b53a4(++_0x574faf);}(_0x9bed,0x1aa));var _0xd9be=function(_0x40ad93,_0x5a9dd3){_0x40ad93=_0x40ad93-0x0;var _0x558d23=_0x9bed[_0x40ad93];return _0x558d23;};'use strict';var _=require('lodash');var util=require(_0xd9be('0x0'));var logger=require(_0xd9be('0x1'))(_0xd9be('0x2'));var moment=require(_0xd9be('0x3'));var BPromise=require(_0xd9be('0x4'));var rp=require(_0xd9be('0x5'));var fs=require('fs');var path=require(_0xd9be('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd9be('0x7'));module[_0xd9be('0x8')]=function(_0x5063a1,_0x518c20){return _0x5063a1[_0xd9be('0x9')](_0xd9be('0xa'),attributes,{'tableName':_0xd9be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index bc4ca20..a189bb8 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 _0x210e=['error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','client','http','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x9b7a64,_0x38d4a8){var _0x33fd98=function(_0x15c82b){while(--_0x15c82b){_0x9b7a64['push'](_0x9b7a64['shift']());}};_0x33fd98(++_0x38d4a8);}(_0x210e,0x17f));var _0xe210=function(_0x1c2d01,_0x55590b){_0x1c2d01=_0x1c2d01-0x0;var _0x2fe07e=_0x210e[_0x1c2d01];return _0x2fe07e;};'use strict';var _=require(_0xe210('0x0'));var util=require(_0xe210('0x1'));var moment=require('moment');var BPromise=require(_0xe210('0x2'));var rs=require(_0xe210('0x3'));var fs=require('fs');var Redis=require(_0xe210('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe210('0x5'))('rpc');var config=require(_0xe210('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe210('0x7')][_0xe210('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10adc8,_0x348fdd,_0x8fcde5){return new BPromise(function(_0x34bd6b,_0x30cbf8){return client['request'](_0x10adc8,_0x8fcde5)[_0xe210('0x9')](function(_0x56a138){logger[_0xe210('0xa')](_0xe210('0xb'),_0x348fdd,_0xe210('0xc'));logger[_0xe210('0xd')](_0xe210('0xe'),_0x348fdd,_0xe210('0xc'),JSON[_0xe210('0xf')](_0x56a138));if(_0x56a138['error']){if(_0x56a138[_0xe210('0x10')][_0xe210('0x11')]===0x1f4){logger[_0xe210('0x10')]('License,\x20%s,\x20%s',_0x348fdd,_0x56a138[_0xe210('0x10')][_0xe210('0x12')]);return _0x30cbf8(_0x56a138['error'][_0xe210('0x12')]);}logger[_0xe210('0x10')](_0xe210('0xb'),_0x348fdd,_0x56a138['error'][_0xe210('0x12')]);return _0x34bd6b(_0x56a138[_0xe210('0x10')][_0xe210('0x12')]);}else{logger[_0xe210('0xa')](_0xe210('0xb'),_0x348fdd,_0xe210('0xc'));_0x34bd6b(_0x56a138[_0xe210('0x13')][_0xe210('0x12')]);}})[_0xe210('0x14')](function(_0xb08899){logger[_0xe210('0x10')]('License,\x20%s,\x20%s',_0x348fdd,_0xb08899);_0x30cbf8(_0xb08899);});});} \ No newline at end of file +var _0x0eef=['message','catch','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','request','then','info','License,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x339170,_0x6feb26){var _0x3543b7=function(_0x28053d){while(--_0x28053d){_0x339170['push'](_0x339170['shift']());}};_0x3543b7(++_0x6feb26);}(_0x0eef,0x92));var _0xf0ee=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0eef[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf0ee('0x0'));var BPromise=require(_0xf0ee('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf0ee('0x2'));var db=require(_0xf0ee('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0ee('0x4'))(_0xf0ee('0x5'));var config=require(_0xf0ee('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1b3387,_0x1e08f2,_0x386999){return new BPromise(function(_0x48f25e,_0x3c2538){return client[_0xf0ee('0x7')](_0x1b3387,_0x386999)[_0xf0ee('0x8')](function(_0x45d175){logger[_0xf0ee('0x9')](_0xf0ee('0xa'),_0x1e08f2,_0xf0ee('0xb'));logger['debug']('License,\x20%s,\x20%s,\x20%s',_0x1e08f2,_0xf0ee('0xb'),JSON[_0xf0ee('0xc')](_0x45d175));if(_0x45d175['error']){if(_0x45d175[_0xf0ee('0xd')]['code']===0x1f4){logger[_0xf0ee('0xd')]('License,\x20%s,\x20%s',_0x1e08f2,_0x45d175[_0xf0ee('0xd')]['message']);return _0x3c2538(_0x45d175[_0xf0ee('0xd')][_0xf0ee('0xe')]);}logger[_0xf0ee('0xd')]('License,\x20%s,\x20%s',_0x1e08f2,_0x45d175[_0xf0ee('0xd')]['message']);return _0x48f25e(_0x45d175[_0xf0ee('0xd')][_0xf0ee('0xe')]);}else{logger['info'](_0xf0ee('0xa'),_0x1e08f2,_0xf0ee('0xb'));_0x48f25e(_0x45d175['result'][_0xf0ee('0xe')]);}})[_0xf0ee('0xf')](function(_0x4bef48){logger['error'](_0xf0ee('0xa'),_0x1e08f2,_0x4bef48);_0x3c2538(_0x4bef48);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index e6a2465..0289802 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 _0xdcd3=['describe','/:id','isAuthenticated','show','/:id/dispositions','getDispositions','/:id/canned_answers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','addAnswer','create','/:id/in_servers','addSmtp','send','removeDispositions','removeAnswers','delete','removeImap','removeSmtp','destroy','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./mailAccount.controller','get','/describe'];(function(_0x522503,_0x5dc0fa){var _0x16cfd7=function(_0x21c3a3){while(--_0x21c3a3){_0x522503['push'](_0x522503['shift']());}};_0x16cfd7(++_0x5dc0fa);}(_0xdcd3,0x182));var _0x3dcd=function(_0x205154,_0x4bcf68){_0x205154=_0x205154-0x0;var _0x53bc41=_0xdcd3[_0x205154];return _0x53bc41;};'use strict';var multer=require(_0x3dcd('0x0'));var util=require('util');var path=require(_0x3dcd('0x1'));var timeout=require(_0x3dcd('0x2'));var express=require(_0x3dcd('0x3'));var router=express[_0x3dcd('0x4')]();var fs_extra=require(_0x3dcd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3dcd('0x6'));var config=require('../../config/environment');var controller=require(_0x3dcd('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x3dcd('0x8')](_0x3dcd('0x9'),auth['isAuthenticated'](),controller[_0x3dcd('0xa')]);router['get'](_0x3dcd('0xb'),auth[_0x3dcd('0xc')](),controller[_0x3dcd('0xd')]);router[_0x3dcd('0x8')](_0x3dcd('0xe'),auth['isAuthenticated'](),controller[_0x3dcd('0xf')]);router[_0x3dcd('0x8')](_0x3dcd('0x10'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x3dcd('0x8')]('/:id/in_servers',auth[_0x3dcd('0xc')](),controller[_0x3dcd('0x11')]);router[_0x3dcd('0x8')](_0x3dcd('0x12'),auth[_0x3dcd('0xc')](),controller[_0x3dcd('0x13')]);router['get'](_0x3dcd('0x14'),auth[_0x3dcd('0xc')](),controller[_0x3dcd('0x15')]);router[_0x3dcd('0x8')](_0x3dcd('0x16'),auth[_0x3dcd('0xc')](),controller[_0x3dcd('0x17')]);router[_0x3dcd('0x8')](_0x3dcd('0x18'),auth[_0x3dcd('0xc')](),controller[_0x3dcd('0x19')]);router['get'](_0x3dcd('0x1a'),auth[_0x3dcd('0xc')](),controller[_0x3dcd('0x1b')]);router[_0x3dcd('0x8')](_0x3dcd('0x1c'),auth[_0x3dcd('0xc')](),controller[_0x3dcd('0x1d')]);router[_0x3dcd('0x1e')](_0x3dcd('0xe'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x3dcd('0x1e')](_0x3dcd('0x10'),auth[_0x3dcd('0xc')](),controller[_0x3dcd('0x1f')]);router[_0x3dcd('0x1e')]('/',auth[_0x3dcd('0xc')](),controller[_0x3dcd('0x20')]);router['post'](_0x3dcd('0x21'),auth[_0x3dcd('0xc')](),controller['addImap']);router['post'](_0x3dcd('0x12'),auth[_0x3dcd('0xc')](),controller[_0x3dcd('0x22')]);router['post'](_0x3dcd('0x14'),auth[_0x3dcd('0xc')](),controller['addInteraction']);router[_0x3dcd('0x1e')](_0x3dcd('0x16'),auth[_0x3dcd('0xc')](),controller['addApplications']);router[_0x3dcd('0x1e')]('/:id/send',auth['isAuthenticated'](),controller[_0x3dcd('0x23')]);router[_0x3dcd('0x1e')](_0x3dcd('0x1c'),auth[_0x3dcd('0xc')](),controller['addAgents']);router['put'](_0x3dcd('0xb'),auth[_0x3dcd('0xc')](),controller['update']);router['delete']('/:id/dispositions',auth[_0x3dcd('0xc')](),controller[_0x3dcd('0x24')]);router['delete'](_0x3dcd('0x10'),auth[_0x3dcd('0xc')](),controller[_0x3dcd('0x25')]);router[_0x3dcd('0x26')](_0x3dcd('0x21'),auth[_0x3dcd('0xc')](),controller[_0x3dcd('0x27')]);router['delete'](_0x3dcd('0x12'),auth[_0x3dcd('0xc')](),controller[_0x3dcd('0x28')]);router[_0x3dcd('0x26')](_0x3dcd('0xb'),auth[_0x3dcd('0xc')](),controller[_0x3dcd('0x29')]);router[_0x3dcd('0x26')](_0x3dcd('0x1c'),auth['isAuthenticated'](),controller[_0x3dcd('0x2a')]);module[_0x3dcd('0x2b')]=router; \ No newline at end of file +var _0x283a=['verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','addImap','addSmtp','/:id/send','send','addAgents','put','/:id','update','delete','/:id/canned_answers','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','/:id/dispositions','getDispositions','getAnswers','/:id/in_servers','getImap','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify'];(function(_0x1ac6e5,_0x40f47f){var _0x5877dc=function(_0x99caea){while(--_0x99caea){_0x1ac6e5['push'](_0x1ac6e5['shift']());}};_0x5877dc(++_0x40f47f);}(_0x283a,0x11e));var _0xa283=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0x283a[_0x256b72];return _0x2183e3;};'use strict';var multer=require(_0xa283('0x0'));var util=require(_0xa283('0x1'));var path=require(_0xa283('0x2'));var timeout=require(_0xa283('0x3'));var express=require(_0xa283('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa283('0x5'));var config=require(_0xa283('0x6'));var controller=require(_0xa283('0x7'));router[_0xa283('0x8')]('/',auth[_0xa283('0x9')](),controller['index']);router[_0xa283('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xa283('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xa283('0x8')](_0xa283('0xa'),auth[_0xa283('0x9')](),controller[_0xa283('0xb')]);router[_0xa283('0x8')]('/:id/canned_answers',auth[_0xa283('0x9')](),controller[_0xa283('0xc')]);router[_0xa283('0x8')](_0xa283('0xd'),auth[_0xa283('0x9')](),controller[_0xa283('0xe')]);router[_0xa283('0x8')]('/:id/out_servers',auth[_0xa283('0x9')](),controller['getSmtp']);router[_0xa283('0x8')](_0xa283('0xf'),auth['isAuthenticated'](),controller[_0xa283('0x10')]);router[_0xa283('0x8')](_0xa283('0x11'),auth[_0xa283('0x9')](),controller[_0xa283('0x12')]);router['get'](_0xa283('0x13'),auth[_0xa283('0x9')](),controller[_0xa283('0x14')]);router[_0xa283('0x8')](_0xa283('0x15'),auth[_0xa283('0x9')](),controller[_0xa283('0x16')]);router[_0xa283('0x8')](_0xa283('0x17'),auth[_0xa283('0x9')](),controller[_0xa283('0x18')]);router[_0xa283('0x19')](_0xa283('0xa'),auth[_0xa283('0x9')](),controller[_0xa283('0x1a')]);router[_0xa283('0x19')]('/:id/canned_answers',auth[_0xa283('0x9')](),controller[_0xa283('0x1b')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa283('0x1c')]);router[_0xa283('0x19')]('/:id/in_servers',auth['isAuthenticated'](),controller[_0xa283('0x1d')]);router['post']('/:id/out_servers',auth[_0xa283('0x9')](),controller[_0xa283('0x1e')]);router[_0xa283('0x19')]('/:id/interactions',auth['isAuthenticated'](),controller['addInteraction']);router['post'](_0xa283('0x11'),auth[_0xa283('0x9')](),controller['addApplications']);router[_0xa283('0x19')](_0xa283('0x1f'),auth['isAuthenticated'](),controller[_0xa283('0x20')]);router[_0xa283('0x19')](_0xa283('0x17'),auth[_0xa283('0x9')](),controller[_0xa283('0x21')]);router[_0xa283('0x22')](_0xa283('0x23'),auth[_0xa283('0x9')](),controller[_0xa283('0x24')]);router[_0xa283('0x25')]('/:id/dispositions',auth[_0xa283('0x9')](),controller['removeDispositions']);router[_0xa283('0x25')](_0xa283('0x26'),auth[_0xa283('0x9')](),controller[_0xa283('0x27')]);router[_0xa283('0x25')]('/:id/in_servers',auth[_0xa283('0x9')](),controller[_0xa283('0x28')]);router['delete']('/:id/out_servers',auth[_0xa283('0x9')](),controller[_0xa283('0x29')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa283('0x2a')]);router[_0xa283('0x25')](_0xa283('0x17'),auth[_0xa283('0x9')](),controller[_0xa283('0x2b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index da9422a..5a74e64 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 _0x988f=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','yahoo','getDataValue','provider','custom','sequelize','exports','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x988f,0x107));var _0xf988=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x988f[_0x4d07cc];return _0x42de3b;};'use strict';var Sequelize=require(_0xf988('0x0'));module[_0xf988('0x1')]={'description':{'type':Sequelize[_0xf988('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0xf988('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xf988('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xf988('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xf988('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xf988('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0xf988('0x5')](0x2)[_0xf988('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xf988('0x7');}},'notificationSound':{'type':Sequelize[_0xf988('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf988('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xf988('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xf988('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xf988('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf988('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf988('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xf988('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf988('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0xf988('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xf988('0x9'),'set':function(_0x218c57){if(!_0x218c57)this[_0xf988('0xa')](_0xf988('0xb'),null);this[_0xf988('0xa')]('mandatoryDisposition',_0x218c57);}},'provider':{'type':Sequelize['ENUM']('gmail','hotmail',_0xf988('0xc'),'outlook365'),'defaultValue':null,'get':function(){var _0x2726a0=this[_0xf988('0xd')](_0xf988('0xe'));return _0x2726a0||_0xf988('0xf');},'set':function(_0x4d6b11){if(_0x4d6b11===_0xf988('0xf')){_0x4d6b11=null;}return this[_0xf988('0xa')](_0xf988('0xe'),_0x4d6b11);}}}; \ No newline at end of file +var _0xf294=['mandatoryDispositionPauseId','mandatoryDisposition','gmail','hotmail','outlook365','getDataValue','custom','sequelize','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue'];(function(_0x294032,_0x4ed889){var _0x5e9616=function(_0x4a5648){while(--_0x4a5648){_0x294032['push'](_0x294032['shift']());}};_0x5e9616(++_0x4ed889);}(_0xf294,0x187));var _0x4f29=function(_0x376db5,_0x2b8874){_0x376db5=_0x376db5-0x0;var _0x304c17=_0xf294[_0x376db5];return _0x304c17;};'use strict';var Sequelize=require(_0x4f29('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x4f29('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x4f29('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x4f29('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x4f29('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x4f29('0x3')]},'markAsUnread':{'type':Sequelize[_0x4f29('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x4f29('0x4')](0x2)[_0x4f29('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x4f29('0x3')],'defaultValue':function(){return _0x4f29('0x6');}},'notificationSound':{'type':Sequelize[_0x4f29('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4f29('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4f29('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x4f29('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4f29('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4f29('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4f29('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4f29('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x4f29('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x4f29('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x35182e){if(!_0x35182e)this[_0x4f29('0x8')](_0x4f29('0x9'),null);this[_0x4f29('0x8')](_0x4f29('0xa'),_0x35182e);}},'provider':{'type':Sequelize['ENUM'](_0x4f29('0xb'),_0x4f29('0xc'),'yahoo',_0x4f29('0xd')),'defaultValue':null,'get':function(){var _0x1eeaa4=this[_0x4f29('0xe')]('provider');return _0x1eeaa4||_0x4f29('0xf');},'set':function(_0x58dae5){if(_0x58dae5===_0x4f29('0xf')){_0x58dae5=null;}return this[_0x4f29('0x8')]('provider',_0x58dae5);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 46ac5d9..4f4d4ce 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 _0xe049=['ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','MailAccounts','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','setImap','getSmtp','MailInteraction','addInteraction','getInteractions','CmContact','Contact','User','fullname','Tag','Tags','tag','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','finally','getApplications','getMessages','MailMessage','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','CmList','List','Contacts','updatedAt','from','email','attachments','join','server/files/attachments','SendMail','sendMail','messageId','subject','attach','out','Messages','CloudProvider','getSmtpOptions','VerifySmtp','Sequelize','ValidationError','omit','spread','removeAgents','isArray','userMailAccount:remove','emit','getAgents','moment','bluebird','util','lodash','juice','ioredis','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','jayson/promise','client','http','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','UserProfileResource','stack','name','send','gmail','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook.office365.com','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','Unknown\x20email\x20service\x20provider','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','index','MailServerIn','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','MailServerOut','Pause','length','includeAll','options','find','body','provider','custom','describe','addDisposition','MailAccountId','create','Disposition','removeDispositions'];(function(_0x5e3bd8,_0x32a19b){var _0x2d2a4f=function(_0x550d15){while(--_0x550d15){_0x5e3bd8['push'](_0x5e3bd8['shift']());}};_0x2d2a4f(++_0x32a19b);}(_0xe049,0x1ba));var _0x9e04=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xe049[_0x25e7cb];return _0x375d92;};'use strict';var moment=require(_0x9e04('0x0'));var BPromise=require(_0x9e04('0x1'));var util=require(_0x9e04('0x2'));var path=require('path');var _=require(_0x9e04('0x3'));var juice=require(_0x9e04('0x4'));var Redis=require(_0x9e04('0x5'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x9e04('0x6'));var config=require(_0x9e04('0x7'));var db=require(_0x9e04('0x8'))['db'];config[_0x9e04('0x9')]=_[_0x9e04('0xa')](config[_0x9e04('0x9')],{'host':_0x9e04('0xb'),'port':0x18eb});var socket=require(_0x9e04('0xc'))(new Redis(config[_0x9e04('0x9')]));require(_0x9e04('0xd'))['register'](socket);var jayson=require(_0x9e04('0xe'));var client=jayson[_0x9e04('0xf')][_0x9e04('0x10')]({'port':0x232b});function respondWithRpcPromise(_0x3f6a80,_0x3a9ba8,_0x27a12c,_0x4e3fd8){return new BPromise(function(_0x157473,_0x51c9ed){var _0x28edf1=_0x4e3fd8||client;return _0x28edf1[_0x9e04('0x11')](_0x3f6a80,_0x27a12c)['then'](function(_0x26da76){logger[_0x9e04('0x12')](_0x9e04('0x13'),_0x3a9ba8,_0x9e04('0x14'));logger[_0x9e04('0x15')](_0x9e04('0x16'),_0x3a9ba8,'request\x20sent',JSON[_0x9e04('0x17')](_0x26da76));if(_0x26da76[_0x9e04('0x18')]){if(_0x26da76[_0x9e04('0x18')][_0x9e04('0x19')]===0x1f4){logger[_0x9e04('0x18')](_0x9e04('0x13'),_0x3a9ba8,_0x26da76[_0x9e04('0x18')]['message']);return _0x51c9ed(_0x26da76[_0x9e04('0x18')][_0x9e04('0x1a')]);}logger[_0x9e04('0x18')](_0x9e04('0x13'),_0x3a9ba8,_0x26da76[_0x9e04('0x18')]['message']);return _0x157473(_0x26da76[_0x9e04('0x18')][_0x9e04('0x1a')]);}else{logger[_0x9e04('0x12')](_0x9e04('0x13'),_0x3a9ba8,_0x9e04('0x14'));_0x157473(_0x26da76[_0x9e04('0x1b')]['message']);}})['catch'](function(_0x437d63){logger[_0x9e04('0x18')](_0x9e04('0x13'),_0x3a9ba8,_0x437d63);_0x51c9ed(_0x437d63);});});}function respondWithStatusCode(_0x432e16,_0xfcb92){_0xfcb92=_0xfcb92||0xcc;return function(_0x42095d){if(_0x42095d){return _0x432e16[_0x9e04('0x1c')](_0xfcb92);}return _0x432e16[_0x9e04('0x1d')](_0xfcb92)[_0x9e04('0x1e')]();};}function respondWithResult(_0x1c1680,_0x329458){_0x329458=_0x329458||0xc8;return function(_0x5843e7){if(_0x5843e7){return _0x1c1680[_0x9e04('0x1d')](_0x329458)[_0x9e04('0x1f')](_0x5843e7);}};}function respondWithFilteredResult(_0x3f5187,_0x17b1fe){return function(_0x4feda2){if(_0x4feda2){var _0x2ad2e3=typeof _0x17b1fe[_0x9e04('0x20')]===_0x9e04('0x21')&&typeof _0x17b1fe[_0x9e04('0x22')]===_0x9e04('0x21');var _0x591dd2=_0x4feda2[_0x9e04('0x23')];var _0x5a1ca6=_0x2ad2e3?0x0:_0x17b1fe[_0x9e04('0x20')];var _0x38ad8d=_0x2ad2e3?_0x4feda2['count']:_0x17b1fe[_0x9e04('0x20')]+_0x17b1fe['limit'];var _0x376996;if(_0x38ad8d>=_0x591dd2){_0x38ad8d=_0x591dd2;_0x376996=0xc8;}else{_0x376996=0xce;}_0x3f5187[_0x9e04('0x1d')](_0x376996);return _0x3f5187[_0x9e04('0x24')](_0x9e04('0x25'),_0x5a1ca6+'-'+_0x38ad8d+'/'+_0x591dd2)['json'](_0x4feda2);}return null;};}function saveUpdates(_0x210e7c){return function(_0x3abfac){if(_0x3abfac){return _0x3abfac[_0x9e04('0x26')](_0x210e7c)[_0x9e04('0x27')](function(_0x3dd0d9){return _0x3dd0d9;});}return null;};}function removeEntity(_0x225755){return function(_0x50c8ad){if(_0x50c8ad){return _0x50c8ad[_0x9e04('0x28')]()['then'](function(){var _0x8a00ae=_0x50c8ad[_0x9e04('0x29')]({'plain':!![]});var _0x29c5f5='MailAccounts';return db[_0x9e04('0x2a')]['destroy']({'where':{'type':_0x29c5f5,'resourceId':_0x8a00ae['id']}})[_0x9e04('0x27')](function(){return _0x50c8ad;});})[_0x9e04('0x27')](function(){_0x225755[_0x9e04('0x1d')](0xcc)[_0x9e04('0x1e')]();});}};}function handleEntityNotFound(_0x1ac294){return function(_0x2f525d){if(!_0x2f525d){_0x1ac294[_0x9e04('0x1c')](0x194);}return _0x2f525d;};}function handleError(_0x473d27,_0x38e2ee){_0x38e2ee=_0x38e2ee||0x1f4;return function(_0x50d2ad){logger[_0x9e04('0x18')](_0x50d2ad[_0x9e04('0x2b')]);if(_0x50d2ad[_0x9e04('0x2c')]){delete _0x50d2ad['name'];}_0x473d27[_0x9e04('0x1d')](_0x38e2ee)[_0x9e04('0x2d')](_0x50d2ad);};}function getImapHost(_0x3dd0e2){switch(_0x3dd0e2){case _0x9e04('0x2e'):return'imap.gmail.com';case _0x9e04('0x2f'):return _0x9e04('0x30');case _0x9e04('0x31'):return _0x9e04('0x32');case'outlook365':return _0x9e04('0x33');}throw new Error('Unknown\x20email\x20service\x20provider',_0x3dd0e2);}function getSmtpHost(_0x340be5){switch(_0x340be5){case _0x9e04('0x2e'):return _0x9e04('0x34');case _0x9e04('0x2f'):return _0x9e04('0x35');case'hotmail':return _0x9e04('0x36');case'outlook365':return _0x9e04('0x37');}throw new Error(_0x9e04('0x38'),_0x340be5);}function getAuthenticationOptions(_0x210b49,_0x527fb9){var _0x418e9a={};var _0x268d6c={};if(_0x210b49){_0x418e9a[_0x9e04('0x39')]=_0x268d6c[_0x9e04('0x39')]=_0x527fb9[_0x9e04('0x3a')];_0x418e9a[_0x9e04('0x3b')]=_0x268d6c[_0x9e04('0x3c')]=_0x527fb9[_0x9e04('0x3b')];if(_0x527fb9['modernAuthentication']){_0x418e9a[_0x9e04('0x3d')]=_0x268d6c['modernAuthentication']=!![];_0x418e9a[_0x9e04('0x3e')]=_0x268d6c[_0x9e04('0x3e')]=_0x527fb9[_0x9e04('0x3e')];_0x418e9a[_0x9e04('0x3b')]=_0x268d6c[_0x9e04('0x3c')]=null;}else{_0x418e9a['CloudProviderId']=_0x268d6c['CloudProviderId']=null;}_0x418e9a[_0x9e04('0x3f')]=getImapHost(_0x210b49);_0x418e9a[_0x9e04('0x40')]=0x3e1;_0x268d6c[_0x9e04('0x3f')]=getSmtpHost(_0x210b49);_0x268d6c[_0x9e04('0x40')]=0x24b;_0x268d6c[_0x9e04('0x41')]=![];_0x418e9a[_0x9e04('0x42')]=_0x268d6c[_0x9e04('0x42')]=null;}else{if(_0x527fb9['authentication']){_0x418e9a[_0x9e04('0x39')]=_0x268d6c[_0x9e04('0x39')]=_0x527fb9[_0x9e04('0x3a')];_0x418e9a['password']=_0x268d6c[_0x9e04('0x3c')]=_0x527fb9[_0x9e04('0x3b')];}else{_0x418e9a[_0x9e04('0x43')]=_0x268d6c['authentication']=![];_0x418e9a[_0x9e04('0x39')]=_0x268d6c[_0x9e04('0x39')]=null;_0x418e9a[_0x9e04('0x3b')]=_0x268d6c[_0x9e04('0x3c')]=null;}_0x418e9a[_0x9e04('0x3f')]=_0x527fb9[_0x9e04('0x44')][_0x9e04('0x3f')];_0x418e9a[_0x9e04('0x40')]=_0x527fb9[_0x9e04('0x44')][_0x9e04('0x40')];_0x268d6c[_0x9e04('0x3f')]=_0x527fb9[_0x9e04('0x45')][_0x9e04('0x3f')];_0x268d6c[_0x9e04('0x40')]=_0x527fb9[_0x9e04('0x45')][_0x9e04('0x40')];}return{'Imap':_0x418e9a,'Smtp':_0x268d6c};}exports[_0x9e04('0x46')]=function(_0x4e928e,_0x50e40a){var _0x48d8fc={'include':[{'model':db[_0x9e04('0x47')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x9e04('0x45')},{'model':db['Pause'],'as':_0x9e04('0x48')}]},_0x5defb3={},_0x1a2d49={'count':0x0,'rows':[]};var _0x52b686=_[_0x9e04('0x49')](db[_0x9e04('0x4a')][_0x9e04('0x4b')],function(_0x24f34f){return{'name':_0x24f34f[_0x9e04('0x4c')],'type':_0x24f34f[_0x9e04('0x4d')][_0x9e04('0x4e')]};});_0x5defb3[_0x9e04('0x4f')]=_[_0x9e04('0x49')](_0x52b686,_0x9e04('0x2c'));_0x5defb3[_0x9e04('0x50')]=_[_0x9e04('0x51')](_0x4e928e[_0x9e04('0x50')]);_0x5defb3[_0x9e04('0x52')]=_[_0x9e04('0x53')](_0x5defb3[_0x9e04('0x4f')],_0x5defb3[_0x9e04('0x50')]);_0x48d8fc[_0x9e04('0x54')]=_[_0x9e04('0x53')](_0x5defb3[_0x9e04('0x4f')],qs[_0x9e04('0x55')](_0x4e928e[_0x9e04('0x50')][_0x9e04('0x55')]));_0x48d8fc[_0x9e04('0x54')]=_0x48d8fc[_0x9e04('0x54')]['length']?_0x48d8fc['attributes']:_0x5defb3['model'];if(!_0x4e928e['query'][_0x9e04('0x56')](_0x9e04('0x57'))){_0x48d8fc[_0x9e04('0x22')]=qs['limit'](_0x4e928e[_0x9e04('0x50')]['limit']);_0x48d8fc[_0x9e04('0x20')]=qs[_0x9e04('0x20')](_0x4e928e[_0x9e04('0x50')][_0x9e04('0x20')]);}_0x48d8fc[_0x9e04('0x58')]=qs[_0x9e04('0x59')](_0x4e928e['query'][_0x9e04('0x59')]);_0x48d8fc[_0x9e04('0x5a')]=qs['filters'](_[_0x9e04('0x5b')](_0x4e928e[_0x9e04('0x50')],_0x5defb3['filters']),_0x52b686);if(_0x4e928e[_0x9e04('0x50')][_0x9e04('0x5c')]){_0x48d8fc[_0x9e04('0x5a')]=_['merge'](_0x48d8fc[_0x9e04('0x5a')],{'$or':_['map'](_0x52b686,function(_0x4cb0f3){if(_0x4cb0f3[_0x9e04('0x4d')]!==_0x9e04('0x5d')){var _0x9f224b={};_0x9f224b[_0x4cb0f3[_0x9e04('0x2c')]]={'$like':'%'+_0x4e928e[_0x9e04('0x50')][_0x9e04('0x5c')]+'%'};return _0x9f224b;}})});}_0x48d8fc=_[_0x9e04('0x5e')]({},_0x48d8fc,_0x4e928e['options']);var _0x4a55d0={'where':_0x48d8fc['where']};return db[_0x9e04('0x4a')][_0x9e04('0x23')](_0x4a55d0)[_0x9e04('0x27')](function(_0x1f5fef){_0x1a2d49[_0x9e04('0x23')]=_0x1f5fef;if(_0x4e928e['query']['includeAll']){_0x48d8fc[_0x9e04('0x5f')]=[{'all':!![]}];}return db[_0x9e04('0x4a')][_0x9e04('0x60')](_0x48d8fc);})['then'](function(_0x4400af){_0x1a2d49[_0x9e04('0x61')]=_0x4400af;return _0x1a2d49;})[_0x9e04('0x27')](respondWithFilteredResult(_0x50e40a,_0x48d8fc))[_0x9e04('0x62')](handleError(_0x50e40a,null));};exports[_0x9e04('0x63')]=function(_0x1b99ec,_0x16a2c3){var _0x2bf5a8={'raw':![],'where':{'id':_0x1b99ec[_0x9e04('0x64')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x9e04('0x44')},{'model':db[_0x9e04('0x65')],'as':'Smtp'},{'model':db[_0x9e04('0x66')],'as':_0x9e04('0x48')}]},_0x1a6b46={};_0x1a6b46[_0x9e04('0x4f')]=_['keys'](db[_0x9e04('0x4a')][_0x9e04('0x4b')]);_0x1a6b46['query']=_[_0x9e04('0x51')](_0x1b99ec[_0x9e04('0x50')]);_0x1a6b46[_0x9e04('0x52')]=_[_0x9e04('0x53')](_0x1a6b46[_0x9e04('0x4f')],_0x1a6b46[_0x9e04('0x50')]);_0x2bf5a8[_0x9e04('0x54')]=_[_0x9e04('0x53')](_0x1a6b46['model'],qs[_0x9e04('0x55')](_0x1b99ec[_0x9e04('0x50')][_0x9e04('0x55')]));_0x2bf5a8[_0x9e04('0x54')]=_0x2bf5a8[_0x9e04('0x54')][_0x9e04('0x67')]?_0x2bf5a8['attributes']:_0x1a6b46[_0x9e04('0x4f')];if(_0x1b99ec[_0x9e04('0x50')][_0x9e04('0x68')]){_0x2bf5a8[_0x9e04('0x5f')]=[{'all':!![]}];}_0x2bf5a8=_['merge']({},_0x2bf5a8,_0x1b99ec[_0x9e04('0x69')]);return db[_0x9e04('0x4a')][_0x9e04('0x6a')](_0x2bf5a8)[_0x9e04('0x27')](handleEntityNotFound(_0x16a2c3,null))[_0x9e04('0x27')](respondWithResult(_0x16a2c3,null))[_0x9e04('0x62')](handleError(_0x16a2c3,null));};exports[_0x9e04('0x26')]=function(_0x199a4e,_0xfc1a9d){if(_0x199a4e[_0x9e04('0x6b')]['id']){delete _0x199a4e['body']['id'];}var _0x52c7f8=_0x199a4e['body'][_0x9e04('0x6c')]===_0x9e04('0x6d')?null:_0x199a4e[_0x9e04('0x6b')]['provider'];var _0x437a4d=_0x199a4e[_0x9e04('0x6b')][_0x9e04('0x44')]||{};var _0x108ee6=_0x199a4e[_0x9e04('0x6b')][_0x9e04('0x45')]||{};if(_0x52c7f8){_0x437a4d['host']=getImapHost(_0x52c7f8);_0x437a4d[_0x9e04('0x40')]=0x3e1;_0x108ee6[_0x9e04('0x3f')]=getSmtpHost(_0x52c7f8);_0x108ee6[_0x9e04('0x40')]=0x24b;_0x108ee6[_0x9e04('0x41')]=![];}if(_0x108ee6[_0x9e04('0x3d')]){_0x108ee6[_0x9e04('0x41')]=![];}else{_0x108ee6[_0x9e04('0x3e')]=null;}if(!_0x437a4d[_0x9e04('0x3d')])_0x437a4d[_0x9e04('0x3e')]=null;_0x199a4e[_0x9e04('0x6b')][_0x9e04('0x44')]=_0x437a4d;_0x199a4e['body'][_0x9e04('0x45')]=_0x108ee6;return db[_0x9e04('0x4a')][_0x9e04('0x6a')]({'where':{'id':_0x199a4e[_0x9e04('0x64')]['id']},'include':[{'model':db[_0x9e04('0x47')],'as':'Imap'},{'model':db[_0x9e04('0x65')],'as':'Smtp'},{'model':db['Pause'],'as':_0x9e04('0x48')}]})[_0x9e04('0x27')](handleEntityNotFound(_0xfc1a9d,null))['then'](function(_0x1198d6){if(!_0x1198d6)throw new Error('Mail\x20Account\x20not\x20found');if(_0x1198d6[_0x9e04('0x42')])delete _0x199a4e[_0x9e04('0x6b')]['Imap'];return _0x1198d6;})[_0x9e04('0x27')](saveUpdates(_0x199a4e[_0x9e04('0x6b')],null))[_0x9e04('0x27')](function(_0x394852){if(!_0x199a4e[_0x9e04('0x6b')][_0x9e04('0x44')])return _0x394852;return db['MailServerIn'][_0x9e04('0x26')](_0x199a4e['body']['Imap'],{'where':{'MailAccountId':_0x394852['id']}})[_0x9e04('0x27')](function(){return _0x394852;});})['then'](function(_0x5d288a){if(!_0x199a4e[_0x9e04('0x6b')]['Smtp'])return _0x5d288a;return db[_0x9e04('0x65')][_0x9e04('0x26')](_0x199a4e[_0x9e04('0x6b')][_0x9e04('0x45')],{'where':{'MailAccountId':_0x5d288a['id']}})[_0x9e04('0x27')](function(){return _0x5d288a;});})[_0x9e04('0x27')](respondWithResult(_0xfc1a9d,null))[_0x9e04('0x62')](handleError(_0xfc1a9d,null));};exports[_0x9e04('0x6e')]=function(_0x21ead9,_0x320fef){return db[_0x9e04('0x4a')][_0x9e04('0x6e')]()[_0x9e04('0x27')](respondWithResult(_0x320fef,null))[_0x9e04('0x62')](handleError(_0x320fef,null));};exports[_0x9e04('0x6f')]=function(_0x414462,_0x3e92e3){if(_0x414462[_0x9e04('0x6b')]['id']){delete _0x414462[_0x9e04('0x6b')]['id'];}return db[_0x9e04('0x4a')][_0x9e04('0x6a')]({'where':{'id':_0x414462[_0x9e04('0x64')]['id']}})[_0x9e04('0x27')](handleEntityNotFound(_0x3e92e3,null))[_0x9e04('0x27')](function(_0x5856f9){if(_0x5856f9){_0x414462[_0x9e04('0x6b')][_0x9e04('0x70')]=_0x5856f9['id'];return db['Disposition'][_0x9e04('0x71')](_0x414462[_0x9e04('0x6b')]);}})[_0x9e04('0x27')](respondWithResult(_0x3e92e3,null))[_0x9e04('0x62')](handleError(_0x3e92e3,null));};exports['getDispositions']=function(_0x1410e1,_0x4168a0){var _0x5522c0={'raw':![],'where':{}};var _0x1ffbf7={};var _0x4c687e={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x1410e1[_0x9e04('0x64')]['id']}})[_0x9e04('0x27')](handleEntityNotFound(_0x4168a0,null))['then'](function(_0x47f563){if(_0x47f563){_0x1ffbf7['model']=_[_0x9e04('0x51')](db[_0x9e04('0x72')]['rawAttributes']);_0x1ffbf7['query']=_[_0x9e04('0x51')](_0x1410e1[_0x9e04('0x50')]);_0x1ffbf7['filters']=_['intersection'](_0x1ffbf7[_0x9e04('0x4f')],_0x1ffbf7[_0x9e04('0x50')]);_0x5522c0[_0x9e04('0x54')]=_[_0x9e04('0x53')](_0x1ffbf7[_0x9e04('0x4f')],qs[_0x9e04('0x55')](_0x1410e1[_0x9e04('0x50')]['fields']));_0x5522c0[_0x9e04('0x54')]=_0x5522c0[_0x9e04('0x54')][_0x9e04('0x67')]?_0x5522c0[_0x9e04('0x54')]:_0x1ffbf7[_0x9e04('0x4f')];if(!_0x1410e1['query'][_0x9e04('0x56')](_0x9e04('0x57'))){_0x5522c0[_0x9e04('0x22')]=qs['limit'](_0x1410e1['query'][_0x9e04('0x22')]);_0x5522c0['offset']=qs[_0x9e04('0x20')](_0x1410e1[_0x9e04('0x50')][_0x9e04('0x20')]);}_0x5522c0[_0x9e04('0x58')]=qs[_0x9e04('0x59')](_0x1410e1[_0x9e04('0x50')][_0x9e04('0x59')]);_0x5522c0['where']=qs[_0x9e04('0x52')](_[_0x9e04('0x5b')](_0x1410e1[_0x9e04('0x50')],_0x1ffbf7[_0x9e04('0x52')]));_0x5522c0['where']['MailAccountId']=_0x47f563['id'];if(_0x1410e1['query']['filter']){_0x5522c0[_0x9e04('0x5a')]=_[_0x9e04('0x5e')](_0x5522c0['where'],{'$or':_[_0x9e04('0x49')](_0x5522c0['attributes'],function(_0x6bea64){var _0x4555bf={};_0x4555bf[_0x6bea64]={'$like':'%'+_0x1410e1[_0x9e04('0x50')][_0x9e04('0x5c')]+'%'};return _0x4555bf;})});}_0x5522c0=_['merge']({},_0x5522c0,_0x1410e1[_0x9e04('0x69')]);return db['Disposition']['count']({'where':_0x5522c0[_0x9e04('0x5a')]})[_0x9e04('0x27')](function(_0x937853){_0x4c687e['count']=_0x937853;if(_0x1410e1[_0x9e04('0x50')][_0x9e04('0x68')]){_0x5522c0[_0x9e04('0x5f')]=[{'all':!![]}];}return db[_0x9e04('0x72')][_0x9e04('0x60')](_0x5522c0);})[_0x9e04('0x27')](function(_0x1c3a96){_0x4c687e[_0x9e04('0x61')]=_0x1c3a96;return _0x4c687e;});}})['then'](respondWithFilteredResult(_0x4168a0,_0x5522c0))[_0x9e04('0x62')](handleError(_0x4168a0,null));};exports[_0x9e04('0x73')]=function(_0x2f2c30,_0x22c9a0){return db[_0x9e04('0x4a')][_0x9e04('0x6a')]({'where':{'id':_0x2f2c30[_0x9e04('0x64')]['id']}})[_0x9e04('0x27')](handleEntityNotFound(_0x22c9a0,null))[_0x9e04('0x27')](function(_0x4bd070){if(_0x4bd070){return _0x4bd070[_0x9e04('0x73')](_0x2f2c30[_0x9e04('0x50')][_0x9e04('0x74')]);}})[_0x9e04('0x27')](respondWithStatusCode(_0x22c9a0,null))[_0x9e04('0x62')](handleError(_0x22c9a0,null));};exports[_0x9e04('0x75')]=function(_0x27a793,_0x4ac5d9){if(_0x27a793[_0x9e04('0x6b')]['id']){delete _0x27a793[_0x9e04('0x6b')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x27a793[_0x9e04('0x64')]['id']}})['then'](handleEntityNotFound(_0x4ac5d9,null))['then'](function(_0x2a0b67){if(_0x2a0b67){_0x27a793[_0x9e04('0x6b')][_0x9e04('0x70')]=_0x2a0b67['id'];return db['CannedAnswer'][_0x9e04('0x71')](_0x27a793[_0x9e04('0x6b')]);}})[_0x9e04('0x27')](respondWithResult(_0x4ac5d9,null))[_0x9e04('0x62')](handleError(_0x4ac5d9,null));};exports[_0x9e04('0x76')]=function(_0x5612d7,_0x6004dd){var _0x279a95={'raw':![],'where':{}};var _0x2b597e={};var _0x59414f={'count':0x0,'rows':[]};return db[_0x9e04('0x4a')][_0x9e04('0x77')]({'where':{'id':_0x5612d7[_0x9e04('0x64')]['id']}})['then'](handleEntityNotFound(_0x6004dd,null))[_0x9e04('0x27')](function(_0x3ebe2d){if(_0x3ebe2d){_0x2b597e[_0x9e04('0x4f')]=_[_0x9e04('0x51')](db['CannedAnswer'][_0x9e04('0x4b')]);_0x2b597e['query']=_[_0x9e04('0x51')](_0x5612d7[_0x9e04('0x50')]);_0x2b597e['filters']=_['intersection'](_0x2b597e[_0x9e04('0x4f')],_0x2b597e[_0x9e04('0x50')]);_0x279a95[_0x9e04('0x54')]=_[_0x9e04('0x53')](_0x2b597e[_0x9e04('0x4f')],qs[_0x9e04('0x55')](_0x5612d7[_0x9e04('0x50')][_0x9e04('0x55')]));_0x279a95[_0x9e04('0x54')]=_0x279a95[_0x9e04('0x54')][_0x9e04('0x67')]?_0x279a95['attributes']:_0x2b597e[_0x9e04('0x4f')];if(!_0x5612d7['query'][_0x9e04('0x56')](_0x9e04('0x57'))){_0x279a95[_0x9e04('0x22')]=qs['limit'](_0x5612d7[_0x9e04('0x50')]['limit']);_0x279a95[_0x9e04('0x20')]=qs[_0x9e04('0x20')](_0x5612d7['query'][_0x9e04('0x20')]);}_0x279a95['order']=qs[_0x9e04('0x59')](_0x5612d7['query']['sort']);_0x279a95[_0x9e04('0x5a')]=qs[_0x9e04('0x52')](_[_0x9e04('0x5b')](_0x5612d7[_0x9e04('0x50')],_0x2b597e['filters']));_0x279a95[_0x9e04('0x5a')][_0x9e04('0x70')]=_0x3ebe2d['id'];if(_0x5612d7[_0x9e04('0x50')][_0x9e04('0x5c')]){_0x279a95[_0x9e04('0x5a')]=_[_0x9e04('0x5e')](_0x279a95[_0x9e04('0x5a')],{'$or':_[_0x9e04('0x49')](_0x279a95[_0x9e04('0x54')],function(_0x5afd27){var _0x571c62={};_0x571c62[_0x5afd27]={'$like':'%'+_0x5612d7['query'][_0x9e04('0x5c')]+'%'};return _0x571c62;})});}_0x279a95=_[_0x9e04('0x5e')]({},_0x279a95,_0x5612d7[_0x9e04('0x69')]);return db['CannedAnswer'][_0x9e04('0x23')]({'where':_0x279a95['where']})[_0x9e04('0x27')](function(_0x545409){_0x59414f[_0x9e04('0x23')]=_0x545409;if(_0x5612d7[_0x9e04('0x50')]['includeAll']){_0x279a95['include']=[{'all':!![]}];}return db[_0x9e04('0x78')][_0x9e04('0x60')](_0x279a95);})['then'](function(_0x51d32c){_0x59414f[_0x9e04('0x61')]=_0x51d32c;return _0x59414f;});}})[_0x9e04('0x27')](respondWithFilteredResult(_0x6004dd,_0x279a95))['catch'](handleError(_0x6004dd,null));};exports[_0x9e04('0x79')]=function(_0x271ead,_0x3af906){return db[_0x9e04('0x4a')][_0x9e04('0x6a')]({'where':{'id':_0x271ead[_0x9e04('0x64')]['id']}})[_0x9e04('0x27')](handleEntityNotFound(_0x3af906,null))['then'](function(_0x593376){if(_0x593376){return _0x593376['removeAnswers'](_0x271ead[_0x9e04('0x50')]['ids']);}})[_0x9e04('0x27')](respondWithStatusCode(_0x3af906,null))[_0x9e04('0x62')](handleError(_0x3af906,null));};exports[_0x9e04('0x71')]=function(_0x2e7345,_0x2b4e67){var _0x377fa2={'name':_0x2e7345[_0x9e04('0x6b')][_0x9e04('0x2c')],'key':_0x2e7345['body']['key'],'provider':_0x2e7345['body'][_0x9e04('0x6c')]===_0x9e04('0x6d')?null:_0x2e7345[_0x9e04('0x6b')][_0x9e04('0x6c')],'email':_0x2e7345[_0x9e04('0x6b')]['email'],'ListId':_0x2e7345[_0x9e04('0x6b')]['ListId'],'active':!_[_0x9e04('0x7a')](_0x2e7345[_0x9e04('0x6b')]['active'])?_0x2e7345['body'][_0x9e04('0x7b')]:!![],'description':_0x2e7345[_0x9e04('0x6b')][_0x9e04('0x7c')]||null};var _0x892418=getAuthenticationOptions(_0x377fa2[_0x9e04('0x6c')],_0x2e7345[_0x9e04('0x6b')]);_0x377fa2[_0x9e04('0x44')]=_0x892418[_0x9e04('0x44')];_0x377fa2[_0x9e04('0x45')]=_0x892418[_0x9e04('0x45')];return db['MailAccount'][_0x9e04('0x71')](_0x377fa2,{'include':[{'model':db[_0x9e04('0x65')],'as':'Smtp'},{'model':db['MailServerIn'],'as':_0x9e04('0x44')}]})[_0x9e04('0x27')](function(_0x1d74e1){var _0x355713=_0x2e7345[_0x9e04('0x39')][_0x9e04('0x29')]({'plain':!![]});if(!_0x355713)throw new Error(_0x9e04('0x7d'));if(_0x355713['role']===_0x9e04('0x39')){var _0x510f6c=_0x1d74e1['get']({'plain':!![]});return db[_0x9e04('0x7e')][_0x9e04('0x6a')]({'where':{'name':_0x9e04('0x7f'),'userProfileId':_0x355713['userProfileId']},'raw':!![]})[_0x9e04('0x27')](function(_0x57e6dc){if(_0x57e6dc&&_0x57e6dc[_0x9e04('0x80')]===0x0){return db[_0x9e04('0x2a')][_0x9e04('0x71')]({'name':_0x510f6c[_0x9e04('0x2c')],'resourceId':_0x510f6c['id'],'type':_0x57e6dc[_0x9e04('0x2c')],'sectionId':_0x57e6dc['id']},{})[_0x9e04('0x27')](function(){return _0x1d74e1;});}else{return _0x1d74e1;}})[_0x9e04('0x62')](function(_0x4f928d){logger[_0x9e04('0x18')](_0x9e04('0x81'),_0x4f928d);throw _0x4f928d;});}return _0x1d74e1;})[_0x9e04('0x27')](respondWithResult(_0x2b4e67,0xc9))[_0x9e04('0x62')](handleError(_0x2b4e67,null));};exports['getImap']=function(_0x58066a,_0x199ced){return db[_0x9e04('0x4a')]['findOne']({'where':{'id':_0x58066a['params']['id']}})[_0x9e04('0x27')](handleEntityNotFound(_0x199ced,null))[_0x9e04('0x27')](function(_0x4d296e){if(_0x4d296e){return _0x4d296e[_0x9e04('0x82')]();}return null;})[_0x9e04('0x27')](respondWithResult(_0x199ced,null))['catch'](handleError(_0x199ced,null));};exports[_0x9e04('0x83')]=function(_0xa783a6,_0x305a94){if(_0xa783a6['body']['id']){delete _0xa783a6[_0x9e04('0x6b')]['id'];}return db['MailAccount'][_0x9e04('0x6a')]({'where':{'id':_0xa783a6[_0x9e04('0x64')]['id']}})[_0x9e04('0x27')](handleEntityNotFound(_0x305a94,null))[_0x9e04('0x27')](function(_0x14aafc){if(_0x14aafc){_0xa783a6[_0x9e04('0x6b')][_0x9e04('0x70')]=_0x14aafc['id'];return db[_0x9e04('0x47')][_0x9e04('0x71')](_0xa783a6[_0x9e04('0x6b')]);}})[_0x9e04('0x27')](respondWithResult(_0x305a94,null))['catch'](handleError(_0x305a94,null));};exports['removeImap']=function(_0x57b3a7,_0x4c088d){return db[_0x9e04('0x4a')][_0x9e04('0x77')]({'where':{'id':_0x57b3a7[_0x9e04('0x64')]['id']}})[_0x9e04('0x27')](handleEntityNotFound(_0x4c088d,null))[_0x9e04('0x27')](function(_0x41508a){if(_0x41508a){return _0x41508a[_0x9e04('0x84')](null);}return null;})[_0x9e04('0x27')](respondWithStatusCode(_0x4c088d,null))[_0x9e04('0x62')](handleError(_0x4c088d,null));};exports['getSmtp']=function(_0x44f58,_0x3c4393){return db[_0x9e04('0x4a')][_0x9e04('0x77')]({'where':{'id':_0x44f58[_0x9e04('0x64')]['id']}})['then'](handleEntityNotFound(_0x3c4393,null))[_0x9e04('0x27')](function(_0x1698bf){if(_0x1698bf){return _0x1698bf[_0x9e04('0x85')]();}return null;})['then'](respondWithResult(_0x3c4393,null))[_0x9e04('0x62')](handleError(_0x3c4393,null));};exports['addSmtp']=function(_0x3cb549,_0x15349f){if(_0x3cb549[_0x9e04('0x6b')]['id']){delete _0x3cb549[_0x9e04('0x6b')]['id'];}return db[_0x9e04('0x4a')][_0x9e04('0x6a')]({'where':{'id':_0x3cb549[_0x9e04('0x64')]['id']}})[_0x9e04('0x27')](handleEntityNotFound(_0x15349f,null))['then'](function(_0x312c9d){if(_0x312c9d){_0x3cb549[_0x9e04('0x6b')][_0x9e04('0x70')]=_0x312c9d['id'];return db[_0x9e04('0x65')][_0x9e04('0x71')](_0x3cb549[_0x9e04('0x6b')]);}})[_0x9e04('0x27')](respondWithResult(_0x15349f,null))[_0x9e04('0x62')](handleError(_0x15349f,null));};exports['removeSmtp']=function(_0x5cf42a,_0x30b9f2){return db[_0x9e04('0x4a')][_0x9e04('0x77')]({'where':{'id':_0x5cf42a[_0x9e04('0x64')]['id']}})[_0x9e04('0x27')](handleEntityNotFound(_0x30b9f2,null))[_0x9e04('0x27')](function(_0x35946c){if(_0x35946c){return _0x35946c['setSmtp'](null);}return null;})[_0x9e04('0x27')](respondWithStatusCode(_0x30b9f2,null))[_0x9e04('0x62')](handleError(_0x30b9f2,null));};exports['addInteraction']=function(_0x134a72,_0x31ff32){return db[_0x9e04('0x86')][_0x9e04('0x6a')]({'where':{'id':_0x134a72[_0x9e04('0x64')]['id']}})[_0x9e04('0x27')](handleEntityNotFound(_0x31ff32,null))[_0x9e04('0x27')](function(_0x202627){if(_0x202627){return _0x202627[_0x9e04('0x87')](_0x134a72[_0x9e04('0x6b')][_0x9e04('0x74')],_['omit'](_0x134a72[_0x9e04('0x6b')],['ids','id'])||{});}})[_0x9e04('0x27')](respondWithResult(_0x31ff32,null))[_0x9e04('0x62')](handleError(_0x31ff32,null));};exports[_0x9e04('0x88')]=function(_0x59dd14,_0x581429){var _0x1dbb45={'raw':![],'where':{}};var _0x4340b6={};var _0xa7afd1={'count':0x0,'rows':[]};return db[_0x9e04('0x4a')][_0x9e04('0x77')]({'where':{'id':_0x59dd14[_0x9e04('0x64')]['id']}})[_0x9e04('0x27')](handleEntityNotFound(_0x581429,null))['then'](function(_0x396ee3){if(_0x396ee3){_0x4340b6[_0x9e04('0x4f')]=_[_0x9e04('0x51')](db[_0x9e04('0x86')][_0x9e04('0x4b')]);_0x4340b6['query']=_[_0x9e04('0x51')](_0x59dd14[_0x9e04('0x50')]);_0x4340b6[_0x9e04('0x52')]=_[_0x9e04('0x53')](_0x4340b6['model'],_0x4340b6[_0x9e04('0x50')]);_0x1dbb45[_0x9e04('0x54')]=_[_0x9e04('0x53')](_0x4340b6[_0x9e04('0x4f')],qs[_0x9e04('0x55')](_0x59dd14['query'][_0x9e04('0x55')]));_0x1dbb45[_0x9e04('0x54')]=_0x1dbb45['attributes'][_0x9e04('0x67')]?_0x1dbb45[_0x9e04('0x54')]:_0x4340b6['model'];if(!_0x59dd14['query'][_0x9e04('0x56')](_0x9e04('0x57'))){_0x1dbb45[_0x9e04('0x22')]=qs[_0x9e04('0x22')](_0x59dd14[_0x9e04('0x50')][_0x9e04('0x22')]);_0x1dbb45[_0x9e04('0x20')]=qs['offset'](_0x59dd14[_0x9e04('0x50')]['offset']);}_0x1dbb45[_0x9e04('0x58')]=qs['sort'](_0x59dd14[_0x9e04('0x50')][_0x9e04('0x59')]);_0x1dbb45[_0x9e04('0x5a')]=qs[_0x9e04('0x52')](_['pick'](_0x59dd14['query'],_0x4340b6[_0x9e04('0x52')]));_0x1dbb45[_0x9e04('0x5a')]['MailAccountId']=_0x396ee3['id'];if(_0x59dd14[_0x9e04('0x50')][_0x9e04('0x5c')]){_0x1dbb45[_0x9e04('0x5a')]=_[_0x9e04('0x5e')](_0x1dbb45[_0x9e04('0x5a')],{'$or':_[_0x9e04('0x49')](_0x1dbb45['attributes'],function(_0x16be70){var _0x3fa270={};_0x3fa270[_0x16be70]={'$like':'%'+_0x59dd14[_0x9e04('0x50')][_0x9e04('0x5c')]+'%'};return _0x3fa270;})});}_0x1dbb45=_['merge']({},_0x1dbb45,_0x59dd14[_0x9e04('0x69')]);return db[_0x9e04('0x86')][_0x9e04('0x23')]({'where':_0x1dbb45[_0x9e04('0x5a')]})['then'](function(_0x31040e){_0xa7afd1[_0x9e04('0x23')]=_0x31040e;if(_0x59dd14[_0x9e04('0x50')][_0x9e04('0x68')]){_0x1dbb45['include']=[{'model':db[_0x9e04('0x89')],'as':_0x9e04('0x8a'),'required':![]},{'model':db[_0x9e04('0x8b')],'as':'Owner','attributes':[_0x9e04('0x2c'),_0x9e04('0x8c'),'internal'],'required':![]},{'model':db[_0x9e04('0x8d')],'as':_0x9e04('0x8e'),'attributes':['id','name','color'],'where':_0x59dd14[_0x9e04('0x50')]['tag']?{'id':_0x59dd14[_0x9e04('0x50')][_0x9e04('0x8f')]}:undefined,'required':_0x59dd14[_0x9e04('0x50')][_0x9e04('0x8f')]?!![]:![]}];}return db['MailInteraction'][_0x9e04('0x60')](_0x1dbb45);})[_0x9e04('0x27')](function(_0x41e08e){_0xa7afd1[_0x9e04('0x61')]=_0x41e08e;return _0xa7afd1;});}})[_0x9e04('0x27')](respondWithFilteredResult(_0x581429,_0x1dbb45))[_0x9e04('0x62')](handleError(_0x581429,null));};exports[_0x9e04('0x90')]=function addApplications(_0x582d1b,_0x1e1907){var _0x11b095=_0x582d1b[_0x9e04('0x64')]['id'];var _0x418490=_0x582d1b['body'];var _0x593287=0xc8;var _0x2b636c=null;return db['sequelize']['transaction']({'isolationLevel':db['sequelize'][_0x9e04('0x91')][_0x9e04('0x92')][_0x9e04('0x93')]},function(_0x58eee5){return db['MailAccount'][_0x9e04('0x77')]({'where':{'id':_0x11b095},'transaction':_0x58eee5})[_0x9e04('0x27')](function(_0x4ba507){if(_0x4ba507){return db[_0x9e04('0x94')]['destroy']({'where':{'MailAccountId':_0x11b095},'transaction':_0x58eee5})[_0x9e04('0x27')](function(){var _0x4092f7=_[_0x9e04('0x49')](_0x418490,function(_0x5f1db5){_0x5f1db5['MailAccountId']=_0x11b095;return _0x5f1db5;});return db[_0x9e04('0x94')][_0x9e04('0x95')](_0x4092f7,{'transaction':_0x58eee5});});}else{_0x593287=0x194;_0x2b636c=[];}});})[_0x9e04('0x27')](function(){if(_0x593287!==0x194){return db[_0x9e04('0x94')][_0x9e04('0x96')]({'where':{'MailAccountId':_0x11b095},'order':'priority'})[_0x9e04('0x27')](function(_0x208eb0){_0x2b636c=_0x208eb0;});}})[_0x9e04('0x62')](function(_0x19f9f8){_0x593287=0x1f4;logger[_0x9e04('0x18')](_0x19f9f8['stack']);if(_0x19f9f8[_0x9e04('0x2c')]){delete _0x19f9f8[_0x9e04('0x2c')];}_0x2b636c=_0x19f9f8;})[_0x9e04('0x97')](function(){if(_0x2b636c===null){_0x1e1907[_0x9e04('0x1c')](_0x593287);}else{if(_0x593287===0x1f4){_0x1e1907[_0x9e04('0x1d')](_0x593287)[_0x9e04('0x2d')](_0x2b636c);}else{_0x1e1907['status'](_0x593287)[_0x9e04('0x1f')](_0x2b636c);}}});};exports['getApplications']=function(_0x5ddb09,_0x5d4767){var _0x232dc0={};var _0x3eeaae={};var _0x481e8c;var _0x5530cd;return db[_0x9e04('0x4a')]['findOne']({'where':{'id':_0x5ddb09[_0x9e04('0x64')]['id']}})[_0x9e04('0x27')](handleEntityNotFound(_0x5d4767,null))[_0x9e04('0x27')](function(_0x2dffae){if(_0x2dffae){_0x481e8c=_0x2dffae;_0x3eeaae[_0x9e04('0x4f')]=_[_0x9e04('0x51')](db[_0x9e04('0x94')][_0x9e04('0x4b')]);_0x3eeaae[_0x9e04('0x50')]=_[_0x9e04('0x51')](_0x5ddb09[_0x9e04('0x50')]);_0x3eeaae[_0x9e04('0x52')]=_[_0x9e04('0x53')](_0x3eeaae[_0x9e04('0x4f')],_0x3eeaae[_0x9e04('0x50')]);_0x232dc0[_0x9e04('0x54')]=_[_0x9e04('0x53')](_0x3eeaae[_0x9e04('0x4f')],qs['fields'](_0x5ddb09['query']['fields']));_0x232dc0[_0x9e04('0x54')]=_0x232dc0[_0x9e04('0x54')]['length']?_0x232dc0[_0x9e04('0x54')]:_0x3eeaae['model'];_0x232dc0[_0x9e04('0x58')]=qs[_0x9e04('0x59')](_0x5ddb09[_0x9e04('0x50')]['sort']);_0x232dc0[_0x9e04('0x5a')]=qs['filters'](_[_0x9e04('0x5b')](_0x5ddb09[_0x9e04('0x50')],_0x3eeaae[_0x9e04('0x52')]));if(_0x5ddb09[_0x9e04('0x50')]['filter']){_0x232dc0[_0x9e04('0x5a')]=_[_0x9e04('0x5e')](_0x232dc0['where'],{'$or':_[_0x9e04('0x49')](_0x232dc0[_0x9e04('0x54')],function(_0x5eb995){var _0x2e216b={};_0x2e216b[_0x5eb995]={'$like':'%'+_0x5ddb09[_0x9e04('0x50')][_0x9e04('0x5c')]+'%'};return _0x2e216b;})});}_0x232dc0=_['merge']({},_0x232dc0,_0x5ddb09['options']);return _0x481e8c[_0x9e04('0x98')](_0x232dc0);}})[_0x9e04('0x27')](function(_0x1789d9){if(_0x1789d9){_0x5530cd=_0x1789d9['length'];if(!_0x5ddb09[_0x9e04('0x50')][_0x9e04('0x56')](_0x9e04('0x57'))){_0x232dc0[_0x9e04('0x22')]=qs[_0x9e04('0x22')](_0x5ddb09['query']['limit']);_0x232dc0[_0x9e04('0x20')]=qs[_0x9e04('0x20')](_0x5ddb09['query'][_0x9e04('0x20')]);}return _0x481e8c[_0x9e04('0x98')](_0x232dc0);}})['then'](function(_0x22bb72){if(_0x22bb72){return _0x22bb72?{'count':_0x5530cd,'rows':_0x22bb72}:null;}})[_0x9e04('0x27')](respondWithResult(_0x5d4767,null))[_0x9e04('0x62')](handleError(_0x5d4767,null));};exports[_0x9e04('0x99')]=function(_0x176c3f,_0x1ee681){var _0x1abe49={'raw':!![],'where':{}};var _0xbdfbe1={};var _0x7826dd={'count':0x0,'rows':[]};return db[_0x9e04('0x4a')][_0x9e04('0x77')]({'where':{'id':_0x176c3f['params']['id']}})[_0x9e04('0x27')](handleEntityNotFound(_0x1ee681,null))[_0x9e04('0x27')](function(_0x40ae7f){if(_0x40ae7f){_0xbdfbe1[_0x9e04('0x4f')]=_[_0x9e04('0x51')](db[_0x9e04('0x9a')][_0x9e04('0x4b')]);_0xbdfbe1[_0x9e04('0x50')]=_['keys'](_0x176c3f[_0x9e04('0x50')]);_0xbdfbe1[_0x9e04('0x52')]=_['intersection'](_0xbdfbe1[_0x9e04('0x4f')],_0xbdfbe1[_0x9e04('0x50')]);_0x1abe49['attributes']=_['intersection'](_0xbdfbe1['model'],qs['fields'](_0x176c3f[_0x9e04('0x50')][_0x9e04('0x55')]));_0x1abe49[_0x9e04('0x54')]=_0x1abe49[_0x9e04('0x54')][_0x9e04('0x67')]?_0x1abe49[_0x9e04('0x54')]:_0xbdfbe1[_0x9e04('0x4f')];if(!_0x176c3f[_0x9e04('0x50')][_0x9e04('0x56')](_0x9e04('0x57'))){_0x1abe49[_0x9e04('0x22')]=qs['limit'](_0x176c3f[_0x9e04('0x50')][_0x9e04('0x22')]);_0x1abe49[_0x9e04('0x20')]=qs[_0x9e04('0x20')](_0x176c3f[_0x9e04('0x50')]['offset']);}_0x1abe49[_0x9e04('0x58')]=qs[_0x9e04('0x59')](_0x176c3f[_0x9e04('0x50')][_0x9e04('0x59')]);_0x1abe49['where']=qs[_0x9e04('0x52')](_[_0x9e04('0x5b')](_0x176c3f[_0x9e04('0x50')],_0xbdfbe1['filters']));_0x1abe49[_0x9e04('0x5a')][_0x9e04('0x70')]=_0x40ae7f['id'];if(_0x176c3f[_0x9e04('0x50')][_0x9e04('0x5c')]){_0x1abe49[_0x9e04('0x5a')]=_[_0x9e04('0x5e')](_0x1abe49[_0x9e04('0x5a')],{'$or':_[_0x9e04('0x49')](_0x1abe49[_0x9e04('0x54')],function(_0x21df53){var _0xbba3d5={};_0xbba3d5[_0x21df53]={'$like':'%'+_0x176c3f[_0x9e04('0x50')][_0x9e04('0x5c')]+'%'};return _0xbba3d5;})});}if(_0x176c3f[_0x9e04('0x50')]['$gte']){var _0x593e25=_0x176c3f[_0x9e04('0x50')]['$gte']['split'](',');var _0x14557a={};_0x14557a[_0x593e25[0x0]]={'$gte':moment(_0x593e25[0x1])[_0x9e04('0x9b')](_0x9e04('0x9c'))};_0x1abe49['where']=_[_0x9e04('0x5e')](_0x1abe49['where'],_0x14557a);}_0x1abe49=_[_0x9e04('0x5e')]({},_0x1abe49,_0x176c3f[_0x9e04('0x69')]);return db[_0x9e04('0x9a')][_0x9e04('0x23')]({'where':_0x1abe49[_0x9e04('0x5a')]})[_0x9e04('0x27')](function(_0x58fcac){_0x7826dd[_0x9e04('0x23')]=_0x58fcac;if(_0x176c3f['query'][_0x9e04('0x68')]){_0x1abe49['include']=[{'all':!![]}];}return db[_0x9e04('0x9a')][_0x9e04('0x60')](_0x1abe49);})['then'](function(_0x39435d){if(_0x176c3f[_0x9e04('0x50')][_0x9e04('0x9d')]==='true'){for(var _0x4419ab=0x0;_0x4419ab<_0x39435d[_0x9e04('0x67')];_0x4419ab++){_0x39435d[_0x4419ab][_0x9e04('0x6b')]=juice(_0x39435d[_0x4419ab][_0x9e04('0x6b')]);}}_0x7826dd[_0x9e04('0x61')]=_0x39435d;return _0x7826dd;});}})[_0x9e04('0x27')](respondWithFilteredResult(_0x1ee681,_0x1abe49))['catch'](handleError(_0x1ee681,null));};exports[_0x9e04('0x2d')]=function(_0xc99f4d,_0x4e9bb2){var _0x414394,_0x57872c={},_0x267f59;if(_0xc99f4d['body']['to']){_0x267f59=_0xc99f4d[_0x9e04('0x6b')]['to']['split'](',')[0x0];}return db['MailAccount'][_0x9e04('0x6a')]({'where':{'id':_0xc99f4d['params']['id']},'include':[{'model':db[_0x9e04('0x9e')],'as':_0x9e04('0x9f'),'include':[{'model':db[_0x9e04('0x89')],'as':_0x9e04('0xa0'),'where':{'email':_0x267f59},'limit':0x1,'order':[[_0x9e04('0xa1'),'DESC']]}]},{'model':db[_0x9e04('0x65')],'as':_0x9e04('0x45'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x9e04('0x27')](handleEntityNotFound(_0x4e9bb2,null))[_0x9e04('0x27')](function(_0x22c732){if(!_0x22c732)return;_0x414394=_0x22c732;if(!_0x22c732[_0x9e04('0x45')])throw new Error('Smtp\x20configuration\x20not\x20found');if(_[_0x9e04('0x7a')](_0xc99f4d[_0x9e04('0x6b')][_0x9e04('0xa2')])){_0xc99f4d['body']['from']=util['format']('%s\x20<%s>',_0x22c732[_0x9e04('0x2c')],_0x22c732[_0x9e04('0xa3')]||_0x22c732['Smtp'][_0x9e04('0x39')]);}if(_0xc99f4d[_0x9e04('0x6b')]['attachments']&&_0xc99f4d[_0x9e04('0x6b')][_0x9e04('0xa4')][_0x9e04('0x67')]){for(var _0x181a69=0x0;_0x181a69<_0xc99f4d[_0x9e04('0x6b')]['attachments'][_0x9e04('0x67')];_0x181a69+=0x1){_0xc99f4d['body'][_0x9e04('0xa4')][_0x181a69]={'filename':_0xc99f4d[_0x9e04('0x6b')][_0x9e04('0xa4')][_0x181a69]['name'],'path':path[_0x9e04('0xa5')](config['root'],_0x9e04('0xa6'),_0xc99f4d[_0x9e04('0x6b')][_0x9e04('0xa4')][_0x181a69]['basename'])};}}var _0x10357f=_0x22c732['getSmtpOptions']();return respondWithRpcPromise(_0x9e04('0xa7'),_0x9e04('0xa8'),{'account':_0x10357f,'message':_0xc99f4d[_0x9e04('0x6b')]});})[_0x9e04('0x27')](function(_0x486992){if(!_0x486992)return;_0x57872c=_0x486992;if(!_0x414394[_0x9e04('0x9f')])throw new Error('List\x20not\x20found');if(_0x414394[_0x9e04('0x9f')][_0x9e04('0xa0')]['length'])return _0x414394['List'][_0x9e04('0xa0')][0x0];return db[_0x9e04('0x89')][_0x9e04('0x71')](_[_0x9e04('0xa')](_0xc99f4d[_0x9e04('0x6b')],{'firstName':_0xc99f4d[_0x9e04('0x6b')]['to'],'email':_0xc99f4d['body']['to'],'phone':_0xc99f4d['body']['to'],'ListId':_0x414394['ListId']}));})[_0x9e04('0x27')](function(_0x475f51){if(!_0x475f51)return;var _0x204c0c={'UserId':_0xc99f4d[_0x9e04('0x39')]['id'],'ContactId':_0x475f51['id'],'MailAccountId':_0x414394['id'],'inReplyTo':_0x57872c[_0x9e04('0xa9')],'to':_0xc99f4d['body'][_0x9e04('0xa2')],'cc':_0xc99f4d[_0x9e04('0x6b')]['cc'],'subject':_0xc99f4d[_0x9e04('0x6b')][_0x9e04('0xaa')],'attach':_0xc99f4d['body'][_0x9e04('0xab')],'firstMsgDirection':_0x9e04('0xac'),'lastMsgAt':moment()[_0x9e04('0x9b')](_0x9e04('0x9c')),'lastMsgDirection':_0x9e04('0xac'),'Messages':[_[_0x9e04('0x5e')](_0xc99f4d[_0x9e04('0x6b')],{'messageId':_0x57872c[_0x9e04('0xa9')],'sentAt':moment()[_0x9e04('0x9b')](_0x9e04('0x9c')),'read':!![],'MailAccountId':_0x414394['id'],'UserId':_0xc99f4d['user']['id'],'ContactId':_0x475f51['id']})]};if(_0xc99f4d[_0x9e04('0x6b')]['Interaction']){_0x204c0c=_[_0x9e04('0x5e')](_0x204c0c,_0xc99f4d[_0x9e04('0x6b')]['Interaction']);}return db['MailInteraction'][_0x9e04('0x71')](_0x204c0c,{'include':[{'model':db['MailMessage'],'as':_0x9e04('0xad')}]});})[_0x9e04('0x27')](respondWithResult(_0x4e9bb2,null))[_0x9e04('0x62')](handleError(_0x4e9bb2,null));};exports['verifySmtp']=function(_0x4fe726,_0x18033d){return db['MailAccount'][_0x9e04('0x6a')]({'where':{'id':_0x4fe726[_0x9e04('0x64')]['id']},'include':[{'model':db['MailServerOut'],'as':_0x9e04('0x45'),'raw':!![],'include':[{'model':db[_0x9e04('0xae')],'as':'CloudProvider','raw':!![]}]}]})[_0x9e04('0x27')](handleEntityNotFound(_0x18033d,null))['then'](function(_0x9aec15){if(!_0x9aec15[_0x9e04('0x45')])return;var _0x5baa95=_0x9aec15[_0x9e04('0xaf')]();return respondWithRpcPromise(_0x9e04('0xb0'),'verifySmtp',{'account':_0x5baa95});})[_0x9e04('0x27')](respondWithResult(_0x18033d,null))[_0x9e04('0x62')](handleError(_0x18033d,null));};exports[_0x9e04('0x28')]=function(_0x11b163,_0x2d8788){return db['MailAccount'][_0x9e04('0x6a')]({'where':{'id':_0x11b163[_0x9e04('0x64')]['id']}})[_0x9e04('0x27')](handleEntityNotFound(_0x2d8788,null))['then'](function(_0x58fe8d){if(_0x58fe8d&&_0x58fe8d[_0x9e04('0x42')]){throw new db[(_0x9e04('0xb1'))][(_0x9e04('0xb2'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x58fe8d;})[_0x9e04('0x27')](removeEntity(_0x2d8788,null))[_0x9e04('0x62')](handleError(_0x2d8788,null));};exports['addAgents']=function(_0xd970b5,_0x3c0e55){return db['MailAccount']['find']({'where':{'id':_0xd970b5[_0x9e04('0x64')]['id']}})[_0x9e04('0x27')](handleEntityNotFound(_0x3c0e55,null))[_0x9e04('0x27')](function(_0x438e13){if(_0x438e13){return _0x438e13['addAgents'](_0xd970b5['body'][_0x9e04('0x74')],_[_0x9e04('0xb3')](_0xd970b5[_0x9e04('0x6b')],[_0x9e04('0x74'),'id'])||{})[_0x9e04('0xb4')](function(_0x4fddb5){for(var _0x273b85=0x0;_0x273b85<_0xd970b5[_0x9e04('0x6b')][_0x9e04('0x74')][_0x9e04('0x67')];_0x273b85+=0x1){socket['emit']('userMailAccount:save',{'UserId':Number(_0xd970b5[_0x9e04('0x6b')][_0x9e04('0x74')][_0x273b85]),'MailAccountId':Number(_0xd970b5['params']['id'])});}return _0x4fddb5;});}})[_0x9e04('0x27')](respondWithResult(_0x3c0e55,null))[_0x9e04('0x62')](handleError(_0x3c0e55,null));};exports[_0x9e04('0xb5')]=function(_0x2c77d4,_0x585f02){return db[_0x9e04('0x4a')][_0x9e04('0x6a')]({'where':{'id':_0x2c77d4['params']['id']}})[_0x9e04('0x27')](handleEntityNotFound(_0x585f02,null))[_0x9e04('0x27')](function(_0x1fc661){if(_0x1fc661){return _0x1fc661[_0x9e04('0xb5')](_0x2c77d4[_0x9e04('0x50')][_0x9e04('0x74')])[_0x9e04('0x27')](function(){if(_[_0x9e04('0xb6')](_0x2c77d4[_0x9e04('0x50')][_0x9e04('0x74')])){for(var _0x19db70=0x0;_0x19db70<_0x2c77d4[_0x9e04('0x50')][_0x9e04('0x74')][_0x9e04('0x67')];_0x19db70+=0x1){socket['emit'](_0x9e04('0xb7'),{'UserId':Number(_0x2c77d4[_0x9e04('0x50')][_0x9e04('0x74')][_0x19db70]),'MailAccountId':Number(_0x2c77d4[_0x9e04('0x64')]['id'])});}}else{socket[_0x9e04('0xb8')](_0x9e04('0xb7'),{'UserId':Number(_0x2c77d4[_0x9e04('0x50')]['ids']),'MailAccountId':Number(_0x2c77d4[_0x9e04('0x64')]['id'])});}});}})['then'](respondWithStatusCode(_0x585f02,null))[_0x9e04('0x62')](handleError(_0x585f02,null));};exports[_0x9e04('0xb9')]=function(_0x1c28ee,_0x4035e1){var _0x4635f1={};var _0x5d188e={};var _0x50c8de;var _0x216f50;return db[_0x9e04('0x4a')]['findOne']({'where':{'id':_0x1c28ee[_0x9e04('0x64')]['id']}})[_0x9e04('0x27')](handleEntityNotFound(_0x4035e1,null))['then'](function(_0x5813ca){if(_0x5813ca){_0x50c8de=_0x5813ca;_0x5d188e[_0x9e04('0x4f')]=_[_0x9e04('0x51')](db[_0x9e04('0x8b')][_0x9e04('0x4b')]);_0x5d188e[_0x9e04('0x50')]=_[_0x9e04('0x51')](_0x1c28ee[_0x9e04('0x50')]);_0x5d188e[_0x9e04('0x52')]=_[_0x9e04('0x53')](_0x5d188e['model'],_0x5d188e[_0x9e04('0x50')]);_0x4635f1['attributes']=_['intersection'](_0x5d188e[_0x9e04('0x4f')],qs['fields'](_0x1c28ee[_0x9e04('0x50')][_0x9e04('0x55')]));_0x4635f1[_0x9e04('0x54')]=_0x4635f1[_0x9e04('0x54')]['length']?_0x4635f1[_0x9e04('0x54')]:_0x5d188e[_0x9e04('0x4f')];_0x4635f1[_0x9e04('0x58')]=qs[_0x9e04('0x59')](_0x1c28ee[_0x9e04('0x50')][_0x9e04('0x59')]);_0x4635f1['where']=qs[_0x9e04('0x52')](_[_0x9e04('0x5b')](_0x1c28ee[_0x9e04('0x50')],_0x5d188e['filters']));if(_0x1c28ee[_0x9e04('0x50')]['filter']){_0x4635f1[_0x9e04('0x5a')]=_[_0x9e04('0x5e')](_0x4635f1[_0x9e04('0x5a')],{'$or':_[_0x9e04('0x49')](_0x4635f1['attributes'],function(_0x19357a){var _0x2af281={};_0x2af281[_0x19357a]={'$like':'%'+_0x1c28ee[_0x9e04('0x50')]['filter']+'%'};return _0x2af281;})});}_0x4635f1=_[_0x9e04('0x5e')]({},_0x4635f1,_0x1c28ee[_0x9e04('0x69')]);return _0x50c8de[_0x9e04('0xb9')](_0x4635f1);}})['then'](function(_0x2ff7aa){if(_0x2ff7aa){_0x216f50=_0x2ff7aa[_0x9e04('0x67')];if(!_0x1c28ee[_0x9e04('0x50')]['hasOwnProperty'](_0x9e04('0x57'))){_0x4635f1[_0x9e04('0x22')]=qs[_0x9e04('0x22')](_0x1c28ee[_0x9e04('0x50')][_0x9e04('0x22')]);_0x4635f1[_0x9e04('0x20')]=qs['offset'](_0x1c28ee[_0x9e04('0x50')][_0x9e04('0x20')]);}return _0x50c8de[_0x9e04('0xb9')](_0x4635f1);}})[_0x9e04('0x27')](function(_0x29a057){if(_0x29a057){return _0x29a057?{'count':_0x216f50,'rows':_0x29a057}:null;}})['then'](respondWithResult(_0x4035e1,null))[_0x9e04('0x62')](handleError(_0x4035e1,null));}; \ No newline at end of file +var _0x3de2=['from','%s\x20<%s>','email','attachments','join','basename','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','ListId','messageId','subject','attach','out','Interaction','Messages','CloudProvider','VerifySmtp','ValidationError','addAgents','omit','spread','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','moment','bluebird','lodash','juice','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','jayson/promise','http','request','then','request\x20sent','debug','error','MailAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','update','destroy','get','UserProfileResource','stack','send','gmail','imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.mail.yahoo.com','smtp.office365.com','user','username','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','password','Imap','Smtp','MailServerIn','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','find','body','custom','params','MailServerOut','Mail\x20Account\x20not\x20found','addDisposition','MailAccountId','create','getDispositions','hasOwnProperty','Disposition','removeDispositions','ids','getAnswers','findOne','CannedAnswer','removeAnswers','name','provider','active','description','role','UserProfileSection','userProfileId','autoAssociation','getImap','removeImap','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','User','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','Transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','CmContact','Contacts','updatedAt','DESC','Smtp\x20configuration\x20not\x20found','isNil'];(function(_0x2977b8,_0x4fc62b){var _0x5c89a9=function(_0x35c0a3){while(--_0x35c0a3){_0x2977b8['push'](_0x2977b8['shift']());}};_0x5c89a9(++_0x4fc62b);}(_0x3de2,0x18f));var _0x23de=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x3de2[_0x1573ea];return _0x51c0e2;};'use strict';var moment=require(_0x23de('0x0'));var BPromise=require(_0x23de('0x1'));var util=require('util');var path=require('path');var _=require(_0x23de('0x2'));var juice=require(_0x23de('0x3'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x23de('0x4'))(_0x23de('0x5'));var config=require(_0x23de('0x6'));var db=require(_0x23de('0x7'))['db'];config[_0x23de('0x8')]=_[_0x23de('0x9')](config[_0x23de('0x8')],{'host':_0x23de('0xa'),'port':0x18eb});var socket=require(_0x23de('0xb'))(new Redis(config[_0x23de('0x8')]));require(_0x23de('0xc'))['register'](socket);var jayson=require(_0x23de('0xd'));var client=jayson['client'][_0x23de('0xe')]({'port':0x232b});function respondWithRpcPromise(_0x41470b,_0x4df429,_0x3210b0,_0x199d13){return new BPromise(function(_0x4ae1d9,_0x13da97){var _0x47c329=_0x199d13||client;return _0x47c329[_0x23de('0xf')](_0x41470b,_0x3210b0)[_0x23de('0x10')](function(_0xc613dc){logger['info']('MailAccount,\x20%s,\x20%s',_0x4df429,_0x23de('0x11'));logger[_0x23de('0x12')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x4df429,_0x23de('0x11'),JSON['stringify'](_0xc613dc));if(_0xc613dc[_0x23de('0x13')]){if(_0xc613dc[_0x23de('0x13')]['code']===0x1f4){logger['error'](_0x23de('0x14'),_0x4df429,_0xc613dc[_0x23de('0x13')][_0x23de('0x15')]);return _0x13da97(_0xc613dc[_0x23de('0x13')][_0x23de('0x15')]);}logger[_0x23de('0x13')](_0x23de('0x14'),_0x4df429,_0xc613dc[_0x23de('0x13')][_0x23de('0x15')]);return _0x4ae1d9(_0xc613dc[_0x23de('0x13')][_0x23de('0x15')]);}else{logger[_0x23de('0x16')]('MailAccount,\x20%s,\x20%s',_0x4df429,'request\x20sent');_0x4ae1d9(_0xc613dc[_0x23de('0x17')][_0x23de('0x15')]);}})[_0x23de('0x18')](function(_0x5c7588){logger[_0x23de('0x13')](_0x23de('0x14'),_0x4df429,_0x5c7588);_0x13da97(_0x5c7588);});});}function respondWithStatusCode(_0x2f1f61,_0x39e730){_0x39e730=_0x39e730||0xcc;return function(_0x224273){if(_0x224273){return _0x2f1f61[_0x23de('0x19')](_0x39e730);}return _0x2f1f61['status'](_0x39e730)[_0x23de('0x1a')]();};}function respondWithResult(_0x423306,_0x2da51e){_0x2da51e=_0x2da51e||0xc8;return function(_0x653cf8){if(_0x653cf8){return _0x423306[_0x23de('0x1b')](_0x2da51e)[_0x23de('0x1c')](_0x653cf8);}};}function respondWithFilteredResult(_0x552238,_0x269057){return function(_0x2064c7){if(_0x2064c7){var _0x3d48a1=typeof _0x269057['offset']===_0x23de('0x1d')&&typeof _0x269057[_0x23de('0x1e')]===_0x23de('0x1d');var _0x1fd5ea=_0x2064c7[_0x23de('0x1f')];var _0x13f38d=_0x3d48a1?0x0:_0x269057[_0x23de('0x20')];var _0x1c34f5=_0x3d48a1?_0x2064c7['count']:_0x269057[_0x23de('0x20')]+_0x269057[_0x23de('0x1e')];var _0x482463;if(_0x1c34f5>=_0x1fd5ea){_0x1c34f5=_0x1fd5ea;_0x482463=0xc8;}else{_0x482463=0xce;}_0x552238[_0x23de('0x1b')](_0x482463);return _0x552238[_0x23de('0x21')](_0x23de('0x22'),_0x13f38d+'-'+_0x1c34f5+'/'+_0x1fd5ea)['json'](_0x2064c7);}return null;};}function saveUpdates(_0x327ba0){return function(_0x527408){if(_0x527408){return _0x527408[_0x23de('0x23')](_0x327ba0)[_0x23de('0x10')](function(_0x1e581e){return _0x1e581e;});}return null;};}function removeEntity(_0x4593d8){return function(_0x2ccb94){if(_0x2ccb94){return _0x2ccb94[_0x23de('0x24')]()['then'](function(){var _0x421bc1=_0x2ccb94[_0x23de('0x25')]({'plain':!![]});var _0x2ee0dc='MailAccounts';return db[_0x23de('0x26')][_0x23de('0x24')]({'where':{'type':_0x2ee0dc,'resourceId':_0x421bc1['id']}})[_0x23de('0x10')](function(){return _0x2ccb94;});})[_0x23de('0x10')](function(){_0x4593d8['status'](0xcc)[_0x23de('0x1a')]();});}};}function handleEntityNotFound(_0x2f75df){return function(_0x618ae4){if(!_0x618ae4){_0x2f75df['sendStatus'](0x194);}return _0x618ae4;};}function handleError(_0x540030,_0x48e3fc){_0x48e3fc=_0x48e3fc||0x1f4;return function(_0xf662b3){logger['error'](_0xf662b3[_0x23de('0x27')]);if(_0xf662b3['name']){delete _0xf662b3['name'];}_0x540030[_0x23de('0x1b')](_0x48e3fc)[_0x23de('0x28')](_0xf662b3);};}function getImapHost(_0x3de2be){switch(_0x3de2be){case _0x23de('0x29'):return _0x23de('0x2a');case'yahoo':return _0x23de('0x2b');case _0x23de('0x2c'):return _0x23de('0x2d');case _0x23de('0x2e'):return'outlook.office365.com';}throw new Error(_0x23de('0x2f'),_0x3de2be);}function getSmtpHost(_0x2c1ce9){switch(_0x2c1ce9){case _0x23de('0x29'):return _0x23de('0x30');case'yahoo':return _0x23de('0x31');case'hotmail':return'smtp-mail.outlook.com';case'outlook365':return _0x23de('0x32');}throw new Error(_0x23de('0x2f'),_0x2c1ce9);}function getAuthenticationOptions(_0x5821dd,_0x534a63){var _0x3a96e6={};var _0xd407cd={};if(_0x5821dd){_0x3a96e6[_0x23de('0x33')]=_0xd407cd[_0x23de('0x33')]=_0x534a63[_0x23de('0x34')];_0x3a96e6['password']=_0xd407cd[_0x23de('0x35')]=_0x534a63['password'];if(_0x534a63['modernAuthentication']){_0x3a96e6[_0x23de('0x36')]=_0xd407cd[_0x23de('0x36')]=!![];_0x3a96e6[_0x23de('0x37')]=_0xd407cd[_0x23de('0x37')]=_0x534a63[_0x23de('0x37')];_0x3a96e6['password']=_0xd407cd[_0x23de('0x35')]=null;}else{_0x3a96e6[_0x23de('0x37')]=_0xd407cd[_0x23de('0x37')]=null;}_0x3a96e6[_0x23de('0x38')]=getImapHost(_0x5821dd);_0x3a96e6[_0x23de('0x39')]=0x3e1;_0xd407cd[_0x23de('0x38')]=getSmtpHost(_0x5821dd);_0xd407cd[_0x23de('0x39')]=0x24b;_0xd407cd[_0x23de('0x3a')]=![];_0x3a96e6[_0x23de('0x3b')]=_0xd407cd[_0x23de('0x3b')]=null;}else{if(_0x534a63[_0x23de('0x3c')]){_0x3a96e6[_0x23de('0x33')]=_0xd407cd[_0x23de('0x33')]=_0x534a63[_0x23de('0x34')];_0x3a96e6['password']=_0xd407cd[_0x23de('0x35')]=_0x534a63[_0x23de('0x3d')];}else{_0x3a96e6['authentication']=_0xd407cd['authentication']=![];_0x3a96e6['user']=_0xd407cd['user']=null;_0x3a96e6[_0x23de('0x3d')]=_0xd407cd[_0x23de('0x35')]=null;}_0x3a96e6['host']=_0x534a63[_0x23de('0x3e')][_0x23de('0x38')];_0x3a96e6[_0x23de('0x39')]=_0x534a63[_0x23de('0x3e')][_0x23de('0x39')];_0xd407cd[_0x23de('0x38')]=_0x534a63[_0x23de('0x3f')][_0x23de('0x38')];_0xd407cd[_0x23de('0x39')]=_0x534a63[_0x23de('0x3f')][_0x23de('0x39')];}return{'Imap':_0x3a96e6,'Smtp':_0xd407cd};}exports['index']=function(_0x22b714,_0x51ed2f){var _0x1b78a4={'include':[{'model':db[_0x23de('0x40')],'as':_0x23de('0x3e')},{'model':db['MailServerOut'],'as':_0x23de('0x3f')},{'model':db[_0x23de('0x41')],'as':_0x23de('0x42')}]},_0x385357={},_0x332e1={'count':0x0,'rows':[]};var _0x44cda7=_[_0x23de('0x43')](db[_0x23de('0x44')][_0x23de('0x45')],function(_0x1b0bf0){return{'name':_0x1b0bf0[_0x23de('0x46')],'type':_0x1b0bf0[_0x23de('0x47')][_0x23de('0x48')]};});_0x385357[_0x23de('0x49')]=_[_0x23de('0x43')](_0x44cda7,'name');_0x385357['query']=_[_0x23de('0x4a')](_0x22b714[_0x23de('0x4b')]);_0x385357[_0x23de('0x4c')]=_[_0x23de('0x4d')](_0x385357[_0x23de('0x49')],_0x385357[_0x23de('0x4b')]);_0x1b78a4['attributes']=_[_0x23de('0x4d')](_0x385357[_0x23de('0x49')],qs[_0x23de('0x4e')](_0x22b714[_0x23de('0x4b')][_0x23de('0x4e')]));_0x1b78a4[_0x23de('0x4f')]=_0x1b78a4[_0x23de('0x4f')][_0x23de('0x50')]?_0x1b78a4['attributes']:_0x385357[_0x23de('0x49')];if(!_0x22b714[_0x23de('0x4b')]['hasOwnProperty'](_0x23de('0x51'))){_0x1b78a4[_0x23de('0x1e')]=qs[_0x23de('0x1e')](_0x22b714['query'][_0x23de('0x1e')]);_0x1b78a4[_0x23de('0x20')]=qs[_0x23de('0x20')](_0x22b714[_0x23de('0x4b')]['offset']);}_0x1b78a4[_0x23de('0x52')]=qs[_0x23de('0x53')](_0x22b714['query'][_0x23de('0x53')]);_0x1b78a4['where']=qs[_0x23de('0x4c')](_[_0x23de('0x54')](_0x22b714[_0x23de('0x4b')],_0x385357[_0x23de('0x4c')]),_0x44cda7);if(_0x22b714[_0x23de('0x4b')][_0x23de('0x55')]){_0x1b78a4[_0x23de('0x56')]=_['merge'](_0x1b78a4[_0x23de('0x56')],{'$or':_['map'](_0x44cda7,function(_0x3220ac){if(_0x3220ac[_0x23de('0x47')]!=='VIRTUAL'){var _0x4e04e0={};_0x4e04e0[_0x3220ac['name']]={'$like':'%'+_0x22b714[_0x23de('0x4b')]['filter']+'%'};return _0x4e04e0;}})});}_0x1b78a4=_[_0x23de('0x57')]({},_0x1b78a4,_0x22b714[_0x23de('0x58')]);var _0xeb5575={'where':_0x1b78a4[_0x23de('0x56')]};return db[_0x23de('0x44')][_0x23de('0x1f')](_0xeb5575)[_0x23de('0x10')](function(_0x5d33e2){_0x332e1['count']=_0x5d33e2;if(_0x22b714[_0x23de('0x4b')][_0x23de('0x59')]){_0x1b78a4[_0x23de('0x5a')]=[{'all':!![]}];}return db[_0x23de('0x44')][_0x23de('0x5b')](_0x1b78a4);})['then'](function(_0x3f26a1){_0x332e1[_0x23de('0x5c')]=_0x3f26a1;return _0x332e1;})[_0x23de('0x10')](respondWithFilteredResult(_0x51ed2f,_0x1b78a4))[_0x23de('0x18')](handleError(_0x51ed2f,null));};exports['show']=function(_0x37a1f6,_0xcdc983){var _0x4097c0={'raw':![],'where':{'id':_0x37a1f6['params']['id']},'include':[{'model':db[_0x23de('0x40')],'as':_0x23de('0x3e')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x346cbd={};_0x346cbd['model']=_[_0x23de('0x4a')](db[_0x23de('0x44')]['rawAttributes']);_0x346cbd['query']=_[_0x23de('0x4a')](_0x37a1f6[_0x23de('0x4b')]);_0x346cbd[_0x23de('0x4c')]=_[_0x23de('0x4d')](_0x346cbd['model'],_0x346cbd[_0x23de('0x4b')]);_0x4097c0[_0x23de('0x4f')]=_[_0x23de('0x4d')](_0x346cbd[_0x23de('0x49')],qs[_0x23de('0x4e')](_0x37a1f6[_0x23de('0x4b')][_0x23de('0x4e')]));_0x4097c0[_0x23de('0x4f')]=_0x4097c0[_0x23de('0x4f')][_0x23de('0x50')]?_0x4097c0[_0x23de('0x4f')]:_0x346cbd[_0x23de('0x49')];if(_0x37a1f6['query'][_0x23de('0x59')]){_0x4097c0[_0x23de('0x5a')]=[{'all':!![]}];}_0x4097c0=_[_0x23de('0x57')]({},_0x4097c0,_0x37a1f6['options']);return db['MailAccount'][_0x23de('0x5d')](_0x4097c0)[_0x23de('0x10')](handleEntityNotFound(_0xcdc983,null))[_0x23de('0x10')](respondWithResult(_0xcdc983,null))[_0x23de('0x18')](handleError(_0xcdc983,null));};exports[_0x23de('0x23')]=function(_0x3c6f5e,_0x58f433){if(_0x3c6f5e[_0x23de('0x5e')]['id']){delete _0x3c6f5e[_0x23de('0x5e')]['id'];}var _0x3f6322=_0x3c6f5e[_0x23de('0x5e')]['provider']===_0x23de('0x5f')?null:_0x3c6f5e[_0x23de('0x5e')]['provider'];var _0x5d33f2=_0x3c6f5e['body'][_0x23de('0x3e')]||{};var _0x21ad12=_0x3c6f5e[_0x23de('0x5e')][_0x23de('0x3f')]||{};if(_0x3f6322){_0x5d33f2['host']=getImapHost(_0x3f6322);_0x5d33f2[_0x23de('0x39')]=0x3e1;_0x21ad12[_0x23de('0x38')]=getSmtpHost(_0x3f6322);_0x21ad12[_0x23de('0x39')]=0x24b;_0x21ad12['secure']=![];}if(_0x21ad12[_0x23de('0x36')]){_0x21ad12['secure']=![];}else{_0x21ad12[_0x23de('0x37')]=null;}if(!_0x5d33f2[_0x23de('0x36')])_0x5d33f2[_0x23de('0x37')]=null;_0x3c6f5e[_0x23de('0x5e')][_0x23de('0x3e')]=_0x5d33f2;_0x3c6f5e[_0x23de('0x5e')][_0x23de('0x3f')]=_0x21ad12;return db[_0x23de('0x44')][_0x23de('0x5d')]({'where':{'id':_0x3c6f5e[_0x23de('0x60')]['id']},'include':[{'model':db[_0x23de('0x40')],'as':_0x23de('0x3e')},{'model':db[_0x23de('0x61')],'as':_0x23de('0x3f')},{'model':db[_0x23de('0x41')],'as':_0x23de('0x42')}]})[_0x23de('0x10')](handleEntityNotFound(_0x58f433,null))[_0x23de('0x10')](function(_0xaabbf9){if(!_0xaabbf9)throw new Error(_0x23de('0x62'));if(_0xaabbf9['service'])delete _0x3c6f5e[_0x23de('0x5e')][_0x23de('0x3e')];return _0xaabbf9;})[_0x23de('0x10')](saveUpdates(_0x3c6f5e['body'],null))[_0x23de('0x10')](function(_0x4995fc){if(!_0x3c6f5e[_0x23de('0x5e')][_0x23de('0x3e')])return _0x4995fc;return db['MailServerIn'][_0x23de('0x23')](_0x3c6f5e['body'][_0x23de('0x3e')],{'where':{'MailAccountId':_0x4995fc['id']}})[_0x23de('0x10')](function(){return _0x4995fc;});})['then'](function(_0x454c7c){if(!_0x3c6f5e[_0x23de('0x5e')]['Smtp'])return _0x454c7c;return db['MailServerOut'][_0x23de('0x23')](_0x3c6f5e[_0x23de('0x5e')]['Smtp'],{'where':{'MailAccountId':_0x454c7c['id']}})['then'](function(){return _0x454c7c;});})[_0x23de('0x10')](respondWithResult(_0x58f433,null))['catch'](handleError(_0x58f433,null));};exports['describe']=function(_0x34c47b,_0x253871){return db[_0x23de('0x44')]['describe']()[_0x23de('0x10')](respondWithResult(_0x253871,null))[_0x23de('0x18')](handleError(_0x253871,null));};exports[_0x23de('0x63')]=function(_0x41fca5,_0x4d82f8){if(_0x41fca5[_0x23de('0x5e')]['id']){delete _0x41fca5[_0x23de('0x5e')]['id'];}return db[_0x23de('0x44')][_0x23de('0x5d')]({'where':{'id':_0x41fca5[_0x23de('0x60')]['id']}})[_0x23de('0x10')](handleEntityNotFound(_0x4d82f8,null))[_0x23de('0x10')](function(_0x5ed974){if(_0x5ed974){_0x41fca5[_0x23de('0x5e')][_0x23de('0x64')]=_0x5ed974['id'];return db['Disposition'][_0x23de('0x65')](_0x41fca5[_0x23de('0x5e')]);}})['then'](respondWithResult(_0x4d82f8,null))[_0x23de('0x18')](handleError(_0x4d82f8,null));};exports[_0x23de('0x66')]=function(_0x4a9d8a,_0x4e6d13){var _0x2697fb={'raw':![],'where':{}};var _0x31de32={};var _0x4f0e8a={'count':0x0,'rows':[]};return db[_0x23de('0x44')]['findOne']({'where':{'id':_0x4a9d8a[_0x23de('0x60')]['id']}})['then'](handleEntityNotFound(_0x4e6d13,null))[_0x23de('0x10')](function(_0x112ae9){if(_0x112ae9){_0x31de32[_0x23de('0x49')]=_[_0x23de('0x4a')](db['Disposition'][_0x23de('0x45')]);_0x31de32[_0x23de('0x4b')]=_[_0x23de('0x4a')](_0x4a9d8a[_0x23de('0x4b')]);_0x31de32['filters']=_['intersection'](_0x31de32[_0x23de('0x49')],_0x31de32[_0x23de('0x4b')]);_0x2697fb[_0x23de('0x4f')]=_[_0x23de('0x4d')](_0x31de32['model'],qs[_0x23de('0x4e')](_0x4a9d8a[_0x23de('0x4b')][_0x23de('0x4e')]));_0x2697fb['attributes']=_0x2697fb[_0x23de('0x4f')][_0x23de('0x50')]?_0x2697fb[_0x23de('0x4f')]:_0x31de32['model'];if(!_0x4a9d8a[_0x23de('0x4b')][_0x23de('0x67')](_0x23de('0x51'))){_0x2697fb['limit']=qs[_0x23de('0x1e')](_0x4a9d8a[_0x23de('0x4b')]['limit']);_0x2697fb[_0x23de('0x20')]=qs[_0x23de('0x20')](_0x4a9d8a[_0x23de('0x4b')][_0x23de('0x20')]);}_0x2697fb['order']=qs[_0x23de('0x53')](_0x4a9d8a['query']['sort']);_0x2697fb[_0x23de('0x56')]=qs[_0x23de('0x4c')](_['pick'](_0x4a9d8a[_0x23de('0x4b')],_0x31de32['filters']));_0x2697fb[_0x23de('0x56')]['MailAccountId']=_0x112ae9['id'];if(_0x4a9d8a[_0x23de('0x4b')][_0x23de('0x55')]){_0x2697fb['where']=_['merge'](_0x2697fb[_0x23de('0x56')],{'$or':_[_0x23de('0x43')](_0x2697fb[_0x23de('0x4f')],function(_0x4f3c03){var _0x86e31f={};_0x86e31f[_0x4f3c03]={'$like':'%'+_0x4a9d8a[_0x23de('0x4b')][_0x23de('0x55')]+'%'};return _0x86e31f;})});}_0x2697fb=_['merge']({},_0x2697fb,_0x4a9d8a[_0x23de('0x58')]);return db['Disposition'][_0x23de('0x1f')]({'where':_0x2697fb[_0x23de('0x56')]})[_0x23de('0x10')](function(_0xa92714){_0x4f0e8a[_0x23de('0x1f')]=_0xa92714;if(_0x4a9d8a[_0x23de('0x4b')][_0x23de('0x59')]){_0x2697fb[_0x23de('0x5a')]=[{'all':!![]}];}return db[_0x23de('0x68')]['findAll'](_0x2697fb);})['then'](function(_0x11812c){_0x4f0e8a[_0x23de('0x5c')]=_0x11812c;return _0x4f0e8a;});}})[_0x23de('0x10')](respondWithFilteredResult(_0x4e6d13,_0x2697fb))[_0x23de('0x18')](handleError(_0x4e6d13,null));};exports[_0x23de('0x69')]=function(_0x1d0bea,_0x5d2874){return db['MailAccount'][_0x23de('0x5d')]({'where':{'id':_0x1d0bea[_0x23de('0x60')]['id']}})[_0x23de('0x10')](handleEntityNotFound(_0x5d2874,null))[_0x23de('0x10')](function(_0x2dd42e){if(_0x2dd42e){return _0x2dd42e[_0x23de('0x69')](_0x1d0bea[_0x23de('0x4b')][_0x23de('0x6a')]);}})[_0x23de('0x10')](respondWithStatusCode(_0x5d2874,null))[_0x23de('0x18')](handleError(_0x5d2874,null));};exports['addAnswer']=function(_0x448f54,_0x2a8af0){if(_0x448f54[_0x23de('0x5e')]['id']){delete _0x448f54[_0x23de('0x5e')]['id'];}return db[_0x23de('0x44')][_0x23de('0x5d')]({'where':{'id':_0x448f54[_0x23de('0x60')]['id']}})[_0x23de('0x10')](handleEntityNotFound(_0x2a8af0,null))[_0x23de('0x10')](function(_0x58ab73){if(_0x58ab73){_0x448f54[_0x23de('0x5e')][_0x23de('0x64')]=_0x58ab73['id'];return db['CannedAnswer']['create'](_0x448f54['body']);}})[_0x23de('0x10')](respondWithResult(_0x2a8af0,null))[_0x23de('0x18')](handleError(_0x2a8af0,null));};exports[_0x23de('0x6b')]=function(_0x282561,_0xc0923b){var _0x2331a5={'raw':![],'where':{}};var _0x2e7875={};var _0x185c8e={'count':0x0,'rows':[]};return db[_0x23de('0x44')][_0x23de('0x6c')]({'where':{'id':_0x282561[_0x23de('0x60')]['id']}})[_0x23de('0x10')](handleEntityNotFound(_0xc0923b,null))[_0x23de('0x10')](function(_0x3c63c7){if(_0x3c63c7){_0x2e7875['model']=_[_0x23de('0x4a')](db[_0x23de('0x6d')]['rawAttributes']);_0x2e7875[_0x23de('0x4b')]=_[_0x23de('0x4a')](_0x282561[_0x23de('0x4b')]);_0x2e7875[_0x23de('0x4c')]=_['intersection'](_0x2e7875[_0x23de('0x49')],_0x2e7875['query']);_0x2331a5[_0x23de('0x4f')]=_[_0x23de('0x4d')](_0x2e7875[_0x23de('0x49')],qs[_0x23de('0x4e')](_0x282561[_0x23de('0x4b')][_0x23de('0x4e')]));_0x2331a5[_0x23de('0x4f')]=_0x2331a5[_0x23de('0x4f')][_0x23de('0x50')]?_0x2331a5[_0x23de('0x4f')]:_0x2e7875[_0x23de('0x49')];if(!_0x282561[_0x23de('0x4b')][_0x23de('0x67')](_0x23de('0x51'))){_0x2331a5[_0x23de('0x1e')]=qs[_0x23de('0x1e')](_0x282561[_0x23de('0x4b')]['limit']);_0x2331a5[_0x23de('0x20')]=qs[_0x23de('0x20')](_0x282561[_0x23de('0x4b')]['offset']);}_0x2331a5['order']=qs['sort'](_0x282561[_0x23de('0x4b')][_0x23de('0x53')]);_0x2331a5[_0x23de('0x56')]=qs['filters'](_[_0x23de('0x54')](_0x282561[_0x23de('0x4b')],_0x2e7875[_0x23de('0x4c')]));_0x2331a5[_0x23de('0x56')][_0x23de('0x64')]=_0x3c63c7['id'];if(_0x282561[_0x23de('0x4b')][_0x23de('0x55')]){_0x2331a5[_0x23de('0x56')]=_[_0x23de('0x57')](_0x2331a5[_0x23de('0x56')],{'$or':_[_0x23de('0x43')](_0x2331a5[_0x23de('0x4f')],function(_0x1c4108){var _0x4aad2e={};_0x4aad2e[_0x1c4108]={'$like':'%'+_0x282561[_0x23de('0x4b')][_0x23de('0x55')]+'%'};return _0x4aad2e;})});}_0x2331a5=_[_0x23de('0x57')]({},_0x2331a5,_0x282561[_0x23de('0x58')]);return db[_0x23de('0x6d')][_0x23de('0x1f')]({'where':_0x2331a5[_0x23de('0x56')]})[_0x23de('0x10')](function(_0x39a005){_0x185c8e['count']=_0x39a005;if(_0x282561[_0x23de('0x4b')][_0x23de('0x59')]){_0x2331a5['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x2331a5);})[_0x23de('0x10')](function(_0x5ecad4){_0x185c8e[_0x23de('0x5c')]=_0x5ecad4;return _0x185c8e;});}})[_0x23de('0x10')](respondWithFilteredResult(_0xc0923b,_0x2331a5))['catch'](handleError(_0xc0923b,null));};exports[_0x23de('0x6e')]=function(_0x1e91d6,_0x3227df){return db[_0x23de('0x44')][_0x23de('0x5d')]({'where':{'id':_0x1e91d6['params']['id']}})['then'](handleEntityNotFound(_0x3227df,null))[_0x23de('0x10')](function(_0x41a496){if(_0x41a496){return _0x41a496['removeAnswers'](_0x1e91d6[_0x23de('0x4b')][_0x23de('0x6a')]);}})['then'](respondWithStatusCode(_0x3227df,null))[_0x23de('0x18')](handleError(_0x3227df,null));};exports[_0x23de('0x65')]=function(_0x5d2ca5,_0x481497){var _0x45f07a={'name':_0x5d2ca5[_0x23de('0x5e')][_0x23de('0x6f')],'key':_0x5d2ca5['body']['key'],'provider':_0x5d2ca5[_0x23de('0x5e')][_0x23de('0x70')]===_0x23de('0x5f')?null:_0x5d2ca5[_0x23de('0x5e')][_0x23de('0x70')],'email':_0x5d2ca5[_0x23de('0x5e')]['email'],'ListId':_0x5d2ca5[_0x23de('0x5e')]['ListId'],'active':!_['isNil'](_0x5d2ca5[_0x23de('0x5e')][_0x23de('0x71')])?_0x5d2ca5[_0x23de('0x5e')][_0x23de('0x71')]:!![],'description':_0x5d2ca5[_0x23de('0x5e')][_0x23de('0x72')]||null};var _0x3bb06d=getAuthenticationOptions(_0x45f07a['provider'],_0x5d2ca5[_0x23de('0x5e')]);_0x45f07a[_0x23de('0x3e')]=_0x3bb06d[_0x23de('0x3e')];_0x45f07a['Smtp']=_0x3bb06d['Smtp'];return db[_0x23de('0x44')]['create'](_0x45f07a,{'include':[{'model':db[_0x23de('0x61')],'as':_0x23de('0x3f')},{'model':db['MailServerIn'],'as':_0x23de('0x3e')}]})[_0x23de('0x10')](function(_0x4fd6ca){var _0x4faf2c=_0x5d2ca5[_0x23de('0x33')][_0x23de('0x25')]({'plain':!![]});if(!_0x4faf2c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4faf2c[_0x23de('0x73')]===_0x23de('0x33')){var _0x3de066=_0x4fd6ca['get']({'plain':!![]});return db[_0x23de('0x74')][_0x23de('0x5d')]({'where':{'name':'MailAccounts','userProfileId':_0x4faf2c[_0x23de('0x75')]},'raw':!![]})['then'](function(_0x21af4a){if(_0x21af4a&&_0x21af4a[_0x23de('0x76')]===0x0){return db['UserProfileResource'][_0x23de('0x65')]({'name':_0x3de066[_0x23de('0x6f')],'resourceId':_0x3de066['id'],'type':_0x21af4a['name'],'sectionId':_0x21af4a['id']},{})['then'](function(){return _0x4fd6ca;});}else{return _0x4fd6ca;}})['catch'](function(_0x1aff9b){logger[_0x23de('0x13')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1aff9b);throw _0x1aff9b;});}return _0x4fd6ca;})[_0x23de('0x10')](respondWithResult(_0x481497,0xc9))['catch'](handleError(_0x481497,null));};exports[_0x23de('0x77')]=function(_0x58b89e,_0x5e9aed){return db[_0x23de('0x44')][_0x23de('0x6c')]({'where':{'id':_0x58b89e['params']['id']}})[_0x23de('0x10')](handleEntityNotFound(_0x5e9aed,null))['then'](function(_0x1d32e2){if(_0x1d32e2){return _0x1d32e2[_0x23de('0x77')]();}return null;})['then'](respondWithResult(_0x5e9aed,null))['catch'](handleError(_0x5e9aed,null));};exports['addImap']=function(_0x5883c5,_0xd5ceea){if(_0x5883c5['body']['id']){delete _0x5883c5[_0x23de('0x5e')]['id'];}return db[_0x23de('0x44')][_0x23de('0x5d')]({'where':{'id':_0x5883c5[_0x23de('0x60')]['id']}})[_0x23de('0x10')](handleEntityNotFound(_0xd5ceea,null))['then'](function(_0x182de7){if(_0x182de7){_0x5883c5['body'][_0x23de('0x64')]=_0x182de7['id'];return db[_0x23de('0x40')]['create'](_0x5883c5[_0x23de('0x5e')]);}})[_0x23de('0x10')](respondWithResult(_0xd5ceea,null))[_0x23de('0x18')](handleError(_0xd5ceea,null));};exports[_0x23de('0x78')]=function(_0x56ae8f,_0x84fad9){return db[_0x23de('0x44')][_0x23de('0x6c')]({'where':{'id':_0x56ae8f[_0x23de('0x60')]['id']}})[_0x23de('0x10')](handleEntityNotFound(_0x84fad9,null))[_0x23de('0x10')](function(_0x37169e){if(_0x37169e){return _0x37169e['setImap'](null);}return null;})[_0x23de('0x10')](respondWithStatusCode(_0x84fad9,null))['catch'](handleError(_0x84fad9,null));};exports['getSmtp']=function(_0x22bed8,_0xd700ec){return db['MailAccount'][_0x23de('0x6c')]({'where':{'id':_0x22bed8[_0x23de('0x60')]['id']}})['then'](handleEntityNotFound(_0xd700ec,null))[_0x23de('0x10')](function(_0x216450){if(_0x216450){return _0x216450['getSmtp']();}return null;})['then'](respondWithResult(_0xd700ec,null))['catch'](handleError(_0xd700ec,null));};exports[_0x23de('0x79')]=function(_0x22ba0e,_0x54fc3e){if(_0x22ba0e[_0x23de('0x5e')]['id']){delete _0x22ba0e['body']['id'];}return db[_0x23de('0x44')]['find']({'where':{'id':_0x22ba0e['params']['id']}})['then'](handleEntityNotFound(_0x54fc3e,null))['then'](function(_0x5f2833){if(_0x5f2833){_0x22ba0e['body'][_0x23de('0x64')]=_0x5f2833['id'];return db[_0x23de('0x61')][_0x23de('0x65')](_0x22ba0e['body']);}})[_0x23de('0x10')](respondWithResult(_0x54fc3e,null))[_0x23de('0x18')](handleError(_0x54fc3e,null));};exports[_0x23de('0x7a')]=function(_0x169245,_0x20bae2){return db[_0x23de('0x44')][_0x23de('0x6c')]({'where':{'id':_0x169245[_0x23de('0x60')]['id']}})['then'](handleEntityNotFound(_0x20bae2,null))[_0x23de('0x10')](function(_0x2db62d){if(_0x2db62d){return _0x2db62d[_0x23de('0x7b')](null);}return null;})[_0x23de('0x10')](respondWithStatusCode(_0x20bae2,null))[_0x23de('0x18')](handleError(_0x20bae2,null));};exports[_0x23de('0x7c')]=function(_0x21c63d,_0x564797){return db[_0x23de('0x7d')]['find']({'where':{'id':_0x21c63d[_0x23de('0x60')]['id']}})[_0x23de('0x10')](handleEntityNotFound(_0x564797,null))[_0x23de('0x10')](function(_0x4812ac){if(_0x4812ac){return _0x4812ac[_0x23de('0x7c')](_0x21c63d[_0x23de('0x5e')][_0x23de('0x6a')],_['omit'](_0x21c63d[_0x23de('0x5e')],[_0x23de('0x6a'),'id'])||{});}})['then'](respondWithResult(_0x564797,null))[_0x23de('0x18')](handleError(_0x564797,null));};exports[_0x23de('0x7e')]=function(_0xde8e2f,_0x1435f4){var _0x126dca={'raw':![],'where':{}};var _0xb9eee3={};var _0x2a8cbc={'count':0x0,'rows':[]};return db[_0x23de('0x44')][_0x23de('0x6c')]({'where':{'id':_0xde8e2f[_0x23de('0x60')]['id']}})[_0x23de('0x10')](handleEntityNotFound(_0x1435f4,null))[_0x23de('0x10')](function(_0x13e2fa){if(_0x13e2fa){_0xb9eee3['model']=_['keys'](db['MailInteraction']['rawAttributes']);_0xb9eee3[_0x23de('0x4b')]=_['keys'](_0xde8e2f[_0x23de('0x4b')]);_0xb9eee3[_0x23de('0x4c')]=_['intersection'](_0xb9eee3['model'],_0xb9eee3['query']);_0x126dca['attributes']=_[_0x23de('0x4d')](_0xb9eee3[_0x23de('0x49')],qs[_0x23de('0x4e')](_0xde8e2f[_0x23de('0x4b')][_0x23de('0x4e')]));_0x126dca[_0x23de('0x4f')]=_0x126dca[_0x23de('0x4f')][_0x23de('0x50')]?_0x126dca[_0x23de('0x4f')]:_0xb9eee3[_0x23de('0x49')];if(!_0xde8e2f['query']['hasOwnProperty'](_0x23de('0x51'))){_0x126dca['limit']=qs['limit'](_0xde8e2f[_0x23de('0x4b')][_0x23de('0x1e')]);_0x126dca[_0x23de('0x20')]=qs['offset'](_0xde8e2f['query'][_0x23de('0x20')]);}_0x126dca[_0x23de('0x52')]=qs[_0x23de('0x53')](_0xde8e2f[_0x23de('0x4b')][_0x23de('0x53')]);_0x126dca[_0x23de('0x56')]=qs[_0x23de('0x4c')](_['pick'](_0xde8e2f[_0x23de('0x4b')],_0xb9eee3[_0x23de('0x4c')]));_0x126dca[_0x23de('0x56')]['MailAccountId']=_0x13e2fa['id'];if(_0xde8e2f[_0x23de('0x4b')]['filter']){_0x126dca[_0x23de('0x56')]=_['merge'](_0x126dca[_0x23de('0x56')],{'$or':_[_0x23de('0x43')](_0x126dca[_0x23de('0x4f')],function(_0x10f127){var _0x16f5e0={};_0x16f5e0[_0x10f127]={'$like':'%'+_0xde8e2f[_0x23de('0x4b')][_0x23de('0x55')]+'%'};return _0x16f5e0;})});}_0x126dca=_[_0x23de('0x57')]({},_0x126dca,_0xde8e2f[_0x23de('0x58')]);return db['MailInteraction'][_0x23de('0x1f')]({'where':_0x126dca[_0x23de('0x56')]})['then'](function(_0xc0cf2d){_0x2a8cbc[_0x23de('0x1f')]=_0xc0cf2d;if(_0xde8e2f[_0x23de('0x4b')][_0x23de('0x59')]){_0x126dca['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x23de('0x7f')],'as':_0x23de('0x80'),'attributes':[_0x23de('0x6f'),_0x23de('0x81'),_0x23de('0x82')],'required':![]},{'model':db[_0x23de('0x83')],'as':_0x23de('0x84'),'attributes':['id',_0x23de('0x6f'),_0x23de('0x85')],'where':_0xde8e2f[_0x23de('0x4b')][_0x23de('0x86')]?{'id':_0xde8e2f[_0x23de('0x4b')][_0x23de('0x86')]}:undefined,'required':_0xde8e2f[_0x23de('0x4b')]['tag']?!![]:![]}];}return db[_0x23de('0x7d')][_0x23de('0x5b')](_0x126dca);})[_0x23de('0x10')](function(_0x441012){_0x2a8cbc['rows']=_0x441012;return _0x2a8cbc;});}})[_0x23de('0x10')](respondWithFilteredResult(_0x1435f4,_0x126dca))[_0x23de('0x18')](handleError(_0x1435f4,null));};exports['addApplications']=function addApplications(_0x57a70b,_0x4a514c){var _0x3e755c=_0x57a70b[_0x23de('0x60')]['id'];var _0x280e2c=_0x57a70b[_0x23de('0x5e')];var _0x7127d0=0xc8;var _0x251438=null;return db[_0x23de('0x87')]['transaction']({'isolationLevel':db[_0x23de('0x87')][_0x23de('0x88')]['ISOLATION_LEVELS'][_0x23de('0x89')]},function(_0x1158cf){return db[_0x23de('0x44')][_0x23de('0x6c')]({'where':{'id':_0x3e755c},'transaction':_0x1158cf})[_0x23de('0x10')](function(_0x184a1b){if(_0x184a1b){return db[_0x23de('0x8a')][_0x23de('0x24')]({'where':{'MailAccountId':_0x3e755c},'transaction':_0x1158cf})[_0x23de('0x10')](function(){var _0x426d2d=_[_0x23de('0x43')](_0x280e2c,function(_0x23dc10){_0x23dc10['MailAccountId']=_0x3e755c;return _0x23dc10;});return db[_0x23de('0x8a')][_0x23de('0x8b')](_0x426d2d,{'transaction':_0x1158cf});});}else{_0x7127d0=0x194;_0x251438=[];}});})[_0x23de('0x10')](function(){if(_0x7127d0!==0x194){return db[_0x23de('0x8a')][_0x23de('0x8c')]({'where':{'MailAccountId':_0x3e755c},'order':_0x23de('0x8d')})[_0x23de('0x10')](function(_0x253f24){_0x251438=_0x253f24;});}})[_0x23de('0x18')](function(_0x23f492){_0x7127d0=0x1f4;logger[_0x23de('0x13')](_0x23f492[_0x23de('0x27')]);if(_0x23f492[_0x23de('0x6f')]){delete _0x23f492[_0x23de('0x6f')];}_0x251438=_0x23f492;})[_0x23de('0x8e')](function(){if(_0x251438===null){_0x4a514c['sendStatus'](_0x7127d0);}else{if(_0x7127d0===0x1f4){_0x4a514c['status'](_0x7127d0)['send'](_0x251438);}else{_0x4a514c[_0x23de('0x1b')](_0x7127d0)['json'](_0x251438);}}});};exports['getApplications']=function(_0x346563,_0x54d5a6){var _0x287610={};var _0x353146={};var _0x59d77f;var _0x5cdb0c;return db['MailAccount'][_0x23de('0x6c')]({'where':{'id':_0x346563['params']['id']}})[_0x23de('0x10')](handleEntityNotFound(_0x54d5a6,null))[_0x23de('0x10')](function(_0xefa084){if(_0xefa084){_0x59d77f=_0xefa084;_0x353146[_0x23de('0x49')]=_[_0x23de('0x4a')](db[_0x23de('0x8a')][_0x23de('0x45')]);_0x353146[_0x23de('0x4b')]=_[_0x23de('0x4a')](_0x346563['query']);_0x353146[_0x23de('0x4c')]=_[_0x23de('0x4d')](_0x353146[_0x23de('0x49')],_0x353146[_0x23de('0x4b')]);_0x287610[_0x23de('0x4f')]=_['intersection'](_0x353146[_0x23de('0x49')],qs['fields'](_0x346563[_0x23de('0x4b')][_0x23de('0x4e')]));_0x287610['attributes']=_0x287610[_0x23de('0x4f')][_0x23de('0x50')]?_0x287610[_0x23de('0x4f')]:_0x353146[_0x23de('0x49')];_0x287610[_0x23de('0x52')]=qs[_0x23de('0x53')](_0x346563[_0x23de('0x4b')][_0x23de('0x53')]);_0x287610[_0x23de('0x56')]=qs[_0x23de('0x4c')](_[_0x23de('0x54')](_0x346563['query'],_0x353146[_0x23de('0x4c')]));if(_0x346563['query']['filter']){_0x287610[_0x23de('0x56')]=_[_0x23de('0x57')](_0x287610['where'],{'$or':_[_0x23de('0x43')](_0x287610[_0x23de('0x4f')],function(_0x220686){var _0x4fe0a2={};_0x4fe0a2[_0x220686]={'$like':'%'+_0x346563[_0x23de('0x4b')]['filter']+'%'};return _0x4fe0a2;})});}_0x287610=_[_0x23de('0x57')]({},_0x287610,_0x346563[_0x23de('0x58')]);return _0x59d77f[_0x23de('0x8f')](_0x287610);}})[_0x23de('0x10')](function(_0x4344fa){if(_0x4344fa){_0x5cdb0c=_0x4344fa[_0x23de('0x50')];if(!_0x346563['query']['hasOwnProperty'](_0x23de('0x51'))){_0x287610[_0x23de('0x1e')]=qs[_0x23de('0x1e')](_0x346563[_0x23de('0x4b')][_0x23de('0x1e')]);_0x287610[_0x23de('0x20')]=qs[_0x23de('0x20')](_0x346563['query'][_0x23de('0x20')]);}return _0x59d77f[_0x23de('0x8f')](_0x287610);}})[_0x23de('0x10')](function(_0x432812){if(_0x432812){return _0x432812?{'count':_0x5cdb0c,'rows':_0x432812}:null;}})[_0x23de('0x10')](respondWithResult(_0x54d5a6,null))[_0x23de('0x18')](handleError(_0x54d5a6,null));};exports['getMessages']=function(_0x15d619,_0x27140a){var _0x40aa1a={'raw':!![],'where':{}};var _0x5115e8={};var _0x53aab4={'count':0x0,'rows':[]};return db[_0x23de('0x44')][_0x23de('0x6c')]({'where':{'id':_0x15d619[_0x23de('0x60')]['id']}})[_0x23de('0x10')](handleEntityNotFound(_0x27140a,null))[_0x23de('0x10')](function(_0x48127b){if(_0x48127b){_0x5115e8[_0x23de('0x49')]=_[_0x23de('0x4a')](db[_0x23de('0x90')][_0x23de('0x45')]);_0x5115e8[_0x23de('0x4b')]=_[_0x23de('0x4a')](_0x15d619[_0x23de('0x4b')]);_0x5115e8['filters']=_[_0x23de('0x4d')](_0x5115e8['model'],_0x5115e8[_0x23de('0x4b')]);_0x40aa1a[_0x23de('0x4f')]=_[_0x23de('0x4d')](_0x5115e8['model'],qs[_0x23de('0x4e')](_0x15d619[_0x23de('0x4b')]['fields']));_0x40aa1a[_0x23de('0x4f')]=_0x40aa1a[_0x23de('0x4f')]['length']?_0x40aa1a[_0x23de('0x4f')]:_0x5115e8['model'];if(!_0x15d619[_0x23de('0x4b')]['hasOwnProperty'](_0x23de('0x51'))){_0x40aa1a['limit']=qs[_0x23de('0x1e')](_0x15d619[_0x23de('0x4b')][_0x23de('0x1e')]);_0x40aa1a[_0x23de('0x20')]=qs['offset'](_0x15d619['query'][_0x23de('0x20')]);}_0x40aa1a[_0x23de('0x52')]=qs[_0x23de('0x53')](_0x15d619[_0x23de('0x4b')][_0x23de('0x53')]);_0x40aa1a[_0x23de('0x56')]=qs[_0x23de('0x4c')](_[_0x23de('0x54')](_0x15d619[_0x23de('0x4b')],_0x5115e8['filters']));_0x40aa1a[_0x23de('0x56')][_0x23de('0x64')]=_0x48127b['id'];if(_0x15d619[_0x23de('0x4b')][_0x23de('0x55')]){_0x40aa1a[_0x23de('0x56')]=_[_0x23de('0x57')](_0x40aa1a[_0x23de('0x56')],{'$or':_['map'](_0x40aa1a[_0x23de('0x4f')],function(_0x3ebe11){var _0x1b2c87={};_0x1b2c87[_0x3ebe11]={'$like':'%'+_0x15d619[_0x23de('0x4b')]['filter']+'%'};return _0x1b2c87;})});}if(_0x15d619[_0x23de('0x4b')][_0x23de('0x91')]){var _0x46361a=_0x15d619[_0x23de('0x4b')][_0x23de('0x91')][_0x23de('0x92')](',');var _0x4c5cfd={};_0x4c5cfd[_0x46361a[0x0]]={'$gte':moment(_0x46361a[0x1])[_0x23de('0x93')](_0x23de('0x94'))};_0x40aa1a['where']=_['merge'](_0x40aa1a[_0x23de('0x56')],_0x4c5cfd);}_0x40aa1a=_[_0x23de('0x57')]({},_0x40aa1a,_0x15d619[_0x23de('0x58')]);return db[_0x23de('0x90')]['count']({'where':_0x40aa1a[_0x23de('0x56')]})[_0x23de('0x10')](function(_0x23b19c){_0x53aab4['count']=_0x23b19c;if(_0x15d619[_0x23de('0x4b')][_0x23de('0x59')]){_0x40aa1a['include']=[{'all':!![]}];}return db[_0x23de('0x90')]['findAll'](_0x40aa1a);})['then'](function(_0xb13f6){if(_0x15d619[_0x23de('0x4b')][_0x23de('0x95')]===_0x23de('0x96')){for(var _0x25cc2d=0x0;_0x25cc2d<_0xb13f6['length'];_0x25cc2d++){_0xb13f6[_0x25cc2d]['body']=juice(_0xb13f6[_0x25cc2d]['body']);}}_0x53aab4[_0x23de('0x5c')]=_0xb13f6;return _0x53aab4;});}})[_0x23de('0x10')](respondWithFilteredResult(_0x27140a,_0x40aa1a))['catch'](handleError(_0x27140a,null));};exports[_0x23de('0x28')]=function(_0x29852d,_0x5e5267){var _0x5ee70a,_0xc7cd5c={},_0x4fa3c8;if(_0x29852d[_0x23de('0x5e')]['to']){_0x4fa3c8=_0x29852d['body']['to']['split'](',')[0x0];}return db['MailAccount'][_0x23de('0x5d')]({'where':{'id':_0x29852d[_0x23de('0x60')]['id']},'include':[{'model':db[_0x23de('0x97')],'as':_0x23de('0x98'),'include':[{'model':db[_0x23de('0x99')],'as':_0x23de('0x9a'),'where':{'email':_0x4fa3c8},'limit':0x1,'order':[[_0x23de('0x9b'),_0x23de('0x9c')]]}]},{'model':db[_0x23de('0x61')],'as':_0x23de('0x3f'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x23de('0x10')](handleEntityNotFound(_0x5e5267,null))[_0x23de('0x10')](function(_0x512b8a){if(!_0x512b8a)return;_0x5ee70a=_0x512b8a;if(!_0x512b8a[_0x23de('0x3f')])throw new Error(_0x23de('0x9d'));if(_[_0x23de('0x9e')](_0x29852d[_0x23de('0x5e')][_0x23de('0x9f')])){_0x29852d[_0x23de('0x5e')]['from']=util[_0x23de('0x93')](_0x23de('0xa0'),_0x512b8a['name'],_0x512b8a[_0x23de('0xa1')]||_0x512b8a[_0x23de('0x3f')][_0x23de('0x33')]);}if(_0x29852d[_0x23de('0x5e')][_0x23de('0xa2')]&&_0x29852d[_0x23de('0x5e')][_0x23de('0xa2')][_0x23de('0x50')]){for(var _0x466cc1=0x0;_0x466cc1<_0x29852d['body'][_0x23de('0xa2')]['length'];_0x466cc1+=0x1){_0x29852d[_0x23de('0x5e')]['attachments'][_0x466cc1]={'filename':_0x29852d[_0x23de('0x5e')]['attachments'][_0x466cc1][_0x23de('0x6f')],'path':path[_0x23de('0xa3')](config['root'],'server/files/attachments',_0x29852d[_0x23de('0x5e')][_0x23de('0xa2')][_0x466cc1][_0x23de('0xa4')])};}}var _0x31ba27=_0x512b8a[_0x23de('0xa5')]();return respondWithRpcPromise(_0x23de('0xa6'),_0x23de('0xa7'),{'account':_0x31ba27,'message':_0x29852d[_0x23de('0x5e')]});})['then'](function(_0x153661){if(!_0x153661)return;_0xc7cd5c=_0x153661;if(!_0x5ee70a[_0x23de('0x98')])throw new Error(_0x23de('0xa8'));if(_0x5ee70a[_0x23de('0x98')][_0x23de('0x9a')][_0x23de('0x50')])return _0x5ee70a['List'][_0x23de('0x9a')][0x0];return db[_0x23de('0x99')][_0x23de('0x65')](_[_0x23de('0x9')](_0x29852d['body'],{'firstName':_0x29852d['body']['to'],'email':_0x29852d[_0x23de('0x5e')]['to'],'phone':_0x29852d[_0x23de('0x5e')]['to'],'ListId':_0x5ee70a[_0x23de('0xa9')]}));})[_0x23de('0x10')](function(_0x4d021c){if(!_0x4d021c)return;var _0x42f0e5={'UserId':_0x29852d[_0x23de('0x33')]['id'],'ContactId':_0x4d021c['id'],'MailAccountId':_0x5ee70a['id'],'inReplyTo':_0xc7cd5c[_0x23de('0xaa')],'to':_0x29852d[_0x23de('0x5e')]['from'],'cc':_0x29852d[_0x23de('0x5e')]['cc'],'subject':_0x29852d[_0x23de('0x5e')][_0x23de('0xab')],'attach':_0x29852d[_0x23de('0x5e')][_0x23de('0xac')],'firstMsgDirection':_0x23de('0xad'),'lastMsgAt':moment()[_0x23de('0x93')](_0x23de('0x94')),'lastMsgDirection':_0x23de('0xad'),'Messages':[_['merge'](_0x29852d[_0x23de('0x5e')],{'messageId':_0xc7cd5c[_0x23de('0xaa')],'sentAt':moment()[_0x23de('0x93')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x5ee70a['id'],'UserId':_0x29852d[_0x23de('0x33')]['id'],'ContactId':_0x4d021c['id']})]};if(_0x29852d[_0x23de('0x5e')][_0x23de('0xae')]){_0x42f0e5=_[_0x23de('0x57')](_0x42f0e5,_0x29852d['body'][_0x23de('0xae')]);}return db['MailInteraction'][_0x23de('0x65')](_0x42f0e5,{'include':[{'model':db[_0x23de('0x90')],'as':_0x23de('0xaf')}]});})[_0x23de('0x10')](respondWithResult(_0x5e5267,null))['catch'](handleError(_0x5e5267,null));};exports['verifySmtp']=function(_0x4ea738,_0x3cbb7c){return db[_0x23de('0x44')]['find']({'where':{'id':_0x4ea738[_0x23de('0x60')]['id']},'include':[{'model':db[_0x23de('0x61')],'as':_0x23de('0x3f'),'raw':!![],'include':[{'model':db[_0x23de('0xb0')],'as':_0x23de('0xb0'),'raw':!![]}]}]})['then'](handleEntityNotFound(_0x3cbb7c,null))[_0x23de('0x10')](function(_0x16243c){if(!_0x16243c['Smtp'])return;var _0x1c59db=_0x16243c[_0x23de('0xa5')]();return respondWithRpcPromise(_0x23de('0xb1'),'verifySmtp',{'account':_0x1c59db});})[_0x23de('0x10')](respondWithResult(_0x3cbb7c,null))[_0x23de('0x18')](handleError(_0x3cbb7c,null));};exports['destroy']=function(_0x544777,_0x338f25){return db[_0x23de('0x44')][_0x23de('0x5d')]({'where':{'id':_0x544777[_0x23de('0x60')]['id']}})[_0x23de('0x10')](handleEntityNotFound(_0x338f25,null))[_0x23de('0x10')](function(_0x70c3ad){if(_0x70c3ad&&_0x70c3ad[_0x23de('0x3b')]){throw new db['Sequelize'][(_0x23de('0xb2'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x70c3ad;})[_0x23de('0x10')](removeEntity(_0x338f25,null))[_0x23de('0x18')](handleError(_0x338f25,null));};exports[_0x23de('0xb3')]=function(_0x43191e,_0x187d5f){return db[_0x23de('0x44')][_0x23de('0x5d')]({'where':{'id':_0x43191e[_0x23de('0x60')]['id']}})[_0x23de('0x10')](handleEntityNotFound(_0x187d5f,null))['then'](function(_0x265995){if(_0x265995){return _0x265995[_0x23de('0xb3')](_0x43191e[_0x23de('0x5e')][_0x23de('0x6a')],_[_0x23de('0xb4')](_0x43191e['body'],[_0x23de('0x6a'),'id'])||{})[_0x23de('0xb5')](function(_0x1cb95b){for(var _0x24b199=0x0;_0x24b199<_0x43191e[_0x23de('0x5e')][_0x23de('0x6a')][_0x23de('0x50')];_0x24b199+=0x1){socket['emit'](_0x23de('0xb6'),{'UserId':Number(_0x43191e['body']['ids'][_0x24b199]),'MailAccountId':Number(_0x43191e[_0x23de('0x60')]['id'])});}return _0x1cb95b;});}})[_0x23de('0x10')](respondWithResult(_0x187d5f,null))[_0x23de('0x18')](handleError(_0x187d5f,null));};exports[_0x23de('0xb7')]=function(_0x1d8d3b,_0x3f3820){return db[_0x23de('0x44')][_0x23de('0x5d')]({'where':{'id':_0x1d8d3b['params']['id']}})[_0x23de('0x10')](handleEntityNotFound(_0x3f3820,null))[_0x23de('0x10')](function(_0x599445){if(_0x599445){return _0x599445['removeAgents'](_0x1d8d3b[_0x23de('0x4b')]['ids'])['then'](function(){if(_[_0x23de('0xb8')](_0x1d8d3b['query'][_0x23de('0x6a')])){for(var _0x414712=0x0;_0x414712<_0x1d8d3b['query'][_0x23de('0x6a')]['length'];_0x414712+=0x1){socket['emit']('userMailAccount:remove',{'UserId':Number(_0x1d8d3b[_0x23de('0x4b')][_0x23de('0x6a')][_0x414712]),'MailAccountId':Number(_0x1d8d3b[_0x23de('0x60')]['id'])});}}else{socket['emit'](_0x23de('0xb9'),{'UserId':Number(_0x1d8d3b['query']['ids']),'MailAccountId':Number(_0x1d8d3b[_0x23de('0x60')]['id'])});}});}})[_0x23de('0x10')](respondWithStatusCode(_0x3f3820,null))[_0x23de('0x18')](handleError(_0x3f3820,null));};exports['getAgents']=function(_0x3a7e0b,_0x1afd3a){var _0x55b558={};var _0x48e59d={};var _0x26a4cc;var _0x300c96;return db[_0x23de('0x44')][_0x23de('0x6c')]({'where':{'id':_0x3a7e0b[_0x23de('0x60')]['id']}})[_0x23de('0x10')](handleEntityNotFound(_0x1afd3a,null))['then'](function(_0x39f245){if(_0x39f245){_0x26a4cc=_0x39f245;_0x48e59d['model']=_[_0x23de('0x4a')](db[_0x23de('0x7f')]['rawAttributes']);_0x48e59d[_0x23de('0x4b')]=_[_0x23de('0x4a')](_0x3a7e0b[_0x23de('0x4b')]);_0x48e59d[_0x23de('0x4c')]=_[_0x23de('0x4d')](_0x48e59d['model'],_0x48e59d[_0x23de('0x4b')]);_0x55b558[_0x23de('0x4f')]=_['intersection'](_0x48e59d[_0x23de('0x49')],qs[_0x23de('0x4e')](_0x3a7e0b[_0x23de('0x4b')][_0x23de('0x4e')]));_0x55b558[_0x23de('0x4f')]=_0x55b558[_0x23de('0x4f')][_0x23de('0x50')]?_0x55b558['attributes']:_0x48e59d[_0x23de('0x49')];_0x55b558['order']=qs[_0x23de('0x53')](_0x3a7e0b[_0x23de('0x4b')][_0x23de('0x53')]);_0x55b558['where']=qs['filters'](_[_0x23de('0x54')](_0x3a7e0b['query'],_0x48e59d[_0x23de('0x4c')]));if(_0x3a7e0b['query'][_0x23de('0x55')]){_0x55b558[_0x23de('0x56')]=_[_0x23de('0x57')](_0x55b558['where'],{'$or':_['map'](_0x55b558[_0x23de('0x4f')],function(_0x4b9e72){var _0x463076={};_0x463076[_0x4b9e72]={'$like':'%'+_0x3a7e0b['query'][_0x23de('0x55')]+'%'};return _0x463076;})});}_0x55b558=_[_0x23de('0x57')]({},_0x55b558,_0x3a7e0b['options']);return _0x26a4cc['getAgents'](_0x55b558);}})[_0x23de('0x10')](function(_0x57715c){if(_0x57715c){_0x300c96=_0x57715c[_0x23de('0x50')];if(!_0x3a7e0b[_0x23de('0x4b')][_0x23de('0x67')](_0x23de('0x51'))){_0x55b558[_0x23de('0x1e')]=qs['limit'](_0x3a7e0b[_0x23de('0x4b')][_0x23de('0x1e')]);_0x55b558[_0x23de('0x20')]=qs[_0x23de('0x20')](_0x3a7e0b[_0x23de('0x4b')][_0x23de('0x20')]);}return _0x26a4cc['getAgents'](_0x55b558);}})[_0x23de('0x10')](function(_0x3bf331){if(_0x3bf331){return _0x3bf331?{'count':_0x300c96,'rows':_0x3bf331}:null;}})['then'](respondWithResult(_0x1afd3a,null))[_0x23de('0x18')](handleError(_0x1afd3a,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 622e89f..fecb357 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 _0xe978=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','update','remove'];(function(_0x121a85,_0x1d7891){var _0x27be3d=function(_0x19b60b){while(--_0x19b60b){_0x121a85['push'](_0x121a85['shift']());}};_0x27be3d(++_0x1d7891);}(_0xe978,0x70));var _0x8e97=function(_0x3efff3,_0x179e83){_0x3efff3=_0x3efff3-0x0;var _0x332931=_0xe978[_0x3efff3];return _0x332931;};'use strict';var EventEmitter=require(_0x8e97('0x0'));var MailAccount=require(_0x8e97('0x1'))['db'][_0x8e97('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x8e97('0x3'),'afterDestroy':_0x8e97('0x4')};function emitEvent(_0x16e587){return function(_0x3e3a3a,_0x1e27f7,_0x4f11c9){MailAccountEvents[_0x8e97('0x5')](_0x16e587+':'+_0x3e3a3a['id'],_0x3e3a3a);MailAccountEvents[_0x8e97('0x5')](_0x16e587,_0x3e3a3a);_0x4f11c9(null);};}for(var e in events){if(events[_0x8e97('0x6')](e)){var event=events[e];MailAccount[_0x8e97('0x7')](e,emitEvent(event));}}module[_0x8e97('0x8')]=MailAccountEvents; \ No newline at end of file +var _0x9b25=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','MailAccount','save'];(function(_0x1034ee,_0x12998c){var _0x2922af=function(_0x13715a){while(--_0x13715a){_0x1034ee['push'](_0x1034ee['shift']());}};_0x2922af(++_0x12998c);}(_0x9b25,0x1be));var _0x59b2=function(_0x5c815c,_0x3885a0){_0x5c815c=_0x5c815c-0x0;var _0x444633=_0x9b25[_0x5c815c];return _0x444633;};'use strict';var EventEmitter=require(_0x59b2('0x0'));var MailAccount=require(_0x59b2('0x1'))['db'][_0x59b2('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x59b2('0x3'),'afterUpdate':_0x59b2('0x4'),'afterDestroy':_0x59b2('0x5')};function emitEvent(_0x459769){return function(_0x72ea4a,_0x48e4ca,_0x4dd11d){MailAccountEvents[_0x59b2('0x6')](_0x459769+':'+_0x72ea4a['id'],_0x72ea4a);MailAccountEvents[_0x59b2('0x6')](_0x459769,_0x72ea4a);_0x4dd11d(null);};}for(var e in events){if(events[_0x59b2('0x7')](e)){var event=events[e];MailAccount[_0x59b2('0x8')](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 659b7bb..fc20f46 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 _0x120c=['service','host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','user','data5','auth','./mailAccount.attributes','exports','provider','custom'];(function(_0x4f7e5b,_0x452c65){var _0x13ea34=function(_0x3f04c0){while(--_0x3f04c0){_0x4f7e5b['push'](_0x4f7e5b['shift']());}};_0x13ea34(++_0x452c65);}(_0x120c,0x172));var _0xc120=function(_0x5a62e5,_0x25cfe8){_0x5a62e5=_0x5a62e5-0x0;var _0x4c1f12=_0x120c[_0x5a62e5];return _0x4c1f12;};'use strict';var attributes=require(_0xc120('0x0'));module[_0xc120('0x1')]=function(_0x43fb5f){return _0x43fb5f['define']('MailAccount',attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x42570b=this;var _0x1e1961={'id':_0x42570b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x42570b[_0xc120('0x2')]!==_0xc120('0x3')){_0x1e1961[_0xc120('0x4')]=_0x42570b[_0xc120('0x2')];}else{_0x1e1961[_0xc120('0x5')]=_0x42570b[_0xc120('0x6')]['host'];_0x1e1961[_0xc120('0x7')]=_0x42570b[_0xc120('0x6')][_0xc120('0x7')];_0x1e1961[_0xc120('0x8')]=_0x42570b['Smtp'][_0xc120('0x8')];}if(_0x42570b[_0xc120('0x6')][_0xc120('0x9')]){if(_0x42570b[_0xc120('0x6')][_0xc120('0xa')]){if(!_0x42570b[_0xc120('0x6')][_0xc120('0xb')])throw new Error(_0xc120('0xc'));_0x1e1961['auth']={'type':_0xc120('0xd'),'user':_0x42570b[_0xc120('0x6')][_0xc120('0xe')],'accessToken':_0x42570b[_0xc120('0x6')][_0xc120('0xb')][_0xc120('0xf')]};}else{_0x1e1961[_0xc120('0x10')]={'user':_0x42570b[_0xc120('0x6')][_0xc120('0xe')],'pass':_0x42570b[_0xc120('0x6')]['pass']};}}return _0x1e1961;}}});}; \ No newline at end of file +var _0xf510=['Smtp','port','secure','authentication','modernAuthentication','auth','OAuth2','user','CloudProvider','data5','pass','./mailAccount.attributes','define','mail_accounts','custom','provider','host'];(function(_0x1625d5,_0x2cb18b){var _0x5f0d99=function(_0x23cbb8){while(--_0x23cbb8){_0x1625d5['push'](_0x1625d5['shift']());}};_0x5f0d99(++_0x2cb18b);}(_0xf510,0x1e7));var _0x0f51=function(_0xa69f1,_0x475984){_0xa69f1=_0xa69f1-0x0;var _0x8fa455=_0xf510[_0xa69f1];return _0x8fa455;};'use strict';var attributes=require(_0x0f51('0x0'));module['exports']=function(_0x48356d){return _0x48356d[_0x0f51('0x1')]('MailAccount',attributes,{'tableName':_0x0f51('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0xa979d3=this;var _0x5a3d20={'id':_0xa979d3['id'],'tls':{'rejectUnauthorized':![]}};if(_0xa979d3['provider']!==_0x0f51('0x3')){_0x5a3d20['service']=_0xa979d3[_0x0f51('0x4')];}else{_0x5a3d20[_0x0f51('0x5')]=_0xa979d3[_0x0f51('0x6')][_0x0f51('0x5')];_0x5a3d20[_0x0f51('0x7')]=_0xa979d3[_0x0f51('0x6')][_0x0f51('0x7')];_0x5a3d20[_0x0f51('0x8')]=_0xa979d3[_0x0f51('0x6')][_0x0f51('0x8')];}if(_0xa979d3[_0x0f51('0x6')][_0x0f51('0x9')]){if(_0xa979d3['Smtp'][_0x0f51('0xa')]){if(!_0xa979d3[_0x0f51('0x6')]['CloudProvider'])throw new Error('Cloud\x20Provider\x20configuration\x20not\x20found');_0x5a3d20[_0x0f51('0xb')]={'type':_0x0f51('0xc'),'user':_0xa979d3['Smtp'][_0x0f51('0xd')],'accessToken':_0xa979d3['Smtp'][_0x0f51('0xe')][_0x0f51('0xf')]};}else{_0x5a3d20[_0x0f51('0xb')]={'user':_0xa979d3[_0x0f51('0x6')][_0x0f51('0xd')],'pass':_0xa979d3['Smtp'][_0x0f51('0x10')]};}}return _0x5a3d20;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 4ed9f4a..ed71905 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 _0xbd51=['message','info','result','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','include','model','map','catch','ShowMailAccount','find','smtp','setDataValue','smtpOptions','getSmtpOptions','NotifyMailAccount','body','mail','CmContact','rawAttributes','createdAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','updatedAt','DESC','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','List','get','omit','account','applications','orderBy','priority','asc','autoclose','push','length','close','*,*,*,*','defaults','from','create','List\x20not\x20found','contact','messageId','generate','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inReplyTo','Contact\x20not\x20found','update','subject','attach','interaction','created','attachments','originTo','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachments','UserId','User','name','waitForTheAssignedAgent','queueId','unshift','queue','waitForTheAssignedQueue','Start','lodash','bluebird','randomstring','ioredis','../../mysqldb','client','http','redis','localhost','socket.io-emitter','./mailAccount.socket','request','then','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x3853d8,_0xc8989b){_0x3853d8=_0x3853d8-0x0;var _0x741d76=_0xbd51[_0x3853d8];return _0x741d76;};'use strict';var _=require(_0x1bd5('0x0'));var moment=require('moment');var BPromise=require(_0x1bd5('0x1'));var rs=require(_0x1bd5('0x2'));var Redis=require(_0x1bd5('0x3'));var db=require(_0x1bd5('0x4'))['db'];var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1bd5('0x5')][_0x1bd5('0x6')]({'port':0x232c});config[_0x1bd5('0x7')]=_['defaults'](config[_0x1bd5('0x7')],{'host':_0x1bd5('0x8'),'port':0x18eb});var socket=require(_0x1bd5('0x9'))(new Redis(config[_0x1bd5('0x7')]));require(_0x1bd5('0xa'))['register'](socket);function respondWithRpcPromise(_0x36ef1a,_0x5c8e0d,_0x2bd975){return new BPromise(function(_0x28df8e,_0x3b868a){return client[_0x1bd5('0xb')](_0x36ef1a,_0x2bd975)[_0x1bd5('0xc')](function(_0x3e3d06){logger['info'](_0x1bd5('0xd'),_0x5c8e0d,'request\x20sent');logger[_0x1bd5('0xe')](_0x1bd5('0xf'),_0x5c8e0d,_0x1bd5('0x10'),JSON[_0x1bd5('0x11')](_0x3e3d06));if(_0x3e3d06[_0x1bd5('0x12')]){if(_0x3e3d06[_0x1bd5('0x12')][_0x1bd5('0x13')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x5c8e0d,_0x3e3d06[_0x1bd5('0x12')][_0x1bd5('0x14')]);return _0x3b868a(_0x3e3d06[_0x1bd5('0x12')][_0x1bd5('0x14')]);}logger['error']('MailAccount,\x20%s,\x20%s',_0x5c8e0d,_0x3e3d06[_0x1bd5('0x12')][_0x1bd5('0x14')]);return _0x28df8e(_0x3e3d06[_0x1bd5('0x12')][_0x1bd5('0x14')]);}else{logger[_0x1bd5('0x15')](_0x1bd5('0xd'),_0x5c8e0d,_0x1bd5('0x10'));_0x28df8e(_0x3e3d06[_0x1bd5('0x16')][_0x1bd5('0x14')]);}})['catch'](function(_0x53ad5e){logger[_0x1bd5('0x12')](_0x1bd5('0xd'),_0x5c8e0d,_0x53ad5e);_0x3b868a(_0x53ad5e);});});}exports[_0x1bd5('0x17')]=function(_0xb95d4e){var _0x459649=this;return new Promise(function(_0x2ff39a,_0x3fbb39){return db[_0x1bd5('0x18')][_0x1bd5('0x19')]({'raw':_0xb95d4e[_0x1bd5('0x1a')]?_0xb95d4e[_0x1bd5('0x1a')][_0x1bd5('0x1b')]===undefined?!![]:![]:!![],'where':_0xb95d4e[_0x1bd5('0x1a')]?_0xb95d4e[_0x1bd5('0x1a')][_0x1bd5('0x1c')]||null:null,'attributes':_0xb95d4e[_0x1bd5('0x1a')]?_0xb95d4e[_0x1bd5('0x1a')][_0x1bd5('0x1d')]||null:null,'limit':_0xb95d4e['options']?_0xb95d4e[_0x1bd5('0x1a')]['limit']||null:null,'include':_0xb95d4e[_0x1bd5('0x1a')]?_0xb95d4e[_0x1bd5('0x1a')][_0x1bd5('0x1e')]?_['map'](_0xb95d4e[_0x1bd5('0x1a')]['include'],function(_0x2ed551){return{'model':db[_0x2ed551[_0x1bd5('0x1f')]],'as':_0x2ed551['as'],'attributes':_0x2ed551[_0x1bd5('0x1d')],'include':_0x2ed551[_0x1bd5('0x1e')]?_['map'](_0x2ed551[_0x1bd5('0x1e')],function(_0x69bb17){return{'model':db[_0x69bb17[_0x1bd5('0x1f')]],'as':_0x69bb17['as'],'attributes':_0x69bb17[_0x1bd5('0x1d')],'include':_0x69bb17['include']?_[_0x1bd5('0x20')](_0x69bb17[_0x1bd5('0x1e')],function(_0x3595e9){return{'model':db[_0x3595e9[_0x1bd5('0x1f')]],'as':_0x3595e9['as'],'attributes':_0x3595e9[_0x1bd5('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1bd5('0xc')](function(_0x4e72b2){logger[_0x1bd5('0x15')](_0x1bd5('0x17'),_0xb95d4e);logger[_0x1bd5('0xe')]('GetMailAccount',_0xb95d4e,JSON[_0x1bd5('0x11')](_0x4e72b2));_0x2ff39a(_0x4e72b2);})[_0x1bd5('0x21')](function(_0x345181){logger[_0x1bd5('0x12')](_0x1bd5('0x17'),_0x345181[_0x1bd5('0x14')],_0xb95d4e);_0x3fbb39(_0x459649['error'](0x1f4,_0x345181['message']));});});};exports[_0x1bd5('0x22')]=function(_0x305126){var _0x5542aa=this;return new Promise(function(_0x36649d,_0x198b88){return db[_0x1bd5('0x18')][_0x1bd5('0x23')]({'raw':_0x305126['options']?_0x305126[_0x1bd5('0x1a')][_0x1bd5('0x1b')]===undefined?!![]:![]:!![],'where':_0x305126[_0x1bd5('0x1a')]?_0x305126[_0x1bd5('0x1a')][_0x1bd5('0x1c')]||null:null,'attributes':_0x305126[_0x1bd5('0x1a')]?_0x305126[_0x1bd5('0x1a')][_0x1bd5('0x1d')]||null:null,'include':_0x305126['options']?_0x305126[_0x1bd5('0x1a')][_0x1bd5('0x1e')]?_[_0x1bd5('0x20')](_0x305126[_0x1bd5('0x1a')][_0x1bd5('0x1e')],function(_0x18a9db){return{'model':db[_0x18a9db[_0x1bd5('0x1f')]],'as':_0x18a9db['as'],'attributes':_0x18a9db['attributes'],'include':_0x18a9db[_0x1bd5('0x1e')]?_[_0x1bd5('0x20')](_0x18a9db[_0x1bd5('0x1e')],function(_0x2f5a48){return{'model':db[_0x2f5a48[_0x1bd5('0x1f')]],'as':_0x2f5a48['as'],'attributes':_0x2f5a48[_0x1bd5('0x1d')],'include':_0x2f5a48[_0x1bd5('0x1e')]?_['map'](_0x2f5a48['include'],function(_0x155e4c){return{'model':db[_0x155e4c[_0x1bd5('0x1f')]],'as':_0x155e4c['as'],'attributes':_0x155e4c[_0x1bd5('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4595a0){if(_0x305126['options'][_0x1bd5('0x24')]===!![])_0x4595a0[_0x1bd5('0x25')](_0x1bd5('0x26'),_0x4595a0[_0x1bd5('0x27')]());logger[_0x1bd5('0x15')](_0x1bd5('0x22'),_0x305126);logger[_0x1bd5('0xe')](_0x1bd5('0x22'),_0x305126,JSON['stringify'](_0x4595a0));_0x36649d(_0x4595a0);})[_0x1bd5('0x21')](function(_0x2978d8){logger['error'](_0x1bd5('0x22'),_0x2978d8[_0x1bd5('0x14')],_0x305126);_0x198b88(_0x5542aa[_0x1bd5('0x12')](0x1f4,_0x2978d8['message']));});});};exports[_0x1bd5('0x28')]=function(_0x53482){var _0x2997a2=this;return new Promise(function(_0x4074f1,_0x4e8ff7){var _0x305720={'body':_0x53482[_0x1bd5('0x29')],'channel':_0x1bd5('0x2a')};var _0x11e996=_['difference'](_['keys'](db[_0x1bd5('0x2b')][_0x1bd5('0x2c')]),[_0x1bd5('0x2d'),'updatedAt',_0x1bd5('0x2e'),_0x1bd5('0x2f')]);var _0x574d95=![];if(_0x53482[_0x1bd5('0x29')]['id']){delete _0x53482['body']['id'];}if(_[_0x1bd5('0x30')](_0x53482[_0x1bd5('0x29')]['from'])){return _0x4e8ff7(_0x2997a2[_0x1bd5('0x12')](0x1f4,_0x1bd5('0x31')));}if(_[_0x1bd5('0x30')](_0x53482[_0x1bd5('0x29')][_0x1bd5('0x29')])||_0x53482[_0x1bd5('0x29')][_0x1bd5('0x29')]===''){return _0x4e8ff7(_0x2997a2[_0x1bd5('0x12')](0x1f4,_0x1bd5('0x32')));}if(_[_0x1bd5('0x30')](_0x53482[_0x1bd5('0x29')][_0x1bd5('0x33')])){return _0x4e8ff7(_0x2997a2['error'](0x1f4,_0x1bd5('0x34')+_0x11e996));}if(!_[_0x1bd5('0x35')](_0x11e996,_0x53482[_0x1bd5('0x29')]['mapKey'])){return _0x4e8ff7(_0x2997a2[_0x1bd5('0x12')](0x1f4,_0x1bd5('0x36')+_0x11e996));}var _0x5bb8a6={};_0x5bb8a6[_0x53482[_0x1bd5('0x29')]['mapKey']]=_0x53482[_0x1bd5('0x29')]['from'];return db[_0x1bd5('0x18')][_0x1bd5('0x23')]({'where':{'id':_0x53482['account']['id']},'include':[{'model':db[_0x1bd5('0x37')],'as':'List','include':[{'model':db[_0x1bd5('0x2b')],'as':_0x1bd5('0x38'),'where':_0x5bb8a6,'limit':0x1,'order':[[_0x1bd5('0x39'),_0x1bd5('0x3a')]]}]},{'model':db[_0x1bd5('0x3b')],'as':_0x1bd5('0x3c')},{'model':db[_0x1bd5('0x3d')],'as':_0x1bd5('0x3e'),'include':[{'model':db['CloudProvider'],'as':_0x1bd5('0x3f')}]}]})[_0x1bd5('0xc')](function(_0x2a1ece){if(_0x2a1ece&&_0x2a1ece[_0x1bd5('0x40')]){var _0x34452a=_0x2a1ece[_0x1bd5('0x41')]({'plain':!![]});_0x305720['account']=_[_0x1bd5('0x42')](_0x34452a,[_0x1bd5('0x3c'),_0x1bd5('0x40')]);_0x305720[_0x1bd5('0x43')][_0x1bd5('0x26')]=_0x2a1ece[_0x1bd5('0x27')]();_0x305720[_0x1bd5('0x44')]=_0x34452a['Applications'];_0x305720['list']=_0x34452a[_0x1bd5('0x40')];_0x305720[_0x1bd5('0x44')]=_[_0x1bd5('0x45')](_0x305720['applications'],[_0x1bd5('0x46')],[_0x1bd5('0x47')]);if(_0x305720[_0x1bd5('0x43')]&&_0x305720[_0x1bd5('0x43')][_0x1bd5('0x48')]){_0x305720[_0x1bd5('0x44')][_0x1bd5('0x49')]({'id':0x0,'priority':_0x305720['applications'][_0x1bd5('0x4a')]+0x1,'app':_0x1bd5('0x4b'),'appdata':'autoclose','interval':_0x1bd5('0x4c')});}if(_0x305720['account'][_0x1bd5('0x3c')]){delete _0x305720['account'][_0x1bd5('0x3c')];}if(_0x305720[_0x1bd5('0x43')]['List']){delete _0x305720[_0x1bd5('0x43')][_0x1bd5('0x40')];}if(_0x34452a[_0x1bd5('0x40')][_0x1bd5('0x38')][_0x1bd5('0x4a')]){return _0x34452a[_0x1bd5('0x40')][_0x1bd5('0x38')][0x0];}var _0x51aebe=_[_0x1bd5('0x4d')](_0x53482['body'],{'firstName':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x4e')],'ListId':_0x34452a[_0x1bd5('0x2f')]});_0x51aebe[_0x53482['body']['mapKey']]=_0x53482[_0x1bd5('0x29')][_0x1bd5('0x4e')];return db[_0x1bd5('0x2b')][_0x1bd5('0x4f')](_0x51aebe);}else{throw new Error(_0x1bd5('0x50'));}})[_0x1bd5('0xc')](function(_0x46e36c){_0x305720[_0x1bd5('0x51')]=_0x46e36c;if(_0x46e36c){if(!_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['messageId']){_0x53482[_0x1bd5('0x29')]['message'][_0x1bd5('0x52')]=rs[_0x1bd5('0x53')]()+'\x20'+_0x53482[_0x1bd5('0x29')]['message'][_0x1bd5('0x4e')];}var _0x17b3a9={'ContactId':_0x46e36c['id'],'MailAccountId':_0x53482[_0x1bd5('0x43')]['id'],'inReplyTo':_0x53482['body'][_0x1bd5('0x14')][_0x1bd5('0x52')],'to':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['from'],'cc':_0x53482['body'][_0x1bd5('0x14')]['cc'],'subject':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['subject'],'attach':_0x53482['body'][_0x1bd5('0x14')]['attach'],'lastMsgAt':moment()[_0x1bd5('0x54')](_0x1bd5('0x55')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x1bd5('0x23')]({'where':{'closed':![],'MailAccountId':_0x53482['account']['id']},'include':[{'model':db[_0x1bd5('0x56')],'as':'Messages','attributes':[_0x1bd5('0x52')],'where':{'messageId':_0x53482[_0x1bd5('0x29')]['message'][_0x1bd5('0x57')]}}]})[_0x1bd5('0xc')](function(_0x47ca3f){if(_0x47ca3f){return[_0x47ca3f,![]];}return db['MailInteraction'][_0x1bd5('0x4f')](_0x17b3a9)[_0x1bd5('0xc')](function(_0x1a9ad2){return[_0x1a9ad2,!![]];});});}else{throw new Error(_0x1bd5('0x58'));}})['spread'](function(_0x551f22,_0x14dd41){if(_0x551f22){_0x574d95=_0x14dd41;if(!_0x14dd41){return _0x551f22[_0x1bd5('0x59')]({'inReplyTo':_0x53482[_0x1bd5('0x29')]['message'][_0x1bd5('0x52')],'to':_0x53482[_0x1bd5('0x29')]['message']['from'],'cc':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['cc'],'subject':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x5a')],'attach':_0x551f22['attach']?_0x551f22[_0x1bd5('0x5b')]:_0x53482['body'][_0x1bd5('0x14')][_0x1bd5('0x5b')],'substatus':null,'substatusAt':moment()[_0x1bd5('0x54')](_0x1bd5('0x55')),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x551f22;}}})[_0x1bd5('0xc')](function(_0x36d62e){_0x305720[_0x1bd5('0x5c')]=_0x36d62e[_0x1bd5('0x41')]({'plain':!![]});_0x305720[_0x1bd5('0x5c')][_0x1bd5('0x5d')]=_0x574d95;return db[_0x1bd5('0x56')][_0x1bd5('0x4f')]({'body':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x29')],'MailAccountId':_0x53482[_0x1bd5('0x43')]['id'],'MailInteractionId':_0x36d62e['id'],'direction':'in','ContactId':_0x305720[_0x1bd5('0x51')]['id'],'messageId':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x52')],'from':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x4e')],'to':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['to'],'cc':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['cc'],'subject':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['subject'],'attach':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x5b')],'Attachments':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x5e')],'originTo':_0x53482[_0x1bd5('0x29')]['message'][_0x1bd5('0x5f')],'originCc':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x60')],'bcc':_0x53482['body'][_0x1bd5('0x14')][_0x1bd5('0x61')],'ChatWebsiteId':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')][_0x1bd5('0x62')]||null,'originChannel':_0x53482[_0x1bd5('0x29')][_0x1bd5('0x14')]['originChannel']||_0x1bd5('0x63'),'ChatOfflineMessageId':_0x53482['body']['message'][_0x1bd5('0x64')]||null},{'include':[{'model':db['Attachment'],'as':_0x1bd5('0x65')}]});})[_0x1bd5('0xc')](function(_0x560f20){_0x305720[_0x1bd5('0x14')]=_0x560f20;if(!_0x305720[_0x1bd5('0x5c')][_0x1bd5('0x66')]){return;}return db[_0x1bd5('0x67')][_0x1bd5('0x23')]({'attributes':['id',_0x1bd5('0x68')],'where':{'id':_0x305720['interaction'][_0x1bd5('0x66')]}});})[_0x1bd5('0xc')](function(_0xdd5183){if(_0xdd5183){_0x305720[_0x1bd5('0x44')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xdd5183[_0x1bd5('0x68')]+','+(_0x305720[_0x1bd5('0x43')][_0x1bd5('0x69')]||0xa),'interval':_0x1bd5('0x4c')});}if(!_0x305720['interaction'][_0x1bd5('0x6a')]){return;}return db['MailQueue']['find']({'attributes':['id',_0x1bd5('0x68')],'where':{'id':_0x305720['interaction'][_0x1bd5('0x6a')]}});})[_0x1bd5('0xc')](function(_0x231556){if(_0x231556){_0x305720[_0x1bd5('0x44')][_0x1bd5('0x6b')]({'id':0x0,'priority':0x1,'app':_0x1bd5('0x6c'),'appdata':_0x231556[_0x1bd5('0x68')]+','+(_0x305720[_0x1bd5('0x43')][_0x1bd5('0x6d')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x1bd5('0x6e'),'startRouting',_0x305720);})['then'](function(_0x59b491){_0x4074f1(_0x59b491);})[_0x1bd5('0x21')](function(_0x524b86){_0x4e8ff7(_0x2997a2[_0x1bd5('0x12')](0x1f4,_0x524b86[_0x1bd5('0x14')]));});});}; \ No newline at end of file +var _0xf69d=['redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','MailAccount','findAll','raw','options','attributes','limit','map','include','GetMailAccount','debug','catch','ShowMailAccount','find','where','model','setDataValue','smtpOptions','NotifyMailAccount','body','mail','CmContact','rawAttributes','createdAt','updatedAt','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','from','account','CmList','List','Contacts','Applications','MailServerOut','Smtp','CloudProvider','get','omit','getSmtpOptions','applications','list','orderBy','asc','length','close','autoclose','create','List\x20not\x20found','contact','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','Messages','inReplyTo','MailInteraction','Contact\x20not\x20found','update','format','interaction','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Attachment','Attachments','UserId','User','name','waitForTheAssignedAgent','queueId','MailQueue','unshift','queue','waitForTheAssignedQueue','*,*,*,*','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x44671c,_0x2a7436){var _0x5a61bc=function(_0x160765){while(--_0x160765){_0x44671c['push'](_0x44671c['shift']());}};_0x5a61bc(++_0x2a7436);}(_0xf69d,0xd3));var _0xdf69=function(_0x4dddcb,_0x52a7a6){_0x4dddcb=_0x4dddcb-0x0;var _0xde5319=_0xf69d[_0x4dddcb];return _0xde5319;};'use strict';var _=require(_0xdf69('0x0'));var moment=require(_0xdf69('0x1'));var BPromise=require(_0xdf69('0x2'));var rs=require(_0xdf69('0x3'));var Redis=require(_0xdf69('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0xdf69('0x5'))(_0xdf69('0x6'));var config=require(_0xdf69('0x7'));var jayson=require(_0xdf69('0x8'));var client=jayson[_0xdf69('0x9')][_0xdf69('0xa')]({'port':0x232c});config[_0xdf69('0xb')]=_[_0xdf69('0xc')](config[_0xdf69('0xb')],{'host':_0xdf69('0xd'),'port':0x18eb});var socket=require(_0xdf69('0xe'))(new Redis(config[_0xdf69('0xb')]));require(_0xdf69('0xf'))[_0xdf69('0x10')](socket);function respondWithRpcPromise(_0x40217f,_0x211ea9,_0x1e0e8d){return new BPromise(function(_0x4fcc93,_0x305726){return client[_0xdf69('0x11')](_0x40217f,_0x1e0e8d)[_0xdf69('0x12')](function(_0x21d8e0){logger[_0xdf69('0x13')](_0xdf69('0x14'),_0x211ea9,'request\x20sent');logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x211ea9,'request\x20sent',JSON[_0xdf69('0x15')](_0x21d8e0));if(_0x21d8e0[_0xdf69('0x16')]){if(_0x21d8e0[_0xdf69('0x16')][_0xdf69('0x17')]===0x1f4){logger[_0xdf69('0x16')](_0xdf69('0x14'),_0x211ea9,_0x21d8e0['error'][_0xdf69('0x18')]);return _0x305726(_0x21d8e0[_0xdf69('0x16')][_0xdf69('0x18')]);}logger[_0xdf69('0x16')]('MailAccount,\x20%s,\x20%s',_0x211ea9,_0x21d8e0[_0xdf69('0x16')]['message']);return _0x4fcc93(_0x21d8e0[_0xdf69('0x16')][_0xdf69('0x18')]);}else{logger['info'](_0xdf69('0x14'),_0x211ea9,_0xdf69('0x19'));_0x4fcc93(_0x21d8e0[_0xdf69('0x1a')][_0xdf69('0x18')]);}})['catch'](function(_0x5ae237){logger[_0xdf69('0x16')](_0xdf69('0x14'),_0x211ea9,_0x5ae237);_0x305726(_0x5ae237);});});}exports['GetMailAccount']=function(_0x32cf65){var _0x259e90=this;return new Promise(function(_0x68fa80,_0x526cbc){return db[_0xdf69('0x1b')][_0xdf69('0x1c')]({'raw':_0x32cf65['options']?_0x32cf65['options'][_0xdf69('0x1d')]===undefined?!![]:![]:!![],'where':_0x32cf65[_0xdf69('0x1e')]?_0x32cf65[_0xdf69('0x1e')]['where']||null:null,'attributes':_0x32cf65['options']?_0x32cf65['options'][_0xdf69('0x1f')]||null:null,'limit':_0x32cf65['options']?_0x32cf65[_0xdf69('0x1e')][_0xdf69('0x20')]||null:null,'include':_0x32cf65[_0xdf69('0x1e')]?_0x32cf65['options']['include']?_[_0xdf69('0x21')](_0x32cf65[_0xdf69('0x1e')][_0xdf69('0x22')],function(_0x3fd933){return{'model':db[_0x3fd933['model']],'as':_0x3fd933['as'],'attributes':_0x3fd933[_0xdf69('0x1f')],'include':_0x3fd933[_0xdf69('0x22')]?_[_0xdf69('0x21')](_0x3fd933['include'],function(_0x2da3df){return{'model':db[_0x2da3df['model']],'as':_0x2da3df['as'],'attributes':_0x2da3df['attributes'],'include':_0x2da3df['include']?_['map'](_0x2da3df[_0xdf69('0x22')],function(_0xe339ac){return{'model':db[_0xe339ac['model']],'as':_0xe339ac['as'],'attributes':_0xe339ac[_0xdf69('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xdf69('0x12')](function(_0x19cf2d){logger[_0xdf69('0x13')](_0xdf69('0x23'),_0x32cf65);logger[_0xdf69('0x24')](_0xdf69('0x23'),_0x32cf65,JSON[_0xdf69('0x15')](_0x19cf2d));_0x68fa80(_0x19cf2d);})[_0xdf69('0x25')](function(_0x3b97df){logger[_0xdf69('0x16')](_0xdf69('0x23'),_0x3b97df[_0xdf69('0x18')],_0x32cf65);_0x526cbc(_0x259e90[_0xdf69('0x16')](0x1f4,_0x3b97df[_0xdf69('0x18')]));});});};exports[_0xdf69('0x26')]=function(_0x1f4602){var _0x5ade53=this;return new Promise(function(_0xf910a0,_0x2aab76){return db[_0xdf69('0x1b')][_0xdf69('0x27')]({'raw':_0x1f4602[_0xdf69('0x1e')]?_0x1f4602['options'][_0xdf69('0x1d')]===undefined?!![]:![]:!![],'where':_0x1f4602['options']?_0x1f4602[_0xdf69('0x1e')][_0xdf69('0x28')]||null:null,'attributes':_0x1f4602['options']?_0x1f4602[_0xdf69('0x1e')]['attributes']||null:null,'include':_0x1f4602[_0xdf69('0x1e')]?_0x1f4602[_0xdf69('0x1e')][_0xdf69('0x22')]?_[_0xdf69('0x21')](_0x1f4602[_0xdf69('0x1e')]['include'],function(_0x175d5a){return{'model':db[_0x175d5a['model']],'as':_0x175d5a['as'],'attributes':_0x175d5a[_0xdf69('0x1f')],'include':_0x175d5a[_0xdf69('0x22')]?_[_0xdf69('0x21')](_0x175d5a[_0xdf69('0x22')],function(_0x5c38db){return{'model':db[_0x5c38db[_0xdf69('0x29')]],'as':_0x5c38db['as'],'attributes':_0x5c38db['attributes'],'include':_0x5c38db[_0xdf69('0x22')]?_['map'](_0x5c38db[_0xdf69('0x22')],function(_0x5d8e26){return{'model':db[_0x5d8e26[_0xdf69('0x29')]],'as':_0x5d8e26['as'],'attributes':_0x5d8e26[_0xdf69('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xdf69('0x12')](function(_0x2b7628){if(_0x1f4602[_0xdf69('0x1e')]['smtp']===!![])_0x2b7628[_0xdf69('0x2a')](_0xdf69('0x2b'),_0x2b7628['getSmtpOptions']());logger['info']('ShowMailAccount',_0x1f4602);logger['debug'](_0xdf69('0x26'),_0x1f4602,JSON['stringify'](_0x2b7628));_0xf910a0(_0x2b7628);})[_0xdf69('0x25')](function(_0x1c45b1){logger[_0xdf69('0x16')](_0xdf69('0x26'),_0x1c45b1['message'],_0x1f4602);_0x2aab76(_0x5ade53[_0xdf69('0x16')](0x1f4,_0x1c45b1[_0xdf69('0x18')]));});});};exports[_0xdf69('0x2c')]=function(_0x4f3370){var _0x216f62=this;return new Promise(function(_0xdd919d,_0x34ab67){var _0x1101ad={'body':_0x4f3370[_0xdf69('0x2d')],'channel':_0xdf69('0x2e')};var _0x4094d7=_['difference'](_['keys'](db[_0xdf69('0x2f')][_0xdf69('0x30')]),[_0xdf69('0x31'),_0xdf69('0x32'),'CompanyId','ListId']);var _0x5980b1=![];if(_0x4f3370['body']['id']){delete _0x4f3370[_0xdf69('0x2d')]['id'];}if(_['isNil'](_0x4f3370[_0xdf69('0x2d')]['from'])){return _0x34ab67(_0x216f62[_0xdf69('0x16')](0x1f4,_0xdf69('0x33')));}if(_[_0xdf69('0x34')](_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x2d')])||_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x2d')]===''){return _0x34ab67(_0x216f62[_0xdf69('0x16')](0x1f4,_0xdf69('0x35')));}if(_['isNil'](_0x4f3370['body'][_0xdf69('0x36')])){return _0x34ab67(_0x216f62['error'](0x1f4,_0xdf69('0x37')+_0x4094d7));}if(!_[_0xdf69('0x38')](_0x4094d7,_0x4f3370[_0xdf69('0x2d')]['mapKey'])){return _0x34ab67(_0x216f62[_0xdf69('0x16')](0x1f4,_0xdf69('0x39')+_0x4094d7));}var _0x4093e9={};_0x4093e9[_0x4f3370[_0xdf69('0x2d')]['mapKey']]=_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x3a')];return db['MailAccount']['find']({'where':{'id':_0x4f3370[_0xdf69('0x3b')]['id']},'include':[{'model':db[_0xdf69('0x3c')],'as':_0xdf69('0x3d'),'include':[{'model':db[_0xdf69('0x2f')],'as':_0xdf69('0x3e'),'where':_0x4093e9,'limit':0x1,'order':[[_0xdf69('0x32'),'DESC']]}]},{'model':db['MailApplication'],'as':_0xdf69('0x3f')},{'model':db[_0xdf69('0x40')],'as':_0xdf69('0x41'),'include':[{'model':db[_0xdf69('0x42')],'as':'CloudProvider'}]}]})['then'](function(_0xb34f76){if(_0xb34f76&&_0xb34f76[_0xdf69('0x3d')]){var _0x3ee7a5=_0xb34f76[_0xdf69('0x43')]({'plain':!![]});_0x1101ad[_0xdf69('0x3b')]=_[_0xdf69('0x44')](_0x3ee7a5,[_0xdf69('0x3f'),_0xdf69('0x3d')]);_0x1101ad[_0xdf69('0x3b')][_0xdf69('0x2b')]=_0xb34f76[_0xdf69('0x45')]();_0x1101ad[_0xdf69('0x46')]=_0x3ee7a5[_0xdf69('0x3f')];_0x1101ad[_0xdf69('0x47')]=_0x3ee7a5['List'];_0x1101ad[_0xdf69('0x46')]=_[_0xdf69('0x48')](_0x1101ad[_0xdf69('0x46')],['priority'],[_0xdf69('0x49')]);if(_0x1101ad[_0xdf69('0x3b')]&&_0x1101ad[_0xdf69('0x3b')]['autoclose']){_0x1101ad[_0xdf69('0x46')]['push']({'id':0x0,'priority':_0x1101ad[_0xdf69('0x46')][_0xdf69('0x4a')]+0x1,'app':_0xdf69('0x4b'),'appdata':_0xdf69('0x4c'),'interval':'*,*,*,*'});}if(_0x1101ad[_0xdf69('0x3b')][_0xdf69('0x3f')]){delete _0x1101ad[_0xdf69('0x3b')][_0xdf69('0x3f')];}if(_0x1101ad[_0xdf69('0x3b')][_0xdf69('0x3d')]){delete _0x1101ad[_0xdf69('0x3b')][_0xdf69('0x3d')];}if(_0x3ee7a5[_0xdf69('0x3d')]['Contacts'][_0xdf69('0x4a')]){return _0x3ee7a5[_0xdf69('0x3d')]['Contacts'][0x0];}var _0x44b011=_[_0xdf69('0xc')](_0x4f3370['body'],{'firstName':_0x4f3370['body'][_0xdf69('0x3a')],'ListId':_0x3ee7a5['ListId']});_0x44b011[_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x36')]]=_0x4f3370[_0xdf69('0x2d')]['from'];return db['CmContact'][_0xdf69('0x4d')](_0x44b011);}else{throw new Error(_0xdf69('0x4e'));}})[_0xdf69('0x12')](function(_0x45ed01){_0x1101ad[_0xdf69('0x4f')]=_0x45ed01;if(_0x45ed01){if(!_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x50')]){_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')]['messageId']=rs[_0xdf69('0x51')]()+'\x20'+_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x3a')];}var _0x11ee6c={'ContactId':_0x45ed01['id'],'MailAccountId':_0x4f3370[_0xdf69('0x3b')]['id'],'inReplyTo':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x50')],'to':_0x4f3370['body']['message'][_0xdf69('0x3a')],'cc':_0x4f3370[_0xdf69('0x2d')]['message']['cc'],'subject':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x52')],'attach':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x53')],'lastMsgAt':moment()['format'](_0xdf69('0x54')),'lastMsgDirection':'in'};return db['MailInteraction'][_0xdf69('0x27')]({'where':{'closed':![],'MailAccountId':_0x4f3370['account']['id']},'include':[{'model':db['MailMessage'],'as':_0xdf69('0x55'),'attributes':[_0xdf69('0x50')],'where':{'messageId':_0x4f3370['body'][_0xdf69('0x18')][_0xdf69('0x56')]}}]})[_0xdf69('0x12')](function(_0x29e6a3){if(_0x29e6a3){return[_0x29e6a3,![]];}return db[_0xdf69('0x57')][_0xdf69('0x4d')](_0x11ee6c)[_0xdf69('0x12')](function(_0x232a69){return[_0x232a69,!![]];});});}else{throw new Error(_0xdf69('0x58'));}})['spread'](function(_0x5cd512,_0x5a2c39){if(_0x5cd512){_0x5980b1=_0x5a2c39;if(!_0x5a2c39){return _0x5cd512[_0xdf69('0x59')]({'inReplyTo':_0x4f3370['body'][_0xdf69('0x18')][_0xdf69('0x50')],'to':_0x4f3370['body']['message'][_0xdf69('0x3a')],'cc':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')]['cc'],'subject':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x52')],'attach':_0x5cd512[_0xdf69('0x53')]?_0x5cd512[_0xdf69('0x53')]:_0x4f3370['body'][_0xdf69('0x18')][_0xdf69('0x53')],'substatus':null,'substatusAt':moment()[_0xdf69('0x5a')](_0xdf69('0x54')),'lastMsgAt':moment()['format'](_0xdf69('0x54')),'lastMsgDirection':'in'});}else{return _0x5cd512;}}})[_0xdf69('0x12')](function(_0x3914bf){_0x1101ad[_0xdf69('0x5b')]=_0x3914bf[_0xdf69('0x43')]({'plain':!![]});_0x1101ad['interaction']['created']=_0x5980b1;return db['MailMessage']['create']({'body':_0x4f3370['body'][_0xdf69('0x2d')],'MailAccountId':_0x4f3370['account']['id'],'MailInteractionId':_0x3914bf['id'],'direction':'in','ContactId':_0x1101ad['contact']['id'],'messageId':_0x4f3370['body']['message'][_0xdf69('0x50')],'from':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x3a')],'to':_0x4f3370['body'][_0xdf69('0x18')]['to'],'cc':_0x4f3370[_0xdf69('0x2d')]['message']['cc'],'subject':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x52')],'attach':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x53')],'Attachments':_0x4f3370[_0xdf69('0x2d')]['message'][_0xdf69('0x5c')],'originTo':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x5d')],'originCc':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x5e')],'bcc':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x5f')],'ChatWebsiteId':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x60')]||null,'originChannel':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')][_0xdf69('0x61')]||'Email','ChatOfflineMessageId':_0x4f3370[_0xdf69('0x2d')][_0xdf69('0x18')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0xdf69('0x62')],'as':_0xdf69('0x63')}]});})[_0xdf69('0x12')](function(_0x3aa055){_0x1101ad[_0xdf69('0x18')]=_0x3aa055;if(!_0x1101ad[_0xdf69('0x5b')][_0xdf69('0x64')]){return;}return db[_0xdf69('0x65')]['find']({'attributes':['id','name'],'where':{'id':_0x1101ad['interaction'][_0xdf69('0x64')]}});})[_0xdf69('0x12')](function(_0x4659b5){if(_0x4659b5){_0x1101ad['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4659b5[_0xdf69('0x66')]+','+(_0x1101ad[_0xdf69('0x3b')][_0xdf69('0x67')]||0xa),'interval':'*,*,*,*'});}if(!_0x1101ad['interaction'][_0xdf69('0x68')]){return;}return db[_0xdf69('0x69')][_0xdf69('0x27')]({'attributes':['id',_0xdf69('0x66')],'where':{'id':_0x1101ad['interaction'][_0xdf69('0x68')]}});})[_0xdf69('0x12')](function(_0x5b6a69){if(_0x5b6a69){_0x1101ad['applications'][_0xdf69('0x6a')]({'id':0x0,'priority':0x1,'app':_0xdf69('0x6b'),'appdata':_0x5b6a69['name']+','+(_0x1101ad[_0xdf69('0x3b')][_0xdf69('0x6c')]||0x12c),'interval':_0xdf69('0x6d')});}return respondWithRpcPromise('Start',_0xdf69('0x6e'),_0x1101ad);})['then'](function(_0x4ba3a0){_0xdd919d(_0x4ba3a0);})['catch'](function(_0x33f057){_0x34ab67(_0x216f62[_0xdf69('0x16')](0x1f4,_0x33f057[_0xdf69('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 4734953..9d7dfba 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 _0x3144=['emit','register','./mailAccount.events','remove','update'];(function(_0x43f2e1,_0xc8f6c){var _0x1d9f95=function(_0x5102e7){while(--_0x5102e7){_0x43f2e1['push'](_0x43f2e1['shift']());}};_0x1d9f95(++_0xc8f6c);}(_0x3144,0x1dd));var _0x4314=function(_0x1cdfe5,_0x94c864){_0x1cdfe5=_0x1cdfe5-0x0;var _0x35fe65=_0x3144[_0x1cdfe5];return _0x35fe65;};'use strict';var MailAccountEvents=require(_0x4314('0x0'));var events=['save',_0x4314('0x1'),_0x4314('0x2')];function createListener(_0x12a130,_0x558dd7){return function(_0x4b9217){_0x558dd7[_0x4314('0x3')](_0x12a130,_0x4b9217);};}function removeListener(_0xeed926,_0x3da15a){return function(){MailAccountEvents['removeListener'](_0xeed926,_0x3da15a);};}exports[_0x4314('0x4')]=function(_0x3157b9){for(var _0x4d36ea=0x0,_0x2b5856=events['length'];_0x4d36ea<_0x2b5856;_0x4d36ea++){var _0x23e09f=events[_0x4d36ea];var _0xb0ef3d=createListener('mailAccount:'+_0x23e09f,_0x3157b9);MailAccountEvents['on'](_0x23e09f,_0xb0ef3d);}}; \ No newline at end of file +var _0x8b09=['update','emit','removeListener','register','length','mailAccount:','./mailAccount.events','save','remove'];(function(_0x1ea4e3,_0x57ad7e){var _0x51030d=function(_0x423390){while(--_0x423390){_0x1ea4e3['push'](_0x1ea4e3['shift']());}};_0x51030d(++_0x57ad7e);}(_0x8b09,0x153));var _0x98b0=function(_0x3753b5,_0x65933d){_0x3753b5=_0x3753b5-0x0;var _0x12a74f=_0x8b09[_0x3753b5];return _0x12a74f;};'use strict';var MailAccountEvents=require(_0x98b0('0x0'));var events=[_0x98b0('0x1'),_0x98b0('0x2'),_0x98b0('0x3')];function createListener(_0x5e301b,_0x2e757a){return function(_0x4f0140){_0x2e757a[_0x98b0('0x4')](_0x5e301b,_0x4f0140);};}function removeListener(_0x54c6e7,_0x26e39d){return function(){MailAccountEvents[_0x98b0('0x5')](_0x54c6e7,_0x26e39d);};}exports[_0x98b0('0x6')]=function(_0x2c83d7){for(var _0x3ca831=0x0,_0x277011=events[_0x98b0('0x7')];_0x3ca831<_0x277011;_0x3ca831++){var _0xec2038=events[_0x3ca831];var _0x4ca573=createListener(_0x98b0('0x8')+_0xec2038,_0x2c83d7);MailAccountEvents['on'](_0xec2038,_0x4ca573);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index b2a97f6..8d7d8d4 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 _0x379b=['put','update','isAuthenticated','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','get','/:id','show'];(function(_0x4e76b0,_0x3168de){var _0x5d5358=function(_0x57db2a){while(--_0x57db2a){_0x4e76b0['push'](_0x4e76b0['shift']());}};_0x5d5358(++_0x3168de);}(_0x379b,0x1f4));var _0xb379=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x379b[_0x1928c9];return _0x51b5fb;};'use strict';var multer=require(_0xb379('0x0'));var util=require(_0xb379('0x1'));var path=require(_0xb379('0x2'));var timeout=require(_0xb379('0x3'));var express=require(_0xb379('0x4'));var router=express['Router']();var fs_extra=require(_0xb379('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb379('0x6'));var controller=require('./mailApplication.controller');router[_0xb379('0x7')](_0xb379('0x8'),auth['isAuthenticated'](),controller[_0xb379('0x9')]);router[_0xb379('0xa')](_0xb379('0x8'),auth['isAuthenticated'](),controller[_0xb379('0xb')]);router['delete'](_0xb379('0x8'),auth[_0xb379('0xc')](),controller[_0xb379('0xd')]);module[_0xb379('0xe')]=router; \ No newline at end of file +var _0x1ec1=['show','put','delete','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','get','/:id','isAuthenticated'];(function(_0x13b330,_0x297092){var _0x1f666c=function(_0x5ebc84){while(--_0x5ebc84){_0x13b330['push'](_0x13b330['shift']());}};_0x1f666c(++_0x297092);}(_0x1ec1,0x86));var _0x11ec=function(_0x14cec4,_0x3c65f7){_0x14cec4=_0x14cec4-0x0;var _0x21f076=_0x1ec1[_0x14cec4];return _0x21f076;};'use strict';var multer=require(_0x11ec('0x0'));var util=require(_0x11ec('0x1'));var path=require(_0x11ec('0x2'));var timeout=require(_0x11ec('0x3'));var express=require(_0x11ec('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x11ec('0x5'));var config=require('../../config/environment');var controller=require('./mailApplication.controller');router[_0x11ec('0x6')](_0x11ec('0x7'),auth[_0x11ec('0x8')](),controller[_0x11ec('0x9')]);router[_0x11ec('0xa')](_0x11ec('0x7'),auth[_0x11ec('0x8')](),controller['update']);router[_0x11ec('0xb')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x11ec('0xc')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 1c8fedd..0beb2b3 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 _0x3099=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x2ec0a0,_0x5165a6){var _0x5a112c=function(_0xdbadc4){while(--_0xdbadc4){_0x2ec0a0['push'](_0x2ec0a0['shift']());}};_0x5a112c(++_0x5165a6);}(_0x3099,0x1d6));var _0x9309=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3099[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x9309('0x0'));module[_0x9309('0x1')]={'priority':{'type':Sequelize[_0x9309('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9309('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x9309('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x9309('0x3')],'defaultValue':_0x9309('0x5')}}; \ No newline at end of file +var _0xfac5=['STRING','noop','TEXT','exports','INTEGER'];(function(_0x13f2ec,_0x407206){var _0x389ca9=function(_0x43d7d6){while(--_0x43d7d6){_0x13f2ec['push'](_0x13f2ec['shift']());}};_0x389ca9(++_0x407206);}(_0xfac5,0x111));var _0x5fac=function(_0x4439b0,_0x2df914){_0x4439b0=_0x4439b0-0x0;var _0x2ff05f=_0xfac5[_0x4439b0];return _0x2ff05f;};'use strict';var Sequelize=require('sequelize');module[_0x5fac('0x0')]={'priority':{'type':Sequelize[_0x5fac('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x5fac('0x2')],'allowNull':![],'defaultValue':_0x5fac('0x3')},'appdata':{'type':Sequelize[_0x5fac('0x4')]()},'description':{'type':Sequelize[_0x5fac('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index f842dbe..720ad7b 100644 --- a/server/api/mailApplication/mailApplication.controller.js +++ b/server/api/mailApplication/mailApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac4a=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x12f69e,_0x3d68ab){var _0x1f106c=function(_0x2905be){while(--_0x2905be){_0x12f69e['push'](_0x12f69e['shift']());}};_0x1f106c(++_0x3d68ab);}(_0xac4a,0x13f));var _0xaac4=function(_0x3e7591,_0x7c5097){_0x3e7591=_0x3e7591-0x0;var _0x529524=_0xac4a[_0x3e7591];return _0x529524;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require(_0xaac4('0x2'));var jsonpatch=require(_0xaac4('0x3'));var rp=require(_0xaac4('0x4'));var moment=require(_0xaac4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac4('0x6'));var path=require(_0xaac4('0x7'));var sox=require(_0xaac4('0x8'));var csv=require('to-csv');var ejs=require(_0xaac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaac4('0x14'))['db'];function respondWithStatusCode(_0x2e2d02,_0x45e512){_0x45e512=_0x45e512||0xcc;return function(_0x5a4801){if(_0x5a4801){return _0x2e2d02[_0xaac4('0x15')](_0x45e512);}return _0x2e2d02[_0xaac4('0x16')](_0x45e512)['end']();};}function respondWithResult(_0xf06b1d,_0x2b20d0){_0x2b20d0=_0x2b20d0||0xc8;return function(_0x46698d){if(_0x46698d){return _0xf06b1d[_0xaac4('0x16')](_0x2b20d0)[_0xaac4('0x17')](_0x46698d);}};}function respondWithFilteredResult(_0x2fbeb7,_0x31b7e5){return function(_0x1df9ae){if(_0x1df9ae){var _0x233278=typeof _0x31b7e5[_0xaac4('0x18')]===_0xaac4('0x19')&&typeof _0x31b7e5[_0xaac4('0x1a')]===_0xaac4('0x19');var _0x52686a=_0x1df9ae[_0xaac4('0x1b')];var _0x52085a=_0x233278?0x0:_0x31b7e5[_0xaac4('0x18')];var _0x5b6fd6=_0x233278?_0x1df9ae[_0xaac4('0x1b')]:_0x31b7e5[_0xaac4('0x18')]+_0x31b7e5[_0xaac4('0x1a')];var _0x271bcb;if(_0x5b6fd6>=_0x52686a){_0x5b6fd6=_0x52686a;_0x271bcb=0xc8;}else{_0x271bcb=0xce;}_0x2fbeb7[_0xaac4('0x16')](_0x271bcb);return _0x2fbeb7[_0xaac4('0x1c')](_0xaac4('0x1d'),_0x52085a+'-'+_0x5b6fd6+'/'+_0x52686a)[_0xaac4('0x17')](_0x1df9ae);}return null;};}function patchUpdates(_0x4166ee){return function(_0x480fb0){try{jsonpatch[_0xaac4('0x1e')](_0x480fb0,_0x4166ee,!![]);}catch(_0x4e1e89){return BPromise[_0xaac4('0x1f')](_0x4e1e89);}return _0x480fb0[_0xaac4('0x20')]();};}function saveUpdates(_0x43625c,_0x477b77){return function(_0x17140f){if(_0x17140f){return _0x17140f[_0xaac4('0x21')](_0x43625c)['then'](function(_0x43ccdc){return _0x43ccdc;});}return null;};}function removeEntity(_0x27a84d,_0x174860){return function(_0x4f10ec){if(_0x4f10ec){return _0x4f10ec[_0xaac4('0x22')]()[_0xaac4('0x23')](function(){_0x27a84d[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24186b,_0x4f1b65){return function(_0x54203b){if(!_0x54203b){_0x24186b['sendStatus'](0x194);}return _0x54203b;};}function handleError(_0x5a0bb3,_0x22d5a6){_0x22d5a6=_0x22d5a6||0x1f4;return function(_0x17d25f){logger[_0xaac4('0x24')](_0x17d25f[_0xaac4('0x25')]);if(_0x17d25f[_0xaac4('0x26')]){delete _0x17d25f[_0xaac4('0x26')];}_0x5a0bb3[_0xaac4('0x16')](_0x22d5a6)[_0xaac4('0x27')](_0x17d25f);};}exports[_0xaac4('0x28')]=function(_0x386c9b,_0x4d0f5f){var _0x316445={'raw':!![],'where':{'id':_0x386c9b[_0xaac4('0x29')]['id']}},_0x16b33c={};_0x16b33c[_0xaac4('0x2a')]=_[_0xaac4('0x2b')](db[_0xaac4('0x2c')]['rawAttributes']);_0x16b33c[_0xaac4('0x2d')]=_['keys'](_0x386c9b[_0xaac4('0x2d')]);_0x16b33c[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x16b33c[_0xaac4('0x2a')],_0x16b33c['query']);_0x316445['attributes']=_['intersection'](_0x16b33c[_0xaac4('0x2a')],qs[_0xaac4('0x30')](_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x30')]));_0x316445[_0xaac4('0x31')]=_0x316445[_0xaac4('0x31')][_0xaac4('0x32')]?_0x316445[_0xaac4('0x31')]:_0x16b33c[_0xaac4('0x2a')];if(_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x33')]){_0x316445[_0xaac4('0x34')]=[{'all':!![]}];}_0x316445=_[_0xaac4('0x35')]({},_0x316445,_0x386c9b[_0xaac4('0x36')]);return db[_0xaac4('0x2c')]['find'](_0x316445)['then'](handleEntityNotFound(_0x4d0f5f,null))[_0xaac4('0x23')](respondWithResult(_0x4d0f5f,null))[_0xaac4('0x37')](handleError(_0x4d0f5f,null));};exports[_0xaac4('0x21')]=function(_0x5e6080,_0x191d0f){if(_0x5e6080[_0xaac4('0x38')]['id']){delete _0x5e6080[_0xaac4('0x38')]['id'];}return db[_0xaac4('0x2c')][_0xaac4('0x39')]({'where':{'id':_0x5e6080[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x191d0f,null))['then'](saveUpdates(_0x5e6080[_0xaac4('0x38')],null))[_0xaac4('0x23')](respondWithResult(_0x191d0f,null))[_0xaac4('0x37')](handleError(_0x191d0f,null));};exports['destroy']=function(_0x36d84a,_0x497e7b){return db['MailApplication'][_0xaac4('0x39')]({'where':{'id':_0x36d84a[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x497e7b,null))['then'](removeEntity(_0x497e7b,null))['catch'](handleError(_0x497e7b,null));}; \ No newline at end of file +var _0xa9e0=['includeAll','merge','options','find','catch','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','show','params','model','MailApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length'];(function(_0x24fb14,_0x3dcf39){var _0x55a51f=function(_0x239bae){while(--_0x239bae){_0x24fb14['push'](_0x24fb14['shift']());}};_0x55a51f(++_0x3dcf39);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={'raw':!![],'where':{'id':_0x25fba9[_0x0a9e('0x28')]['id']}},_0x1538a4={};_0x1538a4[_0x0a9e('0x29')]=_['keys'](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x25fba9['query']);_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],_0x1538a4[_0x0a9e('0x2c')]);_0x140511[_0x0a9e('0x30')]=_[_0x0a9e('0x2f')](_0x1538a4[_0x0a9e('0x29')],qs[_0x0a9e('0x31')](_0x25fba9[_0x0a9e('0x2c')]['fields']));_0x140511[_0x0a9e('0x30')]=_0x140511['attributes'][_0x0a9e('0x32')]?_0x140511[_0x0a9e('0x30')]:_0x1538a4[_0x0a9e('0x29')];if(_0x25fba9[_0x0a9e('0x2c')][_0x0a9e('0x33')]){_0x140511['include']=[{'all':!![]}];}_0x140511=_[_0x0a9e('0x34')]({},_0x140511,_0x25fba9[_0x0a9e('0x35')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x36')](_0x140511)[_0x0a9e('0x22')](handleEntityNotFound(_0x14433c,null))[_0x0a9e('0x22')](respondWithResult(_0x14433c,null))[_0x0a9e('0x37')](handleError(_0x14433c,null));};exports[_0x0a9e('0x21')]=function(_0x5583a4,_0x44295a){if(_0x5583a4['body']['id']){delete _0x5583a4[_0x0a9e('0x38')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x36')]({'where':{'id':_0x5583a4[_0x0a9e('0x28')]['id']}})['then'](handleEntityNotFound(_0x44295a,null))[_0x0a9e('0x22')](saveUpdates(_0x5583a4[_0x0a9e('0x38')],null))[_0x0a9e('0x22')](respondWithResult(_0x44295a,null))[_0x0a9e('0x37')](handleError(_0x44295a,null));};exports['destroy']=function(_0x54135e,_0x1e8694){return db['MailApplication'][_0x0a9e('0x36')]({'where':{'id':_0x54135e[_0x0a9e('0x28')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x1e8694,null))[_0x0a9e('0x22')](removeEntity(_0x1e8694,null))['catch'](handleError(_0x1e8694,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index aaf14b2..b15ad70 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 _0x1a96=['../../config/environment','./mailApplication.attributes','exports','define','MailApplication','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x2451ba,_0x37308b){var _0xb8e2dd=function(_0x21a4da){while(--_0x21a4da){_0x2451ba['push'](_0x2451ba['shift']());}};_0xb8e2dd(++_0x37308b);}(_0x1a96,0xe6));var _0x61a9=function(_0x4c99fd,_0x4f57ba){_0x4c99fd=_0x4c99fd-0x0;var _0x5c33b8=_0x1a96[_0x4c99fd];return _0x5c33b8;};'use strict';var _=require(_0x61a9('0x0'));var util=require(_0x61a9('0x1'));var logger=require(_0x61a9('0x2'))('api');var moment=require(_0x61a9('0x3'));var BPromise=require(_0x61a9('0x4'));var rp=require(_0x61a9('0x5'));var fs=require('fs');var path=require(_0x61a9('0x6'));var rimraf=require(_0x61a9('0x7'));var config=require(_0x61a9('0x8'));var attributes=require(_0x61a9('0x9'));module[_0x61a9('0xa')]=function(_0x452595,_0x3d7aa1){return _0x452595[_0x61a9('0xb')](_0x61a9('0xc'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x61a9('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xa4ef=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0xa4ef,0x6a));var _0xfa4e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa4ef[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0xfa4e('0x0'));var util=require(_0xfa4e('0x1'));var logger=require(_0xfa4e('0x2'))(_0xfa4e('0x3'));var moment=require(_0xfa4e('0x4'));var BPromise=require('bluebird');var rp=require(_0xfa4e('0x5'));var fs=require('fs');var path=require(_0xfa4e('0x6'));var rimraf=require('rimraf');var config=require(_0xfa4e('0x7'));var attributes=require(_0xfa4e('0x8'));module[_0xfa4e('0x9')]=function(_0x39a7c4,_0x229803){return _0x39a7c4[_0xfa4e('0xa')](_0xfa4e('0xb'),attributes,{'tableName':_0xfa4e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfa4e('0xd'),'collate':_0xfa4e('0xe')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 1f5b134..3152844 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 _0xcc81=['UpdateMailApplication','MailApplication','body','options','where','attributes','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','MailApplication,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch'];(function(_0x1b25c1,_0x2c6ce6){var _0x1e4447=function(_0xaaafca){while(--_0xaaafca){_0x1b25c1['push'](_0x1b25c1['shift']());}};_0x1e4447(++_0x2c6ce6);}(_0xcc81,0x19c));var _0x1cc8=function(_0x22487b,_0x3a9021){_0x22487b=_0x22487b-0x0;var _0x2949ef=_0xcc81[_0x22487b];return _0x2949ef;};'use strict';var _=require(_0x1cc8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1cc8('0x1'));var rs=require(_0x1cc8('0x2'));var fs=require('fs');var Redis=require(_0x1cc8('0x3'));var db=require(_0x1cc8('0x4'))['db'];var utils=require(_0x1cc8('0x5'));var logger=require(_0x1cc8('0x6'))('rpc');var config=require(_0x1cc8('0x7'));var jayson=require(_0x1cc8('0x8'));var client=jayson['client'][_0x1cc8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29e813,_0x452253,_0x3c131a){return new BPromise(function(_0x59db9f,_0x2d1d17){return client[_0x1cc8('0xa')](_0x29e813,_0x3c131a)[_0x1cc8('0xb')](function(_0x15fafc){logger['info'](_0x1cc8('0xc'),_0x452253,'request\x20sent');logger['debug']('MailApplication,\x20%s,\x20%s,\x20%s',_0x452253,_0x1cc8('0xd'),JSON[_0x1cc8('0xe')](_0x15fafc));if(_0x15fafc['error']){if(_0x15fafc[_0x1cc8('0xf')]['code']===0x1f4){logger[_0x1cc8('0xf')]('MailApplication,\x20%s,\x20%s',_0x452253,_0x15fafc['error']['message']);return _0x2d1d17(_0x15fafc[_0x1cc8('0xf')]['message']);}logger[_0x1cc8('0xf')](_0x1cc8('0xc'),_0x452253,_0x15fafc['error'][_0x1cc8('0x10')]);return _0x59db9f(_0x15fafc[_0x1cc8('0xf')][_0x1cc8('0x10')]);}else{logger[_0x1cc8('0x11')]('MailApplication,\x20%s,\x20%s',_0x452253,_0x1cc8('0xd'));_0x59db9f(_0x15fafc[_0x1cc8('0x12')][_0x1cc8('0x10')]);}})[_0x1cc8('0x13')](function(_0x6bd235){logger[_0x1cc8('0xf')]('MailApplication,\x20%s,\x20%s',_0x452253,_0x6bd235);_0x2d1d17(_0x6bd235);});});}exports[_0x1cc8('0x14')]=function(_0x229af8){var _0x5c28dd=this;return new Promise(function(_0x2fcda9,_0xe700f7){return db[_0x1cc8('0x15')]['update'](_0x229af8[_0x1cc8('0x16')],{'raw':_0x229af8[_0x1cc8('0x17')]?_0x229af8[_0x1cc8('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x229af8['options']?_0x229af8[_0x1cc8('0x17')][_0x1cc8('0x18')]||null:null,'attributes':_0x229af8[_0x1cc8('0x17')]?_0x229af8['options'][_0x1cc8('0x19')]||null:null,'limit':_0x229af8['options']?_0x229af8['options']['limit']||null:null})[_0x1cc8('0xb')](function(_0x3bf0c3){logger[_0x1cc8('0x11')](_0x1cc8('0x14'),_0x229af8);logger[_0x1cc8('0x1a')](_0x1cc8('0x14'),_0x229af8,JSON[_0x1cc8('0xe')](_0x3bf0c3));_0x2fcda9(_0x3bf0c3);})[_0x1cc8('0x13')](function(_0x40409e){logger[_0x1cc8('0xf')]('UpdateMailApplication',_0x40409e[_0x1cc8('0x10')],_0x229af8);_0xe700f7(_0x5c28dd[_0x1cc8('0xf')](0x1f4,_0x40409e[_0x1cc8('0x10')]));});});}; \ No newline at end of file +var _0x0a29=['code','error','message','result','UpdateMailApplication','update','body','options','raw','where','attributes','then','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2f2377,_0x11cc21){var _0x441e6b=function(_0x1d0e90){while(--_0x1d0e90){_0x2f2377['push'](_0x2f2377['shift']());}};_0x441e6b(++_0x11cc21);}(_0x0a29,0x186));var _0x90a2=function(_0x5dc922,_0x26a255){_0x5dc922=_0x5dc922-0x0;var _0x22b97e=_0x0a29[_0x5dc922];return _0x22b97e;};'use strict';var _=require(_0x90a2('0x0'));var util=require(_0x90a2('0x1'));var moment=require('moment');var BPromise=require(_0x90a2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x90a2('0x3'));var db=require(_0x90a2('0x4'))['db'];var utils=require(_0x90a2('0x5'));var logger=require('../../config/logger')(_0x90a2('0x6'));var config=require('../../config/environment');var jayson=require(_0x90a2('0x7'));var client=jayson['client'][_0x90a2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x57f9e7,_0x48a4eb,_0x2e8367){return new BPromise(function(_0x490abb,_0x22d860){return client[_0x90a2('0x9')](_0x57f9e7,_0x2e8367)['then'](function(_0x439e4a){logger[_0x90a2('0xa')](_0x90a2('0xb'),_0x48a4eb,_0x90a2('0xc'));logger[_0x90a2('0xd')](_0x90a2('0xe'),_0x48a4eb,'request\x20sent',JSON[_0x90a2('0xf')](_0x439e4a));if(_0x439e4a['error']){if(_0x439e4a['error'][_0x90a2('0x10')]===0x1f4){logger[_0x90a2('0x11')](_0x90a2('0xb'),_0x48a4eb,_0x439e4a[_0x90a2('0x11')][_0x90a2('0x12')]);return _0x22d860(_0x439e4a[_0x90a2('0x11')][_0x90a2('0x12')]);}logger[_0x90a2('0x11')](_0x90a2('0xb'),_0x48a4eb,_0x439e4a[_0x90a2('0x11')][_0x90a2('0x12')]);return _0x490abb(_0x439e4a[_0x90a2('0x11')]['message']);}else{logger['info']('MailApplication,\x20%s,\x20%s',_0x48a4eb,_0x90a2('0xc'));_0x490abb(_0x439e4a[_0x90a2('0x13')]['message']);}})['catch'](function(_0x53d65d){logger['error'](_0x90a2('0xb'),_0x48a4eb,_0x53d65d);_0x22d860(_0x53d65d);});});}exports[_0x90a2('0x14')]=function(_0x558952){var _0x5eed3e=this;return new Promise(function(_0x31dda8,_0x8eeb06){return db['MailApplication'][_0x90a2('0x15')](_0x558952[_0x90a2('0x16')],{'raw':_0x558952[_0x90a2('0x17')]?_0x558952[_0x90a2('0x17')][_0x90a2('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x558952[_0x90a2('0x17')]?_0x558952['options'][_0x90a2('0x19')]||null:null,'attributes':_0x558952[_0x90a2('0x17')]?_0x558952[_0x90a2('0x17')][_0x90a2('0x1a')]||null:null,'limit':_0x558952[_0x90a2('0x17')]?_0x558952['options']['limit']||null:null})[_0x90a2('0x1b')](function(_0x28f583){logger[_0x90a2('0xa')](_0x90a2('0x14'),_0x558952);logger[_0x90a2('0xd')](_0x90a2('0x14'),_0x558952,JSON[_0x90a2('0xf')](_0x28f583));_0x31dda8(_0x28f583);})[_0x90a2('0x1c')](function(_0x369d88){logger[_0x90a2('0x11')](_0x90a2('0x14'),_0x369d88[_0x90a2('0x12')],_0x558952);_0x8eeb06(_0x5eed3e[_0x90a2('0x11')](0x1f4,_0x369d88[_0x90a2('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 2ba81d6..edb625b 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 _0x61f8=['tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','update','mailinteraction:destroy','destroy','removeTags','exports','express','Router','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','get','describe','/:id','/:id/messages','getMessages','/:id/download','post','create','/:id/tags'];(function(_0x14c68e,_0x47061d){var _0x87a0b9=function(_0x316570){while(--_0x316570){_0x14c68e['push'](_0x14c68e['shift']());}};_0x87a0b9(++_0x47061d);}(_0x61f8,0xa7));var _0x861f=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x61f8[_0x46698a];return _0x356db0;};'use strict';var express=require(_0x861f('0x0'));var router=express[_0x861f('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x861f('0x2'));var controller=require(_0x861f('0x3'));router['get']('/',auth[_0x861f('0x4')](),controller[_0x861f('0x5')]);router[_0x861f('0x6')]('/describe',auth[_0x861f('0x4')](),controller[_0x861f('0x7')]);router['get'](_0x861f('0x8'),auth[_0x861f('0x4')](),controller['show']);router[_0x861f('0x6')](_0x861f('0x9'),auth[_0x861f('0x4')](),controller[_0x861f('0xa')]);router[_0x861f('0x6')](_0x861f('0xb'),auth[_0x861f('0x4')](),controller['download']);router[_0x861f('0xc')]('/',auth[_0x861f('0x4')](),controller[_0x861f('0xd')]);router[_0x861f('0xc')](_0x861f('0x9'),auth[_0x861f('0x4')](),controller['addMessage']);router[_0x861f('0xc')](_0x861f('0xe'),auth['isAuthenticated'](),interaction[_0x861f('0xf')](_0x861f('0x10'),_0x861f('0x11')),controller[_0x861f('0x12')]);router[_0x861f('0x13')]('/:id',auth[_0x861f('0x4')](),interaction[_0x861f('0xf')](_0x861f('0x10'),_0x861f('0x14')),controller[_0x861f('0x15')]);router['delete'](_0x861f('0x8'),auth[_0x861f('0x4')](),interaction[_0x861f('0xf')](_0x861f('0x10'),_0x861f('0x16')),controller[_0x861f('0x17')]);router['delete'](_0x861f('0xe'),auth[_0x861f('0x4')](),controller[_0x861f('0x18')]);module[_0x861f('0x19')]=router; \ No newline at end of file +var _0x29fb=['describe','/:id','show','/:id/messages','post','create','addMessage','/:id/tags','tracked','mailinteraction:addtags','addTags','put','mail','update','delete','destroy','removeTags','exports','express','Router','../../components/auth/service','./mailInteraction.controller','get','isAuthenticated','index'];(function(_0xb6fea8,_0x168b47){var _0xfba656=function(_0x1b5094){while(--_0x1b5094){_0xb6fea8['push'](_0xb6fea8['shift']());}};_0xfba656(++_0x168b47);}(_0x29fb,0xf3));var _0xb29f=function(_0x37d55d,_0x418158){_0x37d55d=_0x37d55d-0x0;var _0x54ca76=_0x29fb[_0x37d55d];return _0x54ca76;};'use strict';var express=require(_0xb29f('0x0'));var router=express[_0xb29f('0x1')]();var auth=require(_0xb29f('0x2'));var interaction=require('../../components/interaction/service');var controller=require(_0xb29f('0x3'));router[_0xb29f('0x4')]('/',auth[_0xb29f('0x5')](),controller[_0xb29f('0x6')]);router[_0xb29f('0x4')]('/describe',auth[_0xb29f('0x5')](),controller[_0xb29f('0x7')]);router[_0xb29f('0x4')](_0xb29f('0x8'),auth[_0xb29f('0x5')](),controller[_0xb29f('0x9')]);router[_0xb29f('0x4')](_0xb29f('0xa'),auth['isAuthenticated'](),controller['getMessages']);router[_0xb29f('0x4')]('/:id/download',auth[_0xb29f('0x5')](),controller['download']);router[_0xb29f('0xb')]('/',auth[_0xb29f('0x5')](),controller[_0xb29f('0xc')]);router[_0xb29f('0xb')]('/:id/messages',auth[_0xb29f('0x5')](),controller[_0xb29f('0xd')]);router[_0xb29f('0xb')](_0xb29f('0xe'),auth[_0xb29f('0x5')](),interaction[_0xb29f('0xf')]('mail',_0xb29f('0x10')),controller[_0xb29f('0x11')]);router[_0xb29f('0x12')]('/:id',auth[_0xb29f('0x5')](),interaction['tracked'](_0xb29f('0x13'),'mailinteraction:update'),controller[_0xb29f('0x14')]);router[_0xb29f('0x15')](_0xb29f('0x8'),auth[_0xb29f('0x5')](),interaction['tracked'](_0xb29f('0x13'),'mailinteraction:destroy'),controller[_0xb29f('0x16')]);router[_0xb29f('0x15')](_0xb29f('0xe'),auth[_0xb29f('0x5')](),controller[_0xb29f('0x17')]);module[_0xb29f('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 16512ac..ec675dc 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 _0x598b=['STRING','TEXT','long','ENUM','out','INTEGER','sequelize','exports','BOOLEAN','DATE'];(function(_0x37add7,_0x396960){var _0x41053d=function(_0x242477){while(--_0x242477){_0x37add7['push'](_0x37add7['shift']());}};_0x41053d(++_0x396960);}(_0x598b,0xba));var _0xb598=function(_0x25c856,_0x426670){_0x25c856=_0x25c856-0x0;var _0x40480b=_0x598b[_0x25c856];return _0x40480b;};'use strict';var Sequelize=require(_0xb598('0x0'));var iconv=require('iconv');module[_0xb598('0x1')]={'closed':{'type':Sequelize[_0xb598('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb598('0x3')]},'disposition':{'type':Sequelize[_0xb598('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xb598('0x4')]},'note':{'type':Sequelize[_0xb598('0x4')]},'inReplyTo':{'type':Sequelize[_0xb598('0x4')](0x1fe)},'to':{'type':Sequelize[_0xb598('0x4')]},'cc':{'type':Sequelize[_0xb598('0x5')](_0xb598('0x6'))},'subject':{'type':Sequelize[_0xb598('0x5')]()},'attach':{'type':Sequelize[_0xb598('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xb598('0x3')]},'substatus':{'type':Sequelize[_0xb598('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xb598('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xb598('0x7')]('in',_0xb598('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb598('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb598('0x7')]('in',_0xb598('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb598('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xb598('0x9')]}}; \ No newline at end of file +var _0xae95=['TEXT','long','DATE','ENUM','out','INTEGER','sequelize','iconv','exports','BOOLEAN','STRING'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xae95,0x17c));var _0x5ae9=function(_0x97feb1,_0x524c){_0x97feb1=_0x97feb1-0x0;var _0x5b0221=_0xae95[_0x97feb1];return _0x5b0221;};'use strict';var Sequelize=require(_0x5ae9('0x0'));var iconv=require(_0x5ae9('0x1'));module[_0x5ae9('0x2')]={'closed':{'type':Sequelize[_0x5ae9('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x5ae9('0x4')]},'secondDisposition':{'type':Sequelize[_0x5ae9('0x4')]},'thirdDisposition':{'type':Sequelize[_0x5ae9('0x4')]},'note':{'type':Sequelize[_0x5ae9('0x4')]},'inReplyTo':{'type':Sequelize[_0x5ae9('0x4')](0x1fe)},'to':{'type':Sequelize[_0x5ae9('0x4')]},'cc':{'type':Sequelize[_0x5ae9('0x5')](_0x5ae9('0x6'))},'subject':{'type':Sequelize[_0x5ae9('0x5')]()},'attach':{'type':Sequelize[_0x5ae9('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x5ae9('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0x5ae9('0x7')]},'firstMsgDirection':{'type':Sequelize[_0x5ae9('0x8')]('in',_0x5ae9('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x5ae9('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x5ae9('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x5ae9('0xa')]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index df81c0a..ea63227 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 _0xba82=['Bcc','basename','push','build','writeFileSync','unlinkSync','eml-format','rimraf','zip-dir','bluebird','util','path','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','register','sendStatus','status','offset','undefined','count','limit','set','json','then','error','stack','name','index','map','rawAttributes','fieldName','key','user','catch','show','params','model','keys','MailInteraction','query','filters','intersection','fields','attributes','include','merge','options','find','create','body','destroy','describe','addMessage','MailMessage','ids','omit','getMessages','length','hasOwnProperty','nolimit','order','sort','where','pick','MailInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','rows','addTags','setTags','spread','Tag','findAll','color','emit','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','format','Attachments','Messages','from','bcc','subject','createdAt','get','mkdirSync','each','missing.recipient@your.company.com','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xba82,0xe6));var _0x2ba8=function(_0xe0b7a6,_0x5b8b51){_0xe0b7a6=_0xe0b7a6-0x0;var _0x7f4027=_0xba82[_0xe0b7a6];return _0x7f4027;};'use strict';var emlformat=require(_0x2ba8('0x0'));var rimraf=require(_0x2ba8('0x1'));var zipdir=require(_0x2ba8('0x2'));var moment=require('moment');var BPromise=require(_0x2ba8('0x3'));var util=require(_0x2ba8('0x4'));var path=require(_0x2ba8('0x5'));var fs=require('fs');var _=require('lodash');var juice=require(_0x2ba8('0x6'));var Redis=require(_0x2ba8('0x7'));var interaction=require(_0x2ba8('0x8'));var qs=require(_0x2ba8('0x9'));var logger=require(_0x2ba8('0xa'))('api');var config=require(_0x2ba8('0xb'));var db=require(_0x2ba8('0xc'))['db'];var htmlEntities=require(_0x2ba8('0xd'));config[_0x2ba8('0xe')]=_[_0x2ba8('0xf')](config[_0x2ba8('0xe')],{'host':_0x2ba8('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2ba8('0xe')]));require('./mailInteraction.socket')[_0x2ba8('0x11')](socket);function respondWithStatusCode(_0x9b449b,_0x3cb472){_0x3cb472=_0x3cb472||0xcc;return function(_0x37c90b){if(_0x37c90b){return _0x9b449b[_0x2ba8('0x12')](_0x3cb472);}return _0x9b449b[_0x2ba8('0x13')](_0x3cb472)['end']();};}function respondWithResult(_0x263375,_0x8e4a56){_0x8e4a56=_0x8e4a56||0xc8;return function(_0xbbc01d){if(_0xbbc01d){return _0x263375[_0x2ba8('0x13')](_0x8e4a56)['json'](_0xbbc01d);}};}function respondWithFilteredResult(_0x2a5c7d,_0x37d5e2){return function(_0x34d95d){if(_0x34d95d){var _0x542386=typeof _0x37d5e2[_0x2ba8('0x14')]===_0x2ba8('0x15')&&typeof _0x37d5e2['limit']===_0x2ba8('0x15');var _0xb6942e=_0x34d95d[_0x2ba8('0x16')];var _0x233bef=_0x542386?0x0:_0x37d5e2['offset'];var _0x5c7758=_0x542386?_0x34d95d['count']:_0x37d5e2[_0x2ba8('0x14')]+_0x37d5e2[_0x2ba8('0x17')];var _0x3f9c15;if(_0x5c7758>=_0xb6942e){_0x5c7758=_0xb6942e;_0x3f9c15=0xc8;}else{_0x3f9c15=0xce;}_0x2a5c7d['status'](_0x3f9c15);return _0x2a5c7d[_0x2ba8('0x18')]('Content-Range',_0x233bef+'-'+_0x5c7758+'/'+_0xb6942e)[_0x2ba8('0x19')](_0x34d95d);}return null;};}function saveUpdates(_0x44978b){return function(_0x335990){if(_0x335990){return _0x335990['update'](_0x44978b)[_0x2ba8('0x1a')](function(_0x30f8c3){return _0x30f8c3;});}return null;};}function removeEntity(_0x97f004){return function(_0xfad60c){if(_0xfad60c){return _0xfad60c['destroy']()[_0x2ba8('0x1a')](function(){_0x97f004['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x306c7b){return function(_0x509cb6){if(!_0x509cb6){_0x306c7b['sendStatus'](0x194);}return _0x509cb6;};}function handleError(_0x23376a,_0x5ed0b5){_0x5ed0b5=_0x5ed0b5||0x1f4;return function(_0x57f505){logger[_0x2ba8('0x1b')](_0x57f505[_0x2ba8('0x1c')]);if(_0x57f505[_0x2ba8('0x1d')]){delete _0x57f505[_0x2ba8('0x1d')];}_0x23376a[_0x2ba8('0x13')](_0x5ed0b5)['send'](_0x57f505);};}exports[_0x2ba8('0x1e')]=function(_0x25dd5a,_0x2aa059){var _0x2a924f={};var _0x4a20c6=_[_0x2ba8('0x1f')](db['MailInteraction'][_0x2ba8('0x20')],function(_0x23e250){return{'name':_0x23e250[_0x2ba8('0x21')],'type':_0x23e250['type'][_0x2ba8('0x22')]};});_0x2a924f=qs['getOptions'](_0x4a20c6,_0x25dd5a);return interaction['findAll']('mail',_0x25dd5a['query'],_0x25dd5a[_0x2ba8('0x23')],_0x2a924f,_0x4a20c6)[_0x2ba8('0x1a')](respondWithFilteredResult(_0x2aa059,_0x2a924f))[_0x2ba8('0x24')](handleError(_0x2aa059,null));};exports[_0x2ba8('0x25')]=function(_0x64ccde,_0x7b984b){var _0x143686={'raw':![],'where':{'id':_0x64ccde[_0x2ba8('0x26')]['id']}},_0x13d65a={};_0x13d65a[_0x2ba8('0x27')]=_[_0x2ba8('0x28')](db[_0x2ba8('0x29')][_0x2ba8('0x20')]);_0x13d65a[_0x2ba8('0x2a')]=_[_0x2ba8('0x28')](_0x64ccde[_0x2ba8('0x2a')]);_0x13d65a[_0x2ba8('0x2b')]=_['intersection'](_0x13d65a[_0x2ba8('0x27')],_0x13d65a[_0x2ba8('0x2a')]);_0x143686['attributes']=_[_0x2ba8('0x2c')](_0x13d65a[_0x2ba8('0x27')],qs['fields'](_0x64ccde['query'][_0x2ba8('0x2d')]));_0x143686['attributes']=_0x143686[_0x2ba8('0x2e')]['length']?_0x143686['attributes']:_0x13d65a['model'];if(_0x64ccde[_0x2ba8('0x2a')]['includeAll']){_0x143686[_0x2ba8('0x2f')]=[{'all':!![]}];}_0x143686=_[_0x2ba8('0x30')]({},_0x143686,_0x64ccde[_0x2ba8('0x31')]);return db[_0x2ba8('0x29')][_0x2ba8('0x32')](_0x143686)[_0x2ba8('0x1a')](handleEntityNotFound(_0x7b984b,null))[_0x2ba8('0x1a')](respondWithResult(_0x7b984b,null))['catch'](handleError(_0x7b984b,null));};exports[_0x2ba8('0x33')]=function(_0x372fe5,_0x40cc9b){return db[_0x2ba8('0x29')]['create'](_0x372fe5[_0x2ba8('0x34')],{})[_0x2ba8('0x1a')](respondWithResult(_0x40cc9b,0xc9))[_0x2ba8('0x24')](handleError(_0x40cc9b,null));};exports['update']=function(_0x5ee6fa,_0x4fd547){if(_0x5ee6fa[_0x2ba8('0x34')]['id']){delete _0x5ee6fa['body']['id'];}return db[_0x2ba8('0x29')]['find']({'where':{'id':_0x5ee6fa[_0x2ba8('0x26')]['id']}})[_0x2ba8('0x1a')](handleEntityNotFound(_0x4fd547,null))['then'](saveUpdates(_0x5ee6fa[_0x2ba8('0x34')],null))['then'](respondWithResult(_0x4fd547,null))[_0x2ba8('0x24')](handleError(_0x4fd547,null));};exports[_0x2ba8('0x35')]=function(_0x550cce,_0x41baa8){return db[_0x2ba8('0x29')][_0x2ba8('0x32')]({'where':{'id':_0x550cce[_0x2ba8('0x26')]['id']}})[_0x2ba8('0x1a')](handleEntityNotFound(_0x41baa8,null))[_0x2ba8('0x1a')](removeEntity(_0x41baa8,null))[_0x2ba8('0x24')](handleError(_0x41baa8,null));};exports[_0x2ba8('0x36')]=function(_0x31a7bb,_0x583746){return db[_0x2ba8('0x29')][_0x2ba8('0x36')]()[_0x2ba8('0x1a')](respondWithResult(_0x583746,null))[_0x2ba8('0x24')](handleError(_0x583746,null));};exports[_0x2ba8('0x37')]=function(_0x4ed2c1,_0x87a730){return db[_0x2ba8('0x38')][_0x2ba8('0x32')]({'where':{'id':_0x4ed2c1[_0x2ba8('0x26')]['id']}})[_0x2ba8('0x1a')](handleEntityNotFound(_0x87a730,null))[_0x2ba8('0x1a')](function(_0x24c966){if(_0x24c966){return _0x24c966[_0x2ba8('0x37')](_0x4ed2c1[_0x2ba8('0x34')][_0x2ba8('0x39')],_[_0x2ba8('0x3a')](_0x4ed2c1[_0x2ba8('0x34')],[_0x2ba8('0x39'),'id'])||{});}})[_0x2ba8('0x1a')](respondWithResult(_0x87a730,null))[_0x2ba8('0x24')](handleError(_0x87a730,null));};exports[_0x2ba8('0x3b')]=function(_0x2ddf4c,_0x3374fc){var _0x229210={'raw':![],'where':{}};var _0x10e49a={};var _0x77d186={'count':0x0,'rows':[]};return db[_0x2ba8('0x29')]['findOne']({'where':{'id':_0x2ddf4c[_0x2ba8('0x26')]['id']}})[_0x2ba8('0x1a')](handleEntityNotFound(_0x3374fc,null))['then'](function(_0x4d7929){if(_0x4d7929){_0x10e49a[_0x2ba8('0x27')]=_['keys'](db[_0x2ba8('0x38')][_0x2ba8('0x20')]);_0x10e49a[_0x2ba8('0x2a')]=_[_0x2ba8('0x28')](_0x2ddf4c['query']);_0x10e49a[_0x2ba8('0x2b')]=_[_0x2ba8('0x2c')](_0x10e49a[_0x2ba8('0x27')],_0x10e49a[_0x2ba8('0x2a')]);_0x229210['attributes']=_['intersection'](_0x10e49a[_0x2ba8('0x27')],qs[_0x2ba8('0x2d')](_0x2ddf4c[_0x2ba8('0x2a')][_0x2ba8('0x2d')]));_0x229210['attributes']=_0x229210[_0x2ba8('0x2e')][_0x2ba8('0x3c')]?_0x229210[_0x2ba8('0x2e')]:_0x10e49a[_0x2ba8('0x27')];if(!_0x2ddf4c['query'][_0x2ba8('0x3d')](_0x2ba8('0x3e'))){_0x229210[_0x2ba8('0x17')]=qs[_0x2ba8('0x17')](_0x2ddf4c[_0x2ba8('0x2a')][_0x2ba8('0x17')]);_0x229210[_0x2ba8('0x14')]=qs[_0x2ba8('0x14')](_0x2ddf4c[_0x2ba8('0x2a')]['offset']);}_0x229210[_0x2ba8('0x3f')]=qs['sort'](_0x2ddf4c[_0x2ba8('0x2a')][_0x2ba8('0x40')]);_0x229210[_0x2ba8('0x41')]=qs[_0x2ba8('0x2b')](_[_0x2ba8('0x42')](_0x2ddf4c[_0x2ba8('0x2a')],_0x10e49a[_0x2ba8('0x2b')]));_0x229210[_0x2ba8('0x41')][_0x2ba8('0x43')]=_0x4d7929['id'];if(_0x2ddf4c[_0x2ba8('0x2a')][_0x2ba8('0x44')]){_0x229210[_0x2ba8('0x41')]=_['merge'](_0x229210['where'],{'$or':_[_0x2ba8('0x1f')](_0x229210[_0x2ba8('0x2e')],function(_0x5a80ed){var _0x110d7={};_0x110d7[_0x5a80ed]={'$like':'%'+_0x2ddf4c[_0x2ba8('0x2a')][_0x2ba8('0x44')]+'%'};return _0x110d7;})});}if(_0x2ddf4c['query'][_0x2ba8('0x45')]){var _0x5c9fad=_0x2ddf4c[_0x2ba8('0x2a')][_0x2ba8('0x45')][_0x2ba8('0x46')](',');var _0x17e5a7={};_0x17e5a7[_0x5c9fad[0x0]]={'$gte':moment(_0x5c9fad[0x1])['format'](_0x2ba8('0x47'))};_0x229210[_0x2ba8('0x41')]=_[_0x2ba8('0x30')](_0x229210[_0x2ba8('0x41')],_0x17e5a7);}_0x229210=_[_0x2ba8('0x30')]({},_0x229210,_0x2ddf4c[_0x2ba8('0x31')]);return db['MailMessage']['count']({'where':_0x229210[_0x2ba8('0x41')]})[_0x2ba8('0x1a')](function(_0x5b8fa1){_0x77d186[_0x2ba8('0x16')]=_0x5b8fa1;if(_0x2ddf4c['query']['includeAll']){_0x229210[_0x2ba8('0x2f')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x229210);})[_0x2ba8('0x1a')](function(_0x50da6b){if(_0x2ddf4c[_0x2ba8('0x2a')][_0x2ba8('0x48')]===_0x2ba8('0x49')){for(var _0xbb68fe=0x0;_0xbb68fe<_0x50da6b[_0x2ba8('0x3c')];_0xbb68fe++){_0x50da6b[_0xbb68fe][_0x2ba8('0x34')]=juice(_0x50da6b[_0xbb68fe]['body']);}}_0x77d186[_0x2ba8('0x4a')]=_0x50da6b;return _0x77d186;});}})['then'](respondWithFilteredResult(_0x3374fc,_0x229210))[_0x2ba8('0x24')](handleError(_0x3374fc,null));};exports[_0x2ba8('0x4b')]=function(_0x212939,_0x4791e3){return db[_0x2ba8('0x29')][_0x2ba8('0x32')]({'where':{'id':_0x212939['params']['id']}})['then'](handleEntityNotFound(_0x4791e3,null))[_0x2ba8('0x1a')](function(_0x786374){if(_0x786374){return _0x786374[_0x2ba8('0x4c')](_0x212939[_0x2ba8('0x34')][_0x2ba8('0x39')],_['omit'](_0x212939[_0x2ba8('0x34')],[_0x2ba8('0x39'),'id'])||{})[_0x2ba8('0x4d')](function(){return db[_0x2ba8('0x4e')][_0x2ba8('0x4f')]({'attributes':['id','name',_0x2ba8('0x50')],'where':{'id':_0x212939[_0x2ba8('0x34')][_0x2ba8('0x39')]}});})['then'](function(_0x2100c8){socket[_0x2ba8('0x51')]('mailInteractionTags:save',{'id':Number(_0x212939['params']['id']),'tags':_0x2100c8||[]});return{'id':Number(_0x212939[_0x2ba8('0x26')]['id']),'tags':_0x2100c8||[]};});}})[_0x2ba8('0x1a')](respondWithResult(_0x4791e3,null))['catch'](handleError(_0x4791e3,null));};exports[_0x2ba8('0x52')]=function(_0x2a1bf9,_0x503061){return db[_0x2ba8('0x29')][_0x2ba8('0x32')]({'where':{'id':_0x2a1bf9[_0x2ba8('0x26')]['id']}})[_0x2ba8('0x1a')](handleEntityNotFound(_0x503061,null))[_0x2ba8('0x1a')](function(_0x1acb4e){if(_0x1acb4e){return _0x1acb4e[_0x2ba8('0x52')](_0x2a1bf9[_0x2ba8('0x2a')][_0x2ba8('0x39')]);}})['then'](respondWithStatusCode(_0x503061,null))[_0x2ba8('0x24')](handleError(_0x503061,null));};exports[_0x2ba8('0x53')]=function(_0xe7eb3e,_0x10d518){var _0x2d2e81=moment()[_0x2ba8('0x54')]()[_0x2ba8('0x55')]();var _0x29e829=path[_0x2ba8('0x56')](config[_0x2ba8('0x57')],_0x2ba8('0x58'),_0x2ba8('0x59'),_0x2ba8('0x5a'));var _0x1a9f1b=path[_0x2ba8('0x56')](config[_0x2ba8('0x57')],_0x2ba8('0x58'),_0x2ba8('0x59'),_0x2ba8('0x5b'));var _0x4a6662=path[_0x2ba8('0x56')](_0x29e829,_0x2d2e81);var _0x516f08=util[_0x2ba8('0x5c')]('transcript-%d-%s.zip',_0xe7eb3e['params']['id'],_0x2d2e81);var _0x470cdd=path[_0x2ba8('0x56')](_0x29e829,_0x516f08);var _0xe76795=[];if(_0xe7eb3e['query'][_0x2ba8('0x5b')]){_0xe76795['push']({'model':db['Attachment'],'as':_0x2ba8('0x5d'),'raw':!![]});}var _0x23630f=[{'model':db['MailMessage'],'as':_0x2ba8('0x5e'),'attributes':['id','body',_0x2ba8('0x5f'),'to','cc',_0x2ba8('0x60'),_0x2ba8('0x61'),_0x2ba8('0x62')],'where':{'secret':![]},'order':qs[_0x2ba8('0x40')]('id'),'include':_0xe76795}];return db['MailInteraction'][_0x2ba8('0x32')]({'where':{'id':_0xe7eb3e['params']['id']},'include':_0x23630f})['then'](handleEntityNotFound(_0x10d518,null))['then'](function(_0xe7da70){if(_0xe7da70&&_0xe7da70[_0x2ba8('0x5e')]){var _0x29e983=_0xe7da70[_0x2ba8('0x63')]({'plain':!![]});fs[_0x2ba8('0x64')](_0x4a6662);return BPromise[_0x2ba8('0x65')](_0x29e983[_0x2ba8('0x5e')],function(_0x458dd1,_0xf4fe40){var _0x23375f={'from':_0x458dd1[_0x2ba8('0x5f')],'to':_0x458dd1['to']||_0x2ba8('0x66'),'subject':_0x458dd1[_0x2ba8('0x61')],'html':htmlEntities[_0x2ba8('0x67')](_0x458dd1['body']),'headers':{'Date':moment(_0x458dd1[_0x2ba8('0x62')])['format'](_0x2ba8('0x68'))},'attachments':[]};if(_0x458dd1['cc']){_0x23375f[_0x2ba8('0x69')]['Cc']=_0x458dd1['cc'];}if(_0x458dd1[_0x2ba8('0x60')]){_0x23375f[_0x2ba8('0x69')][_0x2ba8('0x6a')]=_0x458dd1[_0x2ba8('0x60')];}return new BPromise(function(_0x206225,_0x959055){if(_0x458dd1['Attachments']){for(var _0x4bbeeb=0x0;_0x4bbeeb<_0x458dd1[_0x2ba8('0x5d')]['length'];_0x4bbeeb++){var _0x29df79=_0x458dd1[_0x2ba8('0x5d')][_0x4bbeeb];var _0x55c464=path[_0x2ba8('0x56')](_0x1a9f1b,_0x29df79[_0x2ba8('0x6b')]);if(fs['existsSync'](_0x55c464)){_0x23375f[_0x2ba8('0x5b')][_0x2ba8('0x6c')]({'name':_0x29df79[_0x2ba8('0x1d')],'contentType':_0x29df79['type'],'data':fs['readFileSync'](_0x55c464)});}}}emlformat[_0x2ba8('0x6d')](_0x23375f,function(_0xe8b2bd,_0x2e82b0){if(_0xe8b2bd)return _0x959055(_0xe8b2bd);fs[_0x2ba8('0x6e')](path[_0x2ba8('0x56')](_0x4a6662,util[_0x2ba8('0x5c')]('message%d.eml',_0xf4fe40)),_0x2e82b0);return _0x206225(_0x2e82b0);});});})[_0x2ba8('0x1a')](function(){return new BPromise(function(_0x203541,_0x377eab){zipdir(_0x4a6662,{'saveTo':_0x470cdd},function(_0x1c42cb,_0x50fa84){if(_0x1c42cb)return _0x377eab(_0x1c42cb);return _0x203541(_0x50fa84);});})['then'](function(){return new BPromise(function(_0x4a70c0,_0x24bf74){rimraf(_0x4a6662,function(_0x3e6d6e){if(_0x3e6d6e)_0x24bf74(_0x3e6d6e);return _0x4a70c0();});});})[_0x2ba8('0x1a')](function(){return _0x10d518[_0x2ba8('0x53')](_0x470cdd,_0x516f08,function(_0x1ee68d){if(!_0x1ee68d)fs[_0x2ba8('0x6f')](_0x470cdd);});});});}else{return _0x10d518['sendStatus'](0xc8);}})['catch'](handleError(_0x10d518,null));}; \ No newline at end of file +var _0xc827=['nolimit','order','sort','where','MailInteractionId','filter','map','$gte','format','YYYY-MM-DD\x20HH:mm:ss','options','include','findAll','inlineCss','rows','addTags','setTags','spread','Tag','color','emit','mailInteractionTags:save','removeTags','download','toString','root','tmp','server','attachments','join','push','Attachments','from','bcc','subject','Messages','get','each','missing.recipient@your.company.com','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','zip-dir','util','path','lodash','juice','../../components/interaction/service','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','json','undefined','count','offset','status','Content-Range','update','then','destroy','stack','name','send','rawAttributes','type','key','mail','query','user','catch','show','params','model','MailInteraction','keys','filters','intersection','attributes','fields','length','includeAll','merge','create','body','find','describe','addMessage','MailMessage','ids','omit','getMessages','findOne','hasOwnProperty'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xc827,0x1e5));var _0x7c82=function(_0x23674c,_0x4df3db){_0x23674c=_0x23674c-0x0;var _0x2d1881=_0xc827[_0x23674c];return _0x2d1881;};'use strict';var emlformat=require(_0x7c82('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7c82('0x1'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x7c82('0x2'));var path=require(_0x7c82('0x3'));var fs=require('fs');var _=require(_0x7c82('0x4'));var juice=require(_0x7c82('0x5'));var Redis=require('ioredis');var interaction=require(_0x7c82('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0x7c82('0x7'))(_0x7c82('0x8'));var config=require(_0x7c82('0x9'));var db=require(_0x7c82('0xa'))['db'];var htmlEntities=require('html-entities');config[_0x7c82('0xb')]=_[_0x7c82('0xc')](config[_0x7c82('0xb')],{'host':_0x7c82('0xd'),'port':0x18eb});var socket=require(_0x7c82('0xe'))(new Redis(config['redis']));require('./mailInteraction.socket')[_0x7c82('0xf')](socket);function respondWithStatusCode(_0x14c157,_0x7227cb){_0x7227cb=_0x7227cb||0xcc;return function(_0x285ddd){if(_0x285ddd){return _0x14c157[_0x7c82('0x10')](_0x7227cb);}return _0x14c157['status'](_0x7227cb)[_0x7c82('0x11')]();};}function respondWithResult(_0x29d09a,_0x30c894){_0x30c894=_0x30c894||0xc8;return function(_0x35e935){if(_0x35e935){return _0x29d09a['status'](_0x30c894)[_0x7c82('0x12')](_0x35e935);}};}function respondWithFilteredResult(_0xa1032f,_0x3108e6){return function(_0x5a3ee8){if(_0x5a3ee8){var _0x1381dd=typeof _0x3108e6['offset']===_0x7c82('0x13')&&typeof _0x3108e6['limit']===_0x7c82('0x13');var _0x55be06=_0x5a3ee8[_0x7c82('0x14')];var _0x641803=_0x1381dd?0x0:_0x3108e6['offset'];var _0x3eedce=_0x1381dd?_0x5a3ee8[_0x7c82('0x14')]:_0x3108e6[_0x7c82('0x15')]+_0x3108e6['limit'];var _0x4d08c3;if(_0x3eedce>=_0x55be06){_0x3eedce=_0x55be06;_0x4d08c3=0xc8;}else{_0x4d08c3=0xce;}_0xa1032f[_0x7c82('0x16')](_0x4d08c3);return _0xa1032f['set'](_0x7c82('0x17'),_0x641803+'-'+_0x3eedce+'/'+_0x55be06)[_0x7c82('0x12')](_0x5a3ee8);}return null;};}function saveUpdates(_0x3dfe0c){return function(_0x20718f){if(_0x20718f){return _0x20718f[_0x7c82('0x18')](_0x3dfe0c)[_0x7c82('0x19')](function(_0x1877c6){return _0x1877c6;});}return null;};}function removeEntity(_0x9efe20){return function(_0x3d3c17){if(_0x3d3c17){return _0x3d3c17[_0x7c82('0x1a')]()[_0x7c82('0x19')](function(){_0x9efe20['status'](0xcc)[_0x7c82('0x11')]();});}};}function handleEntityNotFound(_0x303305){return function(_0x3f8d8e){if(!_0x3f8d8e){_0x303305[_0x7c82('0x10')](0x194);}return _0x3f8d8e;};}function handleError(_0x4ac1f7,_0x55366d){_0x55366d=_0x55366d||0x1f4;return function(_0x1c5a6b){logger['error'](_0x1c5a6b[_0x7c82('0x1b')]);if(_0x1c5a6b['name']){delete _0x1c5a6b[_0x7c82('0x1c')];}_0x4ac1f7['status'](_0x55366d)[_0x7c82('0x1d')](_0x1c5a6b);};}exports['index']=function(_0x43069a,_0x584630){var _0x26e34a={};var _0x24039f=_['map'](db['MailInteraction'][_0x7c82('0x1e')],function(_0x214216){return{'name':_0x214216['fieldName'],'type':_0x214216[_0x7c82('0x1f')][_0x7c82('0x20')]};});_0x26e34a=qs['getOptions'](_0x24039f,_0x43069a);return interaction['findAll'](_0x7c82('0x21'),_0x43069a[_0x7c82('0x22')],_0x43069a[_0x7c82('0x23')],_0x26e34a,_0x24039f)[_0x7c82('0x19')](respondWithFilteredResult(_0x584630,_0x26e34a))[_0x7c82('0x24')](handleError(_0x584630,null));};exports[_0x7c82('0x25')]=function(_0x3cd83c,_0x3d80c3){var _0x2e1b7d={'raw':![],'where':{'id':_0x3cd83c[_0x7c82('0x26')]['id']}},_0x352574={};_0x352574[_0x7c82('0x27')]=_['keys'](db[_0x7c82('0x28')][_0x7c82('0x1e')]);_0x352574[_0x7c82('0x22')]=_[_0x7c82('0x29')](_0x3cd83c['query']);_0x352574[_0x7c82('0x2a')]=_[_0x7c82('0x2b')](_0x352574[_0x7c82('0x27')],_0x352574['query']);_0x2e1b7d[_0x7c82('0x2c')]=_[_0x7c82('0x2b')](_0x352574[_0x7c82('0x27')],qs['fields'](_0x3cd83c[_0x7c82('0x22')][_0x7c82('0x2d')]));_0x2e1b7d[_0x7c82('0x2c')]=_0x2e1b7d[_0x7c82('0x2c')][_0x7c82('0x2e')]?_0x2e1b7d[_0x7c82('0x2c')]:_0x352574[_0x7c82('0x27')];if(_0x3cd83c['query'][_0x7c82('0x2f')]){_0x2e1b7d['include']=[{'all':!![]}];}_0x2e1b7d=_[_0x7c82('0x30')]({},_0x2e1b7d,_0x3cd83c['options']);return db[_0x7c82('0x28')]['find'](_0x2e1b7d)[_0x7c82('0x19')](handleEntityNotFound(_0x3d80c3,null))['then'](respondWithResult(_0x3d80c3,null))['catch'](handleError(_0x3d80c3,null));};exports[_0x7c82('0x31')]=function(_0x893eae,_0x3f68a4){return db['MailInteraction'][_0x7c82('0x31')](_0x893eae[_0x7c82('0x32')],{})[_0x7c82('0x19')](respondWithResult(_0x3f68a4,0xc9))[_0x7c82('0x24')](handleError(_0x3f68a4,null));};exports['update']=function(_0x3c9115,_0x2d5def){if(_0x3c9115[_0x7c82('0x32')]['id']){delete _0x3c9115[_0x7c82('0x32')]['id'];}return db[_0x7c82('0x28')]['find']({'where':{'id':_0x3c9115[_0x7c82('0x26')]['id']}})[_0x7c82('0x19')](handleEntityNotFound(_0x2d5def,null))['then'](saveUpdates(_0x3c9115[_0x7c82('0x32')],null))[_0x7c82('0x19')](respondWithResult(_0x2d5def,null))['catch'](handleError(_0x2d5def,null));};exports[_0x7c82('0x1a')]=function(_0xc9366e,_0x475e3a){return db[_0x7c82('0x28')][_0x7c82('0x33')]({'where':{'id':_0xc9366e[_0x7c82('0x26')]['id']}})[_0x7c82('0x19')](handleEntityNotFound(_0x475e3a,null))[_0x7c82('0x19')](removeEntity(_0x475e3a,null))[_0x7c82('0x24')](handleError(_0x475e3a,null));};exports[_0x7c82('0x34')]=function(_0x2c8721,_0x41b0d7){return db[_0x7c82('0x28')]['describe']()[_0x7c82('0x19')](respondWithResult(_0x41b0d7,null))[_0x7c82('0x24')](handleError(_0x41b0d7,null));};exports[_0x7c82('0x35')]=function(_0x4b1a3c,_0x3771a4){return db[_0x7c82('0x36')][_0x7c82('0x33')]({'where':{'id':_0x4b1a3c['params']['id']}})[_0x7c82('0x19')](handleEntityNotFound(_0x3771a4,null))[_0x7c82('0x19')](function(_0x540bfa){if(_0x540bfa){return _0x540bfa['addMessage'](_0x4b1a3c[_0x7c82('0x32')][_0x7c82('0x37')],_[_0x7c82('0x38')](_0x4b1a3c[_0x7c82('0x32')],[_0x7c82('0x37'),'id'])||{});}})[_0x7c82('0x19')](respondWithResult(_0x3771a4,null))[_0x7c82('0x24')](handleError(_0x3771a4,null));};exports[_0x7c82('0x39')]=function(_0x2bce13,_0x29d53d){var _0x445fab={'raw':![],'where':{}};var _0x4c0f6a={};var _0x4108a5={'count':0x0,'rows':[]};return db['MailInteraction'][_0x7c82('0x3a')]({'where':{'id':_0x2bce13[_0x7c82('0x26')]['id']}})[_0x7c82('0x19')](handleEntityNotFound(_0x29d53d,null))[_0x7c82('0x19')](function(_0x2cc5c2){if(_0x2cc5c2){_0x4c0f6a['model']=_[_0x7c82('0x29')](db['MailMessage'][_0x7c82('0x1e')]);_0x4c0f6a['query']=_['keys'](_0x2bce13[_0x7c82('0x22')]);_0x4c0f6a['filters']=_['intersection'](_0x4c0f6a[_0x7c82('0x27')],_0x4c0f6a[_0x7c82('0x22')]);_0x445fab[_0x7c82('0x2c')]=_['intersection'](_0x4c0f6a[_0x7c82('0x27')],qs[_0x7c82('0x2d')](_0x2bce13['query'][_0x7c82('0x2d')]));_0x445fab[_0x7c82('0x2c')]=_0x445fab['attributes']['length']?_0x445fab[_0x7c82('0x2c')]:_0x4c0f6a[_0x7c82('0x27')];if(!_0x2bce13[_0x7c82('0x22')][_0x7c82('0x3b')](_0x7c82('0x3c'))){_0x445fab['limit']=qs['limit'](_0x2bce13['query']['limit']);_0x445fab['offset']=qs[_0x7c82('0x15')](_0x2bce13['query'][_0x7c82('0x15')]);}_0x445fab[_0x7c82('0x3d')]=qs[_0x7c82('0x3e')](_0x2bce13[_0x7c82('0x22')][_0x7c82('0x3e')]);_0x445fab[_0x7c82('0x3f')]=qs[_0x7c82('0x2a')](_['pick'](_0x2bce13[_0x7c82('0x22')],_0x4c0f6a[_0x7c82('0x2a')]));_0x445fab[_0x7c82('0x3f')][_0x7c82('0x40')]=_0x2cc5c2['id'];if(_0x2bce13[_0x7c82('0x22')][_0x7c82('0x41')]){_0x445fab['where']=_[_0x7c82('0x30')](_0x445fab[_0x7c82('0x3f')],{'$or':_[_0x7c82('0x42')](_0x445fab[_0x7c82('0x2c')],function(_0x40eb7d){var _0x24fa9c={};_0x24fa9c[_0x40eb7d]={'$like':'%'+_0x2bce13[_0x7c82('0x22')]['filter']+'%'};return _0x24fa9c;})});}if(_0x2bce13[_0x7c82('0x22')][_0x7c82('0x43')]){var _0x2c5894=_0x2bce13[_0x7c82('0x22')][_0x7c82('0x43')]['split'](',');var _0x51d6bd={};_0x51d6bd[_0x2c5894[0x0]]={'$gte':moment(_0x2c5894[0x1])[_0x7c82('0x44')](_0x7c82('0x45'))};_0x445fab[_0x7c82('0x3f')]=_[_0x7c82('0x30')](_0x445fab[_0x7c82('0x3f')],_0x51d6bd);}_0x445fab=_[_0x7c82('0x30')]({},_0x445fab,_0x2bce13[_0x7c82('0x46')]);return db['MailMessage'][_0x7c82('0x14')]({'where':_0x445fab['where']})['then'](function(_0x51da9f){_0x4108a5[_0x7c82('0x14')]=_0x51da9f;if(_0x2bce13[_0x7c82('0x22')][_0x7c82('0x2f')]){_0x445fab[_0x7c82('0x47')]=[{'all':!![]}];}return db[_0x7c82('0x36')][_0x7c82('0x48')](_0x445fab);})[_0x7c82('0x19')](function(_0x292212){if(_0x2bce13[_0x7c82('0x22')][_0x7c82('0x49')]==='true'){for(var _0x41d31b=0x0;_0x41d31b<_0x292212[_0x7c82('0x2e')];_0x41d31b++){_0x292212[_0x41d31b][_0x7c82('0x32')]=juice(_0x292212[_0x41d31b][_0x7c82('0x32')]);}}_0x4108a5[_0x7c82('0x4a')]=_0x292212;return _0x4108a5;});}})['then'](respondWithFilteredResult(_0x29d53d,_0x445fab))['catch'](handleError(_0x29d53d,null));};exports[_0x7c82('0x4b')]=function(_0x51ae36,_0x2ca52f){return db[_0x7c82('0x28')][_0x7c82('0x33')]({'where':{'id':_0x51ae36[_0x7c82('0x26')]['id']}})[_0x7c82('0x19')](handleEntityNotFound(_0x2ca52f,null))[_0x7c82('0x19')](function(_0x58b127){if(_0x58b127){return _0x58b127[_0x7c82('0x4c')](_0x51ae36[_0x7c82('0x32')][_0x7c82('0x37')],_[_0x7c82('0x38')](_0x51ae36[_0x7c82('0x32')],[_0x7c82('0x37'),'id'])||{})[_0x7c82('0x4d')](function(){return db[_0x7c82('0x4e')][_0x7c82('0x48')]({'attributes':['id','name',_0x7c82('0x4f')],'where':{'id':_0x51ae36[_0x7c82('0x32')][_0x7c82('0x37')]}});})['then'](function(_0x4e238f){socket[_0x7c82('0x50')](_0x7c82('0x51'),{'id':Number(_0x51ae36[_0x7c82('0x26')]['id']),'tags':_0x4e238f||[]});return{'id':Number(_0x51ae36['params']['id']),'tags':_0x4e238f||[]};});}})[_0x7c82('0x19')](respondWithResult(_0x2ca52f,null))[_0x7c82('0x24')](handleError(_0x2ca52f,null));};exports[_0x7c82('0x52')]=function(_0x2fb2f1,_0x4a00e4){return db[_0x7c82('0x28')]['find']({'where':{'id':_0x2fb2f1[_0x7c82('0x26')]['id']}})[_0x7c82('0x19')](handleEntityNotFound(_0x4a00e4,null))[_0x7c82('0x19')](function(_0x2bf3c4){if(_0x2bf3c4){return _0x2bf3c4['removeTags'](_0x2fb2f1['query'][_0x7c82('0x37')]);}})[_0x7c82('0x19')](respondWithStatusCode(_0x4a00e4,null))[_0x7c82('0x24')](handleError(_0x4a00e4,null));};exports[_0x7c82('0x53')]=function(_0x596e36,_0x1cd61e){var _0x38937e=moment()['unix']()[_0x7c82('0x54')]();var _0x3b2e74=path['join'](config[_0x7c82('0x55')],'server','files',_0x7c82('0x56'));var _0x1798bf=path['join'](config['root'],_0x7c82('0x57'),'files',_0x7c82('0x58'));var _0x9a0011=path[_0x7c82('0x59')](_0x3b2e74,_0x38937e);var _0x44a7c5=util[_0x7c82('0x44')]('transcript-%d-%s.zip',_0x596e36[_0x7c82('0x26')]['id'],_0x38937e);var _0x215c03=path['join'](_0x3b2e74,_0x44a7c5);var _0x30d74b=[];if(_0x596e36[_0x7c82('0x22')]['attachments']){_0x30d74b[_0x7c82('0x5a')]({'model':db['Attachment'],'as':_0x7c82('0x5b'),'raw':!![]});}var _0x41db81=[{'model':db['MailMessage'],'as':'Messages','attributes':['id',_0x7c82('0x32'),_0x7c82('0x5c'),'to','cc',_0x7c82('0x5d'),_0x7c82('0x5e'),'createdAt'],'where':{'secret':![]},'order':qs[_0x7c82('0x3e')]('id'),'include':_0x30d74b}];return db[_0x7c82('0x28')][_0x7c82('0x33')]({'where':{'id':_0x596e36[_0x7c82('0x26')]['id']},'include':_0x41db81})[_0x7c82('0x19')](handleEntityNotFound(_0x1cd61e,null))[_0x7c82('0x19')](function(_0x3c864b){if(_0x3c864b&&_0x3c864b[_0x7c82('0x5f')]){var _0x270deb=_0x3c864b[_0x7c82('0x60')]({'plain':!![]});fs['mkdirSync'](_0x9a0011);return BPromise[_0x7c82('0x61')](_0x270deb[_0x7c82('0x5f')],function(_0x1eb44e,_0x4d29cc){var _0x6b4f37={'from':_0x1eb44e['from'],'to':_0x1eb44e['to']||_0x7c82('0x62'),'subject':_0x1eb44e[_0x7c82('0x5e')],'html':htmlEntities['decode'](_0x1eb44e[_0x7c82('0x32')]),'headers':{'Date':moment(_0x1eb44e[_0x7c82('0x63')])['format'](_0x7c82('0x64'))},'attachments':[]};if(_0x1eb44e['cc']){_0x6b4f37['headers']['Cc']=_0x1eb44e['cc'];}if(_0x1eb44e['bcc']){_0x6b4f37[_0x7c82('0x65')][_0x7c82('0x66')]=_0x1eb44e['bcc'];}return new BPromise(function(_0xadaa85,_0x145d4b){if(_0x1eb44e[_0x7c82('0x5b')]){for(var _0x72bccd=0x0;_0x72bccd<_0x1eb44e[_0x7c82('0x5b')][_0x7c82('0x2e')];_0x72bccd++){var _0x371e37=_0x1eb44e[_0x7c82('0x5b')][_0x72bccd];var _0x1f0dae=path['join'](_0x1798bf,_0x371e37[_0x7c82('0x67')]);if(fs[_0x7c82('0x68')](_0x1f0dae)){_0x6b4f37[_0x7c82('0x58')][_0x7c82('0x5a')]({'name':_0x371e37[_0x7c82('0x1c')],'contentType':_0x371e37[_0x7c82('0x1f')],'data':fs[_0x7c82('0x69')](_0x1f0dae)});}}}emlformat['build'](_0x6b4f37,function(_0x3d6977,_0x529548){if(_0x3d6977)return _0x145d4b(_0x3d6977);fs[_0x7c82('0x6a')](path[_0x7c82('0x59')](_0x9a0011,util[_0x7c82('0x44')](_0x7c82('0x6b'),_0x4d29cc)),_0x529548);return _0xadaa85(_0x529548);});});})[_0x7c82('0x19')](function(){return new BPromise(function(_0x547f24,_0xaefc83){zipdir(_0x9a0011,{'saveTo':_0x215c03},function(_0x37869b,_0x30e04a){if(_0x37869b)return _0xaefc83(_0x37869b);return _0x547f24(_0x30e04a);});})[_0x7c82('0x19')](function(){return new BPromise(function(_0x4f2bc8,_0x51febd){rimraf(_0x9a0011,function(_0x40543e){if(_0x40543e)_0x51febd(_0x40543e);return _0x4f2bc8();});});})[_0x7c82('0x19')](function(){return _0x1cd61e[_0x7c82('0x53')](_0x215c03,_0x44a7c5,function(_0x4a0ee5){if(!_0x4a0ee5)fs[_0x7c82('0x6c')](_0x215c03);});});});}else{return _0x1cd61e[_0x7c82('0x10')](0xc8);}})[_0x7c82('0x24')](handleError(_0x1cd61e,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index b58c4bd..2462847 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 _0xc33f=['../../mysqldb','save','update','remove','then','setDataValue','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','MailInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc33f,0x1ee));var _0xfc33=function(_0x1f9773,_0x4365fb){_0x1f9773=_0x1f9773-0x0;var _0x3fc947=_0xc33f[_0x1f9773];return _0x3fc947;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db'][_0xfc33('0x0')];var MailMessage=require(_0xfc33('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfc33('0x2'),'afterUpdate':_0xfc33('0x3'),'afterDestroy':_0xfc33('0x4')};function emitEvent(_0x36847c){return function(_0x35ef85,_0x92c154,_0x19ff0f){_0x35ef85['getUsers']({'attributes':['id'],'raw':!![]})[_0xfc33('0x5')](function(_0x3f6967){_0x35ef85[_0xfc33('0x6')]('Users',_0x3f6967[_0xfc33('0x7')](function(_0x5a7274){return{'id':_0x5a7274['id']};}));return MailMessage[_0xfc33('0x8')]({'where':{'MailInteractionId':_0x35ef85['id'],'direction':'in','read':![]},'raw':!![]});})[_0xfc33('0x5')](function(_0x395639){_0x35ef85[_0xfc33('0x6')](_0xfc33('0x9'),_0x395639['length']);MailInteractionEvents[_0xfc33('0xa')](_0x36847c+':'+_0x35ef85['id'],_0x35ef85);MailInteractionEvents[_0xfc33('0xa')](_0x36847c,_0x35ef85);_0x19ff0f(null);})[_0xfc33('0xb')](_0x19ff0f(null));};}for(var e in events){if(events[_0xfc33('0xc')](e)){var event=events[e];MailInteraction[_0xfc33('0xd')](e,emitEvent(event));}}module[_0xfc33('0xe')]=MailInteractionEvents; \ No newline at end of file +var _0xb892=['Users','map','findAll','then','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers','setDataValue'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xb892,0x15f));var _0x2b89=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xb892[_0x4a747d];return _0x3a5b5c;};'use strict';var EventEmitter=require(_0x2b89('0x0'));var MailInteraction=require(_0x2b89('0x1'))['db'][_0x2b89('0x2')];var MailMessage=require(_0x2b89('0x1'))['db'][_0x2b89('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x2b89('0x4')](0x0);var events={'afterCreate':_0x2b89('0x5'),'afterUpdate':_0x2b89('0x6'),'afterDestroy':_0x2b89('0x7')};function emitEvent(_0x2cb5e2){return function(_0x4c0215,_0x28dddf,_0x1d7970){_0x4c0215[_0x2b89('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2483b6){_0x4c0215[_0x2b89('0x9')](_0x2b89('0xa'),_0x2483b6[_0x2b89('0xb')](function(_0x56fbcd){return{'id':_0x56fbcd['id']};}));return MailMessage[_0x2b89('0xc')]({'where':{'MailInteractionId':_0x4c0215['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2b89('0xd')](function(_0x1a6111){_0x4c0215['setDataValue']('unreadMessages',_0x1a6111[_0x2b89('0xe')]);MailInteractionEvents[_0x2b89('0xf')](_0x2cb5e2+':'+_0x4c0215['id'],_0x4c0215);MailInteractionEvents[_0x2b89('0xf')](_0x2cb5e2,_0x4c0215);_0x1d7970(null);})['catch'](_0x1d7970(null));};}for(var e in events){if(events[_0x2b89('0x10')](e)){var event=events[e];MailInteraction[_0x2b89('0x11')](e,emitEvent(event));}}module[_0x2b89('0x12')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 5449e8e..1d48a0b 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 _0xd5e4=['changed','closed','get','update','then','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt'];(function(_0x3ab6e8,_0x5ad132){var _0x4ca8df=function(_0x21633b){while(--_0x21633b){_0x3ab6e8['push'](_0x3ab6e8['shift']());}};_0x4ca8df(++_0x5ad132);}(_0xd5e4,0x77));var _0x4d5e=function(_0x177a66,_0x28102c){_0x177a66=_0x177a66-0x0;var _0x1ed11f=_0xd5e4[_0x177a66];return _0x1ed11f;};'use strict';var _=require(_0x4d5e('0x0'));var util=require(_0x4d5e('0x1'));var logger=require(_0x4d5e('0x2'))(_0x4d5e('0x3'));var moment=require('moment');var BPromise=require(_0x4d5e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4d5e('0x5'));var rimraf=require(_0x4d5e('0x6'));var config=require(_0x4d5e('0x7'));var attributes=require(_0x4d5e('0x8'));module[_0x4d5e('0x9')]=function(_0x2f59f7,_0x145fdb){return _0x2f59f7[_0x4d5e('0xa')](_0x4d5e('0xb'),attributes,{'tableName':_0x4d5e('0xc'),'paranoid':![],'indexes':[{'name':_0x4d5e('0xd'),'fields':[_0x4d5e('0xe'),'to'],'type':_0x4d5e('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x38c12b,_0x347f3b,_0x22ec87){if(_0x38c12b[_0x4d5e('0x10')]){_0x38c12b[_0x4d5e('0x11')]=moment()[_0x4d5e('0x12')](_0x4d5e('0x13'));}if(_0x38c12b['closed']){_0x38c12b[_0x4d5e('0x14')]=moment()[_0x4d5e('0x12')](_0x4d5e('0x13'));}_0x22ec87(null,_0x347f3b);},'beforeUpdate':function(_0x34a58c,_0x5e08b2,_0xb3774a){if(_0x34a58c['changed'](_0x4d5e('0x10'))){_0x34a58c['substatusAt']=_0x34a58c[_0x4d5e('0x10')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x34a58c[_0x4d5e('0x15')](_0x4d5e('0x16'))){_0x34a58c['closedAt']=moment()['format'](_0x4d5e('0x13'));_0x34a58c[_0x4d5e('0x10')]=null;_0x34a58c['substatusAt']=null;}_0xb3774a(null,_0x34a58c);},'afterUpdate':function(_0x143d2f,_0x2589e9,_0x16e6b6){var _0x2f6699=_0x2f59f7['models'];var _0x31db4d=_0x143d2f[_0x4d5e('0x17')]({'plain':!![]});if(_0x31db4d[_0x4d5e('0x16')]){return _0x2f6699['MailMessage'][_0x4d5e('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x31db4d['id']}})[_0x4d5e('0x19')](function(){_0x16e6b6();})[_0x4d5e('0x1a')](function(_0x2feb4c){_0x16e6b6(_0x2feb4c);});}else{_0x16e6b6();}}},'charset':'utf8mb4','collate':_0x4d5e('0x1b')});}; \ No newline at end of file +var _0x041d=['bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','mail_interactions','subject','FULLTEXT','substatus','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','substatusAt','models','get','MailMessage','update','then','util','../../config/logger','api'];(function(_0x409817,_0x39116e){var _0x388048=function(_0x200331){while(--_0x200331){_0x409817['push'](_0x409817['shift']());}};_0x388048(++_0x39116e);}(_0x041d,0x1bf));var _0xd041=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x041d[_0x36eaaa];return _0x461349;};'use strict';var _=require('lodash');var util=require(_0xd041('0x0'));var logger=require(_0xd041('0x1'))(_0xd041('0x2'));var moment=require('moment');var BPromise=require(_0xd041('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd041('0x4'));var rimraf=require(_0xd041('0x5'));var config=require(_0xd041('0x6'));var attributes=require(_0xd041('0x7'));module[_0xd041('0x8')]=function(_0x5783a9,_0x9bf78c){return _0x5783a9[_0xd041('0x9')]('MailInteraction',attributes,{'tableName':_0xd041('0xa'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0xd041('0xb'),'to'],'type':_0xd041('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2a22c0,_0x8614e5,_0x1cb229){if(_0x2a22c0[_0xd041('0xd')]){_0x2a22c0['substatusAt']=moment()['format'](_0xd041('0xe'));}if(_0x2a22c0[_0xd041('0xf')]){_0x2a22c0[_0xd041('0x10')]=moment()[_0xd041('0x11')](_0xd041('0xe'));}_0x1cb229(null,_0x8614e5);},'beforeUpdate':function(_0xf1e654,_0x57359b,_0x1a3afe){if(_0xf1e654[_0xd041('0x12')](_0xd041('0xd'))){_0xf1e654[_0xd041('0x13')]=_0xf1e654[_0xd041('0xd')]?moment()[_0xd041('0x11')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0xf1e654['changed']('closed')){_0xf1e654[_0xd041('0x10')]=moment()[_0xd041('0x11')](_0xd041('0xe'));_0xf1e654[_0xd041('0xd')]=null;_0xf1e654[_0xd041('0x13')]=null;}_0x1a3afe(null,_0xf1e654);},'afterUpdate':function(_0x354c0e,_0x56a2f2,_0xc5674c){var _0x4beddb=_0x5783a9[_0xd041('0x14')];var _0x267628=_0x354c0e[_0xd041('0x15')]({'plain':!![]});if(_0x267628[_0xd041('0xf')]){return _0x4beddb[_0xd041('0x16')][_0xd041('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x267628['id']}})[_0xd041('0x18')](function(){_0xc5674c();})['catch'](function(_0x40f026){_0xc5674c(_0x40f026);});}else{_0xc5674c();}}},'charset':'utf8mb4','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 9dac691..40933dd 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 _0x4d1b=['where','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailInteraction','body','options','attributes','limit','UpdateMailInteraction','find'];(function(_0x2f63a0,_0x51855d){var _0x536ae8=function(_0x4b9de2){while(--_0x4b9de2){_0x2f63a0['push'](_0x2f63a0['shift']());}};_0x536ae8(++_0x51855d);}(_0x4d1b,0x102));var _0xb4d1=function(_0x4b4f24,_0x5654a8){_0x4b4f24=_0x4b4f24-0x0;var _0x1c13d4=_0x4d1b[_0x4b4f24];return _0x1c13d4;};'use strict';var _=require(_0xb4d1('0x0'));var util=require('util');var moment=require(_0xb4d1('0x1'));var BPromise=require(_0xb4d1('0x2'));var rs=require(_0xb4d1('0x3'));var fs=require('fs');var Redis=require(_0xb4d1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb4d1('0x5'));var logger=require('../../config/logger')(_0xb4d1('0x6'));var config=require(_0xb4d1('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb4d1('0x8')][_0xb4d1('0x9')]({'port':0x232a});config[_0xb4d1('0xa')]=_[_0xb4d1('0xb')](config['redis'],{'host':_0xb4d1('0xc'),'port':0x18eb});var socket=require(_0xb4d1('0xd'))(new Redis(config['redis']));require(_0xb4d1('0xe'))[_0xb4d1('0xf')](socket);function respondWithRpcPromise(_0xf3010d,_0xfc12a6,_0x29c0b3){return new BPromise(function(_0x6a70ea,_0x57458f){return client[_0xb4d1('0x10')](_0xf3010d,_0x29c0b3)[_0xb4d1('0x11')](function(_0x1c11ff){logger[_0xb4d1('0x12')](_0xb4d1('0x13'),_0xfc12a6,_0xb4d1('0x14'));logger[_0xb4d1('0x15')](_0xb4d1('0x16'),_0xfc12a6,_0xb4d1('0x14'),JSON[_0xb4d1('0x17')](_0x1c11ff));if(_0x1c11ff[_0xb4d1('0x18')]){if(_0x1c11ff[_0xb4d1('0x18')][_0xb4d1('0x19')]===0x1f4){logger[_0xb4d1('0x18')](_0xb4d1('0x13'),_0xfc12a6,_0x1c11ff[_0xb4d1('0x18')][_0xb4d1('0x1a')]);return _0x57458f(_0x1c11ff[_0xb4d1('0x18')][_0xb4d1('0x1a')]);}logger[_0xb4d1('0x18')]('MailInteraction,\x20%s,\x20%s',_0xfc12a6,_0x1c11ff['error'][_0xb4d1('0x1a')]);return _0x6a70ea(_0x1c11ff[_0xb4d1('0x18')]['message']);}else{logger[_0xb4d1('0x12')](_0xb4d1('0x13'),_0xfc12a6,'request\x20sent');_0x6a70ea(_0x1c11ff[_0xb4d1('0x1b')][_0xb4d1('0x1a')]);}})[_0xb4d1('0x1c')](function(_0x4c1100){logger['error'](_0xb4d1('0x13'),_0xfc12a6,_0x4c1100);_0x57458f(_0x4c1100);});});}exports['UpdateMailInteraction']=function(_0x4bede1){var _0x459615=this;return new Promise(function(_0x2dd63f,_0x43eae2){return db[_0xb4d1('0x1d')]['update'](_0x4bede1[_0xb4d1('0x1e')],{'raw':_0x4bede1['options']?_0x4bede1['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4bede1['options']?_0x4bede1[_0xb4d1('0x1f')]['where']||null:null,'attributes':_0x4bede1[_0xb4d1('0x1f')]?_0x4bede1['options'][_0xb4d1('0x20')]||null:null,'limit':_0x4bede1[_0xb4d1('0x1f')]?_0x4bede1[_0xb4d1('0x1f')][_0xb4d1('0x21')]||null:null})[_0xb4d1('0x11')](function(_0x501817){logger[_0xb4d1('0x12')](_0xb4d1('0x22'),_0x4bede1);logger[_0xb4d1('0x15')](_0xb4d1('0x22'),_0x4bede1,JSON[_0xb4d1('0x17')](_0x501817));_0x2dd63f(_0x501817);})['catch'](function(_0x2f144b){logger[_0xb4d1('0x18')](_0xb4d1('0x22'),_0x2f144b[_0xb4d1('0x1a')],_0x4bede1);_0x43eae2(_0x459615[_0xb4d1('0x18')](0x1f4,_0x2f144b[_0xb4d1('0x1a')]));});});};exports['AddTagsToMailInteraction']=function(_0x4fafc7){return new Promise(function(_0x3e9fa6,_0xe94fe1){return db[_0xb4d1('0x1d')][_0xb4d1('0x23')]({'where':_0x4fafc7['options']?_0x4fafc7[_0xb4d1('0x1f')][_0xb4d1('0x24')]||null:null})[_0xb4d1('0x11')](function(_0x474973){if(_0x474973){return _0x474973[_0xb4d1('0x25')](_0x4fafc7[_0xb4d1('0x1e')][_0xb4d1('0x26')],_[_0xb4d1('0x27')](_0x4fafc7['body'],[_0xb4d1('0x26'),'id'])||{});}})[_0xb4d1('0x28')](function(_0x3bea1b){logger['info'](_0xb4d1('0x29'),_0x4fafc7);logger['debug'](_0xb4d1('0x29'),_0x4fafc7,JSON[_0xb4d1('0x17')](_0x3bea1b));_0x3e9fa6(_0x3bea1b);})[_0xb4d1('0x1c')](function(_0x3b0799){logger[_0xb4d1('0x18')](_0xb4d1('0x29'),_0x3b0799[_0xb4d1('0x1a')],_0x4fafc7);_0xe94fe1(_this[_0xb4d1('0x18')](0x1f4,_0x3b0799[_0xb4d1('0x1a')]));});});}; \ No newline at end of file +var _0x6ec2=['../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','MailInteraction','update','body','options','raw','where','attributes','UpdateMailInteraction','debug','catch','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x417dd8,_0x93f4f7){var _0x184956=function(_0x54bdcd){while(--_0x54bdcd){_0x417dd8['push'](_0x417dd8['shift']());}};_0x184956(++_0x93f4f7);}(_0x6ec2,0x78));var _0x26ec=function(_0x464121,_0x39c954){_0x464121=_0x464121-0x0;var _0x1d0cb8=_0x6ec2[_0x464121];return _0x1d0cb8;};'use strict';var _=require(_0x26ec('0x0'));var util=require(_0x26ec('0x1'));var moment=require(_0x26ec('0x2'));var BPromise=require(_0x26ec('0x3'));var rs=require(_0x26ec('0x4'));var fs=require('fs');var Redis=require(_0x26ec('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x26ec('0x6'));var logger=require(_0x26ec('0x7'))(_0x26ec('0x8'));var config=require(_0x26ec('0x9'));var jayson=require(_0x26ec('0xa'));var client=jayson['client'][_0x26ec('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x26ec('0xc')],{'host':_0x26ec('0xd'),'port':0x18eb});var socket=require(_0x26ec('0xe'))(new Redis(config['redis']));require(_0x26ec('0xf'))['register'](socket);function respondWithRpcPromise(_0x143d9f,_0x23b140,_0x26f0a6){return new BPromise(function(_0xef0a42,_0x3b2efe){return client[_0x26ec('0x10')](_0x143d9f,_0x26f0a6)[_0x26ec('0x11')](function(_0x1a8f40){logger[_0x26ec('0x12')](_0x26ec('0x13'),_0x23b140,'request\x20sent');logger['debug'](_0x26ec('0x14'),_0x23b140,_0x26ec('0x15'),JSON[_0x26ec('0x16')](_0x1a8f40));if(_0x1a8f40[_0x26ec('0x17')]){if(_0x1a8f40[_0x26ec('0x17')][_0x26ec('0x18')]===0x1f4){logger[_0x26ec('0x17')]('MailInteraction,\x20%s,\x20%s',_0x23b140,_0x1a8f40[_0x26ec('0x17')][_0x26ec('0x19')]);return _0x3b2efe(_0x1a8f40[_0x26ec('0x17')][_0x26ec('0x19')]);}logger['error']('MailInteraction,\x20%s,\x20%s',_0x23b140,_0x1a8f40[_0x26ec('0x17')][_0x26ec('0x19')]);return _0xef0a42(_0x1a8f40[_0x26ec('0x17')][_0x26ec('0x19')]);}else{logger['info'](_0x26ec('0x13'),_0x23b140,_0x26ec('0x15'));_0xef0a42(_0x1a8f40['result']['message']);}})['catch'](function(_0x21c3ff){logger[_0x26ec('0x17')](_0x26ec('0x13'),_0x23b140,_0x21c3ff);_0x3b2efe(_0x21c3ff);});});}exports['UpdateMailInteraction']=function(_0x4ad50c){var _0x289978=this;return new Promise(function(_0x125fca,_0x33a28b){return db[_0x26ec('0x1a')][_0x26ec('0x1b')](_0x4ad50c[_0x26ec('0x1c')],{'raw':_0x4ad50c['options']?_0x4ad50c[_0x26ec('0x1d')][_0x26ec('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ad50c[_0x26ec('0x1d')]?_0x4ad50c[_0x26ec('0x1d')][_0x26ec('0x1f')]||null:null,'attributes':_0x4ad50c['options']?_0x4ad50c['options'][_0x26ec('0x20')]||null:null,'limit':_0x4ad50c[_0x26ec('0x1d')]?_0x4ad50c[_0x26ec('0x1d')]['limit']||null:null})['then'](function(_0x19cadf){logger[_0x26ec('0x12')](_0x26ec('0x21'),_0x4ad50c);logger[_0x26ec('0x22')](_0x26ec('0x21'),_0x4ad50c,JSON[_0x26ec('0x16')](_0x19cadf));_0x125fca(_0x19cadf);})[_0x26ec('0x23')](function(_0x4e9cf8){logger['error']('UpdateMailInteraction',_0x4e9cf8[_0x26ec('0x19')],_0x4ad50c);_0x33a28b(_0x289978[_0x26ec('0x17')](0x1f4,_0x4e9cf8[_0x26ec('0x19')]));});});};exports[_0x26ec('0x24')]=function(_0x19e0fc){return new Promise(function(_0x2fb176,_0x3268e9){return db['MailInteraction'][_0x26ec('0x25')]({'where':_0x19e0fc['options']?_0x19e0fc[_0x26ec('0x1d')][_0x26ec('0x1f')]||null:null})['then'](function(_0x60c16d){if(_0x60c16d){return _0x60c16d[_0x26ec('0x26')](_0x19e0fc[_0x26ec('0x1c')][_0x26ec('0x27')],_[_0x26ec('0x28')](_0x19e0fc[_0x26ec('0x1c')],['ids','id'])||{});}})[_0x26ec('0x29')](function(_0x583c51){logger[_0x26ec('0x12')]('AddTags',_0x19e0fc);logger[_0x26ec('0x22')](_0x26ec('0x2a'),_0x19e0fc,JSON['stringify'](_0x583c51));_0x2fb176(_0x583c51);})[_0x26ec('0x23')](function(_0x13c4c3){logger[_0x26ec('0x17')](_0x26ec('0x2a'),_0x13c4c3[_0x26ec('0x19')],_0x19e0fc);_0x3268e9(_this[_0x26ec('0x17')](0x1f4,_0x13c4c3['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index caa0a56..0818f22 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 _0xc0c9=['./mailInteraction.events','save','remove','update','emit','removeListener','register','length','mailInteraction:'];(function(_0x423856,_0x1f3e54){var _0x43b947=function(_0x374347){while(--_0x374347){_0x423856['push'](_0x423856['shift']());}};_0x43b947(++_0x1f3e54);}(_0xc0c9,0x10e));var _0x9c0c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xc0c9[_0xa464c9];return _0x3d73c4;};'use strict';var MailInteractionEvents=require(_0x9c0c('0x0'));var events=[_0x9c0c('0x1'),_0x9c0c('0x2'),_0x9c0c('0x3')];function createListener(_0x4e2f47,_0x5845bd){return function(_0x27288e){_0x5845bd[_0x9c0c('0x4')](_0x4e2f47,_0x27288e);};}function removeListener(_0x39c30d,_0x1f878f){return function(){MailInteractionEvents[_0x9c0c('0x5')](_0x39c30d,_0x1f878f);};}exports[_0x9c0c('0x6')]=function(_0x3de4aa){for(var _0x3400b8=0x0,_0x505965=events[_0x9c0c('0x7')];_0x3400b8<_0x505965;_0x3400b8++){var _0x410036=events[_0x3400b8];var _0x8a53f4=createListener(_0x9c0c('0x8')+_0x410036,_0x3de4aa);MailInteractionEvents['on'](_0x410036,_0x8a53f4);}}; \ No newline at end of file +var _0xcb8f=['remove','removeListener','mailInteraction:','./mailInteraction.events','save'];(function(_0x560dfe,_0x3a6c65){var _0x5ccd77=function(_0x8defc5){while(--_0x8defc5){_0x560dfe['push'](_0x560dfe['shift']());}};_0x5ccd77(++_0x3a6c65);}(_0xcb8f,0x189));var _0xfcb8=function(_0x130e1a,_0x447340){_0x130e1a=_0x130e1a-0x0;var _0x3617fb=_0xcb8f[_0x130e1a];return _0x3617fb;};'use strict';var MailInteractionEvents=require(_0xfcb8('0x0'));var events=[_0xfcb8('0x1'),_0xfcb8('0x2'),'update'];function createListener(_0x134251,_0x28b164){return function(_0x582e01){_0x28b164['emit'](_0x134251,_0x582e01);};}function removeListener(_0x260dcd,_0x338dec){return function(){MailInteractionEvents[_0xfcb8('0x3')](_0x260dcd,_0x338dec);};}exports['register']=function(_0x2b6671){for(var _0x1bb3fa=0x0,_0x49e233=events['length'];_0x1bb3fa<_0x49e233;_0x1bb3fa++){var _0x232e42=events[_0x1bb3fa];var _0x32e791=createListener(_0xfcb8('0x4')+_0x232e42,_0x2b6671);MailInteractionEvents['on'](_0x232e42,_0x32e791);}}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/index.js b/server/api/mailInteractionHasTag/index.js index 339c2e7..c77a222 100644 --- a/server/api/mailInteractionHasTag/index.js +++ b/server/api/mailInteractionHasTag/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa701=['Router','../../components/auth/service','/describe','exports'];(function(_0x307bf2,_0x4d580e){var _0x31f2a9=function(_0x1ebfe2){while(--_0x1ebfe2){_0x307bf2['push'](_0x307bf2['shift']());}};_0x31f2a9(++_0x4d580e);}(_0xa701,0xd4));var _0x1a70=function(_0x30df82,_0x4cd7f5){_0x30df82=_0x30df82-0x0;var _0x5a0406=_0xa701[_0x30df82];return _0x5a0406;};'use strict';var express=require('express');var router=express[_0x1a70('0x0')]();var auth=require(_0x1a70('0x1'));var controller=require('./mailInteractionHasTag.controller');router['get'](_0x1a70('0x2'),auth['isAuthenticated'](),controller['describe']);module[_0x1a70('0x3')]=router; \ No newline at end of file +var _0x8200=['express','Router','../../components/auth/service','get','/describe','isAuthenticated','exports'];(function(_0x4597a7,_0x5da925){var _0x52cd16=function(_0x58a526){while(--_0x58a526){_0x4597a7['push'](_0x4597a7['shift']());}};_0x52cd16(++_0x5da925);}(_0x8200,0x11f));var _0x0820=function(_0x4984e3,_0x5a7079){_0x4984e3=_0x4984e3-0x0;var _0x339196=_0x8200[_0x4984e3];return _0x339196;};'use strict';var express=require(_0x0820('0x0'));var router=express[_0x0820('0x1')]();var auth=require(_0x0820('0x2'));var controller=require('./mailInteractionHasTag.controller');router[_0x0820('0x3')](_0x0820('0x4'),auth[_0x0820('0x5')](),controller['describe']);module[_0x0820('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js index 2f39bc8..71967ac 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','../../config/logger','api','../../mysqldb','json','error','name','status','describe','then'];(function(_0x47e435,_0x5eb6d0){var _0x35d47a=function(_0x3c5640){while(--_0x3c5640){_0x47e435['push'](_0x47e435['shift']());}};_0x35d47a(++_0x5eb6d0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var logger=require(_0x0a9e('0x0'))(_0x0a9e('0x1'));var db=require(_0x0a9e('0x2'))['db'];function respondWithResult(_0x5dd881,_0x550fbc){_0x550fbc=_0x550fbc||0xc8;return function(_0x18d5c9){if(_0x18d5c9){return _0x5dd881['status'](_0x550fbc)[_0x0a9e('0x3')](_0x18d5c9);}};}function handleError(_0x432180,_0x2ab90b){_0x2ab90b=_0x2ab90b||0x1f4;return function(_0x991246){logger[_0x0a9e('0x4')](_0x991246['stack']);if(_0x991246[_0x0a9e('0x5')]){delete _0x991246[_0x0a9e('0x5')];}_0x432180[_0x0a9e('0x6')](_0x2ab90b)['send'](_0x991246);};}exports['describe']=function(_0xe42b77,_0x56465b){return db['MailInteractionHasTag'][_0x0a9e('0x7')]()[_0x0a9e('0x8')](respondWithResult(_0x56465b,null))[_0x0a9e('0x9')](handleError(_0x56465b,null));}; \ No newline at end of file +var _0xa9e0=['catch','../../config/logger','api','../../mysqldb','json','error','name','status','describe','then'];(function(_0x4797bc,_0x1b5c8b){var _0x4327dc=function(_0x4e2052){while(--_0x4e2052){_0x4797bc['push'](_0x4797bc['shift']());}};_0x4327dc(++_0x1b5c8b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa9e0[_0x2dafbe];return _0x58a45a;};'use strict';var logger=require(_0x0a9e('0x0'))(_0x0a9e('0x1'));var db=require(_0x0a9e('0x2'))['db'];function respondWithResult(_0x5dd881,_0x550fbc){_0x550fbc=_0x550fbc||0xc8;return function(_0x18d5c9){if(_0x18d5c9){return _0x5dd881['status'](_0x550fbc)[_0x0a9e('0x3')](_0x18d5c9);}};}function handleError(_0x432180,_0x2ab90b){_0x2ab90b=_0x2ab90b||0x1f4;return function(_0x991246){logger[_0x0a9e('0x4')](_0x991246['stack']);if(_0x991246[_0x0a9e('0x5')]){delete _0x991246[_0x0a9e('0x5')];}_0x432180[_0x0a9e('0x6')](_0x2ab90b)['send'](_0x991246);};}exports['describe']=function(_0xe42b77,_0x56465b){return db['MailInteractionHasTag'][_0x0a9e('0x7')]()[_0x0a9e('0x8')](respondWithResult(_0x56465b,null))[_0x0a9e('0x9')](handleError(_0x56465b,null));}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.js index 486b12b..bc6a09d 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x89db=['sequelize','exports','INTEGER'];(function(_0x91282,_0x416226){var _0x18d257=function(_0x26b032){while(--_0x26b032){_0x91282['push'](_0x91282['shift']());}};_0x18d257(++_0x416226);}(_0x89db,0xde));var _0xb89d=function(_0x5e458c,_0xeaea5a){_0x5e458c=_0x5e458c-0x0;var _0x5ea8f2=_0x89db[_0x5e458c];return _0x5ea8f2;};'use strict';var Sequelize=require(_0xb89d('0x0'));module[_0xb89d('0x1')]={'MailInteractionId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'TagId':{'type':Sequelize[_0xb89d('0x2')],'defaultValue':null}}; \ No newline at end of file +var _0xd271=['exports','sequelize'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd271,0xc5));var _0x1d27=function(_0x2f63c0,_0x497f7f){_0x2f63c0=_0x2f63c0-0x0;var _0x156c7e=_0xd271[_0x2f63c0];return _0x156c7e;};'use strict';var Sequelize=require(_0x1d27('0x0'));module[_0x1d27('0x1')]={'MailInteractionId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'TagId':{'type':Sequelize['INTEGER'],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js index 476e844..4ea6e9f 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x309c=['./mailInteractionHasTag','exports','define','mail_interaction_has_tags'];(function(_0x4c05da,_0x414720){var _0x1614db=function(_0xa19cf6){while(--_0xa19cf6){_0x4c05da['push'](_0x4c05da['shift']());}};_0x1614db(++_0x414720);}(_0x309c,0x1a0));var _0xc309=function(_0x21a5fe,_0x3ba399){_0x21a5fe=_0x21a5fe-0x0;var _0x51e524=_0x309c[_0x21a5fe];return _0x51e524;};'use strict';var attributes=require(_0xc309('0x0'));module[_0xc309('0x1')]=function(_0x5302cd){return _0x5302cd[_0xc309('0x2')]('MailInteractionHasTag',attributes,{'tableName':_0xc309('0x3'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x65df=['./mailInteractionHasTag','define','MailInteractionHasTag'];(function(_0x10244a,_0x3e96f4){var _0x4daacd=function(_0x3ef358){while(--_0x3ef358){_0x10244a['push'](_0x10244a['shift']());}};_0x4daacd(++_0x3e96f4);}(_0x65df,0x9c));var _0xf65d=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x65df[_0x56482c];return _0x5aae7a;};'use strict';var attributes=require(_0xf65d('0x0'));module['exports']=function(_0xa023b4){return _0xa023b4[_0xf65d('0x1')](_0xf65d('0x2'),attributes,{'tableName':'mail_interaction_has_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 0a15362..c04f94f 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 _0x8ad0=['describe','show','get','post','tracked','mail','mailmessage:create','create','put','/:id/accept','accept','/:id/reject','reject','/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x8ad0,0xfa));var _0x08ad=function(_0x574b7f,_0x527087){_0x574b7f=_0x574b7f-0x0;var _0x195f3e=_0x8ad0[_0x574b7f];return _0x195f3e;};'use strict';var multer=require(_0x08ad('0x0'));var util=require(_0x08ad('0x1'));var path=require(_0x08ad('0x2'));var timeout=require(_0x08ad('0x3'));var express=require(_0x08ad('0x4'));var router=express['Router']();var fs_extra=require(_0x08ad('0x5'));var auth=require(_0x08ad('0x6'));var interaction=require(_0x08ad('0x7'));var config=require('../../config/environment');var controller=require('./mailMessage.controller');router['get']('/',auth[_0x08ad('0x8')](),controller[_0x08ad('0x9')]);router['get']('/describe',auth[_0x08ad('0x8')](),controller[_0x08ad('0xa')]);router['get']('/:id',auth[_0x08ad('0x8')](),controller[_0x08ad('0xb')]);router[_0x08ad('0xc')]('/:id/download',auth[_0x08ad('0x8')](),controller['download']);router[_0x08ad('0xd')]('/',auth[_0x08ad('0x8')](),interaction[_0x08ad('0xe')](_0x08ad('0xf'),_0x08ad('0x10')),controller[_0x08ad('0x11')]);router['put']('/:id',auth[_0x08ad('0x8')](),controller['update']);router[_0x08ad('0x12')](_0x08ad('0x13'),auth[_0x08ad('0x8')](),controller[_0x08ad('0x14')]);router[_0x08ad('0x12')](_0x08ad('0x15'),auth['isAuthenticated'](),controller[_0x08ad('0x16')]);router['delete'](_0x08ad('0x17'),auth[_0x08ad('0x8')](),controller[_0x08ad('0x18')]);module[_0x08ad('0x19')]=router; \ No newline at end of file +var _0x5d99=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','describe','show','/:id/download','download','post','tracked','mailmessage:create','create','update','accept','/:id/reject','reject','delete','/:id','exports'];(function(_0xd72e13,_0x2253c4){var _0x13d5a1=function(_0x371bcf){while(--_0x371bcf){_0xd72e13['push'](_0xd72e13['shift']());}};_0x13d5a1(++_0x2253c4);}(_0x5d99,0x150));var _0x95d9=function(_0x2c3a88,_0x48637e){_0x2c3a88=_0x2c3a88-0x0;var _0x4a7925=_0x5d99[_0x2c3a88];return _0x4a7925;};'use strict';var multer=require('multer');var util=require(_0x95d9('0x0'));var path=require(_0x95d9('0x1'));var timeout=require(_0x95d9('0x2'));var express=require(_0x95d9('0x3'));var router=express[_0x95d9('0x4')]();var fs_extra=require(_0x95d9('0x5'));var auth=require(_0x95d9('0x6'));var interaction=require(_0x95d9('0x7'));var config=require(_0x95d9('0x8'));var controller=require(_0x95d9('0x9'));router[_0x95d9('0xa')]('/',auth[_0x95d9('0xb')](),controller[_0x95d9('0xc')]);router[_0x95d9('0xa')]('/describe',auth[_0x95d9('0xb')](),controller[_0x95d9('0xd')]);router[_0x95d9('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x95d9('0xe')]);router[_0x95d9('0xa')](_0x95d9('0xf'),auth[_0x95d9('0xb')](),controller[_0x95d9('0x10')]);router[_0x95d9('0x11')]('/',auth['isAuthenticated'](),interaction[_0x95d9('0x12')]('mail',_0x95d9('0x13')),controller[_0x95d9('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x95d9('0x15')]);router['put']('/:id/accept',auth[_0x95d9('0xb')](),controller[_0x95d9('0x16')]);router['put'](_0x95d9('0x17'),auth[_0x95d9('0xb')](),controller[_0x95d9('0x18')]);router[_0x95d9('0x19')](_0x95d9('0x1a'),auth[_0x95d9('0xb')](),controller['destroy']);module[_0x95d9('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 4f5a188..784ec73 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 _0xbc77=['Chat','sequelize','TEXT','medium','BOOLEAN','ENUM','out','STRING','long','DATE','INTEGER','Email'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xbc77,0x15d));var _0x7bc7=function(_0x2c1dcd,_0x350452){_0x2c1dcd=_0x2c1dcd-0x0;var _0x158ce5=_0xbc77[_0x2c1dcd];return _0x158ce5;};'use strict';var Sequelize=require(_0x7bc7('0x0'));var _=require('lodash');module['exports']={'body':{'type':Sequelize[_0x7bc7('0x1')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x7bc7('0x1')](_0x7bc7('0x2'))},'read':{'type':Sequelize[_0x7bc7('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7bc7('0x4')]('in','out'),'defaultValue':_0x7bc7('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x7bc7('0x6')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['TEXT'](_0x7bc7('0x7'))},'cc':{'type':Sequelize[_0x7bc7('0x1')](_0x7bc7('0x7'))},'bcc':{'type':Sequelize[_0x7bc7('0x1')](_0x7bc7('0x7'))},'subject':{'type':Sequelize[_0x7bc7('0x1')]},'sentAt':{'type':Sequelize[_0x7bc7('0x8')]},'attach':{'type':Sequelize[_0x7bc7('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x7bc7('0x8')]},'originTo':{'type':Sequelize[_0x7bc7('0x1')](_0x7bc7('0x7'))},'originCc':{'type':Sequelize['TEXT'](_0x7bc7('0x7'))},'originChannel':{'type':Sequelize[_0x7bc7('0x4')](_0x7bc7('0xa'),_0x7bc7('0xb')),'defaultValue':_0x7bc7('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0xa617=['TEXT','medium','out','STRING','DATE','INTEGER','BOOLEAN','ENUM','Email','Chat','sequelize','exports','long'];(function(_0x4bb593,_0x272ed0){var _0x2da2d8=function(_0x4b25e9){while(--_0x4b25e9){_0x4bb593['push'](_0x4bb593['shift']());}};_0x2da2d8(++_0x272ed0);}(_0xa617,0x128));var _0x7a61=function(_0x3f8a1e,_0x144763){_0x3f8a1e=_0x3f8a1e-0x0;var _0x21f91f=_0xa617[_0x3f8a1e];return _0x21f91f;};'use strict';var Sequelize=require(_0x7a61('0x0'));var _=require('lodash');module[_0x7a61('0x1')]={'body':{'type':Sequelize['TEXT'](_0x7a61('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x7a61('0x3')](_0x7a61('0x4'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x7a61('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x7a61('0x6')](0x1fe)},'from':{'type':Sequelize[_0x7a61('0x6')]},'to':{'type':Sequelize[_0x7a61('0x3')]('long')},'cc':{'type':Sequelize[_0x7a61('0x3')](_0x7a61('0x2'))},'bcc':{'type':Sequelize[_0x7a61('0x3')](_0x7a61('0x2'))},'subject':{'type':Sequelize[_0x7a61('0x3')]},'sentAt':{'type':Sequelize[_0x7a61('0x7')]},'attach':{'type':Sequelize[_0x7a61('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x7a61('0x9')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x7a61('0x7')]},'originTo':{'type':Sequelize[_0x7a61('0x3')]('long')},'originCc':{'type':Sequelize[_0x7a61('0x3')](_0x7a61('0x2'))},'originChannel':{'type':Sequelize[_0x7a61('0xa')](_0x7a61('0xb'),_0x7a61('0xc')),'defaultValue':_0x7a61('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 6b402cb..c515033 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 _0xd83c=['readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','path','lodash','ioredis','html-to-text','../../config/logger','api','mail-interactions','../../config/environment','redis','defaults','socket.io-emitter','html-entities','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailMessage,\x20%s,\x20%s','result','catch','json','offset','undefined','limit','count','status','set','Content-Range','destroy','end','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','MailMessage','includeAll','findAll','rows','params','model','include','update','body','find','describe','create','findOne','MailAccountId','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','root','server/files/attachments','basename','List','ListId','List\x20not\x20found','SendMail','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','accept','read','UserId','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','fullname','reject','rejectmessage','download','unix','server','files','tmp','join','from','bcc','subject','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','push'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xd83c,0xa3));var _0xcd83=function(_0x4d9bb2,_0x3db50d){_0x4d9bb2=_0x4d9bb2-0x0;var _0x3179fe=_0xd83c[_0x4d9bb2];return _0x3179fe;};'use strict';var emlformat=require(_0xcd83('0x0'));var moment=require(_0xcd83('0x1'));var BPromise=require(_0xcd83('0x2'));var util=require('util');var path=require(_0xcd83('0x3'));var fs=require('fs');var _=require(_0xcd83('0x4'));var Redis=require(_0xcd83('0x5'));var htmlToText=require(_0xcd83('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0xcd83('0x7'))(_0xcd83('0x8'));var interaction_log=require('../../config/logger')(_0xcd83('0x9'));var config=require(_0xcd83('0xa'));var db=require('../../mysqldb')['db'];config[_0xcd83('0xb')]=_[_0xcd83('0xc')](config[_0xcd83('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xcd83('0xd'))(new Redis(config[_0xcd83('0xb')]));var htmlEntities=require(_0xcd83('0xe'));require('./mailMessage.socket')[_0xcd83('0xf')](socket);var jayson=require(_0xcd83('0x10'));var client=jayson[_0xcd83('0x11')][_0xcd83('0x12')]({'port':0x232c});var client9003=jayson['client'][_0xcd83('0x12')]({'port':0x232b});var client9002=jayson[_0xcd83('0x11')][_0xcd83('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x444a75,_0x3d149e,_0x11abab,_0x1df5a4){return new BPromise(function(_0x34e6c1,_0x3524f9){var _0x17aec4=_0x1df5a4||client;return _0x17aec4[_0xcd83('0x13')](_0x444a75,_0x11abab)[_0xcd83('0x14')](function(_0x45294d){logger[_0xcd83('0x15')]('MailMessage,\x20%s,\x20%s',_0x3d149e,_0xcd83('0x16'));logger[_0xcd83('0x17')](_0xcd83('0x18'),_0x3d149e,_0xcd83('0x16'),JSON[_0xcd83('0x19')](_0x45294d));if(_0x45294d[_0xcd83('0x1a')]){if(_0x45294d[_0xcd83('0x1a')][_0xcd83('0x1b')]===0x1f4){logger[_0xcd83('0x1a')]('MailMessage,\x20%s,\x20%s',_0x3d149e,_0x45294d['error'][_0xcd83('0x1c')]);return _0x3524f9(_0x45294d[_0xcd83('0x1a')][_0xcd83('0x1c')]);}logger[_0xcd83('0x1a')](_0xcd83('0x1d'),_0x3d149e,_0x45294d['error'][_0xcd83('0x1c')]);return _0x34e6c1(_0x45294d[_0xcd83('0x1a')][_0xcd83('0x1c')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x3d149e,'request\x20sent');_0x34e6c1(_0x45294d[_0xcd83('0x1e')]['message']);}})[_0xcd83('0x1f')](function(_0x1854be){logger[_0xcd83('0x1a')](_0xcd83('0x1d'),_0x3d149e,_0x1854be);_0x3524f9(_0x1854be);});});}function respondWithResult(_0xa8b35a,_0x6a16f){_0x6a16f=_0x6a16f||0xc8;return function(_0x30997d){if(_0x30997d){return _0xa8b35a['status'](_0x6a16f)[_0xcd83('0x20')](_0x30997d);}};}function respondWithFilteredResult(_0x2d02c2,_0x52803b){return function(_0x3068d6){if(_0x3068d6){var _0x8539f5=typeof _0x52803b[_0xcd83('0x21')]===_0xcd83('0x22')&&typeof _0x52803b[_0xcd83('0x23')]===_0xcd83('0x22');var _0x313ce6=_0x3068d6[_0xcd83('0x24')];var _0x32ea15=_0x8539f5?0x0:_0x52803b[_0xcd83('0x21')];var _0x525064=_0x8539f5?_0x3068d6[_0xcd83('0x24')]:_0x52803b['offset']+_0x52803b['limit'];var _0x6b8de4;if(_0x525064>=_0x313ce6){_0x525064=_0x313ce6;_0x6b8de4=0xc8;}else{_0x6b8de4=0xce;}_0x2d02c2[_0xcd83('0x25')](_0x6b8de4);return _0x2d02c2[_0xcd83('0x26')](_0xcd83('0x27'),_0x32ea15+'-'+_0x525064+'/'+_0x313ce6)[_0xcd83('0x20')](_0x3068d6);}return null;};}function saveUpdates(_0x4170a2){return function(_0x2d6728){if(_0x2d6728){return _0x2d6728['update'](_0x4170a2)[_0xcd83('0x14')](function(_0x3d7b65){return _0x3d7b65;});}return null;};}function removeEntity(_0x3b81b1){return function(_0x5e8694){if(_0x5e8694){return _0x5e8694[_0xcd83('0x28')]()[_0xcd83('0x14')](function(){_0x3b81b1['status'](0xcc)[_0xcd83('0x29')]();});}};}function handleEntityNotFound(_0x1ac6c5){return function(_0x419e16){if(!_0x419e16){_0x1ac6c5[_0xcd83('0x2a')](0x194);}return _0x419e16;};}function handleError(_0x51781d,_0x3c764a){_0x3c764a=_0x3c764a||0x1f4;return function(_0x4c2640){logger[_0xcd83('0x1a')](_0x4c2640[_0xcd83('0x2b')]);if(_0x4c2640[_0xcd83('0x2c')]){delete _0x4c2640[_0xcd83('0x2c')];}_0x51781d[_0xcd83('0x25')](_0x3c764a)[_0xcd83('0x2d')](_0x4c2640);};}exports['index']=function(_0x104e99,_0x2692d3){var _0x494956={},_0x415205={},_0x1fcd6a={'count':0x0,'rows':[]};var _0x3f194b=_[_0xcd83('0x2e')](db['MailMessage'][_0xcd83('0x2f')],function(_0x3ada8e){return{'name':_0x3ada8e[_0xcd83('0x30')],'type':_0x3ada8e[_0xcd83('0x31')][_0xcd83('0x32')]};});_0x415205['model']=_[_0xcd83('0x2e')](_0x3f194b,_0xcd83('0x2c'));_0x415205[_0xcd83('0x33')]=_[_0xcd83('0x34')](_0x104e99[_0xcd83('0x33')]);_0x415205[_0xcd83('0x35')]=_[_0xcd83('0x36')](_0x415205['model'],_0x415205[_0xcd83('0x33')]);_0x494956[_0xcd83('0x37')]=_[_0xcd83('0x36')](_0x415205['model'],qs[_0xcd83('0x38')](_0x104e99[_0xcd83('0x33')][_0xcd83('0x38')]));_0x494956['attributes']=_0x494956[_0xcd83('0x37')][_0xcd83('0x39')]?_0x494956[_0xcd83('0x37')]:_0x415205['model'];if(!_0x104e99[_0xcd83('0x33')][_0xcd83('0x3a')]('nolimit')){_0x494956[_0xcd83('0x23')]=qs[_0xcd83('0x23')](_0x104e99[_0xcd83('0x33')][_0xcd83('0x23')]);_0x494956['offset']=qs[_0xcd83('0x21')](_0x104e99['query']['offset']);}_0x494956[_0xcd83('0x3b')]=qs[_0xcd83('0x3c')](_0x104e99[_0xcd83('0x33')][_0xcd83('0x3c')]);_0x494956[_0xcd83('0x3d')]=qs[_0xcd83('0x35')](_[_0xcd83('0x3e')](_0x104e99[_0xcd83('0x33')],_0x415205['filters']),_0x3f194b);if(_0x104e99['query'][_0xcd83('0x3f')]){_0x494956['where']=_[_0xcd83('0x40')](_0x494956[_0xcd83('0x3d')],{'$or':_[_0xcd83('0x2e')](_0x3f194b,function(_0xe39d0e){if(_0xe39d0e['type']!==_0xcd83('0x41')){var _0x5b15a2={};_0x5b15a2[_0xe39d0e[_0xcd83('0x2c')]]={'$like':'%'+_0x104e99[_0xcd83('0x33')][_0xcd83('0x3f')]+'%'};return _0x5b15a2;}})});}_0x494956=_['merge']({},_0x494956,_0x104e99[_0xcd83('0x42')]);var _0x2cf91c={'where':_0x494956['where']};return db[_0xcd83('0x43')][_0xcd83('0x24')](_0x2cf91c)[_0xcd83('0x14')](function(_0x273254){_0x1fcd6a[_0xcd83('0x24')]=_0x273254;if(_0x104e99[_0xcd83('0x33')][_0xcd83('0x44')]){_0x494956['include']=[{'all':!![]}];}return db[_0xcd83('0x43')][_0xcd83('0x45')](_0x494956);})['then'](function(_0x1f6c3b){_0x1fcd6a[_0xcd83('0x46')]=_0x1f6c3b;return _0x1fcd6a;})[_0xcd83('0x14')](respondWithFilteredResult(_0x2692d3,_0x494956))[_0xcd83('0x1f')](handleError(_0x2692d3,null));};exports['show']=function(_0x53040a,_0x311850){var _0x308c46={'raw':!![],'where':{'id':_0x53040a[_0xcd83('0x47')]['id']}},_0x4c1edc={};_0x4c1edc[_0xcd83('0x48')]=_[_0xcd83('0x34')](db[_0xcd83('0x43')][_0xcd83('0x2f')]);_0x4c1edc[_0xcd83('0x33')]=_['keys'](_0x53040a['query']);_0x4c1edc['filters']=_['intersection'](_0x4c1edc[_0xcd83('0x48')],_0x4c1edc['query']);_0x308c46['attributes']=_[_0xcd83('0x36')](_0x4c1edc['model'],qs['fields'](_0x53040a['query'][_0xcd83('0x38')]));_0x308c46[_0xcd83('0x37')]=_0x308c46[_0xcd83('0x37')][_0xcd83('0x39')]?_0x308c46['attributes']:_0x4c1edc[_0xcd83('0x48')];if(_0x53040a[_0xcd83('0x33')][_0xcd83('0x44')]){_0x308c46[_0xcd83('0x49')]=[{'all':!![]}];}_0x308c46=_[_0xcd83('0x40')]({},_0x308c46,_0x53040a[_0xcd83('0x42')]);return db['MailMessage']['find'](_0x308c46)['then'](handleEntityNotFound(_0x311850,null))['then'](respondWithResult(_0x311850,null))[_0xcd83('0x1f')](handleError(_0x311850,null));};exports[_0xcd83('0x4a')]=function(_0xb237f8,_0x524f94){if(_0xb237f8[_0xcd83('0x4b')]['id']){delete _0xb237f8['body']['id'];}return db['MailMessage'][_0xcd83('0x4c')]({'where':{'id':_0xb237f8['params']['id']}})[_0xcd83('0x14')](handleEntityNotFound(_0x524f94,null))[_0xcd83('0x14')](saveUpdates(_0xb237f8[_0xcd83('0x4b')],null))[_0xcd83('0x14')](respondWithResult(_0x524f94,null))[_0xcd83('0x1f')](handleError(_0x524f94,null));};exports[_0xcd83('0x28')]=function(_0x2ff690,_0x379728){return db['MailMessage'][_0xcd83('0x4c')]({'where':{'id':_0x2ff690[_0xcd83('0x47')]['id']}})[_0xcd83('0x14')](handleEntityNotFound(_0x379728,null))[_0xcd83('0x14')](removeEntity(_0x379728,null))['catch'](handleError(_0x379728,null));};exports[_0xcd83('0x4d')]=function(_0x4a4ae6,_0x156359){return db[_0xcd83('0x43')][_0xcd83('0x4d')]()['then'](respondWithResult(_0x156359,null))[_0xcd83('0x1f')](handleError(_0x156359,null));};exports[_0xcd83('0x4e')]=function(_0x5dc0ab,_0x1ddb3f){return db[_0xcd83('0x43')][_0xcd83('0x4e')](_0x5dc0ab[_0xcd83('0x4b')])[_0xcd83('0x14')](function(_0x3a364f){if(_0x3a364f){if(_0x3a364f['direction']==='out'&&!_0x3a364f['secret']){var _0x5239ec,_0x4d5179,_0x4e1fd3;if(_0x5dc0ab[_0xcd83('0x4b')]['to']){_0x4d5179=_0x5dc0ab['body']['to']['split'](',')[0x0];}return db['MailAccount'][_0xcd83('0x4f')]({'where':{'id':_0x3a364f[_0xcd83('0x50')]},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xcd83('0x51')],'as':_0xcd83('0x52'),'where':{'email':_0x4d5179},'limit':0x1,'order':[[_0xcd83('0x53'),_0xcd83('0x54')]]}]},{'model':db[_0xcd83('0x55')],'as':_0xcd83('0x56'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xcd83('0x57'),'raw':!![]}]}]})['then'](function(_0x2ab642){_0x5239ec=_0x2ab642;if(!_0x5239ec||!_0x5239ec[_0xcd83('0x56')])return;var _0x5d0b09=_0x5239ec[_0xcd83('0x58')]();if(_0x5dc0ab['body'][_0xcd83('0x59')]&&_0x5dc0ab['body']['attachments'][_0xcd83('0x39')]){for(var _0x120705=0x0;_0x120705<_0x5dc0ab['body']['attachments'][_0xcd83('0x39')];_0x120705+=0x1){_0x5dc0ab[_0xcd83('0x4b')][_0xcd83('0x59')][_0x120705]={'filename':_0x5dc0ab[_0xcd83('0x4b')][_0xcd83('0x59')][_0x120705][_0xcd83('0x2c')],'path':path['join'](config[_0xcd83('0x5a')],_0xcd83('0x5b'),_0x5dc0ab[_0xcd83('0x4b')][_0xcd83('0x59')][_0x120705][_0xcd83('0x5c')])};}}_0x4e1fd3={'account':_0x5d0b09,'message':_0x5dc0ab[_0xcd83('0x4b')]};return;})['then'](function(){if(_0x5239ec['List']){if(_0x5239ec[_0xcd83('0x5d')]['Contacts']['length']){return _0x5239ec['List'][_0xcd83('0x52')][0x0];}else{return db[_0xcd83('0x51')][_0xcd83('0x4e')](_[_0xcd83('0xc')](_0x5dc0ab['body'],{'firstName':_0x5dc0ab['body']['to'],'email':_0x5dc0ab[_0xcd83('0x4b')]['to'],'phone':_0x5dc0ab[_0xcd83('0x4b')]['to'],'ListId':_0x5239ec[_0xcd83('0x5e')]}));}}else{throw new Error(_0xcd83('0x5f'));}})['then'](function(){if(_0x4e1fd3){return respondWithRpcPromise(_0xcd83('0x60'),_0xcd83('0x61'),_0x4e1fd3,client9003)[_0xcd83('0x14')](function(_0x198d85){return _0x3a364f[_0xcd83('0x4a')]({'read':!![],'messageId':_0x198d85['messageId'],'sentAt':moment()[_0xcd83('0x62')](_0xcd83('0x63'))});})[_0xcd83('0x1f')](function(_0x103f8a){logger[_0xcd83('0x1a')]('%s',JSON['stringify'](_0x103f8a));return _0x3a364f;});}return _0x3a364f;});}return _0x3a364f;}})['then'](respondWithResult(_0x1ddb3f,0xc9))[_0xcd83('0x1f')](handleError(_0x1ddb3f,null));};exports[_0xcd83('0x64')]=function(_0x3f303a,_0x30073f){var _0x1d5f14={'agent':{},'channel':'mail'};if(_0x3f303a[_0xcd83('0x4b')]['id']){delete _0x3f303a[_0xcd83('0x4b')]['id'];}_0x3f303a[_0xcd83('0x4b')][_0xcd83('0x65')]=!![];_0x3f303a[_0xcd83('0x4b')]['readAt']=moment()['format'](_0xcd83('0x63'));_0x3f303a[_0xcd83('0x4b')][_0xcd83('0x66')]=_0x3f303a[_0xcd83('0x4b')][_0xcd83('0x66')]||_0x3f303a['user']['id'];_0x1d5f14[_0xcd83('0x67')]['id']=_0x3f303a[_0xcd83('0x4b')][_0xcd83('0x66')];return db[_0xcd83('0x43')][_0xcd83('0x4c')]({'where':{'id':_0x3f303a[_0xcd83('0x47')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x30073f,null))[_0xcd83('0x14')](saveUpdates(_0x3f303a[_0xcd83('0x4b')],null))[_0xcd83('0x14')](function(_0x587051){if(_0x587051){_0x1d5f14[_0xcd83('0x1c')]=_0x587051[_0xcd83('0x68')]({'plain':!![]});return db[_0xcd83('0x69')]['find']({'where':{'id':_0x587051[_0xcd83('0x6a')]}});}return null;})[_0xcd83('0x14')](handleEntityNotFound(_0x30073f,null))['then'](function(_0x5bc527){if(_0x5bc527){return _0x5bc527[_0xcd83('0x4a')]({'UserId':_0x3f303a[_0xcd83('0x4b')]['UserId'],'read1stAt':_[_0xcd83('0x6b')](_0x5bc527[_0xcd83('0x6c')])?moment()['format'](_0xcd83('0x63')):undefined});}return null;})[_0xcd83('0x14')](function(_0x4be752){if(_0x4be752){_0x1d5f14['interaction']=_0x4be752[_0xcd83('0x68')]({'plain':!![]});interaction_log[_0xcd83('0x15')](_0xcd83('0x6d'),_0x3f303a[_0xcd83('0x6e')]['id'],_0x3f303a[_0xcd83('0x6e')][_0xcd83('0x2c')],_0x3f303a[_0xcd83('0x6e')][_0xcd83('0x6f')],_0x1d5f14[_0xcd83('0x70')]['id'],_0x3f303a[_0xcd83('0x4b')]?JSON['stringify'](_0x3f303a[_0xcd83('0x4b')]):_0xcd83('0x71'));return respondWithRpcPromise(_0xcd83('0x72'),_0xcd83('0x73'),_0x1d5f14);}return null;})[_0xcd83('0x14')](function(_0x287b39){var _0x5d015e=_0xcd83('0x74')+_0x287b39[_0xcd83('0x1c')][_0xcd83('0x75')];return db[_0xcd83('0x76')][_0xcd83('0x33')](_0x5d015e,{'type':db[_0xcd83('0x77')][_0xcd83('0x78')]['SELECT'],'raw':!![]})['then'](function(_0x3f4758){return _0x3f4758;});})[_0xcd83('0x14')](function(_0x2455cf){if(_0x2455cf){_0x1d5f14[_0xcd83('0x1c')][_0xcd83('0x79')]=_0x2455cf[0x0];if(!_0x3f303a[_0xcd83('0x4b')]['UserId'])return;return db[_0xcd83('0x7a')][_0xcd83('0x4c')]({'where':{'id':_0x3f303a[_0xcd83('0x4b')][_0xcd83('0x66')],'role':'agent'},'attributes':['id','name','fullname',_0xcd83('0x7b'),_0xcd83('0x7c')],'raw':!![]});}return null;})[_0xcd83('0x14')](function(_0x2593a3){if(!_0x2593a3)return null;_0x1d5f14[_0xcd83('0x1c')][_0xcd83('0x67')]=_0x2593a3;return _0x1d5f14;})[_0xcd83('0x14')](function(_0x233791){if(_0x233791){if(_0x3f303a[_0xcd83('0x4b')][_0xcd83('0x7d')]){_0x1d5f14[_0xcd83('0x1c')][_0xcd83('0x7e')]=util['format'](_0xcd83('0x7f'),_0x3f303a['user'][_0xcd83('0x2c')]);_0x1d5f14['message'][_0xcd83('0x80')]=_0x1d5f14[_0xcd83('0x80')];_0x1d5f14[_0xcd83('0x1c')][_0xcd83('0x81')]=_0x1d5f14[_0xcd83('0x80')];_0x1d5f14[_0xcd83('0x1c')][_0xcd83('0x82')]=_0xcd83('0x64');_0x1d5f14[_0xcd83('0x1c')][_0xcd83('0x4b')]=htmlToText[_0xcd83('0x83')](_0x1d5f14[_0xcd83('0x1c')][_0xcd83('0x4b')]);return respondWithRpcPromise(_0xcd83('0x84'),'EventManager',{'event':_0xcd83('0x85'),'message':_0x1d5f14[_0xcd83('0x1c')]},client9002)[_0xcd83('0x14')](function(){return _0x1d5f14;});}return _0x1d5f14;}return null;})['then'](respondWithResult(_0x30073f,null))[_0xcd83('0x1f')](handleError(_0x30073f,null));};exports['reject']=function(_0xda0437,_0x1370d4){var _0x561eca={'agent':{},'channel':_0xcd83('0x86')};if(_0xda0437[_0xcd83('0x4b')]['id']){delete _0xda0437[_0xcd83('0x4b')]['id'];}_0xda0437['body'][_0xcd83('0x66')]=_0xda0437[_0xcd83('0x4b')]['UserId']||_0xda0437[_0xcd83('0x6e')]['id'];_0x561eca[_0xcd83('0x67')]['id']=_0xda0437[_0xcd83('0x4b')][_0xcd83('0x66')];return db[_0xcd83('0x43')]['find']({'where':{'id':_0xda0437['params']['id'],'UserId':null}})[_0xcd83('0x14')](handleEntityNotFound(_0x1370d4,null))[_0xcd83('0x14')](function(_0x53b2d9){if(_0x53b2d9){_0x561eca[_0xcd83('0x1c')]=_0x53b2d9['get']({'plain':!![]});return db[_0xcd83('0x69')][_0xcd83('0x4c')]({'where':{'id':_0x53b2d9['MailInteractionId']}});}return null;})[_0xcd83('0x14')](handleEntityNotFound(_0x1370d4,null))['then'](function(_0x1668ec){if(_0x1668ec){_0x561eca[_0xcd83('0x70')]=_0x1668ec[_0xcd83('0x68')]({'plain':!![]});interaction_log[_0xcd83('0x15')](_0xcd83('0x87'),_0xda0437['user']['id'],_0xda0437[_0xcd83('0x6e')]['name'],_0xda0437[_0xcd83('0x6e')][_0xcd83('0x6f')],_0x561eca[_0xcd83('0x70')]['id'],_0xda0437['body']?JSON[_0xcd83('0x19')](_0xda0437['body']):_0xcd83('0x71'));return respondWithRpcPromise(_0xcd83('0x88'),_0xcd83('0x89'),_0x561eca);}return null;})[_0xcd83('0x14')](function(_0x21d324){var _0x3fdbd0=_0xcd83('0x74')+_0x21d324[_0xcd83('0x1c')][_0xcd83('0x75')];return db['sequelize'][_0xcd83('0x33')](_0x3fdbd0,{'type':db[_0xcd83('0x77')][_0xcd83('0x78')]['SELECT'],'raw':!![]})[_0xcd83('0x14')](function(_0x4a7bd3){return _0x4a7bd3;});})[_0xcd83('0x14')](function(_0x4e54eb){if(_0x4e54eb){_0x561eca[_0xcd83('0x1c')]['contact']=_0x4e54eb[0x0];if(!_0xda0437[_0xcd83('0x4b')][_0xcd83('0x66')])return;return db[_0xcd83('0x7a')]['find']({'where':{'id':_0xda0437[_0xcd83('0x4b')]['UserId'],'role':_0xcd83('0x67')},'attributes':['id','name',_0xcd83('0x8a'),'email',_0xcd83('0x7c')],'raw':!![]});}return null;})[_0xcd83('0x14')](function(_0x4013ef){if(!_0x4013ef)return null;_0x561eca['message'][_0xcd83('0x67')]=_0x4013ef;return _0x561eca;})['then'](function(_0x855ce3){if(_0x855ce3){_0x855ce3[_0xcd83('0x1c')][_0xcd83('0x7e')]=util[_0xcd83('0x62')](_0xcd83('0x7f'),_0xda0437[_0xcd83('0x6e')][_0xcd83('0x2c')]);_0x855ce3[_0xcd83('0x1c')][_0xcd83('0x80')]=_0x561eca[_0xcd83('0x80')];_0x855ce3[_0xcd83('0x1c')][_0xcd83('0x81')]=_0x561eca[_0xcd83('0x80')];_0x855ce3[_0xcd83('0x1c')][_0xcd83('0x82')]=_0xcd83('0x8b');_0x855ce3[_0xcd83('0x1c')][_0xcd83('0x4b')]=htmlToText[_0xcd83('0x83')](_0x561eca['message'][_0xcd83('0x4b')]);respondWithRpcPromise(_0xcd83('0x84'),_0xcd83('0x84'),{'event':_0xcd83('0x8c'),'message':_0x855ce3['message']},client9002);return _0x561eca;}return null;})[_0xcd83('0x14')](respondWithResult(_0x1370d4,null))[_0xcd83('0x1f')](handleError(_0x1370d4,null));};exports[_0xcd83('0x8d')]=function(_0xf9623a,_0x43e3ce){var _0x3278d7=moment()[_0xcd83('0x8e')]()['toString']();var _0x313540=path['join'](config[_0xcd83('0x5a')],_0xcd83('0x8f'),_0xcd83('0x90'),_0xcd83('0x91'));var _0xf232b4=path[_0xcd83('0x92')](config[_0xcd83('0x5a')],_0xcd83('0x8f'),'files',_0xcd83('0x59'));var _0x157fd2=util['format']('message-%s.eml',_0x3278d7);return db['MailMessage']['find']({'where':{'id':_0xf9623a['params']['id']},'attributes':['id',_0xcd83('0x4b'),_0xcd83('0x93'),'to','cc',_0xcd83('0x94'),_0xcd83('0x95'),'createdAt'],'include':_0xf9623a[_0xcd83('0x33')]['attachments']?[{'model':db[_0xcd83('0x96')],'as':_0xcd83('0x97')}]:undefined})['then'](handleEntityNotFound(_0x43e3ce,null))[_0xcd83('0x14')](function(_0x360d45){if(_0x360d45){var _0x5d7c99=_0x360d45;var _0x4eb5b9={'from':_0x5d7c99[_0xcd83('0x93')],'to':_0x5d7c99['to'],'subject':_0x5d7c99['subject'],'html':htmlEntities['decode'](_0x5d7c99['body']),'headers':{'Date':moment(_0x5d7c99['createdAt'])[_0xcd83('0x62')](_0xcd83('0x98'))},'attachments':[]};if(_0x360d45['cc']){_0x4eb5b9[_0xcd83('0x99')]['Cc']=_0x360d45['cc'];}if(_0x360d45[_0xcd83('0x94')]){_0x4eb5b9['headers']['Bcc']=_0x360d45[_0xcd83('0x94')];}return new BPromise(function(_0xb93ef8,_0x3fcc3e){if(_0x360d45[_0xcd83('0x97')]){for(var _0x342134=0x0;_0x342134<_0x360d45[_0xcd83('0x97')][_0xcd83('0x39')];_0x342134++){var _0x230b36=_0x360d45[_0xcd83('0x97')][_0x342134];var _0x57a83b=path[_0xcd83('0x92')](_0xf232b4,_0x230b36[_0xcd83('0x5c')]);if(fs['existsSync'](_0x57a83b)){_0x4eb5b9[_0xcd83('0x59')][_0xcd83('0x9a')]({'name':_0x230b36[_0xcd83('0x2c')],'contentType':_0x230b36[_0xcd83('0x31')],'data':fs[_0xcd83('0x9b')](_0x57a83b)});}}}emlformat[_0xcd83('0x9c')](_0x4eb5b9,function(_0x19f5ca,_0x517140){if(_0x19f5ca)return _0x3fcc3e(_0x19f5ca);fs[_0xcd83('0x9d')](path[_0xcd83('0x92')](_0x313540,_0x157fd2),_0x517140);return _0xb93ef8(_0x517140);});});}})['then'](function(_0xd89aa5){if(_0xd89aa5){return _0x43e3ce[_0xcd83('0x8d')](path['join'](_0x313540,_0x157fd2),_0x157fd2,function(_0x1175cc){if(!_0x1175cc)fs[_0xcd83('0x9e')](path[_0xcd83('0x92')](_0x313540,_0x157fd2));});}})[_0xcd83('0x1f')](handleError(_0x43e3ce,null));}; \ No newline at end of file +var _0xebca=['bluebird','util','path','lodash','ioredis','../../components/parsers/qs','api','../../config/logger','mail-interactions','../../mysqldb','defaults','localhost','redis','./mailMessage.socket','jayson/promise','http','client','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','status','offset','undefined','limit','count','set','Content-Range','update','destroy','end','sendStatus','stack','name','send','index','MailMessage','rawAttributes','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','params','find','body','describe','create','direction','out','secret','MailAccount','MailAccountId','List','updatedAt','MailServerOut','Smtp','CloudProvider','getSmtpOptions','attachments','join','root','server/files/attachments','basename','Contacts','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','agent','get','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','fromString','EventManager','MailInteraction','role','null','RejectMessage','rejectMessage','User','interface','reject','rejectmessage','unix','toString','server','files','tmp','message-%s.eml','from','subject','createdAt','Attachments','decode','headers','Bcc','bcc','existsSync','push','readFileSync','build','writeFileSync','download','unlinkSync','eml-format','moment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xebca,0x9e));var _0xaebc=function(_0x5c0232,_0x1c449f){_0x5c0232=_0x5c0232-0x0;var _0x589366=_0xebca[_0x5c0232];return _0x589366;};'use strict';var emlformat=require(_0xaebc('0x0'));var moment=require(_0xaebc('0x1'));var BPromise=require(_0xaebc('0x2'));var util=require(_0xaebc('0x3'));var path=require(_0xaebc('0x4'));var fs=require('fs');var _=require(_0xaebc('0x5'));var Redis=require(_0xaebc('0x6'));var htmlToText=require('html-to-text');var qs=require(_0xaebc('0x7'));var logger=require('../../config/logger')(_0xaebc('0x8'));var interaction_log=require(_0xaebc('0x9'))(_0xaebc('0xa'));var config=require('../../config/environment');var db=require(_0xaebc('0xb'))['db'];config['redis']=_[_0xaebc('0xc')](config['redis'],{'host':_0xaebc('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaebc('0xe')]));var htmlEntities=require('html-entities');require(_0xaebc('0xf'))['register'](socket);var jayson=require(_0xaebc('0x10'));var client=jayson['client'][_0xaebc('0x11')]({'port':0x232c});var client9003=jayson[_0xaebc('0x12')][_0xaebc('0x11')]({'port':0x232b});var client9002=jayson['client'][_0xaebc('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x1b3939,_0x365c55,_0x2c12ef,_0x5743b7){return new BPromise(function(_0x34c462,_0x36a8a9){var _0x3461ac=_0x5743b7||client;return _0x3461ac[_0xaebc('0x13')](_0x1b3939,_0x2c12ef)[_0xaebc('0x14')](function(_0x4820d2){logger[_0xaebc('0x15')](_0xaebc('0x16'),_0x365c55,_0xaebc('0x17'));logger[_0xaebc('0x18')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x365c55,_0xaebc('0x17'),JSON[_0xaebc('0x19')](_0x4820d2));if(_0x4820d2[_0xaebc('0x1a')]){if(_0x4820d2[_0xaebc('0x1a')]['code']===0x1f4){logger[_0xaebc('0x1a')]('MailMessage,\x20%s,\x20%s',_0x365c55,_0x4820d2[_0xaebc('0x1a')][_0xaebc('0x1b')]);return _0x36a8a9(_0x4820d2['error'][_0xaebc('0x1b')]);}logger[_0xaebc('0x1a')](_0xaebc('0x16'),_0x365c55,_0x4820d2[_0xaebc('0x1a')][_0xaebc('0x1b')]);return _0x34c462(_0x4820d2[_0xaebc('0x1a')][_0xaebc('0x1b')]);}else{logger['info'](_0xaebc('0x16'),_0x365c55,'request\x20sent');_0x34c462(_0x4820d2[_0xaebc('0x1c')][_0xaebc('0x1b')]);}})[_0xaebc('0x1d')](function(_0x2adec2){logger[_0xaebc('0x1a')](_0xaebc('0x16'),_0x365c55,_0x2adec2);_0x36a8a9(_0x2adec2);});});}function respondWithResult(_0x45e355,_0x5a1fc7){_0x5a1fc7=_0x5a1fc7||0xc8;return function(_0xbb5bf2){if(_0xbb5bf2){return _0x45e355[_0xaebc('0x1e')](_0x5a1fc7)['json'](_0xbb5bf2);}};}function respondWithFilteredResult(_0x4e917e,_0x5a7b91){return function(_0x582b01){if(_0x582b01){var _0x203f58=typeof _0x5a7b91[_0xaebc('0x1f')]===_0xaebc('0x20')&&typeof _0x5a7b91[_0xaebc('0x21')]===_0xaebc('0x20');var _0x1af7e3=_0x582b01[_0xaebc('0x22')];var _0xfb6b9c=_0x203f58?0x0:_0x5a7b91[_0xaebc('0x1f')];var _0x530398=_0x203f58?_0x582b01['count']:_0x5a7b91[_0xaebc('0x1f')]+_0x5a7b91[_0xaebc('0x21')];var _0x4cfd48;if(_0x530398>=_0x1af7e3){_0x530398=_0x1af7e3;_0x4cfd48=0xc8;}else{_0x4cfd48=0xce;}_0x4e917e[_0xaebc('0x1e')](_0x4cfd48);return _0x4e917e[_0xaebc('0x23')](_0xaebc('0x24'),_0xfb6b9c+'-'+_0x530398+'/'+_0x1af7e3)['json'](_0x582b01);}return null;};}function saveUpdates(_0x184c14){return function(_0x5372ca){if(_0x5372ca){return _0x5372ca[_0xaebc('0x25')](_0x184c14)[_0xaebc('0x14')](function(_0x437d0e){return _0x437d0e;});}return null;};}function removeEntity(_0x1de5ab){return function(_0x30aaf1){if(_0x30aaf1){return _0x30aaf1[_0xaebc('0x26')]()[_0xaebc('0x14')](function(){_0x1de5ab[_0xaebc('0x1e')](0xcc)[_0xaebc('0x27')]();});}};}function handleEntityNotFound(_0x25c48c){return function(_0x125851){if(!_0x125851){_0x25c48c[_0xaebc('0x28')](0x194);}return _0x125851;};}function handleError(_0x1d35d7,_0xbde866){_0xbde866=_0xbde866||0x1f4;return function(_0xdd3ab3){logger['error'](_0xdd3ab3[_0xaebc('0x29')]);if(_0xdd3ab3[_0xaebc('0x2a')]){delete _0xdd3ab3[_0xaebc('0x2a')];}_0x1d35d7[_0xaebc('0x1e')](_0xbde866)[_0xaebc('0x2b')](_0xdd3ab3);};}exports[_0xaebc('0x2c')]=function(_0x462597,_0xb745b4){var _0x1ee7ff={},_0x183b2b={},_0x49393a={'count':0x0,'rows':[]};var _0x42ee1f=_['map'](db[_0xaebc('0x2d')][_0xaebc('0x2e')],function(_0x5cf2fc){return{'name':_0x5cf2fc['fieldName'],'type':_0x5cf2fc['type'][_0xaebc('0x2f')]};});_0x183b2b[_0xaebc('0x30')]=_[_0xaebc('0x31')](_0x42ee1f,_0xaebc('0x2a'));_0x183b2b['query']=_[_0xaebc('0x32')](_0x462597[_0xaebc('0x33')]);_0x183b2b[_0xaebc('0x34')]=_[_0xaebc('0x35')](_0x183b2b[_0xaebc('0x30')],_0x183b2b[_0xaebc('0x33')]);_0x1ee7ff['attributes']=_[_0xaebc('0x35')](_0x183b2b['model'],qs[_0xaebc('0x36')](_0x462597['query']['fields']));_0x1ee7ff[_0xaebc('0x37')]=_0x1ee7ff[_0xaebc('0x37')][_0xaebc('0x38')]?_0x1ee7ff['attributes']:_0x183b2b['model'];if(!_0x462597[_0xaebc('0x33')][_0xaebc('0x39')]('nolimit')){_0x1ee7ff[_0xaebc('0x21')]=qs['limit'](_0x462597[_0xaebc('0x33')][_0xaebc('0x21')]);_0x1ee7ff['offset']=qs['offset'](_0x462597[_0xaebc('0x33')][_0xaebc('0x1f')]);}_0x1ee7ff[_0xaebc('0x3a')]=qs[_0xaebc('0x3b')](_0x462597['query'][_0xaebc('0x3b')]);_0x1ee7ff['where']=qs[_0xaebc('0x34')](_['pick'](_0x462597[_0xaebc('0x33')],_0x183b2b['filters']),_0x42ee1f);if(_0x462597[_0xaebc('0x33')][_0xaebc('0x3c')]){_0x1ee7ff[_0xaebc('0x3d')]=_[_0xaebc('0x3e')](_0x1ee7ff[_0xaebc('0x3d')],{'$or':_[_0xaebc('0x31')](_0x42ee1f,function(_0x185ddd){if(_0x185ddd[_0xaebc('0x3f')]!==_0xaebc('0x40')){var _0x50c3b8={};_0x50c3b8[_0x185ddd[_0xaebc('0x2a')]]={'$like':'%'+_0x462597[_0xaebc('0x33')][_0xaebc('0x3c')]+'%'};return _0x50c3b8;}})});}_0x1ee7ff=_[_0xaebc('0x3e')]({},_0x1ee7ff,_0x462597[_0xaebc('0x41')]);var _0x258bb9={'where':_0x1ee7ff[_0xaebc('0x3d')]};return db[_0xaebc('0x2d')]['count'](_0x258bb9)[_0xaebc('0x14')](function(_0x193fdd){_0x49393a['count']=_0x193fdd;if(_0x462597['query'][_0xaebc('0x42')]){_0x1ee7ff['include']=[{'all':!![]}];}return db[_0xaebc('0x2d')][_0xaebc('0x43')](_0x1ee7ff);})[_0xaebc('0x14')](function(_0x2e79ee){_0x49393a[_0xaebc('0x44')]=_0x2e79ee;return _0x49393a;})[_0xaebc('0x14')](respondWithFilteredResult(_0xb745b4,_0x1ee7ff))[_0xaebc('0x1d')](handleError(_0xb745b4,null));};exports['show']=function(_0x4f846f,_0x36f6fa){var _0x501247={'raw':!![],'where':{'id':_0x4f846f[_0xaebc('0x45')]['id']}},_0x154195={};_0x154195[_0xaebc('0x30')]=_['keys'](db['MailMessage'][_0xaebc('0x2e')]);_0x154195[_0xaebc('0x33')]=_[_0xaebc('0x32')](_0x4f846f['query']);_0x154195['filters']=_[_0xaebc('0x35')](_0x154195['model'],_0x154195[_0xaebc('0x33')]);_0x501247[_0xaebc('0x37')]=_['intersection'](_0x154195[_0xaebc('0x30')],qs['fields'](_0x4f846f[_0xaebc('0x33')][_0xaebc('0x36')]));_0x501247['attributes']=_0x501247['attributes'][_0xaebc('0x38')]?_0x501247[_0xaebc('0x37')]:_0x154195[_0xaebc('0x30')];if(_0x4f846f[_0xaebc('0x33')][_0xaebc('0x42')]){_0x501247['include']=[{'all':!![]}];}_0x501247=_[_0xaebc('0x3e')]({},_0x501247,_0x4f846f[_0xaebc('0x41')]);return db[_0xaebc('0x2d')][_0xaebc('0x46')](_0x501247)[_0xaebc('0x14')](handleEntityNotFound(_0x36f6fa,null))['then'](respondWithResult(_0x36f6fa,null))[_0xaebc('0x1d')](handleError(_0x36f6fa,null));};exports['update']=function(_0x493af4,_0x119bff){if(_0x493af4['body']['id']){delete _0x493af4[_0xaebc('0x47')]['id'];}return db['MailMessage']['find']({'where':{'id':_0x493af4[_0xaebc('0x45')]['id']}})['then'](handleEntityNotFound(_0x119bff,null))[_0xaebc('0x14')](saveUpdates(_0x493af4[_0xaebc('0x47')],null))[_0xaebc('0x14')](respondWithResult(_0x119bff,null))[_0xaebc('0x1d')](handleError(_0x119bff,null));};exports['destroy']=function(_0x38bd2e,_0x420c7a){return db['MailMessage'][_0xaebc('0x46')]({'where':{'id':_0x38bd2e[_0xaebc('0x45')]['id']}})[_0xaebc('0x14')](handleEntityNotFound(_0x420c7a,null))['then'](removeEntity(_0x420c7a,null))[_0xaebc('0x1d')](handleError(_0x420c7a,null));};exports[_0xaebc('0x48')]=function(_0x579fb2,_0x5ad0c6){return db[_0xaebc('0x2d')][_0xaebc('0x48')]()[_0xaebc('0x14')](respondWithResult(_0x5ad0c6,null))[_0xaebc('0x1d')](handleError(_0x5ad0c6,null));};exports[_0xaebc('0x49')]=function(_0x413d83,_0x176cf9){return db[_0xaebc('0x2d')][_0xaebc('0x49')](_0x413d83[_0xaebc('0x47')])[_0xaebc('0x14')](function(_0x5a8812){if(_0x5a8812){if(_0x5a8812[_0xaebc('0x4a')]===_0xaebc('0x4b')&&!_0x5a8812[_0xaebc('0x4c')]){var _0x240880,_0xbef2b8,_0x4dbc58;if(_0x413d83[_0xaebc('0x47')]['to']){_0xbef2b8=_0x413d83[_0xaebc('0x47')]['to']['split'](',')[0x0];}return db[_0xaebc('0x4d')]['findOne']({'where':{'id':_0x5a8812[_0xaebc('0x4e')]},'include':[{'model':db['CmList'],'as':_0xaebc('0x4f'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0xbef2b8},'limit':0x1,'order':[[_0xaebc('0x50'),'DESC']]}]},{'model':db[_0xaebc('0x51')],'as':_0xaebc('0x52'),'raw':!![],'include':[{'model':db[_0xaebc('0x53')],'as':_0xaebc('0x53'),'raw':!![]}]}]})[_0xaebc('0x14')](function(_0x5d5e4a){_0x240880=_0x5d5e4a;if(!_0x240880||!_0x240880[_0xaebc('0x52')])return;var _0x46badf=_0x240880[_0xaebc('0x54')]();if(_0x413d83[_0xaebc('0x47')][_0xaebc('0x55')]&&_0x413d83[_0xaebc('0x47')][_0xaebc('0x55')]['length']){for(var _0x4ac4a3=0x0;_0x4ac4a3<_0x413d83['body'][_0xaebc('0x55')][_0xaebc('0x38')];_0x4ac4a3+=0x1){_0x413d83[_0xaebc('0x47')][_0xaebc('0x55')][_0x4ac4a3]={'filename':_0x413d83[_0xaebc('0x47')][_0xaebc('0x55')][_0x4ac4a3][_0xaebc('0x2a')],'path':path[_0xaebc('0x56')](config[_0xaebc('0x57')],_0xaebc('0x58'),_0x413d83[_0xaebc('0x47')]['attachments'][_0x4ac4a3][_0xaebc('0x59')])};}}_0x4dbc58={'account':_0x46badf,'message':_0x413d83[_0xaebc('0x47')]};return;})[_0xaebc('0x14')](function(){if(_0x240880[_0xaebc('0x4f')]){if(_0x240880[_0xaebc('0x4f')]['Contacts']['length']){return _0x240880[_0xaebc('0x4f')][_0xaebc('0x5a')][0x0];}else{return db['CmContact'][_0xaebc('0x49')](_[_0xaebc('0xc')](_0x413d83['body'],{'firstName':_0x413d83[_0xaebc('0x47')]['to'],'email':_0x413d83['body']['to'],'phone':_0x413d83['body']['to'],'ListId':_0x240880[_0xaebc('0x5b')]}));}}else{throw new Error(_0xaebc('0x5c'));}})[_0xaebc('0x14')](function(){if(_0x4dbc58){return respondWithRpcPromise(_0xaebc('0x5d'),_0xaebc('0x5e'),_0x4dbc58,client9003)[_0xaebc('0x14')](function(_0x45bffc){return _0x5a8812[_0xaebc('0x25')]({'read':!![],'messageId':_0x45bffc[_0xaebc('0x5f')],'sentAt':moment()[_0xaebc('0x60')](_0xaebc('0x61'))});})['catch'](function(_0x4ce55b){logger[_0xaebc('0x1a')]('%s',JSON[_0xaebc('0x19')](_0x4ce55b));return _0x5a8812;});}return _0x5a8812;});}return _0x5a8812;}})['then'](respondWithResult(_0x176cf9,0xc9))[_0xaebc('0x1d')](handleError(_0x176cf9,null));};exports[_0xaebc('0x62')]=function(_0x589b21,_0x92093b){var _0x392978={'agent':{},'channel':_0xaebc('0x63')};if(_0x589b21['body']['id']){delete _0x589b21[_0xaebc('0x47')]['id'];}_0x589b21[_0xaebc('0x47')][_0xaebc('0x64')]=!![];_0x589b21[_0xaebc('0x47')][_0xaebc('0x65')]=moment()['format'](_0xaebc('0x61'));_0x589b21[_0xaebc('0x47')]['UserId']=_0x589b21[_0xaebc('0x47')][_0xaebc('0x66')]||_0x589b21['user']['id'];_0x392978[_0xaebc('0x67')]['id']=_0x589b21[_0xaebc('0x47')][_0xaebc('0x66')];return db[_0xaebc('0x2d')][_0xaebc('0x46')]({'where':{'id':_0x589b21[_0xaebc('0x45')]['id'],'UserId':null}})[_0xaebc('0x14')](handleEntityNotFound(_0x92093b,null))[_0xaebc('0x14')](saveUpdates(_0x589b21[_0xaebc('0x47')],null))[_0xaebc('0x14')](function(_0x117bdf){if(_0x117bdf){_0x392978[_0xaebc('0x1b')]=_0x117bdf[_0xaebc('0x68')]({'plain':!![]});return db['MailInteraction'][_0xaebc('0x46')]({'where':{'id':_0x117bdf[_0xaebc('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x92093b,null))[_0xaebc('0x14')](function(_0x5c0465){if(_0x5c0465){return _0x5c0465['update']({'UserId':_0x589b21[_0xaebc('0x47')][_0xaebc('0x66')],'read1stAt':_[_0xaebc('0x6a')](_0x5c0465[_0xaebc('0x6b')])?moment()[_0xaebc('0x60')](_0xaebc('0x61')):undefined});}return null;})['then'](function(_0x2e6bcf){if(_0x2e6bcf){_0x392978[_0xaebc('0x6c')]=_0x2e6bcf[_0xaebc('0x68')]({'plain':!![]});interaction_log['info'](_0xaebc('0x6d'),_0x589b21[_0xaebc('0x6e')]['id'],_0x589b21[_0xaebc('0x6e')][_0xaebc('0x2a')],_0x589b21['user']['role'],_0x392978['interaction']['id'],_0x589b21[_0xaebc('0x47')]?JSON[_0xaebc('0x19')](_0x589b21[_0xaebc('0x47')]):'null');return respondWithRpcPromise(_0xaebc('0x6f'),_0xaebc('0x70'),_0x392978);}return null;})[_0xaebc('0x14')](function(_0xd626a5){var _0x469a66=_0xaebc('0x71')+_0xd626a5['message'][_0xaebc('0x72')];return db[_0xaebc('0x73')][_0xaebc('0x33')](_0x469a66,{'type':db[_0xaebc('0x74')][_0xaebc('0x75')][_0xaebc('0x76')],'raw':!![]})['then'](function(_0x5007e9){return _0x5007e9;});})['then'](function(_0x241363){if(_0x241363){_0x392978[_0xaebc('0x1b')][_0xaebc('0x77')]=_0x241363[0x0];if(!_0x589b21['body'][_0xaebc('0x66')])return;return db['User'][_0xaebc('0x46')]({'where':{'id':_0x589b21[_0xaebc('0x47')][_0xaebc('0x66')],'role':'agent'},'attributes':['id',_0xaebc('0x2a'),_0xaebc('0x78'),_0xaebc('0x79'),_0xaebc('0x7a')],'raw':!![]});}return null;})['then'](function(_0x227681){if(!_0x227681)return null;_0x392978[_0xaebc('0x1b')][_0xaebc('0x67')]=_0x227681;return _0x392978;})[_0xaebc('0x14')](function(_0x4810e8){if(_0x4810e8){if(_0x589b21[_0xaebc('0x47')][_0xaebc('0x7b')]){_0x392978[_0xaebc('0x1b')]['interface']=util[_0xaebc('0x60')](_0xaebc('0x7c'),_0x589b21['user'][_0xaebc('0x2a')]);_0x392978[_0xaebc('0x1b')][_0xaebc('0x7d')]=_0x392978[_0xaebc('0x7d')];_0x392978[_0xaebc('0x1b')][_0xaebc('0x7e')]=_0x392978['channel'];_0x392978[_0xaebc('0x1b')][_0xaebc('0x7f')]=_0xaebc('0x62');_0x392978[_0xaebc('0x1b')][_0xaebc('0x47')]=htmlToText[_0xaebc('0x80')](_0x392978['message'][_0xaebc('0x47')]);return respondWithRpcPromise(_0xaebc('0x81'),'EventManager',{'event':'acceptmessage','message':_0x392978[_0xaebc('0x1b')]},client9002)['then'](function(){return _0x392978;});}return _0x392978;}return null;})[_0xaebc('0x14')](respondWithResult(_0x92093b,null))[_0xaebc('0x1d')](handleError(_0x92093b,null));};exports['reject']=function(_0x41871a,_0x4fb985){var _0x178910={'agent':{},'channel':_0xaebc('0x63')};if(_0x41871a[_0xaebc('0x47')]['id']){delete _0x41871a[_0xaebc('0x47')]['id'];}_0x41871a[_0xaebc('0x47')][_0xaebc('0x66')]=_0x41871a['body'][_0xaebc('0x66')]||_0x41871a[_0xaebc('0x6e')]['id'];_0x178910['agent']['id']=_0x41871a[_0xaebc('0x47')][_0xaebc('0x66')];return db['MailMessage'][_0xaebc('0x46')]({'where':{'id':_0x41871a[_0xaebc('0x45')]['id'],'UserId':null}})[_0xaebc('0x14')](handleEntityNotFound(_0x4fb985,null))[_0xaebc('0x14')](function(_0x46e205){if(_0x46e205){_0x178910[_0xaebc('0x1b')]=_0x46e205[_0xaebc('0x68')]({'plain':!![]});return db[_0xaebc('0x82')][_0xaebc('0x46')]({'where':{'id':_0x46e205[_0xaebc('0x69')]}});}return null;})[_0xaebc('0x14')](handleEntityNotFound(_0x4fb985,null))[_0xaebc('0x14')](function(_0x57fea9){if(_0x57fea9){_0x178910[_0xaebc('0x6c')]=_0x57fea9[_0xaebc('0x68')]({'plain':!![]});interaction_log['info']('[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x41871a[_0xaebc('0x6e')]['id'],_0x41871a[_0xaebc('0x6e')]['name'],_0x41871a[_0xaebc('0x6e')][_0xaebc('0x83')],_0x178910[_0xaebc('0x6c')]['id'],_0x41871a[_0xaebc('0x47')]?JSON['stringify'](_0x41871a[_0xaebc('0x47')]):_0xaebc('0x84'));return respondWithRpcPromise(_0xaebc('0x85'),_0xaebc('0x86'),_0x178910);}return null;})[_0xaebc('0x14')](function(_0x2a101e){var _0x4e5c76=_0xaebc('0x71')+_0x2a101e[_0xaebc('0x1b')]['ContactId'];return db[_0xaebc('0x73')]['query'](_0x4e5c76,{'type':db[_0xaebc('0x74')][_0xaebc('0x75')][_0xaebc('0x76')],'raw':!![]})[_0xaebc('0x14')](function(_0x3c84e){return _0x3c84e;});})[_0xaebc('0x14')](function(_0x41f072){if(_0x41f072){_0x178910['message'][_0xaebc('0x77')]=_0x41f072[0x0];if(!_0x41871a[_0xaebc('0x47')][_0xaebc('0x66')])return;return db[_0xaebc('0x87')][_0xaebc('0x46')]({'where':{'id':_0x41871a['body'][_0xaebc('0x66')],'role':_0xaebc('0x67')},'attributes':['id',_0xaebc('0x2a'),'fullname','email',_0xaebc('0x7a')],'raw':!![]});}return null;})[_0xaebc('0x14')](function(_0x50935d){if(!_0x50935d)return null;_0x178910[_0xaebc('0x1b')][_0xaebc('0x67')]=_0x50935d;return _0x178910;})[_0xaebc('0x14')](function(_0x5c632b){if(_0x5c632b){_0x5c632b[_0xaebc('0x1b')][_0xaebc('0x88')]=util[_0xaebc('0x60')](_0xaebc('0x7c'),_0x41871a[_0xaebc('0x6e')][_0xaebc('0x2a')]);_0x5c632b[_0xaebc('0x1b')][_0xaebc('0x7d')]=_0x178910[_0xaebc('0x7d')];_0x5c632b['message'][_0xaebc('0x7e')]=_0x178910['channel'];_0x5c632b[_0xaebc('0x1b')][_0xaebc('0x7f')]=_0xaebc('0x89');_0x5c632b[_0xaebc('0x1b')]['body']=htmlToText[_0xaebc('0x80')](_0x178910['message'][_0xaebc('0x47')]);respondWithRpcPromise('EventManager',_0xaebc('0x81'),{'event':_0xaebc('0x8a'),'message':_0x5c632b['message']},client9002);return _0x178910;}return null;})[_0xaebc('0x14')](respondWithResult(_0x4fb985,null))['catch'](handleError(_0x4fb985,null));};exports['download']=function(_0xd3488b,_0x583cf0){var _0x5923b8=moment()[_0xaebc('0x8b')]()[_0xaebc('0x8c')]();var _0x42c582=path[_0xaebc('0x56')](config[_0xaebc('0x57')],_0xaebc('0x8d'),_0xaebc('0x8e'),_0xaebc('0x8f'));var _0x26204a=path[_0xaebc('0x56')](config['root'],'server',_0xaebc('0x8e'),_0xaebc('0x55'));var _0x407271=util[_0xaebc('0x60')](_0xaebc('0x90'),_0x5923b8);return db['MailMessage'][_0xaebc('0x46')]({'where':{'id':_0xd3488b[_0xaebc('0x45')]['id']},'attributes':['id',_0xaebc('0x47'),_0xaebc('0x91'),'to','cc','bcc',_0xaebc('0x92'),_0xaebc('0x93')],'include':_0xd3488b[_0xaebc('0x33')]['attachments']?[{'model':db['Attachment'],'as':_0xaebc('0x94')}]:undefined})['then'](handleEntityNotFound(_0x583cf0,null))[_0xaebc('0x14')](function(_0x203621){if(_0x203621){var _0x49ba35=_0x203621;var _0x44578d={'from':_0x49ba35[_0xaebc('0x91')],'to':_0x49ba35['to'],'subject':_0x49ba35[_0xaebc('0x92')],'html':htmlEntities[_0xaebc('0x95')](_0x49ba35[_0xaebc('0x47')]),'headers':{'Date':moment(_0x49ba35['createdAt'])[_0xaebc('0x60')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x203621['cc']){_0x44578d[_0xaebc('0x96')]['Cc']=_0x203621['cc'];}if(_0x203621['bcc']){_0x44578d['headers'][_0xaebc('0x97')]=_0x203621[_0xaebc('0x98')];}return new BPromise(function(_0xdc1b69,_0x23c9ab){if(_0x203621[_0xaebc('0x94')]){for(var _0x2ecbb5=0x0;_0x2ecbb5<_0x203621[_0xaebc('0x94')][_0xaebc('0x38')];_0x2ecbb5++){var _0x40185e=_0x203621[_0xaebc('0x94')][_0x2ecbb5];var _0x283fcc=path[_0xaebc('0x56')](_0x26204a,_0x40185e[_0xaebc('0x59')]);if(fs[_0xaebc('0x99')](_0x283fcc)){_0x44578d['attachments'][_0xaebc('0x9a')]({'name':_0x40185e[_0xaebc('0x2a')],'contentType':_0x40185e['type'],'data':fs[_0xaebc('0x9b')](_0x283fcc)});}}}emlformat[_0xaebc('0x9c')](_0x44578d,function(_0x44188c,_0x32bcb9){if(_0x44188c)return _0x23c9ab(_0x44188c);fs[_0xaebc('0x9d')](path[_0xaebc('0x56')](_0x42c582,_0x407271),_0x32bcb9);return _0xdc1b69(_0x32bcb9);});});}})[_0xaebc('0x14')](function(_0x1a94be){if(_0x1a94be){return _0x583cf0[_0xaebc('0x9e')](path[_0xaebc('0x56')](_0x42c582,_0x407271),_0x407271,function(_0x4ad741){if(!_0x4ad741)fs[_0xaebc('0x9f')](path[_0xaebc('0x56')](_0x42c582,_0x407271));});}})[_0xaebc('0x1d')](handleError(_0x583cf0,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 554fbd6..5dcac58 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 _0x27d2=['update','emit','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save'];(function(_0x3c0cd6,_0x5ba428){var _0x4381ec=function(_0x2ab4b3){while(--_0x2ab4b3){_0x3c0cd6['push'](_0x3c0cd6['shift']());}};_0x4381ec(++_0x5ba428);}(_0x27d2,0xc1));var _0x227d=function(_0x285732,_0x4b3ce4){_0x285732=_0x285732-0x0;var _0x16f824=_0x27d2[_0x285732];return _0x16f824;};'use strict';var EventEmitter=require(_0x227d('0x0'));var MailMessage=require(_0x227d('0x1'))['db'][_0x227d('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x227d('0x3')](0x0);var events={'afterCreate':_0x227d('0x4'),'afterUpdate':_0x227d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x77c405){return function(_0x525db5,_0x4106b6,_0x257cd1){MailMessageEvents[_0x227d('0x6')](_0x77c405+':'+_0x525db5['id'],_0x525db5);MailMessageEvents[_0x227d('0x6')](_0x77c405,_0x525db5);_0x257cd1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x227d('0x7')](e,emitEvent(event));}}module[_0x227d('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x22f2=['save','update','remove','emit','hook','exports','events','MailMessage','setMaxListeners'];(function(_0x171fdc,_0x16ae91){var _0x3782ea=function(_0x58b691){while(--_0x58b691){_0x171fdc['push'](_0x171fdc['shift']());}};_0x3782ea(++_0x16ae91);}(_0x22f2,0xf9));var _0x222f=function(_0x5c820a,_0x4d3ae4){_0x5c820a=_0x5c820a-0x0;var _0x41ca61=_0x22f2[_0x5c820a];return _0x41ca61;};'use strict';var EventEmitter=require(_0x222f('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x222f('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x222f('0x2')](0x0);var events={'afterCreate':_0x222f('0x3'),'afterUpdate':_0x222f('0x4'),'afterDestroy':_0x222f('0x5')};function emitEvent(_0x8e8959){return function(_0x217c1e,_0x3c8bc4,_0x1b43f1){MailMessageEvents[_0x222f('0x6')](_0x8e8959+':'+_0x217c1e['id'],_0x217c1e);MailMessageEvents[_0x222f('0x6')](_0x8e8959,_0x217c1e);_0x1b43f1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x222f('0x7')](e,emitEvent(event));}}module[_0x222f('0x8')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index e6821f4..43092f7 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 _0x1b6e=['subject','body','get','toLowerCase','direction','isNil','UserId','findOne','MailInteractionId','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','messageId','fti_mail_messages','plainBody'];(function(_0x5043fa,_0xfc35b){var _0x1d064f=function(_0x2954c2){while(--_0x2954c2){_0x5043fa['push'](_0x5043fa['shift']());}};_0x1d064f(++_0xfc35b);}(_0x1b6e,0x8b));var _0xe1b6=function(_0x126b9f,_0xb7dec0){_0x126b9f=_0x126b9f-0x0;var _0x2bd0f8=_0x1b6e[_0x126b9f];return _0x2bd0f8;};'use strict';var _=require(_0xe1b6('0x0'));var util=require(_0xe1b6('0x1'));var logger=require(_0xe1b6('0x2'))(_0xe1b6('0x3'));var moment=require(_0xe1b6('0x4'));var BPromise=require(_0xe1b6('0x5'));var rp=require('request-promise');var htmlToText=require(_0xe1b6('0x6'));var fs=require('fs');var path=require(_0xe1b6('0x7'));var rimraf=require(_0xe1b6('0x8'));var config=require(_0xe1b6('0x9'));var attributes=require(_0xe1b6('0xa'));module[_0xe1b6('0xb')]=function(_0x22085f,_0x5a177d){return _0x22085f[_0xe1b6('0xc')]('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xe1b6('0xd'),'fields':[_0xe1b6('0xd')]},{'name':_0xe1b6('0xe'),'fields':[_0xe1b6('0xf'),_0xe1b6('0x10')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x365ae2,_0x5ae4ca,_0x502ff3){if(_0x365ae2[_0xe1b6('0x11')]){_0x365ae2[_0xe1b6('0xf')]=htmlToText['fromString'](_0x365ae2[_0xe1b6('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x502ff3(null,_0x5ae4ca);},'afterCreate':function(_0x5c0ef1,_0x16188a,_0x5c87c2){var _0x56d19c=_0x22085f['models'];var _0x35cebf=_0x5c0ef1[_0xe1b6('0x12')]({'plain':!![]});if(_0x35cebf['direction'][_0xe1b6('0x13')]()==='in'||_0x35cebf[_0xe1b6('0x14')][_0xe1b6('0x13')]()==='out'&&!_0x35cebf['secret']&&!_[_0xe1b6('0x15')](_0x35cebf[_0xe1b6('0x16')])){_0x56d19c['MailInteraction'][_0xe1b6('0x17')]({'where':{'id':_0x35cebf[_0xe1b6('0x18')]}})['then'](function(_0x592ea3){if(_0x592ea3){_0x592ea3[_0xe1b6('0x19')]({'lastMsgAt':_0x35cebf[_0xe1b6('0x1a')],'lastMsgDirection':_0x35cebf[_0xe1b6('0x14')][_0xe1b6('0x13')]()});}})[_0xe1b6('0x1b')](function(_0x467472){console[_0xe1b6('0x1c')](_0x467472);});}_0x5c87c2();}},'charset':_0xe1b6('0x1d'),'collate':_0xe1b6('0x1e')});}; \ No newline at end of file +var _0x1f92=['UserId','findOne','MailInteractionId','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','MailMessage','mail_messages','messageId','plainBody','FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','secret'];(function(_0x94e2d,_0x176269){var _0x21b4a9=function(_0x2daa5d){while(--_0x2daa5d){_0x94e2d['push'](_0x94e2d['shift']());}};_0x21b4a9(++_0x176269);}(_0x1f92,0xce));var _0x21f9=function(_0x60b31,_0x1a8790){_0x60b31=_0x60b31-0x0;var _0x2ab0ed=_0x1f92[_0x60b31];return _0x2ab0ed;};'use strict';var _=require(_0x21f9('0x0'));var util=require(_0x21f9('0x1'));var logger=require('../../config/logger')(_0x21f9('0x2'));var moment=require(_0x21f9('0x3'));var BPromise=require(_0x21f9('0x4'));var rp=require(_0x21f9('0x5'));var htmlToText=require(_0x21f9('0x6'));var fs=require('fs');var path=require(_0x21f9('0x7'));var rimraf=require(_0x21f9('0x8'));var config=require(_0x21f9('0x9'));var attributes=require(_0x21f9('0xa'));module[_0x21f9('0xb')]=function(_0x2bda3c,_0x15f8bc){return _0x2bda3c['define'](_0x21f9('0xc'),attributes,{'tableName':_0x21f9('0xd'),'paranoid':![],'indexes':[{'name':_0x21f9('0xe'),'fields':[_0x21f9('0xe')]},{'name':'fti_mail_messages','fields':[_0x21f9('0xf'),'subject'],'type':_0x21f9('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3f403b,_0x213d59,_0x1c0236){if(_0x3f403b[_0x21f9('0x11')]){_0x3f403b[_0x21f9('0xf')]=htmlToText[_0x21f9('0x12')](_0x3f403b[_0x21f9('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1c0236(null,_0x213d59);},'afterCreate':function(_0x3d0ba7,_0x1085e6,_0x3837e7){var _0x4bfea5=_0x2bda3c[_0x21f9('0x13')];var _0x445f77=_0x3d0ba7[_0x21f9('0x14')]({'plain':!![]});if(_0x445f77[_0x21f9('0x15')][_0x21f9('0x16')]()==='in'||_0x445f77[_0x21f9('0x15')][_0x21f9('0x16')]()===_0x21f9('0x17')&&!_0x445f77[_0x21f9('0x18')]&&!_['isNil'](_0x445f77[_0x21f9('0x19')])){_0x4bfea5['MailInteraction'][_0x21f9('0x1a')]({'where':{'id':_0x445f77[_0x21f9('0x1b')]}})['then'](function(_0x39a7a2){if(_0x39a7a2){_0x39a7a2[_0x21f9('0x1c')]({'lastMsgAt':_0x445f77[_0x21f9('0x1d')],'lastMsgDirection':_0x445f77[_0x21f9('0x15')][_0x21f9('0x16')]()});}})['catch'](function(_0xcb265d){console[_0x21f9('0x1e')](_0xcb265d);});}_0x3837e7();}},'charset':_0x21f9('0x1f'),'collate':_0x21f9('0x20')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index bb6c5f7..7ed8f76 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 _0xd914=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateMailMessage','MailMessage','create','body','options','raw','stringify','lodash'];(function(_0x241b5a,_0x5ac06c){var _0x49fff8=function(_0x31f8ec){while(--_0x31f8ec){_0x241b5a['push'](_0x241b5a['shift']());}};_0x49fff8(++_0x5ac06c);}(_0xd914,0x17f));var _0x4d91=function(_0x445101,_0x2414bf){_0x445101=_0x445101-0x0;var _0x3c3d04=_0xd914[_0x445101];return _0x3c3d04;};'use strict';var _=require(_0x4d91('0x0'));var util=require(_0x4d91('0x1'));var moment=require('moment');var BPromise=require(_0x4d91('0x2'));var rs=require(_0x4d91('0x3'));var fs=require('fs');var Redis=require(_0x4d91('0x4'));var db=require(_0x4d91('0x5'))['db'];var utils=require(_0x4d91('0x6'));var logger=require(_0x4d91('0x7'))('rpc');var config=require(_0x4d91('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4d91('0x9')][_0x4d91('0xa')]({'port':0x232a});config[_0x4d91('0xb')]=_[_0x4d91('0xc')](config[_0x4d91('0xb')],{'host':_0x4d91('0xd'),'port':0x18eb});var socket=require(_0x4d91('0xe'))(new Redis(config[_0x4d91('0xb')]));require('./mailMessage.socket')[_0x4d91('0xf')](socket);function respondWithRpcPromise(_0xa4bb25,_0xc07c64,_0x278648){return new BPromise(function(_0xb234d2,_0x266b31){return client['request'](_0xa4bb25,_0x278648)['then'](function(_0x2ccd08){logger[_0x4d91('0x10')](_0x4d91('0x11'),_0xc07c64,_0x4d91('0x12'));logger[_0x4d91('0x13')](_0x4d91('0x14'),_0xc07c64,'request\x20sent',JSON['stringify'](_0x2ccd08));if(_0x2ccd08[_0x4d91('0x15')]){if(_0x2ccd08[_0x4d91('0x15')][_0x4d91('0x16')]===0x1f4){logger[_0x4d91('0x15')](_0x4d91('0x11'),_0xc07c64,_0x2ccd08[_0x4d91('0x15')][_0x4d91('0x17')]);return _0x266b31(_0x2ccd08['error'][_0x4d91('0x17')]);}logger[_0x4d91('0x15')](_0x4d91('0x11'),_0xc07c64,_0x2ccd08[_0x4d91('0x15')][_0x4d91('0x17')]);return _0xb234d2(_0x2ccd08['error'][_0x4d91('0x17')]);}else{logger[_0x4d91('0x10')](_0x4d91('0x11'),_0xc07c64,_0x4d91('0x12'));_0xb234d2(_0x2ccd08['result'][_0x4d91('0x17')]);}})[_0x4d91('0x18')](function(_0x13254c){logger['error'](_0x4d91('0x11'),_0xc07c64,_0x13254c);_0x266b31(_0x13254c);});});}exports[_0x4d91('0x19')]=function(_0x351388){var _0xd59fe=this;return new Promise(function(_0x10b767,_0x40cde4){return db[_0x4d91('0x1a')][_0x4d91('0x1b')](_0x351388[_0x4d91('0x1c')],{'raw':_0x351388[_0x4d91('0x1d')]?_0x351388['options'][_0x4d91('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x57913e){logger[_0x4d91('0x10')](_0x4d91('0x19'),_0x351388);logger[_0x4d91('0x13')](_0x4d91('0x19'),_0x351388,JSON[_0x4d91('0x1f')](_0x57913e));_0x10b767(_0x57913e);})[_0x4d91('0x18')](function(_0x100cd4){logger[_0x4d91('0x15')]('CreateMailMessage',_0x100cd4['message'],_0x351388);_0x40cde4(_0xd59fe[_0x4d91('0x15')](0x1f4,_0x100cd4[_0x4d91('0x17')]));});});}; \ No newline at end of file +var _0xea28=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','CreateMailMessage','MailMessage','body','options','raw','stringify','lodash'];(function(_0x1a7550,_0x1edace){var _0x426e22=function(_0x1c10a1){while(--_0x1c10a1){_0x1a7550['push'](_0x1a7550['shift']());}};_0x426e22(++_0x1edace);}(_0xea28,0x13a));var _0x8ea2=function(_0x5285b8,_0x2b09dd){_0x5285b8=_0x5285b8-0x0;var _0x4c68af=_0xea28[_0x5285b8];return _0x4c68af;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var moment=require(_0x8ea2('0x2'));var BPromise=require(_0x8ea2('0x3'));var rs=require(_0x8ea2('0x4'));var fs=require('fs');var Redis=require(_0x8ea2('0x5'));var db=require(_0x8ea2('0x6'))['db'];var utils=require(_0x8ea2('0x7'));var logger=require('../../config/logger')(_0x8ea2('0x8'));var config=require(_0x8ea2('0x9'));var jayson=require(_0x8ea2('0xa'));var client=jayson['client'][_0x8ea2('0xb')]({'port':0x232a});config[_0x8ea2('0xc')]=_[_0x8ea2('0xd')](config[_0x8ea2('0xc')],{'host':_0x8ea2('0xe'),'port':0x18eb});var socket=require(_0x8ea2('0xf'))(new Redis(config[_0x8ea2('0xc')]));require(_0x8ea2('0x10'))[_0x8ea2('0x11')](socket);function respondWithRpcPromise(_0x3000f9,_0x3d0b35,_0x21ae3d){return new BPromise(function(_0x500b82,_0x4da3b1){return client[_0x8ea2('0x12')](_0x3000f9,_0x21ae3d)[_0x8ea2('0x13')](function(_0x374973){logger['info'](_0x8ea2('0x14'),_0x3d0b35,_0x8ea2('0x15'));logger[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x3d0b35,_0x8ea2('0x15'),JSON['stringify'](_0x374973));if(_0x374973[_0x8ea2('0x18')]){if(_0x374973['error']['code']===0x1f4){logger[_0x8ea2('0x18')](_0x8ea2('0x14'),_0x3d0b35,_0x374973[_0x8ea2('0x18')][_0x8ea2('0x19')]);return _0x4da3b1(_0x374973[_0x8ea2('0x18')][_0x8ea2('0x19')]);}logger[_0x8ea2('0x18')](_0x8ea2('0x14'),_0x3d0b35,_0x374973[_0x8ea2('0x18')][_0x8ea2('0x19')]);return _0x500b82(_0x374973[_0x8ea2('0x18')][_0x8ea2('0x19')]);}else{logger[_0x8ea2('0x1a')](_0x8ea2('0x14'),_0x3d0b35,_0x8ea2('0x15'));_0x500b82(_0x374973[_0x8ea2('0x1b')][_0x8ea2('0x19')]);}})[_0x8ea2('0x1c')](function(_0x1068b6){logger[_0x8ea2('0x18')](_0x8ea2('0x14'),_0x3d0b35,_0x1068b6);_0x4da3b1(_0x1068b6);});});}exports[_0x8ea2('0x1d')]=function(_0x52b58c){var _0x4be7c9=this;return new Promise(function(_0x3790e9,_0x248c18){return db[_0x8ea2('0x1e')]['create'](_0x52b58c[_0x8ea2('0x1f')],{'raw':_0x52b58c[_0x8ea2('0x20')]?_0x52b58c['options'][_0x8ea2('0x21')]===undefined?!![]:![]:!![]})[_0x8ea2('0x13')](function(_0x37229a){logger[_0x8ea2('0x1a')](_0x8ea2('0x1d'),_0x52b58c);logger[_0x8ea2('0x16')](_0x8ea2('0x1d'),_0x52b58c,JSON[_0x8ea2('0x22')](_0x37229a));_0x3790e9(_0x37229a);})[_0x8ea2('0x1c')](function(_0x4d5030){logger[_0x8ea2('0x18')]('CreateMailMessage',_0x4d5030[_0x8ea2('0x19')],_0x52b58c);_0x248c18(_0x4be7c9[_0x8ea2('0x18')](0x1f4,_0x4d5030[_0x8ea2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 44a9d21..ee71b69 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 _0xf5d8=['save','removeListener','register','mailMessage:'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf5d8,0x9c));var _0x8f5d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf5d8[_0x3dd15e];return _0x231fd0;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x8f5d('0x0'),'remove','update'];function createListener(_0x5a1e8c,_0x247797){return function(_0x2dbb10){_0x247797['emit'](_0x5a1e8c,_0x2dbb10);};}function removeListener(_0x77d954,_0x37eb9e){return function(){MailMessageEvents[_0x8f5d('0x1')](_0x77d954,_0x37eb9e);};}exports[_0x8f5d('0x2')]=function(_0x100a40){for(var _0x1c07b1=0x0,_0x3f44e2=events['length'];_0x1c07b1<_0x3f44e2;_0x1c07b1++){var _0x21a101=events[_0x1c07b1];var _0x5f09f8=createListener(_0x8f5d('0x3')+_0x21a101,_0x100a40);MailMessageEvents['on'](_0x21a101,_0x5f09f8);}}; \ No newline at end of file +var _0xe54d=['mailMessage:','./mailMessage.events','save','update','removeListener','register','length'];(function(_0x1278b6,_0x24252e){var _0x2cff42=function(_0x46b845){while(--_0x46b845){_0x1278b6['push'](_0x1278b6['shift']());}};_0x2cff42(++_0x24252e);}(_0xe54d,0xbe));var _0xde54=function(_0x1bd313,_0x18b3ef){_0x1bd313=_0x1bd313-0x0;var _0x4c19b3=_0xe54d[_0x1bd313];return _0x4c19b3;};'use strict';var MailMessageEvents=require(_0xde54('0x0'));var events=[_0xde54('0x1'),'remove',_0xde54('0x2')];function createListener(_0x5e4048,_0x6d7fac){return function(_0x266df6){_0x6d7fac['emit'](_0x5e4048,_0x266df6);};}function removeListener(_0x141a3f,_0x26ef76){return function(){MailMessageEvents[_0xde54('0x3')](_0x141a3f,_0x26ef76);};}exports[_0xde54('0x4')]=function(_0x1bad1d){for(var _0xc080cd=0x0,_0x2e37f8=events[_0xde54('0x5')];_0xc080cd<_0x2e37f8;_0xc080cd++){var _0x353c26=events[_0xc080cd];var _0x2c0414=createListener(_0xde54('0x6')+_0x353c26,_0x1bad1d);MailMessageEvents['on'](_0x353c26,_0x2c0414);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 1a85d5f..3888387 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 _0xbd07=['../../components/auth/service','../../config/environment','isAuthenticated','get','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','delete','removeAgents','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x2da5bc,_0x43dd52){var _0x445d91=function(_0xf636a1){while(--_0xf636a1){_0x2da5bc['push'](_0x2da5bc['shift']());}};_0x445d91(++_0x43dd52);}(_0xbd07,0x166));var _0x7bd0=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0xbd07[_0x1992f1];return _0x413dfe;};'use strict';var multer=require(_0x7bd0('0x0'));var util=require(_0x7bd0('0x1'));var path=require(_0x7bd0('0x2'));var timeout=require(_0x7bd0('0x3'));var express=require('express');var router=express[_0x7bd0('0x4')]();var fs_extra=require(_0x7bd0('0x5'));var auth=require(_0x7bd0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7bd0('0x7'));var controller=require('./mailQueue.controller');router['get']('/',auth[_0x7bd0('0x8')](),controller['index']);router[_0x7bd0('0x9')](_0x7bd0('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x7bd0('0x9')](_0x7bd0('0xb'),auth[_0x7bd0('0x8')](),controller[_0x7bd0('0xc')]);router[_0x7bd0('0x9')](_0x7bd0('0xd'),auth[_0x7bd0('0x8')](),controller[_0x7bd0('0xe')]);router[_0x7bd0('0x9')](_0x7bd0('0xf'),auth[_0x7bd0('0x8')](),controller[_0x7bd0('0x10')]);router[_0x7bd0('0x9')](_0x7bd0('0x11'),auth[_0x7bd0('0x8')](),controller['getAgents']);router[_0x7bd0('0x12')]('/',auth[_0x7bd0('0x8')](),controller[_0x7bd0('0x13')]);router[_0x7bd0('0x12')](_0x7bd0('0xf'),auth['isAuthenticated'](),controller[_0x7bd0('0x14')]);router[_0x7bd0('0x12')](_0x7bd0('0x11'),auth['isAuthenticated'](),controller[_0x7bd0('0x15')]);router[_0x7bd0('0x16')](_0x7bd0('0xb'),auth[_0x7bd0('0x8')](),controller[_0x7bd0('0x17')]);router[_0x7bd0('0x18')](_0x7bd0('0xb'),auth[_0x7bd0('0x8')](),controller['destroy']);router[_0x7bd0('0x18')](_0x7bd0('0xf'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x7bd0('0x18')](_0x7bd0('0x11'),auth[_0x7bd0('0x8')](),controller[_0x7bd0('0x19')]);module['exports']=router; \ No newline at end of file +var _0x2cb7=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','getMembers','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express'];(function(_0x5173ff,_0x1909ed){var _0x20468b=function(_0x1b6693){while(--_0x1b6693){_0x5173ff['push'](_0x5173ff['shift']());}};_0x20468b(++_0x1909ed);}(_0x2cb7,0x1a8));var _0x72cb=function(_0x5c9f56,_0x42c9ad){_0x5c9f56=_0x5c9f56-0x0;var _0x2a726b=_0x2cb7[_0x5c9f56];return _0x2a726b;};'use strict';var multer=require(_0x72cb('0x0'));var util=require(_0x72cb('0x1'));var path=require(_0x72cb('0x2'));var timeout=require(_0x72cb('0x3'));var express=require(_0x72cb('0x4'));var router=express[_0x72cb('0x5')]();var fs_extra=require(_0x72cb('0x6'));var auth=require(_0x72cb('0x7'));var interaction=require(_0x72cb('0x8'));var config=require(_0x72cb('0x9'));var controller=require(_0x72cb('0xa'));router[_0x72cb('0xb')]('/',auth['isAuthenticated'](),controller[_0x72cb('0xc')]);router['get'](_0x72cb('0xd'),auth[_0x72cb('0xe')](),controller[_0x72cb('0xf')]);router[_0x72cb('0xb')](_0x72cb('0x10'),auth[_0x72cb('0xe')](),controller[_0x72cb('0x11')]);router[_0x72cb('0xb')]('/:id/members',auth[_0x72cb('0xe')](),controller[_0x72cb('0x12')]);router[_0x72cb('0xb')]('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router[_0x72cb('0xb')](_0x72cb('0x13'),auth[_0x72cb('0xe')](),controller[_0x72cb('0x14')]);router[_0x72cb('0x15')]('/',auth[_0x72cb('0xe')](),controller[_0x72cb('0x16')]);router[_0x72cb('0x15')](_0x72cb('0x17'),auth[_0x72cb('0xe')](),controller[_0x72cb('0x18')]);router[_0x72cb('0x15')]('/:id/users',auth[_0x72cb('0xe')](),controller[_0x72cb('0x19')]);router[_0x72cb('0x1a')](_0x72cb('0x10'),auth['isAuthenticated'](),controller[_0x72cb('0x1b')]);router[_0x72cb('0x1c')](_0x72cb('0x10'),auth['isAuthenticated'](),controller[_0x72cb('0x1d')]);router['delete'](_0x72cb('0x17'),auth['isAuthenticated'](),controller[_0x72cb('0x1e')]);router[_0x72cb('0x1c')]('/:id/users',auth['isAuthenticated'](),controller[_0x72cb('0x1f')]);module[_0x72cb('0x20')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 0604b65..5d282a3 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 _0x7a3b=['roundrobin','sequelize','name','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x7a3b,0xdd));var _0xb7a3=function(_0x1bf59b,_0x2b8c55){_0x1bf59b=_0x1bf59b-0x0;var _0x46fd25=_0x7a3b[_0x1bf59b];return _0x46fd25;};'use strict';var Sequelize=require(_0xb7a3('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xb7a3('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb7a3('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall',_0xb7a3('0x3'))}}; \ No newline at end of file +var _0xe6ab=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','STRING'];(function(_0x177b61,_0x33441d){var _0x274097=function(_0x29b4e6){while(--_0x29b4e6){_0x177b61['push'](_0x177b61['shift']());}};_0x274097(++_0x33441d);}(_0xe6ab,0x1b6));var _0xbe6a=function(_0x511163,_0x19f74d){_0x511163=_0x511163-0x0;var _0x421a0e=_0xe6ab[_0x511163];return _0x421a0e;};'use strict';var Sequelize=require(_0xbe6a('0x0'));module['exports']={'name':{'type':Sequelize[_0xbe6a('0x1')],'unique':_0xbe6a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbe6a('0x1')]},'timeout':{'type':Sequelize[_0xbe6a('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbe6a('0x4')](_0xbe6a('0x5'),_0xbe6a('0x6'),_0xbe6a('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index daef2d5..2322ce5 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 _0x572f=['TeamId','all','union','compact','value','isEmpty','removeAgents','userMailQueue:remove','omit','spread','getAgents','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','then','MailQueues','UserProfileResource','destroy','error','stack','name','send','index','map','MailQueue','fieldName','type','getOptions','where','include','query','findAll','catch','show','params','model','keys','rawAttributes','intersection','fields','attributes','merge','options','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserMailQueue','hasOwnProperty','order','sort','MailQueueId','filter','User','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','Team','filters','length','pick','getTeams','nolimit','addTeams','ids','flatMap','transaction','each','forEach','emit','userMailQueue:save','removeTeams','Agents','field','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every'];(function(_0x5c107d,_0x155dbe){var _0x3eaf06=function(_0x348dd6){while(--_0x348dd6){_0x5c107d['push'](_0x5c107d['shift']());}};_0x3eaf06(++_0x155dbe);}(_0x572f,0x80));var _0xf572=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x572f[_0xfae23b];return _0x200640;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var squel=require('squel');var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xf572('0x0'))(_0xf572('0x1'));var config=require(_0xf572('0x2'));var db=require(_0xf572('0x3'))['db'];config[_0xf572('0x4')]=_[_0xf572('0x5')](config[_0xf572('0x4')],{'host':_0xf572('0x6'),'port':0x18eb});var socket=require(_0xf572('0x7'))(new Redis(config[_0xf572('0x4')]));require(_0xf572('0x8'))[_0xf572('0x9')](socket);function respondWithStatusCode(_0x56161e,_0xc8583d){_0xc8583d=_0xc8583d||0xcc;return function(_0x5eff42){if(_0x5eff42){return _0x56161e[_0xf572('0xa')](_0xc8583d);}return _0x56161e[_0xf572('0xb')](_0xc8583d)[_0xf572('0xc')]();};}function respondWithResult(_0x31c053,_0x4bc6bb){_0x4bc6bb=_0x4bc6bb||0xc8;return function(_0x5e78eb){if(_0x5e78eb){return _0x31c053['status'](_0x4bc6bb)[_0xf572('0xd')](_0x5e78eb);}};}function respondWithFilteredResult(_0x49955f,_0x5bb2d6){return function(_0x324679){if(_0x324679){var _0x47435f=typeof _0x5bb2d6['offset']===_0xf572('0xe')&&typeof _0x5bb2d6[_0xf572('0xf')]===_0xf572('0xe');var _0x51185d=_0x324679[_0xf572('0x10')];var _0x225e80=_0x47435f?0x0:_0x5bb2d6[_0xf572('0x11')];var _0x477d04=_0x47435f?_0x324679[_0xf572('0x10')]:_0x5bb2d6[_0xf572('0x11')]+_0x5bb2d6['limit'];var _0x2a2821;if(_0x477d04>=_0x51185d){_0x477d04=_0x51185d;_0x2a2821=0xc8;}else{_0x2a2821=0xce;}_0x49955f[_0xf572('0xb')](_0x2a2821);return _0x49955f[_0xf572('0x12')](_0xf572('0x13'),_0x225e80+'-'+_0x477d04+'/'+_0x51185d)[_0xf572('0xd')](_0x324679);}return null;};}function saveUpdates(_0x4ca943){return function(_0x8cbd98){if(_0x8cbd98){return _0x8cbd98['update'](_0x4ca943)[_0xf572('0x14')](function(_0x3a4e8d){return _0x3a4e8d;});}return null;};}function removeEntity(_0x6c8b16){return function(_0x49444e){if(_0x49444e){return _0x49444e['destroy']()[_0xf572('0x14')](function(){var _0x4deeea=_0x49444e['get']({'plain':!![]});var _0x5b1b8b=_0xf572('0x15');return db[_0xf572('0x16')][_0xf572('0x17')]({'where':{'type':_0x5b1b8b,'resourceId':_0x4deeea['id']}})[_0xf572('0x14')](function(){return _0x49444e;});})[_0xf572('0x14')](function(){_0x6c8b16[_0xf572('0xb')](0xcc)[_0xf572('0xc')]();});}};}function handleEntityNotFound(_0x165787){return function(_0x2e0b30){if(!_0x2e0b30){_0x165787[_0xf572('0xa')](0x194);}return _0x2e0b30;};}function handleError(_0x5b1483,_0x11ca88){_0x11ca88=_0x11ca88||0x1f4;return function(_0x408fa4){logger[_0xf572('0x18')](_0x408fa4[_0xf572('0x19')]);if(_0x408fa4[_0xf572('0x1a')]){delete _0x408fa4[_0xf572('0x1a')];}_0x5b1483[_0xf572('0xb')](_0x11ca88)[_0xf572('0x1b')](_0x408fa4);};}exports[_0xf572('0x1c')]=function(_0x11a266,_0x2aa077){var _0x199018={};var _0x59dcc4={'count':0x0,'rows':[]};var _0x444b7a=_[_0xf572('0x1d')](db[_0xf572('0x1e')]['rawAttributes'],function(_0x3f5f31){return{'name':_0x3f5f31[_0xf572('0x1f')],'type':_0x3f5f31[_0xf572('0x20')]['key']};});_0x199018=qs[_0xf572('0x21')](_0x444b7a,_0x11a266);var _0x32757f={'where':_0x199018[_0xf572('0x22')]};return db['MailQueue'][_0xf572('0x10')](_0x32757f)[_0xf572('0x14')](function(_0x2984c0){_0x59dcc4[_0xf572('0x10')]=_0x2984c0;_0x199018['include']=qs[_0xf572('0x23')](_0x11a266[_0xf572('0x24')]);return db[_0xf572('0x1e')][_0xf572('0x25')](_0x199018);})[_0xf572('0x14')](function(_0x26eb66){_0x59dcc4['rows']=_0x26eb66;return _0x59dcc4;})[_0xf572('0x14')](respondWithFilteredResult(_0x2aa077,_0x199018))[_0xf572('0x26')](handleError(_0x2aa077,null));};exports[_0xf572('0x27')]=function(_0x3628ec,_0x33b223){var _0x511459={'raw':!![],'where':{'id':_0x3628ec[_0xf572('0x28')]['id']}},_0x270d90={};_0x270d90[_0xf572('0x29')]=_[_0xf572('0x2a')](db[_0xf572('0x1e')][_0xf572('0x2b')]);_0x270d90['query']=_[_0xf572('0x2a')](_0x3628ec[_0xf572('0x24')]);_0x270d90['filters']=_[_0xf572('0x2c')](_0x270d90[_0xf572('0x29')],_0x270d90['query']);_0x511459['attributes']=_[_0xf572('0x2c')](_0x270d90[_0xf572('0x29')],qs[_0xf572('0x2d')](_0x3628ec['query'][_0xf572('0x2d')]));_0x511459[_0xf572('0x2e')]=_0x511459[_0xf572('0x2e')]['length']?_0x511459['attributes']:_0x270d90[_0xf572('0x29')];if(_0x3628ec[_0xf572('0x24')]['includeAll']){_0x511459['include']=[{'all':!![]}];}_0x511459=_[_0xf572('0x2f')]({},_0x511459,_0x3628ec[_0xf572('0x30')]);return db['MailQueue']['find'](_0x511459)['then'](handleEntityNotFound(_0x33b223,null))[_0xf572('0x14')](respondWithResult(_0x33b223,null))['catch'](handleError(_0x33b223,null));};exports[_0xf572('0x31')]=function(_0x298dfd,_0x24688e){return db[_0xf572('0x1e')]['create'](_0x298dfd[_0xf572('0x32')],{})[_0xf572('0x14')](function(_0x843477){var _0x27b21f=_0x298dfd['user'][_0xf572('0x33')]({'plain':!![]});if(!_0x27b21f)throw new Error(_0xf572('0x34'));if(_0x27b21f[_0xf572('0x35')]==='user'){var _0x1f0e7f=_0x843477[_0xf572('0x33')]({'plain':!![]});var _0x44ddb6=_0xf572('0x15');return db[_0xf572('0x36')][_0xf572('0x37')]({'where':{'name':_0x44ddb6,'userProfileId':_0x27b21f[_0xf572('0x38')]},'raw':!![]})[_0xf572('0x14')](function(_0x3fc0b2){if(_0x3fc0b2&&_0x3fc0b2[_0xf572('0x39')]===0x0){return db[_0xf572('0x16')][_0xf572('0x31')]({'name':_0x1f0e7f[_0xf572('0x1a')],'resourceId':_0x1f0e7f['id'],'type':_0x3fc0b2[_0xf572('0x1a')],'sectionId':_0x3fc0b2['id']},{})[_0xf572('0x14')](function(){return _0x843477;});}else{return _0x843477;}})[_0xf572('0x26')](function(_0x26b9c0){logger['error'](_0xf572('0x3a'),_0x26b9c0);throw _0x26b9c0;});}return _0x843477;})[_0xf572('0x14')](respondWithResult(_0x24688e,0xc9))[_0xf572('0x26')](handleError(_0x24688e,null));};exports[_0xf572('0x3b')]=function(_0x1fef46,_0x39f15b){if(_0x1fef46[_0xf572('0x32')]['id']){delete _0x1fef46[_0xf572('0x32')]['id'];}return db['MailQueue'][_0xf572('0x37')]({'where':{'id':_0x1fef46['params']['id']}})[_0xf572('0x14')](handleEntityNotFound(_0x39f15b,null))[_0xf572('0x14')](saveUpdates(_0x1fef46[_0xf572('0x32')],null))[_0xf572('0x14')](respondWithResult(_0x39f15b,null))[_0xf572('0x26')](handleError(_0x39f15b,null));};exports[_0xf572('0x17')]=function(_0x47d87f,_0x1b33a0){return db[_0xf572('0x1e')][_0xf572('0x37')]({'where':{'id':_0x47d87f[_0xf572('0x28')]['id']}})['then'](handleEntityNotFound(_0x1b33a0,null))[_0xf572('0x14')](removeEntity(_0x1b33a0,null))['catch'](handleError(_0x1b33a0,null));};exports[_0xf572('0x3c')]=function(_0xa6a601,_0x22d237){return db[_0xf572('0x1e')][_0xf572('0x3c')]()[_0xf572('0x14')](respondWithResult(_0x22d237,null))[_0xf572('0x26')](handleError(_0x22d237,null));};exports['getMembers']=function(_0x5448ac,_0x5c509d){var _0x3804cc={'raw':!![],'where':{}},_0x50a0c7={},_0x53c14f;return db['MailQueue'][_0xf572('0x3d')]({'where':{'id':_0x5448ac[_0xf572('0x28')]['id']}})['then'](handleEntityNotFound(_0x5c509d,null))[_0xf572('0x14')](function(_0xec6df7){if(_0xec6df7){_0x53c14f=_0xec6df7[_0xf572('0x33')]({'plain':!![]});_0x50a0c7['model']=_[_0xf572('0x2a')](db[_0xf572('0x3e')][_0xf572('0x2b')]);_0x50a0c7[_0xf572('0x24')]=_['keys'](_0x5448ac['query']);_0x50a0c7['filters']=_[_0xf572('0x2c')](_0x50a0c7['model'],_0x50a0c7[_0xf572('0x24')]);_0x3804cc['attributes']=_[_0xf572('0x2c')](_0x50a0c7[_0xf572('0x29')],qs[_0xf572('0x2d')](_0x5448ac['query'][_0xf572('0x2d')]));_0x3804cc[_0xf572('0x2e')]=_0x3804cc['attributes']['length']?_0x3804cc[_0xf572('0x2e')]:_0x50a0c7[_0xf572('0x29')];if(!_0x5448ac[_0xf572('0x24')][_0xf572('0x3f')]('nolimit')){_0x3804cc[_0xf572('0xf')]=qs[_0xf572('0xf')](_0x5448ac[_0xf572('0x24')][_0xf572('0xf')]);_0x3804cc[_0xf572('0x11')]=qs[_0xf572('0x11')](_0x5448ac['query']['offset']);}_0x3804cc[_0xf572('0x40')]=qs['sort'](_0x5448ac[_0xf572('0x24')][_0xf572('0x41')]);_0x3804cc[_0xf572('0x22')]=qs['filters'](_['pick'](_0x5448ac[_0xf572('0x24')],_0x50a0c7['filters']));_0x3804cc[_0xf572('0x22')][_0xf572('0x42')]=_0xec6df7['id'];if(_0x5448ac['query'][_0xf572('0x43')]){_0x3804cc['where']=_[_0xf572('0x2f')](_0x3804cc[_0xf572('0x22')],{'$or':_[_0xf572('0x1d')](_0x3804cc[_0xf572('0x2e')],function(_0x19c662){var _0x46b194={};_0x46b194[_0x19c662]={'$like':'%'+_0x5448ac[_0xf572('0x24')][_0xf572('0x43')]+'%'};return _0x46b194;})});}_0x3804cc=_[_0xf572('0x2f')]({},_0x3804cc,_0x5448ac[_0xf572('0x30')]);return db[_0xf572('0x3e')]['findAll'](_0x3804cc);}})['then'](function(_0x442e0a){if(_0x442e0a){return db[_0xf572('0x44')]['findAndCountAll']({'where':{'id':_[_0xf572('0x1d')](_0x442e0a,_0xf572('0x45')),'role':_0xf572('0x46')},'attributes':['id','name',_0xf572('0x47'),_0xf572('0x48'),_0xf572('0x49')]});}})[_0xf572('0x14')](function(_0x1df082){if(_0x1df082){return{'count':_0x1df082[_0xf572('0x10')],'rows':_[_0xf572('0x1d')](_0x1df082['rows'],function(_0x2edc5f){return{'membername':_0x2edc5f[_0xf572('0x1a')],'UserId':_0x2edc5f['id'],'queue_name':_0x53c14f[_0xf572('0x1a')],'MailQueueId':_0x53c14f['id'],'interface':util[_0xf572('0x4a')](_0xf572('0x4b'),_0xf572('0x4c'),_0x2edc5f['name']),'penalty':0x0,'paused':_0x2edc5f[_0xf572('0x47')],'createdAt':_0x2edc5f[_0xf572('0x49')],'updatedAt':_0x2edc5f[_0xf572('0x48')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf572('0x14')](respondWithFilteredResult(_0x5c509d,_0x3804cc))['catch'](handleError(_0x5c509d,null));};exports['getTeams']=function(_0x19bce4,_0x30ee87){var _0xe31885={};var _0x424ec7={};var _0x21df03;var _0x39b5eb;return db['MailQueue'][_0xf572('0x3d')]({'where':{'id':_0x19bce4['params']['id']}})[_0xf572('0x14')](handleEntityNotFound(_0x30ee87,null))[_0xf572('0x14')](function(_0x150023){if(_0x150023){_0x21df03=_0x150023;_0x424ec7[_0xf572('0x29')]=_[_0xf572('0x2a')](db[_0xf572('0x4d')][_0xf572('0x2b')]);_0x424ec7[_0xf572('0x24')]=_['keys'](_0x19bce4[_0xf572('0x24')]);_0x424ec7[_0xf572('0x4e')]=_[_0xf572('0x2c')](_0x424ec7['model'],_0x424ec7[_0xf572('0x24')]);_0xe31885[_0xf572('0x2e')]=_[_0xf572('0x2c')](_0x424ec7['model'],qs[_0xf572('0x2d')](_0x19bce4[_0xf572('0x24')][_0xf572('0x2d')]));_0xe31885[_0xf572('0x2e')]=_0xe31885[_0xf572('0x2e')][_0xf572('0x4f')]?_0xe31885[_0xf572('0x2e')]:_0x424ec7['model'];_0xe31885[_0xf572('0x40')]=qs[_0xf572('0x41')](_0x19bce4['query'][_0xf572('0x41')]);_0xe31885[_0xf572('0x22')]=qs[_0xf572('0x4e')](_[_0xf572('0x50')](_0x19bce4[_0xf572('0x24')],_0x424ec7[_0xf572('0x4e')]));if(_0x19bce4[_0xf572('0x24')][_0xf572('0x43')]){_0xe31885[_0xf572('0x22')]=_[_0xf572('0x2f')](_0xe31885[_0xf572('0x22')],{'$or':_[_0xf572('0x1d')](_0xe31885[_0xf572('0x2e')],function(_0x24d3f4){var _0x3ed664={};_0x3ed664[_0x24d3f4]={'$like':'%'+_0x19bce4[_0xf572('0x24')]['filter']+'%'};return _0x3ed664;})});}_0xe31885=_['merge']({},_0xe31885,_0x19bce4['options']);return _0x21df03[_0xf572('0x51')](_0xe31885);}})[_0xf572('0x14')](function(_0x52d682){if(_0x52d682){_0x39b5eb=_0x52d682['length'];if(!_0x19bce4[_0xf572('0x24')][_0xf572('0x3f')](_0xf572('0x52'))){_0xe31885[_0xf572('0xf')]=qs[_0xf572('0xf')](_0x19bce4[_0xf572('0x24')][_0xf572('0xf')]);_0xe31885[_0xf572('0x11')]=qs[_0xf572('0x11')](_0x19bce4[_0xf572('0x24')]['offset']);}return _0x21df03[_0xf572('0x51')](_0xe31885);}})['then'](function(_0x407f21){if(_0x407f21){return _0x407f21?{'count':_0x39b5eb,'rows':_0x407f21}:null;}})['then'](respondWithResult(_0x30ee87,null))[_0xf572('0x26')](handleError(_0x30ee87,null));};exports[_0xf572('0x53')]=function(_0x1a0894,_0x27c0d8){var _0x1ed3fb=_0x1a0894[_0xf572('0x32')][_0xf572('0x54')];return db[_0xf572('0x4d')]['findAll']({'where':{'id':_0x1ed3fb},'attributes':['id'],'include':[{'model':db[_0xf572('0x44')],'as':'Agents','attributes':['id',_0xf572('0x1a'),'online','voicePause','interface'],'raw':!![]}]})['then'](function(_0x46ad14){if(_0x46ad14){var _0x4fd368=_[_0xf572('0x55')](_0x46ad14,function(_0x501d29){var _0x36a345=_0x501d29['get']({'plain':!![]});return _0x36a345['Agents'];});return db[_0xf572('0x1e')][_0xf572('0x37')]({'where':{'id':_0x1a0894[_0xf572('0x28')]['id']}})[_0xf572('0x14')](function(_0x43b9a9){return db['sequelize'][_0xf572('0x56')](function(_0x5486fc){return _0x43b9a9[_0xf572('0x53')](_0x1ed3fb,{'transaction':_0x5486fc})['then'](function(){return BPromise[_0xf572('0x57')](_0x4fd368,function(_0x4d3979){return db[_0xf572('0x3e')]['findOrCreate']({'where':{'UserId':_0x4d3979['id'],'MailQueueId':_0x1a0894[_0xf572('0x28')]['id']},'transaction':_0x5486fc});});})[_0xf572('0x14')](function(){_0x4fd368[_0xf572('0x58')](function(_0x4edb09){socket[_0xf572('0x59')](_0xf572('0x5a'),{'UserId':_0x4edb09['id'],'MailQueueId':_0x43b9a9['id']});});});});});}})[_0xf572('0x14')](respondWithStatusCode(_0x27c0d8,null))['catch'](handleError(_0x27c0d8,null));};exports[_0xf572('0x5b')]=function(_0x388dc2,_0x8413ae){return db[_0xf572('0x4d')]['findAll']({'where':{'id':_0x388dc2['query'][_0xf572('0x54')]},'attributes':['id'],'include':[{'model':db[_0xf572('0x44')],'as':_0xf572('0x5c'),'attributes':['id'],'raw':!![]}]})[_0xf572('0x14')](handleEntityNotFound(_0x8413ae,null))[_0xf572('0x14')](function(_0x549cbd){var _0x5ce187=_[_0xf572('0x1d')](_0x549cbd,'id');var _0x43314b=[];var _0x1cbee5=[];var _0x40a31c=squel['select']();_0x40a31c[_0xf572('0x5d')]('tq.TeamId')[_0xf572('0x5e')](_0xf572('0x5f'),'tq')[_0xf572('0x60')](_0xf572('0x61'),'ut',_0xf572('0x62'))['where']('MailQueueId\x20=\x20?',_0x388dc2[_0xf572('0x28')]['id']);for(var _0x2a2b2c=0x0;_0x2a2b2c<_0x549cbd[_0xf572('0x4f')];_0x2a2b2c+=0x1){let _0x307192=_0x549cbd[_0x2a2b2c];for(var _0x1818ae=0x0;_0x1818ae<_0x307192['Agents'][_0xf572('0x4f')];_0x1818ae+=0x1){let _0x265bab=_0x307192[_0xf572('0x5c')][_0x1818ae];var _0x4509c5=_0x40a31c['clone']();_0x4509c5[_0xf572('0x22')](_0xf572('0x63'),_0x265bab['id']);_0x1cbee5[_0xf572('0x64')](db[_0xf572('0x65')][_0xf572('0x24')](_0x4509c5[_0xf572('0x66')](),{'type':db[_0xf572('0x65')][_0xf572('0x67')][_0xf572('0x68')]})[_0xf572('0x14')](function(_0xf4ebbd){if(_0xf4ebbd['length']===0x1){return _0x265bab['id'];}else{var _0x4403d=_[_0xf572('0x69')](_[_0xf572('0x1d')](_0xf4ebbd,_0xf572('0x6a')),function(_0x5e6b0d){return _['includes'](_0x5ce187,_0x5e6b0d);});if(_0x4403d){return _0x265bab['id'];}}}));}}return BPromise[_0xf572('0x6b')](_0x1cbee5)[_0xf572('0x14')](function(_0x2795cb){_0x43314b=_(_0x43314b)[_0xf572('0x6c')](_0x2795cb)[_0xf572('0x6d')]()[_0xf572('0x6e')]();return db[_0xf572('0x1e')]['find']({'where':{'id':_0x388dc2[_0xf572('0x28')]['id']}})['then'](function(_0x28506a){return db[_0xf572('0x65')][_0xf572('0x56')](function(_0x4ef879){return _0x28506a[_0xf572('0x5b')](_0x388dc2[_0xf572('0x24')][_0xf572('0x54')],{'transaction':_0x4ef879})[_0xf572('0x14')](function(){if(!_[_0xf572('0x6f')](_0x43314b)){return _0x28506a[_0xf572('0x70')](_0x43314b,{'transaction':_0x4ef879});}})[_0xf572('0x14')](function(){_0x43314b[_0xf572('0x58')](function(_0x153bc8){socket[_0xf572('0x59')](_0xf572('0x71'),{'UserId':_0x153bc8,'MailQueueId':_0x28506a['id']});});});});});});})[_0xf572('0x14')](respondWithStatusCode(_0x8413ae,null))['catch'](handleError(_0x8413ae,null));};exports['addAgents']=function(_0xefb733,_0x5908a8){return db[_0xf572('0x1e')][_0xf572('0x37')]({'where':{'id':_0xefb733[_0xf572('0x28')]['id']}})[_0xf572('0x14')](handleEntityNotFound(_0x5908a8,null))['then'](function(_0x3e471a){if(_0x3e471a){return _0x3e471a['addAgents'](_0xefb733[_0xf572('0x32')][_0xf572('0x54')],_[_0xf572('0x72')](_0xefb733['body'],['ids','id'])||{})[_0xf572('0x73')](function(_0x15e7da){for(var _0xbf09c5=0x0;_0xbf09c5<_0xefb733['body']['ids'][_0xf572('0x4f')];_0xbf09c5+=0x1){socket[_0xf572('0x59')](_0xf572('0x5a'),{'UserId':Number(_0xefb733[_0xf572('0x32')][_0xf572('0x54')][_0xbf09c5]),'MailQueueId':Number(_0xefb733[_0xf572('0x28')]['id'])});}return _0x15e7da;});}})[_0xf572('0x14')](respondWithResult(_0x5908a8,null))['catch'](handleError(_0x5908a8,null));};exports[_0xf572('0x70')]=function(_0x3c4b0f,_0x54039b){return db[_0xf572('0x1e')][_0xf572('0x37')]({'where':{'id':_0x3c4b0f[_0xf572('0x28')]['id']}})[_0xf572('0x14')](handleEntityNotFound(_0x54039b,null))[_0xf572('0x14')](function(_0x179d57){if(_0x179d57){return _0x179d57[_0xf572('0x70')](_0x3c4b0f[_0xf572('0x24')][_0xf572('0x54')])[_0xf572('0x14')](function(){if(_['isArray'](_0x3c4b0f[_0xf572('0x24')][_0xf572('0x54')])){for(var _0x36d514=0x0;_0x36d514<_0x3c4b0f['query'][_0xf572('0x54')][_0xf572('0x4f')];_0x36d514+=0x1){socket[_0xf572('0x59')](_0xf572('0x71'),{'UserId':Number(_0x3c4b0f['query'][_0xf572('0x54')][_0x36d514]),'MailQueueId':Number(_0x3c4b0f['params']['id'])});}}else{socket[_0xf572('0x59')](_0xf572('0x71'),{'UserId':Number(_0x3c4b0f[_0xf572('0x24')]['ids']),'MailQueueId':Number(_0x3c4b0f[_0xf572('0x28')]['id'])});}});}})[_0xf572('0x14')](respondWithStatusCode(_0x54039b,null))[_0xf572('0x26')](handleError(_0x54039b,null));};exports[_0xf572('0x74')]=function(_0x416e61,_0x53d2aa){var _0x2ee4be={};var _0x37e758={};var _0x54ab06;var _0x5e4dc6;return db[_0xf572('0x1e')][_0xf572('0x3d')]({'where':{'id':_0x416e61[_0xf572('0x28')]['id']}})[_0xf572('0x14')](handleEntityNotFound(_0x53d2aa,null))[_0xf572('0x14')](function(_0x1c804f){if(_0x1c804f){_0x54ab06=_0x1c804f;_0x37e758[_0xf572('0x29')]=_[_0xf572('0x2a')](db[_0xf572('0x44')]['rawAttributes']);_0x37e758[_0xf572('0x24')]=_[_0xf572('0x2a')](_0x416e61[_0xf572('0x24')]);_0x37e758['filters']=_[_0xf572('0x2c')](_0x37e758[_0xf572('0x29')],_0x37e758[_0xf572('0x24')]);_0x2ee4be['attributes']=_[_0xf572('0x2c')](_0x37e758[_0xf572('0x29')],qs[_0xf572('0x2d')](_0x416e61[_0xf572('0x24')][_0xf572('0x2d')]));_0x2ee4be['attributes']=_0x2ee4be[_0xf572('0x2e')][_0xf572('0x4f')]?_0x2ee4be['attributes']:_0x37e758[_0xf572('0x29')];_0x2ee4be['order']=qs[_0xf572('0x41')](_0x416e61[_0xf572('0x24')]['sort']);_0x2ee4be[_0xf572('0x22')]=qs[_0xf572('0x4e')](_[_0xf572('0x50')](_0x416e61[_0xf572('0x24')],_0x37e758[_0xf572('0x4e')]));if(_0x416e61[_0xf572('0x24')][_0xf572('0x43')]){_0x2ee4be['where']=_['merge'](_0x2ee4be['where'],{'$or':_[_0xf572('0x1d')](_0x2ee4be[_0xf572('0x2e')],function(_0x6d2cbf){var _0x3ef134={};_0x3ef134[_0x6d2cbf]={'$like':'%'+_0x416e61[_0xf572('0x24')][_0xf572('0x43')]+'%'};return _0x3ef134;})});}_0x2ee4be=_[_0xf572('0x2f')]({},_0x2ee4be,_0x416e61[_0xf572('0x30')]);return _0x54ab06[_0xf572('0x74')](_0x2ee4be);}})[_0xf572('0x14')](function(_0x43ba5a){if(_0x43ba5a){_0x5e4dc6=_0x43ba5a[_0xf572('0x4f')];if(!_0x416e61['query'][_0xf572('0x3f')](_0xf572('0x52'))){_0x2ee4be['limit']=qs['limit'](_0x416e61[_0xf572('0x24')][_0xf572('0xf')]);_0x2ee4be[_0xf572('0x11')]=qs[_0xf572('0x11')](_0x416e61[_0xf572('0x24')]['offset']);}return _0x54ab06[_0xf572('0x74')](_0x2ee4be);}})[_0xf572('0x14')](function(_0x3ce970){if(_0x3ce970){return _0x3ce970?{'count':_0x5e4dc6,'rows':_0x3ce970}:null;}})[_0xf572('0x14')](respondWithResult(_0x53d2aa,null))[_0xf572('0x26')](handleError(_0x53d2aa,null));}; \ No newline at end of file +var _0x0044=['api','../../config/environment','redis','defaults','socket.io-emitter','./mailQueue.socket','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','MailQueue','rawAttributes','key','where','findAll','rows','show','params','model','keys','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','catch','update','describe','findOne','UserMailQueue','hasOwnProperty','sort','pick','MailQueueId','filter','User','findAndCountAll','UserId','createdAt','%s/%s','mailPause','updatedAt','getTeams','Team','order','nolimit','ids','Agents','interface','sequelize','transaction','addTeams','each','findOrCreate','forEach','select','tq.TeamId','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','removeTeams','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','omit','userMailQueue:save','isArray','getAgents','bluebird','util','lodash','ioredis','../../components/parsers/qs'];(function(_0x10bba8,_0x1b5f3e){var _0x2d4615=function(_0x3a1607){while(--_0x3a1607){_0x10bba8['push'](_0x10bba8['shift']());}};_0x2d4615(++_0x1b5f3e);}(_0x0044,0xdd));var _0x4004=function(_0x5b5cde,_0x1f7c5f){_0x5b5cde=_0x5b5cde-0x0;var _0x364ad2=_0x0044[_0x5b5cde];return _0x364ad2;};'use strict';var BPromise=require(_0x4004('0x0'));var util=require(_0x4004('0x1'));var _=require(_0x4004('0x2'));var squel=require('squel');var Redis=require(_0x4004('0x3'));var qs=require(_0x4004('0x4'));var logger=require('../../config/logger')(_0x4004('0x5'));var config=require(_0x4004('0x6'));var db=require('../../mysqldb')['db'];config[_0x4004('0x7')]=_[_0x4004('0x8')](config[_0x4004('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x4004('0x9'))(new Redis(config['redis']));require(_0x4004('0xa'))['register'](socket);function respondWithStatusCode(_0x354349,_0x4468a0){_0x4468a0=_0x4468a0||0xcc;return function(_0x5aacfe){if(_0x5aacfe){return _0x354349[_0x4004('0xb')](_0x4468a0);}return _0x354349['status'](_0x4468a0)[_0x4004('0xc')]();};}function respondWithResult(_0x56721b,_0x2eb3c7){_0x2eb3c7=_0x2eb3c7||0xc8;return function(_0x37f18b){if(_0x37f18b){return _0x56721b[_0x4004('0xd')](_0x2eb3c7)[_0x4004('0xe')](_0x37f18b);}};}function respondWithFilteredResult(_0x1b84e2,_0x224b47){return function(_0x4b1173){if(_0x4b1173){var _0x55f392=typeof _0x224b47[_0x4004('0xf')]===_0x4004('0x10')&&typeof _0x224b47[_0x4004('0x11')]===_0x4004('0x10');var _0x2c7225=_0x4b1173[_0x4004('0x12')];var _0x16fefd=_0x55f392?0x0:_0x224b47[_0x4004('0xf')];var _0xa9b8eb=_0x55f392?_0x4b1173[_0x4004('0x12')]:_0x224b47[_0x4004('0xf')]+_0x224b47['limit'];var _0x249b69;if(_0xa9b8eb>=_0x2c7225){_0xa9b8eb=_0x2c7225;_0x249b69=0xc8;}else{_0x249b69=0xce;}_0x1b84e2[_0x4004('0xd')](_0x249b69);return _0x1b84e2['set'](_0x4004('0x13'),_0x16fefd+'-'+_0xa9b8eb+'/'+_0x2c7225)[_0x4004('0xe')](_0x4b1173);}return null;};}function saveUpdates(_0x42d536){return function(_0x355c34){if(_0x355c34){return _0x355c34['update'](_0x42d536)[_0x4004('0x14')](function(_0x1c0836){return _0x1c0836;});}return null;};}function removeEntity(_0xdfadc1){return function(_0x403019){if(_0x403019){return _0x403019[_0x4004('0x15')]()[_0x4004('0x14')](function(){var _0x1765b8=_0x403019[_0x4004('0x16')]({'plain':!![]});var _0x54a220='MailQueues';return db[_0x4004('0x17')][_0x4004('0x15')]({'where':{'type':_0x54a220,'resourceId':_0x1765b8['id']}})[_0x4004('0x14')](function(){return _0x403019;});})[_0x4004('0x14')](function(){_0xdfadc1[_0x4004('0xd')](0xcc)[_0x4004('0xc')]();});}};}function handleEntityNotFound(_0x5be77d){return function(_0x2960bc){if(!_0x2960bc){_0x5be77d[_0x4004('0xb')](0x194);}return _0x2960bc;};}function handleError(_0x393ea8,_0x2cdae6){_0x2cdae6=_0x2cdae6||0x1f4;return function(_0x46709a){logger[_0x4004('0x18')](_0x46709a[_0x4004('0x19')]);if(_0x46709a[_0x4004('0x1a')]){delete _0x46709a['name'];}_0x393ea8[_0x4004('0xd')](_0x2cdae6)[_0x4004('0x1b')](_0x46709a);};}exports[_0x4004('0x1c')]=function(_0x44dad3,_0x364e2e){var _0x3a19d2={};var _0xab330a={'count':0x0,'rows':[]};var _0x3f1374=_[_0x4004('0x1d')](db[_0x4004('0x1e')][_0x4004('0x1f')],function(_0x409093){return{'name':_0x409093['fieldName'],'type':_0x409093['type'][_0x4004('0x20')]};});_0x3a19d2=qs['getOptions'](_0x3f1374,_0x44dad3);var _0x1fc410={'where':_0x3a19d2[_0x4004('0x21')]};return db[_0x4004('0x1e')]['count'](_0x1fc410)[_0x4004('0x14')](function(_0x3c5582){_0xab330a[_0x4004('0x12')]=_0x3c5582;_0x3a19d2['include']=qs['include'](_0x44dad3['query']);return db['MailQueue'][_0x4004('0x22')](_0x3a19d2);})['then'](function(_0x4b6556){_0xab330a[_0x4004('0x23')]=_0x4b6556;return _0xab330a;})[_0x4004('0x14')](respondWithFilteredResult(_0x364e2e,_0x3a19d2))['catch'](handleError(_0x364e2e,null));};exports[_0x4004('0x24')]=function(_0x4b588f,_0xd75071){var _0x2eae73={'raw':!![],'where':{'id':_0x4b588f[_0x4004('0x25')]['id']}},_0x1c5da8={};_0x1c5da8[_0x4004('0x26')]=_[_0x4004('0x27')](db[_0x4004('0x1e')][_0x4004('0x1f')]);_0x1c5da8[_0x4004('0x28')]=_['keys'](_0x4b588f[_0x4004('0x28')]);_0x1c5da8[_0x4004('0x29')]=_[_0x4004('0x2a')](_0x1c5da8['model'],_0x1c5da8[_0x4004('0x28')]);_0x2eae73['attributes']=_['intersection'](_0x1c5da8[_0x4004('0x26')],qs[_0x4004('0x2b')](_0x4b588f[_0x4004('0x28')][_0x4004('0x2b')]));_0x2eae73['attributes']=_0x2eae73[_0x4004('0x2c')][_0x4004('0x2d')]?_0x2eae73['attributes']:_0x1c5da8[_0x4004('0x26')];if(_0x4b588f[_0x4004('0x28')][_0x4004('0x2e')]){_0x2eae73[_0x4004('0x2f')]=[{'all':!![]}];}_0x2eae73=_[_0x4004('0x30')]({},_0x2eae73,_0x4b588f[_0x4004('0x31')]);return db['MailQueue'][_0x4004('0x32')](_0x2eae73)[_0x4004('0x14')](handleEntityNotFound(_0xd75071,null))[_0x4004('0x14')](respondWithResult(_0xd75071,null))['catch'](handleError(_0xd75071,null));};exports[_0x4004('0x33')]=function(_0x4ecef5,_0x1c7a8a){return db['MailQueue']['create'](_0x4ecef5[_0x4004('0x34')],{})[_0x4004('0x14')](function(_0x4a5426){var _0xccc4c9=_0x4ecef5[_0x4004('0x35')]['get']({'plain':!![]});if(!_0xccc4c9)throw new Error(_0x4004('0x36'));if(_0xccc4c9['role']===_0x4004('0x35')){var _0x327158=_0x4a5426['get']({'plain':!![]});var _0x1682ca='MailQueues';return db[_0x4004('0x37')]['find']({'where':{'name':_0x1682ca,'userProfileId':_0xccc4c9['userProfileId']},'raw':!![]})['then'](function(_0x4c0ea7){if(_0x4c0ea7&&_0x4c0ea7['autoAssociation']===0x0){return db[_0x4004('0x17')]['create']({'name':_0x327158[_0x4004('0x1a')],'resourceId':_0x327158['id'],'type':_0x4c0ea7[_0x4004('0x1a')],'sectionId':_0x4c0ea7['id']},{})[_0x4004('0x14')](function(){return _0x4a5426;});}else{return _0x4a5426;}})[_0x4004('0x38')](function(_0x285947){logger[_0x4004('0x18')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x285947);throw _0x285947;});}return _0x4a5426;})[_0x4004('0x14')](respondWithResult(_0x1c7a8a,0xc9))[_0x4004('0x38')](handleError(_0x1c7a8a,null));};exports[_0x4004('0x39')]=function(_0x3bb940,_0x58fe14){if(_0x3bb940[_0x4004('0x34')]['id']){delete _0x3bb940[_0x4004('0x34')]['id'];}return db[_0x4004('0x1e')][_0x4004('0x32')]({'where':{'id':_0x3bb940['params']['id']}})[_0x4004('0x14')](handleEntityNotFound(_0x58fe14,null))[_0x4004('0x14')](saveUpdates(_0x3bb940['body'],null))[_0x4004('0x14')](respondWithResult(_0x58fe14,null))['catch'](handleError(_0x58fe14,null));};exports['destroy']=function(_0x269c0e,_0x367852){return db['MailQueue'][_0x4004('0x32')]({'where':{'id':_0x269c0e[_0x4004('0x25')]['id']}})['then'](handleEntityNotFound(_0x367852,null))[_0x4004('0x14')](removeEntity(_0x367852,null))['catch'](handleError(_0x367852,null));};exports['describe']=function(_0x3ffd4e,_0x3361df){return db[_0x4004('0x1e')][_0x4004('0x3a')]()[_0x4004('0x14')](respondWithResult(_0x3361df,null))[_0x4004('0x38')](handleError(_0x3361df,null));};exports['getMembers']=function(_0x2fb19b,_0x298519){var _0x5f53b9={'raw':!![],'where':{}},_0xa7bc64={},_0x15951d;return db[_0x4004('0x1e')][_0x4004('0x3b')]({'where':{'id':_0x2fb19b['params']['id']}})['then'](handleEntityNotFound(_0x298519,null))[_0x4004('0x14')](function(_0x1a651f){if(_0x1a651f){_0x15951d=_0x1a651f[_0x4004('0x16')]({'plain':!![]});_0xa7bc64['model']=_['keys'](db[_0x4004('0x3c')][_0x4004('0x1f')]);_0xa7bc64[_0x4004('0x28')]=_[_0x4004('0x27')](_0x2fb19b['query']);_0xa7bc64[_0x4004('0x29')]=_[_0x4004('0x2a')](_0xa7bc64[_0x4004('0x26')],_0xa7bc64['query']);_0x5f53b9[_0x4004('0x2c')]=_['intersection'](_0xa7bc64[_0x4004('0x26')],qs[_0x4004('0x2b')](_0x2fb19b['query'][_0x4004('0x2b')]));_0x5f53b9[_0x4004('0x2c')]=_0x5f53b9[_0x4004('0x2c')][_0x4004('0x2d')]?_0x5f53b9['attributes']:_0xa7bc64[_0x4004('0x26')];if(!_0x2fb19b['query'][_0x4004('0x3d')]('nolimit')){_0x5f53b9[_0x4004('0x11')]=qs[_0x4004('0x11')](_0x2fb19b['query'][_0x4004('0x11')]);_0x5f53b9['offset']=qs[_0x4004('0xf')](_0x2fb19b['query'][_0x4004('0xf')]);}_0x5f53b9['order']=qs[_0x4004('0x3e')](_0x2fb19b[_0x4004('0x28')]['sort']);_0x5f53b9['where']=qs['filters'](_[_0x4004('0x3f')](_0x2fb19b[_0x4004('0x28')],_0xa7bc64[_0x4004('0x29')]));_0x5f53b9[_0x4004('0x21')][_0x4004('0x40')]=_0x1a651f['id'];if(_0x2fb19b['query']['filter']){_0x5f53b9['where']=_['merge'](_0x5f53b9[_0x4004('0x21')],{'$or':_[_0x4004('0x1d')](_0x5f53b9[_0x4004('0x2c')],function(_0x1c0f29){var _0x15f8c9={};_0x15f8c9[_0x1c0f29]={'$like':'%'+_0x2fb19b['query'][_0x4004('0x41')]+'%'};return _0x15f8c9;})});}_0x5f53b9=_[_0x4004('0x30')]({},_0x5f53b9,_0x2fb19b[_0x4004('0x31')]);return db['UserMailQueue'][_0x4004('0x22')](_0x5f53b9);}})[_0x4004('0x14')](function(_0x2b4b6f){if(_0x2b4b6f){return db[_0x4004('0x42')][_0x4004('0x43')]({'where':{'id':_[_0x4004('0x1d')](_0x2b4b6f,_0x4004('0x44')),'role':'agent'},'attributes':['id',_0x4004('0x1a'),'mailPause','updatedAt',_0x4004('0x45')]});}})[_0x4004('0x14')](function(_0x1cb516){if(_0x1cb516){return{'count':_0x1cb516[_0x4004('0x12')],'rows':_[_0x4004('0x1d')](_0x1cb516[_0x4004('0x23')],function(_0xaaccf9){return{'membername':_0xaaccf9[_0x4004('0x1a')],'UserId':_0xaaccf9['id'],'queue_name':_0x15951d['name'],'MailQueueId':_0x15951d['id'],'interface':util['format'](_0x4004('0x46'),'SIP',_0xaaccf9[_0x4004('0x1a')]),'penalty':0x0,'paused':_0xaaccf9[_0x4004('0x47')],'createdAt':_0xaaccf9[_0x4004('0x45')],'updatedAt':_0xaaccf9[_0x4004('0x48')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4004('0x14')](respondWithFilteredResult(_0x298519,_0x5f53b9))[_0x4004('0x38')](handleError(_0x298519,null));};exports[_0x4004('0x49')]=function(_0xe7d3ee,_0x31df24){var _0x56b2cd={};var _0x189080={};var _0x28f4f0;var _0x2303d9;return db[_0x4004('0x1e')][_0x4004('0x3b')]({'where':{'id':_0xe7d3ee[_0x4004('0x25')]['id']}})[_0x4004('0x14')](handleEntityNotFound(_0x31df24,null))['then'](function(_0x56d68){if(_0x56d68){_0x28f4f0=_0x56d68;_0x189080[_0x4004('0x26')]=_['keys'](db[_0x4004('0x4a')]['rawAttributes']);_0x189080['query']=_['keys'](_0xe7d3ee[_0x4004('0x28')]);_0x189080[_0x4004('0x29')]=_[_0x4004('0x2a')](_0x189080['model'],_0x189080[_0x4004('0x28')]);_0x56b2cd[_0x4004('0x2c')]=_[_0x4004('0x2a')](_0x189080[_0x4004('0x26')],qs['fields'](_0xe7d3ee[_0x4004('0x28')][_0x4004('0x2b')]));_0x56b2cd[_0x4004('0x2c')]=_0x56b2cd[_0x4004('0x2c')][_0x4004('0x2d')]?_0x56b2cd[_0x4004('0x2c')]:_0x189080[_0x4004('0x26')];_0x56b2cd[_0x4004('0x4b')]=qs[_0x4004('0x3e')](_0xe7d3ee[_0x4004('0x28')]['sort']);_0x56b2cd[_0x4004('0x21')]=qs[_0x4004('0x29')](_[_0x4004('0x3f')](_0xe7d3ee[_0x4004('0x28')],_0x189080['filters']));if(_0xe7d3ee['query'][_0x4004('0x41')]){_0x56b2cd[_0x4004('0x21')]=_[_0x4004('0x30')](_0x56b2cd[_0x4004('0x21')],{'$or':_[_0x4004('0x1d')](_0x56b2cd[_0x4004('0x2c')],function(_0x47026e){var _0x519fd6={};_0x519fd6[_0x47026e]={'$like':'%'+_0xe7d3ee[_0x4004('0x28')]['filter']+'%'};return _0x519fd6;})});}_0x56b2cd=_[_0x4004('0x30')]({},_0x56b2cd,_0xe7d3ee[_0x4004('0x31')]);return _0x28f4f0[_0x4004('0x49')](_0x56b2cd);}})[_0x4004('0x14')](function(_0x120385){if(_0x120385){_0x2303d9=_0x120385[_0x4004('0x2d')];if(!_0xe7d3ee[_0x4004('0x28')]['hasOwnProperty'](_0x4004('0x4c'))){_0x56b2cd[_0x4004('0x11')]=qs[_0x4004('0x11')](_0xe7d3ee[_0x4004('0x28')]['limit']);_0x56b2cd[_0x4004('0xf')]=qs[_0x4004('0xf')](_0xe7d3ee['query'][_0x4004('0xf')]);}return _0x28f4f0[_0x4004('0x49')](_0x56b2cd);}})[_0x4004('0x14')](function(_0x1c5a49){if(_0x1c5a49){return _0x1c5a49?{'count':_0x2303d9,'rows':_0x1c5a49}:null;}})[_0x4004('0x14')](respondWithResult(_0x31df24,null))[_0x4004('0x38')](handleError(_0x31df24,null));};exports['addTeams']=function(_0x64c6dd,_0x2935f0){var _0x22067e=_0x64c6dd[_0x4004('0x34')][_0x4004('0x4d')];return db[_0x4004('0x4a')][_0x4004('0x22')]({'where':{'id':_0x22067e},'attributes':['id'],'include':[{'model':db[_0x4004('0x42')],'as':_0x4004('0x4e'),'attributes':['id',_0x4004('0x1a'),'online','voicePause',_0x4004('0x4f')],'raw':!![]}]})[_0x4004('0x14')](function(_0x2c7d74){if(_0x2c7d74){var _0xb9fad4=_['flatMap'](_0x2c7d74,function(_0x28d2e7){var _0xf79c8a=_0x28d2e7[_0x4004('0x16')]({'plain':!![]});return _0xf79c8a[_0x4004('0x4e')];});return db[_0x4004('0x1e')][_0x4004('0x32')]({'where':{'id':_0x64c6dd[_0x4004('0x25')]['id']}})[_0x4004('0x14')](function(_0x9dc320){return db[_0x4004('0x50')][_0x4004('0x51')](function(_0x40ad1a){return _0x9dc320[_0x4004('0x52')](_0x22067e,{'transaction':_0x40ad1a})['then'](function(){return BPromise[_0x4004('0x53')](_0xb9fad4,function(_0x48470e){return db[_0x4004('0x3c')][_0x4004('0x54')]({'where':{'UserId':_0x48470e['id'],'MailQueueId':_0x64c6dd['params']['id']},'transaction':_0x40ad1a});});})[_0x4004('0x14')](function(){_0xb9fad4[_0x4004('0x55')](function(_0x72e19){socket['emit']('userMailQueue:save',{'UserId':_0x72e19['id'],'MailQueueId':_0x9dc320['id']});});});});});}})[_0x4004('0x14')](respondWithStatusCode(_0x2935f0,null))[_0x4004('0x38')](handleError(_0x2935f0,null));};exports['removeTeams']=function(_0xa37fed,_0x15c7f2){return db['Team'][_0x4004('0x22')]({'where':{'id':_0xa37fed[_0x4004('0x28')][_0x4004('0x4d')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4004('0x4e'),'attributes':['id'],'raw':!![]}]})[_0x4004('0x14')](handleEntityNotFound(_0x15c7f2,null))['then'](function(_0x4dfce3){var _0x32e9e1=_['map'](_0x4dfce3,'id');var _0x32d59e=[];var _0x208769=[];var _0x55cd8e=squel[_0x4004('0x56')]();_0x55cd8e['field'](_0x4004('0x57'))['from'](_0x4004('0x58'),'tq')[_0x4004('0x59')](_0x4004('0x5a'),'ut',_0x4004('0x5b'))[_0x4004('0x21')]('MailQueueId\x20=\x20?',_0xa37fed[_0x4004('0x25')]['id']);for(var _0x1993ed=0x0;_0x1993ed<_0x4dfce3[_0x4004('0x2d')];_0x1993ed+=0x1){let _0x4a8b2c=_0x4dfce3[_0x1993ed];for(var _0x4f92bd=0x0;_0x4f92bd<_0x4a8b2c[_0x4004('0x4e')][_0x4004('0x2d')];_0x4f92bd+=0x1){let _0x13b0f3=_0x4a8b2c[_0x4004('0x4e')][_0x4f92bd];var _0x4310d3=_0x55cd8e[_0x4004('0x5c')]();_0x4310d3[_0x4004('0x21')](_0x4004('0x5d'),_0x13b0f3['id']);_0x208769['push'](db[_0x4004('0x50')][_0x4004('0x28')](_0x4310d3[_0x4004('0x5e')](),{'type':db[_0x4004('0x50')][_0x4004('0x5f')][_0x4004('0x60')]})[_0x4004('0x14')](function(_0x51bea0){if(_0x51bea0[_0x4004('0x2d')]===0x1){return _0x13b0f3['id'];}else{var _0x12fe3b=_[_0x4004('0x61')](_['map'](_0x51bea0,'TeamId'),function(_0x1bcee1){return _[_0x4004('0x62')](_0x32e9e1,_0x1bcee1);});if(_0x12fe3b){return _0x13b0f3['id'];}}}));}}return BPromise[_0x4004('0x63')](_0x208769)[_0x4004('0x14')](function(_0x41a74f){_0x32d59e=_(_0x32d59e)[_0x4004('0x64')](_0x41a74f)[_0x4004('0x65')]()[_0x4004('0x66')]();return db[_0x4004('0x1e')]['find']({'where':{'id':_0xa37fed[_0x4004('0x25')]['id']}})[_0x4004('0x14')](function(_0x32caad){return db[_0x4004('0x50')]['transaction'](function(_0x58e79f){return _0x32caad[_0x4004('0x67')](_0xa37fed[_0x4004('0x28')][_0x4004('0x4d')],{'transaction':_0x58e79f})[_0x4004('0x14')](function(){if(!_[_0x4004('0x68')](_0x32d59e)){return _0x32caad[_0x4004('0x69')](_0x32d59e,{'transaction':_0x58e79f});}})[_0x4004('0x14')](function(){_0x32d59e[_0x4004('0x55')](function(_0x176734){socket[_0x4004('0x6a')](_0x4004('0x6b'),{'UserId':_0x176734,'MailQueueId':_0x32caad['id']});});});});});});})[_0x4004('0x14')](respondWithStatusCode(_0x15c7f2,null))[_0x4004('0x38')](handleError(_0x15c7f2,null));};exports[_0x4004('0x6c')]=function(_0x4710e2,_0x32926f){return db[_0x4004('0x1e')][_0x4004('0x32')]({'where':{'id':_0x4710e2[_0x4004('0x25')]['id']}})[_0x4004('0x14')](handleEntityNotFound(_0x32926f,null))['then'](function(_0x4e3651){if(_0x4e3651){return _0x4e3651[_0x4004('0x6c')](_0x4710e2['body']['ids'],_[_0x4004('0x6d')](_0x4710e2[_0x4004('0x34')],[_0x4004('0x4d'),'id'])||{})['spread'](function(_0x34bdf5){for(var _0x1d5d37=0x0;_0x1d5d37<_0x4710e2[_0x4004('0x34')][_0x4004('0x4d')][_0x4004('0x2d')];_0x1d5d37+=0x1){socket[_0x4004('0x6a')](_0x4004('0x6e'),{'UserId':Number(_0x4710e2[_0x4004('0x34')][_0x4004('0x4d')][_0x1d5d37]),'MailQueueId':Number(_0x4710e2[_0x4004('0x25')]['id'])});}return _0x34bdf5;});}})[_0x4004('0x14')](respondWithResult(_0x32926f,null))[_0x4004('0x38')](handleError(_0x32926f,null));};exports[_0x4004('0x69')]=function(_0x240a29,_0x2e8cc5){return db[_0x4004('0x1e')][_0x4004('0x32')]({'where':{'id':_0x240a29[_0x4004('0x25')]['id']}})[_0x4004('0x14')](handleEntityNotFound(_0x2e8cc5,null))[_0x4004('0x14')](function(_0x5bf8bc){if(_0x5bf8bc){return _0x5bf8bc['removeAgents'](_0x240a29[_0x4004('0x28')][_0x4004('0x4d')])[_0x4004('0x14')](function(){if(_[_0x4004('0x6f')](_0x240a29[_0x4004('0x28')][_0x4004('0x4d')])){for(var _0x496dbe=0x0;_0x496dbe<_0x240a29[_0x4004('0x28')][_0x4004('0x4d')][_0x4004('0x2d')];_0x496dbe+=0x1){socket[_0x4004('0x6a')]('userMailQueue:remove',{'UserId':Number(_0x240a29['query'][_0x4004('0x4d')][_0x496dbe]),'MailQueueId':Number(_0x240a29[_0x4004('0x25')]['id'])});}}else{socket[_0x4004('0x6a')](_0x4004('0x6b'),{'UserId':Number(_0x240a29['query'][_0x4004('0x4d')]),'MailQueueId':Number(_0x240a29['params']['id'])});}});}})[_0x4004('0x14')](respondWithStatusCode(_0x2e8cc5,null))[_0x4004('0x38')](handleError(_0x2e8cc5,null));};exports['getAgents']=function(_0x457e78,_0x586121){var _0x5e2842={};var _0x35beba={};var _0x16d251;var _0x1e6864;return db['MailQueue'][_0x4004('0x3b')]({'where':{'id':_0x457e78[_0x4004('0x25')]['id']}})[_0x4004('0x14')](handleEntityNotFound(_0x586121,null))['then'](function(_0x4d8893){if(_0x4d8893){_0x16d251=_0x4d8893;_0x35beba[_0x4004('0x26')]=_[_0x4004('0x27')](db[_0x4004('0x42')][_0x4004('0x1f')]);_0x35beba[_0x4004('0x28')]=_[_0x4004('0x27')](_0x457e78[_0x4004('0x28')]);_0x35beba[_0x4004('0x29')]=_[_0x4004('0x2a')](_0x35beba['model'],_0x35beba['query']);_0x5e2842['attributes']=_['intersection'](_0x35beba[_0x4004('0x26')],qs['fields'](_0x457e78[_0x4004('0x28')][_0x4004('0x2b')]));_0x5e2842[_0x4004('0x2c')]=_0x5e2842[_0x4004('0x2c')]['length']?_0x5e2842[_0x4004('0x2c')]:_0x35beba[_0x4004('0x26')];_0x5e2842[_0x4004('0x4b')]=qs[_0x4004('0x3e')](_0x457e78[_0x4004('0x28')][_0x4004('0x3e')]);_0x5e2842[_0x4004('0x21')]=qs[_0x4004('0x29')](_[_0x4004('0x3f')](_0x457e78[_0x4004('0x28')],_0x35beba['filters']));if(_0x457e78['query'][_0x4004('0x41')]){_0x5e2842[_0x4004('0x21')]=_[_0x4004('0x30')](_0x5e2842[_0x4004('0x21')],{'$or':_['map'](_0x5e2842[_0x4004('0x2c')],function(_0x350d9a){var _0x3c486f={};_0x3c486f[_0x350d9a]={'$like':'%'+_0x457e78[_0x4004('0x28')]['filter']+'%'};return _0x3c486f;})});}_0x5e2842=_[_0x4004('0x30')]({},_0x5e2842,_0x457e78[_0x4004('0x31')]);return _0x16d251[_0x4004('0x70')](_0x5e2842);}})[_0x4004('0x14')](function(_0x551de7){if(_0x551de7){_0x1e6864=_0x551de7[_0x4004('0x2d')];if(!_0x457e78[_0x4004('0x28')][_0x4004('0x3d')]('nolimit')){_0x5e2842['limit']=qs[_0x4004('0x11')](_0x457e78[_0x4004('0x28')][_0x4004('0x11')]);_0x5e2842[_0x4004('0xf')]=qs[_0x4004('0xf')](_0x457e78[_0x4004('0x28')][_0x4004('0xf')]);}return _0x16d251['getAgents'](_0x5e2842);}})['then'](function(_0x4d4363){if(_0x4d4363){return _0x4d4363?{'count':_0x1e6864,'rows':_0x4d4363}:null;}})['then'](respondWithResult(_0x586121,null))['catch'](handleError(_0x586121,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 7c1b1b7..3d0f392 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 _0x1c5d=['exports','events','../../mysqldb','MailQueue','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x1c5d,0x88));var _0xd1c5=function(_0x116c38,_0x54b3cc){_0x116c38=_0x116c38-0x0;var _0xebfdc3=_0x1c5d[_0x116c38];return _0xebfdc3;};'use strict';var EventEmitter=require(_0xd1c5('0x0'));var MailQueue=require(_0xd1c5('0x1'))['db'][_0xd1c5('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xd1c5('0x3')](0x0);var events={'afterCreate':_0xd1c5('0x4'),'afterUpdate':'update','afterDestroy':_0xd1c5('0x5')};function emitEvent(_0x11ce8d){return function(_0x5652aa,_0x2f01ff,_0x166cd6){MailQueueEvents[_0xd1c5('0x6')](_0x11ce8d+':'+_0x5652aa['id'],_0x5652aa);MailQueueEvents['emit'](_0x11ce8d,_0x5652aa);_0x166cd6(null);};}for(var e in events){if(events[_0xd1c5('0x7')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xd1c5('0x8')]=MailQueueEvents; \ No newline at end of file +var _0x8f66=['hook','exports','MailQueue','setMaxListeners','update','remove','emit'];(function(_0xfb3184,_0x4628ae){var _0x4a1e24=function(_0x386291){while(--_0x386291){_0xfb3184['push'](_0xfb3184['shift']());}};_0x4a1e24(++_0x4628ae);}(_0x8f66,0xe2));var _0x68f6=function(_0x4a6156,_0x2b8ce6){_0x4a6156=_0x4a6156-0x0;var _0x12c1f6=_0x8f66[_0x4a6156];return _0x12c1f6;};'use strict';var EventEmitter=require('events');var MailQueue=require('../../mysqldb')['db'][_0x68f6('0x0')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x68f6('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x68f6('0x2'),'afterDestroy':_0x68f6('0x3')};function emitEvent(_0x87bd11){return function(_0x56fab7,_0x8fae23,_0xb51991){MailQueueEvents['emit'](_0x87bd11+':'+_0x56fab7['id'],_0x56fab7);MailQueueEvents[_0x68f6('0x4')](_0x87bd11,_0x56fab7);_0xb51991(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x68f6('0x5')](e,emitEvent(event));}}module[_0x68f6('0x6')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 1cc46e7..5727f1e 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 _0x75a2=['define','MailQueue','mail_queues','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes'];(function(_0x55566a,_0x563b07){var _0xaca7cd=function(_0x556a03){while(--_0x556a03){_0x55566a['push'](_0x55566a['shift']());}};_0xaca7cd(++_0x563b07);}(_0x75a2,0x87));var _0x275a=function(_0x343c7e,_0x2dc892){_0x343c7e=_0x343c7e-0x0;var _0x4473a6=_0x75a2[_0x343c7e];return _0x4473a6;};'use strict';var _=require(_0x275a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x275a('0x1'));var moment=require(_0x275a('0x2'));var BPromise=require(_0x275a('0x3'));var rp=require(_0x275a('0x4'));var fs=require('fs');var path=require(_0x275a('0x5'));var rimraf=require(_0x275a('0x6'));var config=require(_0x275a('0x7'));var attributes=require(_0x275a('0x8'));module['exports']=function(_0x370f43,_0x585804){return _0x370f43[_0x275a('0x9')](_0x275a('0xa'),attributes,{'tableName':_0x275a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x07d1=['rimraf','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x07d1,0x16e));var _0x107d=function(_0x1b5080,_0x3e7cc9){_0x1b5080=_0x1b5080-0x0;var _0x195c87=_0x07d1[_0x1b5080];return _0x195c87;};'use strict';var _=require(_0x107d('0x0'));var util=require(_0x107d('0x1'));var logger=require(_0x107d('0x2'))('api');var moment=require(_0x107d('0x3'));var BPromise=require(_0x107d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x107d('0x5'));var rimraf=require(_0x107d('0x6'));var config=require('../../config/environment');var attributes=require(_0x107d('0x7'));module[_0x107d('0x8')]=function(_0x2ddf6f,_0x17317b){return _0x2ddf6f[_0x107d('0x9')](_0x107d('0xa'),attributes,{'tableName':_0x107d('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 28c6b00..3a09375 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 _0x83d6=['../../config/environment','jayson/promise','client','http','redis','localhost','./mailQueue.socket','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','GetMailQueue','findAll','options','raw','where','attributes','limit','map','include','debug','stringify','catch','ShowMailQueue','MailQueue','find','model','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0xe20cbe,_0x1e55f1){var _0x35f01d=function(_0x539a24){while(--_0x539a24){_0xe20cbe['push'](_0xe20cbe['shift']());}};_0x35f01d(++_0x1e55f1);}(_0x83d6,0xe9));var _0x683d=function(_0x371f4e,_0x3b585c){_0x371f4e=_0x371f4e-0x0;var _0xe930fc=_0x83d6[_0x371f4e];return _0xe930fc;};'use strict';var _=require(_0x683d('0x0'));var util=require('util');var moment=require(_0x683d('0x1'));var BPromise=require('bluebird');var rs=require(_0x683d('0x2'));var fs=require('fs');var Redis=require(_0x683d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x683d('0x4'));var logger=require(_0x683d('0x5'))(_0x683d('0x6'));var config=require(_0x683d('0x7'));var jayson=require(_0x683d('0x8'));var client=jayson[_0x683d('0x9')][_0x683d('0xa')]({'port':0x232a});config[_0x683d('0xb')]=_['defaults'](config['redis'],{'host':_0x683d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x683d('0xb')]));require(_0x683d('0xd'))['register'](socket);function respondWithRpcPromise(_0x5d5815,_0x49f858,_0x262fd1){return new BPromise(function(_0x4698d7,_0x18b8ce){return client[_0x683d('0xe')](_0x5d5815,_0x262fd1)[_0x683d('0xf')](function(_0x53f507){logger['info'](_0x683d('0x10'),_0x49f858,_0x683d('0x11'));logger['debug'](_0x683d('0x12'),_0x49f858,_0x683d('0x11'),JSON['stringify'](_0x53f507));if(_0x53f507[_0x683d('0x13')]){if(_0x53f507[_0x683d('0x13')][_0x683d('0x14')]===0x1f4){logger[_0x683d('0x13')](_0x683d('0x10'),_0x49f858,_0x53f507[_0x683d('0x13')][_0x683d('0x15')]);return _0x18b8ce(_0x53f507['error']['message']);}logger[_0x683d('0x13')](_0x683d('0x10'),_0x49f858,_0x53f507['error'][_0x683d('0x15')]);return _0x4698d7(_0x53f507[_0x683d('0x13')][_0x683d('0x15')]);}else{logger[_0x683d('0x16')]('MailQueue,\x20%s,\x20%s',_0x49f858,_0x683d('0x11'));_0x4698d7(_0x53f507[_0x683d('0x17')]['message']);}})['catch'](function(_0x5224c7){logger[_0x683d('0x13')](_0x683d('0x10'),_0x49f858,_0x5224c7);_0x18b8ce(_0x5224c7);});});}exports[_0x683d('0x18')]=function(_0x2c316e){var _0x2ac2ce=this;return new Promise(function(_0x5bd294,_0xcb69e0){return db['MailQueue'][_0x683d('0x19')]({'raw':_0x2c316e[_0x683d('0x1a')]?_0x2c316e['options'][_0x683d('0x1b')]===undefined?!![]:![]:!![],'where':_0x2c316e[_0x683d('0x1a')]?_0x2c316e[_0x683d('0x1a')][_0x683d('0x1c')]||null:null,'attributes':_0x2c316e[_0x683d('0x1a')]?_0x2c316e[_0x683d('0x1a')][_0x683d('0x1d')]||null:null,'limit':_0x2c316e['options']?_0x2c316e[_0x683d('0x1a')][_0x683d('0x1e')]||null:null,'include':_0x2c316e[_0x683d('0x1a')]?_0x2c316e[_0x683d('0x1a')]['include']?_[_0x683d('0x1f')](_0x2c316e['options'][_0x683d('0x20')],function(_0x4fc533){return{'model':db[_0x4fc533['model']],'as':_0x4fc533['as'],'attributes':_0x4fc533[_0x683d('0x1d')],'include':_0x4fc533['include']?_[_0x683d('0x1f')](_0x4fc533[_0x683d('0x20')],function(_0x5d388d){return{'model':db[_0x5d388d['model']],'as':_0x5d388d['as'],'attributes':_0x5d388d['attributes'],'include':_0x5d388d[_0x683d('0x20')]?_['map'](_0x5d388d['include'],function(_0x259ded){return{'model':db[_0x259ded['model']],'as':_0x259ded['as'],'attributes':_0x259ded[_0x683d('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x683d('0xf')](function(_0x2e2dac){logger[_0x683d('0x16')](_0x683d('0x18'),_0x2c316e);logger[_0x683d('0x21')](_0x683d('0x18'),_0x2c316e,JSON[_0x683d('0x22')](_0x2e2dac));_0x5bd294(_0x2e2dac);})[_0x683d('0x23')](function(_0x3ee0ff){logger[_0x683d('0x13')]('GetMailQueue',_0x3ee0ff[_0x683d('0x15')],_0x2c316e);_0xcb69e0(_0x2ac2ce[_0x683d('0x13')](0x1f4,_0x3ee0ff[_0x683d('0x15')]));});});};exports[_0x683d('0x24')]=function(_0x4c9584){var _0x12cbd2=this;return new Promise(function(_0x3adeea,_0x4de3a8){return db[_0x683d('0x25')][_0x683d('0x26')]({'raw':_0x4c9584[_0x683d('0x1a')]?_0x4c9584[_0x683d('0x1a')][_0x683d('0x1b')]===undefined?!![]:![]:!![],'where':_0x4c9584['options']?_0x4c9584[_0x683d('0x1a')][_0x683d('0x1c')]||null:null,'attributes':_0x4c9584[_0x683d('0x1a')]?_0x4c9584['options'][_0x683d('0x1d')]||null:null,'include':_0x4c9584['options']?_0x4c9584[_0x683d('0x1a')][_0x683d('0x20')]?_[_0x683d('0x1f')](_0x4c9584[_0x683d('0x1a')][_0x683d('0x20')],function(_0x4d71e0){return{'model':db[_0x4d71e0[_0x683d('0x27')]],'as':_0x4d71e0['as'],'attributes':_0x4d71e0[_0x683d('0x1d')],'include':_0x4d71e0[_0x683d('0x20')]?_['map'](_0x4d71e0[_0x683d('0x20')],function(_0x40eb76){return{'model':db[_0x40eb76[_0x683d('0x27')]],'as':_0x40eb76['as'],'attributes':_0x40eb76[_0x683d('0x1d')],'include':_0x40eb76[_0x683d('0x20')]?_[_0x683d('0x1f')](_0x40eb76[_0x683d('0x20')],function(_0x484930){return{'model':db[_0x484930['model']],'as':_0x484930['as'],'attributes':_0x484930[_0x683d('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb47d64){logger[_0x683d('0x16')](_0x683d('0x24'),_0x4c9584);logger['debug'](_0x683d('0x24'),_0x4c9584,JSON[_0x683d('0x22')](_0xb47d64));_0x3adeea(_0xb47d64);})[_0x683d('0x23')](function(_0x3ffaf0){logger[_0x683d('0x13')](_0x683d('0x24'),_0x3ffaf0[_0x683d('0x15')],_0x4c9584);_0x4de3a8(_0x12cbd2['error'](0x1f4,_0x3ffaf0['message']));});});}; \ No newline at end of file +var _0x0d77=['MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetMailQueue','MailQueue','options','raw','where','limit','map','model','attributes','include','ShowMailQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','register','request','then'];(function(_0x48ce9e,_0x54b134){var _0x1363a6=function(_0x43a787){while(--_0x43a787){_0x48ce9e['push'](_0x48ce9e['shift']());}};_0x1363a6(++_0x54b134);}(_0x0d77,0x8b));var _0x70d7=function(_0x462c9c,_0x4c3ee7){_0x462c9c=_0x462c9c-0x0;var _0x507aca=_0x0d77[_0x462c9c];return _0x507aca;};'use strict';var _=require(_0x70d7('0x0'));var util=require(_0x70d7('0x1'));var moment=require(_0x70d7('0x2'));var BPromise=require('bluebird');var rs=require(_0x70d7('0x3'));var fs=require('fs');var Redis=require(_0x70d7('0x4'));var db=require(_0x70d7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x70d7('0x6'))(_0x70d7('0x7'));var config=require('../../config/environment');var jayson=require(_0x70d7('0x8'));var client=jayson[_0x70d7('0x9')][_0x70d7('0xa')]({'port':0x232a});config[_0x70d7('0xb')]=_[_0x70d7('0xc')](config['redis'],{'host':_0x70d7('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x70d7('0xb')]));require('./mailQueue.socket')[_0x70d7('0xe')](socket);function respondWithRpcPromise(_0x48ef72,_0x17deb1,_0x41b16b){return new BPromise(function(_0x9415bf,_0x498f75){return client[_0x70d7('0xf')](_0x48ef72,_0x41b16b)[_0x70d7('0x10')](function(_0x578ef4){logger['info'](_0x70d7('0x11'),_0x17deb1,_0x70d7('0x12'));logger[_0x70d7('0x13')](_0x70d7('0x14'),_0x17deb1,_0x70d7('0x12'),JSON[_0x70d7('0x15')](_0x578ef4));if(_0x578ef4[_0x70d7('0x16')]){if(_0x578ef4[_0x70d7('0x16')][_0x70d7('0x17')]===0x1f4){logger[_0x70d7('0x16')]('MailQueue,\x20%s,\x20%s',_0x17deb1,_0x578ef4[_0x70d7('0x16')][_0x70d7('0x18')]);return _0x498f75(_0x578ef4['error'][_0x70d7('0x18')]);}logger[_0x70d7('0x16')]('MailQueue,\x20%s,\x20%s',_0x17deb1,_0x578ef4['error']['message']);return _0x9415bf(_0x578ef4[_0x70d7('0x16')][_0x70d7('0x18')]);}else{logger[_0x70d7('0x19')](_0x70d7('0x11'),_0x17deb1,_0x70d7('0x12'));_0x9415bf(_0x578ef4[_0x70d7('0x1a')][_0x70d7('0x18')]);}})[_0x70d7('0x1b')](function(_0x5761ba){logger[_0x70d7('0x16')]('MailQueue,\x20%s,\x20%s',_0x17deb1,_0x5761ba);_0x498f75(_0x5761ba);});});}exports[_0x70d7('0x1c')]=function(_0x1c5d8c){var _0x5595aa=this;return new Promise(function(_0x34361d,_0x5f338d){return db[_0x70d7('0x1d')]['findAll']({'raw':_0x1c5d8c[_0x70d7('0x1e')]?_0x1c5d8c[_0x70d7('0x1e')][_0x70d7('0x1f')]===undefined?!![]:![]:!![],'where':_0x1c5d8c[_0x70d7('0x1e')]?_0x1c5d8c[_0x70d7('0x1e')][_0x70d7('0x20')]||null:null,'attributes':_0x1c5d8c[_0x70d7('0x1e')]?_0x1c5d8c[_0x70d7('0x1e')]['attributes']||null:null,'limit':_0x1c5d8c['options']?_0x1c5d8c[_0x70d7('0x1e')][_0x70d7('0x21')]||null:null,'include':_0x1c5d8c[_0x70d7('0x1e')]?_0x1c5d8c[_0x70d7('0x1e')]['include']?_[_0x70d7('0x22')](_0x1c5d8c[_0x70d7('0x1e')]['include'],function(_0x57e98c){return{'model':db[_0x57e98c[_0x70d7('0x23')]],'as':_0x57e98c['as'],'attributes':_0x57e98c[_0x70d7('0x24')],'include':_0x57e98c[_0x70d7('0x25')]?_[_0x70d7('0x22')](_0x57e98c[_0x70d7('0x25')],function(_0x1c3a9d){return{'model':db[_0x1c3a9d[_0x70d7('0x23')]],'as':_0x1c3a9d['as'],'attributes':_0x1c3a9d[_0x70d7('0x24')],'include':_0x1c3a9d[_0x70d7('0x25')]?_['map'](_0x1c3a9d[_0x70d7('0x25')],function(_0x5e9b43){return{'model':db[_0x5e9b43['model']],'as':_0x5e9b43['as'],'attributes':_0x5e9b43[_0x70d7('0x24')]};}):[]};}):[]};}):[]:[]})[_0x70d7('0x10')](function(_0x1ce4a0){logger[_0x70d7('0x19')](_0x70d7('0x1c'),_0x1c5d8c);logger[_0x70d7('0x13')](_0x70d7('0x1c'),_0x1c5d8c,JSON[_0x70d7('0x15')](_0x1ce4a0));_0x34361d(_0x1ce4a0);})[_0x70d7('0x1b')](function(_0xa4a84c){logger[_0x70d7('0x16')](_0x70d7('0x1c'),_0xa4a84c[_0x70d7('0x18')],_0x1c5d8c);_0x5f338d(_0x5595aa[_0x70d7('0x16')](0x1f4,_0xa4a84c['message']));});});};exports[_0x70d7('0x26')]=function(_0x2d29bd){var _0x1a84a9=this;return new Promise(function(_0x1b824f,_0x3d0814){return db[_0x70d7('0x1d')]['find']({'raw':_0x2d29bd[_0x70d7('0x1e')]?_0x2d29bd[_0x70d7('0x1e')][_0x70d7('0x1f')]===undefined?!![]:![]:!![],'where':_0x2d29bd[_0x70d7('0x1e')]?_0x2d29bd[_0x70d7('0x1e')][_0x70d7('0x20')]||null:null,'attributes':_0x2d29bd[_0x70d7('0x1e')]?_0x2d29bd[_0x70d7('0x1e')][_0x70d7('0x24')]||null:null,'include':_0x2d29bd[_0x70d7('0x1e')]?_0x2d29bd['options'][_0x70d7('0x25')]?_[_0x70d7('0x22')](_0x2d29bd[_0x70d7('0x1e')][_0x70d7('0x25')],function(_0xe88999){return{'model':db[_0xe88999[_0x70d7('0x23')]],'as':_0xe88999['as'],'attributes':_0xe88999[_0x70d7('0x24')],'include':_0xe88999[_0x70d7('0x25')]?_[_0x70d7('0x22')](_0xe88999[_0x70d7('0x25')],function(_0x4188cc){return{'model':db[_0x4188cc[_0x70d7('0x23')]],'as':_0x4188cc['as'],'attributes':_0x4188cc[_0x70d7('0x24')],'include':_0x4188cc[_0x70d7('0x25')]?_[_0x70d7('0x22')](_0x4188cc[_0x70d7('0x25')],function(_0x39442d){return{'model':db[_0x39442d[_0x70d7('0x23')]],'as':_0x39442d['as'],'attributes':_0x39442d[_0x70d7('0x24')]};}):[]};}):[]};}):[]:[]})[_0x70d7('0x10')](function(_0x2c5d9c){logger[_0x70d7('0x19')](_0x70d7('0x26'),_0x2d29bd);logger[_0x70d7('0x13')](_0x70d7('0x26'),_0x2d29bd,JSON[_0x70d7('0x15')](_0x2c5d9c));_0x1b824f(_0x2c5d9c);})['catch'](function(_0x3db864){logger[_0x70d7('0x16')](_0x70d7('0x26'),_0x3db864[_0x70d7('0x18')],_0x2d29bd);_0x3d0814(_0x1a84a9['error'](0x1f4,_0x3db864[_0x70d7('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 2471578..4864c0c 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 _0x7d1f=['remove','update','emit','removeListener','register','./mailQueue.events','save'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x7d1f,0x10f));var _0xf7d1=function(_0x2b4211,_0x2bce51){_0x2b4211=_0x2b4211-0x0;var _0x3d1b9e=_0x7d1f[_0x2b4211];return _0x3d1b9e;};'use strict';var MailQueueEvents=require(_0xf7d1('0x0'));var events=[_0xf7d1('0x1'),_0xf7d1('0x2'),_0xf7d1('0x3')];function createListener(_0x51ec0d,_0x1b6726){return function(_0x54440f){_0x1b6726[_0xf7d1('0x4')](_0x51ec0d,_0x54440f);};}function removeListener(_0x547da2,_0x5bcef6){return function(){MailQueueEvents[_0xf7d1('0x5')](_0x547da2,_0x5bcef6);};}exports[_0xf7d1('0x6')]=function(_0x4ddd66){for(var _0x5edc59=0x0,_0x25ed5=events['length'];_0x5edc59<_0x25ed5;_0x5edc59++){var _0x4e60ab=events[_0x5edc59];var _0x29902d=createListener('mailQueue:'+_0x4e60ab,_0x4ddd66);MailQueueEvents['on'](_0x4e60ab,_0x29902d);}}; \ No newline at end of file +var _0x5227=['mailQueue:','./mailQueue.events','save','remove','update','emit','removeListener','length'];(function(_0x1ced9e,_0x2fb740){var _0x370311=function(_0x4cac55){while(--_0x4cac55){_0x1ced9e['push'](_0x1ced9e['shift']());}};_0x370311(++_0x2fb740);}(_0x5227,0x1d1));var _0x7522=function(_0x88fab1,_0x1accff){_0x88fab1=_0x88fab1-0x0;var _0x20c571=_0x5227[_0x88fab1];return _0x20c571;};'use strict';var MailQueueEvents=require(_0x7522('0x0'));var events=[_0x7522('0x1'),_0x7522('0x2'),_0x7522('0x3')];function createListener(_0x3a6c52,_0x186c99){return function(_0x5eb1d1){_0x186c99[_0x7522('0x4')](_0x3a6c52,_0x5eb1d1);};}function removeListener(_0x1826a1,_0x2ff860){return function(){MailQueueEvents[_0x7522('0x5')](_0x1826a1,_0x2ff860);};}exports['register']=function(_0xa19d9a){for(var _0x15e038=0x0,_0x26767c=events[_0x7522('0x6')];_0x15e038<_0x26767c;_0x15e038++){var _0x110f4a=events[_0x15e038];var _0x3ebd0a=createListener(_0x7522('0x7')+_0x110f4a,_0xa19d9a);MailQueueEvents['on'](_0x110f4a,_0x3ebd0a);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 3b75825..94c38fd 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 _0xf3e3=['put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','describe','/:id','show','post'];(function(_0x273d86,_0x261254){var _0x3116b5=function(_0x16c347){while(--_0x16c347){_0x273d86['push'](_0x273d86['shift']());}};_0x3116b5(++_0x261254);}(_0xf3e3,0xf5));var _0x3f3e=function(_0x1587cd,_0x3e66c2){_0x1587cd=_0x1587cd-0x0;var _0x4ed6e5=_0xf3e3[_0x1587cd];return _0x4ed6e5;};'use strict';var multer=require(_0x3f3e('0x0'));var util=require(_0x3f3e('0x1'));var path=require('path');var timeout=require(_0x3f3e('0x2'));var express=require('express');var router=express[_0x3f3e('0x3')]();var fs_extra=require(_0x3f3e('0x4'));var auth=require(_0x3f3e('0x5'));var interaction=require(_0x3f3e('0x6'));var config=require(_0x3f3e('0x7'));var controller=require(_0x3f3e('0x8'));router[_0x3f3e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3f3e('0x9')]('/describe',auth[_0x3f3e('0xa')](),controller[_0x3f3e('0xb')]);router[_0x3f3e('0x9')](_0x3f3e('0xc'),auth[_0x3f3e('0xa')](),controller[_0x3f3e('0xd')]);router[_0x3f3e('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3f3e('0xf')]('/:id',auth[_0x3f3e('0xa')](),controller[_0x3f3e('0x10')]);router[_0x3f3e('0x11')](_0x3f3e('0xc'),auth['isAuthenticated'](),controller[_0x3f3e('0x12')]);module[_0x3f3e('0x13')]=router; \ No newline at end of file +var _0x3815=['./mailQueueReport.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x715d76,_0x402d60){var _0x48fe88=function(_0x4dd0ea){while(--_0x4dd0ea){_0x715d76['push'](_0x715d76['shift']());}};_0x48fe88(++_0x402d60);}(_0x3815,0x175));var _0x5381=function(_0x594843,_0x720f32){_0x594843=_0x594843-0x0;var _0x45f6ba=_0x3815[_0x594843];return _0x45f6ba;};'use strict';var multer=require(_0x5381('0x0'));var util=require(_0x5381('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5381('0x2'));var router=express[_0x5381('0x3')]();var fs_extra=require(_0x5381('0x4'));var auth=require(_0x5381('0x5'));var interaction=require(_0x5381('0x6'));var config=require('../../config/environment');var controller=require(_0x5381('0x7'));router[_0x5381('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5381('0x8')]('/describe',auth[_0x5381('0x9')](),controller['describe']);router[_0x5381('0x8')](_0x5381('0xa'),auth[_0x5381('0x9')](),controller[_0x5381('0xb')]);router[_0x5381('0xc')]('/',auth[_0x5381('0x9')](),controller[_0x5381('0xd')]);router[_0x5381('0xe')](_0x5381('0xa'),auth[_0x5381('0x9')](),controller[_0x5381('0xf')]);router[_0x5381('0x10')](_0x5381('0xa'),auth[_0x5381('0x9')](),controller[_0x5381('0x11')]);module[_0x5381('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 786cdaf..63c2d18 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 _0x7ac8=['DATE','moment','sequelize','exports','STRING'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7ac8,0xfb));var _0x87ac=function(_0x5380cd,_0x1ea634){_0x5380cd=_0x5380cd-0x0;var _0x25dd61=_0x7ac8[_0x5380cd];return _0x25dd61;};'use strict';var moment=require(_0x87ac('0x0'));var Sequelize=require(_0x87ac('0x1'));module[_0x87ac('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x87ac('0x3')]},'joinAt':{'type':Sequelize[_0x87ac('0x4')]},'leaveAt':{'type':Sequelize[_0x87ac('0x4')]},'acceptAt':{'type':Sequelize[_0x87ac('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x87ac('0x3')]}}; \ No newline at end of file +var _0x8c2f=['STRING','DATE'];(function(_0x45d1fd,_0x463212){var _0xd0e542=function(_0x23ebc9){while(--_0x23ebc9){_0x45d1fd['push'](_0x45d1fd['shift']());}};_0xd0e542(++_0x463212);}(_0x8c2f,0xdc));var _0xf8c2=function(_0x26641c,_0x1ba2a5){_0x26641c=_0x26641c-0x0;var _0x42c01a=_0x8c2f[_0x26641c];return _0x42c01a;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xf8c2('0x0')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xf8c2('0x1')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf8c2('0x1')]},'reason':{'type':Sequelize[_0xf8c2('0x0')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index d18f9fb..909df9d 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 _0x0120=['name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','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','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','limit','undefined','count','offset','set','Content-Range','json','reject','save','update','then','destroy','end','sendStatus','error','stack'];(function(_0x1b4f71,_0x346305){var _0x4b9b12=function(_0x6210c6){while(--_0x6210c6){_0x1b4f71['push'](_0x1b4f71['shift']());}};_0x4b9b12(++_0x346305);}(_0x0120,0x6f));var _0x0012=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x0120[_0x484e36];return _0xafc85d;};'use strict';var emlformat=require(_0x0012('0x0'));var rimraf=require(_0x0012('0x1'));var zipdir=require(_0x0012('0x2'));var jsonpatch=require(_0x0012('0x3'));var rp=require(_0x0012('0x4'));var moment=require(_0x0012('0x5'));var BPromise=require(_0x0012('0x6'));var Mustache=require(_0x0012('0x7'));var util=require(_0x0012('0x8'));var path=require(_0x0012('0x9'));var sox=require(_0x0012('0xa'));var csv=require(_0x0012('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0012('0xc'));var crypto=require(_0x0012('0xd'));var jsforce=require(_0x0012('0xe'));var deskjs=require(_0x0012('0xf'));var toCsv=require(_0x0012('0xb'));var querystring=require('querystring');var Papa=require(_0x0012('0x10'));var Redis=require(_0x0012('0x11'));var authService=require(_0x0012('0x12'));var qs=require(_0x0012('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0012('0x14'));var logger=require('../../config/logger')(_0x0012('0x15'));var utils=require(_0x0012('0x16'));var config=require(_0x0012('0x17'));var licenseUtil=require(_0x0012('0x18'));var db=require(_0x0012('0x19'))['db'];function respondWithStatusCode(_0x4d3e7a,_0x6d4a1a){_0x6d4a1a=_0x6d4a1a||0xcc;return function(_0x4f0ee1){if(_0x4f0ee1){return _0x4d3e7a['sendStatus'](_0x6d4a1a);}return _0x4d3e7a['status'](_0x6d4a1a)['end']();};}function respondWithResult(_0x3a7d50,_0x496a2b){_0x496a2b=_0x496a2b||0xc8;return function(_0x3995fd){if(_0x3995fd){return _0x3a7d50[_0x0012('0x1a')](_0x496a2b)['json'](_0x3995fd);}};}function respondWithFilteredResult(_0x24f4ed,_0x1a0c0d){return function(_0x348810){if(_0x348810){var _0x3b8dfc=typeof _0x1a0c0d['offset']==='undefined'&&typeof _0x1a0c0d[_0x0012('0x1b')]===_0x0012('0x1c');var _0x3948bf=_0x348810[_0x0012('0x1d')];var _0x1d0423=_0x3b8dfc?0x0:_0x1a0c0d[_0x0012('0x1e')];var _0x1e78ee=_0x3b8dfc?_0x348810[_0x0012('0x1d')]:_0x1a0c0d['offset']+_0x1a0c0d[_0x0012('0x1b')];var _0x56b0e1;if(_0x1e78ee>=_0x3948bf){_0x1e78ee=_0x3948bf;_0x56b0e1=0xc8;}else{_0x56b0e1=0xce;}_0x24f4ed['status'](_0x56b0e1);return _0x24f4ed[_0x0012('0x1f')](_0x0012('0x20'),_0x1d0423+'-'+_0x1e78ee+'/'+_0x3948bf)[_0x0012('0x21')](_0x348810);}return null;};}function patchUpdates(_0x2c837e){return function(_0x53ac2d){try{jsonpatch['apply'](_0x53ac2d,_0x2c837e,!![]);}catch(_0x460d82){return BPromise[_0x0012('0x22')](_0x460d82);}return _0x53ac2d[_0x0012('0x23')]();};}function saveUpdates(_0x7177bc,_0x190f07){return function(_0x2e6a2c){if(_0x2e6a2c){return _0x2e6a2c[_0x0012('0x24')](_0x7177bc)[_0x0012('0x25')](function(_0x57487e){return _0x57487e;});}return null;};}function removeEntity(_0x24674c,_0x24a280){return function(_0x4cf4bd){if(_0x4cf4bd){return _0x4cf4bd[_0x0012('0x26')]()[_0x0012('0x25')](function(){_0x24674c[_0x0012('0x1a')](0xcc)[_0x0012('0x27')]();});}};}function handleEntityNotFound(_0x42bcd7,_0x5e820b){return function(_0x351ffd){if(!_0x351ffd){_0x42bcd7[_0x0012('0x28')](0x194);}return _0x351ffd;};}function handleError(_0xbb5b55,_0x2a0302){_0x2a0302=_0x2a0302||0x1f4;return function(_0x173cb3){logger[_0x0012('0x29')](_0x173cb3[_0x0012('0x2a')]);if(_0x173cb3[_0x0012('0x2b')]){delete _0x173cb3[_0x0012('0x2b')];}_0xbb5b55[_0x0012('0x1a')](_0x2a0302)[_0x0012('0x2c')](_0x173cb3);};}exports[_0x0012('0x2d')]=function(_0x45c3ca,_0x3ce788){var _0x1282bb={},_0x276389={},_0x1b676d={'count':0x0,'rows':[]};var _0x1f4a0a=_[_0x0012('0x2e')](db[_0x0012('0x2f')][_0x0012('0x30')],function(_0x4d0998){return{'name':_0x4d0998[_0x0012('0x31')],'type':_0x4d0998[_0x0012('0x32')]['key']};});_0x276389[_0x0012('0x33')]=_[_0x0012('0x2e')](_0x1f4a0a,_0x0012('0x2b'));_0x276389[_0x0012('0x34')]=_[_0x0012('0x35')](_0x45c3ca['query']);_0x276389[_0x0012('0x36')]=_[_0x0012('0x37')](_0x276389[_0x0012('0x33')],_0x276389['query']);_0x1282bb[_0x0012('0x38')]=_[_0x0012('0x37')](_0x276389[_0x0012('0x33')],qs[_0x0012('0x39')](_0x45c3ca[_0x0012('0x34')][_0x0012('0x39')]));_0x1282bb['attributes']=_0x1282bb[_0x0012('0x38')][_0x0012('0x3a')]?_0x1282bb[_0x0012('0x38')]:_0x276389[_0x0012('0x33')];if(!_0x45c3ca['query']['hasOwnProperty'](_0x0012('0x3b'))){_0x1282bb[_0x0012('0x1b')]=qs[_0x0012('0x1b')](_0x45c3ca[_0x0012('0x34')][_0x0012('0x1b')]);_0x1282bb[_0x0012('0x1e')]=qs[_0x0012('0x1e')](_0x45c3ca['query'][_0x0012('0x1e')]);}_0x1282bb[_0x0012('0x3c')]=qs['sort'](_0x45c3ca[_0x0012('0x34')][_0x0012('0x3d')]);_0x1282bb[_0x0012('0x3e')]=qs[_0x0012('0x36')](_[_0x0012('0x3f')](_0x45c3ca[_0x0012('0x34')],_0x276389[_0x0012('0x36')]),_0x1f4a0a);if(_0x45c3ca['query'][_0x0012('0x40')]){_0x1282bb['where']=_[_0x0012('0x41')](_0x1282bb['where'],{'$or':_['map'](_0x1f4a0a,function(_0x1c35aa){if(_0x1c35aa[_0x0012('0x32')]!==_0x0012('0x42')){var _0x4e4424={};_0x4e4424[_0x1c35aa[_0x0012('0x2b')]]={'$like':'%'+_0x45c3ca[_0x0012('0x34')][_0x0012('0x40')]+'%'};return _0x4e4424;}})});}_0x1282bb=_[_0x0012('0x41')]({},_0x1282bb,_0x45c3ca[_0x0012('0x43')]);var _0x379780={'where':_0x1282bb[_0x0012('0x3e')]};return db[_0x0012('0x2f')]['count'](_0x379780)[_0x0012('0x25')](function(_0x25aff1){_0x1b676d[_0x0012('0x1d')]=_0x25aff1;if(_0x45c3ca[_0x0012('0x34')][_0x0012('0x44')]){_0x1282bb[_0x0012('0x45')]=[{'all':!![]}];}return db[_0x0012('0x2f')]['findAll'](_0x1282bb);})['then'](function(_0x1c54de){_0x1b676d['rows']=_0x1c54de;return _0x1b676d;})[_0x0012('0x25')](respondWithFilteredResult(_0x3ce788,_0x1282bb))[_0x0012('0x46')](handleError(_0x3ce788,null));};exports[_0x0012('0x47')]=function(_0x40f80d,_0x32c1f9){var _0x5348a2={'raw':!![],'where':{'id':_0x40f80d[_0x0012('0x48')]['id']}},_0x1bd93a={};_0x1bd93a['model']=_[_0x0012('0x35')](db[_0x0012('0x2f')][_0x0012('0x30')]);_0x1bd93a[_0x0012('0x34')]=_['keys'](_0x40f80d['query']);_0x1bd93a[_0x0012('0x36')]=_['intersection'](_0x1bd93a[_0x0012('0x33')],_0x1bd93a['query']);_0x5348a2[_0x0012('0x38')]=_[_0x0012('0x37')](_0x1bd93a[_0x0012('0x33')],qs[_0x0012('0x39')](_0x40f80d['query'][_0x0012('0x39')]));_0x5348a2['attributes']=_0x5348a2[_0x0012('0x38')][_0x0012('0x3a')]?_0x5348a2[_0x0012('0x38')]:_0x1bd93a[_0x0012('0x33')];if(_0x40f80d[_0x0012('0x34')][_0x0012('0x44')]){_0x5348a2[_0x0012('0x45')]=[{'all':!![]}];}_0x5348a2=_['merge']({},_0x5348a2,_0x40f80d[_0x0012('0x43')]);return db[_0x0012('0x2f')][_0x0012('0x49')](_0x5348a2)[_0x0012('0x25')](handleEntityNotFound(_0x32c1f9,null))[_0x0012('0x25')](respondWithResult(_0x32c1f9,null))[_0x0012('0x46')](handleError(_0x32c1f9,null));};exports['create']=function(_0x5894ee,_0x48de64){return db['MailQueueReport'][_0x0012('0x4a')](_0x5894ee[_0x0012('0x4b')],{})[_0x0012('0x25')](respondWithResult(_0x48de64,0xc9))[_0x0012('0x46')](handleError(_0x48de64,null));};exports[_0x0012('0x24')]=function(_0x53d552,_0x44ffaf){if(_0x53d552[_0x0012('0x4b')]['id']){delete _0x53d552[_0x0012('0x4b')]['id'];}return db[_0x0012('0x2f')][_0x0012('0x49')]({'where':{'id':_0x53d552[_0x0012('0x48')]['id']}})[_0x0012('0x25')](handleEntityNotFound(_0x44ffaf,null))[_0x0012('0x25')](saveUpdates(_0x53d552[_0x0012('0x4b')],null))[_0x0012('0x25')](respondWithResult(_0x44ffaf,null))[_0x0012('0x46')](handleError(_0x44ffaf,null));};exports['destroy']=function(_0x2389cd,_0x12cb8f){return db[_0x0012('0x2f')]['find']({'where':{'id':_0x2389cd[_0x0012('0x48')]['id']}})[_0x0012('0x25')](handleEntityNotFound(_0x12cb8f,null))[_0x0012('0x25')](removeEntity(_0x12cb8f,null))[_0x0012('0x46')](handleError(_0x12cb8f,null));};exports[_0x0012('0x4c')]=function(_0x5f283f,_0xd11428){return db['MailQueueReport'][_0x0012('0x4c')]()[_0x0012('0x25')](respondWithResult(_0xd11428,null))['catch'](handleError(_0xd11428,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(_0x193d08,_0x5df3c7){var _0x241318=function(_0x49fa9c){while(--_0x49fa9c){_0x193d08['push'](_0x193d08['shift']());}};_0x241318(++_0x5df3c7);}(_0xbff5,0x1bc));var _0x5bff=function(_0x3670cb,_0x1c82b0){_0x3670cb=_0x3670cb-0x0;var _0x5a6812=_0xbff5[_0x3670cb];return _0x5a6812;};'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 fdf9be8..1ee6936 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 _0xfef0=['define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./mailQueueReport.attributes','exports'];(function(_0x4d2cf8,_0x1ce4d5){var _0x13b6b8=function(_0xbb35c6){while(--_0xbb35c6){_0x4d2cf8['push'](_0x4d2cf8['shift']());}};_0x13b6b8(++_0x1ce4d5);}(_0xfef0,0x19a));var _0x0fef=function(_0x217c2b,_0x19e8d7){_0x217c2b=_0x217c2b-0x0;var _0x4fad0e=_0xfef0[_0x217c2b];return _0x4fad0e;};'use strict';var _=require(_0x0fef('0x0'));var util=require(_0x0fef('0x1'));var logger=require(_0x0fef('0x2'))(_0x0fef('0x3'));var moment=require(_0x0fef('0x4'));var BPromise=require(_0x0fef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0fef('0x6'));var config=require(_0x0fef('0x7'));var attributes=require(_0x0fef('0x8'));module[_0x0fef('0x9')]=function(_0x1bb0f5,_0x1a7da5){return _0x1bb0f5[_0x0fef('0xa')](_0x0fef('0xb'),attributes,{'tableName':_0x0fef('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0fef('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2ea2=['exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','moment','bluebird','rimraf','../../config/environment','./mailQueueReport.attributes'];(function(_0x2dc218,_0x42ed5f){var _0x2b7d36=function(_0x149c11){while(--_0x149c11){_0x2dc218['push'](_0x2dc218['shift']());}};_0x2b7d36(++_0x42ed5f);}(_0x2ea2,0x7e));var _0x22ea=function(_0x205659,_0x33a2f5){_0x205659=_0x205659-0x0;var _0x170029=_0x2ea2[_0x205659];return _0x170029;};'use strict';var _=require(_0x22ea('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x22ea('0x1'));var BPromise=require(_0x22ea('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x22ea('0x3'));var config=require(_0x22ea('0x4'));var attributes=require(_0x22ea('0x5'));module[_0x22ea('0x6')]=function(_0x891fd1,_0x336792){return _0x891fd1[_0x22ea('0x7')](_0x22ea('0x8'),attributes,{'tableName':_0x22ea('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x22ea('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 4448c2d..d218773 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 _0x5f2f=['error','code','message','request\x20sent','result','catch','CreateMailQueueReport','MailQueueReport','create','body','options','raw','UpdateMailQueueReport','update','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailQueueReport,\x20%s,\x20%s','debug','stringify'];(function(_0x52153f,_0x5844f5){var _0x3e6094=function(_0x5ed273){while(--_0x5ed273){_0x52153f['push'](_0x52153f['shift']());}};_0x3e6094(++_0x5844f5);}(_0x5f2f,0x73));var _0xf5f2=function(_0x56fc95,_0x1f1e1a){_0x56fc95=_0x56fc95-0x0;var _0x8b3ca0=_0x5f2f[_0x56fc95];return _0x8b3ca0;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')](_0x20fccd[_0xf5f2('0x1a')],{'raw':_0x20fccd['options']?_0x20fccd[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x47acfc){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger['debug'](_0xf5f2('0x17'),_0x20fccd,JSON[_0xf5f2('0x10')](_0x47acfc));_0x4ff59b(_0x47acfc);})[_0xf5f2('0x16')](function(_0x39c024){logger[_0xf5f2('0x11')]('CreateMailQueueReport',_0x39c024[_0xf5f2('0x13')],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x39c024[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x1d')]=function(_0x287ad5){var _0x5bdf4a=this;return new Promise(function(_0x529f07,_0x5f1124){return db[_0xf5f2('0x18')][_0xf5f2('0x1e')](_0x287ad5[_0xf5f2('0x1a')],{'raw':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')]['where']||null:null,'attributes':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x1f')]||null:null,'limit':_0x287ad5[_0xf5f2('0x1b')]?_0x287ad5[_0xf5f2('0x1b')][_0xf5f2('0x20')]||null:null})['then'](function(_0x53cb96){logger[_0xf5f2('0xd')](_0xf5f2('0x1d'),_0x287ad5);logger[_0xf5f2('0xf')]('UpdateMailQueueReport',_0x287ad5,JSON['stringify'](_0x53cb96));_0x529f07(_0x53cb96);})[_0xf5f2('0x16')](function(_0x50b8a2){logger[_0xf5f2('0x11')](_0xf5f2('0x1d'),_0x50b8a2[_0xf5f2('0x13')],_0x287ad5);_0x5f1124(_0x5bdf4a['error'](0x1f4,_0x50b8a2['message']));});});}; \ No newline at end of file +var _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x3c3021,_0x189015){var _0x347432=function(_0x324dfc){while(--_0x324dfc){_0x3c3021['push'](_0x3c3021['shift']());}};_0x347432(++_0x189015);}(_0x2ef3,0xba));var _0x32ef=function(_0x611ceb,_0x414862){_0x611ceb=_0x611ceb-0x0;var _0x41ac6e=_0x2ef3[_0x611ceb];return _0x41ac6e;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 9e109d5..30ebe00 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x4fd029,_0x2c06bc){var _0x99c365=function(_0x149612){while(--_0x149612){_0x4fd029['push'](_0x4fd029['shift']());}};_0x99c365(++_0x2c06bc);}(_0xedd9,0xfc));var _0x9edd=function(_0x3b05c5,_0x22bc8f){_0x3b05c5=_0x3b05c5-0x0;var _0x35cfe0=_0xedd9[_0x3b05c5];return _0x35cfe0;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x590db7,_0x3fd713){var _0x53125d=function(_0x149b26){while(--_0x149b26){_0x590db7['push'](_0x590db7['shift']());}};_0x53125d(++_0x3fd713);}(_0x70e0,0x17b));var _0x070e=function(_0x25af09,_0x9dc48e){_0x25af09=_0x25af09-0x0;var _0x5ed47b=_0x70e0[_0x25af09];return _0x5ed47b;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 6dc7df4..6866c18 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 _0xeb71=['INTEGER','exports','STRING','BOOLEAN','INBOX'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xeb71,0x18c));var _0x1eb7=function(_0x4fe32e,_0x43fff3){_0x4fe32e=_0x4fe32e-0x0;var _0x3ca7d1=_0xeb71[_0x4fe32e];return _0x3ca7d1;};'use strict';var Sequelize=require('sequelize');module[_0x1eb7('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x1eb7('0x1')]},'authentication':{'type':Sequelize[_0x1eb7('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0x1eb7('0x1')]},'password':{'type':Sequelize[_0x1eb7('0x1')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0x1eb7('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x1eb7('0x1')],'defaultValue':_0x1eb7('0x3')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x1eb7('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0x1eb7('0x1')]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xfd23=['INBOX','sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xfd23,0x17b));var _0x3fd2=function(_0x44a64f,_0x38475c){_0x44a64f=_0x44a64f-0x0;var _0x52024b=_0xfd23[_0x44a64f];return _0x52024b;};'use strict';var Sequelize=require(_0x3fd2('0x0'));module[_0x3fd2('0x1')]={'description':{'type':Sequelize[_0x3fd2('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x3fd2('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x3fd2('0x2')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x3fd2('0x4')]},'tls':{'type':Sequelize[_0x3fd2('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x3fd2('0x2')],'defaultValue':_0x3fd2('0x5')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x3fd2('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index a71ee0c..6661b18 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 _0x41fd=['../../config/logger','api','moment','request-promise','./mailServerIn.attributes','exports','define','mail_servers_in','util'];(function(_0x20c59f,_0x583d0a){var _0x2b6df8=function(_0x303e11){while(--_0x303e11){_0x20c59f['push'](_0x20c59f['shift']());}};_0x2b6df8(++_0x583d0a);}(_0x41fd,0x6b));var _0xd41f=function(_0x130333,_0x1bec7b){_0x130333=_0x130333-0x0;var _0x999a67=_0x41fd[_0x130333];return _0x999a67;};'use strict';var _=require('lodash');var util=require(_0xd41f('0x0'));var logger=require(_0xd41f('0x1'))(_0xd41f('0x2'));var moment=require(_0xd41f('0x3'));var BPromise=require('bluebird');var rp=require(_0xd41f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd41f('0x5'));module[_0xd41f('0x6')]=function(_0x394108,_0x3304bd){return _0x394108[_0xd41f('0x7')]('MailServerIn',attributes,{'tableName':_0xd41f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x115a=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./mailServerIn.attributes','define','MailServerIn','mail_servers_in','util'];(function(_0x2a4fb8,_0x4c4c46){var _0x3af340=function(_0x18f951){while(--_0x18f951){_0x2a4fb8['push'](_0x2a4fb8['shift']());}};_0x3af340(++_0x4c4c46);}(_0x115a,0xf1));var _0xa115=function(_0x492cf7,_0x56e333){_0x492cf7=_0x492cf7-0x0;var _0x26b9a4=_0x115a[_0x492cf7];return _0x26b9a4;};'use strict';var _=require('lodash');var util=require(_0xa115('0x0'));var logger=require(_0xa115('0x1'))(_0xa115('0x2'));var moment=require(_0xa115('0x3'));var BPromise=require(_0xa115('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa115('0x5'));var config=require(_0xa115('0x6'));var attributes=require(_0xa115('0x7'));module['exports']=function(_0x5f2c01,_0x1952ec){return _0x5f2c01[_0xa115('0x8')](_0xa115('0x9'),attributes,{'tableName':_0xa115('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 0a1fc23..0ceed42 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 _0x49e9=['raw','where','attributes','limit','map','model','include','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','result','catch','GetMailServerIn','MailServerIn','findAll','options'];(function(_0x1cf20d,_0x31044e){var _0xe34ae7=function(_0x3e8277){while(--_0x3e8277){_0x1cf20d['push'](_0x1cf20d['shift']());}};_0xe34ae7(++_0x31044e);}(_0x49e9,0x10f));var _0x949e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x49e9[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x949e('0x0'));var util=require(_0x949e('0x1'));var moment=require('moment');var BPromise=require(_0x949e('0x2'));var rs=require(_0x949e('0x3'));var fs=require('fs');var Redis=require(_0x949e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x949e('0x5'))('rpc');var config=require(_0x949e('0x6'));var jayson=require(_0x949e('0x7'));var client=jayson[_0x949e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17f649,_0x16c669,_0xfc4f8a){return new BPromise(function(_0x34ee57,_0x40d442){return client[_0x949e('0x9')](_0x17f649,_0xfc4f8a)[_0x949e('0xa')](function(_0x56e31d){logger[_0x949e('0xb')]('MailServerIn,\x20%s,\x20%s',_0x16c669,_0x949e('0xc'));logger[_0x949e('0xd')](_0x949e('0xe'),_0x16c669,'request\x20sent',JSON[_0x949e('0xf')](_0x56e31d));if(_0x56e31d[_0x949e('0x10')]){if(_0x56e31d[_0x949e('0x10')][_0x949e('0x11')]===0x1f4){logger[_0x949e('0x10')](_0x949e('0x12'),_0x16c669,_0x56e31d[_0x949e('0x10')][_0x949e('0x13')]);return _0x40d442(_0x56e31d[_0x949e('0x10')][_0x949e('0x13')]);}logger[_0x949e('0x10')](_0x949e('0x12'),_0x16c669,_0x56e31d[_0x949e('0x10')][_0x949e('0x13')]);return _0x34ee57(_0x56e31d[_0x949e('0x10')]['message']);}else{logger[_0x949e('0xb')](_0x949e('0x12'),_0x16c669,_0x949e('0xc'));_0x34ee57(_0x56e31d[_0x949e('0x14')]['message']);}})[_0x949e('0x15')](function(_0x441b80){logger['error'](_0x949e('0x12'),_0x16c669,_0x441b80);_0x40d442(_0x441b80);});});}exports[_0x949e('0x16')]=function(_0x43498d){var _0x868913=this;return new Promise(function(_0x20333c,_0x5caac9){return db[_0x949e('0x17')][_0x949e('0x18')]({'raw':_0x43498d[_0x949e('0x19')]?_0x43498d[_0x949e('0x19')][_0x949e('0x1a')]===undefined?!![]:![]:!![],'where':_0x43498d[_0x949e('0x19')]?_0x43498d[_0x949e('0x19')][_0x949e('0x1b')]||null:null,'attributes':_0x43498d[_0x949e('0x19')]?_0x43498d[_0x949e('0x19')][_0x949e('0x1c')]||null:null,'limit':_0x43498d[_0x949e('0x19')]?_0x43498d[_0x949e('0x19')][_0x949e('0x1d')]||null:null,'include':_0x43498d[_0x949e('0x19')]?_0x43498d[_0x949e('0x19')]['include']?_[_0x949e('0x1e')](_0x43498d[_0x949e('0x19')]['include'],function(_0x48a1d1){return{'model':db[_0x48a1d1[_0x949e('0x1f')]],'as':_0x48a1d1['as'],'attributes':_0x48a1d1[_0x949e('0x1c')],'include':_0x48a1d1[_0x949e('0x20')]?_[_0x949e('0x1e')](_0x48a1d1[_0x949e('0x20')],function(_0x1185b3){return{'model':db[_0x1185b3[_0x949e('0x1f')]],'as':_0x1185b3['as'],'attributes':_0x1185b3[_0x949e('0x1c')],'include':_0x1185b3[_0x949e('0x20')]?_[_0x949e('0x1e')](_0x1185b3['include'],function(_0x212224){return{'model':db[_0x212224[_0x949e('0x1f')]],'as':_0x212224['as'],'attributes':_0x212224['attributes']};}):[]};}):[]};}):[]:[]})[_0x949e('0xa')](function(_0x20061d){logger['info'](_0x949e('0x16'),_0x43498d);logger[_0x949e('0xd')]('GetMailServerIn',_0x43498d,JSON[_0x949e('0xf')](_0x20061d));_0x20333c(_0x20061d);})['catch'](function(_0x5e6e34){logger[_0x949e('0x10')]('GetMailServerIn',_0x5e6e34['message'],_0x43498d);_0x5caac9(_0x868913[_0x949e('0x10')](0x1f4,_0x5e6e34[_0x949e('0x13')]));});});}; \ No newline at end of file +var _0xabca=['http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','model','map','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2f7e56,_0x1e2c1){var _0x446186=function(_0x2e1c32){while(--_0x2e1c32){_0x2f7e56['push'](_0x2f7e56['shift']());}};_0x446186(++_0x1e2c1);}(_0xabca,0x1af));var _0xaabc=function(_0x29c48e,_0x2c69bd){_0x29c48e=_0x29c48e-0x0;var _0x4f23b8=_0xabca[_0x29c48e];return _0x4f23b8;};'use strict';var _=require(_0xaabc('0x0'));var util=require(_0xaabc('0x1'));var moment=require('moment');var BPromise=require(_0xaabc('0x2'));var rs=require(_0xaabc('0x3'));var fs=require('fs');var Redis=require(_0xaabc('0x4'));var db=require(_0xaabc('0x5'))['db'];var utils=require(_0xaabc('0x6'));var logger=require(_0xaabc('0x7'))(_0xaabc('0x8'));var config=require(_0xaabc('0x9'));var jayson=require(_0xaabc('0xa'));var client=jayson['client'][_0xaabc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4cac60,_0x242da8,_0x4ff283){return new BPromise(function(_0x55f81d,_0x564a39){return client[_0xaabc('0xc')](_0x4cac60,_0x4ff283)[_0xaabc('0xd')](function(_0xd751aa){logger[_0xaabc('0xe')](_0xaabc('0xf'),_0x242da8,_0xaabc('0x10'));logger[_0xaabc('0x11')](_0xaabc('0x12'),_0x242da8,_0xaabc('0x10'),JSON[_0xaabc('0x13')](_0xd751aa));if(_0xd751aa['error']){if(_0xd751aa[_0xaabc('0x14')]['code']===0x1f4){logger['error']('MailServerIn,\x20%s,\x20%s',_0x242da8,_0xd751aa['error']['message']);return _0x564a39(_0xd751aa[_0xaabc('0x14')][_0xaabc('0x15')]);}logger[_0xaabc('0x14')](_0xaabc('0xf'),_0x242da8,_0xd751aa['error'][_0xaabc('0x15')]);return _0x55f81d(_0xd751aa[_0xaabc('0x14')]['message']);}else{logger['info'](_0xaabc('0xf'),_0x242da8,_0xaabc('0x10'));_0x55f81d(_0xd751aa['result']['message']);}})[_0xaabc('0x16')](function(_0x2e40b0){logger['error'](_0xaabc('0xf'),_0x242da8,_0x2e40b0);_0x564a39(_0x2e40b0);});});}exports[_0xaabc('0x17')]=function(_0xc1280e){var _0x4c48d1=this;return new Promise(function(_0x35e2d7,_0x42e4fc){return db[_0xaabc('0x18')][_0xaabc('0x19')]({'raw':_0xc1280e[_0xaabc('0x1a')]?_0xc1280e[_0xaabc('0x1a')][_0xaabc('0x1b')]===undefined?!![]:![]:!![],'where':_0xc1280e[_0xaabc('0x1a')]?_0xc1280e[_0xaabc('0x1a')][_0xaabc('0x1c')]||null:null,'attributes':_0xc1280e[_0xaabc('0x1a')]?_0xc1280e['options'][_0xaabc('0x1d')]||null:null,'limit':_0xc1280e['options']?_0xc1280e['options'][_0xaabc('0x1e')]||null:null,'include':_0xc1280e[_0xaabc('0x1a')]?_0xc1280e[_0xaabc('0x1a')][_0xaabc('0x1f')]?_['map'](_0xc1280e['options']['include'],function(_0xe88a58){return{'model':db[_0xe88a58[_0xaabc('0x20')]],'as':_0xe88a58['as'],'attributes':_0xe88a58[_0xaabc('0x1d')],'include':_0xe88a58[_0xaabc('0x1f')]?_['map'](_0xe88a58[_0xaabc('0x1f')],function(_0x76460a){return{'model':db[_0x76460a[_0xaabc('0x20')]],'as':_0x76460a['as'],'attributes':_0x76460a[_0xaabc('0x1d')],'include':_0x76460a['include']?_[_0xaabc('0x21')](_0x76460a[_0xaabc('0x1f')],function(_0xa73fc7){return{'model':db[_0xa73fc7[_0xaabc('0x20')]],'as':_0xa73fc7['as'],'attributes':_0xa73fc7[_0xaabc('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xaabc('0xd')](function(_0x30d5e7){logger[_0xaabc('0xe')](_0xaabc('0x17'),_0xc1280e);logger['debug'](_0xaabc('0x17'),_0xc1280e,JSON[_0xaabc('0x13')](_0x30d5e7));_0x35e2d7(_0x30d5e7);})[_0xaabc('0x16')](function(_0x18c1c5){logger['error'](_0xaabc('0x17'),_0x18c1c5[_0xaabc('0x15')],_0xc1280e);_0x42e4fc(_0x4c48d1[_0xaabc('0x14')](0x1f4,_0x18c1c5['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index c1cc622..43398bb 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x7a54,0x106));var _0x47a5=function(_0xb23ea1,_0x2b4c2f){_0xb23ea1=_0xb23ea1-0x0;var _0x537ac1=_0x7a54[_0xb23ea1];return _0x537ac1;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 10bde58..0e32041 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 _0x7334=['sequelize','exports','STRING','BOOLEAN'];(function(_0x26d6d9,_0x431cb8){var _0x1b4875=function(_0x41111f){while(--_0x41111f){_0x26d6d9['push'](_0x26d6d9['shift']());}};_0x1b4875(++_0x431cb8);}(_0x7334,0x184));var _0x4733=function(_0x566441,_0x202717){_0x566441=_0x566441-0x0;var _0x27c5b7=_0x7334[_0x566441];return _0x27c5b7;};'use strict';var Sequelize=require(_0x4733('0x0'));module[_0x4733('0x1')]={'description':{'type':Sequelize[_0x4733('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x4733('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0x4733('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x4733('0x2')]},'authentication':{'type':Sequelize[_0x4733('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x4733('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xf7b4=['STRING','BOOLEAN','sequelize'];(function(_0x3009e6,_0x4eda8d){var _0x37a649=function(_0x12b8e8){while(--_0x12b8e8){_0x3009e6['push'](_0x3009e6['shift']());}};_0x37a649(++_0x4eda8d);}(_0xf7b4,0x152));var _0x4f7b=function(_0x380307,_0x440ccd){_0x380307=_0x380307-0x0;var _0x9ea14b=_0xf7b4[_0x380307];return _0x9ea14b;};'use strict';var Sequelize=require(_0x4f7b('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x4f7b('0x1')]},'user':{'type':Sequelize[_0x4f7b('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0x4f7b('0x2')],'defaultValue':![]},'service':{'type':Sequelize[_0x4f7b('0x1')]},'authentication':{'type':Sequelize[_0x4f7b('0x2')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x4f7b('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 c7703c1..ac2c1bd 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 _0x8267=['show','keys','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','destroy','then','error','stack','name','send','index','MailServerOut','rawAttributes','type','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch'];(function(_0x4ddfdd,_0x390dc9){var _0x2be25f=function(_0x433412){while(--_0x433412){_0x4ddfdd['push'](_0x4ddfdd['shift']());}};_0x2be25f(++_0x390dc9);}(_0x8267,0x1f0));var _0x7826=function(_0x3930a7,_0x2b5476){_0x3930a7=_0x3930a7-0x0;var _0x19ff0b=_0x8267[_0x3930a7];return _0x19ff0b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7826('0x0'));var zipdir=require(_0x7826('0x1'));var jsonpatch=require(_0x7826('0x2'));var rp=require(_0x7826('0x3'));var moment=require(_0x7826('0x4'));var BPromise=require(_0x7826('0x5'));var Mustache=require('mustache');var util=require(_0x7826('0x6'));var path=require(_0x7826('0x7'));var sox=require(_0x7826('0x8'));var csv=require(_0x7826('0x9'));var ejs=require(_0x7826('0xa'));var fs=require('fs');var fs_extra=require(_0x7826('0xb'));var _=require('lodash');var squel=require(_0x7826('0xc'));var crypto=require('crypto');var jsforce=require(_0x7826('0xd'));var deskjs=require(_0x7826('0xe'));var toCsv=require(_0x7826('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7826('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7826('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7826('0x11'));var config=require(_0x7826('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x548956,_0x1eb58f){_0x1eb58f=_0x1eb58f||0xcc;return function(_0x5b2db4){if(_0x5b2db4){return _0x548956[_0x7826('0x13')](_0x1eb58f);}return _0x548956['status'](_0x1eb58f)[_0x7826('0x14')]();};}function respondWithResult(_0x2019c9,_0x48cecc){_0x48cecc=_0x48cecc||0xc8;return function(_0x42c997){if(_0x42c997){return _0x2019c9[_0x7826('0x15')](_0x48cecc)[_0x7826('0x16')](_0x42c997);}};}function respondWithFilteredResult(_0x5f23ff,_0x2a9f11){return function(_0x44dab4){if(_0x44dab4){var _0x491d20=typeof _0x2a9f11[_0x7826('0x17')]==='undefined'&&typeof _0x2a9f11[_0x7826('0x18')]===_0x7826('0x19');var _0x1cfbf1=_0x44dab4[_0x7826('0x1a')];var _0x450bae=_0x491d20?0x0:_0x2a9f11[_0x7826('0x17')];var _0xd5af3f=_0x491d20?_0x44dab4['count']:_0x2a9f11[_0x7826('0x17')]+_0x2a9f11[_0x7826('0x18')];var _0x4b04e2;if(_0xd5af3f>=_0x1cfbf1){_0xd5af3f=_0x1cfbf1;_0x4b04e2=0xc8;}else{_0x4b04e2=0xce;}_0x5f23ff[_0x7826('0x15')](_0x4b04e2);return _0x5f23ff[_0x7826('0x1b')](_0x7826('0x1c'),_0x450bae+'-'+_0xd5af3f+'/'+_0x1cfbf1)[_0x7826('0x16')](_0x44dab4);}return null;};}function patchUpdates(_0x56fc45){return function(_0x1aa3bf){try{jsonpatch['apply'](_0x1aa3bf,_0x56fc45,!![]);}catch(_0x2da00d){return BPromise[_0x7826('0x1d')](_0x2da00d);}return _0x1aa3bf['save']();};}function saveUpdates(_0x5459db,_0x5c5937){return function(_0x25b978){if(_0x25b978){return _0x25b978[_0x7826('0x1e')](_0x5459db)['then'](function(_0x43679c){return _0x43679c;});}return null;};}function removeEntity(_0x175aa1,_0x443abc){return function(_0x172bed){if(_0x172bed){return _0x172bed[_0x7826('0x1f')]()[_0x7826('0x20')](function(){_0x175aa1[_0x7826('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fa1b9,_0xc3b009){return function(_0x421221){if(!_0x421221){_0x3fa1b9['sendStatus'](0x194);}return _0x421221;};}function handleError(_0x1e7859,_0x23ed94){_0x23ed94=_0x23ed94||0x1f4;return function(_0x233ee3){logger[_0x7826('0x21')](_0x233ee3[_0x7826('0x22')]);if(_0x233ee3['name']){delete _0x233ee3[_0x7826('0x23')];}_0x1e7859[_0x7826('0x15')](_0x23ed94)[_0x7826('0x24')](_0x233ee3);};}exports[_0x7826('0x25')]=function(_0x448faa,_0x52422b){var _0x33209a={},_0x2782c7={},_0x5e1d66={'count':0x0,'rows':[]};var _0x137c22=_['map'](db[_0x7826('0x26')][_0x7826('0x27')],function(_0x2f0a61){return{'name':_0x2f0a61['fieldName'],'type':_0x2f0a61[_0x7826('0x28')][_0x7826('0x29')]};});_0x2782c7[_0x7826('0x2a')]=_[_0x7826('0x2b')](_0x137c22,_0x7826('0x23'));_0x2782c7[_0x7826('0x2c')]=_['keys'](_0x448faa[_0x7826('0x2c')]);_0x2782c7[_0x7826('0x2d')]=_['intersection'](_0x2782c7[_0x7826('0x2a')],_0x2782c7['query']);_0x33209a[_0x7826('0x2e')]=_[_0x7826('0x2f')](_0x2782c7[_0x7826('0x2a')],qs[_0x7826('0x30')](_0x448faa[_0x7826('0x2c')][_0x7826('0x30')]));_0x33209a['attributes']=_0x33209a[_0x7826('0x2e')][_0x7826('0x31')]?_0x33209a[_0x7826('0x2e')]:_0x2782c7[_0x7826('0x2a')];if(!_0x448faa['query'][_0x7826('0x32')](_0x7826('0x33'))){_0x33209a[_0x7826('0x18')]=qs[_0x7826('0x18')](_0x448faa[_0x7826('0x2c')][_0x7826('0x18')]);_0x33209a[_0x7826('0x17')]=qs[_0x7826('0x17')](_0x448faa[_0x7826('0x2c')][_0x7826('0x17')]);}_0x33209a[_0x7826('0x34')]=qs[_0x7826('0x35')](_0x448faa['query'][_0x7826('0x35')]);_0x33209a['where']=qs['filters'](_[_0x7826('0x36')](_0x448faa[_0x7826('0x2c')],_0x2782c7[_0x7826('0x2d')]),_0x137c22);if(_0x448faa[_0x7826('0x2c')][_0x7826('0x37')]){_0x33209a[_0x7826('0x38')]=_[_0x7826('0x39')](_0x33209a['where'],{'$or':_[_0x7826('0x2b')](_0x137c22,function(_0x363323){if(_0x363323[_0x7826('0x28')]!==_0x7826('0x3a')){var _0x5e13ea={};_0x5e13ea[_0x363323[_0x7826('0x23')]]={'$like':'%'+_0x448faa[_0x7826('0x2c')]['filter']+'%'};return _0x5e13ea;}})});}_0x33209a=_['merge']({},_0x33209a,_0x448faa[_0x7826('0x3b')]);var _0x20f7d3={'where':_0x33209a[_0x7826('0x38')]};return db[_0x7826('0x26')]['count'](_0x20f7d3)[_0x7826('0x20')](function(_0x4e159c){_0x5e1d66[_0x7826('0x1a')]=_0x4e159c;if(_0x448faa[_0x7826('0x2c')][_0x7826('0x3c')]){_0x33209a[_0x7826('0x3d')]=[{'all':!![]}];}return db[_0x7826('0x26')]['findAll'](_0x33209a);})[_0x7826('0x20')](function(_0x3078be){_0x5e1d66[_0x7826('0x3e')]=_0x3078be;return _0x5e1d66;})[_0x7826('0x20')](respondWithFilteredResult(_0x52422b,_0x33209a))[_0x7826('0x3f')](handleError(_0x52422b,null));};exports[_0x7826('0x40')]=function(_0x692f09,_0x1c132f){var _0x13071a={'raw':!![],'where':{'id':_0x692f09['params']['id']}},_0x38cad0={};_0x38cad0[_0x7826('0x2a')]=_[_0x7826('0x41')](db[_0x7826('0x26')]['rawAttributes']);_0x38cad0[_0x7826('0x2c')]=_[_0x7826('0x41')](_0x692f09[_0x7826('0x2c')]);_0x38cad0['filters']=_[_0x7826('0x2f')](_0x38cad0['model'],_0x38cad0[_0x7826('0x2c')]);_0x13071a[_0x7826('0x2e')]=_[_0x7826('0x2f')](_0x38cad0[_0x7826('0x2a')],qs[_0x7826('0x30')](_0x692f09[_0x7826('0x2c')][_0x7826('0x30')]));_0x13071a[_0x7826('0x2e')]=_0x13071a[_0x7826('0x2e')][_0x7826('0x31')]?_0x13071a[_0x7826('0x2e')]:_0x38cad0[_0x7826('0x2a')];if(_0x692f09['query'][_0x7826('0x3c')]){_0x13071a['include']=[{'all':!![]}];}_0x13071a=_[_0x7826('0x39')]({},_0x13071a,_0x692f09[_0x7826('0x3b')]);return db[_0x7826('0x26')][_0x7826('0x42')](_0x13071a)['then'](handleEntityNotFound(_0x1c132f,null))['then'](respondWithResult(_0x1c132f,null))[_0x7826('0x3f')](handleError(_0x1c132f,null));};exports[_0x7826('0x43')]=function(_0x1109d2,_0x1668ba){return db['MailServerOut'][_0x7826('0x43')](_0x1109d2['body'],{})[_0x7826('0x20')](respondWithResult(_0x1668ba,0xc9))[_0x7826('0x3f')](handleError(_0x1668ba,null));};exports[_0x7826('0x1e')]=function(_0xc96499,_0x3f5c7d){if(_0xc96499[_0x7826('0x44')]['id']){delete _0xc96499[_0x7826('0x44')]['id'];}return db[_0x7826('0x26')][_0x7826('0x42')]({'where':{'id':_0xc96499[_0x7826('0x45')]['id']}})[_0x7826('0x20')](handleEntityNotFound(_0x3f5c7d,null))[_0x7826('0x20')](saveUpdates(_0xc96499[_0x7826('0x44')],null))[_0x7826('0x20')](respondWithResult(_0x3f5c7d,null))[_0x7826('0x3f')](handleError(_0x3f5c7d,null));};exports[_0x7826('0x1f')]=function(_0x3a6962,_0x2c8cb0){return db[_0x7826('0x26')][_0x7826('0x42')]({'where':{'id':_0x3a6962['params']['id']}})['then'](handleEntityNotFound(_0x2c8cb0,null))[_0x7826('0x20')](removeEntity(_0x2c8cb0,null))['catch'](handleError(_0x2c8cb0,null));}; \ No newline at end of file +var _0x1d25=['count','set','reject','save','update','destroy','then','error','stack','name','send','index','map','MailServerOut','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','include','rows','catch','show','params','fields','length','includeAll','options','create','body','find','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','fs-extra','squel','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined'];(function(_0x4d180c,_0x45c68e){var _0x49b57e=function(_0x264741){while(--_0x264741){_0x4d180c['push'](_0x4d180c['shift']());}};_0x49b57e(++_0x45c68e);}(_0x1d25,0x147));var _0x51d2=function(_0x13137e,_0x29c0f3){_0x13137e=_0x13137e-0x0;var _0x346261=_0x1d25[_0x13137e];return _0x346261;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x51d2('0x0'));var jsonpatch=require(_0x51d2('0x1'));var rp=require(_0x51d2('0x2'));var moment=require(_0x51d2('0x3'));var BPromise=require(_0x51d2('0x4'));var Mustache=require('mustache');var util=require(_0x51d2('0x5'));var path=require(_0x51d2('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x51d2('0x7'));var fs=require('fs');var fs_extra=require(_0x51d2('0x8'));var _=require('lodash');var squel=require(_0x51d2('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x51d2('0xa'));var toCsv=require(_0x51d2('0xb'));var querystring=require(_0x51d2('0xc'));var Papa=require(_0x51d2('0xd'));var Redis=require('ioredis');var authService=require(_0x51d2('0xe'));var qs=require(_0x51d2('0xf'));var as=require(_0x51d2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x51d2('0x11'))(_0x51d2('0x12'));var utils=require('../../config/utils');var config=require(_0x51d2('0x13'));var licenseUtil=require(_0x51d2('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8f0fe2,_0x58fba6){_0x58fba6=_0x58fba6||0xcc;return function(_0x52e608){if(_0x52e608){return _0x8f0fe2[_0x51d2('0x15')](_0x58fba6);}return _0x8f0fe2[_0x51d2('0x16')](_0x58fba6)[_0x51d2('0x17')]();};}function respondWithResult(_0x36e4f0,_0x106b85){_0x106b85=_0x106b85||0xc8;return function(_0x5b8423){if(_0x5b8423){return _0x36e4f0[_0x51d2('0x16')](_0x106b85)[_0x51d2('0x18')](_0x5b8423);}};}function respondWithFilteredResult(_0x1e1ab2,_0x3eacf0){return function(_0x12f2e8){if(_0x12f2e8){var _0x8db2e9=typeof _0x3eacf0[_0x51d2('0x19')]==='undefined'&&typeof _0x3eacf0[_0x51d2('0x1a')]===_0x51d2('0x1b');var _0x358794=_0x12f2e8[_0x51d2('0x1c')];var _0xdd1f29=_0x8db2e9?0x0:_0x3eacf0[_0x51d2('0x19')];var _0x5852da=_0x8db2e9?_0x12f2e8[_0x51d2('0x1c')]:_0x3eacf0[_0x51d2('0x19')]+_0x3eacf0['limit'];var _0x3cabd7;if(_0x5852da>=_0x358794){_0x5852da=_0x358794;_0x3cabd7=0xc8;}else{_0x3cabd7=0xce;}_0x1e1ab2['status'](_0x3cabd7);return _0x1e1ab2[_0x51d2('0x1d')]('Content-Range',_0xdd1f29+'-'+_0x5852da+'/'+_0x358794)[_0x51d2('0x18')](_0x12f2e8);}return null;};}function patchUpdates(_0x44cf23){return function(_0x51f5bd){try{jsonpatch['apply'](_0x51f5bd,_0x44cf23,!![]);}catch(_0x20a4d6){return BPromise[_0x51d2('0x1e')](_0x20a4d6);}return _0x51f5bd[_0x51d2('0x1f')]();};}function saveUpdates(_0x2fb5c6,_0x2f7328){return function(_0x27b911){if(_0x27b911){return _0x27b911[_0x51d2('0x20')](_0x2fb5c6)['then'](function(_0xc53279){return _0xc53279;});}return null;};}function removeEntity(_0x406c09,_0x47fca4){return function(_0x59d28e){if(_0x59d28e){return _0x59d28e[_0x51d2('0x21')]()[_0x51d2('0x22')](function(){_0x406c09['status'](0xcc)[_0x51d2('0x17')]();});}};}function handleEntityNotFound(_0x27b41c,_0x1593c9){return function(_0xb6bd50){if(!_0xb6bd50){_0x27b41c[_0x51d2('0x15')](0x194);}return _0xb6bd50;};}function handleError(_0x5a4768,_0x5c68a6){_0x5c68a6=_0x5c68a6||0x1f4;return function(_0x59b381){logger[_0x51d2('0x23')](_0x59b381[_0x51d2('0x24')]);if(_0x59b381[_0x51d2('0x25')]){delete _0x59b381['name'];}_0x5a4768[_0x51d2('0x16')](_0x5c68a6)[_0x51d2('0x26')](_0x59b381);};}exports[_0x51d2('0x27')]=function(_0x225a1c,_0x3e3b38){var _0x1ab077={},_0x3c65bf={},_0x518a4d={'count':0x0,'rows':[]};var _0x5c7f51=_[_0x51d2('0x28')](db[_0x51d2('0x29')][_0x51d2('0x2a')],function(_0x1e1774){return{'name':_0x1e1774['fieldName'],'type':_0x1e1774[_0x51d2('0x2b')][_0x51d2('0x2c')]};});_0x3c65bf[_0x51d2('0x2d')]=_[_0x51d2('0x28')](_0x5c7f51,_0x51d2('0x25'));_0x3c65bf['query']=_[_0x51d2('0x2e')](_0x225a1c[_0x51d2('0x2f')]);_0x3c65bf[_0x51d2('0x30')]=_[_0x51d2('0x31')](_0x3c65bf[_0x51d2('0x2d')],_0x3c65bf[_0x51d2('0x2f')]);_0x1ab077[_0x51d2('0x32')]=_[_0x51d2('0x31')](_0x3c65bf[_0x51d2('0x2d')],qs['fields'](_0x225a1c['query']['fields']));_0x1ab077[_0x51d2('0x32')]=_0x1ab077['attributes']['length']?_0x1ab077[_0x51d2('0x32')]:_0x3c65bf['model'];if(!_0x225a1c['query'][_0x51d2('0x33')](_0x51d2('0x34'))){_0x1ab077[_0x51d2('0x1a')]=qs[_0x51d2('0x1a')](_0x225a1c[_0x51d2('0x2f')][_0x51d2('0x1a')]);_0x1ab077[_0x51d2('0x19')]=qs[_0x51d2('0x19')](_0x225a1c[_0x51d2('0x2f')]['offset']);}_0x1ab077[_0x51d2('0x35')]=qs[_0x51d2('0x36')](_0x225a1c[_0x51d2('0x2f')][_0x51d2('0x36')]);_0x1ab077['where']=qs[_0x51d2('0x30')](_[_0x51d2('0x37')](_0x225a1c[_0x51d2('0x2f')],_0x3c65bf[_0x51d2('0x30')]),_0x5c7f51);if(_0x225a1c[_0x51d2('0x2f')]['filter']){_0x1ab077[_0x51d2('0x38')]=_[_0x51d2('0x39')](_0x1ab077[_0x51d2('0x38')],{'$or':_['map'](_0x5c7f51,function(_0x18e95d){if(_0x18e95d[_0x51d2('0x2b')]!=='VIRTUAL'){var _0x4a7414={};_0x4a7414[_0x18e95d[_0x51d2('0x25')]]={'$like':'%'+_0x225a1c['query'][_0x51d2('0x3a')]+'%'};return _0x4a7414;}})});}_0x1ab077=_[_0x51d2('0x39')]({},_0x1ab077,_0x225a1c['options']);var _0x4418db={'where':_0x1ab077[_0x51d2('0x38')]};return db[_0x51d2('0x29')][_0x51d2('0x1c')](_0x4418db)[_0x51d2('0x22')](function(_0x4c602a){_0x518a4d[_0x51d2('0x1c')]=_0x4c602a;if(_0x225a1c[_0x51d2('0x2f')]['includeAll']){_0x1ab077[_0x51d2('0x3b')]=[{'all':!![]}];}return db[_0x51d2('0x29')]['findAll'](_0x1ab077);})[_0x51d2('0x22')](function(_0x53f634){_0x518a4d[_0x51d2('0x3c')]=_0x53f634;return _0x518a4d;})[_0x51d2('0x22')](respondWithFilteredResult(_0x3e3b38,_0x1ab077))[_0x51d2('0x3d')](handleError(_0x3e3b38,null));};exports[_0x51d2('0x3e')]=function(_0x715641,_0x3e052e){var _0x5d7b7f={'raw':!![],'where':{'id':_0x715641[_0x51d2('0x3f')]['id']}},_0x51d445={};_0x51d445[_0x51d2('0x2d')]=_[_0x51d2('0x2e')](db[_0x51d2('0x29')][_0x51d2('0x2a')]);_0x51d445[_0x51d2('0x2f')]=_[_0x51d2('0x2e')](_0x715641[_0x51d2('0x2f')]);_0x51d445[_0x51d2('0x30')]=_[_0x51d2('0x31')](_0x51d445['model'],_0x51d445['query']);_0x5d7b7f['attributes']=_[_0x51d2('0x31')](_0x51d445[_0x51d2('0x2d')],qs[_0x51d2('0x40')](_0x715641[_0x51d2('0x2f')][_0x51d2('0x40')]));_0x5d7b7f['attributes']=_0x5d7b7f[_0x51d2('0x32')][_0x51d2('0x41')]?_0x5d7b7f[_0x51d2('0x32')]:_0x51d445['model'];if(_0x715641['query'][_0x51d2('0x42')]){_0x5d7b7f[_0x51d2('0x3b')]=[{'all':!![]}];}_0x5d7b7f=_['merge']({},_0x5d7b7f,_0x715641[_0x51d2('0x43')]);return db[_0x51d2('0x29')]['find'](_0x5d7b7f)[_0x51d2('0x22')](handleEntityNotFound(_0x3e052e,null))['then'](respondWithResult(_0x3e052e,null))['catch'](handleError(_0x3e052e,null));};exports[_0x51d2('0x44')]=function(_0x395e66,_0x21fd73){return db[_0x51d2('0x29')][_0x51d2('0x44')](_0x395e66[_0x51d2('0x45')],{})[_0x51d2('0x22')](respondWithResult(_0x21fd73,0xc9))[_0x51d2('0x3d')](handleError(_0x21fd73,null));};exports[_0x51d2('0x20')]=function(_0x7be4fc,_0x1a11d9){if(_0x7be4fc[_0x51d2('0x45')]['id']){delete _0x7be4fc['body']['id'];}return db[_0x51d2('0x29')]['find']({'where':{'id':_0x7be4fc['params']['id']}})['then'](handleEntityNotFound(_0x1a11d9,null))[_0x51d2('0x22')](saveUpdates(_0x7be4fc[_0x51d2('0x45')],null))[_0x51d2('0x22')](respondWithResult(_0x1a11d9,null))[_0x51d2('0x3d')](handleError(_0x1a11d9,null));};exports[_0x51d2('0x21')]=function(_0x5810da,_0x35f4ae){return db[_0x51d2('0x29')][_0x51d2('0x46')]({'where':{'id':_0x5810da[_0x51d2('0x3f')]['id']}})[_0x51d2('0x22')](handleEntityNotFound(_0x35f4ae,null))[_0x51d2('0x22')](removeEntity(_0x35f4ae,null))[_0x51d2('0x3d')](handleError(_0x35f4ae,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 360b7a9..5014195 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 _0xd2e4=['moment','bluebird','request-promise','rimraf','../../config/environment','./mailServerOut.attributes','define','mail_servers_out','util','api'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd2e4,0x80));var _0x4d2e=function(_0xde1fb9,_0x13adc7){_0xde1fb9=_0xde1fb9-0x0;var _0x215755=_0xd2e4[_0xde1fb9];return _0x215755;};'use strict';var _=require('lodash');var util=require(_0x4d2e('0x0'));var logger=require('../../config/logger')(_0x4d2e('0x1'));var moment=require(_0x4d2e('0x2'));var BPromise=require(_0x4d2e('0x3'));var rp=require(_0x4d2e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4d2e('0x5'));var config=require(_0x4d2e('0x6'));var attributes=require(_0x4d2e('0x7'));module['exports']=function(_0xfeeee0,_0x1a20fc){return _0xfeeee0[_0x4d2e('0x8')]('MailServerOut',attributes,{'tableName':_0x4d2e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb867=['path','./mailServerOut.attributes','exports','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xe0756e,_0x1932f5){var _0x265f67=function(_0x7c5815){while(--_0x7c5815){_0xe0756e['push'](_0xe0756e['shift']());}};_0x265f67(++_0x1932f5);}(_0xb867,0x191));var _0x7b86=function(_0x5619ce,_0x54b84a){_0x5619ce=_0x5619ce-0x0;var _0x1ce769=_0xb867[_0x5619ce];return _0x1ce769;};'use strict';var _=require(_0x7b86('0x0'));var util=require(_0x7b86('0x1'));var logger=require(_0x7b86('0x2'))(_0x7b86('0x3'));var moment=require(_0x7b86('0x4'));var BPromise=require(_0x7b86('0x5'));var rp=require(_0x7b86('0x6'));var fs=require('fs');var path=require(_0x7b86('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7b86('0x8'));module[_0x7b86('0x9')]=function(_0xaf96ab,_0x38b773){return _0xaf96ab['define'](_0x7b86('0xa'),attributes,{'tableName':_0x7b86('0xb'),'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 eca4c4d..e2d8110 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x3bc82d,_0x59187f){var _0x2cfb3d=function(_0x515ac3){while(--_0x515ac3){_0x3bc82d['push'](_0x3bc82d['shift']());}};_0x2cfb3d(++_0x59187f);}(_0x2ef3,0xba));var _0x32ef=function(_0x4ba607,_0x6d4b){_0x4ba607=_0x4ba607-0x0;var _0x54f9ce=_0x2ef3[_0x4ba607];return _0x54f9ce;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x258ceb,_0x50a40b){var _0x3257fe=function(_0x43c328){while(--_0x43c328){_0x258ceb['push'](_0x258ceb['shift']());}};_0x3257fe(++_0x50a40b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1b6c76,_0x1d2317){_0x1b6c76=_0x1b6c76-0x0;var _0x385778=_0x5f2f[_0x1b6c76];return _0x385778;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index c69ffd0..f1f6a89 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 _0x675c=['Router','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','isAuthenticated','index','get','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x675c,0x10f));var _0xc675=function(_0x39a3f3,_0x3e2de1){_0x39a3f3=_0x39a3f3-0x0;var _0x3792c4=_0x675c[_0x39a3f3];return _0x3792c4;};'use strict';var multer=require(_0xc675('0x0'));var util=require(_0xc675('0x1'));var path=require(_0xc675('0x2'));var timeout=require(_0xc675('0x3'));var express=require(_0xc675('0x4'));var router=express[_0xc675('0x5')]();var fs_extra=require(_0xc675('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc675('0x7'));var config=require(_0xc675('0x8'));var controller=require(_0xc675('0x9'));router['get']('/',auth[_0xc675('0xa')](),controller[_0xc675('0xb')]);router[_0xc675('0xc')]('/describe',auth['isAuthenticated'](),controller[_0xc675('0xd')]);router[_0xc675('0xc')](_0xc675('0xe'),auth[_0xc675('0xa')](),controller[_0xc675('0xf')]);router[_0xc675('0x10')]('/',auth[_0xc675('0xa')](),controller[_0xc675('0x11')]);router[_0xc675('0x12')](_0xc675('0xe'),auth[_0xc675('0xa')](),controller[_0xc675('0x13')]);router[_0xc675('0x14')](_0xc675('0xe'),auth[_0xc675('0xa')](),controller[_0xc675('0x15')]);module[_0xc675('0x16')]=router; \ No newline at end of file +var _0x718e=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','exports','multer','util','path','express','Router'];(function(_0x38bac8,_0x296b3b){var _0x242e4e=function(_0x26b185){while(--_0x26b185){_0x38bac8['push'](_0x38bac8['shift']());}};_0x242e4e(++_0x296b3b);}(_0x718e,0x121));var _0xe718=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x718e[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0xe718('0x0'));var util=require(_0xe718('0x1'));var path=require(_0xe718('0x2'));var timeout=require('connect-timeout');var express=require(_0xe718('0x3'));var router=express[_0xe718('0x4')]();var fs_extra=require(_0xe718('0x5'));var auth=require(_0xe718('0x6'));var interaction=require(_0xe718('0x7'));var config=require(_0xe718('0x8'));var controller=require(_0xe718('0x9'));router[_0xe718('0xa')]('/',auth[_0xe718('0xb')](),controller[_0xe718('0xc')]);router[_0xe718('0xa')](_0xe718('0xd'),auth[_0xe718('0xb')](),controller[_0xe718('0xe')]);router[_0xe718('0xa')](_0xe718('0xf'),auth[_0xe718('0xb')](),controller[_0xe718('0x10')]);router[_0xe718('0x11')]('/',auth[_0xe718('0xb')](),controller['create']);router['put']('/:id',auth[_0xe718('0xb')](),controller[_0xe718('0x12')]);router[_0xe718('0x13')]('/:id',auth[_0xe718('0xb')](),controller['destroy']);module[_0xe718('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 190a8c2..3a3548b 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 _0xb934=['exports','STRING','sequelize'];(function(_0x22f345,_0x310e5b){var _0x391164=function(_0x373ddb){while(--_0x373ddb){_0x22f345['push'](_0x22f345['shift']());}};_0x391164(++_0x310e5b);}(_0xb934,0x92));var _0x4b93=function(_0x1001b8,_0x1844f3){_0x1001b8=_0x1001b8-0x0;var _0x2f5e67=_0xb934[_0x1001b8];return _0x2f5e67;};'use strict';var Sequelize=require(_0x4b93('0x0'));module[_0x4b93('0x1')]={'name':{'type':Sequelize[_0x4b93('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4b93('0x2')]}}; \ No newline at end of file +var _0x13f5=['exports','STRING','name','sequelize'];(function(_0x46f025,_0x4d0e03){var _0x437770=function(_0x12baff){while(--_0x12baff){_0x46f025['push'](_0x46f025['shift']());}};_0x437770(++_0x4d0e03);}(_0x13f5,0xc3));var _0x513f=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x13f5[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require(_0x513f('0x0'));module[_0x513f('0x1')]={'name':{'type':Sequelize[_0x513f('0x2')],'unique':_0x513f('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 4d64a61..cc276ef 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 _0x4388=['options','includeAll','include','findAll','rows','catch','show','params','create','body','update','find','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','then','destroy','sendStatus','stack','name','send','map','MailSubstatus','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x54a5f5,_0x4c1855){var _0x1d17d=function(_0x4fefe3){while(--_0x4fefe3){_0x54a5f5['push'](_0x54a5f5['shift']());}};_0x1d17d(++_0x4c1855);}(_0x4388,0x184));var _0x8438=function(_0x5d588c,_0x3232a0){_0x5d588c=_0x5d588c-0x0;var _0x148140=_0x4388[_0x5d588c];return _0x148140;};'use strict';var emlformat=require(_0x8438('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8438('0x1'));var rp=require(_0x8438('0x2'));var moment=require(_0x8438('0x3'));var BPromise=require(_0x8438('0x4'));var Mustache=require('mustache');var util=require(_0x8438('0x5'));var path=require(_0x8438('0x6'));var sox=require(_0x8438('0x7'));var csv=require(_0x8438('0x8'));var ejs=require(_0x8438('0x9'));var fs=require('fs');var fs_extra=require(_0x8438('0xa'));var _=require('lodash');var squel=require(_0x8438('0xb'));var crypto=require(_0x8438('0xc'));var jsforce=require(_0x8438('0xd'));var deskjs=require(_0x8438('0xe'));var toCsv=require(_0x8438('0x8'));var querystring=require('querystring');var Papa=require(_0x8438('0xf'));var Redis=require(_0x8438('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8438('0x11'));var as=require(_0x8438('0x12'));var hardwareService=require(_0x8438('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x8438('0x14'));var config=require(_0x8438('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8438('0x16'))['db'];function respondWithStatusCode(_0x379a4c,_0x5240be){_0x5240be=_0x5240be||0xcc;return function(_0x4eb5fd){if(_0x4eb5fd){return _0x379a4c['sendStatus'](_0x5240be);}return _0x379a4c[_0x8438('0x17')](_0x5240be)[_0x8438('0x18')]();};}function respondWithResult(_0x477abb,_0x37b769){_0x37b769=_0x37b769||0xc8;return function(_0x36e005){if(_0x36e005){return _0x477abb[_0x8438('0x17')](_0x37b769)[_0x8438('0x19')](_0x36e005);}};}function respondWithFilteredResult(_0x517fa8,_0xd2d843){return function(_0xb16606){if(_0xb16606){var _0x4c6bfa=typeof _0xd2d843[_0x8438('0x1a')]===_0x8438('0x1b')&&typeof _0xd2d843['limit']===_0x8438('0x1b');var _0x16dba1=_0xb16606[_0x8438('0x1c')];var _0x2d72a9=_0x4c6bfa?0x0:_0xd2d843[_0x8438('0x1a')];var _0x4f4f47=_0x4c6bfa?_0xb16606[_0x8438('0x1c')]:_0xd2d843[_0x8438('0x1a')]+_0xd2d843[_0x8438('0x1d')];var _0x2981d3;if(_0x4f4f47>=_0x16dba1){_0x4f4f47=_0x16dba1;_0x2981d3=0xc8;}else{_0x2981d3=0xce;}_0x517fa8[_0x8438('0x17')](_0x2981d3);return _0x517fa8[_0x8438('0x1e')](_0x8438('0x1f'),_0x2d72a9+'-'+_0x4f4f47+'/'+_0x16dba1)[_0x8438('0x19')](_0xb16606);}return null;};}function patchUpdates(_0x257b3c){return function(_0x2372e2){try{jsonpatch['apply'](_0x2372e2,_0x257b3c,!![]);}catch(_0x5029ce){return BPromise[_0x8438('0x20')](_0x5029ce);}return _0x2372e2[_0x8438('0x21')]();};}function saveUpdates(_0x45c41b,_0x315d52){return function(_0x3ba4a4){if(_0x3ba4a4){return _0x3ba4a4['update'](_0x45c41b)[_0x8438('0x22')](function(_0x1b639e){return _0x1b639e;});}return null;};}function removeEntity(_0x311759,_0x858114){return function(_0x873ce4){if(_0x873ce4){return _0x873ce4[_0x8438('0x23')]()['then'](function(){_0x311759['status'](0xcc)[_0x8438('0x18')]();});}};}function handleEntityNotFound(_0x7c830f,_0x1fce42){return function(_0x2ea1e6){if(!_0x2ea1e6){_0x7c830f[_0x8438('0x24')](0x194);}return _0x2ea1e6;};}function handleError(_0x318240,_0x483d0d){_0x483d0d=_0x483d0d||0x1f4;return function(_0x43ead3){logger['error'](_0x43ead3[_0x8438('0x25')]);if(_0x43ead3[_0x8438('0x26')]){delete _0x43ead3['name'];}_0x318240['status'](_0x483d0d)[_0x8438('0x27')](_0x43ead3);};}exports['index']=function(_0x25b636,_0x48a08c){var _0xce761e={},_0x3bfa43={},_0x13095f={'count':0x0,'rows':[]};var _0x45b5c6=_[_0x8438('0x28')](db[_0x8438('0x29')][_0x8438('0x2a')],function(_0x24e5cb){return{'name':_0x24e5cb[_0x8438('0x2b')],'type':_0x24e5cb[_0x8438('0x2c')][_0x8438('0x2d')]};});_0x3bfa43['model']=_[_0x8438('0x28')](_0x45b5c6,_0x8438('0x26'));_0x3bfa43[_0x8438('0x2e')]=_[_0x8438('0x2f')](_0x25b636['query']);_0x3bfa43[_0x8438('0x30')]=_[_0x8438('0x31')](_0x3bfa43[_0x8438('0x32')],_0x3bfa43[_0x8438('0x2e')]);_0xce761e['attributes']=_[_0x8438('0x31')](_0x3bfa43[_0x8438('0x32')],qs[_0x8438('0x33')](_0x25b636[_0x8438('0x2e')]['fields']));_0xce761e[_0x8438('0x34')]=_0xce761e[_0x8438('0x34')][_0x8438('0x35')]?_0xce761e[_0x8438('0x34')]:_0x3bfa43[_0x8438('0x32')];if(!_0x25b636[_0x8438('0x2e')][_0x8438('0x36')]('nolimit')){_0xce761e[_0x8438('0x1d')]=qs['limit'](_0x25b636[_0x8438('0x2e')]['limit']);_0xce761e[_0x8438('0x1a')]=qs[_0x8438('0x1a')](_0x25b636[_0x8438('0x2e')]['offset']);}_0xce761e[_0x8438('0x37')]=qs[_0x8438('0x38')](_0x25b636[_0x8438('0x2e')][_0x8438('0x38')]);_0xce761e[_0x8438('0x39')]=qs[_0x8438('0x30')](_[_0x8438('0x3a')](_0x25b636[_0x8438('0x2e')],_0x3bfa43['filters']),_0x45b5c6);if(_0x25b636[_0x8438('0x2e')][_0x8438('0x3b')]){_0xce761e['where']=_[_0x8438('0x3c')](_0xce761e[_0x8438('0x39')],{'$or':_[_0x8438('0x28')](_0x45b5c6,function(_0x329306){if(_0x329306[_0x8438('0x2c')]!==_0x8438('0x3d')){var _0x35797f={};_0x35797f[_0x329306[_0x8438('0x26')]]={'$like':'%'+_0x25b636[_0x8438('0x2e')][_0x8438('0x3b')]+'%'};return _0x35797f;}})});}_0xce761e=_[_0x8438('0x3c')]({},_0xce761e,_0x25b636[_0x8438('0x3e')]);var _0x28c0f8={'where':_0xce761e[_0x8438('0x39')]};return db[_0x8438('0x29')][_0x8438('0x1c')](_0x28c0f8)['then'](function(_0x282c8d){_0x13095f[_0x8438('0x1c')]=_0x282c8d;if(_0x25b636[_0x8438('0x2e')][_0x8438('0x3f')]){_0xce761e[_0x8438('0x40')]=[{'all':!![]}];}return db[_0x8438('0x29')][_0x8438('0x41')](_0xce761e);})[_0x8438('0x22')](function(_0x1fbfae){_0x13095f[_0x8438('0x42')]=_0x1fbfae;return _0x13095f;})['then'](respondWithFilteredResult(_0x48a08c,_0xce761e))[_0x8438('0x43')](handleError(_0x48a08c,null));};exports[_0x8438('0x44')]=function(_0x39e6da,_0x32c876){var _0x3d54b5={'raw':!![],'where':{'id':_0x39e6da[_0x8438('0x45')]['id']}},_0x55858d={};_0x55858d[_0x8438('0x32')]=_[_0x8438('0x2f')](db['MailSubstatus'][_0x8438('0x2a')]);_0x55858d[_0x8438('0x2e')]=_['keys'](_0x39e6da['query']);_0x55858d[_0x8438('0x30')]=_[_0x8438('0x31')](_0x55858d[_0x8438('0x32')],_0x55858d['query']);_0x3d54b5['attributes']=_[_0x8438('0x31')](_0x55858d[_0x8438('0x32')],qs['fields'](_0x39e6da[_0x8438('0x2e')][_0x8438('0x33')]));_0x3d54b5[_0x8438('0x34')]=_0x3d54b5[_0x8438('0x34')]['length']?_0x3d54b5['attributes']:_0x55858d[_0x8438('0x32')];if(_0x39e6da[_0x8438('0x2e')][_0x8438('0x3f')]){_0x3d54b5['include']=[{'all':!![]}];}_0x3d54b5=_[_0x8438('0x3c')]({},_0x3d54b5,_0x39e6da[_0x8438('0x3e')]);return db[_0x8438('0x29')]['find'](_0x3d54b5)[_0x8438('0x22')](handleEntityNotFound(_0x32c876,null))['then'](respondWithResult(_0x32c876,null))['catch'](handleError(_0x32c876,null));};exports[_0x8438('0x46')]=function(_0x5f2dda,_0x317b4b){return db[_0x8438('0x29')][_0x8438('0x46')](_0x5f2dda[_0x8438('0x47')],{})[_0x8438('0x22')](respondWithResult(_0x317b4b,0xc9))[_0x8438('0x43')](handleError(_0x317b4b,null));};exports[_0x8438('0x48')]=function(_0x3b8073,_0x283b08){if(_0x3b8073['body']['id']){delete _0x3b8073[_0x8438('0x47')]['id'];}return db['MailSubstatus'][_0x8438('0x49')]({'where':{'id':_0x3b8073['params']['id']}})[_0x8438('0x22')](handleEntityNotFound(_0x283b08,null))[_0x8438('0x22')](saveUpdates(_0x3b8073[_0x8438('0x47')],null))[_0x8438('0x22')](respondWithResult(_0x283b08,null))[_0x8438('0x43')](handleError(_0x283b08,null));};exports['destroy']=function(_0x34af9b,_0x105b4d){return db[_0x8438('0x29')][_0x8438('0x49')]({'where':{'id':_0x34af9b[_0x8438('0x45')]['id']}})[_0x8438('0x22')](handleEntityNotFound(_0x105b4d,null))[_0x8438('0x22')](removeEntity(_0x105b4d,null))[_0x8438('0x43')](handleError(_0x105b4d,null));};exports[_0x8438('0x4a')]=function(_0x6f7fb3,_0x9ae780){return db['MailSubstatus']['describe']()['then'](respondWithResult(_0x9ae780,null))[_0x8438('0x43')](handleError(_0x9ae780,null));}; \ No newline at end of file +var _0x3de4=['body','find','destroy','describe','eml-format','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','nolimit','order','sort','pick','filter','merge','VIRTUAL','MailSubstatus','includeAll','include','findAll','rows','show','params','keys','length','options','catch','create'];(function(_0x194918,_0xd6333d){var _0x71360d=function(_0x4c2be1){while(--_0x4c2be1){_0x194918['push'](_0x194918['shift']());}};_0x71360d(++_0xd6333d);}(_0x3de4,0x17b));var _0x43de=function(_0xc56fd0,_0x4b2aeb){_0xc56fd0=_0xc56fd0-0x0;var _0x6f19d1=_0x3de4[_0xc56fd0];return _0x6f19d1;};'use strict';var emlformat=require(_0x43de('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x43de('0x1'));var rp=require('request-promise');var moment=require(_0x43de('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x43de('0x3'));var util=require(_0x43de('0x4'));var path=require(_0x43de('0x5'));var sox=require(_0x43de('0x6'));var csv=require(_0x43de('0x7'));var ejs=require(_0x43de('0x8'));var fs=require('fs');var fs_extra=require(_0x43de('0x9'));var _=require(_0x43de('0xa'));var squel=require(_0x43de('0xb'));var crypto=require(_0x43de('0xc'));var jsforce=require(_0x43de('0xd'));var deskjs=require(_0x43de('0xe'));var toCsv=require('to-csv');var querystring=require(_0x43de('0xf'));var Papa=require(_0x43de('0x10'));var Redis=require(_0x43de('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x43de('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x43de('0x13'))(_0x43de('0x14'));var utils=require(_0x43de('0x15'));var config=require(_0x43de('0x16'));var licenseUtil=require(_0x43de('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x327b36,_0x37a8ca){_0x37a8ca=_0x37a8ca||0xcc;return function(_0x4dd176){if(_0x4dd176){return _0x327b36[_0x43de('0x18')](_0x37a8ca);}return _0x327b36[_0x43de('0x19')](_0x37a8ca)[_0x43de('0x1a')]();};}function respondWithResult(_0x91f8a1,_0x26cc6d){_0x26cc6d=_0x26cc6d||0xc8;return function(_0x332247){if(_0x332247){return _0x91f8a1[_0x43de('0x19')](_0x26cc6d)[_0x43de('0x1b')](_0x332247);}};}function respondWithFilteredResult(_0x14b932,_0x12d143){return function(_0x49d1e0){if(_0x49d1e0){var _0x2b2ba1=typeof _0x12d143[_0x43de('0x1c')]==='undefined'&&typeof _0x12d143[_0x43de('0x1d')]===_0x43de('0x1e');var _0x142d72=_0x49d1e0[_0x43de('0x1f')];var _0x3c3e35=_0x2b2ba1?0x0:_0x12d143[_0x43de('0x1c')];var _0x331ea2=_0x2b2ba1?_0x49d1e0[_0x43de('0x1f')]:_0x12d143['offset']+_0x12d143[_0x43de('0x1d')];var _0x385db0;if(_0x331ea2>=_0x142d72){_0x331ea2=_0x142d72;_0x385db0=0xc8;}else{_0x385db0=0xce;}_0x14b932[_0x43de('0x19')](_0x385db0);return _0x14b932[_0x43de('0x20')](_0x43de('0x21'),_0x3c3e35+'-'+_0x331ea2+'/'+_0x142d72)[_0x43de('0x1b')](_0x49d1e0);}return null;};}function patchUpdates(_0x228148){return function(_0x3945c5){try{jsonpatch[_0x43de('0x22')](_0x3945c5,_0x228148,!![]);}catch(_0x3c3d81){return BPromise[_0x43de('0x23')](_0x3c3d81);}return _0x3945c5['save']();};}function saveUpdates(_0x3ea85c,_0x55e276){return function(_0x40e9f7){if(_0x40e9f7){return _0x40e9f7[_0x43de('0x24')](_0x3ea85c)[_0x43de('0x25')](function(_0x5f4017){return _0x5f4017;});}return null;};}function removeEntity(_0x51260c,_0x144633){return function(_0x569a74){if(_0x569a74){return _0x569a74['destroy']()[_0x43de('0x25')](function(){_0x51260c[_0x43de('0x19')](0xcc)[_0x43de('0x1a')]();});}};}function handleEntityNotFound(_0x908a41,_0x20e4e2){return function(_0x49b86a){if(!_0x49b86a){_0x908a41['sendStatus'](0x194);}return _0x49b86a;};}function handleError(_0x355fc6,_0x5583d7){_0x5583d7=_0x5583d7||0x1f4;return function(_0x2aa3bb){logger[_0x43de('0x26')](_0x2aa3bb[_0x43de('0x27')]);if(_0x2aa3bb[_0x43de('0x28')]){delete _0x2aa3bb[_0x43de('0x28')];}_0x355fc6[_0x43de('0x19')](_0x5583d7)['send'](_0x2aa3bb);};}exports[_0x43de('0x29')]=function(_0x380ad9,_0x23b4d9){var _0x5bee7f={},_0x5eb052={},_0x4f34df={'count':0x0,'rows':[]};var _0x17ca15=_[_0x43de('0x2a')](db['MailSubstatus'][_0x43de('0x2b')],function(_0x3c7ecc){return{'name':_0x3c7ecc[_0x43de('0x2c')],'type':_0x3c7ecc['type'][_0x43de('0x2d')]};});_0x5eb052[_0x43de('0x2e')]=_['map'](_0x17ca15,_0x43de('0x28'));_0x5eb052[_0x43de('0x2f')]=_['keys'](_0x380ad9[_0x43de('0x2f')]);_0x5eb052[_0x43de('0x30')]=_[_0x43de('0x31')](_0x5eb052[_0x43de('0x2e')],_0x5eb052[_0x43de('0x2f')]);_0x5bee7f['attributes']=_[_0x43de('0x31')](_0x5eb052['model'],qs[_0x43de('0x32')](_0x380ad9[_0x43de('0x2f')][_0x43de('0x32')]));_0x5bee7f[_0x43de('0x33')]=_0x5bee7f[_0x43de('0x33')]['length']?_0x5bee7f['attributes']:_0x5eb052[_0x43de('0x2e')];if(!_0x380ad9['query']['hasOwnProperty'](_0x43de('0x34'))){_0x5bee7f[_0x43de('0x1d')]=qs['limit'](_0x380ad9[_0x43de('0x2f')][_0x43de('0x1d')]);_0x5bee7f['offset']=qs[_0x43de('0x1c')](_0x380ad9[_0x43de('0x2f')][_0x43de('0x1c')]);}_0x5bee7f[_0x43de('0x35')]=qs[_0x43de('0x36')](_0x380ad9[_0x43de('0x2f')][_0x43de('0x36')]);_0x5bee7f['where']=qs['filters'](_[_0x43de('0x37')](_0x380ad9[_0x43de('0x2f')],_0x5eb052['filters']),_0x17ca15);if(_0x380ad9[_0x43de('0x2f')][_0x43de('0x38')]){_0x5bee7f['where']=_[_0x43de('0x39')](_0x5bee7f['where'],{'$or':_[_0x43de('0x2a')](_0x17ca15,function(_0x4bb260){if(_0x4bb260['type']!==_0x43de('0x3a')){var _0x211aeb={};_0x211aeb[_0x4bb260[_0x43de('0x28')]]={'$like':'%'+_0x380ad9[_0x43de('0x2f')][_0x43de('0x38')]+'%'};return _0x211aeb;}})});}_0x5bee7f=_[_0x43de('0x39')]({},_0x5bee7f,_0x380ad9['options']);var _0x5f3517={'where':_0x5bee7f['where']};return db[_0x43de('0x3b')]['count'](_0x5f3517)['then'](function(_0x439246){_0x4f34df[_0x43de('0x1f')]=_0x439246;if(_0x380ad9[_0x43de('0x2f')][_0x43de('0x3c')]){_0x5bee7f[_0x43de('0x3d')]=[{'all':!![]}];}return db['MailSubstatus'][_0x43de('0x3e')](_0x5bee7f);})[_0x43de('0x25')](function(_0x1c8815){_0x4f34df[_0x43de('0x3f')]=_0x1c8815;return _0x4f34df;})[_0x43de('0x25')](respondWithFilteredResult(_0x23b4d9,_0x5bee7f))['catch'](handleError(_0x23b4d9,null));};exports[_0x43de('0x40')]=function(_0x3f522a,_0x4c0b29){var _0x18ac64={'raw':!![],'where':{'id':_0x3f522a[_0x43de('0x41')]['id']}},_0x4a7d1c={};_0x4a7d1c[_0x43de('0x2e')]=_['keys'](db[_0x43de('0x3b')]['rawAttributes']);_0x4a7d1c[_0x43de('0x2f')]=_[_0x43de('0x42')](_0x3f522a[_0x43de('0x2f')]);_0x4a7d1c[_0x43de('0x30')]=_['intersection'](_0x4a7d1c[_0x43de('0x2e')],_0x4a7d1c[_0x43de('0x2f')]);_0x18ac64[_0x43de('0x33')]=_['intersection'](_0x4a7d1c[_0x43de('0x2e')],qs['fields'](_0x3f522a[_0x43de('0x2f')]['fields']));_0x18ac64[_0x43de('0x33')]=_0x18ac64[_0x43de('0x33')][_0x43de('0x43')]?_0x18ac64[_0x43de('0x33')]:_0x4a7d1c[_0x43de('0x2e')];if(_0x3f522a[_0x43de('0x2f')][_0x43de('0x3c')]){_0x18ac64[_0x43de('0x3d')]=[{'all':!![]}];}_0x18ac64=_[_0x43de('0x39')]({},_0x18ac64,_0x3f522a[_0x43de('0x44')]);return db[_0x43de('0x3b')]['find'](_0x18ac64)[_0x43de('0x25')](handleEntityNotFound(_0x4c0b29,null))[_0x43de('0x25')](respondWithResult(_0x4c0b29,null))[_0x43de('0x45')](handleError(_0x4c0b29,null));};exports['create']=function(_0x1779b2,_0x5db359){return db['MailSubstatus'][_0x43de('0x46')](_0x1779b2[_0x43de('0x47')],{})['then'](respondWithResult(_0x5db359,0xc9))['catch'](handleError(_0x5db359,null));};exports[_0x43de('0x24')]=function(_0x27ee26,_0x2a43c7){if(_0x27ee26[_0x43de('0x47')]['id']){delete _0x27ee26[_0x43de('0x47')]['id'];}return db[_0x43de('0x3b')][_0x43de('0x48')]({'where':{'id':_0x27ee26[_0x43de('0x41')]['id']}})[_0x43de('0x25')](handleEntityNotFound(_0x2a43c7,null))[_0x43de('0x25')](saveUpdates(_0x27ee26['body'],null))[_0x43de('0x25')](respondWithResult(_0x2a43c7,null))[_0x43de('0x45')](handleError(_0x2a43c7,null));};exports[_0x43de('0x49')]=function(_0xf3c14c,_0x5830b8){return db[_0x43de('0x3b')]['find']({'where':{'id':_0xf3c14c[_0x43de('0x41')]['id']}})[_0x43de('0x25')](handleEntityNotFound(_0x5830b8,null))[_0x43de('0x25')](removeEntity(_0x5830b8,null))[_0x43de('0x45')](handleError(_0x5830b8,null));};exports[_0x43de('0x4a')]=function(_0x3c6d91,_0x2804c1){return db[_0x43de('0x3b')]['describe']()[_0x43de('0x25')](respondWithResult(_0x2804c1,null))[_0x43de('0x45')](handleError(_0x2804c1,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 39e0ff7..c8f1ebe 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ae1=['setMaxListeners','update','emit','hasOwnProperty','exports','events','../../mysqldb','MailSubstatus'];(function(_0xefda82,_0x9ac512){var _0x39cdb1=function(_0x2b9e35){while(--_0x2b9e35){_0xefda82['push'](_0xefda82['shift']());}};_0x39cdb1(++_0x9ac512);}(_0x0ae1,0x1b5));var _0x10ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0ae1[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x10ae('0x0'));var MailSubstatus=require(_0x10ae('0x1'))['db'][_0x10ae('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x10ae('0x3')](0x0);var events={'afterUpdate':_0x10ae('0x4')};function emitEvent(_0x389851){return function(_0xb279bb,_0x5deb84,_0x21ecaa){MailSubstatusEvents[_0x10ae('0x5')](_0x389851+':'+_0xb279bb['id'],_0xb279bb);MailSubstatusEvents[_0x10ae('0x5')](_0x389851,_0xb279bb);_0x21ecaa(null);};}for(var e in events){if(events[_0x10ae('0x6')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0x10ae('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0xed5f=['events','MailSubstatus','update','emit'];(function(_0x1f9f91,_0xe5a45){var _0x409d8f=function(_0xe151d1){while(--_0xe151d1){_0x1f9f91['push'](_0x1f9f91['shift']());}};_0x409d8f(++_0xe5a45);}(_0xed5f,0x1c8));var _0xfed5=function(_0x2f2572,_0x26b8f0){_0x2f2572=_0x2f2572-0x0;var _0x1ef2ac=_0xed5f[_0x2f2572];return _0x1ef2ac;};'use strict';var EventEmitter=require(_0xfed5('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0xfed5('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0xfed5('0x2')};function emitEvent(_0x491307){return function(_0x678592,_0x390746,_0x3358c3){MailSubstatusEvents['emit'](_0x491307+':'+_0x678592['id'],_0x678592);MailSubstatusEvents[_0xfed5('0x3')](_0x491307,_0x678592);_0x3358c3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 1aafba2..db065b9 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 _0xc5f5=['models','define','MailSubstatus','Condition','update','name','_previousDataValues','then','./mailSubstatus.attributes','exports'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xc5f5,0xa8));var _0x5c5f=function(_0x3712e2,_0x32d752){_0x3712e2=_0x3712e2-0x0;var _0x1faff4=_0xc5f5[_0x3712e2];return _0x1faff4;};'use strict';var attributes=require(_0x5c5f('0x0'));module[_0x5c5f('0x1')]=function(_0xbcf555){var _0x1d8b5c=_0xbcf555[_0x5c5f('0x2')];return _0xbcf555[_0x5c5f('0x3')](_0x5c5f('0x4'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x4976ed,_0x49f116,_0x284583){return _0x1d8b5c[_0x5c5f('0x5')][_0x5c5f('0x6')]({'value':_0x4976ed[_0x5c5f('0x7')]},{'where':{'field':'mailSubstatus','value':_0x4976ed[_0x5c5f('0x8')][_0x5c5f('0x7')]}})[_0x5c5f('0x9')](function(){_0x284583();})['catch'](function(_0x111e60){_0x284583(_0x111e60);});}}});}; \ No newline at end of file +var _0x0bbe=['name','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses','_previousDataValues'];(function(_0x3dacec,_0x52822a){var _0x53abd4=function(_0x1ef55c){while(--_0x1ef55c){_0x3dacec['push'](_0x3dacec['shift']());}};_0x53abd4(++_0x52822a);}(_0x0bbe,0xc9));var _0xe0bb=function(_0xa11cd3,_0x3a3af1){_0xa11cd3=_0xa11cd3-0x0;var _0xa085b6=_0x0bbe[_0xa11cd3];return _0xa085b6;};'use strict';var attributes=require(_0xe0bb('0x0'));module[_0xe0bb('0x1')]=function(_0x27f54e){var _0x2920a7=_0x27f54e[_0xe0bb('0x2')];return _0x27f54e[_0xe0bb('0x3')](_0xe0bb('0x4'),attributes,{'tableName':_0xe0bb('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x36768c,_0x5ab2f3,_0x4a9ef3){return _0x2920a7['Condition']['update']({'value':_0x36768c['name']},{'where':{'field':'mailSubstatus','value':_0x36768c[_0xe0bb('0x6')][_0xe0bb('0x7')]}})['then'](function(){_0x4a9ef3();})['catch'](function(_0x53d62a){_0x4a9ef3(_0x53d62a);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index bf275ab..ec2a54a 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 _0x1b63=['info','MailSubstatus,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x47c635,_0x527895){var _0xb1e191=function(_0x1f129d){while(--_0x1f129d){_0x47c635['push'](_0x47c635['shift']());}};_0xb1e191(++_0x527895);}(_0x1b63,0x90));var _0x31b6=function(_0x4b91c4,_0x23f35f){_0x4b91c4=_0x4b91c4-0x0;var _0x25cb80=_0x1b63[_0x4b91c4];return _0x25cb80;};'use strict';var _=require('lodash');var util=require(_0x31b6('0x0'));var moment=require(_0x31b6('0x1'));var BPromise=require(_0x31b6('0x2'));var rs=require(_0x31b6('0x3'));var fs=require('fs');var Redis=require(_0x31b6('0x4'));var db=require(_0x31b6('0x5'))['db'];var utils=require(_0x31b6('0x6'));var logger=require(_0x31b6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x31b6('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xdc5d14,_0x59493d,_0x47edd9){return new BPromise(function(_0x30bd48,_0x11b472){return client['request'](_0xdc5d14,_0x47edd9)['then'](function(_0x52592e){logger[_0x31b6('0x9')](_0x31b6('0xa'),_0x59493d,_0x31b6('0xb'));logger['debug']('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x59493d,'request\x20sent',JSON[_0x31b6('0xc')](_0x52592e));if(_0x52592e[_0x31b6('0xd')]){if(_0x52592e[_0x31b6('0xd')]['code']===0x1f4){logger['error'](_0x31b6('0xa'),_0x59493d,_0x52592e[_0x31b6('0xd')][_0x31b6('0xe')]);return _0x11b472(_0x52592e[_0x31b6('0xd')][_0x31b6('0xe')]);}logger['error'](_0x31b6('0xa'),_0x59493d,_0x52592e[_0x31b6('0xd')][_0x31b6('0xe')]);return _0x30bd48(_0x52592e[_0x31b6('0xd')][_0x31b6('0xe')]);}else{logger['info'](_0x31b6('0xa'),_0x59493d,_0x31b6('0xb'));_0x30bd48(_0x52592e[_0x31b6('0xf')][_0x31b6('0xe')]);}})[_0x31b6('0x10')](function(_0x3ee8e8){logger['error'](_0x31b6('0xa'),_0x59493d,_0x3ee8e8);_0x11b472(_0x3ee8e8);});});} \ No newline at end of file +var _0x8885=['client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x287528,_0x2fbba7){var _0xc05e28=function(_0x264866){while(--_0x264866){_0x287528['push'](_0x287528['shift']());}};_0xc05e28(++_0x2fbba7);}(_0x8885,0x8b));var _0x5888=function(_0x2f5cdb,_0x2606ba){_0x2f5cdb=_0x2f5cdb-0x0;var _0x14587f=_0x8885[_0x2f5cdb];return _0x14587f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5888('0x0'));var BPromise=require('bluebird');var rs=require(_0x5888('0x1'));var fs=require('fs');var Redis=require(_0x5888('0x2'));var db=require(_0x5888('0x3'))['db'];var utils=require(_0x5888('0x4'));var logger=require(_0x5888('0x5'))(_0x5888('0x6'));var config=require(_0x5888('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5888('0x8')][_0x5888('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e5e0d,_0x2b2d23,_0x1d5ee3){return new BPromise(function(_0x18fb1a,_0x4b0073){return client[_0x5888('0xa')](_0x2e5e0d,_0x1d5ee3)[_0x5888('0xb')](function(_0x8723df){logger[_0x5888('0xc')](_0x5888('0xd'),_0x2b2d23,_0x5888('0xe'));logger[_0x5888('0xf')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x2b2d23,_0x5888('0xe'),JSON['stringify'](_0x8723df));if(_0x8723df[_0x5888('0x10')]){if(_0x8723df['error'][_0x5888('0x11')]===0x1f4){logger[_0x5888('0x10')](_0x5888('0xd'),_0x2b2d23,_0x8723df[_0x5888('0x10')][_0x5888('0x12')]);return _0x4b0073(_0x8723df[_0x5888('0x10')][_0x5888('0x12')]);}logger['error'](_0x5888('0xd'),_0x2b2d23,_0x8723df['error'][_0x5888('0x12')]);return _0x18fb1a(_0x8723df['error'][_0x5888('0x12')]);}else{logger[_0x5888('0xc')](_0x5888('0xd'),_0x2b2d23,'request\x20sent');_0x18fb1a(_0x8723df[_0x5888('0x13')][_0x5888('0x12')]);}})[_0x5888('0x14')](function(_0x5317ab){logger[_0x5888('0x10')](_0x5888('0xd'),_0x2b2d23,_0x5317ab);_0x4b0073(_0x5317ab);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 6b643c6..e132315 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 _0x43d5=['../../config/environment','./mailTransferReport.controller','get','isAuthenticated','describe','/:id','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x30a2ae,_0xfa9d8a){var _0x2f3b0d=function(_0x3d6625){while(--_0x3d6625){_0x30a2ae['push'](_0x30a2ae['shift']());}};_0x2f3b0d(++_0xfa9d8a);}(_0x43d5,0x184));var _0x543d=function(_0x15a2e4,_0x326abf){_0x15a2e4=_0x15a2e4-0x0;var _0xffaa67=_0x43d5[_0x15a2e4];return _0xffaa67;};'use strict';var multer=require(_0x543d('0x0'));var util=require(_0x543d('0x1'));var path=require(_0x543d('0x2'));var timeout=require(_0x543d('0x3'));var express=require(_0x543d('0x4'));var router=express[_0x543d('0x5')]();var fs_extra=require(_0x543d('0x6'));var auth=require(_0x543d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x543d('0x8'));var controller=require(_0x543d('0x9'));router[_0x543d('0xa')]('/',auth[_0x543d('0xb')](),controller['index']);router[_0x543d('0xa')]('/describe',auth[_0x543d('0xb')](),controller[_0x543d('0xc')]);router[_0x543d('0xa')](_0x543d('0xd'),auth[_0x543d('0xb')](),controller['show']);router['post']('/',auth[_0x543d('0xb')](),controller[_0x543d('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x543d('0xf')]);router[_0x543d('0x10')](_0x543d('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x543d('0x11')]=router; \ No newline at end of file +var _0xbf1b=['index','isAuthenticated','describe','/:id','post','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get'];(function(_0x519756,_0x288785){var _0x37047e=function(_0x3d64a7){while(--_0x3d64a7){_0x519756['push'](_0x519756['shift']());}};_0x37047e(++_0x288785);}(_0xbf1b,0x190));var _0xbbf1=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xbf1b[_0x5f0089];return _0x193892;};'use strict';var multer=require('multer');var util=require(_0xbbf1('0x0'));var path=require(_0xbbf1('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xbbf1('0x2'));var auth=require(_0xbbf1('0x3'));var interaction=require(_0xbbf1('0x4'));var config=require(_0xbbf1('0x5'));var controller=require(_0xbbf1('0x6'));router[_0xbbf1('0x7')]('/',auth['isAuthenticated'](),controller[_0xbbf1('0x8')]);router['get']('/describe',auth[_0xbbf1('0x9')](),controller[_0xbbf1('0xa')]);router[_0xbbf1('0x7')](_0xbbf1('0xb'),auth[_0xbbf1('0x9')](),controller['show']);router[_0xbbf1('0xc')]('/',auth[_0xbbf1('0x9')](),controller['create']);router['put'](_0xbbf1('0xb'),auth[_0xbbf1('0x9')](),controller[_0xbbf1('0xd')]);router[_0xbbf1('0xe')](_0xbbf1('0xb'),auth['isAuthenticated'](),controller[_0xbbf1('0xf')]);module[_0xbbf1('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index f788830..dddbc01 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x40e681,_0x39999a){var _0x8528d2=function(_0x42ba6f){while(--_0x42ba6f){_0x40e681['push'](_0x40e681['shift']());}};_0x8528d2(++_0x39999a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'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 +var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x53a11c,_0x393441){var _0x2680d5=function(_0xd3d1e2){while(--_0xd3d1e2){_0x53a11c['push'](_0x53a11c['shift']());}};_0x2680d5(++_0x393441);}(_0x54ef,0x112));var _0xf54e=function(_0xdd115a,_0xe45d3c){_0xdd115a=_0xdd115a-0x0;var _0x13a9b9=_0x54ef[_0xdd115a];return _0x13a9b9;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 759f92c..ff40a34 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 _0xba53=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','save','then','destroy','error','stack','name','index','map','MailTransferReport','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','show','rawAttributes','includeAll','find','catch','update','body','params','describe','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x338775,_0x18d242){var _0x41394d=function(_0x348bca){while(--_0x348bca){_0x338775['push'](_0x338775['shift']());}};_0x41394d(++_0x18d242);}(_0xba53,0x1a8));var _0x3ba5=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xba53[_0xc4001c];return _0x49f7bc;};'use strict';var emlformat=require(_0x3ba5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3ba5('0x1'));var BPromise=require(_0x3ba5('0x2'));var Mustache=require(_0x3ba5('0x3'));var util=require(_0x3ba5('0x4'));var path=require(_0x3ba5('0x5'));var sox=require(_0x3ba5('0x6'));var csv=require(_0x3ba5('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3ba5('0x8'));var _=require(_0x3ba5('0x9'));var squel=require(_0x3ba5('0xa'));var crypto=require('crypto');var jsforce=require(_0x3ba5('0xb'));var deskjs=require(_0x3ba5('0xc'));var toCsv=require(_0x3ba5('0x7'));var querystring=require(_0x3ba5('0xd'));var Papa=require(_0x3ba5('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3ba5('0xf'));var as=require(_0x3ba5('0x10'));var hardwareService=require(_0x3ba5('0x11'));var logger=require(_0x3ba5('0x12'))(_0x3ba5('0x13'));var utils=require(_0x3ba5('0x14'));var config=require(_0x3ba5('0x15'));var licenseUtil=require(_0x3ba5('0x16'));var db=require(_0x3ba5('0x17'))['db'];function respondWithStatusCode(_0x37b72a,_0x1d31f3){_0x1d31f3=_0x1d31f3||0xcc;return function(_0x20a657){if(_0x20a657){return _0x37b72a[_0x3ba5('0x18')](_0x1d31f3);}return _0x37b72a[_0x3ba5('0x19')](_0x1d31f3)[_0x3ba5('0x1a')]();};}function respondWithResult(_0x2ea504,_0x4e84b1){_0x4e84b1=_0x4e84b1||0xc8;return function(_0x39cce5){if(_0x39cce5){return _0x2ea504[_0x3ba5('0x19')](_0x4e84b1)['json'](_0x39cce5);}};}function respondWithFilteredResult(_0x3c3377,_0x40b4e0){return function(_0x5b3e48){if(_0x5b3e48){var _0x4b0c2b=typeof _0x40b4e0[_0x3ba5('0x1b')]===_0x3ba5('0x1c')&&typeof _0x40b4e0[_0x3ba5('0x1d')]==='undefined';var _0x2ce090=_0x5b3e48[_0x3ba5('0x1e')];var _0x36fddf=_0x4b0c2b?0x0:_0x40b4e0[_0x3ba5('0x1b')];var _0x431430=_0x4b0c2b?_0x5b3e48[_0x3ba5('0x1e')]:_0x40b4e0[_0x3ba5('0x1b')]+_0x40b4e0[_0x3ba5('0x1d')];var _0x183dbb;if(_0x431430>=_0x2ce090){_0x431430=_0x2ce090;_0x183dbb=0xc8;}else{_0x183dbb=0xce;}_0x3c3377[_0x3ba5('0x19')](_0x183dbb);return _0x3c3377[_0x3ba5('0x1f')](_0x3ba5('0x20'),_0x36fddf+'-'+_0x431430+'/'+_0x2ce090)[_0x3ba5('0x21')](_0x5b3e48);}return null;};}function patchUpdates(_0x5dba2e){return function(_0x211627){try{jsonpatch['apply'](_0x211627,_0x5dba2e,!![]);}catch(_0x42d0fc){return BPromise['reject'](_0x42d0fc);}return _0x211627[_0x3ba5('0x22')]();};}function saveUpdates(_0x12a140,_0x40e321){return function(_0x4d755d){if(_0x4d755d){return _0x4d755d['update'](_0x12a140)[_0x3ba5('0x23')](function(_0x2f1ccb){return _0x2f1ccb;});}return null;};}function removeEntity(_0x2e77d7,_0x4234ca){return function(_0x161135){if(_0x161135){return _0x161135[_0x3ba5('0x24')]()['then'](function(){_0x2e77d7[_0x3ba5('0x19')](0xcc)[_0x3ba5('0x1a')]();});}};}function handleEntityNotFound(_0x1a5a24,_0x172f9d){return function(_0x2ff7de){if(!_0x2ff7de){_0x1a5a24[_0x3ba5('0x18')](0x194);}return _0x2ff7de;};}function handleError(_0x1a4cea,_0x47c254){_0x47c254=_0x47c254||0x1f4;return function(_0x469bdd){logger[_0x3ba5('0x25')](_0x469bdd[_0x3ba5('0x26')]);if(_0x469bdd['name']){delete _0x469bdd[_0x3ba5('0x27')];}_0x1a4cea[_0x3ba5('0x19')](_0x47c254)['send'](_0x469bdd);};}exports[_0x3ba5('0x28')]=function(_0x1250fe,_0x516c28){var _0x3491c9={},_0x5f4cfd={},_0x4f2fa6={'count':0x0,'rows':[]};var _0x18e63c=_[_0x3ba5('0x29')](db[_0x3ba5('0x2a')]['rawAttributes'],function(_0x4a633e){return{'name':_0x4a633e[_0x3ba5('0x2b')],'type':_0x4a633e[_0x3ba5('0x2c')][_0x3ba5('0x2d')]};});_0x5f4cfd[_0x3ba5('0x2e')]=_[_0x3ba5('0x29')](_0x18e63c,_0x3ba5('0x27'));_0x5f4cfd['query']=_[_0x3ba5('0x2f')](_0x1250fe[_0x3ba5('0x30')]);_0x5f4cfd['filters']=_[_0x3ba5('0x31')](_0x5f4cfd[_0x3ba5('0x2e')],_0x5f4cfd[_0x3ba5('0x30')]);_0x3491c9['attributes']=_[_0x3ba5('0x31')](_0x5f4cfd[_0x3ba5('0x2e')],qs[_0x3ba5('0x32')](_0x1250fe[_0x3ba5('0x30')][_0x3ba5('0x32')]));_0x3491c9[_0x3ba5('0x33')]=_0x3491c9[_0x3ba5('0x33')][_0x3ba5('0x34')]?_0x3491c9[_0x3ba5('0x33')]:_0x5f4cfd[_0x3ba5('0x2e')];if(!_0x1250fe[_0x3ba5('0x30')][_0x3ba5('0x35')](_0x3ba5('0x36'))){_0x3491c9[_0x3ba5('0x1d')]=qs[_0x3ba5('0x1d')](_0x1250fe['query'][_0x3ba5('0x1d')]);_0x3491c9[_0x3ba5('0x1b')]=qs[_0x3ba5('0x1b')](_0x1250fe[_0x3ba5('0x30')][_0x3ba5('0x1b')]);}_0x3491c9['order']=qs[_0x3ba5('0x37')](_0x1250fe[_0x3ba5('0x30')][_0x3ba5('0x37')]);_0x3491c9[_0x3ba5('0x38')]=qs[_0x3ba5('0x39')](_['pick'](_0x1250fe[_0x3ba5('0x30')],_0x5f4cfd['filters']),_0x18e63c);if(_0x1250fe[_0x3ba5('0x30')][_0x3ba5('0x3a')]){_0x3491c9[_0x3ba5('0x38')]=_[_0x3ba5('0x3b')](_0x3491c9[_0x3ba5('0x38')],{'$or':_[_0x3ba5('0x29')](_0x18e63c,function(_0x310a46){if(_0x310a46['type']!==_0x3ba5('0x3c')){var _0x56aa2e={};_0x56aa2e[_0x310a46[_0x3ba5('0x27')]]={'$like':'%'+_0x1250fe[_0x3ba5('0x30')][_0x3ba5('0x3a')]+'%'};return _0x56aa2e;}})});}_0x3491c9=_[_0x3ba5('0x3b')]({},_0x3491c9,_0x1250fe[_0x3ba5('0x3d')]);var _0x291610={'where':_0x3491c9[_0x3ba5('0x38')]};return db[_0x3ba5('0x2a')][_0x3ba5('0x1e')](_0x291610)[_0x3ba5('0x23')](function(_0x32bf9f){_0x4f2fa6[_0x3ba5('0x1e')]=_0x32bf9f;if(_0x1250fe[_0x3ba5('0x30')]['includeAll']){_0x3491c9[_0x3ba5('0x3e')]=[{'all':!![]}];}return db['MailTransferReport'][_0x3ba5('0x3f')](_0x3491c9);})['then'](function(_0x4dd7b3){_0x4f2fa6[_0x3ba5('0x40')]=_0x4dd7b3;return _0x4f2fa6;})['then'](respondWithFilteredResult(_0x516c28,_0x3491c9))['catch'](handleError(_0x516c28,null));};exports[_0x3ba5('0x41')]=function(_0x3e9f78,_0x4234c0){var _0x56bcb8={'raw':!![],'where':{'id':_0x3e9f78['params']['id']}},_0x1eacc8={};_0x1eacc8['model']=_['keys'](db[_0x3ba5('0x2a')][_0x3ba5('0x42')]);_0x1eacc8[_0x3ba5('0x30')]=_[_0x3ba5('0x2f')](_0x3e9f78['query']);_0x1eacc8[_0x3ba5('0x39')]=_[_0x3ba5('0x31')](_0x1eacc8['model'],_0x1eacc8[_0x3ba5('0x30')]);_0x56bcb8[_0x3ba5('0x33')]=_[_0x3ba5('0x31')](_0x1eacc8[_0x3ba5('0x2e')],qs['fields'](_0x3e9f78[_0x3ba5('0x30')][_0x3ba5('0x32')]));_0x56bcb8['attributes']=_0x56bcb8[_0x3ba5('0x33')][_0x3ba5('0x34')]?_0x56bcb8[_0x3ba5('0x33')]:_0x1eacc8[_0x3ba5('0x2e')];if(_0x3e9f78[_0x3ba5('0x30')][_0x3ba5('0x43')]){_0x56bcb8[_0x3ba5('0x3e')]=[{'all':!![]}];}_0x56bcb8=_[_0x3ba5('0x3b')]({},_0x56bcb8,_0x3e9f78[_0x3ba5('0x3d')]);return db['MailTransferReport'][_0x3ba5('0x44')](_0x56bcb8)[_0x3ba5('0x23')](handleEntityNotFound(_0x4234c0,null))[_0x3ba5('0x23')](respondWithResult(_0x4234c0,null))[_0x3ba5('0x45')](handleError(_0x4234c0,null));};exports['create']=function(_0x4a56d3,_0x4ab420){return db['MailTransferReport']['create'](_0x4a56d3['body'],{})['then'](respondWithResult(_0x4ab420,0xc9))[_0x3ba5('0x45')](handleError(_0x4ab420,null));};exports[_0x3ba5('0x46')]=function(_0x44b91f,_0x90e3b0){if(_0x44b91f[_0x3ba5('0x47')]['id']){delete _0x44b91f[_0x3ba5('0x47')]['id'];}return db['MailTransferReport'][_0x3ba5('0x44')]({'where':{'id':_0x44b91f[_0x3ba5('0x48')]['id']}})[_0x3ba5('0x23')](handleEntityNotFound(_0x90e3b0,null))[_0x3ba5('0x23')](saveUpdates(_0x44b91f[_0x3ba5('0x47')],null))[_0x3ba5('0x23')](respondWithResult(_0x90e3b0,null))[_0x3ba5('0x45')](handleError(_0x90e3b0,null));};exports[_0x3ba5('0x24')]=function(_0x23a24d,_0x4025df){return db[_0x3ba5('0x2a')][_0x3ba5('0x44')]({'where':{'id':_0x23a24d[_0x3ba5('0x48')]['id']}})[_0x3ba5('0x23')](handleEntityNotFound(_0x4025df,null))[_0x3ba5('0x23')](removeEntity(_0x4025df,null))[_0x3ba5('0x45')](handleError(_0x4025df,null));};exports[_0x3ba5('0x49')]=function(_0x30cd89,_0x38b4cb){return db[_0x3ba5('0x2a')][_0x3ba5('0x49')]()['then'](respondWithResult(_0x38b4cb,null))[_0x3ba5('0x45')](handleError(_0x38b4cb,null));}; \ No newline at end of file +var _0xb9f2=['undefined','limit','count','set','Content-Range','json','reject','save','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','merge','VIRTUAL','filter','options','MailTransferReport','includeAll','include','findAll','rows','params','length','find','catch','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','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/license/util','../../mysqldb','sendStatus','end','status','offset'];(function(_0x1c82a4,_0x49811a){var _0x41fcea=function(_0x19074e){while(--_0x19074e){_0x1c82a4['push'](_0x1c82a4['shift']());}};_0x41fcea(++_0x49811a);}(_0xb9f2,0x1b0));var _0x2b9f=function(_0x3b5713,_0x302e72){_0x3b5713=_0x3b5713-0x0;var _0x3cc459=_0xb9f2[_0x3b5713];return _0x3cc459;};'use strict';var emlformat=require(_0x2b9f('0x0'));var rimraf=require(_0x2b9f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2b9f('0x2'));var rp=require(_0x2b9f('0x3'));var moment=require(_0x2b9f('0x4'));var BPromise=require(_0x2b9f('0x5'));var Mustache=require('mustache');var util=require(_0x2b9f('0x6'));var path=require(_0x2b9f('0x7'));var sox=require(_0x2b9f('0x8'));var csv=require(_0x2b9f('0x9'));var ejs=require(_0x2b9f('0xa'));var fs=require('fs');var fs_extra=require(_0x2b9f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2b9f('0xc'));var jsforce=require(_0x2b9f('0xd'));var deskjs=require(_0x2b9f('0xe'));var toCsv=require(_0x2b9f('0x9'));var querystring=require(_0x2b9f('0xf'));var Papa=require(_0x2b9f('0x10'));var Redis=require(_0x2b9f('0x11'));var authService=require(_0x2b9f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2b9f('0x13'));var hardwareService=require(_0x2b9f('0x14'));var logger=require(_0x2b9f('0x15'))(_0x2b9f('0x16'));var utils=require(_0x2b9f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2b9f('0x18'));var db=require(_0x2b9f('0x19'))['db'];function respondWithStatusCode(_0x5d6433,_0x2d997f){_0x2d997f=_0x2d997f||0xcc;return function(_0x393bab){if(_0x393bab){return _0x5d6433[_0x2b9f('0x1a')](_0x2d997f);}return _0x5d6433['status'](_0x2d997f)[_0x2b9f('0x1b')]();};}function respondWithResult(_0x5e6bdd,_0x442191){_0x442191=_0x442191||0xc8;return function(_0x2ea992){if(_0x2ea992){return _0x5e6bdd[_0x2b9f('0x1c')](_0x442191)['json'](_0x2ea992);}};}function respondWithFilteredResult(_0x465c5e,_0x4e7674){return function(_0x377838){if(_0x377838){var _0x3b49f0=typeof _0x4e7674[_0x2b9f('0x1d')]===_0x2b9f('0x1e')&&typeof _0x4e7674[_0x2b9f('0x1f')]===_0x2b9f('0x1e');var _0x226d50=_0x377838['count'];var _0x10c902=_0x3b49f0?0x0:_0x4e7674[_0x2b9f('0x1d')];var _0x12a5f9=_0x3b49f0?_0x377838[_0x2b9f('0x20')]:_0x4e7674[_0x2b9f('0x1d')]+_0x4e7674[_0x2b9f('0x1f')];var _0x536c83;if(_0x12a5f9>=_0x226d50){_0x12a5f9=_0x226d50;_0x536c83=0xc8;}else{_0x536c83=0xce;}_0x465c5e[_0x2b9f('0x1c')](_0x536c83);return _0x465c5e[_0x2b9f('0x21')](_0x2b9f('0x22'),_0x10c902+'-'+_0x12a5f9+'/'+_0x226d50)[_0x2b9f('0x23')](_0x377838);}return null;};}function patchUpdates(_0x5c036e){return function(_0xd47995){try{jsonpatch['apply'](_0xd47995,_0x5c036e,!![]);}catch(_0xed6f3b){return BPromise[_0x2b9f('0x24')](_0xed6f3b);}return _0xd47995[_0x2b9f('0x25')]();};}function saveUpdates(_0x223f65,_0x3acf32){return function(_0x39c359){if(_0x39c359){return _0x39c359['update'](_0x223f65)['then'](function(_0x574d2b){return _0x574d2b;});}return null;};}function removeEntity(_0x2ed3f3,_0x5bfd32){return function(_0x1ec957){if(_0x1ec957){return _0x1ec957[_0x2b9f('0x26')]()[_0x2b9f('0x27')](function(){_0x2ed3f3[_0x2b9f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x148c74,_0x584310){return function(_0x31d11b){if(!_0x31d11b){_0x148c74['sendStatus'](0x194);}return _0x31d11b;};}function handleError(_0x51984e,_0x10ee8f){_0x10ee8f=_0x10ee8f||0x1f4;return function(_0x328d59){logger[_0x2b9f('0x28')](_0x328d59[_0x2b9f('0x29')]);if(_0x328d59[_0x2b9f('0x2a')]){delete _0x328d59['name'];}_0x51984e['status'](_0x10ee8f)[_0x2b9f('0x2b')](_0x328d59);};}exports[_0x2b9f('0x2c')]=function(_0x1a8b93,_0x450f87){var _0x11419c={},_0x5d37a4={},_0x104ec3={'count':0x0,'rows':[]};var _0x3b5e19=_[_0x2b9f('0x2d')](db['MailTransferReport'][_0x2b9f('0x2e')],function(_0x23f93d){return{'name':_0x23f93d[_0x2b9f('0x2f')],'type':_0x23f93d[_0x2b9f('0x30')]['key']};});_0x5d37a4[_0x2b9f('0x31')]=_[_0x2b9f('0x2d')](_0x3b5e19,_0x2b9f('0x2a'));_0x5d37a4[_0x2b9f('0x32')]=_[_0x2b9f('0x33')](_0x1a8b93[_0x2b9f('0x32')]);_0x5d37a4[_0x2b9f('0x34')]=_[_0x2b9f('0x35')](_0x5d37a4[_0x2b9f('0x31')],_0x5d37a4['query']);_0x11419c[_0x2b9f('0x36')]=_['intersection'](_0x5d37a4[_0x2b9f('0x31')],qs['fields'](_0x1a8b93[_0x2b9f('0x32')][_0x2b9f('0x37')]));_0x11419c[_0x2b9f('0x36')]=_0x11419c[_0x2b9f('0x36')]['length']?_0x11419c['attributes']:_0x5d37a4['model'];if(!_0x1a8b93[_0x2b9f('0x32')]['hasOwnProperty'](_0x2b9f('0x38'))){_0x11419c[_0x2b9f('0x1f')]=qs['limit'](_0x1a8b93[_0x2b9f('0x32')][_0x2b9f('0x1f')]);_0x11419c[_0x2b9f('0x1d')]=qs[_0x2b9f('0x1d')](_0x1a8b93[_0x2b9f('0x32')]['offset']);}_0x11419c[_0x2b9f('0x39')]=qs[_0x2b9f('0x3a')](_0x1a8b93['query'][_0x2b9f('0x3a')]);_0x11419c[_0x2b9f('0x3b')]=qs['filters'](_['pick'](_0x1a8b93[_0x2b9f('0x32')],_0x5d37a4['filters']),_0x3b5e19);if(_0x1a8b93[_0x2b9f('0x32')]['filter']){_0x11419c[_0x2b9f('0x3b')]=_[_0x2b9f('0x3c')](_0x11419c[_0x2b9f('0x3b')],{'$or':_['map'](_0x3b5e19,function(_0xc17162){if(_0xc17162['type']!==_0x2b9f('0x3d')){var _0x460fe3={};_0x460fe3[_0xc17162[_0x2b9f('0x2a')]]={'$like':'%'+_0x1a8b93[_0x2b9f('0x32')][_0x2b9f('0x3e')]+'%'};return _0x460fe3;}})});}_0x11419c=_[_0x2b9f('0x3c')]({},_0x11419c,_0x1a8b93[_0x2b9f('0x3f')]);var _0x2bc145={'where':_0x11419c[_0x2b9f('0x3b')]};return db[_0x2b9f('0x40')][_0x2b9f('0x20')](_0x2bc145)[_0x2b9f('0x27')](function(_0x55c115){_0x104ec3[_0x2b9f('0x20')]=_0x55c115;if(_0x1a8b93['query'][_0x2b9f('0x41')]){_0x11419c[_0x2b9f('0x42')]=[{'all':!![]}];}return db[_0x2b9f('0x40')][_0x2b9f('0x43')](_0x11419c);})[_0x2b9f('0x27')](function(_0x1b16ff){_0x104ec3[_0x2b9f('0x44')]=_0x1b16ff;return _0x104ec3;})[_0x2b9f('0x27')](respondWithFilteredResult(_0x450f87,_0x11419c))['catch'](handleError(_0x450f87,null));};exports['show']=function(_0x3c8c67,_0x3341ca){var _0x1c6345={'raw':!![],'where':{'id':_0x3c8c67[_0x2b9f('0x45')]['id']}},_0x54ec26={};_0x54ec26[_0x2b9f('0x31')]=_[_0x2b9f('0x33')](db[_0x2b9f('0x40')][_0x2b9f('0x2e')]);_0x54ec26[_0x2b9f('0x32')]=_[_0x2b9f('0x33')](_0x3c8c67[_0x2b9f('0x32')]);_0x54ec26['filters']=_[_0x2b9f('0x35')](_0x54ec26[_0x2b9f('0x31')],_0x54ec26[_0x2b9f('0x32')]);_0x1c6345[_0x2b9f('0x36')]=_[_0x2b9f('0x35')](_0x54ec26[_0x2b9f('0x31')],qs[_0x2b9f('0x37')](_0x3c8c67[_0x2b9f('0x32')][_0x2b9f('0x37')]));_0x1c6345[_0x2b9f('0x36')]=_0x1c6345[_0x2b9f('0x36')][_0x2b9f('0x46')]?_0x1c6345['attributes']:_0x54ec26['model'];if(_0x3c8c67[_0x2b9f('0x32')][_0x2b9f('0x41')]){_0x1c6345['include']=[{'all':!![]}];}_0x1c6345=_['merge']({},_0x1c6345,_0x3c8c67[_0x2b9f('0x3f')]);return db['MailTransferReport'][_0x2b9f('0x47')](_0x1c6345)[_0x2b9f('0x27')](handleEntityNotFound(_0x3341ca,null))[_0x2b9f('0x27')](respondWithResult(_0x3341ca,null))[_0x2b9f('0x48')](handleError(_0x3341ca,null));};exports[_0x2b9f('0x49')]=function(_0x81379f,_0x1abb57){return db[_0x2b9f('0x40')][_0x2b9f('0x49')](_0x81379f[_0x2b9f('0x4a')],{})[_0x2b9f('0x27')](respondWithResult(_0x1abb57,0xc9))['catch'](handleError(_0x1abb57,null));};exports[_0x2b9f('0x4b')]=function(_0x121017,_0x15f841){if(_0x121017[_0x2b9f('0x4a')]['id']){delete _0x121017['body']['id'];}return db[_0x2b9f('0x40')]['find']({'where':{'id':_0x121017[_0x2b9f('0x45')]['id']}})[_0x2b9f('0x27')](handleEntityNotFound(_0x15f841,null))[_0x2b9f('0x27')](saveUpdates(_0x121017[_0x2b9f('0x4a')],null))[_0x2b9f('0x27')](respondWithResult(_0x15f841,null))[_0x2b9f('0x48')](handleError(_0x15f841,null));};exports[_0x2b9f('0x26')]=function(_0x28b510,_0x347fc4){return db[_0x2b9f('0x40')]['find']({'where':{'id':_0x28b510['params']['id']}})[_0x2b9f('0x27')](handleEntityNotFound(_0x347fc4,null))['then'](removeEntity(_0x347fc4,null))[_0x2b9f('0x48')](handleError(_0x347fc4,null));};exports[_0x2b9f('0x4c')]=function(_0x2d8520,_0x513424){return db[_0x2b9f('0x40')][_0x2b9f('0x4c')]()[_0x2b9f('0x27')](respondWithResult(_0x513424,null))[_0x2b9f('0x48')](handleError(_0x513424,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index a24939e..f78ca81 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 _0x1e14=['util','../../config/logger','api','path','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash'];(function(_0x513f27,_0x1cbc87){var _0xa316b7=function(_0x3b592d){while(--_0x3b592d){_0x513f27['push'](_0x513f27['shift']());}};_0xa316b7(++_0x1cbc87);}(_0x1e14,0xef));var _0x41e1=function(_0x22e81a,_0xc6f0c1){_0x22e81a=_0x22e81a-0x0;var _0x24272f=_0x1e14[_0x22e81a];return _0x24272f;};'use strict';var _=require(_0x41e1('0x0'));var util=require(_0x41e1('0x1'));var logger=require(_0x41e1('0x2'))(_0x41e1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x41e1('0x4'));var rimraf=require('rimraf');var config=require(_0x41e1('0x5'));var attributes=require(_0x41e1('0x6'));module[_0x41e1('0x7')]=function(_0xd3a2bf,_0x362862){return _0xd3a2bf[_0x41e1('0x8')](_0x41e1('0x9'),attributes,{'tableName':_0x41e1('0xa'),'paranoid':![],'indexes':[{'name':_0x41e1('0xb'),'fields':[_0x41e1('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x37c5=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','define','report_mail_transfer','uniqueid','util','../../config/logger'];(function(_0xca8ca6,_0x5ca011){var _0x5b193a=function(_0x4e7407){while(--_0x4e7407){_0xca8ca6['push'](_0xca8ca6['shift']());}};_0x5b193a(++_0x5ca011);}(_0x37c5,0xa7));var _0x537c=function(_0x284b0c,_0x31c32b){_0x284b0c=_0x284b0c-0x0;var _0x25aee4=_0x37c5[_0x284b0c];return _0x25aee4;};'use strict';var _=require('lodash');var util=require(_0x537c('0x0'));var logger=require(_0x537c('0x1'))(_0x537c('0x2'));var moment=require(_0x537c('0x3'));var BPromise=require(_0x537c('0x4'));var rp=require(_0x537c('0x5'));var fs=require('fs');var path=require(_0x537c('0x6'));var rimraf=require(_0x537c('0x7'));var config=require(_0x537c('0x8'));var attributes=require(_0x537c('0x9'));module['exports']=function(_0x42c86a,_0x1156f4){return _0x42c86a[_0x537c('0xa')]('MailTransferReport',attributes,{'tableName':_0x537c('0xb'),'paranoid':![],'indexes':[{'name':_0x537c('0xc'),'fields':[_0x537c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 06a1543..38bea31 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 _0xf3ba=['../../mysqldb','../../config/utils','rpc','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','randomstring','ioredis'];(function(_0x5e5d25,_0xa5dc58){var _0x34e516=function(_0x2dc233){while(--_0x2dc233){_0x5e5d25['push'](_0x5e5d25['shift']());}};_0x34e516(++_0xa5dc58);}(_0xf3ba,0x1de));var _0xaf3b=function(_0x295314,_0x17b250){_0x295314=_0x295314-0x0;var _0x584b0c=_0xf3ba[_0x295314];return _0x584b0c;};'use strict';var _=require(_0xaf3b('0x0'));var util=require(_0xaf3b('0x1'));var moment=require(_0xaf3b('0x2'));var BPromise=require('bluebird');var rs=require(_0xaf3b('0x3'));var fs=require('fs');var Redis=require(_0xaf3b('0x4'));var db=require(_0xaf3b('0x5'))['db'];var utils=require(_0xaf3b('0x6'));var logger=require('../../config/logger')(_0xaf3b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xaf3b('0x8')][_0xaf3b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1b891c,_0x1dab47,_0x539839){return new BPromise(function(_0x32b68b,_0x225f29){return client[_0xaf3b('0xa')](_0x1b891c,_0x539839)[_0xaf3b('0xb')](function(_0x2d5d1e){logger[_0xaf3b('0xc')](_0xaf3b('0xd'),_0x1dab47,_0xaf3b('0xe'));logger[_0xaf3b('0xf')](_0xaf3b('0x10'),_0x1dab47,_0xaf3b('0xe'),JSON[_0xaf3b('0x11')](_0x2d5d1e));if(_0x2d5d1e[_0xaf3b('0x12')]){if(_0x2d5d1e['error']['code']===0x1f4){logger['error'](_0xaf3b('0xd'),_0x1dab47,_0x2d5d1e[_0xaf3b('0x12')][_0xaf3b('0x13')]);return _0x225f29(_0x2d5d1e[_0xaf3b('0x12')][_0xaf3b('0x13')]);}logger[_0xaf3b('0x12')](_0xaf3b('0xd'),_0x1dab47,_0x2d5d1e[_0xaf3b('0x12')][_0xaf3b('0x13')]);return _0x32b68b(_0x2d5d1e[_0xaf3b('0x12')][_0xaf3b('0x13')]);}else{logger[_0xaf3b('0xc')](_0xaf3b('0xd'),_0x1dab47,_0xaf3b('0xe'));_0x32b68b(_0x2d5d1e[_0xaf3b('0x14')][_0xaf3b('0x13')]);}})['catch'](function(_0x1f37d6){logger[_0xaf3b('0x12')](_0xaf3b('0xd'),_0x1dab47,_0x1f37d6);_0x225f29(_0x1f37d6);});});} \ No newline at end of file +var _0xfd3f=['request','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','MailTransferReport,\x20%s,\x20%s','result','catch','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5b0b47,_0x299098){var _0x33988c=function(_0x8d220a){while(--_0x8d220a){_0x5b0b47['push'](_0x5b0b47['shift']());}};_0x33988c(++_0x299098);}(_0xfd3f,0xdd));var _0xffd3=function(_0x879e31,_0x139d02){_0x879e31=_0x879e31-0x0;var _0x3467e8=_0xfd3f[_0x879e31];return _0x3467e8;};'use strict';var _=require('lodash');var util=require(_0xffd3('0x0'));var moment=require(_0xffd3('0x1'));var BPromise=require(_0xffd3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xffd3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xffd3('0x4'));var logger=require('../../config/logger')(_0xffd3('0x5'));var config=require(_0xffd3('0x6'));var jayson=require(_0xffd3('0x7'));var client=jayson[_0xffd3('0x8')][_0xffd3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb5b4eb,_0x732838,_0x1f796b){return new BPromise(function(_0x223b08,_0x47535c){return client[_0xffd3('0xa')](_0xb5b4eb,_0x1f796b)['then'](function(_0x31825b){logger[_0xffd3('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x732838,_0xffd3('0xc'));logger[_0xffd3('0xd')](_0xffd3('0xe'),_0x732838,_0xffd3('0xc'),JSON['stringify'](_0x31825b));if(_0x31825b[_0xffd3('0xf')]){if(_0x31825b[_0xffd3('0xf')][_0xffd3('0x10')]===0x1f4){logger[_0xffd3('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x732838,_0x31825b[_0xffd3('0xf')][_0xffd3('0x11')]);return _0x47535c(_0x31825b[_0xffd3('0xf')]['message']);}logger[_0xffd3('0xf')](_0xffd3('0x12'),_0x732838,_0x31825b[_0xffd3('0xf')]['message']);return _0x223b08(_0x31825b['error'][_0xffd3('0x11')]);}else{logger[_0xffd3('0xb')](_0xffd3('0x12'),_0x732838,_0xffd3('0xc'));_0x223b08(_0x31825b[_0xffd3('0x13')][_0xffd3('0x11')]);}})[_0xffd3('0x14')](function(_0x42f975){logger[_0xffd3('0xf')](_0xffd3('0x12'),_0x732838,_0x42f975);_0x47535c(_0x42f975);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index a526bcc..f4bb7f0 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 _0xab50=['describe','/:id','show','post','create','put','update','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe'];(function(_0x32b98d,_0x584cd7){var _0x329897=function(_0x458599){while(--_0x458599){_0x32b98d['push'](_0x32b98d['shift']());}};_0x329897(++_0x584cd7);}(_0xab50,0xfe));var _0x0ab5=function(_0x427629,_0x66bfce){_0x427629=_0x427629-0x0;var _0x28486f=_0xab50[_0x427629];return _0x28486f;};'use strict';var multer=require(_0x0ab5('0x0'));var util=require(_0x0ab5('0x1'));var path=require(_0x0ab5('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0ab5('0x3'));var auth=require(_0x0ab5('0x4'));var interaction=require(_0x0ab5('0x5'));var config=require(_0x0ab5('0x6'));var controller=require(_0x0ab5('0x7'));router[_0x0ab5('0x8')]('/',auth[_0x0ab5('0x9')](),controller[_0x0ab5('0xa')]);router[_0x0ab5('0x8')](_0x0ab5('0xb'),auth[_0x0ab5('0x9')](),controller[_0x0ab5('0xc')]);router[_0x0ab5('0x8')](_0x0ab5('0xd'),auth['isAuthenticated'](),controller[_0x0ab5('0xe')]);router[_0x0ab5('0xf')]('/',auth[_0x0ab5('0x9')](),controller[_0x0ab5('0x10')]);router[_0x0ab5('0x11')](_0x0ab5('0xd'),auth[_0x0ab5('0x9')](),controller[_0x0ab5('0x12')]);router['delete'](_0x0ab5('0xd'),auth[_0x0ab5('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xdde7=['../../components/interaction/service','../../config/environment','./memberReport.controller','get','index','/describe','isAuthenticated','show','post','create','/:id','update','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x2f9651,_0x1c88c4){var _0x3210bc=function(_0x1f0e05){while(--_0x1f0e05){_0x2f9651['push'](_0x2f9651['shift']());}};_0x3210bc(++_0x1c88c4);}(_0xdde7,0x12c));var _0x7dde=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0xdde7[_0x231e16];return _0x570a7c;};'use strict';var multer=require(_0x7dde('0x0'));var util=require(_0x7dde('0x1'));var path=require(_0x7dde('0x2'));var timeout=require(_0x7dde('0x3'));var express=require('express');var router=express[_0x7dde('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7dde('0x5'));var interaction=require(_0x7dde('0x6'));var config=require(_0x7dde('0x7'));var controller=require(_0x7dde('0x8'));router[_0x7dde('0x9')]('/',auth['isAuthenticated'](),controller[_0x7dde('0xa')]);router['get'](_0x7dde('0xb'),auth[_0x7dde('0xc')](),controller['describe']);router[_0x7dde('0x9')]('/:id',auth[_0x7dde('0xc')](),controller[_0x7dde('0xd')]);router[_0x7dde('0xe')]('/',auth['isAuthenticated'](),controller[_0x7dde('0xf')]);router['put'](_0x7dde('0x10'),auth[_0x7dde('0xc')](),controller[_0x7dde('0x11')]);router['delete'](_0x7dde('0x10'),auth[_0x7dde('0xc')](),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 13bc8f0..6f7640f 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 _0xea4f=['diff','seconds','talk:[start]','talk:[destination]','talk:[queue]','exports','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','enterAt'];(function(_0x5554da,_0x6cc7fc){var _0x447f56=function(_0x4d95b1){while(--_0x4d95b1){_0x5554da['push'](_0x5554da['shift']());}};_0x447f56(++_0x6cc7fc);}(_0xea4f,0x155));var _0xfea4=function(_0x1afd49,_0x10e919){_0x1afd49=_0x1afd49-0x0;var _0x3dd836=_0xea4f[_0x1afd49];return _0x3dd836;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xfea4('0x0')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xfea4('0x1')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xfea4('0x1')],'defaultValue':_0xfea4('0x2'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0xfea4('0x3')]},'enterAt':{'type':Sequelize[_0xfea4('0x4')]},'exitAt':{'type':Sequelize[_0xfea4('0x4')],'set':function(_0x1410d5){var _0x31b239=moment(_0x1410d5);var _0x1c9337=moment(this[_0xfea4('0x5')](_0xfea4('0x6')));var _0x36a8d0=_0x31b239[_0xfea4('0x7')](_0x1c9337,_0xfea4('0x8'));this['setDataValue']('exitAt',_0x1410d5);this['setDataValue']('duration',_0x36a8d0>=0x0?_0x36a8d0:null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize['STRING'],'comment':_0xfea4('0x9')},'data3':{'type':Sequelize[_0xfea4('0x1')],'comment':_0xfea4('0xa')},'data4':{'type':Sequelize[_0xfea4('0x1')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0xfea4('0x1')],'comment':_0xfea4('0xb')},'role':{'type':Sequelize[_0xfea4('0x1')]},'internal':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xfea4('0x1')]}}; \ No newline at end of file +var _0xc974=['talk:[queue]','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[start]','talk:[destination]','talk:[dial\x20string]'];(function(_0x3292d7,_0xa8f289){var _0x1b9dd2=function(_0x3e5524){while(--_0x3e5524){_0x3292d7['push'](_0x3292d7['shift']());}};_0x1b9dd2(++_0xa8f289);}(_0xc974,0x133));var _0x4c97=function(_0x21ec43,_0x2639e8){_0x21ec43=_0x21ec43-0x0;var _0x3635d9=_0xc974[_0x21ec43];return _0x3635d9;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x4c97('0x0'));module[_0x4c97('0x1')]={'channel':{'type':Sequelize[_0x4c97('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x4c97('0x2')]},'type':{'type':Sequelize[_0x4c97('0x2')],'defaultValue':_0x4c97('0x3'),'comment':_0x4c97('0x4')},'duration':{'type':Sequelize[_0x4c97('0x5')]},'enterAt':{'type':Sequelize[_0x4c97('0x6')]},'exitAt':{'type':Sequelize[_0x4c97('0x6')],'set':function(_0x5de70c){var _0x180bac=moment(_0x5de70c);var _0x55f2b2=moment(this[_0x4c97('0x7')](_0x4c97('0x8')));var _0x532027=_0x180bac[_0x4c97('0x9')](_0x55f2b2,_0x4c97('0xa'));this[_0x4c97('0xb')](_0x4c97('0xc'),_0x5de70c);this['setDataValue'](_0x4c97('0xd'),_0x532027>=0x0?_0x532027:null);}},'data1':{'type':Sequelize[_0x4c97('0x2')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x4c97('0x2')],'comment':_0x4c97('0xe')},'data3':{'type':Sequelize[_0x4c97('0x2')],'comment':_0x4c97('0xf')},'data4':{'type':Sequelize['STRING'],'comment':_0x4c97('0x10')},'data5':{'type':Sequelize['STRING'],'comment':_0x4c97('0x11')},'role':{'type':Sequelize[_0x4c97('0x2')]},'internal':{'type':Sequelize[_0x4c97('0x5')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 049ee48..4622728 100644 --- a/server/api/memberReport/memberReport.controller.js +++ b/server/api/memberReport/memberReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x546e7d,_0x4c02ed){var _0x3cf967=function(_0x167e4f){while(--_0x167e4f){_0x546e7d['push'](_0x546e7d['shift']());}};_0x3cf967(++_0x4c02ed);}(_0x3e74,0x175));var _0x43e7=function(_0x573666,_0x36f9dd){_0x573666=_0x573666-0x0;var _0x3e8ba2=_0x3e74[_0x573666];return _0x3e8ba2;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));}; \ No newline at end of file +var _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xedd9,0xfc));var _0x9edd=function(_0x325072,_0x23d642){_0x325072=_0x325072-0x0;var _0xfded08=_0xedd9[_0x325072];return _0xfded08;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 222e2f3..0291d4c 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 _0x95ba=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','MemberReport','report_member','interface','lodash'];(function(_0x8525d8,_0x574c3c){var _0x25d8d5=function(_0x2a1061){while(--_0x2a1061){_0x8525d8['push'](_0x8525d8['shift']());}};_0x25d8d5(++_0x574c3c);}(_0x95ba,0x13a));var _0xa95b=function(_0x57bd48,_0x379563){_0x57bd48=_0x57bd48-0x0;var _0x404856=_0x95ba[_0x57bd48];return _0x404856;};'use strict';var _=require(_0xa95b('0x0'));var util=require(_0xa95b('0x1'));var logger=require(_0xa95b('0x2'))('api');var moment=require(_0xa95b('0x3'));var BPromise=require(_0xa95b('0x4'));var rp=require(_0xa95b('0x5'));var fs=require('fs');var path=require(_0xa95b('0x6'));var rimraf=require(_0xa95b('0x7'));var config=require(_0xa95b('0x8'));var attributes=require(_0xa95b('0x9'));module[_0xa95b('0xa')]=function(_0x17df87,_0x4a8fbd){return _0x17df87[_0xa95b('0xb')](_0xa95b('0xc'),attributes,{'tableName':_0xa95b('0xd'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':['membername',_0xa95b('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf2f1=['./memberReport.attributes','exports','define','MemberReport','membername_interface','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x281d36,_0x4ed458){var _0x396a03=function(_0x439c55){while(--_0x439c55){_0x281d36['push'](_0x281d36['shift']());}};_0x396a03(++_0x4ed458);}(_0xf2f1,0x1e1));var _0x1f2f=function(_0x44aa7b,_0x4bfc07){_0x44aa7b=_0x44aa7b-0x0;var _0x202405=_0xf2f1[_0x44aa7b];return _0x202405;};'use strict';var _=require(_0x1f2f('0x0'));var util=require(_0x1f2f('0x1'));var logger=require(_0x1f2f('0x2'))(_0x1f2f('0x3'));var moment=require(_0x1f2f('0x4'));var BPromise=require(_0x1f2f('0x5'));var rp=require(_0x1f2f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f2f('0x7'));var config=require(_0x1f2f('0x8'));var attributes=require(_0x1f2f('0x9'));module[_0x1f2f('0xa')]=function(_0x427f3f,_0xe0b7fb){return _0x427f3f[_0x1f2f('0xb')](_0x1f2f('0xc'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x1f2f('0xd'),'fields':['membername','interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index f2e7d9f..79b4b44 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 _0xf02c=['then','info','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','MemberReport','findAll','options','attributes','limit','include','map','model','GetMemberReport','stringify','CreateMemberReport','create','raw','body','where','UpdateMemberReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xf02c,0x92));var _0xcf02=function(_0xd55570,_0x233b57){_0xd55570=_0xd55570-0x0;var _0x134595=_0xf02c[_0xd55570];return _0x134595;};'use strict';var _=require(_0xcf02('0x0'));var util=require(_0xcf02('0x1'));var moment=require(_0xcf02('0x2'));var BPromise=require(_0xcf02('0x3'));var rs=require(_0xcf02('0x4'));var fs=require('fs');var Redis=require(_0xcf02('0x5'));var db=require(_0xcf02('0x6'))['db'];var utils=require(_0xcf02('0x7'));var logger=require(_0xcf02('0x8'))(_0xcf02('0x9'));var config=require(_0xcf02('0xa'));var jayson=require(_0xcf02('0xb'));var client=jayson[_0xcf02('0xc')][_0xcf02('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3569a1,_0x49ad8e,_0x45745e){return new BPromise(function(_0x56c3db,_0x5a255f){return client['request'](_0x3569a1,_0x45745e)[_0xcf02('0xe')](function(_0x2f1633){logger[_0xcf02('0xf')](_0xcf02('0x10'),_0x49ad8e,'request\x20sent');logger[_0xcf02('0x11')](_0xcf02('0x12'),_0x49ad8e,_0xcf02('0x13'),JSON['stringify'](_0x2f1633));if(_0x2f1633['error']){if(_0x2f1633[_0xcf02('0x14')][_0xcf02('0x15')]===0x1f4){logger[_0xcf02('0x14')](_0xcf02('0x10'),_0x49ad8e,_0x2f1633[_0xcf02('0x14')]['message']);return _0x5a255f(_0x2f1633[_0xcf02('0x14')][_0xcf02('0x16')]);}logger[_0xcf02('0x14')](_0xcf02('0x10'),_0x49ad8e,_0x2f1633[_0xcf02('0x14')][_0xcf02('0x16')]);return _0x56c3db(_0x2f1633[_0xcf02('0x14')]['message']);}else{logger[_0xcf02('0xf')](_0xcf02('0x10'),_0x49ad8e,_0xcf02('0x13'));_0x56c3db(_0x2f1633['result'][_0xcf02('0x16')]);}})[_0xcf02('0x17')](function(_0x59f337){logger[_0xcf02('0x14')]('MemberReport,\x20%s,\x20%s',_0x49ad8e,_0x59f337);_0x5a255f(_0x59f337);});});}exports['GetMemberReport']=function(_0x4f3829){var _0x2860fd=this;return new Promise(function(_0x53a97e,_0x29615d){return db[_0xcf02('0x18')][_0xcf02('0x19')]({'raw':_0x4f3829[_0xcf02('0x1a')]?_0x4f3829['options']['raw']===undefined?!![]:![]:!![],'where':_0x4f3829[_0xcf02('0x1a')]?_0x4f3829[_0xcf02('0x1a')]['where']||null:null,'attributes':_0x4f3829[_0xcf02('0x1a')]?_0x4f3829[_0xcf02('0x1a')][_0xcf02('0x1b')]||null:null,'limit':_0x4f3829[_0xcf02('0x1a')]?_0x4f3829['options'][_0xcf02('0x1c')]||null:null,'include':_0x4f3829[_0xcf02('0x1a')]?_0x4f3829[_0xcf02('0x1a')][_0xcf02('0x1d')]?_[_0xcf02('0x1e')](_0x4f3829[_0xcf02('0x1a')][_0xcf02('0x1d')],function(_0x2926b9){return{'model':db[_0x2926b9['model']],'as':_0x2926b9['as'],'attributes':_0x2926b9['attributes'],'include':_0x2926b9['include']?_[_0xcf02('0x1e')](_0x2926b9[_0xcf02('0x1d')],function(_0x2fd260){return{'model':db[_0x2fd260[_0xcf02('0x1f')]],'as':_0x2fd260['as'],'attributes':_0x2fd260[_0xcf02('0x1b')],'include':_0x2fd260[_0xcf02('0x1d')]?_[_0xcf02('0x1e')](_0x2fd260[_0xcf02('0x1d')],function(_0x4ee2b9){return{'model':db[_0x4ee2b9[_0xcf02('0x1f')]],'as':_0x4ee2b9['as'],'attributes':_0x4ee2b9[_0xcf02('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x54716d){logger[_0xcf02('0xf')](_0xcf02('0x20'),_0x4f3829);logger[_0xcf02('0x11')](_0xcf02('0x20'),_0x4f3829,JSON[_0xcf02('0x21')](_0x54716d));_0x53a97e(_0x54716d);})[_0xcf02('0x17')](function(_0x2b8bc6){logger[_0xcf02('0x14')](_0xcf02('0x20'),_0x2b8bc6['message'],_0x4f3829);_0x29615d(_0x2860fd[_0xcf02('0x14')](0x1f4,_0x2b8bc6[_0xcf02('0x16')]));});});};exports[_0xcf02('0x22')]=function(_0x5af4c3){var _0x2bef8e=this;return new Promise(function(_0x320d89,_0x47b633){return db[_0xcf02('0x18')][_0xcf02('0x23')](_0x5af4c3['body'],{'raw':_0x5af4c3[_0xcf02('0x1a')]?_0x5af4c3[_0xcf02('0x1a')][_0xcf02('0x24')]===undefined?!![]:![]:!![]})[_0xcf02('0xe')](function(_0x474221){logger['info'](_0xcf02('0x22'),_0x5af4c3);logger[_0xcf02('0x11')](_0xcf02('0x22'),_0x5af4c3,JSON[_0xcf02('0x21')](_0x474221));_0x320d89(_0x474221);})[_0xcf02('0x17')](function(_0x5007ae){logger['error'](_0xcf02('0x22'),_0x5007ae[_0xcf02('0x16')],_0x5af4c3);_0x47b633(_0x2bef8e[_0xcf02('0x14')](0x1f4,_0x5007ae['message']));});});};exports['UpdateMemberReport']=function(_0x17e96f){var _0x3c624f=this;return new Promise(function(_0x259577,_0x2775b8){return db[_0xcf02('0x18')]['update'](_0x17e96f[_0xcf02('0x25')],{'raw':_0x17e96f[_0xcf02('0x1a')]?_0x17e96f[_0xcf02('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17e96f[_0xcf02('0x1a')]?_0x17e96f[_0xcf02('0x1a')][_0xcf02('0x26')]||null:null,'attributes':_0x17e96f[_0xcf02('0x1a')]?_0x17e96f[_0xcf02('0x1a')]['attributes']||null:null,'limit':_0x17e96f[_0xcf02('0x1a')]?_0x17e96f[_0xcf02('0x1a')]['limit']||null:null})[_0xcf02('0xe')](function(_0x21225f){logger[_0xcf02('0xf')](_0xcf02('0x27'),_0x17e96f);logger['debug'](_0xcf02('0x27'),_0x17e96f,JSON[_0xcf02('0x21')](_0x21225f));_0x259577(_0x21225f);})[_0xcf02('0x17')](function(_0x43af50){logger[_0xcf02('0x14')](_0xcf02('0x27'),_0x43af50['message'],_0x17e96f);_0x2775b8(_0x3c624f[_0xcf02('0x14')](0x1f4,_0x43af50[_0xcf02('0x16')]));});});}; \ No newline at end of file +var _0x4e83=['bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMemberReport','MemberReport','findAll','options','where','attributes','map','include','model','create','body','raw','CreateMemberReport','UpdateMemberReport','update','limit','lodash','moment'];(function(_0xf8911f,_0x2d0f60){var _0x379f2c=function(_0x11ef3a){while(--_0x11ef3a){_0xf8911f['push'](_0xf8911f['shift']());}};_0x379f2c(++_0x2d0f60);}(_0x4e83,0x1ae));var _0x34e8=function(_0x10b967,_0xb32c4d){_0x10b967=_0x10b967-0x0;var _0x264da2=_0x4e83[_0x10b967];return _0x264da2;};'use strict';var _=require(_0x34e8('0x0'));var util=require('util');var moment=require(_0x34e8('0x1'));var BPromise=require(_0x34e8('0x2'));var rs=require(_0x34e8('0x3'));var fs=require('fs');var Redis=require(_0x34e8('0x4'));var db=require(_0x34e8('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x34e8('0x6'));var client=jayson[_0x34e8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30a3c4,_0x4567bd,_0x28677c){return new BPromise(function(_0x5b5ddc,_0x44d3bf){return client[_0x34e8('0x8')](_0x30a3c4,_0x28677c)[_0x34e8('0x9')](function(_0x5cb792){logger[_0x34e8('0xa')](_0x34e8('0xb'),_0x4567bd,_0x34e8('0xc'));logger[_0x34e8('0xd')](_0x34e8('0xe'),_0x4567bd,_0x34e8('0xc'),JSON[_0x34e8('0xf')](_0x5cb792));if(_0x5cb792[_0x34e8('0x10')]){if(_0x5cb792[_0x34e8('0x10')]['code']===0x1f4){logger[_0x34e8('0x10')](_0x34e8('0xb'),_0x4567bd,_0x5cb792['error'][_0x34e8('0x11')]);return _0x44d3bf(_0x5cb792[_0x34e8('0x10')][_0x34e8('0x11')]);}logger[_0x34e8('0x10')](_0x34e8('0xb'),_0x4567bd,_0x5cb792[_0x34e8('0x10')][_0x34e8('0x11')]);return _0x5b5ddc(_0x5cb792[_0x34e8('0x10')][_0x34e8('0x11')]);}else{logger['info'](_0x34e8('0xb'),_0x4567bd,_0x34e8('0xc'));_0x5b5ddc(_0x5cb792[_0x34e8('0x12')][_0x34e8('0x11')]);}})[_0x34e8('0x13')](function(_0x4a4d17){logger[_0x34e8('0x10')](_0x34e8('0xb'),_0x4567bd,_0x4a4d17);_0x44d3bf(_0x4a4d17);});});}exports[_0x34e8('0x14')]=function(_0x708dd4){var _0x381484=this;return new Promise(function(_0x11543c,_0x1f3d4d){return db[_0x34e8('0x15')][_0x34e8('0x16')]({'raw':_0x708dd4[_0x34e8('0x17')]?_0x708dd4[_0x34e8('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x708dd4[_0x34e8('0x17')]?_0x708dd4[_0x34e8('0x17')][_0x34e8('0x18')]||null:null,'attributes':_0x708dd4[_0x34e8('0x17')]?_0x708dd4[_0x34e8('0x17')][_0x34e8('0x19')]||null:null,'limit':_0x708dd4[_0x34e8('0x17')]?_0x708dd4[_0x34e8('0x17')]['limit']||null:null,'include':_0x708dd4[_0x34e8('0x17')]?_0x708dd4[_0x34e8('0x17')]['include']?_[_0x34e8('0x1a')](_0x708dd4['options'][_0x34e8('0x1b')],function(_0x381d0e){return{'model':db[_0x381d0e[_0x34e8('0x1c')]],'as':_0x381d0e['as'],'attributes':_0x381d0e['attributes'],'include':_0x381d0e['include']?_[_0x34e8('0x1a')](_0x381d0e[_0x34e8('0x1b')],function(_0xb8c9f){return{'model':db[_0xb8c9f[_0x34e8('0x1c')]],'as':_0xb8c9f['as'],'attributes':_0xb8c9f[_0x34e8('0x19')],'include':_0xb8c9f[_0x34e8('0x1b')]?_[_0x34e8('0x1a')](_0xb8c9f['include'],function(_0x29be75){return{'model':db[_0x29be75[_0x34e8('0x1c')]],'as':_0x29be75['as'],'attributes':_0x29be75[_0x34e8('0x19')]};}):[]};}):[]};}):[]:[]})[_0x34e8('0x9')](function(_0xe77c9e){logger[_0x34e8('0xa')](_0x34e8('0x14'),_0x708dd4);logger[_0x34e8('0xd')](_0x34e8('0x14'),_0x708dd4,JSON[_0x34e8('0xf')](_0xe77c9e));_0x11543c(_0xe77c9e);})[_0x34e8('0x13')](function(_0x6f4428){logger[_0x34e8('0x10')](_0x34e8('0x14'),_0x6f4428[_0x34e8('0x11')],_0x708dd4);_0x1f3d4d(_0x381484[_0x34e8('0x10')](0x1f4,_0x6f4428[_0x34e8('0x11')]));});});};exports['CreateMemberReport']=function(_0x3e7e42){var _0x1a3146=this;return new Promise(function(_0x5b951f,_0x461c32){return db[_0x34e8('0x15')][_0x34e8('0x1d')](_0x3e7e42[_0x34e8('0x1e')],{'raw':_0x3e7e42[_0x34e8('0x17')]?_0x3e7e42[_0x34e8('0x17')][_0x34e8('0x1f')]===undefined?!![]:![]:!![]})[_0x34e8('0x9')](function(_0x5e2fef){logger[_0x34e8('0xa')](_0x34e8('0x20'),_0x3e7e42);logger[_0x34e8('0xd')](_0x34e8('0x20'),_0x3e7e42,JSON[_0x34e8('0xf')](_0x5e2fef));_0x5b951f(_0x5e2fef);})[_0x34e8('0x13')](function(_0x5594d0){logger[_0x34e8('0x10')]('CreateMemberReport',_0x5594d0[_0x34e8('0x11')],_0x3e7e42);_0x461c32(_0x1a3146[_0x34e8('0x10')](0x1f4,_0x5594d0['message']));});});};exports[_0x34e8('0x21')]=function(_0x38a525){var _0x1fb985=this;return new Promise(function(_0xde0d37,_0x13ca19){return db[_0x34e8('0x15')][_0x34e8('0x22')](_0x38a525['body'],{'raw':_0x38a525['options']?_0x38a525[_0x34e8('0x17')][_0x34e8('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38a525[_0x34e8('0x17')]?_0x38a525['options'][_0x34e8('0x18')]||null:null,'attributes':_0x38a525[_0x34e8('0x17')]?_0x38a525[_0x34e8('0x17')][_0x34e8('0x19')]||null:null,'limit':_0x38a525[_0x34e8('0x17')]?_0x38a525[_0x34e8('0x17')][_0x34e8('0x23')]||null:null})[_0x34e8('0x9')](function(_0x50a32c){logger[_0x34e8('0xa')](_0x34e8('0x21'),_0x38a525);logger[_0x34e8('0xd')]('UpdateMemberReport',_0x38a525,JSON[_0x34e8('0xf')](_0x50a32c));_0xde0d37(_0x50a32c);})[_0x34e8('0x13')](function(_0x5349e2){logger['error'](_0x34e8('0x21'),_0x5349e2[_0x34e8('0x11')],_0x38a525);_0x13ca19(_0x1fb985['error'](0x1f4,_0x5349e2[_0x34e8('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 782f017..6605678 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 _0x2b34=['../../config/environment','./migration.controller','get','index','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3831ed,_0x5e88ce){var _0x5521ce=function(_0x15fef7){while(--_0x15fef7){_0x3831ed['push'](_0x3831ed['shift']());}};_0x5521ce(++_0x5e88ce);}(_0x2b34,0x165));var _0x42b3=function(_0x3e2b67,_0x5eae3c){_0x3e2b67=_0x3e2b67-0x0;var _0x419d32=_0x2b34[_0x3e2b67];return _0x419d32;};'use strict';var multer=require(_0x42b3('0x0'));var util=require(_0x42b3('0x1'));var path=require('path');var timeout=require(_0x42b3('0x2'));var express=require('express');var router=express[_0x42b3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x42b3('0x4'));var interaction=require(_0x42b3('0x5'));var config=require(_0x42b3('0x6'));var controller=require(_0x42b3('0x7'));router[_0x42b3('0x8')]('/',controller[_0x42b3('0x9')]);module[_0x42b3('0xa')]=router; \ No newline at end of file +var _0x04f1=['util','path','Router','fs-extra','../../components/auth/service','exports','multer'];(function(_0x5a37bb,_0x2c91a4){var _0x36f6b2=function(_0x2e652e){while(--_0x2e652e){_0x5a37bb['push'](_0x5a37bb['shift']());}};_0x36f6b2(++_0x2c91a4);}(_0x04f1,0x92));var _0x104f=function(_0x394f8b,_0x1c2873){_0x394f8b=_0x394f8b-0x0;var _0x37cd82=_0x04f1[_0x394f8b];return _0x37cd82;};'use strict';var multer=require(_0x104f('0x0'));var util=require(_0x104f('0x1'));var path=require(_0x104f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x104f('0x3')]();var fs_extra=require(_0x104f('0x4'));var auth=require(_0x104f('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./migration.controller');router['get']('/',controller['index']);module[_0x104f('0x6')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index c0f9ccd..598393b 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 _0xa1e1=['version','sequelize','exports','STRING'];(function(_0x408b34,_0xb7d872){var _0x1182aa=function(_0x1825c4){while(--_0x1825c4){_0x408b34['push'](_0x408b34['shift']());}};_0x1182aa(++_0xb7d872);}(_0xa1e1,0x1a1));var _0x1a1e=function(_0x980fef,_0x4223c4){_0x980fef=_0x980fef-0x0;var _0x52f662=_0xa1e1[_0x980fef];return _0x52f662;};'use strict';var Sequelize=require(_0x1a1e('0x0'));module[_0x1a1e('0x1')]={'version':{'type':Sequelize[_0x1a1e('0x2')],'unique':_0x1a1e('0x3')}}; \ No newline at end of file +var _0x52e0=['sequelize'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x52e0,0x1dc));var _0x052e=function(_0x57b913,_0x48b176){_0x57b913=_0x57b913-0x0;var _0x466aaa=_0x52e0[_0x57b913];return _0x466aaa;};'use strict';var Sequelize=require(_0x052e('0x0'));module['exports']={'version':{'type':Sequelize['STRING'],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 5a90156..8aec03c 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 _0x7dc5=['error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','Migration','includeAll','rows','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','json','apply','reject','save','then','destroy'];(function(_0x581e25,_0x1c5333){var _0x4435bd=function(_0x19ba88){while(--_0x19ba88){_0x581e25['push'](_0x581e25['shift']());}};_0x4435bd(++_0x1c5333);}(_0x7dc5,0xe7));var _0x57dc=function(_0x1a21ff,_0x4a7550){_0x1a21ff=_0x1a21ff-0x0;var _0x25afc1=_0x7dc5[_0x1a21ff];return _0x25afc1;};'use strict';var emlformat=require(_0x57dc('0x0'));var rimraf=require(_0x57dc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x57dc('0x2'));var rp=require(_0x57dc('0x3'));var moment=require(_0x57dc('0x4'));var BPromise=require(_0x57dc('0x5'));var Mustache=require(_0x57dc('0x6'));var util=require(_0x57dc('0x7'));var path=require(_0x57dc('0x8'));var sox=require(_0x57dc('0x9'));var csv=require(_0x57dc('0xa'));var ejs=require(_0x57dc('0xb'));var fs=require('fs');var fs_extra=require(_0x57dc('0xc'));var _=require(_0x57dc('0xd'));var squel=require(_0x57dc('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x57dc('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x57dc('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x57dc('0x11'))(_0x57dc('0x12'));var utils=require(_0x57dc('0x13'));var config=require(_0x57dc('0x14'));var licenseUtil=require(_0x57dc('0x15'));var db=require(_0x57dc('0x16'))['db'];function respondWithStatusCode(_0x29c757,_0x1829c6){_0x1829c6=_0x1829c6||0xcc;return function(_0x207b67){if(_0x207b67){return _0x29c757[_0x57dc('0x17')](_0x1829c6);}return _0x29c757['status'](_0x1829c6)[_0x57dc('0x18')]();};}function respondWithResult(_0x4524de,_0x158ec9){_0x158ec9=_0x158ec9||0xc8;return function(_0x582fb2){if(_0x582fb2){return _0x4524de[_0x57dc('0x19')](_0x158ec9)['json'](_0x582fb2);}};}function respondWithFilteredResult(_0x3695eb,_0x1427e2){return function(_0xfe92ac){if(_0xfe92ac){var _0x1aaec9=typeof _0x1427e2[_0x57dc('0x1a')]===_0x57dc('0x1b')&&typeof _0x1427e2['limit']===_0x57dc('0x1b');var _0x1b5007=_0xfe92ac[_0x57dc('0x1c')];var _0x97256f=_0x1aaec9?0x0:_0x1427e2['offset'];var _0x40b1dd=_0x1aaec9?_0xfe92ac[_0x57dc('0x1c')]:_0x1427e2[_0x57dc('0x1a')]+_0x1427e2[_0x57dc('0x1d')];var _0x381aef;if(_0x40b1dd>=_0x1b5007){_0x40b1dd=_0x1b5007;_0x381aef=0xc8;}else{_0x381aef=0xce;}_0x3695eb[_0x57dc('0x19')](_0x381aef);return _0x3695eb[_0x57dc('0x1e')]('Content-Range',_0x97256f+'-'+_0x40b1dd+'/'+_0x1b5007)[_0x57dc('0x1f')](_0xfe92ac);}return null;};}function patchUpdates(_0x59ee3e){return function(_0x4c03df){try{jsonpatch[_0x57dc('0x20')](_0x4c03df,_0x59ee3e,!![]);}catch(_0x3fe148){return BPromise[_0x57dc('0x21')](_0x3fe148);}return _0x4c03df[_0x57dc('0x22')]();};}function saveUpdates(_0x5ded82,_0x3ad4d8){return function(_0x442ba9){if(_0x442ba9){return _0x442ba9['update'](_0x5ded82)[_0x57dc('0x23')](function(_0x1b7074){return _0x1b7074;});}return null;};}function removeEntity(_0x3e9e43,_0x444157){return function(_0x397549){if(_0x397549){return _0x397549[_0x57dc('0x24')]()[_0x57dc('0x23')](function(){_0x3e9e43['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bf421,_0x509ca2){return function(_0x4d167a){if(!_0x4d167a){_0x4bf421[_0x57dc('0x17')](0x194);}return _0x4d167a;};}function handleError(_0x18ee89,_0x274ed3){_0x274ed3=_0x274ed3||0x1f4;return function(_0x43700a){logger[_0x57dc('0x25')](_0x43700a[_0x57dc('0x26')]);if(_0x43700a[_0x57dc('0x27')]){delete _0x43700a['name'];}_0x18ee89[_0x57dc('0x19')](_0x274ed3)[_0x57dc('0x28')](_0x43700a);};}exports[_0x57dc('0x29')]=function(_0x10c0dd,_0x52dad8){var _0x154013={},_0x19e014={},_0x4d74ba={'count':0x0,'rows':[]};var _0x3299c9=_[_0x57dc('0x2a')](db['Migration'][_0x57dc('0x2b')],function(_0x5910ca){return{'name':_0x5910ca[_0x57dc('0x2c')],'type':_0x5910ca[_0x57dc('0x2d')][_0x57dc('0x2e')]};});_0x19e014[_0x57dc('0x2f')]=_[_0x57dc('0x2a')](_0x3299c9,_0x57dc('0x27'));_0x19e014[_0x57dc('0x30')]=_['keys'](_0x10c0dd[_0x57dc('0x30')]);_0x19e014['filters']=_[_0x57dc('0x31')](_0x19e014[_0x57dc('0x2f')],_0x19e014['query']);_0x154013[_0x57dc('0x32')]=_['intersection'](_0x19e014[_0x57dc('0x2f')],qs['fields'](_0x10c0dd['query'][_0x57dc('0x33')]));_0x154013[_0x57dc('0x32')]=_0x154013[_0x57dc('0x32')][_0x57dc('0x34')]?_0x154013[_0x57dc('0x32')]:_0x19e014[_0x57dc('0x2f')];if(!_0x10c0dd['query'][_0x57dc('0x35')]('nolimit')){_0x154013[_0x57dc('0x1d')]=qs[_0x57dc('0x1d')](_0x10c0dd['query'][_0x57dc('0x1d')]);_0x154013[_0x57dc('0x1a')]=qs[_0x57dc('0x1a')](_0x10c0dd['query'][_0x57dc('0x1a')]);}_0x154013[_0x57dc('0x36')]=qs[_0x57dc('0x37')](_0x10c0dd[_0x57dc('0x30')]['sort']);_0x154013[_0x57dc('0x38')]=qs['filters'](_[_0x57dc('0x39')](_0x10c0dd[_0x57dc('0x30')],_0x19e014[_0x57dc('0x3a')]),_0x3299c9);if(_0x10c0dd[_0x57dc('0x30')][_0x57dc('0x3b')]){_0x154013['where']=_[_0x57dc('0x3c')](_0x154013[_0x57dc('0x38')],{'$or':_[_0x57dc('0x2a')](_0x3299c9,function(_0x388bc0){if(_0x388bc0[_0x57dc('0x2d')]!==_0x57dc('0x3d')){var _0x1d2197={};_0x1d2197[_0x388bc0['name']]={'$like':'%'+_0x10c0dd[_0x57dc('0x30')]['filter']+'%'};return _0x1d2197;}})});}_0x154013=_[_0x57dc('0x3c')]({},_0x154013,_0x10c0dd[_0x57dc('0x3e')]);var _0x18fc47={'where':_0x154013[_0x57dc('0x38')]};return db[_0x57dc('0x3f')][_0x57dc('0x1c')](_0x18fc47)[_0x57dc('0x23')](function(_0x3f1aa8){_0x4d74ba[_0x57dc('0x1c')]=_0x3f1aa8;if(_0x10c0dd[_0x57dc('0x30')][_0x57dc('0x40')]){_0x154013['include']=[{'all':!![]}];}return db[_0x57dc('0x3f')]['findAll'](_0x154013);})[_0x57dc('0x23')](function(_0x2eeb92){_0x4d74ba[_0x57dc('0x41')]=_0x2eeb92;return _0x4d74ba;})[_0x57dc('0x23')](respondWithFilteredResult(_0x52dad8,_0x154013))[_0x57dc('0x42')](handleError(_0x52dad8,null));}; \ No newline at end of file +var _0xd0d1=['../../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','reject','destroy','end','error','name','send','index','Migration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','map','VIRTUAL','then','includeAll','include','findAll','rows','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js'];(function(_0x25b0ed,_0x2aea92){var _0x41e9a9=function(_0x585184){while(--_0x585184){_0x25b0ed['push'](_0x25b0ed['shift']());}};_0x41e9a9(++_0x2aea92);}(_0xd0d1,0x79));var _0x1d0d=function(_0x19c7a9,_0x419029){_0x19c7a9=_0x19c7a9-0x0;var _0x20ce62=_0xd0d1[_0x19c7a9];return _0x20ce62;};'use strict';var emlformat=require(_0x1d0d('0x0'));var rimraf=require(_0x1d0d('0x1'));var zipdir=require(_0x1d0d('0x2'));var jsonpatch=require(_0x1d0d('0x3'));var rp=require('request-promise');var moment=require(_0x1d0d('0x4'));var BPromise=require(_0x1d0d('0x5'));var Mustache=require(_0x1d0d('0x6'));var util=require(_0x1d0d('0x7'));var path=require(_0x1d0d('0x8'));var sox=require('sox');var csv=require(_0x1d0d('0x9'));var ejs=require(_0x1d0d('0xa'));var fs=require('fs');var fs_extra=require(_0x1d0d('0xb'));var _=require(_0x1d0d('0xc'));var squel=require('squel');var crypto=require(_0x1d0d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1d0d('0xe'));var toCsv=require(_0x1d0d('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1d0d('0xf'));var qs=require(_0x1d0d('0x10'));var as=require(_0x1d0d('0x11'));var hardwareService=require(_0x1d0d('0x12'));var logger=require(_0x1d0d('0x13'))(_0x1d0d('0x14'));var utils=require(_0x1d0d('0x15'));var config=require(_0x1d0d('0x16'));var licenseUtil=require(_0x1d0d('0x17'));var db=require(_0x1d0d('0x18'))['db'];function respondWithStatusCode(_0x71b44a,_0x27e176){_0x27e176=_0x27e176||0xcc;return function(_0x34a533){if(_0x34a533){return _0x71b44a[_0x1d0d('0x19')](_0x27e176);}return _0x71b44a['status'](_0x27e176)['end']();};}function respondWithResult(_0x1f83fd,_0xe90b02){_0xe90b02=_0xe90b02||0xc8;return function(_0x53a1dc){if(_0x53a1dc){return _0x1f83fd[_0x1d0d('0x1a')](_0xe90b02)[_0x1d0d('0x1b')](_0x53a1dc);}};}function respondWithFilteredResult(_0x2af5df,_0xb49efd){return function(_0x1fb0d9){if(_0x1fb0d9){var _0x53cb10=typeof _0xb49efd[_0x1d0d('0x1c')]===_0x1d0d('0x1d')&&typeof _0xb49efd[_0x1d0d('0x1e')]===_0x1d0d('0x1d');var _0x71dadc=_0x1fb0d9[_0x1d0d('0x1f')];var _0x50852b=_0x53cb10?0x0:_0xb49efd[_0x1d0d('0x1c')];var _0x57c415=_0x53cb10?_0x1fb0d9['count']:_0xb49efd[_0x1d0d('0x1c')]+_0xb49efd[_0x1d0d('0x1e')];var _0x236000;if(_0x57c415>=_0x71dadc){_0x57c415=_0x71dadc;_0x236000=0xc8;}else{_0x236000=0xce;}_0x2af5df['status'](_0x236000);return _0x2af5df[_0x1d0d('0x20')](_0x1d0d('0x21'),_0x50852b+'-'+_0x57c415+'/'+_0x71dadc)[_0x1d0d('0x1b')](_0x1fb0d9);}return null;};}function patchUpdates(_0x3def8b){return function(_0x5d9432){try{jsonpatch['apply'](_0x5d9432,_0x3def8b,!![]);}catch(_0x252f87){return BPromise[_0x1d0d('0x22')](_0x252f87);}return _0x5d9432['save']();};}function saveUpdates(_0x54be4a,_0x295f84){return function(_0x5fa88f){if(_0x5fa88f){return _0x5fa88f['update'](_0x54be4a)['then'](function(_0x4556a1){return _0x4556a1;});}return null;};}function removeEntity(_0x37883a,_0xae4882){return function(_0x17da3f){if(_0x17da3f){return _0x17da3f[_0x1d0d('0x23')]()['then'](function(){_0x37883a[_0x1d0d('0x1a')](0xcc)[_0x1d0d('0x24')]();});}};}function handleEntityNotFound(_0x4ca187,_0x322330){return function(_0xaae6f3){if(!_0xaae6f3){_0x4ca187['sendStatus'](0x194);}return _0xaae6f3;};}function handleError(_0x5a1a1f,_0x49471d){_0x49471d=_0x49471d||0x1f4;return function(_0x476ab4){logger[_0x1d0d('0x25')](_0x476ab4['stack']);if(_0x476ab4[_0x1d0d('0x26')]){delete _0x476ab4[_0x1d0d('0x26')];}_0x5a1a1f[_0x1d0d('0x1a')](_0x49471d)[_0x1d0d('0x27')](_0x476ab4);};}exports[_0x1d0d('0x28')]=function(_0xd5d758,_0x270247){var _0x47a471={},_0x5af4f7={},_0x5a5cfb={'count':0x0,'rows':[]};var _0x1ac436=_['map'](db[_0x1d0d('0x29')][_0x1d0d('0x2a')],function(_0x252981){return{'name':_0x252981[_0x1d0d('0x2b')],'type':_0x252981[_0x1d0d('0x2c')][_0x1d0d('0x2d')]};});_0x5af4f7[_0x1d0d('0x2e')]=_['map'](_0x1ac436,_0x1d0d('0x26'));_0x5af4f7[_0x1d0d('0x2f')]=_[_0x1d0d('0x30')](_0xd5d758[_0x1d0d('0x2f')]);_0x5af4f7[_0x1d0d('0x31')]=_[_0x1d0d('0x32')](_0x5af4f7[_0x1d0d('0x2e')],_0x5af4f7[_0x1d0d('0x2f')]);_0x47a471[_0x1d0d('0x33')]=_[_0x1d0d('0x32')](_0x5af4f7[_0x1d0d('0x2e')],qs['fields'](_0xd5d758[_0x1d0d('0x2f')][_0x1d0d('0x34')]));_0x47a471[_0x1d0d('0x33')]=_0x47a471[_0x1d0d('0x33')][_0x1d0d('0x35')]?_0x47a471[_0x1d0d('0x33')]:_0x5af4f7[_0x1d0d('0x2e')];if(!_0xd5d758[_0x1d0d('0x2f')][_0x1d0d('0x36')](_0x1d0d('0x37'))){_0x47a471['limit']=qs['limit'](_0xd5d758['query'][_0x1d0d('0x1e')]);_0x47a471['offset']=qs[_0x1d0d('0x1c')](_0xd5d758[_0x1d0d('0x2f')][_0x1d0d('0x1c')]);}_0x47a471[_0x1d0d('0x38')]=qs['sort'](_0xd5d758['query'][_0x1d0d('0x39')]);_0x47a471['where']=qs[_0x1d0d('0x31')](_['pick'](_0xd5d758['query'],_0x5af4f7[_0x1d0d('0x31')]),_0x1ac436);if(_0xd5d758[_0x1d0d('0x2f')][_0x1d0d('0x3a')]){_0x47a471[_0x1d0d('0x3b')]=_[_0x1d0d('0x3c')](_0x47a471['where'],{'$or':_[_0x1d0d('0x3d')](_0x1ac436,function(_0x51d9e8){if(_0x51d9e8['type']!==_0x1d0d('0x3e')){var _0x4db086={};_0x4db086[_0x51d9e8['name']]={'$like':'%'+_0xd5d758[_0x1d0d('0x2f')][_0x1d0d('0x3a')]+'%'};return _0x4db086;}})});}_0x47a471=_['merge']({},_0x47a471,_0xd5d758['options']);var _0x34dbcd={'where':_0x47a471[_0x1d0d('0x3b')]};return db[_0x1d0d('0x29')][_0x1d0d('0x1f')](_0x34dbcd)[_0x1d0d('0x3f')](function(_0x18d1d5){_0x5a5cfb[_0x1d0d('0x1f')]=_0x18d1d5;if(_0xd5d758['query'][_0x1d0d('0x40')]){_0x47a471[_0x1d0d('0x41')]=[{'all':!![]}];}return db[_0x1d0d('0x29')][_0x1d0d('0x42')](_0x47a471);})[_0x1d0d('0x3f')](function(_0x26cec9){_0x5a5cfb[_0x1d0d('0x43')]=_0x26cec9;return _0x5a5cfb;})['then'](respondWithFilteredResult(_0x270247,_0x47a471))['catch'](handleError(_0x270247,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 772367a..f494a74 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 _0xb057=['rimraf','./migration.attributes','exports','define','Migration','../../config/logger','api','moment','bluebird','path'];(function(_0x256455,_0x386945){var _0x4b3825=function(_0x1699ea){while(--_0x1699ea){_0x256455['push'](_0x256455['shift']());}};_0x4b3825(++_0x386945);}(_0xb057,0x1e5));var _0x7b05=function(_0x23267c,_0x552594){_0x23267c=_0x23267c-0x0;var _0x43dfac=_0xb057[_0x23267c];return _0x43dfac;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7b05('0x0'))(_0x7b05('0x1'));var moment=require(_0x7b05('0x2'));var BPromise=require(_0x7b05('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7b05('0x4'));var rimraf=require(_0x7b05('0x5'));var config=require('../../config/environment');var attributes=require(_0x7b05('0x6'));module[_0x7b05('0x7')]=function(_0x351617,_0x20b9ec){return _0x351617[_0x7b05('0x8')](_0x7b05('0x9'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8aa9=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','Migration','migrations'];(function(_0x708cfa,_0x413d56){var _0x2418ca=function(_0x215ea2){while(--_0x215ea2){_0x708cfa['push'](_0x708cfa['shift']());}};_0x2418ca(++_0x413d56);}(_0x8aa9,0x15e));var _0x98aa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8aa9[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x98aa('0x0'));var util=require(_0x98aa('0x1'));var logger=require(_0x98aa('0x2'))(_0x98aa('0x3'));var moment=require(_0x98aa('0x4'));var BPromise=require(_0x98aa('0x5'));var rp=require(_0x98aa('0x6'));var fs=require('fs');var path=require(_0x98aa('0x7'));var rimraf=require(_0x98aa('0x8'));var config=require(_0x98aa('0x9'));var attributes=require(_0x98aa('0xa'));module[_0x98aa('0xb')]=function(_0x2ba040,_0x16a27c){return _0x2ba040['define'](_0x98aa('0xc'),attributes,{'tableName':_0x98aa('0xd'),'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 89ee539..b33b8c1 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 _0x69af=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','util'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x69af,0x17b));var _0xf69a=function(_0x5704ca,_0x38d30e){_0x5704ca=_0x5704ca-0x0;var _0x37edf3=_0x69af[_0x5704ca];return _0x37edf3;};'use strict';var _=require('lodash');var util=require(_0xf69a('0x0'));var moment=require(_0xf69a('0x1'));var BPromise=require(_0xf69a('0x2'));var rs=require(_0xf69a('0x3'));var fs=require('fs');var Redis=require(_0xf69a('0x4'));var db=require(_0xf69a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf69a('0x6'))(_0xf69a('0x7'));var config=require(_0xf69a('0x8'));var jayson=require(_0xf69a('0x9'));var client=jayson[_0xf69a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10c1b0,_0x3669ef,_0xb0233d){return new BPromise(function(_0x4ffe11,_0x4a3496){return client[_0xf69a('0xb')](_0x10c1b0,_0xb0233d)[_0xf69a('0xc')](function(_0x16a06e){logger[_0xf69a('0xd')](_0xf69a('0xe'),_0x3669ef,'request\x20sent');logger['debug']('Migration,\x20%s,\x20%s,\x20%s',_0x3669ef,_0xf69a('0xf'),JSON[_0xf69a('0x10')](_0x16a06e));if(_0x16a06e[_0xf69a('0x11')]){if(_0x16a06e[_0xf69a('0x11')]['code']===0x1f4){logger[_0xf69a('0x11')](_0xf69a('0xe'),_0x3669ef,_0x16a06e[_0xf69a('0x11')][_0xf69a('0x12')]);return _0x4a3496(_0x16a06e[_0xf69a('0x11')][_0xf69a('0x12')]);}logger[_0xf69a('0x11')](_0xf69a('0xe'),_0x3669ef,_0x16a06e[_0xf69a('0x11')][_0xf69a('0x12')]);return _0x4ffe11(_0x16a06e['error'][_0xf69a('0x12')]);}else{logger[_0xf69a('0xd')](_0xf69a('0xe'),_0x3669ef,_0xf69a('0xf'));_0x4ffe11(_0x16a06e['result'][_0xf69a('0x12')]);}})[_0xf69a('0x13')](function(_0x17660b){logger[_0xf69a('0x11')](_0xf69a('0xe'),_0x3669ef,_0x17660b);_0x4a3496(_0x17660b);});});} \ No newline at end of file +var _0xefe3=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','randomstring'];(function(_0x528db,_0x31f893){var _0x5365aa=function(_0x485e5a){while(--_0x485e5a){_0x528db['push'](_0x528db['shift']());}};_0x5365aa(++_0x31f893);}(_0xefe3,0xf5));var _0x3efe=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xefe3[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x3efe('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3efe('0x1'));var fs=require('fs');var Redis=require(_0x3efe('0x2'));var db=require(_0x3efe('0x3'))['db'];var utils=require(_0x3efe('0x4'));var logger=require('../../config/logger')(_0x3efe('0x5'));var config=require('../../config/environment');var jayson=require(_0x3efe('0x6'));var client=jayson['client'][_0x3efe('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x60487e,_0x1f697b,_0x195d5d){return new BPromise(function(_0x30d2e8,_0x474c9a){return client['request'](_0x60487e,_0x195d5d)[_0x3efe('0x8')](function(_0x54fec1){logger[_0x3efe('0x9')](_0x3efe('0xa'),_0x1f697b,_0x3efe('0xb'));logger[_0x3efe('0xc')](_0x3efe('0xd'),_0x1f697b,_0x3efe('0xb'),JSON['stringify'](_0x54fec1));if(_0x54fec1['error']){if(_0x54fec1[_0x3efe('0xe')][_0x3efe('0xf')]===0x1f4){logger[_0x3efe('0xe')](_0x3efe('0xa'),_0x1f697b,_0x54fec1[_0x3efe('0xe')][_0x3efe('0x10')]);return _0x474c9a(_0x54fec1[_0x3efe('0xe')][_0x3efe('0x10')]);}logger[_0x3efe('0xe')](_0x3efe('0xa'),_0x1f697b,_0x54fec1[_0x3efe('0xe')]['message']);return _0x30d2e8(_0x54fec1[_0x3efe('0xe')][_0x3efe('0x10')]);}else{logger[_0x3efe('0x9')](_0x3efe('0xa'),_0x1f697b,'request\x20sent');_0x30d2e8(_0x54fec1[_0x3efe('0x11')][_0x3efe('0x10')]);}})[_0x3efe('0x12')](function(_0x515e1b){logger['error'](_0x3efe('0xa'),_0x1f697b,_0x515e1b);_0x474c9a(_0x515e1b);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 3156d70..fa23e97 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 _0x1261=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','index','get','isAuthenticated','show','post','create','/:id','update'];(function(_0x216799,_0x44b817){var _0x3661c3=function(_0x28f85e){while(--_0x28f85e){_0x216799['push'](_0x216799['shift']());}};_0x3661c3(++_0x44b817);}(_0x1261,0x144));var _0x1126=function(_0x5448a9,_0x4764da){_0x5448a9=_0x5448a9-0x0;var _0x1924af=_0x1261[_0x5448a9];return _0x1924af;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xe')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0xf')]);router['put'](_0x1126('0x10'),auth[_0x1126('0xc')](),controller[_0x1126('0x11')]);router['delete'](_0x1126('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x1126('0x12')]=router; \ No newline at end of file +var _0xc42c=['connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','post','put','update','delete','exports','util','path'];(function(_0x69b8c3,_0x4f6c1b){var _0x15b301=function(_0x1073d4){while(--_0x1073d4){_0x69b8c3['push'](_0x69b8c3['shift']());}};_0x15b301(++_0x4f6c1b);}(_0xc42c,0x13e));var _0xcc42=function(_0x4ea21b,_0x589da2){_0x4ea21b=_0x4ea21b-0x0;var _0x5a6d93=_0xc42c[_0x4ea21b];return _0x5a6d93;};'use strict';var multer=require('multer');var util=require(_0xcc42('0x0'));var path=require(_0xcc42('0x1'));var timeout=require(_0xcc42('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcc42('0x3'));var interaction=require(_0xcc42('0x4'));var config=require(_0xcc42('0x5'));var controller=require(_0xcc42('0x6'));router[_0xcc42('0x7')]('/',auth[_0xcc42('0x8')](),controller[_0xcc42('0x9')]);router[_0xcc42('0x7')](_0xcc42('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xcc42('0xb')]('/',auth[_0xcc42('0x8')](),controller['create']);router[_0xcc42('0xc')]('/:id',auth['isAuthenticated'](),controller[_0xcc42('0xd')]);router[_0xcc42('0xe')](_0xcc42('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xcc42('0xf')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index d366bbf..c6f90ea 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 _0x4e3c=['ENUM','localnet','stun','turn','STRING','exports'];(function(_0x4df78b,_0xd7466c){var _0x5abffe=function(_0x3d353d){while(--_0x3d353d){_0x4df78b['push'](_0x4df78b['shift']());}};_0x5abffe(++_0xd7466c);}(_0x4e3c,0x1e5));var _0xc4e3=function(_0xb42da0,_0x5e98b4){_0xb42da0=_0xb42da0-0x0;var _0x4036c7=_0x4e3c[_0xb42da0];return _0x4036c7;};'use strict';var Sequelize=require('sequelize');module[_0xc4e3('0x0')]={'type':{'type':Sequelize[_0xc4e3('0x1')](_0xc4e3('0x2'),'externip',_0xc4e3('0x3'),_0xc4e3('0x4'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xc4e3('0x5')]},'password':{'type':Sequelize[_0xc4e3('0x5')]}}; \ No newline at end of file +var _0x7442=['turn','STRING','sequelize','exports','ENUM','localnet','stun'];(function(_0x1b863f,_0x37a989){var _0x494918=function(_0x5f154b){while(--_0x5f154b){_0x1b863f['push'](_0x1b863f['shift']());}};_0x494918(++_0x37a989);}(_0x7442,0x191));var _0x2744=function(_0x598bc1,_0x543990){_0x598bc1=_0x598bc1-0x0;var _0x14625d=_0x7442[_0x598bc1];return _0x14625d;};'use strict';var Sequelize=require(_0x2744('0x0'));module[_0x2744('0x1')]={'type':{'type':Sequelize[_0x2744('0x2')](_0x2744('0x3'),'externip',_0x2744('0x4'),_0x2744('0x5'))},'value':{'type':Sequelize[_0x2744('0x6')]},'username':{'type':Sequelize[_0x2744('0x6')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 4bb8ef0..7f4d639 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 _0xf920=['rows','show','keys','rawAttributes','include','create','readFileSync','join','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','toUpperCase','root','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','body','toLowerCase','chan_sip.so','find','params','STUN','TURN','path','ejs','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','json','offset','limit','undefined','count','status','Content-Range','update','destroy','end','sendStatus','stack','name','send','index','map','Network','fieldName','type','model','query','filters','intersection','fields','attributes','length','order','sort','pick','filter','where','merge','VIRTUAL','options','findAll'];(function(_0x1e6e4e,_0x2b1b09){var _0x3d746b=function(_0x4483dd){while(--_0x4483dd){_0x1e6e4e['push'](_0x1e6e4e['shift']());}};_0x3d746b(++_0x2b1b09);}(_0xf920,0x1b7));var _0x0f92=function(_0x3cf387,_0x31ed26){_0x3cf387=_0x3cf387-0x0;var _0x24425f=_0xf920[_0x3cf387];return _0x24425f;};'use strict';var util=require('util');var path=require(_0x0f92('0x0'));var ejs=require(_0x0f92('0x1'));var fs=require('fs');var _=require('lodash');var qs=require('../../components/parsers/qs');var logger=require(_0x0f92('0x2'))(_0x0f92('0x3'));var config=require(_0x0f92('0x4'));var db=require(_0x0f92('0x5'))['db'];var jayson=require(_0x0f92('0x6'));var client=jayson['client'][_0x0f92('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1bb1ef,_0xb2a923,_0x5ef23c,_0x5cdc5d){return new Promise(function(_0x54ebe9,_0x2d1978){var _0x54b9b5=_0x5cdc5d||client;return _0x54b9b5[_0x0f92('0x8')](_0x1bb1ef,_0x5ef23c)[_0x0f92('0x9')](function(_0x1f0f50){logger['info'](_0x0f92('0xa'),_0xb2a923,_0x0f92('0xb'));logger[_0x0f92('0xc')]('Network,\x20%s,\x20%s,\x20%s',_0xb2a923,_0x0f92('0xb'),JSON[_0x0f92('0xd')](_0x1f0f50));if(_0x1f0f50[_0x0f92('0xe')]){if(_0x1f0f50[_0x0f92('0xe')]['code']===0x1f4){logger['error']('Network,\x20%s,\x20%s',_0xb2a923,_0x1f0f50[_0x0f92('0xe')][_0x0f92('0xf')]);return _0x2d1978(_0x1f0f50[_0x0f92('0xe')][_0x0f92('0xf')]);}logger[_0x0f92('0xe')](_0x0f92('0xa'),_0xb2a923,_0x1f0f50['error'][_0x0f92('0xf')]);return _0x54ebe9(_0x1f0f50[_0x0f92('0xe')][_0x0f92('0xf')]);}else{logger['info'](_0x0f92('0xa'),_0xb2a923,_0x0f92('0xb'));_0x54ebe9(_0x1f0f50[_0x0f92('0x10')][_0x0f92('0xf')]);}})[_0x0f92('0x11')](function(_0xc06e5c){logger[_0x0f92('0xe')](_0x0f92('0xa'),_0xb2a923,_0xc06e5c);_0x2d1978(_0xc06e5c);});});}function respondWithResult(_0x22b1ad,_0x20ff92){_0x20ff92=_0x20ff92||0xc8;return function(_0x4e23d6){if(_0x4e23d6){return _0x22b1ad['status'](_0x20ff92)[_0x0f92('0x12')](_0x4e23d6);}};}function respondWithFilteredResult(_0x203590,_0x25c8e5){return function(_0x126d06){if(_0x126d06){var _0x59e754=typeof _0x25c8e5[_0x0f92('0x13')]==='undefined'&&typeof _0x25c8e5[_0x0f92('0x14')]===_0x0f92('0x15');var _0x5d82e9=_0x126d06[_0x0f92('0x16')];var _0xedcce1=_0x59e754?0x0:_0x25c8e5['offset'];var _0x579596=_0x59e754?_0x126d06['count']:_0x25c8e5[_0x0f92('0x13')]+_0x25c8e5['limit'];var _0x4d4134;if(_0x579596>=_0x5d82e9){_0x579596=_0x5d82e9;_0x4d4134=0xc8;}else{_0x4d4134=0xce;}_0x203590[_0x0f92('0x17')](_0x4d4134);return _0x203590['set'](_0x0f92('0x18'),_0xedcce1+'-'+_0x579596+'/'+_0x5d82e9)[_0x0f92('0x12')](_0x126d06);}return null;};}function saveUpdates(_0x2e5a93){return function(_0x32825b){if(_0x32825b){return _0x32825b[_0x0f92('0x19')](_0x2e5a93)[_0x0f92('0x9')](function(_0x4ca221){return _0x4ca221;});}return null;};}function removeEntity(_0xa58d3e){return function(_0x31623a){if(_0x31623a){return _0x31623a[_0x0f92('0x1a')]()['then'](function(){_0xa58d3e[_0x0f92('0x17')](0xcc)[_0x0f92('0x1b')]();});}};}function handleEntityNotFound(_0x2f771f){return function(_0x3789e0){if(!_0x3789e0){_0x2f771f[_0x0f92('0x1c')](0x194);}return _0x3789e0;};}function handleError(_0x14adae,_0x562afd){_0x562afd=_0x562afd||0x1f4;return function(_0xd086f3){logger['error'](_0xd086f3[_0x0f92('0x1d')]);if(_0xd086f3[_0x0f92('0x1e')]){delete _0xd086f3[_0x0f92('0x1e')];}_0x14adae['status'](_0x562afd)[_0x0f92('0x1f')](_0xd086f3);};}exports[_0x0f92('0x20')]=function(_0x1bf7f4,_0x4ea808){var _0x4361b1={},_0x4d4ccd={},_0x3b8f31={'count':0x0,'rows':[]};var _0x5896c5=_[_0x0f92('0x21')](db[_0x0f92('0x22')]['rawAttributes'],function(_0xf30360){return{'name':_0xf30360[_0x0f92('0x23')],'type':_0xf30360[_0x0f92('0x24')]['key']};});_0x4d4ccd[_0x0f92('0x25')]=_[_0x0f92('0x21')](_0x5896c5,_0x0f92('0x1e'));_0x4d4ccd[_0x0f92('0x26')]=_['keys'](_0x1bf7f4[_0x0f92('0x26')]);_0x4d4ccd[_0x0f92('0x27')]=_['intersection'](_0x4d4ccd[_0x0f92('0x25')],_0x4d4ccd[_0x0f92('0x26')]);_0x4361b1['attributes']=_[_0x0f92('0x28')](_0x4d4ccd['model'],qs[_0x0f92('0x29')](_0x1bf7f4[_0x0f92('0x26')]['fields']));_0x4361b1[_0x0f92('0x2a')]=_0x4361b1[_0x0f92('0x2a')][_0x0f92('0x2b')]?_0x4361b1['attributes']:_0x4d4ccd[_0x0f92('0x25')];if(!_0x1bf7f4[_0x0f92('0x26')]['hasOwnProperty']('nolimit')){_0x4361b1[_0x0f92('0x14')]=qs[_0x0f92('0x14')](_0x1bf7f4['query']['limit']);_0x4361b1[_0x0f92('0x13')]=qs[_0x0f92('0x13')](_0x1bf7f4[_0x0f92('0x26')][_0x0f92('0x13')]);}_0x4361b1[_0x0f92('0x2c')]=qs['sort'](_0x1bf7f4['query'][_0x0f92('0x2d')]);_0x4361b1['where']=qs[_0x0f92('0x27')](_[_0x0f92('0x2e')](_0x1bf7f4[_0x0f92('0x26')],_0x4d4ccd[_0x0f92('0x27')]),_0x5896c5);if(_0x1bf7f4[_0x0f92('0x26')][_0x0f92('0x2f')]){_0x4361b1[_0x0f92('0x30')]=_[_0x0f92('0x31')](_0x4361b1[_0x0f92('0x30')],{'$or':_[_0x0f92('0x21')](_0x5896c5,function(_0x12e40f){if(_0x12e40f[_0x0f92('0x24')]!==_0x0f92('0x32')){var _0xa16bb2={};_0xa16bb2[_0x12e40f[_0x0f92('0x1e')]]={'$like':'%'+_0x1bf7f4[_0x0f92('0x26')][_0x0f92('0x2f')]+'%'};return _0xa16bb2;}})});}_0x4361b1=_[_0x0f92('0x31')]({},_0x4361b1,_0x1bf7f4[_0x0f92('0x33')]);var _0x20b489={'where':_0x4361b1[_0x0f92('0x30')]};return db[_0x0f92('0x22')][_0x0f92('0x16')](_0x20b489)[_0x0f92('0x9')](function(_0x16ce38){_0x3b8f31[_0x0f92('0x16')]=_0x16ce38;if(_0x1bf7f4['query']['includeAll']){_0x4361b1['include']=[{'all':!![]}];}return db['Network'][_0x0f92('0x34')](_0x4361b1);})['then'](function(_0x198e04){_0x3b8f31[_0x0f92('0x35')]=_0x198e04;return _0x3b8f31;})[_0x0f92('0x9')](respondWithFilteredResult(_0x4ea808,_0x4361b1))[_0x0f92('0x11')](handleError(_0x4ea808,null));};exports[_0x0f92('0x36')]=function(_0x17cc0c,_0x21d0da){var _0x19ac55={'raw':!![],'where':{'id':_0x17cc0c['params']['id']}},_0x20313d={};_0x20313d[_0x0f92('0x25')]=_[_0x0f92('0x37')](db[_0x0f92('0x22')][_0x0f92('0x38')]);_0x20313d[_0x0f92('0x26')]=_[_0x0f92('0x37')](_0x17cc0c[_0x0f92('0x26')]);_0x20313d[_0x0f92('0x27')]=_[_0x0f92('0x28')](_0x20313d[_0x0f92('0x25')],_0x20313d[_0x0f92('0x26')]);_0x19ac55[_0x0f92('0x2a')]=_[_0x0f92('0x28')](_0x20313d['model'],qs[_0x0f92('0x29')](_0x17cc0c[_0x0f92('0x26')][_0x0f92('0x29')]));_0x19ac55[_0x0f92('0x2a')]=_0x19ac55[_0x0f92('0x2a')][_0x0f92('0x2b')]?_0x19ac55['attributes']:_0x20313d[_0x0f92('0x25')];if(_0x17cc0c[_0x0f92('0x26')]['includeAll']){_0x19ac55[_0x0f92('0x39')]=[{'all':!![]}];}_0x19ac55=_[_0x0f92('0x31')]({},_0x19ac55,_0x17cc0c[_0x0f92('0x33')]);return db['Network']['find'](_0x19ac55)[_0x0f92('0x9')](handleEntityNotFound(_0x21d0da,null))['then'](respondWithResult(_0x21d0da,null))['catch'](handleError(_0x21d0da,null));};exports[_0x0f92('0x3a')]=function(_0x4e55a5,_0x384f9c){var _0x59e202;return db[_0x0f92('0x22')][_0x0f92('0x3a')](_0x4e55a5['body'],{'raw':!![]})[_0x0f92('0x9')](function(_0x55bb1a){_0x59e202=_0x55bb1a;return db[_0x0f92('0x22')][_0x0f92('0x34')]({'where':{'type':_0x4e55a5['body']['type']},'raw':!![]});})['then'](function(_0x48f508){if(_0x59e202[_0x0f92('0x24')]['toUpperCase']()=='STUN'){var _0x3db479=fs[_0x0f92('0x3b')](path[_0x0f92('0x3c')](config['root'],_0x0f92('0x3d')),_0x0f92('0x3e'));var _0x5a281c=ejs[_0x0f92('0x3f')](_0x3db479,{'networks':_0x48f508||[]});fs[_0x0f92('0x40')](_0x0f92('0x41'),_0x5a281c);return respondWithRpcPromise(_0x0f92('0x42'),_0x0f92('0x3a'),{'module':_0x0f92('0x43')});}else if(_0x59e202[_0x0f92('0x24')][_0x0f92('0x44')]()=='TURN'){var _0x20493e=fs['readFileSync'](path[_0x0f92('0x3c')](config[_0x0f92('0x45')],_0x0f92('0x46')),_0x0f92('0x3e'));var _0xaf7c3e=ejs[_0x0f92('0x3f')](_0x20493e,{'networks':_0x48f508||[]});fs[_0x0f92('0x40')](_0x0f92('0x47'),_0xaf7c3e);return respondWithRpcPromise('Reload',_0x0f92('0x3a'),{'module':_0x0f92('0x43')});}else{var _0xd1c3a0=fs['readFileSync'](path[_0x0f92('0x3c')](config['root'],_0x0f92('0x48')),_0x0f92('0x3e'));var _0x443f5c=ejs['render'](_0xd1c3a0,{'networks':_0x48f508||[]});fs['writeFileSync'](util[_0x0f92('0x49')](_0x0f92('0x4a'),_0x4e55a5[_0x0f92('0x4b')]['type'][_0x0f92('0x4c')]()),_0x443f5c);return respondWithRpcPromise(_0x0f92('0x42'),_0x0f92('0x3a'),{'module':_0x0f92('0x4d')});}})[_0x0f92('0x9')](function(){return _0x59e202;})[_0x0f92('0x9')](respondWithResult(_0x384f9c,0xc9))[_0x0f92('0x11')](handleError(_0x384f9c,null));};exports[_0x0f92('0x19')]=function(_0x368ef4,_0x312441){var _0x27ab00;return db[_0x0f92('0x22')][_0x0f92('0x4e')]({'where':{'id':_0x368ef4[_0x0f92('0x4f')]['id']}})[_0x0f92('0x9')](handleEntityNotFound(_0x312441,null))[_0x0f92('0x9')](saveUpdates(_0x368ef4[_0x0f92('0x4b')],null))[_0x0f92('0x9')](function(_0x3e2562){if(_0x3e2562){_0x27ab00=_0x3e2562;return db[_0x0f92('0x22')][_0x0f92('0x34')]({'where':{'type':_0x27ab00[_0x0f92('0x24')]},'raw':!![]});}return null;})['then'](function(_0x5905fc){if(_0x27ab00[_0x0f92('0x24')][_0x0f92('0x44')]()==_0x0f92('0x50')){var _0x40b82b=fs[_0x0f92('0x3b')](path['join'](config[_0x0f92('0x45')],_0x0f92('0x3d')),_0x0f92('0x3e'));var _0x5138fa=ejs[_0x0f92('0x3f')](_0x40b82b,{'networks':_0x5905fc||[]});fs[_0x0f92('0x40')](_0x0f92('0x41'),_0x5138fa);return respondWithRpcPromise(_0x0f92('0x42'),_0x0f92('0x19'),{'module':_0x0f92('0x43')});}else if(_0x27ab00[_0x0f92('0x24')][_0x0f92('0x44')]()=='TURN'){var _0x4b8a49=fs['readFileSync'](path[_0x0f92('0x3c')](config['root'],_0x0f92('0x46')),_0x0f92('0x3e'));var _0xfd5c11=ejs['render'](_0x4b8a49,{'networks':_0x5905fc||[]});fs[_0x0f92('0x40')](_0x0f92('0x47'),_0xfd5c11);return respondWithRpcPromise('Reload',_0x0f92('0x19'),{'module':_0x0f92('0x43')});}else{var _0x4cdb39=fs['readFileSync'](path[_0x0f92('0x3c')](config[_0x0f92('0x45')],_0x0f92('0x48')),_0x0f92('0x3e'));var _0x1390cb=ejs[_0x0f92('0x3f')](_0x4cdb39,{'networks':_0x5905fc||[]});fs[_0x0f92('0x40')](util[_0x0f92('0x49')](_0x0f92('0x4a'),_0x368ef4['body']['type'][_0x0f92('0x4c')]()),_0x1390cb);return respondWithRpcPromise(_0x0f92('0x42'),_0x0f92('0x19'),{'module':_0x0f92('0x4d')});}})['then'](function(_0x14821f){if(_0x14821f){return _0x27ab00;}return null;})['then'](respondWithResult(_0x312441,null))[_0x0f92('0x11')](handleError(_0x312441,null));};exports[_0x0f92('0x1a')]=function(_0x233560,_0x2b58d0){var _0xba0a10;return db[_0x0f92('0x22')]['find']({'where':{'id':_0x233560[_0x0f92('0x4f')]['id']}})[_0x0f92('0x9')](function(_0x4c5b70){_0xba0a10=_0x4c5b70;return _0x4c5b70;})[_0x0f92('0x9')](handleEntityNotFound(_0x2b58d0,null))['then'](removeEntity(_0x2b58d0,null))[_0x0f92('0x9')](function(){if(_0xba0a10){return db[_0x0f92('0x22')][_0x0f92('0x34')]({'where':{'type':_0xba0a10['type']},'raw':!![]});}})[_0x0f92('0x9')](function(_0x573adf){if(_0xba0a10[_0x0f92('0x24')][_0x0f92('0x44')]()==_0x0f92('0x50')){var _0x364024=fs[_0x0f92('0x3b')](path[_0x0f92('0x3c')](config[_0x0f92('0x45')],_0x0f92('0x3d')),_0x0f92('0x3e'));var _0x17a073=ejs['render'](_0x364024,{'networks':_0x573adf||[]});fs[_0x0f92('0x40')](_0x0f92('0x41'),_0x17a073);return respondWithRpcPromise(_0x0f92('0x42'),'destroy',{'module':_0x0f92('0x43')});}else if(_0xba0a10[_0x0f92('0x24')][_0x0f92('0x44')]()==_0x0f92('0x51')){var _0x46446c=fs[_0x0f92('0x3b')](path[_0x0f92('0x3c')](config[_0x0f92('0x45')],_0x0f92('0x46')),_0x0f92('0x3e'));var _0x356dfd=ejs[_0x0f92('0x3f')](_0x46446c,{'networks':_0x573adf||[]});fs[_0x0f92('0x40')](_0x0f92('0x47'),_0x356dfd);return respondWithRpcPromise(_0x0f92('0x42'),_0x0f92('0x1a'),{'module':_0x0f92('0x43')});}else{var _0x427cf0=fs['readFileSync'](path[_0x0f92('0x3c')](config[_0x0f92('0x45')],'server/files/templates/network.ejs'),_0x0f92('0x3e'));var _0x4fe2d6=ejs[_0x0f92('0x3f')](_0x427cf0,{'networks':_0x573adf||[]});fs[_0x0f92('0x40')](util['format'](_0x0f92('0x4a'),_0xba0a10[_0x0f92('0x24')][_0x0f92('0x4c')]()),_0x4fe2d6);return respondWithRpcPromise(_0x0f92('0x42'),_0x0f92('0x1a'),{'module':_0x0f92('0x4d')});}})[_0x0f92('0x11')](handleError(_0x2b58d0,null));}; \ No newline at end of file +var _0x186d=['toLowerCase','chan_sip.so','util','ejs','../../components/parsers/qs','api','jayson/promise','client','http','request','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','message','info','status','json','offset','undefined','limit','set','Content-Range','then','destroy','sendStatus','name','send','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','count','includeAll','include','rows','show','params','Network','options','catch','create','body','findAll','type','STUN','root','server/files/templates/stun_multiple.ejs','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','toUpperCase','readFileSync','join','utf8','render','writeFileSync','/etc/asterisk/turn_xcally.conf','/etc/asterisk/sip_xcally_%s.conf','update','find','TURN','server/files/templates/turn_multiple.ejs','server/files/templates/network.ejs','format'];(function(_0x3439b9,_0x11cd7c){var _0xe920ec=function(_0x3fecc8){while(--_0x3fecc8){_0x3439b9['push'](_0x3439b9['shift']());}};_0xe920ec(++_0x11cd7c);}(_0x186d,0x142));var _0xd186=function(_0x2649e2,_0x3e73be){_0x2649e2=_0x2649e2-0x0;var _0x4797d4=_0x186d[_0x2649e2];return _0x4797d4;};'use strict';var util=require(_0xd186('0x0'));var path=require('path');var ejs=require(_0xd186('0x1'));var fs=require('fs');var _=require('lodash');var qs=require(_0xd186('0x2'));var logger=require('../../config/logger')(_0xd186('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0xd186('0x4'));var client=jayson[_0xd186('0x5')][_0xd186('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x58e2c1,_0x187e2b,_0x171b68,_0x2da5e2){return new Promise(function(_0x175567,_0x22cb0f){var _0x14f343=_0x2da5e2||client;return _0x14f343[_0xd186('0x7')](_0x58e2c1,_0x171b68)['then'](function(_0x11d426){logger['info'](_0xd186('0x8'),_0x187e2b,_0xd186('0x9'));logger[_0xd186('0xa')](_0xd186('0xb'),_0x187e2b,_0xd186('0x9'),JSON['stringify'](_0x11d426));if(_0x11d426[_0xd186('0xc')]){if(_0x11d426[_0xd186('0xc')]['code']===0x1f4){logger['error'](_0xd186('0x8'),_0x187e2b,_0x11d426[_0xd186('0xc')][_0xd186('0xd')]);return _0x22cb0f(_0x11d426[_0xd186('0xc')][_0xd186('0xd')]);}logger['error'](_0xd186('0x8'),_0x187e2b,_0x11d426[_0xd186('0xc')]['message']);return _0x175567(_0x11d426[_0xd186('0xc')][_0xd186('0xd')]);}else{logger[_0xd186('0xe')](_0xd186('0x8'),_0x187e2b,'request\x20sent');_0x175567(_0x11d426['result'][_0xd186('0xd')]);}})['catch'](function(_0x4883d8){logger[_0xd186('0xc')](_0xd186('0x8'),_0x187e2b,_0x4883d8);_0x22cb0f(_0x4883d8);});});}function respondWithResult(_0x38479f,_0x7f0f49){_0x7f0f49=_0x7f0f49||0xc8;return function(_0x4786d5){if(_0x4786d5){return _0x38479f[_0xd186('0xf')](_0x7f0f49)[_0xd186('0x10')](_0x4786d5);}};}function respondWithFilteredResult(_0x4adc1e,_0x578ca9){return function(_0x224743){if(_0x224743){var _0x175bdb=typeof _0x578ca9[_0xd186('0x11')]===_0xd186('0x12')&&typeof _0x578ca9[_0xd186('0x13')]===_0xd186('0x12');var _0x32aab2=_0x224743['count'];var _0x4b7fa0=_0x175bdb?0x0:_0x578ca9[_0xd186('0x11')];var _0x2fbb1d=_0x175bdb?_0x224743['count']:_0x578ca9['offset']+_0x578ca9[_0xd186('0x13')];var _0x4d19c1;if(_0x2fbb1d>=_0x32aab2){_0x2fbb1d=_0x32aab2;_0x4d19c1=0xc8;}else{_0x4d19c1=0xce;}_0x4adc1e[_0xd186('0xf')](_0x4d19c1);return _0x4adc1e[_0xd186('0x14')](_0xd186('0x15'),_0x4b7fa0+'-'+_0x2fbb1d+'/'+_0x32aab2)[_0xd186('0x10')](_0x224743);}return null;};}function saveUpdates(_0x305c3b){return function(_0x50b5c3){if(_0x50b5c3){return _0x50b5c3['update'](_0x305c3b)[_0xd186('0x16')](function(_0x1c8fe1){return _0x1c8fe1;});}return null;};}function removeEntity(_0x2ee13b){return function(_0x194895){if(_0x194895){return _0x194895[_0xd186('0x17')]()['then'](function(){_0x2ee13b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d7ff2){return function(_0x1b316d){if(!_0x1b316d){_0x1d7ff2[_0xd186('0x18')](0x194);}return _0x1b316d;};}function handleError(_0x33a0d6,_0x502f8e){_0x502f8e=_0x502f8e||0x1f4;return function(_0x25f38c){logger[_0xd186('0xc')](_0x25f38c['stack']);if(_0x25f38c[_0xd186('0x19')]){delete _0x25f38c[_0xd186('0x19')];}_0x33a0d6['status'](_0x502f8e)[_0xd186('0x1a')](_0x25f38c);};}exports['index']=function(_0x1906ca,_0x47e4e5){var _0x1922e7={},_0x204a02={},_0x40aeb3={'count':0x0,'rows':[]};var _0x31d55c=_['map'](db['Network'][_0xd186('0x1b')],function(_0x4edd6b){return{'name':_0x4edd6b[_0xd186('0x1c')],'type':_0x4edd6b['type'][_0xd186('0x1d')]};});_0x204a02[_0xd186('0x1e')]=_[_0xd186('0x1f')](_0x31d55c,_0xd186('0x19'));_0x204a02[_0xd186('0x20')]=_[_0xd186('0x21')](_0x1906ca[_0xd186('0x20')]);_0x204a02[_0xd186('0x22')]=_[_0xd186('0x23')](_0x204a02[_0xd186('0x1e')],_0x204a02['query']);_0x1922e7[_0xd186('0x24')]=_[_0xd186('0x23')](_0x204a02[_0xd186('0x1e')],qs[_0xd186('0x25')](_0x1906ca['query'][_0xd186('0x25')]));_0x1922e7[_0xd186('0x24')]=_0x1922e7[_0xd186('0x24')][_0xd186('0x26')]?_0x1922e7['attributes']:_0x204a02[_0xd186('0x1e')];if(!_0x1906ca['query'][_0xd186('0x27')]('nolimit')){_0x1922e7[_0xd186('0x13')]=qs['limit'](_0x1906ca[_0xd186('0x20')][_0xd186('0x13')]);_0x1922e7['offset']=qs['offset'](_0x1906ca[_0xd186('0x20')][_0xd186('0x11')]);}_0x1922e7[_0xd186('0x28')]=qs[_0xd186('0x29')](_0x1906ca[_0xd186('0x20')][_0xd186('0x29')]);_0x1922e7[_0xd186('0x2a')]=qs[_0xd186('0x22')](_['pick'](_0x1906ca[_0xd186('0x20')],_0x204a02[_0xd186('0x22')]),_0x31d55c);if(_0x1906ca[_0xd186('0x20')][_0xd186('0x2b')]){_0x1922e7[_0xd186('0x2a')]=_[_0xd186('0x2c')](_0x1922e7[_0xd186('0x2a')],{'$or':_[_0xd186('0x1f')](_0x31d55c,function(_0x5e7c46){if(_0x5e7c46['type']!=='VIRTUAL'){var _0x222be0={};_0x222be0[_0x5e7c46[_0xd186('0x19')]]={'$like':'%'+_0x1906ca[_0xd186('0x20')][_0xd186('0x2b')]+'%'};return _0x222be0;}})});}_0x1922e7=_[_0xd186('0x2c')]({},_0x1922e7,_0x1906ca['options']);var _0x3e8469={'where':_0x1922e7[_0xd186('0x2a')]};return db['Network'][_0xd186('0x2d')](_0x3e8469)['then'](function(_0x5d45f2){_0x40aeb3[_0xd186('0x2d')]=_0x5d45f2;if(_0x1906ca[_0xd186('0x20')][_0xd186('0x2e')]){_0x1922e7[_0xd186('0x2f')]=[{'all':!![]}];}return db['Network']['findAll'](_0x1922e7);})[_0xd186('0x16')](function(_0x2d6e2d){_0x40aeb3[_0xd186('0x30')]=_0x2d6e2d;return _0x40aeb3;})[_0xd186('0x16')](respondWithFilteredResult(_0x47e4e5,_0x1922e7))['catch'](handleError(_0x47e4e5,null));};exports[_0xd186('0x31')]=function(_0x2bd5ec,_0x356c1){var _0x4d4653={'raw':!![],'where':{'id':_0x2bd5ec[_0xd186('0x32')]['id']}},_0x34f421={};_0x34f421[_0xd186('0x1e')]=_[_0xd186('0x21')](db[_0xd186('0x33')]['rawAttributes']);_0x34f421[_0xd186('0x20')]=_[_0xd186('0x21')](_0x2bd5ec[_0xd186('0x20')]);_0x34f421[_0xd186('0x22')]=_[_0xd186('0x23')](_0x34f421[_0xd186('0x1e')],_0x34f421[_0xd186('0x20')]);_0x4d4653['attributes']=_[_0xd186('0x23')](_0x34f421[_0xd186('0x1e')],qs[_0xd186('0x25')](_0x2bd5ec[_0xd186('0x20')][_0xd186('0x25')]));_0x4d4653['attributes']=_0x4d4653[_0xd186('0x24')][_0xd186('0x26')]?_0x4d4653['attributes']:_0x34f421[_0xd186('0x1e')];if(_0x2bd5ec['query'][_0xd186('0x2e')]){_0x4d4653[_0xd186('0x2f')]=[{'all':!![]}];}_0x4d4653=_[_0xd186('0x2c')]({},_0x4d4653,_0x2bd5ec[_0xd186('0x34')]);return db[_0xd186('0x33')]['find'](_0x4d4653)[_0xd186('0x16')](handleEntityNotFound(_0x356c1,null))[_0xd186('0x16')](respondWithResult(_0x356c1,null))[_0xd186('0x35')](handleError(_0x356c1,null));};exports[_0xd186('0x36')]=function(_0x574a8a,_0x32382b){var _0x359e16;return db['Network'][_0xd186('0x36')](_0x574a8a[_0xd186('0x37')],{'raw':!![]})['then'](function(_0x1e1e6f){_0x359e16=_0x1e1e6f;return db['Network'][_0xd186('0x38')]({'where':{'type':_0x574a8a['body']['type']},'raw':!![]});})[_0xd186('0x16')](function(_0x14ae33){if(_0x359e16[_0xd186('0x39')]['toUpperCase']()==_0xd186('0x3a')){var _0x709bdb=fs['readFileSync'](path['join'](config[_0xd186('0x3b')],_0xd186('0x3c')),'utf8');var _0x456266=ejs['render'](_0x709bdb,{'networks':_0x14ae33||[]});fs['writeFileSync'](_0xd186('0x3d'),_0x456266);return respondWithRpcPromise(_0xd186('0x3e'),_0xd186('0x36'),{'module':_0xd186('0x3f')});}else if(_0x359e16[_0xd186('0x39')][_0xd186('0x40')]()=='TURN'){var _0x5b1128=fs[_0xd186('0x41')](path[_0xd186('0x42')](config[_0xd186('0x3b')],'server/files/templates/turn_multiple.ejs'),_0xd186('0x43'));var _0x373641=ejs[_0xd186('0x44')](_0x5b1128,{'networks':_0x14ae33||[]});fs[_0xd186('0x45')](_0xd186('0x46'),_0x373641);return respondWithRpcPromise(_0xd186('0x3e'),_0xd186('0x36'),{'module':_0xd186('0x3f')});}else{var _0x1b0532=fs[_0xd186('0x41')](path[_0xd186('0x42')](config['root'],'server/files/templates/network.ejs'),_0xd186('0x43'));var _0x48aa75=ejs[_0xd186('0x44')](_0x1b0532,{'networks':_0x14ae33||[]});fs['writeFileSync'](util['format'](_0xd186('0x47'),_0x574a8a[_0xd186('0x37')][_0xd186('0x39')]['toLowerCase']()),_0x48aa75);return respondWithRpcPromise(_0xd186('0x3e'),_0xd186('0x36'),{'module':'chan_sip.so'});}})[_0xd186('0x16')](function(){return _0x359e16;})['then'](respondWithResult(_0x32382b,0xc9))[_0xd186('0x35')](handleError(_0x32382b,null));};exports[_0xd186('0x48')]=function(_0x484b20,_0x434d2e){var _0x30da44;return db[_0xd186('0x33')][_0xd186('0x49')]({'where':{'id':_0x484b20[_0xd186('0x32')]['id']}})[_0xd186('0x16')](handleEntityNotFound(_0x434d2e,null))['then'](saveUpdates(_0x484b20[_0xd186('0x37')],null))[_0xd186('0x16')](function(_0x39776e){if(_0x39776e){_0x30da44=_0x39776e;return db[_0xd186('0x33')]['findAll']({'where':{'type':_0x30da44['type']},'raw':!![]});}return null;})[_0xd186('0x16')](function(_0x3329ad){if(_0x30da44[_0xd186('0x39')][_0xd186('0x40')]()==_0xd186('0x3a')){var _0x153d79=fs['readFileSync'](path[_0xd186('0x42')](config[_0xd186('0x3b')],'server/files/templates/stun_multiple.ejs'),_0xd186('0x43'));var _0x45656a=ejs[_0xd186('0x44')](_0x153d79,{'networks':_0x3329ad||[]});fs[_0xd186('0x45')](_0xd186('0x3d'),_0x45656a);return respondWithRpcPromise(_0xd186('0x3e'),_0xd186('0x48'),{'module':'res_stun_monitor.so'});}else if(_0x30da44[_0xd186('0x39')]['toUpperCase']()==_0xd186('0x4a')){var _0x278cb7=fs[_0xd186('0x41')](path[_0xd186('0x42')](config[_0xd186('0x3b')],_0xd186('0x4b')),_0xd186('0x43'));var _0x4dd2aa=ejs['render'](_0x278cb7,{'networks':_0x3329ad||[]});fs[_0xd186('0x45')](_0xd186('0x46'),_0x4dd2aa);return respondWithRpcPromise(_0xd186('0x3e'),_0xd186('0x48'),{'module':_0xd186('0x3f')});}else{var _0x67eebe=fs[_0xd186('0x41')](path[_0xd186('0x42')](config['root'],_0xd186('0x4c')),_0xd186('0x43'));var _0x550b44=ejs[_0xd186('0x44')](_0x67eebe,{'networks':_0x3329ad||[]});fs['writeFileSync'](util[_0xd186('0x4d')](_0xd186('0x47'),_0x484b20[_0xd186('0x37')][_0xd186('0x39')]['toLowerCase']()),_0x550b44);return respondWithRpcPromise(_0xd186('0x3e'),'update',{'module':'chan_sip.so'});}})['then'](function(_0x1cfeb2){if(_0x1cfeb2){return _0x30da44;}return null;})['then'](respondWithResult(_0x434d2e,null))[_0xd186('0x35')](handleError(_0x434d2e,null));};exports['destroy']=function(_0x2ba45b,_0x22ba3c){var _0x3fb004;return db[_0xd186('0x33')]['find']({'where':{'id':_0x2ba45b[_0xd186('0x32')]['id']}})[_0xd186('0x16')](function(_0x47538e){_0x3fb004=_0x47538e;return _0x47538e;})[_0xd186('0x16')](handleEntityNotFound(_0x22ba3c,null))[_0xd186('0x16')](removeEntity(_0x22ba3c,null))[_0xd186('0x16')](function(){if(_0x3fb004){return db[_0xd186('0x33')][_0xd186('0x38')]({'where':{'type':_0x3fb004['type']},'raw':!![]});}})[_0xd186('0x16')](function(_0x3b2310){if(_0x3fb004[_0xd186('0x39')][_0xd186('0x40')]()=='STUN'){var _0x3e1afa=fs[_0xd186('0x41')](path['join'](config[_0xd186('0x3b')],'server/files/templates/stun_multiple.ejs'),_0xd186('0x43'));var _0x1ac912=ejs[_0xd186('0x44')](_0x3e1afa,{'networks':_0x3b2310||[]});fs['writeFileSync'](_0xd186('0x3d'),_0x1ac912);return respondWithRpcPromise(_0xd186('0x3e'),_0xd186('0x17'),{'module':'res_stun_monitor.so'});}else if(_0x3fb004[_0xd186('0x39')][_0xd186('0x40')]()==_0xd186('0x4a')){var _0x35fa14=fs[_0xd186('0x41')](path[_0xd186('0x42')](config[_0xd186('0x3b')],_0xd186('0x4b')),_0xd186('0x43'));var _0x235023=ejs[_0xd186('0x44')](_0x35fa14,{'networks':_0x3b2310||[]});fs['writeFileSync'](_0xd186('0x46'),_0x235023);return respondWithRpcPromise(_0xd186('0x3e'),_0xd186('0x17'),{'module':_0xd186('0x3f')});}else{var _0x557eb7=fs[_0xd186('0x41')](path[_0xd186('0x42')](config[_0xd186('0x3b')],_0xd186('0x4c')),_0xd186('0x43'));var _0x427de4=ejs[_0xd186('0x44')](_0x557eb7,{'networks':_0x3b2310||[]});fs['writeFileSync'](util[_0xd186('0x4d')]('/etc/asterisk/sip_xcally_%s.conf',_0x3fb004[_0xd186('0x39')][_0xd186('0x4e')]()),_0x427de4);return respondWithRpcPromise(_0xd186('0x3e'),_0xd186('0x17'),{'module':_0xd186('0x4f')});}})[_0xd186('0x35')](handleError(_0x22ba3c,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index b6af42c..9289cd6 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 _0x1306=['define','Network','network','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','exports'];(function(_0x5944ff,_0x5a955c){var _0x160ba8=function(_0x19783f){while(--_0x19783f){_0x5944ff['push'](_0x5944ff['shift']());}};_0x160ba8(++_0x5a955c);}(_0x1306,0x17a));var _0x6130=function(_0x528ecf,_0x33c991){_0x528ecf=_0x528ecf-0x0;var _0x5b7922=_0x1306[_0x528ecf];return _0x5b7922;};'use strict';var _=require(_0x6130('0x0'));var util=require(_0x6130('0x1'));var logger=require(_0x6130('0x2'))(_0x6130('0x3'));var moment=require(_0x6130('0x4'));var BPromise=require(_0x6130('0x5'));var rp=require(_0x6130('0x6'));var fs=require('fs');var path=require(_0x6130('0x7'));var rimraf=require(_0x6130('0x8'));var config=require(_0x6130('0x9'));var attributes=require(_0x6130('0xa'));module[_0x6130('0xb')]=function(_0x213e6a,_0x2b965d){return _0x213e6a[_0x6130('0xc')](_0x6130('0xd'),attributes,{'tableName':_0x6130('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0427=['api','bluebird','request-promise','path','rimraf','../../config/environment','./network.attributes','exports','define','Network','network','../../config/logger'];(function(_0x57f100,_0xa53aca){var _0x4cac01=function(_0x447061){while(--_0x447061){_0x57f100['push'](_0x57f100['shift']());}};_0x4cac01(++_0xa53aca);}(_0x0427,0x137));var _0x7042=function(_0x56ef34,_0x5ecd72){_0x56ef34=_0x56ef34-0x0;var _0x4c1d92=_0x0427[_0x56ef34];return _0x4c1d92;};'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 diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 22a0117..8e5de83 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x35ad55,_0x1c206c){_0x35ad55=_0x35ad55-0x0;var _0x12c6d5=_0x7a54[_0x35ad55];return _0x12c6d5;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x403490,_0x41d621){_0x403490=_0x403490-0x0;var _0x3ab7c9=_0x7a54[_0x403490];return _0x3ab7c9;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 3ea10df..6b78fa3 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 _0x32b6=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','/:id/notify','notify','addApplications','addAgents','/:id/send','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','connect-timeout'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x32b6,0x1d1));var _0x632b=function(_0x34bbdc,_0x9df857){_0x34bbdc=_0x34bbdc-0x0;var _0x4e4477=_0x32b6[_0x34bbdc];return _0x4e4477;};'use strict';var multer=require(_0x632b('0x0'));var util=require(_0x632b('0x1'));var path=require('path');var timeout=require(_0x632b('0x2'));var express=require(_0x632b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x632b('0x4'));var interaction=require(_0x632b('0x5'));var config=require(_0x632b('0x6'));var controller=require(_0x632b('0x7'));router[_0x632b('0x8')]('/',auth[_0x632b('0x9')](),controller[_0x632b('0xa')]);router[_0x632b('0x8')](_0x632b('0xb'),auth[_0x632b('0x9')](),controller['describe']);router[_0x632b('0x8')](_0x632b('0xc'),auth[_0x632b('0x9')](),controller[_0x632b('0xd')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x632b('0xe')]);router['get'](_0x632b('0xf'),auth[_0x632b('0x9')](),controller[_0x632b('0x10')]);router[_0x632b('0x8')](_0x632b('0x11'),auth[_0x632b('0x9')](),controller[_0x632b('0x12')]);router[_0x632b('0x8')](_0x632b('0x13'),auth['isAuthenticated'](),controller[_0x632b('0x14')]);router[_0x632b('0x8')](_0x632b('0x15'),auth['isAuthenticated'](),controller[_0x632b('0x16')]);router[_0x632b('0x17')]('/',auth[_0x632b('0x9')](),controller[_0x632b('0x18')]);router[_0x632b('0x17')](_0x632b('0x19'),auth['isAuthenticated'](),controller[_0x632b('0x1a')]);router['post']('/:id/canned_answers',auth[_0x632b('0x9')](),controller['addAnswer']);router[_0x632b('0x17')](_0x632b('0x1b'),controller[_0x632b('0x1c')]);router['post'](_0x632b('0x11'),auth[_0x632b('0x9')](),controller[_0x632b('0x1d')]);router[_0x632b('0x17')]('/:id/users',auth[_0x632b('0x9')](),controller[_0x632b('0x1e')]);router['post'](_0x632b('0x1f'),auth['isAuthenticated'](),controller['send']);router[_0x632b('0x20')]('/:id',auth[_0x632b('0x9')](),controller[_0x632b('0x21')]);router[_0x632b('0x22')]('/:id',auth[_0x632b('0x9')](),controller[_0x632b('0x23')]);router['delete'](_0x632b('0x19'),auth[_0x632b('0x9')](),controller[_0x632b('0x24')]);router[_0x632b('0x22')](_0x632b('0xf'),auth[_0x632b('0x9')](),controller['removeAnswers']);router['delete'](_0x632b('0x15'),auth['isAuthenticated'](),controller[_0x632b('0x25')]);module[_0x632b('0x26')]=router; \ No newline at end of file +var _0x5fdc=['../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/users','getAgents','create','post','/:id/dispositions','addAnswer','/:id/notify','notify','addAgents','send','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xf5fa0d,_0x17485e){var _0x2633e3=function(_0x593a2f){while(--_0x593a2f){_0xf5fa0d['push'](_0xf5fa0d['shift']());}};_0x2633e3(++_0x17485e);}(_0x5fdc,0x127));var _0xc5fd=function(_0xbb4b4c,_0x1468be){_0xbb4b4c=_0xbb4b4c-0x0;var _0x434ae6=_0x5fdc[_0xbb4b4c];return _0x434ae6;};'use strict';var multer=require(_0xc5fd('0x0'));var util=require(_0xc5fd('0x1'));var path=require(_0xc5fd('0x2'));var timeout=require(_0xc5fd('0x3'));var express=require(_0xc5fd('0x4'));var router=express[_0xc5fd('0x5')]();var fs_extra=require(_0xc5fd('0x6'));var auth=require(_0xc5fd('0x7'));var interaction=require(_0xc5fd('0x8'));var config=require(_0xc5fd('0x9'));var controller=require(_0xc5fd('0xa'));router[_0xc5fd('0xb')]('/',auth[_0xc5fd('0xc')](),controller[_0xc5fd('0xd')]);router[_0xc5fd('0xb')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xc5fd('0xb')](_0xc5fd('0xe'),auth[_0xc5fd('0xc')](),controller[_0xc5fd('0xf')]);router['get']('/:id/dispositions',auth[_0xc5fd('0xc')](),controller[_0xc5fd('0x10')]);router[_0xc5fd('0xb')](_0xc5fd('0x11'),auth[_0xc5fd('0xc')](),controller[_0xc5fd('0x12')]);router['get'](_0xc5fd('0x13'),auth['isAuthenticated'](),controller['getApplications']);router[_0xc5fd('0xb')](_0xc5fd('0x14'),auth[_0xc5fd('0xc')](),controller[_0xc5fd('0x15')]);router[_0xc5fd('0xb')](_0xc5fd('0x16'),auth[_0xc5fd('0xc')](),controller[_0xc5fd('0x17')]);router['post']('/',auth[_0xc5fd('0xc')](),controller[_0xc5fd('0x18')]);router[_0xc5fd('0x19')](_0xc5fd('0x1a'),auth['isAuthenticated'](),controller['addDisposition']);router['post']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xc5fd('0x1b')]);router[_0xc5fd('0x19')](_0xc5fd('0x1c'),controller[_0xc5fd('0x1d')]);router[_0xc5fd('0x19')](_0xc5fd('0x13'),auth[_0xc5fd('0xc')](),controller['addApplications']);router[_0xc5fd('0x19')](_0xc5fd('0x16'),auth[_0xc5fd('0xc')](),controller[_0xc5fd('0x1e')]);router[_0xc5fd('0x19')]('/:id/send',auth[_0xc5fd('0xc')](),controller[_0xc5fd('0x1f')]);router[_0xc5fd('0x20')](_0xc5fd('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xc5fd('0x21')](_0xc5fd('0xe'),auth[_0xc5fd('0xc')](),controller[_0xc5fd('0x22')]);router[_0xc5fd('0x21')](_0xc5fd('0x1a'),auth['isAuthenticated'](),controller[_0xc5fd('0x23')]);router[_0xc5fd('0x21')](_0xc5fd('0x11'),auth[_0xc5fd('0xc')](),controller[_0xc5fd('0x24')]);router[_0xc5fd('0x21')](_0xc5fd('0x16'),auth['isAuthenticated'](),controller[_0xc5fd('0x25')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index ad88f53..dc0a26b 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 _0x7aa5=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','TEXT'];(function(_0x3f92c7,_0x863c8){var _0x2e7f61=function(_0x2aa370){while(--_0x2aa370){_0x3f92c7['push'](_0x3f92c7['shift']());}};_0x2e7f61(++_0x863c8);}(_0x7aa5,0x157));var _0x57aa=function(_0x1ef560,_0x281094){_0x1ef560=_0x1ef560-0x0;var _0xdccd1=_0x7aa5[_0x1ef560];return _0xdccd1;};'use strict';var Sequelize=require(_0x57aa('0x0'));var rs=require(_0x57aa('0x1'));module[_0x57aa('0x2')]={'name':{'type':Sequelize[_0x57aa('0x3')],'unique':_0x57aa('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x57aa('0x3')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x57aa('0x5')]();}},'replyUri':{'type':Sequelize[_0x57aa('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x57aa('0x6')],'defaultValue':function(){return _0x57aa('0x7');}},'notificationSound':{'type':Sequelize[_0x57aa('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x57aa('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x57aa('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x57aa('0x3')]},'queueTransfer':{'type':Sequelize[_0x57aa('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x57aa('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x57aa('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x57aa('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x57aa('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0x57aa('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2b5c41){if(!_0x2b5c41)this['setDataValue'](_0x57aa('0xb'),null);this[_0x57aa('0xc')](_0x57aa('0xd'),_0x2b5c41);}}}; \ No newline at end of file +var _0xb839=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name'];(function(_0x189eab,_0x2d1178){var _0x4513dc=function(_0x3371c0){while(--_0x3371c0){_0x189eab['push'](_0x189eab['shift']());}};_0x4513dc(++_0x2d1178);}(_0xb839,0xbc));var _0x9b83=function(_0x500f3f,_0xfc91f){_0x500f3f=_0x500f3f-0x0;var _0x29d063=_0xb839[_0x500f3f];return _0x29d063;};'use strict';var Sequelize=require(_0x9b83('0x0'));var rs=require('randomstring');module[_0x9b83('0x1')]={'name':{'type':Sequelize[_0x9b83('0x2')],'unique':_0x9b83('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x9b83('0x2')]},'token':{'type':Sequelize[_0x9b83('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x9b83('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x9b83('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x9b83('0x4')],'defaultValue':function(){return _0x9b83('0x5');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x9b83('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x9b83('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9b83('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9b83('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9b83('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9b83('0x6')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9b83('0x8'),'set':function(_0xb1a438){if(!_0xb1a438)this[_0x9b83('0x9')](_0x9b83('0xa'),null);this[_0x9b83('0x9')](_0x9b83('0xb'),_0xb1a438);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 3355f9a..b245ee8 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 _0x421f=['error','code','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','get','OpenchannelAccounts','destroy','sendStatus','name','send','index','mandatoryDispositionPause','OpenchannelAccount','fieldName','type','model','keys','query','intersection','attributes','length','nolimit','order','sort','filters','pick','where','merge','map','filter','findAll','show','params','rawAttributes','fields','includeAll','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','Pause','describe','addDisposition','Disposition','findOne','hasOwnProperty','OpenchannelAccountId','rows','removeDispositions','ids','CannedAnswer','removeAnswers','notify','CmContact','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','from','Sequelize','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','Applications','account','applications','list','orderBy','asc','contact','lastName','threadId','externalUrl','ContactId','OpenchannelInteraction','firstName','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','queueId','OpenchannelQueue','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','OpenchannelApplication','bulkCreate','findAndCountAll','priority','stack','finally','getApplications','getInteractions','Contact','Owner','fullname','Tag','Tags','color','tag','emit','userOpenchannelAccount:save','isArray','userOpenchannelAccount:remove','out','OpenchannelMessage','spread','dataValues','Messages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x39e5e9,_0x24885f){var _0x3bce63=function(_0x4a06e5){while(--_0x4a06e5){_0x39e5e9['push'](_0x39e5e9['shift']());}};_0x3bce63(++_0x24885f);}(_0x421f,0x160));var _0xf421=function(_0xaf114d,_0x2bf02f){_0xaf114d=_0xaf114d-0x0;var _0x3fa697=_0x421f[_0xaf114d];return _0x3fa697;};'use strict';var emlformat=require(_0xf421('0x0'));var rimraf=require(_0xf421('0x1'));var zipdir=require(_0xf421('0x2'));var jsonpatch=require(_0xf421('0x3'));var rp=require(_0xf421('0x4'));var moment=require(_0xf421('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xf421('0x6'));var sox=require(_0xf421('0x7'));var csv=require(_0xf421('0x8'));var ejs=require(_0xf421('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf421('0xa'));var squel=require(_0xf421('0xb'));var crypto=require(_0xf421('0xc'));var jsforce=require(_0xf421('0xd'));var deskjs=require(_0xf421('0xe'));var toCsv=require(_0xf421('0x8'));var querystring=require(_0xf421('0xf'));var Papa=require(_0xf421('0x10'));var Redis=require(_0xf421('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf421('0x12'));var as=require(_0xf421('0x13'));var hardwareService=require(_0xf421('0x14'));var logger=require(_0xf421('0x15'))(_0xf421('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf421('0x17'));var db=require(_0xf421('0x18'))['db'];config['redis']=_[_0xf421('0x19')](config[_0xf421('0x1a')],{'host':_0xf421('0x1b'),'port':0x18eb});var socket=require(_0xf421('0x1c'))(new Redis(config[_0xf421('0x1a')]));require('./openchannelAccount.socket')[_0xf421('0x1d')](socket);var jayson=require(_0xf421('0x1e'));var client=jayson[_0xf421('0x1f')][_0xf421('0x20')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1e784f,_0xb6aad8,_0x3f26e4,_0x4ff565){return new BPromise(function(_0x48b985,_0x13c3ce){var _0x47bf6b=_0x4ff565||client;return _0x47bf6b[_0xf421('0x21')](_0x1e784f,_0x3f26e4)['then'](function(_0x1d6a39){logger[_0xf421('0x22')]('OpenchannelAccount,\x20%s,\x20%s',_0xb6aad8,_0xf421('0x23'));logger['debug'](_0xf421('0x24'),_0xb6aad8,_0xf421('0x23'),JSON[_0xf421('0x25')](_0x1d6a39));if(_0x1d6a39[_0xf421('0x26')]){if(_0x1d6a39['error'][_0xf421('0x27')]===0x1f4){logger[_0xf421('0x26')](_0xf421('0x28'),_0xb6aad8,_0x1d6a39[_0xf421('0x26')]['message']);return _0x13c3ce(_0x1d6a39[_0xf421('0x26')]['message']);}logger['error'](_0xf421('0x28'),_0xb6aad8,_0x1d6a39['error']['message']);return _0x48b985(_0x1d6a39[_0xf421('0x26')][_0xf421('0x29')]);}else{logger['info'](_0xf421('0x28'),_0xb6aad8,_0xf421('0x23'));_0x48b985(_0x1d6a39[_0xf421('0x2a')]['message']);}})[_0xf421('0x2b')](function(_0x52fa35){logger[_0xf421('0x26')](_0xf421('0x28'),_0xb6aad8,_0x52fa35);_0x13c3ce(_0x52fa35);});});}function respondWithStatusCode(_0x2f7efc,_0x2e96d3){_0x2e96d3=_0x2e96d3||0xcc;return function(_0x5240b6){if(_0x5240b6){return _0x2f7efc['sendStatus'](_0x2e96d3);}return _0x2f7efc[_0xf421('0x2c')](_0x2e96d3)[_0xf421('0x2d')]();};}function respondWithResult(_0x1ce3e3,_0x2dcccf){_0x2dcccf=_0x2dcccf||0xc8;return function(_0x393ef3){if(_0x393ef3){return _0x1ce3e3[_0xf421('0x2c')](_0x2dcccf)[_0xf421('0x2e')](_0x393ef3);}};}function respondWithFilteredResult(_0x21134f,_0x47f060){return function(_0x307d7f){if(_0x307d7f){var _0x27ae3a=typeof _0x47f060[_0xf421('0x2f')]===_0xf421('0x30')&&typeof _0x47f060[_0xf421('0x31')]===_0xf421('0x30');var _0x50a03f=_0x307d7f[_0xf421('0x32')];var _0x38b1ea=_0x27ae3a?0x0:_0x47f060['offset'];var _0x3fcab8=_0x27ae3a?_0x307d7f['count']:_0x47f060[_0xf421('0x2f')]+_0x47f060[_0xf421('0x31')];var _0x34e758;if(_0x3fcab8>=_0x50a03f){_0x3fcab8=_0x50a03f;_0x34e758=0xc8;}else{_0x34e758=0xce;}_0x21134f[_0xf421('0x2c')](_0x34e758);return _0x21134f['set'](_0xf421('0x33'),_0x38b1ea+'-'+_0x3fcab8+'/'+_0x50a03f)['json'](_0x307d7f);}return null;};}function patchUpdates(_0x421b35){return function(_0x55ae3c){try{jsonpatch[_0xf421('0x34')](_0x55ae3c,_0x421b35,!![]);}catch(_0x40bed3){return BPromise[_0xf421('0x35')](_0x40bed3);}return _0x55ae3c['save']();};}function saveUpdates(_0x567c25,_0x5658c1){return function(_0xa7273c){if(_0xa7273c){return _0xa7273c[_0xf421('0x36')](_0x567c25)[_0xf421('0x37')](function(_0x4791cc){return _0x4791cc;});}return null;};}function removeEntity(_0x2d4a22,_0x553c3e){return function(_0x55fb77){if(_0x55fb77){return _0x55fb77['destroy']()[_0xf421('0x37')](function(){var _0x1fd862=_0x55fb77[_0xf421('0x38')]({'plain':!![]});var _0x438f5b=_0xf421('0x39');return db['UserProfileResource'][_0xf421('0x3a')]({'where':{'type':_0x438f5b,'resourceId':_0x1fd862['id']}})[_0xf421('0x37')](function(){return _0x55fb77;});})[_0xf421('0x37')](function(){_0x2d4a22[_0xf421('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d08ca,_0x328a2b){return function(_0x18bb75){if(!_0x18bb75){_0x9d08ca[_0xf421('0x3b')](0x194);}return _0x18bb75;};}function handleError(_0x4f9281,_0x2fe6b1){_0x2fe6b1=_0x2fe6b1||0x1f4;return function(_0x82d3e1){logger[_0xf421('0x26')](_0x82d3e1['stack']);if(_0x82d3e1[_0xf421('0x3c')]){delete _0x82d3e1[_0xf421('0x3c')];}_0x4f9281[_0xf421('0x2c')](_0x2fe6b1)[_0xf421('0x3d')](_0x82d3e1);};}exports[_0xf421('0x3e')]=function(_0x17a649,_0x576f0d){var _0x46e337={'include':[{'model':db['Pause'],'as':_0xf421('0x3f')}]},_0x2b294e={},_0x4f59db={'count':0x0,'rows':[]};var _0x3827ec=_['map'](db[_0xf421('0x40')]['rawAttributes'],function(_0x143cf8){return{'name':_0x143cf8[_0xf421('0x41')],'type':_0x143cf8[_0xf421('0x42')]['key']};});_0x2b294e[_0xf421('0x43')]=_['map'](_0x3827ec,'name');_0x2b294e['query']=_[_0xf421('0x44')](_0x17a649[_0xf421('0x45')]);_0x2b294e['filters']=_[_0xf421('0x46')](_0x2b294e['model'],_0x2b294e[_0xf421('0x45')]);_0x46e337[_0xf421('0x47')]=_[_0xf421('0x46')](_0x2b294e[_0xf421('0x43')],qs['fields'](_0x17a649[_0xf421('0x45')]['fields']));_0x46e337[_0xf421('0x47')]=_0x46e337['attributes'][_0xf421('0x48')]?_0x46e337['attributes']:_0x2b294e[_0xf421('0x43')];if(!_0x17a649[_0xf421('0x45')]['hasOwnProperty'](_0xf421('0x49'))){_0x46e337['limit']=qs[_0xf421('0x31')](_0x17a649[_0xf421('0x45')][_0xf421('0x31')]);_0x46e337[_0xf421('0x2f')]=qs[_0xf421('0x2f')](_0x17a649[_0xf421('0x45')][_0xf421('0x2f')]);}_0x46e337[_0xf421('0x4a')]=qs[_0xf421('0x4b')](_0x17a649[_0xf421('0x45')]['sort']);_0x46e337['where']=qs[_0xf421('0x4c')](_[_0xf421('0x4d')](_0x17a649[_0xf421('0x45')],_0x2b294e['filters']),_0x3827ec);if(_0x17a649[_0xf421('0x45')]['filter']){_0x46e337[_0xf421('0x4e')]=_[_0xf421('0x4f')](_0x46e337[_0xf421('0x4e')],{'$or':_[_0xf421('0x50')](_0x3827ec,function(_0x28ca49){if(_0x28ca49[_0xf421('0x42')]!=='VIRTUAL'){var _0x3036ba={};_0x3036ba[_0x28ca49[_0xf421('0x3c')]]={'$like':'%'+_0x17a649['query'][_0xf421('0x51')]+'%'};return _0x3036ba;}})});}_0x46e337=_[_0xf421('0x4f')]({},_0x46e337,_0x17a649['options']);var _0x3ca6fa={'where':_0x46e337[_0xf421('0x4e')]};return db['OpenchannelAccount'][_0xf421('0x32')](_0x3ca6fa)[_0xf421('0x37')](function(_0x39be1f){_0x4f59db[_0xf421('0x32')]=_0x39be1f;if(_0x17a649[_0xf421('0x45')]['includeAll']){_0x46e337['include']=[{'all':!![]}];}return db['OpenchannelAccount'][_0xf421('0x52')](_0x46e337);})[_0xf421('0x37')](function(_0x5df6f6){_0x4f59db['rows']=_0x5df6f6;return _0x4f59db;})['then'](respondWithFilteredResult(_0x576f0d,_0x46e337))[_0xf421('0x2b')](handleError(_0x576f0d,null));};exports[_0xf421('0x53')]=function(_0x35ca06,_0x1d069c){var _0x4cc850={'raw':![],'where':{'id':_0x35ca06[_0xf421('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0xf421('0x3f')}]},_0x27279e={};_0x27279e['model']=_[_0xf421('0x44')](db[_0xf421('0x40')][_0xf421('0x55')]);_0x27279e[_0xf421('0x45')]=_['keys'](_0x35ca06[_0xf421('0x45')]);_0x27279e[_0xf421('0x4c')]=_[_0xf421('0x46')](_0x27279e['model'],_0x27279e[_0xf421('0x45')]);_0x4cc850['attributes']=_['intersection'](_0x27279e[_0xf421('0x43')],qs[_0xf421('0x56')](_0x35ca06[_0xf421('0x45')][_0xf421('0x56')]));_0x4cc850[_0xf421('0x47')]=_0x4cc850[_0xf421('0x47')]['length']?_0x4cc850[_0xf421('0x47')]:_0x27279e[_0xf421('0x43')];if(_0x35ca06[_0xf421('0x45')][_0xf421('0x57')]){_0x4cc850[_0xf421('0x58')]=[{'all':!![]}];}_0x4cc850=_[_0xf421('0x4f')]({},_0x4cc850,_0x35ca06[_0xf421('0x59')]);return db[_0xf421('0x40')][_0xf421('0x5a')](_0x4cc850)['then'](handleEntityNotFound(_0x1d069c,null))['then'](respondWithResult(_0x1d069c,null))[_0xf421('0x2b')](handleError(_0x1d069c,null));};exports[_0xf421('0x5b')]=function(_0x4483d5,_0x18b9b6){return db[_0xf421('0x40')][_0xf421('0x5b')](_0x4483d5['body'],{})[_0xf421('0x37')](function(_0x4dbc4c){var _0x357a5f=_0x4483d5[_0xf421('0x5c')][_0xf421('0x38')]({'plain':!![]});if(!_0x357a5f)throw new Error(_0xf421('0x5d'));if(_0x357a5f[_0xf421('0x5e')]===_0xf421('0x5c')){var _0x5cf208=_0x4dbc4c[_0xf421('0x38')]({'plain':!![]});var _0x9de23f=_0xf421('0x39');return db[_0xf421('0x5f')]['find']({'where':{'name':_0x9de23f,'userProfileId':_0x357a5f[_0xf421('0x60')]},'raw':!![]})['then'](function(_0xf1a280){if(_0xf1a280&&_0xf1a280[_0xf421('0x61')]===0x0){return db[_0xf421('0x62')]['create']({'name':_0x5cf208[_0xf421('0x3c')],'resourceId':_0x5cf208['id'],'type':_0xf1a280[_0xf421('0x3c')],'sectionId':_0xf1a280['id']},{})[_0xf421('0x37')](function(){return _0x4dbc4c;});}else{return _0x4dbc4c;}})[_0xf421('0x2b')](function(_0x351c19){logger[_0xf421('0x26')](_0xf421('0x63'),_0x351c19);throw _0x351c19;});}return _0x4dbc4c;})[_0xf421('0x37')](respondWithResult(_0x18b9b6,0xc9))[_0xf421('0x2b')](handleError(_0x18b9b6,null));};exports[_0xf421('0x36')]=function(_0x55c2ab,_0x5a4a6e){if(_0x55c2ab[_0xf421('0x64')]['id']){delete _0x55c2ab['body']['id'];}return db[_0xf421('0x40')][_0xf421('0x5a')]({'where':{'id':_0x55c2ab[_0xf421('0x54')]['id']},'include':[{'model':db[_0xf421('0x65')],'as':_0xf421('0x3f')}]})['then'](handleEntityNotFound(_0x5a4a6e,null))[_0xf421('0x37')](saveUpdates(_0x55c2ab['body'],null))['then'](respondWithResult(_0x5a4a6e,null))[_0xf421('0x2b')](handleError(_0x5a4a6e,null));};exports[_0xf421('0x3a')]=function(_0x5ade40,_0x275bb6){return db['OpenchannelAccount'][_0xf421('0x5a')]({'where':{'id':_0x5ade40[_0xf421('0x54')]['id']}})[_0xf421('0x37')](handleEntityNotFound(_0x275bb6,null))['then'](removeEntity(_0x275bb6,null))['catch'](handleError(_0x275bb6,null));};exports[_0xf421('0x66')]=function(_0x4e0c7f,_0x44cc47){return db[_0xf421('0x40')]['describe']()[_0xf421('0x37')](respondWithResult(_0x44cc47,null))['catch'](handleError(_0x44cc47,null));};exports[_0xf421('0x67')]=function(_0x259f02,_0x3c8b3b,_0x3bd84b){if(_0x259f02['body']['id']){delete _0x259f02[_0xf421('0x64')]['id'];}return db[_0xf421('0x40')]['find']({'where':{'id':_0x259f02[_0xf421('0x54')]['id']}})['then'](handleEntityNotFound(_0x3c8b3b,null))['then'](function(_0x2e14c0){if(_0x2e14c0){_0x259f02[_0xf421('0x64')]['OpenchannelAccountId']=_0x2e14c0['id'];return db[_0xf421('0x68')]['create'](_0x259f02['body']);}})['then'](respondWithResult(_0x3c8b3b,null))[_0xf421('0x2b')](handleError(_0x3c8b3b,null));};exports['getDispositions']=function(_0x4c8ff9,_0x16311a,_0x1264cc){var _0x46c1e1={'raw':![],'where':{}};var _0x5c68d0={};var _0xd5e555={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xf421('0x69')]({'where':{'id':_0x4c8ff9[_0xf421('0x54')]['id']}})['then'](handleEntityNotFound(_0x16311a,null))[_0xf421('0x37')](function(_0x3da586){if(_0x3da586){_0x5c68d0[_0xf421('0x43')]=_['keys'](db[_0xf421('0x68')][_0xf421('0x55')]);_0x5c68d0[_0xf421('0x45')]=_[_0xf421('0x44')](_0x4c8ff9[_0xf421('0x45')]);_0x5c68d0['filters']=_[_0xf421('0x46')](_0x5c68d0[_0xf421('0x43')],_0x5c68d0[_0xf421('0x45')]);_0x46c1e1[_0xf421('0x47')]=_['intersection'](_0x5c68d0[_0xf421('0x43')],qs['fields'](_0x4c8ff9[_0xf421('0x45')][_0xf421('0x56')]));_0x46c1e1[_0xf421('0x47')]=_0x46c1e1[_0xf421('0x47')][_0xf421('0x48')]?_0x46c1e1[_0xf421('0x47')]:_0x5c68d0['model'];if(!_0x4c8ff9['query'][_0xf421('0x6a')](_0xf421('0x49'))){_0x46c1e1['limit']=qs[_0xf421('0x31')](_0x4c8ff9['query'][_0xf421('0x31')]);_0x46c1e1[_0xf421('0x2f')]=qs['offset'](_0x4c8ff9['query'][_0xf421('0x2f')]);}_0x46c1e1['order']=qs['sort'](_0x4c8ff9[_0xf421('0x45')][_0xf421('0x4b')]);_0x46c1e1[_0xf421('0x4e')]=qs[_0xf421('0x4c')](_[_0xf421('0x4d')](_0x4c8ff9[_0xf421('0x45')],_0x5c68d0[_0xf421('0x4c')]));_0x46c1e1[_0xf421('0x4e')][_0xf421('0x6b')]=_0x3da586['id'];if(_0x4c8ff9[_0xf421('0x45')]['filter']){_0x46c1e1[_0xf421('0x4e')]=_[_0xf421('0x4f')](_0x46c1e1[_0xf421('0x4e')],{'$or':_[_0xf421('0x50')](_0x46c1e1[_0xf421('0x47')],function(_0x979623){var _0x23684b={};_0x23684b[_0x979623]={'$like':'%'+_0x4c8ff9[_0xf421('0x45')][_0xf421('0x51')]+'%'};return _0x23684b;})});}_0x46c1e1=_['merge']({},_0x46c1e1,_0x4c8ff9[_0xf421('0x59')]);return db[_0xf421('0x68')][_0xf421('0x32')]({'where':_0x46c1e1['where']})[_0xf421('0x37')](function(_0x4f6aaf){_0xd5e555['count']=_0x4f6aaf;if(_0x4c8ff9['query']['includeAll']){_0x46c1e1[_0xf421('0x58')]=[{'all':!![]}];}return db[_0xf421('0x68')][_0xf421('0x52')](_0x46c1e1);})[_0xf421('0x37')](function(_0x2e1851){_0xd5e555[_0xf421('0x6c')]=_0x2e1851;return _0xd5e555;});}})[_0xf421('0x37')](respondWithFilteredResult(_0x16311a,_0x46c1e1))[_0xf421('0x2b')](handleError(_0x16311a,null));};exports[_0xf421('0x6d')]=function(_0x4252a6,_0x5273f9,_0x9e4825){return db['OpenchannelAccount']['find']({'where':{'id':_0x4252a6[_0xf421('0x54')]['id']}})[_0xf421('0x37')](handleEntityNotFound(_0x5273f9,null))[_0xf421('0x37')](function(_0x47bb04){if(_0x47bb04){return _0x47bb04[_0xf421('0x6d')](_0x4252a6['query'][_0xf421('0x6e')]);}})[_0xf421('0x37')](respondWithStatusCode(_0x5273f9,null))[_0xf421('0x2b')](handleError(_0x5273f9,null));};exports['addAnswer']=function(_0x377c8c,_0x380dd4,_0x51ac75){if(_0x377c8c['body']['id']){delete _0x377c8c[_0xf421('0x64')]['id'];}return db[_0xf421('0x40')][_0xf421('0x5a')]({'where':{'id':_0x377c8c[_0xf421('0x54')]['id']}})[_0xf421('0x37')](handleEntityNotFound(_0x380dd4,null))[_0xf421('0x37')](function(_0xb7c391){if(_0xb7c391){_0x377c8c[_0xf421('0x64')][_0xf421('0x6b')]=_0xb7c391['id'];return db[_0xf421('0x6f')][_0xf421('0x5b')](_0x377c8c['body']);}})['then'](respondWithResult(_0x380dd4,null))['catch'](handleError(_0x380dd4,null));};exports['getAnswers']=function(_0x599eb5,_0x324134,_0x4d06f6){var _0x29d63c={'raw':![],'where':{}};var _0xec67f7={};var _0x132665={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xf421('0x69')]({'where':{'id':_0x599eb5['params']['id']}})[_0xf421('0x37')](handleEntityNotFound(_0x324134,null))[_0xf421('0x37')](function(_0x10e740){if(_0x10e740){_0xec67f7[_0xf421('0x43')]=_[_0xf421('0x44')](db['CannedAnswer'][_0xf421('0x55')]);_0xec67f7[_0xf421('0x45')]=_[_0xf421('0x44')](_0x599eb5['query']);_0xec67f7[_0xf421('0x4c')]=_[_0xf421('0x46')](_0xec67f7[_0xf421('0x43')],_0xec67f7[_0xf421('0x45')]);_0x29d63c[_0xf421('0x47')]=_[_0xf421('0x46')](_0xec67f7[_0xf421('0x43')],qs[_0xf421('0x56')](_0x599eb5[_0xf421('0x45')]['fields']));_0x29d63c[_0xf421('0x47')]=_0x29d63c[_0xf421('0x47')]['length']?_0x29d63c['attributes']:_0xec67f7['model'];if(!_0x599eb5[_0xf421('0x45')][_0xf421('0x6a')](_0xf421('0x49'))){_0x29d63c[_0xf421('0x31')]=qs[_0xf421('0x31')](_0x599eb5[_0xf421('0x45')]['limit']);_0x29d63c[_0xf421('0x2f')]=qs[_0xf421('0x2f')](_0x599eb5[_0xf421('0x45')]['offset']);}_0x29d63c[_0xf421('0x4a')]=qs[_0xf421('0x4b')](_0x599eb5[_0xf421('0x45')][_0xf421('0x4b')]);_0x29d63c['where']=qs[_0xf421('0x4c')](_['pick'](_0x599eb5['query'],_0xec67f7['filters']));_0x29d63c[_0xf421('0x4e')]['OpenchannelAccountId']=_0x10e740['id'];if(_0x599eb5['query'][_0xf421('0x51')]){_0x29d63c['where']=_[_0xf421('0x4f')](_0x29d63c['where'],{'$or':_['map'](_0x29d63c[_0xf421('0x47')],function(_0x3b5fce){var _0x4f9b59={};_0x4f9b59[_0x3b5fce]={'$like':'%'+_0x599eb5[_0xf421('0x45')]['filter']+'%'};return _0x4f9b59;})});}_0x29d63c=_[_0xf421('0x4f')]({},_0x29d63c,_0x599eb5[_0xf421('0x59')]);return db['CannedAnswer']['count']({'where':_0x29d63c[_0xf421('0x4e')]})[_0xf421('0x37')](function(_0x5dad81){_0x132665['count']=_0x5dad81;if(_0x599eb5['query'][_0xf421('0x57')]){_0x29d63c[_0xf421('0x58')]=[{'all':!![]}];}return db['CannedAnswer'][_0xf421('0x52')](_0x29d63c);})['then'](function(_0x4c470b){_0x132665[_0xf421('0x6c')]=_0x4c470b;return _0x132665;});}})[_0xf421('0x37')](respondWithFilteredResult(_0x324134,_0x29d63c))['catch'](handleError(_0x324134,null));};exports[_0xf421('0x70')]=function(_0x4a1cb8,_0x1371ee,_0x304de6){return db[_0xf421('0x40')]['find']({'where':{'id':_0x4a1cb8['params']['id']}})[_0xf421('0x37')](handleEntityNotFound(_0x1371ee,null))[_0xf421('0x37')](function(_0x2d6229){if(_0x2d6229){return _0x2d6229[_0xf421('0x70')](_0x4a1cb8[_0xf421('0x45')]['ids']);}})[_0xf421('0x37')](respondWithStatusCode(_0x1371ee,null))['catch'](handleError(_0x1371ee,null));};exports[_0xf421('0x71')]=function(_0x28a439,_0x13bbd4,_0x5a45b0){var _0x45c137={'body':_0x28a439['body'],'channel':'openchannel'};var _0x41db4d=[];var _0x11d13f=[];var _0x30690c={};var _0x4cc41b=![];return db[_0xf421('0x72')]['describe']()['then'](function(_0x1c506d){if(!_0x1c506d){throw new db['Sequelize'][(_0xf421('0x73'))](_0xf421('0x74'));}_0x41db4d=_[_0xf421('0x75')](_[_0xf421('0x44')](_0x1c506d),['createdAt',_0xf421('0x76')]);_0x11d13f=_[_0xf421('0x75')](_[_0xf421('0x44')](_0x1c506d),['createdAt','updatedAt',_0xf421('0x77'),_0xf421('0x78')]);if(_0x28a439[_0xf421('0x64')]['id']){delete _0x28a439[_0xf421('0x64')]['id'];}if(_['isNil'](_0x28a439[_0xf421('0x64')][_0xf421('0x79')])){throw new db[(_0xf421('0x7a'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xf421('0x7b')](_0x28a439['body'][_0xf421('0x64')])||_0x28a439['body']['body']===''){throw new db[(_0xf421('0x7a'))][(_0xf421('0x73'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf421('0x7b')](_0x28a439[_0xf421('0x64')][_0xf421('0x7c')])){throw new db['Sequelize'][(_0xf421('0x73'))](_0xf421('0x7d')+_0x11d13f);}if(!_[_0xf421('0x7e')](_0x11d13f,_0x28a439['body'][_0xf421('0x7c')])){throw new db[(_0xf421('0x7a'))][(_0xf421('0x73'))](_0xf421('0x7f')+_0x11d13f);}_0x30690c[_0x28a439[_0xf421('0x64')][_0xf421('0x7c')]]=_0x28a439[_0xf421('0x64')][_0xf421('0x79')];})[_0xf421('0x37')](function(){return db[_0xf421('0x40')]['find']({'where':{'id':_0x28a439['params']['id']},'include':[{'model':db[_0xf421('0x80')],'as':_0xf421('0x81'),'include':[{'model':db[_0xf421('0x72')],'as':_0xf421('0x82'),'where':_0x30690c,'limit':0x1,'order':[[_0xf421('0x76'),_0xf421('0x83')]]}]},{'model':db['OpenchannelApplication'],'as':_0xf421('0x84')}]});})[_0xf421('0x37')](handleEntityNotFound(_0x13bbd4,null))[_0xf421('0x37')](function(_0x1d06c1){if(_0x1d06c1&&_0x1d06c1[_0xf421('0x81')]){_0x45c137[_0xf421('0x85')]=_0x1d06c1;_0x45c137[_0xf421('0x86')]=_0x1d06c1[_0xf421('0x84')];_0x45c137[_0xf421('0x87')]=_0x1d06c1['List'];_0x45c137[_0xf421('0x86')]=_[_0xf421('0x88')](_0x45c137[_0xf421('0x86')],['priority'],[_0xf421('0x89')]);if(_0x45c137['account'][_0xf421('0x84')]){delete _0x45c137['account']['Applications'];}if(_0x45c137[_0xf421('0x85')][_0xf421('0x81')]&&_0x45c137['account'][_0xf421('0x81')]['Contacts'][_0xf421('0x48')]){return _0x45c137[_0xf421('0x85')][_0xf421('0x81')]['Contacts'][0x0];}var _0x21dc4b=_[_0xf421('0x19')](_0x28a439[_0xf421('0x64')],{'firstName':_0x28a439[_0xf421('0x64')][_0xf421('0x79')],'ListId':_0x1d06c1['ListId']});_0x21dc4b[_0x28a439[_0xf421('0x64')][_0xf421('0x7c')]]=_0x28a439['body']['from'];return db[_0xf421('0x72')]['create'](_0x21dc4b,{'fields':_0x41db4d,'raw':!![]});}})[_0xf421('0x37')](handleEntityNotFound(_0x13bbd4,null))[_0xf421('0x37')](function(_0x57cd5b){_0x45c137[_0xf421('0x8a')]=_0x57cd5b;if(_0x57cd5b){var _0x3e5d68={'ContactId':_0x57cd5b['id'],'OpenchannelAccountId':_0x28a439[_0xf421('0x54')]['id'],'from':(_0x57cd5b['firstName']||'')+'\x20'+(_0x57cd5b[_0xf421('0x8b')]||'')};var _0x50f360={'OpenchannelAccountId':_0x28a439[_0xf421('0x54')]['id'],'closed':![]};if(_0x28a439[_0xf421('0x64')][_0xf421('0x8c')]){_0x50f360[_0xf421('0x8c')]=_0x28a439[_0xf421('0x64')][_0xf421('0x8c')];return db['OpenchannelInteraction'][_0xf421('0x5a')]({'where':_0x50f360})['then'](function(_0x352e27){if(_0x352e27){return[_0x352e27,![]];}_0x3e5d68['threadId']=_0x28a439['body'][_0xf421('0x8c')];_0x3e5d68['externalUrl']=_0x28a439['body'][_0xf421('0x8d')];return db['OpenchannelInteraction']['create'](_0x3e5d68)[_0xf421('0x37')](function(_0x3e1f5e){return[_0x3e1f5e,!![]];});});}else{_0x50f360['threadId']=null;}_0x50f360[_0xf421('0x8e')]=_0x57cd5b['id'];return db[_0xf421('0x8f')][_0xf421('0x5a')]({'where':_0x50f360})[_0xf421('0x37')](function(_0x24cbbb){if(_0x24cbbb){return[_0x24cbbb,![]];}return db[_0xf421('0x8f')][_0xf421('0x5b')](_0x3e5d68)['then'](function(_0x4fb387){return[_0x4fb387,!![]];});});}})['spread'](function(_0x33d259,_0x32f349){if(_0x33d259){_0x4cc41b=_0x32f349;if(!_0x32f349){var _0x5233f8={'from':(_0x45c137[_0xf421('0x8a')][_0xf421('0x90')]||'')+'\x20'+(_0x45c137[_0xf421('0x8a')][_0xf421('0x8b')]||'')};if(_0x28a439['body'][_0xf421('0x8c')]&&_0x28a439['body'][_0xf421('0x91')]&&_0x28a439[_0xf421('0x64')][_0xf421('0x8c')]!=_0x28a439['body']['messageId']){_0x5233f8[_0xf421('0x8c')]=_0x28a439['body']['messageId'];}return _0x33d259['update'](_0x5233f8);}else{return _0x33d259;}}})[_0xf421('0x37')](function(_0x5ff30b){_0x45c137['interaction']=_0x5ff30b[_0xf421('0x38')]({'plain':!![]});_0x45c137[_0xf421('0x92')][_0xf421('0x93')]=_0x4cc41b;if(_0x45c137[_0xf421('0x92')][_0xf421('0x93')]){if(_0x45c137[_0xf421('0x85')][_0xf421('0x94')]){_0x45c137['applications'][_0xf421('0x95')]({'id':0x0,'priority':_0x45c137[_0xf421('0x86')][_0xf421('0x48')]+0x1,'app':'close','appdata':_0xf421('0x96'),'interval':_0xf421('0x97')});}}return db['OpenchannelMessage'][_0xf421('0x5b')]({'body':_0x28a439[_0xf421('0x64')]['body'],'OpenchannelAccountId':_0x28a439[_0xf421('0x54')]['id'],'OpenchannelInteractionId':_0x5ff30b['id'],'direction':'in','ContactId':_0x45c137[_0xf421('0x8a')]['id'],'AttachmentId':_0x28a439[_0xf421('0x64')][_0xf421('0x98')]});})[_0xf421('0x37')](function(_0x3ac17b){_0x45c137[_0xf421('0x29')]=_0x3ac17b;if(!_0x45c137[_0xf421('0x92')][_0xf421('0x99')])return;return db[_0xf421('0x9a')][_0xf421('0x5a')]({'attributes':['id','name'],'where':{'id':_0x45c137[_0xf421('0x92')]['UserId']}});})[_0xf421('0x37')](function(_0x2ea593){if(_0x2ea593){_0x45c137[_0xf421('0x86')][_0xf421('0x9b')]({'id':0x0,'priority':0x0,'app':_0xf421('0x9c'),'appdata':_0x2ea593['name']+','+(_0x45c137[_0xf421('0x85')][_0xf421('0x9d')]||0xa),'interval':_0xf421('0x97')});}if(!_0x45c137['interaction'][_0xf421('0x9e')])return;return db[_0xf421('0x9f')][_0xf421('0x5a')]({'attributes':['id',_0xf421('0x3c')],'where':{'id':_0x45c137[_0xf421('0x92')][_0xf421('0x9e')]}});})['then'](function(_0x1440e9){if(_0x1440e9){_0x45c137['applications'][_0xf421('0x9b')]({'id':0x0,'priority':0x1,'app':_0xf421('0xa0'),'appdata':_0x1440e9[_0xf421('0x3c')]+','+(_0x45c137[_0xf421('0x85')][_0xf421('0xa1')]||0x12c),'interval':_0xf421('0x97')});}return respondWithRpcPromise(_0xf421('0xa2'),_0xf421('0xa3'),_0x45c137);})[_0xf421('0x37')](function(_0x212410){respondWithRpcPromise(_0xf421('0xa4'),'EventManager',{'event':'notify','message':_0x212410},client9002);return _0x212410;})[_0xf421('0x37')](respondWithResult(_0x13bbd4,null))[_0xf421('0x2b')](handleError(_0x13bbd4,null));};exports[_0xf421('0xa5')]=function(_0x457708,_0x22ec71){var _0xdad664=_0x457708[_0xf421('0x54')]['id'];var _0x221808=_0x457708[_0xf421('0x64')];var _0x3fbe0e=0xc8;var _0x429202=null;return db[_0xf421('0xa6')][_0xf421('0xa7')]({'isolationLevel':db[_0xf421('0xa6')][_0xf421('0xa8')][_0xf421('0xa9')][_0xf421('0xaa')]},function(_0x3d0c51){return db[_0xf421('0x40')][_0xf421('0x69')]({'where':{'id':_0xdad664},'transaction':_0x3d0c51})['then'](function(_0x1ce480){if(_0x1ce480){return db[_0xf421('0xab')][_0xf421('0x3a')]({'where':{'OpenchannelAccountId':_0xdad664},'transaction':_0x3d0c51})[_0xf421('0x37')](function(){var _0x18f505=_[_0xf421('0x50')](_0x221808,function(_0x20c048){_0x20c048[_0xf421('0x6b')]=_0xdad664;return _0x20c048;});return db[_0xf421('0xab')][_0xf421('0xac')](_0x18f505,{'transaction':_0x3d0c51});});}else{_0x3fbe0e=0x194;_0x429202=[];}});})[_0xf421('0x37')](function(){if(_0x3fbe0e!==0x194){return db['OpenchannelApplication'][_0xf421('0xad')]({'where':{'OpenchannelAccountId':_0xdad664},'order':_0xf421('0xae')})[_0xf421('0x37')](function(_0x411947){_0x429202=_0x411947;});}})['catch'](function(_0x2ed1d1){_0x3fbe0e=0x1f4;logger['error'](_0x2ed1d1[_0xf421('0xaf')]);if(_0x2ed1d1[_0xf421('0x3c')]){delete _0x2ed1d1[_0xf421('0x3c')];}_0x429202=_0x2ed1d1;})[_0xf421('0xb0')](function(){if(_0x429202===null){_0x22ec71['sendStatus'](_0x3fbe0e);}else{if(_0x3fbe0e===0x1f4){_0x22ec71['status'](_0x3fbe0e)[_0xf421('0x3d')](_0x429202);}else{_0x22ec71[_0xf421('0x2c')](_0x3fbe0e)[_0xf421('0x2e')](_0x429202);}}});};exports[_0xf421('0xb1')]=function(_0x193b0b,_0x1f6ba6,_0x2b5c6e){var _0xb6f1bf={};var _0x546e73={};var _0x4301a0;var _0x2f79b6;return db[_0xf421('0x40')]['findOne']({'where':{'id':_0x193b0b['params']['id']}})[_0xf421('0x37')](handleEntityNotFound(_0x1f6ba6,null))['then'](function(_0x3a8376){if(_0x3a8376){_0x4301a0=_0x3a8376;_0x546e73['model']=_[_0xf421('0x44')](db[_0xf421('0xab')][_0xf421('0x55')]);_0x546e73[_0xf421('0x45')]=_[_0xf421('0x44')](_0x193b0b[_0xf421('0x45')]);_0x546e73[_0xf421('0x4c')]=_['intersection'](_0x546e73[_0xf421('0x43')],_0x546e73[_0xf421('0x45')]);_0xb6f1bf[_0xf421('0x47')]=_['intersection'](_0x546e73['model'],qs[_0xf421('0x56')](_0x193b0b[_0xf421('0x45')]['fields']));_0xb6f1bf[_0xf421('0x47')]=_0xb6f1bf[_0xf421('0x47')][_0xf421('0x48')]?_0xb6f1bf[_0xf421('0x47')]:_0x546e73[_0xf421('0x43')];_0xb6f1bf['order']=qs[_0xf421('0x4b')](_0x193b0b['query']['sort']);_0xb6f1bf[_0xf421('0x4e')]=qs[_0xf421('0x4c')](_[_0xf421('0x4d')](_0x193b0b[_0xf421('0x45')],_0x546e73[_0xf421('0x4c')]));if(_0x193b0b[_0xf421('0x45')]['filter']){_0xb6f1bf[_0xf421('0x4e')]=_[_0xf421('0x4f')](_0xb6f1bf[_0xf421('0x4e')],{'$or':_[_0xf421('0x50')](_0xb6f1bf['attributes'],function(_0x30783f){var _0x22dcae={};_0x22dcae[_0x30783f]={'$like':'%'+_0x193b0b[_0xf421('0x45')][_0xf421('0x51')]+'%'};return _0x22dcae;})});}_0xb6f1bf=_[_0xf421('0x4f')]({},_0xb6f1bf,_0x193b0b[_0xf421('0x59')]);return _0x4301a0['getApplications'](_0xb6f1bf);}})[_0xf421('0x37')](function(_0x281438){if(_0x281438){_0x2f79b6=_0x281438[_0xf421('0x48')];if(!_0x193b0b[_0xf421('0x45')]['hasOwnProperty']('nolimit')){_0xb6f1bf['limit']=qs['limit'](_0x193b0b['query'][_0xf421('0x31')]);_0xb6f1bf[_0xf421('0x2f')]=qs[_0xf421('0x2f')](_0x193b0b[_0xf421('0x45')][_0xf421('0x2f')]);}return _0x4301a0[_0xf421('0xb1')](_0xb6f1bf);}})[_0xf421('0x37')](function(_0x4d3b63){if(_0x4d3b63){return _0x4d3b63?{'count':_0x2f79b6,'rows':_0x4d3b63}:null;}})[_0xf421('0x37')](respondWithResult(_0x1f6ba6,null))[_0xf421('0x2b')](handleError(_0x1f6ba6,null));};exports[_0xf421('0xb2')]=function(_0x2f0b63,_0x2c37a8,_0x44110f){var _0x2e557b={'raw':![],'where':{}};var _0x10e581={};var _0x525927={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xf421('0x69')]({'where':{'id':_0x2f0b63['params']['id']}})[_0xf421('0x37')](handleEntityNotFound(_0x2c37a8,null))[_0xf421('0x37')](function(_0x5bdfec){if(_0x5bdfec){_0x10e581[_0xf421('0x43')]=_[_0xf421('0x44')](db[_0xf421('0x8f')][_0xf421('0x55')]);_0x10e581[_0xf421('0x45')]=_['keys'](_0x2f0b63['query']);_0x10e581[_0xf421('0x4c')]=_['intersection'](_0x10e581['model'],_0x10e581['query']);_0x2e557b['attributes']=_['intersection'](_0x10e581[_0xf421('0x43')],qs[_0xf421('0x56')](_0x2f0b63['query']['fields']));_0x2e557b[_0xf421('0x47')]=_0x2e557b['attributes'][_0xf421('0x48')]?_0x2e557b[_0xf421('0x47')]:_0x10e581[_0xf421('0x43')];if(!_0x2f0b63[_0xf421('0x45')]['hasOwnProperty'](_0xf421('0x49'))){_0x2e557b[_0xf421('0x31')]=qs[_0xf421('0x31')](_0x2f0b63['query']['limit']);_0x2e557b['offset']=qs['offset'](_0x2f0b63[_0xf421('0x45')][_0xf421('0x2f')]);}_0x2e557b['order']=qs[_0xf421('0x4b')](_0x2f0b63[_0xf421('0x45')][_0xf421('0x4b')]);_0x2e557b['where']=qs['filters'](_[_0xf421('0x4d')](_0x2f0b63[_0xf421('0x45')],_0x10e581[_0xf421('0x4c')]));_0x2e557b[_0xf421('0x4e')][_0xf421('0x6b')]=_0x5bdfec['id'];if(_0x2f0b63['query'][_0xf421('0x51')]){_0x2e557b['where']=_[_0xf421('0x4f')](_0x2e557b[_0xf421('0x4e')],{'$or':_[_0xf421('0x50')](_0x2e557b[_0xf421('0x47')],function(_0x1d2096){var _0xaa04df={};_0xaa04df[_0x1d2096]={'$like':'%'+_0x2f0b63['query']['filter']+'%'};return _0xaa04df;})});}_0x2e557b=_[_0xf421('0x4f')]({},_0x2e557b,_0x2f0b63[_0xf421('0x59')]);return db[_0xf421('0x8f')]['count']({'where':_0x2e557b[_0xf421('0x4e')]})[_0xf421('0x37')](function(_0x4c7cdf){_0x525927[_0xf421('0x32')]=_0x4c7cdf;if(_0x2f0b63[_0xf421('0x45')]['includeAll']){_0x2e557b[_0xf421('0x58')]=[{'model':db[_0xf421('0x72')],'as':_0xf421('0xb3'),'required':![]},{'model':db['User'],'as':_0xf421('0xb4'),'attributes':[_0xf421('0x3c'),_0xf421('0xb5'),'internal'],'required':![]},{'model':db[_0xf421('0xb6')],'as':_0xf421('0xb7'),'attributes':['id',_0xf421('0x3c'),_0xf421('0xb8')],'where':_0x2f0b63[_0xf421('0x45')][_0xf421('0xb9')]?{'id':_0x2f0b63['query'][_0xf421('0xb9')]}:undefined,'required':_0x2f0b63[_0xf421('0x45')][_0xf421('0xb9')]?!![]:![]}];}return db[_0xf421('0x8f')][_0xf421('0x52')](_0x2e557b);})['then'](function(_0x4dd06f){_0x525927['rows']=_0x4dd06f;return _0x525927;});}})[_0xf421('0x37')](respondWithFilteredResult(_0x2c37a8,_0x2e557b))[_0xf421('0x2b')](handleError(_0x2c37a8,null));};exports['addAgents']=function(_0x52a271,_0x178feb,_0x41b069){return db[_0xf421('0x40')][_0xf421('0x5a')]({'where':{'id':_0x52a271[_0xf421('0x54')]['id']}})[_0xf421('0x37')](handleEntityNotFound(_0x178feb,null))[_0xf421('0x37')](function(_0x161bf1){if(_0x161bf1){return _0x161bf1['addAgents'](_0x52a271[_0xf421('0x64')]['ids'],_['omit'](_0x52a271['body'],[_0xf421('0x6e'),'id'])||{})['spread'](function(_0x50c02a){for(var _0x4b5bdd=0x0;_0x4b5bdd<_0x52a271[_0xf421('0x64')][_0xf421('0x6e')][_0xf421('0x48')];_0x4b5bdd+=0x1){socket[_0xf421('0xba')](_0xf421('0xbb'),{'UserId':Number(_0x52a271[_0xf421('0x64')][_0xf421('0x6e')][_0x4b5bdd]),'OpenchannelAccountId':Number(_0x52a271[_0xf421('0x54')]['id'])});}return _0x50c02a;});}})[_0xf421('0x37')](respondWithResult(_0x178feb,null))['catch'](handleError(_0x178feb,null));};exports['removeAgents']=function(_0x2fe3c0,_0x21c937,_0x2a2598){return db[_0xf421('0x40')]['find']({'where':{'id':_0x2fe3c0[_0xf421('0x54')]['id']}})[_0xf421('0x37')](handleEntityNotFound(_0x21c937,null))[_0xf421('0x37')](function(_0x582185){if(_0x582185){return _0x582185['removeAgents'](_0x2fe3c0[_0xf421('0x45')][_0xf421('0x6e')])[_0xf421('0x37')](function(){if(_[_0xf421('0xbc')](_0x2fe3c0[_0xf421('0x45')][_0xf421('0x6e')])){for(var _0x40a11f=0x0;_0x40a11f<_0x2fe3c0[_0xf421('0x45')][_0xf421('0x6e')]['length'];_0x40a11f+=0x1){socket[_0xf421('0xba')](_0xf421('0xbd'),{'UserId':Number(_0x2fe3c0['query'][_0xf421('0x6e')][_0x40a11f]),'OpenchannelAccountId':Number(_0x2fe3c0['params']['id'])});}}else{socket[_0xf421('0xba')](_0xf421('0xbd'),{'UserId':Number(_0x2fe3c0['query'][_0xf421('0x6e')]),'OpenchannelAccountId':Number(_0x2fe3c0[_0xf421('0x54')]['id'])});}});}})[_0xf421('0x37')](respondWithStatusCode(_0x21c937,null))[_0xf421('0x2b')](handleError(_0x21c937,null));};exports['getAgents']=function(_0x4ecad2,_0x3c3162,_0x29afc6){var _0x58ed1a={};var _0x371169={};var _0x36b63e;var _0x55db50;return db[_0xf421('0x40')][_0xf421('0x69')]({'where':{'id':_0x4ecad2[_0xf421('0x54')]['id']}})[_0xf421('0x37')](handleEntityNotFound(_0x3c3162,null))[_0xf421('0x37')](function(_0x1c0f3a){if(_0x1c0f3a){_0x36b63e=_0x1c0f3a;_0x371169[_0xf421('0x43')]=_[_0xf421('0x44')](db[_0xf421('0x9a')][_0xf421('0x55')]);_0x371169[_0xf421('0x45')]=_['keys'](_0x4ecad2[_0xf421('0x45')]);_0x371169[_0xf421('0x4c')]=_[_0xf421('0x46')](_0x371169[_0xf421('0x43')],_0x371169[_0xf421('0x45')]);_0x58ed1a['attributes']=_['intersection'](_0x371169[_0xf421('0x43')],qs[_0xf421('0x56')](_0x4ecad2[_0xf421('0x45')]['fields']));_0x58ed1a[_0xf421('0x47')]=_0x58ed1a['attributes'][_0xf421('0x48')]?_0x58ed1a[_0xf421('0x47')]:_0x371169[_0xf421('0x43')];_0x58ed1a[_0xf421('0x4a')]=qs['sort'](_0x4ecad2[_0xf421('0x45')][_0xf421('0x4b')]);_0x58ed1a[_0xf421('0x4e')]=qs[_0xf421('0x4c')](_[_0xf421('0x4d')](_0x4ecad2[_0xf421('0x45')],_0x371169[_0xf421('0x4c')]));if(_0x4ecad2[_0xf421('0x45')][_0xf421('0x51')]){_0x58ed1a[_0xf421('0x4e')]=_[_0xf421('0x4f')](_0x58ed1a[_0xf421('0x4e')],{'$or':_[_0xf421('0x50')](_0x58ed1a[_0xf421('0x47')],function(_0x40bf39){var _0x5805c9={};_0x5805c9[_0x40bf39]={'$like':'%'+_0x4ecad2[_0xf421('0x45')][_0xf421('0x51')]+'%'};return _0x5805c9;})});}_0x58ed1a=_[_0xf421('0x4f')]({},_0x58ed1a,_0x4ecad2[_0xf421('0x59')]);return _0x36b63e['getAgents'](_0x58ed1a);}})[_0xf421('0x37')](function(_0x379b26){if(_0x379b26){_0x55db50=_0x379b26[_0xf421('0x48')];if(!_0x4ecad2['query'][_0xf421('0x6a')](_0xf421('0x49'))){_0x58ed1a[_0xf421('0x31')]=qs[_0xf421('0x31')](_0x4ecad2[_0xf421('0x45')][_0xf421('0x31')]);_0x58ed1a[_0xf421('0x2f')]=qs[_0xf421('0x2f')](_0x4ecad2[_0xf421('0x45')][_0xf421('0x2f')]);}return _0x36b63e['getAgents'](_0x58ed1a);}})[_0xf421('0x37')](function(_0x574a12){if(_0x574a12){return _0x574a12?{'count':_0x55db50,'rows':_0x574a12}:null;}})[_0xf421('0x37')](respondWithResult(_0x3c3162,null))[_0xf421('0x2b')](handleError(_0x3c3162,null));};exports[_0xf421('0x3d')]=function(_0xa2ce8a,_0xbab027,_0x2fa4d7){var _0x43833f,_0x9814f0,_0xd60305;if(_[_0xf421('0x7b')](_0xa2ce8a[_0xf421('0x64')][_0xf421('0x64')])||_0xa2ce8a[_0xf421('0x64')][_0xf421('0x64')]===''){throw new db['Sequelize'][(_0xf421('0x73'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf421('0x7b')](_0xa2ce8a[_0xf421('0x64')]['to'])){}_0x43833f=_0xa2ce8a[_0xf421('0x64')]['to'];return db[_0xf421('0x40')][_0xf421('0x69')]({'where':{'id':_0xa2ce8a[_0xf421('0x54')]['id']}})[_0xf421('0x37')](handleEntityNotFound(_0xbab027,null))['then'](function(_0x229fa9){if(_0x229fa9){return db[_0xf421('0x40')][_0xf421('0x5a')]({'where':{'id':_0x229fa9['id']},'include':[{'model':db['CmList'],'as':_0xf421('0x81'),'include':[{'model':db[_0xf421('0x72')],'as':_0xf421('0x82'),'where':{[_0x229fa9['mapKey']]:_0x43833f},'limit':0x1,'order':[[_0xf421('0x76'),_0xf421('0x83')]]}]}]})['then'](handleEntityNotFound(_0xbab027,null))['then'](function(_0x3d30aa){if(_0x3d30aa&&_0x3d30aa['List']){_0x9814f0=_0x3d30aa[_0xf421('0x38')]({'plain':!![]});if(_0x9814f0[_0xf421('0x81')]&&_0x9814f0[_0xf421('0x81')][_0xf421('0x82')][_0xf421('0x48')]){return _0x9814f0[_0xf421('0x81')][_0xf421('0x82')][0x0];}return db[_0xf421('0x72')][_0xf421('0x5b')](_['defaults'](_0xa2ce8a['body'],{'firstName':_0x43833f,[_0x3d30aa[_0xf421('0x7c')]]:_0x43833f,'phone':_0x43833f,'ListId':_0x9814f0['ListId']}));}})[_0xf421('0x37')](handleEntityNotFound(_0xbab027,null))[_0xf421('0x37')](function(_0x10176a){if(_0x10176a){_0xd60305=_0x10176a;return db[_0xf421('0x8f')]['find']({'where':{'ContactId':_0xd60305['id'],'closed':![],'OpenchannelAccountId':_0x9814f0['id']}})[_0xf421('0x37')](function(_0x229be0){if(_0x229be0){return[_0x229be0,![]];}return db[_0xf421('0x8f')]['create']({'UserId':_0xa2ce8a[_0xf421('0x5c')]['id'],'ContactId':_0xd60305['id'],'OpenchannelAccountId':_0x9814f0['id'],'lastMsgDirection':_0xf421('0xbe'),'firstMsgDirection':_0xf421('0xbe'),'Messages':[_[_0xf421('0x4f')](_0xa2ce8a['body'],{'read':![],'body':_0xa2ce8a[_0xf421('0x64')]['body'],'OpenchannelAccountId':_0x9814f0['id'],'UserId':_0xa2ce8a[_0xf421('0x5c')]['id'],'ContactId':_0xd60305['id']})]},{'include':[{'model':db[_0xf421('0xbf')],'as':'Messages'}]})[_0xf421('0x37')](function(_0x5a32d8){return[_0x5a32d8,!![]];});});}})[_0xf421('0xc0')](function(_0x1bfbdb,_0x219d12){if(_0x219d12){return _0x1bfbdb;}return db['OpenchannelMessage'][_0xf421('0x5b')](_[_0xf421('0x4f')](_0xa2ce8a['body'],{'read':![],'body':_0xa2ce8a[_0xf421('0x64')][_0xf421('0x64')],'OpenchannelAccountId':_0x9814f0['id'],'OpenchannelInteractionId':_0x1bfbdb['id'],'UserId':_0xa2ce8a[_0xf421('0x5c')]['id'],'ContactId':_0xd60305['id']}))[_0xf421('0x37')](function(_0x382567){_0x1bfbdb[_0xf421('0xc1')][_0xf421('0xc2')]=[];_0x1bfbdb[_0xf421('0xc1')][_0xf421('0xc2')][_0xf421('0x95')](_0x382567[_0xf421('0xc1')]);return _0x1bfbdb;});});}})[_0xf421('0x37')](respondWithResult(_0xbab027,null))[_0xf421('0x2b')](handleError(_0xbab027,null));}; \ No newline at end of file +var _0xe864=['OpenchannelAccounts','UserProfileResource','stack','name','index','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','options','includeAll','include','rows','show','Pause','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','CannedAnswer','getAnswers','pick','removeAnswers','notify','openchannel','CmContact','createdAt','updatedAt','difference','CompanyId','isNil','from','Sequelize','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','Contacts','DESC','OpenchannelApplication','Applications','List','account','applications','list','priority','asc','defaults','ListId','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','OpenchannelQueue','queueId','queue','Start','sequelize','Transaction','READ_COMMITTED','findAndCountAll','finally','send','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./openchannelAccount.socket','register','jayson/promise','client','http','request','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','OpenchannelAccount,\x20%s,\x20%s','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get'];(function(_0x4cfe2a,_0x5b0a93){var _0x4f346b=function(_0x1aa38e){while(--_0x1aa38e){_0x4cfe2a['push'](_0x4cfe2a['shift']());}};_0x4f346b(++_0x5b0a93);}(_0xe864,0x14b));var _0x4e86=function(_0x38f012,_0x1df6e8){_0x38f012=_0x38f012-0x0;var _0x38add2=_0xe864[_0x38f012];return _0x38add2;};'use strict';var emlformat=require(_0x4e86('0x0'));var rimraf=require(_0x4e86('0x1'));var zipdir=require(_0x4e86('0x2'));var jsonpatch=require(_0x4e86('0x3'));var rp=require(_0x4e86('0x4'));var moment=require(_0x4e86('0x5'));var BPromise=require(_0x4e86('0x6'));var Mustache=require(_0x4e86('0x7'));var util=require(_0x4e86('0x8'));var path=require(_0x4e86('0x9'));var sox=require(_0x4e86('0xa'));var csv=require(_0x4e86('0xb'));var ejs=require(_0x4e86('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4e86('0xd'));var squel=require(_0x4e86('0xe'));var crypto=require('crypto');var jsforce=require(_0x4e86('0xf'));var deskjs=require(_0x4e86('0x10'));var toCsv=require(_0x4e86('0xb'));var querystring=require(_0x4e86('0x11'));var Papa=require(_0x4e86('0x12'));var Redis=require(_0x4e86('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4e86('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4e86('0x15'))(_0x4e86('0x16'));var utils=require(_0x4e86('0x17'));var config=require(_0x4e86('0x18'));var licenseUtil=require(_0x4e86('0x19'));var db=require(_0x4e86('0x1a'))['db'];config[_0x4e86('0x1b')]=_['defaults'](config[_0x4e86('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4e86('0x1c'))[_0x4e86('0x1d')](socket);var jayson=require(_0x4e86('0x1e'));var client=jayson[_0x4e86('0x1f')][_0x4e86('0x20')]({'port':0x232c});var client9002=jayson[_0x4e86('0x1f')][_0x4e86('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x292ef8,_0x1f6875,_0x3f19d0,_0x20cd27){return new BPromise(function(_0x5185b5,_0x5788b7){var _0x55a7b0=_0x20cd27||client;return _0x55a7b0[_0x4e86('0x21')](_0x292ef8,_0x3f19d0)['then'](function(_0x1e917c){logger['info']('OpenchannelAccount,\x20%s,\x20%s',_0x1f6875,_0x4e86('0x22'));logger['debug'](_0x4e86('0x23'),_0x1f6875,_0x4e86('0x22'),JSON['stringify'](_0x1e917c));if(_0x1e917c['error']){if(_0x1e917c[_0x4e86('0x24')][_0x4e86('0x25')]===0x1f4){logger[_0x4e86('0x24')]('OpenchannelAccount,\x20%s,\x20%s',_0x1f6875,_0x1e917c[_0x4e86('0x24')]['message']);return _0x5788b7(_0x1e917c['error'][_0x4e86('0x26')]);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x1f6875,_0x1e917c[_0x4e86('0x24')][_0x4e86('0x26')]);return _0x5185b5(_0x1e917c['error'][_0x4e86('0x26')]);}else{logger[_0x4e86('0x27')](_0x4e86('0x28'),_0x1f6875,'request\x20sent');_0x5185b5(_0x1e917c[_0x4e86('0x29')][_0x4e86('0x26')]);}})[_0x4e86('0x2a')](function(_0x388887){logger[_0x4e86('0x24')](_0x4e86('0x28'),_0x1f6875,_0x388887);_0x5788b7(_0x388887);});});}function respondWithStatusCode(_0x860ef,_0x2a4ff1){_0x2a4ff1=_0x2a4ff1||0xcc;return function(_0x5c2d72){if(_0x5c2d72){return _0x860ef[_0x4e86('0x2b')](_0x2a4ff1);}return _0x860ef['status'](_0x2a4ff1)['end']();};}function respondWithResult(_0x1f9f25,_0x532bed){_0x532bed=_0x532bed||0xc8;return function(_0x1e9c1b){if(_0x1e9c1b){return _0x1f9f25[_0x4e86('0x2c')](_0x532bed)[_0x4e86('0x2d')](_0x1e9c1b);}};}function respondWithFilteredResult(_0x2ff569,_0x4a5c7d){return function(_0x2bbd61){if(_0x2bbd61){var _0x325f46=typeof _0x4a5c7d[_0x4e86('0x2e')]===_0x4e86('0x2f')&&typeof _0x4a5c7d[_0x4e86('0x30')]===_0x4e86('0x2f');var _0x8f2658=_0x2bbd61[_0x4e86('0x31')];var _0xdda456=_0x325f46?0x0:_0x4a5c7d[_0x4e86('0x2e')];var _0x5d6fa8=_0x325f46?_0x2bbd61[_0x4e86('0x31')]:_0x4a5c7d[_0x4e86('0x2e')]+_0x4a5c7d[_0x4e86('0x30')];var _0x5002ee;if(_0x5d6fa8>=_0x8f2658){_0x5d6fa8=_0x8f2658;_0x5002ee=0xc8;}else{_0x5002ee=0xce;}_0x2ff569[_0x4e86('0x2c')](_0x5002ee);return _0x2ff569[_0x4e86('0x32')](_0x4e86('0x33'),_0xdda456+'-'+_0x5d6fa8+'/'+_0x8f2658)['json'](_0x2bbd61);}return null;};}function patchUpdates(_0x223021){return function(_0x207e57){try{jsonpatch[_0x4e86('0x34')](_0x207e57,_0x223021,!![]);}catch(_0x557bd5){return BPromise[_0x4e86('0x35')](_0x557bd5);}return _0x207e57[_0x4e86('0x36')]();};}function saveUpdates(_0x18e855,_0x47fcc8){return function(_0x381b10){if(_0x381b10){return _0x381b10[_0x4e86('0x37')](_0x18e855)['then'](function(_0x26e41a){return _0x26e41a;});}return null;};}function removeEntity(_0x1a8b8d,_0x52697a){return function(_0x3246e3){if(_0x3246e3){return _0x3246e3[_0x4e86('0x38')]()[_0x4e86('0x39')](function(){var _0xf4b0ee=_0x3246e3[_0x4e86('0x3a')]({'plain':!![]});var _0x2a089b=_0x4e86('0x3b');return db[_0x4e86('0x3c')][_0x4e86('0x38')]({'where':{'type':_0x2a089b,'resourceId':_0xf4b0ee['id']}})[_0x4e86('0x39')](function(){return _0x3246e3;});})[_0x4e86('0x39')](function(){_0x1a8b8d[_0x4e86('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20fe2e,_0x13c54a){return function(_0x3c3c9d){if(!_0x3c3c9d){_0x20fe2e[_0x4e86('0x2b')](0x194);}return _0x3c3c9d;};}function handleError(_0x34ae08,_0x2dd790){_0x2dd790=_0x2dd790||0x1f4;return function(_0x429ac4){logger[_0x4e86('0x24')](_0x429ac4[_0x4e86('0x3d')]);if(_0x429ac4[_0x4e86('0x3e')]){delete _0x429ac4[_0x4e86('0x3e')];}_0x34ae08[_0x4e86('0x2c')](_0x2dd790)['send'](_0x429ac4);};}exports[_0x4e86('0x3f')]=function(_0x20ad14,_0x5c3c88){var _0x164854={'include':[{'model':db['Pause'],'as':_0x4e86('0x40')}]},_0x518fb6={},_0x2688ee={'count':0x0,'rows':[]};var _0x17fca6=_[_0x4e86('0x41')](db[_0x4e86('0x42')][_0x4e86('0x43')],function(_0x190ae1){return{'name':_0x190ae1[_0x4e86('0x44')],'type':_0x190ae1[_0x4e86('0x45')][_0x4e86('0x46')]};});_0x518fb6[_0x4e86('0x47')]=_[_0x4e86('0x41')](_0x17fca6,_0x4e86('0x3e'));_0x518fb6['query']=_[_0x4e86('0x48')](_0x20ad14[_0x4e86('0x49')]);_0x518fb6['filters']=_[_0x4e86('0x4a')](_0x518fb6[_0x4e86('0x47')],_0x518fb6[_0x4e86('0x49')]);_0x164854[_0x4e86('0x4b')]=_[_0x4e86('0x4a')](_0x518fb6['model'],qs[_0x4e86('0x4c')](_0x20ad14['query'][_0x4e86('0x4c')]));_0x164854[_0x4e86('0x4b')]=_0x164854[_0x4e86('0x4b')]['length']?_0x164854['attributes']:_0x518fb6[_0x4e86('0x47')];if(!_0x20ad14[_0x4e86('0x49')][_0x4e86('0x4d')](_0x4e86('0x4e'))){_0x164854['limit']=qs[_0x4e86('0x30')](_0x20ad14[_0x4e86('0x49')][_0x4e86('0x30')]);_0x164854[_0x4e86('0x2e')]=qs[_0x4e86('0x2e')](_0x20ad14['query'][_0x4e86('0x2e')]);}_0x164854[_0x4e86('0x4f')]=qs[_0x4e86('0x50')](_0x20ad14[_0x4e86('0x49')]['sort']);_0x164854[_0x4e86('0x51')]=qs[_0x4e86('0x52')](_['pick'](_0x20ad14[_0x4e86('0x49')],_0x518fb6[_0x4e86('0x52')]),_0x17fca6);if(_0x20ad14[_0x4e86('0x49')]['filter']){_0x164854[_0x4e86('0x51')]=_[_0x4e86('0x53')](_0x164854[_0x4e86('0x51')],{'$or':_[_0x4e86('0x41')](_0x17fca6,function(_0x4436bf){if(_0x4436bf['type']!=='VIRTUAL'){var _0x1ce9f1={};_0x1ce9f1[_0x4436bf['name']]={'$like':'%'+_0x20ad14[_0x4e86('0x49')][_0x4e86('0x54')]+'%'};return _0x1ce9f1;}})});}_0x164854=_[_0x4e86('0x53')]({},_0x164854,_0x20ad14[_0x4e86('0x55')]);var _0x392bf2={'where':_0x164854[_0x4e86('0x51')]};return db[_0x4e86('0x42')][_0x4e86('0x31')](_0x392bf2)[_0x4e86('0x39')](function(_0x3a6d0c){_0x2688ee['count']=_0x3a6d0c;if(_0x20ad14[_0x4e86('0x49')][_0x4e86('0x56')]){_0x164854[_0x4e86('0x57')]=[{'all':!![]}];}return db[_0x4e86('0x42')]['findAll'](_0x164854);})[_0x4e86('0x39')](function(_0x37e853){_0x2688ee[_0x4e86('0x58')]=_0x37e853;return _0x2688ee;})['then'](respondWithFilteredResult(_0x5c3c88,_0x164854))[_0x4e86('0x2a')](handleError(_0x5c3c88,null));};exports[_0x4e86('0x59')]=function(_0x111aa3,_0x26d3ae){var _0x45a4df={'raw':![],'where':{'id':_0x111aa3['params']['id']},'include':[{'model':db[_0x4e86('0x5a')],'as':_0x4e86('0x40')}]},_0x2e6763={};_0x2e6763[_0x4e86('0x47')]=_[_0x4e86('0x48')](db['OpenchannelAccount']['rawAttributes']);_0x2e6763[_0x4e86('0x49')]=_[_0x4e86('0x48')](_0x111aa3[_0x4e86('0x49')]);_0x2e6763[_0x4e86('0x52')]=_['intersection'](_0x2e6763[_0x4e86('0x47')],_0x2e6763[_0x4e86('0x49')]);_0x45a4df[_0x4e86('0x4b')]=_[_0x4e86('0x4a')](_0x2e6763[_0x4e86('0x47')],qs['fields'](_0x111aa3[_0x4e86('0x49')][_0x4e86('0x4c')]));_0x45a4df[_0x4e86('0x4b')]=_0x45a4df['attributes'][_0x4e86('0x5b')]?_0x45a4df['attributes']:_0x2e6763['model'];if(_0x111aa3[_0x4e86('0x49')][_0x4e86('0x56')]){_0x45a4df[_0x4e86('0x57')]=[{'all':!![]}];}_0x45a4df=_['merge']({},_0x45a4df,_0x111aa3['options']);return db[_0x4e86('0x42')][_0x4e86('0x5c')](_0x45a4df)[_0x4e86('0x39')](handleEntityNotFound(_0x26d3ae,null))[_0x4e86('0x39')](respondWithResult(_0x26d3ae,null))[_0x4e86('0x2a')](handleError(_0x26d3ae,null));};exports[_0x4e86('0x5d')]=function(_0x3b4d33,_0x4684eb){return db[_0x4e86('0x42')]['create'](_0x3b4d33[_0x4e86('0x5e')],{})[_0x4e86('0x39')](function(_0x50ecb8){var _0xc29b96=_0x3b4d33[_0x4e86('0x5f')]['get']({'plain':!![]});if(!_0xc29b96)throw new Error(_0x4e86('0x60'));if(_0xc29b96[_0x4e86('0x61')]===_0x4e86('0x5f')){var _0x235bdb=_0x50ecb8['get']({'plain':!![]});var _0x23d216=_0x4e86('0x3b');return db['UserProfileSection'][_0x4e86('0x5c')]({'where':{'name':_0x23d216,'userProfileId':_0xc29b96[_0x4e86('0x62')]},'raw':!![]})['then'](function(_0x229431){if(_0x229431&&_0x229431[_0x4e86('0x63')]===0x0){return db[_0x4e86('0x3c')][_0x4e86('0x5d')]({'name':_0x235bdb['name'],'resourceId':_0x235bdb['id'],'type':_0x229431[_0x4e86('0x3e')],'sectionId':_0x229431['id']},{})['then'](function(){return _0x50ecb8;});}else{return _0x50ecb8;}})[_0x4e86('0x2a')](function(_0x318768){logger[_0x4e86('0x24')](_0x4e86('0x64'),_0x318768);throw _0x318768;});}return _0x50ecb8;})[_0x4e86('0x39')](respondWithResult(_0x4684eb,0xc9))['catch'](handleError(_0x4684eb,null));};exports[_0x4e86('0x37')]=function(_0x5e527c,_0x51e16f){if(_0x5e527c['body']['id']){delete _0x5e527c[_0x4e86('0x5e')]['id'];}return db[_0x4e86('0x42')][_0x4e86('0x5c')]({'where':{'id':_0x5e527c[_0x4e86('0x65')]['id']},'include':[{'model':db[_0x4e86('0x5a')],'as':_0x4e86('0x40')}]})[_0x4e86('0x39')](handleEntityNotFound(_0x51e16f,null))[_0x4e86('0x39')](saveUpdates(_0x5e527c[_0x4e86('0x5e')],null))['then'](respondWithResult(_0x51e16f,null))[_0x4e86('0x2a')](handleError(_0x51e16f,null));};exports[_0x4e86('0x38')]=function(_0xf7979c,_0x321a1b){return db[_0x4e86('0x42')][_0x4e86('0x5c')]({'where':{'id':_0xf7979c[_0x4e86('0x65')]['id']}})[_0x4e86('0x39')](handleEntityNotFound(_0x321a1b,null))[_0x4e86('0x39')](removeEntity(_0x321a1b,null))[_0x4e86('0x2a')](handleError(_0x321a1b,null));};exports['describe']=function(_0xa66c2e,_0x1b345a){return db[_0x4e86('0x42')][_0x4e86('0x66')]()[_0x4e86('0x39')](respondWithResult(_0x1b345a,null))[_0x4e86('0x2a')](handleError(_0x1b345a,null));};exports['addDisposition']=function(_0x724ce1,_0x5d65b7,_0x510139){if(_0x724ce1['body']['id']){delete _0x724ce1[_0x4e86('0x5e')]['id'];}return db[_0x4e86('0x42')][_0x4e86('0x5c')]({'where':{'id':_0x724ce1[_0x4e86('0x65')]['id']}})[_0x4e86('0x39')](handleEntityNotFound(_0x5d65b7,null))[_0x4e86('0x39')](function(_0x421f16){if(_0x421f16){_0x724ce1[_0x4e86('0x5e')][_0x4e86('0x67')]=_0x421f16['id'];return db[_0x4e86('0x68')][_0x4e86('0x5d')](_0x724ce1[_0x4e86('0x5e')]);}})[_0x4e86('0x39')](respondWithResult(_0x5d65b7,null))[_0x4e86('0x2a')](handleError(_0x5d65b7,null));};exports[_0x4e86('0x69')]=function(_0x2d44f8,_0x3a6cac,_0x45e706){var _0x575e23={'raw':![],'where':{}};var _0x7164f4={};var _0x4e38a2={'count':0x0,'rows':[]};return db[_0x4e86('0x42')][_0x4e86('0x6a')]({'where':{'id':_0x2d44f8[_0x4e86('0x65')]['id']}})[_0x4e86('0x39')](handleEntityNotFound(_0x3a6cac,null))[_0x4e86('0x39')](function(_0x4d26fe){if(_0x4d26fe){_0x7164f4[_0x4e86('0x47')]=_[_0x4e86('0x48')](db[_0x4e86('0x68')]['rawAttributes']);_0x7164f4[_0x4e86('0x49')]=_[_0x4e86('0x48')](_0x2d44f8[_0x4e86('0x49')]);_0x7164f4[_0x4e86('0x52')]=_[_0x4e86('0x4a')](_0x7164f4[_0x4e86('0x47')],_0x7164f4[_0x4e86('0x49')]);_0x575e23[_0x4e86('0x4b')]=_['intersection'](_0x7164f4['model'],qs['fields'](_0x2d44f8[_0x4e86('0x49')]['fields']));_0x575e23['attributes']=_0x575e23[_0x4e86('0x4b')]['length']?_0x575e23[_0x4e86('0x4b')]:_0x7164f4['model'];if(!_0x2d44f8['query'][_0x4e86('0x4d')](_0x4e86('0x4e'))){_0x575e23[_0x4e86('0x30')]=qs[_0x4e86('0x30')](_0x2d44f8[_0x4e86('0x49')][_0x4e86('0x30')]);_0x575e23[_0x4e86('0x2e')]=qs[_0x4e86('0x2e')](_0x2d44f8['query'][_0x4e86('0x2e')]);}_0x575e23[_0x4e86('0x4f')]=qs['sort'](_0x2d44f8[_0x4e86('0x49')][_0x4e86('0x50')]);_0x575e23[_0x4e86('0x51')]=qs[_0x4e86('0x52')](_['pick'](_0x2d44f8[_0x4e86('0x49')],_0x7164f4['filters']));_0x575e23[_0x4e86('0x51')]['OpenchannelAccountId']=_0x4d26fe['id'];if(_0x2d44f8[_0x4e86('0x49')][_0x4e86('0x54')]){_0x575e23['where']=_[_0x4e86('0x53')](_0x575e23['where'],{'$or':_[_0x4e86('0x41')](_0x575e23[_0x4e86('0x4b')],function(_0xa38c14){var _0xef9464={};_0xef9464[_0xa38c14]={'$like':'%'+_0x2d44f8[_0x4e86('0x49')][_0x4e86('0x54')]+'%'};return _0xef9464;})});}_0x575e23=_[_0x4e86('0x53')]({},_0x575e23,_0x2d44f8[_0x4e86('0x55')]);return db[_0x4e86('0x68')][_0x4e86('0x31')]({'where':_0x575e23[_0x4e86('0x51')]})['then'](function(_0x34b287){_0x4e38a2[_0x4e86('0x31')]=_0x34b287;if(_0x2d44f8['query']['includeAll']){_0x575e23[_0x4e86('0x57')]=[{'all':!![]}];}return db[_0x4e86('0x68')][_0x4e86('0x6b')](_0x575e23);})['then'](function(_0x17c7e8){_0x4e38a2['rows']=_0x17c7e8;return _0x4e38a2;});}})[_0x4e86('0x39')](respondWithFilteredResult(_0x3a6cac,_0x575e23))[_0x4e86('0x2a')](handleError(_0x3a6cac,null));};exports[_0x4e86('0x6c')]=function(_0x472c7c,_0x49747b,_0x1bf551){return db['OpenchannelAccount']['find']({'where':{'id':_0x472c7c[_0x4e86('0x65')]['id']}})[_0x4e86('0x39')](handleEntityNotFound(_0x49747b,null))['then'](function(_0x167c8b){if(_0x167c8b){return _0x167c8b['removeDispositions'](_0x472c7c['query'][_0x4e86('0x6d')]);}})['then'](respondWithStatusCode(_0x49747b,null))[_0x4e86('0x2a')](handleError(_0x49747b,null));};exports['addAnswer']=function(_0xdfc441,_0xbbf2c9,_0x2c2fff){if(_0xdfc441[_0x4e86('0x5e')]['id']){delete _0xdfc441[_0x4e86('0x5e')]['id'];}return db[_0x4e86('0x42')]['find']({'where':{'id':_0xdfc441['params']['id']}})[_0x4e86('0x39')](handleEntityNotFound(_0xbbf2c9,null))['then'](function(_0xce773f){if(_0xce773f){_0xdfc441[_0x4e86('0x5e')][_0x4e86('0x67')]=_0xce773f['id'];return db[_0x4e86('0x6e')]['create'](_0xdfc441[_0x4e86('0x5e')]);}})[_0x4e86('0x39')](respondWithResult(_0xbbf2c9,null))[_0x4e86('0x2a')](handleError(_0xbbf2c9,null));};exports[_0x4e86('0x6f')]=function(_0x136640,_0x2dda74,_0x3c1a97){var _0x536add={'raw':![],'where':{}};var _0x48fcb8={};var _0x598fd5={'count':0x0,'rows':[]};return db[_0x4e86('0x42')][_0x4e86('0x6a')]({'where':{'id':_0x136640[_0x4e86('0x65')]['id']}})[_0x4e86('0x39')](handleEntityNotFound(_0x2dda74,null))[_0x4e86('0x39')](function(_0xbc621b){if(_0xbc621b){_0x48fcb8[_0x4e86('0x47')]=_[_0x4e86('0x48')](db[_0x4e86('0x6e')][_0x4e86('0x43')]);_0x48fcb8[_0x4e86('0x49')]=_['keys'](_0x136640[_0x4e86('0x49')]);_0x48fcb8[_0x4e86('0x52')]=_['intersection'](_0x48fcb8['model'],_0x48fcb8['query']);_0x536add[_0x4e86('0x4b')]=_[_0x4e86('0x4a')](_0x48fcb8[_0x4e86('0x47')],qs[_0x4e86('0x4c')](_0x136640['query']['fields']));_0x536add[_0x4e86('0x4b')]=_0x536add[_0x4e86('0x4b')]['length']?_0x536add[_0x4e86('0x4b')]:_0x48fcb8['model'];if(!_0x136640[_0x4e86('0x49')][_0x4e86('0x4d')]('nolimit')){_0x536add[_0x4e86('0x30')]=qs[_0x4e86('0x30')](_0x136640[_0x4e86('0x49')][_0x4e86('0x30')]);_0x536add['offset']=qs[_0x4e86('0x2e')](_0x136640[_0x4e86('0x49')][_0x4e86('0x2e')]);}_0x536add[_0x4e86('0x4f')]=qs['sort'](_0x136640[_0x4e86('0x49')][_0x4e86('0x50')]);_0x536add[_0x4e86('0x51')]=qs[_0x4e86('0x52')](_[_0x4e86('0x70')](_0x136640[_0x4e86('0x49')],_0x48fcb8['filters']));_0x536add[_0x4e86('0x51')][_0x4e86('0x67')]=_0xbc621b['id'];if(_0x136640[_0x4e86('0x49')][_0x4e86('0x54')]){_0x536add[_0x4e86('0x51')]=_[_0x4e86('0x53')](_0x536add[_0x4e86('0x51')],{'$or':_['map'](_0x536add[_0x4e86('0x4b')],function(_0x19503a){var _0xbf8e48={};_0xbf8e48[_0x19503a]={'$like':'%'+_0x136640[_0x4e86('0x49')][_0x4e86('0x54')]+'%'};return _0xbf8e48;})});}_0x536add=_['merge']({},_0x536add,_0x136640[_0x4e86('0x55')]);return db[_0x4e86('0x6e')]['count']({'where':_0x536add[_0x4e86('0x51')]})[_0x4e86('0x39')](function(_0xd1ee6e){_0x598fd5[_0x4e86('0x31')]=_0xd1ee6e;if(_0x136640['query'][_0x4e86('0x56')]){_0x536add[_0x4e86('0x57')]=[{'all':!![]}];}return db[_0x4e86('0x6e')][_0x4e86('0x6b')](_0x536add);})[_0x4e86('0x39')](function(_0x10f964){_0x598fd5['rows']=_0x10f964;return _0x598fd5;});}})[_0x4e86('0x39')](respondWithFilteredResult(_0x2dda74,_0x536add))[_0x4e86('0x2a')](handleError(_0x2dda74,null));};exports[_0x4e86('0x71')]=function(_0x4f110d,_0x52138d,_0x4fb90c){return db[_0x4e86('0x42')]['find']({'where':{'id':_0x4f110d[_0x4e86('0x65')]['id']}})['then'](handleEntityNotFound(_0x52138d,null))[_0x4e86('0x39')](function(_0x3fe738){if(_0x3fe738){return _0x3fe738[_0x4e86('0x71')](_0x4f110d['query'][_0x4e86('0x6d')]);}})[_0x4e86('0x39')](respondWithStatusCode(_0x52138d,null))[_0x4e86('0x2a')](handleError(_0x52138d,null));};exports[_0x4e86('0x72')]=function(_0x4e7fa0,_0x44fc44,_0x216959){var _0x143dad={'body':_0x4e7fa0[_0x4e86('0x5e')],'channel':_0x4e86('0x73')};var _0x440e8f=[];var _0x5edb6f=[];var _0xba1990={};var _0x5f57ea=![];return db[_0x4e86('0x74')][_0x4e86('0x66')]()[_0x4e86('0x39')](function(_0xb6b692){if(!_0xb6b692){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x440e8f=_['difference'](_[_0x4e86('0x48')](_0xb6b692),[_0x4e86('0x75'),_0x4e86('0x76')]);_0x5edb6f=_[_0x4e86('0x77')](_['keys'](_0xb6b692),[_0x4e86('0x75'),'updatedAt',_0x4e86('0x78'),'ListId']);if(_0x4e7fa0[_0x4e86('0x5e')]['id']){delete _0x4e7fa0[_0x4e86('0x5e')]['id'];}if(_[_0x4e86('0x79')](_0x4e7fa0[_0x4e86('0x5e')][_0x4e86('0x7a')])){throw new db[(_0x4e86('0x7b'))][(_0x4e86('0x7c'))](_0x4e86('0x7d'));}if(_['isNil'](_0x4e7fa0[_0x4e86('0x5e')][_0x4e86('0x5e')])||_0x4e7fa0['body']['body']===''){throw new db[(_0x4e86('0x7b'))][(_0x4e86('0x7c'))](_0x4e86('0x7e'));}if(_[_0x4e86('0x79')](_0x4e7fa0[_0x4e86('0x5e')][_0x4e86('0x7f')])){throw new db['Sequelize']['ValidationError'](_0x4e86('0x80')+_0x5edb6f);}if(!_[_0x4e86('0x81')](_0x5edb6f,_0x4e7fa0[_0x4e86('0x5e')]['mapKey'])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5edb6f);}_0xba1990[_0x4e7fa0[_0x4e86('0x5e')]['mapKey']]=_0x4e7fa0[_0x4e86('0x5e')][_0x4e86('0x7a')];})[_0x4e86('0x39')](function(){return db[_0x4e86('0x42')][_0x4e86('0x5c')]({'where':{'id':_0x4e7fa0['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x4e86('0x74')],'as':_0x4e86('0x82'),'where':_0xba1990,'limit':0x1,'order':[[_0x4e86('0x76'),_0x4e86('0x83')]]}]},{'model':db[_0x4e86('0x84')],'as':_0x4e86('0x85')}]});})[_0x4e86('0x39')](handleEntityNotFound(_0x44fc44,null))[_0x4e86('0x39')](function(_0xb412e4){if(_0xb412e4&&_0xb412e4[_0x4e86('0x86')]){_0x143dad[_0x4e86('0x87')]=_0xb412e4;_0x143dad[_0x4e86('0x88')]=_0xb412e4['Applications'];_0x143dad[_0x4e86('0x89')]=_0xb412e4[_0x4e86('0x86')];_0x143dad[_0x4e86('0x88')]=_['orderBy'](_0x143dad['applications'],[_0x4e86('0x8a')],[_0x4e86('0x8b')]);if(_0x143dad[_0x4e86('0x87')][_0x4e86('0x85')]){delete _0x143dad[_0x4e86('0x87')][_0x4e86('0x85')];}if(_0x143dad['account']['List']&&_0x143dad['account'][_0x4e86('0x86')][_0x4e86('0x82')][_0x4e86('0x5b')]){return _0x143dad[_0x4e86('0x87')][_0x4e86('0x86')][_0x4e86('0x82')][0x0];}var _0x2812d2=_[_0x4e86('0x8c')](_0x4e7fa0[_0x4e86('0x5e')],{'firstName':_0x4e7fa0[_0x4e86('0x5e')][_0x4e86('0x7a')],'ListId':_0xb412e4[_0x4e86('0x8d')]});_0x2812d2[_0x4e7fa0['body'][_0x4e86('0x7f')]]=_0x4e7fa0[_0x4e86('0x5e')]['from'];return db[_0x4e86('0x74')][_0x4e86('0x5d')](_0x2812d2,{'fields':_0x440e8f,'raw':!![]});}})[_0x4e86('0x39')](handleEntityNotFound(_0x44fc44,null))[_0x4e86('0x39')](function(_0x5d06f3){_0x143dad[_0x4e86('0x8e')]=_0x5d06f3;if(_0x5d06f3){var _0x5396ab={'ContactId':_0x5d06f3['id'],'OpenchannelAccountId':_0x4e7fa0[_0x4e86('0x65')]['id'],'from':(_0x5d06f3[_0x4e86('0x8f')]||'')+'\x20'+(_0x5d06f3[_0x4e86('0x90')]||'')};var _0x106a90={'OpenchannelAccountId':_0x4e7fa0[_0x4e86('0x65')]['id'],'closed':![]};if(_0x4e7fa0['body'][_0x4e86('0x91')]){_0x106a90[_0x4e86('0x91')]=_0x4e7fa0[_0x4e86('0x5e')][_0x4e86('0x91')];return db['OpenchannelInteraction']['find']({'where':_0x106a90})[_0x4e86('0x39')](function(_0x3593bf){if(_0x3593bf){return[_0x3593bf,![]];}_0x5396ab['threadId']=_0x4e7fa0['body'][_0x4e86('0x91')];_0x5396ab[_0x4e86('0x92')]=_0x4e7fa0[_0x4e86('0x5e')]['externalUrl'];return db[_0x4e86('0x93')][_0x4e86('0x5d')](_0x5396ab)[_0x4e86('0x39')](function(_0x16a25e){return[_0x16a25e,!![]];});});}else{_0x106a90['threadId']=null;}_0x106a90[_0x4e86('0x94')]=_0x5d06f3['id'];return db[_0x4e86('0x93')]['find']({'where':_0x106a90})['then'](function(_0x23b37b){if(_0x23b37b){return[_0x23b37b,![]];}return db[_0x4e86('0x93')][_0x4e86('0x5d')](_0x5396ab)[_0x4e86('0x39')](function(_0x188408){return[_0x188408,!![]];});});}})[_0x4e86('0x95')](function(_0x5ea112,_0x6645aa){if(_0x5ea112){_0x5f57ea=_0x6645aa;if(!_0x6645aa){var _0x10dc89={'from':(_0x143dad[_0x4e86('0x8e')][_0x4e86('0x8f')]||'')+'\x20'+(_0x143dad[_0x4e86('0x8e')][_0x4e86('0x90')]||'')};if(_0x4e7fa0[_0x4e86('0x5e')][_0x4e86('0x91')]&&_0x4e7fa0[_0x4e86('0x5e')][_0x4e86('0x96')]&&_0x4e7fa0[_0x4e86('0x5e')][_0x4e86('0x91')]!=_0x4e7fa0[_0x4e86('0x5e')][_0x4e86('0x96')]){_0x10dc89[_0x4e86('0x91')]=_0x4e7fa0[_0x4e86('0x5e')][_0x4e86('0x96')];}return _0x5ea112[_0x4e86('0x37')](_0x10dc89);}else{return _0x5ea112;}}})[_0x4e86('0x39')](function(_0x1dc21c){_0x143dad[_0x4e86('0x97')]=_0x1dc21c['get']({'plain':!![]});_0x143dad[_0x4e86('0x97')][_0x4e86('0x98')]=_0x5f57ea;if(_0x143dad['interaction'][_0x4e86('0x98')]){if(_0x143dad[_0x4e86('0x87')][_0x4e86('0x99')]){_0x143dad[_0x4e86('0x88')][_0x4e86('0x9a')]({'id':0x0,'priority':_0x143dad['applications'][_0x4e86('0x5b')]+0x1,'app':_0x4e86('0x9b'),'appdata':_0x4e86('0x9c'),'interval':_0x4e86('0x9d')});}}return db[_0x4e86('0x9e')][_0x4e86('0x5d')]({'body':_0x4e7fa0['body'][_0x4e86('0x5e')],'OpenchannelAccountId':_0x4e7fa0[_0x4e86('0x65')]['id'],'OpenchannelInteractionId':_0x1dc21c['id'],'direction':'in','ContactId':_0x143dad[_0x4e86('0x8e')]['id'],'AttachmentId':_0x4e7fa0[_0x4e86('0x5e')][_0x4e86('0x9f')]});})[_0x4e86('0x39')](function(_0x5bc912){_0x143dad[_0x4e86('0x26')]=_0x5bc912;if(!_0x143dad['interaction'][_0x4e86('0xa0')])return;return db[_0x4e86('0xa1')][_0x4e86('0x5c')]({'attributes':['id',_0x4e86('0x3e')],'where':{'id':_0x143dad[_0x4e86('0x97')][_0x4e86('0xa0')]}});})[_0x4e86('0x39')](function(_0x4535b9){if(_0x4535b9){_0x143dad[_0x4e86('0x88')][_0x4e86('0xa2')]({'id':0x0,'priority':0x0,'app':_0x4e86('0xa3'),'appdata':_0x4535b9[_0x4e86('0x3e')]+','+(_0x143dad['account'][_0x4e86('0xa4')]||0xa),'interval':_0x4e86('0x9d')});}if(!_0x143dad['interaction']['queueId'])return;return db[_0x4e86('0xa5')][_0x4e86('0x5c')]({'attributes':['id','name'],'where':{'id':_0x143dad[_0x4e86('0x97')][_0x4e86('0xa6')]}});})[_0x4e86('0x39')](function(_0x31791e){if(_0x31791e){_0x143dad[_0x4e86('0x88')][_0x4e86('0xa2')]({'id':0x0,'priority':0x1,'app':_0x4e86('0xa7'),'appdata':_0x31791e['name']+','+(_0x143dad[_0x4e86('0x87')]['waitForTheAssignedQueue']||0x12c),'interval':_0x4e86('0x9d')});}return respondWithRpcPromise(_0x4e86('0xa8'),'startRouting',_0x143dad);})[_0x4e86('0x39')](function(_0x30073f){respondWithRpcPromise('EventManager','EventManager',{'event':_0x4e86('0x72'),'message':_0x30073f},client9002);return _0x30073f;})[_0x4e86('0x39')](respondWithResult(_0x44fc44,null))[_0x4e86('0x2a')](handleError(_0x44fc44,null));};exports['addApplications']=function(_0x264549,_0x4d6206){var _0x247b51=_0x264549['params']['id'];var _0x51d7b7=_0x264549[_0x4e86('0x5e')];var _0x37d50d=0xc8;var _0x5eed48=null;return db[_0x4e86('0xa9')]['transaction']({'isolationLevel':db[_0x4e86('0xa9')][_0x4e86('0xaa')]['ISOLATION_LEVELS'][_0x4e86('0xab')]},function(_0x4183c1){return db[_0x4e86('0x42')][_0x4e86('0x6a')]({'where':{'id':_0x247b51},'transaction':_0x4183c1})[_0x4e86('0x39')](function(_0x1ec902){if(_0x1ec902){return db[_0x4e86('0x84')]['destroy']({'where':{'OpenchannelAccountId':_0x247b51},'transaction':_0x4183c1})[_0x4e86('0x39')](function(){var _0x1871b9=_[_0x4e86('0x41')](_0x51d7b7,function(_0x1e5fe6){_0x1e5fe6[_0x4e86('0x67')]=_0x247b51;return _0x1e5fe6;});return db[_0x4e86('0x84')]['bulkCreate'](_0x1871b9,{'transaction':_0x4183c1});});}else{_0x37d50d=0x194;_0x5eed48=[];}});})[_0x4e86('0x39')](function(){if(_0x37d50d!==0x194){return db[_0x4e86('0x84')][_0x4e86('0xac')]({'where':{'OpenchannelAccountId':_0x247b51},'order':'priority'})[_0x4e86('0x39')](function(_0x5291e7){_0x5eed48=_0x5291e7;});}})['catch'](function(_0x578028){_0x37d50d=0x1f4;logger[_0x4e86('0x24')](_0x578028[_0x4e86('0x3d')]);if(_0x578028[_0x4e86('0x3e')]){delete _0x578028[_0x4e86('0x3e')];}_0x5eed48=_0x578028;})[_0x4e86('0xad')](function(){if(_0x5eed48===null){_0x4d6206[_0x4e86('0x2b')](_0x37d50d);}else{if(_0x37d50d===0x1f4){_0x4d6206['status'](_0x37d50d)[_0x4e86('0xae')](_0x5eed48);}else{_0x4d6206[_0x4e86('0x2c')](_0x37d50d)['json'](_0x5eed48);}}});};exports[_0x4e86('0xaf')]=function(_0x466e23,_0x3edc6c,_0x331168){var _0x1e4da8={};var _0x334fcf={};var _0x5d2d23;var _0x1f44c3;return db[_0x4e86('0x42')][_0x4e86('0x6a')]({'where':{'id':_0x466e23['params']['id']}})[_0x4e86('0x39')](handleEntityNotFound(_0x3edc6c,null))['then'](function(_0x490713){if(_0x490713){_0x5d2d23=_0x490713;_0x334fcf[_0x4e86('0x47')]=_[_0x4e86('0x48')](db[_0x4e86('0x84')][_0x4e86('0x43')]);_0x334fcf[_0x4e86('0x49')]=_[_0x4e86('0x48')](_0x466e23[_0x4e86('0x49')]);_0x334fcf[_0x4e86('0x52')]=_['intersection'](_0x334fcf['model'],_0x334fcf[_0x4e86('0x49')]);_0x1e4da8['attributes']=_[_0x4e86('0x4a')](_0x334fcf[_0x4e86('0x47')],qs[_0x4e86('0x4c')](_0x466e23[_0x4e86('0x49')]['fields']));_0x1e4da8[_0x4e86('0x4b')]=_0x1e4da8[_0x4e86('0x4b')][_0x4e86('0x5b')]?_0x1e4da8['attributes']:_0x334fcf[_0x4e86('0x47')];_0x1e4da8[_0x4e86('0x4f')]=qs[_0x4e86('0x50')](_0x466e23[_0x4e86('0x49')][_0x4e86('0x50')]);_0x1e4da8['where']=qs[_0x4e86('0x52')](_[_0x4e86('0x70')](_0x466e23['query'],_0x334fcf[_0x4e86('0x52')]));if(_0x466e23['query'][_0x4e86('0x54')]){_0x1e4da8[_0x4e86('0x51')]=_[_0x4e86('0x53')](_0x1e4da8[_0x4e86('0x51')],{'$or':_['map'](_0x1e4da8[_0x4e86('0x4b')],function(_0x4c9540){var _0x452ad3={};_0x452ad3[_0x4c9540]={'$like':'%'+_0x466e23['query'][_0x4e86('0x54')]+'%'};return _0x452ad3;})});}_0x1e4da8=_['merge']({},_0x1e4da8,_0x466e23[_0x4e86('0x55')]);return _0x5d2d23[_0x4e86('0xaf')](_0x1e4da8);}})[_0x4e86('0x39')](function(_0x52228f){if(_0x52228f){_0x1f44c3=_0x52228f[_0x4e86('0x5b')];if(!_0x466e23[_0x4e86('0x49')][_0x4e86('0x4d')](_0x4e86('0x4e'))){_0x1e4da8[_0x4e86('0x30')]=qs[_0x4e86('0x30')](_0x466e23[_0x4e86('0x49')][_0x4e86('0x30')]);_0x1e4da8[_0x4e86('0x2e')]=qs['offset'](_0x466e23['query'][_0x4e86('0x2e')]);}return _0x5d2d23[_0x4e86('0xaf')](_0x1e4da8);}})[_0x4e86('0x39')](function(_0x4d2bfe){if(_0x4d2bfe){return _0x4d2bfe?{'count':_0x1f44c3,'rows':_0x4d2bfe}:null;}})[_0x4e86('0x39')](respondWithResult(_0x3edc6c,null))[_0x4e86('0x2a')](handleError(_0x3edc6c,null));};exports[_0x4e86('0xb0')]=function(_0xb83cb5,_0x272bd2,_0x2438c8){var _0x1f9a42={'raw':![],'where':{}};var _0x4a42b0={};var _0x42f453={'count':0x0,'rows':[]};return db[_0x4e86('0x42')][_0x4e86('0x6a')]({'where':{'id':_0xb83cb5[_0x4e86('0x65')]['id']}})[_0x4e86('0x39')](handleEntityNotFound(_0x272bd2,null))[_0x4e86('0x39')](function(_0x50d2fa){if(_0x50d2fa){_0x4a42b0[_0x4e86('0x47')]=_[_0x4e86('0x48')](db[_0x4e86('0x93')][_0x4e86('0x43')]);_0x4a42b0['query']=_[_0x4e86('0x48')](_0xb83cb5[_0x4e86('0x49')]);_0x4a42b0['filters']=_[_0x4e86('0x4a')](_0x4a42b0['model'],_0x4a42b0[_0x4e86('0x49')]);_0x1f9a42[_0x4e86('0x4b')]=_[_0x4e86('0x4a')](_0x4a42b0['model'],qs['fields'](_0xb83cb5['query'][_0x4e86('0x4c')]));_0x1f9a42[_0x4e86('0x4b')]=_0x1f9a42['attributes'][_0x4e86('0x5b')]?_0x1f9a42[_0x4e86('0x4b')]:_0x4a42b0[_0x4e86('0x47')];if(!_0xb83cb5[_0x4e86('0x49')]['hasOwnProperty'](_0x4e86('0x4e'))){_0x1f9a42[_0x4e86('0x30')]=qs[_0x4e86('0x30')](_0xb83cb5[_0x4e86('0x49')]['limit']);_0x1f9a42['offset']=qs[_0x4e86('0x2e')](_0xb83cb5[_0x4e86('0x49')][_0x4e86('0x2e')]);}_0x1f9a42[_0x4e86('0x4f')]=qs['sort'](_0xb83cb5[_0x4e86('0x49')][_0x4e86('0x50')]);_0x1f9a42['where']=qs['filters'](_[_0x4e86('0x70')](_0xb83cb5[_0x4e86('0x49')],_0x4a42b0[_0x4e86('0x52')]));_0x1f9a42['where'][_0x4e86('0x67')]=_0x50d2fa['id'];if(_0xb83cb5[_0x4e86('0x49')][_0x4e86('0x54')]){_0x1f9a42[_0x4e86('0x51')]=_['merge'](_0x1f9a42[_0x4e86('0x51')],{'$or':_['map'](_0x1f9a42[_0x4e86('0x4b')],function(_0x5d3d01){var _0x4e94cc={};_0x4e94cc[_0x5d3d01]={'$like':'%'+_0xb83cb5[_0x4e86('0x49')][_0x4e86('0x54')]+'%'};return _0x4e94cc;})});}_0x1f9a42=_[_0x4e86('0x53')]({},_0x1f9a42,_0xb83cb5[_0x4e86('0x55')]);return db[_0x4e86('0x93')][_0x4e86('0x31')]({'where':_0x1f9a42[_0x4e86('0x51')]})[_0x4e86('0x39')](function(_0x80e38a){_0x42f453['count']=_0x80e38a;if(_0xb83cb5[_0x4e86('0x49')][_0x4e86('0x56')]){_0x1f9a42[_0x4e86('0x57')]=[{'model':db[_0x4e86('0x74')],'as':_0x4e86('0xb1'),'required':![]},{'model':db['User'],'as':_0x4e86('0xb2'),'attributes':[_0x4e86('0x3e'),_0x4e86('0xb3'),_0x4e86('0xb4')],'required':![]},{'model':db[_0x4e86('0xb5')],'as':'Tags','attributes':['id',_0x4e86('0x3e'),_0x4e86('0xb6')],'where':_0xb83cb5[_0x4e86('0x49')][_0x4e86('0xb7')]?{'id':_0xb83cb5[_0x4e86('0x49')][_0x4e86('0xb7')]}:undefined,'required':_0xb83cb5[_0x4e86('0x49')][_0x4e86('0xb7')]?!![]:![]}];}return db[_0x4e86('0x93')][_0x4e86('0x6b')](_0x1f9a42);})[_0x4e86('0x39')](function(_0x3f13fc){_0x42f453[_0x4e86('0x58')]=_0x3f13fc;return _0x42f453;});}})['then'](respondWithFilteredResult(_0x272bd2,_0x1f9a42))['catch'](handleError(_0x272bd2,null));};exports[_0x4e86('0xb8')]=function(_0x1343bd,_0x305e2e,_0x3e3745){return db[_0x4e86('0x42')][_0x4e86('0x5c')]({'where':{'id':_0x1343bd[_0x4e86('0x65')]['id']}})[_0x4e86('0x39')](handleEntityNotFound(_0x305e2e,null))['then'](function(_0x3f4390){if(_0x3f4390){return _0x3f4390['addAgents'](_0x1343bd[_0x4e86('0x5e')]['ids'],_[_0x4e86('0xb9')](_0x1343bd['body'],['ids','id'])||{})['spread'](function(_0x5192a8){for(var _0x26889e=0x0;_0x26889e<_0x1343bd[_0x4e86('0x5e')][_0x4e86('0x6d')][_0x4e86('0x5b')];_0x26889e+=0x1){socket['emit'](_0x4e86('0xba'),{'UserId':Number(_0x1343bd[_0x4e86('0x5e')][_0x4e86('0x6d')][_0x26889e]),'OpenchannelAccountId':Number(_0x1343bd['params']['id'])});}return _0x5192a8;});}})['then'](respondWithResult(_0x305e2e,null))[_0x4e86('0x2a')](handleError(_0x305e2e,null));};exports[_0x4e86('0xbb')]=function(_0x59b742,_0x38d7b7,_0x37f0e2){return db['OpenchannelAccount'][_0x4e86('0x5c')]({'where':{'id':_0x59b742[_0x4e86('0x65')]['id']}})[_0x4e86('0x39')](handleEntityNotFound(_0x38d7b7,null))[_0x4e86('0x39')](function(_0x2b7acd){if(_0x2b7acd){return _0x2b7acd[_0x4e86('0xbb')](_0x59b742[_0x4e86('0x49')][_0x4e86('0x6d')])[_0x4e86('0x39')](function(){if(_[_0x4e86('0xbc')](_0x59b742[_0x4e86('0x49')]['ids'])){for(var _0xabdfd8=0x0;_0xabdfd8<_0x59b742[_0x4e86('0x49')][_0x4e86('0x6d')][_0x4e86('0x5b')];_0xabdfd8+=0x1){socket[_0x4e86('0xbd')](_0x4e86('0xbe'),{'UserId':Number(_0x59b742[_0x4e86('0x49')][_0x4e86('0x6d')][_0xabdfd8]),'OpenchannelAccountId':Number(_0x59b742[_0x4e86('0x65')]['id'])});}}else{socket[_0x4e86('0xbd')]('userOpenchannelAccount:remove',{'UserId':Number(_0x59b742['query'][_0x4e86('0x6d')]),'OpenchannelAccountId':Number(_0x59b742[_0x4e86('0x65')]['id'])});}});}})[_0x4e86('0x39')](respondWithStatusCode(_0x38d7b7,null))[_0x4e86('0x2a')](handleError(_0x38d7b7,null));};exports[_0x4e86('0xbf')]=function(_0x59a6c7,_0x58ae84,_0x34f538){var _0x11db36={};var _0x52b8cf={};var _0x53a300;var _0xf119ed;return db[_0x4e86('0x42')][_0x4e86('0x6a')]({'where':{'id':_0x59a6c7[_0x4e86('0x65')]['id']}})[_0x4e86('0x39')](handleEntityNotFound(_0x58ae84,null))['then'](function(_0x2d463b){if(_0x2d463b){_0x53a300=_0x2d463b;_0x52b8cf['model']=_[_0x4e86('0x48')](db['User']['rawAttributes']);_0x52b8cf['query']=_[_0x4e86('0x48')](_0x59a6c7['query']);_0x52b8cf[_0x4e86('0x52')]=_['intersection'](_0x52b8cf[_0x4e86('0x47')],_0x52b8cf[_0x4e86('0x49')]);_0x11db36['attributes']=_[_0x4e86('0x4a')](_0x52b8cf['model'],qs[_0x4e86('0x4c')](_0x59a6c7['query'][_0x4e86('0x4c')]));_0x11db36['attributes']=_0x11db36[_0x4e86('0x4b')][_0x4e86('0x5b')]?_0x11db36[_0x4e86('0x4b')]:_0x52b8cf[_0x4e86('0x47')];_0x11db36[_0x4e86('0x4f')]=qs[_0x4e86('0x50')](_0x59a6c7[_0x4e86('0x49')][_0x4e86('0x50')]);_0x11db36[_0x4e86('0x51')]=qs[_0x4e86('0x52')](_[_0x4e86('0x70')](_0x59a6c7[_0x4e86('0x49')],_0x52b8cf[_0x4e86('0x52')]));if(_0x59a6c7[_0x4e86('0x49')][_0x4e86('0x54')]){_0x11db36[_0x4e86('0x51')]=_[_0x4e86('0x53')](_0x11db36[_0x4e86('0x51')],{'$or':_[_0x4e86('0x41')](_0x11db36[_0x4e86('0x4b')],function(_0x28146e){var _0x24dab3={};_0x24dab3[_0x28146e]={'$like':'%'+_0x59a6c7[_0x4e86('0x49')][_0x4e86('0x54')]+'%'};return _0x24dab3;})});}_0x11db36=_['merge']({},_0x11db36,_0x59a6c7[_0x4e86('0x55')]);return _0x53a300[_0x4e86('0xbf')](_0x11db36);}})[_0x4e86('0x39')](function(_0x132d5e){if(_0x132d5e){_0xf119ed=_0x132d5e[_0x4e86('0x5b')];if(!_0x59a6c7[_0x4e86('0x49')]['hasOwnProperty']('nolimit')){_0x11db36[_0x4e86('0x30')]=qs[_0x4e86('0x30')](_0x59a6c7[_0x4e86('0x49')]['limit']);_0x11db36['offset']=qs[_0x4e86('0x2e')](_0x59a6c7[_0x4e86('0x49')]['offset']);}return _0x53a300[_0x4e86('0xbf')](_0x11db36);}})['then'](function(_0x591eb2){if(_0x591eb2){return _0x591eb2?{'count':_0xf119ed,'rows':_0x591eb2}:null;}})[_0x4e86('0x39')](respondWithResult(_0x58ae84,null))[_0x4e86('0x2a')](handleError(_0x58ae84,null));};exports[_0x4e86('0xae')]=function(_0x1eeb0e,_0x2592f6,_0x267405){var _0x442f02,_0x54a282,_0x57fdae;if(_[_0x4e86('0x79')](_0x1eeb0e['body'][_0x4e86('0x5e')])||_0x1eeb0e[_0x4e86('0x5e')][_0x4e86('0x5e')]===''){throw new db['Sequelize'][(_0x4e86('0x7c'))](_0x4e86('0x7e'));}if(_[_0x4e86('0x79')](_0x1eeb0e['body']['to'])){}_0x442f02=_0x1eeb0e[_0x4e86('0x5e')]['to'];return db['OpenchannelAccount'][_0x4e86('0x6a')]({'where':{'id':_0x1eeb0e['params']['id']}})[_0x4e86('0x39')](handleEntityNotFound(_0x2592f6,null))[_0x4e86('0x39')](function(_0x408ee5){if(_0x408ee5){return db[_0x4e86('0x42')][_0x4e86('0x5c')]({'where':{'id':_0x408ee5['id']},'include':[{'model':db['CmList'],'as':_0x4e86('0x86'),'include':[{'model':db[_0x4e86('0x74')],'as':_0x4e86('0x82'),'where':{[_0x408ee5[_0x4e86('0x7f')]]:_0x442f02},'limit':0x1,'order':[['updatedAt',_0x4e86('0x83')]]}]}]})[_0x4e86('0x39')](handleEntityNotFound(_0x2592f6,null))[_0x4e86('0x39')](function(_0x190153){if(_0x190153&&_0x190153[_0x4e86('0x86')]){_0x54a282=_0x190153[_0x4e86('0x3a')]({'plain':!![]});if(_0x54a282['List']&&_0x54a282[_0x4e86('0x86')]['Contacts'][_0x4e86('0x5b')]){return _0x54a282['List']['Contacts'][0x0];}return db['CmContact'][_0x4e86('0x5d')](_['defaults'](_0x1eeb0e[_0x4e86('0x5e')],{'firstName':_0x442f02,[_0x190153[_0x4e86('0x7f')]]:_0x442f02,'phone':_0x442f02,'ListId':_0x54a282[_0x4e86('0x8d')]}));}})[_0x4e86('0x39')](handleEntityNotFound(_0x2592f6,null))[_0x4e86('0x39')](function(_0x3750e){if(_0x3750e){_0x57fdae=_0x3750e;return db['OpenchannelInteraction'][_0x4e86('0x5c')]({'where':{'ContactId':_0x57fdae['id'],'closed':![],'OpenchannelAccountId':_0x54a282['id']}})[_0x4e86('0x39')](function(_0x296bc0){if(_0x296bc0){return[_0x296bc0,![]];}return db['OpenchannelInteraction'][_0x4e86('0x5d')]({'UserId':_0x1eeb0e['user']['id'],'ContactId':_0x57fdae['id'],'OpenchannelAccountId':_0x54a282['id'],'lastMsgDirection':_0x4e86('0xc0'),'firstMsgDirection':_0x4e86('0xc0'),'Messages':[_[_0x4e86('0x53')](_0x1eeb0e[_0x4e86('0x5e')],{'read':![],'body':_0x1eeb0e[_0x4e86('0x5e')][_0x4e86('0x5e')],'OpenchannelAccountId':_0x54a282['id'],'UserId':_0x1eeb0e[_0x4e86('0x5f')]['id'],'ContactId':_0x57fdae['id']})]},{'include':[{'model':db[_0x4e86('0x9e')],'as':_0x4e86('0xc1')}]})['then'](function(_0x1fe947){return[_0x1fe947,!![]];});});}})[_0x4e86('0x95')](function(_0xcb9fcf,_0x29bae9){if(_0x29bae9){return _0xcb9fcf;}return db[_0x4e86('0x9e')][_0x4e86('0x5d')](_[_0x4e86('0x53')](_0x1eeb0e[_0x4e86('0x5e')],{'read':![],'body':_0x1eeb0e[_0x4e86('0x5e')]['body'],'OpenchannelAccountId':_0x54a282['id'],'OpenchannelInteractionId':_0xcb9fcf['id'],'UserId':_0x1eeb0e[_0x4e86('0x5f')]['id'],'ContactId':_0x57fdae['id']}))[_0x4e86('0x39')](function(_0xe8215a){_0xcb9fcf[_0x4e86('0xc2')][_0x4e86('0xc1')]=[];_0xcb9fcf[_0x4e86('0xc2')][_0x4e86('0xc1')][_0x4e86('0x9a')](_0xe8215a['dataValues']);return _0xcb9fcf;});});}})['then'](respondWithResult(_0x2592f6,null))[_0x4e86('0x2a')](handleError(_0x2592f6,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 40ce8f3..8b790b5 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 _0xaa88=['../../mysqldb','OpenchannelAccount','setMaxListeners','update','remove','hasOwnProperty','exports','events'];(function(_0x4b5f93,_0x143032){var _0x224ca1=function(_0x42073a){while(--_0x42073a){_0x4b5f93['push'](_0x4b5f93['shift']());}};_0x224ca1(++_0x143032);}(_0xaa88,0x137));var _0x8aa8=function(_0x132d12,_0x2c9799){_0x132d12=_0x132d12-0x0;var _0x1c3163=_0xaa88[_0x132d12];return _0x1c3163;};'use strict';var EventEmitter=require(_0x8aa8('0x0'));var OpenchannelAccount=require(_0x8aa8('0x1'))['db'][_0x8aa8('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x8aa8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8aa8('0x4'),'afterDestroy':_0x8aa8('0x5')};function emitEvent(_0x43f7e4){return function(_0x3b2c88,_0x3e3b70,_0x350e8b){OpenchannelAccountEvents['emit'](_0x43f7e4+':'+_0x3b2c88['id'],_0x3b2c88);OpenchannelAccountEvents['emit'](_0x43f7e4,_0x3b2c88);_0x350e8b(null);};}for(var e in events){if(events[_0x8aa8('0x6')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x8aa8('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xdace=['save','remove','emit','hasOwnProperty','exports','events','OpenchannelAccount','setMaxListeners'];(function(_0x1261c2,_0x3ef819){var _0x3aabd2=function(_0x425d76){while(--_0x425d76){_0x1261c2['push'](_0x1261c2['shift']());}};_0x3aabd2(++_0x3ef819);}(_0xdace,0xc5));var _0xedac=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xdace[_0x2a6809];return _0x11c371;};'use strict';var EventEmitter=require(_0xedac('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0xedac('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xedac('0x2')](0x0);var events={'afterCreate':_0xedac('0x3'),'afterUpdate':'update','afterDestroy':_0xedac('0x4')};function emitEvent(_0x36bcd2){return function(_0x15d3bd,_0xefb142,_0x5a97c0){OpenchannelAccountEvents[_0xedac('0x5')](_0x36bcd2+':'+_0x15d3bd['id'],_0x15d3bd);OpenchannelAccountEvents[_0xedac('0x5')](_0x36bcd2,_0x15d3bd);_0x5a97c0(null);};}for(var e in events){if(events[_0xedac('0x6')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0xedac('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 1381d1c..0dca85f 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(_0x1e5ffe,_0xc3511c){var _0x111793=function(_0x37f425){while(--_0x37f425){_0x1e5ffe['push'](_0x1e5ffe['shift']());}};_0x111793(++_0xc3511c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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(_0x30b9d3,_0xbd1e14){var _0x465479=function(_0x4342bf){while(--_0x4342bf){_0x30b9d3['push'](_0x30b9d3['shift']());}};_0x465479(++_0xbd1e14);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 5029400..828f56e 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 _0x3495=['../../config/logger','../../config/environment','jayson/promise','http','defaults','localhost','redis','./openchannelAccount.socket','register','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x57ee8c,_0xe42849){var _0x3a2322=function(_0x5ea8b2){while(--_0x5ea8b2){_0x57ee8c['push'](_0x57ee8c['shift']());}};_0x3a2322(++_0xe42849);}(_0x3495,0x1de));var _0x5349=function(_0x2175db,_0x714350){_0x2175db=_0x2175db-0x0;var _0x4a9833=_0x3495[_0x2175db];return _0x4a9833;};'use strict';var _=require(_0x5349('0x0'));var util=require(_0x5349('0x1'));var moment=require(_0x5349('0x2'));var BPromise=require(_0x5349('0x3'));var rs=require(_0x5349('0x4'));var fs=require('fs');var Redis=require(_0x5349('0x5'));var db=require(_0x5349('0x6'))['db'];var utils=require(_0x5349('0x7'));var logger=require(_0x5349('0x8'))('rpc');var config=require(_0x5349('0x9'));var jayson=require(_0x5349('0xa'));var client=jayson['client'][_0x5349('0xb')]({'port':0x232a});config['redis']=_[_0x5349('0xc')](config['redis'],{'host':_0x5349('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5349('0xe')]));require(_0x5349('0xf'))[_0x5349('0x10')](socket);function respondWithRpcPromise(_0x23a1c7,_0x21bf91,_0x3a416e){return new BPromise(function(_0x35d425,_0x4bf160){return client[_0x5349('0x11')](_0x23a1c7,_0x3a416e)['then'](function(_0x2cbd83){logger[_0x5349('0x12')](_0x5349('0x13'),_0x21bf91,_0x5349('0x14'));logger[_0x5349('0x15')](_0x5349('0x16'),_0x21bf91,_0x5349('0x14'),JSON[_0x5349('0x17')](_0x2cbd83));if(_0x2cbd83[_0x5349('0x18')]){if(_0x2cbd83[_0x5349('0x18')]['code']===0x1f4){logger[_0x5349('0x18')](_0x5349('0x13'),_0x21bf91,_0x2cbd83['error'][_0x5349('0x19')]);return _0x4bf160(_0x2cbd83[_0x5349('0x18')][_0x5349('0x19')]);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x21bf91,_0x2cbd83['error'][_0x5349('0x19')]);return _0x35d425(_0x2cbd83['error'][_0x5349('0x19')]);}else{logger['info'](_0x5349('0x13'),_0x21bf91,_0x5349('0x14'));_0x35d425(_0x2cbd83[_0x5349('0x1a')][_0x5349('0x19')]);}})['catch'](function(_0x22d1ca){logger[_0x5349('0x18')](_0x5349('0x13'),_0x21bf91,_0x22d1ca);_0x4bf160(_0x22d1ca);});});} \ No newline at end of file +var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x26018a,_0x25471a){var _0x12679c=function(_0x1ecfe2){while(--_0x1ecfe2){_0x26018a['push'](_0x26018a['shift']());}};_0x12679c(++_0x25471a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5712f8,_0x17156b){_0x5712f8=_0x5712f8-0x0;var _0x14a364=_0xcb91[_0x5712f8];return _0x14a364;};'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});config[_0x1cb9('0x9')]=_['defaults'](config[_0x1cb9('0x9')],{'host':_0x1cb9('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1cb9('0x9')]));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x45a12f,_0x2fa15c,_0x74ce19){return new BPromise(function(_0x1f0eca,_0x2fc627){return client['request'](_0x45a12f,_0x74ce19)[_0x1cb9('0xb')](function(_0x44a6b4){logger[_0x1cb9('0xc')](_0x1cb9('0xd'),_0x2fa15c,_0x1cb9('0xe'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x2fa15c,'request\x20sent',JSON[_0x1cb9('0xf')](_0x44a6b4));if(_0x44a6b4[_0x1cb9('0x10')]){if(_0x44a6b4[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger['error'](_0x1cb9('0xd'),_0x2fa15c,_0x44a6b4[_0x1cb9('0x10')][_0x1cb9('0x12')]);return _0x2fc627(_0x44a6b4[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x2fa15c,_0x44a6b4[_0x1cb9('0x10')][_0x1cb9('0x12')]);return _0x1f0eca(_0x44a6b4[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xc')](_0x1cb9('0xd'),_0x2fa15c,_0x1cb9('0xe'));_0x1f0eca(_0x44a6b4['result']['message']);}})[_0x1cb9('0x13')](function(_0x41ac41){logger[_0x1cb9('0x10')](_0x1cb9('0xd'),_0x2fa15c,_0x41ac41);_0x2fc627(_0x41ac41);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 93ad1b5..9182c09 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 _0xcf1c=['openchannelAccount:','./openchannelAccount.events','save','update','removeListener','length'];(function(_0x1a839c,_0x3e2e50){var _0x53f722=function(_0x33be5d){while(--_0x33be5d){_0x1a839c['push'](_0x1a839c['shift']());}};_0x53f722(++_0x3e2e50);}(_0xcf1c,0x18d));var _0xccf1=function(_0x590ef7,_0x175f08){_0x590ef7=_0x590ef7-0x0;var _0x4c2634=_0xcf1c[_0x590ef7];return _0x4c2634;};'use strict';var OpenchannelAccountEvents=require(_0xccf1('0x0'));var events=[_0xccf1('0x1'),'remove',_0xccf1('0x2')];function createListener(_0x3b9acb,_0x1d0b09){return function(_0x2800a8){_0x1d0b09['emit'](_0x3b9acb,_0x2800a8);};}function removeListener(_0x5d3e85,_0x509c8d){return function(){OpenchannelAccountEvents[_0xccf1('0x3')](_0x5d3e85,_0x509c8d);};}exports['register']=function(_0x17e358){for(var _0x2ee316=0x0,_0x2c381f=events[_0xccf1('0x4')];_0x2ee316<_0x2c381f;_0x2ee316++){var _0x1ee241=events[_0x2ee316];var _0x12ca5d=createListener(_0xccf1('0x5')+_0x1ee241,_0x17e358);OpenchannelAccountEvents['on'](_0x1ee241,_0x12ca5d);}}; \ No newline at end of file +var _0x3fec=['length','openchannelAccount:','./openchannelAccount.events','update','register'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3fec,0x1ba));var _0xc3fe=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3fec[_0x14add3];return _0x4a174f;};'use strict';var OpenchannelAccountEvents=require(_0xc3fe('0x0'));var events=['save','remove',_0xc3fe('0x1')];function createListener(_0x1cd663,_0x5adb4c){return function(_0x3e2547){_0x5adb4c['emit'](_0x1cd663,_0x3e2547);};}function removeListener(_0x53a208,_0x1cdef8){return function(){OpenchannelAccountEvents['removeListener'](_0x53a208,_0x1cdef8);};}exports[_0xc3fe('0x2')]=function(_0x327d2f){for(var _0x22dd19=0x0,_0x1ae20f=events[_0xc3fe('0x3')];_0x22dd19<_0x1ae20f;_0x22dd19++){var _0x43a9a9=events[_0x22dd19];var _0x1e532e=createListener(_0xc3fe('0x4')+_0x43a9a9,_0x327d2f);OpenchannelAccountEvents['on'](_0x43a9a9,_0x1e532e);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index c7ae9b6..8fd7155 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 _0x3884=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','index','isAuthenticated','post','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x21e039,_0x3e9573){var _0x586aba=function(_0x5a8e0f){while(--_0x5a8e0f){_0x21e039['push'](_0x21e039['shift']());}};_0x586aba(++_0x3e9573);}(_0x3884,0x1c6));var _0x4388=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0x3884[_0x46f1a6];return _0x38429a;};'use strict';var multer=require(_0x4388('0x0'));var util=require(_0x4388('0x1'));var path=require(_0x4388('0x2'));var timeout=require(_0x4388('0x3'));var express=require(_0x4388('0x4'));var router=express[_0x4388('0x5')]();var fs_extra=require(_0x4388('0x6'));var auth=require(_0x4388('0x7'));var interaction=require(_0x4388('0x8'));var config=require(_0x4388('0x9'));var controller=require(_0x4388('0xa'));router[_0x4388('0xb')]('/',auth['isAuthenticated'](),controller[_0x4388('0xc')]);router[_0x4388('0xb')]('/:id',auth[_0x4388('0xd')](),controller['show']);router[_0x4388('0xe')]('/',auth[_0x4388('0xd')](),controller['create']);router[_0x4388('0xf')]('/:id',auth[_0x4388('0xd')](),controller['update']);router[_0x4388('0x10')](_0x4388('0x11'),auth['isAuthenticated'](),controller[_0x4388('0x12')]);module[_0x4388('0x13')]=router; \ No newline at end of file +var _0xe3c0=['connect-timeout','Router','../../components/interaction/service','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','create','update','destroy','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe3c0,0xa8));var _0x0e3c=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xe3c0[_0x2b7764];return _0x848dcb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0e3c('0x0'));var timeout=require(_0x0e3c('0x1'));var express=require('express');var router=express[_0x0e3c('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0e3c('0x3'));var config=require('../../config/environment');var controller=require(_0x0e3c('0x4'));router[_0x0e3c('0x5')]('/',auth[_0x0e3c('0x6')](),controller[_0x0e3c('0x7')]);router[_0x0e3c('0x5')](_0x0e3c('0x8'),auth['isAuthenticated'](),controller[_0x0e3c('0x9')]);router['post']('/',auth[_0x0e3c('0x6')](),controller[_0x0e3c('0xa')]);router['put'](_0x0e3c('0x8'),auth[_0x0e3c('0x6')](),controller[_0x0e3c('0xb')]);router['delete'](_0x0e3c('0x8'),auth[_0x0e3c('0x6')](),controller[_0x0e3c('0xc')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 9fd4551..ed37ce2 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 _0xa619=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x718d6d,_0xfeedba){var _0x35322f=function(_0x2c5646){while(--_0x2c5646){_0x718d6d['push'](_0x718d6d['shift']());}};_0x35322f(++_0xfeedba);}(_0xa619,0x1b2));var _0x9a61=function(_0x91342c,_0x1047c8){_0x91342c=_0x91342c-0x0;var _0x46446c=_0xa619[_0x91342c];return _0x46446c;};'use strict';var Sequelize=require(_0x9a61('0x0'));module[_0x9a61('0x1')]={'priority':{'type':Sequelize[_0x9a61('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9a61('0x3')],'allowNull':![],'defaultValue':_0x9a61('0x4')},'appdata':{'type':Sequelize[_0x9a61('0x5')]()},'description':{'type':Sequelize[_0x9a61('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x9a61('0x6')}}; \ No newline at end of file +var _0xa967=['sequelize','exports','STRING','*,*,*,*'];(function(_0x393436,_0x2100f4){var _0x1a54a4=function(_0x2318f3){while(--_0x2318f3){_0x393436['push'](_0x393436['shift']());}};_0x1a54a4(++_0x2100f4);}(_0xa967,0x1f4));var _0x7a96=function(_0x4520ac,_0x33a5dc){_0x4520ac=_0x4520ac-0x0;var _0xe6ae67=_0xa967[_0x4520ac];return _0xe6ae67;};'use strict';var Sequelize=require(_0x7a96('0x0'));module[_0x7a96('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x7a96('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x7a96('0x2')]},'interval':{'type':Sequelize[_0x7a96('0x2')],'defaultValue':_0x7a96('0x3')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 45ca35d..b371d49 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 _0xe7fb=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','sort','where','merge','VIRTUAL','filter','options','OpenchannelApplication','includeAll','include','rows','catch','show','params','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x383b68,_0x49ee8e){var _0x44afa4=function(_0x58d4f7){while(--_0x58d4f7){_0x383b68['push'](_0x383b68['shift']());}};_0x44afa4(++_0x49ee8e);}(_0xe7fb,0xc5));var _0xbe7f=function(_0x45f534,_0xa3fa9b){_0x45f534=_0x45f534-0x0;var _0x174592=_0xe7fb[_0x45f534];return _0x174592;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbe7f('0x0'));var zipdir=require(_0xbe7f('0x1'));var jsonpatch=require(_0xbe7f('0x2'));var rp=require(_0xbe7f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbe7f('0x4'));var util=require(_0xbe7f('0x5'));var path=require(_0xbe7f('0x6'));var sox=require('sox');var csv=require(_0xbe7f('0x7'));var ejs=require(_0xbe7f('0x8'));var fs=require('fs');var fs_extra=require(_0xbe7f('0x9'));var _=require('lodash');var squel=require(_0xbe7f('0xa'));var crypto=require(_0xbe7f('0xb'));var jsforce=require(_0xbe7f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xbe7f('0x7'));var querystring=require(_0xbe7f('0xd'));var Papa=require(_0xbe7f('0xe'));var Redis=require(_0xbe7f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xbe7f('0x10'));var as=require(_0xbe7f('0x11'));var hardwareService=require(_0xbe7f('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xbe7f('0x13'));var config=require(_0xbe7f('0x14'));var licenseUtil=require(_0xbe7f('0x15'));var db=require(_0xbe7f('0x16'))['db'];function respondWithStatusCode(_0x44946a,_0x22bdd5){_0x22bdd5=_0x22bdd5||0xcc;return function(_0x3dce78){if(_0x3dce78){return _0x44946a[_0xbe7f('0x17')](_0x22bdd5);}return _0x44946a['status'](_0x22bdd5)[_0xbe7f('0x18')]();};}function respondWithResult(_0x221779,_0x250935){_0x250935=_0x250935||0xc8;return function(_0x5a4528){if(_0x5a4528){return _0x221779[_0xbe7f('0x19')](_0x250935)[_0xbe7f('0x1a')](_0x5a4528);}};}function respondWithFilteredResult(_0x583f82,_0x4feffa){return function(_0x1d3bf8){if(_0x1d3bf8){var _0x1d1cd2=typeof _0x4feffa[_0xbe7f('0x1b')]===_0xbe7f('0x1c')&&typeof _0x4feffa['limit']==='undefined';var _0x5c1f9b=_0x1d3bf8[_0xbe7f('0x1d')];var _0x4dfb38=_0x1d1cd2?0x0:_0x4feffa[_0xbe7f('0x1b')];var _0x49a2bd=_0x1d1cd2?_0x1d3bf8['count']:_0x4feffa[_0xbe7f('0x1b')]+_0x4feffa[_0xbe7f('0x1e')];var _0x45ee38;if(_0x49a2bd>=_0x5c1f9b){_0x49a2bd=_0x5c1f9b;_0x45ee38=0xc8;}else{_0x45ee38=0xce;}_0x583f82[_0xbe7f('0x19')](_0x45ee38);return _0x583f82[_0xbe7f('0x1f')](_0xbe7f('0x20'),_0x4dfb38+'-'+_0x49a2bd+'/'+_0x5c1f9b)[_0xbe7f('0x1a')](_0x1d3bf8);}return null;};}function patchUpdates(_0x44c35f){return function(_0x5290de){try{jsonpatch[_0xbe7f('0x21')](_0x5290de,_0x44c35f,!![]);}catch(_0x236bba){return BPromise[_0xbe7f('0x22')](_0x236bba);}return _0x5290de[_0xbe7f('0x23')]();};}function saveUpdates(_0x12f6ce,_0x14f9a4){return function(_0x59ba21){if(_0x59ba21){return _0x59ba21[_0xbe7f('0x24')](_0x12f6ce)[_0xbe7f('0x25')](function(_0x517da2){return _0x517da2;});}return null;};}function removeEntity(_0x5c8bda,_0xefe25a){return function(_0x3d53b0){if(_0x3d53b0){return _0x3d53b0[_0xbe7f('0x26')]()['then'](function(){_0x5c8bda['status'](0xcc)[_0xbe7f('0x18')]();});}};}function handleEntityNotFound(_0x162edd,_0x8077ba){return function(_0x5d7a77){if(!_0x5d7a77){_0x162edd[_0xbe7f('0x17')](0x194);}return _0x5d7a77;};}function handleError(_0xcbaed2,_0x3a9c25){_0x3a9c25=_0x3a9c25||0x1f4;return function(_0xbed7f4){logger[_0xbe7f('0x27')](_0xbed7f4[_0xbe7f('0x28')]);if(_0xbed7f4[_0xbe7f('0x29')]){delete _0xbed7f4['name'];}_0xcbaed2[_0xbe7f('0x19')](_0x3a9c25)['send'](_0xbed7f4);};}exports[_0xbe7f('0x2a')]=function(_0x1cf11b,_0x193d5d){var _0x261850={},_0x156fea={},_0x14954a={'count':0x0,'rows':[]};var _0x30421e=_[_0xbe7f('0x2b')](db['OpenchannelApplication']['rawAttributes'],function(_0x5057e8){return{'name':_0x5057e8[_0xbe7f('0x2c')],'type':_0x5057e8[_0xbe7f('0x2d')][_0xbe7f('0x2e')]};});_0x156fea['model']=_[_0xbe7f('0x2b')](_0x30421e,_0xbe7f('0x29'));_0x156fea['query']=_[_0xbe7f('0x2f')](_0x1cf11b[_0xbe7f('0x30')]);_0x156fea[_0xbe7f('0x31')]=_[_0xbe7f('0x32')](_0x156fea[_0xbe7f('0x33')],_0x156fea[_0xbe7f('0x30')]);_0x261850[_0xbe7f('0x34')]=_[_0xbe7f('0x32')](_0x156fea[_0xbe7f('0x33')],qs[_0xbe7f('0x35')](_0x1cf11b[_0xbe7f('0x30')]['fields']));_0x261850[_0xbe7f('0x34')]=_0x261850['attributes'][_0xbe7f('0x36')]?_0x261850[_0xbe7f('0x34')]:_0x156fea[_0xbe7f('0x33')];if(!_0x1cf11b[_0xbe7f('0x30')]['hasOwnProperty']('nolimit')){_0x261850['limit']=qs[_0xbe7f('0x1e')](_0x1cf11b[_0xbe7f('0x30')][_0xbe7f('0x1e')]);_0x261850[_0xbe7f('0x1b')]=qs['offset'](_0x1cf11b['query']['offset']);}_0x261850['order']=qs[_0xbe7f('0x37')](_0x1cf11b[_0xbe7f('0x30')][_0xbe7f('0x37')]);_0x261850[_0xbe7f('0x38')]=qs['filters'](_['pick'](_0x1cf11b[_0xbe7f('0x30')],_0x156fea[_0xbe7f('0x31')]),_0x30421e);if(_0x1cf11b['query']['filter']){_0x261850['where']=_[_0xbe7f('0x39')](_0x261850['where'],{'$or':_[_0xbe7f('0x2b')](_0x30421e,function(_0x523da6){if(_0x523da6['type']!==_0xbe7f('0x3a')){var _0x18243d={};_0x18243d[_0x523da6[_0xbe7f('0x29')]]={'$like':'%'+_0x1cf11b[_0xbe7f('0x30')][_0xbe7f('0x3b')]+'%'};return _0x18243d;}})});}_0x261850=_[_0xbe7f('0x39')]({},_0x261850,_0x1cf11b[_0xbe7f('0x3c')]);var _0x3217a1={'where':_0x261850[_0xbe7f('0x38')]};return db[_0xbe7f('0x3d')]['count'](_0x3217a1)[_0xbe7f('0x25')](function(_0x5ac3d5){_0x14954a['count']=_0x5ac3d5;if(_0x1cf11b[_0xbe7f('0x30')][_0xbe7f('0x3e')]){_0x261850[_0xbe7f('0x3f')]=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x261850);})['then'](function(_0x405a49){_0x14954a[_0xbe7f('0x40')]=_0x405a49;return _0x14954a;})['then'](respondWithFilteredResult(_0x193d5d,_0x261850))[_0xbe7f('0x41')](handleError(_0x193d5d,null));};exports[_0xbe7f('0x42')]=function(_0x5df4b6,_0x275203){var _0x1d4d7a={'raw':!![],'where':{'id':_0x5df4b6[_0xbe7f('0x43')]['id']}},_0x2354fe={};_0x2354fe[_0xbe7f('0x33')]=_[_0xbe7f('0x2f')](db['OpenchannelApplication']['rawAttributes']);_0x2354fe[_0xbe7f('0x30')]=_[_0xbe7f('0x2f')](_0x5df4b6[_0xbe7f('0x30')]);_0x2354fe[_0xbe7f('0x31')]=_[_0xbe7f('0x32')](_0x2354fe[_0xbe7f('0x33')],_0x2354fe[_0xbe7f('0x30')]);_0x1d4d7a[_0xbe7f('0x34')]=_['intersection'](_0x2354fe[_0xbe7f('0x33')],qs[_0xbe7f('0x35')](_0x5df4b6['query'][_0xbe7f('0x35')]));_0x1d4d7a[_0xbe7f('0x34')]=_0x1d4d7a['attributes'][_0xbe7f('0x36')]?_0x1d4d7a[_0xbe7f('0x34')]:_0x2354fe[_0xbe7f('0x33')];if(_0x5df4b6[_0xbe7f('0x30')][_0xbe7f('0x3e')]){_0x1d4d7a[_0xbe7f('0x3f')]=[{'all':!![]}];}_0x1d4d7a=_['merge']({},_0x1d4d7a,_0x5df4b6[_0xbe7f('0x3c')]);return db[_0xbe7f('0x3d')]['find'](_0x1d4d7a)['then'](handleEntityNotFound(_0x275203,null))['then'](respondWithResult(_0x275203,null))[_0xbe7f('0x41')](handleError(_0x275203,null));};exports[_0xbe7f('0x44')]=function(_0xac80c3,_0x2b240f){return db[_0xbe7f('0x3d')][_0xbe7f('0x44')](_0xac80c3[_0xbe7f('0x45')],{})[_0xbe7f('0x25')](respondWithResult(_0x2b240f,0xc9))['catch'](handleError(_0x2b240f,null));};exports[_0xbe7f('0x24')]=function(_0x212244,_0x50e8d7){if(_0x212244[_0xbe7f('0x45')]['id']){delete _0x212244[_0xbe7f('0x45')]['id'];}return db[_0xbe7f('0x3d')][_0xbe7f('0x46')]({'where':{'id':_0x212244['params']['id']}})[_0xbe7f('0x25')](handleEntityNotFound(_0x50e8d7,null))[_0xbe7f('0x25')](saveUpdates(_0x212244[_0xbe7f('0x45')],null))[_0xbe7f('0x25')](respondWithResult(_0x50e8d7,null))[_0xbe7f('0x41')](handleError(_0x50e8d7,null));};exports[_0xbe7f('0x26')]=function(_0x29678c,_0x4bb677){return db[_0xbe7f('0x3d')]['find']({'where':{'id':_0x29678c[_0xbe7f('0x43')]['id']}})[_0xbe7f('0x25')](handleEntityNotFound(_0x4bb677,null))['then'](removeEntity(_0x4bb677,null))['catch'](handleError(_0x4bb677,null));}; \ No newline at end of file +var _0xe1db=['name','index','OpenchannelApplication','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','limit','order','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe1db,0x1de));var _0xbe1d=function(_0x311ab5,_0x356e70){_0x311ab5=_0x311ab5-0x0;var _0x451f35=_0xe1db[_0x311ab5];return _0x451f35;};'use strict';var emlformat=require(_0xbe1d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbe1d('0x1'));var jsonpatch=require(_0xbe1d('0x2'));var rp=require(_0xbe1d('0x3'));var moment=require(_0xbe1d('0x4'));var BPromise=require(_0xbe1d('0x5'));var Mustache=require(_0xbe1d('0x6'));var util=require(_0xbe1d('0x7'));var path=require(_0xbe1d('0x8'));var sox=require(_0xbe1d('0x9'));var csv=require(_0xbe1d('0xa'));var ejs=require(_0xbe1d('0xb'));var fs=require('fs');var fs_extra=require(_0xbe1d('0xc'));var _=require(_0xbe1d('0xd'));var squel=require('squel');var crypto=require(_0xbe1d('0xe'));var jsforce=require(_0xbe1d('0xf'));var deskjs=require(_0xbe1d('0x10'));var toCsv=require(_0xbe1d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbe1d('0x11'));var qs=require(_0xbe1d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe1d('0x13'));var logger=require('../../config/logger')(_0xbe1d('0x14'));var utils=require(_0xbe1d('0x15'));var config=require(_0xbe1d('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbe1d('0x17'))['db'];function respondWithStatusCode(_0x233ddc,_0x50a974){_0x50a974=_0x50a974||0xcc;return function(_0x4408d1){if(_0x4408d1){return _0x233ddc[_0xbe1d('0x18')](_0x50a974);}return _0x233ddc[_0xbe1d('0x19')](_0x50a974)[_0xbe1d('0x1a')]();};}function respondWithResult(_0x1e29df,_0x342c31){_0x342c31=_0x342c31||0xc8;return function(_0x2157dc){if(_0x2157dc){return _0x1e29df[_0xbe1d('0x19')](_0x342c31)[_0xbe1d('0x1b')](_0x2157dc);}};}function respondWithFilteredResult(_0x130ec0,_0x3e77df){return function(_0x37a08e){if(_0x37a08e){var _0x4b7ea3=typeof _0x3e77df[_0xbe1d('0x1c')]===_0xbe1d('0x1d')&&typeof _0x3e77df['limit']===_0xbe1d('0x1d');var _0x15a36e=_0x37a08e[_0xbe1d('0x1e')];var _0x21b8a7=_0x4b7ea3?0x0:_0x3e77df['offset'];var _0x35fe00=_0x4b7ea3?_0x37a08e[_0xbe1d('0x1e')]:_0x3e77df[_0xbe1d('0x1c')]+_0x3e77df['limit'];var _0x41f0d9;if(_0x35fe00>=_0x15a36e){_0x35fe00=_0x15a36e;_0x41f0d9=0xc8;}else{_0x41f0d9=0xce;}_0x130ec0[_0xbe1d('0x19')](_0x41f0d9);return _0x130ec0['set'](_0xbe1d('0x1f'),_0x21b8a7+'-'+_0x35fe00+'/'+_0x15a36e)[_0xbe1d('0x1b')](_0x37a08e);}return null;};}function patchUpdates(_0x4a7641){return function(_0x46fab2){try{jsonpatch[_0xbe1d('0x20')](_0x46fab2,_0x4a7641,!![]);}catch(_0x3bea7b){return BPromise[_0xbe1d('0x21')](_0x3bea7b);}return _0x46fab2[_0xbe1d('0x22')]();};}function saveUpdates(_0x203041,_0x2a1fc4){return function(_0x24ab49){if(_0x24ab49){return _0x24ab49[_0xbe1d('0x23')](_0x203041)[_0xbe1d('0x24')](function(_0x5b338d){return _0x5b338d;});}return null;};}function removeEntity(_0x1866c5,_0x5b16df){return function(_0x22c1a1){if(_0x22c1a1){return _0x22c1a1[_0xbe1d('0x25')]()[_0xbe1d('0x24')](function(){_0x1866c5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a86b7,_0x38e029){return function(_0x480da8){if(!_0x480da8){_0x1a86b7['sendStatus'](0x194);}return _0x480da8;};}function handleError(_0x33b4ba,_0x30325d){_0x30325d=_0x30325d||0x1f4;return function(_0x1a90cf){logger[_0xbe1d('0x26')](_0x1a90cf[_0xbe1d('0x27')]);if(_0x1a90cf[_0xbe1d('0x28')]){delete _0x1a90cf['name'];}_0x33b4ba[_0xbe1d('0x19')](_0x30325d)['send'](_0x1a90cf);};}exports[_0xbe1d('0x29')]=function(_0x4d08e0,_0xa54c86){var _0x270f7b={},_0xb2c850={},_0x22a230={'count':0x0,'rows':[]};var _0x501360=_['map'](db[_0xbe1d('0x2a')]['rawAttributes'],function(_0xd8e8b){return{'name':_0xd8e8b[_0xbe1d('0x2b')],'type':_0xd8e8b[_0xbe1d('0x2c')][_0xbe1d('0x2d')]};});_0xb2c850[_0xbe1d('0x2e')]=_[_0xbe1d('0x2f')](_0x501360,_0xbe1d('0x28'));_0xb2c850[_0xbe1d('0x30')]=_[_0xbe1d('0x31')](_0x4d08e0[_0xbe1d('0x30')]);_0xb2c850['filters']=_[_0xbe1d('0x32')](_0xb2c850[_0xbe1d('0x2e')],_0xb2c850[_0xbe1d('0x30')]);_0x270f7b[_0xbe1d('0x33')]=_[_0xbe1d('0x32')](_0xb2c850[_0xbe1d('0x2e')],qs['fields'](_0x4d08e0[_0xbe1d('0x30')][_0xbe1d('0x34')]));_0x270f7b['attributes']=_0x270f7b[_0xbe1d('0x33')][_0xbe1d('0x35')]?_0x270f7b[_0xbe1d('0x33')]:_0xb2c850['model'];if(!_0x4d08e0[_0xbe1d('0x30')]['hasOwnProperty'](_0xbe1d('0x36'))){_0x270f7b[_0xbe1d('0x37')]=qs[_0xbe1d('0x37')](_0x4d08e0[_0xbe1d('0x30')]['limit']);_0x270f7b[_0xbe1d('0x1c')]=qs[_0xbe1d('0x1c')](_0x4d08e0['query'][_0xbe1d('0x1c')]);}_0x270f7b[_0xbe1d('0x38')]=qs['sort'](_0x4d08e0[_0xbe1d('0x30')]['sort']);_0x270f7b[_0xbe1d('0x39')]=qs['filters'](_[_0xbe1d('0x3a')](_0x4d08e0[_0xbe1d('0x30')],_0xb2c850[_0xbe1d('0x3b')]),_0x501360);if(_0x4d08e0[_0xbe1d('0x30')][_0xbe1d('0x3c')]){_0x270f7b['where']=_[_0xbe1d('0x3d')](_0x270f7b['where'],{'$or':_['map'](_0x501360,function(_0x28b811){if(_0x28b811[_0xbe1d('0x2c')]!==_0xbe1d('0x3e')){var _0x2bc2bf={};_0x2bc2bf[_0x28b811['name']]={'$like':'%'+_0x4d08e0[_0xbe1d('0x30')][_0xbe1d('0x3c')]+'%'};return _0x2bc2bf;}})});}_0x270f7b=_[_0xbe1d('0x3d')]({},_0x270f7b,_0x4d08e0[_0xbe1d('0x3f')]);var _0x22d68d={'where':_0x270f7b[_0xbe1d('0x39')]};return db[_0xbe1d('0x2a')][_0xbe1d('0x1e')](_0x22d68d)[_0xbe1d('0x24')](function(_0x29b319){_0x22a230[_0xbe1d('0x1e')]=_0x29b319;if(_0x4d08e0[_0xbe1d('0x30')][_0xbe1d('0x40')]){_0x270f7b['include']=[{'all':!![]}];}return db[_0xbe1d('0x2a')][_0xbe1d('0x41')](_0x270f7b);})['then'](function(_0x7910e0){_0x22a230['rows']=_0x7910e0;return _0x22a230;})[_0xbe1d('0x24')](respondWithFilteredResult(_0xa54c86,_0x270f7b))[_0xbe1d('0x42')](handleError(_0xa54c86,null));};exports[_0xbe1d('0x43')]=function(_0x4161ff,_0x342627){var _0x23519e={'raw':!![],'where':{'id':_0x4161ff[_0xbe1d('0x44')]['id']}},_0x1d54b4={};_0x1d54b4[_0xbe1d('0x2e')]=_[_0xbe1d('0x31')](db[_0xbe1d('0x2a')][_0xbe1d('0x45')]);_0x1d54b4['query']=_[_0xbe1d('0x31')](_0x4161ff['query']);_0x1d54b4[_0xbe1d('0x3b')]=_[_0xbe1d('0x32')](_0x1d54b4['model'],_0x1d54b4['query']);_0x23519e[_0xbe1d('0x33')]=_[_0xbe1d('0x32')](_0x1d54b4[_0xbe1d('0x2e')],qs[_0xbe1d('0x34')](_0x4161ff[_0xbe1d('0x30')][_0xbe1d('0x34')]));_0x23519e[_0xbe1d('0x33')]=_0x23519e[_0xbe1d('0x33')]['length']?_0x23519e[_0xbe1d('0x33')]:_0x1d54b4[_0xbe1d('0x2e')];if(_0x4161ff[_0xbe1d('0x30')][_0xbe1d('0x40')]){_0x23519e[_0xbe1d('0x46')]=[{'all':!![]}];}_0x23519e=_['merge']({},_0x23519e,_0x4161ff['options']);return db[_0xbe1d('0x2a')][_0xbe1d('0x47')](_0x23519e)[_0xbe1d('0x24')](handleEntityNotFound(_0x342627,null))[_0xbe1d('0x24')](respondWithResult(_0x342627,null))[_0xbe1d('0x42')](handleError(_0x342627,null));};exports[_0xbe1d('0x48')]=function(_0x5e8278,_0x35d72c){return db[_0xbe1d('0x2a')][_0xbe1d('0x48')](_0x5e8278[_0xbe1d('0x49')],{})[_0xbe1d('0x24')](respondWithResult(_0x35d72c,0xc9))[_0xbe1d('0x42')](handleError(_0x35d72c,null));};exports[_0xbe1d('0x23')]=function(_0x135cbd,_0x1bfe05){if(_0x135cbd[_0xbe1d('0x49')]['id']){delete _0x135cbd['body']['id'];}return db[_0xbe1d('0x2a')]['find']({'where':{'id':_0x135cbd[_0xbe1d('0x44')]['id']}})[_0xbe1d('0x24')](handleEntityNotFound(_0x1bfe05,null))[_0xbe1d('0x24')](saveUpdates(_0x135cbd[_0xbe1d('0x49')],null))[_0xbe1d('0x24')](respondWithResult(_0x1bfe05,null))[_0xbe1d('0x42')](handleError(_0x1bfe05,null));};exports[_0xbe1d('0x25')]=function(_0x1ad39d,_0x8c37ea){return db['OpenchannelApplication'][_0xbe1d('0x47')]({'where':{'id':_0x1ad39d[_0xbe1d('0x44')]['id']}})[_0xbe1d('0x24')](handleEntityNotFound(_0x8c37ea,null))[_0xbe1d('0x24')](removeEntity(_0x8c37ea,null))[_0xbe1d('0x42')](handleError(_0x8c37ea,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index ee59af6..6f85e67 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 _0x5a18=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment'];(function(_0x3a9468,_0x2b6266){var _0x1d2345=function(_0x499728){while(--_0x499728){_0x3a9468['push'](_0x3a9468['shift']());}};_0x1d2345(++_0x2b6266);}(_0x5a18,0xdc));var _0x85a1=function(_0x31d853,_0x37b487){_0x31d853=_0x31d853-0x0;var _0xed9235=_0x5a18[_0x31d853];return _0xed9235;};'use strict';var _=require(_0x85a1('0x0'));var util=require('util');var logger=require(_0x85a1('0x1'))(_0x85a1('0x2'));var moment=require(_0x85a1('0x3'));var BPromise=require(_0x85a1('0x4'));var rp=require(_0x85a1('0x5'));var fs=require('fs');var path=require(_0x85a1('0x6'));var rimraf=require(_0x85a1('0x7'));var config=require(_0x85a1('0x8'));var attributes=require('./openchannelApplication.attributes');module[_0x85a1('0x9')]=function(_0x4e0ae6,_0x4fc845){return _0x4e0ae6[_0x85a1('0xa')]('OpenchannelApplication',attributes,{'tableName':_0x85a1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x85a1('0xc'),'collate':_0x85a1('0xd')});}; \ No newline at end of file +var _0x466d=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define','OpenchannelApplication','openchannel_applications'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x466d,0x120));var _0xd466=function(_0x3cea78,_0x4a6751){_0x3cea78=_0x3cea78-0x0;var _0x33b66b=_0x466d[_0x3cea78];return _0x33b66b;};'use strict';var _=require(_0xd466('0x0'));var util=require('util');var logger=require(_0xd466('0x1'))(_0xd466('0x2'));var moment=require(_0xd466('0x3'));var BPromise=require(_0xd466('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd466('0x5'));var rimraf=require(_0xd466('0x6'));var config=require(_0xd466('0x7'));var attributes=require('./openchannelApplication.attributes');module['exports']=function(_0x4c1427,_0x3f1f1a){return _0x4c1427[_0xd466('0x8')](_0xd466('0x9'),attributes,{'tableName':_0xd466('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd466('0xb'),'collate':_0xd466('0xc')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 2de41de..21167e0 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 _0x08b4=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','error','code','message','catch','UpdateOpenchannelApplication','options','where','attributes','debug','stringify','lodash'];(function(_0x524189,_0x4fdf18){var _0x23799c=function(_0x5da82f){while(--_0x5da82f){_0x524189['push'](_0x524189['shift']());}};_0x23799c(++_0x4fdf18);}(_0x08b4,0x67));var _0x408b=function(_0x5f3905,_0x43a651){_0x5f3905=_0x5f3905-0x0;var _0x2923b1=_0x08b4[_0x5f3905];return _0x2923b1;};'use strict';var _=require(_0x408b('0x0'));var util=require(_0x408b('0x1'));var moment=require(_0x408b('0x2'));var BPromise=require(_0x408b('0x3'));var rs=require(_0x408b('0x4'));var fs=require('fs');var Redis=require(_0x408b('0x5'));var db=require(_0x408b('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x408b('0x7'));var config=require(_0x408b('0x8'));var jayson=require(_0x408b('0x9'));var client=jayson['client'][_0x408b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xec8c99,_0x1a2564,_0x9a98bc){return new BPromise(function(_0x341ce3,_0x254c04){return client[_0x408b('0xb')](_0xec8c99,_0x9a98bc)[_0x408b('0xc')](function(_0x58c68b){logger[_0x408b('0xd')](_0x408b('0xe'),_0x1a2564,'request\x20sent');logger['debug']('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x1a2564,_0x408b('0xf'),JSON['stringify'](_0x58c68b));if(_0x58c68b[_0x408b('0x10')]){if(_0x58c68b[_0x408b('0x10')][_0x408b('0x11')]===0x1f4){logger[_0x408b('0x10')](_0x408b('0xe'),_0x1a2564,_0x58c68b['error'][_0x408b('0x12')]);return _0x254c04(_0x58c68b['error'][_0x408b('0x12')]);}logger[_0x408b('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x1a2564,_0x58c68b[_0x408b('0x10')]['message']);return _0x341ce3(_0x58c68b[_0x408b('0x10')][_0x408b('0x12')]);}else{logger[_0x408b('0xd')](_0x408b('0xe'),_0x1a2564,_0x408b('0xf'));_0x341ce3(_0x58c68b['result'][_0x408b('0x12')]);}})[_0x408b('0x13')](function(_0x4b0a1c){logger[_0x408b('0x10')](_0x408b('0xe'),_0x1a2564,_0x4b0a1c);_0x254c04(_0x4b0a1c);});});}exports[_0x408b('0x14')]=function(_0xf14152){var _0x454e11=this;return new Promise(function(_0x28e9e5,_0x5aa86d){return db['OpenchannelApplication']['update'](_0xf14152['body'],{'raw':_0xf14152[_0x408b('0x15')]?_0xf14152[_0x408b('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf14152[_0x408b('0x15')]?_0xf14152['options'][_0x408b('0x16')]||null:null,'attributes':_0xf14152[_0x408b('0x15')]?_0xf14152[_0x408b('0x15')][_0x408b('0x17')]||null:null,'limit':_0xf14152[_0x408b('0x15')]?_0xf14152['options']['limit']||null:null})[_0x408b('0xc')](function(_0x250bd3){logger['info'](_0x408b('0x14'),_0xf14152);logger[_0x408b('0x18')](_0x408b('0x14'),_0xf14152,JSON[_0x408b('0x19')](_0x250bd3));_0x28e9e5(_0x250bd3);})[_0x408b('0x13')](function(_0x4d7a97){logger[_0x408b('0x10')](_0x408b('0x14'),_0x4d7a97['message'],_0xf14152);_0x5aa86d(_0x454e11['error'](0x1f4,_0x4d7a97[_0x408b('0x12')]));});});}; \ No newline at end of file +var _0x2b67=['limit','debug','UpdateOpenchannelApplication','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','OpenchannelApplication','update','body','options','raw','attributes'];(function(_0x2322bc,_0x704522){var _0x451470=function(_0x11d45b){while(--_0x11d45b){_0x2322bc['push'](_0x2322bc['shift']());}};_0x451470(++_0x704522);}(_0x2b67,0x1a3));var _0x72b6=function(_0x41ceb5,_0x30a19a){_0x41ceb5=_0x41ceb5-0x0;var _0xc3e44f=_0x2b67[_0x41ceb5];return _0xc3e44f;};'use strict';var _=require(_0x72b6('0x0'));var util=require(_0x72b6('0x1'));var moment=require(_0x72b6('0x2'));var BPromise=require(_0x72b6('0x3'));var rs=require(_0x72b6('0x4'));var fs=require('fs');var Redis=require(_0x72b6('0x5'));var db=require(_0x72b6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x72b6('0x7'))(_0x72b6('0x8'));var config=require(_0x72b6('0x9'));var jayson=require(_0x72b6('0xa'));var client=jayson[_0x72b6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f3132,_0x4686af,_0x2bb51c){return new BPromise(function(_0x9725ef,_0x163b6b){return client[_0x72b6('0xc')](_0x5f3132,_0x2bb51c)[_0x72b6('0xd')](function(_0x50916b){logger[_0x72b6('0xe')](_0x72b6('0xf'),_0x4686af,'request\x20sent');logger['debug'](_0x72b6('0x10'),_0x4686af,'request\x20sent',JSON[_0x72b6('0x11')](_0x50916b));if(_0x50916b[_0x72b6('0x12')]){if(_0x50916b[_0x72b6('0x12')][_0x72b6('0x13')]===0x1f4){logger['error'](_0x72b6('0xf'),_0x4686af,_0x50916b[_0x72b6('0x12')][_0x72b6('0x14')]);return _0x163b6b(_0x50916b[_0x72b6('0x12')][_0x72b6('0x14')]);}logger[_0x72b6('0x12')](_0x72b6('0xf'),_0x4686af,_0x50916b['error'][_0x72b6('0x14')]);return _0x9725ef(_0x50916b['error'][_0x72b6('0x14')]);}else{logger['info'](_0x72b6('0xf'),_0x4686af,_0x72b6('0x15'));_0x9725ef(_0x50916b['result']['message']);}})[_0x72b6('0x16')](function(_0x9c8049){logger[_0x72b6('0x12')](_0x72b6('0xf'),_0x4686af,_0x9c8049);_0x163b6b(_0x9c8049);});});}exports['UpdateOpenchannelApplication']=function(_0x44a90c){var _0x12b222=this;return new Promise(function(_0x1de1e7,_0x1ae5ac){return db[_0x72b6('0x17')][_0x72b6('0x18')](_0x44a90c[_0x72b6('0x19')],{'raw':_0x44a90c[_0x72b6('0x1a')]?_0x44a90c[_0x72b6('0x1a')][_0x72b6('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44a90c['options']?_0x44a90c[_0x72b6('0x1a')]['where']||null:null,'attributes':_0x44a90c[_0x72b6('0x1a')]?_0x44a90c[_0x72b6('0x1a')][_0x72b6('0x1c')]||null:null,'limit':_0x44a90c[_0x72b6('0x1a')]?_0x44a90c[_0x72b6('0x1a')][_0x72b6('0x1d')]||null:null})['then'](function(_0x19e06e){logger[_0x72b6('0xe')]('UpdateOpenchannelApplication',_0x44a90c);logger[_0x72b6('0x1e')](_0x72b6('0x1f'),_0x44a90c,JSON[_0x72b6('0x11')](_0x19e06e));_0x1de1e7(_0x19e06e);})[_0x72b6('0x16')](function(_0x2549cf){logger['error'](_0x72b6('0x1f'),_0x2549cf[_0x72b6('0x14')],_0x44a90c);_0x1ae5ac(_0x12b222[_0x72b6('0x12')](0x1f4,_0x2549cf[_0x72b6('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 65db5af..eb7f3e1 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 _0xb5f9=['getMessages','/:id/download','download','post','addMessage','/:id/tags','openchannel','openchannelinteraction:addtags','addTags','put','/:id','update','delete','tracked','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','show','/:id/messages'];(function(_0x4dfa64,_0x329287){var _0x913d72=function(_0x20a95e){while(--_0x20a95e){_0x4dfa64['push'](_0x4dfa64['shift']());}};_0x913d72(++_0x329287);}(_0xb5f9,0x1a8));var _0x9b5f=function(_0x579e4e,_0x16200e){_0x579e4e=_0x579e4e-0x0;var _0x356670=_0xb5f9[_0x579e4e];return _0x356670;};'use strict';var multer=require(_0x9b5f('0x0'));var util=require(_0x9b5f('0x1'));var path=require(_0x9b5f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9b5f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x9b5f('0x4'));var controller=require('./openchannelInteraction.controller');router[_0x9b5f('0x5')]('/',auth[_0x9b5f('0x6')](),controller['index']);router[_0x9b5f('0x5')](_0x9b5f('0x7'),auth[_0x9b5f('0x6')](),controller[_0x9b5f('0x8')]);router[_0x9b5f('0x5')]('/:id',auth[_0x9b5f('0x6')](),controller[_0x9b5f('0x9')]);router['get'](_0x9b5f('0xa'),auth['isAuthenticated'](),controller[_0x9b5f('0xb')]);router[_0x9b5f('0x5')](_0x9b5f('0xc'),auth['isAuthenticated'](),controller[_0x9b5f('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x9b5f('0xe')]('/:id/messages',auth[_0x9b5f('0x6')](),controller[_0x9b5f('0xf')]);router['post'](_0x9b5f('0x10'),auth['isAuthenticated'](),interaction['tracked'](_0x9b5f('0x11'),_0x9b5f('0x12')),controller[_0x9b5f('0x13')]);router[_0x9b5f('0x14')](_0x9b5f('0x15'),auth[_0x9b5f('0x6')](),interaction['tracked'](_0x9b5f('0x11'),'openchannelinteraction:update'),controller[_0x9b5f('0x16')]);router[_0x9b5f('0x17')](_0x9b5f('0x15'),auth[_0x9b5f('0x6')](),interaction[_0x9b5f('0x18')]('openchannel',_0x9b5f('0x19')),controller[_0x9b5f('0x1a')]);router[_0x9b5f('0x17')]('/:id/tags',auth['isAuthenticated'](),controller[_0x9b5f('0x1b')]);module[_0x9b5f('0x1c')]=router; \ No newline at end of file +var _0x44b1=['destroy','delete','removeTags','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','openchannelinteraction:update','openchannelinteraction:destroy'];(function(_0x4b7c13,_0x2c5239){var _0x37e4ec=function(_0x3e451b){while(--_0x3e451b){_0x4b7c13['push'](_0x4b7c13['shift']());}};_0x37e4ec(++_0x2c5239);}(_0x44b1,0x9f));var _0x144b=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x44b1[_0x13e741];return _0x3f8bb3;};'use strict';var multer=require(_0x144b('0x0'));var util=require(_0x144b('0x1'));var path=require('path');var timeout=require(_0x144b('0x2'));var express=require(_0x144b('0x3'));var router=express[_0x144b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x144b('0x5'));var interaction=require(_0x144b('0x6'));var config=require(_0x144b('0x7'));var controller=require('./openchannelInteraction.controller');router[_0x144b('0x8')]('/',auth[_0x144b('0x9')](),controller['index']);router['get'](_0x144b('0xa'),auth[_0x144b('0x9')](),controller[_0x144b('0xb')]);router[_0x144b('0x8')](_0x144b('0xc'),auth[_0x144b('0x9')](),controller[_0x144b('0xd')]);router['get']('/:id/messages',auth[_0x144b('0x9')](),controller[_0x144b('0xe')]);router[_0x144b('0x8')](_0x144b('0xf'),auth[_0x144b('0x9')](),controller[_0x144b('0x10')]);router[_0x144b('0x11')]('/',auth['isAuthenticated'](),controller[_0x144b('0x12')]);router[_0x144b('0x11')](_0x144b('0x13'),auth[_0x144b('0x9')](),controller[_0x144b('0x14')]);router['post'](_0x144b('0x15'),auth['isAuthenticated'](),interaction[_0x144b('0x16')](_0x144b('0x17'),_0x144b('0x18')),controller['addTags']);router['put'](_0x144b('0xc'),auth[_0x144b('0x9')](),interaction[_0x144b('0x16')](_0x144b('0x17'),_0x144b('0x19')),controller['update']);router['delete'](_0x144b('0xc'),auth[_0x144b('0x9')](),interaction[_0x144b('0x16')]('openchannel',_0x144b('0x1a')),controller[_0x144b('0x1b')]);router[_0x144b('0x1c')](_0x144b('0x15'),auth[_0x144b('0x9')](),controller[_0x144b('0x1d')]);module[_0x144b('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index c4ee357..d1d1c8a 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 _0x7af2=['INTEGER','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x2defb5,_0x1cda14){var _0x229c53=function(_0x5dd408){while(--_0x5dd408){_0x2defb5['push'](_0x2defb5['shift']());}};_0x229c53(++_0x1cda14);}(_0x7af2,0x119));var _0x27af=function(_0x54d56e,_0x524fbf){_0x54d56e=_0x54d56e-0x0;var _0x457d42=_0x7af2[_0x54d56e];return _0x457d42;};'use strict';var Sequelize=require('sequelize');module[_0x27af('0x0')]={'closed':{'type':Sequelize[_0x27af('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x27af('0x2')]},'disposition':{'type':Sequelize[_0x27af('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x27af('0x3')]},'note':{'type':Sequelize[_0x27af('0x3')]},'read1stAt':{'type':Sequelize[_0x27af('0x2')]},'threadId':{'type':Sequelize[_0x27af('0x3')]},'externalUrl':{'type':Sequelize[_0x27af('0x3')]},'lastMsgAt':{'type':Sequelize[_0x27af('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x27af('0x4')]('in',_0x27af('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x27af('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x27af('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x27af('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x27af('0x6')]}}; \ No newline at end of file +var _0x061a=['BOOLEAN','DATE','STRING','ENUM','out','INTEGER','sequelize','exports'];(function(_0x3cfaa3,_0x34f6c9){var _0x55a02c=function(_0x2606fd){while(--_0x2606fd){_0x3cfaa3['push'](_0x3cfaa3['shift']());}};_0x55a02c(++_0x34f6c9);}(_0x061a,0x13e));var _0xa061=function(_0xd5d43b,_0x361a08){_0xd5d43b=_0xd5d43b-0x0;var _0x1395cf=_0x061a[_0xd5d43b];return _0x1395cf;};'use strict';var Sequelize=require(_0xa061('0x0'));module[_0xa061('0x1')]={'closed':{'type':Sequelize[_0xa061('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xa061('0x3')]},'disposition':{'type':Sequelize[_0xa061('0x4')]},'secondDisposition':{'type':Sequelize[_0xa061('0x4')]},'thirdDisposition':{'type':Sequelize[_0xa061('0x4')]},'note':{'type':Sequelize[_0xa061('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xa061('0x4')]},'externalUrl':{'type':Sequelize[_0xa061('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xa061('0x5')]('in',_0xa061('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xa061('0x5')]('in',_0xa061('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xa061('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0xa061('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index eb1f434..d2271e2 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 _0x468c=['lastName','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','Account','Owner','mkdirSync','Openchannel','N.A.','closed','closedAt','Public','basename','existsSync','pipe','createWriteStream','out','System','firstName','Contact','value','renderFile','views','transcript-','createPdfFromHTML','error','unlinkSync','rimraf','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','then','destroy','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','getOptions','findAll','openchannel','query','user','catch','show','from','params','model','keys','filters','attributes','intersection','fields','length','include','merge','find','create','body','describe','addMessage','ids','omit','OpenchannelMessage','order','sort','where','pick','OpenchannelInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','rows','addTags','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','root','server','tmp','join','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact'];(function(_0x2857f5,_0x181da1){var _0xb5aed6=function(_0x1a0097){while(--_0x1a0097){_0x2857f5['push'](_0x2857f5['shift']());}};_0xb5aed6(++_0x181da1);}(_0x468c,0x19f));var _0xc468=function(_0x5d5c63,_0x5e6b8f){_0x5d5c63=_0x5d5c63-0x0;var _0x28dd3c=_0x468c[_0x5d5c63];return _0x28dd3c;};'use strict';var rimraf=require(_0xc468('0x0'));var zipdir=require('zip-dir');var moment=require(_0xc468('0x1'));var util=require(_0xc468('0x2'));var path=require(_0xc468('0x3'));var ejs=require(_0xc468('0x4'));var fs=require('fs');var _=require(_0xc468('0x5'));var Redis=require(_0xc468('0x6'));var interaction=require(_0xc468('0x7'));var qs=require(_0xc468('0x8'));var pdf=require(_0xc468('0x9'));var logger=require(_0xc468('0xa'))('api');var config=require('../../config/environment');var db=require(_0xc468('0xb'))['db'];config[_0xc468('0xc')]=_[_0xc468('0xd')](config[_0xc468('0xc')],{'host':_0xc468('0xe'),'port':0x18eb});var socket=require(_0xc468('0xf'))(new Redis(config['redis']));require(_0xc468('0x10'))['register'](socket);function respondWithStatusCode(_0x123447,_0x58e58d){_0x58e58d=_0x58e58d||0xcc;return function(_0x4b5245){if(_0x4b5245){return _0x123447[_0xc468('0x11')](_0x58e58d);}return _0x123447['status'](_0x58e58d)[_0xc468('0x12')]();};}function respondWithResult(_0x1961e1,_0x1df40e){_0x1df40e=_0x1df40e||0xc8;return function(_0x330597){if(_0x330597){return _0x1961e1[_0xc468('0x13')](_0x1df40e)[_0xc468('0x14')](_0x330597);}};}function respondWithFilteredResult(_0x36f821,_0x1f91a9){return function(_0x10ee06){if(_0x10ee06){var _0x45e62f=typeof _0x1f91a9[_0xc468('0x15')]===_0xc468('0x16')&&typeof _0x1f91a9[_0xc468('0x17')]===_0xc468('0x16');var _0x51891b=_0x10ee06[_0xc468('0x18')];var _0x266933=_0x45e62f?0x0:_0x1f91a9[_0xc468('0x15')];var _0xbdeedd=_0x45e62f?_0x10ee06['count']:_0x1f91a9[_0xc468('0x15')]+_0x1f91a9[_0xc468('0x17')];var _0x2549bb;if(_0xbdeedd>=_0x51891b){_0xbdeedd=_0x51891b;_0x2549bb=0xc8;}else{_0x2549bb=0xce;}_0x36f821[_0xc468('0x13')](_0x2549bb);return _0x36f821[_0xc468('0x19')](_0xc468('0x1a'),_0x266933+'-'+_0xbdeedd+'/'+_0x51891b)[_0xc468('0x14')](_0x10ee06);}return null;};}function saveUpdates(_0x3f0d88){return function(_0x5c01ef){if(_0x5c01ef){return _0x5c01ef['update'](_0x3f0d88)[_0xc468('0x1b')](function(_0xe7b17b){return _0xe7b17b;});}return null;};}function removeEntity(_0x1de312){return function(_0x4f7edb){if(_0x4f7edb){return _0x4f7edb[_0xc468('0x1c')]()['then'](function(){_0x1de312[_0xc468('0x13')](0xcc)[_0xc468('0x12')]();});}};}function handleEntityNotFound(_0x5ca699){return function(_0x70d478){if(!_0x70d478){_0x5ca699[_0xc468('0x11')](0x194);}return _0x70d478;};}function handleError(_0x15a054,_0x30ae12){_0x30ae12=_0x30ae12||0x1f4;return function(_0x177b41){logger['error'](_0x177b41[_0xc468('0x1d')]);if(_0x177b41['name']){delete _0x177b41[_0xc468('0x1e')];}_0x15a054[_0xc468('0x13')](_0x30ae12)[_0xc468('0x1f')](_0x177b41);};}exports[_0xc468('0x20')]=function(_0x29ea78,_0x36e4ea){var _0x594de3={};var _0x16f14b=_[_0xc468('0x21')](db[_0xc468('0x22')][_0xc468('0x23')],function(_0x551d24){return{'name':_0x551d24[_0xc468('0x24')],'type':_0x551d24[_0xc468('0x25')]['key']};});_0x594de3=qs[_0xc468('0x26')](_0x16f14b,_0x29ea78);return interaction[_0xc468('0x27')](_0xc468('0x28'),_0x29ea78[_0xc468('0x29')],_0x29ea78[_0xc468('0x2a')],_0x594de3,_0x16f14b)[_0xc468('0x1b')](respondWithFilteredResult(_0x36e4ea,_0x594de3))[_0xc468('0x2b')](handleError(_0x36e4ea,null));};exports[_0xc468('0x2c')]=function(_0x559bd5,_0xebf11d){var _0x2ace56={};if(_0x559bd5[_0xc468('0x29')][_0xc468('0x25')]&&_0x559bd5[_0xc468('0x29')]['type']===_0xc468('0x2d')){_0x2ace56[_0xc468('0x2d')]=_0x559bd5[_0xc468('0x2e')]['id'];}else{_0x2ace56['id']=_0x559bd5[_0xc468('0x2e')]['id'];}var _0x1459a5={'raw':![],'where':_0x2ace56},_0x1e7dd8={};_0x1e7dd8[_0xc468('0x2f')]=_['keys'](db['OpenchannelInteraction'][_0xc468('0x23')]);_0x1e7dd8['query']=_[_0xc468('0x30')](_0x559bd5[_0xc468('0x29')]);_0x1e7dd8[_0xc468('0x31')]=_['intersection'](_0x1e7dd8[_0xc468('0x2f')],_0x1e7dd8[_0xc468('0x29')]);_0x1459a5[_0xc468('0x32')]=_[_0xc468('0x33')](_0x1e7dd8[_0xc468('0x2f')],qs[_0xc468('0x34')](_0x559bd5[_0xc468('0x29')][_0xc468('0x34')]));_0x1459a5[_0xc468('0x32')]=_0x1459a5[_0xc468('0x32')][_0xc468('0x35')]?_0x1459a5[_0xc468('0x32')]:_0x1e7dd8[_0xc468('0x2f')];if(_0x559bd5[_0xc468('0x29')]['includeAll']){_0x1459a5[_0xc468('0x36')]=[{'all':!![]}];}_0x1459a5=_[_0xc468('0x37')]({},_0x1459a5,_0x559bd5['options']);return db['OpenchannelInteraction'][_0xc468('0x38')](_0x1459a5)[_0xc468('0x1b')](handleEntityNotFound(_0xebf11d,null))['then'](respondWithResult(_0xebf11d,null))[_0xc468('0x2b')](handleError(_0xebf11d,null));};exports[_0xc468('0x39')]=function(_0x380f41,_0xb2e633){return db[_0xc468('0x22')]['create'](_0x380f41['body'],{})['then'](respondWithResult(_0xb2e633,0xc9))['catch'](handleError(_0xb2e633,null));};exports['update']=function(_0x285109,_0x385d87){if(_0x285109[_0xc468('0x3a')]['id']){delete _0x285109[_0xc468('0x3a')]['id'];}return db[_0xc468('0x22')]['find']({'where':{'id':_0x285109[_0xc468('0x2e')]['id']}})[_0xc468('0x1b')](handleEntityNotFound(_0x385d87,null))[_0xc468('0x1b')](saveUpdates(_0x285109[_0xc468('0x3a')],null))['then'](respondWithResult(_0x385d87,null))['catch'](handleError(_0x385d87,null));};exports[_0xc468('0x1c')]=function(_0xb2d84f,_0x580511){return db['OpenchannelInteraction']['find']({'where':{'id':_0xb2d84f['params']['id']}})[_0xc468('0x1b')](handleEntityNotFound(_0x580511,null))[_0xc468('0x1b')](removeEntity(_0x580511,null))[_0xc468('0x2b')](handleError(_0x580511,null));};exports[_0xc468('0x3b')]=function(_0x5652a1,_0x224dc0){return db[_0xc468('0x22')]['describe']()[_0xc468('0x1b')](respondWithResult(_0x224dc0,null))[_0xc468('0x2b')](handleError(_0x224dc0,null));};exports['addMessage']=function(_0x1da40d,_0x1988d1){return db['OpenchannelMessage'][_0xc468('0x38')]({'where':{'id':_0x1da40d[_0xc468('0x2e')]['id']}})['then'](handleEntityNotFound(_0x1988d1,null))[_0xc468('0x1b')](function(_0x19fce7){if(_0x19fce7){return _0x19fce7[_0xc468('0x3c')](_0x1da40d[_0xc468('0x3a')][_0xc468('0x3d')],_[_0xc468('0x3e')](_0x1da40d[_0xc468('0x3a')],['ids','id'])||{});}})['then'](respondWithResult(_0x1988d1,null))[_0xc468('0x2b')](handleError(_0x1988d1,null));};exports['getMessages']=function(_0x21e1c7,_0x1cc9c3){var _0x11108a={'raw':![],'where':{}};var _0x481a8d={};var _0x37f465={'count':0x0,'rows':[]};return db[_0xc468('0x22')]['findOne']({'where':{'id':_0x21e1c7[_0xc468('0x2e')]['id']}})['then'](handleEntityNotFound(_0x1cc9c3,null))[_0xc468('0x1b')](function(_0x442cb7){if(_0x442cb7){_0x481a8d[_0xc468('0x2f')]=_['keys'](db[_0xc468('0x3f')]['rawAttributes']);_0x481a8d[_0xc468('0x29')]=_['keys'](_0x21e1c7[_0xc468('0x29')]);_0x481a8d[_0xc468('0x31')]=_[_0xc468('0x33')](_0x481a8d[_0xc468('0x2f')],_0x481a8d[_0xc468('0x29')]);_0x11108a[_0xc468('0x32')]=_[_0xc468('0x33')](_0x481a8d[_0xc468('0x2f')],qs[_0xc468('0x34')](_0x21e1c7[_0xc468('0x29')][_0xc468('0x34')]));_0x11108a[_0xc468('0x32')]=_0x11108a['attributes']['length']?_0x11108a[_0xc468('0x32')]:_0x481a8d[_0xc468('0x2f')];if(!_0x21e1c7[_0xc468('0x29')]['hasOwnProperty']('nolimit')){_0x11108a[_0xc468('0x17')]=qs['limit'](_0x21e1c7[_0xc468('0x29')][_0xc468('0x17')]);_0x11108a['offset']=qs[_0xc468('0x15')](_0x21e1c7[_0xc468('0x29')][_0xc468('0x15')]);}_0x11108a[_0xc468('0x40')]=qs['sort'](_0x21e1c7['query'][_0xc468('0x41')]);_0x11108a[_0xc468('0x42')]=qs[_0xc468('0x31')](_[_0xc468('0x43')](_0x21e1c7[_0xc468('0x29')],_0x481a8d[_0xc468('0x31')]));_0x11108a[_0xc468('0x42')][_0xc468('0x44')]=_0x442cb7['id'];if(_0x21e1c7[_0xc468('0x29')]['filter']){_0x11108a[_0xc468('0x42')]=_[_0xc468('0x37')](_0x11108a[_0xc468('0x42')],{'$or':_[_0xc468('0x21')](_0x11108a['attributes'],function(_0x4f5ec0){var _0x11fcf8={};_0x11fcf8[_0x4f5ec0]={'$like':'%'+_0x21e1c7[_0xc468('0x29')][_0xc468('0x45')]+'%'};return _0x11fcf8;})});}if(_0x21e1c7[_0xc468('0x29')][_0xc468('0x46')]){var _0xf1aa70=_0x21e1c7[_0xc468('0x29')][_0xc468('0x46')][_0xc468('0x47')](',');var _0xa19c35={};_0xa19c35[_0xf1aa70[0x0]]={'$gte':moment(_0xf1aa70[0x1])[_0xc468('0x48')](_0xc468('0x49'))};_0x11108a[_0xc468('0x42')]=_[_0xc468('0x37')](_0x11108a[_0xc468('0x42')],_0xa19c35);}_0x11108a=_['merge']({},_0x11108a,_0x21e1c7[_0xc468('0x4a')]);return db['OpenchannelMessage'][_0xc468('0x18')]({'where':_0x11108a[_0xc468('0x42')]})[_0xc468('0x1b')](function(_0x3ea13e){_0x37f465[_0xc468('0x18')]=_0x3ea13e;if(_0x21e1c7[_0xc468('0x29')][_0xc468('0x4b')]){_0x11108a['include']=[{'all':!![]}];}return db[_0xc468('0x3f')][_0xc468('0x27')](_0x11108a);})[_0xc468('0x1b')](function(_0x566cb5){_0x37f465[_0xc468('0x4c')]=_0x566cb5;return _0x37f465;});}})[_0xc468('0x1b')](respondWithFilteredResult(_0x1cc9c3,_0x11108a))[_0xc468('0x2b')](handleError(_0x1cc9c3,null));};exports[_0xc468('0x4d')]=function(_0x33bda8,_0x381e17){return db['OpenchannelInteraction'][_0xc468('0x38')]({'where':{'id':_0x33bda8[_0xc468('0x2e')]['id']}})[_0xc468('0x1b')](handleEntityNotFound(_0x381e17,null))[_0xc468('0x1b')](function(_0x4ca4c9){if(_0x4ca4c9){return _0x4ca4c9['setTags'](_0x33bda8[_0xc468('0x3a')]['ids'],_['omit'](_0x33bda8[_0xc468('0x3a')],[_0xc468('0x3d'),'id'])||{})[_0xc468('0x4e')](function(){return db[_0xc468('0x4f')][_0xc468('0x27')]({'attributes':['id',_0xc468('0x1e'),_0xc468('0x50')],'where':{'id':_0x33bda8[_0xc468('0x3a')][_0xc468('0x3d')]}});})[_0xc468('0x1b')](function(_0x381448){socket[_0xc468('0x51')](_0xc468('0x52'),{'id':Number(_0x33bda8[_0xc468('0x2e')]['id']),'tags':_0x381448||[]});return{'id':Number(_0x33bda8[_0xc468('0x2e')]['id']),'tags':_0x381448||[]};});}})[_0xc468('0x1b')](respondWithResult(_0x381e17,null))['catch'](handleError(_0x381e17,null));};exports[_0xc468('0x53')]=function(_0x452a5c,_0x1582e0){return db[_0xc468('0x22')][_0xc468('0x38')]({'where':{'id':_0x452a5c[_0xc468('0x2e')]['id']}})['then'](handleEntityNotFound(_0x1582e0,null))[_0xc468('0x1b')](function(_0x5a85e9){if(_0x5a85e9){return _0x5a85e9[_0xc468('0x53')](_0x452a5c[_0xc468('0x29')][_0xc468('0x3d')]);}})[_0xc468('0x1b')](respondWithStatusCode(_0x1582e0,null))[_0xc468('0x2b')](handleError(_0x1582e0,null));};exports[_0xc468('0x54')]=function(_0x4928a9,_0x57b985){var _0x2a1983=moment()[_0xc468('0x55')]()[_0xc468('0x56')]();var _0x132059=path['join'](config[_0xc468('0x57')],_0xc468('0x58'),'files',_0xc468('0x59'));var _0x32eaac=path[_0xc468('0x5a')](config[_0xc468('0x57')],_0xc468('0x58'),'files',_0xc468('0x5b'));var _0x394f8a=path[_0xc468('0x5a')](_0x132059,_0x2a1983);var _0x75d6d2=util['format'](_0xc468('0x5c'),_0x4928a9['params']['id'],_0x2a1983);var _0x4e3fa0=path['join'](_0x132059,_0x75d6d2);var _0x51a30e=[];_0x51a30e[_0xc468('0x5d')]({'model':db['User'],'as':_0xc468('0x5e'),'attributes':['id',_0xc468('0x5f')],'raw':!![]});_0x51a30e[_0xc468('0x5d')]({'model':db[_0xc468('0x60')],'as':'Contact','attributes':['id','firstName',_0xc468('0x61')],'raw':!![]});if(_0x4928a9[_0xc468('0x29')][_0xc468('0x5b')]){_0x51a30e[_0xc468('0x5d')]({'model':db[_0xc468('0x62')],'as':'Attachment','raw':!![]});}var _0x4417d4=[{'model':db[_0xc468('0x3f')],'as':_0xc468('0x63'),'attributes':['id','body',_0xc468('0x64'),_0xc468('0x65'),_0xc468('0x66'),_0xc468('0x67')],'include':_0x51a30e}];_0x4417d4[_0xc468('0x5d')]({'model':db[_0xc468('0x68')],'as':_0xc468('0x69'),'attributes':['id',_0xc468('0x1e')]});_0x4417d4['push']({'model':db[_0xc468('0x5e')],'as':_0xc468('0x6a'),'attributes':['id',_0xc468('0x5f')]});return db[_0xc468('0x22')][_0xc468('0x38')]({'where':{'id':_0x4928a9[_0xc468('0x2e')]['id']},'include':_0x4417d4})['then'](handleEntityNotFound(_0x57b985,null))[_0xc468('0x1b')](function(_0xbebef8){if(_0xbebef8){var _0x3e6658=_0xbebef8['get']({'plain':!![]});fs[_0xc468('0x6b')](_0x394f8a);var _0x366cf0={'channel':_0xc468('0x6c'),'account':_0x3e6658[_0xc468('0x69')]['name'],'agent':_0x3e6658[_0xc468('0x6a')]?_0x3e6658['Owner'][_0xc468('0x5f')]:_0xc468('0x6d'),'createdAt':moment(_0x3e6658['createdAt'])[_0xc468('0x48')](_0xc468('0x49'))[_0xc468('0x56')](),'closedAt':_0x3e6658[_0xc468('0x6e')]?moment(_0x3e6658[_0xc468('0x6f')])[_0xc468('0x48')](_0xc468('0x49'))[_0xc468('0x56')]():'','disposition':_0x3e6658['disposition'],'visibility':_0x3e6658['threadId']?_0xc468('0x70'):'Private','messages':_(_0x3e6658[_0xc468('0x63')])[_0xc468('0x45')]({'secret':![]})['map'](function(_0x5e3629){if(_0x5e3629[_0xc468('0x62')]){var _0x497fdb=path[_0xc468('0x5a')](_0x32eaac,_0x5e3629['Attachment'][_0xc468('0x71')]);if(fs[_0xc468('0x72')](_0x497fdb)){fs['createReadStream'](_0x497fdb)[_0xc468('0x73')](fs[_0xc468('0x74')](path['join'](_0x394f8a,_0x5e3629[_0xc468('0x62')][_0xc468('0x71')])));}}return{'date':moment(_0x5e3629['createdAt'])[_0xc468('0x48')](_0xc468('0x49'))[_0xc468('0x56')](),'sender':_0x5e3629[_0xc468('0x65')]===_0xc468('0x75')?_0x5e3629['User']?_0x5e3629[_0xc468('0x5e')][_0xc468('0x5f')]:_0xc468('0x76'):_0x5e3629['Contact'][_0xc468('0x77')]+(_0x5e3629[_0xc468('0x78')]['lastName']?'\x20'+_0x5e3629[_0xc468('0x78')][_0xc468('0x61')]:''),'body':_0x5e3629[_0xc468('0x62')]?_0x5e3629[_0xc468('0x62')][_0xc468('0x71')]:_0x5e3629[_0xc468('0x3a')],'direction':_0x5e3629[_0xc468('0x65')]===_0xc468('0x75')?'A':'C','secret':_0x5e3629['secret'],'read':_0x5e3629[_0xc468('0x67')],'attachment':_0x5e3629[_0xc468('0x62')]};})[_0xc468('0x79')]()};return ejs[_0xc468('0x7a')](path[_0xc468('0x5a')](config[_0xc468('0x57')],_0xc468('0x58'),_0xc468('0x7b'),'downloadInteraction.ejs'),{'interaction':_0x366cf0})[_0xc468('0x1b')](function(_0x159b44){var _0x571e48=path[_0xc468('0x5a')](_0x394f8a,_0xc468('0x7c')+_0x3e6658['id']+'-'+_0x2a1983+'.pdf');var _0x166ea3={'path':_0x571e48,'channel':'Openchannel','interactionId':_0x3e6658['id']};return pdf[_0xc468('0x7d')](_0x159b44,_0x166ea3);})['then'](function(){return new Promise(function(_0x3db3ac,_0x2dc3e8){zipdir(_0x394f8a,{'saveTo':_0x4e3fa0},function(_0x20c917,_0x20ec1b){if(_0x20c917)return _0x2dc3e8(_0x20c917);return _0x3db3ac(_0x20ec1b);});})[_0xc468('0x1b')](function(){return new Promise(function(_0x497269,_0x6c2847){rimraf(_0x394f8a,function(_0x5796b3){if(_0x5796b3)_0x6c2847(_0x5796b3);return _0x497269();});});})['then'](function(){return _0x57b985['download'](_0x4e3fa0,_0x75d6d2,function(_0xa9bde4){if(_0xa9bde4){logger[_0xc468('0x7e')]('Unable\x20to\x20delete\x20zip\x20file',_0xa9bde4);}else{fs[_0xc468('0x7f')](_0x4e3fa0);}});});});}else{return _0x57b985[_0xc468('0x11')](0xc8);}})[_0xc468('0x2b')](handleError(_0x57b985,null));}; \ No newline at end of file +var _0x1da7=['../../components/interaction/service','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','status','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','end','sendStatus','stack','name','send','index','map','OpenchannelInteraction','fieldName','type','getOptions','openchannel','query','catch','from','params','model','rawAttributes','filters','intersection','fields','attributes','length','includeAll','include','options','create','body','find','describe','addMessage','ids','omit','getMessages','findOne','keys','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','$gte','split','format','OpenchannelMessage','findAll','rows','addTags','Tag','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','server','tmp','files','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','direction','secret','read','Account','mkdirSync','Openchannel','Owner','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','Public','Private','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','downloadInteraction.ejs','transcript-','.pdf','error','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','rimraf','zip-dir','moment','util','path','ejs','lodash','ioredis'];(function(_0x481906,_0x28c7e4){var _0x3048e3=function(_0x2ebe05){while(--_0x2ebe05){_0x481906['push'](_0x481906['shift']());}};_0x3048e3(++_0x28c7e4);}(_0x1da7,0x1f4));var _0x71da=function(_0x3b6a84,_0x318b9b){_0x3b6a84=_0x3b6a84-0x0;var _0xbae34a=_0x1da7[_0x3b6a84];return _0xbae34a;};'use strict';var rimraf=require(_0x71da('0x0'));var zipdir=require(_0x71da('0x1'));var moment=require(_0x71da('0x2'));var util=require(_0x71da('0x3'));var path=require(_0x71da('0x4'));var ejs=require(_0x71da('0x5'));var fs=require('fs');var _=require(_0x71da('0x6'));var Redis=require(_0x71da('0x7'));var interaction=require(_0x71da('0x8'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require(_0x71da('0x9'))('api');var config=require(_0x71da('0xa'));var db=require(_0x71da('0xb'))['db'];config[_0x71da('0xc')]=_[_0x71da('0xd')](config['redis'],{'host':_0x71da('0xe'),'port':0x18eb});var socket=require(_0x71da('0xf'))(new Redis(config[_0x71da('0xc')]));require(_0x71da('0x10'))[_0x71da('0x11')](socket);function respondWithStatusCode(_0x5d5a89,_0x514395){_0x514395=_0x514395||0xcc;return function(_0x2cf963){if(_0x2cf963){return _0x5d5a89['sendStatus'](_0x514395);}return _0x5d5a89[_0x71da('0x12')](_0x514395)['end']();};}function respondWithResult(_0x32aaef,_0x3272c6){_0x3272c6=_0x3272c6||0xc8;return function(_0x5a0472){if(_0x5a0472){return _0x32aaef[_0x71da('0x12')](_0x3272c6)[_0x71da('0x13')](_0x5a0472);}};}function respondWithFilteredResult(_0x105c8c,_0x11d5ef){return function(_0x1d19e2){if(_0x1d19e2){var _0x17c117=typeof _0x11d5ef[_0x71da('0x14')]==='undefined'&&typeof _0x11d5ef[_0x71da('0x15')]===_0x71da('0x16');var _0x2346ab=_0x1d19e2[_0x71da('0x17')];var _0x411bfb=_0x17c117?0x0:_0x11d5ef[_0x71da('0x14')];var _0x5ae70c=_0x17c117?_0x1d19e2[_0x71da('0x17')]:_0x11d5ef[_0x71da('0x14')]+_0x11d5ef[_0x71da('0x15')];var _0x9f70da;if(_0x5ae70c>=_0x2346ab){_0x5ae70c=_0x2346ab;_0x9f70da=0xc8;}else{_0x9f70da=0xce;}_0x105c8c[_0x71da('0x12')](_0x9f70da);return _0x105c8c[_0x71da('0x18')](_0x71da('0x19'),_0x411bfb+'-'+_0x5ae70c+'/'+_0x2346ab)[_0x71da('0x13')](_0x1d19e2);}return null;};}function saveUpdates(_0x1e8fd1){return function(_0x40648b){if(_0x40648b){return _0x40648b[_0x71da('0x1a')](_0x1e8fd1)[_0x71da('0x1b')](function(_0x533806){return _0x533806;});}return null;};}function removeEntity(_0xeb626){return function(_0x5b3fae){if(_0x5b3fae){return _0x5b3fae[_0x71da('0x1c')]()['then'](function(){_0xeb626[_0x71da('0x12')](0xcc)[_0x71da('0x1d')]();});}};}function handleEntityNotFound(_0x428a40){return function(_0x50fb54){if(!_0x50fb54){_0x428a40[_0x71da('0x1e')](0x194);}return _0x50fb54;};}function handleError(_0x13b162,_0x108687){_0x108687=_0x108687||0x1f4;return function(_0xc307ce){logger['error'](_0xc307ce[_0x71da('0x1f')]);if(_0xc307ce[_0x71da('0x20')]){delete _0xc307ce[_0x71da('0x20')];}_0x13b162[_0x71da('0x12')](_0x108687)[_0x71da('0x21')](_0xc307ce);};}exports[_0x71da('0x22')]=function(_0x2cf1b1,_0x439d94){var _0x35a189={};var _0x36eda7=_[_0x71da('0x23')](db[_0x71da('0x24')]['rawAttributes'],function(_0x46191e){return{'name':_0x46191e[_0x71da('0x25')],'type':_0x46191e[_0x71da('0x26')]['key']};});_0x35a189=qs[_0x71da('0x27')](_0x36eda7,_0x2cf1b1);return interaction['findAll'](_0x71da('0x28'),_0x2cf1b1[_0x71da('0x29')],_0x2cf1b1['user'],_0x35a189,_0x36eda7)[_0x71da('0x1b')](respondWithFilteredResult(_0x439d94,_0x35a189))[_0x71da('0x2a')](handleError(_0x439d94,null));};exports['show']=function(_0xf228cb,_0x49d7c0){var _0x276130={};if(_0xf228cb[_0x71da('0x29')][_0x71da('0x26')]&&_0xf228cb[_0x71da('0x29')]['type']===_0x71da('0x2b')){_0x276130[_0x71da('0x2b')]=_0xf228cb['params']['id'];}else{_0x276130['id']=_0xf228cb[_0x71da('0x2c')]['id'];}var _0x2b9e48={'raw':![],'where':_0x276130},_0x3deef7={};_0x3deef7[_0x71da('0x2d')]=_['keys'](db[_0x71da('0x24')][_0x71da('0x2e')]);_0x3deef7[_0x71da('0x29')]=_['keys'](_0xf228cb[_0x71da('0x29')]);_0x3deef7[_0x71da('0x2f')]=_[_0x71da('0x30')](_0x3deef7['model'],_0x3deef7[_0x71da('0x29')]);_0x2b9e48['attributes']=_[_0x71da('0x30')](_0x3deef7[_0x71da('0x2d')],qs[_0x71da('0x31')](_0xf228cb[_0x71da('0x29')][_0x71da('0x31')]));_0x2b9e48[_0x71da('0x32')]=_0x2b9e48[_0x71da('0x32')][_0x71da('0x33')]?_0x2b9e48[_0x71da('0x32')]:_0x3deef7[_0x71da('0x2d')];if(_0xf228cb['query'][_0x71da('0x34')]){_0x2b9e48[_0x71da('0x35')]=[{'all':!![]}];}_0x2b9e48=_['merge']({},_0x2b9e48,_0xf228cb[_0x71da('0x36')]);return db[_0x71da('0x24')]['find'](_0x2b9e48)['then'](handleEntityNotFound(_0x49d7c0,null))[_0x71da('0x1b')](respondWithResult(_0x49d7c0,null))['catch'](handleError(_0x49d7c0,null));};exports[_0x71da('0x37')]=function(_0x3fbee4,_0x49f16c){return db[_0x71da('0x24')][_0x71da('0x37')](_0x3fbee4[_0x71da('0x38')],{})[_0x71da('0x1b')](respondWithResult(_0x49f16c,0xc9))['catch'](handleError(_0x49f16c,null));};exports['update']=function(_0x5d724b,_0x4fea2b){if(_0x5d724b[_0x71da('0x38')]['id']){delete _0x5d724b[_0x71da('0x38')]['id'];}return db[_0x71da('0x24')][_0x71da('0x39')]({'where':{'id':_0x5d724b[_0x71da('0x2c')]['id']}})[_0x71da('0x1b')](handleEntityNotFound(_0x4fea2b,null))[_0x71da('0x1b')](saveUpdates(_0x5d724b['body'],null))[_0x71da('0x1b')](respondWithResult(_0x4fea2b,null))['catch'](handleError(_0x4fea2b,null));};exports['destroy']=function(_0x1d0efb,_0x4e589c){return db['OpenchannelInteraction'][_0x71da('0x39')]({'where':{'id':_0x1d0efb['params']['id']}})[_0x71da('0x1b')](handleEntityNotFound(_0x4e589c,null))[_0x71da('0x1b')](removeEntity(_0x4e589c,null))['catch'](handleError(_0x4e589c,null));};exports[_0x71da('0x3a')]=function(_0x2ae06b,_0x21a6d3){return db[_0x71da('0x24')]['describe']()[_0x71da('0x1b')](respondWithResult(_0x21a6d3,null))[_0x71da('0x2a')](handleError(_0x21a6d3,null));};exports[_0x71da('0x3b')]=function(_0x32fb00,_0x53138b){return db['OpenchannelMessage'][_0x71da('0x39')]({'where':{'id':_0x32fb00[_0x71da('0x2c')]['id']}})[_0x71da('0x1b')](handleEntityNotFound(_0x53138b,null))[_0x71da('0x1b')](function(_0x1be219){if(_0x1be219){return _0x1be219[_0x71da('0x3b')](_0x32fb00[_0x71da('0x38')][_0x71da('0x3c')],_[_0x71da('0x3d')](_0x32fb00[_0x71da('0x38')],[_0x71da('0x3c'),'id'])||{});}})[_0x71da('0x1b')](respondWithResult(_0x53138b,null))[_0x71da('0x2a')](handleError(_0x53138b,null));};exports[_0x71da('0x3e')]=function(_0x48dbff,_0x234710){var _0x1bab5c={'raw':![],'where':{}};var _0x46a97e={};var _0x22c708={'count':0x0,'rows':[]};return db[_0x71da('0x24')][_0x71da('0x3f')]({'where':{'id':_0x48dbff[_0x71da('0x2c')]['id']}})[_0x71da('0x1b')](handleEntityNotFound(_0x234710,null))['then'](function(_0x2112e1){if(_0x2112e1){_0x46a97e[_0x71da('0x2d')]=_[_0x71da('0x40')](db['OpenchannelMessage'][_0x71da('0x2e')]);_0x46a97e[_0x71da('0x29')]=_[_0x71da('0x40')](_0x48dbff['query']);_0x46a97e[_0x71da('0x2f')]=_['intersection'](_0x46a97e[_0x71da('0x2d')],_0x46a97e[_0x71da('0x29')]);_0x1bab5c[_0x71da('0x32')]=_[_0x71da('0x30')](_0x46a97e['model'],qs[_0x71da('0x31')](_0x48dbff[_0x71da('0x29')][_0x71da('0x31')]));_0x1bab5c['attributes']=_0x1bab5c[_0x71da('0x32')][_0x71da('0x33')]?_0x1bab5c[_0x71da('0x32')]:_0x46a97e[_0x71da('0x2d')];if(!_0x48dbff[_0x71da('0x29')][_0x71da('0x41')](_0x71da('0x42'))){_0x1bab5c[_0x71da('0x15')]=qs[_0x71da('0x15')](_0x48dbff['query'][_0x71da('0x15')]);_0x1bab5c['offset']=qs[_0x71da('0x14')](_0x48dbff[_0x71da('0x29')]['offset']);}_0x1bab5c[_0x71da('0x43')]=qs['sort'](_0x48dbff[_0x71da('0x29')][_0x71da('0x44')]);_0x1bab5c[_0x71da('0x45')]=qs[_0x71da('0x2f')](_[_0x71da('0x46')](_0x48dbff['query'],_0x46a97e[_0x71da('0x2f')]));_0x1bab5c[_0x71da('0x45')]['OpenchannelInteractionId']=_0x2112e1['id'];if(_0x48dbff[_0x71da('0x29')][_0x71da('0x47')]){_0x1bab5c[_0x71da('0x45')]=_[_0x71da('0x48')](_0x1bab5c[_0x71da('0x45')],{'$or':_['map'](_0x1bab5c[_0x71da('0x32')],function(_0x75d23a){var _0x4e1502={};_0x4e1502[_0x75d23a]={'$like':'%'+_0x48dbff[_0x71da('0x29')]['filter']+'%'};return _0x4e1502;})});}if(_0x48dbff[_0x71da('0x29')][_0x71da('0x49')]){var _0x2c47ed=_0x48dbff[_0x71da('0x29')]['$gte'][_0x71da('0x4a')](',');var _0x433c78={};_0x433c78[_0x2c47ed[0x0]]={'$gte':moment(_0x2c47ed[0x1])[_0x71da('0x4b')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1bab5c['where']=_['merge'](_0x1bab5c[_0x71da('0x45')],_0x433c78);}_0x1bab5c=_[_0x71da('0x48')]({},_0x1bab5c,_0x48dbff[_0x71da('0x36')]);return db[_0x71da('0x4c')]['count']({'where':_0x1bab5c[_0x71da('0x45')]})[_0x71da('0x1b')](function(_0x574119){_0x22c708[_0x71da('0x17')]=_0x574119;if(_0x48dbff[_0x71da('0x29')]['includeAll']){_0x1bab5c[_0x71da('0x35')]=[{'all':!![]}];}return db[_0x71da('0x4c')][_0x71da('0x4d')](_0x1bab5c);})[_0x71da('0x1b')](function(_0x4a88ad){_0x22c708[_0x71da('0x4e')]=_0x4a88ad;return _0x22c708;});}})['then'](respondWithFilteredResult(_0x234710,_0x1bab5c))[_0x71da('0x2a')](handleError(_0x234710,null));};exports[_0x71da('0x4f')]=function(_0x81a90b,_0x153b46){return db[_0x71da('0x24')]['find']({'where':{'id':_0x81a90b[_0x71da('0x2c')]['id']}})[_0x71da('0x1b')](handleEntityNotFound(_0x153b46,null))[_0x71da('0x1b')](function(_0x333493){if(_0x333493){return _0x333493['setTags'](_0x81a90b['body'][_0x71da('0x3c')],_['omit'](_0x81a90b['body'],[_0x71da('0x3c'),'id'])||{})['spread'](function(){return db[_0x71da('0x50')][_0x71da('0x4d')]({'attributes':['id',_0x71da('0x20'),'color'],'where':{'id':_0x81a90b[_0x71da('0x38')][_0x71da('0x3c')]}});})[_0x71da('0x1b')](function(_0xc887ec){socket[_0x71da('0x51')](_0x71da('0x52'),{'id':Number(_0x81a90b[_0x71da('0x2c')]['id']),'tags':_0xc887ec||[]});return{'id':Number(_0x81a90b['params']['id']),'tags':_0xc887ec||[]};});}})[_0x71da('0x1b')](respondWithResult(_0x153b46,null))[_0x71da('0x2a')](handleError(_0x153b46,null));};exports[_0x71da('0x53')]=function(_0x1b0e59,_0x2fa7a3){return db['OpenchannelInteraction'][_0x71da('0x39')]({'where':{'id':_0x1b0e59[_0x71da('0x2c')]['id']}})[_0x71da('0x1b')](handleEntityNotFound(_0x2fa7a3,null))[_0x71da('0x1b')](function(_0x5cdc2e){if(_0x5cdc2e){return _0x5cdc2e[_0x71da('0x53')](_0x1b0e59[_0x71da('0x29')][_0x71da('0x3c')]);}})[_0x71da('0x1b')](respondWithStatusCode(_0x2fa7a3,null))[_0x71da('0x2a')](handleError(_0x2fa7a3,null));};exports[_0x71da('0x54')]=function(_0x1ef705,_0x175f9e){var _0x40f821=moment()[_0x71da('0x55')]()[_0x71da('0x56')]();var _0x323455=path[_0x71da('0x57')](config['root'],_0x71da('0x58'),'files',_0x71da('0x59'));var _0xe189cd=path['join'](config['root'],_0x71da('0x58'),_0x71da('0x5a'),_0x71da('0x5b'));var _0x4e8126=path[_0x71da('0x57')](_0x323455,_0x40f821);var _0x342ecd=util[_0x71da('0x4b')](_0x71da('0x5c'),_0x1ef705['params']['id'],_0x40f821);var _0x44a557=path['join'](_0x323455,_0x342ecd);var _0x45ba64=[];_0x45ba64[_0x71da('0x5d')]({'model':db[_0x71da('0x5e')],'as':_0x71da('0x5e'),'attributes':['id',_0x71da('0x5f')],'raw':!![]});_0x45ba64['push']({'model':db[_0x71da('0x60')],'as':_0x71da('0x61'),'attributes':['id',_0x71da('0x62'),_0x71da('0x63')],'raw':!![]});if(_0x1ef705[_0x71da('0x29')][_0x71da('0x5b')]){_0x45ba64['push']({'model':db[_0x71da('0x64')],'as':'Attachment','raw':!![]});}var _0x34b7bf=[{'model':db['OpenchannelMessage'],'as':'Messages','attributes':['id',_0x71da('0x38'),'createdAt',_0x71da('0x65'),_0x71da('0x66'),_0x71da('0x67')],'include':_0x45ba64}];_0x34b7bf[_0x71da('0x5d')]({'model':db['OpenchannelAccount'],'as':_0x71da('0x68'),'attributes':['id',_0x71da('0x20')]});_0x34b7bf[_0x71da('0x5d')]({'model':db['User'],'as':'Owner','attributes':['id','fullname']});return db[_0x71da('0x24')]['find']({'where':{'id':_0x1ef705['params']['id']},'include':_0x34b7bf})[_0x71da('0x1b')](handleEntityNotFound(_0x175f9e,null))['then'](function(_0x51c0c0){if(_0x51c0c0){var _0x59270a=_0x51c0c0['get']({'plain':!![]});fs[_0x71da('0x69')](_0x4e8126);var _0x223334={'channel':_0x71da('0x6a'),'account':_0x59270a['Account'][_0x71da('0x20')],'agent':_0x59270a[_0x71da('0x6b')]?_0x59270a[_0x71da('0x6b')][_0x71da('0x5f')]:'N.A.','createdAt':moment(_0x59270a['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x71da('0x56')](),'closedAt':_0x59270a[_0x71da('0x6c')]?moment(_0x59270a[_0x71da('0x6d')])[_0x71da('0x4b')](_0x71da('0x6e'))[_0x71da('0x56')]():'','disposition':_0x59270a['disposition'],'visibility':_0x59270a['threadId']?_0x71da('0x6f'):_0x71da('0x70'),'messages':_(_0x59270a[_0x71da('0x71')])['filter']({'secret':![]})[_0x71da('0x23')](function(_0x4a9066){if(_0x4a9066[_0x71da('0x64')]){var _0xb26835=path[_0x71da('0x57')](_0xe189cd,_0x4a9066[_0x71da('0x64')][_0x71da('0x72')]);if(fs[_0x71da('0x73')](_0xb26835)){fs[_0x71da('0x74')](_0xb26835)[_0x71da('0x75')](fs[_0x71da('0x76')](path['join'](_0x4e8126,_0x4a9066[_0x71da('0x64')][_0x71da('0x72')])));}}return{'date':moment(_0x4a9066['createdAt'])[_0x71da('0x4b')](_0x71da('0x6e'))[_0x71da('0x56')](),'sender':_0x4a9066['direction']===_0x71da('0x77')?_0x4a9066[_0x71da('0x5e')]?_0x4a9066[_0x71da('0x5e')]['fullname']:'System':_0x4a9066['Contact'][_0x71da('0x62')]+(_0x4a9066[_0x71da('0x61')][_0x71da('0x63')]?'\x20'+_0x4a9066[_0x71da('0x61')][_0x71da('0x63')]:''),'body':_0x4a9066[_0x71da('0x64')]?_0x4a9066[_0x71da('0x64')][_0x71da('0x72')]:_0x4a9066[_0x71da('0x38')],'direction':_0x4a9066[_0x71da('0x65')]===_0x71da('0x77')?'A':'C','secret':_0x4a9066[_0x71da('0x66')],'read':_0x4a9066[_0x71da('0x67')],'attachment':_0x4a9066[_0x71da('0x64')]};})['value']()};return ejs[_0x71da('0x78')](path[_0x71da('0x57')](config['root'],_0x71da('0x58'),'views',_0x71da('0x79')),{'interaction':_0x223334})[_0x71da('0x1b')](function(_0xb57b16){var _0x5080d6=path[_0x71da('0x57')](_0x4e8126,_0x71da('0x7a')+_0x59270a['id']+'-'+_0x40f821+_0x71da('0x7b'));var _0x3ca1ff={'path':_0x5080d6,'channel':_0x71da('0x6a'),'interactionId':_0x59270a['id']};return pdf['createPdfFromHTML'](_0xb57b16,_0x3ca1ff);})[_0x71da('0x1b')](function(){return new Promise(function(_0xa8a4a4,_0x49608b){zipdir(_0x4e8126,{'saveTo':_0x44a557},function(_0x1b5334,_0x479427){if(_0x1b5334)return _0x49608b(_0x1b5334);return _0xa8a4a4(_0x479427);});})[_0x71da('0x1b')](function(){return new Promise(function(_0x4b0739,_0x3d2816){rimraf(_0x4e8126,function(_0x5bb5b4){if(_0x5bb5b4)_0x3d2816(_0x5bb5b4);return _0x4b0739();});});})[_0x71da('0x1b')](function(){return _0x175f9e[_0x71da('0x54')](_0x44a557,_0x342ecd,function(_0x4466d4){if(_0x4466d4){logger[_0x71da('0x7c')](_0x71da('0x7d'),_0x4466d4);}else{fs[_0x71da('0x7e')](_0x44a557);}});});});}else{return _0x175f9e[_0x71da('0x1e')](0xc8);}})[_0x71da('0x2a')](handleError(_0x175f9e,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index f9f3cc4..7e91dda 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 _0x822b=['findAll','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','remove','then','setDataValue','Users'];(function(_0x5c422a,_0x2376e5){var _0x6c5b33=function(_0x3138c0){while(--_0x3138c0){_0x5c422a['push'](_0x5c422a['shift']());}};_0x6c5b33(++_0x2376e5);}(_0x822b,0xab));var _0xb822=function(_0x49fb1c,_0x113891){_0x49fb1c=_0x49fb1c-0x0;var _0x36cc02=_0x822b[_0x49fb1c];return _0x36cc02;};'use strict';var EventEmitter=require(_0xb822('0x0'));var OpenchannelInteraction=require(_0xb822('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0xb822('0x1'))['db'][_0xb822('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xb822('0x3')](0x0);var events={'afterCreate':_0xb822('0x4'),'afterUpdate':'update','afterDestroy':_0xb822('0x5')};function emitEvent(_0x5cc972){return function(_0x48ba3e,_0x1e79c8,_0x2e80cb){_0x48ba3e['getUsers']({'attributes':['id'],'raw':!![]})[_0xb822('0x6')](function(_0x1a463e){_0x48ba3e[_0xb822('0x7')](_0xb822('0x8'),_0x1a463e['map'](function(_0x33e9da){return{'id':_0x33e9da['id']};}));return OpenchannelMessage[_0xb822('0x9')]({'where':{'OpenchannelInteractionId':_0x48ba3e['id'],'direction':'in','read':![]},'raw':!![]});})[_0xb822('0x6')](function(_0x827966){_0x48ba3e[_0xb822('0x7')]('unreadMessages',_0x827966[_0xb822('0xa')]);OpenchannelInteractionEvents[_0xb822('0xb')](_0x5cc972+':'+_0x48ba3e['id'],_0x48ba3e);OpenchannelInteractionEvents[_0xb822('0xb')](_0x5cc972,_0x48ba3e);_0x2e80cb(null);})[_0xb822('0xc')](_0x2e80cb(null));};}for(var e in events){if(events[_0xb822('0xd')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0xb822('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xbb0b=['hasOwnProperty','hook','exports','../../mysqldb','OpenchannelMessage','remove','getUsers','then','Users','map','setDataValue','unreadMessages','length','emit','catch'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xbb0b,0x14d));var _0xbbb0=function(_0x10bcca,_0xa013bc){_0x10bcca=_0x10bcca-0x0;var _0x110095=_0xbb0b[_0x10bcca];return _0x110095;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xbbb0('0x0'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0xbbb0('0x0'))['db'][_0xbbb0('0x1')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xbbb0('0x2')};function emitEvent(_0x2a0ef0){return function(_0x2bbd41,_0x822db1,_0x39678a){_0x2bbd41[_0xbbb0('0x3')]({'attributes':['id'],'raw':!![]})[_0xbbb0('0x4')](function(_0x1ebe42){_0x2bbd41['setDataValue'](_0xbbb0('0x5'),_0x1ebe42[_0xbbb0('0x6')](function(_0x2fd61a){return{'id':_0x2fd61a['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x2bbd41['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbbb0('0x4')](function(_0x9521e2){_0x2bbd41[_0xbbb0('0x7')](_0xbbb0('0x8'),_0x9521e2[_0xbbb0('0x9')]);OpenchannelInteractionEvents['emit'](_0x2a0ef0+':'+_0x2bbd41['id'],_0x2bbd41);OpenchannelInteractionEvents[_0xbbb0('0xa')](_0x2a0ef0,_0x2bbd41);_0x39678a(null);})[_0xbbb0('0xb')](_0x39678a(null));};}for(var e in events){if(events[_0xbbb0('0xc')](e)){var event=events[e];OpenchannelInteraction[_0xbbb0('0xd')](e,emitEvent(event));}}module[_0xbbb0('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index f100ffb..6f05dc9 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 _0x89e4=['exports','OpenchannelInteraction','openchannel_interactions','utf8mb4','changed','closed','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes'];(function(_0xb74e2c,_0x3c35fc){var _0x345b5b=function(_0x5131c9){while(--_0x5131c9){_0xb74e2c['push'](_0xb74e2c['shift']());}};_0x345b5b(++_0x3c35fc);}(_0x89e4,0x8e));var _0x489e=function(_0x4aecb5,_0x1440a4){_0x4aecb5=_0x4aecb5-0x0;var _0x36df86=_0x89e4[_0x4aecb5];return _0x36df86;};'use strict';var _=require(_0x489e('0x0'));var util=require(_0x489e('0x1'));var logger=require(_0x489e('0x2'))(_0x489e('0x3'));var moment=require(_0x489e('0x4'));var BPromise=require(_0x489e('0x5'));var rp=require(_0x489e('0x6'));var fs=require('fs');var path=require(_0x489e('0x7'));var rimraf=require(_0x489e('0x8'));var config=require(_0x489e('0x9'));var attributes=require(_0x489e('0xa'));module[_0x489e('0xb')]=function(_0xc9dcde,_0x263272){return _0xc9dcde['define'](_0x489e('0xc'),attributes,{'tableName':_0x489e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x489e('0xe'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x448863,_0x4f5f34,_0x12860e){if(_0x448863[_0x489e('0xf')](_0x489e('0x10'))){_0x448863['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x12860e(null,_0x448863);}}});}; \ No newline at end of file +var _0x05f5=['bluebird','path','rimraf','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment'];(function(_0x3c0bea,_0x496d85){var _0x37068e=function(_0x24026a){while(--_0x24026a){_0x3c0bea['push'](_0x3c0bea['shift']());}};_0x37068e(++_0x496d85);}(_0x05f5,0x12e));var _0x505f=function(_0x85d56d,_0x37f5c1){_0x85d56d=_0x85d56d-0x0;var _0x51f613=_0x05f5[_0x85d56d];return _0x51f613;};'use strict';var _=require(_0x505f('0x0'));var util=require(_0x505f('0x1'));var logger=require('../../config/logger')(_0x505f('0x2'));var moment=require(_0x505f('0x3'));var BPromise=require(_0x505f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x505f('0x5'));var rimraf=require(_0x505f('0x6'));var config=require('../../config/environment');var attributes=require(_0x505f('0x7'));module[_0x505f('0x8')]=function(_0x5c5e11,_0x1fc0ec){return _0x5c5e11[_0x505f('0x9')](_0x505f('0xa'),attributes,{'tableName':_0x505f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x505f('0xc'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x4a9679,_0x456d71,_0x544885){if(_0x4a9679['changed'](_0x505f('0xd'))){_0x4a9679[_0x505f('0xe')]=moment()[_0x505f('0xf')](_0x505f('0x10'));}_0x544885(null,_0x4a9679);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index bac9088..405bb84 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 _0xa097=['AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','where','limit','catch','AddTagsToOpenchannelInteraction','omit','ids','spread'];(function(_0x3a17b0,_0x32a3b6){var _0xda8c4=function(_0x2e605a){while(--_0x2e605a){_0x3a17b0['push'](_0x3a17b0['shift']());}};_0xda8c4(++_0x32a3b6);}(_0xa097,0x1ef));var _0x7a09=function(_0x31bf4a,_0x51eb5f){_0x31bf4a=_0x31bf4a-0x0;var _0x2265ec=_0xa097[_0x31bf4a];return _0x2265ec;};'use strict';var _=require('lodash');var util=require(_0x7a09('0x0'));var moment=require(_0x7a09('0x1'));var BPromise=require(_0x7a09('0x2'));var rs=require(_0x7a09('0x3'));var fs=require('fs');var Redis=require(_0x7a09('0x4'));var db=require(_0x7a09('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7a09('0x6'))('rpc');var config=require(_0x7a09('0x7'));var jayson=require(_0x7a09('0x8'));var client=jayson[_0x7a09('0x9')]['http']({'port':0x232a});config[_0x7a09('0xa')]=_[_0x7a09('0xb')](config['redis'],{'host':_0x7a09('0xc'),'port':0x18eb});var socket=require(_0x7a09('0xd'))(new Redis(config[_0x7a09('0xa')]));require('./openchannelInteraction.socket')[_0x7a09('0xe')](socket);function respondWithRpcPromise(_0x5d6931,_0xde40bd,_0x29473f){return new BPromise(function(_0x45f58f,_0x4ea7d8){return client['request'](_0x5d6931,_0x29473f)[_0x7a09('0xf')](function(_0x111ba0){logger[_0x7a09('0x10')](_0x7a09('0x11'),_0xde40bd,_0x7a09('0x12'));logger[_0x7a09('0x13')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0xde40bd,_0x7a09('0x12'),JSON[_0x7a09('0x14')](_0x111ba0));if(_0x111ba0[_0x7a09('0x15')]){if(_0x111ba0[_0x7a09('0x15')][_0x7a09('0x16')]===0x1f4){logger[_0x7a09('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0xde40bd,_0x111ba0[_0x7a09('0x15')][_0x7a09('0x17')]);return _0x4ea7d8(_0x111ba0[_0x7a09('0x15')][_0x7a09('0x17')]);}logger[_0x7a09('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0xde40bd,_0x111ba0[_0x7a09('0x15')][_0x7a09('0x17')]);return _0x45f58f(_0x111ba0[_0x7a09('0x15')][_0x7a09('0x17')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0xde40bd,'request\x20sent');_0x45f58f(_0x111ba0[_0x7a09('0x18')]['message']);}})['catch'](function(_0x3b70f8){logger[_0x7a09('0x15')](_0x7a09('0x11'),_0xde40bd,_0x3b70f8);_0x4ea7d8(_0x3b70f8);});});}exports[_0x7a09('0x19')]=function(_0x1c3c73){var _0x1bc3f1=this;return new Promise(function(_0x31a21b,_0x37d5ae){return db[_0x7a09('0x1a')][_0x7a09('0x1b')](_0x1c3c73[_0x7a09('0x1c')],{'raw':_0x1c3c73['options']?_0x1c3c73['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c3c73[_0x7a09('0x1d')]?_0x1c3c73[_0x7a09('0x1d')][_0x7a09('0x1e')]||null:null,'attributes':_0x1c3c73['options']?_0x1c3c73['options']['attributes']||null:null,'limit':_0x1c3c73[_0x7a09('0x1d')]?_0x1c3c73[_0x7a09('0x1d')][_0x7a09('0x1f')]||null:null})[_0x7a09('0xf')](function(_0x4321fc){logger['info']('UpdateOpenchannelInteraction',_0x1c3c73);logger[_0x7a09('0x13')]('UpdateOpenchannelInteraction',_0x1c3c73,JSON[_0x7a09('0x14')](_0x4321fc));_0x31a21b(_0x4321fc);})[_0x7a09('0x20')](function(_0x34bb0b){logger[_0x7a09('0x15')](_0x7a09('0x19'),_0x34bb0b[_0x7a09('0x17')],_0x1c3c73);_0x37d5ae(_0x1bc3f1[_0x7a09('0x15')](0x1f4,_0x34bb0b[_0x7a09('0x17')]));});});};exports[_0x7a09('0x21')]=function(_0x2b5487){return new Promise(function(_0x231f9e,_0x5ca5b4){return db[_0x7a09('0x1a')]['find']({'where':_0x2b5487[_0x7a09('0x1d')]?_0x2b5487[_0x7a09('0x1d')][_0x7a09('0x1e')]||null:null})[_0x7a09('0xf')](function(_0x20bebb){if(_0x20bebb){return _0x20bebb['addTags'](_0x2b5487[_0x7a09('0x1c')]['ids'],_[_0x7a09('0x22')](_0x2b5487[_0x7a09('0x1c')],[_0x7a09('0x23'),'id'])||{});}})[_0x7a09('0x24')](function(_0x4eb550){logger[_0x7a09('0x10')](_0x7a09('0x25'),_0x2b5487);logger[_0x7a09('0x13')]('AddTags',_0x2b5487,JSON[_0x7a09('0x14')](_0x4eb550));_0x231f9e(_0x4eb550);})[_0x7a09('0x20')](function(_0x2323c5){logger[_0x7a09('0x15')](_0x7a09('0x25'),_0x2323c5[_0x7a09('0x17')],_0x2b5487);_0x5ca5b4(_this['error'](0x1f4,_0x2323c5[_0x7a09('0x17')]));});});}; \ No newline at end of file +var _0xee54=['then','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','OpenchannelInteraction,\x20%s,\x20%s','info','result','UpdateOpenchannelInteraction','body','options','raw','where','limit','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','request'];(function(_0x2685c4,_0x113da3){var _0x5f414c=function(_0x172a17){while(--_0x172a17){_0x2685c4['push'](_0x2685c4['shift']());}};_0x5f414c(++_0x113da3);}(_0xee54,0x106));var _0x4ee5=function(_0x295f91,_0x391dbf){_0x295f91=_0x295f91-0x0;var _0xa99243=_0xee54[_0x295f91];return _0xa99243;};'use strict';var _=require(_0x4ee5('0x0'));var util=require(_0x4ee5('0x1'));var moment=require(_0x4ee5('0x2'));var BPromise=require(_0x4ee5('0x3'));var rs=require(_0x4ee5('0x4'));var fs=require('fs');var Redis=require(_0x4ee5('0x5'));var db=require(_0x4ee5('0x6'))['db'];var utils=require(_0x4ee5('0x7'));var logger=require(_0x4ee5('0x8'))(_0x4ee5('0x9'));var config=require(_0x4ee5('0xa'));var jayson=require(_0x4ee5('0xb'));var client=jayson['client'][_0x4ee5('0xc')]({'port':0x232a});config[_0x4ee5('0xd')]=_[_0x4ee5('0xe')](config[_0x4ee5('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x4ee5('0xf'))(new Redis(config[_0x4ee5('0xd')]));require('./openchannelInteraction.socket')[_0x4ee5('0x10')](socket);function respondWithRpcPromise(_0x417737,_0x243f5b,_0x24d538){return new BPromise(function(_0x6c4402,_0x55fc36){return client[_0x4ee5('0x11')](_0x417737,_0x24d538)[_0x4ee5('0x12')](function(_0xcaa716){logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x243f5b,_0x4ee5('0x13'));logger[_0x4ee5('0x14')](_0x4ee5('0x15'),_0x243f5b,_0x4ee5('0x13'),JSON[_0x4ee5('0x16')](_0xcaa716));if(_0xcaa716['error']){if(_0xcaa716[_0x4ee5('0x17')]['code']===0x1f4){logger[_0x4ee5('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x243f5b,_0xcaa716[_0x4ee5('0x17')][_0x4ee5('0x18')]);return _0x55fc36(_0xcaa716[_0x4ee5('0x17')][_0x4ee5('0x18')]);}logger[_0x4ee5('0x17')](_0x4ee5('0x19'),_0x243f5b,_0xcaa716[_0x4ee5('0x17')][_0x4ee5('0x18')]);return _0x6c4402(_0xcaa716[_0x4ee5('0x17')][_0x4ee5('0x18')]);}else{logger[_0x4ee5('0x1a')](_0x4ee5('0x19'),_0x243f5b,_0x4ee5('0x13'));_0x6c4402(_0xcaa716[_0x4ee5('0x1b')][_0x4ee5('0x18')]);}})['catch'](function(_0x28e40b){logger[_0x4ee5('0x17')]('OpenchannelInteraction,\x20%s,\x20%s',_0x243f5b,_0x28e40b);_0x55fc36(_0x28e40b);});});}exports[_0x4ee5('0x1c')]=function(_0x21121e){var _0x129ed5=this;return new Promise(function(_0x19cd3d,_0x21aaff){return db['OpenchannelInteraction']['update'](_0x21121e[_0x4ee5('0x1d')],{'raw':_0x21121e[_0x4ee5('0x1e')]?_0x21121e[_0x4ee5('0x1e')][_0x4ee5('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21121e[_0x4ee5('0x1e')]?_0x21121e[_0x4ee5('0x1e')][_0x4ee5('0x20')]||null:null,'attributes':_0x21121e[_0x4ee5('0x1e')]?_0x21121e[_0x4ee5('0x1e')]['attributes']||null:null,'limit':_0x21121e[_0x4ee5('0x1e')]?_0x21121e[_0x4ee5('0x1e')][_0x4ee5('0x21')]||null:null})[_0x4ee5('0x12')](function(_0x8e8425){logger[_0x4ee5('0x1a')](_0x4ee5('0x1c'),_0x21121e);logger[_0x4ee5('0x14')](_0x4ee5('0x1c'),_0x21121e,JSON[_0x4ee5('0x16')](_0x8e8425));_0x19cd3d(_0x8e8425);})['catch'](function(_0x4cc48f){logger[_0x4ee5('0x17')](_0x4ee5('0x1c'),_0x4cc48f[_0x4ee5('0x18')],_0x21121e);_0x21aaff(_0x129ed5[_0x4ee5('0x17')](0x1f4,_0x4cc48f[_0x4ee5('0x18')]));});});};exports[_0x4ee5('0x22')]=function(_0x2c3066){return new Promise(function(_0x1d6ba4,_0x500004){return db['OpenchannelInteraction'][_0x4ee5('0x23')]({'where':_0x2c3066['options']?_0x2c3066[_0x4ee5('0x1e')]['where']||null:null})['then'](function(_0x581394){if(_0x581394){return _0x581394[_0x4ee5('0x24')](_0x2c3066[_0x4ee5('0x1d')][_0x4ee5('0x25')],_[_0x4ee5('0x26')](_0x2c3066['body'],[_0x4ee5('0x25'),'id'])||{});}})['spread'](function(_0x2ab782){logger[_0x4ee5('0x1a')](_0x4ee5('0x27'),_0x2c3066);logger[_0x4ee5('0x14')](_0x4ee5('0x27'),_0x2c3066,JSON[_0x4ee5('0x16')](_0x2ab782));_0x1d6ba4(_0x2ab782);})['catch'](function(_0x3df41d){logger[_0x4ee5('0x17')](_0x4ee5('0x27'),_0x3df41d[_0x4ee5('0x18')],_0x2c3066);_0x500004(_this[_0x4ee5('0x17')](0x1f4,_0x3df41d[_0x4ee5('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index c4cee0a..470a624 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 _0xccd0=['save','remove','update','emit','register','length','openchannelInteraction:','./openchannelInteraction.events'];(function(_0xfd80d5,_0x303f80){var _0xeb957d=function(_0x1c5d12){while(--_0x1c5d12){_0xfd80d5['push'](_0xfd80d5['shift']());}};_0xeb957d(++_0x303f80);}(_0xccd0,0x1bf));var _0x0ccd=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xccd0[_0x21a9d9];return _0x46adce;};'use strict';var OpenchannelInteractionEvents=require(_0x0ccd('0x0'));var events=[_0x0ccd('0x1'),_0x0ccd('0x2'),_0x0ccd('0x3')];function createListener(_0x4018e3,_0x52edf9){return function(_0x341109){_0x52edf9[_0x0ccd('0x4')](_0x4018e3,_0x341109);};}function removeListener(_0x4b9ec8,_0x1c96d5){return function(){OpenchannelInteractionEvents['removeListener'](_0x4b9ec8,_0x1c96d5);};}exports[_0x0ccd('0x5')]=function(_0x273236){for(var _0x2313a1=0x0,_0x38ac15=events[_0x0ccd('0x6')];_0x2313a1<_0x38ac15;_0x2313a1++){var _0x533781=events[_0x2313a1];var _0x53d37b=createListener(_0x0ccd('0x7')+_0x533781,_0x273236);OpenchannelInteractionEvents['on'](_0x533781,_0x53d37b);}}; \ No newline at end of file +var _0x33db=['removeListener','openchannelInteraction:','save','remove','emit'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x33db,0x70));var _0xb33d=function(_0x179e11,_0xf65436){_0x179e11=_0x179e11-0x0;var _0x549f04=_0x33db[_0x179e11];return _0x549f04;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=[_0xb33d('0x0'),_0xb33d('0x1'),'update'];function createListener(_0x71f922,_0x53ebac){return function(_0x16fa94){_0x53ebac[_0xb33d('0x2')](_0x71f922,_0x16fa94);};}function removeListener(_0x555457,_0x25d3a9){return function(){OpenchannelInteractionEvents[_0xb33d('0x3')](_0x555457,_0x25d3a9);};}exports['register']=function(_0x1855c5){for(var _0x5ed3f8=0x0,_0x4a203d=events['length'];_0x5ed3f8<_0x4a203d;_0x5ed3f8++){var _0x4cae84=events[_0x5ed3f8];var _0x3dfb09=createListener(_0xb33d('0x4')+_0x4cae84,_0x1855c5);OpenchannelInteractionEvents['on'](_0x4cae84,_0x3dfb09);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 1dcacec..d3fb293 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 _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x24d405,_0x59e179){var _0x3c8c57=function(_0x54dcd9){while(--_0x54dcd9){_0x24d405['push'](_0x24d405['shift']());}};_0x3c8c57(++_0x59e179);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router; \ No newline at end of file +var _0x0713=['get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','openchannelmessage:create','put','update','accept','/:id/reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelMessage.controller'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var controller=require(_0x3071('0x7'));router[_0x3071('0x8')]('/',auth[_0x3071('0x9')](),controller[_0x3071('0xa')]);router[_0x3071('0x8')](_0x3071('0xb'),auth[_0x3071('0x9')](),controller[_0x3071('0xc')]);router[_0x3071('0x8')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller['show']);router[_0x3071('0xe')]('/',auth[_0x3071('0x9')](),interaction[_0x3071('0xf')](_0x3071('0x10'),_0x3071('0x11')),controller['create']);router[_0x3071('0x12')](_0x3071('0xd'),auth[_0x3071('0x9')](),controller[_0x3071('0x13')]);router[_0x3071('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x3071('0x14')]);router['put'](_0x3071('0x15'),auth[_0x3071('0x9')](),controller['reject']);router[_0x3071('0x16')]('/:id',auth[_0x3071('0x9')](),controller[_0x3071('0x17')]);module[_0x3071('0x18')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 1d54ef6..376cf8a 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 _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(_0x205e5a,_0x5c19fb){_0x205e5a=_0x205e5a-0x0;var _0x10da58=_0x19e1[_0x205e5a];return _0x10da58;};'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 +var _0xb8a0=['STRING','TEXT','medium','BOOLEAN'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xb8a0,0x1d5));var _0x0b8a=function(_0x1cbac8,_0x575ccf){_0x1cbac8=_0x1cbac8-0x0;var _0x42e9c0=_0xb8a0[_0x1cbac8];return _0x42e9c0;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x0b8a('0x0')](_0x0b8a('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x0b8a('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x0b8a('0x3')]},'providerResponse':{'type':Sequelize[_0x0b8a('0x0')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index de02460..9c5c101 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 _0x1365=['User','fullname','email','internal','manual','interface','channel','motionChannel','EventManager','openchannel-interactions','reject','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','sequelize','event','rejectmessage','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/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','client','request','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','code','OpenchannelMessage,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','save','update','destroy','stack','name','index','OpenchannelMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','count','include','findAll','rows','show','params','includeAll','create','body','find','describe','../../config/logger','accept','openchannel','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','format','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact'];(function(_0x103538,_0x16d9df){var _0x13bd35=function(_0x2cac77){while(--_0x2cac77){_0x103538['push'](_0x103538['shift']());}};_0x13bd35(++_0x16d9df);}(_0x1365,0x1a4));var _0x5136=function(_0x484fc9,_0x4598aa){_0x484fc9=_0x484fc9-0x0;var _0x89aa01=_0x1365[_0x484fc9];return _0x89aa01;};'use strict';var emlformat=require(_0x5136('0x0'));var rimraf=require(_0x5136('0x1'));var zipdir=require(_0x5136('0x2'));var jsonpatch=require(_0x5136('0x3'));var rp=require(_0x5136('0x4'));var moment=require(_0x5136('0x5'));var BPromise=require(_0x5136('0x6'));var Mustache=require(_0x5136('0x7'));var util=require(_0x5136('0x8'));var path=require(_0x5136('0x9'));var sox=require('sox');var csv=require(_0x5136('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5136('0xb'));var squel=require('squel');var crypto=require(_0x5136('0xc'));var jsforce=require(_0x5136('0xd'));var deskjs=require(_0x5136('0xe'));var toCsv=require(_0x5136('0xa'));var querystring=require(_0x5136('0xf'));var Papa=require(_0x5136('0x10'));var Redis=require('ioredis');var authService=require(_0x5136('0x11'));var qs=require(_0x5136('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5136('0x13'));var logger=require('../../config/logger')(_0x5136('0x14'));var utils=require(_0x5136('0x15'));var config=require(_0x5136('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x5136('0x17'))['db'];config[_0x5136('0x18')]=_[_0x5136('0x19')](config[_0x5136('0x18')],{'host':_0x5136('0x1a'),'port':0x18eb});var socket=require(_0x5136('0x1b'))(new Redis(config[_0x5136('0x18')]));require(_0x5136('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x5136('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49e37e,_0x577772,_0x3ccfa7,_0x293662){return new BPromise(function(_0x1c0873,_0x33bb70){var _0x1f0e19=_0x293662||client;return _0x1f0e19[_0x5136('0x1e')](_0x49e37e,_0x3ccfa7)[_0x5136('0x1f')](function(_0x529be0){logger[_0x5136('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0x577772,_0x5136('0x21'));logger[_0x5136('0x22')](_0x5136('0x23'),_0x577772,_0x5136('0x21'),JSON['stringify'](_0x529be0));if(_0x529be0['error']){if(_0x529be0['error'][_0x5136('0x24')]===0x1f4){logger['error'](_0x5136('0x25'),_0x577772,_0x529be0['error']['message']);return _0x33bb70(_0x529be0[_0x5136('0x26')][_0x5136('0x27')]);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x577772,_0x529be0[_0x5136('0x26')][_0x5136('0x27')]);return _0x1c0873(_0x529be0['error'][_0x5136('0x27')]);}else{logger[_0x5136('0x20')](_0x5136('0x25'),_0x577772,_0x5136('0x21'));_0x1c0873(_0x529be0[_0x5136('0x28')][_0x5136('0x27')]);}})[_0x5136('0x29')](function(_0x5d0e9e){logger[_0x5136('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x577772,_0x5d0e9e);_0x33bb70(_0x5d0e9e);});});}function respondWithStatusCode(_0x1b8300,_0x5187a0){_0x5187a0=_0x5187a0||0xcc;return function(_0x10d5bf){if(_0x10d5bf){return _0x1b8300[_0x5136('0x2a')](_0x5187a0);}return _0x1b8300[_0x5136('0x2b')](_0x5187a0)[_0x5136('0x2c')]();};}function respondWithResult(_0x5109d8,_0x5411db){_0x5411db=_0x5411db||0xc8;return function(_0x1791e4){if(_0x1791e4){return _0x5109d8[_0x5136('0x2b')](_0x5411db)[_0x5136('0x2d')](_0x1791e4);}};}function respondWithFilteredResult(_0x221693,_0x15a8de){return function(_0x3e59ca){if(_0x3e59ca){var _0x3a4f94=typeof _0x15a8de[_0x5136('0x2e')]===_0x5136('0x2f')&&typeof _0x15a8de[_0x5136('0x30')]===_0x5136('0x2f');var _0x4b5ab4=_0x3e59ca['count'];var _0x3119fb=_0x3a4f94?0x0:_0x15a8de['offset'];var _0x51cc15=_0x3a4f94?_0x3e59ca['count']:_0x15a8de[_0x5136('0x2e')]+_0x15a8de[_0x5136('0x30')];var _0xd6af07;if(_0x51cc15>=_0x4b5ab4){_0x51cc15=_0x4b5ab4;_0xd6af07=0xc8;}else{_0xd6af07=0xce;}_0x221693[_0x5136('0x2b')](_0xd6af07);return _0x221693[_0x5136('0x31')]('Content-Range',_0x3119fb+'-'+_0x51cc15+'/'+_0x4b5ab4)['json'](_0x3e59ca);}return null;};}function patchUpdates(_0x539b0c){return function(_0x4763f7){try{jsonpatch['apply'](_0x4763f7,_0x539b0c,!![]);}catch(_0x538970){return BPromise['reject'](_0x538970);}return _0x4763f7[_0x5136('0x32')]();};}function saveUpdates(_0x5a5a22,_0x5d1422){return function(_0x1161cb){if(_0x1161cb){return _0x1161cb[_0x5136('0x33')](_0x5a5a22)[_0x5136('0x1f')](function(_0x5c4a75){return _0x5c4a75;});}return null;};}function removeEntity(_0x17b802,_0x36872d){return function(_0x3dd864){if(_0x3dd864){return _0x3dd864[_0x5136('0x34')]()['then'](function(){_0x17b802[_0x5136('0x2b')](0xcc)[_0x5136('0x2c')]();});}};}function handleEntityNotFound(_0x183a1a,_0x14019b){return function(_0x5e889e){if(!_0x5e889e){_0x183a1a[_0x5136('0x2a')](0x194);}return _0x5e889e;};}function handleError(_0x11c135,_0x1a1878){_0x1a1878=_0x1a1878||0x1f4;return function(_0x8c921e){logger[_0x5136('0x26')](_0x8c921e[_0x5136('0x35')]);if(_0x8c921e[_0x5136('0x36')]){delete _0x8c921e['name'];}_0x11c135[_0x5136('0x2b')](_0x1a1878)['send'](_0x8c921e);};}exports[_0x5136('0x37')]=function(_0x2af2c6,_0x35ad63){var _0x5046ce={},_0x29868d={},_0x286292={'count':0x0,'rows':[]};var _0x3c5ca8=_['map'](db[_0x5136('0x38')][_0x5136('0x39')],function(_0x21656b){return{'name':_0x21656b[_0x5136('0x3a')],'type':_0x21656b[_0x5136('0x3b')][_0x5136('0x3c')]};});_0x29868d[_0x5136('0x3d')]=_[_0x5136('0x3e')](_0x3c5ca8,_0x5136('0x36'));_0x29868d[_0x5136('0x3f')]=_[_0x5136('0x40')](_0x2af2c6['query']);_0x29868d[_0x5136('0x41')]=_[_0x5136('0x42')](_0x29868d['model'],_0x29868d[_0x5136('0x3f')]);_0x5046ce[_0x5136('0x43')]=_['intersection'](_0x29868d[_0x5136('0x3d')],qs[_0x5136('0x44')](_0x2af2c6[_0x5136('0x3f')][_0x5136('0x44')]));_0x5046ce[_0x5136('0x43')]=_0x5046ce[_0x5136('0x43')][_0x5136('0x45')]?_0x5046ce[_0x5136('0x43')]:_0x29868d[_0x5136('0x3d')];if(!_0x2af2c6[_0x5136('0x3f')][_0x5136('0x46')](_0x5136('0x47'))){_0x5046ce[_0x5136('0x30')]=qs['limit'](_0x2af2c6['query']['limit']);_0x5046ce[_0x5136('0x2e')]=qs['offset'](_0x2af2c6[_0x5136('0x3f')]['offset']);}_0x5046ce[_0x5136('0x48')]=qs['sort'](_0x2af2c6[_0x5136('0x3f')][_0x5136('0x49')]);_0x5046ce[_0x5136('0x4a')]=qs[_0x5136('0x41')](_[_0x5136('0x4b')](_0x2af2c6[_0x5136('0x3f')],_0x29868d['filters']),_0x3c5ca8);if(_0x2af2c6[_0x5136('0x3f')][_0x5136('0x4c')]){_0x5046ce[_0x5136('0x4a')]=_['merge'](_0x5046ce[_0x5136('0x4a')],{'$or':_[_0x5136('0x3e')](_0x3c5ca8,function(_0x27ad1c){if(_0x27ad1c['type']!=='VIRTUAL'){var _0x56fc25={};_0x56fc25[_0x27ad1c[_0x5136('0x36')]]={'$like':'%'+_0x2af2c6[_0x5136('0x3f')][_0x5136('0x4c')]+'%'};return _0x56fc25;}})});}_0x5046ce=_[_0x5136('0x4d')]({},_0x5046ce,_0x2af2c6[_0x5136('0x4e')]);var _0x21f58d={'where':_0x5046ce[_0x5136('0x4a')]};return db[_0x5136('0x38')]['count'](_0x21f58d)[_0x5136('0x1f')](function(_0x3375ba){_0x286292[_0x5136('0x4f')]=_0x3375ba;if(_0x2af2c6['query']['includeAll']){_0x5046ce[_0x5136('0x50')]=[{'all':!![]}];}return db[_0x5136('0x38')][_0x5136('0x51')](_0x5046ce);})['then'](function(_0x1e60f7){_0x286292[_0x5136('0x52')]=_0x1e60f7;return _0x286292;})['then'](respondWithFilteredResult(_0x35ad63,_0x5046ce))[_0x5136('0x29')](handleError(_0x35ad63,null));};exports[_0x5136('0x53')]=function(_0x2eb9f8,_0x51d535){var _0xc836fc={'raw':!![],'where':{'id':_0x2eb9f8[_0x5136('0x54')]['id']}},_0x20e16f={};_0x20e16f['model']=_[_0x5136('0x40')](db[_0x5136('0x38')]['rawAttributes']);_0x20e16f['query']=_[_0x5136('0x40')](_0x2eb9f8[_0x5136('0x3f')]);_0x20e16f['filters']=_[_0x5136('0x42')](_0x20e16f['model'],_0x20e16f[_0x5136('0x3f')]);_0xc836fc[_0x5136('0x43')]=_[_0x5136('0x42')](_0x20e16f['model'],qs['fields'](_0x2eb9f8[_0x5136('0x3f')]['fields']));_0xc836fc[_0x5136('0x43')]=_0xc836fc[_0x5136('0x43')][_0x5136('0x45')]?_0xc836fc[_0x5136('0x43')]:_0x20e16f[_0x5136('0x3d')];if(_0x2eb9f8['query'][_0x5136('0x55')]){_0xc836fc[_0x5136('0x50')]=[{'all':!![]}];}_0xc836fc=_[_0x5136('0x4d')]({},_0xc836fc,_0x2eb9f8[_0x5136('0x4e')]);return db[_0x5136('0x38')]['find'](_0xc836fc)[_0x5136('0x1f')](handleEntityNotFound(_0x51d535,null))[_0x5136('0x1f')](respondWithResult(_0x51d535,null))['catch'](handleError(_0x51d535,null));};exports['create']=function(_0x5b180b,_0x1751a0){return db[_0x5136('0x38')][_0x5136('0x56')](_0x5b180b[_0x5136('0x57')],{})[_0x5136('0x1f')](respondWithResult(_0x1751a0,0xc9))['catch'](handleError(_0x1751a0,null));};exports[_0x5136('0x33')]=function(_0x47b8e0,_0x3a811b){if(_0x47b8e0[_0x5136('0x57')]['id']){delete _0x47b8e0['body']['id'];}return db[_0x5136('0x38')][_0x5136('0x58')]({'where':{'id':_0x47b8e0[_0x5136('0x54')]['id']}})['then'](handleEntityNotFound(_0x3a811b,null))['then'](saveUpdates(_0x47b8e0[_0x5136('0x57')],null))[_0x5136('0x1f')](respondWithResult(_0x3a811b,null))[_0x5136('0x29')](handleError(_0x3a811b,null));};exports[_0x5136('0x34')]=function(_0x455678,_0x265955){return db[_0x5136('0x38')][_0x5136('0x58')]({'where':{'id':_0x455678[_0x5136('0x54')]['id']}})[_0x5136('0x1f')](handleEntityNotFound(_0x265955,null))[_0x5136('0x1f')](removeEntity(_0x265955,null))[_0x5136('0x29')](handleError(_0x265955,null));};exports[_0x5136('0x59')]=function(_0x5175cf,_0x197a30){return db[_0x5136('0x38')][_0x5136('0x59')]()['then'](respondWithResult(_0x197a30,null))[_0x5136('0x29')](handleError(_0x197a30,null));};var interaction_log=require(_0x5136('0x5a'))('openchannel-interactions');exports[_0x5136('0x5b')]=function(_0x4021c0,_0x17ec50,_0x1a4f44){var _0x5d16bc={'agent':{},'channel':_0x5136('0x5c')};if(_0x4021c0[_0x5136('0x57')]['id']){delete _0x4021c0[_0x5136('0x57')]['id'];}_0x4021c0[_0x5136('0x57')]['read']=!![];_0x4021c0[_0x5136('0x57')][_0x5136('0x5d')]=moment()['format'](_0x5136('0x5e'));_0x4021c0['body'][_0x5136('0x5f')]=_0x4021c0[_0x5136('0x57')][_0x5136('0x5f')]||_0x4021c0[_0x5136('0x60')]['id'];_0x5d16bc[_0x5136('0x61')]['id']=_0x4021c0[_0x5136('0x57')][_0x5136('0x5f')];return db[_0x5136('0x38')][_0x5136('0x58')]({'where':{'id':_0x4021c0[_0x5136('0x54')]['id'],'UserId':null}})[_0x5136('0x1f')](handleEntityNotFound(_0x17ec50,null))[_0x5136('0x1f')](saveUpdates(_0x4021c0[_0x5136('0x57')],null))[_0x5136('0x1f')](function(_0x9f63c3){if(_0x9f63c3){_0x5d16bc[_0x5136('0x27')]=_0x9f63c3[_0x5136('0x62')]({'plain':!![]});return db[_0x5136('0x63')]['find']({'where':{'id':_0x9f63c3[_0x5136('0x64')]}});}return null;})[_0x5136('0x1f')](handleEntityNotFound(_0x17ec50,null))[_0x5136('0x1f')](function(_0x351fb5){if(_0x351fb5){return _0x351fb5[_0x5136('0x33')]({'UserId':_0x4021c0[_0x5136('0x57')]['UserId'],'read1stAt':_[_0x5136('0x65')](_0x351fb5[_0x5136('0x66')])?moment()[_0x5136('0x67')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x5136('0x1f')](function(_0x57843a){if(_0x57843a){_0x5d16bc[_0x5136('0x68')]=_0x57843a[_0x5136('0x62')]({'plain':!![]});interaction_log[_0x5136('0x20')](_0x5136('0x69'),_0x4021c0[_0x5136('0x60')]['id'],_0x4021c0[_0x5136('0x60')][_0x5136('0x36')],_0x4021c0[_0x5136('0x60')]['role'],_0x5d16bc[_0x5136('0x68')]['id'],_0x4021c0[_0x5136('0x57')]?JSON[_0x5136('0x6a')](_0x4021c0[_0x5136('0x57')]):_0x5136('0x6b'));return respondWithRpcPromise(_0x5136('0x6c'),_0x5136('0x6d'),_0x5d16bc);}return null;})[_0x5136('0x1f')](function(_0x339a33){var _0x93cdb=_0x5136('0x6e')+_0x339a33['message'][_0x5136('0x6f')];return db['sequelize'][_0x5136('0x3f')](_0x93cdb,{'type':db[_0x5136('0x70')][_0x5136('0x71')][_0x5136('0x72')],'raw':!![]})[_0x5136('0x1f')](function(_0x3e5127){return _0x3e5127;});})['then'](function(_0x1f74ed){if(_0x1f74ed){_0x5d16bc['message'][_0x5136('0x73')]=_0x1f74ed[0x0];if(!_0x4021c0['body'][_0x5136('0x5f')])return;return db[_0x5136('0x74')][_0x5136('0x58')]({'where':{'id':_0x4021c0[_0x5136('0x57')][_0x5136('0x5f')],'role':_0x5136('0x61')},'attributes':['id',_0x5136('0x36'),_0x5136('0x75'),_0x5136('0x76'),_0x5136('0x77')],'raw':!![]});}return null;})[_0x5136('0x1f')](function(_0x5295a8){if(!_0x5295a8)return null;_0x5d16bc[_0x5136('0x27')][_0x5136('0x61')]=_0x5295a8;return _0x5d16bc;})['then'](function(_0x55bf52){if(_0x55bf52){if(_0x4021c0[_0x5136('0x57')][_0x5136('0x78')]){_0x5d16bc[_0x5136('0x27')][_0x5136('0x79')]=util['format']('SIP/%s',_0x4021c0[_0x5136('0x60')][_0x5136('0x36')]);_0x5d16bc[_0x5136('0x27')][_0x5136('0x7a')]=_0x5d16bc['channel'];_0x5d16bc[_0x5136('0x27')][_0x5136('0x7b')]=_0x5d16bc[_0x5136('0x7a')];_0x5d16bc[_0x5136('0x27')]['event']=_0x5136('0x5b');return respondWithRpcPromise(_0x5136('0x7c'),_0x5136('0x7c'),{'event':'acceptmessage','message':_0x5d16bc['message']},client9002)[_0x5136('0x1f')](function(){return _0x5d16bc;});}return _0x5d16bc;}return null;})[_0x5136('0x1f')](respondWithResult(_0x17ec50,null))[_0x5136('0x29')](handleError(_0x17ec50,null));};var interaction_log=require(_0x5136('0x5a'))(_0x5136('0x7d'));exports[_0x5136('0x7e')]=function(_0x41384c,_0xba7be8,_0x4963e0){var _0x179157={'agent':{},'channel':_0x5136('0x5c')};if(_0x41384c['body']['id']){delete _0x41384c['body']['id'];}_0x41384c[_0x5136('0x57')][_0x5136('0x5f')]=_0x41384c[_0x5136('0x57')]['UserId']||_0x41384c[_0x5136('0x60')]['id'];_0x179157[_0x5136('0x61')]['id']=_0x41384c[_0x5136('0x57')][_0x5136('0x5f')];return db[_0x5136('0x38')]['find']({'where':{'id':_0x41384c['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0xba7be8,null))[_0x5136('0x1f')](function(_0x210c53){if(_0x210c53){_0x179157['message']=_0x210c53[_0x5136('0x62')]({'plain':!![]});return db['OpenchannelInteraction'][_0x5136('0x58')]({'where':{'id':_0x210c53[_0x5136('0x64')]}});}return null;})['then'](handleEntityNotFound(_0xba7be8,null))['then'](function(_0x4f6338){if(_0x4f6338){_0x179157[_0x5136('0x68')]=_0x4f6338[_0x5136('0x62')]({'plain':!![]});interaction_log[_0x5136('0x20')](_0x5136('0x7f'),_0x41384c[_0x5136('0x60')]['id'],_0x41384c[_0x5136('0x60')][_0x5136('0x36')],_0x41384c[_0x5136('0x60')][_0x5136('0x80')],_0x179157[_0x5136('0x68')]['id'],_0x41384c[_0x5136('0x57')]?JSON['stringify'](_0x41384c[_0x5136('0x57')]):'null');return respondWithRpcPromise(_0x5136('0x81'),_0x5136('0x82'),_0x179157);}return null;})[_0x5136('0x1f')](function(_0x846d39){var _0x2f3545=_0x5136('0x6e')+_0x846d39['message'][_0x5136('0x6f')];return db[_0x5136('0x83')]['query'](_0x2f3545,{'type':db[_0x5136('0x70')][_0x5136('0x71')][_0x5136('0x72')],'raw':!![]})[_0x5136('0x1f')](function(_0x5328c9){return _0x5328c9;});})['then'](function(_0x70f9c7){if(_0x70f9c7){_0x179157['message'][_0x5136('0x73')]=_0x70f9c7[0x0];if(!_0x41384c[_0x5136('0x57')][_0x5136('0x5f')])return;return db['User']['find']({'where':{'id':_0x41384c[_0x5136('0x57')][_0x5136('0x5f')],'role':_0x5136('0x61')},'attributes':['id',_0x5136('0x36'),'fullname','email',_0x5136('0x77')],'raw':!![]});}return null;})[_0x5136('0x1f')](function(_0x34f050){if(!_0x34f050)return null;_0x179157[_0x5136('0x27')][_0x5136('0x61')]=_0x34f050;return _0x179157;})['then'](function(_0x3b850f){if(_0x3b850f){_0x3b850f[_0x5136('0x27')][_0x5136('0x79')]=util[_0x5136('0x67')]('SIP/%s',_0x41384c[_0x5136('0x60')][_0x5136('0x36')]);_0x3b850f[_0x5136('0x27')][_0x5136('0x7a')]=_0x179157[_0x5136('0x7a')];_0x3b850f[_0x5136('0x27')][_0x5136('0x7b')]=_0x179157[_0x5136('0x7a')];_0x3b850f[_0x5136('0x27')][_0x5136('0x84')]=_0x5136('0x7e');respondWithRpcPromise(_0x5136('0x7c'),_0x5136('0x7c'),{'event':_0x5136('0x85'),'message':_0x3b850f[_0x5136('0x27')]},client9002);return _0x179157;}return null;})[_0x5136('0x1f')](respondWithResult(_0xba7be8,null))[_0x5136('0x29')](handleError(_0xba7be8,null));}; \ No newline at end of file +var _0x0dd7=['merge','type','VIRTUAL','options','OpenchannelMessage','count','include','rows','params','includeAll','find','create','body','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','User','fullname','email','internal','manual','channel','motionChannel','event','EventManager','acceptmessage','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','Sequelize','QueryTypes','SELECT','interface','SIP/%s','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','undefined','offset','limit','Content-Range','json','reject','then','destroy','name','send','index','rawAttributes','fieldName','key','map','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x22dcef,_0xeeec07){var _0x1abcba=function(_0x4c440e){while(--_0x4c440e){_0x22dcef['push'](_0x22dcef['shift']());}};_0x1abcba(++_0xeeec07);}(_0x0dd7,0x140));var _0x70dd=function(_0x3e0763,_0x3d12be){_0x3e0763=_0x3e0763-0x0;var _0x351ca2=_0x0dd7[_0x3e0763];return _0x351ca2;};'use strict';var emlformat=require(_0x70dd('0x0'));var rimraf=require(_0x70dd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x70dd('0x2'));var rp=require(_0x70dd('0x3'));var moment=require(_0x70dd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x70dd('0x5'));var util=require(_0x70dd('0x6'));var path=require(_0x70dd('0x7'));var sox=require(_0x70dd('0x8'));var csv=require(_0x70dd('0x9'));var ejs=require(_0x70dd('0xa'));var fs=require('fs');var fs_extra=require(_0x70dd('0xb'));var _=require(_0x70dd('0xc'));var squel=require('squel');var crypto=require(_0x70dd('0xd'));var jsforce=require(_0x70dd('0xe'));var deskjs=require(_0x70dd('0xf'));var toCsv=require(_0x70dd('0x9'));var querystring=require(_0x70dd('0x10'));var Papa=require(_0x70dd('0x11'));var Redis=require(_0x70dd('0x12'));var authService=require(_0x70dd('0x13'));var qs=require(_0x70dd('0x14'));var as=require(_0x70dd('0x15'));var hardwareService=require(_0x70dd('0x16'));var logger=require(_0x70dd('0x17'))('api');var utils=require(_0x70dd('0x18'));var config=require(_0x70dd('0x19'));var licenseUtil=require(_0x70dd('0x1a'));var db=require(_0x70dd('0x1b'))['db'];config[_0x70dd('0x1c')]=_[_0x70dd('0x1d')](config[_0x70dd('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x70dd('0x1e'))(new Redis(config[_0x70dd('0x1c')]));require(_0x70dd('0x1f'))[_0x70dd('0x20')](socket);var jayson=require(_0x70dd('0x21'));var client=jayson[_0x70dd('0x22')]['http']({'port':0x232c});var client9002=jayson[_0x70dd('0x22')][_0x70dd('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x4c32e6,_0x224b8f,_0x42519c,_0x26cf25){return new BPromise(function(_0x5c33f7,_0xc43f6f){var _0x3bd4ef=_0x26cf25||client;return _0x3bd4ef['request'](_0x4c32e6,_0x42519c)['then'](function(_0x4963fe){logger['info'](_0x70dd('0x24'),_0x224b8f,_0x70dd('0x25'));logger[_0x70dd('0x26')](_0x70dd('0x27'),_0x224b8f,'request\x20sent',JSON[_0x70dd('0x28')](_0x4963fe));if(_0x4963fe['error']){if(_0x4963fe[_0x70dd('0x29')][_0x70dd('0x2a')]===0x1f4){logger['error'](_0x70dd('0x24'),_0x224b8f,_0x4963fe[_0x70dd('0x29')][_0x70dd('0x2b')]);return _0xc43f6f(_0x4963fe[_0x70dd('0x29')][_0x70dd('0x2b')]);}logger[_0x70dd('0x29')](_0x70dd('0x24'),_0x224b8f,_0x4963fe[_0x70dd('0x29')][_0x70dd('0x2b')]);return _0x5c33f7(_0x4963fe[_0x70dd('0x29')][_0x70dd('0x2b')]);}else{logger[_0x70dd('0x2c')](_0x70dd('0x24'),_0x224b8f,_0x70dd('0x25'));_0x5c33f7(_0x4963fe['result'][_0x70dd('0x2b')]);}})[_0x70dd('0x2d')](function(_0x4604af){logger[_0x70dd('0x29')](_0x70dd('0x24'),_0x224b8f,_0x4604af);_0xc43f6f(_0x4604af);});});}function respondWithStatusCode(_0x48a765,_0x532717){_0x532717=_0x532717||0xcc;return function(_0x543367){if(_0x543367){return _0x48a765[_0x70dd('0x2e')](_0x532717);}return _0x48a765[_0x70dd('0x2f')](_0x532717)[_0x70dd('0x30')]();};}function respondWithResult(_0x3ed838,_0x204757){_0x204757=_0x204757||0xc8;return function(_0x3ad674){if(_0x3ad674){return _0x3ed838[_0x70dd('0x2f')](_0x204757)['json'](_0x3ad674);}};}function respondWithFilteredResult(_0x4740fb,_0x210545){return function(_0x1125de){if(_0x1125de){var _0x4d3c92=typeof _0x210545['offset']===_0x70dd('0x31')&&typeof _0x210545['limit']==='undefined';var _0x59e4b4=_0x1125de['count'];var _0x18b7b5=_0x4d3c92?0x0:_0x210545[_0x70dd('0x32')];var _0x2e6aec=_0x4d3c92?_0x1125de['count']:_0x210545['offset']+_0x210545[_0x70dd('0x33')];var _0x3b0e8a;if(_0x2e6aec>=_0x59e4b4){_0x2e6aec=_0x59e4b4;_0x3b0e8a=0xc8;}else{_0x3b0e8a=0xce;}_0x4740fb['status'](_0x3b0e8a);return _0x4740fb['set'](_0x70dd('0x34'),_0x18b7b5+'-'+_0x2e6aec+'/'+_0x59e4b4)[_0x70dd('0x35')](_0x1125de);}return null;};}function patchUpdates(_0x30490d){return function(_0x1e4392){try{jsonpatch['apply'](_0x1e4392,_0x30490d,!![]);}catch(_0x26c60f){return BPromise[_0x70dd('0x36')](_0x26c60f);}return _0x1e4392['save']();};}function saveUpdates(_0x60dd2f,_0x5f28a9){return function(_0x46f5e4){if(_0x46f5e4){return _0x46f5e4['update'](_0x60dd2f)[_0x70dd('0x37')](function(_0x4b27f6){return _0x4b27f6;});}return null;};}function removeEntity(_0x29d9ca,_0x3cbdcb){return function(_0x1a9700){if(_0x1a9700){return _0x1a9700[_0x70dd('0x38')]()[_0x70dd('0x37')](function(){_0x29d9ca['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a3535,_0x1d2f9c){return function(_0x1a44e9){if(!_0x1a44e9){_0x2a3535[_0x70dd('0x2e')](0x194);}return _0x1a44e9;};}function handleError(_0x480dcb,_0x3f6054){_0x3f6054=_0x3f6054||0x1f4;return function(_0x34914e){logger['error'](_0x34914e['stack']);if(_0x34914e[_0x70dd('0x39')]){delete _0x34914e[_0x70dd('0x39')];}_0x480dcb[_0x70dd('0x2f')](_0x3f6054)[_0x70dd('0x3a')](_0x34914e);};}exports[_0x70dd('0x3b')]=function(_0x2321b4,_0x185d51){var _0x484d84={},_0x708b9f={},_0x15565d={'count':0x0,'rows':[]};var _0x21b4e5=_['map'](db['OpenchannelMessage'][_0x70dd('0x3c')],function(_0x3827a5){return{'name':_0x3827a5[_0x70dd('0x3d')],'type':_0x3827a5['type'][_0x70dd('0x3e')]};});_0x708b9f['model']=_[_0x70dd('0x3f')](_0x21b4e5,_0x70dd('0x39'));_0x708b9f['query']=_[_0x70dd('0x40')](_0x2321b4[_0x70dd('0x41')]);_0x708b9f[_0x70dd('0x42')]=_[_0x70dd('0x43')](_0x708b9f[_0x70dd('0x44')],_0x708b9f[_0x70dd('0x41')]);_0x484d84[_0x70dd('0x45')]=_[_0x70dd('0x43')](_0x708b9f[_0x70dd('0x44')],qs[_0x70dd('0x46')](_0x2321b4[_0x70dd('0x41')][_0x70dd('0x46')]));_0x484d84[_0x70dd('0x45')]=_0x484d84[_0x70dd('0x45')][_0x70dd('0x47')]?_0x484d84[_0x70dd('0x45')]:_0x708b9f[_0x70dd('0x44')];if(!_0x2321b4['query'][_0x70dd('0x48')](_0x70dd('0x49'))){_0x484d84[_0x70dd('0x33')]=qs[_0x70dd('0x33')](_0x2321b4[_0x70dd('0x41')][_0x70dd('0x33')]);_0x484d84[_0x70dd('0x32')]=qs[_0x70dd('0x32')](_0x2321b4[_0x70dd('0x41')][_0x70dd('0x32')]);}_0x484d84[_0x70dd('0x4a')]=qs[_0x70dd('0x4b')](_0x2321b4[_0x70dd('0x41')][_0x70dd('0x4b')]);_0x484d84['where']=qs[_0x70dd('0x42')](_[_0x70dd('0x4c')](_0x2321b4['query'],_0x708b9f[_0x70dd('0x42')]),_0x21b4e5);if(_0x2321b4['query'][_0x70dd('0x4d')]){_0x484d84[_0x70dd('0x4e')]=_[_0x70dd('0x4f')](_0x484d84['where'],{'$or':_[_0x70dd('0x3f')](_0x21b4e5,function(_0xc59e37){if(_0xc59e37[_0x70dd('0x50')]!==_0x70dd('0x51')){var _0x2353e4={};_0x2353e4[_0xc59e37[_0x70dd('0x39')]]={'$like':'%'+_0x2321b4['query'][_0x70dd('0x4d')]+'%'};return _0x2353e4;}})});}_0x484d84=_[_0x70dd('0x4f')]({},_0x484d84,_0x2321b4[_0x70dd('0x52')]);var _0x462f54={'where':_0x484d84['where']};return db[_0x70dd('0x53')][_0x70dd('0x54')](_0x462f54)[_0x70dd('0x37')](function(_0x5548bf){_0x15565d[_0x70dd('0x54')]=_0x5548bf;if(_0x2321b4[_0x70dd('0x41')]['includeAll']){_0x484d84[_0x70dd('0x55')]=[{'all':!![]}];}return db[_0x70dd('0x53')]['findAll'](_0x484d84);})[_0x70dd('0x37')](function(_0x54e6bf){_0x15565d[_0x70dd('0x56')]=_0x54e6bf;return _0x15565d;})['then'](respondWithFilteredResult(_0x185d51,_0x484d84))[_0x70dd('0x2d')](handleError(_0x185d51,null));};exports['show']=function(_0x241082,_0x5a4e72){var _0x464d0a={'raw':!![],'where':{'id':_0x241082[_0x70dd('0x57')]['id']}},_0x13d99d={};_0x13d99d[_0x70dd('0x44')]=_[_0x70dd('0x40')](db['OpenchannelMessage'][_0x70dd('0x3c')]);_0x13d99d[_0x70dd('0x41')]=_[_0x70dd('0x40')](_0x241082[_0x70dd('0x41')]);_0x13d99d[_0x70dd('0x42')]=_[_0x70dd('0x43')](_0x13d99d['model'],_0x13d99d[_0x70dd('0x41')]);_0x464d0a[_0x70dd('0x45')]=_[_0x70dd('0x43')](_0x13d99d[_0x70dd('0x44')],qs[_0x70dd('0x46')](_0x241082['query']['fields']));_0x464d0a[_0x70dd('0x45')]=_0x464d0a[_0x70dd('0x45')][_0x70dd('0x47')]?_0x464d0a['attributes']:_0x13d99d[_0x70dd('0x44')];if(_0x241082[_0x70dd('0x41')][_0x70dd('0x58')]){_0x464d0a[_0x70dd('0x55')]=[{'all':!![]}];}_0x464d0a=_[_0x70dd('0x4f')]({},_0x464d0a,_0x241082[_0x70dd('0x52')]);return db[_0x70dd('0x53')][_0x70dd('0x59')](_0x464d0a)[_0x70dd('0x37')](handleEntityNotFound(_0x5a4e72,null))[_0x70dd('0x37')](respondWithResult(_0x5a4e72,null))[_0x70dd('0x2d')](handleError(_0x5a4e72,null));};exports[_0x70dd('0x5a')]=function(_0x1c5a13,_0xe731a6){return db[_0x70dd('0x53')][_0x70dd('0x5a')](_0x1c5a13[_0x70dd('0x5b')],{})[_0x70dd('0x37')](respondWithResult(_0xe731a6,0xc9))[_0x70dd('0x2d')](handleError(_0xe731a6,null));};exports['update']=function(_0x386dcc,_0x3192dd){if(_0x386dcc['body']['id']){delete _0x386dcc[_0x70dd('0x5b')]['id'];}return db[_0x70dd('0x53')][_0x70dd('0x59')]({'where':{'id':_0x386dcc[_0x70dd('0x57')]['id']}})[_0x70dd('0x37')](handleEntityNotFound(_0x3192dd,null))[_0x70dd('0x37')](saveUpdates(_0x386dcc[_0x70dd('0x5b')],null))[_0x70dd('0x37')](respondWithResult(_0x3192dd,null))[_0x70dd('0x2d')](handleError(_0x3192dd,null));};exports[_0x70dd('0x38')]=function(_0x58bce9,_0x29abf7){return db[_0x70dd('0x53')][_0x70dd('0x59')]({'where':{'id':_0x58bce9['params']['id']}})[_0x70dd('0x37')](handleEntityNotFound(_0x29abf7,null))['then'](removeEntity(_0x29abf7,null))[_0x70dd('0x2d')](handleError(_0x29abf7,null));};exports[_0x70dd('0x5c')]=function(_0x4b8c3d,_0x161a87){return db['OpenchannelMessage'][_0x70dd('0x5c')]()[_0x70dd('0x37')](respondWithResult(_0x161a87,null))[_0x70dd('0x2d')](handleError(_0x161a87,null));};var interaction_log=require(_0x70dd('0x17'))(_0x70dd('0x5d'));exports[_0x70dd('0x5e')]=function(_0x292c31,_0x7e8169,_0x543c4d){var _0x53c855={'agent':{},'channel':_0x70dd('0x5f')};if(_0x292c31[_0x70dd('0x5b')]['id']){delete _0x292c31[_0x70dd('0x5b')]['id'];}_0x292c31[_0x70dd('0x5b')][_0x70dd('0x60')]=!![];_0x292c31['body'][_0x70dd('0x61')]=moment()[_0x70dd('0x62')](_0x70dd('0x63'));_0x292c31['body'][_0x70dd('0x64')]=_0x292c31[_0x70dd('0x5b')][_0x70dd('0x64')]||_0x292c31[_0x70dd('0x65')]['id'];_0x53c855[_0x70dd('0x66')]['id']=_0x292c31['body'][_0x70dd('0x64')];return db[_0x70dd('0x53')][_0x70dd('0x59')]({'where':{'id':_0x292c31['params']['id'],'UserId':null}})[_0x70dd('0x37')](handleEntityNotFound(_0x7e8169,null))[_0x70dd('0x37')](saveUpdates(_0x292c31['body'],null))['then'](function(_0x53c2eb){if(_0x53c2eb){_0x53c855[_0x70dd('0x2b')]=_0x53c2eb[_0x70dd('0x67')]({'plain':!![]});return db[_0x70dd('0x68')][_0x70dd('0x59')]({'where':{'id':_0x53c2eb['OpenchannelInteractionId']}});}return null;})[_0x70dd('0x37')](handleEntityNotFound(_0x7e8169,null))['then'](function(_0x54bb82){if(_0x54bb82){return _0x54bb82['update']({'UserId':_0x292c31[_0x70dd('0x5b')][_0x70dd('0x64')],'read1stAt':_[_0x70dd('0x69')](_0x54bb82[_0x70dd('0x6a')])?moment()['format'](_0x70dd('0x63')):undefined});}return null;})[_0x70dd('0x37')](function(_0x5732b7){if(_0x5732b7){_0x53c855[_0x70dd('0x6b')]=_0x5732b7['get']({'plain':!![]});interaction_log[_0x70dd('0x2c')](_0x70dd('0x6c'),_0x292c31[_0x70dd('0x65')]['id'],_0x292c31[_0x70dd('0x65')][_0x70dd('0x39')],_0x292c31[_0x70dd('0x65')]['role'],_0x53c855[_0x70dd('0x6b')]['id'],_0x292c31['body']?JSON[_0x70dd('0x28')](_0x292c31[_0x70dd('0x5b')]):'null');return respondWithRpcPromise(_0x70dd('0x6d'),'acceptMessage',_0x53c855);}return null;})[_0x70dd('0x37')](function(_0x3bac0d){var _0x3c9ec9=_0x70dd('0x6e')+_0x3bac0d[_0x70dd('0x2b')][_0x70dd('0x6f')];return db[_0x70dd('0x70')][_0x70dd('0x41')](_0x3c9ec9,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x70dd('0x37')](function(_0x122f65){return _0x122f65;});})[_0x70dd('0x37')](function(_0x49483d){if(_0x49483d){_0x53c855['message']['contact']=_0x49483d[0x0];if(!_0x292c31['body'][_0x70dd('0x64')])return;return db[_0x70dd('0x71')][_0x70dd('0x59')]({'where':{'id':_0x292c31[_0x70dd('0x5b')][_0x70dd('0x64')],'role':_0x70dd('0x66')},'attributes':['id',_0x70dd('0x39'),_0x70dd('0x72'),_0x70dd('0x73'),_0x70dd('0x74')],'raw':!![]});}return null;})[_0x70dd('0x37')](function(_0x457d90){if(!_0x457d90)return null;_0x53c855[_0x70dd('0x2b')]['agent']=_0x457d90;return _0x53c855;})[_0x70dd('0x37')](function(_0x134276){if(_0x134276){if(_0x292c31[_0x70dd('0x5b')][_0x70dd('0x75')]){_0x53c855[_0x70dd('0x2b')]['interface']=util[_0x70dd('0x62')]('SIP/%s',_0x292c31[_0x70dd('0x65')][_0x70dd('0x39')]);_0x53c855[_0x70dd('0x2b')][_0x70dd('0x76')]=_0x53c855[_0x70dd('0x76')];_0x53c855[_0x70dd('0x2b')][_0x70dd('0x77')]=_0x53c855['channel'];_0x53c855[_0x70dd('0x2b')][_0x70dd('0x78')]=_0x70dd('0x5e');return respondWithRpcPromise(_0x70dd('0x79'),'EventManager',{'event':_0x70dd('0x7a'),'message':_0x53c855[_0x70dd('0x2b')]},client9002)['then'](function(){return _0x53c855;});}return _0x53c855;}return null;})['then'](respondWithResult(_0x7e8169,null))[_0x70dd('0x2d')](handleError(_0x7e8169,null));};var interaction_log=require(_0x70dd('0x17'))(_0x70dd('0x5d'));exports['reject']=function(_0x38560f,_0x27ba94,_0x42107a){var _0x5111d5={'agent':{},'channel':_0x70dd('0x5f')};if(_0x38560f[_0x70dd('0x5b')]['id']){delete _0x38560f[_0x70dd('0x5b')]['id'];}_0x38560f[_0x70dd('0x5b')]['UserId']=_0x38560f[_0x70dd('0x5b')][_0x70dd('0x64')]||_0x38560f[_0x70dd('0x65')]['id'];_0x5111d5['agent']['id']=_0x38560f[_0x70dd('0x5b')]['UserId'];return db[_0x70dd('0x53')][_0x70dd('0x59')]({'where':{'id':_0x38560f[_0x70dd('0x57')]['id'],'UserId':null}})[_0x70dd('0x37')](handleEntityNotFound(_0x27ba94,null))[_0x70dd('0x37')](function(_0x5cf8a4){if(_0x5cf8a4){_0x5111d5[_0x70dd('0x2b')]=_0x5cf8a4[_0x70dd('0x67')]({'plain':!![]});return db['OpenchannelInteraction'][_0x70dd('0x59')]({'where':{'id':_0x5cf8a4[_0x70dd('0x7b')]}});}return null;})[_0x70dd('0x37')](handleEntityNotFound(_0x27ba94,null))[_0x70dd('0x37')](function(_0x16d50a){if(_0x16d50a){_0x5111d5[_0x70dd('0x6b')]=_0x16d50a[_0x70dd('0x67')]({'plain':!![]});interaction_log[_0x70dd('0x2c')](_0x70dd('0x7c'),_0x38560f[_0x70dd('0x65')]['id'],_0x38560f[_0x70dd('0x65')][_0x70dd('0x39')],_0x38560f['user'][_0x70dd('0x7d')],_0x5111d5[_0x70dd('0x6b')]['id'],_0x38560f[_0x70dd('0x5b')]?JSON[_0x70dd('0x28')](_0x38560f['body']):_0x70dd('0x7e'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x5111d5);}return null;})[_0x70dd('0x37')](function(_0x16143d){var _0x370476=_0x70dd('0x6e')+_0x16143d[_0x70dd('0x2b')]['ContactId'];return db[_0x70dd('0x70')][_0x70dd('0x41')](_0x370476,{'type':db[_0x70dd('0x7f')][_0x70dd('0x80')][_0x70dd('0x81')],'raw':!![]})['then'](function(_0x4eb22a){return _0x4eb22a;});})['then'](function(_0x3b9e52){if(_0x3b9e52){_0x5111d5[_0x70dd('0x2b')]['contact']=_0x3b9e52[0x0];if(!_0x38560f[_0x70dd('0x5b')][_0x70dd('0x64')])return;return db[_0x70dd('0x71')]['find']({'where':{'id':_0x38560f[_0x70dd('0x5b')][_0x70dd('0x64')],'role':_0x70dd('0x66')},'attributes':['id','name',_0x70dd('0x72'),_0x70dd('0x73'),_0x70dd('0x74')],'raw':!![]});}return null;})[_0x70dd('0x37')](function(_0x305b6b){if(!_0x305b6b)return null;_0x5111d5[_0x70dd('0x2b')]['agent']=_0x305b6b;return _0x5111d5;})['then'](function(_0x1c250a){if(_0x1c250a){_0x1c250a['message'][_0x70dd('0x82')]=util[_0x70dd('0x62')](_0x70dd('0x83'),_0x38560f['user']['name']);_0x1c250a[_0x70dd('0x2b')][_0x70dd('0x76')]=_0x5111d5[_0x70dd('0x76')];_0x1c250a[_0x70dd('0x2b')][_0x70dd('0x77')]=_0x5111d5[_0x70dd('0x76')];_0x1c250a[_0x70dd('0x2b')]['event']=_0x70dd('0x36');respondWithRpcPromise('EventManager','EventManager',{'event':_0x70dd('0x84'),'message':_0x1c250a[_0x70dd('0x2b')]},client9002);return _0x5111d5;}return null;})[_0x70dd('0x37')](respondWithResult(_0x27ba94,null))['catch'](handleError(_0x27ba94,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 439b970..45f83ce 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 _0xfbe0=['exports','../../mysqldb','save','remove','emit','hasOwnProperty'];(function(_0x3a23d2,_0x8fa0b8){var _0x53cc22=function(_0x16f6e7){while(--_0x16f6e7){_0x3a23d2['push'](_0x3a23d2['shift']());}};_0x53cc22(++_0x8fa0b8);}(_0xfbe0,0x79));var _0x0fbe=function(_0x4581da,_0x25443e){_0x4581da=_0x4581da-0x0;var _0x4fd8f3=_0xfbe0[_0x4581da];return _0x4fd8f3;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x0fbe('0x0'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0fbe('0x1'),'afterUpdate':'update','afterDestroy':_0x0fbe('0x2')};function emitEvent(_0x3fcceb){return function(_0xee0e8d,_0xa5f77e,_0x1a91de){OpenchannelMessageEvents[_0x0fbe('0x3')](_0x3fcceb+':'+_0xee0e8d['id'],_0xee0e8d);OpenchannelMessageEvents[_0x0fbe('0x3')](_0x3fcceb,_0xee0e8d);_0x1a91de(null);};}for(var e in events){if(events[_0x0fbe('0x4')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0x0fbe('0x5')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x1fda=['update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x1fda,0x19b));var _0xa1fd=function(_0x50f697,_0x11e9cf){_0x50f697=_0x50f697-0x0;var _0x46e0cb=_0x1fda[_0x50f697];return _0x46e0cb;};'use strict';var EventEmitter=require(_0xa1fd('0x0'));var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xa1fd('0x1')](0x0);var events={'afterCreate':_0xa1fd('0x2'),'afterUpdate':_0xa1fd('0x3'),'afterDestroy':_0xa1fd('0x4')};function emitEvent(_0x314b78){return function(_0x26fe0e,_0x8175a0,_0x1056c8){OpenchannelMessageEvents['emit'](_0x314b78+':'+_0x26fe0e['id'],_0x26fe0e);OpenchannelMessageEvents[_0xa1fd('0x5')](_0x314b78,_0x26fe0e);_0x1056c8(null);};}for(var e in events){if(events[_0xa1fd('0x6')](e)){var event=events[e];OpenchannelMessage[_0xa1fd('0x7')](e,emitEvent(event));}}module[_0xa1fd('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 76aacf9..07f981c 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 _0x2b43=['rimraf','../../config/environment','exports','OpenchannelMessage','fti_openchannel_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId','OpenchannelInteraction','findOne','update','createdAt','error','CmContact','describe','then','OpenchannelAccount','OpenchannelAccountId','Interactions','OpenchannelInteractionId','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','format','Forwarding\x20message\x20%d\x20to\x20%s','length','omit','POST','method','Message\x20%d\x20forwarded\x20to\x20%s','threadId','afterCreate','inspect','finally','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0xa7811e,_0x26ec72){var _0x1f8f8c=function(_0x5c296c){while(--_0x5c296c){_0xa7811e['push'](_0xa7811e['shift']());}};_0x1f8f8c(++_0x26ec72);}(_0x2b43,0xc4));var _0x32b4=function(_0x308183,_0x6819f9){_0x308183=_0x308183-0x0;var _0x5308ff=_0x2b43[_0x308183];return _0x5308ff;};'use strict';var _=require(_0x32b4('0x0'));var util=require(_0x32b4('0x1'));var logger=require(_0x32b4('0x2'))(_0x32b4('0x3'));var moment=require(_0x32b4('0x4'));var BPromise=require(_0x32b4('0x5'));var rp=require(_0x32b4('0x6'));var fs=require('fs');var path=require(_0x32b4('0x7'));var rimraf=require(_0x32b4('0x8'));var config=require(_0x32b4('0x9'));var attributes=require('./openchannelMessage.attributes');module[_0x32b4('0xa')]=function(_0x4e73a7,_0x46c103){return _0x4e73a7['define'](_0x32b4('0xb'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x32b4('0xc'),'fields':[_0x32b4('0xd')],'type':_0x32b4('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5e117e,_0xa2f0e1,_0xcd2819){var _0x3c5566=_0x4e73a7[_0x32b4('0xf')];var _0x309cfb=_0x5e117e[_0x32b4('0x10')]({'plain':!![]});if(_0x309cfb['direction'][_0x32b4('0x11')]()==='in'||_0x309cfb[_0x32b4('0x12')][_0x32b4('0x11')]()===_0x32b4('0x13')&&!_0x309cfb[_0x32b4('0x14')]&&!_[_0x32b4('0x15')](_0x309cfb[_0x32b4('0x16')])){_0x3c5566[_0x32b4('0x17')][_0x32b4('0x18')]({'where':{'id':_0x309cfb['OpenchannelInteractionId']}})['then'](function(_0xc9b8e9){if(_0xc9b8e9){_0xc9b8e9[_0x32b4('0x19')]({'lastMsgAt':_0x309cfb[_0x32b4('0x1a')],'lastMsgDirection':_0x309cfb[_0x32b4('0x12')][_0x32b4('0x11')]()});}})['catch'](function(_0x5d301c){console[_0x32b4('0x1b')](_0x5d301c);});}if(_0x309cfb[_0x32b4('0x12')]==='out'&&!_0x309cfb[_0x32b4('0x14')]){var _0x377cb5;_0x3c5566[_0x32b4('0x1c')][_0x32b4('0x1d')]()[_0x32b4('0x1e')](function(_0x26197e){return _0x3c5566[_0x32b4('0x1f')]['find']({'where':{'id':_0x309cfb[_0x32b4('0x20')]},'include':[{'model':_0x3c5566[_0x32b4('0x17')],'as':_0x32b4('0x21'),'where':{'id':_0x309cfb[_0x32b4('0x22')]},'limit':0x1,'include':[{'model':_0x3c5566[_0x32b4('0x1c')],'as':_0x32b4('0x23'),'attributes':_[_0x32b4('0x24')](_0x26197e)}]}]});})['then'](function(_0x38bc48){_0x377cb5=_0x38bc48[_0x32b4('0x10')]({'plain':!![]});if(_0x377cb5&&_0x377cb5[_0x32b4('0x25')]){logger[_0x32b4('0x26')](_0x32b4('0x27'),'afterCreate',util[_0x32b4('0x28')](_0x32b4('0x29'),_0x309cfb['id'],_0x377cb5[_0x32b4('0x25')]));if(_0x377cb5[_0x32b4('0x21')]&&_0x377cb5[_0x32b4('0x21')][_0x32b4('0x2a')]){_0x309cfb['Interaction']=_[_0x32b4('0x2b')](_0x377cb5['Interactions'][0x0],_0x32b4('0x23'));_0x309cfb[_0x32b4('0x23')]=_0x377cb5['Interactions'][0x0][_0x32b4('0x23')];}var _0xa2f0e1={'method':_0x32b4('0x2c'),'uri':encodeURI(_0x377cb5[_0x32b4('0x25')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0xa2f0e1[_0x32b4('0x2d')]){case'GET':_0xa2f0e1['qs']=_0x309cfb;break;case _0x32b4('0x2c'):_0xa2f0e1[_0x32b4('0xd')]=_0x309cfb;break;}return rp(_0xa2f0e1)[_0x32b4('0x1e')](function(_0x2b2e5f){logger[_0x32b4('0x26')](_0x32b4('0x27'),'afterCreate',util[_0x32b4('0x28')](_0x32b4('0x2e'),_0x309cfb['id'],_0x377cb5[_0x32b4('0x25')]));if(_0x2b2e5f['body'][_0x32b4('0x2f')]&&_0x2b2e5f[_0x32b4('0xd')]['threadId']!=_0x309cfb['Interaction'][_0x32b4('0x2f')]){return _0x3c5566[_0x32b4('0x17')][_0x32b4('0x19')]({'threadId':_0x2b2e5f[_0x32b4('0xd')][_0x32b4('0x2f')]},{'where':{'id':_0x309cfb['Interaction']['id']}});}else{return;}})[_0x32b4('0x1e')](function(){return _0x5e117e[_0x32b4('0x19')]({'read':!![]});})['catch'](function(_0x2bba3f){logger[_0x32b4('0x1b')](_0x32b4('0x27'),_0x32b4('0x30'),util[_0x32b4('0x31')](_0x2bba3f,{'showHidden':![],'depth':null}));_0xcd2819();});}else{_0xcd2819();}})[_0x32b4('0x32')](function(){_0xcd2819();});}else{_0xcd2819();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x32d2=['catch','error','out','describe','find','Interactions','CmContact','Contact','keys','then','get','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','GET','body','info','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','define','OpenchannelMessage','openchannel_messages','FULLTEXT','models','direction','toLowerCase','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','update'];(function(_0xe501ff,_0x955b7e){var _0x17135d=function(_0x8e3458){while(--_0x8e3458){_0xe501ff['push'](_0xe501ff['shift']());}};_0x17135d(++_0x955b7e);}(_0x32d2,0x1b5));var _0x232d=function(_0x46fa93,_0x4c1659){_0x46fa93=_0x46fa93-0x0;var _0x13f9fd=_0x32d2[_0x46fa93];return _0x13f9fd;};'use strict';var _=require('lodash');var util=require(_0x232d('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x232d('0x1'));var BPromise=require(_0x232d('0x2'));var rp=require(_0x232d('0x3'));var fs=require('fs');var path=require(_0x232d('0x4'));var rimraf=require(_0x232d('0x5'));var config=require(_0x232d('0x6'));var attributes=require(_0x232d('0x7'));module['exports']=function(_0x4a57d5,_0x50ac23){return _0x4a57d5[_0x232d('0x8')](_0x232d('0x9'),attributes,{'tableName':_0x232d('0xa'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':['body'],'type':_0x232d('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4b2d57,_0x54a997,_0xc74640){var _0x196789=_0x4a57d5[_0x232d('0xc')];var _0x972b2d=_0x4b2d57['get']({'plain':!![]});if(_0x972b2d[_0x232d('0xd')][_0x232d('0xe')]()==='in'||_0x972b2d['direction'][_0x232d('0xe')]()==='out'&&!_0x972b2d[_0x232d('0xf')]&&!_[_0x232d('0x10')](_0x972b2d[_0x232d('0x11')])){_0x196789[_0x232d('0x12')][_0x232d('0x13')]({'where':{'id':_0x972b2d[_0x232d('0x14')]}})['then'](function(_0x43eb47){if(_0x43eb47){_0x43eb47[_0x232d('0x15')]({'lastMsgAt':_0x972b2d['createdAt'],'lastMsgDirection':_0x972b2d[_0x232d('0xd')][_0x232d('0xe')]()});}})[_0x232d('0x16')](function(_0x144e72){console[_0x232d('0x17')](_0x144e72);});}if(_0x972b2d[_0x232d('0xd')]===_0x232d('0x18')&&!_0x972b2d[_0x232d('0xf')]){var _0xcee8d0;_0x196789['CmContact'][_0x232d('0x19')]()['then'](function(_0x5db108){return _0x196789['OpenchannelAccount'][_0x232d('0x1a')]({'where':{'id':_0x972b2d['OpenchannelAccountId']},'include':[{'model':_0x196789[_0x232d('0x12')],'as':_0x232d('0x1b'),'where':{'id':_0x972b2d[_0x232d('0x14')]},'limit':0x1,'include':[{'model':_0x196789[_0x232d('0x1c')],'as':_0x232d('0x1d'),'attributes':_[_0x232d('0x1e')](_0x5db108)}]}]});})[_0x232d('0x1f')](function(_0xff6a85){_0xcee8d0=_0xff6a85[_0x232d('0x20')]({'plain':!![]});if(_0xcee8d0&&_0xcee8d0[_0x232d('0x21')]){logger['info'](_0x232d('0x22'),_0x232d('0x23'),util['format'](_0x232d('0x24'),_0x972b2d['id'],_0xcee8d0[_0x232d('0x21')]));if(_0xcee8d0[_0x232d('0x1b')]&&_0xcee8d0[_0x232d('0x1b')][_0x232d('0x25')]){_0x972b2d[_0x232d('0x26')]=_[_0x232d('0x27')](_0xcee8d0[_0x232d('0x1b')][0x0],_0x232d('0x1d'));_0x972b2d[_0x232d('0x1d')]=_0xcee8d0[_0x232d('0x1b')][0x0][_0x232d('0x1d')];}var _0x54a997={'method':_0x232d('0x28'),'uri':encodeURI(_0xcee8d0[_0x232d('0x21')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x54a997[_0x232d('0x29')]){case _0x232d('0x2a'):_0x54a997['qs']=_0x972b2d;break;case _0x232d('0x28'):_0x54a997[_0x232d('0x2b')]=_0x972b2d;break;}return rp(_0x54a997)[_0x232d('0x1f')](function(_0x19adc1){logger[_0x232d('0x2c')](_0x232d('0x22'),_0x232d('0x23'),util[_0x232d('0x2d')](_0x232d('0x2e'),_0x972b2d['id'],_0xcee8d0['replyUri']));if(_0x19adc1['body'][_0x232d('0x2f')]&&_0x19adc1[_0x232d('0x2b')][_0x232d('0x2f')]!=_0x972b2d['Interaction'][_0x232d('0x2f')]){return _0x196789[_0x232d('0x12')]['update']({'threadId':_0x19adc1[_0x232d('0x2b')][_0x232d('0x2f')]},{'where':{'id':_0x972b2d[_0x232d('0x26')]['id']}});}else{return;}})[_0x232d('0x1f')](function(){return _0x4b2d57['update']({'read':!![]});})[_0x232d('0x16')](function(_0x4f425d){logger['error'](_0x232d('0x22'),_0x232d('0x23'),util[_0x232d('0x30')](_0x4f425d,{'showHidden':![],'depth':null}));_0xc74640();});}else{_0xc74640();}})[_0x232d('0x31')](function(){_0xc74640();});}else{_0xc74640();}}},'charset':_0x232d('0x32'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index e7d0edb..4f9af53 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 _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x25cae6,_0x8ebfe8){var _0x386010=function(_0x1a6f34){while(--_0x1a6f34){_0x25cae6['push'](_0x25cae6['shift']());}};_0x386010(++_0x8ebfe8);}(_0xadb5,0xad));var _0x5adb=function(_0x4d450c,_0x5de4f3){_0x4d450c=_0x4d450c-0x0;var _0xbf11e=_0xadb5[_0x4d450c];return _0xbf11e;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file +var _0xdb28=['then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','request'];(function(_0xc55d64,_0x133f2d){var _0x4194f6=function(_0x4a38c9){while(--_0x4a38c9){_0xc55d64['push'](_0xc55d64['shift']());}};_0x4194f6(++_0x133f2d);}(_0xdb28,0x106));var _0x8db2=function(_0x1ab0ff,_0x5d82a3){_0x1ab0ff=_0x1ab0ff-0x0;var _0x4406f6=_0xdb28[_0x1ab0ff];return _0x4406f6;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8db2('0xb')](config[_0x8db2('0xc')],{'host':_0x8db2('0xd'),'port':0x18eb});var socket=require(_0x8db2('0xe'))(new Redis(config[_0x8db2('0xc')]));require(_0x8db2('0xf'))[_0x8db2('0x10')](socket);function respondWithRpcPromise(_0x4ba340,_0x30dc90,_0x476216){return new BPromise(function(_0x1f62af,_0x57015f){return client[_0x8db2('0x11')](_0x4ba340,_0x476216)[_0x8db2('0x12')](function(_0x576475){logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));logger[_0x8db2('0x16')](_0x8db2('0x17'),_0x30dc90,'request\x20sent',JSON['stringify'](_0x576475));if(_0x576475[_0x8db2('0x18')]){if(_0x576475[_0x8db2('0x18')][_0x8db2('0x19')]===0x1f4){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x57015f(_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);}logger[_0x8db2('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x30dc90,_0x576475[_0x8db2('0x18')][_0x8db2('0x1a')]);return _0x1f62af(_0x576475['error'][_0x8db2('0x1a')]);}else{logger[_0x8db2('0x13')](_0x8db2('0x14'),_0x30dc90,_0x8db2('0x15'));_0x1f62af(_0x576475[_0x8db2('0x1b')][_0x8db2('0x1a')]);}})['catch'](function(_0x5df464){logger[_0x8db2('0x18')](_0x8db2('0x14'),_0x30dc90,_0x5df464);_0x57015f(_0x5df464);});});}exports[_0x8db2('0x1c')]=function(_0x1b64e4){var _0x58562e=this;return new Promise(function(_0x431d60,_0x36a9ff){return db[_0x8db2('0x1d')][_0x8db2('0x1e')](_0x1b64e4[_0x8db2('0x1f')],{'raw':_0x1b64e4['options']?_0x1b64e4[_0x8db2('0x20')][_0x8db2('0x21')]===undefined?!![]:![]:!![]})[_0x8db2('0x12')](function(_0x125be2){logger[_0x8db2('0x13')](_0x8db2('0x1c'),_0x1b64e4);logger[_0x8db2('0x16')]('CreateOpenchannelMessage',_0x1b64e4,JSON[_0x8db2('0x22')](_0x125be2));_0x431d60(_0x125be2);})['catch'](function(_0x5725f0){logger['error']('CreateOpenchannelMessage',_0x5725f0[_0x8db2('0x1a')],_0x1b64e4);_0x36a9ff(_0x58562e[_0x8db2('0x18')](0x1f4,_0x5725f0[_0x8db2('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 88b0622..319612c 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 _0xd45e=['openchannelMessage:','save','remove','emit','removeListener','register','length'];(function(_0x4ce46c,_0x3002e5){var _0x132542=function(_0x3e8d5f){while(--_0x3e8d5f){_0x4ce46c['push'](_0x4ce46c['shift']());}};_0x132542(++_0x3002e5);}(_0xd45e,0x182));var _0xed45=function(_0x552ea5,_0x28c15c){_0x552ea5=_0x552ea5-0x0;var _0x34dc4a=_0xd45e[_0x552ea5];return _0x34dc4a;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xed45('0x0'),_0xed45('0x1'),'update'];function createListener(_0x2d14c4,_0x5591e8){return function(_0x18aa20){_0x5591e8[_0xed45('0x2')](_0x2d14c4,_0x18aa20);};}function removeListener(_0x9c1494,_0x5667ca){return function(){OpenchannelMessageEvents[_0xed45('0x3')](_0x9c1494,_0x5667ca);};}exports[_0xed45('0x4')]=function(_0x5332aa){for(var _0x528ca3=0x0,_0x3185ae=events[_0xed45('0x5')];_0x528ca3<_0x3185ae;_0x528ca3++){var _0x4afe6c=events[_0x528ca3];var _0x380a8=createListener(_0xed45('0x6')+_0x4afe6c,_0x5332aa);OpenchannelMessageEvents['on'](_0x4afe6c,_0x380a8);}}; \ No newline at end of file +var _0x1b94=['register','length','openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener'];(function(_0x2c3048,_0x58b4fb){var _0x5c844d=function(_0x1886fa){while(--_0x1886fa){_0x2c3048['push'](_0x2c3048['shift']());}};_0x5c844d(++_0x58b4fb);}(_0x1b94,0x1f2));var _0x41b9=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x1b94[_0x4ff09b];return _0x3f5c2e;};'use strict';var OpenchannelMessageEvents=require(_0x41b9('0x0'));var events=[_0x41b9('0x1'),_0x41b9('0x2'),_0x41b9('0x3')];function createListener(_0x29b996,_0x4b456b){return function(_0x132025){_0x4b456b[_0x41b9('0x4')](_0x29b996,_0x132025);};}function removeListener(_0x864f17,_0x57f10c){return function(){OpenchannelMessageEvents[_0x41b9('0x5')](_0x864f17,_0x57f10c);};}exports[_0x41b9('0x6')]=function(_0x368c00){for(var _0x5e58d8=0x0,_0x310fd8=events[_0x41b9('0x7')];_0x5e58d8<_0x310fd8;_0x5e58d8++){var _0x2a0eed=events[_0x5e58d8];var _0x37b187=createListener(_0x41b9('0x8')+_0x2a0eed,_0x368c00);OpenchannelMessageEvents['on'](_0x2a0eed,_0x37b187);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 5f0c8cd..f087f75 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 _0xc95a=['post','/:id/users','addAgents','put','update','delete','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','create'];(function(_0x131883,_0x4e747a){var _0x3c64f2=function(_0x323363){while(--_0x323363){_0x131883['push'](_0x131883['shift']());}};_0x3c64f2(++_0x4e747a);}(_0xc95a,0x85));var _0xac95=function(_0x4dea50,_0x5869ce){_0x4dea50=_0x4dea50-0x0;var _0x29db7c=_0xc95a[_0x4dea50];return _0x29db7c;};'use strict';var multer=require('multer');var util=require(_0xac95('0x0'));var path=require(_0xac95('0x1'));var timeout=require(_0xac95('0x2'));var express=require(_0xac95('0x3'));var router=express[_0xac95('0x4')]();var fs_extra=require(_0xac95('0x5'));var auth=require(_0xac95('0x6'));var interaction=require(_0xac95('0x7'));var config=require(_0xac95('0x8'));var controller=require(_0xac95('0x9'));router[_0xac95('0xa')]('/',auth[_0xac95('0xb')](),controller[_0xac95('0xc')]);router[_0xac95('0xa')](_0xac95('0xd'),auth[_0xac95('0xb')](),controller['describe']);router[_0xac95('0xa')](_0xac95('0xe'),auth['isAuthenticated'](),controller[_0xac95('0xf')]);router[_0xac95('0xa')](_0xac95('0x10'),auth[_0xac95('0xb')](),controller[_0xac95('0x11')]);router[_0xac95('0xa')](_0xac95('0x12'),auth[_0xac95('0xb')](),controller[_0xac95('0x13')]);router[_0xac95('0xa')]('/:id/users',auth[_0xac95('0xb')](),controller[_0xac95('0x14')]);router['post']('/',auth[_0xac95('0xb')](),controller[_0xac95('0x15')]);router['post'](_0xac95('0x12'),auth[_0xac95('0xb')](),controller['addTeams']);router[_0xac95('0x16')](_0xac95('0x17'),auth['isAuthenticated'](),controller[_0xac95('0x18')]);router[_0xac95('0x19')]('/:id',auth[_0xac95('0xb')](),controller[_0xac95('0x1a')]);router[_0xac95('0x1b')](_0xac95('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0xac95('0x1b')](_0xac95('0x12'),auth['isAuthenticated'](),controller[_0xac95('0x1c')]);router[_0xac95('0x1b')](_0xac95('0x17'),auth[_0xac95('0xb')](),controller[_0xac95('0x1d')]);module[_0xac95('0x1e')]=router; \ No newline at end of file +var _0xf965=['../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','put','destroy','delete','removeTeams','removeAgents','exports','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x5d225a,_0x2debe9){var _0x1e7761=function(_0x491dc2){while(--_0x491dc2){_0x5d225a['push'](_0x5d225a['shift']());}};_0x1e7761(++_0x2debe9);}(_0xf965,0x124));var _0x5f96=function(_0x1aa3ce,_0x453b5a){_0x1aa3ce=_0x1aa3ce-0x0;var _0x3fb000=_0xf965[_0x1aa3ce];return _0x3fb000;};'use strict';var multer=require('multer');var util=require(_0x5f96('0x0'));var path=require('path');var timeout=require(_0x5f96('0x1'));var express=require(_0x5f96('0x2'));var router=express['Router']();var fs_extra=require(_0x5f96('0x3'));var auth=require(_0x5f96('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x5f96('0x5'));var controller=require(_0x5f96('0x6'));router[_0x5f96('0x7')]('/',auth[_0x5f96('0x8')](),controller[_0x5f96('0x9')]);router[_0x5f96('0x7')]('/describe',auth[_0x5f96('0x8')](),controller[_0x5f96('0xa')]);router[_0x5f96('0x7')](_0x5f96('0xb'),auth['isAuthenticated'](),controller[_0x5f96('0xc')]);router[_0x5f96('0x7')](_0x5f96('0xd'),auth[_0x5f96('0x8')](),controller['getMembers']);router[_0x5f96('0x7')](_0x5f96('0xe'),auth[_0x5f96('0x8')](),controller[_0x5f96('0xf')]);router[_0x5f96('0x7')](_0x5f96('0x10'),auth[_0x5f96('0x8')](),controller[_0x5f96('0x11')]);router[_0x5f96('0x12')]('/',auth[_0x5f96('0x8')](),controller['create']);router[_0x5f96('0x12')](_0x5f96('0xe'),auth['isAuthenticated'](),controller[_0x5f96('0x13')]);router[_0x5f96('0x12')]('/:id/users',auth[_0x5f96('0x8')](),controller[_0x5f96('0x14')]);router[_0x5f96('0x15')]('/:id',auth[_0x5f96('0x8')](),controller['update']);router['delete'](_0x5f96('0xb'),auth['isAuthenticated'](),controller[_0x5f96('0x16')]);router[_0x5f96('0x17')](_0x5f96('0xe'),auth[_0x5f96('0x8')](),controller[_0x5f96('0x18')]);router['delete'](_0x5f96('0x10'),auth[_0x5f96('0x8')](),controller[_0x5f96('0x19')]);module[_0x5f96('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 8444ba1..2b95952 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 _0xcb74=['INTEGER','ENUM','rrmemory','roundrobin','sequelize','exports','STRING','name'];(function(_0x5a8b46,_0x5d1e8c){var _0x459fad=function(_0x529340){while(--_0x529340){_0x5a8b46['push'](_0x5a8b46['shift']());}};_0x459fad(++_0x5d1e8c);}(_0xcb74,0xfc));var _0x4cb7=function(_0x2b9633,_0x517eed){_0x2b9633=_0x2b9633-0x0;var _0x438405=_0xcb74[_0x2b9633];return _0x438405;};'use strict';var Sequelize=require(_0x4cb7('0x0'));module[_0x4cb7('0x1')]={'name':{'type':Sequelize[_0x4cb7('0x2')],'unique':_0x4cb7('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4cb7('0x2')]},'timeout':{'type':Sequelize[_0x4cb7('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4cb7('0x5')](_0x4cb7('0x6'),'beepall',_0x4cb7('0x7'))}}; \ No newline at end of file +var _0x56bb=['roundrobin','exports','STRING','ENUM','rrmemory','beepall'];(function(_0x56da68,_0x597118){var _0x4003d5=function(_0x4d3042){while(--_0x4d3042){_0x56da68['push'](_0x56da68['shift']());}};_0x4003d5(++_0x597118);}(_0x56bb,0x175));var _0xb56b=function(_0x1bb174,_0x4db38c){_0x1bb174=_0x1bb174-0x0;var _0x2caaba=_0x56bb[_0x1bb174];return _0x2caaba;};'use strict';var Sequelize=require('sequelize');module[_0xb56b('0x0')]={'name':{'type':Sequelize[_0xb56b('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb56b('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb56b('0x2')](_0xb56b('0x3'),_0xb56b('0x4'),_0xb56b('0x5'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 6289f1b..90d140c 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 _0x5a24=['filter','User','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','Team','order','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','all','union','compact','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','set','update','then','destroy','get','UserProfileResource','stack','name','send','index','map','OpenchannelQueue','fieldName','key','getOptions','where','count','include','query','findAll','rows','catch','params','keys','model','attributes','intersection','fields','length','merge','options','find','create','body','role','user','OpenchannelQueues','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','rawAttributes','filters','hasOwnProperty','nolimit','limit','sort','OpenchannelQueueId'];(function(_0x5573c0,_0x2ed56d){var _0x5202fd=function(_0xa4cbb4){while(--_0xa4cbb4){_0x5573c0['push'](_0x5573c0['shift']());}};_0x5202fd(++_0x2ed56d);}(_0x5a24,0x193));var _0x45a2=function(_0x30e650,_0x59bcf6){_0x30e650=_0x30e650-0x0;var _0x57ac27=_0x5a24[_0x30e650];return _0x57ac27;};'use strict';var BPromise=require(_0x45a2('0x0'));var util=require('util');var _=require(_0x45a2('0x1'));var squel=require(_0x45a2('0x2'));var Redis=require(_0x45a2('0x3'));var qs=require(_0x45a2('0x4'));var logger=require(_0x45a2('0x5'))(_0x45a2('0x6'));var config=require(_0x45a2('0x7'));var db=require('../../mysqldb')['db'];config[_0x45a2('0x8')]=_[_0x45a2('0x9')](config[_0x45a2('0x8')],{'host':_0x45a2('0xa'),'port':0x18eb});var socket=require(_0x45a2('0xb'))(new Redis(config[_0x45a2('0x8')]));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x7db24f,_0x1f9242){_0x1f9242=_0x1f9242||0xcc;return function(_0x3452a2){if(_0x3452a2){return _0x7db24f[_0x45a2('0xc')](_0x1f9242);}return _0x7db24f[_0x45a2('0xd')](_0x1f9242)[_0x45a2('0xe')]();};}function respondWithResult(_0x41853b,_0x37472e){_0x37472e=_0x37472e||0xc8;return function(_0x4e8234){if(_0x4e8234){return _0x41853b[_0x45a2('0xd')](_0x37472e)[_0x45a2('0xf')](_0x4e8234);}};}function respondWithFilteredResult(_0x1b0868,_0x350959){return function(_0x5a0935){if(_0x5a0935){var _0x10d532=typeof _0x350959[_0x45a2('0x10')]===_0x45a2('0x11')&&typeof _0x350959['limit']===_0x45a2('0x11');var _0x369843=_0x5a0935['count'];var _0x33ca5b=_0x10d532?0x0:_0x350959[_0x45a2('0x10')];var _0x46859f=_0x10d532?_0x5a0935['count']:_0x350959['offset']+_0x350959['limit'];var _0x467c87;if(_0x46859f>=_0x369843){_0x46859f=_0x369843;_0x467c87=0xc8;}else{_0x467c87=0xce;}_0x1b0868[_0x45a2('0xd')](_0x467c87);return _0x1b0868[_0x45a2('0x12')]('Content-Range',_0x33ca5b+'-'+_0x46859f+'/'+_0x369843)['json'](_0x5a0935);}return null;};}function saveUpdates(_0x5d8312){return function(_0x180d20){if(_0x180d20){return _0x180d20[_0x45a2('0x13')](_0x5d8312)[_0x45a2('0x14')](function(_0x47d1a1){return _0x47d1a1;});}return null;};}function removeEntity(_0x16d3e8){return function(_0x5b94d2){if(_0x5b94d2){return _0x5b94d2[_0x45a2('0x15')]()[_0x45a2('0x14')](function(){var _0x21357b=_0x5b94d2[_0x45a2('0x16')]({'plain':!![]});var _0x28a3a1='OpenchannelQueues';return db[_0x45a2('0x17')][_0x45a2('0x15')]({'where':{'type':_0x28a3a1,'resourceId':_0x21357b['id']}})['then'](function(){return _0x5b94d2;});})[_0x45a2('0x14')](function(){_0x16d3e8['status'](0xcc)[_0x45a2('0xe')]();});}};}function handleEntityNotFound(_0x335805){return function(_0x1feb1c){if(!_0x1feb1c){_0x335805[_0x45a2('0xc')](0x194);}return _0x1feb1c;};}function handleError(_0x187bb9,_0xac5e03){_0xac5e03=_0xac5e03||0x1f4;return function(_0x15ca99){logger['error'](_0x15ca99[_0x45a2('0x18')]);if(_0x15ca99[_0x45a2('0x19')]){delete _0x15ca99['name'];}_0x187bb9[_0x45a2('0xd')](_0xac5e03)[_0x45a2('0x1a')](_0x15ca99);};}exports[_0x45a2('0x1b')]=function(_0x323c16,_0x9c0846){var _0x19203a={};var _0x1fc11c={'count':0x0,'rows':[]};var _0x481a59=_[_0x45a2('0x1c')](db[_0x45a2('0x1d')]['rawAttributes'],function(_0x6bfddb){return{'name':_0x6bfddb[_0x45a2('0x1e')],'type':_0x6bfddb['type'][_0x45a2('0x1f')]};});_0x19203a=qs[_0x45a2('0x20')](_0x481a59,_0x323c16);var _0x43ee70={'where':_0x19203a[_0x45a2('0x21')]};return db[_0x45a2('0x1d')][_0x45a2('0x22')](_0x43ee70)[_0x45a2('0x14')](function(_0x46dfad){_0x1fc11c[_0x45a2('0x22')]=_0x46dfad;_0x19203a[_0x45a2('0x23')]=qs[_0x45a2('0x23')](_0x323c16[_0x45a2('0x24')]);return db['OpenchannelQueue'][_0x45a2('0x25')](_0x19203a);})[_0x45a2('0x14')](function(_0x4940ae){_0x1fc11c[_0x45a2('0x26')]=_0x4940ae;return _0x1fc11c;})[_0x45a2('0x14')](respondWithFilteredResult(_0x9c0846,_0x19203a))[_0x45a2('0x27')](handleError(_0x9c0846,null));};exports['show']=function(_0x54522b,_0x4c17ce){var _0x19403e={'raw':!![],'where':{'id':_0x54522b[_0x45a2('0x28')]['id']}},_0x364797={};_0x364797['model']=_[_0x45a2('0x29')](db[_0x45a2('0x1d')]['rawAttributes']);_0x364797[_0x45a2('0x24')]=_[_0x45a2('0x29')](_0x54522b[_0x45a2('0x24')]);_0x364797['filters']=_['intersection'](_0x364797[_0x45a2('0x2a')],_0x364797['query']);_0x19403e[_0x45a2('0x2b')]=_[_0x45a2('0x2c')](_0x364797[_0x45a2('0x2a')],qs[_0x45a2('0x2d')](_0x54522b['query']['fields']));_0x19403e['attributes']=_0x19403e['attributes'][_0x45a2('0x2e')]?_0x19403e[_0x45a2('0x2b')]:_0x364797[_0x45a2('0x2a')];if(_0x54522b[_0x45a2('0x24')]['includeAll']){_0x19403e[_0x45a2('0x23')]=[{'all':!![]}];}_0x19403e=_[_0x45a2('0x2f')]({},_0x19403e,_0x54522b[_0x45a2('0x30')]);return db[_0x45a2('0x1d')][_0x45a2('0x31')](_0x19403e)[_0x45a2('0x14')](handleEntityNotFound(_0x4c17ce,null))[_0x45a2('0x14')](respondWithResult(_0x4c17ce,null))[_0x45a2('0x27')](handleError(_0x4c17ce,null));};exports[_0x45a2('0x32')]=function(_0x3dfa79,_0x41627e){return db['OpenchannelQueue'][_0x45a2('0x32')](_0x3dfa79[_0x45a2('0x33')],{})[_0x45a2('0x14')](function(_0x3570bc){var _0x3ee52e=_0x3dfa79['user'][_0x45a2('0x16')]({'plain':!![]});if(!_0x3ee52e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ee52e[_0x45a2('0x34')]===_0x45a2('0x35')){var _0x54dc32=_0x3570bc[_0x45a2('0x16')]({'plain':!![]});var _0x158651=_0x45a2('0x36');return db[_0x45a2('0x37')][_0x45a2('0x31')]({'where':{'name':_0x158651,'userProfileId':_0x3ee52e['userProfileId']},'raw':!![]})[_0x45a2('0x14')](function(_0x285619){if(_0x285619&&_0x285619[_0x45a2('0x38')]===0x0){return db[_0x45a2('0x17')]['create']({'name':_0x54dc32[_0x45a2('0x19')],'resourceId':_0x54dc32['id'],'type':_0x285619[_0x45a2('0x19')],'sectionId':_0x285619['id']},{})['then'](function(){return _0x3570bc;});}else{return _0x3570bc;}})[_0x45a2('0x27')](function(_0x1a19fd){logger['error'](_0x45a2('0x39'),_0x1a19fd);throw _0x1a19fd;});}return _0x3570bc;})[_0x45a2('0x14')](respondWithResult(_0x41627e,0xc9))[_0x45a2('0x27')](handleError(_0x41627e,null));};exports[_0x45a2('0x13')]=function(_0x8d0a22,_0x1d3c09){if(_0x8d0a22[_0x45a2('0x33')]['id']){delete _0x8d0a22[_0x45a2('0x33')]['id'];}return db[_0x45a2('0x1d')][_0x45a2('0x31')]({'where':{'id':_0x8d0a22[_0x45a2('0x28')]['id']}})[_0x45a2('0x14')](handleEntityNotFound(_0x1d3c09,null))[_0x45a2('0x14')](saveUpdates(_0x8d0a22[_0x45a2('0x33')],null))['then'](respondWithResult(_0x1d3c09,null))[_0x45a2('0x27')](handleError(_0x1d3c09,null));};exports['destroy']=function(_0x4d26b2,_0x1ef2a2){return db['OpenchannelQueue']['find']({'where':{'id':_0x4d26b2[_0x45a2('0x28')]['id']}})[_0x45a2('0x14')](handleEntityNotFound(_0x1ef2a2,null))[_0x45a2('0x14')](removeEntity(_0x1ef2a2,null))[_0x45a2('0x27')](handleError(_0x1ef2a2,null));};exports[_0x45a2('0x3a')]=function(_0x9a0da1,_0x1c6db1){return db[_0x45a2('0x1d')]['describe']()[_0x45a2('0x14')](respondWithResult(_0x1c6db1,null))[_0x45a2('0x27')](handleError(_0x1c6db1,null));};exports[_0x45a2('0x3b')]=function(_0x57397d,_0x454cf8){var _0x44efcd={'raw':!![],'where':{}},_0x3bb680={},_0x528aff;return db[_0x45a2('0x1d')][_0x45a2('0x3c')]({'where':{'id':_0x57397d[_0x45a2('0x28')]['id']}})[_0x45a2('0x14')](handleEntityNotFound(_0x454cf8,null))['then'](function(_0x3a99df){if(_0x3a99df){_0x528aff=_0x3a99df[_0x45a2('0x16')]({'plain':!![]});_0x3bb680[_0x45a2('0x2a')]=_[_0x45a2('0x29')](db[_0x45a2('0x3d')][_0x45a2('0x3e')]);_0x3bb680[_0x45a2('0x24')]=_['keys'](_0x57397d[_0x45a2('0x24')]);_0x3bb680[_0x45a2('0x3f')]=_[_0x45a2('0x2c')](_0x3bb680[_0x45a2('0x2a')],_0x3bb680[_0x45a2('0x24')]);_0x44efcd[_0x45a2('0x2b')]=_[_0x45a2('0x2c')](_0x3bb680[_0x45a2('0x2a')],qs['fields'](_0x57397d[_0x45a2('0x24')]['fields']));_0x44efcd[_0x45a2('0x2b')]=_0x44efcd[_0x45a2('0x2b')]['length']?_0x44efcd[_0x45a2('0x2b')]:_0x3bb680[_0x45a2('0x2a')];if(!_0x57397d[_0x45a2('0x24')][_0x45a2('0x40')](_0x45a2('0x41'))){_0x44efcd[_0x45a2('0x42')]=qs[_0x45a2('0x42')](_0x57397d[_0x45a2('0x24')][_0x45a2('0x42')]);_0x44efcd[_0x45a2('0x10')]=qs['offset'](_0x57397d[_0x45a2('0x24')][_0x45a2('0x10')]);}_0x44efcd['order']=qs[_0x45a2('0x43')](_0x57397d['query'][_0x45a2('0x43')]);_0x44efcd[_0x45a2('0x21')]=qs[_0x45a2('0x3f')](_['pick'](_0x57397d[_0x45a2('0x24')],_0x3bb680[_0x45a2('0x3f')]));_0x44efcd[_0x45a2('0x21')][_0x45a2('0x44')]=_0x3a99df['id'];if(_0x57397d[_0x45a2('0x24')]['filter']){_0x44efcd[_0x45a2('0x21')]=_[_0x45a2('0x2f')](_0x44efcd[_0x45a2('0x21')],{'$or':_['map'](_0x44efcd[_0x45a2('0x2b')],function(_0x19a75a){var _0x27cb03={};_0x27cb03[_0x19a75a]={'$like':'%'+_0x57397d['query'][_0x45a2('0x45')]+'%'};return _0x27cb03;})});}_0x44efcd=_['merge']({},_0x44efcd,_0x57397d['options']);return db[_0x45a2('0x3d')][_0x45a2('0x25')](_0x44efcd);}})[_0x45a2('0x14')](function(_0x112c97){if(_0x112c97){return db[_0x45a2('0x46')]['findAndCountAll']({'where':{'id':_[_0x45a2('0x1c')](_0x112c97,'UserId'),'role':_0x45a2('0x47')},'attributes':['id',_0x45a2('0x19'),_0x45a2('0x48'),_0x45a2('0x49'),_0x45a2('0x4a')]});}})['then'](function(_0x3b5aa4){if(_0x3b5aa4){return{'count':_0x3b5aa4[_0x45a2('0x22')],'rows':_[_0x45a2('0x1c')](_0x3b5aa4[_0x45a2('0x26')],function(_0x9353a3){return{'membername':_0x9353a3[_0x45a2('0x19')],'UserId':_0x9353a3['id'],'queue_name':_0x528aff[_0x45a2('0x19')],'OpenchannelQueueId':_0x528aff['id'],'interface':util[_0x45a2('0x4b')](_0x45a2('0x4c'),_0x45a2('0x4d'),_0x9353a3['name']),'penalty':0x0,'paused':_0x9353a3[_0x45a2('0x48')],'createdAt':_0x9353a3[_0x45a2('0x4a')],'updatedAt':_0x9353a3[_0x45a2('0x49')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x454cf8,_0x44efcd))[_0x45a2('0x27')](handleError(_0x454cf8,null));};exports['getTeams']=function(_0x486754,_0x29be8c){var _0x56a638={};var _0x920cf8={};var _0x5d776a;var _0x51ccdd;return db[_0x45a2('0x1d')][_0x45a2('0x3c')]({'where':{'id':_0x486754[_0x45a2('0x28')]['id']}})[_0x45a2('0x14')](handleEntityNotFound(_0x29be8c,null))[_0x45a2('0x14')](function(_0x2c19d6){if(_0x2c19d6){_0x5d776a=_0x2c19d6;_0x920cf8[_0x45a2('0x2a')]=_[_0x45a2('0x29')](db[_0x45a2('0x4e')]['rawAttributes']);_0x920cf8[_0x45a2('0x24')]=_[_0x45a2('0x29')](_0x486754['query']);_0x920cf8[_0x45a2('0x3f')]=_['intersection'](_0x920cf8['model'],_0x920cf8[_0x45a2('0x24')]);_0x56a638[_0x45a2('0x2b')]=_[_0x45a2('0x2c')](_0x920cf8[_0x45a2('0x2a')],qs[_0x45a2('0x2d')](_0x486754[_0x45a2('0x24')][_0x45a2('0x2d')]));_0x56a638[_0x45a2('0x2b')]=_0x56a638['attributes'][_0x45a2('0x2e')]?_0x56a638[_0x45a2('0x2b')]:_0x920cf8[_0x45a2('0x2a')];_0x56a638[_0x45a2('0x4f')]=qs[_0x45a2('0x43')](_0x486754['query']['sort']);_0x56a638[_0x45a2('0x21')]=qs[_0x45a2('0x3f')](_['pick'](_0x486754[_0x45a2('0x24')],_0x920cf8[_0x45a2('0x3f')]));if(_0x486754['query'][_0x45a2('0x45')]){_0x56a638['where']=_[_0x45a2('0x2f')](_0x56a638['where'],{'$or':_[_0x45a2('0x1c')](_0x56a638[_0x45a2('0x2b')],function(_0x2f2954){var _0x4bcd46={};_0x4bcd46[_0x2f2954]={'$like':'%'+_0x486754['query'][_0x45a2('0x45')]+'%'};return _0x4bcd46;})});}_0x56a638=_[_0x45a2('0x2f')]({},_0x56a638,_0x486754[_0x45a2('0x30')]);return _0x5d776a['getTeams'](_0x56a638);}})['then'](function(_0x1255d1){if(_0x1255d1){_0x51ccdd=_0x1255d1['length'];if(!_0x486754[_0x45a2('0x24')]['hasOwnProperty'](_0x45a2('0x41'))){_0x56a638[_0x45a2('0x42')]=qs[_0x45a2('0x42')](_0x486754[_0x45a2('0x24')][_0x45a2('0x42')]);_0x56a638[_0x45a2('0x10')]=qs['offset'](_0x486754['query']['offset']);}return _0x5d776a['getTeams'](_0x56a638);}})[_0x45a2('0x14')](function(_0xc09eae){if(_0xc09eae){return _0xc09eae?{'count':_0x51ccdd,'rows':_0xc09eae}:null;}})['then'](respondWithResult(_0x29be8c,null))[_0x45a2('0x27')](handleError(_0x29be8c,null));};exports[_0x45a2('0x50')]=function(_0x2f160c,_0xf68c46){var _0x472f13=_0x2f160c[_0x45a2('0x33')][_0x45a2('0x51')];return db[_0x45a2('0x4e')][_0x45a2('0x25')]({'where':{'id':_0x472f13},'attributes':['id'],'include':[{'model':db[_0x45a2('0x46')],'as':_0x45a2('0x52'),'attributes':['id',_0x45a2('0x19'),_0x45a2('0x53'),_0x45a2('0x54'),_0x45a2('0x55')],'raw':!![]}]})[_0x45a2('0x14')](function(_0x133256){if(_0x133256){var _0x58caa2=_['flatMap'](_0x133256,function(_0x49611f){var _0x553e9c=_0x49611f[_0x45a2('0x16')]({'plain':!![]});return _0x553e9c[_0x45a2('0x52')];});return db[_0x45a2('0x1d')][_0x45a2('0x31')]({'where':{'id':_0x2f160c[_0x45a2('0x28')]['id']}})[_0x45a2('0x14')](function(_0x2b1896){return db[_0x45a2('0x56')][_0x45a2('0x57')](function(_0x23eee0){return _0x2b1896['addTeams'](_0x472f13,{'transaction':_0x23eee0})[_0x45a2('0x14')](function(){return BPromise[_0x45a2('0x58')](_0x58caa2,function(_0x2649ca){return db[_0x45a2('0x3d')][_0x45a2('0x59')]({'where':{'UserId':_0x2649ca['id'],'OpenchannelQueueId':_0x2f160c[_0x45a2('0x28')]['id']},'transaction':_0x23eee0});});})[_0x45a2('0x14')](function(){_0x58caa2[_0x45a2('0x5a')](function(_0x10c1e0){socket[_0x45a2('0x5b')]('userOpenchannelQueue:save',{'UserId':_0x10c1e0['id'],'OpenchannelQueueId':_0x2b1896['id']});});});});});}})[_0x45a2('0x14')](respondWithStatusCode(_0xf68c46,null))['catch'](handleError(_0xf68c46,null));};exports[_0x45a2('0x5c')]=function(_0x51a9b3,_0x333677){return db[_0x45a2('0x4e')]['findAll']({'where':{'id':_0x51a9b3['query'][_0x45a2('0x51')]},'attributes':['id'],'include':[{'model':db[_0x45a2('0x46')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x45a2('0x14')](handleEntityNotFound(_0x333677,null))[_0x45a2('0x14')](function(_0x35f74a){var _0x34379b=_['map'](_0x35f74a,'id');var _0x387d7f=[];var _0x4558d6=[];var _0x36bc35=squel[_0x45a2('0x5d')]();_0x36bc35[_0x45a2('0x5e')](_0x45a2('0x5f'))[_0x45a2('0x60')](_0x45a2('0x61'),'tq')[_0x45a2('0x62')]('user_has_teams','ut',_0x45a2('0x63'))[_0x45a2('0x21')](_0x45a2('0x64'),_0x51a9b3[_0x45a2('0x28')]['id']);for(var _0x46d6a4=0x0;_0x46d6a4<_0x35f74a[_0x45a2('0x2e')];_0x46d6a4+=0x1){let _0x159f6a=_0x35f74a[_0x46d6a4];for(var _0x3b8eb7=0x0;_0x3b8eb7<_0x159f6a[_0x45a2('0x52')][_0x45a2('0x2e')];_0x3b8eb7+=0x1){let _0x52c56b=_0x159f6a['Agents'][_0x3b8eb7];var _0x34bbf2=_0x36bc35[_0x45a2('0x65')]();_0x34bbf2['where'](_0x45a2('0x66'),_0x52c56b['id']);_0x4558d6['push'](db[_0x45a2('0x56')][_0x45a2('0x24')](_0x34bbf2[_0x45a2('0x67')](),{'type':db['sequelize'][_0x45a2('0x68')][_0x45a2('0x69')]})[_0x45a2('0x14')](function(_0x23aeb2){if(_0x23aeb2[_0x45a2('0x2e')]===0x1){return _0x52c56b['id'];}else{var _0x21aebe=_['every'](_[_0x45a2('0x1c')](_0x23aeb2,_0x45a2('0x6a')),function(_0x37fb1a){return _[_0x45a2('0x6b')](_0x34379b,_0x37fb1a);});if(_0x21aebe){return _0x52c56b['id'];}}}));}}return BPromise[_0x45a2('0x6c')](_0x4558d6)[_0x45a2('0x14')](function(_0x54adcf){_0x387d7f=_(_0x387d7f)[_0x45a2('0x6d')](_0x54adcf)[_0x45a2('0x6e')]()['value']();return db[_0x45a2('0x1d')]['find']({'where':{'id':_0x51a9b3[_0x45a2('0x28')]['id']}})[_0x45a2('0x14')](function(_0x332226){return db['sequelize'][_0x45a2('0x57')](function(_0x28e515){return _0x332226[_0x45a2('0x5c')](_0x51a9b3[_0x45a2('0x24')][_0x45a2('0x51')],{'transaction':_0x28e515})[_0x45a2('0x14')](function(){if(!_['isEmpty'](_0x387d7f)){return _0x332226[_0x45a2('0x6f')](_0x387d7f,{'transaction':_0x28e515});}})[_0x45a2('0x14')](function(){_0x387d7f[_0x45a2('0x5a')](function(_0x1f47cd){socket[_0x45a2('0x5b')](_0x45a2('0x70'),{'UserId':_0x1f47cd,'OpenchannelQueueId':_0x332226['id']});});});});});});})[_0x45a2('0x14')](respondWithStatusCode(_0x333677,null))[_0x45a2('0x27')](handleError(_0x333677,null));};exports[_0x45a2('0x71')]=function(_0x50cc65,_0x582ac8){return db[_0x45a2('0x1d')][_0x45a2('0x31')]({'where':{'id':_0x50cc65[_0x45a2('0x28')]['id']}})['then'](handleEntityNotFound(_0x582ac8,null))[_0x45a2('0x14')](function(_0x1d1422){if(_0x1d1422){return _0x1d1422['addAgents'](_0x50cc65[_0x45a2('0x33')]['ids'],_[_0x45a2('0x72')](_0x50cc65[_0x45a2('0x33')],['ids','id'])||{})[_0x45a2('0x73')](function(_0x304e8f){for(var _0x11ac9f=0x0;_0x11ac9f<_0x50cc65[_0x45a2('0x33')][_0x45a2('0x51')][_0x45a2('0x2e')];_0x11ac9f+=0x1){socket[_0x45a2('0x5b')]('userOpenchannelQueue:save',{'UserId':Number(_0x50cc65[_0x45a2('0x33')][_0x45a2('0x51')][_0x11ac9f]),'OpenchannelQueueId':Number(_0x50cc65[_0x45a2('0x28')]['id'])});}return _0x304e8f;});}})['then'](respondWithResult(_0x582ac8,null))['catch'](handleError(_0x582ac8,null));};exports[_0x45a2('0x6f')]=function(_0x50c0ca,_0x20e0de){return db[_0x45a2('0x1d')]['find']({'where':{'id':_0x50c0ca['params']['id']}})[_0x45a2('0x14')](handleEntityNotFound(_0x20e0de,null))[_0x45a2('0x14')](function(_0x20d0da){if(_0x20d0da){return _0x20d0da[_0x45a2('0x6f')](_0x50c0ca[_0x45a2('0x24')]['ids'])[_0x45a2('0x14')](function(){if(_[_0x45a2('0x74')](_0x50c0ca[_0x45a2('0x24')]['ids'])){for(var _0x5d1a84=0x0;_0x5d1a84<_0x50c0ca['query'][_0x45a2('0x51')][_0x45a2('0x2e')];_0x5d1a84+=0x1){socket[_0x45a2('0x5b')]('userOpenchannelQueue:remove',{'UserId':Number(_0x50c0ca[_0x45a2('0x24')][_0x45a2('0x51')][_0x5d1a84]),'OpenchannelQueueId':Number(_0x50c0ca['params']['id'])});}}else{socket['emit'](_0x45a2('0x70'),{'UserId':Number(_0x50c0ca[_0x45a2('0x24')][_0x45a2('0x51')]),'OpenchannelQueueId':Number(_0x50c0ca[_0x45a2('0x28')]['id'])});}});}})['then'](respondWithStatusCode(_0x20e0de,null))['catch'](handleError(_0x20e0de,null));};exports[_0x45a2('0x75')]=function(_0x1d0f61,_0xfb5ebe){var _0x4cb3d7={};var _0x515585={};var _0x264618;var _0x2fa631;return db['OpenchannelQueue'][_0x45a2('0x3c')]({'where':{'id':_0x1d0f61['params']['id']}})['then'](handleEntityNotFound(_0xfb5ebe,null))[_0x45a2('0x14')](function(_0x4085f5){if(_0x4085f5){_0x264618=_0x4085f5;_0x515585[_0x45a2('0x2a')]=_[_0x45a2('0x29')](db[_0x45a2('0x46')][_0x45a2('0x3e')]);_0x515585['query']=_[_0x45a2('0x29')](_0x1d0f61[_0x45a2('0x24')]);_0x515585['filters']=_['intersection'](_0x515585[_0x45a2('0x2a')],_0x515585[_0x45a2('0x24')]);_0x4cb3d7[_0x45a2('0x2b')]=_[_0x45a2('0x2c')](_0x515585[_0x45a2('0x2a')],qs[_0x45a2('0x2d')](_0x1d0f61['query'][_0x45a2('0x2d')]));_0x4cb3d7['attributes']=_0x4cb3d7['attributes'][_0x45a2('0x2e')]?_0x4cb3d7[_0x45a2('0x2b')]:_0x515585[_0x45a2('0x2a')];_0x4cb3d7[_0x45a2('0x4f')]=qs[_0x45a2('0x43')](_0x1d0f61[_0x45a2('0x24')]['sort']);_0x4cb3d7[_0x45a2('0x21')]=qs[_0x45a2('0x3f')](_['pick'](_0x1d0f61['query'],_0x515585[_0x45a2('0x3f')]));if(_0x1d0f61[_0x45a2('0x24')][_0x45a2('0x45')]){_0x4cb3d7[_0x45a2('0x21')]=_[_0x45a2('0x2f')](_0x4cb3d7[_0x45a2('0x21')],{'$or':_[_0x45a2('0x1c')](_0x4cb3d7[_0x45a2('0x2b')],function(_0xd4bfae){var _0x59858c={};_0x59858c[_0xd4bfae]={'$like':'%'+_0x1d0f61[_0x45a2('0x24')][_0x45a2('0x45')]+'%'};return _0x59858c;})});}_0x4cb3d7=_[_0x45a2('0x2f')]({},_0x4cb3d7,_0x1d0f61[_0x45a2('0x30')]);return _0x264618[_0x45a2('0x75')](_0x4cb3d7);}})[_0x45a2('0x14')](function(_0x94c5d6){if(_0x94c5d6){_0x2fa631=_0x94c5d6[_0x45a2('0x2e')];if(!_0x1d0f61['query'][_0x45a2('0x40')](_0x45a2('0x41'))){_0x4cb3d7['limit']=qs['limit'](_0x1d0f61[_0x45a2('0x24')][_0x45a2('0x42')]);_0x4cb3d7['offset']=qs[_0x45a2('0x10')](_0x1d0f61[_0x45a2('0x24')]['offset']);}return _0x264618[_0x45a2('0x75')](_0x4cb3d7);}})[_0x45a2('0x14')](function(_0x2dc73a){if(_0x2dc73a){return _0x2dc73a?{'count':_0x2fa631,'rows':_0x2dc73a}:null;}})['then'](respondWithResult(_0xfb5ebe,null))[_0x45a2('0x27')](handleError(_0xfb5ebe,null));}; \ No newline at end of file +var _0xa419=['order','nolimit','ids','Agents','voicePause','flatMap','sequelize','transaction','addTeams','each','UserOpenchannelQueue','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','toString','SELECT','every','TeamId','includes','all','compact','value','isEmpty','userOpenchannelQueue:remove','addAgents','omit','spread','removeAgents','getAgents','hasOwnProperty','bluebird','util','lodash','squel','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','status','end','json','offset','undefined','limit','set','Content-Range','then','get','OpenchannelQueues','destroy','sendStatus','stack','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','getOptions','where','count','include','query','rows','catch','show','model','keys','filters','intersection','fields','attributes','length','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','find','params','describe','getMembers','findOne','sort','pick','OpenchannelQueueId','filter','findAll','User','UserId','openchannelPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team'];(function(_0x72052f,_0x503f17){var _0x3c1e6b=function(_0x3401){while(--_0x3401){_0x72052f['push'](_0x72052f['shift']());}};_0x3c1e6b(++_0x503f17);}(_0xa419,0xa4));var _0x9a41=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa419[_0x1facfa];return _0x9ec701;};'use strict';var BPromise=require(_0x9a41('0x0'));var util=require(_0x9a41('0x1'));var _=require(_0x9a41('0x2'));var squel=require(_0x9a41('0x3'));var Redis=require(_0x9a41('0x4'));var qs=require('../../components/parsers/qs');var logger=require(_0x9a41('0x5'))(_0x9a41('0x6'));var config=require(_0x9a41('0x7'));var db=require(_0x9a41('0x8'))['db'];config[_0x9a41('0x9')]=_[_0x9a41('0xa')](config[_0x9a41('0x9')],{'host':_0x9a41('0xb'),'port':0x18eb});var socket=require(_0x9a41('0xc'))(new Redis(config[_0x9a41('0x9')]));require(_0x9a41('0xd'))[_0x9a41('0xe')](socket);function respondWithStatusCode(_0x5c159e,_0x45585c){_0x45585c=_0x45585c||0xcc;return function(_0xc581d5){if(_0xc581d5){return _0x5c159e['sendStatus'](_0x45585c);}return _0x5c159e[_0x9a41('0xf')](_0x45585c)[_0x9a41('0x10')]();};}function respondWithResult(_0x1664d7,_0x24a624){_0x24a624=_0x24a624||0xc8;return function(_0x4cc1ab){if(_0x4cc1ab){return _0x1664d7[_0x9a41('0xf')](_0x24a624)[_0x9a41('0x11')](_0x4cc1ab);}};}function respondWithFilteredResult(_0x2eaadc,_0x568308){return function(_0x59cde7){if(_0x59cde7){var _0x5801fc=typeof _0x568308[_0x9a41('0x12')]===_0x9a41('0x13')&&typeof _0x568308[_0x9a41('0x14')]===_0x9a41('0x13');var _0x243b39=_0x59cde7['count'];var _0x2ac4a4=_0x5801fc?0x0:_0x568308['offset'];var _0x3d6242=_0x5801fc?_0x59cde7['count']:_0x568308[_0x9a41('0x12')]+_0x568308[_0x9a41('0x14')];var _0x4fb59e;if(_0x3d6242>=_0x243b39){_0x3d6242=_0x243b39;_0x4fb59e=0xc8;}else{_0x4fb59e=0xce;}_0x2eaadc[_0x9a41('0xf')](_0x4fb59e);return _0x2eaadc[_0x9a41('0x15')](_0x9a41('0x16'),_0x2ac4a4+'-'+_0x3d6242+'/'+_0x243b39)[_0x9a41('0x11')](_0x59cde7);}return null;};}function saveUpdates(_0x572907){return function(_0x4d56e0){if(_0x4d56e0){return _0x4d56e0['update'](_0x572907)['then'](function(_0x50f778){return _0x50f778;});}return null;};}function removeEntity(_0x5139fc){return function(_0xba0a3a){if(_0xba0a3a){return _0xba0a3a['destroy']()[_0x9a41('0x17')](function(){var _0x48b574=_0xba0a3a[_0x9a41('0x18')]({'plain':!![]});var _0x35034d=_0x9a41('0x19');return db['UserProfileResource'][_0x9a41('0x1a')]({'where':{'type':_0x35034d,'resourceId':_0x48b574['id']}})['then'](function(){return _0xba0a3a;});})[_0x9a41('0x17')](function(){_0x5139fc[_0x9a41('0xf')](0xcc)[_0x9a41('0x10')]();});}};}function handleEntityNotFound(_0x34b653){return function(_0x49be53){if(!_0x49be53){_0x34b653[_0x9a41('0x1b')](0x194);}return _0x49be53;};}function handleError(_0x194464,_0x214136){_0x214136=_0x214136||0x1f4;return function(_0x277ac9){logger['error'](_0x277ac9[_0x9a41('0x1c')]);if(_0x277ac9[_0x9a41('0x1d')]){delete _0x277ac9['name'];}_0x194464[_0x9a41('0xf')](_0x214136)[_0x9a41('0x1e')](_0x277ac9);};}exports[_0x9a41('0x1f')]=function(_0x4bb4ef,_0xd85519){var _0x24ac05={};var _0x262491={'count':0x0,'rows':[]};var _0x47009e=_[_0x9a41('0x20')](db[_0x9a41('0x21')][_0x9a41('0x22')],function(_0x4a8ead){return{'name':_0x4a8ead[_0x9a41('0x23')],'type':_0x4a8ead[_0x9a41('0x24')][_0x9a41('0x25')]};});_0x24ac05=qs[_0x9a41('0x26')](_0x47009e,_0x4bb4ef);var _0x142187={'where':_0x24ac05[_0x9a41('0x27')]};return db['OpenchannelQueue'][_0x9a41('0x28')](_0x142187)[_0x9a41('0x17')](function(_0x3ac72c){_0x262491[_0x9a41('0x28')]=_0x3ac72c;_0x24ac05[_0x9a41('0x29')]=qs[_0x9a41('0x29')](_0x4bb4ef[_0x9a41('0x2a')]);return db[_0x9a41('0x21')]['findAll'](_0x24ac05);})[_0x9a41('0x17')](function(_0x1e88e0){_0x262491[_0x9a41('0x2b')]=_0x1e88e0;return _0x262491;})[_0x9a41('0x17')](respondWithFilteredResult(_0xd85519,_0x24ac05))[_0x9a41('0x2c')](handleError(_0xd85519,null));};exports[_0x9a41('0x2d')]=function(_0x3ecb1b,_0x5e1ee6){var _0x1931af={'raw':!![],'where':{'id':_0x3ecb1b['params']['id']}},_0x2f8f57={};_0x2f8f57[_0x9a41('0x2e')]=_['keys'](db['OpenchannelQueue'][_0x9a41('0x22')]);_0x2f8f57['query']=_[_0x9a41('0x2f')](_0x3ecb1b[_0x9a41('0x2a')]);_0x2f8f57[_0x9a41('0x30')]=_[_0x9a41('0x31')](_0x2f8f57[_0x9a41('0x2e')],_0x2f8f57[_0x9a41('0x2a')]);_0x1931af['attributes']=_[_0x9a41('0x31')](_0x2f8f57['model'],qs['fields'](_0x3ecb1b[_0x9a41('0x2a')][_0x9a41('0x32')]));_0x1931af['attributes']=_0x1931af[_0x9a41('0x33')][_0x9a41('0x34')]?_0x1931af['attributes']:_0x2f8f57[_0x9a41('0x2e')];if(_0x3ecb1b[_0x9a41('0x2a')]['includeAll']){_0x1931af[_0x9a41('0x29')]=[{'all':!![]}];}_0x1931af=_[_0x9a41('0x35')]({},_0x1931af,_0x3ecb1b[_0x9a41('0x36')]);return db['OpenchannelQueue']['find'](_0x1931af)[_0x9a41('0x17')](handleEntityNotFound(_0x5e1ee6,null))['then'](respondWithResult(_0x5e1ee6,null))[_0x9a41('0x2c')](handleError(_0x5e1ee6,null));};exports[_0x9a41('0x37')]=function(_0x8974b1,_0x326509){return db[_0x9a41('0x21')][_0x9a41('0x37')](_0x8974b1[_0x9a41('0x38')],{})['then'](function(_0x26bf57){var _0x12e9ee=_0x8974b1[_0x9a41('0x39')][_0x9a41('0x18')]({'plain':!![]});if(!_0x12e9ee)throw new Error(_0x9a41('0x3a'));if(_0x12e9ee[_0x9a41('0x3b')]==='user'){var _0x5a723e=_0x26bf57[_0x9a41('0x18')]({'plain':!![]});var _0x1c8138=_0x9a41('0x19');return db[_0x9a41('0x3c')]['find']({'where':{'name':_0x1c8138,'userProfileId':_0x12e9ee[_0x9a41('0x3d')]},'raw':!![]})['then'](function(_0x331bd7){if(_0x331bd7&&_0x331bd7['autoAssociation']===0x0){return db['UserProfileResource'][_0x9a41('0x37')]({'name':_0x5a723e[_0x9a41('0x1d')],'resourceId':_0x5a723e['id'],'type':_0x331bd7[_0x9a41('0x1d')],'sectionId':_0x331bd7['id']},{})['then'](function(){return _0x26bf57;});}else{return _0x26bf57;}})['catch'](function(_0xc4ee85){logger[_0x9a41('0x3e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc4ee85);throw _0xc4ee85;});}return _0x26bf57;})['then'](respondWithResult(_0x326509,0xc9))[_0x9a41('0x2c')](handleError(_0x326509,null));};exports['update']=function(_0x48bd0f,_0x3f2909){if(_0x48bd0f['body']['id']){delete _0x48bd0f[_0x9a41('0x38')]['id'];}return db['OpenchannelQueue'][_0x9a41('0x3f')]({'where':{'id':_0x48bd0f[_0x9a41('0x40')]['id']}})[_0x9a41('0x17')](handleEntityNotFound(_0x3f2909,null))[_0x9a41('0x17')](saveUpdates(_0x48bd0f[_0x9a41('0x38')],null))[_0x9a41('0x17')](respondWithResult(_0x3f2909,null))[_0x9a41('0x2c')](handleError(_0x3f2909,null));};exports[_0x9a41('0x1a')]=function(_0x2024e4,_0x36a3d9){return db[_0x9a41('0x21')][_0x9a41('0x3f')]({'where':{'id':_0x2024e4[_0x9a41('0x40')]['id']}})[_0x9a41('0x17')](handleEntityNotFound(_0x36a3d9,null))[_0x9a41('0x17')](removeEntity(_0x36a3d9,null))[_0x9a41('0x2c')](handleError(_0x36a3d9,null));};exports['describe']=function(_0x1102c0,_0xac05d0){return db[_0x9a41('0x21')][_0x9a41('0x41')]()[_0x9a41('0x17')](respondWithResult(_0xac05d0,null))[_0x9a41('0x2c')](handleError(_0xac05d0,null));};exports[_0x9a41('0x42')]=function(_0x1ffced,_0x4a9f62){var _0x18f987={'raw':!![],'where':{}},_0xfa3fe8={},_0x521c69;return db[_0x9a41('0x21')][_0x9a41('0x43')]({'where':{'id':_0x1ffced[_0x9a41('0x40')]['id']}})[_0x9a41('0x17')](handleEntityNotFound(_0x4a9f62,null))[_0x9a41('0x17')](function(_0x1bbfe3){if(_0x1bbfe3){_0x521c69=_0x1bbfe3['get']({'plain':!![]});_0xfa3fe8['model']=_['keys'](db['UserOpenchannelQueue'][_0x9a41('0x22')]);_0xfa3fe8['query']=_[_0x9a41('0x2f')](_0x1ffced[_0x9a41('0x2a')]);_0xfa3fe8[_0x9a41('0x30')]=_[_0x9a41('0x31')](_0xfa3fe8[_0x9a41('0x2e')],_0xfa3fe8['query']);_0x18f987['attributes']=_[_0x9a41('0x31')](_0xfa3fe8[_0x9a41('0x2e')],qs[_0x9a41('0x32')](_0x1ffced[_0x9a41('0x2a')][_0x9a41('0x32')]));_0x18f987[_0x9a41('0x33')]=_0x18f987[_0x9a41('0x33')]['length']?_0x18f987[_0x9a41('0x33')]:_0xfa3fe8[_0x9a41('0x2e')];if(!_0x1ffced[_0x9a41('0x2a')]['hasOwnProperty']('nolimit')){_0x18f987[_0x9a41('0x14')]=qs[_0x9a41('0x14')](_0x1ffced[_0x9a41('0x2a')]['limit']);_0x18f987[_0x9a41('0x12')]=qs[_0x9a41('0x12')](_0x1ffced[_0x9a41('0x2a')]['offset']);}_0x18f987['order']=qs[_0x9a41('0x44')](_0x1ffced[_0x9a41('0x2a')][_0x9a41('0x44')]);_0x18f987['where']=qs['filters'](_[_0x9a41('0x45')](_0x1ffced['query'],_0xfa3fe8[_0x9a41('0x30')]));_0x18f987['where'][_0x9a41('0x46')]=_0x1bbfe3['id'];if(_0x1ffced[_0x9a41('0x2a')][_0x9a41('0x47')]){_0x18f987['where']=_[_0x9a41('0x35')](_0x18f987[_0x9a41('0x27')],{'$or':_[_0x9a41('0x20')](_0x18f987[_0x9a41('0x33')],function(_0x3d182b){var _0x1e3249={};_0x1e3249[_0x3d182b]={'$like':'%'+_0x1ffced['query']['filter']+'%'};return _0x1e3249;})});}_0x18f987=_['merge']({},_0x18f987,_0x1ffced[_0x9a41('0x36')]);return db['UserOpenchannelQueue'][_0x9a41('0x48')](_0x18f987);}})[_0x9a41('0x17')](function(_0x3f4ea8){if(_0x3f4ea8){return db[_0x9a41('0x49')]['findAndCountAll']({'where':{'id':_[_0x9a41('0x20')](_0x3f4ea8,_0x9a41('0x4a')),'role':'agent'},'attributes':['id','name',_0x9a41('0x4b'),_0x9a41('0x4c'),_0x9a41('0x4d')]});}})[_0x9a41('0x17')](function(_0x296208){if(_0x296208){return{'count':_0x296208['count'],'rows':_[_0x9a41('0x20')](_0x296208['rows'],function(_0x19e672){return{'membername':_0x19e672[_0x9a41('0x1d')],'UserId':_0x19e672['id'],'queue_name':_0x521c69[_0x9a41('0x1d')],'OpenchannelQueueId':_0x521c69['id'],'interface':util['format'](_0x9a41('0x4e'),_0x9a41('0x4f'),_0x19e672[_0x9a41('0x1d')]),'penalty':0x0,'paused':_0x19e672[_0x9a41('0x4b')],'createdAt':_0x19e672[_0x9a41('0x4d')],'updatedAt':_0x19e672[_0x9a41('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4a9f62,_0x18f987))[_0x9a41('0x2c')](handleError(_0x4a9f62,null));};exports[_0x9a41('0x50')]=function(_0x2fbe25,_0x3e2aa8){var _0x441b3b={};var _0x4cf129={};var _0x217968;var _0x5dfb23;return db[_0x9a41('0x21')][_0x9a41('0x43')]({'where':{'id':_0x2fbe25[_0x9a41('0x40')]['id']}})[_0x9a41('0x17')](handleEntityNotFound(_0x3e2aa8,null))[_0x9a41('0x17')](function(_0x27846b){if(_0x27846b){_0x217968=_0x27846b;_0x4cf129[_0x9a41('0x2e')]=_[_0x9a41('0x2f')](db[_0x9a41('0x51')][_0x9a41('0x22')]);_0x4cf129['query']=_[_0x9a41('0x2f')](_0x2fbe25['query']);_0x4cf129[_0x9a41('0x30')]=_['intersection'](_0x4cf129['model'],_0x4cf129[_0x9a41('0x2a')]);_0x441b3b[_0x9a41('0x33')]=_['intersection'](_0x4cf129[_0x9a41('0x2e')],qs['fields'](_0x2fbe25[_0x9a41('0x2a')][_0x9a41('0x32')]));_0x441b3b['attributes']=_0x441b3b[_0x9a41('0x33')][_0x9a41('0x34')]?_0x441b3b['attributes']:_0x4cf129[_0x9a41('0x2e')];_0x441b3b[_0x9a41('0x52')]=qs[_0x9a41('0x44')](_0x2fbe25['query'][_0x9a41('0x44')]);_0x441b3b[_0x9a41('0x27')]=qs['filters'](_[_0x9a41('0x45')](_0x2fbe25[_0x9a41('0x2a')],_0x4cf129['filters']));if(_0x2fbe25[_0x9a41('0x2a')]['filter']){_0x441b3b[_0x9a41('0x27')]=_[_0x9a41('0x35')](_0x441b3b['where'],{'$or':_[_0x9a41('0x20')](_0x441b3b[_0x9a41('0x33')],function(_0x304315){var _0x3a582a={};_0x3a582a[_0x304315]={'$like':'%'+_0x2fbe25[_0x9a41('0x2a')]['filter']+'%'};return _0x3a582a;})});}_0x441b3b=_[_0x9a41('0x35')]({},_0x441b3b,_0x2fbe25['options']);return _0x217968[_0x9a41('0x50')](_0x441b3b);}})[_0x9a41('0x17')](function(_0x45f460){if(_0x45f460){_0x5dfb23=_0x45f460[_0x9a41('0x34')];if(!_0x2fbe25['query']['hasOwnProperty'](_0x9a41('0x53'))){_0x441b3b[_0x9a41('0x14')]=qs[_0x9a41('0x14')](_0x2fbe25['query'][_0x9a41('0x14')]);_0x441b3b['offset']=qs[_0x9a41('0x12')](_0x2fbe25['query'][_0x9a41('0x12')]);}return _0x217968[_0x9a41('0x50')](_0x441b3b);}})['then'](function(_0x5fe9fe){if(_0x5fe9fe){return _0x5fe9fe?{'count':_0x5dfb23,'rows':_0x5fe9fe}:null;}})[_0x9a41('0x17')](respondWithResult(_0x3e2aa8,null))[_0x9a41('0x2c')](handleError(_0x3e2aa8,null));};exports['addTeams']=function(_0x5ab152,_0x5b7364){var _0x3aed07=_0x5ab152[_0x9a41('0x38')][_0x9a41('0x54')];return db[_0x9a41('0x51')][_0x9a41('0x48')]({'where':{'id':_0x3aed07},'attributes':['id'],'include':[{'model':db[_0x9a41('0x49')],'as':_0x9a41('0x55'),'attributes':['id','name','online',_0x9a41('0x56'),'interface'],'raw':!![]}]})[_0x9a41('0x17')](function(_0x45905d){if(_0x45905d){var _0x1ec964=_[_0x9a41('0x57')](_0x45905d,function(_0x45cbb7){var _0x28cafa=_0x45cbb7[_0x9a41('0x18')]({'plain':!![]});return _0x28cafa[_0x9a41('0x55')];});return db[_0x9a41('0x21')][_0x9a41('0x3f')]({'where':{'id':_0x5ab152[_0x9a41('0x40')]['id']}})[_0x9a41('0x17')](function(_0x295d07){return db[_0x9a41('0x58')][_0x9a41('0x59')](function(_0x20fe77){return _0x295d07[_0x9a41('0x5a')](_0x3aed07,{'transaction':_0x20fe77})[_0x9a41('0x17')](function(){return BPromise[_0x9a41('0x5b')](_0x1ec964,function(_0x4dca58){return db[_0x9a41('0x5c')]['findOrCreate']({'where':{'UserId':_0x4dca58['id'],'OpenchannelQueueId':_0x5ab152[_0x9a41('0x40')]['id']},'transaction':_0x20fe77});});})[_0x9a41('0x17')](function(){_0x1ec964[_0x9a41('0x5d')](function(_0xbebbb){socket[_0x9a41('0x5e')](_0x9a41('0x5f'),{'UserId':_0xbebbb['id'],'OpenchannelQueueId':_0x295d07['id']});});});});});}})[_0x9a41('0x17')](respondWithStatusCode(_0x5b7364,null))[_0x9a41('0x2c')](handleError(_0x5b7364,null));};exports[_0x9a41('0x60')]=function(_0x472ba4,_0x34b118){return db[_0x9a41('0x51')][_0x9a41('0x48')]({'where':{'id':_0x472ba4[_0x9a41('0x2a')][_0x9a41('0x54')]},'attributes':['id'],'include':[{'model':db[_0x9a41('0x49')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x34b118,null))[_0x9a41('0x17')](function(_0x5acdc8){var _0x2bcadf=_[_0x9a41('0x20')](_0x5acdc8,'id');var _0x21a3dc=[];var _0x24ab6d=[];var _0x117ea7=squel[_0x9a41('0x61')]();_0x117ea7[_0x9a41('0x62')](_0x9a41('0x63'))[_0x9a41('0x64')](_0x9a41('0x65'),'tq')[_0x9a41('0x66')]('user_has_teams','ut',_0x9a41('0x67'))['where'](_0x9a41('0x68'),_0x472ba4['params']['id']);for(var _0x25d266=0x0;_0x25d266<_0x5acdc8[_0x9a41('0x34')];_0x25d266+=0x1){let _0xdcf703=_0x5acdc8[_0x25d266];for(var _0x32b560=0x0;_0x32b560<_0xdcf703[_0x9a41('0x55')][_0x9a41('0x34')];_0x32b560+=0x1){let _0x1f8175=_0xdcf703[_0x9a41('0x55')][_0x32b560];var _0x3288f7=_0x117ea7[_0x9a41('0x69')]();_0x3288f7[_0x9a41('0x27')]('ut.UserId\x20=\x20?',_0x1f8175['id']);_0x24ab6d[_0x9a41('0x6a')](db['sequelize'][_0x9a41('0x2a')](_0x3288f7[_0x9a41('0x6b')](),{'type':db['sequelize']['QueryTypes'][_0x9a41('0x6c')]})[_0x9a41('0x17')](function(_0x374c36){if(_0x374c36[_0x9a41('0x34')]===0x1){return _0x1f8175['id'];}else{var _0xfb5594=_[_0x9a41('0x6d')](_[_0x9a41('0x20')](_0x374c36,_0x9a41('0x6e')),function(_0x1ecfc8){return _[_0x9a41('0x6f')](_0x2bcadf,_0x1ecfc8);});if(_0xfb5594){return _0x1f8175['id'];}}}));}}return BPromise[_0x9a41('0x70')](_0x24ab6d)[_0x9a41('0x17')](function(_0x252adf){_0x21a3dc=_(_0x21a3dc)['union'](_0x252adf)[_0x9a41('0x71')]()[_0x9a41('0x72')]();return db['OpenchannelQueue']['find']({'where':{'id':_0x472ba4[_0x9a41('0x40')]['id']}})[_0x9a41('0x17')](function(_0x433851){return db[_0x9a41('0x58')][_0x9a41('0x59')](function(_0x7a4668){return _0x433851[_0x9a41('0x60')](_0x472ba4[_0x9a41('0x2a')][_0x9a41('0x54')],{'transaction':_0x7a4668})['then'](function(){if(!_[_0x9a41('0x73')](_0x21a3dc)){return _0x433851['removeAgents'](_0x21a3dc,{'transaction':_0x7a4668});}})['then'](function(){_0x21a3dc[_0x9a41('0x5d')](function(_0x492b7a){socket[_0x9a41('0x5e')](_0x9a41('0x74'),{'UserId':_0x492b7a,'OpenchannelQueueId':_0x433851['id']});});});});});});})[_0x9a41('0x17')](respondWithStatusCode(_0x34b118,null))[_0x9a41('0x2c')](handleError(_0x34b118,null));};exports['addAgents']=function(_0x12bba8,_0x4f1cf5){return db[_0x9a41('0x21')][_0x9a41('0x3f')]({'where':{'id':_0x12bba8['params']['id']}})[_0x9a41('0x17')](handleEntityNotFound(_0x4f1cf5,null))[_0x9a41('0x17')](function(_0x25b666){if(_0x25b666){return _0x25b666[_0x9a41('0x75')](_0x12bba8[_0x9a41('0x38')]['ids'],_[_0x9a41('0x76')](_0x12bba8[_0x9a41('0x38')],[_0x9a41('0x54'),'id'])||{})[_0x9a41('0x77')](function(_0x387607){for(var _0xb79666=0x0;_0xb79666<_0x12bba8['body'][_0x9a41('0x54')]['length'];_0xb79666+=0x1){socket[_0x9a41('0x5e')](_0x9a41('0x5f'),{'UserId':Number(_0x12bba8[_0x9a41('0x38')][_0x9a41('0x54')][_0xb79666]),'OpenchannelQueueId':Number(_0x12bba8[_0x9a41('0x40')]['id'])});}return _0x387607;});}})[_0x9a41('0x17')](respondWithResult(_0x4f1cf5,null))['catch'](handleError(_0x4f1cf5,null));};exports[_0x9a41('0x78')]=function(_0xd4cba4,_0x3f1f04){return db[_0x9a41('0x21')]['find']({'where':{'id':_0xd4cba4[_0x9a41('0x40')]['id']}})[_0x9a41('0x17')](handleEntityNotFound(_0x3f1f04,null))[_0x9a41('0x17')](function(_0x2d65aa){if(_0x2d65aa){return _0x2d65aa[_0x9a41('0x78')](_0xd4cba4[_0x9a41('0x2a')][_0x9a41('0x54')])['then'](function(){if(_['isArray'](_0xd4cba4[_0x9a41('0x2a')][_0x9a41('0x54')])){for(var _0x5e8d19=0x0;_0x5e8d19<_0xd4cba4['query'][_0x9a41('0x54')][_0x9a41('0x34')];_0x5e8d19+=0x1){socket['emit'](_0x9a41('0x74'),{'UserId':Number(_0xd4cba4[_0x9a41('0x2a')][_0x9a41('0x54')][_0x5e8d19]),'OpenchannelQueueId':Number(_0xd4cba4[_0x9a41('0x40')]['id'])});}}else{socket[_0x9a41('0x5e')](_0x9a41('0x74'),{'UserId':Number(_0xd4cba4[_0x9a41('0x2a')][_0x9a41('0x54')]),'OpenchannelQueueId':Number(_0xd4cba4[_0x9a41('0x40')]['id'])});}});}})[_0x9a41('0x17')](respondWithStatusCode(_0x3f1f04,null))[_0x9a41('0x2c')](handleError(_0x3f1f04,null));};exports[_0x9a41('0x79')]=function(_0x487166,_0x3db4ac){var _0xb0d839={};var _0x2c2721={};var _0x3e6ac3;var _0x1e416c;return db[_0x9a41('0x21')]['findOne']({'where':{'id':_0x487166[_0x9a41('0x40')]['id']}})['then'](handleEntityNotFound(_0x3db4ac,null))[_0x9a41('0x17')](function(_0x343de0){if(_0x343de0){_0x3e6ac3=_0x343de0;_0x2c2721[_0x9a41('0x2e')]=_[_0x9a41('0x2f')](db[_0x9a41('0x49')][_0x9a41('0x22')]);_0x2c2721['query']=_['keys'](_0x487166['query']);_0x2c2721['filters']=_[_0x9a41('0x31')](_0x2c2721['model'],_0x2c2721[_0x9a41('0x2a')]);_0xb0d839[_0x9a41('0x33')]=_[_0x9a41('0x31')](_0x2c2721['model'],qs['fields'](_0x487166[_0x9a41('0x2a')][_0x9a41('0x32')]));_0xb0d839[_0x9a41('0x33')]=_0xb0d839[_0x9a41('0x33')][_0x9a41('0x34')]?_0xb0d839[_0x9a41('0x33')]:_0x2c2721[_0x9a41('0x2e')];_0xb0d839[_0x9a41('0x52')]=qs[_0x9a41('0x44')](_0x487166['query'][_0x9a41('0x44')]);_0xb0d839[_0x9a41('0x27')]=qs[_0x9a41('0x30')](_[_0x9a41('0x45')](_0x487166[_0x9a41('0x2a')],_0x2c2721[_0x9a41('0x30')]));if(_0x487166[_0x9a41('0x2a')][_0x9a41('0x47')]){_0xb0d839[_0x9a41('0x27')]=_[_0x9a41('0x35')](_0xb0d839[_0x9a41('0x27')],{'$or':_[_0x9a41('0x20')](_0xb0d839[_0x9a41('0x33')],function(_0x4cbb50){var _0x548ba4={};_0x548ba4[_0x4cbb50]={'$like':'%'+_0x487166['query'][_0x9a41('0x47')]+'%'};return _0x548ba4;})});}_0xb0d839=_['merge']({},_0xb0d839,_0x487166[_0x9a41('0x36')]);return _0x3e6ac3[_0x9a41('0x79')](_0xb0d839);}})['then'](function(_0x264797){if(_0x264797){_0x1e416c=_0x264797[_0x9a41('0x34')];if(!_0x487166[_0x9a41('0x2a')][_0x9a41('0x7a')](_0x9a41('0x53'))){_0xb0d839[_0x9a41('0x14')]=qs['limit'](_0x487166[_0x9a41('0x2a')]['limit']);_0xb0d839[_0x9a41('0x12')]=qs[_0x9a41('0x12')](_0x487166[_0x9a41('0x2a')][_0x9a41('0x12')]);}return _0x3e6ac3[_0x9a41('0x79')](_0xb0d839);}})[_0x9a41('0x17')](function(_0x45e709){if(_0x45e709){return _0x45e709?{'count':_0x1e416c,'rows':_0x45e709}:null;}})[_0x9a41('0x17')](respondWithResult(_0x3db4ac,null))[_0x9a41('0x2c')](handleError(_0x3db4ac,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 212bf26..dc865c5 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 _0x1f0d=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update'];(function(_0x56b578,_0xad0e2){var _0x435272=function(_0x204381){while(--_0x204381){_0x56b578['push'](_0x56b578['shift']());}};_0x435272(++_0xad0e2);}(_0x1f0d,0x102));var _0xd1f0=function(_0x3ab523,_0x355cc1){_0x3ab523=_0x3ab523-0x0;var _0x50a5a6=_0x1f0d[_0x3ab523];return _0x50a5a6;};'use strict';var EventEmitter=require(_0xd1f0('0x0'));var OpenchannelQueue=require(_0xd1f0('0x1'))['db'][_0xd1f0('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xd1f0('0x3')](0x0);var events={'afterCreate':_0xd1f0('0x4'),'afterUpdate':_0xd1f0('0x5'),'afterDestroy':_0xd1f0('0x6')};function emitEvent(_0x308f7e){return function(_0xe57bbf,_0x1d33f4,_0x1afb5b){OpenchannelQueueEvents[_0xd1f0('0x7')](_0x308f7e+':'+_0xe57bbf['id'],_0xe57bbf);OpenchannelQueueEvents['emit'](_0x308f7e,_0xe57bbf);_0x1afb5b(null);};}for(var e in events){if(events[_0xd1f0('0x8')](e)){var event=events[e];OpenchannelQueue[_0xd1f0('0x9')](e,emitEvent(event));}}module[_0xd1f0('0xa')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x1fcd=['hasOwnProperty','hook','exports','events','setMaxListeners','save','update','emit'];(function(_0x3c5667,_0x57a8ff){var _0x4eb4e3=function(_0x2b945f){while(--_0x2b945f){_0x3c5667['push'](_0x3c5667['shift']());}};_0x4eb4e3(++_0x57a8ff);}(_0x1fcd,0x19b));var _0xd1fc=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x1fcd[_0x3e5086];return _0xfeb102;};'use strict';var EventEmitter=require(_0xd1fc('0x0'));var OpenchannelQueue=require('../../mysqldb')['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xd1fc('0x1')](0x0);var events={'afterCreate':_0xd1fc('0x2'),'afterUpdate':_0xd1fc('0x3'),'afterDestroy':'remove'};function emitEvent(_0x559d5b){return function(_0x1d878b,_0x1ee592,_0x3af02f){OpenchannelQueueEvents['emit'](_0x559d5b+':'+_0x1d878b['id'],_0x1d878b);OpenchannelQueueEvents[_0xd1fc('0x4')](_0x559d5b,_0x1d878b);_0x3af02f(null);};}for(var e in events){if(events[_0xd1fc('0x5')](e)){var event=events[e];OpenchannelQueue[_0xd1fc('0x6')](e,emitEvent(event));}}module[_0xd1fc('0x7')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 3373b18..3d79bf0 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 _0x4455=['api','bluebird','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','lodash','../../config/logger'];(function(_0x2bdd9b,_0x3df1bc){var _0x103e81=function(_0x26184b){while(--_0x26184b){_0x2bdd9b['push'](_0x2bdd9b['shift']());}};_0x103e81(++_0x3df1bc);}(_0x4455,0xa8));var _0x5445=function(_0x27c6df,_0x4bbe0b){_0x27c6df=_0x27c6df-0x0;var _0xd065cf=_0x4455[_0x27c6df];return _0xd065cf;};'use strict';var _=require(_0x5445('0x0'));var util=require('util');var logger=require(_0x5445('0x1'))(_0x5445('0x2'));var moment=require('moment');var BPromise=require(_0x5445('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5445('0x4'));var rimraf=require(_0x5445('0x5'));var config=require(_0x5445('0x6'));var attributes=require(_0x5445('0x7'));module[_0x5445('0x8')]=function(_0x430f3e,_0x2bf51d){return _0x430f3e[_0x5445('0x9')]('OpenchannelQueue',attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d67=['./openchannelQueue.attributes','exports','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5e11ff,_0x247853){var _0x38498e=function(_0x410d6e){while(--_0x410d6e){_0x5e11ff['push'](_0x5e11ff['shift']());}};_0x38498e(++_0x247853);}(_0x2d67,0x1a0));var _0x72d6=function(_0x3f477c,_0x52b7ff){_0x3f477c=_0x3f477c-0x0;var _0x4c36b3=_0x2d67[_0x3f477c];return _0x4c36b3;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x72d6('0x0'));var moment=require(_0x72d6('0x1'));var BPromise=require(_0x72d6('0x2'));var rp=require(_0x72d6('0x3'));var fs=require('fs');var path=require(_0x72d6('0x4'));var rimraf=require(_0x72d6('0x5'));var config=require(_0x72d6('0x6'));var attributes=require(_0x72d6('0x7'));module[_0x72d6('0x8')]=function(_0x56c165,_0x5b0a1a){return _0x56c165['define']('OpenchannelQueue',attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index da0b5c5..7d57242 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 _0x3553=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','info','catch','OpenchannelQueue','options','raw','where','limit','include','map','model','attributes','GetOpenchannelQueue','ShowOpenchannelQueue','find','lodash'];(function(_0x4fb993,_0x4fd8ef){var _0x348c09=function(_0x38c9da){while(--_0x38c9da){_0x4fb993['push'](_0x4fb993['shift']());}};_0x348c09(++_0x4fd8ef);}(_0x3553,0x1b7));var _0x3355=function(_0x3070ff,_0x32679a){_0x3070ff=_0x3070ff-0x0;var _0x5de313=_0x3553[_0x3070ff];return _0x5de313;};'use strict';var _=require(_0x3355('0x0'));var util=require('util');var moment=require(_0x3355('0x1'));var BPromise=require('bluebird');var rs=require(_0x3355('0x2'));var fs=require('fs');var Redis=require(_0x3355('0x3'));var db=require(_0x3355('0x4'))['db'];var utils=require(_0x3355('0x5'));var logger=require(_0x3355('0x6'))(_0x3355('0x7'));var config=require('../../config/environment');var jayson=require(_0x3355('0x8'));var client=jayson[_0x3355('0x9')][_0x3355('0xa')]({'port':0x232a});config['redis']=_[_0x3355('0xb')](config[_0x3355('0xc')],{'host':_0x3355('0xd'),'port':0x18eb});var socket=require(_0x3355('0xe'))(new Redis(config[_0x3355('0xc')]));require('./openchannelQueue.socket')[_0x3355('0xf')](socket);function respondWithRpcPromise(_0xb4eed,_0x1cf1eb,_0x2dc6ed){return new BPromise(function(_0x40d43d,_0x52ccfb){return client[_0x3355('0x10')](_0xb4eed,_0x2dc6ed)[_0x3355('0x11')](function(_0x4bca28){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x1cf1eb,_0x3355('0x12'));logger[_0x3355('0x13')](_0x3355('0x14'),_0x1cf1eb,_0x3355('0x12'),JSON[_0x3355('0x15')](_0x4bca28));if(_0x4bca28[_0x3355('0x16')]){if(_0x4bca28[_0x3355('0x16')][_0x3355('0x17')]===0x1f4){logger['error'](_0x3355('0x18'),_0x1cf1eb,_0x4bca28[_0x3355('0x16')][_0x3355('0x19')]);return _0x52ccfb(_0x4bca28[_0x3355('0x16')][_0x3355('0x19')]);}logger['error'](_0x3355('0x18'),_0x1cf1eb,_0x4bca28[_0x3355('0x16')]['message']);return _0x40d43d(_0x4bca28['error'][_0x3355('0x19')]);}else{logger[_0x3355('0x1a')](_0x3355('0x18'),_0x1cf1eb,_0x3355('0x12'));_0x40d43d(_0x4bca28['result'][_0x3355('0x19')]);}})[_0x3355('0x1b')](function(_0x5d0964){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x1cf1eb,_0x5d0964);_0x52ccfb(_0x5d0964);});});}exports['GetOpenchannelQueue']=function(_0x30fe55){var _0x10028c=this;return new Promise(function(_0x16fee7,_0xd96bc9){return db[_0x3355('0x1c')]['findAll']({'raw':_0x30fe55[_0x3355('0x1d')]?_0x30fe55['options'][_0x3355('0x1e')]===undefined?!![]:![]:!![],'where':_0x30fe55[_0x3355('0x1d')]?_0x30fe55[_0x3355('0x1d')][_0x3355('0x1f')]||null:null,'attributes':_0x30fe55[_0x3355('0x1d')]?_0x30fe55[_0x3355('0x1d')]['attributes']||null:null,'limit':_0x30fe55[_0x3355('0x1d')]?_0x30fe55[_0x3355('0x1d')][_0x3355('0x20')]||null:null,'include':_0x30fe55[_0x3355('0x1d')]?_0x30fe55['options'][_0x3355('0x21')]?_[_0x3355('0x22')](_0x30fe55[_0x3355('0x1d')][_0x3355('0x21')],function(_0x335705){return{'model':db[_0x335705[_0x3355('0x23')]],'as':_0x335705['as'],'attributes':_0x335705[_0x3355('0x24')],'include':_0x335705[_0x3355('0x21')]?_[_0x3355('0x22')](_0x335705[_0x3355('0x21')],function(_0x4c4207){return{'model':db[_0x4c4207[_0x3355('0x23')]],'as':_0x4c4207['as'],'attributes':_0x4c4207['attributes'],'include':_0x4c4207[_0x3355('0x21')]?_[_0x3355('0x22')](_0x4c4207[_0x3355('0x21')],function(_0x3734e3){return{'model':db[_0x3734e3[_0x3355('0x23')]],'as':_0x3734e3['as'],'attributes':_0x3734e3[_0x3355('0x24')]};}):[]};}):[]};}):[]:[]})[_0x3355('0x11')](function(_0x4a095f){logger['info'](_0x3355('0x25'),_0x30fe55);logger[_0x3355('0x13')]('GetOpenchannelQueue',_0x30fe55,JSON[_0x3355('0x15')](_0x4a095f));_0x16fee7(_0x4a095f);})['catch'](function(_0x5eb68e){logger[_0x3355('0x16')](_0x3355('0x25'),_0x5eb68e[_0x3355('0x19')],_0x30fe55);_0xd96bc9(_0x10028c[_0x3355('0x16')](0x1f4,_0x5eb68e['message']));});});};exports[_0x3355('0x26')]=function(_0x554aa6){var _0x382c95=this;return new Promise(function(_0x67584f,_0x4e2dcc){return db[_0x3355('0x1c')][_0x3355('0x27')]({'raw':_0x554aa6[_0x3355('0x1d')]?_0x554aa6['options'][_0x3355('0x1e')]===undefined?!![]:![]:!![],'where':_0x554aa6[_0x3355('0x1d')]?_0x554aa6[_0x3355('0x1d')]['where']||null:null,'attributes':_0x554aa6[_0x3355('0x1d')]?_0x554aa6['options'][_0x3355('0x24')]||null:null,'include':_0x554aa6[_0x3355('0x1d')]?_0x554aa6['options'][_0x3355('0x21')]?_[_0x3355('0x22')](_0x554aa6['options'][_0x3355('0x21')],function(_0x34f2f3){return{'model':db[_0x34f2f3[_0x3355('0x23')]],'as':_0x34f2f3['as'],'attributes':_0x34f2f3[_0x3355('0x24')],'include':_0x34f2f3[_0x3355('0x21')]?_['map'](_0x34f2f3[_0x3355('0x21')],function(_0x4cd399){return{'model':db[_0x4cd399[_0x3355('0x23')]],'as':_0x4cd399['as'],'attributes':_0x4cd399['attributes'],'include':_0x4cd399[_0x3355('0x21')]?_['map'](_0x4cd399['include'],function(_0x529ad8){return{'model':db[_0x529ad8[_0x3355('0x23')]],'as':_0x529ad8['as'],'attributes':_0x529ad8[_0x3355('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xccfeee){logger[_0x3355('0x1a')](_0x3355('0x26'),_0x554aa6);logger[_0x3355('0x13')](_0x3355('0x26'),_0x554aa6,JSON[_0x3355('0x15')](_0xccfeee));_0x67584f(_0xccfeee);})['catch'](function(_0x4692d1){logger[_0x3355('0x16')](_0x3355('0x26'),_0x4692d1['message'],_0x554aa6);_0x4e2dcc(_0x382c95[_0x3355('0x16')](0x1f4,_0x4692d1[_0x3355('0x19')]));});});}; \ No newline at end of file +var _0x399c=['register','then','info','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','options','raw','where','attributes','limit','include','map','model','ShowOpenchannelQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','defaults','localhost'];(function(_0x155758,_0x73fd3d){var _0x573c15=function(_0x52f316){while(--_0x52f316){_0x155758['push'](_0x155758['shift']());}};_0x573c15(++_0x73fd3d);}(_0x399c,0xf7));var _0xc399=function(_0x3d2b02,_0x4af5aa){_0x3d2b02=_0x3d2b02-0x0;var _0x45ee5a=_0x399c[_0x3d2b02];return _0x45ee5a;};'use strict';var _=require(_0xc399('0x0'));var util=require(_0xc399('0x1'));var moment=require(_0xc399('0x2'));var BPromise=require('bluebird');var rs=require(_0xc399('0x3'));var fs=require('fs');var Redis=require(_0xc399('0x4'));var db=require(_0xc399('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc399('0x6'))('rpc');var config=require(_0xc399('0x7'));var jayson=require(_0xc399('0x8'));var client=jayson['client'][_0xc399('0x9')]({'port':0x232a});config['redis']=_[_0xc399('0xa')](config['redis'],{'host':_0xc399('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelQueue.socket')[_0xc399('0xc')](socket);function respondWithRpcPromise(_0x59f571,_0x598930,_0x1cf123){return new BPromise(function(_0x2358d8,_0x17dbb3){return client['request'](_0x59f571,_0x1cf123)[_0xc399('0xd')](function(_0xf017f3){logger[_0xc399('0xe')]('OpenchannelQueue,\x20%s,\x20%s',_0x598930,_0xc399('0xf'));logger[_0xc399('0x10')](_0xc399('0x11'),_0x598930,'request\x20sent',JSON[_0xc399('0x12')](_0xf017f3));if(_0xf017f3[_0xc399('0x13')]){if(_0xf017f3[_0xc399('0x13')][_0xc399('0x14')]===0x1f4){logger[_0xc399('0x13')](_0xc399('0x15'),_0x598930,_0xf017f3[_0xc399('0x13')][_0xc399('0x16')]);return _0x17dbb3(_0xf017f3[_0xc399('0x13')][_0xc399('0x16')]);}logger[_0xc399('0x13')](_0xc399('0x15'),_0x598930,_0xf017f3[_0xc399('0x13')][_0xc399('0x16')]);return _0x2358d8(_0xf017f3[_0xc399('0x13')][_0xc399('0x16')]);}else{logger[_0xc399('0xe')](_0xc399('0x15'),_0x598930,'request\x20sent');_0x2358d8(_0xf017f3[_0xc399('0x17')][_0xc399('0x16')]);}})[_0xc399('0x18')](function(_0x82cfdc){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x598930,_0x82cfdc);_0x17dbb3(_0x82cfdc);});});}exports[_0xc399('0x19')]=function(_0x5bdcc4){var _0x12e170=this;return new Promise(function(_0x597ac6,_0x10be75){return db[_0xc399('0x1a')]['findAll']({'raw':_0x5bdcc4[_0xc399('0x1b')]?_0x5bdcc4[_0xc399('0x1b')][_0xc399('0x1c')]===undefined?!![]:![]:!![],'where':_0x5bdcc4['options']?_0x5bdcc4[_0xc399('0x1b')][_0xc399('0x1d')]||null:null,'attributes':_0x5bdcc4[_0xc399('0x1b')]?_0x5bdcc4[_0xc399('0x1b')][_0xc399('0x1e')]||null:null,'limit':_0x5bdcc4[_0xc399('0x1b')]?_0x5bdcc4[_0xc399('0x1b')][_0xc399('0x1f')]||null:null,'include':_0x5bdcc4[_0xc399('0x1b')]?_0x5bdcc4[_0xc399('0x1b')][_0xc399('0x20')]?_[_0xc399('0x21')](_0x5bdcc4[_0xc399('0x1b')][_0xc399('0x20')],function(_0xa7b9b9){return{'model':db[_0xa7b9b9[_0xc399('0x22')]],'as':_0xa7b9b9['as'],'attributes':_0xa7b9b9[_0xc399('0x1e')],'include':_0xa7b9b9[_0xc399('0x20')]?_['map'](_0xa7b9b9[_0xc399('0x20')],function(_0x125fa3){return{'model':db[_0x125fa3[_0xc399('0x22')]],'as':_0x125fa3['as'],'attributes':_0x125fa3[_0xc399('0x1e')],'include':_0x125fa3[_0xc399('0x20')]?_['map'](_0x125fa3[_0xc399('0x20')],function(_0x491646){return{'model':db[_0x491646[_0xc399('0x22')]],'as':_0x491646['as'],'attributes':_0x491646[_0xc399('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc399('0xd')](function(_0x38a6cb){logger[_0xc399('0xe')]('GetOpenchannelQueue',_0x5bdcc4);logger[_0xc399('0x10')](_0xc399('0x19'),_0x5bdcc4,JSON[_0xc399('0x12')](_0x38a6cb));_0x597ac6(_0x38a6cb);})[_0xc399('0x18')](function(_0x28e735){logger[_0xc399('0x13')](_0xc399('0x19'),_0x28e735['message'],_0x5bdcc4);_0x10be75(_0x12e170[_0xc399('0x13')](0x1f4,_0x28e735[_0xc399('0x16')]));});});};exports[_0xc399('0x23')]=function(_0x14aa09){var _0x4da251=this;return new Promise(function(_0x1603f3,_0x248d7c){return db[_0xc399('0x1a')][_0xc399('0x24')]({'raw':_0x14aa09['options']?_0x14aa09[_0xc399('0x1b')][_0xc399('0x1c')]===undefined?!![]:![]:!![],'where':_0x14aa09[_0xc399('0x1b')]?_0x14aa09[_0xc399('0x1b')]['where']||null:null,'attributes':_0x14aa09[_0xc399('0x1b')]?_0x14aa09[_0xc399('0x1b')][_0xc399('0x1e')]||null:null,'include':_0x14aa09[_0xc399('0x1b')]?_0x14aa09['options'][_0xc399('0x20')]?_[_0xc399('0x21')](_0x14aa09[_0xc399('0x1b')]['include'],function(_0x12ee88){return{'model':db[_0x12ee88[_0xc399('0x22')]],'as':_0x12ee88['as'],'attributes':_0x12ee88[_0xc399('0x1e')],'include':_0x12ee88['include']?_[_0xc399('0x21')](_0x12ee88[_0xc399('0x20')],function(_0x595442){return{'model':db[_0x595442['model']],'as':_0x595442['as'],'attributes':_0x595442[_0xc399('0x1e')],'include':_0x595442[_0xc399('0x20')]?_[_0xc399('0x21')](_0x595442[_0xc399('0x20')],function(_0x5e8a5f){return{'model':db[_0x5e8a5f[_0xc399('0x22')]],'as':_0x5e8a5f['as'],'attributes':_0x5e8a5f[_0xc399('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc399('0xd')](function(_0x45d33c){logger[_0xc399('0xe')](_0xc399('0x23'),_0x14aa09);logger['debug']('ShowOpenchannelQueue',_0x14aa09,JSON[_0xc399('0x12')](_0x45d33c));_0x1603f3(_0x45d33c);})['catch'](function(_0xe5b27c){logger['error'](_0xc399('0x23'),_0xe5b27c['message'],_0x14aa09);_0x248d7c(_0x4da251[_0xc399('0x13')](0x1f4,_0xe5b27c[_0xc399('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 54e4473..5fb8508 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 _0x8eb0=['remove','update','emit','register','length','save'];(function(_0x37c410,_0x5b072f){var _0x926c00=function(_0x584f5a){while(--_0x584f5a){_0x37c410['push'](_0x37c410['shift']());}};_0x926c00(++_0x5b072f);}(_0x8eb0,0x1a3));var _0x08eb=function(_0x12f4bf,_0x47cc68){_0x12f4bf=_0x12f4bf-0x0;var _0x3f3692=_0x8eb0[_0x12f4bf];return _0x3f3692;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x08eb('0x0'),_0x08eb('0x1'),_0x08eb('0x2')];function createListener(_0x47f081,_0x4162cd){return function(_0x35e41a){_0x4162cd[_0x08eb('0x3')](_0x47f081,_0x35e41a);};}function removeListener(_0x567fa5,_0x46d708){return function(){OpenchannelQueueEvents['removeListener'](_0x567fa5,_0x46d708);};}exports[_0x08eb('0x4')]=function(_0x3942b0){for(var _0x204bfd=0x0,_0xd43cd2=events[_0x08eb('0x5')];_0x204bfd<_0xd43cd2;_0x204bfd++){var _0x3e5b46=events[_0x204bfd];var _0x1ace2b=createListener('openchannelQueue:'+_0x3e5b46,_0x3942b0);OpenchannelQueueEvents['on'](_0x3e5b46,_0x1ace2b);}}; \ No newline at end of file +var _0x2d22=['save','emit','removeListener','register','length','openchannelQueue:'];(function(_0x24ef05,_0x4132bb){var _0x35792a=function(_0x29b1bf){while(--_0x29b1bf){_0x24ef05['push'](_0x24ef05['shift']());}};_0x35792a(++_0x4132bb);}(_0x2d22,0x1da));var _0x22d2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2d22[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x22d2('0x0'),'remove','update'];function createListener(_0x1d848e,_0x4feaa4){return function(_0x20d43e){_0x4feaa4[_0x22d2('0x1')](_0x1d848e,_0x20d43e);};}function removeListener(_0xdcd2d4,_0x25808b){return function(){OpenchannelQueueEvents[_0x22d2('0x2')](_0xdcd2d4,_0x25808b);};}exports[_0x22d2('0x3')]=function(_0x15d34a){for(var _0x53c356=0x0,_0x11f056=events[_0x22d2('0x4')];_0x53c356<_0x11f056;_0x53c356++){var _0x2add6b=events[_0x53c356];var _0x5cc376=createListener(_0x22d2('0x5')+_0x2add6b,_0x15d34a);OpenchannelQueueEvents['on'](_0x2add6b,_0x5cc376);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index de240da..d849c07 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 _0x66a1=['put','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','/describe','get','/:id','show','post'];(function(_0x5b6cd3,_0x2fcf1b){var _0x34f3a6=function(_0x59f523){while(--_0x59f523){_0x5b6cd3['push'](_0x5b6cd3['shift']());}};_0x34f3a6(++_0x2fcf1b);}(_0x66a1,0xc2));var _0x166a=function(_0x39d33d,_0x38eeb4){_0x39d33d=_0x39d33d-0x0;var _0x397fd9=_0x66a1[_0x39d33d];return _0x397fd9;};'use strict';var multer=require(_0x166a('0x0'));var util=require(_0x166a('0x1'));var path=require(_0x166a('0x2'));var timeout=require(_0x166a('0x3'));var express=require(_0x166a('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x166a('0x5'));var interaction=require(_0x166a('0x6'));var config=require(_0x166a('0x7'));var controller=require(_0x166a('0x8'));router['get']('/',auth[_0x166a('0x9')](),controller['index']);router['get'](_0x166a('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x166a('0xb')](_0x166a('0xc'),auth[_0x166a('0x9')](),controller[_0x166a('0xd')]);router[_0x166a('0xe')]('/',auth[_0x166a('0x9')](),controller['create']);router[_0x166a('0xf')]('/:id',auth[_0x166a('0x9')](),controller[_0x166a('0x10')]);router['delete'](_0x166a('0xc'),auth[_0x166a('0x9')](),controller[_0x166a('0x11')]);module[_0x166a('0x12')]=router; \ No newline at end of file +var _0x9075=['post','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x48af21,_0xbb5da7){var _0x278645=function(_0x30d4e2){while(--_0x30d4e2){_0x48af21['push'](_0x48af21['shift']());}};_0x278645(++_0xbb5da7);}(_0x9075,0x109));var _0x5907=function(_0x242566,_0x4ec88d){_0x242566=_0x242566-0x0;var _0x1bc410=_0x9075[_0x242566];return _0x1bc410;};'use strict';var multer=require('multer');var util=require(_0x5907('0x0'));var path=require(_0x5907('0x1'));var timeout=require('connect-timeout');var express=require(_0x5907('0x2'));var router=express[_0x5907('0x3')]();var fs_extra=require(_0x5907('0x4'));var auth=require(_0x5907('0x5'));var interaction=require(_0x5907('0x6'));var config=require(_0x5907('0x7'));var controller=require(_0x5907('0x8'));router[_0x5907('0x9')]('/',auth[_0x5907('0xa')](),controller[_0x5907('0xb')]);router['get'](_0x5907('0xc'),auth[_0x5907('0xa')](),controller[_0x5907('0xd')]);router[_0x5907('0x9')](_0x5907('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x5907('0xf')]('/',auth[_0x5907('0xa')](),controller['create']);router['put'](_0x5907('0xe'),auth['isAuthenticated'](),controller[_0x5907('0x10')]);router[_0x5907('0x11')](_0x5907('0xe'),auth[_0x5907('0xa')](),controller[_0x5907('0x12')]);module[_0x5907('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 98252e3..6672e3c 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 _0x3199=['sequelize','exports','STRING','DATE','moment'];(function(_0x403a83,_0x218ba0){var _0xf0fd56=function(_0x3be410){while(--_0x3be410){_0x403a83['push'](_0x403a83['shift']());}};_0xf0fd56(++_0x218ba0);}(_0x3199,0x1bc));var _0x9319=function(_0x3f1230,_0x5a2050){_0x3f1230=_0x3f1230-0x0;var _0x9238e2=_0x3199[_0x3f1230];return _0x9238e2;};'use strict';var moment=require(_0x9319('0x0'));var Sequelize=require(_0x9319('0x1'));module[_0x9319('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x9319('0x3')]},'joinAt':{'type':Sequelize[_0x9319('0x4')]},'leaveAt':{'type':Sequelize[_0x9319('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x9319('0x4')]},'reason':{'type':Sequelize[_0x9319('0x3')]}}; \ No newline at end of file +var _0x793b=['moment','sequelize','exports','STRING','DATE'];(function(_0x1346a0,_0x3d11e3){var _0x5cf0b5=function(_0x30e8a0){while(--_0x30e8a0){_0x1346a0['push'](_0x1346a0['shift']());}};_0x5cf0b5(++_0x3d11e3);}(_0x793b,0x1ae));var _0xb793=function(_0x2ed86d,_0x2e804e){_0x2ed86d=_0x2ed86d-0x0;var _0xe13c85=_0x793b[_0x2ed86d];return _0xe13c85;};'use strict';var moment=require(_0xb793('0x0'));var Sequelize=require(_0xb793('0x1'));module[_0xb793('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xb793('0x3')]},'joinAt':{'type':Sequelize[_0xb793('0x4')]},'leaveAt':{'type':Sequelize[_0xb793('0x4')]},'acceptAt':{'type':Sequelize[_0xb793('0x4')]},'exitAt':{'type':Sequelize[_0xb793('0x4')]},'reason':{'type':Sequelize[_0xb793('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 3b1cc34..5a3922b 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 _0xba07=['pick','filter','merge','VIRTUAL','options','OpenchannelQueueReport','includeAll','include','findAll','rows','catch','show','keys','length','find','create','body','params','destroy','describe','eml-format','rimraf','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where'];(function(_0x1dba86,_0x22d58e){var _0x44886e=function(_0x3fd5f1){while(--_0x3fd5f1){_0x1dba86['push'](_0x1dba86['shift']());}};_0x44886e(++_0x22d58e);}(_0xba07,0x1e8));var _0x7ba0=function(_0x2c6559,_0x3a3d99){_0x2c6559=_0x2c6559-0x0;var _0x1a0f7e=_0xba07[_0x2c6559];return _0x1a0f7e;};'use strict';var emlformat=require(_0x7ba0('0x0'));var rimraf=require(_0x7ba0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7ba0('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x7ba0('0x3'));var util=require(_0x7ba0('0x4'));var path=require(_0x7ba0('0x5'));var sox=require(_0x7ba0('0x6'));var csv=require(_0x7ba0('0x7'));var ejs=require(_0x7ba0('0x8'));var fs=require('fs');var fs_extra=require(_0x7ba0('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7ba0('0xa'));var jsforce=require(_0x7ba0('0xb'));var deskjs=require(_0x7ba0('0xc'));var toCsv=require(_0x7ba0('0x7'));var querystring=require(_0x7ba0('0xd'));var Papa=require(_0x7ba0('0xe'));var Redis=require('ioredis');var authService=require(_0x7ba0('0xf'));var qs=require(_0x7ba0('0x10'));var as=require(_0x7ba0('0x11'));var hardwareService=require(_0x7ba0('0x12'));var logger=require(_0x7ba0('0x13'))(_0x7ba0('0x14'));var utils=require(_0x7ba0('0x15'));var config=require(_0x7ba0('0x16'));var licenseUtil=require(_0x7ba0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1cfbf8,_0xe0e0f4){_0xe0e0f4=_0xe0e0f4||0xcc;return function(_0x12220e){if(_0x12220e){return _0x1cfbf8[_0x7ba0('0x18')](_0xe0e0f4);}return _0x1cfbf8[_0x7ba0('0x19')](_0xe0e0f4)[_0x7ba0('0x1a')]();};}function respondWithResult(_0x2b44f7,_0x38a6e8){_0x38a6e8=_0x38a6e8||0xc8;return function(_0x2f653c){if(_0x2f653c){return _0x2b44f7[_0x7ba0('0x19')](_0x38a6e8)[_0x7ba0('0x1b')](_0x2f653c);}};}function respondWithFilteredResult(_0xc07080,_0x94c8f1){return function(_0x1d156d){if(_0x1d156d){var _0x44f301=typeof _0x94c8f1[_0x7ba0('0x1c')]==='undefined'&&typeof _0x94c8f1[_0x7ba0('0x1d')]===_0x7ba0('0x1e');var _0x14998a=_0x1d156d[_0x7ba0('0x1f')];var _0x4b5b66=_0x44f301?0x0:_0x94c8f1['offset'];var _0x107c34=_0x44f301?_0x1d156d[_0x7ba0('0x1f')]:_0x94c8f1[_0x7ba0('0x1c')]+_0x94c8f1['limit'];var _0x5017f4;if(_0x107c34>=_0x14998a){_0x107c34=_0x14998a;_0x5017f4=0xc8;}else{_0x5017f4=0xce;}_0xc07080['status'](_0x5017f4);return _0xc07080[_0x7ba0('0x20')]('Content-Range',_0x4b5b66+'-'+_0x107c34+'/'+_0x14998a)[_0x7ba0('0x1b')](_0x1d156d);}return null;};}function patchUpdates(_0x311f98){return function(_0x46c5b7){try{jsonpatch[_0x7ba0('0x21')](_0x46c5b7,_0x311f98,!![]);}catch(_0x2e9caf){return BPromise[_0x7ba0('0x22')](_0x2e9caf);}return _0x46c5b7[_0x7ba0('0x23')]();};}function saveUpdates(_0x6cf393,_0x450402){return function(_0x2e9dbf){if(_0x2e9dbf){return _0x2e9dbf[_0x7ba0('0x24')](_0x6cf393)['then'](function(_0x33e79a){return _0x33e79a;});}return null;};}function removeEntity(_0x46a4c0,_0x27f49a){return function(_0x32b579){if(_0x32b579){return _0x32b579['destroy']()[_0x7ba0('0x25')](function(){_0x46a4c0[_0x7ba0('0x19')](0xcc)[_0x7ba0('0x1a')]();});}};}function handleEntityNotFound(_0x2eb627,_0x21977d){return function(_0x4a3be1){if(!_0x4a3be1){_0x2eb627[_0x7ba0('0x18')](0x194);}return _0x4a3be1;};}function handleError(_0x3a8257,_0x1f9337){_0x1f9337=_0x1f9337||0x1f4;return function(_0x1ba069){logger[_0x7ba0('0x26')](_0x1ba069[_0x7ba0('0x27')]);if(_0x1ba069['name']){delete _0x1ba069[_0x7ba0('0x28')];}_0x3a8257['status'](_0x1f9337)[_0x7ba0('0x29')](_0x1ba069);};}exports[_0x7ba0('0x2a')]=function(_0x2cdb7a,_0x534337){var _0x1c08f9={},_0x103f12={},_0x1f3adb={'count':0x0,'rows':[]};var _0x401d7b=_[_0x7ba0('0x2b')](db['OpenchannelQueueReport'][_0x7ba0('0x2c')],function(_0x13be27){return{'name':_0x13be27[_0x7ba0('0x2d')],'type':_0x13be27[_0x7ba0('0x2e')][_0x7ba0('0x2f')]};});_0x103f12[_0x7ba0('0x30')]=_[_0x7ba0('0x2b')](_0x401d7b,_0x7ba0('0x28'));_0x103f12[_0x7ba0('0x31')]=_['keys'](_0x2cdb7a[_0x7ba0('0x31')]);_0x103f12[_0x7ba0('0x32')]=_['intersection'](_0x103f12[_0x7ba0('0x30')],_0x103f12[_0x7ba0('0x31')]);_0x1c08f9['attributes']=_[_0x7ba0('0x33')](_0x103f12[_0x7ba0('0x30')],qs[_0x7ba0('0x34')](_0x2cdb7a[_0x7ba0('0x31')]['fields']));_0x1c08f9['attributes']=_0x1c08f9['attributes']['length']?_0x1c08f9[_0x7ba0('0x35')]:_0x103f12[_0x7ba0('0x30')];if(!_0x2cdb7a[_0x7ba0('0x31')][_0x7ba0('0x36')]('nolimit')){_0x1c08f9[_0x7ba0('0x1d')]=qs['limit'](_0x2cdb7a['query'][_0x7ba0('0x1d')]);_0x1c08f9[_0x7ba0('0x1c')]=qs[_0x7ba0('0x1c')](_0x2cdb7a[_0x7ba0('0x31')][_0x7ba0('0x1c')]);}_0x1c08f9[_0x7ba0('0x37')]=qs[_0x7ba0('0x38')](_0x2cdb7a['query'][_0x7ba0('0x38')]);_0x1c08f9[_0x7ba0('0x39')]=qs[_0x7ba0('0x32')](_[_0x7ba0('0x3a')](_0x2cdb7a['query'],_0x103f12[_0x7ba0('0x32')]),_0x401d7b);if(_0x2cdb7a['query'][_0x7ba0('0x3b')]){_0x1c08f9[_0x7ba0('0x39')]=_[_0x7ba0('0x3c')](_0x1c08f9[_0x7ba0('0x39')],{'$or':_['map'](_0x401d7b,function(_0x1860ec){if(_0x1860ec[_0x7ba0('0x2e')]!==_0x7ba0('0x3d')){var _0x2ea079={};_0x2ea079[_0x1860ec[_0x7ba0('0x28')]]={'$like':'%'+_0x2cdb7a['query'][_0x7ba0('0x3b')]+'%'};return _0x2ea079;}})});}_0x1c08f9=_['merge']({},_0x1c08f9,_0x2cdb7a[_0x7ba0('0x3e')]);var _0xc38f87={'where':_0x1c08f9[_0x7ba0('0x39')]};return db[_0x7ba0('0x3f')]['count'](_0xc38f87)['then'](function(_0xd2ec3b){_0x1f3adb[_0x7ba0('0x1f')]=_0xd2ec3b;if(_0x2cdb7a[_0x7ba0('0x31')][_0x7ba0('0x40')]){_0x1c08f9[_0x7ba0('0x41')]=[{'all':!![]}];}return db[_0x7ba0('0x3f')][_0x7ba0('0x42')](_0x1c08f9);})[_0x7ba0('0x25')](function(_0x421bb0){_0x1f3adb[_0x7ba0('0x43')]=_0x421bb0;return _0x1f3adb;})['then'](respondWithFilteredResult(_0x534337,_0x1c08f9))[_0x7ba0('0x44')](handleError(_0x534337,null));};exports[_0x7ba0('0x45')]=function(_0x1c55e2,_0x19a6ee){var _0x10e053={'raw':!![],'where':{'id':_0x1c55e2['params']['id']}},_0x848a61={};_0x848a61[_0x7ba0('0x30')]=_[_0x7ba0('0x46')](db[_0x7ba0('0x3f')]['rawAttributes']);_0x848a61[_0x7ba0('0x31')]=_[_0x7ba0('0x46')](_0x1c55e2[_0x7ba0('0x31')]);_0x848a61['filters']=_[_0x7ba0('0x33')](_0x848a61[_0x7ba0('0x30')],_0x848a61[_0x7ba0('0x31')]);_0x10e053[_0x7ba0('0x35')]=_[_0x7ba0('0x33')](_0x848a61['model'],qs[_0x7ba0('0x34')](_0x1c55e2[_0x7ba0('0x31')]['fields']));_0x10e053[_0x7ba0('0x35')]=_0x10e053[_0x7ba0('0x35')][_0x7ba0('0x47')]?_0x10e053[_0x7ba0('0x35')]:_0x848a61[_0x7ba0('0x30')];if(_0x1c55e2[_0x7ba0('0x31')][_0x7ba0('0x40')]){_0x10e053[_0x7ba0('0x41')]=[{'all':!![]}];}_0x10e053=_[_0x7ba0('0x3c')]({},_0x10e053,_0x1c55e2[_0x7ba0('0x3e')]);return db[_0x7ba0('0x3f')][_0x7ba0('0x48')](_0x10e053)[_0x7ba0('0x25')](handleEntityNotFound(_0x19a6ee,null))['then'](respondWithResult(_0x19a6ee,null))[_0x7ba0('0x44')](handleError(_0x19a6ee,null));};exports[_0x7ba0('0x49')]=function(_0x5b439,_0x36a528){return db['OpenchannelQueueReport']['create'](_0x5b439['body'],{})[_0x7ba0('0x25')](respondWithResult(_0x36a528,0xc9))[_0x7ba0('0x44')](handleError(_0x36a528,null));};exports[_0x7ba0('0x24')]=function(_0x163682,_0xb423fb){if(_0x163682[_0x7ba0('0x4a')]['id']){delete _0x163682[_0x7ba0('0x4a')]['id'];}return db[_0x7ba0('0x3f')]['find']({'where':{'id':_0x163682[_0x7ba0('0x4b')]['id']}})[_0x7ba0('0x25')](handleEntityNotFound(_0xb423fb,null))['then'](saveUpdates(_0x163682['body'],null))[_0x7ba0('0x25')](respondWithResult(_0xb423fb,null))[_0x7ba0('0x44')](handleError(_0xb423fb,null));};exports[_0x7ba0('0x4c')]=function(_0x4490a5,_0x45d93f){return db[_0x7ba0('0x3f')][_0x7ba0('0x48')]({'where':{'id':_0x4490a5['params']['id']}})[_0x7ba0('0x25')](handleEntityNotFound(_0x45d93f,null))[_0x7ba0('0x25')](removeEntity(_0x45d93f,null))[_0x7ba0('0x44')](handleError(_0x45d93f,null));};exports[_0x7ba0('0x4d')]=function(_0x2773f0,_0x24d020){return db['OpenchannelQueueReport'][_0x7ba0('0x4d')]()[_0x7ba0('0x25')](respondWithResult(_0x24d020,null))[_0x7ba0('0x44')](handleError(_0x24d020,null));}; \ No newline at end of file +var _0x5205=['sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','error','stack','name','index','OpenchannelQueueReport','fieldName','type','model','map','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','keys','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x19ac6e,_0x435862){var _0x1cdcf3=function(_0x23151c){while(--_0x23151c){_0x19ac6e['push'](_0x19ac6e['shift']());}};_0x1cdcf3(++_0x435862);}(_0x5205,0xc7));var _0x5520=function(_0xbf5344,_0x56c8ce){_0xbf5344=_0xbf5344-0x0;var _0x2547c5=_0x5205[_0xbf5344];return _0x2547c5;};'use strict';var emlformat=require(_0x5520('0x0'));var rimraf=require(_0x5520('0x1'));var zipdir=require(_0x5520('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5520('0x3'));var BPromise=require(_0x5520('0x4'));var Mustache=require(_0x5520('0x5'));var util=require(_0x5520('0x6'));var path=require(_0x5520('0x7'));var sox=require(_0x5520('0x8'));var csv=require(_0x5520('0x9'));var ejs=require(_0x5520('0xa'));var fs=require('fs');var fs_extra=require(_0x5520('0xb'));var _=require('lodash');var squel=require(_0x5520('0xc'));var crypto=require(_0x5520('0xd'));var jsforce=require(_0x5520('0xe'));var deskjs=require(_0x5520('0xf'));var toCsv=require(_0x5520('0x9'));var querystring=require(_0x5520('0x10'));var Papa=require('papaparse');var Redis=require(_0x5520('0x11'));var authService=require(_0x5520('0x12'));var qs=require(_0x5520('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5520('0x14'));var logger=require('../../config/logger')(_0x5520('0x15'));var utils=require(_0x5520('0x16'));var config=require(_0x5520('0x17'));var licenseUtil=require(_0x5520('0x18'));var db=require(_0x5520('0x19'))['db'];function respondWithStatusCode(_0x15f362,_0x46b9aa){_0x46b9aa=_0x46b9aa||0xcc;return function(_0xddc161){if(_0xddc161){return _0x15f362[_0x5520('0x1a')](_0x46b9aa);}return _0x15f362[_0x5520('0x1b')](_0x46b9aa)[_0x5520('0x1c')]();};}function respondWithResult(_0x1fe1c4,_0x39551d){_0x39551d=_0x39551d||0xc8;return function(_0x248e98){if(_0x248e98){return _0x1fe1c4['status'](_0x39551d)[_0x5520('0x1d')](_0x248e98);}};}function respondWithFilteredResult(_0x1f5170,_0x32d937){return function(_0x1f28bb){if(_0x1f28bb){var _0x3d1b43=typeof _0x32d937['offset']===_0x5520('0x1e')&&typeof _0x32d937[_0x5520('0x1f')]==='undefined';var _0xd999cf=_0x1f28bb[_0x5520('0x20')];var _0xe84f83=_0x3d1b43?0x0:_0x32d937[_0x5520('0x21')];var _0x2350f3=_0x3d1b43?_0x1f28bb[_0x5520('0x20')]:_0x32d937[_0x5520('0x21')]+_0x32d937[_0x5520('0x1f')];var _0x3aca35;if(_0x2350f3>=_0xd999cf){_0x2350f3=_0xd999cf;_0x3aca35=0xc8;}else{_0x3aca35=0xce;}_0x1f5170[_0x5520('0x1b')](_0x3aca35);return _0x1f5170[_0x5520('0x22')]('Content-Range',_0xe84f83+'-'+_0x2350f3+'/'+_0xd999cf)[_0x5520('0x1d')](_0x1f28bb);}return null;};}function patchUpdates(_0x29eaa7){return function(_0x5085d0){try{jsonpatch[_0x5520('0x23')](_0x5085d0,_0x29eaa7,!![]);}catch(_0x495561){return BPromise[_0x5520('0x24')](_0x495561);}return _0x5085d0[_0x5520('0x25')]();};}function saveUpdates(_0x59f145,_0x4b011b){return function(_0x519fa1){if(_0x519fa1){return _0x519fa1['update'](_0x59f145)[_0x5520('0x26')](function(_0x45f6f4){return _0x45f6f4;});}return null;};}function removeEntity(_0x39b65c,_0x5cb322){return function(_0xe88884){if(_0xe88884){return _0xe88884[_0x5520('0x27')]()[_0x5520('0x26')](function(){_0x39b65c[_0x5520('0x1b')](0xcc)[_0x5520('0x1c')]();});}};}function handleEntityNotFound(_0x345bfa,_0x57c650){return function(_0xee2221){if(!_0xee2221){_0x345bfa[_0x5520('0x1a')](0x194);}return _0xee2221;};}function handleError(_0x5755c4,_0x13176d){_0x13176d=_0x13176d||0x1f4;return function(_0x5eb92e){logger[_0x5520('0x28')](_0x5eb92e[_0x5520('0x29')]);if(_0x5eb92e[_0x5520('0x2a')]){delete _0x5eb92e[_0x5520('0x2a')];}_0x5755c4[_0x5520('0x1b')](_0x13176d)['send'](_0x5eb92e);};}exports[_0x5520('0x2b')]=function(_0x48d66a,_0x6c8167){var _0x5a281e={},_0x5afa68={},_0xa54d8d={'count':0x0,'rows':[]};var _0x36e88e=_['map'](db[_0x5520('0x2c')]['rawAttributes'],function(_0x1aee8a){return{'name':_0x1aee8a[_0x5520('0x2d')],'type':_0x1aee8a[_0x5520('0x2e')]['key']};});_0x5afa68[_0x5520('0x2f')]=_[_0x5520('0x30')](_0x36e88e,_0x5520('0x2a'));_0x5afa68[_0x5520('0x31')]=_['keys'](_0x48d66a[_0x5520('0x31')]);_0x5afa68[_0x5520('0x32')]=_[_0x5520('0x33')](_0x5afa68[_0x5520('0x2f')],_0x5afa68[_0x5520('0x31')]);_0x5a281e['attributes']=_[_0x5520('0x33')](_0x5afa68[_0x5520('0x2f')],qs[_0x5520('0x34')](_0x48d66a[_0x5520('0x31')][_0x5520('0x34')]));_0x5a281e['attributes']=_0x5a281e[_0x5520('0x35')][_0x5520('0x36')]?_0x5a281e[_0x5520('0x35')]:_0x5afa68[_0x5520('0x2f')];if(!_0x48d66a[_0x5520('0x31')]['hasOwnProperty'](_0x5520('0x37'))){_0x5a281e['limit']=qs[_0x5520('0x1f')](_0x48d66a['query'][_0x5520('0x1f')]);_0x5a281e[_0x5520('0x21')]=qs[_0x5520('0x21')](_0x48d66a[_0x5520('0x31')][_0x5520('0x21')]);}_0x5a281e[_0x5520('0x38')]=qs[_0x5520('0x39')](_0x48d66a['query'][_0x5520('0x39')]);_0x5a281e[_0x5520('0x3a')]=qs[_0x5520('0x32')](_['pick'](_0x48d66a[_0x5520('0x31')],_0x5afa68[_0x5520('0x32')]),_0x36e88e);if(_0x48d66a['query'][_0x5520('0x3b')]){_0x5a281e[_0x5520('0x3a')]=_[_0x5520('0x3c')](_0x5a281e['where'],{'$or':_[_0x5520('0x30')](_0x36e88e,function(_0x237e38){if(_0x237e38[_0x5520('0x2e')]!==_0x5520('0x3d')){var _0x32cea3={};_0x32cea3[_0x237e38[_0x5520('0x2a')]]={'$like':'%'+_0x48d66a[_0x5520('0x31')][_0x5520('0x3b')]+'%'};return _0x32cea3;}})});}_0x5a281e=_[_0x5520('0x3c')]({},_0x5a281e,_0x48d66a[_0x5520('0x3e')]);var _0x34ebc4={'where':_0x5a281e[_0x5520('0x3a')]};return db[_0x5520('0x2c')]['count'](_0x34ebc4)['then'](function(_0x307da9){_0xa54d8d[_0x5520('0x20')]=_0x307da9;if(_0x48d66a['query'][_0x5520('0x3f')]){_0x5a281e[_0x5520('0x40')]=[{'all':!![]}];}return db[_0x5520('0x2c')]['findAll'](_0x5a281e);})[_0x5520('0x26')](function(_0x1b749b){_0xa54d8d[_0x5520('0x41')]=_0x1b749b;return _0xa54d8d;})['then'](respondWithFilteredResult(_0x6c8167,_0x5a281e))['catch'](handleError(_0x6c8167,null));};exports[_0x5520('0x42')]=function(_0xf05c9,_0x1fda66){var _0x56fbd4={'raw':!![],'where':{'id':_0xf05c9[_0x5520('0x43')]['id']}},_0xa94636={};_0xa94636[_0x5520('0x2f')]=_[_0x5520('0x44')](db[_0x5520('0x2c')]['rawAttributes']);_0xa94636[_0x5520('0x31')]=_['keys'](_0xf05c9[_0x5520('0x31')]);_0xa94636[_0x5520('0x32')]=_[_0x5520('0x33')](_0xa94636[_0x5520('0x2f')],_0xa94636[_0x5520('0x31')]);_0x56fbd4['attributes']=_['intersection'](_0xa94636[_0x5520('0x2f')],qs[_0x5520('0x34')](_0xf05c9['query'][_0x5520('0x34')]));_0x56fbd4[_0x5520('0x35')]=_0x56fbd4[_0x5520('0x35')][_0x5520('0x36')]?_0x56fbd4[_0x5520('0x35')]:_0xa94636['model'];if(_0xf05c9[_0x5520('0x31')]['includeAll']){_0x56fbd4['include']=[{'all':!![]}];}_0x56fbd4=_[_0x5520('0x3c')]({},_0x56fbd4,_0xf05c9['options']);return db[_0x5520('0x2c')][_0x5520('0x45')](_0x56fbd4)['then'](handleEntityNotFound(_0x1fda66,null))['then'](respondWithResult(_0x1fda66,null))[_0x5520('0x46')](handleError(_0x1fda66,null));};exports[_0x5520('0x47')]=function(_0xb600a2,_0x58a10c){return db[_0x5520('0x2c')][_0x5520('0x47')](_0xb600a2[_0x5520('0x48')],{})['then'](respondWithResult(_0x58a10c,0xc9))[_0x5520('0x46')](handleError(_0x58a10c,null));};exports[_0x5520('0x49')]=function(_0x3a68c5,_0x52c160){if(_0x3a68c5[_0x5520('0x48')]['id']){delete _0x3a68c5['body']['id'];}return db[_0x5520('0x2c')][_0x5520('0x45')]({'where':{'id':_0x3a68c5['params']['id']}})[_0x5520('0x26')](handleEntityNotFound(_0x52c160,null))[_0x5520('0x26')](saveUpdates(_0x3a68c5[_0x5520('0x48')],null))[_0x5520('0x26')](respondWithResult(_0x52c160,null))[_0x5520('0x46')](handleError(_0x52c160,null));};exports['destroy']=function(_0x577203,_0x9704d3){return db[_0x5520('0x2c')][_0x5520('0x45')]({'where':{'id':_0x577203[_0x5520('0x43')]['id']}})[_0x5520('0x26')](handleEntityNotFound(_0x9704d3,null))[_0x5520('0x26')](removeEntity(_0x9704d3,null))[_0x5520('0x46')](handleError(_0x9704d3,null));};exports['describe']=function(_0x3ea3c3,_0x5a9bf5){return db[_0x5520('0x2c')][_0x5520('0x4a')]()[_0x5520('0x26')](respondWithResult(_0x5a9bf5,null))['catch'](handleError(_0x5a9bf5,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 0c8821d..6ef6959 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x5af41c,_0x13ca69){var _0x358160=function(_0x349238){while(--_0x349238){_0x5af41c['push'](_0x5af41c['shift']());}};_0x358160(++_0x13ca69);}(_0x1261,0x144));var _0x1126=function(_0x444f91,_0x2a61f2){_0x444f91=_0x444f91-0x0;var _0x3248ab=_0x1261[_0x444f91];return _0x3248ab;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2ef3=['define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./openchannelQueueReport.attributes','exports'];(function(_0x264373,_0xcf0e17){var _0xece0b4=function(_0xba6f2a){while(--_0xba6f2a){_0x264373['push'](_0x264373['shift']());}};_0xece0b4(++_0xcf0e17);}(_0x2ef3,0xba));var _0x32ef=function(_0x43cbdf,_0x3ab339){_0x43cbdf=_0x43cbdf-0x0;var _0x3d1638=_0x2ef3[_0x43cbdf];return _0x3d1638;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ef('0x6'));var rimraf=require(_0x32ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x32ef('0x8'));module[_0x32ef('0x9')]=function(_0x4c8104,_0x5dfa09){return _0x4c8104[_0x32ef('0xa')](_0x32ef('0xb'),attributes,{'tableName':_0x32ef('0xc'),'paranoid':![],'indexes':[{'name':_0x32ef('0xd'),'fields':[_0x32ef('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 758fc57..d2f02dd 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 _0x4f7b=['where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelQueueReport','create','body','raw','CreateOpenchannelQueueReport','debug','UpdateOpenchannelQueueReport','update','options'];(function(_0xb79ed5,_0x289390){var _0x5e9fe8=function(_0x43e14c){while(--_0x43e14c){_0xb79ed5['push'](_0xb79ed5['shift']());}};_0x5e9fe8(++_0x289390);}(_0x4f7b,0x13e));var _0xb4f7=function(_0x5e614d,_0x25556d){_0x5e614d=_0x5e614d-0x0;var _0x5da9fe=_0x4f7b[_0x5e614d];return _0x5da9fe;};'use strict';var _=require(_0xb4f7('0x0'));var util=require(_0xb4f7('0x1'));var moment=require(_0xb4f7('0x2'));var BPromise=require(_0xb4f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb4f7('0x4'));var db=require(_0xb4f7('0x5'))['db'];var utils=require(_0xb4f7('0x6'));var logger=require(_0xb4f7('0x7'))(_0xb4f7('0x8'));var config=require(_0xb4f7('0x9'));var jayson=require(_0xb4f7('0xa'));var client=jayson[_0xb4f7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27872e,_0x5e7b94,_0x179391){return new BPromise(function(_0xf56d08,_0x2849ed){return client['request'](_0x27872e,_0x179391)[_0xb4f7('0xc')](function(_0x5af41f){logger[_0xb4f7('0xd')](_0xb4f7('0xe'),_0x5e7b94,_0xb4f7('0xf'));logger['debug'](_0xb4f7('0x10'),_0x5e7b94,_0xb4f7('0xf'),JSON[_0xb4f7('0x11')](_0x5af41f));if(_0x5af41f[_0xb4f7('0x12')]){if(_0x5af41f[_0xb4f7('0x12')][_0xb4f7('0x13')]===0x1f4){logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0x5af41f['error'][_0xb4f7('0x14')]);return _0x2849ed(_0x5af41f[_0xb4f7('0x12')][_0xb4f7('0x14')]);}logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0x5af41f[_0xb4f7('0x12')]['message']);return _0xf56d08(_0x5af41f[_0xb4f7('0x12')]['message']);}else{logger[_0xb4f7('0xd')](_0xb4f7('0xe'),_0x5e7b94,_0xb4f7('0xf'));_0xf56d08(_0x5af41f[_0xb4f7('0x15')][_0xb4f7('0x14')]);}})[_0xb4f7('0x16')](function(_0xbc599a){logger[_0xb4f7('0x12')](_0xb4f7('0xe'),_0x5e7b94,_0xbc599a);_0x2849ed(_0xbc599a);});});}exports['CreateOpenchannelQueueReport']=function(_0x53b135){var _0x3a78b7=this;return new Promise(function(_0x22e273,_0x4b93fc){return db[_0xb4f7('0x17')][_0xb4f7('0x18')](_0x53b135[_0xb4f7('0x19')],{'raw':_0x53b135['options']?_0x53b135['options'][_0xb4f7('0x1a')]===undefined?!![]:![]:!![]})[_0xb4f7('0xc')](function(_0x5cc40e){logger[_0xb4f7('0xd')](_0xb4f7('0x1b'),_0x53b135);logger[_0xb4f7('0x1c')](_0xb4f7('0x1b'),_0x53b135,JSON['stringify'](_0x5cc40e));_0x22e273(_0x5cc40e);})[_0xb4f7('0x16')](function(_0x56bac5){logger[_0xb4f7('0x12')](_0xb4f7('0x1b'),_0x56bac5[_0xb4f7('0x14')],_0x53b135);_0x4b93fc(_0x3a78b7[_0xb4f7('0x12')](0x1f4,_0x56bac5[_0xb4f7('0x14')]));});});};exports[_0xb4f7('0x1d')]=function(_0x493d81){var _0x1fe0cf=this;return new Promise(function(_0x291166,_0x19e549){return db[_0xb4f7('0x17')][_0xb4f7('0x1e')](_0x493d81[_0xb4f7('0x19')],{'raw':_0x493d81['options']?_0x493d81[_0xb4f7('0x1f')][_0xb4f7('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x493d81[_0xb4f7('0x1f')]?_0x493d81[_0xb4f7('0x1f')][_0xb4f7('0x20')]||null:null,'attributes':_0x493d81['options']?_0x493d81[_0xb4f7('0x1f')][_0xb4f7('0x21')]||null:null,'limit':_0x493d81['options']?_0x493d81[_0xb4f7('0x1f')][_0xb4f7('0x22')]||null:null})[_0xb4f7('0xc')](function(_0x35582a){logger['info'](_0xb4f7('0x1d'),_0x493d81);logger[_0xb4f7('0x1c')](_0xb4f7('0x1d'),_0x493d81,JSON[_0xb4f7('0x11')](_0x35582a));_0x291166(_0x35582a);})['catch'](function(_0x4ea802){logger[_0xb4f7('0x12')]('UpdateOpenchannelQueueReport',_0x4ea802[_0xb4f7('0x14')],_0x493d81);_0x19e549(_0x1fe0cf[_0xb4f7('0x12')](0x1f4,_0x4ea802['message']));});});}; \ No newline at end of file +var _0xd237=['debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','raw','stringify','update','options','where','attributes','limit','UpdateOpenchannelQueueReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xd237,0x14f));var _0x7d23=function(_0x411d5a,_0x21411b){_0x411d5a=_0x411d5a-0x0;var _0x4c97b1=_0xd237[_0x411d5a];return _0x4c97b1;};'use strict';var _=require(_0x7d23('0x0'));var util=require(_0x7d23('0x1'));var moment=require(_0x7d23('0x2'));var BPromise=require(_0x7d23('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7d23('0x4'));var db=require(_0x7d23('0x5'))['db'];var utils=require(_0x7d23('0x6'));var logger=require(_0x7d23('0x7'))(_0x7d23('0x8'));var config=require(_0x7d23('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7d23('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ca126,_0x48358f,_0xc43371){return new BPromise(function(_0x42c334,_0x6ce28d){return client[_0x7d23('0xb')](_0x5ca126,_0xc43371)[_0x7d23('0xc')](function(_0x23f1d6){logger[_0x7d23('0xd')](_0x7d23('0xe'),_0x48358f,'request\x20sent');logger[_0x7d23('0xf')](_0x7d23('0x10'),_0x48358f,_0x7d23('0x11'),JSON['stringify'](_0x23f1d6));if(_0x23f1d6[_0x7d23('0x12')]){if(_0x23f1d6['error'][_0x7d23('0x13')]===0x1f4){logger[_0x7d23('0x12')](_0x7d23('0xe'),_0x48358f,_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);return _0x6ce28d(_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);}logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x48358f,_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);return _0x42c334(_0x23f1d6[_0x7d23('0x12')][_0x7d23('0x14')]);}else{logger['info'](_0x7d23('0xe'),_0x48358f,'request\x20sent');_0x42c334(_0x23f1d6[_0x7d23('0x15')]['message']);}})[_0x7d23('0x16')](function(_0x46a35b){logger[_0x7d23('0x12')](_0x7d23('0xe'),_0x48358f,_0x46a35b);_0x6ce28d(_0x46a35b);});});}exports[_0x7d23('0x17')]=function(_0x506a3b){var _0x313471=this;return new Promise(function(_0x3d6a7b,_0x49ce32){return db[_0x7d23('0x18')][_0x7d23('0x19')](_0x506a3b[_0x7d23('0x1a')],{'raw':_0x506a3b['options']?_0x506a3b['options'][_0x7d23('0x1b')]===undefined?!![]:![]:!![]})[_0x7d23('0xc')](function(_0x56b0ba){logger[_0x7d23('0xd')]('CreateOpenchannelQueueReport',_0x506a3b);logger[_0x7d23('0xf')]('CreateOpenchannelQueueReport',_0x506a3b,JSON[_0x7d23('0x1c')](_0x56b0ba));_0x3d6a7b(_0x56b0ba);})[_0x7d23('0x16')](function(_0x59522b){logger[_0x7d23('0x12')](_0x7d23('0x17'),_0x59522b[_0x7d23('0x14')],_0x506a3b);_0x49ce32(_0x313471['error'](0x1f4,_0x59522b[_0x7d23('0x14')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x2e6d9f){var _0x354b2a=this;return new Promise(function(_0x1c007a,_0x3a5d87){return db[_0x7d23('0x18')][_0x7d23('0x1d')](_0x2e6d9f[_0x7d23('0x1a')],{'raw':_0x2e6d9f[_0x7d23('0x1e')]?_0x2e6d9f[_0x7d23('0x1e')][_0x7d23('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e6d9f[_0x7d23('0x1e')]?_0x2e6d9f['options'][_0x7d23('0x1f')]||null:null,'attributes':_0x2e6d9f[_0x7d23('0x1e')]?_0x2e6d9f[_0x7d23('0x1e')][_0x7d23('0x20')]||null:null,'limit':_0x2e6d9f[_0x7d23('0x1e')]?_0x2e6d9f[_0x7d23('0x1e')][_0x7d23('0x21')]||null:null})[_0x7d23('0xc')](function(_0x4808f2){logger[_0x7d23('0xd')](_0x7d23('0x22'),_0x2e6d9f);logger['debug'](_0x7d23('0x22'),_0x2e6d9f,JSON[_0x7d23('0x1c')](_0x4808f2));_0x1c007a(_0x4808f2);})[_0x7d23('0x16')](function(_0x4b1c92){logger[_0x7d23('0x12')](_0x7d23('0x22'),_0x4b1c92[_0x7d23('0x14')],_0x2e6d9f);_0x3a5d87(_0x354b2a[_0x7d23('0x12')](0x1f4,_0x4b1c92[_0x7d23('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 617d3c3..83acc48 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 _0x4f37=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','update','delete','exports'];(function(_0x10193b,_0x3d839a){var _0x1a271b=function(_0x397aba){while(--_0x397aba){_0x10193b['push'](_0x10193b['shift']());}};_0x1a271b(++_0x3d839a);}(_0x4f37,0xb4));var _0x74f3=function(_0x241b68,_0x1deab3){_0x241b68=_0x241b68-0x0;var _0x43449d=_0x4f37[_0x241b68];return _0x43449d;};'use strict';var multer=require('multer');var util=require(_0x74f3('0x0'));var path=require(_0x74f3('0x1'));var timeout=require(_0x74f3('0x2'));var express=require(_0x74f3('0x3'));var router=express[_0x74f3('0x4')]();var fs_extra=require(_0x74f3('0x5'));var auth=require(_0x74f3('0x6'));var interaction=require(_0x74f3('0x7'));var config=require(_0x74f3('0x8'));var controller=require(_0x74f3('0x9'));router[_0x74f3('0xa')]('/',auth[_0x74f3('0xb')](),controller[_0x74f3('0xc')]);router[_0x74f3('0xa')](_0x74f3('0xd'),auth[_0x74f3('0xb')](),controller['describe']);router['get'](_0x74f3('0xe'),auth[_0x74f3('0xb')](),controller['show']);router[_0x74f3('0xf')]('/',auth['isAuthenticated'](),controller[_0x74f3('0x10')]);router['put'](_0x74f3('0xe'),auth[_0x74f3('0xb')](),controller[_0x74f3('0x11')]);router[_0x74f3('0x12')](_0x74f3('0xe'),auth[_0x74f3('0xb')](),controller['destroy']);module[_0x74f3('0x13')]=router; \ No newline at end of file +var _0x9d81=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','exports'];(function(_0xff16ab,_0x1cf0f9){var _0x437648=function(_0x4567d6){while(--_0x4567d6){_0xff16ab['push'](_0xff16ab['shift']());}};_0x437648(++_0x1cf0f9);}(_0x9d81,0xc0));var _0x19d8=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x9d81[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x19d8('0x0'));var util=require(_0x19d8('0x1'));var path=require(_0x19d8('0x2'));var timeout=require(_0x19d8('0x3'));var express=require(_0x19d8('0x4'));var router=express[_0x19d8('0x5')]();var fs_extra=require(_0x19d8('0x6'));var auth=require(_0x19d8('0x7'));var interaction=require(_0x19d8('0x8'));var config=require(_0x19d8('0x9'));var controller=require(_0x19d8('0xa'));router[_0x19d8('0xb')]('/',auth[_0x19d8('0xc')](),controller[_0x19d8('0xd')]);router[_0x19d8('0xb')](_0x19d8('0xe'),auth[_0x19d8('0xc')](),controller[_0x19d8('0xf')]);router['get'](_0x19d8('0x10'),auth[_0x19d8('0xc')](),controller['show']);router[_0x19d8('0x11')]('/',auth[_0x19d8('0xc')](),controller[_0x19d8('0x12')]);router[_0x19d8('0x13')](_0x19d8('0x10'),auth[_0x19d8('0xc')](),controller[_0x19d8('0x14')]);router[_0x19d8('0x15')](_0x19d8('0x10'),auth[_0x19d8('0xc')](),controller[_0x19d8('0x16')]);module[_0x19d8('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 8e5d64c..a3acd63 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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x1bad26,_0xf6f79f){var _0x23b581=function(_0x4040c9){while(--_0x4040c9){_0x1bad26['push'](_0x1bad26['shift']());}};_0x23b581(++_0xf6f79f);}(_0x34e8,0x12c));var _0x834e=function(_0x51e78d,_0x37e329){_0x51e78d=_0x51e78d-0x0;var _0x5594a3=_0x34e8[_0x51e78d];return _0x5594a3;};'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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0xc72da6,_0x30e853){var _0x1275b8=function(_0x13b29a){while(--_0x13b29a){_0xc72da6['push'](_0xc72da6['shift']());}};_0x1275b8(++_0x30e853);}(_0xedd9,0xfc));var _0x9edd=function(_0x203a8e,_0x307806){_0x203a8e=_0x203a8e-0x0;var _0x35c998=_0xedd9[_0x203a8e];return _0x35c998;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 6a5c19a..4fa3b16 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 _0x0941=['limit','set','Content-Range','apply','update','then','destroy','error','stack','name','send','index','map','OpenchannelTransferReport','fieldName','type','model','query','keys','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','count','includeAll','findAll','rows','catch','show','fields','include','find','body','params','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','offset'];(function(_0x2d2502,_0x330f0d){var _0x324fb4=function(_0x1e28b8){while(--_0x1e28b8){_0x2d2502['push'](_0x2d2502['shift']());}};_0x324fb4(++_0x330f0d);}(_0x0941,0x71));var _0x1094=function(_0x220386,_0x548620){_0x220386=_0x220386-0x0;var _0x4402c9=_0x0941[_0x220386];return _0x4402c9;};'use strict';var emlformat=require(_0x1094('0x0'));var rimraf=require(_0x1094('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1094('0x2'));var rp=require('request-promise');var moment=require(_0x1094('0x3'));var BPromise=require(_0x1094('0x4'));var Mustache=require('mustache');var util=require(_0x1094('0x5'));var path=require('path');var sox=require(_0x1094('0x6'));var csv=require(_0x1094('0x7'));var ejs=require(_0x1094('0x8'));var fs=require('fs');var fs_extra=require(_0x1094('0x9'));var _=require(_0x1094('0xa'));var squel=require(_0x1094('0xb'));var crypto=require(_0x1094('0xc'));var jsforce=require(_0x1094('0xd'));var deskjs=require(_0x1094('0xe'));var toCsv=require(_0x1094('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1094('0xf'));var authService=require(_0x1094('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1094('0x11'));var hardwareService=require(_0x1094('0x12'));var logger=require(_0x1094('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1094('0x14'))['db'];function respondWithStatusCode(_0x14ce73,_0x94cef7){_0x94cef7=_0x94cef7||0xcc;return function(_0x14779f){if(_0x14779f){return _0x14ce73[_0x1094('0x15')](_0x94cef7);}return _0x14ce73[_0x1094('0x16')](_0x94cef7)[_0x1094('0x17')]();};}function respondWithResult(_0x394a06,_0x2f23c4){_0x2f23c4=_0x2f23c4||0xc8;return function(_0x3ff7c9){if(_0x3ff7c9){return _0x394a06[_0x1094('0x16')](_0x2f23c4)['json'](_0x3ff7c9);}};}function respondWithFilteredResult(_0x294baa,_0xfcaead){return function(_0x4378dc){if(_0x4378dc){var _0x17293a=typeof _0xfcaead[_0x1094('0x18')]==='undefined'&&typeof _0xfcaead[_0x1094('0x19')]==='undefined';var _0x45dcdf=_0x4378dc['count'];var _0x4b80f3=_0x17293a?0x0:_0xfcaead['offset'];var _0x4633a2=_0x17293a?_0x4378dc['count']:_0xfcaead[_0x1094('0x18')]+_0xfcaead[_0x1094('0x19')];var _0x5590ec;if(_0x4633a2>=_0x45dcdf){_0x4633a2=_0x45dcdf;_0x5590ec=0xc8;}else{_0x5590ec=0xce;}_0x294baa[_0x1094('0x16')](_0x5590ec);return _0x294baa[_0x1094('0x1a')](_0x1094('0x1b'),_0x4b80f3+'-'+_0x4633a2+'/'+_0x45dcdf)['json'](_0x4378dc);}return null;};}function patchUpdates(_0xb15524){return function(_0x4bf694){try{jsonpatch[_0x1094('0x1c')](_0x4bf694,_0xb15524,!![]);}catch(_0x141a99){return BPromise['reject'](_0x141a99);}return _0x4bf694['save']();};}function saveUpdates(_0x9d5af3,_0x368ea2){return function(_0x23c82b){if(_0x23c82b){return _0x23c82b[_0x1094('0x1d')](_0x9d5af3)[_0x1094('0x1e')](function(_0x4ea985){return _0x4ea985;});}return null;};}function removeEntity(_0x4da46f,_0x17e5fa){return function(_0x2c67f3){if(_0x2c67f3){return _0x2c67f3[_0x1094('0x1f')]()['then'](function(){_0x4da46f[_0x1094('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b7cc3,_0x5a605c){return function(_0xcd3e9c){if(!_0xcd3e9c){_0x5b7cc3[_0x1094('0x15')](0x194);}return _0xcd3e9c;};}function handleError(_0x76c34b,_0x2713d9){_0x2713d9=_0x2713d9||0x1f4;return function(_0xb2531f){logger[_0x1094('0x20')](_0xb2531f[_0x1094('0x21')]);if(_0xb2531f[_0x1094('0x22')]){delete _0xb2531f[_0x1094('0x22')];}_0x76c34b[_0x1094('0x16')](_0x2713d9)[_0x1094('0x23')](_0xb2531f);};}exports[_0x1094('0x24')]=function(_0x2b0716,_0x635e37){var _0x401631={},_0x3d3f4b={},_0x230b50={'count':0x0,'rows':[]};var _0x288fe3=_[_0x1094('0x25')](db[_0x1094('0x26')]['rawAttributes'],function(_0x42b545){return{'name':_0x42b545[_0x1094('0x27')],'type':_0x42b545[_0x1094('0x28')]['key']};});_0x3d3f4b[_0x1094('0x29')]=_[_0x1094('0x25')](_0x288fe3,'name');_0x3d3f4b[_0x1094('0x2a')]=_[_0x1094('0x2b')](_0x2b0716[_0x1094('0x2a')]);_0x3d3f4b['filters']=_['intersection'](_0x3d3f4b['model'],_0x3d3f4b[_0x1094('0x2a')]);_0x401631[_0x1094('0x2c')]=_[_0x1094('0x2d')](_0x3d3f4b[_0x1094('0x29')],qs['fields'](_0x2b0716[_0x1094('0x2a')]['fields']));_0x401631['attributes']=_0x401631[_0x1094('0x2c')][_0x1094('0x2e')]?_0x401631[_0x1094('0x2c')]:_0x3d3f4b[_0x1094('0x29')];if(!_0x2b0716['query'][_0x1094('0x2f')](_0x1094('0x30'))){_0x401631[_0x1094('0x19')]=qs[_0x1094('0x19')](_0x2b0716[_0x1094('0x2a')][_0x1094('0x19')]);_0x401631[_0x1094('0x18')]=qs[_0x1094('0x18')](_0x2b0716[_0x1094('0x2a')]['offset']);}_0x401631[_0x1094('0x31')]=qs[_0x1094('0x32')](_0x2b0716[_0x1094('0x2a')]['sort']);_0x401631['where']=qs[_0x1094('0x33')](_[_0x1094('0x34')](_0x2b0716[_0x1094('0x2a')],_0x3d3f4b[_0x1094('0x33')]),_0x288fe3);if(_0x2b0716[_0x1094('0x2a')][_0x1094('0x35')]){_0x401631[_0x1094('0x36')]=_[_0x1094('0x37')](_0x401631[_0x1094('0x36')],{'$or':_[_0x1094('0x25')](_0x288fe3,function(_0x424e9d){if(_0x424e9d[_0x1094('0x28')]!=='VIRTUAL'){var _0x567391={};_0x567391[_0x424e9d[_0x1094('0x22')]]={'$like':'%'+_0x2b0716['query'][_0x1094('0x35')]+'%'};return _0x567391;}})});}_0x401631=_['merge']({},_0x401631,_0x2b0716[_0x1094('0x38')]);var _0x46d5f8={'where':_0x401631[_0x1094('0x36')]};return db[_0x1094('0x26')][_0x1094('0x39')](_0x46d5f8)[_0x1094('0x1e')](function(_0xf59c9f){_0x230b50[_0x1094('0x39')]=_0xf59c9f;if(_0x2b0716[_0x1094('0x2a')][_0x1094('0x3a')]){_0x401631['include']=[{'all':!![]}];}return db[_0x1094('0x26')][_0x1094('0x3b')](_0x401631);})['then'](function(_0x20c166){_0x230b50[_0x1094('0x3c')]=_0x20c166;return _0x230b50;})[_0x1094('0x1e')](respondWithFilteredResult(_0x635e37,_0x401631))[_0x1094('0x3d')](handleError(_0x635e37,null));};exports[_0x1094('0x3e')]=function(_0x47d33f,_0x338dd6){var _0x383bff={'raw':!![],'where':{'id':_0x47d33f['params']['id']}},_0x541c76={};_0x541c76['model']=_[_0x1094('0x2b')](db[_0x1094('0x26')]['rawAttributes']);_0x541c76[_0x1094('0x2a')]=_[_0x1094('0x2b')](_0x47d33f[_0x1094('0x2a')]);_0x541c76[_0x1094('0x33')]=_[_0x1094('0x2d')](_0x541c76[_0x1094('0x29')],_0x541c76['query']);_0x383bff[_0x1094('0x2c')]=_[_0x1094('0x2d')](_0x541c76[_0x1094('0x29')],qs['fields'](_0x47d33f[_0x1094('0x2a')][_0x1094('0x3f')]));_0x383bff[_0x1094('0x2c')]=_0x383bff[_0x1094('0x2c')][_0x1094('0x2e')]?_0x383bff[_0x1094('0x2c')]:_0x541c76[_0x1094('0x29')];if(_0x47d33f[_0x1094('0x2a')]['includeAll']){_0x383bff[_0x1094('0x40')]=[{'all':!![]}];}_0x383bff=_[_0x1094('0x37')]({},_0x383bff,_0x47d33f['options']);return db['OpenchannelTransferReport'][_0x1094('0x41')](_0x383bff)[_0x1094('0x1e')](handleEntityNotFound(_0x338dd6,null))['then'](respondWithResult(_0x338dd6,null))[_0x1094('0x3d')](handleError(_0x338dd6,null));};exports['create']=function(_0x1e4214,_0x1a1ff2){return db[_0x1094('0x26')]['create'](_0x1e4214['body'],{})['then'](respondWithResult(_0x1a1ff2,0xc9))[_0x1094('0x3d')](handleError(_0x1a1ff2,null));};exports[_0x1094('0x1d')]=function(_0x1464ce,_0x5ef022){if(_0x1464ce[_0x1094('0x42')]['id']){delete _0x1464ce[_0x1094('0x42')]['id'];}return db['OpenchannelTransferReport'][_0x1094('0x41')]({'where':{'id':_0x1464ce[_0x1094('0x43')]['id']}})[_0x1094('0x1e')](handleEntityNotFound(_0x5ef022,null))['then'](saveUpdates(_0x1464ce[_0x1094('0x42')],null))[_0x1094('0x1e')](respondWithResult(_0x5ef022,null))[_0x1094('0x3d')](handleError(_0x5ef022,null));};exports['destroy']=function(_0x455f74,_0x302125){return db[_0x1094('0x26')]['find']({'where':{'id':_0x455f74['params']['id']}})['then'](handleEntityNotFound(_0x302125,null))[_0x1094('0x1e')](removeEntity(_0x302125,null))[_0x1094('0x3d')](handleError(_0x302125,null));};exports[_0x1094('0x44')]=function(_0x1648f0,_0x511eae){return db[_0x1094('0x26')][_0x1094('0x44')]()[_0x1094('0x1e')](respondWithResult(_0x511eae,null))[_0x1094('0x3d')](handleError(_0x511eae,null));}; \ No newline at end of file +var _0x2036=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','destroy','end','error','stack','name','send','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelTransferReport','then','findAll','rows','catch','show','params','rawAttributes','fields','includeAll','include','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x2036,0x8c));var _0x6203=function(_0x4821d4,_0x40758d){_0x4821d4=_0x4821d4-0x0;var _0x5e2abc=_0x2036[_0x4821d4];return _0x5e2abc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6203('0x0'));var zipdir=require(_0x6203('0x1'));var jsonpatch=require(_0x6203('0x2'));var rp=require(_0x6203('0x3'));var moment=require('moment');var BPromise=require(_0x6203('0x4'));var Mustache=require(_0x6203('0x5'));var util=require(_0x6203('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6203('0x7'));var fs=require('fs');var fs_extra=require(_0x6203('0x8'));var _=require('lodash');var squel=require(_0x6203('0x9'));var crypto=require(_0x6203('0xa'));var jsforce=require(_0x6203('0xb'));var deskjs=require(_0x6203('0xc'));var toCsv=require(_0x6203('0xd'));var querystring=require(_0x6203('0xe'));var Papa=require(_0x6203('0xf'));var Redis=require(_0x6203('0x10'));var authService=require(_0x6203('0x11'));var qs=require(_0x6203('0x12'));var as=require(_0x6203('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6203('0x14'))(_0x6203('0x15'));var utils=require(_0x6203('0x16'));var config=require(_0x6203('0x17'));var licenseUtil=require(_0x6203('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4bdc7f,_0x58fa9f){_0x58fa9f=_0x58fa9f||0xcc;return function(_0x52ae78){if(_0x52ae78){return _0x4bdc7f[_0x6203('0x19')](_0x58fa9f);}return _0x4bdc7f[_0x6203('0x1a')](_0x58fa9f)['end']();};}function respondWithResult(_0x2b3dc9,_0x2b3074){_0x2b3074=_0x2b3074||0xc8;return function(_0x43a4ff){if(_0x43a4ff){return _0x2b3dc9[_0x6203('0x1a')](_0x2b3074)[_0x6203('0x1b')](_0x43a4ff);}};}function respondWithFilteredResult(_0x301d27,_0x105c2a){return function(_0x16c6df){if(_0x16c6df){var _0x52255c=typeof _0x105c2a['offset']==='undefined'&&typeof _0x105c2a[_0x6203('0x1c')]===_0x6203('0x1d');var _0x1a4977=_0x16c6df[_0x6203('0x1e')];var _0x2abf45=_0x52255c?0x0:_0x105c2a[_0x6203('0x1f')];var _0x358765=_0x52255c?_0x16c6df[_0x6203('0x1e')]:_0x105c2a[_0x6203('0x1f')]+_0x105c2a['limit'];var _0x263392;if(_0x358765>=_0x1a4977){_0x358765=_0x1a4977;_0x263392=0xc8;}else{_0x263392=0xce;}_0x301d27['status'](_0x263392);return _0x301d27[_0x6203('0x20')](_0x6203('0x21'),_0x2abf45+'-'+_0x358765+'/'+_0x1a4977)[_0x6203('0x1b')](_0x16c6df);}return null;};}function patchUpdates(_0x110fa1){return function(_0x3d6286){try{jsonpatch[_0x6203('0x22')](_0x3d6286,_0x110fa1,!![]);}catch(_0xc15a65){return BPromise[_0x6203('0x23')](_0xc15a65);}return _0x3d6286[_0x6203('0x24')]();};}function saveUpdates(_0x25cb39,_0x1a54e9){return function(_0x3b0cef){if(_0x3b0cef){return _0x3b0cef['update'](_0x25cb39)['then'](function(_0x4fc463){return _0x4fc463;});}return null;};}function removeEntity(_0x577bf9,_0x32ba79){return function(_0x301fec){if(_0x301fec){return _0x301fec[_0x6203('0x25')]()['then'](function(){_0x577bf9[_0x6203('0x1a')](0xcc)[_0x6203('0x26')]();});}};}function handleEntityNotFound(_0x67fb5f,_0x3e8e99){return function(_0x3790ea){if(!_0x3790ea){_0x67fb5f[_0x6203('0x19')](0x194);}return _0x3790ea;};}function handleError(_0x2d814a,_0xf090d8){_0xf090d8=_0xf090d8||0x1f4;return function(_0x19cb5a){logger[_0x6203('0x27')](_0x19cb5a[_0x6203('0x28')]);if(_0x19cb5a['name']){delete _0x19cb5a[_0x6203('0x29')];}_0x2d814a['status'](_0xf090d8)[_0x6203('0x2a')](_0x19cb5a);};}exports[_0x6203('0x2b')]=function(_0x6f67b4,_0x121c33){var _0x24c679={},_0x55c384={},_0x41a168={'count':0x0,'rows':[]};var _0x44d07a=_[_0x6203('0x2c')](db['OpenchannelTransferReport']['rawAttributes'],function(_0x11d232){return{'name':_0x11d232[_0x6203('0x2d')],'type':_0x11d232[_0x6203('0x2e')][_0x6203('0x2f')]};});_0x55c384[_0x6203('0x30')]=_[_0x6203('0x2c')](_0x44d07a,_0x6203('0x29'));_0x55c384['query']=_[_0x6203('0x31')](_0x6f67b4[_0x6203('0x32')]);_0x55c384[_0x6203('0x33')]=_[_0x6203('0x34')](_0x55c384['model'],_0x55c384[_0x6203('0x32')]);_0x24c679[_0x6203('0x35')]=_['intersection'](_0x55c384[_0x6203('0x30')],qs['fields'](_0x6f67b4[_0x6203('0x32')]['fields']));_0x24c679[_0x6203('0x35')]=_0x24c679[_0x6203('0x35')][_0x6203('0x36')]?_0x24c679[_0x6203('0x35')]:_0x55c384[_0x6203('0x30')];if(!_0x6f67b4['query'][_0x6203('0x37')](_0x6203('0x38'))){_0x24c679[_0x6203('0x1c')]=qs['limit'](_0x6f67b4[_0x6203('0x32')][_0x6203('0x1c')]);_0x24c679[_0x6203('0x1f')]=qs[_0x6203('0x1f')](_0x6f67b4[_0x6203('0x32')][_0x6203('0x1f')]);}_0x24c679[_0x6203('0x39')]=qs[_0x6203('0x3a')](_0x6f67b4['query'][_0x6203('0x3a')]);_0x24c679[_0x6203('0x3b')]=qs[_0x6203('0x33')](_[_0x6203('0x3c')](_0x6f67b4[_0x6203('0x32')],_0x55c384[_0x6203('0x33')]),_0x44d07a);if(_0x6f67b4[_0x6203('0x32')][_0x6203('0x3d')]){_0x24c679[_0x6203('0x3b')]=_[_0x6203('0x3e')](_0x24c679[_0x6203('0x3b')],{'$or':_[_0x6203('0x2c')](_0x44d07a,function(_0x257503){if(_0x257503[_0x6203('0x2e')]!==_0x6203('0x3f')){var _0x1b7964={};_0x1b7964[_0x257503[_0x6203('0x29')]]={'$like':'%'+_0x6f67b4[_0x6203('0x32')][_0x6203('0x3d')]+'%'};return _0x1b7964;}})});}_0x24c679=_[_0x6203('0x3e')]({},_0x24c679,_0x6f67b4[_0x6203('0x40')]);var _0x23ca74={'where':_0x24c679[_0x6203('0x3b')]};return db[_0x6203('0x41')][_0x6203('0x1e')](_0x23ca74)[_0x6203('0x42')](function(_0x1a6907){_0x41a168[_0x6203('0x1e')]=_0x1a6907;if(_0x6f67b4[_0x6203('0x32')]['includeAll']){_0x24c679['include']=[{'all':!![]}];}return db[_0x6203('0x41')][_0x6203('0x43')](_0x24c679);})[_0x6203('0x42')](function(_0x18ecbf){_0x41a168[_0x6203('0x44')]=_0x18ecbf;return _0x41a168;})[_0x6203('0x42')](respondWithFilteredResult(_0x121c33,_0x24c679))[_0x6203('0x45')](handleError(_0x121c33,null));};exports[_0x6203('0x46')]=function(_0x1a0cb3,_0x3414a5){var _0x1748ef={'raw':!![],'where':{'id':_0x1a0cb3[_0x6203('0x47')]['id']}},_0x54f48c={};_0x54f48c[_0x6203('0x30')]=_[_0x6203('0x31')](db[_0x6203('0x41')][_0x6203('0x48')]);_0x54f48c['query']=_[_0x6203('0x31')](_0x1a0cb3[_0x6203('0x32')]);_0x54f48c[_0x6203('0x33')]=_[_0x6203('0x34')](_0x54f48c[_0x6203('0x30')],_0x54f48c[_0x6203('0x32')]);_0x1748ef['attributes']=_[_0x6203('0x34')](_0x54f48c[_0x6203('0x30')],qs['fields'](_0x1a0cb3['query'][_0x6203('0x49')]));_0x1748ef['attributes']=_0x1748ef[_0x6203('0x35')][_0x6203('0x36')]?_0x1748ef[_0x6203('0x35')]:_0x54f48c['model'];if(_0x1a0cb3['query'][_0x6203('0x4a')]){_0x1748ef[_0x6203('0x4b')]=[{'all':!![]}];}_0x1748ef=_[_0x6203('0x3e')]({},_0x1748ef,_0x1a0cb3[_0x6203('0x40')]);return db[_0x6203('0x41')][_0x6203('0x4c')](_0x1748ef)[_0x6203('0x42')](handleEntityNotFound(_0x3414a5,null))['then'](respondWithResult(_0x3414a5,null))[_0x6203('0x45')](handleError(_0x3414a5,null));};exports[_0x6203('0x4d')]=function(_0x155a99,_0x5ed814){return db[_0x6203('0x41')][_0x6203('0x4d')](_0x155a99[_0x6203('0x4e')],{})[_0x6203('0x42')](respondWithResult(_0x5ed814,0xc9))['catch'](handleError(_0x5ed814,null));};exports[_0x6203('0x4f')]=function(_0x5e17b3,_0x5e4b83){if(_0x5e17b3[_0x6203('0x4e')]['id']){delete _0x5e17b3[_0x6203('0x4e')]['id'];}return db['OpenchannelTransferReport']['find']({'where':{'id':_0x5e17b3[_0x6203('0x47')]['id']}})['then'](handleEntityNotFound(_0x5e4b83,null))[_0x6203('0x42')](saveUpdates(_0x5e17b3[_0x6203('0x4e')],null))[_0x6203('0x42')](respondWithResult(_0x5e4b83,null))[_0x6203('0x45')](handleError(_0x5e4b83,null));};exports[_0x6203('0x25')]=function(_0x5e6035,_0x5f03d5){return db[_0x6203('0x41')][_0x6203('0x4c')]({'where':{'id':_0x5e6035['params']['id']}})['then'](handleEntityNotFound(_0x5f03d5,null))[_0x6203('0x42')](removeEntity(_0x5f03d5,null))['catch'](handleError(_0x5f03d5,null));};exports['describe']=function(_0xe42e2e,_0x193594){return db[_0x6203('0x41')][_0x6203('0x50')]()[_0x6203('0x42')](respondWithResult(_0x193594,null))['catch'](handleError(_0x193594,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index fc75107..d8d1a31 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 _0xc33f=['path','rimraf','../../config/environment','exports','define','OpenchannelTransferReport','uniqueid','lodash','../../config/logger','api','moment','request-promise'];(function(_0x3614c5,_0x174847){var _0x258563=function(_0x1beba8){while(--_0x1beba8){_0x3614c5['push'](_0x3614c5['shift']());}};_0x258563(++_0x174847);}(_0xc33f,0x193));var _0xfc33=function(_0x1bb11e,_0x58fd78){_0x1bb11e=_0x1bb11e-0x0;var _0x422492=_0xc33f[_0x1bb11e];return _0x422492;};'use strict';var _=require(_0xfc33('0x0'));var util=require('util');var logger=require(_0xfc33('0x1'))(_0xfc33('0x2'));var moment=require(_0xfc33('0x3'));var BPromise=require('bluebird');var rp=require(_0xfc33('0x4'));var fs=require('fs');var path=require(_0xfc33('0x5'));var rimraf=require(_0xfc33('0x6'));var config=require(_0xfc33('0x7'));var attributes=require('./openchannelTransferReport.attributes');module[_0xfc33('0x8')]=function(_0x3d14c1,_0x3e23eb){return _0x3d14c1[_0xfc33('0x9')](_0xfc33('0xa'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0xfc33('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3e2d=['./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x15af2f,_0x3c0a01){var _0x359239=function(_0x20da30){while(--_0x20da30){_0x15af2f['push'](_0x15af2f['shift']());}};_0x359239(++_0x3c0a01);}(_0x3e2d,0xf6));var _0xd3e2=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x3e2d[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0xd3e2('0x0'));var util=require(_0xd3e2('0x1'));var logger=require(_0xd3e2('0x2'))(_0xd3e2('0x3'));var moment=require(_0xd3e2('0x4'));var BPromise=require(_0xd3e2('0x5'));var rp=require(_0xd3e2('0x6'));var fs=require('fs');var path=require(_0xd3e2('0x7'));var rimraf=require('rimraf');var config=require(_0xd3e2('0x8'));var attributes=require(_0xd3e2('0x9'));module[_0xd3e2('0xa')]=function(_0x1d60b0,_0x2346fc){return _0x1d60b0[_0xd3e2('0xb')](_0xd3e2('0xc'),attributes,{'tableName':_0xd3e2('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd3e2('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 631964a..2cda2ce 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 _0x2975=['http','request','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client'];(function(_0x3259fe,_0x4925fa){var _0xae7b06=function(_0x28dffb){while(--_0x28dffb){_0x3259fe['push'](_0x3259fe['shift']());}};_0xae7b06(++_0x4925fa);}(_0x2975,0x1c5));var _0x5297=function(_0x469263,_0x31b5b2){_0x469263=_0x469263-0x0;var _0x206b2d=_0x2975[_0x469263];return _0x206b2d;};'use strict';var _=require('lodash');var util=require(_0x5297('0x0'));var moment=require(_0x5297('0x1'));var BPromise=require(_0x5297('0x2'));var rs=require(_0x5297('0x3'));var fs=require('fs');var Redis=require(_0x5297('0x4'));var db=require(_0x5297('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x5297('0x6'));var jayson=require(_0x5297('0x7'));var client=jayson[_0x5297('0x8')][_0x5297('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d1d2c,_0x1f6762,_0x1b72a7){return new BPromise(function(_0x4f12b0,_0x2c015c){return client[_0x5297('0xa')](_0x4d1d2c,_0x1b72a7)[_0x5297('0xb')](function(_0x2f3b24){logger[_0x5297('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1f6762,_0x5297('0xd'));logger[_0x5297('0xe')](_0x5297('0xf'),_0x1f6762,'request\x20sent',JSON[_0x5297('0x10')](_0x2f3b24));if(_0x2f3b24[_0x5297('0x11')]){if(_0x2f3b24[_0x5297('0x11')]['code']===0x1f4){logger[_0x5297('0x11')](_0x5297('0x12'),_0x1f6762,_0x2f3b24['error']['message']);return _0x2c015c(_0x2f3b24[_0x5297('0x11')][_0x5297('0x13')]);}logger['error'](_0x5297('0x12'),_0x1f6762,_0x2f3b24['error'][_0x5297('0x13')]);return _0x4f12b0(_0x2f3b24[_0x5297('0x11')]['message']);}else{logger[_0x5297('0xc')](_0x5297('0x12'),_0x1f6762,_0x5297('0xd'));_0x4f12b0(_0x2f3b24[_0x5297('0x14')][_0x5297('0x13')]);}})[_0x5297('0x15')](function(_0x1fb138){logger[_0x5297('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1f6762,_0x1fb138);_0x2c015c(_0x1fb138);});});} \ No newline at end of file +var _0xdc59=['catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5f41ca,_0x3346b3){var _0xeaeb6=function(_0x2f3f5f){while(--_0x2f3f5f){_0x5f41ca['push'](_0x5f41ca['shift']());}};_0xeaeb6(++_0x3346b3);}(_0xdc59,0x12c));var _0x9dc5=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xdc59[_0x5a776b];return _0xbbef59;};'use strict';var _=require(_0x9dc5('0x0'));var util=require(_0x9dc5('0x1'));var moment=require(_0x9dc5('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9dc5('0x3'));var db=require(_0x9dc5('0x4'))['db'];var utils=require(_0x9dc5('0x5'));var logger=require(_0x9dc5('0x6'))(_0x9dc5('0x7'));var config=require(_0x9dc5('0x8'));var jayson=require(_0x9dc5('0x9'));var client=jayson[_0x9dc5('0xa')][_0x9dc5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48beee,_0x42941b,_0x10b268){return new BPromise(function(_0x202a8a,_0x3729b6){return client[_0x9dc5('0xc')](_0x48beee,_0x10b268)[_0x9dc5('0xd')](function(_0x174835){logger[_0x9dc5('0xe')](_0x9dc5('0xf'),_0x42941b,_0x9dc5('0x10'));logger['debug'](_0x9dc5('0x11'),_0x42941b,_0x9dc5('0x10'),JSON[_0x9dc5('0x12')](_0x174835));if(_0x174835[_0x9dc5('0x13')]){if(_0x174835['error'][_0x9dc5('0x14')]===0x1f4){logger[_0x9dc5('0x13')](_0x9dc5('0xf'),_0x42941b,_0x174835['error'][_0x9dc5('0x15')]);return _0x3729b6(_0x174835[_0x9dc5('0x13')][_0x9dc5('0x15')]);}logger[_0x9dc5('0x13')](_0x9dc5('0xf'),_0x42941b,_0x174835[_0x9dc5('0x13')][_0x9dc5('0x15')]);return _0x202a8a(_0x174835[_0x9dc5('0x13')][_0x9dc5('0x15')]);}else{logger[_0x9dc5('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x42941b,_0x9dc5('0x10'));_0x202a8a(_0x174835['result'][_0x9dc5('0x15')]);}})[_0x9dc5('0x16')](function(_0x5a9ffb){logger[_0x9dc5('0x13')](_0x9dc5('0xf'),_0x42941b,_0x5a9ffb);_0x3729b6(_0x5a9ffb);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index ba2b33f..88f5543 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 _0x953e=['delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','./pause.controller','get','isAuthenticated','index','put','update'];(function(_0x59616b,_0x38e534){var _0x5c4523=function(_0x166f2e){while(--_0x166f2e){_0x59616b['push'](_0x59616b['shift']());}};_0x5c4523(++_0x38e534);}(_0x953e,0xb4));var _0xe953=function(_0x203814,_0x1c92a6){_0x203814=_0x203814-0x0;var _0x2aaf64=_0x953e[_0x203814];return _0x2aaf64;};'use strict';var multer=require(_0xe953('0x0'));var util=require(_0xe953('0x1'));var path=require('path');var timeout=require(_0xe953('0x2'));var express=require(_0xe953('0x3'));var router=express[_0xe953('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe953('0x5'));var config=require('../../config/environment');var controller=require(_0xe953('0x6'));router[_0xe953('0x7')]('/',auth[_0xe953('0x8')](),controller[_0xe953('0x9')]);router[_0xe953('0x7')]('/:id',auth[_0xe953('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe953('0xa')]('/:id',auth[_0xe953('0x8')](),controller[_0xe953('0xb')]);router[_0xe953('0xc')](_0xe953('0xd'),auth[_0xe953('0x8')](),controller[_0xe953('0xe')]);module[_0xe953('0xf')]=router; \ No newline at end of file +var _0x4e65=['get','isAuthenticated','show','post','put','/:id','update','delete','destroy','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./pause.controller'];(function(_0x2dcdad,_0x1d2613){var _0x3f436a=function(_0x11e1c9){while(--_0x11e1c9){_0x2dcdad['push'](_0x2dcdad['shift']());}};_0x3f436a(++_0x1d2613);}(_0x4e65,0xc4));var _0x54e6=function(_0xb498f6,_0x31c8b8){_0xb498f6=_0xb498f6-0x0;var _0x378558=_0x4e65[_0xb498f6];return _0x378558;};'use strict';var multer=require('multer');var util=require(_0x54e6('0x0'));var path=require(_0x54e6('0x1'));var timeout=require(_0x54e6('0x2'));var express=require(_0x54e6('0x3'));var router=express[_0x54e6('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x54e6('0x5'));var config=require(_0x54e6('0x6'));var controller=require(_0x54e6('0x7'));router[_0x54e6('0x8')]('/',auth[_0x54e6('0x9')](),controller['index']);router[_0x54e6('0x8')]('/:id',auth[_0x54e6('0x9')](),controller[_0x54e6('0xa')]);router[_0x54e6('0xb')]('/',auth[_0x54e6('0x9')](),controller['create']);router[_0x54e6('0xc')](_0x54e6('0xd'),auth[_0x54e6('0x9')](),controller[_0x54e6('0xe')]);router[_0x54e6('0xf')](_0x54e6('0xd'),auth['isAuthenticated'](),controller[_0x54e6('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 2136bb6..370c371 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 _0x6380=['STRING','sequelize'];(function(_0x2d4421,_0x15a84f){var _0x2d3b01=function(_0xb9e94c){while(--_0xb9e94c){_0x2d4421['push'](_0x2d4421['shift']());}};_0x2d3b01(++_0x15a84f);}(_0x6380,0x11d));var _0x0638=function(_0x4e9158,_0x160de0){_0x4e9158=_0x4e9158-0x0;var _0x3ce7d5=_0x6380[_0x4e9158];return _0x3ce7d5;};'use strict';var Sequelize=require(_0x0638('0x0'));module['exports']={'name':{'type':Sequelize[_0x0638('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x0638('0x1')]}}; \ No newline at end of file +var _0x7b98=['exports','STRING','sequelize'];(function(_0x22979c,_0x71b35e){var _0x4186d3=function(_0x103e63){while(--_0x103e63){_0x22979c['push'](_0x22979c['shift']());}};_0x4186d3(++_0x71b35e);}(_0x7b98,0xbf));var _0x87b9=function(_0x1daaa9,_0x220393){_0x1daaa9=_0x1daaa9-0x0;var _0x1dd221=_0x7b98[_0x1daaa9];return _0x1dd221;};'use strict';var Sequelize=require(_0x87b9('0x0'));module[_0x87b9('0x1')]={'name':{'type':Sequelize[_0x87b9('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x87b9('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 925322f..5e75ace 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 _0xf727=['query','attributes','fields','model','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','Pauses','UserProfileResource','error','stack','name','send','index','map','Pause','rawAttributes','keys','filters','intersection'];(function(_0x4d5c12,_0x2015fe){var _0x54ac8b=function(_0x5e84cc){while(--_0x5e84cc){_0x4d5c12['push'](_0x4d5c12['shift']());}};_0x54ac8b(++_0x2015fe);}(_0xf727,0x1bb));var _0x7f72=function(_0x45d26b,_0xe9d33f){_0x45d26b=_0x45d26b-0x0;var _0x261fb2=_0xf727[_0x45d26b];return _0x261fb2;};'use strict';var emlformat=require(_0x7f72('0x0'));var rimraf=require(_0x7f72('0x1'));var zipdir=require(_0x7f72('0x2'));var jsonpatch=require(_0x7f72('0x3'));var rp=require(_0x7f72('0x4'));var moment=require(_0x7f72('0x5'));var BPromise=require(_0x7f72('0x6'));var Mustache=require(_0x7f72('0x7'));var util=require(_0x7f72('0x8'));var path=require(_0x7f72('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7f72('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7f72('0xb'));var squel=require('squel');var crypto=require(_0x7f72('0xc'));var jsforce=require(_0x7f72('0xd'));var deskjs=require(_0x7f72('0xe'));var toCsv=require(_0x7f72('0xf'));var querystring=require(_0x7f72('0x10'));var Papa=require(_0x7f72('0x11'));var Redis=require('ioredis');var authService=require(_0x7f72('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7f72('0x13'));var hardwareService=require(_0x7f72('0x14'));var logger=require(_0x7f72('0x15'))(_0x7f72('0x16'));var utils=require(_0x7f72('0x17'));var config=require(_0x7f72('0x18'));var licenseUtil=require(_0x7f72('0x19'));var db=require(_0x7f72('0x1a'))['db'];function respondWithStatusCode(_0x4d7714,_0x1e0a5e){_0x1e0a5e=_0x1e0a5e||0xcc;return function(_0x438b3f){if(_0x438b3f){return _0x4d7714[_0x7f72('0x1b')](_0x1e0a5e);}return _0x4d7714['status'](_0x1e0a5e)[_0x7f72('0x1c')]();};}function respondWithResult(_0x28f592,_0x194070){_0x194070=_0x194070||0xc8;return function(_0x5844c2){if(_0x5844c2){return _0x28f592[_0x7f72('0x1d')](_0x194070)[_0x7f72('0x1e')](_0x5844c2);}};}function respondWithFilteredResult(_0x5845b4,_0x56a307){return function(_0x4abc16){if(_0x4abc16){var _0x342a1b=typeof _0x56a307[_0x7f72('0x1f')]===_0x7f72('0x20')&&typeof _0x56a307[_0x7f72('0x21')]===_0x7f72('0x20');var _0x2c37cb=_0x4abc16['count'];var _0xfa80af=_0x342a1b?0x0:_0x56a307[_0x7f72('0x1f')];var _0x3a1cd4=_0x342a1b?_0x4abc16[_0x7f72('0x22')]:_0x56a307[_0x7f72('0x1f')]+_0x56a307['limit'];var _0x53eb2f;if(_0x3a1cd4>=_0x2c37cb){_0x3a1cd4=_0x2c37cb;_0x53eb2f=0xc8;}else{_0x53eb2f=0xce;}_0x5845b4[_0x7f72('0x1d')](_0x53eb2f);return _0x5845b4[_0x7f72('0x23')]('Content-Range',_0xfa80af+'-'+_0x3a1cd4+'/'+_0x2c37cb)[_0x7f72('0x1e')](_0x4abc16);}return null;};}function patchUpdates(_0x2a40d3){return function(_0x519f09){try{jsonpatch[_0x7f72('0x24')](_0x519f09,_0x2a40d3,!![]);}catch(_0x56743b){return BPromise[_0x7f72('0x25')](_0x56743b);}return _0x519f09[_0x7f72('0x26')]();};}function saveUpdates(_0x48f4a6,_0x42739e){return function(_0x15fdc2){if(_0x15fdc2){return _0x15fdc2[_0x7f72('0x27')](_0x48f4a6)['then'](function(_0x1f2165){return _0x1f2165;});}return null;};}function removeEntity(_0x3088d9,_0x5e48ba){return function(_0x2d0fcf){if(_0x2d0fcf){return _0x2d0fcf[_0x7f72('0x28')]()[_0x7f72('0x29')](function(){var _0x1f84bb=_0x2d0fcf['get']({'plain':!![]});var _0xf8caef=_0x7f72('0x2a');return db[_0x7f72('0x2b')][_0x7f72('0x28')]({'where':{'type':_0xf8caef,'resourceId':_0x1f84bb['id']}})[_0x7f72('0x29')](function(){return _0x2d0fcf;});})['then'](function(){_0x3088d9[_0x7f72('0x1d')](0xcc)[_0x7f72('0x1c')]();});}};}function handleEntityNotFound(_0xbf29c8,_0x2e53c7){return function(_0x2e1814){if(!_0x2e1814){_0xbf29c8['sendStatus'](0x194);}return _0x2e1814;};}function handleError(_0x2ed67d,_0x5ce309){_0x5ce309=_0x5ce309||0x1f4;return function(_0x55ca34){logger[_0x7f72('0x2c')](_0x55ca34[_0x7f72('0x2d')]);if(_0x55ca34['name']){delete _0x55ca34[_0x7f72('0x2e')];}_0x2ed67d['status'](_0x5ce309)[_0x7f72('0x2f')](_0x55ca34);};}exports[_0x7f72('0x30')]=function(_0x270ca0,_0x57003d){var _0x51411c={},_0x316aee={},_0x18b577={'count':0x0,'rows':[]};var _0x21673b=_[_0x7f72('0x31')](db[_0x7f72('0x32')][_0x7f72('0x33')],function(_0x240282){return{'name':_0x240282['fieldName'],'type':_0x240282['type']['key']};});_0x316aee['model']=_[_0x7f72('0x31')](_0x21673b,_0x7f72('0x2e'));_0x316aee['query']=_[_0x7f72('0x34')](_0x270ca0['query']);_0x316aee[_0x7f72('0x35')]=_[_0x7f72('0x36')](_0x316aee['model'],_0x316aee[_0x7f72('0x37')]);_0x51411c[_0x7f72('0x38')]=_[_0x7f72('0x36')](_0x316aee['model'],qs[_0x7f72('0x39')](_0x270ca0[_0x7f72('0x37')][_0x7f72('0x39')]));_0x51411c[_0x7f72('0x38')]=_0x51411c[_0x7f72('0x38')]['length']?_0x51411c['attributes']:_0x316aee[_0x7f72('0x3a')];if(!_0x270ca0['query']['hasOwnProperty']('nolimit')){_0x51411c['limit']=qs['limit'](_0x270ca0[_0x7f72('0x37')][_0x7f72('0x21')]);_0x51411c[_0x7f72('0x1f')]=qs['offset'](_0x270ca0['query'][_0x7f72('0x1f')]);}_0x51411c[_0x7f72('0x3b')]=qs[_0x7f72('0x3c')](_0x270ca0[_0x7f72('0x37')]['sort']);_0x51411c[_0x7f72('0x3d')]=qs[_0x7f72('0x35')](_['pick'](_0x270ca0[_0x7f72('0x37')],_0x316aee['filters']),_0x21673b);if(_0x270ca0[_0x7f72('0x37')]['filter']){_0x51411c[_0x7f72('0x3d')]=_[_0x7f72('0x3e')](_0x51411c[_0x7f72('0x3d')],{'$or':_['map'](_0x21673b,function(_0x212464){if(_0x212464['type']!==_0x7f72('0x3f')){var _0x1c6123={};_0x1c6123[_0x212464['name']]={'$like':'%'+_0x270ca0[_0x7f72('0x37')][_0x7f72('0x40')]+'%'};return _0x1c6123;}})});}_0x51411c=_[_0x7f72('0x3e')]({},_0x51411c,_0x270ca0['options']);var _0x383847={'where':_0x51411c[_0x7f72('0x3d')]};return db[_0x7f72('0x32')][_0x7f72('0x22')](_0x383847)['then'](function(_0x2fd395){_0x18b577[_0x7f72('0x22')]=_0x2fd395;if(_0x270ca0[_0x7f72('0x37')][_0x7f72('0x41')]){_0x51411c[_0x7f72('0x42')]=[{'all':!![]}];}return db[_0x7f72('0x32')][_0x7f72('0x43')](_0x51411c);})[_0x7f72('0x29')](function(_0x10d72a){_0x18b577[_0x7f72('0x44')]=_0x10d72a;return _0x18b577;})['then'](respondWithFilteredResult(_0x57003d,_0x51411c))[_0x7f72('0x45')](handleError(_0x57003d,null));};exports[_0x7f72('0x46')]=function(_0x32e8a0,_0x5280d8){var _0x15039d={'raw':!![],'where':{'id':_0x32e8a0[_0x7f72('0x47')]['id']}},_0x362eb0={};_0x362eb0[_0x7f72('0x3a')]=_['keys'](db['Pause']['rawAttributes']);_0x362eb0[_0x7f72('0x37')]=_[_0x7f72('0x34')](_0x32e8a0[_0x7f72('0x37')]);_0x362eb0[_0x7f72('0x35')]=_[_0x7f72('0x36')](_0x362eb0[_0x7f72('0x3a')],_0x362eb0[_0x7f72('0x37')]);_0x15039d[_0x7f72('0x38')]=_[_0x7f72('0x36')](_0x362eb0[_0x7f72('0x3a')],qs[_0x7f72('0x39')](_0x32e8a0[_0x7f72('0x37')]['fields']));_0x15039d[_0x7f72('0x38')]=_0x15039d[_0x7f72('0x38')][_0x7f72('0x48')]?_0x15039d[_0x7f72('0x38')]:_0x362eb0[_0x7f72('0x3a')];if(_0x32e8a0['query'][_0x7f72('0x41')]){_0x15039d[_0x7f72('0x42')]=[{'all':!![]}];}_0x15039d=_[_0x7f72('0x3e')]({},_0x15039d,_0x32e8a0[_0x7f72('0x49')]);return db[_0x7f72('0x32')][_0x7f72('0x4a')](_0x15039d)[_0x7f72('0x29')](handleEntityNotFound(_0x5280d8,null))[_0x7f72('0x29')](respondWithResult(_0x5280d8,null))[_0x7f72('0x45')](handleError(_0x5280d8,null));};exports[_0x7f72('0x4b')]=function(_0x4d5372,_0x49eea7){return db['Pause'][_0x7f72('0x4b')](_0x4d5372[_0x7f72('0x4c')],{})['then'](function(_0x45a8cb){var _0x1a83fd=_0x4d5372[_0x7f72('0x4d')]['get']({'plain':!![]});if(!_0x1a83fd)throw new Error(_0x7f72('0x4e'));if(_0x1a83fd[_0x7f72('0x4f')]==='user'){var _0x4911a4=_0x45a8cb['get']({'plain':!![]});var _0x3922f7=_0x7f72('0x2a');return db[_0x7f72('0x50')][_0x7f72('0x4a')]({'where':{'name':_0x3922f7,'userProfileId':_0x1a83fd[_0x7f72('0x51')]},'raw':!![]})['then'](function(_0x590b4f){if(_0x590b4f&&_0x590b4f['autoAssociation']===0x0){return db[_0x7f72('0x2b')][_0x7f72('0x4b')]({'name':_0x4911a4['name'],'resourceId':_0x4911a4['id'],'type':_0x590b4f[_0x7f72('0x2e')],'sectionId':_0x590b4f['id']},{})[_0x7f72('0x29')](function(){return _0x45a8cb;});}else{return _0x45a8cb;}})[_0x7f72('0x45')](function(_0x40c2e1){logger[_0x7f72('0x2c')](_0x7f72('0x52'),_0x40c2e1);throw _0x40c2e1;});}return _0x45a8cb;})[_0x7f72('0x29')](respondWithResult(_0x49eea7,0xc9))[_0x7f72('0x45')](handleError(_0x49eea7,null));};exports[_0x7f72('0x27')]=function(_0x16665c,_0x423056){if(_0x16665c[_0x7f72('0x4c')]['id']){delete _0x16665c[_0x7f72('0x4c')]['id'];}return db[_0x7f72('0x32')][_0x7f72('0x4a')]({'where':{'id':_0x16665c['params']['id']}})[_0x7f72('0x29')](handleEntityNotFound(_0x423056,null))['then'](saveUpdates(_0x16665c[_0x7f72('0x4c')],null))[_0x7f72('0x29')](respondWithResult(_0x423056,null))[_0x7f72('0x45')](handleError(_0x423056,null));};exports[_0x7f72('0x28')]=function(_0x135588,_0x232266){return db[_0x7f72('0x32')][_0x7f72('0x4a')]({'where':{'id':_0x135588[_0x7f72('0x47')]['id']}})[_0x7f72('0x29')](handleEntityNotFound(_0x232266,null))[_0x7f72('0x29')](removeEntity(_0x232266,null))[_0x7f72('0x45')](handleError(_0x232266,null));}; \ No newline at end of file +var _0x0d80=['intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Pause','includeAll','include','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','Pauses','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x777909,_0x5f9b7b){var _0x3aac0b=function(_0x1daf10){while(--_0x1daf10){_0x777909['push'](_0x777909['shift']());}};_0x3aac0b(++_0x5f9b7b);}(_0x0d80,0x72));var _0x00d8=function(_0x3b7a0c,_0xf1a4c2){_0x3b7a0c=_0x3b7a0c-0x0;var _0x3bb70f=_0x0d80[_0x3b7a0c];return _0x3bb70f;};'use strict';var emlformat=require(_0x00d8('0x0'));var rimraf=require(_0x00d8('0x1'));var zipdir=require(_0x00d8('0x2'));var jsonpatch=require(_0x00d8('0x3'));var rp=require('request-promise');var moment=require(_0x00d8('0x4'));var BPromise=require(_0x00d8('0x5'));var Mustache=require(_0x00d8('0x6'));var util=require(_0x00d8('0x7'));var path=require(_0x00d8('0x8'));var sox=require(_0x00d8('0x9'));var csv=require(_0x00d8('0xa'));var ejs=require(_0x00d8('0xb'));var fs=require('fs');var fs_extra=require(_0x00d8('0xc'));var _=require(_0x00d8('0xd'));var squel=require(_0x00d8('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x00d8('0xf'));var toCsv=require(_0x00d8('0xa'));var querystring=require(_0x00d8('0x10'));var Papa=require(_0x00d8('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x00d8('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x00d8('0x13'));var logger=require(_0x00d8('0x14'))(_0x00d8('0x15'));var utils=require(_0x00d8('0x16'));var config=require(_0x00d8('0x17'));var licenseUtil=require(_0x00d8('0x18'));var db=require(_0x00d8('0x19'))['db'];function respondWithStatusCode(_0x35355c,_0x2b8e3b){_0x2b8e3b=_0x2b8e3b||0xcc;return function(_0x3a2734){if(_0x3a2734){return _0x35355c[_0x00d8('0x1a')](_0x2b8e3b);}return _0x35355c[_0x00d8('0x1b')](_0x2b8e3b)[_0x00d8('0x1c')]();};}function respondWithResult(_0x3a797a,_0x51c1b9){_0x51c1b9=_0x51c1b9||0xc8;return function(_0x19f9d1){if(_0x19f9d1){return _0x3a797a[_0x00d8('0x1b')](_0x51c1b9)[_0x00d8('0x1d')](_0x19f9d1);}};}function respondWithFilteredResult(_0x3545e8,_0x96dcfc){return function(_0x239545){if(_0x239545){var _0x3c6f13=typeof _0x96dcfc[_0x00d8('0x1e')]==='undefined'&&typeof _0x96dcfc[_0x00d8('0x1f')]===_0x00d8('0x20');var _0x548fa7=_0x239545[_0x00d8('0x21')];var _0x53c47c=_0x3c6f13?0x0:_0x96dcfc[_0x00d8('0x1e')];var _0x18b896=_0x3c6f13?_0x239545[_0x00d8('0x21')]:_0x96dcfc[_0x00d8('0x1e')]+_0x96dcfc[_0x00d8('0x1f')];var _0x4a3e83;if(_0x18b896>=_0x548fa7){_0x18b896=_0x548fa7;_0x4a3e83=0xc8;}else{_0x4a3e83=0xce;}_0x3545e8['status'](_0x4a3e83);return _0x3545e8[_0x00d8('0x22')](_0x00d8('0x23'),_0x53c47c+'-'+_0x18b896+'/'+_0x548fa7)['json'](_0x239545);}return null;};}function patchUpdates(_0x56a83f){return function(_0x64552e){try{jsonpatch[_0x00d8('0x24')](_0x64552e,_0x56a83f,!![]);}catch(_0x523b43){return BPromise[_0x00d8('0x25')](_0x523b43);}return _0x64552e['save']();};}function saveUpdates(_0x1dcc0f,_0x56c93){return function(_0xf37435){if(_0xf37435){return _0xf37435[_0x00d8('0x26')](_0x1dcc0f)[_0x00d8('0x27')](function(_0x3bbe7b){return _0x3bbe7b;});}return null;};}function removeEntity(_0x242b1a,_0x1746f9){return function(_0xfd1f1e){if(_0xfd1f1e){return _0xfd1f1e[_0x00d8('0x28')]()[_0x00d8('0x27')](function(){var _0x307e59=_0xfd1f1e[_0x00d8('0x29')]({'plain':!![]});var _0xbe8c08=_0x00d8('0x2a');return db['UserProfileResource'][_0x00d8('0x28')]({'where':{'type':_0xbe8c08,'resourceId':_0x307e59['id']}})['then'](function(){return _0xfd1f1e;});})['then'](function(){_0x242b1a[_0x00d8('0x1b')](0xcc)[_0x00d8('0x1c')]();});}};}function handleEntityNotFound(_0x250f6f,_0x2ec2c3){return function(_0x2b72e2){if(!_0x2b72e2){_0x250f6f[_0x00d8('0x1a')](0x194);}return _0x2b72e2;};}function handleError(_0x31ad01,_0x172130){_0x172130=_0x172130||0x1f4;return function(_0xa89525){logger['error'](_0xa89525[_0x00d8('0x2b')]);if(_0xa89525[_0x00d8('0x2c')]){delete _0xa89525[_0x00d8('0x2c')];}_0x31ad01[_0x00d8('0x1b')](_0x172130)[_0x00d8('0x2d')](_0xa89525);};}exports[_0x00d8('0x2e')]=function(_0x390180,_0x189ef0){var _0x1c5742={},_0x447642={},_0x3dc4ed={'count':0x0,'rows':[]};var _0x21820f=_[_0x00d8('0x2f')](db['Pause'][_0x00d8('0x30')],function(_0x10f834){return{'name':_0x10f834[_0x00d8('0x31')],'type':_0x10f834[_0x00d8('0x32')][_0x00d8('0x33')]};});_0x447642[_0x00d8('0x34')]=_[_0x00d8('0x2f')](_0x21820f,'name');_0x447642[_0x00d8('0x35')]=_[_0x00d8('0x36')](_0x390180['query']);_0x447642[_0x00d8('0x37')]=_[_0x00d8('0x38')](_0x447642[_0x00d8('0x34')],_0x447642[_0x00d8('0x35')]);_0x1c5742[_0x00d8('0x39')]=_['intersection'](_0x447642[_0x00d8('0x34')],qs[_0x00d8('0x3a')](_0x390180['query']['fields']));_0x1c5742[_0x00d8('0x39')]=_0x1c5742['attributes'][_0x00d8('0x3b')]?_0x1c5742[_0x00d8('0x39')]:_0x447642[_0x00d8('0x34')];if(!_0x390180[_0x00d8('0x35')][_0x00d8('0x3c')]('nolimit')){_0x1c5742[_0x00d8('0x1f')]=qs['limit'](_0x390180['query'][_0x00d8('0x1f')]);_0x1c5742[_0x00d8('0x1e')]=qs[_0x00d8('0x1e')](_0x390180[_0x00d8('0x35')][_0x00d8('0x1e')]);}_0x1c5742[_0x00d8('0x3d')]=qs[_0x00d8('0x3e')](_0x390180[_0x00d8('0x35')][_0x00d8('0x3e')]);_0x1c5742[_0x00d8('0x3f')]=qs[_0x00d8('0x37')](_[_0x00d8('0x40')](_0x390180[_0x00d8('0x35')],_0x447642[_0x00d8('0x37')]),_0x21820f);if(_0x390180[_0x00d8('0x35')][_0x00d8('0x41')]){_0x1c5742[_0x00d8('0x3f')]=_[_0x00d8('0x42')](_0x1c5742[_0x00d8('0x3f')],{'$or':_['map'](_0x21820f,function(_0x41ff64){if(_0x41ff64[_0x00d8('0x32')]!==_0x00d8('0x43')){var _0x2a9a9b={};_0x2a9a9b[_0x41ff64[_0x00d8('0x2c')]]={'$like':'%'+_0x390180[_0x00d8('0x35')][_0x00d8('0x41')]+'%'};return _0x2a9a9b;}})});}_0x1c5742=_[_0x00d8('0x42')]({},_0x1c5742,_0x390180[_0x00d8('0x44')]);var _0x2c19d6={'where':_0x1c5742[_0x00d8('0x3f')]};return db[_0x00d8('0x45')][_0x00d8('0x21')](_0x2c19d6)['then'](function(_0x3f23ab){_0x3dc4ed[_0x00d8('0x21')]=_0x3f23ab;if(_0x390180['query'][_0x00d8('0x46')]){_0x1c5742[_0x00d8('0x47')]=[{'all':!![]}];}return db[_0x00d8('0x45')]['findAll'](_0x1c5742);})[_0x00d8('0x27')](function(_0x2671cc){_0x3dc4ed['rows']=_0x2671cc;return _0x3dc4ed;})[_0x00d8('0x27')](respondWithFilteredResult(_0x189ef0,_0x1c5742))[_0x00d8('0x48')](handleError(_0x189ef0,null));};exports[_0x00d8('0x49')]=function(_0x5c0b06,_0x4a0fa8){var _0x575b91={'raw':!![],'where':{'id':_0x5c0b06[_0x00d8('0x4a')]['id']}},_0x2636ef={};_0x2636ef[_0x00d8('0x34')]=_[_0x00d8('0x36')](db[_0x00d8('0x45')][_0x00d8('0x30')]);_0x2636ef['query']=_['keys'](_0x5c0b06[_0x00d8('0x35')]);_0x2636ef['filters']=_[_0x00d8('0x38')](_0x2636ef[_0x00d8('0x34')],_0x2636ef['query']);_0x575b91[_0x00d8('0x39')]=_['intersection'](_0x2636ef[_0x00d8('0x34')],qs[_0x00d8('0x3a')](_0x5c0b06['query'][_0x00d8('0x3a')]));_0x575b91[_0x00d8('0x39')]=_0x575b91[_0x00d8('0x39')]['length']?_0x575b91['attributes']:_0x2636ef[_0x00d8('0x34')];if(_0x5c0b06[_0x00d8('0x35')][_0x00d8('0x46')]){_0x575b91[_0x00d8('0x47')]=[{'all':!![]}];}_0x575b91=_[_0x00d8('0x42')]({},_0x575b91,_0x5c0b06[_0x00d8('0x44')]);return db[_0x00d8('0x45')][_0x00d8('0x4b')](_0x575b91)[_0x00d8('0x27')](handleEntityNotFound(_0x4a0fa8,null))[_0x00d8('0x27')](respondWithResult(_0x4a0fa8,null))[_0x00d8('0x48')](handleError(_0x4a0fa8,null));};exports[_0x00d8('0x4c')]=function(_0x87c2af,_0x3bd365){return db[_0x00d8('0x45')]['create'](_0x87c2af[_0x00d8('0x4d')],{})[_0x00d8('0x27')](function(_0x449740){var _0x23a2b5=_0x87c2af[_0x00d8('0x4e')][_0x00d8('0x29')]({'plain':!![]});if(!_0x23a2b5)throw new Error(_0x00d8('0x4f'));if(_0x23a2b5[_0x00d8('0x50')]===_0x00d8('0x4e')){var _0x1d8e1a=_0x449740[_0x00d8('0x29')]({'plain':!![]});var _0x45009e=_0x00d8('0x2a');return db[_0x00d8('0x51')][_0x00d8('0x4b')]({'where':{'name':_0x45009e,'userProfileId':_0x23a2b5[_0x00d8('0x52')]},'raw':!![]})[_0x00d8('0x27')](function(_0x2cd2eb){if(_0x2cd2eb&&_0x2cd2eb[_0x00d8('0x53')]===0x0){return db[_0x00d8('0x54')]['create']({'name':_0x1d8e1a[_0x00d8('0x2c')],'resourceId':_0x1d8e1a['id'],'type':_0x2cd2eb[_0x00d8('0x2c')],'sectionId':_0x2cd2eb['id']},{})['then'](function(){return _0x449740;});}else{return _0x449740;}})[_0x00d8('0x48')](function(_0x4fc47d){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4fc47d);throw _0x4fc47d;});}return _0x449740;})[_0x00d8('0x27')](respondWithResult(_0x3bd365,0xc9))[_0x00d8('0x48')](handleError(_0x3bd365,null));};exports[_0x00d8('0x26')]=function(_0x496b90,_0xd9efd5){if(_0x496b90[_0x00d8('0x4d')]['id']){delete _0x496b90[_0x00d8('0x4d')]['id'];}return db[_0x00d8('0x45')]['find']({'where':{'id':_0x496b90['params']['id']}})[_0x00d8('0x27')](handleEntityNotFound(_0xd9efd5,null))[_0x00d8('0x27')](saveUpdates(_0x496b90[_0x00d8('0x4d')],null))['then'](respondWithResult(_0xd9efd5,null))[_0x00d8('0x48')](handleError(_0xd9efd5,null));};exports[_0x00d8('0x28')]=function(_0x5739ac,_0x1a66b9){return db[_0x00d8('0x45')][_0x00d8('0x4b')]({'where':{'id':_0x5739ac[_0x00d8('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1a66b9,null))[_0x00d8('0x27')](removeEntity(_0x1a66b9,null))['catch'](handleError(_0x1a66b9,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index ab3333d..dfdac30 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 _0x1cb9=['./pause.attributes','exports','define','Pause','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x30d845,_0x15784d){var _0x2b3919=function(_0x3b6d18){while(--_0x3b6d18){_0x30d845['push'](_0x30d845['shift']());}};_0x2b3919(++_0x15784d);}(_0x1cb9,0x14e));var _0x91cb=function(_0x52efd4,_0x2d5faa){_0x52efd4=_0x52efd4-0x0;var _0x3abc57=_0x1cb9[_0x52efd4];return _0x3abc57;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fc3=['lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./pause.attributes','exports','define','tools_pauses'];(function(_0x609c59,_0x404ef9){var _0x1d1c91=function(_0x165481){while(--_0x165481){_0x609c59['push'](_0x609c59['shift']());}};_0x1d1c91(++_0x404ef9);}(_0x5fc3,0xa8));var _0x35fc=function(_0x5466ab,_0x227b13){_0x5466ab=_0x5466ab-0x0;var _0x40751a=_0x5fc3[_0x5466ab];return _0x40751a;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('Pause',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index ef8a379..0808d51 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x30304b,_0x3c4e82){var _0x14cebf=function(_0xb0a766){while(--_0xb0a766){_0x30304b['push'](_0x30304b['shift']());}};_0x14cebf(++_0x3c4e82);}(_0xb10b,0x12a));var _0xbb10=function(_0x484e74,_0x4e62bd){_0x484e74=_0x484e74-0x0;var _0x2874fa=_0xb10b[_0x484e74];return _0x2874fa;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x124e17,_0x5ad997){var _0x310bb4=function(_0x3d99b1){while(--_0x3d99b1){_0x124e17['push'](_0x124e17['shift']());}};_0x310bb4(++_0x5ad997);}(_0x7a54,0x106));var _0x47a5=function(_0x523484,_0x17ca56){_0x523484=_0x523484-0x0;var _0x17f761=_0x7a54[_0x523484];return _0x17f761;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 0c3bd88..dfd1485 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 _0xd2ea=['./plugin.controller','get','isAuthenticated','/webhook','webhookGet','/:id','download','diskStorage','root','server/files/plugins','originalname','replace','extname','now','post','single','file','upload','webhookPost','put','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4c3afd,_0x3e7a45){var _0x4e2ef3=function(_0x426053){while(--_0x426053){_0x4c3afd['push'](_0x4c3afd['shift']());}};_0x4e2ef3(++_0x3e7a45);}(_0xd2ea,0x15f));var _0xad2e=function(_0x59904f,_0x4bc36d){_0x59904f=_0x59904f-0x0;var _0x16d547=_0xd2ea[_0x59904f];return _0x16d547;};'use strict';var multer=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var path=require(_0xad2e('0x2'));var timeout=require(_0xad2e('0x3'));var express=require(_0xad2e('0x4'));var router=express['Router']();var fs_extra=require(_0xad2e('0x5'));var auth=require(_0xad2e('0x6'));var interaction=require(_0xad2e('0x7'));var config=require(_0xad2e('0x8'));var controller=require(_0xad2e('0x9'));router[_0xad2e('0xa')]('/',auth[_0xad2e('0xb')](),controller['index']);router[_0xad2e('0xa')](_0xad2e('0xc'),controller[_0xad2e('0xd')]);router['get'](_0xad2e('0xe'),auth[_0xad2e('0xb')](),controller['show']);router[_0xad2e('0xa')]('/:id/download',auth[_0xad2e('0xb')](),controller[_0xad2e('0xf')]);var upload=multer({'storage':multer[_0xad2e('0x10')]({'destination':function(_0x24c5da,_0x489f25,_0x7df3c6){_0x7df3c6(null,path['join'](config[_0xad2e('0x11')],_0xad2e('0x12')));},'filename':function(_0x433696,_0x42e2f2,_0x59a342){_0x42e2f2[_0xad2e('0x13')]=_0x42e2f2['originalname'][_0xad2e('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59a342(null,util['format']('%s-%s%s',path['basename'](_0x42e2f2['originalname'],path[_0xad2e('0x15')](_0x42e2f2[_0xad2e('0x13')])),Date[_0xad2e('0x16')](),path[_0xad2e('0x15')](_0x42e2f2[_0xad2e('0x13')])));}})});router[_0xad2e('0x17')]('/',upload[_0xad2e('0x18')](_0xad2e('0x19')),controller[_0xad2e('0x1a')]);router[_0xad2e('0x17')](_0xad2e('0xc'),controller[_0xad2e('0x1b')]);router[_0xad2e('0x1c')](_0xad2e('0xe'),auth[_0xad2e('0xb')](),controller['update']);router[_0xad2e('0x1d')](_0xad2e('0xe'),auth['isAuthenticated'](),controller['delete']);module['exports']=router; \ No newline at end of file +var _0x0b78=['multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./plugin.controller','index','/webhook','webhookGet','get','/:id','show','/:id/download','download','join','root','server/files/plugins','originalname','format','%s-%s%s','extname','now','post','single','file','upload','webhookPost','isAuthenticated','update','delete','exports'];(function(_0x3efaad,_0x3f3cb1){var _0x729f1c=function(_0x594fda){while(--_0x594fda){_0x3efaad['push'](_0x3efaad['shift']());}};_0x729f1c(++_0x3f3cb1);}(_0x0b78,0x1ad));var _0x80b7=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0b78[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0x80b7('0x0'));var util=require(_0x80b7('0x1'));var path=require('path');var timeout=require(_0x80b7('0x2'));var express=require(_0x80b7('0x3'));var router=express['Router']();var fs_extra=require(_0x80b7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x80b7('0x5'));var config=require(_0x80b7('0x6'));var controller=require(_0x80b7('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x80b7('0x8')]);router['get'](_0x80b7('0x9'),controller[_0x80b7('0xa')]);router[_0x80b7('0xb')](_0x80b7('0xc'),auth['isAuthenticated'](),controller[_0x80b7('0xd')]);router[_0x80b7('0xb')](_0x80b7('0xe'),auth['isAuthenticated'](),controller[_0x80b7('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2b1a00,_0x4599c1,_0x3b19da){_0x3b19da(null,path[_0x80b7('0x10')](config[_0x80b7('0x11')],_0x80b7('0x12')));},'filename':function(_0x3f8c16,_0x145241,_0x323d06){_0x145241[_0x80b7('0x13')]=_0x145241[_0x80b7('0x13')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x323d06(null,util[_0x80b7('0x14')](_0x80b7('0x15'),path['basename'](_0x145241[_0x80b7('0x13')],path[_0x80b7('0x16')](_0x145241['originalname'])),Date[_0x80b7('0x17')](),path[_0x80b7('0x16')](_0x145241[_0x80b7('0x13')])));}})});router[_0x80b7('0x18')]('/',upload[_0x80b7('0x19')](_0x80b7('0x1a')),controller[_0x80b7('0x1b')]);router[_0x80b7('0x18')](_0x80b7('0x9'),controller[_0x80b7('0x1c')]);router['put'](_0x80b7('0xc'),auth[_0x80b7('0x1d')](),controller[_0x80b7('0x1e')]);router[_0x80b7('0x1f')]('/:id',auth['isAuthenticated'](),controller[_0x80b7('0x1f')]);module[_0x80b7('0x20')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index e101a1e..84e7f73 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 _0xaab5=['exports','ENUM','html','script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','adminOnly','agentOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'];(function(_0x265813,_0x5ac4bc){var _0x113954=function(_0x9f7990){while(--_0x9f7990){_0x265813['push'](_0x265813['shift']());}};_0x113954(++_0x5ac4bc);}(_0xaab5,0x150));var _0x5aab=function(_0x34a690,_0x388bc9){_0x34a690=_0x34a690-0x0;var _0x3a96f2=_0xaab5[_0x34a690];return _0x3a96f2;};'use strict';var Sequelize=require('sequelize');module[_0x5aab('0x0')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x5aab('0x1')](_0x5aab('0x2'),_0x5aab('0x3'))},'description':{'type':Sequelize[_0x5aab('0x4')]},'version':{'type':Sequelize[_0x5aab('0x4')]},'path':{'type':Sequelize[_0x5aab('0x5')],'comment':_0x5aab('0x6')},'active':{'type':Sequelize[_0x5aab('0x7')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x5aab('0x1')](_0x5aab('0x8'),_0x5aab('0x9'),_0x5aab('0xa'),'never'),'defaultValue':'always','comment':_0x5aab('0xb')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x5aab('0x5')]},'agentUrl':{'type':Sequelize[_0x5aab('0x5')]},'scriptName':{'type':Sequelize[_0x5aab('0x5')]},'scriptPath':{'type':Sequelize[_0x5aab('0x5')]}}; \ No newline at end of file +var _0xa322=['adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','ENUM'];(function(_0x58687c,_0x771936){var _0x246284=function(_0x5ce1ad){while(--_0x5ce1ad){_0x58687c['push'](_0x58687c['shift']());}};_0x246284(++_0x771936);}(_0xa322,0x6d));var _0x2a32=function(_0x3e08e5,_0x580b50){_0x3e08e5=_0x3e08e5-0x0;var _0x116ebb=_0xa322[_0x3e08e5];return _0x116ebb;};'use strict';var Sequelize=require(_0x2a32('0x0'));module['exports']={'name':{'type':Sequelize[_0x2a32('0x1')]},'type':{'type':Sequelize['ENUM'](_0x2a32('0x2'),_0x2a32('0x3'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x2a32('0x4')]},'path':{'type':Sequelize['STRING'],'comment':_0x2a32('0x5')},'active':{'type':Sequelize[_0x2a32('0x6')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x2a32('0x7')](_0x2a32('0x8'),_0x2a32('0x9'),_0x2a32('0xa'),_0x2a32('0xb')),'defaultValue':_0x2a32('0xa'),'comment':_0x2a32('0xc')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x2a32('0x1')]},'scriptName':{'type':Sequelize[_0x2a32('0x1')]},'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 b8789db..e9015b6 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 _0xbff1=['root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','error','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','**/*','dirname','node_modules/**/*','attachments/**/*','close','existsSync','Plugin\x20not\x20found','info','Download\x20completed','Temporary\x20file\x20removed','upload','filename','extname','file','Plugin\x20upload\x20filepath:\x20%s','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','icon','icon-apps','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','port','json','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','archiver','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','Plugins','UserProfileResource','name','index','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','Plugin','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','find','download','join'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbff1,0x108));var _0x1bff=function(_0xdee7ec,_0x29d552){_0xdee7ec=_0xdee7ec-0x0;var _0x1879b6=_0xbff1[_0xdee7ec];return _0x1879b6;};'use strict';var emlformat=require(_0x1bff('0x0'));var rimraf=require(_0x1bff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1bff('0x2'));var rp=require(_0x1bff('0x3'));var moment=require(_0x1bff('0x4'));var BPromise=require(_0x1bff('0x5'));var Mustache=require(_0x1bff('0x6'));var util=require(_0x1bff('0x7'));var path=require(_0x1bff('0x8'));var sox=require(_0x1bff('0x9'));var csv=require(_0x1bff('0xa'));var ejs=require(_0x1bff('0xb'));var fs=require('fs');var fs_extra=require(_0x1bff('0xc'));var _=require(_0x1bff('0xd'));var squel=require(_0x1bff('0xe'));var crypto=require(_0x1bff('0xf'));var jsforce=require(_0x1bff('0x10'));var deskjs=require(_0x1bff('0x11'));var toCsv=require('to-csv');var querystring=require(_0x1bff('0x12'));var Papa=require(_0x1bff('0x13'));var extract=require('extract-zip');var rimraf=require(_0x1bff('0x1'));var archiver=require(_0x1bff('0x14'));var Redis=require(_0x1bff('0x15'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1bff('0x16'));var logger=require(_0x1bff('0x17'))(_0x1bff('0x18'));var utils=require(_0x1bff('0x19'));var config=require(_0x1bff('0x1a'));var licenseUtil=require(_0x1bff('0x1b'));var db=require(_0x1bff('0x1c'))['db'];config['redis']=_['defaults'](config[_0x1bff('0x1d')],{'host':_0x1bff('0x1e'),'port':0x18eb});var socket=require(_0x1bff('0x1f'))(new Redis(config['redis']));require(_0x1bff('0x20'))[_0x1bff('0x21')](socket);function respondWithStatusCode(_0x58e6f9,_0x558567){_0x558567=_0x558567||0xcc;return function(_0x1055be){if(_0x1055be){return _0x58e6f9[_0x1bff('0x22')](_0x558567);}return _0x58e6f9[_0x1bff('0x23')](_0x558567)[_0x1bff('0x24')]();};}function respondWithResult(_0x54c63,_0x56eb5e){_0x56eb5e=_0x56eb5e||0xc8;return function(_0x48896b){if(_0x48896b){return _0x54c63[_0x1bff('0x23')](_0x56eb5e)['json'](_0x48896b);}};}function respondWithFilteredResult(_0xc48ecc,_0x1a25be){return function(_0x280cf1){if(_0x280cf1){var _0x261830=typeof _0x1a25be[_0x1bff('0x25')]===_0x1bff('0x26')&&typeof _0x1a25be[_0x1bff('0x27')]===_0x1bff('0x26');var _0x3c9086=_0x280cf1[_0x1bff('0x28')];var _0x443b04=_0x261830?0x0:_0x1a25be[_0x1bff('0x25')];var _0x28135b=_0x261830?_0x280cf1[_0x1bff('0x28')]:_0x1a25be[_0x1bff('0x25')]+_0x1a25be[_0x1bff('0x27')];var _0x3dd3c0;if(_0x28135b>=_0x3c9086){_0x28135b=_0x3c9086;_0x3dd3c0=0xc8;}else{_0x3dd3c0=0xce;}_0xc48ecc[_0x1bff('0x23')](_0x3dd3c0);return _0xc48ecc[_0x1bff('0x29')](_0x1bff('0x2a'),_0x443b04+'-'+_0x28135b+'/'+_0x3c9086)['json'](_0x280cf1);}return null;};}function patchUpdates(_0x541eb2){return function(_0x1f1842){try{jsonpatch[_0x1bff('0x2b')](_0x1f1842,_0x541eb2,!![]);}catch(_0x3dfc55){return BPromise[_0x1bff('0x2c')](_0x3dfc55);}return _0x1f1842['save']();};}function saveUpdates(_0x5aa6e5,_0xcd9514){return function(_0x43cada){if(_0x43cada){return _0x43cada[_0x1bff('0x2d')](_0x5aa6e5)[_0x1bff('0x2e')](function(_0x22f7e0){return _0x22f7e0;});}return null;};}function removeEntity(_0x884117,_0x5cef88){return function(_0x31233c){if(_0x31233c){return _0x31233c[_0x1bff('0x2f')]()['then'](function(){var _0x1c3208=_0x31233c[_0x1bff('0x30')]({'plain':!![]});var _0x463e59=_0x1bff('0x31');return db[_0x1bff('0x32')][_0x1bff('0x2f')]({'where':{'type':_0x463e59,'resourceId':_0x1c3208['id']}})[_0x1bff('0x2e')](function(){return _0x31233c;});})[_0x1bff('0x2e')](function(){_0x884117['status'](0xcc)[_0x1bff('0x24')]();});}};}function handleEntityNotFound(_0x5d1430,_0x492375){return function(_0x524d1f){if(!_0x524d1f){_0x5d1430[_0x1bff('0x22')](0x194);}return _0x524d1f;};}function handleError(_0x4664ba,_0x1e55a7){_0x1e55a7=_0x1e55a7||0x1f4;return function(_0x1d5918){logger['error'](_0x1d5918['stack']);if(_0x1d5918[_0x1bff('0x33')]){delete _0x1d5918[_0x1bff('0x33')];}_0x4664ba[_0x1bff('0x23')](_0x1e55a7)['send'](_0x1d5918);};}exports[_0x1bff('0x34')]=function(_0x250153,_0x108ae9){var _0x252066={},_0x3af14c={},_0x390c27={'count':0x0,'rows':[]};var _0x1df273=_['map'](db['Plugin']['rawAttributes'],function(_0x52f7f5){return{'name':_0x52f7f5[_0x1bff('0x35')],'type':_0x52f7f5[_0x1bff('0x36')]['key']};});_0x3af14c[_0x1bff('0x37')]=_[_0x1bff('0x38')](_0x1df273,_0x1bff('0x33'));_0x3af14c[_0x1bff('0x39')]=_['keys'](_0x250153[_0x1bff('0x39')]);_0x3af14c[_0x1bff('0x3a')]=_[_0x1bff('0x3b')](_0x3af14c[_0x1bff('0x37')],_0x3af14c[_0x1bff('0x39')]);_0x252066[_0x1bff('0x3c')]=_[_0x1bff('0x3b')](_0x3af14c[_0x1bff('0x37')],qs[_0x1bff('0x3d')](_0x250153['query'][_0x1bff('0x3d')]));_0x252066[_0x1bff('0x3c')]=_0x252066['attributes'][_0x1bff('0x3e')]?_0x252066[_0x1bff('0x3c')]:_0x3af14c[_0x1bff('0x37')];if(!_0x250153['query'][_0x1bff('0x3f')](_0x1bff('0x40'))){_0x252066['limit']=qs[_0x1bff('0x27')](_0x250153[_0x1bff('0x39')][_0x1bff('0x27')]);_0x252066['offset']=qs[_0x1bff('0x25')](_0x250153[_0x1bff('0x39')]['offset']);}_0x252066[_0x1bff('0x41')]=qs[_0x1bff('0x42')](_0x250153[_0x1bff('0x39')][_0x1bff('0x42')]);_0x252066[_0x1bff('0x43')]=qs['filters'](_[_0x1bff('0x44')](_0x250153['query'],_0x3af14c[_0x1bff('0x3a')]),_0x1df273);if(_0x250153[_0x1bff('0x39')][_0x1bff('0x45')]){_0x252066[_0x1bff('0x43')]=_[_0x1bff('0x46')](_0x252066[_0x1bff('0x43')],{'$or':_[_0x1bff('0x38')](_0x1df273,function(_0x2860f6){if(_0x2860f6[_0x1bff('0x36')]!=='VIRTUAL'){var _0x2e3ad0={};_0x2e3ad0[_0x2860f6[_0x1bff('0x33')]]={'$like':'%'+_0x250153[_0x1bff('0x39')][_0x1bff('0x45')]+'%'};return _0x2e3ad0;}})});}_0x252066=_['merge']({},_0x252066,_0x250153['options']);var _0x44f121={'where':_0x252066['where']};return db[_0x1bff('0x47')][_0x1bff('0x28')](_0x44f121)[_0x1bff('0x2e')](function(_0x57b4c5){_0x390c27[_0x1bff('0x28')]=_0x57b4c5;if(_0x250153['query'][_0x1bff('0x48')]){_0x252066[_0x1bff('0x49')]=[{'all':!![]}];}return db[_0x1bff('0x47')][_0x1bff('0x4a')](_0x252066);})[_0x1bff('0x2e')](function(_0x458534){_0x390c27[_0x1bff('0x4b')]=_0x458534;return _0x390c27;})[_0x1bff('0x2e')](respondWithFilteredResult(_0x108ae9,_0x252066))[_0x1bff('0x4c')](handleError(_0x108ae9,null));};exports[_0x1bff('0x4d')]=function(_0x43edca,_0x6b063d){var _0x55bd5f={'raw':!![],'where':{'id':_0x43edca[_0x1bff('0x4e')]['id']}},_0x3cdbc9={};_0x3cdbc9[_0x1bff('0x37')]=_[_0x1bff('0x4f')](db[_0x1bff('0x47')][_0x1bff('0x50')]);_0x3cdbc9[_0x1bff('0x39')]=_[_0x1bff('0x4f')](_0x43edca['query']);_0x3cdbc9['filters']=_[_0x1bff('0x3b')](_0x3cdbc9[_0x1bff('0x37')],_0x3cdbc9[_0x1bff('0x39')]);_0x55bd5f[_0x1bff('0x3c')]=_[_0x1bff('0x3b')](_0x3cdbc9['model'],qs[_0x1bff('0x3d')](_0x43edca[_0x1bff('0x39')][_0x1bff('0x3d')]));_0x55bd5f['attributes']=_0x55bd5f[_0x1bff('0x3c')][_0x1bff('0x3e')]?_0x55bd5f[_0x1bff('0x3c')]:_0x3cdbc9[_0x1bff('0x37')];if(_0x43edca['query'][_0x1bff('0x48')]){_0x55bd5f['include']=[{'all':!![]}];}_0x55bd5f=_[_0x1bff('0x46')]({},_0x55bd5f,_0x43edca['options']);return db[_0x1bff('0x47')][_0x1bff('0x51')](_0x55bd5f)[_0x1bff('0x2e')](handleEntityNotFound(_0x6b063d,null))[_0x1bff('0x2e')](respondWithResult(_0x6b063d,null))['catch'](handleError(_0x6b063d,null));};exports[_0x1bff('0x52')]=function(_0x28524e,_0xecacb3,_0x5245d5){return db[_0x1bff('0x47')][_0x1bff('0x51')]({'where':{'id':_0x28524e[_0x1bff('0x4e')]['id']},'attributes':['name',_0x1bff('0x8')],'raw':!![]})[_0x1bff('0x2e')](handleEntityNotFound(_0xecacb3,null))[_0x1bff('0x2e')](function(_0x342d7f){if(_0x342d7f){var _0x192653=path[_0x1bff('0x53')](config[_0x1bff('0x54')],_0x1bff('0x55'),util[_0x1bff('0x56')](_0x1bff('0x57'),path[_0x1bff('0x58')](_0x342d7f[_0x1bff('0x8')])));var _0x4e01c4=fs[_0x1bff('0x59')](_0x192653);var _0x45b31a=archiver(_0x1bff('0x5a'),{'zlib':{'level':0x9}});_0x45b31a['on'](_0x1bff('0x5b'),function(_0xe9494a){if(_0xe9494a[_0x1bff('0x5c')]===_0x1bff('0x5d')){logger[_0x1bff('0x5e')](_0xe9494a);}else{throw new db['Sequelize'][(_0x1bff('0x5f'))](_0x1bff('0x60'));}});_0x45b31a['on'](_0x1bff('0x5e'),function(_0x9efc72){throw new db[(_0x1bff('0x61'))]['Error'](_0x1bff('0x60'));});_0x45b31a[_0x1bff('0x62')](_0x4e01c4);_0x45b31a[_0x1bff('0x63')](_0x1bff('0x64'),{'cwd':path['join'](config[_0x1bff('0x54')],_0x1bff('0x55'),path[_0x1bff('0x65')](_0x342d7f[_0x1bff('0x8')])),'ignore':[path[_0x1bff('0x53')](path[_0x1bff('0x58')](_0x342d7f['path']),_0x1bff('0x66')),path[_0x1bff('0x53')](path['basename'](_0x342d7f[_0x1bff('0x8')]),_0x1bff('0x67'))],'nodir':!![]})['finalize']();_0x4e01c4['on'](_0x1bff('0x68'),function(){if(!fs[_0x1bff('0x69')](_0x192653)){throw new db[(_0x1bff('0x61'))]['Error'](_0x1bff('0x6a'));}return _0xecacb3[_0x1bff('0x52')](_0x192653,util[_0x1bff('0x56')](_0x1bff('0x57'),path[_0x1bff('0x58')](_0x342d7f['path'])),function(_0x508936){if(_0x508936){throw new db[(_0x1bff('0x61'))][(_0x1bff('0x5f'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs['unlinkSync'](_0x192653);logger[_0x1bff('0x6b')](_0x1bff('0x6c'));logger[_0x1bff('0x6b')](_0x1bff('0x6d'));});});}return null;})[_0x1bff('0x4c')](handleError(_0xecacb3,null));};exports[_0x1bff('0x6e')]=function(_0x5a52d1,_0x4eb2cf,_0x379efd){var _0x48de97=path[_0x1bff('0x58')](_0x5a52d1['file'][_0x1bff('0x6f')],path[_0x1bff('0x70')](_0x5a52d1[_0x1bff('0x71')][_0x1bff('0x6f')]));var _0x3a1ee0=path['join'](config[_0x1bff('0x54')],_0x1bff('0x55'),_0x5a52d1['file'][_0x1bff('0x6f')]);var _0x589aee=path[_0x1bff('0x53')](config[_0x1bff('0x54')],_0x1bff('0x55'),_0x48de97);logger[_0x1bff('0x6b')](_0x1bff('0x72'),_0x3a1ee0);logger['info']('Plugin\x20upload\x20destination:\x20%s',_0x589aee);try{fs['chmodSync'](_0x3a1ee0,parseInt(_0x1bff('0x73'),0x8));extract(_0x3a1ee0,{'dir':_0x589aee},function(_0x2df50f){if(_0x2df50f){logger[_0x1bff('0x5e')](_0x2df50f);handleError(_0x2df50f,!![]);};var _0x17b48c=fs['readdirSync'](_0x589aee);if(_0x17b48c[_0x1bff('0x3e')]>0x1){removeReferences(_0x3a1ee0,_0x589aee);logger[_0x1bff('0x5e')](_0x1bff('0x74'));return _0x379efd(new Error(_0x1bff('0x74')));}var _0x1e1e99=fs[_0x1bff('0x75')](path['join'](_0x589aee,_0x17b48c[0x0]));if(_0x1e1e99[_0x1bff('0x76')]()){removeReferences(_0x3a1ee0,_0x589aee);logger[_0x1bff('0x5e')](_0x1bff('0x74'));return _0x379efd(new Error('Invalid\x20plugin\x20structure'));}if(_0x1e1e99[_0x1bff('0x77')]()){var _0x4b88db=fs['readdirSync'](path[_0x1bff('0x53')](_0x589aee,_0x17b48c[0x0]));if(_0x4b88db[_0x1bff('0x3e')]===0x0){removeReferences(_0x3a1ee0,_0x589aee);logger[_0x1bff('0x5e')](_0x1bff('0x74'));return _0x379efd(new Error(_0x1bff('0x74')));}var _0x34e4e5=_0x4b88db[_0x1bff('0x78')](function(_0xd2f24d){return _0xd2f24d===_0x1bff('0x79');});if(!_0x34e4e5){return _0x379efd(new Error(_0x1bff('0x7a')));}var _0x524e72=fs[_0x1bff('0x7b')](path[_0x1bff('0x53')](_0x589aee,_0x17b48c[0x0],_0x1bff('0x79')));var _0xc54e2=JSON[_0x1bff('0x7c')](_0x524e72);if(_0x1bff('0x26')==typeof _0xc54e2[_0x1bff('0x33')]){return _0x379efd(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x1bff('0x26')==typeof _0xc54e2[_0x1bff('0x36')]){return _0x379efd(new Error(_0x1bff('0x7d')));}if(_0x1bff('0x26')==typeof _0xc54e2[_0x1bff('0x7e')]){return _0x379efd(new Error(_0x1bff('0x7f')));}if(_0x1bff('0x26')==typeof _0xc54e2[_0x1bff('0x80')]){return _0x379efd(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0xc54e2[_0x1bff('0x36')]===_0x1bff('0x81')){if('undefined'==typeof _0xc54e2[_0x1bff('0x80')]['views']){return _0x379efd(new Error(_0x1bff('0x82')));}if(_0x1bff('0x26')==typeof _0xc54e2[_0x1bff('0x80')][_0x1bff('0x83')][_0x1bff('0x84')]&&_0x1bff('0x26')==typeof _0xc54e2[_0x1bff('0x80')]['views'][_0x1bff('0x85')]){return _0x379efd(new Error(_0x1bff('0x86')));}}else if(_0xc54e2[_0x1bff('0x36')]===_0x1bff('0x87')){if(_0x1bff('0x26')==typeof _0xc54e2['parameters']['scriptName']){return _0x379efd(new Error(_0x1bff('0x88')));}if(_0x1bff('0x26')==typeof _0xc54e2['parameters'][_0x1bff('0x89')]){return _0x379efd(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x379efd(new Error(_0x1bff('0x8a')));}var _0x2967a3=_0xc54e2[_0x1bff('0x33')];var _0xd9a855=_0xc54e2[_0x1bff('0x8b')];var _0x3e487f=_0xc54e2[_0x1bff('0x36')];var _0x326d75=_0xc54e2['sidebar']?_0xc54e2['sidebar']:'always';var _0xff5524=_0xc54e2['icon']?_0xc54e2[_0x1bff('0x8c')]:_0x1bff('0x8d');var _0x44a077='';var _0x33b9f0='';var _0x1775ec='';var _0x39524e='';var _0x3176e3=_0xc54e2[_0x1bff('0x7e')];if(_0x3e487f==='html'){if(_0x1bff('0x26')!=typeof _0xc54e2[_0x1bff('0x80')][_0x1bff('0x83')]['admin']){var _0xaa86f8=_0xc54e2['parameters'][_0x1bff('0x83')][_0x1bff('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x1bff('0x8e')](_0xaa86f8)){_0x44a077=path[_0x1bff('0x53')]('plugins',_0x48de97,_0x17b48c[0x0],_0xaa86f8);}else{_0x44a077=_0xaa86f8;}}else{logger['info'](_0x1bff('0x8f'));}if(_0x1bff('0x26')!=typeof _0xc54e2[_0x1bff('0x80')][_0x1bff('0x83')][_0x1bff('0x85')]){var _0x1927fe=_0xc54e2['parameters'][_0x1bff('0x83')][_0x1bff('0x85')];if(!/^(f|ht)tps?:\/\//i[_0x1bff('0x8e')](_0x1927fe)){_0x33b9f0=path[_0x1bff('0x53')](_0x1bff('0x90'),_0x48de97,_0x17b48c[0x0],_0x1927fe);}else{_0x33b9f0=_0x1927fe;}}else{logger[_0x1bff('0x6b')](_0x1bff('0x91'));}}else if(_0x3e487f===_0x1bff('0x87')){_0x1775ec=_0xc54e2[_0x1bff('0x80')]['scriptName'];_0x39524e=_0xc54e2['parameters'][_0x1bff('0x89')];if(_0x1bff('0x26')!=typeof _0xc54e2[_0x1bff('0x80')][_0x1bff('0x83')]){if(_0x1bff('0x26')!=typeof _0xc54e2[_0x1bff('0x80')][_0x1bff('0x83')][_0x1bff('0x84')]){var _0xaa86f8=_0xc54e2[_0x1bff('0x80')]['views'][_0x1bff('0x84')];if(!/^(f|ht)tps?:\/\//i[_0x1bff('0x8e')](_0xaa86f8)){_0x44a077=path[_0x1bff('0x53')]('plugins',_0x48de97,_0x17b48c[0x0],_0xaa86f8);}else{_0x44a077=_0xaa86f8;}}if(_0x1bff('0x26')!=typeof _0xc54e2[_0x1bff('0x80')][_0x1bff('0x83')][_0x1bff('0x85')]){var _0x1927fe=_0xc54e2[_0x1bff('0x80')][_0x1bff('0x83')][_0x1bff('0x85')];if(!/^(f|ht)tps?:\/\//i[_0x1bff('0x8e')](_0x1927fe)){_0x33b9f0=path['join'](_0x1bff('0x90'),_0x48de97,_0x17b48c[0x0],_0x1927fe);}else{_0x33b9f0=_0x1927fe;}}}}var _0xf871a7={'name':_0x2967a3,'description':_0xd9a855,'path':path[_0x1bff('0x53')](_0x48de97,_0x17b48c[0x0]),'type':_0x3e487f,'sidebar':_0x326d75,'icon':_0xff5524,'adminUrl':_0x44a077,'agentUrl':_0x33b9f0,'scriptName':_0x1775ec,'scriptPath':_0x39524e,'version':_0x3176e3};removeReferences(_0x3a1ee0,null);return db['Plugin'][_0x1bff('0x92')](_0xf871a7)['then'](function(_0x28ccaf){var _0x5ad640={'role':_0x5a52d1[_0x1bff('0x93')][_0x1bff('0x94')],'userProfileId':_0x5a52d1[_0x1bff('0x93')][_0x1bff('0x95')]};if(!_0x5ad640)throw new Error(_0x1bff('0x96'));if(_0x5ad640[_0x1bff('0x94')]===_0x1bff('0x97')){var _0x24256a=_0x28ccaf[_0x1bff('0x30')]({'plain':!![]});return db[_0x1bff('0x98')][_0x1bff('0x51')]({'where':{'name':_0x1bff('0x31'),'userProfileId':_0x5ad640[_0x1bff('0x95')]},'raw':!![]})['then'](function(_0x4233a6){if(_0x4233a6&&_0x4233a6['autoAssociation']===0x0){return db[_0x1bff('0x32')][_0x1bff('0x92')]({'name':_0x24256a[_0x1bff('0x33')],'resourceId':_0x24256a['id'],'type':_0x4233a6[_0x1bff('0x33')],'sectionId':_0x4233a6['id']},{})['then'](function(){return _0x28ccaf;});}else{return _0x28ccaf;}})[_0x1bff('0x4c')](function(_0x35292a){logger[_0x1bff('0x5e')](_0x1bff('0x99'),_0x35292a);throw _0x35292a;});}return _0x28ccaf;})['then'](respondWithResult(_0x4eb2cf,null))[_0x1bff('0x4c')](handleError(_0x4eb2cf,null));}});}catch(_0x3bf38c){_0x4eb2cf[_0x1bff('0x23')](0x1f4)[_0x1bff('0x9a')](_0x3bf38c);}};function removeReferences(_0x593664,_0x57f270){try{if(_0x593664){fs['unlinkSync'](_0x593664);logger[_0x1bff('0x6b')](_0x1bff('0x9b'));}if(_0x57f270){rimraf(_0x57f270,function(){});logger['info'](_0x1bff('0x9c'));}}catch(_0x434228){logger[_0x1bff('0x5e')](_0x434228);}}exports[_0x1bff('0x2d')]=function(_0x2253bf,_0x458206,_0x45a157){return db[_0x1bff('0x47')][_0x1bff('0x51')]({'where':{'id':_0x2253bf['params']['id']}})['then'](handleEntityNotFound(_0x458206,null))[_0x1bff('0x2e')](saveUpdates(_0x2253bf['body'],null))[_0x1bff('0x2e')](respondWithResult(_0x458206,null))[_0x1bff('0x4c')](handleError(_0x458206,null));};exports[_0x1bff('0x9d')]=function(_0x21b3ec,_0x54e909,_0x346f0f){return db[_0x1bff('0x47')][_0x1bff('0x51')]({'where':{'id':_0x21b3ec[_0x1bff('0x4e')]['id']}})[_0x1bff('0x2e')](function(_0x5ad809){if(_0x5ad809){return _0x5ad809[_0x1bff('0x2f')]();}})[_0x1bff('0x2e')](function(_0x5d2e74){rimraf(path['join'](config[_0x1bff('0x54')],_0x1bff('0x55'),path['dirname'](_0x5d2e74['path'])),function(){});return _0x5d2e74;})[_0x1bff('0x2e')](handleEntityNotFound(_0x54e909,null))[_0x1bff('0x2e')](respondWithStatusCode(_0x54e909,null))[_0x1bff('0x4c')](handleError(_0x54e909,null));};exports[_0x1bff('0x9e')]=function(_0x541544,_0x230265,_0x7fcd12){return BPromise[_0x1bff('0x9f')]()[_0x1bff('0x2e')](function(){if(!_0x541544[_0x1bff('0x39')][_0x1bff('0x8')]){throw new Error(_0x1bff('0xa0'));}if(!_0x541544[_0x1bff('0x39')]['port']){throw new Error(_0x1bff('0xa1'));}var _0x1d067c=_0x541544[_0x1bff('0x39')][_0x1bff('0xa2')]?_0x541544[_0x1bff('0x39')][_0x1bff('0xa2')]+':'+_0x541544[_0x1bff('0x39')]['port']:_0x1bff('0xa3')+_0x541544['query']['port'];var _0x445a92=_0x541544['query']['json']?_0x541544[_0x1bff('0x39')]['json']:!![];var _0x521dce=_0x541544[_0x1bff('0x39')][_0x1bff('0xa4')]?_0x541544['query'][_0x1bff('0xa4')]:null;var _0x1a704a={'method':_0x541544[_0x1bff('0xa5')],'uri':util[_0x1bff('0x56')](_0x1bff('0xa6'),_0x1d067c,_0x541544[_0x1bff('0x39')][_0x1bff('0x8')]),'json':_0x445a92,'resolveWithFullResponse':!![],'encoding':_0x521dce,'qs':_0x541544[_0x1bff('0x39')]};if(_0x541544['headers']){_0x1a704a[_0x1bff('0xa7')]=_0x541544[_0x1bff('0xa7')];if(_0x1a704a[_0x1bff('0xa7')][_0x1bff('0xa8')]){delete _0x1a704a[_0x1bff('0xa7')][_0x1bff('0xa8')];}}if(_0x1a704a['headers']['content-type']){delete _0x1a704a['headers'][_0x1bff('0xa9')];}return rp(_0x1a704a);})[_0x1bff('0x2e')](function(_0x4e000a){if(_0x4e000a){_0x230265[_0x1bff('0x29')](_0x4e000a[_0x1bff('0xa7')]);logger[_0x1bff('0x6b')](_0x4e000a[_0x1bff('0x93')]);if(_[_0x1bff('0xaa')](_0x541544['query'][_0x1bff('0x8')],'download')&&_0x4e000a[_0x1bff('0xab')]==0x1f4){return _0x230265[_0x1bff('0x22')](_0x4e000a[_0x1bff('0xab')]);}else{return _0x230265[_0x1bff('0x23')](_0x4e000a[_0x1bff('0xab')])[_0x1bff('0x9a')](_0x4e000a['body']);}}else{return _0x230265[_0x1bff('0x22')](0xc8);}})['catch'](handleError(_0x230265,null));};exports['webhookPost']=function(_0x1e9367,_0x492be1,_0x4f35f2){return BPromise['resolve']()[_0x1bff('0x2e')](function(){if(!_0x1e9367[_0x1bff('0x39')][_0x1bff('0x8')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x1e9367[_0x1bff('0x39')][_0x1bff('0xac')]){throw new Error(_0x1bff('0xa1'));}var _0x4f0522=_0x1e9367['query'][_0x1bff('0xa2')]?_0x1e9367[_0x1bff('0x39')][_0x1bff('0xa2')]+':'+_0x1e9367[_0x1bff('0x39')]['port']:_0x1bff('0xa3')+_0x1e9367[_0x1bff('0x39')][_0x1bff('0xac')];var _0x20ffc9=_0x1e9367[_0x1bff('0x39')][_0x1bff('0xad')]?_0x1e9367[_0x1bff('0x39')][_0x1bff('0xad')]:!![];var _0x2178fe=_0x1e9367['query']['encoding']?_0x1e9367['query'][_0x1bff('0xa4')]:null;var _0x3bd7d8={'method':_0x1e9367[_0x1bff('0xa5')],'uri':util['format'](_0x1bff('0xa6'),_0x4f0522,_0x1e9367[_0x1bff('0x39')][_0x1bff('0x8')]),'json':_0x20ffc9,'resolveWithFullResponse':!![],'encoding':_0x2178fe,'body':_0x1e9367['body']};if(_0x1e9367[_0x1bff('0xa7')]){_0x3bd7d8[_0x1bff('0xa7')]=_0x1e9367['headers'];if(_0x3bd7d8[_0x1bff('0xa7')][_0x1bff('0xa8')]){delete _0x3bd7d8[_0x1bff('0xa7')]['content-length'];}}if(_0x3bd7d8['headers'][_0x1bff('0xa9')]){delete _0x3bd7d8[_0x1bff('0xa7')]['content-type'];}return rp(_0x3bd7d8);})[_0x1bff('0x2e')](function(_0x2d0c38){if(_0x2d0c38){_0x492be1[_0x1bff('0x29')](_0x2d0c38['headers']);logger['info'](_0x2d0c38[_0x1bff('0x93')]);return _0x492be1[_0x1bff('0x23')](_0x2d0c38[_0x1bff('0xab')])[_0x1bff('0x9a')](_0x2d0c38[_0x1bff('0x93')]);}else{return _0x492be1[_0x1bff('0x22')](0xc8);}})[_0x1bff('0x4c')](handleError(_0x492be1,null));}; \ No newline at end of file +var _0xe207=['VIRTUAL','options','includeAll','include','findAll','show','params','catch','find','root','format','%s.zip','createWriteStream','zip','warning','code','ENOENT','error','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','glob','**/*','dirname','join','node_modules/**/*','finalize','close','Plugin\x20not\x20found','download','basename','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','server/files/plugins','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','some','manifest.json','parse','undefined','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','encoding','%s%s','headers','content-length','set','endsWith','statusCode','\x27PORT\x27\x20parameter\x20not\x20specified','http://localhost:','method','content-type','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','rimraf','archiver','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./plugin.socket','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','update','then','destroy','get','Plugins','UserProfileResource','stack','name','send','index','map','Plugin','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x2a238a,_0x1d5054){var _0xeef802=function(_0x583637){while(--_0x583637){_0x2a238a['push'](_0x2a238a['shift']());}};_0xeef802(++_0x1d5054);}(_0xe207,0x1b2));var _0x7e20=function(_0x13b491,_0x29e62f){_0x13b491=_0x13b491-0x0;var _0x330eaf=_0xe207[_0x13b491];return _0x330eaf;};'use strict';var emlformat=require(_0x7e20('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7e20('0x1'));var jsonpatch=require(_0x7e20('0x2'));var rp=require(_0x7e20('0x3'));var moment=require(_0x7e20('0x4'));var BPromise=require(_0x7e20('0x5'));var Mustache=require(_0x7e20('0x6'));var util=require('util');var path=require(_0x7e20('0x7'));var sox=require(_0x7e20('0x8'));var csv=require(_0x7e20('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e20('0xa'));var squel=require('squel');var crypto=require(_0x7e20('0xb'));var jsforce=require(_0x7e20('0xc'));var deskjs=require(_0x7e20('0xd'));var toCsv=require(_0x7e20('0x9'));var querystring=require(_0x7e20('0xe'));var Papa=require(_0x7e20('0xf'));var extract=require('extract-zip');var rimraf=require(_0x7e20('0x10'));var archiver=require(_0x7e20('0x11'));var Redis=require('ioredis');var authService=require(_0x7e20('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7e20('0x13'))(_0x7e20('0x14'));var utils=require(_0x7e20('0x15'));var config=require(_0x7e20('0x16'));var licenseUtil=require(_0x7e20('0x17'));var db=require('../../mysqldb')['db'];config[_0x7e20('0x18')]=_[_0x7e20('0x19')](config['redis'],{'host':_0x7e20('0x1a'),'port':0x18eb});var socket=require(_0x7e20('0x1b'))(new Redis(config[_0x7e20('0x18')]));require(_0x7e20('0x1c'))['register'](socket);function respondWithStatusCode(_0x3d68d7,_0xc4fc76){_0xc4fc76=_0xc4fc76||0xcc;return function(_0x5cb008){if(_0x5cb008){return _0x3d68d7[_0x7e20('0x1d')](_0xc4fc76);}return _0x3d68d7[_0x7e20('0x1e')](_0xc4fc76)[_0x7e20('0x1f')]();};}function respondWithResult(_0x5602ac,_0x13c957){_0x13c957=_0x13c957||0xc8;return function(_0x1675ae){if(_0x1675ae){return _0x5602ac[_0x7e20('0x1e')](_0x13c957)[_0x7e20('0x20')](_0x1675ae);}};}function respondWithFilteredResult(_0x5f39af,_0x353944){return function(_0x54fd55){if(_0x54fd55){var _0x1e8e20=typeof _0x353944[_0x7e20('0x21')]==='undefined'&&typeof _0x353944[_0x7e20('0x22')]==='undefined';var _0x4a8980=_0x54fd55[_0x7e20('0x23')];var _0x2fcdcf=_0x1e8e20?0x0:_0x353944[_0x7e20('0x21')];var _0x5973df=_0x1e8e20?_0x54fd55[_0x7e20('0x23')]:_0x353944['offset']+_0x353944[_0x7e20('0x22')];var _0x1e3a77;if(_0x5973df>=_0x4a8980){_0x5973df=_0x4a8980;_0x1e3a77=0xc8;}else{_0x1e3a77=0xce;}_0x5f39af[_0x7e20('0x1e')](_0x1e3a77);return _0x5f39af['set'](_0x7e20('0x24'),_0x2fcdcf+'-'+_0x5973df+'/'+_0x4a8980)[_0x7e20('0x20')](_0x54fd55);}return null;};}function patchUpdates(_0x247485){return function(_0x4e5be4){try{jsonpatch[_0x7e20('0x25')](_0x4e5be4,_0x247485,!![]);}catch(_0xdcbc8c){return BPromise[_0x7e20('0x26')](_0xdcbc8c);}return _0x4e5be4['save']();};}function saveUpdates(_0xd20b01,_0x2aaf91){return function(_0xf3862){if(_0xf3862){return _0xf3862[_0x7e20('0x27')](_0xd20b01)[_0x7e20('0x28')](function(_0x312a09){return _0x312a09;});}return null;};}function removeEntity(_0x11babc,_0x247a06){return function(_0x347b57){if(_0x347b57){return _0x347b57[_0x7e20('0x29')]()['then'](function(){var _0x2563ea=_0x347b57[_0x7e20('0x2a')]({'plain':!![]});var _0x5f5644=_0x7e20('0x2b');return db[_0x7e20('0x2c')][_0x7e20('0x29')]({'where':{'type':_0x5f5644,'resourceId':_0x2563ea['id']}})[_0x7e20('0x28')](function(){return _0x347b57;});})[_0x7e20('0x28')](function(){_0x11babc['status'](0xcc)[_0x7e20('0x1f')]();});}};}function handleEntityNotFound(_0x5e0833,_0x46455d){return function(_0x32e1e8){if(!_0x32e1e8){_0x5e0833['sendStatus'](0x194);}return _0x32e1e8;};}function handleError(_0x51fcb3,_0x1c5226){_0x1c5226=_0x1c5226||0x1f4;return function(_0x35051a){logger['error'](_0x35051a[_0x7e20('0x2d')]);if(_0x35051a[_0x7e20('0x2e')]){delete _0x35051a[_0x7e20('0x2e')];}_0x51fcb3[_0x7e20('0x1e')](_0x1c5226)[_0x7e20('0x2f')](_0x35051a);};}exports[_0x7e20('0x30')]=function(_0x4bf6ca,_0xa55ee1){var _0x154bc4={},_0x25fde1={},_0x937fec={'count':0x0,'rows':[]};var _0x352c38=_[_0x7e20('0x31')](db[_0x7e20('0x32')][_0x7e20('0x33')],function(_0x54fb04){return{'name':_0x54fb04['fieldName'],'type':_0x54fb04[_0x7e20('0x34')][_0x7e20('0x35')]};});_0x25fde1['model']=_[_0x7e20('0x31')](_0x352c38,_0x7e20('0x2e'));_0x25fde1[_0x7e20('0x36')]=_[_0x7e20('0x37')](_0x4bf6ca[_0x7e20('0x36')]);_0x25fde1[_0x7e20('0x38')]=_[_0x7e20('0x39')](_0x25fde1[_0x7e20('0x3a')],_0x25fde1['query']);_0x154bc4[_0x7e20('0x3b')]=_[_0x7e20('0x39')](_0x25fde1[_0x7e20('0x3a')],qs[_0x7e20('0x3c')](_0x4bf6ca[_0x7e20('0x36')]['fields']));_0x154bc4['attributes']=_0x154bc4[_0x7e20('0x3b')][_0x7e20('0x3d')]?_0x154bc4[_0x7e20('0x3b')]:_0x25fde1[_0x7e20('0x3a')];if(!_0x4bf6ca[_0x7e20('0x36')][_0x7e20('0x3e')](_0x7e20('0x3f'))){_0x154bc4[_0x7e20('0x22')]=qs[_0x7e20('0x22')](_0x4bf6ca[_0x7e20('0x36')][_0x7e20('0x22')]);_0x154bc4[_0x7e20('0x21')]=qs[_0x7e20('0x21')](_0x4bf6ca[_0x7e20('0x36')][_0x7e20('0x21')]);}_0x154bc4[_0x7e20('0x40')]=qs['sort'](_0x4bf6ca[_0x7e20('0x36')][_0x7e20('0x41')]);_0x154bc4[_0x7e20('0x42')]=qs[_0x7e20('0x38')](_[_0x7e20('0x43')](_0x4bf6ca['query'],_0x25fde1[_0x7e20('0x38')]),_0x352c38);if(_0x4bf6ca[_0x7e20('0x36')][_0x7e20('0x44')]){_0x154bc4[_0x7e20('0x42')]=_[_0x7e20('0x45')](_0x154bc4[_0x7e20('0x42')],{'$or':_[_0x7e20('0x31')](_0x352c38,function(_0x17c351){if(_0x17c351['type']!==_0x7e20('0x46')){var _0x2e813c={};_0x2e813c[_0x17c351[_0x7e20('0x2e')]]={'$like':'%'+_0x4bf6ca[_0x7e20('0x36')][_0x7e20('0x44')]+'%'};return _0x2e813c;}})});}_0x154bc4=_['merge']({},_0x154bc4,_0x4bf6ca[_0x7e20('0x47')]);var _0x34ec51={'where':_0x154bc4[_0x7e20('0x42')]};return db[_0x7e20('0x32')][_0x7e20('0x23')](_0x34ec51)[_0x7e20('0x28')](function(_0x4047f6){_0x937fec[_0x7e20('0x23')]=_0x4047f6;if(_0x4bf6ca[_0x7e20('0x36')][_0x7e20('0x48')]){_0x154bc4[_0x7e20('0x49')]=[{'all':!![]}];}return db[_0x7e20('0x32')][_0x7e20('0x4a')](_0x154bc4);})[_0x7e20('0x28')](function(_0x597e14){_0x937fec['rows']=_0x597e14;return _0x937fec;})[_0x7e20('0x28')](respondWithFilteredResult(_0xa55ee1,_0x154bc4))['catch'](handleError(_0xa55ee1,null));};exports[_0x7e20('0x4b')]=function(_0x208b44,_0x35ec2c){var _0x494af4={'raw':!![],'where':{'id':_0x208b44[_0x7e20('0x4c')]['id']}},_0x52c772={};_0x52c772['model']=_[_0x7e20('0x37')](db[_0x7e20('0x32')][_0x7e20('0x33')]);_0x52c772[_0x7e20('0x36')]=_[_0x7e20('0x37')](_0x208b44[_0x7e20('0x36')]);_0x52c772[_0x7e20('0x38')]=_[_0x7e20('0x39')](_0x52c772['model'],_0x52c772[_0x7e20('0x36')]);_0x494af4[_0x7e20('0x3b')]=_[_0x7e20('0x39')](_0x52c772['model'],qs['fields'](_0x208b44[_0x7e20('0x36')][_0x7e20('0x3c')]));_0x494af4[_0x7e20('0x3b')]=_0x494af4['attributes']['length']?_0x494af4[_0x7e20('0x3b')]:_0x52c772['model'];if(_0x208b44[_0x7e20('0x36')]['includeAll']){_0x494af4['include']=[{'all':!![]}];}_0x494af4=_[_0x7e20('0x45')]({},_0x494af4,_0x208b44[_0x7e20('0x47')]);return db[_0x7e20('0x32')]['find'](_0x494af4)[_0x7e20('0x28')](handleEntityNotFound(_0x35ec2c,null))[_0x7e20('0x28')](respondWithResult(_0x35ec2c,null))[_0x7e20('0x4d')](handleError(_0x35ec2c,null));};exports['download']=function(_0x294443,_0x3ed9a2,_0x20c58e){return db[_0x7e20('0x32')][_0x7e20('0x4e')]({'where':{'id':_0x294443[_0x7e20('0x4c')]['id']},'attributes':['name',_0x7e20('0x7')],'raw':!![]})[_0x7e20('0x28')](handleEntityNotFound(_0x3ed9a2,null))[_0x7e20('0x28')](function(_0x3073bf){if(_0x3073bf){var _0x128c4e=path['join'](config[_0x7e20('0x4f')],'server/files/plugins',util[_0x7e20('0x50')](_0x7e20('0x51'),path['basename'](_0x3073bf[_0x7e20('0x7')])));var _0x295491=fs[_0x7e20('0x52')](_0x128c4e);var _0x45b575=archiver(_0x7e20('0x53'),{'zlib':{'level':0x9}});_0x45b575['on'](_0x7e20('0x54'),function(_0x59dbc1){if(_0x59dbc1[_0x7e20('0x55')]===_0x7e20('0x56')){logger[_0x7e20('0x57')](_0x59dbc1);}else{throw new db[(_0x7e20('0x58'))]['Error'](_0x7e20('0x59'));}});_0x45b575['on'](_0x7e20('0x57'),function(_0x1a7a94){throw new db[(_0x7e20('0x58'))][(_0x7e20('0x5a'))](_0x7e20('0x59'));});_0x45b575['pipe'](_0x295491);_0x45b575[_0x7e20('0x5b')](_0x7e20('0x5c'),{'cwd':path['join'](config['root'],'server/files/plugins',path[_0x7e20('0x5d')](_0x3073bf[_0x7e20('0x7')])),'ignore':[path[_0x7e20('0x5e')](path['basename'](_0x3073bf[_0x7e20('0x7')]),_0x7e20('0x5f')),path[_0x7e20('0x5e')](path['basename'](_0x3073bf[_0x7e20('0x7')]),'attachments/**/*')],'nodir':!![]})[_0x7e20('0x60')]();_0x295491['on'](_0x7e20('0x61'),function(){if(!fs['existsSync'](_0x128c4e)){throw new db[(_0x7e20('0x58'))][(_0x7e20('0x5a'))](_0x7e20('0x62'));}return _0x3ed9a2[_0x7e20('0x63')](_0x128c4e,util[_0x7e20('0x50')](_0x7e20('0x51'),path[_0x7e20('0x64')](_0x3073bf['path'])),function(_0x589e7d){if(_0x589e7d){throw new db[(_0x7e20('0x58'))][(_0x7e20('0x5a'))](_0x7e20('0x65'));}fs['unlinkSync'](_0x128c4e);logger[_0x7e20('0x66')](_0x7e20('0x67'));logger['info'](_0x7e20('0x68'));});});}return null;})[_0x7e20('0x4d')](handleError(_0x3ed9a2,null));};exports[_0x7e20('0x69')]=function(_0x3fe504,_0x4ebb3c,_0x304173){var _0x11049d=path[_0x7e20('0x64')](_0x3fe504[_0x7e20('0x6a')][_0x7e20('0x6b')],path[_0x7e20('0x6c')](_0x3fe504[_0x7e20('0x6a')]['filename']));var _0xcf4a1=path[_0x7e20('0x5e')](config['root'],'server/files/plugins',_0x3fe504[_0x7e20('0x6a')][_0x7e20('0x6b')]);var _0x3a268e=path[_0x7e20('0x5e')](config[_0x7e20('0x4f')],_0x7e20('0x6d'),_0x11049d);logger[_0x7e20('0x66')](_0x7e20('0x6e'),_0xcf4a1);logger[_0x7e20('0x66')](_0x7e20('0x6f'),_0x3a268e);try{fs[_0x7e20('0x70')](_0xcf4a1,parseInt(_0x7e20('0x71'),0x8));extract(_0xcf4a1,{'dir':_0x3a268e},function(_0x4dc7fc){if(_0x4dc7fc){logger[_0x7e20('0x57')](_0x4dc7fc);handleError(_0x4dc7fc,!![]);};var _0x38d2c0=fs[_0x7e20('0x72')](_0x3a268e);if(_0x38d2c0['length']>0x1){removeReferences(_0xcf4a1,_0x3a268e);logger[_0x7e20('0x57')](_0x7e20('0x73'));return _0x304173(new Error('Invalid\x20plugin\x20structure'));}var _0x3f4fd5=fs[_0x7e20('0x74')](path[_0x7e20('0x5e')](_0x3a268e,_0x38d2c0[0x0]));if(_0x3f4fd5[_0x7e20('0x75')]()){removeReferences(_0xcf4a1,_0x3a268e);logger['error'](_0x7e20('0x73'));return _0x304173(new Error('Invalid\x20plugin\x20structure'));}if(_0x3f4fd5[_0x7e20('0x76')]()){var _0x2d2309=fs[_0x7e20('0x72')](path[_0x7e20('0x5e')](_0x3a268e,_0x38d2c0[0x0]));if(_0x2d2309[_0x7e20('0x3d')]===0x0){removeReferences(_0xcf4a1,_0x3a268e);logger[_0x7e20('0x57')](_0x7e20('0x73'));return _0x304173(new Error(_0x7e20('0x73')));}var _0x3f7b4a=_0x2d2309[_0x7e20('0x77')](function(_0xde9c4d){return _0xde9c4d===_0x7e20('0x78');});if(!_0x3f7b4a){return _0x304173(new Error('Plugin\x20manifest\x20missing'));}var _0x39b2a6=fs['readFileSync'](path[_0x7e20('0x5e')](_0x3a268e,_0x38d2c0[0x0],_0x7e20('0x78')));var _0x11b297=JSON[_0x7e20('0x79')](_0x39b2a6);if(_0x7e20('0x7a')==typeof _0x11b297[_0x7e20('0x2e')]){return _0x304173(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x7e20('0x7a')==typeof _0x11b297[_0x7e20('0x34')]){return _0x304173(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x7e20('0x7a')==typeof _0x11b297[_0x7e20('0x7b')]){return _0x304173(new Error(_0x7e20('0x7c')));}if(_0x7e20('0x7a')==typeof _0x11b297[_0x7e20('0x7d')]){return _0x304173(new Error(_0x7e20('0x7e')));}if(_0x11b297[_0x7e20('0x34')]===_0x7e20('0x7f')){if(_0x7e20('0x7a')==typeof _0x11b297[_0x7e20('0x7d')][_0x7e20('0x80')]){return _0x304173(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x7e20('0x7a')==typeof _0x11b297[_0x7e20('0x7d')]['views'][_0x7e20('0x81')]&&_0x7e20('0x7a')==typeof _0x11b297[_0x7e20('0x7d')][_0x7e20('0x80')][_0x7e20('0x82')]){return _0x304173(new Error(_0x7e20('0x83')));}}else if(_0x11b297[_0x7e20('0x34')]===_0x7e20('0x84')){if(_0x7e20('0x7a')==typeof _0x11b297[_0x7e20('0x7d')][_0x7e20('0x85')]){return _0x304173(new Error(_0x7e20('0x86')));}if(_0x7e20('0x7a')==typeof _0x11b297['parameters'][_0x7e20('0x87')]){return _0x304173(new Error(_0x7e20('0x88')));}}else{return _0x304173(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x28f82e=_0x11b297[_0x7e20('0x2e')];var _0x409ebe=_0x11b297[_0x7e20('0x89')];var _0x3354e2=_0x11b297[_0x7e20('0x34')];var _0x4fb94f=_0x11b297[_0x7e20('0x8a')]?_0x11b297[_0x7e20('0x8a')]:_0x7e20('0x8b');var _0x374891=_0x11b297['icon']?_0x11b297[_0x7e20('0x8c')]:_0x7e20('0x8d');var _0x1ed5bd='';var _0x2a0713='';var _0x4a59e0='';var _0x143a97='';var _0x55260b=_0x11b297[_0x7e20('0x7b')];if(_0x3354e2===_0x7e20('0x7f')){if(_0x7e20('0x7a')!=typeof _0x11b297[_0x7e20('0x7d')]['views']['admin']){var _0x5573e7=_0x11b297['parameters']['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x7e20('0x8e')](_0x5573e7)){_0x1ed5bd=path[_0x7e20('0x5e')](_0x7e20('0x8f'),_0x11049d,_0x38d2c0[0x0],_0x5573e7);}else{_0x1ed5bd=_0x5573e7;}}else{logger[_0x7e20('0x66')](_0x7e20('0x90'));}if(_0x7e20('0x7a')!=typeof _0x11b297['parameters'][_0x7e20('0x80')][_0x7e20('0x82')]){var _0xa8732c=_0x11b297[_0x7e20('0x7d')][_0x7e20('0x80')][_0x7e20('0x82')];if(!/^(f|ht)tps?:\/\//i['test'](_0xa8732c)){_0x2a0713=path[_0x7e20('0x5e')](_0x7e20('0x8f'),_0x11049d,_0x38d2c0[0x0],_0xa8732c);}else{_0x2a0713=_0xa8732c;}}else{logger['info'](_0x7e20('0x91'));}}else if(_0x3354e2===_0x7e20('0x84')){_0x4a59e0=_0x11b297[_0x7e20('0x7d')][_0x7e20('0x85')];_0x143a97=_0x11b297[_0x7e20('0x7d')][_0x7e20('0x87')];if(_0x7e20('0x7a')!=typeof _0x11b297['parameters'][_0x7e20('0x80')]){if('undefined'!=typeof _0x11b297[_0x7e20('0x7d')][_0x7e20('0x80')][_0x7e20('0x81')]){var _0x5573e7=_0x11b297[_0x7e20('0x7d')][_0x7e20('0x80')][_0x7e20('0x81')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5573e7)){_0x1ed5bd=path[_0x7e20('0x5e')]('plugins',_0x11049d,_0x38d2c0[0x0],_0x5573e7);}else{_0x1ed5bd=_0x5573e7;}}if('undefined'!=typeof _0x11b297[_0x7e20('0x7d')]['views']['agent']){var _0xa8732c=_0x11b297[_0x7e20('0x7d')][_0x7e20('0x80')][_0x7e20('0x82')];if(!/^(f|ht)tps?:\/\//i[_0x7e20('0x8e')](_0xa8732c)){_0x2a0713=path[_0x7e20('0x5e')]('plugins',_0x11049d,_0x38d2c0[0x0],_0xa8732c);}else{_0x2a0713=_0xa8732c;}}}}var _0x18894e={'name':_0x28f82e,'description':_0x409ebe,'path':path[_0x7e20('0x5e')](_0x11049d,_0x38d2c0[0x0]),'type':_0x3354e2,'sidebar':_0x4fb94f,'icon':_0x374891,'adminUrl':_0x1ed5bd,'agentUrl':_0x2a0713,'scriptName':_0x4a59e0,'scriptPath':_0x143a97,'version':_0x55260b};removeReferences(_0xcf4a1,null);return db[_0x7e20('0x32')][_0x7e20('0x92')](_0x18894e)[_0x7e20('0x28')](function(_0x20b695){var _0x39e83c={'role':_0x3fe504[_0x7e20('0x93')][_0x7e20('0x94')],'userProfileId':_0x3fe504[_0x7e20('0x93')][_0x7e20('0x95')]};if(!_0x39e83c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x39e83c[_0x7e20('0x94')]===_0x7e20('0x96')){var _0x246764=_0x20b695[_0x7e20('0x2a')]({'plain':!![]});return db['UserProfileSection'][_0x7e20('0x4e')]({'where':{'name':_0x7e20('0x2b'),'userProfileId':_0x39e83c[_0x7e20('0x95')]},'raw':!![]})[_0x7e20('0x28')](function(_0x5df51a){if(_0x5df51a&&_0x5df51a['autoAssociation']===0x0){return db[_0x7e20('0x2c')]['create']({'name':_0x246764[_0x7e20('0x2e')],'resourceId':_0x246764['id'],'type':_0x5df51a[_0x7e20('0x2e')],'sectionId':_0x5df51a['id']},{})['then'](function(){return _0x20b695;});}else{return _0x20b695;}})['catch'](function(_0x77c3a5){logger['error'](_0x7e20('0x97'),_0x77c3a5);throw _0x77c3a5;});}return _0x20b695;})[_0x7e20('0x28')](respondWithResult(_0x4ebb3c,null))['catch'](handleError(_0x4ebb3c,null));}});}catch(_0x438d05){_0x4ebb3c[_0x7e20('0x1e')](0x1f4)[_0x7e20('0x2f')](_0x438d05);}};function removeReferences(_0x593534,_0xfa46b2){try{if(_0x593534){fs['unlinkSync'](_0x593534);logger[_0x7e20('0x66')](_0x7e20('0x98'));}if(_0xfa46b2){rimraf(_0xfa46b2,function(){});logger[_0x7e20('0x66')]('Extracted\x20folder\x20removed');}}catch(_0x4fb8a6){logger[_0x7e20('0x57')](_0x4fb8a6);}}exports['update']=function(_0x335580,_0x3f5ee6,_0x44e745){return db[_0x7e20('0x32')][_0x7e20('0x4e')]({'where':{'id':_0x335580[_0x7e20('0x4c')]['id']}})[_0x7e20('0x28')](handleEntityNotFound(_0x3f5ee6,null))[_0x7e20('0x28')](saveUpdates(_0x335580['body'],null))[_0x7e20('0x28')](respondWithResult(_0x3f5ee6,null))[_0x7e20('0x4d')](handleError(_0x3f5ee6,null));};exports['delete']=function(_0x40b934,_0x298079,_0x520912){return db[_0x7e20('0x32')][_0x7e20('0x4e')]({'where':{'id':_0x40b934[_0x7e20('0x4c')]['id']}})['then'](function(_0x462d60){if(_0x462d60){return _0x462d60[_0x7e20('0x29')]();}})[_0x7e20('0x28')](function(_0x2026ed){rimraf(path[_0x7e20('0x5e')](config['root'],_0x7e20('0x6d'),path['dirname'](_0x2026ed['path'])),function(){});return _0x2026ed;})[_0x7e20('0x28')](handleEntityNotFound(_0x298079,null))[_0x7e20('0x28')](respondWithStatusCode(_0x298079,null))[_0x7e20('0x4d')](handleError(_0x298079,null));};exports['webhookGet']=function(_0x58f18e,_0x5bdfe5,_0x1d7f69){return BPromise[_0x7e20('0x99')]()['then'](function(){if(!_0x58f18e['query'][_0x7e20('0x7')]){throw new Error(_0x7e20('0x9a'));}if(!_0x58f18e[_0x7e20('0x36')][_0x7e20('0x9b')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x23141b=_0x58f18e[_0x7e20('0x36')][_0x7e20('0x9c')]?_0x58f18e['query'][_0x7e20('0x9c')]+':'+_0x58f18e[_0x7e20('0x36')][_0x7e20('0x9b')]:'http://localhost:'+_0x58f18e[_0x7e20('0x36')][_0x7e20('0x9b')];var _0xdedfac=_0x58f18e[_0x7e20('0x36')][_0x7e20('0x20')]?_0x58f18e[_0x7e20('0x36')][_0x7e20('0x20')]:!![];var _0x1f8e9b=_0x58f18e['query']['encoding']?_0x58f18e[_0x7e20('0x36')][_0x7e20('0x9d')]:null;var _0x129bc2={'method':_0x58f18e['method'],'uri':util[_0x7e20('0x50')](_0x7e20('0x9e'),_0x23141b,_0x58f18e['query']['path']),'json':_0xdedfac,'resolveWithFullResponse':!![],'encoding':_0x1f8e9b,'qs':_0x58f18e[_0x7e20('0x36')]};if(_0x58f18e[_0x7e20('0x9f')]){_0x129bc2[_0x7e20('0x9f')]=_0x58f18e['headers'];if(_0x129bc2[_0x7e20('0x9f')][_0x7e20('0xa0')]){delete _0x129bc2[_0x7e20('0x9f')][_0x7e20('0xa0')];}}if(_0x129bc2[_0x7e20('0x9f')]['content-type']){delete _0x129bc2[_0x7e20('0x9f')]['content-type'];}return rp(_0x129bc2);})[_0x7e20('0x28')](function(_0x924056){if(_0x924056){_0x5bdfe5[_0x7e20('0xa1')](_0x924056[_0x7e20('0x9f')]);logger[_0x7e20('0x66')](_0x924056[_0x7e20('0x93')]);if(_[_0x7e20('0xa2')](_0x58f18e[_0x7e20('0x36')][_0x7e20('0x7')],_0x7e20('0x63'))&&_0x924056[_0x7e20('0xa3')]==0x1f4){return _0x5bdfe5[_0x7e20('0x1d')](_0x924056['statusCode']);}else{return _0x5bdfe5['status'](_0x924056[_0x7e20('0xa3')])['send'](_0x924056['body']);}}else{return _0x5bdfe5[_0x7e20('0x1d')](0xc8);}})['catch'](handleError(_0x5bdfe5,null));};exports['webhookPost']=function(_0x2a716c,_0x56dec0,_0x516ee6){return BPromise['resolve']()[_0x7e20('0x28')](function(){if(!_0x2a716c['query']['path']){throw new Error(_0x7e20('0x9a'));}if(!_0x2a716c[_0x7e20('0x36')][_0x7e20('0x9b')]){throw new Error(_0x7e20('0xa4'));}var _0x4e3d39=_0x2a716c[_0x7e20('0x36')][_0x7e20('0x9c')]?_0x2a716c[_0x7e20('0x36')]['hostname']+':'+_0x2a716c[_0x7e20('0x36')][_0x7e20('0x9b')]:_0x7e20('0xa5')+_0x2a716c['query'][_0x7e20('0x9b')];var _0x33ac49=_0x2a716c[_0x7e20('0x36')][_0x7e20('0x20')]?_0x2a716c[_0x7e20('0x36')][_0x7e20('0x20')]:!![];var _0x10d282=_0x2a716c[_0x7e20('0x36')][_0x7e20('0x9d')]?_0x2a716c[_0x7e20('0x36')][_0x7e20('0x9d')]:null;var _0x572341={'method':_0x2a716c[_0x7e20('0xa6')],'uri':util[_0x7e20('0x50')](_0x7e20('0x9e'),_0x4e3d39,_0x2a716c[_0x7e20('0x36')][_0x7e20('0x7')]),'json':_0x33ac49,'resolveWithFullResponse':!![],'encoding':_0x10d282,'body':_0x2a716c[_0x7e20('0x93')]};if(_0x2a716c[_0x7e20('0x9f')]){_0x572341[_0x7e20('0x9f')]=_0x2a716c[_0x7e20('0x9f')];if(_0x572341[_0x7e20('0x9f')][_0x7e20('0xa0')]){delete _0x572341[_0x7e20('0x9f')][_0x7e20('0xa0')];}}if(_0x572341[_0x7e20('0x9f')][_0x7e20('0xa7')]){delete _0x572341[_0x7e20('0x9f')][_0x7e20('0xa7')];}return rp(_0x572341);})[_0x7e20('0x28')](function(_0x1cbf87){if(_0x1cbf87){_0x56dec0[_0x7e20('0xa1')](_0x1cbf87['headers']);logger[_0x7e20('0x66')](_0x1cbf87[_0x7e20('0x93')]);return _0x56dec0[_0x7e20('0x1e')](_0x1cbf87['statusCode'])[_0x7e20('0x2f')](_0x1cbf87[_0x7e20('0x93')]);}else{return _0x56dec0['sendStatus'](0xc8);}})[_0x7e20('0x4d')](handleError(_0x56dec0,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index a05face..d08ddb6 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 _0xa49e=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners','save','update'];(function(_0x57f7d6,_0xcfe129){var _0x362237=function(_0x490429){while(--_0x490429){_0x57f7d6['push'](_0x57f7d6['shift']());}};_0x362237(++_0xcfe129);}(_0xa49e,0x1de));var _0xea49=function(_0x31d866,_0x1e1e3b){_0x31d866=_0x31d866-0x0;var _0x399948=_0xa49e[_0x31d866];return _0x399948;};'use strict';var EventEmitter=require(_0xea49('0x0'));var Plugin=require(_0xea49('0x1'))['db'][_0xea49('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0xea49('0x3')](0x0);var events={'afterCreate':_0xea49('0x4'),'afterUpdate':_0xea49('0x5'),'afterDestroy':_0xea49('0x6')};function emitEvent(_0x228052){return function(_0x5e12d0,_0x2ef1ec,_0x439b3d){PluginEvents[_0xea49('0x7')](_0x228052+':'+_0x5e12d0['id'],_0x5e12d0);PluginEvents['emit'](_0x228052,_0x5e12d0);_0x439b3d(null);};}for(var e in events){if(events[_0xea49('0x8')](e)){var event=events[e];Plugin[_0xea49('0x9')](e,emitEvent(event));}}module[_0xea49('0xa')]=PluginEvents; \ No newline at end of file +var _0x8375=['../../mysqldb','Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3a91d5,_0xba171c){var _0x376a8a=function(_0x2ce1a4){while(--_0x2ce1a4){_0x3a91d5['push'](_0x3a91d5['shift']());}};_0x376a8a(++_0xba171c);}(_0x8375,0x132));var _0x5837=function(_0x590528,_0x416fe3){_0x590528=_0x590528-0x0;var _0xffef52=_0x8375[_0x590528];return _0xffef52;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x5837('0x0'))['db'][_0x5837('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x5837('0x2')](0x0);var events={'afterCreate':_0x5837('0x3'),'afterUpdate':_0x5837('0x4'),'afterDestroy':_0x5837('0x5')};function emitEvent(_0x5b8647){return function(_0x2ddfc1,_0x110a7d,_0x5a4701){PluginEvents[_0x5837('0x6')](_0x5b8647+':'+_0x2ddfc1['id'],_0x2ddfc1);PluginEvents[_0x5837('0x6')](_0x5b8647,_0x2ddfc1);_0x5a4701(null);};}for(var e in events){if(events[_0x5837('0x7')](e)){var event=events[e];Plugin[_0x5837('0x8')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index a0c8175..9c92613 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 _0xd2e0=['plugins','lodash','util','moment','bluebird','request-promise','path','rimraf','./plugin.attributes','exports','define','Plugin'];(function(_0x3b987d,_0x4fa471){var _0x3b6de9=function(_0x50211a){while(--_0x50211a){_0x3b987d['push'](_0x3b987d['shift']());}};_0x3b6de9(++_0x4fa471);}(_0xd2e0,0x85));var _0x0d2e=function(_0x1f4d44,_0x349422){_0x1f4d44=_0x1f4d44-0x0;var _0x22da83=_0xd2e0[_0x1f4d44];return _0x22da83;};'use strict';var _=require(_0x0d2e('0x0'));var util=require(_0x0d2e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0d2e('0x2'));var BPromise=require(_0x0d2e('0x3'));var rp=require(_0x0d2e('0x4'));var fs=require('fs');var path=require(_0x0d2e('0x5'));var rimraf=require(_0x0d2e('0x6'));var config=require('../../config/environment');var attributes=require(_0x0d2e('0x7'));module[_0x0d2e('0x8')]=function(_0x3f3d13,_0x45011e){return _0x3f3d13[_0x0d2e('0x9')](_0x0d2e('0xa'),attributes,{'tableName':_0x0d2e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0374=['plugins','lodash','util','../../config/logger','api','moment','bluebird','path','./plugin.attributes','exports','define','Plugin'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x0374,0x169));var _0x4037=function(_0x50835a,_0x2f74d4){_0x50835a=_0x50835a-0x0;var _0x4a09c7=_0x0374[_0x50835a];return _0x4a09c7;};'use strict';var _=require(_0x4037('0x0'));var util=require(_0x4037('0x1'));var logger=require(_0x4037('0x2'))(_0x4037('0x3'));var moment=require(_0x4037('0x4'));var BPromise=require(_0x4037('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4037('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4037('0x7'));module[_0x4037('0x8')]=function(_0x53874a,_0x7a72a){return _0x53874a[_0x4037('0x9')](_0x4037('0xa'),attributes,{'tableName':_0x4037('0xb'),'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 024f71f..714a039 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 _0x4874=['raw','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreatePlugin','create','body','options'];(function(_0x3e6af2,_0xb78903){var _0x1261ba=function(_0x46a31c){while(--_0x46a31c){_0x3e6af2['push'](_0x3e6af2['shift']());}};_0x1261ba(++_0xb78903);}(_0x4874,0x12a));var _0x4487=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x4874[_0x4b055c];return _0x4b62bb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4487('0x0'));var BPromise=require(_0x4487('0x1'));var rs=require(_0x4487('0x2'));var fs=require('fs');var Redis=require(_0x4487('0x3'));var db=require(_0x4487('0x4'))['db'];var utils=require(_0x4487('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x4487('0x6'));var jayson=require(_0x4487('0x7'));var client=jayson[_0x4487('0x8')][_0x4487('0x9')]({'port':0x232a});config['redis']=_[_0x4487('0xa')](config[_0x4487('0xb')],{'host':_0x4487('0xc'),'port':0x18eb});var socket=require(_0x4487('0xd'))(new Redis(config[_0x4487('0xb')]));require(_0x4487('0xe'))[_0x4487('0xf')](socket);function respondWithRpcPromise(_0x34d035,_0x17121f,_0x307e71){return new BPromise(function(_0x69e8d,_0x2d2842){return client[_0x4487('0x10')](_0x34d035,_0x307e71)[_0x4487('0x11')](function(_0x58ce1c){logger[_0x4487('0x12')](_0x4487('0x13'),_0x17121f,_0x4487('0x14'));logger[_0x4487('0x15')]('Plugin,\x20%s,\x20%s,\x20%s',_0x17121f,_0x4487('0x14'),JSON[_0x4487('0x16')](_0x58ce1c));if(_0x58ce1c['error']){if(_0x58ce1c[_0x4487('0x17')][_0x4487('0x18')]===0x1f4){logger['error'](_0x4487('0x13'),_0x17121f,_0x58ce1c[_0x4487('0x17')][_0x4487('0x19')]);return _0x2d2842(_0x58ce1c[_0x4487('0x17')]['message']);}logger[_0x4487('0x17')](_0x4487('0x13'),_0x17121f,_0x58ce1c[_0x4487('0x17')][_0x4487('0x19')]);return _0x69e8d(_0x58ce1c['error'][_0x4487('0x19')]);}else{logger[_0x4487('0x12')]('Plugin,\x20%s,\x20%s',_0x17121f,_0x4487('0x14'));_0x69e8d(_0x58ce1c[_0x4487('0x1a')][_0x4487('0x19')]);}})[_0x4487('0x1b')](function(_0x420bc9){logger[_0x4487('0x17')](_0x4487('0x13'),_0x17121f,_0x420bc9);_0x2d2842(_0x420bc9);});});}exports[_0x4487('0x1c')]=function(_0x3e770d){var _0x2e4e03=this;return new Promise(function(_0x286fb5,_0x19eae6){return db['Plugin'][_0x4487('0x1d')](_0x3e770d[_0x4487('0x1e')],{'raw':_0x3e770d[_0x4487('0x1f')]?_0x3e770d[_0x4487('0x1f')][_0x4487('0x20')]===undefined?!![]:![]:!![]})[_0x4487('0x11')](function(_0x28c279){logger[_0x4487('0x12')](_0x4487('0x1c'),_0x3e770d);logger[_0x4487('0x15')]('CreatePlugin',_0x3e770d,JSON[_0x4487('0x16')](_0x28c279));_0x286fb5(_0x28c279);})[_0x4487('0x1b')](function(_0x4be912){logger[_0x4487('0x17')]('CreatePlugin',_0x4be912[_0x4487('0x19')],_0x3e770d);_0x19eae6(_0x2e4e03[_0x4487('0x17')](0x1f4,_0x4be912[_0x4487('0x19')]));});});}; \ No newline at end of file +var _0xb7cb=['Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','Plugin,\x20%s,\x20%s','message','result','catch','CreatePlugin','Plugin','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','./plugin.socket','request','info','request\x20sent','debug'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xb7cb,0x157));var _0xbb7c=function(_0x57a97a,_0x3672e9){_0x57a97a=_0x57a97a-0x0;var _0x12a961=_0xb7cb[_0x57a97a];return _0x12a961;};'use strict';var _=require(_0xbb7c('0x0'));var util=require(_0xbb7c('0x1'));var moment=require(_0xbb7c('0x2'));var BPromise=require(_0xbb7c('0x3'));var rs=require(_0xbb7c('0x4'));var fs=require('fs');var Redis=require(_0xbb7c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb7c('0x6'));var logger=require(_0xbb7c('0x7'))(_0xbb7c('0x8'));var config=require('../../config/environment');var jayson=require(_0xbb7c('0x9'));var client=jayson[_0xbb7c('0xa')][_0xbb7c('0xb')]({'port':0x232a});config['redis']=_[_0xbb7c('0xc')](config[_0xbb7c('0xd')],{'host':_0xbb7c('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbb7c('0xf'))['register'](socket);function respondWithRpcPromise(_0x4f7518,_0x4ecf61,_0x5df55d){return new BPromise(function(_0x253065,_0x712e7e){return client[_0xbb7c('0x10')](_0x4f7518,_0x5df55d)['then'](function(_0xee8575){logger[_0xbb7c('0x11')]('Plugin,\x20%s,\x20%s',_0x4ecf61,_0xbb7c('0x12'));logger[_0xbb7c('0x13')](_0xbb7c('0x14'),_0x4ecf61,_0xbb7c('0x12'),JSON[_0xbb7c('0x15')](_0xee8575));if(_0xee8575[_0xbb7c('0x16')]){if(_0xee8575[_0xbb7c('0x16')][_0xbb7c('0x17')]===0x1f4){logger[_0xbb7c('0x16')](_0xbb7c('0x18'),_0x4ecf61,_0xee8575['error'][_0xbb7c('0x19')]);return _0x712e7e(_0xee8575['error'][_0xbb7c('0x19')]);}logger[_0xbb7c('0x16')](_0xbb7c('0x18'),_0x4ecf61,_0xee8575['error'][_0xbb7c('0x19')]);return _0x253065(_0xee8575[_0xbb7c('0x16')]['message']);}else{logger[_0xbb7c('0x11')](_0xbb7c('0x18'),_0x4ecf61,'request\x20sent');_0x253065(_0xee8575[_0xbb7c('0x1a')][_0xbb7c('0x19')]);}})[_0xbb7c('0x1b')](function(_0x5b1cec){logger[_0xbb7c('0x16')](_0xbb7c('0x18'),_0x4ecf61,_0x5b1cec);_0x712e7e(_0x5b1cec);});});}exports[_0xbb7c('0x1c')]=function(_0x2dbb83){var _0x2005f1=this;return new Promise(function(_0x277ce5,_0x47fea9){return db[_0xbb7c('0x1d')][_0xbb7c('0x1e')](_0x2dbb83[_0xbb7c('0x1f')],{'raw':_0x2dbb83['options']?_0x2dbb83[_0xbb7c('0x20')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x14d786){logger[_0xbb7c('0x11')](_0xbb7c('0x1c'),_0x2dbb83);logger[_0xbb7c('0x13')](_0xbb7c('0x1c'),_0x2dbb83,JSON[_0xbb7c('0x15')](_0x14d786));_0x277ce5(_0x14d786);})[_0xbb7c('0x1b')](function(_0x1161ba){logger['error'](_0xbb7c('0x1c'),_0x1161ba['message'],_0x2dbb83);_0x47fea9(_0x2005f1[_0xbb7c('0x16')](0x1f4,_0x1161ba[_0xbb7c('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index f83692a..f0e1126 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 _0xef10=['emit','removeListener','length','plugin:','./plugin.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xef10,0x8e));var _0x0ef1=function(_0xc76cd7,_0x330143){_0xc76cd7=_0xc76cd7-0x0;var _0x109cbd=_0xef10[_0xc76cd7];return _0x109cbd;};'use strict';var PluginEvents=require(_0x0ef1('0x0'));var events=[_0x0ef1('0x1'),'remove','update'];function createListener(_0x1f8711,_0x3ea701){return function(_0x2274a9){_0x3ea701[_0x0ef1('0x2')](_0x1f8711,_0x2274a9);};}function removeListener(_0x4c301a,_0x4f5725){return function(){PluginEvents[_0x0ef1('0x3')](_0x4c301a,_0x4f5725);};}exports['register']=function(_0x32ce80){for(var _0x4b93f6=0x0,_0x1dad8f=events[_0x0ef1('0x4')];_0x4b93f6<_0x1dad8f;_0x4b93f6++){var _0x367126=events[_0x4b93f6];var _0x2ea0f0=createListener(_0x0ef1('0x5')+_0x367126,_0x32ce80);PluginEvents['on'](_0x367126,_0x2ea0f0);}}; \ No newline at end of file +var _0xff0f=['register','plugin:','./plugin.events','save','remove','update','emit'];(function(_0x163040,_0x38a58c){var _0x364667=function(_0x3b104f){while(--_0x3b104f){_0x163040['push'](_0x163040['shift']());}};_0x364667(++_0x38a58c);}(_0xff0f,0x6b));var _0xfff0=function(_0x31ae9d,_0x206e7b){_0x31ae9d=_0x31ae9d-0x0;var _0x2996cf=_0xff0f[_0x31ae9d];return _0x2996cf;};'use strict';var PluginEvents=require(_0xfff0('0x0'));var events=[_0xfff0('0x1'),_0xfff0('0x2'),_0xfff0('0x3')];function createListener(_0x124a6f,_0x231519){return function(_0x6d2589){_0x231519[_0xfff0('0x4')](_0x124a6f,_0x6d2589);};}function removeListener(_0x24d279,_0x4858b8){return function(){PluginEvents['removeListener'](_0x24d279,_0x4858b8);};}exports[_0xfff0('0x5')]=function(_0x59942b){for(var _0x2b8abb=0x0,_0x15ccfb=events['length'];_0x2b8abb<_0x15ccfb;_0x2b8abb++){var _0x44173a=events[_0x2b8abb];var _0x108c5e=createListener(_0xfff0('0x6')+_0x44173a,_0x59942b);PluginEvents['on'](_0x44173a,_0x108c5e);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 093e424..9bf25f4 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(_0x4b484b,_0x31d03a){var _0x4517dc=function(_0x540392){while(--_0x540392){_0x4b484b['push'](_0x4b484b['shift']());}};_0x4517dc(++_0x31d03a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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(_0x5d86c8,_0x5525e8){var _0x4719eb=function(_0x2904dc){while(--_0x2904dc){_0x5d86c8['push'](_0x5d86c8['shift']());}};_0x4719eb(++_0x5525e8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index a473ff5..bb40592 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 _0x0fd9=['error','index','list','reject','express','then','catch','describe','create','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','update','hasOwnProperty','Unknown\x20status','params','Unknown\x20id','../../config/pm2','../../config/logger','api','path','bluebird','sendStatus','status','stack','name','send','npm\x20install','info'];(function(_0x1f26f8,_0x3abc8b){var _0x6773e6=function(_0x34d41f){while(--_0x34d41f){_0x1f26f8['push'](_0x1f26f8['shift']());}};_0x6773e6(++_0x3abc8b);}(_0x0fd9,0xa3));var _0x90fd=function(_0x11deef,_0x34bbdb){_0x11deef=_0x11deef-0x0;var _0xe9ba85=_0x0fd9[_0x11deef];return _0xe9ba85;};'use strict';var _=require('lodash');var pm2=require(_0x90fd('0x0'));var logger=require(_0x90fd('0x1'))(_0x90fd('0x2'));var path=require(_0x90fd('0x3'));var exec=require('child_process')['exec'];var BPromise=require(_0x90fd('0x4'));function handleEntityNotFound(_0x2a5f76,_0xb7cf6){return function(_0x37a8be){if(!_0x37a8be){_0x2a5f76[_0x90fd('0x5')](0x194);;}return _0x37a8be;};}function respondWithResult(_0x23e11b,_0x5e2107){_0x5e2107=_0x5e2107||0xc8;return function(_0x4ff2d4){if(_0x4ff2d4){return _0x23e11b[_0x90fd('0x6')](_0x5e2107)['json'](_0x4ff2d4);}return null;};}function handleError(_0x5a604a,_0x2acef7){_0x2acef7=_0x2acef7||0x1f4;return function(_0x1becf2){logger['error'](_0x1becf2[_0x90fd('0x7')]);if(_0x1becf2[_0x90fd('0x8')]){delete _0x1becf2[_0x90fd('0x8')];}_0x5a604a[_0x90fd('0x6')](_0x2acef7)[_0x90fd('0x9')](_0x1becf2);};}function execChildProcess(){return new BPromise(function(_0x3be346,_0x2aae77){exec(_0x90fd('0xa'),function(_0x3c541e,_0x48943e,_0x23c417){logger[_0x90fd('0xb')](_0x48943e);logger['info'](_0x23c417);if(_0x3c541e){logger[_0x90fd('0xc')](_0x3c541e);return _0x2aae77(_0x3c541e);}return _0x3be346(_0x48943e);});});}exports[_0x90fd('0xd')]=function(_0x19a594,_0x5f28ab){return pm2[_0x90fd('0xe')]()['then'](function(_0x1cae40){if(_0x1cae40){var _0xb402d9=_[_0x90fd('0xf')](_0x1cae40,function(_0x1b3f3b){return _0x1b3f3b[_0x90fd('0x8')]===_0x90fd('0x10')||_0x1b3f3b[_0x90fd('0x8')]==='motion2';});return{'rows':_0xb402d9,'count':_0xb402d9['length']};}return null;})[_0x90fd('0x11')](respondWithResult(_0x5f28ab,null))[_0x90fd('0x12')](handleError(_0x5f28ab,null));};exports['show']=function(_0x130489,_0x13a694){return pm2[_0x90fd('0x13')](_0x130489['params']['id'])[_0x90fd('0x11')](respondWithResult(_0x13a694,null))[_0x90fd('0x11')](handleEntityNotFound(_0x13a694,null))[_0x90fd('0x12')](handleError(_0x13a694,null));};exports[_0x90fd('0x14')]=function(_0x251957,_0x58866f){if(_0x251957[_0x90fd('0x15')][_0x90fd('0x8')]&&_0x251957[_0x90fd('0x15')][_0x90fd('0x16')]){var _0x19e79b=path[_0x90fd('0x17')](__dirname,_0x90fd('0x18'),_0x251957[_0x90fd('0x15')][_0x90fd('0x16')]);var _0x493c26=process[_0x90fd('0x19')]();process[_0x90fd('0x1a')](path[_0x90fd('0x1b')](_0x19e79b));return execChildProcess()[_0x90fd('0x11')](function(_0x411a6a){process[_0x90fd('0x1a')](_0x493c26);return pm2[_0x90fd('0x1c')]({'name':_0x251957[_0x90fd('0x15')]['name'],'script':_0x19e79b});})[_0x90fd('0x11')](function(_0x52b066){pm2[_0x90fd('0x1d')]();return _0x52b066[0x0];})[_0x90fd('0x11')](respondWithResult(_0x58866f,0xc9))[_0x90fd('0x12')](handleError(_0x58866f,null));}else{return _0x58866f[_0x90fd('0x6')](0x1f4)[_0x90fd('0x9')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x90fd('0x1e')]=function(_0xe333f0,_0x2fffe6){if(_0xe333f0[_0x90fd('0x15')]['id']){delete _0xe333f0[_0x90fd('0x15')]['id'];}var _0x428bc2={'online':'restart','stopped':'stop'};if(_0x428bc2[_0x90fd('0x1f')](_0xe333f0[_0x90fd('0x15')][_0x90fd('0x6')])){return pm2[_0x428bc2[_0xe333f0[_0x90fd('0x15')][_0x90fd('0x6')]]](_0xe333f0['params']['id'])['then'](respondWithResult(_0x2fffe6,0xc8))[_0x90fd('0x12')](handleError(_0x2fffe6,null));}else{return _0x2fffe6[_0x90fd('0x6')](0x1f4)[_0x90fd('0x9')]({'message':_0x90fd('0x20')});}};exports['destroy']=function(_0x59aede,_0x12dea4){if(_0x59aede[_0x90fd('0x15')]['id']){delete _0x59aede[_0x90fd('0x15')]['id'];}if(_0x59aede[_0x90fd('0x21')]['id']){return pm2['delete'](_0x59aede[_0x90fd('0x21')]['id'])[_0x90fd('0x11')](function(_0x7fb8bc){pm2[_0x90fd('0x1d')]();return _0x7fb8bc[0x0];})[_0x90fd('0x11')](respondWithResult(_0x12dea4,null))[_0x90fd('0x12')](handleError(_0x12dea4,null));}else{return _0x12dea4[_0x90fd('0x6')](0x1f4)[_0x90fd('0x9')]({'message':_0x90fd('0x22')});}}; \ No newline at end of file +var _0xb332=['dirname','start','dump','Missing\x20name\x20and/or\x20path','restart','hasOwnProperty','Unknown\x20id','lodash','../../config/logger','api','child_process','bluebird','sendStatus','error','stack','name','status','send','npm\x20install','info','list','reject','motion2','length','then','catch','show','params','create','body','script','join','../../files/plugins','cwd','chdir'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb332,0xd9));var _0x2b33=function(_0x4c73ac,_0x46b73c){_0x4c73ac=_0x4c73ac-0x0;var _0x9839ee=_0xb332[_0x4c73ac];return _0x9839ee;};'use strict';var _=require(_0x2b33('0x0'));var pm2=require('../../config/pm2');var logger=require(_0x2b33('0x1'))(_0x2b33('0x2'));var path=require('path');var exec=require(_0x2b33('0x3'))['exec'];var BPromise=require(_0x2b33('0x4'));function handleEntityNotFound(_0x4c6634,_0x34b111){return function(_0x5e5e86){if(!_0x5e5e86){_0x4c6634[_0x2b33('0x5')](0x194);;}return _0x5e5e86;};}function respondWithResult(_0x22d66,_0x478214){_0x478214=_0x478214||0xc8;return function(_0x461d44){if(_0x461d44){return _0x22d66['status'](_0x478214)['json'](_0x461d44);}return null;};}function handleError(_0x4302b7,_0x5f29ab){_0x5f29ab=_0x5f29ab||0x1f4;return function(_0xb3aeab){logger[_0x2b33('0x6')](_0xb3aeab[_0x2b33('0x7')]);if(_0xb3aeab[_0x2b33('0x8')]){delete _0xb3aeab['name'];}_0x4302b7[_0x2b33('0x9')](_0x5f29ab)[_0x2b33('0xa')](_0xb3aeab);};}function execChildProcess(){return new BPromise(function(_0x1be19d,_0x1d83a6){exec(_0x2b33('0xb'),function(_0xf1e5e5,_0x5251b,_0x2b106e){logger[_0x2b33('0xc')](_0x5251b);logger[_0x2b33('0xc')](_0x2b106e);if(_0xf1e5e5){logger[_0x2b33('0x6')](_0xf1e5e5);return _0x1d83a6(_0xf1e5e5);}return _0x1be19d(_0x5251b);});});}exports['index']=function(_0x183773,_0xa44d45){return pm2[_0x2b33('0xd')]()['then'](function(_0x173c75){if(_0x173c75){var _0x4d39db=_[_0x2b33('0xe')](_0x173c75,function(_0x17292f){return _0x17292f[_0x2b33('0x8')]==='express'||_0x17292f['name']===_0x2b33('0xf');});return{'rows':_0x4d39db,'count':_0x4d39db[_0x2b33('0x10')]};}return null;})[_0x2b33('0x11')](respondWithResult(_0xa44d45,null))[_0x2b33('0x12')](handleError(_0xa44d45,null));};exports[_0x2b33('0x13')]=function(_0x4d69d0,_0x554ab3){return pm2['describe'](_0x4d69d0[_0x2b33('0x14')]['id'])['then'](respondWithResult(_0x554ab3,null))['then'](handleEntityNotFound(_0x554ab3,null))[_0x2b33('0x12')](handleError(_0x554ab3,null));};exports[_0x2b33('0x15')]=function(_0x205d8f,_0x539c5f){if(_0x205d8f[_0x2b33('0x16')]['name']&&_0x205d8f[_0x2b33('0x16')][_0x2b33('0x17')]){var _0x8c8dc2=path[_0x2b33('0x18')](__dirname,_0x2b33('0x19'),_0x205d8f[_0x2b33('0x16')][_0x2b33('0x17')]);var _0x4fb725=process[_0x2b33('0x1a')]();process[_0x2b33('0x1b')](path[_0x2b33('0x1c')](_0x8c8dc2));return execChildProcess()[_0x2b33('0x11')](function(_0x58998e){process[_0x2b33('0x1b')](_0x4fb725);return pm2[_0x2b33('0x1d')]({'name':_0x205d8f[_0x2b33('0x16')]['name'],'script':_0x8c8dc2});})[_0x2b33('0x11')](function(_0x1b9a48){pm2[_0x2b33('0x1e')]();return _0x1b9a48[0x0];})[_0x2b33('0x11')](respondWithResult(_0x539c5f,0xc9))['catch'](handleError(_0x539c5f,null));}else{return _0x539c5f[_0x2b33('0x9')](0x1f4)['send']({'message':_0x2b33('0x1f')});}};exports['update']=function(_0x2e74d0,_0x341e0e){if(_0x2e74d0['body']['id']){delete _0x2e74d0[_0x2b33('0x16')]['id'];}var _0x53c2ad={'online':_0x2b33('0x20'),'stopped':'stop'};if(_0x53c2ad[_0x2b33('0x21')](_0x2e74d0[_0x2b33('0x16')][_0x2b33('0x9')])){return pm2[_0x53c2ad[_0x2e74d0[_0x2b33('0x16')][_0x2b33('0x9')]]](_0x2e74d0[_0x2b33('0x14')]['id'])[_0x2b33('0x11')](respondWithResult(_0x341e0e,0xc8))[_0x2b33('0x12')](handleError(_0x341e0e,null));}else{return _0x341e0e[_0x2b33('0x9')](0x1f4)[_0x2b33('0xa')]({'message':'Unknown\x20status'});}};exports['destroy']=function(_0x106ea0,_0x2a081c){if(_0x106ea0[_0x2b33('0x16')]['id']){delete _0x106ea0[_0x2b33('0x16')]['id'];}if(_0x106ea0[_0x2b33('0x14')]['id']){return pm2['delete'](_0x106ea0['params']['id'])[_0x2b33('0x11')](function(_0x3d2aaa){pm2[_0x2b33('0x1e')]();return _0x3d2aaa[0x0];})[_0x2b33('0x11')](respondWithResult(_0x2a081c,null))[_0x2b33('0x12')](handleError(_0x2a081c,null));}else{return _0x2a081c[_0x2b33('0x9')](0x1f4)['send']({'message':_0x2b33('0x22')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 353c7d3..7f98374 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 _0xa448=['express','../../components/auth/service','./realtime.controller','/agents','isAuthenticated','get','/queues','getQueues','exports'];(function(_0x4b7468,_0x1a5bbc){var _0x97d592=function(_0x1f7cfb){while(--_0x1f7cfb){_0x4b7468['push'](_0x4b7468['shift']());}};_0x97d592(++_0x1a5bbc);}(_0xa448,0x168));var _0x8a44=function(_0x803a42,_0x4bab6f){_0x803a42=_0x803a42-0x0;var _0x58cfa7=_0xa448[_0x803a42];return _0x58cfa7;};'use strict';var express=require(_0x8a44('0x0'));var router=express['Router']();var auth=require(_0x8a44('0x1'));var controller=require(_0x8a44('0x2'));router['get'](_0x8a44('0x3'),auth[_0x8a44('0x4')](),controller['getAgents']);router[_0x8a44('0x5')](_0x8a44('0x6'),auth[_0x8a44('0x4')](),controller[_0x8a44('0x7')]);module[_0x8a44('0x8')]=router; \ No newline at end of file +var _0x6db9=['Router','/agents','isAuthenticated','getAgents','/queues','exports'];(function(_0x1eda65,_0x13d2d7){var _0x57d5ad=function(_0xc731b2){while(--_0xc731b2){_0x1eda65['push'](_0x1eda65['shift']());}};_0x57d5ad(++_0x13d2d7);}(_0x6db9,0x114));var _0x96db=function(_0x7c02f7,_0x8ff23b){_0x7c02f7=_0x7c02f7-0x0;var _0x515003=_0x6db9[_0x7c02f7];return _0x515003;};'use strict';var express=require('express');var router=express[_0x96db('0x0')]();var auth=require('../../components/auth/service');var controller=require('./realtime.controller');router['get'](_0x96db('0x1'),auth[_0x96db('0x2')](),controller[_0x96db('0x3')]);router['get'](_0x96db('0x4'),auth[_0x96db('0x2')](),controller['getQueues']);module[_0x96db('0x5')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index f0977f3..64c0f21 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 _0x1cb7=['getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','User','rawAttributes','fieldName','type','key','role','agent','getOptions','push','sequelize','literal','FIELD(id,','forEach','Pause','where','user','Agents','online','extraQueryConditions','omit','UserProfile','getResources','findAndCountAll','filterAgentAttributes','merge','includes','voice','voiceStatus','pause','Status','getRealtimeAgentsQueryFields','pick','catch','startCase','Queue','name','outbound','dialActive','dialMethod','QueueCampaigns','Queues','filter','assign','getRealtimeQueues','lodash','util','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../errors/api','APIBadRequestError','handleError','offset','undefined','count','set','Content-Range','getAgents','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','*pause','resolve','then','channel','isValidChannel','format','toLowerCase','sort','globalStatus'];(function(_0x4bfe08,_0x48ae7b){var _0x1f9125=function(_0x11450e){while(--_0x11450e){_0x4bfe08['push'](_0x4bfe08['shift']());}};_0x1f9125(++_0x48ae7b);}(_0x1cb7,0x17f));var _0x71cb=function(_0xa83db6,_0x2ec358){_0xa83db6=_0xa83db6-0x0;var _0x5d6e5f=_0x1cb7[_0xa83db6];return _0x5d6e5f;};'use strict';var _=require(_0x71cb('0x0'));var util=require(_0x71cb('0x1'));var rta=require('../../components/realtime/agents');var rtq=require(_0x71cb('0x2'));var qs=require(_0x71cb('0x3'));var utils=require(_0x71cb('0x4'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0x71cb('0x5'))[_0x71cb('0x6')];var APIHandleError=require(_0x71cb('0x5'))[_0x71cb('0x7')];function respondWithFilteredResult(_0x24c566,_0x573985){return function(_0x298762){if(_0x298762){var _0x1387fd=typeof _0x573985[_0x71cb('0x8')]===_0x71cb('0x9')&&typeof _0x573985['limit']===_0x71cb('0x9');var _0x38c05b=_0x298762[_0x71cb('0xa')];var _0x211ff7=_0x1387fd?0x0:_0x573985[_0x71cb('0x8')];var _0x57e7ec=_0x1387fd?_0x298762[_0x71cb('0xa')]:_0x573985[_0x71cb('0x8')]+_0x573985['limit'];var _0x32c202;if(_0x57e7ec>=_0x38c05b){_0x57e7ec=_0x38c05b;_0x32c202=0xc8;}else{_0x32c202=0xce;}_0x24c566['status'](_0x32c202);return _0x24c566[_0x71cb('0xb')](_0x71cb('0xc'),_0x211ff7+'-'+_0x57e7ec+'/'+_0x38c05b)['json'](_0x298762);}return null;};}exports[_0x71cb('0xd')]=function(_0x377efb,_0x1a5c82){var _0x22ee04={'count':0x0,'rows':[]};var _0xb834f6={};var _0x2dac4a;var _0x16c49a=utils['getChannels']();var _0x38ece1;var _0x2d7e98;var _0x14b685=_0x377efb[_0x71cb('0xe')][_0x71cb('0xf')];var _0xd8d854=_0x377efb[_0x71cb('0xe')][_0x71cb('0x10')];var _0x15acef=_0x377efb['query'][_0x71cb('0x11')];var _0xa1027a=_0xd8d854==='pause'||_0xd8d854===_0x71cb('0x12')?!![]:![];var _0x32ff17=[];var _0x33838e;var _0x9a56a7;Promise[_0x71cb('0x13')]()[_0x71cb('0x14')](function(){if(_0x377efb[_0x71cb('0xe')][_0x71cb('0x15')]){if(!utils[_0x71cb('0x16')](_0x377efb[_0x71cb('0xe')][_0x71cb('0x15')])){throw new APIBadRequestError(util[_0x71cb('0x17')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x377efb[_0x71cb('0xe')]['channel']));}_0x2dac4a=_0x377efb['query']['channel'][_0x71cb('0x18')]();}if(!_0x377efb[_0x71cb('0xe')][_0x71cb('0x19')]||!_0x377efb[_0x71cb('0xe')][_0x71cb('0x19')]['includes'](_0x71cb('0x1a'))){_0x377efb[_0x71cb('0xe')]['sort']=rta['validateSortParameter'](_0x377efb[_0x71cb('0xe')][_0x71cb('0x19')]);return;}var _0x43d35d=rta[_0x71cb('0x1b')](_0x377efb['query'][_0x71cb('0x19')]);_0x377efb['query'][_0x71cb('0x19')]=_0x43d35d[_0x71cb('0x1c')][_0x71cb('0x1d')](',');_0x33838e=_0x43d35d[_0x71cb('0x1e')];})[_0x71cb('0x14')](function(){if(!_0x14b685){return[];}return rta[_0x71cb('0x1f')](_0x14b685,_0x2dac4a);})[_0x71cb('0x14')](function(_0x415940){_0x32ff17=_0x415940;return rta[_0x71cb('0x20')]();})[_0x71cb('0x14')](function(_0x46f821){_0x2d7e98=_0x46f821[_0x71cb('0x21')];if((!_0xd8d854||_0xa1027a)&&!_0x33838e){return _0x32ff17;}if(_0x33838e&&!_0xd8d854){return rta[_0x71cb('0x22')](_0x2d7e98,_0x32ff17,_0x33838e);}else{return rta[_0x71cb('0x23')](_0x2d7e98,_0x32ff17,_0xd8d854);}})[_0x71cb('0x14')](function(_0x4adfb0){_0x32ff17=_0x4adfb0;var _0x25ce0c=![];if(_0x32ff17[_0x71cb('0x24')]===0x0){if(_0x14b685||_0xd8d854){_0x25ce0c=!![];}if(_0xa1027a){_0x25ce0c=![];}}if(_0x25ce0c){return _0x22ee04;}var _0x5f2500=_[_0x71cb('0x25')](db[_0x71cb('0x26')][_0x71cb('0x27')],function(_0x509c99){return{'name':_0x509c99[_0x71cb('0x28')],'type':_0x509c99[_0x71cb('0x29')][_0x71cb('0x2a')]};});_0x377efb[_0x71cb('0xe')][_0x71cb('0x2b')]=_0x71cb('0x2c');_0xb834f6=qs[_0x71cb('0x2d')](_0x5f2500,_0x377efb);_0xb834f6['raw']=!![];var _0x1007a4=[];if(_0x32ff17[_0x71cb('0x24')]>0x0){_0x1007a4[_0x71cb('0x2e')]({'id':{'$in':_0x32ff17}});if(_0x33838e&&!_0xd8d854){_0x9a56a7=[db[_0x71cb('0x2f')][_0x71cb('0x30')](_0x71cb('0x31')+_0x32ff17+')')];_0xb834f6[_0x71cb('0x1e')]=_0x9a56a7;}}if(_0xa1027a){_0x16c49a[_0x71cb('0x32')](function(_0x3e633f){var _0x1b4f18=!![];if(_0xd8d854===_0x71cb('0x12')&&_0x2dac4a!==_0x3e633f){_0x1b4f18=![];}_0x1007a4[_0x71cb('0x2e')]({[_0x3e633f+_0x71cb('0x33')]:_0x1b4f18});});if(_0x15acef){_0x1007a4[_0x71cb('0x2e')]({'pauseType':_0x15acef});}}else if(_0xd8d854){_0x16c49a['forEach'](function(_0x460e2e){_0x1007a4['push']({[_0x460e2e+_0x71cb('0x33')]:![]});});}_0xb834f6[_0x71cb('0x34')]=_['merge'](_0xb834f6['where'],{'$and':_0x1007a4});if(_0x377efb[_0x71cb('0x35')][_0x71cb('0x2b')]===_0x71cb('0x35')){var _0x3f40b7={'params':{'id':_0x377efb[_0x71cb('0x35')]['userProfileId']},'query':{'section':_0x71cb('0x36'),'role':_0x71cb('0x2c'),'raw':!![],'ids':_0x32ff17,'customSorting':_0x9a56a7}};if(_0x377efb[_0x71cb('0xe')][_0x71cb('0x37')]){_0x3f40b7[_0x71cb('0xe')][_0x71cb('0x37')]=!![];}if(_0xa1027a){_0x3f40b7['query'][_0x71cb('0x38')]=_0x1007a4;}_0x3f40b7[_0x71cb('0xe')]=Object['assign'](_0x3f40b7[_0x71cb('0xe')],_[_0x71cb('0x39')](_0x377efb[_0x71cb('0xe')],'id'));return db[_0x71cb('0x3a')][_0x71cb('0x3b')](_0x3f40b7);}return db['User'][_0x71cb('0x3c')](_0xb834f6);})[_0x71cb('0x14')](function(_0x27934f){_0x22ee04[_0x71cb('0xa')]=_0x27934f['count'];_0x38ece1=_0x27934f[_0x71cb('0x21')];return _0x38ece1[_0x71cb('0x25')](function(_0x4bf627){var _0x37bfb1=_['find'](_0x2d7e98,['id',_0x4bf627['id']]);if(_0x37bfb1){var _0x5cd7dd=rta[_0x71cb('0x3d')](_0x37bfb1);_[_0x71cb('0x3e')](_0x4bf627,_0x5cd7dd);}_0x4bf627['globalStatus']=rta['getAgentStatus'](_0x4bf627);if(_0x4bf627[_0x71cb('0x1a')][_0x71cb('0x3f')]('pause')){_0x16c49a[_0x71cb('0x32')](function(_0x2e432a){if(_0x4bf627[_0x2e432a+'Pause']){if(_0x2e432a===_0x71cb('0x40')){if(_0x4bf627['voiceStatus']!=='talking'){_0x4bf627[_0x71cb('0x41')]=_0x71cb('0x42');}}else{_0x4bf627[_0x2e432a+_0x71cb('0x43')]='pause';}}});}return _0x4bf627;});})[_0x71cb('0x14')](function(_0xaf069d){if(!_0x33838e||_0x9a56a7){return _0xaf069d;}return rta['sortAgentsByStatus'](_0xaf069d,_0x33838e);})['then'](function(_0x1a6592){var _0x1bbf1c=rta[_0x71cb('0x44')]();_0x22ee04[_0x71cb('0x21')]=_0x1a6592['map'](function(_0x3bf85a){return _[_0x71cb('0x45')](_0x3bf85a,_0x1bbf1c);});return _0x22ee04;})[_0x71cb('0x14')](respondWithFilteredResult(_0x1a5c82,_0xb834f6))[_0x71cb('0x46')](APIHandleError(_0x1a5c82));};exports['getQueues']=function(_0x371253,_0x19f47f){var _0xf15897={'count':0x0,'rows':[]};var _0x1e7310={};var _0x38518a;var _0x1a8638;var _0x5843ca;Promise['resolve']()['then'](function(){if(_0x371253['query'][_0x71cb('0x15')]){if(!utils[_0x71cb('0x16')](_0x371253[_0x71cb('0xe')][_0x71cb('0x15')])){throw new APIBadRequestError(util[_0x71cb('0x17')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x371253['query'][_0x71cb('0x15')]));}_0x38518a=_0x371253[_0x71cb('0xe')][_0x71cb('0x15')]['toLowerCase']();}var _0x13c158=_[_0x71cb('0x47')](_0x38518a)+_0x71cb('0x48');var _0x268a01=_[_0x71cb('0x25')](db[_0x13c158][_0x71cb('0x27')],function(_0x1c7641){return{'name':_0x1c7641['fieldName'],'type':_0x1c7641[_0x71cb('0x29')][_0x71cb('0x2a')]};});if(!_0x371253[_0x71cb('0xe')]['fields']){var _0x4fefd5=['id',_0x71cb('0x49')];if(_0x38518a===_0x71cb('0x40')){_0x4fefd5[_0x71cb('0x2e')](_0x71cb('0x29'));if(_0x371253[_0x71cb('0xe')]['type']===_0x71cb('0x4a')){_0x4fefd5[_0x71cb('0x2e')]([_0x71cb('0x4b'),_0x71cb('0x4c')]);}}_0x371253[_0x71cb('0xe')]['fields']=_0x4fefd5['join'](',');}_0x1e7310=qs[_0x71cb('0x2d')](_0x268a01,_0x371253);if(_0x371253[_0x71cb('0x35')][_0x71cb('0x2b')]===_0x71cb('0x35')){var _0x14a931={'params':{'id':_0x371253['user']['userProfileId']},'query':{'section':_0x38518a===_0x71cb('0x40')&&_0x371253[_0x71cb('0xe')][_0x71cb('0x29')]===_0x71cb('0x4a')?_0x71cb('0x4d'):_[_0x71cb('0x47')](_0x38518a)+_0x71cb('0x4e'),'type':_0x371253[_0x71cb('0xe')][_0x71cb('0x29')],'nolimit':!![],'sort':_0x71cb('0x49'),'filter':_0x371253[_0x71cb('0xe')][_0x71cb('0x4f')]}};_0x14a931[_0x71cb('0xe')]=Object[_0x71cb('0x50')](_0x14a931[_0x71cb('0xe')],_0x371253[_0x71cb('0xe')]);delete _0x14a931[_0x71cb('0xe')]['id'];return db['UserProfile']['getResources'](_0x14a931);}return db[_0x13c158]['findAndCountAll'](_0x1e7310);})['then'](function(_0x4b52b3){_0xf15897[_0x71cb('0xa')]=_0x4b52b3[_0x71cb('0xa')];_0x1a8638=_0x4b52b3['rows'];return rtq[_0x71cb('0x51')](_0x371253,_0x38518a);})[_0x71cb('0x14')](function(_0x22e799){_0x5843ca=_0x22e799['rows'];return rtq['initializeQueues'](_0x1a8638,_0x5843ca,_0x38518a,_0x371253['query'][_0x71cb('0x29')]);})[_0x71cb('0x14')](function(_0x4247e1){_0xf15897['rows']=_0x4247e1;return _0xf15897;})['then'](respondWithFilteredResult(_0x19f47f,_0x1e7310))[_0x71cb('0x46')](APIHandleError(_0x19f47f));}; \ No newline at end of file +var _0x675b=['talking','Status','sortAgentsByStatus','getRealtimeAgentsQueryFields','pick','getQueues','startCase','Queue','dialActive','dialMethod','join','QueueCampaigns','Queues','name','filter','initializeQueues','catch','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../config/utils','../../mysqldb','../../errors/api','undefined','limit','count','offset','status','set','Content-Range','getChannels','query','globalStatusFilter','*pause','resolve','then','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','globalStatus','validateSortParameter','fields','order','getRealtimeAgents','rows','getAgentIdsByStatus','length','User','rawAttributes','fieldName','type','key','role','getOptions','push','literal','FIELD(id,','Pause','forEach','merge','where','user','userProfileId','online','UserProfile','getResources','map','find','filterAgentAttributes','getAgentStatus','includes','pause','voice','voiceStatus'];(function(_0x7abd7,_0x1ca3f9){var _0x3a2577=function(_0x18456d){while(--_0x18456d){_0x7abd7['push'](_0x7abd7['shift']());}};_0x3a2577(++_0x1ca3f9);}(_0x675b,0x192));var _0xb675=function(_0x1e64d0,_0x37b191){_0x1e64d0=_0x1e64d0-0x0;var _0x445f60=_0x675b[_0x1e64d0];return _0x445f60;};'use strict';var _=require(_0xb675('0x0'));var util=require(_0xb675('0x1'));var rta=require(_0xb675('0x2'));var rtq=require(_0xb675('0x3'));var qs=require('../../components/parsers/qs');var utils=require(_0xb675('0x4'));var db=require(_0xb675('0x5'))['db'];var APIBadRequestError=require('../../errors/api')['APIBadRequestError'];var APIHandleError=require(_0xb675('0x6'))['handleError'];function respondWithFilteredResult(_0x271046,_0x18b125){return function(_0x39647d){if(_0x39647d){var _0x34a2b4=typeof _0x18b125['offset']===_0xb675('0x7')&&typeof _0x18b125[_0xb675('0x8')]===_0xb675('0x7');var _0x161718=_0x39647d[_0xb675('0x9')];var _0x3ef7ff=_0x34a2b4?0x0:_0x18b125[_0xb675('0xa')];var _0x14dd31=_0x34a2b4?_0x39647d[_0xb675('0x9')]:_0x18b125[_0xb675('0xa')]+_0x18b125['limit'];var _0x337f5c;if(_0x14dd31>=_0x161718){_0x14dd31=_0x161718;_0x337f5c=0xc8;}else{_0x337f5c=0xce;}_0x271046[_0xb675('0xb')](_0x337f5c);return _0x271046[_0xb675('0xc')](_0xb675('0xd'),_0x3ef7ff+'-'+_0x14dd31+'/'+_0x161718)['json'](_0x39647d);}return null;};}exports['getAgents']=function(_0x148f36,_0x509b55){var _0x8bdd98={'count':0x0,'rows':[]};var _0x3a816e={};var _0x18ee76;var _0x3780b0=utils[_0xb675('0xe')]();var _0x2b7f4f;var _0x3ce072;var _0xaf43da=_0x148f36[_0xb675('0xf')]['globalQueueFilter'];var _0x927b52=_0x148f36[_0xb675('0xf')][_0xb675('0x10')];var _0x41e5d3=_0x148f36[_0xb675('0xf')]['pauseTypeFilter'];var _0x30def2=_0x927b52==='pause'||_0x927b52===_0xb675('0x11')?!![]:![];var _0x2f3911=[];var _0x2cd2f5;var _0x6815;Promise[_0xb675('0x12')]()[_0xb675('0x13')](function(){if(_0x148f36[_0xb675('0xf')]['channel']){if(!utils['isValidChannel'](_0x148f36['query'][_0xb675('0x14')])){throw new APIBadRequestError(util[_0xb675('0x15')](_0xb675('0x16'),_0x148f36[_0xb675('0xf')]['channel']));}_0x18ee76=_0x148f36[_0xb675('0xf')]['channel'][_0xb675('0x17')]();}if(!_0x148f36[_0xb675('0xf')][_0xb675('0x18')]||!_0x148f36['query'][_0xb675('0x18')]['includes'](_0xb675('0x19'))){_0x148f36[_0xb675('0xf')]['sort']=rta[_0xb675('0x1a')](_0x148f36[_0xb675('0xf')][_0xb675('0x18')]);return;}var _0x1e9cef=rta['getUpdatedSortOptions'](_0x148f36['query'][_0xb675('0x18')]);_0x148f36[_0xb675('0xf')][_0xb675('0x18')]=_0x1e9cef[_0xb675('0x1b')]['join'](',');_0x2cd2f5=_0x1e9cef[_0xb675('0x1c')];})['then'](function(){if(!_0xaf43da){return[];}return rta['getAgentIdsByQueues'](_0xaf43da,_0x18ee76);})['then'](function(_0x3afec0){_0x2f3911=_0x3afec0;return rta[_0xb675('0x1d')]();})[_0xb675('0x13')](function(_0x1a9641){_0x3ce072=_0x1a9641[_0xb675('0x1e')];if((!_0x927b52||_0x30def2)&&!_0x2cd2f5){return _0x2f3911;}if(_0x2cd2f5&&!_0x927b52){return rta['getSortedAgentsIdsByStatus'](_0x3ce072,_0x2f3911,_0x2cd2f5);}else{return rta[_0xb675('0x1f')](_0x3ce072,_0x2f3911,_0x927b52);}})[_0xb675('0x13')](function(_0x20b09f){_0x2f3911=_0x20b09f;var _0x35df0a=![];if(_0x2f3911[_0xb675('0x20')]===0x0){if(_0xaf43da||_0x927b52){_0x35df0a=!![];}if(_0x30def2){_0x35df0a=![];}}if(_0x35df0a){return _0x8bdd98;}var _0xbd075a=_['map'](db[_0xb675('0x21')][_0xb675('0x22')],function(_0x20f7a8){return{'name':_0x20f7a8[_0xb675('0x23')],'type':_0x20f7a8[_0xb675('0x24')][_0xb675('0x25')]};});_0x148f36[_0xb675('0xf')][_0xb675('0x26')]='agent';_0x3a816e=qs[_0xb675('0x27')](_0xbd075a,_0x148f36);_0x3a816e['raw']=!![];var _0x5ae98e=[];if(_0x2f3911[_0xb675('0x20')]>0x0){_0x5ae98e[_0xb675('0x28')]({'id':{'$in':_0x2f3911}});if(_0x2cd2f5&&!_0x927b52){_0x6815=[db['sequelize'][_0xb675('0x29')](_0xb675('0x2a')+_0x2f3911+')')];_0x3a816e[_0xb675('0x1c')]=_0x6815;}}if(_0x30def2){_0x3780b0['forEach'](function(_0x12476c){var _0x28aea8=!![];if(_0x927b52===_0xb675('0x11')&&_0x18ee76!==_0x12476c){_0x28aea8=![];}_0x5ae98e[_0xb675('0x28')]({[_0x12476c+_0xb675('0x2b')]:_0x28aea8});});if(_0x41e5d3){_0x5ae98e[_0xb675('0x28')]({'pauseType':_0x41e5d3});}}else if(_0x927b52){_0x3780b0[_0xb675('0x2c')](function(_0x113521){_0x5ae98e[_0xb675('0x28')]({[_0x113521+'Pause']:![]});});}_0x3a816e['where']=_[_0xb675('0x2d')](_0x3a816e[_0xb675('0x2e')],{'$and':_0x5ae98e});if(_0x148f36[_0xb675('0x2f')][_0xb675('0x26')]===_0xb675('0x2f')){var _0x2a49d3={'params':{'id':_0x148f36[_0xb675('0x2f')][_0xb675('0x30')]},'query':{'section':'Agents','role':'agent','raw':!![],'ids':_0x2f3911,'customSorting':_0x6815}};if(_0x148f36[_0xb675('0xf')][_0xb675('0x31')]){_0x2a49d3[_0xb675('0xf')][_0xb675('0x31')]=!![];}if(_0x30def2){_0x2a49d3[_0xb675('0xf')]['extraQueryConditions']=_0x5ae98e;}_0x2a49d3[_0xb675('0xf')]=Object['assign'](_0x2a49d3[_0xb675('0xf')],_['omit'](_0x148f36[_0xb675('0xf')],'id'));return db[_0xb675('0x32')][_0xb675('0x33')](_0x2a49d3);}return db[_0xb675('0x21')]['findAndCountAll'](_0x3a816e);})[_0xb675('0x13')](function(_0x2ca6e8){_0x8bdd98['count']=_0x2ca6e8[_0xb675('0x9')];_0x2b7f4f=_0x2ca6e8['rows'];return _0x2b7f4f[_0xb675('0x34')](function(_0x2fc35b){var _0x1724b4=_[_0xb675('0x35')](_0x3ce072,['id',_0x2fc35b['id']]);if(_0x1724b4){var _0x5c7c6d=rta[_0xb675('0x36')](_0x1724b4);_[_0xb675('0x2d')](_0x2fc35b,_0x5c7c6d);}_0x2fc35b[_0xb675('0x19')]=rta[_0xb675('0x37')](_0x2fc35b);if(_0x2fc35b[_0xb675('0x19')][_0xb675('0x38')](_0xb675('0x39'))){_0x3780b0['forEach'](function(_0x3718cb){if(_0x2fc35b[_0x3718cb+_0xb675('0x2b')]){if(_0x3718cb===_0xb675('0x3a')){if(_0x2fc35b[_0xb675('0x3b')]!==_0xb675('0x3c')){_0x2fc35b[_0xb675('0x3b')]=_0xb675('0x39');}}else{_0x2fc35b[_0x3718cb+_0xb675('0x3d')]='pause';}}});}return _0x2fc35b;});})[_0xb675('0x13')](function(_0x31d191){if(!_0x2cd2f5||_0x6815){return _0x31d191;}return rta[_0xb675('0x3e')](_0x31d191,_0x2cd2f5);})[_0xb675('0x13')](function(_0x3602fb){var _0x448887=rta[_0xb675('0x3f')]();_0x8bdd98[_0xb675('0x1e')]=_0x3602fb[_0xb675('0x34')](function(_0x13a079){return _[_0xb675('0x40')](_0x13a079,_0x448887);});return _0x8bdd98;})[_0xb675('0x13')](respondWithFilteredResult(_0x509b55,_0x3a816e))['catch'](APIHandleError(_0x509b55));};exports[_0xb675('0x41')]=function(_0x13ced2,_0x15eecc){var _0x445254={'count':0x0,'rows':[]};var _0x1025c2={};var _0x125e10;var _0x5a65b9;var _0x3f3a9b;Promise[_0xb675('0x12')]()[_0xb675('0x13')](function(){if(_0x13ced2[_0xb675('0xf')][_0xb675('0x14')]){if(!utils['isValidChannel'](_0x13ced2['query'][_0xb675('0x14')])){throw new APIBadRequestError(util[_0xb675('0x15')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x13ced2['query']['channel']));}_0x125e10=_0x13ced2[_0xb675('0xf')]['channel'][_0xb675('0x17')]();}var _0x37c75b=_[_0xb675('0x42')](_0x125e10)+_0xb675('0x43');var _0x5b1e26=_[_0xb675('0x34')](db[_0x37c75b][_0xb675('0x22')],function(_0x5e42cd){return{'name':_0x5e42cd[_0xb675('0x23')],'type':_0x5e42cd[_0xb675('0x24')]['key']};});if(!_0x13ced2[_0xb675('0xf')][_0xb675('0x1b')]){var _0x3b8761=['id','name'];if(_0x125e10===_0xb675('0x3a')){_0x3b8761['push'](_0xb675('0x24'));if(_0x13ced2[_0xb675('0xf')]['type']==='outbound'){_0x3b8761[_0xb675('0x28')]([_0xb675('0x44'),_0xb675('0x45')]);}}_0x13ced2['query'][_0xb675('0x1b')]=_0x3b8761[_0xb675('0x46')](',');}_0x1025c2=qs['getOptions'](_0x5b1e26,_0x13ced2);if(_0x13ced2[_0xb675('0x2f')][_0xb675('0x26')]===_0xb675('0x2f')){var _0xe55bd1={'params':{'id':_0x13ced2[_0xb675('0x2f')][_0xb675('0x30')]},'query':{'section':_0x125e10==='voice'&&_0x13ced2[_0xb675('0xf')][_0xb675('0x24')]==='outbound'?_0xb675('0x47'):_['startCase'](_0x125e10)+_0xb675('0x48'),'type':_0x13ced2['query'][_0xb675('0x24')],'nolimit':!![],'sort':_0xb675('0x49'),'filter':_0x13ced2[_0xb675('0xf')][_0xb675('0x4a')]}};_0xe55bd1[_0xb675('0xf')]=Object['assign'](_0xe55bd1[_0xb675('0xf')],_0x13ced2[_0xb675('0xf')]);delete _0xe55bd1[_0xb675('0xf')]['id'];return db['UserProfile'][_0xb675('0x33')](_0xe55bd1);}return db[_0x37c75b]['findAndCountAll'](_0x1025c2);})[_0xb675('0x13')](function(_0x55c135){_0x445254[_0xb675('0x9')]=_0x55c135['count'];_0x5a65b9=_0x55c135[_0xb675('0x1e')];return rtq['getRealtimeQueues'](_0x13ced2,_0x125e10);})[_0xb675('0x13')](function(_0x1f2012){_0x3f3a9b=_0x1f2012[_0xb675('0x1e')];return rtq[_0xb675('0x4b')](_0x5a65b9,_0x3f3a9b,_0x125e10,_0x13ced2[_0xb675('0xf')][_0xb675('0x24')]);})[_0xb675('0x13')](function(_0x124ee2){_0x445254[_0xb675('0x1e')]=_0x124ee2;return _0x445254;})['then'](respondWithFilteredResult(_0x15eecc,_0x1025c2))[_0xb675('0x4c')](APIHandleError(_0x15eecc));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 3c21c48..7498967 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x11d97f,_0x3a1caa){var _0x70c245=function(_0x36f801){while(--_0x36f801){_0x11d97f['push'](_0x11d97f['shift']());}};_0x70c245(++_0x3a1caa);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x2ad574,_0x18f1c9){var _0x42d228=function(_0x1df798){while(--_0x1df798){_0x2ad574['push'](_0x2ad574['shift']());}};_0x42d228(++_0x18f1c9);}(_0x70e0,0x17b));var _0x070e=function(_0x219ba8,_0x3d5115){_0x219ba8=_0x219ba8-0x0;var _0x4ef313=_0x70e0[_0x219ba8];return _0x4ef313;};'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/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 14e7c86..a6591de 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 _0xed54=['exports','INTEGER','STRING','DATE'];(function(_0x2d6533,_0x4b34b0){var _0x398c10=function(_0x37a4e8){while(--_0x37a4e8){_0x2d6533['push'](_0x2d6533['shift']());}};_0x398c10(++_0x4b34b0);}(_0xed54,0xfc));var _0x4ed5=function(_0x3b64a1,_0x25e298){_0x3b64a1=_0x3b64a1-0x0;var _0x3de574=_0xed54[_0x3b64a1];return _0x3de574;};'use strict';var Sequelize=require('sequelize');module[_0x4ed5('0x0')]={'state':{'type':Sequelize[_0x4ed5('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x4ed5('0x2')]},'scheduledat':{'type':Sequelize[_0x4ed5('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x4ed5('0x3')]},'responsetime':{'type':Sequelize[_0x4ed5('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x4ed5('0x2')]},'membername':{'type':Sequelize[_0x4ed5('0x2')]}}; \ No newline at end of file +var _0xf483=['DATE','INTEGER','exports','STRING'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xf483,0xf2));var _0x3f48=function(_0x28e33b,_0x47eb28){_0x28e33b=_0x28e33b-0x0;var _0x50032b=_0xf483[_0x28e33b];return _0x50032b;};'use strict';var Sequelize=require('sequelize');module[_0x3f48('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x3f48('0x1')]},'scheduledat':{'type':Sequelize[_0x3f48('0x2')]},'uniqueid':{'type':Sequelize[_0x3f48('0x1')]},'starttime':{'type':Sequelize[_0x3f48('0x2')]},'responsetime':{'type':Sequelize[_0x3f48('0x2')]},'ringtime':{'type':Sequelize[_0x3f48('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 9fe7a9c..de2f51f 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 _0x360f=['util','api','moment','request-promise','path','rimraf','../../config/environment','ReportAgentPreview','report_agent_preview','lodash'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x360f,0x135));var _0xf360=function(_0x20e18e,_0x4fc621){_0x20e18e=_0x20e18e-0x0;var _0x234a0e=_0x360f[_0x20e18e];return _0x234a0e;};'use strict';var _=require(_0xf360('0x0'));var util=require(_0xf360('0x1'));var logger=require('../../config/logger')(_0xf360('0x2'));var moment=require(_0xf360('0x3'));var BPromise=require('bluebird');var rp=require(_0xf360('0x4'));var fs=require('fs');var path=require(_0xf360('0x5'));var rimraf=require(_0xf360('0x6'));var config=require(_0xf360('0x7'));var attributes=require('./reportAgentPreview.attributes');module['exports']=function(_0x1f5586,_0x4f4204){return _0x1f5586['define'](_0xf360('0x8'),attributes,{'tableName':_0xf360('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x489e=['../../config/environment','exports','define','ReportAgentPreview','lodash','util','bluebird','request-promise','path'];(function(_0x5b6fc2,_0x5d9df3){var _0x742e48=function(_0x439b3d){while(--_0x439b3d){_0x5b6fc2['push'](_0x5b6fc2['shift']());}};_0x742e48(++_0x5d9df3);}(_0x489e,0x1d8));var _0xe489=function(_0x48965e,_0x1ceceb){_0x48965e=_0x48965e-0x0;var _0x10423a=_0x489e[_0x48965e];return _0x10423a;};'use strict';var _=require(_0xe489('0x0'));var util=require(_0xe489('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xe489('0x2'));var rp=require(_0xe489('0x3'));var fs=require('fs');var path=require(_0xe489('0x4'));var rimraf=require('rimraf');var config=require(_0xe489('0x5'));var attributes=require('./reportAgentPreview.attributes');module[_0xe489('0x6')]=function(_0x338d70,_0x170259){return _0x338d70[_0xe489('0x7')](_0xe489('0x8'),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 121b3fa..232238b 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 _0x0553=['catch','CreateReportAgentPreview','body','options','raw','info','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x0553,0x88));var _0x3055=function(_0x51dada,_0x4ddb59){_0x51dada=_0x51dada-0x0;var _0x209d74=_0x0553[_0x51dada];return _0x209d74;};'use strict';var _=require(_0x3055('0x0'));var util=require(_0x3055('0x1'));var moment=require(_0x3055('0x2'));var BPromise=require('bluebird');var rs=require(_0x3055('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3055('0x4'));var logger=require(_0x3055('0x5'))(_0x3055('0x6'));var config=require(_0x3055('0x7'));var jayson=require(_0x3055('0x8'));var client=jayson[_0x3055('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cd895,_0x2c5354,_0x1bc96a){return new BPromise(function(_0x548159,_0xbedf2d){return client['request'](_0x3cd895,_0x1bc96a)[_0x3055('0xa')](function(_0x2de26b){logger['info'](_0x3055('0xb'),_0x2c5354,_0x3055('0xc'));logger[_0x3055('0xd')](_0x3055('0xe'),_0x2c5354,_0x3055('0xc'),JSON[_0x3055('0xf')](_0x2de26b));if(_0x2de26b['error']){if(_0x2de26b[_0x3055('0x10')][_0x3055('0x11')]===0x1f4){logger['error'](_0x3055('0xb'),_0x2c5354,_0x2de26b[_0x3055('0x10')][_0x3055('0x12')]);return _0xbedf2d(_0x2de26b['error']['message']);}logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x2c5354,_0x2de26b[_0x3055('0x10')][_0x3055('0x12')]);return _0x548159(_0x2de26b[_0x3055('0x10')]['message']);}else{logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x2c5354,'request\x20sent');_0x548159(_0x2de26b[_0x3055('0x13')][_0x3055('0x12')]);}})[_0x3055('0x14')](function(_0x46a729){logger['error'](_0x3055('0xb'),_0x2c5354,_0x46a729);_0xbedf2d(_0x46a729);});});}exports[_0x3055('0x15')]=function(_0x56c6ee){var _0x579858=this;return new Promise(function(_0x3d5a3c,_0x10bd51){return db['ReportAgentPreview']['create'](_0x56c6ee[_0x3055('0x16')],{'raw':_0x56c6ee['options']?_0x56c6ee[_0x3055('0x17')][_0x3055('0x18')]===undefined?!![]:![]:!![]})[_0x3055('0xa')](function(_0x5df379){logger[_0x3055('0x19')]('CreateReportAgentPreview',_0x56c6ee);logger[_0x3055('0xd')](_0x3055('0x15'),_0x56c6ee,JSON[_0x3055('0xf')](_0x5df379));_0x3d5a3c(_0x5df379);})[_0x3055('0x14')](function(_0x14e419){logger['error'](_0x3055('0x15'),_0x14e419[_0x3055('0x12')],_0x56c6ee);_0x10bd51(_0x579858[_0x3055('0x10')](0x1f4,_0x14e419[_0x3055('0x12')]));});});}; \ No newline at end of file +var _0x1ef1=['CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','message','ReportAgentPreview,\x20%s,\x20%s','result','catch'];(function(_0xd19f1f,_0x4e9015){var _0x409c77=function(_0x2496c2){while(--_0x2496c2){_0xd19f1f['push'](_0xd19f1f['shift']());}};_0x409c77(++_0x4e9015);}(_0x1ef1,0x1a6));var _0x11ef=function(_0x33fbcb,_0x365e2e){_0x33fbcb=_0x33fbcb-0x0;var _0x2b00e9=_0x1ef1[_0x33fbcb];return _0x2b00e9;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x11ef('0x0'));var rs=require(_0x11ef('0x1'));var fs=require('fs');var Redis=require(_0x11ef('0x2'));var db=require(_0x11ef('0x3'))['db'];var utils=require(_0x11ef('0x4'));var logger=require(_0x11ef('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x11ef('0x6'));var client=jayson[_0x11ef('0x7')][_0x11ef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x21d2fb,_0x150bb6,_0x57adf6){return new BPromise(function(_0xbb9825,_0x56950c){return client['request'](_0x21d2fb,_0x57adf6)[_0x11ef('0x9')](function(_0x448d3d){logger[_0x11ef('0xa')]('ReportAgentPreview,\x20%s,\x20%s',_0x150bb6,_0x11ef('0xb'));logger[_0x11ef('0xc')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x150bb6,'request\x20sent',JSON[_0x11ef('0xd')](_0x448d3d));if(_0x448d3d[_0x11ef('0xe')]){if(_0x448d3d[_0x11ef('0xe')][_0x11ef('0xf')]===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x150bb6,_0x448d3d[_0x11ef('0xe')][_0x11ef('0x10')]);return _0x56950c(_0x448d3d[_0x11ef('0xe')][_0x11ef('0x10')]);}logger[_0x11ef('0xe')](_0x11ef('0x11'),_0x150bb6,_0x448d3d[_0x11ef('0xe')][_0x11ef('0x10')]);return _0xbb9825(_0x448d3d['error'][_0x11ef('0x10')]);}else{logger[_0x11ef('0xa')]('ReportAgentPreview,\x20%s,\x20%s',_0x150bb6,'request\x20sent');_0xbb9825(_0x448d3d[_0x11ef('0x12')]['message']);}})[_0x11ef('0x13')](function(_0x5ad41a){logger['error'](_0x11ef('0x11'),_0x150bb6,_0x5ad41a);_0x56950c(_0x5ad41a);});});}exports[_0x11ef('0x14')]=function(_0x595106){var _0x569278=this;return new Promise(function(_0x582b54,_0x233433){return db[_0x11ef('0x15')][_0x11ef('0x16')](_0x595106[_0x11ef('0x17')],{'raw':_0x595106['options']?_0x595106[_0x11ef('0x18')][_0x11ef('0x19')]===undefined?!![]:![]:!![]})[_0x11ef('0x9')](function(_0x3c5366){logger[_0x11ef('0xa')](_0x11ef('0x14'),_0x595106);logger[_0x11ef('0xc')](_0x11ef('0x14'),_0x595106,JSON[_0x11ef('0xd')](_0x3c5366));_0x582b54(_0x3c5366);})[_0x11ef('0x13')](function(_0x41f80b){logger[_0x11ef('0xe')](_0x11ef('0x14'),_0x41f80b['message'],_0x595106);_0x233433(_0x569278[_0x11ef('0xe')](0x1f4,_0x41f80b[_0x11ef('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index da04080..91cffbf 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 _0x76ad=['/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','multer','util','path','../../components/auth/service','get','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor','voiceQueues','/chat/queues','chatQueues','mailQueues','/mail/accounts','mailAccounts','/sms/queues','smsQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','put','/voice/queues/:id','/outbound','outbound','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','chat','/chat/queues/:id','showChatQueues','post','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','queueNotify','/openchannel/queues/:id','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x76ad,0x9a));var _0xd76a=function(_0xb011d6,_0x74d4eb){_0xb011d6=_0xb011d6-0x0;var _0x1e30f1=_0x76ad[_0xb011d6];return _0x1e30f1;};'use strict';var multer=require(_0xd76a('0x0'));var util=require(_0xd76a('0x1'));var path=require(_0xd76a('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xd76a('0x3'));var controller=require('./rpc.controller');router[_0xd76a('0x4')](_0xd76a('0x5'),auth[_0xd76a('0x6')](),controller[_0xd76a('0x7')]);router[_0xd76a('0x4')]('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller[_0xd76a('0x8')]);router[_0xd76a('0x4')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0xd76a('0x6')](),controller['voiceChannelStopMixMonitor']);router[_0xd76a('0x4')]('/voice/queues',auth['isAuthenticated'](),controller[_0xd76a('0x9')]);router['get'](_0xd76a('0xa'),auth[_0xd76a('0x6')](),controller[_0xd76a('0xb')]);router[_0xd76a('0x4')]('/mail/queues',auth[_0xd76a('0x6')](),controller[_0xd76a('0xc')]);router[_0xd76a('0x4')](_0xd76a('0xd'),auth[_0xd76a('0x6')](),controller[_0xd76a('0xe')]);router['get']('/openchannel/queues',auth[_0xd76a('0x6')](),controller['openchannelQueues']);router[_0xd76a('0x4')](_0xd76a('0xf'),auth['isAuthenticated'](),controller[_0xd76a('0x10')]);router['get']('/whatsapp/queues',auth[_0xd76a('0x6')](),controller['whatsappQueues']);router[_0xd76a('0x4')](_0xd76a('0x11'),auth[_0xd76a('0x6')](),controller[_0xd76a('0x12')]);router['get'](_0xd76a('0x13'),auth[_0xd76a('0x6')](),controller[_0xd76a('0x14')]);router['get'](_0xd76a('0x15'),auth[_0xd76a('0x6')](),controller[_0xd76a('0x16')]);router[_0xd76a('0x4')](_0xd76a('0x17'),auth[_0xd76a('0x6')](),controller[_0xd76a('0x18')]);router['get'](_0xd76a('0x19'),auth[_0xd76a('0x6')](),controller[_0xd76a('0x1a')]);router[_0xd76a('0x4')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0xd76a('0x6')](),controller['voiceQueuesChannelRedirect']);router['get']('/voice/queues/:id',auth[_0xd76a('0x6')](),controller['showVoiceQueues']);router[_0xd76a('0x1b')](_0xd76a('0x1c'),auth['isAuthenticated'](),controller['updateVoiceQueue']);router['get'](_0xd76a('0x1d'),auth[_0xd76a('0x6')](),controller[_0xd76a('0x1e')]);router[_0xd76a('0x4')]('/outbound/channels',auth[_0xd76a('0x6')](),controller[_0xd76a('0x1f')]);router[_0xd76a('0x4')](_0xd76a('0x20'),auth[_0xd76a('0x6')](),controller[_0xd76a('0x21')]);router[_0xd76a('0x1b')](_0xd76a('0x22'),auth['isAuthenticated'](),controller[_0xd76a('0x23')]);router[_0xd76a('0x4')](_0xd76a('0x24'),auth['isAuthenticated'](),controller[_0xd76a('0x25')]);router['get'](_0xd76a('0x26'),auth[_0xd76a('0x6')](),controller['trunks']);router[_0xd76a('0x4')](_0xd76a('0x27'),auth[_0xd76a('0x6')](),controller[_0xd76a('0x28')]);router['get'](_0xd76a('0x29'),auth['isAuthenticated'](),controller[_0xd76a('0x2a')]);router['get'](_0xd76a('0x2b'),auth['isAuthenticated'](),controller[_0xd76a('0x2c')]);router['get']('/mail/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xd76a('0x2d')]);router['get'](_0xd76a('0x2e'),auth['isAuthenticated'](),controller[_0xd76a('0x2f')]);router[_0xd76a('0x4')](_0xd76a('0x30'),auth['isAuthenticated'](),controller['openchannelQueuesIdWaitingInteractions']);router[_0xd76a('0x4')]('/sms/queues/waitinginteractions',auth[_0xd76a('0x6')](),controller[_0xd76a('0x31')]);router[_0xd76a('0x4')]('/whatsapp/queues/waitinginteractions',auth[_0xd76a('0x6')](),controller[_0xd76a('0x32')]);router[_0xd76a('0x4')](_0xd76a('0x33'),auth['isAuthenticated'](),controller[_0xd76a('0x34')]);router['post'](_0xd76a('0x35'),auth['isAuthenticated'](),controller['queueNotify'](_0xd76a('0x36')));router['get'](_0xd76a('0x37'),auth['isAuthenticated'](),controller[_0xd76a('0x38')]);router['post']('/chat/queues/:id/notify',auth[_0xd76a('0x6')](),controller['queueNotify'](_0xd76a('0x39')));router[_0xd76a('0x4')](_0xd76a('0x3a'),auth[_0xd76a('0x6')](),controller[_0xd76a('0x3b')]);router[_0xd76a('0x3c')](_0xd76a('0x3d'),auth[_0xd76a('0x6')](),controller['queueNotify'](_0xd76a('0x3e')));router[_0xd76a('0x4')](_0xd76a('0x3f'),auth['isAuthenticated'](),controller[_0xd76a('0x40')]);router[_0xd76a('0x3c')]('/openchannel/queues/:id/notify',auth[_0xd76a('0x6')](),controller[_0xd76a('0x41')]('openchannel'));router['get'](_0xd76a('0x42'),auth[_0xd76a('0x6')](),controller['showOpenchannelQueues']);router['post'](_0xd76a('0x43'),auth[_0xd76a('0x6')](),controller['queueNotify']('sms'));router[_0xd76a('0x3c')](_0xd76a('0x44'),auth[_0xd76a('0x6')](),controller[_0xd76a('0x41')]('whatsapp'));router['get'](_0xd76a('0x45'),auth['isAuthenticated'](),controller[_0xd76a('0x46')]);router[_0xd76a('0x4')](_0xd76a('0x47'),auth[_0xd76a('0x6')](),controller[_0xd76a('0x48')]);router[_0xd76a('0x3c')]('/agents/:id/notify',auth[_0xd76a('0x6')](),controller[_0xd76a('0x49')]);module[_0xd76a('0x4a')]=router; \ No newline at end of file +var _0xfe29=['faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','/openchannel/queues/:id','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','agentNotify','multer','util','path','express','Router','../../components/auth/service','get','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','/outbound/channels','/agents','agents','put','agentCapacity','/telephones','/trunks','trunks','campaigns','/fax/accounts'];(function(_0x1f7dd8,_0x251a7d){var _0x35b87d=function(_0x1db4b1){while(--_0x1db4b1){_0x1f7dd8['push'](_0x1f7dd8['shift']());}};_0x35b87d(++_0x251a7d);}(_0xfe29,0x1ed));var _0x9fe2=function(_0x1751d8,_0x12ab4d){_0x1751d8=_0x1751d8-0x0;var _0x510945=_0xfe29[_0x1751d8];return _0x510945;};'use strict';var multer=require(_0x9fe2('0x0'));var util=require(_0x9fe2('0x1'));var path=require(_0x9fe2('0x2'));var express=require(_0x9fe2('0x3'));var router=express[_0x9fe2('0x4')]();var auth=require(_0x9fe2('0x5'));var controller=require('./rpc.controller');router[_0x9fe2('0x6')](_0x9fe2('0x7'),auth[_0x9fe2('0x8')](),controller[_0x9fe2('0x9')]);router[_0x9fe2('0x6')]('/voice/channels/:uniqueid/mixmonitor',auth[_0x9fe2('0x8')](),controller[_0x9fe2('0xa')]);router[_0x9fe2('0x6')](_0x9fe2('0xb'),auth[_0x9fe2('0x8')](),controller['voiceChannelStopMixMonitor']);router['get'](_0x9fe2('0xc'),auth['isAuthenticated'](),controller[_0x9fe2('0xd')]);router[_0x9fe2('0x6')]('/chat/queues',auth[_0x9fe2('0x8')](),controller[_0x9fe2('0xe')]);router['get'](_0x9fe2('0xf'),auth[_0x9fe2('0x8')](),controller[_0x9fe2('0x10')]);router[_0x9fe2('0x6')](_0x9fe2('0x11'),auth['isAuthenticated'](),controller[_0x9fe2('0x12')]);router['get'](_0x9fe2('0x13'),auth[_0x9fe2('0x8')](),controller[_0x9fe2('0x14')]);router[_0x9fe2('0x6')]('/sms/queues',auth[_0x9fe2('0x8')](),controller[_0x9fe2('0x15')]);router[_0x9fe2('0x6')]('/whatsapp/queues',auth[_0x9fe2('0x8')](),controller[_0x9fe2('0x16')]);router[_0x9fe2('0x6')](_0x9fe2('0x17'),auth[_0x9fe2('0x8')](),controller[_0x9fe2('0x18')]);router[_0x9fe2('0x6')]('/voice/queues/preview/:id',auth[_0x9fe2('0x8')](),controller[_0x9fe2('0x19')]);router[_0x9fe2('0x6')](_0x9fe2('0x1a'),auth[_0x9fe2('0x8')](),controller[_0x9fe2('0x1b')]);router[_0x9fe2('0x6')]('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0x9fe2('0x1c')]);router['get'](_0x9fe2('0x1d'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0x9fe2('0x6')](_0x9fe2('0x1e'),auth[_0x9fe2('0x8')](),controller[_0x9fe2('0x1f')]);router['get'](_0x9fe2('0x20'),auth[_0x9fe2('0x8')](),controller['showVoiceQueues']);router['put']('/voice/queues/:id',auth[_0x9fe2('0x8')](),controller[_0x9fe2('0x21')]);router[_0x9fe2('0x6')](_0x9fe2('0x22'),auth[_0x9fe2('0x8')](),controller[_0x9fe2('0x23')]);router[_0x9fe2('0x6')](_0x9fe2('0x24'),auth[_0x9fe2('0x8')](),controller['outboundChannels']);router[_0x9fe2('0x6')](_0x9fe2('0x25'),auth['isAuthenticated'](),controller[_0x9fe2('0x26')]);router[_0x9fe2('0x27')]('/agents/:id/capacity',auth[_0x9fe2('0x8')](),controller[_0x9fe2('0x28')]);router[_0x9fe2('0x6')](_0x9fe2('0x29'),auth[_0x9fe2('0x8')](),controller['telephones']);router[_0x9fe2('0x6')](_0x9fe2('0x2a'),auth[_0x9fe2('0x8')](),controller[_0x9fe2('0x2b')]);router[_0x9fe2('0x6')]('/campaigns',auth[_0x9fe2('0x8')](),controller[_0x9fe2('0x2c')]);router[_0x9fe2('0x6')](_0x9fe2('0x2d'),auth[_0x9fe2('0x8')](),controller[_0x9fe2('0x2e')]);router[_0x9fe2('0x6')]('/chat/queues/waitinginteractions',auth[_0x9fe2('0x8')](),controller[_0x9fe2('0x2f')]);router[_0x9fe2('0x6')](_0x9fe2('0x30'),auth[_0x9fe2('0x8')](),controller[_0x9fe2('0x31')]);router[_0x9fe2('0x6')](_0x9fe2('0x32'),auth[_0x9fe2('0x8')](),controller['openchannelQueuesWaitingInteractions']);router[_0x9fe2('0x6')](_0x9fe2('0x33'),auth['isAuthenticated'](),controller[_0x9fe2('0x34')]);router[_0x9fe2('0x6')](_0x9fe2('0x35'),auth['isAuthenticated'](),controller[_0x9fe2('0x36')]);router[_0x9fe2('0x6')](_0x9fe2('0x37'),auth[_0x9fe2('0x8')](),controller[_0x9fe2('0x38')]);router[_0x9fe2('0x6')]('/fax/queues/waitinginteractions',auth[_0x9fe2('0x8')](),controller[_0x9fe2('0x39')]);router[_0x9fe2('0x3a')](_0x9fe2('0x3b'),auth['isAuthenticated'](),controller[_0x9fe2('0x3c')](_0x9fe2('0x3d')));router[_0x9fe2('0x6')](_0x9fe2('0x3e'),auth[_0x9fe2('0x8')](),controller[_0x9fe2('0x3f')]);router[_0x9fe2('0x3a')](_0x9fe2('0x40'),auth[_0x9fe2('0x8')](),controller['queueNotify'](_0x9fe2('0x41')));router[_0x9fe2('0x6')](_0x9fe2('0x42'),auth[_0x9fe2('0x8')](),controller['showChatQueues']);router[_0x9fe2('0x3a')]('/fax/queues/:id/notify',auth[_0x9fe2('0x8')](),controller[_0x9fe2('0x3c')]('fax'));router[_0x9fe2('0x6')]('/fax/queues/:id',auth[_0x9fe2('0x8')](),controller['showFaxQueues']);router['post']('/openchannel/queues/:id/notify',auth[_0x9fe2('0x8')](),controller[_0x9fe2('0x3c')]('openchannel'));router[_0x9fe2('0x6')](_0x9fe2('0x43'),auth[_0x9fe2('0x8')](),controller[_0x9fe2('0x44')]);router[_0x9fe2('0x3a')]('/sms/queues/:id/notify',auth[_0x9fe2('0x8')](),controller['queueNotify'](_0x9fe2('0x45')));router['post'](_0x9fe2('0x46'),auth[_0x9fe2('0x8')](),controller[_0x9fe2('0x3c')](_0x9fe2('0x47')));router[_0x9fe2('0x6')](_0x9fe2('0x48'),auth[_0x9fe2('0x8')](),controller['showSmsQueues']);router[_0x9fe2('0x6')](_0x9fe2('0x49'),auth[_0x9fe2('0x8')](),controller[_0x9fe2('0x4a')]);router[_0x9fe2('0x3a')](_0x9fe2('0x4b'),auth[_0x9fe2('0x8')](),controller[_0x9fe2('0x4c')]);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 33f7c36..e18fa41 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 _0xa9e0=['mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','filter','map','queue_id','uniq','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','chat','Website','Account','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','MessageId','InteractionId','From','QueueId','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','capitalize','User','messageId','update','bluebird','moment','lodash','../../config/logger','jayson/promise','client','http','then','error','code','catch','status','sendStatus','stack','name','send','isNil','find','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','findAll','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','INTERACTION','interface','SIP/%s','agent','internal','AgentCapacity','telephones','Telephones','Trunks','campaigns','ChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var BPromise=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x0a9e('0x3'))('api');var jayson=require(_0x0a9e('0x4'));var amiClient=jayson[_0x0a9e('0x5')][_0x0a9e('0x6')]({'port':0x232a});var mailClient=jayson[_0x0a9e('0x5')][_0x0a9e('0x6')]({'port':0x232b});var routingClient=jayson['client'][_0x0a9e('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){var _0x56465b=_0x5f41ea?_0x5f41ea:amiClient;return _0x56465b['request'](_0x441e3a,_0x2cc193)[_0x0a9e('0x7')](function(_0xf81284){if(_0xf81284[_0x0a9e('0x8')]){if(_0xf81284[_0x0a9e('0x8')][_0x0a9e('0x9')]===0x1f4){return _0xe42b77(_0xf81284[_0x0a9e('0x8')]['message']);}return _0x503809(_0xf81284['error']['message']);}else{_0x503809(_0xf81284['result']);}})[_0x0a9e('0xa')](function(_0x36471c){_0xe42b77(_0x36471c);});});}function respondWithResult(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xc8;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0xb')](_0x26d672)['json'](_0x32d742);}return _0xd5b662[_0x0a9e('0xc')](0x194);};}function handleError(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0x1f4;return function(_0x281129){logger[_0x0a9e('0x8')](_0x281129[_0x0a9e('0xd')]);if(_0x281129['name']){delete _0x281129[_0x0a9e('0xe')];}_0x239b12['status'](_0x2b4227)[_0x0a9e('0xf')](_0x281129);};}function findById(_0x519dfd){return function(_0x16033c){if(!_[_0x0a9e('0x10')](_0x519dfd)&&!_['isNil'](_0x16033c)&&!_[_0x0a9e('0x10')](_0x16033c['rows'])){return _[_0x0a9e('0x11')](_0x16033c[_0x0a9e('0x12')],function(_0x106033){return _0x106033['id']==_0x519dfd;});}return null;};}exports[_0x0a9e('0x13')]=function(_0x31b1ca,_0x2eb11f){return respondWithRpcPromise(_0x0a9e('0x14'),_0x31b1ca[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x2eb11f,null))[_0x0a9e('0xa')](handleError(_0x2eb11f,null));};exports[_0x0a9e('0x16')]=function(_0x105080,_0x4bb1e3){return respondWithRpcPromise(_0x0a9e('0x17'),_[_0x0a9e('0x18')](_0x105080['query'],_0x105080[_0x0a9e('0x19')]))['then'](respondWithResult(_0x4bb1e3,null))['catch'](handleError(_0x4bb1e3,null));};exports[_0x0a9e('0x1a')]=function(_0x432e56,_0x38e7c4){return respondWithRpcPromise(_0x0a9e('0x1b'),_['merge'](_0x432e56[_0x0a9e('0x15')],_0x432e56[_0x0a9e('0x19')]))[_0x0a9e('0x7')](respondWithResult(_0x38e7c4,null))[_0x0a9e('0xa')](handleError(_0x38e7c4,null));};exports[_0x0a9e('0x1c')]=function(_0x42ac8f,_0x16b1ca){return respondWithRpcPromise('VoiceQueues',_0x42ac8f['query'])[_0x0a9e('0x7')](respondWithResult(_0x16b1ca,null))[_0x0a9e('0xa')](handleError(_0x16b1ca,null));};exports[_0x0a9e('0x1d')]=function(_0x33161b,_0x526cf3){return respondWithRpcPromise(_0x0a9e('0x1e'),_0x33161b['query'])[_0x0a9e('0x7')](findById(_0x33161b['params']['id']))[_0x0a9e('0x7')](respondWithResult(_0x526cf3,null))[_0x0a9e('0xa')](handleError(_0x526cf3,null));};exports[_0x0a9e('0x1f')]=function(_0x14433c,_0x140511){return respondWithRpcPromise(_0x0a9e('0x20'),_[_0x0a9e('0x18')](_0x14433c[_0x0a9e('0x21')],_0x14433c['params']))[_0x0a9e('0x7')](respondWithResult(_0x140511,null))[_0x0a9e('0xa')](handleError(_0x140511,null));};exports[_0x0a9e('0x22')]=function(_0x2ec755,_0x5c877d){return respondWithRpcPromise(_0x0a9e('0x23'),_[_0x0a9e('0x18')](_0x2ec755[_0x0a9e('0x15')],_0x2ec755[_0x0a9e('0x19')]))[_0x0a9e('0x7')](respondWithResult(_0x5c877d,null))[_0x0a9e('0xa')](handleError(_0x5c877d,null));};exports[_0x0a9e('0x24')]=function(_0x2e8759,_0x1dbde2){return respondWithRpcPromise('VoiceQueuesChannels',_0x2e8759[_0x0a9e('0x15')])['then'](respondWithResult(_0x1dbde2,null))[_0x0a9e('0xa')](handleError(_0x1dbde2,null));};exports[_0x0a9e('0x25')]=function(_0x1122db,_0x33bdb7){return respondWithRpcPromise(_0x0a9e('0x26'),_['merge'](_0x1122db[_0x0a9e('0x15')],_0x1122db[_0x0a9e('0x19')]))[_0x0a9e('0x7')](respondWithResult(_0x33bdb7,null))[_0x0a9e('0xa')](handleError(_0x33bdb7,null));};exports[_0x0a9e('0x27')]=function(_0x409319,_0x332d35){return respondWithRpcPromise(_0x0a9e('0x28'),_['merge'](_0x409319[_0x0a9e('0x15')],_0x409319['params']))[_0x0a9e('0x7')](respondWithResult(_0x332d35,null))[_0x0a9e('0xa')](handleError(_0x332d35,null));};exports[_0x0a9e('0x29')]=function(_0x3f3d41,_0x567193){return respondWithRpcPromise(_0x0a9e('0x2a'),_[_0x0a9e('0x18')](_0x3f3d41[_0x0a9e('0x15')],_0x3f3d41[_0x0a9e('0x19')]))['then'](respondWithResult(_0x567193,null))['catch'](handleError(_0x567193,null));};exports[_0x0a9e('0x2b')]=function(_0x5640eb,_0x24936a){return respondWithRpcPromise(_0x0a9e('0x2c'),_0x5640eb[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x24936a,null))['catch'](handleError(_0x24936a,null));};exports[_0x0a9e('0x2d')]=function(_0x3bfce8,_0x3cae){return respondWithRpcPromise('OutboundChannels',_0x3bfce8[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x3cae,null))[_0x0a9e('0xa')](handleError(_0x3cae,null));};exports['agents']=function(_0x546ef8,_0x11b61d){var _0x40d766;return respondWithRpcPromise('Agents',_0x546ef8[_0x0a9e('0x15')])[_0x0a9e('0x7')](function(_0x2e1b3a){_0x40d766=_0x2e1b3a;return respondWithRpcPromise(_0x0a9e('0x2e'),_0x546ef8['query'],routingClient);})['then'](function(_0x15e37d){return _[_0x0a9e('0x18')]({},_0x15e37d,_0x40d766);})['then'](respondWithResult(_0x11b61d,null))[_0x0a9e('0xa')](handleError(_0x11b61d,null));};exports[_0x0a9e('0x2f')]=function(_0x1459bb,_0x5b4f5e){if(_0x1459bb[_0x0a9e('0x21')]&&_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')]&&_0x1459bb[_0x0a9e('0x31')]&&_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0xe')]){for(var _0x2881b3 in _0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')]){if(_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x0a9e('0x32')](_0x2881b3)){db[_0x0a9e('0x33')][_0x0a9e('0x34')]({'where':{'channel':_0x2881b3,'membername':_0x1459bb[_0x0a9e('0x31')]['name'],'type':'INTERACTION','exitAt':null,'uniqueid':_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3]&&_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3][_0x0a9e('0x35')]?{'$notIn':_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3]}:{'$ne':null}}})[_0x0a9e('0x7')](function(_0x432fcc){var _0x25c6e6=moment()[_0x0a9e('0x36')](_0x0a9e('0x37'));for(var _0x5026aa=0x0,_0x117c99=_0x432fcc[_0x0a9e('0x35')];_0x5026aa<_0x117c99;_0x5026aa+=0x1){_0x432fcc[_0x5026aa][_0x0a9e('0x38')]({'exitAt':_0x25c6e6});}});for(var _0xfbd5ad=0x0;_0xfbd5ad<_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3][_0x0a9e('0x35')];_0xfbd5ad+=0x1){db[_0x0a9e('0x33')]['findOrCreate']({'where':{'channel':_0x2881b3,'membername':_0x1459bb[_0x0a9e('0x31')]['name'],'type':_0x0a9e('0x39'),'uniqueid':_0x1459bb[_0x0a9e('0x21')][_0x0a9e('0x30')][_0x2881b3][_0xfbd5ad],'exitAt':null},'defaults':{'channel':_0x2881b3,'membername':_0x1459bb['user'][_0x0a9e('0xe')],'interface':_[_0x0a9e('0x10')](_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x3a')])?util[_0x0a9e('0x36')](_0x0a9e('0x3b'),_0x1459bb[_0x0a9e('0x31')]['name']):_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x3a')],'type':_0x0a9e('0x39'),'enterAt':moment()[_0x0a9e('0x36')](_0x0a9e('0x37')),'role':_0x0a9e('0x3c'),'internal':_0x1459bb[_0x0a9e('0x31')][_0x0a9e('0x3d')],'uniqueid':_0x1459bb[_0x0a9e('0x21')]['interaction'][_0x2881b3][_0xfbd5ad]}});}}}}return respondWithRpcPromise(_0x0a9e('0x3e'),{'id':_0x1459bb[_0x0a9e('0x19')]['id'],'capacity':_0x1459bb['body']['capacity']},routingClient)['then'](respondWithResult(_0x5b4f5e,null))[_0x0a9e('0xa')](handleError(_0x5b4f5e,null));};exports[_0x0a9e('0x3f')]=function(_0x37edaa,_0x11545a){return respondWithRpcPromise(_0x0a9e('0x40'),_0x37edaa[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x11545a,null))[_0x0a9e('0xa')](handleError(_0x11545a,null));};exports['trunks']=function(_0x4b1b9f,_0x53975a){return respondWithRpcPromise(_0x0a9e('0x41'),_0x4b1b9f[_0x0a9e('0x15')])[_0x0a9e('0x7')](respondWithResult(_0x53975a,null))['catch'](handleError(_0x53975a,null));};exports[_0x0a9e('0x42')]=function(_0x161aa7,_0x53d113){return respondWithRpcPromise('Campaigns',_0x161aa7[_0x0a9e('0x15')])['then'](respondWithResult(_0x53d113,null))[_0x0a9e('0xa')](handleError(_0x53d113,null));};exports['chatQueues']=function(_0x2e5e62,_0x3c20b2){return respondWithRpcPromise(_0x0a9e('0x43'),_0x2e5e62['query'],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x3c20b2,null))[_0x0a9e('0xa')](handleError(_0x3c20b2,null));};exports['showChatQueues']=function(_0x50f687,_0x128aa6){return respondWithRpcPromise(_0x0a9e('0x43'),_0x50f687['query'],routingClient)[_0x0a9e('0x7')](findById(_0x50f687['params']['id']))[_0x0a9e('0x7')](respondWithResult(_0x128aa6,null))['catch'](handleError(_0x128aa6,null));};exports[_0x0a9e('0x44')]=function(_0x4a6deb,_0x5da27d){return respondWithRpcPromise('MailQueues',_0x4a6deb[_0x0a9e('0x15')],routingClient)['then'](respondWithResult(_0x5da27d,null))[_0x0a9e('0xa')](handleError(_0x5da27d,null));};exports[_0x0a9e('0x45')]=function(_0x3cfd00,_0x19b4df){return respondWithRpcPromise(_0x0a9e('0x46'),_0x3cfd00[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](findById(_0x3cfd00[_0x0a9e('0x19')]['id']))['then'](respondWithResult(_0x19b4df,null))[_0x0a9e('0xa')](handleError(_0x19b4df,null));};exports[_0x0a9e('0x47')]=function(_0x2642bb,_0x30c491){return respondWithRpcPromise(_0x0a9e('0x48'),_0x2642bb[_0x0a9e('0x15')],mailClient)['then'](respondWithResult(_0x30c491,null))[_0x0a9e('0xa')](handleError(_0x30c491,null));};exports[_0x0a9e('0x49')]=function(_0x5239ef,_0x3649cc){return respondWithRpcPromise('OpenchannelQueues',_0x5239ef[_0x0a9e('0x15')],routingClient)['then'](respondWithResult(_0x3649cc,null))['catch'](handleError(_0x3649cc,null));};exports['showOpenchannelQueues']=function(_0x273cb5,_0x49d231){return respondWithRpcPromise(_0x0a9e('0x4a'),_0x273cb5[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](findById(_0x273cb5[_0x0a9e('0x19')]['id']))[_0x0a9e('0x7')](respondWithResult(_0x49d231,null))[_0x0a9e('0xa')](handleError(_0x49d231,null));};exports['smsQueues']=function(_0x1627a7,_0x5854cc){return respondWithRpcPromise(_0x0a9e('0x4b'),_0x1627a7[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x5854cc,null))['catch'](handleError(_0x5854cc,null));};exports[_0x0a9e('0x4c')]=function(_0x156f1c,_0x119677){return respondWithRpcPromise(_0x0a9e('0x4b'),_0x156f1c['query'],routingClient)[_0x0a9e('0x7')](findById(_0x156f1c[_0x0a9e('0x19')]['id']))['then'](respondWithResult(_0x119677,null))[_0x0a9e('0xa')](handleError(_0x119677,null));};exports[_0x0a9e('0x4d')]=function(_0x88dcbf,_0x409b29){return respondWithRpcPromise(_0x0a9e('0x4e'),_0x88dcbf['query'],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x409b29,null))[_0x0a9e('0xa')](handleError(_0x409b29,null));};exports[_0x0a9e('0x4f')]=function(_0x47bb43,_0x3528b7){return respondWithRpcPromise('WhatsappQueues',_0x47bb43['query'],routingClient)[_0x0a9e('0x7')](findById(_0x47bb43[_0x0a9e('0x19')]['id']))[_0x0a9e('0x7')](respondWithResult(_0x3528b7,null))[_0x0a9e('0xa')](handleError(_0x3528b7,null));};exports[_0x0a9e('0x50')]=function(_0xc8c264,_0x387489){return respondWithRpcPromise(_0x0a9e('0x51'),_0xc8c264[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x387489,null))[_0x0a9e('0xa')](handleError(_0x387489,null));};exports[_0x0a9e('0x52')]=function(_0x2bbb86,_0x2b8192){return respondWithRpcPromise(_0x0a9e('0x51'),_0x2bbb86[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](findById(_0x2bbb86[_0x0a9e('0x19')]['id']))['then'](respondWithResult(_0x2b8192,null))[_0x0a9e('0xa')](handleError(_0x2b8192,null));};exports[_0x0a9e('0x53')]=function(_0x243d12,_0x4edbb0){return respondWithRpcPromise(_0x0a9e('0x54'),_0x243d12[_0x0a9e('0x15')])['then'](respondWithResult(_0x4edbb0,null))[_0x0a9e('0xa')](handleError(_0x4edbb0,null));};exports[_0x0a9e('0x55')]=function(_0x3ef315,_0x427946){return respondWithRpcPromise(_0x0a9e('0x56'),_0x3ef315['query'],routingClient)['then'](respondWithResult(_0x427946,null))['catch'](handleError(_0x427946,null));};exports[_0x0a9e('0x57')]=function(_0x18bf5d,_0x1104ad){return respondWithRpcPromise(_0x0a9e('0x58'),_0x18bf5d[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x1104ad,null))[_0x0a9e('0xa')](handleError(_0x1104ad,null));};exports[_0x0a9e('0x59')]=function(_0x5512d1,_0x235f8f){return respondWithRpcPromise(_0x0a9e('0x5a'),_0x5512d1[_0x0a9e('0x15')],routingClient)['then'](respondWithResult(_0x235f8f,null))[_0x0a9e('0xa')](handleError(_0x235f8f,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x4437ff,_0x44351d){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x4437ff[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](function(_0x2cc7a7){if(_0x4437ff[_0x0a9e('0x15')]['type']!==undefined){var _0x1d442c=_(_0x2cc7a7[_0x0a9e('0x12')])[_0x0a9e('0x5b')]([_0x4437ff[_0x0a9e('0x15')]['type'],_0x4437ff[_0x0a9e('0x19')]['id']])[_0x0a9e('0x5c')](_0x0a9e('0x5d'))[_0x0a9e('0x5e')]()['value']();return _0x2cc7a7[_0x0a9e('0x12')][_0x0a9e('0x5b')](function(_0x30a4c7){return _0x1d442c[_0x0a9e('0x5f')](_0x30a4c7[_0x0a9e('0x5d')])>-0x1;});}else{return _0x2cc7a7[_0x0a9e('0x12')][_0x0a9e('0x5b')](function(_0x3df0e3){return _0x3df0e3[_0x0a9e('0x5d')]===parseInt(_0x4437ff[_0x0a9e('0x19')]['id']);});}})[_0x0a9e('0x7')](respondWithResult(_0x44351d,null))[_0x0a9e('0xa')](handleError(_0x44351d,null));};exports[_0x0a9e('0x60')]=function(_0xe0749e,_0x5b35db){return respondWithRpcPromise(_0x0a9e('0x61'),_0xe0749e[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x5b35db,null))['catch'](handleError(_0x5b35db,null));};exports[_0x0a9e('0x62')]=function(_0x33dda0,_0x8cea96){return respondWithRpcPromise(_0x0a9e('0x63'),_0x33dda0['query'],routingClient)['then'](respondWithResult(_0x8cea96,null))[_0x0a9e('0xa')](handleError(_0x8cea96,null));};exports[_0x0a9e('0x64')]=function(_0x4c54fa,_0x45108c){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x4c54fa[_0x0a9e('0x15')],routingClient)[_0x0a9e('0x7')](respondWithResult(_0x45108c,null))['catch'](handleError(_0x45108c,null));};exports[_0x0a9e('0x65')]=function(_0x41cf12){return function(_0x2d2286,_0x42b959){var _0x3755fe,_0x1f42a0;var _0x444f1f=_['capitalize'](_0x41cf12);var _0x2973d3=_0x41cf12===_0x0a9e('0x66')?_0x0a9e('0x67'):_0x0a9e('0x68');return db[_0x444f1f+'Queue'][_0x0a9e('0x69')]({'raw':!![],'where':{'id':_0x2d2286[_0x0a9e('0x19')]['id']}})['then'](function(_0x1d6834){if(_['isNil'](_0x1d6834)){throw new Error(_0x444f1f+_0x0a9e('0x6a'));}_0x3755fe=_0x1d6834;return db[_0x444f1f+_0x0a9e('0x6b')][_0x0a9e('0x69')]({'where':{'id':_0x2d2286[_0x0a9e('0x21')]['messageId']},'include':[{'model':db[_0x444f1f+'Interaction'],'as':_0x0a9e('0x6c')},{'model':db[_0x444f1f+_0x2973d3],'as':_0x0a9e('0x68')}]});})[_0x0a9e('0x7')](function(_0x5ac73d){if(_[_0x0a9e('0x10')](_0x5ac73d)){throw new Error(_0x444f1f+_0x0a9e('0x6d'));}_0x1f42a0=_0x5ac73d;return _0x5ac73d['update']({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0xf0a802={'uniqueid':_0x41cf12+'.'+_0x1f42a0['id']+'.'+_0x1f42a0['Interaction']['id'],'FromUserId':_0x2d2286['user']['id'],'type':'queue'};_0xf0a802[_0x444f1f+_0x0a9e('0x6e')]=_0x1f42a0['id'];_0xf0a802[_0x444f1f+_0x0a9e('0x6f')]=_0x1f42a0[_0x0a9e('0x6c')]['id'];_0xf0a802[_0x0a9e('0x70')+_0x444f1f+_0x2973d3+'Id']=_0x1f42a0[_0x0a9e('0x68')]['id'];_0xf0a802['To'+_0x444f1f+_0x0a9e('0x71')]=_0x3755fe['id'];return db[_0x444f1f+'TransferReport'][_0x0a9e('0x72')](_0xf0a802);})['then'](function(){return respondWithRpcPromise(_0x0a9e('0x73'),{'channel':_0x41cf12,'interaction':_0x1f42a0[_0x0a9e('0x6c')],'message':_0x1f42a0,'account':_0x1f42a0[_0x0a9e('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a9e('0x74'),'appdata':_0x3755fe['name']+','+(_0x1f42a0[_0x0a9e('0x68')][_0x0a9e('0x75')]||0x12c),'interval':_0x0a9e('0x76')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x42b959,null))[_0x0a9e('0xa')](handleError(_0x42b959,null));};};exports[_0x0a9e('0x77')]=function(_0x2a563d,_0x22063c){var _0x255e49,_0x1910bf;if(_[_0x0a9e('0x10')](_0x2a563d[_0x0a9e('0x21')]['channel'])){throw new Error(_0x0a9e('0x78'));}var _0x3325c5=_0x2a563d['body'][_0x0a9e('0x79')];var _0x982340=_[_0x0a9e('0x7a')](_0x3325c5);var _0x5a26c8=_0x3325c5===_0x0a9e('0x66')?'Website':_0x0a9e('0x68');return db[_0x0a9e('0x7b')][_0x0a9e('0x69')]({'raw':!![],'where':{'id':_0x2a563d[_0x0a9e('0x19')]['id'],'role':_0x0a9e('0x3c')}})[_0x0a9e('0x7')](function(_0x16a039){if(_[_0x0a9e('0x10')](_0x16a039)){throw new Error('Agent\x20not\x20found');}_0x255e49=_0x16a039;return db[_0x982340+_0x0a9e('0x6b')][_0x0a9e('0x69')]({'where':{'id':_0x2a563d[_0x0a9e('0x21')][_0x0a9e('0x7c')]},'include':[{'model':db[_0x982340+_0x0a9e('0x6c')],'as':_0x0a9e('0x6c')},{'model':db[_0x982340+_0x5a26c8],'as':_0x0a9e('0x68')}]});})[_0x0a9e('0x7')](function(_0x1808ba){if(_[_0x0a9e('0x10')](_0x1808ba)){throw new Error(_0x982340+_0x0a9e('0x6d'));}_0x1910bf=_0x1808ba;return _0x1808ba[_0x0a9e('0x7d')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0a9e('0x7')](function(){var _0x4989f9={'uniqueid':_0x3325c5+'.'+_0x1910bf['id']+'.'+_0x1910bf[_0x0a9e('0x6c')]['id'],'FromUserId':_0x2a563d[_0x0a9e('0x31')]['id'],'type':_0x0a9e('0x3c'),'ToUserId':_0x255e49['id']};_0x4989f9[_0x982340+_0x0a9e('0x6e')]=_0x1910bf['id'];_0x4989f9[_0x982340+_0x0a9e('0x6f')]=_0x1910bf['Interaction']['id'];_0x4989f9[_0x0a9e('0x70')+_0x982340+_0x5a26c8+'Id']=_0x1910bf[_0x0a9e('0x68')]['id'];return db[_0x982340+'TransferReport'][_0x0a9e('0x72')](_0x4989f9);})['then'](function(){return respondWithRpcPromise(_0x0a9e('0x73'),{'channel':_0x3325c5,'interaction':_0x1910bf[_0x0a9e('0x6c')],'message':_0x1910bf,'account':_0x1910bf[_0x0a9e('0x68')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a9e('0x3c'),'appdata':_0x255e49['name']+','+(_0x1910bf[_0x0a9e('0x68')]['agentTransferTimeout']||0x12c),'interval':_0x0a9e('0x76')}],'transfer':!![]},routingClient);})[_0x0a9e('0x7')](respondWithResult(_0x22063c,null))['catch'](handleError(_0x22063c,null));}; \ No newline at end of file +var _0xe706=['indexOf','queue_id','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','\x20Queue\x20not\x20found','Message','findOne','Interaction','Account','update','queue','MessageId','InteractionId','TransferReport','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','chat','User','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','From','create','Start','agentTransferTimeout','bluebird','moment','lodash','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','json','name','send','isNil','rows','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','user','hasOwnProperty','MemberReport','findAll','INTERACTION','interaction','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','SIP/%s','interface','agent','internal','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','OpenchannelQueues','showOpenchannelQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','faxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','uniq'];(function(_0x5d2e46,_0x5324e2){var _0x8b23c1=function(_0xc6b14c){while(--_0xc6b14c){_0x5d2e46['push'](_0x5d2e46['shift']());}};_0x8b23c1(++_0x5324e2);}(_0xe706,0xa3));var _0x6e70=function(_0x582d0b,_0x28f609){_0x582d0b=_0x582d0b-0x0;var _0x2e93e1=_0xe706[_0x582d0b];return _0x2e93e1;};'use strict';var BPromise=require(_0x6e70('0x0'));var moment=require(_0x6e70('0x1'));var _=require(_0x6e70('0x2'));var util=require('util');var db=require(_0x6e70('0x3'))['db'];var logger=require(_0x6e70('0x4'))(_0x6e70('0x5'));var jayson=require(_0x6e70('0x6'));var amiClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232a});var mailClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232b});var routingClient=jayson[_0x6e70('0x7')][_0x6e70('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){var _0x449b48=_0x45a2d4?_0x45a2d4:amiClient;return _0x449b48[_0x6e70('0x9')](_0x36357b,_0x293ce7)[_0x6e70('0xa')](function(_0x100eb7){if(_0x100eb7[_0x6e70('0xb')]){if(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xc')]===0x1f4){return _0x3c4843(_0x100eb7[_0x6e70('0xb')][_0x6e70('0xd')]);}return _0x188ed3(_0x100eb7['error']['message']);}else{_0x188ed3(_0x100eb7[_0x6e70('0xe')]);}})[_0x6e70('0xf')](function(_0x18cf27){_0x3c4843(_0x18cf27);});});}function respondWithResult(_0x27dd9b,_0x3b38f3){_0x3b38f3=_0x3b38f3||0xc8;return function(_0x310eb7){if(_0x310eb7){return _0x27dd9b[_0x6e70('0x10')](_0x3b38f3)[_0x6e70('0x11')](_0x310eb7);}return _0x27dd9b['sendStatus'](0x194);};}function handleError(_0x52737e,_0x48bc72){_0x48bc72=_0x48bc72||0x1f4;return function(_0x257e81){logger['error'](_0x257e81['stack']);if(_0x257e81[_0x6e70('0x12')]){delete _0x257e81[_0x6e70('0x12')];}_0x52737e['status'](_0x48bc72)[_0x6e70('0x13')](_0x257e81);};}function findById(_0x5c3fe7){return function(_0x2efc0f){if(!_[_0x6e70('0x14')](_0x5c3fe7)&&!_['isNil'](_0x2efc0f)&&!_['isNil'](_0x2efc0f[_0x6e70('0x15')])){return _['find'](_0x2efc0f[_0x6e70('0x15')],function(_0x173afe){return _0x173afe['id']==_0x5c3fe7;});}return null;};}exports['voiceChannels']=function(_0x497d61,_0xc238ba){return respondWithRpcPromise(_0x6e70('0x16'),_0x497d61[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0xc238ba,null))[_0x6e70('0xf')](handleError(_0xc238ba,null));};exports[_0x6e70('0x18')]=function(_0x1b2453,_0x44a49f){return respondWithRpcPromise(_0x6e70('0x19'),_[_0x6e70('0x1a')](_0x1b2453['query'],_0x1b2453[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x44a49f,null))[_0x6e70('0xf')](handleError(_0x44a49f,null));};exports['voiceChannelStopMixMonitor']=function(_0x3ccd87,_0xa5d49){return respondWithRpcPromise(_0x6e70('0x1c'),_['merge'](_0x3ccd87[_0x6e70('0x17')],_0x3ccd87['params']))['then'](respondWithResult(_0xa5d49,null))['catch'](handleError(_0xa5d49,null));};exports[_0x6e70('0x1d')]=function(_0x19c5ae,_0x51d292){return respondWithRpcPromise(_0x6e70('0x1e'),_0x19c5ae[_0x6e70('0x17')])['then'](respondWithResult(_0x51d292,null))[_0x6e70('0xf')](handleError(_0x51d292,null));};exports[_0x6e70('0x1f')]=function(_0x2bb231,_0x4a67ac){return respondWithRpcPromise('VoiceQueues',_0x2bb231[_0x6e70('0x17')])[_0x6e70('0xa')](findById(_0x2bb231[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4a67ac,null))[_0x6e70('0xf')](handleError(_0x4a67ac,null));};exports['updateVoiceQueue']=function(_0x1952ea,_0x406f29){return respondWithRpcPromise(_0x6e70('0x20'),_[_0x6e70('0x1a')](_0x1952ea[_0x6e70('0x21')],_0x1952ea[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x406f29,null))[_0x6e70('0xf')](handleError(_0x406f29,null));};exports[_0x6e70('0x22')]=function(_0x3a5d30,_0x4b1229){return respondWithRpcPromise(_0x6e70('0x23'),_['merge'](_0x3a5d30[_0x6e70('0x17')],_0x3a5d30['params']))[_0x6e70('0xa')](respondWithResult(_0x4b1229,null))[_0x6e70('0xf')](handleError(_0x4b1229,null));};exports[_0x6e70('0x24')]=function(_0x56f6f7,_0x38c40d){return respondWithRpcPromise(_0x6e70('0x25'),_0x56f6f7['query'])[_0x6e70('0xa')](respondWithResult(_0x38c40d,null))[_0x6e70('0xf')](handleError(_0x38c40d,null));};exports['voiceQueuesChannel']=function(_0x10d8f6,_0x3665a1){return respondWithRpcPromise(_0x6e70('0x26'),_[_0x6e70('0x1a')](_0x10d8f6[_0x6e70('0x17')],_0x10d8f6[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x3665a1,null))[_0x6e70('0xf')](handleError(_0x3665a1,null));};exports[_0x6e70('0x27')]=function(_0x419a41,_0x4d32d8){return respondWithRpcPromise(_0x6e70('0x28'),_['merge'](_0x419a41[_0x6e70('0x17')],_0x419a41[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x4d32d8,null))[_0x6e70('0xf')](handleError(_0x4d32d8,null));};exports[_0x6e70('0x29')]=function(_0x989b80,_0x2440be){return respondWithRpcPromise(_0x6e70('0x2a'),_[_0x6e70('0x1a')](_0x989b80[_0x6e70('0x17')],_0x989b80[_0x6e70('0x1b')]))[_0x6e70('0xa')](respondWithResult(_0x2440be,null))[_0x6e70('0xf')](handleError(_0x2440be,null));};exports['outbound']=function(_0x5446a2,_0x5424eb){return respondWithRpcPromise(_0x6e70('0x2b'),_0x5446a2[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x5424eb,null))[_0x6e70('0xf')](handleError(_0x5424eb,null));};exports[_0x6e70('0x2c')]=function(_0x3bdd87,_0x572a71){return respondWithRpcPromise(_0x6e70('0x2d'),_0x3bdd87[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x572a71,null))[_0x6e70('0xf')](handleError(_0x572a71,null));};exports[_0x6e70('0x2e')]=function(_0x37bf46,_0x246e61){var _0x16fc7d;return respondWithRpcPromise('Agents',_0x37bf46[_0x6e70('0x17')])[_0x6e70('0xa')](function(_0x22fce9){_0x16fc7d=_0x22fce9;return respondWithRpcPromise(_0x6e70('0x2f'),_0x37bf46[_0x6e70('0x17')],routingClient);})[_0x6e70('0xa')](function(_0x21b0e7){return _['merge']({},_0x21b0e7,_0x16fc7d);})['then'](respondWithResult(_0x246e61,null))['catch'](handleError(_0x246e61,null));};exports[_0x6e70('0x30')]=function(_0x2b63cc,_0x83847b){if(_0x2b63cc[_0x6e70('0x21')]&&_0x2b63cc[_0x6e70('0x21')]['interaction']&&_0x2b63cc[_0x6e70('0x31')]&&_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]){for(var _0x52b197 in _0x2b63cc['body']['interaction']){if(_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x6e70('0x32')](_0x52b197)){db[_0x6e70('0x33')][_0x6e70('0x34')]({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'exitAt':null,'uniqueid':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]&&_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')]?{'$notIn':_0x2b63cc['body'][_0x6e70('0x36')][_0x52b197]}:{'$ne':null}}})[_0x6e70('0xa')](function(_0x3d39c3){var _0xac87d6=moment()[_0x6e70('0x38')](_0x6e70('0x39'));for(var _0x3d9c5=0x0,_0x552e7e=_0x3d39c3[_0x6e70('0x37')];_0x3d9c5<_0x552e7e;_0x3d9c5+=0x1){_0x3d39c3[_0x3d9c5][_0x6e70('0x3a')]({'exitAt':_0xac87d6});}});for(var _0x10de2a=0x0;_0x10de2a<_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x36')][_0x52b197][_0x6e70('0x37')];_0x10de2a+=0x1){db[_0x6e70('0x33')]['findOrCreate']({'where':{'channel':_0x52b197,'membername':_0x2b63cc[_0x6e70('0x31')]['name'],'type':_0x6e70('0x35'),'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a],'exitAt':null},'defaults':{'channel':_0x52b197,'membername':_0x2b63cc['user'][_0x6e70('0x12')],'interface':_[_0x6e70('0x14')](_0x2b63cc[_0x6e70('0x31')]['interface'])?util['format'](_0x6e70('0x3b'),_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x12')]):_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3c')],'type':_0x6e70('0x35'),'enterAt':moment()['format'](_0x6e70('0x39')),'role':_0x6e70('0x3d'),'internal':_0x2b63cc[_0x6e70('0x31')][_0x6e70('0x3e')],'uniqueid':_0x2b63cc[_0x6e70('0x21')]['interaction'][_0x52b197][_0x10de2a]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b63cc[_0x6e70('0x1b')]['id'],'capacity':_0x2b63cc[_0x6e70('0x21')][_0x6e70('0x3f')]},routingClient)[_0x6e70('0xa')](respondWithResult(_0x83847b,null))[_0x6e70('0xf')](handleError(_0x83847b,null));};exports['telephones']=function(_0x41bd0b,_0x232366){return respondWithRpcPromise(_0x6e70('0x40'),_0x41bd0b[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x232366,null))['catch'](handleError(_0x232366,null));};exports[_0x6e70('0x41')]=function(_0x1dd242,_0x2c20d3){return respondWithRpcPromise(_0x6e70('0x42'),_0x1dd242[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x2c20d3,null))['catch'](handleError(_0x2c20d3,null));};exports[_0x6e70('0x43')]=function(_0x8d425d,_0x5c2396){return respondWithRpcPromise(_0x6e70('0x44'),_0x8d425d[_0x6e70('0x17')])['then'](respondWithResult(_0x5c2396,null))[_0x6e70('0xf')](handleError(_0x5c2396,null));};exports[_0x6e70('0x45')]=function(_0x2134c4,_0x46d536){return respondWithRpcPromise(_0x6e70('0x46'),_0x2134c4['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x46d536,null))[_0x6e70('0xf')](handleError(_0x46d536,null));};exports[_0x6e70('0x47')]=function(_0x13be81,_0x1c02d7){return respondWithRpcPromise(_0x6e70('0x46'),_0x13be81[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x13be81[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x1c02d7,null))[_0x6e70('0xf')](handleError(_0x1c02d7,null));};exports[_0x6e70('0x48')]=function(_0xb8f78,_0x1fd9a6){return respondWithRpcPromise(_0x6e70('0x49'),_0xb8f78[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x1fd9a6,null))[_0x6e70('0xf')](handleError(_0x1fd9a6,null));};exports[_0x6e70('0x4a')]=function(_0x1c7dca,_0x4c6aab){return respondWithRpcPromise(_0x6e70('0x49'),_0x1c7dca[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x1c7dca[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x4c6aab,null))[_0x6e70('0xf')](handleError(_0x4c6aab,null));};exports['mailAccounts']=function(_0x42bd85,_0x6cabf0){return respondWithRpcPromise('MailAccounts',_0x42bd85[_0x6e70('0x17')],mailClient)[_0x6e70('0xa')](respondWithResult(_0x6cabf0,null))[_0x6e70('0xf')](handleError(_0x6cabf0,null));};exports['openchannelQueues']=function(_0x51f268,_0x2f9be4){return respondWithRpcPromise(_0x6e70('0x4b'),_0x51f268[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2f9be4,null))[_0x6e70('0xf')](handleError(_0x2f9be4,null));};exports[_0x6e70('0x4c')]=function(_0x30cd88,_0x57bfe5){return respondWithRpcPromise('OpenchannelQueues',_0x30cd88[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x30cd88[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x57bfe5,null))['catch'](handleError(_0x57bfe5,null));};exports['smsQueues']=function(_0x2e972b,_0x4e5545){return respondWithRpcPromise('SmsQueues',_0x2e972b['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x4e5545,null))['catch'](handleError(_0x4e5545,null));};exports[_0x6e70('0x4d')]=function(_0x23900b,_0x3b4da0){return respondWithRpcPromise(_0x6e70('0x4e'),_0x23900b[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](findById(_0x23900b[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0x3b4da0,null))['catch'](handleError(_0x3b4da0,null));};exports[_0x6e70('0x4f')]=function(_0x6a560f,_0x22c836){return respondWithRpcPromise(_0x6e70('0x50'),_0x6a560f[_0x6e70('0x17')],routingClient)['then'](respondWithResult(_0x22c836,null))['catch'](handleError(_0x22c836,null));};exports['showWhatsappQueues']=function(_0x1bb338,_0xd91b9){return respondWithRpcPromise(_0x6e70('0x50'),_0x1bb338['query'],routingClient)['then'](findById(_0x1bb338[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xd91b9,null))[_0x6e70('0xf')](handleError(_0xd91b9,null));};exports[_0x6e70('0x51')]=function(_0x2285f1,_0x32b884){return respondWithRpcPromise('FaxQueues',_0x2285f1[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x32b884,null))[_0x6e70('0xf')](handleError(_0x32b884,null));};exports[_0x6e70('0x52')]=function(_0x515c0c,_0xce964b){return respondWithRpcPromise('FaxQueues',_0x515c0c['query'],routingClient)[_0x6e70('0xa')](findById(_0x515c0c[_0x6e70('0x1b')]['id']))[_0x6e70('0xa')](respondWithResult(_0xce964b,null))[_0x6e70('0xf')](handleError(_0xce964b,null));};exports[_0x6e70('0x53')]=function(_0x2be0fc,_0x4b5b19){return respondWithRpcPromise(_0x6e70('0x54'),_0x2be0fc[_0x6e70('0x17')])[_0x6e70('0xa')](respondWithResult(_0x4b5b19,null))[_0x6e70('0xf')](handleError(_0x4b5b19,null));};exports[_0x6e70('0x55')]=function(_0x13c092,_0x363722){return respondWithRpcPromise(_0x6e70('0x56'),_0x13c092[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x363722,null))['catch'](handleError(_0x363722,null));};exports[_0x6e70('0x57')]=function(_0x303c5a,_0x577c3b){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x303c5a['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x577c3b,null))[_0x6e70('0xf')](handleError(_0x577c3b,null));};exports[_0x6e70('0x58')]=function(_0x14bb74,_0x5a3dcb){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x14bb74['query'],routingClient)[_0x6e70('0xa')](respondWithResult(_0x5a3dcb,null))[_0x6e70('0xf')](handleError(_0x5a3dcb,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x58666a,_0x1c7c5f){return respondWithRpcPromise(_0x6e70('0x59'),_0x58666a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](function(_0x44bf96){if(_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')]!==undefined){var _0x3650e9=_(_0x44bf96[_0x6e70('0x15')])[_0x6e70('0x5b')]([_0x58666a[_0x6e70('0x17')][_0x6e70('0x5a')],_0x58666a[_0x6e70('0x1b')]['id']])['map']('queue_id')[_0x6e70('0x5c')]()['value']();return _0x44bf96[_0x6e70('0x15')]['filter'](function(_0x5b5471){return _0x3650e9[_0x6e70('0x5d')](_0x5b5471['queue_id'])>-0x1;});}else{return _0x44bf96['rows'][_0x6e70('0x5b')](function(_0x21e4c2){return _0x21e4c2[_0x6e70('0x5e')]===parseInt(_0x58666a['params']['id']);});}})['then'](respondWithResult(_0x1c7c5f,null))['catch'](handleError(_0x1c7c5f,null));};exports[_0x6e70('0x5f')]=function(_0x512b0a,_0x2e8ed3){return respondWithRpcPromise(_0x6e70('0x60'),_0x512b0a[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x2e8ed3,null))[_0x6e70('0xf')](handleError(_0x2e8ed3,null));};exports[_0x6e70('0x61')]=function(_0x214a8f,_0x50046a){return respondWithRpcPromise(_0x6e70('0x62'),_0x214a8f[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x50046a,null))['catch'](handleError(_0x50046a,null));};exports[_0x6e70('0x63')]=function(_0x227d94,_0x11a615){return respondWithRpcPromise(_0x6e70('0x64'),_0x227d94[_0x6e70('0x17')],routingClient)[_0x6e70('0xa')](respondWithResult(_0x11a615,null))[_0x6e70('0xf')](handleError(_0x11a615,null));};exports[_0x6e70('0x65')]=function(_0x461ec0){return function(_0x48f6fd,_0x463eed){var _0x39e6db,_0x53acc8;var _0x252f07=_[_0x6e70('0x66')](_0x461ec0);var _0x51be27=_0x461ec0==='chat'?_0x6e70('0x67'):'Account';return db[_0x252f07+_0x6e70('0x68')]['findOne']({'raw':!![],'where':{'id':_0x48f6fd[_0x6e70('0x1b')]['id']}})[_0x6e70('0xa')](function(_0x106f32){if(_[_0x6e70('0x14')](_0x106f32)){throw new Error(_0x252f07+_0x6e70('0x69'));}_0x39e6db=_0x106f32;return db[_0x252f07+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x48f6fd['body']['messageId']},'include':[{'model':db[_0x252f07+_0x6e70('0x6c')],'as':'Interaction'},{'model':db[_0x252f07+_0x51be27],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x28e5b1){if(_[_0x6e70('0x14')](_0x28e5b1)){throw new Error(_0x252f07+'\x20Message\x20not\x20found');}_0x53acc8=_0x28e5b1;return _0x28e5b1[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x260dfa={'uniqueid':_0x461ec0+'.'+_0x53acc8['id']+'.'+_0x53acc8[_0x6e70('0x6c')]['id'],'FromUserId':_0x48f6fd[_0x6e70('0x31')]['id'],'type':_0x6e70('0x6f')};_0x260dfa[_0x252f07+_0x6e70('0x70')]=_0x53acc8['id'];_0x260dfa[_0x252f07+_0x6e70('0x71')]=_0x53acc8[_0x6e70('0x6c')]['id'];_0x260dfa['From'+_0x252f07+_0x51be27+'Id']=_0x53acc8[_0x6e70('0x6d')]['id'];_0x260dfa['To'+_0x252f07+'QueueId']=_0x39e6db['id'];return db[_0x252f07+_0x6e70('0x72')]['create'](_0x260dfa);})['then'](function(){return respondWithRpcPromise('Start',{'channel':_0x461ec0,'interaction':_0x53acc8[_0x6e70('0x6c')],'message':_0x53acc8,'account':_0x53acc8[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x6f'),'appdata':_0x39e6db[_0x6e70('0x12')]+','+(_0x53acc8[_0x6e70('0x6d')]['queueTransferTimeout']||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})[_0x6e70('0xa')](respondWithResult(_0x463eed,null))['catch'](handleError(_0x463eed,null));};};exports[_0x6e70('0x74')]=function(_0x50e494,_0x17d3a4){var _0x5d0585,_0x4a87e2;if(_[_0x6e70('0x14')](_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')])){throw new Error(_0x6e70('0x76'));}var _0x3e6661=_0x50e494[_0x6e70('0x21')][_0x6e70('0x75')];var _0x5c0276=_[_0x6e70('0x66')](_0x3e6661);var _0x4f4a16=_0x3e6661===_0x6e70('0x77')?_0x6e70('0x67'):_0x6e70('0x6d');return db[_0x6e70('0x78')][_0x6e70('0x6b')]({'raw':!![],'where':{'id':_0x50e494[_0x6e70('0x1b')]['id'],'role':_0x6e70('0x3d')}})['then'](function(_0x4466f0){if(_['isNil'](_0x4466f0)){throw new Error(_0x6e70('0x79'));}_0x5d0585=_0x4466f0;return db[_0x5c0276+_0x6e70('0x6a')][_0x6e70('0x6b')]({'where':{'id':_0x50e494[_0x6e70('0x21')][_0x6e70('0x7a')]},'include':[{'model':db[_0x5c0276+_0x6e70('0x6c')],'as':_0x6e70('0x6c')},{'model':db[_0x5c0276+_0x4f4a16],'as':_0x6e70('0x6d')}]});})[_0x6e70('0xa')](function(_0x162bc3){if(_['isNil'](_0x162bc3)){throw new Error(_0x5c0276+_0x6e70('0x7b'));}_0x4a87e2=_0x162bc3;return _0x162bc3[_0x6e70('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6e70('0xa')](function(){var _0x181802={'uniqueid':_0x3e6661+'.'+_0x4a87e2['id']+'.'+_0x4a87e2[_0x6e70('0x6c')]['id'],'FromUserId':_0x50e494['user']['id'],'type':'agent','ToUserId':_0x5d0585['id']};_0x181802[_0x5c0276+'MessageId']=_0x4a87e2['id'];_0x181802[_0x5c0276+_0x6e70('0x71')]=_0x4a87e2[_0x6e70('0x6c')]['id'];_0x181802[_0x6e70('0x7c')+_0x5c0276+_0x4f4a16+'Id']=_0x4a87e2[_0x6e70('0x6d')]['id'];return db[_0x5c0276+_0x6e70('0x72')][_0x6e70('0x7d')](_0x181802);})[_0x6e70('0xa')](function(){return respondWithRpcPromise(_0x6e70('0x7e'),{'channel':_0x3e6661,'interaction':_0x4a87e2[_0x6e70('0x6c')],'message':_0x4a87e2,'account':_0x4a87e2[_0x6e70('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0x6e70('0x3d'),'appdata':_0x5d0585[_0x6e70('0x12')]+','+(_0x4a87e2[_0x6e70('0x6d')][_0x6e70('0x7f')]||0x12c),'interval':_0x6e70('0x73')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x17d3a4,null))[_0x6e70('0xf')](handleError(_0x17d3a4,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index f43781c..619810e 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 _0xccd2=['../../config/environment','get','isAuthenticated','index','/:id','show','run','post','put','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5608b0,_0x5d0a5f){var _0x265d25=function(_0x2f0822){while(--_0x2f0822){_0x5608b0['push'](_0x5608b0['shift']());}};_0x265d25(++_0x5d0a5f);}(_0xccd2,0x116));var _0x2ccd=function(_0x48e2f2,_0x1a92f1){_0x48e2f2=_0x48e2f2-0x0;var _0xe32dbb=_0xccd2[_0x48e2f2];return _0xe32dbb;};'use strict';var multer=require(_0x2ccd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2ccd('0x1'));var express=require(_0x2ccd('0x2'));var router=express[_0x2ccd('0x3')]();var fs_extra=require(_0x2ccd('0x4'));var auth=require(_0x2ccd('0x5'));var interaction=require(_0x2ccd('0x6'));var config=require(_0x2ccd('0x7'));var controller=require('./schedule.controller');router[_0x2ccd('0x8')]('/',auth[_0x2ccd('0x9')](),controller[_0x2ccd('0xa')]);router[_0x2ccd('0x8')](_0x2ccd('0xb'),auth[_0x2ccd('0x9')](),controller[_0x2ccd('0xc')]);router[_0x2ccd('0x8')]('/:id/run',auth[_0x2ccd('0x9')](),controller[_0x2ccd('0xd')]);router[_0x2ccd('0xe')]('/',auth[_0x2ccd('0x9')](),controller['create']);router[_0x2ccd('0xf')](_0x2ccd('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x2ccd('0x10')]('/:id',auth[_0x2ccd('0x9')](),controller[_0x2ccd('0x11')]);module[_0x2ccd('0x12')]=router; \ No newline at end of file +var _0x2a50=['delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','run'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2a50,0xa3));var _0x02a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a50[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x02a5('0x0'));var path=require(_0x02a5('0x1'));var timeout=require(_0x02a5('0x2'));var express=require(_0x02a5('0x3'));var router=express[_0x02a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x02a5('0x5'));var interaction=require(_0x02a5('0x6'));var config=require(_0x02a5('0x7'));var controller=require('./schedule.controller');router[_0x02a5('0x8')]('/',auth[_0x02a5('0x9')](),controller['index']);router[_0x02a5('0x8')](_0x02a5('0xa'),auth[_0x02a5('0x9')](),controller[_0x02a5('0xb')]);router[_0x02a5('0x8')]('/:id/run',auth['isAuthenticated'](),controller[_0x02a5('0xc')]);router['post']('/',auth[_0x02a5('0x9')](),controller['create']);router['put']('/:id',auth[_0x02a5('0x9')](),controller['update']);router[_0x02a5('0xd')]('/:id',auth[_0x02a5('0x9')](),controller[_0x02a5('0xe')]);module[_0x02a5('0xf')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 75ffaec..5db28cf 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 _0xecc2=['default','BOOLEAN','TEXT','sequelize','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','weeks','days','minutes','csv','xlsx','custom'];(function(_0xcc05ed,_0x44eb83){var _0x24a2f5=function(_0x37b8ea){while(--_0x37b8ea){_0xcc05ed['push'](_0xcc05ed['shift']());}};_0x24a2f5(++_0x44eb83);}(_0xecc2,0xe0));var _0x2ecc=function(_0x21065c,_0x23839c){_0x21065c=_0x21065c-0x0;var _0x3500c0=_0xecc2[_0x21065c];return _0x3500c0;};'use strict';var Sequelize=require(_0x2ecc('0x0'));module[_0x2ecc('0x1')]={'name':{'type':Sequelize[_0x2ecc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2ecc('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x2ecc('0x2')],'allowNull':![],'defaultValue':_0x2ecc('0x3')},'startAt':{'type':Sequelize[_0x2ecc('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x2ecc('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x2ecc('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x2ecc('0x6')](_0x2ecc('0x7'),'quarters','months',_0x2ecc('0x8'),_0x2ecc('0x9'),'hours',_0x2ecc('0xa')),'allowNull':![],'defaultValue':_0x2ecc('0x9')},'output':{'type':Sequelize[_0x2ecc('0x6')](_0x2ecc('0xb'),'pdf',_0x2ecc('0xc')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize['ENUM'](_0x2ecc('0xd'),_0x2ecc('0xe')),'allowNull':![],'defaultValue':_0x2ecc('0xd')},'sendMail':{'type':Sequelize[_0x2ecc('0xf')],'defaultValue':![]},'email':{'type':Sequelize[_0x2ecc('0x2')]},'cc':{'type':Sequelize[_0x2ecc('0x10')]},'bcc':{'type':Sequelize[_0x2ecc('0x10')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x04d0=['minutes','csv','xlsx','custom','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','days','hours'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x04d0,0x15b));var _0x004d=function(_0x57b223,_0x55e648){_0x57b223=_0x57b223-0x0;var _0x3697cb=_0x04d0[_0x57b223];return _0x3697cb;};'use strict';var Sequelize=require('sequelize');module[_0x004d('0x0')]={'name':{'type':Sequelize[_0x004d('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x004d('0x1')]},'active':{'type':Sequelize[_0x004d('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x004d('0x1')],'allowNull':![],'defaultValue':_0x004d('0x3')},'startAt':{'type':Sequelize[_0x004d('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x004d('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x004d('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x004d('0x6')](_0x004d('0x7'),_0x004d('0x8'),_0x004d('0x9'),_0x004d('0xa'),_0x004d('0xb'),_0x004d('0xc'),_0x004d('0xd')),'allowNull':![],'defaultValue':_0x004d('0xb')},'output':{'type':Sequelize['ENUM'](_0x004d('0xe'),'pdf',_0x004d('0xf')),'allowNull':![],'defaultValue':_0x004d('0xe')},'type':{'type':Sequelize[_0x004d('0x6')](_0x004d('0x10'),'default'),'allowNull':![],'defaultValue':_0x004d('0x10')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0x004d('0x1')]},'cc':{'type':Sequelize[_0x004d('0x11')]},'bcc':{'type':Sequelize[_0x004d('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x004d('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 6015cdb..32cb239 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 _0x045b=['undefined','limit','count','offset','set','Content-Range','json','apply','save','update','then','get','UserProfileResource','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filters','filter','merge','where','VIRTUAL','options','Schedule','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Scheduler','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','rimraf','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x51ed62,_0x574379){var _0x34aee3=function(_0x2958bc){while(--_0x2958bc){_0x51ed62['push'](_0x51ed62['shift']());}};_0x34aee3(++_0x574379);}(_0x045b,0x95));var _0xb045=function(_0x55c00d,_0x520cb6){_0x55c00d=_0x55c00d-0x0;var _0x254a8f=_0x045b[_0x55c00d];return _0x254a8f;};'use strict';var emlformat=require(_0xb045('0x0'));var rimraf=require(_0xb045('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb045('0x2'));var BPromise=require(_0xb045('0x3'));var Mustache=require(_0xb045('0x4'));var util=require(_0xb045('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xb045('0x6'));var ejs=require(_0xb045('0x7'));var fs=require('fs');var fs_extra=require(_0xb045('0x8'));var _=require(_0xb045('0x9'));var squel=require(_0xb045('0xa'));var crypto=require(_0xb045('0xb'));var jsforce=require(_0xb045('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb045('0x6'));var querystring=require(_0xb045('0xd'));var Papa=require(_0xb045('0xe'));var Redis=require(_0xb045('0xf'));var authService=require(_0xb045('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb045('0x11'));var hardwareService=require(_0xb045('0x12'));var logger=require(_0xb045('0x13'))(_0xb045('0x14'));var utils=require(_0xb045('0x15'));var config=require(_0xb045('0x16'));var licenseUtil=require(_0xb045('0x17'));var db=require(_0xb045('0x18'))['db'];function respondWithStatusCode(_0x1a8a5a,_0x5b22de){_0x5b22de=_0x5b22de||0xcc;return function(_0x208ca9){if(_0x208ca9){return _0x1a8a5a[_0xb045('0x19')](_0x5b22de);}return _0x1a8a5a[_0xb045('0x1a')](_0x5b22de)['end']();};}function respondWithResult(_0xe7ed32,_0x451841){_0x451841=_0x451841||0xc8;return function(_0xa8e1c2){if(_0xa8e1c2){return _0xe7ed32[_0xb045('0x1a')](_0x451841)['json'](_0xa8e1c2);}};}function respondWithFilteredResult(_0x4eb6d0,_0x487627){return function(_0x2e70f6){if(_0x2e70f6){var _0x3451e9=typeof _0x487627['offset']===_0xb045('0x1b')&&typeof _0x487627[_0xb045('0x1c')]===_0xb045('0x1b');var _0x5b28f3=_0x2e70f6[_0xb045('0x1d')];var _0x4a1b22=_0x3451e9?0x0:_0x487627[_0xb045('0x1e')];var _0x39856b=_0x3451e9?_0x2e70f6['count']:_0x487627[_0xb045('0x1e')]+_0x487627[_0xb045('0x1c')];var _0x5df044;if(_0x39856b>=_0x5b28f3){_0x39856b=_0x5b28f3;_0x5df044=0xc8;}else{_0x5df044=0xce;}_0x4eb6d0[_0xb045('0x1a')](_0x5df044);return _0x4eb6d0[_0xb045('0x1f')](_0xb045('0x20'),_0x4a1b22+'-'+_0x39856b+'/'+_0x5b28f3)[_0xb045('0x21')](_0x2e70f6);}return null;};}function patchUpdates(_0x1f1d0b){return function(_0x32d955){try{jsonpatch[_0xb045('0x22')](_0x32d955,_0x1f1d0b,!![]);}catch(_0x34d9bd){return BPromise['reject'](_0x34d9bd);}return _0x32d955[_0xb045('0x23')]();};}function saveUpdates(_0x3ae598,_0x514712){return function(_0x30cc92){if(_0x30cc92){return _0x30cc92[_0xb045('0x24')](_0x3ae598)['then'](function(_0x119c08){return _0x119c08;});}return null;};}function removeEntity(_0x2615d2,_0x9fb9a0){return function(_0x3a6b09){if(_0x3a6b09){return _0x3a6b09['destroy']()[_0xb045('0x25')](function(){var _0x53e398=_0x3a6b09[_0xb045('0x26')]({'plain':!![]});var _0x4adf43='Scheduler';return db[_0xb045('0x27')][_0xb045('0x28')]({'where':{'type':_0x4adf43,'resourceId':_0x53e398['id']}})[_0xb045('0x25')](function(){return _0x3a6b09;});})[_0xb045('0x25')](function(){_0x2615d2[_0xb045('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c3da1,_0x56e4b6){return function(_0x4501c0){if(!_0x4501c0){_0x3c3da1[_0xb045('0x19')](0x194);}return _0x4501c0;};}function handleError(_0x1b711f,_0x1fdd94){_0x1fdd94=_0x1fdd94||0x1f4;return function(_0x296278){logger[_0xb045('0x29')](_0x296278['stack']);if(_0x296278[_0xb045('0x2a')]){delete _0x296278[_0xb045('0x2a')];}_0x1b711f[_0xb045('0x1a')](_0x1fdd94)[_0xb045('0x2b')](_0x296278);};}exports[_0xb045('0x2c')]=function(_0x253aad,_0x225ac4){var _0x323e49={},_0xfabd8b={},_0x301ebd={'count':0x0,'rows':[]};var _0x1fb7f1=_[_0xb045('0x2d')](db['Schedule'][_0xb045('0x2e')],function(_0x5095c4){return{'name':_0x5095c4[_0xb045('0x2f')],'type':_0x5095c4[_0xb045('0x30')][_0xb045('0x31')]};});_0xfabd8b[_0xb045('0x32')]=_[_0xb045('0x2d')](_0x1fb7f1,'name');_0xfabd8b[_0xb045('0x33')]=_[_0xb045('0x34')](_0x253aad[_0xb045('0x33')]);_0xfabd8b['filters']=_[_0xb045('0x35')](_0xfabd8b[_0xb045('0x32')],_0xfabd8b[_0xb045('0x33')]);_0x323e49[_0xb045('0x36')]=_[_0xb045('0x35')](_0xfabd8b[_0xb045('0x32')],qs['fields'](_0x253aad[_0xb045('0x33')][_0xb045('0x37')]));_0x323e49['attributes']=_0x323e49[_0xb045('0x36')]['length']?_0x323e49['attributes']:_0xfabd8b['model'];if(!_0x253aad[_0xb045('0x33')][_0xb045('0x38')](_0xb045('0x39'))){_0x323e49['limit']=qs[_0xb045('0x1c')](_0x253aad[_0xb045('0x33')]['limit']);_0x323e49[_0xb045('0x1e')]=qs['offset'](_0x253aad[_0xb045('0x33')][_0xb045('0x1e')]);}_0x323e49[_0xb045('0x3a')]=qs[_0xb045('0x3b')](_0x253aad[_0xb045('0x33')][_0xb045('0x3b')]);_0x323e49['where']=qs['filters'](_[_0xb045('0x3c')](_0x253aad[_0xb045('0x33')],_0xfabd8b[_0xb045('0x3d')]),_0x1fb7f1);if(_0x253aad['query'][_0xb045('0x3e')]){_0x323e49['where']=_[_0xb045('0x3f')](_0x323e49[_0xb045('0x40')],{'$or':_[_0xb045('0x2d')](_0x1fb7f1,function(_0x2ea78b){if(_0x2ea78b[_0xb045('0x30')]!==_0xb045('0x41')){var _0x414e70={};_0x414e70[_0x2ea78b[_0xb045('0x2a')]]={'$like':'%'+_0x253aad[_0xb045('0x33')]['filter']+'%'};return _0x414e70;}})});}_0x323e49=_[_0xb045('0x3f')]({},_0x323e49,_0x253aad[_0xb045('0x42')]);var _0x4d5c68={'where':_0x323e49['where']};return db[_0xb045('0x43')][_0xb045('0x1d')](_0x4d5c68)[_0xb045('0x25')](function(_0x3c5831){_0x301ebd[_0xb045('0x1d')]=_0x3c5831;if(_0x253aad['query'][_0xb045('0x44')]){_0x323e49[_0xb045('0x45')]=[{'all':!![]}];}return db['Schedule'][_0xb045('0x46')](_0x323e49);})[_0xb045('0x25')](function(_0x565993){_0x301ebd[_0xb045('0x47')]=_0x565993;return _0x301ebd;})[_0xb045('0x25')](respondWithFilteredResult(_0x225ac4,_0x323e49))[_0xb045('0x48')](handleError(_0x225ac4,null));};exports[_0xb045('0x49')]=function(_0x315824,_0x4a52f9){var _0x3bf1ac={'raw':![],'where':{'id':_0x315824[_0xb045('0x4a')]['id']}},_0x15034e={};_0x15034e['model']=_[_0xb045('0x34')](db['Schedule']['rawAttributes']);_0x15034e[_0xb045('0x33')]=_[_0xb045('0x34')](_0x315824[_0xb045('0x33')]);_0x15034e['filters']=_[_0xb045('0x35')](_0x15034e[_0xb045('0x32')],_0x15034e[_0xb045('0x33')]);_0x3bf1ac[_0xb045('0x36')]=_[_0xb045('0x35')](_0x15034e[_0xb045('0x32')],qs[_0xb045('0x37')](_0x315824[_0xb045('0x33')][_0xb045('0x37')]));_0x3bf1ac[_0xb045('0x36')]=_0x3bf1ac[_0xb045('0x36')][_0xb045('0x4b')]?_0x3bf1ac[_0xb045('0x36')]:_0x15034e[_0xb045('0x32')];if(_0x315824[_0xb045('0x33')][_0xb045('0x44')]){_0x3bf1ac[_0xb045('0x45')]=[{'all':!![]}];}_0x3bf1ac=_[_0xb045('0x3f')]({},_0x3bf1ac,_0x315824[_0xb045('0x42')]);return db[_0xb045('0x43')][_0xb045('0x4c')](_0x3bf1ac)[_0xb045('0x25')](handleEntityNotFound(_0x4a52f9,null))[_0xb045('0x25')](respondWithResult(_0x4a52f9,null))[_0xb045('0x48')](handleError(_0x4a52f9,null));};exports['create']=function(_0x568b46,_0x542bd9){return db[_0xb045('0x43')][_0xb045('0x4d')](_0x568b46[_0xb045('0x4e')],{})['then'](function(_0x5ac261){var _0x1492a6=_0x568b46['user'][_0xb045('0x26')]({'plain':!![]});if(!_0x1492a6)throw new Error(_0xb045('0x4f'));if(_0x1492a6['role']===_0xb045('0x50')){var _0x51d53e=_0x5ac261[_0xb045('0x26')]({'plain':!![]});var _0x14d464=_0xb045('0x51');return db[_0xb045('0x52')][_0xb045('0x4c')]({'where':{'name':_0x14d464,'userProfileId':_0x1492a6[_0xb045('0x53')]},'raw':!![]})[_0xb045('0x25')](function(_0x286f62){if(_0x286f62&&_0x286f62[_0xb045('0x54')]===0x0){return db['UserProfileResource'][_0xb045('0x4d')]({'name':_0x51d53e[_0xb045('0x2a')],'resourceId':_0x51d53e['id'],'type':_0x286f62[_0xb045('0x2a')],'sectionId':_0x286f62['id']},{})['then'](function(){return _0x5ac261;});}else{return _0x5ac261;}})[_0xb045('0x48')](function(_0x1a36b5){logger[_0xb045('0x29')](_0xb045('0x55'),_0x1a36b5);throw _0x1a36b5;});}return _0x5ac261;})[_0xb045('0x25')](respondWithResult(_0x542bd9,0xc9))[_0xb045('0x48')](handleError(_0x542bd9,null));};exports[_0xb045('0x24')]=function(_0x328e0f,_0x53f733){if(_0x328e0f['body']['id']){delete _0x328e0f[_0xb045('0x4e')]['id'];}return db['Schedule'][_0xb045('0x4c')]({'where':{'id':_0x328e0f[_0xb045('0x4a')]['id']}})['then'](handleEntityNotFound(_0x53f733,null))['then'](saveUpdates(_0x328e0f[_0xb045('0x4e')],null))[_0xb045('0x25')](respondWithResult(_0x53f733,null))[_0xb045('0x48')](handleError(_0x53f733,null));};exports[_0xb045('0x28')]=function(_0x172da9,_0x1a791d){return db['Schedule'][_0xb045('0x4c')]({'where':{'id':_0x172da9[_0xb045('0x4a')]['id']}})[_0xb045('0x25')](handleEntityNotFound(_0x1a791d,null))[_0xb045('0x25')](removeEntity(_0x1a791d,null))[_0xb045('0x48')](handleError(_0x1a791d,null));};exports[_0xb045('0x56')]=function(_0x2481b7,_0x2626ce,_0x5d10f7){var _0xfc3d51=require(_0xb045('0x57'));return db[_0xb045('0x43')]['find']({'where':{'id':_0x2481b7['params']['id']},'raw':!![]})[_0xb045('0x25')](handleEntityNotFound(_0x2626ce,null))[_0xb045('0x25')](function(){_0xfc3d51['run'](_0x2481b7[_0xb045('0x4a')]['id']);})[_0xb045('0x25')](respondWithStatusCode(_0x2626ce,null))['catch'](handleError(_0x2626ce,null));}; \ No newline at end of file +var _0x0b5f=['rawAttributes','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','params','run','../../config/schedule','eml-format','fast-json-patch','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','then','Scheduler','UserProfileResource','end','sendStatus','error','name','send','index','map','Schedule','fieldName','type','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show'];(function(_0x1b0f15,_0x271b0f){var _0x30f9dd=function(_0x47eba7){while(--_0x47eba7){_0x1b0f15['push'](_0x1b0f15['shift']());}};_0x30f9dd(++_0x271b0f);}(_0x0b5f,0x152));var _0xf0b5=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0b5f[_0x3bf83f];return _0x22c4a9;};'use strict';var emlformat=require(_0xf0b5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf0b5('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf0b5('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf0b5('0x3'));var sox=require(_0xf0b5('0x4'));var csv=require(_0xf0b5('0x5'));var ejs=require(_0xf0b5('0x6'));var fs=require('fs');var fs_extra=require(_0xf0b5('0x7'));var _=require(_0xf0b5('0x8'));var squel=require(_0xf0b5('0x9'));var crypto=require(_0xf0b5('0xa'));var jsforce=require(_0xf0b5('0xb'));var deskjs=require(_0xf0b5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf0b5('0xd'));var Papa=require('papaparse');var Redis=require(_0xf0b5('0xe'));var authService=require(_0xf0b5('0xf'));var qs=require(_0xf0b5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf0b5('0x11'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf0b5('0x12'));var licenseUtil=require(_0xf0b5('0x13'));var db=require(_0xf0b5('0x14'))['db'];function respondWithStatusCode(_0x1ea6cd,_0x62ddc6){_0x62ddc6=_0x62ddc6||0xcc;return function(_0x4bf9f3){if(_0x4bf9f3){return _0x1ea6cd['sendStatus'](_0x62ddc6);}return _0x1ea6cd[_0xf0b5('0x15')](_0x62ddc6)['end']();};}function respondWithResult(_0xf6f298,_0x56266a){_0x56266a=_0x56266a||0xc8;return function(_0x36a646){if(_0x36a646){return _0xf6f298['status'](_0x56266a)[_0xf0b5('0x16')](_0x36a646);}};}function respondWithFilteredResult(_0x4e0ab4,_0x5b160e){return function(_0x3d7801){if(_0x3d7801){var _0x10f82b=typeof _0x5b160e['offset']===_0xf0b5('0x17')&&typeof _0x5b160e[_0xf0b5('0x18')]===_0xf0b5('0x17');var _0x2b0b02=_0x3d7801[_0xf0b5('0x19')];var _0x629de1=_0x10f82b?0x0:_0x5b160e[_0xf0b5('0x1a')];var _0x5e681b=_0x10f82b?_0x3d7801[_0xf0b5('0x19')]:_0x5b160e[_0xf0b5('0x1a')]+_0x5b160e[_0xf0b5('0x18')];var _0x4ab47e;if(_0x5e681b>=_0x2b0b02){_0x5e681b=_0x2b0b02;_0x4ab47e=0xc8;}else{_0x4ab47e=0xce;}_0x4e0ab4[_0xf0b5('0x15')](_0x4ab47e);return _0x4e0ab4[_0xf0b5('0x1b')](_0xf0b5('0x1c'),_0x629de1+'-'+_0x5e681b+'/'+_0x2b0b02)[_0xf0b5('0x16')](_0x3d7801);}return null;};}function patchUpdates(_0x3a32ba){return function(_0xc2ee59){try{jsonpatch['apply'](_0xc2ee59,_0x3a32ba,!![]);}catch(_0x54187c){return BPromise[_0xf0b5('0x1d')](_0x54187c);}return _0xc2ee59[_0xf0b5('0x1e')]();};}function saveUpdates(_0xe56d8e,_0x735ee5){return function(_0x202091){if(_0x202091){return _0x202091[_0xf0b5('0x1f')](_0xe56d8e)['then'](function(_0x4fc803){return _0x4fc803;});}return null;};}function removeEntity(_0x262efc,_0x45169f){return function(_0x2d2420){if(_0x2d2420){return _0x2d2420[_0xf0b5('0x20')]()[_0xf0b5('0x21')](function(){var _0x52cc00=_0x2d2420['get']({'plain':!![]});var _0x5622de=_0xf0b5('0x22');return db[_0xf0b5('0x23')][_0xf0b5('0x20')]({'where':{'type':_0x5622de,'resourceId':_0x52cc00['id']}})[_0xf0b5('0x21')](function(){return _0x2d2420;});})['then'](function(){_0x262efc[_0xf0b5('0x15')](0xcc)[_0xf0b5('0x24')]();});}};}function handleEntityNotFound(_0x2e7a24,_0x42f504){return function(_0x32ec53){if(!_0x32ec53){_0x2e7a24[_0xf0b5('0x25')](0x194);}return _0x32ec53;};}function handleError(_0x51c827,_0xe0a30f){_0xe0a30f=_0xe0a30f||0x1f4;return function(_0x2e0c0c){logger[_0xf0b5('0x26')](_0x2e0c0c['stack']);if(_0x2e0c0c[_0xf0b5('0x27')]){delete _0x2e0c0c['name'];}_0x51c827[_0xf0b5('0x15')](_0xe0a30f)[_0xf0b5('0x28')](_0x2e0c0c);};}exports[_0xf0b5('0x29')]=function(_0x1afc52,_0xdcb3ae){var _0xb5fe54={},_0x5c7b11={},_0x53ed7e={'count':0x0,'rows':[]};var _0x3018d0=_[_0xf0b5('0x2a')](db[_0xf0b5('0x2b')]['rawAttributes'],function(_0xd4efc5){return{'name':_0xd4efc5[_0xf0b5('0x2c')],'type':_0xd4efc5[_0xf0b5('0x2d')]['key']};});_0x5c7b11['model']=_[_0xf0b5('0x2a')](_0x3018d0,_0xf0b5('0x27'));_0x5c7b11[_0xf0b5('0x2e')]=_[_0xf0b5('0x2f')](_0x1afc52[_0xf0b5('0x2e')]);_0x5c7b11['filters']=_[_0xf0b5('0x30')](_0x5c7b11['model'],_0x5c7b11[_0xf0b5('0x2e')]);_0xb5fe54['attributes']=_[_0xf0b5('0x30')](_0x5c7b11[_0xf0b5('0x31')],qs[_0xf0b5('0x32')](_0x1afc52[_0xf0b5('0x2e')][_0xf0b5('0x32')]));_0xb5fe54[_0xf0b5('0x33')]=_0xb5fe54['attributes']['length']?_0xb5fe54[_0xf0b5('0x33')]:_0x5c7b11[_0xf0b5('0x31')];if(!_0x1afc52[_0xf0b5('0x2e')][_0xf0b5('0x34')](_0xf0b5('0x35'))){_0xb5fe54['limit']=qs[_0xf0b5('0x18')](_0x1afc52['query']['limit']);_0xb5fe54[_0xf0b5('0x1a')]=qs[_0xf0b5('0x1a')](_0x1afc52[_0xf0b5('0x2e')][_0xf0b5('0x1a')]);}_0xb5fe54[_0xf0b5('0x36')]=qs[_0xf0b5('0x37')](_0x1afc52[_0xf0b5('0x2e')][_0xf0b5('0x37')]);_0xb5fe54['where']=qs[_0xf0b5('0x38')](_[_0xf0b5('0x39')](_0x1afc52['query'],_0x5c7b11[_0xf0b5('0x38')]),_0x3018d0);if(_0x1afc52[_0xf0b5('0x2e')]['filter']){_0xb5fe54[_0xf0b5('0x3a')]=_[_0xf0b5('0x3b')](_0xb5fe54[_0xf0b5('0x3a')],{'$or':_[_0xf0b5('0x2a')](_0x3018d0,function(_0x5502f2){if(_0x5502f2[_0xf0b5('0x2d')]!==_0xf0b5('0x3c')){var _0x122392={};_0x122392[_0x5502f2['name']]={'$like':'%'+_0x1afc52[_0xf0b5('0x2e')]['filter']+'%'};return _0x122392;}})});}_0xb5fe54=_[_0xf0b5('0x3b')]({},_0xb5fe54,_0x1afc52[_0xf0b5('0x3d')]);var _0x2b63ff={'where':_0xb5fe54[_0xf0b5('0x3a')]};return db['Schedule']['count'](_0x2b63ff)[_0xf0b5('0x21')](function(_0x4ae35d){_0x53ed7e[_0xf0b5('0x19')]=_0x4ae35d;if(_0x1afc52['query'][_0xf0b5('0x3e')]){_0xb5fe54[_0xf0b5('0x3f')]=[{'all':!![]}];}return db[_0xf0b5('0x2b')]['findAll'](_0xb5fe54);})[_0xf0b5('0x21')](function(_0x212765){_0x53ed7e[_0xf0b5('0x40')]=_0x212765;return _0x53ed7e;})[_0xf0b5('0x21')](respondWithFilteredResult(_0xdcb3ae,_0xb5fe54))[_0xf0b5('0x41')](handleError(_0xdcb3ae,null));};exports[_0xf0b5('0x42')]=function(_0xe4215a,_0x46b3a2){var _0x12bf21={'raw':![],'where':{'id':_0xe4215a['params']['id']}},_0x325158={};_0x325158[_0xf0b5('0x31')]=_[_0xf0b5('0x2f')](db[_0xf0b5('0x2b')][_0xf0b5('0x43')]);_0x325158[_0xf0b5('0x2e')]=_[_0xf0b5('0x2f')](_0xe4215a[_0xf0b5('0x2e')]);_0x325158[_0xf0b5('0x38')]=_[_0xf0b5('0x30')](_0x325158['model'],_0x325158['query']);_0x12bf21[_0xf0b5('0x33')]=_[_0xf0b5('0x30')](_0x325158['model'],qs[_0xf0b5('0x32')](_0xe4215a[_0xf0b5('0x2e')][_0xf0b5('0x32')]));_0x12bf21[_0xf0b5('0x33')]=_0x12bf21[_0xf0b5('0x33')][_0xf0b5('0x44')]?_0x12bf21[_0xf0b5('0x33')]:_0x325158[_0xf0b5('0x31')];if(_0xe4215a[_0xf0b5('0x2e')][_0xf0b5('0x3e')]){_0x12bf21[_0xf0b5('0x3f')]=[{'all':!![]}];}_0x12bf21=_[_0xf0b5('0x3b')]({},_0x12bf21,_0xe4215a['options']);return db[_0xf0b5('0x2b')][_0xf0b5('0x45')](_0x12bf21)[_0xf0b5('0x21')](handleEntityNotFound(_0x46b3a2,null))[_0xf0b5('0x21')](respondWithResult(_0x46b3a2,null))[_0xf0b5('0x41')](handleError(_0x46b3a2,null));};exports[_0xf0b5('0x46')]=function(_0x535f8b,_0x1183a0){return db[_0xf0b5('0x2b')][_0xf0b5('0x46')](_0x535f8b[_0xf0b5('0x47')],{})[_0xf0b5('0x21')](function(_0x964a4c){var _0x1d2970=_0x535f8b['user'][_0xf0b5('0x48')]({'plain':!![]});if(!_0x1d2970)throw new Error(_0xf0b5('0x49'));if(_0x1d2970[_0xf0b5('0x4a')]===_0xf0b5('0x4b')){var _0x5122e1=_0x964a4c['get']({'plain':!![]});var _0xfae707=_0xf0b5('0x22');return db['UserProfileSection'][_0xf0b5('0x45')]({'where':{'name':_0xfae707,'userProfileId':_0x1d2970[_0xf0b5('0x4c')]},'raw':!![]})['then'](function(_0x5079e3){if(_0x5079e3&&_0x5079e3[_0xf0b5('0x4d')]===0x0){return db[_0xf0b5('0x23')][_0xf0b5('0x46')]({'name':_0x5122e1[_0xf0b5('0x27')],'resourceId':_0x5122e1['id'],'type':_0x5079e3[_0xf0b5('0x27')],'sectionId':_0x5079e3['id']},{})[_0xf0b5('0x21')](function(){return _0x964a4c;});}else{return _0x964a4c;}})[_0xf0b5('0x41')](function(_0x16d7fd){logger[_0xf0b5('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x16d7fd);throw _0x16d7fd;});}return _0x964a4c;})[_0xf0b5('0x21')](respondWithResult(_0x1183a0,0xc9))[_0xf0b5('0x41')](handleError(_0x1183a0,null));};exports['update']=function(_0x562be3,_0x301e07){if(_0x562be3[_0xf0b5('0x47')]['id']){delete _0x562be3[_0xf0b5('0x47')]['id'];}return db[_0xf0b5('0x2b')]['find']({'where':{'id':_0x562be3[_0xf0b5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x301e07,null))[_0xf0b5('0x21')](saveUpdates(_0x562be3[_0xf0b5('0x47')],null))[_0xf0b5('0x21')](respondWithResult(_0x301e07,null))['catch'](handleError(_0x301e07,null));};exports[_0xf0b5('0x20')]=function(_0x5531e6,_0xd0f7b4){return db[_0xf0b5('0x2b')][_0xf0b5('0x45')]({'where':{'id':_0x5531e6[_0xf0b5('0x4e')]['id']}})['then'](handleEntityNotFound(_0xd0f7b4,null))[_0xf0b5('0x21')](removeEntity(_0xd0f7b4,null))[_0xf0b5('0x41')](handleError(_0xd0f7b4,null));};exports[_0xf0b5('0x4f')]=function(_0x21dffb,_0x18770d,_0x4ac2c8){var _0x260918=require(_0xf0b5('0x50'));return db[_0xf0b5('0x2b')]['find']({'where':{'id':_0x21dffb['params']['id']},'raw':!![]})[_0xf0b5('0x21')](handleEntityNotFound(_0x18770d,null))['then'](function(){_0x260918[_0xf0b5('0x4f')](_0x21dffb['params']['id']);})[_0xf0b5('0x21')](respondWithStatusCode(_0x18770d,null))['catch'](handleError(_0x18770d,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index d0d8bfc..ecc97ca 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 _0xc0c2=['../../config/environment','exports','Schedule','tools_schedules','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0xc0c2,0x9e));var _0x2c0c=function(_0x1d0d23,_0x43e210){_0x1d0d23=_0x1d0d23-0x0;var _0x2d295b=_0xc0c2[_0x1d0d23];return _0x2d295b;};'use strict';var _=require(_0x2c0c('0x0'));var util=require('util');var logger=require(_0x2c0c('0x1'))(_0x2c0c('0x2'));var moment=require(_0x2c0c('0x3'));var BPromise=require(_0x2c0c('0x4'));var rp=require(_0x2c0c('0x5'));var fs=require('fs');var path=require(_0x2c0c('0x6'));var rimraf=require('rimraf');var config=require(_0x2c0c('0x7'));var attributes=require('./schedule.attributes');module[_0x2c0c('0x8')]=function(_0x34539b,_0x30fc2){return _0x34539b['define'](_0x2c0c('0x9'),attributes,{'tableName':_0x2c0c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3903=['request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define','tools_schedules','lodash','../../config/logger','api','moment','bluebird'];(function(_0x7de33e,_0x46a873){var _0x9b0f8=function(_0x264f7f){while(--_0x264f7f){_0x7de33e['push'](_0x7de33e['shift']());}};_0x9b0f8(++_0x46a873);}(_0x3903,0x1a8));var _0x3390=function(_0x4f3d89,_0x174445){_0x4f3d89=_0x4f3d89-0x0;var _0x59f05b=_0x3903[_0x4f3d89];return _0x59f05b;};'use strict';var _=require(_0x3390('0x0'));var util=require('util');var logger=require(_0x3390('0x1'))(_0x3390('0x2'));var moment=require(_0x3390('0x3'));var BPromise=require(_0x3390('0x4'));var rp=require(_0x3390('0x5'));var fs=require('fs');var path=require(_0x3390('0x6'));var rimraf=require(_0x3390('0x7'));var config=require(_0x3390('0x8'));var attributes=require(_0x3390('0x9'));module[_0x3390('0xa')]=function(_0x33c95e,_0x3b3319){return _0x33c95e[_0x3390('0xb')]('Schedule',attributes,{'tableName':_0x3390('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 92b4f72..658fc4d 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 _0x4dca=['catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','Schedule,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x1c0991,_0x4f22d2){var _0x5034de=function(_0x520f49){while(--_0x520f49){_0x1c0991['push'](_0x1c0991['shift']());}};_0x5034de(++_0x4f22d2);}(_0x4dca,0x1ef));var _0xa4dc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4dca[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa4dc('0x0'));var BPromise=require(_0xa4dc('0x1'));var rs=require(_0xa4dc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa4dc('0x3'))['db'];var utils=require(_0xa4dc('0x4'));var logger=require('../../config/logger')(_0xa4dc('0x5'));var config=require(_0xa4dc('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xa4dc('0x7')][_0xa4dc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d1ddb,_0x384b3e,_0x599318){return new BPromise(function(_0x114711,_0x1d8c05){return client['request'](_0x5d1ddb,_0x599318)[_0xa4dc('0x9')](function(_0xa84ea7){logger[_0xa4dc('0xa')](_0xa4dc('0xb'),_0x384b3e,_0xa4dc('0xc'));logger['debug']('Schedule,\x20%s,\x20%s,\x20%s',_0x384b3e,_0xa4dc('0xc'),JSON[_0xa4dc('0xd')](_0xa84ea7));if(_0xa84ea7[_0xa4dc('0xe')]){if(_0xa84ea7[_0xa4dc('0xe')][_0xa4dc('0xf')]===0x1f4){logger[_0xa4dc('0xe')](_0xa4dc('0xb'),_0x384b3e,_0xa84ea7[_0xa4dc('0xe')][_0xa4dc('0x10')]);return _0x1d8c05(_0xa84ea7[_0xa4dc('0xe')][_0xa4dc('0x10')]);}logger[_0xa4dc('0xe')](_0xa4dc('0xb'),_0x384b3e,_0xa84ea7['error'][_0xa4dc('0x10')]);return _0x114711(_0xa84ea7[_0xa4dc('0xe')][_0xa4dc('0x10')]);}else{logger['info'](_0xa4dc('0xb'),_0x384b3e,_0xa4dc('0xc'));_0x114711(_0xa84ea7[_0xa4dc('0x11')][_0xa4dc('0x10')]);}})[_0xa4dc('0x12')](function(_0x2d83c7){logger[_0xa4dc('0xe')](_0xa4dc('0xb'),_0x384b3e,_0x2d83c7);_0x1d8c05(_0x2d83c7);});});} \ No newline at end of file +var _0x0aa6=['catch','lodash','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','Schedule,\x20%s,\x20%s','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0aa6,0x190));var _0x60aa=function(_0x54a2d4,_0x18815d){_0x54a2d4=_0x54a2d4-0x0;var _0x59d881=_0x0aa6[_0x54a2d4];return _0x59d881;};'use strict';var _=require(_0x60aa('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x60aa('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x60aa('0x2'));var db=require(_0x60aa('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x60aa('0x4'));var config=require(_0x60aa('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x60aa('0x6')][_0x60aa('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x588de1,_0x32c23b,_0x4f46a7){return new BPromise(function(_0x35dddf,_0x5289d0){return client[_0x60aa('0x8')](_0x588de1,_0x4f46a7)[_0x60aa('0x9')](function(_0x168f21){logger[_0x60aa('0xa')]('Schedule,\x20%s,\x20%s',_0x32c23b,_0x60aa('0xb'));logger['debug'](_0x60aa('0xc'),_0x32c23b,_0x60aa('0xb'),JSON[_0x60aa('0xd')](_0x168f21));if(_0x168f21[_0x60aa('0xe')]){if(_0x168f21[_0x60aa('0xe')][_0x60aa('0xf')]===0x1f4){logger[_0x60aa('0xe')](_0x60aa('0x10'),_0x32c23b,_0x168f21[_0x60aa('0xe')][_0x60aa('0x11')]);return _0x5289d0(_0x168f21[_0x60aa('0xe')][_0x60aa('0x11')]);}logger['error'](_0x60aa('0x10'),_0x32c23b,_0x168f21[_0x60aa('0xe')][_0x60aa('0x11')]);return _0x35dddf(_0x168f21[_0x60aa('0xe')][_0x60aa('0x11')]);}else{logger[_0x60aa('0xa')]('Schedule,\x20%s,\x20%s',_0x32c23b,_0x60aa('0xb'));_0x35dddf(_0x168f21['result'][_0x60aa('0x11')]);}})[_0x60aa('0x12')](function(_0x1e2cb8){logger[_0x60aa('0xe')](_0x60aa('0x10'),_0x32c23b,_0x1e2cb8);_0x5289d0(_0x1e2cb8);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 08ad4fd..c8e9298 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 _0x87dc=['put','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','isAuthenticated','describe','get','/:id','/:id/download','download','post','create'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x87dc,0xc2));var _0xc87d=function(_0x386492,_0x2d3405){_0x386492=_0x386492-0x0;var _0x1d4f58=_0x87dc[_0x386492];return _0x1d4f58;};'use strict';var multer=require('multer');var util=require(_0xc87d('0x0'));var path=require(_0xc87d('0x1'));var timeout=require('connect-timeout');var express=require(_0xc87d('0x2'));var router=express[_0xc87d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc87d('0x4'));var interaction=require(_0xc87d('0x5'));var config=require('../../config/environment');var controller=require(_0xc87d('0x6'));router['get']('/',auth[_0xc87d('0x7')](),controller['index']);router['get']('/describe',auth[_0xc87d('0x7')](),controller[_0xc87d('0x8')]);router[_0xc87d('0x9')](_0xc87d('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xc87d('0x9')](_0xc87d('0xb'),auth[_0xc87d('0x7')](),controller[_0xc87d('0xc')]);router[_0xc87d('0xd')]('/',auth[_0xc87d('0x7')](),controller[_0xc87d('0xe')]);router[_0xc87d('0xf')](_0xc87d('0xa'),auth[_0xc87d('0x7')](),controller['update']);router[_0xc87d('0x10')](_0xc87d('0xa'),auth[_0xc87d('0x7')](),controller[_0xc87d('0x11')]);module[_0xc87d('0x12')]=router; \ No newline at end of file +var _0x8fe5=['post','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/download'];(function(_0x3295d0,_0x120dbe){var _0x4b5400=function(_0x540861){while(--_0x540861){_0x3295d0['push'](_0x3295d0['shift']());}};_0x4b5400(++_0x120dbe);}(_0x8fe5,0xae));var _0x58fe=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8fe5[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x58fe('0x0'));var path=require(_0x58fe('0x1'));var timeout=require(_0x58fe('0x2'));var express=require(_0x58fe('0x3'));var router=express[_0x58fe('0x4')]();var fs_extra=require(_0x58fe('0x5'));var auth=require(_0x58fe('0x6'));var interaction=require(_0x58fe('0x7'));var config=require(_0x58fe('0x8'));var controller=require(_0x58fe('0x9'));router['get']('/',auth[_0x58fe('0xa')](),controller[_0x58fe('0xb')]);router[_0x58fe('0xc')](_0x58fe('0xd'),auth[_0x58fe('0xa')](),controller[_0x58fe('0xe')]);router[_0x58fe('0xc')](_0x58fe('0xf'),auth[_0x58fe('0xa')](),controller[_0x58fe('0x10')]);router[_0x58fe('0xc')](_0x58fe('0x11'),auth[_0x58fe('0xa')](),controller['download']);router[_0x58fe('0x12')]('/',auth[_0x58fe('0xa')](),controller['create']);router[_0x58fe('0x13')](_0x58fe('0xf'),auth[_0x58fe('0xa')](),controller[_0x58fe('0x14')]);router[_0x58fe('0x15')](_0x58fe('0xf'),auth['isAuthenticated'](),controller[_0x58fe('0x16')]);module[_0x58fe('0x17')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 135357c..1fa2aad 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 _0xafcd=['STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','DATE','format','MM-DD-YYYY\x20HH:mm','createdAt','updatedAt','toString','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','extname','value'];(function(_0x1ea300,_0x128218){var _0x894b27=function(_0x184afb){while(--_0x184afb){_0x1ea300['push'](_0x1ea300['shift']());}};_0x894b27(++_0x128218);}(_0xafcd,0x157));var _0xdafc=function(_0x28fbbf,_0x11f896){_0x28fbbf=_0x28fbbf-0x0;var _0x543af6=_0xafcd[_0x28fbbf];return _0x543af6;};'use strict';var Sequelize=require(_0xdafc('0x0'));var moment=require(_0xdafc('0x1'));var path=require(_0xdafc('0x2'));var config=require(_0xdafc('0x3'));module[_0xdafc('0x4')]={'format':{'type':Sequelize[_0xdafc('0x5')],'get':function(){return this[_0xdafc('0x6')]('value')?path[_0xdafc('0x7')](this[_0xdafc('0x6')](_0xdafc('0x8'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xdafc('0x9')]},'value':{'type':Sequelize[_0xdafc('0x9')],'set':function(_0x33adc9){var _0x52872c=_0x33adc9[_0xdafc('0xa')](/\\/g,'/');this[_0xdafc('0xb')](_0xdafc('0x8'),_0x52872c);}},'rating':{'type':Sequelize[_0xdafc('0xc')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xdafc('0xc')],'set':function(_0x241787){this[_0xdafc('0xb')](_0xdafc('0xd'),moment()[_0xdafc('0xe')](_0x241787,'ms'));this[_0xdafc('0xb')](_0xdafc('0xf'),moment());this['setDataValue']('duration',_0x241787);}},'startedAt':{'type':Sequelize[_0xdafc('0x10')],'get':function(){return moment(this[_0xdafc('0x6')](_0xdafc('0xd')))[_0xdafc('0x11')](_0xdafc('0x12'))['toString']();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue'](_0xdafc('0xf')))['format'](_0xdafc('0x12'))['toString']();}},'createdAt':{'type':Sequelize[_0xdafc('0x10')],'get':function(){return moment(this[_0xdafc('0x6')](_0xdafc('0x13')))[_0xdafc('0x11')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'updatedAt':{'type':Sequelize[_0xdafc('0x10')],'get':function(){return moment(this[_0xdafc('0x6')](_0xdafc('0x14')))['format']('MM-DD-YYYY\x20HH:mm')[_0xdafc('0x15')]();}}}; \ No newline at end of file +var _0x659c=['setDataValue','startedAt','subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','sequelize','../../config/environment','exports','getDataValue','value','STRING'];(function(_0xe0d64b,_0x5f0fef){var _0x480aed=function(_0x31a3ce){while(--_0x31a3ce){_0xe0d64b['push'](_0xe0d64b['shift']());}};_0x480aed(++_0x5f0fef);}(_0x659c,0x1aa));var _0xc659=function(_0x45c10a,_0x4b9090){_0x45c10a=_0x45c10a-0x0;var _0x3f680=_0x659c[_0x45c10a];return _0x3f680;};'use strict';var Sequelize=require(_0xc659('0x0'));var moment=require('moment');var path=require('path');var config=require(_0xc659('0x1'));module[_0xc659('0x2')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xc659('0x3')](_0xc659('0x4'))?path['extname'](this['getDataValue'](_0xc659('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0xc659('0x5')]},'channel':{'type':Sequelize[_0xc659('0x5')]},'value':{'type':Sequelize[_0xc659('0x5')],'set':function(_0x15e20b){var _0x33e9d9=_0x15e20b['replace'](/\\/g,'/');this['setDataValue'](_0xc659('0x4'),_0x33e9d9);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x4fadc2){this[_0xc659('0x6')](_0xc659('0x7'),moment()[_0xc659('0x8')](_0x4fadc2,'ms'));this[_0xc659('0x6')](_0xc659('0x9'),moment());this[_0xc659('0x6')](_0xc659('0xa'),_0x4fadc2);}},'startedAt':{'type':Sequelize[_0xc659('0xb')],'get':function(){return moment(this['getDataValue'](_0xc659('0x7')))[_0xc659('0xc')](_0xc659('0xd'))['toString']();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xc659('0x3')](_0xc659('0x9')))['format'](_0xc659('0xd'))[_0xc659('0xe')]();}},'createdAt':{'type':Sequelize[_0xc659('0xb')],'get':function(){return moment(this[_0xc659('0x3')](_0xc659('0xf')))[_0xc659('0xc')](_0xc659('0xd'))[_0xc659('0xe')]();}},'updatedAt':{'type':Sequelize[_0xc659('0xb')],'get':function(){return moment(this[_0xc659('0x3')]('updatedAt'))[_0xc659('0xc')](_0xc659('0xd'))[_0xc659('0xe')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index dd312f0..4d71129 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 _0x032e=['status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','name','send','rawAttributes','fieldName','type','model','differenceBy','map','format','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','ScreenRecording','rows','catch','show','find','create','body','createdAt','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','destroy','eml-format','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end'];(function(_0x1590fe,_0x3341b8){var _0x624709=function(_0x449134){while(--_0x449134){_0x1590fe['push'](_0x1590fe['shift']());}};_0x624709(++_0x3341b8);}(_0x032e,0x124));var _0xe032=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x032e[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0xe032('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe032('0x1'));var jsonpatch=require(_0xe032('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe032('0x3'));var Mustache=require(_0xe032('0x4'));var util=require(_0xe032('0x5'));var path=require(_0xe032('0x6'));var sox=require(_0xe032('0x7'));var csv=require(_0xe032('0x8'));var ejs=require(_0xe032('0x9'));var fs=require('fs');var fs_extra=require(_0xe032('0xa'));var _=require(_0xe032('0xb'));var squel=require(_0xe032('0xc'));var crypto=require(_0xe032('0xd'));var jsforce=require(_0xe032('0xe'));var deskjs=require(_0xe032('0xf'));var toCsv=require(_0xe032('0x8'));var querystring=require(_0xe032('0x10'));var Papa=require(_0xe032('0x11'));var Redis=require(_0xe032('0x12'));var authService=require(_0xe032('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe032('0x14'));var hardwareService=require(_0xe032('0x15'));var logger=require(_0xe032('0x16'))(_0xe032('0x17'));var utils=require(_0xe032('0x18'));var config=require(_0xe032('0x19'));var licenseUtil=require(_0xe032('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x646979,_0x266d71){_0x266d71=_0x266d71||0xcc;return function(_0x28c2b6){if(_0x28c2b6){return _0x646979[_0xe032('0x1b')](_0x266d71);}return _0x646979['status'](_0x266d71)[_0xe032('0x1c')]();};}function respondWithResult(_0x2e267b,_0x176547){_0x176547=_0x176547||0xc8;return function(_0x422e96){if(_0x422e96){return _0x2e267b[_0xe032('0x1d')](_0x176547)[_0xe032('0x1e')](_0x422e96);}};}function respondWithFilteredResult(_0x2bf528,_0x4da5b7){return function(_0x231c35){if(_0x231c35){var _0x749018=typeof _0x4da5b7[_0xe032('0x1f')]===_0xe032('0x20')&&typeof _0x4da5b7[_0xe032('0x21')]===_0xe032('0x20');var _0x4cdab3=_0x231c35[_0xe032('0x22')];var _0x25cedb=_0x749018?0x0:_0x4da5b7[_0xe032('0x1f')];var _0x41d2a5=_0x749018?_0x231c35[_0xe032('0x22')]:_0x4da5b7['offset']+_0x4da5b7['limit'];var _0x484e6c;if(_0x41d2a5>=_0x4cdab3){_0x41d2a5=_0x4cdab3;_0x484e6c=0xc8;}else{_0x484e6c=0xce;}_0x2bf528[_0xe032('0x1d')](_0x484e6c);return _0x2bf528['set'](_0xe032('0x23'),_0x25cedb+'-'+_0x41d2a5+'/'+_0x4cdab3)[_0xe032('0x1e')](_0x231c35);}return null;};}function patchUpdates(_0x3f0257){return function(_0x2aa342){try{jsonpatch[_0xe032('0x24')](_0x2aa342,_0x3f0257,!![]);}catch(_0x256f71){return BPromise[_0xe032('0x25')](_0x256f71);}return _0x2aa342['save']();};}function saveUpdates(_0x32f8b6,_0x866c81){return function(_0x232e8f){if(_0x232e8f){return _0x232e8f[_0xe032('0x26')](_0x32f8b6)[_0xe032('0x27')](function(_0x33d89a){return _0x33d89a;});}return null;};}function removeEntity(_0x22831a,_0xe89aa7){return function(_0x499da5){if(_0x499da5){return _0x499da5['destroy']()['then'](function(){_0x22831a[_0xe032('0x1d')](0xcc)[_0xe032('0x1c')]();});}};}function handleEntityNotFound(_0x302559,_0x2a56e5){return function(_0x2bfe8f){if(!_0x2bfe8f){_0x302559[_0xe032('0x1b')](0x194);}return _0x2bfe8f;};}function handleError(_0x36ece7,_0x2b6ffa){_0x2b6ffa=_0x2b6ffa||0x1f4;return function(_0x4dcbf1){logger[_0xe032('0x28')](_0x4dcbf1['stack']);if(_0x4dcbf1[_0xe032('0x29')]){delete _0x4dcbf1[_0xe032('0x29')];}_0x36ece7[_0xe032('0x1d')](_0x2b6ffa)[_0xe032('0x2a')](_0x4dcbf1);};}exports['index']=function(_0x5573e4,_0x3e2575){var _0x38e7ea={},_0x469290={},_0xae116e={'count':0x0,'rows':[]};var _0x4e8b72=_['map'](db['ScreenRecording'][_0xe032('0x2b')],function(_0x1dd34f){return{'name':_0x1dd34f[_0xe032('0x2c')],'type':_0x1dd34f[_0xe032('0x2d')]['key']};});_0x469290[_0xe032('0x2e')]=_[_0xe032('0x2f')](_[_0xe032('0x30')](_0x4e8b72,_0xe032('0x29')),[_0xe032('0x31')]);_0x469290['query']=_[_0xe032('0x32')](_0x5573e4[_0xe032('0x33')]);_0x469290[_0xe032('0x34')]=_[_0xe032('0x35')](_0x469290['model'],_0x469290[_0xe032('0x33')]);_0x38e7ea['attributes']=_[_0xe032('0x35')](_0x469290['model'],qs[_0xe032('0x36')](_0x5573e4['query'][_0xe032('0x36')]));_0x38e7ea['attributes']=_0x38e7ea[_0xe032('0x37')][_0xe032('0x38')]?_0x38e7ea['attributes']:_0x469290[_0xe032('0x2e')];if(!_0x5573e4[_0xe032('0x33')][_0xe032('0x39')](_0xe032('0x3a'))){_0x38e7ea['limit']=qs[_0xe032('0x21')](_0x5573e4['query'][_0xe032('0x21')]);_0x38e7ea[_0xe032('0x1f')]=qs['offset'](_0x5573e4[_0xe032('0x33')][_0xe032('0x1f')]);}_0x38e7ea['order']=qs[_0xe032('0x3b')](_0x5573e4[_0xe032('0x33')][_0xe032('0x3b')]);_0x38e7ea[_0xe032('0x3c')]=qs[_0xe032('0x34')](_[_0xe032('0x3d')](_0x5573e4[_0xe032('0x33')],_0x469290[_0xe032('0x34')]),_0x4e8b72);if(_0x5573e4[_0xe032('0x33')][_0xe032('0x3e')]){_0x38e7ea[_0xe032('0x3c')]=_[_0xe032('0x3f')](_0x38e7ea[_0xe032('0x3c')],{'$or':_[_0xe032('0x30')](_0x4e8b72,function(_0x39af44){if(_0x39af44[_0xe032('0x2d')]!==_0xe032('0x40')){var _0x555914={};_0x555914[_0x39af44[_0xe032('0x29')]]={'$like':'%'+_0x5573e4['query'][_0xe032('0x3e')]+'%'};return _0x555914;}})});}_0x38e7ea=_[_0xe032('0x3f')]({},_0x38e7ea,_0x5573e4[_0xe032('0x41')]);var _0x119790={'where':_0x38e7ea[_0xe032('0x3c')]};return db['ScreenRecording'][_0xe032('0x22')](_0x119790)['then'](function(_0x46ea84){_0xae116e['count']=_0x46ea84;if(_0x5573e4[_0xe032('0x33')][_0xe032('0x42')]){_0x38e7ea[_0xe032('0x43')]=[{'all':!![]}];}return db[_0xe032('0x44')]['findAll'](_0x38e7ea);})[_0xe032('0x27')](function(_0x5a6450){_0xae116e[_0xe032('0x45')]=_0x5a6450;return _0xae116e;})[_0xe032('0x27')](respondWithFilteredResult(_0x3e2575,_0x38e7ea))[_0xe032('0x46')](handleError(_0x3e2575,null));};exports[_0xe032('0x47')]=function(_0x4b58eb,_0x513b0c){var _0x45345d={'raw':![],'where':{'id':_0x4b58eb['params']['id']}},_0x203021={};_0x203021[_0xe032('0x2e')]=_[_0xe032('0x32')](db[_0xe032('0x44')][_0xe032('0x2b')]);_0x203021[_0xe032('0x33')]=_['keys'](_0x4b58eb[_0xe032('0x33')]);_0x203021[_0xe032('0x34')]=_[_0xe032('0x35')](_0x203021[_0xe032('0x2e')],_0x203021[_0xe032('0x33')]);_0x45345d[_0xe032('0x37')]=_[_0xe032('0x35')](_0x203021[_0xe032('0x2e')],qs['fields'](_0x4b58eb['query'][_0xe032('0x36')]));_0x45345d['attributes']=_0x45345d[_0xe032('0x37')][_0xe032('0x38')]?_0x45345d[_0xe032('0x37')]:_0x203021[_0xe032('0x2e')];if(_0x4b58eb[_0xe032('0x33')][_0xe032('0x42')]){_0x45345d[_0xe032('0x43')]=[{'all':!![]}];}_0x45345d=_[_0xe032('0x3f')]({},_0x45345d,_0x4b58eb[_0xe032('0x41')]);return db['ScreenRecording'][_0xe032('0x48')](_0x45345d)['then'](handleEntityNotFound(_0x513b0c,null))['then'](respondWithResult(_0x513b0c,null))[_0xe032('0x46')](handleError(_0x513b0c,null));};exports[_0xe032('0x49')]=function(_0x62bfc8,_0x1e54d3){return db['ScreenRecording'][_0xe032('0x49')](_0x62bfc8[_0xe032('0x4a')],{})[_0xe032('0x27')](respondWithResult(_0x1e54d3,0xc9))[_0xe032('0x46')](handleError(_0x1e54d3,null));};exports[_0xe032('0x26')]=function(_0x233d9e,_0x3774bc){if(_0x233d9e['body']['id']){delete _0x233d9e[_0xe032('0x4a')]['id'];}delete _0x233d9e[_0xe032('0x4a')]['duration'];delete _0x233d9e[_0xe032('0x4a')][_0xe032('0x4b')];delete _0x233d9e[_0xe032('0x4a')][_0xe032('0x4c')];delete _0x233d9e[_0xe032('0x4a')][_0xe032('0x4d')];return db[_0xe032('0x44')][_0xe032('0x48')]({'where':{'id':_0x233d9e[_0xe032('0x4e')]['id']}})[_0xe032('0x27')](handleEntityNotFound(_0x3774bc,null))[_0xe032('0x27')](saveUpdates(_0x233d9e[_0xe032('0x4a')],null))[_0xe032('0x27')](respondWithResult(_0x3774bc,null))[_0xe032('0x46')](handleError(_0x3774bc,null));};exports['describe']=function(_0x1c8b32,_0x53c8b2){return db[_0xe032('0x44')][_0xe032('0x4f')]()[_0xe032('0x27')](respondWithResult(_0x53c8b2,null))[_0xe032('0x46')](handleError(_0x53c8b2,null));};exports[_0xe032('0x50')]=function(_0x1b7a91,_0x2e29d3,_0xa98ee6){var _0x16c91e=require(_0xe032('0x51'));var _0x1b9012=![];var _0x564fe0={};if(_0x1b7a91[_0xe032('0x33')][_0xe032('0x2d')]&&_0x1b7a91['query'][_0xe032('0x2d')]==='uniqueid'){_0x564fe0[_0xe032('0x52')]=_0x1b7a91[_0xe032('0x4e')]['id'];}else{_0x564fe0['id']=_0x1b7a91[_0xe032('0x4e')]['id'];}return db[_0xe032('0x44')][_0xe032('0x48')]({'where':_0x564fe0,'attributes':['id','value'],'raw':!![]})[_0xe032('0x27')](handleEntityNotFound(_0x2e29d3,null))[_0xe032('0x27')](function(_0x1e1277){if(_0x1e1277){var _0x21a32f=path[_0xe032('0x53')](config[_0xe032('0x54')],_0xe032('0x55'),_0x1e1277['value']);var _0x3f46c0=util[_0xe032('0x31')](_0xe032('0x56'),_0x21a32f);if(fs[_0xe032('0x57')](_0x3f46c0)){_0x1b9012=!![];return _0x16c91e[_0xe032('0x58')](_0x3f46c0,_0x21a32f,config[_0xe032('0x59')][_0xe032('0x5a')])[_0xe032('0x27')](function(){return _0x1e1277;});}return _0x1e1277;}})[_0xe032('0x27')](function(_0x54c0b0){if(_0x54c0b0){var _0x795a58=path[_0xe032('0x53')](config[_0xe032('0x54')],'server/files/screen_recordings',_0x54c0b0[_0xe032('0x4d')]);if(!fs[_0xe032('0x57')](_0x795a58)){throw new db['Sequelize'][(_0xe032('0x5b'))](_0xe032('0x5c'));}if(_0x54c0b0[_0xe032('0x5d')]){return _0x2e29d3[_0xe032('0x50')](_0x795a58,_0x54c0b0[_0xe032('0x5d')]+path[_0xe032('0x5e')](_0x795a58),function(){if(_0x1b9012){fs[_0xe032('0x5f')](_0x795a58);}});}else{return _0x2e29d3[_0xe032('0x50')](_0x795a58,function(_0x1aa18e){if(_0x1b9012){fs[_0xe032('0x5f')](_0x795a58);}});}}})[_0xe032('0x46')](function(_0x505986){if(_0x505986[_0xe032('0x60')]===_0xe032('0x5c')){_0x2e29d3[_0xe032('0x1d')](0x194)[_0xe032('0x2a')](_0xe032('0x61'));}else{return handleError(_0x2e29d3,null);}});};exports['destroy']=function(_0x2b6ef8,_0x55e6b0){return db[_0xe032('0x44')][_0xe032('0x48')]({'where':{'id':_0x2b6ef8[_0xe032('0x4e')]['id']}})[_0xe032('0x27')](function(_0x3c5eb8){if(_[_0xe032('0x62')](_0x3c5eb8)){throw new ReferenceError(_0xe032('0x63'));}return _0x3c5eb8;})[_0xe032('0x27')](function(_0x22fd01){var _0x536510=path['join'](config['root'],_0xe032('0x55'),_0x22fd01[_0xe032('0x4d')]);logger[_0xe032('0x64')](_0xe032('0x65'),_0x536510);if(!_[_0xe032('0x62')](_0x22fd01[_0xe032('0x4d')])&&fs['existsSync'](_0x536510)){logger[_0xe032('0x64')](_0xe032('0x66')+_0x536510+_0xe032('0x67'));fs['unlinkSync'](_0x536510);}_0x536510=_0x536510+_0xe032('0x68');if(!_['isNil'](_0x22fd01[_0xe032('0x4d')])&&fs[_0xe032('0x57')](_0x536510)){logger['info']('File:\x20\x22'+_0x536510+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xe032('0x69')](_0x536510);}return _0x22fd01;})['then'](function(_0x5157f7){if(!_0x5157f7)throw new InternalError();return _0x5157f7[_0xe032('0x6a')]();})[_0xe032('0x27')](function(){_0x55e6b0[_0xe032('0x1d')](0xcc)['end']();})[_0xe032('0x46')](handleError(_0x55e6b0,null));}; \ No newline at end of file +var _0x5c12=['undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','differenceBy','format','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','merge','filter','include','rows','catch','keys','includeAll','options','find','create','body','createdAt','closedAt','value','params','describe','download','uniqueid','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','limit'];(function(_0x53dbf6,_0x3a0fec){var _0x37715c=function(_0x45c28d){while(--_0x45c28d){_0x53dbf6['push'](_0x53dbf6['shift']());}};_0x37715c(++_0x3a0fec);}(_0x5c12,0x188));var _0x25c1=function(_0x5d1044,_0x18f656){_0x5d1044=_0x5d1044-0x0;var _0x3cd90e=_0x5c12[_0x5d1044];return _0x3cd90e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x25c1('0x0'));var zipdir=require(_0x25c1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x25c1('0x2'));var moment=require(_0x25c1('0x3'));var BPromise=require(_0x25c1('0x4'));var Mustache=require(_0x25c1('0x5'));var util=require(_0x25c1('0x6'));var path=require(_0x25c1('0x7'));var sox=require(_0x25c1('0x8'));var csv=require('to-csv');var ejs=require(_0x25c1('0x9'));var fs=require('fs');var fs_extra=require(_0x25c1('0xa'));var _=require(_0x25c1('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x25c1('0xc'));var deskjs=require(_0x25c1('0xd'));var toCsv=require(_0x25c1('0xe'));var querystring=require(_0x25c1('0xf'));var Papa=require(_0x25c1('0x10'));var Redis=require('ioredis');var authService=require(_0x25c1('0x11'));var qs=require(_0x25c1('0x12'));var as=require(_0x25c1('0x13'));var hardwareService=require(_0x25c1('0x14'));var logger=require(_0x25c1('0x15'))('api');var utils=require(_0x25c1('0x16'));var config=require(_0x25c1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x25c1('0x18'))['db'];function respondWithStatusCode(_0x209af5,_0x323d3c){_0x323d3c=_0x323d3c||0xcc;return function(_0x329ba9){if(_0x329ba9){return _0x209af5['sendStatus'](_0x323d3c);}return _0x209af5['status'](_0x323d3c)['end']();};}function respondWithResult(_0x54f6f4,_0x3ef429){_0x3ef429=_0x3ef429||0xc8;return function(_0x1412ed){if(_0x1412ed){return _0x54f6f4[_0x25c1('0x19')](_0x3ef429)[_0x25c1('0x1a')](_0x1412ed);}};}function respondWithFilteredResult(_0x17a032,_0x4ea926){return function(_0x4638f0){if(_0x4638f0){var _0x55b62d=typeof _0x4ea926['offset']==='undefined'&&typeof _0x4ea926[_0x25c1('0x1b')]===_0x25c1('0x1c');var _0x4dc64b=_0x4638f0['count'];var _0x61a29f=_0x55b62d?0x0:_0x4ea926['offset'];var _0x7175d4=_0x55b62d?_0x4638f0[_0x25c1('0x1d')]:_0x4ea926['offset']+_0x4ea926['limit'];var _0x542768;if(_0x7175d4>=_0x4dc64b){_0x7175d4=_0x4dc64b;_0x542768=0xc8;}else{_0x542768=0xce;}_0x17a032[_0x25c1('0x19')](_0x542768);return _0x17a032[_0x25c1('0x1e')](_0x25c1('0x1f'),_0x61a29f+'-'+_0x7175d4+'/'+_0x4dc64b)[_0x25c1('0x1a')](_0x4638f0);}return null;};}function patchUpdates(_0x481c12){return function(_0x119639){try{jsonpatch[_0x25c1('0x20')](_0x119639,_0x481c12,!![]);}catch(_0x34454a){return BPromise[_0x25c1('0x21')](_0x34454a);}return _0x119639['save']();};}function saveUpdates(_0x4c3259,_0x2a8a84){return function(_0xac3335){if(_0xac3335){return _0xac3335[_0x25c1('0x22')](_0x4c3259)[_0x25c1('0x23')](function(_0x15cf2f){return _0x15cf2f;});}return null;};}function removeEntity(_0x1a4b89,_0x2ba595){return function(_0x324ea9){if(_0x324ea9){return _0x324ea9[_0x25c1('0x24')]()[_0x25c1('0x23')](function(){_0x1a4b89[_0x25c1('0x19')](0xcc)[_0x25c1('0x25')]();});}};}function handleEntityNotFound(_0x399d72,_0x4915cc){return function(_0x2dadae){if(!_0x2dadae){_0x399d72[_0x25c1('0x26')](0x194);}return _0x2dadae;};}function handleError(_0x1b1c96,_0x1fb59f){_0x1fb59f=_0x1fb59f||0x1f4;return function(_0x21fdb8){logger[_0x25c1('0x27')](_0x21fdb8['stack']);if(_0x21fdb8[_0x25c1('0x28')]){delete _0x21fdb8[_0x25c1('0x28')];}_0x1b1c96[_0x25c1('0x19')](_0x1fb59f)[_0x25c1('0x29')](_0x21fdb8);};}exports[_0x25c1('0x2a')]=function(_0x193a68,_0x5c56ab){var _0x1e498={},_0x478f1e={},_0x76b360={'count':0x0,'rows':[]};var _0x31c153=_[_0x25c1('0x2b')](db[_0x25c1('0x2c')][_0x25c1('0x2d')],function(_0x21069c){return{'name':_0x21069c[_0x25c1('0x2e')],'type':_0x21069c[_0x25c1('0x2f')][_0x25c1('0x30')]};});_0x478f1e['model']=_[_0x25c1('0x31')](_['map'](_0x31c153,'name'),[_0x25c1('0x32')]);_0x478f1e[_0x25c1('0x33')]=_['keys'](_0x193a68[_0x25c1('0x33')]);_0x478f1e['filters']=_[_0x25c1('0x34')](_0x478f1e['model'],_0x478f1e[_0x25c1('0x33')]);_0x1e498[_0x25c1('0x35')]=_[_0x25c1('0x34')](_0x478f1e[_0x25c1('0x36')],qs[_0x25c1('0x37')](_0x193a68[_0x25c1('0x33')][_0x25c1('0x37')]));_0x1e498[_0x25c1('0x35')]=_0x1e498['attributes'][_0x25c1('0x38')]?_0x1e498['attributes']:_0x478f1e[_0x25c1('0x36')];if(!_0x193a68['query'][_0x25c1('0x39')](_0x25c1('0x3a'))){_0x1e498[_0x25c1('0x1b')]=qs[_0x25c1('0x1b')](_0x193a68[_0x25c1('0x33')][_0x25c1('0x1b')]);_0x1e498[_0x25c1('0x3b')]=qs[_0x25c1('0x3b')](_0x193a68[_0x25c1('0x33')][_0x25c1('0x3b')]);}_0x1e498[_0x25c1('0x3c')]=qs[_0x25c1('0x3d')](_0x193a68[_0x25c1('0x33')][_0x25c1('0x3d')]);_0x1e498[_0x25c1('0x3e')]=qs[_0x25c1('0x3f')](_[_0x25c1('0x40')](_0x193a68[_0x25c1('0x33')],_0x478f1e[_0x25c1('0x3f')]),_0x31c153);if(_0x193a68[_0x25c1('0x33')]['filter']){_0x1e498[_0x25c1('0x3e')]=_[_0x25c1('0x41')](_0x1e498['where'],{'$or':_[_0x25c1('0x2b')](_0x31c153,function(_0x5eca99){if(_0x5eca99[_0x25c1('0x2f')]!=='VIRTUAL'){var _0x4326fb={};_0x4326fb[_0x5eca99[_0x25c1('0x28')]]={'$like':'%'+_0x193a68[_0x25c1('0x33')][_0x25c1('0x42')]+'%'};return _0x4326fb;}})});}_0x1e498=_[_0x25c1('0x41')]({},_0x1e498,_0x193a68['options']);var _0x1fe6d7={'where':_0x1e498['where']};return db[_0x25c1('0x2c')][_0x25c1('0x1d')](_0x1fe6d7)[_0x25c1('0x23')](function(_0x17fc23){_0x76b360['count']=_0x17fc23;if(_0x193a68['query']['includeAll']){_0x1e498[_0x25c1('0x43')]=[{'all':!![]}];}return db[_0x25c1('0x2c')]['findAll'](_0x1e498);})[_0x25c1('0x23')](function(_0x58792d){_0x76b360[_0x25c1('0x44')]=_0x58792d;return _0x76b360;})[_0x25c1('0x23')](respondWithFilteredResult(_0x5c56ab,_0x1e498))[_0x25c1('0x45')](handleError(_0x5c56ab,null));};exports['show']=function(_0x5502c1,_0x53f87b){var _0x1b1d17={'raw':![],'where':{'id':_0x5502c1['params']['id']}},_0x3cf9c0={};_0x3cf9c0[_0x25c1('0x36')]=_[_0x25c1('0x46')](db[_0x25c1('0x2c')]['rawAttributes']);_0x3cf9c0['query']=_['keys'](_0x5502c1['query']);_0x3cf9c0[_0x25c1('0x3f')]=_[_0x25c1('0x34')](_0x3cf9c0['model'],_0x3cf9c0[_0x25c1('0x33')]);_0x1b1d17[_0x25c1('0x35')]=_[_0x25c1('0x34')](_0x3cf9c0[_0x25c1('0x36')],qs[_0x25c1('0x37')](_0x5502c1[_0x25c1('0x33')][_0x25c1('0x37')]));_0x1b1d17['attributes']=_0x1b1d17['attributes'][_0x25c1('0x38')]?_0x1b1d17[_0x25c1('0x35')]:_0x3cf9c0[_0x25c1('0x36')];if(_0x5502c1['query'][_0x25c1('0x47')]){_0x1b1d17[_0x25c1('0x43')]=[{'all':!![]}];}_0x1b1d17=_[_0x25c1('0x41')]({},_0x1b1d17,_0x5502c1[_0x25c1('0x48')]);return db['ScreenRecording'][_0x25c1('0x49')](_0x1b1d17)[_0x25c1('0x23')](handleEntityNotFound(_0x53f87b,null))[_0x25c1('0x23')](respondWithResult(_0x53f87b,null))[_0x25c1('0x45')](handleError(_0x53f87b,null));};exports['create']=function(_0x59e96b,_0x13ac06){return db[_0x25c1('0x2c')][_0x25c1('0x4a')](_0x59e96b[_0x25c1('0x4b')],{})['then'](respondWithResult(_0x13ac06,0xc9))[_0x25c1('0x45')](handleError(_0x13ac06,null));};exports[_0x25c1('0x22')]=function(_0x5770dd,_0x102f5){if(_0x5770dd[_0x25c1('0x4b')]['id']){delete _0x5770dd[_0x25c1('0x4b')]['id'];}delete _0x5770dd[_0x25c1('0x4b')]['duration'];delete _0x5770dd['body'][_0x25c1('0x4c')];delete _0x5770dd[_0x25c1('0x4b')][_0x25c1('0x4d')];delete _0x5770dd['body'][_0x25c1('0x4e')];return db[_0x25c1('0x2c')]['find']({'where':{'id':_0x5770dd[_0x25c1('0x4f')]['id']}})[_0x25c1('0x23')](handleEntityNotFound(_0x102f5,null))[_0x25c1('0x23')](saveUpdates(_0x5770dd[_0x25c1('0x4b')],null))[_0x25c1('0x23')](respondWithResult(_0x102f5,null))[_0x25c1('0x45')](handleError(_0x102f5,null));};exports[_0x25c1('0x50')]=function(_0x5102a0,_0x5344da){return db['ScreenRecording'][_0x25c1('0x50')]()['then'](respondWithResult(_0x5344da,null))[_0x25c1('0x45')](handleError(_0x5344da,null));};exports[_0x25c1('0x51')]=function(_0x42fd6e,_0x153603,_0x40fe57){var _0x1b72e5=require('../../components/encryptor');var _0x4a876b=![];var _0x68e295={};if(_0x42fd6e[_0x25c1('0x33')][_0x25c1('0x2f')]&&_0x42fd6e[_0x25c1('0x33')][_0x25c1('0x2f')]==='uniqueid'){_0x68e295[_0x25c1('0x52')]=_0x42fd6e[_0x25c1('0x4f')]['id'];}else{_0x68e295['id']=_0x42fd6e[_0x25c1('0x4f')]['id'];}return db[_0x25c1('0x2c')][_0x25c1('0x49')]({'where':_0x68e295,'attributes':['id','value'],'raw':!![]})[_0x25c1('0x23')](handleEntityNotFound(_0x153603,null))[_0x25c1('0x23')](function(_0x49b192){if(_0x49b192){var _0x1341d2=path[_0x25c1('0x53')](config[_0x25c1('0x54')],_0x25c1('0x55'),_0x49b192[_0x25c1('0x4e')]);var _0x3d051a=util['format'](_0x25c1('0x56'),_0x1341d2);if(fs[_0x25c1('0x57')](_0x3d051a)){_0x4a876b=!![];return _0x1b72e5[_0x25c1('0x58')](_0x3d051a,_0x1341d2,config[_0x25c1('0x59')][_0x25c1('0x5a')])[_0x25c1('0x23')](function(){return _0x49b192;});}return _0x49b192;}})[_0x25c1('0x23')](function(_0x5d54cd){if(_0x5d54cd){var _0x321833=path[_0x25c1('0x53')](config[_0x25c1('0x54')],_0x25c1('0x55'),_0x5d54cd[_0x25c1('0x4e')]);if(!fs[_0x25c1('0x57')](_0x321833)){throw new db['Sequelize'][(_0x25c1('0x5b'))](_0x25c1('0x5c'));}if(_0x5d54cd[_0x25c1('0x5d')]){return _0x153603[_0x25c1('0x51')](_0x321833,_0x5d54cd[_0x25c1('0x5d')]+path[_0x25c1('0x5e')](_0x321833),function(){if(_0x4a876b){fs[_0x25c1('0x5f')](_0x321833);}});}else{return _0x153603['download'](_0x321833,function(_0x44efc9){if(_0x4a876b){fs['unlink'](_0x321833);}});}}})[_0x25c1('0x45')](function(_0x24568c){if(_0x24568c[_0x25c1('0x60')]===_0x25c1('0x5c')){_0x153603[_0x25c1('0x19')](0x194)[_0x25c1('0x29')](_0x25c1('0x61'));}else{return handleError(_0x153603,null);}});};exports[_0x25c1('0x24')]=function(_0x4c435c,_0x7dbbe1){return db[_0x25c1('0x2c')][_0x25c1('0x49')]({'where':{'id':_0x4c435c[_0x25c1('0x4f')]['id']}})[_0x25c1('0x23')](function(_0x338f70){if(_[_0x25c1('0x62')](_0x338f70)){throw new ReferenceError('Entity\x20not\x20found');}return _0x338f70;})[_0x25c1('0x23')](function(_0x51e747){var _0x5e1517=path['join'](config[_0x25c1('0x54')],_0x25c1('0x55'),_0x51e747[_0x25c1('0x4e')]);logger[_0x25c1('0x63')](_0x25c1('0x64'),_0x5e1517);if(!_['isNil'](_0x51e747[_0x25c1('0x4e')])&&fs['existsSync'](_0x5e1517)){logger[_0x25c1('0x63')](_0x25c1('0x65')+_0x5e1517+_0x25c1('0x66'));fs[_0x25c1('0x67')](_0x5e1517);}_0x5e1517=_0x5e1517+_0x25c1('0x68');if(!_[_0x25c1('0x62')](_0x51e747[_0x25c1('0x4e')])&&fs['existsSync'](_0x5e1517)){logger[_0x25c1('0x63')](_0x25c1('0x65')+_0x5e1517+_0x25c1('0x66'));fs[_0x25c1('0x67')](_0x5e1517);}return _0x51e747;})[_0x25c1('0x23')](function(_0x425f3e){if(!_0x425f3e)throw new InternalError();return _0x425f3e['destroy']();})[_0x25c1('0x23')](function(){_0x7dbbe1['status'](0xcc)[_0x25c1('0x25')]();})['catch'](handleError(_0x7dbbe1,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 6ac97cd..5b1cf8a 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 _0xce44=['ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define'];(function(_0x3cafef,_0x54f23b){var _0x250f55=function(_0x30490f){while(--_0x30490f){_0x3cafef['push'](_0x3cafef['shift']());}};_0x250f55(++_0x54f23b);}(_0xce44,0x1b6));var _0x4ce4=function(_0x2bf848,_0x1425af){_0x2bf848=_0x2bf848-0x0;var _0x28d43e=_0xce44[_0x2bf848];return _0x28d43e;};'use strict';var _=require(_0x4ce4('0x0'));var util=require(_0x4ce4('0x1'));var logger=require(_0x4ce4('0x2'))(_0x4ce4('0x3'));var moment=require(_0x4ce4('0x4'));var BPromise=require(_0x4ce4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4ce4('0x6'));var rimraf=require(_0x4ce4('0x7'));var config=require(_0x4ce4('0x8'));var attributes=require(_0x4ce4('0x9'));module[_0x4ce4('0xa')]=function(_0x1c637d,_0x5ea654){return _0x1c637d[_0x4ce4('0xb')](_0x4ce4('0xc'),attributes,{'tableName':_0x4ce4('0xd'),'paranoid':![],'indexes':[{'name':_0x4ce4('0xe'),'fields':[_0x4ce4('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0373=['./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x0373,0xba));var _0x3037=function(_0x5b8a92,_0x1e6117){_0x5b8a92=_0x5b8a92-0x0;var _0x97ad43=_0x0373[_0x5b8a92];return _0x97ad43;};'use strict';var _=require(_0x3037('0x0'));var util=require(_0x3037('0x1'));var logger=require(_0x3037('0x2'))(_0x3037('0x3'));var moment=require(_0x3037('0x4'));var BPromise=require(_0x3037('0x5'));var rp=require(_0x3037('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3037('0x7'));var config=require(_0x3037('0x8'));var attributes=require(_0x3037('0x9'));module[_0x3037('0xa')]=function(_0xa83d,_0x32b766){return _0xa83d[_0x3037('0xb')](_0x3037('0xc'),attributes,{'tableName':_0x3037('0xd'),'paranoid':![],'indexes':[{'name':_0x3037('0xe'),'fields':[_0x3037('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 0d856ee..61dde22 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 _0xffa0=['message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','error'];(function(_0x5ad55e,_0x1c9b31){var _0x815e9a=function(_0x304a88){while(--_0x304a88){_0x5ad55e['push'](_0x5ad55e['shift']());}};_0x815e9a(++_0x1c9b31);}(_0xffa0,0x74));var _0x0ffa=function(_0x502038,_0x79292){_0x502038=_0x502038-0x0;var _0x2c71a9=_0xffa0[_0x502038];return _0x2c71a9;};'use strict';var _=require('lodash');var util=require(_0x0ffa('0x0'));var moment=require(_0x0ffa('0x1'));var BPromise=require('bluebird');var rs=require(_0x0ffa('0x2'));var fs=require('fs');var Redis=require(_0x0ffa('0x3'));var db=require(_0x0ffa('0x4'))['db'];var utils=require(_0x0ffa('0x5'));var logger=require(_0x0ffa('0x6'))(_0x0ffa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0ffa('0x8')][_0x0ffa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x41527b,_0xd62165,_0x50ab6c){return new BPromise(function(_0x104734,_0xce2c6f){return client[_0x0ffa('0xa')](_0x41527b,_0x50ab6c)[_0x0ffa('0xb')](function(_0x2251d1){logger[_0x0ffa('0xc')](_0x0ffa('0xd'),_0xd62165,_0x0ffa('0xe'));logger['debug'](_0x0ffa('0xf'),_0xd62165,_0x0ffa('0xe'),JSON['stringify'](_0x2251d1));if(_0x2251d1[_0x0ffa('0x10')]){if(_0x2251d1[_0x0ffa('0x10')]['code']===0x1f4){logger[_0x0ffa('0x10')](_0x0ffa('0xd'),_0xd62165,_0x2251d1[_0x0ffa('0x10')][_0x0ffa('0x11')]);return _0xce2c6f(_0x2251d1['error'][_0x0ffa('0x11')]);}logger['error'](_0x0ffa('0xd'),_0xd62165,_0x2251d1['error'][_0x0ffa('0x11')]);return _0x104734(_0x2251d1[_0x0ffa('0x10')][_0x0ffa('0x11')]);}else{logger[_0x0ffa('0xc')](_0x0ffa('0xd'),_0xd62165,_0x0ffa('0xe'));_0x104734(_0x2251d1[_0x0ffa('0x12')][_0x0ffa('0x11')]);}})['catch'](function(_0x1e9e3d){logger[_0x0ffa('0x10')](_0x0ffa('0xd'),_0xd62165,_0x1e9e3d);_0xce2c6f(_0x1e9e3d);});});} \ No newline at end of file +var _0x8ebd=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','ScreenRecording,\x20%s,\x20%s','debug','request\x20sent','error','code','message'];(function(_0x26aa07,_0x55175f){var _0x3683e9=function(_0x484a30){while(--_0x484a30){_0x26aa07['push'](_0x26aa07['shift']());}};_0x3683e9(++_0x55175f);}(_0x8ebd,0xca));var _0xd8eb=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x8ebd[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0xd8eb('0x0'));var util=require(_0xd8eb('0x1'));var moment=require('moment');var BPromise=require(_0xd8eb('0x2'));var rs=require(_0xd8eb('0x3'));var fs=require('fs');var Redis=require(_0xd8eb('0x4'));var db=require(_0xd8eb('0x5'))['db'];var utils=require(_0xd8eb('0x6'));var logger=require('../../config/logger')(_0xd8eb('0x7'));var config=require('../../config/environment');var jayson=require(_0xd8eb('0x8'));var client=jayson['client'][_0xd8eb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5bb818,_0x56127b,_0x5f1531){return new BPromise(function(_0x36c6d2,_0x27bb7d){return client[_0xd8eb('0xa')](_0x5bb818,_0x5f1531)[_0xd8eb('0xb')](function(_0x5072f3){logger['info'](_0xd8eb('0xc'),_0x56127b,'request\x20sent');logger[_0xd8eb('0xd')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x56127b,_0xd8eb('0xe'),JSON['stringify'](_0x5072f3));if(_0x5072f3['error']){if(_0x5072f3[_0xd8eb('0xf')][_0xd8eb('0x10')]===0x1f4){logger['error'](_0xd8eb('0xc'),_0x56127b,_0x5072f3[_0xd8eb('0xf')][_0xd8eb('0x11')]);return _0x27bb7d(_0x5072f3['error'][_0xd8eb('0x11')]);}logger['error'](_0xd8eb('0xc'),_0x56127b,_0x5072f3['error'][_0xd8eb('0x11')]);return _0x36c6d2(_0x5072f3[_0xd8eb('0xf')]['message']);}else{logger['info'](_0xd8eb('0xc'),_0x56127b,'request\x20sent');_0x36c6d2(_0x5072f3[_0xd8eb('0x12')][_0xd8eb('0x11')]);}})[_0xd8eb('0x13')](function(_0xcc7057){logger[_0xd8eb('0xf')](_0xd8eb('0xc'),_0x56127b,_0xcc7057);_0x27bb7d(_0xcc7057);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 5a63901..2da43c9 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 _0xb5ac=['getFavicon','diskStorage','root','server/files/images/logos/','format','%s%s','logo','extname','post','/:id/logo','file','addLogo','join','logologin','addLogoLogin','preferred','single','addPreferred','favicon','originalname','addFavicon','put','update','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','getDate','/:id','show','/:id/logo_login','gdpr','/:id/preferred','getPreferred','/:id/favicon'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0xb5ac,0x189));var _0xcb5a=function(_0x374d35,_0x1ea694){_0x374d35=_0x374d35-0x0;var _0x102652=_0xb5ac[_0x374d35];return _0x102652;};'use strict';var multer=require(_0xcb5a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xcb5a('0x1'));var express=require('express');var router=express[_0xcb5a('0x2')]();var fs_extra=require(_0xcb5a('0x3'));var auth=require(_0xcb5a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xcb5a('0x5'));var controller=require('./setting.controller');router[_0xcb5a('0x6')]('/',auth[_0xcb5a('0x7')](),controller[_0xcb5a('0x8')]);router[_0xcb5a('0x6')]('/now',controller[_0xcb5a('0x9')]);router['get'](_0xcb5a('0xa'),controller[_0xcb5a('0xb')]);router[_0xcb5a('0x6')]('/:id/logo',controller['getLogo']);router['get'](_0xcb5a('0xc'),controller['getLogoLogin']);router['get']('/:id/gdpr',controller[_0xcb5a('0xd')]);router[_0xcb5a('0x6')](_0xcb5a('0xe'),controller[_0xcb5a('0xf')]);router['get'](_0xcb5a('0x10'),controller[_0xcb5a('0x11')]);var upload=multer({'storage':multer[_0xcb5a('0x12')]({'destination':function(_0x5e8d,_0x2cc987,_0x3acd0e){_0x3acd0e(null,path['join'](config[_0xcb5a('0x13')],_0xcb5a('0x14')));},'filename':function(_0x4d7c05,_0x4eb1ce,_0x1049fa){_0x1049fa(null,util[_0xcb5a('0x15')](_0xcb5a('0x16'),_0xcb5a('0x17'),path[_0xcb5a('0x18')](_0x4eb1ce['originalname'])));}})});router[_0xcb5a('0x19')](_0xcb5a('0x1a'),upload['single'](_0xcb5a('0x1b')),controller[_0xcb5a('0x1c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x383fea,_0x523521,_0x1d5a7c){_0x1d5a7c(null,path[_0xcb5a('0x1d')](config['root'],_0xcb5a('0x14')));},'filename':function(_0x3e36b4,_0x45f112,_0x1c85be){_0x1c85be(null,util[_0xcb5a('0x15')]('%s%s',_0xcb5a('0x1e'),path[_0xcb5a('0x18')](_0x45f112['originalname'])));}})});router['post'](_0xcb5a('0xc'),upload['single'](_0xcb5a('0x1b')),controller[_0xcb5a('0x1f')]);var upload=multer({'storage':multer[_0xcb5a('0x12')]({'destination':function(_0x15fec2,_0x167bb8,_0x47f12b){_0x47f12b(null,path[_0xcb5a('0x1d')](config['root'],_0xcb5a('0x14')));},'filename':function(_0x482992,_0x8d7037,_0x60da59){_0x60da59(null,util['format']('%s%s',_0xcb5a('0x20'),path['extname'](_0x8d7037['originalname'])));}})});router[_0xcb5a('0x19')]('/:id/preferred',upload[_0xcb5a('0x21')]('file'),controller[_0xcb5a('0x22')]);var upload=multer({'storage':multer[_0xcb5a('0x12')]({'destination':function(_0x1153fc,_0x15b5f6,_0x2ed181){_0x2ed181(null,path[_0xcb5a('0x1d')](config[_0xcb5a('0x13')],_0xcb5a('0x14')));},'filename':function(_0x392aa4,_0x3d27b4,_0x42ca33){_0x42ca33(null,util[_0xcb5a('0x15')](_0xcb5a('0x16'),_0xcb5a('0x23'),path[_0xcb5a('0x18')](_0x3d27b4[_0xcb5a('0x24')])));}})});router['post'](_0xcb5a('0x10'),upload[_0xcb5a('0x21')](_0xcb5a('0x1b')),controller[_0xcb5a('0x25')]);router[_0xcb5a('0x26')](_0xcb5a('0xa'),auth['isAuthenticated'](),controller[_0xcb5a('0x27')]);module[_0xcb5a('0x28')]=router; \ No newline at end of file +var _0xeb4f=['logologin','single','server/files/images/logos/','preferred','addPreferred','favicon','addFavicon','put','isAuthenticated','update','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','/now','getDate','/:id','show','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','/:id/favicon','getFavicon','diskStorage','join','root','format','%s%s','logo','extname','originalname','post','/:id/logo','file','addLogo'];(function(_0x3bc9d3,_0x105bba){var _0x536b66=function(_0x9f8106){while(--_0x9f8106){_0x3bc9d3['push'](_0x3bc9d3['shift']());}};_0x536b66(++_0x105bba);}(_0xeb4f,0xb7));var _0xfeb4=function(_0x202d90,_0x148358){_0x202d90=_0x202d90-0x0;var _0x44b94b=_0xeb4f[_0x202d90];return _0x44b94b;};'use strict';var multer=require(_0xfeb4('0x0'));var util=require(_0xfeb4('0x1'));var path=require(_0xfeb4('0x2'));var timeout=require(_0xfeb4('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xfeb4('0x4'));var auth=require(_0xfeb4('0x5'));var interaction=require(_0xfeb4('0x6'));var config=require(_0xfeb4('0x7'));var controller=require(_0xfeb4('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xfeb4('0x9')](_0xfeb4('0xa'),controller[_0xfeb4('0xb')]);router[_0xfeb4('0x9')](_0xfeb4('0xc'),controller[_0xfeb4('0xd')]);router[_0xfeb4('0x9')]('/:id/logo',controller['getLogo']);router[_0xfeb4('0x9')](_0xfeb4('0xe'),controller[_0xfeb4('0xf')]);router[_0xfeb4('0x9')](_0xfeb4('0x10'),controller['gdpr']);router['get'](_0xfeb4('0x11'),controller['getPreferred']);router['get'](_0xfeb4('0x12'),controller[_0xfeb4('0x13')]);var upload=multer({'storage':multer[_0xfeb4('0x14')]({'destination':function(_0x85d719,_0x2bcc26,_0x2136ab){_0x2136ab(null,path[_0xfeb4('0x15')](config[_0xfeb4('0x16')],'server/files/images/logos/'));},'filename':function(_0x2739f3,_0x279f6a,_0x511136){_0x511136(null,util[_0xfeb4('0x17')](_0xfeb4('0x18'),_0xfeb4('0x19'),path[_0xfeb4('0x1a')](_0x279f6a[_0xfeb4('0x1b')])));}})});router[_0xfeb4('0x1c')](_0xfeb4('0x1d'),upload['single'](_0xfeb4('0x1e')),controller[_0xfeb4('0x1f')]);var upload=multer({'storage':multer[_0xfeb4('0x14')]({'destination':function(_0x31c8ff,_0x55250b,_0x1ff3e3){_0x1ff3e3(null,path[_0xfeb4('0x15')](config[_0xfeb4('0x16')],'server/files/images/logos/'));},'filename':function(_0x26b8e8,_0x469d7f,_0x5aa925){_0x5aa925(null,util[_0xfeb4('0x17')]('%s%s',_0xfeb4('0x20'),path['extname'](_0x469d7f[_0xfeb4('0x1b')])));}})});router['post']('/:id/logo_login',upload[_0xfeb4('0x21')](_0xfeb4('0x1e')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xfeb4('0x14')]({'destination':function(_0x292cb5,_0x225a7e,_0x447fed){_0x447fed(null,path[_0xfeb4('0x15')](config[_0xfeb4('0x16')],_0xfeb4('0x22')));},'filename':function(_0x301e7e,_0x16f1fc,_0x432ada){_0x432ada(null,util[_0xfeb4('0x17')]('%s%s',_0xfeb4('0x23'),path[_0xfeb4('0x1a')](_0x16f1fc[_0xfeb4('0x1b')])));}})});router[_0xfeb4('0x1c')]('/:id/preferred',upload[_0xfeb4('0x21')](_0xfeb4('0x1e')),controller[_0xfeb4('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4771be,_0x35336c,_0xd5df86){_0xd5df86(null,path['join'](config[_0xfeb4('0x16')],_0xfeb4('0x22')));},'filename':function(_0x363b53,_0x469e2a,_0x29beef){_0x29beef(null,util[_0xfeb4('0x17')](_0xfeb4('0x18'),_0xfeb4('0x25'),path[_0xfeb4('0x1a')](_0x469e2a['originalname'])));}})});router[_0xfeb4('0x1c')](_0xfeb4('0x12'),upload[_0xfeb4('0x21')](_0xfeb4('0x1e')),controller[_0xfeb4('0x26')]);router[_0xfeb4('0x27')](_0xfeb4('0xc'),auth[_0xfeb4('0x28')](),controller[_0xfeb4('0x29')]);module[_0xfeb4('0x2a')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index b64ee87..a52ae74 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 _0x258e=['/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports','min_internal','INTEGER','min_mailbox','STRING'];(function(_0x452cc0,_0x18f9ce){var _0x3b22f4=function(_0x34b729){while(--_0x34b729){_0x452cc0['push'](_0x452cc0['shift']());}};_0x3b22f4(++_0x18f9ce);}(_0x258e,0x186));var _0xe258=function(_0x14b64f,_0x16a6bd){_0x14b64f=_0x14b64f-0x0;var _0x58dbb2=_0x258e[_0x14b64f];return _0x58dbb2;};'use strict';var Sequelize=require(_0xe258('0x0'));module[_0xe258('0x1')]={'min_internal':{'type':Sequelize['INTEGER'](0xb),'unique':_0xe258('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xe258('0x3')](0xb),'unique':_0xe258('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xe258('0x3')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xe258('0x5')],'defaultValue':_0xe258('0x6')},'logo':{'type':Sequelize[_0xe258('0x5')]},'defaultLogo':{'type':Sequelize[_0xe258('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xe258('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0xe258('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xe258('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xe258('0x5')]},'turnaddr':{'type':Sequelize[_0xe258('0x5')]},'turnusername':{'type':Sequelize[_0xe258('0x5')]},'turnpassword':{'type':Sequelize[_0xe258('0x5')]},'pageTitle':{'type':Sequelize[_0xe258('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xe258('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xe258('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xe258('0x3')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xe258('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0xe258('0x8')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xe258('0x3')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xe258('0x3')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xe258('0x5')],'defaultValue':_0xe258('0x9')},'chatTimeout':{'type':Sequelize[_0xe258('0x3')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xe258('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xe258('0x5')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xe258('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xe258('0x5')]},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xe258('0x3')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xe258('0x5')]},'defaultFavicon':{'type':Sequelize[_0xe258('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xe258('0x3')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xe258('0x7')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xe258('0x3')]},'transcribeRegion':{'type':Sequelize[_0xe258('0x5')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xe258('0x3')]},'sentimentRegion':{'type':Sequelize[_0xe258('0x5')]},'language':{'type':Sequelize[_0xe258('0x5')]},'bucket':{'type':Sequelize[_0xe258('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0xe258('0x7')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xe258('0x7')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xe258('0x7')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xe258('0x3')](0x2)[_0xe258('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xe258('0x3')](0x2)[_0xe258('0xa')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xe258('0x3')](0x2)[_0xe258('0xa')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xe258('0x3')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xe258('0x3')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xe258('0x3')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xe258('0x3')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xe258('0x7')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0xe258('0x7')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize['INTEGER'],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize[_0xe258('0x7')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0xe258('0x3')],'defaultValue':0x14},'filterFullName':{'type':Sequelize[_0xe258('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x1e56=['INTEGER','min_internal','min_mailbox','/var/opt/motion2/server/files/sounds/converted','STRING','BOOLEAN','alternate','UNSIGNED','exports'];(function(_0x57ee85,_0x32bf8b){var _0x1f943c=function(_0x4e0847){while(--_0x4e0847){_0x57ee85['push'](_0x57ee85['shift']());}};_0x1f943c(++_0x32bf8b);}(_0x1e56,0x86));var _0x61e5=function(_0x4ac10b,_0x4bf408){_0x4ac10b=_0x4ac10b-0x0;var _0x87a0f8=_0x1e56[_0x4ac10b];return _0x87a0f8;};'use strict';var Sequelize=require('sequelize');module[_0x61e5('0x0')]={'min_internal':{'type':Sequelize[_0x61e5('0x1')](0xb),'unique':_0x61e5('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x61e5('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0x61e5('0x4')},'logo':{'type':Sequelize[_0x61e5('0x5')]},'defaultLogo':{'type':Sequelize[_0x61e5('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x61e5('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0x61e5('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x61e5('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x61e5('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x61e5('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x61e5('0x5')]},'turnaddr':{'type':Sequelize[_0x61e5('0x5')]},'turnusername':{'type':Sequelize[_0x61e5('0x5')]},'turnpassword':{'type':Sequelize[_0x61e5('0x5')]},'pageTitle':{'type':Sequelize[_0x61e5('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x61e5('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x61e5('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x61e5('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x61e5('0x5')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x61e5('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x61e5('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x61e5('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x61e5('0x5')],'defaultValue':_0x61e5('0x7')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x61e5('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x61e5('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x61e5('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x61e5('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x61e5('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x61e5('0x5')]},'defaultFavicon':{'type':Sequelize[_0x61e5('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x61e5('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x61e5('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x61e5('0x1')]},'transcribeRegion':{'type':Sequelize[_0x61e5('0x5')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x61e5('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x61e5('0x1')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x61e5('0x5')]},'bucket':{'type':Sequelize[_0x61e5('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0x61e5('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x61e5('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x61e5('0x1')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x61e5('0x1')](0x2)[_0x61e5('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)[_0x61e5('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x61e5('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x61e5('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x61e5('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x61e5('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x61e5('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x61e5('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x61e5('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x61e5('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x61e5('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize['INTEGER'],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize[_0x61e5('0x6')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x61e5('0x1')],'defaultValue':0x14},'filterFullName':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 7541d37..4210d48 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 _0x0048=['name','send','index','map','Setting','type','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','body','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLoginLogo','defaultPreferred','existsSync','root','toLower','join','upperFirst','default_logo.svg','Sequelize','ValidationError','\x20not\x20found','download','defaultLogo','defaultFavicon','default_loginLogo.svg','custom','gdpr','securePassword','getPreferred','default','default_preferred.png','getFavicon','getDate','now','YYYY-MM-DD\x20HH:mm:ss:SSS','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','destroy','stack'];(function(_0x597b3b,_0x3febc1){var _0x2bf1db=function(_0x99d339){while(--_0x99d339){_0x597b3b['push'](_0x597b3b['shift']());}};_0x2bf1db(++_0x3febc1);}(_0x0048,0x129));var _0x8004=function(_0x2a0ad3,_0x3e5795){_0x2a0ad3=_0x2a0ad3-0x0;var _0x1e501b=_0x0048[_0x2a0ad3];return _0x1e501b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8004('0x0'));var zipdir=require(_0x8004('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8004('0x2'));var moment=require(_0x8004('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8004('0x4'));var util=require(_0x8004('0x5'));var path=require(_0x8004('0x6'));var sox=require(_0x8004('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8004('0x8'));var _=require(_0x8004('0x9'));var squel=require(_0x8004('0xa'));var crypto=require('crypto');var jsforce=require(_0x8004('0xb'));var deskjs=require(_0x8004('0xc'));var toCsv=require(_0x8004('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8004('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8004('0xf'));var logger=require(_0x8004('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x8004('0x11'));var licenseUtil=require(_0x8004('0x12'));var db=require(_0x8004('0x13'))['db'];var jayson=require(_0x8004('0x14'));var client=jayson[_0x8004('0x15')][_0x8004('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x39a752,_0x5d9972,_0x26dde8,_0x3bb941){return new BPromise(function(_0x2fc21a,_0xeaeac3){var _0x235819=_0x3bb941||client;return _0x235819[_0x8004('0x17')](_0x39a752,_0x26dde8)[_0x8004('0x18')](function(_0x65f71e){logger[_0x8004('0x19')](_0x8004('0x1a'),_0x5d9972,_0x8004('0x1b'));logger[_0x8004('0x1c')](_0x8004('0x1d'),_0x5d9972,_0x8004('0x1b'),JSON[_0x8004('0x1e')](_0x65f71e));if(_0x65f71e[_0x8004('0x1f')]){if(_0x65f71e[_0x8004('0x1f')][_0x8004('0x20')]===0x1f4){logger[_0x8004('0x1f')]('Setting,\x20%s,\x20%s',_0x5d9972,_0x65f71e[_0x8004('0x1f')][_0x8004('0x21')]);return _0xeaeac3(_0x65f71e['error'][_0x8004('0x21')]);}logger[_0x8004('0x1f')](_0x8004('0x1a'),_0x5d9972,_0x65f71e[_0x8004('0x1f')][_0x8004('0x21')]);return _0x2fc21a(_0x65f71e[_0x8004('0x1f')][_0x8004('0x21')]);}else{logger[_0x8004('0x19')](_0x8004('0x1a'),_0x5d9972,_0x8004('0x1b'));_0x2fc21a(_0x65f71e['result']['message']);}})['catch'](function(_0x2006f5){logger[_0x8004('0x1f')]('Setting,\x20%s,\x20%s',_0x5d9972,_0x2006f5);_0xeaeac3(_0x2006f5);});});}function respondWithStatusCode(_0x4325f9,_0x1a4410){_0x1a4410=_0x1a4410||0xcc;return function(_0x81b386){if(_0x81b386){return _0x4325f9[_0x8004('0x22')](_0x1a4410);}return _0x4325f9[_0x8004('0x23')](_0x1a4410)[_0x8004('0x24')]();};}function respondWithResult(_0x567c3e,_0x108089){_0x108089=_0x108089||0xc8;return function(_0x43b3d6){if(_0x43b3d6){return _0x567c3e['status'](_0x108089)[_0x8004('0x25')](_0x43b3d6);}};}function respondWithFilteredResult(_0x7f96a8,_0xbf2fe7){return function(_0x1102c2){if(_0x1102c2){var _0x5dc5d4=typeof _0xbf2fe7['offset']===_0x8004('0x26')&&typeof _0xbf2fe7[_0x8004('0x27')]==='undefined';var _0x278b8c=_0x1102c2[_0x8004('0x28')];var _0x3be2f9=_0x5dc5d4?0x0:_0xbf2fe7[_0x8004('0x29')];var _0x78d1d2=_0x5dc5d4?_0x1102c2['count']:_0xbf2fe7[_0x8004('0x29')]+_0xbf2fe7['limit'];var _0x28b6c8;if(_0x78d1d2>=_0x278b8c){_0x78d1d2=_0x278b8c;_0x28b6c8=0xc8;}else{_0x28b6c8=0xce;}_0x7f96a8['status'](_0x28b6c8);return _0x7f96a8['set']('Content-Range',_0x3be2f9+'-'+_0x78d1d2+'/'+_0x278b8c)[_0x8004('0x25')](_0x1102c2);}return null;};}function patchUpdates(_0x3dff63){return function(_0x53c21a){try{jsonpatch[_0x8004('0x2a')](_0x53c21a,_0x3dff63,!![]);}catch(_0xd3f82e){return BPromise[_0x8004('0x2b')](_0xd3f82e);}return _0x53c21a[_0x8004('0x2c')]();};}function saveUpdates(_0x26877e,_0xd1da3f){return function(_0x2eeb55){if(_0x2eeb55){return _0x2eeb55[_0x8004('0x2d')](_0x26877e)['then'](function(_0x542d92){return _0x542d92;});}return null;};}function removeEntity(_0x5c015b,_0x4859f6){return function(_0x378394){if(_0x378394){return _0x378394[_0x8004('0x2e')]()[_0x8004('0x18')](function(){_0x5c015b[_0x8004('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21a138,_0x5edf96){return function(_0x376276){if(!_0x376276){_0x21a138[_0x8004('0x22')](0x194);}return _0x376276;};}function handleError(_0x2dbf14,_0x5bcd0d){_0x5bcd0d=_0x5bcd0d||0x1f4;return function(_0x46dc66){logger[_0x8004('0x1f')](_0x46dc66[_0x8004('0x2f')]);if(_0x46dc66[_0x8004('0x30')]){delete _0x46dc66[_0x8004('0x30')];}_0x2dbf14[_0x8004('0x23')](_0x5bcd0d)[_0x8004('0x31')](_0x46dc66);};}exports[_0x8004('0x32')]=function(_0x5a8190,_0xad3eb3){var _0x2b0568={},_0x19c376={},_0x9c012d={'count':0x0,'rows':[]};var _0x529fb3=_[_0x8004('0x33')](db[_0x8004('0x34')]['rawAttributes'],function(_0x37841d){return{'name':_0x37841d['fieldName'],'type':_0x37841d[_0x8004('0x35')]['key']};});_0x19c376['model']=_[_0x8004('0x33')](_0x529fb3,_0x8004('0x30'));_0x19c376[_0x8004('0x36')]=_[_0x8004('0x37')](_0x5a8190[_0x8004('0x36')]);_0x19c376['filters']=_[_0x8004('0x38')](_0x19c376[_0x8004('0x39')],_0x19c376[_0x8004('0x36')]);_0x2b0568[_0x8004('0x3a')]=_['intersection'](_0x19c376[_0x8004('0x39')],qs[_0x8004('0x3b')](_0x5a8190['query'][_0x8004('0x3b')]));_0x2b0568[_0x8004('0x3a')]=_0x2b0568[_0x8004('0x3a')]['length']?_0x2b0568[_0x8004('0x3a')]:_0x19c376['model'];if(!_0x5a8190[_0x8004('0x36')][_0x8004('0x3c')](_0x8004('0x3d'))){_0x2b0568['limit']=qs['limit'](_0x5a8190['query']['limit']);_0x2b0568[_0x8004('0x29')]=qs[_0x8004('0x29')](_0x5a8190['query'][_0x8004('0x29')]);}_0x2b0568[_0x8004('0x3e')]=qs['sort'](_0x5a8190[_0x8004('0x36')][_0x8004('0x3f')]);_0x2b0568[_0x8004('0x40')]=qs['filters'](_[_0x8004('0x41')](_0x5a8190['query'],_0x19c376[_0x8004('0x42')]),_0x529fb3);if(_0x5a8190['query'][_0x8004('0x43')]){_0x2b0568[_0x8004('0x40')]=_['merge'](_0x2b0568[_0x8004('0x40')],{'$or':_[_0x8004('0x33')](_0x529fb3,function(_0x33dfaf){if(_0x33dfaf['type']!=='VIRTUAL'){var _0x1bf929={};_0x1bf929[_0x33dfaf[_0x8004('0x30')]]={'$like':'%'+_0x5a8190[_0x8004('0x36')][_0x8004('0x43')]+'%'};return _0x1bf929;}})});}_0x2b0568=_['merge']({},_0x2b0568,_0x5a8190[_0x8004('0x44')]);var _0x106811={'where':_0x2b0568[_0x8004('0x40')]};return db[_0x8004('0x34')][_0x8004('0x28')](_0x106811)['then'](function(_0x552962){_0x9c012d[_0x8004('0x28')]=_0x552962;if(_0x5a8190[_0x8004('0x36')][_0x8004('0x45')]){_0x2b0568[_0x8004('0x46')]=[{'all':!![]}];}return db[_0x8004('0x34')][_0x8004('0x47')](_0x2b0568);})[_0x8004('0x18')](function(_0x113203){_0x9c012d[_0x8004('0x48')]=_0x113203;return _0x9c012d;})[_0x8004('0x18')](respondWithFilteredResult(_0xad3eb3,_0x2b0568))[_0x8004('0x49')](handleError(_0xad3eb3,null));};exports[_0x8004('0x4a')]=function(_0x3f5148,_0x49cdef){var _0x164f9d={'raw':![],'where':{'id':_0x3f5148[_0x8004('0x4b')]['id']}},_0x11dbbe={};_0x11dbbe[_0x8004('0x39')]=_['keys'](db['Setting'][_0x8004('0x4c')]);_0x11dbbe[_0x8004('0x36')]=_['keys'](_0x3f5148[_0x8004('0x36')]);_0x11dbbe[_0x8004('0x42')]=_['intersection'](_0x11dbbe['model'],_0x11dbbe['query']);_0x164f9d[_0x8004('0x3a')]=_[_0x8004('0x38')](_0x11dbbe[_0x8004('0x39')],qs[_0x8004('0x3b')](_0x3f5148[_0x8004('0x36')][_0x8004('0x3b')]));_0x164f9d[_0x8004('0x3a')]=_0x164f9d['attributes'][_0x8004('0x4d')]?_0x164f9d[_0x8004('0x3a')]:_0x11dbbe[_0x8004('0x39')];if(_0x3f5148[_0x8004('0x36')]['includeAll']){_0x164f9d[_0x8004('0x46')]=[{'all':!![]}];}_0x164f9d=_['merge']({},_0x164f9d,_0x3f5148['options']);return db[_0x8004('0x34')][_0x8004('0x4e')](_0x164f9d)[_0x8004('0x18')](handleEntityNotFound(_0x49cdef,null))[_0x8004('0x18')](respondWithResult(_0x49cdef,null))['catch'](handleError(_0x49cdef,null));};exports[_0x8004('0x2d')]=function(_0x581875,_0x101b0c){if(_0x581875[_0x8004('0x4f')]['id']){delete _0x581875[_0x8004('0x4f')]['id'];}return db[_0x8004('0x34')][_0x8004('0x4e')]({'where':{'id':_0x581875[_0x8004('0x4b')]['id']}})[_0x8004('0x18')](handleEntityNotFound(_0x101b0c,null))[_0x8004('0x18')](saveUpdates(_0x581875['body'],null))[_0x8004('0x18')](respondWithResult(_0x101b0c,null))[_0x8004('0x49')](handleError(_0x101b0c,null));};exports['addLogo']=function(_0x4f369d,_0x33e112,_0x23f343){if(_0x4f369d[_0x8004('0x50')]&&_0x4f369d[_0x8004('0x50')][_0x8004('0x51')]){_0x4f369d[_0x8004('0x4f')][_0x8004('0x52')]=_0x4f369d['file'][_0x8004('0x51')];}return db['Setting'][_0x8004('0x4e')]({'where':{'id':_0x4f369d[_0x8004('0x4b')]['id']}})[_0x8004('0x18')](handleEntityNotFound(_0x33e112,null))[_0x8004('0x18')](saveUpdates(_0x4f369d['body'],null))[_0x8004('0x18')](respondWithResult(_0x33e112,null))[_0x8004('0x49')](handleError(_0x33e112,null));};exports[_0x8004('0x53')]=function(_0x74211e,_0x41efdf,_0x533dc4){if(_0x74211e[_0x8004('0x50')]&&_0x74211e[_0x8004('0x50')][_0x8004('0x51')]){_0x74211e[_0x8004('0x4f')][_0x8004('0x54')]=_0x74211e[_0x8004('0x50')][_0x8004('0x51')];}return db[_0x8004('0x34')][_0x8004('0x4e')]({'where':{'id':_0x74211e['params']['id']}})[_0x8004('0x18')](handleEntityNotFound(_0x41efdf,null))['then'](saveUpdates(_0x74211e[_0x8004('0x4f')],null))[_0x8004('0x18')](respondWithResult(_0x41efdf,null))['catch'](handleError(_0x41efdf,null));};var utilLicense=require(_0x8004('0x12'));exports[_0x8004('0x55')]=function(_0x2548fb,_0xa4abfa,_0xdfa80f){var _0x2c1e1a=_0x8004('0x56');var _0xc7d853={'custom':![]};return utilLicense[_0x8004('0x57')]()['then'](function(_0x2e9c45){if(_0x2e9c45){_0xc7d853=_0x2e9c45;}return db[_0x8004('0x34')]['find']({'where':{'id':_0x2548fb[_0x8004('0x4b')]['id']},'attributes':['logo',_0x8004('0x54'),_0x8004('0x58'),_0x8004('0x59'),'defaultLogo',_0x8004('0x5a'),_0x8004('0x5b'),'defaultFavicon'],'raw':!![]});})[_0x8004('0x18')](handleEntityNotFound(_0xa4abfa,null))[_0x8004('0x18')](function(_0x476c2){if(_0x476c2){var _0x43e1bb=_0x476c2[_0x8004('0x52')]&&fs[_0x8004('0x5c')](path['join'](config[_0x8004('0x5d')],_0x2c1e1a,_[_0x8004('0x5e')](_0x476c2[_0x8004('0x52')])))?path['join'](config[_0x8004('0x5d')],_0x2c1e1a,_[_0x8004('0x5e')](_0x476c2['logo'])):path[_0x8004('0x5f')](config[_0x8004('0x5d')],_0x2c1e1a,_[_0x8004('0x5e')]('default_logo.svg'));var _0x40b00f='default'+_[_0x8004('0x60')](_0x8004('0x52'));if(_0x476c2[_0x40b00f]||!_0xc7d853['custom']){_0x43e1bb=path[_0x8004('0x5f')](config[_0x8004('0x5d')],_0x2c1e1a,_[_0x8004('0x5e')](_0x8004('0x61')));}if(!fs[_0x8004('0x5c')](_0x43e1bb)){throw new db[(_0x8004('0x62'))][(_0x8004('0x63'))](_[_0x8004('0x60')](_0x8004('0x52'))+_0x8004('0x64'));}return _0xa4abfa[_0x8004('0x65')](_0x43e1bb);}})[_0x8004('0x49')](handleError(_0xa4abfa,null));};var utilLicense=require(_0x8004('0x12'));exports['getLogoLogin']=function(_0x5e0d26,_0x327554,_0x4aabb9){var _0x4f7b94=_0x8004('0x56');var _0xd4e168={'custom':![]};return utilLicense[_0x8004('0x57')]()[_0x8004('0x18')](function(_0x3557a1){if(_0x3557a1){_0xd4e168=_0x3557a1;}return db[_0x8004('0x34')][_0x8004('0x4e')]({'where':{'id':_0x5e0d26[_0x8004('0x4b')]['id']},'attributes':[_0x8004('0x52'),_0x8004('0x54'),_0x8004('0x58'),_0x8004('0x59'),_0x8004('0x66'),_0x8004('0x5a'),_0x8004('0x5b'),_0x8004('0x67')],'raw':!![]});})[_0x8004('0x18')](handleEntityNotFound(_0x327554,null))[_0x8004('0x18')](function(_0x4e9485){if(_0x4e9485){var _0x1a4a52=_0x4e9485[_0x8004('0x54')]&&fs[_0x8004('0x5c')](path['join'](config[_0x8004('0x5d')],_0x4f7b94,_[_0x8004('0x5e')](_0x4e9485[_0x8004('0x54')])))?path[_0x8004('0x5f')](config[_0x8004('0x5d')],_0x4f7b94,_['toLower'](_0x4e9485['loginLogo'])):path[_0x8004('0x5f')](config[_0x8004('0x5d')],_0x4f7b94,_[_0x8004('0x5e')](_0x8004('0x68')));var _0x55d158='default'+_[_0x8004('0x60')](_0x8004('0x54'));if(_0x4e9485[_0x55d158]||!_0xd4e168[_0x8004('0x69')]){_0x1a4a52=path[_0x8004('0x5f')](config[_0x8004('0x5d')],_0x4f7b94,_[_0x8004('0x5e')](_0x8004('0x68')));}if(!fs[_0x8004('0x5c')](_0x1a4a52)){throw new db['Sequelize']['ValidationError'](_[_0x8004('0x60')](_0x8004('0x54'))+_0x8004('0x64'));}return _0x327554[_0x8004('0x65')](_0x1a4a52);}})['catch'](handleError(_0x327554,null));};exports[_0x8004('0x6a')]=function(_0x34bc38,_0x450e57){return db['Setting'][_0x8004('0x4e')]({'where':{'id':_0x34bc38['params']['id']},'attributes':[_0x8004('0x6b')]})[_0x8004('0x18')](respondWithResult(_0x450e57,null))[_0x8004('0x49')](handleError(_0x450e57,null));};exports['addPreferred']=function(_0x177e55,_0x3e101b,_0x1e844c){if(_0x177e55['file']&&_0x177e55[_0x8004('0x50')][_0x8004('0x51')]){_0x177e55['body']['preferred']=_0x177e55[_0x8004('0x50')][_0x8004('0x51')];}return db[_0x8004('0x34')][_0x8004('0x4e')]({'where':{'id':_0x177e55[_0x8004('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3e101b,null))[_0x8004('0x18')](saveUpdates(_0x177e55[_0x8004('0x4f')],null))[_0x8004('0x18')](respondWithResult(_0x3e101b,null))[_0x8004('0x49')](handleError(_0x3e101b,null));};var utilLicense=require(_0x8004('0x12'));exports[_0x8004('0x6c')]=function(_0xc431db,_0x2360b2,_0x26e9d3){var _0x4a557f=_0x8004('0x56');var _0x354f4c={'custom':![]};return utilLicense[_0x8004('0x57')]()[_0x8004('0x18')](function(_0x5dcb8a){if(_0x5dcb8a){_0x354f4c=_0x5dcb8a;}return db[_0x8004('0x34')][_0x8004('0x4e')]({'where':{'id':_0xc431db[_0x8004('0x4b')]['id']},'attributes':['logo',_0x8004('0x54'),_0x8004('0x58'),_0x8004('0x59'),'defaultLogo','defaultLoginLogo','defaultPreferred',_0x8004('0x67')],'raw':!![]});})[_0x8004('0x18')](handleEntityNotFound(_0x2360b2,null))[_0x8004('0x18')](function(_0x16d887){if(_0x16d887){var _0x3e7da5=_0x16d887[_0x8004('0x58')]&&fs[_0x8004('0x5c')](path[_0x8004('0x5f')](config[_0x8004('0x5d')],_0x4a557f,_['toLower'](_0x16d887[_0x8004('0x58')])))?path[_0x8004('0x5f')](config[_0x8004('0x5d')],_0x4a557f,_[_0x8004('0x5e')](_0x16d887[_0x8004('0x58')])):path['join'](config[_0x8004('0x5d')],_0x4a557f,_[_0x8004('0x5e')]('default_preferred.png'));var _0x3726b6=_0x8004('0x6d')+_[_0x8004('0x60')](_0x8004('0x58'));if(_0x16d887[_0x3726b6]||!_0x354f4c[_0x8004('0x69')]||!_0x354f4c[_0x8004('0x58')]){_0x3e7da5=path[_0x8004('0x5f')](config[_0x8004('0x5d')],_0x4a557f,_[_0x8004('0x5e')](_0x8004('0x6e')));}if(!fs[_0x8004('0x5c')](_0x3e7da5)){throw new db[(_0x8004('0x62'))][(_0x8004('0x63'))](_[_0x8004('0x60')](_0x8004('0x58'))+_0x8004('0x64'));}return _0x2360b2['download'](_0x3e7da5);}})[_0x8004('0x49')](handleError(_0x2360b2,null));};exports['addFavicon']=function(_0x2f5325,_0x4a8cb2,_0x43895f){if(_0x2f5325[_0x8004('0x50')]&&_0x2f5325[_0x8004('0x50')]['filename']){_0x2f5325[_0x8004('0x4f')]['favicon']=_0x2f5325['file'][_0x8004('0x51')];}return db['Setting'][_0x8004('0x4e')]({'where':{'id':_0x2f5325[_0x8004('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4a8cb2,null))[_0x8004('0x18')](saveUpdates(_0x2f5325[_0x8004('0x4f')],null))[_0x8004('0x18')](respondWithResult(_0x4a8cb2,null))[_0x8004('0x49')](handleError(_0x4a8cb2,null));};var utilLicense=require(_0x8004('0x12'));exports[_0x8004('0x6f')]=function(_0x6675cb,_0x5b6bd0,_0x3e32d8){var _0x3a68d5=_0x8004('0x56');var _0x5cba80={'custom':![]};return utilLicense['getLicense']()[_0x8004('0x18')](function(_0x3104c5){if(_0x3104c5){_0x5cba80=_0x3104c5;}return db[_0x8004('0x34')][_0x8004('0x4e')]({'where':{'id':_0x6675cb[_0x8004('0x4b')]['id']},'attributes':[_0x8004('0x52'),_0x8004('0x54'),_0x8004('0x58'),_0x8004('0x59'),_0x8004('0x66'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x5b6bd0,null))[_0x8004('0x18')](function(_0x27a10a){if(_0x27a10a){var _0x4fef50=_0x27a10a[_0x8004('0x59')]&&fs['existsSync'](path['join'](config[_0x8004('0x5d')],_0x3a68d5,_['toLower'](_0x27a10a['favicon'])))?path[_0x8004('0x5f')](config['root'],_0x3a68d5,_[_0x8004('0x5e')](_0x27a10a[_0x8004('0x59')])):path[_0x8004('0x5f')](config[_0x8004('0x5d')],_0x3a68d5,_['toLower']('default_favicon.ico'));var _0x39f6a3=_0x8004('0x6d')+_[_0x8004('0x60')](_0x8004('0x59'));if(_0x27a10a[_0x39f6a3]||!_0x5cba80[_0x8004('0x69')]){_0x4fef50=path[_0x8004('0x5f')](config[_0x8004('0x5d')],_0x3a68d5,_['toLower']('default_favicon.ico'));}if(!fs[_0x8004('0x5c')](_0x4fef50)){throw new db['Sequelize'][(_0x8004('0x63'))](_[_0x8004('0x60')]('favicon')+_0x8004('0x64'));}return _0x5b6bd0[_0x8004('0x65')](_0x4fef50);}})['catch'](handleError(_0x5b6bd0,null));};exports[_0x8004('0x70')]=function(_0x247e2b,_0x59204f){var _0x5eb893={'offset':moment()['utcOffset']()};_0x5eb893[_0x8004('0x71')]=moment()['utcOffset'](_0x5eb893[_0x8004('0x29')])['format'](_0x8004('0x72'));return _0x59204f[_0x8004('0x23')](0xc8)[_0x8004('0x31')](_0x5eb893);}; \ No newline at end of file +var _0xc47e=['ValidationError','\x20not\x20found','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','sendStatus','stack','name','send','index','map','Setting','fieldName','type','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultFavicon','existsSync','join','root','default_logo.svg','default','upperFirst','custom','toLower','Sequelize','download','defaultLoginLogo','defaultPreferred','default_loginLogo.svg'];(function(_0x396466,_0xe9857b){var _0x5e9ab4=function(_0x362f66){while(--_0x362f66){_0x396466['push'](_0x396466['shift']());}};_0x5e9ab4(++_0xe9857b);}(_0xc47e,0x17b));var _0xec47=function(_0x296809,_0x1c9665){_0x296809=_0x296809-0x0;var _0x18c0d3=_0xc47e[_0x296809];return _0x18c0d3;};'use strict';var emlformat=require(_0xec47('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xec47('0x1'));var jsonpatch=require(_0xec47('0x2'));var rp=require(_0xec47('0x3'));var moment=require(_0xec47('0x4'));var BPromise=require(_0xec47('0x5'));var Mustache=require(_0xec47('0x6'));var util=require('util');var path=require(_0xec47('0x7'));var sox=require('sox');var csv=require(_0xec47('0x8'));var ejs=require(_0xec47('0x9'));var fs=require('fs');var fs_extra=require(_0xec47('0xa'));var _=require('lodash');var squel=require(_0xec47('0xb'));var crypto=require(_0xec47('0xc'));var jsforce=require(_0xec47('0xd'));var deskjs=require(_0xec47('0xe'));var toCsv=require(_0xec47('0x8'));var querystring=require('querystring');var Papa=require(_0xec47('0xf'));var Redis=require(_0xec47('0x10'));var authService=require(_0xec47('0x11'));var qs=require(_0xec47('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xec47('0x13'));var logger=require(_0xec47('0x14'))('api');var utils=require(_0xec47('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xec47('0x16'));var db=require(_0xec47('0x17'))['db'];var jayson=require(_0xec47('0x18'));var client=jayson[_0xec47('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d9385,_0x30b96f,_0x3fbe56,_0x4b696e){return new BPromise(function(_0x2631ef,_0xe89f29){var _0x24fd9d=_0x4b696e||client;return _0x24fd9d[_0xec47('0x1a')](_0x1d9385,_0x3fbe56)[_0xec47('0x1b')](function(_0x378c51){logger[_0xec47('0x1c')](_0xec47('0x1d'),_0x30b96f,_0xec47('0x1e'));logger[_0xec47('0x1f')](_0xec47('0x20'),_0x30b96f,'request\x20sent',JSON[_0xec47('0x21')](_0x378c51));if(_0x378c51['error']){if(_0x378c51[_0xec47('0x22')][_0xec47('0x23')]===0x1f4){logger[_0xec47('0x22')](_0xec47('0x1d'),_0x30b96f,_0x378c51[_0xec47('0x22')][_0xec47('0x24')]);return _0xe89f29(_0x378c51[_0xec47('0x22')]['message']);}logger[_0xec47('0x22')](_0xec47('0x1d'),_0x30b96f,_0x378c51[_0xec47('0x22')][_0xec47('0x24')]);return _0x2631ef(_0x378c51[_0xec47('0x22')][_0xec47('0x24')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x30b96f,_0xec47('0x1e'));_0x2631ef(_0x378c51[_0xec47('0x25')][_0xec47('0x24')]);}})[_0xec47('0x26')](function(_0x715dd){logger['error'](_0xec47('0x1d'),_0x30b96f,_0x715dd);_0xe89f29(_0x715dd);});});}function respondWithStatusCode(_0x53ec77,_0x4ed56c){_0x4ed56c=_0x4ed56c||0xcc;return function(_0x2c8d72){if(_0x2c8d72){return _0x53ec77['sendStatus'](_0x4ed56c);}return _0x53ec77[_0xec47('0x27')](_0x4ed56c)[_0xec47('0x28')]();};}function respondWithResult(_0x405c0c,_0x28fe64){_0x28fe64=_0x28fe64||0xc8;return function(_0x46cdaa){if(_0x46cdaa){return _0x405c0c[_0xec47('0x27')](_0x28fe64)[_0xec47('0x29')](_0x46cdaa);}};}function respondWithFilteredResult(_0x9ccf20,_0xded5af){return function(_0x3cb887){if(_0x3cb887){var _0x2b9aba=typeof _0xded5af[_0xec47('0x2a')]===_0xec47('0x2b')&&typeof _0xded5af[_0xec47('0x2c')]===_0xec47('0x2b');var _0x3de86e=_0x3cb887['count'];var _0xd692fd=_0x2b9aba?0x0:_0xded5af[_0xec47('0x2a')];var _0x3370ee=_0x2b9aba?_0x3cb887[_0xec47('0x2d')]:_0xded5af[_0xec47('0x2a')]+_0xded5af['limit'];var _0x1fd433;if(_0x3370ee>=_0x3de86e){_0x3370ee=_0x3de86e;_0x1fd433=0xc8;}else{_0x1fd433=0xce;}_0x9ccf20[_0xec47('0x27')](_0x1fd433);return _0x9ccf20[_0xec47('0x2e')](_0xec47('0x2f'),_0xd692fd+'-'+_0x3370ee+'/'+_0x3de86e)[_0xec47('0x29')](_0x3cb887);}return null;};}function patchUpdates(_0x43ef1e){return function(_0x1e1609){try{jsonpatch[_0xec47('0x30')](_0x1e1609,_0x43ef1e,!![]);}catch(_0x228813){return BPromise['reject'](_0x228813);}return _0x1e1609['save']();};}function saveUpdates(_0x53a705,_0xabf455){return function(_0xeccfd5){if(_0xeccfd5){return _0xeccfd5[_0xec47('0x31')](_0x53a705)[_0xec47('0x1b')](function(_0x5ccc0a){return _0x5ccc0a;});}return null;};}function removeEntity(_0x1f5d1a,_0x329909){return function(_0x3a98ce){if(_0x3a98ce){return _0x3a98ce[_0xec47('0x32')]()['then'](function(){_0x1f5d1a['status'](0xcc)[_0xec47('0x28')]();});}};}function handleEntityNotFound(_0x198059,_0x36918a){return function(_0x89f10b){if(!_0x89f10b){_0x198059[_0xec47('0x33')](0x194);}return _0x89f10b;};}function handleError(_0xdc100a,_0x28098b){_0x28098b=_0x28098b||0x1f4;return function(_0x36f6d){logger[_0xec47('0x22')](_0x36f6d[_0xec47('0x34')]);if(_0x36f6d[_0xec47('0x35')]){delete _0x36f6d[_0xec47('0x35')];}_0xdc100a[_0xec47('0x27')](_0x28098b)[_0xec47('0x36')](_0x36f6d);};}exports[_0xec47('0x37')]=function(_0x3dfe54,_0x11b9f5){var _0x3a765b={},_0x5b8b7c={},_0x255ce9={'count':0x0,'rows':[]};var _0x548503=_[_0xec47('0x38')](db[_0xec47('0x39')]['rawAttributes'],function(_0x29baab){return{'name':_0x29baab[_0xec47('0x3a')],'type':_0x29baab[_0xec47('0x3b')]['key']};});_0x5b8b7c[_0xec47('0x3c')]=_[_0xec47('0x38')](_0x548503,'name');_0x5b8b7c[_0xec47('0x3d')]=_[_0xec47('0x3e')](_0x3dfe54[_0xec47('0x3d')]);_0x5b8b7c[_0xec47('0x3f')]=_['intersection'](_0x5b8b7c[_0xec47('0x3c')],_0x5b8b7c[_0xec47('0x3d')]);_0x3a765b[_0xec47('0x40')]=_[_0xec47('0x41')](_0x5b8b7c['model'],qs[_0xec47('0x42')](_0x3dfe54[_0xec47('0x3d')]['fields']));_0x3a765b[_0xec47('0x40')]=_0x3a765b['attributes']['length']?_0x3a765b[_0xec47('0x40')]:_0x5b8b7c['model'];if(!_0x3dfe54[_0xec47('0x3d')]['hasOwnProperty'](_0xec47('0x43'))){_0x3a765b[_0xec47('0x2c')]=qs['limit'](_0x3dfe54['query'][_0xec47('0x2c')]);_0x3a765b[_0xec47('0x2a')]=qs[_0xec47('0x2a')](_0x3dfe54['query'][_0xec47('0x2a')]);}_0x3a765b[_0xec47('0x44')]=qs[_0xec47('0x45')](_0x3dfe54[_0xec47('0x3d')][_0xec47('0x45')]);_0x3a765b[_0xec47('0x46')]=qs[_0xec47('0x3f')](_['pick'](_0x3dfe54[_0xec47('0x3d')],_0x5b8b7c[_0xec47('0x3f')]),_0x548503);if(_0x3dfe54['query'][_0xec47('0x47')]){_0x3a765b[_0xec47('0x46')]=_[_0xec47('0x48')](_0x3a765b[_0xec47('0x46')],{'$or':_[_0xec47('0x38')](_0x548503,function(_0x164ad2){if(_0x164ad2['type']!=='VIRTUAL'){var _0x55e8ee={};_0x55e8ee[_0x164ad2[_0xec47('0x35')]]={'$like':'%'+_0x3dfe54['query'][_0xec47('0x47')]+'%'};return _0x55e8ee;}})});}_0x3a765b=_['merge']({},_0x3a765b,_0x3dfe54[_0xec47('0x49')]);var _0x555097={'where':_0x3a765b[_0xec47('0x46')]};return db[_0xec47('0x39')][_0xec47('0x2d')](_0x555097)[_0xec47('0x1b')](function(_0x496f8d){_0x255ce9['count']=_0x496f8d;if(_0x3dfe54[_0xec47('0x3d')][_0xec47('0x4a')]){_0x3a765b[_0xec47('0x4b')]=[{'all':!![]}];}return db[_0xec47('0x39')][_0xec47('0x4c')](_0x3a765b);})['then'](function(_0x4d07ed){_0x255ce9[_0xec47('0x4d')]=_0x4d07ed;return _0x255ce9;})[_0xec47('0x1b')](respondWithFilteredResult(_0x11b9f5,_0x3a765b))[_0xec47('0x26')](handleError(_0x11b9f5,null));};exports[_0xec47('0x4e')]=function(_0x1d02b2,_0x5aea4d){var _0x5196af={'raw':![],'where':{'id':_0x1d02b2[_0xec47('0x4f')]['id']}},_0x3f0241={};_0x3f0241['model']=_[_0xec47('0x3e')](db['Setting'][_0xec47('0x50')]);_0x3f0241[_0xec47('0x3d')]=_['keys'](_0x1d02b2[_0xec47('0x3d')]);_0x3f0241[_0xec47('0x3f')]=_[_0xec47('0x41')](_0x3f0241[_0xec47('0x3c')],_0x3f0241['query']);_0x5196af['attributes']=_[_0xec47('0x41')](_0x3f0241[_0xec47('0x3c')],qs[_0xec47('0x42')](_0x1d02b2[_0xec47('0x3d')][_0xec47('0x42')]));_0x5196af[_0xec47('0x40')]=_0x5196af[_0xec47('0x40')]['length']?_0x5196af[_0xec47('0x40')]:_0x3f0241['model'];if(_0x1d02b2['query'][_0xec47('0x4a')]){_0x5196af[_0xec47('0x4b')]=[{'all':!![]}];}_0x5196af=_[_0xec47('0x48')]({},_0x5196af,_0x1d02b2['options']);return db[_0xec47('0x39')][_0xec47('0x51')](_0x5196af)[_0xec47('0x1b')](handleEntityNotFound(_0x5aea4d,null))[_0xec47('0x1b')](respondWithResult(_0x5aea4d,null))[_0xec47('0x26')](handleError(_0x5aea4d,null));};exports[_0xec47('0x31')]=function(_0x3c53ef,_0x1e1cfc){if(_0x3c53ef[_0xec47('0x52')]['id']){delete _0x3c53ef[_0xec47('0x52')]['id'];}return db[_0xec47('0x39')][_0xec47('0x51')]({'where':{'id':_0x3c53ef[_0xec47('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1e1cfc,null))[_0xec47('0x1b')](saveUpdates(_0x3c53ef['body'],null))[_0xec47('0x1b')](respondWithResult(_0x1e1cfc,null))['catch'](handleError(_0x1e1cfc,null));};exports[_0xec47('0x53')]=function(_0x50854a,_0x41ec14,_0x27218c){if(_0x50854a['file']&&_0x50854a[_0xec47('0x54')][_0xec47('0x55')]){_0x50854a[_0xec47('0x52')][_0xec47('0x56')]=_0x50854a[_0xec47('0x54')][_0xec47('0x55')];}return db['Setting']['find']({'where':{'id':_0x50854a[_0xec47('0x4f')]['id']}})['then'](handleEntityNotFound(_0x41ec14,null))['then'](saveUpdates(_0x50854a[_0xec47('0x52')],null))[_0xec47('0x1b')](respondWithResult(_0x41ec14,null))[_0xec47('0x26')](handleError(_0x41ec14,null));};exports[_0xec47('0x57')]=function(_0x34bc3a,_0x39b034,_0x337cd1){if(_0x34bc3a[_0xec47('0x54')]&&_0x34bc3a['file']['filename']){_0x34bc3a['body'][_0xec47('0x58')]=_0x34bc3a['file'][_0xec47('0x55')];}return db[_0xec47('0x39')][_0xec47('0x51')]({'where':{'id':_0x34bc3a['params']['id']}})[_0xec47('0x1b')](handleEntityNotFound(_0x39b034,null))[_0xec47('0x1b')](saveUpdates(_0x34bc3a[_0xec47('0x52')],null))[_0xec47('0x1b')](respondWithResult(_0x39b034,null))[_0xec47('0x26')](handleError(_0x39b034,null));};var utilLicense=require('../../config/license/util');exports[_0xec47('0x59')]=function(_0x7165cc,_0x1dae25,_0x18cbbb){var _0x2045cb=_0xec47('0x5a');var _0x1f31a3={'custom':![]};return utilLicense[_0xec47('0x5b')]()['then'](function(_0x33f577){if(_0x33f577){_0x1f31a3=_0x33f577;}return db[_0xec47('0x39')][_0xec47('0x51')]({'where':{'id':_0x7165cc[_0xec47('0x4f')]['id']},'attributes':['logo','loginLogo',_0xec47('0x5c'),_0xec47('0x5d'),_0xec47('0x5e'),'defaultLoginLogo','defaultPreferred',_0xec47('0x5f')],'raw':!![]});})['then'](handleEntityNotFound(_0x1dae25,null))[_0xec47('0x1b')](function(_0xd6f10a){if(_0xd6f10a){var _0x144853=_0xd6f10a[_0xec47('0x56')]&&fs[_0xec47('0x60')](path[_0xec47('0x61')](config[_0xec47('0x62')],_0x2045cb,_['toLower'](_0xd6f10a[_0xec47('0x56')])))?path[_0xec47('0x61')](config[_0xec47('0x62')],_0x2045cb,_['toLower'](_0xd6f10a[_0xec47('0x56')])):path[_0xec47('0x61')](config[_0xec47('0x62')],_0x2045cb,_['toLower'](_0xec47('0x63')));var _0x35e65a=_0xec47('0x64')+_[_0xec47('0x65')](_0xec47('0x56'));if(_0xd6f10a[_0x35e65a]||!_0x1f31a3[_0xec47('0x66')]){_0x144853=path['join'](config['root'],_0x2045cb,_[_0xec47('0x67')](_0xec47('0x63')));}if(!fs[_0xec47('0x60')](_0x144853)){throw new db[(_0xec47('0x68'))]['ValidationError'](_[_0xec47('0x65')](_0xec47('0x56'))+'\x20not\x20found');}return _0x1dae25[_0xec47('0x69')](_0x144853);}})['catch'](handleError(_0x1dae25,null));};var utilLicense=require(_0xec47('0x16'));exports['getLogoLogin']=function(_0x354b62,_0x4f3051,_0x2b2083){var _0x43ddd4='server/files/images/logos';var _0x21f5b6={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x34f058){if(_0x34f058){_0x21f5b6=_0x34f058;}return db[_0xec47('0x39')]['find']({'where':{'id':_0x354b62[_0xec47('0x4f')]['id']},'attributes':[_0xec47('0x56'),_0xec47('0x58'),_0xec47('0x5c'),'favicon','defaultLogo',_0xec47('0x6a'),_0xec47('0x6b'),_0xec47('0x5f')],'raw':!![]});})[_0xec47('0x1b')](handleEntityNotFound(_0x4f3051,null))[_0xec47('0x1b')](function(_0x534916){if(_0x534916){var _0xf398ed=_0x534916[_0xec47('0x58')]&&fs[_0xec47('0x60')](path[_0xec47('0x61')](config[_0xec47('0x62')],_0x43ddd4,_[_0xec47('0x67')](_0x534916[_0xec47('0x58')])))?path[_0xec47('0x61')](config['root'],_0x43ddd4,_[_0xec47('0x67')](_0x534916[_0xec47('0x58')])):path[_0xec47('0x61')](config[_0xec47('0x62')],_0x43ddd4,_['toLower'](_0xec47('0x6c')));var _0x5e28df=_0xec47('0x64')+_[_0xec47('0x65')]('loginLogo');if(_0x534916[_0x5e28df]||!_0x21f5b6[_0xec47('0x66')]){_0xf398ed=path[_0xec47('0x61')](config[_0xec47('0x62')],_0x43ddd4,_[_0xec47('0x67')](_0xec47('0x6c')));}if(!fs['existsSync'](_0xf398ed)){throw new db[(_0xec47('0x68'))][(_0xec47('0x6d'))](_[_0xec47('0x65')](_0xec47('0x58'))+_0xec47('0x6e'));}return _0x4f3051['download'](_0xf398ed);}})[_0xec47('0x26')](handleError(_0x4f3051,null));};exports[_0xec47('0x6f')]=function(_0x512b89,_0x1db9c2){return db[_0xec47('0x39')]['find']({'where':{'id':_0x512b89['params']['id']},'attributes':[_0xec47('0x70')]})[_0xec47('0x1b')](respondWithResult(_0x1db9c2,null))[_0xec47('0x26')](handleError(_0x1db9c2,null));};exports[_0xec47('0x71')]=function(_0x4144a7,_0x1983d0,_0x2fcdac){if(_0x4144a7[_0xec47('0x54')]&&_0x4144a7[_0xec47('0x54')]['filename']){_0x4144a7[_0xec47('0x52')][_0xec47('0x5c')]=_0x4144a7['file'][_0xec47('0x55')];}return db[_0xec47('0x39')]['find']({'where':{'id':_0x4144a7['params']['id']}})['then'](handleEntityNotFound(_0x1983d0,null))[_0xec47('0x1b')](saveUpdates(_0x4144a7['body'],null))[_0xec47('0x1b')](respondWithResult(_0x1983d0,null))[_0xec47('0x26')](handleError(_0x1983d0,null));};var utilLicense=require('../../config/license/util');exports[_0xec47('0x72')]=function(_0x2b8b54,_0x9933c7,_0x40a14e){var _0x10bc9a=_0xec47('0x5a');var _0x30f73d={'custom':![]};return utilLicense['getLicense']()[_0xec47('0x1b')](function(_0x376d2b){if(_0x376d2b){_0x30f73d=_0x376d2b;}return db['Setting'][_0xec47('0x51')]({'where':{'id':_0x2b8b54[_0xec47('0x4f')]['id']},'attributes':['logo',_0xec47('0x58'),_0xec47('0x5c'),_0xec47('0x5d'),_0xec47('0x5e'),_0xec47('0x6a'),'defaultPreferred',_0xec47('0x5f')],'raw':!![]});})['then'](handleEntityNotFound(_0x9933c7,null))['then'](function(_0x120fec){if(_0x120fec){var _0x5f0545=_0x120fec[_0xec47('0x5c')]&&fs[_0xec47('0x60')](path[_0xec47('0x61')](config[_0xec47('0x62')],_0x10bc9a,_[_0xec47('0x67')](_0x120fec[_0xec47('0x5c')])))?path[_0xec47('0x61')](config[_0xec47('0x62')],_0x10bc9a,_[_0xec47('0x67')](_0x120fec[_0xec47('0x5c')])):path['join'](config['root'],_0x10bc9a,_[_0xec47('0x67')](_0xec47('0x73')));var _0x480aa5=_0xec47('0x64')+_[_0xec47('0x65')](_0xec47('0x5c'));if(_0x120fec[_0x480aa5]||!_0x30f73d['custom']||!_0x30f73d['preferred']){_0x5f0545=path[_0xec47('0x61')](config['root'],_0x10bc9a,_[_0xec47('0x67')]('default_preferred.png'));}if(!fs[_0xec47('0x60')](_0x5f0545)){throw new db['Sequelize']['ValidationError'](_[_0xec47('0x65')](_0xec47('0x5c'))+_0xec47('0x6e'));}return _0x9933c7[_0xec47('0x69')](_0x5f0545);}})['catch'](handleError(_0x9933c7,null));};exports['addFavicon']=function(_0x27b5f3,_0x31df7a,_0x45a831){if(_0x27b5f3[_0xec47('0x54')]&&_0x27b5f3[_0xec47('0x54')][_0xec47('0x55')]){_0x27b5f3[_0xec47('0x52')][_0xec47('0x5d')]=_0x27b5f3['file']['filename'];}return db[_0xec47('0x39')][_0xec47('0x51')]({'where':{'id':_0x27b5f3[_0xec47('0x4f')]['id']}})['then'](handleEntityNotFound(_0x31df7a,null))[_0xec47('0x1b')](saveUpdates(_0x27b5f3[_0xec47('0x52')],null))[_0xec47('0x1b')](respondWithResult(_0x31df7a,null))['catch'](handleError(_0x31df7a,null));};var utilLicense=require(_0xec47('0x16'));exports['getFavicon']=function(_0x8273fb,_0x4e1e61,_0x292336){var _0x16bd65='server/files/images/logos';var _0x281821={'custom':![]};return utilLicense[_0xec47('0x5b')]()[_0xec47('0x1b')](function(_0x9d7a16){if(_0x9d7a16){_0x281821=_0x9d7a16;}return db[_0xec47('0x39')]['find']({'where':{'id':_0x8273fb[_0xec47('0x4f')]['id']},'attributes':[_0xec47('0x56'),_0xec47('0x58'),_0xec47('0x5c'),'favicon',_0xec47('0x5e'),'defaultLoginLogo',_0xec47('0x6b'),'defaultFavicon'],'raw':!![]});})[_0xec47('0x1b')](handleEntityNotFound(_0x4e1e61,null))[_0xec47('0x1b')](function(_0x28f227){if(_0x28f227){var _0x160172=_0x28f227[_0xec47('0x5d')]&&fs['existsSync'](path[_0xec47('0x61')](config[_0xec47('0x62')],_0x16bd65,_['toLower'](_0x28f227[_0xec47('0x5d')])))?path[_0xec47('0x61')](config[_0xec47('0x62')],_0x16bd65,_['toLower'](_0x28f227[_0xec47('0x5d')])):path['join'](config[_0xec47('0x62')],_0x16bd65,_[_0xec47('0x67')](_0xec47('0x74')));var _0x1553b6=_0xec47('0x64')+_['upperFirst'](_0xec47('0x5d'));if(_0x28f227[_0x1553b6]||!_0x281821[_0xec47('0x66')]){_0x160172=path[_0xec47('0x61')](config['root'],_0x16bd65,_[_0xec47('0x67')]('default_favicon.ico'));}if(!fs['existsSync'](_0x160172)){throw new db[(_0xec47('0x68'))][(_0xec47('0x6d'))](_[_0xec47('0x65')](_0xec47('0x5d'))+'\x20not\x20found');}return _0x4e1e61['download'](_0x160172);}})[_0xec47('0x26')](handleError(_0x4e1e61,null));};exports[_0xec47('0x75')]=function(_0x582933,_0x32d544){var _0x4bd741={'offset':moment()[_0xec47('0x76')]()};_0x4bd741[_0xec47('0x77')]=moment()[_0xec47('0x76')](_0x4bd741[_0xec47('0x2a')])[_0xec47('0x78')](_0xec47('0x79'));return _0x32d544['status'](0xc8)['send'](_0x4bd741);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index b3f1e1e..1f898e0 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x1f6951,_0x14a366){var _0x4b2190=function(_0x406481){while(--_0x406481){_0x1f6951['push'](_0x1f6951['shift']());}};_0x4b2190(++_0x14a366);}(_0xedd9,0xfc));var _0x9edd=function(_0x4ddb58,_0x214379){_0x4ddb58=_0x4ddb58-0x0;var _0x1382ad=_0xedd9[_0x4ddb58];return _0x1382ad;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Setting','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_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 55f666e..f4b6711 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 _0x13c0=['find','options','raw','where','attributes','include','map','model','info','catch','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','ShowSetting','Setting'];(function(_0x496d3c,_0x3eab1e){var _0x3700b8=function(_0x4c271c){while(--_0x4c271c){_0x496d3c['push'](_0x496d3c['shift']());}};_0x3700b8(++_0x3eab1e);}(_0x13c0,0x166));var _0x013c=function(_0x2fff83,_0x29d5fe){_0x2fff83=_0x2fff83-0x0;var _0xa2a722=_0x13c0[_0x2fff83];return _0xa2a722;};'use strict';var _=require('lodash');var util=require(_0x013c('0x0'));var moment=require(_0x013c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x013c('0x2'));var db=require(_0x013c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x013c('0x4'))(_0x013c('0x5'));var config=require(_0x013c('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x013c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x400450,_0x3006de,_0x1d7d94){return new BPromise(function(_0x517bba,_0x11b332){return client[_0x013c('0x8')](_0x400450,_0x1d7d94)[_0x013c('0x9')](function(_0x2e1fe5){logger['info'](_0x013c('0xa'),_0x3006de,_0x013c('0xb'));logger[_0x013c('0xc')]('Setting,\x20%s,\x20%s,\x20%s',_0x3006de,_0x013c('0xb'),JSON[_0x013c('0xd')](_0x2e1fe5));if(_0x2e1fe5[_0x013c('0xe')]){if(_0x2e1fe5[_0x013c('0xe')]['code']===0x1f4){logger[_0x013c('0xe')]('Setting,\x20%s,\x20%s',_0x3006de,_0x2e1fe5[_0x013c('0xe')][_0x013c('0xf')]);return _0x11b332(_0x2e1fe5[_0x013c('0xe')][_0x013c('0xf')]);}logger[_0x013c('0xe')](_0x013c('0xa'),_0x3006de,_0x2e1fe5['error'][_0x013c('0xf')]);return _0x517bba(_0x2e1fe5[_0x013c('0xe')][_0x013c('0xf')]);}else{logger['info'](_0x013c('0xa'),_0x3006de,_0x013c('0xb'));_0x517bba(_0x2e1fe5[_0x013c('0x10')][_0x013c('0xf')]);}})['catch'](function(_0x5dc24e){logger[_0x013c('0xe')](_0x013c('0xa'),_0x3006de,_0x5dc24e);_0x11b332(_0x5dc24e);});});}exports[_0x013c('0x11')]=function(_0x1d10d8){var _0x20e7b9=this;return new Promise(function(_0xe4a7b9,_0x4cd3ba){return db[_0x013c('0x12')][_0x013c('0x13')]({'raw':_0x1d10d8[_0x013c('0x14')]?_0x1d10d8['options'][_0x013c('0x15')]===undefined?!![]:![]:!![],'where':_0x1d10d8[_0x013c('0x14')]?_0x1d10d8[_0x013c('0x14')][_0x013c('0x16')]||null:null,'attributes':_0x1d10d8[_0x013c('0x14')]?_0x1d10d8['options'][_0x013c('0x17')]||null:null,'include':_0x1d10d8[_0x013c('0x14')]?_0x1d10d8[_0x013c('0x14')][_0x013c('0x18')]?_[_0x013c('0x19')](_0x1d10d8['options'][_0x013c('0x18')],function(_0x33a48f){return{'model':db[_0x33a48f[_0x013c('0x1a')]],'as':_0x33a48f['as'],'attributes':_0x33a48f[_0x013c('0x17')],'include':_0x33a48f[_0x013c('0x18')]?_[_0x013c('0x19')](_0x33a48f[_0x013c('0x18')],function(_0x97678){return{'model':db[_0x97678[_0x013c('0x1a')]],'as':_0x97678['as'],'attributes':_0x97678[_0x013c('0x17')],'include':_0x97678[_0x013c('0x18')]?_[_0x013c('0x19')](_0x97678[_0x013c('0x18')],function(_0x3226fb){return{'model':db[_0x3226fb['model']],'as':_0x3226fb['as'],'attributes':_0x3226fb['attributes']};}):[]};}):[]};}):[]:[]})[_0x013c('0x9')](function(_0xf661bb){logger[_0x013c('0x1b')](_0x013c('0x11'),_0x1d10d8);logger[_0x013c('0xc')]('ShowSetting',_0x1d10d8,JSON['stringify'](_0xf661bb));_0xe4a7b9(_0xf661bb);})[_0x013c('0x1c')](function(_0x212699){logger['error'](_0x013c('0x11'),_0x212699['message'],_0x1d10d8);_0x4cd3ba(_0x20e7b9['error'](0x1f4,_0x212699[_0x013c('0xf')]));});});}; \ No newline at end of file +var _0x8b6c=['request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','message','info','ShowSetting','find','options','raw','where','attributes','include','map','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Setting,\x20%s,\x20%s'];(function(_0x1d1839,_0x2e8d3d){var _0x321756=function(_0x12dfb4){while(--_0x12dfb4){_0x1d1839['push'](_0x1d1839['shift']());}};_0x321756(++_0x2e8d3d);}(_0x8b6c,0x13b));var _0xc8b6=function(_0x4d8777,_0x251dfe){_0x4d8777=_0x4d8777-0x0;var _0x283862=_0x8b6c[_0x4d8777];return _0x283862;};'use strict';var _=require(_0xc8b6('0x0'));var util=require('util');var moment=require(_0xc8b6('0x1'));var BPromise=require(_0xc8b6('0x2'));var rs=require(_0xc8b6('0x3'));var fs=require('fs');var Redis=require(_0xc8b6('0x4'));var db=require(_0xc8b6('0x5'))['db'];var utils=require(_0xc8b6('0x6'));var logger=require(_0xc8b6('0x7'))(_0xc8b6('0x8'));var config=require(_0xc8b6('0x9'));var jayson=require(_0xc8b6('0xa'));var client=jayson[_0xc8b6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ad272,_0x471ac7,_0x250cd6){return new BPromise(function(_0x18a4f3,_0x494441){return client[_0xc8b6('0xc')](_0x1ad272,_0x250cd6)[_0xc8b6('0xd')](function(_0x1804c5){logger['info'](_0xc8b6('0xe'),_0x471ac7,_0xc8b6('0xf'));logger[_0xc8b6('0x10')](_0xc8b6('0x11'),_0x471ac7,_0xc8b6('0xf'),JSON['stringify'](_0x1804c5));if(_0x1804c5[_0xc8b6('0x12')]){if(_0x1804c5['error']['code']===0x1f4){logger[_0xc8b6('0x12')](_0xc8b6('0xe'),_0x471ac7,_0x1804c5[_0xc8b6('0x12')][_0xc8b6('0x13')]);return _0x494441(_0x1804c5['error'][_0xc8b6('0x13')]);}logger['error']('Setting,\x20%s,\x20%s',_0x471ac7,_0x1804c5['error']['message']);return _0x18a4f3(_0x1804c5[_0xc8b6('0x12')][_0xc8b6('0x13')]);}else{logger[_0xc8b6('0x14')]('Setting,\x20%s,\x20%s',_0x471ac7,_0xc8b6('0xf'));_0x18a4f3(_0x1804c5['result'][_0xc8b6('0x13')]);}})['catch'](function(_0x51a76f){logger[_0xc8b6('0x12')](_0xc8b6('0xe'),_0x471ac7,_0x51a76f);_0x494441(_0x51a76f);});});}exports[_0xc8b6('0x15')]=function(_0x3feab8){var _0x2b17ef=this;return new Promise(function(_0x379077,_0x270e6d){return db['Setting'][_0xc8b6('0x16')]({'raw':_0x3feab8[_0xc8b6('0x17')]?_0x3feab8['options'][_0xc8b6('0x18')]===undefined?!![]:![]:!![],'where':_0x3feab8[_0xc8b6('0x17')]?_0x3feab8[_0xc8b6('0x17')][_0xc8b6('0x19')]||null:null,'attributes':_0x3feab8[_0xc8b6('0x17')]?_0x3feab8[_0xc8b6('0x17')][_0xc8b6('0x1a')]||null:null,'include':_0x3feab8[_0xc8b6('0x17')]?_0x3feab8['options'][_0xc8b6('0x1b')]?_[_0xc8b6('0x1c')](_0x3feab8[_0xc8b6('0x17')][_0xc8b6('0x1b')],function(_0x2ae7f6){return{'model':db[_0x2ae7f6[_0xc8b6('0x1d')]],'as':_0x2ae7f6['as'],'attributes':_0x2ae7f6[_0xc8b6('0x1a')],'include':_0x2ae7f6[_0xc8b6('0x1b')]?_['map'](_0x2ae7f6[_0xc8b6('0x1b')],function(_0x47e8cd){return{'model':db[_0x47e8cd[_0xc8b6('0x1d')]],'as':_0x47e8cd['as'],'attributes':_0x47e8cd[_0xc8b6('0x1a')],'include':_0x47e8cd[_0xc8b6('0x1b')]?_['map'](_0x47e8cd[_0xc8b6('0x1b')],function(_0x26d1e3){return{'model':db[_0x26d1e3[_0xc8b6('0x1d')]],'as':_0x26d1e3['as'],'attributes':_0x26d1e3[_0xc8b6('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5baef8){logger[_0xc8b6('0x14')](_0xc8b6('0x15'),_0x3feab8);logger[_0xc8b6('0x10')](_0xc8b6('0x15'),_0x3feab8,JSON['stringify'](_0x5baef8));_0x379077(_0x5baef8);})['catch'](function(_0x1b0f55){logger['error'](_0xc8b6('0x15'),_0x1b0f55[_0xc8b6('0x13')],_0x3feab8);_0x270e6d(_0x2b17ef[_0xc8b6('0x12')](0x1f4,_0x1b0f55[_0xc8b6('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 5f1cf8b..46d216a 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 _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x585133,_0x2412a1){var _0x18254a=function(_0x4c8aaf){while(--_0x4c8aaf){_0x585133['push'](_0x585133['shift']());}};_0x18254a(++_0x2412a1);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file +var _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x45dc60,_0x5b6ac7){var _0x3765ba=function(_0x2e9586){while(--_0x2e9586){_0x45dc60['push'](_0x45dc60['shift']());}};_0x3765ba(++_0x5b6ac7);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 95077b3..188dadb 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 _0xc979=['clicksend','plivo','clickatell','bandwidth','csc','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','randomstring','STRING','name','ENUM','twilio','skebby','connectel'];(function(_0x3e26bd,_0x1f46d2){var _0x3da8c0=function(_0x198e31){while(--_0x198e31){_0x3e26bd['push'](_0x3e26bd['shift']());}};_0x3da8c0(++_0x1f46d2);}(_0xc979,0x1bb));var _0x9c97=function(_0x3bce5f,_0xb551ef){_0x3bce5f=_0x3bce5f-0x0;var _0xa8c448=_0xc979[_0x3bce5f];return _0xa8c448;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x9c97('0x0'));module['exports']={'name':{'type':Sequelize[_0x9c97('0x1')],'unique':_0x9c97('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x9c97('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0x9c97('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0x9c97('0x1')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x9c97('0x1')]},'type':{'type':Sequelize[_0x9c97('0x3')](_0x9c97('0x4'),_0x9c97('0x5'),_0x9c97('0x6'),_0x9c97('0x7'),_0x9c97('0x8'),_0x9c97('0x9'),_0x9c97('0xa'),_0x9c97('0xb'),'infobip','intelepeer')},'accountSid':{'type':Sequelize[_0x9c97('0x1')]},'authId':{'type':Sequelize[_0x9c97('0x1')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x9c97('0x3')]('SI','TI','GP')},'username':{'type':Sequelize[_0x9c97('0x1')]},'password':{'type':Sequelize[_0x9c97('0x1')]},'apiKey':{'type':Sequelize[_0x9c97('0x1')]},'applicationId':{'type':Sequelize[_0x9c97('0x1')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x9c97('0x1')]},'deliveryReport':{'type':Sequelize[_0x9c97('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0x9c97('0x1')]},'notificationTemplate':{'type':Sequelize[_0x9c97('0xd')],'defaultValue':function(){return _0x9c97('0xe');}},'notificationSound':{'type':Sequelize[_0x9c97('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9c97('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x9c97('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9c97('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9c97('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x9c97('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9c97('0xf')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x9c97('0xc')],'defaultValue':![],'comment':_0x9c97('0x10'),'set':function(_0x5f5435){if(!_0x5f5435)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x9c97('0x11')]('mandatoryDisposition',_0x5f5435);}}}; \ No newline at end of file +var _0x36f5=['clicksend','plivo','clickatell','infobip','intelepeer','ENUM','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','STRING','name','twilio','skebby'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x36f5,0x1e8));var _0x536f=function(_0x2b45c8,_0x4adc0c){_0x2b45c8=_0x2b45c8-0x0;var _0x295268=_0x36f5[_0x2b45c8];return _0x295268;};'use strict';var Sequelize=require(_0x536f('0x0'));var rs=require(_0x536f('0x1'));module['exports']={'name':{'type':Sequelize[_0x536f('0x2')],'unique':_0x536f('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x536f('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x536f('0x4'),_0x536f('0x5'),'connectel',_0x536f('0x6'),_0x536f('0x7'),_0x536f('0x8'),'bandwidth','csc',_0x536f('0x9'),_0x536f('0xa'))},'accountSid':{'type':Sequelize[_0x536f('0x2')]},'authId':{'type':Sequelize[_0x536f('0x2')]},'authToken':{'type':Sequelize[_0x536f('0x2')]},'smsMethod':{'type':Sequelize[_0x536f('0xb')]('SI','TI','GP')},'username':{'type':Sequelize[_0x536f('0x2')]},'password':{'type':Sequelize[_0x536f('0x2')]},'apiKey':{'type':Sequelize[_0x536f('0x2')]},'applicationId':{'type':Sequelize[_0x536f('0x2')]},'accountId':{'type':Sequelize[_0x536f('0x2')]},'senderString':{'type':Sequelize[_0x536f('0x2')]},'deliveryReport':{'type':Sequelize[_0x536f('0xc')],'defaultValue':![]},'description':{'type':Sequelize[_0x536f('0x2')]},'notificationTemplate':{'type':Sequelize[_0x536f('0xd')],'defaultValue':function(){return _0x536f('0xe');}},'notificationSound':{'type':Sequelize[_0x536f('0xc')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x536f('0xc')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x536f('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x536f('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x536f('0xc')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x536f('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x536f('0xc')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x536f('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x536f('0xf')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x536f('0x10'),'set':function(_0x426d09){if(!_0x426d09)this[_0x536f('0x11')](_0x536f('0x12'),null);this[_0x536f('0x11')]('mandatoryDisposition',_0x426d09);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index aae397f..7d86c43 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 _0xbf64=['filters','merge','VIRTUAL','findAll','includeAll','include','options','find','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','SmsAccountId','Disposition','findOne','pick','filter','rows','removeDispositions','ids','CannedAnswer','removeAnswers','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','Sequelize','ValidationError','createdAt','updatedAt','difference','CompanyId','ListId','mobile','twilio','Body','MessageSid','skebby','from','sender','text','connectel','clicksend','messageId','message_id','plivo','From','Text','infobip','results','originatingAddress','segmentedMessage','fromNumber','replyMessageId','bandwidth','intelepeer','refid','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','list','omit','SmsInteraction','spread','interaction','created','push','close','*,*,*,*','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','queueId','queue','waitForTheAssignedQueue','receiveMessage','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','\x0a','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','stack','finally','getApplications','getInteractions','Contact','User','fullname','internal','Tag','color','tag','to\x20is\x20mandatory','List','DESC','out','SmsMessage','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','groupName','DELIVERED','redif','error_code','clickatell','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','statusGet','csc','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','path','sox','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsAccount.socket','register','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','get','SmsAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x5463c2,_0x22c4cc){var _0x5a7da7=function(_0x4c16b5){while(--_0x4c16b5){_0x5463c2['push'](_0x5463c2['shift']());}};_0x5a7da7(++_0x22c4cc);}(_0xbf64,0x97));var _0x4bf6=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xbf64[_0x1a72f3];return _0x57ef47;};'use strict';var emlformat=require(_0x4bf6('0x0'));var rimraf=require(_0x4bf6('0x1'));var zipdir=require(_0x4bf6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4bf6('0x3'));var moment=require(_0x4bf6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x4bf6('0x5'));var sox=require(_0x4bf6('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4bf6('0x7'));var _=require(_0x4bf6('0x8'));var squel=require(_0x4bf6('0x9'));var crypto=require(_0x4bf6('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4bf6('0xb'));var querystring=require(_0x4bf6('0xc'));var Papa=require(_0x4bf6('0xd'));var Redis=require(_0x4bf6('0xe'));var authService=require(_0x4bf6('0xf'));var qs=require(_0x4bf6('0x10'));var as=require(_0x4bf6('0x11'));var hardwareService=require(_0x4bf6('0x12'));var logger=require(_0x4bf6('0x13'))('api');var utils=require(_0x4bf6('0x14'));var config=require(_0x4bf6('0x15'));var licenseUtil=require(_0x4bf6('0x16'));var db=require(_0x4bf6('0x17'))['db'];config[_0x4bf6('0x18')]=_[_0x4bf6('0x19')](config[_0x4bf6('0x18')],{'host':_0x4bf6('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4bf6('0x18')]));require(_0x4bf6('0x1b'))[_0x4bf6('0x1c')](socket);var jayson=require(_0x4bf6('0x1d'));var client=jayson[_0x4bf6('0x1e')][_0x4bf6('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x2cea97,_0x3ac17a,_0x16f777,_0x325715){return new BPromise(function(_0x2f44b5,_0x535aef){var _0x452a43=_0x325715||client;return _0x452a43[_0x4bf6('0x20')](_0x2cea97,_0x16f777)[_0x4bf6('0x21')](function(_0x34a9e7){logger[_0x4bf6('0x22')](_0x4bf6('0x23'),_0x3ac17a,_0x4bf6('0x24'));logger['debug'](_0x4bf6('0x25'),_0x3ac17a,'request\x20sent',JSON[_0x4bf6('0x26')](_0x34a9e7));if(_0x34a9e7[_0x4bf6('0x27')]){if(_0x34a9e7['error'][_0x4bf6('0x28')]===0x1f4){logger['error'](_0x4bf6('0x23'),_0x3ac17a,_0x34a9e7[_0x4bf6('0x27')]['message']);return _0x535aef(_0x34a9e7[_0x4bf6('0x27')][_0x4bf6('0x29')]);}logger[_0x4bf6('0x27')](_0x4bf6('0x23'),_0x3ac17a,_0x34a9e7['error']['message']);return _0x2f44b5(_0x34a9e7[_0x4bf6('0x27')]['message']);}else{logger[_0x4bf6('0x22')](_0x4bf6('0x23'),_0x3ac17a,_0x4bf6('0x24'));_0x2f44b5(_0x34a9e7['result'][_0x4bf6('0x29')]);}})['catch'](function(_0x1e080f){logger[_0x4bf6('0x27')](_0x4bf6('0x23'),_0x3ac17a,_0x1e080f);_0x535aef(_0x1e080f);});});}function respondWithStatusCode(_0x3185d1,_0x37dc1f){_0x37dc1f=_0x37dc1f||0xcc;return function(_0x2ebaa1){if(_0x2ebaa1){return _0x3185d1[_0x4bf6('0x2a')](_0x37dc1f);}return _0x3185d1[_0x4bf6('0x2b')](_0x37dc1f)[_0x4bf6('0x2c')]();};}function respondWithResult(_0x4b10a5,_0x5c21a7){_0x5c21a7=_0x5c21a7||0xc8;return function(_0xb75f9){if(_0xb75f9){return _0x4b10a5[_0x4bf6('0x2b')](_0x5c21a7)[_0x4bf6('0x2d')](_0xb75f9);}};}function respondWithFilteredResult(_0x1c1c0c,_0x300a7a){return function(_0x4f6ca3){if(_0x4f6ca3){var _0x3136b8=typeof _0x300a7a[_0x4bf6('0x2e')]===_0x4bf6('0x2f')&&typeof _0x300a7a[_0x4bf6('0x30')]===_0x4bf6('0x2f');var _0x4b9f2a=_0x4f6ca3[_0x4bf6('0x31')];var _0x24ab7e=_0x3136b8?0x0:_0x300a7a[_0x4bf6('0x2e')];var _0x240a3d=_0x3136b8?_0x4f6ca3['count']:_0x300a7a[_0x4bf6('0x2e')]+_0x300a7a['limit'];var _0x2d3f9b;if(_0x240a3d>=_0x4b9f2a){_0x240a3d=_0x4b9f2a;_0x2d3f9b=0xc8;}else{_0x2d3f9b=0xce;}_0x1c1c0c[_0x4bf6('0x2b')](_0x2d3f9b);return _0x1c1c0c['set'](_0x4bf6('0x32'),_0x24ab7e+'-'+_0x240a3d+'/'+_0x4b9f2a)[_0x4bf6('0x2d')](_0x4f6ca3);}return null;};}function patchUpdates(_0x5366eb){return function(_0x40e116){try{jsonpatch[_0x4bf6('0x33')](_0x40e116,_0x5366eb,!![]);}catch(_0x388f71){return BPromise[_0x4bf6('0x34')](_0x388f71);}return _0x40e116[_0x4bf6('0x35')]();};}function saveUpdates(_0x385447,_0x4b539e){return function(_0x56c235){if(_0x56c235){return _0x56c235['update'](_0x385447)[_0x4bf6('0x21')](function(_0xe4d2a7){return _0xe4d2a7;});}return null;};}function removeEntity(_0x5a910b,_0x20e9f1){return function(_0x4d3745){if(_0x4d3745){return _0x4d3745[_0x4bf6('0x36')]()[_0x4bf6('0x21')](function(){var _0x1d1f0a=_0x4d3745[_0x4bf6('0x37')]({'plain':!![]});var _0x324a0f=_0x4bf6('0x38');return db[_0x4bf6('0x39')][_0x4bf6('0x36')]({'where':{'type':_0x324a0f,'resourceId':_0x1d1f0a['id']}})[_0x4bf6('0x21')](function(){return _0x4d3745;});})['then'](function(){_0x5a910b[_0x4bf6('0x2b')](0xcc)[_0x4bf6('0x2c')]();});}};}function handleEntityNotFound(_0x1b2cab,_0x216a5d){return function(_0xa76fc8){if(!_0xa76fc8){_0x1b2cab['sendStatus'](0x194);}return _0xa76fc8;};}function handleError(_0x34bee1,_0x340c6e){_0x340c6e=_0x340c6e||0x1f4;return function(_0x54994f){logger['error'](_0x54994f['stack']);if(_0x54994f['name']){delete _0x54994f[_0x4bf6('0x3a')];}_0x34bee1[_0x4bf6('0x2b')](_0x340c6e)[_0x4bf6('0x3b')](_0x54994f);};}exports[_0x4bf6('0x3c')]=function(_0x1ff541,_0x10fc82){var _0x593685={'include':[{'model':db[_0x4bf6('0x3d')],'as':_0x4bf6('0x3e')}]},_0x1523cd={},_0x47ffb1={'count':0x0,'rows':[]};var _0x4b8d51=_[_0x4bf6('0x3f')](db[_0x4bf6('0x40')][_0x4bf6('0x41')],function(_0x581f23){return{'name':_0x581f23['fieldName'],'type':_0x581f23[_0x4bf6('0x42')][_0x4bf6('0x43')]};});_0x1523cd['model']=_[_0x4bf6('0x3f')](_0x4b8d51,_0x4bf6('0x3a'));_0x1523cd['query']=_[_0x4bf6('0x44')](_0x1ff541[_0x4bf6('0x45')]);_0x1523cd['filters']=_[_0x4bf6('0x46')](_0x1523cd[_0x4bf6('0x47')],_0x1523cd['query']);_0x593685[_0x4bf6('0x48')]=_[_0x4bf6('0x46')](_0x1523cd[_0x4bf6('0x47')],qs[_0x4bf6('0x49')](_0x1ff541[_0x4bf6('0x45')]['fields']));_0x593685[_0x4bf6('0x48')]=_0x593685[_0x4bf6('0x48')][_0x4bf6('0x4a')]?_0x593685[_0x4bf6('0x48')]:_0x1523cd['model'];if(!_0x1ff541[_0x4bf6('0x45')][_0x4bf6('0x4b')](_0x4bf6('0x4c'))){_0x593685[_0x4bf6('0x30')]=qs[_0x4bf6('0x30')](_0x1ff541['query'][_0x4bf6('0x30')]);_0x593685[_0x4bf6('0x2e')]=qs[_0x4bf6('0x2e')](_0x1ff541[_0x4bf6('0x45')][_0x4bf6('0x2e')]);}_0x593685[_0x4bf6('0x4d')]=qs[_0x4bf6('0x4e')](_0x1ff541[_0x4bf6('0x45')][_0x4bf6('0x4e')]);_0x593685[_0x4bf6('0x4f')]=qs[_0x4bf6('0x50')](_['pick'](_0x1ff541[_0x4bf6('0x45')],_0x1523cd['filters']),_0x4b8d51);if(_0x1ff541[_0x4bf6('0x45')]['filter']){_0x593685['where']=_[_0x4bf6('0x51')](_0x593685[_0x4bf6('0x4f')],{'$or':_[_0x4bf6('0x3f')](_0x4b8d51,function(_0x5857f1){if(_0x5857f1[_0x4bf6('0x42')]!==_0x4bf6('0x52')){var _0x19ec53={};_0x19ec53[_0x5857f1[_0x4bf6('0x3a')]]={'$like':'%'+_0x1ff541[_0x4bf6('0x45')]['filter']+'%'};return _0x19ec53;}})});}_0x593685=_[_0x4bf6('0x51')]({},_0x593685,_0x1ff541['options']);var _0x59aaf3={'where':_0x593685[_0x4bf6('0x4f')]};return db[_0x4bf6('0x40')][_0x4bf6('0x31')](_0x59aaf3)[_0x4bf6('0x21')](function(_0x16dc51){_0x47ffb1[_0x4bf6('0x31')]=_0x16dc51;if(_0x1ff541[_0x4bf6('0x45')]['includeAll']){_0x593685['include']=[{'all':!![]}];}return db[_0x4bf6('0x40')][_0x4bf6('0x53')](_0x593685);})['then'](function(_0x220993){_0x47ffb1['rows']=_0x220993;return _0x47ffb1;})[_0x4bf6('0x21')](respondWithFilteredResult(_0x10fc82,_0x593685))['catch'](handleError(_0x10fc82,null));};exports['show']=function(_0x582768,_0x4fc7cf){var _0x77455d={'raw':![],'where':{'id':_0x582768['params']['id']},'include':[{'model':db[_0x4bf6('0x3d')],'as':'mandatoryDispositionPause'}]},_0x2a4b0b={};_0x2a4b0b['model']=_[_0x4bf6('0x44')](db[_0x4bf6('0x40')][_0x4bf6('0x41')]);_0x2a4b0b[_0x4bf6('0x45')]=_[_0x4bf6('0x44')](_0x582768[_0x4bf6('0x45')]);_0x2a4b0b[_0x4bf6('0x50')]=_[_0x4bf6('0x46')](_0x2a4b0b[_0x4bf6('0x47')],_0x2a4b0b[_0x4bf6('0x45')]);_0x77455d[_0x4bf6('0x48')]=_['intersection'](_0x2a4b0b[_0x4bf6('0x47')],qs[_0x4bf6('0x49')](_0x582768[_0x4bf6('0x45')][_0x4bf6('0x49')]));_0x77455d[_0x4bf6('0x48')]=_0x77455d[_0x4bf6('0x48')][_0x4bf6('0x4a')]?_0x77455d['attributes']:_0x2a4b0b['model'];if(_0x582768['query'][_0x4bf6('0x54')]){_0x77455d[_0x4bf6('0x55')]=[{'all':!![]}];}_0x77455d=_['merge']({},_0x77455d,_0x582768[_0x4bf6('0x56')]);return db[_0x4bf6('0x40')][_0x4bf6('0x57')](_0x77455d)[_0x4bf6('0x21')](handleEntityNotFound(_0x4fc7cf,null))[_0x4bf6('0x21')](respondWithResult(_0x4fc7cf,null))[_0x4bf6('0x58')](handleError(_0x4fc7cf,null));};exports[_0x4bf6('0x59')]=function(_0x5572b1,_0x1672c8){return db['SmsAccount'][_0x4bf6('0x59')](_0x5572b1['body'],{})['then'](function(_0x5dd0d9){var _0x3b597f=_0x5572b1['user'][_0x4bf6('0x37')]({'plain':!![]});if(!_0x3b597f)throw new Error(_0x4bf6('0x5a'));if(_0x3b597f[_0x4bf6('0x5b')]===_0x4bf6('0x5c')){var _0xef62f7=_0x5dd0d9['get']({'plain':!![]});var _0x46aa09=_0x4bf6('0x38');return db[_0x4bf6('0x5d')][_0x4bf6('0x57')]({'where':{'name':_0x46aa09,'userProfileId':_0x3b597f['userProfileId']},'raw':!![]})[_0x4bf6('0x21')](function(_0x256125){if(_0x256125&&_0x256125[_0x4bf6('0x5e')]===0x0){return db[_0x4bf6('0x39')][_0x4bf6('0x59')]({'name':_0xef62f7[_0x4bf6('0x3a')],'resourceId':_0xef62f7['id'],'type':_0x256125[_0x4bf6('0x3a')],'sectionId':_0x256125['id']},{})[_0x4bf6('0x21')](function(){return _0x5dd0d9;});}else{return _0x5dd0d9;}})[_0x4bf6('0x58')](function(_0x34d872){logger[_0x4bf6('0x27')](_0x4bf6('0x5f'),_0x34d872);throw _0x34d872;});}return _0x5dd0d9;})[_0x4bf6('0x21')](respondWithResult(_0x1672c8,0xc9))[_0x4bf6('0x58')](handleError(_0x1672c8,null));};exports[_0x4bf6('0x60')]=function(_0x3218d0,_0xab2020){if(_0x3218d0[_0x4bf6('0x61')]['id']){delete _0x3218d0['body']['id'];}return db[_0x4bf6('0x40')]['find']({'where':{'id':_0x3218d0[_0x4bf6('0x62')]['id']},'include':[{'model':db[_0x4bf6('0x3d')],'as':_0x4bf6('0x3e')}]})[_0x4bf6('0x21')](handleEntityNotFound(_0xab2020,null))[_0x4bf6('0x21')](saveUpdates(_0x3218d0[_0x4bf6('0x61')],null))[_0x4bf6('0x21')](respondWithResult(_0xab2020,null))[_0x4bf6('0x58')](handleError(_0xab2020,null));};exports[_0x4bf6('0x36')]=function(_0x5756a7,_0x5e4c12){return db[_0x4bf6('0x40')][_0x4bf6('0x57')]({'where':{'id':_0x5756a7[_0x4bf6('0x62')]['id']}})['then'](handleEntityNotFound(_0x5e4c12,null))['then'](removeEntity(_0x5e4c12,null))[_0x4bf6('0x58')](handleError(_0x5e4c12,null));};exports[_0x4bf6('0x63')]=function(_0x35f95b,_0x57025f){return db[_0x4bf6('0x40')][_0x4bf6('0x63')]()[_0x4bf6('0x21')](respondWithResult(_0x57025f,null))[_0x4bf6('0x58')](handleError(_0x57025f,null));};exports['addDisposition']=function(_0x58374d,_0x330a55,_0x4b3fee){if(_0x58374d[_0x4bf6('0x61')]['id']){delete _0x58374d[_0x4bf6('0x61')]['id'];}return db['SmsAccount'][_0x4bf6('0x57')]({'where':{'id':_0x58374d['params']['id']}})[_0x4bf6('0x21')](handleEntityNotFound(_0x330a55,null))[_0x4bf6('0x21')](function(_0x40bfc8){if(_0x40bfc8){_0x58374d[_0x4bf6('0x61')][_0x4bf6('0x64')]=_0x40bfc8['id'];return db[_0x4bf6('0x65')][_0x4bf6('0x59')](_0x58374d['body']);}})[_0x4bf6('0x21')](respondWithResult(_0x330a55,null))[_0x4bf6('0x58')](handleError(_0x330a55,null));};exports['getDispositions']=function(_0x406c28,_0x9756a8,_0x4c8339){var _0x3ac6c8={'raw':![],'where':{}};var _0x23b12e={};var _0x1d4860={'count':0x0,'rows':[]};return db[_0x4bf6('0x40')][_0x4bf6('0x66')]({'where':{'id':_0x406c28[_0x4bf6('0x62')]['id']}})['then'](handleEntityNotFound(_0x9756a8,null))['then'](function(_0x4347eb){if(_0x4347eb){_0x23b12e[_0x4bf6('0x47')]=_[_0x4bf6('0x44')](db['Disposition'][_0x4bf6('0x41')]);_0x23b12e[_0x4bf6('0x45')]=_[_0x4bf6('0x44')](_0x406c28[_0x4bf6('0x45')]);_0x23b12e[_0x4bf6('0x50')]=_[_0x4bf6('0x46')](_0x23b12e[_0x4bf6('0x47')],_0x23b12e[_0x4bf6('0x45')]);_0x3ac6c8[_0x4bf6('0x48')]=_[_0x4bf6('0x46')](_0x23b12e['model'],qs[_0x4bf6('0x49')](_0x406c28[_0x4bf6('0x45')][_0x4bf6('0x49')]));_0x3ac6c8['attributes']=_0x3ac6c8[_0x4bf6('0x48')][_0x4bf6('0x4a')]?_0x3ac6c8[_0x4bf6('0x48')]:_0x23b12e[_0x4bf6('0x47')];if(!_0x406c28[_0x4bf6('0x45')][_0x4bf6('0x4b')](_0x4bf6('0x4c'))){_0x3ac6c8[_0x4bf6('0x30')]=qs[_0x4bf6('0x30')](_0x406c28[_0x4bf6('0x45')][_0x4bf6('0x30')]);_0x3ac6c8[_0x4bf6('0x2e')]=qs[_0x4bf6('0x2e')](_0x406c28[_0x4bf6('0x45')]['offset']);}_0x3ac6c8[_0x4bf6('0x4d')]=qs['sort'](_0x406c28[_0x4bf6('0x45')][_0x4bf6('0x4e')]);_0x3ac6c8[_0x4bf6('0x4f')]=qs[_0x4bf6('0x50')](_[_0x4bf6('0x67')](_0x406c28[_0x4bf6('0x45')],_0x23b12e[_0x4bf6('0x50')]));_0x3ac6c8[_0x4bf6('0x4f')]['SmsAccountId']=_0x4347eb['id'];if(_0x406c28[_0x4bf6('0x45')][_0x4bf6('0x68')]){_0x3ac6c8['where']=_['merge'](_0x3ac6c8['where'],{'$or':_[_0x4bf6('0x3f')](_0x3ac6c8[_0x4bf6('0x48')],function(_0x293056){var _0x324a75={};_0x324a75[_0x293056]={'$like':'%'+_0x406c28[_0x4bf6('0x45')]['filter']+'%'};return _0x324a75;})});}_0x3ac6c8=_[_0x4bf6('0x51')]({},_0x3ac6c8,_0x406c28[_0x4bf6('0x56')]);return db['Disposition'][_0x4bf6('0x31')]({'where':_0x3ac6c8[_0x4bf6('0x4f')]})[_0x4bf6('0x21')](function(_0x532102){_0x1d4860[_0x4bf6('0x31')]=_0x532102;if(_0x406c28[_0x4bf6('0x45')]['includeAll']){_0x3ac6c8[_0x4bf6('0x55')]=[{'all':!![]}];}return db['Disposition'][_0x4bf6('0x53')](_0x3ac6c8);})[_0x4bf6('0x21')](function(_0xd8056c){_0x1d4860[_0x4bf6('0x69')]=_0xd8056c;return _0x1d4860;});}})[_0x4bf6('0x21')](respondWithFilteredResult(_0x9756a8,_0x3ac6c8))[_0x4bf6('0x58')](handleError(_0x9756a8,null));};exports['removeDispositions']=function(_0x48bb6c,_0x497310,_0x4330d2){return db[_0x4bf6('0x40')][_0x4bf6('0x57')]({'where':{'id':_0x48bb6c['params']['id']}})['then'](handleEntityNotFound(_0x497310,null))[_0x4bf6('0x21')](function(_0x28db7c){if(_0x28db7c){return _0x28db7c[_0x4bf6('0x6a')](_0x48bb6c[_0x4bf6('0x45')][_0x4bf6('0x6b')]);}})['then'](respondWithStatusCode(_0x497310,null))[_0x4bf6('0x58')](handleError(_0x497310,null));};exports['addAnswer']=function(_0x1f8bac,_0x497bf7,_0x4f4c3f){if(_0x1f8bac['body']['id']){delete _0x1f8bac[_0x4bf6('0x61')]['id'];}return db[_0x4bf6('0x40')][_0x4bf6('0x57')]({'where':{'id':_0x1f8bac['params']['id']}})[_0x4bf6('0x21')](handleEntityNotFound(_0x497bf7,null))[_0x4bf6('0x21')](function(_0x5b0d99){if(_0x5b0d99){_0x1f8bac[_0x4bf6('0x61')]['SmsAccountId']=_0x5b0d99['id'];return db[_0x4bf6('0x6c')][_0x4bf6('0x59')](_0x1f8bac[_0x4bf6('0x61')]);}})['then'](respondWithResult(_0x497bf7,null))[_0x4bf6('0x58')](handleError(_0x497bf7,null));};exports['getAnswers']=function(_0x346174,_0x240da5,_0x33532e){var _0x305307={'raw':![],'where':{}};var _0x3e49b3={};var _0x27811b={'count':0x0,'rows':[]};return db['SmsAccount'][_0x4bf6('0x66')]({'where':{'id':_0x346174[_0x4bf6('0x62')]['id']}})[_0x4bf6('0x21')](handleEntityNotFound(_0x240da5,null))[_0x4bf6('0x21')](function(_0x4eebf6){if(_0x4eebf6){_0x3e49b3['model']=_[_0x4bf6('0x44')](db[_0x4bf6('0x6c')]['rawAttributes']);_0x3e49b3[_0x4bf6('0x45')]=_[_0x4bf6('0x44')](_0x346174[_0x4bf6('0x45')]);_0x3e49b3[_0x4bf6('0x50')]=_['intersection'](_0x3e49b3[_0x4bf6('0x47')],_0x3e49b3['query']);_0x305307[_0x4bf6('0x48')]=_['intersection'](_0x3e49b3['model'],qs[_0x4bf6('0x49')](_0x346174[_0x4bf6('0x45')][_0x4bf6('0x49')]));_0x305307[_0x4bf6('0x48')]=_0x305307[_0x4bf6('0x48')]['length']?_0x305307[_0x4bf6('0x48')]:_0x3e49b3[_0x4bf6('0x47')];if(!_0x346174[_0x4bf6('0x45')][_0x4bf6('0x4b')](_0x4bf6('0x4c'))){_0x305307[_0x4bf6('0x30')]=qs[_0x4bf6('0x30')](_0x346174[_0x4bf6('0x45')][_0x4bf6('0x30')]);_0x305307[_0x4bf6('0x2e')]=qs[_0x4bf6('0x2e')](_0x346174[_0x4bf6('0x45')]['offset']);}_0x305307['order']=qs['sort'](_0x346174[_0x4bf6('0x45')][_0x4bf6('0x4e')]);_0x305307[_0x4bf6('0x4f')]=qs[_0x4bf6('0x50')](_[_0x4bf6('0x67')](_0x346174[_0x4bf6('0x45')],_0x3e49b3[_0x4bf6('0x50')]));_0x305307[_0x4bf6('0x4f')]['SmsAccountId']=_0x4eebf6['id'];if(_0x346174[_0x4bf6('0x45')][_0x4bf6('0x68')]){_0x305307[_0x4bf6('0x4f')]=_[_0x4bf6('0x51')](_0x305307[_0x4bf6('0x4f')],{'$or':_[_0x4bf6('0x3f')](_0x305307[_0x4bf6('0x48')],function(_0x3e9805){var _0x540f7a={};_0x540f7a[_0x3e9805]={'$like':'%'+_0x346174[_0x4bf6('0x45')][_0x4bf6('0x68')]+'%'};return _0x540f7a;})});}_0x305307=_[_0x4bf6('0x51')]({},_0x305307,_0x346174[_0x4bf6('0x56')]);return db[_0x4bf6('0x6c')][_0x4bf6('0x31')]({'where':_0x305307['where']})[_0x4bf6('0x21')](function(_0x1368eb){_0x27811b[_0x4bf6('0x31')]=_0x1368eb;if(_0x346174[_0x4bf6('0x45')][_0x4bf6('0x54')]){_0x305307[_0x4bf6('0x55')]=[{'all':!![]}];}return db[_0x4bf6('0x6c')][_0x4bf6('0x53')](_0x305307);})[_0x4bf6('0x21')](function(_0x1c765e){_0x27811b[_0x4bf6('0x69')]=_0x1c765e;return _0x27811b;});}})[_0x4bf6('0x21')](respondWithFilteredResult(_0x240da5,_0x305307))[_0x4bf6('0x58')](handleError(_0x240da5,null));};exports[_0x4bf6('0x6d')]=function(_0x1a24eb,_0x3190be,_0xb4b008){return db[_0x4bf6('0x40')][_0x4bf6('0x57')]({'where':{'id':_0x1a24eb[_0x4bf6('0x62')]['id']}})[_0x4bf6('0x21')](handleEntityNotFound(_0x3190be,null))[_0x4bf6('0x21')](function(_0x5c37ee){if(_0x5c37ee){return _0x5c37ee[_0x4bf6('0x6d')](_0x1a24eb['query'][_0x4bf6('0x6b')]);}})[_0x4bf6('0x21')](respondWithStatusCode(_0x3190be,null))[_0x4bf6('0x58')](handleError(_0x3190be,null));};exports['notify']=function(_0x23301e,_0x19dc44,_0x2fb830){var _0x515d2b={'channel':_0x4bf6('0x6e')};var _0x132c32=[];var _0x25c485=[];var _0x237935={};return db[_0x4bf6('0x40')][_0x4bf6('0x57')]({'where':{'id':_0x23301e[_0x4bf6('0x62')]['id']},'include':[{'model':db[_0x4bf6('0x6f')],'as':_0x4bf6('0x70')}]})['then'](handleEntityNotFound(_0x19dc44,null))[_0x4bf6('0x21')](function(_0x2fc1fd){_0x515d2b[_0x4bf6('0x71')]=_0x2fc1fd;_0x515d2b[_0x4bf6('0x72')]=_[_0x4bf6('0x73')](_0x2fc1fd['Applications'],[_0x4bf6('0x74')],[_0x4bf6('0x75')]);if(_0x515d2b[_0x4bf6('0x71')]['Applications']){delete _0x515d2b[_0x4bf6('0x71')][_0x4bf6('0x70')];}return db[_0x4bf6('0x76')]['describe']();})[_0x4bf6('0x21')](function(_0x467ebf){if(!_0x467ebf){throw new db[(_0x4bf6('0x77'))][(_0x4bf6('0x78'))]('no\x20available\x20attributes');}_0x132c32=_['difference'](_[_0x4bf6('0x44')](_0x467ebf),[_0x4bf6('0x79'),_0x4bf6('0x7a')]);_0x25c485=_[_0x4bf6('0x7b')](_['keys'](_0x467ebf),[_0x4bf6('0x79'),_0x4bf6('0x7a'),_0x4bf6('0x7c'),_0x4bf6('0x7d')]);_0x515d2b[_0x4bf6('0x61')]={'mapKey':_0x4bf6('0x7e')};if(_0x515d2b['account']['type']){switch(_0x515d2b['account'][_0x4bf6('0x42')]){case _0x4bf6('0x7f'):_0x515d2b['body']['from']=_0x23301e['body']['From'];_0x515d2b[_0x4bf6('0x61')][_0x4bf6('0x61')]=_0x23301e[_0x4bf6('0x61')][_0x4bf6('0x80')];_0x515d2b[_0x4bf6('0x61')]['messageId']=_0x23301e[_0x4bf6('0x61')][_0x4bf6('0x81')];break;case _0x4bf6('0x82'):_0x515d2b[_0x4bf6('0x61')][_0x4bf6('0x83')]='+'+_0x23301e['body'][_0x4bf6('0x84')];_0x515d2b[_0x4bf6('0x61')]['body']=_0x23301e[_0x4bf6('0x61')][_0x4bf6('0x85')];break;case _0x4bf6('0x86'):_0x515d2b[_0x4bf6('0x61')][_0x4bf6('0x83')]=_0x23301e['body'][_0x4bf6('0x83')];_0x515d2b[_0x4bf6('0x61')][_0x4bf6('0x61')]=_0x23301e[_0x4bf6('0x61')][_0x4bf6('0x29')];break;case _0x4bf6('0x87'):_0x515d2b[_0x4bf6('0x61')][_0x4bf6('0x83')]=_0x23301e[_0x4bf6('0x61')][_0x4bf6('0x83')];_0x515d2b[_0x4bf6('0x61')][_0x4bf6('0x61')]=_0x23301e[_0x4bf6('0x61')]['body'];_0x515d2b['body'][_0x4bf6('0x88')]=_0x23301e['body'][_0x4bf6('0x89')];break;case _0x4bf6('0x8a'):_0x515d2b[_0x4bf6('0x61')][_0x4bf6('0x83')]=_0x23301e['body'][_0x4bf6('0x8b')];_0x515d2b[_0x4bf6('0x61')][_0x4bf6('0x61')]=_0x23301e[_0x4bf6('0x61')][_0x4bf6('0x8c')];_0x515d2b[_0x4bf6('0x61')]['messageId']=_0x23301e[_0x4bf6('0x61')]['MessageUUID'];break;case _0x4bf6('0x8d'):_0x515d2b[_0x4bf6('0x61')][_0x4bf6('0x83')]='+'+_0x23301e[_0x4bf6('0x61')][_0x4bf6('0x8e')][0x0][_0x4bf6('0x83')];_0x515d2b[_0x4bf6('0x61')][_0x4bf6('0x61')]=_0x23301e['body'][_0x4bf6('0x8e')][0x0]['text'];_0x515d2b['body'][_0x4bf6('0x88')]=_0x23301e[_0x4bf6('0x61')][_0x4bf6('0x8e')][0x0][_0x4bf6('0x88')];break;case'csc':_0x515d2b[_0x4bf6('0x61')][_0x4bf6('0x83')]=_0x23301e[_0x4bf6('0x61')][_0x4bf6('0x8f')];_0x515d2b[_0x4bf6('0x61')]['body']=_0x23301e[_0x4bf6('0x61')][_0x4bf6('0x90')][_0x4bf6('0x29')];break;case'clickatell':_0x515d2b['body'][_0x4bf6('0x83')]=_0x23301e[_0x4bf6('0x61')][_0x4bf6('0x91')];_0x515d2b[_0x4bf6('0x61')][_0x4bf6('0x61')]=_0x23301e['body'][_0x4bf6('0x85')];_0x515d2b[_0x4bf6('0x61')]['messageId']=_0x23301e['body'][_0x4bf6('0x92')];break;case _0x4bf6('0x93'):_0x515d2b[_0x4bf6('0x61')]['messageId']=_0x23301e[_0x4bf6('0x61')][0x0][_0x4bf6('0x29')]['id'];_0x515d2b[_0x4bf6('0x61')][_0x4bf6('0x83')]=_0x23301e['body'][0x0][_0x4bf6('0x29')][_0x4bf6('0x83')];_0x515d2b['body'][_0x4bf6('0x61')]=_0x23301e[_0x4bf6('0x61')][0x0][_0x4bf6('0x29')]['text'];break;case _0x4bf6('0x94'):_0x515d2b['body']['from']=_0x23301e['body'][_0x4bf6('0x83')];_0x515d2b[_0x4bf6('0x61')][_0x4bf6('0x61')]=_0x23301e[_0x4bf6('0x61')][_0x4bf6('0x29')];_0x515d2b[_0x4bf6('0x61')][_0x4bf6('0x88')]=_0x23301e[_0x4bf6('0x61')][_0x4bf6('0x95')];break;}}if(_0x515d2b[_0x4bf6('0x61')]['id']){delete _0x515d2b[_0x4bf6('0x61')]['id'];}if(_['isNil'](_0x515d2b['body'][_0x4bf6('0x83')])){throw new db[(_0x4bf6('0x77'))]['ValidationError'](_0x4bf6('0x96'));}if(_[_0x4bf6('0x97')](_0x515d2b['body'][_0x4bf6('0x61')])||_0x515d2b[_0x4bf6('0x61')][_0x4bf6('0x61')]===''){throw new db[(_0x4bf6('0x77'))][(_0x4bf6('0x78'))](_0x4bf6('0x98'));}if(_[_0x4bf6('0x97')](_0x515d2b[_0x4bf6('0x61')][_0x4bf6('0x99')])){throw new db[(_0x4bf6('0x77'))]['ValidationError'](_0x4bf6('0x9a')+_0x25c485);}if(!_[_0x4bf6('0x9b')](_0x25c485,_0x515d2b[_0x4bf6('0x61')][_0x4bf6('0x99')])){throw new db[(_0x4bf6('0x77'))][(_0x4bf6('0x78'))](_0x4bf6('0x9c')+_0x25c485);}_0x237935[_0x515d2b[_0x4bf6('0x61')][_0x4bf6('0x99')]]=_0x515d2b[_0x4bf6('0x61')][_0x4bf6('0x83')];return db[_0x4bf6('0x9d')]['find']({'where':{'id':_0x515d2b[_0x4bf6('0x71')][_0x4bf6('0x7d')]},'include':[{'model':db[_0x4bf6('0x76')],'as':_0x4bf6('0x9e'),'where':_0x237935,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0x4bf6('0x21')](handleEntityNotFound(_0x19dc44,null))[_0x4bf6('0x21')](function(_0x67afcb){if(_0x67afcb){_0x515d2b[_0x4bf6('0x9f')]=_[_0x4bf6('0xa0')](_0x67afcb,[_0x4bf6('0x9e')]);if(_0x67afcb[_0x4bf6('0x9e')]['length']){return _0x67afcb[_0x4bf6('0x9e')][0x0];}var _0x2935ea=_[_0x4bf6('0x19')](_0x515d2b[_0x4bf6('0x61')],{'firstName':_0x515d2b[_0x4bf6('0x61')][_0x4bf6('0x83')],'ListId':_0x67afcb['id']});_0x2935ea[_0x515d2b['body'][_0x4bf6('0x99')]]=_0x515d2b[_0x4bf6('0x61')][_0x4bf6('0x83')];return db[_0x4bf6('0x76')][_0x4bf6('0x59')](_0x2935ea,{'fields':_0x132c32,'raw':!![]});}})['then'](handleEntityNotFound(_0x19dc44,null))['then'](function(_0x347c0c){if(_0x347c0c){_0x515d2b['contact']=_0x347c0c;var _0x25cbaa={'ContactId':_0x347c0c['id'],'phone':_0x515d2b[_0x4bf6('0x61')][_0x4bf6('0x83')],'SmsAccountId':_0x23301e[_0x4bf6('0x62')]['id']};var _0x4c2acf={'ContactId':_0x347c0c['id'],'SmsAccountId':_0x23301e[_0x4bf6('0x62')]['id'],'closed':![]};return db[_0x4bf6('0xa1')][_0x4bf6('0x57')]({'where':_0x4c2acf})[_0x4bf6('0x21')](function(_0x1b2bd8){if(_0x1b2bd8){return[_0x1b2bd8,![]];}return db['SmsInteraction'][_0x4bf6('0x59')](_0x25cbaa)[_0x4bf6('0x21')](function(_0x11ba78){return[_0x11ba78,!![]];});});}})[_0x4bf6('0xa2')](function(_0x5e48a4,_0x4b64b7){_0x515d2b[_0x4bf6('0xa3')]=_0x5e48a4['get']({'plain':!![]});_0x515d2b[_0x4bf6('0xa3')][_0x4bf6('0xa4')]=![];if(_0x4b64b7){if(_0x515d2b['account']['autoclose']){_0x515d2b[_0x4bf6('0x72')][_0x4bf6('0xa5')]({'id':0x0,'priority':_0x515d2b['applications'][_0x4bf6('0x4a')]+0x1,'app':_0x4bf6('0xa6'),'appdata':'unmanaged','interval':_0x4bf6('0xa7')});}_0x515d2b[_0x4bf6('0xa3')][_0x4bf6('0xa4')]=!![];}return db['SmsMessage'][_0x4bf6('0x59')]({'phone':_0x515d2b[_0x4bf6('0x61')][_0x4bf6('0x83')],'messageId':_0x515d2b[_0x4bf6('0x61')][_0x4bf6('0x88')],'body':_0x515d2b['body']['body'],'SmsAccountId':_0x23301e[_0x4bf6('0x62')]['id'],'SmsInteractionId':_0x5e48a4['id'],'direction':'in','ContactId':_0x5e48a4[_0x4bf6('0xa8')],'AttachmentId':_0x515d2b[_0x4bf6('0x61')][_0x4bf6('0xa9')]});})[_0x4bf6('0x21')](function(_0x3fdae6){_0x515d2b[_0x4bf6('0x29')]=_0x3fdae6;if(!_0x515d2b['interaction'][_0x4bf6('0xaa')])return;return db['User'][_0x4bf6('0x57')]({'attributes':['id','name'],'where':{'id':_0x515d2b['interaction'][_0x4bf6('0xaa')]}});})[_0x4bf6('0x21')](function(_0x58bc01){if(_0x58bc01){_0x515d2b[_0x4bf6('0x72')][_0x4bf6('0xab')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x58bc01['name']+','+(_0x515d2b['account'][_0x4bf6('0xac')]||0xa),'interval':_0x4bf6('0xa7')});}if(!_0x515d2b[_0x4bf6('0xa3')][_0x4bf6('0xad')])return;return db['SmsQueue'][_0x4bf6('0x57')]({'attributes':['id',_0x4bf6('0x3a')],'where':{'id':_0x515d2b[_0x4bf6('0xa3')]['queueId']}});})['then'](function(_0x26597f){if(_0x26597f){_0x515d2b[_0x4bf6('0x72')][_0x4bf6('0xab')]({'id':0x0,'priority':0x1,'app':_0x4bf6('0xae'),'appdata':_0x26597f['name']+','+(_0x515d2b[_0x4bf6('0x71')][_0x4bf6('0xaf')]||0x12c),'interval':_0x4bf6('0xa7')});}return respondWithRpcPromise('Start','startRouting',_0x515d2b);})['then'](function(_0x5e6ba8){if(_0x5e6ba8){var _0x569b24=0xc8;var _0xa6c048=_0x4bf6('0xb0');logger[_0x4bf6('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa6c048,_0x569b24,_0x4bf6('0xb1'));logger[_0x4bf6('0xb2')](_0x4bf6('0xb3'),_0xa6c048,_0x569b24,_0x4bf6('0xb1'),JSON['stringify'](_0x5e6ba8));if(_0x515d2b[_0x4bf6('0x71')][_0x4bf6('0x42')]==='twilio'){return _0x19dc44[_0x4bf6('0x2b')](_0x569b24)['set']('Content-Type',_0x4bf6('0xb4'))[_0x4bf6('0x3b')](_0x4bf6('0xb5'));}else{return _0x19dc44[_0x4bf6('0x2b')](_0x569b24)[_0x4bf6('0x2d')](_0x5e6ba8);}}})[_0x4bf6('0x58')](handleError(_0x19dc44,null));};exports[_0x4bf6('0xb6')]=function(_0x31f32c,_0x2e2169){var _0x4eb066=_0x31f32c[_0x4bf6('0x62')]['id'];var _0x489fcc=_0x31f32c[_0x4bf6('0x61')];var _0x2a5e5d=0xc8;var _0x4be136=null;return db[_0x4bf6('0xb7')][_0x4bf6('0xb8')]({'isolationLevel':db[_0x4bf6('0xb7')][_0x4bf6('0xb9')][_0x4bf6('0xba')]['READ_COMMITTED']},function(_0xc88bd3){return db['SmsAccount']['findOne']({'where':{'id':_0x4eb066},'transaction':_0xc88bd3})[_0x4bf6('0x21')](function(_0x4247a3){if(_0x4247a3){return db['SmsApplication'][_0x4bf6('0x36')]({'where':{'SmsAccountId':_0x4eb066},'transaction':_0xc88bd3})['then'](function(){var _0x2716e5=_[_0x4bf6('0x3f')](_0x489fcc,function(_0x4eec00){_0x4eec00[_0x4bf6('0x64')]=_0x4eb066;return _0x4eec00;});return db[_0x4bf6('0x6f')][_0x4bf6('0xbb')](_0x2716e5,{'transaction':_0xc88bd3});});}else{_0x2a5e5d=0x194;_0x4be136=[];}});})[_0x4bf6('0x21')](function(){if(_0x2a5e5d!==0x194){return db[_0x4bf6('0x6f')][_0x4bf6('0xbc')]({'where':{'SmsAccountId':_0x4eb066},'order':_0x4bf6('0x74')})['then'](function(_0x2b7136){_0x4be136=_0x2b7136;});}})[_0x4bf6('0x58')](function(_0x2a3f68){_0x2a5e5d=0x1f4;logger[_0x4bf6('0x27')](_0x2a3f68[_0x4bf6('0xbd')]);if(_0x2a3f68[_0x4bf6('0x3a')]){delete _0x2a3f68['name'];}_0x4be136=_0x2a3f68;})[_0x4bf6('0xbe')](function(){if(_0x4be136===null){_0x2e2169['sendStatus'](_0x2a5e5d);}else{if(_0x2a5e5d===0x1f4){_0x2e2169[_0x4bf6('0x2b')](_0x2a5e5d)[_0x4bf6('0x3b')](_0x4be136);}else{_0x2e2169[_0x4bf6('0x2b')](_0x2a5e5d)[_0x4bf6('0x2d')](_0x4be136);}}});};exports[_0x4bf6('0xbf')]=function(_0x59f281,_0x6136f4,_0x5305d1){var _0x21eb01={};var _0x2990d7={};var _0x3bcc35;var _0x2cfb09;return db[_0x4bf6('0x40')][_0x4bf6('0x66')]({'where':{'id':_0x59f281[_0x4bf6('0x62')]['id']}})[_0x4bf6('0x21')](handleEntityNotFound(_0x6136f4,null))[_0x4bf6('0x21')](function(_0x488477){if(_0x488477){_0x3bcc35=_0x488477;_0x2990d7['model']=_['keys'](db[_0x4bf6('0x6f')][_0x4bf6('0x41')]);_0x2990d7[_0x4bf6('0x45')]=_[_0x4bf6('0x44')](_0x59f281[_0x4bf6('0x45')]);_0x2990d7[_0x4bf6('0x50')]=_['intersection'](_0x2990d7[_0x4bf6('0x47')],_0x2990d7[_0x4bf6('0x45')]);_0x21eb01[_0x4bf6('0x48')]=_[_0x4bf6('0x46')](_0x2990d7[_0x4bf6('0x47')],qs['fields'](_0x59f281[_0x4bf6('0x45')][_0x4bf6('0x49')]));_0x21eb01[_0x4bf6('0x48')]=_0x21eb01['attributes'][_0x4bf6('0x4a')]?_0x21eb01['attributes']:_0x2990d7[_0x4bf6('0x47')];_0x21eb01[_0x4bf6('0x4d')]=qs[_0x4bf6('0x4e')](_0x59f281['query'][_0x4bf6('0x4e')]);_0x21eb01['where']=qs['filters'](_[_0x4bf6('0x67')](_0x59f281[_0x4bf6('0x45')],_0x2990d7[_0x4bf6('0x50')]));if(_0x59f281[_0x4bf6('0x45')][_0x4bf6('0x68')]){_0x21eb01[_0x4bf6('0x4f')]=_['merge'](_0x21eb01[_0x4bf6('0x4f')],{'$or':_['map'](_0x21eb01[_0x4bf6('0x48')],function(_0x5b79c9){var _0x40a4dd={};_0x40a4dd[_0x5b79c9]={'$like':'%'+_0x59f281[_0x4bf6('0x45')]['filter']+'%'};return _0x40a4dd;})});}_0x21eb01=_['merge']({},_0x21eb01,_0x59f281[_0x4bf6('0x56')]);return _0x3bcc35['getApplications'](_0x21eb01);}})[_0x4bf6('0x21')](function(_0x5166e3){if(_0x5166e3){_0x2cfb09=_0x5166e3['length'];if(!_0x59f281[_0x4bf6('0x45')][_0x4bf6('0x4b')]('nolimit')){_0x21eb01[_0x4bf6('0x30')]=qs['limit'](_0x59f281[_0x4bf6('0x45')][_0x4bf6('0x30')]);_0x21eb01[_0x4bf6('0x2e')]=qs[_0x4bf6('0x2e')](_0x59f281['query']['offset']);}return _0x3bcc35[_0x4bf6('0xbf')](_0x21eb01);}})[_0x4bf6('0x21')](function(_0xa0bcd6){if(_0xa0bcd6){return _0xa0bcd6?{'count':_0x2cfb09,'rows':_0xa0bcd6}:null;}})[_0x4bf6('0x21')](respondWithResult(_0x6136f4,null))['catch'](handleError(_0x6136f4,null));};exports[_0x4bf6('0xc0')]=function(_0x3c0fdd,_0x530cb3,_0x5847fd){var _0x22495b={'raw':![],'where':{}};var _0x501ebf={};var _0x565e84={'count':0x0,'rows':[]};return db['SmsAccount'][_0x4bf6('0x66')]({'where':{'id':_0x3c0fdd[_0x4bf6('0x62')]['id']}})['then'](handleEntityNotFound(_0x530cb3,null))[_0x4bf6('0x21')](function(_0x534e2b){if(_0x534e2b){_0x501ebf[_0x4bf6('0x47')]=_[_0x4bf6('0x44')](db[_0x4bf6('0xa1')]['rawAttributes']);_0x501ebf[_0x4bf6('0x45')]=_['keys'](_0x3c0fdd['query']);_0x501ebf[_0x4bf6('0x50')]=_[_0x4bf6('0x46')](_0x501ebf[_0x4bf6('0x47')],_0x501ebf[_0x4bf6('0x45')]);_0x22495b['attributes']=_['intersection'](_0x501ebf['model'],qs['fields'](_0x3c0fdd[_0x4bf6('0x45')][_0x4bf6('0x49')]));_0x22495b[_0x4bf6('0x48')]=_0x22495b[_0x4bf6('0x48')][_0x4bf6('0x4a')]?_0x22495b[_0x4bf6('0x48')]:_0x501ebf[_0x4bf6('0x47')];if(!_0x3c0fdd[_0x4bf6('0x45')][_0x4bf6('0x4b')](_0x4bf6('0x4c'))){_0x22495b[_0x4bf6('0x30')]=qs['limit'](_0x3c0fdd[_0x4bf6('0x45')][_0x4bf6('0x30')]);_0x22495b[_0x4bf6('0x2e')]=qs[_0x4bf6('0x2e')](_0x3c0fdd['query']['offset']);}_0x22495b[_0x4bf6('0x4d')]=qs[_0x4bf6('0x4e')](_0x3c0fdd[_0x4bf6('0x45')][_0x4bf6('0x4e')]);_0x22495b[_0x4bf6('0x4f')]=qs[_0x4bf6('0x50')](_[_0x4bf6('0x67')](_0x3c0fdd[_0x4bf6('0x45')],_0x501ebf[_0x4bf6('0x50')]));_0x22495b[_0x4bf6('0x4f')]['SmsAccountId']=_0x534e2b['id'];if(_0x3c0fdd[_0x4bf6('0x45')][_0x4bf6('0x68')]){_0x22495b[_0x4bf6('0x4f')]=_[_0x4bf6('0x51')](_0x22495b[_0x4bf6('0x4f')],{'$or':_[_0x4bf6('0x3f')](_0x22495b[_0x4bf6('0x48')],function(_0x5d7217){var _0x7347={};_0x7347[_0x5d7217]={'$like':'%'+_0x3c0fdd[_0x4bf6('0x45')][_0x4bf6('0x68')]+'%'};return _0x7347;})});}_0x22495b=_[_0x4bf6('0x51')]({},_0x22495b,_0x3c0fdd[_0x4bf6('0x56')]);return db[_0x4bf6('0xa1')][_0x4bf6('0x31')]({'where':_0x22495b[_0x4bf6('0x4f')]})[_0x4bf6('0x21')](function(_0x102260){_0x565e84['count']=_0x102260;if(_0x3c0fdd[_0x4bf6('0x45')]['includeAll']){_0x22495b['include']=[{'model':db['CmContact'],'as':_0x4bf6('0xc1'),'required':![]},{'model':db[_0x4bf6('0xc2')],'as':'Owner','attributes':[_0x4bf6('0x3a'),_0x4bf6('0xc3'),_0x4bf6('0xc4')],'required':![]},{'model':db[_0x4bf6('0xc5')],'as':'Tags','attributes':['id',_0x4bf6('0x3a'),_0x4bf6('0xc6')],'where':_0x3c0fdd[_0x4bf6('0x45')][_0x4bf6('0xc7')]?{'id':_0x3c0fdd[_0x4bf6('0x45')][_0x4bf6('0xc7')]}:undefined,'required':_0x3c0fdd[_0x4bf6('0x45')][_0x4bf6('0xc7')]?!![]:![]}];}return db[_0x4bf6('0xa1')][_0x4bf6('0x53')](_0x22495b);})[_0x4bf6('0x21')](function(_0x550267){_0x565e84['rows']=_0x550267;return _0x565e84;});}})[_0x4bf6('0x21')](respondWithFilteredResult(_0x530cb3,_0x22495b))[_0x4bf6('0x58')](handleError(_0x530cb3,null));};exports[_0x4bf6('0x3b')]=function(_0x36653a,_0x2defb2,_0x523fdc){var _0x4a63e5,_0xb4241c,_0x50bf9a;if(_[_0x4bf6('0x97')](_0x36653a[_0x4bf6('0x61')][_0x4bf6('0x61')])||_0x36653a[_0x4bf6('0x61')][_0x4bf6('0x61')]===''){throw new db[(_0x4bf6('0x77'))][(_0x4bf6('0x78'))](_0x4bf6('0x98'));}if(_[_0x4bf6('0x97')](_0x36653a[_0x4bf6('0x61')]['to'])){throw new db[(_0x4bf6('0x77'))][(_0x4bf6('0x78'))](_0x4bf6('0xc8'));}_0x4a63e5=_0x36653a[_0x4bf6('0x61')]['to'];return db[_0x4bf6('0x40')][_0x4bf6('0x57')]({'where':{'id':_0x36653a['params']['id']},'include':[{'model':db[_0x4bf6('0x9d')],'as':_0x4bf6('0xc9'),'include':[{'model':db['CmContact'],'as':_0x4bf6('0x9e'),'where':{'mobile':_0x4a63e5},'limit':0x1,'order':[[_0x4bf6('0x7a'),_0x4bf6('0xca')]]}]}]})[_0x4bf6('0x21')](handleEntityNotFound(_0x2defb2,null))[_0x4bf6('0x21')](function(_0x446620){if(_0x446620&&_0x446620['List']){_0xb4241c=_0x446620[_0x4bf6('0x37')]({'plain':!![]});if(_0xb4241c[_0x4bf6('0xc9')]&&_0xb4241c[_0x4bf6('0xc9')]['Contacts'][_0x4bf6('0x4a')]){return _0xb4241c[_0x4bf6('0xc9')][_0x4bf6('0x9e')][0x0];}return db[_0x4bf6('0x76')]['create'](_[_0x4bf6('0x19')](_0x36653a[_0x4bf6('0x61')],{'firstName':_0x4a63e5,'mobile':_0x4a63e5,'phone':_0x4a63e5,'ListId':_0xb4241c['ListId']}));}})[_0x4bf6('0x21')](handleEntityNotFound(_0x2defb2,null))[_0x4bf6('0x21')](function(_0x97d6d2){if(_0x97d6d2){_0x50bf9a=_0x97d6d2;return db['SmsInteraction'][_0x4bf6('0x57')]({'where':{'ContactId':_0x50bf9a['id'],'closed':![],'SmsAccountId':_0xb4241c['id']}})['then'](function(_0x534346){if(_0x534346){return[_0x534346,![]];}return db['SmsInteraction'][_0x4bf6('0x59')]({'UserId':_0x36653a[_0x4bf6('0x5c')]['id'],'ContactId':_0x50bf9a['id'],'SmsAccountId':_0xb4241c['id'],'phone':_0x4a63e5,'firstMsgDirection':_0x4bf6('0xcb'),'Messages':[_[_0x4bf6('0x51')](_0x36653a[_0x4bf6('0x61')],{'read':![],'body':_0x36653a['body'][_0x4bf6('0x61')],'phone':_0x4a63e5,'SmsAccountId':_0xb4241c['id'],'UserId':_0x36653a[_0x4bf6('0x5c')]['id'],'ContactId':_0x50bf9a['id']})]},{'include':[{'model':db[_0x4bf6('0xcc')],'as':_0x4bf6('0xcd')}]})[_0x4bf6('0x21')](function(_0x5de87b){return[_0x5de87b,!![]];});});}})[_0x4bf6('0xa2')](function(_0x43b4d6,_0x10f71a){if(_0x10f71a){return _0x43b4d6;}return db[_0x4bf6('0xcc')][_0x4bf6('0x59')](_[_0x4bf6('0x51')](_0x36653a['body'],{'read':![],'body':_0x36653a[_0x4bf6('0x61')][_0x4bf6('0x61')],'phone':_0x4a63e5,'SmsAccountId':_0xb4241c['id'],'SmsInteractionId':_0x43b4d6['id'],'UserId':_0x36653a[_0x4bf6('0x5c')]['id'],'ContactId':_0x50bf9a['id']}))['then'](function(_0x133469){_0x43b4d6[_0x4bf6('0xce')][_0x4bf6('0xcd')]=[];_0x43b4d6[_0x4bf6('0xce')][_0x4bf6('0xcd')][_0x4bf6('0xa5')](_0x133469[_0x4bf6('0xce')]);return _0x43b4d6;});})['then'](respondWithResult(_0x2defb2,null))[_0x4bf6('0x58')](handleError(_0x2defb2,null));};exports[_0x4bf6('0x2b')]=function(_0x2b3dfc,_0xd50517,_0x3277cb){if(_0x2b3dfc[_0x4bf6('0x61')]['id']){delete _0x2b3dfc[_0x4bf6('0x61')]['id'];}var _0x2b35bc,_0x54a1d6,_0x258dc0;return db[_0x4bf6('0x40')][_0x4bf6('0x57')]({'where':{'id':_0x2b3dfc[_0x4bf6('0x62')]['id']}})['then'](handleEntityNotFound(_0xd50517,null))[_0x4bf6('0x21')](function(_0x2d7b06){if(_0x2d7b06){_0x258dc0=_0x2d7b06;logger[_0x4bf6('0xb2')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4bf6('0x2b'),_0x4bf6('0xcf'),_0x2d7b06[_0x4bf6('0x42')],util[_0x4bf6('0xd0')](_0x2b3dfc['body'],{'showHidden':![],'depth':null}));switch(_0x2d7b06[_0x4bf6('0x42')]){case'skebby':if(_0x2b3dfc[_0x4bf6('0x61')][_0x4bf6('0xd1')]&&_0x2b3dfc[_0x4bf6('0x61')]['status']){_0x54a1d6=_0x2b3dfc[_0x4bf6('0x61')][_0x4bf6('0x2b')];return db[_0x4bf6('0xcc')][_0x4bf6('0x57')]({'where':{'messageId':_0x2b3dfc['body'][_0x4bf6('0xd1')]}});}break;case'connectel':if(_0x2b3dfc[_0x4bf6('0x61')][_0x4bf6('0xd2')]&&_0x2b3dfc[_0x4bf6('0x61')][_0x4bf6('0xd3')]){_0x54a1d6=_0x2b3dfc[_0x4bf6('0x61')][_0x4bf6('0xd3')];return db[_0x4bf6('0xcc')][_0x4bf6('0x57')]({'where':{'messageId':_0x2b3dfc['body'][_0x4bf6('0xd2')]}});}break;case _0x4bf6('0x87'):if(_0x2b3dfc[_0x4bf6('0x61')]['message_id']&&_0x2b3dfc[_0x4bf6('0x61')]['status_code']){_0x54a1d6=_0x2b3dfc[_0x4bf6('0x61')]['status_code'];return db['SmsMessage'][_0x4bf6('0x57')]({'where':{'messageId':_0x2b3dfc[_0x4bf6('0x61')][_0x4bf6('0x89')]}});}break;case _0x4bf6('0x8d'):var _0x4f54a7=_0x2b3dfc[_0x4bf6('0x61')]['results'][0x0];if(_0x4f54a7[_0x4bf6('0x88')]&&_0x4f54a7[_0x4bf6('0x2b')][_0x4bf6('0xd4')]===_0x4bf6('0xd5')){_0x54a1d6=_0x4f54a7['status'][_0x4bf6('0xd4')];return db[_0x4bf6('0xcc')]['find']({'where':{'messageId':_0x4f54a7[_0x4bf6('0x88')]}});}break;case'clickatell':if(_0x2b3dfc[_0x4bf6('0x61')]['messageId']&&_0x2b3dfc[_0x4bf6('0x61')][_0x4bf6('0x2b')]){_0x54a1d6=_0x2b3dfc[_0x4bf6('0x61')][_0x4bf6('0x2b')];return db[_0x4bf6('0xcc')][_0x4bf6('0x57')]({'where':{'messageId':_0x2b3dfc[_0x4bf6('0x61')][_0x4bf6('0x88')]}});}break;case _0x4bf6('0x93'):if(_0x2b3dfc[_0x4bf6('0x61')][0x0][_0x4bf6('0x29')]['id']){_0x54a1d6=_0x2b3dfc[_0x4bf6('0x61')][0x0][_0x4bf6('0x42')];return db[_0x4bf6('0xcc')][_0x4bf6('0x57')]({'where':{'messageId':_0x2b3dfc[_0x4bf6('0x61')][0x0][_0x4bf6('0x29')]['id']}});}break;case _0x4bf6('0x94'):if(_0x2b3dfc[_0x4bf6('0x61')]['redif']&&_0x2b3dfc['body'][_0x4bf6('0x2b')]){_0x54a1d6=_0x2b3dfc['body']['status'];return db[_0x4bf6('0xcc')]['find']({'where':{'messageId':_0x2b3dfc[_0x4bf6('0x61')][_0x4bf6('0xd6')]}});}break;}}})[_0x4bf6('0x21')](handleEntityNotFound(_0xd50517,null))[_0x4bf6('0x21')](function(_0xe64c19){if(_0xe64c19){_0x2b35bc=_0xe64c19;switch(_0x258dc0[_0x4bf6('0x42')]){case _0x4bf6('0x82'):if(_0x54a1d6===_0x4bf6('0xd5')){return _0x2b35bc['update']({'read':!![]});}else{logger[_0x4bf6('0x27')](_0x4bf6('0x25'),_0x4bf6('0x2b'),'skebby',util[_0x4bf6('0xd0')](_0x2b3dfc[_0x4bf6('0x61')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x54a1d6==='1'){return _0x2b35bc[_0x4bf6('0x60')]({'read':!![]});}else{logger[_0x4bf6('0x27')](_0x4bf6('0x25'),_0x4bf6('0x2b'),_0x4bf6('0x82'),util[_0x4bf6('0xd0')](_0x2b3dfc[_0x4bf6('0x61')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x2b3dfc[_0x4bf6('0x61')][_0x4bf6('0xd7')]&&_0x54a1d6>=0xc8&&_0x54a1d6<=0xce){return _0x2b35bc[_0x4bf6('0x60')]({'read':!![]});}else{logger[_0x4bf6('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4bf6('0x2b'),_0x4bf6('0x87'),util['inspect'](_0x2b3dfc[_0x4bf6('0x61')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x40fde7=_0x2b3dfc[_0x4bf6('0x61')][_0x4bf6('0x8e')][0x0];if(_0x40fde7['status'][_0x4bf6('0xd4')]===_0x4bf6('0xd5')){return _0x2b35bc[_0x4bf6('0x60')]({'read':!![]});}else{logger[_0x4bf6('0x27')](_0x4bf6('0x25'),_0x4bf6('0x2b'),'infobip',util['inspect'](_0x2b3dfc[_0x4bf6('0x61')],{'showHidden':![],'depth':null}));}break;case _0x4bf6('0xd8'):if(_0x54a1d6=='DELIVERED_TO_GATEWAY'||_0x54a1d6==_0x4bf6('0xd9')){return _0x2b35bc['update']({'read':!![]});}else{logger[_0x4bf6('0x27')](_0x4bf6('0x25'),'status',_0x4bf6('0xd8'),util[_0x4bf6('0xd0')](_0x2b3dfc[_0x4bf6('0x61')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x54a1d6==_0x4bf6('0xda')){return _0x2b35bc['update']({'read':!![]});}else{logger[_0x4bf6('0x27')](_0x4bf6('0x25'),_0x4bf6('0x2b'),'bandwidth',util['inspect'](_0x2b3dfc[_0x4bf6('0x61')],{'showHidden':![],'depth':null}));}break;case _0x4bf6('0x94'):if(_0x54a1d6==='DELIVRD'||_0x54a1d6===_0x4bf6('0xdb')){return _0x2b35bc[_0x4bf6('0x60')]({'read':!![]});}else{logger['error'](_0x4bf6('0x25'),_0x4bf6('0x2b'),_0x4bf6('0x94'),util[_0x4bf6('0xd0')](_0x2b3dfc['body'],{'showHidden':![],'depth':null}));}break;}return _0x2b35bc;}})[_0x4bf6('0x21')](respondWithResult(_0xd50517,null))['catch'](handleError(_0xd50517,null));};exports[_0x4bf6('0xdc')]=function(_0x407e1b,_0x409334,_0x121ad0){var _0x11a10b,_0x51b43c,_0x2badda;return db[_0x4bf6('0x40')][_0x4bf6('0x57')]({'where':{'id':_0x407e1b[_0x4bf6('0x62')]['id']}})[_0x4bf6('0x21')](handleEntityNotFound(_0x409334,null))[_0x4bf6('0x21')](function(_0x3a4f6e){if(_0x3a4f6e){_0x2badda=_0x3a4f6e;logger['debug'](_0x4bf6('0x25'),_0x4bf6('0x2b'),'received\x20delivery\x20report\x20from',_0x3a4f6e[_0x4bf6('0x42')],util['inspect'](_0x407e1b[_0x4bf6('0x45')],{'showHidden':![],'depth':null}));switch(_0x3a4f6e['type']){case _0x4bf6('0xdd'):if(_0x407e1b['query'][_0x4bf6('0xde')]&&_0x407e1b['query']['state']){_0x51b43c=_0x407e1b[_0x4bf6('0x45')][_0x4bf6('0xdf')];return db[_0x4bf6('0xcc')][_0x4bf6('0x57')]({'where':{'messageId':_0x407e1b[_0x4bf6('0x45')][_0x4bf6('0xde')]}});}break;}}})['then'](handleEntityNotFound(_0x409334,null))[_0x4bf6('0x21')](function(_0x2e3e32){if(_0x2e3e32){_0x11a10b=_0x2e3e32;switch(_0x2badda['type']){case _0x4bf6('0xdd'):if(_0x51b43c==='2'||_0x51b43c==='6'){return _0x11a10b[_0x4bf6('0x60')]({'read':!![]});}else{logger[_0x4bf6('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4bf6('0x2b'),_0x4bf6('0xdd'),util[_0x4bf6('0xd0')](_0x407e1b[_0x4bf6('0x45')],{'showHidden':![],'depth':null}));};break;}return _0x11a10b;}})[_0x4bf6('0x21')](respondWithResult(_0x409334,null))[_0x4bf6('0x58')](handleError(_0x409334,null));};exports[_0x4bf6('0xe0')]=function(_0x18204d,_0x20f4e9,_0x1704df){return db[_0x4bf6('0x40')]['find']({'where':{'id':_0x18204d[_0x4bf6('0x62')]['id']}})['then'](handleEntityNotFound(_0x20f4e9,null))['then'](function(_0x4ea147){if(_0x4ea147){return _0x4ea147[_0x4bf6('0xe0')](_0x18204d[_0x4bf6('0x61')][_0x4bf6('0x6b')],_[_0x4bf6('0xa0')](_0x18204d['body'],[_0x4bf6('0x6b'),'id'])||{})[_0x4bf6('0xa2')](function(_0x3ea1f0){for(var _0x2cbc79=0x0;_0x2cbc79<_0x18204d['body']['ids'][_0x4bf6('0x4a')];_0x2cbc79+=0x1){socket[_0x4bf6('0xe1')](_0x4bf6('0xe2'),{'UserId':Number(_0x18204d[_0x4bf6('0x61')][_0x4bf6('0x6b')][_0x2cbc79]),'SmsAccountId':Number(_0x18204d[_0x4bf6('0x62')]['id'])});}return _0x3ea1f0;});}})['then'](respondWithResult(_0x20f4e9,null))[_0x4bf6('0x58')](handleError(_0x20f4e9,null));};exports[_0x4bf6('0xe3')]=function(_0x5009f2,_0x1fe80a,_0x393a3c){return db[_0x4bf6('0x40')][_0x4bf6('0x57')]({'where':{'id':_0x5009f2['params']['id']}})[_0x4bf6('0x21')](handleEntityNotFound(_0x1fe80a,null))['then'](function(_0xc19e12){if(_0xc19e12){return _0xc19e12[_0x4bf6('0xe3')](_0x5009f2[_0x4bf6('0x45')][_0x4bf6('0x6b')])['then'](function(){if(_[_0x4bf6('0xe4')](_0x5009f2[_0x4bf6('0x45')][_0x4bf6('0x6b')])){for(var _0x455847=0x0;_0x455847<_0x5009f2['query']['ids'][_0x4bf6('0x4a')];_0x455847+=0x1){socket[_0x4bf6('0xe1')](_0x4bf6('0xe5'),{'UserId':Number(_0x5009f2[_0x4bf6('0x45')]['ids'][_0x455847]),'SmsAccountId':Number(_0x5009f2['params']['id'])});}}else{socket[_0x4bf6('0xe1')](_0x4bf6('0xe5'),{'UserId':Number(_0x5009f2[_0x4bf6('0x45')][_0x4bf6('0x6b')]),'SmsAccountId':Number(_0x5009f2[_0x4bf6('0x62')]['id'])});}});}})[_0x4bf6('0x21')](respondWithStatusCode(_0x1fe80a,null))[_0x4bf6('0x58')](handleError(_0x1fe80a,null));};exports[_0x4bf6('0xe6')]=function(_0x447f18,_0x31070d,_0x3bf2b9){var _0x564e8d={};var _0x3a7f50={};var _0x23e755;var _0x163668;return db[_0x4bf6('0x40')]['findOne']({'where':{'id':_0x447f18[_0x4bf6('0x62')]['id']}})[_0x4bf6('0x21')](handleEntityNotFound(_0x31070d,null))['then'](function(_0x396636){if(_0x396636){_0x23e755=_0x396636;_0x3a7f50['model']=_[_0x4bf6('0x44')](db[_0x4bf6('0xc2')][_0x4bf6('0x41')]);_0x3a7f50['query']=_[_0x4bf6('0x44')](_0x447f18['query']);_0x3a7f50['filters']=_['intersection'](_0x3a7f50['model'],_0x3a7f50[_0x4bf6('0x45')]);_0x564e8d['attributes']=_[_0x4bf6('0x46')](_0x3a7f50[_0x4bf6('0x47')],qs[_0x4bf6('0x49')](_0x447f18[_0x4bf6('0x45')][_0x4bf6('0x49')]));_0x564e8d[_0x4bf6('0x48')]=_0x564e8d['attributes'][_0x4bf6('0x4a')]?_0x564e8d[_0x4bf6('0x48')]:_0x3a7f50[_0x4bf6('0x47')];_0x564e8d[_0x4bf6('0x4d')]=qs[_0x4bf6('0x4e')](_0x447f18[_0x4bf6('0x45')]['sort']);_0x564e8d['where']=qs['filters'](_[_0x4bf6('0x67')](_0x447f18['query'],_0x3a7f50[_0x4bf6('0x50')]));if(_0x447f18['query'][_0x4bf6('0x68')]){_0x564e8d[_0x4bf6('0x4f')]=_['merge'](_0x564e8d[_0x4bf6('0x4f')],{'$or':_['map'](_0x564e8d[_0x4bf6('0x48')],function(_0x105708){var _0x40ddeb={};_0x40ddeb[_0x105708]={'$like':'%'+_0x447f18['query']['filter']+'%'};return _0x40ddeb;})});}_0x564e8d=_[_0x4bf6('0x51')]({},_0x564e8d,_0x447f18[_0x4bf6('0x56')]);return _0x23e755[_0x4bf6('0xe6')](_0x564e8d);}})[_0x4bf6('0x21')](function(_0x5e4562){if(_0x5e4562){_0x163668=_0x5e4562['length'];if(!_0x447f18[_0x4bf6('0x45')][_0x4bf6('0x4b')](_0x4bf6('0x4c'))){_0x564e8d['limit']=qs[_0x4bf6('0x30')](_0x447f18[_0x4bf6('0x45')][_0x4bf6('0x30')]);_0x564e8d[_0x4bf6('0x2e')]=qs['offset'](_0x447f18[_0x4bf6('0x45')][_0x4bf6('0x2e')]);}return _0x23e755[_0x4bf6('0xe6')](_0x564e8d);}})[_0x4bf6('0x21')](function(_0x56569){if(_0x56569){return _0x56569?{'count':_0x163668,'rows':_0x56569}:null;}})[_0x4bf6('0x21')](respondWithResult(_0x31070d,null))[_0x4bf6('0x58')](handleError(_0x31070d,null));}; \ No newline at end of file +var _0x9ef7=['SmsAccountId','findOne','Disposition','nolimit','includeAll','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','notify','sms','Applications','account','applications','orderBy','asc','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','twilio','from','From','Body','messageId','sender','connectel','clicksend','message_id','plivo','MessageUUID','infobip','results','text','csc','originatingAddress','segmentedMessage','clickatell','intelepeer','refid','isNil','Sequelize','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','DESC','list','omit','Contacts','contact','SmsInteraction','spread','interaction','created','autoclose','push','unmanaged','*,*,*,*','ContactId','UserId','unshift','waitForTheAssignedAgent','queueId','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','entity\x20found','Content-Type','text/xml','\x0a','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','SmsApplication','finally','getApplications','getInteractions','Contact','User','Owner','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','SmsMessage','Messages','dataValues','skebby','skebby_dispatch_id','requestid','statusInt','status_code','groupName','bandwidth','redif','DELIVERED','error_code','inspect','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','client','http','request','info','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','SmsAccount,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition'];(function(_0x44e4e1,_0x5637b2){var _0x300cd2=function(_0x189eeb){while(--_0x189eeb){_0x44e4e1['push'](_0x44e4e1['shift']());}};_0x300cd2(++_0x5637b2);}(_0x9ef7,0x168));var _0x79ef=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x9ef7[_0x5d4607];return _0x5e4a86;};'use strict';var emlformat=require(_0x79ef('0x0'));var rimraf=require(_0x79ef('0x1'));var zipdir=require(_0x79ef('0x2'));var jsonpatch=require(_0x79ef('0x3'));var rp=require(_0x79ef('0x4'));var moment=require('moment');var BPromise=require(_0x79ef('0x5'));var Mustache=require(_0x79ef('0x6'));var util=require(_0x79ef('0x7'));var path=require(_0x79ef('0x8'));var sox=require(_0x79ef('0x9'));var csv=require(_0x79ef('0xa'));var ejs=require(_0x79ef('0xb'));var fs=require('fs');var fs_extra=require(_0x79ef('0xc'));var _=require(_0x79ef('0xd'));var squel=require(_0x79ef('0xe'));var crypto=require(_0x79ef('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x79ef('0xa'));var querystring=require(_0x79ef('0x10'));var Papa=require(_0x79ef('0x11'));var Redis=require('ioredis');var authService=require(_0x79ef('0x12'));var qs=require(_0x79ef('0x13'));var as=require(_0x79ef('0x14'));var hardwareService=require(_0x79ef('0x15'));var logger=require(_0x79ef('0x16'))(_0x79ef('0x17'));var utils=require(_0x79ef('0x18'));var config=require(_0x79ef('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x79ef('0x1a'))['db'];config['redis']=_[_0x79ef('0x1b')](config[_0x79ef('0x1c')],{'host':_0x79ef('0x1d'),'port':0x18eb});var socket=require(_0x79ef('0x1e'))(new Redis(config[_0x79ef('0x1c')]));require(_0x79ef('0x1f'))[_0x79ef('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x79ef('0x21')][_0x79ef('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x2e3232,_0x1f6c4e,_0x1877ce,_0x336e2f){return new BPromise(function(_0x1df85a,_0x5c1d4a){var _0x4380e3=_0x336e2f||client;return _0x4380e3[_0x79ef('0x23')](_0x2e3232,_0x1877ce)['then'](function(_0x3055c9){logger[_0x79ef('0x24')]('SmsAccount,\x20%s,\x20%s',_0x1f6c4e,'request\x20sent');logger[_0x79ef('0x25')](_0x79ef('0x26'),_0x1f6c4e,_0x79ef('0x27'),JSON[_0x79ef('0x28')](_0x3055c9));if(_0x3055c9['error']){if(_0x3055c9['error'][_0x79ef('0x29')]===0x1f4){logger['error'](_0x79ef('0x2a'),_0x1f6c4e,_0x3055c9[_0x79ef('0x2b')]['message']);return _0x5c1d4a(_0x3055c9[_0x79ef('0x2b')][_0x79ef('0x2c')]);}logger[_0x79ef('0x2b')](_0x79ef('0x2a'),_0x1f6c4e,_0x3055c9[_0x79ef('0x2b')]['message']);return _0x1df85a(_0x3055c9[_0x79ef('0x2b')]['message']);}else{logger[_0x79ef('0x24')](_0x79ef('0x2a'),_0x1f6c4e,_0x79ef('0x27'));_0x1df85a(_0x3055c9[_0x79ef('0x2d')][_0x79ef('0x2c')]);}})[_0x79ef('0x2e')](function(_0x47feca){logger[_0x79ef('0x2b')]('SmsAccount,\x20%s,\x20%s',_0x1f6c4e,_0x47feca);_0x5c1d4a(_0x47feca);});});}function respondWithStatusCode(_0x1272e8,_0x18ded7){_0x18ded7=_0x18ded7||0xcc;return function(_0xd52cd4){if(_0xd52cd4){return _0x1272e8[_0x79ef('0x2f')](_0x18ded7);}return _0x1272e8[_0x79ef('0x30')](_0x18ded7)[_0x79ef('0x31')]();};}function respondWithResult(_0x1bcb80,_0x3873f0){_0x3873f0=_0x3873f0||0xc8;return function(_0x55146e){if(_0x55146e){return _0x1bcb80['status'](_0x3873f0)[_0x79ef('0x32')](_0x55146e);}};}function respondWithFilteredResult(_0x238662,_0x5f6387){return function(_0x2e8482){if(_0x2e8482){var _0x12152a=typeof _0x5f6387[_0x79ef('0x33')]==='undefined'&&typeof _0x5f6387[_0x79ef('0x34')]==='undefined';var _0x907cc=_0x2e8482[_0x79ef('0x35')];var _0x2b4705=_0x12152a?0x0:_0x5f6387[_0x79ef('0x33')];var _0x32ab1f=_0x12152a?_0x2e8482['count']:_0x5f6387[_0x79ef('0x33')]+_0x5f6387[_0x79ef('0x34')];var _0x1122a8;if(_0x32ab1f>=_0x907cc){_0x32ab1f=_0x907cc;_0x1122a8=0xc8;}else{_0x1122a8=0xce;}_0x238662[_0x79ef('0x30')](_0x1122a8);return _0x238662[_0x79ef('0x36')](_0x79ef('0x37'),_0x2b4705+'-'+_0x32ab1f+'/'+_0x907cc)[_0x79ef('0x32')](_0x2e8482);}return null;};}function patchUpdates(_0x9b1e0c){return function(_0xec3c37){try{jsonpatch['apply'](_0xec3c37,_0x9b1e0c,!![]);}catch(_0x3baf04){return BPromise[_0x79ef('0x38')](_0x3baf04);}return _0xec3c37[_0x79ef('0x39')]();};}function saveUpdates(_0x32aec6,_0x580dd5){return function(_0x3f3a56){if(_0x3f3a56){return _0x3f3a56[_0x79ef('0x3a')](_0x32aec6)[_0x79ef('0x3b')](function(_0x3e9839){return _0x3e9839;});}return null;};}function removeEntity(_0x1b1cc3,_0x3cd039){return function(_0x42ccaf){if(_0x42ccaf){return _0x42ccaf[_0x79ef('0x3c')]()['then'](function(){var _0x4ecb87=_0x42ccaf[_0x79ef('0x3d')]({'plain':!![]});var _0x2f345e=_0x79ef('0x3e');return db[_0x79ef('0x3f')][_0x79ef('0x3c')]({'where':{'type':_0x2f345e,'resourceId':_0x4ecb87['id']}})[_0x79ef('0x3b')](function(){return _0x42ccaf;});})[_0x79ef('0x3b')](function(){_0x1b1cc3[_0x79ef('0x30')](0xcc)[_0x79ef('0x31')]();});}};}function handleEntityNotFound(_0x3f6fc4,_0x4ab0f8){return function(_0xc8b41c){if(!_0xc8b41c){_0x3f6fc4['sendStatus'](0x194);}return _0xc8b41c;};}function handleError(_0x3c8aff,_0x4d1031){_0x4d1031=_0x4d1031||0x1f4;return function(_0x467a7d){logger['error'](_0x467a7d[_0x79ef('0x40')]);if(_0x467a7d[_0x79ef('0x41')]){delete _0x467a7d[_0x79ef('0x41')];}_0x3c8aff[_0x79ef('0x30')](_0x4d1031)[_0x79ef('0x42')](_0x467a7d);};}exports[_0x79ef('0x43')]=function(_0x385a2a,_0x2ded65){var _0x1b7f0d={'include':[{'model':db[_0x79ef('0x44')],'as':_0x79ef('0x45')}]},_0x3bedbf={},_0x32dbe6={'count':0x0,'rows':[]};var _0x2459c8=_[_0x79ef('0x46')](db[_0x79ef('0x47')][_0x79ef('0x48')],function(_0x32eeb6){return{'name':_0x32eeb6[_0x79ef('0x49')],'type':_0x32eeb6[_0x79ef('0x4a')][_0x79ef('0x4b')]};});_0x3bedbf[_0x79ef('0x4c')]=_['map'](_0x2459c8,'name');_0x3bedbf[_0x79ef('0x4d')]=_[_0x79ef('0x4e')](_0x385a2a['query']);_0x3bedbf[_0x79ef('0x4f')]=_[_0x79ef('0x50')](_0x3bedbf[_0x79ef('0x4c')],_0x3bedbf[_0x79ef('0x4d')]);_0x1b7f0d[_0x79ef('0x51')]=_[_0x79ef('0x50')](_0x3bedbf[_0x79ef('0x4c')],qs[_0x79ef('0x52')](_0x385a2a[_0x79ef('0x4d')]['fields']));_0x1b7f0d[_0x79ef('0x51')]=_0x1b7f0d['attributes'][_0x79ef('0x53')]?_0x1b7f0d[_0x79ef('0x51')]:_0x3bedbf['model'];if(!_0x385a2a[_0x79ef('0x4d')][_0x79ef('0x54')]('nolimit')){_0x1b7f0d[_0x79ef('0x34')]=qs['limit'](_0x385a2a[_0x79ef('0x4d')][_0x79ef('0x34')]);_0x1b7f0d[_0x79ef('0x33')]=qs[_0x79ef('0x33')](_0x385a2a[_0x79ef('0x4d')][_0x79ef('0x33')]);}_0x1b7f0d[_0x79ef('0x55')]=qs[_0x79ef('0x56')](_0x385a2a[_0x79ef('0x4d')][_0x79ef('0x56')]);_0x1b7f0d[_0x79ef('0x57')]=qs['filters'](_[_0x79ef('0x58')](_0x385a2a['query'],_0x3bedbf[_0x79ef('0x4f')]),_0x2459c8);if(_0x385a2a[_0x79ef('0x4d')]['filter']){_0x1b7f0d[_0x79ef('0x57')]=_['merge'](_0x1b7f0d[_0x79ef('0x57')],{'$or':_[_0x79ef('0x46')](_0x2459c8,function(_0x4654c0){if(_0x4654c0[_0x79ef('0x4a')]!=='VIRTUAL'){var _0x2ac818={};_0x2ac818[_0x4654c0[_0x79ef('0x41')]]={'$like':'%'+_0x385a2a[_0x79ef('0x4d')][_0x79ef('0x59')]+'%'};return _0x2ac818;}})});}_0x1b7f0d=_[_0x79ef('0x5a')]({},_0x1b7f0d,_0x385a2a[_0x79ef('0x5b')]);var _0x57b573={'where':_0x1b7f0d[_0x79ef('0x57')]};return db[_0x79ef('0x47')][_0x79ef('0x35')](_0x57b573)[_0x79ef('0x3b')](function(_0x4584a5){_0x32dbe6['count']=_0x4584a5;if(_0x385a2a[_0x79ef('0x4d')]['includeAll']){_0x1b7f0d[_0x79ef('0x5c')]=[{'all':!![]}];}return db[_0x79ef('0x47')][_0x79ef('0x5d')](_0x1b7f0d);})['then'](function(_0x58f731){_0x32dbe6[_0x79ef('0x5e')]=_0x58f731;return _0x32dbe6;})[_0x79ef('0x3b')](respondWithFilteredResult(_0x2ded65,_0x1b7f0d))[_0x79ef('0x2e')](handleError(_0x2ded65,null));};exports[_0x79ef('0x5f')]=function(_0x4d1e95,_0x53d6ee){var _0x2b324d={'raw':![],'where':{'id':_0x4d1e95[_0x79ef('0x60')]['id']},'include':[{'model':db[_0x79ef('0x44')],'as':_0x79ef('0x45')}]},_0x45f80d={};_0x45f80d['model']=_[_0x79ef('0x4e')](db[_0x79ef('0x47')][_0x79ef('0x48')]);_0x45f80d[_0x79ef('0x4d')]=_[_0x79ef('0x4e')](_0x4d1e95[_0x79ef('0x4d')]);_0x45f80d[_0x79ef('0x4f')]=_['intersection'](_0x45f80d['model'],_0x45f80d[_0x79ef('0x4d')]);_0x2b324d['attributes']=_[_0x79ef('0x50')](_0x45f80d[_0x79ef('0x4c')],qs[_0x79ef('0x52')](_0x4d1e95['query']['fields']));_0x2b324d[_0x79ef('0x51')]=_0x2b324d['attributes'][_0x79ef('0x53')]?_0x2b324d[_0x79ef('0x51')]:_0x45f80d[_0x79ef('0x4c')];if(_0x4d1e95['query']['includeAll']){_0x2b324d[_0x79ef('0x5c')]=[{'all':!![]}];}_0x2b324d=_['merge']({},_0x2b324d,_0x4d1e95[_0x79ef('0x5b')]);return db['SmsAccount'][_0x79ef('0x61')](_0x2b324d)[_0x79ef('0x3b')](handleEntityNotFound(_0x53d6ee,null))['then'](respondWithResult(_0x53d6ee,null))[_0x79ef('0x2e')](handleError(_0x53d6ee,null));};exports[_0x79ef('0x62')]=function(_0x468340,_0x32dadf){return db[_0x79ef('0x47')][_0x79ef('0x62')](_0x468340[_0x79ef('0x63')],{})[_0x79ef('0x3b')](function(_0x1c0eb0){var _0x32bf07=_0x468340[_0x79ef('0x64')]['get']({'plain':!![]});if(!_0x32bf07)throw new Error(_0x79ef('0x65'));if(_0x32bf07[_0x79ef('0x66')]==='user'){var _0xff6068=_0x1c0eb0[_0x79ef('0x3d')]({'plain':!![]});var _0x45ca76=_0x79ef('0x3e');return db['UserProfileSection'][_0x79ef('0x61')]({'where':{'name':_0x45ca76,'userProfileId':_0x32bf07[_0x79ef('0x67')]},'raw':!![]})[_0x79ef('0x3b')](function(_0x3473a2){if(_0x3473a2&&_0x3473a2[_0x79ef('0x68')]===0x0){return db[_0x79ef('0x3f')][_0x79ef('0x62')]({'name':_0xff6068['name'],'resourceId':_0xff6068['id'],'type':_0x3473a2[_0x79ef('0x41')],'sectionId':_0x3473a2['id']},{})['then'](function(){return _0x1c0eb0;});}else{return _0x1c0eb0;}})[_0x79ef('0x2e')](function(_0x4c04bb){logger['error'](_0x79ef('0x69'),_0x4c04bb);throw _0x4c04bb;});}return _0x1c0eb0;})['then'](respondWithResult(_0x32dadf,0xc9))[_0x79ef('0x2e')](handleError(_0x32dadf,null));};exports['update']=function(_0x2a3666,_0x11b793){if(_0x2a3666[_0x79ef('0x63')]['id']){delete _0x2a3666[_0x79ef('0x63')]['id'];}return db[_0x79ef('0x47')][_0x79ef('0x61')]({'where':{'id':_0x2a3666[_0x79ef('0x60')]['id']},'include':[{'model':db[_0x79ef('0x44')],'as':_0x79ef('0x45')}]})[_0x79ef('0x3b')](handleEntityNotFound(_0x11b793,null))['then'](saveUpdates(_0x2a3666[_0x79ef('0x63')],null))[_0x79ef('0x3b')](respondWithResult(_0x11b793,null))['catch'](handleError(_0x11b793,null));};exports[_0x79ef('0x3c')]=function(_0x5cd1ea,_0x2d8547){return db['SmsAccount'][_0x79ef('0x61')]({'where':{'id':_0x5cd1ea[_0x79ef('0x60')]['id']}})[_0x79ef('0x3b')](handleEntityNotFound(_0x2d8547,null))[_0x79ef('0x3b')](removeEntity(_0x2d8547,null))[_0x79ef('0x2e')](handleError(_0x2d8547,null));};exports[_0x79ef('0x6a')]=function(_0x4c39c7,_0x4fdbf9){return db['SmsAccount'][_0x79ef('0x6a')]()[_0x79ef('0x3b')](respondWithResult(_0x4fdbf9,null))[_0x79ef('0x2e')](handleError(_0x4fdbf9,null));};exports[_0x79ef('0x6b')]=function(_0x8904aa,_0x3df545,_0x38bce0){if(_0x8904aa[_0x79ef('0x63')]['id']){delete _0x8904aa[_0x79ef('0x63')]['id'];}return db[_0x79ef('0x47')][_0x79ef('0x61')]({'where':{'id':_0x8904aa[_0x79ef('0x60')]['id']}})['then'](handleEntityNotFound(_0x3df545,null))['then'](function(_0x5ca3e4){if(_0x5ca3e4){_0x8904aa[_0x79ef('0x63')][_0x79ef('0x6c')]=_0x5ca3e4['id'];return db['Disposition'][_0x79ef('0x62')](_0x8904aa[_0x79ef('0x63')]);}})[_0x79ef('0x3b')](respondWithResult(_0x3df545,null))['catch'](handleError(_0x3df545,null));};exports['getDispositions']=function(_0x54e79c,_0x4cbd8e,_0x2305de){var _0x8312f8={'raw':![],'where':{}};var _0x5a6b9b={};var _0x371876={'count':0x0,'rows':[]};return db[_0x79ef('0x47')][_0x79ef('0x6d')]({'where':{'id':_0x54e79c['params']['id']}})[_0x79ef('0x3b')](handleEntityNotFound(_0x4cbd8e,null))[_0x79ef('0x3b')](function(_0x50d58f){if(_0x50d58f){_0x5a6b9b[_0x79ef('0x4c')]=_['keys'](db[_0x79ef('0x6e')][_0x79ef('0x48')]);_0x5a6b9b[_0x79ef('0x4d')]=_[_0x79ef('0x4e')](_0x54e79c[_0x79ef('0x4d')]);_0x5a6b9b[_0x79ef('0x4f')]=_[_0x79ef('0x50')](_0x5a6b9b['model'],_0x5a6b9b[_0x79ef('0x4d')]);_0x8312f8[_0x79ef('0x51')]=_[_0x79ef('0x50')](_0x5a6b9b['model'],qs[_0x79ef('0x52')](_0x54e79c['query']['fields']));_0x8312f8[_0x79ef('0x51')]=_0x8312f8[_0x79ef('0x51')][_0x79ef('0x53')]?_0x8312f8[_0x79ef('0x51')]:_0x5a6b9b['model'];if(!_0x54e79c[_0x79ef('0x4d')]['hasOwnProperty'](_0x79ef('0x6f'))){_0x8312f8['limit']=qs[_0x79ef('0x34')](_0x54e79c[_0x79ef('0x4d')][_0x79ef('0x34')]);_0x8312f8[_0x79ef('0x33')]=qs['offset'](_0x54e79c[_0x79ef('0x4d')][_0x79ef('0x33')]);}_0x8312f8[_0x79ef('0x55')]=qs[_0x79ef('0x56')](_0x54e79c[_0x79ef('0x4d')][_0x79ef('0x56')]);_0x8312f8[_0x79ef('0x57')]=qs[_0x79ef('0x4f')](_[_0x79ef('0x58')](_0x54e79c['query'],_0x5a6b9b['filters']));_0x8312f8[_0x79ef('0x57')]['SmsAccountId']=_0x50d58f['id'];if(_0x54e79c[_0x79ef('0x4d')]['filter']){_0x8312f8[_0x79ef('0x57')]=_['merge'](_0x8312f8['where'],{'$or':_[_0x79ef('0x46')](_0x8312f8['attributes'],function(_0x5d6e20){var _0xb959be={};_0xb959be[_0x5d6e20]={'$like':'%'+_0x54e79c[_0x79ef('0x4d')][_0x79ef('0x59')]+'%'};return _0xb959be;})});}_0x8312f8=_[_0x79ef('0x5a')]({},_0x8312f8,_0x54e79c[_0x79ef('0x5b')]);return db['Disposition'][_0x79ef('0x35')]({'where':_0x8312f8[_0x79ef('0x57')]})[_0x79ef('0x3b')](function(_0x3ae494){_0x371876[_0x79ef('0x35')]=_0x3ae494;if(_0x54e79c[_0x79ef('0x4d')][_0x79ef('0x70')]){_0x8312f8[_0x79ef('0x5c')]=[{'all':!![]}];}return db[_0x79ef('0x6e')][_0x79ef('0x5d')](_0x8312f8);})[_0x79ef('0x3b')](function(_0x155aa8){_0x371876[_0x79ef('0x5e')]=_0x155aa8;return _0x371876;});}})[_0x79ef('0x3b')](respondWithFilteredResult(_0x4cbd8e,_0x8312f8))[_0x79ef('0x2e')](handleError(_0x4cbd8e,null));};exports[_0x79ef('0x71')]=function(_0x1007e6,_0x264fdb,_0x133d87){return db[_0x79ef('0x47')][_0x79ef('0x61')]({'where':{'id':_0x1007e6[_0x79ef('0x60')]['id']}})[_0x79ef('0x3b')](handleEntityNotFound(_0x264fdb,null))[_0x79ef('0x3b')](function(_0x572428){if(_0x572428){return _0x572428[_0x79ef('0x71')](_0x1007e6[_0x79ef('0x4d')][_0x79ef('0x72')]);}})[_0x79ef('0x3b')](respondWithStatusCode(_0x264fdb,null))[_0x79ef('0x2e')](handleError(_0x264fdb,null));};exports['addAnswer']=function(_0x58b2c4,_0x128d33,_0x2688f3){if(_0x58b2c4[_0x79ef('0x63')]['id']){delete _0x58b2c4[_0x79ef('0x63')]['id'];}return db[_0x79ef('0x47')][_0x79ef('0x61')]({'where':{'id':_0x58b2c4[_0x79ef('0x60')]['id']}})[_0x79ef('0x3b')](handleEntityNotFound(_0x128d33,null))[_0x79ef('0x3b')](function(_0x73b52f){if(_0x73b52f){_0x58b2c4[_0x79ef('0x63')]['SmsAccountId']=_0x73b52f['id'];return db['CannedAnswer']['create'](_0x58b2c4[_0x79ef('0x63')]);}})[_0x79ef('0x3b')](respondWithResult(_0x128d33,null))[_0x79ef('0x2e')](handleError(_0x128d33,null));};exports[_0x79ef('0x73')]=function(_0x4b6b11,_0x3c321f,_0x303b5d){var _0x59f569={'raw':![],'where':{}};var _0x4dfd84={};var _0x586e17={'count':0x0,'rows':[]};return db[_0x79ef('0x47')][_0x79ef('0x6d')]({'where':{'id':_0x4b6b11[_0x79ef('0x60')]['id']}})[_0x79ef('0x3b')](handleEntityNotFound(_0x3c321f,null))[_0x79ef('0x3b')](function(_0x4e5619){if(_0x4e5619){_0x4dfd84[_0x79ef('0x4c')]=_[_0x79ef('0x4e')](db['CannedAnswer'][_0x79ef('0x48')]);_0x4dfd84['query']=_[_0x79ef('0x4e')](_0x4b6b11[_0x79ef('0x4d')]);_0x4dfd84[_0x79ef('0x4f')]=_[_0x79ef('0x50')](_0x4dfd84['model'],_0x4dfd84['query']);_0x59f569[_0x79ef('0x51')]=_[_0x79ef('0x50')](_0x4dfd84[_0x79ef('0x4c')],qs[_0x79ef('0x52')](_0x4b6b11[_0x79ef('0x4d')][_0x79ef('0x52')]));_0x59f569[_0x79ef('0x51')]=_0x59f569[_0x79ef('0x51')]['length']?_0x59f569['attributes']:_0x4dfd84['model'];if(!_0x4b6b11[_0x79ef('0x4d')][_0x79ef('0x54')](_0x79ef('0x6f'))){_0x59f569[_0x79ef('0x34')]=qs[_0x79ef('0x34')](_0x4b6b11[_0x79ef('0x4d')]['limit']);_0x59f569[_0x79ef('0x33')]=qs['offset'](_0x4b6b11[_0x79ef('0x4d')][_0x79ef('0x33')]);}_0x59f569[_0x79ef('0x55')]=qs[_0x79ef('0x56')](_0x4b6b11[_0x79ef('0x4d')][_0x79ef('0x56')]);_0x59f569[_0x79ef('0x57')]=qs[_0x79ef('0x4f')](_[_0x79ef('0x58')](_0x4b6b11['query'],_0x4dfd84[_0x79ef('0x4f')]));_0x59f569['where'][_0x79ef('0x6c')]=_0x4e5619['id'];if(_0x4b6b11[_0x79ef('0x4d')][_0x79ef('0x59')]){_0x59f569[_0x79ef('0x57')]=_[_0x79ef('0x5a')](_0x59f569['where'],{'$or':_[_0x79ef('0x46')](_0x59f569[_0x79ef('0x51')],function(_0xbecc39){var _0xcc06d6={};_0xcc06d6[_0xbecc39]={'$like':'%'+_0x4b6b11[_0x79ef('0x4d')]['filter']+'%'};return _0xcc06d6;})});}_0x59f569=_['merge']({},_0x59f569,_0x4b6b11[_0x79ef('0x5b')]);return db[_0x79ef('0x74')][_0x79ef('0x35')]({'where':_0x59f569[_0x79ef('0x57')]})[_0x79ef('0x3b')](function(_0x4c0643){_0x586e17[_0x79ef('0x35')]=_0x4c0643;if(_0x4b6b11[_0x79ef('0x4d')][_0x79ef('0x70')]){_0x59f569[_0x79ef('0x5c')]=[{'all':!![]}];}return db[_0x79ef('0x74')][_0x79ef('0x5d')](_0x59f569);})['then'](function(_0xacdd0){_0x586e17['rows']=_0xacdd0;return _0x586e17;});}})['then'](respondWithFilteredResult(_0x3c321f,_0x59f569))[_0x79ef('0x2e')](handleError(_0x3c321f,null));};exports[_0x79ef('0x75')]=function(_0x499575,_0xe62dd7,_0x48b34a){return db[_0x79ef('0x47')][_0x79ef('0x61')]({'where':{'id':_0x499575[_0x79ef('0x60')]['id']}})[_0x79ef('0x3b')](handleEntityNotFound(_0xe62dd7,null))[_0x79ef('0x3b')](function(_0x53d1dd){if(_0x53d1dd){return _0x53d1dd[_0x79ef('0x75')](_0x499575['query'][_0x79ef('0x72')]);}})[_0x79ef('0x3b')](respondWithStatusCode(_0xe62dd7,null))[_0x79ef('0x2e')](handleError(_0xe62dd7,null));};exports[_0x79ef('0x76')]=function(_0x2c12e4,_0xe4984e,_0x44ffce){var _0x157bb4={'channel':_0x79ef('0x77')};var _0x5b11cb=[];var _0x571af0=[];var _0x1b8931={};return db['SmsAccount']['find']({'where':{'id':_0x2c12e4[_0x79ef('0x60')]['id']},'include':[{'model':db['SmsApplication'],'as':_0x79ef('0x78')}]})[_0x79ef('0x3b')](handleEntityNotFound(_0xe4984e,null))[_0x79ef('0x3b')](function(_0x45f77a){_0x157bb4[_0x79ef('0x79')]=_0x45f77a;_0x157bb4[_0x79ef('0x7a')]=_[_0x79ef('0x7b')](_0x45f77a['Applications'],['priority'],[_0x79ef('0x7c')]);if(_0x157bb4[_0x79ef('0x79')][_0x79ef('0x78')]){delete _0x157bb4[_0x79ef('0x79')][_0x79ef('0x78')];}return db['CmContact'][_0x79ef('0x6a')]();})[_0x79ef('0x3b')](function(_0x3a6bcc){if(!_0x3a6bcc){throw new db['Sequelize'][(_0x79ef('0x7d'))](_0x79ef('0x7e'));}_0x5b11cb=_[_0x79ef('0x7f')](_['keys'](_0x3a6bcc),[_0x79ef('0x80'),'updatedAt']);_0x571af0=_['difference'](_[_0x79ef('0x4e')](_0x3a6bcc),[_0x79ef('0x80'),_0x79ef('0x81'),_0x79ef('0x82'),_0x79ef('0x83')]);_0x157bb4['body']={'mapKey':'mobile'};if(_0x157bb4[_0x79ef('0x79')][_0x79ef('0x4a')]){switch(_0x157bb4[_0x79ef('0x79')][_0x79ef('0x4a')]){case _0x79ef('0x84'):_0x157bb4[_0x79ef('0x63')][_0x79ef('0x85')]=_0x2c12e4[_0x79ef('0x63')][_0x79ef('0x86')];_0x157bb4[_0x79ef('0x63')]['body']=_0x2c12e4[_0x79ef('0x63')][_0x79ef('0x87')];_0x157bb4['body'][_0x79ef('0x88')]=_0x2c12e4[_0x79ef('0x63')]['MessageSid'];break;case'skebby':_0x157bb4[_0x79ef('0x63')][_0x79ef('0x85')]='+'+_0x2c12e4[_0x79ef('0x63')][_0x79ef('0x89')];_0x157bb4[_0x79ef('0x63')][_0x79ef('0x63')]=_0x2c12e4[_0x79ef('0x63')]['text'];break;case _0x79ef('0x8a'):_0x157bb4['body']['from']=_0x2c12e4['body'][_0x79ef('0x85')];_0x157bb4[_0x79ef('0x63')][_0x79ef('0x63')]=_0x2c12e4[_0x79ef('0x63')][_0x79ef('0x2c')];break;case _0x79ef('0x8b'):_0x157bb4[_0x79ef('0x63')][_0x79ef('0x85')]=_0x2c12e4[_0x79ef('0x63')]['from'];_0x157bb4[_0x79ef('0x63')][_0x79ef('0x63')]=_0x2c12e4['body'][_0x79ef('0x63')];_0x157bb4[_0x79ef('0x63')]['messageId']=_0x2c12e4[_0x79ef('0x63')][_0x79ef('0x8c')];break;case _0x79ef('0x8d'):_0x157bb4['body'][_0x79ef('0x85')]=_0x2c12e4['body'][_0x79ef('0x86')];_0x157bb4[_0x79ef('0x63')][_0x79ef('0x63')]=_0x2c12e4[_0x79ef('0x63')]['Text'];_0x157bb4[_0x79ef('0x63')][_0x79ef('0x88')]=_0x2c12e4['body'][_0x79ef('0x8e')];break;case _0x79ef('0x8f'):_0x157bb4[_0x79ef('0x63')][_0x79ef('0x85')]='+'+_0x2c12e4['body'][_0x79ef('0x90')][0x0]['from'];_0x157bb4[_0x79ef('0x63')][_0x79ef('0x63')]=_0x2c12e4['body'][_0x79ef('0x90')][0x0][_0x79ef('0x91')];_0x157bb4[_0x79ef('0x63')][_0x79ef('0x88')]=_0x2c12e4[_0x79ef('0x63')][_0x79ef('0x90')][0x0][_0x79ef('0x88')];break;case _0x79ef('0x92'):_0x157bb4[_0x79ef('0x63')]['from']=_0x2c12e4[_0x79ef('0x63')][_0x79ef('0x93')];_0x157bb4['body'][_0x79ef('0x63')]=_0x2c12e4[_0x79ef('0x63')][_0x79ef('0x94')][_0x79ef('0x2c')];break;case _0x79ef('0x95'):_0x157bb4['body'][_0x79ef('0x85')]=_0x2c12e4[_0x79ef('0x63')]['fromNumber'];_0x157bb4[_0x79ef('0x63')][_0x79ef('0x63')]=_0x2c12e4[_0x79ef('0x63')][_0x79ef('0x91')];_0x157bb4['body'][_0x79ef('0x88')]=_0x2c12e4['body']['replyMessageId'];break;case'bandwidth':_0x157bb4[_0x79ef('0x63')][_0x79ef('0x88')]=_0x2c12e4[_0x79ef('0x63')][0x0][_0x79ef('0x2c')]['id'];_0x157bb4[_0x79ef('0x63')][_0x79ef('0x85')]=_0x2c12e4[_0x79ef('0x63')][0x0][_0x79ef('0x2c')]['from'];_0x157bb4[_0x79ef('0x63')]['body']=_0x2c12e4[_0x79ef('0x63')][0x0][_0x79ef('0x2c')][_0x79ef('0x91')];break;case _0x79ef('0x96'):_0x157bb4[_0x79ef('0x63')][_0x79ef('0x85')]=_0x2c12e4['body'][_0x79ef('0x85')];_0x157bb4[_0x79ef('0x63')][_0x79ef('0x63')]=_0x2c12e4[_0x79ef('0x63')]['message'];_0x157bb4[_0x79ef('0x63')]['messageId']=_0x2c12e4[_0x79ef('0x63')][_0x79ef('0x97')];break;}}if(_0x157bb4['body']['id']){delete _0x157bb4['body']['id'];}if(_[_0x79ef('0x98')](_0x157bb4['body']['from'])){throw new db[(_0x79ef('0x99'))][(_0x79ef('0x7d'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x157bb4['body']['body'])||_0x157bb4[_0x79ef('0x63')][_0x79ef('0x63')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x79ef('0x98')](_0x157bb4[_0x79ef('0x63')][_0x79ef('0x9a')])){throw new db['Sequelize'][(_0x79ef('0x7d'))](_0x79ef('0x9b')+_0x571af0);}if(!_['includes'](_0x571af0,_0x157bb4[_0x79ef('0x63')]['mapKey'])){throw new db['Sequelize'][(_0x79ef('0x7d'))](_0x79ef('0x9c')+_0x571af0);}_0x1b8931[_0x157bb4[_0x79ef('0x63')][_0x79ef('0x9a')]]=_0x157bb4[_0x79ef('0x63')][_0x79ef('0x85')];return db[_0x79ef('0x9d')]['find']({'where':{'id':_0x157bb4['account'][_0x79ef('0x83')]},'include':[{'model':db[_0x79ef('0x9e')],'as':'Contacts','where':_0x1b8931,'limit':0x1,'order':[[_0x79ef('0x81'),_0x79ef('0x9f')]]}]});})['then'](handleEntityNotFound(_0xe4984e,null))[_0x79ef('0x3b')](function(_0x54b392){if(_0x54b392){_0x157bb4[_0x79ef('0xa0')]=_[_0x79ef('0xa1')](_0x54b392,[_0x79ef('0xa2')]);if(_0x54b392['Contacts'][_0x79ef('0x53')]){return _0x54b392[_0x79ef('0xa2')][0x0];}var _0x6ab53f=_[_0x79ef('0x1b')](_0x157bb4[_0x79ef('0x63')],{'firstName':_0x157bb4[_0x79ef('0x63')][_0x79ef('0x85')],'ListId':_0x54b392['id']});_0x6ab53f[_0x157bb4['body'][_0x79ef('0x9a')]]=_0x157bb4[_0x79ef('0x63')]['from'];return db[_0x79ef('0x9e')][_0x79ef('0x62')](_0x6ab53f,{'fields':_0x5b11cb,'raw':!![]});}})[_0x79ef('0x3b')](handleEntityNotFound(_0xe4984e,null))['then'](function(_0xe50c58){if(_0xe50c58){_0x157bb4[_0x79ef('0xa3')]=_0xe50c58;var _0x291cf2={'ContactId':_0xe50c58['id'],'phone':_0x157bb4[_0x79ef('0x63')][_0x79ef('0x85')],'SmsAccountId':_0x2c12e4['params']['id']};var _0x3b8beb={'ContactId':_0xe50c58['id'],'SmsAccountId':_0x2c12e4[_0x79ef('0x60')]['id'],'closed':![]};return db['SmsInteraction'][_0x79ef('0x61')]({'where':_0x3b8beb})[_0x79ef('0x3b')](function(_0x3034fd){if(_0x3034fd){return[_0x3034fd,![]];}return db[_0x79ef('0xa4')]['create'](_0x291cf2)[_0x79ef('0x3b')](function(_0x59c4ba){return[_0x59c4ba,!![]];});});}})[_0x79ef('0xa5')](function(_0x26f51f,_0x3a51df){_0x157bb4[_0x79ef('0xa6')]=_0x26f51f[_0x79ef('0x3d')]({'plain':!![]});_0x157bb4[_0x79ef('0xa6')][_0x79ef('0xa7')]=![];if(_0x3a51df){if(_0x157bb4[_0x79ef('0x79')][_0x79ef('0xa8')]){_0x157bb4['applications'][_0x79ef('0xa9')]({'id':0x0,'priority':_0x157bb4[_0x79ef('0x7a')][_0x79ef('0x53')]+0x1,'app':'close','appdata':_0x79ef('0xaa'),'interval':_0x79ef('0xab')});}_0x157bb4[_0x79ef('0xa6')][_0x79ef('0xa7')]=!![];}return db['SmsMessage']['create']({'phone':_0x157bb4[_0x79ef('0x63')]['from'],'messageId':_0x157bb4[_0x79ef('0x63')]['messageId'],'body':_0x157bb4['body']['body'],'SmsAccountId':_0x2c12e4[_0x79ef('0x60')]['id'],'SmsInteractionId':_0x26f51f['id'],'direction':'in','ContactId':_0x26f51f[_0x79ef('0xac')],'AttachmentId':_0x157bb4[_0x79ef('0x63')]['AttachmentId']});})['then'](function(_0x112531){_0x157bb4[_0x79ef('0x2c')]=_0x112531;if(!_0x157bb4[_0x79ef('0xa6')][_0x79ef('0xad')])return;return db['User']['find']({'attributes':['id',_0x79ef('0x41')],'where':{'id':_0x157bb4[_0x79ef('0xa6')][_0x79ef('0xad')]}});})[_0x79ef('0x3b')](function(_0x49bf5b){if(_0x49bf5b){_0x157bb4['applications'][_0x79ef('0xae')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x49bf5b[_0x79ef('0x41')]+','+(_0x157bb4[_0x79ef('0x79')][_0x79ef('0xaf')]||0xa),'interval':_0x79ef('0xab')});}if(!_0x157bb4[_0x79ef('0xa6')][_0x79ef('0xb0')])return;return db['SmsQueue'][_0x79ef('0x61')]({'attributes':['id',_0x79ef('0x41')],'where':{'id':_0x157bb4[_0x79ef('0xa6')]['queueId']}});})[_0x79ef('0x3b')](function(_0x5c43dc){if(_0x5c43dc){_0x157bb4[_0x79ef('0x7a')]['unshift']({'id':0x0,'priority':0x1,'app':_0x79ef('0xb1'),'appdata':_0x5c43dc[_0x79ef('0x41')]+','+(_0x157bb4['account'][_0x79ef('0xb2')]||0x12c),'interval':_0x79ef('0xab')});}return respondWithRpcPromise(_0x79ef('0xb3'),_0x79ef('0xb4'),_0x157bb4);})[_0x79ef('0x3b')](function(_0x1771c8){if(_0x1771c8){var _0x5c5337=0xc8;var _0x2f36fc=_0x79ef('0xb5');logger['info']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x2f36fc,_0x5c5337,_0x79ef('0xb6'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x2f36fc,_0x5c5337,'entity\x20found',JSON['stringify'](_0x1771c8));if(_0x157bb4[_0x79ef('0x79')][_0x79ef('0x4a')]==='twilio'){return _0xe4984e[_0x79ef('0x30')](_0x5c5337)['set'](_0x79ef('0xb7'),_0x79ef('0xb8'))[_0x79ef('0x42')](_0x79ef('0xb9'));}else{return _0xe4984e[_0x79ef('0x30')](_0x5c5337)['json'](_0x1771c8);}}})[_0x79ef('0x2e')](handleError(_0xe4984e,null));};exports[_0x79ef('0xba')]=function(_0x3cf95f,_0x24c084){var _0x58cd1a=_0x3cf95f[_0x79ef('0x60')]['id'];var _0x4f8ad7=_0x3cf95f['body'];var _0x4da035=0xc8;var _0x36d094=null;return db['sequelize'][_0x79ef('0xbb')]({'isolationLevel':db[_0x79ef('0xbc')][_0x79ef('0xbd')][_0x79ef('0xbe')][_0x79ef('0xbf')]},function(_0x131ddf){return db[_0x79ef('0x47')][_0x79ef('0x6d')]({'where':{'id':_0x58cd1a},'transaction':_0x131ddf})[_0x79ef('0x3b')](function(_0x7ff022){if(_0x7ff022){return db[_0x79ef('0xc0')][_0x79ef('0x3c')]({'where':{'SmsAccountId':_0x58cd1a},'transaction':_0x131ddf})[_0x79ef('0x3b')](function(){var _0x314ad7=_[_0x79ef('0x46')](_0x4f8ad7,function(_0x420435){_0x420435['SmsAccountId']=_0x58cd1a;return _0x420435;});return db[_0x79ef('0xc0')]['bulkCreate'](_0x314ad7,{'transaction':_0x131ddf});});}else{_0x4da035=0x194;_0x36d094=[];}});})[_0x79ef('0x3b')](function(){if(_0x4da035!==0x194){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x58cd1a},'order':'priority'})[_0x79ef('0x3b')](function(_0x3e2e32){_0x36d094=_0x3e2e32;});}})[_0x79ef('0x2e')](function(_0x18c17e){_0x4da035=0x1f4;logger[_0x79ef('0x2b')](_0x18c17e[_0x79ef('0x40')]);if(_0x18c17e[_0x79ef('0x41')]){delete _0x18c17e[_0x79ef('0x41')];}_0x36d094=_0x18c17e;})[_0x79ef('0xc1')](function(){if(_0x36d094===null){_0x24c084['sendStatus'](_0x4da035);}else{if(_0x4da035===0x1f4){_0x24c084[_0x79ef('0x30')](_0x4da035)[_0x79ef('0x42')](_0x36d094);}else{_0x24c084[_0x79ef('0x30')](_0x4da035)['json'](_0x36d094);}}});};exports[_0x79ef('0xc2')]=function(_0x219192,_0x40c406,_0x33100f){var _0x187eeb={};var _0x3ac3c6={};var _0x5a33d6;var _0x3371c8;return db[_0x79ef('0x47')][_0x79ef('0x6d')]({'where':{'id':_0x219192[_0x79ef('0x60')]['id']}})[_0x79ef('0x3b')](handleEntityNotFound(_0x40c406,null))['then'](function(_0xac269e){if(_0xac269e){_0x5a33d6=_0xac269e;_0x3ac3c6[_0x79ef('0x4c')]=_['keys'](db[_0x79ef('0xc0')][_0x79ef('0x48')]);_0x3ac3c6[_0x79ef('0x4d')]=_[_0x79ef('0x4e')](_0x219192['query']);_0x3ac3c6[_0x79ef('0x4f')]=_[_0x79ef('0x50')](_0x3ac3c6[_0x79ef('0x4c')],_0x3ac3c6['query']);_0x187eeb['attributes']=_['intersection'](_0x3ac3c6[_0x79ef('0x4c')],qs['fields'](_0x219192['query'][_0x79ef('0x52')]));_0x187eeb['attributes']=_0x187eeb[_0x79ef('0x51')][_0x79ef('0x53')]?_0x187eeb[_0x79ef('0x51')]:_0x3ac3c6[_0x79ef('0x4c')];_0x187eeb['order']=qs[_0x79ef('0x56')](_0x219192[_0x79ef('0x4d')][_0x79ef('0x56')]);_0x187eeb[_0x79ef('0x57')]=qs['filters'](_[_0x79ef('0x58')](_0x219192['query'],_0x3ac3c6['filters']));if(_0x219192[_0x79ef('0x4d')][_0x79ef('0x59')]){_0x187eeb['where']=_[_0x79ef('0x5a')](_0x187eeb[_0x79ef('0x57')],{'$or':_['map'](_0x187eeb['attributes'],function(_0x424b2c){var _0x45f420={};_0x45f420[_0x424b2c]={'$like':'%'+_0x219192[_0x79ef('0x4d')][_0x79ef('0x59')]+'%'};return _0x45f420;})});}_0x187eeb=_[_0x79ef('0x5a')]({},_0x187eeb,_0x219192[_0x79ef('0x5b')]);return _0x5a33d6['getApplications'](_0x187eeb);}})[_0x79ef('0x3b')](function(_0x155fd2){if(_0x155fd2){_0x3371c8=_0x155fd2[_0x79ef('0x53')];if(!_0x219192[_0x79ef('0x4d')][_0x79ef('0x54')](_0x79ef('0x6f'))){_0x187eeb[_0x79ef('0x34')]=qs['limit'](_0x219192[_0x79ef('0x4d')]['limit']);_0x187eeb[_0x79ef('0x33')]=qs[_0x79ef('0x33')](_0x219192[_0x79ef('0x4d')][_0x79ef('0x33')]);}return _0x5a33d6[_0x79ef('0xc2')](_0x187eeb);}})['then'](function(_0x47a8e7){if(_0x47a8e7){return _0x47a8e7?{'count':_0x3371c8,'rows':_0x47a8e7}:null;}})['then'](respondWithResult(_0x40c406,null))[_0x79ef('0x2e')](handleError(_0x40c406,null));};exports[_0x79ef('0xc3')]=function(_0x1917c6,_0x3fa345,_0x5137e9){var _0x4abe4e={'raw':![],'where':{}};var _0x528d35={};var _0xfc4300={'count':0x0,'rows':[]};return db[_0x79ef('0x47')][_0x79ef('0x6d')]({'where':{'id':_0x1917c6[_0x79ef('0x60')]['id']}})[_0x79ef('0x3b')](handleEntityNotFound(_0x3fa345,null))[_0x79ef('0x3b')](function(_0x23b9d2){if(_0x23b9d2){_0x528d35[_0x79ef('0x4c')]=_[_0x79ef('0x4e')](db[_0x79ef('0xa4')][_0x79ef('0x48')]);_0x528d35[_0x79ef('0x4d')]=_[_0x79ef('0x4e')](_0x1917c6[_0x79ef('0x4d')]);_0x528d35[_0x79ef('0x4f')]=_[_0x79ef('0x50')](_0x528d35['model'],_0x528d35[_0x79ef('0x4d')]);_0x4abe4e[_0x79ef('0x51')]=_[_0x79ef('0x50')](_0x528d35[_0x79ef('0x4c')],qs['fields'](_0x1917c6[_0x79ef('0x4d')][_0x79ef('0x52')]));_0x4abe4e[_0x79ef('0x51')]=_0x4abe4e[_0x79ef('0x51')]['length']?_0x4abe4e['attributes']:_0x528d35[_0x79ef('0x4c')];if(!_0x1917c6[_0x79ef('0x4d')][_0x79ef('0x54')]('nolimit')){_0x4abe4e[_0x79ef('0x34')]=qs[_0x79ef('0x34')](_0x1917c6[_0x79ef('0x4d')][_0x79ef('0x34')]);_0x4abe4e['offset']=qs[_0x79ef('0x33')](_0x1917c6['query'][_0x79ef('0x33')]);}_0x4abe4e[_0x79ef('0x55')]=qs[_0x79ef('0x56')](_0x1917c6[_0x79ef('0x4d')][_0x79ef('0x56')]);_0x4abe4e[_0x79ef('0x57')]=qs['filters'](_['pick'](_0x1917c6[_0x79ef('0x4d')],_0x528d35[_0x79ef('0x4f')]));_0x4abe4e[_0x79ef('0x57')]['SmsAccountId']=_0x23b9d2['id'];if(_0x1917c6[_0x79ef('0x4d')][_0x79ef('0x59')]){_0x4abe4e['where']=_[_0x79ef('0x5a')](_0x4abe4e[_0x79ef('0x57')],{'$or':_['map'](_0x4abe4e[_0x79ef('0x51')],function(_0x25986d){var _0x5349dd={};_0x5349dd[_0x25986d]={'$like':'%'+_0x1917c6['query']['filter']+'%'};return _0x5349dd;})});}_0x4abe4e=_[_0x79ef('0x5a')]({},_0x4abe4e,_0x1917c6[_0x79ef('0x5b')]);return db[_0x79ef('0xa4')]['count']({'where':_0x4abe4e[_0x79ef('0x57')]})[_0x79ef('0x3b')](function(_0x3760ab){_0xfc4300[_0x79ef('0x35')]=_0x3760ab;if(_0x1917c6['query'][_0x79ef('0x70')]){_0x4abe4e[_0x79ef('0x5c')]=[{'model':db[_0x79ef('0x9e')],'as':_0x79ef('0xc4'),'required':![]},{'model':db[_0x79ef('0xc5')],'as':_0x79ef('0xc6'),'attributes':[_0x79ef('0x41'),'fullname',_0x79ef('0xc7')],'required':![]},{'model':db[_0x79ef('0xc8')],'as':_0x79ef('0xc9'),'attributes':['id',_0x79ef('0x41'),_0x79ef('0xca')],'where':_0x1917c6['query'][_0x79ef('0xcb')]?{'id':_0x1917c6['query'][_0x79ef('0xcb')]}:undefined,'required':_0x1917c6[_0x79ef('0x4d')]['tag']?!![]:![]}];}return db['SmsInteraction']['findAll'](_0x4abe4e);})['then'](function(_0x2d2608){_0xfc4300[_0x79ef('0x5e')]=_0x2d2608;return _0xfc4300;});}})[_0x79ef('0x3b')](respondWithFilteredResult(_0x3fa345,_0x4abe4e))['catch'](handleError(_0x3fa345,null));};exports[_0x79ef('0x42')]=function(_0x57bf73,_0x14903b,_0xd668b0){var _0x277af6,_0x17e91,_0x234f06;if(_[_0x79ef('0x98')](_0x57bf73[_0x79ef('0x63')][_0x79ef('0x63')])||_0x57bf73[_0x79ef('0x63')][_0x79ef('0x63')]===''){throw new db[(_0x79ef('0x99'))][(_0x79ef('0x7d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x57bf73[_0x79ef('0x63')]['to'])){throw new db['Sequelize'][(_0x79ef('0x7d'))](_0x79ef('0xcc'));}_0x277af6=_0x57bf73['body']['to'];return db[_0x79ef('0x47')][_0x79ef('0x61')]({'where':{'id':_0x57bf73[_0x79ef('0x60')]['id']},'include':[{'model':db[_0x79ef('0x9d')],'as':'List','include':[{'model':db['CmContact'],'as':_0x79ef('0xa2'),'where':{'mobile':_0x277af6},'limit':0x1,'order':[[_0x79ef('0x81'),'DESC']]}]}]})[_0x79ef('0x3b')](handleEntityNotFound(_0x14903b,null))[_0x79ef('0x3b')](function(_0xa96944){if(_0xa96944&&_0xa96944[_0x79ef('0xcd')]){_0x17e91=_0xa96944[_0x79ef('0x3d')]({'plain':!![]});if(_0x17e91[_0x79ef('0xcd')]&&_0x17e91['List']['Contacts'][_0x79ef('0x53')]){return _0x17e91[_0x79ef('0xcd')][_0x79ef('0xa2')][0x0];}return db[_0x79ef('0x9e')][_0x79ef('0x62')](_[_0x79ef('0x1b')](_0x57bf73[_0x79ef('0x63')],{'firstName':_0x277af6,'mobile':_0x277af6,'phone':_0x277af6,'ListId':_0x17e91[_0x79ef('0x83')]}));}})[_0x79ef('0x3b')](handleEntityNotFound(_0x14903b,null))[_0x79ef('0x3b')](function(_0x5e7f07){if(_0x5e7f07){_0x234f06=_0x5e7f07;return db[_0x79ef('0xa4')][_0x79ef('0x61')]({'where':{'ContactId':_0x234f06['id'],'closed':![],'SmsAccountId':_0x17e91['id']}})[_0x79ef('0x3b')](function(_0x4d49b0){if(_0x4d49b0){return[_0x4d49b0,![]];}return db[_0x79ef('0xa4')]['create']({'UserId':_0x57bf73['user']['id'],'ContactId':_0x234f06['id'],'SmsAccountId':_0x17e91['id'],'phone':_0x277af6,'firstMsgDirection':'out','Messages':[_[_0x79ef('0x5a')](_0x57bf73[_0x79ef('0x63')],{'read':![],'body':_0x57bf73[_0x79ef('0x63')][_0x79ef('0x63')],'phone':_0x277af6,'SmsAccountId':_0x17e91['id'],'UserId':_0x57bf73[_0x79ef('0x64')]['id'],'ContactId':_0x234f06['id']})]},{'include':[{'model':db[_0x79ef('0xce')],'as':_0x79ef('0xcf')}]})[_0x79ef('0x3b')](function(_0xf2b3bc){return[_0xf2b3bc,!![]];});});}})[_0x79ef('0xa5')](function(_0x5b40bb,_0x249b10){if(_0x249b10){return _0x5b40bb;}return db[_0x79ef('0xce')][_0x79ef('0x62')](_['merge'](_0x57bf73[_0x79ef('0x63')],{'read':![],'body':_0x57bf73[_0x79ef('0x63')]['body'],'phone':_0x277af6,'SmsAccountId':_0x17e91['id'],'SmsInteractionId':_0x5b40bb['id'],'UserId':_0x57bf73[_0x79ef('0x64')]['id'],'ContactId':_0x234f06['id']}))[_0x79ef('0x3b')](function(_0x189bb3){_0x5b40bb[_0x79ef('0xd0')]['Messages']=[];_0x5b40bb[_0x79ef('0xd0')][_0x79ef('0xcf')][_0x79ef('0xa9')](_0x189bb3[_0x79ef('0xd0')]);return _0x5b40bb;});})['then'](respondWithResult(_0x14903b,null))[_0x79ef('0x2e')](handleError(_0x14903b,null));};exports[_0x79ef('0x30')]=function(_0x528249,_0x5d18f2,_0x35cc96){if(_0x528249['body']['id']){delete _0x528249[_0x79ef('0x63')]['id'];}var _0x20bfb6,_0x179176,_0x2aba12;return db['SmsAccount'][_0x79ef('0x61')]({'where':{'id':_0x528249[_0x79ef('0x60')]['id']}})['then'](handleEntityNotFound(_0x5d18f2,null))['then'](function(_0x572029){if(_0x572029){_0x2aba12=_0x572029;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x79ef('0x30'),'received\x20delivery\x20report\x20from',_0x572029[_0x79ef('0x4a')],util['inspect'](_0x528249[_0x79ef('0x63')],{'showHidden':![],'depth':null}));switch(_0x572029[_0x79ef('0x4a')]){case _0x79ef('0xd1'):if(_0x528249[_0x79ef('0x63')]['skebby_dispatch_id']&&_0x528249[_0x79ef('0x63')][_0x79ef('0x30')]){_0x179176=_0x528249[_0x79ef('0x63')][_0x79ef('0x30')];return db[_0x79ef('0xce')][_0x79ef('0x61')]({'where':{'messageId':_0x528249[_0x79ef('0x63')][_0x79ef('0xd2')]}});}break;case'connectel':if(_0x528249[_0x79ef('0x63')][_0x79ef('0xd3')]&&_0x528249[_0x79ef('0x63')][_0x79ef('0xd4')]){_0x179176=_0x528249['body'][_0x79ef('0xd4')];return db[_0x79ef('0xce')][_0x79ef('0x61')]({'where':{'messageId':_0x528249[_0x79ef('0x63')]['requestid']}});}break;case _0x79ef('0x8b'):if(_0x528249[_0x79ef('0x63')][_0x79ef('0x8c')]&&_0x528249[_0x79ef('0x63')][_0x79ef('0xd5')]){_0x179176=_0x528249[_0x79ef('0x63')][_0x79ef('0xd5')];return db[_0x79ef('0xce')][_0x79ef('0x61')]({'where':{'messageId':_0x528249[_0x79ef('0x63')]['message_id']}});}break;case _0x79ef('0x8f'):var _0x15a2f5=_0x528249['body'][_0x79ef('0x90')][0x0];if(_0x15a2f5[_0x79ef('0x88')]&&_0x15a2f5['status'][_0x79ef('0xd6')]==='DELIVERED'){_0x179176=_0x15a2f5[_0x79ef('0x30')][_0x79ef('0xd6')];return db[_0x79ef('0xce')]['find']({'where':{'messageId':_0x15a2f5[_0x79ef('0x88')]}});}break;case _0x79ef('0x95'):if(_0x528249[_0x79ef('0x63')][_0x79ef('0x88')]&&_0x528249['body']['status']){_0x179176=_0x528249[_0x79ef('0x63')]['status'];return db[_0x79ef('0xce')][_0x79ef('0x61')]({'where':{'messageId':_0x528249['body'][_0x79ef('0x88')]}});}break;case _0x79ef('0xd7'):if(_0x528249[_0x79ef('0x63')][0x0][_0x79ef('0x2c')]['id']){_0x179176=_0x528249[_0x79ef('0x63')][0x0][_0x79ef('0x4a')];return db[_0x79ef('0xce')][_0x79ef('0x61')]({'where':{'messageId':_0x528249[_0x79ef('0x63')][0x0][_0x79ef('0x2c')]['id']}});}break;case _0x79ef('0x96'):if(_0x528249['body']['redif']&&_0x528249[_0x79ef('0x63')][_0x79ef('0x30')]){_0x179176=_0x528249[_0x79ef('0x63')][_0x79ef('0x30')];return db[_0x79ef('0xce')][_0x79ef('0x61')]({'where':{'messageId':_0x528249['body'][_0x79ef('0xd8')]}});}break;}}})[_0x79ef('0x3b')](handleEntityNotFound(_0x5d18f2,null))['then'](function(_0x2b789d){if(_0x2b789d){_0x20bfb6=_0x2b789d;switch(_0x2aba12[_0x79ef('0x4a')]){case _0x79ef('0xd1'):if(_0x179176===_0x79ef('0xd9')){return _0x20bfb6[_0x79ef('0x3a')]({'read':!![]});}else{logger[_0x79ef('0x2b')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x79ef('0xd1'),util['inspect'](_0x528249[_0x79ef('0x63')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x179176==='1'){return _0x20bfb6['update']({'read':!![]});}else{logger[_0x79ef('0x2b')](_0x79ef('0x26'),'status',_0x79ef('0xd1'),util['inspect'](_0x528249[_0x79ef('0x63')],{'showHidden':![],'depth':null}));}break;case _0x79ef('0x8b'):if(!_0x528249[_0x79ef('0x63')][_0x79ef('0xda')]&&_0x179176>=0xc8&&_0x179176<=0xce){return _0x20bfb6['update']({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status','clicksend',util[_0x79ef('0xdb')](_0x528249[_0x79ef('0x63')],{'showHidden':![],'depth':null}));}break;case _0x79ef('0x8f'):var _0x44ad9a=_0x528249['body'][_0x79ef('0x90')][0x0];if(_0x44ad9a['status'][_0x79ef('0xd6')]===_0x79ef('0xd9')){return _0x20bfb6[_0x79ef('0x3a')]({'read':!![]});}else{logger['error'](_0x79ef('0x26'),_0x79ef('0x30'),_0x79ef('0x8f'),util[_0x79ef('0xdb')](_0x528249[_0x79ef('0x63')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x179176==_0x79ef('0xdc')||_0x179176==_0x79ef('0xdd')){return _0x20bfb6['update']({'read':!![]});}else{logger[_0x79ef('0x2b')](_0x79ef('0x26'),_0x79ef('0x30'),_0x79ef('0x95'),util[_0x79ef('0xdb')](_0x528249[_0x79ef('0x63')],{'showHidden':![],'depth':null}));}break;case _0x79ef('0xd7'):if(_0x179176=='message-delivered'){return _0x20bfb6[_0x79ef('0x3a')]({'read':!![]});}else{logger[_0x79ef('0x2b')](_0x79ef('0x26'),'status',_0x79ef('0xd7'),util[_0x79ef('0xdb')](_0x528249[_0x79ef('0x63')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x179176===_0x79ef('0xde')||_0x179176===_0x79ef('0xdf')){return _0x20bfb6[_0x79ef('0x3a')]({'read':!![]});}else{logger[_0x79ef('0x2b')](_0x79ef('0x26'),_0x79ef('0x30'),_0x79ef('0x96'),util['inspect'](_0x528249[_0x79ef('0x63')],{'showHidden':![],'depth':null}));}break;}return _0x20bfb6;}})[_0x79ef('0x3b')](respondWithResult(_0x5d18f2,null))[_0x79ef('0x2e')](handleError(_0x5d18f2,null));};exports[_0x79ef('0xe0')]=function(_0x49f2e7,_0x3e0794,_0x3406fa){var _0x28f646,_0x4d6865,_0x4949a4;return db['SmsAccount'][_0x79ef('0x61')]({'where':{'id':_0x49f2e7[_0x79ef('0x60')]['id']}})['then'](handleEntityNotFound(_0x3e0794,null))[_0x79ef('0x3b')](function(_0x8f11c8){if(_0x8f11c8){_0x4949a4=_0x8f11c8;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x79ef('0x30'),'received\x20delivery\x20report\x20from',_0x8f11c8[_0x79ef('0x4a')],util[_0x79ef('0xdb')](_0x49f2e7[_0x79ef('0x4d')],{'showHidden':![],'depth':null}));switch(_0x8f11c8[_0x79ef('0x4a')]){case _0x79ef('0x92'):if(_0x49f2e7[_0x79ef('0x4d')][_0x79ef('0xe1')]&&_0x49f2e7[_0x79ef('0x4d')][_0x79ef('0xe2')]){_0x4d6865=_0x49f2e7[_0x79ef('0x4d')]['state'];return db[_0x79ef('0xce')][_0x79ef('0x61')]({'where':{'messageId':_0x49f2e7['query'][_0x79ef('0xe1')]}});}break;}}})['then'](handleEntityNotFound(_0x3e0794,null))[_0x79ef('0x3b')](function(_0x3c508d){if(_0x3c508d){_0x28f646=_0x3c508d;switch(_0x4949a4[_0x79ef('0x4a')]){case'csc':if(_0x4d6865==='2'||_0x4d6865==='6'){return _0x28f646['update']({'read':!![]});}else{logger[_0x79ef('0x2b')](_0x79ef('0x26'),_0x79ef('0x30'),_0x79ef('0x92'),util[_0x79ef('0xdb')](_0x49f2e7[_0x79ef('0x4d')],{'showHidden':![],'depth':null}));};break;}return _0x28f646;}})[_0x79ef('0x3b')](respondWithResult(_0x3e0794,null))[_0x79ef('0x2e')](handleError(_0x3e0794,null));};exports[_0x79ef('0xe3')]=function(_0x5c6d2f,_0x8ec40f,_0x2d54a5){return db[_0x79ef('0x47')][_0x79ef('0x61')]({'where':{'id':_0x5c6d2f[_0x79ef('0x60')]['id']}})[_0x79ef('0x3b')](handleEntityNotFound(_0x8ec40f,null))[_0x79ef('0x3b')](function(_0x362970){if(_0x362970){return _0x362970['addAgents'](_0x5c6d2f[_0x79ef('0x63')][_0x79ef('0x72')],_[_0x79ef('0xa1')](_0x5c6d2f[_0x79ef('0x63')],['ids','id'])||{})[_0x79ef('0xa5')](function(_0x1ce785){for(var _0x3101ac=0x0;_0x3101ac<_0x5c6d2f[_0x79ef('0x63')][_0x79ef('0x72')][_0x79ef('0x53')];_0x3101ac+=0x1){socket['emit'](_0x79ef('0xe4'),{'UserId':Number(_0x5c6d2f[_0x79ef('0x63')][_0x79ef('0x72')][_0x3101ac]),'SmsAccountId':Number(_0x5c6d2f[_0x79ef('0x60')]['id'])});}return _0x1ce785;});}})['then'](respondWithResult(_0x8ec40f,null))['catch'](handleError(_0x8ec40f,null));};exports[_0x79ef('0xe5')]=function(_0x21f3ee,_0x361b76,_0x581335){return db[_0x79ef('0x47')][_0x79ef('0x61')]({'where':{'id':_0x21f3ee[_0x79ef('0x60')]['id']}})[_0x79ef('0x3b')](handleEntityNotFound(_0x361b76,null))[_0x79ef('0x3b')](function(_0x1bed54){if(_0x1bed54){return _0x1bed54['removeAgents'](_0x21f3ee[_0x79ef('0x4d')][_0x79ef('0x72')])[_0x79ef('0x3b')](function(){if(_[_0x79ef('0xe6')](_0x21f3ee[_0x79ef('0x4d')]['ids'])){for(var _0x32c14f=0x0;_0x32c14f<_0x21f3ee[_0x79ef('0x4d')][_0x79ef('0x72')][_0x79ef('0x53')];_0x32c14f+=0x1){socket[_0x79ef('0xe7')](_0x79ef('0xe8'),{'UserId':Number(_0x21f3ee[_0x79ef('0x4d')]['ids'][_0x32c14f]),'SmsAccountId':Number(_0x21f3ee[_0x79ef('0x60')]['id'])});}}else{socket[_0x79ef('0xe7')](_0x79ef('0xe8'),{'UserId':Number(_0x21f3ee['query'][_0x79ef('0x72')]),'SmsAccountId':Number(_0x21f3ee['params']['id'])});}});}})[_0x79ef('0x3b')](respondWithStatusCode(_0x361b76,null))[_0x79ef('0x2e')](handleError(_0x361b76,null));};exports[_0x79ef('0xe9')]=function(_0x17fefd,_0x402039,_0x2dc3c7){var _0x226ac2={};var _0x450604={};var _0x172107;var _0x5ad092;return db[_0x79ef('0x47')][_0x79ef('0x6d')]({'where':{'id':_0x17fefd[_0x79ef('0x60')]['id']}})[_0x79ef('0x3b')](handleEntityNotFound(_0x402039,null))[_0x79ef('0x3b')](function(_0x5dfa5c){if(_0x5dfa5c){_0x172107=_0x5dfa5c;_0x450604[_0x79ef('0x4c')]=_['keys'](db[_0x79ef('0xc5')]['rawAttributes']);_0x450604[_0x79ef('0x4d')]=_['keys'](_0x17fefd[_0x79ef('0x4d')]);_0x450604[_0x79ef('0x4f')]=_['intersection'](_0x450604[_0x79ef('0x4c')],_0x450604[_0x79ef('0x4d')]);_0x226ac2[_0x79ef('0x51')]=_[_0x79ef('0x50')](_0x450604[_0x79ef('0x4c')],qs[_0x79ef('0x52')](_0x17fefd[_0x79ef('0x4d')][_0x79ef('0x52')]));_0x226ac2[_0x79ef('0x51')]=_0x226ac2[_0x79ef('0x51')]['length']?_0x226ac2[_0x79ef('0x51')]:_0x450604['model'];_0x226ac2[_0x79ef('0x55')]=qs[_0x79ef('0x56')](_0x17fefd[_0x79ef('0x4d')]['sort']);_0x226ac2[_0x79ef('0x57')]=qs[_0x79ef('0x4f')](_['pick'](_0x17fefd['query'],_0x450604['filters']));if(_0x17fefd[_0x79ef('0x4d')][_0x79ef('0x59')]){_0x226ac2['where']=_[_0x79ef('0x5a')](_0x226ac2['where'],{'$or':_[_0x79ef('0x46')](_0x226ac2[_0x79ef('0x51')],function(_0x12f767){var _0x44b1d8={};_0x44b1d8[_0x12f767]={'$like':'%'+_0x17fefd[_0x79ef('0x4d')][_0x79ef('0x59')]+'%'};return _0x44b1d8;})});}_0x226ac2=_[_0x79ef('0x5a')]({},_0x226ac2,_0x17fefd[_0x79ef('0x5b')]);return _0x172107[_0x79ef('0xe9')](_0x226ac2);}})['then'](function(_0x2ab492){if(_0x2ab492){_0x5ad092=_0x2ab492[_0x79ef('0x53')];if(!_0x17fefd['query'][_0x79ef('0x54')](_0x79ef('0x6f'))){_0x226ac2[_0x79ef('0x34')]=qs[_0x79ef('0x34')](_0x17fefd['query'][_0x79ef('0x34')]);_0x226ac2[_0x79ef('0x33')]=qs[_0x79ef('0x33')](_0x17fefd[_0x79ef('0x4d')]['offset']);}return _0x172107['getAgents'](_0x226ac2);}})[_0x79ef('0x3b')](function(_0x48d391){if(_0x48d391){return _0x48d391?{'count':_0x5ad092,'rows':_0x48d391}:null;}})[_0x79ef('0x3b')](respondWithResult(_0x402039,null))[_0x79ef('0x2e')](handleError(_0x402039,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 2b684fa..86c831c 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 _0xa43d=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','SmsAccount','setMaxListeners'];(function(_0x546aaf,_0x1ed138){var _0x1cbf6d=function(_0x36c837){while(--_0x36c837){_0x546aaf['push'](_0x546aaf['shift']());}};_0x1cbf6d(++_0x1ed138);}(_0xa43d,0xb5));var _0xda43=function(_0x4c67b8,_0x571e13){_0x4c67b8=_0x4c67b8-0x0;var _0xbc26e=_0xa43d[_0x4c67b8];return _0xbc26e;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xda43('0x0'))['db'][_0xda43('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xda43('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xda43('0x3')};function emitEvent(_0x994e7d){return function(_0x11385d,_0x27d2ab,_0x22f063){SmsAccountEvents[_0xda43('0x4')](_0x994e7d+':'+_0x11385d['id'],_0x11385d);SmsAccountEvents[_0xda43('0x4')](_0x994e7d,_0x11385d);_0x22f063(null);};}for(var e in events){if(events[_0xda43('0x5')](e)){var event=events[e];SmsAccount[_0xda43('0x6')](e,emitEvent(event));}}module[_0xda43('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0xa00f=['save','update','remove','emit','hasOwnProperty','events','SmsAccount'];(function(_0x284239,_0x232a4e){var _0x2d06cb=function(_0x508508){while(--_0x508508){_0x284239['push'](_0x284239['shift']());}};_0x2d06cb(++_0x232a4e);}(_0xa00f,0x8a));var _0xfa00=function(_0xeb34fa,_0x45020e){_0xeb34fa=_0xeb34fa-0x0;var _0xde69e5=_0xa00f[_0xeb34fa];return _0xde69e5;};'use strict';var EventEmitter=require(_0xfa00('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0xfa00('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfa00('0x2'),'afterUpdate':_0xfa00('0x3'),'afterDestroy':_0xfa00('0x4')};function emitEvent(_0x180608){return function(_0x41cd73,_0x5330d1,_0x4f597c){SmsAccountEvents[_0xfa00('0x5')](_0x180608+':'+_0x41cd73['id'],_0x41cd73);SmsAccountEvents[_0xfa00('0x5')](_0x180608,_0x41cd73);_0x4f597c(null);};}for(var e in events){if(events[_0xfa00('0x6')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 0a2fe9e..f07e464 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 _0xd44f=['../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x1d3c43,_0x1a6225){var _0x4791d3=function(_0x3ba0d4){while(--_0x3ba0d4){_0x1d3c43['push'](_0x1d3c43['shift']());}};_0x4791d3(++_0x1a6225);}(_0xd44f,0x18c));var _0xfd44=function(_0x1d2d4c,_0x340107){_0x1d2d4c=_0x1d2d4c-0x0;var _0x58ed56=_0xd44f[_0x1d2d4c];return _0x58ed56;};'use strict';var _=require(_0xfd44('0x0'));var util=require(_0xfd44('0x1'));var logger=require('../../config/logger')(_0xfd44('0x2'));var moment=require(_0xfd44('0x3'));var BPromise=require(_0xfd44('0x4'));var rp=require(_0xfd44('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfd44('0x6'));var config=require(_0xfd44('0x7'));var attributes=require(_0xfd44('0x8'));module[_0xfd44('0x9')]=function(_0x1c126a,_0x5dff8a){return _0x1c126a[_0xfd44('0xa')](_0xfd44('0xb'),attributes,{'tableName':_0xfd44('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c26=['exports','define','SmsAccount','sms_accounts','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes'];(function(_0x3841a7,_0x3c91fb){var _0x56fda8=function(_0x30ea35){while(--_0x30ea35){_0x3841a7['push'](_0x3841a7['shift']());}};_0x56fda8(++_0x3c91fb);}(_0x3c26,0x122));var _0x63c2=function(_0x5b5a01,_0xb8e4){_0x5b5a01=_0x5b5a01-0x0;var _0x2c2951=_0x3c26[_0x5b5a01];return _0x2c2951;};'use strict';var _=require('lodash');var util=require(_0x63c2('0x0'));var logger=require(_0x63c2('0x1'))(_0x63c2('0x2'));var moment=require('moment');var BPromise=require(_0x63c2('0x3'));var rp=require(_0x63c2('0x4'));var fs=require('fs');var path=require(_0x63c2('0x5'));var rimraf=require(_0x63c2('0x6'));var config=require(_0x63c2('0x7'));var attributes=require(_0x63c2('0x8'));module[_0x63c2('0x9')]=function(_0x161ca5,_0x2e6fdb){return _0x161ca5[_0x63c2('0xa')](_0x63c2('0xb'),attributes,{'tableName':_0x63c2('0xc'),'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 b9c987c..83fbd7d 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 _0x81ea=['request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','options','raw','attributes','map','include','model','ShowSmsAccount','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','./smsAccount.socket','register'];(function(_0x1a2d42,_0x3ba183){var _0x5429ff=function(_0x4afede){while(--_0x4afede){_0x1a2d42['push'](_0x1a2d42['shift']());}};_0x5429ff(++_0x3ba183);}(_0x81ea,0x17c));var _0xa81e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x81ea[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xa81e('0x0'));var util=require('util');var moment=require(_0xa81e('0x1'));var BPromise=require(_0xa81e('0x2'));var rs=require(_0xa81e('0x3'));var fs=require('fs');var Redis=require(_0xa81e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa81e('0x5'));var logger=require(_0xa81e('0x6'))(_0xa81e('0x7'));var config=require(_0xa81e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa81e('0x9')][_0xa81e('0xa')]({'port':0x232a});config['redis']=_[_0xa81e('0xb')](config[_0xa81e('0xc')],{'host':_0xa81e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa81e('0xc')]));require(_0xa81e('0xe'))[_0xa81e('0xf')](socket);function respondWithRpcPromise(_0x5590af,_0x5d74ba,_0xddf692){return new BPromise(function(_0x4f6f80,_0x2fba28){return client[_0xa81e('0x10')](_0x5590af,_0xddf692)[_0xa81e('0x11')](function(_0x58b517){logger[_0xa81e('0x12')](_0xa81e('0x13'),_0x5d74ba,_0xa81e('0x14'));logger[_0xa81e('0x15')](_0xa81e('0x16'),_0x5d74ba,_0xa81e('0x14'),JSON[_0xa81e('0x17')](_0x58b517));if(_0x58b517['error']){if(_0x58b517[_0xa81e('0x18')][_0xa81e('0x19')]===0x1f4){logger[_0xa81e('0x18')]('SmsAccount,\x20%s,\x20%s',_0x5d74ba,_0x58b517[_0xa81e('0x18')]['message']);return _0x2fba28(_0x58b517[_0xa81e('0x18')][_0xa81e('0x1a')]);}logger[_0xa81e('0x18')](_0xa81e('0x13'),_0x5d74ba,_0x58b517['error']['message']);return _0x4f6f80(_0x58b517[_0xa81e('0x18')][_0xa81e('0x1a')]);}else{logger[_0xa81e('0x12')]('SmsAccount,\x20%s,\x20%s',_0x5d74ba,_0xa81e('0x14'));_0x4f6f80(_0x58b517[_0xa81e('0x1b')][_0xa81e('0x1a')]);}})['catch'](function(_0xf01a5f){logger[_0xa81e('0x18')](_0xa81e('0x13'),_0x5d74ba,_0xf01a5f);_0x2fba28(_0xf01a5f);});});}exports['ShowSmsAccount']=function(_0x28e11c){var _0x189d7c=this;return new Promise(function(_0x21cbd4,_0x12963c){return db['SmsAccount']['find']({'raw':_0x28e11c[_0xa81e('0x1c')]?_0x28e11c[_0xa81e('0x1c')][_0xa81e('0x1d')]===undefined?!![]:![]:!![],'where':_0x28e11c[_0xa81e('0x1c')]?_0x28e11c[_0xa81e('0x1c')]['where']||null:null,'attributes':_0x28e11c[_0xa81e('0x1c')]?_0x28e11c[_0xa81e('0x1c')][_0xa81e('0x1e')]||null:null,'include':_0x28e11c['options']?_0x28e11c[_0xa81e('0x1c')]['include']?_[_0xa81e('0x1f')](_0x28e11c['options'][_0xa81e('0x20')],function(_0x51caaf){return{'model':db[_0x51caaf[_0xa81e('0x21')]],'as':_0x51caaf['as'],'attributes':_0x51caaf[_0xa81e('0x1e')],'include':_0x51caaf[_0xa81e('0x20')]?_[_0xa81e('0x1f')](_0x51caaf[_0xa81e('0x20')],function(_0xd47887){return{'model':db[_0xd47887[_0xa81e('0x21')]],'as':_0xd47887['as'],'attributes':_0xd47887[_0xa81e('0x1e')],'include':_0xd47887[_0xa81e('0x20')]?_[_0xa81e('0x1f')](_0xd47887['include'],function(_0x58991c){return{'model':db[_0x58991c[_0xa81e('0x21')]],'as':_0x58991c['as'],'attributes':_0x58991c[_0xa81e('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa81e('0x11')](function(_0x2f88f7){logger[_0xa81e('0x12')](_0xa81e('0x22'),_0x28e11c);logger[_0xa81e('0x15')](_0xa81e('0x22'),_0x28e11c,JSON['stringify'](_0x2f88f7));_0x21cbd4(_0x2f88f7);})[_0xa81e('0x23')](function(_0x3c8e64){logger['error'](_0xa81e('0x22'),_0x3c8e64[_0xa81e('0x1a')],_0x28e11c);_0x12963c(_0x189d7c[_0xa81e('0x18')](0x1f4,_0x3c8e64[_0xa81e('0x1a')]));});});}; \ No newline at end of file +var _0x5197=['stringify','error','code','message','result','SmsAccount','find','options','raw','include','map','model','attributes','ShowSmsAccount','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','defaults','redis','socket.io-emitter','./smsAccount.socket','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4c68e3,_0x429630){var _0x4094b1=function(_0xba0771){while(--_0xba0771){_0x4c68e3['push'](_0x4c68e3['shift']());}};_0x4094b1(++_0x429630);}(_0x5197,0x1c9));var _0x7519=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x5197[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0x7519('0x0'));var util=require(_0x7519('0x1'));var moment=require('moment');var BPromise=require(_0x7519('0x2'));var rs=require(_0x7519('0x3'));var fs=require('fs');var Redis=require(_0x7519('0x4'));var db=require(_0x7519('0x5'))['db'];var utils=require(_0x7519('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7519('0x7'));var client=jayson['client'][_0x7519('0x8')]({'port':0x232a});config['redis']=_[_0x7519('0x9')](config[_0x7519('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x7519('0xb'))(new Redis(config[_0x7519('0xa')]));require(_0x7519('0xc'))['register'](socket);function respondWithRpcPromise(_0x493632,_0x1cb715,_0x3ae402){return new BPromise(function(_0x331a4a,_0x30137f){return client[_0x7519('0xd')](_0x493632,_0x3ae402)[_0x7519('0xe')](function(_0x558928){logger[_0x7519('0xf')](_0x7519('0x10'),_0x1cb715,_0x7519('0x11'));logger[_0x7519('0x12')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1cb715,_0x7519('0x11'),JSON[_0x7519('0x13')](_0x558928));if(_0x558928['error']){if(_0x558928[_0x7519('0x14')][_0x7519('0x15')]===0x1f4){logger['error'](_0x7519('0x10'),_0x1cb715,_0x558928[_0x7519('0x14')][_0x7519('0x16')]);return _0x30137f(_0x558928[_0x7519('0x14')][_0x7519('0x16')]);}logger[_0x7519('0x14')]('SmsAccount,\x20%s,\x20%s',_0x1cb715,_0x558928['error'][_0x7519('0x16')]);return _0x331a4a(_0x558928['error'][_0x7519('0x16')]);}else{logger[_0x7519('0xf')](_0x7519('0x10'),_0x1cb715,_0x7519('0x11'));_0x331a4a(_0x558928[_0x7519('0x17')][_0x7519('0x16')]);}})['catch'](function(_0x392aea){logger[_0x7519('0x14')]('SmsAccount,\x20%s,\x20%s',_0x1cb715,_0x392aea);_0x30137f(_0x392aea);});});}exports['ShowSmsAccount']=function(_0x47472e){var _0x5d9448=this;return new Promise(function(_0x3fd2e9,_0x197d4e){return db[_0x7519('0x18')][_0x7519('0x19')]({'raw':_0x47472e[_0x7519('0x1a')]?_0x47472e[_0x7519('0x1a')][_0x7519('0x1b')]===undefined?!![]:![]:!![],'where':_0x47472e[_0x7519('0x1a')]?_0x47472e[_0x7519('0x1a')]['where']||null:null,'attributes':_0x47472e[_0x7519('0x1a')]?_0x47472e[_0x7519('0x1a')]['attributes']||null:null,'include':_0x47472e[_0x7519('0x1a')]?_0x47472e[_0x7519('0x1a')][_0x7519('0x1c')]?_[_0x7519('0x1d')](_0x47472e[_0x7519('0x1a')][_0x7519('0x1c')],function(_0x4bf278){return{'model':db[_0x4bf278[_0x7519('0x1e')]],'as':_0x4bf278['as'],'attributes':_0x4bf278[_0x7519('0x1f')],'include':_0x4bf278[_0x7519('0x1c')]?_[_0x7519('0x1d')](_0x4bf278[_0x7519('0x1c')],function(_0x37bc23){return{'model':db[_0x37bc23[_0x7519('0x1e')]],'as':_0x37bc23['as'],'attributes':_0x37bc23[_0x7519('0x1f')],'include':_0x37bc23[_0x7519('0x1c')]?_[_0x7519('0x1d')](_0x37bc23[_0x7519('0x1c')],function(_0x469b7a){return{'model':db[_0x469b7a[_0x7519('0x1e')]],'as':_0x469b7a['as'],'attributes':_0x469b7a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7519('0xe')](function(_0x2dbdd8){logger['info'](_0x7519('0x20'),_0x47472e);logger['debug']('ShowSmsAccount',_0x47472e,JSON[_0x7519('0x13')](_0x2dbdd8));_0x3fd2e9(_0x2dbdd8);})[_0x7519('0x21')](function(_0x124fee){logger[_0x7519('0x14')]('ShowSmsAccount',_0x124fee[_0x7519('0x16')],_0x47472e);_0x197d4e(_0x5d9448[_0x7519('0x14')](0x1f4,_0x124fee[_0x7519('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index beac655..8ec21a4 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xa9e0[_0xf50820];return _0x2a9b10;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 33f099b..2621012 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 _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x5b7d5b,_0x5055d9){var _0x3c9abe=function(_0xc864a2){while(--_0xc864a2){_0x5b7d5b['push'](_0x5b7d5b['shift']());}};_0x3c9abe(++_0x5055d9);}(_0x7217,0x19e));var _0x7721=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x7217[_0x2576d7];return _0x16a08c;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router; \ No newline at end of file +var _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0x37df89,_0x2e44a1){var _0x324202=function(_0x160816){while(--_0x160816){_0x37df89['push'](_0x37df89['shift']());}};_0x324202(++_0x2e44a1);}(_0x55ca,0x126));var _0xa55c=function(_0x242152,_0x2f7b09){_0x242152=_0x242152-0x0;var _0x167a0d=_0x55ca[_0x242152];return _0x167a0d;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 10c1a60..6a77833 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 _0x6ae1=['*,*,*,*','sequelize','exports','STRING','noop','TEXT'];(function(_0x59e1a5,_0x16d072){var _0x57adb4=function(_0x1c631b){while(--_0x1c631b){_0x59e1a5['push'](_0x59e1a5['shift']());}};_0x57adb4(++_0x16d072);}(_0x6ae1,0x10f));var _0x16ae=function(_0x9b5467,_0x1d245e){_0x9b5467=_0x9b5467-0x0;var _0x3e940c=_0x6ae1[_0x9b5467];return _0x3e940c;};'use strict';var Sequelize=require(_0x16ae('0x0'));module[_0x16ae('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x16ae('0x2')],'allowNull':![],'defaultValue':_0x16ae('0x3')},'appdata':{'type':Sequelize[_0x16ae('0x4')]()},'description':{'type':Sequelize[_0x16ae('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x16ae('0x5')}}; \ No newline at end of file +var _0xddb2=['exports','STRING','noop','TEXT','sequelize'];(function(_0x3703eb,_0x1c7cde){var _0x190bdc=function(_0x5246c8){while(--_0x5246c8){_0x3703eb['push'](_0x3703eb['shift']());}};_0x190bdc(++_0x1c7cde);}(_0xddb2,0x1d0));var _0x2ddb=function(_0x3a5a49,_0x55f984){_0x3a5a49=_0x3a5a49-0x0;var _0x4b9a0d=_0xddb2[_0x3a5a49];return _0x4b9a0d;};'use strict';var Sequelize=require(_0x2ddb('0x0'));module[_0x2ddb('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x2ddb('0x2')],'allowNull':![],'defaultValue':_0x2ddb('0x3')},'appdata':{'type':Sequelize[_0x2ddb('0x4')]()},'description':{'type':Sequelize[_0x2ddb('0x2')]},'interval':{'type':Sequelize[_0x2ddb('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 1522c32..34a931e 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 _0xdab1=['show','params','find','create','body','eml-format','rimraf','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','stack','name','send','index','rawAttributes','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','SmsApplication','findAll','rows','catch'];(function(_0x505dd9,_0x227339){var _0x4f2b64=function(_0x1f6ae8){while(--_0x1f6ae8){_0x505dd9['push'](_0x505dd9['shift']());}};_0x4f2b64(++_0x227339);}(_0xdab1,0x1c1));var _0x1dab=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xdab1[_0x39096d];return _0x13da4f;};'use strict';var emlformat=require(_0x1dab('0x0'));var rimraf=require(_0x1dab('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1dab('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1dab('0x3'));var util=require(_0x1dab('0x4'));var path=require(_0x1dab('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1dab('0x6'));var fs=require('fs');var fs_extra=require(_0x1dab('0x7'));var _=require(_0x1dab('0x8'));var squel=require(_0x1dab('0x9'));var crypto=require(_0x1dab('0xa'));var jsforce=require(_0x1dab('0xb'));var deskjs=require(_0x1dab('0xc'));var toCsv=require(_0x1dab('0xd'));var querystring=require('querystring');var Papa=require(_0x1dab('0xe'));var Redis=require(_0x1dab('0xf'));var authService=require(_0x1dab('0x10'));var qs=require(_0x1dab('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1dab('0x12'))(_0x1dab('0x13'));var utils=require(_0x1dab('0x14'));var config=require(_0x1dab('0x15'));var licenseUtil=require(_0x1dab('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4c75ce,_0x4b2a29){_0x4b2a29=_0x4b2a29||0xcc;return function(_0x43d1dd){if(_0x43d1dd){return _0x4c75ce[_0x1dab('0x17')](_0x4b2a29);}return _0x4c75ce[_0x1dab('0x18')](_0x4b2a29)[_0x1dab('0x19')]();};}function respondWithResult(_0x21274c,_0x5efc70){_0x5efc70=_0x5efc70||0xc8;return function(_0x5f318d){if(_0x5f318d){return _0x21274c[_0x1dab('0x18')](_0x5efc70)[_0x1dab('0x1a')](_0x5f318d);}};}function respondWithFilteredResult(_0x438d88,_0x233eb9){return function(_0x51822b){if(_0x51822b){var _0x272c61=typeof _0x233eb9[_0x1dab('0x1b')]===_0x1dab('0x1c')&&typeof _0x233eb9[_0x1dab('0x1d')]===_0x1dab('0x1c');var _0x4f503d=_0x51822b[_0x1dab('0x1e')];var _0x4184b7=_0x272c61?0x0:_0x233eb9[_0x1dab('0x1b')];var _0x4672e9=_0x272c61?_0x51822b[_0x1dab('0x1e')]:_0x233eb9[_0x1dab('0x1b')]+_0x233eb9[_0x1dab('0x1d')];var _0x5338aa;if(_0x4672e9>=_0x4f503d){_0x4672e9=_0x4f503d;_0x5338aa=0xc8;}else{_0x5338aa=0xce;}_0x438d88['status'](_0x5338aa);return _0x438d88['set'](_0x1dab('0x1f'),_0x4184b7+'-'+_0x4672e9+'/'+_0x4f503d)[_0x1dab('0x1a')](_0x51822b);}return null;};}function patchUpdates(_0x5e4f0e){return function(_0x471ac3){try{jsonpatch[_0x1dab('0x20')](_0x471ac3,_0x5e4f0e,!![]);}catch(_0x5a7525){return BPromise[_0x1dab('0x21')](_0x5a7525);}return _0x471ac3['save']();};}function saveUpdates(_0xd684f5,_0xa6310c){return function(_0x24ba5c){if(_0x24ba5c){return _0x24ba5c[_0x1dab('0x22')](_0xd684f5)[_0x1dab('0x23')](function(_0x38b239){return _0x38b239;});}return null;};}function removeEntity(_0x9cc36d,_0x48ae5e){return function(_0x2e74c6){if(_0x2e74c6){return _0x2e74c6['destroy']()[_0x1dab('0x23')](function(){_0x9cc36d[_0x1dab('0x18')](0xcc)[_0x1dab('0x19')]();});}};}function handleEntityNotFound(_0x46856a,_0x2d0a4d){return function(_0xcc1335){if(!_0xcc1335){_0x46856a[_0x1dab('0x17')](0x194);}return _0xcc1335;};}function handleError(_0x491db7,_0x39e86b){_0x39e86b=_0x39e86b||0x1f4;return function(_0xb3acdf){logger[_0x1dab('0x24')](_0xb3acdf[_0x1dab('0x25')]);if(_0xb3acdf[_0x1dab('0x26')]){delete _0xb3acdf[_0x1dab('0x26')];}_0x491db7['status'](_0x39e86b)[_0x1dab('0x27')](_0xb3acdf);};}exports[_0x1dab('0x28')]=function(_0x5b2ac9,_0x4f0827){var _0x392302={},_0x33c7bc={},_0x1c56ee={'count':0x0,'rows':[]};var _0x2ee1f5=_['map'](db['SmsApplication'][_0x1dab('0x29')],function(_0x2f2312){return{'name':_0x2f2312[_0x1dab('0x2a')],'type':_0x2f2312[_0x1dab('0x2b')][_0x1dab('0x2c')]};});_0x33c7bc['model']=_['map'](_0x2ee1f5,_0x1dab('0x26'));_0x33c7bc['query']=_[_0x1dab('0x2d')](_0x5b2ac9[_0x1dab('0x2e')]);_0x33c7bc['filters']=_[_0x1dab('0x2f')](_0x33c7bc[_0x1dab('0x30')],_0x33c7bc[_0x1dab('0x2e')]);_0x392302[_0x1dab('0x31')]=_[_0x1dab('0x2f')](_0x33c7bc['model'],qs[_0x1dab('0x32')](_0x5b2ac9[_0x1dab('0x2e')][_0x1dab('0x32')]));_0x392302[_0x1dab('0x31')]=_0x392302['attributes'][_0x1dab('0x33')]?_0x392302[_0x1dab('0x31')]:_0x33c7bc[_0x1dab('0x30')];if(!_0x5b2ac9[_0x1dab('0x2e')][_0x1dab('0x34')]('nolimit')){_0x392302['limit']=qs['limit'](_0x5b2ac9[_0x1dab('0x2e')][_0x1dab('0x1d')]);_0x392302[_0x1dab('0x1b')]=qs['offset'](_0x5b2ac9[_0x1dab('0x2e')][_0x1dab('0x1b')]);}_0x392302[_0x1dab('0x35')]=qs[_0x1dab('0x36')](_0x5b2ac9[_0x1dab('0x2e')]['sort']);_0x392302['where']=qs[_0x1dab('0x37')](_[_0x1dab('0x38')](_0x5b2ac9['query'],_0x33c7bc[_0x1dab('0x37')]),_0x2ee1f5);if(_0x5b2ac9[_0x1dab('0x2e')][_0x1dab('0x39')]){_0x392302[_0x1dab('0x3a')]=_[_0x1dab('0x3b')](_0x392302[_0x1dab('0x3a')],{'$or':_[_0x1dab('0x3c')](_0x2ee1f5,function(_0x1a1f77){if(_0x1a1f77[_0x1dab('0x2b')]!==_0x1dab('0x3d')){var _0x48c7dd={};_0x48c7dd[_0x1a1f77[_0x1dab('0x26')]]={'$like':'%'+_0x5b2ac9[_0x1dab('0x2e')]['filter']+'%'};return _0x48c7dd;}})});}_0x392302=_[_0x1dab('0x3b')]({},_0x392302,_0x5b2ac9[_0x1dab('0x3e')]);var _0x5dc181={'where':_0x392302[_0x1dab('0x3a')]};return db['SmsApplication'][_0x1dab('0x1e')](_0x5dc181)[_0x1dab('0x23')](function(_0x3b6bf9){_0x1c56ee['count']=_0x3b6bf9;if(_0x5b2ac9[_0x1dab('0x2e')][_0x1dab('0x3f')]){_0x392302[_0x1dab('0x40')]=[{'all':!![]}];}return db[_0x1dab('0x41')][_0x1dab('0x42')](_0x392302);})['then'](function(_0x186108){_0x1c56ee[_0x1dab('0x43')]=_0x186108;return _0x1c56ee;})[_0x1dab('0x23')](respondWithFilteredResult(_0x4f0827,_0x392302))[_0x1dab('0x44')](handleError(_0x4f0827,null));};exports[_0x1dab('0x45')]=function(_0x3be0c7,_0x144806){var _0x4f9a21={'raw':!![],'where':{'id':_0x3be0c7[_0x1dab('0x46')]['id']}},_0x53bff5={};_0x53bff5[_0x1dab('0x30')]=_[_0x1dab('0x2d')](db[_0x1dab('0x41')][_0x1dab('0x29')]);_0x53bff5['query']=_[_0x1dab('0x2d')](_0x3be0c7[_0x1dab('0x2e')]);_0x53bff5[_0x1dab('0x37')]=_[_0x1dab('0x2f')](_0x53bff5[_0x1dab('0x30')],_0x53bff5[_0x1dab('0x2e')]);_0x4f9a21['attributes']=_[_0x1dab('0x2f')](_0x53bff5[_0x1dab('0x30')],qs[_0x1dab('0x32')](_0x3be0c7['query']['fields']));_0x4f9a21['attributes']=_0x4f9a21[_0x1dab('0x31')][_0x1dab('0x33')]?_0x4f9a21[_0x1dab('0x31')]:_0x53bff5['model'];if(_0x3be0c7[_0x1dab('0x2e')][_0x1dab('0x3f')]){_0x4f9a21[_0x1dab('0x40')]=[{'all':!![]}];}_0x4f9a21=_[_0x1dab('0x3b')]({},_0x4f9a21,_0x3be0c7[_0x1dab('0x3e')]);return db['SmsApplication'][_0x1dab('0x47')](_0x4f9a21)[_0x1dab('0x23')](handleEntityNotFound(_0x144806,null))[_0x1dab('0x23')](respondWithResult(_0x144806,null))[_0x1dab('0x44')](handleError(_0x144806,null));};exports[_0x1dab('0x48')]=function(_0x52a2a3,_0x4f37cf){return db[_0x1dab('0x41')]['create'](_0x52a2a3[_0x1dab('0x49')],{})[_0x1dab('0x23')](respondWithResult(_0x4f37cf,0xc9))[_0x1dab('0x44')](handleError(_0x4f37cf,null));};exports[_0x1dab('0x22')]=function(_0x59daf2,_0x22055e){if(_0x59daf2[_0x1dab('0x49')]['id']){delete _0x59daf2[_0x1dab('0x49')]['id'];}return db[_0x1dab('0x41')][_0x1dab('0x47')]({'where':{'id':_0x59daf2[_0x1dab('0x46')]['id']}})[_0x1dab('0x23')](handleEntityNotFound(_0x22055e,null))[_0x1dab('0x23')](saveUpdates(_0x59daf2[_0x1dab('0x49')],null))[_0x1dab('0x23')](respondWithResult(_0x22055e,null))[_0x1dab('0x44')](handleError(_0x22055e,null));};exports['destroy']=function(_0x5cd391,_0x526294){return db[_0x1dab('0x41')]['find']({'where':{'id':_0x5cd391['params']['id']}})[_0x1dab('0x23')](handleEntityNotFound(_0x526294,null))['then'](removeEntity(_0x526294,null))[_0x1dab('0x44')](handleError(_0x526294,null));}; \ No newline at end of file +var _0xda45=['to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','map','SmsApplication','rawAttributes','type','query','intersection','model','fields','attributes','length','hasOwnProperty','sort','filters','pick','where','merge','filter','include','findAll','catch','show','params','keys','includeAll','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox'];(function(_0xc1263e,_0x56d738){var _0x471f07=function(_0x2e6c55){while(--_0x2e6c55){_0xc1263e['push'](_0xc1263e['shift']());}};_0x471f07(++_0x56d738);}(_0xda45,0x1db));var _0x5da4=function(_0xff6876,_0x8c061d){_0xff6876=_0xff6876-0x0;var _0x5ca4fb=_0xda45[_0xff6876];return _0x5ca4fb;};'use strict';var emlformat=require(_0x5da4('0x0'));var rimraf=require(_0x5da4('0x1'));var zipdir=require(_0x5da4('0x2'));var jsonpatch=require(_0x5da4('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5da4('0x4'));var Mustache=require(_0x5da4('0x5'));var util=require(_0x5da4('0x6'));var path=require('path');var sox=require(_0x5da4('0x7'));var csv=require(_0x5da4('0x8'));var ejs=require(_0x5da4('0x9'));var fs=require('fs');var fs_extra=require(_0x5da4('0xa'));var _=require(_0x5da4('0xb'));var squel=require(_0x5da4('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5da4('0xd'));var toCsv=require(_0x5da4('0x8'));var querystring=require('querystring');var Papa=require(_0x5da4('0xe'));var Redis=require(_0x5da4('0xf'));var authService=require(_0x5da4('0x10'));var qs=require(_0x5da4('0x11'));var as=require(_0x5da4('0x12'));var hardwareService=require(_0x5da4('0x13'));var logger=require(_0x5da4('0x14'))('api');var utils=require(_0x5da4('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5da4('0x16'));var db=require(_0x5da4('0x17'))['db'];function respondWithStatusCode(_0x327e90,_0x4e8285){_0x4e8285=_0x4e8285||0xcc;return function(_0x57ff6c){if(_0x57ff6c){return _0x327e90[_0x5da4('0x18')](_0x4e8285);}return _0x327e90[_0x5da4('0x19')](_0x4e8285)[_0x5da4('0x1a')]();};}function respondWithResult(_0x3f32b1,_0x4f2e9d){_0x4f2e9d=_0x4f2e9d||0xc8;return function(_0x13bcd3){if(_0x13bcd3){return _0x3f32b1[_0x5da4('0x19')](_0x4f2e9d)[_0x5da4('0x1b')](_0x13bcd3);}};}function respondWithFilteredResult(_0x4314a8,_0x27f1ca){return function(_0x5c475e){if(_0x5c475e){var _0x5b548f=typeof _0x27f1ca[_0x5da4('0x1c')]===_0x5da4('0x1d')&&typeof _0x27f1ca[_0x5da4('0x1e')]==='undefined';var _0x358077=_0x5c475e[_0x5da4('0x1f')];var _0x13e673=_0x5b548f?0x0:_0x27f1ca['offset'];var _0x36c2d1=_0x5b548f?_0x5c475e['count']:_0x27f1ca[_0x5da4('0x1c')]+_0x27f1ca[_0x5da4('0x1e')];var _0x47a254;if(_0x36c2d1>=_0x358077){_0x36c2d1=_0x358077;_0x47a254=0xc8;}else{_0x47a254=0xce;}_0x4314a8[_0x5da4('0x19')](_0x47a254);return _0x4314a8['set'](_0x5da4('0x20'),_0x13e673+'-'+_0x36c2d1+'/'+_0x358077)[_0x5da4('0x1b')](_0x5c475e);}return null;};}function patchUpdates(_0x2461db){return function(_0x3f27f6){try{jsonpatch[_0x5da4('0x21')](_0x3f27f6,_0x2461db,!![]);}catch(_0x1a1d06){return BPromise[_0x5da4('0x22')](_0x1a1d06);}return _0x3f27f6[_0x5da4('0x23')]();};}function saveUpdates(_0x15439a,_0x411913){return function(_0x5a0083){if(_0x5a0083){return _0x5a0083[_0x5da4('0x24')](_0x15439a)[_0x5da4('0x25')](function(_0x2389d0){return _0x2389d0;});}return null;};}function removeEntity(_0x2dc105,_0x2a701d){return function(_0x3a9d85){if(_0x3a9d85){return _0x3a9d85['destroy']()['then'](function(){_0x2dc105[_0x5da4('0x19')](0xcc)[_0x5da4('0x1a')]();});}};}function handleEntityNotFound(_0x319619,_0x2cd6d3){return function(_0x1644d0){if(!_0x1644d0){_0x319619[_0x5da4('0x18')](0x194);}return _0x1644d0;};}function handleError(_0x2bc008,_0x53a521){_0x53a521=_0x53a521||0x1f4;return function(_0x328bdf){logger[_0x5da4('0x26')](_0x328bdf[_0x5da4('0x27')]);if(_0x328bdf[_0x5da4('0x28')]){delete _0x328bdf['name'];}_0x2bc008[_0x5da4('0x19')](_0x53a521)['send'](_0x328bdf);};}exports['index']=function(_0xfee09a,_0x1e50db){var _0x185ecd={},_0x1cfb01={},_0x8b836c={'count':0x0,'rows':[]};var _0x8a9f3a=_[_0x5da4('0x29')](db[_0x5da4('0x2a')][_0x5da4('0x2b')],function(_0x22f969){return{'name':_0x22f969['fieldName'],'type':_0x22f969[_0x5da4('0x2c')]['key']};});_0x1cfb01['model']=_[_0x5da4('0x29')](_0x8a9f3a,'name');_0x1cfb01[_0x5da4('0x2d')]=_['keys'](_0xfee09a[_0x5da4('0x2d')]);_0x1cfb01['filters']=_[_0x5da4('0x2e')](_0x1cfb01['model'],_0x1cfb01['query']);_0x185ecd['attributes']=_[_0x5da4('0x2e')](_0x1cfb01[_0x5da4('0x2f')],qs['fields'](_0xfee09a[_0x5da4('0x2d')][_0x5da4('0x30')]));_0x185ecd[_0x5da4('0x31')]=_0x185ecd['attributes'][_0x5da4('0x32')]?_0x185ecd[_0x5da4('0x31')]:_0x1cfb01[_0x5da4('0x2f')];if(!_0xfee09a['query'][_0x5da4('0x33')]('nolimit')){_0x185ecd[_0x5da4('0x1e')]=qs[_0x5da4('0x1e')](_0xfee09a[_0x5da4('0x2d')][_0x5da4('0x1e')]);_0x185ecd['offset']=qs[_0x5da4('0x1c')](_0xfee09a['query']['offset']);}_0x185ecd['order']=qs['sort'](_0xfee09a[_0x5da4('0x2d')][_0x5da4('0x34')]);_0x185ecd['where']=qs[_0x5da4('0x35')](_[_0x5da4('0x36')](_0xfee09a[_0x5da4('0x2d')],_0x1cfb01[_0x5da4('0x35')]),_0x8a9f3a);if(_0xfee09a['query']['filter']){_0x185ecd[_0x5da4('0x37')]=_[_0x5da4('0x38')](_0x185ecd[_0x5da4('0x37')],{'$or':_['map'](_0x8a9f3a,function(_0xbff25d){if(_0xbff25d[_0x5da4('0x2c')]!=='VIRTUAL'){var _0x2efc11={};_0x2efc11[_0xbff25d[_0x5da4('0x28')]]={'$like':'%'+_0xfee09a[_0x5da4('0x2d')][_0x5da4('0x39')]+'%'};return _0x2efc11;}})});}_0x185ecd=_['merge']({},_0x185ecd,_0xfee09a['options']);var _0x2eda93={'where':_0x185ecd['where']};return db[_0x5da4('0x2a')][_0x5da4('0x1f')](_0x2eda93)[_0x5da4('0x25')](function(_0x11ca3a){_0x8b836c[_0x5da4('0x1f')]=_0x11ca3a;if(_0xfee09a[_0x5da4('0x2d')]['includeAll']){_0x185ecd[_0x5da4('0x3a')]=[{'all':!![]}];}return db[_0x5da4('0x2a')][_0x5da4('0x3b')](_0x185ecd);})[_0x5da4('0x25')](function(_0x4be38a){_0x8b836c['rows']=_0x4be38a;return _0x8b836c;})[_0x5da4('0x25')](respondWithFilteredResult(_0x1e50db,_0x185ecd))[_0x5da4('0x3c')](handleError(_0x1e50db,null));};exports[_0x5da4('0x3d')]=function(_0x4464e3,_0x18e7d6){var _0x4e2f37={'raw':!![],'where':{'id':_0x4464e3[_0x5da4('0x3e')]['id']}},_0x501b72={};_0x501b72[_0x5da4('0x2f')]=_[_0x5da4('0x3f')](db[_0x5da4('0x2a')][_0x5da4('0x2b')]);_0x501b72[_0x5da4('0x2d')]=_[_0x5da4('0x3f')](_0x4464e3[_0x5da4('0x2d')]);_0x501b72[_0x5da4('0x35')]=_[_0x5da4('0x2e')](_0x501b72[_0x5da4('0x2f')],_0x501b72['query']);_0x4e2f37[_0x5da4('0x31')]=_[_0x5da4('0x2e')](_0x501b72['model'],qs[_0x5da4('0x30')](_0x4464e3[_0x5da4('0x2d')][_0x5da4('0x30')]));_0x4e2f37[_0x5da4('0x31')]=_0x4e2f37['attributes'][_0x5da4('0x32')]?_0x4e2f37[_0x5da4('0x31')]:_0x501b72[_0x5da4('0x2f')];if(_0x4464e3[_0x5da4('0x2d')][_0x5da4('0x40')]){_0x4e2f37['include']=[{'all':!![]}];}_0x4e2f37=_[_0x5da4('0x38')]({},_0x4e2f37,_0x4464e3[_0x5da4('0x41')]);return db[_0x5da4('0x2a')][_0x5da4('0x42')](_0x4e2f37)['then'](handleEntityNotFound(_0x18e7d6,null))[_0x5da4('0x25')](respondWithResult(_0x18e7d6,null))[_0x5da4('0x3c')](handleError(_0x18e7d6,null));};exports[_0x5da4('0x43')]=function(_0x5ec64a,_0xc3f2ea){return db[_0x5da4('0x2a')][_0x5da4('0x43')](_0x5ec64a['body'],{})['then'](respondWithResult(_0xc3f2ea,0xc9))[_0x5da4('0x3c')](handleError(_0xc3f2ea,null));};exports['update']=function(_0x23414a,_0x464bd2){if(_0x23414a[_0x5da4('0x44')]['id']){delete _0x23414a['body']['id'];}return db[_0x5da4('0x2a')][_0x5da4('0x42')]({'where':{'id':_0x23414a[_0x5da4('0x3e')]['id']}})[_0x5da4('0x25')](handleEntityNotFound(_0x464bd2,null))[_0x5da4('0x25')](saveUpdates(_0x23414a[_0x5da4('0x44')],null))[_0x5da4('0x25')](respondWithResult(_0x464bd2,null))[_0x5da4('0x3c')](handleError(_0x464bd2,null));};exports['destroy']=function(_0x3e8742,_0x1ccf4b){return db[_0x5da4('0x2a')]['find']({'where':{'id':_0x3e8742[_0x5da4('0x3e')]['id']}})['then'](handleEntityNotFound(_0x1ccf4b,null))[_0x5da4('0x25')](removeEntity(_0x1ccf4b,null))[_0x5da4('0x3c')](handleError(_0x1ccf4b,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 2896254..5f160a5 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 _0xb45e=['lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','define','SmsApplication','utf8mb4','utf8mb4_unicode_ci'];(function(_0x514fc0,_0x1032a0){var _0x26f8ee=function(_0x3bd0da){while(--_0x3bd0da){_0x514fc0['push'](_0x514fc0['shift']());}};_0x26f8ee(++_0x1032a0);}(_0xb45e,0x90));var _0xeb45=function(_0x44c768,_0x552a5e){_0x44c768=_0x44c768-0x0;var _0x55daf5=_0xb45e[_0x44c768];return _0x55daf5;};'use strict';var _=require(_0xeb45('0x0'));var util=require('util');var logger=require(_0xeb45('0x1'))(_0xeb45('0x2'));var moment=require(_0xeb45('0x3'));var BPromise=require('bluebird');var rp=require(_0xeb45('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeb45('0x5'));var config=require(_0xeb45('0x6'));var attributes=require('./smsApplication.attributes');module[_0xeb45('0x7')]=function(_0x26c885,_0x4c6dac){return _0x26c885[_0xeb45('0x8')](_0xeb45('0x9'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xeb45('0xa'),'collate':_0xeb45('0xb')});}; \ No newline at end of file +var _0x6b76=['bluebird','path','rimraf','../../config/environment','./smsApplication.attributes','define','SmsApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment'];(function(_0x448565,_0x40c97c){var _0x40ac06=function(_0x1a2adc){while(--_0x1a2adc){_0x448565['push'](_0x448565['shift']());}};_0x40ac06(++_0x40c97c);}(_0x6b76,0xa5));var _0x66b7=function(_0x451069,_0x2ef01e){_0x451069=_0x451069-0x0;var _0x269aed=_0x6b76[_0x451069];return _0x269aed;};'use strict';var _=require(_0x66b7('0x0'));var util=require('util');var logger=require(_0x66b7('0x1'))(_0x66b7('0x2'));var moment=require(_0x66b7('0x3'));var BPromise=require(_0x66b7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x66b7('0x5'));var rimraf=require(_0x66b7('0x6'));var config=require(_0x66b7('0x7'));var attributes=require(_0x66b7('0x8'));module['exports']=function(_0x25d3d,_0x4acbf0){return _0x25d3d[_0x66b7('0x9')](_0x66b7('0xa'),attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x66b7('0xb'),'collate':_0x66b7('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 3f5ba64..87eb7b1 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 _0xa809=['error','message','info','result','catch','util','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x483c7f,_0x33722e){var _0x4abf79=function(_0x3f136f){while(--_0x3f136f){_0x483c7f['push'](_0x483c7f['shift']());}};_0x4abf79(++_0x33722e);}(_0xa809,0x1f3));var _0x9a80=function(_0x19a814,_0x103c9f){_0x19a814=_0x19a814-0x0;var _0x5a6aab=_0xa809[_0x19a814];return _0x5a6aab;};'use strict';var _=require('lodash');var util=require(_0x9a80('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9a80('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9a80('0x2'))(_0x9a80('0x3'));var config=require(_0x9a80('0x4'));var jayson=require(_0x9a80('0x5'));var client=jayson['client'][_0x9a80('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x504ba8,_0x17b704,_0x286ac5){return new BPromise(function(_0x4ea507,_0x1ef67a){return client[_0x9a80('0x7')](_0x504ba8,_0x286ac5)[_0x9a80('0x8')](function(_0x269ee2){logger['info'](_0x9a80('0x9'),_0x17b704,_0x9a80('0xa'));logger[_0x9a80('0xb')](_0x9a80('0xc'),_0x17b704,_0x9a80('0xa'),JSON[_0x9a80('0xd')](_0x269ee2));if(_0x269ee2[_0x9a80('0xe')]){if(_0x269ee2[_0x9a80('0xe')]['code']===0x1f4){logger[_0x9a80('0xe')](_0x9a80('0x9'),_0x17b704,_0x269ee2[_0x9a80('0xe')][_0x9a80('0xf')]);return _0x1ef67a(_0x269ee2[_0x9a80('0xe')][_0x9a80('0xf')]);}logger[_0x9a80('0xe')](_0x9a80('0x9'),_0x17b704,_0x269ee2['error'][_0x9a80('0xf')]);return _0x4ea507(_0x269ee2['error'][_0x9a80('0xf')]);}else{logger[_0x9a80('0x10')](_0x9a80('0x9'),_0x17b704,'request\x20sent');_0x4ea507(_0x269ee2[_0x9a80('0x11')][_0x9a80('0xf')]);}})[_0x9a80('0x12')](function(_0x12ecee){logger[_0x9a80('0xe')]('SmsApplication,\x20%s,\x20%s',_0x17b704,_0x12ecee);_0x1ef67a(_0x12ecee);});});} \ No newline at end of file +var _0x60a5=['then','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request'];(function(_0x4e6913,_0xba423b){var _0x9ef2ad=function(_0x259f53){while(--_0x259f53){_0x4e6913['push'](_0x4e6913['shift']());}};_0x9ef2ad(++_0xba423b);}(_0x60a5,0x83));var _0x560a=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x60a5[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x560a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x560a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x560a('0x2'))['db'];var utils=require(_0x560a('0x3'));var logger=require(_0x560a('0x4'))('rpc');var config=require(_0x560a('0x5'));var jayson=require(_0x560a('0x6'));var client=jayson[_0x560a('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52fa23,_0x55eb57,_0x53a664){return new BPromise(function(_0x3ac39e,_0x1891ea){return client[_0x560a('0x8')](_0x52fa23,_0x53a664)[_0x560a('0x9')](function(_0x52c52e){logger['info'](_0x560a('0xa'),_0x55eb57,'request\x20sent');logger[_0x560a('0xb')](_0x560a('0xc'),_0x55eb57,'request\x20sent',JSON[_0x560a('0xd')](_0x52c52e));if(_0x52c52e[_0x560a('0xe')]){if(_0x52c52e[_0x560a('0xe')][_0x560a('0xf')]===0x1f4){logger[_0x560a('0xe')](_0x560a('0xa'),_0x55eb57,_0x52c52e[_0x560a('0xe')][_0x560a('0x10')]);return _0x1891ea(_0x52c52e[_0x560a('0xe')]['message']);}logger[_0x560a('0xe')](_0x560a('0xa'),_0x55eb57,_0x52c52e[_0x560a('0xe')]['message']);return _0x3ac39e(_0x52c52e[_0x560a('0xe')][_0x560a('0x10')]);}else{logger[_0x560a('0x11')](_0x560a('0xa'),_0x55eb57,'request\x20sent');_0x3ac39e(_0x52c52e[_0x560a('0x12')][_0x560a('0x10')]);}})[_0x560a('0x13')](function(_0x3f9f15){logger['error']('SmsApplication,\x20%s,\x20%s',_0x55eb57,_0x3f9f15);_0x1891ea(_0x3f9f15);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 6ca3f7a..226aaac 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 _0x7708=['removeTags','exports','multer','util','connect-timeout','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','sms','addTags','put','delete'];(function(_0x5c94d2,_0x5ab94b){var _0x59d81e=function(_0x4c2aa8){while(--_0x4c2aa8){_0x5c94d2['push'](_0x5c94d2['shift']());}};_0x59d81e(++_0x5ab94b);}(_0x7708,0x188));var _0x8770=function(_0x99868f,_0xbdb8e7){_0x99868f=_0x99868f-0x0;var _0x27a71b=_0x7708[_0x99868f];return _0x27a71b;};'use strict';var multer=require(_0x8770('0x0'));var util=require(_0x8770('0x1'));var path=require('path');var timeout=require(_0x8770('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8770('0x3'));var config=require(_0x8770('0x4'));var controller=require('./smsInteraction.controller');router[_0x8770('0x5')]('/',auth['isAuthenticated'](),controller[_0x8770('0x6')]);router[_0x8770('0x5')](_0x8770('0x7'),auth[_0x8770('0x8')](),controller[_0x8770('0x9')]);router[_0x8770('0x5')](_0x8770('0xa'),auth['isAuthenticated'](),controller[_0x8770('0xb')]);router[_0x8770('0x5')](_0x8770('0xc'),auth['isAuthenticated'](),controller[_0x8770('0xd')]);router[_0x8770('0x5')](_0x8770('0xe'),auth[_0x8770('0x8')](),controller['download']);router[_0x8770('0xf')]('/',auth[_0x8770('0x8')](),controller[_0x8770('0x10')]);router['post'](_0x8770('0xc'),auth[_0x8770('0x8')](),controller[_0x8770('0x11')]);router[_0x8770('0xf')](_0x8770('0x12'),auth[_0x8770('0x8')](),interaction[_0x8770('0x13')](_0x8770('0x14'),'smsinteraction:addtags'),controller[_0x8770('0x15')]);router[_0x8770('0x16')]('/:id',auth[_0x8770('0x8')](),interaction['tracked'](_0x8770('0x14'),'smsinteraction:update'),controller['update']);router['delete'](_0x8770('0xa'),auth[_0x8770('0x8')](),interaction[_0x8770('0x13')](_0x8770('0x14'),'smsinteraction:destroy'),controller['destroy']);router[_0x8770('0x17')](_0x8770('0x12'),auth[_0x8770('0x8')](),controller[_0x8770('0x18')]);module[_0x8770('0x19')]=router; \ No newline at end of file +var _0x9ffd=['sms','smsinteraction:addtags','put','smsinteraction:update','delete','tracked','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','getMessages','/:id/download','download','post','create','addMessage','/:id/tags'];(function(_0x54a8d3,_0x12b8b7){var _0x5eec0e=function(_0xbc1ade){while(--_0xbc1ade){_0x54a8d3['push'](_0x54a8d3['shift']());}};_0x5eec0e(++_0x12b8b7);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x74e30c,_0x5b61f6){_0x74e30c=_0x74e30c-0x0;var _0x19022d=_0x9ffd[_0x74e30c];return _0x19022d;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xb')](_0xd9ff('0xe'),auth[_0xd9ff('0x9')](),controller['show']);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0xd9ff('0xf')]);router[_0xd9ff('0xb')](_0xd9ff('0x10'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);router[_0xd9ff('0x12')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x13')]);router['post']('/:id/messages',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x14')]);router[_0xd9ff('0x12')](_0xd9ff('0x15'),auth[_0xd9ff('0x9')](),interaction['tracked'](_0xd9ff('0x16'),_0xd9ff('0x17')),controller['addTags']);router[_0xd9ff('0x18')]('/:id',auth['isAuthenticated'](),interaction['tracked']('sms',_0xd9ff('0x19')),controller['update']);router[_0xd9ff('0x1a')](_0xd9ff('0xe'),auth[_0xd9ff('0x9')](),interaction[_0xd9ff('0x1b')](_0xd9ff('0x16'),_0xd9ff('0x1c')),controller[_0xd9ff('0x1d')]);router[_0xd9ff('0x1a')](_0xd9ff('0x15'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x1e')]);module[_0xd9ff('0x1f')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index b083d75..7877dad 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 _0xfd7b=['INTEGER','sequelize','moment','exports','DATE','STRING','out','BOOLEAN'];(function(_0x10d39e,_0x260735){var _0x27a17d=function(_0x1d445b){while(--_0x1d445b){_0x10d39e['push'](_0x10d39e['shift']());}};_0x27a17d(++_0x260735);}(_0xfd7b,0xd1));var _0xbfd7=function(_0x52e363,_0x48062a){_0x52e363=_0x52e363-0x0;var _0x3fc2b5=_0xfd7b[_0x52e363];return _0x3fc2b5;};'use strict';var Sequelize=require(_0xbfd7('0x0'));var moment=require(_0xbfd7('0x1'));module[_0xbfd7('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbfd7('0x3')]},'disposition':{'type':Sequelize[_0xbfd7('0x4')]},'secondDisposition':{'type':Sequelize[_0xbfd7('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xbfd7('0x4')]},'phone':{'type':Sequelize[_0xbfd7('0x4')]},'read1stAt':{'type':Sequelize[_0xbfd7('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xbfd7('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbfd7('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xbfd7('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xbfd7('0x6')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xbfd7('0x7')]}}; \ No newline at end of file +var _0x3746=['INTEGER','sequelize','moment','BOOLEAN','STRING','DATE','ENUM','out'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3746,0xa9));var _0x6374=function(_0x612521,_0x2e9771){_0x612521=_0x612521-0x0;var _0x24fe8d=_0x3746[_0x612521];return _0x24fe8d;};'use strict';var Sequelize=require(_0x6374('0x0'));var moment=require(_0x6374('0x1'));module['exports']={'closed':{'type':Sequelize[_0x6374('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x6374('0x3')]},'secondDisposition':{'type':Sequelize[_0x6374('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x6374('0x3')]},'read1stAt':{'type':Sequelize[_0x6374('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x6374('0x5')]('in',_0x6374('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6374('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x6374('0x5')]('in',_0x6374('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x6374('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x6374('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 03c8e45..dab08d0 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 _0x0048=['pick','SmsInteractionId','filter','where','merge','$gte','split','format','includeAll','findAll','rows','addTags','setTags','omit','spread','Tag','color','smsInteractionTags:save','removeTags','toString','root','server','files','tmp','join','transcript-%d-%s.zip','User','fullname','CmContact','firstName','lastName','Messages','createdAt','direction','secret','read','push','SmsAccount','Account','get','mkdirSync','Sms','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','out','System','Contact','value','downloadInteraction.ejs','.pdf','download','log','err','unlinkSync','zip-dir','moment','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','SmsInteraction','fieldName','type','key','sms','query','catch','show','model','keys','filters','intersection','attributes','fields','length','include','options','find','create','body','params','describe','SmsMessage','ids','getMessages','findOne','rawAttributes','hasOwnProperty','nolimit','sort'];(function(_0x311909,_0x414bf7){var _0x8d3163=function(_0x226f55){while(--_0x226f55){_0x311909['push'](_0x311909['shift']());}};_0x8d3163(++_0x414bf7);}(_0x0048,0x129));var _0x8004=function(_0x4e0d05,_0x1252ef){_0x4e0d05=_0x4e0d05-0x0;var _0x568b50=_0x0048[_0x4e0d05];return _0x568b50;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x8004('0x0'));var moment=require(_0x8004('0x1'));var BPromise=require('bluebird');var util=require(_0x8004('0x2'));var path=require(_0x8004('0x3'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8004('0x4'));var Redis=require(_0x8004('0x5'));var interaction=require(_0x8004('0x6'));var qs=require(_0x8004('0x7'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0x8004('0x8'));var config=require(_0x8004('0x9'));var db=require(_0x8004('0xa'))['db'];config['redis']=_[_0x8004('0xb')](config[_0x8004('0xc')],{'host':_0x8004('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsInteraction.socket')[_0x8004('0xe')](socket);function respondWithStatusCode(_0x4ae5a4,_0x59ea76){_0x59ea76=_0x59ea76||0xcc;return function(_0x12e67b){if(_0x12e67b){return _0x4ae5a4[_0x8004('0xf')](_0x59ea76);}return _0x4ae5a4['status'](_0x59ea76)['end']();};}function respondWithResult(_0x1a261e,_0x75a8a6){_0x75a8a6=_0x75a8a6||0xc8;return function(_0x42dafb){if(_0x42dafb){return _0x1a261e[_0x8004('0x10')](_0x75a8a6)[_0x8004('0x11')](_0x42dafb);}};}function respondWithFilteredResult(_0x368720,_0x39a752){return function(_0x5d9972){if(_0x5d9972){var _0x26dde8=typeof _0x39a752[_0x8004('0x12')]===_0x8004('0x13')&&typeof _0x39a752[_0x8004('0x14')]===_0x8004('0x13');var _0xc47c27=_0x5d9972[_0x8004('0x15')];var _0x65f71e=_0x26dde8?0x0:_0x39a752[_0x8004('0x12')];var _0x3cebc4=_0x26dde8?_0x5d9972[_0x8004('0x15')]:_0x39a752[_0x8004('0x12')]+_0x39a752[_0x8004('0x14')];var _0x36a0c9;if(_0x3cebc4>=_0xc47c27){_0x3cebc4=_0xc47c27;_0x36a0c9=0xc8;}else{_0x36a0c9=0xce;}_0x368720[_0x8004('0x10')](_0x36a0c9);return _0x368720[_0x8004('0x16')](_0x8004('0x17'),_0x65f71e+'-'+_0x3cebc4+'/'+_0xc47c27)[_0x8004('0x11')](_0x5d9972);}return null;};}function saveUpdates(_0x75f97d){return function(_0x4b0a9b){if(_0x4b0a9b){return _0x4b0a9b[_0x8004('0x18')](_0x75f97d)[_0x8004('0x19')](function(_0x502eed){return _0x502eed;});}return null;};}function removeEntity(_0x17b715){return function(_0x44222d){if(_0x44222d){return _0x44222d[_0x8004('0x1a')]()[_0x8004('0x19')](function(){_0x17b715[_0x8004('0x10')](0xcc)[_0x8004('0x1b')]();});}};}function handleEntityNotFound(_0x93be01){return function(_0x1ffeef){if(!_0x1ffeef){_0x93be01[_0x8004('0xf')](0x194);}return _0x1ffeef;};}function handleError(_0x15e146,_0x5a4608){_0x5a4608=_0x5a4608||0x1f4;return function(_0x57370e){logger['error'](_0x57370e[_0x8004('0x1c')]);if(_0x57370e[_0x8004('0x1d')]){delete _0x57370e['name'];}_0x15e146[_0x8004('0x10')](_0x5a4608)[_0x8004('0x1e')](_0x57370e);};}exports[_0x8004('0x1f')]=function(_0x36bf15,_0x1b3340){var _0x2d3313={};var _0x567c3e=_[_0x8004('0x20')](db[_0x8004('0x21')]['rawAttributes'],function(_0x3bddfc){return{'name':_0x3bddfc[_0x8004('0x22')],'type':_0x3bddfc[_0x8004('0x23')][_0x8004('0x24')]};});_0x2d3313=qs['getOptions'](_0x567c3e,_0x36bf15);return interaction['findAll'](_0x8004('0x25'),_0x36bf15[_0x8004('0x26')],_0x36bf15['user'],_0x2d3313,_0x567c3e)[_0x8004('0x19')](respondWithFilteredResult(_0x1b3340,_0x2d3313))[_0x8004('0x27')](handleError(_0x1b3340,null));};exports[_0x8004('0x28')]=function(_0x2afc36,_0x78d1d2){var _0x5d24f8={'raw':![],'where':{'id':_0x2afc36['params']['id']}},_0x27902e={};_0x27902e[_0x8004('0x29')]=_['keys'](db['SmsInteraction']['rawAttributes']);_0x27902e[_0x8004('0x26')]=_[_0x8004('0x2a')](_0x2afc36['query']);_0x27902e[_0x8004('0x2b')]=_[_0x8004('0x2c')](_0x27902e[_0x8004('0x29')],_0x27902e[_0x8004('0x26')]);_0x5d24f8[_0x8004('0x2d')]=_[_0x8004('0x2c')](_0x27902e[_0x8004('0x29')],qs[_0x8004('0x2e')](_0x2afc36['query']['fields']));_0x5d24f8['attributes']=_0x5d24f8['attributes'][_0x8004('0x2f')]?_0x5d24f8[_0x8004('0x2d')]:_0x27902e[_0x8004('0x29')];if(_0x2afc36[_0x8004('0x26')]['includeAll']){_0x5d24f8[_0x8004('0x30')]=[{'all':!![]}];}_0x5d24f8=_['merge']({},_0x5d24f8,_0x2afc36[_0x8004('0x31')]);return db[_0x8004('0x21')][_0x8004('0x32')](_0x5d24f8)['then'](handleEntityNotFound(_0x78d1d2,null))[_0x8004('0x19')](respondWithResult(_0x78d1d2,null))[_0x8004('0x27')](handleError(_0x78d1d2,null));};exports[_0x8004('0x33')]=function(_0x1eea2d,_0x1ebac1){return db[_0x8004('0x21')][_0x8004('0x33')](_0x1eea2d[_0x8004('0x34')],{})['then'](respondWithResult(_0x1ebac1,0xc9))[_0x8004('0x27')](handleError(_0x1ebac1,null));};exports[_0x8004('0x18')]=function(_0x19c376,_0x9c012d){if(_0x19c376['body']['id']){delete _0x19c376[_0x8004('0x34')]['id'];}return db[_0x8004('0x21')]['find']({'where':{'id':_0x19c376[_0x8004('0x35')]['id']}})['then'](handleEntityNotFound(_0x9c012d,null))[_0x8004('0x19')](saveUpdates(_0x19c376['body'],null))['then'](respondWithResult(_0x9c012d,null))[_0x8004('0x27')](handleError(_0x9c012d,null));};exports[_0x8004('0x1a')]=function(_0x3e7413,_0x351941){return db[_0x8004('0x21')]['find']({'where':{'id':_0x3e7413[_0x8004('0x35')]['id']}})[_0x8004('0x19')](handleEntityNotFound(_0x351941,null))[_0x8004('0x19')](removeEntity(_0x351941,null))[_0x8004('0x27')](handleError(_0x351941,null));};exports['describe']=function(_0x16c078,_0x14469c){return db['SmsInteraction'][_0x8004('0x36')]()[_0x8004('0x19')](respondWithResult(_0x14469c,null))[_0x8004('0x27')](handleError(_0x14469c,null));};exports['addMessage']=function(_0x3ba4e4,_0x511885){return db[_0x8004('0x37')][_0x8004('0x32')]({'where':{'id':_0x3ba4e4[_0x8004('0x35')]['id']}})['then'](handleEntityNotFound(_0x511885,null))['then'](function(_0x5ac54b){if(_0x5ac54b){return _0x5ac54b['addMessage'](_0x3ba4e4[_0x8004('0x34')][_0x8004('0x38')],_['omit'](_0x3ba4e4[_0x8004('0x34')],[_0x8004('0x38'),'id'])||{});}})['then'](respondWithResult(_0x511885,null))[_0x8004('0x27')](handleError(_0x511885,null));};exports[_0x8004('0x39')]=function(_0x167e26,_0x511cfa){var _0x462988={'raw':![],'where':{}};var _0x59b1df={};var _0x3fb197={'count':0x0,'rows':[]};return db['SmsInteraction'][_0x8004('0x3a')]({'where':{'id':_0x167e26[_0x8004('0x35')]['id']}})['then'](handleEntityNotFound(_0x511cfa,null))[_0x8004('0x19')](function(_0xea8da3){if(_0xea8da3){_0x59b1df[_0x8004('0x29')]=_['keys'](db['SmsMessage'][_0x8004('0x3b')]);_0x59b1df[_0x8004('0x26')]=_[_0x8004('0x2a')](_0x167e26[_0x8004('0x26')]);_0x59b1df['filters']=_[_0x8004('0x2c')](_0x59b1df[_0x8004('0x29')],_0x59b1df[_0x8004('0x26')]);_0x462988[_0x8004('0x2d')]=_[_0x8004('0x2c')](_0x59b1df['model'],qs['fields'](_0x167e26[_0x8004('0x26')][_0x8004('0x2e')]));_0x462988[_0x8004('0x2d')]=_0x462988[_0x8004('0x2d')][_0x8004('0x2f')]?_0x462988[_0x8004('0x2d')]:_0x59b1df[_0x8004('0x29')];if(!_0x167e26[_0x8004('0x26')][_0x8004('0x3c')](_0x8004('0x3d'))){_0x462988[_0x8004('0x14')]=qs[_0x8004('0x14')](_0x167e26[_0x8004('0x26')]['limit']);_0x462988[_0x8004('0x12')]=qs[_0x8004('0x12')](_0x167e26[_0x8004('0x26')][_0x8004('0x12')]);}_0x462988['order']=qs['sort'](_0x167e26[_0x8004('0x26')][_0x8004('0x3e')]);_0x462988['where']=qs[_0x8004('0x2b')](_[_0x8004('0x3f')](_0x167e26['query'],_0x59b1df['filters']));_0x462988['where'][_0x8004('0x40')]=_0xea8da3['id'];if(_0x167e26[_0x8004('0x26')][_0x8004('0x41')]){_0x462988[_0x8004('0x42')]=_[_0x8004('0x43')](_0x462988[_0x8004('0x42')],{'$or':_[_0x8004('0x20')](_0x462988['attributes'],function(_0x2a3600){var _0x2b1001={};_0x2b1001[_0x2a3600]={'$like':'%'+_0x167e26[_0x8004('0x26')][_0x8004('0x41')]+'%'};return _0x2b1001;})});}if(_0x167e26['query'][_0x8004('0x44')]){var _0x521723=_0x167e26['query'][_0x8004('0x44')][_0x8004('0x45')](',');var _0x3d801d={};_0x3d801d[_0x521723[0x0]]={'$gte':moment(_0x521723[0x1])[_0x8004('0x46')]('YYYY-MM-DD\x20HH:mm:ss')};_0x462988[_0x8004('0x42')]=_['merge'](_0x462988[_0x8004('0x42')],_0x3d801d);}_0x462988=_[_0x8004('0x43')]({},_0x462988,_0x167e26[_0x8004('0x31')]);return db[_0x8004('0x37')][_0x8004('0x15')]({'where':_0x462988[_0x8004('0x42')]})[_0x8004('0x19')](function(_0x3ebd70){_0x3fb197['count']=_0x3ebd70;if(_0x167e26[_0x8004('0x26')][_0x8004('0x47')]){_0x462988['include']=[{'all':!![]}];}return db['SmsMessage'][_0x8004('0x48')](_0x462988);})[_0x8004('0x19')](function(_0xa581f7){_0x3fb197[_0x8004('0x49')]=_0xa581f7;return _0x3fb197;});}})[_0x8004('0x19')](respondWithFilteredResult(_0x511cfa,_0x462988))[_0x8004('0x27')](handleError(_0x511cfa,null));};exports[_0x8004('0x4a')]=function(_0x4d09e5,_0x15ccf3){return db['SmsInteraction'][_0x8004('0x32')]({'where':{'id':_0x4d09e5[_0x8004('0x35')]['id']}})[_0x8004('0x19')](handleEntityNotFound(_0x15ccf3,null))[_0x8004('0x19')](function(_0x5e5c97){if(_0x5e5c97){return _0x5e5c97[_0x8004('0x4b')](_0x4d09e5[_0x8004('0x34')][_0x8004('0x38')],_[_0x8004('0x4c')](_0x4d09e5[_0x8004('0x34')],['ids','id'])||{})[_0x8004('0x4d')](function(){return db[_0x8004('0x4e')][_0x8004('0x48')]({'attributes':['id',_0x8004('0x1d'),_0x8004('0x4f')],'where':{'id':_0x4d09e5[_0x8004('0x34')][_0x8004('0x38')]}});})[_0x8004('0x19')](function(_0x25b05c){socket['emit'](_0x8004('0x50'),{'id':Number(_0x4d09e5['params']['id']),'tags':_0x25b05c||[]});return{'id':Number(_0x4d09e5[_0x8004('0x35')]['id']),'tags':_0x25b05c||[]};});}})[_0x8004('0x19')](respondWithResult(_0x15ccf3,null))['catch'](handleError(_0x15ccf3,null));};exports[_0x8004('0x51')]=function(_0x1e1a98,_0x2548fb){return db[_0x8004('0x21')][_0x8004('0x32')]({'where':{'id':_0x1e1a98[_0x8004('0x35')]['id']}})[_0x8004('0x19')](handleEntityNotFound(_0x2548fb,null))[_0x8004('0x19')](function(_0x17338e){if(_0x17338e){return _0x17338e['removeTags'](_0x1e1a98[_0x8004('0x26')][_0x8004('0x38')]);}})['then'](respondWithStatusCode(_0x2548fb,null))[_0x8004('0x27')](handleError(_0x2548fb,null));};exports['download']=function(_0x458901,_0x9efec5){var _0x1b9bf6=moment()['unix']()[_0x8004('0x52')]();var _0x42c6e4=path['join'](config[_0x8004('0x53')],_0x8004('0x54'),_0x8004('0x55'),_0x8004('0x56'));var _0x2c8ef2=path[_0x8004('0x57')](_0x42c6e4,_0x1b9bf6);var _0x4aec51=util[_0x8004('0x46')](_0x8004('0x58'),_0x458901[_0x8004('0x35')]['id'],_0x1b9bf6);var _0x50092d=path[_0x8004('0x57')](_0x42c6e4,_0x4aec51);var _0x15eb85=[];_0x15eb85['push']({'model':db[_0x8004('0x59')],'as':_0x8004('0x59'),'attributes':['id',_0x8004('0x5a')],'raw':!![]});_0x15eb85['push']({'model':db[_0x8004('0x5b')],'as':'Contact','attributes':['id',_0x8004('0x5c'),_0x8004('0x5d')],'raw':!![]});var _0x494462=[{'model':db[_0x8004('0x37')],'as':_0x8004('0x5e'),'attributes':['id',_0x8004('0x34'),_0x8004('0x5f'),_0x8004('0x60'),_0x8004('0x61'),_0x8004('0x62')],'include':_0x15eb85}];_0x494462[_0x8004('0x63')]({'model':db[_0x8004('0x64')],'as':_0x8004('0x65'),'attributes':['id',_0x8004('0x1d')]});_0x494462[_0x8004('0x63')]({'model':db[_0x8004('0x59')],'as':'Owner','attributes':['id','fullname']});return db[_0x8004('0x21')]['find']({'where':{'id':_0x458901['params']['id']},'include':_0x494462})[_0x8004('0x19')](handleEntityNotFound(_0x9efec5,null))[_0x8004('0x19')](function(_0x45ee53){if(_0x45ee53){var _0x25e03a=_0x45ee53[_0x8004('0x66')]({'plain':!![]});fs[_0x8004('0x67')](_0x2c8ef2);var _0x132e66={'channel':_0x8004('0x68'),'account':_0x25e03a[_0x8004('0x65')][_0x8004('0x1d')],'agent':_0x25e03a[_0x8004('0x69')]?_0x25e03a[_0x8004('0x69')][_0x8004('0x5a')]:_0x8004('0x6a'),'createdAt':moment(_0x25e03a[_0x8004('0x5f')])[_0x8004('0x46')](_0x8004('0x6b'))[_0x8004('0x52')](),'closedAt':_0x25e03a['closed']?moment(_0x25e03a[_0x8004('0x6c')])[_0x8004('0x46')](_0x8004('0x6b'))['toString']():'','disposition':_0x25e03a[_0x8004('0x6d')],'messages':_(_0x25e03a[_0x8004('0x5e')])[_0x8004('0x41')]({'secret':![]})[_0x8004('0x20')](function(_0xa8583){return{'date':moment(_0xa8583['createdAt'])['format'](_0x8004('0x6b'))[_0x8004('0x52')](),'sender':_0xa8583[_0x8004('0x60')]===_0x8004('0x6e')?_0xa8583['User']?_0xa8583['User'][_0x8004('0x5a')]:_0x8004('0x6f'):_0xa8583[_0x8004('0x70')][_0x8004('0x5c')]+(_0xa8583[_0x8004('0x70')][_0x8004('0x5d')]?'\x20'+_0xa8583[_0x8004('0x70')][_0x8004('0x5d')]:''),'body':_0xa8583['body'],'direction':_0xa8583['direction']===_0x8004('0x6e')?'A':'C','secret':_0xa8583[_0x8004('0x61')],'read':_0xa8583[_0x8004('0x62')]};})[_0x8004('0x71')]()};return ejs['renderFile'](path[_0x8004('0x57')](config[_0x8004('0x53')],_0x8004('0x54'),'views',_0x8004('0x72')),{'interaction':_0x132e66})['then'](function(_0x196703){var _0x26d2c4=path[_0x8004('0x57')](_0x2c8ef2,'transcript-'+_0x25e03a['id']+'-'+_0x1b9bf6+_0x8004('0x73'));var _0x3e101b={'path':_0x26d2c4,'channel':_0x8004('0x68'),'interactionId':_0x25e03a['id']};return pdf['createPdfFromHTML'](_0x196703,_0x3e101b);})[_0x8004('0x19')](function(){return new BPromise(function(_0xc84e3,_0x4c6387){zipdir(_0x2c8ef2,{'saveTo':_0x50092d},function(_0x54e5f5,_0x2b0a86){if(_0x54e5f5)return _0x4c6387(_0x54e5f5);return _0xc84e3(_0x2b0a86);});})[_0x8004('0x19')](function(){return new BPromise(function(_0x2fb7f7,_0x1167a2){rimraf(_0x2c8ef2,function(_0x21f226){if(_0x21f226)_0x1167a2(_0x21f226);return _0x2fb7f7();});});})['then'](function(){return _0x9efec5[_0x8004('0x74')](_0x50092d,_0x4aec51,function(_0x3af652){if(_0x3af652){console[_0x8004('0x75')](_0x8004('0x76'),_0x3af652);}else{fs[_0x8004('0x77')](_0x50092d);}});});});}else{return _0x9efec5[_0x8004('0xf')](0xc8);}})[_0x8004('0x27')](handleError(_0x9efec5,null));}; \ No newline at end of file +var _0x9cdb=['index','SmsInteraction','rawAttributes','type','key','getOptions','sms','query','user','show','params','keys','filters','intersection','model','attributes','fields','includeAll','include','merge','find','catch','create','body','describe','addMessage','omit','ids','getMessages','SmsMessage','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','split','format','options','findAll','addTags','spread','Tag','color','emit','smsInteractionTags:save','unix','join','root','server','files','tmp','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','lastName','Messages','createdAt','secret','read','SmsAccount','Account','Owner','get','Sms','N.A.','YYYY-MM-DD\x20HH:mm:ss','toString','closed','closedAt','disposition','map','direction','out','System','value','renderFile','views','transcript-','.pdf','download','log','rimraf','zip-dir','bluebird','util','path','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','then','destroy','error','stack','name','send'];(function(_0x4e1584,_0x4e1b3f){var _0x1a37b8=function(_0x16cf1d){while(--_0x16cf1d){_0x4e1584['push'](_0x4e1584['shift']());}};_0x1a37b8(++_0x4e1b3f);}(_0x9cdb,0x142));var _0xb9cd=function(_0x490119,_0x491838){_0x490119=_0x490119-0x0;var _0xc46b8=_0x9cdb[_0x490119];return _0xc46b8;};'use strict';var rimraf=require(_0xb9cd('0x0'));var zipdir=require(_0xb9cd('0x1'));var moment=require('moment');var BPromise=require(_0xb9cd('0x2'));var util=require(_0xb9cd('0x3'));var path=require(_0xb9cd('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var interaction=require(_0xb9cd('0x5'));var qs=require(_0xb9cd('0x6'));var pdf=require('../../components/export/pdf');var logger=require(_0xb9cd('0x7'))(_0xb9cd('0x8'));var config=require('../../config/environment');var db=require(_0xb9cd('0x9'))['db'];config['redis']=_['defaults'](config[_0xb9cd('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xb9cd('0xb'))(new Redis(config[_0xb9cd('0xa')]));require(_0xb9cd('0xc'))[_0xb9cd('0xd')](socket);function respondWithStatusCode(_0xbddbf3,_0x54bd45){_0x54bd45=_0x54bd45||0xcc;return function(_0x3ca3c8){if(_0x3ca3c8){return _0xbddbf3[_0xb9cd('0xe')](_0x54bd45);}return _0xbddbf3[_0xb9cd('0xf')](_0x54bd45)[_0xb9cd('0x10')]();};}function respondWithResult(_0x1fa91c,_0x55e652){_0x55e652=_0x55e652||0xc8;return function(_0x3f6609){if(_0x3f6609){return _0x1fa91c[_0xb9cd('0xf')](_0x55e652)[_0xb9cd('0x11')](_0x3f6609);}};}function respondWithFilteredResult(_0x30259c,_0x4fab2d){return function(_0x247d1c){if(_0x247d1c){var _0x924e61=typeof _0x4fab2d[_0xb9cd('0x12')]===_0xb9cd('0x13')&&typeof _0x4fab2d['limit']===_0xb9cd('0x13');var _0x265c18=_0x247d1c[_0xb9cd('0x14')];var _0x4f1509=_0x924e61?0x0:_0x4fab2d['offset'];var _0x5d3250=_0x924e61?_0x247d1c[_0xb9cd('0x14')]:_0x4fab2d[_0xb9cd('0x12')]+_0x4fab2d['limit'];var _0x48d99b;if(_0x5d3250>=_0x265c18){_0x5d3250=_0x265c18;_0x48d99b=0xc8;}else{_0x48d99b=0xce;}_0x30259c[_0xb9cd('0xf')](_0x48d99b);return _0x30259c[_0xb9cd('0x15')](_0xb9cd('0x16'),_0x4f1509+'-'+_0x5d3250+'/'+_0x265c18)[_0xb9cd('0x11')](_0x247d1c);}return null;};}function saveUpdates(_0x3564f6){return function(_0x507104){if(_0x507104){return _0x507104['update'](_0x3564f6)[_0xb9cd('0x17')](function(_0x4511b7){return _0x4511b7;});}return null;};}function removeEntity(_0x27794c){return function(_0x527dd4){if(_0x527dd4){return _0x527dd4[_0xb9cd('0x18')]()[_0xb9cd('0x17')](function(){_0x27794c[_0xb9cd('0xf')](0xcc)[_0xb9cd('0x10')]();});}};}function handleEntityNotFound(_0x50055b){return function(_0xc2dc40){if(!_0xc2dc40){_0x50055b[_0xb9cd('0xe')](0x194);}return _0xc2dc40;};}function handleError(_0x58909,_0x10c3fb){_0x10c3fb=_0x10c3fb||0x1f4;return function(_0x37cbfc){logger[_0xb9cd('0x19')](_0x37cbfc[_0xb9cd('0x1a')]);if(_0x37cbfc[_0xb9cd('0x1b')]){delete _0x37cbfc['name'];}_0x58909['status'](_0x10c3fb)[_0xb9cd('0x1c')](_0x37cbfc);};}exports[_0xb9cd('0x1d')]=function(_0x45c4f2,_0x5f102c){var _0x15da18={};var _0x33c1a9=_['map'](db[_0xb9cd('0x1e')][_0xb9cd('0x1f')],function(_0x35e11a){return{'name':_0x35e11a['fieldName'],'type':_0x35e11a[_0xb9cd('0x20')][_0xb9cd('0x21')]};});_0x15da18=qs[_0xb9cd('0x22')](_0x33c1a9,_0x45c4f2);return interaction['findAll'](_0xb9cd('0x23'),_0x45c4f2[_0xb9cd('0x24')],_0x45c4f2[_0xb9cd('0x25')],_0x15da18,_0x33c1a9)[_0xb9cd('0x17')](respondWithFilteredResult(_0x5f102c,_0x15da18))['catch'](handleError(_0x5f102c,null));};exports[_0xb9cd('0x26')]=function(_0x354a20,_0x332a92){var _0x270eec={'raw':![],'where':{'id':_0x354a20[_0xb9cd('0x27')]['id']}},_0x4adb50={};_0x4adb50['model']=_['keys'](db['SmsInteraction'][_0xb9cd('0x1f')]);_0x4adb50['query']=_[_0xb9cd('0x28')](_0x354a20['query']);_0x4adb50[_0xb9cd('0x29')]=_[_0xb9cd('0x2a')](_0x4adb50[_0xb9cd('0x2b')],_0x4adb50['query']);_0x270eec[_0xb9cd('0x2c')]=_[_0xb9cd('0x2a')](_0x4adb50[_0xb9cd('0x2b')],qs[_0xb9cd('0x2d')](_0x354a20[_0xb9cd('0x24')][_0xb9cd('0x2d')]));_0x270eec[_0xb9cd('0x2c')]=_0x270eec[_0xb9cd('0x2c')]['length']?_0x270eec['attributes']:_0x4adb50[_0xb9cd('0x2b')];if(_0x354a20[_0xb9cd('0x24')][_0xb9cd('0x2e')]){_0x270eec[_0xb9cd('0x2f')]=[{'all':!![]}];}_0x270eec=_[_0xb9cd('0x30')]({},_0x270eec,_0x354a20['options']);return db['SmsInteraction'][_0xb9cd('0x31')](_0x270eec)['then'](handleEntityNotFound(_0x332a92,null))[_0xb9cd('0x17')](respondWithResult(_0x332a92,null))[_0xb9cd('0x32')](handleError(_0x332a92,null));};exports[_0xb9cd('0x33')]=function(_0x1bf2be,_0x3e21ae){return db['SmsInteraction'][_0xb9cd('0x33')](_0x1bf2be['body'],{})[_0xb9cd('0x17')](respondWithResult(_0x3e21ae,0xc9))['catch'](handleError(_0x3e21ae,null));};exports['update']=function(_0x4cbda5,_0x59f3e1){if(_0x4cbda5['body']['id']){delete _0x4cbda5['body']['id'];}return db[_0xb9cd('0x1e')]['find']({'where':{'id':_0x4cbda5[_0xb9cd('0x27')]['id']}})[_0xb9cd('0x17')](handleEntityNotFound(_0x59f3e1,null))[_0xb9cd('0x17')](saveUpdates(_0x4cbda5[_0xb9cd('0x34')],null))['then'](respondWithResult(_0x59f3e1,null))[_0xb9cd('0x32')](handleError(_0x59f3e1,null));};exports['destroy']=function(_0x3c64d9,_0x9129d7){return db[_0xb9cd('0x1e')]['find']({'where':{'id':_0x3c64d9['params']['id']}})[_0xb9cd('0x17')](handleEntityNotFound(_0x9129d7,null))[_0xb9cd('0x17')](removeEntity(_0x9129d7,null))[_0xb9cd('0x32')](handleError(_0x9129d7,null));};exports[_0xb9cd('0x35')]=function(_0x1d769c,_0x51c272){return db[_0xb9cd('0x1e')][_0xb9cd('0x35')]()['then'](respondWithResult(_0x51c272,null))['catch'](handleError(_0x51c272,null));};exports[_0xb9cd('0x36')]=function(_0x8a85fa,_0x261792){return db['SmsMessage'][_0xb9cd('0x31')]({'where':{'id':_0x8a85fa['params']['id']}})[_0xb9cd('0x17')](handleEntityNotFound(_0x261792,null))[_0xb9cd('0x17')](function(_0x50e3cc){if(_0x50e3cc){return _0x50e3cc[_0xb9cd('0x36')](_0x8a85fa[_0xb9cd('0x34')]['ids'],_[_0xb9cd('0x37')](_0x8a85fa[_0xb9cd('0x34')],[_0xb9cd('0x38'),'id'])||{});}})[_0xb9cd('0x17')](respondWithResult(_0x261792,null))[_0xb9cd('0x32')](handleError(_0x261792,null));};exports[_0xb9cd('0x39')]=function(_0x4226a4,_0x1e54c7){var _0x25f1f8={'raw':![],'where':{}};var _0x31cf66={};var _0x9004={'count':0x0,'rows':[]};return db[_0xb9cd('0x1e')]['findOne']({'where':{'id':_0x4226a4[_0xb9cd('0x27')]['id']}})[_0xb9cd('0x17')](handleEntityNotFound(_0x1e54c7,null))[_0xb9cd('0x17')](function(_0xd246c5){if(_0xd246c5){_0x31cf66[_0xb9cd('0x2b')]=_['keys'](db[_0xb9cd('0x3a')]['rawAttributes']);_0x31cf66['query']=_[_0xb9cd('0x28')](_0x4226a4['query']);_0x31cf66['filters']=_[_0xb9cd('0x2a')](_0x31cf66['model'],_0x31cf66[_0xb9cd('0x24')]);_0x25f1f8[_0xb9cd('0x2c')]=_[_0xb9cd('0x2a')](_0x31cf66[_0xb9cd('0x2b')],qs['fields'](_0x4226a4[_0xb9cd('0x24')][_0xb9cd('0x2d')]));_0x25f1f8['attributes']=_0x25f1f8[_0xb9cd('0x2c')][_0xb9cd('0x3b')]?_0x25f1f8[_0xb9cd('0x2c')]:_0x31cf66['model'];if(!_0x4226a4['query'][_0xb9cd('0x3c')](_0xb9cd('0x3d'))){_0x25f1f8[_0xb9cd('0x3e')]=qs[_0xb9cd('0x3e')](_0x4226a4[_0xb9cd('0x24')][_0xb9cd('0x3e')]);_0x25f1f8[_0xb9cd('0x12')]=qs[_0xb9cd('0x12')](_0x4226a4[_0xb9cd('0x24')][_0xb9cd('0x12')]);}_0x25f1f8['order']=qs[_0xb9cd('0x3f')](_0x4226a4[_0xb9cd('0x24')][_0xb9cd('0x3f')]);_0x25f1f8['where']=qs[_0xb9cd('0x29')](_[_0xb9cd('0x40')](_0x4226a4['query'],_0x31cf66[_0xb9cd('0x29')]));_0x25f1f8['where']['SmsInteractionId']=_0xd246c5['id'];if(_0x4226a4[_0xb9cd('0x24')][_0xb9cd('0x41')]){_0x25f1f8[_0xb9cd('0x42')]=_[_0xb9cd('0x30')](_0x25f1f8['where'],{'$or':_['map'](_0x25f1f8['attributes'],function(_0x2bf0bd){var _0x4c4561={};_0x4c4561[_0x2bf0bd]={'$like':'%'+_0x4226a4[_0xb9cd('0x24')][_0xb9cd('0x41')]+'%'};return _0x4c4561;})});}if(_0x4226a4[_0xb9cd('0x24')]['$gte']){var _0xb91a16=_0x4226a4['query']['$gte'][_0xb9cd('0x43')](',');var _0xa65cb1={};_0xa65cb1[_0xb91a16[0x0]]={'$gte':moment(_0xb91a16[0x1])[_0xb9cd('0x44')]('YYYY-MM-DD\x20HH:mm:ss')};_0x25f1f8[_0xb9cd('0x42')]=_['merge'](_0x25f1f8['where'],_0xa65cb1);}_0x25f1f8=_[_0xb9cd('0x30')]({},_0x25f1f8,_0x4226a4[_0xb9cd('0x45')]);return db[_0xb9cd('0x3a')][_0xb9cd('0x14')]({'where':_0x25f1f8['where']})[_0xb9cd('0x17')](function(_0x4783ef){_0x9004['count']=_0x4783ef;if(_0x4226a4[_0xb9cd('0x24')]['includeAll']){_0x25f1f8[_0xb9cd('0x2f')]=[{'all':!![]}];}return db[_0xb9cd('0x3a')][_0xb9cd('0x46')](_0x25f1f8);})[_0xb9cd('0x17')](function(_0x5096b7){_0x9004['rows']=_0x5096b7;return _0x9004;});}})['then'](respondWithFilteredResult(_0x1e54c7,_0x25f1f8))[_0xb9cd('0x32')](handleError(_0x1e54c7,null));};exports[_0xb9cd('0x47')]=function(_0x1c130d,_0x3e0f01){return db[_0xb9cd('0x1e')]['find']({'where':{'id':_0x1c130d[_0xb9cd('0x27')]['id']}})[_0xb9cd('0x17')](handleEntityNotFound(_0x3e0f01,null))['then'](function(_0x32434a){if(_0x32434a){return _0x32434a['setTags'](_0x1c130d[_0xb9cd('0x34')]['ids'],_[_0xb9cd('0x37')](_0x1c130d['body'],[_0xb9cd('0x38'),'id'])||{})[_0xb9cd('0x48')](function(){return db[_0xb9cd('0x49')][_0xb9cd('0x46')]({'attributes':['id',_0xb9cd('0x1b'),_0xb9cd('0x4a')],'where':{'id':_0x1c130d[_0xb9cd('0x34')][_0xb9cd('0x38')]}});})[_0xb9cd('0x17')](function(_0xcb25ec){socket[_0xb9cd('0x4b')](_0xb9cd('0x4c'),{'id':Number(_0x1c130d[_0xb9cd('0x27')]['id']),'tags':_0xcb25ec||[]});return{'id':Number(_0x1c130d['params']['id']),'tags':_0xcb25ec||[]};});}})['then'](respondWithResult(_0x3e0f01,null))[_0xb9cd('0x32')](handleError(_0x3e0f01,null));};exports['removeTags']=function(_0x5940b9,_0x44f4b4){return db[_0xb9cd('0x1e')][_0xb9cd('0x31')]({'where':{'id':_0x5940b9[_0xb9cd('0x27')]['id']}})[_0xb9cd('0x17')](handleEntityNotFound(_0x44f4b4,null))[_0xb9cd('0x17')](function(_0x55a975){if(_0x55a975){return _0x55a975['removeTags'](_0x5940b9[_0xb9cd('0x24')][_0xb9cd('0x38')]);}})[_0xb9cd('0x17')](respondWithStatusCode(_0x44f4b4,null))['catch'](handleError(_0x44f4b4,null));};exports['download']=function(_0x569926,_0x4e356c){var _0x1fb679=moment()[_0xb9cd('0x4d')]()['toString']();var _0x30b448=path[_0xb9cd('0x4e')](config[_0xb9cd('0x4f')],_0xb9cd('0x50'),_0xb9cd('0x51'),_0xb9cd('0x52'));var _0x2f3973=path[_0xb9cd('0x4e')](_0x30b448,_0x1fb679);var _0x36662e=util['format'](_0xb9cd('0x53'),_0x569926['params']['id'],_0x1fb679);var _0xe78d3f=path[_0xb9cd('0x4e')](_0x30b448,_0x36662e);var _0x23fba1=[];_0x23fba1[_0xb9cd('0x54')]({'model':db[_0xb9cd('0x55')],'as':'User','attributes':['id',_0xb9cd('0x56')],'raw':!![]});_0x23fba1[_0xb9cd('0x54')]({'model':db[_0xb9cd('0x57')],'as':_0xb9cd('0x58'),'attributes':['id',_0xb9cd('0x59'),_0xb9cd('0x5a')],'raw':!![]});var _0x326bff=[{'model':db['SmsMessage'],'as':_0xb9cd('0x5b'),'attributes':['id',_0xb9cd('0x34'),_0xb9cd('0x5c'),'direction',_0xb9cd('0x5d'),_0xb9cd('0x5e')],'include':_0x23fba1}];_0x326bff[_0xb9cd('0x54')]({'model':db[_0xb9cd('0x5f')],'as':_0xb9cd('0x60'),'attributes':['id',_0xb9cd('0x1b')]});_0x326bff[_0xb9cd('0x54')]({'model':db['User'],'as':_0xb9cd('0x61'),'attributes':['id',_0xb9cd('0x56')]});return db[_0xb9cd('0x1e')][_0xb9cd('0x31')]({'where':{'id':_0x569926[_0xb9cd('0x27')]['id']},'include':_0x326bff})[_0xb9cd('0x17')](handleEntityNotFound(_0x4e356c,null))[_0xb9cd('0x17')](function(_0x25c403){if(_0x25c403){var _0x465d43=_0x25c403[_0xb9cd('0x62')]({'plain':!![]});fs['mkdirSync'](_0x2f3973);var _0x296ec5={'channel':_0xb9cd('0x63'),'account':_0x465d43[_0xb9cd('0x60')][_0xb9cd('0x1b')],'agent':_0x465d43['Owner']?_0x465d43['Owner'][_0xb9cd('0x56')]:_0xb9cd('0x64'),'createdAt':moment(_0x465d43[_0xb9cd('0x5c')])[_0xb9cd('0x44')](_0xb9cd('0x65'))[_0xb9cd('0x66')](),'closedAt':_0x465d43[_0xb9cd('0x67')]?moment(_0x465d43[_0xb9cd('0x68')])[_0xb9cd('0x44')](_0xb9cd('0x65'))[_0xb9cd('0x66')]():'','disposition':_0x465d43[_0xb9cd('0x69')],'messages':_(_0x465d43['Messages'])['filter']({'secret':![]})[_0xb9cd('0x6a')](function(_0x3e3056){return{'date':moment(_0x3e3056[_0xb9cd('0x5c')])[_0xb9cd('0x44')]('YYYY-MM-DD\x20HH:mm:ss')[_0xb9cd('0x66')](),'sender':_0x3e3056[_0xb9cd('0x6b')]===_0xb9cd('0x6c')?_0x3e3056['User']?_0x3e3056['User'][_0xb9cd('0x56')]:_0xb9cd('0x6d'):_0x3e3056[_0xb9cd('0x58')][_0xb9cd('0x59')]+(_0x3e3056[_0xb9cd('0x58')][_0xb9cd('0x5a')]?'\x20'+_0x3e3056[_0xb9cd('0x58')]['lastName']:''),'body':_0x3e3056[_0xb9cd('0x34')],'direction':_0x3e3056[_0xb9cd('0x6b')]===_0xb9cd('0x6c')?'A':'C','secret':_0x3e3056[_0xb9cd('0x5d')],'read':_0x3e3056[_0xb9cd('0x5e')]};})[_0xb9cd('0x6e')]()};return ejs[_0xb9cd('0x6f')](path[_0xb9cd('0x4e')](config['root'],_0xb9cd('0x50'),_0xb9cd('0x70'),'downloadInteraction.ejs'),{'interaction':_0x296ec5})[_0xb9cd('0x17')](function(_0x489e91){var _0x480a0a=path['join'](_0x2f3973,_0xb9cd('0x71')+_0x465d43['id']+'-'+_0x1fb679+_0xb9cd('0x72'));var _0x26bdc4={'path':_0x480a0a,'channel':_0xb9cd('0x63'),'interactionId':_0x465d43['id']};return pdf['createPdfFromHTML'](_0x489e91,_0x26bdc4);})[_0xb9cd('0x17')](function(){return new BPromise(function(_0x47d89c,_0x1db0e1){zipdir(_0x2f3973,{'saveTo':_0xe78d3f},function(_0x5ed5b3,_0x3190c8){if(_0x5ed5b3)return _0x1db0e1(_0x5ed5b3);return _0x47d89c(_0x3190c8);});})[_0xb9cd('0x17')](function(){return new BPromise(function(_0x48f508,_0x5152a7){rimraf(_0x2f3973,function(_0x47b672){if(_0x47b672)_0x5152a7(_0x47b672);return _0x48f508();});});})[_0xb9cd('0x17')](function(){return _0x4e356c[_0xb9cd('0x73')](_0xe78d3f,_0x36662e,function(_0x3047f3){if(_0x3047f3){console[_0xb9cd('0x74')]('err',_0x3047f3);}else{fs['unlinkSync'](_0xe78d3f);}});});});}else{return _0x4e356c[_0xb9cd('0xe')](0xc8);}})[_0xb9cd('0x32')](handleError(_0x4e356c,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 941113e..d0bfd48 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 _0xd7d1=['SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x233b67,_0x3a93e6){var _0x285bd7=function(_0x166484){while(--_0x166484){_0x233b67['push'](_0x233b67['shift']());}};_0x285bd7(++_0x3a93e6);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x12c4b2,_0x530cad){_0x12c4b2=_0x12c4b2-0x0;var _0x3b7746=_0xd7d1[_0x12c4b2];return _0x3b7746;};'use strict';var EventEmitter=require(_0x1d7d('0x0'));var SmsInteraction=require(_0x1d7d('0x1'))['db'][_0x1d7d('0x2')];var SmsMessage=require(_0x1d7d('0x1'))['db'][_0x1d7d('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x1d7d('0x4')](0x0);var events={'afterCreate':_0x1d7d('0x5'),'afterUpdate':_0x1d7d('0x6'),'afterDestroy':_0x1d7d('0x7')};function emitEvent(_0x1adb6b){return function(_0x3c0839,_0x1a2564,_0x14b2b9){_0x3c0839['getUsers']({'attributes':['id'],'raw':!![]})[_0x1d7d('0x8')](function(_0x1aa456){_0x3c0839[_0x1d7d('0x9')](_0x1d7d('0xa'),_0x1aa456[_0x1d7d('0xb')](function(_0x268732){return{'id':_0x268732['id']};}));return SmsMessage[_0x1d7d('0xc')]({'where':{'SmsInteractionId':_0x3c0839['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1d7d('0x8')](function(_0x1ad06f){_0x3c0839[_0x1d7d('0x9')](_0x1d7d('0xd'),_0x1ad06f['length']);SmsInteractionEvents[_0x1d7d('0xe')](_0x1adb6b+':'+_0x3c0839['id'],_0x3c0839);SmsInteractionEvents['emit'](_0x1adb6b,_0x3c0839);_0x14b2b9(null);})[_0x1d7d('0xf')](_0x14b2b9(null));};}for(var e in events){if(events[_0x1d7d('0x10')](e)){var event=events[e];SmsInteraction[_0x1d7d('0x11')](e,emitEvent(event));}}module[_0x1d7d('0x12')]=SmsInteractionEvents; \ No newline at end of file +var _0x8603=['update','remove','getUsers','then','setDataValue','findAll','unreadMessages','emit','hasOwnProperty','hook','../../mysqldb','SmsInteraction','save'];(function(_0x559a7b,_0x467226){var _0x478601=function(_0x24e81){while(--_0x24e81){_0x559a7b['push'](_0x559a7b['shift']());}};_0x478601(++_0x467226);}(_0x8603,0x190));var _0x3860=function(_0x311e39,_0x21f955){_0x311e39=_0x311e39-0x0;var _0x40687b=_0x8603[_0x311e39];return _0x40687b;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x3860('0x0'))['db'][_0x3860('0x1')];var SmsMessage=require(_0x3860('0x0'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3860('0x2'),'afterUpdate':_0x3860('0x3'),'afterDestroy':_0x3860('0x4')};function emitEvent(_0x490262){return function(_0x2fc97a,_0x56f8c5,_0xb0fc24){_0x2fc97a[_0x3860('0x5')]({'attributes':['id'],'raw':!![]})[_0x3860('0x6')](function(_0xd3ce26){_0x2fc97a[_0x3860('0x7')]('Users',_0xd3ce26['map'](function(_0x5b1ac8){return{'id':_0x5b1ac8['id']};}));return SmsMessage[_0x3860('0x8')]({'where':{'SmsInteractionId':_0x2fc97a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3860('0x6')](function(_0x52c277){_0x2fc97a[_0x3860('0x7')](_0x3860('0x9'),_0x52c277['length']);SmsInteractionEvents[_0x3860('0xa')](_0x490262+':'+_0x2fc97a['id'],_0x2fc97a);SmsInteractionEvents[_0x3860('0xa')](_0x490262,_0x2fc97a);_0xb0fc24(null);})['catch'](_0xb0fc24(null));};}for(var e in events){if(events[_0x3860('0xb')](e)){var event=events[e];SmsInteraction[_0x3860('0xc')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 0953c74..851794d 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 _0x0660=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api'];(function(_0x4e30fd,_0x3bad15){var _0x2f1c1e=function(_0x1dcce){while(--_0x1dcce){_0x4e30fd['push'](_0x4e30fd['shift']());}};_0x2f1c1e(++_0x3bad15);}(_0x0660,0x6d));var _0x0066=function(_0x1db41a,_0x4e31a3){_0x1db41a=_0x1db41a-0x0;var _0x1c49e1=_0x0660[_0x1db41a];return _0x1c49e1;};'use strict';var _=require(_0x0066('0x0'));var util=require(_0x0066('0x1'));var logger=require('../../config/logger')(_0x0066('0x2'));var moment=require(_0x0066('0x3'));var BPromise=require(_0x0066('0x4'));var rp=require(_0x0066('0x5'));var fs=require('fs');var path=require(_0x0066('0x6'));var rimraf=require(_0x0066('0x7'));var config=require(_0x0066('0x8'));var attributes=require(_0x0066('0x9'));module[_0x0066('0xa')]=function(_0x15d534,_0x35bfbc){return _0x15d534['define']('SmsInteraction',attributes,{'tableName':_0x0066('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xb1410f,_0x30c1f2,_0x339de6){if(_0xb1410f[_0x0066('0xc')](_0x0066('0xd'))){_0xb1410f[_0x0066('0xe')]=moment()['format'](_0x0066('0xf'));}_0x339de6(null,_0xb1410f);}}});}; \ No newline at end of file +var _0x2af8=['request-promise','define','SmsInteraction','sms_interactions','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird'];(function(_0x1f7a11,_0x46c2bf){var _0x2d5f62=function(_0x125899){while(--_0x125899){_0x1f7a11['push'](_0x1f7a11['shift']());}};_0x2d5f62(++_0x46c2bf);}(_0x2af8,0x192));var _0x82af=function(_0x6a4474,_0x5b68e1){_0x6a4474=_0x6a4474-0x0;var _0x2606f7=_0x2af8[_0x6a4474];return _0x2606f7;};'use strict';var _=require('lodash');var util=require(_0x82af('0x0'));var logger=require(_0x82af('0x1'))(_0x82af('0x2'));var moment=require(_0x82af('0x3'));var BPromise=require(_0x82af('0x4'));var rp=require(_0x82af('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x3f4f10,_0x4692b3){return _0x3f4f10[_0x82af('0x6')](_0x82af('0x7'),attributes,{'tableName':_0x82af('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xd1166a,_0x256465,_0x80e784){if(_0xd1166a['changed']('closed')){_0xd1166a['closedAt']=moment()[_0x82af('0x9')](_0x82af('0xa'));}_0x80e784(null,_0xd1166a);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 671f380..d7cb09d 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 _0x23fe=['localhost','socket.io-emitter','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','UpdateSmsInteraction','SmsInteraction','body','raw','options','where','attributes','limit','stringify','AddTagsToSmsInteraction','find','addTags','omit','ids','AddTags','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x4f91a0,_0x44e433){var _0x5b3608=function(_0x277071){while(--_0x277071){_0x4f91a0['push'](_0x4f91a0['shift']());}};_0x5b3608(++_0x44e433);}(_0x23fe,0x1ab));var _0xe23f=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0x23fe[_0x45f951];return _0x24756c;};'use strict';var _=require(_0xe23f('0x0'));var util=require(_0xe23f('0x1'));var moment=require(_0xe23f('0x2'));var BPromise=require(_0xe23f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe23f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe23f('0x5'));var logger=require(_0xe23f('0x6'))(_0xe23f('0x7'));var config=require(_0xe23f('0x8'));var jayson=require(_0xe23f('0x9'));var client=jayson[_0xe23f('0xa')][_0xe23f('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xe23f('0xc')],{'host':_0xe23f('0xd'),'port':0x18eb});var socket=require(_0xe23f('0xe'))(new Redis(config[_0xe23f('0xc')]));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0xeed7a4,_0x50fb6c,_0x53bce2){return new BPromise(function(_0x23f805,_0x157569){return client[_0xe23f('0xf')](_0xeed7a4,_0x53bce2)[_0xe23f('0x10')](function(_0x343b32){logger[_0xe23f('0x11')](_0xe23f('0x12'),_0x50fb6c,_0xe23f('0x13'));logger[_0xe23f('0x14')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x50fb6c,_0xe23f('0x13'),JSON['stringify'](_0x343b32));if(_0x343b32['error']){if(_0x343b32[_0xe23f('0x15')]['code']===0x1f4){logger[_0xe23f('0x15')](_0xe23f('0x12'),_0x50fb6c,_0x343b32[_0xe23f('0x15')][_0xe23f('0x16')]);return _0x157569(_0x343b32['error']['message']);}logger[_0xe23f('0x15')](_0xe23f('0x12'),_0x50fb6c,_0x343b32['error'][_0xe23f('0x16')]);return _0x23f805(_0x343b32['error'][_0xe23f('0x16')]);}else{logger[_0xe23f('0x11')](_0xe23f('0x12'),_0x50fb6c,'request\x20sent');_0x23f805(_0x343b32[_0xe23f('0x17')]['message']);}})[_0xe23f('0x18')](function(_0x2180c8){logger[_0xe23f('0x15')](_0xe23f('0x12'),_0x50fb6c,_0x2180c8);_0x157569(_0x2180c8);});});}exports[_0xe23f('0x19')]=function(_0x30dbdb){var _0x23f538=this;return new Promise(function(_0x10d60f,_0x2d1308){return db[_0xe23f('0x1a')]['update'](_0x30dbdb[_0xe23f('0x1b')],{'raw':_0x30dbdb['options']?_0x30dbdb['options'][_0xe23f('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30dbdb[_0xe23f('0x1d')]?_0x30dbdb[_0xe23f('0x1d')][_0xe23f('0x1e')]||null:null,'attributes':_0x30dbdb[_0xe23f('0x1d')]?_0x30dbdb[_0xe23f('0x1d')][_0xe23f('0x1f')]||null:null,'limit':_0x30dbdb[_0xe23f('0x1d')]?_0x30dbdb[_0xe23f('0x1d')][_0xe23f('0x20')]||null:null})[_0xe23f('0x10')](function(_0x18e305){logger[_0xe23f('0x11')]('UpdateSmsInteraction',_0x30dbdb);logger[_0xe23f('0x14')](_0xe23f('0x19'),_0x30dbdb,JSON[_0xe23f('0x21')](_0x18e305));_0x10d60f(_0x18e305);})['catch'](function(_0xd3c560){logger[_0xe23f('0x15')](_0xe23f('0x19'),_0xd3c560[_0xe23f('0x16')],_0x30dbdb);_0x2d1308(_0x23f538[_0xe23f('0x15')](0x1f4,_0xd3c560[_0xe23f('0x16')]));});});};exports[_0xe23f('0x22')]=function(_0x120bca){return new Promise(function(_0x4d60d9,_0x1ffd06){return db['SmsInteraction'][_0xe23f('0x23')]({'where':_0x120bca[_0xe23f('0x1d')]?_0x120bca[_0xe23f('0x1d')][_0xe23f('0x1e')]||null:null})['then'](function(_0x4d42f7){if(_0x4d42f7){return _0x4d42f7[_0xe23f('0x24')](_0x120bca[_0xe23f('0x1b')]['ids'],_[_0xe23f('0x25')](_0x120bca['body'],[_0xe23f('0x26'),'id'])||{});}})['spread'](function(_0x1a0c74){logger['info'](_0xe23f('0x27'),_0x120bca);logger[_0xe23f('0x14')](_0xe23f('0x27'),_0x120bca,JSON[_0xe23f('0x21')](_0x1a0c74));_0x4d60d9(_0x1a0c74);})[_0xe23f('0x18')](function(_0x38d21b){logger[_0xe23f('0x15')]('AddTags',_0x38d21b[_0xe23f('0x16')],_0x120bca);_0x1ffd06(_this[_0xe23f('0x15')](0x1f4,_0x38d21b[_0xe23f('0x16')]));});});}; \ No newline at end of file +var _0x3e5d=['options','raw','attributes','limit','UpdateSmsInteraction','where','addTags','body','omit','AddTags','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','update'];(function(_0x19d829,_0xdff57){var _0x5c5394=function(_0x24d9ef){while(--_0x24d9ef){_0x19d829['push'](_0x19d829['shift']());}};_0x5c5394(++_0xdff57);}(_0x3e5d,0x1df));var _0xd3e5=function(_0x5db875,_0x10573e){_0x5db875=_0x5db875-0x0;var _0xde9c65=_0x3e5d[_0x5db875];return _0xde9c65;};'use strict';var _=require(_0xd3e5('0x0'));var util=require(_0xd3e5('0x1'));var moment=require(_0xd3e5('0x2'));var BPromise=require(_0xd3e5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd3e5('0x4'));var db=require(_0xd3e5('0x5'))['db'];var utils=require(_0xd3e5('0x6'));var logger=require(_0xd3e5('0x7'))(_0xd3e5('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd3e5('0x9')]['http']({'port':0x232a});config[_0xd3e5('0xa')]=_[_0xd3e5('0xb')](config[_0xd3e5('0xa')],{'host':_0xd3e5('0xc'),'port':0x18eb});var socket=require(_0xd3e5('0xd'))(new Redis(config[_0xd3e5('0xa')]));require(_0xd3e5('0xe'))['register'](socket);function respondWithRpcPromise(_0x3ef882,_0x355dba,_0x2bb585){return new BPromise(function(_0x377a1,_0x30b5da){return client[_0xd3e5('0xf')](_0x3ef882,_0x2bb585)[_0xd3e5('0x10')](function(_0x15a18f){logger[_0xd3e5('0x11')](_0xd3e5('0x12'),_0x355dba,_0xd3e5('0x13'));logger[_0xd3e5('0x14')](_0xd3e5('0x15'),_0x355dba,_0xd3e5('0x13'),JSON['stringify'](_0x15a18f));if(_0x15a18f[_0xd3e5('0x16')]){if(_0x15a18f[_0xd3e5('0x16')][_0xd3e5('0x17')]===0x1f4){logger[_0xd3e5('0x16')](_0xd3e5('0x12'),_0x355dba,_0x15a18f[_0xd3e5('0x16')][_0xd3e5('0x18')]);return _0x30b5da(_0x15a18f['error'][_0xd3e5('0x18')]);}logger['error'](_0xd3e5('0x12'),_0x355dba,_0x15a18f[_0xd3e5('0x16')][_0xd3e5('0x18')]);return _0x377a1(_0x15a18f[_0xd3e5('0x16')][_0xd3e5('0x18')]);}else{logger[_0xd3e5('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x355dba,'request\x20sent');_0x377a1(_0x15a18f[_0xd3e5('0x19')][_0xd3e5('0x18')]);}})[_0xd3e5('0x1a')](function(_0x5c9f3b){logger[_0xd3e5('0x16')](_0xd3e5('0x12'),_0x355dba,_0x5c9f3b);_0x30b5da(_0x5c9f3b);});});}exports['UpdateSmsInteraction']=function(_0x23c052){var _0x8e8cfa=this;return new Promise(function(_0x4c23a1,_0x1fefe1){return db['SmsInteraction'][_0xd3e5('0x1b')](_0x23c052['body'],{'raw':_0x23c052[_0xd3e5('0x1c')]?_0x23c052[_0xd3e5('0x1c')][_0xd3e5('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23c052['options']?_0x23c052[_0xd3e5('0x1c')]['where']||null:null,'attributes':_0x23c052[_0xd3e5('0x1c')]?_0x23c052[_0xd3e5('0x1c')][_0xd3e5('0x1e')]||null:null,'limit':_0x23c052['options']?_0x23c052['options'][_0xd3e5('0x1f')]||null:null})[_0xd3e5('0x10')](function(_0x7c3b58){logger[_0xd3e5('0x11')]('UpdateSmsInteraction',_0x23c052);logger[_0xd3e5('0x14')]('UpdateSmsInteraction',_0x23c052,JSON['stringify'](_0x7c3b58));_0x4c23a1(_0x7c3b58);})[_0xd3e5('0x1a')](function(_0x3f5a6c){logger[_0xd3e5('0x16')](_0xd3e5('0x20'),_0x3f5a6c[_0xd3e5('0x18')],_0x23c052);_0x1fefe1(_0x8e8cfa[_0xd3e5('0x16')](0x1f4,_0x3f5a6c[_0xd3e5('0x18')]));});});};exports['AddTagsToSmsInteraction']=function(_0x36a3e9){return new Promise(function(_0x457d1e,_0x2d1a46){return db['SmsInteraction']['find']({'where':_0x36a3e9[_0xd3e5('0x1c')]?_0x36a3e9[_0xd3e5('0x1c')][_0xd3e5('0x21')]||null:null})[_0xd3e5('0x10')](function(_0x547a97){if(_0x547a97){return _0x547a97[_0xd3e5('0x22')](_0x36a3e9[_0xd3e5('0x23')]['ids'],_[_0xd3e5('0x24')](_0x36a3e9[_0xd3e5('0x23')],['ids','id'])||{});}})['spread'](function(_0x2753bb){logger[_0xd3e5('0x11')](_0xd3e5('0x25'),_0x36a3e9);logger[_0xd3e5('0x14')](_0xd3e5('0x25'),_0x36a3e9,JSON[_0xd3e5('0x26')](_0x2753bb));_0x457d1e(_0x2753bb);})[_0xd3e5('0x1a')](function(_0x2ab27e){logger[_0xd3e5('0x16')](_0xd3e5('0x25'),_0x2ab27e[_0xd3e5('0x18')],_0x36a3e9);_0x2d1a46(_this[_0xd3e5('0x16')](0x1f4,_0x2ab27e['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index e9cb559..f8b7462 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 _0x0c05=['length','smsInteraction:','./smsInteraction.events','remove','update','register'];(function(_0x3046a2,_0x2d8157){var _0x17d280=function(_0x549be1){while(--_0x549be1){_0x3046a2['push'](_0x3046a2['shift']());}};_0x17d280(++_0x2d8157);}(_0x0c05,0xe0));var _0x50c0=function(_0x3c24c3,_0x39888b){_0x3c24c3=_0x3c24c3-0x0;var _0x23e5e0=_0x0c05[_0x3c24c3];return _0x23e5e0;};'use strict';var SmsInteractionEvents=require(_0x50c0('0x0'));var events=['save',_0x50c0('0x1'),_0x50c0('0x2')];function createListener(_0x34ef58,_0x5f3759){return function(_0x51ba45){_0x5f3759['emit'](_0x34ef58,_0x51ba45);};}function removeListener(_0x17b982,_0x1ebeeb){return function(){SmsInteractionEvents['removeListener'](_0x17b982,_0x1ebeeb);};}exports[_0x50c0('0x3')]=function(_0x54b636){for(var _0x2c40b5=0x0,_0x3ff58d=events[_0x50c0('0x4')];_0x2c40b5<_0x3ff58d;_0x2c40b5++){var _0x18a57c=events[_0x2c40b5];var _0x1ec9f0=createListener(_0x50c0('0x5')+_0x18a57c,_0x54b636);SmsInteractionEvents['on'](_0x18a57c,_0x1ec9f0);}}; \ No newline at end of file +var _0x4f9f=['register','smsInteraction:','./smsInteraction.events','save','update','removeListener'];(function(_0x519a04,_0x38408e){var _0x210a84=function(_0x2158f3){while(--_0x2158f3){_0x519a04['push'](_0x519a04['shift']());}};_0x210a84(++_0x38408e);}(_0x4f9f,0x1dc));var _0xf4f9=function(_0xc82d1a,_0x145c50){_0xc82d1a=_0xc82d1a-0x0;var _0x32fad2=_0x4f9f[_0xc82d1a];return _0x32fad2;};'use strict';var SmsInteractionEvents=require(_0xf4f9('0x0'));var events=[_0xf4f9('0x1'),'remove',_0xf4f9('0x2')];function createListener(_0x5ea325,_0x1047de){return function(_0x4ef819){_0x1047de['emit'](_0x5ea325,_0x4ef819);};}function removeListener(_0x5f42ca,_0x10b93e){return function(){SmsInteractionEvents[_0xf4f9('0x3')](_0x5f42ca,_0x10b93e);};}exports[_0xf4f9('0x4')]=function(_0x33359a){for(var _0x1de6b0=0x0,_0x2cdce5=events['length'];_0x1de6b0<_0x2cdce5;_0x1de6b0++){var _0x408a3f=events[_0x1de6b0];var _0x4675f7=createListener(_0xf4f9('0x5')+_0x408a3f,_0x33359a);SmsInteractionEvents['on'](_0x408a3f,_0x4675f7);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index f5fbf43..4fa6758 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 _0x5e3b=['tracked','sms','smsmessage:create','create','/:id/status','status','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','fs-extra','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x1c6866,_0x5db355){var _0x4193ee=function(_0x554494){while(--_0x554494){_0x1c6866['push'](_0x1c6866['shift']());}};_0x4193ee(++_0x5db355);}(_0x5e3b,0x79));var _0xb5e3=function(_0x44deb0,_0x36cdc4){_0x44deb0=_0x44deb0-0x0;var _0x859d5c=_0x5e3b[_0x44deb0];return _0x859d5c;};'use strict';var multer=require(_0xb5e3('0x0'));var util=require(_0xb5e3('0x1'));var path=require(_0xb5e3('0x2'));var timeout=require(_0xb5e3('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb5e3('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb5e3('0x5'));var controller=require(_0xb5e3('0x6'));router[_0xb5e3('0x7')]('/',auth[_0xb5e3('0x8')](),controller[_0xb5e3('0x9')]);router[_0xb5e3('0x7')](_0xb5e3('0xa'),auth[_0xb5e3('0x8')](),controller[_0xb5e3('0xb')]);router['get'](_0xb5e3('0xc'),auth[_0xb5e3('0x8')](),controller['show']);router[_0xb5e3('0xd')]('/',auth[_0xb5e3('0x8')](),interaction[_0xb5e3('0xe')](_0xb5e3('0xf'),_0xb5e3('0x10')),controller[_0xb5e3('0x11')]);router['post'](_0xb5e3('0x12'),controller[_0xb5e3('0x13')]);router[_0xb5e3('0x14')](_0xb5e3('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xb5e3('0x14')](_0xb5e3('0x15'),auth[_0xb5e3('0x8')](),controller[_0xb5e3('0x16')]);router[_0xb5e3('0x14')](_0xb5e3('0x17'),auth[_0xb5e3('0x8')](),controller[_0xb5e3('0x18')]);router[_0xb5e3('0x19')]('/:id',auth['isAuthenticated'](),controller[_0xb5e3('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x58c4=['delete','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','/:id','create','post','/:id/status','status','put','/:id/accept','accept','reject'];(function(_0x3e87ba,_0x46c587){var _0x40efc2=function(_0xfbaf35){while(--_0xfbaf35){_0x3e87ba['push'](_0x3e87ba['shift']());}};_0x40efc2(++_0x46c587);}(_0x58c4,0x135));var _0x458c=function(_0x2bd146,_0xf00cc1){_0x2bd146=_0x2bd146-0x0;var _0x3f835a=_0x58c4[_0x2bd146];return _0x3f835a;};'use strict';var multer=require(_0x458c('0x0'));var util=require('util');var path=require(_0x458c('0x1'));var timeout=require(_0x458c('0x2'));var express=require(_0x458c('0x3'));var router=express[_0x458c('0x4')]();var fs_extra=require(_0x458c('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x458c('0x6'));var controller=require(_0x458c('0x7'));router[_0x458c('0x8')]('/',auth[_0x458c('0x9')](),controller[_0x458c('0xa')]);router[_0x458c('0x8')](_0x458c('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x458c('0x8')](_0x458c('0xc'),auth[_0x458c('0x9')](),controller['show']);router['post']('/',auth[_0x458c('0x9')](),interaction['tracked']('sms','smsmessage:create'),controller[_0x458c('0xd')]);router[_0x458c('0xe')](_0x458c('0xf'),controller[_0x458c('0x10')]);router[_0x458c('0x11')](_0x458c('0xc'),auth[_0x458c('0x9')](),controller['update']);router[_0x458c('0x11')](_0x458c('0x12'),auth['isAuthenticated'](),controller[_0x458c('0x13')]);router[_0x458c('0x11')]('/:id/reject',auth[_0x458c('0x9')](),controller[_0x458c('0x14')]);router[_0x458c('0x15')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 9f6d93b..2d68c7d 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 _0xaf79=['STRING','DATE','exports','TEXT','medium','BOOLEAN','ENUM','out'];(function(_0x22cc89,_0x111fc1){var _0x556a2c=function(_0x4fec95){while(--_0x4fec95){_0x22cc89['push'](_0x22cc89['shift']());}};_0x556a2c(++_0x111fc1);}(_0xaf79,0x82));var _0x9af7=function(_0x7baac8,_0x481055){_0x7baac8=_0x7baac8-0x0;var _0x572f4e=_0xaf79[_0x7baac8];return _0x572f4e;};'use strict';var Sequelize=require('sequelize');module[_0x9af7('0x0')]={'body':{'type':Sequelize[_0x9af7('0x1')](_0x9af7('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x9af7('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9af7('0x4')]('in',_0x9af7('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x9af7('0x6')](0xbe)},'phone':{'type':Sequelize[_0x9af7('0x6')]},'readAt':{'type':Sequelize[_0x9af7('0x7')]},'secret':{'type':Sequelize[_0x9af7('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x450f=['TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports'];(function(_0x172dca,_0xda5041){var _0x2a887f=function(_0x1a6aa5){while(--_0x1a6aa5){_0x172dca['push'](_0x172dca['shift']());}};_0x2a887f(++_0xda5041);}(_0x450f,0x15d));var _0xf450=function(_0x1711f8,_0x208f40){_0x1711f8=_0x1711f8-0x0;var _0x38ca74=_0x450f[_0x1711f8];return _0x38ca74;};'use strict';var Sequelize=require(_0xf450('0x0'));module[_0xf450('0x1')]={'body':{'type':Sequelize[_0xf450('0x2')](_0xf450('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf450('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf450('0x5')]('in',_0xf450('0x6')),'defaultValue':_0xf450('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xf450('0x7')](0xbe)},'phone':{'type':Sequelize[_0xf450('0x7')]},'readAt':{'type':Sequelize[_0xf450('0x8')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xf450('0x7')]},'providerResponse':{'type':Sequelize[_0xf450('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index b11a305..9911d92 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 _0xa486=['nolimit','sort','where','filters','type','filter','includeAll','include','findAll','rows','catch','show','params','length','merge','find','create','body','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','acceptMessage','sequelize','Sequelize','SELECT','User','fullname','email','internal','agent','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','QueryTypes','contact','rejectmessage','SmsAccount','SmsAccountId','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','Status','infobip','groupName','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','sendStatus','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty'];(function(_0x58e92d,_0x1181bd){var _0x45d179=function(_0xf162a4){while(--_0xf162a4){_0x58e92d['push'](_0x58e92d['shift']());}};_0x45d179(++_0x1181bd);}(_0xa486,0x17d));var _0x6a48=function(_0x843839,_0x1f1a63){_0x843839=_0x843839-0x0;var _0x3373d7=_0xa486[_0x843839];return _0x3373d7;};'use strict';var emlformat=require(_0x6a48('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6a48('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6a48('0x2'));var moment=require('moment');var BPromise=require(_0x6a48('0x3'));var Mustache=require(_0x6a48('0x4'));var util=require(_0x6a48('0x5'));var path=require(_0x6a48('0x6'));var sox=require(_0x6a48('0x7'));var csv=require(_0x6a48('0x8'));var ejs=require(_0x6a48('0x9'));var fs=require('fs');var fs_extra=require(_0x6a48('0xa'));var _=require(_0x6a48('0xb'));var squel=require(_0x6a48('0xc'));var crypto=require(_0x6a48('0xd'));var jsforce=require(_0x6a48('0xe'));var deskjs=require(_0x6a48('0xf'));var toCsv=require(_0x6a48('0x8'));var querystring=require(_0x6a48('0x10'));var Papa=require(_0x6a48('0x11'));var Redis=require('ioredis');var authService=require(_0x6a48('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6a48('0x13'));var hardwareService=require(_0x6a48('0x14'));var logger=require(_0x6a48('0x15'))(_0x6a48('0x16'));var utils=require(_0x6a48('0x17'));var config=require(_0x6a48('0x18'));var licenseUtil=require(_0x6a48('0x19'));var db=require(_0x6a48('0x1a'))['db'];config[_0x6a48('0x1b')]=_[_0x6a48('0x1c')](config[_0x6a48('0x1b')],{'host':_0x6a48('0x1d'),'port':0x18eb});var socket=require(_0x6a48('0x1e'))(new Redis(config[_0x6a48('0x1b')]));require(_0x6a48('0x1f'))[_0x6a48('0x20')](socket);var jayson=require(_0x6a48('0x21'));var client=jayson[_0x6a48('0x22')][_0x6a48('0x23')]({'port':0x232c});var client9002=jayson[_0x6a48('0x22')][_0x6a48('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x10867e,_0x231930,_0xaf303c,_0xad96d0){return new BPromise(function(_0x2ca540,_0x41218a){var _0x20cab5=_0xad96d0||client;return _0x20cab5['request'](_0x10867e,_0xaf303c)[_0x6a48('0x24')](function(_0x23a1fe){logger[_0x6a48('0x25')](_0x6a48('0x26'),_0x231930,'request\x20sent');logger[_0x6a48('0x27')](_0x6a48('0x28'),_0x231930,_0x6a48('0x29'),JSON['stringify'](_0x23a1fe));if(_0x23a1fe[_0x6a48('0x2a')]){if(_0x23a1fe[_0x6a48('0x2a')][_0x6a48('0x2b')]===0x1f4){logger['error'](_0x6a48('0x26'),_0x231930,_0x23a1fe[_0x6a48('0x2a')][_0x6a48('0x2c')]);return _0x41218a(_0x23a1fe[_0x6a48('0x2a')]['message']);}logger[_0x6a48('0x2a')](_0x6a48('0x26'),_0x231930,_0x23a1fe['error']['message']);return _0x2ca540(_0x23a1fe[_0x6a48('0x2a')][_0x6a48('0x2c')]);}else{logger['info'](_0x6a48('0x26'),_0x231930,'request\x20sent');_0x2ca540(_0x23a1fe['result']['message']);}})['catch'](function(_0x2a14d5){logger['error'](_0x6a48('0x26'),_0x231930,_0x2a14d5);_0x41218a(_0x2a14d5);});});}function respondWithStatusCode(_0x52de7c,_0x5b1331){_0x5b1331=_0x5b1331||0xcc;return function(_0x483278){if(_0x483278){return _0x52de7c['sendStatus'](_0x5b1331);}return _0x52de7c[_0x6a48('0x2d')](_0x5b1331)[_0x6a48('0x2e')]();};}function respondWithResult(_0x2cb60e,_0x20ecb0){_0x20ecb0=_0x20ecb0||0xc8;return function(_0x4c53cc){if(_0x4c53cc){return _0x2cb60e[_0x6a48('0x2d')](_0x20ecb0)[_0x6a48('0x2f')](_0x4c53cc);}};}function respondWithFilteredResult(_0xf450b,_0x13fe57){return function(_0x5188e8){if(_0x5188e8){var _0x57522a=typeof _0x13fe57[_0x6a48('0x30')]===_0x6a48('0x31')&&typeof _0x13fe57[_0x6a48('0x32')]===_0x6a48('0x31');var _0x437622=_0x5188e8['count'];var _0x16982f=_0x57522a?0x0:_0x13fe57['offset'];var _0x50e0e8=_0x57522a?_0x5188e8[_0x6a48('0x33')]:_0x13fe57[_0x6a48('0x30')]+_0x13fe57[_0x6a48('0x32')];var _0xd53693;if(_0x50e0e8>=_0x437622){_0x50e0e8=_0x437622;_0xd53693=0xc8;}else{_0xd53693=0xce;}_0xf450b[_0x6a48('0x2d')](_0xd53693);return _0xf450b[_0x6a48('0x34')](_0x6a48('0x35'),_0x16982f+'-'+_0x50e0e8+'/'+_0x437622)[_0x6a48('0x2f')](_0x5188e8);}return null;};}function patchUpdates(_0x1372ef){return function(_0x27504a){try{jsonpatch[_0x6a48('0x36')](_0x27504a,_0x1372ef,!![]);}catch(_0x28ebfc){return BPromise['reject'](_0x28ebfc);}return _0x27504a[_0x6a48('0x37')]();};}function saveUpdates(_0x32a90b,_0x53e85b){return function(_0x5502bb){if(_0x5502bb){return _0x5502bb[_0x6a48('0x38')](_0x32a90b)['then'](function(_0x13d303){return _0x13d303;});}return null;};}function removeEntity(_0x4ba7f8,_0x42cd76){return function(_0x259cab){if(_0x259cab){return _0x259cab[_0x6a48('0x39')]()['then'](function(){_0x4ba7f8[_0x6a48('0x2d')](0xcc)[_0x6a48('0x2e')]();});}};}function handleEntityNotFound(_0x51703a,_0x53004c){return function(_0x2e6472){if(!_0x2e6472){_0x51703a[_0x6a48('0x3a')](0x194);}return _0x2e6472;};}function handleError(_0x4f3ec1,_0x5bf085){_0x5bf085=_0x5bf085||0x1f4;return function(_0xd33ad9){logger[_0x6a48('0x2a')](_0xd33ad9[_0x6a48('0x3b')]);if(_0xd33ad9[_0x6a48('0x3c')]){delete _0xd33ad9['name'];}_0x4f3ec1[_0x6a48('0x2d')](_0x5bf085)[_0x6a48('0x3d')](_0xd33ad9);};}exports[_0x6a48('0x3e')]=function(_0x2b236b,_0x228297){var _0x434f53={},_0x2e085c={},_0x399e13={'count':0x0,'rows':[]};var _0x2b5773=_[_0x6a48('0x3f')](db[_0x6a48('0x40')][_0x6a48('0x41')],function(_0x19244f){return{'name':_0x19244f[_0x6a48('0x42')],'type':_0x19244f['type'][_0x6a48('0x43')]};});_0x2e085c[_0x6a48('0x44')]=_['map'](_0x2b5773,_0x6a48('0x3c'));_0x2e085c[_0x6a48('0x45')]=_[_0x6a48('0x46')](_0x2b236b[_0x6a48('0x45')]);_0x2e085c['filters']=_[_0x6a48('0x47')](_0x2e085c[_0x6a48('0x44')],_0x2e085c[_0x6a48('0x45')]);_0x434f53[_0x6a48('0x48')]=_[_0x6a48('0x47')](_0x2e085c[_0x6a48('0x44')],qs[_0x6a48('0x49')](_0x2b236b['query']['fields']));_0x434f53[_0x6a48('0x48')]=_0x434f53[_0x6a48('0x48')]['length']?_0x434f53[_0x6a48('0x48')]:_0x2e085c[_0x6a48('0x44')];if(!_0x2b236b['query'][_0x6a48('0x4a')](_0x6a48('0x4b'))){_0x434f53[_0x6a48('0x32')]=qs[_0x6a48('0x32')](_0x2b236b[_0x6a48('0x45')]['limit']);_0x434f53[_0x6a48('0x30')]=qs['offset'](_0x2b236b['query'][_0x6a48('0x30')]);}_0x434f53['order']=qs[_0x6a48('0x4c')](_0x2b236b['query'][_0x6a48('0x4c')]);_0x434f53[_0x6a48('0x4d')]=qs[_0x6a48('0x4e')](_['pick'](_0x2b236b[_0x6a48('0x45')],_0x2e085c['filters']),_0x2b5773);if(_0x2b236b['query']['filter']){_0x434f53[_0x6a48('0x4d')]=_['merge'](_0x434f53[_0x6a48('0x4d')],{'$or':_[_0x6a48('0x3f')](_0x2b5773,function(_0x277950){if(_0x277950[_0x6a48('0x4f')]!=='VIRTUAL'){var _0xa57759={};_0xa57759[_0x277950['name']]={'$like':'%'+_0x2b236b[_0x6a48('0x45')][_0x6a48('0x50')]+'%'};return _0xa57759;}})});}_0x434f53=_['merge']({},_0x434f53,_0x2b236b['options']);var _0x1b942b={'where':_0x434f53[_0x6a48('0x4d')]};return db['SmsMessage'][_0x6a48('0x33')](_0x1b942b)[_0x6a48('0x24')](function(_0x11c34d){_0x399e13[_0x6a48('0x33')]=_0x11c34d;if(_0x2b236b[_0x6a48('0x45')][_0x6a48('0x51')]){_0x434f53[_0x6a48('0x52')]=[{'all':!![]}];}return db['SmsMessage'][_0x6a48('0x53')](_0x434f53);})[_0x6a48('0x24')](function(_0x4dbbad){_0x399e13[_0x6a48('0x54')]=_0x4dbbad;return _0x399e13;})[_0x6a48('0x24')](respondWithFilteredResult(_0x228297,_0x434f53))[_0x6a48('0x55')](handleError(_0x228297,null));};exports[_0x6a48('0x56')]=function(_0x375358,_0x58b400){var _0xf58971={'raw':!![],'where':{'id':_0x375358[_0x6a48('0x57')]['id']}},_0x1ce605={};_0x1ce605[_0x6a48('0x44')]=_[_0x6a48('0x46')](db['SmsMessage']['rawAttributes']);_0x1ce605[_0x6a48('0x45')]=_[_0x6a48('0x46')](_0x375358[_0x6a48('0x45')]);_0x1ce605['filters']=_[_0x6a48('0x47')](_0x1ce605['model'],_0x1ce605[_0x6a48('0x45')]);_0xf58971[_0x6a48('0x48')]=_['intersection'](_0x1ce605[_0x6a48('0x44')],qs[_0x6a48('0x49')](_0x375358[_0x6a48('0x45')][_0x6a48('0x49')]));_0xf58971[_0x6a48('0x48')]=_0xf58971[_0x6a48('0x48')][_0x6a48('0x58')]?_0xf58971['attributes']:_0x1ce605[_0x6a48('0x44')];if(_0x375358[_0x6a48('0x45')]['includeAll']){_0xf58971['include']=[{'all':!![]}];}_0xf58971=_[_0x6a48('0x59')]({},_0xf58971,_0x375358['options']);return db['SmsMessage'][_0x6a48('0x5a')](_0xf58971)['then'](handleEntityNotFound(_0x58b400,null))[_0x6a48('0x24')](respondWithResult(_0x58b400,null))[_0x6a48('0x55')](handleError(_0x58b400,null));};exports[_0x6a48('0x5b')]=function(_0x564afa,_0x104fc2){return db[_0x6a48('0x40')][_0x6a48('0x5b')](_0x564afa[_0x6a48('0x5c')],{})[_0x6a48('0x24')](respondWithResult(_0x104fc2,0xc9))[_0x6a48('0x55')](handleError(_0x104fc2,null));};exports['update']=function(_0x116359,_0x2d138e){if(_0x116359[_0x6a48('0x5c')]['id']){delete _0x116359['body']['id'];}return db[_0x6a48('0x40')]['find']({'where':{'id':_0x116359['params']['id']}})[_0x6a48('0x24')](handleEntityNotFound(_0x2d138e,null))[_0x6a48('0x24')](saveUpdates(_0x116359[_0x6a48('0x5c')],null))['then'](respondWithResult(_0x2d138e,null))['catch'](handleError(_0x2d138e,null));};exports[_0x6a48('0x39')]=function(_0x1e16e5,_0x133494){return db['SmsMessage'][_0x6a48('0x5a')]({'where':{'id':_0x1e16e5[_0x6a48('0x57')]['id']}})['then'](handleEntityNotFound(_0x133494,null))[_0x6a48('0x24')](removeEntity(_0x133494,null))['catch'](handleError(_0x133494,null));};exports[_0x6a48('0x5d')]=function(_0x70b605,_0x276f1e){return db[_0x6a48('0x40')][_0x6a48('0x5d')]()[_0x6a48('0x24')](respondWithResult(_0x276f1e,null))[_0x6a48('0x55')](handleError(_0x276f1e,null));};var interaction_log=require('../../config/logger')(_0x6a48('0x5e'));exports[_0x6a48('0x5f')]=function(_0x676264,_0x238590,_0x2e9891){var _0x382bb5={'agent':{},'channel':_0x6a48('0x60')};if(_0x676264[_0x6a48('0x5c')]['id']){delete _0x676264[_0x6a48('0x5c')]['id'];}_0x676264[_0x6a48('0x5c')][_0x6a48('0x61')]=!![];_0x676264['body'][_0x6a48('0x62')]=moment()[_0x6a48('0x63')](_0x6a48('0x64'));_0x676264[_0x6a48('0x5c')][_0x6a48('0x65')]=_0x676264[_0x6a48('0x5c')]['UserId']||_0x676264['user']['id'];_0x382bb5['agent']['id']=_0x676264[_0x6a48('0x5c')][_0x6a48('0x65')];return db[_0x6a48('0x40')][_0x6a48('0x5a')]({'where':{'id':_0x676264['params']['id'],'UserId':null}})[_0x6a48('0x24')](handleEntityNotFound(_0x238590,null))['then'](saveUpdates(_0x676264[_0x6a48('0x5c')],null))[_0x6a48('0x24')](function(_0x2edba7){if(_0x2edba7){_0x382bb5[_0x6a48('0x2c')]=_0x2edba7['get']({'plain':!![]});return db[_0x6a48('0x66')][_0x6a48('0x5a')]({'where':{'id':_0x2edba7[_0x6a48('0x67')]}});}return null;})[_0x6a48('0x24')](handleEntityNotFound(_0x238590,null))[_0x6a48('0x24')](function(_0x1635fa){if(_0x1635fa){return _0x1635fa[_0x6a48('0x38')]({'UserId':_0x676264[_0x6a48('0x5c')][_0x6a48('0x65')],'read1stAt':_[_0x6a48('0x68')](_0x1635fa[_0x6a48('0x69')])?moment()[_0x6a48('0x63')](_0x6a48('0x64')):undefined});}return null;})[_0x6a48('0x24')](function(_0xec7a63){if(_0xec7a63){_0x382bb5[_0x6a48('0x6a')]=_0xec7a63[_0x6a48('0x6b')]({'plain':!![]});interaction_log[_0x6a48('0x25')](_0x6a48('0x6c'),_0x676264[_0x6a48('0x6d')]['id'],_0x676264[_0x6a48('0x6d')][_0x6a48('0x3c')],_0x676264[_0x6a48('0x6d')][_0x6a48('0x6e')],_0x382bb5['interaction']['id'],_0x676264[_0x6a48('0x5c')]?JSON['stringify'](_0x676264[_0x6a48('0x5c')]):_0x6a48('0x6f'));return respondWithRpcPromise('AcceptMessage',_0x6a48('0x70'),_0x382bb5);}return null;})[_0x6a48('0x24')](function(_0x5acda6){var _0x2ddc74='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5acda6[_0x6a48('0x2c')]['ContactId'];return db[_0x6a48('0x71')][_0x6a48('0x45')](_0x2ddc74,{'type':db[_0x6a48('0x72')]['QueryTypes'][_0x6a48('0x73')],'raw':!![]})[_0x6a48('0x24')](function(_0x48042a){return _0x48042a;});})['then'](function(_0x27129b){if(_0x27129b){_0x382bb5['message']['contact']=_0x27129b[0x0];if(!_0x676264['body'][_0x6a48('0x65')])return;return db[_0x6a48('0x74')][_0x6a48('0x5a')]({'where':{'id':_0x676264[_0x6a48('0x5c')][_0x6a48('0x65')],'role':'agent'},'attributes':['id',_0x6a48('0x3c'),_0x6a48('0x75'),_0x6a48('0x76'),_0x6a48('0x77')],'raw':!![]});}return null;})[_0x6a48('0x24')](function(_0x3c7fc5){if(!_0x3c7fc5)return null;_0x382bb5[_0x6a48('0x2c')][_0x6a48('0x78')]=_0x3c7fc5;return _0x382bb5;})[_0x6a48('0x24')](function(_0x5454b9){if(_0x5454b9){if(_0x676264[_0x6a48('0x5c')][_0x6a48('0x79')]){_0x382bb5[_0x6a48('0x2c')][_0x6a48('0x7a')]=util['format'](_0x6a48('0x7b'),_0x676264[_0x6a48('0x6d')][_0x6a48('0x3c')]);_0x382bb5[_0x6a48('0x2c')]['channel']=_0x382bb5[_0x6a48('0x7c')];_0x382bb5['message'][_0x6a48('0x7d')]=_0x382bb5[_0x6a48('0x7c')];_0x382bb5['message'][_0x6a48('0x7e')]=_0x6a48('0x5f');return respondWithRpcPromise(_0x6a48('0x7f'),'EventManager',{'event':_0x6a48('0x80'),'message':_0x382bb5[_0x6a48('0x2c')]},client9002)[_0x6a48('0x24')](function(){return _0x382bb5;});}return _0x382bb5;}return null;})[_0x6a48('0x24')](respondWithResult(_0x238590,null))[_0x6a48('0x55')](handleError(_0x238590,null));};var interaction_log=require(_0x6a48('0x15'))(_0x6a48('0x5e'));exports[_0x6a48('0x81')]=function(_0xc3fcfe,_0x4fd0e5,_0x17f9b5){var _0x25ba98={'agent':{},'channel':'sms'};if(_0xc3fcfe[_0x6a48('0x5c')]['id']){delete _0xc3fcfe['body']['id'];}_0xc3fcfe[_0x6a48('0x5c')][_0x6a48('0x65')]=_0xc3fcfe[_0x6a48('0x5c')][_0x6a48('0x65')]||_0xc3fcfe[_0x6a48('0x6d')]['id'];_0x25ba98[_0x6a48('0x78')]['id']=_0xc3fcfe[_0x6a48('0x5c')][_0x6a48('0x65')];return db[_0x6a48('0x40')][_0x6a48('0x5a')]({'where':{'id':_0xc3fcfe['params']['id'],'UserId':null}})[_0x6a48('0x24')](handleEntityNotFound(_0x4fd0e5,null))[_0x6a48('0x24')](function(_0x2b1ad4){if(_0x2b1ad4){_0x25ba98[_0x6a48('0x2c')]=_0x2b1ad4[_0x6a48('0x6b')]({'plain':!![]});return db[_0x6a48('0x66')][_0x6a48('0x5a')]({'where':{'id':_0x2b1ad4['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x4fd0e5,null))[_0x6a48('0x24')](function(_0x2695d1){if(_0x2695d1){_0x25ba98['interaction']=_0x2695d1['get']({'plain':!![]});interaction_log[_0x6a48('0x25')](_0x6a48('0x82'),_0xc3fcfe[_0x6a48('0x6d')]['id'],_0xc3fcfe[_0x6a48('0x6d')][_0x6a48('0x3c')],_0xc3fcfe['user'][_0x6a48('0x6e')],_0x25ba98['interaction']['id'],_0xc3fcfe[_0x6a48('0x5c')]?JSON[_0x6a48('0x83')](_0xc3fcfe[_0x6a48('0x5c')]):_0x6a48('0x6f'));return respondWithRpcPromise(_0x6a48('0x84'),_0x6a48('0x85'),_0x25ba98);}return null;})[_0x6a48('0x24')](function(_0x590adc){var _0xbd3fb1=_0x6a48('0x86')+_0x590adc[_0x6a48('0x2c')]['ContactId'];return db[_0x6a48('0x71')][_0x6a48('0x45')](_0xbd3fb1,{'type':db[_0x6a48('0x72')][_0x6a48('0x87')][_0x6a48('0x73')],'raw':!![]})['then'](function(_0x5555d5){return _0x5555d5;});})[_0x6a48('0x24')](function(_0x5ba0db){if(_0x5ba0db){_0x25ba98[_0x6a48('0x2c')][_0x6a48('0x88')]=_0x5ba0db[0x0];if(!_0xc3fcfe[_0x6a48('0x5c')][_0x6a48('0x65')])return;return db[_0x6a48('0x74')]['find']({'where':{'id':_0xc3fcfe['body'][_0x6a48('0x65')],'role':'agent'},'attributes':['id',_0x6a48('0x3c'),'fullname',_0x6a48('0x76'),_0x6a48('0x77')],'raw':!![]});}return null;})[_0x6a48('0x24')](function(_0x208bae){if(!_0x208bae)return null;_0x25ba98['message'][_0x6a48('0x78')]=_0x208bae;return _0x25ba98;})[_0x6a48('0x24')](function(_0x16131a){if(_0x16131a){_0x16131a['message'][_0x6a48('0x7a')]=util[_0x6a48('0x63')]('SIP/%s',_0xc3fcfe['user'][_0x6a48('0x3c')]);_0x16131a[_0x6a48('0x2c')]['channel']=_0x25ba98['channel'];_0x16131a[_0x6a48('0x2c')]['motionChannel']=_0x25ba98[_0x6a48('0x7c')];_0x16131a[_0x6a48('0x2c')][_0x6a48('0x7e')]=_0x6a48('0x81');respondWithRpcPromise(_0x6a48('0x7f'),_0x6a48('0x7f'),{'event':_0x6a48('0x89'),'message':_0x16131a[_0x6a48('0x2c')]},client9002);return _0x25ba98;}return null;})[_0x6a48('0x24')](respondWithResult(_0x4fd0e5,null))['catch'](handleError(_0x4fd0e5,null));};exports['status']=function(_0xa9fdfa,_0x49d4db,_0x3d890d){if(_0xa9fdfa[_0x6a48('0x5c')]['id']){delete _0xa9fdfa[_0x6a48('0x5c')]['id'];}var _0x8fb163;return db[_0x6a48('0x40')][_0x6a48('0x5a')]({'where':{'id':_0xa9fdfa[_0x6a48('0x57')]['id']}})[_0x6a48('0x24')](handleEntityNotFound(_0x49d4db,null))['then'](function(_0x2d181a){if(_0x2d181a){_0x8fb163=_0x2d181a;return db[_0x6a48('0x8a')][_0x6a48('0x5a')]({'where':{'id':_0x2d181a[_0x6a48('0x8b')]}});}})['then'](handleEntityNotFound(_0x49d4db,null))[_0x6a48('0x24')](function(_0x413e4c){if(_0x413e4c){logger[_0x6a48('0x27')](_0x6a48('0x28'),_0x6a48('0x2d'),'received\x20delivery\x20report\x20from',_0x413e4c[_0x6a48('0x4f')],util[_0x6a48('0x8c')](_0xa9fdfa['body'],{'showHidden':![],'depth':null}));switch(_0x413e4c[_0x6a48('0x4f')]){case _0x6a48('0x8d'):if(_0xa9fdfa[_0x6a48('0x5c')][_0x6a48('0x8e')]&&_0xa9fdfa[_0x6a48('0x5c')][_0x6a48('0x8e')]===_0x8fb163[_0x6a48('0x8f')]){return _0x8fb163['update']({'read':!![]});}else{logger[_0x6a48('0x2a')](_0x6a48('0x90'),_0x6a48('0x2d'),_0x6a48('0x8d'),util['inspect'](_0xa9fdfa[_0x6a48('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x6a48('0x91'):if(_0xa9fdfa[_0x6a48('0x5c')][_0x6a48('0x92')]&&_0xa9fdfa['body']['MessageUUID']===_0x8fb163[_0x6a48('0x8f')]&&_[_0x6a48('0x93')]([_0x6a48('0x94'),'delivered'],_0xa9fdfa['body'][_0x6a48('0x95')])>=0x0){return _0x8fb163[_0x6a48('0x38')]({'read':!![]});}else{logger[_0x6a48('0x2a')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6a48('0x2d'),'plivio',util[_0x6a48('0x8c')](_0xa9fdfa[_0x6a48('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x6a48('0x96'):var _0x54d72b=_0xa9fdfa[_0x6a48('0x5c')]['results'][0x0];if(_0x54d72b['status'][_0x6a48('0x97')]==='DELIVERED'){return _0x8fb163[_0x6a48('0x38')]({'read':!![]});}else{logger[_0x6a48('0x2a')](_0x6a48('0x90'),_0x6a48('0x2d'),_0x6a48('0x96'),util[_0x6a48('0x8c')](_0xa9fdfa[_0x6a48('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x8fb163;}})[_0x6a48('0x24')](respondWithResult(_0x49d4db,null))['catch'](handleError(_0x49d4db,null));}; \ No newline at end of file +var _0xd7d5=['create','body','describe','sms-interactions','accept','sms','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','SmsInteraction','isNil','read1stAt','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','stringify','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','reject','interaction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','rejectmessage','SmsAccount','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','inspect','infobip','results','groupName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','./smsMessage.socket','register','http','client','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','message','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','destroy','stack','map','rawAttributes','type','key','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','SmsMessage','catch','params','find'];(function(_0x3748d3,_0x30753d){var _0x99dd2f=function(_0x5c9f0d){while(--_0x5c9f0d){_0x3748d3['push'](_0x3748d3['shift']());}};_0x99dd2f(++_0x30753d);}(_0xd7d5,0x1ea));var _0x5d7d=function(_0x2804cb,_0x4d9c62){_0x2804cb=_0x2804cb-0x0;var _0x36a83d=_0xd7d5[_0x2804cb];return _0x36a83d;};'use strict';var emlformat=require(_0x5d7d('0x0'));var rimraf=require(_0x5d7d('0x1'));var zipdir=require(_0x5d7d('0x2'));var jsonpatch=require(_0x5d7d('0x3'));var rp=require(_0x5d7d('0x4'));var moment=require(_0x5d7d('0x5'));var BPromise=require(_0x5d7d('0x6'));var Mustache=require('mustache');var util=require(_0x5d7d('0x7'));var path=require('path');var sox=require(_0x5d7d('0x8'));var csv=require(_0x5d7d('0x9'));var ejs=require(_0x5d7d('0xa'));var fs=require('fs');var fs_extra=require(_0x5d7d('0xb'));var _=require(_0x5d7d('0xc'));var squel=require(_0x5d7d('0xd'));var crypto=require(_0x5d7d('0xe'));var jsforce=require(_0x5d7d('0xf'));var deskjs=require(_0x5d7d('0x10'));var toCsv=require(_0x5d7d('0x9'));var querystring=require('querystring');var Papa=require(_0x5d7d('0x11'));var Redis=require(_0x5d7d('0x12'));var authService=require(_0x5d7d('0x13'));var qs=require(_0x5d7d('0x14'));var as=require(_0x5d7d('0x15'));var hardwareService=require(_0x5d7d('0x16'));var logger=require(_0x5d7d('0x17'))(_0x5d7d('0x18'));var utils=require(_0x5d7d('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x5d7d('0x1a'));var db=require(_0x5d7d('0x1b'))['db'];config[_0x5d7d('0x1c')]=_['defaults'](config[_0x5d7d('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5d7d('0x1d'))[_0x5d7d('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x5d7d('0x1f')]({'port':0x232c});var client9002=jayson[_0x5d7d('0x20')][_0x5d7d('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x159c5a,_0x3d687b,_0x5d8d8c,_0x4a07d2){return new BPromise(function(_0x4dc832,_0x14b449){var _0x1f2154=_0x4a07d2||client;return _0x1f2154[_0x5d7d('0x21')](_0x159c5a,_0x5d8d8c)[_0x5d7d('0x22')](function(_0x1aa4f5){logger[_0x5d7d('0x23')](_0x5d7d('0x24'),_0x3d687b,_0x5d7d('0x25'));logger[_0x5d7d('0x26')](_0x5d7d('0x27'),_0x3d687b,_0x5d7d('0x25'),JSON['stringify'](_0x1aa4f5));if(_0x1aa4f5[_0x5d7d('0x28')]){if(_0x1aa4f5['error']['code']===0x1f4){logger[_0x5d7d('0x28')](_0x5d7d('0x24'),_0x3d687b,_0x1aa4f5[_0x5d7d('0x28')][_0x5d7d('0x29')]);return _0x14b449(_0x1aa4f5[_0x5d7d('0x28')][_0x5d7d('0x29')]);}logger[_0x5d7d('0x28')](_0x5d7d('0x24'),_0x3d687b,_0x1aa4f5[_0x5d7d('0x28')][_0x5d7d('0x29')]);return _0x4dc832(_0x1aa4f5[_0x5d7d('0x28')]['message']);}else{logger[_0x5d7d('0x23')](_0x5d7d('0x24'),_0x3d687b,_0x5d7d('0x25'));_0x4dc832(_0x1aa4f5[_0x5d7d('0x2a')]['message']);}})['catch'](function(_0x14002a){logger[_0x5d7d('0x28')](_0x5d7d('0x24'),_0x3d687b,_0x14002a);_0x14b449(_0x14002a);});});}function respondWithStatusCode(_0x5b855e,_0x4132a9){_0x4132a9=_0x4132a9||0xcc;return function(_0x509e77){if(_0x509e77){return _0x5b855e[_0x5d7d('0x2b')](_0x4132a9);}return _0x5b855e[_0x5d7d('0x2c')](_0x4132a9)[_0x5d7d('0x2d')]();};}function respondWithResult(_0x5a224a,_0x371a78){_0x371a78=_0x371a78||0xc8;return function(_0xfa9b42){if(_0xfa9b42){return _0x5a224a[_0x5d7d('0x2c')](_0x371a78)['json'](_0xfa9b42);}};}function respondWithFilteredResult(_0x187030,_0x4ed00c){return function(_0x126873){if(_0x126873){var _0x18545f=typeof _0x4ed00c[_0x5d7d('0x2e')]===_0x5d7d('0x2f')&&typeof _0x4ed00c[_0x5d7d('0x30')]==='undefined';var _0x211166=_0x126873[_0x5d7d('0x31')];var _0x1ff099=_0x18545f?0x0:_0x4ed00c[_0x5d7d('0x2e')];var _0x4c588c=_0x18545f?_0x126873[_0x5d7d('0x31')]:_0x4ed00c[_0x5d7d('0x2e')]+_0x4ed00c[_0x5d7d('0x30')];var _0x35d550;if(_0x4c588c>=_0x211166){_0x4c588c=_0x211166;_0x35d550=0xc8;}else{_0x35d550=0xce;}_0x187030['status'](_0x35d550);return _0x187030[_0x5d7d('0x32')](_0x5d7d('0x33'),_0x1ff099+'-'+_0x4c588c+'/'+_0x211166)[_0x5d7d('0x34')](_0x126873);}return null;};}function patchUpdates(_0x563244){return function(_0x48afcb){try{jsonpatch[_0x5d7d('0x35')](_0x48afcb,_0x563244,!![]);}catch(_0x2ad100){return BPromise['reject'](_0x2ad100);}return _0x48afcb[_0x5d7d('0x36')]();};}function saveUpdates(_0xee91b6,_0x2da4ac){return function(_0x393619){if(_0x393619){return _0x393619[_0x5d7d('0x37')](_0xee91b6)[_0x5d7d('0x22')](function(_0x290c79){return _0x290c79;});}return null;};}function removeEntity(_0x5ced5b,_0xfc005c){return function(_0xffd878){if(_0xffd878){return _0xffd878[_0x5d7d('0x38')]()[_0x5d7d('0x22')](function(){_0x5ced5b['status'](0xcc)[_0x5d7d('0x2d')]();});}};}function handleEntityNotFound(_0x306cd1,_0x42c076){return function(_0x4b0b10){if(!_0x4b0b10){_0x306cd1[_0x5d7d('0x2b')](0x194);}return _0x4b0b10;};}function handleError(_0x141680,_0x5cbdbd){_0x5cbdbd=_0x5cbdbd||0x1f4;return function(_0x28c437){logger[_0x5d7d('0x28')](_0x28c437[_0x5d7d('0x39')]);if(_0x28c437['name']){delete _0x28c437['name'];}_0x141680[_0x5d7d('0x2c')](_0x5cbdbd)['send'](_0x28c437);};}exports['index']=function(_0xcce177,_0x3177b4){var _0x525957={},_0x132cef={},_0x55a6c8={'count':0x0,'rows':[]};var _0x13ccb2=_[_0x5d7d('0x3a')](db['SmsMessage'][_0x5d7d('0x3b')],function(_0x548aa3){return{'name':_0x548aa3['fieldName'],'type':_0x548aa3[_0x5d7d('0x3c')][_0x5d7d('0x3d')]};});_0x132cef['model']=_[_0x5d7d('0x3a')](_0x13ccb2,_0x5d7d('0x3e'));_0x132cef[_0x5d7d('0x3f')]=_[_0x5d7d('0x40')](_0xcce177[_0x5d7d('0x3f')]);_0x132cef[_0x5d7d('0x41')]=_[_0x5d7d('0x42')](_0x132cef[_0x5d7d('0x43')],_0x132cef[_0x5d7d('0x3f')]);_0x525957[_0x5d7d('0x44')]=_[_0x5d7d('0x42')](_0x132cef[_0x5d7d('0x43')],qs[_0x5d7d('0x45')](_0xcce177[_0x5d7d('0x3f')]['fields']));_0x525957[_0x5d7d('0x44')]=_0x525957['attributes'][_0x5d7d('0x46')]?_0x525957[_0x5d7d('0x44')]:_0x132cef[_0x5d7d('0x43')];if(!_0xcce177['query'][_0x5d7d('0x47')](_0x5d7d('0x48'))){_0x525957[_0x5d7d('0x30')]=qs[_0x5d7d('0x30')](_0xcce177[_0x5d7d('0x3f')][_0x5d7d('0x30')]);_0x525957['offset']=qs[_0x5d7d('0x2e')](_0xcce177[_0x5d7d('0x3f')][_0x5d7d('0x2e')]);}_0x525957[_0x5d7d('0x49')]=qs[_0x5d7d('0x4a')](_0xcce177['query'][_0x5d7d('0x4a')]);_0x525957[_0x5d7d('0x4b')]=qs[_0x5d7d('0x41')](_[_0x5d7d('0x4c')](_0xcce177[_0x5d7d('0x3f')],_0x132cef[_0x5d7d('0x41')]),_0x13ccb2);if(_0xcce177['query'][_0x5d7d('0x4d')]){_0x525957[_0x5d7d('0x4b')]=_['merge'](_0x525957[_0x5d7d('0x4b')],{'$or':_[_0x5d7d('0x3a')](_0x13ccb2,function(_0x5e0e66){if(_0x5e0e66[_0x5d7d('0x3c')]!=='VIRTUAL'){var _0x42ec26={};_0x42ec26[_0x5e0e66[_0x5d7d('0x3e')]]={'$like':'%'+_0xcce177[_0x5d7d('0x3f')][_0x5d7d('0x4d')]+'%'};return _0x42ec26;}})});}_0x525957=_[_0x5d7d('0x4e')]({},_0x525957,_0xcce177[_0x5d7d('0x4f')]);var _0x1a817c={'where':_0x525957[_0x5d7d('0x4b')]};return db['SmsMessage']['count'](_0x1a817c)[_0x5d7d('0x22')](function(_0x19fc1f){_0x55a6c8['count']=_0x19fc1f;if(_0xcce177[_0x5d7d('0x3f')][_0x5d7d('0x50')]){_0x525957[_0x5d7d('0x51')]=[{'all':!![]}];}return db[_0x5d7d('0x52')]['findAll'](_0x525957);})[_0x5d7d('0x22')](function(_0x29512f){_0x55a6c8['rows']=_0x29512f;return _0x55a6c8;})[_0x5d7d('0x22')](respondWithFilteredResult(_0x3177b4,_0x525957))[_0x5d7d('0x53')](handleError(_0x3177b4,null));};exports['show']=function(_0x5100d7,_0x3faf11){var _0x56832a={'raw':!![],'where':{'id':_0x5100d7[_0x5d7d('0x54')]['id']}},_0x4f4c96={};_0x4f4c96[_0x5d7d('0x43')]=_[_0x5d7d('0x40')](db[_0x5d7d('0x52')][_0x5d7d('0x3b')]);_0x4f4c96['query']=_[_0x5d7d('0x40')](_0x5100d7['query']);_0x4f4c96['filters']=_['intersection'](_0x4f4c96[_0x5d7d('0x43')],_0x4f4c96['query']);_0x56832a[_0x5d7d('0x44')]=_[_0x5d7d('0x42')](_0x4f4c96['model'],qs[_0x5d7d('0x45')](_0x5100d7['query'][_0x5d7d('0x45')]));_0x56832a[_0x5d7d('0x44')]=_0x56832a[_0x5d7d('0x44')][_0x5d7d('0x46')]?_0x56832a[_0x5d7d('0x44')]:_0x4f4c96[_0x5d7d('0x43')];if(_0x5100d7[_0x5d7d('0x3f')]['includeAll']){_0x56832a['include']=[{'all':!![]}];}_0x56832a=_[_0x5d7d('0x4e')]({},_0x56832a,_0x5100d7[_0x5d7d('0x4f')]);return db[_0x5d7d('0x52')][_0x5d7d('0x55')](_0x56832a)['then'](handleEntityNotFound(_0x3faf11,null))['then'](respondWithResult(_0x3faf11,null))['catch'](handleError(_0x3faf11,null));};exports[_0x5d7d('0x56')]=function(_0x347ed8,_0x43effb){return db[_0x5d7d('0x52')][_0x5d7d('0x56')](_0x347ed8[_0x5d7d('0x57')],{})[_0x5d7d('0x22')](respondWithResult(_0x43effb,0xc9))['catch'](handleError(_0x43effb,null));};exports['update']=function(_0x4aa73d,_0x3675de){if(_0x4aa73d[_0x5d7d('0x57')]['id']){delete _0x4aa73d[_0x5d7d('0x57')]['id'];}return db[_0x5d7d('0x52')][_0x5d7d('0x55')]({'where':{'id':_0x4aa73d['params']['id']}})['then'](handleEntityNotFound(_0x3675de,null))[_0x5d7d('0x22')](saveUpdates(_0x4aa73d['body'],null))[_0x5d7d('0x22')](respondWithResult(_0x3675de,null))[_0x5d7d('0x53')](handleError(_0x3675de,null));};exports[_0x5d7d('0x38')]=function(_0x3844e4,_0x556db3){return db[_0x5d7d('0x52')][_0x5d7d('0x55')]({'where':{'id':_0x3844e4['params']['id']}})[_0x5d7d('0x22')](handleEntityNotFound(_0x556db3,null))['then'](removeEntity(_0x556db3,null))[_0x5d7d('0x53')](handleError(_0x556db3,null));};exports[_0x5d7d('0x58')]=function(_0x3d70cf,_0x569214){return db['SmsMessage'][_0x5d7d('0x58')]()[_0x5d7d('0x22')](respondWithResult(_0x569214,null))[_0x5d7d('0x53')](handleError(_0x569214,null));};var interaction_log=require(_0x5d7d('0x17'))(_0x5d7d('0x59'));exports[_0x5d7d('0x5a')]=function(_0x1981de,_0x5df345,_0x301159){var _0x1ba205={'agent':{},'channel':_0x5d7d('0x5b')};if(_0x1981de[_0x5d7d('0x57')]['id']){delete _0x1981de[_0x5d7d('0x57')]['id'];}_0x1981de[_0x5d7d('0x57')]['read']=!![];_0x1981de[_0x5d7d('0x57')]['readAt']=moment()[_0x5d7d('0x5c')](_0x5d7d('0x5d'));_0x1981de[_0x5d7d('0x57')][_0x5d7d('0x5e')]=_0x1981de[_0x5d7d('0x57')][_0x5d7d('0x5e')]||_0x1981de['user']['id'];_0x1ba205[_0x5d7d('0x5f')]['id']=_0x1981de[_0x5d7d('0x57')][_0x5d7d('0x5e')];return db[_0x5d7d('0x52')][_0x5d7d('0x55')]({'where':{'id':_0x1981de[_0x5d7d('0x54')]['id'],'UserId':null}})[_0x5d7d('0x22')](handleEntityNotFound(_0x5df345,null))[_0x5d7d('0x22')](saveUpdates(_0x1981de[_0x5d7d('0x57')],null))[_0x5d7d('0x22')](function(_0x5b0f8a){if(_0x5b0f8a){_0x1ba205['message']=_0x5b0f8a[_0x5d7d('0x60')]({'plain':!![]});return db[_0x5d7d('0x61')][_0x5d7d('0x55')]({'where':{'id':_0x5b0f8a['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x5df345,null))['then'](function(_0x5af086){if(_0x5af086){return _0x5af086[_0x5d7d('0x37')]({'UserId':_0x1981de['body'][_0x5d7d('0x5e')],'read1stAt':_[_0x5d7d('0x62')](_0x5af086[_0x5d7d('0x63')])?moment()['format'](_0x5d7d('0x5d')):undefined});}return null;})[_0x5d7d('0x22')](function(_0x2dd81c){if(_0x2dd81c){_0x1ba205['interaction']=_0x2dd81c[_0x5d7d('0x60')]({'plain':!![]});interaction_log[_0x5d7d('0x23')](_0x5d7d('0x64'),_0x1981de[_0x5d7d('0x65')]['id'],_0x1981de['user'][_0x5d7d('0x3e')],_0x1981de[_0x5d7d('0x65')]['role'],_0x1ba205['interaction']['id'],_0x1981de['body']?JSON[_0x5d7d('0x66')](_0x1981de['body']):'null');return respondWithRpcPromise(_0x5d7d('0x67'),_0x5d7d('0x68'),_0x1ba205);}return null;})[_0x5d7d('0x22')](function(_0x5154ca){var _0x19864a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5154ca[_0x5d7d('0x29')][_0x5d7d('0x69')];return db[_0x5d7d('0x6a')][_0x5d7d('0x3f')](_0x19864a,{'type':db[_0x5d7d('0x6b')][_0x5d7d('0x6c')][_0x5d7d('0x6d')],'raw':!![]})[_0x5d7d('0x22')](function(_0x4c30e5){return _0x4c30e5;});})[_0x5d7d('0x22')](function(_0x5d9e2d){if(_0x5d9e2d){_0x1ba205[_0x5d7d('0x29')][_0x5d7d('0x6e')]=_0x5d9e2d[0x0];if(!_0x1981de[_0x5d7d('0x57')]['UserId'])return;return db[_0x5d7d('0x6f')][_0x5d7d('0x55')]({'where':{'id':_0x1981de[_0x5d7d('0x57')][_0x5d7d('0x5e')],'role':_0x5d7d('0x5f')},'attributes':['id',_0x5d7d('0x3e'),_0x5d7d('0x70'),_0x5d7d('0x71'),_0x5d7d('0x72')],'raw':!![]});}return null;})[_0x5d7d('0x22')](function(_0x19a858){if(!_0x19a858)return null;_0x1ba205[_0x5d7d('0x29')]['agent']=_0x19a858;return _0x1ba205;})[_0x5d7d('0x22')](function(_0x2dfcb2){if(_0x2dfcb2){if(_0x1981de[_0x5d7d('0x57')][_0x5d7d('0x73')]){_0x1ba205[_0x5d7d('0x29')][_0x5d7d('0x74')]=util[_0x5d7d('0x5c')]('SIP/%s',_0x1981de['user']['name']);_0x1ba205[_0x5d7d('0x29')]['channel']=_0x1ba205[_0x5d7d('0x75')];_0x1ba205[_0x5d7d('0x29')][_0x5d7d('0x76')]=_0x1ba205['channel'];_0x1ba205['message'][_0x5d7d('0x77')]=_0x5d7d('0x5a');return respondWithRpcPromise(_0x5d7d('0x78'),_0x5d7d('0x78'),{'event':_0x5d7d('0x79'),'message':_0x1ba205['message']},client9002)['then'](function(){return _0x1ba205;});}return _0x1ba205;}return null;})[_0x5d7d('0x22')](respondWithResult(_0x5df345,null))[_0x5d7d('0x53')](handleError(_0x5df345,null));};var interaction_log=require(_0x5d7d('0x17'))(_0x5d7d('0x59'));exports[_0x5d7d('0x7a')]=function(_0x7adacc,_0x1459e1,_0x393f7f){var _0x358225={'agent':{},'channel':_0x5d7d('0x5b')};if(_0x7adacc[_0x5d7d('0x57')]['id']){delete _0x7adacc[_0x5d7d('0x57')]['id'];}_0x7adacc['body'][_0x5d7d('0x5e')]=_0x7adacc[_0x5d7d('0x57')][_0x5d7d('0x5e')]||_0x7adacc[_0x5d7d('0x65')]['id'];_0x358225[_0x5d7d('0x5f')]['id']=_0x7adacc[_0x5d7d('0x57')][_0x5d7d('0x5e')];return db['SmsMessage']['find']({'where':{'id':_0x7adacc[_0x5d7d('0x54')]['id'],'UserId':null}})[_0x5d7d('0x22')](handleEntityNotFound(_0x1459e1,null))[_0x5d7d('0x22')](function(_0x41440f){if(_0x41440f){_0x358225['message']=_0x41440f[_0x5d7d('0x60')]({'plain':!![]});return db[_0x5d7d('0x61')][_0x5d7d('0x55')]({'where':{'id':_0x41440f['SmsInteractionId']}});}return null;})[_0x5d7d('0x22')](handleEntityNotFound(_0x1459e1,null))[_0x5d7d('0x22')](function(_0x1a2ea1){if(_0x1a2ea1){_0x358225[_0x5d7d('0x7b')]=_0x1a2ea1[_0x5d7d('0x60')]({'plain':!![]});interaction_log['info'](_0x5d7d('0x7c'),_0x7adacc['user']['id'],_0x7adacc[_0x5d7d('0x65')]['name'],_0x7adacc[_0x5d7d('0x65')]['role'],_0x358225['interaction']['id'],_0x7adacc[_0x5d7d('0x57')]?JSON['stringify'](_0x7adacc[_0x5d7d('0x57')]):'null');return respondWithRpcPromise(_0x5d7d('0x7d'),_0x5d7d('0x7e'),_0x358225);}return null;})['then'](function(_0x4b9eb5){var _0x4b1fde=_0x5d7d('0x7f')+_0x4b9eb5[_0x5d7d('0x29')][_0x5d7d('0x69')];return db['sequelize'][_0x5d7d('0x3f')](_0x4b1fde,{'type':db['Sequelize'][_0x5d7d('0x6c')][_0x5d7d('0x6d')],'raw':!![]})['then'](function(_0x4866ea){return _0x4866ea;});})[_0x5d7d('0x22')](function(_0x3861b0){if(_0x3861b0){_0x358225[_0x5d7d('0x29')][_0x5d7d('0x6e')]=_0x3861b0[0x0];if(!_0x7adacc[_0x5d7d('0x57')][_0x5d7d('0x5e')])return;return db[_0x5d7d('0x6f')]['find']({'where':{'id':_0x7adacc[_0x5d7d('0x57')][_0x5d7d('0x5e')],'role':_0x5d7d('0x5f')},'attributes':['id',_0x5d7d('0x3e'),_0x5d7d('0x70'),_0x5d7d('0x71'),_0x5d7d('0x72')],'raw':!![]});}return null;})[_0x5d7d('0x22')](function(_0x481a3c){if(!_0x481a3c)return null;_0x358225[_0x5d7d('0x29')][_0x5d7d('0x5f')]=_0x481a3c;return _0x358225;})[_0x5d7d('0x22')](function(_0x488b9e){if(_0x488b9e){_0x488b9e[_0x5d7d('0x29')][_0x5d7d('0x74')]=util[_0x5d7d('0x5c')]('SIP/%s',_0x7adacc[_0x5d7d('0x65')][_0x5d7d('0x3e')]);_0x488b9e[_0x5d7d('0x29')][_0x5d7d('0x75')]=_0x358225[_0x5d7d('0x75')];_0x488b9e[_0x5d7d('0x29')]['motionChannel']=_0x358225[_0x5d7d('0x75')];_0x488b9e[_0x5d7d('0x29')]['event']=_0x5d7d('0x7a');respondWithRpcPromise(_0x5d7d('0x78'),_0x5d7d('0x78'),{'event':_0x5d7d('0x80'),'message':_0x488b9e['message']},client9002);return _0x358225;}return null;})[_0x5d7d('0x22')](respondWithResult(_0x1459e1,null))['catch'](handleError(_0x1459e1,null));};exports[_0x5d7d('0x2c')]=function(_0x2ec919,_0x272ea7,_0x36fa7c){if(_0x2ec919[_0x5d7d('0x57')]['id']){delete _0x2ec919[_0x5d7d('0x57')]['id'];}var _0x1688d6;return db[_0x5d7d('0x52')][_0x5d7d('0x55')]({'where':{'id':_0x2ec919[_0x5d7d('0x54')]['id']}})[_0x5d7d('0x22')](handleEntityNotFound(_0x272ea7,null))[_0x5d7d('0x22')](function(_0x5a6779){if(_0x5a6779){_0x1688d6=_0x5a6779;return db[_0x5d7d('0x81')][_0x5d7d('0x55')]({'where':{'id':_0x5a6779['SmsAccountId']}});}})['then'](handleEntityNotFound(_0x272ea7,null))[_0x5d7d('0x22')](function(_0x346c67){if(_0x346c67){logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0x346c67[_0x5d7d('0x3c')],util['inspect'](_0x2ec919[_0x5d7d('0x57')],{'showHidden':![],'depth':null}));switch(_0x346c67[_0x5d7d('0x3c')]){case _0x5d7d('0x82'):if(_0x2ec919['body'][_0x5d7d('0x83')]&&_0x2ec919['body'][_0x5d7d('0x83')]===_0x1688d6[_0x5d7d('0x84')]){return _0x1688d6['update']({'read':!![]});}else{logger[_0x5d7d('0x28')](_0x5d7d('0x85'),_0x5d7d('0x2c'),_0x5d7d('0x82'),util['inspect'](_0x2ec919['body'],{'showHidden':![],'depth':null}));}break;case _0x5d7d('0x86'):if(_0x2ec919[_0x5d7d('0x57')][_0x5d7d('0x87')]&&_0x2ec919['body'][_0x5d7d('0x87')]===_0x1688d6[_0x5d7d('0x84')]&&_[_0x5d7d('0x88')]([_0x5d7d('0x89'),_0x5d7d('0x8a')],_0x2ec919['body'][_0x5d7d('0x8b')])>=0x0){return _0x1688d6[_0x5d7d('0x37')]({'read':!![]});}else{logger['error'](_0x5d7d('0x85'),_0x5d7d('0x2c'),'plivio',util[_0x5d7d('0x8c')](_0x2ec919[_0x5d7d('0x57')],{'showHidden':![],'depth':null}));}break;case _0x5d7d('0x8d'):var _0x5cec58=_0x2ec919[_0x5d7d('0x57')][_0x5d7d('0x8e')][0x0];if(_0x5cec58['status'][_0x5d7d('0x8f')]==='DELIVERED'){return _0x1688d6['update']({'read':!![]});}else{logger[_0x5d7d('0x28')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5d7d('0x2c'),_0x5d7d('0x8d'),util[_0x5d7d('0x8c')](_0x2ec919[_0x5d7d('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x1688d6;}})['then'](respondWithResult(_0x272ea7,null))[_0x5d7d('0x53')](handleError(_0x272ea7,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 4e1ea5c..93a5229 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 _0x8708=['emit','hasOwnProperty','hook','exports','events','SmsMessage','save','update'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x8708,0x7c));var _0x8870=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x8708[_0x4b055c];return _0x4b62bb;};'use strict';var EventEmitter=require(_0x8870('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x8870('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8870('0x2'),'afterUpdate':_0x8870('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4dad40){return function(_0x2be7e3,_0x4bb23a,_0x44f158){SmsMessageEvents[_0x8870('0x4')](_0x4dad40+':'+_0x2be7e3['id'],_0x2be7e3);SmsMessageEvents[_0x8870('0x4')](_0x4dad40,_0x2be7e3);_0x44f158(null);};}for(var e in events){if(events[_0x8870('0x5')](e)){var event=events[e];SmsMessage[_0x8870('0x6')](e,emitEvent(event));}}module[_0x8870('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0x9a60=['hook','../../mysqldb','SmsMessage','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x408d58,_0x4ffeae){var _0x4a4ccf=function(_0x194f67){while(--_0x194f67){_0x408d58['push'](_0x408d58['shift']());}};_0x4a4ccf(++_0x4ffeae);}(_0x9a60,0xbe));var _0x09a6=function(_0x10ba4f,_0xa870a4){_0x10ba4f=_0x10ba4f-0x0;var _0x4fdcec=_0x9a60[_0x10ba4f];return _0x4fdcec;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x09a6('0x0'))['db'][_0x09a6('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x09a6('0x2')](0x0);var events={'afterCreate':_0x09a6('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x212247){return function(_0xfdc6b9,_0x40c406,_0x2dcef1){SmsMessageEvents[_0x09a6('0x4')](_0x212247+':'+_0xfdc6b9['id'],_0xfdc6b9);SmsMessageEvents[_0x09a6('0x4')](_0x212247,_0xfdc6b9);_0x2dcef1(null);};}for(var e in events){if(events[_0x09a6('0x5')](e)){var event=events[e];SmsMessage[_0x09a6('0x6')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 733b667..ecf49d3 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 _0xe80a=['Missing\x20parameters:\x20username,\x20password','plivo','authId','remote','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/api/sms/messages/','IBSSO\x20','Missing\x20parameters:\x20base_url','crypto','apiKey','sender','text','timestamp','keys','sort','md5','digest','hex','GET','csc','Missing\x20parameters:\x20apiKey','clickatell','UTF-8','apiMessageId','bandwidth','accountId','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','application/json','status','refid','Token\x20not\x20received','finally','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','define','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','UserId','isNil','SmsInteraction','findOne','SmsInteractionId','createdAt','catch','error','SmsAccount','SmsAccountId','accountSid','authToken','phone','messages','/status?token=','token','then','sid','afterCreate','twilio','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','login?username=','&password=','password','split','sms','user_key','session_key','deliveryReport','read','update','inspect','connectel','senderString','POST','https://smsapi.connectel.se/api/v2/send/','clicksend','xCALLY\x20Motion','format','Basic\x20%s','base64','http_code','data','queued_count','head','message_id','clickSend'];(function(_0x27fc94,_0x1041e7){var _0x151e73=function(_0x8dce68){while(--_0x8dce68){_0x27fc94['push'](_0x27fc94['shift']());}};_0x151e73(++_0x1041e7);}(_0xe80a,0x17d));var _0xae80=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xe80a[_0x40ac5e];return _0x2839d6;};'use strict';var _=require(_0xae80('0x0'));var util=require('util');var logger=require(_0xae80('0x1'))(_0xae80('0x2'));var moment=require(_0xae80('0x3'));var BPromise=require(_0xae80('0x4'));var rp=require(_0xae80('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xae80('0x6'));var config=require(_0xae80('0x7'));var attributes=require(_0xae80('0x8'));module['exports']=function(_0x389cf9,_0x56614d){return _0x389cf9[_0xae80('0x9')]('SmsMessage',attributes,{'tableName':_0xae80('0xa'),'paranoid':![],'indexes':[{'name':_0xae80('0xb'),'fields':[_0xae80('0xb')]},{'name':_0xae80('0xc'),'fields':[_0xae80('0xd')],'type':_0xae80('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3c4db9,_0x1e0937,_0xc4d010){var _0x991d80=_0x389cf9[_0xae80('0xf')];var _0x44f4a9=_0x3c4db9['get']({'plain':!![]});if(_0x44f4a9[_0xae80('0x10')][_0xae80('0x11')]()==='in'||_0x44f4a9[_0xae80('0x10')][_0xae80('0x11')]()===_0xae80('0x12')&&!_0x44f4a9[_0xae80('0x13')]&&!_['isNil'](_0x44f4a9[_0xae80('0x14')])&&!_[_0xae80('0x15')](_0x44f4a9['SmsInteractionId'])){_0x991d80[_0xae80('0x16')][_0xae80('0x17')]({'where':{'id':_0x44f4a9[_0xae80('0x18')]}})['then'](function(_0x49e428){if(_0x49e428){_0x49e428['update']({'lastMsgAt':_0x44f4a9[_0xae80('0x19')],'lastMsgDirection':_0x44f4a9[_0xae80('0x10')]['toLowerCase']()});}})[_0xae80('0x1a')](function(_0xa1632){console[_0xae80('0x1b')](_0xa1632);});}if(_0x44f4a9['direction']==='out'&&!_0x44f4a9[_0xae80('0x13')]){var _0x444f63;_0x991d80[_0xae80('0x1c')]['find']({'where':{'id':_0x44f4a9[_0xae80('0x1d')]},'raw':!![]})['then'](function(_0x1390ba){_0x444f63=_0x1390ba;if(_0x444f63&&_0x444f63['type']){switch(_0x444f63['type']){case'twilio':var _0x76b705=require('twilio');if(_0x444f63[_0xae80('0x1e')]&&_0x444f63[_0xae80('0x1f')]&&_0x444f63[_0xae80('0x20')]){var _0x1ce6ac=new _0x76b705(_0x444f63[_0xae80('0x1e')],_0x444f63[_0xae80('0x1f')]);_0x1ce6ac[_0xae80('0x21')]['create']({'body':_0x44f4a9[_0xae80('0xd')],'to':_0x44f4a9['phone'],'from':_0x444f63[_0xae80('0x20')],'statusCallback':_0x444f63['remote']+'/api/sms/messages/'+_0x44f4a9['id']+_0xae80('0x22')+_0x444f63[_0xae80('0x23')]})[_0xae80('0x24')](function(_0xcca717){if(_0xcca717[_0xae80('0x25')]){return _0x3c4db9['update']({'messageId':_0xcca717[_0xae80('0x25')]});}})[_0xae80('0x1a')](function(_0x22da3b){logger[_0xae80('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xae80('0x26'),_0xae80('0x27'),util['inspect'](_0x22da3b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xae80('0x28'),_0xae80('0x26'),_0xae80('0x27'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xae80('0x29'):var _0x220997=_0xae80('0x2a');if(_0x444f63[_0xae80('0x2b')]&&_0x444f63['password']){var _0x55c21f={'recipient':[_0x44f4a9[_0xae80('0x20')]],'message':_0x44f4a9['body'],'message_type':_0x444f63['smsMethod']};if(_0x444f63[_0xae80('0x2c')]&&_0x444f63[_0xae80('0x2c')]!=='SI'){_0x55c21f['sender']=_0x444f63[_0xae80('0x20')];}var _0x5e370e={'url':_0x220997+_0xae80('0x2d')+_0x444f63[_0xae80('0x2b')]+_0xae80('0x2e')+_0x444f63[_0xae80('0x2f')],'method':'GET'};rp(_0x5e370e)[_0xae80('0x24')](function(_0x17aa57){var _0x2cf85a=_0x17aa57[_0xae80('0x30')](';');var _0x53fc31={'user_key':_0x2cf85a[0x0],'session_key':_0x2cf85a[0x1]};_0x5e370e={'url':_0x220997+_0xae80('0x31'),'method':'POST','headers':{'user_key':_0x53fc31[_0xae80('0x32')],'Session_key':_0x53fc31[_0xae80('0x33')]},'json':!![],'body':_0x55c21f};return rp(_0x5e370e);})[_0xae80('0x24')](function(_0x28867d){if(_0x28867d['total_sent']>=0x1){var _0x4f16ae={'messageId':_0x28867d['internal_order_id']};if(_0x444f63[_0xae80('0x2c')]!=='GP'||!_0x444f63[_0xae80('0x34')]){_0x4f16ae[_0xae80('0x35')]=!![];}return _0x3c4db9[_0xae80('0x36')](_0x4f16ae);}else{return logger[_0xae80('0x1b')](_0xae80('0x28'),'afterCreate',_0xae80('0x29'),util[_0xae80('0x37')](_0x28867d,{'showHidden':![],'depth':null}));}})[_0xae80('0x1a')](function(_0x4a8d2a){return logger['error'](_0xae80('0x28'),_0xae80('0x26'),'skebby',util[_0xae80('0x37')](_0x4a8d2a,{'showHidden':![],'depth':null}));});}else{logger[_0xae80('0x1b')](_0xae80('0x28'),_0xae80('0x26'),_0xae80('0x29'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xae80('0x38'):if(_0x444f63[_0xae80('0x1f')]){var _0x13b772={'recipient':_0x44f4a9[_0xae80('0x20')],'message':_0x44f4a9[_0xae80('0xd')],'sender':_0x444f63[_0xae80('0x39')]||_0x444f63[_0xae80('0x20')],'authorization':_0x444f63[_0xae80('0x1f')]};var _0x1e0937={'method':_0xae80('0x3a'),'uri':_0xae80('0x3b'),'body':_0x13b772,'json':!![]};rp(_0x1e0937)['then'](function(_0x4c89f3){var _0x974cee={'messageId':_0x4c89f3['requestid']};if(!_0x444f63['deliveryReport']){_0x974cee['read']=!![];}return _0x3c4db9[_0xae80('0x36')](_0x974cee);})[_0xae80('0x1a')](function(_0x3ff9ee){logger[_0xae80('0x1b')](_0xae80('0x28'),_0xae80('0x26'),_0xae80('0x38'),util[_0xae80('0x37')](_0x3ff9ee,{'showHidden':![],'depth':null}));});}else{logger[_0xae80('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xae80('0x26'),_0xae80('0x38'),'Missing\x20parameters:\x20authToken');}break;case _0xae80('0x3c'):if(_0x444f63['username']&&_0x444f63[_0xae80('0x2f')]){var _0x13b772={'messages':[{'source':_0xae80('0x3d'),'to':_0x44f4a9[_0xae80('0x20')],'body':_0x44f4a9['body'],'from':_0x444f63[_0xae80('0x39')]||_0x444f63[_0xae80('0x20')]}]};var _0xbc7698=util['format']('%s:%s',_0x444f63[_0xae80('0x2b')],_0x444f63[_0xae80('0x2f')]);var _0x1e0937={'method':_0xae80('0x3a'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x13b772,'headers':{'Authorization':util[_0xae80('0x3e')](_0xae80('0x3f'),new Buffer(_0xbc7698)['toString'](_0xae80('0x40')))},'json':!![]};rp(_0x1e0937)[_0xae80('0x24')](function(_0x1aa573){if(_0x1aa573[_0xae80('0x41')]>=0xc8&&_0x1aa573['http_code']<=0xce){if(_0x1aa573[_0xae80('0x42')]&&_0x1aa573[_0xae80('0x42')][_0xae80('0x43')]>0x0){var _0x5591cb=_[_0xae80('0x44')](_0x1aa573[_0xae80('0x42')][_0xae80('0x21')]);var _0x27eefb={'messageId':_0x5591cb[_0xae80('0x45')]};if(!_0x444f63[_0xae80('0x34')]){_0x27eefb['read']=!![];}return _0x3c4db9[_0xae80('0x36')](_0x27eefb);}else{logger[_0xae80('0x1b')](_0xae80('0x28'),'afterCreate','clickSend',util[_0xae80('0x37')](_0x1aa573,{'showHidden':![],'depth':null}));}}else{logger[_0xae80('0x1b')](_0xae80('0x28'),'afterCreate',_0xae80('0x46'),util[_0xae80('0x37')](_0x1aa573,{'showHidden':![],'depth':null}));}})[_0xae80('0x1a')](function(_0x19679d){logger['error'](_0xae80('0x28'),_0xae80('0x26'),_0xae80('0x46'),util[_0xae80('0x37')](_0x19679d,{'showHidden':![],'depth':null}));});}else{logger[_0xae80('0x1b')](_0xae80('0x28'),_0xae80('0x26'),_0xae80('0x46'),_0xae80('0x47'));}break;case _0xae80('0x48'):if(_0x444f63[_0xae80('0x49')]&&_0x444f63[_0xae80('0x1f')]){var _0x13b772={'dst':_0x44f4a9[_0xae80('0x20')],'text':_0x44f4a9[_0xae80('0xd')],'src':_0x444f63['senderString']||_0x444f63[_0xae80('0x20')],'url':_0x444f63[_0xae80('0x4a')]+'/api/sms/messages/'+_0x44f4a9['id']+_0xae80('0x22')+_0x444f63[_0xae80('0x23')]};var _0xbc7698=util[_0xae80('0x3e')]('%s:%s',_0x444f63['authId'],_0x444f63[_0xae80('0x1f')]);var _0x1e0937={'method':_0xae80('0x3a'),'uri':util['format']('https://api.plivo.com/v1/Account/%s/Message/',_0x444f63[_0xae80('0x49')]),'body':_0x13b772,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0xbc7698)['toString'](_0xae80('0x40')))},'json':!![]};rp(_0x1e0937)[_0xae80('0x24')](function(_0x245f8e){var _0x425381={'messageId':_0x245f8e['message_uuid'][0x0]};return _0x3c4db9[_0xae80('0x36')](_0x425381);})[_0xae80('0x1a')](function(_0x113361){logger[_0xae80('0x1b')](_0xae80('0x28'),'afterCreate','plivo',util[_0xae80('0x37')](_0x113361,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xae80('0x28'),_0xae80('0x26'),_0xae80('0x48'),_0xae80('0x4b'));}break;case _0xae80('0x4c'):if(_0x444f63[_0xae80('0x2b')]&&_0x444f63[_0xae80('0x2f')]){if(_0x444f63[_0xae80('0x4d')]){var _0x7e0b39={'method':'POST','uri':_0x444f63[_0xae80('0x4d')]+_0xae80('0x4e'),'body':{'username':_0x444f63[_0xae80('0x2b')],'password':_0x444f63[_0xae80('0x2f')]},'json':!![]};return rp(_0x7e0b39)[_0xae80('0x24')](function(_0x5b8067){var _0x130530={'method':_0xae80('0x3a'),'uri':_0x444f63[_0xae80('0x4d')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x444f63[_0xae80('0x20')],'destinations':[{'to':_0x44f4a9['phone']}],'text':_0x44f4a9['body'],'notifyUrl':_0x444f63['remote']+_0xae80('0x4f')+_0x44f4a9['id']+_0xae80('0x22')+_0x444f63[_0xae80('0x23')],'notifyContentType':'application/json','callbackData':_0x444f63[_0xae80('0x20')]+';'+_0x44f4a9['body']}]},'headers':{'Authorization':_0xae80('0x50')+_0x5b8067[_0xae80('0x23')]},'json':!![]};return rp(_0x130530)[_0xae80('0x24')](function(_0x1b8aa9){if(_0x1b8aa9['messages']){var _0x246fb3={'messageId':_0x1b8aa9['messages'][0x0]['messageId']};if(!_0x444f63[_0xae80('0x34')]){_0x246fb3[_0xae80('0x35')]=!![];}return _0x3c4db9[_0xae80('0x36')](_0x246fb3);}else{return logger[_0xae80('0x1b')](_0xae80('0x28'),_0xae80('0x26'),_0xae80('0x4c'),util['inspect'](_0x1b8aa9,{'showHidden':![],'depth':null}));}});})[_0xae80('0x1a')](function(_0x5a028d){return logger[_0xae80('0x1b')](_0xae80('0x28'),_0xae80('0x26'),_0xae80('0x4c'),util[_0xae80('0x37')](_0x5a028d,{'showHidden':![],'depth':null}));});}else{logger[_0xae80('0x1b')](_0xae80('0x28'),_0xae80('0x26'),'infobip',_0xae80('0x51'));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xae80('0x26'),_0xae80('0x4c'),_0xae80('0x47'));}break;case'csc':var _0x250bf0=require(_0xae80('0x52'));if(_0x444f63[_0xae80('0x53')]){var _0x4d0877={};_0x4d0877['login']=_0x444f63[_0xae80('0x2b')];_0x4d0877[_0xae80('0x20')]=_0x44f4a9[_0xae80('0x20')];_0x4d0877[_0xae80('0x54')]=_0x444f63[_0xae80('0x20')];_0x4d0877[_0xae80('0x55')]=_0x44f4a9[_0xae80('0xd')];_0x4d0877[_0xae80('0x56')]=+new Date();var _0x4002ef='';var _0x2e984b='';var _0x31a9f2=Object[_0xae80('0x57')](_0x4d0877);_0x31a9f2[_0xae80('0x58')]();for(var _0x4a6c3b=0x0;_0x4a6c3b<_0x31a9f2['length'];_0x4a6c3b++){if(_0x4002ef!=''){_0x4002ef+='&';}_0x4002ef+=_0x31a9f2[_0x4a6c3b]+'='+encodeURIComponent(_0x4d0877[_0x31a9f2[_0x4a6c3b]]);_0x2e984b+=_0x4d0877[_0x31a9f2[_0x4a6c3b]];}_0x2e984b+=_0x444f63[_0xae80('0x53')];_0x2e984b=_0x250bf0['createHash'](_0xae80('0x59'))[_0xae80('0x36')](_0x2e984b)[_0xae80('0x5a')](_0xae80('0x5b'));if(_0x4002ef!==''){_0x4002ef+='&';}_0x4002ef+='signature='+_0x2e984b;var _0x5e370e={'method':_0xae80('0x5c'),'uri':_0x444f63['baseUrl']+'/external/get/send.php?'+_0x4002ef,'json':!![]};return rp(_0x5e370e)['then'](function(_0x405bf5){var _0x2bd7f9=Object[_0xae80('0x57')](_0x405bf5);if(_0x405bf5[_0x2bd7f9[0x0]]['error']&&parseInt(_0x405bf5[_0x2bd7f9[0x0]][_0xae80('0x1b')])===0x0){var _0x103ec7={'messageId':_0x405bf5[_0x2bd7f9[0x0]]['id_sms']};if(!_0x444f63['deliveryReport']){_0x103ec7[_0xae80('0x35')]=!![];}return _0x3c4db9['update'](_0x103ec7);}else{return logger[_0xae80('0x1b')](_0xae80('0x28'),_0xae80('0x26'),_0xae80('0x5d'),util[_0xae80('0x37')](_0x405bf5['error'],{'showHidden':![],'depth':null}));}})[_0xae80('0x1a')](function(_0x3dce5d){return logger[_0xae80('0x1b')](_0xae80('0x28'),_0xae80('0x26'),'csc',util[_0xae80('0x37')](_0x3dce5d,{'showHidden':![],'depth':null}));});}else{logger[_0xae80('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xae80('0x26'),_0xae80('0x5d'),_0xae80('0x5e'));}break;case _0xae80('0x5f'):if(_0x444f63['apiKey']){var _0x111d1e={'method':_0xae80('0x3a'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x444f63['apiKey']},'body':{'content':_0x44f4a9[_0xae80('0xd')],'to':[_0x44f4a9[_0xae80('0x20')]],'from':_0x444f63[_0xae80('0x20')],'binary':![],'clientMessageId':'uuid','charset':_0xae80('0x60')},'json':!![]};rp(_0x111d1e)[_0xae80('0x24')](function(_0x4f953e){if(!_0x4f953e[_0xae80('0x1b')]){var _0x14c7b7={'messageId':_0x4f953e[_0xae80('0x21')][0x0][_0xae80('0x61')]};if(!_0x444f63[_0xae80('0x34')]){_0x14c7b7[_0xae80('0x35')]=!![];}return _0x3c4db9[_0xae80('0x36')](_0x14c7b7);}else{return logger[_0xae80('0x1b')](_0xae80('0x28'),'afterCreate',_0xae80('0x5f'),util[_0xae80('0x37')](_0x4f953e[_0xae80('0x1b')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x123eac){return logger['error'](_0xae80('0x28'),_0xae80('0x26'),_0xae80('0x5f'),util[_0xae80('0x37')](_0x123eac,{'showHidden':![],'depth':null}));});}else{logger[_0xae80('0x1b')](_0xae80('0x28'),_0xae80('0x26'),_0xae80('0x5f'),'Missing\x20parameters:\x20apiKey');}break;case _0xae80('0x62'):if(_0x444f63[_0xae80('0x2b')]&&_0x444f63[_0xae80('0x2f')]){var _0xbc7698=util['format']('%s:%s',_0x444f63[_0xae80('0x2b')],_0x444f63[_0xae80('0x2f')]);var _0x1e0937={'method':_0xae80('0x3a'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x444f63[_0xae80('0x63')]+'/messages','body':{'to':[_0x44f4a9[_0xae80('0x20')]],'text':_0x44f4a9[_0xae80('0xd')],'from':_0x444f63['phone'],'applicationId':_0x444f63[_0xae80('0x64')]},'headers':{'Authorization':util[_0xae80('0x3e')](_0xae80('0x3f'),new Buffer(_0xbc7698)['toString']('base64'))},'json':!![]};rp(_0x1e0937)['then'](function(_0x12dc68){if(_0x12dc68['id']){var _0x41d5b1={'messageId':_0x12dc68['id']};return _0x3c4db9[_0xae80('0x36')](_0x41d5b1);}else{logger[_0xae80('0x1b')](_0xae80('0x28'),'afterCreate',_0xae80('0x62'),util[_0xae80('0x37')](_0x12dc68,{'showHidden':![],'depth':null}));}})[_0xae80('0x1a')](function(_0x251989){logger[_0xae80('0x1b')](_0xae80('0x28'),_0xae80('0x26'),_0xae80('0x62'),util[_0xae80('0x37')](_0x251989,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xae80('0x26'),'bandwidth',_0xae80('0x47'));}break;case _0xae80('0x65'):if(_0x444f63[_0xae80('0x53')]){var _0x3123ab={};var _0x5e370e={'method':_0xae80('0x3a'),'uri':_0xae80('0x66'),'headers':{'Authorization':_0xae80('0x67')+_0x444f63[_0xae80('0x53')],'Content-Type':'application/json'},'body':{'from':_0x444f63['phone'],'to':_0x44f4a9[_0xae80('0x20')],'text':_0x44f4a9['body']},'json':!![]};return rp(_0x5e370e)[_0xae80('0x24')](function(_0x335b26){if(_0x335b26[_0xae80('0x68')]==0xca){_0x3123ab[_0xae80('0x69')]=_0x335b26;var _0x1cfd10={'method':_0xae80('0x3a'),'uri':_0xae80('0x6a'),'headers':{'Authorization':_0xae80('0x67')+_0x444f63[_0xae80('0x53')],'Content-Type':_0xae80('0x6b')},'body':{'refid':_0x3123ab[_0xae80('0x69')]['refid']},'json':!![]};return rp(_0x1cfd10)[_0xae80('0x24')](function(_0x41796e){_0x3123ab[_0xae80('0x6c')]=_0x41796e;var _0x38f627={'messageId':_0x3123ab[_0xae80('0x69')][_0xae80('0x6d')],'read':!![]};return _0x3c4db9[_0xae80('0x36')](_0x38f627);});}else{return logger[_0xae80('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xae80('0x65'),util[_0xae80('0x37')](_0x335b26,{'showHidden':![],'depth':null}));}})['catch'](function(_0x406bc7){return logger['error'](_0xae80('0x28'),_0xae80('0x26'),'intelepeer',util['inspect'](_0x406bc7,{'showHidden':![],'depth':null}));});}else{return logger[_0xae80('0x1b')](_0xae80('0x28'),_0xae80('0x26'),_0xae80('0x65'),_0xae80('0x6e'));}break;}}})[_0xae80('0x6f')](function(){_0xc4d010();});}else{_0xc4d010();}}},'charset':_0xae80('0x70'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4e64=['csc','Missing\x20parameters:\x20apiKey','clickatell','uuid','bandwidth','accountId','applicationId','base64','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','exports','define','SmsMessage','sms_messages','messageId','body','FULLTEXT','get','toLowerCase','direction','out','isNil','UserId','SmsInteractionId','findOne','then','update','createdAt','catch','error','secret','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','create','remote','/api/sms/messages/','/status?token=','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/','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','total_sent','internal_order_id','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','requestid','xCALLY\x20Motion','format','Basic\x20%s','http_code','data','queued_count','head','messages','message_id','clickSend','plivo','authId','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','application/json','deliveryReport','infobip','Missing\x20parameters:\x20base_url','apiKey','text','length','createHash','md5','/external/get/send.php?','keys','id_sms'];(function(_0x4bc0f7,_0x329c69){var _0x1fa851=function(_0x53173d){while(--_0x53173d){_0x4bc0f7['push'](_0x4bc0f7['shift']());}};_0x1fa851(++_0x329c69);}(_0x4e64,0xf3));var _0x44e6=function(_0x3b0295,_0x218b0b){_0x3b0295=_0x3b0295-0x0;var _0x2cdd32=_0x4e64[_0x3b0295];return _0x2cdd32;};'use strict';var _=require('lodash');var util=require(_0x44e6('0x0'));var logger=require(_0x44e6('0x1'))('api');var moment=require(_0x44e6('0x2'));var BPromise=require(_0x44e6('0x3'));var rp=require(_0x44e6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x44e6('0x5'));var attributes=require('./smsMessage.attributes');module[_0x44e6('0x6')]=function(_0x4b7aec,_0x25148b){return _0x4b7aec[_0x44e6('0x7')](_0x44e6('0x8'),attributes,{'tableName':_0x44e6('0x9'),'paranoid':![],'indexes':[{'name':_0x44e6('0xa'),'fields':[_0x44e6('0xa')]},{'name':'fti_sms_messages','fields':[_0x44e6('0xb')],'type':_0x44e6('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x178907,_0x396c4c,_0x5dfcc9){var _0x3abfd2=_0x4b7aec['models'];var _0x3a23e8=_0x178907[_0x44e6('0xd')]({'plain':!![]});if(_0x3a23e8['direction'][_0x44e6('0xe')]()==='in'||_0x3a23e8[_0x44e6('0xf')]['toLowerCase']()===_0x44e6('0x10')&&!_0x3a23e8['secret']&&!_[_0x44e6('0x11')](_0x3a23e8[_0x44e6('0x12')])&&!_[_0x44e6('0x11')](_0x3a23e8[_0x44e6('0x13')])){_0x3abfd2['SmsInteraction'][_0x44e6('0x14')]({'where':{'id':_0x3a23e8['SmsInteractionId']}})[_0x44e6('0x15')](function(_0x3b0360){if(_0x3b0360){_0x3b0360[_0x44e6('0x16')]({'lastMsgAt':_0x3a23e8[_0x44e6('0x17')],'lastMsgDirection':_0x3a23e8[_0x44e6('0xf')][_0x44e6('0xe')]()});}})[_0x44e6('0x18')](function(_0x1ab98f){console[_0x44e6('0x19')](_0x1ab98f);});}if(_0x3a23e8['direction']===_0x44e6('0x10')&&!_0x3a23e8[_0x44e6('0x1a')]){var _0x3cc5b8;_0x3abfd2[_0x44e6('0x1b')][_0x44e6('0x1c')]({'where':{'id':_0x3a23e8[_0x44e6('0x1d')]},'raw':!![]})['then'](function(_0x564d18){_0x3cc5b8=_0x564d18;if(_0x3cc5b8&&_0x3cc5b8[_0x44e6('0x1e')]){switch(_0x3cc5b8[_0x44e6('0x1e')]){case'twilio':var _0x4b989e=require(_0x44e6('0x1f'));if(_0x3cc5b8[_0x44e6('0x20')]&&_0x3cc5b8[_0x44e6('0x21')]&&_0x3cc5b8[_0x44e6('0x22')]){var _0x33ec0d=new _0x4b989e(_0x3cc5b8[_0x44e6('0x20')],_0x3cc5b8[_0x44e6('0x21')]);_0x33ec0d['messages'][_0x44e6('0x23')]({'body':_0x3a23e8[_0x44e6('0xb')],'to':_0x3a23e8[_0x44e6('0x22')],'from':_0x3cc5b8[_0x44e6('0x22')],'statusCallback':_0x3cc5b8[_0x44e6('0x24')]+_0x44e6('0x25')+_0x3a23e8['id']+_0x44e6('0x26')+_0x3cc5b8[_0x44e6('0x27')]})[_0x44e6('0x15')](function(_0x2c8e98){if(_0x2c8e98[_0x44e6('0x28')]){return _0x178907[_0x44e6('0x16')]({'messageId':_0x2c8e98['sid']});}})[_0x44e6('0x18')](function(_0x1dd549){logger[_0x44e6('0x19')](_0x44e6('0x29'),_0x44e6('0x2a'),'twilio',util[_0x44e6('0x2b')](_0x1dd549,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x44e6('0x29'),_0x44e6('0x2a'),_0x44e6('0x1f'),_0x44e6('0x2c'));}break;case _0x44e6('0x2d'):var _0x48a55a=_0x44e6('0x2e');if(_0x3cc5b8[_0x44e6('0x2f')]&&_0x3cc5b8[_0x44e6('0x30')]){var _0x217e06={'recipient':[_0x3a23e8[_0x44e6('0x22')]],'message':_0x3a23e8[_0x44e6('0xb')],'message_type':_0x3cc5b8['smsMethod']};if(_0x3cc5b8[_0x44e6('0x31')]&&_0x3cc5b8['smsMethod']!=='SI'){_0x217e06[_0x44e6('0x32')]=_0x3cc5b8[_0x44e6('0x22')];}var _0xb7394d={'url':_0x48a55a+_0x44e6('0x33')+_0x3cc5b8[_0x44e6('0x2f')]+_0x44e6('0x34')+_0x3cc5b8[_0x44e6('0x30')],'method':_0x44e6('0x35')};rp(_0xb7394d)['then'](function(_0x3dbf52){var _0x3f80f9=_0x3dbf52[_0x44e6('0x36')](';');var _0x4b494b={'user_key':_0x3f80f9[0x0],'session_key':_0x3f80f9[0x1]};_0xb7394d={'url':_0x48a55a+_0x44e6('0x37'),'method':_0x44e6('0x38'),'headers':{'user_key':_0x4b494b['user_key'],'Session_key':_0x4b494b['session_key']},'json':!![],'body':_0x217e06};return rp(_0xb7394d);})[_0x44e6('0x15')](function(_0x1584a8){if(_0x1584a8[_0x44e6('0x39')]>=0x1){var _0x203ad1={'messageId':_0x1584a8[_0x44e6('0x3a')]};if(_0x3cc5b8['smsMethod']!=='GP'||!_0x3cc5b8['deliveryReport']){_0x203ad1[_0x44e6('0x3b')]=!![];}return _0x178907['update'](_0x203ad1);}else{return logger[_0x44e6('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x44e6('0x2a'),'skebby',util[_0x44e6('0x2b')](_0x1584a8,{'showHidden':![],'depth':null}));}})[_0x44e6('0x18')](function(_0x120a1f){return logger[_0x44e6('0x19')](_0x44e6('0x29'),_0x44e6('0x2a'),_0x44e6('0x2d'),util[_0x44e6('0x2b')](_0x120a1f,{'showHidden':![],'depth':null}));});}else{logger[_0x44e6('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x44e6('0x2a'),'skebby',_0x44e6('0x3c'));}break;case _0x44e6('0x3d'):if(_0x3cc5b8['authToken']){var _0x1ded4c={'recipient':_0x3a23e8[_0x44e6('0x22')],'message':_0x3a23e8[_0x44e6('0xb')],'sender':_0x3cc5b8[_0x44e6('0x3e')]||_0x3cc5b8['phone'],'authorization':_0x3cc5b8[_0x44e6('0x21')]};var _0x396c4c={'method':_0x44e6('0x38'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x1ded4c,'json':!![]};rp(_0x396c4c)['then'](function(_0x53c247){var _0x38f4e6={'messageId':_0x53c247[_0x44e6('0x3f')]};if(!_0x3cc5b8['deliveryReport']){_0x38f4e6[_0x44e6('0x3b')]=!![];}return _0x178907[_0x44e6('0x16')](_0x38f4e6);})['catch'](function(_0xd57feb){logger[_0x44e6('0x19')](_0x44e6('0x29'),'afterCreate',_0x44e6('0x3d'),util['inspect'](_0xd57feb,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x44e6('0x29'),_0x44e6('0x2a'),_0x44e6('0x3d'),'Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x3cc5b8[_0x44e6('0x2f')]&&_0x3cc5b8['password']){var _0x1ded4c={'messages':[{'source':_0x44e6('0x40'),'to':_0x3a23e8['phone'],'body':_0x3a23e8['body'],'from':_0x3cc5b8[_0x44e6('0x3e')]||_0x3cc5b8['phone']}]};var _0x4c9c9a=util['format']('%s:%s',_0x3cc5b8['username'],_0x3cc5b8[_0x44e6('0x30')]);var _0x396c4c={'method':_0x44e6('0x38'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x1ded4c,'headers':{'Authorization':util[_0x44e6('0x41')](_0x44e6('0x42'),new Buffer(_0x4c9c9a)['toString']('base64'))},'json':!![]};rp(_0x396c4c)[_0x44e6('0x15')](function(_0x57da1e){if(_0x57da1e['http_code']>=0xc8&&_0x57da1e[_0x44e6('0x43')]<=0xce){if(_0x57da1e[_0x44e6('0x44')]&&_0x57da1e[_0x44e6('0x44')][_0x44e6('0x45')]>0x0){var _0x170802=_[_0x44e6('0x46')](_0x57da1e['data'][_0x44e6('0x47')]);var _0x289fd6={'messageId':_0x170802[_0x44e6('0x48')]};if(!_0x3cc5b8['deliveryReport']){_0x289fd6[_0x44e6('0x3b')]=!![];}return _0x178907[_0x44e6('0x16')](_0x289fd6);}else{logger[_0x44e6('0x19')](_0x44e6('0x29'),_0x44e6('0x2a'),_0x44e6('0x49'),util['inspect'](_0x57da1e,{'showHidden':![],'depth':null}));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickSend',util['inspect'](_0x57da1e,{'showHidden':![],'depth':null}));}})[_0x44e6('0x18')](function(_0x22006f){logger['error'](_0x44e6('0x29'),'afterCreate',_0x44e6('0x49'),util[_0x44e6('0x2b')](_0x22006f,{'showHidden':![],'depth':null}));});}else{logger[_0x44e6('0x19')](_0x44e6('0x29'),_0x44e6('0x2a'),_0x44e6('0x49'),_0x44e6('0x3c'));}break;case _0x44e6('0x4a'):if(_0x3cc5b8[_0x44e6('0x4b')]&&_0x3cc5b8[_0x44e6('0x21')]){var _0x1ded4c={'dst':_0x3a23e8[_0x44e6('0x22')],'text':_0x3a23e8[_0x44e6('0xb')],'src':_0x3cc5b8[_0x44e6('0x3e')]||_0x3cc5b8['phone'],'url':_0x3cc5b8[_0x44e6('0x24')]+'/api/sms/messages/'+_0x3a23e8['id']+_0x44e6('0x26')+_0x3cc5b8['token']};var _0x4c9c9a=util[_0x44e6('0x41')]('%s:%s',_0x3cc5b8[_0x44e6('0x4b')],_0x3cc5b8[_0x44e6('0x21')]);var _0x396c4c={'method':_0x44e6('0x38'),'uri':util[_0x44e6('0x41')]('https://api.plivo.com/v1/Account/%s/Message/',_0x3cc5b8[_0x44e6('0x4b')]),'body':_0x1ded4c,'headers':{'Authorization':util[_0x44e6('0x41')](_0x44e6('0x42'),new Buffer(_0x4c9c9a)[_0x44e6('0x4c')]('base64'))},'json':!![]};rp(_0x396c4c)['then'](function(_0x586607){var _0x271065={'messageId':_0x586607[_0x44e6('0x4d')][0x0]};return _0x178907[_0x44e6('0x16')](_0x271065);})['catch'](function(_0x23af99){logger[_0x44e6('0x19')](_0x44e6('0x29'),'afterCreate',_0x44e6('0x4a'),util[_0x44e6('0x2b')](_0x23af99,{'showHidden':![],'depth':null}));});}else{logger[_0x44e6('0x19')](_0x44e6('0x29'),_0x44e6('0x2a'),_0x44e6('0x4a'),_0x44e6('0x4e'));}break;case'infobip':if(_0x3cc5b8['username']&&_0x3cc5b8[_0x44e6('0x30')]){if(_0x3cc5b8[_0x44e6('0x4f')]){var _0x2e64c6={'method':_0x44e6('0x38'),'uri':_0x3cc5b8['baseUrl']+_0x44e6('0x50'),'body':{'username':_0x3cc5b8['username'],'password':_0x3cc5b8[_0x44e6('0x30')]},'json':!![]};return rp(_0x2e64c6)['then'](function(_0x16bf0e){var _0x6151d5={'method':_0x44e6('0x38'),'uri':_0x3cc5b8['baseUrl']+'/sms/2/text/advanced','body':{'messages':[{'from':_0x3cc5b8[_0x44e6('0x22')],'destinations':[{'to':_0x3a23e8[_0x44e6('0x22')]}],'text':_0x3a23e8[_0x44e6('0xb')],'notifyUrl':_0x3cc5b8[_0x44e6('0x24')]+'/api/sms/messages/'+_0x3a23e8['id']+_0x44e6('0x26')+_0x3cc5b8[_0x44e6('0x27')],'notifyContentType':_0x44e6('0x51'),'callbackData':_0x3cc5b8[_0x44e6('0x22')]+';'+_0x3a23e8[_0x44e6('0xb')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x16bf0e[_0x44e6('0x27')]},'json':!![]};return rp(_0x6151d5)[_0x44e6('0x15')](function(_0x24d01c){if(_0x24d01c[_0x44e6('0x47')]){var _0x3b3997={'messageId':_0x24d01c[_0x44e6('0x47')][0x0][_0x44e6('0xa')]};if(!_0x3cc5b8[_0x44e6('0x52')]){_0x3b3997[_0x44e6('0x3b')]=!![];}return _0x178907[_0x44e6('0x16')](_0x3b3997);}else{return logger[_0x44e6('0x19')](_0x44e6('0x29'),_0x44e6('0x2a'),'infobip',util[_0x44e6('0x2b')](_0x24d01c,{'showHidden':![],'depth':null}));}});})[_0x44e6('0x18')](function(_0x5428ac){return logger[_0x44e6('0x19')](_0x44e6('0x29'),'afterCreate',_0x44e6('0x53'),util[_0x44e6('0x2b')](_0x5428ac,{'showHidden':![],'depth':null}));});}else{logger[_0x44e6('0x19')](_0x44e6('0x29'),_0x44e6('0x2a'),_0x44e6('0x53'),_0x44e6('0x54'));}}else{logger[_0x44e6('0x19')](_0x44e6('0x29'),'afterCreate',_0x44e6('0x53'),_0x44e6('0x3c'));}break;case'csc':var _0x3ac3c4=require('crypto');if(_0x3cc5b8[_0x44e6('0x55')]){var _0x2c3d2c={};_0x2c3d2c['login']=_0x3cc5b8['username'];_0x2c3d2c[_0x44e6('0x22')]=_0x3a23e8[_0x44e6('0x22')];_0x2c3d2c[_0x44e6('0x32')]=_0x3cc5b8[_0x44e6('0x22')];_0x2c3d2c[_0x44e6('0x56')]=_0x3a23e8['body'];_0x2c3d2c['timestamp']=+new Date();var _0x50f39b='';var _0xcf0083='';var _0x2d9d20=Object['keys'](_0x2c3d2c);_0x2d9d20['sort']();for(var _0x2dbdde=0x0;_0x2dbdde<_0x2d9d20[_0x44e6('0x57')];_0x2dbdde++){if(_0x50f39b!=''){_0x50f39b+='&';}_0x50f39b+=_0x2d9d20[_0x2dbdde]+'='+encodeURIComponent(_0x2c3d2c[_0x2d9d20[_0x2dbdde]]);_0xcf0083+=_0x2c3d2c[_0x2d9d20[_0x2dbdde]];}_0xcf0083+=_0x3cc5b8[_0x44e6('0x55')];_0xcf0083=_0x3ac3c4[_0x44e6('0x58')](_0x44e6('0x59'))[_0x44e6('0x16')](_0xcf0083)['digest']('hex');if(_0x50f39b!==''){_0x50f39b+='&';}_0x50f39b+='signature='+_0xcf0083;var _0xb7394d={'method':_0x44e6('0x35'),'uri':_0x3cc5b8[_0x44e6('0x4f')]+_0x44e6('0x5a')+_0x50f39b,'json':!![]};return rp(_0xb7394d)[_0x44e6('0x15')](function(_0x4c2e23){var _0x47552d=Object[_0x44e6('0x5b')](_0x4c2e23);if(_0x4c2e23[_0x47552d[0x0]][_0x44e6('0x19')]&&parseInt(_0x4c2e23[_0x47552d[0x0]][_0x44e6('0x19')])===0x0){var _0x2f2491={'messageId':_0x4c2e23[_0x47552d[0x0]][_0x44e6('0x5c')]};if(!_0x3cc5b8[_0x44e6('0x52')]){_0x2f2491[_0x44e6('0x3b')]=!![];}return _0x178907[_0x44e6('0x16')](_0x2f2491);}else{return logger[_0x44e6('0x19')](_0x44e6('0x29'),_0x44e6('0x2a'),_0x44e6('0x5d'),util[_0x44e6('0x2b')](_0x4c2e23[_0x44e6('0x19')],{'showHidden':![],'depth':null}));}})[_0x44e6('0x18')](function(_0x23ff6c){return logger['error'](_0x44e6('0x29'),_0x44e6('0x2a'),_0x44e6('0x5d'),util[_0x44e6('0x2b')](_0x23ff6c,{'showHidden':![],'depth':null}));});}else{logger[_0x44e6('0x19')](_0x44e6('0x29'),'afterCreate','csc',_0x44e6('0x5e'));}break;case _0x44e6('0x5f'):if(_0x3cc5b8[_0x44e6('0x55')]){var _0x12922e={'method':_0x44e6('0x38'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x3cc5b8[_0x44e6('0x55')]},'body':{'content':_0x3a23e8[_0x44e6('0xb')],'to':[_0x3a23e8[_0x44e6('0x22')]],'from':_0x3cc5b8[_0x44e6('0x22')],'binary':![],'clientMessageId':_0x44e6('0x60'),'charset':'UTF-8'},'json':!![]};rp(_0x12922e)['then'](function(_0x36f40b){if(!_0x36f40b[_0x44e6('0x19')]){var _0x48f50c={'messageId':_0x36f40b['messages'][0x0]['apiMessageId']};if(!_0x3cc5b8[_0x44e6('0x52')]){_0x48f50c['read']=!![];}return _0x178907[_0x44e6('0x16')](_0x48f50c);}else{return logger[_0x44e6('0x19')](_0x44e6('0x29'),'afterCreate','clickatell',util[_0x44e6('0x2b')](_0x36f40b[_0x44e6('0x19')],{'showHidden':![],'depth':null}));}})[_0x44e6('0x18')](function(_0x39e51b){return logger[_0x44e6('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x44e6('0x2a'),_0x44e6('0x5f'),util[_0x44e6('0x2b')](_0x39e51b,{'showHidden':![],'depth':null}));});}else{logger[_0x44e6('0x19')](_0x44e6('0x29'),_0x44e6('0x2a'),_0x44e6('0x5f'),_0x44e6('0x5e'));}break;case _0x44e6('0x61'):if(_0x3cc5b8[_0x44e6('0x2f')]&&_0x3cc5b8[_0x44e6('0x30')]){var _0x4c9c9a=util[_0x44e6('0x41')]('%s:%s',_0x3cc5b8['username'],_0x3cc5b8[_0x44e6('0x30')]);var _0x396c4c={'method':_0x44e6('0x38'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x3cc5b8[_0x44e6('0x62')]+'/messages','body':{'to':[_0x3a23e8[_0x44e6('0x22')]],'text':_0x3a23e8['body'],'from':_0x3cc5b8['phone'],'applicationId':_0x3cc5b8[_0x44e6('0x63')]},'headers':{'Authorization':util['format'](_0x44e6('0x42'),new Buffer(_0x4c9c9a)[_0x44e6('0x4c')](_0x44e6('0x64')))},'json':!![]};rp(_0x396c4c)[_0x44e6('0x15')](function(_0x1489aa){if(_0x1489aa['id']){var _0x420cc5={'messageId':_0x1489aa['id']};return _0x178907[_0x44e6('0x16')](_0x420cc5);}else{logger[_0x44e6('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x44e6('0x2a'),'bandwidth',util[_0x44e6('0x2b')](_0x1489aa,{'showHidden':![],'depth':null}));}})[_0x44e6('0x18')](function(_0x337145){logger[_0x44e6('0x19')](_0x44e6('0x29'),_0x44e6('0x2a'),_0x44e6('0x61'),util[_0x44e6('0x2b')](_0x337145,{'showHidden':![],'depth':null}));});}else{logger[_0x44e6('0x19')](_0x44e6('0x29'),'afterCreate',_0x44e6('0x61'),_0x44e6('0x3c'));}break;case _0x44e6('0x65'):if(_0x3cc5b8[_0x44e6('0x55')]){var _0x35491d={};var _0xb7394d={'method':'POST','uri':_0x44e6('0x66'),'headers':{'Authorization':_0x44e6('0x67')+_0x3cc5b8['apiKey'],'Content-Type':_0x44e6('0x51')},'body':{'from':_0x3cc5b8[_0x44e6('0x22')],'to':_0x3a23e8[_0x44e6('0x22')],'text':_0x3a23e8['body']},'json':!![]};return rp(_0xb7394d)[_0x44e6('0x15')](function(_0x2cfb35){if(_0x2cfb35[_0x44e6('0x68')]==0xca){_0x35491d['message']=_0x2cfb35;var _0x11d7d1={'method':_0x44e6('0x38'),'uri':_0x44e6('0x69'),'headers':{'Authorization':_0x44e6('0x67')+_0x3cc5b8[_0x44e6('0x55')],'Content-Type':_0x44e6('0x51')},'body':{'refid':_0x35491d['message']['refid']},'json':!![]};return rp(_0x11d7d1)[_0x44e6('0x15')](function(_0x368100){_0x35491d[_0x44e6('0x6a')]=_0x368100;var _0x3782ff={'messageId':_0x35491d['message'][_0x44e6('0x6b')],'read':!![]};return _0x178907[_0x44e6('0x16')](_0x3782ff);});}else{return logger[_0x44e6('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','intelepeer',util['inspect'](_0x2cfb35,{'showHidden':![],'depth':null}));}})['catch'](function(_0x50e771){return logger['error'](_0x44e6('0x29'),'afterCreate',_0x44e6('0x65'),util[_0x44e6('0x2b')](_0x50e771,{'showHidden':![],'depth':null}));});}else{return logger[_0x44e6('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x44e6('0x2a'),'intelepeer',_0x44e6('0x6c'));}break;}}})[_0x44e6('0x6d')](function(){_0x5dfcc9();});}else{_0x5dfcc9();}}},'charset':_0x44e6('0x6e'),'collate':_0x44e6('0x6f')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index aa1604b..e52ae25 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 _0x3387=['stringify','error','code','message','info','result','catch','body','options','raw','CreateSmsMessage','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','http','redis','socket.io-emitter','./smsMessage.socket','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s'];(function(_0x192eea,_0x5f4fd3){var _0x161666=function(_0x3fa845){while(--_0x3fa845){_0x192eea['push'](_0x192eea['shift']());}};_0x161666(++_0x5f4fd3);}(_0x3387,0x97));var _0x7338=function(_0x104e56,_0xb9cc75){_0x104e56=_0x104e56-0x0;var _0x403b84=_0x3387[_0x104e56];return _0x403b84;};'use strict';var _=require(_0x7338('0x0'));var util=require('util');var moment=require(_0x7338('0x1'));var BPromise=require(_0x7338('0x2'));var rs=require(_0x7338('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7338('0x4'))['db'];var utils=require(_0x7338('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7338('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7338('0x7')]({'port':0x232a});config['redis']=_['defaults'](config[_0x7338('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x7338('0x9'))(new Redis(config[_0x7338('0x8')]));require(_0x7338('0xa'))['register'](socket);function respondWithRpcPromise(_0x306de5,_0x21ab33,_0x45f284){return new BPromise(function(_0x28947a,_0x3ac12f){return client[_0x7338('0xb')](_0x306de5,_0x45f284)[_0x7338('0xc')](function(_0x3851b4){logger['info'](_0x7338('0xd'),_0x21ab33,_0x7338('0xe'));logger[_0x7338('0xf')](_0x7338('0x10'),_0x21ab33,_0x7338('0xe'),JSON[_0x7338('0x11')](_0x3851b4));if(_0x3851b4[_0x7338('0x12')]){if(_0x3851b4[_0x7338('0x12')][_0x7338('0x13')]===0x1f4){logger[_0x7338('0x12')](_0x7338('0xd'),_0x21ab33,_0x3851b4[_0x7338('0x12')][_0x7338('0x14')]);return _0x3ac12f(_0x3851b4[_0x7338('0x12')][_0x7338('0x14')]);}logger[_0x7338('0x12')](_0x7338('0xd'),_0x21ab33,_0x3851b4[_0x7338('0x12')][_0x7338('0x14')]);return _0x28947a(_0x3851b4[_0x7338('0x12')]['message']);}else{logger[_0x7338('0x15')]('SmsMessage,\x20%s,\x20%s',_0x21ab33,_0x7338('0xe'));_0x28947a(_0x3851b4[_0x7338('0x16')]['message']);}})[_0x7338('0x17')](function(_0x135a97){logger[_0x7338('0x12')]('SmsMessage,\x20%s,\x20%s',_0x21ab33,_0x135a97);_0x3ac12f(_0x135a97);});});}exports['CreateSmsMessage']=function(_0x1ad519){var _0x4ffb74=this;return new Promise(function(_0x1231bc,_0x1ee2e1){return db['SmsMessage']['create'](_0x1ad519[_0x7338('0x18')],{'raw':_0x1ad519[_0x7338('0x19')]?_0x1ad519[_0x7338('0x19')][_0x7338('0x1a')]===undefined?!![]:![]:!![]})[_0x7338('0xc')](function(_0x33b6be){logger[_0x7338('0x15')](_0x7338('0x1b'),_0x1ad519);logger[_0x7338('0xf')](_0x7338('0x1b'),_0x1ad519,JSON[_0x7338('0x11')](_0x33b6be));_0x1231bc(_0x33b6be);})[_0x7338('0x17')](function(_0x4fa26d){logger['error'](_0x7338('0x1b'),_0x4fa26d[_0x7338('0x14')],_0x1ad519);_0x1ee2e1(_0x4ffb74['error'](0x1f4,_0x4fa26d[_0x7338('0x14')]));});});}; \ No newline at end of file +var _0xb306=['./smsMessage.socket','register','request','then','request\x20sent','debug','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','SmsMessage','create','body','options','raw','info','CreateSmsMessage','catch','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0xb306,0xb4));var _0x6b30=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb306[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x6b30('0x0'));var moment=require(_0x6b30('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b30('0x2'));var db=require(_0x6b30('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6b30('0x4'))(_0x6b30('0x5'));var config=require('../../config/environment');var jayson=require(_0x6b30('0x6'));var client=jayson[_0x6b30('0x7')]['http']({'port':0x232a});config[_0x6b30('0x8')]=_[_0x6b30('0x9')](config[_0x6b30('0x8')],{'host':_0x6b30('0xa'),'port':0x18eb});var socket=require(_0x6b30('0xb'))(new Redis(config[_0x6b30('0x8')]));require(_0x6b30('0xc'))[_0x6b30('0xd')](socket);function respondWithRpcPromise(_0xb9b7c5,_0x15405d,_0x136b89){return new BPromise(function(_0x579769,_0xc7ddb){return client[_0x6b30('0xe')](_0xb9b7c5,_0x136b89)[_0x6b30('0xf')](function(_0x1bd10d){logger['info']('SmsMessage,\x20%s,\x20%s',_0x15405d,_0x6b30('0x10'));logger[_0x6b30('0x11')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x15405d,_0x6b30('0x10'),JSON[_0x6b30('0x12')](_0x1bd10d));if(_0x1bd10d[_0x6b30('0x13')]){if(_0x1bd10d['error'][_0x6b30('0x14')]===0x1f4){logger[_0x6b30('0x13')](_0x6b30('0x15'),_0x15405d,_0x1bd10d['error'][_0x6b30('0x16')]);return _0xc7ddb(_0x1bd10d['error']['message']);}logger['error'](_0x6b30('0x15'),_0x15405d,_0x1bd10d['error'][_0x6b30('0x16')]);return _0x579769(_0x1bd10d[_0x6b30('0x13')][_0x6b30('0x16')]);}else{logger['info'](_0x6b30('0x15'),_0x15405d,_0x6b30('0x10'));_0x579769(_0x1bd10d[_0x6b30('0x17')]['message']);}})['catch'](function(_0x3d5600){logger[_0x6b30('0x13')](_0x6b30('0x15'),_0x15405d,_0x3d5600);_0xc7ddb(_0x3d5600);});});}exports['CreateSmsMessage']=function(_0x4e646c){var _0x34f970=this;return new Promise(function(_0x1c9f02,_0x433b67){return db[_0x6b30('0x18')][_0x6b30('0x19')](_0x4e646c[_0x6b30('0x1a')],{'raw':_0x4e646c[_0x6b30('0x1b')]?_0x4e646c[_0x6b30('0x1b')][_0x6b30('0x1c')]===undefined?!![]:![]:!![]})[_0x6b30('0xf')](function(_0x8f9cc1){logger[_0x6b30('0x1d')](_0x6b30('0x1e'),_0x4e646c);logger[_0x6b30('0x11')](_0x6b30('0x1e'),_0x4e646c,JSON[_0x6b30('0x12')](_0x8f9cc1));_0x1c9f02(_0x8f9cc1);})[_0x6b30('0x1f')](function(_0x54b636){logger[_0x6b30('0x13')](_0x6b30('0x1e'),_0x54b636[_0x6b30('0x16')],_0x4e646c);_0x433b67(_0x34f970[_0x6b30('0x13')](0x1f4,_0x54b636[_0x6b30('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index ff99d57..c07cb19 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 _0x27f3=['remove','update','emit','removeListener','register','length','smsMessage:','./smsMessage.events','save'];(function(_0x55c76f,_0x13b7f4){var _0x1571ff=function(_0x4082ce){while(--_0x4082ce){_0x55c76f['push'](_0x55c76f['shift']());}};_0x1571ff(++_0x13b7f4);}(_0x27f3,0x178));var _0x327f=function(_0x4c7b20,_0x361515){_0x4c7b20=_0x4c7b20-0x0;var _0x4872bd=_0x27f3[_0x4c7b20];return _0x4872bd;};'use strict';var SmsMessageEvents=require(_0x327f('0x0'));var events=[_0x327f('0x1'),_0x327f('0x2'),_0x327f('0x3')];function createListener(_0x550b3f,_0x46a1b6){return function(_0x45202f){_0x46a1b6[_0x327f('0x4')](_0x550b3f,_0x45202f);};}function removeListener(_0x26c4aa,_0x578fef){return function(){SmsMessageEvents[_0x327f('0x5')](_0x26c4aa,_0x578fef);};}exports[_0x327f('0x6')]=function(_0x4cc130){for(var _0x295796=0x0,_0x39b5fc=events[_0x327f('0x7')];_0x295796<_0x39b5fc;_0x295796++){var _0x3b1626=events[_0x295796];var _0x525910=createListener(_0x327f('0x8')+_0x3b1626,_0x4cc130);SmsMessageEvents['on'](_0x3b1626,_0x525910);}}; \ No newline at end of file +var _0xa7d4=['register','smsMessage:','./smsMessage.events','remove','update','emit','removeListener'];(function(_0x402b34,_0x27815d){var _0x2a1ba9=function(_0x1398bf){while(--_0x1398bf){_0x402b34['push'](_0x402b34['shift']());}};_0x2a1ba9(++_0x27815d);}(_0xa7d4,0x113));var _0x4a7d=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa7d4[_0xa1e3e3];return _0xc980e9;};'use strict';var SmsMessageEvents=require(_0x4a7d('0x0'));var events=['save',_0x4a7d('0x1'),_0x4a7d('0x2')];function createListener(_0x1be166,_0x4360d5){return function(_0xf66c8f){_0x4360d5[_0x4a7d('0x3')](_0x1be166,_0xf66c8f);};}function removeListener(_0x4ad7a3,_0x56fc3f){return function(){SmsMessageEvents[_0x4a7d('0x4')](_0x4ad7a3,_0x56fc3f);};}exports[_0x4a7d('0x5')]=function(_0x2bc384){for(var _0x52b27b=0x0,_0x2d382f=events['length'];_0x52b27b<_0x2d382f;_0x52b27b++){var _0x34d913=events[_0x52b27b];var _0x2e534a=createListener(_0x4a7d('0x6')+_0x34d913,_0x2bc384);SmsMessageEvents['on'](_0x34d913,_0x2e534a);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index eb5d13d..e67c3d6 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 _0xeaa1=['/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','./smsQueue.controller','get','isAuthenticated'];(function(_0x7dc91c,_0xc59628){var _0x25f614=function(_0x261f75){while(--_0x261f75){_0x7dc91c['push'](_0x7dc91c['shift']());}};_0x25f614(++_0xc59628);}(_0xeaa1,0x163));var _0x1eaa=function(_0x394114,_0x49ea1a){_0x394114=_0x394114-0x0;var _0x20c1bc=_0xeaa1[_0x394114];return _0x20c1bc;};'use strict';var multer=require('multer');var util=require(_0x1eaa('0x0'));var path=require(_0x1eaa('0x1'));var timeout=require(_0x1eaa('0x2'));var express=require(_0x1eaa('0x3'));var router=express[_0x1eaa('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1eaa('0x5'));var config=require('../../config/environment');var controller=require(_0x1eaa('0x6'));router[_0x1eaa('0x7')]('/',auth[_0x1eaa('0x8')](),controller['index']);router['get']('/describe',auth[_0x1eaa('0x8')](),controller['describe']);router['get'](_0x1eaa('0x9'),auth[_0x1eaa('0x8')](),controller[_0x1eaa('0xa')]);router['get'](_0x1eaa('0xb'),auth[_0x1eaa('0x8')](),controller[_0x1eaa('0xc')]);router[_0x1eaa('0x7')](_0x1eaa('0xd'),auth[_0x1eaa('0x8')](),controller['getTeams']);router[_0x1eaa('0x7')](_0x1eaa('0xe'),auth['isAuthenticated'](),controller[_0x1eaa('0xf')]);router[_0x1eaa('0x10')]('/',auth[_0x1eaa('0x8')](),controller['create']);router[_0x1eaa('0x10')](_0x1eaa('0xd'),auth['isAuthenticated'](),controller[_0x1eaa('0x11')]);router[_0x1eaa('0x10')](_0x1eaa('0xe'),auth['isAuthenticated'](),controller[_0x1eaa('0x12')]);router[_0x1eaa('0x13')](_0x1eaa('0x9'),auth[_0x1eaa('0x8')](),controller[_0x1eaa('0x14')]);router[_0x1eaa('0x15')]('/:id',auth[_0x1eaa('0x8')](),controller[_0x1eaa('0x16')]);router[_0x1eaa('0x15')]('/:id/teams',auth[_0x1eaa('0x8')](),controller[_0x1eaa('0x17')]);router['delete'](_0x1eaa('0xe'),auth[_0x1eaa('0x8')](),controller[_0x1eaa('0x18')]);module[_0x1eaa('0x19')]=router; \ No newline at end of file +var _0xeeb5=['/:id/members','getMembers','/:id/teams','getAgents','post','create','put','update','destroy','delete','/:id/users','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0xeeb5,0x1a1));var _0x5eeb=function(_0x4eaf7e,_0x2afb74){_0x4eaf7e=_0x4eaf7e-0x0;var _0x31cb6a=_0xeeb5[_0x4eaf7e];return _0x31cb6a;};'use strict';var multer=require(_0x5eeb('0x0'));var util=require(_0x5eeb('0x1'));var path=require(_0x5eeb('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5eeb('0x3')]();var fs_extra=require(_0x5eeb('0x4'));var auth=require(_0x5eeb('0x5'));var interaction=require(_0x5eeb('0x6'));var config=require(_0x5eeb('0x7'));var controller=require('./smsQueue.controller');router[_0x5eeb('0x8')]('/',auth[_0x5eeb('0x9')](),controller[_0x5eeb('0xa')]);router[_0x5eeb('0x8')](_0x5eeb('0xb'),auth['isAuthenticated'](),controller[_0x5eeb('0xc')]);router[_0x5eeb('0x8')](_0x5eeb('0xd'),auth[_0x5eeb('0x9')](),controller[_0x5eeb('0xe')]);router[_0x5eeb('0x8')](_0x5eeb('0xf'),auth[_0x5eeb('0x9')](),controller[_0x5eeb('0x10')]);router['get'](_0x5eeb('0x11'),auth[_0x5eeb('0x9')](),controller['getTeams']);router['get']('/:id/users',auth[_0x5eeb('0x9')](),controller[_0x5eeb('0x12')]);router[_0x5eeb('0x13')]('/',auth[_0x5eeb('0x9')](),controller[_0x5eeb('0x14')]);router[_0x5eeb('0x13')](_0x5eeb('0x11'),auth[_0x5eeb('0x9')](),controller['addTeams']);router[_0x5eeb('0x13')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x5eeb('0x15')](_0x5eeb('0xd'),auth[_0x5eeb('0x9')](),controller[_0x5eeb('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5eeb('0x17')]);router[_0x5eeb('0x18')]('/:id/teams',auth[_0x5eeb('0x9')](),controller['removeTeams']);router[_0x5eeb('0x18')](_0x5eeb('0x19'),auth[_0x5eeb('0x9')](),controller['removeAgents']);module[_0x5eeb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index e717d4e..6aacf45 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 _0xd234=['beepall','roundrobin','exports','STRING','name','INTEGER'];(function(_0x276fae,_0x1424c1){var _0x132c7e=function(_0x4bf08a){while(--_0x4bf08a){_0x276fae['push'](_0x276fae['shift']());}};_0x132c7e(++_0x1424c1);}(_0xd234,0x1e8));var _0x4d23=function(_0x220dbe,_0xe23c15){_0x220dbe=_0x220dbe-0x0;var _0x311879=_0xd234[_0x220dbe];return _0x311879;};'use strict';var Sequelize=require('sequelize');module[_0x4d23('0x0')]={'name':{'type':Sequelize[_0x4d23('0x1')],'unique':_0x4d23('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4d23('0x1')]},'timeout':{'type':Sequelize[_0x4d23('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x4d23('0x4'),_0x4d23('0x5'))}}; \ No newline at end of file +var _0xaaed=['name','STRING','ENUM','roundrobin','sequelize'];(function(_0x4e6eb2,_0x16a451){var _0x4e0c1c=function(_0x59f144){while(--_0x59f144){_0x4e6eb2['push'](_0x4e6eb2['shift']());}};_0x4e0c1c(++_0x16a451);}(_0xaaed,0x1c6));var _0xdaae=function(_0x3bd873,_0x4a8f76){_0x3bd873=_0x3bd873-0x0;var _0xd0794f=_0xaaed[_0x3bd873];return _0xd0794f;};'use strict';var Sequelize=require(_0xdaae('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xdaae('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xdaae('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdaae('0x3')]('rrmemory','beepall',_0xdaae('0x4'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index a1f9144..3473490 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 _0x2032=['offset','limit','set','Content-Range','json','update','then','get','SmsQueues','UserProfileResource','destroy','error','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','getOptions','where','include','query','rows','show','keys','filters','intersection','attributes','model','fields','options','find','catch','body','user','UserProfileSection','autoAssociation','params','describe','findOne','UserSmsQueue','hasOwnProperty','order','sort','SmsQueueId','filter','merge','findAll','User','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','pick','nolimit','addTeams','Agents','online','voicePause','interface','sequelize','each','findOrCreate','forEach','userSmsQueue:save','removeTeams','ids','select','field','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','length','clone','toString','QueryTypes','SELECT','every','TeamId','includes','all','value','transaction','isEmpty','emit','userSmsQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','util','lodash','squel','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','end','status','count'];(function(_0x507403,_0x3f954d){var _0x1327c=function(_0x2aea1b){while(--_0x2aea1b){_0x507403['push'](_0x507403['shift']());}};_0x1327c(++_0x3f954d);}(_0x2032,0xd9));var _0x2203=function(_0x3460cb,_0x53cf99){_0x3460cb=_0x3460cb-0x0;var _0x10ebd1=_0x2032[_0x3460cb];return _0x10ebd1;};'use strict';var BPromise=require('bluebird');var util=require(_0x2203('0x0'));var _=require(_0x2203('0x1'));var squel=require(_0x2203('0x2'));var Redis=require('ioredis');var qs=require(_0x2203('0x3'));var logger=require(_0x2203('0x4'))('api');var config=require(_0x2203('0x5'));var db=require(_0x2203('0x6'))['db'];config[_0x2203('0x7')]=_[_0x2203('0x8')](config[_0x2203('0x7')],{'host':_0x2203('0x9'),'port':0x18eb});var socket=require(_0x2203('0xa'))(new Redis(config[_0x2203('0x7')]));require(_0x2203('0xb'))[_0x2203('0xc')](socket);function respondWithStatusCode(_0x2999ed,_0x5ecf9e){_0x5ecf9e=_0x5ecf9e||0xcc;return function(_0x526ae0){if(_0x526ae0){return _0x2999ed[_0x2203('0xd')](_0x5ecf9e);}return _0x2999ed['status'](_0x5ecf9e)[_0x2203('0xe')]();};}function respondWithResult(_0x2972f3,_0x6339c4){_0x6339c4=_0x6339c4||0xc8;return function(_0x5b19df){if(_0x5b19df){return _0x2972f3[_0x2203('0xf')](_0x6339c4)['json'](_0x5b19df);}};}function respondWithFilteredResult(_0x3f690a,_0x4b73be){return function(_0x297459){if(_0x297459){var _0x1abb51=typeof _0x4b73be['offset']==='undefined'&&typeof _0x4b73be['limit']==='undefined';var _0x4bad7c=_0x297459[_0x2203('0x10')];var _0x538b30=_0x1abb51?0x0:_0x4b73be['offset'];var _0x21a3af=_0x1abb51?_0x297459[_0x2203('0x10')]:_0x4b73be[_0x2203('0x11')]+_0x4b73be[_0x2203('0x12')];var _0x226209;if(_0x21a3af>=_0x4bad7c){_0x21a3af=_0x4bad7c;_0x226209=0xc8;}else{_0x226209=0xce;}_0x3f690a[_0x2203('0xf')](_0x226209);return _0x3f690a[_0x2203('0x13')](_0x2203('0x14'),_0x538b30+'-'+_0x21a3af+'/'+_0x4bad7c)[_0x2203('0x15')](_0x297459);}return null;};}function saveUpdates(_0x3053f3){return function(_0x5129fb){if(_0x5129fb){return _0x5129fb[_0x2203('0x16')](_0x3053f3)[_0x2203('0x17')](function(_0x4893ff){return _0x4893ff;});}return null;};}function removeEntity(_0x3f9ef6){return function(_0x8906e1){if(_0x8906e1){return _0x8906e1['destroy']()[_0x2203('0x17')](function(){var _0x5ee83c=_0x8906e1[_0x2203('0x18')]({'plain':!![]});var _0x310b8c=_0x2203('0x19');return db[_0x2203('0x1a')][_0x2203('0x1b')]({'where':{'type':_0x310b8c,'resourceId':_0x5ee83c['id']}})[_0x2203('0x17')](function(){return _0x8906e1;});})['then'](function(){_0x3f9ef6[_0x2203('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ac866){return function(_0x15f543){if(!_0x15f543){_0x5ac866['sendStatus'](0x194);}return _0x15f543;};}function handleError(_0x3b8ef9,_0x5bfe61){_0x5bfe61=_0x5bfe61||0x1f4;return function(_0x5d4c4e){logger[_0x2203('0x1c')](_0x5d4c4e['stack']);if(_0x5d4c4e['name']){delete _0x5d4c4e[_0x2203('0x1d')];}_0x3b8ef9[_0x2203('0xf')](_0x5bfe61)[_0x2203('0x1e')](_0x5d4c4e);};}exports[_0x2203('0x1f')]=function(_0x1244f4,_0x3114ef){var _0x49c12={};var _0x250349={'count':0x0,'rows':[]};var _0x576378=_[_0x2203('0x20')](db[_0x2203('0x21')][_0x2203('0x22')],function(_0x5f11bf){return{'name':_0x5f11bf[_0x2203('0x23')],'type':_0x5f11bf[_0x2203('0x24')]['key']};});_0x49c12=qs[_0x2203('0x25')](_0x576378,_0x1244f4);var _0xd91f5d={'where':_0x49c12[_0x2203('0x26')]};return db[_0x2203('0x21')][_0x2203('0x10')](_0xd91f5d)[_0x2203('0x17')](function(_0x9c53f){_0x250349['count']=_0x9c53f;_0x49c12[_0x2203('0x27')]=qs[_0x2203('0x27')](_0x1244f4[_0x2203('0x28')]);return db[_0x2203('0x21')]['findAll'](_0x49c12);})[_0x2203('0x17')](function(_0x21ff0d){_0x250349[_0x2203('0x29')]=_0x21ff0d;return _0x250349;})[_0x2203('0x17')](respondWithFilteredResult(_0x3114ef,_0x49c12))['catch'](handleError(_0x3114ef,null));};exports[_0x2203('0x2a')]=function(_0x50aa17,_0x5e6560){var _0x5c0157={'raw':!![],'where':{'id':_0x50aa17['params']['id']}},_0x1d5f74={};_0x1d5f74['model']=_[_0x2203('0x2b')](db[_0x2203('0x21')][_0x2203('0x22')]);_0x1d5f74[_0x2203('0x28')]=_[_0x2203('0x2b')](_0x50aa17['query']);_0x1d5f74[_0x2203('0x2c')]=_[_0x2203('0x2d')](_0x1d5f74['model'],_0x1d5f74[_0x2203('0x28')]);_0x5c0157[_0x2203('0x2e')]=_[_0x2203('0x2d')](_0x1d5f74[_0x2203('0x2f')],qs[_0x2203('0x30')](_0x50aa17[_0x2203('0x28')][_0x2203('0x30')]));_0x5c0157[_0x2203('0x2e')]=_0x5c0157[_0x2203('0x2e')]['length']?_0x5c0157[_0x2203('0x2e')]:_0x1d5f74[_0x2203('0x2f')];if(_0x50aa17['query']['includeAll']){_0x5c0157[_0x2203('0x27')]=[{'all':!![]}];}_0x5c0157=_['merge']({},_0x5c0157,_0x50aa17[_0x2203('0x31')]);return db[_0x2203('0x21')][_0x2203('0x32')](_0x5c0157)['then'](handleEntityNotFound(_0x5e6560,null))['then'](respondWithResult(_0x5e6560,null))[_0x2203('0x33')](handleError(_0x5e6560,null));};exports['create']=function(_0x2d0365,_0x5cfe5e){return db[_0x2203('0x21')]['create'](_0x2d0365[_0x2203('0x34')],{})[_0x2203('0x17')](function(_0x4311d1){var _0x40a793=_0x2d0365[_0x2203('0x35')]['get']({'plain':!![]});if(!_0x40a793)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40a793['role']===_0x2203('0x35')){var _0x25a2dc=_0x4311d1[_0x2203('0x18')]({'plain':!![]});var _0x3b0c7a=_0x2203('0x19');return db[_0x2203('0x36')][_0x2203('0x32')]({'where':{'name':_0x3b0c7a,'userProfileId':_0x40a793['userProfileId']},'raw':!![]})[_0x2203('0x17')](function(_0x1b12c3){if(_0x1b12c3&&_0x1b12c3[_0x2203('0x37')]===0x0){return db[_0x2203('0x1a')]['create']({'name':_0x25a2dc['name'],'resourceId':_0x25a2dc['id'],'type':_0x1b12c3[_0x2203('0x1d')],'sectionId':_0x1b12c3['id']},{})['then'](function(){return _0x4311d1;});}else{return _0x4311d1;}})[_0x2203('0x33')](function(_0x446209){logger[_0x2203('0x1c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x446209);throw _0x446209;});}return _0x4311d1;})['then'](respondWithResult(_0x5cfe5e,0xc9))[_0x2203('0x33')](handleError(_0x5cfe5e,null));};exports[_0x2203('0x16')]=function(_0x368444,_0x1e09f3){if(_0x368444[_0x2203('0x34')]['id']){delete _0x368444[_0x2203('0x34')]['id'];}return db['SmsQueue'][_0x2203('0x32')]({'where':{'id':_0x368444[_0x2203('0x38')]['id']}})[_0x2203('0x17')](handleEntityNotFound(_0x1e09f3,null))[_0x2203('0x17')](saveUpdates(_0x368444[_0x2203('0x34')],null))[_0x2203('0x17')](respondWithResult(_0x1e09f3,null))[_0x2203('0x33')](handleError(_0x1e09f3,null));};exports[_0x2203('0x1b')]=function(_0x36b8e4,_0x1e34a0){return db['SmsQueue'][_0x2203('0x32')]({'where':{'id':_0x36b8e4[_0x2203('0x38')]['id']}})[_0x2203('0x17')](handleEntityNotFound(_0x1e34a0,null))[_0x2203('0x17')](removeEntity(_0x1e34a0,null))['catch'](handleError(_0x1e34a0,null));};exports['describe']=function(_0x1c6661,_0x48129c){return db[_0x2203('0x21')][_0x2203('0x39')]()[_0x2203('0x17')](respondWithResult(_0x48129c,null))[_0x2203('0x33')](handleError(_0x48129c,null));};exports['getMembers']=function(_0x289146,_0x102803){var _0x5cd8c6={'raw':!![],'where':{}},_0x29bd91={},_0x381b3e;return db[_0x2203('0x21')][_0x2203('0x3a')]({'where':{'id':_0x289146['params']['id']}})['then'](handleEntityNotFound(_0x102803,null))[_0x2203('0x17')](function(_0x5707c8){if(_0x5707c8){_0x381b3e=_0x5707c8['get']({'plain':!![]});_0x29bd91[_0x2203('0x2f')]=_[_0x2203('0x2b')](db[_0x2203('0x3b')]['rawAttributes']);_0x29bd91['query']=_[_0x2203('0x2b')](_0x289146[_0x2203('0x28')]);_0x29bd91[_0x2203('0x2c')]=_[_0x2203('0x2d')](_0x29bd91[_0x2203('0x2f')],_0x29bd91[_0x2203('0x28')]);_0x5cd8c6['attributes']=_[_0x2203('0x2d')](_0x29bd91['model'],qs[_0x2203('0x30')](_0x289146[_0x2203('0x28')][_0x2203('0x30')]));_0x5cd8c6[_0x2203('0x2e')]=_0x5cd8c6['attributes']['length']?_0x5cd8c6[_0x2203('0x2e')]:_0x29bd91[_0x2203('0x2f')];if(!_0x289146[_0x2203('0x28')][_0x2203('0x3c')]('nolimit')){_0x5cd8c6['limit']=qs['limit'](_0x289146[_0x2203('0x28')][_0x2203('0x12')]);_0x5cd8c6['offset']=qs[_0x2203('0x11')](_0x289146[_0x2203('0x28')]['offset']);}_0x5cd8c6[_0x2203('0x3d')]=qs[_0x2203('0x3e')](_0x289146[_0x2203('0x28')][_0x2203('0x3e')]);_0x5cd8c6['where']=qs[_0x2203('0x2c')](_['pick'](_0x289146[_0x2203('0x28')],_0x29bd91[_0x2203('0x2c')]));_0x5cd8c6['where'][_0x2203('0x3f')]=_0x5707c8['id'];if(_0x289146[_0x2203('0x28')][_0x2203('0x40')]){_0x5cd8c6[_0x2203('0x26')]=_[_0x2203('0x41')](_0x5cd8c6[_0x2203('0x26')],{'$or':_['map'](_0x5cd8c6['attributes'],function(_0x2f2537){var _0x524356={};_0x524356[_0x2f2537]={'$like':'%'+_0x289146['query'][_0x2203('0x40')]+'%'};return _0x524356;})});}_0x5cd8c6=_[_0x2203('0x41')]({},_0x5cd8c6,_0x289146[_0x2203('0x31')]);return db['UserSmsQueue'][_0x2203('0x42')](_0x5cd8c6);}})['then'](function(_0x5ddf9e){if(_0x5ddf9e){return db[_0x2203('0x43')]['findAndCountAll']({'where':{'id':_['map'](_0x5ddf9e,'UserId'),'role':_0x2203('0x44')},'attributes':['id',_0x2203('0x1d'),_0x2203('0x45'),_0x2203('0x46'),_0x2203('0x47')]});}})[_0x2203('0x17')](function(_0x2baea2){if(_0x2baea2){return{'count':_0x2baea2[_0x2203('0x10')],'rows':_[_0x2203('0x20')](_0x2baea2[_0x2203('0x29')],function(_0x384a59){return{'membername':_0x384a59[_0x2203('0x1d')],'UserId':_0x384a59['id'],'queue_name':_0x381b3e['name'],'SmsQueueId':_0x381b3e['id'],'interface':util['format'](_0x2203('0x48'),_0x2203('0x49'),_0x384a59[_0x2203('0x1d')]),'penalty':0x0,'paused':_0x384a59[_0x2203('0x45')],'createdAt':_0x384a59[_0x2203('0x47')],'updatedAt':_0x384a59[_0x2203('0x46')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x102803,_0x5cd8c6))['catch'](handleError(_0x102803,null));};exports[_0x2203('0x4a')]=function(_0x34358e,_0x21ee59){var _0x1e6d21={};var _0xcab922={};var _0x7b0b9c;var _0x133d22;return db[_0x2203('0x21')][_0x2203('0x3a')]({'where':{'id':_0x34358e[_0x2203('0x38')]['id']}})[_0x2203('0x17')](handleEntityNotFound(_0x21ee59,null))['then'](function(_0x1ea97a){if(_0x1ea97a){_0x7b0b9c=_0x1ea97a;_0xcab922[_0x2203('0x2f')]=_[_0x2203('0x2b')](db[_0x2203('0x4b')][_0x2203('0x22')]);_0xcab922[_0x2203('0x28')]=_[_0x2203('0x2b')](_0x34358e[_0x2203('0x28')]);_0xcab922[_0x2203('0x2c')]=_[_0x2203('0x2d')](_0xcab922[_0x2203('0x2f')],_0xcab922[_0x2203('0x28')]);_0x1e6d21[_0x2203('0x2e')]=_[_0x2203('0x2d')](_0xcab922[_0x2203('0x2f')],qs[_0x2203('0x30')](_0x34358e[_0x2203('0x28')][_0x2203('0x30')]));_0x1e6d21[_0x2203('0x2e')]=_0x1e6d21[_0x2203('0x2e')]['length']?_0x1e6d21[_0x2203('0x2e')]:_0xcab922[_0x2203('0x2f')];_0x1e6d21[_0x2203('0x3d')]=qs['sort'](_0x34358e[_0x2203('0x28')][_0x2203('0x3e')]);_0x1e6d21[_0x2203('0x26')]=qs[_0x2203('0x2c')](_[_0x2203('0x4c')](_0x34358e['query'],_0xcab922[_0x2203('0x2c')]));if(_0x34358e[_0x2203('0x28')][_0x2203('0x40')]){_0x1e6d21['where']=_['merge'](_0x1e6d21['where'],{'$or':_['map'](_0x1e6d21['attributes'],function(_0x418d48){var _0xbc9f88={};_0xbc9f88[_0x418d48]={'$like':'%'+_0x34358e[_0x2203('0x28')][_0x2203('0x40')]+'%'};return _0xbc9f88;})});}_0x1e6d21=_[_0x2203('0x41')]({},_0x1e6d21,_0x34358e[_0x2203('0x31')]);return _0x7b0b9c[_0x2203('0x4a')](_0x1e6d21);}})[_0x2203('0x17')](function(_0x56dcbe){if(_0x56dcbe){_0x133d22=_0x56dcbe['length'];if(!_0x34358e[_0x2203('0x28')][_0x2203('0x3c')](_0x2203('0x4d'))){_0x1e6d21[_0x2203('0x12')]=qs[_0x2203('0x12')](_0x34358e[_0x2203('0x28')][_0x2203('0x12')]);_0x1e6d21[_0x2203('0x11')]=qs[_0x2203('0x11')](_0x34358e[_0x2203('0x28')][_0x2203('0x11')]);}return _0x7b0b9c[_0x2203('0x4a')](_0x1e6d21);}})[_0x2203('0x17')](function(_0xae45a5){if(_0xae45a5){return _0xae45a5?{'count':_0x133d22,'rows':_0xae45a5}:null;}})[_0x2203('0x17')](respondWithResult(_0x21ee59,null))[_0x2203('0x33')](handleError(_0x21ee59,null));};exports[_0x2203('0x4e')]=function(_0x173ac1,_0xa15021){var _0x4b2e4f=_0x173ac1[_0x2203('0x34')]['ids'];return db[_0x2203('0x4b')]['findAll']({'where':{'id':_0x4b2e4f},'attributes':['id'],'include':[{'model':db[_0x2203('0x43')],'as':_0x2203('0x4f'),'attributes':['id',_0x2203('0x1d'),_0x2203('0x50'),_0x2203('0x51'),_0x2203('0x52')],'raw':!![]}]})[_0x2203('0x17')](function(_0x2eab08){if(_0x2eab08){var _0x4e9a01=_['flatMap'](_0x2eab08,function(_0x38903b){var _0x34593a=_0x38903b[_0x2203('0x18')]({'plain':!![]});return _0x34593a['Agents'];});return db['SmsQueue']['find']({'where':{'id':_0x173ac1[_0x2203('0x38')]['id']}})[_0x2203('0x17')](function(_0x20385b){return db[_0x2203('0x53')]['transaction'](function(_0x2f7850){return _0x20385b['addTeams'](_0x4b2e4f,{'transaction':_0x2f7850})[_0x2203('0x17')](function(){return BPromise[_0x2203('0x54')](_0x4e9a01,function(_0xe3bee5){return db[_0x2203('0x3b')][_0x2203('0x55')]({'where':{'UserId':_0xe3bee5['id'],'SmsQueueId':_0x173ac1['params']['id']},'transaction':_0x2f7850});});})[_0x2203('0x17')](function(){_0x4e9a01[_0x2203('0x56')](function(_0x18663f){socket['emit'](_0x2203('0x57'),{'UserId':_0x18663f['id'],'SmsQueueId':_0x20385b['id']});});});});});}})[_0x2203('0x17')](respondWithStatusCode(_0xa15021,null))[_0x2203('0x33')](handleError(_0xa15021,null));};exports[_0x2203('0x58')]=function(_0x1c65f9,_0x4356fe){return db[_0x2203('0x4b')][_0x2203('0x42')]({'where':{'id':_0x1c65f9[_0x2203('0x28')][_0x2203('0x59')]},'attributes':['id'],'include':[{'model':db[_0x2203('0x43')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x2203('0x17')](handleEntityNotFound(_0x4356fe,null))[_0x2203('0x17')](function(_0x21b755){var _0x2da37c=_[_0x2203('0x20')](_0x21b755,'id');var _0x52c35e=[];var _0x23f7b1=[];var _0x2a5a4b=squel[_0x2203('0x5a')]();_0x2a5a4b[_0x2203('0x5b')](_0x2203('0x5c'))[_0x2203('0x5d')]('team_has_sms_queues','tq')['join'](_0x2203('0x5e'),'ut',_0x2203('0x5f'))[_0x2203('0x26')](_0x2203('0x60'),_0x1c65f9[_0x2203('0x38')]['id']);for(var _0x4fd029=0x0;_0x4fd029<_0x21b755[_0x2203('0x61')];_0x4fd029+=0x1){let _0x3cb792=_0x21b755[_0x4fd029];for(var _0x4e539b=0x0;_0x4e539b<_0x3cb792['Agents']['length'];_0x4e539b+=0x1){let _0x4fc51a=_0x3cb792['Agents'][_0x4e539b];var _0x2952fc=_0x2a5a4b[_0x2203('0x62')]();_0x2952fc[_0x2203('0x26')]('ut.UserId\x20=\x20?',_0x4fc51a['id']);_0x23f7b1['push'](db['sequelize'][_0x2203('0x28')](_0x2952fc[_0x2203('0x63')](),{'type':db[_0x2203('0x53')][_0x2203('0x64')][_0x2203('0x65')]})[_0x2203('0x17')](function(_0x3d1797){if(_0x3d1797['length']===0x1){return _0x4fc51a['id'];}else{var _0x3bf2c9=_[_0x2203('0x66')](_[_0x2203('0x20')](_0x3d1797,_0x2203('0x67')),function(_0x35ff6b){return _[_0x2203('0x68')](_0x2da37c,_0x35ff6b);});if(_0x3bf2c9){return _0x4fc51a['id'];}}}));}}return BPromise[_0x2203('0x69')](_0x23f7b1)['then'](function(_0x188722){_0x52c35e=_(_0x52c35e)['union'](_0x188722)['compact']()[_0x2203('0x6a')]();return db['SmsQueue'][_0x2203('0x32')]({'where':{'id':_0x1c65f9[_0x2203('0x38')]['id']}})['then'](function(_0x29d545){return db[_0x2203('0x53')][_0x2203('0x6b')](function(_0x461f90){return _0x29d545[_0x2203('0x58')](_0x1c65f9[_0x2203('0x28')]['ids'],{'transaction':_0x461f90})[_0x2203('0x17')](function(){if(!_[_0x2203('0x6c')](_0x52c35e)){return _0x29d545['removeAgents'](_0x52c35e,{'transaction':_0x461f90});}})['then'](function(){_0x52c35e[_0x2203('0x56')](function(_0x3fe71b){socket[_0x2203('0x6d')](_0x2203('0x6e'),{'UserId':_0x3fe71b,'SmsQueueId':_0x29d545['id']});});});});});});})[_0x2203('0x17')](respondWithStatusCode(_0x4356fe,null))[_0x2203('0x33')](handleError(_0x4356fe,null));};exports[_0x2203('0x6f')]=function(_0x3c41bf,_0x4749df){return db[_0x2203('0x21')][_0x2203('0x32')]({'where':{'id':_0x3c41bf[_0x2203('0x38')]['id']}})[_0x2203('0x17')](handleEntityNotFound(_0x4749df,null))[_0x2203('0x17')](function(_0x7589a7){if(_0x7589a7){return _0x7589a7[_0x2203('0x6f')](_0x3c41bf['body']['ids'],_[_0x2203('0x70')](_0x3c41bf[_0x2203('0x34')],['ids','id'])||{})[_0x2203('0x71')](function(_0x447a95){for(var _0x5b5e95=0x0;_0x5b5e95<_0x3c41bf[_0x2203('0x34')][_0x2203('0x59')]['length'];_0x5b5e95+=0x1){socket[_0x2203('0x6d')](_0x2203('0x57'),{'UserId':Number(_0x3c41bf['body'][_0x2203('0x59')][_0x5b5e95]),'SmsQueueId':Number(_0x3c41bf[_0x2203('0x38')]['id'])});}return _0x447a95;});}})[_0x2203('0x17')](respondWithResult(_0x4749df,null))[_0x2203('0x33')](handleError(_0x4749df,null));};exports['removeAgents']=function(_0x511c66,_0x2df837){return db[_0x2203('0x21')][_0x2203('0x32')]({'where':{'id':_0x511c66['params']['id']}})['then'](handleEntityNotFound(_0x2df837,null))[_0x2203('0x17')](function(_0x199bec){if(_0x199bec){return _0x199bec[_0x2203('0x72')](_0x511c66['query']['ids'])[_0x2203('0x17')](function(){if(_[_0x2203('0x73')](_0x511c66['query'][_0x2203('0x59')])){for(var _0x2de64d=0x0;_0x2de64d<_0x511c66['query'][_0x2203('0x59')]['length'];_0x2de64d+=0x1){socket[_0x2203('0x6d')]('userSmsQueue:remove',{'UserId':Number(_0x511c66['query']['ids'][_0x2de64d]),'SmsQueueId':Number(_0x511c66[_0x2203('0x38')]['id'])});}}else{socket[_0x2203('0x6d')]('userSmsQueue:remove',{'UserId':Number(_0x511c66[_0x2203('0x28')][_0x2203('0x59')]),'SmsQueueId':Number(_0x511c66[_0x2203('0x38')]['id'])});}});}})['then'](respondWithStatusCode(_0x2df837,null))[_0x2203('0x33')](handleError(_0x2df837,null));};exports['getAgents']=function(_0x3f31e0,_0x3edb38){var _0x486563={};var _0x4358c1={};var _0x4096f4;var _0x5bd4e4;return db[_0x2203('0x21')][_0x2203('0x3a')]({'where':{'id':_0x3f31e0[_0x2203('0x38')]['id']}})[_0x2203('0x17')](handleEntityNotFound(_0x3edb38,null))[_0x2203('0x17')](function(_0x5d73a7){if(_0x5d73a7){_0x4096f4=_0x5d73a7;_0x4358c1[_0x2203('0x2f')]=_[_0x2203('0x2b')](db[_0x2203('0x43')][_0x2203('0x22')]);_0x4358c1[_0x2203('0x28')]=_[_0x2203('0x2b')](_0x3f31e0['query']);_0x4358c1[_0x2203('0x2c')]=_[_0x2203('0x2d')](_0x4358c1['model'],_0x4358c1[_0x2203('0x28')]);_0x486563['attributes']=_[_0x2203('0x2d')](_0x4358c1[_0x2203('0x2f')],qs[_0x2203('0x30')](_0x3f31e0['query'][_0x2203('0x30')]));_0x486563[_0x2203('0x2e')]=_0x486563[_0x2203('0x2e')][_0x2203('0x61')]?_0x486563[_0x2203('0x2e')]:_0x4358c1[_0x2203('0x2f')];_0x486563[_0x2203('0x3d')]=qs['sort'](_0x3f31e0['query'][_0x2203('0x3e')]);_0x486563[_0x2203('0x26')]=qs[_0x2203('0x2c')](_[_0x2203('0x4c')](_0x3f31e0[_0x2203('0x28')],_0x4358c1[_0x2203('0x2c')]));if(_0x3f31e0[_0x2203('0x28')]['filter']){_0x486563[_0x2203('0x26')]=_[_0x2203('0x41')](_0x486563['where'],{'$or':_[_0x2203('0x20')](_0x486563['attributes'],function(_0xc3dac5){var _0xbd1866={};_0xbd1866[_0xc3dac5]={'$like':'%'+_0x3f31e0['query'][_0x2203('0x40')]+'%'};return _0xbd1866;})});}_0x486563=_[_0x2203('0x41')]({},_0x486563,_0x3f31e0[_0x2203('0x31')]);return _0x4096f4[_0x2203('0x74')](_0x486563);}})[_0x2203('0x17')](function(_0x36ab7f){if(_0x36ab7f){_0x5bd4e4=_0x36ab7f[_0x2203('0x61')];if(!_0x3f31e0[_0x2203('0x28')][_0x2203('0x3c')](_0x2203('0x4d'))){_0x486563[_0x2203('0x12')]=qs[_0x2203('0x12')](_0x3f31e0['query'][_0x2203('0x12')]);_0x486563['offset']=qs[_0x2203('0x11')](_0x3f31e0[_0x2203('0x28')][_0x2203('0x11')]);}return _0x4096f4[_0x2203('0x74')](_0x486563);}})[_0x2203('0x17')](function(_0x2159a5){if(_0x2159a5){return _0x2159a5?{'count':_0x5bd4e4,'rows':_0x2159a5}:null;}})[_0x2203('0x17')](respondWithResult(_0x3edb38,null))[_0x2203('0x33')](handleError(_0x3edb38,null));}; \ No newline at end of file +var _0x0b0e=['userSmsQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','clone','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','union','value','removeAgents','forEach','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','hasOwnProperty','bluebird','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','update','SmsQueues','destroy','then','error','stack','name','send','SmsQueue','fieldName','type','key','getOptions','include','query','findAll','rows','show','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','merge','options','find','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','params','nolimit','order','sort','where','SmsQueueId','filter','map','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','%s/%s','SIP','findOne','Team','pick','getTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','emit'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x560485,_0x244601){_0x560485=_0x560485-0x0;var _0x3e7f69=_0x0b0e[_0x560485];return _0x3e7f69;};'use strict';var BPromise=require(_0xe0b0('0x0'));var util=require('util');var _=require(_0xe0b0('0x1'));var squel=require('squel');var Redis=require(_0xe0b0('0x2'));var qs=require(_0xe0b0('0x3'));var logger=require(_0xe0b0('0x4'))(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var db=require(_0xe0b0('0x7'))['db'];config[_0xe0b0('0x8')]=_[_0xe0b0('0x9')](config[_0xe0b0('0x8')],{'host':_0xe0b0('0xa'),'port':0x18eb});var socket=require(_0xe0b0('0xb'))(new Redis(config['redis']));require('./smsQueue.socket')[_0xe0b0('0xc')](socket);function respondWithStatusCode(_0x435060,_0xc4a085){_0xc4a085=_0xc4a085||0xcc;return function(_0x2ac27e){if(_0x2ac27e){return _0x435060['sendStatus'](_0xc4a085);}return _0x435060[_0xe0b0('0xd')](_0xc4a085)[_0xe0b0('0xe')]();};}function respondWithResult(_0x553d4f,_0x1fef28){_0x1fef28=_0x1fef28||0xc8;return function(_0x2f32b6){if(_0x2f32b6){return _0x553d4f['status'](_0x1fef28)[_0xe0b0('0xf')](_0x2f32b6);}};}function respondWithFilteredResult(_0x2cdad2,_0x39b1c2){return function(_0x585615){if(_0x585615){var _0x3068c0=typeof _0x39b1c2[_0xe0b0('0x10')]===_0xe0b0('0x11')&&typeof _0x39b1c2[_0xe0b0('0x12')]===_0xe0b0('0x11');var _0x4d2bf7=_0x585615[_0xe0b0('0x13')];var _0x154de6=_0x3068c0?0x0:_0x39b1c2[_0xe0b0('0x10')];var _0x24babd=_0x3068c0?_0x585615[_0xe0b0('0x13')]:_0x39b1c2['offset']+_0x39b1c2[_0xe0b0('0x12')];var _0x5adb01;if(_0x24babd>=_0x4d2bf7){_0x24babd=_0x4d2bf7;_0x5adb01=0xc8;}else{_0x5adb01=0xce;}_0x2cdad2[_0xe0b0('0xd')](_0x5adb01);return _0x2cdad2[_0xe0b0('0x14')]('Content-Range',_0x154de6+'-'+_0x24babd+'/'+_0x4d2bf7)[_0xe0b0('0xf')](_0x585615);}return null;};}function saveUpdates(_0x4a4cc0){return function(_0x2d6fb6){if(_0x2d6fb6){return _0x2d6fb6[_0xe0b0('0x15')](_0x4a4cc0)['then'](function(_0x54a3eb){return _0x54a3eb;});}return null;};}function removeEntity(_0x46bb44){return function(_0x50a441){if(_0x50a441){return _0x50a441['destroy']()['then'](function(){var _0x1920ee=_0x50a441['get']({'plain':!![]});var _0x52598b=_0xe0b0('0x16');return db['UserProfileResource'][_0xe0b0('0x17')]({'where':{'type':_0x52598b,'resourceId':_0x1920ee['id']}})['then'](function(){return _0x50a441;});})[_0xe0b0('0x18')](function(){_0x46bb44[_0xe0b0('0xd')](0xcc)[_0xe0b0('0xe')]();});}};}function handleEntityNotFound(_0x310a6d){return function(_0x2cf6a1){if(!_0x2cf6a1){_0x310a6d['sendStatus'](0x194);}return _0x2cf6a1;};}function handleError(_0x4cae54,_0x2fa820){_0x2fa820=_0x2fa820||0x1f4;return function(_0x5512bb){logger[_0xe0b0('0x19')](_0x5512bb[_0xe0b0('0x1a')]);if(_0x5512bb['name']){delete _0x5512bb[_0xe0b0('0x1b')];}_0x4cae54['status'](_0x2fa820)[_0xe0b0('0x1c')](_0x5512bb);};}exports['index']=function(_0x28586d,_0x576352){var _0x3e5c88={};var _0x4de537={'count':0x0,'rows':[]};var _0x4700cc=_['map'](db[_0xe0b0('0x1d')]['rawAttributes'],function(_0x362aba){return{'name':_0x362aba[_0xe0b0('0x1e')],'type':_0x362aba[_0xe0b0('0x1f')][_0xe0b0('0x20')]};});_0x3e5c88=qs[_0xe0b0('0x21')](_0x4700cc,_0x28586d);var _0x10745d={'where':_0x3e5c88['where']};return db[_0xe0b0('0x1d')][_0xe0b0('0x13')](_0x10745d)['then'](function(_0x15e13b){_0x4de537[_0xe0b0('0x13')]=_0x15e13b;_0x3e5c88[_0xe0b0('0x22')]=qs[_0xe0b0('0x22')](_0x28586d[_0xe0b0('0x23')]);return db[_0xe0b0('0x1d')][_0xe0b0('0x24')](_0x3e5c88);})['then'](function(_0x1854b8){_0x4de537[_0xe0b0('0x25')]=_0x1854b8;return _0x4de537;})['then'](respondWithFilteredResult(_0x576352,_0x3e5c88))['catch'](handleError(_0x576352,null));};exports[_0xe0b0('0x26')]=function(_0x33e672,_0x422575){var _0x3f81d5={'raw':!![],'where':{'id':_0x33e672['params']['id']}},_0x2ab1b1={};_0x2ab1b1[_0xe0b0('0x27')]=_[_0xe0b0('0x28')](db[_0xe0b0('0x1d')][_0xe0b0('0x29')]);_0x2ab1b1[_0xe0b0('0x23')]=_['keys'](_0x33e672[_0xe0b0('0x23')]);_0x2ab1b1[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0x2ab1b1[_0xe0b0('0x27')],_0x2ab1b1[_0xe0b0('0x23')]);_0x3f81d5[_0xe0b0('0x2c')]=_[_0xe0b0('0x2b')](_0x2ab1b1[_0xe0b0('0x27')],qs[_0xe0b0('0x2d')](_0x33e672[_0xe0b0('0x23')][_0xe0b0('0x2d')]));_0x3f81d5[_0xe0b0('0x2c')]=_0x3f81d5[_0xe0b0('0x2c')][_0xe0b0('0x2e')]?_0x3f81d5[_0xe0b0('0x2c')]:_0x2ab1b1['model'];if(_0x33e672[_0xe0b0('0x23')][_0xe0b0('0x2f')]){_0x3f81d5[_0xe0b0('0x22')]=[{'all':!![]}];}_0x3f81d5=_[_0xe0b0('0x30')]({},_0x3f81d5,_0x33e672[_0xe0b0('0x31')]);return db[_0xe0b0('0x1d')][_0xe0b0('0x32')](_0x3f81d5)['then'](handleEntityNotFound(_0x422575,null))['then'](respondWithResult(_0x422575,null))['catch'](handleError(_0x422575,null));};exports['create']=function(_0x26137c,_0xc3d967){return db[_0xe0b0('0x1d')]['create'](_0x26137c[_0xe0b0('0x33')],{})[_0xe0b0('0x18')](function(_0x1cd705){var _0x297c64=_0x26137c['user'][_0xe0b0('0x34')]({'plain':!![]});if(!_0x297c64)throw new Error(_0xe0b0('0x35'));if(_0x297c64[_0xe0b0('0x36')]===_0xe0b0('0x37')){var _0x4265e3=_0x1cd705[_0xe0b0('0x34')]({'plain':!![]});var _0x8b745=_0xe0b0('0x16');return db[_0xe0b0('0x38')]['find']({'where':{'name':_0x8b745,'userProfileId':_0x297c64[_0xe0b0('0x39')]},'raw':!![]})['then'](function(_0x34178d){if(_0x34178d&&_0x34178d[_0xe0b0('0x3a')]===0x0){return db[_0xe0b0('0x3b')][_0xe0b0('0x3c')]({'name':_0x4265e3['name'],'resourceId':_0x4265e3['id'],'type':_0x34178d[_0xe0b0('0x1b')],'sectionId':_0x34178d['id']},{})[_0xe0b0('0x18')](function(){return _0x1cd705;});}else{return _0x1cd705;}})[_0xe0b0('0x3d')](function(_0x402a0e){logger[_0xe0b0('0x19')](_0xe0b0('0x3e'),_0x402a0e);throw _0x402a0e;});}return _0x1cd705;})[_0xe0b0('0x18')](respondWithResult(_0xc3d967,0xc9))[_0xe0b0('0x3d')](handleError(_0xc3d967,null));};exports['update']=function(_0x2aad80,_0x309bbf){if(_0x2aad80['body']['id']){delete _0x2aad80['body']['id'];}return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x2aad80['params']['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x309bbf,null))[_0xe0b0('0x18')](saveUpdates(_0x2aad80[_0xe0b0('0x33')],null))[_0xe0b0('0x18')](respondWithResult(_0x309bbf,null))[_0xe0b0('0x3d')](handleError(_0x309bbf,null));};exports['destroy']=function(_0x5d2fa2,_0x51c580){return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x5d2fa2['params']['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x51c580,null))[_0xe0b0('0x18')](removeEntity(_0x51c580,null))[_0xe0b0('0x3d')](handleError(_0x51c580,null));};exports[_0xe0b0('0x3f')]=function(_0x16ccca,_0x5c6f94){return db['SmsQueue'][_0xe0b0('0x3f')]()[_0xe0b0('0x18')](respondWithResult(_0x5c6f94,null))[_0xe0b0('0x3d')](handleError(_0x5c6f94,null));};exports[_0xe0b0('0x40')]=function(_0x1bf77d,_0x575c7d){var _0x3b1474={'raw':!![],'where':{}},_0x11d4fd={},_0x534340;return db['SmsQueue']['findOne']({'where':{'id':_0x1bf77d[_0xe0b0('0x41')]['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x575c7d,null))[_0xe0b0('0x18')](function(_0x364877){if(_0x364877){_0x534340=_0x364877['get']({'plain':!![]});_0x11d4fd[_0xe0b0('0x27')]=_[_0xe0b0('0x28')](db['UserSmsQueue']['rawAttributes']);_0x11d4fd[_0xe0b0('0x23')]=_[_0xe0b0('0x28')](_0x1bf77d['query']);_0x11d4fd[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0x11d4fd['model'],_0x11d4fd['query']);_0x3b1474[_0xe0b0('0x2c')]=_['intersection'](_0x11d4fd[_0xe0b0('0x27')],qs[_0xe0b0('0x2d')](_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x2d')]));_0x3b1474[_0xe0b0('0x2c')]=_0x3b1474[_0xe0b0('0x2c')]['length']?_0x3b1474['attributes']:_0x11d4fd[_0xe0b0('0x27')];if(!_0x1bf77d['query']['hasOwnProperty'](_0xe0b0('0x42'))){_0x3b1474[_0xe0b0('0x12')]=qs['limit'](_0x1bf77d['query'][_0xe0b0('0x12')]);_0x3b1474[_0xe0b0('0x10')]=qs[_0xe0b0('0x10')](_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x10')]);}_0x3b1474[_0xe0b0('0x43')]=qs[_0xe0b0('0x44')](_0x1bf77d['query'][_0xe0b0('0x44')]);_0x3b1474['where']=qs[_0xe0b0('0x2a')](_['pick'](_0x1bf77d['query'],_0x11d4fd[_0xe0b0('0x2a')]));_0x3b1474[_0xe0b0('0x45')][_0xe0b0('0x46')]=_0x364877['id'];if(_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x47')]){_0x3b1474[_0xe0b0('0x45')]=_[_0xe0b0('0x30')](_0x3b1474[_0xe0b0('0x45')],{'$or':_[_0xe0b0('0x48')](_0x3b1474['attributes'],function(_0x253ab0){var _0x57ccc9={};_0x57ccc9[_0x253ab0]={'$like':'%'+_0x1bf77d[_0xe0b0('0x23')][_0xe0b0('0x47')]+'%'};return _0x57ccc9;})});}_0x3b1474=_[_0xe0b0('0x30')]({},_0x3b1474,_0x1bf77d[_0xe0b0('0x31')]);return db[_0xe0b0('0x49')][_0xe0b0('0x24')](_0x3b1474);}})['then'](function(_0x1a057c){if(_0x1a057c){return db[_0xe0b0('0x4a')][_0xe0b0('0x4b')]({'where':{'id':_[_0xe0b0('0x48')](_0x1a057c,_0xe0b0('0x4c')),'role':_0xe0b0('0x4d')},'attributes':['id',_0xe0b0('0x1b'),_0xe0b0('0x4e'),_0xe0b0('0x4f'),_0xe0b0('0x50')]});}})[_0xe0b0('0x18')](function(_0x18ab99){if(_0x18ab99){return{'count':_0x18ab99[_0xe0b0('0x13')],'rows':_[_0xe0b0('0x48')](_0x18ab99[_0xe0b0('0x25')],function(_0x34c642){return{'membername':_0x34c642[_0xe0b0('0x1b')],'UserId':_0x34c642['id'],'queue_name':_0x534340[_0xe0b0('0x1b')],'SmsQueueId':_0x534340['id'],'interface':util['format'](_0xe0b0('0x51'),_0xe0b0('0x52'),_0x34c642[_0xe0b0('0x1b')]),'penalty':0x0,'paused':_0x34c642[_0xe0b0('0x4e')],'createdAt':_0x34c642[_0xe0b0('0x50')],'updatedAt':_0x34c642[_0xe0b0('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe0b0('0x18')](respondWithFilteredResult(_0x575c7d,_0x3b1474))['catch'](handleError(_0x575c7d,null));};exports['getTeams']=function(_0x139014,_0x2a0415){var _0x157556={};var _0x47ecc1={};var _0x117d20;var _0x13fb4b;return db[_0xe0b0('0x1d')][_0xe0b0('0x53')]({'where':{'id':_0x139014[_0xe0b0('0x41')]['id']}})['then'](handleEntityNotFound(_0x2a0415,null))[_0xe0b0('0x18')](function(_0x242120){if(_0x242120){_0x117d20=_0x242120;_0x47ecc1[_0xe0b0('0x27')]=_['keys'](db[_0xe0b0('0x54')][_0xe0b0('0x29')]);_0x47ecc1['query']=_[_0xe0b0('0x28')](_0x139014['query']);_0x47ecc1['filters']=_[_0xe0b0('0x2b')](_0x47ecc1['model'],_0x47ecc1['query']);_0x157556[_0xe0b0('0x2c')]=_[_0xe0b0('0x2b')](_0x47ecc1[_0xe0b0('0x27')],qs[_0xe0b0('0x2d')](_0x139014['query'][_0xe0b0('0x2d')]));_0x157556[_0xe0b0('0x2c')]=_0x157556[_0xe0b0('0x2c')][_0xe0b0('0x2e')]?_0x157556[_0xe0b0('0x2c')]:_0x47ecc1[_0xe0b0('0x27')];_0x157556[_0xe0b0('0x43')]=qs[_0xe0b0('0x44')](_0x139014['query']['sort']);_0x157556[_0xe0b0('0x45')]=qs[_0xe0b0('0x2a')](_[_0xe0b0('0x55')](_0x139014['query'],_0x47ecc1['filters']));if(_0x139014[_0xe0b0('0x23')][_0xe0b0('0x47')]){_0x157556['where']=_['merge'](_0x157556[_0xe0b0('0x45')],{'$or':_[_0xe0b0('0x48')](_0x157556[_0xe0b0('0x2c')],function(_0x29175a){var _0x3b263f={};_0x3b263f[_0x29175a]={'$like':'%'+_0x139014[_0xe0b0('0x23')][_0xe0b0('0x47')]+'%'};return _0x3b263f;})});}_0x157556=_[_0xe0b0('0x30')]({},_0x157556,_0x139014['options']);return _0x117d20[_0xe0b0('0x56')](_0x157556);}})[_0xe0b0('0x18')](function(_0x1673bc){if(_0x1673bc){_0x13fb4b=_0x1673bc['length'];if(!_0x139014['query']['hasOwnProperty']('nolimit')){_0x157556['limit']=qs['limit'](_0x139014[_0xe0b0('0x23')]['limit']);_0x157556['offset']=qs[_0xe0b0('0x10')](_0x139014[_0xe0b0('0x23')][_0xe0b0('0x10')]);}return _0x117d20[_0xe0b0('0x56')](_0x157556);}})[_0xe0b0('0x18')](function(_0xd0629e){if(_0xd0629e){return _0xd0629e?{'count':_0x13fb4b,'rows':_0xd0629e}:null;}})[_0xe0b0('0x18')](respondWithResult(_0x2a0415,null))[_0xe0b0('0x3d')](handleError(_0x2a0415,null));};exports['addTeams']=function(_0x3097fb,_0x5da8fd){var _0x86e90=_0x3097fb[_0xe0b0('0x33')][_0xe0b0('0x57')];return db[_0xe0b0('0x54')][_0xe0b0('0x24')]({'where':{'id':_0x86e90},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe0b0('0x58'),'attributes':['id','name',_0xe0b0('0x59'),_0xe0b0('0x5a'),_0xe0b0('0x5b')],'raw':!![]}]})[_0xe0b0('0x18')](function(_0x4a78f8){if(_0x4a78f8){var _0x311f79=_[_0xe0b0('0x5c')](_0x4a78f8,function(_0x49deef){var _0x4cf60a=_0x49deef[_0xe0b0('0x34')]({'plain':!![]});return _0x4cf60a[_0xe0b0('0x58')];});return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x3097fb[_0xe0b0('0x41')]['id']}})[_0xe0b0('0x18')](function(_0x34f4ff){return db[_0xe0b0('0x5d')][_0xe0b0('0x5e')](function(_0x24571b){return _0x34f4ff['addTeams'](_0x86e90,{'transaction':_0x24571b})['then'](function(){return BPromise[_0xe0b0('0x5f')](_0x311f79,function(_0x4880d5){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x4880d5['id'],'SmsQueueId':_0x3097fb['params']['id']},'transaction':_0x24571b});});})[_0xe0b0('0x18')](function(){_0x311f79['forEach'](function(_0x654d2b){socket[_0xe0b0('0x60')](_0xe0b0('0x61'),{'UserId':_0x654d2b['id'],'SmsQueueId':_0x34f4ff['id']});});});});});}})[_0xe0b0('0x18')](respondWithStatusCode(_0x5da8fd,null))['catch'](handleError(_0x5da8fd,null));};exports[_0xe0b0('0x62')]=function(_0x948708,_0x5a0817){return db[_0xe0b0('0x54')][_0xe0b0('0x24')]({'where':{'id':_0x948708[_0xe0b0('0x23')][_0xe0b0('0x57')]},'attributes':['id'],'include':[{'model':db[_0xe0b0('0x4a')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5a0817,null))['then'](function(_0x545694){var _0x5c258b=_[_0xe0b0('0x48')](_0x545694,'id');var _0x567e1a=[];var _0x3c09af=[];var _0x5f4aaf=squel[_0xe0b0('0x63')]();_0x5f4aaf[_0xe0b0('0x64')](_0xe0b0('0x65'))[_0xe0b0('0x66')](_0xe0b0('0x67'),'tq')[_0xe0b0('0x68')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where']('SmsQueueId\x20=\x20?',_0x948708[_0xe0b0('0x41')]['id']);for(var _0x261381=0x0;_0x261381<_0x545694[_0xe0b0('0x2e')];_0x261381+=0x1){let _0x4377f7=_0x545694[_0x261381];for(var _0x2c1149=0x0;_0x2c1149<_0x4377f7['Agents'][_0xe0b0('0x2e')];_0x2c1149+=0x1){let _0x39a07b=_0x4377f7[_0xe0b0('0x58')][_0x2c1149];var _0xc6090e=_0x5f4aaf[_0xe0b0('0x69')]();_0xc6090e[_0xe0b0('0x45')](_0xe0b0('0x6a'),_0x39a07b['id']);_0x3c09af[_0xe0b0('0x6b')](db[_0xe0b0('0x5d')]['query'](_0xc6090e['toString'](),{'type':db[_0xe0b0('0x5d')][_0xe0b0('0x6c')]['SELECT']})[_0xe0b0('0x18')](function(_0x4593f1){if(_0x4593f1[_0xe0b0('0x2e')]===0x1){return _0x39a07b['id'];}else{var _0x3fcffd=_[_0xe0b0('0x6d')](_[_0xe0b0('0x48')](_0x4593f1,_0xe0b0('0x6e')),function(_0xc8eba3){return _['includes'](_0x5c258b,_0xc8eba3);});if(_0x3fcffd){return _0x39a07b['id'];}}}));}}return BPromise['all'](_0x3c09af)['then'](function(_0xc19743){_0x567e1a=_(_0x567e1a)[_0xe0b0('0x6f')](_0xc19743)['compact']()[_0xe0b0('0x70')]();return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x948708[_0xe0b0('0x41')]['id']}})['then'](function(_0x56c4b9){return db['sequelize'][_0xe0b0('0x5e')](function(_0x266835){return _0x56c4b9['removeTeams'](_0x948708[_0xe0b0('0x23')][_0xe0b0('0x57')],{'transaction':_0x266835})['then'](function(){if(!_['isEmpty'](_0x567e1a)){return _0x56c4b9[_0xe0b0('0x71')](_0x567e1a,{'transaction':_0x266835});}})['then'](function(){_0x567e1a[_0xe0b0('0x72')](function(_0x5f06c0){socket[_0xe0b0('0x60')](_0xe0b0('0x73'),{'UserId':_0x5f06c0,'SmsQueueId':_0x56c4b9['id']});});});});});});})[_0xe0b0('0x18')](respondWithStatusCode(_0x5a0817,null))[_0xe0b0('0x3d')](handleError(_0x5a0817,null));};exports[_0xe0b0('0x74')]=function(_0x1ec7c2,_0x434dfa){return db[_0xe0b0('0x1d')][_0xe0b0('0x32')]({'where':{'id':_0x1ec7c2['params']['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x434dfa,null))[_0xe0b0('0x18')](function(_0x2b40eb){if(_0x2b40eb){return _0x2b40eb['addAgents'](_0x1ec7c2[_0xe0b0('0x33')]['ids'],_[_0xe0b0('0x75')](_0x1ec7c2[_0xe0b0('0x33')],['ids','id'])||{})[_0xe0b0('0x76')](function(_0x4e4b45){for(var _0x528932=0x0;_0x528932<_0x1ec7c2[_0xe0b0('0x33')]['ids']['length'];_0x528932+=0x1){socket[_0xe0b0('0x60')](_0xe0b0('0x61'),{'UserId':Number(_0x1ec7c2[_0xe0b0('0x33')][_0xe0b0('0x57')][_0x528932]),'SmsQueueId':Number(_0x1ec7c2[_0xe0b0('0x41')]['id'])});}return _0x4e4b45;});}})[_0xe0b0('0x18')](respondWithResult(_0x434dfa,null))['catch'](handleError(_0x434dfa,null));};exports[_0xe0b0('0x71')]=function(_0x4609d5,_0x421b3b){return db['SmsQueue'][_0xe0b0('0x32')]({'where':{'id':_0x4609d5[_0xe0b0('0x41')]['id']}})['then'](handleEntityNotFound(_0x421b3b,null))['then'](function(_0x33f89a){if(_0x33f89a){return _0x33f89a['removeAgents'](_0x4609d5[_0xe0b0('0x23')][_0xe0b0('0x57')])[_0xe0b0('0x18')](function(){if(_[_0xe0b0('0x77')](_0x4609d5[_0xe0b0('0x23')][_0xe0b0('0x57')])){for(var _0x3d70d7=0x0;_0x3d70d7<_0x4609d5['query'][_0xe0b0('0x57')][_0xe0b0('0x2e')];_0x3d70d7+=0x1){socket[_0xe0b0('0x60')](_0xe0b0('0x73'),{'UserId':Number(_0x4609d5[_0xe0b0('0x23')]['ids'][_0x3d70d7]),'SmsQueueId':Number(_0x4609d5['params']['id'])});}}else{socket[_0xe0b0('0x60')](_0xe0b0('0x73'),{'UserId':Number(_0x4609d5[_0xe0b0('0x23')][_0xe0b0('0x57')]),'SmsQueueId':Number(_0x4609d5[_0xe0b0('0x41')]['id'])});}});}})[_0xe0b0('0x18')](respondWithStatusCode(_0x421b3b,null))[_0xe0b0('0x3d')](handleError(_0x421b3b,null));};exports[_0xe0b0('0x78')]=function(_0x932e,_0x1b3f4d){var _0x4fe048={};var _0xac45e6={};var _0x401c4b;var _0x3e18a3;return db[_0xe0b0('0x1d')]['findOne']({'where':{'id':_0x932e[_0xe0b0('0x41')]['id']}})[_0xe0b0('0x18')](handleEntityNotFound(_0x1b3f4d,null))[_0xe0b0('0x18')](function(_0x116c16){if(_0x116c16){_0x401c4b=_0x116c16;_0xac45e6[_0xe0b0('0x27')]=_['keys'](db[_0xe0b0('0x4a')]['rawAttributes']);_0xac45e6[_0xe0b0('0x23')]=_[_0xe0b0('0x28')](_0x932e[_0xe0b0('0x23')]);_0xac45e6[_0xe0b0('0x2a')]=_[_0xe0b0('0x2b')](_0xac45e6['model'],_0xac45e6['query']);_0x4fe048[_0xe0b0('0x2c')]=_['intersection'](_0xac45e6[_0xe0b0('0x27')],qs['fields'](_0x932e[_0xe0b0('0x23')][_0xe0b0('0x2d')]));_0x4fe048[_0xe0b0('0x2c')]=_0x4fe048[_0xe0b0('0x2c')][_0xe0b0('0x2e')]?_0x4fe048[_0xe0b0('0x2c')]:_0xac45e6[_0xe0b0('0x27')];_0x4fe048['order']=qs['sort'](_0x932e[_0xe0b0('0x23')][_0xe0b0('0x44')]);_0x4fe048[_0xe0b0('0x45')]=qs[_0xe0b0('0x2a')](_[_0xe0b0('0x55')](_0x932e[_0xe0b0('0x23')],_0xac45e6[_0xe0b0('0x2a')]));if(_0x932e[_0xe0b0('0x23')][_0xe0b0('0x47')]){_0x4fe048[_0xe0b0('0x45')]=_['merge'](_0x4fe048['where'],{'$or':_[_0xe0b0('0x48')](_0x4fe048[_0xe0b0('0x2c')],function(_0x187465){var _0x3f9e6b={};_0x3f9e6b[_0x187465]={'$like':'%'+_0x932e[_0xe0b0('0x23')][_0xe0b0('0x47')]+'%'};return _0x3f9e6b;})});}_0x4fe048=_[_0xe0b0('0x30')]({},_0x4fe048,_0x932e['options']);return _0x401c4b['getAgents'](_0x4fe048);}})[_0xe0b0('0x18')](function(_0x1ea4d5){if(_0x1ea4d5){_0x3e18a3=_0x1ea4d5[_0xe0b0('0x2e')];if(!_0x932e[_0xe0b0('0x23')][_0xe0b0('0x79')](_0xe0b0('0x42'))){_0x4fe048[_0xe0b0('0x12')]=qs[_0xe0b0('0x12')](_0x932e[_0xe0b0('0x23')][_0xe0b0('0x12')]);_0x4fe048['offset']=qs[_0xe0b0('0x10')](_0x932e[_0xe0b0('0x23')]['offset']);}return _0x401c4b[_0xe0b0('0x78')](_0x4fe048);}})[_0xe0b0('0x18')](function(_0x3615f9){if(_0x3615f9){return _0x3615f9?{'count':_0x3e18a3,'rows':_0x3615f9}:null;}})[_0xe0b0('0x18')](respondWithResult(_0x1b3f4d,null))[_0xe0b0('0x3d')](handleError(_0x1b3f4d,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index bab49fc..c9f8b7e 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 _0xff3f=['update','emit','hasOwnProperty','hook','exports','events','SmsQueue','setMaxListeners','save'];(function(_0x1e8bcb,_0x474a81){var _0x212080=function(_0x57a1f5){while(--_0x57a1f5){_0x1e8bcb['push'](_0x1e8bcb['shift']());}};_0x212080(++_0x474a81);}(_0xff3f,0xdd));var _0xfff3=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0xff3f[_0x1a9204];return _0x17ca68;};'use strict';var EventEmitter=require(_0xfff3('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xfff3('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xfff3('0x2')](0x0);var events={'afterCreate':_0xfff3('0x3'),'afterUpdate':_0xfff3('0x4'),'afterDestroy':'remove'};function emitEvent(_0x11094b){return function(_0x218154,_0x5cf25b,_0x2f030f){SmsQueueEvents[_0xfff3('0x5')](_0x11094b+':'+_0x218154['id'],_0x218154);SmsQueueEvents['emit'](_0x11094b,_0x218154);_0x2f030f(null);};}for(var e in events){if(events[_0xfff3('0x6')](e)){var event=events[e];SmsQueue[_0xfff3('0x7')](e,emitEvent(event));}}module[_0xfff3('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0x4489=['../../mysqldb','SmsQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x5de9ea,_0x55a869){var _0x467891=function(_0x4efcf5){while(--_0x4efcf5){_0x5de9ea['push'](_0x5de9ea['shift']());}};_0x467891(++_0x55a869);}(_0x4489,0xe5));var _0x9448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4489[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x9448('0x0'));var SmsQueue=require(_0x9448('0x1'))['db'][_0x9448('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x9448('0x3')](0x0);var events={'afterCreate':_0x9448('0x4'),'afterUpdate':_0x9448('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4811a8){return function(_0x3ea1f6,_0x5ce5a7,_0x24e9a0){SmsQueueEvents['emit'](_0x4811a8+':'+_0x3ea1f6['id'],_0x3ea1f6);SmsQueueEvents[_0x9448('0x6')](_0x4811a8,_0x3ea1f6);_0x24e9a0(null);};}for(var e in events){if(events[_0x9448('0x7')](e)){var event=events[e];SmsQueue[_0x9448('0x8')](e,emitEvent(event));}}module[_0x9448('0x9')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 8958a01..365de11 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 _0xc633=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','util'];(function(_0x3e0dc4,_0x13971b){var _0x586111=function(_0x123c53){while(--_0x123c53){_0x3e0dc4['push'](_0x3e0dc4['shift']());}};_0x586111(++_0x13971b);}(_0xc633,0x107));var _0x3c63=function(_0x2a7379,_0x33cc90){_0x2a7379=_0x2a7379-0x0;var _0x438974=_0xc633[_0x2a7379];return _0x438974;};'use strict';var _=require('lodash');var util=require(_0x3c63('0x0'));var logger=require(_0x3c63('0x1'))(_0x3c63('0x2'));var moment=require('moment');var BPromise=require(_0x3c63('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3c63('0x4'));var rimraf=require(_0x3c63('0x5'));var config=require(_0x3c63('0x6'));var attributes=require(_0x3c63('0x7'));module[_0x3c63('0x8')]=function(_0x402abe,_0x481972){return _0x402abe[_0x3c63('0x9')](_0x3c63('0xa'),attributes,{'tableName':_0x3c63('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b00=['sms_queues','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue'];(function(_0x3e182f,_0x380ec7){var _0x23edc9=function(_0x3ca65e){while(--_0x3ca65e){_0x3e182f['push'](_0x3e182f['shift']());}};_0x23edc9(++_0x380ec7);}(_0x1b00,0xc4));var _0x01b0=function(_0xb6e50b,_0x4b20ee){_0xb6e50b=_0xb6e50b-0x0;var _0x5df670=_0x1b00[_0xb6e50b];return _0x5df670;};'use strict';var _=require(_0x01b0('0x0'));var util=require(_0x01b0('0x1'));var logger=require('../../config/logger')(_0x01b0('0x2'));var moment=require(_0x01b0('0x3'));var BPromise=require(_0x01b0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x01b0('0x5'));var rimraf=require(_0x01b0('0x6'));var config=require(_0x01b0('0x7'));var attributes=require(_0x01b0('0x8'));module[_0x01b0('0x9')]=function(_0xc1540b,_0x382107){return _0xc1540b[_0x01b0('0xa')](_0x01b0('0xb'),attributes,{'tableName':_0x01b0('0xc'),'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 7f7a7fe..3d04caa 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 _0x70ba=['util','moment','ioredis','../../config/utils','../../config/logger','rpc','client','redis','defaults','localhost','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetSmsQueue','findAll','raw','options','where','attributes','limit','include','map','model','then','SmsQueue','find','ShowSmsQueue','lodash'];(function(_0x8b156d,_0x31f312){var _0x4c06ed=function(_0x503c70){while(--_0x503c70){_0x8b156d['push'](_0x8b156d['shift']());}};_0x4c06ed(++_0x31f312);}(_0x70ba,0x109));var _0xa70b=function(_0x4b071c,_0x3bbb51){_0x4b071c=_0x4b071c-0x0;var _0x2f1757=_0x70ba[_0x4b071c];return _0x2f1757;};'use strict';var _=require(_0xa70b('0x0'));var util=require(_0xa70b('0x1'));var moment=require(_0xa70b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa70b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa70b('0x4'));var logger=require(_0xa70b('0x5'))(_0xa70b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa70b('0x7')]['http']({'port':0x232a});config[_0xa70b('0x8')]=_[_0xa70b('0x9')](config[_0xa70b('0x8')],{'host':_0xa70b('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa70b('0x8')]));require(_0xa70b('0xb'))[_0xa70b('0xc')](socket);function respondWithRpcPromise(_0x238671,_0x4341cd,_0x142281){return new BPromise(function(_0x93d4f6,_0x29900b){return client[_0xa70b('0xd')](_0x238671,_0x142281)['then'](function(_0x10788b){logger[_0xa70b('0xe')](_0xa70b('0xf'),_0x4341cd,_0xa70b('0x10'));logger[_0xa70b('0x11')](_0xa70b('0x12'),_0x4341cd,_0xa70b('0x10'),JSON[_0xa70b('0x13')](_0x10788b));if(_0x10788b['error']){if(_0x10788b[_0xa70b('0x14')][_0xa70b('0x15')]===0x1f4){logger[_0xa70b('0x14')](_0xa70b('0xf'),_0x4341cd,_0x10788b[_0xa70b('0x14')][_0xa70b('0x16')]);return _0x29900b(_0x10788b['error'][_0xa70b('0x16')]);}logger[_0xa70b('0x14')]('SmsQueue,\x20%s,\x20%s',_0x4341cd,_0x10788b[_0xa70b('0x14')][_0xa70b('0x16')]);return _0x93d4f6(_0x10788b[_0xa70b('0x14')][_0xa70b('0x16')]);}else{logger[_0xa70b('0xe')](_0xa70b('0xf'),_0x4341cd,_0xa70b('0x10'));_0x93d4f6(_0x10788b['result'][_0xa70b('0x16')]);}})[_0xa70b('0x17')](function(_0x4fca5e){logger['error'](_0xa70b('0xf'),_0x4341cd,_0x4fca5e);_0x29900b(_0x4fca5e);});});}exports[_0xa70b('0x18')]=function(_0x567a36){var _0x3da19c=this;return new Promise(function(_0x47ec3d,_0x4859b2){return db['SmsQueue'][_0xa70b('0x19')]({'raw':_0x567a36['options']?_0x567a36['options'][_0xa70b('0x1a')]===undefined?!![]:![]:!![],'where':_0x567a36['options']?_0x567a36[_0xa70b('0x1b')][_0xa70b('0x1c')]||null:null,'attributes':_0x567a36[_0xa70b('0x1b')]?_0x567a36['options'][_0xa70b('0x1d')]||null:null,'limit':_0x567a36[_0xa70b('0x1b')]?_0x567a36[_0xa70b('0x1b')][_0xa70b('0x1e')]||null:null,'include':_0x567a36[_0xa70b('0x1b')]?_0x567a36[_0xa70b('0x1b')][_0xa70b('0x1f')]?_[_0xa70b('0x20')](_0x567a36[_0xa70b('0x1b')][_0xa70b('0x1f')],function(_0x503a95){return{'model':db[_0x503a95[_0xa70b('0x21')]],'as':_0x503a95['as'],'attributes':_0x503a95[_0xa70b('0x1d')],'include':_0x503a95[_0xa70b('0x1f')]?_[_0xa70b('0x20')](_0x503a95[_0xa70b('0x1f')],function(_0x92a337){return{'model':db[_0x92a337['model']],'as':_0x92a337['as'],'attributes':_0x92a337['attributes'],'include':_0x92a337[_0xa70b('0x1f')]?_[_0xa70b('0x20')](_0x92a337[_0xa70b('0x1f')],function(_0x2017ee){return{'model':db[_0x2017ee[_0xa70b('0x21')]],'as':_0x2017ee['as'],'attributes':_0x2017ee[_0xa70b('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa70b('0x22')](function(_0x574cf9){logger['info']('GetSmsQueue',_0x567a36);logger['debug'](_0xa70b('0x18'),_0x567a36,JSON[_0xa70b('0x13')](_0x574cf9));_0x47ec3d(_0x574cf9);})[_0xa70b('0x17')](function(_0x41ba81){logger[_0xa70b('0x14')](_0xa70b('0x18'),_0x41ba81[_0xa70b('0x16')],_0x567a36);_0x4859b2(_0x3da19c['error'](0x1f4,_0x41ba81[_0xa70b('0x16')]));});});};exports['ShowSmsQueue']=function(_0x1f3271){var _0x38c040=this;return new Promise(function(_0x252b95,_0xa837c8){return db[_0xa70b('0x23')][_0xa70b('0x24')]({'raw':_0x1f3271[_0xa70b('0x1b')]?_0x1f3271['options'][_0xa70b('0x1a')]===undefined?!![]:![]:!![],'where':_0x1f3271['options']?_0x1f3271['options'][_0xa70b('0x1c')]||null:null,'attributes':_0x1f3271[_0xa70b('0x1b')]?_0x1f3271[_0xa70b('0x1b')][_0xa70b('0x1d')]||null:null,'include':_0x1f3271['options']?_0x1f3271[_0xa70b('0x1b')][_0xa70b('0x1f')]?_['map'](_0x1f3271['options'][_0xa70b('0x1f')],function(_0xd4965e){return{'model':db[_0xd4965e[_0xa70b('0x21')]],'as':_0xd4965e['as'],'attributes':_0xd4965e[_0xa70b('0x1d')],'include':_0xd4965e['include']?_['map'](_0xd4965e['include'],function(_0x1371a7){return{'model':db[_0x1371a7[_0xa70b('0x21')]],'as':_0x1371a7['as'],'attributes':_0x1371a7[_0xa70b('0x1d')],'include':_0x1371a7['include']?_[_0xa70b('0x20')](_0x1371a7[_0xa70b('0x1f')],function(_0x56db47){return{'model':db[_0x56db47[_0xa70b('0x21')]],'as':_0x56db47['as'],'attributes':_0x56db47['attributes']};}):[]};}):[]};}):[]:[]})[_0xa70b('0x22')](function(_0x261d77){logger[_0xa70b('0xe')](_0xa70b('0x25'),_0x1f3271);logger['debug'](_0xa70b('0x25'),_0x1f3271,JSON['stringify'](_0x261d77));_0x252b95(_0x261d77);})[_0xa70b('0x17')](function(_0x1015e8){logger['error'](_0xa70b('0x25'),_0x1015e8[_0xa70b('0x16')],_0x1f3271);_0xa837c8(_0x38c040[_0xa70b('0x14')](0x1f4,_0x1015e8['message']));});});}; \ No newline at end of file +var _0xa56a=['register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','options','raw','where','attributes','map','include','model','ShowSmsQueue','find','lodash','util','moment','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','redis','./smsQueue.socket'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0xa56a,0x1d5));var _0xaa56=function(_0x237a3e,_0x22a5cd){_0x237a3e=_0x237a3e-0x0;var _0x38101f=_0xa56a[_0x237a3e];return _0x38101f;};'use strict';var _=require(_0xaa56('0x0'));var util=require(_0xaa56('0x1'));var moment=require(_0xaa56('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaa56('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xaa56('0x4'));var logger=require('../../config/logger')(_0xaa56('0x5'));var config=require(_0xaa56('0x6'));var jayson=require(_0xaa56('0x7'));var client=jayson[_0xaa56('0x8')]['http']({'port':0x232a});config['redis']=_[_0xaa56('0x9')](config[_0xaa56('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xaa56('0xb'))[_0xaa56('0xc')](socket);function respondWithRpcPromise(_0x13de92,_0xfd63e6,_0x4ba1c7){return new BPromise(function(_0x3c98a0,_0x25c770){return client[_0xaa56('0xd')](_0x13de92,_0x4ba1c7)[_0xaa56('0xe')](function(_0x596a35){logger[_0xaa56('0xf')](_0xaa56('0x10'),_0xfd63e6,_0xaa56('0x11'));logger[_0xaa56('0x12')](_0xaa56('0x13'),_0xfd63e6,_0xaa56('0x11'),JSON[_0xaa56('0x14')](_0x596a35));if(_0x596a35[_0xaa56('0x15')]){if(_0x596a35[_0xaa56('0x15')][_0xaa56('0x16')]===0x1f4){logger['error']('SmsQueue,\x20%s,\x20%s',_0xfd63e6,_0x596a35['error'][_0xaa56('0x17')]);return _0x25c770(_0x596a35[_0xaa56('0x15')]['message']);}logger[_0xaa56('0x15')](_0xaa56('0x10'),_0xfd63e6,_0x596a35['error'][_0xaa56('0x17')]);return _0x3c98a0(_0x596a35[_0xaa56('0x15')][_0xaa56('0x17')]);}else{logger[_0xaa56('0xf')]('SmsQueue,\x20%s,\x20%s',_0xfd63e6,_0xaa56('0x11'));_0x3c98a0(_0x596a35[_0xaa56('0x18')]['message']);}})[_0xaa56('0x19')](function(_0x3ec69e){logger[_0xaa56('0x15')](_0xaa56('0x10'),_0xfd63e6,_0x3ec69e);_0x25c770(_0x3ec69e);});});}exports[_0xaa56('0x1a')]=function(_0x803484){var _0x5aa8f8=this;return new Promise(function(_0x3cdd39,_0xbffc58){return db[_0xaa56('0x1b')]['findAll']({'raw':_0x803484['options']?_0x803484[_0xaa56('0x1c')][_0xaa56('0x1d')]===undefined?!![]:![]:!![],'where':_0x803484[_0xaa56('0x1c')]?_0x803484['options'][_0xaa56('0x1e')]||null:null,'attributes':_0x803484[_0xaa56('0x1c')]?_0x803484[_0xaa56('0x1c')][_0xaa56('0x1f')]||null:null,'limit':_0x803484[_0xaa56('0x1c')]?_0x803484[_0xaa56('0x1c')]['limit']||null:null,'include':_0x803484[_0xaa56('0x1c')]?_0x803484[_0xaa56('0x1c')]['include']?_[_0xaa56('0x20')](_0x803484[_0xaa56('0x1c')][_0xaa56('0x21')],function(_0x151763){return{'model':db[_0x151763[_0xaa56('0x22')]],'as':_0x151763['as'],'attributes':_0x151763['attributes'],'include':_0x151763[_0xaa56('0x21')]?_['map'](_0x151763[_0xaa56('0x21')],function(_0x2be31f){return{'model':db[_0x2be31f[_0xaa56('0x22')]],'as':_0x2be31f['as'],'attributes':_0x2be31f['attributes'],'include':_0x2be31f['include']?_['map'](_0x2be31f[_0xaa56('0x21')],function(_0x468c35){return{'model':db[_0x468c35['model']],'as':_0x468c35['as'],'attributes':_0x468c35['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f4320){logger['info'](_0xaa56('0x1a'),_0x803484);logger[_0xaa56('0x12')](_0xaa56('0x1a'),_0x803484,JSON[_0xaa56('0x14')](_0x4f4320));_0x3cdd39(_0x4f4320);})[_0xaa56('0x19')](function(_0x24fe8f){logger[_0xaa56('0x15')](_0xaa56('0x1a'),_0x24fe8f[_0xaa56('0x17')],_0x803484);_0xbffc58(_0x5aa8f8['error'](0x1f4,_0x24fe8f[_0xaa56('0x17')]));});});};exports[_0xaa56('0x23')]=function(_0x301c33){var _0x1a376e=this;return new Promise(function(_0x556343,_0x537b16){return db[_0xaa56('0x1b')][_0xaa56('0x24')]({'raw':_0x301c33[_0xaa56('0x1c')]?_0x301c33[_0xaa56('0x1c')][_0xaa56('0x1d')]===undefined?!![]:![]:!![],'where':_0x301c33['options']?_0x301c33[_0xaa56('0x1c')][_0xaa56('0x1e')]||null:null,'attributes':_0x301c33[_0xaa56('0x1c')]?_0x301c33['options'][_0xaa56('0x1f')]||null:null,'include':_0x301c33[_0xaa56('0x1c')]?_0x301c33['options'][_0xaa56('0x21')]?_['map'](_0x301c33[_0xaa56('0x1c')]['include'],function(_0x4b0fbf){return{'model':db[_0x4b0fbf['model']],'as':_0x4b0fbf['as'],'attributes':_0x4b0fbf[_0xaa56('0x1f')],'include':_0x4b0fbf[_0xaa56('0x21')]?_[_0xaa56('0x20')](_0x4b0fbf[_0xaa56('0x21')],function(_0x17c1f5){return{'model':db[_0x17c1f5[_0xaa56('0x22')]],'as':_0x17c1f5['as'],'attributes':_0x17c1f5[_0xaa56('0x1f')],'include':_0x17c1f5[_0xaa56('0x21')]?_['map'](_0x17c1f5[_0xaa56('0x21')],function(_0x476266){return{'model':db[_0x476266[_0xaa56('0x22')]],'as':_0x476266['as'],'attributes':_0x476266[_0xaa56('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xaa56('0xe')](function(_0x32e48a){logger['info']('ShowSmsQueue',_0x301c33);logger[_0xaa56('0x12')]('ShowSmsQueue',_0x301c33,JSON[_0xaa56('0x14')](_0x32e48a));_0x556343(_0x32e48a);})['catch'](function(_0x584cf0){logger[_0xaa56('0x15')]('ShowSmsQueue',_0x584cf0['message'],_0x301c33);_0x537b16(_0x1a376e['error'](0x1f4,_0x584cf0[_0xaa56('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 8b0b7b0..9fa7209 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 _0xfdd2=['./smsQueue.events','remove','emit','register','length'];(function(_0x566862,_0x49a760){var _0x1ebc27=function(_0x126d7a){while(--_0x126d7a){_0x566862['push'](_0x566862['shift']());}};_0x1ebc27(++_0x49a760);}(_0xfdd2,0xf0));var _0x2fdd=function(_0x146907,_0x541dcb){_0x146907=_0x146907-0x0;var _0x47e370=_0xfdd2[_0x146907];return _0x47e370;};'use strict';var SmsQueueEvents=require(_0x2fdd('0x0'));var events=['save',_0x2fdd('0x1'),'update'];function createListener(_0x3ebbaf,_0x355b1f){return function(_0x3e52ff){_0x355b1f[_0x2fdd('0x2')](_0x3ebbaf,_0x3e52ff);};}function removeListener(_0x34c070,_0x54635c){return function(){SmsQueueEvents['removeListener'](_0x34c070,_0x54635c);};}exports[_0x2fdd('0x3')]=function(_0x2be61d){for(var _0x15d602=0x0,_0x2ed0f4=events[_0x2fdd('0x4')];_0x15d602<_0x2ed0f4;_0x15d602++){var _0x7bbdd2=events[_0x15d602];var _0x1346ba=createListener('smsQueue:'+_0x7bbdd2,_0x2be61d);SmsQueueEvents['on'](_0x7bbdd2,_0x1346ba);}}; \ No newline at end of file +var _0x1a21=['update','emit','removeListener','length','./smsQueue.events','save','remove'];(function(_0x10113d,_0x13a861){var _0xf52f5d=function(_0x5b6479){while(--_0x5b6479){_0x10113d['push'](_0x10113d['shift']());}};_0xf52f5d(++_0x13a861);}(_0x1a21,0x1d9));var _0x11a2=function(_0x2a238a,_0x1d5054){_0x2a238a=_0x2a238a-0x0;var _0xeef802=_0x1a21[_0x2a238a];return _0xeef802;};'use strict';var SmsQueueEvents=require(_0x11a2('0x0'));var events=[_0x11a2('0x1'),_0x11a2('0x2'),_0x11a2('0x3')];function createListener(_0x21960d,_0x25b6e9){return function(_0x2fcdd6){_0x25b6e9[_0x11a2('0x4')](_0x21960d,_0x2fcdd6);};}function removeListener(_0x784c38,_0x7f975a){return function(){SmsQueueEvents[_0x11a2('0x5')](_0x784c38,_0x7f975a);};}exports['register']=function(_0x25ba2c){for(var _0x374aa3=0x0,_0x238950=events[_0x11a2('0x6')];_0x374aa3<_0x238950;_0x374aa3++){var _0x227e9b=events[_0x374aa3];var _0x42438b=createListener('smsQueue:'+_0x227e9b,_0x25ba2c);SmsQueueEvents['on'](_0x227e9b,_0x42438b);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 276681a..59afdf0 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 _0x83b3=['describe','/:id','show','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe'];(function(_0x33dcf7,_0x3d5390){var _0x542d4e=function(_0x281250){while(--_0x281250){_0x33dcf7['push'](_0x33dcf7['shift']());}};_0x542d4e(++_0x3d5390);}(_0x83b3,0x147));var _0x383b=function(_0x2fd9ea,_0x1a99d9){_0x2fd9ea=_0x2fd9ea-0x0;var _0x4ba133=_0x83b3[_0x2fd9ea];return _0x4ba133;};'use strict';var multer=require(_0x383b('0x0'));var util=require(_0x383b('0x1'));var path=require(_0x383b('0x2'));var timeout=require(_0x383b('0x3'));var express=require(_0x383b('0x4'));var router=express[_0x383b('0x5')]();var fs_extra=require(_0x383b('0x6'));var auth=require(_0x383b('0x7'));var interaction=require(_0x383b('0x8'));var config=require('../../config/environment');var controller=require('./smsQueueReport.controller');router[_0x383b('0x9')]('/',auth[_0x383b('0xa')](),controller[_0x383b('0xb')]);router[_0x383b('0x9')](_0x383b('0xc'),auth[_0x383b('0xa')](),controller[_0x383b('0xd')]);router[_0x383b('0x9')](_0x383b('0xe'),auth[_0x383b('0xa')](),controller[_0x383b('0xf')]);router['post']('/',auth[_0x383b('0xa')](),controller[_0x383b('0x10')]);router[_0x383b('0x11')](_0x383b('0xe'),auth[_0x383b('0xa')](),controller['update']);router[_0x383b('0x12')]('/:id',auth[_0x383b('0xa')](),controller['destroy']);module[_0x383b('0x13')]=router; \ No newline at end of file +var _0x3e1f=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','create','/:id','update','delete','destroy','util','path'];(function(_0x4081b9,_0x42025e){var _0x468cbf=function(_0x5f1211){while(--_0x5f1211){_0x4081b9['push'](_0x4081b9['shift']());}};_0x468cbf(++_0x42025e);}(_0x3e1f,0x18a));var _0xf3e1=function(_0x274dd7,_0x2e6051){_0x274dd7=_0x274dd7-0x0;var _0x148829=_0x3e1f[_0x274dd7];return _0x148829;};'use strict';var multer=require('multer');var util=require(_0xf3e1('0x0'));var path=require(_0xf3e1('0x1'));var timeout=require(_0xf3e1('0x2'));var express=require('express');var router=express[_0xf3e1('0x3')]();var fs_extra=require(_0xf3e1('0x4'));var auth=require(_0xf3e1('0x5'));var interaction=require(_0xf3e1('0x6'));var config=require(_0xf3e1('0x7'));var controller=require('./smsQueueReport.controller');router[_0xf3e1('0x8')]('/',auth[_0xf3e1('0x9')](),controller[_0xf3e1('0xa')]);router[_0xf3e1('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xf3e1('0xb')]);router[_0xf3e1('0x8')]('/:id',auth[_0xf3e1('0x9')](),controller[_0xf3e1('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf3e1('0xd')]);router['put'](_0xf3e1('0xe'),auth[_0xf3e1('0x9')](),controller[_0xf3e1('0xf')]);router[_0xf3e1('0x10')](_0xf3e1('0xe'),auth['isAuthenticated'](),controller[_0xf3e1('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 180a641..edc5364 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 _0xe86b=['STRING','DATE','moment','sequelize','exports'];(function(_0x5259e1,_0xcd97fd){var _0x319c87=function(_0x4eea4d){while(--_0x4eea4d){_0x5259e1['push'](_0x5259e1['shift']());}};_0x319c87(++_0xcd97fd);}(_0xe86b,0x1c9));var _0xbe86=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xe86b[_0x59ee6f];return _0x4c0979;};'use strict';var moment=require(_0xbe86('0x0'));var Sequelize=require(_0xbe86('0x1'));module[_0xbe86('0x2')]={'uniqueid':{'type':Sequelize[_0xbe86('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xbe86('0x3')]},'joinAt':{'type':Sequelize[_0xbe86('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xbe86('0x4')]},'exitAt':{'type':Sequelize[_0xbe86('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x2894=['STRING','DATE','moment','sequelize'];(function(_0x27c28c,_0x49ba23){var _0x1f5669=function(_0x257683){while(--_0x257683){_0x27c28c['push'](_0x27c28c['shift']());}};_0x1f5669(++_0x49ba23);}(_0x2894,0xb2));var _0x4289=function(_0x18e0bf,_0x2b3088){_0x18e0bf=_0x18e0bf-0x0;var _0x13c438=_0x2894[_0x18e0bf];return _0x13c438;};'use strict';var moment=require(_0x4289('0x0'));var Sequelize=require(_0x4289('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x4289('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x4289('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x4289('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x4289('0x3')]},'reason':{'type':Sequelize[_0x4289('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index b70e143..bb94819 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 _0xc1fe=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','set','Content-Range','save','then','status','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','SmsQueueReport','findAll','rows','catch','show','find','create','body','params','describe','eml-format'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xc1fe,0x9d));var _0xec1f=function(_0x2f8dac,_0x1050ba){_0x2f8dac=_0x2f8dac-0x0;var _0x3d4222=_0xc1fe[_0x2f8dac];return _0x3d4222;};'use strict';var emlformat=require(_0xec1f('0x0'));var rimraf=require(_0xec1f('0x1'));var zipdir=require(_0xec1f('0x2'));var jsonpatch=require(_0xec1f('0x3'));var rp=require(_0xec1f('0x4'));var moment=require(_0xec1f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xec1f('0x6'));var util=require('util');var path=require(_0xec1f('0x7'));var sox=require(_0xec1f('0x8'));var csv=require(_0xec1f('0x9'));var ejs=require(_0xec1f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xec1f('0xb'));var squel=require(_0xec1f('0xc'));var crypto=require(_0xec1f('0xd'));var jsforce=require(_0xec1f('0xe'));var deskjs=require(_0xec1f('0xf'));var toCsv=require(_0xec1f('0x9'));var querystring=require(_0xec1f('0x10'));var Papa=require(_0xec1f('0x11'));var Redis=require('ioredis');var authService=require(_0xec1f('0x12'));var qs=require(_0xec1f('0x13'));var as=require(_0xec1f('0x14'));var hardwareService=require(_0xec1f('0x15'));var logger=require(_0xec1f('0x16'))('api');var utils=require(_0xec1f('0x17'));var config=require(_0xec1f('0x18'));var licenseUtil=require(_0xec1f('0x19'));var db=require(_0xec1f('0x1a'))['db'];function respondWithStatusCode(_0x1f17d7,_0x446e82){_0x446e82=_0x446e82||0xcc;return function(_0x31990d){if(_0x31990d){return _0x1f17d7[_0xec1f('0x1b')](_0x446e82);}return _0x1f17d7['status'](_0x446e82)['end']();};}function respondWithResult(_0x5a67c,_0x581738){_0x581738=_0x581738||0xc8;return function(_0x3cb285){if(_0x3cb285){return _0x5a67c['status'](_0x581738)[_0xec1f('0x1c')](_0x3cb285);}};}function respondWithFilteredResult(_0x23b4df,_0x1bb6df){return function(_0xef84e1){if(_0xef84e1){var _0x32636d=typeof _0x1bb6df[_0xec1f('0x1d')]===_0xec1f('0x1e')&&typeof _0x1bb6df[_0xec1f('0x1f')]===_0xec1f('0x1e');var _0x29479b=_0xef84e1[_0xec1f('0x20')];var _0x10a85d=_0x32636d?0x0:_0x1bb6df['offset'];var _0x2ebf0e=_0x32636d?_0xef84e1['count']:_0x1bb6df[_0xec1f('0x1d')]+_0x1bb6df['limit'];var _0x5eae05;if(_0x2ebf0e>=_0x29479b){_0x2ebf0e=_0x29479b;_0x5eae05=0xc8;}else{_0x5eae05=0xce;}_0x23b4df['status'](_0x5eae05);return _0x23b4df[_0xec1f('0x21')](_0xec1f('0x22'),_0x10a85d+'-'+_0x2ebf0e+'/'+_0x29479b)[_0xec1f('0x1c')](_0xef84e1);}return null;};}function patchUpdates(_0x59fa9e){return function(_0x3cf455){try{jsonpatch['apply'](_0x3cf455,_0x59fa9e,!![]);}catch(_0x58f180){return BPromise['reject'](_0x58f180);}return _0x3cf455[_0xec1f('0x23')]();};}function saveUpdates(_0x3691e8,_0x1e969a){return function(_0x586002){if(_0x586002){return _0x586002['update'](_0x3691e8)['then'](function(_0x4e65a5){return _0x4e65a5;});}return null;};}function removeEntity(_0x41913f,_0x25d09d){return function(_0x3bd84c){if(_0x3bd84c){return _0x3bd84c['destroy']()[_0xec1f('0x24')](function(){_0x41913f[_0xec1f('0x25')](0xcc)[_0xec1f('0x26')]();});}};}function handleEntityNotFound(_0x35478b,_0x898b8e){return function(_0x423cbe){if(!_0x423cbe){_0x35478b['sendStatus'](0x194);}return _0x423cbe;};}function handleError(_0x576e52,_0x415c20){_0x415c20=_0x415c20||0x1f4;return function(_0x51e93b){logger[_0xec1f('0x27')](_0x51e93b[_0xec1f('0x28')]);if(_0x51e93b[_0xec1f('0x29')]){delete _0x51e93b['name'];}_0x576e52['status'](_0x415c20)[_0xec1f('0x2a')](_0x51e93b);};}exports[_0xec1f('0x2b')]=function(_0x43c5c3,_0x19cec3){var _0x22d219={},_0x2180bf={},_0x19c171={'count':0x0,'rows':[]};var _0x3a750d=_[_0xec1f('0x2c')](db['SmsQueueReport'][_0xec1f('0x2d')],function(_0x15c1c4){return{'name':_0x15c1c4[_0xec1f('0x2e')],'type':_0x15c1c4['type'][_0xec1f('0x2f')]};});_0x2180bf[_0xec1f('0x30')]=_['map'](_0x3a750d,_0xec1f('0x29'));_0x2180bf['query']=_[_0xec1f('0x31')](_0x43c5c3['query']);_0x2180bf['filters']=_[_0xec1f('0x32')](_0x2180bf[_0xec1f('0x30')],_0x2180bf[_0xec1f('0x33')]);_0x22d219[_0xec1f('0x34')]=_[_0xec1f('0x32')](_0x2180bf[_0xec1f('0x30')],qs[_0xec1f('0x35')](_0x43c5c3[_0xec1f('0x33')][_0xec1f('0x35')]));_0x22d219[_0xec1f('0x34')]=_0x22d219[_0xec1f('0x34')][_0xec1f('0x36')]?_0x22d219[_0xec1f('0x34')]:_0x2180bf[_0xec1f('0x30')];if(!_0x43c5c3[_0xec1f('0x33')][_0xec1f('0x37')](_0xec1f('0x38'))){_0x22d219[_0xec1f('0x1f')]=qs[_0xec1f('0x1f')](_0x43c5c3[_0xec1f('0x33')][_0xec1f('0x1f')]);_0x22d219[_0xec1f('0x1d')]=qs['offset'](_0x43c5c3[_0xec1f('0x33')][_0xec1f('0x1d')]);}_0x22d219[_0xec1f('0x39')]=qs[_0xec1f('0x3a')](_0x43c5c3[_0xec1f('0x33')][_0xec1f('0x3a')]);_0x22d219['where']=qs[_0xec1f('0x3b')](_[_0xec1f('0x3c')](_0x43c5c3['query'],_0x2180bf['filters']),_0x3a750d);if(_0x43c5c3['query'][_0xec1f('0x3d')]){_0x22d219[_0xec1f('0x3e')]=_[_0xec1f('0x3f')](_0x22d219[_0xec1f('0x3e')],{'$or':_[_0xec1f('0x2c')](_0x3a750d,function(_0x51b69d){if(_0x51b69d[_0xec1f('0x40')]!==_0xec1f('0x41')){var _0x19cf48={};_0x19cf48[_0x51b69d[_0xec1f('0x29')]]={'$like':'%'+_0x43c5c3[_0xec1f('0x33')]['filter']+'%'};return _0x19cf48;}})});}_0x22d219=_['merge']({},_0x22d219,_0x43c5c3[_0xec1f('0x42')]);var _0x3d1cc4={'where':_0x22d219[_0xec1f('0x3e')]};return db['SmsQueueReport'][_0xec1f('0x20')](_0x3d1cc4)[_0xec1f('0x24')](function(_0x3795f2){_0x19c171['count']=_0x3795f2;if(_0x43c5c3[_0xec1f('0x33')][_0xec1f('0x43')]){_0x22d219[_0xec1f('0x44')]=[{'all':!![]}];}return db[_0xec1f('0x45')][_0xec1f('0x46')](_0x22d219);})[_0xec1f('0x24')](function(_0x39aa05){_0x19c171[_0xec1f('0x47')]=_0x39aa05;return _0x19c171;})['then'](respondWithFilteredResult(_0x19cec3,_0x22d219))[_0xec1f('0x48')](handleError(_0x19cec3,null));};exports[_0xec1f('0x49')]=function(_0x4467a8,_0x58c3b5){var _0x44d4c5={'raw':!![],'where':{'id':_0x4467a8['params']['id']}},_0x9c04a3={};_0x9c04a3[_0xec1f('0x30')]=_[_0xec1f('0x31')](db[_0xec1f('0x45')][_0xec1f('0x2d')]);_0x9c04a3['query']=_[_0xec1f('0x31')](_0x4467a8[_0xec1f('0x33')]);_0x9c04a3['filters']=_[_0xec1f('0x32')](_0x9c04a3[_0xec1f('0x30')],_0x9c04a3[_0xec1f('0x33')]);_0x44d4c5['attributes']=_['intersection'](_0x9c04a3[_0xec1f('0x30')],qs[_0xec1f('0x35')](_0x4467a8[_0xec1f('0x33')]['fields']));_0x44d4c5[_0xec1f('0x34')]=_0x44d4c5[_0xec1f('0x34')]['length']?_0x44d4c5[_0xec1f('0x34')]:_0x9c04a3[_0xec1f('0x30')];if(_0x4467a8['query'][_0xec1f('0x43')]){_0x44d4c5[_0xec1f('0x44')]=[{'all':!![]}];}_0x44d4c5=_[_0xec1f('0x3f')]({},_0x44d4c5,_0x4467a8[_0xec1f('0x42')]);return db[_0xec1f('0x45')][_0xec1f('0x4a')](_0x44d4c5)[_0xec1f('0x24')](handleEntityNotFound(_0x58c3b5,null))[_0xec1f('0x24')](respondWithResult(_0x58c3b5,null))['catch'](handleError(_0x58c3b5,null));};exports[_0xec1f('0x4b')]=function(_0x179671,_0x3257ef){return db['SmsQueueReport'][_0xec1f('0x4b')](_0x179671[_0xec1f('0x4c')],{})[_0xec1f('0x24')](respondWithResult(_0x3257ef,0xc9))[_0xec1f('0x48')](handleError(_0x3257ef,null));};exports['update']=function(_0x30c6d9,_0x562d8a){if(_0x30c6d9[_0xec1f('0x4c')]['id']){delete _0x30c6d9[_0xec1f('0x4c')]['id'];}return db[_0xec1f('0x45')]['find']({'where':{'id':_0x30c6d9[_0xec1f('0x4d')]['id']}})[_0xec1f('0x24')](handleEntityNotFound(_0x562d8a,null))['then'](saveUpdates(_0x30c6d9[_0xec1f('0x4c')],null))['then'](respondWithResult(_0x562d8a,null))[_0xec1f('0x48')](handleError(_0x562d8a,null));};exports['destroy']=function(_0x289f4e,_0x280640){return db[_0xec1f('0x45')][_0xec1f('0x4a')]({'where':{'id':_0x289f4e[_0xec1f('0x4d')]['id']}})['then'](handleEntityNotFound(_0x280640,null))[_0xec1f('0x24')](removeEntity(_0x280640,null))[_0xec1f('0x48')](handleError(_0x280640,null));};exports[_0xec1f('0x4e')]=function(_0x4fb6a8,_0x46bd1e){return db[_0xec1f('0x45')][_0xec1f('0x4e')]()[_0xec1f('0x24')](respondWithResult(_0x46bd1e,null))[_0xec1f('0x48')](handleError(_0x46bd1e,null));}; \ No newline at end of file +var _0xbb6b=['filter','merge','options','includeAll','include','findAll','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','SmsQueueReport','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where'];(function(_0x310fbc,_0x4b70de){var _0x4a8be0=function(_0x4fd5cb){while(--_0x4fd5cb){_0x310fbc['push'](_0x310fbc['shift']());}};_0x4a8be0(++_0x4b70de);}(_0xbb6b,0x135));var _0xbbb6=function(_0x5b7218,_0x51cb1f){_0x5b7218=_0x5b7218-0x0;var _0x424010=_0xbb6b[_0x5b7218];return _0x424010;};'use strict';var emlformat=require(_0xbbb6('0x0'));var rimraf=require(_0xbbb6('0x1'));var zipdir=require(_0xbbb6('0x2'));var jsonpatch=require(_0xbbb6('0x3'));var rp=require(_0xbbb6('0x4'));var moment=require(_0xbbb6('0x5'));var BPromise=require(_0xbbb6('0x6'));var Mustache=require('mustache');var util=require(_0xbbb6('0x7'));var path=require('path');var sox=require(_0xbbb6('0x8'));var csv=require(_0xbbb6('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbbb6('0xa'));var squel=require(_0xbbb6('0xb'));var crypto=require(_0xbbb6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbbb6('0xd'));var toCsv=require(_0xbbb6('0x9'));var querystring=require('querystring');var Papa=require(_0xbbb6('0xe'));var Redis=require('ioredis');var authService=require(_0xbbb6('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xbbb6('0x10'));var hardwareService=require(_0xbbb6('0x11'));var logger=require(_0xbbb6('0x12'))(_0xbbb6('0x13'));var utils=require(_0xbbb6('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xbbb6('0x15'));var db=require(_0xbbb6('0x16'))['db'];function respondWithStatusCode(_0x29c82e,_0xcd5e96){_0xcd5e96=_0xcd5e96||0xcc;return function(_0x398621){if(_0x398621){return _0x29c82e[_0xbbb6('0x17')](_0xcd5e96);}return _0x29c82e['status'](_0xcd5e96)[_0xbbb6('0x18')]();};}function respondWithResult(_0x564f59,_0x286c93){_0x286c93=_0x286c93||0xc8;return function(_0x3ae147){if(_0x3ae147){return _0x564f59[_0xbbb6('0x19')](_0x286c93)[_0xbbb6('0x1a')](_0x3ae147);}};}function respondWithFilteredResult(_0x442467,_0x3328e0){return function(_0x3a4597){if(_0x3a4597){var _0x1d5ef4=typeof _0x3328e0[_0xbbb6('0x1b')]===_0xbbb6('0x1c')&&typeof _0x3328e0[_0xbbb6('0x1d')]===_0xbbb6('0x1c');var _0x378878=_0x3a4597[_0xbbb6('0x1e')];var _0x5e250d=_0x1d5ef4?0x0:_0x3328e0['offset'];var _0x883155=_0x1d5ef4?_0x3a4597[_0xbbb6('0x1e')]:_0x3328e0[_0xbbb6('0x1b')]+_0x3328e0[_0xbbb6('0x1d')];var _0x3cb1a5;if(_0x883155>=_0x378878){_0x883155=_0x378878;_0x3cb1a5=0xc8;}else{_0x3cb1a5=0xce;}_0x442467[_0xbbb6('0x19')](_0x3cb1a5);return _0x442467[_0xbbb6('0x1f')](_0xbbb6('0x20'),_0x5e250d+'-'+_0x883155+'/'+_0x378878)[_0xbbb6('0x1a')](_0x3a4597);}return null;};}function patchUpdates(_0x54ede4){return function(_0x8127a3){try{jsonpatch[_0xbbb6('0x21')](_0x8127a3,_0x54ede4,!![]);}catch(_0x4aabea){return BPromise[_0xbbb6('0x22')](_0x4aabea);}return _0x8127a3[_0xbbb6('0x23')]();};}function saveUpdates(_0x3fb492,_0x401139){return function(_0x2549fe){if(_0x2549fe){return _0x2549fe[_0xbbb6('0x24')](_0x3fb492)[_0xbbb6('0x25')](function(_0x57c006){return _0x57c006;});}return null;};}function removeEntity(_0x40bb3f,_0x1fbbe7){return function(_0x434647){if(_0x434647){return _0x434647[_0xbbb6('0x26')]()[_0xbbb6('0x25')](function(){_0x40bb3f[_0xbbb6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdc50da,_0x11a34f){return function(_0x574196){if(!_0x574196){_0xdc50da[_0xbbb6('0x17')](0x194);}return _0x574196;};}function handleError(_0x1ccc9d,_0x5d17ab){_0x5d17ab=_0x5d17ab||0x1f4;return function(_0x265fe3){logger[_0xbbb6('0x27')](_0x265fe3[_0xbbb6('0x28')]);if(_0x265fe3[_0xbbb6('0x29')]){delete _0x265fe3['name'];}_0x1ccc9d['status'](_0x5d17ab)[_0xbbb6('0x2a')](_0x265fe3);};}exports[_0xbbb6('0x2b')]=function(_0x210ced,_0x25443b){var _0x2b3020={},_0x1b65c0={},_0x446391={'count':0x0,'rows':[]};var _0x32af2b=_['map'](db[_0xbbb6('0x2c')][_0xbbb6('0x2d')],function(_0x3d0955){return{'name':_0x3d0955[_0xbbb6('0x2e')],'type':_0x3d0955[_0xbbb6('0x2f')][_0xbbb6('0x30')]};});_0x1b65c0['model']=_[_0xbbb6('0x31')](_0x32af2b,_0xbbb6('0x29'));_0x1b65c0[_0xbbb6('0x32')]=_[_0xbbb6('0x33')](_0x210ced[_0xbbb6('0x32')]);_0x1b65c0[_0xbbb6('0x34')]=_[_0xbbb6('0x35')](_0x1b65c0[_0xbbb6('0x36')],_0x1b65c0[_0xbbb6('0x32')]);_0x2b3020[_0xbbb6('0x37')]=_[_0xbbb6('0x35')](_0x1b65c0['model'],qs[_0xbbb6('0x38')](_0x210ced['query'][_0xbbb6('0x38')]));_0x2b3020[_0xbbb6('0x37')]=_0x2b3020[_0xbbb6('0x37')][_0xbbb6('0x39')]?_0x2b3020[_0xbbb6('0x37')]:_0x1b65c0['model'];if(!_0x210ced[_0xbbb6('0x32')][_0xbbb6('0x3a')]('nolimit')){_0x2b3020['limit']=qs[_0xbbb6('0x1d')](_0x210ced[_0xbbb6('0x32')]['limit']);_0x2b3020['offset']=qs[_0xbbb6('0x1b')](_0x210ced[_0xbbb6('0x32')][_0xbbb6('0x1b')]);}_0x2b3020['order']=qs[_0xbbb6('0x3b')](_0x210ced[_0xbbb6('0x32')][_0xbbb6('0x3b')]);_0x2b3020[_0xbbb6('0x3c')]=qs[_0xbbb6('0x34')](_['pick'](_0x210ced['query'],_0x1b65c0[_0xbbb6('0x34')]),_0x32af2b);if(_0x210ced[_0xbbb6('0x32')][_0xbbb6('0x3d')]){_0x2b3020['where']=_[_0xbbb6('0x3e')](_0x2b3020[_0xbbb6('0x3c')],{'$or':_[_0xbbb6('0x31')](_0x32af2b,function(_0x5e33e3){if(_0x5e33e3[_0xbbb6('0x2f')]!=='VIRTUAL'){var _0x5d91db={};_0x5d91db[_0x5e33e3[_0xbbb6('0x29')]]={'$like':'%'+_0x210ced[_0xbbb6('0x32')][_0xbbb6('0x3d')]+'%'};return _0x5d91db;}})});}_0x2b3020=_[_0xbbb6('0x3e')]({},_0x2b3020,_0x210ced[_0xbbb6('0x3f')]);var _0x4e5018={'where':_0x2b3020[_0xbbb6('0x3c')]};return db[_0xbbb6('0x2c')][_0xbbb6('0x1e')](_0x4e5018)[_0xbbb6('0x25')](function(_0x59ad44){_0x446391['count']=_0x59ad44;if(_0x210ced[_0xbbb6('0x32')][_0xbbb6('0x40')]){_0x2b3020[_0xbbb6('0x41')]=[{'all':!![]}];}return db[_0xbbb6('0x2c')][_0xbbb6('0x42')](_0x2b3020);})[_0xbbb6('0x25')](function(_0x1712af){_0x446391['rows']=_0x1712af;return _0x446391;})[_0xbbb6('0x25')](respondWithFilteredResult(_0x25443b,_0x2b3020))[_0xbbb6('0x43')](handleError(_0x25443b,null));};exports[_0xbbb6('0x44')]=function(_0x47a98d,_0x44aa16){var _0x42975f={'raw':!![],'where':{'id':_0x47a98d[_0xbbb6('0x45')]['id']}},_0x22247b={};_0x22247b[_0xbbb6('0x36')]=_[_0xbbb6('0x33')](db[_0xbbb6('0x2c')][_0xbbb6('0x2d')]);_0x22247b['query']=_[_0xbbb6('0x33')](_0x47a98d['query']);_0x22247b['filters']=_['intersection'](_0x22247b[_0xbbb6('0x36')],_0x22247b['query']);_0x42975f[_0xbbb6('0x37')]=_['intersection'](_0x22247b[_0xbbb6('0x36')],qs['fields'](_0x47a98d['query']['fields']));_0x42975f['attributes']=_0x42975f[_0xbbb6('0x37')][_0xbbb6('0x39')]?_0x42975f[_0xbbb6('0x37')]:_0x22247b[_0xbbb6('0x36')];if(_0x47a98d[_0xbbb6('0x32')]['includeAll']){_0x42975f[_0xbbb6('0x41')]=[{'all':!![]}];}_0x42975f=_[_0xbbb6('0x3e')]({},_0x42975f,_0x47a98d[_0xbbb6('0x3f')]);return db[_0xbbb6('0x2c')]['find'](_0x42975f)[_0xbbb6('0x25')](handleEntityNotFound(_0x44aa16,null))[_0xbbb6('0x25')](respondWithResult(_0x44aa16,null))[_0xbbb6('0x43')](handleError(_0x44aa16,null));};exports['create']=function(_0x5b7092,_0x15de28){return db[_0xbbb6('0x2c')][_0xbbb6('0x46')](_0x5b7092[_0xbbb6('0x47')],{})[_0xbbb6('0x25')](respondWithResult(_0x15de28,0xc9))[_0xbbb6('0x43')](handleError(_0x15de28,null));};exports[_0xbbb6('0x24')]=function(_0x1eda2d,_0x1b16c7){if(_0x1eda2d[_0xbbb6('0x47')]['id']){delete _0x1eda2d[_0xbbb6('0x47')]['id'];}return db[_0xbbb6('0x2c')][_0xbbb6('0x48')]({'where':{'id':_0x1eda2d['params']['id']}})[_0xbbb6('0x25')](handleEntityNotFound(_0x1b16c7,null))[_0xbbb6('0x25')](saveUpdates(_0x1eda2d[_0xbbb6('0x47')],null))[_0xbbb6('0x25')](respondWithResult(_0x1b16c7,null))[_0xbbb6('0x43')](handleError(_0x1b16c7,null));};exports[_0xbbb6('0x26')]=function(_0x1b56ea,_0x3a6824){return db['SmsQueueReport'][_0xbbb6('0x48')]({'where':{'id':_0x1b56ea['params']['id']}})[_0xbbb6('0x25')](handleEntityNotFound(_0x3a6824,null))[_0xbbb6('0x25')](removeEntity(_0x3a6824,null))[_0xbbb6('0x43')](handleError(_0x3a6824,null));};exports[_0xbbb6('0x49')]=function(_0x2f22fb,_0x825802){return db[_0xbbb6('0x2c')][_0xbbb6('0x49')]()['then'](respondWithResult(_0x825802,null))['catch'](handleError(_0x825802,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 51f0b3f..2c5c36e 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid'];(function(_0xd1a252,_0x16396f){var _0x560ee1=function(_0x35dd90){while(--_0x35dd90){_0xd1a252['push'](_0xd1a252['shift']());}};_0x560ee1(++_0x16396f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue','uniqueid','lodash','util'];(function(_0xc7d92f,_0x2f2193){var _0x3a17ea=function(_0x4315de){while(--_0x4315de){_0xc7d92f['push'](_0xc7d92f['shift']());}};_0x3a17ea(++_0x2f2193);}(_0xe706,0xa3));var _0x6e70=function(_0x213969,_0x303344){_0x213969=_0x213969-0x0;var _0x5f4fca=_0xe706[_0x213969];return _0x5f4fca;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 9c356d3..8745539 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 _0x1ed8=['error','message','result','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','catch','UpdateSmsQueueReport','update','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2b3233,_0x40a866){var _0x16df0a=function(_0x45779a){while(--_0x45779a){_0x2b3233['push'](_0x2b3233['shift']());}};_0x16df0a(++_0x40a866);}(_0x1ed8,0x1d6));var _0x81ed=function(_0x4d7530,_0xdee31){_0x4d7530=_0x4d7530-0x0;var _0x1afc9e=_0x1ed8[_0x4d7530];return _0x1afc9e;};'use strict';var _=require('lodash');var util=require(_0x81ed('0x0'));var moment=require(_0x81ed('0x1'));var BPromise=require(_0x81ed('0x2'));var rs=require(_0x81ed('0x3'));var fs=require('fs');var Redis=require(_0x81ed('0x4'));var db=require(_0x81ed('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x81ed('0x6'))(_0x81ed('0x7'));var config=require(_0x81ed('0x8'));var jayson=require(_0x81ed('0x9'));var client=jayson[_0x81ed('0xa')][_0x81ed('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb42548,_0xa3a05d,_0x1ce72c){return new BPromise(function(_0x242001,_0x12c599){return client[_0x81ed('0xc')](_0xb42548,_0x1ce72c)[_0x81ed('0xd')](function(_0x5cf6f4){logger[_0x81ed('0xe')](_0x81ed('0xf'),_0xa3a05d,_0x81ed('0x10'));logger[_0x81ed('0x11')](_0x81ed('0x12'),_0xa3a05d,_0x81ed('0x10'),JSON[_0x81ed('0x13')](_0x5cf6f4));if(_0x5cf6f4['error']){if(_0x5cf6f4['error']['code']===0x1f4){logger[_0x81ed('0x14')](_0x81ed('0xf'),_0xa3a05d,_0x5cf6f4[_0x81ed('0x14')][_0x81ed('0x15')]);return _0x12c599(_0x5cf6f4[_0x81ed('0x14')]['message']);}logger[_0x81ed('0x14')]('SmsQueueReport,\x20%s,\x20%s',_0xa3a05d,_0x5cf6f4[_0x81ed('0x14')][_0x81ed('0x15')]);return _0x242001(_0x5cf6f4['error'][_0x81ed('0x15')]);}else{logger[_0x81ed('0xe')](_0x81ed('0xf'),_0xa3a05d,_0x81ed('0x10'));_0x242001(_0x5cf6f4[_0x81ed('0x16')][_0x81ed('0x15')]);}})['catch'](function(_0x6179a){logger[_0x81ed('0x14')](_0x81ed('0xf'),_0xa3a05d,_0x6179a);_0x12c599(_0x6179a);});});}exports[_0x81ed('0x17')]=function(_0x1f61a5){var _0x2e0995=this;return new Promise(function(_0x2610f8,_0x42c0fd){return db[_0x81ed('0x18')][_0x81ed('0x19')](_0x1f61a5[_0x81ed('0x1a')],{'raw':_0x1f61a5[_0x81ed('0x1b')]?_0x1f61a5[_0x81ed('0x1b')][_0x81ed('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0xa97c72){logger[_0x81ed('0xe')](_0x81ed('0x17'),_0x1f61a5);logger['debug'](_0x81ed('0x17'),_0x1f61a5,JSON['stringify'](_0xa97c72));_0x2610f8(_0xa97c72);})[_0x81ed('0x1d')](function(_0x29cf32){logger[_0x81ed('0x14')](_0x81ed('0x17'),_0x29cf32[_0x81ed('0x15')],_0x1f61a5);_0x42c0fd(_0x2e0995[_0x81ed('0x14')](0x1f4,_0x29cf32[_0x81ed('0x15')]));});});};exports[_0x81ed('0x1e')]=function(_0x23cc91){var _0x3f26bd=this;return new Promise(function(_0x2302d3,_0x294bef){return db[_0x81ed('0x18')][_0x81ed('0x1f')](_0x23cc91[_0x81ed('0x1a')],{'raw':_0x23cc91[_0x81ed('0x1b')]?_0x23cc91[_0x81ed('0x1b')][_0x81ed('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23cc91['options']?_0x23cc91[_0x81ed('0x1b')][_0x81ed('0x20')]||null:null,'attributes':_0x23cc91[_0x81ed('0x1b')]?_0x23cc91['options'][_0x81ed('0x21')]||null:null,'limit':_0x23cc91[_0x81ed('0x1b')]?_0x23cc91[_0x81ed('0x1b')][_0x81ed('0x22')]||null:null})['then'](function(_0xad7cd7){logger[_0x81ed('0xe')](_0x81ed('0x1e'),_0x23cc91);logger[_0x81ed('0x11')]('UpdateSmsQueueReport',_0x23cc91,JSON[_0x81ed('0x13')](_0xad7cd7));_0x2302d3(_0xad7cd7);})[_0x81ed('0x1d')](function(_0xd4ae0a){logger[_0x81ed('0x14')](_0x81ed('0x1e'),_0xd4ae0a['message'],_0x23cc91);_0x294bef(_0x3f26bd['error'](0x1f4,_0xd4ae0a['message']));});});}; \ No newline at end of file +var _0x822e=['util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','SmsQueueReport,\x20%s,\x20%s','message','info','result','catch','CreateSmsQueueReport','SmsQueueReport','create','options','raw','UpdateSmsQueueReport','body','where','attributes','lodash'];(function(_0x4753d7,_0x3d4f6d){var _0x3b8f0c=function(_0xb0c445){while(--_0xb0c445){_0x4753d7['push'](_0x4753d7['shift']());}};_0x3b8f0c(++_0x3d4f6d);}(_0x822e,0xbf));var _0xe822=function(_0x1aa1a2,_0x5118bc){_0x1aa1a2=_0x1aa1a2-0x0;var _0x185e8d=_0x822e[_0x1aa1a2];return _0x185e8d;};'use strict';var _=require(_0xe822('0x0'));var util=require(_0xe822('0x1'));var moment=require(_0xe822('0x2'));var BPromise=require('bluebird');var rs=require(_0xe822('0x3'));var fs=require('fs');var Redis=require(_0xe822('0x4'));var db=require(_0xe822('0x5'))['db'];var utils=require(_0xe822('0x6'));var logger=require('../../config/logger')(_0xe822('0x7'));var config=require('../../config/environment');var jayson=require(_0xe822('0x8'));var client=jayson[_0xe822('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x351f3b,_0xfe7a28,_0x4e5f19){return new BPromise(function(_0x43c759,_0x226c1c){return client[_0xe822('0xa')](_0x351f3b,_0x4e5f19)[_0xe822('0xb')](function(_0xe701d2){logger['info']('SmsQueueReport,\x20%s,\x20%s',_0xfe7a28,_0xe822('0xc'));logger[_0xe822('0xd')](_0xe822('0xe'),_0xfe7a28,_0xe822('0xc'),JSON[_0xe822('0xf')](_0xe701d2));if(_0xe701d2['error']){if(_0xe701d2['error'][_0xe822('0x10')]===0x1f4){logger[_0xe822('0x11')](_0xe822('0x12'),_0xfe7a28,_0xe701d2[_0xe822('0x11')][_0xe822('0x13')]);return _0x226c1c(_0xe701d2[_0xe822('0x11')][_0xe822('0x13')]);}logger['error'](_0xe822('0x12'),_0xfe7a28,_0xe701d2[_0xe822('0x11')][_0xe822('0x13')]);return _0x43c759(_0xe701d2[_0xe822('0x11')]['message']);}else{logger[_0xe822('0x14')](_0xe822('0x12'),_0xfe7a28,'request\x20sent');_0x43c759(_0xe701d2[_0xe822('0x15')][_0xe822('0x13')]);}})[_0xe822('0x16')](function(_0x1a9292){logger[_0xe822('0x11')](_0xe822('0x12'),_0xfe7a28,_0x1a9292);_0x226c1c(_0x1a9292);});});}exports[_0xe822('0x17')]=function(_0x47d595){var _0xcee313=this;return new Promise(function(_0x5d45e2,_0x288b38){return db[_0xe822('0x18')][_0xe822('0x19')](_0x47d595['body'],{'raw':_0x47d595['options']?_0x47d595[_0xe822('0x1a')][_0xe822('0x1b')]===undefined?!![]:![]:!![]})[_0xe822('0xb')](function(_0x19fa32){logger[_0xe822('0x14')](_0xe822('0x17'),_0x47d595);logger['debug'](_0xe822('0x17'),_0x47d595,JSON['stringify'](_0x19fa32));_0x5d45e2(_0x19fa32);})[_0xe822('0x16')](function(_0x4337fa){logger['error'](_0xe822('0x17'),_0x4337fa['message'],_0x47d595);_0x288b38(_0xcee313[_0xe822('0x11')](0x1f4,_0x4337fa['message']));});});};exports[_0xe822('0x1c')]=function(_0xfdb42f){var _0x57846b=this;return new Promise(function(_0x2ba542,_0x3a5437){return db[_0xe822('0x18')]['update'](_0xfdb42f[_0xe822('0x1d')],{'raw':_0xfdb42f[_0xe822('0x1a')]?_0xfdb42f[_0xe822('0x1a')][_0xe822('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfdb42f[_0xe822('0x1a')]?_0xfdb42f['options'][_0xe822('0x1e')]||null:null,'attributes':_0xfdb42f[_0xe822('0x1a')]?_0xfdb42f[_0xe822('0x1a')][_0xe822('0x1f')]||null:null,'limit':_0xfdb42f['options']?_0xfdb42f[_0xe822('0x1a')]['limit']||null:null})[_0xe822('0xb')](function(_0x346d53){logger[_0xe822('0x14')](_0xe822('0x1c'),_0xfdb42f);logger[_0xe822('0xd')]('UpdateSmsQueueReport',_0xfdb42f,JSON[_0xe822('0xf')](_0x346d53));_0x2ba542(_0x346d53);})[_0xe822('0x16')](function(_0x3941c9){logger[_0xe822('0x11')](_0xe822('0x1c'),_0x3941c9[_0xe822('0x13')],_0xfdb42f);_0x3a5437(_0x57846b['error'](0x1f4,_0x3941c9[_0xe822('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index c845d15..f65d744 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 _0x4f17=['put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','post','create'];(function(_0x429378,_0x2433e9){var _0x13cc16=function(_0x723b3){while(--_0x723b3){_0x429378['push'](_0x429378['shift']());}};_0x13cc16(++_0x2433e9);}(_0x4f17,0x9e));var _0x74f1=function(_0x4ee386,_0x1a9032){_0x4ee386=_0x4ee386-0x0;var _0x42450c=_0x4f17[_0x4ee386];return _0x42450c;};'use strict';var multer=require(_0x74f1('0x0'));var util=require('util');var path=require(_0x74f1('0x1'));var timeout=require(_0x74f1('0x2'));var express=require('express');var router=express[_0x74f1('0x3')]();var fs_extra=require(_0x74f1('0x4'));var auth=require(_0x74f1('0x5'));var interaction=require(_0x74f1('0x6'));var config=require(_0x74f1('0x7'));var controller=require('./smsTransferReport.controller');router['get']('/',auth[_0x74f1('0x8')](),controller['index']);router[_0x74f1('0x9')]('/describe',auth[_0x74f1('0x8')](),controller[_0x74f1('0xa')]);router[_0x74f1('0x9')]('/:id',auth[_0x74f1('0x8')](),controller['show']);router[_0x74f1('0xb')]('/',auth['isAuthenticated'](),controller[_0x74f1('0xc')]);router[_0x74f1('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x74f1('0xe')]);router[_0x74f1('0xf')](_0x74f1('0x10'),auth[_0x74f1('0x8')](),controller[_0x74f1('0x11')]);module[_0x74f1('0x12')]=router; \ No newline at end of file +var _0xf0ba=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','/describe','isAuthenticated','describe','show','post','create','/:id','update','destroy','exports','multer'];(function(_0x464fd5,_0x3ac1a9){var _0x2a75e1=function(_0xf41ad9){while(--_0xf41ad9){_0x464fd5['push'](_0x464fd5['shift']());}};_0x2a75e1(++_0x3ac1a9);}(_0xf0ba,0x1ed));var _0xaf0b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf0ba[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xaf0b('0x0'));var util=require(_0xaf0b('0x1'));var path=require(_0xaf0b('0x2'));var timeout=require(_0xaf0b('0x3'));var express=require(_0xaf0b('0x4'));var router=express['Router']();var fs_extra=require(_0xaf0b('0x5'));var auth=require(_0xaf0b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xaf0b('0x7'));var controller=require('./smsTransferReport.controller');router[_0xaf0b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xaf0b('0x8')](_0xaf0b('0x9'),auth[_0xaf0b('0xa')](),controller[_0xaf0b('0xb')]);router[_0xaf0b('0x8')]('/:id',auth[_0xaf0b('0xa')](),controller[_0xaf0b('0xc')]);router[_0xaf0b('0xd')]('/',auth['isAuthenticated'](),controller[_0xaf0b('0xe')]);router['put'](_0xaf0b('0xf'),auth[_0xaf0b('0xa')](),controller[_0xaf0b('0x10')]);router['delete'](_0xaf0b('0xf'),auth[_0xaf0b('0xa')](),controller[_0xaf0b('0x11')]);module[_0xaf0b('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 2172b29..5224455 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0xa6d9a8,_0x118f4c){var _0x410c24=function(_0x466fbe){while(--_0x466fbe){_0xa6d9a8['push'](_0xa6d9a8['shift']());}};_0x410c24(++_0x118f4c);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x1a89ca,_0x27394b){_0x1a89ca=_0x1a89ca-0x0;var _0x29cbb2=_0xf3cd[_0x1a89ca];return _0x29cbb2;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x57c4ff,_0x102e4e){var _0x21649c=function(_0x5a4fa9){while(--_0x5a4fa9){_0x57c4ff['push'](_0x57c4ff['shift']());}};_0x21649c(++_0x102e4e);}(_0x34e8,0x12c));var _0x834e=function(_0x28be56,_0x254350){_0x28be56=_0x28be56-0x0;var _0x67c369=_0x34e8[_0x28be56];return _0x67c369;};'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 diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index d3b3c0c..59c39e3 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 _0x544a=['count','apply','reject','then','destroy','sendStatus','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','catch','include','find','create','body','update','params','describe','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x544a,0x15b));var _0xa544=function(_0x589510,_0x13e0e5){_0x589510=_0x589510-0x0;var _0x38339d=_0x544a[_0x589510];return _0x38339d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa544('0x0'));var zipdir=require(_0xa544('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa544('0x2'));var moment=require(_0xa544('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa544('0x4'));var util=require(_0xa544('0x5'));var path=require(_0xa544('0x6'));var sox=require(_0xa544('0x7'));var csv=require(_0xa544('0x8'));var ejs=require(_0xa544('0x9'));var fs=require('fs');var fs_extra=require(_0xa544('0xa'));var _=require(_0xa544('0xb'));var squel=require(_0xa544('0xc'));var crypto=require(_0xa544('0xd'));var jsforce=require(_0xa544('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa544('0x8'));var querystring=require(_0xa544('0xf'));var Papa=require(_0xa544('0x10'));var Redis=require(_0xa544('0x11'));var authService=require(_0xa544('0x12'));var qs=require(_0xa544('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa544('0x14'));var logger=require(_0xa544('0x15'))(_0xa544('0x16'));var utils=require(_0xa544('0x17'));var config=require(_0xa544('0x18'));var licenseUtil=require(_0xa544('0x19'));var db=require(_0xa544('0x1a'))['db'];function respondWithStatusCode(_0x29e8f7,_0x4b4df0){_0x4b4df0=_0x4b4df0||0xcc;return function(_0x571ea0){if(_0x571ea0){return _0x29e8f7['sendStatus'](_0x4b4df0);}return _0x29e8f7[_0xa544('0x1b')](_0x4b4df0)[_0xa544('0x1c')]();};}function respondWithResult(_0x230283,_0x276bd6){_0x276bd6=_0x276bd6||0xc8;return function(_0x2c78dc){if(_0x2c78dc){return _0x230283[_0xa544('0x1b')](_0x276bd6)[_0xa544('0x1d')](_0x2c78dc);}};}function respondWithFilteredResult(_0x35b0c2,_0x281cdd){return function(_0x13614a){if(_0x13614a){var _0x4a2257=typeof _0x281cdd[_0xa544('0x1e')]===_0xa544('0x1f')&&typeof _0x281cdd[_0xa544('0x20')]==='undefined';var _0x4ad1a5=_0x13614a[_0xa544('0x21')];var _0x240394=_0x4a2257?0x0:_0x281cdd[_0xa544('0x1e')];var _0x5a4ea7=_0x4a2257?_0x13614a['count']:_0x281cdd['offset']+_0x281cdd[_0xa544('0x20')];var _0x506190;if(_0x5a4ea7>=_0x4ad1a5){_0x5a4ea7=_0x4ad1a5;_0x506190=0xc8;}else{_0x506190=0xce;}_0x35b0c2[_0xa544('0x1b')](_0x506190);return _0x35b0c2['set']('Content-Range',_0x240394+'-'+_0x5a4ea7+'/'+_0x4ad1a5)['json'](_0x13614a);}return null;};}function patchUpdates(_0x212d07){return function(_0xa99b0d){try{jsonpatch[_0xa544('0x22')](_0xa99b0d,_0x212d07,!![]);}catch(_0x584f7b){return BPromise[_0xa544('0x23')](_0x584f7b);}return _0xa99b0d['save']();};}function saveUpdates(_0x228596,_0x233297){return function(_0x4ed838){if(_0x4ed838){return _0x4ed838['update'](_0x228596)[_0xa544('0x24')](function(_0x492f78){return _0x492f78;});}return null;};}function removeEntity(_0x41f464,_0x3be184){return function(_0x1be567){if(_0x1be567){return _0x1be567[_0xa544('0x25')]()[_0xa544('0x24')](function(){_0x41f464['status'](0xcc)[_0xa544('0x1c')]();});}};}function handleEntityNotFound(_0x357abe,_0x1ca6a0){return function(_0xf73214){if(!_0xf73214){_0x357abe[_0xa544('0x26')](0x194);}return _0xf73214;};}function handleError(_0x2aabf5,_0x178c5a){_0x178c5a=_0x178c5a||0x1f4;return function(_0x4f99db){logger[_0xa544('0x27')](_0x4f99db[_0xa544('0x28')]);if(_0x4f99db[_0xa544('0x29')]){delete _0x4f99db['name'];}_0x2aabf5[_0xa544('0x1b')](_0x178c5a)[_0xa544('0x2a')](_0x4f99db);};}exports[_0xa544('0x2b')]=function(_0x1ead48,_0x42dde9){var _0x15cb3d={},_0x4288cd={},_0x229b96={'count':0x0,'rows':[]};var _0x57fa95=_[_0xa544('0x2c')](db[_0xa544('0x2d')][_0xa544('0x2e')],function(_0x282eaf){return{'name':_0x282eaf[_0xa544('0x2f')],'type':_0x282eaf[_0xa544('0x30')]['key']};});_0x4288cd['model']=_[_0xa544('0x2c')](_0x57fa95,_0xa544('0x29'));_0x4288cd[_0xa544('0x31')]=_[_0xa544('0x32')](_0x1ead48[_0xa544('0x31')]);_0x4288cd[_0xa544('0x33')]=_[_0xa544('0x34')](_0x4288cd[_0xa544('0x35')],_0x4288cd['query']);_0x15cb3d[_0xa544('0x36')]=_['intersection'](_0x4288cd[_0xa544('0x35')],qs['fields'](_0x1ead48['query'][_0xa544('0x37')]));_0x15cb3d[_0xa544('0x36')]=_0x15cb3d[_0xa544('0x36')][_0xa544('0x38')]?_0x15cb3d[_0xa544('0x36')]:_0x4288cd['model'];if(!_0x1ead48[_0xa544('0x31')]['hasOwnProperty'](_0xa544('0x39'))){_0x15cb3d[_0xa544('0x20')]=qs[_0xa544('0x20')](_0x1ead48['query'][_0xa544('0x20')]);_0x15cb3d[_0xa544('0x1e')]=qs[_0xa544('0x1e')](_0x1ead48[_0xa544('0x31')][_0xa544('0x1e')]);}_0x15cb3d[_0xa544('0x3a')]=qs[_0xa544('0x3b')](_0x1ead48[_0xa544('0x31')][_0xa544('0x3b')]);_0x15cb3d['where']=qs[_0xa544('0x33')](_[_0xa544('0x3c')](_0x1ead48[_0xa544('0x31')],_0x4288cd[_0xa544('0x33')]),_0x57fa95);if(_0x1ead48[_0xa544('0x31')][_0xa544('0x3d')]){_0x15cb3d[_0xa544('0x3e')]=_[_0xa544('0x3f')](_0x15cb3d[_0xa544('0x3e')],{'$or':_[_0xa544('0x2c')](_0x57fa95,function(_0x3641c7){if(_0x3641c7[_0xa544('0x30')]!=='VIRTUAL'){var _0x5e864e={};_0x5e864e[_0x3641c7[_0xa544('0x29')]]={'$like':'%'+_0x1ead48[_0xa544('0x31')][_0xa544('0x3d')]+'%'};return _0x5e864e;}})});}_0x15cb3d=_[_0xa544('0x3f')]({},_0x15cb3d,_0x1ead48[_0xa544('0x40')]);var _0x284162={'where':_0x15cb3d[_0xa544('0x3e')]};return db[_0xa544('0x2d')]['count'](_0x284162)['then'](function(_0x3a39b0){_0x229b96[_0xa544('0x21')]=_0x3a39b0;if(_0x1ead48['query'][_0xa544('0x41')]){_0x15cb3d['include']=[{'all':!![]}];}return db[_0xa544('0x2d')][_0xa544('0x42')](_0x15cb3d);})[_0xa544('0x24')](function(_0x4d860e){_0x229b96[_0xa544('0x43')]=_0x4d860e;return _0x229b96;})[_0xa544('0x24')](respondWithFilteredResult(_0x42dde9,_0x15cb3d))[_0xa544('0x44')](handleError(_0x42dde9,null));};exports['show']=function(_0x57b4f1,_0x587e9f){var _0x3d0432={'raw':!![],'where':{'id':_0x57b4f1['params']['id']}},_0x630c44={};_0x630c44[_0xa544('0x35')]=_['keys'](db[_0xa544('0x2d')][_0xa544('0x2e')]);_0x630c44[_0xa544('0x31')]=_[_0xa544('0x32')](_0x57b4f1[_0xa544('0x31')]);_0x630c44[_0xa544('0x33')]=_[_0xa544('0x34')](_0x630c44['model'],_0x630c44['query']);_0x3d0432[_0xa544('0x36')]=_[_0xa544('0x34')](_0x630c44['model'],qs[_0xa544('0x37')](_0x57b4f1['query'][_0xa544('0x37')]));_0x3d0432['attributes']=_0x3d0432[_0xa544('0x36')][_0xa544('0x38')]?_0x3d0432['attributes']:_0x630c44['model'];if(_0x57b4f1[_0xa544('0x31')]['includeAll']){_0x3d0432[_0xa544('0x45')]=[{'all':!![]}];}_0x3d0432=_[_0xa544('0x3f')]({},_0x3d0432,_0x57b4f1[_0xa544('0x40')]);return db[_0xa544('0x2d')][_0xa544('0x46')](_0x3d0432)[_0xa544('0x24')](handleEntityNotFound(_0x587e9f,null))[_0xa544('0x24')](respondWithResult(_0x587e9f,null))['catch'](handleError(_0x587e9f,null));};exports[_0xa544('0x47')]=function(_0x593abd,_0x501315){return db[_0xa544('0x2d')][_0xa544('0x47')](_0x593abd[_0xa544('0x48')],{})['then'](respondWithResult(_0x501315,0xc9))[_0xa544('0x44')](handleError(_0x501315,null));};exports[_0xa544('0x49')]=function(_0x3133d5,_0x307fa9){if(_0x3133d5[_0xa544('0x48')]['id']){delete _0x3133d5[_0xa544('0x48')]['id'];}return db[_0xa544('0x2d')][_0xa544('0x46')]({'where':{'id':_0x3133d5[_0xa544('0x4a')]['id']}})[_0xa544('0x24')](handleEntityNotFound(_0x307fa9,null))[_0xa544('0x24')](saveUpdates(_0x3133d5[_0xa544('0x48')],null))[_0xa544('0x24')](respondWithResult(_0x307fa9,null))['catch'](handleError(_0x307fa9,null));};exports[_0xa544('0x25')]=function(_0x1126d4,_0x515f9c){return db[_0xa544('0x2d')][_0xa544('0x46')]({'where':{'id':_0x1126d4[_0xa544('0x4a')]['id']}})[_0xa544('0x24')](handleEntityNotFound(_0x515f9c,null))[_0xa544('0x24')](removeEntity(_0x515f9c,null))[_0xa544('0x44')](handleError(_0x515f9c,null));};exports[_0xa544('0x4b')]=function(_0xfb9b4f,_0x2e4dff){return db[_0xa544('0x2d')]['describe']()[_0xa544('0x24')](respondWithResult(_0x2e4dff,null))['catch'](handleError(_0x2e4dff,null));}; \ No newline at end of file +var _0xc173=['catch','show','params','intersection','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../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','apply','reject','save','update','then','destroy','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','SmsTransferReport','includeAll','include','findAll'];(function(_0x14eb14,_0x46d205){var _0xef813a=function(_0x57459a){while(--_0x57459a){_0x14eb14['push'](_0x14eb14['shift']());}};_0xef813a(++_0x46d205);}(_0xc173,0x1be));var _0x3c17=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc173[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x3c17('0x0'));var rimraf=require(_0x3c17('0x1'));var zipdir=require(_0x3c17('0x2'));var jsonpatch=require(_0x3c17('0x3'));var rp=require('request-promise');var moment=require(_0x3c17('0x4'));var BPromise=require(_0x3c17('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3c17('0x6'));var csv=require(_0x3c17('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3c17('0x8'));var _=require(_0x3c17('0x9'));var squel=require(_0x3c17('0xa'));var crypto=require(_0x3c17('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3c17('0xc'));var toCsv=require(_0x3c17('0x7'));var querystring=require(_0x3c17('0xd'));var Papa=require(_0x3c17('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3c17('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3c17('0x10'));var logger=require(_0x3c17('0x11'))(_0x3c17('0x12'));var utils=require(_0x3c17('0x13'));var config=require(_0x3c17('0x14'));var licenseUtil=require(_0x3c17('0x15'));var db=require(_0x3c17('0x16'))['db'];function respondWithStatusCode(_0x11e30b,_0x2681e3){_0x2681e3=_0x2681e3||0xcc;return function(_0x1fa742){if(_0x1fa742){return _0x11e30b[_0x3c17('0x17')](_0x2681e3);}return _0x11e30b[_0x3c17('0x18')](_0x2681e3)[_0x3c17('0x19')]();};}function respondWithResult(_0x51dbbd,_0x4d3155){_0x4d3155=_0x4d3155||0xc8;return function(_0x90006){if(_0x90006){return _0x51dbbd['status'](_0x4d3155)[_0x3c17('0x1a')](_0x90006);}};}function respondWithFilteredResult(_0x3267c3,_0x44f2e4){return function(_0x4d3909){if(_0x4d3909){var _0x5b3711=typeof _0x44f2e4[_0x3c17('0x1b')]===_0x3c17('0x1c')&&typeof _0x44f2e4[_0x3c17('0x1d')]===_0x3c17('0x1c');var _0x502b04=_0x4d3909[_0x3c17('0x1e')];var _0x2cacae=_0x5b3711?0x0:_0x44f2e4['offset'];var _0x985124=_0x5b3711?_0x4d3909[_0x3c17('0x1e')]:_0x44f2e4[_0x3c17('0x1b')]+_0x44f2e4[_0x3c17('0x1d')];var _0x135275;if(_0x985124>=_0x502b04){_0x985124=_0x502b04;_0x135275=0xc8;}else{_0x135275=0xce;}_0x3267c3[_0x3c17('0x18')](_0x135275);return _0x3267c3[_0x3c17('0x1f')]('Content-Range',_0x2cacae+'-'+_0x985124+'/'+_0x502b04)[_0x3c17('0x1a')](_0x4d3909);}return null;};}function patchUpdates(_0x240478){return function(_0x401caf){try{jsonpatch[_0x3c17('0x20')](_0x401caf,_0x240478,!![]);}catch(_0x4d6858){return BPromise[_0x3c17('0x21')](_0x4d6858);}return _0x401caf[_0x3c17('0x22')]();};}function saveUpdates(_0x51994f,_0x5d2284){return function(_0x5056c3){if(_0x5056c3){return _0x5056c3[_0x3c17('0x23')](_0x51994f)[_0x3c17('0x24')](function(_0x264422){return _0x264422;});}return null;};}function removeEntity(_0x47a315,_0x22a641){return function(_0xb177f2){if(_0xb177f2){return _0xb177f2[_0x3c17('0x25')]()['then'](function(){_0x47a315[_0x3c17('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23afdb,_0x9fd59c){return function(_0x16eb8f){if(!_0x16eb8f){_0x23afdb[_0x3c17('0x17')](0x194);}return _0x16eb8f;};}function handleError(_0xb36428,_0x7a2a91){_0x7a2a91=_0x7a2a91||0x1f4;return function(_0x38d639){logger['error'](_0x38d639['stack']);if(_0x38d639[_0x3c17('0x26')]){delete _0x38d639['name'];}_0xb36428[_0x3c17('0x18')](_0x7a2a91)[_0x3c17('0x27')](_0x38d639);};}exports[_0x3c17('0x28')]=function(_0x500c3e,_0x327db4){var _0x497ac5={},_0x52a31c={},_0x1e7cd2={'count':0x0,'rows':[]};var _0x5dbeb6=_[_0x3c17('0x29')](db['SmsTransferReport'][_0x3c17('0x2a')],function(_0x308ebb){return{'name':_0x308ebb[_0x3c17('0x2b')],'type':_0x308ebb[_0x3c17('0x2c')][_0x3c17('0x2d')]};});_0x52a31c[_0x3c17('0x2e')]=_['map'](_0x5dbeb6,_0x3c17('0x26'));_0x52a31c[_0x3c17('0x2f')]=_[_0x3c17('0x30')](_0x500c3e[_0x3c17('0x2f')]);_0x52a31c[_0x3c17('0x31')]=_['intersection'](_0x52a31c[_0x3c17('0x2e')],_0x52a31c[_0x3c17('0x2f')]);_0x497ac5[_0x3c17('0x32')]=_['intersection'](_0x52a31c['model'],qs[_0x3c17('0x33')](_0x500c3e[_0x3c17('0x2f')][_0x3c17('0x33')]));_0x497ac5[_0x3c17('0x32')]=_0x497ac5[_0x3c17('0x32')][_0x3c17('0x34')]?_0x497ac5[_0x3c17('0x32')]:_0x52a31c[_0x3c17('0x2e')];if(!_0x500c3e[_0x3c17('0x2f')][_0x3c17('0x35')](_0x3c17('0x36'))){_0x497ac5[_0x3c17('0x1d')]=qs[_0x3c17('0x1d')](_0x500c3e[_0x3c17('0x2f')][_0x3c17('0x1d')]);_0x497ac5[_0x3c17('0x1b')]=qs['offset'](_0x500c3e[_0x3c17('0x2f')][_0x3c17('0x1b')]);}_0x497ac5['order']=qs[_0x3c17('0x37')](_0x500c3e[_0x3c17('0x2f')][_0x3c17('0x37')]);_0x497ac5[_0x3c17('0x38')]=qs[_0x3c17('0x31')](_[_0x3c17('0x39')](_0x500c3e['query'],_0x52a31c[_0x3c17('0x31')]),_0x5dbeb6);if(_0x500c3e[_0x3c17('0x2f')]['filter']){_0x497ac5['where']=_[_0x3c17('0x3a')](_0x497ac5['where'],{'$or':_['map'](_0x5dbeb6,function(_0x41e04d){if(_0x41e04d[_0x3c17('0x2c')]!==_0x3c17('0x3b')){var _0x3b23c5={};_0x3b23c5[_0x41e04d[_0x3c17('0x26')]]={'$like':'%'+_0x500c3e['query'][_0x3c17('0x3c')]+'%'};return _0x3b23c5;}})});}_0x497ac5=_[_0x3c17('0x3a')]({},_0x497ac5,_0x500c3e['options']);var _0x409311={'where':_0x497ac5['where']};return db[_0x3c17('0x3d')][_0x3c17('0x1e')](_0x409311)['then'](function(_0x4f0506){_0x1e7cd2[_0x3c17('0x1e')]=_0x4f0506;if(_0x500c3e[_0x3c17('0x2f')][_0x3c17('0x3e')]){_0x497ac5[_0x3c17('0x3f')]=[{'all':!![]}];}return db[_0x3c17('0x3d')][_0x3c17('0x40')](_0x497ac5);})['then'](function(_0x2c4100){_0x1e7cd2['rows']=_0x2c4100;return _0x1e7cd2;})[_0x3c17('0x24')](respondWithFilteredResult(_0x327db4,_0x497ac5))[_0x3c17('0x41')](handleError(_0x327db4,null));};exports[_0x3c17('0x42')]=function(_0x321a4f,_0x523ada){var _0x52fc84={'raw':!![],'where':{'id':_0x321a4f[_0x3c17('0x43')]['id']}},_0x4d09e1={};_0x4d09e1[_0x3c17('0x2e')]=_[_0x3c17('0x30')](db[_0x3c17('0x3d')][_0x3c17('0x2a')]);_0x4d09e1['query']=_[_0x3c17('0x30')](_0x321a4f[_0x3c17('0x2f')]);_0x4d09e1[_0x3c17('0x31')]=_['intersection'](_0x4d09e1['model'],_0x4d09e1['query']);_0x52fc84['attributes']=_[_0x3c17('0x44')](_0x4d09e1[_0x3c17('0x2e')],qs[_0x3c17('0x33')](_0x321a4f['query']['fields']));_0x52fc84[_0x3c17('0x32')]=_0x52fc84[_0x3c17('0x32')][_0x3c17('0x34')]?_0x52fc84[_0x3c17('0x32')]:_0x4d09e1[_0x3c17('0x2e')];if(_0x321a4f['query'][_0x3c17('0x3e')]){_0x52fc84[_0x3c17('0x3f')]=[{'all':!![]}];}_0x52fc84=_[_0x3c17('0x3a')]({},_0x52fc84,_0x321a4f['options']);return db['SmsTransferReport'][_0x3c17('0x45')](_0x52fc84)[_0x3c17('0x24')](handleEntityNotFound(_0x523ada,null))[_0x3c17('0x24')](respondWithResult(_0x523ada,null))['catch'](handleError(_0x523ada,null));};exports['create']=function(_0x515fac,_0x5b9aad){return db[_0x3c17('0x3d')][_0x3c17('0x46')](_0x515fac[_0x3c17('0x47')],{})['then'](respondWithResult(_0x5b9aad,0xc9))[_0x3c17('0x41')](handleError(_0x5b9aad,null));};exports['update']=function(_0x454b89,_0x3e557e){if(_0x454b89[_0x3c17('0x47')]['id']){delete _0x454b89[_0x3c17('0x47')]['id'];}return db[_0x3c17('0x3d')]['find']({'where':{'id':_0x454b89['params']['id']}})[_0x3c17('0x24')](handleEntityNotFound(_0x3e557e,null))[_0x3c17('0x24')](saveUpdates(_0x454b89[_0x3c17('0x47')],null))[_0x3c17('0x24')](respondWithResult(_0x3e557e,null))[_0x3c17('0x41')](handleError(_0x3e557e,null));};exports[_0x3c17('0x25')]=function(_0x1bebf1,_0x312676){return db[_0x3c17('0x3d')][_0x3c17('0x45')]({'where':{'id':_0x1bebf1['params']['id']}})[_0x3c17('0x24')](handleEntityNotFound(_0x312676,null))[_0x3c17('0x24')](removeEntity(_0x312676,null))[_0x3c17('0x41')](handleError(_0x312676,null));};exports[_0x3c17('0x48')]=function(_0x22b444,_0x3db97c){return db[_0x3c17('0x3d')][_0x3c17('0x48')]()[_0x3c17('0x24')](respondWithResult(_0x3db97c,null))['catch'](handleError(_0x3db97c,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 6973824..2236af2 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 _0x46df=['lodash','api','moment','bluebird','rimraf','define','report_sms_transfer','uniqueid'];(function(_0xfb0281,_0x3ff38b){var _0x408dd3=function(_0x5d8017){while(--_0x5d8017){_0xfb0281['push'](_0xfb0281['shift']());}};_0x408dd3(++_0x3ff38b);}(_0x46df,0x1e0));var _0xf46d=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x46df[_0x432682];return _0x463d05;};'use strict';var _=require(_0xf46d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf46d('0x1'));var moment=require(_0xf46d('0x2'));var BPromise=require(_0xf46d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf46d('0x4'));var config=require('../../config/environment');var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x53f537,_0x579510){return _0x53f537[_0xf46d('0x5')]('SmsTransferReport',attributes,{'tableName':_0xf46d('0x6'),'paranoid':![],'indexes':[{'name':_0xf46d('0x7'),'fields':[_0xf46d('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfd48=['util','../../config/logger','api','moment','bluebird','path','../../config/environment','./smsTransferReport.attributes','exports','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x4a2c3a,_0x318fc8){var _0x267e6d=function(_0x3b4688){while(--_0x3b4688){_0x4a2c3a['push'](_0x4a2c3a['shift']());}};_0x267e6d(++_0x318fc8);}(_0xfd48,0x168));var _0x8fd4=function(_0xaf1782,_0x2a26fd){_0xaf1782=_0xaf1782-0x0;var _0x3a3ca8=_0xfd48[_0xaf1782];return _0x3a3ca8;};'use strict';var _=require('lodash');var util=require(_0x8fd4('0x0'));var logger=require(_0x8fd4('0x1'))(_0x8fd4('0x2'));var moment=require(_0x8fd4('0x3'));var BPromise=require(_0x8fd4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8fd4('0x5'));var rimraf=require('rimraf');var config=require(_0x8fd4('0x6'));var attributes=require(_0x8fd4('0x7'));module[_0x8fd4('0x8')]=function(_0x2c480c,_0x282b61){return _0x2c480c['define'](_0x8fd4('0x9'),attributes,{'tableName':_0x8fd4('0xa'),'paranoid':![],'indexes':[{'name':_0x8fd4('0xb'),'fields':[_0x8fd4('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index bd1461a..bec8535 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 _0x0fc8=['catch','lodash','util','ioredis','../../mysqldb','rpc','jayson/promise','client','http','then','info','request\x20sent','stringify','error','code','SmsTransferReport,\x20%s,\x20%s','message','result'];(function(_0xdf8663,_0x4d0715){var _0x2ebaeb=function(_0x5d24c6){while(--_0x5d24c6){_0xdf8663['push'](_0xdf8663['shift']());}};_0x2ebaeb(++_0x4d0715);}(_0x0fc8,0x145));var _0x80fc=function(_0x5cf736,_0x73de61){_0x5cf736=_0x5cf736-0x0;var _0x42067e=_0x0fc8[_0x5cf736];return _0x42067e;};'use strict';var _=require(_0x80fc('0x0'));var util=require(_0x80fc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x80fc('0x2'));var db=require(_0x80fc('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x80fc('0x4'));var config=require('../../config/environment');var jayson=require(_0x80fc('0x5'));var client=jayson[_0x80fc('0x6')][_0x80fc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x116a2e,_0x1f64ab,_0x5cb645){return new BPromise(function(_0x14a3c4,_0x36e45f){return client['request'](_0x116a2e,_0x5cb645)[_0x80fc('0x8')](function(_0x43eb28){logger[_0x80fc('0x9')]('SmsTransferReport,\x20%s,\x20%s',_0x1f64ab,_0x80fc('0xa'));logger['debug']('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x1f64ab,_0x80fc('0xa'),JSON[_0x80fc('0xb')](_0x43eb28));if(_0x43eb28[_0x80fc('0xc')]){if(_0x43eb28[_0x80fc('0xc')][_0x80fc('0xd')]===0x1f4){logger[_0x80fc('0xc')](_0x80fc('0xe'),_0x1f64ab,_0x43eb28[_0x80fc('0xc')][_0x80fc('0xf')]);return _0x36e45f(_0x43eb28[_0x80fc('0xc')][_0x80fc('0xf')]);}logger[_0x80fc('0xc')](_0x80fc('0xe'),_0x1f64ab,_0x43eb28[_0x80fc('0xc')][_0x80fc('0xf')]);return _0x14a3c4(_0x43eb28[_0x80fc('0xc')][_0x80fc('0xf')]);}else{logger['info'](_0x80fc('0xe'),_0x1f64ab,'request\x20sent');_0x14a3c4(_0x43eb28[_0x80fc('0x10')][_0x80fc('0xf')]);}})[_0x80fc('0x11')](function(_0x5d105c){logger[_0x80fc('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x1f64ab,_0x5d105c);_0x36e45f(_0x5d105c);});});} \ No newline at end of file +var _0xf8b2=['code','SmsTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x4444e4,_0x5f1462){var _0x43a887=function(_0x266fdb){while(--_0x266fdb){_0x4444e4['push'](_0x4444e4['shift']());}};_0x43a887(++_0x5f1462);}(_0xf8b2,0x15e));var _0x2f8b=function(_0x40f3ed,_0x30a518){_0x40f3ed=_0x40f3ed-0x0;var _0x30fd3b=_0xf8b2[_0x40f3ed];return _0x30fd3b;};'use strict';var _=require(_0x2f8b('0x0'));var util=require(_0x2f8b('0x1'));var moment=require(_0x2f8b('0x2'));var BPromise=require(_0x2f8b('0x3'));var rs=require(_0x2f8b('0x4'));var fs=require('fs');var Redis=require(_0x2f8b('0x5'));var db=require(_0x2f8b('0x6'))['db'];var utils=require(_0x2f8b('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x2f8b('0x8'));var jayson=require(_0x2f8b('0x9'));var client=jayson[_0x2f8b('0xa')][_0x2f8b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b0511,_0x2cc1e9,_0x449c86){return new BPromise(function(_0x24bd39,_0x366bac){return client['request'](_0x3b0511,_0x449c86)[_0x2f8b('0xc')](function(_0xb352e8){logger[_0x2f8b('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x2cc1e9,_0x2f8b('0xe'));logger[_0x2f8b('0xf')](_0x2f8b('0x10'),_0x2cc1e9,'request\x20sent',JSON['stringify'](_0xb352e8));if(_0xb352e8[_0x2f8b('0x11')]){if(_0xb352e8[_0x2f8b('0x11')][_0x2f8b('0x12')]===0x1f4){logger[_0x2f8b('0x11')](_0x2f8b('0x13'),_0x2cc1e9,_0xb352e8['error'][_0x2f8b('0x14')]);return _0x366bac(_0xb352e8['error'][_0x2f8b('0x14')]);}logger[_0x2f8b('0x11')](_0x2f8b('0x13'),_0x2cc1e9,_0xb352e8[_0x2f8b('0x11')][_0x2f8b('0x14')]);return _0x24bd39(_0xb352e8[_0x2f8b('0x11')][_0x2f8b('0x14')]);}else{logger[_0x2f8b('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x2cc1e9,_0x2f8b('0xe'));_0x24bd39(_0xb352e8[_0x2f8b('0x15')][_0x2f8b('0x14')]);}})[_0x2f8b('0x16')](function(_0xa79a7){logger[_0x2f8b('0x11')](_0x2f8b('0x13'),_0x2cc1e9,_0xa79a7);_0x366bac(_0xa79a7);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index b89d77e..720896c 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 _0x9466=['index','/:id/download','download','diskStorage','join','root','originalname','format','%s-%s%s','basename','extname','post','single','file','put','/:id','delete','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated'];(function(_0x877f61,_0x5882fc){var _0x333e34=function(_0x20641c){while(--_0x20641c){_0x877f61['push'](_0x877f61['shift']());}};_0x333e34(++_0x5882fc);}(_0x9466,0x199));var _0x6946=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x9466[_0x82129b];return _0x2ae5dc;};'use strict';var multer=require(_0x6946('0x0'));var util=require(_0x6946('0x1'));var path=require('path');var timeout=require(_0x6946('0x2'));var express=require(_0x6946('0x3'));var router=express['Router']();var fs_extra=require(_0x6946('0x4'));var auth=require(_0x6946('0x5'));var interaction=require(_0x6946('0x6'));var config=require(_0x6946('0x7'));var controller=require(_0x6946('0x8'));router[_0x6946('0x9')]('/',auth[_0x6946('0xa')](),controller[_0x6946('0xb')]);router[_0x6946('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x6946('0x9')](_0x6946('0xc'),auth[_0x6946('0xa')](),controller[_0x6946('0xd')]);var upload=multer({'storage':multer[_0x6946('0xe')]({'destination':function(_0x292e2f,_0x3da11a,_0x1f4f9b){_0x1f4f9b(null,path[_0x6946('0xf')](config[_0x6946('0x10')],'server/files/sounds/original/'));},'filename':function(_0x41b427,_0x3bfcac,_0x1a4229){_0x3bfcac[_0x6946('0x11')]=_0x3bfcac['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1a4229(null,util[_0x6946('0x12')](_0x6946('0x13'),path[_0x6946('0x14')](_0x3bfcac[_0x6946('0x11')],path['extname'](_0x3bfcac['originalname'])),Date['now'](),path[_0x6946('0x15')](_0x3bfcac['originalname'])));}})});router[_0x6946('0x16')]('/',upload[_0x6946('0x17')](_0x6946('0x18')),controller['create']);router[_0x6946('0x19')](_0x6946('0x1a'),auth[_0x6946('0xa')](),controller['update']);router[_0x6946('0x1b')]('/:id',auth[_0x6946('0xa')](),controller[_0x6946('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x16c5=['root','server/files/sounds/original/','originalname','format','%s-%s%s','basename','extname','single','file','/:id','update','delete','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','index','get','show','/:id/download','download','diskStorage','join'];(function(_0x23a908,_0x55db8f){var _0x1f2961=function(_0x5c3549){while(--_0x5c3549){_0x23a908['push'](_0x23a908['shift']());}};_0x1f2961(++_0x55db8f);}(_0x16c5,0xec));var _0x516c=function(_0x9b9f97,_0x56e997){_0x9b9f97=_0x9b9f97-0x0;var _0x4a7d8c=_0x16c5[_0x9b9f97];return _0x4a7d8c;};'use strict';var multer=require(_0x516c('0x0'));var util=require('util');var path=require(_0x516c('0x1'));var timeout=require(_0x516c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x516c('0x3'));var auth=require(_0x516c('0x4'));var interaction=require(_0x516c('0x5'));var config=require(_0x516c('0x6'));var controller=require(_0x516c('0x7'));router['get']('/',auth[_0x516c('0x8')](),controller[_0x516c('0x9')]);router[_0x516c('0xa')]('/:id',auth[_0x516c('0x8')](),controller[_0x516c('0xb')]);router[_0x516c('0xa')](_0x516c('0xc'),auth[_0x516c('0x8')](),controller[_0x516c('0xd')]);var upload=multer({'storage':multer[_0x516c('0xe')]({'destination':function(_0x2523bf,_0x5436ee,_0x21a947){_0x21a947(null,path[_0x516c('0xf')](config[_0x516c('0x10')],_0x516c('0x11')));},'filename':function(_0x4df3b9,_0x7b8beb,_0x1e5f09){_0x7b8beb[_0x516c('0x12')]=_0x7b8beb[_0x516c('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1e5f09(null,util[_0x516c('0x13')](_0x516c('0x14'),path[_0x516c('0x15')](_0x7b8beb[_0x516c('0x12')],path['extname'](_0x7b8beb[_0x516c('0x12')])),Date['now'](),path[_0x516c('0x16')](_0x7b8beb[_0x516c('0x12')])));}})});router['post']('/',upload[_0x516c('0x17')](_0x516c('0x18')),controller['create']);router['put'](_0x516c('0x19'),auth[_0x516c('0x8')](),controller[_0x516c('0x1a')]);router[_0x516c('0x1b')](_0x516c('0x19'),auth[_0x516c('0x8')](),controller[_0x516c('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 9f74afd..ab83566 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 _0x8431=['STRING','INTEGER','BIGINT','exports'];(function(_0x51bfa7,_0x51c8e0){var _0x1cf7ae=function(_0x5e5625){while(--_0x5e5625){_0x51bfa7['push'](_0x51bfa7['shift']());}};_0x1cf7ae(++_0x51c8e0);}(_0x8431,0x1ef));var _0x1843=function(_0x541bf7,_0x2008b4){_0x541bf7=_0x541bf7-0x0;var _0x3f8d3d=_0x8431[_0x541bf7];return _0x3f8d3d;};'use strict';var Sequelize=require('sequelize');module[_0x1843('0x0')]={'name':{'type':Sequelize[_0x1843('0x1')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x1843('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x1843('0x1')]},'original_format':{'type':Sequelize[_0x1843('0x1')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x1843('0x2')]},'original_bitRate':{'type':Sequelize[_0x1843('0x3')]},'original_sampleRate':{'type':Sequelize[_0x1843('0x2')]},'converted_format':{'type':Sequelize[_0x1843('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x1843('0x3')]},'converted_channelCount':{'type':Sequelize[_0x1843('0x2')]},'converted_bitRate':{'type':Sequelize[_0x1843('0x3')]},'converted_sampleRate':{'type':Sequelize[_0x1843('0x2')]}}; \ No newline at end of file +var _0xbc49=['STRING','name','FLOAT','BIGINT','INTEGER','sequelize','exports'];(function(_0x38efe1,_0x34a883){var _0x44c9fb=function(_0x3cbfea){while(--_0x3cbfea){_0x38efe1['push'](_0x38efe1['shift']());}};_0x44c9fb(++_0x34a883);}(_0xbc49,0x186));var _0x9bc4=function(_0x565fed,_0xb85768){_0x565fed=_0x565fed-0x0;var _0x3e018f=_0xbc49[_0x565fed];return _0x3e018f;};'use strict';var Sequelize=require(_0x9bc4('0x0'));module[_0x9bc4('0x1')]={'name':{'type':Sequelize[_0x9bc4('0x2')],'unique':_0x9bc4('0x3'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x9bc4('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x9bc4('0x4')]},'original_sampleCount':{'type':Sequelize[_0x9bc4('0x5')]},'original_channelCount':{'type':Sequelize[_0x9bc4('0x6')]},'original_bitRate':{'type':Sequelize[_0x9bc4('0x5')]},'original_sampleRate':{'type':Sequelize[_0x9bc4('0x6')]},'converted_format':{'type':Sequelize[_0x9bc4('0x2')]},'converted_duration':{'type':Sequelize[_0x9bc4('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x9bc4('0x5')]},'converted_channelCount':{'type':Sequelize[_0x9bc4('0x6')]},'converted_bitRate':{'type':Sequelize[_0x9bc4('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x9bc4('0x6')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index aabeb99..9459da2 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 _0xa1c7=['path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','get','UserProfileResource','error','stack','name','index','Sound','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','download','params','save_name','converted_format','join','root','server/files/sounds/converted','Sequelize','ValidationError','format','%s.%s','create','basename','originalname','extname','file','filename','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','send','src','duration','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','Sounds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x185d52,_0x18909b){var _0x5292a1=function(_0x3ea6e7){while(--_0x3ea6e7){_0x185d52['push'](_0x185d52['shift']());}};_0x5292a1(++_0x18909b);}(_0xa1c7,0xec));var _0x7a1c=function(_0x32c27d,_0x404c34){_0x32c27d=_0x32c27d-0x0;var _0xe640d8=_0xa1c7[_0x32c27d];return _0xe640d8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7a1c('0x0'));var rp=require(_0x7a1c('0x1'));var moment=require(_0x7a1c('0x2'));var BPromise=require(_0x7a1c('0x3'));var Mustache=require(_0x7a1c('0x4'));var util=require(_0x7a1c('0x5'));var path=require(_0x7a1c('0x6'));var sox=require(_0x7a1c('0x7'));var csv=require(_0x7a1c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7a1c('0x9'));var _=require(_0x7a1c('0xa'));var squel=require('squel');var crypto=require(_0x7a1c('0xb'));var jsforce=require(_0x7a1c('0xc'));var deskjs=require(_0x7a1c('0xd'));var toCsv=require(_0x7a1c('0x8'));var querystring=require(_0x7a1c('0xe'));var Papa=require(_0x7a1c('0xf'));var Redis=require(_0x7a1c('0x10'));var authService=require(_0x7a1c('0x11'));var qs=require(_0x7a1c('0x12'));var as=require(_0x7a1c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7a1c('0x14'))(_0x7a1c('0x15'));var utils=require(_0x7a1c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7a1c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5aea68,_0x338225){_0x338225=_0x338225||0xcc;return function(_0x472519){if(_0x472519){return _0x5aea68[_0x7a1c('0x18')](_0x338225);}return _0x5aea68[_0x7a1c('0x19')](_0x338225)[_0x7a1c('0x1a')]();};}function respondWithResult(_0x49e419,_0x460ebc){_0x460ebc=_0x460ebc||0xc8;return function(_0x128858){if(_0x128858){return _0x49e419['status'](_0x460ebc)['json'](_0x128858);}};}function respondWithFilteredResult(_0x5e0cb7,_0x54379a){return function(_0x5da407){if(_0x5da407){var _0x1df54d=typeof _0x54379a[_0x7a1c('0x1b')]===_0x7a1c('0x1c')&&typeof _0x54379a[_0x7a1c('0x1d')]===_0x7a1c('0x1c');var _0x1eacf7=_0x5da407['count'];var _0x58231e=_0x1df54d?0x0:_0x54379a[_0x7a1c('0x1b')];var _0x864e7f=_0x1df54d?_0x5da407[_0x7a1c('0x1e')]:_0x54379a[_0x7a1c('0x1b')]+_0x54379a['limit'];var _0x2309ac;if(_0x864e7f>=_0x1eacf7){_0x864e7f=_0x1eacf7;_0x2309ac=0xc8;}else{_0x2309ac=0xce;}_0x5e0cb7[_0x7a1c('0x19')](_0x2309ac);return _0x5e0cb7[_0x7a1c('0x1f')](_0x7a1c('0x20'),_0x58231e+'-'+_0x864e7f+'/'+_0x1eacf7)['json'](_0x5da407);}return null;};}function patchUpdates(_0x24b332){return function(_0x11fcad){try{jsonpatch[_0x7a1c('0x21')](_0x11fcad,_0x24b332,!![]);}catch(_0x27462b){return BPromise['reject'](_0x27462b);}return _0x11fcad['save']();};}function saveUpdates(_0xc0f7c6,_0x1815ff){return function(_0x462b52){if(_0x462b52){return _0x462b52['update'](_0xc0f7c6)[_0x7a1c('0x22')](function(_0x52c308){return _0x52c308;});}return null;};}function removeEntity(_0x52585c,_0x5869dc){return function(_0x599a7c){if(_0x599a7c){return _0x599a7c[_0x7a1c('0x23')]()[_0x7a1c('0x22')](function(){var _0x2a3750=_0x599a7c[_0x7a1c('0x24')]({'plain':!![]});var _0x438c03='Sounds';return db[_0x7a1c('0x25')]['destroy']({'where':{'type':_0x438c03,'resourceId':_0x2a3750['id']}})['then'](function(){return _0x599a7c;});})[_0x7a1c('0x22')](function(){_0x52585c[_0x7a1c('0x19')](0xcc)[_0x7a1c('0x1a')]();});}};}function handleEntityNotFound(_0x3b5167,_0xb95ff9){return function(_0x21ad53){if(!_0x21ad53){_0x3b5167[_0x7a1c('0x18')](0x194);}return _0x21ad53;};}function handleError(_0x2f4506,_0x4153e6){_0x4153e6=_0x4153e6||0x1f4;return function(_0x57fae5){logger[_0x7a1c('0x26')](_0x57fae5[_0x7a1c('0x27')]);if(_0x57fae5[_0x7a1c('0x28')]){delete _0x57fae5[_0x7a1c('0x28')];}_0x2f4506[_0x7a1c('0x19')](_0x4153e6)['send'](_0x57fae5);};}exports[_0x7a1c('0x29')]=function(_0x2f49ea,_0x7346dc){var _0x30daa6={},_0x4994ab={},_0x648351={'count':0x0,'rows':[]};var _0x3f4376=_['map'](db[_0x7a1c('0x2a')]['rawAttributes'],function(_0x48b669){return{'name':_0x48b669['fieldName'],'type':_0x48b669['type'][_0x7a1c('0x2b')]};});_0x4994ab[_0x7a1c('0x2c')]=_[_0x7a1c('0x2d')](_0x3f4376,_0x7a1c('0x28'));_0x4994ab[_0x7a1c('0x2e')]=_[_0x7a1c('0x2f')](_0x2f49ea[_0x7a1c('0x2e')]);_0x4994ab['filters']=_[_0x7a1c('0x30')](_0x4994ab[_0x7a1c('0x2c')],_0x4994ab[_0x7a1c('0x2e')]);_0x30daa6[_0x7a1c('0x31')]=_[_0x7a1c('0x30')](_0x4994ab['model'],qs[_0x7a1c('0x32')](_0x2f49ea['query'][_0x7a1c('0x32')]));_0x30daa6[_0x7a1c('0x31')]=_0x30daa6['attributes']['length']?_0x30daa6[_0x7a1c('0x31')]:_0x4994ab[_0x7a1c('0x2c')];if(!_0x2f49ea[_0x7a1c('0x2e')][_0x7a1c('0x33')](_0x7a1c('0x34'))){_0x30daa6[_0x7a1c('0x1d')]=qs[_0x7a1c('0x1d')](_0x2f49ea[_0x7a1c('0x2e')][_0x7a1c('0x1d')]);_0x30daa6[_0x7a1c('0x1b')]=qs[_0x7a1c('0x1b')](_0x2f49ea[_0x7a1c('0x2e')][_0x7a1c('0x1b')]);}_0x30daa6[_0x7a1c('0x35')]=qs['sort'](_0x2f49ea[_0x7a1c('0x2e')][_0x7a1c('0x36')]);_0x30daa6[_0x7a1c('0x37')]=qs[_0x7a1c('0x38')](_[_0x7a1c('0x39')](_0x2f49ea[_0x7a1c('0x2e')],_0x4994ab['filters']),_0x3f4376);if(_0x2f49ea[_0x7a1c('0x2e')][_0x7a1c('0x3a')]){_0x30daa6['where']=_[_0x7a1c('0x3b')](_0x30daa6[_0x7a1c('0x37')],{'$or':_[_0x7a1c('0x2d')](_0x3f4376,function(_0xfd097){if(_0xfd097[_0x7a1c('0x3c')]!==_0x7a1c('0x3d')){var _0x35a14f={};_0x35a14f[_0xfd097[_0x7a1c('0x28')]]={'$like':'%'+_0x2f49ea[_0x7a1c('0x2e')]['filter']+'%'};return _0x35a14f;}})});}_0x30daa6=_[_0x7a1c('0x3b')]({},_0x30daa6,_0x2f49ea['options']);var _0x1bda73={'where':_0x30daa6[_0x7a1c('0x37')]};return db[_0x7a1c('0x2a')]['count'](_0x1bda73)[_0x7a1c('0x22')](function(_0x22709c){_0x648351[_0x7a1c('0x1e')]=_0x22709c;if(_0x2f49ea['query'][_0x7a1c('0x3e')]){_0x30daa6[_0x7a1c('0x3f')]=[{'all':!![]}];}return db[_0x7a1c('0x2a')][_0x7a1c('0x40')](_0x30daa6);})['then'](function(_0x431cd9){_0x648351[_0x7a1c('0x41')]=_0x431cd9;return _0x648351;})[_0x7a1c('0x22')](respondWithFilteredResult(_0x7346dc,_0x30daa6))[_0x7a1c('0x42')](handleError(_0x7346dc,null));};exports[_0x7a1c('0x43')]=function(_0x271735,_0x18b437){var _0x12ffa3={'raw':!![],'where':{'id':_0x271735['params']['id']}},_0x198a67={};_0x198a67[_0x7a1c('0x2c')]=_['keys'](db[_0x7a1c('0x2a')][_0x7a1c('0x44')]);_0x198a67[_0x7a1c('0x2e')]=_['keys'](_0x271735[_0x7a1c('0x2e')]);_0x198a67[_0x7a1c('0x38')]=_[_0x7a1c('0x30')](_0x198a67[_0x7a1c('0x2c')],_0x198a67[_0x7a1c('0x2e')]);_0x12ffa3['attributes']=_['intersection'](_0x198a67[_0x7a1c('0x2c')],qs[_0x7a1c('0x32')](_0x271735[_0x7a1c('0x2e')]['fields']));_0x12ffa3['attributes']=_0x12ffa3[_0x7a1c('0x31')]['length']?_0x12ffa3[_0x7a1c('0x31')]:_0x198a67[_0x7a1c('0x2c')];if(_0x271735[_0x7a1c('0x2e')][_0x7a1c('0x3e')]){_0x12ffa3[_0x7a1c('0x3f')]=[{'all':!![]}];}_0x12ffa3=_['merge']({},_0x12ffa3,_0x271735[_0x7a1c('0x45')]);return db[_0x7a1c('0x2a')][_0x7a1c('0x46')](_0x12ffa3)[_0x7a1c('0x22')](handleEntityNotFound(_0x18b437,null))[_0x7a1c('0x22')](respondWithResult(_0x18b437,null))[_0x7a1c('0x42')](handleError(_0x18b437,null));};exports[_0x7a1c('0x47')]=function(_0x2ecbb1,_0x3e8400,_0x3e2438){return db[_0x7a1c('0x2a')][_0x7a1c('0x46')]({'where':{'id':_0x2ecbb1[_0x7a1c('0x48')]['id']},'attributes':[_0x7a1c('0x28'),_0x7a1c('0x49'),_0x7a1c('0x4a')],'raw':!![]})[_0x7a1c('0x22')](handleEntityNotFound(_0x3e8400,null))['then'](function(_0x476ced){if(_0x476ced){if(!fs['existsSync'](path[_0x7a1c('0x4b')](config[_0x7a1c('0x4c')],_0x7a1c('0x4d'),_0x476ced['save_name']+'.'+_0x476ced[_0x7a1c('0x4a')]))){throw new db[(_0x7a1c('0x4e'))][(_0x7a1c('0x4f'))]('Sound\x20not\x20found');}return _0x3e8400[_0x7a1c('0x47')](path[_0x7a1c('0x4b')](config[_0x7a1c('0x4c')],_0x7a1c('0x4d'),util['format']('%s.%s',_0x476ced[_0x7a1c('0x49')],_0x476ced[_0x7a1c('0x4a')])),util[_0x7a1c('0x50')](_0x7a1c('0x51'),_0x476ced['name'],_0x476ced[_0x7a1c('0x4a')]));}return null;})[_0x7a1c('0x42')](handleError(_0x3e8400,null));};exports[_0x7a1c('0x52')]=function(_0x1bab92,_0x6f5728,_0x9e8a5){var _0x1373df={'name':path[_0x7a1c('0x53')](_0x1bab92['file'][_0x7a1c('0x54')],path[_0x7a1c('0x55')](_0x1bab92[_0x7a1c('0x56')]['originalname'])),'save_name':path[_0x7a1c('0x53')](_0x1bab92[_0x7a1c('0x56')][_0x7a1c('0x57')],path['extname'](_0x1bab92[_0x7a1c('0x56')][_0x7a1c('0x57')])),'original_format':path[_0x7a1c('0x55')](_0x1bab92[_0x7a1c('0x56')][_0x7a1c('0x54')])['substring'](0x1),'converted_format':_0x7a1c('0x58')};var _0x322d13=path[_0x7a1c('0x4b')](config[_0x7a1c('0x4c')],_0x7a1c('0x59'),_0x1bab92[_0x7a1c('0x56')][_0x7a1c('0x57')]);var _0x389f35=path[_0x7a1c('0x4b')](config['root'],_0x7a1c('0x4d'),util[_0x7a1c('0x50')]('%s.%s',path[_0x7a1c('0x53')](_0x1bab92[_0x7a1c('0x56')][_0x7a1c('0x57')],path[_0x7a1c('0x55')](_0x1bab92[_0x7a1c('0x56')][_0x7a1c('0x57')])),_0x1373df['converted_format']));logger[_0x7a1c('0x5a')](_0x7a1c('0x5b'),_0x322d13);logger[_0x7a1c('0x5a')](_0x7a1c('0x5c'),_0x389f35);try{fs[_0x7a1c('0x5d')](_0x322d13,parseInt(_0x7a1c('0x5e'),0x8));var _0x473943=sox[_0x7a1c('0x5f')](_0x322d13,_0x389f35,{'sampleRate':0x1f40,'format':_0x7a1c('0x58'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x473943['on'](_0x7a1c('0x26'),function(_0x3e419f){fs[_0x7a1c('0x60')](_0x322d13);_0x6f5728[_0x7a1c('0x19')](0x1f4)[_0x7a1c('0x61')](_0x3e419f);});_0x473943['on'](_0x7a1c('0x62'),function(_0x186cf1){_0x1373df['original_duration']=isNaN(_0x186cf1[_0x7a1c('0x63')])?null:_0x186cf1[_0x7a1c('0x63')]*0x3e8;_0x1373df[_0x7a1c('0x64')]=isNaN(_0x186cf1[_0x7a1c('0x65')])?null:_0x186cf1[_0x7a1c('0x65')];_0x1373df['original_channelCount']=isNaN(_0x186cf1['channelCount'])?null:_0x186cf1[_0x7a1c('0x66')];_0x1373df[_0x7a1c('0x67')]=isNaN(_0x186cf1['bitRate'])?null:_0x186cf1[_0x7a1c('0x68')];_0x1373df[_0x7a1c('0x69')]=isNaN(_0x186cf1[_0x7a1c('0x6a')])?null:_0x186cf1['sampleRate'];});_0x473943['on'](_0x7a1c('0x6b'),function(_0x1dd744){_0x1373df[_0x7a1c('0x6c')]=isNaN(_0x1dd744[_0x7a1c('0x63')])?null:_0x1dd744[_0x7a1c('0x63')]*0x3e8;_0x1373df['converted_sampleCount']=isNaN(_0x1dd744[_0x7a1c('0x65')])?null:_0x1dd744[_0x7a1c('0x65')];_0x1373df[_0x7a1c('0x6d')]=isNaN(_0x1dd744[_0x7a1c('0x66')])?null:_0x1dd744[_0x7a1c('0x66')];_0x1373df[_0x7a1c('0x6e')]=isNaN(_0x1dd744[_0x7a1c('0x68')])?null:_0x1dd744['bitRate'];_0x1373df[_0x7a1c('0x6f')]=isNaN(_0x1dd744['sampleRate'])?null:_0x1dd744[_0x7a1c('0x6a')];});_0x473943['on'](_0x7a1c('0x1a'),function(){fs['chmodSync'](_0x389f35,parseInt(_0x7a1c('0x5e'),0x8));return db[_0x7a1c('0x2a')][_0x7a1c('0x52')](_0x1373df)['then'](function(_0x2c347d){var _0x293ab2={'role':_0x1bab92[_0x7a1c('0x70')][_0x7a1c('0x71')],'userProfileId':_0x1bab92[_0x7a1c('0x70')][_0x7a1c('0x72')]};if(!_0x293ab2)throw new Error(_0x7a1c('0x73'));if(_0x293ab2[_0x7a1c('0x71')]==='user'){var _0x214998=_0x2c347d[_0x7a1c('0x24')]({'plain':!![]});return db['UserProfileSection'][_0x7a1c('0x46')]({'where':{'name':_0x7a1c('0x74'),'userProfileId':_0x293ab2[_0x7a1c('0x72')]},'raw':!![]})[_0x7a1c('0x22')](function(_0x33bbf9){if(_0x33bbf9&&_0x33bbf9[_0x7a1c('0x75')]===0x0){return db[_0x7a1c('0x25')][_0x7a1c('0x52')]({'name':_0x214998[_0x7a1c('0x28')],'resourceId':_0x214998['id'],'type':_0x33bbf9[_0x7a1c('0x28')],'sectionId':_0x33bbf9['id']},{})[_0x7a1c('0x22')](function(){return _0x2c347d;});}else{return _0x2c347d;}})[_0x7a1c('0x42')](function(_0x139e71){logger[_0x7a1c('0x26')](_0x7a1c('0x76'),_0x139e71);throw _0x139e71;});}return _0x2c347d;})[_0x7a1c('0x22')](respondWithResult(_0x6f5728,null))[_0x7a1c('0x42')](handleError(_0x6f5728,null));});_0x473943[_0x7a1c('0x77')]();}catch(_0xeed3d4){_0x6f5728[_0x7a1c('0x19')](0x1f4)[_0x7a1c('0x61')](_0xeed3d4);}};exports['update']=function(_0x242b71,_0x3bacf7,_0x151a1a){return db['Sound']['find']({'where':{'id':_0x242b71['params']['id']}})[_0x7a1c('0x22')](handleEntityNotFound(_0x3bacf7,null))[_0x7a1c('0x22')](saveUpdates(_[_0x7a1c('0x39')](_0x242b71[_0x7a1c('0x70')],[_0x7a1c('0x28'),_0x7a1c('0x78')]),null))[_0x7a1c('0x22')](respondWithResult(_0x3bacf7,null))[_0x7a1c('0x42')](handleError(_0x3bacf7,null));};exports['delete']=function(_0x3f0d95,_0x48d3ff,_0x46eb95){return db[_0x7a1c('0x2a')]['find']({'where':{'id':_0x3f0d95[_0x7a1c('0x48')]['id']}})[_0x7a1c('0x22')](function(_0x445e52){if(_0x445e52){return _0x445e52['destroy']();}})[_0x7a1c('0x22')](function(_0x48f13f){var _0x435847=path[_0x7a1c('0x4b')](config['root'],_0x7a1c('0x59'),util[_0x7a1c('0x50')]('%s.%s',_0x48f13f['save_name'],_0x48f13f['original_format']));var _0x18ee62=path['join'](config['root'],_0x7a1c('0x4d'),util[_0x7a1c('0x50')](_0x7a1c('0x51'),_0x48f13f[_0x7a1c('0x49')],_0x48f13f[_0x7a1c('0x4a')]));fs[_0x7a1c('0x60')](_0x435847);fs[_0x7a1c('0x60')](_0x18ee62);return _0x48f13f;})[_0x7a1c('0x22')](function(_0x1aa3f4){if(_0x1aa3f4){return _0x48d3ff[_0x7a1c('0x19')](0xcc)['end']();}})[_0x7a1c('0x22')](handleEntityNotFound(_0x48d3ff,null))[_0x7a1c('0x42')](handleError(_0x48d3ff,null));}; \ No newline at end of file +var _0x69de=['attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filters','filter','VIRTUAL','merge','options','where','includeAll','findAll','rows','params','rawAttributes','length','find','download','save_name','existsSync','join','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','%s.%s','format','catch','create','basename','originalname','file','filename','extname','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','pick','description','delete','original_format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','Sounds','UserProfileResource','error','stack','name','send','index','map','Sound','type','key','model','query','keys'];(function(_0x1dcd9d,_0x3a10aa){var _0x46d822=function(_0x4f19cb){while(--_0x4f19cb){_0x1dcd9d['push'](_0x1dcd9d['shift']());}};_0x46d822(++_0x3a10aa);}(_0x69de,0xca));var _0xe69d=function(_0x16de68,_0x33d7ff){_0x16de68=_0x16de68-0x0;var _0x1c277e=_0x69de[_0x16de68];return _0x1c277e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe69d('0x0'));var zipdir=require(_0xe69d('0x1'));var jsonpatch=require(_0xe69d('0x2'));var rp=require(_0xe69d('0x3'));var moment=require(_0xe69d('0x4'));var BPromise=require(_0xe69d('0x5'));var Mustache=require(_0xe69d('0x6'));var util=require(_0xe69d('0x7'));var path=require(_0xe69d('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe69d('0x9'));var fs=require('fs');var fs_extra=require(_0xe69d('0xa'));var _=require(_0xe69d('0xb'));var squel=require('squel');var crypto=require(_0xe69d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe69d('0xd'));var toCsv=require(_0xe69d('0xe'));var querystring=require(_0xe69d('0xf'));var Papa=require('papaparse');var Redis=require(_0xe69d('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe69d('0x11'));var hardwareService=require(_0xe69d('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xe69d('0x13'));var licenseUtil=require(_0xe69d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1da99c,_0x3c8108){_0x3c8108=_0x3c8108||0xcc;return function(_0x67bf88){if(_0x67bf88){return _0x1da99c[_0xe69d('0x15')](_0x3c8108);}return _0x1da99c['status'](_0x3c8108)[_0xe69d('0x16')]();};}function respondWithResult(_0x4fa763,_0x3419e4){_0x3419e4=_0x3419e4||0xc8;return function(_0xcad41a){if(_0xcad41a){return _0x4fa763[_0xe69d('0x17')](_0x3419e4)[_0xe69d('0x18')](_0xcad41a);}};}function respondWithFilteredResult(_0x5aa6bd,_0x77c74){return function(_0x5bb491){if(_0x5bb491){var _0x3cf12a=typeof _0x77c74[_0xe69d('0x19')]===_0xe69d('0x1a')&&typeof _0x77c74['limit']==='undefined';var _0x3b41d4=_0x5bb491[_0xe69d('0x1b')];var _0x271c5f=_0x3cf12a?0x0:_0x77c74[_0xe69d('0x19')];var _0x13f17d=_0x3cf12a?_0x5bb491['count']:_0x77c74[_0xe69d('0x19')]+_0x77c74[_0xe69d('0x1c')];var _0x3308b1;if(_0x13f17d>=_0x3b41d4){_0x13f17d=_0x3b41d4;_0x3308b1=0xc8;}else{_0x3308b1=0xce;}_0x5aa6bd['status'](_0x3308b1);return _0x5aa6bd[_0xe69d('0x1d')](_0xe69d('0x1e'),_0x271c5f+'-'+_0x13f17d+'/'+_0x3b41d4)['json'](_0x5bb491);}return null;};}function patchUpdates(_0x24b528){return function(_0x1f186c){try{jsonpatch[_0xe69d('0x1f')](_0x1f186c,_0x24b528,!![]);}catch(_0x285f5a){return BPromise[_0xe69d('0x20')](_0x285f5a);}return _0x1f186c[_0xe69d('0x21')]();};}function saveUpdates(_0x41c717,_0x2f2be7){return function(_0x57f549){if(_0x57f549){return _0x57f549['update'](_0x41c717)[_0xe69d('0x22')](function(_0x2c1a0f){return _0x2c1a0f;});}return null;};}function removeEntity(_0x3540ea,_0x12e993){return function(_0x280090){if(_0x280090){return _0x280090[_0xe69d('0x23')]()[_0xe69d('0x22')](function(){var _0x2b5866=_0x280090['get']({'plain':!![]});var _0x5258ca=_0xe69d('0x24');return db[_0xe69d('0x25')][_0xe69d('0x23')]({'where':{'type':_0x5258ca,'resourceId':_0x2b5866['id']}})['then'](function(){return _0x280090;});})[_0xe69d('0x22')](function(){_0x3540ea[_0xe69d('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x494d3c,_0x34feb6){return function(_0x2f4c8d){if(!_0x2f4c8d){_0x494d3c['sendStatus'](0x194);}return _0x2f4c8d;};}function handleError(_0x3af299,_0x5dc9e2){_0x5dc9e2=_0x5dc9e2||0x1f4;return function(_0xfd1c1c){logger[_0xe69d('0x26')](_0xfd1c1c[_0xe69d('0x27')]);if(_0xfd1c1c[_0xe69d('0x28')]){delete _0xfd1c1c[_0xe69d('0x28')];}_0x3af299['status'](_0x5dc9e2)[_0xe69d('0x29')](_0xfd1c1c);};}exports[_0xe69d('0x2a')]=function(_0x3e435b,_0x5b59da){var _0x35ed33={},_0x2c434f={},_0x220aa5={'count':0x0,'rows':[]};var _0x40e154=_[_0xe69d('0x2b')](db[_0xe69d('0x2c')]['rawAttributes'],function(_0x5891e3){return{'name':_0x5891e3['fieldName'],'type':_0x5891e3[_0xe69d('0x2d')][_0xe69d('0x2e')]};});_0x2c434f[_0xe69d('0x2f')]=_[_0xe69d('0x2b')](_0x40e154,_0xe69d('0x28'));_0x2c434f[_0xe69d('0x30')]=_[_0xe69d('0x31')](_0x3e435b['query']);_0x2c434f['filters']=_['intersection'](_0x2c434f[_0xe69d('0x2f')],_0x2c434f[_0xe69d('0x30')]);_0x35ed33[_0xe69d('0x32')]=_[_0xe69d('0x33')](_0x2c434f[_0xe69d('0x2f')],qs[_0xe69d('0x34')](_0x3e435b[_0xe69d('0x30')]['fields']));_0x35ed33['attributes']=_0x35ed33[_0xe69d('0x32')]['length']?_0x35ed33[_0xe69d('0x32')]:_0x2c434f[_0xe69d('0x2f')];if(!_0x3e435b[_0xe69d('0x30')][_0xe69d('0x35')](_0xe69d('0x36'))){_0x35ed33[_0xe69d('0x1c')]=qs[_0xe69d('0x1c')](_0x3e435b[_0xe69d('0x30')]['limit']);_0x35ed33[_0xe69d('0x19')]=qs['offset'](_0x3e435b['query'][_0xe69d('0x19')]);}_0x35ed33[_0xe69d('0x37')]=qs[_0xe69d('0x38')](_0x3e435b[_0xe69d('0x30')]['sort']);_0x35ed33['where']=qs['filters'](_['pick'](_0x3e435b[_0xe69d('0x30')],_0x2c434f[_0xe69d('0x39')]),_0x40e154);if(_0x3e435b[_0xe69d('0x30')][_0xe69d('0x3a')]){_0x35ed33['where']=_['merge'](_0x35ed33['where'],{'$or':_[_0xe69d('0x2b')](_0x40e154,function(_0x4ebbce){if(_0x4ebbce[_0xe69d('0x2d')]!==_0xe69d('0x3b')){var _0x4803a0={};_0x4803a0[_0x4ebbce['name']]={'$like':'%'+_0x3e435b[_0xe69d('0x30')][_0xe69d('0x3a')]+'%'};return _0x4803a0;}})});}_0x35ed33=_[_0xe69d('0x3c')]({},_0x35ed33,_0x3e435b[_0xe69d('0x3d')]);var _0x27c706={'where':_0x35ed33[_0xe69d('0x3e')]};return db[_0xe69d('0x2c')][_0xe69d('0x1b')](_0x27c706)[_0xe69d('0x22')](function(_0x3168f4){_0x220aa5['count']=_0x3168f4;if(_0x3e435b[_0xe69d('0x30')][_0xe69d('0x3f')]){_0x35ed33['include']=[{'all':!![]}];}return db[_0xe69d('0x2c')][_0xe69d('0x40')](_0x35ed33);})['then'](function(_0x418256){_0x220aa5[_0xe69d('0x41')]=_0x418256;return _0x220aa5;})[_0xe69d('0x22')](respondWithFilteredResult(_0x5b59da,_0x35ed33))['catch'](handleError(_0x5b59da,null));};exports['show']=function(_0x2ee1f3,_0x3de3a6){var _0x53d954={'raw':!![],'where':{'id':_0x2ee1f3[_0xe69d('0x42')]['id']}},_0x3e0207={};_0x3e0207[_0xe69d('0x2f')]=_[_0xe69d('0x31')](db[_0xe69d('0x2c')][_0xe69d('0x43')]);_0x3e0207['query']=_[_0xe69d('0x31')](_0x2ee1f3['query']);_0x3e0207[_0xe69d('0x39')]=_[_0xe69d('0x33')](_0x3e0207[_0xe69d('0x2f')],_0x3e0207['query']);_0x53d954[_0xe69d('0x32')]=_['intersection'](_0x3e0207['model'],qs[_0xe69d('0x34')](_0x2ee1f3[_0xe69d('0x30')][_0xe69d('0x34')]));_0x53d954[_0xe69d('0x32')]=_0x53d954[_0xe69d('0x32')][_0xe69d('0x44')]?_0x53d954[_0xe69d('0x32')]:_0x3e0207[_0xe69d('0x2f')];if(_0x2ee1f3[_0xe69d('0x30')][_0xe69d('0x3f')]){_0x53d954['include']=[{'all':!![]}];}_0x53d954=_[_0xe69d('0x3c')]({},_0x53d954,_0x2ee1f3['options']);return db[_0xe69d('0x2c')][_0xe69d('0x45')](_0x53d954)[_0xe69d('0x22')](handleEntityNotFound(_0x3de3a6,null))[_0xe69d('0x22')](respondWithResult(_0x3de3a6,null))['catch'](handleError(_0x3de3a6,null));};exports[_0xe69d('0x46')]=function(_0x497521,_0x6a6590,_0x1b0b95){return db[_0xe69d('0x2c')][_0xe69d('0x45')]({'where':{'id':_0x497521['params']['id']},'attributes':[_0xe69d('0x28'),_0xe69d('0x47'),'converted_format'],'raw':!![]})[_0xe69d('0x22')](handleEntityNotFound(_0x6a6590,null))[_0xe69d('0x22')](function(_0x15c068){if(_0x15c068){if(!fs[_0xe69d('0x48')](path[_0xe69d('0x49')](config[_0xe69d('0x4a')],_0xe69d('0x4b'),_0x15c068[_0xe69d('0x47')]+'.'+_0x15c068[_0xe69d('0x4c')]))){throw new db[(_0xe69d('0x4d'))][(_0xe69d('0x4e'))](_0xe69d('0x4f'));}return _0x6a6590[_0xe69d('0x46')](path[_0xe69d('0x49')](config['root'],'server/files/sounds/converted',util['format'](_0xe69d('0x50'),_0x15c068[_0xe69d('0x47')],_0x15c068['converted_format'])),util[_0xe69d('0x51')](_0xe69d('0x50'),_0x15c068[_0xe69d('0x28')],_0x15c068[_0xe69d('0x4c')]));}return null;})[_0xe69d('0x52')](handleError(_0x6a6590,null));};exports[_0xe69d('0x53')]=function(_0x229422,_0x5a8551,_0x278c89){var _0x37e4b0={'name':path[_0xe69d('0x54')](_0x229422['file'][_0xe69d('0x55')],path['extname'](_0x229422[_0xe69d('0x56')][_0xe69d('0x55')])),'save_name':path[_0xe69d('0x54')](_0x229422[_0xe69d('0x56')][_0xe69d('0x57')],path[_0xe69d('0x58')](_0x229422[_0xe69d('0x56')][_0xe69d('0x57')])),'original_format':path[_0xe69d('0x58')](_0x229422[_0xe69d('0x56')][_0xe69d('0x55')])['substring'](0x1),'converted_format':'wav'};var _0x831362=path['join'](config['root'],_0xe69d('0x59'),_0x229422[_0xe69d('0x56')][_0xe69d('0x57')]);var _0x58bfe6=path[_0xe69d('0x49')](config[_0xe69d('0x4a')],'server/files/sounds/converted',util[_0xe69d('0x51')]('%s.%s',path[_0xe69d('0x54')](_0x229422[_0xe69d('0x56')][_0xe69d('0x57')],path['extname'](_0x229422[_0xe69d('0x56')][_0xe69d('0x57')])),_0x37e4b0[_0xe69d('0x4c')]));logger['info'](_0xe69d('0x5a'),_0x831362);logger['info'](_0xe69d('0x5b'),_0x58bfe6);try{fs[_0xe69d('0x5c')](_0x831362,parseInt(_0xe69d('0x5d'),0x8));var _0x31fcd3=sox[_0xe69d('0x5e')](_0x831362,_0x58bfe6,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x31fcd3['on']('error',function(_0x2d0b42){fs[_0xe69d('0x5f')](_0x831362);_0x5a8551['status'](0x1f4)[_0xe69d('0x29')](_0x2d0b42);});_0x31fcd3['on'](_0xe69d('0x60'),function(_0x55726c){_0x37e4b0[_0xe69d('0x61')]=isNaN(_0x55726c[_0xe69d('0x62')])?null:_0x55726c['duration']*0x3e8;_0x37e4b0[_0xe69d('0x63')]=isNaN(_0x55726c[_0xe69d('0x64')])?null:_0x55726c[_0xe69d('0x64')];_0x37e4b0[_0xe69d('0x65')]=isNaN(_0x55726c[_0xe69d('0x66')])?null:_0x55726c['channelCount'];_0x37e4b0[_0xe69d('0x67')]=isNaN(_0x55726c[_0xe69d('0x68')])?null:_0x55726c[_0xe69d('0x68')];_0x37e4b0[_0xe69d('0x69')]=isNaN(_0x55726c[_0xe69d('0x6a')])?null:_0x55726c['sampleRate'];});_0x31fcd3['on'](_0xe69d('0x6b'),function(_0x149fac){_0x37e4b0[_0xe69d('0x6c')]=isNaN(_0x149fac['duration'])?null:_0x149fac[_0xe69d('0x62')]*0x3e8;_0x37e4b0[_0xe69d('0x6d')]=isNaN(_0x149fac['sampleCount'])?null:_0x149fac[_0xe69d('0x64')];_0x37e4b0[_0xe69d('0x6e')]=isNaN(_0x149fac[_0xe69d('0x66')])?null:_0x149fac[_0xe69d('0x66')];_0x37e4b0[_0xe69d('0x6f')]=isNaN(_0x149fac[_0xe69d('0x68')])?null:_0x149fac[_0xe69d('0x68')];_0x37e4b0[_0xe69d('0x70')]=isNaN(_0x149fac[_0xe69d('0x6a')])?null:_0x149fac[_0xe69d('0x6a')];});_0x31fcd3['on'](_0xe69d('0x16'),function(){fs[_0xe69d('0x5c')](_0x58bfe6,parseInt(_0xe69d('0x5d'),0x8));return db[_0xe69d('0x2c')]['create'](_0x37e4b0)[_0xe69d('0x22')](function(_0x53fc5c){var _0x13b354={'role':_0x229422[_0xe69d('0x71')][_0xe69d('0x72')],'userProfileId':_0x229422[_0xe69d('0x71')]['userProfileId']};if(!_0x13b354)throw new Error(_0xe69d('0x73'));if(_0x13b354[_0xe69d('0x72')]===_0xe69d('0x74')){var _0x46e0a7=_0x53fc5c[_0xe69d('0x75')]({'plain':!![]});return db[_0xe69d('0x76')][_0xe69d('0x45')]({'where':{'name':_0xe69d('0x24'),'userProfileId':_0x13b354[_0xe69d('0x77')]},'raw':!![]})['then'](function(_0x37562c){if(_0x37562c&&_0x37562c[_0xe69d('0x78')]===0x0){return db['UserProfileResource'][_0xe69d('0x53')]({'name':_0x46e0a7[_0xe69d('0x28')],'resourceId':_0x46e0a7['id'],'type':_0x37562c[_0xe69d('0x28')],'sectionId':_0x37562c['id']},{})[_0xe69d('0x22')](function(){return _0x53fc5c;});}else{return _0x53fc5c;}})[_0xe69d('0x52')](function(_0x57ef34){logger[_0xe69d('0x26')](_0xe69d('0x79'),_0x57ef34);throw _0x57ef34;});}return _0x53fc5c;})[_0xe69d('0x22')](respondWithResult(_0x5a8551,null))['catch'](handleError(_0x5a8551,null));});_0x31fcd3['start']();}catch(_0x516ed2){_0x5a8551['status'](0x1f4)[_0xe69d('0x29')](_0x516ed2);}};exports['update']=function(_0x50c557,_0x1ab914,_0x3f2340){return db[_0xe69d('0x2c')][_0xe69d('0x45')]({'where':{'id':_0x50c557[_0xe69d('0x42')]['id']}})[_0xe69d('0x22')](handleEntityNotFound(_0x1ab914,null))[_0xe69d('0x22')](saveUpdates(_[_0xe69d('0x7a')](_0x50c557[_0xe69d('0x71')],[_0xe69d('0x28'),_0xe69d('0x7b')]),null))[_0xe69d('0x22')](respondWithResult(_0x1ab914,null))[_0xe69d('0x52')](handleError(_0x1ab914,null));};exports[_0xe69d('0x7c')]=function(_0x471459,_0x3a5c5f,_0x32b911){return db[_0xe69d('0x2c')][_0xe69d('0x45')]({'where':{'id':_0x471459[_0xe69d('0x42')]['id']}})['then'](function(_0x34fd5f){if(_0x34fd5f){return _0x34fd5f[_0xe69d('0x23')]();}})[_0xe69d('0x22')](function(_0x1737d3){var _0x33733d=path[_0xe69d('0x49')](config[_0xe69d('0x4a')],_0xe69d('0x59'),util[_0xe69d('0x51')](_0xe69d('0x50'),_0x1737d3[_0xe69d('0x47')],_0x1737d3[_0xe69d('0x7d')]));var _0x47e310=path[_0xe69d('0x49')](config[_0xe69d('0x4a')],_0xe69d('0x4b'),util[_0xe69d('0x51')](_0xe69d('0x50'),_0x1737d3[_0xe69d('0x47')],_0x1737d3[_0xe69d('0x4c')]));fs[_0xe69d('0x5f')](_0x33733d);fs['unlinkSync'](_0x47e310);return _0x1737d3;})['then'](function(_0x1e7d02){if(_0x1e7d02){return _0x3a5c5f[_0xe69d('0x17')](0xcc)[_0xe69d('0x16')]();}})[_0xe69d('0x22')](handleEntityNotFound(_0x3a5c5f,null))[_0xe69d('0x52')](handleError(_0x3a5c5f,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index c7ed2e4..27a2f80 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 _0xd4ce=['util','api','moment','request-promise','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds'];(function(_0x5e00c8,_0x21f9e1){var _0x41c430=function(_0x303e26){while(--_0x303e26){_0x5e00c8['push'](_0x5e00c8['shift']());}};_0x41c430(++_0x21f9e1);}(_0xd4ce,0xc0));var _0xed4c=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xd4ce[_0x45e98e];return _0x374dba;};'use strict';var _=require('lodash');var util=require(_0xed4c('0x0'));var logger=require('../../config/logger')(_0xed4c('0x1'));var moment=require(_0xed4c('0x2'));var BPromise=require('bluebird');var rp=require(_0xed4c('0x3'));var fs=require('fs');var path=require(_0xed4c('0x4'));var rimraf=require(_0xed4c('0x5'));var config=require(_0xed4c('0x6'));var attributes=require(_0xed4c('0x7'));module[_0xed4c('0x8')]=function(_0x48a831,_0x2a2558){return _0x48a831[_0xed4c('0x9')](_0xed4c('0xa'),attributes,{'tableName':_0xed4c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x92b9=['request-promise','path','../../config/environment','./sound.attributes','exports','Sound','tools_sounds','lodash','util','../../config/logger','api','moment'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x92b9,0x14b));var _0x992b=function(_0x5575bb,_0x272266){_0x5575bb=_0x5575bb-0x0;var _0x347c89=_0x92b9[_0x5575bb];return _0x347c89;};'use strict';var _=require(_0x992b('0x0'));var util=require(_0x992b('0x1'));var logger=require(_0x992b('0x2'))(_0x992b('0x3'));var moment=require(_0x992b('0x4'));var BPromise=require('bluebird');var rp=require(_0x992b('0x5'));var fs=require('fs');var path=require(_0x992b('0x6'));var rimraf=require('rimraf');var config=require(_0x992b('0x7'));var attributes=require(_0x992b('0x8'));module[_0x992b('0x9')]=function(_0x40aafe,_0x4e9008){return _0x40aafe['define'](_0x992b('0xa'),attributes,{'tableName':_0x992b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index e4cde33..05fc082 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 _0x0c7c=['ShowSound','Sound','find','options','raw','where','include','map','model','attributes','stringify','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x525445,_0x4f8f42){var _0x48b600=function(_0x561bc1){while(--_0x561bc1){_0x525445['push'](_0x525445['shift']());}};_0x48b600(++_0x4f8f42);}(_0x0c7c,0xc5));var _0xc0c7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c7c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xc0c7('0x0'));var moment=require('moment');var BPromise=require(_0xc0c7('0x1'));var rs=require(_0xc0c7('0x2'));var fs=require('fs');var Redis=require(_0xc0c7('0x3'));var db=require(_0xc0c7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc0c7('0x5'))(_0xc0c7('0x6'));var config=require(_0xc0c7('0x7'));var jayson=require(_0xc0c7('0x8'));var client=jayson[_0xc0c7('0x9')][_0xc0c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3bf52c,_0x39711f,_0x26d8b8){return new BPromise(function(_0x2d7059,_0x1233e1){return client['request'](_0x3bf52c,_0x26d8b8)[_0xc0c7('0xb')](function(_0x3d371b){logger[_0xc0c7('0xc')](_0xc0c7('0xd'),_0x39711f,_0xc0c7('0xe'));logger[_0xc0c7('0xf')](_0xc0c7('0x10'),_0x39711f,'request\x20sent',JSON['stringify'](_0x3d371b));if(_0x3d371b[_0xc0c7('0x11')]){if(_0x3d371b['error']['code']===0x1f4){logger[_0xc0c7('0x11')](_0xc0c7('0xd'),_0x39711f,_0x3d371b[_0xc0c7('0x11')][_0xc0c7('0x12')]);return _0x1233e1(_0x3d371b[_0xc0c7('0x11')][_0xc0c7('0x12')]);}logger['error']('Sound,\x20%s,\x20%s',_0x39711f,_0x3d371b[_0xc0c7('0x11')][_0xc0c7('0x12')]);return _0x2d7059(_0x3d371b[_0xc0c7('0x11')][_0xc0c7('0x12')]);}else{logger['info'](_0xc0c7('0xd'),_0x39711f,_0xc0c7('0xe'));_0x2d7059(_0x3d371b[_0xc0c7('0x13')][_0xc0c7('0x12')]);}})['catch'](function(_0x414577){logger[_0xc0c7('0x11')](_0xc0c7('0xd'),_0x39711f,_0x414577);_0x1233e1(_0x414577);});});}exports[_0xc0c7('0x14')]=function(_0x147835){var _0x348ad6=this;return new Promise(function(_0x511f98,_0x59fdd6){return db[_0xc0c7('0x15')][_0xc0c7('0x16')]({'raw':_0x147835[_0xc0c7('0x17')]?_0x147835['options'][_0xc0c7('0x18')]===undefined?!![]:![]:!![],'where':_0x147835['options']?_0x147835[_0xc0c7('0x17')][_0xc0c7('0x19')]||null:null,'attributes':_0x147835[_0xc0c7('0x17')]?_0x147835[_0xc0c7('0x17')]['attributes']||null:null,'include':_0x147835[_0xc0c7('0x17')]?_0x147835[_0xc0c7('0x17')][_0xc0c7('0x1a')]?_[_0xc0c7('0x1b')](_0x147835[_0xc0c7('0x17')][_0xc0c7('0x1a')],function(_0x32e754){return{'model':db[_0x32e754[_0xc0c7('0x1c')]],'as':_0x32e754['as'],'attributes':_0x32e754[_0xc0c7('0x1d')],'include':_0x32e754[_0xc0c7('0x1a')]?_[_0xc0c7('0x1b')](_0x32e754[_0xc0c7('0x1a')],function(_0x287565){return{'model':db[_0x287565[_0xc0c7('0x1c')]],'as':_0x287565['as'],'attributes':_0x287565[_0xc0c7('0x1d')],'include':_0x287565[_0xc0c7('0x1a')]?_[_0xc0c7('0x1b')](_0x287565[_0xc0c7('0x1a')],function(_0x414994){return{'model':db[_0x414994[_0xc0c7('0x1c')]],'as':_0x414994['as'],'attributes':_0x414994[_0xc0c7('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x451fa2){logger[_0xc0c7('0xc')](_0xc0c7('0x14'),_0x147835);logger['debug'](_0xc0c7('0x14'),_0x147835,JSON[_0xc0c7('0x1e')](_0x451fa2));_0x511f98(_0x451fa2);})['catch'](function(_0x19e588){logger['error']('ShowSound',_0x19e588[_0xc0c7('0x12')],_0x147835);_0x59fdd6(_0x348ad6[_0xc0c7('0x11')](0x1f4,_0x19e588['message']));});});}; \ No newline at end of file +var _0x5283=['code','error','message','result','catch','ShowSound','Sound','options','raw','where','attributes','map','model','include','debug','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3e79a7,_0x5c6fa7){var _0x11d050=function(_0x3910dc){while(--_0x3910dc){_0x3e79a7['push'](_0x3e79a7['shift']());}};_0x11d050(++_0x5c6fa7);}(_0x5283,0x1e0));var _0x3528=function(_0x5c38cd,_0x5a6b4e){_0x5c38cd=_0x5c38cd-0x0;var _0xc985ef=_0x5283[_0x5c38cd];return _0xc985ef;};'use strict';var _=require(_0x3528('0x0'));var util=require(_0x3528('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3528('0x2'));var fs=require('fs');var Redis=require(_0x3528('0x3'));var db=require(_0x3528('0x4'))['db'];var utils=require(_0x3528('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3528('0x6'));var jayson=require(_0x3528('0x7'));var client=jayson['client'][_0x3528('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c59b7,_0x56d1df,_0x1b1d84){return new BPromise(function(_0xd0225b,_0x255f0e){return client[_0x3528('0x9')](_0x3c59b7,_0x1b1d84)[_0x3528('0xa')](function(_0x21e93b){logger[_0x3528('0xb')](_0x3528('0xc'),_0x56d1df,_0x3528('0xd'));logger['debug'](_0x3528('0xe'),_0x56d1df,'request\x20sent',JSON[_0x3528('0xf')](_0x21e93b));if(_0x21e93b['error']){if(_0x21e93b['error'][_0x3528('0x10')]===0x1f4){logger[_0x3528('0x11')](_0x3528('0xc'),_0x56d1df,_0x21e93b[_0x3528('0x11')][_0x3528('0x12')]);return _0x255f0e(_0x21e93b[_0x3528('0x11')][_0x3528('0x12')]);}logger[_0x3528('0x11')](_0x3528('0xc'),_0x56d1df,_0x21e93b[_0x3528('0x11')][_0x3528('0x12')]);return _0xd0225b(_0x21e93b[_0x3528('0x11')]['message']);}else{logger[_0x3528('0xb')](_0x3528('0xc'),_0x56d1df,_0x3528('0xd'));_0xd0225b(_0x21e93b[_0x3528('0x13')]['message']);}})[_0x3528('0x14')](function(_0x371d1c){logger[_0x3528('0x11')](_0x3528('0xc'),_0x56d1df,_0x371d1c);_0x255f0e(_0x371d1c);});});}exports[_0x3528('0x15')]=function(_0x32ac65){var _0x469ec9=this;return new Promise(function(_0x3e189f,_0x4e48e2){return db[_0x3528('0x16')]['find']({'raw':_0x32ac65['options']?_0x32ac65[_0x3528('0x17')][_0x3528('0x18')]===undefined?!![]:![]:!![],'where':_0x32ac65['options']?_0x32ac65['options'][_0x3528('0x19')]||null:null,'attributes':_0x32ac65[_0x3528('0x17')]?_0x32ac65[_0x3528('0x17')][_0x3528('0x1a')]||null:null,'include':_0x32ac65[_0x3528('0x17')]?_0x32ac65[_0x3528('0x17')]['include']?_[_0x3528('0x1b')](_0x32ac65[_0x3528('0x17')]['include'],function(_0x2af7d4){return{'model':db[_0x2af7d4[_0x3528('0x1c')]],'as':_0x2af7d4['as'],'attributes':_0x2af7d4[_0x3528('0x1a')],'include':_0x2af7d4['include']?_['map'](_0x2af7d4[_0x3528('0x1d')],function(_0x32181f){return{'model':db[_0x32181f[_0x3528('0x1c')]],'as':_0x32181f['as'],'attributes':_0x32181f['attributes'],'include':_0x32181f[_0x3528('0x1d')]?_[_0x3528('0x1b')](_0x32181f[_0x3528('0x1d')],function(_0x209fe4){return{'model':db[_0x209fe4['model']],'as':_0x209fe4['as'],'attributes':_0x209fe4[_0x3528('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3528('0xa')](function(_0x4255e7){logger['info']('ShowSound',_0x32ac65);logger[_0x3528('0x1e')](_0x3528('0x15'),_0x32ac65,JSON[_0x3528('0xf')](_0x4255e7));_0x3e189f(_0x4255e7);})[_0x3528('0x14')](function(_0x324541){logger[_0x3528('0x11')]('ShowSound',_0x324541[_0x3528('0x12')],_0x32ac65);_0x4e48e2(_0x469ec9[_0x3528('0x11')](0x1f4,_0x324541[_0x3528('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 0c3b851..d8c0d8d 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(_0xbdd99f,_0x2a07b2){var _0xfc2ebe=function(_0x1774be){while(--_0x1774be){_0xbdd99f['push'](_0xbdd99f['shift']());}};_0xfc2ebe(++_0x2a07b2);}(_0xb10b,0x12a));var _0xbb10=function(_0x357979,_0x56feef){_0x357979=_0x357979-0x0;var _0xabb42f=_0xb10b[_0x357979];return _0xabb42f;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0xd')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['update']);router['delete'](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);module['exports']=router; \ No newline at end of file +var _0x2032=['exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x39e227,_0x21fa81){var _0x558d73=function(_0x282632){while(--_0x282632){_0x39e227['push'](_0x39e227['shift']());}};_0x558d73(++_0x21fa81);}(_0x2032,0xd9));var _0x2203=function(_0x5034bb,_0x4a80ba){_0x5034bb=_0x5034bb-0x0;var _0x3a94fa=_0x2032[_0x5034bb];return _0x3a94fa;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2203('0xe')]('/:id',auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router[_0x2203('0x10')]('/:id',auth[_0x2203('0x9')](),controller['destroy']);module[_0x2203('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index ace9f52..d61ca1a 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 _0x1c19=['sequelize','exports','STRING','TEXT','medium','ENUM'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x1c19,0x1c8));var _0x91c1=function(_0x4e46fd,_0x5993bb){_0x4e46fd=_0x4e46fd-0x0;var _0x4dc5cf=_0x1c19[_0x4e46fd];return _0x4dc5cf;};'use strict';var Sequelize=require(_0x91c1('0x0'));module[_0x91c1('0x1')]={'uniqueid':{'type':Sequelize[_0x91c1('0x2')]},'body':{'type':Sequelize[_0x91c1('0x3')](_0x91c1('0x4')),'allowNull':![]},'direction':{'type':Sequelize[_0x91c1('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x91c1('0x3')]}}; \ No newline at end of file +var _0x2e61=['medium','out','exports','STRING'];(function(_0x254163,_0x1b990b){var _0x4bad07=function(_0x419819){while(--_0x419819){_0x254163['push'](_0x254163['shift']());}};_0x4bad07(++_0x1b990b);}(_0x2e61,0x86));var _0x12e6=function(_0x226716,_0x5b24dd){_0x226716=_0x226716-0x0;var _0x45801f=_0x2e61[_0x226716];return _0x45801f;};'use strict';var Sequelize=require('sequelize');module[_0x12e6('0x0')]={'uniqueid':{'type':Sequelize[_0x12e6('0x1')]},'body':{'type':Sequelize['TEXT'](_0x12e6('0x2')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x12e6('0x3')),'defaultValue':_0x12e6('0x3'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index be2ce1c..dc7ab75 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 _0x99d0=['intersection','attributes','fields','hasOwnProperty','order','sort','filters','pick','where','type','filter','merge','count','findAll','catch','show','params','keys','length','includeAll','options','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','SquareMessage','rawAttributes','key','model','query'];(function(_0x3e591a,_0xb0bed2){var _0x5b4f27=function(_0x61a77e){while(--_0x61a77e){_0x3e591a['push'](_0x3e591a['shift']());}};_0x5b4f27(++_0xb0bed2);}(_0x99d0,0xa8));var _0x099d=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x99d0[_0x4154a6];return _0x3b2786;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x099d('0x0'));var zipdir=require(_0x099d('0x1'));var jsonpatch=require(_0x099d('0x2'));var rp=require(_0x099d('0x3'));var moment=require('moment');var BPromise=require(_0x099d('0x4'));var Mustache=require('mustache');var util=require(_0x099d('0x5'));var path=require(_0x099d('0x6'));var sox=require(_0x099d('0x7'));var csv=require(_0x099d('0x8'));var ejs=require(_0x099d('0x9'));var fs=require('fs');var fs_extra=require(_0x099d('0xa'));var _=require(_0x099d('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x099d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x099d('0x8'));var querystring=require('querystring');var Papa=require(_0x099d('0xd'));var Redis=require(_0x099d('0xe'));var authService=require(_0x099d('0xf'));var qs=require(_0x099d('0x10'));var as=require(_0x099d('0x11'));var hardwareService=require(_0x099d('0x12'));var logger=require(_0x099d('0x13'))('api');var utils=require(_0x099d('0x14'));var config=require(_0x099d('0x15'));var licenseUtil=require(_0x099d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f3fa8,_0x27c769){_0x27c769=_0x27c769||0xcc;return function(_0xcf985f){if(_0xcf985f){return _0x3f3fa8[_0x099d('0x17')](_0x27c769);}return _0x3f3fa8[_0x099d('0x18')](_0x27c769)[_0x099d('0x19')]();};}function respondWithResult(_0x5ba901,_0x2d67cd){_0x2d67cd=_0x2d67cd||0xc8;return function(_0x4bc9d1){if(_0x4bc9d1){return _0x5ba901[_0x099d('0x18')](_0x2d67cd)[_0x099d('0x1a')](_0x4bc9d1);}};}function respondWithFilteredResult(_0x42398d,_0x2689b7){return function(_0x4b9f01){if(_0x4b9f01){var _0x11d638=typeof _0x2689b7[_0x099d('0x1b')]===_0x099d('0x1c')&&typeof _0x2689b7[_0x099d('0x1d')]==='undefined';var _0x4042d8=_0x4b9f01['count'];var _0xb6635c=_0x11d638?0x0:_0x2689b7[_0x099d('0x1b')];var _0x29f7b3=_0x11d638?_0x4b9f01['count']:_0x2689b7[_0x099d('0x1b')]+_0x2689b7[_0x099d('0x1d')];var _0x121c5b;if(_0x29f7b3>=_0x4042d8){_0x29f7b3=_0x4042d8;_0x121c5b=0xc8;}else{_0x121c5b=0xce;}_0x42398d[_0x099d('0x18')](_0x121c5b);return _0x42398d[_0x099d('0x1e')](_0x099d('0x1f'),_0xb6635c+'-'+_0x29f7b3+'/'+_0x4042d8)['json'](_0x4b9f01);}return null;};}function patchUpdates(_0x2d43ee){return function(_0x108223){try{jsonpatch[_0x099d('0x20')](_0x108223,_0x2d43ee,!![]);}catch(_0x1dcf66){return BPromise[_0x099d('0x21')](_0x1dcf66);}return _0x108223[_0x099d('0x22')]();};}function saveUpdates(_0x1ec7bb,_0x3cd8e7){return function(_0x1f12bc){if(_0x1f12bc){return _0x1f12bc[_0x099d('0x23')](_0x1ec7bb)['then'](function(_0x5a66aa){return _0x5a66aa;});}return null;};}function removeEntity(_0x4384b2,_0x388d2c){return function(_0x8db89b){if(_0x8db89b){return _0x8db89b[_0x099d('0x24')]()[_0x099d('0x25')](function(){_0x4384b2[_0x099d('0x18')](0xcc)[_0x099d('0x19')]();});}};}function handleEntityNotFound(_0x1e9217,_0xe11c0){return function(_0x2170d5){if(!_0x2170d5){_0x1e9217['sendStatus'](0x194);}return _0x2170d5;};}function handleError(_0x1be986,_0x40fdd0){_0x40fdd0=_0x40fdd0||0x1f4;return function(_0x40787f){logger[_0x099d('0x26')](_0x40787f[_0x099d('0x27')]);if(_0x40787f[_0x099d('0x28')]){delete _0x40787f[_0x099d('0x28')];}_0x1be986['status'](_0x40fdd0)[_0x099d('0x29')](_0x40787f);};}exports['index']=function(_0x159602,_0x28b620){var _0x47ea22={},_0x4e190f={},_0x10d542={'count':0x0,'rows':[]};var _0x53c5c8=_[_0x099d('0x2a')](db[_0x099d('0x2b')][_0x099d('0x2c')],function(_0x3dd708){return{'name':_0x3dd708['fieldName'],'type':_0x3dd708['type'][_0x099d('0x2d')]};});_0x4e190f[_0x099d('0x2e')]=_[_0x099d('0x2a')](_0x53c5c8,_0x099d('0x28'));_0x4e190f['query']=_['keys'](_0x159602[_0x099d('0x2f')]);_0x4e190f['filters']=_[_0x099d('0x30')](_0x4e190f[_0x099d('0x2e')],_0x4e190f['query']);_0x47ea22[_0x099d('0x31')]=_[_0x099d('0x30')](_0x4e190f[_0x099d('0x2e')],qs['fields'](_0x159602[_0x099d('0x2f')][_0x099d('0x32')]));_0x47ea22[_0x099d('0x31')]=_0x47ea22['attributes']['length']?_0x47ea22[_0x099d('0x31')]:_0x4e190f[_0x099d('0x2e')];if(!_0x159602[_0x099d('0x2f')][_0x099d('0x33')]('nolimit')){_0x47ea22[_0x099d('0x1d')]=qs[_0x099d('0x1d')](_0x159602[_0x099d('0x2f')][_0x099d('0x1d')]);_0x47ea22[_0x099d('0x1b')]=qs[_0x099d('0x1b')](_0x159602[_0x099d('0x2f')][_0x099d('0x1b')]);}_0x47ea22[_0x099d('0x34')]=qs[_0x099d('0x35')](_0x159602['query'][_0x099d('0x35')]);_0x47ea22['where']=qs[_0x099d('0x36')](_[_0x099d('0x37')](_0x159602[_0x099d('0x2f')],_0x4e190f[_0x099d('0x36')]),_0x53c5c8);if(_0x159602[_0x099d('0x2f')]['filter']){_0x47ea22['where']=_['merge'](_0x47ea22[_0x099d('0x38')],{'$or':_[_0x099d('0x2a')](_0x53c5c8,function(_0x459b9a){if(_0x459b9a[_0x099d('0x39')]!=='VIRTUAL'){var _0x3c18af={};_0x3c18af[_0x459b9a['name']]={'$like':'%'+_0x159602[_0x099d('0x2f')][_0x099d('0x3a')]+'%'};return _0x3c18af;}})});}_0x47ea22=_[_0x099d('0x3b')]({},_0x47ea22,_0x159602['options']);var _0x4eba27={'where':_0x47ea22[_0x099d('0x38')]};return db['SquareMessage'][_0x099d('0x3c')](_0x4eba27)[_0x099d('0x25')](function(_0x41e755){_0x10d542[_0x099d('0x3c')]=_0x41e755;if(_0x159602[_0x099d('0x2f')]['includeAll']){_0x47ea22['include']=[{'all':!![]}];}return db[_0x099d('0x2b')][_0x099d('0x3d')](_0x47ea22);})['then'](function(_0x19fef1){_0x10d542['rows']=_0x19fef1;return _0x10d542;})[_0x099d('0x25')](respondWithFilteredResult(_0x28b620,_0x47ea22))[_0x099d('0x3e')](handleError(_0x28b620,null));};exports[_0x099d('0x3f')]=function(_0x5d4aaf,_0x5773da){var _0x18d1ff={'raw':!![],'where':{'id':_0x5d4aaf[_0x099d('0x40')]['id']}},_0x34ee05={};_0x34ee05[_0x099d('0x2e')]=_[_0x099d('0x41')](db['SquareMessage'][_0x099d('0x2c')]);_0x34ee05[_0x099d('0x2f')]=_[_0x099d('0x41')](_0x5d4aaf[_0x099d('0x2f')]);_0x34ee05['filters']=_[_0x099d('0x30')](_0x34ee05[_0x099d('0x2e')],_0x34ee05['query']);_0x18d1ff[_0x099d('0x31')]=_['intersection'](_0x34ee05['model'],qs[_0x099d('0x32')](_0x5d4aaf[_0x099d('0x2f')][_0x099d('0x32')]));_0x18d1ff[_0x099d('0x31')]=_0x18d1ff[_0x099d('0x31')][_0x099d('0x42')]?_0x18d1ff[_0x099d('0x31')]:_0x34ee05[_0x099d('0x2e')];if(_0x5d4aaf[_0x099d('0x2f')][_0x099d('0x43')]){_0x18d1ff['include']=[{'all':!![]}];}_0x18d1ff=_['merge']({},_0x18d1ff,_0x5d4aaf[_0x099d('0x44')]);return db['SquareMessage'][_0x099d('0x45')](_0x18d1ff)[_0x099d('0x25')](handleEntityNotFound(_0x5773da,null))['then'](respondWithResult(_0x5773da,null))['catch'](handleError(_0x5773da,null));};exports[_0x099d('0x46')]=function(_0x460a61,_0x2b20fa){return db[_0x099d('0x2b')][_0x099d('0x46')](_0x460a61['body'],{})[_0x099d('0x25')](respondWithResult(_0x2b20fa,0xc9))['catch'](handleError(_0x2b20fa,null));};exports[_0x099d('0x23')]=function(_0x1b80d6,_0xe47a27){if(_0x1b80d6[_0x099d('0x47')]['id']){delete _0x1b80d6[_0x099d('0x47')]['id'];}return db[_0x099d('0x2b')][_0x099d('0x45')]({'where':{'id':_0x1b80d6[_0x099d('0x40')]['id']}})['then'](handleEntityNotFound(_0xe47a27,null))[_0x099d('0x25')](saveUpdates(_0x1b80d6[_0x099d('0x47')],null))[_0x099d('0x25')](respondWithResult(_0xe47a27,null))[_0x099d('0x3e')](handleError(_0xe47a27,null));};exports['destroy']=function(_0x46b2bc,_0x48c458){return db[_0x099d('0x2b')][_0x099d('0x45')]({'where':{'id':_0x46b2bc[_0x099d('0x40')]['id']}})[_0x099d('0x25')](handleEntityNotFound(_0x48c458,null))[_0x099d('0x25')](removeEntity(_0x48c458,null))[_0x099d('0x3e')](handleError(_0x48c458,null));}; \ No newline at end of file +var _0x87ad=['api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','then','stack','name','send','index','SquareMessage','rawAttributes','type','key','model','map','query','keys','intersection','fields','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','catch','show','params','attributes','length','includeAll','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x279dce,_0x2f2d2){var _0x1d7e03=function(_0x949a){while(--_0x949a){_0x279dce['push'](_0x279dce['shift']());}};_0x1d7e03(++_0x2f2d2);}(_0x87ad,0x76));var _0xd87a=function(_0x67e2b1,_0x11bb74){_0x67e2b1=_0x67e2b1-0x0;var _0xb0fe50=_0x87ad[_0x67e2b1];return _0xb0fe50;};'use strict';var emlformat=require(_0xd87a('0x0'));var rimraf=require(_0xd87a('0x1'));var zipdir=require(_0xd87a('0x2'));var jsonpatch=require(_0xd87a('0x3'));var rp=require(_0xd87a('0x4'));var moment=require('moment');var BPromise=require(_0xd87a('0x5'));var Mustache=require(_0xd87a('0x6'));var util=require(_0xd87a('0x7'));var path=require(_0xd87a('0x8'));var sox=require('sox');var csv=require(_0xd87a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd87a('0xa'));var _=require('lodash');var squel=require(_0xd87a('0xb'));var crypto=require(_0xd87a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd87a('0xd'));var toCsv=require(_0xd87a('0x9'));var querystring=require('querystring');var Papa=require(_0xd87a('0xe'));var Redis=require(_0xd87a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd87a('0x10'));var as=require(_0xd87a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd87a('0x12'));var utils=require('../../config/utils');var config=require(_0xd87a('0x13'));var licenseUtil=require(_0xd87a('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x151fd8,_0xefa9c3){_0xefa9c3=_0xefa9c3||0xcc;return function(_0x310a88){if(_0x310a88){return _0x151fd8[_0xd87a('0x15')](_0xefa9c3);}return _0x151fd8[_0xd87a('0x16')](_0xefa9c3)[_0xd87a('0x17')]();};}function respondWithResult(_0x47a8ee,_0x404e9a){_0x404e9a=_0x404e9a||0xc8;return function(_0x167137){if(_0x167137){return _0x47a8ee[_0xd87a('0x16')](_0x404e9a)[_0xd87a('0x18')](_0x167137);}};}function respondWithFilteredResult(_0x58f15a,_0xc309c5){return function(_0xf15100){if(_0xf15100){var _0x472171=typeof _0xc309c5[_0xd87a('0x19')]==='undefined'&&typeof _0xc309c5[_0xd87a('0x1a')]==='undefined';var _0x3e825a=_0xf15100[_0xd87a('0x1b')];var _0x54f072=_0x472171?0x0:_0xc309c5[_0xd87a('0x19')];var _0x1427dd=_0x472171?_0xf15100[_0xd87a('0x1b')]:_0xc309c5[_0xd87a('0x19')]+_0xc309c5[_0xd87a('0x1a')];var _0x4f91ad;if(_0x1427dd>=_0x3e825a){_0x1427dd=_0x3e825a;_0x4f91ad=0xc8;}else{_0x4f91ad=0xce;}_0x58f15a['status'](_0x4f91ad);return _0x58f15a[_0xd87a('0x1c')](_0xd87a('0x1d'),_0x54f072+'-'+_0x1427dd+'/'+_0x3e825a)[_0xd87a('0x18')](_0xf15100);}return null;};}function patchUpdates(_0x9f87b1){return function(_0x5893b5){try{jsonpatch['apply'](_0x5893b5,_0x9f87b1,!![]);}catch(_0x3d44ab){return BPromise[_0xd87a('0x1e')](_0x3d44ab);}return _0x5893b5[_0xd87a('0x1f')]();};}function saveUpdates(_0x4dcf66,_0x2a591c){return function(_0x459cf9){if(_0x459cf9){return _0x459cf9['update'](_0x4dcf66)[_0xd87a('0x20')](function(_0xc01c43){return _0xc01c43;});}return null;};}function removeEntity(_0x445d81,_0x54a286){return function(_0x4bb6f7){if(_0x4bb6f7){return _0x4bb6f7['destroy']()[_0xd87a('0x20')](function(){_0x445d81[_0xd87a('0x16')](0xcc)[_0xd87a('0x17')]();});}};}function handleEntityNotFound(_0x22ebc3,_0x175096){return function(_0xd569dc){if(!_0xd569dc){_0x22ebc3['sendStatus'](0x194);}return _0xd569dc;};}function handleError(_0x9241f9,_0x134a47){_0x134a47=_0x134a47||0x1f4;return function(_0x35a2c5){logger['error'](_0x35a2c5[_0xd87a('0x21')]);if(_0x35a2c5['name']){delete _0x35a2c5[_0xd87a('0x22')];}_0x9241f9[_0xd87a('0x16')](_0x134a47)[_0xd87a('0x23')](_0x35a2c5);};}exports[_0xd87a('0x24')]=function(_0x43e5b9,_0x1003c6){var _0x3cf5fd={},_0x353c50={},_0x192d66={'count':0x0,'rows':[]};var _0x2e7e7e=_['map'](db[_0xd87a('0x25')][_0xd87a('0x26')],function(_0x2c96e6){return{'name':_0x2c96e6['fieldName'],'type':_0x2c96e6[_0xd87a('0x27')][_0xd87a('0x28')]};});_0x353c50[_0xd87a('0x29')]=_[_0xd87a('0x2a')](_0x2e7e7e,_0xd87a('0x22'));_0x353c50[_0xd87a('0x2b')]=_[_0xd87a('0x2c')](_0x43e5b9[_0xd87a('0x2b')]);_0x353c50['filters']=_[_0xd87a('0x2d')](_0x353c50['model'],_0x353c50['query']);_0x3cf5fd['attributes']=_[_0xd87a('0x2d')](_0x353c50[_0xd87a('0x29')],qs['fields'](_0x43e5b9['query'][_0xd87a('0x2e')]));_0x3cf5fd['attributes']=_0x3cf5fd['attributes']['length']?_0x3cf5fd['attributes']:_0x353c50[_0xd87a('0x29')];if(!_0x43e5b9[_0xd87a('0x2b')]['hasOwnProperty']('nolimit')){_0x3cf5fd[_0xd87a('0x1a')]=qs[_0xd87a('0x1a')](_0x43e5b9[_0xd87a('0x2b')][_0xd87a('0x1a')]);_0x3cf5fd[_0xd87a('0x19')]=qs[_0xd87a('0x19')](_0x43e5b9[_0xd87a('0x2b')][_0xd87a('0x19')]);}_0x3cf5fd[_0xd87a('0x2f')]=qs[_0xd87a('0x30')](_0x43e5b9['query'][_0xd87a('0x30')]);_0x3cf5fd[_0xd87a('0x31')]=qs[_0xd87a('0x32')](_[_0xd87a('0x33')](_0x43e5b9[_0xd87a('0x2b')],_0x353c50[_0xd87a('0x32')]),_0x2e7e7e);if(_0x43e5b9[_0xd87a('0x2b')][_0xd87a('0x34')]){_0x3cf5fd[_0xd87a('0x31')]=_[_0xd87a('0x35')](_0x3cf5fd[_0xd87a('0x31')],{'$or':_[_0xd87a('0x2a')](_0x2e7e7e,function(_0x3a05e7){if(_0x3a05e7[_0xd87a('0x27')]!==_0xd87a('0x36')){var _0x2f3fc4={};_0x2f3fc4[_0x3a05e7[_0xd87a('0x22')]]={'$like':'%'+_0x43e5b9['query'][_0xd87a('0x34')]+'%'};return _0x2f3fc4;}})});}_0x3cf5fd=_[_0xd87a('0x35')]({},_0x3cf5fd,_0x43e5b9['options']);var _0x23bf2b={'where':_0x3cf5fd['where']};return db[_0xd87a('0x25')]['count'](_0x23bf2b)['then'](function(_0x5eab61){_0x192d66['count']=_0x5eab61;if(_0x43e5b9['query']['includeAll']){_0x3cf5fd[_0xd87a('0x37')]=[{'all':!![]}];}return db[_0xd87a('0x25')][_0xd87a('0x38')](_0x3cf5fd);})[_0xd87a('0x20')](function(_0x206167){_0x192d66['rows']=_0x206167;return _0x192d66;})[_0xd87a('0x20')](respondWithFilteredResult(_0x1003c6,_0x3cf5fd))[_0xd87a('0x39')](handleError(_0x1003c6,null));};exports[_0xd87a('0x3a')]=function(_0x8e8022,_0x218559){var _0x1cf02a={'raw':!![],'where':{'id':_0x8e8022[_0xd87a('0x3b')]['id']}},_0x13a3ba={};_0x13a3ba[_0xd87a('0x29')]=_[_0xd87a('0x2c')](db[_0xd87a('0x25')][_0xd87a('0x26')]);_0x13a3ba['query']=_[_0xd87a('0x2c')](_0x8e8022['query']);_0x13a3ba[_0xd87a('0x32')]=_[_0xd87a('0x2d')](_0x13a3ba[_0xd87a('0x29')],_0x13a3ba[_0xd87a('0x2b')]);_0x1cf02a['attributes']=_[_0xd87a('0x2d')](_0x13a3ba[_0xd87a('0x29')],qs[_0xd87a('0x2e')](_0x8e8022['query'][_0xd87a('0x2e')]));_0x1cf02a[_0xd87a('0x3c')]=_0x1cf02a[_0xd87a('0x3c')][_0xd87a('0x3d')]?_0x1cf02a[_0xd87a('0x3c')]:_0x13a3ba[_0xd87a('0x29')];if(_0x8e8022[_0xd87a('0x2b')][_0xd87a('0x3e')]){_0x1cf02a['include']=[{'all':!![]}];}_0x1cf02a=_['merge']({},_0x1cf02a,_0x8e8022[_0xd87a('0x3f')]);return db[_0xd87a('0x25')][_0xd87a('0x40')](_0x1cf02a)['then'](handleEntityNotFound(_0x218559,null))[_0xd87a('0x20')](respondWithResult(_0x218559,null))[_0xd87a('0x39')](handleError(_0x218559,null));};exports[_0xd87a('0x41')]=function(_0x2e4d30,_0x4cd367){return db[_0xd87a('0x25')]['create'](_0x2e4d30[_0xd87a('0x42')],{})['then'](respondWithResult(_0x4cd367,0xc9))[_0xd87a('0x39')](handleError(_0x4cd367,null));};exports['update']=function(_0x4d21a8,_0xce0fb9){if(_0x4d21a8['body']['id']){delete _0x4d21a8['body']['id'];}return db[_0xd87a('0x25')][_0xd87a('0x40')]({'where':{'id':_0x4d21a8[_0xd87a('0x3b')]['id']}})[_0xd87a('0x20')](handleEntityNotFound(_0xce0fb9,null))[_0xd87a('0x20')](saveUpdates(_0x4d21a8[_0xd87a('0x42')],null))[_0xd87a('0x20')](respondWithResult(_0xce0fb9,null))[_0xd87a('0x39')](handleError(_0xce0fb9,null));};exports[_0xd87a('0x43')]=function(_0x47b504,_0x254b84){return db[_0xd87a('0x25')]['find']({'where':{'id':_0x47b504['params']['id']}})[_0xd87a('0x20')](handleEntityNotFound(_0x254b84,null))[_0xd87a('0x20')](removeEntity(_0x254b84,null))[_0xd87a('0x39')](handleError(_0x254b84,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index a858de8..954e99a 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 _0x204a=['./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x36ed3c,_0x44a00a){var _0x52a2e0=function(_0x3f7af9){while(--_0x3f7af9){_0x36ed3c['push'](_0x36ed3c['shift']());}};_0x52a2e0(++_0x44a00a);}(_0x204a,0x6e));var _0xa204=function(_0x791adf,_0x332f5c){_0x791adf=_0x791adf-0x0;var _0x4ff1e4=_0x204a[_0x791adf];return _0x4ff1e4;};'use strict';var _=require(_0xa204('0x0'));var util=require(_0xa204('0x1'));var logger=require(_0xa204('0x2'))(_0xa204('0x3'));var moment=require(_0xa204('0x4'));var BPromise=require(_0xa204('0x5'));var rp=require(_0xa204('0x6'));var fs=require('fs');var path=require(_0xa204('0x7'));var rimraf=require(_0xa204('0x8'));var config=require(_0xa204('0x9'));var attributes=require(_0xa204('0xa'));module[_0xa204('0xb')]=function(_0x8d9961,_0x56ab9d){return _0x8d9961[_0xa204('0xc')](_0xa204('0xd'),attributes,{'tableName':_0xa204('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd596=['./squareMessage.attributes','exports','define','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x2ad0af,_0x52fd58){var _0x226a55=function(_0x29769e){while(--_0x29769e){_0x2ad0af['push'](_0x2ad0af['shift']());}};_0x226a55(++_0x52fd58);}(_0xd596,0xc1));var _0x6d59=function(_0x30a31e,_0x31f766){_0x30a31e=_0x30a31e-0x0;var _0x170879=_0xd596[_0x30a31e];return _0x170879;};'use strict';var _=require(_0x6d59('0x0'));var util=require(_0x6d59('0x1'));var logger=require(_0x6d59('0x2'))(_0x6d59('0x3'));var moment=require('moment');var BPromise=require(_0x6d59('0x4'));var rp=require(_0x6d59('0x5'));var fs=require('fs');var path=require(_0x6d59('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6d59('0x7'));module[_0x6d59('0x8')]=function(_0x1707b4,_0x31f8fc){return _0x1707b4[_0x6d59('0x9')]('SquareMessage',attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 59042da..d6bb7b3 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 _0x619f=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateSquareMessage','SquareMessage','create','body','options','lodash','moment','randomstring'];(function(_0x47e18e,_0x5a6ead){var _0x2232f3=function(_0x1961d0){while(--_0x1961d0){_0x47e18e['push'](_0x47e18e['shift']());}};_0x2232f3(++_0x5a6ead);}(_0x619f,0x1b7));var _0xf619=function(_0xae9462,_0x3fe448){_0xae9462=_0xae9462-0x0;var _0x3aa977=_0x619f[_0xae9462];return _0x3aa977;};'use strict';var _=require(_0xf619('0x0'));var util=require('util');var moment=require(_0xf619('0x1'));var BPromise=require('bluebird');var rs=require(_0xf619('0x2'));var fs=require('fs');var Redis=require(_0xf619('0x3'));var db=require(_0xf619('0x4'))['db'];var utils=require(_0xf619('0x5'));var logger=require('../../config/logger')(_0xf619('0x6'));var config=require(_0xf619('0x7'));var jayson=require(_0xf619('0x8'));var client=jayson[_0xf619('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x49d72c,_0x36b06a,_0x2ddfda){return new BPromise(function(_0x9e5919,_0x57b425){return client[_0xf619('0xa')](_0x49d72c,_0x2ddfda)[_0xf619('0xb')](function(_0x377c86){logger[_0xf619('0xc')](_0xf619('0xd'),_0x36b06a,_0xf619('0xe'));logger[_0xf619('0xf')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x36b06a,'request\x20sent',JSON[_0xf619('0x10')](_0x377c86));if(_0x377c86['error']){if(_0x377c86[_0xf619('0x11')][_0xf619('0x12')]===0x1f4){logger[_0xf619('0x11')](_0xf619('0xd'),_0x36b06a,_0x377c86[_0xf619('0x11')][_0xf619('0x13')]);return _0x57b425(_0x377c86['error'][_0xf619('0x13')]);}logger[_0xf619('0x11')](_0xf619('0xd'),_0x36b06a,_0x377c86['error'][_0xf619('0x13')]);return _0x9e5919(_0x377c86[_0xf619('0x11')][_0xf619('0x13')]);}else{logger[_0xf619('0xc')]('SquareMessage,\x20%s,\x20%s',_0x36b06a,_0xf619('0xe'));_0x9e5919(_0x377c86['result'][_0xf619('0x13')]);}})[_0xf619('0x14')](function(_0x445452){logger[_0xf619('0x11')](_0xf619('0xd'),_0x36b06a,_0x445452);_0x57b425(_0x445452);});});}exports[_0xf619('0x15')]=function(_0x114caa){var _0x319bd5=this;return new Promise(function(_0x77e55d,_0x52457e){return db[_0xf619('0x16')][_0xf619('0x17')](_0x114caa[_0xf619('0x18')],{'raw':_0x114caa[_0xf619('0x19')]?_0x114caa[_0xf619('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xf619('0xb')](function(_0x561f09){logger[_0xf619('0xc')](_0xf619('0x15'),_0x114caa);logger['debug'](_0xf619('0x15'),_0x114caa,JSON[_0xf619('0x10')](_0x561f09));_0x77e55d(_0x561f09);})[_0xf619('0x14')](function(_0x540992){logger[_0xf619('0x11')](_0xf619('0x15'),_0x540992['message'],_0x114caa);_0x52457e(_0x319bd5[_0xf619('0x11')](0x1f4,_0x540992[_0xf619('0x13')]));});});}; \ No newline at end of file +var _0x1e9d=['rpc','../../config/environment','jayson/promise','client','http','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateSquareMessage','SquareMessage','create','body','options','raw','then','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x51ed62,_0x574379){var _0x34aee3=function(_0x2958bc){while(--_0x2958bc){_0x51ed62['push'](_0x51ed62['shift']());}};_0x34aee3(++_0x574379);}(_0x1e9d,0x190));var _0xd1e9=function(_0xe88ee9,_0x919d){_0xe88ee9=_0xe88ee9-0x0;var _0x118922=_0x1e9d[_0xe88ee9];return _0x118922;};'use strict';var _=require(_0xd1e9('0x0'));var util=require(_0xd1e9('0x1'));var moment=require(_0xd1e9('0x2'));var BPromise=require(_0xd1e9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd1e9('0x4'));var db=require(_0xd1e9('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd1e9('0x6'));var config=require(_0xd1e9('0x7'));var jayson=require(_0xd1e9('0x8'));var client=jayson[_0xd1e9('0x9')][_0xd1e9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a57cf,_0x5c356a,_0x56de96){return new BPromise(function(_0x5de7f3,_0x44a69a){return client[_0xd1e9('0xb')](_0x4a57cf,_0x56de96)['then'](function(_0x555980){logger[_0xd1e9('0xc')](_0xd1e9('0xd'),_0x5c356a,_0xd1e9('0xe'));logger[_0xd1e9('0xf')](_0xd1e9('0x10'),_0x5c356a,'request\x20sent',JSON[_0xd1e9('0x11')](_0x555980));if(_0x555980[_0xd1e9('0x12')]){if(_0x555980[_0xd1e9('0x12')][_0xd1e9('0x13')]===0x1f4){logger[_0xd1e9('0x12')](_0xd1e9('0xd'),_0x5c356a,_0x555980[_0xd1e9('0x12')][_0xd1e9('0x14')]);return _0x44a69a(_0x555980[_0xd1e9('0x12')]['message']);}logger['error'](_0xd1e9('0xd'),_0x5c356a,_0x555980[_0xd1e9('0x12')][_0xd1e9('0x14')]);return _0x5de7f3(_0x555980[_0xd1e9('0x12')][_0xd1e9('0x14')]);}else{logger[_0xd1e9('0xc')]('SquareMessage,\x20%s,\x20%s',_0x5c356a,_0xd1e9('0xe'));_0x5de7f3(_0x555980['result'][_0xd1e9('0x14')]);}})['catch'](function(_0xd1f86a){logger[_0xd1e9('0x12')](_0xd1e9('0xd'),_0x5c356a,_0xd1f86a);_0x44a69a(_0xd1f86a);});});}exports[_0xd1e9('0x15')]=function(_0x447e05){var _0x53443c=this;return new Promise(function(_0x3b2cfa,_0xb56ab0){return db[_0xd1e9('0x16')][_0xd1e9('0x17')](_0x447e05[_0xd1e9('0x18')],{'raw':_0x447e05[_0xd1e9('0x19')]?_0x447e05[_0xd1e9('0x19')][_0xd1e9('0x1a')]===undefined?!![]:![]:!![]})[_0xd1e9('0x1b')](function(_0x2818eb){logger[_0xd1e9('0xc')](_0xd1e9('0x15'),_0x447e05);logger[_0xd1e9('0xf')](_0xd1e9('0x15'),_0x447e05,JSON[_0xd1e9('0x11')](_0x2818eb));_0x3b2cfa(_0x2818eb);})[_0xd1e9('0x1c')](function(_0x1fb961){logger[_0xd1e9('0x12')]('CreateSquareMessage',_0x1fb961[_0xd1e9('0x14')],_0x447e05);_0xb56ab0(_0x53443c[_0xd1e9('0x12')](0x1f4,_0x1fb961['message']));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index a731438..3a68fa7 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 _0xcf41=['post','create','put','update','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareOdbc.controller','get','/:id','isAuthenticated','/:id/test'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcf41,0x15c));var _0x1cf4=function(_0x5756c2,_0xa04087){_0x5756c2=_0x5756c2-0x0;var _0xb2ae91=_0xcf41[_0x5756c2];return _0xb2ae91;};'use strict';var multer=require(_0x1cf4('0x0'));var util=require('util');var path=require(_0x1cf4('0x1'));var timeout=require(_0x1cf4('0x2'));var express=require('express');var router=express[_0x1cf4('0x3')]();var fs_extra=require(_0x1cf4('0x4'));var auth=require(_0x1cf4('0x5'));var interaction=require(_0x1cf4('0x6'));var config=require('../../config/environment');var controller=require(_0x1cf4('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1cf4('0x8')](_0x1cf4('0x9'),auth[_0x1cf4('0xa')](),controller['show']);router[_0x1cf4('0x8')](_0x1cf4('0xb'),auth[_0x1cf4('0xa')](),timeout('15s'),controller['test']);router[_0x1cf4('0xc')]('/',auth[_0x1cf4('0xa')](),controller[_0x1cf4('0xd')]);router[_0x1cf4('0xe')](_0x1cf4('0x9'),auth[_0x1cf4('0xa')](),controller[_0x1cf4('0xf')]);router[_0x1cf4('0x10')](_0x1cf4('0x9'),auth[_0x1cf4('0xa')](),controller[_0x1cf4('0x11')]);module['exports']=router; \ No newline at end of file +var _0xf596=['put','destroy','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','test','post'];(function(_0x588c5f,_0x5e6c75){var _0xe23d5b=function(_0x1c24f7){while(--_0x1c24f7){_0x588c5f['push'](_0x588c5f['shift']());}};_0xe23d5b(++_0x5e6c75);}(_0xf596,0x92));var _0x6f59=function(_0x4ca08f,_0x1a1da9){_0x4ca08f=_0x4ca08f-0x0;var _0x48fa19=_0xf596[_0x4ca08f];return _0x48fa19;};'use strict';var multer=require('multer');var util=require(_0x6f59('0x0'));var path=require(_0x6f59('0x1'));var timeout=require('connect-timeout');var express=require(_0x6f59('0x2'));var router=express['Router']();var fs_extra=require(_0x6f59('0x3'));var auth=require(_0x6f59('0x4'));var interaction=require(_0x6f59('0x5'));var config=require(_0x6f59('0x6'));var controller=require(_0x6f59('0x7'));router[_0x6f59('0x8')]('/',auth[_0x6f59('0x9')](),controller[_0x6f59('0xa')]);router[_0x6f59('0x8')](_0x6f59('0xb'),auth[_0x6f59('0x9')](),controller[_0x6f59('0xc')]);router[_0x6f59('0x8')](_0x6f59('0xd'),auth[_0x6f59('0x9')](),timeout('15s'),controller[_0x6f59('0xe')]);router[_0x6f59('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6f59('0x10')](_0x6f59('0xb'),auth[_0x6f59('0x9')](),controller['update']);router['delete'](_0x6f59('0xb'),auth[_0x6f59('0x9')](),controller[_0x6f59('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 7f24a33..c88869f 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 _0x817b=['name','STRING'];(function(_0x4b473d,_0x26561){var _0x1e1b73=function(_0x311ddd){while(--_0x311ddd){_0x4b473d['push'](_0x4b473d['shift']());}};_0x1e1b73(++_0x26561);}(_0x817b,0x1df));var _0xb817=function(_0x12dd1e,_0x28962a){_0x12dd1e=_0x12dd1e-0x0;var _0x383061=_0x817b[_0x12dd1e];return _0x383061;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb817('0x0')],'unique':_0xb817('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0xb817('0x0')]},'description':{'type':Sequelize[_0xb817('0x0')]}}; \ No newline at end of file +var _0x70d7=['exports','STRING','sequelize'];(function(_0x2bd1ec,_0x3fe65f){var _0x2f7577=function(_0x5234fb){while(--_0x5234fb){_0x2bd1ec['push'](_0x2bd1ec['shift']());}};_0x2f7577(++_0x3fe65f);}(_0x70d7,0xfe));var _0x770d=function(_0x49327d,_0x4a484b){_0x49327d=_0x49327d-0x0;var _0x4f2c09=_0x70d7[_0x49327d];return _0x4f2c09;};'use strict';var Sequelize=require(_0x770d('0x0'));module[_0x770d('0x1')]={'name':{'type':Sequelize[_0x770d('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x770d('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index ca63ff0..683a32f 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 _0x65c8=['end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','ODBC','UserProfileResource','sendStatus','error','name','index','map','SquareOdbc','rawAttributes','fieldName','type','model','keys','query','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','intersection','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','test','dsn','odbc','openSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','status'];(function(_0x1a43ec,_0x4a9482){var _0x15b555=function(_0x1915a9){while(--_0x1915a9){_0x1a43ec['push'](_0x1a43ec['shift']());}};_0x15b555(++_0x4a9482);}(_0x65c8,0x93));var _0x865c=function(_0x54a8af,_0x17d6bb){_0x54a8af=_0x54a8af-0x0;var _0x1c6284=_0x65c8[_0x54a8af];return _0x1c6284;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x865c('0x0'));var zipdir=require(_0x865c('0x1'));var jsonpatch=require(_0x865c('0x2'));var rp=require(_0x865c('0x3'));var moment=require(_0x865c('0x4'));var BPromise=require(_0x865c('0x5'));var Mustache=require(_0x865c('0x6'));var util=require(_0x865c('0x7'));var path=require(_0x865c('0x8'));var sox=require(_0x865c('0x9'));var csv=require(_0x865c('0xa'));var ejs=require(_0x865c('0xb'));var fs=require('fs');var fs_extra=require(_0x865c('0xc'));var _=require(_0x865c('0xd'));var squel=require(_0x865c('0xe'));var crypto=require(_0x865c('0xf'));var jsforce=require(_0x865c('0x10'));var deskjs=require(_0x865c('0x11'));var toCsv=require(_0x865c('0xa'));var querystring=require(_0x865c('0x12'));var Papa=require('papaparse');var Redis=require(_0x865c('0x13'));var authService=require(_0x865c('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x865c('0x15'));var hardwareService=require(_0x865c('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x865c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x865c('0x18'));var db=require(_0x865c('0x19'))['db'];function respondWithStatusCode(_0x4b9418,_0x3c0408){_0x3c0408=_0x3c0408||0xcc;return function(_0x1cf36b){if(_0x1cf36b){return _0x4b9418['sendStatus'](_0x3c0408);}return _0x4b9418[_0x865c('0x1a')](_0x3c0408)[_0x865c('0x1b')]();};}function respondWithResult(_0x366682,_0x5966b5){_0x5966b5=_0x5966b5||0xc8;return function(_0x594c86){if(_0x594c86){return _0x366682[_0x865c('0x1a')](_0x5966b5)[_0x865c('0x1c')](_0x594c86);}};}function respondWithFilteredResult(_0x186bf2,_0x1e9c45){return function(_0x2dcd37){if(_0x2dcd37){var _0xc2b593=typeof _0x1e9c45[_0x865c('0x1d')]===_0x865c('0x1e')&&typeof _0x1e9c45[_0x865c('0x1f')]==='undefined';var _0x18d0e8=_0x2dcd37[_0x865c('0x20')];var _0x4a4527=_0xc2b593?0x0:_0x1e9c45[_0x865c('0x1d')];var _0x5360d5=_0xc2b593?_0x2dcd37[_0x865c('0x20')]:_0x1e9c45[_0x865c('0x1d')]+_0x1e9c45['limit'];var _0x4ab666;if(_0x5360d5>=_0x18d0e8){_0x5360d5=_0x18d0e8;_0x4ab666=0xc8;}else{_0x4ab666=0xce;}_0x186bf2[_0x865c('0x1a')](_0x4ab666);return _0x186bf2['set'](_0x865c('0x21'),_0x4a4527+'-'+_0x5360d5+'/'+_0x18d0e8)['json'](_0x2dcd37);}return null;};}function patchUpdates(_0x4a39d3){return function(_0x17f070){try{jsonpatch[_0x865c('0x22')](_0x17f070,_0x4a39d3,!![]);}catch(_0x2c49be){return BPromise[_0x865c('0x23')](_0x2c49be);}return _0x17f070[_0x865c('0x24')]();};}function saveUpdates(_0x27d25a,_0x26e65a){return function(_0x123d1e){if(_0x123d1e){return _0x123d1e[_0x865c('0x25')](_0x27d25a)[_0x865c('0x26')](function(_0x25be09){return _0x25be09;});}return null;};}function removeEntity(_0xcfbd6c,_0x287a46){return function(_0x296b15){if(_0x296b15){return _0x296b15[_0x865c('0x27')]()['then'](function(){var _0x4e572f=_0x296b15['get']({'plain':!![]});var _0x2d5cc0=_0x865c('0x28');return db[_0x865c('0x29')][_0x865c('0x27')]({'where':{'type':_0x2d5cc0,'resourceId':_0x4e572f['id']}})[_0x865c('0x26')](function(){return _0x296b15;});})[_0x865c('0x26')](function(){_0xcfbd6c[_0x865c('0x1a')](0xcc)[_0x865c('0x1b')]();});}};}function handleEntityNotFound(_0xe806f9,_0x72823b){return function(_0x11c532){if(!_0x11c532){_0xe806f9[_0x865c('0x2a')](0x194);}return _0x11c532;};}function handleError(_0x3b2e93,_0x117169){_0x117169=_0x117169||0x1f4;return function(_0x1b1d91){logger[_0x865c('0x2b')](_0x1b1d91['stack']);if(_0x1b1d91[_0x865c('0x2c')]){delete _0x1b1d91[_0x865c('0x2c')];}_0x3b2e93[_0x865c('0x1a')](_0x117169)['send'](_0x1b1d91);};}exports[_0x865c('0x2d')]=function(_0x390ddd,_0x1fc5b8){var _0x16aca5={},_0x103334={},_0x4b1fb9={'count':0x0,'rows':[]};var _0x531b8c=_[_0x865c('0x2e')](db[_0x865c('0x2f')][_0x865c('0x30')],function(_0x100d03){return{'name':_0x100d03[_0x865c('0x31')],'type':_0x100d03[_0x865c('0x32')]['key']};});_0x103334[_0x865c('0x33')]=_['map'](_0x531b8c,'name');_0x103334['query']=_[_0x865c('0x34')](_0x390ddd[_0x865c('0x35')]);_0x103334['filters']=_['intersection'](_0x103334[_0x865c('0x33')],_0x103334[_0x865c('0x35')]);_0x16aca5['attributes']=_['intersection'](_0x103334[_0x865c('0x33')],qs[_0x865c('0x36')](_0x390ddd[_0x865c('0x35')][_0x865c('0x36')]));_0x16aca5['attributes']=_0x16aca5[_0x865c('0x37')][_0x865c('0x38')]?_0x16aca5[_0x865c('0x37')]:_0x103334['model'];if(!_0x390ddd['query'][_0x865c('0x39')](_0x865c('0x3a'))){_0x16aca5[_0x865c('0x1f')]=qs['limit'](_0x390ddd[_0x865c('0x35')][_0x865c('0x1f')]);_0x16aca5[_0x865c('0x1d')]=qs[_0x865c('0x1d')](_0x390ddd[_0x865c('0x35')]['offset']);}_0x16aca5['order']=qs[_0x865c('0x3b')](_0x390ddd[_0x865c('0x35')][_0x865c('0x3b')]);_0x16aca5['where']=qs[_0x865c('0x3c')](_[_0x865c('0x3d')](_0x390ddd['query'],_0x103334['filters']),_0x531b8c);if(_0x390ddd[_0x865c('0x35')][_0x865c('0x3e')]){_0x16aca5[_0x865c('0x3f')]=_['merge'](_0x16aca5[_0x865c('0x3f')],{'$or':_[_0x865c('0x2e')](_0x531b8c,function(_0x2d4c03){if(_0x2d4c03['type']!==_0x865c('0x40')){var _0x5be3dd={};_0x5be3dd[_0x2d4c03['name']]={'$like':'%'+_0x390ddd[_0x865c('0x35')][_0x865c('0x3e')]+'%'};return _0x5be3dd;}})});}_0x16aca5=_[_0x865c('0x41')]({},_0x16aca5,_0x390ddd[_0x865c('0x42')]);var _0x50d405={'where':_0x16aca5[_0x865c('0x3f')]};return db[_0x865c('0x2f')][_0x865c('0x20')](_0x50d405)[_0x865c('0x26')](function(_0x34bcae){_0x4b1fb9[_0x865c('0x20')]=_0x34bcae;if(_0x390ddd[_0x865c('0x35')][_0x865c('0x43')]){_0x16aca5[_0x865c('0x44')]=[{'all':!![]}];}return db[_0x865c('0x2f')][_0x865c('0x45')](_0x16aca5);})[_0x865c('0x26')](function(_0x280bc){_0x4b1fb9[_0x865c('0x46')]=_0x280bc;return _0x4b1fb9;})[_0x865c('0x26')](respondWithFilteredResult(_0x1fc5b8,_0x16aca5))[_0x865c('0x47')](handleError(_0x1fc5b8,null));};exports[_0x865c('0x48')]=function(_0x1c9ef9,_0x2a8860){var _0x46cbd6={'raw':!![],'where':{'id':_0x1c9ef9['params']['id']}},_0x5c3a85={};_0x5c3a85[_0x865c('0x33')]=_[_0x865c('0x34')](db[_0x865c('0x2f')][_0x865c('0x30')]);_0x5c3a85[_0x865c('0x35')]=_[_0x865c('0x34')](_0x1c9ef9[_0x865c('0x35')]);_0x5c3a85[_0x865c('0x3c')]=_[_0x865c('0x49')](_0x5c3a85[_0x865c('0x33')],_0x5c3a85[_0x865c('0x35')]);_0x46cbd6[_0x865c('0x37')]=_['intersection'](_0x5c3a85[_0x865c('0x33')],qs[_0x865c('0x36')](_0x1c9ef9[_0x865c('0x35')][_0x865c('0x36')]));_0x46cbd6[_0x865c('0x37')]=_0x46cbd6[_0x865c('0x37')][_0x865c('0x38')]?_0x46cbd6[_0x865c('0x37')]:_0x5c3a85[_0x865c('0x33')];if(_0x1c9ef9[_0x865c('0x35')][_0x865c('0x43')]){_0x46cbd6['include']=[{'all':!![]}];}_0x46cbd6=_[_0x865c('0x41')]({},_0x46cbd6,_0x1c9ef9[_0x865c('0x42')]);return db[_0x865c('0x2f')][_0x865c('0x4a')](_0x46cbd6)[_0x865c('0x26')](handleEntityNotFound(_0x2a8860,null))[_0x865c('0x26')](respondWithResult(_0x2a8860,null))['catch'](handleError(_0x2a8860,null));};exports[_0x865c('0x4b')]=function(_0x653a5c,_0x4aee1a){return db['SquareOdbc'][_0x865c('0x4b')](_0x653a5c['body'],{})[_0x865c('0x26')](function(_0x43998d){var _0x371834=_0x653a5c[_0x865c('0x4c')]['get']({'plain':!![]});if(!_0x371834)throw new Error(_0x865c('0x4d'));if(_0x371834[_0x865c('0x4e')]===_0x865c('0x4c')){var _0x4530b1=_0x43998d['get']({'plain':!![]});var _0x1ce3c9='ODBC';return db[_0x865c('0x4f')]['find']({'where':{'name':_0x1ce3c9,'userProfileId':_0x371834['userProfileId']},'raw':!![]})['then'](function(_0x3e500a){if(_0x3e500a&&_0x3e500a['autoAssociation']===0x0){return db[_0x865c('0x29')]['create']({'name':_0x4530b1[_0x865c('0x2c')],'resourceId':_0x4530b1['id'],'type':_0x3e500a[_0x865c('0x2c')],'sectionId':_0x3e500a['id']},{})[_0x865c('0x26')](function(){return _0x43998d;});}else{return _0x43998d;}})[_0x865c('0x47')](function(_0xe63d17){logger[_0x865c('0x2b')](_0x865c('0x50'),_0xe63d17);throw _0xe63d17;});}return _0x43998d;})[_0x865c('0x26')](respondWithResult(_0x4aee1a,0xc9))['catch'](handleError(_0x4aee1a,null));};exports[_0x865c('0x25')]=function(_0x2ece00,_0x14bc37){if(_0x2ece00[_0x865c('0x51')]['id']){delete _0x2ece00[_0x865c('0x51')]['id'];}return db[_0x865c('0x2f')][_0x865c('0x4a')]({'where':{'id':_0x2ece00[_0x865c('0x52')]['id']}})[_0x865c('0x26')](handleEntityNotFound(_0x14bc37,null))[_0x865c('0x26')](saveUpdates(_0x2ece00[_0x865c('0x51')],null))[_0x865c('0x26')](respondWithResult(_0x14bc37,null))[_0x865c('0x47')](handleError(_0x14bc37,null));};exports['destroy']=function(_0x5d0b8b,_0x42c179){return db[_0x865c('0x2f')]['find']({'where':{'id':_0x5d0b8b['params']['id']}})['then'](handleEntityNotFound(_0x42c179,null))[_0x865c('0x26')](removeEntity(_0x42c179,null))[_0x865c('0x47')](handleError(_0x42c179,null));};exports[_0x865c('0x53')]=function(_0x2fa675,_0x1398a8,_0x295cbe){var _0x1c50a0;return db[_0x865c('0x2f')][_0x865c('0x4a')]({'where':{'id':_0x2fa675['params']['id']},'attributes':['id',_0x865c('0x54')]})[_0x865c('0x26')](handleEntityNotFound(_0x1398a8,null))[_0x865c('0x26')](function(_0x480a18){if(_0x480a18){var _0x1c3d63=require(_0x865c('0x55'))();_0x1c3d63[_0x865c('0x56')](_0x480a18[_0x865c('0x54')]);_0x1c3d63['closeSync']();return _0x480a18;}})[_0x865c('0x26')](respondWithResult(_0x1398a8,null))['catch'](handleError(_0x1398a8,null));}; \ No newline at end of file +var _0xadc0=['UserProfileResource','stack','name','map','rawAttributes','fieldName','type','key','model','filters','intersection','query','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareOdbc','include','findAll','rows','catch','keys','includeAll','create','body','user','get','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','test','dsn','odbc','closeSync','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','ODBC'];(function(_0x571f9b,_0x335971){var _0x3418a1=function(_0x427177){while(--_0x427177){_0x571f9b['push'](_0x571f9b['shift']());}};_0x3418a1(++_0x335971);}(_0xadc0,0x1bc));var _0x0adc=function(_0x5e68c5,_0x494261){_0x5e68c5=_0x5e68c5-0x0;var _0x309549=_0xadc0[_0x5e68c5];return _0x309549;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0adc('0x0'));var rp=require(_0x0adc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0adc('0x2'));var util=require(_0x0adc('0x3'));var path=require(_0x0adc('0x4'));var sox=require('sox');var csv=require(_0x0adc('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0adc('0x6'));var _=require(_0x0adc('0x7'));var squel=require(_0x0adc('0x8'));var crypto=require('crypto');var jsforce=require(_0x0adc('0x9'));var deskjs=require(_0x0adc('0xa'));var toCsv=require(_0x0adc('0x5'));var querystring=require(_0x0adc('0xb'));var Papa=require(_0x0adc('0xc'));var Redis=require(_0x0adc('0xd'));var authService=require(_0x0adc('0xe'));var qs=require(_0x0adc('0xf'));var as=require(_0x0adc('0x10'));var hardwareService=require(_0x0adc('0x11'));var logger=require(_0x0adc('0x12'))(_0x0adc('0x13'));var utils=require(_0x0adc('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0adc('0x15'))['db'];function respondWithStatusCode(_0x58be9d,_0x277492){_0x277492=_0x277492||0xcc;return function(_0x5c161c){if(_0x5c161c){return _0x58be9d['sendStatus'](_0x277492);}return _0x58be9d[_0x0adc('0x16')](_0x277492)[_0x0adc('0x17')]();};}function respondWithResult(_0x3ff09a,_0x5c8a3e){_0x5c8a3e=_0x5c8a3e||0xc8;return function(_0x14f401){if(_0x14f401){return _0x3ff09a[_0x0adc('0x16')](_0x5c8a3e)[_0x0adc('0x18')](_0x14f401);}};}function respondWithFilteredResult(_0x663f29,_0x480daa){return function(_0x2b7a7f){if(_0x2b7a7f){var _0x36fa46=typeof _0x480daa[_0x0adc('0x19')]===_0x0adc('0x1a')&&typeof _0x480daa[_0x0adc('0x1b')]==='undefined';var _0x3027a2=_0x2b7a7f[_0x0adc('0x1c')];var _0x4f51cd=_0x36fa46?0x0:_0x480daa[_0x0adc('0x19')];var _0x21a6d1=_0x36fa46?_0x2b7a7f[_0x0adc('0x1c')]:_0x480daa[_0x0adc('0x19')]+_0x480daa[_0x0adc('0x1b')];var _0x4ce6d4;if(_0x21a6d1>=_0x3027a2){_0x21a6d1=_0x3027a2;_0x4ce6d4=0xc8;}else{_0x4ce6d4=0xce;}_0x663f29['status'](_0x4ce6d4);return _0x663f29[_0x0adc('0x1d')](_0x0adc('0x1e'),_0x4f51cd+'-'+_0x21a6d1+'/'+_0x3027a2)[_0x0adc('0x18')](_0x2b7a7f);}return null;};}function patchUpdates(_0x1e68af){return function(_0x28f902){try{jsonpatch[_0x0adc('0x1f')](_0x28f902,_0x1e68af,!![]);}catch(_0x1bb5cd){return BPromise['reject'](_0x1bb5cd);}return _0x28f902['save']();};}function saveUpdates(_0x59ab72,_0x446ff6){return function(_0x5d4c3e){if(_0x5d4c3e){return _0x5d4c3e[_0x0adc('0x20')](_0x59ab72)[_0x0adc('0x21')](function(_0x2cb248){return _0x2cb248;});}return null;};}function removeEntity(_0x1d8101,_0x24457e){return function(_0x51f6ac){if(_0x51f6ac){return _0x51f6ac[_0x0adc('0x22')]()['then'](function(){var _0x2634b8=_0x51f6ac['get']({'plain':!![]});var _0x9d1e13=_0x0adc('0x23');return db[_0x0adc('0x24')]['destroy']({'where':{'type':_0x9d1e13,'resourceId':_0x2634b8['id']}})[_0x0adc('0x21')](function(){return _0x51f6ac;});})[_0x0adc('0x21')](function(){_0x1d8101[_0x0adc('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27d8a3,_0x24545e){return function(_0x4be6af){if(!_0x4be6af){_0x27d8a3['sendStatus'](0x194);}return _0x4be6af;};}function handleError(_0xbb4fb8,_0x5773d9){_0x5773d9=_0x5773d9||0x1f4;return function(_0xc342b3){logger['error'](_0xc342b3[_0x0adc('0x25')]);if(_0xc342b3[_0x0adc('0x26')]){delete _0xc342b3['name'];}_0xbb4fb8[_0x0adc('0x16')](_0x5773d9)['send'](_0xc342b3);};}exports['index']=function(_0x2c2dcd,_0xa7685e){var _0x5b2209={},_0x23d8ad={},_0x52fd5b={'count':0x0,'rows':[]};var _0x2f3065=_[_0x0adc('0x27')](db['SquareOdbc'][_0x0adc('0x28')],function(_0x4586bb){return{'name':_0x4586bb[_0x0adc('0x29')],'type':_0x4586bb[_0x0adc('0x2a')][_0x0adc('0x2b')]};});_0x23d8ad[_0x0adc('0x2c')]=_[_0x0adc('0x27')](_0x2f3065,'name');_0x23d8ad['query']=_['keys'](_0x2c2dcd['query']);_0x23d8ad[_0x0adc('0x2d')]=_[_0x0adc('0x2e')](_0x23d8ad[_0x0adc('0x2c')],_0x23d8ad['query']);_0x5b2209['attributes']=_[_0x0adc('0x2e')](_0x23d8ad[_0x0adc('0x2c')],qs['fields'](_0x2c2dcd[_0x0adc('0x2f')][_0x0adc('0x30')]));_0x5b2209[_0x0adc('0x31')]=_0x5b2209['attributes'][_0x0adc('0x32')]?_0x5b2209[_0x0adc('0x31')]:_0x23d8ad[_0x0adc('0x2c')];if(!_0x2c2dcd[_0x0adc('0x2f')]['hasOwnProperty'](_0x0adc('0x33'))){_0x5b2209[_0x0adc('0x1b')]=qs[_0x0adc('0x1b')](_0x2c2dcd[_0x0adc('0x2f')][_0x0adc('0x1b')]);_0x5b2209['offset']=qs[_0x0adc('0x19')](_0x2c2dcd[_0x0adc('0x2f')]['offset']);}_0x5b2209[_0x0adc('0x34')]=qs[_0x0adc('0x35')](_0x2c2dcd[_0x0adc('0x2f')][_0x0adc('0x35')]);_0x5b2209[_0x0adc('0x36')]=qs['filters'](_[_0x0adc('0x37')](_0x2c2dcd[_0x0adc('0x2f')],_0x23d8ad['filters']),_0x2f3065);if(_0x2c2dcd[_0x0adc('0x2f')][_0x0adc('0x38')]){_0x5b2209['where']=_[_0x0adc('0x39')](_0x5b2209['where'],{'$or':_['map'](_0x2f3065,function(_0x29bcce){if(_0x29bcce[_0x0adc('0x2a')]!==_0x0adc('0x3a')){var _0x56af26={};_0x56af26[_0x29bcce[_0x0adc('0x26')]]={'$like':'%'+_0x2c2dcd[_0x0adc('0x2f')]['filter']+'%'};return _0x56af26;}})});}_0x5b2209=_['merge']({},_0x5b2209,_0x2c2dcd[_0x0adc('0x3b')]);var _0x2bf421={'where':_0x5b2209[_0x0adc('0x36')]};return db[_0x0adc('0x3c')][_0x0adc('0x1c')](_0x2bf421)['then'](function(_0x2e9b21){_0x52fd5b[_0x0adc('0x1c')]=_0x2e9b21;if(_0x2c2dcd[_0x0adc('0x2f')]['includeAll']){_0x5b2209[_0x0adc('0x3d')]=[{'all':!![]}];}return db[_0x0adc('0x3c')][_0x0adc('0x3e')](_0x5b2209);})[_0x0adc('0x21')](function(_0x1e261c){_0x52fd5b[_0x0adc('0x3f')]=_0x1e261c;return _0x52fd5b;})['then'](respondWithFilteredResult(_0xa7685e,_0x5b2209))[_0x0adc('0x40')](handleError(_0xa7685e,null));};exports['show']=function(_0x28f148,_0x2c7d7e){var _0x1de6ba={'raw':!![],'where':{'id':_0x28f148['params']['id']}},_0x508655={};_0x508655[_0x0adc('0x2c')]=_[_0x0adc('0x41')](db['SquareOdbc'][_0x0adc('0x28')]);_0x508655[_0x0adc('0x2f')]=_[_0x0adc('0x41')](_0x28f148['query']);_0x508655[_0x0adc('0x2d')]=_[_0x0adc('0x2e')](_0x508655[_0x0adc('0x2c')],_0x508655[_0x0adc('0x2f')]);_0x1de6ba[_0x0adc('0x31')]=_['intersection'](_0x508655['model'],qs[_0x0adc('0x30')](_0x28f148[_0x0adc('0x2f')][_0x0adc('0x30')]));_0x1de6ba['attributes']=_0x1de6ba[_0x0adc('0x31')]['length']?_0x1de6ba['attributes']:_0x508655[_0x0adc('0x2c')];if(_0x28f148[_0x0adc('0x2f')][_0x0adc('0x42')]){_0x1de6ba[_0x0adc('0x3d')]=[{'all':!![]}];}_0x1de6ba=_['merge']({},_0x1de6ba,_0x28f148[_0x0adc('0x3b')]);return db[_0x0adc('0x3c')]['find'](_0x1de6ba)[_0x0adc('0x21')](handleEntityNotFound(_0x2c7d7e,null))[_0x0adc('0x21')](respondWithResult(_0x2c7d7e,null))[_0x0adc('0x40')](handleError(_0x2c7d7e,null));};exports[_0x0adc('0x43')]=function(_0x4bfdca,_0x62e264){return db[_0x0adc('0x3c')]['create'](_0x4bfdca[_0x0adc('0x44')],{})['then'](function(_0x15085b){var _0x4ac607=_0x4bfdca[_0x0adc('0x45')][_0x0adc('0x46')]({'plain':!![]});if(!_0x4ac607)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ac607['role']==='user'){var _0x2a0504=_0x15085b[_0x0adc('0x46')]({'plain':!![]});var _0x174667='ODBC';return db[_0x0adc('0x47')][_0x0adc('0x48')]({'where':{'name':_0x174667,'userProfileId':_0x4ac607[_0x0adc('0x49')]},'raw':!![]})[_0x0adc('0x21')](function(_0x4c2b45){if(_0x4c2b45&&_0x4c2b45['autoAssociation']===0x0){return db[_0x0adc('0x24')][_0x0adc('0x43')]({'name':_0x2a0504[_0x0adc('0x26')],'resourceId':_0x2a0504['id'],'type':_0x4c2b45['name'],'sectionId':_0x4c2b45['id']},{})[_0x0adc('0x21')](function(){return _0x15085b;});}else{return _0x15085b;}})[_0x0adc('0x40')](function(_0x50ac04){logger['error'](_0x0adc('0x4a'),_0x50ac04);throw _0x50ac04;});}return _0x15085b;})[_0x0adc('0x21')](respondWithResult(_0x62e264,0xc9))[_0x0adc('0x40')](handleError(_0x62e264,null));};exports[_0x0adc('0x20')]=function(_0x373794,_0x15e0f0){if(_0x373794[_0x0adc('0x44')]['id']){delete _0x373794['body']['id'];}return db[_0x0adc('0x3c')][_0x0adc('0x48')]({'where':{'id':_0x373794[_0x0adc('0x4b')]['id']}})['then'](handleEntityNotFound(_0x15e0f0,null))['then'](saveUpdates(_0x373794['body'],null))[_0x0adc('0x21')](respondWithResult(_0x15e0f0,null))[_0x0adc('0x40')](handleError(_0x15e0f0,null));};exports[_0x0adc('0x22')]=function(_0x622688,_0x59b630){return db[_0x0adc('0x3c')][_0x0adc('0x48')]({'where':{'id':_0x622688['params']['id']}})[_0x0adc('0x21')](handleEntityNotFound(_0x59b630,null))[_0x0adc('0x21')](removeEntity(_0x59b630,null))['catch'](handleError(_0x59b630,null));};exports[_0x0adc('0x4c')]=function(_0x26c7cb,_0x9a79fd,_0x50e7c7){var _0x222060;return db[_0x0adc('0x3c')]['find']({'where':{'id':_0x26c7cb[_0x0adc('0x4b')]['id']},'attributes':['id',_0x0adc('0x4d')]})['then'](handleEntityNotFound(_0x9a79fd,null))[_0x0adc('0x21')](function(_0x22cf0e){if(_0x22cf0e){var _0xf2cca0=require(_0x0adc('0x4e'))();_0xf2cca0['openSync'](_0x22cf0e['dsn']);_0xf2cca0[_0x0adc('0x4f')]();return _0x22cf0e;}})[_0x0adc('0x21')](respondWithResult(_0x9a79fd,null))[_0x0adc('0x40')](handleError(_0x9a79fd,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index fe08739..d7d60b5 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 _0x9437=['moment','bluebird','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util','../../config/logger'];(function(_0x1d664f,_0x55c9c4){var _0x5663f9=function(_0x47737a){while(--_0x47737a){_0x1d664f['push'](_0x1d664f['shift']());}};_0x5663f9(++_0x55c9c4);}(_0x9437,0xb8));var _0x7943=function(_0xfdd097,_0x4158ae){_0xfdd097=_0xfdd097-0x0;var _0x15234=_0x9437[_0xfdd097];return _0x15234;};'use strict';var _=require(_0x7943('0x0'));var util=require(_0x7943('0x1'));var logger=require(_0x7943('0x2'))('api');var moment=require(_0x7943('0x3'));var BPromise=require(_0x7943('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7943('0x5'));var attributes=require(_0x7943('0x6'));module[_0x7943('0x7')]=function(_0x452047,_0x4298b5){return _0x452047[_0x7943('0x8')](_0x7943('0x9'),attributes,{'tableName':_0x7943('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec9e=['../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xec9e,0x102));var _0xeec9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xec9e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xeec9('0x0'));var util=require('util');var logger=require(_0xeec9('0x1'))(_0xeec9('0x2'));var moment=require(_0xeec9('0x3'));var BPromise=require('bluebird');var rp=require(_0xeec9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeec9('0x5'));var config=require(_0xeec9('0x6'));var attributes=require(_0xeec9('0x7'));module[_0xeec9('0x8')]=function(_0x4bcfa7,_0x4accdf){return _0x4bcfa7[_0xeec9('0x9')](_0xeec9('0xa'),attributes,{'tableName':_0xeec9('0xb'),'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 c2f6a52..09aa126 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 _0x72e8=['request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','message','result','ShowSquareOdbc','SquareOdbc','find','options','raw','where','include','map','model','attributes','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareOdbc,\x20%s,\x20%s'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x72e8,0x188));var _0x872e=function(_0x3225e3,_0x4573ed){_0x3225e3=_0x3225e3-0x0;var _0x5c45d6=_0x72e8[_0x3225e3];return _0x5c45d6;};'use strict';var _=require('lodash');var util=require(_0x872e('0x0'));var moment=require(_0x872e('0x1'));var BPromise=require(_0x872e('0x2'));var rs=require(_0x872e('0x3'));var fs=require('fs');var Redis=require(_0x872e('0x4'));var db=require(_0x872e('0x5'))['db'];var utils=require(_0x872e('0x6'));var logger=require(_0x872e('0x7'))(_0x872e('0x8'));var config=require(_0x872e('0x9'));var jayson=require(_0x872e('0xa'));var client=jayson[_0x872e('0xb')][_0x872e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4b4752,_0x4e7c0f,_0x2265d4){return new BPromise(function(_0x359624,_0x5f5a69){return client['request'](_0x4b4752,_0x2265d4)[_0x872e('0xd')](function(_0x3ff4f3){logger[_0x872e('0xe')](_0x872e('0xf'),_0x4e7c0f,_0x872e('0x10'));logger[_0x872e('0x11')](_0x872e('0x12'),_0x4e7c0f,_0x872e('0x10'),JSON[_0x872e('0x13')](_0x3ff4f3));if(_0x3ff4f3['error']){if(_0x3ff4f3[_0x872e('0x14')]['code']===0x1f4){logger[_0x872e('0x14')](_0x872e('0xf'),_0x4e7c0f,_0x3ff4f3[_0x872e('0x14')][_0x872e('0x15')]);return _0x5f5a69(_0x3ff4f3[_0x872e('0x14')]['message']);}logger[_0x872e('0x14')](_0x872e('0xf'),_0x4e7c0f,_0x3ff4f3[_0x872e('0x14')]['message']);return _0x359624(_0x3ff4f3[_0x872e('0x14')][_0x872e('0x15')]);}else{logger[_0x872e('0xe')](_0x872e('0xf'),_0x4e7c0f,_0x872e('0x10'));_0x359624(_0x3ff4f3[_0x872e('0x16')]['message']);}})['catch'](function(_0x3673d5){logger['error']('SquareOdbc,\x20%s,\x20%s',_0x4e7c0f,_0x3673d5);_0x5f5a69(_0x3673d5);});});}exports[_0x872e('0x17')]=function(_0x4c4e04){var _0x37617e=this;return new Promise(function(_0x531842,_0x2b450d){return db[_0x872e('0x18')][_0x872e('0x19')]({'raw':_0x4c4e04[_0x872e('0x1a')]?_0x4c4e04[_0x872e('0x1a')][_0x872e('0x1b')]===undefined?!![]:![]:!![],'where':_0x4c4e04[_0x872e('0x1a')]?_0x4c4e04[_0x872e('0x1a')][_0x872e('0x1c')]||null:null,'attributes':_0x4c4e04[_0x872e('0x1a')]?_0x4c4e04[_0x872e('0x1a')]['attributes']||null:null,'include':_0x4c4e04[_0x872e('0x1a')]?_0x4c4e04[_0x872e('0x1a')][_0x872e('0x1d')]?_[_0x872e('0x1e')](_0x4c4e04[_0x872e('0x1a')][_0x872e('0x1d')],function(_0x423797){return{'model':db[_0x423797[_0x872e('0x1f')]],'as':_0x423797['as'],'attributes':_0x423797[_0x872e('0x20')],'include':_0x423797[_0x872e('0x1d')]?_['map'](_0x423797[_0x872e('0x1d')],function(_0x3a1303){return{'model':db[_0x3a1303[_0x872e('0x1f')]],'as':_0x3a1303['as'],'attributes':_0x3a1303[_0x872e('0x20')],'include':_0x3a1303[_0x872e('0x1d')]?_[_0x872e('0x1e')](_0x3a1303[_0x872e('0x1d')],function(_0x13a6fa){return{'model':db[_0x13a6fa['model']],'as':_0x13a6fa['as'],'attributes':_0x13a6fa['attributes']};}):[]};}):[]};}):[]:[]})[_0x872e('0xd')](function(_0x4dc1ed){logger[_0x872e('0xe')](_0x872e('0x17'),_0x4c4e04);logger[_0x872e('0x11')](_0x872e('0x17'),_0x4c4e04,JSON[_0x872e('0x13')](_0x4dc1ed));_0x531842(_0x4dc1ed);})[_0x872e('0x21')](function(_0x22f0c7){logger[_0x872e('0x14')]('ShowSquareOdbc',_0x22f0c7[_0x872e('0x15')],_0x4c4e04);_0x2b450d(_0x37617e[_0x872e('0x14')](0x1f4,_0x22f0c7[_0x872e('0x15')]));});});}; \ No newline at end of file +var _0x78df=['rpc','jayson/promise','http','request','then','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','ShowSquareOdbc','SquareOdbc','find','options','where','attributes','include','model','map','lodash','moment','bluebird','../../config/utils','../../config/logger'];(function(_0x3768f3,_0x4a40f1){var _0x526a13=function(_0x350126){while(--_0x350126){_0x3768f3['push'](_0x3768f3['shift']());}};_0x526a13(++_0x4a40f1);}(_0x78df,0x100));var _0xf78d=function(_0x33f03f,_0x110c53){_0x33f03f=_0x33f03f-0x0;var _0x2bf3c9=_0x78df[_0x33f03f];return _0x2bf3c9;};'use strict';var _=require(_0xf78d('0x0'));var util=require('util');var moment=require(_0xf78d('0x1'));var BPromise=require(_0xf78d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf78d('0x3'));var logger=require(_0xf78d('0x4'))(_0xf78d('0x5'));var config=require('../../config/environment');var jayson=require(_0xf78d('0x6'));var client=jayson['client'][_0xf78d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x232c57,_0x1b5c14,_0x2622f9){return new BPromise(function(_0x381122,_0x469706){return client[_0xf78d('0x8')](_0x232c57,_0x2622f9)[_0xf78d('0x9')](function(_0x4d5cf2){logger['info'](_0xf78d('0xa'),_0x1b5c14,'request\x20sent');logger[_0xf78d('0xb')](_0xf78d('0xc'),_0x1b5c14,_0xf78d('0xd'),JSON[_0xf78d('0xe')](_0x4d5cf2));if(_0x4d5cf2[_0xf78d('0xf')]){if(_0x4d5cf2[_0xf78d('0xf')][_0xf78d('0x10')]===0x1f4){logger[_0xf78d('0xf')]('SquareOdbc,\x20%s,\x20%s',_0x1b5c14,_0x4d5cf2[_0xf78d('0xf')][_0xf78d('0x11')]);return _0x469706(_0x4d5cf2[_0xf78d('0xf')]['message']);}logger[_0xf78d('0xf')](_0xf78d('0xa'),_0x1b5c14,_0x4d5cf2['error'][_0xf78d('0x11')]);return _0x381122(_0x4d5cf2['error'][_0xf78d('0x11')]);}else{logger[_0xf78d('0x12')](_0xf78d('0xa'),_0x1b5c14,_0xf78d('0xd'));_0x381122(_0x4d5cf2['result']['message']);}})[_0xf78d('0x13')](function(_0x1059a5){logger[_0xf78d('0xf')](_0xf78d('0xa'),_0x1b5c14,_0x1059a5);_0x469706(_0x1059a5);});});}exports[_0xf78d('0x14')]=function(_0x1a9399){var _0x4bb31b=this;return new Promise(function(_0x3be8db,_0x100f79){return db[_0xf78d('0x15')][_0xf78d('0x16')]({'raw':_0x1a9399[_0xf78d('0x17')]?_0x1a9399['options']['raw']===undefined?!![]:![]:!![],'where':_0x1a9399[_0xf78d('0x17')]?_0x1a9399['options'][_0xf78d('0x18')]||null:null,'attributes':_0x1a9399[_0xf78d('0x17')]?_0x1a9399[_0xf78d('0x17')][_0xf78d('0x19')]||null:null,'include':_0x1a9399[_0xf78d('0x17')]?_0x1a9399[_0xf78d('0x17')]['include']?_['map'](_0x1a9399[_0xf78d('0x17')][_0xf78d('0x1a')],function(_0x287ee7){return{'model':db[_0x287ee7[_0xf78d('0x1b')]],'as':_0x287ee7['as'],'attributes':_0x287ee7[_0xf78d('0x19')],'include':_0x287ee7[_0xf78d('0x1a')]?_[_0xf78d('0x1c')](_0x287ee7[_0xf78d('0x1a')],function(_0x21500c){return{'model':db[_0x21500c['model']],'as':_0x21500c['as'],'attributes':_0x21500c[_0xf78d('0x19')],'include':_0x21500c[_0xf78d('0x1a')]?_['map'](_0x21500c[_0xf78d('0x1a')],function(_0x5646e1){return{'model':db[_0x5646e1[_0xf78d('0x1b')]],'as':_0x5646e1['as'],'attributes':_0x5646e1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x10245a){logger['info'](_0xf78d('0x14'),_0x1a9399);logger[_0xf78d('0xb')](_0xf78d('0x14'),_0x1a9399,JSON[_0xf78d('0xe')](_0x10245a));_0x3be8db(_0x10245a);})[_0xf78d('0x13')](function(_0xb89446){logger[_0xf78d('0xf')](_0xf78d('0x14'),_0xb89446[_0xf78d('0x11')],_0x1a9399);_0x100f79(_0x4bb31b[_0xf78d('0xf')](0x1f4,_0xb89446[_0xf78d('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 8bd755b..e222ed3 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 _0x9e21=['multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./squareProject.controller','index','isAuthenticated','show','post','create','put','delete','exports'];(function(_0x40a62c,_0xe876f4){var _0x23970e=function(_0x29d52c){while(--_0x29d52c){_0x40a62c['push'](_0x40a62c['shift']());}};_0x23970e(++_0xe876f4);}(_0x9e21,0x1d0));var _0x19e2=function(_0x381c49,_0x12595b){_0x381c49=_0x381c49-0x0;var _0x42db9e=_0x9e21[_0x381c49];return _0x42db9e;};'use strict';var multer=require(_0x19e2('0x0'));var util=require('util');var path=require(_0x19e2('0x1'));var timeout=require(_0x19e2('0x2'));var express=require(_0x19e2('0x3'));var router=express[_0x19e2('0x4')]();var fs_extra=require(_0x19e2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x19e2('0x6'));var config=require('../../config/environment');var controller=require(_0x19e2('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x19e2('0x8')]);router['get']('/:id',auth[_0x19e2('0x9')](),controller[_0x19e2('0xa')]);router[_0x19e2('0xb')]('/',auth['isAuthenticated'](),controller[_0x19e2('0xc')]);router[_0x19e2('0xd')]('/:id',auth[_0x19e2('0x9')](),controller['update']);router[_0x19e2('0xe')]('/:id',auth[_0x19e2('0x9')](),controller['destroy']);module[_0x19e2('0xf')]=router; \ No newline at end of file +var _0xc660=['exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','index','/:id','isAuthenticated','show','post','put','update','destroy'];(function(_0x535b59,_0x59eb31){var _0x109a40=function(_0x355d17){while(--_0x355d17){_0x535b59['push'](_0x535b59['shift']());}};_0x109a40(++_0x59eb31);}(_0xc660,0x16a));var _0x0c66=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xc660[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x0c66('0x0'));var util=require(_0x0c66('0x1'));var path=require(_0x0c66('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0c66('0x3')]();var fs_extra=require(_0x0c66('0x4'));var auth=require(_0x0c66('0x5'));var interaction=require(_0x0c66('0x6'));var config=require(_0x0c66('0x7'));var controller=require(_0x0c66('0x8'));router[_0x0c66('0x9')]('/',auth['isAuthenticated'](),controller[_0x0c66('0xa')]);router['get'](_0x0c66('0xb'),auth[_0x0c66('0xc')](),controller[_0x0c66('0xd')]);router[_0x0c66('0xe')]('/',auth[_0x0c66('0xc')](),controller['create']);router[_0x0c66('0xf')](_0x0c66('0xb'),auth[_0x0c66('0xc')](),controller[_0x0c66('0x10')]);router['delete'](_0x0c66('0xb'),auth[_0x0c66('0xc')](),controller[_0x0c66('0x11')]);module[_0x0c66('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index a091f4b..f514bbb 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 _0x5e89=['utf8','production','DATE','STRING','TEXT','BLOB','long','getDataValue','preproduction','toString'];(function(_0x41958d,_0x3ee800){var _0x521c70=function(_0x80135d){while(--_0x80135d){_0x41958d['push'](_0x41958d['shift']());}};_0x521c70(++_0x3ee800);}(_0x5e89,0x19d));var _0x95e8=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x5e89[_0x484e36];return _0xafc85d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x95e8('0x0')]},'notes':{'type':Sequelize[_0x95e8('0x1')]},'preproduction':{'type':Sequelize[_0x95e8('0x2')](_0x95e8('0x3')),'get':function(){if(this[_0x95e8('0x4')]('preproduction')){return this['getDataValue'](_0x95e8('0x5'))[_0x95e8('0x6')](_0x95e8('0x7'));}}},'production':{'type':Sequelize[_0x95e8('0x2')]('long'),'get':function(){if(this[_0x95e8('0x4')](_0x95e8('0x8'))){return this['getDataValue'](_0x95e8('0x8'))[_0x95e8('0x6')](_0x95e8('0x7'));}}},'savedAt':{'type':Sequelize[_0x95e8('0x9')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xd0cd=['name','TEXT','BLOB','long','getDataValue','preproduction','toString','production','utf8','DATE','sequelize','exports','STRING'];(function(_0x26de0e,_0xa9ee8e){var _0x149d7c=function(_0x41d76b){while(--_0x41d76b){_0x26de0e['push'](_0x26de0e['shift']());}};_0x149d7c(++_0xa9ee8e);}(_0xd0cd,0xe7));var _0xdd0c=function(_0x1401e1,_0xabb499){_0x1401e1=_0x1401e1-0x0;var _0x1aab56=_0xd0cd[_0x1401e1];return _0x1aab56;};'use strict';var Sequelize=require(_0xdd0c('0x0'));module[_0xdd0c('0x1')]={'name':{'type':Sequelize[_0xdd0c('0x2')],'unique':_0xdd0c('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0xdd0c('0x4')]},'preproduction':{'type':Sequelize[_0xdd0c('0x5')](_0xdd0c('0x6')),'get':function(){if(this[_0xdd0c('0x7')](_0xdd0c('0x8'))){return this[_0xdd0c('0x7')](_0xdd0c('0x8'))[_0xdd0c('0x9')]('utf8');}}},'production':{'type':Sequelize['BLOB'](_0xdd0c('0x6')),'get':function(){if(this[_0xdd0c('0x7')](_0xdd0c('0xa'))){return this['getDataValue']('production')[_0xdd0c('0x9')](_0xdd0c('0xb'));}}},'savedAt':{'type':Sequelize[_0xdd0c('0xc')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index c021bea..be27830 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 _0x6010=['limit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','catch','params','keys','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','production','ioredis','../../components/parsers/qs','api','redis','localhost','socket.io-emitter','./squareProject.socket','register','status','undefined','count','offset','set','Content-Range','json','update','then','destroy','get','SquareProjects','UserProfileResource','publish','agi','sendStatus','error','stack','name','send','map','SquareProject','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x5958a2,_0x41fd51){var _0x1a563d=function(_0x35ec01){while(--_0x35ec01){_0x5958a2['push'](_0x5958a2['shift']());}};_0x1a563d(++_0x41fd51);}(_0x6010,0x1ee));var _0x0601=function(_0xb736c0,_0x14d462){_0xb736c0=_0xb736c0-0x0;var _0x31d446=_0x6010[_0xb736c0];return _0x31d446;};'use strict';var _=require('lodash');var Redis=require(_0x0601('0x0'));var qs=require(_0x0601('0x1'));var logger=require('../../config/logger')(_0x0601('0x2'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x0601('0x3')]=_['defaults'](config[_0x0601('0x3')],{'host':_0x0601('0x4'),'port':0x18eb});var socket=require(_0x0601('0x5'))(new Redis(config[_0x0601('0x3')]));require(_0x0601('0x6'))[_0x0601('0x7')](socket);function respondWithResult(_0x26cbce,_0x5b5628){_0x5b5628=_0x5b5628||0xc8;return function(_0x20ec38){if(_0x20ec38){return _0x26cbce[_0x0601('0x8')](_0x5b5628)['json'](_0x20ec38);}};}function respondWithFilteredResult(_0x106d3c,_0x18c89f){return function(_0xfacd50){if(_0xfacd50){var _0x55df8f=typeof _0x18c89f['offset']===_0x0601('0x9')&&typeof _0x18c89f['limit']===_0x0601('0x9');var _0x528a4b=_0xfacd50[_0x0601('0xa')];var _0x3f22c0=_0x55df8f?0x0:_0x18c89f[_0x0601('0xb')];var _0x39b81a=_0x55df8f?_0xfacd50[_0x0601('0xa')]:_0x18c89f[_0x0601('0xb')]+_0x18c89f['limit'];var _0x993a62;if(_0x39b81a>=_0x528a4b){_0x39b81a=_0x528a4b;_0x993a62=0xc8;}else{_0x993a62=0xce;}_0x106d3c[_0x0601('0x8')](_0x993a62);return _0x106d3c[_0x0601('0xc')](_0x0601('0xd'),_0x3f22c0+'-'+_0x39b81a+'/'+_0x528a4b)[_0x0601('0xe')](_0xfacd50);}return null;};}function saveUpdates(_0x11b743){return function(_0x44c7a8){if(_0x44c7a8){return _0x44c7a8[_0x0601('0xf')](_0x11b743)[_0x0601('0x10')](function(_0x128ec3){return _0x128ec3;});}return null;};}function removeEntity(_0x2727ad){return function(_0x41e614){if(_0x41e614){return _0x41e614[_0x0601('0x11')]()[_0x0601('0x10')](function(){var _0x36188e=_0x41e614[_0x0601('0x12')]({'plain':!![]});var _0x11d46c=_0x0601('0x13');return db[_0x0601('0x14')][_0x0601('0x11')]({'where':{'type':_0x11d46c,'resourceId':_0x36188e['id']}})[_0x0601('0x10')](function(){return _0x41e614;});})['then'](function(){var _0x2f1089=new Redis(config[_0x0601('0x3')]);_0x2f1089[_0x0601('0x15')](_0x0601('0x16'),JSON['stringify']({'id':_0x41e614['id'],'deleted':!![]}));})[_0x0601('0x10')](function(){_0x2727ad[_0x0601('0x8')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10f7f8){return function(_0x26af88){if(!_0x26af88){_0x10f7f8[_0x0601('0x17')](0x194);}return _0x26af88;};}function handleError(_0x4288be,_0x3045da){_0x3045da=_0x3045da||0x1f4;return function(_0x2a67ff){logger[_0x0601('0x18')](_0x2a67ff[_0x0601('0x19')]);if(_0x2a67ff[_0x0601('0x1a')]){delete _0x2a67ff[_0x0601('0x1a')];}_0x4288be[_0x0601('0x8')](_0x3045da)[_0x0601('0x1b')](_0x2a67ff);};}exports['index']=function(_0x515e2f,_0x18d23e){var _0x45fcc0={},_0x540e3c={},_0x48a3ea={'count':0x0,'rows':[]};var _0x489104=_[_0x0601('0x1c')](db[_0x0601('0x1d')][_0x0601('0x1e')],function(_0x4123df){return{'name':_0x4123df[_0x0601('0x1f')],'type':_0x4123df[_0x0601('0x20')]['key']};});_0x540e3c[_0x0601('0x21')]=_['map'](_0x489104,_0x0601('0x1a'));_0x540e3c[_0x0601('0x22')]=_['keys'](_0x515e2f[_0x0601('0x22')]);_0x540e3c[_0x0601('0x23')]=_[_0x0601('0x24')](_0x540e3c['model'],_0x540e3c[_0x0601('0x22')]);_0x45fcc0['attributes']=_[_0x0601('0x24')](_0x540e3c[_0x0601('0x21')],qs[_0x0601('0x25')](_0x515e2f[_0x0601('0x22')][_0x0601('0x25')]));_0x45fcc0[_0x0601('0x26')]=_0x45fcc0[_0x0601('0x26')][_0x0601('0x27')]?_0x45fcc0[_0x0601('0x26')]:_0x540e3c[_0x0601('0x21')];if(!_0x515e2f[_0x0601('0x22')][_0x0601('0x28')](_0x0601('0x29'))){_0x45fcc0['limit']=qs[_0x0601('0x2a')](_0x515e2f[_0x0601('0x22')][_0x0601('0x2a')]);_0x45fcc0[_0x0601('0xb')]=qs[_0x0601('0xb')](_0x515e2f[_0x0601('0x22')][_0x0601('0xb')]);}_0x45fcc0[_0x0601('0x2b')]=qs[_0x0601('0x2c')](_0x515e2f['query'][_0x0601('0x2c')]);_0x45fcc0['where']=qs['filters'](_[_0x0601('0x2d')](_0x515e2f[_0x0601('0x22')],_0x540e3c['filters']),_0x489104);if(_0x515e2f[_0x0601('0x22')][_0x0601('0x2e')]){_0x45fcc0[_0x0601('0x2f')]=_['merge'](_0x45fcc0[_0x0601('0x2f')],{'$or':_['map'](_0x489104,function(_0x45d1f9){if(_0x45d1f9[_0x0601('0x20')]!==_0x0601('0x30')){var _0x814175={};_0x814175[_0x45d1f9['name']]={'$like':'%'+_0x515e2f[_0x0601('0x22')][_0x0601('0x2e')]+'%'};return _0x814175;}})});}_0x45fcc0=_[_0x0601('0x31')]({},_0x45fcc0,_0x515e2f[_0x0601('0x32')]);var _0x381fc6={'where':_0x45fcc0[_0x0601('0x2f')]};return db[_0x0601('0x1d')][_0x0601('0xa')](_0x381fc6)[_0x0601('0x10')](function(_0x250c77){_0x48a3ea[_0x0601('0xa')]=_0x250c77;if(_0x515e2f[_0x0601('0x22')]['includeAll']){_0x45fcc0[_0x0601('0x33')]=[{'all':!![]}];}return db[_0x0601('0x1d')][_0x0601('0x34')](_0x45fcc0);})[_0x0601('0x10')](function(_0x1c9cbd){_0x48a3ea['rows']=_0x1c9cbd;return _0x48a3ea;})[_0x0601('0x10')](respondWithFilteredResult(_0x18d23e,_0x45fcc0))[_0x0601('0x35')](handleError(_0x18d23e,null));};exports['show']=function(_0x55e1c8,_0x5ab8f8){var _0x515b1a={'raw':![],'where':{'id':_0x55e1c8[_0x0601('0x36')]['id']}},_0x11fa9f={};_0x11fa9f['model']=_[_0x0601('0x37')](db[_0x0601('0x1d')]['rawAttributes']);_0x11fa9f[_0x0601('0x22')]=_[_0x0601('0x37')](_0x55e1c8[_0x0601('0x22')]);_0x11fa9f['filters']=_[_0x0601('0x24')](_0x11fa9f[_0x0601('0x21')],_0x11fa9f['query']);_0x515b1a[_0x0601('0x26')]=_[_0x0601('0x24')](_0x11fa9f[_0x0601('0x21')],qs[_0x0601('0x25')](_0x55e1c8[_0x0601('0x22')][_0x0601('0x25')]));_0x515b1a[_0x0601('0x26')]=_0x515b1a[_0x0601('0x26')][_0x0601('0x27')]?_0x515b1a[_0x0601('0x26')]:_0x11fa9f[_0x0601('0x21')];if(_0x55e1c8[_0x0601('0x22')][_0x0601('0x38')]){_0x515b1a[_0x0601('0x33')]=[{'all':!![]}];}_0x515b1a=_[_0x0601('0x31')]({},_0x515b1a,_0x55e1c8[_0x0601('0x32')]);return db['SquareProject']['find'](_0x515b1a)['then'](handleEntityNotFound(_0x5ab8f8,null))[_0x0601('0x10')](respondWithResult(_0x5ab8f8,null))[_0x0601('0x35')](handleError(_0x5ab8f8,null));};exports[_0x0601('0x39')]=function(_0x7fc3f,_0x2d30bc){return db[_0x0601('0x1d')]['create'](_0x7fc3f[_0x0601('0x3a')],{})[_0x0601('0x10')](function(_0x27f41e){var _0x55ae50=_0x7fc3f[_0x0601('0x3b')][_0x0601('0x12')]({'plain':!![]});if(!_0x55ae50)throw new Error(_0x0601('0x3c'));if(_0x55ae50[_0x0601('0x3d')]===_0x0601('0x3b')){var _0x15a6eb=_0x27f41e[_0x0601('0x12')]({'plain':!![]});var _0x1ef607=_0x0601('0x13');return db[_0x0601('0x3e')][_0x0601('0x3f')]({'where':{'name':_0x1ef607,'userProfileId':_0x55ae50[_0x0601('0x40')]},'raw':!![]})['then'](function(_0x577544){if(_0x577544&&_0x577544[_0x0601('0x41')]===0x0){return db[_0x0601('0x14')]['create']({'name':_0x15a6eb[_0x0601('0x1a')],'resourceId':_0x15a6eb['id'],'type':_0x577544[_0x0601('0x1a')],'sectionId':_0x577544['id']},{})[_0x0601('0x10')](function(){return _0x27f41e;});}else{return _0x27f41e;}})[_0x0601('0x35')](function(_0x1b49e5){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b49e5);throw _0x1b49e5;});}return _0x27f41e;})[_0x0601('0x10')](respondWithResult(_0x2d30bc,0xc9))['catch'](handleError(_0x2d30bc,null));};exports[_0x0601('0xf')]=function(_0x37ed7d,_0x5045d7){if(_0x37ed7d['body']['id']){delete _0x37ed7d[_0x0601('0x3a')]['id'];}return db[_0x0601('0x1d')][_0x0601('0x3f')]({'where':{'id':_0x37ed7d['params']['id']}})[_0x0601('0x10')](handleEntityNotFound(_0x5045d7,null))[_0x0601('0x10')](saveUpdates(_0x37ed7d['body'],null))['then'](function(_0x3375e3){if(!_0x3375e3)return;var _0x390ac7=_0x3375e3[_0x0601('0x12')]({'plain':!![]});return _0x390ac7;})['then'](function(_0x3b3fa3){var _0x25d462=new Redis(config[_0x0601('0x3')]);_0x25d462[_0x0601('0x15')](_0x0601('0x16'),JSON['stringify'](_[_0x0601('0x2d')](_0x3b3fa3,['id',_0x0601('0x1a'),_0x0601('0x42')])));return _0x3b3fa3;})[_0x0601('0x10')](respondWithResult(_0x5045d7,null))[_0x0601('0x35')](handleError(_0x5045d7,null));};exports[_0x0601('0x11')]=function(_0x19a331,_0x34afb2){return db[_0x0601('0x1d')][_0x0601('0x3f')]({'where':{'id':_0x19a331[_0x0601('0x36')]['id']}})['then'](handleEntityNotFound(_0x34afb2,null))[_0x0601('0x10')](removeEntity(_0x34afb2,null))['catch'](handleError(_0x34afb2,null));}; \ No newline at end of file +var _0xaf93=['../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','offset','limit','undefined','count','set','Content-Range','update','destroy','then','get','SquareProjects','UserProfileResource','agi','error','name','index','map','SquareProject','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','keys','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','publish','stringify','production','ioredis','../../components/parsers/qs'];(function(_0x21baab,_0x4f4817){var _0x4bc12f=function(_0x323a82){while(--_0x323a82){_0x21baab['push'](_0x21baab['shift']());}};_0x4bc12f(++_0x4f4817);}(_0xaf93,0x143));var _0x3af9=function(_0x10134a,_0x3f714a){_0x10134a=_0x10134a-0x0;var _0x17386a=_0xaf93[_0x10134a];return _0x17386a;};'use strict';var _=require('lodash');var Redis=require(_0x3af9('0x0'));var qs=require(_0x3af9('0x1'));var logger=require(_0x3af9('0x2'))('api');var config=require('../../config/environment');var db=require(_0x3af9('0x3'))['db'];config[_0x3af9('0x4')]=_[_0x3af9('0x5')](config[_0x3af9('0x4')],{'host':_0x3af9('0x6'),'port':0x18eb});var socket=require(_0x3af9('0x7'))(new Redis(config[_0x3af9('0x4')]));require(_0x3af9('0x8'))[_0x3af9('0x9')](socket);function respondWithResult(_0x577323,_0x32e82a){_0x32e82a=_0x32e82a||0xc8;return function(_0x2cef9c){if(_0x2cef9c){return _0x577323[_0x3af9('0xa')](_0x32e82a)['json'](_0x2cef9c);}};}function respondWithFilteredResult(_0x1d800b,_0x16d4bc){return function(_0x324d42){if(_0x324d42){var _0x33f433=typeof _0x16d4bc[_0x3af9('0xb')]==='undefined'&&typeof _0x16d4bc[_0x3af9('0xc')]===_0x3af9('0xd');var _0x1a7a39=_0x324d42[_0x3af9('0xe')];var _0x47cafb=_0x33f433?0x0:_0x16d4bc[_0x3af9('0xb')];var _0x21919b=_0x33f433?_0x324d42[_0x3af9('0xe')]:_0x16d4bc['offset']+_0x16d4bc[_0x3af9('0xc')];var _0xf49db8;if(_0x21919b>=_0x1a7a39){_0x21919b=_0x1a7a39;_0xf49db8=0xc8;}else{_0xf49db8=0xce;}_0x1d800b[_0x3af9('0xa')](_0xf49db8);return _0x1d800b[_0x3af9('0xf')](_0x3af9('0x10'),_0x47cafb+'-'+_0x21919b+'/'+_0x1a7a39)['json'](_0x324d42);}return null;};}function saveUpdates(_0x3c3b2f){return function(_0x1cb15c){if(_0x1cb15c){return _0x1cb15c[_0x3af9('0x11')](_0x3c3b2f)['then'](function(_0x3db4ee){return _0x3db4ee;});}return null;};}function removeEntity(_0x149c0d){return function(_0x5373be){if(_0x5373be){return _0x5373be[_0x3af9('0x12')]()[_0x3af9('0x13')](function(){var _0x29cfab=_0x5373be[_0x3af9('0x14')]({'plain':!![]});var _0xcaa302=_0x3af9('0x15');return db[_0x3af9('0x16')]['destroy']({'where':{'type':_0xcaa302,'resourceId':_0x29cfab['id']}})[_0x3af9('0x13')](function(){return _0x5373be;});})[_0x3af9('0x13')](function(){var _0x102117=new Redis(config['redis']);_0x102117['publish'](_0x3af9('0x17'),JSON['stringify']({'id':_0x5373be['id'],'deleted':!![]}));})['then'](function(){_0x149c0d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ec61f){return function(_0x4be941){if(!_0x4be941){_0x5ec61f['sendStatus'](0x194);}return _0x4be941;};}function handleError(_0x455591,_0x38688b){_0x38688b=_0x38688b||0x1f4;return function(_0x36d043){logger[_0x3af9('0x18')](_0x36d043['stack']);if(_0x36d043[_0x3af9('0x19')]){delete _0x36d043['name'];}_0x455591[_0x3af9('0xa')](_0x38688b)['send'](_0x36d043);};}exports[_0x3af9('0x1a')]=function(_0x16c015,_0xbe6e94){var _0x2c2769={},_0x7d8e9d={},_0x45028b={'count':0x0,'rows':[]};var _0xc77628=_[_0x3af9('0x1b')](db[_0x3af9('0x1c')][_0x3af9('0x1d')],function(_0x554630){return{'name':_0x554630['fieldName'],'type':_0x554630[_0x3af9('0x1e')]['key']};});_0x7d8e9d[_0x3af9('0x1f')]=_[_0x3af9('0x1b')](_0xc77628,_0x3af9('0x19'));_0x7d8e9d[_0x3af9('0x20')]=_['keys'](_0x16c015[_0x3af9('0x20')]);_0x7d8e9d[_0x3af9('0x21')]=_[_0x3af9('0x22')](_0x7d8e9d[_0x3af9('0x1f')],_0x7d8e9d[_0x3af9('0x20')]);_0x2c2769[_0x3af9('0x23')]=_['intersection'](_0x7d8e9d['model'],qs[_0x3af9('0x24')](_0x16c015[_0x3af9('0x20')][_0x3af9('0x24')]));_0x2c2769['attributes']=_0x2c2769[_0x3af9('0x23')][_0x3af9('0x25')]?_0x2c2769[_0x3af9('0x23')]:_0x7d8e9d[_0x3af9('0x1f')];if(!_0x16c015[_0x3af9('0x20')][_0x3af9('0x26')]('nolimit')){_0x2c2769['limit']=qs[_0x3af9('0xc')](_0x16c015[_0x3af9('0x20')]['limit']);_0x2c2769[_0x3af9('0xb')]=qs[_0x3af9('0xb')](_0x16c015['query'][_0x3af9('0xb')]);}_0x2c2769[_0x3af9('0x27')]=qs[_0x3af9('0x28')](_0x16c015[_0x3af9('0x20')][_0x3af9('0x28')]);_0x2c2769[_0x3af9('0x29')]=qs[_0x3af9('0x21')](_[_0x3af9('0x2a')](_0x16c015[_0x3af9('0x20')],_0x7d8e9d[_0x3af9('0x21')]),_0xc77628);if(_0x16c015[_0x3af9('0x20')][_0x3af9('0x2b')]){_0x2c2769[_0x3af9('0x29')]=_[_0x3af9('0x2c')](_0x2c2769['where'],{'$or':_[_0x3af9('0x1b')](_0xc77628,function(_0x31db53){if(_0x31db53['type']!==_0x3af9('0x2d')){var _0x4d3043={};_0x4d3043[_0x31db53['name']]={'$like':'%'+_0x16c015[_0x3af9('0x20')][_0x3af9('0x2b')]+'%'};return _0x4d3043;}})});}_0x2c2769=_[_0x3af9('0x2c')]({},_0x2c2769,_0x16c015[_0x3af9('0x2e')]);var _0x31bc9d={'where':_0x2c2769[_0x3af9('0x29')]};return db[_0x3af9('0x1c')]['count'](_0x31bc9d)[_0x3af9('0x13')](function(_0x21e393){_0x45028b[_0x3af9('0xe')]=_0x21e393;if(_0x16c015[_0x3af9('0x20')][_0x3af9('0x2f')]){_0x2c2769['include']=[{'all':!![]}];}return db['SquareProject'][_0x3af9('0x30')](_0x2c2769);})[_0x3af9('0x13')](function(_0x577c5c){_0x45028b['rows']=_0x577c5c;return _0x45028b;})[_0x3af9('0x13')](respondWithFilteredResult(_0xbe6e94,_0x2c2769))[_0x3af9('0x31')](handleError(_0xbe6e94,null));};exports[_0x3af9('0x32')]=function(_0x8b2a0,_0x28cc82){var _0x1e92e6={'raw':![],'where':{'id':_0x8b2a0[_0x3af9('0x33')]['id']}},_0x34d054={};_0x34d054[_0x3af9('0x1f')]=_['keys'](db[_0x3af9('0x1c')][_0x3af9('0x1d')]);_0x34d054[_0x3af9('0x20')]=_[_0x3af9('0x34')](_0x8b2a0[_0x3af9('0x20')]);_0x34d054[_0x3af9('0x21')]=_[_0x3af9('0x22')](_0x34d054['model'],_0x34d054['query']);_0x1e92e6[_0x3af9('0x23')]=_[_0x3af9('0x22')](_0x34d054[_0x3af9('0x1f')],qs[_0x3af9('0x24')](_0x8b2a0[_0x3af9('0x20')][_0x3af9('0x24')]));_0x1e92e6[_0x3af9('0x23')]=_0x1e92e6['attributes'][_0x3af9('0x25')]?_0x1e92e6[_0x3af9('0x23')]:_0x34d054[_0x3af9('0x1f')];if(_0x8b2a0[_0x3af9('0x20')]['includeAll']){_0x1e92e6[_0x3af9('0x35')]=[{'all':!![]}];}_0x1e92e6=_[_0x3af9('0x2c')]({},_0x1e92e6,_0x8b2a0['options']);return db['SquareProject'][_0x3af9('0x36')](_0x1e92e6)[_0x3af9('0x13')](handleEntityNotFound(_0x28cc82,null))[_0x3af9('0x13')](respondWithResult(_0x28cc82,null))[_0x3af9('0x31')](handleError(_0x28cc82,null));};exports[_0x3af9('0x37')]=function(_0x47559f,_0x2ea4b7){return db['SquareProject'][_0x3af9('0x37')](_0x47559f[_0x3af9('0x38')],{})[_0x3af9('0x13')](function(_0x394d4d){var _0x1e5688=_0x47559f['user']['get']({'plain':!![]});if(!_0x1e5688)throw new Error(_0x3af9('0x39'));if(_0x1e5688[_0x3af9('0x3a')]===_0x3af9('0x3b')){var _0x1b0566=_0x394d4d['get']({'plain':!![]});var _0x507ee2=_0x3af9('0x15');return db['UserProfileSection'][_0x3af9('0x36')]({'where':{'name':_0x507ee2,'userProfileId':_0x1e5688[_0x3af9('0x3c')]},'raw':!![]})[_0x3af9('0x13')](function(_0xf819d1){if(_0xf819d1&&_0xf819d1['autoAssociation']===0x0){return db[_0x3af9('0x16')]['create']({'name':_0x1b0566[_0x3af9('0x19')],'resourceId':_0x1b0566['id'],'type':_0xf819d1['name'],'sectionId':_0xf819d1['id']},{})[_0x3af9('0x13')](function(){return _0x394d4d;});}else{return _0x394d4d;}})[_0x3af9('0x31')](function(_0x4c1125){logger[_0x3af9('0x18')](_0x3af9('0x3d'),_0x4c1125);throw _0x4c1125;});}return _0x394d4d;})[_0x3af9('0x13')](respondWithResult(_0x2ea4b7,0xc9))[_0x3af9('0x31')](handleError(_0x2ea4b7,null));};exports[_0x3af9('0x11')]=function(_0x21a0de,_0x39eab4){if(_0x21a0de['body']['id']){delete _0x21a0de[_0x3af9('0x38')]['id'];}return db[_0x3af9('0x1c')][_0x3af9('0x36')]({'where':{'id':_0x21a0de[_0x3af9('0x33')]['id']}})['then'](handleEntityNotFound(_0x39eab4,null))['then'](saveUpdates(_0x21a0de[_0x3af9('0x38')],null))[_0x3af9('0x13')](function(_0x4f0a5e){if(!_0x4f0a5e)return;var _0x26416f=_0x4f0a5e[_0x3af9('0x14')]({'plain':!![]});return _0x26416f;})['then'](function(_0x3668e0){var _0x4176a8=new Redis(config['redis']);_0x4176a8[_0x3af9('0x3e')]('agi',JSON[_0x3af9('0x3f')](_[_0x3af9('0x2a')](_0x3668e0,['id','name',_0x3af9('0x40')])));return _0x3668e0;})[_0x3af9('0x13')](respondWithResult(_0x39eab4,null))[_0x3af9('0x31')](handleError(_0x39eab4,null));};exports[_0x3af9('0x12')]=function(_0x12527a,_0x1d0045){return db[_0x3af9('0x1c')][_0x3af9('0x36')]({'where':{'id':_0x12527a[_0x3af9('0x33')]['id']}})[_0x3af9('0x13')](handleEntityNotFound(_0x1d0045,null))[_0x3af9('0x13')](removeEntity(_0x1d0045,null))['catch'](handleError(_0x1d0045,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 9079cb7..edfdb11 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 _0xff07=['exports','events','../../mysqldb','SquareProject','save','remove','emit','hasOwnProperty','hook'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xff07,0x1cc));var _0x7ff0=function(_0x1bb6aa,_0x40fe82){_0x1bb6aa=_0x1bb6aa-0x0;var _0x2ef28e=_0xff07[_0x1bb6aa];return _0x2ef28e;};'use strict';var EventEmitter=require(_0x7ff0('0x0'));var SquareProject=require(_0x7ff0('0x1'))['db'][_0x7ff0('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7ff0('0x3'),'afterUpdate':'update','afterDestroy':_0x7ff0('0x4')};function emitEvent(_0x28517b){return function(_0x585eab,_0x3f86b5,_0x577bdc){SquareProjectEvents[_0x7ff0('0x5')](_0x28517b+':'+_0x585eab['id'],_0x585eab);SquareProjectEvents[_0x7ff0('0x5')](_0x28517b,_0x585eab);_0x577bdc(null);};}for(var e in events){if(events[_0x7ff0('0x6')](e)){var event=events[e];SquareProject[_0x7ff0('0x7')](e,emitEvent(event));}}module[_0x7ff0('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x9e75=['SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4eb05d,_0xbdd9c4){var _0xad239=function(_0x22798b){while(--_0x22798b){_0x4eb05d['push'](_0x4eb05d['shift']());}};_0xad239(++_0xbdd9c4);}(_0x9e75,0x132));var _0x59e7=function(_0x5e9397,_0x4a4b36){_0x5e9397=_0x5e9397-0x0;var _0x50de38=_0x9e75[_0x5e9397];return _0x50de38;};'use strict';var EventEmitter=require(_0x59e7('0x0'));var SquareProject=require(_0x59e7('0x1'))['db'][_0x59e7('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x59e7('0x3')](0x0);var events={'afterCreate':_0x59e7('0x4'),'afterUpdate':_0x59e7('0x5'),'afterDestroy':_0x59e7('0x6')};function emitEvent(_0x30310a){return function(_0x23e4b6,_0x235804,_0x3526e3){SquareProjectEvents[_0x59e7('0x7')](_0x30310a+':'+_0x23e4b6['id'],_0x23e4b6);SquareProjectEvents[_0x59e7('0x7')](_0x30310a,_0x23e4b6);_0x3526e3(null);};}for(var e in events){if(events[_0x59e7('0x8')](e)){var event=events[e];SquareProject[_0x59e7('0x9')](e,emitEvent(event));}}module[_0x59e7('0xa')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 44b5472..57ab879 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 _0x0021=['exports','define','SquareProject','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x0021,0xee));var _0x1002=function(_0x31991b,_0xaf75d2){_0x31991b=_0x31991b-0x0;var _0x307304=_0x0021[_0x31991b];return _0x307304;};'use strict';var _=require(_0x1002('0x0'));var util=require(_0x1002('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1002('0x2'));var BPromise=require(_0x1002('0x3'));var rp=require(_0x1002('0x4'));var fs=require('fs');var path=require(_0x1002('0x5'));var rimraf=require(_0x1002('0x6'));var config=require(_0x1002('0x7'));var attributes=require(_0x1002('0x8'));module[_0x1002('0x9')]=function(_0x33c45b,_0x6e669e){return _0x33c45b[_0x1002('0xa')](_0x1002('0xb'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xca66b8,_0xedf5b4,_0x37e528){if(_0xca66b8[_0x1002('0xc')](_0x1002('0xd'))){_0xca66b8[_0x1002('0xe')]=moment()[_0x1002('0xf')](_0x1002('0x10'));}if(_0xca66b8[_0x1002('0xc')](_0x1002('0x11'))){_0xca66b8[_0x1002('0x12')]=moment()[_0x1002('0xf')](_0x1002('0x10'));}_0x37e528(null,_0xca66b8);}}});}; \ No newline at end of file +var _0x1852=['../../config/environment','./squareProject.attributes','exports','SquareProject','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','api','moment','path','rimraf'];(function(_0x56348b,_0x2eaf26){var _0x2bfa14=function(_0x45c745){while(--_0x45c745){_0x56348b['push'](_0x56348b['shift']());}};_0x2bfa14(++_0x2eaf26);}(_0x1852,0xa4));var _0x2185=function(_0x4f1a5b,_0x2bc292){_0x4f1a5b=_0x4f1a5b-0x0;var _0xc738c5=_0x1852[_0x4f1a5b];return _0xc738c5;};'use strict';var _=require(_0x2185('0x0'));var util=require(_0x2185('0x1'));var logger=require('../../config/logger')(_0x2185('0x2'));var moment=require(_0x2185('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2185('0x4'));var rimraf=require(_0x2185('0x5'));var config=require(_0x2185('0x6'));var attributes=require(_0x2185('0x7'));module[_0x2185('0x8')]=function(_0x25ae57,_0x239dae){return _0x25ae57['define'](_0x2185('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x9726e3,_0x33c7da,_0x13773e){if(_0x9726e3[_0x2185('0xa')](_0x2185('0xb'))){_0x9726e3[_0x2185('0xc')]=moment()[_0x2185('0xd')](_0x2185('0xe'));}if(_0x9726e3['changed'](_0x2185('0xf'))){_0x9726e3[_0x2185('0x10')]=moment()[_0x2185('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x13773e(null,_0x9726e3);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 544eec3..91f337f 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 _0xd2ab=['error','ShowSquareProject','find','where','stringify','lodash','../../mysqldb','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','SquareProject','findAll','options','raw','attributes','limit','map','include','model','then','info','debug','message'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xd2ab,0x1f2));var _0xbd2a=function(_0xb350c8,_0x35544c){_0xb350c8=_0xb350c8-0x0;var _0x59153b=_0xd2ab[_0xb350c8];return _0x59153b;};'use strict';var _=require(_0xbd2a('0x0'));var Redis=require('ioredis');var db=require(_0xbd2a('0x1'))['db'];var logger=require(_0xbd2a('0x2'))('rpc');var config=require(_0xbd2a('0x3'));config[_0xbd2a('0x4')]=_[_0xbd2a('0x5')](config['redis'],{'host':_0xbd2a('0x6'),'port':0x18eb});var socket=require(_0xbd2a('0x7'))(new Redis(config[_0xbd2a('0x4')]));require(_0xbd2a('0x8'))[_0xbd2a('0x9')](socket);exports[_0xbd2a('0xa')]=function(_0x3502e1){var _0x5f4e8d=this;return new Promise(function(_0x3e1bd4,_0x4bde85){return db[_0xbd2a('0xb')][_0xbd2a('0xc')]({'raw':_0x3502e1[_0xbd2a('0xd')]?_0x3502e1[_0xbd2a('0xd')][_0xbd2a('0xe')]===undefined?!![]:![]:!![],'where':_0x3502e1[_0xbd2a('0xd')]?_0x3502e1[_0xbd2a('0xd')]['where']||null:null,'attributes':_0x3502e1[_0xbd2a('0xd')]?_0x3502e1[_0xbd2a('0xd')][_0xbd2a('0xf')]||null:null,'limit':_0x3502e1['options']?_0x3502e1['options'][_0xbd2a('0x10')]||null:null,'include':_0x3502e1[_0xbd2a('0xd')]?_0x3502e1[_0xbd2a('0xd')]['include']?_[_0xbd2a('0x11')](_0x3502e1[_0xbd2a('0xd')][_0xbd2a('0x12')],function(_0x579638){return{'model':db[_0x579638[_0xbd2a('0x13')]],'as':_0x579638['as'],'attributes':_0x579638['attributes'],'include':_0x579638[_0xbd2a('0x12')]?_[_0xbd2a('0x11')](_0x579638[_0xbd2a('0x12')],function(_0x5e6543){return{'model':db[_0x5e6543[_0xbd2a('0x13')]],'as':_0x5e6543['as'],'attributes':_0x5e6543[_0xbd2a('0xf')],'include':_0x5e6543[_0xbd2a('0x12')]?_[_0xbd2a('0x11')](_0x5e6543[_0xbd2a('0x12')],function(_0xf4de36){return{'model':db[_0xf4de36['model']],'as':_0xf4de36['as'],'attributes':_0xf4de36[_0xbd2a('0xf')]};}):[]};}):[]};}):[]:[]})[_0xbd2a('0x14')](function(_0x54761c){logger[_0xbd2a('0x15')](_0xbd2a('0xa'),_0x3502e1);logger[_0xbd2a('0x16')](_0xbd2a('0xa'),_0x3502e1,JSON['stringify'](_0x54761c));_0x3e1bd4(_0x54761c);})['catch'](function(_0x3d563d){logger['error'](_0xbd2a('0xa'),_0x3d563d[_0xbd2a('0x17')],_0x3502e1);_0x4bde85(_0x5f4e8d[_0xbd2a('0x18')](0x1f4,_0x3d563d['message']));});});};exports[_0xbd2a('0x19')]=function(_0x2892f3){var _0x284c86=this;return new Promise(function(_0x26d547,_0x5ee7b8){return db[_0xbd2a('0xb')][_0xbd2a('0x1a')]({'raw':_0x2892f3[_0xbd2a('0xd')]?_0x2892f3[_0xbd2a('0xd')][_0xbd2a('0xe')]===undefined?!![]:![]:!![],'where':_0x2892f3[_0xbd2a('0xd')]?_0x2892f3[_0xbd2a('0xd')][_0xbd2a('0x1b')]||null:null,'attributes':_0x2892f3[_0xbd2a('0xd')]?_0x2892f3[_0xbd2a('0xd')][_0xbd2a('0xf')]||null:null,'include':_0x2892f3[_0xbd2a('0xd')]?_0x2892f3[_0xbd2a('0xd')][_0xbd2a('0x12')]?_['map'](_0x2892f3['options'][_0xbd2a('0x12')],function(_0x3b77a6){return{'model':db[_0x3b77a6[_0xbd2a('0x13')]],'as':_0x3b77a6['as'],'attributes':_0x3b77a6[_0xbd2a('0xf')],'include':_0x3b77a6[_0xbd2a('0x12')]?_[_0xbd2a('0x11')](_0x3b77a6[_0xbd2a('0x12')],function(_0x29bb45){return{'model':db[_0x29bb45['model']],'as':_0x29bb45['as'],'attributes':_0x29bb45[_0xbd2a('0xf')],'include':_0x29bb45[_0xbd2a('0x12')]?_[_0xbd2a('0x11')](_0x29bb45[_0xbd2a('0x12')],function(_0x2ada2c){return{'model':db[_0x2ada2c[_0xbd2a('0x13')]],'as':_0x2ada2c['as'],'attributes':_0x2ada2c['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5cd7b4){logger['info']('ShowSquareProject',_0x2892f3);logger['debug'](_0xbd2a('0x19'),_0x2892f3,JSON[_0xbd2a('0x1c')](_0x5cd7b4));_0x26d547(_0x5cd7b4);})['catch'](function(_0x45a802){logger[_0xbd2a('0x18')]('ShowSquareProject',_0x45a802[_0xbd2a('0x17')],_0x2892f3);_0x5ee7b8(_0x284c86[_0xbd2a('0x18')](0x1f4,_0x45a802[_0xbd2a('0x17')]));});});}; \ No newline at end of file +var _0x70e7=['findAll','options','raw','where','attributes','include','model','map','then','debug','stringify','catch','error','message','ShowSquareProject','find','../../mysqldb','../../config/logger','rpc','../../config/environment','defaults','redis','localhost','socket.io-emitter','register','GetSquareProjects','SquareProject'];(function(_0x4573fb,_0x4cb139){var _0x237a36=function(_0x46c30a){while(--_0x46c30a){_0x4573fb['push'](_0x4573fb['shift']());}};_0x237a36(++_0x4cb139);}(_0x70e7,0x18a));var _0x770e=function(_0x2eef84,_0x52ac4c){_0x2eef84=_0x2eef84-0x0;var _0x545899=_0x70e7[_0x2eef84];return _0x545899;};'use strict';var _=require('lodash');var Redis=require('ioredis');var db=require(_0x770e('0x0'))['db'];var logger=require(_0x770e('0x1'))(_0x770e('0x2'));var config=require(_0x770e('0x3'));config['redis']=_[_0x770e('0x4')](config[_0x770e('0x5')],{'host':_0x770e('0x6'),'port':0x18eb});var socket=require(_0x770e('0x7'))(new Redis(config[_0x770e('0x5')]));require('./squareProject.socket')[_0x770e('0x8')](socket);exports[_0x770e('0x9')]=function(_0x49e169){var _0x3fdda1=this;return new Promise(function(_0x1e4564,_0x15a57a){return db[_0x770e('0xa')][_0x770e('0xb')]({'raw':_0x49e169[_0x770e('0xc')]?_0x49e169['options'][_0x770e('0xd')]===undefined?!![]:![]:!![],'where':_0x49e169[_0x770e('0xc')]?_0x49e169['options'][_0x770e('0xe')]||null:null,'attributes':_0x49e169['options']?_0x49e169['options'][_0x770e('0xf')]||null:null,'limit':_0x49e169['options']?_0x49e169[_0x770e('0xc')]['limit']||null:null,'include':_0x49e169['options']?_0x49e169['options'][_0x770e('0x10')]?_['map'](_0x49e169[_0x770e('0xc')][_0x770e('0x10')],function(_0x464d57){return{'model':db[_0x464d57[_0x770e('0x11')]],'as':_0x464d57['as'],'attributes':_0x464d57[_0x770e('0xf')],'include':_0x464d57[_0x770e('0x10')]?_[_0x770e('0x12')](_0x464d57[_0x770e('0x10')],function(_0x3a0dd1){return{'model':db[_0x3a0dd1[_0x770e('0x11')]],'as':_0x3a0dd1['as'],'attributes':_0x3a0dd1[_0x770e('0xf')],'include':_0x3a0dd1['include']?_[_0x770e('0x12')](_0x3a0dd1[_0x770e('0x10')],function(_0x5b3379){return{'model':db[_0x5b3379[_0x770e('0x11')]],'as':_0x5b3379['as'],'attributes':_0x5b3379[_0x770e('0xf')]};}):[]};}):[]};}):[]:[]})[_0x770e('0x13')](function(_0x3b95a0){logger['info'](_0x770e('0x9'),_0x49e169);logger[_0x770e('0x14')]('GetSquareProjects',_0x49e169,JSON[_0x770e('0x15')](_0x3b95a0));_0x1e4564(_0x3b95a0);})[_0x770e('0x16')](function(_0x4617b6){logger[_0x770e('0x17')](_0x770e('0x9'),_0x4617b6[_0x770e('0x18')],_0x49e169);_0x15a57a(_0x3fdda1[_0x770e('0x17')](0x1f4,_0x4617b6[_0x770e('0x18')]));});});};exports[_0x770e('0x19')]=function(_0x3fb466){var _0x53fc68=this;return new Promise(function(_0x532600,_0x28e7b6){return db['SquareProject'][_0x770e('0x1a')]({'raw':_0x3fb466['options']?_0x3fb466['options'][_0x770e('0xd')]===undefined?!![]:![]:!![],'where':_0x3fb466[_0x770e('0xc')]?_0x3fb466[_0x770e('0xc')][_0x770e('0xe')]||null:null,'attributes':_0x3fb466[_0x770e('0xc')]?_0x3fb466[_0x770e('0xc')][_0x770e('0xf')]||null:null,'include':_0x3fb466[_0x770e('0xc')]?_0x3fb466[_0x770e('0xc')][_0x770e('0x10')]?_['map'](_0x3fb466[_0x770e('0xc')]['include'],function(_0x2e7d59){return{'model':db[_0x2e7d59['model']],'as':_0x2e7d59['as'],'attributes':_0x2e7d59[_0x770e('0xf')],'include':_0x2e7d59[_0x770e('0x10')]?_['map'](_0x2e7d59[_0x770e('0x10')],function(_0x2faff9){return{'model':db[_0x2faff9[_0x770e('0x11')]],'as':_0x2faff9['as'],'attributes':_0x2faff9[_0x770e('0xf')],'include':_0x2faff9[_0x770e('0x10')]?_['map'](_0x2faff9[_0x770e('0x10')],function(_0x597f15){return{'model':db[_0x597f15[_0x770e('0x11')]],'as':_0x597f15['as'],'attributes':_0x597f15[_0x770e('0xf')]};}):[]};}):[]};}):[]:[]})[_0x770e('0x13')](function(_0x2b50c7){logger['info']('ShowSquareProject',_0x3fb466);logger[_0x770e('0x14')](_0x770e('0x19'),_0x3fb466,JSON[_0x770e('0x15')](_0x2b50c7));_0x532600(_0x2b50c7);})['catch'](function(_0x1a2244){logger[_0x770e('0x17')]('ShowSquareProject',_0x1a2244['message'],_0x3fb466);_0x28e7b6(_0x53fc68[_0x770e('0x17')](0x1f4,_0x1a2244['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index a33eb36..b9b8fa6 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 _0x4d93=['remove','removeListener','register','length','squareProject:','./squareProject.events'];(function(_0x5c4868,_0x192f68){var _0x3a9323=function(_0x408d26){while(--_0x408d26){_0x5c4868['push'](_0x5c4868['shift']());}};_0x3a9323(++_0x192f68);}(_0x4d93,0x13d));var _0x34d9=function(_0x47f136,_0x5cfe8e){_0x47f136=_0x47f136-0x0;var _0x25a34b=_0x4d93[_0x47f136];return _0x25a34b;};'use strict';var SquareProjectEvents=require(_0x34d9('0x0'));var events=['save',_0x34d9('0x1'),'update'];function createListener(_0x685fe3,_0x983264){return function(_0x140d04){_0x983264['emit'](_0x685fe3,_0x140d04);};}function removeListener(_0x42f4c5,_0x35eaea){return function(){SquareProjectEvents[_0x34d9('0x2')](_0x42f4c5,_0x35eaea);};}exports[_0x34d9('0x3')]=function(_0x1f52ed){for(var _0x27e949=0x0,_0x4d05bf=events[_0x34d9('0x4')];_0x27e949<_0x4d05bf;_0x27e949++){var _0x1ab81c=events[_0x27e949];var _0x52305a=createListener(_0x34d9('0x5')+_0x1ab81c,_0x1f52ed);SquareProjectEvents['on'](_0x1ab81c,_0x52305a);}}; \ No newline at end of file +var _0xbc48=['remove','emit','removeListener','register','squareProject:'];(function(_0x150bf6,_0x277742){var _0x42dcdb=function(_0x4f3e22){while(--_0x4f3e22){_0x150bf6['push'](_0x150bf6['shift']());}};_0x42dcdb(++_0x277742);}(_0xbc48,0x1e0));var _0x8bc4=function(_0x86e4e6,_0x102ae7){_0x86e4e6=_0x86e4e6-0x0;var _0x38d653=_0xbc48[_0x86e4e6];return _0x38d653;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save',_0x8bc4('0x0'),'update'];function createListener(_0x3114bc,_0xef978b){return function(_0x2ec457){_0xef978b[_0x8bc4('0x1')](_0x3114bc,_0x2ec457);};}function removeListener(_0x4fcba4,_0x17bc35){return function(){SquareProjectEvents[_0x8bc4('0x2')](_0x4fcba4,_0x17bc35);};}exports[_0x8bc4('0x3')]=function(_0x580f8a){for(var _0x34cc42=0x0,_0x199094=events['length'];_0x34cc42<_0x199094;_0x34cc42++){var _0x1bd530=events[_0x34cc42];var _0x2b6d08=createListener(_0x8bc4('0x4')+_0x1bd530,_0x580f8a);SquareProjectEvents['on'](_0x1bd530,_0x2b6d08);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index f1422b9..e666dd9 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put'];(function(_0x22120c,_0x136b37){var _0x319735=function(_0x24e971){while(--_0x24e971){_0x22120c['push'](_0x22120c['shift']());}};_0x319735(++_0x136b37);}(_0x1cb9,0x14e));var _0x91cb=function(_0x106169,_0x5561ec){_0x106169=_0x106169-0x0;var _0x3d58b5=_0x1cb9[_0x106169];return _0x3d58b5;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xb'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router; \ No newline at end of file +var _0x326f=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','download','post','create','put','delete','exports'];(function(_0x5a7242,_0x5bc9e7){var _0x15d862=function(_0x30ea0a){while(--_0x30ea0a){_0x5a7242['push'](_0x5a7242['shift']());}};_0x15d862(++_0x5bc9e7);}(_0x326f,0xd1));var _0xf326=function(_0x20b4ad,_0x5158db){_0x20b4ad=_0x20b4ad-0x0;var _0x3f556a=_0x326f[_0x20b4ad];return _0x3f556a;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0xe')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router[_0xf326('0x10')]('/:id',auth[_0xf326('0xa')](),controller['update']);router[_0xf326('0x11')]('/:id',auth[_0xf326('0xa')](),controller['destroy']);module[_0xf326('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 2f461f3..44e0d0b 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 _0xe14b=['VIRTUAL','lastIndexOf','sequelize','exports','STRING'];(function(_0x1a856a,_0x3d2c5d){var _0x3d61f4=function(_0x3bc2b2){while(--_0x3bc2b2){_0x1a856a['push'](_0x1a856a['shift']());}};_0x3d61f4(++_0x3d2c5d);}(_0xe14b,0x93));var _0xbe14=function(_0x1027c8,_0x54ec2){_0x1027c8=_0x1027c8-0x0;var _0x266bc2=_0xe14b[_0x1027c8];return _0x266bc2;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xbe14('0x2')]},'context':{'type':Sequelize[_0xbe14('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xbe14('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xbe14('0x2')]},'saveName':{'type':Sequelize[_0xbe14('0x2')]},'filename':{'type':Sequelize[_0xbe14('0x2')]},'savePath':{'type':Sequelize[_0xbe14('0x2')]},'format':{'type':Sequelize[_0xbe14('0x3')],'get':function(){var _0x39387e='';var _0x196fca=this['getDataValue']('savePath');if(_0x196fca){_0x39387e=_0x196fca['substring'](_0x196fca[_0xbe14('0x4')]('.'));}return _0x39387e;}}}; \ No newline at end of file +var _0x8958=['savePath','substring','lastIndexOf','exports','STRING','VIRTUAL'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0x8958,0x93));var _0x8895=function(_0x524fe0,_0x6e01fc){_0x524fe0=_0x524fe0-0x0;var _0xbe6f24=_0x8958[_0x524fe0];return _0xbe6f24;};'use strict';var Sequelize=require('sequelize');module[_0x8895('0x0')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x8895('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8895('0x1')]},'dnid':{'type':Sequelize[_0x8895('0x1')]},'projectName':{'type':Sequelize[_0x8895('0x1')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0x8895('0x1')]},'savePath':{'type':Sequelize[_0x8895('0x1')]},'format':{'type':Sequelize[_0x8895('0x2')],'get':function(){var _0x40cec6='';var _0x33013a=this['getDataValue'](_0x8895('0x3'));if(_0x33013a){_0x40cec6=_0x33013a[_0x8895('0x4')](_0x33013a[_0x8895('0x5')]('.'));}return _0x40cec6;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 4fcdd40..cdcbc1e 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 _0xa68c=['catch','show','params','rawAttributes','find','create','body','update','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','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','status','end','undefined','limit','count','offset','Content-Range','reject','save','then','destroy','name','send','index','map','SquareRecording','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filters','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows'];(function(_0x4327fe,_0x4f8040){var _0x138651=function(_0x418acc){while(--_0x418acc){_0x4327fe['push'](_0x4327fe['shift']());}};_0x138651(++_0x4f8040);}(_0xa68c,0x87));var _0xca68=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa68c[_0x110c3d];return _0x226d67;};'use strict';var emlformat=require(_0xca68('0x0'));var rimraf=require(_0xca68('0x1'));var zipdir=require(_0xca68('0x2'));var jsonpatch=require(_0xca68('0x3'));var rp=require(_0xca68('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xca68('0x5'));var util=require(_0xca68('0x6'));var path=require(_0xca68('0x7'));var sox=require(_0xca68('0x8'));var csv=require('to-csv');var ejs=require(_0xca68('0x9'));var fs=require('fs');var fs_extra=require(_0xca68('0xa'));var _=require(_0xca68('0xb'));var squel=require(_0xca68('0xc'));var crypto=require(_0xca68('0xd'));var jsforce=require(_0xca68('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xca68('0xf'));var querystring=require(_0xca68('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xca68('0x11'));var qs=require(_0xca68('0x12'));var as=require(_0xca68('0x13'));var hardwareService=require(_0xca68('0x14'));var logger=require(_0xca68('0x15'))(_0xca68('0x16'));var utils=require(_0xca68('0x17'));var config=require(_0xca68('0x18'));var licenseUtil=require(_0xca68('0x19'));var db=require(_0xca68('0x1a'))['db'];function respondWithStatusCode(_0x56cf54,_0x1592d1){_0x1592d1=_0x1592d1||0xcc;return function(_0x390b1f){if(_0x390b1f){return _0x56cf54[_0xca68('0x1b')](_0x1592d1);}return _0x56cf54[_0xca68('0x1c')](_0x1592d1)[_0xca68('0x1d')]();};}function respondWithResult(_0x15c790,_0x323d18){_0x323d18=_0x323d18||0xc8;return function(_0x15d533){if(_0x15d533){return _0x15c790[_0xca68('0x1c')](_0x323d18)['json'](_0x15d533);}};}function respondWithFilteredResult(_0x56380e,_0x5b41cf){return function(_0x374976){if(_0x374976){var _0x6fb824=typeof _0x5b41cf['offset']===_0xca68('0x1e')&&typeof _0x5b41cf[_0xca68('0x1f')]==='undefined';var _0x4d3997=_0x374976[_0xca68('0x20')];var _0x1cc3cc=_0x6fb824?0x0:_0x5b41cf[_0xca68('0x21')];var _0x9e17d1=_0x6fb824?_0x374976['count']:_0x5b41cf['offset']+_0x5b41cf['limit'];var _0x1f92ff;if(_0x9e17d1>=_0x4d3997){_0x9e17d1=_0x4d3997;_0x1f92ff=0xc8;}else{_0x1f92ff=0xce;}_0x56380e['status'](_0x1f92ff);return _0x56380e['set'](_0xca68('0x22'),_0x1cc3cc+'-'+_0x9e17d1+'/'+_0x4d3997)['json'](_0x374976);}return null;};}function patchUpdates(_0x453373){return function(_0x11d978){try{jsonpatch['apply'](_0x11d978,_0x453373,!![]);}catch(_0x40de7e){return BPromise[_0xca68('0x23')](_0x40de7e);}return _0x11d978[_0xca68('0x24')]();};}function saveUpdates(_0x4cd891,_0x3ee0fd){return function(_0x3a08ed){if(_0x3a08ed){return _0x3a08ed['update'](_0x4cd891)[_0xca68('0x25')](function(_0x24b2f6){return _0x24b2f6;});}return null;};}function removeEntity(_0x286ab9,_0x247568){return function(_0x36e176){if(_0x36e176){return _0x36e176[_0xca68('0x26')]()[_0xca68('0x25')](function(){_0x286ab9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x115958,_0x516f12){return function(_0x317401){if(!_0x317401){_0x115958[_0xca68('0x1b')](0x194);}return _0x317401;};}function handleError(_0x14fdaf,_0x5b1283){_0x5b1283=_0x5b1283||0x1f4;return function(_0x277029){logger['error'](_0x277029['stack']);if(_0x277029[_0xca68('0x27')]){delete _0x277029[_0xca68('0x27')];}_0x14fdaf[_0xca68('0x1c')](_0x5b1283)[_0xca68('0x28')](_0x277029);};}exports[_0xca68('0x29')]=function(_0x12ed03,_0x364780){var _0xe7c68f={},_0x333eff={},_0x549c24={'count':0x0,'rows':[]};var _0x1fb73c=_[_0xca68('0x2a')](db[_0xca68('0x2b')]['rawAttributes'],function(_0x4ef3f0){return{'name':_0x4ef3f0[_0xca68('0x2c')],'type':_0x4ef3f0['type'][_0xca68('0x2d')]};});_0x333eff[_0xca68('0x2e')]=_[_0xca68('0x2a')](_0x1fb73c,_0xca68('0x27'));_0x333eff[_0xca68('0x2f')]=_[_0xca68('0x30')](_0x12ed03[_0xca68('0x2f')]);_0x333eff['filters']=_['intersection'](_0x333eff[_0xca68('0x2e')],_0x333eff['query']);_0xe7c68f[_0xca68('0x31')]=_[_0xca68('0x32')](_0x333eff['model'],qs[_0xca68('0x33')](_0x12ed03[_0xca68('0x2f')][_0xca68('0x33')]));_0xe7c68f[_0xca68('0x31')]=_0xe7c68f[_0xca68('0x31')][_0xca68('0x34')]?_0xe7c68f['attributes']:_0x333eff[_0xca68('0x2e')];if(!_0x12ed03['query'][_0xca68('0x35')](_0xca68('0x36'))){_0xe7c68f[_0xca68('0x1f')]=qs['limit'](_0x12ed03[_0xca68('0x2f')][_0xca68('0x1f')]);_0xe7c68f[_0xca68('0x21')]=qs[_0xca68('0x21')](_0x12ed03[_0xca68('0x2f')][_0xca68('0x21')]);}_0xe7c68f['order']=qs[_0xca68('0x37')](_0x12ed03[_0xca68('0x2f')][_0xca68('0x37')]);_0xe7c68f['where']=qs[_0xca68('0x38')](_['pick'](_0x12ed03[_0xca68('0x2f')],_0x333eff[_0xca68('0x38')]),_0x1fb73c);if(_0x12ed03[_0xca68('0x2f')][_0xca68('0x39')]){_0xe7c68f[_0xca68('0x3a')]=_['merge'](_0xe7c68f[_0xca68('0x3a')],{'$or':_['map'](_0x1fb73c,function(_0x2a0948){if(_0x2a0948[_0xca68('0x3b')]!==_0xca68('0x3c')){var _0x15d80a={};_0x15d80a[_0x2a0948[_0xca68('0x27')]]={'$like':'%'+_0x12ed03[_0xca68('0x2f')][_0xca68('0x39')]+'%'};return _0x15d80a;}})});}_0xe7c68f=_[_0xca68('0x3d')]({},_0xe7c68f,_0x12ed03[_0xca68('0x3e')]);var _0x4edb92={'where':_0xe7c68f[_0xca68('0x3a')]};return db['SquareRecording'][_0xca68('0x20')](_0x4edb92)[_0xca68('0x25')](function(_0x59a525){_0x549c24[_0xca68('0x20')]=_0x59a525;if(_0x12ed03[_0xca68('0x2f')][_0xca68('0x3f')]){_0xe7c68f[_0xca68('0x40')]=[{'all':!![]}];}return db['SquareRecording'][_0xca68('0x41')](_0xe7c68f);})[_0xca68('0x25')](function(_0x38e503){_0x549c24[_0xca68('0x42')]=_0x38e503;return _0x549c24;})['then'](respondWithFilteredResult(_0x364780,_0xe7c68f))[_0xca68('0x43')](handleError(_0x364780,null));};exports[_0xca68('0x44')]=function(_0x181b94,_0x3ce93d){var _0x4ea533={'raw':!![],'where':{'id':_0x181b94[_0xca68('0x45')]['id']}},_0x392c8b={};_0x392c8b[_0xca68('0x2e')]=_['keys'](db['SquareRecording'][_0xca68('0x46')]);_0x392c8b[_0xca68('0x2f')]=_['keys'](_0x181b94[_0xca68('0x2f')]);_0x392c8b[_0xca68('0x38')]=_[_0xca68('0x32')](_0x392c8b[_0xca68('0x2e')],_0x392c8b['query']);_0x4ea533[_0xca68('0x31')]=_[_0xca68('0x32')](_0x392c8b[_0xca68('0x2e')],qs['fields'](_0x181b94['query'][_0xca68('0x33')]));_0x4ea533['attributes']=_0x4ea533[_0xca68('0x31')][_0xca68('0x34')]?_0x4ea533[_0xca68('0x31')]:_0x392c8b['model'];if(_0x181b94['query'][_0xca68('0x3f')]){_0x4ea533[_0xca68('0x40')]=[{'all':!![]}];}_0x4ea533=_[_0xca68('0x3d')]({},_0x4ea533,_0x181b94['options']);return db['SquareRecording'][_0xca68('0x47')](_0x4ea533)[_0xca68('0x25')](handleEntityNotFound(_0x3ce93d,null))['then'](respondWithResult(_0x3ce93d,null))[_0xca68('0x43')](handleError(_0x3ce93d,null));};exports[_0xca68('0x48')]=function(_0x29d0fc,_0x37811e){return db[_0xca68('0x2b')][_0xca68('0x48')](_0x29d0fc[_0xca68('0x49')],{})[_0xca68('0x25')](respondWithResult(_0x37811e,0xc9))[_0xca68('0x43')](handleError(_0x37811e,null));};exports[_0xca68('0x4a')]=function(_0x304048,_0x41ddd0){if(_0x304048[_0xca68('0x49')]['id']){delete _0x304048[_0xca68('0x49')]['id'];}return db[_0xca68('0x2b')]['find']({'where':{'id':_0x304048[_0xca68('0x45')]['id']}})[_0xca68('0x25')](handleEntityNotFound(_0x41ddd0,null))['then'](saveUpdates(_0x304048[_0xca68('0x49')],null))[_0xca68('0x25')](respondWithResult(_0x41ddd0,null))['catch'](handleError(_0x41ddd0,null));};exports[_0xca68('0x4b')]=function(_0xebb294,_0x3e06e8,_0x33bf2f){var _0x416744=require(_0xca68('0x4c'));var _0x2a2a97=![];var _0x244484={};if(_0xebb294[_0xca68('0x2f')][_0xca68('0x3b')]&&_0xebb294[_0xca68('0x2f')][_0xca68('0x3b')]===_0xca68('0x4d')){_0x244484[_0xca68('0x4d')]=_0xebb294['params']['id'];}else{_0x244484['id']=_0xebb294['params']['id'];}return db[_0xca68('0x2b')][_0xca68('0x47')]({'where':_0x244484,'attributes':['id',_0xca68('0x4e'),_0xca68('0x4f')],'raw':!![]})['then'](handleEntityNotFound(_0x3e06e8,null))['then'](function(_0x429e7c){if(_0x429e7c){var _0x2a08e9=_0x429e7c[_0xca68('0x4e')];var _0x3fbdb7=util[_0xca68('0x50')](_0xca68('0x51'),_0x2a08e9);if(fs[_0xca68('0x52')](_0x3fbdb7)){_0x2a2a97=!![];return _0x416744[_0xca68('0x53')](_0x3fbdb7,_0x2a08e9,config[_0xca68('0x54')][_0xca68('0x55')])[_0xca68('0x25')](function(){return _0x429e7c;});}return _0x429e7c;}})[_0xca68('0x25')](function(_0x43a73f){if(_0x43a73f){var _0x3e1dbe=_0x43a73f['savePath'];if(!fs[_0xca68('0x52')](_0x3e1dbe)){throw new db[(_0xca68('0x56'))][(_0xca68('0x57'))](_0xca68('0x58'));}if(_0x43a73f[_0xca68('0x4f')]){return _0x3e06e8['download'](_0x3e1dbe,_0x43a73f[_0xca68('0x4f')]+path[_0xca68('0x59')](_0x3e1dbe),function(){if(_0x2a2a97){fs[_0xca68('0x5a')](_0x3e1dbe);}});}else{return _0x3e06e8[_0xca68('0x4b')](_0x3e1dbe,function(_0x5c8f20){if(_0x2a2a97){fs[_0xca68('0x5a')](_0x3e1dbe);}});}}})[_0xca68('0x43')](function(_0x39b0bd){if(_0x39b0bd[_0xca68('0x5b')]==='SquareRecording\x20not\x20found'){_0x3e06e8['status'](0x194)[_0xca68('0x28')](_0xca68('0x5c'));}else{return handleError(_0x3e06e8,null);}});};exports[_0xca68('0x26')]=function(_0xd7f61d,_0x3be7a4){return db[_0xca68('0x2b')][_0xca68('0x47')]({'where':{'id':_0xd7f61d[_0xca68('0x45')]['id']}})[_0xca68('0x25')](function(_0x53d90a){if(_[_0xca68('0x5d')](_0x53d90a)){throw new ReferenceError(_0xca68('0x5e'));}return _0x53d90a;})[_0xca68('0x25')](function(_0x324857){var _0x4877cd=_0x324857[_0xca68('0x4e')];logger[_0xca68('0x5f')](_0xca68('0x60'),_0x4877cd);if(!_[_0xca68('0x5d')](_0x324857[_0xca68('0x4e')])&&fs[_0xca68('0x52')](_0x4877cd)){logger[_0xca68('0x5f')](_0xca68('0x61')+_0x4877cd+_0xca68('0x62'));fs[_0xca68('0x63')](_0x4877cd);}_0x4877cd=_0x4877cd+_0xca68('0x64');if(!_['isNil'](_0x324857[_0xca68('0x4e')])&&fs[_0xca68('0x52')](_0x4877cd)){logger[_0xca68('0x5f')](_0xca68('0x61')+_0x4877cd+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xca68('0x63')](_0x4877cd);}return _0x324857;})[_0xca68('0x25')](function(_0x4b2c1c){if(!_0x4b2c1c)throw new InternalError();return _0x4b2c1c[_0xca68('0x26')]();})[_0xca68('0x25')](function(){_0x3be7a4[_0xca68('0x1c')](0xcc)[_0xca68('0x1d')]();})['catch'](handleError(_0x3be7a4,null));}; \ No newline at end of file +var _0xf4b9=['type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','keys','rawAttributes','find','create','body','update','download','../../components/encryptor','uniqueid','savePath','filename','decryptFile','recording','existsSync','ValidationError','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../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','then','destroy','error','stack','name','send','index','map','SquareRecording','fieldName'];(function(_0x2b7fd8,_0x14677e){var _0x53d1ac=function(_0x43768c){while(--_0x43768c){_0x2b7fd8['push'](_0x2b7fd8['shift']());}};_0x53d1ac(++_0x14677e);}(_0xf4b9,0xff));var _0x9f4b=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0xf4b9[_0x2fc012];return _0x2891f9;};'use strict';var emlformat=require(_0x9f4b('0x0'));var rimraf=require(_0x9f4b('0x1'));var zipdir=require(_0x9f4b('0x2'));var jsonpatch=require(_0x9f4b('0x3'));var rp=require(_0x9f4b('0x4'));var moment=require(_0x9f4b('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9f4b('0x6'));var path=require(_0x9f4b('0x7'));var sox=require(_0x9f4b('0x8'));var csv=require(_0x9f4b('0x9'));var ejs=require(_0x9f4b('0xa'));var fs=require('fs');var fs_extra=require(_0x9f4b('0xb'));var _=require(_0x9f4b('0xc'));var squel=require('squel');var crypto=require(_0x9f4b('0xd'));var jsforce=require(_0x9f4b('0xe'));var deskjs=require(_0x9f4b('0xf'));var toCsv=require(_0x9f4b('0x9'));var querystring=require(_0x9f4b('0x10'));var Papa=require(_0x9f4b('0x11'));var Redis=require(_0x9f4b('0x12'));var authService=require(_0x9f4b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x9f4b('0x14'));var hardwareService=require(_0x9f4b('0x15'));var logger=require(_0x9f4b('0x16'))(_0x9f4b('0x17'));var utils=require(_0x9f4b('0x18'));var config=require(_0x9f4b('0x19'));var licenseUtil=require(_0x9f4b('0x1a'));var db=require(_0x9f4b('0x1b'))['db'];function respondWithStatusCode(_0x1a5710,_0x222974){_0x222974=_0x222974||0xcc;return function(_0x381836){if(_0x381836){return _0x1a5710[_0x9f4b('0x1c')](_0x222974);}return _0x1a5710[_0x9f4b('0x1d')](_0x222974)[_0x9f4b('0x1e')]();};}function respondWithResult(_0x49fff3,_0x36c465){_0x36c465=_0x36c465||0xc8;return function(_0x2d3b2d){if(_0x2d3b2d){return _0x49fff3[_0x9f4b('0x1d')](_0x36c465)[_0x9f4b('0x1f')](_0x2d3b2d);}};}function respondWithFilteredResult(_0x41dd45,_0xc47ae){return function(_0x53e5ad){if(_0x53e5ad){var _0x138fe1=typeof _0xc47ae[_0x9f4b('0x20')]===_0x9f4b('0x21')&&typeof _0xc47ae[_0x9f4b('0x22')]==='undefined';var _0x299600=_0x53e5ad['count'];var _0xcf5aeb=_0x138fe1?0x0:_0xc47ae[_0x9f4b('0x20')];var _0x56f64d=_0x138fe1?_0x53e5ad[_0x9f4b('0x23')]:_0xc47ae[_0x9f4b('0x20')]+_0xc47ae[_0x9f4b('0x22')];var _0x5ee6ba;if(_0x56f64d>=_0x299600){_0x56f64d=_0x299600;_0x5ee6ba=0xc8;}else{_0x5ee6ba=0xce;}_0x41dd45[_0x9f4b('0x1d')](_0x5ee6ba);return _0x41dd45[_0x9f4b('0x24')](_0x9f4b('0x25'),_0xcf5aeb+'-'+_0x56f64d+'/'+_0x299600)[_0x9f4b('0x1f')](_0x53e5ad);}return null;};}function patchUpdates(_0x3f585e){return function(_0x50924b){try{jsonpatch[_0x9f4b('0x26')](_0x50924b,_0x3f585e,!![]);}catch(_0x443f92){return BPromise[_0x9f4b('0x27')](_0x443f92);}return _0x50924b[_0x9f4b('0x28')]();};}function saveUpdates(_0x220525,_0x40acad){return function(_0x4a642e){if(_0x4a642e){return _0x4a642e['update'](_0x220525)[_0x9f4b('0x29')](function(_0x495ce1){return _0x495ce1;});}return null;};}function removeEntity(_0x3b683f,_0x41a3a4){return function(_0x1ca1f7){if(_0x1ca1f7){return _0x1ca1f7[_0x9f4b('0x2a')]()['then'](function(){_0x3b683f[_0x9f4b('0x1d')](0xcc)[_0x9f4b('0x1e')]();});}};}function handleEntityNotFound(_0x2e1dcb,_0x267d10){return function(_0x203a2e){if(!_0x203a2e){_0x2e1dcb[_0x9f4b('0x1c')](0x194);}return _0x203a2e;};}function handleError(_0x1a3cc7,_0x10df61){_0x10df61=_0x10df61||0x1f4;return function(_0x412401){logger[_0x9f4b('0x2b')](_0x412401[_0x9f4b('0x2c')]);if(_0x412401[_0x9f4b('0x2d')]){delete _0x412401[_0x9f4b('0x2d')];}_0x1a3cc7[_0x9f4b('0x1d')](_0x10df61)[_0x9f4b('0x2e')](_0x412401);};}exports[_0x9f4b('0x2f')]=function(_0x22cd9c,_0x3810ca){var _0x315ed4={},_0xc039c4={},_0x53e121={'count':0x0,'rows':[]};var _0x205493=_[_0x9f4b('0x30')](db[_0x9f4b('0x31')]['rawAttributes'],function(_0x4d965a){return{'name':_0x4d965a[_0x9f4b('0x32')],'type':_0x4d965a[_0x9f4b('0x33')][_0x9f4b('0x34')]};});_0xc039c4[_0x9f4b('0x35')]=_[_0x9f4b('0x30')](_0x205493,'name');_0xc039c4[_0x9f4b('0x36')]=_['keys'](_0x22cd9c[_0x9f4b('0x36')]);_0xc039c4['filters']=_[_0x9f4b('0x37')](_0xc039c4[_0x9f4b('0x35')],_0xc039c4[_0x9f4b('0x36')]);_0x315ed4[_0x9f4b('0x38')]=_['intersection'](_0xc039c4[_0x9f4b('0x35')],qs[_0x9f4b('0x39')](_0x22cd9c[_0x9f4b('0x36')][_0x9f4b('0x39')]));_0x315ed4[_0x9f4b('0x38')]=_0x315ed4['attributes'][_0x9f4b('0x3a')]?_0x315ed4[_0x9f4b('0x38')]:_0xc039c4[_0x9f4b('0x35')];if(!_0x22cd9c['query'][_0x9f4b('0x3b')](_0x9f4b('0x3c'))){_0x315ed4['limit']=qs[_0x9f4b('0x22')](_0x22cd9c[_0x9f4b('0x36')][_0x9f4b('0x22')]);_0x315ed4['offset']=qs['offset'](_0x22cd9c[_0x9f4b('0x36')]['offset']);}_0x315ed4[_0x9f4b('0x3d')]=qs['sort'](_0x22cd9c[_0x9f4b('0x36')][_0x9f4b('0x3e')]);_0x315ed4[_0x9f4b('0x3f')]=qs[_0x9f4b('0x40')](_['pick'](_0x22cd9c[_0x9f4b('0x36')],_0xc039c4[_0x9f4b('0x40')]),_0x205493);if(_0x22cd9c[_0x9f4b('0x36')]['filter']){_0x315ed4[_0x9f4b('0x3f')]=_[_0x9f4b('0x41')](_0x315ed4[_0x9f4b('0x3f')],{'$or':_['map'](_0x205493,function(_0x567b9c){if(_0x567b9c[_0x9f4b('0x33')]!==_0x9f4b('0x42')){var _0x2fdbdb={};_0x2fdbdb[_0x567b9c[_0x9f4b('0x2d')]]={'$like':'%'+_0x22cd9c[_0x9f4b('0x36')][_0x9f4b('0x43')]+'%'};return _0x2fdbdb;}})});}_0x315ed4=_[_0x9f4b('0x41')]({},_0x315ed4,_0x22cd9c[_0x9f4b('0x44')]);var _0x52b476={'where':_0x315ed4[_0x9f4b('0x3f')]};return db['SquareRecording']['count'](_0x52b476)[_0x9f4b('0x29')](function(_0x33d2fa){_0x53e121[_0x9f4b('0x23')]=_0x33d2fa;if(_0x22cd9c[_0x9f4b('0x36')][_0x9f4b('0x45')]){_0x315ed4[_0x9f4b('0x46')]=[{'all':!![]}];}return db[_0x9f4b('0x31')][_0x9f4b('0x47')](_0x315ed4);})[_0x9f4b('0x29')](function(_0x18c311){_0x53e121['rows']=_0x18c311;return _0x53e121;})[_0x9f4b('0x29')](respondWithFilteredResult(_0x3810ca,_0x315ed4))[_0x9f4b('0x48')](handleError(_0x3810ca,null));};exports[_0x9f4b('0x49')]=function(_0x1aff32,_0x5efc37){var _0x4ab713={'raw':!![],'where':{'id':_0x1aff32[_0x9f4b('0x4a')]['id']}},_0x5b6700={};_0x5b6700[_0x9f4b('0x35')]=_[_0x9f4b('0x4b')](db[_0x9f4b('0x31')][_0x9f4b('0x4c')]);_0x5b6700[_0x9f4b('0x36')]=_['keys'](_0x1aff32[_0x9f4b('0x36')]);_0x5b6700['filters']=_[_0x9f4b('0x37')](_0x5b6700[_0x9f4b('0x35')],_0x5b6700[_0x9f4b('0x36')]);_0x4ab713[_0x9f4b('0x38')]=_[_0x9f4b('0x37')](_0x5b6700[_0x9f4b('0x35')],qs[_0x9f4b('0x39')](_0x1aff32['query'][_0x9f4b('0x39')]));_0x4ab713[_0x9f4b('0x38')]=_0x4ab713[_0x9f4b('0x38')][_0x9f4b('0x3a')]?_0x4ab713[_0x9f4b('0x38')]:_0x5b6700['model'];if(_0x1aff32[_0x9f4b('0x36')][_0x9f4b('0x45')]){_0x4ab713[_0x9f4b('0x46')]=[{'all':!![]}];}_0x4ab713=_['merge']({},_0x4ab713,_0x1aff32[_0x9f4b('0x44')]);return db[_0x9f4b('0x31')][_0x9f4b('0x4d')](_0x4ab713)[_0x9f4b('0x29')](handleEntityNotFound(_0x5efc37,null))[_0x9f4b('0x29')](respondWithResult(_0x5efc37,null))[_0x9f4b('0x48')](handleError(_0x5efc37,null));};exports[_0x9f4b('0x4e')]=function(_0x350bae,_0xb9a80e){return db[_0x9f4b('0x31')][_0x9f4b('0x4e')](_0x350bae[_0x9f4b('0x4f')],{})['then'](respondWithResult(_0xb9a80e,0xc9))[_0x9f4b('0x48')](handleError(_0xb9a80e,null));};exports[_0x9f4b('0x50')]=function(_0x36df9f,_0x18a8a6){if(_0x36df9f['body']['id']){delete _0x36df9f[_0x9f4b('0x4f')]['id'];}return db[_0x9f4b('0x31')][_0x9f4b('0x4d')]({'where':{'id':_0x36df9f[_0x9f4b('0x4a')]['id']}})[_0x9f4b('0x29')](handleEntityNotFound(_0x18a8a6,null))[_0x9f4b('0x29')](saveUpdates(_0x36df9f[_0x9f4b('0x4f')],null))[_0x9f4b('0x29')](respondWithResult(_0x18a8a6,null))[_0x9f4b('0x48')](handleError(_0x18a8a6,null));};exports[_0x9f4b('0x51')]=function(_0x2ae40f,_0x3d218d,_0x34edc8){var _0x10f709=require(_0x9f4b('0x52'));var _0xf0c70f=![];var _0x4f68e8={};if(_0x2ae40f[_0x9f4b('0x36')][_0x9f4b('0x33')]&&_0x2ae40f[_0x9f4b('0x36')][_0x9f4b('0x33')]===_0x9f4b('0x53')){_0x4f68e8[_0x9f4b('0x53')]=_0x2ae40f[_0x9f4b('0x4a')]['id'];}else{_0x4f68e8['id']=_0x2ae40f[_0x9f4b('0x4a')]['id'];}return db['SquareRecording'][_0x9f4b('0x4d')]({'where':_0x4f68e8,'attributes':['id',_0x9f4b('0x54'),_0x9f4b('0x55')],'raw':!![]})['then'](handleEntityNotFound(_0x3d218d,null))[_0x9f4b('0x29')](function(_0xccc778){if(_0xccc778){var _0x4b5f98=_0xccc778['savePath'];var _0x587283=util['format']('%s.cypher',_0x4b5f98);if(fs['existsSync'](_0x587283)){_0xf0c70f=!![];return _0x10f709[_0x9f4b('0x56')](_0x587283,_0x4b5f98,config['secrets'][_0x9f4b('0x57')])['then'](function(){return _0xccc778;});}return _0xccc778;}})['then'](function(_0x57919f){if(_0x57919f){var _0x3d67f3=_0x57919f[_0x9f4b('0x54')];if(!fs[_0x9f4b('0x58')](_0x3d67f3)){throw new db['Sequelize'][(_0x9f4b('0x59'))]('SquareRecording\x20not\x20found');}if(_0x57919f['filename']){return _0x3d218d['download'](_0x3d67f3,_0x57919f[_0x9f4b('0x55')]+path[_0x9f4b('0x5a')](_0x3d67f3),function(){if(_0xf0c70f){fs[_0x9f4b('0x5b')](_0x3d67f3);}});}else{return _0x3d218d['download'](_0x3d67f3,function(_0x28bbe0){if(_0xf0c70f){fs[_0x9f4b('0x5b')](_0x3d67f3);}});}}})[_0x9f4b('0x48')](function(_0x2d6ff5){if(_0x2d6ff5[_0x9f4b('0x5c')]==='SquareRecording\x20not\x20found'){_0x3d218d[_0x9f4b('0x1d')](0x194)[_0x9f4b('0x2e')](_0x9f4b('0x5d'));}else{return handleError(_0x3d218d,null);}});};exports[_0x9f4b('0x2a')]=function(_0x236d76,_0x2b8831){return db[_0x9f4b('0x31')][_0x9f4b('0x4d')]({'where':{'id':_0x236d76[_0x9f4b('0x4a')]['id']}})[_0x9f4b('0x29')](function(_0x58e798){if(_[_0x9f4b('0x5e')](_0x58e798)){throw new ReferenceError(_0x9f4b('0x5f'));}return _0x58e798;})[_0x9f4b('0x29')](function(_0x47d71f){var _0x2fea72=_0x47d71f[_0x9f4b('0x54')];logger['info'](_0x9f4b('0x60'),_0x2fea72);if(!_['isNil'](_0x47d71f[_0x9f4b('0x54')])&&fs[_0x9f4b('0x58')](_0x2fea72)){logger[_0x9f4b('0x61')](_0x9f4b('0x62')+_0x2fea72+_0x9f4b('0x63'));fs[_0x9f4b('0x64')](_0x2fea72);}_0x2fea72=_0x2fea72+_0x9f4b('0x65');if(!_['isNil'](_0x47d71f[_0x9f4b('0x54')])&&fs[_0x9f4b('0x58')](_0x2fea72)){logger['info'](_0x9f4b('0x62')+_0x2fea72+_0x9f4b('0x63'));fs['unlinkSync'](_0x2fea72);}return _0x47d71f;})['then'](function(_0x22ae8c){if(!_0x22ae8c)throw new InternalError();return _0x22ae8c[_0x9f4b('0x2a')]();})['then'](function(){_0x2b8831[_0x9f4b('0x1d')](0xcc)[_0x9f4b('0x1e')]();})[_0x9f4b('0x48')](handleError(_0x2b8831,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index f716fbf..b74842b 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 _0x7292=['api','moment','bluebird','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger'];(function(_0x5b8310,_0x77ea6f){var _0xd3ebc1=function(_0x9dfb29){while(--_0x9dfb29){_0x5b8310['push'](_0x5b8310['shift']());}};_0xd3ebc1(++_0x77ea6f);}(_0x7292,0x6d));var _0x2729=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x7292[_0x1beef3];return _0x5af964;};'use strict';var _=require(_0x2729('0x0'));var util=require(_0x2729('0x1'));var logger=require(_0x2729('0x2'))(_0x2729('0x3'));var moment=require(_0x2729('0x4'));var BPromise=require(_0x2729('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2729('0x6'));var rimraf=require(_0x2729('0x7'));var config=require(_0x2729('0x8'));var attributes=require(_0x2729('0x9'));module[_0x2729('0xa')]=function(_0x4db88a,_0x119935){return _0x4db88a[_0x2729('0xb')](_0x2729('0xc'),attributes,{'tableName':_0x2729('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6bab=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SquareRecording','square_recordings'];(function(_0x485907,_0x47224d){var _0x3ed143=function(_0x12e968){while(--_0x12e968){_0x485907['push'](_0x485907['shift']());}};_0x3ed143(++_0x47224d);}(_0x6bab,0x1c7));var _0xb6ba=function(_0x219d87,_0x1cb6f7){_0x219d87=_0x219d87-0x0;var _0x22823d=_0x6bab[_0x219d87];return _0x22823d;};'use strict';var _=require(_0xb6ba('0x0'));var util=require(_0xb6ba('0x1'));var logger=require(_0xb6ba('0x2'))(_0xb6ba('0x3'));var moment=require('moment');var BPromise=require(_0xb6ba('0x4'));var rp=require(_0xb6ba('0x5'));var fs=require('fs');var path=require(_0xb6ba('0x6'));var rimraf=require(_0xb6ba('0x7'));var config=require(_0xb6ba('0x8'));var attributes=require('./squareRecording.attributes');module[_0xb6ba('0x9')]=function(_0x5220a1,_0x176097){return _0x5220a1[_0xb6ba('0xa')](_0xb6ba('0xb'),attributes,{'tableName':_0xb6ba('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 51dc619..ec1c32e 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 _0x3439=['stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s'];(function(_0x14476b,_0xd1a7a4){var _0x24e2e8=function(_0x52ed26){while(--_0x52ed26){_0x14476b['push'](_0x14476b['shift']());}};_0x24e2e8(++_0xd1a7a4);}(_0x3439,0xd3));var _0x9343=function(_0x207c6a,_0x2a257b){_0x207c6a=_0x207c6a-0x0;var _0x4a5dc0=_0x3439[_0x207c6a];return _0x4a5dc0;};'use strict';var _=require(_0x9343('0x0'));var util=require('util');var moment=require(_0x9343('0x1'));var BPromise=require(_0x9343('0x2'));var rs=require(_0x9343('0x3'));var fs=require('fs');var Redis=require(_0x9343('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9343('0x5'));var logger=require(_0x9343('0x6'))(_0x9343('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9343('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5260b2,_0x1371b8,_0x2ae163){return new BPromise(function(_0x2aead7,_0x2730e0){return client['request'](_0x5260b2,_0x2ae163)['then'](function(_0x44d87b){logger[_0x9343('0x9')](_0x9343('0xa'),_0x1371b8,_0x9343('0xb'));logger[_0x9343('0xc')](_0x9343('0xd'),_0x1371b8,_0x9343('0xb'),JSON[_0x9343('0xe')](_0x44d87b));if(_0x44d87b[_0x9343('0xf')]){if(_0x44d87b[_0x9343('0xf')][_0x9343('0x10')]===0x1f4){logger[_0x9343('0xf')]('SquareRecording,\x20%s,\x20%s',_0x1371b8,_0x44d87b['error']['message']);return _0x2730e0(_0x44d87b['error'][_0x9343('0x11')]);}logger[_0x9343('0xf')](_0x9343('0xa'),_0x1371b8,_0x44d87b[_0x9343('0xf')][_0x9343('0x11')]);return _0x2aead7(_0x44d87b[_0x9343('0xf')][_0x9343('0x11')]);}else{logger[_0x9343('0x9')](_0x9343('0xa'),_0x1371b8,_0x9343('0xb'));_0x2aead7(_0x44d87b[_0x9343('0x12')][_0x9343('0x11')]);}})[_0x9343('0x13')](function(_0x3f5ca2){logger[_0x9343('0xf')]('SquareRecording,\x20%s,\x20%s',_0x1371b8,_0x3f5ca2);_0x2730e0(_0x3f5ca2);});});}exports[_0x9343('0x14')]=function(_0x31e205){var _0xce5f74=this;return new Promise(function(_0x2fb402,_0x500408){return db[_0x9343('0x15')][_0x9343('0x16')](_0x31e205['body'],{'raw':_0x31e205[_0x9343('0x17')]?_0x31e205[_0x9343('0x17')][_0x9343('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x1adc9a){logger['info']('CreateSquareRecording',_0x31e205);logger[_0x9343('0xc')]('CreateSquareRecording',_0x31e205,JSON[_0x9343('0xe')](_0x1adc9a));_0x2fb402(_0x1adc9a);})['catch'](function(_0x137c62){logger['error'](_0x9343('0x14'),_0x137c62[_0x9343('0x11')],_0x31e205);_0x500408(_0xce5f74[_0x9343('0xf')](0x1f4,_0x137c62[_0x9343('0x11')]));});});}; \ No newline at end of file +var _0xf594=['CreateSquareRecording','debug','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareRecording,\x20%s,\x20%s','message','result','catch','SquareRecording','create','body','options','info'];(function(_0xf0f9ae,_0x3b02ef){var _0x46b898=function(_0x4ac6ec){while(--_0x4ac6ec){_0xf0f9ae['push'](_0xf0f9ae['shift']());}};_0x46b898(++_0x3b02ef);}(_0xf594,0x1d2));var _0x4f59=function(_0xff2baf,_0x5db4d9){_0xff2baf=_0xff2baf-0x0;var _0x190611=_0xf594[_0xff2baf];return _0x190611;};'use strict';var _=require(_0x4f59('0x0'));var util=require(_0x4f59('0x1'));var moment=require('moment');var BPromise=require(_0x4f59('0x2'));var rs=require(_0x4f59('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4f59('0x4'))['db'];var utils=require(_0x4f59('0x5'));var logger=require(_0x4f59('0x6'))(_0x4f59('0x7'));var config=require(_0x4f59('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4f59('0x9')][_0x4f59('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x167e51,_0x306173,_0x537117){return new BPromise(function(_0x38c622,_0x1417eb){return client[_0x4f59('0xb')](_0x167e51,_0x537117)[_0x4f59('0xc')](function(_0x240585){logger['info']('SquareRecording,\x20%s,\x20%s',_0x306173,_0x4f59('0xd'));logger['debug'](_0x4f59('0xe'),_0x306173,_0x4f59('0xd'),JSON[_0x4f59('0xf')](_0x240585));if(_0x240585[_0x4f59('0x10')]){if(_0x240585['error'][_0x4f59('0x11')]===0x1f4){logger[_0x4f59('0x10')](_0x4f59('0x12'),_0x306173,_0x240585[_0x4f59('0x10')]['message']);return _0x1417eb(_0x240585['error'][_0x4f59('0x13')]);}logger['error'](_0x4f59('0x12'),_0x306173,_0x240585[_0x4f59('0x10')][_0x4f59('0x13')]);return _0x38c622(_0x240585[_0x4f59('0x10')][_0x4f59('0x13')]);}else{logger['info'](_0x4f59('0x12'),_0x306173,_0x4f59('0xd'));_0x38c622(_0x240585[_0x4f59('0x14')][_0x4f59('0x13')]);}})[_0x4f59('0x15')](function(_0x39c592){logger[_0x4f59('0x10')](_0x4f59('0x12'),_0x306173,_0x39c592);_0x1417eb(_0x39c592);});});}exports['CreateSquareRecording']=function(_0x48eb54){var _0x24d765=this;return new Promise(function(_0x5d2782,_0x421a02){return db[_0x4f59('0x16')][_0x4f59('0x17')](_0x48eb54[_0x4f59('0x18')],{'raw':_0x48eb54[_0x4f59('0x19')]?_0x48eb54['options']['raw']===undefined?!![]:![]:!![]})[_0x4f59('0xc')](function(_0x6c2888){logger[_0x4f59('0x1a')](_0x4f59('0x1b'),_0x48eb54);logger[_0x4f59('0x1c')]('CreateSquareRecording',_0x48eb54,JSON[_0x4f59('0xf')](_0x6c2888));_0x5d2782(_0x6c2888);})[_0x4f59('0x15')](function(_0x4d220b){logger['error'](_0x4f59('0x1b'),_0x4d220b[_0x4f59('0x13')],_0x48eb54);_0x421a02(_0x24d765['error'](0x1f4,_0x4d220b[_0x4f59('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index d264015..49761de 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x248c51,_0xdf9962){var _0x28c4ce=function(_0xfd6d44){while(--_0xfd6d44){_0x248c51['push'](_0x248c51['shift']());}};_0x28c4ce(++_0xdf9962);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 5c38dee..4474a51 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 _0x4f1e=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x2473cb,_0x3149dd){var _0x53c48f=function(_0x13d8c3){while(--_0x13d8c3){_0x2473cb['push'](_0x2473cb['shift']());}};_0x53c48f(++_0x3149dd);}(_0x4f1e,0x168));var _0xe4f1=function(_0x1fdd56,_0x16807b){_0x1fdd56=_0x1fdd56-0x0;var _0x38c03f=_0x4f1e[_0x1fdd56];return _0x38c03f;};'use strict';var Sequelize=require(_0xe4f1('0x0'));module[_0xe4f1('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xe4f1('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe4f1('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xe4f1('0x2')]},'calleridname':{'type':Sequelize[_0xe4f1('0x2')]},'callingpres':{'type':Sequelize[_0xe4f1('0x2')]},'callingani2':{'type':Sequelize[_0xe4f1('0x2')]},'callington':{'type':Sequelize[_0xe4f1('0x2')]},'callingtns':{'type':Sequelize[_0xe4f1('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xe4f1('0x2')]},'extension':{'type':Sequelize[_0xe4f1('0x2')]},'priority':{'type':Sequelize[_0xe4f1('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xe4f1('0x2')]},'threadid':{'type':Sequelize[_0xe4f1('0x2')]},'project_name':{'type':Sequelize[_0xe4f1('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xe4f1('0x3')]},'bot':{'type':Sequelize[_0xe4f1('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x9a6b=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x3f27a5,_0x368fdb){var _0x402066=function(_0x3d333e){while(--_0x3d333e){_0x3f27a5['push'](_0x3f27a5['shift']());}};_0x402066(++_0x368fdb);}(_0x9a6b,0xd3));var _0xb9a6=function(_0x403477,_0x30b501){_0x403477=_0x403477-0x0;var _0x131dbc=_0x9a6b[_0x403477];return _0x131dbc;};'use strict';var Sequelize=require(_0xb9a6('0x0'));module[_0xb9a6('0x1')]={'network':{'type':Sequelize[_0xb9a6('0x2')]},'network_script':{'type':Sequelize[_0xb9a6('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xb9a6('0x2')]},'language':{'type':Sequelize[_0xb9a6('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xb9a6('0x2')]},'version':{'type':Sequelize[_0xb9a6('0x2')]},'callerid':{'type':Sequelize[_0xb9a6('0x2')]},'calleridname':{'type':Sequelize[_0xb9a6('0x2')]},'callingpres':{'type':Sequelize[_0xb9a6('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0xb9a6('0x2')]},'callingtns':{'type':Sequelize[_0xb9a6('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0xb9a6('0x2')]},'context':{'type':Sequelize[_0xb9a6('0x2')]},'extension':{'type':Sequelize[_0xb9a6('0x2')]},'priority':{'type':Sequelize[_0xb9a6('0x2')]},'enhanced':{'type':Sequelize[_0xb9a6('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xb9a6('0x2')]},'joinAt':{'type':Sequelize[_0xb9a6('0x3')]},'leaveAt':{'type':Sequelize[_0xb9a6('0x3')]},'bot':{'type':Sequelize[_0xb9a6('0x4')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index fa249a6..50f3026 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 _0xfe69=['length','nolimit','sort','where','filter','merge','includeAll','include','findAll','rows','catch','params','fields','options','find','create','body','destroy','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','error','stack','name','send','index','map','SquareReport','fieldName','key','query','keys','filters','attributes','intersection','model'];(function(_0xe8adac,_0x2e258f){var _0x3bf258=function(_0x2336d9){while(--_0x2336d9){_0xe8adac['push'](_0xe8adac['shift']());}};_0x3bf258(++_0x2e258f);}(_0xfe69,0x12b));var _0x9fe6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfe69[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x9fe6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9fe6('0x1'));var rp=require(_0x9fe6('0x2'));var moment=require(_0x9fe6('0x3'));var BPromise=require(_0x9fe6('0x4'));var Mustache=require(_0x9fe6('0x5'));var util=require(_0x9fe6('0x6'));var path=require(_0x9fe6('0x7'));var sox=require('sox');var csv=require(_0x9fe6('0x8'));var ejs=require(_0x9fe6('0x9'));var fs=require('fs');var fs_extra=require(_0x9fe6('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9fe6('0xb'));var jsforce=require(_0x9fe6('0xc'));var deskjs=require(_0x9fe6('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9fe6('0xe'));var Papa=require(_0x9fe6('0xf'));var Redis=require(_0x9fe6('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9fe6('0x11'));var as=require(_0x9fe6('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9fe6('0x13'))(_0x9fe6('0x14'));var utils=require('../../config/utils');var config=require(_0x9fe6('0x15'));var licenseUtil=require(_0x9fe6('0x16'));var db=require(_0x9fe6('0x17'))['db'];function respondWithStatusCode(_0x4cb82f,_0x35c4e3){_0x35c4e3=_0x35c4e3||0xcc;return function(_0x392dcd){if(_0x392dcd){return _0x4cb82f[_0x9fe6('0x18')](_0x35c4e3);}return _0x4cb82f[_0x9fe6('0x19')](_0x35c4e3)[_0x9fe6('0x1a')]();};}function respondWithResult(_0x2ca5a3,_0x547ba2){_0x547ba2=_0x547ba2||0xc8;return function(_0x51709f){if(_0x51709f){return _0x2ca5a3['status'](_0x547ba2)[_0x9fe6('0x1b')](_0x51709f);}};}function respondWithFilteredResult(_0x18d286,_0x35b847){return function(_0x2252d4){if(_0x2252d4){var _0x13ea85=typeof _0x35b847['offset']===_0x9fe6('0x1c')&&typeof _0x35b847[_0x9fe6('0x1d')]===_0x9fe6('0x1c');var _0x1a9592=_0x2252d4[_0x9fe6('0x1e')];var _0x110e4f=_0x13ea85?0x0:_0x35b847[_0x9fe6('0x1f')];var _0x32ceec=_0x13ea85?_0x2252d4[_0x9fe6('0x1e')]:_0x35b847[_0x9fe6('0x1f')]+_0x35b847[_0x9fe6('0x1d')];var _0x2ddc14;if(_0x32ceec>=_0x1a9592){_0x32ceec=_0x1a9592;_0x2ddc14=0xc8;}else{_0x2ddc14=0xce;}_0x18d286['status'](_0x2ddc14);return _0x18d286[_0x9fe6('0x20')](_0x9fe6('0x21'),_0x110e4f+'-'+_0x32ceec+'/'+_0x1a9592)[_0x9fe6('0x1b')](_0x2252d4);}return null;};}function patchUpdates(_0x427ba2){return function(_0x5a8922){try{jsonpatch['apply'](_0x5a8922,_0x427ba2,!![]);}catch(_0xd4813c){return BPromise['reject'](_0xd4813c);}return _0x5a8922['save']();};}function saveUpdates(_0x1e06bf,_0x5be909){return function(_0x16e843){if(_0x16e843){return _0x16e843[_0x9fe6('0x22')](_0x1e06bf)['then'](function(_0xb44f73){return _0xb44f73;});}return null;};}function removeEntity(_0x14d548,_0x39e386){return function(_0x3dd9ed){if(_0x3dd9ed){return _0x3dd9ed['destroy']()[_0x9fe6('0x23')](function(){_0x14d548[_0x9fe6('0x19')](0xcc)[_0x9fe6('0x1a')]();});}};}function handleEntityNotFound(_0x3c6e4e,_0x1fed5e){return function(_0x920ae1){if(!_0x920ae1){_0x3c6e4e[_0x9fe6('0x18')](0x194);}return _0x920ae1;};}function handleError(_0x206d85,_0x18cc86){_0x18cc86=_0x18cc86||0x1f4;return function(_0x374837){logger[_0x9fe6('0x24')](_0x374837[_0x9fe6('0x25')]);if(_0x374837[_0x9fe6('0x26')]){delete _0x374837[_0x9fe6('0x26')];}_0x206d85[_0x9fe6('0x19')](_0x18cc86)[_0x9fe6('0x27')](_0x374837);};}exports[_0x9fe6('0x28')]=function(_0x3e9fdc,_0x258d90){var _0x491d63={},_0x4c70c0={},_0x32c615={'count':0x0,'rows':[]};var _0x439163=_[_0x9fe6('0x29')](db[_0x9fe6('0x2a')]['rawAttributes'],function(_0x162c93){return{'name':_0x162c93[_0x9fe6('0x2b')],'type':_0x162c93['type'][_0x9fe6('0x2c')]};});_0x4c70c0['model']=_[_0x9fe6('0x29')](_0x439163,'name');_0x4c70c0[_0x9fe6('0x2d')]=_[_0x9fe6('0x2e')](_0x3e9fdc[_0x9fe6('0x2d')]);_0x4c70c0[_0x9fe6('0x2f')]=_['intersection'](_0x4c70c0['model'],_0x4c70c0[_0x9fe6('0x2d')]);_0x491d63[_0x9fe6('0x30')]=_[_0x9fe6('0x31')](_0x4c70c0[_0x9fe6('0x32')],qs['fields'](_0x3e9fdc['query']['fields']));_0x491d63['attributes']=_0x491d63[_0x9fe6('0x30')][_0x9fe6('0x33')]?_0x491d63['attributes']:_0x4c70c0['model'];if(!_0x3e9fdc[_0x9fe6('0x2d')]['hasOwnProperty'](_0x9fe6('0x34'))){_0x491d63[_0x9fe6('0x1d')]=qs[_0x9fe6('0x1d')](_0x3e9fdc['query'][_0x9fe6('0x1d')]);_0x491d63[_0x9fe6('0x1f')]=qs[_0x9fe6('0x1f')](_0x3e9fdc['query'][_0x9fe6('0x1f')]);}_0x491d63['order']=qs[_0x9fe6('0x35')](_0x3e9fdc['query'][_0x9fe6('0x35')]);_0x491d63[_0x9fe6('0x36')]=qs[_0x9fe6('0x2f')](_['pick'](_0x3e9fdc[_0x9fe6('0x2d')],_0x4c70c0[_0x9fe6('0x2f')]),_0x439163);if(_0x3e9fdc[_0x9fe6('0x2d')][_0x9fe6('0x37')]){_0x491d63[_0x9fe6('0x36')]=_[_0x9fe6('0x38')](_0x491d63[_0x9fe6('0x36')],{'$or':_[_0x9fe6('0x29')](_0x439163,function(_0x174fce){if(_0x174fce['type']!=='VIRTUAL'){var _0x1075bc={};_0x1075bc[_0x174fce[_0x9fe6('0x26')]]={'$like':'%'+_0x3e9fdc[_0x9fe6('0x2d')]['filter']+'%'};return _0x1075bc;}})});}_0x491d63=_[_0x9fe6('0x38')]({},_0x491d63,_0x3e9fdc['options']);var _0x204b36={'where':_0x491d63['where']};return db[_0x9fe6('0x2a')][_0x9fe6('0x1e')](_0x204b36)['then'](function(_0x2dff5d){_0x32c615[_0x9fe6('0x1e')]=_0x2dff5d;if(_0x3e9fdc['query'][_0x9fe6('0x39')]){_0x491d63[_0x9fe6('0x3a')]=[{'all':!![]}];}return db[_0x9fe6('0x2a')][_0x9fe6('0x3b')](_0x491d63);})[_0x9fe6('0x23')](function(_0x1ec64f){_0x32c615[_0x9fe6('0x3c')]=_0x1ec64f;return _0x32c615;})[_0x9fe6('0x23')](respondWithFilteredResult(_0x258d90,_0x491d63))[_0x9fe6('0x3d')](handleError(_0x258d90,null));};exports['show']=function(_0x588009,_0x133304){var _0x4fdd4f={'raw':!![],'where':{'id':_0x588009[_0x9fe6('0x3e')]['id']}},_0x1ff690={};_0x1ff690[_0x9fe6('0x32')]=_[_0x9fe6('0x2e')](db[_0x9fe6('0x2a')]['rawAttributes']);_0x1ff690['query']=_[_0x9fe6('0x2e')](_0x588009['query']);_0x1ff690[_0x9fe6('0x2f')]=_[_0x9fe6('0x31')](_0x1ff690[_0x9fe6('0x32')],_0x1ff690['query']);_0x4fdd4f[_0x9fe6('0x30')]=_['intersection'](_0x1ff690['model'],qs[_0x9fe6('0x3f')](_0x588009['query']['fields']));_0x4fdd4f[_0x9fe6('0x30')]=_0x4fdd4f[_0x9fe6('0x30')]['length']?_0x4fdd4f[_0x9fe6('0x30')]:_0x1ff690[_0x9fe6('0x32')];if(_0x588009['query'][_0x9fe6('0x39')]){_0x4fdd4f['include']=[{'all':!![]}];}_0x4fdd4f=_[_0x9fe6('0x38')]({},_0x4fdd4f,_0x588009[_0x9fe6('0x40')]);return db[_0x9fe6('0x2a')][_0x9fe6('0x41')](_0x4fdd4f)[_0x9fe6('0x23')](handleEntityNotFound(_0x133304,null))[_0x9fe6('0x23')](respondWithResult(_0x133304,null))[_0x9fe6('0x3d')](handleError(_0x133304,null));};exports[_0x9fe6('0x42')]=function(_0x45c327,_0x3cdcf1){return db['SquareReport'][_0x9fe6('0x42')](_0x45c327[_0x9fe6('0x43')],{})['then'](respondWithResult(_0x3cdcf1,0xc9))[_0x9fe6('0x3d')](handleError(_0x3cdcf1,null));};exports[_0x9fe6('0x22')]=function(_0x1ba7e9,_0x3f02f7){if(_0x1ba7e9[_0x9fe6('0x43')]['id']){delete _0x1ba7e9['body']['id'];}return db[_0x9fe6('0x2a')][_0x9fe6('0x41')]({'where':{'id':_0x1ba7e9[_0x9fe6('0x3e')]['id']}})[_0x9fe6('0x23')](handleEntityNotFound(_0x3f02f7,null))[_0x9fe6('0x23')](saveUpdates(_0x1ba7e9[_0x9fe6('0x43')],null))['then'](respondWithResult(_0x3f02f7,null))[_0x9fe6('0x3d')](handleError(_0x3f02f7,null));};exports[_0x9fe6('0x44')]=function(_0x490f29,_0x3d60b0){return db[_0x9fe6('0x2a')][_0x9fe6('0x41')]({'where':{'id':_0x490f29[_0x9fe6('0x3e')]['id']}})[_0x9fe6('0x23')](handleEntityNotFound(_0x3d60b0,null))[_0x9fe6('0x23')](removeEntity(_0x3d60b0,null))[_0x9fe6('0x3d')](handleError(_0x3d60b0,null));};exports[_0x9fe6('0x45')]=function(_0x580338,_0x4ca9b6){return db['SquareReport'][_0x9fe6('0x45')]()[_0x9fe6('0x23')](respondWithResult(_0x4ca9b6,null))[_0x9fe6('0x3d')](handleError(_0x4ca9b6,null));}; \ No newline at end of file +var _0x7930=['Content-Range','reject','update','then','destroy','error','stack','name','index','map','SquareReport','rawAttributes','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7930,0xbc));var _0x0793=function(_0x5b327d,_0x570af7){_0x5b327d=_0x5b327d-0x0;var _0x4ac585=_0x7930[_0x5b327d];return _0x4ac585;};'use strict';var emlformat=require(_0x0793('0x0'));var rimraf=require(_0x0793('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0793('0x2'));var rp=require(_0x0793('0x3'));var moment=require(_0x0793('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0793('0x5'));var util=require(_0x0793('0x6'));var path=require(_0x0793('0x7'));var sox=require('sox');var csv=require(_0x0793('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0793('0x9'));var _=require(_0x0793('0xa'));var squel=require(_0x0793('0xb'));var crypto=require(_0x0793('0xc'));var jsforce=require(_0x0793('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0793('0x8'));var querystring=require(_0x0793('0xe'));var Papa=require(_0x0793('0xf'));var Redis=require('ioredis');var authService=require(_0x0793('0x10'));var qs=require(_0x0793('0x11'));var as=require(_0x0793('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0793('0x13'))(_0x0793('0x14'));var utils=require(_0x0793('0x15'));var config=require(_0x0793('0x16'));var licenseUtil=require(_0x0793('0x17'));var db=require(_0x0793('0x18'))['db'];function respondWithStatusCode(_0x333721,_0x2bc883){_0x2bc883=_0x2bc883||0xcc;return function(_0x11f8bd){if(_0x11f8bd){return _0x333721[_0x0793('0x19')](_0x2bc883);}return _0x333721[_0x0793('0x1a')](_0x2bc883)[_0x0793('0x1b')]();};}function respondWithResult(_0x1770cf,_0x3de0a7){_0x3de0a7=_0x3de0a7||0xc8;return function(_0x432304){if(_0x432304){return _0x1770cf['status'](_0x3de0a7)[_0x0793('0x1c')](_0x432304);}};}function respondWithFilteredResult(_0x5e4a49,_0x4c641f){return function(_0x32a125){if(_0x32a125){var _0xa5a07e=typeof _0x4c641f['offset']===_0x0793('0x1d')&&typeof _0x4c641f[_0x0793('0x1e')]==='undefined';var _0x286f70=_0x32a125[_0x0793('0x1f')];var _0x5752d1=_0xa5a07e?0x0:_0x4c641f['offset'];var _0x29e88d=_0xa5a07e?_0x32a125[_0x0793('0x1f')]:_0x4c641f[_0x0793('0x20')]+_0x4c641f[_0x0793('0x1e')];var _0x1d0608;if(_0x29e88d>=_0x286f70){_0x29e88d=_0x286f70;_0x1d0608=0xc8;}else{_0x1d0608=0xce;}_0x5e4a49[_0x0793('0x1a')](_0x1d0608);return _0x5e4a49[_0x0793('0x21')](_0x0793('0x22'),_0x5752d1+'-'+_0x29e88d+'/'+_0x286f70)[_0x0793('0x1c')](_0x32a125);}return null;};}function patchUpdates(_0x4c8a1d){return function(_0x2ee558){try{jsonpatch['apply'](_0x2ee558,_0x4c8a1d,!![]);}catch(_0x5b4932){return BPromise[_0x0793('0x23')](_0x5b4932);}return _0x2ee558['save']();};}function saveUpdates(_0x372543,_0x494b06){return function(_0x27f765){if(_0x27f765){return _0x27f765[_0x0793('0x24')](_0x372543)[_0x0793('0x25')](function(_0x11b113){return _0x11b113;});}return null;};}function removeEntity(_0x2106bb,_0x1ebe48){return function(_0x113437){if(_0x113437){return _0x113437[_0x0793('0x26')]()[_0x0793('0x25')](function(){_0x2106bb[_0x0793('0x1a')](0xcc)[_0x0793('0x1b')]();});}};}function handleEntityNotFound(_0x466c54,_0x43e755){return function(_0x599d34){if(!_0x599d34){_0x466c54[_0x0793('0x19')](0x194);}return _0x599d34;};}function handleError(_0x458ca6,_0x2634ef){_0x2634ef=_0x2634ef||0x1f4;return function(_0x4cc837){logger[_0x0793('0x27')](_0x4cc837[_0x0793('0x28')]);if(_0x4cc837[_0x0793('0x29')]){delete _0x4cc837['name'];}_0x458ca6['status'](_0x2634ef)['send'](_0x4cc837);};}exports[_0x0793('0x2a')]=function(_0x2a3e5d,_0x49e7f1){var _0x8cc573={},_0x118453={},_0x359a1c={'count':0x0,'rows':[]};var _0x483ea2=_[_0x0793('0x2b')](db[_0x0793('0x2c')][_0x0793('0x2d')],function(_0x3a9dc8){return{'name':_0x3a9dc8['fieldName'],'type':_0x3a9dc8[_0x0793('0x2e')][_0x0793('0x2f')]};});_0x118453[_0x0793('0x30')]=_[_0x0793('0x2b')](_0x483ea2,_0x0793('0x29'));_0x118453['query']=_[_0x0793('0x31')](_0x2a3e5d['query']);_0x118453[_0x0793('0x32')]=_[_0x0793('0x33')](_0x118453[_0x0793('0x30')],_0x118453[_0x0793('0x34')]);_0x8cc573['attributes']=_['intersection'](_0x118453['model'],qs[_0x0793('0x35')](_0x2a3e5d[_0x0793('0x34')][_0x0793('0x35')]));_0x8cc573[_0x0793('0x36')]=_0x8cc573[_0x0793('0x36')][_0x0793('0x37')]?_0x8cc573[_0x0793('0x36')]:_0x118453['model'];if(!_0x2a3e5d[_0x0793('0x34')][_0x0793('0x38')](_0x0793('0x39'))){_0x8cc573[_0x0793('0x1e')]=qs['limit'](_0x2a3e5d[_0x0793('0x34')][_0x0793('0x1e')]);_0x8cc573['offset']=qs[_0x0793('0x20')](_0x2a3e5d[_0x0793('0x34')][_0x0793('0x20')]);}_0x8cc573['order']=qs[_0x0793('0x3a')](_0x2a3e5d['query']['sort']);_0x8cc573[_0x0793('0x3b')]=qs[_0x0793('0x32')](_[_0x0793('0x3c')](_0x2a3e5d[_0x0793('0x34')],_0x118453['filters']),_0x483ea2);if(_0x2a3e5d[_0x0793('0x34')][_0x0793('0x3d')]){_0x8cc573['where']=_[_0x0793('0x3e')](_0x8cc573[_0x0793('0x3b')],{'$or':_[_0x0793('0x2b')](_0x483ea2,function(_0x57f8c3){if(_0x57f8c3[_0x0793('0x2e')]!==_0x0793('0x3f')){var _0x1a38c3={};_0x1a38c3[_0x57f8c3[_0x0793('0x29')]]={'$like':'%'+_0x2a3e5d['query'][_0x0793('0x3d')]+'%'};return _0x1a38c3;}})});}_0x8cc573=_[_0x0793('0x3e')]({},_0x8cc573,_0x2a3e5d[_0x0793('0x40')]);var _0x4da202={'where':_0x8cc573[_0x0793('0x3b')]};return db[_0x0793('0x2c')]['count'](_0x4da202)[_0x0793('0x25')](function(_0x464f88){_0x359a1c[_0x0793('0x1f')]=_0x464f88;if(_0x2a3e5d[_0x0793('0x34')][_0x0793('0x41')]){_0x8cc573[_0x0793('0x42')]=[{'all':!![]}];}return db[_0x0793('0x2c')]['findAll'](_0x8cc573);})['then'](function(_0x4db4ca){_0x359a1c[_0x0793('0x43')]=_0x4db4ca;return _0x359a1c;})[_0x0793('0x25')](respondWithFilteredResult(_0x49e7f1,_0x8cc573))[_0x0793('0x44')](handleError(_0x49e7f1,null));};exports[_0x0793('0x45')]=function(_0x138adb,_0xde1a76){var _0x56cd69={'raw':!![],'where':{'id':_0x138adb['params']['id']}},_0x31050c={};_0x31050c[_0x0793('0x30')]=_[_0x0793('0x31')](db['SquareReport'][_0x0793('0x2d')]);_0x31050c[_0x0793('0x34')]=_['keys'](_0x138adb['query']);_0x31050c[_0x0793('0x32')]=_['intersection'](_0x31050c[_0x0793('0x30')],_0x31050c[_0x0793('0x34')]);_0x56cd69[_0x0793('0x36')]=_['intersection'](_0x31050c[_0x0793('0x30')],qs[_0x0793('0x35')](_0x138adb['query'][_0x0793('0x35')]));_0x56cd69[_0x0793('0x36')]=_0x56cd69[_0x0793('0x36')]['length']?_0x56cd69[_0x0793('0x36')]:_0x31050c[_0x0793('0x30')];if(_0x138adb[_0x0793('0x34')][_0x0793('0x41')]){_0x56cd69[_0x0793('0x42')]=[{'all':!![]}];}_0x56cd69=_['merge']({},_0x56cd69,_0x138adb['options']);return db[_0x0793('0x2c')]['find'](_0x56cd69)['then'](handleEntityNotFound(_0xde1a76,null))[_0x0793('0x25')](respondWithResult(_0xde1a76,null))[_0x0793('0x44')](handleError(_0xde1a76,null));};exports[_0x0793('0x46')]=function(_0x188522,_0x5203c5){return db[_0x0793('0x2c')][_0x0793('0x46')](_0x188522[_0x0793('0x47')],{})['then'](respondWithResult(_0x5203c5,0xc9))[_0x0793('0x44')](handleError(_0x5203c5,null));};exports[_0x0793('0x24')]=function(_0x2347df,_0x15d320){if(_0x2347df[_0x0793('0x47')]['id']){delete _0x2347df['body']['id'];}return db[_0x0793('0x2c')]['find']({'where':{'id':_0x2347df[_0x0793('0x48')]['id']}})[_0x0793('0x25')](handleEntityNotFound(_0x15d320,null))[_0x0793('0x25')](saveUpdates(_0x2347df['body'],null))[_0x0793('0x25')](respondWithResult(_0x15d320,null))[_0x0793('0x44')](handleError(_0x15d320,null));};exports['destroy']=function(_0x1f4c36,_0x37f940){return db[_0x0793('0x2c')]['find']({'where':{'id':_0x1f4c36['params']['id']}})[_0x0793('0x25')](handleEntityNotFound(_0x37f940,null))[_0x0793('0x25')](removeEntity(_0x37f940,null))[_0x0793('0x44')](handleError(_0x37f940,null));};exports['describe']=function(_0x5b8278,_0x898b2b){return db[_0x0793('0x2c')][_0x0793('0x49')]()[_0x0793('0x25')](respondWithResult(_0x898b2b,null))['catch'](handleError(_0x898b2b,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 2206b45..2859bcb 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 _0xe20b=['project_name','leaveAt','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','SquareReport','report_square','uniqueid'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe20b,0x10c));var _0xbe20=function(_0x11b732,_0xcd26f4){_0x11b732=_0x11b732-0x0;var _0x6dc597=_0xe20b[_0x11b732];return _0x6dc597;};'use strict';var _=require(_0xbe20('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbe20('0x1'));var moment=require(_0xbe20('0x2'));var BPromise=require(_0xbe20('0x3'));var rp=require(_0xbe20('0x4'));var fs=require('fs');var path=require(_0xbe20('0x5'));var rimraf=require(_0xbe20('0x6'));var config=require(_0xbe20('0x7'));var attributes=require('./squareReport.attributes');module[_0xbe20('0x8')]=function(_0x476487,_0x278182){return _0x476487['define'](_0xbe20('0x9'),attributes,{'tableName':_0xbe20('0xa'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0xbe20('0xb'),_0xbe20('0xc')]},{'name':_0xbe20('0xd'),'fields':[_0xbe20('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd121=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api'];(function(_0x51b360,_0x19092c){var _0x544947=function(_0x48ce13){while(--_0x48ce13){_0x51b360['push'](_0x51b360['shift']());}};_0x544947(++_0x19092c);}(_0xd121,0x10c));var _0x1d12=function(_0x5d4746,_0x35320f){_0x5d4746=_0x5d4746-0x0;var _0x2ea358=_0xd121[_0x5d4746];return _0x2ea358;};'use strict';var _=require(_0x1d12('0x0'));var util=require(_0x1d12('0x1'));var logger=require(_0x1d12('0x2'))(_0x1d12('0x3'));var moment=require(_0x1d12('0x4'));var BPromise=require(_0x1d12('0x5'));var rp=require(_0x1d12('0x6'));var fs=require('fs');var path=require(_0x1d12('0x7'));var rimraf=require(_0x1d12('0x8'));var config=require(_0x1d12('0x9'));var attributes=require('./squareReport.attributes');module[_0x1d12('0xa')]=function(_0x16f336,_0x202ab0){return _0x16f336['define'](_0x1d12('0xb'),attributes,{'tableName':_0x1d12('0xc'),'paranoid':![],'indexes':[{'name':_0x1d12('0xd'),'fields':[_0x1d12('0xe'),_0x1d12('0xf')]},{'name':_0x1d12('0x10'),'fields':[_0x1d12('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 605c806..3c64d41 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 _0x9a12=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','create','body','options','then','CreateSquareReport','catch','SquareReport','update','limit','UpdateSquareReport','lodash','util','moment'];(function(_0x190310,_0x14932e){var _0x5137c7=function(_0x15029b){while(--_0x15029b){_0x190310['push'](_0x190310['shift']());}};_0x5137c7(++_0x14932e);}(_0x9a12,0x10b));var _0x29a1=function(_0x1d5f70,_0x51d206){_0x1d5f70=_0x1d5f70-0x0;var _0x401ee2=_0x9a12[_0x1d5f70];return _0x401ee2;};'use strict';var _=require(_0x29a1('0x0'));var util=require(_0x29a1('0x1'));var moment=require(_0x29a1('0x2'));var BPromise=require(_0x29a1('0x3'));var rs=require(_0x29a1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x29a1('0x5'))['db'];var utils=require(_0x29a1('0x6'));var logger=require(_0x29a1('0x7'))(_0x29a1('0x8'));var config=require(_0x29a1('0x9'));var jayson=require(_0x29a1('0xa'));var client=jayson['client'][_0x29a1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a7688,_0x3562e2,_0x4568a){return new BPromise(function(_0x55489f,_0x457cd1){return client['request'](_0x1a7688,_0x4568a)['then'](function(_0x368c1d){logger[_0x29a1('0xc')](_0x29a1('0xd'),_0x3562e2,_0x29a1('0xe'));logger[_0x29a1('0xf')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x3562e2,'request\x20sent',JSON[_0x29a1('0x10')](_0x368c1d));if(_0x368c1d['error']){if(_0x368c1d[_0x29a1('0x11')][_0x29a1('0x12')]===0x1f4){logger[_0x29a1('0x11')]('SquareReport,\x20%s,\x20%s',_0x3562e2,_0x368c1d['error'][_0x29a1('0x13')]);return _0x457cd1(_0x368c1d['error'][_0x29a1('0x13')]);}logger[_0x29a1('0x11')]('SquareReport,\x20%s,\x20%s',_0x3562e2,_0x368c1d[_0x29a1('0x11')]['message']);return _0x55489f(_0x368c1d[_0x29a1('0x11')][_0x29a1('0x13')]);}else{logger[_0x29a1('0xc')](_0x29a1('0xd'),_0x3562e2,_0x29a1('0xe'));_0x55489f(_0x368c1d['result'][_0x29a1('0x13')]);}})['catch'](function(_0x167389){logger[_0x29a1('0x11')](_0x29a1('0xd'),_0x3562e2,_0x167389);_0x457cd1(_0x167389);});});}exports['CreateSquareReport']=function(_0x41644f){var _0x3d26f7=this;return new Promise(function(_0x4a1031,_0x1dfbf4){return db['SquareReport'][_0x29a1('0x14')](_0x41644f[_0x29a1('0x15')],{'raw':_0x41644f[_0x29a1('0x16')]?_0x41644f[_0x29a1('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x29a1('0x17')](function(_0x9204a8){logger['info'](_0x29a1('0x18'),_0x41644f);logger[_0x29a1('0xf')](_0x29a1('0x18'),_0x41644f,JSON['stringify'](_0x9204a8));_0x4a1031(_0x9204a8);})[_0x29a1('0x19')](function(_0x500c15){logger[_0x29a1('0x11')](_0x29a1('0x18'),_0x500c15['message'],_0x41644f);_0x1dfbf4(_0x3d26f7[_0x29a1('0x11')](0x1f4,_0x500c15[_0x29a1('0x13')]));});});};exports['UpdateSquareReport']=function(_0x34efbb){var _0x202c9b=this;return new Promise(function(_0x24817e,_0x31c462){return db[_0x29a1('0x1a')][_0x29a1('0x1b')](_0x34efbb[_0x29a1('0x15')],{'raw':_0x34efbb[_0x29a1('0x16')]?_0x34efbb[_0x29a1('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x34efbb[_0x29a1('0x16')]?_0x34efbb[_0x29a1('0x16')]['where']||null:null,'attributes':_0x34efbb[_0x29a1('0x16')]?_0x34efbb[_0x29a1('0x16')]['attributes']||null:null,'limit':_0x34efbb[_0x29a1('0x16')]?_0x34efbb[_0x29a1('0x16')][_0x29a1('0x1c')]||null:null})[_0x29a1('0x17')](function(_0x1c75b5){logger[_0x29a1('0xc')](_0x29a1('0x1d'),_0x34efbb);logger[_0x29a1('0xf')](_0x29a1('0x1d'),_0x34efbb,JSON['stringify'](_0x1c75b5));_0x24817e(_0x1c75b5);})[_0x29a1('0x19')](function(_0x3652d8){logger[_0x29a1('0x11')](_0x29a1('0x1d'),_0x3652d8[_0x29a1('0x13')],_0x34efbb);_0x31c462(_0x202c9b['error'](0x1f4,_0x3652d8[_0x29a1('0x13')]));});});}; \ No newline at end of file +var _0x271d=['body','options','then','CreateSquareReport','debug','stringify','UpdateSquareReport','update','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','error','SquareReport,\x20%s,\x20%s','message','info','result','catch','create'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x271d,0x120));var _0xd271=function(_0x5eca56,_0x426d1b){_0x5eca56=_0x5eca56-0x0;var _0x54d607=_0x271d[_0x5eca56];return _0x54d607;};'use strict';var _=require(_0xd271('0x0'));var util=require(_0xd271('0x1'));var moment=require(_0xd271('0x2'));var BPromise=require(_0xd271('0x3'));var rs=require(_0xd271('0x4'));var fs=require('fs');var Redis=require(_0xd271('0x5'));var db=require(_0xd271('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd271('0x7'))(_0xd271('0x8'));var config=require(_0xd271('0x9'));var jayson=require(_0xd271('0xa'));var client=jayson[_0xd271('0xb')][_0xd271('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c6020,_0x3211f7,_0x5e3da3){return new BPromise(function(_0x4075da,_0xe0d21f){return client['request'](_0x5c6020,_0x5e3da3)['then'](function(_0x3ddfac){logger['info']('SquareReport,\x20%s,\x20%s',_0x3211f7,_0xd271('0xd'));logger['debug'](_0xd271('0xe'),_0x3211f7,_0xd271('0xd'),JSON['stringify'](_0x3ddfac));if(_0x3ddfac[_0xd271('0xf')]){if(_0x3ddfac['error']['code']===0x1f4){logger['error'](_0xd271('0x10'),_0x3211f7,_0x3ddfac[_0xd271('0xf')][_0xd271('0x11')]);return _0xe0d21f(_0x3ddfac['error'][_0xd271('0x11')]);}logger[_0xd271('0xf')](_0xd271('0x10'),_0x3211f7,_0x3ddfac[_0xd271('0xf')][_0xd271('0x11')]);return _0x4075da(_0x3ddfac[_0xd271('0xf')][_0xd271('0x11')]);}else{logger[_0xd271('0x12')]('SquareReport,\x20%s,\x20%s',_0x3211f7,'request\x20sent');_0x4075da(_0x3ddfac[_0xd271('0x13')][_0xd271('0x11')]);}})[_0xd271('0x14')](function(_0x29b5e2){logger[_0xd271('0xf')](_0xd271('0x10'),_0x3211f7,_0x29b5e2);_0xe0d21f(_0x29b5e2);});});}exports['CreateSquareReport']=function(_0x27cdc3){var _0x3002b2=this;return new Promise(function(_0x57bbc8,_0x509db0){return db['SquareReport'][_0xd271('0x15')](_0x27cdc3[_0xd271('0x16')],{'raw':_0x27cdc3[_0xd271('0x17')]?_0x27cdc3['options']['raw']===undefined?!![]:![]:!![]})[_0xd271('0x18')](function(_0x5b0229){logger['info'](_0xd271('0x19'),_0x27cdc3);logger[_0xd271('0x1a')](_0xd271('0x19'),_0x27cdc3,JSON[_0xd271('0x1b')](_0x5b0229));_0x57bbc8(_0x5b0229);})[_0xd271('0x14')](function(_0x445238){logger[_0xd271('0xf')](_0xd271('0x19'),_0x445238['message'],_0x27cdc3);_0x509db0(_0x3002b2[_0xd271('0xf')](0x1f4,_0x445238[_0xd271('0x11')]));});});};exports[_0xd271('0x1c')]=function(_0x29d849){var _0x1cab92=this;return new Promise(function(_0x411ff9,_0x5a665e){return db['SquareReport'][_0xd271('0x1d')](_0x29d849[_0xd271('0x16')],{'raw':_0x29d849[_0xd271('0x17')]?_0x29d849[_0xd271('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x29d849[_0xd271('0x17')]?_0x29d849[_0xd271('0x17')]['where']||null:null,'attributes':_0x29d849[_0xd271('0x17')]?_0x29d849['options'][_0xd271('0x1e')]||null:null,'limit':_0x29d849[_0xd271('0x17')]?_0x29d849[_0xd271('0x17')]['limit']||null:null})[_0xd271('0x18')](function(_0x3eb190){logger[_0xd271('0x12')]('UpdateSquareReport',_0x29d849);logger[_0xd271('0x1a')](_0xd271('0x1c'),_0x29d849,JSON[_0xd271('0x1b')](_0x3eb190));_0x411ff9(_0x3eb190);})[_0xd271('0x14')](function(_0x498fc5){logger[_0xd271('0xf')](_0xd271('0x1c'),_0x498fc5['message'],_0x29d849);_0x5a665e(_0x1cab92['error'](0x1f4,_0x498fc5['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index d5b64bc..6207120 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 _0x270a=['../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','post','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x2f9bf6,_0x4ec63f){var _0x3f7df4=function(_0x58025a){while(--_0x58025a){_0x2f9bf6['push'](_0x2f9bf6['shift']());}};_0x3f7df4(++_0x4ec63f);}(_0x270a,0xfe));var _0xa270=function(_0x22f5c9,_0x29f501){_0x22f5c9=_0x22f5c9-0x0;var _0x20f444=_0x270a[_0x22f5c9];return _0x20f444;};'use strict';var multer=require(_0xa270('0x0'));var util=require(_0xa270('0x1'));var path=require(_0xa270('0x2'));var timeout=require('connect-timeout');var express=require(_0xa270('0x3'));var router=express[_0xa270('0x4')]();var fs_extra=require(_0xa270('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa270('0x6'));var config=require(_0xa270('0x7'));var controller=require('./squareReportDetail.controller');router['get']('/',auth[_0xa270('0x8')](),controller[_0xa270('0x9')]);router[_0xa270('0xa')](_0xa270('0xb'),auth[_0xa270('0x8')](),controller[_0xa270('0xc')]);router[_0xa270('0xa')](_0xa270('0xd'),auth[_0xa270('0x8')](),controller['show']);router[_0xa270('0xe')]('/',auth[_0xa270('0x8')](),controller['create']);router[_0xa270('0xf')](_0xa270('0xd'),auth[_0xa270('0x8')](),controller[_0xa270('0x10')]);router[_0xa270('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa270('0x12')]);module[_0xa270('0x13')]=router; \ No newline at end of file +var _0x8392=['../../config/environment','get','isAuthenticated','describe','show','post','create','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8392,0x181));var _0x2839=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8392[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x2839('0x0'));var util=require('util');var path=require(_0x2839('0x1'));var timeout=require(_0x2839('0x2'));var express=require(_0x2839('0x3'));var router=express['Router']();var fs_extra=require(_0x2839('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2839('0x5'));var config=require(_0x2839('0x6'));var controller=require('./squareReportDetail.controller');router[_0x2839('0x7')]('/',auth[_0x2839('0x8')](),controller['index']);router[_0x2839('0x7')]('/describe',auth[_0x2839('0x8')](),controller[_0x2839('0x9')]);router[_0x2839('0x7')]('/:id',auth[_0x2839('0x8')](),controller[_0x2839('0xa')]);router[_0x2839('0xb')]('/',auth[_0x2839('0x8')](),controller[_0x2839('0xc')]);router['put'](_0x2839('0xd'),auth[_0x2839('0x8')](),controller[_0x2839('0xe')]);router['delete']('/:id',auth[_0x2839('0x8')](),controller[_0x2839('0xf')]);module[_0x2839('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 1c46cb8..d64b16f 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 _0xfc69=['TEXT','exports','STRING'];(function(_0x116cca,_0x5f3309){var _0xcb2c91=function(_0x353bac){while(--_0x353bac){_0x116cca['push'](_0x116cca['shift']());}};_0xcb2c91(++_0x5f3309);}(_0xfc69,0x145));var _0x9fc6=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0xfc69[_0x39d544];return _0x5a5ff2;};'use strict';var Sequelize=require('sequelize');module[_0x9fc6('0x0')]={'uniqueid':{'type':Sequelize[_0x9fc6('0x1')]},'node':{'type':Sequelize[_0x9fc6('0x1')]},'application':{'type':Sequelize[_0x9fc6('0x1')]},'data':{'type':Sequelize[_0x9fc6('0x2')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x9fc6('0x1')]}}; \ No newline at end of file +var _0x97c8=['STRING','TEXT','sequelize','exports'];(function(_0x728750,_0x5ce59a){var _0xb27740=function(_0x1539ba){while(--_0x1539ba){_0x728750['push'](_0x728750['shift']());}};_0xb27740(++_0x5ce59a);}(_0x97c8,0x1ae));var _0x897c=function(_0x40b2ed,_0x2b1765){_0x40b2ed=_0x40b2ed-0x0;var _0x18397d=_0x97c8[_0x40b2ed];return _0x18397d;};'use strict';var Sequelize=require(_0x897c('0x0'));module[_0x897c('0x1')]={'uniqueid':{'type':Sequelize[_0x897c('0x2')]},'node':{'type':Sequelize[_0x897c('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x897c('0x3')]},'project_name':{'type':Sequelize[_0x897c('0x2')]},'callerid':{'type':Sequelize[_0x897c('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 8387ed0..c0f64bd 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 _0xac43=['jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','SquareDetailsReport','includeAll','include','rows','catch','show','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel'];(function(_0x49e6c8,_0x46d9cc){var _0x124f82=function(_0x1b4a43){while(--_0x1b4a43){_0x49e6c8['push'](_0x49e6c8['shift']());}};_0x124f82(++_0x46d9cc);}(_0xac43,0x12b));var _0x3ac4=function(_0x3cba37,_0x351a66){_0x3cba37=_0x3cba37-0x0;var _0x2154f2=_0xac43[_0x3cba37];return _0x2154f2;};'use strict';var emlformat=require(_0x3ac4('0x0'));var rimraf=require(_0x3ac4('0x1'));var zipdir=require(_0x3ac4('0x2'));var jsonpatch=require(_0x3ac4('0x3'));var rp=require('request-promise');var moment=require(_0x3ac4('0x4'));var BPromise=require(_0x3ac4('0x5'));var Mustache=require('mustache');var util=require(_0x3ac4('0x6'));var path=require(_0x3ac4('0x7'));var sox=require(_0x3ac4('0x8'));var csv=require(_0x3ac4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3ac4('0xa'));var _=require(_0x3ac4('0xb'));var squel=require(_0x3ac4('0xc'));var crypto=require('crypto');var jsforce=require(_0x3ac4('0xd'));var deskjs=require(_0x3ac4('0xe'));var toCsv=require(_0x3ac4('0x9'));var querystring=require('querystring');var Papa=require(_0x3ac4('0xf'));var Redis=require('ioredis');var authService=require(_0x3ac4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3ac4('0x11'));var hardwareService=require(_0x3ac4('0x12'));var logger=require('../../config/logger')(_0x3ac4('0x13'));var utils=require(_0x3ac4('0x14'));var config=require(_0x3ac4('0x15'));var licenseUtil=require(_0x3ac4('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c1168,_0x7b499e){_0x7b499e=_0x7b499e||0xcc;return function(_0x54a0c8){if(_0x54a0c8){return _0x5c1168[_0x3ac4('0x17')](_0x7b499e);}return _0x5c1168[_0x3ac4('0x18')](_0x7b499e)[_0x3ac4('0x19')]();};}function respondWithResult(_0x162c68,_0x3453cd){_0x3453cd=_0x3453cd||0xc8;return function(_0x30231a){if(_0x30231a){return _0x162c68[_0x3ac4('0x18')](_0x3453cd)[_0x3ac4('0x1a')](_0x30231a);}};}function respondWithFilteredResult(_0x2e4044,_0x3f3ff0){return function(_0x267e61){if(_0x267e61){var _0xf00f75=typeof _0x3f3ff0[_0x3ac4('0x1b')]===_0x3ac4('0x1c')&&typeof _0x3f3ff0[_0x3ac4('0x1d')]==='undefined';var _0x5b55fe=_0x267e61[_0x3ac4('0x1e')];var _0x32f54a=_0xf00f75?0x0:_0x3f3ff0[_0x3ac4('0x1b')];var _0x3bcbb1=_0xf00f75?_0x267e61[_0x3ac4('0x1e')]:_0x3f3ff0['offset']+_0x3f3ff0[_0x3ac4('0x1d')];var _0x38741b;if(_0x3bcbb1>=_0x5b55fe){_0x3bcbb1=_0x5b55fe;_0x38741b=0xc8;}else{_0x38741b=0xce;}_0x2e4044[_0x3ac4('0x18')](_0x38741b);return _0x2e4044[_0x3ac4('0x1f')](_0x3ac4('0x20'),_0x32f54a+'-'+_0x3bcbb1+'/'+_0x5b55fe)[_0x3ac4('0x1a')](_0x267e61);}return null;};}function patchUpdates(_0x4ec0fe){return function(_0x467436){try{jsonpatch[_0x3ac4('0x21')](_0x467436,_0x4ec0fe,!![]);}catch(_0x4364e3){return BPromise[_0x3ac4('0x22')](_0x4364e3);}return _0x467436[_0x3ac4('0x23')]();};}function saveUpdates(_0x4bc36c,_0x4bc2de){return function(_0x3d7cb9){if(_0x3d7cb9){return _0x3d7cb9[_0x3ac4('0x24')](_0x4bc36c)[_0x3ac4('0x25')](function(_0x403ae2){return _0x403ae2;});}return null;};}function removeEntity(_0x4891b1,_0x5b32a5){return function(_0x7ef0bc){if(_0x7ef0bc){return _0x7ef0bc[_0x3ac4('0x26')]()[_0x3ac4('0x25')](function(){_0x4891b1[_0x3ac4('0x18')](0xcc)[_0x3ac4('0x19')]();});}};}function handleEntityNotFound(_0x1d2bf4,_0x1f0df6){return function(_0x12e0c8){if(!_0x12e0c8){_0x1d2bf4[_0x3ac4('0x17')](0x194);}return _0x12e0c8;};}function handleError(_0x465bc9,_0x56b956){_0x56b956=_0x56b956||0x1f4;return function(_0x1f877c){logger[_0x3ac4('0x27')](_0x1f877c[_0x3ac4('0x28')]);if(_0x1f877c[_0x3ac4('0x29')]){delete _0x1f877c[_0x3ac4('0x29')];}_0x465bc9[_0x3ac4('0x18')](_0x56b956)[_0x3ac4('0x2a')](_0x1f877c);};}exports[_0x3ac4('0x2b')]=function(_0x3be4bf,_0x3c54b6){var _0x407eb6={},_0x5d9733={},_0x10ba7b={'count':0x0,'rows':[]};var _0x1447c9=_[_0x3ac4('0x2c')](db['SquareDetailsReport'][_0x3ac4('0x2d')],function(_0x14c31f){return{'name':_0x14c31f[_0x3ac4('0x2e')],'type':_0x14c31f['type'][_0x3ac4('0x2f')]};});_0x5d9733[_0x3ac4('0x30')]=_[_0x3ac4('0x2c')](_0x1447c9,_0x3ac4('0x29'));_0x5d9733[_0x3ac4('0x31')]=_[_0x3ac4('0x32')](_0x3be4bf[_0x3ac4('0x31')]);_0x5d9733[_0x3ac4('0x33')]=_[_0x3ac4('0x34')](_0x5d9733[_0x3ac4('0x30')],_0x5d9733[_0x3ac4('0x31')]);_0x407eb6['attributes']=_[_0x3ac4('0x34')](_0x5d9733[_0x3ac4('0x30')],qs['fields'](_0x3be4bf[_0x3ac4('0x31')][_0x3ac4('0x35')]));_0x407eb6[_0x3ac4('0x36')]=_0x407eb6['attributes'][_0x3ac4('0x37')]?_0x407eb6['attributes']:_0x5d9733[_0x3ac4('0x30')];if(!_0x3be4bf[_0x3ac4('0x31')][_0x3ac4('0x38')](_0x3ac4('0x39'))){_0x407eb6['limit']=qs['limit'](_0x3be4bf[_0x3ac4('0x31')][_0x3ac4('0x1d')]);_0x407eb6[_0x3ac4('0x1b')]=qs[_0x3ac4('0x1b')](_0x3be4bf[_0x3ac4('0x31')][_0x3ac4('0x1b')]);}_0x407eb6[_0x3ac4('0x3a')]=qs[_0x3ac4('0x3b')](_0x3be4bf[_0x3ac4('0x31')][_0x3ac4('0x3b')]);_0x407eb6['where']=qs[_0x3ac4('0x33')](_[_0x3ac4('0x3c')](_0x3be4bf[_0x3ac4('0x31')],_0x5d9733[_0x3ac4('0x33')]),_0x1447c9);if(_0x3be4bf[_0x3ac4('0x31')][_0x3ac4('0x3d')]){_0x407eb6[_0x3ac4('0x3e')]=_[_0x3ac4('0x3f')](_0x407eb6['where'],{'$or':_[_0x3ac4('0x2c')](_0x1447c9,function(_0xa81499){if(_0xa81499[_0x3ac4('0x40')]!==_0x3ac4('0x41')){var _0x4a4ca5={};_0x4a4ca5[_0xa81499['name']]={'$like':'%'+_0x3be4bf[_0x3ac4('0x31')][_0x3ac4('0x3d')]+'%'};return _0x4a4ca5;}})});}_0x407eb6=_[_0x3ac4('0x3f')]({},_0x407eb6,_0x3be4bf[_0x3ac4('0x42')]);var _0x455efa={'where':_0x407eb6[_0x3ac4('0x3e')]};return db[_0x3ac4('0x43')][_0x3ac4('0x1e')](_0x455efa)[_0x3ac4('0x25')](function(_0x3a9085){_0x10ba7b[_0x3ac4('0x1e')]=_0x3a9085;if(_0x3be4bf[_0x3ac4('0x31')][_0x3ac4('0x44')]){_0x407eb6[_0x3ac4('0x45')]=[{'all':!![]}];}return db[_0x3ac4('0x43')]['findAll'](_0x407eb6);})[_0x3ac4('0x25')](function(_0x5e0249){_0x10ba7b[_0x3ac4('0x46')]=_0x5e0249;return _0x10ba7b;})[_0x3ac4('0x25')](respondWithFilteredResult(_0x3c54b6,_0x407eb6))[_0x3ac4('0x47')](handleError(_0x3c54b6,null));};exports[_0x3ac4('0x48')]=function(_0x3d582a,_0x5591b2){var _0x16ca6f={'raw':!![],'where':{'id':_0x3d582a['params']['id']}},_0x4bb945={};_0x4bb945[_0x3ac4('0x30')]=_[_0x3ac4('0x32')](db[_0x3ac4('0x43')]['rawAttributes']);_0x4bb945[_0x3ac4('0x31')]=_['keys'](_0x3d582a[_0x3ac4('0x31')]);_0x4bb945[_0x3ac4('0x33')]=_[_0x3ac4('0x34')](_0x4bb945['model'],_0x4bb945['query']);_0x16ca6f[_0x3ac4('0x36')]=_[_0x3ac4('0x34')](_0x4bb945[_0x3ac4('0x30')],qs[_0x3ac4('0x35')](_0x3d582a[_0x3ac4('0x31')][_0x3ac4('0x35')]));_0x16ca6f['attributes']=_0x16ca6f['attributes'][_0x3ac4('0x37')]?_0x16ca6f[_0x3ac4('0x36')]:_0x4bb945[_0x3ac4('0x30')];if(_0x3d582a[_0x3ac4('0x31')]['includeAll']){_0x16ca6f[_0x3ac4('0x45')]=[{'all':!![]}];}_0x16ca6f=_[_0x3ac4('0x3f')]({},_0x16ca6f,_0x3d582a[_0x3ac4('0x42')]);return db[_0x3ac4('0x43')][_0x3ac4('0x49')](_0x16ca6f)[_0x3ac4('0x25')](handleEntityNotFound(_0x5591b2,null))[_0x3ac4('0x25')](respondWithResult(_0x5591b2,null))['catch'](handleError(_0x5591b2,null));};exports[_0x3ac4('0x4a')]=function(_0x267aaa,_0x33062a){return db[_0x3ac4('0x43')][_0x3ac4('0x4a')](_0x267aaa[_0x3ac4('0x4b')],{})['then'](respondWithResult(_0x33062a,0xc9))['catch'](handleError(_0x33062a,null));};exports[_0x3ac4('0x24')]=function(_0x48e69d,_0x1d5bee){if(_0x48e69d['body']['id']){delete _0x48e69d['body']['id'];}return db[_0x3ac4('0x43')][_0x3ac4('0x49')]({'where':{'id':_0x48e69d[_0x3ac4('0x4c')]['id']}})[_0x3ac4('0x25')](handleEntityNotFound(_0x1d5bee,null))['then'](saveUpdates(_0x48e69d['body'],null))[_0x3ac4('0x25')](respondWithResult(_0x1d5bee,null))[_0x3ac4('0x47')](handleError(_0x1d5bee,null));};exports[_0x3ac4('0x26')]=function(_0x5bd7d8,_0x172806){return db[_0x3ac4('0x43')]['find']({'where':{'id':_0x5bd7d8[_0x3ac4('0x4c')]['id']}})[_0x3ac4('0x25')](handleEntityNotFound(_0x172806,null))[_0x3ac4('0x25')](removeEntity(_0x172806,null))[_0x3ac4('0x47')](handleError(_0x172806,null));};exports[_0x3ac4('0x4d')]=function(_0x15f1da,_0x51d1d3){return db[_0x3ac4('0x43')][_0x3ac4('0x4d')]()[_0x3ac4('0x25')](respondWithResult(_0x51d1d3,null))['catch'](handleError(_0x51d1d3,null));}; \ No newline at end of file +var _0x66f1=['reject','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','SquareDetailsReport','includeAll','include','rows','show','find','catch','create','body','update','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x66f1,0x114));var _0x166f=function(_0x45fc9c,_0x70f2cb){_0x45fc9c=_0x45fc9c-0x0;var _0x984946=_0x66f1[_0x45fc9c];return _0x984946;};'use strict';var emlformat=require(_0x166f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x166f('0x1'));var jsonpatch=require(_0x166f('0x2'));var rp=require(_0x166f('0x3'));var moment=require(_0x166f('0x4'));var BPromise=require(_0x166f('0x5'));var Mustache=require(_0x166f('0x6'));var util=require(_0x166f('0x7'));var path=require(_0x166f('0x8'));var sox=require(_0x166f('0x9'));var csv=require(_0x166f('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x166f('0xb'));var _=require(_0x166f('0xc'));var squel=require(_0x166f('0xd'));var crypto=require('crypto');var jsforce=require(_0x166f('0xe'));var deskjs=require(_0x166f('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x166f('0x10'));var Redis=require(_0x166f('0x11'));var authService=require(_0x166f('0x12'));var qs=require(_0x166f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x166f('0x14'))('api');var utils=require(_0x166f('0x15'));var config=require(_0x166f('0x16'));var licenseUtil=require(_0x166f('0x17'));var db=require(_0x166f('0x18'))['db'];function respondWithStatusCode(_0x243ab3,_0x2966ce){_0x2966ce=_0x2966ce||0xcc;return function(_0x37f6b5){if(_0x37f6b5){return _0x243ab3[_0x166f('0x19')](_0x2966ce);}return _0x243ab3['status'](_0x2966ce)[_0x166f('0x1a')]();};}function respondWithResult(_0x3395bc,_0x67aaf4){_0x67aaf4=_0x67aaf4||0xc8;return function(_0x10ef80){if(_0x10ef80){return _0x3395bc[_0x166f('0x1b')](_0x67aaf4)[_0x166f('0x1c')](_0x10ef80);}};}function respondWithFilteredResult(_0x314f28,_0x2aa402){return function(_0x18d8d0){if(_0x18d8d0){var _0x28e7cf=typeof _0x2aa402[_0x166f('0x1d')]==='undefined'&&typeof _0x2aa402['limit']===_0x166f('0x1e');var _0x33f2d0=_0x18d8d0[_0x166f('0x1f')];var _0x4f0656=_0x28e7cf?0x0:_0x2aa402[_0x166f('0x1d')];var _0x1c264d=_0x28e7cf?_0x18d8d0[_0x166f('0x1f')]:_0x2aa402[_0x166f('0x1d')]+_0x2aa402[_0x166f('0x20')];var _0x370288;if(_0x1c264d>=_0x33f2d0){_0x1c264d=_0x33f2d0;_0x370288=0xc8;}else{_0x370288=0xce;}_0x314f28[_0x166f('0x1b')](_0x370288);return _0x314f28[_0x166f('0x21')](_0x166f('0x22'),_0x4f0656+'-'+_0x1c264d+'/'+_0x33f2d0)[_0x166f('0x1c')](_0x18d8d0);}return null;};}function patchUpdates(_0x3a7de2){return function(_0x11ea2d){try{jsonpatch[_0x166f('0x23')](_0x11ea2d,_0x3a7de2,!![]);}catch(_0x1527c9){return BPromise[_0x166f('0x24')](_0x1527c9);}return _0x11ea2d['save']();};}function saveUpdates(_0xeb7759,_0x20fb6c){return function(_0x154e8f){if(_0x154e8f){return _0x154e8f['update'](_0xeb7759)[_0x166f('0x25')](function(_0x2a945b){return _0x2a945b;});}return null;};}function removeEntity(_0x2c3ab4,_0x54269a){return function(_0x2a8ae7){if(_0x2a8ae7){return _0x2a8ae7[_0x166f('0x26')]()['then'](function(){_0x2c3ab4['status'](0xcc)[_0x166f('0x1a')]();});}};}function handleEntityNotFound(_0x18c658,_0x51f28f){return function(_0x3af54f){if(!_0x3af54f){_0x18c658[_0x166f('0x19')](0x194);}return _0x3af54f;};}function handleError(_0x5205d7,_0x8faf2e){_0x8faf2e=_0x8faf2e||0x1f4;return function(_0x7086c1){logger[_0x166f('0x27')](_0x7086c1[_0x166f('0x28')]);if(_0x7086c1[_0x166f('0x29')]){delete _0x7086c1['name'];}_0x5205d7[_0x166f('0x1b')](_0x8faf2e)['send'](_0x7086c1);};}exports[_0x166f('0x2a')]=function(_0x2c4bd4,_0x239620){var _0x3e3ac3={},_0x131425={},_0x516c7c={'count':0x0,'rows':[]};var _0x1c76a2=_[_0x166f('0x2b')](db['SquareDetailsReport'][_0x166f('0x2c')],function(_0x4a1d2f){return{'name':_0x4a1d2f[_0x166f('0x2d')],'type':_0x4a1d2f[_0x166f('0x2e')][_0x166f('0x2f')]};});_0x131425[_0x166f('0x30')]=_[_0x166f('0x2b')](_0x1c76a2,_0x166f('0x29'));_0x131425[_0x166f('0x31')]=_[_0x166f('0x32')](_0x2c4bd4[_0x166f('0x31')]);_0x131425[_0x166f('0x33')]=_[_0x166f('0x34')](_0x131425[_0x166f('0x30')],_0x131425[_0x166f('0x31')]);_0x3e3ac3['attributes']=_[_0x166f('0x34')](_0x131425[_0x166f('0x30')],qs['fields'](_0x2c4bd4[_0x166f('0x31')][_0x166f('0x35')]));_0x3e3ac3[_0x166f('0x36')]=_0x3e3ac3['attributes'][_0x166f('0x37')]?_0x3e3ac3[_0x166f('0x36')]:_0x131425['model'];if(!_0x2c4bd4[_0x166f('0x31')][_0x166f('0x38')](_0x166f('0x39'))){_0x3e3ac3['limit']=qs[_0x166f('0x20')](_0x2c4bd4[_0x166f('0x31')][_0x166f('0x20')]);_0x3e3ac3[_0x166f('0x1d')]=qs[_0x166f('0x1d')](_0x2c4bd4[_0x166f('0x31')][_0x166f('0x1d')]);}_0x3e3ac3[_0x166f('0x3a')]=qs[_0x166f('0x3b')](_0x2c4bd4['query'][_0x166f('0x3b')]);_0x3e3ac3[_0x166f('0x3c')]=qs[_0x166f('0x33')](_[_0x166f('0x3d')](_0x2c4bd4[_0x166f('0x31')],_0x131425[_0x166f('0x33')]),_0x1c76a2);if(_0x2c4bd4[_0x166f('0x31')]['filter']){_0x3e3ac3[_0x166f('0x3c')]=_[_0x166f('0x3e')](_0x3e3ac3[_0x166f('0x3c')],{'$or':_[_0x166f('0x2b')](_0x1c76a2,function(_0x37fddb){if(_0x37fddb[_0x166f('0x2e')]!==_0x166f('0x3f')){var _0x10604={};_0x10604[_0x37fddb[_0x166f('0x29')]]={'$like':'%'+_0x2c4bd4[_0x166f('0x31')][_0x166f('0x40')]+'%'};return _0x10604;}})});}_0x3e3ac3=_[_0x166f('0x3e')]({},_0x3e3ac3,_0x2c4bd4[_0x166f('0x41')]);var _0x253b91={'where':_0x3e3ac3[_0x166f('0x3c')]};return db[_0x166f('0x42')]['count'](_0x253b91)[_0x166f('0x25')](function(_0x3bd151){_0x516c7c[_0x166f('0x1f')]=_0x3bd151;if(_0x2c4bd4[_0x166f('0x31')][_0x166f('0x43')]){_0x3e3ac3[_0x166f('0x44')]=[{'all':!![]}];}return db[_0x166f('0x42')]['findAll'](_0x3e3ac3);})['then'](function(_0x1d4f6e){_0x516c7c[_0x166f('0x45')]=_0x1d4f6e;return _0x516c7c;})[_0x166f('0x25')](respondWithFilteredResult(_0x239620,_0x3e3ac3))['catch'](handleError(_0x239620,null));};exports[_0x166f('0x46')]=function(_0x4f0c98,_0x1d715b){var _0x3fa6d2={'raw':!![],'where':{'id':_0x4f0c98['params']['id']}},_0x1e5905={};_0x1e5905[_0x166f('0x30')]=_[_0x166f('0x32')](db[_0x166f('0x42')][_0x166f('0x2c')]);_0x1e5905[_0x166f('0x31')]=_[_0x166f('0x32')](_0x4f0c98[_0x166f('0x31')]);_0x1e5905[_0x166f('0x33')]=_[_0x166f('0x34')](_0x1e5905[_0x166f('0x30')],_0x1e5905[_0x166f('0x31')]);_0x3fa6d2[_0x166f('0x36')]=_[_0x166f('0x34')](_0x1e5905['model'],qs['fields'](_0x4f0c98[_0x166f('0x31')]['fields']));_0x3fa6d2[_0x166f('0x36')]=_0x3fa6d2[_0x166f('0x36')]['length']?_0x3fa6d2[_0x166f('0x36')]:_0x1e5905['model'];if(_0x4f0c98[_0x166f('0x31')]['includeAll']){_0x3fa6d2[_0x166f('0x44')]=[{'all':!![]}];}_0x3fa6d2=_[_0x166f('0x3e')]({},_0x3fa6d2,_0x4f0c98['options']);return db[_0x166f('0x42')][_0x166f('0x47')](_0x3fa6d2)[_0x166f('0x25')](handleEntityNotFound(_0x1d715b,null))[_0x166f('0x25')](respondWithResult(_0x1d715b,null))[_0x166f('0x48')](handleError(_0x1d715b,null));};exports[_0x166f('0x49')]=function(_0x175e7d,_0x51d2eb){return db[_0x166f('0x42')][_0x166f('0x49')](_0x175e7d[_0x166f('0x4a')],{})[_0x166f('0x25')](respondWithResult(_0x51d2eb,0xc9))['catch'](handleError(_0x51d2eb,null));};exports[_0x166f('0x4b')]=function(_0x67b554,_0x1f6103){if(_0x67b554[_0x166f('0x4a')]['id']){delete _0x67b554[_0x166f('0x4a')]['id'];}return db[_0x166f('0x42')]['find']({'where':{'id':_0x67b554[_0x166f('0x4c')]['id']}})[_0x166f('0x25')](handleEntityNotFound(_0x1f6103,null))[_0x166f('0x25')](saveUpdates(_0x67b554[_0x166f('0x4a')],null))[_0x166f('0x25')](respondWithResult(_0x1f6103,null))[_0x166f('0x48')](handleError(_0x1f6103,null));};exports['destroy']=function(_0x223f50,_0x1d8d85){return db[_0x166f('0x42')]['find']({'where':{'id':_0x223f50[_0x166f('0x4c')]['id']}})[_0x166f('0x25')](handleEntityNotFound(_0x1d8d85,null))[_0x166f('0x25')](removeEntity(_0x1d8d85,null))[_0x166f('0x48')](handleError(_0x1d8d85,null));};exports[_0x166f('0x4d')]=function(_0x574f28,_0x2b86dd){return db[_0x166f('0x42')]['describe']()[_0x166f('0x25')](respondWithResult(_0x2b86dd,null))[_0x166f('0x48')](handleError(_0x2b86dd,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 801c646..af3cdfe 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 _0x7354=['../../config/logger','api','bluebird','request-promise','./squareReportDetail.attributes','define','SquareDetailsReport','report_square_details'];(function(_0xeb4c8b,_0x1dc497){var _0x90b0d0=function(_0x332e32){while(--_0x332e32){_0xeb4c8b['push'](_0xeb4c8b['shift']());}};_0x90b0d0(++_0x1dc497);}(_0x7354,0x168));var _0x4735=function(_0x4e7b37,_0x33b1fa){_0x4e7b37=_0x4e7b37-0x0;var _0x20b707=_0x7354[_0x4e7b37];return _0x20b707;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4735('0x0'))(_0x4735('0x1'));var moment=require('moment');var BPromise=require(_0x4735('0x2'));var rp=require(_0x4735('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4735('0x4'));module['exports']=function(_0x56f8a3,_0xbf2a2b){return _0x56f8a3[_0x4735('0x5')](_0x4735('0x6'),attributes,{'tableName':_0x4735('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb493=['path','rimraf','../../config/environment','SquareDetailsReport','report_square_details','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x56400d,_0x30ccef){var _0x17387d=function(_0x10e32d){while(--_0x10e32d){_0x56400d['push'](_0x56400d['shift']());}};_0x17387d(++_0x30ccef);}(_0xb493,0xf5));var _0x3b49=function(_0x2ebac6,_0x57c469){_0x2ebac6=_0x2ebac6-0x0;var _0x4a59e7=_0xb493[_0x2ebac6];return _0x4a59e7;};'use strict';var _=require(_0x3b49('0x0'));var util=require('util');var logger=require(_0x3b49('0x1'))(_0x3b49('0x2'));var moment=require('moment');var BPromise=require(_0x3b49('0x3'));var rp=require(_0x3b49('0x4'));var fs=require('fs');var path=require(_0x3b49('0x5'));var rimraf=require(_0x3b49('0x6'));var config=require(_0x3b49('0x7'));var attributes=require('./squareReportDetail.attributes');module['exports']=function(_0x418fd5,_0x20d71c){return _0x418fd5['define'](_0x3b49('0x8'),attributes,{'tableName':_0x3b49('0x9'),'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 e0e43c6..890d382 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 _0x3c66=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','SquareDetailsReport','options','CreateSquareDetailsReport','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x28394f,_0x5ebdd2){var _0x2618d2=function(_0x2ffed6){while(--_0x2ffed6){_0x28394f['push'](_0x28394f['shift']());}};_0x2618d2(++_0x5ebdd2);}(_0x3c66,0x8b));var _0x63c6=function(_0x3de846,_0x59b2cb){_0x3de846=_0x3de846-0x0;var _0x1be10a=_0x3c66[_0x3de846];return _0x1be10a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x63c6('0x0'));var rs=require(_0x63c6('0x1'));var fs=require('fs');var Redis=require(_0x63c6('0x2'));var db=require(_0x63c6('0x3'))['db'];var utils=require(_0x63c6('0x4'));var logger=require(_0x63c6('0x5'))(_0x63c6('0x6'));var config=require(_0x63c6('0x7'));var jayson=require(_0x63c6('0x8'));var client=jayson[_0x63c6('0x9')][_0x63c6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b33e8,_0x47b438,_0x232099){return new BPromise(function(_0x50ff5c,_0x44e826){return client[_0x63c6('0xb')](_0x2b33e8,_0x232099)['then'](function(_0x386110){logger[_0x63c6('0xc')](_0x63c6('0xd'),_0x47b438,_0x63c6('0xe'));logger[_0x63c6('0xf')](_0x63c6('0x10'),_0x47b438,'request\x20sent',JSON[_0x63c6('0x11')](_0x386110));if(_0x386110[_0x63c6('0x12')]){if(_0x386110[_0x63c6('0x12')]['code']===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x47b438,_0x386110['error']['message']);return _0x44e826(_0x386110['error'][_0x63c6('0x13')]);}logger[_0x63c6('0x12')](_0x63c6('0xd'),_0x47b438,_0x386110[_0x63c6('0x12')][_0x63c6('0x13')]);return _0x50ff5c(_0x386110['error'][_0x63c6('0x13')]);}else{logger[_0x63c6('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x47b438,_0x63c6('0xe'));_0x50ff5c(_0x386110['result']['message']);}})[_0x63c6('0x14')](function(_0x571022){logger[_0x63c6('0x12')](_0x63c6('0xd'),_0x47b438,_0x571022);_0x44e826(_0x571022);});});}exports['CreateSquareDetailsReport']=function(_0xd5a3b5){var _0x2bbda5=this;return new Promise(function(_0x377f6e,_0x35ee57){return db[_0x63c6('0x15')]['create'](_0xd5a3b5['body'],{'raw':_0xd5a3b5['options']?_0xd5a3b5[_0x63c6('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0xb7ba4f){logger[_0x63c6('0xc')]('CreateSquareDetailsReport',_0xd5a3b5);logger[_0x63c6('0xf')](_0x63c6('0x17'),_0xd5a3b5,JSON[_0x63c6('0x11')](_0xb7ba4f));_0x377f6e(_0xb7ba4f);})[_0x63c6('0x14')](function(_0x430a6e){logger['error'](_0x63c6('0x17'),_0x430a6e[_0x63c6('0x13')],_0xd5a3b5);_0x35ee57(_0x2bbda5[_0x63c6('0x12')](0x1f4,_0x430a6e[_0x63c6('0x13')]));});});}; \ No newline at end of file +var _0x15b8=['options','raw','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create'];(function(_0x51e656,_0x4c0ec6){var _0x10d0eb=function(_0x6df727){while(--_0x6df727){_0x51e656['push'](_0x51e656['shift']());}};_0x10d0eb(++_0x4c0ec6);}(_0x15b8,0xcd));var _0x815b=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x15b8[_0x209941];return _0x1e8729;};'use strict';var _=require('lodash');var util=require(_0x815b('0x0'));var moment=require(_0x815b('0x1'));var BPromise=require(_0x815b('0x2'));var rs=require(_0x815b('0x3'));var fs=require('fs');var Redis=require(_0x815b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x815b('0x5'));var logger=require(_0x815b('0x6'))(_0x815b('0x7'));var config=require(_0x815b('0x8'));var jayson=require(_0x815b('0x9'));var client=jayson[_0x815b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1e9fc0,_0xdfdf6,_0x26119a){return new BPromise(function(_0x175053,_0x2170c5){return client[_0x815b('0xb')](_0x1e9fc0,_0x26119a)[_0x815b('0xc')](function(_0x221ce4){logger[_0x815b('0xd')](_0x815b('0xe'),_0xdfdf6,_0x815b('0xf'));logger[_0x815b('0x10')](_0x815b('0x11'),_0xdfdf6,_0x815b('0xf'),JSON[_0x815b('0x12')](_0x221ce4));if(_0x221ce4[_0x815b('0x13')]){if(_0x221ce4[_0x815b('0x13')][_0x815b('0x14')]===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0xdfdf6,_0x221ce4[_0x815b('0x13')][_0x815b('0x15')]);return _0x2170c5(_0x221ce4['error']['message']);}logger['error'](_0x815b('0xe'),_0xdfdf6,_0x221ce4['error']['message']);return _0x175053(_0x221ce4[_0x815b('0x13')][_0x815b('0x15')]);}else{logger[_0x815b('0xd')]('SquareDetailsReport,\x20%s,\x20%s',_0xdfdf6,'request\x20sent');_0x175053(_0x221ce4[_0x815b('0x16')][_0x815b('0x15')]);}})[_0x815b('0x17')](function(_0x4078db){logger[_0x815b('0x13')](_0x815b('0xe'),_0xdfdf6,_0x4078db);_0x2170c5(_0x4078db);});});}exports[_0x815b('0x18')]=function(_0x92d86a){var _0x26a8a3=this;return new Promise(function(_0x2fa2bd,_0x2ade43){return db[_0x815b('0x19')][_0x815b('0x1a')](_0x92d86a['body'],{'raw':_0x92d86a[_0x815b('0x1b')]?_0x92d86a[_0x815b('0x1b')][_0x815b('0x1c')]===undefined?!![]:![]:!![]})[_0x815b('0xc')](function(_0x3f710c){logger['info'](_0x815b('0x18'),_0x92d86a);logger[_0x815b('0x10')](_0x815b('0x18'),_0x92d86a,JSON['stringify'](_0x3f710c));_0x2fa2bd(_0x3f710c);})['catch'](function(_0x3ffdb7){logger[_0x815b('0x13')](_0x815b('0x18'),_0x3ffdb7[_0x815b('0x15')],_0x92d86a);_0x2ade43(_0x26a8a3[_0x815b('0x13')](0x1f4,_0x3ffdb7[_0x815b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 4d326ff..ea4ac3e 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 _0x53cd=['get','isAuthenticated','index','killProcess','exports','express','Router','../../components/auth/service','./system.controller'];(function(_0x4fcbc5,_0x1c73ff){var _0x2191c4=function(_0x120ee9){while(--_0x120ee9){_0x4fcbc5['push'](_0x4fcbc5['shift']());}};_0x2191c4(++_0x1c73ff);}(_0x53cd,0x71));var _0xd53c=function(_0x1cef56,_0x11892f){_0x1cef56=_0x1cef56-0x0;var _0x44a49d=_0x53cd[_0x1cef56];return _0x44a49d;};'use strict';var express=require(_0xd53c('0x0'));var router=express[_0xd53c('0x1')]();var auth=require(_0xd53c('0x2'));var controller=require(_0xd53c('0x3'));router[_0xd53c('0x4')]('/',auth[_0xd53c('0x5')](),controller[_0xd53c('0x6')]);router[_0xd53c('0x4')]('/process/:pid/kill',auth[_0xd53c('0x5')](),controller[_0xd53c('0x7')]);module[_0xd53c('0x8')]=router; \ No newline at end of file +var _0xbc39=['../../components/auth/service','./system.controller','isAuthenticated','index','get','/process/:pid/kill','exports','express','Router'];(function(_0x102f4c,_0x58899b){var _0x5942e2=function(_0x2acb45){while(--_0x2acb45){_0x102f4c['push'](_0x102f4c['shift']());}};_0x5942e2(++_0x58899b);}(_0xbc39,0x115));var _0x9bc3=function(_0x321575,_0x458292){_0x321575=_0x321575-0x0;var _0x147fc3=_0xbc39[_0x321575];return _0x147fc3;};'use strict';var express=require(_0x9bc3('0x0'));var router=express[_0x9bc3('0x1')]();var auth=require(_0x9bc3('0x2'));var controller=require(_0x9bc3('0x3'));router['get']('/',auth[_0x9bc3('0x4')](),controller[_0x9bc3('0x5')]);router[_0x9bc3('0x6')](_0x9bc3('0x7'),auth[_0x9bc3('0x4')](),controller['killProcess']);module[_0x9bc3('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 49b626b..52e2548 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 _0x359f=['params','pid','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','catch','killProcess','systeminformation','child_process','exec','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','name','index','getAllData','then','status','json','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args'];(function(_0x3273e3,_0x2a5256){var _0xfbd07c=function(_0x58a4a7){while(--_0x58a4a7){_0x3273e3['push'](_0x3273e3['shift']());}};_0xfbd07c(++_0x2a5256);}(_0x359f,0x71));var _0xf359=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x359f[_0x20a584];return _0x4b41a8;};'use strict';var info=require(_0xf359('0x0'));var exec=require(_0xf359('0x1'))[_0xf359('0x2')];var logger=require('../../config/logger')(_0xf359('0x3'));var util=require(_0xf359('0x4'));var BPromise=require(_0xf359('0x5'));var _=require(_0xf359('0x6'));function handleError(_0x1281a0,_0x4428f4,_0x30d2f6){_0x4428f4=_0x4428f4||0x1f4;return function(_0x5a0f5f){logger[_0xf359('0x7')](_0xf359('0x8'),_0x30d2f6,_0x4428f4,util['inspect'](_0x5a0f5f,{'showHidden':![],'depth':null}));delete _0x5a0f5f[_0xf359('0x9')];_0x1281a0['status'](_0x4428f4)['send'](_0x5a0f5f);};}exports[_0xf359('0xa')]=function(_0xda7686,_0x5079a1){return info[_0xf359('0xb')]()[_0xf359('0xc')](function(_0x4dd441){return _0x5079a1[_0xf359('0xd')](0xc8)['json'](_0x4dd441);})['catch'](function(_0x7cdcb6){return _0x5079a1[_0xf359('0xd')](0x1f4)[_0xf359('0xe')](_0x7cdcb6);});};exports['killProcess']=function(_0x27b7c2,_0x5d89e0){var _0x4b01aa=['components/import/cm'];return new BPromise(function(_0x3f8e92,_0x2dae8b){return exec(util[_0xf359('0xf')](_0xf359('0x10'),_0x27b7c2[_0xf359('0x11')][_0xf359('0x12')]),function(_0x2d6383,_0x29aaff,_0xe19539){if(_0x2d6383){return _0x2dae8b(_0x2d6383);}return _0x3f8e92(_0x29aaff);});})[_0xf359('0xc')](function(_0x18f932){var _0x19a866=![];var _0x37d863=_0x18f932['split'](/\n/);for(var _0x5b1bb5=0x0,_0x363f18=_0x4b01aa[_0xf359('0x13')];_0x5b1bb5<_0x363f18,_0x19a866===![];_0x5b1bb5+=0x1){if(_0x18f932[_0xf359('0x14')](_0x4b01aa[_0x5b1bb5])>=0x0){_0x19a866=!![];}}if(!_0x19a866){throw new Error(util[_0xf359('0xf')](_0xf359('0x15'),_0x27b7c2[_0xf359('0x11')]['pid']));}process['kill'](_0x27b7c2[_0xf359('0x11')][_0xf359('0x12')],_0xf359('0x16'));return _0x5d89e0[_0xf359('0xd')](0xc8)[_0xf359('0xe')]({'message':util[_0xf359('0xf')](_0xf359('0x17'),_0x27b7c2[_0xf359('0x11')]['pid'])});})[_0xf359('0x18')](handleError(_0x5d89e0,null,_0xf359('0x19')));}; \ No newline at end of file +var _0x32a6=['split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','kill','SIGINT','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash','inspect','status','send','index','then','json','catch','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid'];(function(_0x1ca02b,_0x58460d){var _0x17a719=function(_0x56334a){while(--_0x56334a){_0x1ca02b['push'](_0x1ca02b['shift']());}};_0x17a719(++_0x58460d);}(_0x32a6,0xa3));var _0x632a=function(_0x17e05a,_0x25e3a){_0x17e05a=_0x17e05a-0x0;var _0x5a1bb9=_0x32a6[_0x17e05a];return _0x5a1bb9;};'use strict';var info=require(_0x632a('0x0'));var exec=require(_0x632a('0x1'))[_0x632a('0x2')];var logger=require(_0x632a('0x3'))(_0x632a('0x4'));var util=require(_0x632a('0x5'));var BPromise=require(_0x632a('0x6'));var _=require(_0x632a('0x7'));function handleError(_0x209cb7,_0x20ddcc,_0x4651ec){_0x20ddcc=_0x20ddcc||0x1f4;return function(_0x5ac67b){logger['error']('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x4651ec,_0x20ddcc,util[_0x632a('0x8')](_0x5ac67b,{'showHidden':![],'depth':null}));delete _0x5ac67b['name'];_0x209cb7[_0x632a('0x9')](_0x20ddcc)[_0x632a('0xa')](_0x5ac67b);};}exports[_0x632a('0xb')]=function(_0x22e619,_0x3f9608){return info['getAllData']()[_0x632a('0xc')](function(_0x41fea8){return _0x3f9608[_0x632a('0x9')](0xc8)[_0x632a('0xd')](_0x41fea8);})[_0x632a('0xe')](function(_0x3bc3b1){return _0x3f9608[_0x632a('0x9')](0x1f4)[_0x632a('0xd')](_0x3bc3b1);});};exports[_0x632a('0xf')]=function(_0x2a9f30,_0x10e0ac){var _0x204ca7=['components/import/cm'];return new BPromise(function(_0x154e85,_0x37600a){return exec(util[_0x632a('0x10')](_0x632a('0x11'),_0x2a9f30['params'][_0x632a('0x12')]),function(_0x373213,_0x325646,_0x3a13e9){if(_0x373213){return _0x37600a(_0x373213);}return _0x154e85(_0x325646);});})[_0x632a('0xc')](function(_0x12dabb){var _0x3f0458=![];var _0x251bc2=_0x12dabb[_0x632a('0x13')](/\n/);for(var _0x3e1e18=0x0,_0x490af7=_0x204ca7[_0x632a('0x14')];_0x3e1e18<_0x490af7,_0x3f0458===![];_0x3e1e18+=0x1){if(_0x12dabb[_0x632a('0x15')](_0x204ca7[_0x3e1e18])>=0x0){_0x3f0458=!![];}}if(!_0x3f0458){throw new Error(util['format'](_0x632a('0x16'),_0x2a9f30[_0x632a('0x17')][_0x632a('0x12')]));}process[_0x632a('0x18')](_0x2a9f30[_0x632a('0x17')][_0x632a('0x12')],_0x632a('0x19'));return _0x10e0ac[_0x632a('0x9')](0xc8)['json']({'message':util[_0x632a('0x10')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x2a9f30[_0x632a('0x17')][_0x632a('0x12')])});})[_0x632a('0xe')](handleError(_0x10e0ac,null,_0x632a('0xf')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index a517372..bf159b8 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 _0x4b84=['update','delete','destroy','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/describe','describe','isAuthenticated','show','post','create','put','/:id'];(function(_0x46f7f0,_0x4ef418){var _0x783786=function(_0x1ad786){while(--_0x1ad786){_0x46f7f0['push'](_0x46f7f0['shift']());}};_0x783786(++_0x4ef418);}(_0x4b84,0x1cc));var _0x44b8=function(_0x3c4f1f,_0x20d3ec){_0x3c4f1f=_0x3c4f1f-0x0;var _0x19cb69=_0x4b84[_0x3c4f1f];return _0x19cb69;};'use strict';var multer=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x44b8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x44b8('0x3'));var interaction=require(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var controller=require('./tag.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x44b8('0x6')]);router['get'](_0x44b8('0x7'),auth['isAuthenticated'](),controller[_0x44b8('0x8')]);router['get']('/:id',auth[_0x44b8('0x9')](),controller[_0x44b8('0xa')]);router[_0x44b8('0xb')]('/',auth['isAuthenticated'](),controller[_0x44b8('0xc')]);router[_0x44b8('0xd')](_0x44b8('0xe'),auth[_0x44b8('0x9')](),controller[_0x44b8('0xf')]);router[_0x44b8('0x10')](_0x44b8('0xe'),auth['isAuthenticated'](),controller[_0x44b8('0x11')]);module[_0x44b8('0x12')]=router; \ No newline at end of file +var _0x2dae=['show','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./tag.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x2dae,0xc3));var _0xe2da=function(_0x2ae2ad,_0xac5b0c){_0x2ae2ad=_0x2ae2ad-0x0;var _0x26dbd7=_0x2dae[_0x2ae2ad];return _0x26dbd7;};'use strict';var multer=require(_0xe2da('0x0'));var util=require('util');var path=require(_0xe2da('0x1'));var timeout=require(_0xe2da('0x2'));var express=require(_0xe2da('0x3'));var router=express[_0xe2da('0x4')]();var fs_extra=require(_0xe2da('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe2da('0x6'));var config=require(_0xe2da('0x7'));var controller=require(_0xe2da('0x8'));router[_0xe2da('0x9')]('/',auth['isAuthenticated'](),controller[_0xe2da('0xa')]);router[_0xe2da('0x9')](_0xe2da('0xb'),auth[_0xe2da('0xc')](),controller[_0xe2da('0xd')]);router[_0xe2da('0x9')](_0xe2da('0xe'),auth[_0xe2da('0xc')](),controller[_0xe2da('0xf')]);router['post']('/',auth[_0xe2da('0xc')](),controller[_0xe2da('0x10')]);router[_0xe2da('0x11')](_0xe2da('0xe'),auth[_0xe2da('0xc')](),controller[_0xe2da('0x12')]);router[_0xe2da('0x13')](_0xe2da('0xe'),auth['isAuthenticated'](),controller[_0xe2da('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 1ea8608..020ccda 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 _0x688a=['STRING','sequelize','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x688a,0x124));var _0xa688=function(_0x426370,_0x17ecbc){_0x426370=_0x426370-0x0;var _0x3de4e2=_0x688a[_0x426370];return _0x3de4e2;};'use strict';var Sequelize=require(_0xa688('0x0'));module[_0xa688('0x1')]={'name':{'type':Sequelize[_0xa688('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xa688('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xa688('0x2')]}}; \ No newline at end of file +var _0x6f3e=['exports','STRING','name','#0091EA','sequelize'];(function(_0x532e0b,_0x217981){var _0x58009b=function(_0x46857a){while(--_0x46857a){_0x532e0b['push'](_0x532e0b['shift']());}};_0x58009b(++_0x217981);}(_0x6f3e,0x9f));var _0xe6f3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f3e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe6f3('0x0'));module[_0xe6f3('0x1')]={'name':{'type':Sequelize[_0xe6f3('0x2')],'unique':_0xe6f3('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xe6f3('0x2')],'defaultValue':_0xe6f3('0x4')},'description':{'type':Sequelize[_0xe6f3('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index bd49d97..bb4e99f 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 _0x4fd8=['status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','update','then','destroy','UserProfileResource','stack','name','send','index','Tag','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Tags','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','eml-format','rimraf','zip-dir','moment','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x1aa39e,_0x47f38d){var _0x1780d=function(_0x4c5c2a){while(--_0x4c5c2a){_0x1aa39e['push'](_0x1aa39e['shift']());}};_0x1780d(++_0x47f38d);}(_0x4fd8,0x129));var _0x84fd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4fd8[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x84fd('0x0'));var rimraf=require(_0x84fd('0x1'));var zipdir=require(_0x84fd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x84fd('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x84fd('0x4'));var csv=require(_0x84fd('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x84fd('0x6'));var _=require('lodash');var squel=require(_0x84fd('0x7'));var crypto=require(_0x84fd('0x8'));var jsforce=require(_0x84fd('0x9'));var deskjs=require(_0x84fd('0xa'));var toCsv=require('to-csv');var querystring=require(_0x84fd('0xb'));var Papa=require(_0x84fd('0xc'));var Redis=require(_0x84fd('0xd'));var authService=require(_0x84fd('0xe'));var qs=require(_0x84fd('0xf'));var as=require(_0x84fd('0x10'));var hardwareService=require(_0x84fd('0x11'));var logger=require(_0x84fd('0x12'))('api');var utils=require(_0x84fd('0x13'));var config=require(_0x84fd('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x84fd('0x15'))['db'];function respondWithStatusCode(_0x3d65a1,_0x250947){_0x250947=_0x250947||0xcc;return function(_0x466830){if(_0x466830){return _0x3d65a1[_0x84fd('0x16')](_0x250947);}return _0x3d65a1[_0x84fd('0x17')](_0x250947)[_0x84fd('0x18')]();};}function respondWithResult(_0x5b2798,_0x28f41b){_0x28f41b=_0x28f41b||0xc8;return function(_0x4d9106){if(_0x4d9106){return _0x5b2798[_0x84fd('0x17')](_0x28f41b)[_0x84fd('0x19')](_0x4d9106);}};}function respondWithFilteredResult(_0x24c0a9,_0x2be640){return function(_0x5a7830){if(_0x5a7830){var _0x130a8e=typeof _0x2be640[_0x84fd('0x1a')]==='undefined'&&typeof _0x2be640['limit']===_0x84fd('0x1b');var _0x363aa1=_0x5a7830['count'];var _0x514445=_0x130a8e?0x0:_0x2be640[_0x84fd('0x1a')];var _0x517a05=_0x130a8e?_0x5a7830[_0x84fd('0x1c')]:_0x2be640[_0x84fd('0x1a')]+_0x2be640[_0x84fd('0x1d')];var _0x1ba9f5;if(_0x517a05>=_0x363aa1){_0x517a05=_0x363aa1;_0x1ba9f5=0xc8;}else{_0x1ba9f5=0xce;}_0x24c0a9['status'](_0x1ba9f5);return _0x24c0a9['set'](_0x84fd('0x1e'),_0x514445+'-'+_0x517a05+'/'+_0x363aa1)[_0x84fd('0x19')](_0x5a7830);}return null;};}function patchUpdates(_0x4a178d){return function(_0x39e829){try{jsonpatch[_0x84fd('0x1f')](_0x39e829,_0x4a178d,!![]);}catch(_0x5c170b){return BPromise[_0x84fd('0x20')](_0x5c170b);}return _0x39e829['save']();};}function saveUpdates(_0xe660c6,_0x1b0c30){return function(_0x7611bb){if(_0x7611bb){return _0x7611bb[_0x84fd('0x21')](_0xe660c6)[_0x84fd('0x22')](function(_0x1564b5){return _0x1564b5;});}return null;};}function removeEntity(_0x17005d,_0x1b64e8){return function(_0x2d7a1b){if(_0x2d7a1b){return _0x2d7a1b[_0x84fd('0x23')]()[_0x84fd('0x22')](function(){var _0xa6f2f4=_0x2d7a1b['get']({'plain':!![]});var _0x116728='Tags';return db[_0x84fd('0x24')][_0x84fd('0x23')]({'where':{'type':_0x116728,'resourceId':_0xa6f2f4['id']}})[_0x84fd('0x22')](function(){return _0x2d7a1b;});})[_0x84fd('0x22')](function(){_0x17005d[_0x84fd('0x17')](0xcc)[_0x84fd('0x18')]();});}};}function handleEntityNotFound(_0x49a818,_0xbeae3c){return function(_0x3293fe){if(!_0x3293fe){_0x49a818[_0x84fd('0x16')](0x194);}return _0x3293fe;};}function handleError(_0xf38411,_0x573be7){_0x573be7=_0x573be7||0x1f4;return function(_0x40ef13){logger['error'](_0x40ef13[_0x84fd('0x25')]);if(_0x40ef13[_0x84fd('0x26')]){delete _0x40ef13[_0x84fd('0x26')];}_0xf38411[_0x84fd('0x17')](_0x573be7)[_0x84fd('0x27')](_0x40ef13);};}exports[_0x84fd('0x28')]=function(_0x36c9e7,_0x1d38ba){var _0x57275b={},_0x290de5={},_0x1a2810={'count':0x0,'rows':[]};var _0x1aaa65=_['map'](db[_0x84fd('0x29')]['rawAttributes'],function(_0x3fc736){return{'name':_0x3fc736['fieldName'],'type':_0x3fc736[_0x84fd('0x2a')][_0x84fd('0x2b')]};});_0x290de5[_0x84fd('0x2c')]=_[_0x84fd('0x2d')](_0x1aaa65,_0x84fd('0x26'));_0x290de5['query']=_[_0x84fd('0x2e')](_0x36c9e7[_0x84fd('0x2f')]);_0x290de5[_0x84fd('0x30')]=_[_0x84fd('0x31')](_0x290de5[_0x84fd('0x2c')],_0x290de5[_0x84fd('0x2f')]);_0x57275b[_0x84fd('0x32')]=_[_0x84fd('0x31')](_0x290de5[_0x84fd('0x2c')],qs[_0x84fd('0x33')](_0x36c9e7['query'][_0x84fd('0x33')]));_0x57275b[_0x84fd('0x32')]=_0x57275b['attributes'][_0x84fd('0x34')]?_0x57275b[_0x84fd('0x32')]:_0x290de5[_0x84fd('0x2c')];if(!_0x36c9e7[_0x84fd('0x2f')][_0x84fd('0x35')]('nolimit')){_0x57275b['limit']=qs[_0x84fd('0x1d')](_0x36c9e7[_0x84fd('0x2f')]['limit']);_0x57275b[_0x84fd('0x1a')]=qs[_0x84fd('0x1a')](_0x36c9e7[_0x84fd('0x2f')][_0x84fd('0x1a')]);}_0x57275b[_0x84fd('0x36')]=qs[_0x84fd('0x37')](_0x36c9e7[_0x84fd('0x2f')]['sort']);_0x57275b[_0x84fd('0x38')]=qs[_0x84fd('0x30')](_[_0x84fd('0x39')](_0x36c9e7[_0x84fd('0x2f')],_0x290de5['filters']),_0x1aaa65);if(_0x36c9e7[_0x84fd('0x2f')][_0x84fd('0x3a')]){_0x57275b[_0x84fd('0x38')]=_[_0x84fd('0x3b')](_0x57275b['where'],{'$or':_['map'](_0x1aaa65,function(_0x216c82){if(_0x216c82[_0x84fd('0x2a')]!==_0x84fd('0x3c')){var _0x533ac5={};_0x533ac5[_0x216c82[_0x84fd('0x26')]]={'$like':'%'+_0x36c9e7[_0x84fd('0x2f')][_0x84fd('0x3a')]+'%'};return _0x533ac5;}})});}_0x57275b=_[_0x84fd('0x3b')]({},_0x57275b,_0x36c9e7['options']);var _0x1ca3c4={'where':_0x57275b[_0x84fd('0x38')]};return db[_0x84fd('0x29')]['count'](_0x1ca3c4)[_0x84fd('0x22')](function(_0x19e353){_0x1a2810[_0x84fd('0x1c')]=_0x19e353;if(_0x36c9e7[_0x84fd('0x2f')][_0x84fd('0x3d')]){_0x57275b[_0x84fd('0x3e')]=[{'all':!![]}];}return db['Tag']['findAll'](_0x57275b);})[_0x84fd('0x22')](function(_0x537a76){_0x1a2810[_0x84fd('0x3f')]=_0x537a76;return _0x1a2810;})[_0x84fd('0x22')](respondWithFilteredResult(_0x1d38ba,_0x57275b))[_0x84fd('0x40')](handleError(_0x1d38ba,null));};exports[_0x84fd('0x41')]=function(_0x56b693,_0xf2f85f){var _0x10de3f={'raw':!![],'where':{'id':_0x56b693[_0x84fd('0x42')]['id']}},_0x516461={};_0x516461[_0x84fd('0x2c')]=_[_0x84fd('0x2e')](db[_0x84fd('0x29')]['rawAttributes']);_0x516461[_0x84fd('0x2f')]=_[_0x84fd('0x2e')](_0x56b693['query']);_0x516461[_0x84fd('0x30')]=_[_0x84fd('0x31')](_0x516461[_0x84fd('0x2c')],_0x516461[_0x84fd('0x2f')]);_0x10de3f['attributes']=_['intersection'](_0x516461['model'],qs['fields'](_0x56b693[_0x84fd('0x2f')]['fields']));_0x10de3f[_0x84fd('0x32')]=_0x10de3f[_0x84fd('0x32')][_0x84fd('0x34')]?_0x10de3f[_0x84fd('0x32')]:_0x516461[_0x84fd('0x2c')];if(_0x56b693[_0x84fd('0x2f')][_0x84fd('0x3d')]){_0x10de3f[_0x84fd('0x3e')]=[{'all':!![]}];}_0x10de3f=_[_0x84fd('0x3b')]({},_0x10de3f,_0x56b693[_0x84fd('0x43')]);return db[_0x84fd('0x29')][_0x84fd('0x44')](_0x10de3f)[_0x84fd('0x22')](handleEntityNotFound(_0xf2f85f,null))[_0x84fd('0x22')](respondWithResult(_0xf2f85f,null))[_0x84fd('0x40')](handleError(_0xf2f85f,null));};exports[_0x84fd('0x45')]=function(_0xbfbef2,_0x1a59ca){return db[_0x84fd('0x29')]['create'](_0xbfbef2[_0x84fd('0x46')],{})[_0x84fd('0x22')](function(_0x1a664a){var _0x22d773=_0xbfbef2['user'][_0x84fd('0x47')]({'plain':!![]});if(!_0x22d773)throw new Error(_0x84fd('0x48'));if(_0x22d773[_0x84fd('0x49')]==='user'){var _0x1e3cdc=_0x1a664a['get']({'plain':!![]});var _0x513c99=_0x84fd('0x4a');return db[_0x84fd('0x4b')][_0x84fd('0x44')]({'where':{'name':_0x513c99,'userProfileId':_0x22d773['userProfileId']},'raw':!![]})['then'](function(_0x292465){if(_0x292465&&_0x292465[_0x84fd('0x4c')]===0x0){return db[_0x84fd('0x24')][_0x84fd('0x45')]({'name':_0x1e3cdc[_0x84fd('0x26')],'resourceId':_0x1e3cdc['id'],'type':_0x292465[_0x84fd('0x26')],'sectionId':_0x292465['id']},{})[_0x84fd('0x22')](function(){return _0x1a664a;});}else{return _0x1a664a;}})[_0x84fd('0x40')](function(_0x171292){logger[_0x84fd('0x4d')](_0x84fd('0x4e'),_0x171292);throw _0x171292;});}return _0x1a664a;})['then'](respondWithResult(_0x1a59ca,0xc9))[_0x84fd('0x40')](handleError(_0x1a59ca,null));};exports['update']=function(_0x2ff2c0,_0x29eb91){if(_0x2ff2c0[_0x84fd('0x46')]['id']){delete _0x2ff2c0[_0x84fd('0x46')]['id'];}return db[_0x84fd('0x29')][_0x84fd('0x44')]({'where':{'id':_0x2ff2c0[_0x84fd('0x42')]['id']}})[_0x84fd('0x22')](handleEntityNotFound(_0x29eb91,null))['then'](saveUpdates(_0x2ff2c0[_0x84fd('0x46')],null))[_0x84fd('0x22')](respondWithResult(_0x29eb91,null))[_0x84fd('0x40')](handleError(_0x29eb91,null));};exports[_0x84fd('0x23')]=function(_0x34fce3,_0x988506){return db['Tag'][_0x84fd('0x44')]({'where':{'id':_0x34fce3[_0x84fd('0x42')]['id']}})['then'](handleEntityNotFound(_0x988506,null))[_0x84fd('0x22')](removeEntity(_0x988506,null))[_0x84fd('0x40')](handleError(_0x988506,null));};exports[_0x84fd('0x4f')]=function(_0x37f1c0,_0x48e0f9){return db['Tag'][_0x84fd('0x4f')]()[_0x84fd('0x22')](respondWithResult(_0x48e0f9,null))[_0x84fd('0x40')](handleError(_0x48e0f9,null));}; \ No newline at end of file +var _0xedca=['merge','options','includeAll','findAll','show','params','include','find','create','body','user','role','userProfileId','autoAssociation','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','set','Content-Range','json','apply','reject','save','update','then','get','Tags','UserProfileResource','destroy','error','stack','name','send','map','Tag','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL'];(function(_0xb56068,_0x1cd7a0){var _0x4b9c59=function(_0x137e25){while(--_0x137e25){_0xb56068['push'](_0xb56068['shift']());}};_0x4b9c59(++_0x1cd7a0);}(_0xedca,0x15c));var _0xaedc=function(_0xd99387,_0x2be94f){_0xd99387=_0xd99387-0x0;var _0x393bc2=_0xedca[_0xd99387];return _0x393bc2;};'use strict';var emlformat=require(_0xaedc('0x0'));var rimraf=require(_0xaedc('0x1'));var zipdir=require(_0xaedc('0x2'));var jsonpatch=require(_0xaedc('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xaedc('0x4'));var Mustache=require(_0xaedc('0x5'));var util=require(_0xaedc('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xaedc('0x7'));var ejs=require(_0xaedc('0x8'));var fs=require('fs');var fs_extra=require(_0xaedc('0x9'));var _=require('lodash');var squel=require(_0xaedc('0xa'));var crypto=require(_0xaedc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xaedc('0xc'));var toCsv=require(_0xaedc('0x7'));var querystring=require(_0xaedc('0xd'));var Papa=require(_0xaedc('0xe'));var Redis=require(_0xaedc('0xf'));var authService=require(_0xaedc('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xaedc('0x11'));var hardwareService=require(_0xaedc('0x12'));var logger=require(_0xaedc('0x13'))(_0xaedc('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xaedc('0x15'));var db=require(_0xaedc('0x16'))['db'];function respondWithStatusCode(_0x547bc0,_0x3c0dd3){_0x3c0dd3=_0x3c0dd3||0xcc;return function(_0x5c0660){if(_0x5c0660){return _0x547bc0[_0xaedc('0x17')](_0x3c0dd3);}return _0x547bc0['status'](_0x3c0dd3)[_0xaedc('0x18')]();};}function respondWithResult(_0x297cce,_0x22c711){_0x22c711=_0x22c711||0xc8;return function(_0x5e349f){if(_0x5e349f){return _0x297cce['status'](_0x22c711)['json'](_0x5e349f);}};}function respondWithFilteredResult(_0x5e4a6d,_0x12cf5d){return function(_0x5f01d5){if(_0x5f01d5){var _0x5d3252=typeof _0x12cf5d[_0xaedc('0x19')]===_0xaedc('0x1a')&&typeof _0x12cf5d[_0xaedc('0x1b')]===_0xaedc('0x1a');var _0x36a176=_0x5f01d5[_0xaedc('0x1c')];var _0x4b222a=_0x5d3252?0x0:_0x12cf5d['offset'];var _0x510893=_0x5d3252?_0x5f01d5['count']:_0x12cf5d[_0xaedc('0x19')]+_0x12cf5d[_0xaedc('0x1b')];var _0x46f2a4;if(_0x510893>=_0x36a176){_0x510893=_0x36a176;_0x46f2a4=0xc8;}else{_0x46f2a4=0xce;}_0x5e4a6d[_0xaedc('0x1d')](_0x46f2a4);return _0x5e4a6d[_0xaedc('0x1e')](_0xaedc('0x1f'),_0x4b222a+'-'+_0x510893+'/'+_0x36a176)[_0xaedc('0x20')](_0x5f01d5);}return null;};}function patchUpdates(_0x1b4937){return function(_0x40d844){try{jsonpatch[_0xaedc('0x21')](_0x40d844,_0x1b4937,!![]);}catch(_0x26dcf1){return BPromise[_0xaedc('0x22')](_0x26dcf1);}return _0x40d844[_0xaedc('0x23')]();};}function saveUpdates(_0xb1582d,_0x4ade2a){return function(_0x151b1f){if(_0x151b1f){return _0x151b1f[_0xaedc('0x24')](_0xb1582d)[_0xaedc('0x25')](function(_0x161e9c){return _0x161e9c;});}return null;};}function removeEntity(_0x65c624,_0x352b58){return function(_0x4a5c5e){if(_0x4a5c5e){return _0x4a5c5e['destroy']()['then'](function(){var _0x18f775=_0x4a5c5e[_0xaedc('0x26')]({'plain':!![]});var _0x2b5e00=_0xaedc('0x27');return db[_0xaedc('0x28')][_0xaedc('0x29')]({'where':{'type':_0x2b5e00,'resourceId':_0x18f775['id']}})[_0xaedc('0x25')](function(){return _0x4a5c5e;});})[_0xaedc('0x25')](function(){_0x65c624[_0xaedc('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x249d26,_0x3a1c42){return function(_0x4f7832){if(!_0x4f7832){_0x249d26[_0xaedc('0x17')](0x194);}return _0x4f7832;};}function handleError(_0x18ab69,_0x4ac4f2){_0x4ac4f2=_0x4ac4f2||0x1f4;return function(_0x689239){logger[_0xaedc('0x2a')](_0x689239[_0xaedc('0x2b')]);if(_0x689239[_0xaedc('0x2c')]){delete _0x689239[_0xaedc('0x2c')];}_0x18ab69['status'](_0x4ac4f2)[_0xaedc('0x2d')](_0x689239);};}exports['index']=function(_0x2e0609,_0x5d02b0){var _0x47227a={},_0x345bab={},_0x70fd96={'count':0x0,'rows':[]};var _0x1f82ce=_[_0xaedc('0x2e')](db[_0xaedc('0x2f')][_0xaedc('0x30')],function(_0x376904){return{'name':_0x376904[_0xaedc('0x31')],'type':_0x376904[_0xaedc('0x32')][_0xaedc('0x33')]};});_0x345bab[_0xaedc('0x34')]=_[_0xaedc('0x2e')](_0x1f82ce,_0xaedc('0x2c'));_0x345bab[_0xaedc('0x35')]=_[_0xaedc('0x36')](_0x2e0609[_0xaedc('0x35')]);_0x345bab['filters']=_[_0xaedc('0x37')](_0x345bab[_0xaedc('0x34')],_0x345bab[_0xaedc('0x35')]);_0x47227a['attributes']=_['intersection'](_0x345bab[_0xaedc('0x34')],qs['fields'](_0x2e0609[_0xaedc('0x35')][_0xaedc('0x38')]));_0x47227a[_0xaedc('0x39')]=_0x47227a[_0xaedc('0x39')][_0xaedc('0x3a')]?_0x47227a[_0xaedc('0x39')]:_0x345bab[_0xaedc('0x34')];if(!_0x2e0609[_0xaedc('0x35')][_0xaedc('0x3b')]('nolimit')){_0x47227a[_0xaedc('0x1b')]=qs[_0xaedc('0x1b')](_0x2e0609[_0xaedc('0x35')]['limit']);_0x47227a[_0xaedc('0x19')]=qs[_0xaedc('0x19')](_0x2e0609[_0xaedc('0x35')][_0xaedc('0x19')]);}_0x47227a[_0xaedc('0x3c')]=qs[_0xaedc('0x3d')](_0x2e0609[_0xaedc('0x35')]['sort']);_0x47227a[_0xaedc('0x3e')]=qs[_0xaedc('0x3f')](_[_0xaedc('0x40')](_0x2e0609[_0xaedc('0x35')],_0x345bab['filters']),_0x1f82ce);if(_0x2e0609[_0xaedc('0x35')][_0xaedc('0x41')]){_0x47227a[_0xaedc('0x3e')]=_['merge'](_0x47227a[_0xaedc('0x3e')],{'$or':_['map'](_0x1f82ce,function(_0x28ca06){if(_0x28ca06[_0xaedc('0x32')]!==_0xaedc('0x42')){var _0x188d47={};_0x188d47[_0x28ca06[_0xaedc('0x2c')]]={'$like':'%'+_0x2e0609[_0xaedc('0x35')][_0xaedc('0x41')]+'%'};return _0x188d47;}})});}_0x47227a=_[_0xaedc('0x43')]({},_0x47227a,_0x2e0609[_0xaedc('0x44')]);var _0x54a9fe={'where':_0x47227a['where']};return db['Tag'][_0xaedc('0x1c')](_0x54a9fe)[_0xaedc('0x25')](function(_0xad9b95){_0x70fd96[_0xaedc('0x1c')]=_0xad9b95;if(_0x2e0609[_0xaedc('0x35')][_0xaedc('0x45')]){_0x47227a['include']=[{'all':!![]}];}return db[_0xaedc('0x2f')][_0xaedc('0x46')](_0x47227a);})[_0xaedc('0x25')](function(_0x176d49){_0x70fd96['rows']=_0x176d49;return _0x70fd96;})[_0xaedc('0x25')](respondWithFilteredResult(_0x5d02b0,_0x47227a))['catch'](handleError(_0x5d02b0,null));};exports[_0xaedc('0x47')]=function(_0x57cd34,_0x1ac64b){var _0x400991={'raw':!![],'where':{'id':_0x57cd34[_0xaedc('0x48')]['id']}},_0x324003={};_0x324003['model']=_[_0xaedc('0x36')](db['Tag'][_0xaedc('0x30')]);_0x324003[_0xaedc('0x35')]=_['keys'](_0x57cd34['query']);_0x324003[_0xaedc('0x3f')]=_[_0xaedc('0x37')](_0x324003[_0xaedc('0x34')],_0x324003['query']);_0x400991['attributes']=_[_0xaedc('0x37')](_0x324003[_0xaedc('0x34')],qs['fields'](_0x57cd34[_0xaedc('0x35')][_0xaedc('0x38')]));_0x400991[_0xaedc('0x39')]=_0x400991['attributes']['length']?_0x400991[_0xaedc('0x39')]:_0x324003[_0xaedc('0x34')];if(_0x57cd34[_0xaedc('0x35')][_0xaedc('0x45')]){_0x400991[_0xaedc('0x49')]=[{'all':!![]}];}_0x400991=_[_0xaedc('0x43')]({},_0x400991,_0x57cd34[_0xaedc('0x44')]);return db[_0xaedc('0x2f')][_0xaedc('0x4a')](_0x400991)['then'](handleEntityNotFound(_0x1ac64b,null))[_0xaedc('0x25')](respondWithResult(_0x1ac64b,null))['catch'](handleError(_0x1ac64b,null));};exports[_0xaedc('0x4b')]=function(_0x2a88ff,_0x10acd0){return db[_0xaedc('0x2f')][_0xaedc('0x4b')](_0x2a88ff[_0xaedc('0x4c')],{})[_0xaedc('0x25')](function(_0x5ba65a){var _0x314ff1=_0x2a88ff[_0xaedc('0x4d')][_0xaedc('0x26')]({'plain':!![]});if(!_0x314ff1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x314ff1[_0xaedc('0x4e')]===_0xaedc('0x4d')){var _0x19626b=_0x5ba65a[_0xaedc('0x26')]({'plain':!![]});var _0x1e57a5='Tags';return db['UserProfileSection'][_0xaedc('0x4a')]({'where':{'name':_0x1e57a5,'userProfileId':_0x314ff1[_0xaedc('0x4f')]},'raw':!![]})[_0xaedc('0x25')](function(_0x188fa9){if(_0x188fa9&&_0x188fa9[_0xaedc('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x19626b[_0xaedc('0x2c')],'resourceId':_0x19626b['id'],'type':_0x188fa9[_0xaedc('0x2c')],'sectionId':_0x188fa9['id']},{})['then'](function(){return _0x5ba65a;});}else{return _0x5ba65a;}})['catch'](function(_0x2326cd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2326cd);throw _0x2326cd;});}return _0x5ba65a;})[_0xaedc('0x25')](respondWithResult(_0x10acd0,0xc9))[_0xaedc('0x51')](handleError(_0x10acd0,null));};exports[_0xaedc('0x24')]=function(_0x1cf8f6,_0x53bcb7){if(_0x1cf8f6[_0xaedc('0x4c')]['id']){delete _0x1cf8f6[_0xaedc('0x4c')]['id'];}return db[_0xaedc('0x2f')][_0xaedc('0x4a')]({'where':{'id':_0x1cf8f6[_0xaedc('0x48')]['id']}})[_0xaedc('0x25')](handleEntityNotFound(_0x53bcb7,null))[_0xaedc('0x25')](saveUpdates(_0x1cf8f6['body'],null))['then'](respondWithResult(_0x53bcb7,null))[_0xaedc('0x51')](handleError(_0x53bcb7,null));};exports[_0xaedc('0x29')]=function(_0x4046b1,_0x285307){return db['Tag']['find']({'where':{'id':_0x4046b1['params']['id']}})[_0xaedc('0x25')](handleEntityNotFound(_0x285307,null))[_0xaedc('0x25')](removeEntity(_0x285307,null))['catch'](handleError(_0x285307,null));};exports[_0xaedc('0x52')]=function(_0x391639,_0x5e145d){return db[_0xaedc('0x2f')]['describe']()[_0xaedc('0x25')](respondWithResult(_0x5e145d,null))[_0xaedc('0x51')](handleError(_0x5e145d,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 9762a7b..0632499 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 _0x095f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','Tag','tools_tags','lodash','util','../../config/logger'];(function(_0x3fc120,_0x10cf63){var _0x268d5f=function(_0x4f8329){while(--_0x4f8329){_0x3fc120['push'](_0x3fc120['shift']());}};_0x268d5f(++_0x10cf63);}(_0x095f,0x8c));var _0xf095=function(_0xf4a0d,_0x5d28b7){_0xf4a0d=_0xf4a0d-0x0;var _0x1fce82=_0x095f[_0xf4a0d];return _0x1fce82;};'use strict';var _=require(_0xf095('0x0'));var util=require(_0xf095('0x1'));var logger=require(_0xf095('0x2'))(_0xf095('0x3'));var moment=require(_0xf095('0x4'));var BPromise=require(_0xf095('0x5'));var rp=require(_0xf095('0x6'));var fs=require('fs');var path=require(_0xf095('0x7'));var rimraf=require(_0xf095('0x8'));var config=require(_0xf095('0x9'));var attributes=require(_0xf095('0xa'));module['exports']=function(_0x52aa40,_0x28c17e){return _0x52aa40['define'](_0xf095('0xb'),attributes,{'tableName':_0xf095('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x274c=['path','rimraf','./tag.attributes','exports','define','tools_tags','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x274c,0xae));var _0xc274=function(_0x491faa,_0x4f2907){_0x491faa=_0x491faa-0x0;var _0x414440=_0x274c[_0x491faa];return _0x414440;};'use strict';var _=require(_0xc274('0x0'));var util=require(_0xc274('0x1'));var logger=require(_0xc274('0x2'))(_0xc274('0x3'));var moment=require(_0xc274('0x4'));var BPromise=require(_0xc274('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc274('0x6'));var rimraf=require(_0xc274('0x7'));var config=require('../../config/environment');var attributes=require(_0xc274('0x8'));module[_0xc274('0x9')]=function(_0x294072,_0x21a674){return _0x294072[_0xc274('0xa')]('Tag',attributes,{'tableName':_0xc274('0xb'),'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 474aefe..1f9fb96 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 _0x5089=['result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x1667df,_0x266940){var _0x341abf=function(_0x123c3f){while(--_0x123c3f){_0x1667df['push'](_0x1667df['shift']());}};_0x341abf(++_0x266940);}(_0x5089,0x1bb));var _0x9508=function(_0x25c326,_0x250137){_0x25c326=_0x25c326-0x0;var _0x762452=_0x5089[_0x25c326];return _0x762452;};'use strict';var _=require(_0x9508('0x0'));var util=require(_0x9508('0x1'));var moment=require('moment');var BPromise=require(_0x9508('0x2'));var rs=require(_0x9508('0x3'));var fs=require('fs');var Redis=require(_0x9508('0x4'));var db=require(_0x9508('0x5'))['db'];var utils=require(_0x9508('0x6'));var logger=require('../../config/logger')(_0x9508('0x7'));var config=require('../../config/environment');var jayson=require(_0x9508('0x8'));var client=jayson[_0x9508('0x9')][_0x9508('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ab3c6,_0x1dc04c,_0x42d13a){return new BPromise(function(_0x55a5de,_0x14dae7){return client[_0x9508('0xb')](_0x4ab3c6,_0x42d13a)['then'](function(_0x342ddd){logger['info'](_0x9508('0xc'),_0x1dc04c,_0x9508('0xd'));logger[_0x9508('0xe')](_0x9508('0xf'),_0x1dc04c,_0x9508('0xd'),JSON[_0x9508('0x10')](_0x342ddd));if(_0x342ddd['error']){if(_0x342ddd[_0x9508('0x11')]['code']===0x1f4){logger[_0x9508('0x11')](_0x9508('0xc'),_0x1dc04c,_0x342ddd['error'][_0x9508('0x12')]);return _0x14dae7(_0x342ddd[_0x9508('0x11')][_0x9508('0x12')]);}logger[_0x9508('0x11')]('Tag,\x20%s,\x20%s',_0x1dc04c,_0x342ddd[_0x9508('0x11')][_0x9508('0x12')]);return _0x55a5de(_0x342ddd['error'][_0x9508('0x12')]);}else{logger['info'](_0x9508('0xc'),_0x1dc04c,_0x9508('0xd'));_0x55a5de(_0x342ddd[_0x9508('0x13')][_0x9508('0x12')]);}})[_0x9508('0x14')](function(_0x343802){logger[_0x9508('0x11')](_0x9508('0xc'),_0x1dc04c,_0x343802);_0x14dae7(_0x343802);});});} \ No newline at end of file +var _0x43fd=['request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','Tag,\x20%s,\x20%s'];(function(_0x34eb31,_0x8f0f70){var _0x254994=function(_0xbec9a3){while(--_0xbec9a3){_0x34eb31['push'](_0x34eb31['shift']());}};_0x254994(++_0x8f0f70);}(_0x43fd,0x1ec));var _0xd43f=function(_0x583c7c,_0x437395){_0x583c7c=_0x583c7c-0x0;var _0x8be7b1=_0x43fd[_0x583c7c];return _0x8be7b1;};'use strict';var _=require('lodash');var util=require(_0xd43f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd43f('0x1'));var fs=require('fs');var Redis=require(_0xd43f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xd43f('0x3'));var logger=require('../../config/logger')(_0xd43f('0x4'));var config=require(_0xd43f('0x5'));var jayson=require(_0xd43f('0x6'));var client=jayson[_0xd43f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xde214d,_0xad5196,_0x20ccd7){return new BPromise(function(_0x331163,_0x547e12){return client[_0xd43f('0x8')](_0xde214d,_0x20ccd7)[_0xd43f('0x9')](function(_0x52e9c8){logger[_0xd43f('0xa')](_0xd43f('0xb'),_0xad5196,_0xd43f('0xc'));logger[_0xd43f('0xd')](_0xd43f('0xe'),_0xad5196,'request\x20sent',JSON[_0xd43f('0xf')](_0x52e9c8));if(_0x52e9c8[_0xd43f('0x10')]){if(_0x52e9c8[_0xd43f('0x10')][_0xd43f('0x11')]===0x1f4){logger[_0xd43f('0x10')](_0xd43f('0xb'),_0xad5196,_0x52e9c8[_0xd43f('0x10')][_0xd43f('0x12')]);return _0x547e12(_0x52e9c8[_0xd43f('0x10')][_0xd43f('0x12')]);}logger[_0xd43f('0x10')]('Tag,\x20%s,\x20%s',_0xad5196,_0x52e9c8[_0xd43f('0x10')][_0xd43f('0x12')]);return _0x331163(_0x52e9c8[_0xd43f('0x10')]['message']);}else{logger['info']('Tag,\x20%s,\x20%s',_0xad5196,_0xd43f('0xc'));_0x331163(_0x52e9c8[_0xd43f('0x13')]['message']);}})[_0xd43f('0x14')](function(_0x3647df){logger['error']('Tag,\x20%s,\x20%s',_0xad5196,_0x3647df);_0x547e12(_0x3647df);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index decce08..a3a3428 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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 bbfc402..450eb85 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','sequelize','STRING'];(function(_0x194e13,_0x7e3ff3){var _0x480a25=function(_0x87b03e){while(--_0x87b03e){_0x194e13['push'](_0x194e13['shift']());}};_0x480a25(++_0x7e3ff3);}(_0xb10b,0x12a));var _0xbb10=function(_0x4c207b,_0x59f530){_0x4c207b=_0x4c207b-0x0;var _0x560c4f=_0xb10b[_0x4c207b];return _0x560c4f;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0x0713=['STRING','name'];(function(_0x3f62d0,_0x4ff9c1){var _0x1fb2ba=function(_0x349819){while(--_0x349819){_0x3f62d0['push'](_0x3f62d0['shift']());}};_0x1fb2ba(++_0x4ff9c1);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 2af9b4c..a368dc9 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 _0xdc86=['request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./team.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','map','Team','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','params','includeAll','find','create','user','get','role','Teams','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','UserId','QueryTypes','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','getQueues','channel','isValidChannel','ValidationError','Unknown\x20channel','capitalize','toLowerCase','Queue','pick','Queues','addQueues','findOne','add','ids','removeQueues','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','Openchannel','transaction','through','penalty','defaults','TeamVoiceQueue','User','findOrCreate','Queue:save','online','voicePause','upsert','isNil','interface','format','all','spread','removeAgents','Queue:remove','QueueId','UserVoiceQueueRt','getAgents','hasOwnProperty','eml-format','rimraf','fast-json-patch'];(function(_0x5eaa0b,_0x433b2f){var _0x28b295=function(_0x5e4f6d){while(--_0x5e4f6d){_0x5eaa0b['push'](_0x5eaa0b['shift']());}};_0x28b295(++_0x433b2f);}(_0xdc86,0x1d1));var _0x6dc8=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xdc86[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require(_0x6dc8('0x0'));var rimraf=require(_0x6dc8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6dc8('0x2'));var rp=require(_0x6dc8('0x3'));var moment=require(_0x6dc8('0x4'));var BPromise=require(_0x6dc8('0x5'));var Mustache=require(_0x6dc8('0x6'));var util=require(_0x6dc8('0x7'));var path=require('path');var sox=require(_0x6dc8('0x8'));var csv=require(_0x6dc8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6dc8('0xa'));var _=require(_0x6dc8('0xb'));var squel=require(_0x6dc8('0xc'));var crypto=require('crypto');var jsforce=require(_0x6dc8('0xd'));var deskjs=require(_0x6dc8('0xe'));var toCsv=require(_0x6dc8('0x9'));var querystring=require('querystring');var Papa=require(_0x6dc8('0xf'));var Redis=require('ioredis');var authService=require(_0x6dc8('0x10'));var qs=require(_0x6dc8('0x11'));var as=require(_0x6dc8('0x12'));var hardwareService=require(_0x6dc8('0x13'));var logger=require(_0x6dc8('0x14'))(_0x6dc8('0x15'));var utils=require(_0x6dc8('0x16'));var config=require(_0x6dc8('0x17'));var licenseUtil=require(_0x6dc8('0x18'));var db=require(_0x6dc8('0x19'))['db'];config[_0x6dc8('0x1a')]=_['defaults'](config['redis'],{'host':_0x6dc8('0x1b'),'port':0x18eb});var socket=require(_0x6dc8('0x1c'))(new Redis(config['redis']));require(_0x6dc8('0x1d'))[_0x6dc8('0x1e')](socket);function respondWithStatusCode(_0x5afdf0,_0x2d6411){_0x2d6411=_0x2d6411||0xcc;return function(_0x33ebf0){if(_0x33ebf0){return _0x5afdf0['sendStatus'](_0x2d6411);}return _0x5afdf0[_0x6dc8('0x1f')](_0x2d6411)[_0x6dc8('0x20')]();};}function respondWithResult(_0x5c1990,_0x46d983){_0x46d983=_0x46d983||0xc8;return function(_0x1155e2){if(_0x1155e2){return _0x5c1990['status'](_0x46d983)[_0x6dc8('0x21')](_0x1155e2);}};}function respondWithFilteredResult(_0x4fc8a5,_0x8de3e5){return function(_0x39b544){if(_0x39b544){var _0x1146ea=typeof _0x8de3e5[_0x6dc8('0x22')]===_0x6dc8('0x23')&&typeof _0x8de3e5[_0x6dc8('0x24')]===_0x6dc8('0x23');var _0x1bebe8=_0x39b544[_0x6dc8('0x25')];var _0x446105=_0x1146ea?0x0:_0x8de3e5['offset'];var _0x341481=_0x1146ea?_0x39b544[_0x6dc8('0x25')]:_0x8de3e5['offset']+_0x8de3e5['limit'];var _0x30df8b;if(_0x341481>=_0x1bebe8){_0x341481=_0x1bebe8;_0x30df8b=0xc8;}else{_0x30df8b=0xce;}_0x4fc8a5['status'](_0x30df8b);return _0x4fc8a5[_0x6dc8('0x26')](_0x6dc8('0x27'),_0x446105+'-'+_0x341481+'/'+_0x1bebe8)[_0x6dc8('0x21')](_0x39b544);}return null;};}function patchUpdates(_0x4173da){return function(_0x48877c){try{jsonpatch[_0x6dc8('0x28')](_0x48877c,_0x4173da,!![]);}catch(_0x2c37c8){return BPromise[_0x6dc8('0x29')](_0x2c37c8);}return _0x48877c[_0x6dc8('0x2a')]();};}function saveUpdates(_0x37dd9f,_0x264cfd){return function(_0x23024c){if(_0x23024c){return _0x23024c[_0x6dc8('0x2b')](_0x37dd9f)[_0x6dc8('0x2c')](function(_0x4034d3){return _0x4034d3;});}return null;};}function handleEntityNotFound(_0x1165c1,_0x162a6a){return function(_0x2a76c3){if(!_0x2a76c3){_0x1165c1[_0x6dc8('0x2d')](0x194);}return _0x2a76c3;};}function handleError(_0x29d1ef,_0x309e49){_0x309e49=_0x309e49||0x1f4;return function(_0x27f345){logger[_0x6dc8('0x2e')](_0x27f345[_0x6dc8('0x2f')]);if(_0x27f345[_0x6dc8('0x30')]){delete _0x27f345[_0x6dc8('0x30')];}_0x29d1ef[_0x6dc8('0x1f')](_0x309e49)[_0x6dc8('0x31')](_0x27f345);};}exports['index']=function(_0x3b21c0,_0x45fb7f){var _0x6dfeda={},_0x5d9cb9={},_0x468c57={'count':0x0,'rows':[]};var _0x29cc5d=_[_0x6dc8('0x32')](db[_0x6dc8('0x33')][_0x6dc8('0x34')],function(_0x1f06e6){return{'name':_0x1f06e6[_0x6dc8('0x35')],'type':_0x1f06e6[_0x6dc8('0x36')][_0x6dc8('0x37')]};});_0x5d9cb9[_0x6dc8('0x38')]=_[_0x6dc8('0x32')](_0x29cc5d,_0x6dc8('0x30'));_0x5d9cb9[_0x6dc8('0x39')]=_[_0x6dc8('0x3a')](_0x3b21c0[_0x6dc8('0x39')]);_0x5d9cb9[_0x6dc8('0x3b')]=_[_0x6dc8('0x3c')](_0x5d9cb9[_0x6dc8('0x38')],_0x5d9cb9[_0x6dc8('0x39')]);_0x6dfeda['attributes']=_['intersection'](_0x5d9cb9[_0x6dc8('0x38')],qs[_0x6dc8('0x3d')](_0x3b21c0['query']['fields']));_0x6dfeda['attributes']=_0x6dfeda[_0x6dc8('0x3e')][_0x6dc8('0x3f')]?_0x6dfeda[_0x6dc8('0x3e')]:_0x5d9cb9['model'];if(!_0x3b21c0[_0x6dc8('0x39')]['hasOwnProperty'](_0x6dc8('0x40'))){_0x6dfeda['limit']=qs[_0x6dc8('0x24')](_0x3b21c0[_0x6dc8('0x39')][_0x6dc8('0x24')]);_0x6dfeda[_0x6dc8('0x22')]=qs['offset'](_0x3b21c0[_0x6dc8('0x39')][_0x6dc8('0x22')]);}_0x6dfeda[_0x6dc8('0x41')]=qs[_0x6dc8('0x42')](_0x3b21c0[_0x6dc8('0x39')]['sort']);_0x6dfeda[_0x6dc8('0x43')]=qs['filters'](_['pick'](_0x3b21c0['query'],_0x5d9cb9[_0x6dc8('0x3b')]),_0x29cc5d);if(_0x3b21c0[_0x6dc8('0x39')]['filter']){_0x6dfeda['where']=_[_0x6dc8('0x44')](_0x6dfeda['where'],{'$or':_[_0x6dc8('0x32')](_0x29cc5d,function(_0x212859){if(_0x212859[_0x6dc8('0x36')]!==_0x6dc8('0x45')){var _0x2eeb9f={};_0x2eeb9f[_0x212859['name']]={'$like':'%'+_0x3b21c0[_0x6dc8('0x39')][_0x6dc8('0x46')]+'%'};return _0x2eeb9f;}})});}_0x6dfeda=_['merge']({},_0x6dfeda,_0x3b21c0[_0x6dc8('0x47')]);var _0x39105c={'where':_0x6dfeda['where']};return db[_0x6dc8('0x33')]['count'](_0x39105c)[_0x6dc8('0x2c')](function(_0x46d6a6){_0x468c57[_0x6dc8('0x25')]=_0x46d6a6;if(_0x3b21c0[_0x6dc8('0x39')]['includeAll']){_0x6dfeda[_0x6dc8('0x48')]=[{'all':!![]}];}return db[_0x6dc8('0x33')][_0x6dc8('0x49')](_0x6dfeda);})['then'](function(_0x57a03f){_0x468c57[_0x6dc8('0x4a')]=_0x57a03f;return _0x468c57;})[_0x6dc8('0x2c')](respondWithFilteredResult(_0x45fb7f,_0x6dfeda))[_0x6dc8('0x4b')](handleError(_0x45fb7f,null));};exports['show']=function(_0xa695dc,_0x126bc8){var _0x451440={'raw':![],'where':{'id':_0xa695dc[_0x6dc8('0x4c')]['id']}},_0x196559={};_0x196559[_0x6dc8('0x38')]=_[_0x6dc8('0x3a')](db[_0x6dc8('0x33')][_0x6dc8('0x34')]);_0x196559[_0x6dc8('0x39')]=_[_0x6dc8('0x3a')](_0xa695dc[_0x6dc8('0x39')]);_0x196559[_0x6dc8('0x3b')]=_[_0x6dc8('0x3c')](_0x196559[_0x6dc8('0x38')],_0x196559[_0x6dc8('0x39')]);_0x451440[_0x6dc8('0x3e')]=_['intersection'](_0x196559[_0x6dc8('0x38')],qs[_0x6dc8('0x3d')](_0xa695dc['query']['fields']));_0x451440['attributes']=_0x451440[_0x6dc8('0x3e')]['length']?_0x451440[_0x6dc8('0x3e')]:_0x196559[_0x6dc8('0x38')];if(_0xa695dc[_0x6dc8('0x39')][_0x6dc8('0x4d')]){_0x451440[_0x6dc8('0x48')]=[{'all':!![]}];}_0x451440=_['merge']({},_0x451440,_0xa695dc[_0x6dc8('0x47')]);return db['Team'][_0x6dc8('0x4e')](_0x451440)[_0x6dc8('0x2c')](handleEntityNotFound(_0x126bc8,null))[_0x6dc8('0x2c')](respondWithResult(_0x126bc8,null))[_0x6dc8('0x4b')](handleError(_0x126bc8,null));};exports[_0x6dc8('0x4f')]=function(_0x14fa39,_0xb7daf5){return db[_0x6dc8('0x33')][_0x6dc8('0x4f')](_0x14fa39['body'],{})['then'](function(_0x3aac02){var _0x20a4de=_0x14fa39[_0x6dc8('0x50')][_0x6dc8('0x51')]({'plain':!![]});if(!_0x20a4de)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x20a4de[_0x6dc8('0x52')]===_0x6dc8('0x50')){var _0x5cea1c=_0x3aac02['get']({'plain':!![]});var _0x101e22=_0x6dc8('0x53');return db[_0x6dc8('0x54')][_0x6dc8('0x4e')]({'where':{'name':_0x101e22,'userProfileId':_0x20a4de[_0x6dc8('0x55')]},'raw':!![]})['then'](function(_0x2d8726){if(_0x2d8726&&_0x2d8726['autoAssociation']===0x0){return db[_0x6dc8('0x56')][_0x6dc8('0x4f')]({'name':_0x5cea1c['name'],'resourceId':_0x5cea1c['id'],'type':_0x2d8726['name'],'sectionId':_0x2d8726['id']},{})[_0x6dc8('0x2c')](function(){return _0x3aac02;});}else{return _0x3aac02;}})['catch'](function(_0x3ee5ad){logger['error'](_0x6dc8('0x57'),_0x3ee5ad);throw _0x3ee5ad;});}return _0x3aac02;})['then'](respondWithResult(_0xb7daf5,0xc9))[_0x6dc8('0x4b')](handleError(_0xb7daf5,null));};exports['update']=function(_0x2c2fbd,_0x1ff7f8){if(_0x2c2fbd[_0x6dc8('0x58')]['id']){delete _0x2c2fbd['body']['id'];}return db[_0x6dc8('0x33')]['find']({'where':{'id':_0x2c2fbd[_0x6dc8('0x4c')]['id']}})[_0x6dc8('0x2c')](handleEntityNotFound(_0x1ff7f8,null))[_0x6dc8('0x2c')](saveUpdates(_0x2c2fbd[_0x6dc8('0x58')],null))[_0x6dc8('0x2c')](respondWithResult(_0x1ff7f8,null))[_0x6dc8('0x4b')](handleError(_0x1ff7f8,null));};exports[_0x6dc8('0x59')]=function(_0x5421e6,_0x3b5137){var _0x2befa9=_0x5421e6[_0x6dc8('0x4c')]['id'];var _0x44e044=[];return db[_0x6dc8('0x5a')]['transaction'](function(_0x3ec882){var _0x44d6fb=_0x6dc8('0x5b')+_0x2befa9;return db[_0x6dc8('0x5a')][_0x6dc8('0x39')](_0x44d6fb,{'type':db[_0x6dc8('0x5c')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x3ec882})[_0x6dc8('0x2c')](function(_0x12c446){_0x44e044=_['map'](_0x12c446,function(_0x5601ff){return Number(_0x5601ff[_0x6dc8('0x5d')]);});})[_0x6dc8('0x2c')](function(){var _0x5f0c93='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2befa9;return db[_0x6dc8('0x5a')][_0x6dc8('0x39')](_0x5f0c93,{'type':db['Sequelize'][_0x6dc8('0x5e')]['SELECT'],'raw':!![],'transaction':_0x3ec882});})[_0x6dc8('0x2c')](function(_0x1c505b){var _0x21b8dc=_[_0x6dc8('0x32')](_0x1c505b,function(_0x1fc33b){return Number(_0x1fc33b['VoiceQueueId']);});return db['UserVoiceQueue'][_0x6dc8('0x59')]({'where':{'UserId':{'$in':_0x44e044},'VoiceQueueId':{'$in':_0x21b8dc}},'transaction':_0x3ec882});})[_0x6dc8('0x2c')](function(){var _0x364699=_0x6dc8('0x5f')+_0x2befa9;return db['sequelize'][_0x6dc8('0x39')](_0x364699,{'type':db['Sequelize'][_0x6dc8('0x5e')][_0x6dc8('0x60')],'raw':!![],'transaction':_0x3ec882});})[_0x6dc8('0x2c')](function(_0x99bb85){var _0x4c20c0=_[_0x6dc8('0x32')](_0x99bb85,function(_0xe67dc3){return Number(_0xe67dc3[_0x6dc8('0x61')]);});return db[_0x6dc8('0x62')]['destroy']({'where':{'UserId':{'$in':_0x44e044},'MailQueueId':{'$in':_0x4c20c0}},'transaction':_0x3ec882});})['then'](function(){var _0x4386b9=_0x6dc8('0x63')+_0x2befa9;return db[_0x6dc8('0x5a')][_0x6dc8('0x39')](_0x4386b9,{'type':db['Sequelize'][_0x6dc8('0x5e')][_0x6dc8('0x60')],'raw':!![],'transaction':_0x3ec882});})[_0x6dc8('0x2c')](function(_0x2c8282){var _0x472ebe=_[_0x6dc8('0x32')](_0x2c8282,function(_0x2b61cb){return Number(_0x2b61cb['SmsQueueId']);});return db[_0x6dc8('0x64')]['destroy']({'where':{'UserId':{'$in':_0x44e044},'SmsQueueId':{'$in':_0x472ebe}},'transaction':_0x3ec882});})['then'](function(){var _0x42bd26=_0x6dc8('0x65')+_0x2befa9;return db[_0x6dc8('0x5a')][_0x6dc8('0x39')](_0x42bd26,{'type':db[_0x6dc8('0x5c')][_0x6dc8('0x5e')][_0x6dc8('0x60')],'raw':!![],'transaction':_0x3ec882});})[_0x6dc8('0x2c')](function(_0x501ee8){var _0x1cfb4d=_[_0x6dc8('0x32')](_0x501ee8,function(_0x21fe2c){return Number(_0x21fe2c[_0x6dc8('0x66')]);});return db[_0x6dc8('0x67')][_0x6dc8('0x59')]({'where':{'UserId':{'$in':_0x44e044},'ChatQueueId':{'$in':_0x1cfb4d}},'transaction':_0x3ec882});})[_0x6dc8('0x2c')](function(){var _0x2a747a=_0x6dc8('0x68')+_0x2befa9;return db[_0x6dc8('0x5a')][_0x6dc8('0x39')](_0x2a747a,{'type':db[_0x6dc8('0x5c')]['QueryTypes'][_0x6dc8('0x60')],'raw':!![],'transaction':_0x3ec882});})[_0x6dc8('0x2c')](function(_0x3b062a){var _0x2e1a5a=_[_0x6dc8('0x32')](_0x3b062a,function(_0x2e949e){return Number(_0x2e949e[_0x6dc8('0x69')]);});return db['UserFaxQueue'][_0x6dc8('0x59')]({'where':{'UserId':{'$in':_0x44e044},'FaxQueueId':{'$in':_0x2e1a5a}},'transaction':_0x3ec882});})[_0x6dc8('0x2c')](function(){var _0x36b07e=_0x6dc8('0x6a')+_0x2befa9;return db[_0x6dc8('0x5a')][_0x6dc8('0x39')](_0x36b07e,{'type':db[_0x6dc8('0x5c')][_0x6dc8('0x5e')]['SELECT'],'raw':!![],'transaction':_0x3ec882});})[_0x6dc8('0x2c')](function(_0xa5668f){var _0xa0d4cc=_[_0x6dc8('0x32')](_0xa5668f,function(_0x18e94f){return Number(_0x18e94f['OpenchannelQueueId']);});return db['UserOpenchannelQueue'][_0x6dc8('0x59')]({'where':{'UserId':{'$in':_0x44e044},'OpenchannelQueueId':{'$in':_0xa0d4cc}},'transaction':_0x3ec882});})['then'](function(){var _0x165db8='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2befa9;return db['sequelize']['query'](_0x165db8,{'type':db['Sequelize'][_0x6dc8('0x5e')][_0x6dc8('0x60')],'raw':!![],'transaction':_0x3ec882});})[_0x6dc8('0x2c')](function(_0x36c85c){var _0x52a2b9=_[_0x6dc8('0x32')](_0x36c85c,function(_0x447ee4){return Number(_0x447ee4[_0x6dc8('0x6b')]);});return db['UserWhatsappQueue']['destroy']({'where':{'UserId':{'$in':_0x44e044},'WhatsappQueueId':{'$in':_0x52a2b9}},'transaction':_0x3ec882});})[_0x6dc8('0x2c')](function(){return db[_0x6dc8('0x6c')][_0x6dc8('0x4e')]({'where':{'TeamId':_0x2befa9}});})[_0x6dc8('0x2c')](function(_0x3360e1){if(_0x3360e1===null){return;}return db[_0x6dc8('0x6d')]['destroy']({'where':{'UserId':{'$in':_0x44e044},'VoicePrefixId':_0x3360e1[_0x6dc8('0x6e')]},'transaction':_0x3ec882});})[_0x6dc8('0x2c')](function(){return db[_0x6dc8('0x33')][_0x6dc8('0x59')]({'where':{'id':_0x2befa9},'cascade':!![],'transaction':_0x3ec882});})[_0x6dc8('0x2c')](function(_0x2d94ea){if(_0x2d94ea===0x0){_0x3b5137[_0x6dc8('0x2d')](0x194);}else{return db[_0x6dc8('0x56')][_0x6dc8('0x59')]({'where':{'type':'Teams','resourceId':_0x2befa9},'cascade':!![],'transaction':_0x3ec882})['then'](function(){_0x3b5137[_0x6dc8('0x1f')](0xcc)['end']();});}})[_0x6dc8('0x4b')](function(_0x23eb8f){_0x3b5137[_0x6dc8('0x1f')](0x1f4)[_0x6dc8('0x31')](_0x23eb8f);});});};exports[_0x6dc8('0x6f')]=function(_0x5e2953,_0x97bc04,_0x35af34){return db[_0x6dc8('0x33')]['findOne']({'where':{'id':_0x5e2953[_0x6dc8('0x4c')]['id']}})[_0x6dc8('0x2c')](handleEntityNotFound(_0x97bc04,null))[_0x6dc8('0x2c')](function(_0x50ca14){if(!_0x5e2953['query'][_0x6dc8('0x70')]||!utils[_0x6dc8('0x71')](_0x5e2953[_0x6dc8('0x39')][_0x6dc8('0x70')])){throw new db['Sequelize'][(_0x6dc8('0x72'))](_0x6dc8('0x73'));}var _0x3691dd={};var _0x140939={};_0x140939[_0x6dc8('0x38')]=_[_0x6dc8('0x3a')](db[_[_0x6dc8('0x74')](_0x5e2953['query']['channel'][_0x6dc8('0x75')]())+_0x6dc8('0x76')]['rawAttributes']);_0x140939['query']=_[_0x6dc8('0x3a')](_0x5e2953['query']);_0x140939[_0x6dc8('0x3b')]=_[_0x6dc8('0x3c')](_0x140939[_0x6dc8('0x38')],_0x140939['query']);_0x3691dd[_0x6dc8('0x3e')]=_[_0x6dc8('0x3c')](_0x140939[_0x6dc8('0x38')],qs[_0x6dc8('0x3d')](_0x5e2953[_0x6dc8('0x39')][_0x6dc8('0x3d')]));_0x3691dd[_0x6dc8('0x3e')]=_0x3691dd[_0x6dc8('0x3e')][_0x6dc8('0x3f')]?_0x3691dd[_0x6dc8('0x3e')]:_0x140939['model'];_0x3691dd[_0x6dc8('0x24')]=qs[_0x6dc8('0x24')](_0x5e2953['query'][_0x6dc8('0x24')]);_0x3691dd[_0x6dc8('0x22')]=qs[_0x6dc8('0x22')](_0x5e2953[_0x6dc8('0x39')]['offset']);_0x3691dd[_0x6dc8('0x41')]=qs['sort'](_0x5e2953['query']['sort']);_0x3691dd[_0x6dc8('0x43')]=qs['filters'](_[_0x6dc8('0x77')](_0x5e2953[_0x6dc8('0x39')],_0x140939[_0x6dc8('0x3b')]));_0x3691dd=_[_0x6dc8('0x44')]({},_0x3691dd,_0x5e2953[_0x6dc8('0x47')]);return _0x50ca14[_0x6dc8('0x51')+_['capitalize'](_0x5e2953[_0x6dc8('0x39')][_0x6dc8('0x70')][_0x6dc8('0x75')]())+_0x6dc8('0x78')](_0x3691dd);})[_0x6dc8('0x2c')](respondWithResult(_0x97bc04,null))['catch'](handleError(_0x97bc04,null));};exports[_0x6dc8('0x79')]=function(_0x1f18fc,_0x25a5da,_0x5b10b9){return db['Team'][_0x6dc8('0x7a')]({'where':{'id':_0x1f18fc[_0x6dc8('0x4c')]['id']}})['then'](function(_0x52a239){if(_0x52a239){if(!_0x1f18fc[_0x6dc8('0x58')][_0x6dc8('0x70')]||!utils['isValidChannel'](_0x1f18fc[_0x6dc8('0x58')][_0x6dc8('0x70')])){throw new db[(_0x6dc8('0x5c'))][(_0x6dc8('0x72'))]('Unknown\x20channel');}return _0x52a239[_0x6dc8('0x7b')+_[_0x6dc8('0x74')](_0x1f18fc[_0x6dc8('0x58')][_0x6dc8('0x70')][_0x6dc8('0x75')]())+_0x6dc8('0x78')](_0x1f18fc[_0x6dc8('0x58')][_0x6dc8('0x7c')]);}return null;})['then'](handleEntityNotFound(_0x25a5da,null))[_0x6dc8('0x2c')](respondWithStatusCode(_0x25a5da,null))[_0x6dc8('0x4b')](handleError(_0x25a5da,null));};exports[_0x6dc8('0x7d')]=function(_0x27bf1c,_0x1ba201,_0x3cc571){return db[_0x6dc8('0x33')][_0x6dc8('0x7a')]({'where':{'id':_0x27bf1c[_0x6dc8('0x4c')]['id']}})['then'](function(_0x1d072d){if(_0x1d072d){if(!_0x27bf1c[_0x6dc8('0x39')][_0x6dc8('0x70')]||!utils[_0x6dc8('0x71')](_0x27bf1c[_0x6dc8('0x39')]['channel'])){throw new db[(_0x6dc8('0x5c'))][(_0x6dc8('0x72'))](_0x6dc8('0x73'));}return _0x1d072d['remove'+_[_0x6dc8('0x74')](_0x27bf1c[_0x6dc8('0x39')][_0x6dc8('0x70')]['toLowerCase']())+_0x6dc8('0x78')](_0x27bf1c[_0x6dc8('0x39')][_0x6dc8('0x7c')]);}return null;})[_0x6dc8('0x2c')](handleEntityNotFound(_0x1ba201,null))[_0x6dc8('0x2c')](respondWithStatusCode(_0x1ba201,null))['catch'](handleError(_0x1ba201,null));};exports[_0x6dc8('0x7e')]=function(_0x2990d5,_0x3e9c15){var _0xd490da=_[_0x6dc8('0x7f')](_0x2990d5[_0x6dc8('0x58')][_0x6dc8('0x7c')])?_0x2990d5[_0x6dc8('0x58')]['ids']:[_0x2990d5['body'][_0x6dc8('0x7c')]];var _0x5d2210=_0x2990d5['params']['id'];return db[_0x6dc8('0x33')][_0x6dc8('0x4e')]({'where':{'id':_0x5d2210}})[_0x6dc8('0x2c')](handleEntityNotFound(_0x3e9c15,null))[_0x6dc8('0x2c')](function(_0x5c1595){if(_0x5c1595){var _0x4f7ca0=[_0x6dc8('0x80'),_0x6dc8('0x81'),_0x6dc8('0x82'),_0x6dc8('0x83'),_0x6dc8('0x84'),_0x6dc8('0x85'),'Whatsapp'];return db[_0x6dc8('0x5a')][_0x6dc8('0x86')](function(_0x5432b3){var _0x47c927=_[_0x6dc8('0x32')](_0x4f7ca0,function(_0x2e957b){var _0x1a51ec={'attributes':['id',_0x6dc8('0x30')]};if(_0x2e957b===_0x6dc8('0x80')){_0x1a51ec[_0x6dc8('0x87')]={'attributes':[_0x6dc8('0x88')]};}return _0x5c1595[_0x6dc8('0x51')+_0x2e957b+_0x6dc8('0x78')](_0x1a51ec)['then'](function(_0x4062d3){var _0x26c0c7=_[_0x6dc8('0x32')](_0x4062d3,function(_0x3de0d1){var _0x47130b=_[_0x6dc8('0x32')](_0xd490da,function(_0x4107ec){var _0x49d503={'where':{'UserId':_0x4107ec,[_0x2e957b+'QueueId']:_0x3de0d1['id']},'transaction':_0x5432b3};if(_0x2e957b===_0x6dc8('0x80')){_0x49d503[_0x6dc8('0x89')]={'penalty':_0x3de0d1[_0x6dc8('0x8a')][_0x6dc8('0x88')]};}return db[_0x6dc8('0x8b')+_0x2e957b+'Queue'][_0x6dc8('0x8c')](_0x49d503)[_0x6dc8('0x2c')](function(){socket['emit']('user'+_0x2e957b+_0x6dc8('0x8d'),{'UserId':_0x4107ec,[_0x2e957b+'QueueId']:_0x3de0d1['id']});if(_0x2e957b!==_0x6dc8('0x80')){return;}return db['User'][_0x6dc8('0x49')]({'where':{'id':_0xd490da,'online':0x1},'attributes':['id','name',_0x6dc8('0x8e'),_0x6dc8('0x8f'),'interface'],'raw':!![]})[_0x6dc8('0x2c')](function(_0x300b85){var _0x4b886c=_[_0x6dc8('0x32')](_0x300b85,function(_0x5f0f8c){return db['UserVoiceQueueRt'][_0x6dc8('0x90')]({'membername':_0x5f0f8c[_0x6dc8('0x30')],'UserId':_0x5f0f8c['id'],'queue_name':_0x3de0d1['name'],'VoiceQueueId':_0x3de0d1['id'],'interface':_[_0x6dc8('0x91')](_0x5f0f8c[_0x6dc8('0x92')])?util[_0x6dc8('0x93')]('SIP/%s',_0x5f0f8c[_0x6dc8('0x30')]):_0x5f0f8c[_0x6dc8('0x92')],'paused':_0x5f0f8c['voicePause']||![],'penalty':_0x3de0d1[_0x6dc8('0x8a')][_0x6dc8('0x88')]},{'transaction':_0x5432b3});});return Promise[_0x6dc8('0x94')](_0x4b886c);});});});return Promise[_0x6dc8('0x94')](_0x47130b);});return Promise[_0x6dc8('0x94')](_0x26c0c7);})[_0x6dc8('0x2c')](function(){return db['TeamVoicePrefix'][_0x6dc8('0x7a')]({'where':{'teamId':_0x5d2210}})['then'](function(_0x1f3237){if(_0x1f3237){var _0x1a1428=_[_0x6dc8('0x32')](_0xd490da,function(_0x23ed66){db[_0x6dc8('0x6d')][_0x6dc8('0x90')]({'UserId':_0x23ed66,'VoicePrefixId':_0x1f3237[_0x6dc8('0x6e')]});});return Promise['all'](_0x1a1428);}});});});return Promise['all'](_0x47c927)[_0x6dc8('0x2c')](function(){return _0x5c1595[_0x6dc8('0x7e')](_0xd490da,{'transaction':_0x5432b3})[_0x6dc8('0x95')](function(_0x45de5c){return _0x45de5c;});});});}})[_0x6dc8('0x2c')](respondWithResult(_0x3e9c15,null))[_0x6dc8('0x4b')](handleError(_0x3e9c15,null));};exports[_0x6dc8('0x96')]=function(_0x5d4735,_0x2ba65b){var _0x5973a2=_[_0x6dc8('0x7f')](_0x5d4735[_0x6dc8('0x39')][_0x6dc8('0x7c')])?_0x5d4735[_0x6dc8('0x39')][_0x6dc8('0x7c')]:[_0x5d4735[_0x6dc8('0x39')][_0x6dc8('0x7c')]];var _0x27f4b9=_0x5d4735[_0x6dc8('0x4c')]['id'];return db[_0x6dc8('0x33')]['find']({'where':{'id':_0x27f4b9}})[_0x6dc8('0x2c')](handleEntityNotFound(_0x2ba65b,null))['then'](function(_0x5b2675){if(_0x5b2675){var _0x371c54=['Voice',_0x6dc8('0x81'),'Mail',_0x6dc8('0x83'),_0x6dc8('0x84'),_0x6dc8('0x85'),'Whatsapp'];return db[_0x6dc8('0x5a')][_0x6dc8('0x86')](function(_0x325d0a){var _0x100d32=_[_0x6dc8('0x32')](_0x371c54,function(_0x46955a){var _0x5cd5b4={'attributes':['id','name']};return _0x5b2675[_0x6dc8('0x51')+_0x46955a+_0x6dc8('0x78')](_0x5cd5b4)[_0x6dc8('0x2c')](function(_0x38e1e1){var _0x4f8c92=_['map'](_0x38e1e1,function(_0x16f476){return _0x16f476[_0x6dc8('0x96')](_0x5973a2,{'transaction':_0x325d0a})['then'](function(){var _0x4e1b9d=_[_0x6dc8('0x32')](_0x5973a2,function(_0x34d362){socket['emit'](_0x6dc8('0x50')+_0x46955a+_0x6dc8('0x97'),{'UserId':Number(_0x34d362),[_0x46955a+_0x6dc8('0x98')]:_0x16f476['id']});if(_0x46955a!==_0x6dc8('0x80')){return;}return db[_0x6dc8('0x99')][_0x6dc8('0x59')]({'where':{'VoiceQueueId':_0x16f476['id'],'UserId':_0x34d362},'transaction':_0x325d0a});});return Promise[_0x6dc8('0x94')](_0x4e1b9d);});});return Promise[_0x6dc8('0x94')](_0x4f8c92);});});return Promise[_0x6dc8('0x94')](_0x100d32)[_0x6dc8('0x2c')](function(){return _0x5b2675[_0x6dc8('0x96')](_0x5973a2,{'transaction':_0x325d0a});})[_0x6dc8('0x2c')](function(){return db[_0x6dc8('0x6c')][_0x6dc8('0x7a')]({'where':{'teamId':_0x27f4b9}})[_0x6dc8('0x2c')](function(_0x4d8019){if(_0x4d8019){var _0x4ac3f5=_[_0x6dc8('0x32')](_0x5973a2,function(_0x169392){db[_0x6dc8('0x6d')][_0x6dc8('0x59')]({'where':{'UserId':_0x169392,'VoicePrefixId':_0x4d8019['VoicePrefixId']}});});return Promise[_0x6dc8('0x94')](_0x4ac3f5);}});});});}})[_0x6dc8('0x2c')](respondWithStatusCode(_0x2ba65b,null))[_0x6dc8('0x4b')](handleError(_0x2ba65b,null));};exports[_0x6dc8('0x9a')]=function(_0x119115,_0x2365f3,_0x551ae0){var _0x1d1929={};var _0xb71b95={};var _0x2e07e5;var _0x330b50;return db['Team']['findOne']({'where':{'id':_0x119115['params']['id']}})[_0x6dc8('0x2c')](handleEntityNotFound(_0x2365f3,null))[_0x6dc8('0x2c')](function(_0x82b5ce){if(_0x82b5ce){_0x2e07e5=_0x82b5ce;_0xb71b95[_0x6dc8('0x38')]=_['keys'](db[_0x6dc8('0x8b')][_0x6dc8('0x34')]);_0xb71b95[_0x6dc8('0x39')]=_[_0x6dc8('0x3a')](_0x119115[_0x6dc8('0x39')]);_0xb71b95[_0x6dc8('0x3b')]=_[_0x6dc8('0x3c')](_0xb71b95['model'],_0xb71b95[_0x6dc8('0x39')]);_0x1d1929['attributes']=_['intersection'](_0xb71b95[_0x6dc8('0x38')],qs['fields'](_0x119115[_0x6dc8('0x39')][_0x6dc8('0x3d')]));_0x1d1929[_0x6dc8('0x3e')]=_0x1d1929['attributes'][_0x6dc8('0x3f')]?_0x1d1929[_0x6dc8('0x3e')]:_0xb71b95[_0x6dc8('0x38')];_0x1d1929[_0x6dc8('0x41')]=qs[_0x6dc8('0x42')](_0x119115[_0x6dc8('0x39')][_0x6dc8('0x42')]);_0x1d1929['where']=qs[_0x6dc8('0x3b')](_['pick'](_0x119115['query'],_0xb71b95[_0x6dc8('0x3b')]));if(_0x119115[_0x6dc8('0x39')][_0x6dc8('0x46')]){_0x1d1929[_0x6dc8('0x43')]=_['merge'](_0x1d1929[_0x6dc8('0x43')],{'$or':_[_0x6dc8('0x32')](_0x1d1929['attributes'],function(_0x1f49cc){var _0x31d33e={};_0x31d33e[_0x1f49cc]={'$like':'%'+_0x119115[_0x6dc8('0x39')][_0x6dc8('0x46')]+'%'};return _0x31d33e;})});}_0x1d1929=_['merge']({},_0x1d1929,_0x119115[_0x6dc8('0x47')]);return _0x2e07e5[_0x6dc8('0x9a')](_0x1d1929);}})[_0x6dc8('0x2c')](function(_0x236f76){if(_0x236f76){_0x330b50=_0x236f76[_0x6dc8('0x3f')];if(!_0x119115[_0x6dc8('0x39')][_0x6dc8('0x9b')]('nolimit')){_0x1d1929['limit']=qs[_0x6dc8('0x24')](_0x119115['query'][_0x6dc8('0x24')]);_0x1d1929[_0x6dc8('0x22')]=qs['offset'](_0x119115[_0x6dc8('0x39')][_0x6dc8('0x22')]);}return _0x2e07e5[_0x6dc8('0x9a')](_0x1d1929);}})[_0x6dc8('0x2c')](function(_0x2af597){if(_0x2af597){return _0x2af597?{'count':_0x330b50,'rows':_0x2af597}:null;}})[_0x6dc8('0x2c')](respondWithResult(_0x2365f3,null))['catch'](handleError(_0x2365f3,null));}; \ No newline at end of file +var _0x9833=['UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','Sequelize','SELECT','VoiceQueueId','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','UserProfileResource','getQueues','findOne','channel','isValidChannel','ValidationError','capitalize','Queue','rawAttributes','pick','toLowerCase','Unknown\x20channel','add','Queues','removeQueues','remove','ids','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','transaction','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','online','voicePause','interface','UserVoiceQueueRt','isNil','format','SIP/%s','all','upsert','removeAgents','Queue:remove','filter','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','sendStatus','error','name','send','index','map','Team','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','VIRTUAL','options','findAll','then','rows','show','params','keys','include','catch','create','body','user','get','role','Teams'];(function(_0x4db46b,_0xadcb1a){var _0x565be8=function(_0x5d2e50){while(--_0x5d2e50){_0x4db46b['push'](_0x4db46b['shift']());}};_0x565be8(++_0xadcb1a);}(_0x9833,0x181));var _0x3983=function(_0x5c8b1d,_0x90782a){_0x5c8b1d=_0x5c8b1d-0x0;var _0x59db68=_0x9833[_0x5c8b1d];return _0x59db68;};'use strict';var emlformat=require(_0x3983('0x0'));var rimraf=require(_0x3983('0x1'));var zipdir=require(_0x3983('0x2'));var jsonpatch=require(_0x3983('0x3'));var rp=require(_0x3983('0x4'));var moment=require(_0x3983('0x5'));var BPromise=require(_0x3983('0x6'));var Mustache=require('mustache');var util=require(_0x3983('0x7'));var path=require(_0x3983('0x8'));var sox=require(_0x3983('0x9'));var csv=require(_0x3983('0xa'));var ejs=require(_0x3983('0xb'));var fs=require('fs');var fs_extra=require(_0x3983('0xc'));var _=require('lodash');var squel=require(_0x3983('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3983('0xa'));var querystring=require('querystring');var Papa=require(_0x3983('0xe'));var Redis=require(_0x3983('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3983('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3983('0x11'))(_0x3983('0x12'));var utils=require(_0x3983('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3983('0x14'));var db=require(_0x3983('0x15'))['db'];config[_0x3983('0x16')]=_[_0x3983('0x17')](config[_0x3983('0x16')],{'host':_0x3983('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./team.socket')[_0x3983('0x19')](socket);function respondWithStatusCode(_0x22515d,_0x5c18fb){_0x5c18fb=_0x5c18fb||0xcc;return function(_0x3f580c){if(_0x3f580c){return _0x22515d['sendStatus'](_0x5c18fb);}return _0x22515d[_0x3983('0x1a')](_0x5c18fb)[_0x3983('0x1b')]();};}function respondWithResult(_0x20deda,_0x36f2e8){_0x36f2e8=_0x36f2e8||0xc8;return function(_0x264fc5){if(_0x264fc5){return _0x20deda[_0x3983('0x1a')](_0x36f2e8)[_0x3983('0x1c')](_0x264fc5);}};}function respondWithFilteredResult(_0x5c10ce,_0x29b45c){return function(_0x3cb042){if(_0x3cb042){var _0x8a9d5e=typeof _0x29b45c[_0x3983('0x1d')]===_0x3983('0x1e')&&typeof _0x29b45c[_0x3983('0x1f')]===_0x3983('0x1e');var _0x51f069=_0x3cb042['count'];var _0x282083=_0x8a9d5e?0x0:_0x29b45c[_0x3983('0x1d')];var _0xeed825=_0x8a9d5e?_0x3cb042[_0x3983('0x20')]:_0x29b45c[_0x3983('0x1d')]+_0x29b45c['limit'];var _0x2517f3;if(_0xeed825>=_0x51f069){_0xeed825=_0x51f069;_0x2517f3=0xc8;}else{_0x2517f3=0xce;}_0x5c10ce[_0x3983('0x1a')](_0x2517f3);return _0x5c10ce[_0x3983('0x21')](_0x3983('0x22'),_0x282083+'-'+_0xeed825+'/'+_0x51f069)[_0x3983('0x1c')](_0x3cb042);}return null;};}function patchUpdates(_0x597cb2){return function(_0x5c7003){try{jsonpatch['apply'](_0x5c7003,_0x597cb2,!![]);}catch(_0x189fa7){return BPromise[_0x3983('0x23')](_0x189fa7);}return _0x5c7003[_0x3983('0x24')]();};}function saveUpdates(_0x255840,_0x50cf14){return function(_0x55e46b){if(_0x55e46b){return _0x55e46b[_0x3983('0x25')](_0x255840)['then'](function(_0x347efe){return _0x347efe;});}return null;};}function handleEntityNotFound(_0x3f6e22,_0x3b79c0){return function(_0x10e6c3){if(!_0x10e6c3){_0x3f6e22[_0x3983('0x26')](0x194);}return _0x10e6c3;};}function handleError(_0x47fe0d,_0x45c498){_0x45c498=_0x45c498||0x1f4;return function(_0x60a5e7){logger[_0x3983('0x27')](_0x60a5e7['stack']);if(_0x60a5e7[_0x3983('0x28')]){delete _0x60a5e7[_0x3983('0x28')];}_0x47fe0d['status'](_0x45c498)[_0x3983('0x29')](_0x60a5e7);};}exports[_0x3983('0x2a')]=function(_0x31b8f3,_0x513608){var _0x5514c3={},_0x5a0817={},_0x585c6d={'count':0x0,'rows':[]};var _0x267e93=_[_0x3983('0x2b')](db[_0x3983('0x2c')]['rawAttributes'],function(_0x251f55){return{'name':_0x251f55[_0x3983('0x2d')],'type':_0x251f55[_0x3983('0x2e')][_0x3983('0x2f')]};});_0x5a0817['model']=_[_0x3983('0x2b')](_0x267e93,_0x3983('0x28'));_0x5a0817[_0x3983('0x30')]=_['keys'](_0x31b8f3[_0x3983('0x30')]);_0x5a0817['filters']=_[_0x3983('0x31')](_0x5a0817[_0x3983('0x32')],_0x5a0817['query']);_0x5514c3[_0x3983('0x33')]=_[_0x3983('0x31')](_0x5a0817[_0x3983('0x32')],qs['fields'](_0x31b8f3[_0x3983('0x30')][_0x3983('0x34')]));_0x5514c3['attributes']=_0x5514c3[_0x3983('0x33')][_0x3983('0x35')]?_0x5514c3[_0x3983('0x33')]:_0x5a0817['model'];if(!_0x31b8f3['query'][_0x3983('0x36')](_0x3983('0x37'))){_0x5514c3[_0x3983('0x1f')]=qs[_0x3983('0x1f')](_0x31b8f3['query']['limit']);_0x5514c3['offset']=qs['offset'](_0x31b8f3['query'][_0x3983('0x1d')]);}_0x5514c3[_0x3983('0x38')]=qs[_0x3983('0x39')](_0x31b8f3['query'][_0x3983('0x39')]);_0x5514c3['where']=qs[_0x3983('0x3a')](_['pick'](_0x31b8f3[_0x3983('0x30')],_0x5a0817[_0x3983('0x3a')]),_0x267e93);if(_0x31b8f3[_0x3983('0x30')]['filter']){_0x5514c3[_0x3983('0x3b')]=_[_0x3983('0x3c')](_0x5514c3[_0x3983('0x3b')],{'$or':_['map'](_0x267e93,function(_0x169c8c){if(_0x169c8c[_0x3983('0x2e')]!==_0x3983('0x3d')){var _0x150458={};_0x150458[_0x169c8c['name']]={'$like':'%'+_0x31b8f3[_0x3983('0x30')]['filter']+'%'};return _0x150458;}})});}_0x5514c3=_[_0x3983('0x3c')]({},_0x5514c3,_0x31b8f3[_0x3983('0x3e')]);var _0x2c5b07={'where':_0x5514c3[_0x3983('0x3b')]};return db[_0x3983('0x2c')][_0x3983('0x20')](_0x2c5b07)['then'](function(_0x9b8424){_0x585c6d[_0x3983('0x20')]=_0x9b8424;if(_0x31b8f3[_0x3983('0x30')]['includeAll']){_0x5514c3['include']=[{'all':!![]}];}return db[_0x3983('0x2c')][_0x3983('0x3f')](_0x5514c3);})[_0x3983('0x40')](function(_0x171132){_0x585c6d[_0x3983('0x41')]=_0x171132;return _0x585c6d;})[_0x3983('0x40')](respondWithFilteredResult(_0x513608,_0x5514c3))['catch'](handleError(_0x513608,null));};exports[_0x3983('0x42')]=function(_0x1432bc,_0x279347){var _0x2b2ac9={'raw':![],'where':{'id':_0x1432bc[_0x3983('0x43')]['id']}},_0x3f0af3={};_0x3f0af3[_0x3983('0x32')]=_[_0x3983('0x44')](db[_0x3983('0x2c')]['rawAttributes']);_0x3f0af3[_0x3983('0x30')]=_[_0x3983('0x44')](_0x1432bc[_0x3983('0x30')]);_0x3f0af3[_0x3983('0x3a')]=_[_0x3983('0x31')](_0x3f0af3[_0x3983('0x32')],_0x3f0af3['query']);_0x2b2ac9[_0x3983('0x33')]=_['intersection'](_0x3f0af3[_0x3983('0x32')],qs[_0x3983('0x34')](_0x1432bc[_0x3983('0x30')]['fields']));_0x2b2ac9[_0x3983('0x33')]=_0x2b2ac9[_0x3983('0x33')][_0x3983('0x35')]?_0x2b2ac9[_0x3983('0x33')]:_0x3f0af3['model'];if(_0x1432bc[_0x3983('0x30')]['includeAll']){_0x2b2ac9[_0x3983('0x45')]=[{'all':!![]}];}_0x2b2ac9=_[_0x3983('0x3c')]({},_0x2b2ac9,_0x1432bc[_0x3983('0x3e')]);return db[_0x3983('0x2c')]['find'](_0x2b2ac9)[_0x3983('0x40')](handleEntityNotFound(_0x279347,null))[_0x3983('0x40')](respondWithResult(_0x279347,null))[_0x3983('0x46')](handleError(_0x279347,null));};exports[_0x3983('0x47')]=function(_0x74fbfc,_0x10d369){return db[_0x3983('0x2c')][_0x3983('0x47')](_0x74fbfc[_0x3983('0x48')],{})[_0x3983('0x40')](function(_0x10fdac){var _0x277e74=_0x74fbfc[_0x3983('0x49')][_0x3983('0x4a')]({'plain':!![]});if(!_0x277e74)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x277e74[_0x3983('0x4b')]===_0x3983('0x49')){var _0x58f6cc=_0x10fdac[_0x3983('0x4a')]({'plain':!![]});var _0x4f941b=_0x3983('0x4c');return db[_0x3983('0x4d')][_0x3983('0x4e')]({'where':{'name':_0x4f941b,'userProfileId':_0x277e74[_0x3983('0x4f')]},'raw':!![]})[_0x3983('0x40')](function(_0x3af0a5){if(_0x3af0a5&&_0x3af0a5[_0x3983('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x58f6cc[_0x3983('0x28')],'resourceId':_0x58f6cc['id'],'type':_0x3af0a5[_0x3983('0x28')],'sectionId':_0x3af0a5['id']},{})[_0x3983('0x40')](function(){return _0x10fdac;});}else{return _0x10fdac;}})[_0x3983('0x46')](function(_0x5edd0a){logger[_0x3983('0x27')](_0x3983('0x51'),_0x5edd0a);throw _0x5edd0a;});}return _0x10fdac;})[_0x3983('0x40')](respondWithResult(_0x10d369,0xc9))[_0x3983('0x46')](handleError(_0x10d369,null));};exports[_0x3983('0x25')]=function(_0x19e5a7,_0x5915bc){if(_0x19e5a7[_0x3983('0x48')]['id']){delete _0x19e5a7[_0x3983('0x48')]['id'];}return db[_0x3983('0x2c')][_0x3983('0x4e')]({'where':{'id':_0x19e5a7['params']['id']}})[_0x3983('0x40')](handleEntityNotFound(_0x5915bc,null))[_0x3983('0x40')](saveUpdates(_0x19e5a7[_0x3983('0x48')],null))['then'](respondWithResult(_0x5915bc,null))[_0x3983('0x46')](handleError(_0x5915bc,null));};exports[_0x3983('0x52')]=function(_0xc3d597,_0x1a1351){var _0x1b584e=_0xc3d597[_0x3983('0x43')]['id'];var _0x181b0d=[];return db['sequelize']['transaction'](function(_0x3b34a4){var _0x48a0df=_0x3983('0x53')+_0x1b584e;return db[_0x3983('0x54')]['query'](_0x48a0df,{'type':db['Sequelize'][_0x3983('0x55')]['SELECT'],'raw':!![],'transaction':_0x3b34a4})[_0x3983('0x40')](function(_0x381702){_0x181b0d=_[_0x3983('0x2b')](_0x381702,function(_0x527fb4){return Number(_0x527fb4[_0x3983('0x56')]);});})[_0x3983('0x40')](function(){var _0x44761b=_0x3983('0x57')+_0x1b584e;return db[_0x3983('0x54')][_0x3983('0x30')](_0x44761b,{'type':db[_0x3983('0x58')][_0x3983('0x55')][_0x3983('0x59')],'raw':!![],'transaction':_0x3b34a4});})[_0x3983('0x40')](function(_0x12da6a){var _0x10c75f=_['map'](_0x12da6a,function(_0x30a8c3){return Number(_0x30a8c3[_0x3983('0x5a')]);});return db['UserVoiceQueue'][_0x3983('0x52')]({'where':{'UserId':{'$in':_0x181b0d},'VoiceQueueId':{'$in':_0x10c75f}},'transaction':_0x3b34a4});})[_0x3983('0x40')](function(){var _0x28decf=_0x3983('0x5b')+_0x1b584e;return db['sequelize'][_0x3983('0x30')](_0x28decf,{'type':db[_0x3983('0x58')][_0x3983('0x55')]['SELECT'],'raw':!![],'transaction':_0x3b34a4});})[_0x3983('0x40')](function(_0x61daa7){var _0x45e01b=_[_0x3983('0x2b')](_0x61daa7,function(_0x4c2a00){return Number(_0x4c2a00['MailQueueId']);});return db[_0x3983('0x5c')][_0x3983('0x52')]({'where':{'UserId':{'$in':_0x181b0d},'MailQueueId':{'$in':_0x45e01b}},'transaction':_0x3b34a4});})[_0x3983('0x40')](function(){var _0x1acb19=_0x3983('0x5d')+_0x1b584e;return db[_0x3983('0x54')][_0x3983('0x30')](_0x1acb19,{'type':db[_0x3983('0x58')]['QueryTypes'][_0x3983('0x59')],'raw':!![],'transaction':_0x3b34a4});})[_0x3983('0x40')](function(_0x18b41d){var _0x8438b=_['map'](_0x18b41d,function(_0x167335){return Number(_0x167335[_0x3983('0x5e')]);});return db[_0x3983('0x5f')][_0x3983('0x52')]({'where':{'UserId':{'$in':_0x181b0d},'SmsQueueId':{'$in':_0x8438b}},'transaction':_0x3b34a4});})['then'](function(){var _0x15fc46='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x1b584e;return db[_0x3983('0x54')][_0x3983('0x30')](_0x15fc46,{'type':db[_0x3983('0x58')][_0x3983('0x55')][_0x3983('0x59')],'raw':!![],'transaction':_0x3b34a4});})[_0x3983('0x40')](function(_0x4b3c6b){var _0x3888c9=_[_0x3983('0x2b')](_0x4b3c6b,function(_0x3e70eb){return Number(_0x3e70eb[_0x3983('0x60')]);});return db[_0x3983('0x61')]['destroy']({'where':{'UserId':{'$in':_0x181b0d},'ChatQueueId':{'$in':_0x3888c9}},'transaction':_0x3b34a4});})[_0x3983('0x40')](function(){var _0x551a2a=_0x3983('0x62')+_0x1b584e;return db[_0x3983('0x54')][_0x3983('0x30')](_0x551a2a,{'type':db[_0x3983('0x58')][_0x3983('0x55')]['SELECT'],'raw':!![],'transaction':_0x3b34a4});})[_0x3983('0x40')](function(_0x3dd0fc){var _0x1a127a=_['map'](_0x3dd0fc,function(_0x4f5e3a){return Number(_0x4f5e3a[_0x3983('0x63')]);});return db['UserFaxQueue'][_0x3983('0x52')]({'where':{'UserId':{'$in':_0x181b0d},'FaxQueueId':{'$in':_0x1a127a}},'transaction':_0x3b34a4});})[_0x3983('0x40')](function(){var _0x513a98=_0x3983('0x64')+_0x1b584e;return db[_0x3983('0x54')][_0x3983('0x30')](_0x513a98,{'type':db[_0x3983('0x58')][_0x3983('0x55')]['SELECT'],'raw':!![],'transaction':_0x3b34a4});})[_0x3983('0x40')](function(_0xc843d1){var _0x4ea973=_[_0x3983('0x2b')](_0xc843d1,function(_0x2068be){return Number(_0x2068be['OpenchannelQueueId']);});return db[_0x3983('0x65')][_0x3983('0x52')]({'where':{'UserId':{'$in':_0x181b0d},'OpenchannelQueueId':{'$in':_0x4ea973}},'transaction':_0x3b34a4});})[_0x3983('0x40')](function(){var _0x3ec049=_0x3983('0x66')+_0x1b584e;return db['sequelize']['query'](_0x3ec049,{'type':db['Sequelize'][_0x3983('0x55')][_0x3983('0x59')],'raw':!![],'transaction':_0x3b34a4});})['then'](function(_0x36c58b){var _0x4166c5=_[_0x3983('0x2b')](_0x36c58b,function(_0x150927){return Number(_0x150927['WhatsappQueueId']);});return db[_0x3983('0x67')][_0x3983('0x52')]({'where':{'UserId':{'$in':_0x181b0d},'WhatsappQueueId':{'$in':_0x4166c5}},'transaction':_0x3b34a4});})['then'](function(){return db[_0x3983('0x68')][_0x3983('0x4e')]({'where':{'TeamId':_0x1b584e}});})[_0x3983('0x40')](function(_0x207591){if(_0x207591===null){return;}return db[_0x3983('0x69')]['destroy']({'where':{'UserId':{'$in':_0x181b0d},'VoicePrefixId':_0x207591[_0x3983('0x6a')]},'transaction':_0x3b34a4});})[_0x3983('0x40')](function(){return db[_0x3983('0x2c')][_0x3983('0x52')]({'where':{'id':_0x1b584e},'cascade':!![],'transaction':_0x3b34a4});})[_0x3983('0x40')](function(_0x4735de){if(_0x4735de===0x0){_0x1a1351[_0x3983('0x26')](0x194);}else{return db[_0x3983('0x6b')][_0x3983('0x52')]({'where':{'type':_0x3983('0x4c'),'resourceId':_0x1b584e},'cascade':!![],'transaction':_0x3b34a4})[_0x3983('0x40')](function(){_0x1a1351[_0x3983('0x1a')](0xcc)['end']();});}})[_0x3983('0x46')](function(_0x5c387e){_0x1a1351[_0x3983('0x1a')](0x1f4)[_0x3983('0x29')](_0x5c387e);});});};exports[_0x3983('0x6c')]=function(_0x41a275,_0xfa1666,_0x56c632){return db[_0x3983('0x2c')][_0x3983('0x6d')]({'where':{'id':_0x41a275[_0x3983('0x43')]['id']}})['then'](handleEntityNotFound(_0xfa1666,null))[_0x3983('0x40')](function(_0x88f30d){if(!_0x41a275[_0x3983('0x30')][_0x3983('0x6e')]||!utils[_0x3983('0x6f')](_0x41a275[_0x3983('0x30')]['channel'])){throw new db['Sequelize'][(_0x3983('0x70'))]('Unknown\x20channel');}var _0x5d6d7f={};var _0x48849e={};_0x48849e[_0x3983('0x32')]=_[_0x3983('0x44')](db[_[_0x3983('0x71')](_0x41a275[_0x3983('0x30')][_0x3983('0x6e')]['toLowerCase']())+_0x3983('0x72')][_0x3983('0x73')]);_0x48849e[_0x3983('0x30')]=_[_0x3983('0x44')](_0x41a275[_0x3983('0x30')]);_0x48849e[_0x3983('0x3a')]=_[_0x3983('0x31')](_0x48849e[_0x3983('0x32')],_0x48849e[_0x3983('0x30')]);_0x5d6d7f[_0x3983('0x33')]=_['intersection'](_0x48849e[_0x3983('0x32')],qs['fields'](_0x41a275[_0x3983('0x30')]['fields']));_0x5d6d7f['attributes']=_0x5d6d7f[_0x3983('0x33')][_0x3983('0x35')]?_0x5d6d7f['attributes']:_0x48849e['model'];_0x5d6d7f[_0x3983('0x1f')]=qs['limit'](_0x41a275['query'][_0x3983('0x1f')]);_0x5d6d7f['offset']=qs['offset'](_0x41a275[_0x3983('0x30')][_0x3983('0x1d')]);_0x5d6d7f[_0x3983('0x38')]=qs[_0x3983('0x39')](_0x41a275['query'][_0x3983('0x39')]);_0x5d6d7f['where']=qs[_0x3983('0x3a')](_[_0x3983('0x74')](_0x41a275[_0x3983('0x30')],_0x48849e[_0x3983('0x3a')]));_0x5d6d7f=_[_0x3983('0x3c')]({},_0x5d6d7f,_0x41a275[_0x3983('0x3e')]);return _0x88f30d[_0x3983('0x4a')+_[_0x3983('0x71')](_0x41a275[_0x3983('0x30')][_0x3983('0x6e')][_0x3983('0x75')]())+'Queues'](_0x5d6d7f);})['then'](respondWithResult(_0xfa1666,null))[_0x3983('0x46')](handleError(_0xfa1666,null));};exports['addQueues']=function(_0x4c93a0,_0x66efe0,_0x258729){return db['Team']['findOne']({'where':{'id':_0x4c93a0[_0x3983('0x43')]['id']}})[_0x3983('0x40')](function(_0x8d7644){if(_0x8d7644){if(!_0x4c93a0[_0x3983('0x48')]['channel']||!utils[_0x3983('0x6f')](_0x4c93a0['body'][_0x3983('0x6e')])){throw new db[(_0x3983('0x58'))]['ValidationError'](_0x3983('0x76'));}return _0x8d7644[_0x3983('0x77')+_[_0x3983('0x71')](_0x4c93a0[_0x3983('0x48')][_0x3983('0x6e')][_0x3983('0x75')]())+_0x3983('0x78')](_0x4c93a0[_0x3983('0x48')]['ids']);}return null;})[_0x3983('0x40')](handleEntityNotFound(_0x66efe0,null))[_0x3983('0x40')](respondWithStatusCode(_0x66efe0,null))[_0x3983('0x46')](handleError(_0x66efe0,null));};exports[_0x3983('0x79')]=function(_0x5d7a5c,_0x556952,_0x2c24a9){return db['Team'][_0x3983('0x6d')]({'where':{'id':_0x5d7a5c[_0x3983('0x43')]['id']}})[_0x3983('0x40')](function(_0x4c0896){if(_0x4c0896){if(!_0x5d7a5c['query'][_0x3983('0x6e')]||!utils[_0x3983('0x6f')](_0x5d7a5c['query'][_0x3983('0x6e')])){throw new db['Sequelize'][(_0x3983('0x70'))](_0x3983('0x76'));}return _0x4c0896[_0x3983('0x7a')+_[_0x3983('0x71')](_0x5d7a5c[_0x3983('0x30')][_0x3983('0x6e')][_0x3983('0x75')]())+_0x3983('0x78')](_0x5d7a5c[_0x3983('0x30')][_0x3983('0x7b')]);}return null;})[_0x3983('0x40')](handleEntityNotFound(_0x556952,null))['then'](respondWithStatusCode(_0x556952,null))[_0x3983('0x46')](handleError(_0x556952,null));};exports[_0x3983('0x7c')]=function(_0x2e4557,_0x31b4d2){var _0x1219c5=_[_0x3983('0x7d')](_0x2e4557[_0x3983('0x48')]['ids'])?_0x2e4557['body'][_0x3983('0x7b')]:[_0x2e4557[_0x3983('0x48')][_0x3983('0x7b')]];var _0x527d0e=_0x2e4557[_0x3983('0x43')]['id'];return db[_0x3983('0x2c')][_0x3983('0x4e')]({'where':{'id':_0x527d0e}})[_0x3983('0x40')](handleEntityNotFound(_0x31b4d2,null))[_0x3983('0x40')](function(_0x5c4130){if(_0x5c4130){var _0x56ea67=[_0x3983('0x7e'),_0x3983('0x7f'),_0x3983('0x80'),_0x3983('0x81'),_0x3983('0x82'),_0x3983('0x83'),_0x3983('0x84')];return db[_0x3983('0x54')][_0x3983('0x85')](function(_0x72f25){var _0x21358c=_[_0x3983('0x2b')](_0x56ea67,function(_0x6bd378){var _0x56eb62={'attributes':['id','name']};if(_0x6bd378===_0x3983('0x7e')){_0x56eb62[_0x3983('0x86')]={'attributes':[_0x3983('0x87')]};}return _0x5c4130[_0x3983('0x4a')+_0x6bd378+_0x3983('0x78')](_0x56eb62)[_0x3983('0x40')](function(_0x1ce55f){var _0x53b89c=_[_0x3983('0x2b')](_0x1ce55f,function(_0x333ba6){var _0x380133=_[_0x3983('0x2b')](_0x1219c5,function(_0x439fd3){var _0x4244cb={'where':{'UserId':_0x439fd3,[_0x6bd378+_0x3983('0x88')]:_0x333ba6['id']},'transaction':_0x72f25};if(_0x6bd378===_0x3983('0x7e')){_0x4244cb['defaults']={'penalty':_0x333ba6[_0x3983('0x89')][_0x3983('0x87')]};}return db[_0x3983('0x8a')+_0x6bd378+'Queue'][_0x3983('0x8b')](_0x4244cb)[_0x3983('0x40')](function(){socket[_0x3983('0x8c')](_0x3983('0x49')+_0x6bd378+'Queue:save',{'UserId':_0x439fd3,[_0x6bd378+'QueueId']:_0x333ba6['id']});if(_0x6bd378!==_0x3983('0x7e')){return;}return db['User']['findAll']({'where':{'id':_0x1219c5,'online':0x1},'attributes':['id','name',_0x3983('0x8d'),_0x3983('0x8e'),_0x3983('0x8f')],'raw':!![]})[_0x3983('0x40')](function(_0x2d55c4){var _0x1e7d64=_[_0x3983('0x2b')](_0x2d55c4,function(_0x5237af){return db[_0x3983('0x90')]['upsert']({'membername':_0x5237af[_0x3983('0x28')],'UserId':_0x5237af['id'],'queue_name':_0x333ba6[_0x3983('0x28')],'VoiceQueueId':_0x333ba6['id'],'interface':_[_0x3983('0x91')](_0x5237af['interface'])?util[_0x3983('0x92')](_0x3983('0x93'),_0x5237af[_0x3983('0x28')]):_0x5237af[_0x3983('0x8f')],'paused':_0x5237af[_0x3983('0x8e')]||![],'penalty':_0x333ba6[_0x3983('0x89')][_0x3983('0x87')]},{'transaction':_0x72f25});});return Promise[_0x3983('0x94')](_0x1e7d64);});});});return Promise[_0x3983('0x94')](_0x380133);});return Promise[_0x3983('0x94')](_0x53b89c);})[_0x3983('0x40')](function(){return db[_0x3983('0x68')]['findOne']({'where':{'teamId':_0x527d0e}})['then'](function(_0x1959ce){if(_0x1959ce){var _0x5bf336=_[_0x3983('0x2b')](_0x1219c5,function(_0x3561b0){db[_0x3983('0x69')][_0x3983('0x95')]({'UserId':_0x3561b0,'VoicePrefixId':_0x1959ce[_0x3983('0x6a')]});});return Promise[_0x3983('0x94')](_0x5bf336);}});});});return Promise[_0x3983('0x94')](_0x21358c)['then'](function(){return _0x5c4130[_0x3983('0x7c')](_0x1219c5,{'transaction':_0x72f25})['spread'](function(_0xe772bc){return _0xe772bc;});});});}})[_0x3983('0x40')](respondWithResult(_0x31b4d2,null))[_0x3983('0x46')](handleError(_0x31b4d2,null));};exports[_0x3983('0x96')]=function(_0x74bddd,_0x2f1043){var _0xbd28b5=_[_0x3983('0x7d')](_0x74bddd[_0x3983('0x30')][_0x3983('0x7b')])?_0x74bddd[_0x3983('0x30')]['ids']:[_0x74bddd[_0x3983('0x30')]['ids']];var _0x21e11c=_0x74bddd[_0x3983('0x43')]['id'];return db['Team']['find']({'where':{'id':_0x21e11c}})[_0x3983('0x40')](handleEntityNotFound(_0x2f1043,null))[_0x3983('0x40')](function(_0x55f742){if(_0x55f742){var _0x4c149b=[_0x3983('0x7e'),_0x3983('0x7f'),_0x3983('0x80'),'Sms','Fax','Openchannel','Whatsapp'];return db[_0x3983('0x54')][_0x3983('0x85')](function(_0x433129){var _0x37a2c1=_[_0x3983('0x2b')](_0x4c149b,function(_0x2b550f){var _0x3cfe61={'attributes':['id',_0x3983('0x28')]};return _0x55f742[_0x3983('0x4a')+_0x2b550f+_0x3983('0x78')](_0x3cfe61)['then'](function(_0x45b201){var _0x2b41f9=_['map'](_0x45b201,function(_0x40968f){return _0x40968f[_0x3983('0x96')](_0xbd28b5,{'transaction':_0x433129})['then'](function(){var _0x3ea38f=_[_0x3983('0x2b')](_0xbd28b5,function(_0x546465){socket['emit'](_0x3983('0x49')+_0x2b550f+_0x3983('0x97'),{'UserId':Number(_0x546465),[_0x2b550f+_0x3983('0x88')]:_0x40968f['id']});if(_0x2b550f!=='Voice'){return;}return db[_0x3983('0x90')][_0x3983('0x52')]({'where':{'VoiceQueueId':_0x40968f['id'],'UserId':_0x546465},'transaction':_0x433129});});return Promise[_0x3983('0x94')](_0x3ea38f);});});return Promise[_0x3983('0x94')](_0x2b41f9);});});return Promise[_0x3983('0x94')](_0x37a2c1)[_0x3983('0x40')](function(){return _0x55f742[_0x3983('0x96')](_0xbd28b5,{'transaction':_0x433129});})['then'](function(){return db[_0x3983('0x68')][_0x3983('0x6d')]({'where':{'teamId':_0x21e11c}})['then'](function(_0x26846b){if(_0x26846b){var _0x1e0335=_['map'](_0xbd28b5,function(_0x531a48){db[_0x3983('0x69')]['destroy']({'where':{'UserId':_0x531a48,'VoicePrefixId':_0x26846b[_0x3983('0x6a')]}});});return Promise[_0x3983('0x94')](_0x1e0335);}});});});}})['then'](respondWithStatusCode(_0x2f1043,null))[_0x3983('0x46')](handleError(_0x2f1043,null));};exports['getAgents']=function(_0x3a65e2,_0x51c114,_0x24b820){var _0xae0bb6={};var _0x195351={};var _0x28f1e5;var _0x3e4c92;return db[_0x3983('0x2c')][_0x3983('0x6d')]({'where':{'id':_0x3a65e2[_0x3983('0x43')]['id']}})[_0x3983('0x40')](handleEntityNotFound(_0x51c114,null))[_0x3983('0x40')](function(_0x41d430){if(_0x41d430){_0x28f1e5=_0x41d430;_0x195351['model']=_[_0x3983('0x44')](db[_0x3983('0x8a')]['rawAttributes']);_0x195351[_0x3983('0x30')]=_[_0x3983('0x44')](_0x3a65e2[_0x3983('0x30')]);_0x195351[_0x3983('0x3a')]=_[_0x3983('0x31')](_0x195351['model'],_0x195351[_0x3983('0x30')]);_0xae0bb6[_0x3983('0x33')]=_[_0x3983('0x31')](_0x195351['model'],qs[_0x3983('0x34')](_0x3a65e2['query'][_0x3983('0x34')]));_0xae0bb6[_0x3983('0x33')]=_0xae0bb6[_0x3983('0x33')][_0x3983('0x35')]?_0xae0bb6[_0x3983('0x33')]:_0x195351[_0x3983('0x32')];_0xae0bb6[_0x3983('0x38')]=qs['sort'](_0x3a65e2['query'][_0x3983('0x39')]);_0xae0bb6[_0x3983('0x3b')]=qs[_0x3983('0x3a')](_[_0x3983('0x74')](_0x3a65e2[_0x3983('0x30')],_0x195351[_0x3983('0x3a')]));if(_0x3a65e2[_0x3983('0x30')][_0x3983('0x98')]){_0xae0bb6[_0x3983('0x3b')]=_[_0x3983('0x3c')](_0xae0bb6[_0x3983('0x3b')],{'$or':_[_0x3983('0x2b')](_0xae0bb6[_0x3983('0x33')],function(_0x47e917){var _0x3bf7ce={};_0x3bf7ce[_0x47e917]={'$like':'%'+_0x3a65e2[_0x3983('0x30')]['filter']+'%'};return _0x3bf7ce;})});}_0xae0bb6=_[_0x3983('0x3c')]({},_0xae0bb6,_0x3a65e2[_0x3983('0x3e')]);return _0x28f1e5[_0x3983('0x99')](_0xae0bb6);}})[_0x3983('0x40')](function(_0x222811){if(_0x222811){_0x3e4c92=_0x222811[_0x3983('0x35')];if(!_0x3a65e2[_0x3983('0x30')]['hasOwnProperty'](_0x3983('0x37'))){_0xae0bb6[_0x3983('0x1f')]=qs[_0x3983('0x1f')](_0x3a65e2[_0x3983('0x30')][_0x3983('0x1f')]);_0xae0bb6[_0x3983('0x1d')]=qs[_0x3983('0x1d')](_0x3a65e2[_0x3983('0x30')]['offset']);}return _0x28f1e5[_0x3983('0x99')](_0xae0bb6);}})[_0x3983('0x40')](function(_0x26cb2a){if(_0x26cb2a){return _0x26cb2a?{'count':_0x3e4c92,'rows':_0x26cb2a}:null;}})[_0x3983('0x40')](respondWithResult(_0x51c114,null))['catch'](handleError(_0x51c114,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 8f05932..965d34c 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 _0xfd27=['hook','exports','events','../../mysqldb','Team','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x237849,_0x2a106f){var _0x257e3e=function(_0x5d415e){while(--_0x5d415e){_0x237849['push'](_0x237849['shift']());}};_0x257e3e(++_0x2a106f);}(_0xfd27,0x84));var _0x7fd2=function(_0x15e5b2,_0x45ff39){_0x15e5b2=_0x15e5b2-0x0;var _0x764f50=_0xfd27[_0x15e5b2];return _0x764f50;};'use strict';var EventEmitter=require(_0x7fd2('0x0'));var Team=require(_0x7fd2('0x1'))['db'][_0x7fd2('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x7fd2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7fd2('0x4'),'afterDestroy':_0x7fd2('0x5')};function emitEvent(_0xd139c0){return function(_0x3efdaa,_0x40a66d,_0x3dcb2e){TeamEvents[_0x7fd2('0x6')](_0xd139c0+':'+_0x3efdaa['id'],_0x3efdaa);TeamEvents['emit'](_0xd139c0,_0x3efdaa);_0x3dcb2e(null);};}for(var e in events){if(events[_0x7fd2('0x7')](e)){var event=events[e];Team[_0x7fd2('0x8')](e,emitEvent(event));}}module[_0x7fd2('0x9')]=TeamEvents; \ No newline at end of file +var _0x1cf1=['events','../../mysqldb','Team','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x162d0a,_0x5369a7){var _0x4bd392=function(_0x4e1070){while(--_0x4e1070){_0x162d0a['push'](_0x162d0a['shift']());}};_0x4bd392(++_0x5369a7);}(_0x1cf1,0x183));var _0x11cf=function(_0x19c7fa,_0x52914b){_0x19c7fa=_0x19c7fa-0x0;var _0x4a7476=_0x1cf1[_0x19c7fa];return _0x4a7476;};'use strict';var EventEmitter=require(_0x11cf('0x0'));var Team=require(_0x11cf('0x1'))['db'][_0x11cf('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x11cf('0x3')](0x0);var events={'afterCreate':_0x11cf('0x4'),'afterUpdate':'update','afterDestroy':_0x11cf('0x5')};function emitEvent(_0x1cf3dd){return function(_0x420a4,_0x5800ba,_0x20a9b8){TeamEvents[_0x11cf('0x6')](_0x1cf3dd+':'+_0x420a4['id'],_0x420a4);TeamEvents[_0x11cf('0x6')](_0x1cf3dd,_0x420a4);_0x20a9b8(null);};}for(var e in events){if(events[_0x11cf('0x7')](e)){var event=events[e];Team[_0x11cf('0x8')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 5ad3a13..99928e1 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 _0x2b9e=['Chat','Fax','Mail','Openchannel','Sms','Voice','resolve','all','catch','lodash','map','setDataValue','channel','exports','define','teams'];(function(_0x59560f,_0x11f222){var _0x435293=function(_0x4a2794){while(--_0x4a2794){_0x59560f['push'](_0x59560f['shift']());}};_0x435293(++_0x11f222);}(_0x2b9e,0xf9));var _0xe2b9=function(_0x37a174,_0x1f3cbd){_0x37a174=_0x37a174-0x0;var _0x4f6328=_0x2b9e[_0x37a174];return _0x4f6328;};'use strict';var _=require(_0xe2b9('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x50b2a2,_0x5819f3){var _0x5aa773='get'+_0x5819f3+'Queues';return _0x50b2a2[_0x5aa773]()['then'](function(_0x5c9178){return _[_0xe2b9('0x1')](_0x5c9178,function(_0x5098c6){_0x5098c6[_0xe2b9('0x2')](_0xe2b9('0x3'),_0x5819f3);return _0x5098c6;});})['catch'](function(_0x1ed22e){throw _0x1ed22e;});}module[_0xe2b9('0x4')]=function(_0x3408c1){return _0x3408c1[_0xe2b9('0x5')]('Team',attributes,{'tableName':_0xe2b9('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x5e0b04=this;var _0xca90e0=[_0xe2b9('0x7'),_0xe2b9('0x8'),_0xe2b9('0x9'),_0xe2b9('0xa'),_0xe2b9('0xb'),_0xe2b9('0xc'),'Whatsapp'];return Promise[_0xe2b9('0xd')]()['then'](function(){var _0xbbb0a8=_[_0xe2b9('0x1')](_0xca90e0,function(_0x5b320b){return getQueuesByChannel(_0x5e0b04,_0x5b320b);});return Promise[_0xe2b9('0xe')](_0xbbb0a8);})[_0xe2b9('0xf')](function(_0x197350){throw _0x197350;});}}});}; \ No newline at end of file +var _0x1ce6=['Chat','Mail','Openchannel','Sms','all','lodash','get','then','map','channel','catch','exports','define','Team','teams'];(function(_0x187f71,_0xf40f00){var _0xdf027a=function(_0x127e87){while(--_0x127e87){_0x187f71['push'](_0x187f71['shift']());}};_0xdf027a(++_0xf40f00);}(_0x1ce6,0x1f4));var _0x61ce=function(_0x19b475,_0x5062b6){_0x19b475=_0x19b475-0x0;var _0x333eea=_0x1ce6[_0x19b475];return _0x333eea;};'use strict';var _=require(_0x61ce('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x35709b,_0x2a0f22){var _0x320ec0=_0x61ce('0x1')+_0x2a0f22+'Queues';return _0x35709b[_0x320ec0]()[_0x61ce('0x2')](function(_0x432719){return _[_0x61ce('0x3')](_0x432719,function(_0x5f5234){_0x5f5234['setDataValue'](_0x61ce('0x4'),_0x2a0f22);return _0x5f5234;});})[_0x61ce('0x5')](function(_0xa6665c){throw _0xa6665c;});}module[_0x61ce('0x6')]=function(_0x37a09b){return _0x37a09b[_0x61ce('0x7')](_0x61ce('0x8'),attributes,{'tableName':_0x61ce('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x432443=this;var _0x22a795=[_0x61ce('0xa'),'Fax',_0x61ce('0xb'),_0x61ce('0xc'),_0x61ce('0xd'),'Voice','Whatsapp'];return Promise['resolve']()[_0x61ce('0x2')](function(){var _0x5d9a83=_[_0x61ce('0x3')](_0x22a795,function(_0x40aa5d){return getQueuesByChannel(_0x432443,_0x40aa5d);});return Promise[_0x61ce('0xe')](_0x5d9a83);})[_0x61ce('0x5')](function(_0x171914){throw _0x171914;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index ffd3e82..1a2c6ae 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 _0x7d0e=['lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','error','code','Team,\x20%s,\x20%s','message','catch'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x7d0e,0xc8));var _0xe7d0=function(_0x47177d,_0x5b11ff){_0x47177d=_0x47177d-0x0;var _0x402995=_0x7d0e[_0x47177d];return _0x402995;};'use strict';var _=require(_0xe7d0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe7d0('0x1'));var rs=require(_0xe7d0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe7d0('0x3'))['db'];var utils=require(_0xe7d0('0x4'));var logger=require(_0xe7d0('0x5'))(_0xe7d0('0x6'));var config=require(_0xe7d0('0x7'));var jayson=require(_0xe7d0('0x8'));var client=jayson['client'][_0xe7d0('0x9')]({'port':0x232a});config['redis']=_[_0xe7d0('0xa')](config['redis'],{'host':_0xe7d0('0xb'),'port':0x18eb});var socket=require(_0xe7d0('0xc'))(new Redis(config['redis']));require('./team.socket')[_0xe7d0('0xd')](socket);function respondWithRpcPromise(_0x260757,_0x5f2ff9,_0x4649f5){return new BPromise(function(_0x30253f,_0x39eeb1){return client[_0xe7d0('0xe')](_0x260757,_0x4649f5)[_0xe7d0('0xf')](function(_0x542e22){logger[_0xe7d0('0x10')]('Team,\x20%s,\x20%s',_0x5f2ff9,_0xe7d0('0x11'));logger[_0xe7d0('0x12')](_0xe7d0('0x13'),_0x5f2ff9,_0xe7d0('0x11'),JSON['stringify'](_0x542e22));if(_0x542e22[_0xe7d0('0x14')]){if(_0x542e22[_0xe7d0('0x14')][_0xe7d0('0x15')]===0x1f4){logger[_0xe7d0('0x14')](_0xe7d0('0x16'),_0x5f2ff9,_0x542e22[_0xe7d0('0x14')][_0xe7d0('0x17')]);return _0x39eeb1(_0x542e22[_0xe7d0('0x14')][_0xe7d0('0x17')]);}logger[_0xe7d0('0x14')](_0xe7d0('0x16'),_0x5f2ff9,_0x542e22[_0xe7d0('0x14')][_0xe7d0('0x17')]);return _0x30253f(_0x542e22[_0xe7d0('0x14')]['message']);}else{logger[_0xe7d0('0x10')](_0xe7d0('0x16'),_0x5f2ff9,_0xe7d0('0x11'));_0x30253f(_0x542e22['result']['message']);}})[_0xe7d0('0x18')](function(_0x1d8838){logger[_0xe7d0('0x14')]('Team,\x20%s,\x20%s',_0x5f2ff9,_0x1d8838);_0x39eeb1(_0x1d8838);});});} \ No newline at end of file +var _0x2fd3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','redis','./team.socket','register','info','request\x20sent','error','Team,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x2e3b7c,_0xc17939){var _0x421487=function(_0x15c703){while(--_0x15c703){_0x2e3b7c['push'](_0x2e3b7c['shift']());}};_0x421487(++_0xc17939);}(_0x2fd3,0x18c));var _0x32fd=function(_0x1fb524,_0x33d1d3){_0x1fb524=_0x1fb524-0x0;var _0x3a76d3=_0x2fd3[_0x1fb524];return _0x3a76d3;};'use strict';var _=require('lodash');var util=require(_0x32fd('0x0'));var moment=require(_0x32fd('0x1'));var BPromise=require(_0x32fd('0x2'));var rs=require(_0x32fd('0x3'));var fs=require('fs');var Redis=require(_0x32fd('0x4'));var db=require(_0x32fd('0x5'))['db'];var utils=require(_0x32fd('0x6'));var logger=require(_0x32fd('0x7'))(_0x32fd('0x8'));var config=require(_0x32fd('0x9'));var jayson=require(_0x32fd('0xa'));var client=jayson[_0x32fd('0xb')][_0x32fd('0xc')]({'port':0x232a});config['redis']=_[_0x32fd('0xd')](config['redis'],{'host':_0x32fd('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x32fd('0xf')]));require(_0x32fd('0x10'))[_0x32fd('0x11')](socket);function respondWithRpcPromise(_0x1c2f04,_0x4ab8f2,_0x56f4f8){return new BPromise(function(_0x3f2e81,_0x1f4326){return client['request'](_0x1c2f04,_0x56f4f8)['then'](function(_0x2578c9){logger[_0x32fd('0x12')]('Team,\x20%s,\x20%s',_0x4ab8f2,_0x32fd('0x13'));logger['debug']('Team,\x20%s,\x20%s,\x20%s',_0x4ab8f2,'request\x20sent',JSON['stringify'](_0x2578c9));if(_0x2578c9[_0x32fd('0x14')]){if(_0x2578c9[_0x32fd('0x14')]['code']===0x1f4){logger['error'](_0x32fd('0x15'),_0x4ab8f2,_0x2578c9['error'][_0x32fd('0x16')]);return _0x1f4326(_0x2578c9[_0x32fd('0x14')][_0x32fd('0x16')]);}logger[_0x32fd('0x14')](_0x32fd('0x15'),_0x4ab8f2,_0x2578c9[_0x32fd('0x14')][_0x32fd('0x16')]);return _0x3f2e81(_0x2578c9[_0x32fd('0x14')]['message']);}else{logger[_0x32fd('0x12')](_0x32fd('0x15'),_0x4ab8f2,_0x32fd('0x13'));_0x3f2e81(_0x2578c9[_0x32fd('0x17')][_0x32fd('0x16')]);}})[_0x32fd('0x18')](function(_0x661ea0){logger['error'](_0x32fd('0x15'),_0x4ab8f2,_0x661ea0);_0x1f4326(_0x661ea0);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 0c21df6..0edc4ee 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 _0xfa91=['team:','save','update','emit','register','length'];(function(_0xb1b08c,_0x1961a6){var _0x608518=function(_0x405997){while(--_0x405997){_0xb1b08c['push'](_0xb1b08c['shift']());}};_0x608518(++_0x1961a6);}(_0xfa91,0x11b));var _0x1fa9=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0xfa91[_0xd0b415];return _0x2bdf2c;};'use strict';var TeamEvents=require('./team.events');var events=[_0x1fa9('0x0'),'remove',_0x1fa9('0x1')];function createListener(_0x542b29,_0x25a850){return function(_0x25877f){_0x25a850[_0x1fa9('0x2')](_0x542b29,_0x25877f);};}function removeListener(_0x4a65c9,_0xc2cd7e){return function(){TeamEvents['removeListener'](_0x4a65c9,_0xc2cd7e);};}exports[_0x1fa9('0x3')]=function(_0xe45dcf){for(var _0x3434d7=0x0,_0x1ff290=events[_0x1fa9('0x4')];_0x3434d7<_0x1ff290;_0x3434d7++){var _0x4f4c71=events[_0x3434d7];var _0x36c070=createListener(_0x1fa9('0x5')+_0x4f4c71,_0xe45dcf);TeamEvents['on'](_0x4f4c71,_0x36c070);}}; \ No newline at end of file +var _0xab7f=['remove','update','emit','register','length','team:','./team.events','save'];(function(_0x819bcc,_0x11d8b2){var _0x55fc0e=function(_0x5937f8){while(--_0x5937f8){_0x819bcc['push'](_0x819bcc['shift']());}};_0x55fc0e(++_0x11d8b2);}(_0xab7f,0xa6));var _0xfab7=function(_0xe8acf6,_0xce88e6){_0xe8acf6=_0xe8acf6-0x0;var _0x354cfb=_0xab7f[_0xe8acf6];return _0x354cfb;};'use strict';var TeamEvents=require(_0xfab7('0x0'));var events=[_0xfab7('0x1'),_0xfab7('0x2'),_0xfab7('0x3')];function createListener(_0x22a471,_0x4e1b3d){return function(_0x7693da){_0x4e1b3d[_0xfab7('0x4')](_0x22a471,_0x7693da);};}function removeListener(_0x233cd9,_0x1e13c6){return function(){TeamEvents['removeListener'](_0x233cd9,_0x1e13c6);};}exports[_0xfab7('0x5')]=function(_0x1213a8){for(var _0x5cde2d=0x0,_0x704224=events[_0xfab7('0x6')];_0x5cde2d<_0x704224;_0x5cde2d++){var _0x40610b=events[_0x5cde2d];var _0x2025c9=createListener(_0xfab7('0x7')+_0x40610b,_0x1213a8);TeamEvents['on'](_0x40610b,_0x2025c9);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 0d938bf..f0029ab 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 _0x3526=['INTEGER','exports'];(function(_0x54feb3,_0x1a342d){var _0x479c1b=function(_0x6af747){while(--_0x6af747){_0x54feb3['push'](_0x54feb3['shift']());}};_0x479c1b(++_0x1a342d);}(_0x3526,0x1db));var _0x6352=function(_0x2867e5,_0x8c540c){_0x2867e5=_0x2867e5-0x0;var _0x12a39f=_0x3526[_0x2867e5];return _0x12a39f;};'use strict';var Sequelize=require('sequelize');module[_0x6352('0x0')]={'TeamId':{'type':Sequelize[_0x6352('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x6352('0x1')]}}; \ No newline at end of file +var _0xde46=['sequelize','INTEGER'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xde46,0x174));var _0x6de4=function(_0x537a14,_0x4dbf52){_0x537a14=_0x537a14-0x0;var _0x4c554b=_0xde46[_0x537a14];return _0x4c554b;};'use strict';var Sequelize=require(_0x6de4('0x0'));module['exports']={'TeamId':{'type':Sequelize[_0x6de4('0x1')]},'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 36677f4..0d6c072 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 _0x1c8a=['team_has_voice_prefixes','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./teamVoicePrefix.attributes','define'];(function(_0x30fc17,_0x43b50f){var _0x38ec11=function(_0x2e5079){while(--_0x2e5079){_0x30fc17['push'](_0x30fc17['shift']());}};_0x38ec11(++_0x43b50f);}(_0x1c8a,0x140));var _0xa1c8=function(_0x528283,_0xf28f92){_0x528283=_0x528283-0x0;var _0x479fef=_0x1c8a[_0x528283];return _0x479fef;};'use strict';var _=require(_0xa1c8('0x0'));var util=require(_0xa1c8('0x1'));var logger=require(_0xa1c8('0x2'))(_0xa1c8('0x3'));var moment=require(_0xa1c8('0x4'));var BPromise=require('bluebird');var rp=require(_0xa1c8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa1c8('0x6'));var config=require(_0xa1c8('0x7'));var attributes=require(_0xa1c8('0x8'));module['exports']=function(_0x331282,_0x14b85c){return _0x331282[_0xa1c8('0x9')]('TeamVoicePrefix',attributes,{'tableName':_0xa1c8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6f3e=['exports','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x6f3e,0x9f));var _0xe6f3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6f3e[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xe6f3('0x0'));var util=require(_0xe6f3('0x1'));var logger=require(_0xe6f3('0x2'))(_0xe6f3('0x3'));var moment=require(_0xe6f3('0x4'));var BPromise=require(_0xe6f3('0x5'));var rp=require(_0xe6f3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe6f3('0x7'));var config=require(_0xe6f3('0x8'));var attributes=require('./teamVoicePrefix.attributes');module[_0xe6f3('0x9')]=function(_0x46e7ef,_0x2723be){return _0x46e7ef['define'](_0xe6f3('0xa'),attributes,{'tableName':_0xe6f3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 2c3cb28..b721d5a 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1a3db4,_0x5b02bf){var _0x4b3eb5=function(_0x49f0ee){while(--_0x49f0ee){_0x1a3db4['push'](_0x1a3db4['shift']());}};_0x4b3eb5(++_0x5b02bf);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x43c0d8,_0x59449e){var _0x255aaf=function(_0x204b32){while(--_0x204b32){_0x43c0d8['push'](_0x43c0d8['shift']());}};_0x255aaf(++_0x59449e);}(_0x9c44,0x178));var _0x49c4=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9c44[_0x2e4aa2];return _0x5e6092;};'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 3f8dd88..cd43c83 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 _0xcb26=['sequelize','exports','INTEGER'];(function(_0x4d337e,_0x2f7eed){var _0x247963=function(_0x3d6564){while(--_0x3d6564){_0x4d337e['push'](_0x4d337e['shift']());}};_0x247963(++_0x2f7eed);}(_0xcb26,0xf6));var _0x6cb2=function(_0x17406a,_0x1e2320){_0x17406a=_0x17406a-0x0;var _0x1501ff=_0xcb26[_0x17406a];return _0x1501ff;};'use strict';var Sequelize=require(_0x6cb2('0x0'));module[_0x6cb2('0x1')]={'penalty':{'type':Sequelize[_0x6cb2('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb4e9=['exports','INTEGER','sequelize'];(function(_0x31b456,_0x134a1f){var _0x45c588=function(_0x57fede){while(--_0x57fede){_0x31b456['push'](_0x31b456['shift']());}};_0x45c588(++_0x134a1f);}(_0xb4e9,0xda));var _0x9b4e=function(_0x2b7fd3,_0x17556d){_0x2b7fd3=_0x2b7fd3-0x0;var _0x1bd260=_0xb4e9[_0x2b7fd3];return _0x1bd260;};'use strict';var Sequelize=require(_0x9b4e('0x0'));module[_0x9b4e('0x1')]={'penalty':{'type':Sequelize[_0x9b4e('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 4ffddf9..e85cb74 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 _0x26cf=['../../config/logger','moment','request-promise','rimraf','../../config/environment','exports','define','TeamVoiceQueue','team_has_voice_queues','util'];(function(_0x337216,_0x4184e2){var _0x113fdb=function(_0x34e656){while(--_0x34e656){_0x337216['push'](_0x337216['shift']());}};_0x113fdb(++_0x4184e2);}(_0x26cf,0x135));var _0xf26c=function(_0x272608,_0x182cfa){_0x272608=_0x272608-0x0;var _0x4fd28a=_0x26cf[_0x272608];return _0x4fd28a;};'use strict';var _=require('lodash');var util=require(_0xf26c('0x0'));var logger=require(_0xf26c('0x1'))('api');var moment=require(_0xf26c('0x2'));var BPromise=require('bluebird');var rp=require(_0xf26c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf26c('0x4'));var config=require(_0xf26c('0x5'));var attributes=require('./teamVoiceQueue.attributes');module[_0xf26c('0x6')]=function(_0x10638a,_0x32d4ef){return _0x10638a[_0xf26c('0x7')](_0xf26c('0x8'),attributes,{'tableName':_0xf26c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4876=['../../config/environment','./teamVoiceQueue.attributes','TeamVoiceQueue','team_has_voice_queues','../../config/logger','bluebird','path','rimraf'];(function(_0x413891,_0xa01a2f){var _0xe46731=function(_0x30dfa7){while(--_0x30dfa7){_0x413891['push'](_0x413891['shift']());}};_0xe46731(++_0xa01a2f);}(_0x4876,0x84));var _0x6487=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4876[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6487('0x0'))('api');var moment=require('moment');var BPromise=require(_0x6487('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6487('0x2'));var rimraf=require(_0x6487('0x3'));var config=require(_0x6487('0x4'));var attributes=require(_0x6487('0x5'));module['exports']=function(_0x23e50b,_0x856b1c){return _0x23e50b['define'](_0x6487('0x6'),attributes,{'tableName':_0x6487('0x7'),'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 27121be..81a6cd0 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 _0x2feb=['error','code','message','catch','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x19a6b7,_0x44e5fe){var _0x4b1297=function(_0x1c7ea1){while(--_0x1c7ea1){_0x19a6b7['push'](_0x19a6b7['shift']());}};_0x4b1297(++_0x44e5fe);}(_0x2feb,0x10c));var _0xb2fe=function(_0x307d2b,_0x3796e0){_0x307d2b=_0x307d2b-0x0;var _0xe82587=_0x2feb[_0x307d2b];return _0xe82587;};'use strict';var _=require(_0xb2fe('0x0'));var util=require('util');var moment=require(_0xb2fe('0x1'));var BPromise=require(_0xb2fe('0x2'));var rs=require(_0xb2fe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb2fe('0x4'));var logger=require(_0xb2fe('0x5'))(_0xb2fe('0x6'));var config=require(_0xb2fe('0x7'));var jayson=require(_0xb2fe('0x8'));var client=jayson[_0xb2fe('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x221a4a,_0x415212,_0x23b747){return new BPromise(function(_0x320766,_0x1afd30){return client[_0xb2fe('0xa')](_0x221a4a,_0x23b747)[_0xb2fe('0xb')](function(_0x2d0260){logger[_0xb2fe('0xc')](_0xb2fe('0xd'),_0x415212,_0xb2fe('0xe'));logger[_0xb2fe('0xf')](_0xb2fe('0x10'),_0x415212,_0xb2fe('0xe'),JSON[_0xb2fe('0x11')](_0x2d0260));if(_0x2d0260[_0xb2fe('0x12')]){if(_0x2d0260[_0xb2fe('0x12')][_0xb2fe('0x13')]===0x1f4){logger[_0xb2fe('0x12')](_0xb2fe('0xd'),_0x415212,_0x2d0260[_0xb2fe('0x12')][_0xb2fe('0x14')]);return _0x1afd30(_0x2d0260['error'][_0xb2fe('0x14')]);}logger['error'](_0xb2fe('0xd'),_0x415212,_0x2d0260[_0xb2fe('0x12')][_0xb2fe('0x14')]);return _0x320766(_0x2d0260[_0xb2fe('0x12')][_0xb2fe('0x14')]);}else{logger[_0xb2fe('0xc')](_0xb2fe('0xd'),_0x415212,'request\x20sent');_0x320766(_0x2d0260['result'][_0xb2fe('0x14')]);}})[_0xb2fe('0x15')](function(_0x1aee80){logger[_0xb2fe('0x12')](_0xb2fe('0xd'),_0x415212,_0x1aee80);_0x1afd30(_0x1aee80);});});} \ No newline at end of file +var _0xa7d7=['message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x29829d,_0x1ff9bf){var _0xaf67d0=function(_0x1ce9c4){while(--_0x1ce9c4){_0x29829d['push'](_0x29829d['shift']());}};_0xaf67d0(++_0x1ff9bf);}(_0xa7d7,0x179));var _0x7a7d=function(_0x412e27,_0x20a978){_0x412e27=_0x412e27-0x0;var _0x53da42=_0xa7d7[_0x412e27];return _0x53da42;};'use strict';var _=require(_0x7a7d('0x0'));var util=require(_0x7a7d('0x1'));var moment=require(_0x7a7d('0x2'));var BPromise=require(_0x7a7d('0x3'));var rs=require(_0x7a7d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7a7d('0x5'))['db'];var utils=require(_0x7a7d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x7a7d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7a7d('0x8')][_0x7a7d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40a223,_0x234018,_0x3494b8){return new BPromise(function(_0x131422,_0x43f29b){return client[_0x7a7d('0xa')](_0x40a223,_0x3494b8)[_0x7a7d('0xb')](function(_0x55adbf){logger['info'](_0x7a7d('0xc'),_0x234018,'request\x20sent');logger[_0x7a7d('0xd')](_0x7a7d('0xe'),_0x234018,_0x7a7d('0xf'),JSON[_0x7a7d('0x10')](_0x55adbf));if(_0x55adbf[_0x7a7d('0x11')]){if(_0x55adbf[_0x7a7d('0x11')][_0x7a7d('0x12')]===0x1f4){logger[_0x7a7d('0x11')](_0x7a7d('0xc'),_0x234018,_0x55adbf[_0x7a7d('0x11')]['message']);return _0x43f29b(_0x55adbf['error'][_0x7a7d('0x13')]);}logger['error'](_0x7a7d('0xc'),_0x234018,_0x55adbf['error']['message']);return _0x131422(_0x55adbf[_0x7a7d('0x11')]['message']);}else{logger[_0x7a7d('0x14')](_0x7a7d('0xc'),_0x234018,_0x7a7d('0xf'));_0x131422(_0x55adbf['result'][_0x7a7d('0x13')]);}})[_0x7a7d('0x15')](function(_0x3f9462){logger['error']('TeamVoiceQueue,\x20%s,\x20%s',_0x234018,_0x3f9462);_0x43f29b(_0x3f9462);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 5001c56..dc37a76 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 _0xf61e=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','index','isAuthenticated','show','post','put'];(function(_0x4e46ec,_0x10d0ae){var _0x96e5e7=function(_0x3c3f40){while(--_0x3c3f40){_0x4e46ec['push'](_0x4e46ec['shift']());}};_0x96e5e7(++_0x10d0ae);}(_0xf61e,0x191));var _0xef61=function(_0x483609,_0xb93779){_0x483609=_0x483609-0x0;var _0x5007fb=_0xf61e[_0x483609];return _0x5007fb;};'use strict';var multer=require(_0xef61('0x0'));var util=require(_0xef61('0x1'));var path=require(_0xef61('0x2'));var timeout=require(_0xef61('0x3'));var express=require(_0xef61('0x4'));var router=express[_0xef61('0x5')]();var fs_extra=require(_0xef61('0x6'));var auth=require(_0xef61('0x7'));var interaction=require(_0xef61('0x8'));var config=require(_0xef61('0x9'));var controller=require(_0xef61('0xa'));router[_0xef61('0xb')]('/',auth['isAuthenticated'](),controller[_0xef61('0xc')]);router[_0xef61('0xb')]('/:id',auth[_0xef61('0xd')](),controller[_0xef61('0xe')]);router[_0xef61('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xef61('0x10')](_0xef61('0x11'),auth[_0xef61('0xd')](),controller[_0xef61('0x12')]);router[_0xef61('0x13')](_0xef61('0x11'),auth[_0xef61('0xd')](),controller[_0xef61('0x14')]);module[_0xef61('0x15')]=router; \ No newline at end of file +var _0x0af5=['create','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','/:id'];(function(_0xdd3b79,_0x3d7db8){var _0x7fd880=function(_0x4f82c0){while(--_0x4f82c0){_0xdd3b79['push'](_0xdd3b79['shift']());}};_0x7fd880(++_0x3d7db8);}(_0x0af5,0x158));var _0x50af=function(_0x172ba2,_0x1cef77){_0x172ba2=_0x172ba2-0x0;var _0x1d0858=_0x0af5[_0x172ba2];return _0x1d0858;};'use strict';var multer=require('multer');var util=require(_0x50af('0x0'));var path=require(_0x50af('0x1'));var timeout=require(_0x50af('0x2'));var express=require(_0x50af('0x3'));var router=express[_0x50af('0x4')]();var fs_extra=require(_0x50af('0x5'));var auth=require(_0x50af('0x6'));var interaction=require(_0x50af('0x7'));var config=require(_0x50af('0x8'));var controller=require(_0x50af('0x9'));router[_0x50af('0xa')]('/',auth[_0x50af('0xb')](),controller['index']);router['get'](_0x50af('0xc'),auth[_0x50af('0xb')](),controller['show']);router['post']('/',auth[_0x50af('0xb')](),controller[_0x50af('0xd')]);router['put']('/:id',auth[_0x50af('0xb')](),controller[_0x50af('0xe')]);router['delete'](_0x50af('0xc'),auth[_0x50af('0xb')](),controller[_0x50af('0xf')]);module[_0x50af('0x10')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 1ed736d..46c4471 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 _0x4ba8=['sequelize','exports','STRING','TEXT'];(function(_0x50388b,_0x276225){var _0x6037b=function(_0x584277){while(--_0x584277){_0x50388b['push'](_0x50388b['shift']());}};_0x6037b(++_0x276225);}(_0x4ba8,0xa4));var _0x84ba=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4ba8[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x84ba('0x0'));module[_0x84ba('0x1')]={'name':{'type':Sequelize[_0x84ba('0x2')]},'description':{'type':Sequelize[_0x84ba('0x2')]},'html':{'type':Sequelize[_0x84ba('0x3')]}}; \ No newline at end of file +var _0xe6c4=['exports','STRING','TEXT'];(function(_0x43b459,_0x1523bf){var _0x12110a=function(_0x4d0023){while(--_0x4d0023){_0x43b459['push'](_0x43b459['shift']());}};_0x12110a(++_0x1523bf);}(_0xe6c4,0x1aa));var _0x4e6c=function(_0x34cf54,_0x18f11){_0x34cf54=_0x34cf54-0x0;var _0x4c97ab=_0xe6c4[_0x34cf54];return _0x4c97ab;};'use strict';var Sequelize=require('sequelize');module[_0x4e6c('0x0')]={'name':{'type':Sequelize[_0x4e6c('0x1')]},'description':{'type':Sequelize[_0x4e6c('0x1')]},'html':{'type':Sequelize[_0x4e6c('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 858afb3..6134a64 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 _0x0fea=['Template','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Templates','end','error','stack','name','send','index'];(function(_0x3b4889,_0x3868f6){var _0x4fb5e6=function(_0x681a0){while(--_0x681a0){_0x3b4889['push'](_0x3b4889['shift']());}};_0x4fb5e6(++_0x3868f6);}(_0x0fea,0x80));var _0xa0fe=function(_0x53080e,_0x252127){_0x53080e=_0x53080e-0x0;var _0x1a0c14=_0x0fea[_0x53080e];return _0x1a0c14;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa0fe('0x0'));var zipdir=require(_0xa0fe('0x1'));var jsonpatch=require(_0xa0fe('0x2'));var rp=require(_0xa0fe('0x3'));var moment=require(_0xa0fe('0x4'));var BPromise=require(_0xa0fe('0x5'));var Mustache=require(_0xa0fe('0x6'));var util=require(_0xa0fe('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xa0fe('0x8'));var ejs=require(_0xa0fe('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa0fe('0xa'));var squel=require(_0xa0fe('0xb'));var crypto=require(_0xa0fe('0xc'));var jsforce=require(_0xa0fe('0xd'));var deskjs=require(_0xa0fe('0xe'));var toCsv=require(_0xa0fe('0x8'));var querystring=require(_0xa0fe('0xf'));var Papa=require(_0xa0fe('0x10'));var Redis=require('ioredis');var authService=require(_0xa0fe('0x11'));var qs=require(_0xa0fe('0x12'));var as=require(_0xa0fe('0x13'));var hardwareService=require(_0xa0fe('0x14'));var logger=require(_0xa0fe('0x15'))(_0xa0fe('0x16'));var utils=require(_0xa0fe('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa0fe('0x18'));var db=require(_0xa0fe('0x19'))['db'];function respondWithStatusCode(_0x2232c9,_0x5bf51a){_0x5bf51a=_0x5bf51a||0xcc;return function(_0x22e11e){if(_0x22e11e){return _0x2232c9[_0xa0fe('0x1a')](_0x5bf51a);}return _0x2232c9[_0xa0fe('0x1b')](_0x5bf51a)['end']();};}function respondWithResult(_0x10935d,_0x1b6916){_0x1b6916=_0x1b6916||0xc8;return function(_0x38e0d0){if(_0x38e0d0){return _0x10935d[_0xa0fe('0x1b')](_0x1b6916)[_0xa0fe('0x1c')](_0x38e0d0);}};}function respondWithFilteredResult(_0x3c217f,_0x54cd31){return function(_0x1f64ea){if(_0x1f64ea){var _0x4022d5=typeof _0x54cd31[_0xa0fe('0x1d')]===_0xa0fe('0x1e')&&typeof _0x54cd31['limit']===_0xa0fe('0x1e');var _0x19076a=_0x1f64ea['count'];var _0x2ac92e=_0x4022d5?0x0:_0x54cd31[_0xa0fe('0x1d')];var _0x260e3f=_0x4022d5?_0x1f64ea[_0xa0fe('0x1f')]:_0x54cd31[_0xa0fe('0x1d')]+_0x54cd31['limit'];var _0x5500a3;if(_0x260e3f>=_0x19076a){_0x260e3f=_0x19076a;_0x5500a3=0xc8;}else{_0x5500a3=0xce;}_0x3c217f[_0xa0fe('0x1b')](_0x5500a3);return _0x3c217f[_0xa0fe('0x20')](_0xa0fe('0x21'),_0x2ac92e+'-'+_0x260e3f+'/'+_0x19076a)[_0xa0fe('0x1c')](_0x1f64ea);}return null;};}function patchUpdates(_0x185f03){return function(_0x2156d2){try{jsonpatch[_0xa0fe('0x22')](_0x2156d2,_0x185f03,!![]);}catch(_0xb0ec32){return BPromise[_0xa0fe('0x23')](_0xb0ec32);}return _0x2156d2[_0xa0fe('0x24')]();};}function saveUpdates(_0x2f45df,_0x4241d5){return function(_0x5eddd3){if(_0x5eddd3){return _0x5eddd3[_0xa0fe('0x25')](_0x2f45df)[_0xa0fe('0x26')](function(_0x11fc3f){return _0x11fc3f;});}return null;};}function removeEntity(_0x34c594,_0x49a23b){return function(_0x593257){if(_0x593257){return _0x593257[_0xa0fe('0x27')]()[_0xa0fe('0x26')](function(){var _0x2d66c8=_0x593257[_0xa0fe('0x28')]({'plain':!![]});var _0x2807a5=_0xa0fe('0x29');return db['UserProfileResource'][_0xa0fe('0x27')]({'where':{'type':_0x2807a5,'resourceId':_0x2d66c8['id']}})['then'](function(){return _0x593257;});})[_0xa0fe('0x26')](function(){_0x34c594[_0xa0fe('0x1b')](0xcc)[_0xa0fe('0x2a')]();});}};}function handleEntityNotFound(_0x48d476,_0x522a6f){return function(_0x4934e5){if(!_0x4934e5){_0x48d476[_0xa0fe('0x1a')](0x194);}return _0x4934e5;};}function handleError(_0x3aafd2,_0xb65b40){_0xb65b40=_0xb65b40||0x1f4;return function(_0x200235){logger[_0xa0fe('0x2b')](_0x200235[_0xa0fe('0x2c')]);if(_0x200235[_0xa0fe('0x2d')]){delete _0x200235['name'];}_0x3aafd2[_0xa0fe('0x1b')](_0xb65b40)[_0xa0fe('0x2e')](_0x200235);};}exports[_0xa0fe('0x2f')]=function(_0x42c659,_0x3ef0ad){var _0xa3bc6e={},_0x112615={},_0x5c7762={'count':0x0,'rows':[]};var _0x146798=_['map'](db[_0xa0fe('0x30')]['rawAttributes'],function(_0x24ca60){return{'name':_0x24ca60[_0xa0fe('0x31')],'type':_0x24ca60[_0xa0fe('0x32')][_0xa0fe('0x33')]};});_0x112615[_0xa0fe('0x34')]=_[_0xa0fe('0x35')](_0x146798,_0xa0fe('0x2d'));_0x112615[_0xa0fe('0x36')]=_['keys'](_0x42c659['query']);_0x112615[_0xa0fe('0x37')]=_[_0xa0fe('0x38')](_0x112615[_0xa0fe('0x34')],_0x112615[_0xa0fe('0x36')]);_0xa3bc6e[_0xa0fe('0x39')]=_[_0xa0fe('0x38')](_0x112615[_0xa0fe('0x34')],qs[_0xa0fe('0x3a')](_0x42c659[_0xa0fe('0x36')]['fields']));_0xa3bc6e[_0xa0fe('0x39')]=_0xa3bc6e[_0xa0fe('0x39')][_0xa0fe('0x3b')]?_0xa3bc6e[_0xa0fe('0x39')]:_0x112615[_0xa0fe('0x34')];if(!_0x42c659[_0xa0fe('0x36')][_0xa0fe('0x3c')]('nolimit')){_0xa3bc6e[_0xa0fe('0x3d')]=qs[_0xa0fe('0x3d')](_0x42c659[_0xa0fe('0x36')][_0xa0fe('0x3d')]);_0xa3bc6e[_0xa0fe('0x1d')]=qs[_0xa0fe('0x1d')](_0x42c659[_0xa0fe('0x36')][_0xa0fe('0x1d')]);}_0xa3bc6e['order']=qs['sort'](_0x42c659['query'][_0xa0fe('0x3e')]);_0xa3bc6e[_0xa0fe('0x3f')]=qs[_0xa0fe('0x37')](_[_0xa0fe('0x40')](_0x42c659[_0xa0fe('0x36')],_0x112615[_0xa0fe('0x37')]),_0x146798);if(_0x42c659[_0xa0fe('0x36')][_0xa0fe('0x41')]){_0xa3bc6e[_0xa0fe('0x3f')]=_['merge'](_0xa3bc6e[_0xa0fe('0x3f')],{'$or':_['map'](_0x146798,function(_0xc5c74c){if(_0xc5c74c[_0xa0fe('0x32')]!==_0xa0fe('0x42')){var _0x1a601f={};_0x1a601f[_0xc5c74c[_0xa0fe('0x2d')]]={'$like':'%'+_0x42c659[_0xa0fe('0x36')][_0xa0fe('0x41')]+'%'};return _0x1a601f;}})});}_0xa3bc6e=_['merge']({},_0xa3bc6e,_0x42c659[_0xa0fe('0x43')]);var _0x5afe74={'where':_0xa3bc6e[_0xa0fe('0x3f')]};return db[_0xa0fe('0x30')][_0xa0fe('0x1f')](_0x5afe74)[_0xa0fe('0x26')](function(_0x18693){_0x5c7762['count']=_0x18693;if(_0x42c659[_0xa0fe('0x36')]['includeAll']){_0xa3bc6e[_0xa0fe('0x44')]=[{'all':!![]}];}return db[_0xa0fe('0x30')][_0xa0fe('0x45')](_0xa3bc6e);})[_0xa0fe('0x26')](function(_0x36a768){_0x5c7762[_0xa0fe('0x46')]=_0x36a768;return _0x5c7762;})[_0xa0fe('0x26')](respondWithFilteredResult(_0x3ef0ad,_0xa3bc6e))[_0xa0fe('0x47')](handleError(_0x3ef0ad,null));};exports[_0xa0fe('0x48')]=function(_0x204d5f,_0x17cc44){var _0x7ad738={'raw':!![],'where':{'id':_0x204d5f[_0xa0fe('0x49')]['id']}},_0x3cdf51={};_0x3cdf51['model']=_[_0xa0fe('0x4a')](db[_0xa0fe('0x30')][_0xa0fe('0x4b')]);_0x3cdf51[_0xa0fe('0x36')]=_[_0xa0fe('0x4a')](_0x204d5f[_0xa0fe('0x36')]);_0x3cdf51[_0xa0fe('0x37')]=_[_0xa0fe('0x38')](_0x3cdf51['model'],_0x3cdf51[_0xa0fe('0x36')]);_0x7ad738[_0xa0fe('0x39')]=_[_0xa0fe('0x38')](_0x3cdf51[_0xa0fe('0x34')],qs[_0xa0fe('0x3a')](_0x204d5f[_0xa0fe('0x36')][_0xa0fe('0x3a')]));_0x7ad738[_0xa0fe('0x39')]=_0x7ad738[_0xa0fe('0x39')]['length']?_0x7ad738[_0xa0fe('0x39')]:_0x3cdf51[_0xa0fe('0x34')];if(_0x204d5f[_0xa0fe('0x36')][_0xa0fe('0x4c')]){_0x7ad738[_0xa0fe('0x44')]=[{'all':!![]}];}_0x7ad738=_['merge']({},_0x7ad738,_0x204d5f[_0xa0fe('0x43')]);return db[_0xa0fe('0x30')][_0xa0fe('0x4d')](_0x7ad738)[_0xa0fe('0x26')](handleEntityNotFound(_0x17cc44,null))['then'](respondWithResult(_0x17cc44,null))[_0xa0fe('0x47')](handleError(_0x17cc44,null));};exports[_0xa0fe('0x4e')]=function(_0x5d24c9,_0x5020f1){return db[_0xa0fe('0x30')][_0xa0fe('0x4e')](_0x5d24c9['body'],{})[_0xa0fe('0x26')](function(_0x3e14cd){var _0x31bf28=_0x5d24c9[_0xa0fe('0x4f')][_0xa0fe('0x28')]({'plain':!![]});if(!_0x31bf28)throw new Error(_0xa0fe('0x50'));if(_0x31bf28[_0xa0fe('0x51')]===_0xa0fe('0x4f')){var _0xdf7c60=_0x3e14cd[_0xa0fe('0x28')]({'plain':!![]});var _0x5d85d3=_0xa0fe('0x29');return db[_0xa0fe('0x52')][_0xa0fe('0x4d')]({'where':{'name':_0x5d85d3,'userProfileId':_0x31bf28[_0xa0fe('0x53')]},'raw':!![]})[_0xa0fe('0x26')](function(_0x22a28e){if(_0x22a28e&&_0x22a28e[_0xa0fe('0x54')]===0x0){return db[_0xa0fe('0x55')][_0xa0fe('0x4e')]({'name':_0xdf7c60[_0xa0fe('0x2d')],'resourceId':_0xdf7c60['id'],'type':_0x22a28e['name'],'sectionId':_0x22a28e['id']},{})[_0xa0fe('0x26')](function(){return _0x3e14cd;});}else{return _0x3e14cd;}})[_0xa0fe('0x47')](function(_0xe38f53){logger[_0xa0fe('0x2b')](_0xa0fe('0x56'),_0xe38f53);throw _0xe38f53;});}return _0x3e14cd;})[_0xa0fe('0x26')](respondWithResult(_0x5020f1,0xc9))[_0xa0fe('0x47')](handleError(_0x5020f1,null));};exports['update']=function(_0x3c6fd2,_0x16b602){if(_0x3c6fd2[_0xa0fe('0x57')]['id']){delete _0x3c6fd2[_0xa0fe('0x57')]['id'];}return db[_0xa0fe('0x30')]['find']({'where':{'id':_0x3c6fd2[_0xa0fe('0x49')]['id']}})[_0xa0fe('0x26')](handleEntityNotFound(_0x16b602,null))[_0xa0fe('0x26')](saveUpdates(_0x3c6fd2['body'],null))['then'](respondWithResult(_0x16b602,null))[_0xa0fe('0x47')](handleError(_0x16b602,null));};exports[_0xa0fe('0x27')]=function(_0x5b7955,_0x5b07e4){return db['Template'][_0xa0fe('0x4d')]({'where':{'id':_0x5b7955[_0xa0fe('0x49')]['id']}})[_0xa0fe('0x26')](handleEntityNotFound(_0x5b07e4,null))[_0xa0fe('0x26')](removeEntity(_0x5b07e4,null))['catch'](handleError(_0x5b07e4,null));}; \ No newline at end of file +var _0xda4a=['get','Templates','UserProfileResource','then','end','error','stack','name','Template','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','params','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','body','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy'];(function(_0x32bd11,_0x684ee3){var _0x319ad7=function(_0x1e0843){while(--_0x1e0843){_0x32bd11['push'](_0x32bd11['shift']());}};_0x319ad7(++_0x684ee3);}(_0xda4a,0x1eb));var _0xada4=function(_0x11c40b,_0x14fd54){_0x11c40b=_0x11c40b-0x0;var _0x4bee1b=_0xda4a[_0x11c40b];return _0x4bee1b;};'use strict';var emlformat=require(_0xada4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xada4('0x1'));var rp=require(_0xada4('0x2'));var moment=require(_0xada4('0x3'));var BPromise=require(_0xada4('0x4'));var Mustache=require('mustache');var util=require(_0xada4('0x5'));var path=require(_0xada4('0x6'));var sox=require(_0xada4('0x7'));var csv=require('to-csv');var ejs=require(_0xada4('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xada4('0x9'));var squel=require(_0xada4('0xa'));var crypto=require('crypto');var jsforce=require(_0xada4('0xb'));var deskjs=require(_0xada4('0xc'));var toCsv=require(_0xada4('0xd'));var querystring=require(_0xada4('0xe'));var Papa=require('papaparse');var Redis=require(_0xada4('0xf'));var authService=require(_0xada4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xada4('0x11'));var hardwareService=require(_0xada4('0x12'));var logger=require('../../config/logger')(_0xada4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xada4('0x14'));var db=require(_0xada4('0x15'))['db'];function respondWithStatusCode(_0x500e89,_0x11d197){_0x11d197=_0x11d197||0xcc;return function(_0x2c4c5c){if(_0x2c4c5c){return _0x500e89[_0xada4('0x16')](_0x11d197);}return _0x500e89['status'](_0x11d197)['end']();};}function respondWithResult(_0x53edd1,_0x9c279b){_0x9c279b=_0x9c279b||0xc8;return function(_0x402996){if(_0x402996){return _0x53edd1[_0xada4('0x17')](_0x9c279b)[_0xada4('0x18')](_0x402996);}};}function respondWithFilteredResult(_0x619114,_0x1978f4){return function(_0x291ee1){if(_0x291ee1){var _0x478f39=typeof _0x1978f4[_0xada4('0x19')]===_0xada4('0x1a')&&typeof _0x1978f4[_0xada4('0x1b')]==='undefined';var _0x322918=_0x291ee1[_0xada4('0x1c')];var _0x3ce22e=_0x478f39?0x0:_0x1978f4[_0xada4('0x19')];var _0x5f53da=_0x478f39?_0x291ee1[_0xada4('0x1c')]:_0x1978f4[_0xada4('0x19')]+_0x1978f4[_0xada4('0x1b')];var _0x4d1ae6;if(_0x5f53da>=_0x322918){_0x5f53da=_0x322918;_0x4d1ae6=0xc8;}else{_0x4d1ae6=0xce;}_0x619114[_0xada4('0x17')](_0x4d1ae6);return _0x619114['set'](_0xada4('0x1d'),_0x3ce22e+'-'+_0x5f53da+'/'+_0x322918)[_0xada4('0x18')](_0x291ee1);}return null;};}function patchUpdates(_0x27838b){return function(_0x3e81f8){try{jsonpatch[_0xada4('0x1e')](_0x3e81f8,_0x27838b,!![]);}catch(_0x379917){return BPromise[_0xada4('0x1f')](_0x379917);}return _0x3e81f8['save']();};}function saveUpdates(_0x206dcf,_0x4b3be6){return function(_0x411b33){if(_0x411b33){return _0x411b33[_0xada4('0x20')](_0x206dcf)['then'](function(_0x1d15cf){return _0x1d15cf;});}return null;};}function removeEntity(_0x19849b,_0x55665c){return function(_0x3b696){if(_0x3b696){return _0x3b696[_0xada4('0x21')]()['then'](function(){var _0x71a27b=_0x3b696[_0xada4('0x22')]({'plain':!![]});var _0x582a9a=_0xada4('0x23');return db[_0xada4('0x24')][_0xada4('0x21')]({'where':{'type':_0x582a9a,'resourceId':_0x71a27b['id']}})[_0xada4('0x25')](function(){return _0x3b696;});})['then'](function(){_0x19849b[_0xada4('0x17')](0xcc)[_0xada4('0x26')]();});}};}function handleEntityNotFound(_0x106ce3,_0x14ae4e){return function(_0x2e91dc){if(!_0x2e91dc){_0x106ce3[_0xada4('0x16')](0x194);}return _0x2e91dc;};}function handleError(_0x58e442,_0x5bfd2f){_0x5bfd2f=_0x5bfd2f||0x1f4;return function(_0x24e1ac){logger[_0xada4('0x27')](_0x24e1ac[_0xada4('0x28')]);if(_0x24e1ac[_0xada4('0x29')]){delete _0x24e1ac[_0xada4('0x29')];}_0x58e442[_0xada4('0x17')](_0x5bfd2f)['send'](_0x24e1ac);};}exports['index']=function(_0x33f6e1,_0x293e9e){var _0x57a97f={},_0x541f65={},_0x3dc263={'count':0x0,'rows':[]};var _0x467d69=_['map'](db[_0xada4('0x2a')]['rawAttributes'],function(_0x34f99f){return{'name':_0x34f99f[_0xada4('0x2b')],'type':_0x34f99f['type'][_0xada4('0x2c')]};});_0x541f65[_0xada4('0x2d')]=_[_0xada4('0x2e')](_0x467d69,'name');_0x541f65[_0xada4('0x2f')]=_[_0xada4('0x30')](_0x33f6e1[_0xada4('0x2f')]);_0x541f65[_0xada4('0x31')]=_[_0xada4('0x32')](_0x541f65[_0xada4('0x2d')],_0x541f65['query']);_0x57a97f['attributes']=_[_0xada4('0x32')](_0x541f65['model'],qs[_0xada4('0x33')](_0x33f6e1[_0xada4('0x2f')][_0xada4('0x33')]));_0x57a97f[_0xada4('0x34')]=_0x57a97f[_0xada4('0x34')][_0xada4('0x35')]?_0x57a97f[_0xada4('0x34')]:_0x541f65['model'];if(!_0x33f6e1[_0xada4('0x2f')]['hasOwnProperty'](_0xada4('0x36'))){_0x57a97f[_0xada4('0x1b')]=qs[_0xada4('0x1b')](_0x33f6e1[_0xada4('0x2f')][_0xada4('0x1b')]);_0x57a97f[_0xada4('0x19')]=qs[_0xada4('0x19')](_0x33f6e1[_0xada4('0x2f')][_0xada4('0x19')]);}_0x57a97f['order']=qs[_0xada4('0x37')](_0x33f6e1[_0xada4('0x2f')][_0xada4('0x37')]);_0x57a97f[_0xada4('0x38')]=qs['filters'](_[_0xada4('0x39')](_0x33f6e1[_0xada4('0x2f')],_0x541f65['filters']),_0x467d69);if(_0x33f6e1[_0xada4('0x2f')][_0xada4('0x3a')]){_0x57a97f[_0xada4('0x38')]=_[_0xada4('0x3b')](_0x57a97f['where'],{'$or':_[_0xada4('0x2e')](_0x467d69,function(_0x319997){if(_0x319997[_0xada4('0x3c')]!==_0xada4('0x3d')){var _0x49897f={};_0x49897f[_0x319997['name']]={'$like':'%'+_0x33f6e1[_0xada4('0x2f')][_0xada4('0x3a')]+'%'};return _0x49897f;}})});}_0x57a97f=_[_0xada4('0x3b')]({},_0x57a97f,_0x33f6e1[_0xada4('0x3e')]);var _0x52ac70={'where':_0x57a97f[_0xada4('0x38')]};return db['Template'][_0xada4('0x1c')](_0x52ac70)[_0xada4('0x25')](function(_0x1c0762){_0x3dc263[_0xada4('0x1c')]=_0x1c0762;if(_0x33f6e1[_0xada4('0x2f')][_0xada4('0x3f')]){_0x57a97f['include']=[{'all':!![]}];}return db['Template'][_0xada4('0x40')](_0x57a97f);})['then'](function(_0x42d818){_0x3dc263['rows']=_0x42d818;return _0x3dc263;})[_0xada4('0x25')](respondWithFilteredResult(_0x293e9e,_0x57a97f))['catch'](handleError(_0x293e9e,null));};exports['show']=function(_0xfb2dad,_0x368329){var _0xa53b09={'raw':!![],'where':{'id':_0xfb2dad[_0xada4('0x41')]['id']}},_0x370b20={};_0x370b20[_0xada4('0x2d')]=_[_0xada4('0x30')](db[_0xada4('0x2a')]['rawAttributes']);_0x370b20[_0xada4('0x2f')]=_['keys'](_0xfb2dad[_0xada4('0x2f')]);_0x370b20[_0xada4('0x31')]=_['intersection'](_0x370b20[_0xada4('0x2d')],_0x370b20[_0xada4('0x2f')]);_0xa53b09[_0xada4('0x34')]=_[_0xada4('0x32')](_0x370b20[_0xada4('0x2d')],qs['fields'](_0xfb2dad[_0xada4('0x2f')][_0xada4('0x33')]));_0xa53b09[_0xada4('0x34')]=_0xa53b09[_0xada4('0x34')][_0xada4('0x35')]?_0xa53b09['attributes']:_0x370b20['model'];if(_0xfb2dad[_0xada4('0x2f')]['includeAll']){_0xa53b09[_0xada4('0x42')]=[{'all':!![]}];}_0xa53b09=_[_0xada4('0x3b')]({},_0xa53b09,_0xfb2dad[_0xada4('0x3e')]);return db[_0xada4('0x2a')][_0xada4('0x43')](_0xa53b09)[_0xada4('0x25')](handleEntityNotFound(_0x368329,null))[_0xada4('0x25')](respondWithResult(_0x368329,null))[_0xada4('0x44')](handleError(_0x368329,null));};exports[_0xada4('0x45')]=function(_0x130483,_0x574809){return db[_0xada4('0x2a')][_0xada4('0x45')](_0x130483['body'],{})['then'](function(_0x458f0d){var _0x148033=_0x130483[_0xada4('0x46')][_0xada4('0x22')]({'plain':!![]});if(!_0x148033)throw new Error(_0xada4('0x47'));if(_0x148033[_0xada4('0x48')]==='user'){var _0x2002c8=_0x458f0d[_0xada4('0x22')]({'plain':!![]});var _0x3f6928=_0xada4('0x23');return db['UserProfileSection'][_0xada4('0x43')]({'where':{'name':_0x3f6928,'userProfileId':_0x148033['userProfileId']},'raw':!![]})[_0xada4('0x25')](function(_0x3247fc){if(_0x3247fc&&_0x3247fc[_0xada4('0x49')]===0x0){return db[_0xada4('0x24')][_0xada4('0x45')]({'name':_0x2002c8[_0xada4('0x29')],'resourceId':_0x2002c8['id'],'type':_0x3247fc[_0xada4('0x29')],'sectionId':_0x3247fc['id']},{})['then'](function(){return _0x458f0d;});}else{return _0x458f0d;}})[_0xada4('0x44')](function(_0x2f6833){logger[_0xada4('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2f6833);throw _0x2f6833;});}return _0x458f0d;})[_0xada4('0x25')](respondWithResult(_0x574809,0xc9))['catch'](handleError(_0x574809,null));};exports[_0xada4('0x20')]=function(_0x2041cc,_0x19ae6a){if(_0x2041cc[_0xada4('0x4a')]['id']){delete _0x2041cc[_0xada4('0x4a')]['id'];}return db[_0xada4('0x2a')][_0xada4('0x43')]({'where':{'id':_0x2041cc['params']['id']}})[_0xada4('0x25')](handleEntityNotFound(_0x19ae6a,null))[_0xada4('0x25')](saveUpdates(_0x2041cc[_0xada4('0x4a')],null))[_0xada4('0x25')](respondWithResult(_0x19ae6a,null))[_0xada4('0x44')](handleError(_0x19ae6a,null));};exports['destroy']=function(_0x3b5884,_0x4a15bb){return db[_0xada4('0x2a')][_0xada4('0x43')]({'where':{'id':_0x3b5884[_0xada4('0x41')]['id']}})[_0xada4('0x25')](handleEntityNotFound(_0x4a15bb,null))[_0xada4('0x25')](removeEntity(_0x4a15bb,null))[_0xada4('0x44')](handleError(_0x4a15bb,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index ad7f592..b4ecfdb 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 _0xbcba=['path','rimraf','../../config/environment','./template.attributes','exports','Template','tools_templates','lodash','moment','bluebird','request-promise'];(function(_0x3eb630,_0x552586){var _0x1b840d=function(_0x2594a8){while(--_0x2594a8){_0x3eb630['push'](_0x3eb630['shift']());}};_0x1b840d(++_0x552586);}(_0xbcba,0x19e));var _0xabcb=function(_0x3e5d54,_0x4db75c){_0x3e5d54=_0x3e5d54-0x0;var _0xed47ac=_0xbcba[_0x3e5d54];return _0xed47ac;};'use strict';var _=require(_0xabcb('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xabcb('0x1'));var BPromise=require(_0xabcb('0x2'));var rp=require(_0xabcb('0x3'));var fs=require('fs');var path=require(_0xabcb('0x4'));var rimraf=require(_0xabcb('0x5'));var config=require(_0xabcb('0x6'));var attributes=require(_0xabcb('0x7'));module[_0xabcb('0x8')]=function(_0x29b0d6,_0x2fc075){return _0x29b0d6['define'](_0xabcb('0x9'),attributes,{'tableName':_0xabcb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x902f=['tools_templates','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./template.attributes','exports','define','Template'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x902f,0x197));var _0xf902=function(_0x8f79e4,_0x30c5d6){_0x8f79e4=_0x8f79e4-0x0;var _0x59ecb0=_0x902f[_0x8f79e4];return _0x59ecb0;};'use strict';var _=require(_0xf902('0x0'));var util=require(_0xf902('0x1'));var logger=require(_0xf902('0x2'))(_0xf902('0x3'));var moment=require(_0xf902('0x4'));var BPromise=require(_0xf902('0x5'));var rp=require(_0xf902('0x6'));var fs=require('fs');var path=require(_0xf902('0x7'));var rimraf=require(_0xf902('0x8'));var config=require('../../config/environment');var attributes=require(_0xf902('0x9'));module[_0xf902('0xa')]=function(_0x1e5c59,_0x4f7914){return _0x1e5c59[_0xf902('0xb')](_0xf902('0xc'),attributes,{'tableName':_0xf902('0xd'),'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 36ba1b4..ae7ffbe 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 _0x9299=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','Template,\x20%s,\x20%s','message','result','catch','GetTemplate','options','attributes','include','map','model','lodash','bluebird','randomstring'];(function(_0x5760ce,_0x36e4a3){var _0xd87900=function(_0x33b3bb){while(--_0x33b3bb){_0x5760ce['push'](_0x5760ce['shift']());}};_0xd87900(++_0x36e4a3);}(_0x9299,0x1dd));var _0x9929=function(_0x111c81,_0x43ef17){_0x111c81=_0x111c81-0x0;var _0x547792=_0x9299[_0x111c81];return _0x547792;};'use strict';var _=require(_0x9929('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9929('0x1'));var rs=require(_0x9929('0x2'));var fs=require('fs');var Redis=require(_0x9929('0x3'));var db=require(_0x9929('0x4'))['db'];var utils=require(_0x9929('0x5'));var logger=require(_0x9929('0x6'))(_0x9929('0x7'));var config=require(_0x9929('0x8'));var jayson=require(_0x9929('0x9'));var client=jayson[_0x9929('0xa')][_0x9929('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12b4e2,_0x130e40,_0x31a930){return new BPromise(function(_0x55e70e,_0x1261ee){return client[_0x9929('0xc')](_0x12b4e2,_0x31a930)[_0x9929('0xd')](function(_0x216625){logger[_0x9929('0xe')]('Template,\x20%s,\x20%s',_0x130e40,_0x9929('0xf'));logger[_0x9929('0x10')]('Template,\x20%s,\x20%s,\x20%s',_0x130e40,_0x9929('0xf'),JSON[_0x9929('0x11')](_0x216625));if(_0x216625[_0x9929('0x12')]){if(_0x216625[_0x9929('0x12')][_0x9929('0x13')]===0x1f4){logger[_0x9929('0x12')](_0x9929('0x14'),_0x130e40,_0x216625[_0x9929('0x12')][_0x9929('0x15')]);return _0x1261ee(_0x216625[_0x9929('0x12')][_0x9929('0x15')]);}logger[_0x9929('0x12')](_0x9929('0x14'),_0x130e40,_0x216625['error']['message']);return _0x55e70e(_0x216625[_0x9929('0x12')][_0x9929('0x15')]);}else{logger[_0x9929('0xe')](_0x9929('0x14'),_0x130e40,_0x9929('0xf'));_0x55e70e(_0x216625[_0x9929('0x16')][_0x9929('0x15')]);}})[_0x9929('0x17')](function(_0x584838){logger[_0x9929('0x12')](_0x9929('0x14'),_0x130e40,_0x584838);_0x1261ee(_0x584838);});});}exports[_0x9929('0x18')]=function(_0x114998){var _0xc973ca=this;return new Promise(function(_0x2c34c3,_0x45d992){return db['Template']['findAll']({'raw':_0x114998[_0x9929('0x19')]?_0x114998[_0x9929('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x114998[_0x9929('0x19')]?_0x114998[_0x9929('0x19')]['where']||null:null,'attributes':_0x114998[_0x9929('0x19')]?_0x114998[_0x9929('0x19')][_0x9929('0x1a')]||null:null,'limit':_0x114998[_0x9929('0x19')]?_0x114998[_0x9929('0x19')]['limit']||null:null,'include':_0x114998[_0x9929('0x19')]?_0x114998[_0x9929('0x19')][_0x9929('0x1b')]?_[_0x9929('0x1c')](_0x114998[_0x9929('0x19')][_0x9929('0x1b')],function(_0x111ecd){return{'model':db[_0x111ecd[_0x9929('0x1d')]],'as':_0x111ecd['as'],'attributes':_0x111ecd[_0x9929('0x1a')],'include':_0x111ecd[_0x9929('0x1b')]?_['map'](_0x111ecd[_0x9929('0x1b')],function(_0x46f43f){return{'model':db[_0x46f43f['model']],'as':_0x46f43f['as'],'attributes':_0x46f43f[_0x9929('0x1a')],'include':_0x46f43f[_0x9929('0x1b')]?_[_0x9929('0x1c')](_0x46f43f['include'],function(_0xf4cb6b){return{'model':db[_0xf4cb6b[_0x9929('0x1d')]],'as':_0xf4cb6b['as'],'attributes':_0xf4cb6b[_0x9929('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9929('0xd')](function(_0xc37f56){logger[_0x9929('0xe')](_0x9929('0x18'),_0x114998);logger['debug']('GetTemplate',_0x114998,JSON[_0x9929('0x11')](_0xc37f56));_0x2c34c3(_0xc37f56);})[_0x9929('0x17')](function(_0x683bbb){logger[_0x9929('0x12')](_0x9929('0x18'),_0x683bbb['message'],_0x114998);_0x45d992(_0xc973ca[_0x9929('0x12')](0x1f4,_0x683bbb[_0x9929('0x15')]));});});}; \ No newline at end of file +var _0x5d87=['Template,\x20%s,\x20%s','message','result','catch','GetTemplate','findAll','options','raw','where','attributes','limit','include','model','map','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code'];(function(_0x55d6be,_0x5719b3){var _0x23e4ee=function(_0x59bb82){while(--_0x59bb82){_0x55d6be['push'](_0x55d6be['shift']());}};_0x23e4ee(++_0x5719b3);}(_0x5d87,0x12e));var _0x75d8=function(_0x4d0555,_0x5ef323){_0x4d0555=_0x4d0555-0x0;var _0x5da0e1=_0x5d87[_0x4d0555];return _0x5da0e1;};'use strict';var _=require(_0x75d8('0x0'));var util=require(_0x75d8('0x1'));var moment=require(_0x75d8('0x2'));var BPromise=require(_0x75d8('0x3'));var rs=require(_0x75d8('0x4'));var fs=require('fs');var Redis=require(_0x75d8('0x5'));var db=require(_0x75d8('0x6'))['db'];var utils=require(_0x75d8('0x7'));var logger=require(_0x75d8('0x8'))(_0x75d8('0x9'));var config=require(_0x75d8('0xa'));var jayson=require(_0x75d8('0xb'));var client=jayson[_0x75d8('0xc')][_0x75d8('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x550842,_0x2a597e,_0x4bac5d){return new BPromise(function(_0x46e053,_0x3af8c9){return client[_0x75d8('0xe')](_0x550842,_0x4bac5d)[_0x75d8('0xf')](function(_0x3d2777){logger[_0x75d8('0x10')]('Template,\x20%s,\x20%s',_0x2a597e,'request\x20sent');logger[_0x75d8('0x11')]('Template,\x20%s,\x20%s,\x20%s',_0x2a597e,_0x75d8('0x12'),JSON[_0x75d8('0x13')](_0x3d2777));if(_0x3d2777[_0x75d8('0x14')]){if(_0x3d2777[_0x75d8('0x14')][_0x75d8('0x15')]===0x1f4){logger[_0x75d8('0x14')](_0x75d8('0x16'),_0x2a597e,_0x3d2777[_0x75d8('0x14')]['message']);return _0x3af8c9(_0x3d2777[_0x75d8('0x14')][_0x75d8('0x17')]);}logger[_0x75d8('0x14')](_0x75d8('0x16'),_0x2a597e,_0x3d2777['error'][_0x75d8('0x17')]);return _0x46e053(_0x3d2777[_0x75d8('0x14')][_0x75d8('0x17')]);}else{logger[_0x75d8('0x10')](_0x75d8('0x16'),_0x2a597e,_0x75d8('0x12'));_0x46e053(_0x3d2777[_0x75d8('0x18')][_0x75d8('0x17')]);}})[_0x75d8('0x19')](function(_0x55e00e){logger[_0x75d8('0x14')]('Template,\x20%s,\x20%s',_0x2a597e,_0x55e00e);_0x3af8c9(_0x55e00e);});});}exports[_0x75d8('0x1a')]=function(_0x2aea99){var _0x45dd4a=this;return new Promise(function(_0x2597d3,_0x2234da){return db['Template'][_0x75d8('0x1b')]({'raw':_0x2aea99[_0x75d8('0x1c')]?_0x2aea99['options'][_0x75d8('0x1d')]===undefined?!![]:![]:!![],'where':_0x2aea99[_0x75d8('0x1c')]?_0x2aea99['options'][_0x75d8('0x1e')]||null:null,'attributes':_0x2aea99[_0x75d8('0x1c')]?_0x2aea99[_0x75d8('0x1c')][_0x75d8('0x1f')]||null:null,'limit':_0x2aea99[_0x75d8('0x1c')]?_0x2aea99[_0x75d8('0x1c')][_0x75d8('0x20')]||null:null,'include':_0x2aea99[_0x75d8('0x1c')]?_0x2aea99[_0x75d8('0x1c')][_0x75d8('0x21')]?_['map'](_0x2aea99[_0x75d8('0x1c')]['include'],function(_0x4e6361){return{'model':db[_0x4e6361[_0x75d8('0x22')]],'as':_0x4e6361['as'],'attributes':_0x4e6361[_0x75d8('0x1f')],'include':_0x4e6361[_0x75d8('0x21')]?_['map'](_0x4e6361['include'],function(_0x315449){return{'model':db[_0x315449[_0x75d8('0x22')]],'as':_0x315449['as'],'attributes':_0x315449[_0x75d8('0x1f')],'include':_0x315449[_0x75d8('0x21')]?_[_0x75d8('0x23')](_0x315449[_0x75d8('0x21')],function(_0x179613){return{'model':db[_0x179613[_0x75d8('0x22')]],'as':_0x179613['as'],'attributes':_0x179613['attributes']};}):[]};}):[]};}):[]:[]})[_0x75d8('0xf')](function(_0x2f4239){logger[_0x75d8('0x10')](_0x75d8('0x1a'),_0x2aea99);logger[_0x75d8('0x11')](_0x75d8('0x1a'),_0x2aea99,JSON[_0x75d8('0x13')](_0x2f4239));_0x2597d3(_0x2f4239);})[_0x75d8('0x19')](function(_0x232acb){logger[_0x75d8('0x14')](_0x75d8('0x1a'),_0x232acb[_0x75d8('0x17')],_0x2aea99);_0x2234da(_0x45dd4a[_0x75d8('0x14')](0x1f4,_0x232acb[_0x75d8('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 49c04c5..7f73056 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 _0xa5bf=['express','Router','../../components/auth/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','post','create','addAllCondition','addAnyCondition','addAction','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x5d208b,_0x2615e6){var _0x3d4ef7=function(_0x412e01){while(--_0x412e01){_0x5d208b['push'](_0x5d208b['shift']());}};_0x3d4ef7(++_0x2615e6);}(_0xa5bf,0x101));var _0xfa5b=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xa5bf[_0x2dea24];return _0x309d58;};'use strict';var multer=require(_0xfa5b('0x0'));var util=require('util');var path=require(_0xfa5b('0x1'));var timeout=require(_0xfa5b('0x2'));var express=require(_0xfa5b('0x3'));var router=express[_0xfa5b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xfa5b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xfa5b('0x6'));var controller=require(_0xfa5b('0x7'));router[_0xfa5b('0x8')]('/',auth[_0xfa5b('0x9')](),controller[_0xfa5b('0xa')]);router['get']('/:id',auth[_0xfa5b('0x9')](),controller['show']);router[_0xfa5b('0x8')](_0xfa5b('0xb'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0xfa5b('0x8')](_0xfa5b('0xc'),auth['isAuthenticated'](),controller[_0xfa5b('0xd')]);router['get'](_0xfa5b('0xe'),auth['isAuthenticated'](),controller['getActions']);router[_0xfa5b('0xf')]('/',auth['isAuthenticated'](),controller[_0xfa5b('0x10')]);router['post'](_0xfa5b('0xb'),auth[_0xfa5b('0x9')](),controller[_0xfa5b('0x11')]);router[_0xfa5b('0xf')]('/:id/any_conditions',auth[_0xfa5b('0x9')](),controller[_0xfa5b('0x12')]);router['post'](_0xfa5b('0xe'),auth[_0xfa5b('0x9')](),controller[_0xfa5b('0x13')]);router[_0xfa5b('0x14')](_0xfa5b('0x15'),auth[_0xfa5b('0x9')](),controller[_0xfa5b('0x16')]);router[_0xfa5b('0x17')](_0xfa5b('0x15'),auth[_0xfa5b('0x9')](),controller[_0xfa5b('0x18')]);module[_0xfa5b('0x19')]=router; \ No newline at end of file +var _0xa49b=['../../components/auth/service','../../components/interaction/service','./trigger.controller','get','isAuthenticated','show','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','post','/:id/all_conditions','addAnyCondition','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra'];(function(_0xbe0d54,_0x5c3362){var _0x13e619=function(_0xfa3e7f){while(--_0xfa3e7f){_0xbe0d54['push'](_0xbe0d54['shift']());}};_0x13e619(++_0x5c3362);}(_0xa49b,0x126));var _0xba49=function(_0x44bb08,_0xe5930b){_0x44bb08=_0x44bb08-0x0;var _0x55268b=_0xa49b[_0x44bb08];return _0x55268b;};'use strict';var multer=require('multer');var util=require(_0xba49('0x0'));var path=require(_0xba49('0x1'));var timeout=require(_0xba49('0x2'));var express=require(_0xba49('0x3'));var router=express['Router']();var fs_extra=require(_0xba49('0x4'));var auth=require(_0xba49('0x5'));var interaction=require(_0xba49('0x6'));var config=require('../../config/environment');var controller=require(_0xba49('0x7'));router[_0xba49('0x8')]('/',auth[_0xba49('0x9')](),controller['index']);router[_0xba49('0x8')]('/:id',auth[_0xba49('0x9')](),controller[_0xba49('0xa')]);router[_0xba49('0x8')]('/:id/all_conditions',auth[_0xba49('0x9')](),controller[_0xba49('0xb')]);router[_0xba49('0x8')](_0xba49('0xc'),auth['isAuthenticated'](),controller[_0xba49('0xd')]);router[_0xba49('0x8')](_0xba49('0xe'),auth['isAuthenticated'](),controller['getActions']);router[_0xba49('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xba49('0x10'),auth['isAuthenticated'](),controller['addAllCondition']);router[_0xba49('0xf')](_0xba49('0xc'),auth[_0xba49('0x9')](),controller[_0xba49('0x11')]);router['post'](_0xba49('0xe'),auth[_0xba49('0x9')](),controller['addAction']);router['put'](_0xba49('0x12'),auth[_0xba49('0x9')](),controller[_0xba49('0x13')]);router[_0xba49('0x14')]('/:id',auth[_0xba49('0x9')](),controller[_0xba49('0x15')]);module[_0xba49('0x16')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 359aa52..66b902a 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 _0xc7b2=['STRING','BOOLEAN','exports'];(function(_0x5a9a42,_0x559062){var _0x1eade8=function(_0x5caffc){while(--_0x5caffc){_0x5a9a42['push'](_0x5a9a42['shift']());}};_0x1eade8(++_0x559062);}(_0xc7b2,0x68));var _0x2c7b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7b2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x2c7b('0x0')]={'name':{'type':Sequelize[_0x2c7b('0x1')]},'channel':{'type':Sequelize[_0x2c7b('0x1')]},'description':{'type':Sequelize[_0x2c7b('0x1')]},'status':{'type':Sequelize[_0x2c7b('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xc331=['exports','STRING','BOOLEAN','sequelize'];(function(_0x2df5d3,_0x4336a7){var _0x4a6050=function(_0x33d952){while(--_0x33d952){_0x2df5d3['push'](_0x2df5d3['shift']());}};_0x4a6050(++_0x4336a7);}(_0xc331,0x18b));var _0x1c33=function(_0x29aebc,_0x54bb9e){_0x29aebc=_0x29aebc-0x0;var _0x1528d6=_0xc331[_0x29aebc];return _0x1528d6;};'use strict';var Sequelize=require(_0x1c33('0x0'));module[_0x1c33('0x1')]={'name':{'type':Sequelize[_0x1c33('0x2')]},'channel':{'type':Sequelize[_0x1c33('0x2')]},'description':{'type':Sequelize[_0x1c33('0x2')]},'status':{'type':Sequelize[_0x1c33('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index c10eb54..037a0af 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 _0x65f6=['Content-Range','apply','reject','save','update','then','Triggers','UserProfileResource','destroy','error','stack','name','index','Trigger','rawAttributes','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','map','filter','options','include','findAll','rows','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','find','userProfileId','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addAllCondition','params','TriggerAllId','Condition','getAllConditions','pick','findOne','getAnyConditions','addAction','TriggerId','getActions','Action','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x3104e0,_0x3661c8){var _0x3715fa=function(_0x554d96){while(--_0x554d96){_0x3104e0['push'](_0x3104e0['shift']());}};_0x3715fa(++_0x3661c8);}(_0x65f6,0xf3));var _0x665f=function(_0x191918,_0x3f8a57){_0x191918=_0x191918-0x0;var _0x37ba44=_0x65f6[_0x191918];return _0x37ba44;};'use strict';var emlformat=require(_0x665f('0x0'));var rimraf=require(_0x665f('0x1'));var zipdir=require(_0x665f('0x2'));var jsonpatch=require(_0x665f('0x3'));var rp=require(_0x665f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x665f('0x5'));var util=require('util');var path=require('path');var sox=require(_0x665f('0x6'));var csv=require(_0x665f('0x7'));var ejs=require(_0x665f('0x8'));var fs=require('fs');var fs_extra=require(_0x665f('0x9'));var _=require(_0x665f('0xa'));var squel=require(_0x665f('0xb'));var crypto=require(_0x665f('0xc'));var jsforce=require(_0x665f('0xd'));var deskjs=require(_0x665f('0xe'));var toCsv=require(_0x665f('0x7'));var querystring=require('querystring');var Papa=require(_0x665f('0xf'));var Redis=require('ioredis');var authService=require(_0x665f('0x10'));var qs=require(_0x665f('0x11'));var as=require(_0x665f('0x12'));var hardwareService=require(_0x665f('0x13'));var logger=require(_0x665f('0x14'))(_0x665f('0x15'));var utils=require(_0x665f('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x665f('0x17'))['db'];function respondWithStatusCode(_0x32e52d,_0x3c10c6){_0x3c10c6=_0x3c10c6||0xcc;return function(_0x31616c){if(_0x31616c){return _0x32e52d[_0x665f('0x18')](_0x3c10c6);}return _0x32e52d[_0x665f('0x19')](_0x3c10c6)[_0x665f('0x1a')]();};}function respondWithResult(_0x3cff25,_0x430851){_0x430851=_0x430851||0xc8;return function(_0x20b140){if(_0x20b140){return _0x3cff25[_0x665f('0x19')](_0x430851)[_0x665f('0x1b')](_0x20b140);}};}function respondWithFilteredResult(_0x2c3f50,_0x197e49){return function(_0x4dcb64){if(_0x4dcb64){var _0x3e3002=typeof _0x197e49[_0x665f('0x1c')]===_0x665f('0x1d')&&typeof _0x197e49[_0x665f('0x1e')]==='undefined';var _0x27c727=_0x4dcb64[_0x665f('0x1f')];var _0x1590e1=_0x3e3002?0x0:_0x197e49[_0x665f('0x1c')];var _0x57f5c1=_0x3e3002?_0x4dcb64['count']:_0x197e49[_0x665f('0x1c')]+_0x197e49[_0x665f('0x1e')];var _0x111c76;if(_0x57f5c1>=_0x27c727){_0x57f5c1=_0x27c727;_0x111c76=0xc8;}else{_0x111c76=0xce;}_0x2c3f50['status'](_0x111c76);return _0x2c3f50[_0x665f('0x20')](_0x665f('0x21'),_0x1590e1+'-'+_0x57f5c1+'/'+_0x27c727)[_0x665f('0x1b')](_0x4dcb64);}return null;};}function patchUpdates(_0x522b62){return function(_0x5796e5){try{jsonpatch[_0x665f('0x22')](_0x5796e5,_0x522b62,!![]);}catch(_0x52f399){return BPromise[_0x665f('0x23')](_0x52f399);}return _0x5796e5[_0x665f('0x24')]();};}function saveUpdates(_0x57e0af,_0x32e592){return function(_0x54b18f){if(_0x54b18f){return _0x54b18f[_0x665f('0x25')](_0x57e0af)[_0x665f('0x26')](function(_0x14ae3e){return _0x14ae3e;});}return null;};}function removeEntity(_0x49463c,_0x23f174){return function(_0x13e9f8){if(_0x13e9f8){return _0x13e9f8['destroy']()[_0x665f('0x26')](function(){var _0x1fd46e=_0x13e9f8['get']({'plain':!![]});var _0x5d3cbe=_0x665f('0x27');return db[_0x665f('0x28')][_0x665f('0x29')]({'where':{'type':_0x5d3cbe,'resourceId':_0x1fd46e['id']}})['then'](function(){return _0x13e9f8;});})[_0x665f('0x26')](function(){_0x49463c[_0x665f('0x19')](0xcc)[_0x665f('0x1a')]();});}};}function handleEntityNotFound(_0x162201,_0x390c41){return function(_0x4af77c){if(!_0x4af77c){_0x162201[_0x665f('0x18')](0x194);}return _0x4af77c;};}function handleError(_0x12be8d,_0x11251a){_0x11251a=_0x11251a||0x1f4;return function(_0xe6edd2){logger[_0x665f('0x2a')](_0xe6edd2[_0x665f('0x2b')]);if(_0xe6edd2[_0x665f('0x2c')]){delete _0xe6edd2['name'];}_0x12be8d[_0x665f('0x19')](_0x11251a)['send'](_0xe6edd2);};}exports[_0x665f('0x2d')]=function(_0x28761d,_0x2e8f12){var _0x439e9b={},_0x5ab00f={},_0x2a1067={'count':0x0,'rows':[]};var _0x2525c8=_['map'](db[_0x665f('0x2e')][_0x665f('0x2f')],function(_0x4939a4){return{'name':_0x4939a4['fieldName'],'type':_0x4939a4[_0x665f('0x30')][_0x665f('0x31')]};});_0x5ab00f['model']=_['map'](_0x2525c8,_0x665f('0x2c'));_0x5ab00f[_0x665f('0x32')]=_[_0x665f('0x33')](_0x28761d[_0x665f('0x32')]);_0x5ab00f['filters']=_['intersection'](_0x5ab00f[_0x665f('0x34')],_0x5ab00f[_0x665f('0x32')]);_0x439e9b[_0x665f('0x35')]=_[_0x665f('0x36')](_0x5ab00f[_0x665f('0x34')],qs[_0x665f('0x37')](_0x28761d[_0x665f('0x32')][_0x665f('0x37')]));_0x439e9b[_0x665f('0x35')]=_0x439e9b[_0x665f('0x35')][_0x665f('0x38')]?_0x439e9b[_0x665f('0x35')]:_0x5ab00f['model'];if(!_0x28761d[_0x665f('0x32')][_0x665f('0x39')](_0x665f('0x3a'))){_0x439e9b[_0x665f('0x1e')]=qs[_0x665f('0x1e')](_0x28761d[_0x665f('0x32')][_0x665f('0x1e')]);_0x439e9b['offset']=qs[_0x665f('0x1c')](_0x28761d[_0x665f('0x32')][_0x665f('0x1c')]);}_0x439e9b[_0x665f('0x3b')]=qs[_0x665f('0x3c')](_0x28761d[_0x665f('0x32')][_0x665f('0x3c')]);_0x439e9b[_0x665f('0x3d')]=qs[_0x665f('0x3e')](_['pick'](_0x28761d['query'],_0x5ab00f[_0x665f('0x3e')]),_0x2525c8);if(_0x28761d[_0x665f('0x32')]['filter']){_0x439e9b[_0x665f('0x3d')]=_[_0x665f('0x3f')](_0x439e9b[_0x665f('0x3d')],{'$or':_[_0x665f('0x40')](_0x2525c8,function(_0x5628c2){if(_0x5628c2['type']!=='VIRTUAL'){var _0x27f5aa={};_0x27f5aa[_0x5628c2['name']]={'$like':'%'+_0x28761d[_0x665f('0x32')][_0x665f('0x41')]+'%'};return _0x27f5aa;}})});}_0x439e9b=_[_0x665f('0x3f')]({},_0x439e9b,_0x28761d[_0x665f('0x42')]);var _0x297505={'where':_0x439e9b[_0x665f('0x3d')]};return db[_0x665f('0x2e')][_0x665f('0x1f')](_0x297505)[_0x665f('0x26')](function(_0x21b5b2){_0x2a1067[_0x665f('0x1f')]=_0x21b5b2;if(_0x28761d[_0x665f('0x32')]['includeAll']){_0x439e9b[_0x665f('0x43')]=[{'all':!![]}];}return db[_0x665f('0x2e')][_0x665f('0x44')](_0x439e9b);})[_0x665f('0x26')](function(_0x272206){_0x2a1067[_0x665f('0x45')]=_0x272206;return _0x2a1067;})['then'](respondWithFilteredResult(_0x2e8f12,_0x439e9b))['catch'](handleError(_0x2e8f12,null));};exports['show']=function(_0x5c3b81,_0x5f0aba){var _0xae5513={'raw':![],'where':{'id':_0x5c3b81['params']['id']}},_0x4eb519={};_0x4eb519[_0x665f('0x34')]=_[_0x665f('0x33')](db[_0x665f('0x2e')][_0x665f('0x2f')]);_0x4eb519[_0x665f('0x32')]=_['keys'](_0x5c3b81[_0x665f('0x32')]);_0x4eb519['filters']=_[_0x665f('0x36')](_0x4eb519['model'],_0x4eb519['query']);_0xae5513[_0x665f('0x35')]=_[_0x665f('0x36')](_0x4eb519[_0x665f('0x34')],qs[_0x665f('0x37')](_0x5c3b81['query'][_0x665f('0x37')]));_0xae5513['attributes']=_0xae5513[_0x665f('0x35')]['length']?_0xae5513[_0x665f('0x35')]:_0x4eb519['model'];if(_0x5c3b81[_0x665f('0x32')]['includeAll']){_0xae5513[_0x665f('0x43')]=[{'all':!![]}];}_0xae5513=_['merge']({},_0xae5513,_0x5c3b81['options']);return db[_0x665f('0x2e')]['find'](_0xae5513)['then'](handleEntityNotFound(_0x5f0aba,null))[_0x665f('0x26')](respondWithResult(_0x5f0aba,null))['catch'](handleError(_0x5f0aba,null));};exports['create']=function(_0x52255d,_0x15c8ec){return db[_0x665f('0x2e')]['create'](_0x52255d['body'],{})['then'](function(_0x171695){var _0x38a68a=_0x52255d[_0x665f('0x46')]['get']({'plain':!![]});if(!_0x38a68a)throw new Error(_0x665f('0x47'));if(_0x38a68a['role']===_0x665f('0x46')){var _0xbd947c=_0x171695[_0x665f('0x48')]({'plain':!![]});var _0x37e41f='Triggers';return db[_0x665f('0x49')][_0x665f('0x4a')]({'where':{'name':_0x37e41f,'userProfileId':_0x38a68a[_0x665f('0x4b')]},'raw':!![]})[_0x665f('0x26')](function(_0x3a0df6){if(_0x3a0df6&&_0x3a0df6['autoAssociation']===0x0){return db[_0x665f('0x28')][_0x665f('0x4c')]({'name':_0xbd947c[_0x665f('0x2c')],'resourceId':_0xbd947c['id'],'type':_0x3a0df6[_0x665f('0x2c')],'sectionId':_0x3a0df6['id']},{})[_0x665f('0x26')](function(){return _0x171695;});}else{return _0x171695;}})[_0x665f('0x4d')](function(_0x2cb5b0){logger[_0x665f('0x2a')](_0x665f('0x4e'),_0x2cb5b0);throw _0x2cb5b0;});}return _0x171695;})[_0x665f('0x26')](respondWithResult(_0x15c8ec,0xc9))[_0x665f('0x4d')](handleError(_0x15c8ec,null));};exports[_0x665f('0x25')]=function(_0x35f70c,_0x29d356){if(_0x35f70c['body']['id']){delete _0x35f70c[_0x665f('0x4f')]['id'];}return db[_0x665f('0x2e')][_0x665f('0x4a')]({'where':{'id':_0x35f70c['params']['id']}})[_0x665f('0x26')](handleEntityNotFound(_0x29d356,null))[_0x665f('0x26')](saveUpdates(_0x35f70c['body'],null))[_0x665f('0x26')](respondWithResult(_0x29d356,null))[_0x665f('0x4d')](handleError(_0x29d356,null));};exports[_0x665f('0x29')]=function(_0x397c8c,_0x1e882e){return db[_0x665f('0x2e')]['find']({'where':{'id':_0x397c8c['params']['id']}})[_0x665f('0x26')](handleEntityNotFound(_0x1e882e,null))['then'](removeEntity(_0x1e882e,null))['catch'](handleError(_0x1e882e,null));};exports[_0x665f('0x50')]=function(_0x61de03,_0x38d125,_0x51d22f){if(_0x61de03['body']['id']){delete _0x61de03[_0x665f('0x4f')]['id'];}return db['Trigger'][_0x665f('0x4a')]({'where':{'id':_0x61de03[_0x665f('0x51')]['id']}})[_0x665f('0x26')](handleEntityNotFound(_0x38d125,null))[_0x665f('0x26')](function(_0x288ba0){if(_0x288ba0){_0x61de03['body'][_0x665f('0x52')]=_0x288ba0['id'];return db[_0x665f('0x53')][_0x665f('0x4c')](_0x61de03[_0x665f('0x4f')]);}})[_0x665f('0x26')](respondWithResult(_0x38d125,null))[_0x665f('0x4d')](handleError(_0x38d125,null));};exports['addAnyCondition']=function(_0x31cb65,_0x2d3fb9,_0x16f960){if(_0x31cb65[_0x665f('0x4f')]['id']){delete _0x31cb65[_0x665f('0x4f')]['id'];}return db[_0x665f('0x2e')][_0x665f('0x4a')]({'where':{'id':_0x31cb65[_0x665f('0x51')]['id']}})[_0x665f('0x26')](handleEntityNotFound(_0x2d3fb9,null))[_0x665f('0x26')](function(_0x38fb93){if(_0x38fb93){_0x31cb65[_0x665f('0x4f')]['TriggerAnyId']=_0x38fb93['id'];return db[_0x665f('0x53')][_0x665f('0x4c')](_0x31cb65[_0x665f('0x4f')]);}})['then'](respondWithResult(_0x2d3fb9,null))[_0x665f('0x4d')](handleError(_0x2d3fb9,null));};exports[_0x665f('0x54')]=function(_0x2df1e7,_0x4d9ffa,_0x5d803b){var _0x317fe9={};var _0x3441f5={};var _0x3507c5;var _0xc6c0bf;return db['Trigger']['findOne']({'where':{'id':_0x2df1e7[_0x665f('0x51')]['id']}})[_0x665f('0x26')](handleEntityNotFound(_0x4d9ffa,null))[_0x665f('0x26')](function(_0x33a3dd){if(_0x33a3dd){_0x3507c5=_0x33a3dd;_0x3441f5['model']=_[_0x665f('0x33')](db[_0x665f('0x53')][_0x665f('0x2f')]);_0x3441f5[_0x665f('0x32')]=_[_0x665f('0x33')](_0x2df1e7[_0x665f('0x32')]);_0x3441f5['filters']=_['intersection'](_0x3441f5[_0x665f('0x34')],_0x3441f5[_0x665f('0x32')]);_0x317fe9['attributes']=_[_0x665f('0x36')](_0x3441f5[_0x665f('0x34')],qs['fields'](_0x2df1e7[_0x665f('0x32')][_0x665f('0x37')]));_0x317fe9[_0x665f('0x35')]=_0x317fe9['attributes'][_0x665f('0x38')]?_0x317fe9[_0x665f('0x35')]:_0x3441f5[_0x665f('0x34')];_0x317fe9[_0x665f('0x3b')]=qs['sort'](_0x2df1e7[_0x665f('0x32')][_0x665f('0x3c')]);_0x317fe9[_0x665f('0x3d')]=qs[_0x665f('0x3e')](_[_0x665f('0x55')](_0x2df1e7[_0x665f('0x32')],_0x3441f5[_0x665f('0x3e')]));if(_0x2df1e7[_0x665f('0x32')][_0x665f('0x41')]){_0x317fe9[_0x665f('0x3d')]=_[_0x665f('0x3f')](_0x317fe9[_0x665f('0x3d')],{'$or':_['map'](_0x317fe9[_0x665f('0x35')],function(_0x183b8c){var _0x2a804a={};_0x2a804a[_0x183b8c]={'$like':'%'+_0x2df1e7[_0x665f('0x32')]['filter']+'%'};return _0x2a804a;})});}_0x317fe9=_[_0x665f('0x3f')]({},_0x317fe9,_0x2df1e7[_0x665f('0x42')]);return _0x3507c5['getAllConditions'](_0x317fe9);}})[_0x665f('0x26')](function(_0x349a97){if(_0x349a97){_0xc6c0bf=_0x349a97[_0x665f('0x38')];if(!_0x2df1e7[_0x665f('0x32')][_0x665f('0x39')](_0x665f('0x3a'))){_0x317fe9[_0x665f('0x1e')]=qs[_0x665f('0x1e')](_0x2df1e7[_0x665f('0x32')][_0x665f('0x1e')]);_0x317fe9[_0x665f('0x1c')]=qs[_0x665f('0x1c')](_0x2df1e7[_0x665f('0x32')][_0x665f('0x1c')]);}return _0x3507c5[_0x665f('0x54')](_0x317fe9);}})[_0x665f('0x26')](function(_0x354969){if(_0x354969){return _0x354969?{'count':_0xc6c0bf,'rows':_0x354969}:null;}})['then'](respondWithResult(_0x4d9ffa,null))['catch'](handleError(_0x4d9ffa,null));};exports['getAnyConditions']=function(_0x5da3c1,_0x5266b1,_0x54d20c){var _0x33a80d={};var _0x353238={};var _0x209394;var _0xde2e09;return db['Trigger'][_0x665f('0x56')]({'where':{'id':_0x5da3c1['params']['id']}})['then'](handleEntityNotFound(_0x5266b1,null))['then'](function(_0x190087){if(_0x190087){_0x209394=_0x190087;_0x353238[_0x665f('0x34')]=_[_0x665f('0x33')](db['Condition']['rawAttributes']);_0x353238[_0x665f('0x32')]=_[_0x665f('0x33')](_0x5da3c1[_0x665f('0x32')]);_0x353238[_0x665f('0x3e')]=_[_0x665f('0x36')](_0x353238[_0x665f('0x34')],_0x353238[_0x665f('0x32')]);_0x33a80d[_0x665f('0x35')]=_[_0x665f('0x36')](_0x353238['model'],qs[_0x665f('0x37')](_0x5da3c1[_0x665f('0x32')]['fields']));_0x33a80d['attributes']=_0x33a80d['attributes']['length']?_0x33a80d['attributes']:_0x353238[_0x665f('0x34')];_0x33a80d['order']=qs['sort'](_0x5da3c1[_0x665f('0x32')][_0x665f('0x3c')]);_0x33a80d['where']=qs[_0x665f('0x3e')](_[_0x665f('0x55')](_0x5da3c1[_0x665f('0x32')],_0x353238[_0x665f('0x3e')]));if(_0x5da3c1[_0x665f('0x32')][_0x665f('0x41')]){_0x33a80d['where']=_['merge'](_0x33a80d[_0x665f('0x3d')],{'$or':_[_0x665f('0x40')](_0x33a80d[_0x665f('0x35')],function(_0x381a74){var _0x24deac={};_0x24deac[_0x381a74]={'$like':'%'+_0x5da3c1[_0x665f('0x32')][_0x665f('0x41')]+'%'};return _0x24deac;})});}_0x33a80d=_['merge']({},_0x33a80d,_0x5da3c1[_0x665f('0x42')]);return _0x209394[_0x665f('0x57')](_0x33a80d);}})[_0x665f('0x26')](function(_0x42a750){if(_0x42a750){_0xde2e09=_0x42a750[_0x665f('0x38')];if(!_0x5da3c1[_0x665f('0x32')][_0x665f('0x39')]('nolimit')){_0x33a80d['limit']=qs[_0x665f('0x1e')](_0x5da3c1[_0x665f('0x32')][_0x665f('0x1e')]);_0x33a80d[_0x665f('0x1c')]=qs[_0x665f('0x1c')](_0x5da3c1[_0x665f('0x32')][_0x665f('0x1c')]);}return _0x209394['getAnyConditions'](_0x33a80d);}})[_0x665f('0x26')](function(_0x503554){if(_0x503554){return _0x503554?{'count':_0xde2e09,'rows':_0x503554}:null;}})['then'](respondWithResult(_0x5266b1,null))[_0x665f('0x4d')](handleError(_0x5266b1,null));};exports[_0x665f('0x58')]=function(_0x4e66a3,_0x2a3911,_0x1da6d3){if(_0x4e66a3[_0x665f('0x4f')]['id']){delete _0x4e66a3['body']['id'];}return db[_0x665f('0x2e')][_0x665f('0x4a')]({'where':{'id':_0x4e66a3[_0x665f('0x51')]['id']}})[_0x665f('0x26')](handleEntityNotFound(_0x2a3911,null))['then'](function(_0x3fd9c5){if(_0x3fd9c5){_0x4e66a3[_0x665f('0x4f')][_0x665f('0x59')]=_0x3fd9c5['id'];return db['Action'][_0x665f('0x4c')](_0x4e66a3[_0x665f('0x4f')]);}})[_0x665f('0x26')](respondWithResult(_0x2a3911,null))[_0x665f('0x4d')](handleError(_0x2a3911,null));};exports[_0x665f('0x5a')]=function(_0x47d434,_0x110139,_0x5284cc){var _0x4604a9={};var _0x1b8a03={};var _0x200b2e;var _0x58562d;return db[_0x665f('0x2e')][_0x665f('0x56')]({'where':{'id':_0x47d434[_0x665f('0x51')]['id']}})[_0x665f('0x26')](handleEntityNotFound(_0x110139,null))[_0x665f('0x26')](function(_0x672b4c){if(_0x672b4c){_0x200b2e=_0x672b4c;_0x1b8a03[_0x665f('0x34')]=_[_0x665f('0x33')](db[_0x665f('0x5b')][_0x665f('0x2f')]);_0x1b8a03[_0x665f('0x32')]=_[_0x665f('0x33')](_0x47d434[_0x665f('0x32')]);_0x1b8a03[_0x665f('0x3e')]=_[_0x665f('0x36')](_0x1b8a03['model'],_0x1b8a03['query']);_0x4604a9[_0x665f('0x35')]=_['intersection'](_0x1b8a03[_0x665f('0x34')],qs[_0x665f('0x37')](_0x47d434[_0x665f('0x32')][_0x665f('0x37')]));_0x4604a9[_0x665f('0x35')]=_0x4604a9['attributes'][_0x665f('0x38')]?_0x4604a9['attributes']:_0x1b8a03[_0x665f('0x34')];_0x4604a9[_0x665f('0x3b')]=qs[_0x665f('0x3c')](_0x47d434[_0x665f('0x32')][_0x665f('0x3c')]);_0x4604a9['where']=qs[_0x665f('0x3e')](_['pick'](_0x47d434['query'],_0x1b8a03[_0x665f('0x3e')]));if(_0x47d434['query'][_0x665f('0x41')]){_0x4604a9['where']=_[_0x665f('0x3f')](_0x4604a9[_0x665f('0x3d')],{'$or':_[_0x665f('0x40')](_0x4604a9[_0x665f('0x35')],function(_0xcf004f){var _0x350c11={};_0x350c11[_0xcf004f]={'$like':'%'+_0x47d434[_0x665f('0x32')][_0x665f('0x41')]+'%'};return _0x350c11;})});}_0x4604a9=_['merge']({},_0x4604a9,_0x47d434[_0x665f('0x42')]);return _0x200b2e['getActions'](_0x4604a9);}})[_0x665f('0x26')](function(_0x56b5be){if(_0x56b5be){_0x58562d=_0x56b5be['length'];if(!_0x47d434[_0x665f('0x32')][_0x665f('0x39')]('nolimit')){_0x4604a9[_0x665f('0x1e')]=qs[_0x665f('0x1e')](_0x47d434[_0x665f('0x32')][_0x665f('0x1e')]);_0x4604a9['offset']=qs[_0x665f('0x1c')](_0x47d434[_0x665f('0x32')]['offset']);}return _0x200b2e[_0x665f('0x5a')](_0x4604a9);}})[_0x665f('0x26')](function(_0x5e6a63){if(_0x5e6a63){return _0x5e6a63?{'count':_0x58562d,'rows':_0x5e6a63}:null;}})['then'](respondWithResult(_0x110139,null))[_0x665f('0x4d')](handleError(_0x110139,null));}; \ No newline at end of file +var _0x8899=['end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','Triggers','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','Trigger','catch','show','params','intersection','includeAll','include','find','create','body','role','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','hasOwnProperty','getAnyConditions','addAction','Action','getActions','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x233afe,_0x541c51){var _0x339a10=function(_0x4b0897){while(--_0x4b0897){_0x233afe['push'](_0x233afe['shift']());}};_0x339a10(++_0x541c51);}(_0x8899,0x163));var _0x9889=function(_0x372aec,_0x142987){_0x372aec=_0x372aec-0x0;var _0x15cb5f=_0x8899[_0x372aec];return _0x15cb5f;};'use strict';var emlformat=require(_0x9889('0x0'));var rimraf=require(_0x9889('0x1'));var zipdir=require(_0x9889('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x9889('0x3'));var BPromise=require(_0x9889('0x4'));var Mustache=require(_0x9889('0x5'));var util=require(_0x9889('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x9889('0x7'));var ejs=require(_0x9889('0x8'));var fs=require('fs');var fs_extra=require(_0x9889('0x9'));var _=require(_0x9889('0xa'));var squel=require(_0x9889('0xb'));var crypto=require(_0x9889('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9889('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9889('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9889('0xf'));var qs=require(_0x9889('0x10'));var as=require(_0x9889('0x11'));var hardwareService=require(_0x9889('0x12'));var logger=require(_0x9889('0x13'))(_0x9889('0x14'));var utils=require('../../config/utils');var config=require(_0x9889('0x15'));var licenseUtil=require(_0x9889('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xbac9f,_0x382b9a){_0x382b9a=_0x382b9a||0xcc;return function(_0x59e226){if(_0x59e226){return _0xbac9f[_0x9889('0x17')](_0x382b9a);}return _0xbac9f[_0x9889('0x18')](_0x382b9a)[_0x9889('0x19')]();};}function respondWithResult(_0x586c8b,_0x1cc7e7){_0x1cc7e7=_0x1cc7e7||0xc8;return function(_0x458ccd){if(_0x458ccd){return _0x586c8b['status'](_0x1cc7e7)['json'](_0x458ccd);}};}function respondWithFilteredResult(_0x397a44,_0x176e71){return function(_0x3ecbee){if(_0x3ecbee){var _0x38932d=typeof _0x176e71[_0x9889('0x1a')]===_0x9889('0x1b')&&typeof _0x176e71[_0x9889('0x1c')]==='undefined';var _0x3d98db=_0x3ecbee[_0x9889('0x1d')];var _0x501b5c=_0x38932d?0x0:_0x176e71[_0x9889('0x1a')];var _0x5e3ad7=_0x38932d?_0x3ecbee[_0x9889('0x1d')]:_0x176e71['offset']+_0x176e71[_0x9889('0x1c')];var _0x267b95;if(_0x5e3ad7>=_0x3d98db){_0x5e3ad7=_0x3d98db;_0x267b95=0xc8;}else{_0x267b95=0xce;}_0x397a44[_0x9889('0x18')](_0x267b95);return _0x397a44[_0x9889('0x1e')](_0x9889('0x1f'),_0x501b5c+'-'+_0x5e3ad7+'/'+_0x3d98db)[_0x9889('0x20')](_0x3ecbee);}return null;};}function patchUpdates(_0x27364a){return function(_0x1464cd){try{jsonpatch[_0x9889('0x21')](_0x1464cd,_0x27364a,!![]);}catch(_0x2be8f4){return BPromise[_0x9889('0x22')](_0x2be8f4);}return _0x1464cd[_0x9889('0x23')]();};}function saveUpdates(_0xd9d8c0,_0x452fed){return function(_0x5c7f5e){if(_0x5c7f5e){return _0x5c7f5e[_0x9889('0x24')](_0xd9d8c0)['then'](function(_0x3d5b5c){return _0x3d5b5c;});}return null;};}function removeEntity(_0x26ad74,_0x29bcc9){return function(_0x17ae17){if(_0x17ae17){return _0x17ae17[_0x9889('0x25')]()[_0x9889('0x26')](function(){var _0x4375d6=_0x17ae17['get']({'plain':!![]});var _0xb2ca3a=_0x9889('0x27');return db[_0x9889('0x28')][_0x9889('0x25')]({'where':{'type':_0xb2ca3a,'resourceId':_0x4375d6['id']}})['then'](function(){return _0x17ae17;});})[_0x9889('0x26')](function(){_0x26ad74[_0x9889('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x46f5c3,_0x20493e){return function(_0xa5a389){if(!_0xa5a389){_0x46f5c3[_0x9889('0x17')](0x194);}return _0xa5a389;};}function handleError(_0x4d219e,_0x508ad6){_0x508ad6=_0x508ad6||0x1f4;return function(_0xc8efdd){logger[_0x9889('0x29')](_0xc8efdd[_0x9889('0x2a')]);if(_0xc8efdd[_0x9889('0x2b')]){delete _0xc8efdd['name'];}_0x4d219e[_0x9889('0x18')](_0x508ad6)[_0x9889('0x2c')](_0xc8efdd);};}exports[_0x9889('0x2d')]=function(_0x60d720,_0x1eaf42){var _0x72f236={},_0x134df9={},_0x52bc2b={'count':0x0,'rows':[]};var _0x377be7=_[_0x9889('0x2e')](db['Trigger'][_0x9889('0x2f')],function(_0x51d731){return{'name':_0x51d731[_0x9889('0x30')],'type':_0x51d731[_0x9889('0x31')][_0x9889('0x32')]};});_0x134df9[_0x9889('0x33')]=_[_0x9889('0x2e')](_0x377be7,'name');_0x134df9[_0x9889('0x34')]=_[_0x9889('0x35')](_0x60d720['query']);_0x134df9[_0x9889('0x36')]=_['intersection'](_0x134df9[_0x9889('0x33')],_0x134df9[_0x9889('0x34')]);_0x72f236[_0x9889('0x37')]=_['intersection'](_0x134df9['model'],qs[_0x9889('0x38')](_0x60d720[_0x9889('0x34')]['fields']));_0x72f236[_0x9889('0x37')]=_0x72f236['attributes'][_0x9889('0x39')]?_0x72f236[_0x9889('0x37')]:_0x134df9[_0x9889('0x33')];if(!_0x60d720[_0x9889('0x34')]['hasOwnProperty'](_0x9889('0x3a'))){_0x72f236[_0x9889('0x1c')]=qs['limit'](_0x60d720[_0x9889('0x34')][_0x9889('0x1c')]);_0x72f236['offset']=qs[_0x9889('0x1a')](_0x60d720[_0x9889('0x34')][_0x9889('0x1a')]);}_0x72f236[_0x9889('0x3b')]=qs[_0x9889('0x3c')](_0x60d720['query'][_0x9889('0x3c')]);_0x72f236[_0x9889('0x3d')]=qs[_0x9889('0x36')](_[_0x9889('0x3e')](_0x60d720[_0x9889('0x34')],_0x134df9[_0x9889('0x36')]),_0x377be7);if(_0x60d720[_0x9889('0x34')]['filter']){_0x72f236['where']=_[_0x9889('0x3f')](_0x72f236[_0x9889('0x3d')],{'$or':_['map'](_0x377be7,function(_0x43f5ee){if(_0x43f5ee[_0x9889('0x31')]!==_0x9889('0x40')){var _0x44e9dc={};_0x44e9dc[_0x43f5ee[_0x9889('0x2b')]]={'$like':'%'+_0x60d720[_0x9889('0x34')][_0x9889('0x41')]+'%'};return _0x44e9dc;}})});}_0x72f236=_[_0x9889('0x3f')]({},_0x72f236,_0x60d720[_0x9889('0x42')]);var _0x17fe98={'where':_0x72f236['where']};return db['Trigger'][_0x9889('0x1d')](_0x17fe98)[_0x9889('0x26')](function(_0x479883){_0x52bc2b[_0x9889('0x1d')]=_0x479883;if(_0x60d720['query']['includeAll']){_0x72f236['include']=[{'all':!![]}];}return db[_0x9889('0x43')]['findAll'](_0x72f236);})[_0x9889('0x26')](function(_0xd49d69){_0x52bc2b['rows']=_0xd49d69;return _0x52bc2b;})[_0x9889('0x26')](respondWithFilteredResult(_0x1eaf42,_0x72f236))[_0x9889('0x44')](handleError(_0x1eaf42,null));};exports[_0x9889('0x45')]=function(_0x2ff92c,_0x5f4263){var _0x87a2fc={'raw':![],'where':{'id':_0x2ff92c[_0x9889('0x46')]['id']}},_0x654577={};_0x654577[_0x9889('0x33')]=_['keys'](db[_0x9889('0x43')]['rawAttributes']);_0x654577['query']=_[_0x9889('0x35')](_0x2ff92c[_0x9889('0x34')]);_0x654577[_0x9889('0x36')]=_[_0x9889('0x47')](_0x654577[_0x9889('0x33')],_0x654577['query']);_0x87a2fc['attributes']=_[_0x9889('0x47')](_0x654577['model'],qs[_0x9889('0x38')](_0x2ff92c['query'][_0x9889('0x38')]));_0x87a2fc[_0x9889('0x37')]=_0x87a2fc[_0x9889('0x37')][_0x9889('0x39')]?_0x87a2fc['attributes']:_0x654577[_0x9889('0x33')];if(_0x2ff92c[_0x9889('0x34')][_0x9889('0x48')]){_0x87a2fc[_0x9889('0x49')]=[{'all':!![]}];}_0x87a2fc=_[_0x9889('0x3f')]({},_0x87a2fc,_0x2ff92c['options']);return db[_0x9889('0x43')][_0x9889('0x4a')](_0x87a2fc)[_0x9889('0x26')](handleEntityNotFound(_0x5f4263,null))[_0x9889('0x26')](respondWithResult(_0x5f4263,null))[_0x9889('0x44')](handleError(_0x5f4263,null));};exports[_0x9889('0x4b')]=function(_0x3a5f8b,_0x5c8a48){return db['Trigger'][_0x9889('0x4b')](_0x3a5f8b[_0x9889('0x4c')],{})[_0x9889('0x26')](function(_0x8936e){var _0x3cb31e=_0x3a5f8b['user']['get']({'plain':!![]});if(!_0x3cb31e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3cb31e[_0x9889('0x4d')]===_0x9889('0x4e')){var _0x200329=_0x8936e[_0x9889('0x4f')]({'plain':!![]});var _0x321f54=_0x9889('0x27');return db[_0x9889('0x50')]['find']({'where':{'name':_0x321f54,'userProfileId':_0x3cb31e[_0x9889('0x51')]},'raw':!![]})[_0x9889('0x26')](function(_0x227246){if(_0x227246&&_0x227246[_0x9889('0x52')]===0x0){return db['UserProfileResource'][_0x9889('0x4b')]({'name':_0x200329[_0x9889('0x2b')],'resourceId':_0x200329['id'],'type':_0x227246[_0x9889('0x2b')],'sectionId':_0x227246['id']},{})[_0x9889('0x26')](function(){return _0x8936e;});}else{return _0x8936e;}})[_0x9889('0x44')](function(_0x1cdc49){logger[_0x9889('0x29')](_0x9889('0x53'),_0x1cdc49);throw _0x1cdc49;});}return _0x8936e;})[_0x9889('0x26')](respondWithResult(_0x5c8a48,0xc9))[_0x9889('0x44')](handleError(_0x5c8a48,null));};exports['update']=function(_0x4c3418,_0x2081a8){if(_0x4c3418[_0x9889('0x4c')]['id']){delete _0x4c3418[_0x9889('0x4c')]['id'];}return db[_0x9889('0x43')][_0x9889('0x4a')]({'where':{'id':_0x4c3418[_0x9889('0x46')]['id']}})['then'](handleEntityNotFound(_0x2081a8,null))['then'](saveUpdates(_0x4c3418[_0x9889('0x4c')],null))['then'](respondWithResult(_0x2081a8,null))[_0x9889('0x44')](handleError(_0x2081a8,null));};exports['destroy']=function(_0x23e928,_0x324dfc){return db[_0x9889('0x43')][_0x9889('0x4a')]({'where':{'id':_0x23e928[_0x9889('0x46')]['id']}})[_0x9889('0x26')](handleEntityNotFound(_0x324dfc,null))['then'](removeEntity(_0x324dfc,null))[_0x9889('0x44')](handleError(_0x324dfc,null));};exports[_0x9889('0x54')]=function(_0x55cedf,_0x241817,_0x536bfa){if(_0x55cedf[_0x9889('0x4c')]['id']){delete _0x55cedf['body']['id'];}return db[_0x9889('0x43')][_0x9889('0x4a')]({'where':{'id':_0x55cedf['params']['id']}})[_0x9889('0x26')](handleEntityNotFound(_0x241817,null))[_0x9889('0x26')](function(_0x5d5e85){if(_0x5d5e85){_0x55cedf[_0x9889('0x4c')]['TriggerAllId']=_0x5d5e85['id'];return db[_0x9889('0x55')]['create'](_0x55cedf[_0x9889('0x4c')]);}})['then'](respondWithResult(_0x241817,null))['catch'](handleError(_0x241817,null));};exports[_0x9889('0x56')]=function(_0x42f300,_0x353b29,_0x11af91){if(_0x42f300[_0x9889('0x4c')]['id']){delete _0x42f300[_0x9889('0x4c')]['id'];}return db[_0x9889('0x43')]['find']({'where':{'id':_0x42f300['params']['id']}})[_0x9889('0x26')](handleEntityNotFound(_0x353b29,null))['then'](function(_0x183919){if(_0x183919){_0x42f300[_0x9889('0x4c')][_0x9889('0x57')]=_0x183919['id'];return db['Condition'][_0x9889('0x4b')](_0x42f300[_0x9889('0x4c')]);}})[_0x9889('0x26')](respondWithResult(_0x353b29,null))[_0x9889('0x44')](handleError(_0x353b29,null));};exports[_0x9889('0x58')]=function(_0x420b47,_0x1c109d,_0x555660){var _0x1d2015={};var _0x29e376={};var _0x382a34;var _0x3feba2;return db['Trigger'][_0x9889('0x59')]({'where':{'id':_0x420b47[_0x9889('0x46')]['id']}})[_0x9889('0x26')](handleEntityNotFound(_0x1c109d,null))[_0x9889('0x26')](function(_0x3f5b10){if(_0x3f5b10){_0x382a34=_0x3f5b10;_0x29e376[_0x9889('0x33')]=_['keys'](db['Condition']['rawAttributes']);_0x29e376[_0x9889('0x34')]=_[_0x9889('0x35')](_0x420b47[_0x9889('0x34')]);_0x29e376[_0x9889('0x36')]=_['intersection'](_0x29e376[_0x9889('0x33')],_0x29e376[_0x9889('0x34')]);_0x1d2015[_0x9889('0x37')]=_[_0x9889('0x47')](_0x29e376[_0x9889('0x33')],qs[_0x9889('0x38')](_0x420b47[_0x9889('0x34')][_0x9889('0x38')]));_0x1d2015[_0x9889('0x37')]=_0x1d2015[_0x9889('0x37')][_0x9889('0x39')]?_0x1d2015[_0x9889('0x37')]:_0x29e376[_0x9889('0x33')];_0x1d2015[_0x9889('0x3b')]=qs[_0x9889('0x3c')](_0x420b47['query'][_0x9889('0x3c')]);_0x1d2015[_0x9889('0x3d')]=qs['filters'](_['pick'](_0x420b47[_0x9889('0x34')],_0x29e376['filters']));if(_0x420b47[_0x9889('0x34')][_0x9889('0x41')]){_0x1d2015[_0x9889('0x3d')]=_[_0x9889('0x3f')](_0x1d2015[_0x9889('0x3d')],{'$or':_[_0x9889('0x2e')](_0x1d2015[_0x9889('0x37')],function(_0x26f72e){var _0x11a393={};_0x11a393[_0x26f72e]={'$like':'%'+_0x420b47[_0x9889('0x34')][_0x9889('0x41')]+'%'};return _0x11a393;})});}_0x1d2015=_[_0x9889('0x3f')]({},_0x1d2015,_0x420b47[_0x9889('0x42')]);return _0x382a34[_0x9889('0x58')](_0x1d2015);}})[_0x9889('0x26')](function(_0x14da3e){if(_0x14da3e){_0x3feba2=_0x14da3e[_0x9889('0x39')];if(!_0x420b47[_0x9889('0x34')][_0x9889('0x5a')](_0x9889('0x3a'))){_0x1d2015[_0x9889('0x1c')]=qs[_0x9889('0x1c')](_0x420b47[_0x9889('0x34')][_0x9889('0x1c')]);_0x1d2015['offset']=qs[_0x9889('0x1a')](_0x420b47[_0x9889('0x34')]['offset']);}return _0x382a34[_0x9889('0x58')](_0x1d2015);}})['then'](function(_0x1d118b){if(_0x1d118b){return _0x1d118b?{'count':_0x3feba2,'rows':_0x1d118b}:null;}})[_0x9889('0x26')](respondWithResult(_0x1c109d,null))[_0x9889('0x44')](handleError(_0x1c109d,null));};exports['getAnyConditions']=function(_0x489d9e,_0x4f7442,_0x53a120){var _0x2afe32={};var _0x40a123={};var _0xff907;var _0x164a1e;return db['Trigger']['findOne']({'where':{'id':_0x489d9e[_0x9889('0x46')]['id']}})[_0x9889('0x26')](handleEntityNotFound(_0x4f7442,null))[_0x9889('0x26')](function(_0x52b12d){if(_0x52b12d){_0xff907=_0x52b12d;_0x40a123[_0x9889('0x33')]=_[_0x9889('0x35')](db[_0x9889('0x55')][_0x9889('0x2f')]);_0x40a123['query']=_[_0x9889('0x35')](_0x489d9e[_0x9889('0x34')]);_0x40a123['filters']=_[_0x9889('0x47')](_0x40a123[_0x9889('0x33')],_0x40a123[_0x9889('0x34')]);_0x2afe32[_0x9889('0x37')]=_['intersection'](_0x40a123[_0x9889('0x33')],qs[_0x9889('0x38')](_0x489d9e['query'][_0x9889('0x38')]));_0x2afe32[_0x9889('0x37')]=_0x2afe32[_0x9889('0x37')][_0x9889('0x39')]?_0x2afe32[_0x9889('0x37')]:_0x40a123[_0x9889('0x33')];_0x2afe32[_0x9889('0x3b')]=qs['sort'](_0x489d9e['query']['sort']);_0x2afe32[_0x9889('0x3d')]=qs[_0x9889('0x36')](_[_0x9889('0x3e')](_0x489d9e[_0x9889('0x34')],_0x40a123[_0x9889('0x36')]));if(_0x489d9e[_0x9889('0x34')][_0x9889('0x41')]){_0x2afe32[_0x9889('0x3d')]=_[_0x9889('0x3f')](_0x2afe32[_0x9889('0x3d')],{'$or':_[_0x9889('0x2e')](_0x2afe32['attributes'],function(_0x1a5c97){var _0x47c969={};_0x47c969[_0x1a5c97]={'$like':'%'+_0x489d9e[_0x9889('0x34')][_0x9889('0x41')]+'%'};return _0x47c969;})});}_0x2afe32=_[_0x9889('0x3f')]({},_0x2afe32,_0x489d9e[_0x9889('0x42')]);return _0xff907['getAnyConditions'](_0x2afe32);}})[_0x9889('0x26')](function(_0x6b381e){if(_0x6b381e){_0x164a1e=_0x6b381e[_0x9889('0x39')];if(!_0x489d9e[_0x9889('0x34')][_0x9889('0x5a')]('nolimit')){_0x2afe32[_0x9889('0x1c')]=qs[_0x9889('0x1c')](_0x489d9e[_0x9889('0x34')][_0x9889('0x1c')]);_0x2afe32['offset']=qs[_0x9889('0x1a')](_0x489d9e[_0x9889('0x34')][_0x9889('0x1a')]);}return _0xff907[_0x9889('0x5b')](_0x2afe32);}})[_0x9889('0x26')](function(_0xdf1bf8){if(_0xdf1bf8){return _0xdf1bf8?{'count':_0x164a1e,'rows':_0xdf1bf8}:null;}})[_0x9889('0x26')](respondWithResult(_0x4f7442,null))[_0x9889('0x44')](handleError(_0x4f7442,null));};exports[_0x9889('0x5c')]=function(_0x1e5f09,_0x244fce,_0x28792b){if(_0x1e5f09[_0x9889('0x4c')]['id']){delete _0x1e5f09[_0x9889('0x4c')]['id'];}return db[_0x9889('0x43')][_0x9889('0x4a')]({'where':{'id':_0x1e5f09[_0x9889('0x46')]['id']}})[_0x9889('0x26')](handleEntityNotFound(_0x244fce,null))[_0x9889('0x26')](function(_0x4b9b80){if(_0x4b9b80){_0x1e5f09['body']['TriggerId']=_0x4b9b80['id'];return db[_0x9889('0x5d')][_0x9889('0x4b')](_0x1e5f09['body']);}})[_0x9889('0x26')](respondWithResult(_0x244fce,null))[_0x9889('0x44')](handleError(_0x244fce,null));};exports['getActions']=function(_0x9dc02e,_0x3c7d01,_0x297425){var _0xa7f4c9={};var _0x406f52={};var _0x18270e;var _0x293f75;return db['Trigger'][_0x9889('0x59')]({'where':{'id':_0x9dc02e[_0x9889('0x46')]['id']}})[_0x9889('0x26')](handleEntityNotFound(_0x3c7d01,null))[_0x9889('0x26')](function(_0x4237c2){if(_0x4237c2){_0x18270e=_0x4237c2;_0x406f52[_0x9889('0x33')]=_['keys'](db['Action'][_0x9889('0x2f')]);_0x406f52[_0x9889('0x34')]=_[_0x9889('0x35')](_0x9dc02e[_0x9889('0x34')]);_0x406f52['filters']=_['intersection'](_0x406f52[_0x9889('0x33')],_0x406f52['query']);_0xa7f4c9[_0x9889('0x37')]=_['intersection'](_0x406f52[_0x9889('0x33')],qs[_0x9889('0x38')](_0x9dc02e['query'][_0x9889('0x38')]));_0xa7f4c9[_0x9889('0x37')]=_0xa7f4c9[_0x9889('0x37')][_0x9889('0x39')]?_0xa7f4c9['attributes']:_0x406f52[_0x9889('0x33')];_0xa7f4c9[_0x9889('0x3b')]=qs[_0x9889('0x3c')](_0x9dc02e[_0x9889('0x34')][_0x9889('0x3c')]);_0xa7f4c9[_0x9889('0x3d')]=qs[_0x9889('0x36')](_[_0x9889('0x3e')](_0x9dc02e[_0x9889('0x34')],_0x406f52[_0x9889('0x36')]));if(_0x9dc02e[_0x9889('0x34')][_0x9889('0x41')]){_0xa7f4c9['where']=_[_0x9889('0x3f')](_0xa7f4c9[_0x9889('0x3d')],{'$or':_[_0x9889('0x2e')](_0xa7f4c9[_0x9889('0x37')],function(_0x6c84ad){var _0x32d0e9={};_0x32d0e9[_0x6c84ad]={'$like':'%'+_0x9dc02e['query']['filter']+'%'};return _0x32d0e9;})});}_0xa7f4c9=_[_0x9889('0x3f')]({},_0xa7f4c9,_0x9dc02e[_0x9889('0x42')]);return _0x18270e[_0x9889('0x5e')](_0xa7f4c9);}})['then'](function(_0x1263d3){if(_0x1263d3){_0x293f75=_0x1263d3[_0x9889('0x39')];if(!_0x9dc02e[_0x9889('0x34')][_0x9889('0x5a')](_0x9889('0x3a'))){_0xa7f4c9['limit']=qs[_0x9889('0x1c')](_0x9dc02e[_0x9889('0x34')]['limit']);_0xa7f4c9['offset']=qs[_0x9889('0x1a')](_0x9dc02e[_0x9889('0x34')][_0x9889('0x1a')]);}return _0x18270e[_0x9889('0x5e')](_0xa7f4c9);}})[_0x9889('0x26')](function(_0x4063f4){if(_0x4063f4){return _0x4063f4?{'count':_0x293f75,'rows':_0x4063f4}:null;}})['then'](respondWithResult(_0x3c7d01,null))[_0x9889('0x44')](handleError(_0x3c7d01,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index c55ae96..90d6ae6 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 _0x7c8e=['exports','define','Trigger','tools_triggers','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes'];(function(_0x2b2489,_0x289ae2){var _0x387771=function(_0x5d8fe0){while(--_0x5d8fe0){_0x2b2489['push'](_0x2b2489['shift']());}};_0x387771(++_0x289ae2);}(_0x7c8e,0x10e));var _0xe7c8=function(_0x4a77e4,_0x556f71){_0x4a77e4=_0x4a77e4-0x0;var _0x1c68d8=_0x7c8e[_0x4a77e4];return _0x1c68d8;};'use strict';var _=require('lodash');var util=require(_0xe7c8('0x0'));var logger=require(_0xe7c8('0x1'))(_0xe7c8('0x2'));var moment=require(_0xe7c8('0x3'));var BPromise=require(_0xe7c8('0x4'));var rp=require(_0xe7c8('0x5'));var fs=require('fs');var path=require(_0xe7c8('0x6'));var rimraf=require(_0xe7c8('0x7'));var config=require(_0xe7c8('0x8'));var attributes=require(_0xe7c8('0x9'));module[_0xe7c8('0xa')]=function(_0x1f0a65,_0x293383){return _0x1f0a65[_0xe7c8('0xb')](_0xe7c8('0xc'),attributes,{'tableName':_0xe7c8('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4c6d=['moment','request-promise','path','rimraf','./trigger.attributes','exports','define','Trigger','lodash','util','../../config/logger','api'];(function(_0xea25aa,_0x4c3a90){var _0x45c7ac=function(_0x52b4bd){while(--_0x52b4bd){_0xea25aa['push'](_0xea25aa['shift']());}};_0x45c7ac(++_0x4c3a90);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x1a0e1b,_0x1ed3d6){_0x1a0e1b=_0x1a0e1b-0x0;var _0x541bf6=_0x4c6d[_0x1a0e1b];return _0x541bf6;};'use strict';var _=require(_0xd4c6('0x0'));var util=require(_0xd4c6('0x1'));var logger=require(_0xd4c6('0x2'))(_0xd4c6('0x3'));var moment=require(_0xd4c6('0x4'));var BPromise=require('bluebird');var rp=require(_0xd4c6('0x5'));var fs=require('fs');var path=require(_0xd4c6('0x6'));var rimraf=require(_0xd4c6('0x7'));var config=require('../../config/environment');var attributes=require(_0xd4c6('0x8'));module[_0xd4c6('0x9')]=function(_0x56279c,_0x182671){return _0x56279c[_0xd4c6('0xa')](_0xd4c6('0xb'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index dd48517..c9905aa 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 _0xd3c3=['debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','map','include','model','find','ShowTrigger','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent'];(function(_0x3e9f54,_0x3ec08d){var _0x2333bb=function(_0x4942f5){while(--_0x4942f5){_0x3e9f54['push'](_0x3e9f54['shift']());}};_0x2333bb(++_0x3ec08d);}(_0xd3c3,0x18a));var _0x3d3c=function(_0x2fdcf5,_0x3b72d6){_0x2fdcf5=_0x2fdcf5-0x0;var _0x516336=_0xd3c3[_0x2fdcf5];return _0x516336;};'use strict';var _=require(_0x3d3c('0x0'));var util=require(_0x3d3c('0x1'));var moment=require(_0x3d3c('0x2'));var BPromise=require(_0x3d3c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3d3c('0x4'));var logger=require(_0x3d3c('0x5'))(_0x3d3c('0x6'));var config=require(_0x3d3c('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3d3c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2a1ff0,_0xc7f71b,_0x249110){return new BPromise(function(_0x79bf51,_0x40b761){return client[_0x3d3c('0x9')](_0x2a1ff0,_0x249110)[_0x3d3c('0xa')](function(_0x23adca){logger[_0x3d3c('0xb')](_0x3d3c('0xc'),_0xc7f71b,_0x3d3c('0xd'));logger[_0x3d3c('0xe')](_0x3d3c('0xf'),_0xc7f71b,_0x3d3c('0xd'),JSON[_0x3d3c('0x10')](_0x23adca));if(_0x23adca[_0x3d3c('0x11')]){if(_0x23adca['error'][_0x3d3c('0x12')]===0x1f4){logger['error'](_0x3d3c('0xc'),_0xc7f71b,_0x23adca[_0x3d3c('0x11')][_0x3d3c('0x13')]);return _0x40b761(_0x23adca['error'][_0x3d3c('0x13')]);}logger['error']('Trigger,\x20%s,\x20%s',_0xc7f71b,_0x23adca[_0x3d3c('0x11')][_0x3d3c('0x13')]);return _0x79bf51(_0x23adca[_0x3d3c('0x11')][_0x3d3c('0x13')]);}else{logger[_0x3d3c('0xb')](_0x3d3c('0xc'),_0xc7f71b,'request\x20sent');_0x79bf51(_0x23adca[_0x3d3c('0x14')][_0x3d3c('0x13')]);}})[_0x3d3c('0x15')](function(_0xa3d8f){logger[_0x3d3c('0x11')](_0x3d3c('0xc'),_0xc7f71b,_0xa3d8f);_0x40b761(_0xa3d8f);});});}exports[_0x3d3c('0x16')]=function(_0x4141bd){var _0x13a677=this;return new Promise(function(_0x4db41a,_0x262b4f){return db[_0x3d3c('0x17')][_0x3d3c('0x18')]({'raw':_0x4141bd[_0x3d3c('0x19')]?_0x4141bd['options'][_0x3d3c('0x1a')]===undefined?!![]:![]:!![],'where':_0x4141bd[_0x3d3c('0x19')]?_0x4141bd[_0x3d3c('0x19')][_0x3d3c('0x1b')]||null:null,'attributes':_0x4141bd[_0x3d3c('0x19')]?_0x4141bd['options'][_0x3d3c('0x1c')]||null:null,'limit':_0x4141bd[_0x3d3c('0x19')]?_0x4141bd[_0x3d3c('0x19')]['limit']||null:null,'include':_0x4141bd[_0x3d3c('0x19')]?_0x4141bd[_0x3d3c('0x19')]['include']?_[_0x3d3c('0x1d')](_0x4141bd[_0x3d3c('0x19')][_0x3d3c('0x1e')],function(_0x275d04){return{'model':db[_0x275d04[_0x3d3c('0x1f')]],'as':_0x275d04['as'],'attributes':_0x275d04[_0x3d3c('0x1c')],'include':_0x275d04['include']?_[_0x3d3c('0x1d')](_0x275d04[_0x3d3c('0x1e')],function(_0x54e74a){return{'model':db[_0x54e74a[_0x3d3c('0x1f')]],'as':_0x54e74a['as'],'attributes':_0x54e74a[_0x3d3c('0x1c')],'include':_0x54e74a[_0x3d3c('0x1e')]?_[_0x3d3c('0x1d')](_0x54e74a['include'],function(_0x5f4f16){return{'model':db[_0x5f4f16[_0x3d3c('0x1f')]],'as':_0x5f4f16['as'],'attributes':_0x5f4f16[_0x3d3c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3d3c('0xa')](function(_0x2119d3){logger[_0x3d3c('0xb')](_0x3d3c('0x16'),_0x4141bd);logger[_0x3d3c('0xe')](_0x3d3c('0x16'),_0x4141bd,JSON['stringify'](_0x2119d3));_0x4db41a(_0x2119d3);})['catch'](function(_0x2e9055){logger['error'](_0x3d3c('0x16'),_0x2e9055[_0x3d3c('0x13')],_0x4141bd);_0x262b4f(_0x13a677[_0x3d3c('0x11')](0x1f4,_0x2e9055[_0x3d3c('0x13')]));});});};exports['ShowTrigger']=function(_0x480c9e){var _0x44e255=this;return new Promise(function(_0x15fbb2,_0x59be80){return db[_0x3d3c('0x17')][_0x3d3c('0x20')]({'raw':_0x480c9e[_0x3d3c('0x19')]?_0x480c9e[_0x3d3c('0x19')][_0x3d3c('0x1a')]===undefined?!![]:![]:!![],'where':_0x480c9e[_0x3d3c('0x19')]?_0x480c9e['options']['where']||null:null,'attributes':_0x480c9e[_0x3d3c('0x19')]?_0x480c9e[_0x3d3c('0x19')][_0x3d3c('0x1c')]||null:null,'include':_0x480c9e[_0x3d3c('0x19')]?_0x480c9e['options']['include']?_[_0x3d3c('0x1d')](_0x480c9e[_0x3d3c('0x19')][_0x3d3c('0x1e')],function(_0x199a1e){return{'model':db[_0x199a1e[_0x3d3c('0x1f')]],'as':_0x199a1e['as'],'attributes':_0x199a1e[_0x3d3c('0x1c')],'include':_0x199a1e[_0x3d3c('0x1e')]?_['map'](_0x199a1e[_0x3d3c('0x1e')],function(_0x1edbea){return{'model':db[_0x1edbea[_0x3d3c('0x1f')]],'as':_0x1edbea['as'],'attributes':_0x1edbea['attributes'],'include':_0x1edbea[_0x3d3c('0x1e')]?_[_0x3d3c('0x1d')](_0x1edbea['include'],function(_0x1986a4){return{'model':db[_0x1986a4[_0x3d3c('0x1f')]],'as':_0x1986a4['as'],'attributes':_0x1986a4['attributes']};}):[]};}):[]};}):[]:[]})[_0x3d3c('0xa')](function(_0xb02cea){logger[_0x3d3c('0xb')]('ShowTrigger',_0x480c9e);logger[_0x3d3c('0xe')](_0x3d3c('0x21'),_0x480c9e,JSON[_0x3d3c('0x10')](_0xb02cea));_0x15fbb2(_0xb02cea);})[_0x3d3c('0x15')](function(_0x358ec6){logger[_0x3d3c('0x11')]('ShowTrigger',_0x358ec6[_0x3d3c('0x13')],_0x480c9e);_0x59be80(_0x44e255[_0x3d3c('0x11')](0x1f4,_0x358ec6['message']));});});}; \ No newline at end of file +var _0xfec8=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetTrigger','Trigger','findAll','options','where','limit','include','model','attributes','map','ShowTrigger','find','raw','util','moment','bluebird','randomstring'];(function(_0x38793f,_0x120998){var _0x6a5109=function(_0x3bcc0a){while(--_0x3bcc0a){_0x38793f['push'](_0x38793f['shift']());}};_0x6a5109(++_0x120998);}(_0xfec8,0x65));var _0x8fec=function(_0x19b84f,_0x48765e){_0x19b84f=_0x19b84f-0x0;var _0x18067b=_0xfec8[_0x19b84f];return _0x18067b;};'use strict';var _=require('lodash');var util=require(_0x8fec('0x0'));var moment=require(_0x8fec('0x1'));var BPromise=require(_0x8fec('0x2'));var rs=require(_0x8fec('0x3'));var fs=require('fs');var Redis=require(_0x8fec('0x4'));var db=require(_0x8fec('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8fec('0x6'))(_0x8fec('0x7'));var config=require(_0x8fec('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8fec('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24b0a9,_0x27948f,_0x23bb82){return new BPromise(function(_0x44a1ef,_0x207b01){return client[_0x8fec('0xa')](_0x24b0a9,_0x23bb82)[_0x8fec('0xb')](function(_0x9371e0){logger[_0x8fec('0xc')](_0x8fec('0xd'),_0x27948f,_0x8fec('0xe'));logger[_0x8fec('0xf')]('Trigger,\x20%s,\x20%s,\x20%s',_0x27948f,_0x8fec('0xe'),JSON[_0x8fec('0x10')](_0x9371e0));if(_0x9371e0[_0x8fec('0x11')]){if(_0x9371e0[_0x8fec('0x11')][_0x8fec('0x12')]===0x1f4){logger[_0x8fec('0x11')](_0x8fec('0xd'),_0x27948f,_0x9371e0[_0x8fec('0x11')][_0x8fec('0x13')]);return _0x207b01(_0x9371e0[_0x8fec('0x11')][_0x8fec('0x13')]);}logger[_0x8fec('0x11')](_0x8fec('0xd'),_0x27948f,_0x9371e0[_0x8fec('0x11')][_0x8fec('0x13')]);return _0x44a1ef(_0x9371e0[_0x8fec('0x11')][_0x8fec('0x13')]);}else{logger[_0x8fec('0xc')](_0x8fec('0xd'),_0x27948f,'request\x20sent');_0x44a1ef(_0x9371e0[_0x8fec('0x14')][_0x8fec('0x13')]);}})[_0x8fec('0x15')](function(_0x2234a2){logger['error'](_0x8fec('0xd'),_0x27948f,_0x2234a2);_0x207b01(_0x2234a2);});});}exports[_0x8fec('0x16')]=function(_0x56f322){var _0x42755a=this;return new Promise(function(_0x59f939,_0x592020){return db[_0x8fec('0x17')][_0x8fec('0x18')]({'raw':_0x56f322[_0x8fec('0x19')]?_0x56f322[_0x8fec('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x56f322[_0x8fec('0x19')]?_0x56f322[_0x8fec('0x19')][_0x8fec('0x1a')]||null:null,'attributes':_0x56f322[_0x8fec('0x19')]?_0x56f322[_0x8fec('0x19')]['attributes']||null:null,'limit':_0x56f322[_0x8fec('0x19')]?_0x56f322[_0x8fec('0x19')][_0x8fec('0x1b')]||null:null,'include':_0x56f322['options']?_0x56f322['options'][_0x8fec('0x1c')]?_['map'](_0x56f322['options'][_0x8fec('0x1c')],function(_0x1d77c5){return{'model':db[_0x1d77c5[_0x8fec('0x1d')]],'as':_0x1d77c5['as'],'attributes':_0x1d77c5[_0x8fec('0x1e')],'include':_0x1d77c5[_0x8fec('0x1c')]?_['map'](_0x1d77c5[_0x8fec('0x1c')],function(_0x33e80a){return{'model':db[_0x33e80a['model']],'as':_0x33e80a['as'],'attributes':_0x33e80a['attributes'],'include':_0x33e80a[_0x8fec('0x1c')]?_[_0x8fec('0x1f')](_0x33e80a[_0x8fec('0x1c')],function(_0x40c4fb){return{'model':db[_0x40c4fb[_0x8fec('0x1d')]],'as':_0x40c4fb['as'],'attributes':_0x40c4fb[_0x8fec('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8fec('0xb')](function(_0x368f18){logger[_0x8fec('0xc')]('GetTrigger',_0x56f322);logger[_0x8fec('0xf')](_0x8fec('0x16'),_0x56f322,JSON[_0x8fec('0x10')](_0x368f18));_0x59f939(_0x368f18);})['catch'](function(_0xc828c4){logger[_0x8fec('0x11')](_0x8fec('0x16'),_0xc828c4[_0x8fec('0x13')],_0x56f322);_0x592020(_0x42755a[_0x8fec('0x11')](0x1f4,_0xc828c4[_0x8fec('0x13')]));});});};exports[_0x8fec('0x20')]=function(_0x28c729){var _0x3ffdfb=this;return new Promise(function(_0x4b3092,_0xe266b){return db['Trigger'][_0x8fec('0x21')]({'raw':_0x28c729[_0x8fec('0x19')]?_0x28c729[_0x8fec('0x19')][_0x8fec('0x22')]===undefined?!![]:![]:!![],'where':_0x28c729[_0x8fec('0x19')]?_0x28c729['options'][_0x8fec('0x1a')]||null:null,'attributes':_0x28c729[_0x8fec('0x19')]?_0x28c729[_0x8fec('0x19')][_0x8fec('0x1e')]||null:null,'include':_0x28c729[_0x8fec('0x19')]?_0x28c729[_0x8fec('0x19')][_0x8fec('0x1c')]?_[_0x8fec('0x1f')](_0x28c729[_0x8fec('0x19')][_0x8fec('0x1c')],function(_0x15e032){return{'model':db[_0x15e032['model']],'as':_0x15e032['as'],'attributes':_0x15e032[_0x8fec('0x1e')],'include':_0x15e032[_0x8fec('0x1c')]?_[_0x8fec('0x1f')](_0x15e032['include'],function(_0x2f0479){return{'model':db[_0x2f0479[_0x8fec('0x1d')]],'as':_0x2f0479['as'],'attributes':_0x2f0479[_0x8fec('0x1e')],'include':_0x2f0479['include']?_[_0x8fec('0x1f')](_0x2f0479[_0x8fec('0x1c')],function(_0x3d6447){return{'model':db[_0x3d6447[_0x8fec('0x1d')]],'as':_0x3d6447['as'],'attributes':_0x3d6447[_0x8fec('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8fec('0xb')](function(_0x52c855){logger['info'](_0x8fec('0x20'),_0x28c729);logger[_0x8fec('0xf')](_0x8fec('0x20'),_0x28c729,JSON[_0x8fec('0x10')](_0x52c855));_0x4b3092(_0x52c855);})[_0x8fec('0x15')](function(_0x2c35ae){logger[_0x8fec('0x11')](_0x8fec('0x20'),_0x2c35ae[_0x8fec('0x13')],_0x28c729);_0xe266b(_0x3ffdfb[_0x8fec('0x11')](0x1f4,_0x2c35ae[_0x8fec('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 5798fb6..5739bcc 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 _0x5218=['clone','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone'];(function(_0x33f273,_0x5a5ec9){var _0x279d56=function(_0x3ba124){while(--_0x3ba124){_0x33f273['push'](_0x33f273['shift']());}};_0x279d56(++_0x5a5ec9);}(_0x5218,0x1be));var _0x8521=function(_0x317088,_0x11f3de){_0x317088=_0x317088-0x0;var _0x4007dd=_0x5218[_0x317088];return _0x4007dd;};'use strict';var multer=require(_0x8521('0x0'));var util=require(_0x8521('0x1'));var path=require(_0x8521('0x2'));var timeout=require(_0x8521('0x3'));var express=require(_0x8521('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x8521('0x5'));var controller=require(_0x8521('0x6'));router[_0x8521('0x7')]('/',auth[_0x8521('0x8')](),controller[_0x8521('0x9')]);router[_0x8521('0x7')](_0x8521('0xa'),auth['isAuthenticated'](),controller[_0x8521('0xb')]);router[_0x8521('0xc')](_0x8521('0xd'),auth[_0x8521('0x8')](),controller[_0x8521('0xe')]);router[_0x8521('0xc')]('/',auth[_0x8521('0x8')](),controller[_0x8521('0xf')]);router[_0x8521('0x10')](_0x8521('0xa'),auth[_0x8521('0x8')](),controller[_0x8521('0x11')]);router[_0x8521('0x12')](_0x8521('0xa'),auth[_0x8521('0x8')](),controller[_0x8521('0x13')]);module['exports']=router; \ No newline at end of file +var _0xe239=['util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./trunk.controller','index','get','/:id','isAuthenticated','show','post','clone','create','put','destroy','exports'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xe239,0xe4));var _0x9e23=function(_0x3af4af,_0x44042d){_0x3af4af=_0x3af4af-0x0;var _0x332fc9=_0xe239[_0x3af4af];return _0x332fc9;};'use strict';var multer=require('multer');var util=require(_0x9e23('0x0'));var path=require(_0x9e23('0x1'));var timeout=require(_0x9e23('0x2'));var express=require('express');var router=express[_0x9e23('0x3')]();var fs_extra=require(_0x9e23('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9e23('0x5'));var config=require(_0x9e23('0x6'));var controller=require(_0x9e23('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x9e23('0x8')]);router[_0x9e23('0x9')](_0x9e23('0xa'),auth[_0x9e23('0xb')](),controller[_0x9e23('0xc')]);router[_0x9e23('0xd')]('/:id/clone',auth['isAuthenticated'](),controller[_0x9e23('0xe')]);router[_0x9e23('0xd')]('/',auth[_0x9e23('0xb')](),controller[_0x9e23('0xf')]);router[_0x9e23('0x10')](_0x9e23('0xa'),auth[_0x9e23('0xb')](),controller['update']);router['delete'](_0x9e23('0xa'),auth[_0x9e23('0xb')](),controller[_0x9e23('0x11')]);module[_0x9e23('0x12')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index bcd2a11..4a438c0 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 _0xe6fe=['rfc2833','yes','nonat','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','originate','uac','uas','pai','fingerprint','certificate','active','passive','actpass','update,nonat','BOOLEAN','exports','STRING','name','ENUM','friend','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','transport','join','getDataValue','split','shortinfo'];(function(_0x388347,_0x111683){var _0x1f06b4=function(_0xd2027d){while(--_0xd2027d){_0x388347['push'](_0x388347['shift']());}};_0x1f06b4(++_0x111683);}(_0xe6fe,0xdf));var _0xee6f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe6fe[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0xee6f('0x0')]={'name':{'type':Sequelize[_0xee6f('0x1')],'allowNull':![],'unique':_0xee6f('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xee6f('0x3')](_0xee6f('0x4'),'user',_0xee6f('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xee6f('0x1')],'allowNull':![],'defaultValue':_0xee6f('0x6')},'callingpres':{'type':Sequelize[_0xee6f('0x3')](_0xee6f('0x7'),_0xee6f('0x8'),_0xee6f('0x9'),_0xee6f('0xa'),_0xee6f('0xb'),_0xee6f('0xc'),_0xee6f('0xd'),_0xee6f('0xe'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0xee6f('0x1')]},'remotesecret':{'type':Sequelize[_0xee6f('0x1')]},'transport':{'type':Sequelize[_0xee6f('0x1')],'defaultValue':_0xee6f('0xf'),'set':function(_0x4b07f2){this[_0xee6f('0x10')](_0xee6f('0x11'),_0x4b07f2?_0x4b07f2[_0xee6f('0x12')](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0xee6f('0x13')](_0xee6f('0x11'))[_0xee6f('0x14')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0xee6f('0x3')]('rfc2833','info',_0xee6f('0x15'),'inband','auto'),'defaultValue':_0xee6f('0x16')},'directmedia':{'type':Sequelize['ENUM'](_0xee6f('0x17'),'no',_0xee6f('0x18'),_0xee6f('0x19'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xee6f('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xee6f('0x1')]},'directmediadeny':{'type':Sequelize[_0xee6f('0x1')]},'nat':{'type':Sequelize[_0xee6f('0x1')],'defaultValue':_0xee6f('0x1a'),'set':function(_0x4d049d){this[_0xee6f('0x10')](_0xee6f('0x1b'),_0x4d049d?_0x4d049d[_0xee6f('0x12')](','):null);},'get':function(){return this[_0xee6f('0x13')](_0xee6f('0x1b'))?this['getDataValue'](_0xee6f('0x1b'))[_0xee6f('0x14')](','):null;},'comment':_0xee6f('0x1c')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xee6f('0x1')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xee6f('0x1')]},'language':{'type':Sequelize[_0xee6f('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xee6f('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xee6f('0x1')],'defaultValue':_0xee6f('0x1d')},'allow':{'type':Sequelize[_0xee6f('0x1')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0xcd82f6){this[_0xee6f('0x10')](_0xee6f('0x1e'),_0xcd82f6?_0xcd82f6['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xee6f('0x13')](_0xee6f('0x1e'))?this['getDataValue']('allow')['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xee6f('0x3')](_0xee6f('0x17'),'no')},'insecure':{'type':Sequelize[_0xee6f('0x1')],'defaultValue':'port,invite','set':function(_0x215166){this[_0xee6f('0x10')](_0xee6f('0x1f'),_0x215166?_0x215166[_0xee6f('0x12')](','):null);},'get':function(){return this[_0xee6f('0x13')]('insecure')?this['getDataValue'](_0xee6f('0x1f'))['split'](','):null;},'comment':_0xee6f('0x20')},'trustrpid':{'type':Sequelize[_0xee6f('0x3')](_0xee6f('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xee6f('0x3')](_0xee6f('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xee6f('0x17'),'no',_0xee6f('0x21'))},'promiscredir':{'type':Sequelize[_0xee6f('0x3')](_0xee6f('0x17'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0xee6f('0x17'),'no')},'accountcode':{'type':Sequelize[_0xee6f('0x22')](0xb)},'setvar':{'type':Sequelize[_0xee6f('0x1')]},'callerid':{'type':Sequelize[_0xee6f('0x1')],'defaultValue':_0xee6f('0x23')},'amaflags':{'type':Sequelize[_0xee6f('0x1')]},'callcounter':{'type':Sequelize['ENUM'](_0xee6f('0x17'),'no'),'defaultValue':_0xee6f('0x17')},'busylevel':{'type':Sequelize[_0xee6f('0x22')](0xb)},'allowoverlap':{'type':Sequelize[_0xee6f('0x3')]('yes','no')},'allowsubscribe':{'type':Sequelize['ENUM'](_0xee6f('0x17'),'no')},'allowtransfer':{'type':Sequelize['ENUM']('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xee6f('0x3')](_0xee6f('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0xee6f('0x1')]},'template':{'type':Sequelize[_0xee6f('0x1')]},'videosupport':{'type':Sequelize['ENUM'](_0xee6f('0x17'),'no',_0xee6f('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xee6f('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xee6f('0x17'),'no')},'mailbox':{'type':Sequelize[_0xee6f('0x1')]},'session_timers':{'type':Sequelize[_0xee6f('0x3')](_0xee6f('0x25'),'refuse',_0xee6f('0x26'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xee6f('0x22')](0xb)},'session_refresher':{'type':Sequelize[_0xee6f('0x3')](_0xee6f('0x27'),_0xee6f('0x28')),'defaultValue':_0xee6f('0x28')},'t38pt_usertpsource':{'type':Sequelize[_0xee6f('0x1')]},'regexten':{'type':Sequelize[_0xee6f('0x1')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0xee6f('0x1')]},'port':{'type':Sequelize[_0xee6f('0x22')](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0xee6f('0x1')]},'defaultuser':{'type':Sequelize[_0xee6f('0x1')]},'rtptimeout':{'type':Sequelize[_0xee6f('0x22')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xee6f('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0xee6f('0x17'),'no',_0xee6f('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0xee6f('0x22')](0xb)},'timerb':{'type':Sequelize[_0xee6f('0x22')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xee6f('0x1')]},'contactdeny':{'type':Sequelize[_0xee6f('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0xee6f('0x1')]},'use_q850_reason':{'type':Sequelize[_0xee6f('0x1')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xee6f('0x3')](_0xee6f('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xee6f('0x3')](_0xee6f('0x17'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0xee6f('0x17'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0xee6f('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0xee6f('0x3')](_0xee6f('0x17'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xee6f('0x17'),'no',_0xee6f('0x2a'),_0xee6f('0x2b'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0xee6f('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xee6f('0x1')]},'dtlscipher':{'type':Sequelize[_0xee6f('0x1')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xee6f('0x3')](_0xee6f('0x2c'),_0xee6f('0x2d'),_0xee6f('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xee6f('0x1')]},'usereqphone':{'type':Sequelize[_0xee6f('0x3')](_0xee6f('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xee6f('0x1')]},'recordofffeature':{'type':Sequelize[_0xee6f('0x1')]},'call_limit':{'type':Sequelize[_0xee6f('0x22')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xee6f('0x3')](_0xee6f('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0xee6f('0x3')](_0xee6f('0x17'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0xee6f('0x1')]},'parkinglot':{'type':Sequelize[_0xee6f('0x1')]},'description':{'type':Sequelize[_0xee6f('0x1')]},'host':{'type':Sequelize[_0xee6f('0x1')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xee6f('0x3')](_0xee6f('0x17'),'no',_0xee6f('0x18'),_0xee6f('0x19'),_0xee6f('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xee6f('0x1')]},'otherFields':{'type':Sequelize[_0xee6f('0x1')]},'active':{'type':Sequelize[_0xee6f('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xee6f('0x1')],'defaultValue':'no'}}; \ No newline at end of file +var _0x4712=['String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','setDataValue','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','refuse','originate','uac','uas','pai','fingerprint','certificate','active','passive','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','nonat','outgoing','yes','force_rport,comedia','nat'];(function(_0x2ff6f0,_0x5e2b92){var _0x3560cb=function(_0x124385){while(--_0x124385){_0x2ff6f0['push'](_0x2ff6f0['shift']());}};_0x3560cb(++_0x5e2b92);}(_0x4712,0x132));var _0x2471=function(_0x4e7bc5,_0x373eb1){_0x4e7bc5=_0x4e7bc5-0x0;var _0x523852=_0x4712[_0x4e7bc5];return _0x523852;};'use strict';var Sequelize=require(_0x2471('0x0'));module[_0x2471('0x1')]={'name':{'type':Sequelize[_0x2471('0x2')],'allowNull':![],'unique':_0x2471('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x2471('0x4')](_0x2471('0x5'),_0x2471('0x6'),_0x2471('0x7')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2471('0x8')},'callingpres':{'type':Sequelize['ENUM'](_0x2471('0x9'),_0x2471('0xa'),_0x2471('0xb'),'ALLOWED',_0x2471('0xc'),_0x2471('0xd'),_0x2471('0xe'),_0x2471('0xf'))},'deny':{'type':Sequelize[_0x2471('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x2471('0x2')]},'md5secret':{'type':Sequelize[_0x2471('0x2')]},'remotesecret':{'type':Sequelize[_0x2471('0x2')]},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x2471('0x10'),'set':function(_0x3ffb7b){this['setDataValue'](_0x2471('0x11'),_0x3ffb7b?_0x3ffb7b[_0x2471('0x12')](','):null);},'get':function(){return this[_0x2471('0x13')](_0x2471('0x11'))?this[_0x2471('0x13')](_0x2471('0x11'))['split'](','):null;},'comment':_0x2471('0x14')},'dtmfmode':{'type':Sequelize[_0x2471('0x4')](_0x2471('0x15'),_0x2471('0x16'),'shortinfo',_0x2471('0x17'),_0x2471('0x18')),'defaultValue':_0x2471('0x15')},'directmedia':{'type':Sequelize[_0x2471('0x4')]('yes','no',_0x2471('0x19'),'update',_0x2471('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x2471('0x4')](_0x2471('0x1b'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x2471('0x2')]},'directmediadeny':{'type':Sequelize[_0x2471('0x2')]},'nat':{'type':Sequelize[_0x2471('0x2')],'defaultValue':_0x2471('0x1c'),'set':function(_0x4e4a69){this['setDataValue']('nat',_0x4e4a69?_0x4e4a69['join'](','):null);},'get':function(){return this[_0x2471('0x13')](_0x2471('0x1d'))?this['getDataValue']('nat')['split'](','):null;},'comment':_0x2471('0x1e')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x2471('0x2')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x2471('0x2')]},'language':{'type':Sequelize[_0x2471('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x2471('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x2471('0x2')],'defaultValue':_0x2471('0x1f')},'allow':{'type':Sequelize[_0x2471('0x2')],'allowNull':![],'defaultValue':_0x2471('0x20'),'set':function(_0x283830){this['setDataValue'](_0x2471('0x21'),_0x283830?_0x283830['join'](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0x2471('0x13')]('allow')?this['getDataValue'](_0x2471('0x21'))[_0x2471('0x22')](';'):null;},'comment':_0x2471('0x23')},'autoframing':{'type':Sequelize[_0x2471('0x4')]('yes','no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x2471('0x24'),'set':function(_0x1facc9){this[_0x2471('0x25')](_0x2471('0x26'),_0x1facc9?_0x1facc9[_0x2471('0x12')](','):null);},'get':function(){return this[_0x2471('0x13')](_0x2471('0x26'))?this['getDataValue'](_0x2471('0x26'))[_0x2471('0x22')](','):null;},'comment':_0x2471('0x27')},'trustrpid':{'type':Sequelize['ENUM'](_0x2471('0x1b'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x2471('0x4')](_0x2471('0x1b'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x2471('0x4')](_0x2471('0x1b'),'no',_0x2471('0x28'))},'promiscredir':{'type':Sequelize[_0x2471('0x4')](_0x2471('0x1b'),'no')},'useclientcode':{'type':Sequelize[_0x2471('0x4')](_0x2471('0x1b'),'no')},'accountcode':{'type':Sequelize[_0x2471('0x29')](0xb)},'setvar':{'type':Sequelize[_0x2471('0x2')]},'callerid':{'type':Sequelize[_0x2471('0x2')],'defaultValue':_0x2471('0x2a')},'amaflags':{'type':Sequelize[_0x2471('0x2')]},'callcounter':{'type':Sequelize[_0x2471('0x4')](_0x2471('0x1b'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x2471('0x29')](0xb)},'allowoverlap':{'type':Sequelize[_0x2471('0x4')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x2471('0x4')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x2471('0x4')](_0x2471('0x1b'),'no')},'ignoresdpversion':{'type':Sequelize[_0x2471('0x4')](_0x2471('0x1b'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x2471('0x4')]('yes','no',_0x2471('0x2b')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x2471('0x4')](_0x2471('0x1b'),'no')},'mailbox':{'type':Sequelize[_0x2471('0x2')]},'session_timers':{'type':Sequelize[_0x2471('0x4')]('accept',_0x2471('0x2c'),_0x2471('0x2d'))},'session_expires':{'type':Sequelize[_0x2471('0x29')](0xb)},'session_minse':{'type':Sequelize[_0x2471('0x29')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x2471('0x2e'),_0x2471('0x2f')),'defaultValue':_0x2471('0x2f')},'t38pt_usertpsource':{'type':Sequelize[_0x2471('0x2')]},'regexten':{'type':Sequelize[_0x2471('0x2')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x2471('0x2')]},'port':{'type':Sequelize[_0x2471('0x29')](0x5)},'qualify':{'type':Sequelize[_0x2471('0x4')]('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x2471('0x29')](0xb)},'defaultip':{'type':Sequelize[_0x2471('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x2471('0x29')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x2471('0x29')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x2471('0x29')](0xb)},'sendrpid':{'type':Sequelize[_0x2471('0x4')](_0x2471('0x1b'),'no',_0x2471('0x30')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x2471('0x2')]},'callbackextension':{'type':Sequelize[_0x2471('0x2')]},'timert1':{'type':Sequelize[_0x2471('0x29')](0xb)},'timerb':{'type':Sequelize[_0x2471('0x29')](0xb)},'qualifyfreq':{'type':Sequelize[_0x2471('0x29')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x2471('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x2471('0x2')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x2471('0x29')](0xb)},'encryption':{'type':Sequelize[_0x2471('0x4')](_0x2471('0x1b'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no')},'force_avp':{'type':Sequelize[_0x2471('0x4')](_0x2471('0x1b'),'no')},'icesupport':{'type':Sequelize[_0x2471('0x4')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x2471('0x4')](_0x2471('0x1b'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x2471('0x1b'),'no',_0x2471('0x31'),_0x2471('0x32'))},'dtlsrekey':{'type':Sequelize[_0x2471('0x29')](0xb)},'dtlscertfile':{'type':Sequelize[_0x2471('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x2471('0x2')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x2471('0x2')]},'dtlscapath':{'type':Sequelize[_0x2471('0x2')]},'dtlssetup':{'type':Sequelize[_0x2471('0x4')](_0x2471('0x33'),_0x2471('0x34'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x2471('0x4')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x2471('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x2471('0x29')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x2471('0x4')](_0x2471('0x1b'),'no')},'subscribemwi':{'type':Sequelize[_0x2471('0x4')](_0x2471('0x1b'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x2471('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x2471('0x2')]},'description':{'type':Sequelize[_0x2471('0x2')]},'host':{'type':Sequelize[_0x2471('0x2')],'defaultValue':_0x2471('0x35')},'canreinvite':{'type':Sequelize[_0x2471('0x4')](_0x2471('0x1b'),'no',_0x2471('0x19'),'update',_0x2471('0x36')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x2471('0x37')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x2471('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 92f9057..de5a7d6 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 _0x9a19=['query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','show','include','find','clone','params','omit','updatedAt','body','createdAt','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','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','/etc/asterisk/sip_xcally_trunks.conf','registry','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','role','autoAssociation','findAll','readFileSync','writeFileSync','Reload','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','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','get','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','fieldName','type'];(function(_0x24c613,_0x1a0f9e){var _0x4b6160=function(_0x4fbdfa){while(--_0x4fbdfa){_0x24c613['push'](_0x24c613['shift']());}};_0x4b6160(++_0x1a0f9e);}(_0x9a19,0x114));var _0x99a1=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x9a19[_0x346737];return _0x1ade2e;};'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'];var jayson=require(_0x99a1('0x19'));var client=jayson[_0x99a1('0x1a')][_0x99a1('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0xf713b9,_0x40c19c,_0x3a865c,_0x47815e){return new BPromise(function(_0xe1a1f,_0x3c9ef4){var _0x39ee55=_0x47815e||client;return _0x39ee55['request'](_0xf713b9,_0x3a865c)[_0x99a1('0x1c')](function(_0x3e45d4){logger[_0x99a1('0x1d')](_0x99a1('0x1e'),_0x40c19c,_0x99a1('0x1f'));logger[_0x99a1('0x20')](_0x99a1('0x21'),_0x40c19c,'request\x20sent',JSON['stringify'](_0x3e45d4));if(_0x3e45d4[_0x99a1('0x22')]){if(_0x3e45d4[_0x99a1('0x22')][_0x99a1('0x23')]===0x1f4){logger[_0x99a1('0x22')](_0x99a1('0x1e'),_0x40c19c,_0x3e45d4[_0x99a1('0x22')][_0x99a1('0x24')]);return _0x3c9ef4(_0x3e45d4[_0x99a1('0x22')][_0x99a1('0x24')]);}logger[_0x99a1('0x22')](_0x99a1('0x1e'),_0x40c19c,_0x3e45d4['error'][_0x99a1('0x24')]);return _0xe1a1f(_0x3e45d4[_0x99a1('0x22')]['message']);}else{logger[_0x99a1('0x1d')]('Trunk,\x20%s,\x20%s',_0x40c19c,_0x99a1('0x1f'));_0xe1a1f(_0x3e45d4[_0x99a1('0x25')][_0x99a1('0x24')]);}})[_0x99a1('0x26')](function(_0x5a88c6){logger[_0x99a1('0x22')](_0x99a1('0x1e'),_0x40c19c,_0x5a88c6);_0x3c9ef4(_0x5a88c6);});});}function respondWithStatusCode(_0x483c17,_0x44df2d){_0x44df2d=_0x44df2d||0xcc;return function(_0x5b5dfa){if(_0x5b5dfa){return _0x483c17[_0x99a1('0x27')](_0x44df2d);}return _0x483c17[_0x99a1('0x28')](_0x44df2d)[_0x99a1('0x29')]();};}function respondWithResult(_0xdaa27d,_0x3c813){_0x3c813=_0x3c813||0xc8;return function(_0x491341){if(_0x491341){return _0xdaa27d['status'](_0x3c813)[_0x99a1('0x2a')](_0x491341);}};}function respondWithFilteredResult(_0x5dabd9,_0x5dc733){return function(_0xafea84){if(_0xafea84){var _0x440879=typeof _0x5dc733[_0x99a1('0x2b')]===_0x99a1('0x2c')&&typeof _0x5dc733[_0x99a1('0x2d')]===_0x99a1('0x2c');var _0x183037=_0xafea84['count'];var _0xf41b0d=_0x440879?0x0:_0x5dc733['offset'];var _0x255197=_0x440879?_0xafea84[_0x99a1('0x2e')]:_0x5dc733[_0x99a1('0x2b')]+_0x5dc733['limit'];var _0x371edf;if(_0x255197>=_0x183037){_0x255197=_0x183037;_0x371edf=0xc8;}else{_0x371edf=0xce;}_0x5dabd9[_0x99a1('0x28')](_0x371edf);return _0x5dabd9['set'](_0x99a1('0x2f'),_0xf41b0d+'-'+_0x255197+'/'+_0x183037)[_0x99a1('0x2a')](_0xafea84);}return null;};}function patchUpdates(_0x36aa34){return function(_0x303d1e){try{jsonpatch[_0x99a1('0x30')](_0x303d1e,_0x36aa34,!![]);}catch(_0x969f6e){return BPromise[_0x99a1('0x31')](_0x969f6e);}return _0x303d1e[_0x99a1('0x32')]();};}function saveUpdates(_0x52da8d,_0x4960e4){return function(_0x3fa342){if(_0x3fa342){return _0x3fa342['update'](_0x52da8d)[_0x99a1('0x1c')](function(_0x400581){return _0x400581;});}return null;};}function removeEntity(_0x5b1a79,_0xa5972b){return function(_0x3503d5){if(_0x3503d5){return _0x3503d5[_0x99a1('0x33')]()[_0x99a1('0x1c')](function(){var _0x13f4db=_0x3503d5[_0x99a1('0x34')]({'plain':!![]});var _0x3081cd=_0x99a1('0x35');return db[_0x99a1('0x36')][_0x99a1('0x33')]({'where':{'type':_0x3081cd,'resourceId':_0x13f4db['id']}})[_0x99a1('0x1c')](function(){return _0x3503d5;});})[_0x99a1('0x1c')](function(){_0x5b1a79[_0x99a1('0x28')](0xcc)[_0x99a1('0x29')]();});}};}function handleEntityNotFound(_0x55005e,_0x53fed5){return function(_0x46e3f2){if(!_0x46e3f2){_0x55005e[_0x99a1('0x27')](0x194);}return _0x46e3f2;};}function handleError(_0x416a36,_0x4131e0){_0x4131e0=_0x4131e0||0x1f4;return function(_0x2690bd){logger[_0x99a1('0x22')](_0x2690bd[_0x99a1('0x37')]);if(_0x2690bd['name']){delete _0x2690bd[_0x99a1('0x38')];}_0x416a36[_0x99a1('0x28')](_0x4131e0)['send'](_0x2690bd);};}exports[_0x99a1('0x39')]=function(_0x2d328c,_0x391afa){var _0x3cd1a0={},_0x430cbc={},_0x399fd4={'count':0x0,'rows':[]};var _0x30e8a9=_[_0x99a1('0x3a')](db[_0x99a1('0x3b')][_0x99a1('0x3c')],function(_0x1da3e7){return{'name':_0x1da3e7[_0x99a1('0x3d')],'type':_0x1da3e7[_0x99a1('0x3e')]['key']};});_0x430cbc['model']=_['map'](_0x30e8a9,_0x99a1('0x38'));_0x430cbc[_0x99a1('0x3f')]=_[_0x99a1('0x40')](_0x2d328c[_0x99a1('0x3f')]);_0x430cbc[_0x99a1('0x41')]=_['intersection'](_0x430cbc[_0x99a1('0x42')],_0x430cbc[_0x99a1('0x3f')]);_0x3cd1a0[_0x99a1('0x43')]=_['intersection'](_0x430cbc['model'],qs[_0x99a1('0x44')](_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x44')]));_0x3cd1a0['attributes']=_0x3cd1a0[_0x99a1('0x43')][_0x99a1('0x45')]?_0x3cd1a0[_0x99a1('0x43')]:_0x430cbc[_0x99a1('0x42')];if(!_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x46')](_0x99a1('0x47'))){_0x3cd1a0[_0x99a1('0x2d')]=qs[_0x99a1('0x2d')](_0x2d328c[_0x99a1('0x3f')]['limit']);_0x3cd1a0[_0x99a1('0x2b')]=qs[_0x99a1('0x2b')](_0x2d328c[_0x99a1('0x3f')]['offset']);}_0x3cd1a0[_0x99a1('0x48')]=qs['sort'](_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x49')]);_0x3cd1a0[_0x99a1('0x4a')]=qs[_0x99a1('0x41')](_[_0x99a1('0x4b')](_0x2d328c[_0x99a1('0x3f')],_0x430cbc['filters']),_0x30e8a9);if(_0x2d328c[_0x99a1('0x3f')]['filter']){_0x3cd1a0[_0x99a1('0x4a')]=_[_0x99a1('0x4c')](_0x3cd1a0[_0x99a1('0x4a')],{'$or':_[_0x99a1('0x3a')](_0x30e8a9,function(_0x3a0b44){if(_0x3a0b44[_0x99a1('0x3e')]!==_0x99a1('0x4d')){var _0x3861b6={};_0x3861b6[_0x3a0b44[_0x99a1('0x38')]]={'$like':'%'+_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x4e')]+'%'};return _0x3861b6;}})});}_0x3cd1a0=_['merge']({},_0x3cd1a0,_0x2d328c[_0x99a1('0x4f')]);var _0x330e3b={'where':_0x3cd1a0['where']};return db[_0x99a1('0x3b')][_0x99a1('0x2e')](_0x330e3b)[_0x99a1('0x1c')](function(_0x2e377b){_0x399fd4[_0x99a1('0x2e')]=_0x2e377b;if(_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x50')]){_0x3cd1a0['include']=[{'all':!![]}];}return db[_0x99a1('0x3b')]['findAll'](_0x3cd1a0);})[_0x99a1('0x1c')](function(_0x269798){_0x399fd4['rows']=_0x269798;return _0x399fd4;})['then'](respondWithFilteredResult(_0x391afa,_0x3cd1a0))[_0x99a1('0x26')](handleError(_0x391afa,null));};exports[_0x99a1('0x51')]=function(_0x462c15,_0x4519fb){var _0xee2b1b={'raw':![],'where':{'id':_0x462c15['params']['id']}},_0x597836={};_0x597836['model']=_[_0x99a1('0x40')](db[_0x99a1('0x3b')][_0x99a1('0x3c')]);_0x597836[_0x99a1('0x3f')]=_[_0x99a1('0x40')](_0x462c15[_0x99a1('0x3f')]);_0x597836[_0x99a1('0x41')]=_['intersection'](_0x597836[_0x99a1('0x42')],_0x597836[_0x99a1('0x3f')]);_0xee2b1b[_0x99a1('0x43')]=_['intersection'](_0x597836[_0x99a1('0x42')],qs['fields'](_0x462c15['query'][_0x99a1('0x44')]));_0xee2b1b[_0x99a1('0x43')]=_0xee2b1b[_0x99a1('0x43')][_0x99a1('0x45')]?_0xee2b1b[_0x99a1('0x43')]:_0x597836[_0x99a1('0x42')];if(_0x462c15[_0x99a1('0x3f')][_0x99a1('0x50')]){_0xee2b1b[_0x99a1('0x52')]=[{'all':!![]}];}_0xee2b1b=_['merge']({},_0xee2b1b,_0x462c15[_0x99a1('0x4f')]);return db['Trunk'][_0x99a1('0x53')](_0xee2b1b)[_0x99a1('0x1c')](handleEntityNotFound(_0x4519fb,null))['then'](respondWithResult(_0x4519fb,null))[_0x99a1('0x26')](handleError(_0x4519fb,null));};exports[_0x99a1('0x54')]=function(_0x469e10,_0x2b2d63){var _0x2800d5={'where':{'id':_0x469e10[_0x99a1('0x55')]['id']}},_0x1bff78={};_0x1bff78[_0x99a1('0x42')]=_[_0x99a1('0x40')](db[_0x99a1('0x3b')][_0x99a1('0x3c')]);_0x2800d5[_0x99a1('0x43')]=_['intersection'](_0x1bff78['model'],qs[_0x99a1('0x44')](_0x469e10[_0x99a1('0x3f')][_0x99a1('0x44')]));_0x2800d5[_0x99a1('0x43')]=_0x2800d5[_0x99a1('0x43')]['length']?_0x2800d5[_0x99a1('0x43')]:_0x1bff78[_0x99a1('0x42')];if(_0x469e10['query'][_0x99a1('0x50')]){_0x2800d5[_0x99a1('0x52')]=[{'all':!![]}];}_0x2800d5=_[_0x99a1('0x4c')]({},_0x2800d5,_0x469e10[_0x99a1('0x4f')]);return db[_0x99a1('0x3b')]['find'](_0x2800d5)[_0x99a1('0x1c')](handleEntityNotFound(_0x2b2d63,null))[_0x99a1('0x1c')](function(_0x1bb1cb){if(_0x1bb1cb){var _0x22811f=_0x1bb1cb[_0x99a1('0x34')]({'plain':!![]});_0x22811f=qs[_0x99a1('0x56')](_0x22811f,['id','createdAt',_0x99a1('0x57')]);_0x469e10[_0x99a1('0x58')]=_['omit'](_0x469e10[_0x99a1('0x58')],['id',_0x99a1('0x59'),_0x99a1('0x57')]);return db[_0x99a1('0x3b')][_0x99a1('0x5a')](_['merge'](_0x22811f,_0x469e10[_0x99a1('0x58')]),{'include':_0x469e10['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x38ce3c){var _0x3f7c16=_0x469e10['user']['get']({'plain':!![]});if(!_0x3f7c16)throw new Error(_0x99a1('0x5b'));if(_0x3f7c16['role']===_0x99a1('0x5c')){var _0x263db3=_0x38ce3c[_0x99a1('0x34')]({'plain':!![]});var _0x180c1e='Trunks';return db[_0x99a1('0x5d')][_0x99a1('0x53')]({'where':{'name':_0x180c1e,'userProfileId':_0x3f7c16[_0x99a1('0x5e')]},'raw':!![]})['then'](function(_0x3a62c6){if(_0x3a62c6&&_0x3a62c6['autoAssociation']===0x0){return db[_0x99a1('0x36')][_0x99a1('0x5a')]({'name':_0x263db3[_0x99a1('0x38')],'resourceId':_0x263db3['id'],'type':_0x3a62c6[_0x99a1('0x38')],'sectionId':_0x3a62c6['id']},{})[_0x99a1('0x1c')](function(){return _0x38ce3c;});}else{return _0x38ce3c;}})['catch'](function(_0x4d37f8){logger['error'](_0x99a1('0x5f'),_0x4d37f8);throw _0x4d37f8;});}return _0x38ce3c;});}})[_0x99a1('0x1c')](respondWithResult(_0x2b2d63,0xc9))['catch'](handleError(_0x2b2d63,null));};exports['create']=function(_0x1fe7af,_0x2f5587,_0x401c8f){var _0x509d4f;return db['Trunk'][_0x99a1('0x5a')](_0x1fe7af['body'],{'raw':!![]})[_0x99a1('0x1c')](function(_0x129690){_0x509d4f=_0x129690;return db[_0x99a1('0x3b')]['findAll']({'raw':!![]});})[_0x99a1('0x1c')](function(_0x28c7d8){var _0x4ac99e=fs['readFileSync'](path[_0x99a1('0x60')](config['root'],_0x99a1('0x61')),_0x99a1('0x62'));var _0x30a0a5=fs['readFileSync'](path[_0x99a1('0x60')](config[_0x99a1('0x63')],_0x99a1('0x64')),_0x99a1('0x62'));var _0x3d0ff6=ejs['render'](_0x4ac99e,{'trunks':_0x28c7d8||[]});fs['writeFileSync'](_0x99a1('0x65'),_0x3d0ff6);if(_0x509d4f[_0x99a1('0x66')]){var _0x1750d5=ejs[_0x99a1('0x67')](_0x30a0a5,{'trunks':_0x28c7d8||[]});fs['writeFileSync'](_0x99a1('0x68'),_0x1750d5);}})['then'](function(){return respondWithRpcPromise('Reload',_0x99a1('0x5a'),{'module':_0x99a1('0x69')});})[_0x99a1('0x1c')](function(){var _0x525969=_0x1fe7af[_0x99a1('0x5c')][_0x99a1('0x34')]({'plain':!![]});if(!_0x525969)throw new Error(_0x99a1('0x5b'));if(_0x525969[_0x99a1('0x6a')]===_0x99a1('0x5c')){var _0x4ae313=_0x509d4f[_0x99a1('0x34')]({'plain':!![]});return db[_0x99a1('0x5d')][_0x99a1('0x53')]({'where':{'name':_0x99a1('0x35'),'userProfileId':_0x525969[_0x99a1('0x5e')]},'raw':!![]})[_0x99a1('0x1c')](function(_0x5e42be){if(_0x5e42be&&_0x5e42be[_0x99a1('0x6b')]===0x0){return db[_0x99a1('0x36')][_0x99a1('0x5a')]({'name':_0x4ae313[_0x99a1('0x38')],'resourceId':_0x4ae313['id'],'type':_0x5e42be[_0x99a1('0x38')],'sectionId':_0x5e42be['id']},{})['then'](function(){return _0x509d4f;});}else{return _0x509d4f;}})[_0x99a1('0x26')](function(_0x68c944){logger[_0x99a1('0x22')](_0x99a1('0x5f'),_0x68c944);throw _0x68c944;});}return _0x509d4f;})[_0x99a1('0x1c')](respondWithResult(_0x2f5587,0xc9))[_0x99a1('0x26')](handleError(_0x2f5587,null));};exports['update']=function(_0xaa953e,_0x33d96b,_0x4a5617){var _0x56716a;return db[_0x99a1('0x3b')][_0x99a1('0x53')]({'where':{'id':_0xaa953e['params']['id']}})[_0x99a1('0x1c')](handleEntityNotFound(_0x33d96b,null))[_0x99a1('0x1c')](saveUpdates(_0xaa953e[_0x99a1('0x58')],null))[_0x99a1('0x1c')](function(_0x43156f){if(_0x43156f){_0x56716a=_0x43156f;return db[_0x99a1('0x3b')][_0x99a1('0x6c')]({'raw':!![]});}})[_0x99a1('0x1c')](function(_0x4260d7){if(_0x4260d7){var _0x3e099c=fs[_0x99a1('0x6d')](path[_0x99a1('0x60')](config[_0x99a1('0x63')],'server/files/templates/trunk.ejs'),_0x99a1('0x62'));var _0x5a9a7d=fs['readFileSync'](path[_0x99a1('0x60')](config[_0x99a1('0x63')],_0x99a1('0x64')),_0x99a1('0x62'));var _0xbbbe26=ejs[_0x99a1('0x67')](_0x3e099c,{'trunks':_0x4260d7||[]});fs[_0x99a1('0x6e')](_0x99a1('0x65'),_0xbbbe26);var _0x361ce6=ejs['render'](_0x5a9a7d,{'trunks':_0x4260d7||[]});fs[_0x99a1('0x6e')](_0x99a1('0x68'),_0x361ce6);return respondWithRpcPromise(_0x99a1('0x6f'),_0x99a1('0x70'),{'module':_0x99a1('0x69')});}return null;})[_0x99a1('0x1c')](function(_0x6dab29){if(_0x6dab29){return _0x56716a;}})[_0x99a1('0x1c')](respondWithResult(_0x33d96b,null))['catch'](handleError(_0x33d96b,null));};exports['destroy']=function(_0x51c289,_0x2dd29b,_0x353f25){var _0x53cdb3;return db[_0x99a1('0x3b')][_0x99a1('0x53')]({'where':{'id':_0x51c289[_0x99a1('0x55')]['id']}})[_0x99a1('0x1c')](handleEntityNotFound(_0x2dd29b,null))['then'](removeEntity(_0x2dd29b,null))[_0x99a1('0x1c')](function(){return db[_0x99a1('0x3b')][_0x99a1('0x6c')]({'raw':!![]});})[_0x99a1('0x1c')](function(_0x4e9fe9){var _0x24aa05=fs['readFileSync'](path['join'](config['root'],_0x99a1('0x61')),'utf8');var _0xb7744c=fs[_0x99a1('0x6d')](path[_0x99a1('0x60')](config[_0x99a1('0x63')],_0x99a1('0x64')),_0x99a1('0x62'));var _0x444e43=ejs['render'](_0x24aa05,{'trunks':_0x4e9fe9});var _0x4fcd65=ejs[_0x99a1('0x67')](_0xb7744c,{'trunks':_0x4e9fe9});fs[_0x99a1('0x6e')](_0x99a1('0x65'),_0x444e43);fs['writeFileSync'](_0x99a1('0x68'),_0x4fcd65);return respondWithRpcPromise(_0x99a1('0x6f'),_0x99a1('0x33'),{'module':'chan_sip.so'});})[_0x99a1('0x26')](handleError(_0x2dd29b,null));}; \ No newline at end of file +var _0x8d0e=['omit','updatedAt','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','reject','update','destroy','get','Trunks','stack','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','createdAt','body'];(function(_0x2ef0f7,_0x423785){var _0x24eab7=function(_0x19f822){while(--_0x19f822){_0x2ef0f7['push'](_0x2ef0f7['shift']());}};_0x24eab7(++_0x423785);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x6fd803,_0x46c95d){_0x6fd803=_0x6fd803-0x0;var _0x1608c0=_0x8d0e[_0x6fd803];return _0x1608c0;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe8d0('0x1b')][_0xe8d0('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x533b42,_0x2b640d,_0x4cbd26,_0x59b4b7){return new BPromise(function(_0x90a1ea,_0x2aa906){var _0x1aa725=_0x59b4b7||client;return _0x1aa725[_0xe8d0('0x1d')](_0x533b42,_0x4cbd26)[_0xe8d0('0x1e')](function(_0x7151c6){logger['info'](_0xe8d0('0x1f'),_0x2b640d,'request\x20sent');logger[_0xe8d0('0x20')](_0xe8d0('0x21'),_0x2b640d,_0xe8d0('0x22'),JSON['stringify'](_0x7151c6));if(_0x7151c6['error']){if(_0x7151c6['error'][_0xe8d0('0x23')]===0x1f4){logger[_0xe8d0('0x24')](_0xe8d0('0x1f'),_0x2b640d,_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);return _0x2aa906(_0x7151c6['error'][_0xe8d0('0x25')]);}logger[_0xe8d0('0x24')]('Trunk,\x20%s,\x20%s',_0x2b640d,_0x7151c6['error']['message']);return _0x90a1ea(_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);}else{logger[_0xe8d0('0x26')](_0xe8d0('0x1f'),_0x2b640d,_0xe8d0('0x22'));_0x90a1ea(_0x7151c6[_0xe8d0('0x27')][_0xe8d0('0x25')]);}})[_0xe8d0('0x28')](function(_0x32e39a){logger['error'](_0xe8d0('0x1f'),_0x2b640d,_0x32e39a);_0x2aa906(_0x32e39a);});});}function respondWithStatusCode(_0x9f747,_0x572c25){_0x572c25=_0x572c25||0xcc;return function(_0x106614){if(_0x106614){return _0x9f747[_0xe8d0('0x29')](_0x572c25);}return _0x9f747[_0xe8d0('0x2a')](_0x572c25)[_0xe8d0('0x2b')]();};}function respondWithResult(_0x146783,_0x149dfd){_0x149dfd=_0x149dfd||0xc8;return function(_0x31519b){if(_0x31519b){return _0x146783[_0xe8d0('0x2a')](_0x149dfd)[_0xe8d0('0x2c')](_0x31519b);}};}function respondWithFilteredResult(_0x2dee67,_0x264de4){return function(_0x539548){if(_0x539548){var _0x24982c=typeof _0x264de4[_0xe8d0('0x2d')]===_0xe8d0('0x2e')&&typeof _0x264de4['limit']===_0xe8d0('0x2e');var _0x343b08=_0x539548['count'];var _0x1519e2=_0x24982c?0x0:_0x264de4[_0xe8d0('0x2d')];var _0x11fcf2=_0x24982c?_0x539548[_0xe8d0('0x2f')]:_0x264de4[_0xe8d0('0x2d')]+_0x264de4['limit'];var _0x3cc292;if(_0x11fcf2>=_0x343b08){_0x11fcf2=_0x343b08;_0x3cc292=0xc8;}else{_0x3cc292=0xce;}_0x2dee67['status'](_0x3cc292);return _0x2dee67['set']('Content-Range',_0x1519e2+'-'+_0x11fcf2+'/'+_0x343b08)[_0xe8d0('0x2c')](_0x539548);}return null;};}function patchUpdates(_0x13cd4c){return function(_0x36ccec){try{jsonpatch['apply'](_0x36ccec,_0x13cd4c,!![]);}catch(_0x57e375){return BPromise[_0xe8d0('0x30')](_0x57e375);}return _0x36ccec['save']();};}function saveUpdates(_0x3b5d31,_0x383084){return function(_0x327004){if(_0x327004){return _0x327004[_0xe8d0('0x31')](_0x3b5d31)[_0xe8d0('0x1e')](function(_0x5bbc9e){return _0x5bbc9e;});}return null;};}function removeEntity(_0x1bee61,_0x4db53c){return function(_0x402e90){if(_0x402e90){return _0x402e90[_0xe8d0('0x32')]()['then'](function(){var _0x4547b6=_0x402e90[_0xe8d0('0x33')]({'plain':!![]});var _0x4c1347=_0xe8d0('0x34');return db['UserProfileResource'][_0xe8d0('0x32')]({'where':{'type':_0x4c1347,'resourceId':_0x4547b6['id']}})['then'](function(){return _0x402e90;});})[_0xe8d0('0x1e')](function(){_0x1bee61['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0xb2cdbf,_0x1e2430){return function(_0x320565){if(!_0x320565){_0xb2cdbf['sendStatus'](0x194);}return _0x320565;};}function handleError(_0x36a650,_0x354e19){_0x354e19=_0x354e19||0x1f4;return function(_0x20eec5){logger['error'](_0x20eec5[_0xe8d0('0x35')]);if(_0x20eec5[_0xe8d0('0x36')]){delete _0x20eec5[_0xe8d0('0x36')];}_0x36a650[_0xe8d0('0x2a')](_0x354e19)[_0xe8d0('0x37')](_0x20eec5);};}exports['index']=function(_0x5a969a,_0x1828c5){var _0x10970d={},_0x3d76d5={},_0x318106={'count':0x0,'rows':[]};var _0x23d72e=_[_0xe8d0('0x38')](db[_0xe8d0('0x39')]['rawAttributes'],function(_0x5dff14){return{'name':_0x5dff14[_0xe8d0('0x3a')],'type':_0x5dff14[_0xe8d0('0x3b')][_0xe8d0('0x3c')]};});_0x3d76d5[_0xe8d0('0x3d')]=_[_0xe8d0('0x38')](_0x23d72e,'name');_0x3d76d5[_0xe8d0('0x3e')]=_['keys'](_0x5a969a[_0xe8d0('0x3e')]);_0x3d76d5[_0xe8d0('0x3f')]=_[_0xe8d0('0x40')](_0x3d76d5['model'],_0x3d76d5[_0xe8d0('0x3e')]);_0x10970d[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x3d76d5[_0xe8d0('0x3d')],qs[_0xe8d0('0x42')](_0x5a969a['query']['fields']));_0x10970d['attributes']=_0x10970d['attributes'][_0xe8d0('0x43')]?_0x10970d['attributes']:_0x3d76d5[_0xe8d0('0x3d')];if(!_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x44')](_0xe8d0('0x45'))){_0x10970d[_0xe8d0('0x46')]=qs[_0xe8d0('0x46')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x46')]);_0x10970d['offset']=qs[_0xe8d0('0x2d')](_0x5a969a[_0xe8d0('0x3e')]['offset']);}_0x10970d['order']=qs[_0xe8d0('0x47')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x47')]);_0x10970d['where']=qs[_0xe8d0('0x3f')](_[_0xe8d0('0x48')](_0x5a969a['query'],_0x3d76d5[_0xe8d0('0x3f')]),_0x23d72e);if(_0x5a969a[_0xe8d0('0x3e')]['filter']){_0x10970d[_0xe8d0('0x49')]=_[_0xe8d0('0x4a')](_0x10970d[_0xe8d0('0x49')],{'$or':_[_0xe8d0('0x38')](_0x23d72e,function(_0x1d5815){if(_0x1d5815[_0xe8d0('0x3b')]!==_0xe8d0('0x4b')){var _0x1ce97d={};_0x1ce97d[_0x1d5815['name']]={'$like':'%'+_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x4c')]+'%'};return _0x1ce97d;}})});}_0x10970d=_[_0xe8d0('0x4a')]({},_0x10970d,_0x5a969a[_0xe8d0('0x4d')]);var _0x28d38b={'where':_0x10970d[_0xe8d0('0x49')]};return db[_0xe8d0('0x39')][_0xe8d0('0x2f')](_0x28d38b)[_0xe8d0('0x1e')](function(_0x2e2c05){_0x318106[_0xe8d0('0x2f')]=_0x2e2c05;if(_0x5a969a[_0xe8d0('0x3e')]['includeAll']){_0x10970d[_0xe8d0('0x4e')]=[{'all':!![]}];}return db[_0xe8d0('0x39')][_0xe8d0('0x4f')](_0x10970d);})[_0xe8d0('0x1e')](function(_0x34047c){_0x318106[_0xe8d0('0x50')]=_0x34047c;return _0x318106;})[_0xe8d0('0x1e')](respondWithFilteredResult(_0x1828c5,_0x10970d))['catch'](handleError(_0x1828c5,null));};exports[_0xe8d0('0x51')]=function(_0x424764,_0x151cf4){var _0x205933={'raw':![],'where':{'id':_0x424764[_0xe8d0('0x52')]['id']}},_0x4ed47f={};_0x4ed47f['model']=_[_0xe8d0('0x53')](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x4ed47f[_0xe8d0('0x3e')]=_[_0xe8d0('0x53')](_0x424764[_0xe8d0('0x3e')]);_0x4ed47f[_0xe8d0('0x3f')]=_['intersection'](_0x4ed47f[_0xe8d0('0x3d')],_0x4ed47f['query']);_0x205933['attributes']=_[_0xe8d0('0x40')](_0x4ed47f['model'],qs[_0xe8d0('0x42')](_0x424764['query'][_0xe8d0('0x42')]));_0x205933[_0xe8d0('0x41')]=_0x205933[_0xe8d0('0x41')][_0xe8d0('0x43')]?_0x205933['attributes']:_0x4ed47f[_0xe8d0('0x3d')];if(_0x424764[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x205933[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x205933=_[_0xe8d0('0x4a')]({},_0x205933,_0x424764['options']);return db[_0xe8d0('0x39')][_0xe8d0('0x56')](_0x205933)[_0xe8d0('0x1e')](handleEntityNotFound(_0x151cf4,null))['then'](respondWithResult(_0x151cf4,null))[_0xe8d0('0x28')](handleError(_0x151cf4,null));};exports['clone']=function(_0x56b4fa,_0x1bd329){var _0x37040a={'where':{'id':_0x56b4fa[_0xe8d0('0x52')]['id']}},_0x4e7b49={};_0x4e7b49[_0xe8d0('0x3d')]=_['keys'](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x37040a[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x4e7b49['model'],qs[_0xe8d0('0x42')](_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x42')]));_0x37040a[_0xe8d0('0x41')]=_0x37040a['attributes'][_0xe8d0('0x43')]?_0x37040a[_0xe8d0('0x41')]:_0x4e7b49[_0xe8d0('0x3d')];if(_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x37040a[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x37040a=_['merge']({},_0x37040a,_0x56b4fa['options']);return db[_0xe8d0('0x39')]['find'](_0x37040a)[_0xe8d0('0x1e')](handleEntityNotFound(_0x1bd329,null))[_0xe8d0('0x1e')](function(_0x4c0d4c){if(_0x4c0d4c){var _0x5ac1ae=_0x4c0d4c[_0xe8d0('0x33')]({'plain':!![]});_0x5ac1ae=qs['omit'](_0x5ac1ae,['id',_0xe8d0('0x57'),'updatedAt']);_0x56b4fa[_0xe8d0('0x58')]=_[_0xe8d0('0x59')](_0x56b4fa[_0xe8d0('0x58')],['id','createdAt',_0xe8d0('0x5a')]);return db[_0xe8d0('0x39')]['create'](_[_0xe8d0('0x4a')](_0x5ac1ae,_0x56b4fa['body']),{'include':_0x56b4fa[_0xe8d0('0x3e')]['includeAll']?[{'all':!![]}]:undefined})[_0xe8d0('0x1e')](function(_0x17afc2){var _0x29467d=_0x56b4fa[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x29467d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29467d['role']===_0xe8d0('0x5b')){var _0x55a2df=_0x17afc2[_0xe8d0('0x33')]({'plain':!![]});var _0x18b655=_0xe8d0('0x34');return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':_0x18b655,'userProfileId':_0x29467d[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0x20647d){if(_0x20647d&&_0x20647d[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')][_0xe8d0('0x60')]({'name':_0x55a2df[_0xe8d0('0x36')],'resourceId':_0x55a2df['id'],'type':_0x20647d[_0xe8d0('0x36')],'sectionId':_0x20647d['id']},{})[_0xe8d0('0x1e')](function(){return _0x17afc2;});}else{return _0x17afc2;}})[_0xe8d0('0x28')](function(_0x4a68d5){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x4a68d5);throw _0x4a68d5;});}return _0x17afc2;});}})[_0xe8d0('0x1e')](respondWithResult(_0x1bd329,0xc9))[_0xe8d0('0x28')](handleError(_0x1bd329,null));};exports[_0xe8d0('0x60')]=function(_0x4848d4,_0x2eeb92,_0x1d30c0){var _0x45b42b;return db[_0xe8d0('0x39')][_0xe8d0('0x60')](_0x4848d4[_0xe8d0('0x58')],{'raw':!![]})[_0xe8d0('0x1e')](function(_0x13ceb4){_0x45b42b=_0x13ceb4;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})[_0xe8d0('0x1e')](function(_0xdb3e53){var _0x556d7e=fs['readFileSync'](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x56761c=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x1b5df8=ejs[_0xe8d0('0x68')](_0x556d7e,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x1b5df8);if(_0x45b42b[_0xe8d0('0x6b')]){var _0xb078d8=ejs[_0xe8d0('0x68')](_0x56761c,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0xb078d8);}})[_0xe8d0('0x1e')](function(){return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x60'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x1e')](function(){var _0x500fb0=_0x4848d4[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x500fb0)throw new Error(_0xe8d0('0x6f'));if(_0x500fb0['role']===_0xe8d0('0x5b')){var _0x4c54c4=_0x45b42b[_0xe8d0('0x33')]({'plain':!![]});return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':'Trunks','userProfileId':_0x500fb0[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0xc94cd3){if(_0xc94cd3&&_0xc94cd3[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')]['create']({'name':_0x4c54c4[_0xe8d0('0x36')],'resourceId':_0x4c54c4['id'],'type':_0xc94cd3[_0xe8d0('0x36')],'sectionId':_0xc94cd3['id']},{})[_0xe8d0('0x1e')](function(){return _0x45b42b;});}else{return _0x45b42b;}})[_0xe8d0('0x28')](function(_0x252f0e){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x252f0e);throw _0x252f0e;});}return _0x45b42b;})[_0xe8d0('0x1e')](respondWithResult(_0x2eeb92,0xc9))['catch'](handleError(_0x2eeb92,null));};exports[_0xe8d0('0x31')]=function(_0x31b9d3,_0x14d722,_0x2aa6fc){var _0x4d5997;return db[_0xe8d0('0x39')][_0xe8d0('0x56')]({'where':{'id':_0x31b9d3[_0xe8d0('0x52')]['id']}})['then'](handleEntityNotFound(_0x14d722,null))[_0xe8d0('0x1e')](saveUpdates(_0x31b9d3['body'],null))[_0xe8d0('0x1e')](function(_0x478eb2){if(_0x478eb2){_0x4d5997=_0x478eb2;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});}})[_0xe8d0('0x1e')](function(_0xa90bdc){if(_0xa90bdc){var _0x87aa04=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2eaf2f=fs[_0xe8d0('0x65')](path['join'](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x761e97=ejs[_0xe8d0('0x68')](_0x87aa04,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x761e97);var _0x605b5f=ejs[_0xe8d0('0x68')](_0x2eaf2f,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')]('/etc/asterisk/sip_xcally_registers.conf',_0x605b5f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x31'),{'module':_0xe8d0('0x6e')});}return null;})[_0xe8d0('0x1e')](function(_0x255e4b){if(_0x255e4b){return _0x4d5997;}})['then'](respondWithResult(_0x14d722,null))['catch'](handleError(_0x14d722,null));};exports[_0xe8d0('0x32')]=function(_0x5c8c7d,_0x3fb7c8,_0x16098b){var _0x363b3a;return db['Trunk'][_0xe8d0('0x56')]({'where':{'id':_0x5c8c7d['params']['id']}})[_0xe8d0('0x1e')](handleEntityNotFound(_0x3fb7c8,null))[_0xe8d0('0x1e')](removeEntity(_0x3fb7c8,null))[_0xe8d0('0x1e')](function(){return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})['then'](function(_0x58034d){var _0xfbacce=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2790f=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x142db4=ejs[_0xe8d0('0x68')](_0xfbacce,{'trunks':_0x58034d});var _0x4a568f=ejs['render'](_0x2790f,{'trunks':_0x58034d});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x142db4);fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0x4a568f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x32'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x28')](handleError(_0x3fb7c8,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index eea7668..98fbac3 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 _0x5e75=['tools_trunks','util','../../config/logger','api','moment','bluebird','request-promise','./trunk.attributes','define'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x5e75,0x160));var _0x55e7=function(_0x3492c1,_0x27805d){_0x3492c1=_0x3492c1-0x0;var _0xa8b640=_0x5e75[_0x3492c1];return _0xa8b640;};'use strict';var _=require('lodash');var util=require(_0x55e7('0x0'));var logger=require(_0x55e7('0x1'))(_0x55e7('0x2'));var moment=require(_0x55e7('0x3'));var BPromise=require(_0x55e7('0x4'));var rp=require(_0x55e7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x55e7('0x6'));module['exports']=function(_0x493b8b,_0x529f91){return _0x493b8b[_0x55e7('0x7')]('Trunk',attributes,{'tableName':_0x55e7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec0b=['rimraf','../../config/environment','./trunk.attributes','exports','define','tools_trunks','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x2e0ec5,_0x4496a7){var _0x5ca5cd=function(_0x3ae985){while(--_0x3ae985){_0x2e0ec5['push'](_0x2e0ec5['shift']());}};_0x5ca5cd(++_0x4496a7);}(_0xec0b,0xf0));var _0xbec0=function(_0x1902e2,_0x2de9df){_0x1902e2=_0x1902e2-0x0;var _0x47213f=_0xec0b[_0x1902e2];return _0x47213f;};'use strict';var _=require(_0xbec0('0x0'));var util=require(_0xbec0('0x1'));var logger=require(_0xbec0('0x2'))(_0xbec0('0x3'));var moment=require('moment');var BPromise=require(_0xbec0('0x4'));var rp=require(_0xbec0('0x5'));var fs=require('fs');var path=require(_0xbec0('0x6'));var rimraf=require(_0xbec0('0x7'));var config=require(_0xbec0('0x8'));var attributes=require(_0xbec0('0x9'));module[_0xbec0('0xa')]=function(_0x369267,_0xf7794d){return _0x369267[_0xbec0('0xb')]('Trunk',attributes,{'tableName':_0xbec0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index d725ba0..7a48cc5 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 _0x149f=['code','message','result','GetTrunk','Trunk','findAll','options','limit','include','map','model','attributes','catch','ShowTrunk','where','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x149f,0xa8));var _0xf149=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x149f[_0x1beef3];return _0x5af964;};'use strict';var _=require(_0xf149('0x0'));var util=require(_0xf149('0x1'));var moment=require(_0xf149('0x2'));var BPromise=require(_0xf149('0x3'));var rs=require(_0xf149('0x4'));var fs=require('fs');var Redis=require(_0xf149('0x5'));var db=require(_0xf149('0x6'))['db'];var utils=require(_0xf149('0x7'));var logger=require(_0xf149('0x8'))(_0xf149('0x9'));var config=require(_0xf149('0xa'));var jayson=require(_0xf149('0xb'));var client=jayson[_0xf149('0xc')][_0xf149('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xdc579,_0x516db7,_0xdb321a){return new BPromise(function(_0x4b21d7,_0x5a068e){return client[_0xf149('0xe')](_0xdc579,_0xdb321a)[_0xf149('0xf')](function(_0x5cdf1e){logger[_0xf149('0x10')](_0xf149('0x11'),_0x516db7,'request\x20sent');logger['debug'](_0xf149('0x12'),_0x516db7,_0xf149('0x13'),JSON[_0xf149('0x14')](_0x5cdf1e));if(_0x5cdf1e[_0xf149('0x15')]){if(_0x5cdf1e[_0xf149('0x15')][_0xf149('0x16')]===0x1f4){logger[_0xf149('0x15')](_0xf149('0x11'),_0x516db7,_0x5cdf1e[_0xf149('0x15')][_0xf149('0x17')]);return _0x5a068e(_0x5cdf1e[_0xf149('0x15')][_0xf149('0x17')]);}logger[_0xf149('0x15')](_0xf149('0x11'),_0x516db7,_0x5cdf1e[_0xf149('0x15')][_0xf149('0x17')]);return _0x4b21d7(_0x5cdf1e[_0xf149('0x15')][_0xf149('0x17')]);}else{logger[_0xf149('0x10')](_0xf149('0x11'),_0x516db7,_0xf149('0x13'));_0x4b21d7(_0x5cdf1e[_0xf149('0x18')]['message']);}})['catch'](function(_0x362391){logger['error'](_0xf149('0x11'),_0x516db7,_0x362391);_0x5a068e(_0x362391);});});}exports[_0xf149('0x19')]=function(_0x3e8d35){var _0xcfe8a7=this;return new Promise(function(_0x1178d2,_0xd217cb){return db[_0xf149('0x1a')][_0xf149('0x1b')]({'raw':_0x3e8d35[_0xf149('0x1c')]?_0x3e8d35[_0xf149('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3e8d35[_0xf149('0x1c')]?_0x3e8d35[_0xf149('0x1c')]['where']||null:null,'attributes':_0x3e8d35[_0xf149('0x1c')]?_0x3e8d35[_0xf149('0x1c')]['attributes']||null:null,'limit':_0x3e8d35[_0xf149('0x1c')]?_0x3e8d35['options'][_0xf149('0x1d')]||null:null,'include':_0x3e8d35[_0xf149('0x1c')]?_0x3e8d35['options'][_0xf149('0x1e')]?_[_0xf149('0x1f')](_0x3e8d35[_0xf149('0x1c')][_0xf149('0x1e')],function(_0x9bd06f){return{'model':db[_0x9bd06f[_0xf149('0x20')]],'as':_0x9bd06f['as'],'attributes':_0x9bd06f[_0xf149('0x21')],'include':_0x9bd06f[_0xf149('0x1e')]?_[_0xf149('0x1f')](_0x9bd06f[_0xf149('0x1e')],function(_0x1a6c08){return{'model':db[_0x1a6c08['model']],'as':_0x1a6c08['as'],'attributes':_0x1a6c08['attributes'],'include':_0x1a6c08[_0xf149('0x1e')]?_[_0xf149('0x1f')](_0x1a6c08[_0xf149('0x1e')],function(_0x381bc0){return{'model':db[_0x381bc0[_0xf149('0x20')]],'as':_0x381bc0['as'],'attributes':_0x381bc0[_0xf149('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x495377){logger[_0xf149('0x10')]('GetTrunk',_0x3e8d35);logger['debug']('GetTrunk',_0x3e8d35,JSON[_0xf149('0x14')](_0x495377));_0x1178d2(_0x495377);})[_0xf149('0x22')](function(_0x246a95){logger['error'](_0xf149('0x19'),_0x246a95[_0xf149('0x17')],_0x3e8d35);_0xd217cb(_0xcfe8a7[_0xf149('0x15')](0x1f4,_0x246a95[_0xf149('0x17')]));});});};exports[_0xf149('0x23')]=function(_0x57516a){var _0x53f662=this;return new Promise(function(_0x8e42cf,_0x36b336){return db[_0xf149('0x1a')]['find']({'raw':_0x57516a[_0xf149('0x1c')]?_0x57516a['options']['raw']===undefined?!![]:![]:!![],'where':_0x57516a[_0xf149('0x1c')]?_0x57516a['options'][_0xf149('0x24')]||null:null,'attributes':_0x57516a['options']?_0x57516a[_0xf149('0x1c')][_0xf149('0x21')]||null:null,'include':_0x57516a[_0xf149('0x1c')]?_0x57516a[_0xf149('0x1c')][_0xf149('0x1e')]?_[_0xf149('0x1f')](_0x57516a[_0xf149('0x1c')][_0xf149('0x1e')],function(_0x4395c2){return{'model':db[_0x4395c2[_0xf149('0x20')]],'as':_0x4395c2['as'],'attributes':_0x4395c2[_0xf149('0x21')],'include':_0x4395c2['include']?_['map'](_0x4395c2[_0xf149('0x1e')],function(_0x2ac99e){return{'model':db[_0x2ac99e['model']],'as':_0x2ac99e['as'],'attributes':_0x2ac99e['attributes'],'include':_0x2ac99e[_0xf149('0x1e')]?_[_0xf149('0x1f')](_0x2ac99e[_0xf149('0x1e')],function(_0x1126f2){return{'model':db[_0x1126f2[_0xf149('0x20')]],'as':_0x1126f2['as'],'attributes':_0x1126f2[_0xf149('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf149('0xf')](function(_0x11e2b9){logger[_0xf149('0x10')](_0xf149('0x23'),_0x57516a);logger[_0xf149('0x25')](_0xf149('0x23'),_0x57516a,JSON[_0xf149('0x14')](_0x11e2b9));_0x8e42cf(_0x11e2b9);})[_0xf149('0x22')](function(_0x101029){logger['error']('ShowTrunk',_0x101029['message'],_0x57516a);_0x36b336(_0x53f662['error'](0x1f4,_0x101029[_0xf149('0x17')]));});});}; \ No newline at end of file +var _0x6250=['ShowTrunk','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','request\x20sent','stringify','error','code','Trunk,\x20%s,\x20%s','message','result','catch','GetTrunk','Trunk','findAll','options','where','attributes','limit','include','map','model','debug','find','raw'];(function(_0x214359,_0x5b8a69){var _0x469780=function(_0x2f8afd){while(--_0x2f8afd){_0x214359['push'](_0x214359['shift']());}};_0x469780(++_0x5b8a69);}(_0x6250,0x91));var _0x0625=function(_0x48506c,_0x20a172){_0x48506c=_0x48506c-0x0;var _0xf69e65=_0x6250[_0x48506c];return _0xf69e65;};'use strict';var _=require(_0x0625('0x0'));var util=require(_0x0625('0x1'));var moment=require(_0x0625('0x2'));var BPromise=require(_0x0625('0x3'));var rs=require(_0x0625('0x4'));var fs=require('fs');var Redis=require(_0x0625('0x5'));var db=require(_0x0625('0x6'))['db'];var utils=require(_0x0625('0x7'));var logger=require('../../config/logger')(_0x0625('0x8'));var config=require('../../config/environment');var jayson=require(_0x0625('0x9'));var client=jayson[_0x0625('0xa')][_0x0625('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48bea1,_0x11f795,_0x4acf86){return new BPromise(function(_0x5d53b8,_0x5ddfed){return client['request'](_0x48bea1,_0x4acf86)[_0x0625('0xc')](function(_0x439457){logger[_0x0625('0xd')]('Trunk,\x20%s,\x20%s',_0x11f795,'request\x20sent');logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x11f795,_0x0625('0xe'),JSON[_0x0625('0xf')](_0x439457));if(_0x439457['error']){if(_0x439457[_0x0625('0x10')][_0x0625('0x11')]===0x1f4){logger[_0x0625('0x10')](_0x0625('0x12'),_0x11f795,_0x439457[_0x0625('0x10')][_0x0625('0x13')]);return _0x5ddfed(_0x439457[_0x0625('0x10')][_0x0625('0x13')]);}logger['error'](_0x0625('0x12'),_0x11f795,_0x439457[_0x0625('0x10')][_0x0625('0x13')]);return _0x5d53b8(_0x439457[_0x0625('0x10')][_0x0625('0x13')]);}else{logger[_0x0625('0xd')](_0x0625('0x12'),_0x11f795,_0x0625('0xe'));_0x5d53b8(_0x439457[_0x0625('0x14')]['message']);}})[_0x0625('0x15')](function(_0x2d5e47){logger['error'](_0x0625('0x12'),_0x11f795,_0x2d5e47);_0x5ddfed(_0x2d5e47);});});}exports[_0x0625('0x16')]=function(_0xb7b942){var _0x51bb07=this;return new Promise(function(_0x20eb30,_0x4e8c7b){return db[_0x0625('0x17')][_0x0625('0x18')]({'raw':_0xb7b942[_0x0625('0x19')]?_0xb7b942['options']['raw']===undefined?!![]:![]:!![],'where':_0xb7b942[_0x0625('0x19')]?_0xb7b942[_0x0625('0x19')][_0x0625('0x1a')]||null:null,'attributes':_0xb7b942[_0x0625('0x19')]?_0xb7b942[_0x0625('0x19')][_0x0625('0x1b')]||null:null,'limit':_0xb7b942[_0x0625('0x19')]?_0xb7b942[_0x0625('0x19')][_0x0625('0x1c')]||null:null,'include':_0xb7b942[_0x0625('0x19')]?_0xb7b942[_0x0625('0x19')][_0x0625('0x1d')]?_[_0x0625('0x1e')](_0xb7b942[_0x0625('0x19')][_0x0625('0x1d')],function(_0x3d715d){return{'model':db[_0x3d715d[_0x0625('0x1f')]],'as':_0x3d715d['as'],'attributes':_0x3d715d[_0x0625('0x1b')],'include':_0x3d715d['include']?_['map'](_0x3d715d['include'],function(_0x18c295){return{'model':db[_0x18c295[_0x0625('0x1f')]],'as':_0x18c295['as'],'attributes':_0x18c295['attributes'],'include':_0x18c295[_0x0625('0x1d')]?_[_0x0625('0x1e')](_0x18c295[_0x0625('0x1d')],function(_0x5617be){return{'model':db[_0x5617be[_0x0625('0x1f')]],'as':_0x5617be['as'],'attributes':_0x5617be[_0x0625('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0625('0xc')](function(_0x5e61ee){logger[_0x0625('0xd')](_0x0625('0x16'),_0xb7b942);logger[_0x0625('0x20')](_0x0625('0x16'),_0xb7b942,JSON['stringify'](_0x5e61ee));_0x20eb30(_0x5e61ee);})[_0x0625('0x15')](function(_0x5cab6a){logger[_0x0625('0x10')]('GetTrunk',_0x5cab6a[_0x0625('0x13')],_0xb7b942);_0x4e8c7b(_0x51bb07['error'](0x1f4,_0x5cab6a[_0x0625('0x13')]));});});};exports['ShowTrunk']=function(_0x691a75){var _0x4533fc=this;return new Promise(function(_0xed012a,_0x392409){return db[_0x0625('0x17')][_0x0625('0x21')]({'raw':_0x691a75[_0x0625('0x19')]?_0x691a75[_0x0625('0x19')][_0x0625('0x22')]===undefined?!![]:![]:!![],'where':_0x691a75[_0x0625('0x19')]?_0x691a75[_0x0625('0x19')][_0x0625('0x1a')]||null:null,'attributes':_0x691a75[_0x0625('0x19')]?_0x691a75[_0x0625('0x19')][_0x0625('0x1b')]||null:null,'include':_0x691a75[_0x0625('0x19')]?_0x691a75[_0x0625('0x19')][_0x0625('0x1d')]?_[_0x0625('0x1e')](_0x691a75['options'][_0x0625('0x1d')],function(_0x1f4b75){return{'model':db[_0x1f4b75['model']],'as':_0x1f4b75['as'],'attributes':_0x1f4b75[_0x0625('0x1b')],'include':_0x1f4b75[_0x0625('0x1d')]?_[_0x0625('0x1e')](_0x1f4b75[_0x0625('0x1d')],function(_0x33c620){return{'model':db[_0x33c620[_0x0625('0x1f')]],'as':_0x33c620['as'],'attributes':_0x33c620[_0x0625('0x1b')],'include':_0x33c620['include']?_[_0x0625('0x1e')](_0x33c620[_0x0625('0x1d')],function(_0x38f860){return{'model':db[_0x38f860[_0x0625('0x1f')]],'as':_0x38f860['as'],'attributes':_0x38f860[_0x0625('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0625('0xc')](function(_0x2db488){logger[_0x0625('0xd')](_0x0625('0x23'),_0x691a75);logger[_0x0625('0x20')]('ShowTrunk',_0x691a75,JSON[_0x0625('0xf')](_0x2db488));_0xed012a(_0x2db488);})[_0x0625('0x15')](function(_0x5e9aa8){logger[_0x0625('0x10')](_0x0625('0x23'),_0x5e9aa8[_0x0625('0x13')],_0x691a75);_0x392409(_0x4533fc['error'](0x1f4,_0x5e9aa8[_0x0625('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index b3342e9..75f42a4 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9fdd=['exports','express','Router','../../components/auth/service','./user-setting.controller','/:id','isAuthenticated','update'];(function(_0x5d5373,_0x10cd97){var _0x360a4a=function(_0x59f281){while(--_0x59f281){_0x5d5373['push'](_0x5d5373['shift']());}};_0x360a4a(++_0x10cd97);}(_0x9fdd,0x121));var _0xd9fd=function(_0x168630,_0x3dc280){_0x168630=_0x168630-0x0;var _0x1cdc51=_0x9fdd[_0x168630];return _0x1cdc51;};'use strict';var express=require(_0xd9fd('0x0'));var router=express[_0xd9fd('0x1')]();var auth=require(_0xd9fd('0x2'));var controller=require(_0xd9fd('0x3'));router['put'](_0xd9fd('0x4'),auth[_0xd9fd('0x5')](),controller[_0xd9fd('0x6')]);module[_0xd9fd('0x7')]=router; \ No newline at end of file +var _0x6e48=['../../components/auth/service','put','/:id','isAuthenticated','update','express','Router'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6e48,0xd0));var _0x86e4=function(_0x3efed3,_0x354aef){_0x3efed3=_0x3efed3-0x0;var _0x5b885e=_0x6e48[_0x3efed3];return _0x5b885e;};'use strict';var express=require(_0x86e4('0x0'));var router=express[_0x86e4('0x1')]();var auth=require(_0x86e4('0x2'));var controller=require('./user-setting.controller');router[_0x86e4('0x3')](_0x86e4('0x4'),auth[_0x86e4('0x5')](),controller[_0x86e4('0x6')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index 0205e72..3806867 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6bf9=['ENUM','BOOLEAN','DATE','INTEGER','UserId','sequelize','error','warning','debug','exports'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x6bf9,0xff));var _0x96bf=function(_0x15942a,_0x13b58c){_0x15942a=_0x15942a-0x0;var _0x36a9fb=_0x6bf9[_0x15942a];return _0x36a9fb;};'use strict';var Sequelize=require(_0x96bf('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0x96bf('0x1'),_0x96bf('0x2'),'info',_0x96bf('0x3')];module[_0x96bf('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0x96bf('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x96bf('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0x96bf('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x96bf('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x96bf('0x8')],'unique':_0x96bf('0x9')}}; \ No newline at end of file +var _0x53ec=['warning','debug','exports','ENUM','BOOLEAN','TEXT','DATE','UserId','sequelize','error'];(function(_0x1b2569,_0x144dbf){var _0x4ace10=function(_0x37e42d){while(--_0x37e42d){_0x1b2569['push'](_0x1b2569['shift']());}};_0x4ace10(++_0x144dbf);}(_0x53ec,0x8a));var _0xc53e=function(_0x4ef8bc,_0x5eb00d){_0x4ef8bc=_0x4ef8bc-0x0;var _0x5d4d56=_0x53ec[_0x4ef8bc];return _0x5d4d56;};'use strict';var Sequelize=require(_0xc53e('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xc53e('0x1'),_0xc53e('0x2'),'info',_0xc53e('0x3')];module[_0xc53e('0x4')]={'clientSideLoggingLevel':{'type':Sequelize[_0xc53e('0x5')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xc53e('0x6')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xc53e('0x7')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xc53e('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0xc53e('0x9')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index aba5cc1..e55dcc9 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14f=['defaults','localhost','status','json','update','sendStatus','error','name','send','role','admin','Unauthorized','Invalid\x20user\x20setting\x20id','find','params','then','body','catch','lodash','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket'];(function(_0xff72e8,_0x5dca7c){var _0x39e303=function(_0xc39f90){while(--_0xc39f90){_0xff72e8['push'](_0xff72e8['shift']());}};_0x39e303(++_0x5dca7c);}(_0xe14f,0xea));var _0xfe14=function(_0x563678,_0x594017){_0x563678=_0x563678-0x0;var _0x2abae1=_0xe14f[_0x563678];return _0x2abae1;};'use strict';var _=require(_0xfe14('0x0'));var Redis=require(_0xfe14('0x1'));var logger=require(_0xfe14('0x2'))(_0xfe14('0x3'));var config=require(_0xfe14('0x4'));var db=require(_0xfe14('0x5'))['db'];var socket=require(_0xfe14('0x6'))(new Redis(config[_0xfe14('0x7')]));require(_0xfe14('0x8'))['register'](socket);config['redis']=_[_0xfe14('0x9')](config['redis'],{'host':_0xfe14('0xa'),'port':0x18eb});function respondWithResult(_0x174635,_0x14e1c8){_0x14e1c8=_0x14e1c8||0xc8;return function(_0x350c85){if(_0x350c85){return _0x174635[_0xfe14('0xb')](_0x14e1c8)[_0xfe14('0xc')](_0x350c85);}};}function saveUpdates(_0x2f92e4){return function(_0x396b63){if(_0x396b63){return _0x396b63[_0xfe14('0xd')](_0x2f92e4)['then'](function(_0x2a85b0){return _0x2a85b0;});}return null;};}function handleEntityNotFound(_0x3a8713){return function(_0x2bc525){if(!_0x2bc525){_0x3a8713[_0xfe14('0xe')](0x194);}return _0x2bc525;};}function handleError(_0x32f55d,_0x618719){_0x618719=_0x618719||0x1f4;return function(_0x4ae9a6){logger[_0xfe14('0xf')](_0x4ae9a6['stack']);if(_0x4ae9a6[_0xfe14('0x10')]){delete _0x4ae9a6[_0xfe14('0x10')];}_0x32f55d[_0xfe14('0xb')](_0x618719)[_0xfe14('0x11')](_0x4ae9a6);};}exports[_0xfe14('0xd')]=function(_0x390736,_0x56ad1f){if(_0x390736['user'][_0xfe14('0x12')]!==_0xfe14('0x13'))throw new Error(_0xfe14('0x14'));if(isNaN(Number(_0x390736['params']['id'])))throw new Error(_0xfe14('0x15'));return db['UserSetting'][_0xfe14('0x16')]({'where':{'id':_0x390736[_0xfe14('0x17')]['id']}})[_0xfe14('0x18')](handleEntityNotFound(_0x56ad1f,null))[_0xfe14('0x18')](saveUpdates(_0x390736[_0xfe14('0x19')],null))[_0xfe14('0x18')](respondWithResult(_0x56ad1f,null))[_0xfe14('0x1a')](handleError(_0x56ad1f,null));}; \ No newline at end of file +var _0x6d0b=['name','user','role','admin','Invalid\x20user\x20setting\x20id','UserSetting','params','body','lodash','../../config/logger','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','register','localhost','status','json','update','then'];(function(_0x3b4f36,_0x5c1bc5){var _0x42c965=function(_0x599a81){while(--_0x599a81){_0x3b4f36['push'](_0x3b4f36['shift']());}};_0x42c965(++_0x5c1bc5);}(_0x6d0b,0x71));var _0xb6d0=function(_0x19e02d,_0x35c766){_0x19e02d=_0x19e02d-0x0;var _0x35481b=_0x6d0b[_0x19e02d];return _0x35481b;};'use strict';var _=require(_0xb6d0('0x0'));var Redis=require('ioredis');var logger=require(_0xb6d0('0x1'))('api');var config=require(_0xb6d0('0x2'));var db=require(_0xb6d0('0x3'))['db'];var socket=require(_0xb6d0('0x4'))(new Redis(config[_0xb6d0('0x5')]));require(_0xb6d0('0x6'))[_0xb6d0('0x7')](socket);config[_0xb6d0('0x5')]=_['defaults'](config[_0xb6d0('0x5')],{'host':_0xb6d0('0x8'),'port':0x18eb});function respondWithResult(_0x23217f,_0x341756){_0x341756=_0x341756||0xc8;return function(_0x440414){if(_0x440414){return _0x23217f[_0xb6d0('0x9')](_0x341756)[_0xb6d0('0xa')](_0x440414);}};}function saveUpdates(_0x354e56){return function(_0x1497e5){if(_0x1497e5){return _0x1497e5[_0xb6d0('0xb')](_0x354e56)[_0xb6d0('0xc')](function(_0x3dff2f){return _0x3dff2f;});}return null;};}function handleEntityNotFound(_0x5d3d75){return function(_0x458941){if(!_0x458941){_0x5d3d75['sendStatus'](0x194);}return _0x458941;};}function handleError(_0x237283,_0x1254cb){_0x1254cb=_0x1254cb||0x1f4;return function(_0x542641){logger['error'](_0x542641['stack']);if(_0x542641[_0xb6d0('0xd')]){delete _0x542641['name'];}_0x237283['status'](_0x1254cb)['send'](_0x542641);};}exports['update']=function(_0x213af0,_0x410af2){if(_0x213af0[_0xb6d0('0xe')][_0xb6d0('0xf')]!==_0xb6d0('0x10'))throw new Error('Unauthorized');if(isNaN(Number(_0x213af0['params']['id'])))throw new Error(_0xb6d0('0x11'));return db[_0xb6d0('0x12')]['find']({'where':{'id':_0x213af0[_0xb6d0('0x13')]['id']}})[_0xb6d0('0xc')](handleEntityNotFound(_0x410af2,null))[_0xb6d0('0xc')](saveUpdates(_0x213af0[_0xb6d0('0x14')],null))[_0xb6d0('0xc')](respondWithResult(_0x410af2,null))['catch'](handleError(_0x410af2,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 4ebec3a..d668602 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbf3e=['setMaxListeners','save','update','remove','hook','events','../../mysqldb'];(function(_0x126a29,_0x260c22){var _0x2e3ecd=function(_0x4ed343){while(--_0x4ed343){_0x126a29['push'](_0x126a29['shift']());}};_0x2e3ecd(++_0x260c22);}(_0xbf3e,0x194));var _0xebf3=function(_0x373b5c,_0xfd7e30){_0x373b5c=_0x373b5c-0x0;var _0x21c50f=_0xbf3e[_0x373b5c];return _0x21c50f;};'use strict';var EventEmitter=require(_0xebf3('0x0'));var UserSetting=require(_0xebf3('0x1'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xebf3('0x2')](0x0);var events={'afterCreate':_0xebf3('0x3'),'afterUpdate':_0xebf3('0x4'),'afterDestroy':_0xebf3('0x5')};function emitEvent(_0x3edd29){return function(_0x1c1137,_0x5d69bd,_0x34b771){UserSettingEvents['emit'](_0x3edd29+':'+_0x1c1137['id'],_0x1c1137);UserSettingEvents['emit'](_0x3edd29,_0x1c1137);_0x34b771(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0xebf3('0x6')](e,emitEvent(event));}}module['exports']=UserSettingEvents; \ No newline at end of file +var _0xfbca=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3133d3,_0x32f9ef){var _0xe98bb1=function(_0x2b4df5){while(--_0x2b4df5){_0x3133d3['push'](_0x3133d3['shift']());}};_0xe98bb1(++_0x32f9ef);}(_0xfbca,0x9a));var _0xafbc=function(_0x15e807,_0x4880bb){_0x15e807=_0x15e807-0x0;var _0x300e0b=_0xfbca[_0x15e807];return _0x300e0b;};'use strict';var EventEmitter=require('events');var UserSetting=require('../../mysqldb')['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xafbc('0x0')](0x0);var events={'afterCreate':_0xafbc('0x1'),'afterUpdate':'update','afterDestroy':_0xafbc('0x2')};function emitEvent(_0x3e9714){return function(_0xe46f9d,_0x3ee50b,_0x1aff7f){UserSettingEvents[_0xafbc('0x3')](_0x3e9714+':'+_0xe46f9d['id'],_0xe46f9d);UserSettingEvents['emit'](_0x3e9714,_0xe46f9d);_0x1aff7f(null);};}for(var e in events){if(events[_0xafbc('0x4')](e)){var event=events[e];UserSetting[_0xafbc('0x5')](e,emitEvent(event));}}module[_0xafbc('0x6')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index b52d4d5..6ecd72e 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c2c=['user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes','exports'];(function(_0x98ff8,_0x1abf9e){var _0x13a724=function(_0x31e03e){while(--_0x31e03e){_0x98ff8['push'](_0x98ff8['shift']());}};_0x13a724(++_0x1abf9e);}(_0x9c2c,0x1c0));var _0xc9c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9c2c[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require(_0xc9c2('0x0'));module[_0xc9c2('0x1')]=function(_0x4ac695){return _0x4ac695['define']('UserSetting',attributes,{'tableName':_0xc9c2('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4ac3bb){if(!_0x4ac3bb[_0xc9c2('0x3')])_0x4ac3bb[_0xc9c2('0x4')]=null;else if(_0x4ac3bb['clientSideLoggingEnabledSince']===null)_0x4ac3bb['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file +var _0x24cf=['clientSideLoggingEnabledSince','define','UserSetting','user_settings'];(function(_0xa7657d,_0x16c719){var _0x2c0312=function(_0x3d3f26){while(--_0x3d3f26){_0xa7657d['push'](_0xa7657d['shift']());}};_0x2c0312(++_0x16c719);}(_0x24cf,0x1d5));var _0xf24c=function(_0x28997,_0x1b8246){_0x28997=_0x28997-0x0;var _0x12973f=_0x24cf[_0x28997];return _0x12973f;};'use strict';var attributes=require('./user-setting.attributes');module['exports']=function(_0x1c670d){return _0x1c670d[_0xf24c('0x0')](_0xf24c('0x1'),attributes,{'tableName':_0xf24c('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x45f945){if(!_0x45f945['clientSideLoggingEnabled'])_0x45f945[_0xf24c('0x3')]=null;else if(_0x45f945[_0xf24c('0x3')]===null)_0x45f945[_0xf24c('0x3')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index 72e950a..3dec3f2 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf88f=['./user-setting.events','save','remove','emit','user-setting:update','UserId','register','length','user-setting:'];(function(_0x4751ac,_0x4d31b8){var _0x50fc01=function(_0x570e5b){while(--_0x570e5b){_0x4751ac['push'](_0x4751ac['shift']());}};_0x50fc01(++_0x4d31b8);}(_0xf88f,0xb4));var _0xff88=function(_0xa755e,_0x54633b){_0xa755e=_0xa755e-0x0;var _0x307c66=_0xf88f[_0xa755e];return _0x307c66;};'use strict';var UserSettingEvents=require(_0xff88('0x0'));var events=[_0xff88('0x1'),_0xff88('0x2'),'update'];function createListener(_0x2d3522,_0x81e486){return function(_0x3245fb){_0x81e486[_0xff88('0x3')](_0x2d3522,_0x3245fb);if(_0x2d3522===_0xff88('0x4')){_0x81e486[_0xff88('0x3')]('user-setting:update:user-'+_0x3245fb[_0xff88('0x5')],_0x3245fb);}};}exports[_0xff88('0x6')]=function(_0x432bfd){for(var _0x54b4df=0x0,_0x519605=events[_0xff88('0x7')];_0x54b4df<_0x519605;_0x54b4df++){var _0x4fa9a3=events[_0x54b4df];var _0x1bfffd=createListener(_0xff88('0x8')+_0x4fa9a3,_0x432bfd);UserSettingEvents['on'](_0x4fa9a3,_0x1bfffd);}}; \ No newline at end of file +var _0x9c10=['length','user-setting:','./user-setting.events','save','update','emit','user-setting:update'];(function(_0x46becf,_0x14443c){var _0x315605=function(_0x523cf8){while(--_0x523cf8){_0x46becf['push'](_0x46becf['shift']());}};_0x315605(++_0x14443c);}(_0x9c10,0x159));var _0x09c1=function(_0x43554e,_0x1e3896){_0x43554e=_0x43554e-0x0;var _0x2e0ff6=_0x9c10[_0x43554e];return _0x2e0ff6;};'use strict';var UserSettingEvents=require(_0x09c1('0x0'));var events=[_0x09c1('0x1'),'remove',_0x09c1('0x2')];function createListener(_0x101ffd,_0x387d84){return function(_0x35da25){_0x387d84[_0x09c1('0x3')](_0x101ffd,_0x35da25);if(_0x101ffd===_0x09c1('0x4')){_0x387d84[_0x09c1('0x3')]('user-setting:update:user-'+_0x35da25['UserId'],_0x35da25);}};}exports['register']=function(_0x3caeb4){for(var _0x56660a=0x0,_0x26888d=events[_0x09c1('0x5')];_0x56660a<_0x26888d;_0x56660a++){var _0x28ac8c=events[_0x56660a];var _0x13d51a=createListener(_0x09c1('0x6')+_0x28ac8c,_0x3caeb4);UserSettingEvents['on'](_0x28ac8c,_0x13d51a);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index f5c3c9e..582f336 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 _0xc0d7=['addChatWebsites','addWhatsappAccounts','createApiKey','put','/:id/password','removeQueues','removeTeams','delete','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','/:id/whatsapp_accounts','removeWhatsappAccounts','removeApiKey','/:id/messengerSoundNotification','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','index','/describe','isAuthenticated','/whoami','whoami','/presence','/:id','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getOpenchannelAccounts','/:id/chat_websites','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','addContacts','create','/create_many','addQueues','diskStorage','join','server/files/images/','format','originalname','single','addAvatar','/:id/logout','/:id/pause','pause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts'];(function(_0x8dec24,_0x903de0){var _0x381de1=function(_0x1aceb4){while(--_0x1aceb4){_0x8dec24['push'](_0x8dec24['shift']());}};_0x381de1(++_0x903de0);}(_0xc0d7,0x7f));var _0x7c0d=function(_0x1b2012,_0x578fcd){_0x1b2012=_0x1b2012-0x0;var _0x4ce18a=_0xc0d7[_0x1b2012];return _0x4ce18a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x7c0d('0x0'));var express=require(_0x7c0d('0x1'));var router=express[_0x7c0d('0x2')]();var fs_extra=require(_0x7c0d('0x3'));var auth=require(_0x7c0d('0x4'));var interaction=require(_0x7c0d('0x5'));var config=require(_0x7c0d('0x6'));var controller=require(_0x7c0d('0x7'));router[_0x7c0d('0x8')]('/',auth['isAuthenticated'](),controller[_0x7c0d('0x9')]);router[_0x7c0d('0x8')](_0x7c0d('0xa'),auth[_0x7c0d('0xb')](),controller['describe']);router[_0x7c0d('0x8')](_0x7c0d('0xc'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0xd')]);router['get'](_0x7c0d('0xe'),auth[_0x7c0d('0xb')](),controller['getPresence']);router['get'](_0x7c0d('0xf'),auth[_0x7c0d('0xb')](),controller['show']);router[_0x7c0d('0x8')](_0x7c0d('0x10'),controller[_0x7c0d('0x11')]);router[_0x7c0d('0x8')](_0x7c0d('0x12'),auth[_0x7c0d('0xb')](),controller['getOpenTabs']);router[_0x7c0d('0x8')](_0x7c0d('0x13'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x14')]);router[_0x7c0d('0x8')](_0x7c0d('0x15'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x16')]);router['get'](_0x7c0d('0x17'),auth['isAuthenticated'](),controller[_0x7c0d('0x18')]);router['get'](_0x7c0d('0x19'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x1a')]);router[_0x7c0d('0x8')](_0x7c0d('0x1b'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x1c')]);router[_0x7c0d('0x8')](_0x7c0d('0x1d'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x1e')]);router[_0x7c0d('0x8')](_0x7c0d('0x1f'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x20')]);router[_0x7c0d('0x8')](_0x7c0d('0x21'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x22')]);router['get']('/:id/mail/interactions',auth['isAuthenticated'](),controller['getMailInteractions']);router['get'](_0x7c0d('0x23'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x24')]);router[_0x7c0d('0x8')](_0x7c0d('0x25'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x26')]);router['get'](_0x7c0d('0x27'),auth[_0x7c0d('0xb')](),controller['getWhatsappInteractions']);router['get'](_0x7c0d('0x28'),auth['isAuthenticated'](),controller[_0x7c0d('0x29')]);router[_0x7c0d('0x8')](_0x7c0d('0x2a'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x2b')]);router['get'](_0x7c0d('0x2c'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x2d')]);router[_0x7c0d('0x8')](_0x7c0d('0x2e'),auth['isAuthenticated'](),controller[_0x7c0d('0x2f')]);router['get'](_0x7c0d('0x30'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x31')]);router[_0x7c0d('0x8')](_0x7c0d('0x32'),auth[_0x7c0d('0xb')](),controller['getMailAccounts']);router[_0x7c0d('0x8')]('/:id/openchannel_accounts',auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x33')]);router['get']('/:id/sms_accounts',auth[_0x7c0d('0xb')](),controller['getSmsAccounts']);router[_0x7c0d('0x8')](_0x7c0d('0x34'),auth['isAuthenticated'](),controller['getChatWebsites']);router['get']('/:id/whatsapp_accounts',auth[_0x7c0d('0xb')](),controller['getWhatsappAccounts']);router[_0x7c0d('0x8')](_0x7c0d('0x35'),auth['isAuthenticated'](),controller[_0x7c0d('0x36')]);router[_0x7c0d('0x8')](_0x7c0d('0x37'),auth[_0x7c0d('0xb')](),controller['getApiKey']);router[_0x7c0d('0x38')](_0x7c0d('0x13'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x39')]);router[_0x7c0d('0x38')]('/',auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x3a')]);router[_0x7c0d('0x38')](_0x7c0d('0x3b'),auth[_0x7c0d('0xb')](),controller['bulkCreate']);router[_0x7c0d('0x38')](_0x7c0d('0x15'),auth['isAuthenticated'](),controller[_0x7c0d('0x3c')]);var upload=multer({'storage':multer[_0x7c0d('0x3d')]({'destination':function(_0x35f3c3,_0x1b723b,_0x304606){_0x304606(null,path[_0x7c0d('0x3e')](config['root'],_0x7c0d('0x3f')));},'filename':function(_0x169eff,_0x309f6b,_0xf06cef){_0xf06cef(null,util[_0x7c0d('0x40')]('%s-%s',Date['now'](),_0x309f6b[_0x7c0d('0x41')]));}})});router[_0x7c0d('0x38')]('/:id/avatar',upload[_0x7c0d('0x42')]('file'),controller[_0x7c0d('0x43')]);router[_0x7c0d('0x38')]('/:id/login',auth[_0x7c0d('0xb')](),controller['login']);router[_0x7c0d('0x38')](_0x7c0d('0x44'),auth['isAuthenticated'](),controller['logout']);router['post'](_0x7c0d('0x45'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x46')]);router[_0x7c0d('0x38')]('/:id/unpause',auth['isAuthenticated'](),controller[_0x7c0d('0x47')]);router['post']('/:id/teams',auth[_0x7c0d('0xb')](),controller['addTeams']);router[_0x7c0d('0x38')](_0x7c0d('0x48'),auth['isAuthenticated'](),controller[_0x7c0d('0x49')]);router[_0x7c0d('0x38')](_0x7c0d('0x4a'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x4b')]);router['post'](_0x7c0d('0x4c'),auth[_0x7c0d('0xb')](),controller['addFaxInteractions']);router[_0x7c0d('0x38')](_0x7c0d('0x4d'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x4e')]);router['post'](_0x7c0d('0x4f'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x50')]);router[_0x7c0d('0x38')](_0x7c0d('0x51'),auth['isAuthenticated'](),controller[_0x7c0d('0x52')]);router['post'](_0x7c0d('0x30'),auth['isAuthenticated'](),controller[_0x7c0d('0x53')]);router[_0x7c0d('0x38')](_0x7c0d('0x32'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x54')]);router['post'](_0x7c0d('0x55'),auth['isAuthenticated'](),controller[_0x7c0d('0x56')]);router[_0x7c0d('0x38')](_0x7c0d('0x57'),auth['isAuthenticated'](),controller[_0x7c0d('0x58')]);router['post']('/:id/chat_websites',auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x59')]);router[_0x7c0d('0x38')]('/:id/whatsapp_accounts',auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x5a')]);router[_0x7c0d('0x38')]('/:id/api_key',auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x5b')]);router[_0x7c0d('0x5c')](_0x7c0d('0xf'),auth[_0x7c0d('0xb')](),controller['update']);router['put'](_0x7c0d('0x5d'),auth[_0x7c0d('0xb')](),controller['changePassword']);router['delete'](_0x7c0d('0x15'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x5e')]);router['delete'](_0x7c0d('0x28'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x5f')]);router[_0x7c0d('0x60')](_0x7c0d('0xf'),auth[_0x7c0d('0xb')](),controller['destroy']);router['delete'](_0x7c0d('0x48'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x61')]);router['delete'](_0x7c0d('0x4a'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x62')]);router[_0x7c0d('0x60')]('/:id/fax_interactions',auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x63')]);router[_0x7c0d('0x60')](_0x7c0d('0x4d'),auth[_0x7c0d('0xb')](),controller['removeSmsInteractions']);router['delete'](_0x7c0d('0x4f'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x64')]);router[_0x7c0d('0x60')](_0x7c0d('0x51'),auth['isAuthenticated'](),controller[_0x7c0d('0x65')]);router[_0x7c0d('0x60')](_0x7c0d('0x30'),auth['isAuthenticated'](),controller[_0x7c0d('0x66')]);router[_0x7c0d('0x60')]('/:id/mail_accounts',auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x67')]);router[_0x7c0d('0x60')](_0x7c0d('0x55'),auth[_0x7c0d('0xb')](),controller['removeOpenchannelAccounts']);router['delete']('/:id/sms_accounts',auth[_0x7c0d('0xb')](),controller['removeSmsAccounts']);router[_0x7c0d('0x60')](_0x7c0d('0x34'),auth[_0x7c0d('0xb')](),controller['removeChatWebsites']);router[_0x7c0d('0x60')](_0x7c0d('0x68'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x69')]);router['delete'](_0x7c0d('0x37'),auth[_0x7c0d('0xb')](),controller[_0x7c0d('0x6a')]);router[_0x7c0d('0x38')](_0x7c0d('0x6b'),auth[_0x7c0d('0xb')](),controller['messengerSoundNotification']);module['exports']=router; \ No newline at end of file +var _0xae24=['addContacts','post','bulkCreate','addQueues','diskStorage','join','root','format','%s-%s','originalname','single','addAvatar','login','/:id/logout','logout','/:id/pause','pause','unpause','addTeams','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','createApiKey','put','/:id','update','/:id/password','changePassword','removeQueues','delete','removeTeams','destroy','/:id/chat_interactions','removeMailInteractions','removeFaxInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','index','/describe','/whoami','isAuthenticated','whoami','/presence','getPresence','show','/:id/avatar','/:id/open_tabs','getOpenTabs','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','/:id/recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getSmsInteractions','/:id/fax/interactions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key'];(function(_0x118a88,_0x166f95){var _0x5a5ae7=function(_0x180b2d){while(--_0x180b2d){_0x118a88['push'](_0x118a88['shift']());}};_0x5a5ae7(++_0x166f95);}(_0xae24,0x180));var _0x4ae2=function(_0x94148e,_0x822462){_0x94148e=_0x94148e-0x0;var _0x5bea30=_0xae24[_0x94148e];return _0x5bea30;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4ae2('0x0'));var timeout=require(_0x4ae2('0x1'));var express=require(_0x4ae2('0x2'));var router=express[_0x4ae2('0x3')]();var fs_extra=require(_0x4ae2('0x4'));var auth=require(_0x4ae2('0x5'));var interaction=require(_0x4ae2('0x6'));var config=require(_0x4ae2('0x7'));var controller=require(_0x4ae2('0x8'));router[_0x4ae2('0x9')]('/',auth['isAuthenticated'](),controller[_0x4ae2('0xa')]);router[_0x4ae2('0x9')](_0x4ae2('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x4ae2('0x9')](_0x4ae2('0xc'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0xe')]);router[_0x4ae2('0x9')](_0x4ae2('0xf'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x10')]);router[_0x4ae2('0x9')]('/:id',auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x11')]);router['get'](_0x4ae2('0x12'),controller['getAvatar']);router[_0x4ae2('0x9')](_0x4ae2('0x13'),auth['isAuthenticated'](),controller[_0x4ae2('0x14')]);router['get'](_0x4ae2('0x15'),auth[_0x4ae2('0xd')](),controller['getContacts']);router[_0x4ae2('0x9')](_0x4ae2('0x16'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x17')]);router[_0x4ae2('0x9')](_0x4ae2('0x18'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x19')]);router[_0x4ae2('0x9')](_0x4ae2('0x1a'),auth[_0x4ae2('0xd')](),controller['getGroups']);router[_0x4ae2('0x9')](_0x4ae2('0x1b'),auth[_0x4ae2('0xd')](),controller['getRecordings']);router[_0x4ae2('0x9')]('/:id/screen_recordings',auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x1c')]);router[_0x4ae2('0x9')]('/:id/chat/interactions',auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x1d')]);router[_0x4ae2('0x9')](_0x4ae2('0x1e'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x1f')]);router[_0x4ae2('0x9')]('/:id/mail/interactions',auth[_0x4ae2('0xd')](),controller['getMailInteractions']);router[_0x4ae2('0x9')]('/:id/sms/interactions',auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x20')]);router['get'](_0x4ae2('0x21'),auth[_0x4ae2('0xd')](),controller['getFaxInteractions']);router[_0x4ae2('0x9')]('/:id/whatsapp/interactions',auth[_0x4ae2('0xd')](),controller['getWhatsappInteractions']);router[_0x4ae2('0x9')](_0x4ae2('0x22'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x23')]);router[_0x4ae2('0x9')](_0x4ae2('0x24'),auth['isAuthenticated'](),controller[_0x4ae2('0x25')]);router[_0x4ae2('0x9')](_0x4ae2('0x26'),auth[_0x4ae2('0xd')](),controller['getAgents']);router[_0x4ae2('0x9')](_0x4ae2('0x27'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x28')]);router['get'](_0x4ae2('0x29'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x2a')]);router[_0x4ae2('0x9')](_0x4ae2('0x2b'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x2c')]);router[_0x4ae2('0x9')]('/:id/openchannel_accounts',auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router['get'](_0x4ae2('0x2d'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x2e')]);router[_0x4ae2('0x9')]('/:id/chat_websites',auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x2f')]);router[_0x4ae2('0x9')]('/:id/whatsapp_accounts',auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x30')]);router[_0x4ae2('0x9')](_0x4ae2('0x31'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x32')]);router[_0x4ae2('0x9')](_0x4ae2('0x33'),auth[_0x4ae2('0xd')](),controller['getApiKey']);router['post']('/:id/contacts',auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x34')]);router[_0x4ae2('0x35')]('/',auth[_0x4ae2('0xd')](),controller['create']);router[_0x4ae2('0x35')]('/create_many',auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x36')]);router['post'](_0x4ae2('0x16'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x37')]);var upload=multer({'storage':multer[_0x4ae2('0x38')]({'destination':function(_0x31d376,_0x5b18a8,_0x4a437b){_0x4a437b(null,path[_0x4ae2('0x39')](config[_0x4ae2('0x3a')],'server/files/images/'));},'filename':function(_0x32f3a0,_0x154930,_0x262007){_0x262007(null,util[_0x4ae2('0x3b')](_0x4ae2('0x3c'),Date['now'](),_0x154930[_0x4ae2('0x3d')]));}})});router[_0x4ae2('0x35')](_0x4ae2('0x12'),upload[_0x4ae2('0x3e')]('file'),controller[_0x4ae2('0x3f')]);router[_0x4ae2('0x35')]('/:id/login',auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x40')]);router['post'](_0x4ae2('0x41'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x42')]);router[_0x4ae2('0x35')](_0x4ae2('0x43'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x44')]);router[_0x4ae2('0x35')]('/:id/unpause',auth['isAuthenticated'](),controller[_0x4ae2('0x45')]);router[_0x4ae2('0x35')](_0x4ae2('0x22'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x46')]);router[_0x4ae2('0x35')]('/:id/chat_interactions',auth[_0x4ae2('0xd')](),controller['addChatInteractions']);router[_0x4ae2('0x35')](_0x4ae2('0x47'),auth['isAuthenticated'](),controller['addMailInteractions']);router[_0x4ae2('0x35')](_0x4ae2('0x48'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x49')]);router[_0x4ae2('0x35')](_0x4ae2('0x4a'),auth[_0x4ae2('0xd')](),controller['addSmsInteractions']);router[_0x4ae2('0x35')](_0x4ae2('0x4b'),auth[_0x4ae2('0xd')](),controller['addOpenchannelInteractions']);router[_0x4ae2('0x35')](_0x4ae2('0x4c'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x4d')]);router['post'](_0x4ae2('0x29'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x4e')]);router[_0x4ae2('0x35')](_0x4ae2('0x2b'),auth['isAuthenticated'](),controller[_0x4ae2('0x4f')]);router[_0x4ae2('0x35')](_0x4ae2('0x50'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x51')]);router['post'](_0x4ae2('0x2d'),auth['isAuthenticated'](),controller[_0x4ae2('0x52')]);router['post'](_0x4ae2('0x53'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x54')]);router['post'](_0x4ae2('0x55'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x56')]);router['post'](_0x4ae2('0x33'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x57')]);router[_0x4ae2('0x58')](_0x4ae2('0x59'),auth['isAuthenticated'](),controller[_0x4ae2('0x5a')]);router[_0x4ae2('0x58')](_0x4ae2('0x5b'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x5c')]);router['delete'](_0x4ae2('0x16'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x5d')]);router[_0x4ae2('0x5e')](_0x4ae2('0x22'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x5f')]);router[_0x4ae2('0x5e')](_0x4ae2('0x59'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x60')]);router[_0x4ae2('0x5e')](_0x4ae2('0x61'),auth['isAuthenticated'](),controller['removeChatInteractions']);router[_0x4ae2('0x5e')](_0x4ae2('0x47'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x62')]);router[_0x4ae2('0x5e')](_0x4ae2('0x48'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x63')]);router[_0x4ae2('0x5e')](_0x4ae2('0x4a'),auth[_0x4ae2('0xd')](),controller['removeSmsInteractions']);router[_0x4ae2('0x5e')](_0x4ae2('0x4b'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x64')]);router[_0x4ae2('0x5e')]('/:id/whatsapp_interactions',auth['isAuthenticated'](),controller[_0x4ae2('0x65')]);router[_0x4ae2('0x5e')](_0x4ae2('0x29'),auth['isAuthenticated'](),controller['removeFaxAccounts']);router[_0x4ae2('0x5e')](_0x4ae2('0x2b'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x66')]);router[_0x4ae2('0x5e')]('/:id/openchannel_accounts',auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x67')]);router[_0x4ae2('0x5e')](_0x4ae2('0x2d'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x68')]);router[_0x4ae2('0x5e')](_0x4ae2('0x53'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x69')]);router[_0x4ae2('0x5e')]('/:id/whatsapp_accounts',auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x6a')]);router[_0x4ae2('0x5e')](_0x4ae2('0x33'),auth[_0x4ae2('0xd')](),controller[_0x4ae2('0x6b')]);router[_0x4ae2('0x35')]('/:id/messengerSoundNotification',auth[_0x4ae2('0xd')](),controller['messengerSoundNotification']);module[_0x4ae2('0x6c')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index ebf72ea..3d13d11 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 _0x3b08=['force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','insecure','always','accept','refuse','originate','uas','fingerprint','certificate','active','nonat','update','update,nonat','TEXT','get','isArray','udp','wss','encryption','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','force_avp','actpass','/etc/pki/tls/certs/motion.crt','map','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','moment','util','lodash','exports','STRING','setDataValue','The\x20name\x20of\x20the\x20user','fullname','format','getDataValue','email','toLowerCase','ENUM','admin','user','telephone','INTEGER','internal','accountcode','callerid','\x22%s\x22\x20<%s>','DATE','BOOLEAN','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','outgoing'];(function(_0x5da59e,_0x16baf8){var _0x5d2d3a=function(_0x57328f){while(--_0x57328f){_0x5da59e['push'](_0x5da59e['shift']());}};_0x5d2d3a(++_0x16baf8);}(_0x3b08,0xdc));var _0x83b0=function(_0x4a2da0,_0x4df496){_0x4a2da0=_0x4a2da0-0x0;var _0x1a8642=_0x3b08[_0x4a2da0];return _0x1a8642;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x83b0('0x0'));var util=require(_0x83b0('0x1'));var _=require(_0x83b0('0x2'));module[_0x83b0('0x3')]={'name':{'type':Sequelize[_0x83b0('0x4')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x860d60){this[_0x83b0('0x5')]('name',_0x860d60);this[_0x83b0('0x5')]('defaultuser',_0x860d60);},'comment':_0x83b0('0x6')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x5d0479){this['setDataValue'](_0x83b0('0x7'),_0x5d0479);this[_0x83b0('0x5')]('callerid',util[_0x83b0('0x8')]('\x22%s\x22\x20<%s>',_0x5d0479,this[_0x83b0('0x9')]('internal')));}},'alias':{'type':Sequelize[_0x83b0('0x4')]},'email':{'type':Sequelize[_0x83b0('0x4')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x41d8a1){if(_0x41d8a1){this['setDataValue'](_0x83b0('0xa'),_0x41d8a1[_0x83b0('0xb')]());}}},'role':{'type':Sequelize[_0x83b0('0xc')](_0x83b0('0xd'),_0x83b0('0xe'),'agent',_0x83b0('0xf')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x83b0('0x4')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x83b0('0x10')](0xb),'allowNull':![],'unique':_0x83b0('0x11'),'set':function(_0x3fa5d4){this[_0x83b0('0x5')]('internal',_0x3fa5d4);this['setDataValue'](_0x83b0('0x12'),_0x3fa5d4);this[_0x83b0('0x5')](_0x83b0('0x13'),util[_0x83b0('0x8')](_0x83b0('0x14'),this[_0x83b0('0x9')](_0x83b0('0x7')),_0x3fa5d4));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x83b0('0x4')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x83b0('0x4')]},'zipcode':{'type':Sequelize[_0x83b0('0x4')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x83b0('0x4')]},'country':{'type':Sequelize[_0x83b0('0x4')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x83b0('0x15')]},'voicePause':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x83b0('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x83b0('0x15')]},'chatCapacity':{'type':Sequelize[_0x83b0('0x10')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x83b0('0x10')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x83b0('0x10')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x83b0('0x10')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x83b0('0x10')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x83b0('0x10')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x83b0('0x10')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x83b0('0x10')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x83b0('0x10')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x83b0('0x10')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x83b0('0x17'),_0x83b0('0xe'),_0x83b0('0x18')),'allowNull':!![],'defaultValue':_0x83b0('0x17')},'context':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![],'defaultValue':_0x83b0('0x19')},'callingpres':{'type':Sequelize[_0x83b0('0xc')](_0x83b0('0x1a'),_0x83b0('0x1b'),_0x83b0('0x1c'),_0x83b0('0x1d'),'PROHIB_NOT_SCREENED',_0x83b0('0x1e'),_0x83b0('0x1f'),_0x83b0('0x20')),'allowNull':!![]},'deny':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![],'defaultValue':'udp','set':function(_0x3086d4){this['setDataValue'](_0x83b0('0x21'),_0x3086d4?_0x3086d4[_0x83b0('0x22')](','):null);},'get':function(){return this['getDataValue'](_0x83b0('0x21'))?this[_0x83b0('0x9')](_0x83b0('0x21'))[_0x83b0('0x23')](','):null;},'comment':_0x83b0('0x24')},'dtmfmode':{'type':Sequelize['ENUM'](_0x83b0('0x25'),_0x83b0('0x26'),_0x83b0('0x27'),_0x83b0('0x28'),_0x83b0('0x29')),'allowNull':!![],'defaultValue':_0x83b0('0x25')},'directmedia':{'type':Sequelize[_0x83b0('0xc')](_0x83b0('0x2a'),'no','nonat','update',_0x83b0('0x2b')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x83b0('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![],'defaultValue':_0x83b0('0x2c'),'set':function(_0xc61ab3){this[_0x83b0('0x5')]('nat',_0xc61ab3?_0xc61ab3[_0x83b0('0x22')](','):null);},'get':function(){return this[_0x83b0('0x9')](_0x83b0('0x2d'))?this[_0x83b0('0x9')]('nat')['split'](','):null;},'comment':_0x83b0('0x2e')},'callgroup':{'type':Sequelize[_0x83b0('0x4')]},'namedcallgroup':{'type':Sequelize[_0x83b0('0x4')]},'pickupgroup':{'type':Sequelize[_0x83b0('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x83b0('0x4')]},'language':{'type':Sequelize[_0x83b0('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x83b0('0x4')]},'disallow':{'type':Sequelize[_0x83b0('0x4')],'allowNull':![],'defaultValue':_0x83b0('0x2f')},'allow':{'type':Sequelize[_0x83b0('0x4')],'allowNull':![],'defaultValue':_0x83b0('0x30'),'set':function(_0x5731bb){this[_0x83b0('0x5')](_0x83b0('0x31'),_0x5731bb?_0x5731bb[_0x83b0('0x22')](';'):_0x83b0('0x30'));},'get':function(){return this[_0x83b0('0x9')](_0x83b0('0x31'))?this['getDataValue'](_0x83b0('0x31'))[_0x83b0('0x23')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x83b0('0xc')](_0x83b0('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![],'set':function(_0x456ddb){this[_0x83b0('0x5')](_0x83b0('0x32'),_0x456ddb?_0x456ddb['join'](','):null);},'get':function(){return this[_0x83b0('0x9')](_0x83b0('0x32'))?this[_0x83b0('0x9')](_0x83b0('0x32'))[_0x83b0('0x23')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x83b0('0xc')](_0x83b0('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x83b0('0xc')](_0x83b0('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x83b0('0xc')]('yes','no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x83b0('0xc')](_0x83b0('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x83b0('0x10')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x83b0('0xc')]('yes','no'),'allowNull':!![],'defaultValue':_0x83b0('0x2a')},'busylevel':{'type':Sequelize[_0x83b0('0x10')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x83b0('0xc')](_0x83b0('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x83b0('0xc')](_0x83b0('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x83b0('0xc')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x83b0('0xc')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x83b0('0xc')]('yes','no',_0x83b0('0x33')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x83b0('0x10')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x83b0('0xc')](_0x83b0('0x34'),_0x83b0('0x35'),_0x83b0('0x36')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x83b0('0x10')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x83b0('0x10')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x83b0('0xc')]('uac',_0x83b0('0x37')),'allowNull':!![],'defaultValue':_0x83b0('0x37')},'t38pt_usertpsource':{'type':Sequelize['STRING'],'allowNull':!![]},'regexten':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x83b0('0xc')]('yes','no'),'allowNull':!![],'defaultValue':_0x83b0('0x2a')},'keepalive':{'type':Sequelize[_0x83b0('0x10')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x83b0('0x10')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x83b0('0xc')](_0x83b0('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x83b0('0x10')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x83b0('0x10')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x83b0('0x10')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x83b0('0xc')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x83b0('0xc')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize['ENUM'](_0x83b0('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x83b0('0xc')](_0x83b0('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x83b0('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x83b0('0xc')](_0x83b0('0x2a'),'no',_0x83b0('0x38'),_0x83b0('0x39')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x83b0('0x10')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x83b0('0xc')](_0x83b0('0x3a'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x83b0('0xc')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x83b0('0x10')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x83b0('0xc')](_0x83b0('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x83b0('0xc')](_0x83b0('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x83b0('0xc')]('yes','no',_0x83b0('0x3b'),_0x83b0('0x3c'),_0x83b0('0x3d')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x83b0('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x83b0('0x15')]},'passwordResetAt':{'type':Sequelize[_0x83b0('0x15')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x83b0('0x3e')]},'showWebBar':{'type':Sequelize[_0x83b0('0x10')],'defaultValue':0x0,'set':function(_0x4b14ea){this['setDataValue']('showWebBar',_0x4b14ea);var _0x179e48=this[_0x83b0('0x3f')]({'plain':!![]});switch(_0x4b14ea){case 0x0:case 0x1:var _0x514479=_0x179e48[_0x83b0('0x21')]?_[_0x83b0('0x40')](_0x179e48[_0x83b0('0x21')])?_0x179e48[_0x83b0('0x21')][_0x83b0('0x22')]():_0x179e48[_0x83b0('0x21')]:_0x83b0('0x41');if(_0x514479===_0x83b0('0x42')){_0x514479=_0x83b0('0x41');}this[_0x83b0('0x5')](_0x83b0('0x21'),_0x514479);this[_0x83b0('0x5')](_0x83b0('0x43'),'no');this[_0x83b0('0x5')]('avpf',null);this[_0x83b0('0x5')]('force_avp',null);this[_0x83b0('0x5')](_0x83b0('0x44'),null);this[_0x83b0('0x5')](_0x83b0('0x45'),null);this['setDataValue'](_0x83b0('0x46'),null);this[_0x83b0('0x5')](_0x83b0('0x47'),null);this[_0x83b0('0x5')](_0x83b0('0x48'),null);this[_0x83b0('0x5')](_0x83b0('0x49'),null);this[_0x83b0('0x5')](_0x83b0('0x4a'),'no');break;case 0x2:this['setDataValue'](_0x83b0('0x21'),_0x83b0('0x42'));this['setDataValue'](_0x83b0('0x43'),_0x83b0('0x2a'));this[_0x83b0('0x5')]('avpf','yes');this[_0x83b0('0x5')](_0x83b0('0x4b'),_0x83b0('0x2a'));this['setDataValue']('icesupport',_0x83b0('0x2a'));this[_0x83b0('0x5')](_0x83b0('0x45'),_0x83b0('0x2a'));this[_0x83b0('0x5')](_0x83b0('0x46'),'no');this[_0x83b0('0x5')]('dtlssetup',_0x83b0('0x4c'));this['setDataValue'](_0x83b0('0x48'),_0x179e48[_0x83b0('0x48')]||_0x83b0('0x4d'));this[_0x83b0('0x5')](_0x83b0('0x49'),_0x179e48[_0x83b0('0x49')]||'/etc/pki/tls/private/motion.key');this['setDataValue']('rtcp_mux','yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x569edb){this['setDataValue']('permissions',_0x569edb?_0x569edb[_0x83b0('0x22')](','):[]);},'get':function(){return this[_0x83b0('0x9')]('permissions')?_[_0x83b0('0x4e')](this[_0x83b0('0x9')](_0x83b0('0x4f'))[_0x83b0('0x23')](','),function(_0x132f08){return parseInt(_0x132f08,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x83b0('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x83b0('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x83b0('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x83b0('0x10')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x83b0('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x83b0('0x10')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x83b0('0xc')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x83b0('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x83b0('0x50')],'get':function(){return this['getDataValue'](_0x83b0('0x51'))?this[_0x83b0('0x9')](_0x83b0('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x83b0('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x21f320){if(typeof _0x21f320==='string'){var _0x3fc8ef=_0x21f320==='1'?!![]:_0x21f320==='0'?![]:_0x21f320==='true'?!![]:_0x21f320===_0x83b0('0x52')?![]:![];this[_0x83b0('0x5')](_0x83b0('0x53'),_0x3fc8ef);}else{this[_0x83b0('0x5')]('screenrecording',_0x21f320);}}},'blocked':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![],'set':function(_0x48c00f){this[_0x83b0('0x5')](_0x83b0('0x54'),_0x48c00f);if(_0x48c00f===!![]){this[_0x83b0('0x5')](_0x83b0('0x55'),moment());this[_0x83b0('0x5')](_0x83b0('0x56'),0x0);}else{this[_0x83b0('0x5')](_0x83b0('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x83b0('0x15')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x83b0('0x10')](0x5)[_0x83b0('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x83b0('0x10')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x83b0('0x10')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x83b0('0x10')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x83b0('0x10')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x83b0('0x16')],'defaultValue':![]}}; \ No newline at end of file +var _0x6b8f=['STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','\x22%s\x22\x20<%s>','internal','email','toLowerCase','ENUM','agent','local','INTEGER','accountcode','getDataValue','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','user','friend','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','join','rfc2833','info','shortinfo','inband','auto','yes','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','uac','uas','fingerprint','certificate','passive','actpass','nonat','TEXT','showWebBar','wss','encryption','avpf','force_avp','icesupport','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','dtlsenable','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','moment','util','lodash'];(function(_0x12e787,_0x36c9e4){var _0x407e14=function(_0x1b30bf){while(--_0x1b30bf){_0x12e787['push'](_0x12e787['shift']());}};_0x407e14(++_0x36c9e4);}(_0x6b8f,0x105));var _0xf6b8=function(_0xa47f76,_0x1ebb98){_0xa47f76=_0xa47f76-0x0;var _0x428688=_0x6b8f[_0xa47f76];return _0x428688;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf6b8('0x0'));var util=require(_0xf6b8('0x1'));var _=require(_0xf6b8('0x2'));module['exports']={'name':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':![],'unique':_0xf6b8('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3887f2){this[_0xf6b8('0x5')](_0xf6b8('0x4'),_0x3887f2);this[_0xf6b8('0x5')](_0xf6b8('0x6'),_0x3887f2);},'comment':_0xf6b8('0x7')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x54a89a){this[_0xf6b8('0x5')](_0xf6b8('0x8'),_0x54a89a);this[_0xf6b8('0x5')](_0xf6b8('0x9'),util[_0xf6b8('0xa')](_0xf6b8('0xb'),_0x54a89a,this['getDataValue'](_0xf6b8('0xc'))));}},'alias':{'type':Sequelize[_0xf6b8('0x3')]},'email':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':![],'unique':_0xf6b8('0xd'),'validate':{'isEmail':!![]},'set':function(_0x41d300){if(_0x41d300){this['setDataValue'](_0xf6b8('0xd'),_0x41d300[_0xf6b8('0xe')]());}}},'role':{'type':Sequelize[_0xf6b8('0xf')]('admin','user',_0xf6b8('0x10'),'telephone'),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xf6b8('0x3')],'defaultValue':_0xf6b8('0x11')},'internal':{'type':Sequelize[_0xf6b8('0x12')](0xb),'allowNull':![],'unique':'internal','set':function(_0x5b7a8d){this[_0xf6b8('0x5')](_0xf6b8('0xc'),_0x5b7a8d);this[_0xf6b8('0x5')](_0xf6b8('0x13'),_0x5b7a8d);this[_0xf6b8('0x5')](_0xf6b8('0x9'),util['format'](_0xf6b8('0xb'),this[_0xf6b8('0x14')](_0xf6b8('0x8')),_0x5b7a8d));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xf6b8('0x3')]},'mobile':{'type':Sequelize[_0xf6b8('0x3')]},'address':{'type':Sequelize[_0xf6b8('0x3')]},'zipcode':{'type':Sequelize[_0xf6b8('0x3')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xf6b8('0x3')]},'country':{'type':Sequelize[_0xf6b8('0x3')]},'online':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xf6b8('0x3')],'defaultValue':_0xf6b8('0x16')},'lastPauseAt':{'type':Sequelize[_0xf6b8('0x17')]},'chatCapacity':{'type':Sequelize[_0xf6b8('0x12')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xf6b8('0x12')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xf6b8('0x12')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xf6b8('0x12')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xf6b8('0x12')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xf6b8('0x12')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xf6b8('0x12')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xf6b8('0x12')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xf6b8('0x18')},'ipaddr':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0xf6b8('0x12')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xf6b8('0x12')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xf6b8('0xf')]('friend',_0xf6b8('0x19'),'peer'),'allowNull':!![],'defaultValue':_0xf6b8('0x1a')},'context':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize['ENUM'](_0xf6b8('0x1b'),_0xf6b8('0x1c'),_0xf6b8('0x1d'),_0xf6b8('0x1e'),_0xf6b8('0x1f'),_0xf6b8('0x20'),'PROHIB_FAILED_SCREEN',_0xf6b8('0x21')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![],'defaultValue':_0xf6b8('0x22'),'set':function(_0x17bc7e){this[_0xf6b8('0x5')](_0xf6b8('0x23'),_0x17bc7e?_0x17bc7e[_0xf6b8('0x24')](','):null);},'get':function(){return this[_0xf6b8('0x14')](_0xf6b8('0x23'))?this['getDataValue']('transport')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0xf6b8('0x25'),_0xf6b8('0x26'),_0xf6b8('0x27'),_0xf6b8('0x28'),_0xf6b8('0x29')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xf6b8('0xf')](_0xf6b8('0x2a'),'no','nonat',_0xf6b8('0x2b'),_0xf6b8('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xf6b8('0xf')](_0xf6b8('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![],'defaultValue':_0xf6b8('0x2d'),'set':function(_0x5ef6ac){this[_0xf6b8('0x5')](_0xf6b8('0x2e'),_0x5ef6ac?_0x5ef6ac[_0xf6b8('0x24')](','):null);},'get':function(){return this[_0xf6b8('0x14')](_0xf6b8('0x2e'))?this[_0xf6b8('0x14')]('nat')['split'](','):null;},'comment':_0xf6b8('0x2f')},'callgroup':{'type':Sequelize[_0xf6b8('0x3')]},'namedcallgroup':{'type':Sequelize[_0xf6b8('0x3')]},'pickupgroup':{'type':Sequelize[_0xf6b8('0x3')]},'namedpickupgroup':{'type':Sequelize[_0xf6b8('0x3')]},'language':{'type':Sequelize[_0xf6b8('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xf6b8('0x3')]},'disallow':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':![],'defaultValue':_0xf6b8('0x30')},'allow':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':![],'defaultValue':_0xf6b8('0x31'),'set':function(_0x3bca88){this[_0xf6b8('0x5')](_0xf6b8('0x32'),_0x3bca88?_0x3bca88[_0xf6b8('0x24')](';'):_0xf6b8('0x31'));},'get':function(){return this['getDataValue'](_0xf6b8('0x32'))?this[_0xf6b8('0x14')](_0xf6b8('0x32'))[_0xf6b8('0x33')](';'):null;},'comment':_0xf6b8('0x34')},'autoframing':{'type':Sequelize[_0xf6b8('0xf')](_0xf6b8('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![],'set':function(_0x10ae76){this[_0xf6b8('0x5')](_0xf6b8('0x35'),_0x10ae76?_0x10ae76[_0xf6b8('0x24')](','):null);},'get':function(){return this[_0xf6b8('0x14')](_0xf6b8('0x35'))?this[_0xf6b8('0x14')]('insecure')[_0xf6b8('0x33')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xf6b8('0xf')](_0xf6b8('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xf6b8('0xf')](_0xf6b8('0x2a'),'no',_0xf6b8('0x36')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xf6b8('0xf')](_0xf6b8('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xf6b8('0xf')](_0xf6b8('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xf6b8('0x12')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![],'defaultValue':_0xf6b8('0x37')},'amaflags':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xf6b8('0xf')](_0xf6b8('0x2a'),'no'),'allowNull':!![],'defaultValue':_0xf6b8('0x2a')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xf6b8('0xf')](_0xf6b8('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xf6b8('0xf')](_0xf6b8('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xf6b8('0xf')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xf6b8('0xf')](_0xf6b8('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xf6b8('0xf')](_0xf6b8('0x2a'),'no',_0xf6b8('0x38')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xf6b8('0x12')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xf6b8('0xf')]('accept','refuse','originate'),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xf6b8('0x12')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xf6b8('0xf')](_0xf6b8('0x39'),_0xf6b8('0x3a')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0xf6b8('0xf')]('yes','no'),'allowNull':!![],'defaultValue':_0xf6b8('0x2a')},'keepalive':{'type':Sequelize[_0xf6b8('0x12')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xf6b8('0x12')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xf6b8('0x12')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xf6b8('0x12')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xf6b8('0xf')](_0xf6b8('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xf6b8('0x12')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xf6b8('0x12')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xf6b8('0x12')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xf6b8('0x12')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0xf6b8('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xf6b8('0xf')](_0xf6b8('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xf6b8('0xf')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xf6b8('0xf')](_0xf6b8('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xf6b8('0xf')](_0xf6b8('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xf6b8('0xf')](_0xf6b8('0x2a'),'no',_0xf6b8('0x3b'),_0xf6b8('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xf6b8('0x12')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xf6b8('0xf')]('active',_0xf6b8('0x3d'),_0xf6b8('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xf6b8('0xf')](_0xf6b8('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xf6b8('0x12')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xf6b8('0xf')](_0xf6b8('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0xf6b8('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xf6b8('0xf')](_0xf6b8('0x2a'),'no',_0xf6b8('0x3f'),_0xf6b8('0x2b'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0xf6b8('0x17')]},'passwordResetAt':{'type':Sequelize[_0xf6b8('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xf6b8('0x40')]},'showWebBar':{'type':Sequelize[_0xf6b8('0x12')],'defaultValue':0x0,'set':function(_0xe10e5f){this[_0xf6b8('0x5')](_0xf6b8('0x41'),_0xe10e5f);var _0x1bb991=this['get']({'plain':!![]});switch(_0xe10e5f){case 0x0:case 0x1:var _0x4515dc=_0x1bb991['transport']?_['isArray'](_0x1bb991['transport'])?_0x1bb991['transport']['join']():_0x1bb991[_0xf6b8('0x23')]:'udp';if(_0x4515dc===_0xf6b8('0x42')){_0x4515dc=_0xf6b8('0x22');}this[_0xf6b8('0x5')](_0xf6b8('0x23'),_0x4515dc);this[_0xf6b8('0x5')](_0xf6b8('0x43'),'no');this[_0xf6b8('0x5')](_0xf6b8('0x44'),null);this[_0xf6b8('0x5')](_0xf6b8('0x45'),null);this['setDataValue'](_0xf6b8('0x46'),null);this['setDataValue']('dtlsenable',null);this[_0xf6b8('0x5')]('dtlsverify',null);this[_0xf6b8('0x5')](_0xf6b8('0x47'),null);this[_0xf6b8('0x5')](_0xf6b8('0x48'),null);this[_0xf6b8('0x5')](_0xf6b8('0x49'),null);this[_0xf6b8('0x5')](_0xf6b8('0x4a'),'no');break;case 0x2:this[_0xf6b8('0x5')]('transport',_0xf6b8('0x42'));this[_0xf6b8('0x5')]('encryption','yes');this['setDataValue']('avpf','yes');this[_0xf6b8('0x5')]('force_avp',_0xf6b8('0x2a'));this['setDataValue'](_0xf6b8('0x46'),'yes');this['setDataValue'](_0xf6b8('0x4b'),_0xf6b8('0x2a'));this[_0xf6b8('0x5')]('dtlsverify','no');this[_0xf6b8('0x5')](_0xf6b8('0x47'),_0xf6b8('0x3e'));this[_0xf6b8('0x5')](_0xf6b8('0x48'),_0x1bb991[_0xf6b8('0x48')]||_0xf6b8('0x4c'));this[_0xf6b8('0x5')](_0xf6b8('0x49'),_0x1bb991['dtlsprivatekey']||_0xf6b8('0x4d'));this['setDataValue'](_0xf6b8('0x4a'),_0xf6b8('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0xf6b8('0x40')],'set':function(_0x39fcb8){this['setDataValue'](_0xf6b8('0x4e'),_0x39fcb8?_0x39fcb8[_0xf6b8('0x24')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_['map'](this[_0xf6b8('0x14')](_0xf6b8('0x4e'))[_0xf6b8('0x33')](','),function(_0x4d0f06){return parseInt(_0x4d0f06,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0xf6b8('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0xf6b8('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xf6b8('0x12')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xf6b8('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xf6b8('0x12')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xf6b8('0xf')](_0xf6b8('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xf6b8('0x4f')],'get':function(){return this[_0xf6b8('0x14')](_0xf6b8('0x50'))?this[_0xf6b8('0x14')](_0xf6b8('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xf6b8('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![],'set':function(_0x2e9505){if(typeof _0x2e9505==='string'){var _0x49963d=_0x2e9505==='1'?!![]:_0x2e9505==='0'?![]:_0x2e9505===_0xf6b8('0x51')?!![]:_0x2e9505===_0xf6b8('0x52')?![]:![];this[_0xf6b8('0x5')](_0xf6b8('0x53'),_0x49963d);}else{this[_0xf6b8('0x5')](_0xf6b8('0x53'),_0x2e9505);}}},'blocked':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![],'set':function(_0x30f9a1){this[_0xf6b8('0x5')](_0xf6b8('0x54'),_0x30f9a1);if(_0x30f9a1===!![]){this[_0xf6b8('0x5')](_0xf6b8('0x55'),moment());this[_0xf6b8('0x5')](_0xf6b8('0x56'),0x0);}else{this['setDataValue'](_0xf6b8('0x55'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xf6b8('0x12')](0x5)[_0xf6b8('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0xf6b8('0x12')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0xf6b8('0x12')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0xf6b8('0x12')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xf6b8('0x12')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0xf6b8('0x15')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0xf6b8('0x12')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0xf6b8('0x12')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0xf6b8('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 0cd24d1..d9af245 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 _0xe307=['getAgents','values','CmHopper','omit','spread','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','$and','$or','$gt','$gte','$lte','$ne','$not','$between','$notBetween','$notIn','$like','$iLike','$notILike','$overlap','$contained','$any','firstName','lastName','phone','CmContact','dialActive','retrieveApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','token','removeApiKey','apiKeyNonce','API\x20key\x20not\x20available','whoami','send','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','getPresence','unknown','ringing','teams','queues','inbound','flatten','toString','col','desc','asc','substring','uniqBy','getRealtimeAgents','offline','voiceStatus','unavailable','busy','slice','charAt','toUpperCase','QueryTypes','InteractionId','ui.createdAt','user_has_','ui.UserId\x20=\x20?','OpenTabs','messengerSoundNotification','enabled','moment','util','path','squel','ioredis','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../errors/api','APIBadRequestError','APINotFoundError','APIForbiddenrror','handleError','../../mysqldb','socket.io-emitter','redis','./user.socket','client','http','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','request','then','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','update','role','agent','emit','userNotification:recalc:','Users','user','Agents','telephone','ignore','value','name','destroy','stack','rawAttributes','map','fieldName','type','filter','password','previousPasswords','resetPasswordToken','resetPasswordExpires','md5secret','includes','index','where','User','query','includeAll','include','userSetting','true','UserSetting','push','findAll','rows','openTabs','length','chat','sms','dataValues','fax','mail','openchannel','whatsapp','all','params','getOptions','merge','options','attributes','body','describe','addContacts','ids','Setting','findById','securePassword','validatePasswordPattern','max','internal','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','from','voicemail','mailbox','fullname','permissions','101','102','113','110','104','105','106','109','111','114','115','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','create','VoiceMail','find','Telephones','userProfileId','UserProfileResource','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','UserProfileSection','isEmpty','autoAssociation','compact','Sequelize','ValidationError','authenticate','oldPassword','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','findOne','enforcePasswordHistory','addQueues','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','penalty','voice','VoiceQueue','online','format','SIP/%s','voicePause','upsert','removeQueues','channel','remove','QueueId','Queue:remove','UserVoiceQueueRt','addAvatar','userpic','getAvatar','root','server/files/images/','download','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','concat','getContacts','User\x20with\x20id\x20%s\x20not\x20found','hasOwnProperty','CmList','List','Tag','color','tag','getQueues','model','keys','Queue','filters','intersection','fields','order','sort','pick','get','nolimit','getVoiceQueuesRt','getGroups','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','getWhatsappInteractions','login','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','loginInPause','MemberReport','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','LOGIN','PAUSE','LOGININPAUSE','isMiddleware','resolve','pause','updateAttributes','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','faxPause','openchannelPause','smsPause','whatsappPause','lastPauseAt','getTeams','Team','addTeams','transaction','flattenDeep','addAgent','getDataValue','Voice','UserVoicePrefix','VoicePrefixId','Queue:save','isArray','getAssociatedQueues','removeAgent','TeamVoicePrefix','getLists'];(function(_0x405300,_0x54dc24){var _0x246df0=function(_0x21162e){while(--_0x21162e){_0x405300['push'](_0x405300['shift']());}};_0x246df0(++_0x54dc24);}(_0xe307,0x70));var _0x7e30=function(_0x813b2b,_0x478f13){_0x813b2b=_0x813b2b-0x0;var _0x5dfaa8=_0xe307[_0x813b2b];return _0x5dfaa8;};'use strict';var moment=require(_0x7e30('0x0'));var util=require(_0x7e30('0x1'));var path=require(_0x7e30('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7e30('0x3'));var Redis=require(_0x7e30('0x4'));var jayson=require(_0x7e30('0x5'));var authService=require('../../components/auth/service');var contacts=require('../../components/contacts');var qs=require(_0x7e30('0x6'));var rta=require('../../components/realtime/agents');var logger=require(_0x7e30('0x7'))(_0x7e30('0x8'));var utils=require(_0x7e30('0x9'));var config=require(_0x7e30('0xa'));var licenseUtil=require(_0x7e30('0xb'));var APIBadRequestError=require(_0x7e30('0xc'))[_0x7e30('0xd')];var APINotFoundError=require(_0x7e30('0xc'))[_0x7e30('0xe')];var APIForbiddenError=require(_0x7e30('0xc'))[_0x7e30('0xf')];var APIHandleError=require(_0x7e30('0xc'))[_0x7e30('0x10')];var db=require(_0x7e30('0x11'))['db'];var socket=require(_0x7e30('0x12'))(new Redis(config[_0x7e30('0x13')]));require(_0x7e30('0x14'))['register'](socket);config[_0x7e30('0x13')]=_['defaults'](config[_0x7e30('0x13')],{'host':'localhost','port':0x18eb});var amiClient=jayson[_0x7e30('0x15')][_0x7e30('0x16')]({'port':0x232a});var values;function respondWithStatusCode(_0x241e73,_0x2121fb){_0x2121fb=_0x2121fb||0xcc;return function(_0x5f524a){if(_0x5f524a){return _0x241e73[_0x7e30('0x17')](_0x2121fb);}return _0x241e73['status'](_0x2121fb)[_0x7e30('0x18')]();};}function respondWithResult(_0x2640a9,_0x18696d){_0x18696d=_0x18696d||0xc8;return function(_0x5011f5){if(_0x5011f5){return _0x2640a9[_0x7e30('0x19')](_0x18696d)[_0x7e30('0x1a')](_0x5011f5);}};}function respondWithFilteredResult(_0x19b1c6,_0x23358d){return function(_0x7a1c6f){if(_0x7a1c6f){var _0x4bc361=typeof _0x23358d[_0x7e30('0x1b')]===_0x7e30('0x1c')&&typeof _0x23358d[_0x7e30('0x1d')]===_0x7e30('0x1c');var _0x4e5d44=_0x7a1c6f[_0x7e30('0x1e')];var _0xeed1a0=_0x4bc361?0x0:_0x23358d['offset'];var _0x5d7eec=_0x4bc361?_0x7a1c6f[_0x7e30('0x1e')]:_0x23358d['offset']+_0x23358d[_0x7e30('0x1d')];var _0x989b20;if(_0x5d7eec>=_0x4e5d44){_0x5d7eec=_0x4e5d44;_0x989b20=0xc8;}else{_0x989b20=0xce;}_0x19b1c6[_0x7e30('0x19')](_0x989b20);return _0x19b1c6[_0x7e30('0x1f')](_0x7e30('0x20'),_0xeed1a0+'-'+_0x5d7eec+'/'+_0x4e5d44)[_0x7e30('0x1a')](_0x7a1c6f);}return null;};}function respondWithRpcPromise(_0x2837ac,_0x1b4fb3,_0x16911d,_0x432a01){return new Promise(function(_0x224aac,_0x3d882e){var _0xca8eb1=_0x432a01||amiClient;return _0xca8eb1[_0x7e30('0x21')](_0x2837ac,_0x16911d)[_0x7e30('0x22')](function(_0x4d4afa){logger['info'](_0x7e30('0x23'),_0x1b4fb3,_0x7e30('0x24'));logger[_0x7e30('0x25')](_0x7e30('0x26'),_0x1b4fb3,_0x7e30('0x24'),JSON[_0x7e30('0x27')](_0x4d4afa));if(_0x4d4afa[_0x7e30('0x28')]){if(_0x4d4afa[_0x7e30('0x28')]['code']===0x1f4){logger[_0x7e30('0x28')]('User,\x20%s,\x20%s',_0x1b4fb3,_0x4d4afa['error'][_0x7e30('0x29')]);return _0x3d882e(_0x4d4afa['error'][_0x7e30('0x29')]);}logger[_0x7e30('0x28')](_0x7e30('0x23'),_0x1b4fb3,_0x4d4afa[_0x7e30('0x28')]['message']);return _0x224aac(_0x4d4afa['error'][_0x7e30('0x29')]);}else{logger['info'](_0x7e30('0x23'),_0x1b4fb3,_0x7e30('0x24'));_0x224aac(_0x4d4afa[_0x7e30('0x2a')]['message']);}})[_0x7e30('0x2b')](function(_0x2c6151){logger[_0x7e30('0x28')](_0x7e30('0x23'),_0x1b4fb3,_0x2c6151);_0x3d882e(_0x2c6151);});});}function saveUpdates(_0x223eeb){return function(_0x165cd3){if(_0x165cd3){return _0x165cd3[_0x7e30('0x2c')](_0x223eeb)[_0x7e30('0x22')](function(_0x807e3e){if(_0x807e3e[_0x7e30('0x2d')]===_0x7e30('0x2e')){socket[_0x7e30('0x2f')](_0x7e30('0x30')+_0x807e3e['id'],_0x807e3e);}return _0x807e3e;});}return null;};}function removeEntity(_0x587547,_0x3667df){return function(_0x4c6c41){if(_0x4c6c41){return _0x4c6c41['destroy']({'transaction':_0x3667df})[_0x7e30('0x22')](function(){var _0x314e58=_0x4c6c41['get']({'plain':!![]});if(_0x314e58[_0x7e30('0x2d')]==='admin')return;var _0x265c55=[{'name':_0x7e30('0x31'),'value':_0x7e30('0x32'),'ignore':!![]},{'name':_0x7e30('0x33'),'value':'agent','ignore':![]},{'name':'Telephones','value':_0x7e30('0x34'),'ignore':![]}];var _0x3dc965=_(_0x265c55)['filter'](_0x7e30('0x35'))['map'](_0x7e30('0x36'))[_0x7e30('0x36')]();if(_['includes'](_0x3dc965,_0x314e58['role'])){return;}var _0x4110ff=_['find'](_0x265c55,[_0x7e30('0x36'),_0x314e58[_0x7e30('0x2d')]])[_0x7e30('0x37')];return db['UserProfileResource'][_0x7e30('0x38')]({'where':{'type':_0x4110ff,'resourceId':_0x314e58['id']},'transaction':_0x3667df})['then'](function(){return _0x4c6c41;});})[_0x7e30('0x22')](function(){_0x587547[_0x7e30('0x19')](0xcc)[_0x7e30('0x18')]();});}};}function handleEntityNotFound(_0x28b0a7){return function(_0x132111){if(!_0x132111){_0x28b0a7[_0x7e30('0x17')](0x194);}return _0x132111;};}function handleError(_0x29f757,_0x3b6883){_0x3b6883=_0x3b6883||0x1f4;return function(_0xbe7a06){logger['error'](_0xbe7a06[_0x7e30('0x39')]);if(_0xbe7a06[_0x7e30('0x37')]){delete _0xbe7a06[_0x7e30('0x37')];}_0x29f757[_0x7e30('0x19')](_0x3b6883)['send'](_0xbe7a06);};}function getUserAttributes(){return _(db['User'][_0x7e30('0x3a')])[_0x7e30('0x3b')](function(_0x42c34a){return{'name':_0x42c34a[_0x7e30('0x3c')],'type':_0x42c34a[_0x7e30('0x3d')]['key']};})[_0x7e30('0x3e')](function(_0x54da){return![_0x7e30('0x3f'),'salt',_0x7e30('0x40'),_0x7e30('0x41'),_0x7e30('0x42'),_0x7e30('0x43')][_0x7e30('0x44')](_0x54da[_0x7e30('0x37')]);})['value']();}exports[_0x7e30('0x45')]=function(_0x46f497,_0xda6613){var _0x4cefd4={},_0x4daad3={'count':0x0,'rows':[]};var _0x44e234=getUserAttributes();_0x4cefd4=qs['getOptions'](_0x44e234,_0x46f497);var _0x36edef={'where':_0x4cefd4[_0x7e30('0x46')]};return db[_0x7e30('0x47')][_0x7e30('0x1e')](_0x36edef)[_0x7e30('0x22')](function(_0x47b24a){_0x4daad3[_0x7e30('0x1e')]=_0x47b24a;if(_0x46f497[_0x7e30('0x48')][_0x7e30('0x49')]){_0x4cefd4[_0x7e30('0x4a')]=[{'all':!![]}];}if(_0x46f497[_0x7e30('0x48')][_0x7e30('0x4b')]===_0x7e30('0x4c')){_0x4cefd4[_0x7e30('0x4a')]=[{'model':db[_0x7e30('0x4d')],'as':_0x7e30('0x4b')}];}if(!_['includes'](_0x4cefd4['attributes'],'id')){_0x4cefd4['attributes'][_0x7e30('0x4e')]('id');}return db[_0x7e30('0x47')][_0x7e30('0x4f')](_0x4cefd4);})[_0x7e30('0x22')](function(_0x582282){_0x4daad3[_0x7e30('0x50')]=_0x582282;if(_0x46f497[_0x7e30('0x48')][_0x7e30('0x51')]===_0x7e30('0x4c')){var _0x2842ad=[];for(var _0x1e0a60=0x0;_0x1e0a60<_0x4daad3[_0x7e30('0x50')][_0x7e30('0x52')];_0x1e0a60++){_0x2842ad[_0x7e30('0x4e')](get_open_tabs(_0x7e30('0x53'),_0x4daad3['rows'][_0x1e0a60]['dataValues']));_0x2842ad[_0x7e30('0x4e')](get_open_tabs(_0x7e30('0x54'),_0x4daad3[_0x7e30('0x50')][_0x1e0a60][_0x7e30('0x55')]));_0x2842ad[_0x7e30('0x4e')](get_open_tabs(_0x7e30('0x56'),_0x4daad3[_0x7e30('0x50')][_0x1e0a60][_0x7e30('0x55')]));_0x2842ad[_0x7e30('0x4e')](get_open_tabs(_0x7e30('0x57'),_0x4daad3[_0x7e30('0x50')][_0x1e0a60][_0x7e30('0x55')]));_0x2842ad[_0x7e30('0x4e')](get_open_tabs(_0x7e30('0x58'),_0x4daad3[_0x7e30('0x50')][_0x1e0a60][_0x7e30('0x55')]));_0x2842ad['push'](get_open_tabs(_0x7e30('0x59'),_0x4daad3['rows'][_0x1e0a60][_0x7e30('0x55')]));}return Promise[_0x7e30('0x5a')](_0x2842ad)['then'](function(){return _0x4daad3;});}else{return _0x4daad3;}})[_0x7e30('0x22')](respondWithFilteredResult(_0xda6613,_0x4cefd4))[_0x7e30('0x2b')](handleError(_0xda6613,null));};exports['show']=function(_0x3d0223,_0x3cc096){var _0x38e5a8=getUserAttributes();_0x3d0223[_0x7e30('0x48')]['id']=_0x3d0223[_0x7e30('0x5b')]['id'];var _0x5e0427=qs[_0x7e30('0x5c')](_0x38e5a8,_0x3d0223);if(_0x3d0223[_0x7e30('0x48')][_0x7e30('0x49')]){_0x5e0427[_0x7e30('0x4a')]=[{'all':!![]}];}if(_0x3d0223['query'][_0x7e30('0x4b')]===_0x7e30('0x4c')){_0x5e0427[_0x7e30('0x4a')]=[{'model':db[_0x7e30('0x4d')],'as':_0x7e30('0x4b')}];}_0x5e0427=_[_0x7e30('0x5d')]({},_0x5e0427,_0x3d0223[_0x7e30('0x5e')]);if(!_['includes'](_0x5e0427['attributes'],'id')){_0x5e0427[_0x7e30('0x5f')][_0x7e30('0x4e')]('id');}return db[_0x7e30('0x47')]['find'](_0x5e0427)[_0x7e30('0x22')](handleEntityNotFound(_0x3cc096,null))[_0x7e30('0x22')](function(_0x4966c2){var _0x292c42=[];values=_0x4966c2;if(_0x3d0223['query'][_0x7e30('0x51')]===_0x7e30('0x4c')){_0x292c42[_0x7e30('0x4e')](get_open_tabs(_0x7e30('0x53'),_0x4966c2[_0x7e30('0x55')]));_0x292c42[_0x7e30('0x4e')](get_open_tabs(_0x7e30('0x54'),_0x4966c2[_0x7e30('0x55')]));_0x292c42[_0x7e30('0x4e')](get_open_tabs(_0x7e30('0x58'),_0x4966c2[_0x7e30('0x55')]));_0x292c42[_0x7e30('0x4e')](get_open_tabs('whatsapp',_0x4966c2[_0x7e30('0x55')]));_0x292c42['push'](get_open_tabs(_0x7e30('0x56'),_0x4966c2[_0x7e30('0x55')]));_0x292c42[_0x7e30('0x4e')](get_open_tabs(_0x7e30('0x57'),_0x4966c2[_0x7e30('0x55')]));return Promise['all'](_0x292c42);}else{return values;}})[_0x7e30('0x22')](function(){return values;})['then'](respondWithResult(_0x3cc096,null))['catch'](handleError(_0x3cc096,null));};exports[_0x7e30('0x2c')]=function(_0x5e7950,_0x57e219){if(_0x5e7950[_0x7e30('0x60')]['id']){delete _0x5e7950[_0x7e30('0x60')]['id'];}delete _0x5e7950[_0x7e30('0x60')][_0x7e30('0x2d')];return db[_0x7e30('0x47')]['find']({'where':{'id':_0x5e7950[_0x7e30('0x5b')]['id']}})[_0x7e30('0x22')](handleEntityNotFound(_0x57e219,null))[_0x7e30('0x22')](saveUpdates(_0x5e7950[_0x7e30('0x60')],null))[_0x7e30('0x22')](respondWithResult(_0x57e219,null))[_0x7e30('0x2b')](handleError(_0x57e219,null));};exports[_0x7e30('0x61')]=function(_0x292332,_0x4fff1b){return db[_0x7e30('0x47')][_0x7e30('0x61')]()[_0x7e30('0x22')](respondWithResult(_0x4fff1b,null))[_0x7e30('0x2b')](handleError(_0x4fff1b,null));};exports[_0x7e30('0x62')]=function(_0x5951b4,_0x4c181f){return db[_0x7e30('0x47')]['find']({'where':{'id':_0x5951b4[_0x7e30('0x5b')]['id']}})[_0x7e30('0x22')](handleEntityNotFound(_0x4c181f,null))['then'](function(_0x1a708d){if(_0x1a708d){return _0x1a708d['addContacts'](_0x5951b4[_0x7e30('0x60')][_0x7e30('0x63')],_['omit'](_0x5951b4[_0x7e30('0x60')],[_0x7e30('0x63'),'id'])||{});}})[_0x7e30('0x22')](respondWithResult(_0x4c181f,null))['catch'](handleError(_0x4c181f,null));};function validateUser(_0x3634c5){return new Promise(function(_0x1e86f3,_0x3283dd){if(_0x3634c5['internal'])return _0x1e86f3(_0x3634c5);return db[_0x7e30('0x64')][_0x7e30('0x65')](0x1)[_0x7e30('0x22')](function(_0x19834a){if(_0x19834a[_0x7e30('0x66')])authService[_0x7e30('0x67')](_0x3634c5[_0x7e30('0x3f')]);db['User'][_0x7e30('0x68')](_0x7e30('0x69'))['then'](function(_0x5a6068){if(_[_0x7e30('0x6a')](_0x5a6068)){_0x3634c5[_0x7e30('0x69')]=_0x19834a[_0x7e30('0x6b')]||0x1;return;}if(_[_0x7e30('0x6a')](_0x19834a['min_internal'])||_0x19834a[_0x7e30('0x6b')]===_0x5a6068){_0x3634c5[_0x7e30('0x69')]=_0x5a6068+0x1;return;}if(_0x19834a[_0x7e30('0x6b')]>_0x5a6068){_0x3634c5[_0x7e30('0x69')]=_0x19834a[_0x7e30('0x6b')];return;}return db[_0x7e30('0x6c')][_0x7e30('0x48')](_0x7e30('0x6d'),{'type':db[_0x7e30('0x6c')]['QueryTypes']['SELECT']})[_0x7e30('0x22')](function(_0x21344b){if(_0x21344b&&_0x21344b[_0x7e30('0x52')]){for(var _0x158fe=0x0,_0x4fb1da=_0x21344b[_0x7e30('0x52')];_0x158fe<_0x4fb1da&&_['isNil'](_0x3634c5['internal']);_0x158fe++){if(_0x19834a['min_internal']<=_0x21344b[_0x158fe][_0x7e30('0x6e')]){_0x3634c5[_0x7e30('0x69')]=_0x21344b[_0x158fe]['from'];}else if(_0x19834a[_0x7e30('0x6b')]>_0x21344b[_0x158fe][_0x7e30('0x6e')]&&_0x19834a['min_internal']<=_0x21344b[_0x158fe]['to']){_0x3634c5[_0x7e30('0x69')]=_0x19834a[_0x7e30('0x6b')];}}}if(_[_0x7e30('0x6a')](_0x3634c5[_0x7e30('0x69')])){_0x3634c5[_0x7e30('0x69')]=_0x5a6068+0x1;}return _0x1e86f3(_0x3634c5);});});})[_0x7e30('0x2b')](function(_0x158cf2){_0x3283dd(_0x158cf2);});});}function updateUser(_0x33abff){return new Promise(function(_0x4bbcb9,_0x526c4b){try{if(_0x33abff[_0x7e30('0x6f')]){_0x33abff[_0x7e30('0x70')]=_0x33abff[_0x7e30('0x69')];_0x33abff['VoiceMail']={'mailbox':_0x33abff['internal'],'password':_0x33abff[_0x7e30('0x3f')],'fullname':_0x33abff[_0x7e30('0x71')],'email':_0x33abff['email']};}if(_0x33abff[_0x7e30('0x2d')]===_0x7e30('0x2e')){if(!_0x33abff[_0x7e30('0x72')])_0x33abff[_0x7e30('0x72')]=[_0x7e30('0x73'),_0x7e30('0x74'),'103',_0x7e30('0x75'),_0x7e30('0x76'),_0x7e30('0x77'),_0x7e30('0x78'),_0x7e30('0x79'),'107','108',_0x7e30('0x7a'),'100',_0x7e30('0x7b'),_0x7e30('0x7c'),_0x7e30('0x7d')];}_0x4bbcb9(_0x33abff);}catch(_0x98e195){_0x526c4b(_0x98e195);}});}exports['create']=function(_0x8a8a41,_0x35d4c1){if(_0x8a8a41['user']['role']==='agent')throw new Error('Unauthorized');if(_0x8a8a41['body'][_0x7e30('0x2d')]===_0x7e30('0x32')&&_0x8a8a41[_0x7e30('0x32')][_0x7e30('0x2d')]!==_0x7e30('0x7e')){throw new Error(_0x7e30('0x7f'));}if(_0x8a8a41['body'][_0x7e30('0x2d')]===_0x7e30('0x7e')&&_0x8a8a41[_0x7e30('0x32')]['role']!=='admin'){throw new Error(_0x7e30('0x80'));}return licenseUtil['checkUserLimits']([_0x8a8a41[_0x7e30('0x60')]])['then'](function(){return validateUser(_0x8a8a41[_0x7e30('0x60')]);})[_0x7e30('0x22')](function(_0x4d5f18){return updateUser(_0x4d5f18)['then'](function(_0x32e526){if(_0x32e526[_0x7e30('0x2d')]===_0x7e30('0x7e')){_0x32e526[_0x7e30('0x81')]=_0x8a8a41[_0x7e30('0x32')][_0x7e30('0x81')];delete _0x32e526['userProfileId'];}return _0x32e526;});})[_0x7e30('0x22')](function(_0x22dba8){return db[_0x7e30('0x47')][_0x7e30('0x82')](_0x22dba8,{'include':[{'model':db[_0x7e30('0x83')],'as':_0x7e30('0x83')}]});})['then'](function(_0x3718f0){if(_0x8a8a41[_0x7e30('0x60')]['role']===_0x7e30('0x32'))return _0x3718f0;if(_0x8a8a41[_0x7e30('0x32')][_0x7e30('0x2d')]!==_0x7e30('0x32'))return _0x3718f0;return db['UserProfileSection'][_0x7e30('0x84')]({'where':{'name':_0x3718f0[_0x7e30('0x2d')]===_0x7e30('0x2e')?'Agents':_0x7e30('0x85'),'userProfileId':_0x8a8a41['user'][_0x7e30('0x86')]},'raw':!![]})[_0x7e30('0x22')](function(_0x4a39e8){if(!_0x4a39e8||_0x4a39e8['autoAssociation']!=0x0)return _0x3718f0;return db[_0x7e30('0x87')]['create']({'name':_0x3718f0['name'],'resourceId':_0x3718f0['id'],'type':_0x4a39e8[_0x7e30('0x37')],'sectionId':_0x4a39e8['id']},{})[_0x7e30('0x22')](function(){return _0x3718f0;});})[_0x7e30('0x2b')](function(_0x50895e){logger[_0x7e30('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50895e);throw _0x50895e;});})[_0x7e30('0x22')](respondWithResult(_0x35d4c1,0xc9))[_0x7e30('0x2b')](handleError(_0x35d4c1,null));};exports[_0x7e30('0x88')]=function(_0x38dd46,_0x1fe2e6){var _0x24d59b=_0x38dd46[_0x7e30('0x60')];var _0x1d025e=[];if(_0x38dd46[_0x7e30('0x32')][_0x7e30('0x2d')]===_0x7e30('0x2e'))throw new Error('Unauthorized');if(_['some'](_0x24d59b,[_0x7e30('0x2d'),_0x7e30('0x32')])&&_0x38dd46[_0x7e30('0x32')][_0x7e30('0x2d')]!==_0x7e30('0x7e')){throw new Error(_0x7e30('0x7f'));}if(_[_0x7e30('0x89')](_0x24d59b,[_0x7e30('0x2d'),_0x7e30('0x7e')])&&_0x38dd46['user']['role']!=='admin'){throw new Error(_0x7e30('0x8a'));}return licenseUtil[_0x7e30('0x8b')](_0x24d59b)['then'](function(){return validateUser(_0x24d59b[0x0]);})['then'](function(){for(var _0x557aba=0x1;_0x557aba<_0x24d59b[_0x7e30('0x52')];_0x557aba++){var _0x41664e=_0x24d59b[_0x557aba-0x1][_0x7e30('0x69')];if(!_0x24d59b[_0x557aba][_0x7e30('0x69')])_0x24d59b[_0x557aba][_0x7e30('0x69')]=_0x41664e+0x1;_0x1d025e['push'](validateUser(_0x24d59b[_0x557aba]));}return Promise[_0x7e30('0x5a')](_0x1d025e);})[_0x7e30('0x22')](function(){_0x1d025e=[];for(var _0x52e092=0x0;_0x52e092<_0x24d59b[_0x7e30('0x52')];_0x52e092++){_0x1d025e[_0x7e30('0x4e')](updateUser(_0x24d59b[_0x52e092]));}return Promise[_0x7e30('0x5a')](_0x1d025e);})[_0x7e30('0x22')](function(){_0x1d025e=_0x24d59b['map'](function(_0x5f43f5){return db[_0x7e30('0x47')][_0x7e30('0x82')](_0x5f43f5,{'include':[{'model':db['VoiceMail'],'as':_0x7e30('0x83')}]})[_0x7e30('0x22')](function(_0x849209){_0x5f43f5['id']=_0x849209['id'];return _0x5f43f5;});});return Promise[_0x7e30('0x5a')](_0x1d025e);})[_0x7e30('0x22')](function(_0xcbac67){if(_0x38dd46['body'][_0x7e30('0x2d')]===_0x7e30('0x32'))return _0xcbac67;if(_0x38dd46['user']['role']!=='user')return _0xcbac67;var _0x3c7a90=_[_0x7e30('0x89')](_0xcbac67,function(_0x4112a2){return _0x4112a2['role']===_0x7e30('0x2e')||_0x4112a2[_0x7e30('0x2d')]==='telephone';});if(!_0x3c7a90)return _0xcbac67;return db[_0x7e30('0x8c')]['findAll']({'where':{'name':{'$or':[_0x7e30('0x33'),_0x7e30('0x85')]},'userProfileId':_0x38dd46[_0x7e30('0x32')][_0x7e30('0x86')]},'raw':!![]})[_0x7e30('0x22')](function(_0x921f3d){if(_[_0x7e30('0x8d')](_0x921f3d)||!_['some'](_0x921f3d,[_0x7e30('0x8e'),0x0]))return _0xcbac67;_0x1d025e=[];var _0x33238f=_(_0x921f3d)['map'](function(_0x9ea506){if(_0x9ea506[_0x7e30('0x8e')]===0x1)return;return _0x9ea506[_0x7e30('0x37')]===_0x7e30('0x33')?_0x7e30('0x2e'):_0x7e30('0x34');})[_0x7e30('0x8f')]()[_0x7e30('0x36')]();for(var _0x21ee95=0x0;_0x21ee95<_0xcbac67['length'];_0x21ee95++){if(!_[_0x7e30('0x44')](_0x33238f,_0xcbac67[_0x21ee95][_0x7e30('0x2d')]))return;var _0x515d86=_0xcbac67[_0x21ee95][_0x7e30('0x2d')]===_0x7e30('0x2e')?_0x7e30('0x33'):_0x7e30('0x85');_0x1d025e[_0x7e30('0x4e')](db[_0x7e30('0x87')][_0x7e30('0x82')]({'name':_0xcbac67[_0x21ee95][_0x7e30('0x37')],'resourceId':_0xcbac67[_0x21ee95]['id'],'type':_0x515d86,'sectionId':_[_0x7e30('0x84')](_0x921f3d,[_0x7e30('0x37'),_0x515d86])['id']},{}));}return Promise['all'](_0x1d025e);});})[_0x7e30('0x22')](respondWithResult(_0x1fe2e6,0xc9))[_0x7e30('0x2b')](handleError(_0x1fe2e6,null));};exports['changePassword']=function(_0x2d0ef4,_0xa2e1b3){if(_0x2d0ef4[_0x7e30('0x60')]['id']){delete _0x2d0ef4[_0x7e30('0x60')]['id'];}return db['User'][_0x7e30('0x84')]({'where':{'id':_0x2d0ef4[_0x7e30('0x5b')]['id']}})[_0x7e30('0x22')](function(_0x1133c3){if(!_0x1133c3)return null;if(_0x1133c3['id']===_0x2d0ef4[_0x7e30('0x32')]['id']){if(!_0x2d0ef4[_0x7e30('0x60')]['oldPassword']||!_0x2d0ef4[_0x7e30('0x60')]['newPassword']){throw new db[(_0x7e30('0x90'))][(_0x7e30('0x91'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x1133c3[_0x7e30('0x92')](_0x2d0ef4[_0x7e30('0x60')]['oldPassword'])){throw new db[(_0x7e30('0x90'))][(_0x7e30('0x91'))]('Wrong\x20credentials');}if(_0x2d0ef4['body'][_0x7e30('0x93')]===_0x2d0ef4[_0x7e30('0x60')][_0x7e30('0x94')]){throw new db[(_0x7e30('0x90'))][(_0x7e30('0x91'))](_0x7e30('0x95'));}}else if(_0x2d0ef4[_0x7e30('0x32')][_0x7e30('0x2d')]===_0x7e30('0x7e')){if(!_0x2d0ef4[_0x7e30('0x60')][_0x7e30('0x94')]){throw new db[(_0x7e30('0x90'))][(_0x7e30('0x91'))](_0x7e30('0x96'));}}else if(_0x2d0ef4[_0x7e30('0x32')][_0x7e30('0x2d')]==='user'){if(!_0x2d0ef4[_0x7e30('0x60')][_0x7e30('0x94')]){throw new db[(_0x7e30('0x90'))][(_0x7e30('0x91'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x1133c3['role']!==_0x7e30('0x2e')){throw new db[(_0x7e30('0x90'))][(_0x7e30('0x91'))](_0x7e30('0x97'));}}else{throw new db[(_0x7e30('0x90'))][(_0x7e30('0x91'))]('Unauthorized');}return _0x1133c3;})['then'](handleEntityNotFound(_0xa2e1b3,null))['then'](function(_0x392fc2){return db[_0x7e30('0x64')][_0x7e30('0x98')]({'attributes':['id',_0x7e30('0x66'),_0x7e30('0x99'),'passwordHistoryLimit']})[_0x7e30('0x22')](function(_0x16e1b7){if(_0x16e1b7['securePassword'])authService[_0x7e30('0x67')](_0x2d0ef4[_0x7e30('0x60')][_0x7e30('0x94')]);if(!_0x16e1b7[_0x7e30('0x99')]||!_0x392fc2['previousPasswords'])return _0x392fc2;authService['validatePasswordHistory'](_0x2d0ef4[_0x7e30('0x60')][_0x7e30('0x94')],_0x392fc2[_0x7e30('0x40')],_0x16e1b7['passwordHistoryLimit']);return _0x392fc2;})['then'](saveUpdates({'password':_0x2d0ef4['body']['newPassword'],'passwordResetAt':_0x2d0ef4[_0x7e30('0x32')]['id']==_0x2d0ef4[_0x7e30('0x5b')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x2d0ef4['body'][_0x7e30('0x94')],_0x392fc2[_0x7e30('0x40')])},null));})[_0x7e30('0x22')](respondWithResult(_0xa2e1b3,null))[_0x7e30('0x2b')](handleError(_0xa2e1b3,null));};exports[_0x7e30('0x9a')]=function(_0x458be3,_0x2fb9e6){var _0x24b2a8=_0x458be3[_0x7e30('0x60')]['channel'];return db[_0x7e30('0x47')][_0x7e30('0x84')]({'where':{'id':_0x458be3[_0x7e30('0x5b')]['id']},'attributes':['id',_0x7e30('0x37'),'role','online','loginInPause','voicePause',_0x7e30('0x9b')]})[_0x7e30('0x22')](handleEntityNotFound(_0x2fb9e6,null))[_0x7e30('0x22')](function(_0x2f8fe8){if(_0x2f8fe8){if(!utils[_0x7e30('0x9c')](_0x24b2a8)){throw new db[(_0x7e30('0x90'))][(_0x7e30('0x91'))](_0x7e30('0x9d'));}return _0x2f8fe8[_0x7e30('0x9e')+_[_0x7e30('0x9f')](_0x24b2a8[_0x7e30('0xa0')]())+_0x7e30('0xa1')](_0x458be3[_0x7e30('0x60')][_0x7e30('0x63')],{'penalty':_0x458be3[_0x7e30('0x60')][_0x7e30('0xa2')]||0x0})['spread'](function(_0x3321a7){for(var _0x15f122=0x0;_0x15f122<_0x458be3[_0x7e30('0x60')][_0x7e30('0x63')]['length'];_0x15f122+=0x1){var _0x581452={'UserId':Number(_0x458be3[_0x7e30('0x5b')]['id'])};_0x581452[_['capitalize'](_0x24b2a8['toLowerCase']())+'QueueId']=Number(_0x458be3[_0x7e30('0x60')][_0x7e30('0x63')][_0x15f122]);socket[_0x7e30('0x2f')](_0x7e30('0x32')+_[_0x7e30('0x9f')](_0x24b2a8[_0x7e30('0xa0')]())+'Queue:save',_0x581452);}return _0x3321a7;})[_0x7e30('0x22')](function(){if(_0x24b2a8===_0x7e30('0xa3')){return db[_0x7e30('0xa4')][_0x7e30('0x4f')]({'where':{'id':_0x458be3[_0x7e30('0x60')][_0x7e30('0x63')]||[]},'raw':!![],'attributes':['id',_0x7e30('0x37')]});}})['then'](function(_0x18f473){var _0x26fbbc=_0x2f8fe8['get']({'plain':!![]});var _0x1a028c=[];if(_0x24b2a8===_0x7e30('0xa3')&&_0x26fbbc['role']===_0x7e30('0x2e')&&_0x26fbbc[_0x7e30('0xa5')]){for(let _0x200bb5=0x0;_0x200bb5<_0x18f473['length'];_0x200bb5+=0x1){_0x1a028c[_0x7e30('0x4e')]({'membername':_0x26fbbc[_0x7e30('0x37')],'UserId':_0x26fbbc['id'],'queue_name':_0x18f473[_0x200bb5]['name'],'VoiceQueueId':_0x18f473[_0x200bb5]['id'],'interface':_[_0x7e30('0x6a')](_0x26fbbc[_0x7e30('0x9b')])?util[_0x7e30('0xa6')](_0x7e30('0xa7'),_0x26fbbc[_0x7e30('0x37')]):_0x26fbbc[_0x7e30('0x9b')],'paused':_0x26fbbc[_0x7e30('0xa8')]||![],'penalty':_0x458be3[_0x7e30('0x60')][_0x7e30('0xa2')]||0x0});}return Promise[_0x7e30('0x5a')](_0x1a028c[_0x7e30('0x3b')](function(_0x3ea16f){return db['UserVoiceQueueRt'][_0x7e30('0xa9')](_0x3ea16f);}));}return _0x2f8fe8;});}})[_0x7e30('0x22')](respondWithStatusCode(_0x2fb9e6,null))['catch'](handleError(_0x2fb9e6,null));};exports[_0x7e30('0xaa')]=function(_0x22c471,_0x5c5f1a){var _0x4887c8,_0x5e0cd8;return db['User'][_0x7e30('0x84')]({'where':{'id':_0x22c471[_0x7e30('0x5b')]['id']},'attributes':['id',_0x7e30('0x37'),_0x7e30('0x2d')]})[_0x7e30('0x22')](handleEntityNotFound(_0x5c5f1a,null))[_0x7e30('0x22')](function(_0x14ba47){if(_0x14ba47){_0x4887c8=_0x14ba47;if(!_0x22c471[_0x7e30('0x48')][_0x7e30('0xab')]||!utils[_0x7e30('0x9c')](_0x22c471[_0x7e30('0x48')][_0x7e30('0xab')])){throw new db['Sequelize'][(_0x7e30('0x91'))](_0x7e30('0x9d'));}return _0x14ba47[_0x7e30('0xac')+_[_0x7e30('0x9f')](_0x22c471[_0x7e30('0x48')][_0x7e30('0xab')][_0x7e30('0xa0')]())+_0x7e30('0xa1')](_0x22c471[_0x7e30('0x48')][_0x7e30('0x63')]);}})[_0x7e30('0x22')](function(_0x26f195){if(_['isArray'](_0x22c471[_0x7e30('0x48')][_0x7e30('0x63')])){for(var _0x302728=0x0;_0x302728<_0x22c471[_0x7e30('0x48')]['ids'][_0x7e30('0x52')];_0x302728+=0x1){_0x5e0cd8={'UserId':Number(_0x22c471[_0x7e30('0x5b')]['id'])};_0x5e0cd8[_[_0x7e30('0x9f')](_0x22c471[_0x7e30('0x48')][_0x7e30('0xab')][_0x7e30('0xa0')]())+_0x7e30('0xad')]=Number(_0x22c471[_0x7e30('0x48')][_0x7e30('0x63')][_0x302728]);socket[_0x7e30('0x2f')](_0x7e30('0x32')+_[_0x7e30('0x9f')](_0x22c471[_0x7e30('0x48')][_0x7e30('0xab')][_0x7e30('0xa0')]())+'Queue:remove',_0x5e0cd8);}}else{_0x5e0cd8={'UserId':Number(_0x22c471['params']['id'])};_0x5e0cd8[_[_0x7e30('0x9f')](_0x22c471[_0x7e30('0x48')]['channel']['toLowerCase']())+_0x7e30('0xad')]=Number(_0x22c471[_0x7e30('0x48')][_0x7e30('0x63')]);socket[_0x7e30('0x2f')](_0x7e30('0x32')+_[_0x7e30('0x9f')](_0x22c471['query']['channel'][_0x7e30('0xa0')]())+_0x7e30('0xae'),_0x5e0cd8);}return _0x26f195;})[_0x7e30('0x22')](function(){if(_0x22c471['query'][_0x7e30('0xab')]===_0x7e30('0xa3')){return db[_0x7e30('0xaf')][_0x7e30('0x38')]({'where':{'UserId':_0x22c471[_0x7e30('0x5b')]['id'],'VoiceQueueId':_0x22c471[_0x7e30('0x48')][_0x7e30('0x63')]},'individualHooks':!![]})['then'](function(){return _0x4887c8;});}return _0x4887c8;})[_0x7e30('0x22')](respondWithStatusCode(_0x5c5f1a,null))[_0x7e30('0x2b')](handleError(_0x5c5f1a,null));};exports[_0x7e30('0xb0')]=function(_0xeaf8dc,_0x1e219b){_0xeaf8dc[_0x7e30('0x60')][_0x7e30('0xb1')]=_0xeaf8dc['file']['filename'];return db[_0x7e30('0x47')][_0x7e30('0x84')]({'where':{'id':_0xeaf8dc['params']['id']}})['then'](handleEntityNotFound(_0x1e219b,null))[_0x7e30('0x22')](saveUpdates(_0xeaf8dc[_0x7e30('0x60')],null))[_0x7e30('0x22')](respondWithResult(_0x1e219b,null))[_0x7e30('0x2b')](handleError(_0x1e219b,null));};exports[_0x7e30('0xb2')]=function(_0x30ba32,_0x24a4f0){var _0x24b62d=path['join'](config['root'],'server/files/images/logos/default_profile.png');return db[_0x7e30('0x47')]['find']({'where':{'id':_0x30ba32[_0x7e30('0x5b')]['id']},'attributes':['id',_0x7e30('0xb1')],'raw':!![]})['then'](handleEntityNotFound(_0x24a4f0,null))[_0x7e30('0x22')](function(_0x283ffe){if(_0x283ffe){if(_[_0x7e30('0x6a')](_0x283ffe[_0x7e30('0xb1')])){return _0x24a4f0['download'](_0x24b62d);}else{if(!fs['existsSync'](path['join'](config[_0x7e30('0xb3')],_0x7e30('0xb4'),_0x283ffe[_0x7e30('0xb1')]))){return _0x24a4f0['download'](_0x24b62d);}return _0x24a4f0[_0x7e30('0xb5')](path['join'](config[_0x7e30('0xb3')],_0x7e30('0xb4'),_0x283ffe['userpic']));}}})[_0x7e30('0x2b')](handleError(_0x24a4f0,null));};exports[_0x7e30('0xb6')]=function(_0x4fad75,_0x563e8f){return db['User'][_0x7e30('0x84')]({'where':{'id':_0x4fad75[_0x7e30('0x5b')]['id']},'attributes':['id']})[_0x7e30('0x22')](handleEntityNotFound(_0x563e8f,null))[_0x7e30('0x22')](function(_0x347bab){var _0x42fdcf=[];values=_0x347bab[_0x7e30('0x55')];_0x42fdcf[_0x7e30('0x4e')](get_open_tabs(_0x7e30('0x53'),_0x347bab[_0x7e30('0x55')]));_0x42fdcf[_0x7e30('0x4e')](get_open_tabs('sms',_0x347bab[_0x7e30('0x55')]));_0x42fdcf[_0x7e30('0x4e')](get_open_tabs(_0x7e30('0x58'),_0x347bab[_0x7e30('0x55')]));_0x42fdcf['push'](get_open_tabs(_0x7e30('0x59'),_0x347bab[_0x7e30('0x55')]));_0x42fdcf[_0x7e30('0x4e')](get_open_tabs(_0x7e30('0x56'),_0x347bab['dataValues']));_0x42fdcf[_0x7e30('0x4e')](get_open_tabs(_0x7e30('0x57'),_0x347bab[_0x7e30('0x55')]));return Promise[_0x7e30('0x5a')](_0x42fdcf);})['then'](function(_0x34dd4f){if(_0x34dd4f){var _0x45e60a=_['map'](values[_0x7e30('0xb7')],function(_0x511e0f){return{'channel':_0x7e30('0xb8'),'id':_0x511e0f['id'],'createdAt':_0x511e0f[_0x7e30('0xb9')]};});var _0x653449=_[_0x7e30('0x3b')](values[_0x7e30('0xba')],function(_0x4d1d9b){return{'channel':'FAX','id':_0x4d1d9b['id'],'createdAt':_0x4d1d9b[_0x7e30('0xb9')]};});var _0x2bb946=_[_0x7e30('0x3b')](values[_0x7e30('0xbb')],function(_0x1e6ba0){return{'channel':_0x7e30('0xbc'),'id':_0x1e6ba0['id'],'createdAt':_0x1e6ba0['createdAt']};});var _0x347fd2=_[_0x7e30('0x3b')](values[_0x7e30('0xbd')],function(_0x527314){return{'channel':_0x7e30('0xbe'),'id':_0x527314['id'],'createdAt':_0x527314[_0x7e30('0xb9')]};});var _0x600b60=_[_0x7e30('0x3b')](values[_0x7e30('0xbf')],function(_0x1b8a0f){return{'channel':_0x7e30('0xc0'),'id':_0x1b8a0f['id'],'createdAt':_0x1b8a0f[_0x7e30('0xb9')]};});var _0x2c2c7d=_[_0x7e30('0x3b')](values[_0x7e30('0xc1')],function(_0x30974a){return{'channel':'WHATSAPP','id':_0x30974a['id'],'createdAt':_0x30974a['createdAt']};});var _0x19280a=_[_0x7e30('0xc2')](_0x45e60a,_0x653449,_0x2bb946,_0x347fd2,_0x600b60,_0x2c2c7d);var _0x533127={'count':_0x19280a['length'],'rows':_0x19280a};return _0x533127;}else return null;})[_0x7e30('0x22')](respondWithResult(_0x563e8f,null))[_0x7e30('0x2b')](handleError(_0x563e8f,null));};exports[_0x7e30('0xc3')]=function(_0x4f7038,_0x4baf21){var _0x16bb17={};return db['User'][_0x7e30('0x98')]({'where':{'id':_0x4f7038[_0x7e30('0x5b')]['id']}})[_0x7e30('0x22')](function(_0x574a36){if(!_0x574a36){throw new APINotFoundError(util[_0x7e30('0xa6')](_0x7e30('0xc4'),_0x4f7038[_0x7e30('0x5b')]['id']));}return contacts[_0x7e30('0x61')]();})['then'](function(_0x5b44b9){_0x4f7038[_0x7e30('0x48')][_0x7e30('0x47')]=_0x4f7038['params']['id'];_0x16bb17=qs[_0x7e30('0x5c')](_0x5b44b9,_0x4f7038);if(_0x4f7038[_0x7e30('0x48')][_0x7e30('0xc5')](_0x7e30('0x49'))){_0x16bb17[_0x7e30('0x4a')]=[{'model':db[_0x7e30('0xc6')],'as':_0x7e30('0xc7'),'required':![]},{'model':db[_0x7e30('0xc8')],'as':'Tags','attributes':['id',_0x7e30('0x37'),_0x7e30('0xc9')],'where':_0x4f7038[_0x7e30('0x48')][_0x7e30('0xca')]?{'id':_0x4f7038['query'][_0x7e30('0xca')]}:undefined,'required':_0x4f7038['query'][_0x7e30('0xca')]?!![]:![]}];}return contacts[_0x7e30('0x4f')](_0x4f7038[_0x7e30('0x48')],_0x4f7038[_0x7e30('0x32')],_0x16bb17,_0x5b44b9);})[_0x7e30('0x22')](respondWithFilteredResult(_0x4baf21,_0x16bb17))[_0x7e30('0x2b')](APIHandleError(_0x4baf21));};exports[_0x7e30('0xcb')]=function(_0x4e729f,_0x3ded63){var _0x3b00c1;var _0x45d98b={};var _0x3aa03f;return db[_0x7e30('0x47')][_0x7e30('0x98')]({'where':{'id':_0x4e729f[_0x7e30('0x5b')]['id']},'attributes':['id',_0x7e30('0x37'),_0x7e30('0x2d')]})[_0x7e30('0x22')](handleEntityNotFound(_0x3ded63,null))[_0x7e30('0x22')](function(_0x21d8ff){if(!utils[_0x7e30('0x9c')](_0x4e729f[_0x7e30('0x48')][_0x7e30('0xab')])){throw new db['Sequelize'][(_0x7e30('0x91'))](_0x7e30('0x9d'));}_0x3b00c1=_0x21d8ff;var _0x46550e={};_0x46550e[_0x7e30('0xcc')]=_[_0x7e30('0xcd')](db[_[_0x7e30('0x9f')](_0x4e729f['query']['channel'])+_0x7e30('0xce')][_0x7e30('0x3a')]);_0x46550e['query']=_[_0x7e30('0xcd')](_0x4e729f[_0x7e30('0x48')]);_0x46550e[_0x7e30('0xcf')]=_['intersection'](_0x46550e[_0x7e30('0xcc')],_0x46550e[_0x7e30('0x48')]);_0x45d98b[_0x7e30('0x5f')]=_[_0x7e30('0xd0')](_0x46550e[_0x7e30('0xcc')],qs[_0x7e30('0xd1')](_0x4e729f['query'][_0x7e30('0xd1')]));_0x45d98b[_0x7e30('0x5f')]=_0x45d98b['attributes'][_0x7e30('0x52')]?_0x45d98b[_0x7e30('0x5f')]:_0x46550e[_0x7e30('0xcc')];_0x45d98b[_0x7e30('0xd2')]=qs[_0x7e30('0xd3')](_0x4e729f[_0x7e30('0x48')][_0x7e30('0xd3')]);_0x45d98b['where']=qs[_0x7e30('0xcf')](_[_0x7e30('0xd4')](_0x4e729f[_0x7e30('0x48')],_0x46550e[_0x7e30('0xcf')]));if(_0x4e729f['query'][_0x7e30('0x3e')]){_0x45d98b[_0x7e30('0x46')]=_[_0x7e30('0x5d')](_0x45d98b['where'],{'$or':_['map'](_0x45d98b[_0x7e30('0x5f')],function(_0x383b49){var _0x5079e8={};_0x5079e8[_0x383b49]={'$like':'%'+_0x4e729f['query'][_0x7e30('0x3e')]+'%'};return _0x5079e8;})});}_0x45d98b=_['merge']({},_0x45d98b,_0x4e729f[_0x7e30('0x5e')]);switch(_0x3b00c1['role']){case _0x7e30('0x7e'):return db[_[_0x7e30('0x9f')](_0x4e729f['query']['channel'])+'Queue'][_0x7e30('0x4f')](_0x45d98b);case _0x7e30('0x32'):case _0x7e30('0x2e'):return _0x3b00c1[_0x7e30('0xd5')+_[_0x7e30('0x9f')](_0x4e729f[_0x7e30('0x48')][_0x7e30('0xab')])+_0x7e30('0xa1')](_0x45d98b);default:throw new db[(_0x7e30('0x90'))]['ValidationError']('Unknown\x20role');}})[_0x7e30('0x22')](function(_0x563615){_0x3aa03f=_0x563615[_0x7e30('0x52')];if(!_0x4e729f['query'][_0x7e30('0xc5')](_0x7e30('0xd6'))){_0x45d98b[_0x7e30('0x1d')]=qs[_0x7e30('0x1d')](_0x4e729f[_0x7e30('0x48')]['limit']);_0x45d98b['offset']=qs[_0x7e30('0x1b')](_0x4e729f['query']['offset']);}switch(_0x3b00c1['role']){case'admin':return db[_[_0x7e30('0x9f')](_0x4e729f[_0x7e30('0x48')][_0x7e30('0xab')])+_0x7e30('0xce')][_0x7e30('0x4f')](_0x45d98b);case _0x7e30('0x32'):case _0x7e30('0x2e'):return _0x3b00c1[_0x7e30('0xd5')+_[_0x7e30('0x9f')](_0x4e729f['query'][_0x7e30('0xab')])+_0x7e30('0xa1')](_0x45d98b);}})['then'](function(_0x21cdc0){return{'count':_0x3aa03f,'rows':_0x21cdc0};})[_0x7e30('0x22')](respondWithResult(_0x3ded63,null))[_0x7e30('0x2b')](handleError(_0x3ded63,null));};exports[_0x7e30('0xd7')]=function(_0x476979,_0x12b699){var _0x33627b={};var _0x3d19fc={};var _0x4c42dd;var _0x5a59aa;return db[_0x7e30('0x47')][_0x7e30('0x98')]({'where':{'id':_0x476979[_0x7e30('0x5b')]['id']}})['then'](handleEntityNotFound(_0x12b699,null))['then'](function(_0x41ecca){if(_0x41ecca){_0x4c42dd=_0x41ecca;_0x3d19fc[_0x7e30('0xcc')]=_['keys'](db[_0x7e30('0xaf')][_0x7e30('0x3a')]);_0x3d19fc[_0x7e30('0x48')]=_[_0x7e30('0xcd')](_0x476979[_0x7e30('0x48')]);_0x3d19fc[_0x7e30('0xcf')]=_[_0x7e30('0xd0')](_0x3d19fc[_0x7e30('0xcc')],_0x3d19fc['query']);_0x33627b[_0x7e30('0x5f')]=_[_0x7e30('0xd0')](_0x3d19fc[_0x7e30('0xcc')],qs[_0x7e30('0xd1')](_0x476979[_0x7e30('0x48')][_0x7e30('0xd1')]));_0x33627b[_0x7e30('0x5f')]=_0x33627b[_0x7e30('0x5f')]['length']?_0x33627b['attributes']:_0x3d19fc[_0x7e30('0xcc')];_0x33627b[_0x7e30('0xd2')]=qs[_0x7e30('0xd3')](_0x476979[_0x7e30('0x48')][_0x7e30('0xd3')]);_0x33627b[_0x7e30('0x46')]=qs[_0x7e30('0xcf')](_[_0x7e30('0xd4')](_0x476979[_0x7e30('0x48')],_0x3d19fc[_0x7e30('0xcf')]));if(_0x476979[_0x7e30('0x48')]['filter']){_0x33627b[_0x7e30('0x46')]=_[_0x7e30('0x5d')](_0x33627b['where'],{'$or':_['map'](_0x33627b[_0x7e30('0x5f')],function(_0x9c62af){var _0x4076af={};_0x4076af[_0x9c62af]={'$like':'%'+_0x476979[_0x7e30('0x48')][_0x7e30('0x3e')]+'%'};return _0x4076af;})});}_0x33627b=_[_0x7e30('0x5d')]({},_0x33627b,_0x476979['options']);return _0x4c42dd[_0x7e30('0xd7')](_0x33627b);}})[_0x7e30('0x22')](function(_0x180cc6){if(_0x180cc6){_0x5a59aa=_0x180cc6[_0x7e30('0x52')];if(!_0x476979[_0x7e30('0x48')][_0x7e30('0xc5')](_0x7e30('0xd6'))){_0x33627b[_0x7e30('0x1d')]=qs[_0x7e30('0x1d')](_0x476979[_0x7e30('0x48')][_0x7e30('0x1d')]);_0x33627b[_0x7e30('0x1b')]=qs[_0x7e30('0x1b')](_0x476979[_0x7e30('0x48')][_0x7e30('0x1b')]);}return _0x4c42dd['getVoiceQueuesRt'](_0x33627b);}})['then'](function(_0x160c43){if(_0x160c43){return _0x160c43?{'count':_0x5a59aa,'rows':_0x160c43}:null;}})[_0x7e30('0x22')](respondWithResult(_0x12b699,null))[_0x7e30('0x2b')](handleError(_0x12b699,null));};exports[_0x7e30('0xd8')]=function(_0x354345,_0xbb3629){var _0x22d490={};var _0x3e30ec={};var _0x4337aa;var _0x4f7d39;return db[_0x7e30('0x47')][_0x7e30('0x98')]({'where':{'id':_0x354345[_0x7e30('0x5b')]['id']}})['then'](handleEntityNotFound(_0xbb3629,null))['then'](function(_0x108155){if(_0x108155){_0x4337aa=_0x108155;_0x3e30ec[_0x7e30('0xcc')]=_[_0x7e30('0xcd')](db['ChatGroup'][_0x7e30('0x3a')]);_0x3e30ec[_0x7e30('0x48')]=_[_0x7e30('0xcd')](_0x354345[_0x7e30('0x48')]);_0x3e30ec[_0x7e30('0xcf')]=_[_0x7e30('0xd0')](_0x3e30ec[_0x7e30('0xcc')],_0x3e30ec[_0x7e30('0x48')]);_0x22d490[_0x7e30('0x5f')]=_[_0x7e30('0xd0')](_0x3e30ec[_0x7e30('0xcc')],qs[_0x7e30('0xd1')](_0x354345[_0x7e30('0x48')][_0x7e30('0xd1')]));_0x22d490[_0x7e30('0x5f')]=_0x22d490[_0x7e30('0x5f')][_0x7e30('0x52')]?_0x22d490[_0x7e30('0x5f')]:_0x3e30ec[_0x7e30('0xcc')];_0x22d490[_0x7e30('0xd2')]=qs[_0x7e30('0xd3')](_0x354345[_0x7e30('0x48')][_0x7e30('0xd3')]);_0x22d490[_0x7e30('0x46')]=qs['filters'](_[_0x7e30('0xd4')](_0x354345['query'],_0x3e30ec[_0x7e30('0xcf')]));if(_0x354345[_0x7e30('0x48')][_0x7e30('0x3e')]){_0x22d490['where']=_[_0x7e30('0x5d')](_0x22d490[_0x7e30('0x46')],{'$or':_['map'](_0x22d490['attributes'],function(_0x40d5d1){var _0x472c8e={};_0x472c8e[_0x40d5d1]={'$like':'%'+_0x354345[_0x7e30('0x48')][_0x7e30('0x3e')]+'%'};return _0x472c8e;})});}_0x22d490=_[_0x7e30('0x5d')]({},_0x22d490,_0x354345['options']);return _0x4337aa['getGroups'](_0x22d490);}})[_0x7e30('0x22')](function(_0x41bf69){if(_0x41bf69){_0x4f7d39=_0x41bf69['length'];if(!_0x354345[_0x7e30('0x48')][_0x7e30('0xc5')](_0x7e30('0xd6'))){_0x22d490[_0x7e30('0x1d')]=qs[_0x7e30('0x1d')](_0x354345[_0x7e30('0x48')]['limit']);_0x22d490[_0x7e30('0x1b')]=qs['offset'](_0x354345[_0x7e30('0x48')][_0x7e30('0x1b')]);}return _0x4337aa[_0x7e30('0xd8')](_0x22d490);}})[_0x7e30('0x22')](function(_0x229d13){if(_0x229d13){return _0x229d13?{'count':_0x4f7d39,'rows':_0x229d13}:null;}})[_0x7e30('0x22')](respondWithResult(_0xbb3629,null))[_0x7e30('0x2b')](handleError(_0xbb3629,null));};exports['getRecordings']=function(_0x14e9e4,_0x26a602){var _0xc62bf1={'raw':!![],'where':{}};var _0x4abe04={};var _0x37fab9={'count':0x0,'rows':[]};return db[_0x7e30('0x47')][_0x7e30('0x98')]({'where':{'id':_0x14e9e4['params']['id']}})['then'](handleEntityNotFound(_0x26a602,null))[_0x7e30('0x22')](function(_0x207856){if(_0x207856){_0x4abe04[_0x7e30('0xcc')]=_[_0x7e30('0xcd')](db[_0x7e30('0xd9')][_0x7e30('0x3a')]);_0x4abe04[_0x7e30('0x48')]=_[_0x7e30('0xcd')](_0x14e9e4['query']);_0x4abe04['filters']=_[_0x7e30('0xd0')](_0x4abe04[_0x7e30('0xcc')],_0x4abe04[_0x7e30('0x48')]);_0xc62bf1[_0x7e30('0x5f')]=_[_0x7e30('0xd0')](_0x4abe04['model'],qs[_0x7e30('0xd1')](_0x14e9e4[_0x7e30('0x48')][_0x7e30('0xd1')]));_0xc62bf1['attributes']=_0xc62bf1[_0x7e30('0x5f')][_0x7e30('0x52')]?_0xc62bf1[_0x7e30('0x5f')]:_0x4abe04[_0x7e30('0xcc')];if(!_0x14e9e4['query'][_0x7e30('0xc5')](_0x7e30('0xd6'))){_0xc62bf1[_0x7e30('0x1d')]=qs['limit'](_0x14e9e4['query'][_0x7e30('0x1d')]);_0xc62bf1[_0x7e30('0x1b')]=qs[_0x7e30('0x1b')](_0x14e9e4[_0x7e30('0x48')][_0x7e30('0x1b')]);}_0xc62bf1['order']=qs[_0x7e30('0xd3')](_0x14e9e4[_0x7e30('0x48')][_0x7e30('0xd3')]);_0xc62bf1['where']=qs[_0x7e30('0xcf')](_['pick'](_0x14e9e4[_0x7e30('0x48')],_0x4abe04[_0x7e30('0xcf')]));_0xc62bf1[_0x7e30('0x46')][_0x7e30('0xda')]=_0x207856['id'];if(_0x14e9e4[_0x7e30('0x48')][_0x7e30('0x3e')]){_0xc62bf1[_0x7e30('0x46')]=_['merge'](_0xc62bf1[_0x7e30('0x46')],{'$or':_[_0x7e30('0x3b')](_0xc62bf1[_0x7e30('0x5f')],function(_0x26d6f5){var _0x35fc84={};_0x35fc84[_0x26d6f5]={'$like':'%'+_0x14e9e4[_0x7e30('0x48')][_0x7e30('0x3e')]+'%'};return _0x35fc84;})});}_0xc62bf1=_[_0x7e30('0x5d')]({},_0xc62bf1,_0x14e9e4[_0x7e30('0x5e')]);return db[_0x7e30('0xd9')]['count']({'where':_0xc62bf1[_0x7e30('0x46')]})['then'](function(_0x152563){_0x37fab9[_0x7e30('0x1e')]=_0x152563;if(_0x14e9e4[_0x7e30('0x48')][_0x7e30('0x49')]){_0xc62bf1['include']=[{'all':!![]}];}return db[_0x7e30('0xd9')][_0x7e30('0x4f')](_0xc62bf1);})[_0x7e30('0x22')](function(_0x3283d2){_0x37fab9[_0x7e30('0x50')]=_0x3283d2;return _0x37fab9;});}})['then'](respondWithFilteredResult(_0x26a602,_0xc62bf1))[_0x7e30('0x2b')](handleError(_0x26a602,null));};exports[_0x7e30('0xdb')]=function(_0x3a14b3,_0x57c899){var _0x246639={'raw':!![],'where':{}};var _0x41cc6e={};var _0x659ec4={'count':0x0,'rows':[]};return db[_0x7e30('0x47')][_0x7e30('0x98')]({'where':{'id':_0x3a14b3[_0x7e30('0x5b')]['id']}})[_0x7e30('0x22')](handleEntityNotFound(_0x57c899,null))[_0x7e30('0x22')](function(_0x2e9e03){if(_0x2e9e03){_0x41cc6e[_0x7e30('0xcc')]=_[_0x7e30('0xcd')](db[_0x7e30('0xdc')][_0x7e30('0x3a')]);_0x41cc6e[_0x7e30('0x48')]=_[_0x7e30('0xcd')](_0x3a14b3['query']);_0x41cc6e[_0x7e30('0xcf')]=_[_0x7e30('0xd0')](_0x41cc6e[_0x7e30('0xcc')],_0x41cc6e[_0x7e30('0x48')]);_0x246639[_0x7e30('0x5f')]=_[_0x7e30('0xd0')](_0x41cc6e['model'],qs[_0x7e30('0xd1')](_0x3a14b3[_0x7e30('0x48')][_0x7e30('0xd1')]));_0x246639[_0x7e30('0x5f')]=_0x246639[_0x7e30('0x5f')][_0x7e30('0x52')]?_0x246639[_0x7e30('0x5f')]:_0x41cc6e['model'];if(!_0x3a14b3['query']['hasOwnProperty'](_0x7e30('0xd6'))){_0x246639[_0x7e30('0x1d')]=qs[_0x7e30('0x1d')](_0x3a14b3[_0x7e30('0x48')][_0x7e30('0x1d')]);_0x246639[_0x7e30('0x1b')]=qs[_0x7e30('0x1b')](_0x3a14b3[_0x7e30('0x48')][_0x7e30('0x1b')]);}_0x246639['order']=qs[_0x7e30('0xd3')](_0x3a14b3[_0x7e30('0x48')][_0x7e30('0xd3')]);_0x246639[_0x7e30('0x46')]=qs['filters'](_[_0x7e30('0xd4')](_0x3a14b3[_0x7e30('0x48')],_0x41cc6e[_0x7e30('0xcf')]));_0x246639[_0x7e30('0x46')][_0x7e30('0xda')]=_0x2e9e03['id'];if(_0x3a14b3[_0x7e30('0x48')][_0x7e30('0x3e')]){_0x246639[_0x7e30('0x46')]=_[_0x7e30('0x5d')](_0x246639[_0x7e30('0x46')],{'$or':_[_0x7e30('0x3b')](_0x246639[_0x7e30('0x5f')],function(_0x24d660){var _0x2daa7b={};_0x2daa7b[_0x24d660]={'$like':'%'+_0x3a14b3['query']['filter']+'%'};return _0x2daa7b;})});}_0x246639=_[_0x7e30('0x5d')]({},_0x246639,_0x3a14b3[_0x7e30('0x5e')]);return db[_0x7e30('0xdc')][_0x7e30('0x1e')]({'where':_0x246639[_0x7e30('0x46')]})[_0x7e30('0x22')](function(_0x29b7ac){_0x659ec4['count']=_0x29b7ac;if(_0x3a14b3['query'][_0x7e30('0x49')]){_0x246639[_0x7e30('0x4a')]=[{'all':!![]}];}return db[_0x7e30('0xdc')][_0x7e30('0x4f')](_0x246639);})[_0x7e30('0x22')](function(_0x17d28a){_0x659ec4['rows']=_0x17d28a;return _0x659ec4;});}})[_0x7e30('0x22')](respondWithFilteredResult(_0x57c899,_0x246639))['catch'](handleError(_0x57c899,null));};exports['getChatInteractions']=function(_0x4c6802,_0x270840){var _0x3ad062={};var _0x571e0c={};var _0x11a5b6;var _0x47824a;return db[_0x7e30('0x47')][_0x7e30('0x98')]({'where':{'id':_0x4c6802[_0x7e30('0x5b')]['id']}})[_0x7e30('0x22')](handleEntityNotFound(_0x270840,null))[_0x7e30('0x22')](function(_0x41d6a7){if(_0x41d6a7){_0x11a5b6=_0x41d6a7;_0x571e0c['model']=_['keys'](db[_0x7e30('0xdd')][_0x7e30('0x3a')]);_0x571e0c[_0x7e30('0x48')]=_['keys'](_0x4c6802[_0x7e30('0x48')]);_0x571e0c[_0x7e30('0xcf')]=_[_0x7e30('0xd0')](_0x571e0c[_0x7e30('0xcc')],_0x571e0c['query']);_0x3ad062[_0x7e30('0x5f')]=_[_0x7e30('0xd0')](_0x571e0c[_0x7e30('0xcc')],qs[_0x7e30('0xd1')](_0x4c6802['query']['fields']));_0x3ad062[_0x7e30('0x5f')]=_0x3ad062[_0x7e30('0x5f')][_0x7e30('0x52')]?_0x3ad062[_0x7e30('0x5f')]:_0x571e0c[_0x7e30('0xcc')];_0x3ad062[_0x7e30('0xd2')]=qs['sort'](_0x4c6802['query'][_0x7e30('0xd3')]);_0x3ad062[_0x7e30('0x46')]=qs[_0x7e30('0xcf')](_[_0x7e30('0xd4')](_0x4c6802[_0x7e30('0x48')],_0x571e0c['filters']));if(_0x4c6802[_0x7e30('0x48')][_0x7e30('0x3e')]){_0x3ad062[_0x7e30('0x46')]=_[_0x7e30('0x5d')](_0x3ad062[_0x7e30('0x46')],{'$or':_[_0x7e30('0x3b')](_0x3ad062['attributes'],function(_0x306c02){var _0x56fc77={};_0x56fc77[_0x306c02]={'$like':'%'+_0x4c6802[_0x7e30('0x48')]['filter']+'%'};return _0x56fc77;})});}_0x3ad062=_[_0x7e30('0x5d')]({},_0x3ad062,_0x4c6802[_0x7e30('0x5e')]);return _0x11a5b6[_0x7e30('0xde')](_0x3ad062);}})[_0x7e30('0x22')](function(_0x3d0c9a){if(_0x3d0c9a){_0x47824a=_0x3d0c9a['length'];if(!_0x4c6802[_0x7e30('0x48')][_0x7e30('0xc5')]('nolimit')){_0x3ad062['limit']=qs[_0x7e30('0x1d')](_0x4c6802['query']['limit']);_0x3ad062[_0x7e30('0x1b')]=qs['offset'](_0x4c6802[_0x7e30('0x48')]['offset']);}return _0x11a5b6[_0x7e30('0xde')](_0x3ad062);}})[_0x7e30('0x22')](function(_0x4f2c1f){if(_0x4f2c1f){return _0x4f2c1f?{'count':_0x47824a,'rows':_0x4f2c1f}:null;}})['then'](respondWithResult(_0x270840,null))[_0x7e30('0x2b')](handleError(_0x270840,null));};exports[_0x7e30('0xdf')]=function(_0x7450a6,_0x155dc5){var _0x11621e={};var _0x2549cd={};var _0x2aa16f;var _0x4c0e57;return db[_0x7e30('0x47')][_0x7e30('0x98')]({'where':{'id':_0x7450a6[_0x7e30('0x5b')]['id']}})[_0x7e30('0x22')](handleEntityNotFound(_0x155dc5,null))[_0x7e30('0x22')](function(_0x32e487){if(_0x32e487){_0x2aa16f=_0x32e487;_0x2549cd[_0x7e30('0xcc')]=_[_0x7e30('0xcd')](db['OpenchannelInteraction'][_0x7e30('0x3a')]);_0x2549cd[_0x7e30('0x48')]=_[_0x7e30('0xcd')](_0x7450a6['query']);_0x2549cd[_0x7e30('0xcf')]=_['intersection'](_0x2549cd[_0x7e30('0xcc')],_0x2549cd['query']);_0x11621e['attributes']=_[_0x7e30('0xd0')](_0x2549cd[_0x7e30('0xcc')],qs[_0x7e30('0xd1')](_0x7450a6[_0x7e30('0x48')]['fields']));_0x11621e[_0x7e30('0x5f')]=_0x11621e[_0x7e30('0x5f')][_0x7e30('0x52')]?_0x11621e['attributes']:_0x2549cd[_0x7e30('0xcc')];_0x11621e['order']=qs[_0x7e30('0xd3')](_0x7450a6[_0x7e30('0x48')][_0x7e30('0xd3')]);_0x11621e['where']=qs[_0x7e30('0xcf')](_['pick'](_0x7450a6[_0x7e30('0x48')],_0x2549cd[_0x7e30('0xcf')]));if(_0x7450a6[_0x7e30('0x48')]['filter']){_0x11621e[_0x7e30('0x46')]=_[_0x7e30('0x5d')](_0x11621e[_0x7e30('0x46')],{'$or':_[_0x7e30('0x3b')](_0x11621e[_0x7e30('0x5f')],function(_0x53895f){var _0x10d133={};_0x10d133[_0x53895f]={'$like':'%'+_0x7450a6[_0x7e30('0x48')][_0x7e30('0x3e')]+'%'};return _0x10d133;})});}_0x11621e=_[_0x7e30('0x5d')]({},_0x11621e,_0x7450a6[_0x7e30('0x5e')]);return _0x2aa16f['getOpenchannelInteractions'](_0x11621e);}})[_0x7e30('0x22')](function(_0x499864){if(_0x499864){_0x4c0e57=_0x499864[_0x7e30('0x52')];if(!_0x7450a6['query'][_0x7e30('0xc5')](_0x7e30('0xd6'))){_0x11621e[_0x7e30('0x1d')]=qs['limit'](_0x7450a6[_0x7e30('0x48')]['limit']);_0x11621e['offset']=qs['offset'](_0x7450a6[_0x7e30('0x48')][_0x7e30('0x1b')]);}return _0x2aa16f[_0x7e30('0xdf')](_0x11621e);}})[_0x7e30('0x22')](function(_0x2c6424){if(_0x2c6424){return _0x2c6424?{'count':_0x4c0e57,'rows':_0x2c6424}:null;}})['then'](respondWithResult(_0x155dc5,null))[_0x7e30('0x2b')](handleError(_0x155dc5,null));};exports[_0x7e30('0xe0')]=function(_0x5b3a14,_0x13c4d1){var _0x10a249={'raw':!![],'where':{}};var _0x6ee6a6={};var _0xcdcef={'count':0x0,'rows':[]};return db[_0x7e30('0x47')][_0x7e30('0x98')]({'where':{'id':_0x5b3a14[_0x7e30('0x5b')]['id']}})['then'](handleEntityNotFound(_0x13c4d1,null))[_0x7e30('0x22')](function(_0x50dd46){if(_0x50dd46){_0x6ee6a6['model']=_[_0x7e30('0xcd')](db[_0x7e30('0xe1')][_0x7e30('0x3a')]);_0x6ee6a6[_0x7e30('0x48')]=_[_0x7e30('0xcd')](_0x5b3a14[_0x7e30('0x48')]);_0x6ee6a6[_0x7e30('0xcf')]=_[_0x7e30('0xd0')](_0x6ee6a6[_0x7e30('0xcc')],_0x6ee6a6[_0x7e30('0x48')]);_0x10a249[_0x7e30('0x5f')]=_[_0x7e30('0xd0')](_0x6ee6a6['model'],qs[_0x7e30('0xd1')](_0x5b3a14['query'][_0x7e30('0xd1')]));_0x10a249[_0x7e30('0x5f')]=_0x10a249[_0x7e30('0x5f')][_0x7e30('0x52')]?_0x10a249['attributes']:_0x6ee6a6[_0x7e30('0xcc')];if(!_0x5b3a14[_0x7e30('0x48')][_0x7e30('0xc5')](_0x7e30('0xd6'))){_0x10a249[_0x7e30('0x1d')]=qs[_0x7e30('0x1d')](_0x5b3a14[_0x7e30('0x48')][_0x7e30('0x1d')]);_0x10a249[_0x7e30('0x1b')]=qs['offset'](_0x5b3a14['query'][_0x7e30('0x1b')]);}_0x10a249['order']=qs[_0x7e30('0xd3')](_0x5b3a14[_0x7e30('0x48')][_0x7e30('0xd3')]);_0x10a249[_0x7e30('0x46')]=qs['filters'](_[_0x7e30('0xd4')](_0x5b3a14[_0x7e30('0x48')],_0x6ee6a6[_0x7e30('0xcf')]));_0x10a249[_0x7e30('0x46')][_0x7e30('0xda')]=_0x50dd46['id'];if(_0x5b3a14[_0x7e30('0x48')][_0x7e30('0x3e')]){_0x10a249[_0x7e30('0x46')]=_['merge'](_0x10a249[_0x7e30('0x46')],{'$or':_[_0x7e30('0x3b')](_0x10a249[_0x7e30('0x5f')],function(_0x4b216f){var _0x36b5e2={};_0x36b5e2[_0x4b216f]={'$like':'%'+_0x5b3a14[_0x7e30('0x48')][_0x7e30('0x3e')]+'%'};return _0x36b5e2;})});}_0x10a249=_[_0x7e30('0x5d')]({},_0x10a249,_0x5b3a14[_0x7e30('0x5e')]);return db['MailInteraction'][_0x7e30('0x1e')]({'where':_0x10a249['where']})[_0x7e30('0x22')](function(_0xa44dd4){_0xcdcef[_0x7e30('0x1e')]=_0xa44dd4;if(_0x5b3a14[_0x7e30('0x48')][_0x7e30('0x49')]){_0x10a249['include']=[{'all':!![]}];}return db['MailInteraction'][_0x7e30('0x4f')](_0x10a249);})[_0x7e30('0x22')](function(_0x5d19a5){_0xcdcef[_0x7e30('0x50')]=_0x5d19a5;return _0xcdcef;});}})[_0x7e30('0x22')](respondWithFilteredResult(_0x13c4d1,_0x10a249))[_0x7e30('0x2b')](handleError(_0x13c4d1,null));};exports[_0x7e30('0xe2')]=function(_0x5294a9,_0x5d3c8f){var _0x18c68b={};var _0x3e083a={};var _0x284c73;var _0x22d573;return db['User']['findOne']({'where':{'id':_0x5294a9['params']['id']}})['then'](handleEntityNotFound(_0x5d3c8f,null))[_0x7e30('0x22')](function(_0xfb5167){if(_0xfb5167){_0x284c73=_0xfb5167;_0x3e083a[_0x7e30('0xcc')]=_[_0x7e30('0xcd')](db[_0x7e30('0xe3')][_0x7e30('0x3a')]);_0x3e083a[_0x7e30('0x48')]=_[_0x7e30('0xcd')](_0x5294a9['query']);_0x3e083a[_0x7e30('0xcf')]=_['intersection'](_0x3e083a[_0x7e30('0xcc')],_0x3e083a[_0x7e30('0x48')]);_0x18c68b[_0x7e30('0x5f')]=_[_0x7e30('0xd0')](_0x3e083a['model'],qs[_0x7e30('0xd1')](_0x5294a9[_0x7e30('0x48')][_0x7e30('0xd1')]));_0x18c68b['attributes']=_0x18c68b[_0x7e30('0x5f')][_0x7e30('0x52')]?_0x18c68b[_0x7e30('0x5f')]:_0x3e083a[_0x7e30('0xcc')];_0x18c68b['order']=qs[_0x7e30('0xd3')](_0x5294a9[_0x7e30('0x48')][_0x7e30('0xd3')]);_0x18c68b[_0x7e30('0x46')]=qs['filters'](_[_0x7e30('0xd4')](_0x5294a9['query'],_0x3e083a[_0x7e30('0xcf')]));if(_0x5294a9['query']['filter']){_0x18c68b['where']=_['merge'](_0x18c68b[_0x7e30('0x46')],{'$or':_[_0x7e30('0x3b')](_0x18c68b[_0x7e30('0x5f')],function(_0x5301ee){var _0x19a173={};_0x19a173[_0x5301ee]={'$like':'%'+_0x5294a9[_0x7e30('0x48')]['filter']+'%'};return _0x19a173;})});}_0x18c68b=_[_0x7e30('0x5d')]({},_0x18c68b,_0x5294a9['options']);return _0x284c73[_0x7e30('0xe2')](_0x18c68b);}})[_0x7e30('0x22')](function(_0x200f47){if(_0x200f47){_0x22d573=_0x200f47[_0x7e30('0x52')];if(!_0x5294a9['query']['hasOwnProperty'](_0x7e30('0xd6'))){_0x18c68b[_0x7e30('0x1d')]=qs[_0x7e30('0x1d')](_0x5294a9['query'][_0x7e30('0x1d')]);_0x18c68b[_0x7e30('0x1b')]=qs[_0x7e30('0x1b')](_0x5294a9[_0x7e30('0x48')][_0x7e30('0x1b')]);}return _0x284c73['getSmsInteractions'](_0x18c68b);}})[_0x7e30('0x22')](function(_0xa5ad9b){if(_0xa5ad9b){return _0xa5ad9b?{'count':_0x22d573,'rows':_0xa5ad9b}:null;}})[_0x7e30('0x22')](respondWithResult(_0x5d3c8f,null))['catch'](handleError(_0x5d3c8f,null));};exports[_0x7e30('0xe4')]=function(_0x3ce023,_0x3a940f){var _0x2cf81f={};var _0x546bfa={};var _0xd8e7dd;var _0x3a4875;return db[_0x7e30('0x47')][_0x7e30('0x98')]({'where':{'id':_0x3ce023['params']['id']}})[_0x7e30('0x22')](handleEntityNotFound(_0x3a940f,null))[_0x7e30('0x22')](function(_0x49e59e){if(_0x49e59e){_0xd8e7dd=_0x49e59e;_0x546bfa[_0x7e30('0xcc')]=_['keys'](db['FaxInteraction']['rawAttributes']);_0x546bfa[_0x7e30('0x48')]=_['keys'](_0x3ce023['query']);_0x546bfa[_0x7e30('0xcf')]=_[_0x7e30('0xd0')](_0x546bfa[_0x7e30('0xcc')],_0x546bfa[_0x7e30('0x48')]);_0x2cf81f[_0x7e30('0x5f')]=_[_0x7e30('0xd0')](_0x546bfa[_0x7e30('0xcc')],qs['fields'](_0x3ce023[_0x7e30('0x48')]['fields']));_0x2cf81f[_0x7e30('0x5f')]=_0x2cf81f[_0x7e30('0x5f')][_0x7e30('0x52')]?_0x2cf81f[_0x7e30('0x5f')]:_0x546bfa[_0x7e30('0xcc')];_0x2cf81f[_0x7e30('0xd2')]=qs[_0x7e30('0xd3')](_0x3ce023['query'][_0x7e30('0xd3')]);_0x2cf81f[_0x7e30('0x46')]=qs[_0x7e30('0xcf')](_[_0x7e30('0xd4')](_0x3ce023['query'],_0x546bfa[_0x7e30('0xcf')]));if(_0x3ce023['query']['filter']){_0x2cf81f['where']=_[_0x7e30('0x5d')](_0x2cf81f['where'],{'$or':_[_0x7e30('0x3b')](_0x2cf81f[_0x7e30('0x5f')],function(_0x38430){var _0x3a01bc={};_0x3a01bc[_0x38430]={'$like':'%'+_0x3ce023['query'][_0x7e30('0x3e')]+'%'};return _0x3a01bc;})});}_0x2cf81f=_[_0x7e30('0x5d')]({},_0x2cf81f,_0x3ce023[_0x7e30('0x5e')]);return _0xd8e7dd['getFaxInteractions'](_0x2cf81f);}})[_0x7e30('0x22')](function(_0x599bb5){if(_0x599bb5){_0x3a4875=_0x599bb5[_0x7e30('0x52')];if(!_0x3ce023[_0x7e30('0x48')]['hasOwnProperty'](_0x7e30('0xd6'))){_0x2cf81f[_0x7e30('0x1d')]=qs[_0x7e30('0x1d')](_0x3ce023[_0x7e30('0x48')][_0x7e30('0x1d')]);_0x2cf81f[_0x7e30('0x1b')]=qs[_0x7e30('0x1b')](_0x3ce023[_0x7e30('0x48')][_0x7e30('0x1b')]);}return _0xd8e7dd[_0x7e30('0xe4')](_0x2cf81f);}})['then'](function(_0x4700c2){if(_0x4700c2){return _0x4700c2?{'count':_0x3a4875,'rows':_0x4700c2}:null;}})[_0x7e30('0x22')](respondWithResult(_0x3a940f,null))['catch'](handleError(_0x3a940f,null));};exports[_0x7e30('0xe5')]=function(_0x5049ba,_0x16d3cc){var _0x14856d={};var _0x14dacf={};var _0x3bbaeb;var _0x434bcc;return db[_0x7e30('0x47')][_0x7e30('0x98')]({'where':{'id':_0x5049ba[_0x7e30('0x5b')]['id']}})[_0x7e30('0x22')](handleEntityNotFound(_0x16d3cc,null))[_0x7e30('0x22')](function(_0x277a04){if(_0x277a04){_0x3bbaeb=_0x277a04;_0x14dacf[_0x7e30('0xcc')]=_['keys'](db['WhatsappInteraction'][_0x7e30('0x3a')]);_0x14dacf[_0x7e30('0x48')]=_[_0x7e30('0xcd')](_0x5049ba['query']);_0x14dacf[_0x7e30('0xcf')]=_[_0x7e30('0xd0')](_0x14dacf[_0x7e30('0xcc')],_0x14dacf[_0x7e30('0x48')]);_0x14856d['attributes']=_[_0x7e30('0xd0')](_0x14dacf['model'],qs['fields'](_0x5049ba[_0x7e30('0x48')][_0x7e30('0xd1')]));_0x14856d[_0x7e30('0x5f')]=_0x14856d[_0x7e30('0x5f')]['length']?_0x14856d['attributes']:_0x14dacf[_0x7e30('0xcc')];_0x14856d[_0x7e30('0xd2')]=qs[_0x7e30('0xd3')](_0x5049ba[_0x7e30('0x48')][_0x7e30('0xd3')]);_0x14856d[_0x7e30('0x46')]=qs['filters'](_[_0x7e30('0xd4')](_0x5049ba[_0x7e30('0x48')],_0x14dacf[_0x7e30('0xcf')]));if(_0x5049ba[_0x7e30('0x48')]['filter']){_0x14856d[_0x7e30('0x46')]=_[_0x7e30('0x5d')](_0x14856d[_0x7e30('0x46')],{'$or':_[_0x7e30('0x3b')](_0x14856d['attributes'],function(_0x5418a8){var _0xd1245b={};_0xd1245b[_0x5418a8]={'$like':'%'+_0x5049ba[_0x7e30('0x48')][_0x7e30('0x3e')]+'%'};return _0xd1245b;})});}_0x14856d=_[_0x7e30('0x5d')]({},_0x14856d,_0x5049ba[_0x7e30('0x5e')]);return _0x3bbaeb[_0x7e30('0xe5')](_0x14856d);}})['then'](function(_0x203bf7){if(_0x203bf7){_0x434bcc=_0x203bf7[_0x7e30('0x52')];if(!_0x5049ba[_0x7e30('0x48')][_0x7e30('0xc5')](_0x7e30('0xd6'))){_0x14856d[_0x7e30('0x1d')]=qs[_0x7e30('0x1d')](_0x5049ba[_0x7e30('0x48')][_0x7e30('0x1d')]);_0x14856d[_0x7e30('0x1b')]=qs[_0x7e30('0x1b')](_0x5049ba[_0x7e30('0x48')][_0x7e30('0x1b')]);}return _0x3bbaeb['getWhatsappInteractions'](_0x14856d);}})[_0x7e30('0x22')](function(_0x523e86){if(_0x523e86){return _0x523e86?{'count':_0x434bcc,'rows':_0x523e86}:null;}})[_0x7e30('0x22')](respondWithResult(_0x16d3cc,null))[_0x7e30('0x2b')](handleError(_0x16d3cc,null));};exports[_0x7e30('0xe6')]=function(_0x20a413,_0x34cda7,_0x1fd63e){var _0x55adec;var _0x361994;var _0x18a132;var _0x502472=!_[_0x7e30('0x6a')](_0x20a413[_0x7e30('0x5b')]['id'])?_0x20a413[_0x7e30('0x5b')]['id']:!_[_0x7e30('0x6a')](_0x20a413[_0x7e30('0x32')]['id'])?_0x20a413[_0x7e30('0x32')]['id']:null;return db[_0x7e30('0x47')][_0x7e30('0x84')]({'where':{'id':_0x502472,'role':{'$or':[_0x7e30('0x7e'),'user',_0x7e30('0x2e')]}},'attributes':['id',_0x7e30('0x37'),'phone','mobile',_0x7e30('0x2d'),_0x7e30('0x69'),'loginInPause']})[_0x7e30('0x22')](function(_0x162b79){if(_0x162b79){if(_0x162b79['role']===_0x7e30('0x2e')){_0x55adec=_0x162b79;if(_0x20a413['body'][_0x7e30('0x9b')]){_0x18a132=util[_0x7e30('0xa6')](_0x7e30('0xe7'),_0x55adec[_0x20a413[_0x7e30('0x60')][_0x7e30('0x9b')]]);}else if(_0x20a413[_0x7e30('0x60')][_0x7e30('0xe8')]){_0x18a132=util[_0x7e30('0xa6')](_0x7e30('0xa7'),_0x20a413[_0x7e30('0x60')][_0x7e30('0xe8')]);}else{_0x18a132=util[_0x7e30('0xa6')]('SIP/%s',_0x55adec[_0x7e30('0x37')]);}socket['to'](util[_0x7e30('0xa6')](_0x7e30('0xe9'),_0x55adec[_0x7e30('0x37')]))[_0x7e30('0x2f')](_0x7e30('0xea'),{'user':{'id':_0x55adec['id'],'name':_0x55adec[_0x7e30('0x37')]},'ip':_0x20a413[_0x7e30('0xeb')][_0x7e30('0xec')]||_0x20a413[_0x7e30('0xed')][_0x7e30('0xee')]||_0x20a413[_0x7e30('0xef')][_0x7e30('0xee')]||_0x20a413[_0x7e30('0xed')][_0x7e30('0xef')][_0x7e30('0xee')]});return db[_0x7e30('0xaf')]['destroy']({'where':{'membername':_0x55adec[_0x7e30('0x37')]},'individualHooks':!![]});}}else{throw new db[(_0x7e30('0x90'))][(_0x7e30('0x91'))](_0x7e30('0xf0'));}})[_0x7e30('0x22')](function(){if(_0x55adec){return _0x55adec[_0x7e30('0xf1')]({'raw':!![]});}})['then'](function(_0x1ad8a7){if(_0x55adec){if(_0x1ad8a7){_0x361994=_0x1ad8a7;if(_0x361994[_0x7e30('0x52')]){var _0x2c180c=_0x361994[_0x7e30('0x3b')](function(_0x58db55){var _0x202226={'membername':_0x55adec[_0x7e30('0x37')],'UserId':_0x55adec['id'],'queue_name':_0x58db55[_0x7e30('0x37')],'VoiceQueueId':_0x58db55['id'],'interface':_0x18a132,'paused':_0x55adec[_0x7e30('0xf2')]||![],'penalty':_0x58db55['UserVoiceQueue.penalty']||0x0};return db['UserVoiceQueueRt'][_0x7e30('0xa9')](_0x202226);});return Promise[_0x7e30('0x5a')](_0x2c180c);}}}})[_0x7e30('0x22')](function(){if(_0x55adec){return db[_0x7e30('0xf3')][_0x7e30('0x4f')]({'where':{'membername':_0x55adec[_0x7e30('0x37')],'exitAt':null}});}})['then'](function(_0x10ab55){if(_0x55adec){var _0x3b8148=[];_0x10ab55['forEach'](function(_0x550c04){_0x3b8148['push'](_0x550c04['update']({'exitAt':moment()[_0x7e30('0xa6')](_0x7e30('0xf4'))}));});return Promise[_0x7e30('0x5a')](_0x3b8148);}})[_0x7e30('0x22')](function(){if(_0x55adec){var _0x44a8b1=[];var _0x511267=[];var _0x1e694a=utils[_0x7e30('0xf5')]();var _0x1b25e6={'membername':_0x55adec[_0x7e30('0x37')],'interface':_0x18a132,'enterAt':moment()[_0x7e30('0xa6')](_0x7e30('0xf4')),'role':_0x55adec[_0x7e30('0x2d')],'internal':_0x55adec[_0x7e30('0x69')]};_0x1e694a[_0x7e30('0xf6')](function(_0x588b4b){_0x44a8b1[_0x7e30('0x4e')](_['merge']({'channel':_0x588b4b,'type':_0x7e30('0xf7'),'data1':_0x20a413[_0x7e30('0x60')]['device'],'data2':_0x18a132},_0x1b25e6));if(_0x55adec[_0x7e30('0xf2')]){_0x511267['push'](_[_0x7e30('0x5d')]({'channel':_0x588b4b,'type':_0x7e30('0xf8'),'data1':'LOGININPAUSE'},_0x1b25e6));}});return db['MemberReport'][_0x7e30('0x88')](_0x44a8b1[_0x7e30('0xc2')](_0x511267),{'individualHooks':!![]});}})['then'](function(){if(_0x55adec){return _0x55adec[_0x7e30('0x2c')]({'online':!![],'lastLoginAt':moment()[_0x7e30('0xa6')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x55adec['loginInPause']||![],'mailPause':_0x55adec[_0x7e30('0xf2')]||![],'chatPause':_0x55adec[_0x7e30('0xf2')]||![],'faxPause':_0x55adec[_0x7e30('0xf2')]||![],'smsPause':_0x55adec[_0x7e30('0xf2')]||![],'openchannelPause':_0x55adec[_0x7e30('0xf2')]||![],'whatsappPause':_0x55adec[_0x7e30('0xf2')]||![],'pauseType':_0x55adec[_0x7e30('0xf2')]?_0x7e30('0xf9'):null,'interface':_0x18a132,'lastPauseAt':moment()[_0x7e30('0xa6')](_0x7e30('0xf4'))});}})[_0x7e30('0x22')](function(_0x803ee8){if(_0x20a413[_0x7e30('0xfa')]){return _0x1fd63e();}else{return Promise[_0x7e30('0xfb')](_0x803ee8)['then'](respondWithResult(_0x34cda7,null));}})['catch'](handleError(_0x34cda7,null));};exports['logout']=function(_0x141aa5,_0x3b14f4){var _0x3117fa;return db[_0x7e30('0x47')]['find']({'where':{'id':_0x141aa5[_0x7e30('0x5b')]['id'],'role':_0x7e30('0x2e')},'attributes':['id',_0x7e30('0x37'),_0x7e30('0x2d')]})['then'](handleEntityNotFound(_0x3b14f4,null))[_0x7e30('0x22')](function(_0x17195b){if(_0x17195b){_0x3117fa=_0x17195b;return db[_0x7e30('0xaf')][_0x7e30('0x38')]({'where':{'membername':_0x3117fa[_0x7e30('0x37')]},'individualHooks':!![]});}})[_0x7e30('0x22')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x3117fa[_0x7e30('0x37')],'exitAt':null}});})[_0x7e30('0x22')](function(_0x380dad){var _0x113f1c=[];_0x380dad['forEach'](function(_0xca460c){_0x113f1c[_0x7e30('0x4e')](_0xca460c[_0x7e30('0x2c')]({'exitAt':moment()['format'](_0x7e30('0xf4'))}));});return Promise[_0x7e30('0x5a')](_0x113f1c);})['then'](function(){return _0x3117fa[_0x7e30('0x2c')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x7e30('0x22')](respondWithResult(_0x3b14f4,null))[_0x7e30('0x2b')](handleError(_0x3b14f4,null));};exports['pause']=function(_0x1cfa7b,_0x1e541d){var _0x352b8e;return db[_0x7e30('0xaf')][_0x7e30('0x2c')]({'paused':0x1},{'where':{'UserId':_0x1cfa7b[_0x7e30('0x5b')]['id']},'individualHooks':!![]})[_0x7e30('0x22')](function(){return db[_0x7e30('0x47')][_0x7e30('0x84')]({'where':{'id':_0x1cfa7b[_0x7e30('0x5b')]['id'],'role':_0x7e30('0x2e')},'attributes':['id',_0x7e30('0x37'),_0x7e30('0x2d'),_0x7e30('0x69'),'interface',_0x7e30('0xa5')]});})['then'](handleEntityNotFound(_0x1e541d,null))[_0x7e30('0x22')](function(_0x476def){if(_0x476def){_0x352b8e=_0x476def;return respondWithRpcPromise('QueuePause',_0x7e30('0xfc'),{'id':_0x352b8e['id'],'name':_0x352b8e[_0x7e30('0x37')],'pause':!![]});}})[_0x7e30('0x22')](function(){if(_0x352b8e){return db[_0x7e30('0xf3')]['findAll']({'where':{'membername':_0x352b8e[_0x7e30('0x37')],'type':'PAUSE','exitAt':null}});}})[_0x7e30('0x22')](function(_0x5b2683){if(_0x5b2683[_0x7e30('0x52')]){var _0x210da3=moment()[_0x7e30('0xa6')](_0x7e30('0xf4'));for(var _0x508543=0x0,_0x171317=_0x5b2683[_0x7e30('0x52')];_0x508543<_0x171317;_0x508543++){_0x5b2683[_0x508543][_0x7e30('0xfd')]({'exitAt':_0x210da3});}}})['then'](function(){var _0x369ae1=[];var _0x2e1ad9=utils[_0x7e30('0xf5')]();_0x2e1ad9[_0x7e30('0xf6')](function(_0x523bc3){_0x369ae1['push']({'channel':_0x523bc3,'membername':_0x352b8e[_0x7e30('0x37')],'interface':_[_0x7e30('0x6a')](_0x352b8e[_0x7e30('0x9b')])?util[_0x7e30('0xa6')](_0x7e30('0xa7'),_0x352b8e[_0x7e30('0x37')]):_0x352b8e[_0x7e30('0x9b')],'type':_0x7e30('0xf8'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x1cfa7b[_0x7e30('0x60')][_0x7e30('0x3d')]||_0x7e30('0xfe'),'role':_0x352b8e[_0x7e30('0x2d')],'internal':_0x352b8e[_0x7e30('0x69')]});});return db[_0x7e30('0xf3')][_0x7e30('0x88')](_0x369ae1,{'individualHooks':!![]});})[_0x7e30('0x22')](function(){return _0x352b8e[_0x7e30('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x1cfa7b[_0x7e30('0x60')]['type']||_0x7e30('0xfe'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x7e30('0x22')](respondWithResult(_0x1e541d,null))[_0x7e30('0x2b')](handleError(_0x1e541d,null));};exports[_0x7e30('0xff')]=function(_0x59c539,_0x4a0225){if(_0x59c539[_0x7e30('0x60')]['channel']&&!utils['isValidChannel'](_0x59c539[_0x7e30('0x60')][_0x7e30('0xab')])){throw new APIBadRequestError(util[_0x7e30('0xa6')](_0x7e30('0x100'),_0x59c539['body'][_0x7e30('0xab')]));}return db[_0x7e30('0x47')][_0x7e30('0x84')]({'where':{'id':_0x59c539['params']['id']},'attributes':['id','name',_0x7e30('0x2d'),'internal',_0x7e30('0x9b'),_0x7e30('0xa5'),'voicePause',_0x7e30('0x101'),'chatPause',_0x7e30('0x102'),_0x7e30('0x103'),_0x7e30('0x104'),_0x7e30('0x105'),'pauseType',_0x7e30('0x106')]})[_0x7e30('0x22')](function(_0x4efc4d){if(!_0x4efc4d){throw new APINotFoundError(util[_0x7e30('0xa6')]('User\x20with\x20id\x20%s\x20not\x20found',_0x59c539[_0x7e30('0x5b')]['id']));}return _0x4efc4d[_0x7e30('0xff')](_0x59c539[_0x7e30('0x60')][_0x7e30('0xab')]);})[_0x7e30('0x22')](respondWithResult(_0x4a0225,null))[_0x7e30('0x2b')](APIHandleError(_0x4a0225));};exports[_0x7e30('0x107')]=function(_0xd1994c,_0x30d5d1){var _0x3ffab3={};var _0x54c382={};var _0x4c9dc5;var _0x41570e;return db['User'][_0x7e30('0x98')]({'where':{'id':_0xd1994c['params']['id']}})[_0x7e30('0x22')](handleEntityNotFound(_0x30d5d1,null))[_0x7e30('0x22')](function(_0x3ca0b1){if(_0x3ca0b1){_0x4c9dc5=_0x3ca0b1;_0x54c382[_0x7e30('0xcc')]=_[_0x7e30('0xcd')](db[_0x7e30('0x108')][_0x7e30('0x3a')]);_0x54c382[_0x7e30('0x48')]=_[_0x7e30('0xcd')](_0xd1994c[_0x7e30('0x48')]);_0x54c382[_0x7e30('0xcf')]=_[_0x7e30('0xd0')](_0x54c382[_0x7e30('0xcc')],_0x54c382[_0x7e30('0x48')]);_0x3ffab3[_0x7e30('0x5f')]=_[_0x7e30('0xd0')](_0x54c382[_0x7e30('0xcc')],qs['fields'](_0xd1994c[_0x7e30('0x48')][_0x7e30('0xd1')]));_0x3ffab3[_0x7e30('0x5f')]=_0x3ffab3[_0x7e30('0x5f')][_0x7e30('0x52')]?_0x3ffab3[_0x7e30('0x5f')]:_0x54c382[_0x7e30('0xcc')];_0x3ffab3[_0x7e30('0xd2')]=qs[_0x7e30('0xd3')](_0xd1994c[_0x7e30('0x48')][_0x7e30('0xd3')]);_0x3ffab3['where']=qs[_0x7e30('0xcf')](_['pick'](_0xd1994c[_0x7e30('0x48')],_0x54c382[_0x7e30('0xcf')]));if(_0xd1994c[_0x7e30('0x48')]['filter']){_0x3ffab3['where']=_[_0x7e30('0x5d')](_0x3ffab3[_0x7e30('0x46')],{'$or':_[_0x7e30('0x3b')](_0x3ffab3['attributes'],function(_0x5664f0){var _0x35cf65={};_0x35cf65[_0x5664f0]={'$like':'%'+_0xd1994c[_0x7e30('0x48')][_0x7e30('0x3e')]+'%'};return _0x35cf65;})});}_0x3ffab3=_[_0x7e30('0x5d')]({},_0x3ffab3,_0xd1994c[_0x7e30('0x5e')]);return _0x4c9dc5[_0x7e30('0x107')](_0x3ffab3);}})[_0x7e30('0x22')](function(_0x4f4a94){if(_0x4f4a94){_0x41570e=_0x4f4a94['length'];if(!_0xd1994c[_0x7e30('0x48')][_0x7e30('0xc5')](_0x7e30('0xd6'))){_0x3ffab3[_0x7e30('0x1d')]=qs['limit'](_0xd1994c['query']['limit']);_0x3ffab3[_0x7e30('0x1b')]=qs[_0x7e30('0x1b')](_0xd1994c[_0x7e30('0x48')]['offset']);}return _0x4c9dc5[_0x7e30('0x107')](_0x3ffab3);}})[_0x7e30('0x22')](function(_0x2bd8a9){if(_0x2bd8a9){return _0x2bd8a9?{'count':_0x41570e,'rows':_0x2bd8a9}:null;}})[_0x7e30('0x22')](respondWithResult(_0x30d5d1,null))[_0x7e30('0x2b')](handleError(_0x30d5d1,null));};exports[_0x7e30('0x109')]=function(_0x349554,_0xebc910){var _0x2faf11=_0x349554[_0x7e30('0x5b')]['id'];var _0x34b4b9=_0x349554[_0x7e30('0x60')]?_0x349554['body']['ids']:null;var _0x4b2673=[];return Promise['resolve']()[_0x7e30('0x22')](function(){if(!_0x34b4b9)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x7e30('0x22')](function(){return db[_0x7e30('0x47')][_0x7e30('0x98')]({'where':{'id':_0x2faf11}});})[_0x7e30('0x22')](function(_0xd8ebbd){if(!_0xd8ebbd)throw new APINotFoundError(util[_0x7e30('0xa6')](_0x7e30('0xc4'),_0x349554[_0x7e30('0x5b')]['id']));return db[_0x7e30('0x6c')][_0x7e30('0x10a')](function(_0x5ed6ca){return _0xd8ebbd['addTeams'](_0x34b4b9,{'transaction':_0x5ed6ca})[_0x7e30('0x22')](function(){return db[_0x7e30('0x108')]['findAll']({'where':{'id':{'$in':_0x34b4b9}}});})[_0x7e30('0x22')](function(_0x546cc8){var _0x11357f=_['map'](_0x546cc8,function(_0x50dd98){return _0x50dd98['getAssociatedQueues']();});return Promise['all'](_0x11357f);})[_0x7e30('0x22')](function(_0x23785d){_0x4b2673=_[_0x7e30('0x10b')](_0x23785d);var _0x3b830a=_[_0x7e30('0x3b')](_0x4b2673,function(_0x45e6ff){return _0x45e6ff[_0x7e30('0x10c')](_0xd8ebbd['id'],{'transaction':_0x5ed6ca});});return Promise[_0x7e30('0x5a')](_0x3b830a);})[_0x7e30('0x22')](function(){if(!_0xd8ebbd[_0x7e30('0xa5')])return;var _0x47cc14=_[_0x7e30('0x3e')](_0x4b2673,function(_0xd935c6){return _0xd935c6[_0x7e30('0x10d')]('channel')===_0x7e30('0x10e');});var _0x41b52b=_['map'](_0x47cc14,function(_0x527cf5){return db[_0x7e30('0xaf')][_0x7e30('0xa9')]({'membername':_0xd8ebbd[_0x7e30('0x37')],'UserId':_0xd8ebbd['id'],'queue_name':_0x527cf5[_0x7e30('0x37')],'VoiceQueueId':_0x527cf5['id'],'interface':_[_0x7e30('0x6a')](_0xd8ebbd[_0x7e30('0x9b')])?util[_0x7e30('0xa6')](_0x7e30('0xa7'),_0xd8ebbd[_0x7e30('0x37')]):_0xd8ebbd[_0x7e30('0x9b')],'paused':_0xd8ebbd[_0x7e30('0xa8')]||![],'penalty':_0xd8ebbd[_0x7e30('0xa2')]},{'transaction':_0x5ed6ca});});return Promise[_0x7e30('0x5a')](_0x41b52b);})[_0x7e30('0x22')](function(){return db['TeamVoicePrefix'][_0x7e30('0x4f')]({'where':{'teamId':{'$in':_0x34b4b9}}});})[_0x7e30('0x22')](function(_0x7a4e7d){var _0x67089c=_[_0x7e30('0x3b')](_0x7a4e7d,function(_0x49bfb5){return db[_0x7e30('0x10f')]['create']({'UserId':_0xd8ebbd['id'],'VoicePrefixId':_0x49bfb5[_0x7e30('0x110')]},{'transaction':_0x5ed6ca});});return Promise[_0x7e30('0x5a')](_0x67089c);});});})[_0x7e30('0x22')](function(){for(var _0x4d1687=0x0;_0x4d1687<_0x4b2673['length'];_0x4d1687++){var _0x2df059=_0x4b2673[_0x4d1687]['getDataValue']('channel');var _0x326542=_0x2df059+'QueueId';socket['emit'](_0x7e30('0x32')+_0x2df059+_0x7e30('0x111'),{'UserId':_0x2faf11,['queueField']:_0x4b2673[_0x4d1687]['id']});}})[_0x7e30('0x22')](respondWithStatusCode(_0xebc910,null))[_0x7e30('0x2b')](APIHandleError(_0xebc910));};exports['removeTeams']=function(_0xe86f9e,_0x15919b){var _0x422389=_0xe86f9e[_0x7e30('0x5b')]['id'];var _0x5c9450=null;if(_0xe86f9e['query'][_0x7e30('0x63')]){_0x5c9450=_[_0x7e30('0x112')](_0xe86f9e['query'][_0x7e30('0x63')])?_0xe86f9e[_0x7e30('0x48')]['ids']:[_0xe86f9e[_0x7e30('0x48')]['ids']];}var _0x3a0e75=[];return Promise['resolve']()[_0x7e30('0x22')](function(){if(!_0x5c9450)throw new APIBadRequestError('Query\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x7e30('0x22')](function(){return db[_0x7e30('0x47')][_0x7e30('0x98')]({'where':{'id':_0x422389}});})[_0x7e30('0x22')](function(_0x36e1aa){if(!_0x36e1aa)throw new APINotFoundError(util[_0x7e30('0xa6')](_0x7e30('0xc4'),_0xe86f9e['params']['id']));return db[_0x7e30('0x6c')][_0x7e30('0x10a')](function(_0x57705d){return _0x36e1aa['removeTeams'](_0x5c9450,{'transaction':_0x57705d})[_0x7e30('0x22')](function(){return db['Team'][_0x7e30('0x4f')]({'where':{'id':{'$in':_0x5c9450}}});})[_0x7e30('0x22')](function(_0x450776){var _0x4b9a5a=_[_0x7e30('0x3b')](_0x450776,function(_0x359259){return _0x359259[_0x7e30('0x113')]();});return Promise[_0x7e30('0x5a')](_0x4b9a5a);})[_0x7e30('0x22')](function(_0x134647){_0x3a0e75=_[_0x7e30('0x10b')](_0x134647);var _0x11e457=_[_0x7e30('0x3b')](_0x3a0e75,function(_0x3ef700){return _0x3ef700[_0x7e30('0x114')](_0x36e1aa['id'],{'transaction':_0x57705d});});return Promise[_0x7e30('0x5a')](_0x11e457);})[_0x7e30('0x22')](function(){if(!_0x36e1aa[_0x7e30('0xa5')])return;var _0x1512ad=_[_0x7e30('0x3e')](_0x3a0e75,function(_0x27dcbf){return _0x27dcbf[_0x7e30('0x10d')](_0x7e30('0xab'))==='Voice';});var _0xc1d092=_[_0x7e30('0x3b')](_0x1512ad,function(_0x5705c5){return db[_0x7e30('0xaf')][_0x7e30('0x38')]({'where':{'VoiceQueueId':_0x5705c5['id'],'UserId':_0x36e1aa['id']},'transaction':_0x57705d});});return Promise[_0x7e30('0x5a')](_0xc1d092);})['then'](function(){return db[_0x7e30('0x115')][_0x7e30('0x4f')]({'where':{'teamId':{'$in':_0x5c9450}}});})['then'](function(_0x4c3183){var _0xa3f85f=_[_0x7e30('0x3b')](_0x4c3183,function(_0x2553d9){return db[_0x7e30('0x10f')][_0x7e30('0x38')]({'where':{'UserId':_0x36e1aa['id'],'VoicePrefixId':_0x2553d9[_0x7e30('0x110')]}},{'transaction':_0x57705d});});return Promise['all'](_0xa3f85f);});});})[_0x7e30('0x22')](function(){for(var _0x10f5a4=0x0;_0x10f5a4<_0x3a0e75[_0x7e30('0x52')];_0x10f5a4++){var _0x319786=_0x3a0e75[_0x10f5a4][_0x7e30('0x10d')](_0x7e30('0xab'));var _0x571f4e=_0x319786+'QueueId';socket['emit'](_0x7e30('0x32')+_0x319786+_0x7e30('0xae'),{'UserId':_0x422389,['queueField']:_0x3a0e75[_0x10f5a4]['id']});}})['then'](respondWithStatusCode(_0x15919b,null))[_0x7e30('0x2b')](APIHandleError(_0x15919b));};exports['getLists']=function(_0x9c8f08,_0xf3148f){var _0x4df2c0={};var _0x36d187={};var _0x274718;var _0x2855c4;return db[_0x7e30('0x47')][_0x7e30('0x98')]({'where':{'id':_0x9c8f08['params']['id']}})[_0x7e30('0x22')](handleEntityNotFound(_0xf3148f,null))[_0x7e30('0x22')](function(_0x25b8f0){if(_0x25b8f0){_0x274718=_0x25b8f0;_0x36d187[_0x7e30('0xcc')]=_[_0x7e30('0xcd')](db[_0x7e30('0xc6')][_0x7e30('0x3a')]);_0x36d187[_0x7e30('0x48')]=_[_0x7e30('0xcd')](_0x9c8f08[_0x7e30('0x48')]);_0x36d187[_0x7e30('0xcf')]=_[_0x7e30('0xd0')](_0x36d187[_0x7e30('0xcc')],_0x36d187[_0x7e30('0x48')]);_0x4df2c0[_0x7e30('0x5f')]=_[_0x7e30('0xd0')](_0x36d187['model'],qs[_0x7e30('0xd1')](_0x9c8f08[_0x7e30('0x48')][_0x7e30('0xd1')]));_0x4df2c0[_0x7e30('0x5f')]=_0x4df2c0[_0x7e30('0x5f')][_0x7e30('0x52')]?_0x4df2c0[_0x7e30('0x5f')]:_0x36d187[_0x7e30('0xcc')];_0x4df2c0[_0x7e30('0xd2')]=qs[_0x7e30('0xd3')](_0x9c8f08['query'][_0x7e30('0xd3')]);_0x4df2c0[_0x7e30('0x46')]=qs[_0x7e30('0xcf')](_['pick'](_0x9c8f08[_0x7e30('0x48')],_0x36d187[_0x7e30('0xcf')]));if(_0x9c8f08['query'][_0x7e30('0x3e')]){_0x4df2c0[_0x7e30('0x46')]=_[_0x7e30('0x5d')](_0x4df2c0[_0x7e30('0x46')],{'$or':_[_0x7e30('0x3b')](_0x4df2c0[_0x7e30('0x5f')],function(_0x163f0c){var _0x199cec={};_0x199cec[_0x163f0c]={'$like':'%'+_0x9c8f08[_0x7e30('0x48')][_0x7e30('0x3e')]+'%'};return _0x199cec;})});}_0x4df2c0=_[_0x7e30('0x5d')]({},_0x4df2c0,_0x9c8f08[_0x7e30('0x5e')]);return _0x274718[_0x7e30('0x116')](_0x4df2c0);}})[_0x7e30('0x22')](function(_0x555ef1){if(_0x555ef1){_0x2855c4=_0x555ef1['length'];if(!_0x9c8f08['query']['hasOwnProperty'](_0x7e30('0xd6'))){_0x4df2c0['limit']=qs[_0x7e30('0x1d')](_0x9c8f08[_0x7e30('0x48')][_0x7e30('0x1d')]);_0x4df2c0[_0x7e30('0x1b')]=qs['offset'](_0x9c8f08[_0x7e30('0x48')][_0x7e30('0x1b')]);}return _0x274718[_0x7e30('0x116')](_0x4df2c0);}})['then'](function(_0x34c61f){if(_0x34c61f){return _0x34c61f?{'count':_0x2855c4,'rows':_0x34c61f}:null;}})[_0x7e30('0x22')](respondWithResult(_0xf3148f,null))[_0x7e30('0x2b')](handleError(_0xf3148f,null));};exports[_0x7e30('0x117')]=function(_0x44c073,_0x6c7ac4){var _0x34cb89={};var _0x4c3d1c={};var _0x2555be;return db['User'][_0x7e30('0x98')]({'where':{'id':_0x44c073['params']['id']}})[_0x7e30('0x22')](handleEntityNotFound(_0x6c7ac4,null))[_0x7e30('0x22')](function(_0xce827b){if(_0xce827b){_0x2555be=_0xce827b;_0x4c3d1c[_0x7e30('0xcc')]=_[_0x7e30('0xcd')](db[_0x7e30('0x47')][_0x7e30('0x3a')]);_0x4c3d1c[_0x7e30('0x48')]=_['keys'](_0x44c073[_0x7e30('0x48')]);_0x4c3d1c['filters']=_[_0x7e30('0xd0')](_0x4c3d1c[_0x7e30('0xcc')],_0x4c3d1c[_0x7e30('0x48')]);_0x34cb89[_0x7e30('0x5f')]=_[_0x7e30('0xd0')](_0x4c3d1c[_0x7e30('0xcc')],qs[_0x7e30('0xd1')](_0x44c073['query'][_0x7e30('0xd1')]));_0x34cb89[_0x7e30('0x5f')]=_0x34cb89[_0x7e30('0x5f')][_0x7e30('0x52')]?_0x34cb89[_0x7e30('0x5f')]:_0x4c3d1c[_0x7e30('0xcc')];_0x34cb89[_0x7e30('0xd2')]=qs[_0x7e30('0xd3')](_0x44c073[_0x7e30('0x48')]['sort']);_0x34cb89['where']=qs[_0x7e30('0xcf')](_[_0x7e30('0xd4')](_0x44c073[_0x7e30('0x48')],_0x4c3d1c[_0x7e30('0xcf')]));if(_0x44c073[_0x7e30('0x48')][_0x7e30('0x3e')]){_0x34cb89['where']=_[_0x7e30('0x5d')](_0x34cb89[_0x7e30('0x46')],{'$or':_[_0x7e30('0x3b')](_0x34cb89[_0x7e30('0x5f')],function(_0x2e621f){var _0x30777d={};_0x30777d[_0x2e621f]={'$like':'%'+_0x44c073[_0x7e30('0x48')][_0x7e30('0x3e')]+'%'};return _0x30777d;})});}_0x34cb89[_0x7e30('0xcc')]=db[_0x7e30('0x47')];_0x34cb89['as']=_0x7e30('0x33');_0x34cb89=_[_0x7e30('0x5d')]({},_0x34cb89,_0x44c073[_0x7e30('0x5e')]);return _0x2555be[_0x7e30('0xf1')]({'include':[_0x34cb89]});}})[_0x7e30('0x22')](function(_0x501321){if(_0x501321){var _0x226060={},_0x33dc1a=[];for(var _0x1621fe=0x0;_0x1621fe<_0x501321[_0x7e30('0x52')];_0x1621fe+=0x1){for(var _0x183b7c=0x0,_0x354e47;_0x183b7c<_0x501321[_0x1621fe][_0x7e30('0x33')]['length'];_0x183b7c+=0x1){_0x354e47=_0x501321[_0x1621fe][_0x7e30('0x33')][_0x183b7c][_0x7e30('0xd5')]({'plain':!![]});_0x226060[_0x354e47['id']]=_0x354e47;}}_0x226060=_[_0x7e30('0x118')](_0x226060);for(var _0x377576=qs['offset'](_0x44c073[_0x7e30('0x48')]['offset']);_0x377576<_0x226060[_0x7e30('0x52')]&&_0x33dc1a[_0x7e30('0x52')]=_0x438db8){_0x2142c8=_0x438db8;_0x52157f=0xc8;}else{_0x52157f=0xce;}_0x389678['status'](_0x52157f);return _0x389678[_0x72f3('0x1c')](_0x72f3('0x1d'),_0x3c87fa+'-'+_0x2142c8+'/'+_0x438db8)[_0x72f3('0x17')](_0x55997b);}return null;};}function respondWithRpcPromise(_0x200118,_0x4b488b,_0x3627c4,_0x10d982){return new Promise(function(_0x46177c,_0xe45db8){var _0x440354=_0x10d982||amiClient;return _0x440354[_0x72f3('0x1e')](_0x200118,_0x3627c4)[_0x72f3('0x1f')](function(_0x311765){logger[_0x72f3('0x20')]('User,\x20%s,\x20%s',_0x4b488b,_0x72f3('0x21'));logger['debug'](_0x72f3('0x22'),_0x4b488b,'request\x20sent',JSON['stringify'](_0x311765));if(_0x311765[_0x72f3('0x23')]){if(_0x311765['error'][_0x72f3('0x24')]===0x1f4){logger[_0x72f3('0x23')](_0x72f3('0x25'),_0x4b488b,_0x311765[_0x72f3('0x23')][_0x72f3('0x26')]);return _0xe45db8(_0x311765['error'][_0x72f3('0x26')]);}logger[_0x72f3('0x23')](_0x72f3('0x25'),_0x4b488b,_0x311765[_0x72f3('0x23')][_0x72f3('0x26')]);return _0x46177c(_0x311765[_0x72f3('0x23')][_0x72f3('0x26')]);}else{logger['info'](_0x72f3('0x25'),_0x4b488b,_0x72f3('0x21'));_0x46177c(_0x311765[_0x72f3('0x27')][_0x72f3('0x26')]);}})[_0x72f3('0x28')](function(_0x42e2d9){logger[_0x72f3('0x23')]('User,\x20%s,\x20%s',_0x4b488b,_0x42e2d9);_0xe45db8(_0x42e2d9);});});}function saveUpdates(_0x2ae62b){return function(_0x39361f){if(_0x39361f){return _0x39361f['update'](_0x2ae62b)['then'](function(_0x2b9ac6){if(_0x2b9ac6[_0x72f3('0x29')]===_0x72f3('0x2a')){socket[_0x72f3('0x2b')]('userNotification:recalc:'+_0x2b9ac6['id'],_0x2b9ac6);}return _0x2b9ac6;});}return null;};}function removeEntity(_0x4f8a62,_0x21b5bd){return function(_0x52a8d7){if(_0x52a8d7){return _0x52a8d7['destroy']({'transaction':_0x21b5bd})[_0x72f3('0x1f')](function(){var _0x4185c5=_0x52a8d7['get']({'plain':!![]});if(_0x4185c5[_0x72f3('0x29')]===_0x72f3('0x2c'))return;var _0x35d2a9=[{'name':_0x72f3('0x2d'),'value':_0x72f3('0x2e'),'ignore':!![]},{'name':_0x72f3('0x2f'),'value':_0x72f3('0x2a'),'ignore':![]},{'name':_0x72f3('0x30'),'value':_0x72f3('0x31'),'ignore':![]}];var _0x1daf98=_(_0x35d2a9)[_0x72f3('0x32')](_0x72f3('0x33'))[_0x72f3('0x34')](_0x72f3('0x35'))['value']();if(_[_0x72f3('0x36')](_0x1daf98,_0x4185c5[_0x72f3('0x29')])){return;}var _0x189cb3=_[_0x72f3('0x37')](_0x35d2a9,['value',_0x4185c5[_0x72f3('0x29')]])[_0x72f3('0x38')];return db[_0x72f3('0x39')][_0x72f3('0x3a')]({'where':{'type':_0x189cb3,'resourceId':_0x4185c5['id']},'transaction':_0x21b5bd})[_0x72f3('0x1f')](function(){return _0x52a8d7;});})['then'](function(){_0x4f8a62[_0x72f3('0x15')](0xcc)[_0x72f3('0x16')]();});}};}function handleEntityNotFound(_0x16dcea){return function(_0x3d7e85){if(!_0x3d7e85){_0x16dcea['sendStatus'](0x194);}return _0x3d7e85;};}function handleError(_0x529028,_0x13eb5c){_0x13eb5c=_0x13eb5c||0x1f4;return function(_0x24bebc){logger[_0x72f3('0x23')](_0x24bebc[_0x72f3('0x3b')]);if(_0x24bebc[_0x72f3('0x38')]){delete _0x24bebc[_0x72f3('0x38')];}_0x529028[_0x72f3('0x15')](_0x13eb5c)[_0x72f3('0x3c')](_0x24bebc);};}function getUserAttributes(){return _(db[_0x72f3('0x3d')][_0x72f3('0x3e')])[_0x72f3('0x34')](function(_0x3fe179){return{'name':_0x3fe179[_0x72f3('0x3f')],'type':_0x3fe179[_0x72f3('0x40')][_0x72f3('0x41')]};})['filter'](function(_0x266b33){return![_0x72f3('0x42'),_0x72f3('0x43'),_0x72f3('0x44'),_0x72f3('0x45'),'resetPasswordExpires',_0x72f3('0x46')][_0x72f3('0x36')](_0x266b33[_0x72f3('0x38')]);})[_0x72f3('0x35')]();}exports[_0x72f3('0x47')]=function(_0x164d30,_0x1c469e){var _0x2cc6f6={},_0x43ee82={'count':0x0,'rows':[]};var _0xbb2715=getUserAttributes();_0x2cc6f6=qs[_0x72f3('0x48')](_0xbb2715,_0x164d30);var _0x182467={'where':_0x2cc6f6[_0x72f3('0x49')]};return db[_0x72f3('0x3d')]['count'](_0x182467)[_0x72f3('0x1f')](function(_0xae1332){_0x43ee82[_0x72f3('0x1b')]=_0xae1332;if(_0x164d30['query']['includeAll']){_0x2cc6f6[_0x72f3('0x4a')]=[{'all':!![]}];}if(_0x164d30[_0x72f3('0x4b')][_0x72f3('0x4c')]===_0x72f3('0x4d')){_0x2cc6f6[_0x72f3('0x4a')]=[{'model':db[_0x72f3('0x4e')],'as':_0x72f3('0x4c')}];}if(!_[_0x72f3('0x36')](_0x2cc6f6['attributes'],'id')){_0x2cc6f6[_0x72f3('0x4f')][_0x72f3('0x50')]('id');}return db[_0x72f3('0x3d')][_0x72f3('0x51')](_0x2cc6f6);})[_0x72f3('0x1f')](function(_0x530b94){_0x43ee82[_0x72f3('0x52')]=_0x530b94;if(_0x164d30[_0x72f3('0x4b')][_0x72f3('0x53')]===_0x72f3('0x4d')){var _0x155348=[];for(var _0x4241b5=0x0;_0x4241b5<_0x43ee82[_0x72f3('0x52')]['length'];_0x4241b5++){_0x155348['push'](get_open_tabs(_0x72f3('0x54'),_0x43ee82[_0x72f3('0x52')][_0x4241b5][_0x72f3('0x55')]));_0x155348[_0x72f3('0x50')](get_open_tabs(_0x72f3('0x56'),_0x43ee82[_0x72f3('0x52')][_0x4241b5][_0x72f3('0x55')]));_0x155348[_0x72f3('0x50')](get_open_tabs(_0x72f3('0x57'),_0x43ee82[_0x72f3('0x52')][_0x4241b5][_0x72f3('0x55')]));_0x155348[_0x72f3('0x50')](get_open_tabs(_0x72f3('0x58'),_0x43ee82[_0x72f3('0x52')][_0x4241b5]['dataValues']));_0x155348['push'](get_open_tabs('openchannel',_0x43ee82[_0x72f3('0x52')][_0x4241b5]['dataValues']));_0x155348[_0x72f3('0x50')](get_open_tabs(_0x72f3('0x59'),_0x43ee82[_0x72f3('0x52')][_0x4241b5][_0x72f3('0x55')]));}return Promise['all'](_0x155348)[_0x72f3('0x1f')](function(){return _0x43ee82;});}else{return _0x43ee82;}})[_0x72f3('0x1f')](respondWithFilteredResult(_0x1c469e,_0x2cc6f6))[_0x72f3('0x28')](handleError(_0x1c469e,null));};exports['show']=function(_0xc1469b,_0x4b2b91){var _0x39a113=getUserAttributes();_0xc1469b['query']['id']=_0xc1469b['params']['id'];var _0x3ce1b7=qs[_0x72f3('0x48')](_0x39a113,_0xc1469b);if(_0xc1469b[_0x72f3('0x4b')][_0x72f3('0x5a')]){_0x3ce1b7[_0x72f3('0x4a')]=[{'all':!![]}];}if(_0xc1469b['query'][_0x72f3('0x4c')]===_0x72f3('0x4d')){_0x3ce1b7['include']=[{'model':db[_0x72f3('0x4e')],'as':_0x72f3('0x4c')}];}_0x3ce1b7=_['merge']({},_0x3ce1b7,_0xc1469b[_0x72f3('0x5b')]);if(!_[_0x72f3('0x36')](_0x3ce1b7[_0x72f3('0x4f')],'id')){_0x3ce1b7[_0x72f3('0x4f')][_0x72f3('0x50')]('id');}return db[_0x72f3('0x3d')][_0x72f3('0x37')](_0x3ce1b7)['then'](handleEntityNotFound(_0x4b2b91,null))[_0x72f3('0x1f')](function(_0x1b3ac9){var _0x376197=[];values=_0x1b3ac9;if(_0xc1469b[_0x72f3('0x4b')]['openTabs']===_0x72f3('0x4d')){_0x376197[_0x72f3('0x50')](get_open_tabs(_0x72f3('0x54'),_0x1b3ac9['dataValues']));_0x376197[_0x72f3('0x50')](get_open_tabs(_0x72f3('0x56'),_0x1b3ac9[_0x72f3('0x55')]));_0x376197['push'](get_open_tabs(_0x72f3('0x5c'),_0x1b3ac9[_0x72f3('0x55')]));_0x376197['push'](get_open_tabs(_0x72f3('0x59'),_0x1b3ac9[_0x72f3('0x55')]));_0x376197[_0x72f3('0x50')](get_open_tabs(_0x72f3('0x57'),_0x1b3ac9[_0x72f3('0x55')]));_0x376197[_0x72f3('0x50')](get_open_tabs(_0x72f3('0x58'),_0x1b3ac9[_0x72f3('0x55')]));return Promise[_0x72f3('0x5d')](_0x376197);}else{return values;}})[_0x72f3('0x1f')](function(){return values;})['then'](respondWithResult(_0x4b2b91,null))[_0x72f3('0x28')](handleError(_0x4b2b91,null));};exports[_0x72f3('0x5e')]=function(_0x3ce1c3,_0x285392){if(_0x3ce1c3[_0x72f3('0x5f')]['id']){delete _0x3ce1c3[_0x72f3('0x5f')]['id'];}delete _0x3ce1c3['body'][_0x72f3('0x29')];return db[_0x72f3('0x3d')][_0x72f3('0x37')]({'where':{'id':_0x3ce1c3[_0x72f3('0x60')]['id']}})['then'](handleEntityNotFound(_0x285392,null))[_0x72f3('0x1f')](saveUpdates(_0x3ce1c3['body'],null))[_0x72f3('0x1f')](respondWithResult(_0x285392,null))[_0x72f3('0x28')](handleError(_0x285392,null));};exports[_0x72f3('0x61')]=function(_0x2035e5,_0x20d0e6){return db[_0x72f3('0x3d')]['describe']()['then'](respondWithResult(_0x20d0e6,null))[_0x72f3('0x28')](handleError(_0x20d0e6,null));};exports[_0x72f3('0x62')]=function(_0x15ff44,_0x210111){return db[_0x72f3('0x3d')]['find']({'where':{'id':_0x15ff44[_0x72f3('0x60')]['id']}})[_0x72f3('0x1f')](handleEntityNotFound(_0x210111,null))[_0x72f3('0x1f')](function(_0x4b0dea){if(_0x4b0dea){return _0x4b0dea[_0x72f3('0x62')](_0x15ff44['body'][_0x72f3('0x63')],_[_0x72f3('0x64')](_0x15ff44[_0x72f3('0x5f')],['ids','id'])||{});}})[_0x72f3('0x1f')](respondWithResult(_0x210111,null))[_0x72f3('0x28')](handleError(_0x210111,null));};function validateUser(_0x2e59a4){return new Promise(function(_0xda585,_0xf4cfe7){if(_0x2e59a4[_0x72f3('0x65')])return _0xda585(_0x2e59a4);return db[_0x72f3('0x66')][_0x72f3('0x67')](0x1)[_0x72f3('0x1f')](function(_0x11a6f8){if(_0x11a6f8['securePassword'])authService[_0x72f3('0x68')](_0x2e59a4[_0x72f3('0x42')]);db[_0x72f3('0x3d')][_0x72f3('0x69')](_0x72f3('0x65'))[_0x72f3('0x1f')](function(_0x142b01){if(_[_0x72f3('0x6a')](_0x142b01)){_0x2e59a4['internal']=_0x11a6f8[_0x72f3('0x6b')]||0x1;return;}if(_[_0x72f3('0x6a')](_0x11a6f8[_0x72f3('0x6b')])||_0x11a6f8[_0x72f3('0x6b')]===_0x142b01){_0x2e59a4[_0x72f3('0x65')]=_0x142b01+0x1;return;}if(_0x11a6f8[_0x72f3('0x6b')]>_0x142b01){_0x2e59a4[_0x72f3('0x65')]=_0x11a6f8[_0x72f3('0x6b')];return;}return db[_0x72f3('0x6c')]['query'](_0x72f3('0x6d'),{'type':db[_0x72f3('0x6c')]['QueryTypes'][_0x72f3('0x6e')]})['then'](function(_0x1e5b6a){if(_0x1e5b6a&&_0x1e5b6a['length']){for(var _0x4c252c=0x0,_0x358ab6=_0x1e5b6a[_0x72f3('0x6f')];_0x4c252c<_0x358ab6&&_[_0x72f3('0x6a')](_0x2e59a4[_0x72f3('0x65')]);_0x4c252c++){if(_0x11a6f8[_0x72f3('0x6b')]<=_0x1e5b6a[_0x4c252c][_0x72f3('0x70')]){_0x2e59a4[_0x72f3('0x65')]=_0x1e5b6a[_0x4c252c][_0x72f3('0x70')];}else if(_0x11a6f8[_0x72f3('0x6b')]>_0x1e5b6a[_0x4c252c]['from']&&_0x11a6f8[_0x72f3('0x6b')]<=_0x1e5b6a[_0x4c252c]['to']){_0x2e59a4[_0x72f3('0x65')]=_0x11a6f8['min_internal'];}}}if(_[_0x72f3('0x6a')](_0x2e59a4[_0x72f3('0x65')])){_0x2e59a4[_0x72f3('0x65')]=_0x142b01+0x1;}return _0xda585(_0x2e59a4);});});})[_0x72f3('0x28')](function(_0x85472a){_0xf4cfe7(_0x85472a);});});}function updateUser(_0x14af22){return new Promise(function(_0x152a82,_0x4b269c){try{if(_0x14af22[_0x72f3('0x71')]){_0x14af22[_0x72f3('0x72')]=_0x14af22[_0x72f3('0x65')];_0x14af22[_0x72f3('0x73')]={'mailbox':_0x14af22[_0x72f3('0x65')],'password':_0x14af22[_0x72f3('0x42')],'fullname':_0x14af22['fullname'],'email':_0x14af22['email']};}if(_0x14af22[_0x72f3('0x29')]===_0x72f3('0x2a')){if(!_0x14af22[_0x72f3('0x74')])_0x14af22[_0x72f3('0x74')]=[_0x72f3('0x75'),_0x72f3('0x76'),'103',_0x72f3('0x77'),_0x72f3('0x78'),_0x72f3('0x79'),_0x72f3('0x7a'),_0x72f3('0x7b'),_0x72f3('0x7c'),_0x72f3('0x7d'),'109',_0x72f3('0x7e'),_0x72f3('0x7f'),_0x72f3('0x80'),_0x72f3('0x81')];}_0x152a82(_0x14af22);}catch(_0x7e6967){_0x4b269c(_0x7e6967);}});}exports[_0x72f3('0x82')]=function(_0xcd0a72,_0xef77a4){if(_0xcd0a72[_0x72f3('0x2e')][_0x72f3('0x29')]===_0x72f3('0x2a'))throw new Error('Unauthorized');if(_0xcd0a72[_0x72f3('0x5f')][_0x72f3('0x29')]===_0x72f3('0x2e')&&_0xcd0a72['user'][_0x72f3('0x29')]!==_0x72f3('0x2c')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0xcd0a72['body'][_0x72f3('0x29')]===_0x72f3('0x2c')&&_0xcd0a72[_0x72f3('0x2e')]['role']!==_0x72f3('0x2c')){throw new Error(_0x72f3('0x83'));}return licenseUtil[_0x72f3('0x84')]([_0xcd0a72['body']])['then'](function(){return validateUser(_0xcd0a72['body']);})[_0x72f3('0x1f')](function(_0x28d333){return updateUser(_0x28d333)[_0x72f3('0x1f')](function(_0x4a6141){if(_0x4a6141['role']===_0x72f3('0x2c')){_0x4a6141[_0x72f3('0x85')]=_0xcd0a72[_0x72f3('0x2e')][_0x72f3('0x85')];delete _0x4a6141[_0x72f3('0x86')];}return _0x4a6141;});})[_0x72f3('0x1f')](function(_0x4d22ca){return db['User']['create'](_0x4d22ca,{'include':[{'model':db[_0x72f3('0x73')],'as':_0x72f3('0x73')}]});})[_0x72f3('0x1f')](function(_0x4d8cd5){if(_0xcd0a72['body'][_0x72f3('0x29')]===_0x72f3('0x2e'))return _0x4d8cd5;if(_0xcd0a72[_0x72f3('0x2e')][_0x72f3('0x29')]!==_0x72f3('0x2e'))return _0x4d8cd5;return db['UserProfileSection']['find']({'where':{'name':_0x4d8cd5['role']==='agent'?'Agents':_0x72f3('0x30'),'userProfileId':_0xcd0a72['user'][_0x72f3('0x86')]},'raw':!![]})[_0x72f3('0x1f')](function(_0x7bc2d5){if(!_0x7bc2d5||_0x7bc2d5['autoAssociation']!=0x0)return _0x4d8cd5;return db[_0x72f3('0x39')][_0x72f3('0x82')]({'name':_0x4d8cd5[_0x72f3('0x38')],'resourceId':_0x4d8cd5['id'],'type':_0x7bc2d5[_0x72f3('0x38')],'sectionId':_0x7bc2d5['id']},{})['then'](function(){return _0x4d8cd5;});})[_0x72f3('0x28')](function(_0x407318){logger[_0x72f3('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x407318);throw _0x407318;});})[_0x72f3('0x1f')](respondWithResult(_0xef77a4,0xc9))['catch'](handleError(_0xef77a4,null));};exports[_0x72f3('0x87')]=function(_0xd9d01a,_0x2d396e){var _0x2b33ae=_0xd9d01a[_0x72f3('0x5f')];var _0x3ffe64=[];if(_0xd9d01a[_0x72f3('0x2e')][_0x72f3('0x29')]===_0x72f3('0x2a'))throw new Error(_0x72f3('0x88'));if(_[_0x72f3('0x89')](_0x2b33ae,['role',_0x72f3('0x2e')])&&_0xd9d01a[_0x72f3('0x2e')][_0x72f3('0x29')]!==_0x72f3('0x2c')){throw new Error(_0x72f3('0x8a'));}if(_[_0x72f3('0x89')](_0x2b33ae,[_0x72f3('0x29'),_0x72f3('0x2c')])&&_0xd9d01a[_0x72f3('0x2e')][_0x72f3('0x29')]!=='admin'){throw new Error(_0x72f3('0x8b'));}return licenseUtil[_0x72f3('0x84')](_0x2b33ae)[_0x72f3('0x1f')](function(){return validateUser(_0x2b33ae[0x0]);})['then'](function(){for(var _0x1096a6=0x1;_0x1096a6<_0x2b33ae[_0x72f3('0x6f')];_0x1096a6++){var _0x25999c=_0x2b33ae[_0x1096a6-0x1][_0x72f3('0x65')];if(!_0x2b33ae[_0x1096a6][_0x72f3('0x65')])_0x2b33ae[_0x1096a6][_0x72f3('0x65')]=_0x25999c+0x1;_0x3ffe64[_0x72f3('0x50')](validateUser(_0x2b33ae[_0x1096a6]));}return Promise[_0x72f3('0x5d')](_0x3ffe64);})[_0x72f3('0x1f')](function(){_0x3ffe64=[];for(var _0x5bd05e=0x0;_0x5bd05e<_0x2b33ae['length'];_0x5bd05e++){_0x3ffe64[_0x72f3('0x50')](updateUser(_0x2b33ae[_0x5bd05e]));}return Promise[_0x72f3('0x5d')](_0x3ffe64);})[_0x72f3('0x1f')](function(){_0x3ffe64=_0x2b33ae[_0x72f3('0x34')](function(_0x76747c){return db[_0x72f3('0x3d')][_0x72f3('0x82')](_0x76747c,{'include':[{'model':db[_0x72f3('0x73')],'as':'VoiceMail'}]})['then'](function(_0x55b5b6){_0x76747c['id']=_0x55b5b6['id'];return _0x76747c;});});return Promise[_0x72f3('0x5d')](_0x3ffe64);})['then'](function(_0x5e9c6d){if(_0xd9d01a[_0x72f3('0x5f')]['role']===_0x72f3('0x2e'))return _0x5e9c6d;if(_0xd9d01a[_0x72f3('0x2e')]['role']!=='user')return _0x5e9c6d;var _0x405c57=_[_0x72f3('0x89')](_0x5e9c6d,function(_0x57c7a0){return _0x57c7a0[_0x72f3('0x29')]===_0x72f3('0x2a')||_0x57c7a0[_0x72f3('0x29')]===_0x72f3('0x31');});if(!_0x405c57)return _0x5e9c6d;return db[_0x72f3('0x8c')][_0x72f3('0x51')]({'where':{'name':{'$or':[_0x72f3('0x2f'),'Telephones']},'userProfileId':_0xd9d01a[_0x72f3('0x2e')][_0x72f3('0x86')]},'raw':!![]})[_0x72f3('0x1f')](function(_0x116e07){if(_[_0x72f3('0x8d')](_0x116e07)||!_['some'](_0x116e07,[_0x72f3('0x8e'),0x0]))return _0x5e9c6d;_0x3ffe64=[];var _0x31242e=_(_0x116e07)[_0x72f3('0x34')](function(_0xc02c28){if(_0xc02c28[_0x72f3('0x8e')]===0x1)return;return _0xc02c28[_0x72f3('0x38')]===_0x72f3('0x2f')?_0x72f3('0x2a'):'telephone';})[_0x72f3('0x8f')]()[_0x72f3('0x35')]();for(var _0x30e2a3=0x0;_0x30e2a3<_0x5e9c6d[_0x72f3('0x6f')];_0x30e2a3++){if(!_[_0x72f3('0x36')](_0x31242e,_0x5e9c6d[_0x30e2a3][_0x72f3('0x29')]))return;var _0x100133=_0x5e9c6d[_0x30e2a3][_0x72f3('0x29')]===_0x72f3('0x2a')?_0x72f3('0x2f'):_0x72f3('0x30');_0x3ffe64['push'](db[_0x72f3('0x39')][_0x72f3('0x82')]({'name':_0x5e9c6d[_0x30e2a3][_0x72f3('0x38')],'resourceId':_0x5e9c6d[_0x30e2a3]['id'],'type':_0x100133,'sectionId':_[_0x72f3('0x37')](_0x116e07,['name',_0x100133])['id']},{}));}return Promise[_0x72f3('0x5d')](_0x3ffe64);});})[_0x72f3('0x1f')](respondWithResult(_0x2d396e,0xc9))[_0x72f3('0x28')](handleError(_0x2d396e,null));};exports[_0x72f3('0x90')]=function(_0x45f809,_0x5cb009){if(_0x45f809[_0x72f3('0x5f')]['id']){delete _0x45f809['body']['id'];}return db[_0x72f3('0x3d')]['find']({'where':{'id':_0x45f809[_0x72f3('0x60')]['id']}})[_0x72f3('0x1f')](function(_0x363306){if(!_0x363306)return null;if(_0x363306['id']===_0x45f809[_0x72f3('0x2e')]['id']){if(!_0x45f809[_0x72f3('0x5f')][_0x72f3('0x91')]||!_0x45f809[_0x72f3('0x5f')][_0x72f3('0x92')]){throw new db[(_0x72f3('0x93'))][(_0x72f3('0x94'))](_0x72f3('0x95'));}if(!_0x363306['authenticate'](_0x45f809[_0x72f3('0x5f')][_0x72f3('0x91')])){throw new db[(_0x72f3('0x93'))][(_0x72f3('0x94'))]('Wrong\x20credentials');}if(_0x45f809[_0x72f3('0x5f')][_0x72f3('0x91')]===_0x45f809[_0x72f3('0x5f')][_0x72f3('0x92')]){throw new db[(_0x72f3('0x93'))]['ValidationError']('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x45f809[_0x72f3('0x2e')][_0x72f3('0x29')]===_0x72f3('0x2c')){if(!_0x45f809[_0x72f3('0x5f')][_0x72f3('0x92')]){throw new db['Sequelize'][(_0x72f3('0x94'))](_0x72f3('0x96'));}}else if(_0x45f809[_0x72f3('0x2e')][_0x72f3('0x29')]===_0x72f3('0x2e')){if(!_0x45f809[_0x72f3('0x5f')][_0x72f3('0x92')]){throw new db[(_0x72f3('0x93'))][(_0x72f3('0x94'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x363306[_0x72f3('0x29')]!==_0x72f3('0x2a')){throw new db[(_0x72f3('0x93'))][(_0x72f3('0x94'))](_0x72f3('0x88'));}}else{throw new db[(_0x72f3('0x93'))]['ValidationError'](_0x72f3('0x88'));}return _0x363306;})[_0x72f3('0x1f')](handleEntityNotFound(_0x5cb009,null))[_0x72f3('0x1f')](function(_0x21c82c){return db[_0x72f3('0x66')][_0x72f3('0x97')]({'attributes':['id',_0x72f3('0x98'),_0x72f3('0x99'),_0x72f3('0x9a')]})[_0x72f3('0x1f')](function(_0x1d1fca){if(_0x1d1fca[_0x72f3('0x98')])authService[_0x72f3('0x68')](_0x45f809[_0x72f3('0x5f')]['newPassword']);if(!_0x1d1fca[_0x72f3('0x99')]||!_0x21c82c[_0x72f3('0x44')])return _0x21c82c;authService[_0x72f3('0x9b')](_0x45f809[_0x72f3('0x5f')][_0x72f3('0x92')],_0x21c82c['previousPasswords'],_0x1d1fca[_0x72f3('0x9a')]);return _0x21c82c;})[_0x72f3('0x1f')](saveUpdates({'password':_0x45f809[_0x72f3('0x5f')][_0x72f3('0x92')],'passwordResetAt':_0x45f809[_0x72f3('0x2e')]['id']==_0x45f809[_0x72f3('0x60')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x45f809[_0x72f3('0x5f')][_0x72f3('0x92')],_0x21c82c[_0x72f3('0x44')])},null));})[_0x72f3('0x1f')](respondWithResult(_0x5cb009,null))[_0x72f3('0x28')](handleError(_0x5cb009,null));};exports['addQueues']=function(_0x568541,_0x2c6e5f){var _0x1034d6=_0x568541[_0x72f3('0x5f')][_0x72f3('0x9c')];return db[_0x72f3('0x3d')][_0x72f3('0x37')]({'where':{'id':_0x568541[_0x72f3('0x60')]['id']},'attributes':['id',_0x72f3('0x38'),_0x72f3('0x29'),'online',_0x72f3('0x9d'),_0x72f3('0x9e'),_0x72f3('0x9f')]})[_0x72f3('0x1f')](handleEntityNotFound(_0x2c6e5f,null))[_0x72f3('0x1f')](function(_0x3ce2bd){if(_0x3ce2bd){if(!utils[_0x72f3('0xa0')](_0x1034d6)){throw new db['Sequelize'][(_0x72f3('0x94'))](_0x72f3('0xa1'));}return _0x3ce2bd[_0x72f3('0xa2')+_[_0x72f3('0xa3')](_0x1034d6[_0x72f3('0xa4')]())+'Queues'](_0x568541[_0x72f3('0x5f')][_0x72f3('0x63')],{'penalty':_0x568541[_0x72f3('0x5f')][_0x72f3('0xa5')]||0x0})['spread'](function(_0x413566){for(var _0x170236=0x0;_0x170236<_0x568541[_0x72f3('0x5f')][_0x72f3('0x63')][_0x72f3('0x6f')];_0x170236+=0x1){var _0x455af3={'UserId':Number(_0x568541[_0x72f3('0x60')]['id'])};_0x455af3[_[_0x72f3('0xa3')](_0x1034d6[_0x72f3('0xa4')]())+_0x72f3('0xa6')]=Number(_0x568541[_0x72f3('0x5f')]['ids'][_0x170236]);socket[_0x72f3('0x2b')](_0x72f3('0x2e')+_['capitalize'](_0x1034d6['toLowerCase']())+'Queue:save',_0x455af3);}return _0x413566;})[_0x72f3('0x1f')](function(){if(_0x1034d6==='voice'){return db[_0x72f3('0xa7')]['findAll']({'where':{'id':_0x568541[_0x72f3('0x5f')]['ids']||[]},'raw':!![],'attributes':['id','name']});}})['then'](function(_0x15e677){var _0x4b1f5f=_0x3ce2bd[_0x72f3('0xa8')]({'plain':!![]});var _0x463cbb=[];if(_0x1034d6===_0x72f3('0xa9')&&_0x4b1f5f[_0x72f3('0x29')]===_0x72f3('0x2a')&&_0x4b1f5f[_0x72f3('0xaa')]){for(let _0x1d0eef=0x0;_0x1d0eef<_0x15e677[_0x72f3('0x6f')];_0x1d0eef+=0x1){_0x463cbb[_0x72f3('0x50')]({'membername':_0x4b1f5f[_0x72f3('0x38')],'UserId':_0x4b1f5f['id'],'queue_name':_0x15e677[_0x1d0eef]['name'],'VoiceQueueId':_0x15e677[_0x1d0eef]['id'],'interface':_[_0x72f3('0x6a')](_0x4b1f5f[_0x72f3('0x9f')])?util[_0x72f3('0xab')](_0x72f3('0xac'),_0x4b1f5f[_0x72f3('0x38')]):_0x4b1f5f['interface'],'paused':_0x4b1f5f[_0x72f3('0x9e')]||![],'penalty':_0x568541[_0x72f3('0x5f')]['penalty']||0x0});}return Promise['all'](_0x463cbb[_0x72f3('0x34')](function(_0x41b112){return db['UserVoiceQueueRt'][_0x72f3('0xad')](_0x41b112);}));}return _0x3ce2bd;});}})['then'](respondWithStatusCode(_0x2c6e5f,null))[_0x72f3('0x28')](handleError(_0x2c6e5f,null));};exports[_0x72f3('0xae')]=function(_0x20bdc9,_0x207524){var _0x1ec3fd,_0x5095df;return db['User']['find']({'where':{'id':_0x20bdc9[_0x72f3('0x60')]['id']},'attributes':['id',_0x72f3('0x38'),_0x72f3('0x29')]})[_0x72f3('0x1f')](handleEntityNotFound(_0x207524,null))[_0x72f3('0x1f')](function(_0x369758){if(_0x369758){_0x1ec3fd=_0x369758;if(!_0x20bdc9[_0x72f3('0x4b')]['channel']||!utils[_0x72f3('0xa0')](_0x20bdc9[_0x72f3('0x4b')][_0x72f3('0x9c')])){throw new db[(_0x72f3('0x93'))][(_0x72f3('0x94'))](_0x72f3('0xa1'));}return _0x369758[_0x72f3('0xaf')+_[_0x72f3('0xa3')](_0x20bdc9[_0x72f3('0x4b')][_0x72f3('0x9c')][_0x72f3('0xa4')]())+_0x72f3('0xb0')](_0x20bdc9[_0x72f3('0x4b')][_0x72f3('0x63')]);}})[_0x72f3('0x1f')](function(_0x1d1cdd){if(_[_0x72f3('0xb1')](_0x20bdc9[_0x72f3('0x4b')][_0x72f3('0x63')])){for(var _0x318aee=0x0;_0x318aee<_0x20bdc9[_0x72f3('0x4b')]['ids'][_0x72f3('0x6f')];_0x318aee+=0x1){_0x5095df={'UserId':Number(_0x20bdc9[_0x72f3('0x60')]['id'])};_0x5095df[_[_0x72f3('0xa3')](_0x20bdc9[_0x72f3('0x4b')][_0x72f3('0x9c')][_0x72f3('0xa4')]())+_0x72f3('0xa6')]=Number(_0x20bdc9[_0x72f3('0x4b')][_0x72f3('0x63')][_0x318aee]);socket[_0x72f3('0x2b')](_0x72f3('0x2e')+_[_0x72f3('0xa3')](_0x20bdc9[_0x72f3('0x4b')][_0x72f3('0x9c')]['toLowerCase']())+_0x72f3('0xb2'),_0x5095df);}}else{_0x5095df={'UserId':Number(_0x20bdc9['params']['id'])};_0x5095df[_[_0x72f3('0xa3')](_0x20bdc9[_0x72f3('0x4b')][_0x72f3('0x9c')][_0x72f3('0xa4')]())+_0x72f3('0xa6')]=Number(_0x20bdc9[_0x72f3('0x4b')][_0x72f3('0x63')]);socket[_0x72f3('0x2b')]('user'+_[_0x72f3('0xa3')](_0x20bdc9[_0x72f3('0x4b')][_0x72f3('0x9c')][_0x72f3('0xa4')]())+_0x72f3('0xb2'),_0x5095df);}return _0x1d1cdd;})['then'](function(){if(_0x20bdc9[_0x72f3('0x4b')][_0x72f3('0x9c')]===_0x72f3('0xa9')){return db[_0x72f3('0xb3')][_0x72f3('0x3a')]({'where':{'UserId':_0x20bdc9[_0x72f3('0x60')]['id'],'VoiceQueueId':_0x20bdc9['query'][_0x72f3('0x63')]},'individualHooks':!![]})[_0x72f3('0x1f')](function(){return _0x1ec3fd;});}return _0x1ec3fd;})[_0x72f3('0x1f')](respondWithStatusCode(_0x207524,null))['catch'](handleError(_0x207524,null));};exports['addAvatar']=function(_0x1b98a5,_0x12eadb){_0x1b98a5[_0x72f3('0x5f')][_0x72f3('0xb4')]=_0x1b98a5[_0x72f3('0xb5')]['filename'];return db[_0x72f3('0x3d')][_0x72f3('0x37')]({'where':{'id':_0x1b98a5[_0x72f3('0x60')]['id']}})[_0x72f3('0x1f')](handleEntityNotFound(_0x12eadb,null))['then'](saveUpdates(_0x1b98a5['body'],null))['then'](respondWithResult(_0x12eadb,null))['catch'](handleError(_0x12eadb,null));};exports[_0x72f3('0xb6')]=function(_0x4d9fe9,_0xf47512){var _0x1fd0dc=path[_0x72f3('0xb7')](config[_0x72f3('0xb8')],_0x72f3('0xb9'));return db[_0x72f3('0x3d')][_0x72f3('0x37')]({'where':{'id':_0x4d9fe9[_0x72f3('0x60')]['id']},'attributes':['id',_0x72f3('0xb4')],'raw':!![]})[_0x72f3('0x1f')](handleEntityNotFound(_0xf47512,null))['then'](function(_0x213cc8){if(_0x213cc8){if(_[_0x72f3('0x6a')](_0x213cc8[_0x72f3('0xb4')])){return _0xf47512[_0x72f3('0xba')](_0x1fd0dc);}else{if(!fs[_0x72f3('0xbb')](path['join'](config['root'],_0x72f3('0xbc'),_0x213cc8[_0x72f3('0xb4')]))){return _0xf47512[_0x72f3('0xba')](_0x1fd0dc);}return _0xf47512[_0x72f3('0xba')](path['join'](config[_0x72f3('0xb8')],_0x72f3('0xbc'),_0x213cc8[_0x72f3('0xb4')]));}}})['catch'](handleError(_0xf47512,null));};exports[_0x72f3('0xbd')]=function(_0x1e1370,_0x1ab289){return db['User'][_0x72f3('0x37')]({'where':{'id':_0x1e1370[_0x72f3('0x60')]['id']},'attributes':['id']})[_0x72f3('0x1f')](handleEntityNotFound(_0x1ab289,null))[_0x72f3('0x1f')](function(_0x47a3fc){var _0x2cd829=[];values=_0x47a3fc[_0x72f3('0x55')];_0x2cd829[_0x72f3('0x50')](get_open_tabs(_0x72f3('0x54'),_0x47a3fc[_0x72f3('0x55')]));_0x2cd829[_0x72f3('0x50')](get_open_tabs(_0x72f3('0x56'),_0x47a3fc[_0x72f3('0x55')]));_0x2cd829['push'](get_open_tabs('openchannel',_0x47a3fc[_0x72f3('0x55')]));_0x2cd829[_0x72f3('0x50')](get_open_tabs(_0x72f3('0x59'),_0x47a3fc['dataValues']));_0x2cd829[_0x72f3('0x50')](get_open_tabs(_0x72f3('0x57'),_0x47a3fc[_0x72f3('0x55')]));_0x2cd829['push'](get_open_tabs(_0x72f3('0x58'),_0x47a3fc[_0x72f3('0x55')]));return Promise[_0x72f3('0x5d')](_0x2cd829);})[_0x72f3('0x1f')](function(_0x5c8382){if(_0x5c8382){var _0x3bbd2b=_['map'](values[_0x72f3('0xbe')],function(_0x52e650){return{'channel':_0x72f3('0xbf'),'id':_0x52e650['id'],'createdAt':_0x52e650['createdAt']};});var _0x306bec=_[_0x72f3('0x34')](values['FaxOpenTabs'],function(_0x4d2a7c){return{'channel':_0x72f3('0xc0'),'id':_0x4d2a7c['id'],'createdAt':_0x4d2a7c[_0x72f3('0xc1')]};});var _0x53affb=_[_0x72f3('0x34')](values[_0x72f3('0xc2')],function(_0x48191a){return{'channel':_0x72f3('0xc3'),'id':_0x48191a['id'],'createdAt':_0x48191a['createdAt']};});var _0x588987=_[_0x72f3('0x34')](values[_0x72f3('0xc4')],function(_0x2830db){return{'channel':'MAIL','id':_0x2830db['id'],'createdAt':_0x2830db[_0x72f3('0xc1')]};});var _0x470861=_[_0x72f3('0x34')](values[_0x72f3('0xc5')],function(_0x5e6ef2){return{'channel':_0x72f3('0xc6'),'id':_0x5e6ef2['id'],'createdAt':_0x5e6ef2[_0x72f3('0xc1')]};});var _0x5b99ad=_['map'](values[_0x72f3('0xc7')],function(_0x9ceaa2){return{'channel':'WHATSAPP','id':_0x9ceaa2['id'],'createdAt':_0x9ceaa2['createdAt']};});var _0x149796=_['concat'](_0x3bbd2b,_0x306bec,_0x53affb,_0x588987,_0x470861,_0x5b99ad);var _0x2d6542={'count':_0x149796[_0x72f3('0x6f')],'rows':_0x149796};return _0x2d6542;}else return null;})[_0x72f3('0x1f')](respondWithResult(_0x1ab289,null))['catch'](handleError(_0x1ab289,null));};exports[_0x72f3('0xc8')]=function(_0x436bb2,_0x5eb286){var _0x405eea={};return db[_0x72f3('0x3d')][_0x72f3('0x97')]({'where':{'id':_0x436bb2[_0x72f3('0x60')]['id']}})[_0x72f3('0x1f')](function(_0x6e4671){if(!_0x6e4671){throw new APINotFoundError(util[_0x72f3('0xab')](_0x72f3('0xc9'),_0x436bb2['params']['id']));}return contacts['describe']();})['then'](function(_0x5994bb){_0x436bb2['query'][_0x72f3('0x3d')]=_0x436bb2[_0x72f3('0x60')]['id'];_0x405eea=qs['getOptions'](_0x5994bb,_0x436bb2);if(_0x436bb2[_0x72f3('0x4b')][_0x72f3('0xca')]('includeAll')){_0x405eea['include']=[{'model':db[_0x72f3('0xcb')],'as':_0x72f3('0xcc'),'required':![]},{'model':db[_0x72f3('0xcd')],'as':_0x72f3('0xce'),'attributes':['id',_0x72f3('0x38'),'color'],'where':_0x436bb2['query'][_0x72f3('0xcf')]?{'id':_0x436bb2[_0x72f3('0x4b')][_0x72f3('0xcf')]}:undefined,'required':_0x436bb2[_0x72f3('0x4b')][_0x72f3('0xcf')]?!![]:![]}];}return contacts[_0x72f3('0x51')](_0x436bb2[_0x72f3('0x4b')],_0x436bb2[_0x72f3('0x2e')],_0x405eea,_0x5994bb);})[_0x72f3('0x1f')](respondWithFilteredResult(_0x5eb286,_0x405eea))[_0x72f3('0x28')](APIHandleError(_0x5eb286));};exports['getQueues']=function(_0x124737,_0x47a309){var _0x1d7929;var _0x13cdc2={};var _0x339d73;return db[_0x72f3('0x3d')][_0x72f3('0x97')]({'where':{'id':_0x124737[_0x72f3('0x60')]['id']},'attributes':['id',_0x72f3('0x38'),_0x72f3('0x29')]})[_0x72f3('0x1f')](handleEntityNotFound(_0x47a309,null))[_0x72f3('0x1f')](function(_0x385ca3){if(!utils[_0x72f3('0xa0')](_0x124737['query'][_0x72f3('0x9c')])){throw new db['Sequelize'][(_0x72f3('0x94'))]('Unknown\x20channel');}_0x1d7929=_0x385ca3;var _0x502ee1={};_0x502ee1[_0x72f3('0xd0')]=_[_0x72f3('0xd1')](db[_[_0x72f3('0xa3')](_0x124737[_0x72f3('0x4b')][_0x72f3('0x9c')])+_0x72f3('0xd2')][_0x72f3('0x3e')]);_0x502ee1[_0x72f3('0x4b')]=_[_0x72f3('0xd1')](_0x124737[_0x72f3('0x4b')]);_0x502ee1[_0x72f3('0xd3')]=_[_0x72f3('0xd4')](_0x502ee1[_0x72f3('0xd0')],_0x502ee1['query']);_0x13cdc2[_0x72f3('0x4f')]=_[_0x72f3('0xd4')](_0x502ee1[_0x72f3('0xd0')],qs[_0x72f3('0xd5')](_0x124737[_0x72f3('0x4b')][_0x72f3('0xd5')]));_0x13cdc2[_0x72f3('0x4f')]=_0x13cdc2[_0x72f3('0x4f')]['length']?_0x13cdc2[_0x72f3('0x4f')]:_0x502ee1[_0x72f3('0xd0')];_0x13cdc2[_0x72f3('0xd6')]=qs[_0x72f3('0xd7')](_0x124737[_0x72f3('0x4b')][_0x72f3('0xd7')]);_0x13cdc2[_0x72f3('0x49')]=qs[_0x72f3('0xd3')](_[_0x72f3('0xd8')](_0x124737['query'],_0x502ee1[_0x72f3('0xd3')]));if(_0x124737['query'][_0x72f3('0x32')]){_0x13cdc2[_0x72f3('0x49')]=_[_0x72f3('0xd9')](_0x13cdc2['where'],{'$or':_[_0x72f3('0x34')](_0x13cdc2['attributes'],function(_0xed127e){var _0x3d46b5={};_0x3d46b5[_0xed127e]={'$like':'%'+_0x124737[_0x72f3('0x4b')][_0x72f3('0x32')]+'%'};return _0x3d46b5;})});}_0x13cdc2=_[_0x72f3('0xd9')]({},_0x13cdc2,_0x124737[_0x72f3('0x5b')]);switch(_0x1d7929[_0x72f3('0x29')]){case _0x72f3('0x2c'):return db[_[_0x72f3('0xa3')](_0x124737[_0x72f3('0x4b')][_0x72f3('0x9c')])+'Queue'][_0x72f3('0x51')](_0x13cdc2);case _0x72f3('0x2e'):case _0x72f3('0x2a'):return _0x1d7929[_0x72f3('0xa8')+_['capitalize'](_0x124737[_0x72f3('0x4b')]['channel'])+_0x72f3('0xb0')](_0x13cdc2);default:throw new db[(_0x72f3('0x93'))]['ValidationError'](_0x72f3('0xda'));}})[_0x72f3('0x1f')](function(_0x484974){_0x339d73=_0x484974[_0x72f3('0x6f')];if(!_0x124737[_0x72f3('0x4b')][_0x72f3('0xca')]('nolimit')){_0x13cdc2[_0x72f3('0x19')]=qs[_0x72f3('0x19')](_0x124737[_0x72f3('0x4b')][_0x72f3('0x19')]);_0x13cdc2['offset']=qs[_0x72f3('0x18')](_0x124737[_0x72f3('0x4b')]['offset']);}switch(_0x1d7929['role']){case _0x72f3('0x2c'):return db[_[_0x72f3('0xa3')](_0x124737[_0x72f3('0x4b')][_0x72f3('0x9c')])+_0x72f3('0xd2')]['findAll'](_0x13cdc2);case _0x72f3('0x2e'):case _0x72f3('0x2a'):return _0x1d7929[_0x72f3('0xa8')+_[_0x72f3('0xa3')](_0x124737[_0x72f3('0x4b')][_0x72f3('0x9c')])+_0x72f3('0xb0')](_0x13cdc2);}})[_0x72f3('0x1f')](function(_0x4070e9){return{'count':_0x339d73,'rows':_0x4070e9};})[_0x72f3('0x1f')](respondWithResult(_0x47a309,null))[_0x72f3('0x28')](handleError(_0x47a309,null));};exports[_0x72f3('0xdb')]=function(_0x4f40a2,_0x2f5718){var _0x29ed12={};var _0x3347ff={};var _0x16a085;var _0x11bfae;return db[_0x72f3('0x3d')][_0x72f3('0x97')]({'where':{'id':_0x4f40a2[_0x72f3('0x60')]['id']}})['then'](handleEntityNotFound(_0x2f5718,null))[_0x72f3('0x1f')](function(_0x2e0472){if(_0x2e0472){_0x16a085=_0x2e0472;_0x3347ff[_0x72f3('0xd0')]=_[_0x72f3('0xd1')](db[_0x72f3('0xb3')][_0x72f3('0x3e')]);_0x3347ff[_0x72f3('0x4b')]=_[_0x72f3('0xd1')](_0x4f40a2[_0x72f3('0x4b')]);_0x3347ff[_0x72f3('0xd3')]=_[_0x72f3('0xd4')](_0x3347ff[_0x72f3('0xd0')],_0x3347ff['query']);_0x29ed12[_0x72f3('0x4f')]=_[_0x72f3('0xd4')](_0x3347ff[_0x72f3('0xd0')],qs[_0x72f3('0xd5')](_0x4f40a2[_0x72f3('0x4b')]['fields']));_0x29ed12[_0x72f3('0x4f')]=_0x29ed12[_0x72f3('0x4f')][_0x72f3('0x6f')]?_0x29ed12[_0x72f3('0x4f')]:_0x3347ff[_0x72f3('0xd0')];_0x29ed12['order']=qs[_0x72f3('0xd7')](_0x4f40a2[_0x72f3('0x4b')][_0x72f3('0xd7')]);_0x29ed12[_0x72f3('0x49')]=qs[_0x72f3('0xd3')](_[_0x72f3('0xd8')](_0x4f40a2[_0x72f3('0x4b')],_0x3347ff['filters']));if(_0x4f40a2[_0x72f3('0x4b')]['filter']){_0x29ed12[_0x72f3('0x49')]=_[_0x72f3('0xd9')](_0x29ed12[_0x72f3('0x49')],{'$or':_[_0x72f3('0x34')](_0x29ed12[_0x72f3('0x4f')],function(_0x1cee2b){var _0x20fd30={};_0x20fd30[_0x1cee2b]={'$like':'%'+_0x4f40a2[_0x72f3('0x4b')]['filter']+'%'};return _0x20fd30;})});}_0x29ed12=_['merge']({},_0x29ed12,_0x4f40a2[_0x72f3('0x5b')]);return _0x16a085[_0x72f3('0xdb')](_0x29ed12);}})[_0x72f3('0x1f')](function(_0x1c584a){if(_0x1c584a){_0x11bfae=_0x1c584a[_0x72f3('0x6f')];if(!_0x4f40a2[_0x72f3('0x4b')][_0x72f3('0xca')](_0x72f3('0xdc'))){_0x29ed12[_0x72f3('0x19')]=qs[_0x72f3('0x19')](_0x4f40a2['query'][_0x72f3('0x19')]);_0x29ed12['offset']=qs['offset'](_0x4f40a2[_0x72f3('0x4b')][_0x72f3('0x18')]);}return _0x16a085[_0x72f3('0xdb')](_0x29ed12);}})[_0x72f3('0x1f')](function(_0x262e04){if(_0x262e04){return _0x262e04?{'count':_0x11bfae,'rows':_0x262e04}:null;}})['then'](respondWithResult(_0x2f5718,null))[_0x72f3('0x28')](handleError(_0x2f5718,null));};exports[_0x72f3('0xdd')]=function(_0x6ad827,_0x1b6077){var _0x398367={};var _0x1af899={};var _0x47c1a3;var _0x21714d;return db[_0x72f3('0x3d')]['findOne']({'where':{'id':_0x6ad827['params']['id']}})[_0x72f3('0x1f')](handleEntityNotFound(_0x1b6077,null))[_0x72f3('0x1f')](function(_0x561ee1){if(_0x561ee1){_0x47c1a3=_0x561ee1;_0x1af899[_0x72f3('0xd0')]=_[_0x72f3('0xd1')](db[_0x72f3('0xde')][_0x72f3('0x3e')]);_0x1af899['query']=_['keys'](_0x6ad827[_0x72f3('0x4b')]);_0x1af899[_0x72f3('0xd3')]=_['intersection'](_0x1af899[_0x72f3('0xd0')],_0x1af899[_0x72f3('0x4b')]);_0x398367[_0x72f3('0x4f')]=_[_0x72f3('0xd4')](_0x1af899[_0x72f3('0xd0')],qs[_0x72f3('0xd5')](_0x6ad827[_0x72f3('0x4b')]['fields']));_0x398367['attributes']=_0x398367[_0x72f3('0x4f')][_0x72f3('0x6f')]?_0x398367['attributes']:_0x1af899[_0x72f3('0xd0')];_0x398367[_0x72f3('0xd6')]=qs[_0x72f3('0xd7')](_0x6ad827[_0x72f3('0x4b')][_0x72f3('0xd7')]);_0x398367[_0x72f3('0x49')]=qs[_0x72f3('0xd3')](_[_0x72f3('0xd8')](_0x6ad827[_0x72f3('0x4b')],_0x1af899[_0x72f3('0xd3')]));if(_0x6ad827['query']['filter']){_0x398367[_0x72f3('0x49')]=_['merge'](_0x398367[_0x72f3('0x49')],{'$or':_[_0x72f3('0x34')](_0x398367[_0x72f3('0x4f')],function(_0x2083fb){var _0x58a138={};_0x58a138[_0x2083fb]={'$like':'%'+_0x6ad827[_0x72f3('0x4b')][_0x72f3('0x32')]+'%'};return _0x58a138;})});}_0x398367=_['merge']({},_0x398367,_0x6ad827[_0x72f3('0x5b')]);return _0x47c1a3[_0x72f3('0xdd')](_0x398367);}})[_0x72f3('0x1f')](function(_0x347e46){if(_0x347e46){_0x21714d=_0x347e46[_0x72f3('0x6f')];if(!_0x6ad827[_0x72f3('0x4b')][_0x72f3('0xca')]('nolimit')){_0x398367[_0x72f3('0x19')]=qs[_0x72f3('0x19')](_0x6ad827[_0x72f3('0x4b')][_0x72f3('0x19')]);_0x398367[_0x72f3('0x18')]=qs['offset'](_0x6ad827['query'][_0x72f3('0x18')]);}return _0x47c1a3[_0x72f3('0xdd')](_0x398367);}})[_0x72f3('0x1f')](function(_0x2cfc9c){if(_0x2cfc9c){return _0x2cfc9c?{'count':_0x21714d,'rows':_0x2cfc9c}:null;}})[_0x72f3('0x1f')](respondWithResult(_0x1b6077,null))[_0x72f3('0x28')](handleError(_0x1b6077,null));};exports[_0x72f3('0xdf')]=function(_0x480a91,_0x581978){var _0xf39084={'raw':!![],'where':{}};var _0x5c2551={};var _0x591c35={'count':0x0,'rows':[]};return db[_0x72f3('0x3d')][_0x72f3('0x97')]({'where':{'id':_0x480a91[_0x72f3('0x60')]['id']}})['then'](handleEntityNotFound(_0x581978,null))[_0x72f3('0x1f')](function(_0x1ecea6){if(_0x1ecea6){_0x5c2551[_0x72f3('0xd0')]=_[_0x72f3('0xd1')](db[_0x72f3('0xe0')][_0x72f3('0x3e')]);_0x5c2551[_0x72f3('0x4b')]=_[_0x72f3('0xd1')](_0x480a91['query']);_0x5c2551[_0x72f3('0xd3')]=_[_0x72f3('0xd4')](_0x5c2551[_0x72f3('0xd0')],_0x5c2551[_0x72f3('0x4b')]);_0xf39084[_0x72f3('0x4f')]=_[_0x72f3('0xd4')](_0x5c2551[_0x72f3('0xd0')],qs['fields'](_0x480a91[_0x72f3('0x4b')]['fields']));_0xf39084[_0x72f3('0x4f')]=_0xf39084['attributes'][_0x72f3('0x6f')]?_0xf39084[_0x72f3('0x4f')]:_0x5c2551[_0x72f3('0xd0')];if(!_0x480a91[_0x72f3('0x4b')][_0x72f3('0xca')]('nolimit')){_0xf39084[_0x72f3('0x19')]=qs[_0x72f3('0x19')](_0x480a91[_0x72f3('0x4b')][_0x72f3('0x19')]);_0xf39084[_0x72f3('0x18')]=qs[_0x72f3('0x18')](_0x480a91['query']['offset']);}_0xf39084[_0x72f3('0xd6')]=qs[_0x72f3('0xd7')](_0x480a91['query'][_0x72f3('0xd7')]);_0xf39084[_0x72f3('0x49')]=qs[_0x72f3('0xd3')](_[_0x72f3('0xd8')](_0x480a91['query'],_0x5c2551[_0x72f3('0xd3')]));_0xf39084[_0x72f3('0x49')][_0x72f3('0xe1')]=_0x1ecea6['id'];if(_0x480a91[_0x72f3('0x4b')][_0x72f3('0x32')]){_0xf39084[_0x72f3('0x49')]=_['merge'](_0xf39084[_0x72f3('0x49')],{'$or':_[_0x72f3('0x34')](_0xf39084[_0x72f3('0x4f')],function(_0x1a5fad){var _0x5d4dac={};_0x5d4dac[_0x1a5fad]={'$like':'%'+_0x480a91[_0x72f3('0x4b')][_0x72f3('0x32')]+'%'};return _0x5d4dac;})});}_0xf39084=_[_0x72f3('0xd9')]({},_0xf39084,_0x480a91['options']);return db['VoiceRecording'][_0x72f3('0x1b')]({'where':_0xf39084[_0x72f3('0x49')]})[_0x72f3('0x1f')](function(_0x9cbde6){_0x591c35[_0x72f3('0x1b')]=_0x9cbde6;if(_0x480a91['query'][_0x72f3('0x5a')]){_0xf39084['include']=[{'all':!![]}];}return db[_0x72f3('0xe0')][_0x72f3('0x51')](_0xf39084);})[_0x72f3('0x1f')](function(_0x57401e){_0x591c35[_0x72f3('0x52')]=_0x57401e;return _0x591c35;});}})[_0x72f3('0x1f')](respondWithFilteredResult(_0x581978,_0xf39084))[_0x72f3('0x28')](handleError(_0x581978,null));};exports[_0x72f3('0xe2')]=function(_0x5c1964,_0x1f6fa5){var _0x1ef38f={'raw':!![],'where':{}};var _0x2fffe6={};var _0x37dc0c={'count':0x0,'rows':[]};return db[_0x72f3('0x3d')]['findOne']({'where':{'id':_0x5c1964[_0x72f3('0x60')]['id']}})[_0x72f3('0x1f')](handleEntityNotFound(_0x1f6fa5,null))['then'](function(_0x4ab9a6){if(_0x4ab9a6){_0x2fffe6[_0x72f3('0xd0')]=_[_0x72f3('0xd1')](db[_0x72f3('0xe3')][_0x72f3('0x3e')]);_0x2fffe6[_0x72f3('0x4b')]=_[_0x72f3('0xd1')](_0x5c1964[_0x72f3('0x4b')]);_0x2fffe6[_0x72f3('0xd3')]=_[_0x72f3('0xd4')](_0x2fffe6['model'],_0x2fffe6[_0x72f3('0x4b')]);_0x1ef38f['attributes']=_[_0x72f3('0xd4')](_0x2fffe6[_0x72f3('0xd0')],qs[_0x72f3('0xd5')](_0x5c1964[_0x72f3('0x4b')]['fields']));_0x1ef38f[_0x72f3('0x4f')]=_0x1ef38f[_0x72f3('0x4f')][_0x72f3('0x6f')]?_0x1ef38f[_0x72f3('0x4f')]:_0x2fffe6[_0x72f3('0xd0')];if(!_0x5c1964[_0x72f3('0x4b')][_0x72f3('0xca')](_0x72f3('0xdc'))){_0x1ef38f[_0x72f3('0x19')]=qs[_0x72f3('0x19')](_0x5c1964[_0x72f3('0x4b')]['limit']);_0x1ef38f[_0x72f3('0x18')]=qs['offset'](_0x5c1964[_0x72f3('0x4b')][_0x72f3('0x18')]);}_0x1ef38f[_0x72f3('0xd6')]=qs[_0x72f3('0xd7')](_0x5c1964[_0x72f3('0x4b')][_0x72f3('0xd7')]);_0x1ef38f[_0x72f3('0x49')]=qs[_0x72f3('0xd3')](_[_0x72f3('0xd8')](_0x5c1964[_0x72f3('0x4b')],_0x2fffe6[_0x72f3('0xd3')]));_0x1ef38f[_0x72f3('0x49')]['UserId']=_0x4ab9a6['id'];if(_0x5c1964[_0x72f3('0x4b')]['filter']){_0x1ef38f[_0x72f3('0x49')]=_[_0x72f3('0xd9')](_0x1ef38f['where'],{'$or':_[_0x72f3('0x34')](_0x1ef38f[_0x72f3('0x4f')],function(_0x4bc738){var _0x428902={};_0x428902[_0x4bc738]={'$like':'%'+_0x5c1964[_0x72f3('0x4b')]['filter']+'%'};return _0x428902;})});}_0x1ef38f=_['merge']({},_0x1ef38f,_0x5c1964['options']);return db[_0x72f3('0xe3')]['count']({'where':_0x1ef38f[_0x72f3('0x49')]})[_0x72f3('0x1f')](function(_0x4f5388){_0x37dc0c[_0x72f3('0x1b')]=_0x4f5388;if(_0x5c1964['query'][_0x72f3('0x5a')]){_0x1ef38f['include']=[{'all':!![]}];}return db[_0x72f3('0xe3')][_0x72f3('0x51')](_0x1ef38f);})[_0x72f3('0x1f')](function(_0x12f0be){_0x37dc0c[_0x72f3('0x52')]=_0x12f0be;return _0x37dc0c;});}})[_0x72f3('0x1f')](respondWithFilteredResult(_0x1f6fa5,_0x1ef38f))[_0x72f3('0x28')](handleError(_0x1f6fa5,null));};exports['getChatInteractions']=function(_0x3cd68e,_0x355814){var _0x480a36={};var _0x362e88={};var _0x2cf486;var _0x338427;return db['User'][_0x72f3('0x97')]({'where':{'id':_0x3cd68e[_0x72f3('0x60')]['id']}})[_0x72f3('0x1f')](handleEntityNotFound(_0x355814,null))[_0x72f3('0x1f')](function(_0x5e7214){if(_0x5e7214){_0x2cf486=_0x5e7214;_0x362e88['model']=_[_0x72f3('0xd1')](db[_0x72f3('0xe4')][_0x72f3('0x3e')]);_0x362e88['query']=_[_0x72f3('0xd1')](_0x3cd68e['query']);_0x362e88[_0x72f3('0xd3')]=_[_0x72f3('0xd4')](_0x362e88['model'],_0x362e88[_0x72f3('0x4b')]);_0x480a36['attributes']=_[_0x72f3('0xd4')](_0x362e88[_0x72f3('0xd0')],qs[_0x72f3('0xd5')](_0x3cd68e[_0x72f3('0x4b')][_0x72f3('0xd5')]));_0x480a36[_0x72f3('0x4f')]=_0x480a36[_0x72f3('0x4f')][_0x72f3('0x6f')]?_0x480a36[_0x72f3('0x4f')]:_0x362e88['model'];_0x480a36[_0x72f3('0xd6')]=qs['sort'](_0x3cd68e[_0x72f3('0x4b')][_0x72f3('0xd7')]);_0x480a36[_0x72f3('0x49')]=qs[_0x72f3('0xd3')](_[_0x72f3('0xd8')](_0x3cd68e['query'],_0x362e88[_0x72f3('0xd3')]));if(_0x3cd68e[_0x72f3('0x4b')][_0x72f3('0x32')]){_0x480a36['where']=_[_0x72f3('0xd9')](_0x480a36[_0x72f3('0x49')],{'$or':_[_0x72f3('0x34')](_0x480a36['attributes'],function(_0x1c0bf6){var _0x5a90f7={};_0x5a90f7[_0x1c0bf6]={'$like':'%'+_0x3cd68e['query'][_0x72f3('0x32')]+'%'};return _0x5a90f7;})});}_0x480a36=_['merge']({},_0x480a36,_0x3cd68e[_0x72f3('0x5b')]);return _0x2cf486[_0x72f3('0xe5')](_0x480a36);}})['then'](function(_0x39c5f8){if(_0x39c5f8){_0x338427=_0x39c5f8[_0x72f3('0x6f')];if(!_0x3cd68e['query'][_0x72f3('0xca')](_0x72f3('0xdc'))){_0x480a36[_0x72f3('0x19')]=qs[_0x72f3('0x19')](_0x3cd68e['query']['limit']);_0x480a36[_0x72f3('0x18')]=qs[_0x72f3('0x18')](_0x3cd68e[_0x72f3('0x4b')][_0x72f3('0x18')]);}return _0x2cf486[_0x72f3('0xe5')](_0x480a36);}})[_0x72f3('0x1f')](function(_0x32da63){if(_0x32da63){return _0x32da63?{'count':_0x338427,'rows':_0x32da63}:null;}})['then'](respondWithResult(_0x355814,null))['catch'](handleError(_0x355814,null));};exports['getOpenchannelInteractions']=function(_0x52c371,_0x3e178f){var _0x55e95a={};var _0xc20c2a={};var _0x4d661f;var _0x585a19;return db[_0x72f3('0x3d')][_0x72f3('0x97')]({'where':{'id':_0x52c371[_0x72f3('0x60')]['id']}})[_0x72f3('0x1f')](handleEntityNotFound(_0x3e178f,null))[_0x72f3('0x1f')](function(_0x2d4ace){if(_0x2d4ace){_0x4d661f=_0x2d4ace;_0xc20c2a['model']=_[_0x72f3('0xd1')](db[_0x72f3('0xe6')]['rawAttributes']);_0xc20c2a[_0x72f3('0x4b')]=_['keys'](_0x52c371[_0x72f3('0x4b')]);_0xc20c2a[_0x72f3('0xd3')]=_[_0x72f3('0xd4')](_0xc20c2a[_0x72f3('0xd0')],_0xc20c2a['query']);_0x55e95a[_0x72f3('0x4f')]=_[_0x72f3('0xd4')](_0xc20c2a[_0x72f3('0xd0')],qs['fields'](_0x52c371[_0x72f3('0x4b')][_0x72f3('0xd5')]));_0x55e95a[_0x72f3('0x4f')]=_0x55e95a['attributes']['length']?_0x55e95a[_0x72f3('0x4f')]:_0xc20c2a['model'];_0x55e95a['order']=qs[_0x72f3('0xd7')](_0x52c371['query'][_0x72f3('0xd7')]);_0x55e95a[_0x72f3('0x49')]=qs['filters'](_[_0x72f3('0xd8')](_0x52c371['query'],_0xc20c2a['filters']));if(_0x52c371[_0x72f3('0x4b')][_0x72f3('0x32')]){_0x55e95a['where']=_[_0x72f3('0xd9')](_0x55e95a['where'],{'$or':_[_0x72f3('0x34')](_0x55e95a[_0x72f3('0x4f')],function(_0x147d62){var _0x327c5b={};_0x327c5b[_0x147d62]={'$like':'%'+_0x52c371[_0x72f3('0x4b')][_0x72f3('0x32')]+'%'};return _0x327c5b;})});}_0x55e95a=_[_0x72f3('0xd9')]({},_0x55e95a,_0x52c371['options']);return _0x4d661f[_0x72f3('0xe7')](_0x55e95a);}})[_0x72f3('0x1f')](function(_0x8c8753){if(_0x8c8753){_0x585a19=_0x8c8753['length'];if(!_0x52c371['query'][_0x72f3('0xca')](_0x72f3('0xdc'))){_0x55e95a[_0x72f3('0x19')]=qs['limit'](_0x52c371[_0x72f3('0x4b')][_0x72f3('0x19')]);_0x55e95a['offset']=qs[_0x72f3('0x18')](_0x52c371['query']['offset']);}return _0x4d661f[_0x72f3('0xe7')](_0x55e95a);}})[_0x72f3('0x1f')](function(_0x3c4ada){if(_0x3c4ada){return _0x3c4ada?{'count':_0x585a19,'rows':_0x3c4ada}:null;}})[_0x72f3('0x1f')](respondWithResult(_0x3e178f,null))[_0x72f3('0x28')](handleError(_0x3e178f,null));};exports['getMailInteractions']=function(_0x23638e,_0x2dc7ad){var _0x3d20e9={'raw':!![],'where':{}};var _0x3f2179={};var _0x326f93={'count':0x0,'rows':[]};return db[_0x72f3('0x3d')][_0x72f3('0x97')]({'where':{'id':_0x23638e[_0x72f3('0x60')]['id']}})[_0x72f3('0x1f')](handleEntityNotFound(_0x2dc7ad,null))[_0x72f3('0x1f')](function(_0x2287ba){if(_0x2287ba){_0x3f2179[_0x72f3('0xd0')]=_[_0x72f3('0xd1')](db['MailInteraction']['rawAttributes']);_0x3f2179[_0x72f3('0x4b')]=_[_0x72f3('0xd1')](_0x23638e[_0x72f3('0x4b')]);_0x3f2179['filters']=_[_0x72f3('0xd4')](_0x3f2179[_0x72f3('0xd0')],_0x3f2179[_0x72f3('0x4b')]);_0x3d20e9[_0x72f3('0x4f')]=_[_0x72f3('0xd4')](_0x3f2179['model'],qs[_0x72f3('0xd5')](_0x23638e[_0x72f3('0x4b')]['fields']));_0x3d20e9[_0x72f3('0x4f')]=_0x3d20e9['attributes'][_0x72f3('0x6f')]?_0x3d20e9[_0x72f3('0x4f')]:_0x3f2179[_0x72f3('0xd0')];if(!_0x23638e[_0x72f3('0x4b')]['hasOwnProperty'](_0x72f3('0xdc'))){_0x3d20e9[_0x72f3('0x19')]=qs[_0x72f3('0x19')](_0x23638e[_0x72f3('0x4b')]['limit']);_0x3d20e9[_0x72f3('0x18')]=qs[_0x72f3('0x18')](_0x23638e[_0x72f3('0x4b')][_0x72f3('0x18')]);}_0x3d20e9[_0x72f3('0xd6')]=qs['sort'](_0x23638e[_0x72f3('0x4b')][_0x72f3('0xd7')]);_0x3d20e9['where']=qs[_0x72f3('0xd3')](_['pick'](_0x23638e[_0x72f3('0x4b')],_0x3f2179[_0x72f3('0xd3')]));_0x3d20e9[_0x72f3('0x49')]['UserId']=_0x2287ba['id'];if(_0x23638e[_0x72f3('0x4b')][_0x72f3('0x32')]){_0x3d20e9[_0x72f3('0x49')]=_[_0x72f3('0xd9')](_0x3d20e9['where'],{'$or':_['map'](_0x3d20e9[_0x72f3('0x4f')],function(_0x384a62){var _0x40000b={};_0x40000b[_0x384a62]={'$like':'%'+_0x23638e['query'][_0x72f3('0x32')]+'%'};return _0x40000b;})});}_0x3d20e9=_[_0x72f3('0xd9')]({},_0x3d20e9,_0x23638e[_0x72f3('0x5b')]);return db['MailInteraction'][_0x72f3('0x1b')]({'where':_0x3d20e9['where']})[_0x72f3('0x1f')](function(_0x94c3e4){_0x326f93[_0x72f3('0x1b')]=_0x94c3e4;if(_0x23638e[_0x72f3('0x4b')][_0x72f3('0x5a')]){_0x3d20e9[_0x72f3('0x4a')]=[{'all':!![]}];}return db['MailInteraction']['findAll'](_0x3d20e9);})['then'](function(_0x2aa147){_0x326f93[_0x72f3('0x52')]=_0x2aa147;return _0x326f93;});}})[_0x72f3('0x1f')](respondWithFilteredResult(_0x2dc7ad,_0x3d20e9))['catch'](handleError(_0x2dc7ad,null));};exports[_0x72f3('0xe8')]=function(_0x1a14b2,_0x45c041){var _0x23a8cd={};var _0x5d26ab={};var _0x38674a;var _0x35fa0b;return db[_0x72f3('0x3d')][_0x72f3('0x97')]({'where':{'id':_0x1a14b2[_0x72f3('0x60')]['id']}})[_0x72f3('0x1f')](handleEntityNotFound(_0x45c041,null))[_0x72f3('0x1f')](function(_0x473c53){if(_0x473c53){_0x38674a=_0x473c53;_0x5d26ab['model']=_[_0x72f3('0xd1')](db[_0x72f3('0xe9')][_0x72f3('0x3e')]);_0x5d26ab[_0x72f3('0x4b')]=_[_0x72f3('0xd1')](_0x1a14b2[_0x72f3('0x4b')]);_0x5d26ab[_0x72f3('0xd3')]=_[_0x72f3('0xd4')](_0x5d26ab[_0x72f3('0xd0')],_0x5d26ab['query']);_0x23a8cd[_0x72f3('0x4f')]=_['intersection'](_0x5d26ab['model'],qs['fields'](_0x1a14b2['query'][_0x72f3('0xd5')]));_0x23a8cd[_0x72f3('0x4f')]=_0x23a8cd[_0x72f3('0x4f')]['length']?_0x23a8cd['attributes']:_0x5d26ab[_0x72f3('0xd0')];_0x23a8cd[_0x72f3('0xd6')]=qs[_0x72f3('0xd7')](_0x1a14b2[_0x72f3('0x4b')][_0x72f3('0xd7')]);_0x23a8cd['where']=qs[_0x72f3('0xd3')](_[_0x72f3('0xd8')](_0x1a14b2[_0x72f3('0x4b')],_0x5d26ab[_0x72f3('0xd3')]));if(_0x1a14b2[_0x72f3('0x4b')]['filter']){_0x23a8cd[_0x72f3('0x49')]=_[_0x72f3('0xd9')](_0x23a8cd['where'],{'$or':_['map'](_0x23a8cd['attributes'],function(_0x5bf97c){var _0x5310ba={};_0x5310ba[_0x5bf97c]={'$like':'%'+_0x1a14b2['query'][_0x72f3('0x32')]+'%'};return _0x5310ba;})});}_0x23a8cd=_[_0x72f3('0xd9')]({},_0x23a8cd,_0x1a14b2[_0x72f3('0x5b')]);return _0x38674a['getSmsInteractions'](_0x23a8cd);}})[_0x72f3('0x1f')](function(_0x30b5a7){if(_0x30b5a7){_0x35fa0b=_0x30b5a7[_0x72f3('0x6f')];if(!_0x1a14b2[_0x72f3('0x4b')][_0x72f3('0xca')](_0x72f3('0xdc'))){_0x23a8cd['limit']=qs['limit'](_0x1a14b2[_0x72f3('0x4b')]['limit']);_0x23a8cd['offset']=qs[_0x72f3('0x18')](_0x1a14b2['query']['offset']);}return _0x38674a['getSmsInteractions'](_0x23a8cd);}})[_0x72f3('0x1f')](function(_0x507547){if(_0x507547){return _0x507547?{'count':_0x35fa0b,'rows':_0x507547}:null;}})[_0x72f3('0x1f')](respondWithResult(_0x45c041,null))['catch'](handleError(_0x45c041,null));};exports[_0x72f3('0xea')]=function(_0x473312,_0x242ccf){var _0x20dabe={};var _0x3f9e8b={};var _0x4908e0;var _0x4555a7;return db[_0x72f3('0x3d')][_0x72f3('0x97')]({'where':{'id':_0x473312['params']['id']}})[_0x72f3('0x1f')](handleEntityNotFound(_0x242ccf,null))['then'](function(_0xb21bb3){if(_0xb21bb3){_0x4908e0=_0xb21bb3;_0x3f9e8b[_0x72f3('0xd0')]=_[_0x72f3('0xd1')](db['FaxInteraction']['rawAttributes']);_0x3f9e8b[_0x72f3('0x4b')]=_[_0x72f3('0xd1')](_0x473312['query']);_0x3f9e8b['filters']=_[_0x72f3('0xd4')](_0x3f9e8b[_0x72f3('0xd0')],_0x3f9e8b[_0x72f3('0x4b')]);_0x20dabe[_0x72f3('0x4f')]=_[_0x72f3('0xd4')](_0x3f9e8b['model'],qs[_0x72f3('0xd5')](_0x473312[_0x72f3('0x4b')][_0x72f3('0xd5')]));_0x20dabe[_0x72f3('0x4f')]=_0x20dabe[_0x72f3('0x4f')]['length']?_0x20dabe[_0x72f3('0x4f')]:_0x3f9e8b[_0x72f3('0xd0')];_0x20dabe[_0x72f3('0xd6')]=qs[_0x72f3('0xd7')](_0x473312[_0x72f3('0x4b')][_0x72f3('0xd7')]);_0x20dabe[_0x72f3('0x49')]=qs[_0x72f3('0xd3')](_[_0x72f3('0xd8')](_0x473312[_0x72f3('0x4b')],_0x3f9e8b['filters']));if(_0x473312[_0x72f3('0x4b')]['filter']){_0x20dabe[_0x72f3('0x49')]=_[_0x72f3('0xd9')](_0x20dabe[_0x72f3('0x49')],{'$or':_[_0x72f3('0x34')](_0x20dabe['attributes'],function(_0x395436){var _0x2fb97c={};_0x2fb97c[_0x395436]={'$like':'%'+_0x473312[_0x72f3('0x4b')]['filter']+'%'};return _0x2fb97c;})});}_0x20dabe=_[_0x72f3('0xd9')]({},_0x20dabe,_0x473312[_0x72f3('0x5b')]);return _0x4908e0[_0x72f3('0xea')](_0x20dabe);}})[_0x72f3('0x1f')](function(_0x48ef25){if(_0x48ef25){_0x4555a7=_0x48ef25['length'];if(!_0x473312[_0x72f3('0x4b')][_0x72f3('0xca')](_0x72f3('0xdc'))){_0x20dabe[_0x72f3('0x19')]=qs[_0x72f3('0x19')](_0x473312[_0x72f3('0x4b')][_0x72f3('0x19')]);_0x20dabe[_0x72f3('0x18')]=qs[_0x72f3('0x18')](_0x473312[_0x72f3('0x4b')][_0x72f3('0x18')]);}return _0x4908e0['getFaxInteractions'](_0x20dabe);}})[_0x72f3('0x1f')](function(_0x42f9c7){if(_0x42f9c7){return _0x42f9c7?{'count':_0x4555a7,'rows':_0x42f9c7}:null;}})[_0x72f3('0x1f')](respondWithResult(_0x242ccf,null))['catch'](handleError(_0x242ccf,null));};exports[_0x72f3('0xeb')]=function(_0x94dfa,_0xdcf0be){var _0x1fe7e9={};var _0x4ac83b={};var _0x3282db;var _0x16c568;return db['User'][_0x72f3('0x97')]({'where':{'id':_0x94dfa['params']['id']}})[_0x72f3('0x1f')](handleEntityNotFound(_0xdcf0be,null))[_0x72f3('0x1f')](function(_0x544a23){if(_0x544a23){_0x3282db=_0x544a23;_0x4ac83b['model']=_[_0x72f3('0xd1')](db[_0x72f3('0xec')][_0x72f3('0x3e')]);_0x4ac83b['query']=_[_0x72f3('0xd1')](_0x94dfa[_0x72f3('0x4b')]);_0x4ac83b[_0x72f3('0xd3')]=_[_0x72f3('0xd4')](_0x4ac83b[_0x72f3('0xd0')],_0x4ac83b[_0x72f3('0x4b')]);_0x1fe7e9[_0x72f3('0x4f')]=_['intersection'](_0x4ac83b[_0x72f3('0xd0')],qs[_0x72f3('0xd5')](_0x94dfa[_0x72f3('0x4b')][_0x72f3('0xd5')]));_0x1fe7e9[_0x72f3('0x4f')]=_0x1fe7e9[_0x72f3('0x4f')]['length']?_0x1fe7e9[_0x72f3('0x4f')]:_0x4ac83b[_0x72f3('0xd0')];_0x1fe7e9[_0x72f3('0xd6')]=qs[_0x72f3('0xd7')](_0x94dfa[_0x72f3('0x4b')][_0x72f3('0xd7')]);_0x1fe7e9[_0x72f3('0x49')]=qs[_0x72f3('0xd3')](_['pick'](_0x94dfa['query'],_0x4ac83b['filters']));if(_0x94dfa['query']['filter']){_0x1fe7e9[_0x72f3('0x49')]=_[_0x72f3('0xd9')](_0x1fe7e9['where'],{'$or':_[_0x72f3('0x34')](_0x1fe7e9[_0x72f3('0x4f')],function(_0x3a99b3){var _0x352316={};_0x352316[_0x3a99b3]={'$like':'%'+_0x94dfa[_0x72f3('0x4b')][_0x72f3('0x32')]+'%'};return _0x352316;})});}_0x1fe7e9=_[_0x72f3('0xd9')]({},_0x1fe7e9,_0x94dfa[_0x72f3('0x5b')]);return _0x3282db[_0x72f3('0xeb')](_0x1fe7e9);}})[_0x72f3('0x1f')](function(_0x38f755){if(_0x38f755){_0x16c568=_0x38f755[_0x72f3('0x6f')];if(!_0x94dfa[_0x72f3('0x4b')][_0x72f3('0xca')](_0x72f3('0xdc'))){_0x1fe7e9['limit']=qs[_0x72f3('0x19')](_0x94dfa[_0x72f3('0x4b')][_0x72f3('0x19')]);_0x1fe7e9[_0x72f3('0x18')]=qs['offset'](_0x94dfa[_0x72f3('0x4b')][_0x72f3('0x18')]);}return _0x3282db[_0x72f3('0xeb')](_0x1fe7e9);}})['then'](function(_0xa85c8d){if(_0xa85c8d){return _0xa85c8d?{'count':_0x16c568,'rows':_0xa85c8d}:null;}})[_0x72f3('0x1f')](respondWithResult(_0xdcf0be,null))[_0x72f3('0x28')](handleError(_0xdcf0be,null));};exports[_0x72f3('0xed')]=function(_0x8f14f1,_0x284c7c,_0x2636a5){var _0x1f1b90;var _0x3d2dfb;var _0x40f2a4;var _0x2785f6=!_['isNil'](_0x8f14f1['params']['id'])?_0x8f14f1['params']['id']:!_[_0x72f3('0x6a')](_0x8f14f1[_0x72f3('0x2e')]['id'])?_0x8f14f1[_0x72f3('0x2e')]['id']:null;return db[_0x72f3('0x3d')][_0x72f3('0x37')]({'where':{'id':_0x2785f6,'role':{'$or':[_0x72f3('0x2c'),'user',_0x72f3('0x2a')]}},'attributes':['id','name','phone',_0x72f3('0xee'),_0x72f3('0x29'),_0x72f3('0x65'),_0x72f3('0x9d')]})[_0x72f3('0x1f')](function(_0xf924b7){if(_0xf924b7){if(_0xf924b7[_0x72f3('0x29')]===_0x72f3('0x2a')){_0x1f1b90=_0xf924b7;if(_0x8f14f1['body'][_0x72f3('0x9f')]){_0x40f2a4=util[_0x72f3('0xab')](_0x72f3('0xef'),_0x1f1b90[_0x8f14f1[_0x72f3('0x5f')][_0x72f3('0x9f')]]);}else if(_0x8f14f1[_0x72f3('0x5f')][_0x72f3('0xf0')]){_0x40f2a4=util[_0x72f3('0xab')](_0x72f3('0xac'),_0x8f14f1['body'][_0x72f3('0xf0')]);}else{_0x40f2a4=util[_0x72f3('0xab')](_0x72f3('0xac'),_0x1f1b90['name']);}socket['to'](util[_0x72f3('0xab')](_0x72f3('0xf1'),_0x1f1b90[_0x72f3('0x38')]))['emit'](_0x72f3('0xf2'),{'user':{'id':_0x1f1b90['id'],'name':_0x1f1b90[_0x72f3('0x38')]},'ip':_0x8f14f1[_0x72f3('0xf3')][_0x72f3('0xf4')]||_0x8f14f1[_0x72f3('0xf5')][_0x72f3('0xf6')]||_0x8f14f1['socket'][_0x72f3('0xf6')]||_0x8f14f1[_0x72f3('0xf5')][_0x72f3('0xf7')]['remoteAddress']});return db['UserVoiceQueueRt'][_0x72f3('0x3a')]({'where':{'membername':_0x1f1b90[_0x72f3('0x38')]},'individualHooks':!![]});}}else{throw new db[(_0x72f3('0x93'))][(_0x72f3('0x94'))](_0x72f3('0xf8'));}})[_0x72f3('0x1f')](function(){if(_0x1f1b90){return _0x1f1b90[_0x72f3('0xf9')]({'raw':!![]});}})[_0x72f3('0x1f')](function(_0x28ed42){if(_0x1f1b90){if(_0x28ed42){_0x3d2dfb=_0x28ed42;if(_0x3d2dfb['length']){var _0x4fffaf=_0x3d2dfb['map'](function(_0x3841d8){var _0x16b2e4={'membername':_0x1f1b90['name'],'UserId':_0x1f1b90['id'],'queue_name':_0x3841d8['name'],'VoiceQueueId':_0x3841d8['id'],'interface':_0x40f2a4,'paused':_0x1f1b90[_0x72f3('0x9d')]||![],'penalty':_0x3841d8['UserVoiceQueue.penalty']||0x0};return db[_0x72f3('0xb3')]['upsert'](_0x16b2e4);});return Promise[_0x72f3('0x5d')](_0x4fffaf);}}}})['then'](function(){if(_0x1f1b90){return db[_0x72f3('0xfa')][_0x72f3('0x51')]({'where':{'membername':_0x1f1b90[_0x72f3('0x38')],'exitAt':null}});}})[_0x72f3('0x1f')](function(_0x4d585b){if(_0x1f1b90){var _0x53f1cb=[];_0x4d585b[_0x72f3('0xfb')](function(_0x58aafc){_0x53f1cb[_0x72f3('0x50')](_0x58aafc[_0x72f3('0x5e')]({'exitAt':moment()[_0x72f3('0xab')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x72f3('0x5d')](_0x53f1cb);}})[_0x72f3('0x1f')](function(){if(_0x1f1b90){var _0x5244fe=[];var _0x3e0818=[];var _0x51391f=utils[_0x72f3('0xfc')]();var _0x30b510={'membername':_0x1f1b90[_0x72f3('0x38')],'interface':_0x40f2a4,'enterAt':moment()['format'](_0x72f3('0xfd')),'role':_0x1f1b90[_0x72f3('0x29')],'internal':_0x1f1b90['internal']};_0x51391f['forEach'](function(_0x2a23d1){_0x5244fe['push'](_[_0x72f3('0xd9')]({'channel':_0x2a23d1,'type':'LOGIN','data1':_0x8f14f1[_0x72f3('0x5f')][_0x72f3('0xfe')],'data2':_0x40f2a4},_0x30b510));if(_0x1f1b90[_0x72f3('0x9d')]){_0x3e0818[_0x72f3('0x50')](_[_0x72f3('0xd9')]({'channel':_0x2a23d1,'type':_0x72f3('0xff'),'data1':'LOGININPAUSE'},_0x30b510));}});return db[_0x72f3('0xfa')]['bulkCreate'](_0x5244fe[_0x72f3('0x100')](_0x3e0818),{'individualHooks':!![]});}})[_0x72f3('0x1f')](function(){if(_0x1f1b90){return _0x1f1b90[_0x72f3('0x5e')]({'online':!![],'lastLoginAt':moment()['format'](_0x72f3('0xfd')),'voicePause':_0x1f1b90['loginInPause']||![],'mailPause':_0x1f1b90[_0x72f3('0x9d')]||![],'chatPause':_0x1f1b90['loginInPause']||![],'faxPause':_0x1f1b90[_0x72f3('0x9d')]||![],'smsPause':_0x1f1b90[_0x72f3('0x9d')]||![],'openchannelPause':_0x1f1b90[_0x72f3('0x9d')]||![],'whatsappPause':_0x1f1b90[_0x72f3('0x9d')]||![],'pauseType':_0x1f1b90[_0x72f3('0x9d')]?'LOGININPAUSE':null,'interface':_0x40f2a4,'lastPauseAt':moment()[_0x72f3('0xab')](_0x72f3('0xfd'))});}})[_0x72f3('0x1f')](function(_0x4b5aea){if(_0x8f14f1[_0x72f3('0x101')]){return _0x2636a5();}else{return Promise['resolve'](_0x4b5aea)['then'](respondWithResult(_0x284c7c,null));}})['catch'](handleError(_0x284c7c,null));};exports['logout']=function(_0x8e0aaa,_0x48d26e){var _0x206498;return db['User']['find']({'where':{'id':_0x8e0aaa[_0x72f3('0x60')]['id'],'role':_0x72f3('0x2a')},'attributes':['id',_0x72f3('0x38'),_0x72f3('0x29')]})[_0x72f3('0x1f')](handleEntityNotFound(_0x48d26e,null))[_0x72f3('0x1f')](function(_0x4b2eaa){if(_0x4b2eaa){_0x206498=_0x4b2eaa;return db[_0x72f3('0xb3')][_0x72f3('0x3a')]({'where':{'membername':_0x206498[_0x72f3('0x38')]},'individualHooks':!![]});}})[_0x72f3('0x1f')](function(){return db[_0x72f3('0xfa')][_0x72f3('0x51')]({'where':{'membername':_0x206498[_0x72f3('0x38')],'exitAt':null}});})[_0x72f3('0x1f')](function(_0x1eed03){var _0x4edf01=[];_0x1eed03['forEach'](function(_0x5e3ec8){_0x4edf01[_0x72f3('0x50')](_0x5e3ec8[_0x72f3('0x5e')]({'exitAt':moment()[_0x72f3('0xab')](_0x72f3('0xfd'))}));});return Promise[_0x72f3('0x5d')](_0x4edf01);})[_0x72f3('0x1f')](function(){return _0x206498[_0x72f3('0x5e')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x72f3('0x1f')](respondWithResult(_0x48d26e,null))[_0x72f3('0x28')](handleError(_0x48d26e,null));};exports[_0x72f3('0x102')]=function(_0x1a4d63,_0x198505){var _0x3251ed;return db[_0x72f3('0xb3')][_0x72f3('0x5e')]({'paused':0x1},{'where':{'UserId':_0x1a4d63[_0x72f3('0x60')]['id']},'individualHooks':!![]})[_0x72f3('0x1f')](function(){return db[_0x72f3('0x3d')]['find']({'where':{'id':_0x1a4d63[_0x72f3('0x60')]['id'],'role':_0x72f3('0x2a')},'attributes':['id',_0x72f3('0x38'),_0x72f3('0x29'),'internal',_0x72f3('0x9f'),_0x72f3('0xaa')]});})['then'](handleEntityNotFound(_0x198505,null))['then'](function(_0x55cc5f){if(_0x55cc5f){_0x3251ed=_0x55cc5f;return respondWithRpcPromise(_0x72f3('0x103'),_0x72f3('0x102'),{'id':_0x3251ed['id'],'name':_0x3251ed[_0x72f3('0x38')],'pause':!![]});}})[_0x72f3('0x1f')](function(){if(_0x3251ed){return db['MemberReport'][_0x72f3('0x51')]({'where':{'membername':_0x3251ed['name'],'type':_0x72f3('0xff'),'exitAt':null}});}})[_0x72f3('0x1f')](function(_0x37c6d5){if(_0x37c6d5[_0x72f3('0x6f')]){var _0x5ca8ab=moment()[_0x72f3('0xab')](_0x72f3('0xfd'));for(var _0x447df7=0x0,_0x149525=_0x37c6d5['length'];_0x447df7<_0x149525;_0x447df7++){_0x37c6d5[_0x447df7][_0x72f3('0x104')]({'exitAt':_0x5ca8ab});}}})[_0x72f3('0x1f')](function(){var _0x265cd8=[];var _0x38fda6=utils[_0x72f3('0xfc')]();_0x38fda6[_0x72f3('0xfb')](function(_0x3e5a07){_0x265cd8[_0x72f3('0x50')]({'channel':_0x3e5a07,'membername':_0x3251ed[_0x72f3('0x38')],'interface':_['isNil'](_0x3251ed[_0x72f3('0x9f')])?util[_0x72f3('0xab')](_0x72f3('0xac'),_0x3251ed[_0x72f3('0x38')]):_0x3251ed[_0x72f3('0x9f')],'type':_0x72f3('0xff'),'enterAt':moment()[_0x72f3('0xab')](_0x72f3('0xfd')),'data1':_0x1a4d63[_0x72f3('0x5f')][_0x72f3('0x40')]||'DEFAULT\x20PAUSE','role':_0x3251ed[_0x72f3('0x29')],'internal':_0x3251ed[_0x72f3('0x65')]});});return db['MemberReport'][_0x72f3('0x87')](_0x265cd8,{'individualHooks':!![]});})['then'](function(){return _0x3251ed[_0x72f3('0x5e')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x1a4d63[_0x72f3('0x5f')][_0x72f3('0x40')]||_0x72f3('0x105'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x72f3('0x1f')](respondWithResult(_0x198505,null))[_0x72f3('0x28')](handleError(_0x198505,null));};exports[_0x72f3('0x106')]=function(_0x55e44e,_0xc21a8f){if(_0x55e44e[_0x72f3('0x5f')][_0x72f3('0x9c')]&&!utils['isValidChannel'](_0x55e44e[_0x72f3('0x5f')]['channel'])){throw new APIBadRequestError(util[_0x72f3('0xab')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x55e44e[_0x72f3('0x5f')][_0x72f3('0x9c')]));}return db['User']['find']({'where':{'id':_0x55e44e[_0x72f3('0x60')]['id']},'attributes':['id',_0x72f3('0x38'),'role','internal',_0x72f3('0x9f'),_0x72f3('0xaa'),_0x72f3('0x9e'),'mailPause',_0x72f3('0x107'),_0x72f3('0x108'),'openchannelPause',_0x72f3('0x109'),'whatsappPause',_0x72f3('0x10a'),_0x72f3('0x10b')]})[_0x72f3('0x1f')](function(_0x51a994){if(!_0x51a994){throw new APINotFoundError(util[_0x72f3('0xab')]('User\x20with\x20id\x20%s\x20not\x20found',_0x55e44e[_0x72f3('0x60')]['id']));}return _0x51a994['unpause'](_0x55e44e['body'][_0x72f3('0x9c')]);})[_0x72f3('0x1f')](respondWithResult(_0xc21a8f,null))['catch'](APIHandleError(_0xc21a8f));};exports['getTeams']=function(_0x4f746b,_0x19b070){var _0x1a1f93={};var _0x1ec90d={};var _0x511c35;var _0x226433;return db['User'][_0x72f3('0x97')]({'where':{'id':_0x4f746b['params']['id']}})[_0x72f3('0x1f')](handleEntityNotFound(_0x19b070,null))['then'](function(_0x3e4d56){if(_0x3e4d56){_0x511c35=_0x3e4d56;_0x1ec90d[_0x72f3('0xd0')]=_[_0x72f3('0xd1')](db['Team'][_0x72f3('0x3e')]);_0x1ec90d[_0x72f3('0x4b')]=_[_0x72f3('0xd1')](_0x4f746b[_0x72f3('0x4b')]);_0x1ec90d[_0x72f3('0xd3')]=_[_0x72f3('0xd4')](_0x1ec90d[_0x72f3('0xd0')],_0x1ec90d['query']);_0x1a1f93[_0x72f3('0x4f')]=_[_0x72f3('0xd4')](_0x1ec90d['model'],qs[_0x72f3('0xd5')](_0x4f746b[_0x72f3('0x4b')][_0x72f3('0xd5')]));_0x1a1f93[_0x72f3('0x4f')]=_0x1a1f93[_0x72f3('0x4f')][_0x72f3('0x6f')]?_0x1a1f93[_0x72f3('0x4f')]:_0x1ec90d[_0x72f3('0xd0')];_0x1a1f93[_0x72f3('0xd6')]=qs[_0x72f3('0xd7')](_0x4f746b[_0x72f3('0x4b')][_0x72f3('0xd7')]);_0x1a1f93[_0x72f3('0x49')]=qs[_0x72f3('0xd3')](_['pick'](_0x4f746b['query'],_0x1ec90d[_0x72f3('0xd3')]));if(_0x4f746b[_0x72f3('0x4b')][_0x72f3('0x32')]){_0x1a1f93['where']=_[_0x72f3('0xd9')](_0x1a1f93[_0x72f3('0x49')],{'$or':_[_0x72f3('0x34')](_0x1a1f93[_0x72f3('0x4f')],function(_0x20f52a){var _0x4a412a={};_0x4a412a[_0x20f52a]={'$like':'%'+_0x4f746b['query']['filter']+'%'};return _0x4a412a;})});}_0x1a1f93=_[_0x72f3('0xd9')]({},_0x1a1f93,_0x4f746b[_0x72f3('0x5b')]);return _0x511c35[_0x72f3('0x10c')](_0x1a1f93);}})['then'](function(_0x4f79cb){if(_0x4f79cb){_0x226433=_0x4f79cb[_0x72f3('0x6f')];if(!_0x4f746b[_0x72f3('0x4b')][_0x72f3('0xca')](_0x72f3('0xdc'))){_0x1a1f93[_0x72f3('0x19')]=qs[_0x72f3('0x19')](_0x4f746b[_0x72f3('0x4b')]['limit']);_0x1a1f93[_0x72f3('0x18')]=qs['offset'](_0x4f746b[_0x72f3('0x4b')][_0x72f3('0x18')]);}return _0x511c35[_0x72f3('0x10c')](_0x1a1f93);}})[_0x72f3('0x1f')](function(_0x2e6862){if(_0x2e6862){return _0x2e6862?{'count':_0x226433,'rows':_0x2e6862}:null;}})[_0x72f3('0x1f')](respondWithResult(_0x19b070,null))[_0x72f3('0x28')](handleError(_0x19b070,null));};exports[_0x72f3('0x10d')]=function(_0x1b6d44,_0xca006b){var _0x3be2f6=_0x1b6d44['params']['id'];var _0x2bb9ee=_0x1b6d44[_0x72f3('0x5f')]?_0x1b6d44['body'][_0x72f3('0x63')]:null;var _0x52a849=[];return Promise[_0x72f3('0x10e')]()[_0x72f3('0x1f')](function(){if(!_0x2bb9ee)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x72f3('0x1f')](function(){return db[_0x72f3('0x3d')][_0x72f3('0x97')]({'where':{'id':_0x3be2f6}});})['then'](function(_0x4b36ba){if(!_0x4b36ba)throw new APINotFoundError(util['format'](_0x72f3('0xc9'),_0x1b6d44[_0x72f3('0x60')]['id']));return db[_0x72f3('0x6c')][_0x72f3('0x10f')](function(_0xf3e421){return _0x4b36ba[_0x72f3('0x10d')](_0x2bb9ee,{'transaction':_0xf3e421})['then'](function(){return db['Team'][_0x72f3('0x51')]({'where':{'id':{'$in':_0x2bb9ee}}});})['then'](function(_0x1b21ab){var _0x1745f5=_[_0x72f3('0x34')](_0x1b21ab,function(_0x371312){return _0x371312[_0x72f3('0x110')]();});return Promise['all'](_0x1745f5);})['then'](function(_0x7511c2){_0x52a849=_[_0x72f3('0x111')](_0x7511c2);var _0x5763b2=_[_0x72f3('0x34')](_0x52a849,function(_0x34ac15){return _0x34ac15[_0x72f3('0x112')](_0x4b36ba['id'],{'transaction':_0xf3e421});});return Promise[_0x72f3('0x5d')](_0x5763b2);})[_0x72f3('0x1f')](function(){if(!_0x4b36ba[_0x72f3('0xaa')])return;var _0x2fad6b=_[_0x72f3('0x32')](_0x52a849,function(_0xfaa50){return _0xfaa50['getDataValue'](_0x72f3('0x9c'))===_0x72f3('0x113');});var _0x179bc5=_['map'](_0x2fad6b,function(_0x19a046){return db[_0x72f3('0xb3')][_0x72f3('0xad')]({'membername':_0x4b36ba[_0x72f3('0x38')],'UserId':_0x4b36ba['id'],'queue_name':_0x19a046[_0x72f3('0x38')],'VoiceQueueId':_0x19a046['id'],'interface':_['isNil'](_0x4b36ba[_0x72f3('0x9f')])?util[_0x72f3('0xab')](_0x72f3('0xac'),_0x4b36ba[_0x72f3('0x38')]):_0x4b36ba[_0x72f3('0x9f')],'paused':_0x4b36ba[_0x72f3('0x9e')]||![],'penalty':_0x4b36ba[_0x72f3('0xa5')]},{'transaction':_0xf3e421});});return Promise['all'](_0x179bc5);})[_0x72f3('0x1f')](function(){return db[_0x72f3('0x114')][_0x72f3('0x51')]({'where':{'teamId':{'$in':_0x2bb9ee}}});})[_0x72f3('0x1f')](function(_0xe967b5){var _0x2a4ee5=_[_0x72f3('0x34')](_0xe967b5,function(_0x4bef43){return db['UserVoicePrefix'][_0x72f3('0x82')]({'UserId':_0x4b36ba['id'],'VoicePrefixId':_0x4bef43['VoicePrefixId']},{'transaction':_0xf3e421});});return Promise[_0x72f3('0x5d')](_0x2a4ee5);});});})[_0x72f3('0x1f')](function(){for(var _0x31f0c9=0x0;_0x31f0c9<_0x52a849['length'];_0x31f0c9++){var _0x3cce1f=_0x52a849[_0x31f0c9][_0x72f3('0x115')](_0x72f3('0x9c'));var _0x3c2b6d=_0x3cce1f+_0x72f3('0xa6');socket[_0x72f3('0x2b')](_0x72f3('0x2e')+_0x3cce1f+_0x72f3('0x116'),{'UserId':_0x3be2f6,['queueField']:_0x52a849[_0x31f0c9]['id']});}})['then'](respondWithStatusCode(_0xca006b,null))[_0x72f3('0x28')](APIHandleError(_0xca006b));};exports[_0x72f3('0x117')]=function(_0x29af75,_0x45ed72){var _0x10d356=_0x29af75[_0x72f3('0x60')]['id'];var _0x16e250=null;if(_0x29af75['query'][_0x72f3('0x63')]){_0x16e250=_['isArray'](_0x29af75['query'][_0x72f3('0x63')])?_0x29af75[_0x72f3('0x4b')][_0x72f3('0x63')]:[_0x29af75[_0x72f3('0x4b')][_0x72f3('0x63')]];}var _0x64ac40=[];return Promise[_0x72f3('0x10e')]()[_0x72f3('0x1f')](function(){if(!_0x16e250)throw new APIBadRequestError(_0x72f3('0x118'));})[_0x72f3('0x1f')](function(){return db['User'][_0x72f3('0x97')]({'where':{'id':_0x10d356}});})[_0x72f3('0x1f')](function(_0x2e2ec7){if(!_0x2e2ec7)throw new APINotFoundError(util[_0x72f3('0xab')](_0x72f3('0xc9'),_0x29af75[_0x72f3('0x60')]['id']));return db[_0x72f3('0x6c')][_0x72f3('0x10f')](function(_0x1946e6){return _0x2e2ec7[_0x72f3('0x117')](_0x16e250,{'transaction':_0x1946e6})[_0x72f3('0x1f')](function(){return db[_0x72f3('0x119')][_0x72f3('0x51')]({'where':{'id':{'$in':_0x16e250}}});})[_0x72f3('0x1f')](function(_0x44b188){var _0x5976c4=_[_0x72f3('0x34')](_0x44b188,function(_0x37411a){return _0x37411a['getAssociatedQueues']();});return Promise[_0x72f3('0x5d')](_0x5976c4);})['then'](function(_0x56fb15){_0x64ac40=_['flattenDeep'](_0x56fb15);var _0x1493aa=_[_0x72f3('0x34')](_0x64ac40,function(_0x5df6a0){return _0x5df6a0[_0x72f3('0x11a')](_0x2e2ec7['id'],{'transaction':_0x1946e6});});return Promise[_0x72f3('0x5d')](_0x1493aa);})[_0x72f3('0x1f')](function(){if(!_0x2e2ec7['online'])return;var _0x1fd662=_[_0x72f3('0x32')](_0x64ac40,function(_0x32547f){return _0x32547f['getDataValue'](_0x72f3('0x9c'))===_0x72f3('0x113');});var _0xe9f245=_[_0x72f3('0x34')](_0x1fd662,function(_0x128fda){return db[_0x72f3('0xb3')][_0x72f3('0x3a')]({'where':{'VoiceQueueId':_0x128fda['id'],'UserId':_0x2e2ec7['id']},'transaction':_0x1946e6});});return Promise[_0x72f3('0x5d')](_0xe9f245);})[_0x72f3('0x1f')](function(){return db[_0x72f3('0x114')][_0x72f3('0x51')]({'where':{'teamId':{'$in':_0x16e250}}});})['then'](function(_0xbefbd9){var _0x57799d=_['map'](_0xbefbd9,function(_0x441e63){return db['UserVoicePrefix'][_0x72f3('0x3a')]({'where':{'UserId':_0x2e2ec7['id'],'VoicePrefixId':_0x441e63[_0x72f3('0x11b')]}},{'transaction':_0x1946e6});});return Promise[_0x72f3('0x5d')](_0x57799d);});});})[_0x72f3('0x1f')](function(){for(var _0xbcac96=0x0;_0xbcac96<_0x64ac40[_0x72f3('0x6f')];_0xbcac96++){var _0x459a74=_0x64ac40[_0xbcac96][_0x72f3('0x115')]('channel');var _0x227d8b=_0x459a74+'QueueId';socket[_0x72f3('0x2b')](_0x72f3('0x2e')+_0x459a74+_0x72f3('0xb2'),{'UserId':_0x10d356,['queueField']:_0x64ac40[_0xbcac96]['id']});}})[_0x72f3('0x1f')](respondWithStatusCode(_0x45ed72,null))[_0x72f3('0x28')](APIHandleError(_0x45ed72));};exports['getLists']=function(_0x31074b,_0x551328){var _0x3ee82b={};var _0x4cb3bd={};var _0x8d2e2c;var _0x412f9a;return db[_0x72f3('0x3d')][_0x72f3('0x97')]({'where':{'id':_0x31074b[_0x72f3('0x60')]['id']}})[_0x72f3('0x1f')](handleEntityNotFound(_0x551328,null))[_0x72f3('0x1f')](function(_0x52b08e){if(_0x52b08e){_0x8d2e2c=_0x52b08e;_0x4cb3bd[_0x72f3('0xd0')]=_[_0x72f3('0xd1')](db['CmList'][_0x72f3('0x3e')]);_0x4cb3bd[_0x72f3('0x4b')]=_[_0x72f3('0xd1')](_0x31074b[_0x72f3('0x4b')]);_0x4cb3bd[_0x72f3('0xd3')]=_[_0x72f3('0xd4')](_0x4cb3bd[_0x72f3('0xd0')],_0x4cb3bd['query']);_0x3ee82b[_0x72f3('0x4f')]=_[_0x72f3('0xd4')](_0x4cb3bd['model'],qs[_0x72f3('0xd5')](_0x31074b[_0x72f3('0x4b')][_0x72f3('0xd5')]));_0x3ee82b[_0x72f3('0x4f')]=_0x3ee82b[_0x72f3('0x4f')][_0x72f3('0x6f')]?_0x3ee82b[_0x72f3('0x4f')]:_0x4cb3bd[_0x72f3('0xd0')];_0x3ee82b[_0x72f3('0xd6')]=qs[_0x72f3('0xd7')](_0x31074b[_0x72f3('0x4b')][_0x72f3('0xd7')]);_0x3ee82b[_0x72f3('0x49')]=qs[_0x72f3('0xd3')](_[_0x72f3('0xd8')](_0x31074b[_0x72f3('0x4b')],_0x4cb3bd['filters']));if(_0x31074b['query'][_0x72f3('0x32')]){_0x3ee82b[_0x72f3('0x49')]=_[_0x72f3('0xd9')](_0x3ee82b[_0x72f3('0x49')],{'$or':_[_0x72f3('0x34')](_0x3ee82b[_0x72f3('0x4f')],function(_0x5753de){var _0x5acee1={};_0x5acee1[_0x5753de]={'$like':'%'+_0x31074b['query']['filter']+'%'};return _0x5acee1;})});}_0x3ee82b=_['merge']({},_0x3ee82b,_0x31074b[_0x72f3('0x5b')]);return _0x8d2e2c['getLists'](_0x3ee82b);}})[_0x72f3('0x1f')](function(_0x31554a){if(_0x31554a){_0x412f9a=_0x31554a[_0x72f3('0x6f')];if(!_0x31074b[_0x72f3('0x4b')][_0x72f3('0xca')](_0x72f3('0xdc'))){_0x3ee82b[_0x72f3('0x19')]=qs['limit'](_0x31074b[_0x72f3('0x4b')]['limit']);_0x3ee82b[_0x72f3('0x18')]=qs[_0x72f3('0x18')](_0x31074b[_0x72f3('0x4b')][_0x72f3('0x18')]);}return _0x8d2e2c[_0x72f3('0x11c')](_0x3ee82b);}})[_0x72f3('0x1f')](function(_0x529f0d){if(_0x529f0d){return _0x529f0d?{'count':_0x412f9a,'rows':_0x529f0d}:null;}})[_0x72f3('0x1f')](respondWithResult(_0x551328,null))[_0x72f3('0x28')](handleError(_0x551328,null));};exports[_0x72f3('0x11d')]=function(_0x1c08ae,_0x38b3ce){var _0x2684d2={};var _0x59c855={};var _0x1fff47;return db[_0x72f3('0x3d')][_0x72f3('0x97')]({'where':{'id':_0x1c08ae['params']['id']}})[_0x72f3('0x1f')](handleEntityNotFound(_0x38b3ce,null))[_0x72f3('0x1f')](function(_0x4c2df0){if(_0x4c2df0){_0x1fff47=_0x4c2df0;_0x59c855[_0x72f3('0xd0')]=_[_0x72f3('0xd1')](db[_0x72f3('0x3d')]['rawAttributes']);_0x59c855[_0x72f3('0x4b')]=_[_0x72f3('0xd1')](_0x1c08ae[_0x72f3('0x4b')]);_0x59c855['filters']=_[_0x72f3('0xd4')](_0x59c855[_0x72f3('0xd0')],_0x59c855[_0x72f3('0x4b')]);_0x2684d2[_0x72f3('0x4f')]=_[_0x72f3('0xd4')](_0x59c855[_0x72f3('0xd0')],qs['fields'](_0x1c08ae['query'][_0x72f3('0xd5')]));_0x2684d2[_0x72f3('0x4f')]=_0x2684d2['attributes'][_0x72f3('0x6f')]?_0x2684d2['attributes']:_0x59c855[_0x72f3('0xd0')];_0x2684d2['order']=qs['sort'](_0x1c08ae[_0x72f3('0x4b')][_0x72f3('0xd7')]);_0x2684d2[_0x72f3('0x49')]=qs['filters'](_[_0x72f3('0xd8')](_0x1c08ae[_0x72f3('0x4b')],_0x59c855['filters']));if(_0x1c08ae['query'][_0x72f3('0x32')]){_0x2684d2['where']=_[_0x72f3('0xd9')](_0x2684d2[_0x72f3('0x49')],{'$or':_[_0x72f3('0x34')](_0x2684d2['attributes'],function(_0x4b09af){var _0x3aca63={};_0x3aca63[_0x4b09af]={'$like':'%'+_0x1c08ae[_0x72f3('0x4b')]['filter']+'%'};return _0x3aca63;})});}_0x2684d2[_0x72f3('0xd0')]=db['User'];_0x2684d2['as']=_0x72f3('0x2f');_0x2684d2=_['merge']({},_0x2684d2,_0x1c08ae[_0x72f3('0x5b')]);return _0x1fff47['getVoiceQueues']({'include':[_0x2684d2]});}})[_0x72f3('0x1f')](function(_0x7ccbb0){if(_0x7ccbb0){var _0x243ea8={},_0x1b098e=[];for(var _0x229c6c=0x0;_0x229c6c<_0x7ccbb0[_0x72f3('0x6f')];_0x229c6c+=0x1){for(var _0x5cc6af=0x0,_0x4f5019;_0x5cc6af<_0x7ccbb0[_0x229c6c]['Agents'][_0x72f3('0x6f')];_0x5cc6af+=0x1){_0x4f5019=_0x7ccbb0[_0x229c6c][_0x72f3('0x2f')][_0x5cc6af][_0x72f3('0xa8')]({'plain':!![]});_0x243ea8[_0x4f5019['id']]=_0x4f5019;}}_0x243ea8=_['values'](_0x243ea8);for(var _0x1bb00a=qs[_0x72f3('0x18')](_0x1c08ae[_0x72f3('0x4b')]['offset']);_0x1bb00a<_0x243ea8['length']&&_0x1b098e[_0x72f3('0x6f')]=_0x142152[_0xc6e1('0x51')]){throw new Error(_0xc6e1('0x52'));}})[_0xc6e1('0x17')](function(){if(_0x312057){return db[_0xc6e1('0x27')][_0xc6e1('0x47')]({'where':{'membername':_0x312057['name']},'individualHooks':!![]});}})[_0xc6e1('0x17')](function(){if(_0x312057){return _0x312057[_0xc6e1('0x53')]({'raw':!![]});}})[_0xc6e1('0x17')](function(_0x126cf2){if(_0x312057){if(_0x126cf2){var _0x481900=[];_0x4ec3d8=_0x126cf2;if(_0x4ec3d8[_0xc6e1('0x2b')]){for(var _0x515886=0x0;_0x515886<_0x4ec3d8[_0xc6e1('0x2b')];_0x515886++){_0x481900[_0xc6e1('0x2e')](db[_0xc6e1('0x27')][_0xc6e1('0x54')]({'membername':_0x312057[_0xc6e1('0x21')],'UserId':_0x312057['id'],'queue_name':_0x4ec3d8[_0x515886][_0xc6e1('0x21')],'VoiceQueueId':_0x4ec3d8[_0x515886]['id'],'interface':_0x50f24a,'paused':_0x312057[_0xc6e1('0x4c')]||![],'penalty':_0x4ec3d8[_0x515886][_0xc6e1('0x55')]||0x0}));}return BPromise[_0xc6e1('0x48')](_0x481900);}}}})['then'](function(){if(_0x312057){return db[_0xc6e1('0x29')]['findAll']({'where':{'membername':_0x312057[_0xc6e1('0x21')],'exitAt':null}});}})['then'](function(_0x1848a2){if(_0x312057){if(_0x1848a2&&_0x1848a2[_0xc6e1('0x2b')]){var _0x389fc3=[];_0x1848a2[_0xc6e1('0x2d')](function(_0x29019e){_0x389fc3['push'](_0x29019e[_0xc6e1('0x28')]({'exitAt':moment()[_0xc6e1('0x24')](_0xc6e1('0x2c'))}));});return BPromise[_0xc6e1('0x48')](_0x389fc3);}}})[_0xc6e1('0x17')](function(){if(_0x312057){var _0x15587e=[];var _0x63e06b=[];var _0x1caf93=utils['getChannels']();var _0x4708c1={'membername':_0x312057[_0xc6e1('0x21')],'interface':_0x50f24a,'enterAt':moment()[_0xc6e1('0x24')](_0xc6e1('0x2c')),'role':_0x312057[_0xc6e1('0x3c')],'internal':_0x312057[_0xc6e1('0x22')]};_0x1caf93[_0xc6e1('0x2d')](function(_0x1c6ac1){_0x15587e['push'](_[_0xc6e1('0x56')]({'channel':_0x1c6ac1,'type':_0xc6e1('0x57'),'data1':_0xc6e1('0x58'),'data2':_0x50f24a},_0x4708c1));if(_0x312057[_0xc6e1('0x4c')]){_0x63e06b[_0xc6e1('0x2e')](_[_0xc6e1('0x56')]({'channel':_0x1c6ac1,'type':_0xc6e1('0x30'),'data1':'LOGININPAUSE'},_0x4708c1));}});return db[_0xc6e1('0x29')][_0xc6e1('0x34')](_0x15587e[_0xc6e1('0x59')](_0x63e06b),{'individualHooks':!![]});}})['then'](function(){if(_0x312057){return _0x312057['update']({'online':!![],'lastLoginAt':moment()[_0xc6e1('0x24')](_0xc6e1('0x2c')),'voicePause':_0x312057[_0xc6e1('0x4c')]||![],'mailPause':_0x312057[_0xc6e1('0x4c')]||![],'chatPause':_0x312057[_0xc6e1('0x4c')]||![],'faxPause':_0x312057[_0xc6e1('0x4c')]||![],'smsPause':_0x312057[_0xc6e1('0x4c')]||![],'openchannelPause':_0x312057[_0xc6e1('0x4c')]||![],'pauseType':_0x312057[_0xc6e1('0x4c')]?_0xc6e1('0x5a'):null,'lastPauseAt':moment()[_0xc6e1('0x24')](_0xc6e1('0x2c')),'interface':_0x50f24a});}})[_0xc6e1('0x17')](function(_0x4fe500){_0x357094(_0x4fe500);})['catch'](function(_0xf5fd7c){_0x55d6b6(_0x1ccb5c['error'](0x1f4,_0xf5fd7c[_0xc6e1('0x1d')]));});});}; \ No newline at end of file +var _0x5c2a=['pauseType','lastPauseAt','system','findOne','destroy','push','all','LoginUser','mobile','loginInPause','count','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','length','UserVoiceQueue.penalty','findAll','merge','callysquare','LOGININPAUSE','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','redis','defaults','socket.io-emitter','register','GetUser','User','options','raw','where','attributes','limit','include','map','model','debug','stringify','catch','message','error','ShowUser','info','name','role','then','User\x20with\x20id\x20%s\x20not\x20found','params','UserVoiceQueueRt','update','PAUSE','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','interface','body','type','DEFAULT\x20PAUSE','internal','uniqueid','MemberReport','bulkCreate','UnpauseUser','resolve','channel','Channel\x20parameter\x20%s\x20is\x20invalid','online','voicePause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsappPause'];(function(_0x46cdff,_0x1a7498){var _0xb9bcf4=function(_0x3d5039){while(--_0x3d5039){_0x46cdff['push'](_0x46cdff['shift']());}};_0xb9bcf4(++_0x1a7498);}(_0x5c2a,0x108));var _0xa5c2=function(_0x149083,_0x4047b6){_0x149083=_0x149083-0x0;var _0x4dc74e=_0x5c2a[_0x149083];return _0x4dc74e;};'use strict';var _=require(_0xa5c2('0x0'));var util=require(_0xa5c2('0x1'));var moment=require(_0xa5c2('0x2'));var BPromise=require(_0xa5c2('0x3'));var Redis=require('ioredis');var db=require(_0xa5c2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa5c2('0x5'))('rpc');var config=require('../../config/environment');config[_0xa5c2('0x6')]=_[_0xa5c2('0x7')](config[_0xa5c2('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0xa5c2('0x8'))(new Redis(config[_0xa5c2('0x6')]));require('./user.socket')[_0xa5c2('0x9')](socket);exports[_0xa5c2('0xa')]=function(_0x750151){var _0x55d9a8=this;return new Promise(function(_0x11038b,_0x4a577f){return db[_0xa5c2('0xb')]['findAll']({'raw':_0x750151[_0xa5c2('0xc')]?_0x750151['options'][_0xa5c2('0xd')]===undefined?!![]:![]:!![],'where':_0x750151[_0xa5c2('0xc')]?_0x750151[_0xa5c2('0xc')][_0xa5c2('0xe')]||null:null,'attributes':_0x750151[_0xa5c2('0xc')]?_0x750151[_0xa5c2('0xc')][_0xa5c2('0xf')]||null:null,'limit':_0x750151[_0xa5c2('0xc')]?_0x750151[_0xa5c2('0xc')][_0xa5c2('0x10')]||null:null,'include':_0x750151[_0xa5c2('0xc')]?_0x750151[_0xa5c2('0xc')][_0xa5c2('0x11')]?_[_0xa5c2('0x12')](_0x750151['options'][_0xa5c2('0x11')],function(_0x3e2c10){return{'model':db[_0x3e2c10[_0xa5c2('0x13')]],'as':_0x3e2c10['as'],'attributes':_0x3e2c10[_0xa5c2('0xf')],'include':_0x3e2c10['include']?_[_0xa5c2('0x12')](_0x3e2c10[_0xa5c2('0x11')],function(_0x378137){return{'model':db[_0x378137[_0xa5c2('0x13')]],'as':_0x378137['as'],'attributes':_0x378137[_0xa5c2('0xf')],'include':_0x378137[_0xa5c2('0x11')]?_[_0xa5c2('0x12')](_0x378137['include'],function(_0x571ecd){return{'model':db[_0x571ecd[_0xa5c2('0x13')]],'as':_0x571ecd['as'],'attributes':_0x571ecd['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x965f50){logger['info']('GetUser',_0x750151);logger[_0xa5c2('0x14')](_0xa5c2('0xa'),_0x750151,JSON[_0xa5c2('0x15')](_0x965f50));_0x11038b(_0x965f50);})[_0xa5c2('0x16')](function(_0x44daf6){logger['error'](_0xa5c2('0xa'),_0x44daf6[_0xa5c2('0x17')],_0x750151);_0x4a577f(_0x55d9a8[_0xa5c2('0x18')](0x1f4,_0x44daf6[_0xa5c2('0x17')]));});});};exports[_0xa5c2('0x19')]=function(_0x1d2311){var _0x901c2=this;return new Promise(function(_0x589f43,_0x33328f){return db['User']['find']({'raw':_0x1d2311[_0xa5c2('0xc')]?_0x1d2311['options'][_0xa5c2('0xd')]===undefined?!![]:![]:!![],'where':_0x1d2311['options']?_0x1d2311[_0xa5c2('0xc')][_0xa5c2('0xe')]||null:null,'attributes':_0x1d2311[_0xa5c2('0xc')]?_0x1d2311[_0xa5c2('0xc')][_0xa5c2('0xf')]||null:null,'include':_0x1d2311[_0xa5c2('0xc')]?_0x1d2311[_0xa5c2('0xc')][_0xa5c2('0x11')]?_[_0xa5c2('0x12')](_0x1d2311[_0xa5c2('0xc')][_0xa5c2('0x11')],function(_0x1bc7f0){return{'model':db[_0x1bc7f0[_0xa5c2('0x13')]],'as':_0x1bc7f0['as'],'attributes':_0x1bc7f0[_0xa5c2('0xf')],'include':_0x1bc7f0[_0xa5c2('0x11')]?_['map'](_0x1bc7f0[_0xa5c2('0x11')],function(_0x498dde){return{'model':db[_0x498dde[_0xa5c2('0x13')]],'as':_0x498dde['as'],'attributes':_0x498dde['attributes'],'include':_0x498dde['include']?_[_0xa5c2('0x12')](_0x498dde[_0xa5c2('0x11')],function(_0x468987){return{'model':db[_0x468987['model']],'as':_0x468987['as'],'attributes':_0x468987['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c0604){logger[_0xa5c2('0x1a')](_0xa5c2('0x19'),_0x1d2311);logger[_0xa5c2('0x14')](_0xa5c2('0x19'),_0x1d2311,JSON[_0xa5c2('0x15')](_0x4c0604));_0x589f43(_0x4c0604);})['catch'](function(_0x22e4e6){logger[_0xa5c2('0x18')]('ShowUser',_0x22e4e6['message'],_0x1d2311);_0x33328f(_0x901c2[_0xa5c2('0x18')](0x1f4,_0x22e4e6['message']));});});};exports['PauseUser']=function(_0x9f76d9){var _0x3b3980;return db[_0xa5c2('0xb')]['find']({'where':_0x9f76d9[_0xa5c2('0xc')][_0xa5c2('0xe')]||{},'attributes':['id',_0xa5c2('0x1b'),_0xa5c2('0x1c'),'internal','interface']})[_0xa5c2('0x1d')](function(_0x1dbf16){if(!_0x1dbf16){throw new Error(util['format'](_0xa5c2('0x1e'),_0x9f76d9[_0xa5c2('0x1f')]['id']));}_0x3b3980=_0x1dbf16;return db[_0xa5c2('0x20')][_0xa5c2('0x21')]({'paused':0x1},{'where':{'UserId':_0x3b3980['id']},'individualHooks':!![]});})[_0xa5c2('0x1d')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x3b3980[_0xa5c2('0x1b')],'type':_0xa5c2('0x22'),'exitAt':null}});})[_0xa5c2('0x1d')](function(_0x1dcab1){if(_0x1dcab1&&_0x1dcab1['length']){var _0x2518f3=moment()[_0xa5c2('0x23')](_0xa5c2('0x24'));for(var _0x11b72a=0x0,_0x2467c5=_0x1dcab1['length'];_0x11b72a<_0x2467c5;_0x11b72a++){_0x1dcab1[_0x11b72a][_0xa5c2('0x25')]({'exitAt':_0x2518f3});}}})[_0xa5c2('0x1d')](function(){var _0x58cf79=[];var _0x3be424=utils[_0xa5c2('0x26')]();_0x3be424[_0xa5c2('0x27')](function(_0x3df925){_0x58cf79['push']({'channel':_0x3df925,'membername':_0x3b3980[_0xa5c2('0x1b')],'interface':_['isNil'](_0x3b3980['interface'])?util[_0xa5c2('0x23')]('SIP/%s',_0x3b3980['name']):_0x3b3980[_0xa5c2('0x28')],'type':'PAUSE','enterAt':moment()[_0xa5c2('0x23')](_0xa5c2('0x24')),'data1':_0x9f76d9[_0xa5c2('0x29')][_0xa5c2('0x2a')]||_0xa5c2('0x2b'),'role':_0x3b3980[_0xa5c2('0x1c')],'internal':_0x3b3980[_0xa5c2('0x2c')],'uniqueid':_0x9f76d9['body'][_0xa5c2('0x2d')]||null});});return db[_0xa5c2('0x2e')][_0xa5c2('0x2f')](_0x58cf79,{'individualHooks':!![]});})[_0xa5c2('0x1d')](function(){return _0x3b3980[_0xa5c2('0x21')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x9f76d9[_0xa5c2('0x29')][_0xa5c2('0x2a')]||_0xa5c2('0x2b'),'lastPauseAt':moment()[_0xa5c2('0x23')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xa5c2('0x16')](function(_0x134d06){throw _0x134d06;});};exports[_0xa5c2('0x30')]=function(_0xa5b49c){return Promise[_0xa5c2('0x31')]()['then'](function(){if(_0xa5b49c['body'][_0xa5c2('0x32')]&&!utils['isValidChannel'](_0xa5b49c[_0xa5c2('0x29')][_0xa5c2('0x32')])){throw new Error(util[_0xa5c2('0x23')](_0xa5c2('0x33'),_0xa5b49c[_0xa5c2('0x29')]['channel']));}return db[_0xa5c2('0xb')]['findOne']({'where':_0xa5b49c[_0xa5c2('0xc')][_0xa5c2('0xe')]||{},'attributes':['id',_0xa5c2('0x1b'),_0xa5c2('0x1c'),'internal',_0xa5c2('0x28'),_0xa5c2('0x34'),_0xa5c2('0x35'),_0xa5c2('0x36'),_0xa5c2('0x37'),_0xa5c2('0x38'),_0xa5c2('0x39'),_0xa5c2('0x3a'),_0xa5c2('0x3b'),_0xa5c2('0x3c'),_0xa5c2('0x3d')]});})['then'](function(_0x7a3ca0){if(!_0x7a3ca0){throw new Error(util[_0xa5c2('0x23')](_0xa5c2('0x1e'),_0xa5b49c['params']['id']));}return _0x7a3ca0['unpause'](_0xa5b49c[_0xa5c2('0x29')][_0xa5c2('0x32')],_0xa5c2('0x3e'));})[_0xa5c2('0x16')](function(_0x36ab91){throw _0x36ab91;});};exports['LogoutUser']=function(_0x171bb3){var _0x557566=this;return new Promise(function(_0x5a9aff,_0x436b2c){var _0x4c7779;return db[_0xa5c2('0xb')][_0xa5c2('0x3f')]({'where':_0x171bb3[_0xa5c2('0xc')][_0xa5c2('0xe')]||{},'attributes':['id','name']})['then'](function(_0x5597cd){if(_0x5597cd){_0x4c7779=_0x5597cd;return db[_0xa5c2('0x20')][_0xa5c2('0x40')]({'where':{'membername':_0x4c7779[_0xa5c2('0x1b')]},'individualHooks':!![]});}})[_0xa5c2('0x1d')](function(){if(_0x4c7779){return db['MemberReport']['findAll']({'where':{'membername':_0x4c7779['name'],'exitAt':null}});}})[_0xa5c2('0x1d')](function(_0x1783b6){if(_0x4c7779){if(_0x1783b6&&_0x1783b6['length']){var _0xde1672=[];_0x1783b6['forEach'](function(_0x124e0f){_0xde1672[_0xa5c2('0x41')](_0x124e0f[_0xa5c2('0x21')]({'exitAt':moment()['format'](_0xa5c2('0x24'))}));});return BPromise[_0xa5c2('0x42')](_0xde1672);}}})[_0xa5c2('0x1d')](function(){if(_0x4c7779){return _0x4c7779[_0xa5c2('0x21')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xa5c2('0x1d')](function(_0xf210b8){_0x5a9aff(_0xf210b8);})[_0xa5c2('0x16')](function(_0x1b3efa){_0x436b2c(_0x557566['error'](0x1f4,_0x1b3efa[_0xa5c2('0x17')]));});});};exports[_0xa5c2('0x43')]=function(_0x12b8d3){var _0x22fbc6=this;return new Promise(function(_0x58cfbe,_0x25c4ce){var _0x18676b;var _0x2e9732;var _0x49bd76;var _0x37b041;return db[_0xa5c2('0xb')]['findOne']({'where':_0x12b8d3[_0xa5c2('0xc')]['where']||{},'attributes':['id',_0xa5c2('0x1b'),'role',_0xa5c2('0x44'),'phone',_0xa5c2('0x2c'),_0xa5c2('0x45'),_0xa5c2('0x28')]})['then'](function(_0x4fc317){if(_0x4fc317){_0x18676b=_0x4fc317;_0x37b041=_0x12b8d3['body']['interface']?_0x12b8d3[_0xa5c2('0x29')][_0xa5c2('0x28')]:util[_0xa5c2('0x23')]('SIP/%s',_0x18676b[_0xa5c2('0x1b')]);return db[_0xa5c2('0xb')][_0xa5c2('0x46')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x18676b['id']}}});}})['then'](function(_0x58d28a){if(_0x58d28a){_0x49bd76=_0x58d28a;return require('../../config/license/util')[_0xa5c2('0x47')]();}})[_0xa5c2('0x1d')](function(_0x5f4fec){if(_0x5f4fec&&_0x5f4fec['agents']&&_0x49bd76>=_0x5f4fec[_0xa5c2('0x48')]){throw new Error(_0xa5c2('0x49'));}})[_0xa5c2('0x1d')](function(){if(_0x18676b){return db[_0xa5c2('0x20')][_0xa5c2('0x40')]({'where':{'membername':_0x18676b['name']},'individualHooks':!![]});}})[_0xa5c2('0x1d')](function(){if(_0x18676b){return _0x18676b[_0xa5c2('0x4a')]({'raw':!![]});}})[_0xa5c2('0x1d')](function(_0x486132){if(_0x18676b){if(_0x486132){var _0x392833=[];_0x2e9732=_0x486132;if(_0x2e9732[_0xa5c2('0x4b')]){for(var _0x45013a=0x0;_0x45013a<_0x2e9732[_0xa5c2('0x4b')];_0x45013a++){_0x392833['push'](db[_0xa5c2('0x20')]['upsert']({'membername':_0x18676b['name'],'UserId':_0x18676b['id'],'queue_name':_0x2e9732[_0x45013a][_0xa5c2('0x1b')],'VoiceQueueId':_0x2e9732[_0x45013a]['id'],'interface':_0x37b041,'paused':_0x18676b[_0xa5c2('0x45')]||![],'penalty':_0x2e9732[_0x45013a][_0xa5c2('0x4c')]||0x0}));}return BPromise[_0xa5c2('0x42')](_0x392833);}}}})['then'](function(){if(_0x18676b){return db[_0xa5c2('0x2e')][_0xa5c2('0x4d')]({'where':{'membername':_0x18676b[_0xa5c2('0x1b')],'exitAt':null}});}})[_0xa5c2('0x1d')](function(_0xbba445){if(_0x18676b){if(_0xbba445&&_0xbba445[_0xa5c2('0x4b')]){var _0x158b65=[];_0xbba445['forEach'](function(_0x3b78c9){_0x158b65['push'](_0x3b78c9['update']({'exitAt':moment()[_0xa5c2('0x23')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xa5c2('0x42')](_0x158b65);}}})['then'](function(){if(_0x18676b){var _0x32b35b=[];var _0x2f77a6=[];var _0x227e3d=utils[_0xa5c2('0x26')]();var _0xbfab0f={'membername':_0x18676b[_0xa5c2('0x1b')],'interface':_0x37b041,'enterAt':moment()['format'](_0xa5c2('0x24')),'role':_0x18676b['role'],'internal':_0x18676b[_0xa5c2('0x2c')]};_0x227e3d[_0xa5c2('0x27')](function(_0x448bad){_0x32b35b[_0xa5c2('0x41')](_[_0xa5c2('0x4e')]({'channel':_0x448bad,'type':'LOGIN','data1':_0xa5c2('0x4f'),'data2':_0x37b041},_0xbfab0f));if(_0x18676b[_0xa5c2('0x45')]){_0x2f77a6[_0xa5c2('0x41')](_[_0xa5c2('0x4e')]({'channel':_0x448bad,'type':'PAUSE','data1':_0xa5c2('0x50')},_0xbfab0f));}});return db[_0xa5c2('0x2e')][_0xa5c2('0x2f')](_0x32b35b['concat'](_0x2f77a6),{'individualHooks':!![]});}})[_0xa5c2('0x1d')](function(){if(_0x18676b){return _0x18676b[_0xa5c2('0x21')]({'online':!![],'lastLoginAt':moment()['format'](_0xa5c2('0x24')),'voicePause':_0x18676b[_0xa5c2('0x45')]||![],'mailPause':_0x18676b[_0xa5c2('0x45')]||![],'chatPause':_0x18676b['loginInPause']||![],'faxPause':_0x18676b[_0xa5c2('0x45')]||![],'smsPause':_0x18676b['loginInPause']||![],'openchannelPause':_0x18676b['loginInPause']||![],'pauseType':_0x18676b[_0xa5c2('0x45')]?_0xa5c2('0x50'):null,'lastPauseAt':moment()[_0xa5c2('0x23')](_0xa5c2('0x24')),'interface':_0x37b041});}})[_0xa5c2('0x1d')](function(_0xf0163f){_0x58cfbe(_0xf0163f);})[_0xa5c2('0x16')](function(_0x37ef30){_0x25c4ce(_0x22fbc6[_0xa5c2('0x18')](0x1f4,_0x37ef30[_0xa5c2('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 953712e..29820d5 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 _0x9dd8=['save','remove','update','emit','removeListener','user:','./user.events'];(function(_0x224b2f,_0x192fc7){var _0x3e5ed4=function(_0x2a069e){while(--_0x2a069e){_0x224b2f['push'](_0x224b2f['shift']());}};_0x3e5ed4(++_0x192fc7);}(_0x9dd8,0x15d));var _0x89dd=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x9dd8[_0x1deb03];return _0x189fe7;};'use strict';var UserEvents=require(_0x89dd('0x0'));var events=[_0x89dd('0x1'),_0x89dd('0x2'),_0x89dd('0x3')];function createListener(_0x2e78e2,_0x4a61fc){return function(_0x26ed06){_0x4a61fc[_0x89dd('0x4')](_0x2e78e2,_0x26ed06);};}function removeListener(_0x32b6de,_0x54efde){return function(){UserEvents[_0x89dd('0x5')](_0x32b6de,_0x54efde);};}exports['register']=function(_0x47efd4){for(var _0x29a56c=0x0,_0x50cebc=events['length'];_0x29a56c<_0x50cebc;_0x29a56c++){var _0x3da62a=events[_0x29a56c];var _0x5095c8=createListener(_0x89dd('0x6')+_0x3da62a,_0x47efd4);UserEvents['on'](_0x3da62a,_0x5095c8);}}; \ No newline at end of file +var _0x5512=['emit','removeListener','register','length','user:','./user.events'];(function(_0xcc523b,_0x1eb463){var _0x6afae7=function(_0x5cc82f){while(--_0x5cc82f){_0xcc523b['push'](_0xcc523b['shift']());}};_0x6afae7(++_0x1eb463);}(_0x5512,0x95));var _0x2551=function(_0x3aabbe,_0x4b8ea1){_0x3aabbe=_0x3aabbe-0x0;var _0x5462e1=_0x5512[_0x3aabbe];return _0x5462e1;};'use strict';var UserEvents=require(_0x2551('0x0'));var events=['save','remove','update'];function createListener(_0x42b458,_0x417cca){return function(_0x1e47e6){_0x417cca[_0x2551('0x1')](_0x42b458,_0x1e47e6);};}function removeListener(_0x210c85,_0x8dc2c4){return function(){UserEvents[_0x2551('0x2')](_0x210c85,_0x8dc2c4);};}exports[_0x2551('0x3')]=function(_0x3c97fa){for(var _0xa8c0ab=0x0,_0x258423=events[_0x2551('0x4')];_0xa8c0ab<_0x258423;_0xa8c0ab++){var _0x286ea7=events[_0xa8c0ab];var _0x40c114=createListener(_0x2551('0x5')+_0x286ea7,_0x3c97fa);UserEvents['on'](_0x286ea7,_0x40c114);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index c240774..bfda7f0 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x232f9c,_0x3ae9df){var _0x24bb71=function(_0x4fb958){while(--_0x4fb958){_0x232f9c['push'](_0x232f9c['shift']());}};_0x24bb71(++_0x3ae9df);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xa9e0[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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(_0x4034f0,_0x45a177){var _0x4a4119=function(_0x122ca8){while(--_0x122ca8){_0x4034f0['push'](_0x4034f0['shift']());}};_0x4a4119(++_0x45a177);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 9a8602e..389a6d5 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 _0xcfa6=['sequelize','INTEGER'];(function(_0x11b648,_0x110359){var _0x4ad9af=function(_0x2cc9cd){while(--_0x2cc9cd){_0x11b648['push'](_0x11b648['shift']());}};_0x4ad9af(++_0x110359);}(_0xcfa6,0x168));var _0x6cfa=function(_0x28cd2c,_0x1ce656){_0x28cd2c=_0x28cd2c-0x0;var _0x162980=_0xcfa6[_0x28cd2c];return _0x162980;};'use strict';var Sequelize=require(_0x6cfa('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x6cfa('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6459=['sequelize','INTEGER'];(function(_0x58460b,_0x358ec0){var _0x49169f=function(_0x5e91d5){while(--_0x5e91d5){_0x58460b['push'](_0x58460b['shift']());}};_0x49169f(++_0x358ec0);}(_0x6459,0x1b8));var _0x9645=function(_0x33e452,_0x503c6b){_0x33e452=_0x33e452-0x0;var _0x46f379=_0x6459[_0x33e452];return _0x46f379;};'use strict';var Sequelize=require(_0x9645('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x9645('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 e0fff20..19f09df 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 _0xd1e6=['define','UserChatQueue','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x28367c,_0x4ab687){var _0x32be1d=function(_0x572e63){while(--_0x572e63){_0x28367c['push'](_0x28367c['shift']());}};_0x32be1d(++_0x4ab687);}(_0xd1e6,0xce));var _0x6d1e=function(_0x33f3fe,_0x332a8b){_0x33f3fe=_0x33f3fe-0x0;var _0x10075c=_0xd1e6[_0x33f3fe];return _0x10075c;};'use strict';var _=require(_0x6d1e('0x0'));var util=require(_0x6d1e('0x1'));var logger=require(_0x6d1e('0x2'))('api');var moment=require(_0x6d1e('0x3'));var BPromise=require(_0x6d1e('0x4'));var rp=require(_0x6d1e('0x5'));var fs=require('fs');var path=require(_0x6d1e('0x6'));var rimraf=require(_0x6d1e('0x7'));var config=require(_0x6d1e('0x8'));var attributes=require('./userChatQueue.attributes');module[_0x6d1e('0x9')]=function(_0x4382e8,_0x450dd0){return _0x4382e8[_0x6d1e('0xa')](_0x6d1e('0xb'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa5e8=['user_has_chat_queues','../../config/logger','moment','bluebird','request-promise','path','./userChatQueue.attributes','exports'];(function(_0x45c883,_0x1c22ba){var _0x333475=function(_0x1eb912){while(--_0x1eb912){_0x45c883['push'](_0x45c883['shift']());}};_0x333475(++_0x1c22ba);}(_0xa5e8,0x1b1));var _0x8a5e=function(_0xbb526f,_0x3e1ff5){_0xbb526f=_0xbb526f-0x0;var _0x38ebaf=_0xa5e8[_0xbb526f];return _0x38ebaf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8a5e('0x0'))('api');var moment=require(_0x8a5e('0x1'));var BPromise=require(_0x8a5e('0x2'));var rp=require(_0x8a5e('0x3'));var fs=require('fs');var path=require(_0x8a5e('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8a5e('0x5'));module[_0x8a5e('0x6')]=function(_0x4523d0,_0x5e9558){return _0x4523d0['define']('UserChatQueue',attributes,{'tableName':_0x8a5e('0x7'),'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 1c536c9..e0c84ce 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 _0x17c3=['client','http','request','then','info','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x41e507,_0x17d6b9){var _0x407024=function(_0x3753e1){while(--_0x3753e1){_0x41e507['push'](_0x41e507['shift']());}};_0x407024(++_0x17d6b9);}(_0x17c3,0x1d0));var _0x317c=function(_0x196757,_0x45ff9e){_0x196757=_0x196757-0x0;var _0x561d69=_0x17c3[_0x196757];return _0x561d69;};'use strict';var _=require(_0x317c('0x0'));var util=require(_0x317c('0x1'));var moment=require(_0x317c('0x2'));var BPromise=require(_0x317c('0x3'));var rs=require(_0x317c('0x4'));var fs=require('fs');var Redis=require(_0x317c('0x5'));var db=require(_0x317c('0x6'))['db'];var utils=require(_0x317c('0x7'));var logger=require(_0x317c('0x8'))(_0x317c('0x9'));var config=require('../../config/environment');var jayson=require(_0x317c('0xa'));var client=jayson[_0x317c('0xb')][_0x317c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x548863,_0x652986,_0x33dbde){return new BPromise(function(_0x1f0cb2,_0x3e57e5){return client[_0x317c('0xd')](_0x548863,_0x33dbde)[_0x317c('0xe')](function(_0x15d723){logger[_0x317c('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x652986,'request\x20sent');logger[_0x317c('0x10')](_0x317c('0x11'),_0x652986,_0x317c('0x12'),JSON[_0x317c('0x13')](_0x15d723));if(_0x15d723[_0x317c('0x14')]){if(_0x15d723[_0x317c('0x14')][_0x317c('0x15')]===0x1f4){logger[_0x317c('0x14')](_0x317c('0x16'),_0x652986,_0x15d723['error'][_0x317c('0x17')]);return _0x3e57e5(_0x15d723[_0x317c('0x14')]['message']);}logger[_0x317c('0x14')](_0x317c('0x16'),_0x652986,_0x15d723[_0x317c('0x14')][_0x317c('0x17')]);return _0x1f0cb2(_0x15d723[_0x317c('0x14')]['message']);}else{logger[_0x317c('0xf')](_0x317c('0x16'),_0x652986,_0x317c('0x12'));_0x1f0cb2(_0x15d723[_0x317c('0x18')]['message']);}})['catch'](function(_0x757916){logger[_0x317c('0x14')](_0x317c('0x16'),_0x652986,_0x757916);_0x3e57e5(_0x757916);});});} \ No newline at end of file +var _0x8680=['request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','info','UserChatQueue,\x20%s,\x20%s'];(function(_0x2a7a96,_0x232940){var _0xd5a479=function(_0x206f66){while(--_0x206f66){_0x2a7a96['push'](_0x2a7a96['shift']());}};_0xd5a479(++_0x232940);}(_0x8680,0x10c));var _0x0868=function(_0x381005,_0x2b3564){_0x381005=_0x381005-0x0;var _0x7fb157=_0x8680[_0x381005];return _0x7fb157;};'use strict';var _=require(_0x0868('0x0'));var util=require(_0x0868('0x1'));var moment=require(_0x0868('0x2'));var BPromise=require(_0x0868('0x3'));var rs=require(_0x0868('0x4'));var fs=require('fs');var Redis=require(_0x0868('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0868('0x6'));var logger=require('../../config/logger')(_0x0868('0x7'));var config=require(_0x0868('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0868('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7c06ff,_0x3caba2,_0xe533a4){return new BPromise(function(_0xf57d44,_0x3c344b){return client['request'](_0x7c06ff,_0xe533a4)['then'](function(_0x3ab43e){logger[_0x0868('0xa')](_0x0868('0xb'),_0x3caba2,_0x0868('0xc'));logger[_0x0868('0xd')](_0x0868('0xe'),_0x3caba2,_0x0868('0xc'),JSON[_0x0868('0xf')](_0x3ab43e));if(_0x3ab43e[_0x0868('0x10')]){if(_0x3ab43e['error'][_0x0868('0x11')]===0x1f4){logger[_0x0868('0x10')](_0x0868('0xb'),_0x3caba2,_0x3ab43e[_0x0868('0x10')][_0x0868('0x12')]);return _0x3c344b(_0x3ab43e['error'][_0x0868('0x12')]);}logger[_0x0868('0x10')](_0x0868('0xb'),_0x3caba2,_0x3ab43e[_0x0868('0x10')][_0x0868('0x12')]);return _0xf57d44(_0x3ab43e[_0x0868('0x10')]['message']);}else{logger[_0x0868('0xa')](_0x0868('0xb'),_0x3caba2,'request\x20sent');_0xf57d44(_0x3ab43e['result'][_0x0868('0x12')]);}})[_0x0868('0x13')](function(_0x7f211c){logger[_0x0868('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x3caba2,_0x7f211c);_0x3c344b(_0x7f211c);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 4017d35..91b4a92 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x17558f,_0x42f9f5){var _0x4a81a5=function(_0x14ec0a){while(--_0x14ec0a){_0x17558f['push'](_0x17558f['shift']());}};_0x4a81a5(++_0x42f9f5);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5096ea,_0xc621e1){var _0x32acd5=function(_0x595f6c){while(--_0x595f6c){_0x5096ea['push'](_0x5096ea['shift']());}};_0x32acd5(++_0xc621e1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x58547b,_0x4b89c2){_0x58547b=_0x58547b-0x0;var _0x1d3fd2=_0xcb91[_0x58547b];return _0x1d3fd2;};'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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 548f264..e0ccfc1 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 _0xf6a6=['STRING','sequelize','INTEGER'];(function(_0x183b13,_0x5bea3b){var _0x268216=function(_0x51f96c){while(--_0x51f96c){_0x183b13['push'](_0x183b13['shift']());}};_0x268216(++_0x5bea3b);}(_0xf6a6,0xbe));var _0x6f6a=function(_0x21b68b,_0x47cde3){_0x21b68b=_0x21b68b-0x0;var _0xb469fd=_0xf6a6[_0x21b68b];return _0xb469fd;};'use strict';var Sequelize=require(_0x6f6a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x6f6a('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x6f6a('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x6f6a('0x2')]}}; \ No newline at end of file +var _0x1a74=['STRING','sequelize','INTEGER'];(function(_0x52e68e,_0x309912){var _0x3211a4=function(_0x467c01){while(--_0x467c01){_0x52e68e['push'](_0x52e68e['shift']());}};_0x3211a4(++_0x309912);}(_0x1a74,0x6d));var _0x41a7=function(_0x3babc2,_0x4f1cd0){_0x3babc2=_0x3babc2-0x0;var _0x169447=_0x1a74[_0x3babc2];return _0x169447;};'use strict';var Sequelize=require(_0x41a7('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x41a7('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x41a7('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 937d4a8..d4b2271 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 _0xb447=['util','../../config/logger','api','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash'];(function(_0x43a432,_0x35dcec){var _0xe858b0=function(_0x5443af){while(--_0x5443af){_0x43a432['push'](_0x43a432['shift']());}};_0xe858b0(++_0x35dcec);}(_0xb447,0xf1));var _0x7b44=function(_0x358237,_0x496b7d){_0x358237=_0x358237-0x0;var _0x4ad711=_0xb447[_0x358237];return _0x4ad711;};'use strict';var _=require(_0x7b44('0x0'));var util=require(_0x7b44('0x1'));var logger=require(_0x7b44('0x2'))(_0x7b44('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7b44('0x4'));var config=require(_0x7b44('0x5'));var attributes=require(_0x7b44('0x6'));module[_0x7b44('0x7')]=function(_0x4426ac,_0x995fdd){return _0x4426ac[_0x7b44('0x8')](_0x7b44('0x9'),attributes,{'tableName':_0x7b44('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d0d=['./userFaxQueue.attributes','define','UserFaxQueue','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xe6c2cf,_0x617b83){var _0x287854=function(_0x4add9b){while(--_0x4add9b){_0xe6c2cf['push'](_0xe6c2cf['shift']());}};_0x287854(++_0x617b83);}(_0x0d0d,0x92));var _0xd0d0=function(_0x4689f8,_0x2c6232){_0x4689f8=_0x4689f8-0x0;var _0x489cdc=_0x0d0d[_0x4689f8];return _0x489cdc;};'use strict';var _=require(_0xd0d0('0x0'));var util=require('util');var logger=require(_0xd0d0('0x1'))(_0xd0d0('0x2'));var moment=require(_0xd0d0('0x3'));var BPromise=require(_0xd0d0('0x4'));var rp=require(_0xd0d0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd0d0('0x6'));var config=require(_0xd0d0('0x7'));var attributes=require(_0xd0d0('0x8'));module['exports']=function(_0x37d489,_0x263908){return _0x37d489[_0xd0d0('0x9')](_0xd0d0('0xa'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 58c370b..9bc523b 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 _0x1717=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x593534,_0x471e0b){var _0x12b346=function(_0x1cdf12){while(--_0x1cdf12){_0x593534['push'](_0x593534['shift']());}};_0x12b346(++_0x471e0b);}(_0x1717,0xfb));var _0x7171=function(_0x514c15,_0x486901){_0x514c15=_0x514c15-0x0;var _0x16283e=_0x1717[_0x514c15];return _0x16283e;};'use strict';var _=require(_0x7171('0x0'));var util=require(_0x7171('0x1'));var moment=require(_0x7171('0x2'));var BPromise=require(_0x7171('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7171('0x4'));var db=require(_0x7171('0x5'))['db'];var utils=require(_0x7171('0x6'));var logger=require('../../config/logger')(_0x7171('0x7'));var config=require(_0x7171('0x8'));var jayson=require(_0x7171('0x9'));var client=jayson[_0x7171('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3cd4c5,_0x446db8,_0x39e494){return new BPromise(function(_0x4b4e,_0x4a20f9){return client['request'](_0x3cd4c5,_0x39e494)[_0x7171('0xb')](function(_0x46ede4){logger[_0x7171('0xc')](_0x7171('0xd'),_0x446db8,_0x7171('0xe'));logger['debug'](_0x7171('0xf'),_0x446db8,'request\x20sent',JSON[_0x7171('0x10')](_0x46ede4));if(_0x46ede4[_0x7171('0x11')]){if(_0x46ede4[_0x7171('0x11')][_0x7171('0x12')]===0x1f4){logger[_0x7171('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x446db8,_0x46ede4[_0x7171('0x11')][_0x7171('0x13')]);return _0x4a20f9(_0x46ede4[_0x7171('0x11')][_0x7171('0x13')]);}logger[_0x7171('0x11')](_0x7171('0xd'),_0x446db8,_0x46ede4[_0x7171('0x11')][_0x7171('0x13')]);return _0x4b4e(_0x46ede4[_0x7171('0x11')][_0x7171('0x13')]);}else{logger['info'](_0x7171('0xd'),_0x446db8,_0x7171('0xe'));_0x4b4e(_0x46ede4[_0x7171('0x14')][_0x7171('0x13')]);}})['catch'](function(_0x5517d4){logger[_0x7171('0x11')](_0x7171('0xd'),_0x446db8,_0x5517d4);_0x4a20f9(_0x5517d4);});});} \ No newline at end of file +var _0xefb9=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','moment'];(function(_0x5300a8,_0x89fed7){var _0x2081e1=function(_0x181f8d){while(--_0x181f8d){_0x5300a8['push'](_0x5300a8['shift']());}};_0x2081e1(++_0x89fed7);}(_0xefb9,0x1cd));var _0x9efb=function(_0x270dba,_0x1817d2){_0x270dba=_0x270dba-0x0;var _0x36b83b=_0xefb9[_0x270dba];return _0x36b83b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9efb('0x0'));var BPromise=require(_0x9efb('0x1'));var rs=require(_0x9efb('0x2'));var fs=require('fs');var Redis=require(_0x9efb('0x3'));var db=require(_0x9efb('0x4'))['db'];var utils=require(_0x9efb('0x5'));var logger=require(_0x9efb('0x6'))(_0x9efb('0x7'));var config=require(_0x9efb('0x8'));var jayson=require(_0x9efb('0x9'));var client=jayson['client'][_0x9efb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x109c47,_0x148228,_0x33be74){return new BPromise(function(_0x223456,_0x1ab127){return client[_0x9efb('0xb')](_0x109c47,_0x33be74)[_0x9efb('0xc')](function(_0x2b7dc1){logger[_0x9efb('0xd')](_0x9efb('0xe'),_0x148228,_0x9efb('0xf'));logger[_0x9efb('0x10')](_0x9efb('0x11'),_0x148228,_0x9efb('0xf'),JSON['stringify'](_0x2b7dc1));if(_0x2b7dc1[_0x9efb('0x12')]){if(_0x2b7dc1[_0x9efb('0x12')][_0x9efb('0x13')]===0x1f4){logger[_0x9efb('0x12')](_0x9efb('0xe'),_0x148228,_0x2b7dc1['error'][_0x9efb('0x14')]);return _0x1ab127(_0x2b7dc1[_0x9efb('0x12')][_0x9efb('0x14')]);}logger['error'](_0x9efb('0xe'),_0x148228,_0x2b7dc1['error'][_0x9efb('0x14')]);return _0x223456(_0x2b7dc1[_0x9efb('0x12')][_0x9efb('0x14')]);}else{logger[_0x9efb('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x148228,_0x9efb('0xf'));_0x223456(_0x2b7dc1['result'][_0x9efb('0x14')]);}})['catch'](function(_0x5aa0ab){logger[_0x9efb('0x12')](_0x9efb('0xe'),_0x148228,_0x5aa0ab);_0x1ab127(_0x5aa0ab);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 8362527..9ee8e05 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x32b542,_0x4512fa){var _0x554d54=function(_0x35cdfc){while(--_0x35cdfc){_0x32b542['push'](_0x32b542['shift']());}};_0x554d54(++_0x4512fa);}(_0x9c44,0x178));var _0x49c4=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x9c44[_0x15bc81];return _0x59440e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x42757,_0x497be6){var _0x5eaf5a=function(_0x255d7c){while(--_0x255d7c){_0x42757['push'](_0x42757['shift']());}};_0x5eaf5a(++_0x497be6);}(_0x70e0,0x17b));var _0x070e=function(_0x244d52,_0x3efd90){_0x244d52=_0x244d52-0x0;var _0x27427d=_0x70e0[_0x244d52];return _0x27427d;};'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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 9898799..ab49545 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 _0x63af=['exports','INTEGER','sequelize'];(function(_0x1f3154,_0x12d04d){var _0x4f2dfd=function(_0x37d882){while(--_0x37d882){_0x1f3154['push'](_0x1f3154['shift']());}};_0x4f2dfd(++_0x12d04d);}(_0x63af,0x68));var _0xf63a=function(_0x1256cd,_0x8939b9){_0x1256cd=_0x1256cd-0x0;var _0x4a310f=_0x63af[_0x1256cd];return _0x4a310f;};'use strict';var Sequelize=require(_0xf63a('0x0'));module[_0xf63a('0x1')]={'penalty':{'type':Sequelize[_0xf63a('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0631=['INTEGER','sequelize'];(function(_0x4037d8,_0x485514){var _0x1fc2b1=function(_0x4fb94a){while(--_0x4fb94a){_0x4037d8['push'](_0x4037d8['shift']());}};_0x1fc2b1(++_0x485514);}(_0x0631,0xcd));var _0x1063=function(_0x4b9b30,_0x4ebf7d){_0x4b9b30=_0x4b9b30-0x0;var _0x8577a9=_0x0631[_0x4b9b30];return _0x8577a9;};'use strict';var Sequelize=require(_0x1063('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x1063('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 56f8719..88a28ac 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 _0xc182=['user_has_mail_queues','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./userMailQueue.attributes','exports','define','UserMailQueue'];(function(_0x41a93b,_0x2fc19d){var _0x220a7e=function(_0x5ecb05){while(--_0x5ecb05){_0x41a93b['push'](_0x41a93b['shift']());}};_0x220a7e(++_0x2fc19d);}(_0xc182,0xe5));var _0x2c18=function(_0x476677,_0x3feb45){_0x476677=_0x476677-0x0;var _0x4c0a56=_0xc182[_0x476677];return _0x4c0a56;};'use strict';var _=require(_0x2c18('0x0'));var util=require(_0x2c18('0x1'));var logger=require(_0x2c18('0x2'))('api');var moment=require(_0x2c18('0x3'));var BPromise=require(_0x2c18('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c18('0x5'));var rimraf=require(_0x2c18('0x6'));var config=require('../../config/environment');var attributes=require(_0x2c18('0x7'));module[_0x2c18('0x8')]=function(_0x2fbe95,_0x2efc73){return _0x2fbe95[_0x2c18('0x9')](_0x2c18('0xa'),attributes,{'tableName':_0x2c18('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x75e5=['bluebird','request-promise','path','rimraf','exports','util','moment'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x75e5,0x1be));var _0x575e=function(_0x31a9d1,_0x283ae9){_0x31a9d1=_0x31a9d1-0x0;var _0x127d8e=_0x75e5[_0x31a9d1];return _0x127d8e;};'use strict';var _=require('lodash');var util=require(_0x575e('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x575e('0x1'));var BPromise=require(_0x575e('0x2'));var rp=require(_0x575e('0x3'));var fs=require('fs');var path=require(_0x575e('0x4'));var rimraf=require(_0x575e('0x5'));var config=require('../../config/environment');var attributes=require('./userMailQueue.attributes');module[_0x575e('0x6')]=function(_0x50408e,_0x48955e){return _0x50408e['define']('UserMailQueue',attributes,{'tableName':'user_has_mail_queues','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 000ea7d..44745c2 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 _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x183d50,_0xa36bc8){var _0x2587fa=function(_0xc59727){while(--_0xc59727){_0x183d50['push'](_0x183d50['shift']());}};_0x2587fa(++_0xa36bc8);}(_0xe14b,0x93));var _0xbe14=function(_0x3274b0,_0x1cb7db){_0x3274b0=_0x3274b0-0x0;var _0x110dae=_0xe14b[_0x3274b0];return _0x110dae;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file +var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x53dc94,_0xf90b6e){var _0x37102d=function(_0x5d890b){while(--_0x5d890b){_0x53dc94['push'](_0x53dc94['shift']());}};_0x37102d(++_0xf90b6e);}(_0xe14b,0x93));var _0xbe14=function(_0xde2e64,_0x46b3d6){_0xde2e64=_0xde2e64-0x0;var _0x20fef8=_0xe14b[_0xde2e64];return _0x20fef8;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 6848ff3..7d7b0db 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 _0x02de=['fs-extra','../../components/auth/service','../../config/environment','post','isAuthenticated','sendUserNotification','exports','multer','util','connect-timeout','express','Router'];(function(_0x4b587b,_0x4ee2bc){var _0x2caa4d=function(_0x287932){while(--_0x287932){_0x4b587b['push'](_0x4b587b['shift']());}};_0x2caa4d(++_0x4ee2bc);}(_0x02de,0x1db));var _0xe02d=function(_0x5563fd,_0x1f8c42){_0x5563fd=_0x5563fd-0x0;var _0x329495=_0x02de[_0x5563fd];return _0x329495;};'use strict';var multer=require(_0xe02d('0x0'));var util=require(_0xe02d('0x1'));var path=require('path');var timeout=require(_0xe02d('0x2'));var express=require(_0xe02d('0x3'));var router=express[_0xe02d('0x4')]();var fs_extra=require(_0xe02d('0x5'));var auth=require(_0xe02d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe02d('0x7'));var controller=require('./userNotification.controller');router[_0xe02d('0x8')]('/',auth[_0xe02d('0x9')](),controller[_0xe02d('0xa')]);module[_0xe02d('0xb')]=router; \ No newline at end of file +var _0x0230=['fs-extra','../../components/auth/service','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4571aa,_0x255a68){var _0xb0d14f=function(_0x25f35a){while(--_0x25f35a){_0x4571aa['push'](_0x4571aa['shift']());}};_0xb0d14f(++_0x255a68);}(_0x0230,0xb0));var _0x0023=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x0230[_0x500419];return _0x241c1a;};'use strict';var multer=require(_0x0023('0x0'));var util=require(_0x0023('0x1'));var path=require(_0x0023('0x2'));var timeout=require(_0x0023('0x3'));var express=require(_0x0023('0x4'));var router=express[_0x0023('0x5')]();var fs_extra=require(_0x0023('0x6'));var auth=require(_0x0023('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0023('0x8'));router[_0x0023('0x9')]('/',auth[_0x0023('0xa')](),controller[_0x0023('0xb')]);module[_0x0023('0xc')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index dbb496e..3d74796 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 _0x95b5=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x389fb1,_0x431673){var _0x3d3520=function(_0x2dcab7){while(--_0x2dcab7){_0x389fb1['push'](_0x389fb1['shift']());}};_0x3d3520(++_0x431673);}(_0x95b5,0x75));var _0x595b=function(_0x26d701,_0x95f242){_0x26d701=_0x26d701-0x0;var _0x25bb5d=_0x95b5[_0x26d701];return _0x25bb5d;};'use strict';var Sequelize=require(_0x595b('0x0'));module[_0x595b('0x1')]={'body':{'type':Sequelize[_0x595b('0x2')]},'senderName':{'type':Sequelize[_0x595b('0x3')]},'recipientsId':{'type':Sequelize[_0x595b('0x2')]},'recipientsDescription':{'type':Sequelize[_0x595b('0x3')]},'beep':{'type':Sequelize[_0x595b('0x4')]}}; \ No newline at end of file +var _0x2e17=['STRING','BOOLEAN','sequelize'];(function(_0xe896bf,_0x4f8e5e){var _0x4c7a8a=function(_0x410ff2){while(--_0x410ff2){_0xe896bf['push'](_0xe896bf['shift']());}};_0x4c7a8a(++_0x4f8e5e);}(_0x2e17,0x80));var _0x72e1=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x2e17[_0xd1d19a];return _0x52a79d;};'use strict';var Sequelize=require(_0x72e1('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x72e1('0x1')]},'beep':{'type':Sequelize[_0x72e1('0x2')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index e93ce7a..9ea68d9 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 _0xce57=['html','render','User','union','ids','queue','replace','Queue','push','all','getAgents','map','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','defaults','./userNotification.socket','register','sendStatus','end','status','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','ValidationError','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','user','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','join','sequelize','transaction','create','forEach','recipient','emit','catch','findOne'];(function(_0xf8e45b,_0x336e08){var _0xb38c41=function(_0x51f9d8){while(--_0x51f9d8){_0xf8e45b['push'](_0xf8e45b['shift']());}};_0xb38c41(++_0x336e08);}(_0xce57,0x6e));var _0x7ce5=function(_0x3c6ae2,_0x5c52d8){_0x3c6ae2=_0x3c6ae2-0x0;var _0x4edda=_0xce57[_0x3c6ae2];return _0x4edda;};'use strict';var emlformat=require(_0x7ce5('0x0'));var rimraf=require(_0x7ce5('0x1'));var zipdir=require(_0x7ce5('0x2'));var jsonpatch=require(_0x7ce5('0x3'));var rp=require(_0x7ce5('0x4'));var moment=require(_0x7ce5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7ce5('0x6'));var util=require(_0x7ce5('0x7'));var path=require('path');var sox=require(_0x7ce5('0x8'));var csv=require(_0x7ce5('0x9'));var ejs=require(_0x7ce5('0xa'));var fs=require('fs');var fs_extra=require(_0x7ce5('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7ce5('0xc'));var jsforce=require(_0x7ce5('0xd'));var deskjs=require(_0x7ce5('0xe'));var toCsv=require(_0x7ce5('0x9'));var querystring=require(_0x7ce5('0xf'));var Papa=require('papaparse');var Redis=require(_0x7ce5('0x10'));var authService=require(_0x7ce5('0x11'));var qs=require(_0x7ce5('0x12'));var as=require(_0x7ce5('0x13'));var hardwareService=require(_0x7ce5('0x14'));var logger=require(_0x7ce5('0x15'))(_0x7ce5('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7ce5('0x17'));var db=require(_0x7ce5('0x18'))['db'];config['redis']=_[_0x7ce5('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7ce5('0x1a'))[_0x7ce5('0x1b')](socket);function respondWithStatusCode(_0x2257fb,_0x275624){_0x275624=_0x275624||0xcc;return function(_0x462c35){if(_0x462c35){return _0x2257fb[_0x7ce5('0x1c')](_0x275624);}return _0x2257fb['status'](_0x275624)[_0x7ce5('0x1d')]();};}function respondWithResult(_0x4600b1,_0x30c39e){_0x30c39e=_0x30c39e||0xc8;return function(_0x194d62){if(_0x194d62){return _0x4600b1[_0x7ce5('0x1e')](_0x30c39e)['json'](_0x194d62);}};}function respondWithFilteredResult(_0x180883,_0x3304f7){return function(_0x35ba74){if(_0x35ba74){var _0x4e6177=typeof _0x3304f7[_0x7ce5('0x1f')]===_0x7ce5('0x20')&&typeof _0x3304f7[_0x7ce5('0x21')]===_0x7ce5('0x20');var _0x39e1ea=_0x35ba74[_0x7ce5('0x22')];var _0x43f3c0=_0x4e6177?0x0:_0x3304f7['offset'];var _0x240527=_0x4e6177?_0x35ba74['count']:_0x3304f7['offset']+_0x3304f7[_0x7ce5('0x21')];var _0x107ad3;if(_0x240527>=_0x39e1ea){_0x240527=_0x39e1ea;_0x107ad3=0xc8;}else{_0x107ad3=0xce;}_0x180883[_0x7ce5('0x1e')](_0x107ad3);return _0x180883['set']('Content-Range',_0x43f3c0+'-'+_0x240527+'/'+_0x39e1ea)['json'](_0x35ba74);}return null;};}function patchUpdates(_0x1c3710){return function(_0x3c3338){try{jsonpatch[_0x7ce5('0x23')](_0x3c3338,_0x1c3710,!![]);}catch(_0x1c6eeb){return BPromise[_0x7ce5('0x24')](_0x1c6eeb);}return _0x3c3338[_0x7ce5('0x25')]();};}function saveUpdates(_0x4033be,_0x4b573c){return function(_0x3dabfa){if(_0x3dabfa){return _0x3dabfa[_0x7ce5('0x26')](_0x4033be)[_0x7ce5('0x27')](function(_0x25e2e4){return _0x25e2e4;});}return null;};}function removeEntity(_0x6c72d1,_0x112b66){return function(_0x1fca0e){if(_0x1fca0e){return _0x1fca0e[_0x7ce5('0x28')]()[_0x7ce5('0x27')](function(){_0x6c72d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xec9615,_0xd5cf85){return function(_0x2761ae){if(!_0x2761ae){_0xec9615[_0x7ce5('0x1c')](0x194);}return _0x2761ae;};}function handleError(_0x40c2a5,_0x278e74){_0x278e74=_0x278e74||0x1f4;return function(_0xb3ddde){logger[_0x7ce5('0x29')](_0xb3ddde[_0x7ce5('0x2a')]);if(_0xb3ddde[_0x7ce5('0x2b')]){delete _0xb3ddde[_0x7ce5('0x2b')];}_0x40c2a5['status'](_0x278e74)['send'](_0xb3ddde);};}exports[_0x7ce5('0x2c')]=function(_0x5e1236,_0x281116,_0x396140){if(!_0x5e1236[_0x7ce5('0x2d')][_0x7ce5('0x2e')](_0x7ce5('0x2f'))&&!_0x5e1236['body'][_0x7ce5('0x2e')](_0x7ce5('0x30'))){throw new db[(_0x7ce5('0x31'))]['ValidationError'](_0x7ce5('0x32'));}else{if(_0x5e1236['body'][_0x7ce5('0x2e')](_0x7ce5('0x30'))&&!_0x5e1236[_0x7ce5('0x2d')][_0x7ce5('0x2e')](_0x7ce5('0x33'))){throw new db[(_0x7ce5('0x31'))]['ValidationError']('Missing\x20\x27view\x27\x20parameter');}if(!_0x5e1236[_0x7ce5('0x2d')][_0x7ce5('0x2e')](_0x7ce5('0x34'))){throw new db[(_0x7ce5('0x31'))]['ValidationError'](_0x7ce5('0x35'));}else{try{var _0x137818=JSON[_0x7ce5('0x36')](_0x5e1236['body'][_0x7ce5('0x34')]);}catch(_0x37ce72){logger[_0x7ce5('0x29')](_0x37ce72);throw new db[(_0x7ce5('0x31'))][(_0x7ce5('0x37'))]('Invalid\x20\x27recipients\x27\x20object');}var _0xc071b7=[_0x7ce5('0x38'),_0x7ce5('0x39'),_0x7ce5('0x3a'),_0x7ce5('0x3b'),_0x7ce5('0x3c'),_0x7ce5('0x3d'),_0x7ce5('0x3e'),_0x7ce5('0x3f'),'user'];if(_[_0x7ce5('0x40')](_0x137818,function(_0x438cf2){return!_[_0x7ce5('0x41')](_0xc071b7,_0x438cf2[_0x7ce5('0x42')][_0x7ce5('0x43')]());})){throw new db[(_0x7ce5('0x31'))][(_0x7ce5('0x37'))](_0x7ce5('0x44'));}}}var _0x2f6415={};_0x2f6415[_0x7ce5('0x45')]=_0x5e1236[_0x7ce5('0x2d')][_0x7ce5('0x2e')]('senderName')?_0x5e1236['body'][_0x7ce5('0x45')]:_0x5e1236[_0x7ce5('0x46')][_0x7ce5('0x47')];_0x2f6415[_0x7ce5('0x48')]=_[_0x7ce5('0x49')](_0x5e1236[_0x7ce5('0x2d')][_0x7ce5('0x48')])?null:_0x5e1236[_0x7ce5('0x2d')]['recipientsDescription'];_0x2f6415['beep']=_0x5e1236['body'][_0x7ce5('0x4a')]||![];_0x2f6415[_0x7ce5('0x4b')]=_0x5e1236['user']['id'];return getContent(_0x5e1236[_0x7ce5('0x2d')])['then'](function(_0xe62263){_0x2f6415['body']=_0xe62263;return getRecipients(_0x137818);})[_0x7ce5('0x27')](function(_0x49e521){_0x2f6415[_0x7ce5('0x4c')]=_['sortBy'](_0x49e521)[_0x7ce5('0x4d')](',');return db[_0x7ce5('0x4e')][_0x7ce5('0x4f')](function(_0x3f8604){return db['UserNotification'][_0x7ce5('0x50')](_0x2f6415,{'raw':!![],'transaction':_0x3f8604})[_0x7ce5('0x27')](function(_0x1cdea6){var _0x1e8c10={'sender':_0x2f6415['senderName'],'description':_0x2f6415[_0x7ce5('0x48')],'content':_0x2f6415[_0x7ce5('0x2d')],'beep':_0x2f6415[_0x7ce5('0x4a')]};_0x49e521[_0x7ce5('0x51')](function(_0x1f4967){_0x1e8c10[_0x7ce5('0x52')]=_0x1f4967;socket[_0x7ce5('0x53')]('userNotification:send',_0x1e8c10);});return _0x1cdea6;});});})[_0x7ce5('0x27')](respondWithResult(_0x281116,0xc9))[_0x7ce5('0x54')](handleError(_0x281116,null));};function getContent(_0x37d73f){return new BPromise(function(_0x3cf967,_0x148a15){if(_0x37d73f[_0x7ce5('0x2f')]){_0x3cf967(_0x37d73f['text']);return;}return db['Template'][_0x7ce5('0x55')]({'attributes':[_0x7ce5('0x56')],'where':{'id':_0x37d73f[_0x7ce5('0x30')]},'raw':!![]})['then'](function(_0x257e6f){if(!_0x257e6f)throw new db[(_0x7ce5('0x31'))]['ValidationError']('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x14d0e7=Mustache[_0x7ce5('0x57')](_0x257e6f[_0x7ce5('0x56')],_0x37d73f[_0x7ce5('0x33')]);_0x3cf967(_0x14d0e7);})[_0x7ce5('0x54')](function(_0x23b91d){_0x148a15(_0x23b91d);});});}function getRecipients(_0x240cd6){return new BPromise(function(_0x323a85,_0x173eb0){var _0x5441b3=[];var _0x2d0387=[];_0x240cd6[_0x7ce5('0x51')](function(_0xd6db0b){var _0x47b5df=_['startCase'](_0xd6db0b['model'][_0x7ce5('0x43')]());if(_0x47b5df===_0x7ce5('0x58')){_0x5441b3=_[_0x7ce5('0x59')](_0x5441b3,_0xd6db0b[_0x7ce5('0x5a')]);}else{if(_[_0x7ce5('0x41')](_0x47b5df,_0x7ce5('0x5b')))_0x47b5df=_0x47b5df[_0x7ce5('0x5c')](_0x7ce5('0x5b'),_0x7ce5('0x5d'));_0xd6db0b['ids'][_0x7ce5('0x51')](function(_0x26ffc8){_0x2d0387[_0x7ce5('0x5e')](getAgents(_0x47b5df,_0x26ffc8));});}});return BPromise[_0x7ce5('0x5f')](_0x2d0387)['then'](function(_0x48271d){_0x5441b3=_[_0x7ce5('0x59')](_0x5441b3,_['flatten'](_0x48271d));_0x323a85(_0x5441b3);})[_0x7ce5('0x54')](function(_0x44e510){_0x173eb0(_0x44e510);});});}function getAgents(_0x3ff2e2,_0x2a24da){return new BPromise(function(_0x57bdd6,_0x272127){return db[_0x3ff2e2][_0x7ce5('0x55')]({'where':{'id':_0x2a24da}})[_0x7ce5('0x27')](function(_0x405dc3){return _0x405dc3[_0x7ce5('0x60')]({'attributes':['id'],'raw':!![]})['then'](function(_0x197b4f){var _0x552bc0=_[_0x7ce5('0x61')](_0x197b4f,'id');_0x57bdd6(_0x552bc0);});})['catch'](function(_0x1b3d6e){_0x272127(_0x1b3d6e);});});} \ No newline at end of file +var _0xe520=['name','send','sendUserNotification','hasOwnProperty','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','body','view','Missing\x20\x27view\x27\x20parameter','Sequelize','parse','recipients','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','includes','model','toLowerCase','senderName','fullname','recipientsDescription','beep','SenderId','sortBy','join','transaction','UserNotification','forEach','emit','userNotification:send','text','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','User','union','ids','queue','replace','push','all','getAgents','map','catch','fast-json-patch','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','apply','reject','then','sendStatus','stack'];(function(_0x9bb029,_0x58cba1){var _0x8d3193=function(_0xc050f7){while(--_0xc050f7){_0x9bb029['push'](_0x9bb029['shift']());}};_0x8d3193(++_0x58cba1);}(_0xe520,0x1b7));var _0x0e52=function(_0x13f6e2,_0x404dae){_0x13f6e2=_0x13f6e2-0x0;var _0x32f12f=_0xe520[_0x13f6e2];return _0x32f12f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0e52('0x0'));var rp=require(_0x0e52('0x1'));var moment=require(_0x0e52('0x2'));var BPromise=require(_0x0e52('0x3'));var Mustache=require('mustache');var util=require(_0x0e52('0x4'));var path=require(_0x0e52('0x5'));var sox=require(_0x0e52('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0e52('0x7'));var _=require(_0x0e52('0x8'));var squel=require(_0x0e52('0x9'));var crypto=require(_0x0e52('0xa'));var jsforce=require(_0x0e52('0xb'));var deskjs=require(_0x0e52('0xc'));var toCsv=require(_0x0e52('0xd'));var querystring=require(_0x0e52('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0e52('0xf'));var qs=require(_0x0e52('0x10'));var as=require(_0x0e52('0x11'));var hardwareService=require(_0x0e52('0x12'));var logger=require('../../config/logger')(_0x0e52('0x13'));var utils=require(_0x0e52('0x14'));var config=require(_0x0e52('0x15'));var licenseUtil=require(_0x0e52('0x16'));var db=require(_0x0e52('0x17'))['db'];config['redis']=_[_0x0e52('0x18')](config[_0x0e52('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x0e52('0x1a'))(new Redis(config[_0x0e52('0x19')]));require('./userNotification.socket')[_0x0e52('0x1b')](socket);function respondWithStatusCode(_0x4cd267,_0x3c7b0d){_0x3c7b0d=_0x3c7b0d||0xcc;return function(_0x42fe63){if(_0x42fe63){return _0x4cd267['sendStatus'](_0x3c7b0d);}return _0x4cd267[_0x0e52('0x1c')](_0x3c7b0d)[_0x0e52('0x1d')]();};}function respondWithResult(_0x111feb,_0x29f23c){_0x29f23c=_0x29f23c||0xc8;return function(_0x4ed540){if(_0x4ed540){return _0x111feb[_0x0e52('0x1c')](_0x29f23c)[_0x0e52('0x1e')](_0x4ed540);}};}function respondWithFilteredResult(_0x2e95e3,_0x599503){return function(_0x3acfba){if(_0x3acfba){var _0x1813e8=typeof _0x599503[_0x0e52('0x1f')]===_0x0e52('0x20')&&typeof _0x599503[_0x0e52('0x21')]===_0x0e52('0x20');var _0x39bc94=_0x3acfba['count'];var _0x1fe5c7=_0x1813e8?0x0:_0x599503['offset'];var _0x213bef=_0x1813e8?_0x3acfba[_0x0e52('0x22')]:_0x599503['offset']+_0x599503[_0x0e52('0x21')];var _0x19bdbe;if(_0x213bef>=_0x39bc94){_0x213bef=_0x39bc94;_0x19bdbe=0xc8;}else{_0x19bdbe=0xce;}_0x2e95e3[_0x0e52('0x1c')](_0x19bdbe);return _0x2e95e3[_0x0e52('0x23')]('Content-Range',_0x1fe5c7+'-'+_0x213bef+'/'+_0x39bc94)[_0x0e52('0x1e')](_0x3acfba);}return null;};}function patchUpdates(_0x18cb2e){return function(_0x4cd4c3){try{jsonpatch[_0x0e52('0x24')](_0x4cd4c3,_0x18cb2e,!![]);}catch(_0x320978){return BPromise[_0x0e52('0x25')](_0x320978);}return _0x4cd4c3['save']();};}function saveUpdates(_0x13edaf,_0xa237e3){return function(_0x44fe18){if(_0x44fe18){return _0x44fe18['update'](_0x13edaf)[_0x0e52('0x26')](function(_0x5430c0){return _0x5430c0;});}return null;};}function removeEntity(_0x22fb43,_0x2527c8){return function(_0x1aa16c){if(_0x1aa16c){return _0x1aa16c['destroy']()[_0x0e52('0x26')](function(){_0x22fb43[_0x0e52('0x1c')](0xcc)[_0x0e52('0x1d')]();});}};}function handleEntityNotFound(_0x457ae3,_0x24385f){return function(_0x5b588b){if(!_0x5b588b){_0x457ae3[_0x0e52('0x27')](0x194);}return _0x5b588b;};}function handleError(_0x319efb,_0x452e60){_0x452e60=_0x452e60||0x1f4;return function(_0x3ca4cb){logger['error'](_0x3ca4cb[_0x0e52('0x28')]);if(_0x3ca4cb[_0x0e52('0x29')]){delete _0x3ca4cb[_0x0e52('0x29')];}_0x319efb[_0x0e52('0x1c')](_0x452e60)[_0x0e52('0x2a')](_0x3ca4cb);};}exports[_0x0e52('0x2b')]=function(_0x50ea1f,_0x4bb040,_0x4dcf96){if(!_0x50ea1f['body'][_0x0e52('0x2c')]('text')&&!_0x50ea1f['body'][_0x0e52('0x2c')](_0x0e52('0x2d'))){throw new db['Sequelize'][(_0x0e52('0x2e'))](_0x0e52('0x2f'));}else{if(_0x50ea1f[_0x0e52('0x30')][_0x0e52('0x2c')](_0x0e52('0x2d'))&&!_0x50ea1f[_0x0e52('0x30')][_0x0e52('0x2c')](_0x0e52('0x31'))){throw new db['Sequelize'][(_0x0e52('0x2e'))](_0x0e52('0x32'));}if(!_0x50ea1f[_0x0e52('0x30')][_0x0e52('0x2c')]('recipients')){throw new db[(_0x0e52('0x33'))][(_0x0e52('0x2e'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x5a3a39=JSON[_0x0e52('0x34')](_0x50ea1f[_0x0e52('0x30')][_0x0e52('0x35')]);}catch(_0x43b768){logger[_0x0e52('0x36')](_0x43b768);throw new db[(_0x0e52('0x33'))]['ValidationError'](_0x0e52('0x37'));}var _0x138271=[_0x0e52('0x38'),'faxqueue',_0x0e52('0x39'),_0x0e52('0x3a'),_0x0e52('0x3b'),_0x0e52('0x3c'),_0x0e52('0x3d'),_0x0e52('0x3e'),_0x0e52('0x3f')];if(_['some'](_0x5a3a39,function(_0x3a431d){return!_[_0x0e52('0x40')](_0x138271,_0x3a431d[_0x0e52('0x41')][_0x0e52('0x42')]());})){throw new db[(_0x0e52('0x33'))]['ValidationError']('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x535620={};_0x535620[_0x0e52('0x43')]=_0x50ea1f[_0x0e52('0x30')]['hasOwnProperty'](_0x0e52('0x43'))?_0x50ea1f['body'][_0x0e52('0x43')]:_0x50ea1f['user'][_0x0e52('0x44')];_0x535620['recipientsDescription']=_['isEmpty'](_0x50ea1f[_0x0e52('0x30')][_0x0e52('0x45')])?null:_0x50ea1f[_0x0e52('0x30')][_0x0e52('0x45')];_0x535620[_0x0e52('0x46')]=_0x50ea1f[_0x0e52('0x30')][_0x0e52('0x46')]||![];_0x535620[_0x0e52('0x47')]=_0x50ea1f[_0x0e52('0x3f')]['id'];return getContent(_0x50ea1f[_0x0e52('0x30')])[_0x0e52('0x26')](function(_0x139669){_0x535620[_0x0e52('0x30')]=_0x139669;return getRecipients(_0x5a3a39);})['then'](function(_0x394caa){_0x535620['recipientsId']=_[_0x0e52('0x48')](_0x394caa)[_0x0e52('0x49')](',');return db['sequelize'][_0x0e52('0x4a')](function(_0x2a49c7){return db[_0x0e52('0x4b')]['create'](_0x535620,{'raw':!![],'transaction':_0x2a49c7})[_0x0e52('0x26')](function(_0x173f58){var _0x37cf90={'sender':_0x535620[_0x0e52('0x43')],'description':_0x535620[_0x0e52('0x45')],'content':_0x535620[_0x0e52('0x30')],'beep':_0x535620[_0x0e52('0x46')]};_0x394caa[_0x0e52('0x4c')](function(_0x4a69a7){_0x37cf90['recipient']=_0x4a69a7;socket[_0x0e52('0x4d')](_0x0e52('0x4e'),_0x37cf90);});return _0x173f58;});});})[_0x0e52('0x26')](respondWithResult(_0x4bb040,0xc9))['catch'](handleError(_0x4bb040,null));};function getContent(_0x4654e6){return new BPromise(function(_0x53b5ef,_0x2116c4){if(_0x4654e6[_0x0e52('0x4f')]){_0x53b5ef(_0x4654e6[_0x0e52('0x4f')]);return;}return db[_0x0e52('0x50')][_0x0e52('0x51')]({'attributes':[_0x0e52('0x52')],'where':{'id':_0x4654e6[_0x0e52('0x2d')]},'raw':!![]})['then'](function(_0x50741c){if(!_0x50741c)throw new db[(_0x0e52('0x33'))][(_0x0e52('0x2e'))](_0x0e52('0x53'));var _0x408e20=Mustache[_0x0e52('0x54')](_0x50741c[_0x0e52('0x52')],_0x4654e6[_0x0e52('0x31')]);_0x53b5ef(_0x408e20);})['catch'](function(_0x26c50a){_0x2116c4(_0x26c50a);});});}function getRecipients(_0x3d9df0){return new BPromise(function(_0x3ebf7f,_0x202dcf){var _0x5b7c5e=[];var _0x122de5=[];_0x3d9df0['forEach'](function(_0x4a0534){var _0x193d75=_[_0x0e52('0x55')](_0x4a0534[_0x0e52('0x41')][_0x0e52('0x42')]());if(_0x193d75===_0x0e52('0x56')){_0x5b7c5e=_[_0x0e52('0x57')](_0x5b7c5e,_0x4a0534[_0x0e52('0x58')]);}else{if(_['includes'](_0x193d75,_0x0e52('0x59')))_0x193d75=_0x193d75[_0x0e52('0x5a')](_0x0e52('0x59'),'Queue');_0x4a0534['ids']['forEach'](function(_0x56f444){_0x122de5[_0x0e52('0x5b')](getAgents(_0x193d75,_0x56f444));});}});return BPromise[_0x0e52('0x5c')](_0x122de5)[_0x0e52('0x26')](function(_0x3cf514){_0x5b7c5e=_[_0x0e52('0x57')](_0x5b7c5e,_['flatten'](_0x3cf514));_0x3ebf7f(_0x5b7c5e);})['catch'](function(_0x50e0b7){_0x202dcf(_0x50e0b7);});});}function getAgents(_0x43efe6,_0x10fd37){return new BPromise(function(_0xdacbd8,_0x15d19f){return db[_0x43efe6][_0x0e52('0x51')]({'where':{'id':_0x10fd37}})[_0x0e52('0x26')](function(_0x5b2e44){return _0x5b2e44[_0x0e52('0x5d')]({'attributes':['id'],'raw':!![]})[_0x0e52('0x26')](function(_0x36984c){var _0x3bea6=_[_0x0e52('0x5e')](_0x36984c,'id');_0xdacbd8(_0x3bea6);});})[_0x0e52('0x5f')](function(_0x2b555f){_0x15d19f(_0x2b555f);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index dcd113c..c64e98c 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 _0xdda3=['hook','../../mysqldb','UserNotification','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x3d7436,_0x5e1e82){var _0x18133f=function(_0x173f40){while(--_0x173f40){_0x3d7436['push'](_0x3d7436['shift']());}};_0x18133f(++_0x5e1e82);}(_0xdda3,0x1b1));var _0x3dda=function(_0x56e984,_0x57363d){_0x56e984=_0x56e984-0x0;var _0x4cb323=_0xdda3[_0x56e984];return _0x4cb323;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x3dda('0x0'))['db'][_0x3dda('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x3dda('0x2')](0x0);var events={'afterCreate':_0x3dda('0x3'),'afterUpdate':_0x3dda('0x4'),'afterDestroy':'remove'};function emitEvent(_0x21e2a5){return function(_0xd3b58,_0xaad3b8,_0x4cf5cb){UserNotificationEvents[_0x3dda('0x5')](_0x21e2a5+':'+_0xd3b58['id'],_0xd3b58);UserNotificationEvents[_0x3dda('0x5')](_0x21e2a5,_0xd3b58);_0x4cf5cb(null);};}for(var e in events){if(events[_0x3dda('0x6')](e)){var event=events[e];UserNotification[_0x3dda('0x7')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file +var _0x3363=['exports','events','../../mysqldb','UserNotification','update','remove','hasOwnProperty','hook'];(function(_0x20d0da,_0x388969){var _0x37c3a9=function(_0x985aa3){while(--_0x985aa3){_0x20d0da['push'](_0x20d0da['shift']());}};_0x37c3a9(++_0x388969);}(_0x3363,0x1d1));var _0x3336=function(_0x160a9c,_0x2768f3){_0x160a9c=_0x160a9c-0x0;var _0x522484=_0x3363[_0x160a9c];return _0x522484;};'use strict';var EventEmitter=require(_0x3336('0x0'));var UserNotification=require(_0x3336('0x1'))['db'][_0x3336('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x3336('0x3'),'afterDestroy':_0x3336('0x4')};function emitEvent(_0xfa7da9){return function(_0x5c0091,_0x47da69,_0x7933ed){UserNotificationEvents['emit'](_0xfa7da9+':'+_0x5c0091['id'],_0x5c0091);UserNotificationEvents['emit'](_0xfa7da9,_0x5c0091);_0x7933ed(null);};}for(var e in events){if(events[_0x3336('0x5')](e)){var event=events[e];UserNotification[_0x3336('0x6')](e,emitEvent(event));}}module[_0x3336('0x7')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 2582fdc..dac1c3d 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 _0xb3a2=['../../config/logger','moment','bluebird','path','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','util'];(function(_0x4b6da2,_0x195570){var _0x2503dc=function(_0x382e90){while(--_0x382e90){_0x4b6da2['push'](_0x4b6da2['shift']());}};_0x2503dc(++_0x195570);}(_0xb3a2,0x77));var _0x2b3a=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xb3a2[_0xdea41a];return _0x15d0d8;};'use strict';var _=require('lodash');var util=require(_0x2b3a('0x0'));var logger=require(_0x2b3a('0x1'))('api');var moment=require(_0x2b3a('0x2'));var BPromise=require(_0x2b3a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b3a('0x4'));var rimraf=require('rimraf');var config=require(_0x2b3a('0x5'));var attributes=require(_0x2b3a('0x6'));module[_0x2b3a('0x7')]=function(_0xe66051,_0x3cd48b){return _0xe66051[_0x2b3a('0x8')](_0x2b3a('0x9'),attributes,{'tableName':_0x2b3a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2b3a('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf0f9=['utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','UserNotification','userNotifications'];(function(_0x1eff96,_0x56e0b3){var _0x5c40e0=function(_0x2b9e06){while(--_0x2b9e06){_0x1eff96['push'](_0x1eff96['shift']());}};_0x5c40e0(++_0x56e0b3);}(_0xf0f9,0x1c4));var _0x9f0f=function(_0x419435,_0x1ec68c){_0x419435=_0x419435-0x0;var _0x18bdaa=_0xf0f9[_0x419435];return _0x18bdaa;};'use strict';var _=require(_0x9f0f('0x0'));var util=require(_0x9f0f('0x1'));var logger=require('../../config/logger')(_0x9f0f('0x2'));var moment=require(_0x9f0f('0x3'));var BPromise=require(_0x9f0f('0x4'));var rp=require(_0x9f0f('0x5'));var fs=require('fs');var path=require(_0x9f0f('0x6'));var rimraf=require(_0x9f0f('0x7'));var config=require(_0x9f0f('0x8'));var attributes=require(_0x9f0f('0x9'));module[_0x9f0f('0xa')]=function(_0x389b28,_0x18dfc9){return _0x389b28['define'](_0x9f0f('0xb'),attributes,{'tableName':_0x9f0f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9f0f('0xd'),'collate':_0x9f0f('0xe')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 44efdc3..98a8c41 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 _0x5871=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1e5419,_0x511dc5){var _0x5e1400=function(_0x241cdb){while(--_0x241cdb){_0x1e5419['push'](_0x1e5419['shift']());}};_0x5e1400(++_0x511dc5);}(_0x5871,0x9f));var _0x1587=function(_0x1ca13a,_0x244264){_0x1ca13a=_0x1ca13a-0x0;var _0x52728b=_0x5871[_0x1ca13a];return _0x52728b;};'use strict';var _=require(_0x1587('0x0'));var util=require(_0x1587('0x1'));var moment=require(_0x1587('0x2'));var BPromise=require(_0x1587('0x3'));var rs=require(_0x1587('0x4'));var fs=require('fs');var Redis=require(_0x1587('0x5'));var db=require(_0x1587('0x6'))['db'];var utils=require(_0x1587('0x7'));var logger=require(_0x1587('0x8'))(_0x1587('0x9'));var config=require('../../config/environment');var jayson=require(_0x1587('0xa'));var client=jayson[_0x1587('0xb')][_0x1587('0xc')]({'port':0x232a});config[_0x1587('0xd')]=_['defaults'](config[_0x1587('0xd')],{'host':_0x1587('0xe'),'port':0x18eb});var socket=require(_0x1587('0xf'))(new Redis(config[_0x1587('0xd')]));require(_0x1587('0x10'))[_0x1587('0x11')](socket);function respondWithRpcPromise(_0x2b2c18,_0x5b1e22,_0x31e60c){return new BPromise(function(_0xb14314,_0x5c037f){return client[_0x1587('0x12')](_0x2b2c18,_0x31e60c)[_0x1587('0x13')](function(_0xed6b45){logger[_0x1587('0x14')](_0x1587('0x15'),_0x5b1e22,_0x1587('0x16'));logger[_0x1587('0x17')](_0x1587('0x18'),_0x5b1e22,_0x1587('0x16'),JSON[_0x1587('0x19')](_0xed6b45));if(_0xed6b45['error']){if(_0xed6b45[_0x1587('0x1a')][_0x1587('0x1b')]===0x1f4){logger[_0x1587('0x1a')]('UserNotification,\x20%s,\x20%s',_0x5b1e22,_0xed6b45[_0x1587('0x1a')][_0x1587('0x1c')]);return _0x5c037f(_0xed6b45['error'][_0x1587('0x1c')]);}logger[_0x1587('0x1a')]('UserNotification,\x20%s,\x20%s',_0x5b1e22,_0xed6b45[_0x1587('0x1a')][_0x1587('0x1c')]);return _0xb14314(_0xed6b45[_0x1587('0x1a')][_0x1587('0x1c')]);}else{logger['info'](_0x1587('0x15'),_0x5b1e22,_0x1587('0x16'));_0xb14314(_0xed6b45[_0x1587('0x1d')][_0x1587('0x1c')]);}})[_0x1587('0x1e')](function(_0x2f627c){logger[_0x1587('0x1a')](_0x1587('0x15'),_0x5b1e22,_0x2f627c);_0x5c037f(_0x2f627c);});});} \ No newline at end of file +var _0x60d5=['then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./userNotification.socket','register'];(function(_0x284d33,_0x5b003f){var _0x225cf8=function(_0xe512c4){while(--_0xe512c4){_0x284d33['push'](_0x284d33['shift']());}};_0x225cf8(++_0x5b003f);}(_0x60d5,0x123));var _0x560d=function(_0x339bb4,_0x573f12){_0x339bb4=_0x339bb4-0x0;var _0x15b2c2=_0x60d5[_0x339bb4];return _0x15b2c2;};'use strict';var _=require(_0x560d('0x0'));var util=require(_0x560d('0x1'));var moment=require(_0x560d('0x2'));var BPromise=require(_0x560d('0x3'));var rs=require(_0x560d('0x4'));var fs=require('fs');var Redis=require(_0x560d('0x5'));var db=require(_0x560d('0x6'))['db'];var utils=require(_0x560d('0x7'));var logger=require('../../config/logger')(_0x560d('0x8'));var config=require(_0x560d('0x9'));var jayson=require(_0x560d('0xa'));var client=jayson['client'][_0x560d('0xb')]({'port':0x232a});config[_0x560d('0xc')]=_[_0x560d('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x560d('0xe'))(new Redis(config['redis']));require(_0x560d('0xf'))[_0x560d('0x10')](socket);function respondWithRpcPromise(_0x5e3986,_0x4210fb,_0x5a915b){return new BPromise(function(_0x1849e7,_0x3ed8c6){return client['request'](_0x5e3986,_0x5a915b)[_0x560d('0x11')](function(_0x4b1f2a){logger[_0x560d('0x12')](_0x560d('0x13'),_0x4210fb,_0x560d('0x14'));logger[_0x560d('0x15')](_0x560d('0x16'),_0x4210fb,_0x560d('0x14'),JSON[_0x560d('0x17')](_0x4b1f2a));if(_0x4b1f2a[_0x560d('0x18')]){if(_0x4b1f2a[_0x560d('0x18')]['code']===0x1f4){logger[_0x560d('0x18')](_0x560d('0x13'),_0x4210fb,_0x4b1f2a[_0x560d('0x18')]['message']);return _0x3ed8c6(_0x4b1f2a[_0x560d('0x18')][_0x560d('0x19')]);}logger[_0x560d('0x18')]('UserNotification,\x20%s,\x20%s',_0x4210fb,_0x4b1f2a[_0x560d('0x18')][_0x560d('0x19')]);return _0x1849e7(_0x4b1f2a[_0x560d('0x18')][_0x560d('0x19')]);}else{logger[_0x560d('0x12')]('UserNotification,\x20%s,\x20%s',_0x4210fb,'request\x20sent');_0x1849e7(_0x4b1f2a[_0x560d('0x1a')][_0x560d('0x19')]);}})[_0x560d('0x1b')](function(_0x4b6df5){logger['error'](_0x560d('0x13'),_0x4210fb,_0x4b6df5);_0x3ed8c6(_0x4b6df5);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 94b78be..f0539ce 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 _0x9757=['emit','removeListener','register','length','userNotification:','./userNotification.events','save','remove','update'];(function(_0x5d4684,_0x21ff2a){var _0x5b4dce=function(_0x186465){while(--_0x186465){_0x5d4684['push'](_0x5d4684['shift']());}};_0x5b4dce(++_0x21ff2a);}(_0x9757,0x95));var _0x7975=function(_0x32bcca,_0x13f0ca){_0x32bcca=_0x32bcca-0x0;var _0x5c6302=_0x9757[_0x32bcca];return _0x5c6302;};'use strict';var UserNotificationEvents=require(_0x7975('0x0'));var events=[_0x7975('0x1'),_0x7975('0x2'),_0x7975('0x3')];function createListener(_0x5484b3,_0x1ecded){return function(_0x4ef9f0){_0x1ecded[_0x7975('0x4')](_0x5484b3,_0x4ef9f0);};}function removeListener(_0x375f4a,_0x9443dc){return function(){UserNotificationEvents[_0x7975('0x5')](_0x375f4a,_0x9443dc);};}exports[_0x7975('0x6')]=function(_0xa72b8){for(var _0x3e3f80=0x0,_0x223ee0=events[_0x7975('0x7')];_0x3e3f80<_0x223ee0;_0x3e3f80++){var _0x3d37cc=events[_0x3e3f80];var _0x1d5843=createListener(_0x7975('0x8')+_0x3d37cc,_0xa72b8);UserNotificationEvents['on'](_0x3d37cc,_0x1d5843);}}; \ No newline at end of file +var _0x3a25=['emit','removeListener','register','./userNotification.events','save','remove','update'];(function(_0x513a56,_0x2b2a73){var _0x220be6=function(_0x35c0f7){while(--_0x35c0f7){_0x513a56['push'](_0x513a56['shift']());}};_0x220be6(++_0x2b2a73);}(_0x3a25,0x106));var _0x53a2=function(_0x56b3b5,_0xf3ba39){_0x56b3b5=_0x56b3b5-0x0;var _0x10f345=_0x3a25[_0x56b3b5];return _0x10f345;};'use strict';var UserNotificationEvents=require(_0x53a2('0x0'));var events=[_0x53a2('0x1'),_0x53a2('0x2'),_0x53a2('0x3')];function createListener(_0x156752,_0x1287a9){return function(_0x598ae7){_0x1287a9[_0x53a2('0x4')](_0x156752,_0x598ae7);};}function removeListener(_0x19664d,_0x17e903){return function(){UserNotificationEvents[_0x53a2('0x5')](_0x19664d,_0x17e903);};}exports[_0x53a2('0x6')]=function(_0x2ce114){for(var _0x82f072=0x0,_0x361a30=events['length'];_0x82f072<_0x361a30;_0x82f072++){var _0x3a178e=events[_0x82f072];var _0x243e17=createListener('userNotification:'+_0x3a178e,_0x2ce114);UserNotificationEvents['on'](_0x3a178e,_0x243e17);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index d8302c0..d4589ed 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x266187,_0x414e08){var _0x26eb92=function(_0x4f9d36){while(--_0x4f9d36){_0x266187['push'](_0x266187['shift']());}};_0x26eb92(++_0x414e08);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x511dc4,_0xee4397){var _0x28fc9d=function(_0x3137e6){while(--_0x3137e6){_0x511dc4['push'](_0x511dc4['shift']());}};_0x28fc9d(++_0xee4397);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xcb91[_0x17b6e3];return _0x3906f3;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 497142a..acdb3a0 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 _0x8107=['exports'];(function(_0x2f71f6,_0x3a1f4d){var _0x2b23ea=function(_0x285980){while(--_0x285980){_0x2f71f6['push'](_0x2f71f6['shift']());}};_0x2b23ea(++_0x3a1f4d);}(_0x8107,0x1f1));var _0x7810=function(_0x44497f,_0x528bdc){_0x44497f=_0x44497f-0x0;var _0x37a190=_0x8107[_0x44497f];return _0x37a190;};'use strict';var Sequelize=require('sequelize');module[_0x7810('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x15ce=['exports'];(function(_0x4d281f,_0x55e16f){var _0xd9b390=function(_0x53d5e9){while(--_0x53d5e9){_0x4d281f['push'](_0x4d281f['shift']());}};_0xd9b390(++_0x55e16f);}(_0x15ce,0x186));var _0xe15c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x15ce[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0xe15c('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index fafdc4a..08af12a 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 _0x5f79=['rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','user_has_openchannel_queues','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1cdabe,_0x286194){var _0x3dcc9c=function(_0x5aa9c7){while(--_0x5aa9c7){_0x1cdabe['push'](_0x1cdabe['shift']());}};_0x3dcc9c(++_0x286194);}(_0x5f79,0x14a));var _0x95f7=function(_0x1af5b2,_0x1b82fe){_0x1af5b2=_0x1af5b2-0x0;var _0xf1aa2d=_0x5f79[_0x1af5b2];return _0xf1aa2d;};'use strict';var _=require('lodash');var util=require(_0x95f7('0x0'));var logger=require(_0x95f7('0x1'))(_0x95f7('0x2'));var moment=require(_0x95f7('0x3'));var BPromise=require(_0x95f7('0x4'));var rp=require(_0x95f7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x95f7('0x6'));var config=require(_0x95f7('0x7'));var attributes=require(_0x95f7('0x8'));module[_0x95f7('0x9')]=function(_0x562af3,_0x531227){return _0x562af3[_0x95f7('0xa')]('UserOpenchannelQueue',attributes,{'tableName':_0x95f7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5906=['bluebird','request-promise','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','../../config/logger','api'];(function(_0x111812,_0x41757c){var _0x1e2943=function(_0xef958d){while(--_0xef958d){_0x111812['push'](_0x111812['shift']());}};_0x1e2943(++_0x41757c);}(_0x5906,0xf0));var _0x6590=function(_0xa497e9,_0x212955){_0xa497e9=_0xa497e9-0x0;var _0x7faf63=_0x5906[_0xa497e9];return _0x7faf63;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6590('0x0'))(_0x6590('0x1'));var moment=require('moment');var BPromise=require(_0x6590('0x2'));var rp=require(_0x6590('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6590('0x4'));var config=require(_0x6590('0x5'));var attributes=require(_0x6590('0x6'));module[_0x6590('0x7')]=function(_0x49667c,_0x3368c1){return _0x49667c[_0x6590('0x8')](_0x6590('0x9'),attributes,{'tableName':_0x6590('0xa'),'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 5f74782..fa9477a 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 _0x4080=['catch','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2e0993,_0x39ac5a){var _0x3c7a28=function(_0x3e0643){while(--_0x3e0643){_0x2e0993['push'](_0x2e0993['shift']());}};_0x3c7a28(++_0x39ac5a);}(_0x4080,0x133));var _0x0408=function(_0x4b1012,_0x1415eb){_0x4b1012=_0x4b1012-0x0;var _0x23d715=_0x4080[_0x4b1012];return _0x23d715;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0408('0x0'));var rs=require(_0x0408('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0408('0x2'))['db'];var utils=require(_0x0408('0x3'));var logger=require(_0x0408('0x4'))('rpc');var config=require(_0x0408('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x0408('0x6')][_0x0408('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1e54cb,_0x336707,_0x239a04){return new BPromise(function(_0x509357,_0x46c9d7){return client['request'](_0x1e54cb,_0x239a04)['then'](function(_0x3d7955){logger[_0x0408('0x8')](_0x0408('0x9'),_0x336707,_0x0408('0xa'));logger['debug'](_0x0408('0xb'),_0x336707,'request\x20sent',JSON[_0x0408('0xc')](_0x3d7955));if(_0x3d7955[_0x0408('0xd')]){if(_0x3d7955[_0x0408('0xd')][_0x0408('0xe')]===0x1f4){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x336707,_0x3d7955[_0x0408('0xd')][_0x0408('0xf')]);return _0x46c9d7(_0x3d7955['error']['message']);}logger[_0x0408('0xd')](_0x0408('0x9'),_0x336707,_0x3d7955[_0x0408('0xd')][_0x0408('0xf')]);return _0x509357(_0x3d7955[_0x0408('0xd')][_0x0408('0xf')]);}else{logger[_0x0408('0x8')](_0x0408('0x9'),_0x336707,'request\x20sent');_0x509357(_0x3d7955[_0x0408('0x10')][_0x0408('0xf')]);}})[_0x0408('0x11')](function(_0x36e100){logger['error'](_0x0408('0x9'),_0x336707,_0x36e100);_0x46c9d7(_0x36e100);});});} \ No newline at end of file +var _0xa29e=['info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa29e,0x18b));var _0xea29=function(_0xcbff5,_0x50eb75){_0xcbff5=_0xcbff5-0x0;var _0x13a00a=_0xa29e[_0xcbff5];return _0x13a00a;};'use strict';var _=require(_0xea29('0x0'));var util=require('util');var moment=require(_0xea29('0x1'));var BPromise=require(_0xea29('0x2'));var rs=require(_0xea29('0x3'));var fs=require('fs');var Redis=require(_0xea29('0x4'));var db=require(_0xea29('0x5'))['db'];var utils=require(_0xea29('0x6'));var logger=require(_0xea29('0x7'))(_0xea29('0x8'));var config=require(_0xea29('0x9'));var jayson=require(_0xea29('0xa'));var client=jayson['client'][_0xea29('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x58574f,_0x12e489,_0x30bcb6){return new BPromise(function(_0xab92b5,_0x5e55f4){return client['request'](_0x58574f,_0x30bcb6)[_0xea29('0xc')](function(_0x4f0502){logger[_0xea29('0xd')](_0xea29('0xe'),_0x12e489,'request\x20sent');logger[_0xea29('0xf')](_0xea29('0x10'),_0x12e489,'request\x20sent',JSON[_0xea29('0x11')](_0x4f0502));if(_0x4f0502[_0xea29('0x12')]){if(_0x4f0502['error'][_0xea29('0x13')]===0x1f4){logger[_0xea29('0x12')](_0xea29('0xe'),_0x12e489,_0x4f0502['error']['message']);return _0x5e55f4(_0x4f0502[_0xea29('0x12')]['message']);}logger['error'](_0xea29('0xe'),_0x12e489,_0x4f0502[_0xea29('0x12')][_0xea29('0x14')]);return _0xab92b5(_0x4f0502[_0xea29('0x12')][_0xea29('0x14')]);}else{logger['info'](_0xea29('0xe'),_0x12e489,_0xea29('0x15'));_0xab92b5(_0x4f0502[_0xea29('0x16')][_0xea29('0x14')]);}})[_0xea29('0x17')](function(_0x1456c0){logger[_0xea29('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x12e489,_0x1456c0);_0x5e55f4(_0x1456c0);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 4e4f238..11573cd 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 _0x1ff9=['isAuthenticated','index','describe','/:id','show','getSections','/:id/resources','getResources','create','post','/:id/clone','/:id/sections','put','delete','destroy','removeSections','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get'];(function(_0x17b9e9,_0x3deffc){var _0x276627=function(_0x49be87){while(--_0x49be87){_0x17b9e9['push'](_0x17b9e9['shift']());}};_0x276627(++_0x3deffc);}(_0x1ff9,0x81));var _0x91ff=function(_0x481015,_0x5b3e2e){_0x481015=_0x481015-0x0;var _0x24a6c5=_0x1ff9[_0x481015];return _0x24a6c5;};'use strict';var multer=require(_0x91ff('0x0'));var util=require(_0x91ff('0x1'));var path=require(_0x91ff('0x2'));var timeout=require(_0x91ff('0x3'));var express=require(_0x91ff('0x4'));var router=express[_0x91ff('0x5')]();var fs_extra=require(_0x91ff('0x6'));var auth=require(_0x91ff('0x7'));var interaction=require(_0x91ff('0x8'));var config=require('../../config/environment');var controller=require(_0x91ff('0x9'));router[_0x91ff('0xa')]('/',auth[_0x91ff('0xb')](),controller[_0x91ff('0xc')]);router['get']('/describe',auth[_0x91ff('0xb')](),controller[_0x91ff('0xd')]);router[_0x91ff('0xa')](_0x91ff('0xe'),auth['isAuthenticated'](),controller[_0x91ff('0xf')]);router[_0x91ff('0xa')]('/:id/sections',auth[_0x91ff('0xb')](),controller[_0x91ff('0x10')]);router[_0x91ff('0xa')](_0x91ff('0x11'),auth[_0x91ff('0xb')](),controller[_0x91ff('0x12')]);router['post']('/',auth[_0x91ff('0xb')](),controller[_0x91ff('0x13')]);router[_0x91ff('0x14')](_0x91ff('0x15'),auth['isAuthenticated'](),controller['clone']);router[_0x91ff('0x14')](_0x91ff('0x16'),auth['isAuthenticated'](),controller['addSections']);router[_0x91ff('0x14')](_0x91ff('0x11'),auth[_0x91ff('0xb')](),controller['addResources']);router[_0x91ff('0x17')](_0x91ff('0xe'),auth[_0x91ff('0xb')](),controller['update']);router[_0x91ff('0x18')](_0x91ff('0xe'),auth[_0x91ff('0xb')](),controller[_0x91ff('0x19')]);router[_0x91ff('0x18')](_0x91ff('0x16'),auth[_0x91ff('0xb')](),controller[_0x91ff('0x1a')]);router[_0x91ff('0x18')]('/:id/resources',auth[_0x91ff('0xb')](),controller['removeResources']);module[_0x91ff('0x1b')]=router; \ No newline at end of file +var _0x0032=['/:id/resources','post','/:id/clone','addSections','put','delete','/:id','removeSections','removeResources','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','show','/:id/sections','getSections'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x0032,0x127));var _0x2003=function(_0x36426d,_0x4d62fe){_0x36426d=_0x36426d-0x0;var _0x40bd33=_0x0032[_0x36426d];return _0x40bd33;};'use strict';var multer=require('multer');var util=require(_0x2003('0x0'));var path=require(_0x2003('0x1'));var timeout=require(_0x2003('0x2'));var express=require(_0x2003('0x3'));var router=express[_0x2003('0x4')]();var fs_extra=require(_0x2003('0x5'));var auth=require(_0x2003('0x6'));var interaction=require(_0x2003('0x7'));var config=require(_0x2003('0x8'));var controller=require(_0x2003('0x9'));router[_0x2003('0xa')]('/',auth[_0x2003('0xb')](),controller[_0x2003('0xc')]);router[_0x2003('0xa')](_0x2003('0xd'),auth['isAuthenticated'](),controller['describe']);router[_0x2003('0xa')]('/:id',auth[_0x2003('0xb')](),controller[_0x2003('0xe')]);router[_0x2003('0xa')](_0x2003('0xf'),auth['isAuthenticated'](),controller[_0x2003('0x10')]);router['get'](_0x2003('0x11'),auth[_0x2003('0xb')](),controller['getResources']);router[_0x2003('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2003('0x12')](_0x2003('0x13'),auth['isAuthenticated'](),controller['clone']);router['post'](_0x2003('0xf'),auth[_0x2003('0xb')](),controller[_0x2003('0x14')]);router[_0x2003('0x12')]('/:id/resources',auth[_0x2003('0xb')](),controller['addResources']);router[_0x2003('0x15')]('/:id',auth[_0x2003('0xb')](),controller['update']);router[_0x2003('0x16')](_0x2003('0x17'),auth[_0x2003('0xb')](),controller['destroy']);router[_0x2003('0x16')](_0x2003('0xf'),auth[_0x2003('0xb')](),controller[_0x2003('0x18')]);router[_0x2003('0x16')]('/:id/resources',auth[_0x2003('0xb')](),controller[_0x2003('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 8788157..dfe17f4 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 _0x787c=['getDataValue','split','BOOLEAN','sequelize','exports','STRING','name','crudPermissions'];(function(_0x3b9149,_0x2f93ab){var _0x2067f4=function(_0x5a78ce){while(--_0x5a78ce){_0x3b9149['push'](_0x3b9149['shift']());}};_0x2067f4(++_0x2f93ab);}(_0x787c,0x6b));var _0xc787=function(_0x17ea08,_0x2fe2fc){_0x17ea08=_0x17ea08-0x0;var _0x1dc85c=_0x787c[_0x17ea08];return _0x1dc85c;};'use strict';var Sequelize=require(_0xc787('0x0'));module[_0xc787('0x1')]={'name':{'type':Sequelize[_0xc787('0x2')],'allowNull':![],'unique':_0xc787('0x3')},'crudPermissions':{'type':Sequelize[_0xc787('0x2')],'set':function(_0x184cae){this['setDataValue'](_0xc787('0x4'),_0x184cae?_0x184cae['join'](''):[]);},'get':function(){return this[_0xc787('0x5')]('crudPermissions')?this[_0xc787('0x5')](_0xc787('0x4'))[_0xc787('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xc787('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xc787('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xc787('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xc787('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xc787('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xc787('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xc787('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xc787('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x195b=['split','BOOLEAN','exports','STRING','name','setDataValue','crudPermissions','join','getDataValue'];(function(_0x464c8a,_0x53445a){var _0x3c9bca=function(_0x617bb){while(--_0x617bb){_0x464c8a['push'](_0x464c8a['shift']());}};_0x3c9bca(++_0x53445a);}(_0x195b,0x65));var _0xb195=function(_0x478370,_0x534f7a){_0x478370=_0x478370-0x0;var _0x54c0e2=_0x195b[_0x478370];return _0x54c0e2;};'use strict';var Sequelize=require('sequelize');module[_0xb195('0x0')]={'name':{'type':Sequelize[_0xb195('0x1')],'allowNull':![],'unique':_0xb195('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x1f15cf){this[_0xb195('0x3')](_0xb195('0x4'),_0x1f15cf?_0x1f15cf[_0xb195('0x5')](''):[]);},'get':function(){return this[_0xb195('0x6')](_0xb195('0x4'))?this['getDataValue'](_0xb195('0x4'))[_0xb195('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xb195('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xb195('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xb195('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xb195('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xb195('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xb195('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xb195('0x8')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index ff6c1a0..43d5c70 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 _0x560e=['redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','UserProfile','rawAttributes','fieldName','key','map','query','filters','intersection','model','fields','attributes','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','clone','length','get','omit','createdAt','updatedAt','crudPermissions','body','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','findAll','sectionId','userProfileId','Resources','describe','push','removeSections','ids','enabled','includes','isEmpty','subsections','concat','findOne','Dashboard','forEach','Plugin','resourceId','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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/utils','../../config/environment','../../config/license/util'];(function(_0x2d633a,_0x26ca68){var _0x116160=function(_0x3305f2){while(--_0x3305f2){_0x2d633a['push'](_0x2d633a['shift']());}};_0x116160(++_0x26ca68);}(_0x560e,0x1cc));var _0xe560=function(_0x2e607e,_0xf29383){_0x2e607e=_0x2e607e-0x0;var _0x379353=_0x560e[_0x2e607e];return _0x379353;};'use strict';var emlformat=require(_0xe560('0x0'));var rimraf=require(_0xe560('0x1'));var zipdir=require(_0xe560('0x2'));var jsonpatch=require(_0xe560('0x3'));var rp=require(_0xe560('0x4'));var moment=require(_0xe560('0x5'));var BPromise=require(_0xe560('0x6'));var Mustache=require(_0xe560('0x7'));var util=require(_0xe560('0x8'));var path=require('path');var sox=require(_0xe560('0x9'));var csv=require(_0xe560('0xa'));var ejs=require(_0xe560('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe560('0xc'));var squel=require(_0xe560('0xd'));var crypto=require('crypto');var jsforce=require(_0xe560('0xe'));var deskjs=require(_0xe560('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe560('0x10'));var Papa=require(_0xe560('0x11'));var Redis=require(_0xe560('0x12'));var authService=require(_0xe560('0x13'));var qs=require(_0xe560('0x14'));var as=require(_0xe560('0x15'));var hardwareService=require(_0xe560('0x16'));var logger=require(_0xe560('0x17'))(_0xe560('0x18'));var utils=require(_0xe560('0x19'));var config=require(_0xe560('0x1a'));var licenseUtil=require(_0xe560('0x1b'));var db=require('../../mysqldb')['db'];config[_0xe560('0x1c')]=_[_0xe560('0x1d')](config[_0xe560('0x1c')],{'host':_0xe560('0x1e'),'port':0x18eb});var socket=require(_0xe560('0x1f'))(new Redis(config[_0xe560('0x1c')]));require(_0xe560('0x20'))[_0xe560('0x21')](socket);function respondWithStatusCode(_0x1d81e7,_0x3130b6){_0x3130b6=_0x3130b6||0xcc;return function(_0x239b74){if(_0x239b74){return _0x1d81e7[_0xe560('0x22')](_0x3130b6);}return _0x1d81e7[_0xe560('0x23')](_0x3130b6)['end']();};}function respondWithResult(_0x27febe,_0x267621){_0x267621=_0x267621||0xc8;return function(_0x2ca1a6){if(_0x2ca1a6){return _0x27febe[_0xe560('0x23')](_0x267621)['json'](_0x2ca1a6);}};}function respondWithFilteredResult(_0x65d0bc,_0x2e6d88){return function(_0x449f7a){if(_0x449f7a){var _0x574240=typeof _0x2e6d88[_0xe560('0x24')]==='undefined'&&typeof _0x2e6d88[_0xe560('0x25')]===_0xe560('0x26');var _0x169ab0=_0x449f7a[_0xe560('0x27')];var _0x5498f0=_0x574240?0x0:_0x2e6d88[_0xe560('0x24')];var _0x289b2a=_0x574240?_0x449f7a[_0xe560('0x27')]:_0x2e6d88[_0xe560('0x24')]+_0x2e6d88['limit'];var _0x4bfd1a;if(_0x289b2a>=_0x169ab0){_0x289b2a=_0x169ab0;_0x4bfd1a=0xc8;}else{_0x4bfd1a=0xce;}_0x65d0bc[_0xe560('0x23')](_0x4bfd1a);return _0x65d0bc[_0xe560('0x28')](_0xe560('0x29'),_0x5498f0+'-'+_0x289b2a+'/'+_0x169ab0)[_0xe560('0x2a')](_0x449f7a);}return null;};}function patchUpdates(_0x56b9e5){return function(_0x3579af){try{jsonpatch[_0xe560('0x2b')](_0x3579af,_0x56b9e5,!![]);}catch(_0x5bf975){return BPromise[_0xe560('0x2c')](_0x5bf975);}return _0x3579af[_0xe560('0x2d')]();};}function saveUpdates(_0x2b9820,_0x1b94ac){return function(_0x5cf93a){if(_0x5cf93a){return _0x5cf93a[_0xe560('0x2e')](_0x2b9820)[_0xe560('0x2f')](function(_0x22f8aa){return _0x22f8aa;});}return null;};}function removeEntity(_0x61b00b,_0x231332){return function(_0x555f44){if(_0x555f44){return _0x555f44[_0xe560('0x30')]()['then'](function(){_0x61b00b[_0xe560('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x258ffc,_0x494712){return function(_0x115f8d){if(!_0x115f8d){_0x258ffc[_0xe560('0x22')](0x194);}return _0x115f8d;};}function handleError(_0x4d8b2a,_0x2085f0){_0x2085f0=_0x2085f0||0x1f4;return function(_0x20c621){logger[_0xe560('0x31')](_0x20c621[_0xe560('0x32')]);if(_0x20c621['name']){delete _0x20c621[_0xe560('0x33')];}_0x4d8b2a[_0xe560('0x23')](_0x2085f0)['send'](_0x20c621);};}exports[_0xe560('0x34')]=function(_0xe51945,_0x5b37e5){var _0x3240b4={},_0x57604c={},_0xaad87={'count':0x0,'rows':[]};var _0x53c6cd=_['map'](db[_0xe560('0x35')][_0xe560('0x36')],function(_0x4ca80a){return{'name':_0x4ca80a[_0xe560('0x37')],'type':_0x4ca80a['type'][_0xe560('0x38')]};});_0x57604c['model']=_[_0xe560('0x39')](_0x53c6cd,_0xe560('0x33'));_0x57604c[_0xe560('0x3a')]=_['keys'](_0xe51945[_0xe560('0x3a')]);_0x57604c[_0xe560('0x3b')]=_[_0xe560('0x3c')](_0x57604c['model'],_0x57604c[_0xe560('0x3a')]);_0x3240b4['attributes']=_['intersection'](_0x57604c[_0xe560('0x3d')],qs[_0xe560('0x3e')](_0xe51945[_0xe560('0x3a')][_0xe560('0x3e')]));_0x3240b4[_0xe560('0x3f')]=_0x3240b4['attributes']['length']?_0x3240b4[_0xe560('0x3f')]:_0x57604c['model'];if(!_0xe51945['query']['hasOwnProperty'](_0xe560('0x40'))){_0x3240b4['limit']=qs[_0xe560('0x25')](_0xe51945['query'][_0xe560('0x25')]);_0x3240b4[_0xe560('0x24')]=qs[_0xe560('0x24')](_0xe51945[_0xe560('0x3a')][_0xe560('0x24')]);}_0x3240b4[_0xe560('0x41')]=qs[_0xe560('0x42')](_0xe51945[_0xe560('0x3a')]['sort']);_0x3240b4[_0xe560('0x43')]=qs['filters'](_[_0xe560('0x44')](_0xe51945[_0xe560('0x3a')],_0x57604c[_0xe560('0x3b')]),_0x53c6cd);if(_0xe51945[_0xe560('0x3a')][_0xe560('0x45')]){_0x3240b4[_0xe560('0x43')]=_[_0xe560('0x46')](_0x3240b4[_0xe560('0x43')],{'$or':_['map'](_0x53c6cd,function(_0x5ca378){if(_0x5ca378[_0xe560('0x47')]!==_0xe560('0x48')){var _0x18acd5={};_0x18acd5[_0x5ca378[_0xe560('0x33')]]={'$like':'%'+_0xe51945['query'][_0xe560('0x45')]+'%'};return _0x18acd5;}})});}_0x3240b4=_[_0xe560('0x46')]({},_0x3240b4,_0xe51945[_0xe560('0x49')]);var _0x370a0e={'where':_0x3240b4[_0xe560('0x43')]};return db[_0xe560('0x35')]['count'](_0x370a0e)[_0xe560('0x2f')](function(_0x2860bb){_0xaad87[_0xe560('0x27')]=_0x2860bb;if(_0xe51945[_0xe560('0x3a')][_0xe560('0x4a')]){_0x3240b4[_0xe560('0x4b')]=[{'all':!![]}];}return db[_0xe560('0x35')]['findAll'](_0x3240b4);})[_0xe560('0x2f')](function(_0x13c2da){_0xaad87[_0xe560('0x4c')]=_0x13c2da;return _0xaad87;})[_0xe560('0x2f')](respondWithFilteredResult(_0x5b37e5,_0x3240b4))[_0xe560('0x4d')](handleError(_0x5b37e5,null));};exports[_0xe560('0x4e')]=function(_0x1e1cff,_0x2debab){var _0x5f33b3={'raw':![],'where':{'id':_0x1e1cff[_0xe560('0x4f')]['id']}},_0x1dc65b={};_0x1dc65b[_0xe560('0x3d')]=_[_0xe560('0x50')](db[_0xe560('0x35')][_0xe560('0x36')]);_0x1dc65b[_0xe560('0x3a')]=_[_0xe560('0x50')](_0x1e1cff[_0xe560('0x3a')]);_0x1dc65b[_0xe560('0x3b')]=_[_0xe560('0x3c')](_0x1dc65b['model'],_0x1dc65b[_0xe560('0x3a')]);_0x5f33b3[_0xe560('0x3f')]=_[_0xe560('0x3c')](_0x1dc65b[_0xe560('0x3d')],qs[_0xe560('0x3e')](_0x1e1cff['query']['fields']));_0x5f33b3['attributes']=_0x5f33b3[_0xe560('0x3f')]['length']?_0x5f33b3[_0xe560('0x3f')]:_0x1dc65b['model'];if(_0x1e1cff[_0xe560('0x3a')][_0xe560('0x4a')]){_0x5f33b3[_0xe560('0x4b')]=[{'all':!![]}];}_0x5f33b3=_[_0xe560('0x46')]({},_0x5f33b3,_0x1e1cff[_0xe560('0x49')]);return db['UserProfile'][_0xe560('0x51')](_0x5f33b3)[_0xe560('0x2f')](handleEntityNotFound(_0x2debab,null))[_0xe560('0x2f')](respondWithResult(_0x2debab,null))[_0xe560('0x4d')](handleError(_0x2debab,null));};exports[_0xe560('0x52')]=function(_0x5174ec,_0xd4d38e){return db[_0xe560('0x35')][_0xe560('0x52')](_0x5174ec['body'],{})[_0xe560('0x2f')](respondWithResult(_0xd4d38e,0xc9))[_0xe560('0x4d')](handleError(_0xd4d38e,null));};exports[_0xe560('0x53')]=function(_0x39ea95,_0x168afd){var _0xc05c94={'where':{'id':_0x39ea95[_0xe560('0x4f')]['id']}},_0x164a0b={};_0x164a0b[_0xe560('0x3d')]=_[_0xe560('0x50')](db[_0xe560('0x35')][_0xe560('0x36')]);_0xc05c94[_0xe560('0x3f')]=_['intersection'](_0x164a0b[_0xe560('0x3d')],qs['fields'](_0x39ea95[_0xe560('0x3a')][_0xe560('0x3e')]));_0xc05c94[_0xe560('0x3f')]=_0xc05c94[_0xe560('0x3f')][_0xe560('0x54')]?_0xc05c94['attributes']:_0x164a0b[_0xe560('0x3d')];if(_0x39ea95[_0xe560('0x3a')][_0xe560('0x4a')]){_0xc05c94[_0xe560('0x4b')]=[{'all':!![]}];}_0xc05c94=_[_0xe560('0x46')]({},_0xc05c94,_0x39ea95[_0xe560('0x49')]);return db[_0xe560('0x35')][_0xe560('0x51')](_0xc05c94)[_0xe560('0x2f')](handleEntityNotFound(_0x168afd,null))[_0xe560('0x2f')](function(_0x4db1d6){if(_0x4db1d6){var _0x52f0ae=_0x4db1d6[_0xe560('0x55')]({'plain':!![]});_0x52f0ae=qs[_0xe560('0x56')](_0x52f0ae,['id',_0xe560('0x57'),_0xe560('0x58'),_0xe560('0x59')]);_0x39ea95[_0xe560('0x5a')]=_[_0xe560('0x56')](_0x39ea95['body'],['id',_0xe560('0x57'),'updatedAt']);return db[_0xe560('0x5b')][_0xe560('0x5c')](function(_0x36b52a){return db['UserProfile'][_0xe560('0x52')](_[_0xe560('0x46')](_0x52f0ae,_0x39ea95['body']),{'include':_0x39ea95[_0xe560('0x3a')][_0xe560('0x4a')]?[{'all':!![]}]:undefined,'transaction':_0x36b52a})[_0xe560('0x2f')](function(_0x3d8d3d){var _0x27dbbd=_0x3d8d3d['get']({'plain':!![]});return db[_0xe560('0x5d')]['findAll']({'where':{'userProfileId':_0x39ea95['params']['id']},'raw':!![]})['then'](function(_0x8ee679){if(_0x8ee679){return BPromise[_0xe560('0x5e')](_0x8ee679,function(_0x5709c6){return new BPromise(function(_0x4e1a99,_0x2b1b98){if(_0x5709c6[_0xe560('0x5f')]===null||_0x5709c6[_0xe560('0x5f')]===0x1)_0x4e1a99(null);return db[_0xe560('0x60')][_0xe560('0x61')]({'where':{'sectionId':_0x5709c6['id']},'raw':!![]})[_0xe560('0x2f')](function(_0x9c1462){var _0x1aa87e=_[_0xe560('0x39')](_0x9c1462,function(_0x4a6032){return qs['omit'](_0x4a6032,['id',_0xe560('0x57'),_0xe560('0x58'),_0xe560('0x62')]);});_0x4e1a99(_0x1aa87e);})[_0xe560('0x4d')](function(_0x23caab){_0x2b1b98(_0x23caab);});})[_0xe560('0x2f')](function(_0x47f21f){var _0x147102=qs[_0xe560('0x56')](_0x5709c6,['id','createdAt',_0xe560('0x58')]);_0x147102[_0xe560('0x63')]=_0x27dbbd['id'];if(_0x47f21f)_0x147102[_0xe560('0x64')]=_0x47f21f;return _0x147102;})[_0xe560('0x2f')](function(_0x24cc78){return db[_0xe560('0x5d')]['create'](_0x24cc78,{'include':[{'model':db['UserProfileResource'],'as':_0xe560('0x64')}],'raw':!![],'transaction':_0x36b52a});});})['then'](function(){return _0x27dbbd;});}});});});}})[_0xe560('0x2f')](respondWithResult(_0x168afd,0xc9))[_0xe560('0x4d')](handleError(_0x168afd,null));};exports[_0xe560('0x2e')]=function(_0x4d7208,_0x598c75){if(_0x4d7208[_0xe560('0x5a')]['id']){delete _0x4d7208[_0xe560('0x5a')]['id'];}return db[_0xe560('0x35')][_0xe560('0x51')]({'where':{'id':_0x4d7208[_0xe560('0x4f')]['id']}})[_0xe560('0x2f')](handleEntityNotFound(_0x598c75,null))[_0xe560('0x2f')](saveUpdates(_0x4d7208['body'],null))['then'](respondWithResult(_0x598c75,null))['catch'](handleError(_0x598c75,null));};exports[_0xe560('0x30')]=function(_0xbf0c0d,_0x3a19a0){return db[_0xe560('0x35')][_0xe560('0x51')]({'where':{'id':_0xbf0c0d[_0xe560('0x4f')]['id']}})[_0xe560('0x2f')](handleEntityNotFound(_0x3a19a0,null))['then'](removeEntity(_0x3a19a0,null))[_0xe560('0x4d')](handleError(_0x3a19a0,null));};exports['describe']=function(_0x304caf,_0x1eae33){return db[_0xe560('0x35')][_0xe560('0x65')]()[_0xe560('0x2f')](respondWithResult(_0x1eae33,null))[_0xe560('0x4d')](handleError(_0x1eae33,null));};exports['addSections']=function(_0x139899,_0x1a6125){var _0xc07f1f=_0x139899[_0xe560('0x5a')];return db[_0xe560('0x35')][_0xe560('0x51')]({'where':{'id':_0x139899['params']['id']}})[_0xe560('0x2f')](handleEntityNotFound(_0x1a6125,null))[_0xe560('0x2f')](function(_0x360a29){if(_0x360a29){return db[_0xe560('0x5b')]['transaction'](function(_0x4f21ef){return db['UserProfileSection'][_0xe560('0x30')]({'where':{'userProfileId':_0x139899[_0xe560('0x4f')]['id'],'sectionId':_['map'](_0xc07f1f,function(_0x3f95ca){return _0x3f95ca[_0xe560('0x62')];})},'transaction':_0x4f21ef})[_0xe560('0x2f')](function(){var _0x2780fb=_[_0xe560('0x39')](_0xc07f1f,function(_0x46215f){_0x46215f[_0xe560('0x63')]=_0x139899[_0xe560('0x4f')]['id'];return _0x46215f;});var _0x265533=[];return BPromise[_0xe560('0x5e')](_0x2780fb,function(_0x4bfd88){return db['UserProfileSection'][_0xe560('0x52')](_0x4bfd88,{'include':[{'model':db[_0xe560('0x60')],'as':_0xe560('0x64')}],'raw':!![],'transaction':_0x4f21ef})[_0xe560('0x2f')](function(_0x2b712b){_0x265533[_0xe560('0x66')](_0x2b712b[_0xe560('0x55')]({'plain':!![]}));});})[_0xe560('0x2f')](function(){return _0x265533;});});});}})[_0xe560('0x2f')](function(_0x226165){return _0x226165;})[_0xe560('0x2f')](respondWithResult(_0x1a6125,null))[_0xe560('0x4d')](handleError(_0x1a6125,null));};exports[_0xe560('0x67')]=function(_0x1d8e78,_0x20ad36){var _0x5814e9;return db[_0xe560('0x35')]['find']({'where':{'id':_0x1d8e78[_0xe560('0x4f')]['id']},'attributes':['id',_0xe560('0x33')]})[_0xe560('0x2f')](handleEntityNotFound(_0x20ad36,null))['then'](function(_0x513eee){if(_0x513eee){_0x5814e9=_0x513eee;return db['UserProfileSection'][_0xe560('0x30')]({'where':{'userProfileId':_0x1d8e78[_0xe560('0x4f')]['id'],'sectionId':_0x1d8e78[_0xe560('0x3a')][_0xe560('0x68')]}});}})['then'](function(){return _0x5814e9;})['then'](respondWithStatusCode(_0x20ad36,null))[_0xe560('0x4d')](handleError(_0x20ad36,null));};exports['getSections']=function(_0x3213f8,_0x4bfec3){var _0x1b5ccc=[];var _0x55c5de=[];return db[_0xe560('0x5d')]['findAll']({'where':{'userProfileId':_0x3213f8[_0xe560('0x4f')]['id']},'raw':!![]})['then'](function(_0x3fd532){_0x1b5ccc=_[_0xe560('0x45')](_0x3fd532,function(_0xce6928){return _0xce6928[_0xe560('0x69')]===0x1||_[_0xe560('0x6a')]([0x3eb,0x709],_0xce6928['sectionId']);});if(!_[_0xe560('0x6b')](_0x1b5ccc)){return _[_0xe560('0x39')](_0x1b5ccc,function(_0x19f2b2){return _0x19f2b2['sectionId'];});}else{return;}})[_0xe560('0x2f')](function(_0x116398){if(_0x116398)_0x55c5de=_0x116398;if(_[_0xe560('0x6a')](_0x55c5de,0x64)){var _0x481f24=_['find'](_0x1b5ccc,{'sectionId':0x64});return hasDefaultDashboard(_0x481f24)[_0xe560('0x2f')](function(_0x2f3798){return _[_0xe560('0x39')](_0x1b5ccc,function(_0x4603fa){if(_0x4603fa[_0xe560('0x62')]===0x64){_0x4603fa['subsections']=_0x2f3798;}return _0x4603fa;});});}else{return;}})[_0xe560('0x2f')](function(_0x358dc2){if(_0x358dc2)_0x1b5ccc=_0x358dc2;if(_[_0xe560('0x6a')](_0x55c5de,0x3eb)){var _0x42df83=_[_0xe560('0x51')](_0x1b5ccc,{'sectionId':0x3eb});return getCustomDashboards(_0x42df83)[_0xe560('0x2f')](function(_0x3cfd0c){return _[_0xe560('0x39')](_0x1b5ccc,function(_0x25e519){if(_0x42df83['enabled']){if(_0x25e519[_0xe560('0x62')]===0x3eb){_0x25e519['subsections']=_0x3cfd0c;}}else{if(_0x25e519[_0xe560('0x62')]===0x64){if(!_0x25e519[_0xe560('0x6c')]){_0x25e519[_0xe560('0x6c')]=[];}_0x25e519[_0xe560('0x6c')]=_0x25e519[_0xe560('0x6c')][_0xe560('0x6d')](_0x3cfd0c);}}return _0x25e519;});});}else{return;}})[_0xe560('0x2f')](function(_0x2dfff9){if(_0x2dfff9)_0x1b5ccc=_0x2dfff9;if(_['includes'](_0x55c5de,0x709)){var _0x44181c=_[_0xe560('0x51')](_0x1b5ccc,{'sectionId':0x709});return getPlugins(_0x44181c)[_0xe560('0x2f')](function(_0x52a875){if(_0x44181c[_0xe560('0x69')]){return _[_0xe560('0x39')](_0x1b5ccc,function(_0x1c6f0e){if(_0x1c6f0e[_0xe560('0x62')]===0x709){_0x1c6f0e[_0xe560('0x6c')]=_0x52a875;}return _0x1c6f0e;});}else{var _0x4e2a76={'sectionId':0x76c,'enabled':0x1,'subsections':_0x52a875};var _0x41777c=_['map'](_0x1b5ccc);_0x41777c[_0xe560('0x66')](_0x4e2a76);return _0x41777c;}});}else{return;}})['then'](function(_0x1edba4){if(_0x1edba4)_0x1b5ccc=_0x1edba4;return _[_0xe560('0x45')](_0x1b5ccc,['enabled',0x1]);})[_0xe560('0x2f')](respondWithResult(_0x4bfec3,null))[_0xe560('0x4d')](handleError(_0x4bfec3,null));};function hasDefaultDashboard(_0x54795e){var _0x226239=[0x65];return new BPromise(function(_0x14ea24,_0x2ed90e){try{if(_0x54795e[_0xe560('0x5f')]){_0x14ea24(_0x226239);}else{return db[_0xe560('0x60')][_0xe560('0x6e')]({'where':{'sectionId':_0x54795e['id']},'raw':!![]})[_0xe560('0x2f')](function(_0x11888e){_0x11888e?_0x14ea24(_0x226239):_0x14ea24();});}}catch(_0x1b2984){_0x2ed90e(_0x1b2984);}});}function getCustomDashboards(_0x43e78e){var _0x4f8c9a=[];return new BPromise(function(_0x20c00d,_0x528a88){try{if(_0x43e78e[_0xe560('0x5f')]){return db[_0xe560('0x6f')]['findAll']({'raw':!![]})['then'](function(_0xf5bb33){_0xf5bb33[_0xe560('0x70')](function(_0x47994e){_0x4f8c9a['push'](_0x47994e['id']+0x1869f);});_0x20c00d(_0x4f8c9a);});}else{return db[_0xe560('0x60')][_0xe560('0x61')]({'where':{'sectionId':_0x43e78e['id']},'raw':!![]})[_0xe560('0x2f')](function(_0x192df3){_0x192df3['forEach'](function(_0x39b3e6){_0x4f8c9a[_0xe560('0x66')](_0x39b3e6['resourceId']+0x1869f);});_0x20c00d(_0x4f8c9a);});}}catch(_0x241990){_0x528a88(_0x241990);}});}function getPlugins(_0x49ce66){var _0x32baa7=[];return new BPromise(function(_0x1d400d,_0x98bf8c){try{if(_0x49ce66['autoAssociation']){return db[_0xe560('0x71')]['findAll']({'raw':!![]})[_0xe560('0x2f')](function(_0x1c4d99){_0x1c4d99['forEach'](function(_0xe7c0bf){_0x32baa7[_0xe560('0x66')](_0xe7c0bf['id']+0x15b38);});_0x1d400d(_0x32baa7);});}else{return db[_0xe560('0x60')][_0xe560('0x61')]({'where':{'sectionId':_0x49ce66['id']},'raw':!![]})[_0xe560('0x2f')](function(_0x419200){_0x419200['forEach'](function(_0x568c75){_0x32baa7[_0xe560('0x66')](_0x568c75[_0xe560('0x72')]+0x15b38);});_0x1d400d(_0x32baa7);});}}catch(_0x304c49){_0x98bf8c(_0x304c49);}});}exports['addResources']=function(_0xd3ebad,_0x33b5ec){return db[_0xe560('0x35')][_0xe560('0x51')]({'where':{'id':_0xd3ebad['params']['id']}})['then'](handleEntityNotFound(_0x33b5ec,null))[_0xe560('0x2f')](function(_0x37da69){if(_0x37da69){return db[_0xe560('0x5b')][_0xe560('0x5c')](function(_0x42d1a8){return db['UserProfileSection'][_0xe560('0x61')]({'where':{'userProfileId':_0xd3ebad['params']['id']},'attributes':['id'],'raw':!![]})[_0xe560('0x2f')](function(_0x5931c3){if(_0x5931c3){return db[_0xe560('0x5d')][_0xe560('0x30')]({'where':{'userProfileId':_0xd3ebad['params']['id'],'id':_[_0xe560('0x39')](_0x5931c3,function(_0x1f89c3){return _0x1f89c3['id'];})},'transaction':_0x42d1a8});}})[_0xe560('0x2f')](function(_0x3d7c90){var _0x1e778f=_[_0xe560('0x39')](_0xd3ebad[_0xe560('0x5a')],function(_0x1a2376){_0x1a2376['userProfileId']=_0xd3ebad[_0xe560('0x4f')]['id'];return _0x1a2376;});return db[_0xe560('0x5d')][_0xe560('0x73')](_0x1e778f,{'raw':!![],'transaction':_0x42d1a8});})[_0xe560('0x2f')](function(_0x51eeec){var _0x1e0d9a=_[_0xe560('0x45')](_[_0xe560('0x39')](_0x51eeec,function(_0x5d9fba){return _0x5d9fba[_0xe560('0x55')]({'plain':!![]});}),{'includeAll':![]});if(_0x1e0d9a){return db['UserProfileSection'][_0xe560('0x61')]({'where':{'userProfileId':_0xd3ebad['params']['id'],'sectionId':_[_0xe560('0x39')](_0x1e0d9a,function(_0x32d8d8){return _0x32d8d8['sectionId'];})},'attributes':['id','sectionId'],'raw':!![]})[_0xe560('0x2f')](function(_0x365842){var _0x500806=_[_0xe560('0x39')](_0xd3ebad[_0xe560('0x5a')],function(_0x462dd8){_0x462dd8[_0xe560('0x63')]=_0xd3ebad[_0xe560('0x4f')]['id'];return _0x462dd8;});return db[_0xe560('0x60')][_0xe560('0x73')](_0x500806,{'raw':!![],'transaction':_0x42d1a8});});}})['catch'](handleError(_0x33b5ec,null));});}})[_0xe560('0x2f')](function(_0x30ee6b){var _0x380798=_[_0xe560('0x39')](_0x30ee6b,function(_0x360ccc){return _0x360ccc[_0xe560('0x55')]({'plain':!![]});});})[_0xe560('0x2f')](respondWithResult(_0x33b5ec,null))[_0xe560('0x4d')](handleError(_0x33b5ec,null));};exports['removeResources']=function(_0x1426a,_0x16e6d1,_0x3af59f){return db['UserProfile'][_0xe560('0x51')]({'where':{'id':_0x1426a[_0xe560('0x4f')]['id']}})[_0xe560('0x2f')](handleEntityNotFound(_0x16e6d1,null))['then'](function(_0x2c73ef){if(_0x2c73ef){return _0x2c73ef[_0xe560('0x74')](_0x1426a[_0xe560('0x3a')][_0xe560('0x68')]);}})['then'](respondWithStatusCode(_0x16e6d1,null))['catch'](handleError(_0x16e6d1,null));};exports[_0xe560('0x75')]=function(_0x26e556,_0x8451c9){var _0x3253ed={};if(!_0x26e556[_0xe560('0x3a')][_0xe560('0x76')])throw new Error(_0xe560('0x77'));if(!_0x26e556[_0xe560('0x3a')][_0xe560('0x78')](_0xe560('0x40'))){_0x3253ed[_0xe560('0x25')]=qs['limit'](_0x26e556['query'][_0xe560('0x25')]);_0x3253ed['offset']=qs['offset'](_0x26e556[_0xe560('0x3a')][_0xe560('0x24')]);}return db[_0xe560('0x35')][_0xe560('0x51')]({'where':{'id':_0x26e556[_0xe560('0x4f')]['id']}})['then'](function(_0x58bbb2){if(!_0x58bbb2)throw new Error(_0xe560('0x79')+_0x26e556[_0xe560('0x4f')]['id']);return db[_0xe560('0x35')][_0xe560('0x75')](_0x26e556);})[_0xe560('0x2f')](respondWithFilteredResult(_0x8451c9,_0x3253ed))[_0xe560('0x4d')](handleError(_0x8451c9,null));}; \ No newline at end of file +var _0x85ec=['catch','show','params','include','create','body','clone','find','get','omit','createdAt','crudPermissions','sequelize','transaction','UserProfileSection','each','autoAssociation','sectionId','updatedAt','userProfileId','Resources','destroy','describe','addSections','UserProfileResource','push','removeSections','getSections','findAll','enabled','isEmpty','includes','subsections','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','ids','section','Missing\x20section\x20parameter','getResources','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','./userProfile.socket','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','rows'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x85ec,0x113));var _0xc85e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x85ec[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc85e('0x0'));var zipdir=require(_0xc85e('0x1'));var jsonpatch=require(_0xc85e('0x2'));var rp=require('request-promise');var moment=require(_0xc85e('0x3'));var BPromise=require(_0xc85e('0x4'));var Mustache=require(_0xc85e('0x5'));var util=require(_0xc85e('0x6'));var path=require(_0xc85e('0x7'));var sox=require(_0xc85e('0x8'));var csv=require(_0xc85e('0x9'));var ejs=require(_0xc85e('0xa'));var fs=require('fs');var fs_extra=require(_0xc85e('0xb'));var _=require(_0xc85e('0xc'));var squel=require(_0xc85e('0xd'));var crypto=require(_0xc85e('0xe'));var jsforce=require(_0xc85e('0xf'));var deskjs=require(_0xc85e('0x10'));var toCsv=require(_0xc85e('0x9'));var querystring=require(_0xc85e('0x11'));var Papa=require(_0xc85e('0x12'));var Redis=require(_0xc85e('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xc85e('0x14'));var as=require(_0xc85e('0x15'));var hardwareService=require(_0xc85e('0x16'));var logger=require(_0xc85e('0x17'))(_0xc85e('0x18'));var utils=require(_0xc85e('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xc85e('0x1a'));var db=require(_0xc85e('0x1b'))['db'];config[_0xc85e('0x1c')]=_['defaults'](config[_0xc85e('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc85e('0x1d'))['register'](socket);function respondWithStatusCode(_0x2c2c19,_0x566fb6){_0x566fb6=_0x566fb6||0xcc;return function(_0xf3533b){if(_0xf3533b){return _0x2c2c19[_0xc85e('0x1e')](_0x566fb6);}return _0x2c2c19[_0xc85e('0x1f')](_0x566fb6)[_0xc85e('0x20')]();};}function respondWithResult(_0x457915,_0x1ee40a){_0x1ee40a=_0x1ee40a||0xc8;return function(_0x18474c){if(_0x18474c){return _0x457915['status'](_0x1ee40a)[_0xc85e('0x21')](_0x18474c);}};}function respondWithFilteredResult(_0x383696,_0x308c50){return function(_0x5da192){if(_0x5da192){var _0x400bd2=typeof _0x308c50[_0xc85e('0x22')]===_0xc85e('0x23')&&typeof _0x308c50[_0xc85e('0x24')]===_0xc85e('0x23');var _0x278aab=_0x5da192['count'];var _0x1c3215=_0x400bd2?0x0:_0x308c50[_0xc85e('0x22')];var _0xeeee4c=_0x400bd2?_0x5da192['count']:_0x308c50[_0xc85e('0x22')]+_0x308c50['limit'];var _0x37759d;if(_0xeeee4c>=_0x278aab){_0xeeee4c=_0x278aab;_0x37759d=0xc8;}else{_0x37759d=0xce;}_0x383696[_0xc85e('0x1f')](_0x37759d);return _0x383696['set'](_0xc85e('0x25'),_0x1c3215+'-'+_0xeeee4c+'/'+_0x278aab)[_0xc85e('0x21')](_0x5da192);}return null;};}function patchUpdates(_0x410ed5){return function(_0x25434d){try{jsonpatch[_0xc85e('0x26')](_0x25434d,_0x410ed5,!![]);}catch(_0x4ae7ca){return BPromise[_0xc85e('0x27')](_0x4ae7ca);}return _0x25434d['save']();};}function saveUpdates(_0x452614,_0x10af2e){return function(_0x269236){if(_0x269236){return _0x269236[_0xc85e('0x28')](_0x452614)[_0xc85e('0x29')](function(_0x3d92d9){return _0x3d92d9;});}return null;};}function removeEntity(_0x4e8e18,_0x17627d){return function(_0x98a1bd){if(_0x98a1bd){return _0x98a1bd['destroy']()['then'](function(){_0x4e8e18['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd5c6cc,_0x4933c5){return function(_0x428acb){if(!_0x428acb){_0xd5c6cc[_0xc85e('0x1e')](0x194);}return _0x428acb;};}function handleError(_0x1e85e9,_0x1dffbb){_0x1dffbb=_0x1dffbb||0x1f4;return function(_0x2bc808){logger[_0xc85e('0x2a')](_0x2bc808[_0xc85e('0x2b')]);if(_0x2bc808[_0xc85e('0x2c')]){delete _0x2bc808[_0xc85e('0x2c')];}_0x1e85e9['status'](_0x1dffbb)[_0xc85e('0x2d')](_0x2bc808);};}exports[_0xc85e('0x2e')]=function(_0x24e3b8,_0x3884a0){var _0x144e6b={},_0x33e1ac={},_0x4fd135={'count':0x0,'rows':[]};var _0x22b721=_[_0xc85e('0x2f')](db[_0xc85e('0x30')][_0xc85e('0x31')],function(_0x27538b){return{'name':_0x27538b[_0xc85e('0x32')],'type':_0x27538b['type'][_0xc85e('0x33')]};});_0x33e1ac[_0xc85e('0x34')]=_['map'](_0x22b721,_0xc85e('0x2c'));_0x33e1ac[_0xc85e('0x35')]=_[_0xc85e('0x36')](_0x24e3b8[_0xc85e('0x35')]);_0x33e1ac['filters']=_[_0xc85e('0x37')](_0x33e1ac[_0xc85e('0x34')],_0x33e1ac[_0xc85e('0x35')]);_0x144e6b['attributes']=_[_0xc85e('0x37')](_0x33e1ac[_0xc85e('0x34')],qs['fields'](_0x24e3b8['query'][_0xc85e('0x38')]));_0x144e6b[_0xc85e('0x39')]=_0x144e6b['attributes'][_0xc85e('0x3a')]?_0x144e6b[_0xc85e('0x39')]:_0x33e1ac['model'];if(!_0x24e3b8[_0xc85e('0x35')][_0xc85e('0x3b')](_0xc85e('0x3c'))){_0x144e6b[_0xc85e('0x24')]=qs[_0xc85e('0x24')](_0x24e3b8[_0xc85e('0x35')][_0xc85e('0x24')]);_0x144e6b['offset']=qs[_0xc85e('0x22')](_0x24e3b8[_0xc85e('0x35')][_0xc85e('0x22')]);}_0x144e6b[_0xc85e('0x3d')]=qs[_0xc85e('0x3e')](_0x24e3b8[_0xc85e('0x35')][_0xc85e('0x3e')]);_0x144e6b[_0xc85e('0x3f')]=qs[_0xc85e('0x40')](_[_0xc85e('0x41')](_0x24e3b8[_0xc85e('0x35')],_0x33e1ac[_0xc85e('0x40')]),_0x22b721);if(_0x24e3b8['query'][_0xc85e('0x42')]){_0x144e6b[_0xc85e('0x3f')]=_[_0xc85e('0x43')](_0x144e6b[_0xc85e('0x3f')],{'$or':_[_0xc85e('0x2f')](_0x22b721,function(_0x5eb208){if(_0x5eb208['type']!==_0xc85e('0x44')){var _0x1c3ab2={};_0x1c3ab2[_0x5eb208[_0xc85e('0x2c')]]={'$like':'%'+_0x24e3b8[_0xc85e('0x35')][_0xc85e('0x42')]+'%'};return _0x1c3ab2;}})});}_0x144e6b=_[_0xc85e('0x43')]({},_0x144e6b,_0x24e3b8[_0xc85e('0x45')]);var _0x176aba={'where':_0x144e6b['where']};return db['UserProfile'][_0xc85e('0x46')](_0x176aba)[_0xc85e('0x29')](function(_0x593ff0){_0x4fd135['count']=_0x593ff0;if(_0x24e3b8[_0xc85e('0x35')][_0xc85e('0x47')]){_0x144e6b['include']=[{'all':!![]}];}return db[_0xc85e('0x30')]['findAll'](_0x144e6b);})[_0xc85e('0x29')](function(_0x17196c){_0x4fd135[_0xc85e('0x48')]=_0x17196c;return _0x4fd135;})[_0xc85e('0x29')](respondWithFilteredResult(_0x3884a0,_0x144e6b))[_0xc85e('0x49')](handleError(_0x3884a0,null));};exports[_0xc85e('0x4a')]=function(_0x518c35,_0x47e3ee){var _0x231e60={'raw':![],'where':{'id':_0x518c35[_0xc85e('0x4b')]['id']}},_0x44b365={};_0x44b365[_0xc85e('0x34')]=_[_0xc85e('0x36')](db['UserProfile'][_0xc85e('0x31')]);_0x44b365[_0xc85e('0x35')]=_[_0xc85e('0x36')](_0x518c35[_0xc85e('0x35')]);_0x44b365[_0xc85e('0x40')]=_['intersection'](_0x44b365[_0xc85e('0x34')],_0x44b365[_0xc85e('0x35')]);_0x231e60['attributes']=_[_0xc85e('0x37')](_0x44b365[_0xc85e('0x34')],qs['fields'](_0x518c35[_0xc85e('0x35')][_0xc85e('0x38')]));_0x231e60[_0xc85e('0x39')]=_0x231e60['attributes']['length']?_0x231e60[_0xc85e('0x39')]:_0x44b365[_0xc85e('0x34')];if(_0x518c35[_0xc85e('0x35')][_0xc85e('0x47')]){_0x231e60[_0xc85e('0x4c')]=[{'all':!![]}];}_0x231e60=_['merge']({},_0x231e60,_0x518c35[_0xc85e('0x45')]);return db[_0xc85e('0x30')]['find'](_0x231e60)[_0xc85e('0x29')](handleEntityNotFound(_0x47e3ee,null))[_0xc85e('0x29')](respondWithResult(_0x47e3ee,null))[_0xc85e('0x49')](handleError(_0x47e3ee,null));};exports[_0xc85e('0x4d')]=function(_0x55cd0b,_0x14a67d){return db[_0xc85e('0x30')][_0xc85e('0x4d')](_0x55cd0b[_0xc85e('0x4e')],{})[_0xc85e('0x29')](respondWithResult(_0x14a67d,0xc9))[_0xc85e('0x49')](handleError(_0x14a67d,null));};exports[_0xc85e('0x4f')]=function(_0x355809,_0x403f70){var _0x3239b7={'where':{'id':_0x355809['params']['id']}},_0x41946d={};_0x41946d[_0xc85e('0x34')]=_['keys'](db[_0xc85e('0x30')][_0xc85e('0x31')]);_0x3239b7[_0xc85e('0x39')]=_[_0xc85e('0x37')](_0x41946d[_0xc85e('0x34')],qs['fields'](_0x355809[_0xc85e('0x35')]['fields']));_0x3239b7['attributes']=_0x3239b7[_0xc85e('0x39')][_0xc85e('0x3a')]?_0x3239b7[_0xc85e('0x39')]:_0x41946d[_0xc85e('0x34')];if(_0x355809['query'][_0xc85e('0x47')]){_0x3239b7[_0xc85e('0x4c')]=[{'all':!![]}];}_0x3239b7=_['merge']({},_0x3239b7,_0x355809[_0xc85e('0x45')]);return db[_0xc85e('0x30')][_0xc85e('0x50')](_0x3239b7)[_0xc85e('0x29')](handleEntityNotFound(_0x403f70,null))[_0xc85e('0x29')](function(_0xb7decc){if(_0xb7decc){var _0x37a507=_0xb7decc[_0xc85e('0x51')]({'plain':!![]});_0x37a507=qs[_0xc85e('0x52')](_0x37a507,['id',_0xc85e('0x53'),'updatedAt',_0xc85e('0x54')]);_0x355809[_0xc85e('0x4e')]=_['omit'](_0x355809[_0xc85e('0x4e')],['id',_0xc85e('0x53'),'updatedAt']);return db[_0xc85e('0x55')][_0xc85e('0x56')](function(_0x2fe457){return db['UserProfile'][_0xc85e('0x4d')](_['merge'](_0x37a507,_0x355809[_0xc85e('0x4e')]),{'include':_0x355809[_0xc85e('0x35')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x2fe457})['then'](function(_0x190fe3){var _0x112960=_0x190fe3[_0xc85e('0x51')]({'plain':!![]});return db[_0xc85e('0x57')]['findAll']({'where':{'userProfileId':_0x355809[_0xc85e('0x4b')]['id']},'raw':!![]})[_0xc85e('0x29')](function(_0x1d862d){if(_0x1d862d){return BPromise[_0xc85e('0x58')](_0x1d862d,function(_0x391e80){return new BPromise(function(_0x1b4f16,_0x12f61d){if(_0x391e80[_0xc85e('0x59')]===null||_0x391e80['autoAssociation']===0x1)_0x1b4f16(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x391e80['id']},'raw':!![]})[_0xc85e('0x29')](function(_0x6a6a17){var _0x3bbf4e=_[_0xc85e('0x2f')](_0x6a6a17,function(_0xf41d5d){return qs[_0xc85e('0x52')](_0xf41d5d,['id',_0xc85e('0x53'),'updatedAt',_0xc85e('0x5a')]);});_0x1b4f16(_0x3bbf4e);})[_0xc85e('0x49')](function(_0x39ffcc){_0x12f61d(_0x39ffcc);});})[_0xc85e('0x29')](function(_0x17ca5f){var _0x1df56e=qs[_0xc85e('0x52')](_0x391e80,['id',_0xc85e('0x53'),_0xc85e('0x5b')]);_0x1df56e[_0xc85e('0x5c')]=_0x112960['id'];if(_0x17ca5f)_0x1df56e[_0xc85e('0x5d')]=_0x17ca5f;return _0x1df56e;})['then'](function(_0x3ae250){return db[_0xc85e('0x57')]['create'](_0x3ae250,{'include':[{'model':db['UserProfileResource'],'as':_0xc85e('0x5d')}],'raw':!![],'transaction':_0x2fe457});});})[_0xc85e('0x29')](function(){return _0x112960;});}});});});}})['then'](respondWithResult(_0x403f70,0xc9))[_0xc85e('0x49')](handleError(_0x403f70,null));};exports[_0xc85e('0x28')]=function(_0x411be9,_0x3a127c){if(_0x411be9[_0xc85e('0x4e')]['id']){delete _0x411be9[_0xc85e('0x4e')]['id'];}return db[_0xc85e('0x30')][_0xc85e('0x50')]({'where':{'id':_0x411be9['params']['id']}})['then'](handleEntityNotFound(_0x3a127c,null))['then'](saveUpdates(_0x411be9[_0xc85e('0x4e')],null))[_0xc85e('0x29')](respondWithResult(_0x3a127c,null))[_0xc85e('0x49')](handleError(_0x3a127c,null));};exports[_0xc85e('0x5e')]=function(_0x44fed5,_0x1aa4f5){return db[_0xc85e('0x30')][_0xc85e('0x50')]({'where':{'id':_0x44fed5['params']['id']}})[_0xc85e('0x29')](handleEntityNotFound(_0x1aa4f5,null))[_0xc85e('0x29')](removeEntity(_0x1aa4f5,null))[_0xc85e('0x49')](handleError(_0x1aa4f5,null));};exports[_0xc85e('0x5f')]=function(_0xa391b6,_0x18d291){return db[_0xc85e('0x30')][_0xc85e('0x5f')]()['then'](respondWithResult(_0x18d291,null))[_0xc85e('0x49')](handleError(_0x18d291,null));};exports[_0xc85e('0x60')]=function(_0x35f20f,_0x377572){var _0x4759a1=_0x35f20f[_0xc85e('0x4e')];return db[_0xc85e('0x30')]['find']({'where':{'id':_0x35f20f[_0xc85e('0x4b')]['id']}})[_0xc85e('0x29')](handleEntityNotFound(_0x377572,null))[_0xc85e('0x29')](function(_0x2a06e6){if(_0x2a06e6){return db[_0xc85e('0x55')]['transaction'](function(_0x7f7e92){return db[_0xc85e('0x57')][_0xc85e('0x5e')]({'where':{'userProfileId':_0x35f20f[_0xc85e('0x4b')]['id'],'sectionId':_[_0xc85e('0x2f')](_0x4759a1,function(_0x4a78b2){return _0x4a78b2[_0xc85e('0x5a')];})},'transaction':_0x7f7e92})[_0xc85e('0x29')](function(){var _0x2998b8=_[_0xc85e('0x2f')](_0x4759a1,function(_0xc8c8d2){_0xc8c8d2[_0xc85e('0x5c')]=_0x35f20f[_0xc85e('0x4b')]['id'];return _0xc8c8d2;});var _0x39951b=[];return BPromise[_0xc85e('0x58')](_0x2998b8,function(_0x102910){return db[_0xc85e('0x57')][_0xc85e('0x4d')](_0x102910,{'include':[{'model':db[_0xc85e('0x61')],'as':_0xc85e('0x5d')}],'raw':!![],'transaction':_0x7f7e92})[_0xc85e('0x29')](function(_0xf456b3){_0x39951b[_0xc85e('0x62')](_0xf456b3['get']({'plain':!![]}));});})[_0xc85e('0x29')](function(){return _0x39951b;});});});}})[_0xc85e('0x29')](function(_0x3ddd29){return _0x3ddd29;})[_0xc85e('0x29')](respondWithResult(_0x377572,null))[_0xc85e('0x49')](handleError(_0x377572,null));};exports[_0xc85e('0x63')]=function(_0x20da86,_0x1310aa){var _0x80de48;return db[_0xc85e('0x30')][_0xc85e('0x50')]({'where':{'id':_0x20da86['params']['id']},'attributes':['id','name']})['then'](handleEntityNotFound(_0x1310aa,null))['then'](function(_0x460840){if(_0x460840){_0x80de48=_0x460840;return db[_0xc85e('0x57')]['destroy']({'where':{'userProfileId':_0x20da86['params']['id'],'sectionId':_0x20da86[_0xc85e('0x35')]['ids']}});}})['then'](function(){return _0x80de48;})[_0xc85e('0x29')](respondWithStatusCode(_0x1310aa,null))['catch'](handleError(_0x1310aa,null));};exports[_0xc85e('0x64')]=function(_0x39ab3b,_0x271fd2){var _0x2fa033=[];var _0x1c176f=[];return db['UserProfileSection'][_0xc85e('0x65')]({'where':{'userProfileId':_0x39ab3b[_0xc85e('0x4b')]['id']},'raw':!![]})['then'](function(_0xbef6bf){_0x2fa033=_[_0xc85e('0x42')](_0xbef6bf,function(_0x2461b2){return _0x2461b2[_0xc85e('0x66')]===0x1||_['includes']([0x3eb,0x709],_0x2461b2[_0xc85e('0x5a')]);});if(!_[_0xc85e('0x67')](_0x2fa033)){return _[_0xc85e('0x2f')](_0x2fa033,function(_0x5f2c65){return _0x5f2c65['sectionId'];});}else{return;}})[_0xc85e('0x29')](function(_0x2b047c){if(_0x2b047c)_0x1c176f=_0x2b047c;if(_[_0xc85e('0x68')](_0x1c176f,0x64)){var _0x93f95a=_['find'](_0x2fa033,{'sectionId':0x64});return hasDefaultDashboard(_0x93f95a)[_0xc85e('0x29')](function(_0x3b5dbe){return _[_0xc85e('0x2f')](_0x2fa033,function(_0x372e9c){if(_0x372e9c[_0xc85e('0x5a')]===0x64){_0x372e9c[_0xc85e('0x69')]=_0x3b5dbe;}return _0x372e9c;});});}else{return;}})['then'](function(_0x13048b){if(_0x13048b)_0x2fa033=_0x13048b;if(_[_0xc85e('0x68')](_0x1c176f,0x3eb)){var _0x22e11e=_[_0xc85e('0x50')](_0x2fa033,{'sectionId':0x3eb});return getCustomDashboards(_0x22e11e)[_0xc85e('0x29')](function(_0x45c5ef){return _[_0xc85e('0x2f')](_0x2fa033,function(_0x57ed93){if(_0x22e11e[_0xc85e('0x66')]){if(_0x57ed93[_0xc85e('0x5a')]===0x3eb){_0x57ed93['subsections']=_0x45c5ef;}}else{if(_0x57ed93[_0xc85e('0x5a')]===0x64){if(!_0x57ed93[_0xc85e('0x69')]){_0x57ed93['subsections']=[];}_0x57ed93['subsections']=_0x57ed93[_0xc85e('0x69')]['concat'](_0x45c5ef);}}return _0x57ed93;});});}else{return;}})['then'](function(_0x3626e7){if(_0x3626e7)_0x2fa033=_0x3626e7;if(_['includes'](_0x1c176f,0x709)){var _0x2e71d5=_[_0xc85e('0x50')](_0x2fa033,{'sectionId':0x709});return getPlugins(_0x2e71d5)['then'](function(_0x27408a){if(_0x2e71d5['enabled']){return _[_0xc85e('0x2f')](_0x2fa033,function(_0x19619d){if(_0x19619d['sectionId']===0x709){_0x19619d[_0xc85e('0x69')]=_0x27408a;}return _0x19619d;});}else{var _0x101c89={'sectionId':0x76c,'enabled':0x1,'subsections':_0x27408a};var _0x33ca42=_[_0xc85e('0x2f')](_0x2fa033);_0x33ca42['push'](_0x101c89);return _0x33ca42;}});}else{return;}})[_0xc85e('0x29')](function(_0x46ca77){if(_0x46ca77)_0x2fa033=_0x46ca77;return _['filter'](_0x2fa033,[_0xc85e('0x66'),0x1]);})['then'](respondWithResult(_0x271fd2,null))[_0xc85e('0x49')](handleError(_0x271fd2,null));};function hasDefaultDashboard(_0x362711){var _0x2cebbe=[0x65];return new BPromise(function(_0x206c3c,_0x4ccec3){try{if(_0x362711['autoAssociation']){_0x206c3c(_0x2cebbe);}else{return db[_0xc85e('0x61')]['findOne']({'where':{'sectionId':_0x362711['id']},'raw':!![]})[_0xc85e('0x29')](function(_0x24733e){_0x24733e?_0x206c3c(_0x2cebbe):_0x206c3c();});}}catch(_0x3715a7){_0x4ccec3(_0x3715a7);}});}function getCustomDashboards(_0xd55baf){var _0x240e2f=[];return new BPromise(function(_0x5cb574,_0x183400){try{if(_0xd55baf['autoAssociation']){return db[_0xc85e('0x6a')]['findAll']({'raw':!![]})[_0xc85e('0x29')](function(_0x203ec5){_0x203ec5[_0xc85e('0x6b')](function(_0x3c6e30){_0x240e2f[_0xc85e('0x62')](_0x3c6e30['id']+0x1869f);});_0x5cb574(_0x240e2f);});}else{return db['UserProfileResource'][_0xc85e('0x65')]({'where':{'sectionId':_0xd55baf['id']},'raw':!![]})[_0xc85e('0x29')](function(_0x23fc91){_0x23fc91[_0xc85e('0x6b')](function(_0x34657f){_0x240e2f[_0xc85e('0x62')](_0x34657f[_0xc85e('0x6c')]+0x1869f);});_0x5cb574(_0x240e2f);});}}catch(_0x206676){_0x183400(_0x206676);}});}function getPlugins(_0x1df98c){var _0x3d4423=[];return new BPromise(function(_0x1491ea,_0x2b39f7){try{if(_0x1df98c[_0xc85e('0x59')]){return db[_0xc85e('0x6d')][_0xc85e('0x65')]({'raw':!![]})['then'](function(_0x478ee4){_0x478ee4[_0xc85e('0x6b')](function(_0x56c238){_0x3d4423[_0xc85e('0x62')](_0x56c238['id']+0x15b38);});_0x1491ea(_0x3d4423);});}else{return db[_0xc85e('0x61')][_0xc85e('0x65')]({'where':{'sectionId':_0x1df98c['id']},'raw':!![]})[_0xc85e('0x29')](function(_0x4417ac){_0x4417ac[_0xc85e('0x6b')](function(_0x31a722){_0x3d4423[_0xc85e('0x62')](_0x31a722['resourceId']+0x15b38);});_0x1491ea(_0x3d4423);});}}catch(_0x462fb9){_0x2b39f7(_0x462fb9);}});}exports['addResources']=function(_0x3d24ba,_0x16f321){return db[_0xc85e('0x30')][_0xc85e('0x50')]({'where':{'id':_0x3d24ba[_0xc85e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x16f321,null))[_0xc85e('0x29')](function(_0x227f74){if(_0x227f74){return db[_0xc85e('0x55')][_0xc85e('0x56')](function(_0x1faa35){return db['UserProfileSection'][_0xc85e('0x65')]({'where':{'userProfileId':_0x3d24ba[_0xc85e('0x4b')]['id']},'attributes':['id'],'raw':!![]})[_0xc85e('0x29')](function(_0xc15ddd){if(_0xc15ddd){return db[_0xc85e('0x57')][_0xc85e('0x5e')]({'where':{'userProfileId':_0x3d24ba[_0xc85e('0x4b')]['id'],'id':_[_0xc85e('0x2f')](_0xc15ddd,function(_0x3dbf40){return _0x3dbf40['id'];})},'transaction':_0x1faa35});}})['then'](function(_0x14ece6){var _0x4b363c=_[_0xc85e('0x2f')](_0x3d24ba[_0xc85e('0x4e')],function(_0x25845d){_0x25845d['userProfileId']=_0x3d24ba[_0xc85e('0x4b')]['id'];return _0x25845d;});return db[_0xc85e('0x57')][_0xc85e('0x6e')](_0x4b363c,{'raw':!![],'transaction':_0x1faa35});})[_0xc85e('0x29')](function(_0xef02d3){var _0x53983a=_['filter'](_[_0xc85e('0x2f')](_0xef02d3,function(_0x37aba3){return _0x37aba3[_0xc85e('0x51')]({'plain':!![]});}),{'includeAll':![]});if(_0x53983a){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x3d24ba[_0xc85e('0x4b')]['id'],'sectionId':_[_0xc85e('0x2f')](_0x53983a,function(_0xb95cf5){return _0xb95cf5[_0xc85e('0x5a')];})},'attributes':['id',_0xc85e('0x5a')],'raw':!![]})[_0xc85e('0x29')](function(_0x5a994a){var _0x115ee9=_['map'](_0x3d24ba[_0xc85e('0x4e')],function(_0x4ef002){_0x4ef002[_0xc85e('0x5c')]=_0x3d24ba[_0xc85e('0x4b')]['id'];return _0x4ef002;});return db['UserProfileResource']['bulkCreate'](_0x115ee9,{'raw':!![],'transaction':_0x1faa35});});}})[_0xc85e('0x49')](handleError(_0x16f321,null));});}})['then'](function(_0x102395){var _0x4f9e32=_['map'](_0x102395,function(_0x527dfb){return _0x527dfb[_0xc85e('0x51')]({'plain':!![]});});})['then'](respondWithResult(_0x16f321,null))['catch'](handleError(_0x16f321,null));};exports[_0xc85e('0x6f')]=function(_0x453196,_0x2dbeb2,_0x2da3c9){return db[_0xc85e('0x30')]['find']({'where':{'id':_0x453196[_0xc85e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2dbeb2,null))[_0xc85e('0x29')](function(_0x5418cb){if(_0x5418cb){return _0x5418cb[_0xc85e('0x6f')](_0x453196[_0xc85e('0x35')][_0xc85e('0x70')]);}})[_0xc85e('0x29')](respondWithStatusCode(_0x2dbeb2,null))[_0xc85e('0x49')](handleError(_0x2dbeb2,null));};exports['getResources']=function(_0x41392f,_0x485509){var _0x755d92={};if(!_0x41392f[_0xc85e('0x35')][_0xc85e('0x71')])throw new Error(_0xc85e('0x72'));if(!_0x41392f['query'][_0xc85e('0x3b')](_0xc85e('0x3c'))){_0x755d92[_0xc85e('0x24')]=qs[_0xc85e('0x24')](_0x41392f['query'][_0xc85e('0x24')]);_0x755d92[_0xc85e('0x22')]=qs[_0xc85e('0x22')](_0x41392f[_0xc85e('0x35')][_0xc85e('0x22')]);}return db[_0xc85e('0x30')][_0xc85e('0x50')]({'where':{'id':_0x41392f[_0xc85e('0x4b')]['id']}})['then'](function(_0x4bd0a4){if(!_0x4bd0a4)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x41392f[_0xc85e('0x4b')]['id']);return db[_0xc85e('0x30')][_0xc85e('0x73')](_0x41392f);})[_0xc85e('0x29')](respondWithFilteredResult(_0x485509,_0x755d92))[_0xc85e('0x49')](handleError(_0x485509,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 5160c57..a8313fc 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 _0x7c1a=['update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','setMaxListeners','save'];(function(_0x47dc1c,_0x4bd160){var _0x52a6f0=function(_0x2fe6f0){while(--_0x2fe6f0){_0x47dc1c['push'](_0x47dc1c['shift']());}};_0x52a6f0(++_0x4bd160);}(_0x7c1a,0x159));var _0xa7c1=function(_0x1aaa00,_0x245138){_0x1aaa00=_0x1aaa00-0x0;var _0x4be822=_0x7c1a[_0x1aaa00];return _0x4be822;};'use strict';var EventEmitter=require(_0xa7c1('0x0'));var UserProfile=require(_0xa7c1('0x1'))['db'][_0xa7c1('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xa7c1('0x3')](0x0);var events={'afterCreate':_0xa7c1('0x4'),'afterUpdate':_0xa7c1('0x5'),'afterDestroy':'remove'};function emitEvent(_0xd434f){return function(_0x132b08,_0x506858,_0x135ae7){UserProfileEvents['emit'](_0xd434f+':'+_0x132b08['id'],_0x132b08);UserProfileEvents[_0xa7c1('0x6')](_0xd434f,_0x132b08);_0x135ae7(null);};}for(var e in events){if(events[_0xa7c1('0x7')](e)){var event=events[e];UserProfile[_0xa7c1('0x8')](e,emitEvent(event));}}module[_0xa7c1('0x9')]=UserProfileEvents; \ No newline at end of file +var _0x66fa=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x66fa,0x117));var _0xa66f=function(_0x4631c4,_0x560c89){_0x4631c4=_0x4631c4-0x0;var _0x467515=_0x66fa[_0x4631c4];return _0x467515;};'use strict';var EventEmitter=require(_0xa66f('0x0'));var UserProfile=require(_0xa66f('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xa66f('0x2')](0x0);var events={'afterCreate':_0xa66f('0x3'),'afterUpdate':_0xa66f('0x4'),'afterDestroy':_0xa66f('0x5')};function emitEvent(_0x3d0c49){return function(_0x2a2abf,_0x3f4904,_0x5ebea5){UserProfileEvents['emit'](_0x3d0c49+':'+_0x2a2abf['id'],_0x2a2abf);UserProfileEvents[_0xa66f('0x6')](_0x3d0c49,_0x2a2abf);_0x5ebea5(null);};}for(var e in events){if(events[_0xa66f('0x7')](e)){var event=events[e];UserProfile[_0xa66f('0x8')](e,emitEvent(event));}}module[_0xa66f('0x9')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 179399d..5547869 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 _0x04b3=['FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Dashboard','intervals','Interval','Pause','scheduler','Schedule','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','plugins','extractedreports','reportId','AnalyticMetric','charAt','toUpperCase','Sequelize','QueryTypes','select','InteractionId','from','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','UserProfile','user_profiles','../../components/parsers/qs','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','UserProfileSection','union','find','ignore','push','autoAssociation','all','keys','filters','attributes','fields','nolimit','limit','offset','sort','where','merge','key','foreignKey','forEach','options','includeAll','include','default','DefaultReports','custom','CustomReports','count','intersection','ids','customSorting','extraQueryConditions','Tags','color','tag','ThroughTags','rows','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','squel','exports','models','filter','value','findAll','then','associatedResources','map','model','name','catch','UserProfileResource','field','AnalyticExtractedReport','resourceId','squareprojects','childModel','SquareProject','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','JscriptyProject','CmContact','Lists','ListId','CmList','companies','CmCompany','globalcustomfields','chatqueues','ChatQueue','faxqueues','FaxQueue','faxaccounts','FaxAccount','outboundroutes','contexts','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','type','inbound','QueueCampaigns','outbound','chanspies','voiceprefixes','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','users','agents','telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x04b3,0x1e2));var _0x304b=function(_0x4bff76,_0x571516){_0x4bff76=_0x4bff76-0x0;var _0x32bc68=_0x04b3[_0x4bff76];return _0x32bc68;};'use strict';var _=require(_0x304b('0x0'));var attributes=require(_0x304b('0x1'));var squel=require(_0x304b('0x2'));module[_0x304b('0x3')]=function(_0x2ed0b1){var _0x1e70b9=_0x2ed0b1[_0x304b('0x4')];function _0x31fa14(_0x1a6340,_0x41b8c0){return new Promise(function(_0x431ef1,_0x50de66){if(!_0x41b8c0)return _0x431ef1(null);var _0x1e9f79=_0x41b8c0[_0x304b('0x5')]?{[_0x41b8c0[_0x304b('0x5')]['field']]:_0x41b8c0[_0x304b('0x5')][_0x304b('0x6')]}:undefined;return _0x1e70b9[_0x1a6340][_0x304b('0x7')]({'where':_0x1e9f79,'raw':!![]})[_0x304b('0x8')](function(_0x18a242){_0x41b8c0[_0x304b('0x9')]=_[_0x304b('0xa')](_0x18a242,'id');_0x431ef1(_0x41b8c0);})['catch'](function(_0x108f99){_0x50de66(_0x108f99);});});}function _0xdc1c69(_0x846e2,_0x3cc98f){return new Promise(function(_0x818011,_0x13cdeb){var _0x29f159=_0x846e2['filter']?{[_0x846e2[_0x304b('0x5')]['field']]:_0x846e2[_0x304b('0x5')][_0x304b('0x6')]}:undefined;return _0x1e70b9[_0x846e2[_0x304b('0xb')]]['findAll']({'where':_0x29f159,'raw':!![]})['then'](function(_0x111b7f){_0x3cc98f['associatedResources']=_[_0x304b('0xa')](_0x111b7f,function(_0x4a6d97){return _0x4a6d97[_0x304b('0xc')];});_0x818011(_0x3cc98f);})[_0x304b('0xd')](function(_0x2a730e){_0x13cdeb(_0x2a730e);});});}function _0x4a50b7(_0x574f8b,_0x24eb7c,_0x54d720){if(!_0x24eb7c)return Promise['resolve'](null);return new Promise(function(_0x133fd8,_0x241cc0){return _0x1e70b9[_0x304b('0xe')][_0x304b('0x7')]({'where':{'sectionId':_0x24eb7c['id']},'raw':!![]})[_0x304b('0x8')](function(_0x1b60bc){if(_0x574f8b[_0x304b('0xf')]&&_0x574f8b[_0x304b('0xf')]!=='id'){_0x24eb7c[_0x304b('0x9')]=_['map'](_0x1b60bc,function(_0x6cf823){return _0x6cf823[_0x574f8b[_0x304b('0xf')]];});}else{if(_0x54d720===_0x304b('0x10')){_0x24eb7c[_0x304b('0x9')]=_['map'](_0x1b60bc,function(_0x2ba773){return{'id':_0x2ba773[_0x304b('0x11')],'type':_0x2ba773['type']};});}else{_0x24eb7c['associatedResources']=_[_0x304b('0xa')](_0x1b60bc,function(_0xf1e38d){return _0xf1e38d[_0x304b('0x11')];});}}_0x133fd8(_0x24eb7c);})['catch'](function(_0x1c88c0){_0x241cc0(_0x1c88c0);});});}function _0x595059(_0x1c2360,_0x6de022){var _0x1c2ddb={'parentSections':[]};switch(_0x1c2360['toLowerCase']()){case _0x304b('0x12'):_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x14');break;case'odbc':_0x1c2ddb['childModel']='SquareOdbc';break;case _0x304b('0x15'):_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x16');_0x1c2ddb[_0x304b('0x17')]=[{'name':_0x304b('0x18'),'field':_0x304b('0xc'),'foreignKey':_0x304b('0x19')}];break;case'projects':_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x1a');break;case'contacts':_0x1c2ddb['childModel']=_0x304b('0x1b');_0x1c2ddb[_0x304b('0x17')]=[{'name':_0x304b('0x1c'),'field':'id','foreignKey':_0x304b('0x1d')}];break;case'lists':_0x1c2ddb['childModel']=_0x304b('0x1e');break;case _0x304b('0x1f'):_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x20');break;case _0x304b('0x21'):_0x1c2ddb[_0x304b('0x13')]='CmCustomField';break;case _0x304b('0x22'):_0x1c2ddb['childModel']=_0x304b('0x23');break;case'chatwebsites':_0x1c2ddb['childModel']='ChatWebsite';break;case _0x304b('0x24'):_0x1c2ddb['childModel']=_0x304b('0x25');break;case _0x304b('0x26'):_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x27');break;case'inboundroutes':case'internalroutes':case _0x304b('0x28'):_0x1c2ddb[_0x304b('0x13')]='VoiceExtension';break;case _0x304b('0x29'):_0x1c2ddb[_0x304b('0x13')]='VoiceContext';break;case _0x304b('0x2a'):_0x1c2ddb['childModel']=_0x304b('0x2b');break;case _0x304b('0x2c'):_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x2d');_0x1c2ddb['parentSections']=[{'name':_0x304b('0x2e'),'field':_0x304b('0xc'),'foreignKey':_0x304b('0x2f'),'model':_0x304b('0x30'),'filter':{'field':_0x304b('0x31'),'value':[_0x304b('0x32')]}},{'name':_0x304b('0x33'),'field':_0x304b('0xc'),'foreignKey':_0x304b('0x2f'),'model':'User','filter':{'field':_0x304b('0x31'),'value':[_0x304b('0x34')]}},{'name':_0x304b('0x35'),'field':_0x304b('0xc'),'foreignKey':_0x304b('0x36'),'model':_0x304b('0x37'),'filter':{'field':_0x304b('0x38'),'value':[_0x304b('0x39')]}},{'name':_0x304b('0x3a'),'field':_0x304b('0xc'),'foreignKey':'queue','model':_0x304b('0x37'),'filter':{'field':'type','value':[_0x304b('0x3b')]}}];break;case'musiconholds':_0x1c2ddb[_0x304b('0x13')]='VoiceMusicOnHold';break;case _0x304b('0x3c'):_0x1c2ddb[_0x304b('0x13')]='VoiceChanSpy';break;case _0x304b('0x3d'):_0x1c2ddb['childModel']='VoicePrefix';break;case _0x304b('0x3e'):_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x3f');break;case _0x304b('0x40'):_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x41');break;case _0x304b('0x42'):_0x1c2ddb['childModel']='MailAccount';break;case _0x304b('0x43'):_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x44');break;case _0x304b('0x45'):_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x46');break;case _0x304b('0x47'):_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x48');break;case _0x304b('0x49'):_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x4a');break;case'smsaccounts':_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x4b');break;case _0x304b('0x4c'):_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x4d');break;case _0x304b('0x4e'):_0x1c2ddb['childModel']=_0x304b('0x4f');break;case _0x304b('0x50'):_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x51');break;case _0x304b('0x52'):case'queuecampaigns':_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x37');if(_0x6de022){_0x1c2ddb[_0x304b('0x17')]=[{'name':_0x304b('0x35')},{'name':_0x304b('0x3a')}];}break;case _0x304b('0x53'):case _0x304b('0x54'):case _0x304b('0x55'):_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x30');if(_0x6de022){_0x1c2ddb[_0x304b('0x17')]=[{'name':'Users','filter':{'field':_0x304b('0x31'),'value':['admin','user']},'ignore':!![]},{'name':_0x304b('0x2e')},{'name':_0x304b('0x33')}];}break;case _0x304b('0x56'):_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x57');break;case _0x304b('0x58'):_0x1c2ddb['childModel']=_0x304b('0x59');break;case _0x304b('0x5a'):_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x5b');break;case'sugarcrmaccounts':_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x5c');break;case _0x304b('0x5d'):_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x5e');break;case _0x304b('0x5f'):_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x60');break;case _0x304b('0x61'):_0x1c2ddb[_0x304b('0x13')]='User';break;case _0x304b('0x62'):_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x63');break;case _0x304b('0x64'):_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x65');break;case'customdashboards':_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x66');break;case _0x304b('0x67'):_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x68');break;case'pauses':_0x1c2ddb['childModel']=_0x304b('0x69');break;case _0x304b('0x6a'):_0x1c2ddb['childModel']=_0x304b('0x6b');break;case'sounds':_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x6c');break;case _0x304b('0x6d'):_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x6e');break;case _0x304b('0x6f'):_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x70');break;case _0x304b('0x71'):_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x72');break;case _0x304b('0x73'):_0x1c2ddb['childModel']=_0x304b('0x74');break;case _0x304b('0x75'):_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x76');break;case _0x304b('0x77'):_0x1c2ddb[_0x304b('0x13')]='Plugin';break;case _0x304b('0x78'):_0x1c2ddb[_0x304b('0x13')]=_0x304b('0x10');_0x1c2ddb[_0x304b('0x17')]=[{'name':'Reports','field':'id','foreignKey':_0x304b('0x79')}];break;case'metrics':_0x1c2ddb['childModel']=_0x304b('0x7a');break;}return _0x1c2ddb;}function _0x4b91f1(_0x1f0190,_0x12acbb){var _0x86bd17=_0x1f0190[_0x304b('0x7b')](0x0)[_0x304b('0x7c')]()+_0x1f0190['slice'](0x1);var _0x278e4e={'type':_0x1e70b9[_0x304b('0x7d')][_0x304b('0x7e')]['SELECT'],'raw':!![]};return new Promise(function(_0x5e7afd,_0x18c173){var _0x26fbd9=squel[_0x304b('0x7f')]()['field']('ui.'+_0x86bd17+_0x304b('0x80'),'id')[_0x304b('0xf')]('ui.createdAt')[_0x304b('0x81')](_0x304b('0x82')+_0x1f0190+_0x304b('0x83'),'ui')['where'](_0x304b('0x84'),_0x12acbb['id']);return _0x1e70b9[_0x304b('0x85')][_0x304b('0x86')](_0x26fbd9[_0x304b('0x87')](),_0x278e4e)[_0x304b('0x8')](function(_0x1448e6){_0x12acbb[_0x86bd17+_0x304b('0x88')]=_0x1448e6;_0x5e7afd(_0x1448e6);})[_0x304b('0xd')](function(_0x447e5f){_0x18c173(_0x447e5f);});});}return _0x2ed0b1['define'](_0x304b('0x89'),attributes,{'tableName':_0x304b('0x8a'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x3cd80c){var _0x204c41=require(_0x304b('0x8b'));var _0x38ad85={'raw':_0x3cd80c[_0x304b('0x86')][_0x304b('0x8c')],'where':{}};var _0xe2a7d2={};var _0x5c4dea={'count':0x0,'rows':[]};var _0x20911a=_0x3cd80c[_0x304b('0x86')][_0x304b('0x8d')];var _0x2976b4=_0x3cd80c[_0x304b('0x86')][_0x304b('0x8e')]||![];var _0x138ba0=_0x595059(_0x20911a,_0x2976b4);if(!_0x138ba0['childModel'])throw new Error(_0x304b('0x8f')+_0x20911a+'\x27');var _0xb48064=[{'name':_0x20911a}];if(!_[_0x304b('0x90')](_0x138ba0[_0x304b('0x17')]))_0xb48064=_0x138ba0['parentSections'];var _0x4565f2=[];for(var _0x121f61=0x0;_0x121f61<_0xb48064[_0x304b('0x91')];_0x121f61++){_0x4565f2['push'](_0x1e70b9[_0x304b('0x92')]['find']({'where':{'userProfileId':_0x3cd80c['params']['id'],'name':_0xb48064[_0x121f61][_0x304b('0xc')]},'raw':!![]}));}return Promise['all'](_0x4565f2)[_0x304b('0x8')](function(_0x58a1d6){var _0x36637f=_['filter'](_0x58a1d6,function(_0x4cf9fd){return _0x4cf9fd?_0x4cf9fd:undefined;});var _0x2b6ff9=_[_0x304b('0x5')](_0xb48064,['ignore',!![]]);var _0x3469b0=_[_0x304b('0x90')](_0x36637f)&&_[_0x304b('0x90')](_0x2b6ff9)?null:_[_0x304b('0x93')](_0x2b6ff9,_0x36637f);if(!_0x3469b0)return null;var _0x4bbfa1=[];for(var _0x39cc1c=0x0;_0x39cc1c<_0x3469b0[_0x304b('0x91')];_0x39cc1c++){var _0x5bf414=_[_0x304b('0x94')](_0xb48064,function(_0x4f2ace){return _0x3469b0[_0x39cc1c]?_0x4f2ace[_0x304b('0xc')]===_0x3469b0[_0x39cc1c][_0x304b('0xc')]:null;});if(_0x5bf414){if(_0x3469b0[_0x39cc1c][_0x304b('0x95')]){_0x4bbfa1[_0x304b('0x96')](_0x31fa14(_0x138ba0['childModel'],_0x3469b0[_0x39cc1c]));}else{if(!_0x3469b0[_0x39cc1c][_0x304b('0x97')]){_0x4bbfa1[_0x304b('0x96')](_0x4a50b7(_0x5bf414,_0x3469b0[_0x39cc1c],_0x138ba0['childModel']));}else{if(_0x5bf414[_0x304b('0xb')]){_0x4bbfa1[_0x304b('0x96')](_0xdc1c69(_0x5bf414,_0x3469b0[_0x39cc1c]));}}}}}return Promise[_0x304b('0x98')](_0x4bbfa1);})['then'](function(_0x2a1dec){var _0x42ad3b=_0x2a1dec;var _0x200ab0=null;if(_0x42ad3b){_0x200ab0=_0x42ad3b[_0x304b('0x91')]===0x1?_0x42ad3b[0x0]:null;}if(!_0x200ab0&&!_0x42ad3b)return _0x5c4dea;var _0x4986c9=_0x1e70b9[_0x138ba0[_0x304b('0x13')]]['rawAttributes'];_0xe2a7d2[_0x304b('0xb')]=_[_0x304b('0x99')](_0x4986c9);_0xe2a7d2[_0x304b('0x86')]=_[_0x304b('0x99')](_0x3cd80c['query']);_0xe2a7d2[_0x304b('0x9a')]=_['intersection'](_0xe2a7d2[_0x304b('0xb')],_0xe2a7d2[_0x304b('0x86')]);_0x38ad85[_0x304b('0x9b')]=_['intersection'](_0xe2a7d2['model'],_0x204c41['fields'](_0x3cd80c[_0x304b('0x86')][_0x304b('0x9c')]));_0x38ad85[_0x304b('0x9b')]=_0x38ad85[_0x304b('0x9b')]['length']?_0x38ad85[_0x304b('0x9b')]:_0xe2a7d2['model'];if(!_0x3cd80c[_0x304b('0x86')]['hasOwnProperty'](_0x304b('0x9d'))){_0x38ad85[_0x304b('0x9e')]=_0x204c41[_0x304b('0x9e')](_0x3cd80c[_0x304b('0x86')][_0x304b('0x9e')]);_0x38ad85[_0x304b('0x9f')]=_0x204c41[_0x304b('0x9f')](_0x3cd80c['query'][_0x304b('0x9f')]);}_0x38ad85['order']=_0x204c41['sort'](_0x3cd80c[_0x304b('0x86')][_0x304b('0xa0')]);_0x38ad85[_0x304b('0xa1')]=_0x204c41[_0x304b('0x9a')](_['pick'](_0x3cd80c['query'],_0xe2a7d2[_0x304b('0x9a')]));if(_0x3cd80c[_0x304b('0x86')][_0x304b('0x5')]){_0x38ad85[_0x304b('0xa1')]=_[_0x304b('0xa2')](_0x38ad85[_0x304b('0xa1')],{'$or':_['map'](_0x4986c9,function(_0x5036ef){if(_0x5036ef[_0x304b('0x38')][_0x304b('0xa3')]!=='VIRTUAL'){var _0x2590c4={};_0x2590c4[_0x5036ef['field']]={'$like':'%'+_0x3cd80c[_0x304b('0x86')]['filter']+'%'};return _0x2590c4;}})});}var _0x16d380=[];var _0x3ec70e=null;var _0x4c1492={};if(_0x200ab0){_0x3ec70e=_[_0x304b('0x94')](_0xb48064,['name',_0x200ab0[_0x304b('0xc')]]);if(_0x3ec70e[_0x304b('0xf')]){_0x4c1492={};if(_0x138ba0[_0x304b('0x13')]===_0x304b('0x10')){_0x4c1492[_0x3ec70e[_0x304b('0xa4')]]=_['map'](_0x200ab0[_0x304b('0x9')],'id');}else{_0x4c1492[_0x3ec70e[_0x304b('0xa4')]]=_0x200ab0[_0x304b('0x9')];}_0x16d380[_0x304b('0x96')](_0x4c1492);}else{_0x38ad85[_0x304b('0xa1')]['id']=_0x200ab0[_0x304b('0x9')];}}else{for(var _0x5a96ea=0x0;_0x5a96ea<_0x42ad3b[_0x304b('0x91')];_0x5a96ea++){_0x3ec70e=_[_0x304b('0x94')](_0xb48064,['name',_0x42ad3b[_0x5a96ea][_0x304b('0xc')]]);if(_0x3ec70e[_0x304b('0xf')]){_0x4c1492={};_0x4c1492[_0x3ec70e[_0x304b('0xa4')]]=_0x42ad3b[_0x5a96ea]['associatedResources'];_0x16d380['push'](_0x4c1492);}else{if(!_0x38ad85[_0x304b('0xa1')]['id'])_0x38ad85[_0x304b('0xa1')]['id']=[];_0x42ad3b[_0x5a96ea]['associatedResources'][_0x304b('0xa5')](function(_0x4b2313){_0x38ad85[_0x304b('0xa1')]['id'][_0x304b('0x96')](_0x4b2313);});}}}if(!_[_0x304b('0x90')](_0x16d380)){_0x38ad85['where']=_[_0x304b('0xa2')](_0x38ad85['where'],{'$and':{'$or':_0x16d380}});}_0x38ad85=_[_0x304b('0xa2')]({},_0x38ad85,_0x3cd80c[_0x304b('0xa6')]);if(_0x200ab0&&!_0x200ab0[_0x304b('0x97')]&&_0x138ba0[_0x304b('0x13')]===_0x304b('0x10')){if(_0x3cd80c[_0x304b('0x86')][_0x304b('0xa7')]){_0x38ad85[_0x304b('0xa8')]=[{'all':!![]}];}return _0x1e70b9[_0x138ba0[_0x304b('0x13')]]['findAll'](_0x38ad85)[_0x304b('0x8')](function(_0x38c4ac){var _0xe0c1b=[];_0x38c4ac[_0x304b('0xa5')](function(_0x217e4a){var _0x4298f5;switch(_0x217e4a['reportType']){case _0x304b('0xa9'):_0x4298f5=_[_0x304b('0x94')](_0x200ab0['associatedResources'],function(_0x333a60){return _0x333a60['id']===_0x217e4a[_0x304b('0x79')]&&_0x333a60[_0x304b('0x38')]===_0x304b('0xaa');});break;case _0x304b('0xab'):_0x4298f5=_[_0x304b('0x94')](_0x200ab0[_0x304b('0x9')],function(_0x1078bd){return _0x1078bd['id']===_0x217e4a[_0x304b('0x79')]&&_0x1078bd['type']===_0x304b('0xac');});break;}if(_0x4298f5)_0xe0c1b[_0x304b('0x96')](_0x217e4a);});_0x5c4dea[_0x304b('0xad')]=_0xe0c1b['length'];_0x5c4dea['rows']=_0xe0c1b;return _0x5c4dea;});}else{if(!_[_0x304b('0x90')](_0x3cd80c[_0x304b('0x86')]['ids'])){_0x38ad85[_0x304b('0xa1')]['id']=_0x38ad85[_0x304b('0xa1')]['id']?_[_0x304b('0xae')](_0x38ad85[_0x304b('0xa1')]['id'],_0x3cd80c[_0x304b('0x86')][_0x304b('0xaf')]):_0x3cd80c[_0x304b('0x86')][_0x304b('0xaf')];if(_0x3cd80c[_0x304b('0x86')][_0x304b('0xb0')]){_0x38ad85['order']=_0x3cd80c[_0x304b('0x86')][_0x304b('0xb0')];}}if(_0x3cd80c[_0x304b('0x86')][_0x304b('0xb1')]){_0x38ad85[_0x304b('0xa1')]=_[_0x304b('0xa2')](_0x38ad85['where'],{'$and':_0x3cd80c['query']['extraQueryConditions']});}return _0x1e70b9[_0x138ba0['childModel']][_0x304b('0xad')]({'where':_0x38ad85[_0x304b('0xa1')]})[_0x304b('0x8')](function(_0x35a2fa){_0x5c4dea['count']=_0x35a2fa;if(_0x3cd80c['query'][_0x304b('0xa7')]){if(_0x138ba0[_0x304b('0x13')]==='CmContact'){_0x38ad85['include']=[{'model':_0x1e70b9[_0x304b('0x6e')],'as':_0x304b('0xb2'),'attributes':['id',_0x304b('0xc'),_0x304b('0xb3')],'required':_0x3cd80c['query'][_0x304b('0xb4')]?!![]:![]},{'model':_0x1e70b9[_0x304b('0x6e')],'as':_0x304b('0xb5'),'attributes':['id',_0x304b('0xc'),_0x304b('0xb3')],'through':_0x3cd80c[_0x304b('0x86')][_0x304b('0xb4')]?{'attributes':[],'where':{'TagId':_0x3cd80c['query'][_0x304b('0xb4')]||undefined}}:{},'required':_0x3cd80c[_0x304b('0x86')]['tag']?!![]:![]}];}else{_0x38ad85[_0x304b('0xa8')]=[{'all':!![]}];}}return _0x1e70b9[_0x138ba0[_0x304b('0x13')]][_0x304b('0x7')](_0x38ad85);})[_0x304b('0x8')](function(_0x131c13){_0x5c4dea[_0x304b('0xb6')]=_0x131c13;if(_0x20911a===_0x304b('0x2e')&&_0x3cd80c[_0x304b('0x86')]['openTabs']===_0x304b('0xb7')){var _0x4adeaa=[];for(var _0x3378f3=0x0;_0x3378f3<_0x5c4dea[_0x304b('0xb6')][_0x304b('0x91')];_0x3378f3++){_0x4adeaa[_0x304b('0x96')](_0x4b91f1(_0x304b('0xb8'),_0x5c4dea[_0x304b('0xb6')][_0x3378f3][_0x304b('0xb9')]));_0x4adeaa[_0x304b('0x96')](_0x4b91f1(_0x304b('0xba'),_0x5c4dea[_0x304b('0xb6')][_0x3378f3][_0x304b('0xb9')]));_0x4adeaa[_0x304b('0x96')](_0x4b91f1(_0x304b('0xbb'),_0x5c4dea[_0x304b('0xb6')][_0x3378f3][_0x304b('0xb9')]));_0x4adeaa[_0x304b('0x96')](_0x4b91f1(_0x304b('0xbc'),_0x5c4dea[_0x304b('0xb6')][_0x3378f3][_0x304b('0xb9')]));_0x4adeaa[_0x304b('0x96')](_0x4b91f1(_0x304b('0xbd'),_0x5c4dea[_0x304b('0xb6')][_0x3378f3]['dataValues']));_0x4adeaa['push'](_0x4b91f1(_0x304b('0xbe'),_0x5c4dea['rows'][_0x3378f3][_0x304b('0xb9')]));}return Promise[_0x304b('0x98')](_0x4adeaa)[_0x304b('0x8')](function(){return _0x5c4dea;});}return _0x5c4dea;});}});}}});}; \ No newline at end of file +var _0xf618=['sounds','Sound','tags','Template','triggers','Trigger','Trunk','variables','plugins','extractedreports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','SELECT','select','ui.','InteractionId','from','_interactions','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','UserProfile','user_profiles','../../components/parsers/qs','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','find','params','all','ignore','push','autoAssociation','model','rawAttributes','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','filters','pick','VIRTUAL','foreignKey','forEach','merge','options','includeAll','include','reportType','default','DefaultReports','custom','count','rows','ids','customSorting','extraQueryConditions','Tag','Tags','color','tag','ThroughTags','openTabs','true','sms','fax','dataValues','openchannel','whatsapp','lodash','squel','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','squareprojects','SquareProject','odbc','childModel','SquareOdbc','SquareRecording','parentSections','SquareProjects','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','faxqueues','FaxQueue','FaxAccount','inboundroutes','internalroutes','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','User','agent','Telephones','membername','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','VoiceMusicOnHold','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','MailQueue','MailAccount','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','agents','Users','role','admin','user','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','DeskAccount','vtigeraccounts','dispositions','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule'];(function(_0x5e2407,_0x375bc6){var _0x285838=function(_0x209907){while(--_0x209907){_0x5e2407['push'](_0x5e2407['shift']());}};_0x285838(++_0x375bc6);}(_0xf618,0x1d2));var _0x8f61=function(_0x8b29b3,_0x29ac61){_0x8b29b3=_0x8b29b3-0x0;var _0x294497=_0xf618[_0x8b29b3];return _0x294497;};'use strict';var _=require(_0x8f61('0x0'));var attributes=require('./userProfile.attributes');var squel=require(_0x8f61('0x1'));module[_0x8f61('0x2')]=function(_0x3bdb81){var _0x193c95=_0x3bdb81[_0x8f61('0x3')];function _0x451612(_0x1bddd4,_0x6c6427){return new Promise(function(_0xa86dc9,_0x1a5f61){if(!_0x6c6427)return _0xa86dc9(null);var _0x2cf43e=_0x6c6427[_0x8f61('0x4')]?{[_0x6c6427[_0x8f61('0x4')][_0x8f61('0x5')]]:_0x6c6427[_0x8f61('0x4')][_0x8f61('0x6')]}:undefined;return _0x193c95[_0x1bddd4][_0x8f61('0x7')]({'where':_0x2cf43e,'raw':!![]})[_0x8f61('0x8')](function(_0x4f1dd8){_0x6c6427[_0x8f61('0x9')]=_[_0x8f61('0xa')](_0x4f1dd8,'id');_0xa86dc9(_0x6c6427);})[_0x8f61('0xb')](function(_0x5891ea){_0x1a5f61(_0x5891ea);});});}function _0x57e1bb(_0x1367b6,_0x4427ec){return new Promise(function(_0x187f80,_0x28a1cc){var _0x578984=_0x1367b6[_0x8f61('0x4')]?{[_0x1367b6[_0x8f61('0x4')]['field']]:_0x1367b6[_0x8f61('0x4')]['value']}:undefined;return _0x193c95[_0x1367b6['model']][_0x8f61('0x7')]({'where':_0x578984,'raw':!![]})[_0x8f61('0x8')](function(_0x5d49b8){_0x4427ec['associatedResources']=_[_0x8f61('0xa')](_0x5d49b8,function(_0x2dd4e3){return _0x2dd4e3[_0x8f61('0xc')];});_0x187f80(_0x4427ec);})[_0x8f61('0xb')](function(_0x3d2da1){_0x28a1cc(_0x3d2da1);});});}function _0x271c5e(_0x4de747,_0x563fbc,_0x4a13d7){if(!_0x563fbc)return Promise[_0x8f61('0xd')](null);return new Promise(function(_0x11b0e3,_0x5d9bb0){return _0x193c95[_0x8f61('0xe')][_0x8f61('0x7')]({'where':{'sectionId':_0x563fbc['id']},'raw':!![]})['then'](function(_0x508afe){if(_0x4de747[_0x8f61('0x5')]&&_0x4de747[_0x8f61('0x5')]!=='id'){_0x563fbc[_0x8f61('0x9')]=_[_0x8f61('0xa')](_0x508afe,function(_0x142803){return _0x142803[_0x4de747[_0x8f61('0x5')]];});}else{if(_0x4a13d7===_0x8f61('0xf')){_0x563fbc['associatedResources']=_[_0x8f61('0xa')](_0x508afe,function(_0x2409c6){return{'id':_0x2409c6[_0x8f61('0x10')],'type':_0x2409c6[_0x8f61('0x11')]};});}else{_0x563fbc[_0x8f61('0x9')]=_[_0x8f61('0xa')](_0x508afe,function(_0x3b193f){return _0x3b193f[_0x8f61('0x10')];});}}_0x11b0e3(_0x563fbc);})['catch'](function(_0xe19d){_0x5d9bb0(_0xe19d);});});}function _0x7c99a2(_0x48dd5c,_0x1bca69){var _0x3a9776={'parentSections':[]};switch(_0x48dd5c['toLowerCase']()){case _0x8f61('0x12'):_0x3a9776['childModel']=_0x8f61('0x13');break;case _0x8f61('0x14'):_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x16');break;case'squarerecordings':_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x17');_0x3a9776[_0x8f61('0x18')]=[{'name':_0x8f61('0x19'),'field':_0x8f61('0xc'),'foreignKey':'projectName'}];break;case _0x8f61('0x1a'):_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x1b');break;case _0x8f61('0x1c'):_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x1d');_0x3a9776['parentSections']=[{'name':_0x8f61('0x1e'),'field':'id','foreignKey':_0x8f61('0x1f')}];break;case _0x8f61('0x20'):_0x3a9776[_0x8f61('0x15')]='CmList';break;case'companies':_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x21');break;case _0x8f61('0x22'):_0x3a9776['childModel']=_0x8f61('0x23');break;case _0x8f61('0x24'):_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x25');break;case _0x8f61('0x26'):_0x3a9776[_0x8f61('0x15')]='ChatWebsite';break;case _0x8f61('0x27'):_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x28');break;case'faxaccounts':_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x29');break;case _0x8f61('0x2a'):case _0x8f61('0x2b'):case'outboundroutes':_0x3a9776[_0x8f61('0x15')]='VoiceExtension';break;case _0x8f61('0x2c'):_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x2d');break;case _0x8f61('0x2e'):_0x3a9776[_0x8f61('0x15')]='VoiceMail';break;case _0x8f61('0x2f'):_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x30');_0x3a9776[_0x8f61('0x18')]=[{'name':_0x8f61('0x31'),'field':_0x8f61('0xc'),'foreignKey':'membername','model':_0x8f61('0x32'),'filter':{'field':'role','value':[_0x8f61('0x33')]}},{'name':_0x8f61('0x34'),'field':'name','foreignKey':_0x8f61('0x35'),'model':_0x8f61('0x32'),'filter':{'field':'role','value':[_0x8f61('0x36')]}},{'name':_0x8f61('0x37'),'field':_0x8f61('0xc'),'foreignKey':_0x8f61('0x38'),'model':_0x8f61('0x39'),'filter':{'field':'type','value':[_0x8f61('0x3a')]}},{'name':_0x8f61('0x3b'),'field':'name','foreignKey':_0x8f61('0x38'),'model':_0x8f61('0x39'),'filter':{'field':'type','value':['outbound']}}];break;case'musiconholds':_0x3a9776['childModel']=_0x8f61('0x3c');break;case'chanspies':_0x3a9776[_0x8f61('0x15')]='VoiceChanSpy';break;case _0x8f61('0x3d'):_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x3e');break;case _0x8f61('0x3f'):_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x40');break;case'mailqueues':_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x41');break;case'mailaccounts':_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x42');break;case'mailsubstatuses':_0x3a9776[_0x8f61('0x15')]='MailSubstatus';break;case _0x8f61('0x43'):_0x3a9776[_0x8f61('0x15')]='OpenchannelQueue';break;case _0x8f61('0x44'):_0x3a9776['childModel']=_0x8f61('0x45');break;case _0x8f61('0x46'):_0x3a9776['childModel']='SmsQueue';break;case _0x8f61('0x47'):_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x48');break;case _0x8f61('0x49'):_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x4a');break;case _0x8f61('0x4b'):_0x3a9776['childModel']=_0x8f61('0x4c');break;case _0x8f61('0x4d'):_0x3a9776['childModel']=_0x8f61('0x4e');break;case _0x8f61('0x4f'):case _0x8f61('0x50'):_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x39');if(_0x1bca69){_0x3a9776[_0x8f61('0x18')]=[{'name':'VoiceQueues'},{'name':_0x8f61('0x3b')}];}break;case'users':case _0x8f61('0x51'):case'telephones':_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x32');if(_0x1bca69){_0x3a9776['parentSections']=[{'name':_0x8f61('0x52'),'filter':{'field':_0x8f61('0x53'),'value':[_0x8f61('0x54'),_0x8f61('0x55')]},'ignore':!![]},{'name':_0x8f61('0x31')},{'name':_0x8f61('0x34')}];}break;case'zendeskaccounts':_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x56');break;case _0x8f61('0x57'):_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x58');break;case _0x8f61('0x59'):_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x5a');break;case'sugarcrmaccounts':_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x5b');break;case _0x8f61('0x5c'):_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x5d');break;case'zohoaccounts':_0x3a9776[_0x8f61('0x15')]='ZohoAccount';break;case _0x8f61('0x5e'):_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x32');break;case'cannedanswers':_0x3a9776[_0x8f61('0x15')]='CannedAnswer';break;case _0x8f61('0x5f'):_0x3a9776['childModel']='Disposition';break;case _0x8f61('0x60'):_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x61');break;case _0x8f61('0x62'):_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x63');break;case _0x8f61('0x64'):_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x65');break;case _0x8f61('0x66'):_0x3a9776['childModel']=_0x8f61('0x67');break;case _0x8f61('0x68'):_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x69');break;case _0x8f61('0x6a'):_0x3a9776[_0x8f61('0x15')]='Tag';break;case'templates':_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x6b');break;case _0x8f61('0x6c'):_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x6d');break;case'trunks':_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x6e');break;case _0x8f61('0x6f'):_0x3a9776[_0x8f61('0x15')]='Variable';break;case _0x8f61('0x70'):_0x3a9776[_0x8f61('0x15')]='Plugin';break;case _0x8f61('0x71'):_0x3a9776[_0x8f61('0x15')]=_0x8f61('0xf');_0x3a9776[_0x8f61('0x18')]=[{'name':'Reports','field':'id','foreignKey':_0x8f61('0x72')}];break;case _0x8f61('0x73'):_0x3a9776[_0x8f61('0x15')]=_0x8f61('0x74');break;}return _0x3a9776;}function _0x5e8c09(_0x567af3,_0x5a79ac){var _0x5492e4=_0x567af3[_0x8f61('0x75')](0x0)[_0x8f61('0x76')]()+_0x567af3[_0x8f61('0x77')](0x1);var _0x470dc4={'type':_0x193c95[_0x8f61('0x78')]['QueryTypes'][_0x8f61('0x79')],'raw':!![]};return new Promise(function(_0x51e0d6,_0x3ec0d0){var _0x1ff700=squel[_0x8f61('0x7a')]()[_0x8f61('0x5')](_0x8f61('0x7b')+_0x5492e4+_0x8f61('0x7c'),'id')[_0x8f61('0x5')]('ui.createdAt')[_0x8f61('0x7d')]('user_has_'+_0x567af3+_0x8f61('0x7e'),'ui')[_0x8f61('0x7f')](_0x8f61('0x80'),_0x5a79ac['id']);return _0x193c95['sequelize'][_0x8f61('0x81')](_0x1ff700[_0x8f61('0x82')](),_0x470dc4)[_0x8f61('0x8')](function(_0x315990){_0x5a79ac[_0x5492e4+_0x8f61('0x83')]=_0x315990;_0x51e0d6(_0x315990);})[_0x8f61('0xb')](function(_0x5a2c9f){_0x3ec0d0(_0x5a2c9f);});});}return _0x3bdb81[_0x8f61('0x84')](_0x8f61('0x85'),attributes,{'tableName':_0x8f61('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x203e28){var _0x35952c=require(_0x8f61('0x87'));var _0x4832bc={'raw':_0x203e28[_0x8f61('0x81')][_0x8f61('0x88')],'where':{}};var _0x954566={};var _0xeb1696={'count':0x0,'rows':[]};var _0x577bf6=_0x203e28[_0x8f61('0x81')][_0x8f61('0x89')];var _0x208fcd=_0x203e28[_0x8f61('0x81')][_0x8f61('0x8a')]||![];var _0x9e8ecd=_0x7c99a2(_0x577bf6,_0x208fcd);if(!_0x9e8ecd[_0x8f61('0x15')])throw new Error(_0x8f61('0x8b')+_0x577bf6+'\x27');var _0x4cc6f4=[{'name':_0x577bf6}];if(!_[_0x8f61('0x8c')](_0x9e8ecd['parentSections']))_0x4cc6f4=_0x9e8ecd[_0x8f61('0x18')];var _0x3cd117=[];for(var _0x4f1468=0x0;_0x4f1468<_0x4cc6f4[_0x8f61('0x8d')];_0x4f1468++){_0x3cd117['push'](_0x193c95['UserProfileSection'][_0x8f61('0x8e')]({'where':{'userProfileId':_0x203e28[_0x8f61('0x8f')]['id'],'name':_0x4cc6f4[_0x4f1468][_0x8f61('0xc')]},'raw':!![]}));}return Promise[_0x8f61('0x90')](_0x3cd117)['then'](function(_0x2bb81e){var _0x1c20f2=_[_0x8f61('0x4')](_0x2bb81e,function(_0x4b7c32){return _0x4b7c32?_0x4b7c32:undefined;});var _0x1d1281=_[_0x8f61('0x4')](_0x4cc6f4,[_0x8f61('0x91'),!![]]);var _0x42b2f3=_[_0x8f61('0x8c')](_0x1c20f2)&&_[_0x8f61('0x8c')](_0x1d1281)?null:_['union'](_0x1d1281,_0x1c20f2);if(!_0x42b2f3)return null;var _0x513dd5=[];for(var _0x4e7696=0x0;_0x4e7696<_0x42b2f3[_0x8f61('0x8d')];_0x4e7696++){var _0x1d1b92=_[_0x8f61('0x8e')](_0x4cc6f4,function(_0x13681f){return _0x42b2f3[_0x4e7696]?_0x13681f[_0x8f61('0xc')]===_0x42b2f3[_0x4e7696][_0x8f61('0xc')]:null;});if(_0x1d1b92){if(_0x42b2f3[_0x4e7696]['ignore']){_0x513dd5[_0x8f61('0x92')](_0x451612(_0x9e8ecd[_0x8f61('0x15')],_0x42b2f3[_0x4e7696]));}else{if(!_0x42b2f3[_0x4e7696][_0x8f61('0x93')]){_0x513dd5[_0x8f61('0x92')](_0x271c5e(_0x1d1b92,_0x42b2f3[_0x4e7696],_0x9e8ecd[_0x8f61('0x15')]));}else{if(_0x1d1b92[_0x8f61('0x94')]){_0x513dd5[_0x8f61('0x92')](_0x57e1bb(_0x1d1b92,_0x42b2f3[_0x4e7696]));}}}}}return Promise[_0x8f61('0x90')](_0x513dd5);})['then'](function(_0x9e3e15){var _0xe2e715=_0x9e3e15;var _0x4bbc94=null;if(_0xe2e715){_0x4bbc94=_0xe2e715['length']===0x1?_0xe2e715[0x0]:null;}if(!_0x4bbc94&&!_0xe2e715)return _0xeb1696;var _0x48b4ca=_0x193c95[_0x9e8ecd[_0x8f61('0x15')]][_0x8f61('0x95')];_0x954566[_0x8f61('0x94')]=_[_0x8f61('0x96')](_0x48b4ca);_0x954566[_0x8f61('0x81')]=_[_0x8f61('0x96')](_0x203e28[_0x8f61('0x81')]);_0x954566['filters']=_[_0x8f61('0x97')](_0x954566[_0x8f61('0x94')],_0x954566[_0x8f61('0x81')]);_0x4832bc[_0x8f61('0x98')]=_[_0x8f61('0x97')](_0x954566[_0x8f61('0x94')],_0x35952c['fields'](_0x203e28['query'][_0x8f61('0x99')]));_0x4832bc[_0x8f61('0x98')]=_0x4832bc[_0x8f61('0x98')][_0x8f61('0x8d')]?_0x4832bc[_0x8f61('0x98')]:_0x954566[_0x8f61('0x94')];if(!_0x203e28[_0x8f61('0x81')][_0x8f61('0x9a')](_0x8f61('0x9b'))){_0x4832bc[_0x8f61('0x9c')]=_0x35952c[_0x8f61('0x9c')](_0x203e28[_0x8f61('0x81')][_0x8f61('0x9c')]);_0x4832bc['offset']=_0x35952c[_0x8f61('0x9d')](_0x203e28[_0x8f61('0x81')]['offset']);}_0x4832bc[_0x8f61('0x9e')]=_0x35952c[_0x8f61('0x9f')](_0x203e28['query'][_0x8f61('0x9f')]);_0x4832bc[_0x8f61('0x7f')]=_0x35952c[_0x8f61('0xa0')](_[_0x8f61('0xa1')](_0x203e28[_0x8f61('0x81')],_0x954566['filters']));if(_0x203e28['query'][_0x8f61('0x4')]){_0x4832bc[_0x8f61('0x7f')]=_['merge'](_0x4832bc[_0x8f61('0x7f')],{'$or':_[_0x8f61('0xa')](_0x48b4ca,function(_0x306089){if(_0x306089[_0x8f61('0x11')]['key']!==_0x8f61('0xa2')){var _0x36de75={};_0x36de75[_0x306089[_0x8f61('0x5')]]={'$like':'%'+_0x203e28['query'][_0x8f61('0x4')]+'%'};return _0x36de75;}})});}var _0x4b4be9=[];var _0x5ed69f=null;var _0x5c9521={};if(_0x4bbc94){_0x5ed69f=_['find'](_0x4cc6f4,['name',_0x4bbc94[_0x8f61('0xc')]]);if(_0x5ed69f[_0x8f61('0x5')]){_0x5c9521={};if(_0x9e8ecd[_0x8f61('0x15')]===_0x8f61('0xf')){_0x5c9521[_0x5ed69f['foreignKey']]=_['map'](_0x4bbc94[_0x8f61('0x9')],'id');}else{_0x5c9521[_0x5ed69f[_0x8f61('0xa3')]]=_0x4bbc94[_0x8f61('0x9')];}_0x4b4be9[_0x8f61('0x92')](_0x5c9521);}else{_0x4832bc[_0x8f61('0x7f')]['id']=_0x4bbc94['associatedResources'];}}else{for(var _0x414cc2=0x0;_0x414cc2<_0xe2e715[_0x8f61('0x8d')];_0x414cc2++){_0x5ed69f=_[_0x8f61('0x8e')](_0x4cc6f4,[_0x8f61('0xc'),_0xe2e715[_0x414cc2]['name']]);if(_0x5ed69f[_0x8f61('0x5')]){_0x5c9521={};_0x5c9521[_0x5ed69f[_0x8f61('0xa3')]]=_0xe2e715[_0x414cc2][_0x8f61('0x9')];_0x4b4be9[_0x8f61('0x92')](_0x5c9521);}else{if(!_0x4832bc['where']['id'])_0x4832bc[_0x8f61('0x7f')]['id']=[];_0xe2e715[_0x414cc2]['associatedResources'][_0x8f61('0xa4')](function(_0x28f18e){_0x4832bc[_0x8f61('0x7f')]['id'][_0x8f61('0x92')](_0x28f18e);});}}}if(!_[_0x8f61('0x8c')](_0x4b4be9)){_0x4832bc[_0x8f61('0x7f')]=_[_0x8f61('0xa5')](_0x4832bc[_0x8f61('0x7f')],{'$and':{'$or':_0x4b4be9}});}_0x4832bc=_[_0x8f61('0xa5')]({},_0x4832bc,_0x203e28[_0x8f61('0xa6')]);if(_0x4bbc94&&!_0x4bbc94[_0x8f61('0x93')]&&_0x9e8ecd[_0x8f61('0x15')]==='AnalyticExtractedReport'){if(_0x203e28[_0x8f61('0x81')][_0x8f61('0xa7')]){_0x4832bc[_0x8f61('0xa8')]=[{'all':!![]}];}return _0x193c95[_0x9e8ecd[_0x8f61('0x15')]]['findAll'](_0x4832bc)[_0x8f61('0x8')](function(_0x24812b){var _0x4f16c6=[];_0x24812b[_0x8f61('0xa4')](function(_0x5e2056){var _0x1db45a;switch(_0x5e2056[_0x8f61('0xa9')]){case _0x8f61('0xaa'):_0x1db45a=_['find'](_0x4bbc94[_0x8f61('0x9')],function(_0x25d04b){return _0x25d04b['id']===_0x5e2056[_0x8f61('0x72')]&&_0x25d04b['type']===_0x8f61('0xab');});break;case _0x8f61('0xac'):_0x1db45a=_['find'](_0x4bbc94[_0x8f61('0x9')],function(_0x2fe1ec){return _0x2fe1ec['id']===_0x5e2056[_0x8f61('0x72')]&&_0x2fe1ec[_0x8f61('0x11')]==='CustomReports';});break;}if(_0x1db45a)_0x4f16c6[_0x8f61('0x92')](_0x5e2056);});_0xeb1696[_0x8f61('0xad')]=_0x4f16c6[_0x8f61('0x8d')];_0xeb1696[_0x8f61('0xae')]=_0x4f16c6;return _0xeb1696;});}else{if(!_[_0x8f61('0x8c')](_0x203e28[_0x8f61('0x81')]['ids'])){_0x4832bc[_0x8f61('0x7f')]['id']=_0x4832bc[_0x8f61('0x7f')]['id']?_['intersection'](_0x4832bc[_0x8f61('0x7f')]['id'],_0x203e28[_0x8f61('0x81')][_0x8f61('0xaf')]):_0x203e28[_0x8f61('0x81')][_0x8f61('0xaf')];if(_0x203e28[_0x8f61('0x81')][_0x8f61('0xb0')]){_0x4832bc['order']=_0x203e28[_0x8f61('0x81')][_0x8f61('0xb0')];}}if(_0x203e28[_0x8f61('0x81')][_0x8f61('0xb1')]){_0x4832bc[_0x8f61('0x7f')]=_[_0x8f61('0xa5')](_0x4832bc[_0x8f61('0x7f')],{'$and':_0x203e28['query'][_0x8f61('0xb1')]});}return _0x193c95[_0x9e8ecd[_0x8f61('0x15')]][_0x8f61('0xad')]({'where':_0x4832bc[_0x8f61('0x7f')]})[_0x8f61('0x8')](function(_0x3735cd){_0xeb1696['count']=_0x3735cd;if(_0x203e28[_0x8f61('0x81')][_0x8f61('0xa7')]){if(_0x9e8ecd['childModel']===_0x8f61('0x1d')){_0x4832bc[_0x8f61('0xa8')]=[{'model':_0x193c95[_0x8f61('0xb2')],'as':_0x8f61('0xb3'),'attributes':['id',_0x8f61('0xc'),_0x8f61('0xb4')],'required':_0x203e28[_0x8f61('0x81')][_0x8f61('0xb5')]?!![]:![]},{'model':_0x193c95[_0x8f61('0xb2')],'as':_0x8f61('0xb6'),'attributes':['id',_0x8f61('0xc'),_0x8f61('0xb4')],'through':_0x203e28[_0x8f61('0x81')][_0x8f61('0xb5')]?{'attributes':[],'where':{'TagId':_0x203e28[_0x8f61('0x81')][_0x8f61('0xb5')]||undefined}}:{},'required':_0x203e28['query'][_0x8f61('0xb5')]?!![]:![]}];}else{_0x4832bc[_0x8f61('0xa8')]=[{'all':!![]}];}}return _0x193c95[_0x9e8ecd['childModel']][_0x8f61('0x7')](_0x4832bc);})[_0x8f61('0x8')](function(_0x49c391){_0xeb1696[_0x8f61('0xae')]=_0x49c391;if(_0x577bf6===_0x8f61('0x31')&&_0x203e28[_0x8f61('0x81')][_0x8f61('0xb7')]===_0x8f61('0xb8')){var _0x2be95d=[];for(var _0x3cda78=0x0;_0x3cda78<_0xeb1696[_0x8f61('0xae')][_0x8f61('0x8d')];_0x3cda78++){_0x2be95d[_0x8f61('0x92')](_0x5e8c09('chat',_0xeb1696[_0x8f61('0xae')][_0x3cda78]['dataValues']));_0x2be95d[_0x8f61('0x92')](_0x5e8c09(_0x8f61('0xb9'),_0xeb1696[_0x8f61('0xae')][_0x3cda78]['dataValues']));_0x2be95d['push'](_0x5e8c09(_0x8f61('0xba'),_0xeb1696['rows'][_0x3cda78][_0x8f61('0xbb')]));_0x2be95d['push'](_0x5e8c09('mail',_0xeb1696[_0x8f61('0xae')][_0x3cda78]['dataValues']));_0x2be95d[_0x8f61('0x92')](_0x5e8c09(_0x8f61('0xbc'),_0xeb1696[_0x8f61('0xae')][_0x3cda78][_0x8f61('0xbb')]));_0x2be95d[_0x8f61('0x92')](_0x5e8c09(_0x8f61('0xbd'),_0xeb1696[_0x8f61('0xae')][_0x3cda78][_0x8f61('0xbb')]));}return Promise[_0x8f61('0x90')](_0x2be95d)['then'](function(){return _0xeb1696;});}return _0xeb1696;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index f31b595..7dfb065 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 _0xf02c=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./userProfile.socket','register','request','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x4d2c26,_0x2701f9){var _0x5bf9b4=function(_0x52edc6){while(--_0x52edc6){_0x4d2c26['push'](_0x4d2c26['shift']());}};_0x5bf9b4(++_0x2701f9);}(_0xf02c,0x92));var _0xcf02=function(_0x9cb814,_0x1b1165){_0x9cb814=_0x9cb814-0x0;var _0x504348=_0xf02c[_0x9cb814];return _0x504348;};'use strict';var _=require(_0xcf02('0x0'));var util=require(_0xcf02('0x1'));var moment=require(_0xcf02('0x2'));var BPromise=require(_0xcf02('0x3'));var rs=require(_0xcf02('0x4'));var fs=require('fs');var Redis=require(_0xcf02('0x5'));var db=require(_0xcf02('0x6'))['db'];var utils=require(_0xcf02('0x7'));var logger=require(_0xcf02('0x8'))(_0xcf02('0x9'));var config=require(_0xcf02('0xa'));var jayson=require(_0xcf02('0xb'));var client=jayson[_0xcf02('0xc')][_0xcf02('0xd')]({'port':0x232a});config[_0xcf02('0xe')]=_['defaults'](config[_0xcf02('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xcf02('0xf'))[_0xcf02('0x10')](socket);function respondWithRpcPromise(_0x1411e5,_0x1c9cda,_0x5bd27c){return new BPromise(function(_0x70fe11,_0x2c0978){return client[_0xcf02('0x11')](_0x1411e5,_0x5bd27c)['then'](function(_0x48c0d8){logger[_0xcf02('0x12')](_0xcf02('0x13'),_0x1c9cda,_0xcf02('0x14'));logger[_0xcf02('0x15')](_0xcf02('0x16'),_0x1c9cda,'request\x20sent',JSON[_0xcf02('0x17')](_0x48c0d8));if(_0x48c0d8[_0xcf02('0x18')]){if(_0x48c0d8[_0xcf02('0x18')][_0xcf02('0x19')]===0x1f4){logger[_0xcf02('0x18')](_0xcf02('0x13'),_0x1c9cda,_0x48c0d8[_0xcf02('0x18')]['message']);return _0x2c0978(_0x48c0d8[_0xcf02('0x18')][_0xcf02('0x1a')]);}logger[_0xcf02('0x18')]('UserProfile,\x20%s,\x20%s',_0x1c9cda,_0x48c0d8[_0xcf02('0x18')][_0xcf02('0x1a')]);return _0x70fe11(_0x48c0d8[_0xcf02('0x18')][_0xcf02('0x1a')]);}else{logger['info']('UserProfile,\x20%s,\x20%s',_0x1c9cda,'request\x20sent');_0x70fe11(_0x48c0d8[_0xcf02('0x1b')]['message']);}})[_0xcf02('0x1c')](function(_0x1cac37){logger[_0xcf02('0x18')](_0xcf02('0x13'),_0x1c9cda,_0x1cac37);_0x2c0978(_0x1cac37);});});} \ No newline at end of file +var _0xc7b3=['client','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x3411a4,_0x60d585){var _0x4eb325=function(_0x2356d4){while(--_0x2356d4){_0x3411a4['push'](_0x3411a4['shift']());}};_0x4eb325(++_0x60d585);}(_0xc7b3,0x1c6));var _0x3c7b=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xc7b3[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0x3c7b('0x0'));var util=require(_0x3c7b('0x1'));var moment=require('moment');var BPromise=require(_0x3c7b('0x2'));var rs=require(_0x3c7b('0x3'));var fs=require('fs');var Redis=require(_0x3c7b('0x4'));var db=require(_0x3c7b('0x5'))['db'];var utils=require(_0x3c7b('0x6'));var logger=require(_0x3c7b('0x7'))('rpc');var config=require(_0x3c7b('0x8'));var jayson=require(_0x3c7b('0x9'));var client=jayson[_0x3c7b('0xa')]['http']({'port':0x232a});config[_0x3c7b('0xb')]=_[_0x3c7b('0xc')](config['redis'],{'host':_0x3c7b('0xd'),'port':0x18eb});var socket=require(_0x3c7b('0xe'))(new Redis(config['redis']));require(_0x3c7b('0xf'))[_0x3c7b('0x10')](socket);function respondWithRpcPromise(_0x3d8744,_0x584cfe,_0x20c47f){return new BPromise(function(_0x5ae6ec,_0x86188c){return client[_0x3c7b('0x11')](_0x3d8744,_0x20c47f)['then'](function(_0x6452a1){logger[_0x3c7b('0x12')](_0x3c7b('0x13'),_0x584cfe,_0x3c7b('0x14'));logger[_0x3c7b('0x15')](_0x3c7b('0x16'),_0x584cfe,'request\x20sent',JSON[_0x3c7b('0x17')](_0x6452a1));if(_0x6452a1['error']){if(_0x6452a1[_0x3c7b('0x18')][_0x3c7b('0x19')]===0x1f4){logger[_0x3c7b('0x18')](_0x3c7b('0x13'),_0x584cfe,_0x6452a1[_0x3c7b('0x18')][_0x3c7b('0x1a')]);return _0x86188c(_0x6452a1[_0x3c7b('0x18')][_0x3c7b('0x1a')]);}logger[_0x3c7b('0x18')](_0x3c7b('0x13'),_0x584cfe,_0x6452a1[_0x3c7b('0x18')][_0x3c7b('0x1a')]);return _0x5ae6ec(_0x6452a1['error'][_0x3c7b('0x1a')]);}else{logger[_0x3c7b('0x12')](_0x3c7b('0x13'),_0x584cfe,_0x3c7b('0x14'));_0x5ae6ec(_0x6452a1[_0x3c7b('0x1b')][_0x3c7b('0x1a')]);}})[_0x3c7b('0x1c')](function(_0x10a6ec){logger[_0x3c7b('0x18')](_0x3c7b('0x13'),_0x584cfe,_0x10a6ec);_0x86188c(_0x10a6ec);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 33cc3e2..7141e53 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 _0xa8b3=['save','remove','update','removeListener','register','userProfile:','./userProfile.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa8b3,0x1d4));var _0x3a8b=function(_0x53d3b0,_0x62aa42){_0x53d3b0=_0x53d3b0-0x0;var _0x44f608=_0xa8b3[_0x53d3b0];return _0x44f608;};'use strict';var UserProfileEvents=require(_0x3a8b('0x0'));var events=[_0x3a8b('0x1'),_0x3a8b('0x2'),_0x3a8b('0x3')];function createListener(_0x591bf0,_0x426953){return function(_0x56f042){_0x426953['emit'](_0x591bf0,_0x56f042);};}function removeListener(_0x2a483c,_0xbad3bf){return function(){UserProfileEvents[_0x3a8b('0x4')](_0x2a483c,_0xbad3bf);};}exports[_0x3a8b('0x5')]=function(_0x2585fc){for(var _0x377654=0x0,_0x1da3e3=events['length'];_0x377654<_0x1da3e3;_0x377654++){var _0x461616=events[_0x377654];var _0x49333f=createListener(_0x3a8b('0x6')+_0x461616,_0x2585fc);UserProfileEvents['on'](_0x461616,_0x49333f);}}; \ No newline at end of file +var _0xd4cb=['./userProfile.events','save','removeListener','register','length','userProfile:'];(function(_0x512011,_0x4524ed){var _0x187259=function(_0x572dac){while(--_0x572dac){_0x512011['push'](_0x512011['shift']());}};_0x187259(++_0x4524ed);}(_0xd4cb,0xd8));var _0xbd4c=function(_0x29d472,_0x112031){_0x29d472=_0x29d472-0x0;var _0x2bd00d=_0xd4cb[_0x29d472];return _0x2bd00d;};'use strict';var UserProfileEvents=require(_0xbd4c('0x0'));var events=[_0xbd4c('0x1'),'remove','update'];function createListener(_0x22d6e9,_0x3db6df){return function(_0x40e86c){_0x3db6df['emit'](_0x22d6e9,_0x40e86c);};}function removeListener(_0x4e43b2,_0x3f11fc){return function(){UserProfileEvents[_0xbd4c('0x2')](_0x4e43b2,_0x3f11fc);};}exports[_0xbd4c('0x3')]=function(_0x245706){for(var _0x2ea4e4=0x0,_0x117096=events[_0xbd4c('0x4')];_0x2ea4e4<_0x117096;_0x2ea4e4++){var _0x326516=events[_0x2ea4e4];var _0x5f1a0a=createListener(_0xbd4c('0x5')+_0x326516,_0x245706);UserProfileEvents['on'](_0x326516,_0x5f1a0a);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 6273194..a3a3728 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 _0x2b67=['update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create'];(function(_0x1b1100,_0x45e5c2){var _0x3e5e16=function(_0x1d4370){while(--_0x1d4370){_0x1b1100['push'](_0x1b1100['shift']());}};_0x3e5e16(++_0x45e5c2);}(_0x2b67,0x13e));var _0x72b6=function(_0x291583,_0x36ad03){_0x291583=_0x291583-0x0;var _0x5665ed=_0x2b67[_0x291583];return _0x5665ed;};'use strict';var multer=require(_0x72b6('0x0'));var util=require('util');var path=require(_0x72b6('0x1'));var timeout=require(_0x72b6('0x2'));var express=require(_0x72b6('0x3'));var router=express[_0x72b6('0x4')]();var fs_extra=require(_0x72b6('0x5'));var auth=require(_0x72b6('0x6'));var interaction=require(_0x72b6('0x7'));var config=require(_0x72b6('0x8'));var controller=require(_0x72b6('0x9'));router[_0x72b6('0xa')]('/',auth[_0x72b6('0xb')](),controller['index']);router['get'](_0x72b6('0xc'),auth['isAuthenticated'](),controller[_0x72b6('0xd')]);router[_0x72b6('0xa')](_0x72b6('0xe'),auth[_0x72b6('0xb')](),controller[_0x72b6('0xf')]);router[_0x72b6('0x10')]('/',auth['isAuthenticated'](),controller[_0x72b6('0x11')]);router['put'](_0x72b6('0xe'),auth[_0x72b6('0xb')](),controller[_0x72b6('0x12')]);router['delete'](_0x72b6('0xe'),auth[_0x72b6('0xb')](),controller[_0x72b6('0x13')]);module[_0x72b6('0x14')]=router; \ No newline at end of file +var _0xd311=['update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','/describe','describe','/:id','post','put'];(function(_0x50e347,_0x537dc7){var _0x3d7684=function(_0x244ee2){while(--_0x244ee2){_0x50e347['push'](_0x50e347['shift']());}};_0x3d7684(++_0x537dc7);}(_0xd311,0x143));var _0x1d31=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd311[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x1d31('0x0'));var util=require(_0x1d31('0x1'));var path=require(_0x1d31('0x2'));var timeout=require(_0x1d31('0x3'));var express=require('express');var router=express[_0x1d31('0x4')]();var fs_extra=require(_0x1d31('0x5'));var auth=require(_0x1d31('0x6'));var interaction=require(_0x1d31('0x7'));var config=require(_0x1d31('0x8'));var controller=require(_0x1d31('0x9'));router[_0x1d31('0xa')]('/',auth[_0x1d31('0xb')](),controller['index']);router[_0x1d31('0xa')](_0x1d31('0xc'),auth[_0x1d31('0xb')](),controller[_0x1d31('0xd')]);router[_0x1d31('0xa')](_0x1d31('0xe'),auth[_0x1d31('0xb')](),controller['show']);router[_0x1d31('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1d31('0x10')](_0x1d31('0xe'),auth[_0x1d31('0xb')](),controller[_0x1d31('0x11')]);router['delete']('/:id',auth[_0x1d31('0xb')](),controller[_0x1d31('0x12')]);module[_0x1d31('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 0d64b76..2bde8d2 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 _0xfe34=['sequelize','exports','STRING'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0xfe34,0xb4));var _0x4fe3=function(_0x84b79c,_0xb11dd4){_0x84b79c=_0x84b79c-0x0;var _0x3a09a1=_0xfe34[_0x84b79c];return _0x3a09a1;};'use strict';var Sequelize=require(_0x4fe3('0x0'));module[_0x4fe3('0x1')]={'name':{'type':Sequelize[_0x4fe3('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x4fe3('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x3fbd=['exports','STRING','INTEGER','sequelize'];(function(_0x7d0b1f,_0x1397e6){var _0x2de201=function(_0x4db863){while(--_0x4db863){_0x7d0b1f['push'](_0x7d0b1f['shift']());}};_0x2de201(++_0x1397e6);}(_0x3fbd,0x1b3));var _0xd3fb=function(_0x1637b5,_0x12da04){_0x1637b5=_0x1637b5-0x0;var _0x131de8=_0x3fbd[_0x1637b5];return _0x131de8;};'use strict';var Sequelize=require(_0xd3fb('0x0'));module[_0xd3fb('0x1')]={'name':{'type':Sequelize[_0xd3fb('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xd3fb('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xd3fb('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index a31f0f3..62bca3f 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 _0xc1c6=['filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','UserProfileResource','rawAttributes','type','key','model','query'];(function(_0xfde719,_0x128ccf){var _0x51fa79=function(_0x208141){while(--_0x208141){_0xfde719['push'](_0xfde719['shift']());}};_0x51fa79(++_0x128ccf);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x3360e9,_0xa46861){_0x3360e9=_0x3360e9-0x0;var _0x53f022=_0xc1c6[_0x3360e9];return _0x53f022;};'use strict';var emlformat=require(_0x6c1c('0x0'));var rimraf=require(_0x6c1c('0x1'));var zipdir=require(_0x6c1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c1c('0x3'));var moment=require('moment');var BPromise=require(_0x6c1c('0x4'));var Mustache=require(_0x6c1c('0x5'));var util=require(_0x6c1c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6c1c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c1c('0x8'));var _=require('lodash');var squel=require(_0x6c1c('0x9'));var crypto=require(_0x6c1c('0xa'));var jsforce=require(_0x6c1c('0xb'));var deskjs=require(_0x6c1c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6c1c('0xd'));var Papa=require(_0x6c1c('0xe'));var Redis=require('ioredis');var authService=require(_0x6c1c('0xf'));var qs=require(_0x6c1c('0x10'));var as=require(_0x6c1c('0x11'));var hardwareService=require(_0x6c1c('0x12'));var logger=require('../../config/logger')(_0x6c1c('0x13'));var utils=require(_0x6c1c('0x14'));var config=require(_0x6c1c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c1c('0x16'))['db'];function respondWithStatusCode(_0x12a9e6,_0x2067bd){_0x2067bd=_0x2067bd||0xcc;return function(_0x49304f){if(_0x49304f){return _0x12a9e6[_0x6c1c('0x17')](_0x2067bd);}return _0x12a9e6['status'](_0x2067bd)[_0x6c1c('0x18')]();};}function respondWithResult(_0x15a1fc,_0x2d279e){_0x2d279e=_0x2d279e||0xc8;return function(_0x154107){if(_0x154107){return _0x15a1fc[_0x6c1c('0x19')](_0x2d279e)[_0x6c1c('0x1a')](_0x154107);}};}function respondWithFilteredResult(_0x297c33,_0x41aa74){return function(_0x448f35){if(_0x448f35){var _0x5f3758=typeof _0x41aa74[_0x6c1c('0x1b')]===_0x6c1c('0x1c')&&typeof _0x41aa74['limit']===_0x6c1c('0x1c');var _0x237cac=_0x448f35['count'];var _0x137770=_0x5f3758?0x0:_0x41aa74['offset'];var _0x338dc2=_0x5f3758?_0x448f35[_0x6c1c('0x1d')]:_0x41aa74['offset']+_0x41aa74[_0x6c1c('0x1e')];var _0x59ab38;if(_0x338dc2>=_0x237cac){_0x338dc2=_0x237cac;_0x59ab38=0xc8;}else{_0x59ab38=0xce;}_0x297c33[_0x6c1c('0x19')](_0x59ab38);return _0x297c33[_0x6c1c('0x1f')](_0x6c1c('0x20'),_0x137770+'-'+_0x338dc2+'/'+_0x237cac)[_0x6c1c('0x1a')](_0x448f35);}return null;};}function patchUpdates(_0x1acf7f){return function(_0x1efb19){try{jsonpatch[_0x6c1c('0x21')](_0x1efb19,_0x1acf7f,!![]);}catch(_0x2ed830){return BPromise[_0x6c1c('0x22')](_0x2ed830);}return _0x1efb19[_0x6c1c('0x23')]();};}function saveUpdates(_0x3d2bf3,_0x450b1f){return function(_0x2382c0){if(_0x2382c0){return _0x2382c0[_0x6c1c('0x24')](_0x3d2bf3)[_0x6c1c('0x25')](function(_0x19c269){return _0x19c269;});}return null;};}function removeEntity(_0x2319d3,_0x12c638){return function(_0x3a3f13){if(_0x3a3f13){return _0x3a3f13[_0x6c1c('0x26')]()[_0x6c1c('0x25')](function(){_0x2319d3[_0x6c1c('0x19')](0xcc)[_0x6c1c('0x18')]();});}};}function handleEntityNotFound(_0x7ff10d,_0x18452d){return function(_0x80bc05){if(!_0x80bc05){_0x7ff10d[_0x6c1c('0x17')](0x194);}return _0x80bc05;};}function handleError(_0x1b9d7d,_0x2feaf4){_0x2feaf4=_0x2feaf4||0x1f4;return function(_0x5f4568){logger[_0x6c1c('0x27')](_0x5f4568['stack']);if(_0x5f4568[_0x6c1c('0x28')]){delete _0x5f4568['name'];}_0x1b9d7d[_0x6c1c('0x19')](_0x2feaf4)['send'](_0x5f4568);};}exports[_0x6c1c('0x29')]=function(_0xf557ba,_0x504348){var _0x3b1a4f={},_0x24da4c={},_0x4e13e3={'count':0x0,'rows':[]};var _0x3b319a=_[_0x6c1c('0x2a')](db[_0x6c1c('0x2b')][_0x6c1c('0x2c')],function(_0x4fc279){return{'name':_0x4fc279['fieldName'],'type':_0x4fc279[_0x6c1c('0x2d')][_0x6c1c('0x2e')]};});_0x24da4c[_0x6c1c('0x2f')]=_[_0x6c1c('0x2a')](_0x3b319a,_0x6c1c('0x28'));_0x24da4c[_0x6c1c('0x30')]=_['keys'](_0xf557ba[_0x6c1c('0x30')]);_0x24da4c[_0x6c1c('0x31')]=_['intersection'](_0x24da4c[_0x6c1c('0x2f')],_0x24da4c[_0x6c1c('0x30')]);_0x3b1a4f[_0x6c1c('0x32')]=_[_0x6c1c('0x33')](_0x24da4c['model'],qs[_0x6c1c('0x34')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x3b1a4f['attributes']=_0x3b1a4f[_0x6c1c('0x32')]['length']?_0x3b1a4f[_0x6c1c('0x32')]:_0x24da4c['model'];if(!_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x35')](_0x6c1c('0x36'))){_0x3b1a4f['limit']=qs['limit'](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x1e')]);_0x3b1a4f[_0x6c1c('0x1b')]=qs['offset'](_0xf557ba[_0x6c1c('0x30')]['offset']);}_0x3b1a4f['order']=qs[_0x6c1c('0x37')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x37')]);_0x3b1a4f[_0x6c1c('0x38')]=qs['filters'](_[_0x6c1c('0x39')](_0xf557ba[_0x6c1c('0x30')],_0x24da4c[_0x6c1c('0x31')]),_0x3b319a);if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]){_0x3b1a4f[_0x6c1c('0x38')]=_[_0x6c1c('0x3b')](_0x3b1a4f[_0x6c1c('0x38')],{'$or':_[_0x6c1c('0x2a')](_0x3b319a,function(_0x232508){if(_0x232508['type']!==_0x6c1c('0x3c')){var _0x464549={};_0x464549[_0x232508[_0x6c1c('0x28')]]={'$like':'%'+_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]+'%'};return _0x464549;}})});}_0x3b1a4f=_['merge']({},_0x3b1a4f,_0xf557ba['options']);var _0x549db1={'where':_0x3b1a4f[_0x6c1c('0x38')]};return db['UserProfileResource']['count'](_0x549db1)[_0x6c1c('0x25')](function(_0x37244e){_0x4e13e3['count']=_0x37244e;if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x3b1a4f[_0x6c1c('0x3e')]=[{'all':!![]}];}return db['UserProfileResource'][_0x6c1c('0x3f')](_0x3b1a4f);})[_0x6c1c('0x25')](function(_0x502e75){_0x4e13e3[_0x6c1c('0x40')]=_0x502e75;return _0x4e13e3;})['then'](respondWithFilteredResult(_0x504348,_0x3b1a4f))[_0x6c1c('0x41')](handleError(_0x504348,null));};exports[_0x6c1c('0x42')]=function(_0x16a389,_0x174f2c){var _0x10764a={'raw':![],'where':{'id':_0x16a389[_0x6c1c('0x43')]['id']}},_0x595ba2={};_0x595ba2[_0x6c1c('0x2f')]=_[_0x6c1c('0x44')](db['UserProfileResource'][_0x6c1c('0x2c')]);_0x595ba2[_0x6c1c('0x30')]=_[_0x6c1c('0x44')](_0x16a389[_0x6c1c('0x30')]);_0x595ba2[_0x6c1c('0x31')]=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],_0x595ba2['query']);_0x10764a['attributes']=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],qs[_0x6c1c('0x34')](_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x10764a[_0x6c1c('0x32')]=_0x10764a[_0x6c1c('0x32')][_0x6c1c('0x45')]?_0x10764a[_0x6c1c('0x32')]:_0x595ba2['model'];if(_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x10764a['include']=[{'all':!![]}];}_0x10764a=_[_0x6c1c('0x3b')]({},_0x10764a,_0x16a389['options']);return db[_0x6c1c('0x2b')][_0x6c1c('0x46')](_0x10764a)[_0x6c1c('0x25')](handleEntityNotFound(_0x174f2c,null))[_0x6c1c('0x25')](respondWithResult(_0x174f2c,null))[_0x6c1c('0x41')](handleError(_0x174f2c,null));};exports['create']=function(_0x1fe6e8,_0x58d075){return db[_0x6c1c('0x2b')][_0x6c1c('0x47')](_0x1fe6e8[_0x6c1c('0x48')],{})[_0x6c1c('0x25')](respondWithResult(_0x58d075,0xc9))[_0x6c1c('0x41')](handleError(_0x58d075,null));};exports[_0x6c1c('0x24')]=function(_0x52c14d,_0xa9889a){if(_0x52c14d[_0x6c1c('0x48')]['id']){delete _0x52c14d['body']['id'];}return db[_0x6c1c('0x2b')][_0x6c1c('0x46')]({'where':{'id':_0x52c14d[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0xa9889a,null))['then'](saveUpdates(_0x52c14d[_0x6c1c('0x48')],null))[_0x6c1c('0x25')](respondWithResult(_0xa9889a,null))[_0x6c1c('0x41')](handleError(_0xa9889a,null));};exports['destroy']=function(_0x5b8d69,_0x56b367){return db['UserProfileResource']['find']({'where':{'id':_0x5b8d69[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0x56b367,null))['then'](removeEntity(_0x56b367,null))[_0x6c1c('0x41')](handleError(_0x56b367,null));};exports[_0x6c1c('0x49')]=function(_0x2450ab,_0x5489ac){return db['UserProfileResource'][_0x6c1c('0x49')]()[_0x6c1c('0x25')](respondWithResult(_0x5489ac,null))['catch'](handleError(_0x5489ac,null));}; \ No newline at end of file +var _0x4137=['key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','show','params','includeAll','options','find','catch','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','json','offset','limit','count','set','apply','reject','save','update','destroy','then','end','sendStatus','error','name','send','index','map','UserProfileResource','rawAttributes','type'];(function(_0x3fab8d,_0x3a43e0){var _0x652a13=function(_0x53cf7d){while(--_0x53cf7d){_0x3fab8d['push'](_0x3fab8d['shift']());}};_0x652a13(++_0x3a43e0);}(_0x4137,0xf8));var _0x7413=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x4137[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require(_0x7413('0x0'));var rimraf=require(_0x7413('0x1'));var zipdir=require(_0x7413('0x2'));var jsonpatch=require(_0x7413('0x3'));var rp=require(_0x7413('0x4'));var moment=require(_0x7413('0x5'));var BPromise=require(_0x7413('0x6'));var Mustache=require(_0x7413('0x7'));var util=require(_0x7413('0x8'));var path=require(_0x7413('0x9'));var sox=require(_0x7413('0xa'));var csv=require(_0x7413('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7413('0xc'));var _=require(_0x7413('0xd'));var squel=require(_0x7413('0xe'));var crypto=require(_0x7413('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7413('0x10'));var toCsv=require(_0x7413('0xb'));var querystring=require('querystring');var Papa=require(_0x7413('0x11'));var Redis=require(_0x7413('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x7413('0x13'));var as=require(_0x7413('0x14'));var hardwareService=require(_0x7413('0x15'));var logger=require(_0x7413('0x16'))(_0x7413('0x17'));var utils=require('../../config/utils');var config=require(_0x7413('0x18'));var licenseUtil=require(_0x7413('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18a874,_0xa26ca4){_0xa26ca4=_0xa26ca4||0xcc;return function(_0x13e6bd){if(_0x13e6bd){return _0x18a874['sendStatus'](_0xa26ca4);}return _0x18a874['status'](_0xa26ca4)['end']();};}function respondWithResult(_0x2267f6,_0x336c4c){_0x336c4c=_0x336c4c||0xc8;return function(_0x49f0f6){if(_0x49f0f6){return _0x2267f6[_0x7413('0x1a')](_0x336c4c)[_0x7413('0x1b')](_0x49f0f6);}};}function respondWithFilteredResult(_0x4955d3,_0x38b3d1){return function(_0x50f301){if(_0x50f301){var _0x4b9a5b=typeof _0x38b3d1[_0x7413('0x1c')]==='undefined'&&typeof _0x38b3d1[_0x7413('0x1d')]==='undefined';var _0x2036b6=_0x50f301[_0x7413('0x1e')];var _0x19157f=_0x4b9a5b?0x0:_0x38b3d1[_0x7413('0x1c')];var _0x2a3417=_0x4b9a5b?_0x50f301[_0x7413('0x1e')]:_0x38b3d1['offset']+_0x38b3d1[_0x7413('0x1d')];var _0x17c062;if(_0x2a3417>=_0x2036b6){_0x2a3417=_0x2036b6;_0x17c062=0xc8;}else{_0x17c062=0xce;}_0x4955d3[_0x7413('0x1a')](_0x17c062);return _0x4955d3[_0x7413('0x1f')]('Content-Range',_0x19157f+'-'+_0x2a3417+'/'+_0x2036b6)[_0x7413('0x1b')](_0x50f301);}return null;};}function patchUpdates(_0x12d94d){return function(_0x206afc){try{jsonpatch[_0x7413('0x20')](_0x206afc,_0x12d94d,!![]);}catch(_0x409392){return BPromise[_0x7413('0x21')](_0x409392);}return _0x206afc[_0x7413('0x22')]();};}function saveUpdates(_0x4e18cb,_0x56a06a){return function(_0x5f12a2){if(_0x5f12a2){return _0x5f12a2[_0x7413('0x23')](_0x4e18cb)['then'](function(_0x1585ba){return _0x1585ba;});}return null;};}function removeEntity(_0x372944,_0x3b0c81){return function(_0x2fc0f4){if(_0x2fc0f4){return _0x2fc0f4[_0x7413('0x24')]()[_0x7413('0x25')](function(){_0x372944[_0x7413('0x1a')](0xcc)[_0x7413('0x26')]();});}};}function handleEntityNotFound(_0x1d455b,_0x5a8329){return function(_0x5cb15f){if(!_0x5cb15f){_0x1d455b[_0x7413('0x27')](0x194);}return _0x5cb15f;};}function handleError(_0x48c2dc,_0x46c895){_0x46c895=_0x46c895||0x1f4;return function(_0x71cbb4){logger[_0x7413('0x28')](_0x71cbb4['stack']);if(_0x71cbb4[_0x7413('0x29')]){delete _0x71cbb4[_0x7413('0x29')];}_0x48c2dc[_0x7413('0x1a')](_0x46c895)[_0x7413('0x2a')](_0x71cbb4);};}exports[_0x7413('0x2b')]=function(_0x2e521f,_0x5eb4d9){var _0x24dce7={},_0x4ed662={},_0x1d0bde={'count':0x0,'rows':[]};var _0x23e682=_[_0x7413('0x2c')](db[_0x7413('0x2d')][_0x7413('0x2e')],function(_0x2004ea){return{'name':_0x2004ea['fieldName'],'type':_0x2004ea[_0x7413('0x2f')][_0x7413('0x30')]};});_0x4ed662[_0x7413('0x31')]=_[_0x7413('0x2c')](_0x23e682,_0x7413('0x29'));_0x4ed662[_0x7413('0x32')]=_[_0x7413('0x33')](_0x2e521f['query']);_0x4ed662[_0x7413('0x34')]=_[_0x7413('0x35')](_0x4ed662[_0x7413('0x31')],_0x4ed662[_0x7413('0x32')]);_0x24dce7[_0x7413('0x36')]=_['intersection'](_0x4ed662[_0x7413('0x31')],qs['fields'](_0x2e521f[_0x7413('0x32')][_0x7413('0x37')]));_0x24dce7[_0x7413('0x36')]=_0x24dce7['attributes'][_0x7413('0x38')]?_0x24dce7['attributes']:_0x4ed662[_0x7413('0x31')];if(!_0x2e521f[_0x7413('0x32')]['hasOwnProperty']('nolimit')){_0x24dce7[_0x7413('0x1d')]=qs[_0x7413('0x1d')](_0x2e521f[_0x7413('0x32')]['limit']);_0x24dce7['offset']=qs[_0x7413('0x1c')](_0x2e521f['query']['offset']);}_0x24dce7[_0x7413('0x39')]=qs['sort'](_0x2e521f[_0x7413('0x32')][_0x7413('0x3a')]);_0x24dce7[_0x7413('0x3b')]=qs[_0x7413('0x34')](_[_0x7413('0x3c')](_0x2e521f['query'],_0x4ed662[_0x7413('0x34')]),_0x23e682);if(_0x2e521f[_0x7413('0x32')][_0x7413('0x3d')]){_0x24dce7[_0x7413('0x3b')]=_[_0x7413('0x3e')](_0x24dce7[_0x7413('0x3b')],{'$or':_[_0x7413('0x2c')](_0x23e682,function(_0x385156){if(_0x385156[_0x7413('0x2f')]!==_0x7413('0x3f')){var _0x5c03eb={};_0x5c03eb[_0x385156[_0x7413('0x29')]]={'$like':'%'+_0x2e521f['query'][_0x7413('0x3d')]+'%'};return _0x5c03eb;}})});}_0x24dce7=_['merge']({},_0x24dce7,_0x2e521f['options']);var _0x5b592c={'where':_0x24dce7['where']};return db['UserProfileResource'][_0x7413('0x1e')](_0x5b592c)['then'](function(_0x535e49){_0x1d0bde[_0x7413('0x1e')]=_0x535e49;if(_0x2e521f['query']['includeAll']){_0x24dce7[_0x7413('0x40')]=[{'all':!![]}];}return db[_0x7413('0x2d')][_0x7413('0x41')](_0x24dce7);})[_0x7413('0x25')](function(_0x8049c0){_0x1d0bde['rows']=_0x8049c0;return _0x1d0bde;})[_0x7413('0x25')](respondWithFilteredResult(_0x5eb4d9,_0x24dce7))['catch'](handleError(_0x5eb4d9,null));};exports[_0x7413('0x42')]=function(_0x1d8219,_0xa063d1){var _0xfe0daa={'raw':![],'where':{'id':_0x1d8219[_0x7413('0x43')]['id']}},_0x3f7da2={};_0x3f7da2[_0x7413('0x31')]=_[_0x7413('0x33')](db[_0x7413('0x2d')][_0x7413('0x2e')]);_0x3f7da2[_0x7413('0x32')]=_[_0x7413('0x33')](_0x1d8219[_0x7413('0x32')]);_0x3f7da2['filters']=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],_0x3f7da2[_0x7413('0x32')]);_0xfe0daa[_0x7413('0x36')]=_[_0x7413('0x35')](_0x3f7da2[_0x7413('0x31')],qs[_0x7413('0x37')](_0x1d8219[_0x7413('0x32')][_0x7413('0x37')]));_0xfe0daa[_0x7413('0x36')]=_0xfe0daa[_0x7413('0x36')]['length']?_0xfe0daa[_0x7413('0x36')]:_0x3f7da2['model'];if(_0x1d8219[_0x7413('0x32')][_0x7413('0x44')]){_0xfe0daa[_0x7413('0x40')]=[{'all':!![]}];}_0xfe0daa=_[_0x7413('0x3e')]({},_0xfe0daa,_0x1d8219[_0x7413('0x45')]);return db[_0x7413('0x2d')][_0x7413('0x46')](_0xfe0daa)[_0x7413('0x25')](handleEntityNotFound(_0xa063d1,null))[_0x7413('0x25')](respondWithResult(_0xa063d1,null))[_0x7413('0x47')](handleError(_0xa063d1,null));};exports['create']=function(_0x513657,_0x3c1f1a){return db['UserProfileResource']['create'](_0x513657[_0x7413('0x48')],{})[_0x7413('0x25')](respondWithResult(_0x3c1f1a,0xc9))['catch'](handleError(_0x3c1f1a,null));};exports[_0x7413('0x23')]=function(_0x586d25,_0x562bae){if(_0x586d25[_0x7413('0x48')]['id']){delete _0x586d25['body']['id'];}return db[_0x7413('0x2d')][_0x7413('0x46')]({'where':{'id':_0x586d25[_0x7413('0x43')]['id']}})[_0x7413('0x25')](handleEntityNotFound(_0x562bae,null))[_0x7413('0x25')](saveUpdates(_0x586d25[_0x7413('0x48')],null))[_0x7413('0x25')](respondWithResult(_0x562bae,null))[_0x7413('0x47')](handleError(_0x562bae,null));};exports[_0x7413('0x24')]=function(_0x2031e3,_0x50a27d){return db[_0x7413('0x2d')]['find']({'where':{'id':_0x2031e3['params']['id']}})['then'](handleEntityNotFound(_0x50a27d,null))[_0x7413('0x25')](removeEntity(_0x50a27d,null))[_0x7413('0x47')](handleError(_0x50a27d,null));};exports[_0x7413('0x49')]=function(_0x1ba4e9,_0x4bc337){return db['UserProfileResource'][_0x7413('0x49')]()['then'](respondWithResult(_0x4bc337,null))[_0x7413('0x47')](handleError(_0x4bc337,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 87e1fa1..867ca58 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 _0x7ed2=['request-promise','path','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','../../config/logger','bluebird'];(function(_0x5bad56,_0x146f81){var _0x17abe3=function(_0x496d33){while(--_0x496d33){_0x5bad56['push'](_0x5bad56['shift']());}};_0x17abe3(++_0x146f81);}(_0x7ed2,0x192));var _0x27ed=function(_0x4e0fd6,_0x16bc28){_0x4e0fd6=_0x4e0fd6-0x0;var _0x50a6ef=_0x7ed2[_0x4e0fd6];return _0x50a6ef;};'use strict';var _=require(_0x27ed('0x0'));var util=require(_0x27ed('0x1'));var logger=require(_0x27ed('0x2'))('api');var moment=require('moment');var BPromise=require(_0x27ed('0x3'));var rp=require(_0x27ed('0x4'));var fs=require('fs');var path=require(_0x27ed('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x27ed('0x6'));module[_0x27ed('0x7')]=function(_0x204f22,_0x3e6f0c){return _0x204f22[_0x27ed('0x8')](_0x27ed('0x9'),attributes,{'tableName':_0x27ed('0xa'),'paranoid':![],'indexes':[{'name':_0x27ed('0xb'),'fields':[_0x27ed('0xc'),_0x27ed('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb9ea=['exports','UserProfileResource','user_profile_has_resources','compositeIndex','sectionId','lodash','util','api','moment','request-promise','path','rimraf','./userProfileResource.attributes'];(function(_0x3bd709,_0x7dffd8){var _0x37813e=function(_0x1c6c2b){while(--_0x1c6c2b){_0x3bd709['push'](_0x3bd709['shift']());}};_0x37813e(++_0x7dffd8);}(_0xb9ea,0x1f3));var _0xab9e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb9ea[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xab9e('0x0'));var util=require(_0xab9e('0x1'));var logger=require('../../config/logger')(_0xab9e('0x2'));var moment=require(_0xab9e('0x3'));var BPromise=require('bluebird');var rp=require(_0xab9e('0x4'));var fs=require('fs');var path=require(_0xab9e('0x5'));var rimraf=require(_0xab9e('0x6'));var config=require('../../config/environment');var attributes=require(_0xab9e('0x7'));module[_0xab9e('0x8')]=function(_0x2ece21,_0x26d55c){return _0x2ece21['define'](_0xab9e('0x9'),attributes,{'tableName':_0xab9e('0xa'),'paranoid':![],'indexes':[{'name':_0xab9e('0xb'),'fields':['resourceId',_0xab9e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 86cb698..dd8eace 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 _0xefcd=['rpc','../../config/environment','client','then','info','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xefcd,0x9a));var _0xdefc=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xefcd[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xdefc('0x0'));var util=require('util');var moment=require(_0xdefc('0x1'));var BPromise=require('bluebird');var rs=require(_0xdefc('0x2'));var fs=require('fs');var Redis=require(_0xdefc('0x3'));var db=require(_0xdefc('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdefc('0x5'))(_0xdefc('0x6'));var config=require(_0xdefc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdefc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x56082a,_0x445343,_0x230355){return new BPromise(function(_0x5eb66f,_0x3a15b6){return client['request'](_0x56082a,_0x230355)[_0xdefc('0x9')](function(_0x3369d){logger[_0xdefc('0xa')](_0xdefc('0xb'),_0x445343,'request\x20sent');logger[_0xdefc('0xc')](_0xdefc('0xd'),_0x445343,_0xdefc('0xe'),JSON[_0xdefc('0xf')](_0x3369d));if(_0x3369d[_0xdefc('0x10')]){if(_0x3369d[_0xdefc('0x10')]['code']===0x1f4){logger[_0xdefc('0x10')](_0xdefc('0xb'),_0x445343,_0x3369d[_0xdefc('0x10')]['message']);return _0x3a15b6(_0x3369d[_0xdefc('0x10')][_0xdefc('0x11')]);}logger[_0xdefc('0x10')](_0xdefc('0xb'),_0x445343,_0x3369d['error'][_0xdefc('0x11')]);return _0x5eb66f(_0x3369d[_0xdefc('0x10')][_0xdefc('0x11')]);}else{logger[_0xdefc('0xa')](_0xdefc('0xb'),_0x445343,_0xdefc('0xe'));_0x5eb66f(_0x3369d[_0xdefc('0x12')][_0xdefc('0x11')]);}})[_0xdefc('0x13')](function(_0x135be1){logger[_0xdefc('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x445343,_0x135be1);_0x3a15b6(_0x135be1);});});} \ No newline at end of file +var _0x1939=['message','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0xfdf571,_0x18a56e){var _0x2b405c=function(_0x96f776){while(--_0x96f776){_0xfdf571['push'](_0xfdf571['shift']());}};_0x2b405c(++_0x18a56e);}(_0x1939,0x144));var _0x9193=function(_0x2fb87c,_0x2dee49){_0x2fb87c=_0x2fb87c-0x0;var _0x43038b=_0x1939[_0x2fb87c];return _0x43038b;};'use strict';var _=require(_0x9193('0x0'));var util=require(_0x9193('0x1'));var moment=require('moment');var BPromise=require(_0x9193('0x2'));var rs=require(_0x9193('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9193('0x4'))['db'];var utils=require(_0x9193('0x5'));var logger=require(_0x9193('0x6'))(_0x9193('0x7'));var config=require('../../config/environment');var jayson=require(_0x9193('0x8'));var client=jayson[_0x9193('0x9')][_0x9193('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x519188,_0x4710e6,_0x1c3be0){return new BPromise(function(_0x1c96f7,_0x52ab7c){return client['request'](_0x519188,_0x1c3be0)[_0x9193('0xb')](function(_0x34cad6){logger[_0x9193('0xc')](_0x9193('0xd'),_0x4710e6,_0x9193('0xe'));logger[_0x9193('0xf')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x4710e6,_0x9193('0xe'),JSON[_0x9193('0x10')](_0x34cad6));if(_0x34cad6[_0x9193('0x11')]){if(_0x34cad6[_0x9193('0x11')]['code']===0x1f4){logger[_0x9193('0x11')](_0x9193('0xd'),_0x4710e6,_0x34cad6['error'][_0x9193('0x12')]);return _0x52ab7c(_0x34cad6[_0x9193('0x11')][_0x9193('0x12')]);}logger[_0x9193('0x11')](_0x9193('0xd'),_0x4710e6,_0x34cad6[_0x9193('0x11')][_0x9193('0x12')]);return _0x1c96f7(_0x34cad6[_0x9193('0x11')][_0x9193('0x12')]);}else{logger[_0x9193('0xc')](_0x9193('0xd'),_0x4710e6,_0x9193('0xe'));_0x1c96f7(_0x34cad6['result'][_0x9193('0x12')]);}})['catch'](function(_0x189cb9){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x4710e6,_0x189cb9);_0x52ab7c(_0x189cb9);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index b472709..0b1ec5a 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 _0xed45=['create','delete','destroy','exports','path','fs-extra','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed45,0x1d4));var _0x5ed4=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0xed45[_0x1035c1];return _0x308d67;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5ed4('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x5ed4('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x5ed4('0x2'));var config=require(_0x5ed4('0x3'));var controller=require(_0x5ed4('0x4'));router[_0x5ed4('0x5')]('/',auth[_0x5ed4('0x6')](),controller[_0x5ed4('0x7')]);router[_0x5ed4('0x5')](_0x5ed4('0x8'),auth[_0x5ed4('0x6')](),controller[_0x5ed4('0x9')]);router[_0x5ed4('0x5')](_0x5ed4('0xa'),auth['isAuthenticated'](),controller[_0x5ed4('0xb')]);router['post']('/',auth[_0x5ed4('0x6')](),controller[_0x5ed4('0xc')]);router['put'](_0x5ed4('0xa'),auth[_0x5ed4('0x6')](),controller['update']);router[_0x5ed4('0xd')]('/:id',auth[_0x5ed4('0x6')](),controller[_0x5ed4('0xe')]);module[_0x5ed4('0xf')]=router; \ No newline at end of file +var _0xc208=['express','Router','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','get','isAuthenticated','/:id','post','create','update','delete','exports','multer','util','path','connect-timeout'];(function(_0x42b424,_0x162cdf){var _0x308491=function(_0x1c0e6b){while(--_0x1c0e6b){_0x42b424['push'](_0x42b424['shift']());}};_0x308491(++_0x162cdf);}(_0xc208,0xb7));var _0x8c20=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc208[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x8c20('0x0'));var util=require(_0x8c20('0x1'));var path=require(_0x8c20('0x2'));var timeout=require(_0x8c20('0x3'));var express=require(_0x8c20('0x4'));var router=express[_0x8c20('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x8c20('0x6'));var interaction=require(_0x8c20('0x7'));var config=require('../../config/environment');var controller=require(_0x8c20('0x8'));router[_0x8c20('0x9')]('/',auth[_0x8c20('0xa')](),controller['index']);router[_0x8c20('0x9')]('/describe',auth[_0x8c20('0xa')](),controller['describe']);router[_0x8c20('0x9')](_0x8c20('0xb'),auth[_0x8c20('0xa')](),controller['show']);router[_0x8c20('0xc')]('/',auth[_0x8c20('0xa')](),controller[_0x8c20('0xd')]);router['put'](_0x8c20('0xb'),auth[_0x8c20('0xa')](),controller[_0x8c20('0xe')]);router[_0x8c20('0xf')](_0x8c20('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x8c20('0x10')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 3110d1b..d114dc5 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 _0x9ffd=['exports','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','getDataValue','split','sequelize'];(function(_0x43192f,_0x45e191){var _0x227deb=function(_0x58a9c4){while(--_0x58a9c4){_0x43192f['push'](_0x43192f['shift']());}};_0x227deb(++_0x45e191);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x4aa922,_0x3d9780){_0x4aa922=_0x4aa922-0x0;var _0xe786ac=_0x9ffd[_0x4aa922];return _0xe786ac;};'use strict';var Sequelize=require(_0xd9ff('0x0'));module[_0xd9ff('0x1')]={'name':{'type':Sequelize[_0xd9ff('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0xd9ff('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xd9ff('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xd9ff('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xd9ff('0x2')],'set':function(_0x53e962){this[_0xd9ff('0x5')](_0xd9ff('0x6'),_0x53e962?_0x53e962['join'](''):[]);},'get':function(){return this[_0xd9ff('0x7')](_0xd9ff('0x6'))?this[_0xd9ff('0x7')](_0xd9ff('0x6'))[_0xd9ff('0x8')](''):[];}}}; \ No newline at end of file +var _0x0565=['exports','STRING','INTEGER','BOOLEAN','setDataValue','join','getDataValue','crudPermissions','sequelize'];(function(_0x5cd32e,_0x3b2c6d){var _0x4cc07e=function(_0x2ce1eb){while(--_0x2ce1eb){_0x5cd32e['push'](_0x5cd32e['shift']());}};_0x4cc07e(++_0x3b2c6d);}(_0x0565,0xf2));var _0x5056=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0x0565[_0x39d544];return _0x5a5ff2;};'use strict';var Sequelize=require(_0x5056('0x0'));module[_0x5056('0x1')]={'name':{'type':Sequelize[_0x5056('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x5056('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x5056('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x5056('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x5056('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x5056('0x2')],'set':function(_0x3657a8){this[_0x5056('0x5')]('crudPermissions',_0x3657a8?_0x3657a8[_0x5056('0x6')](''):[]);},'get':function(){return this[_0x5056('0x7')](_0x5056('0x8'))?this[_0x5056('0x7')]('crudPermissions')['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index ce0728e..05c7f7c 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 _0xb69b=['filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','map','UserProfileSection','rawAttributes','type','key','query','keys'];(function(_0x5e3665,_0x369ac8){var _0x187299=function(_0x5c37f8){while(--_0x5c37f8){_0x5e3665['push'](_0x5e3665['shift']());}};_0x187299(++_0x369ac8);}(_0xb69b,0xa8));var _0xbb69=function(_0x5b85c5,_0x3f42b6){_0x5b85c5=_0x5b85c5-0x0;var _0x6d8010=_0xb69b[_0x5b85c5];return _0x6d8010;};'use strict';var emlformat=require(_0xbb69('0x0'));var rimraf=require(_0xbb69('0x1'));var zipdir=require(_0xbb69('0x2'));var jsonpatch=require(_0xbb69('0x3'));var rp=require(_0xbb69('0x4'));var moment=require(_0xbb69('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbb69('0x6'));var util=require(_0xbb69('0x7'));var path=require(_0xbb69('0x8'));var sox=require(_0xbb69('0x9'));var csv=require(_0xbb69('0xa'));var ejs=require(_0xbb69('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb69('0xc'));var squel=require('squel');var crypto=require(_0xbb69('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbb69('0xe'));var toCsv=require(_0xbb69('0xa'));var querystring=require(_0xbb69('0xf'));var Papa=require('papaparse');var Redis=require(_0xbb69('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb69('0x11'));var as=require(_0xbb69('0x12'));var hardwareService=require(_0xbb69('0x13'));var logger=require(_0xbb69('0x14'))(_0xbb69('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbb69('0x16'));var db=require(_0xbb69('0x17'))['db'];function respondWithStatusCode(_0x56315c,_0x3021d3){_0x3021d3=_0x3021d3||0xcc;return function(_0x547694){if(_0x547694){return _0x56315c[_0xbb69('0x18')](_0x3021d3);}return _0x56315c[_0xbb69('0x19')](_0x3021d3)[_0xbb69('0x1a')]();};}function respondWithResult(_0x567cff,_0x39b434){_0x39b434=_0x39b434||0xc8;return function(_0x43cd4e){if(_0x43cd4e){return _0x567cff['status'](_0x39b434)[_0xbb69('0x1b')](_0x43cd4e);}};}function respondWithFilteredResult(_0x5c7c21,_0x4d01e8){return function(_0x3e9d9a){if(_0x3e9d9a){var _0x1e21fb=typeof _0x4d01e8[_0xbb69('0x1c')]===_0xbb69('0x1d')&&typeof _0x4d01e8[_0xbb69('0x1e')]===_0xbb69('0x1d');var _0x2ac774=_0x3e9d9a[_0xbb69('0x1f')];var _0x57406c=_0x1e21fb?0x0:_0x4d01e8[_0xbb69('0x1c')];var _0x3fb920=_0x1e21fb?_0x3e9d9a['count']:_0x4d01e8[_0xbb69('0x1c')]+_0x4d01e8[_0xbb69('0x1e')];var _0x22e549;if(_0x3fb920>=_0x2ac774){_0x3fb920=_0x2ac774;_0x22e549=0xc8;}else{_0x22e549=0xce;}_0x5c7c21['status'](_0x22e549);return _0x5c7c21[_0xbb69('0x20')]('Content-Range',_0x57406c+'-'+_0x3fb920+'/'+_0x2ac774)[_0xbb69('0x1b')](_0x3e9d9a);}return null;};}function patchUpdates(_0x2c80c7){return function(_0x41478b){try{jsonpatch[_0xbb69('0x21')](_0x41478b,_0x2c80c7,!![]);}catch(_0x178d13){return BPromise['reject'](_0x178d13);}return _0x41478b[_0xbb69('0x22')]();};}function saveUpdates(_0x31f3e0,_0x54f99f){return function(_0x3f69ac){if(_0x3f69ac){return _0x3f69ac[_0xbb69('0x23')](_0x31f3e0)[_0xbb69('0x24')](function(_0x5e915a){return _0x5e915a;});}return null;};}function removeEntity(_0xb64f7c,_0x240ed8){return function(_0x57bde1){if(_0x57bde1){return _0x57bde1[_0xbb69('0x25')]()['then'](function(){_0xb64f7c[_0xbb69('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1eb919,_0x241831){return function(_0x171edc){if(!_0x171edc){_0x1eb919[_0xbb69('0x18')](0x194);}return _0x171edc;};}function handleError(_0x42a691,_0x5ab2c4){_0x5ab2c4=_0x5ab2c4||0x1f4;return function(_0x59ec5c){logger['error'](_0x59ec5c[_0xbb69('0x26')]);if(_0x59ec5c['name']){delete _0x59ec5c[_0xbb69('0x27')];}_0x42a691[_0xbb69('0x19')](_0x5ab2c4)[_0xbb69('0x28')](_0x59ec5c);};}exports['index']=function(_0x1227c7,_0x1a7001){var _0x2b36d8={},_0x1780ec={},_0x178327={'count':0x0,'rows':[]};var _0x381129=_[_0xbb69('0x29')](db[_0xbb69('0x2a')][_0xbb69('0x2b')],function(_0x1bfda3){return{'name':_0x1bfda3['fieldName'],'type':_0x1bfda3[_0xbb69('0x2c')][_0xbb69('0x2d')]};});_0x1780ec['model']=_['map'](_0x381129,_0xbb69('0x27'));_0x1780ec[_0xbb69('0x2e')]=_[_0xbb69('0x2f')](_0x1227c7['query']);_0x1780ec[_0xbb69('0x30')]=_[_0xbb69('0x31')](_0x1780ec[_0xbb69('0x32')],_0x1780ec[_0xbb69('0x2e')]);_0x2b36d8[_0xbb69('0x33')]=_[_0xbb69('0x31')](_0x1780ec[_0xbb69('0x32')],qs[_0xbb69('0x34')](_0x1227c7[_0xbb69('0x2e')]['fields']));_0x2b36d8[_0xbb69('0x33')]=_0x2b36d8['attributes'][_0xbb69('0x35')]?_0x2b36d8[_0xbb69('0x33')]:_0x1780ec[_0xbb69('0x32')];if(!_0x1227c7[_0xbb69('0x2e')][_0xbb69('0x36')]('nolimit')){_0x2b36d8[_0xbb69('0x1e')]=qs[_0xbb69('0x1e')](_0x1227c7[_0xbb69('0x2e')]['limit']);_0x2b36d8['offset']=qs[_0xbb69('0x1c')](_0x1227c7[_0xbb69('0x2e')]['offset']);}_0x2b36d8[_0xbb69('0x37')]=qs[_0xbb69('0x38')](_0x1227c7[_0xbb69('0x2e')]['sort']);_0x2b36d8[_0xbb69('0x39')]=qs[_0xbb69('0x30')](_[_0xbb69('0x3a')](_0x1227c7[_0xbb69('0x2e')],_0x1780ec['filters']),_0x381129);if(_0x1227c7[_0xbb69('0x2e')][_0xbb69('0x3b')]){_0x2b36d8[_0xbb69('0x39')]=_[_0xbb69('0x3c')](_0x2b36d8[_0xbb69('0x39')],{'$or':_[_0xbb69('0x29')](_0x381129,function(_0x472832){if(_0x472832['type']!==_0xbb69('0x3d')){var _0x58aeb1={};_0x58aeb1[_0x472832['name']]={'$like':'%'+_0x1227c7['query'][_0xbb69('0x3b')]+'%'};return _0x58aeb1;}})});}_0x2b36d8=_[_0xbb69('0x3c')]({},_0x2b36d8,_0x1227c7[_0xbb69('0x3e')]);var _0x482c5b={'where':_0x2b36d8[_0xbb69('0x39')]};return db['UserProfileSection'][_0xbb69('0x1f')](_0x482c5b)['then'](function(_0x15b97d){_0x178327[_0xbb69('0x1f')]=_0x15b97d;if(_0x1227c7['query'][_0xbb69('0x3f')]){_0x2b36d8['include']=[{'all':!![]}];}return db[_0xbb69('0x2a')]['findAll'](_0x2b36d8);})[_0xbb69('0x24')](function(_0x176789){_0x178327[_0xbb69('0x40')]=_0x176789;return _0x178327;})['then'](respondWithFilteredResult(_0x1a7001,_0x2b36d8))['catch'](handleError(_0x1a7001,null));};exports[_0xbb69('0x41')]=function(_0x4d0ea4,_0x28d60d){var _0x27b422={'raw':![],'where':{'id':_0x4d0ea4[_0xbb69('0x42')]['id']}},_0x24da14={};_0x24da14[_0xbb69('0x32')]=_['keys'](db[_0xbb69('0x2a')][_0xbb69('0x2b')]);_0x24da14['query']=_['keys'](_0x4d0ea4['query']);_0x24da14[_0xbb69('0x30')]=_[_0xbb69('0x31')](_0x24da14['model'],_0x24da14[_0xbb69('0x2e')]);_0x27b422[_0xbb69('0x33')]=_['intersection'](_0x24da14[_0xbb69('0x32')],qs[_0xbb69('0x34')](_0x4d0ea4[_0xbb69('0x2e')]['fields']));_0x27b422[_0xbb69('0x33')]=_0x27b422[_0xbb69('0x33')][_0xbb69('0x35')]?_0x27b422[_0xbb69('0x33')]:_0x24da14[_0xbb69('0x32')];if(_0x4d0ea4[_0xbb69('0x2e')][_0xbb69('0x3f')]){_0x27b422['include']=[{'all':!![]}];}_0x27b422=_[_0xbb69('0x3c')]({},_0x27b422,_0x4d0ea4['options']);return db['UserProfileSection'][_0xbb69('0x43')](_0x27b422)[_0xbb69('0x24')](handleEntityNotFound(_0x28d60d,null))['then'](respondWithResult(_0x28d60d,null))[_0xbb69('0x44')](handleError(_0x28d60d,null));};exports[_0xbb69('0x45')]=function(_0xf08761,_0x3d5f1f){return db[_0xbb69('0x2a')]['create'](_0xf08761['body'],{})[_0xbb69('0x24')](respondWithResult(_0x3d5f1f,0xc9))[_0xbb69('0x44')](handleError(_0x3d5f1f,null));};exports[_0xbb69('0x23')]=function(_0x5c9f92,_0x2d4d84){if(_0x5c9f92[_0xbb69('0x46')]['id']){delete _0x5c9f92[_0xbb69('0x46')]['id'];}return db[_0xbb69('0x2a')][_0xbb69('0x43')]({'where':{'id':_0x5c9f92[_0xbb69('0x42')]['id']}})[_0xbb69('0x24')](handleEntityNotFound(_0x2d4d84,null))[_0xbb69('0x24')](saveUpdates(_0x5c9f92['body'],null))[_0xbb69('0x24')](respondWithResult(_0x2d4d84,null))[_0xbb69('0x44')](handleError(_0x2d4d84,null));};exports[_0xbb69('0x25')]=function(_0x26c84f,_0x4cf21c){return db[_0xbb69('0x2a')][_0xbb69('0x43')]({'where':{'id':_0x26c84f[_0xbb69('0x42')]['id']}})[_0xbb69('0x24')](handleEntityNotFound(_0x4cf21c,null))['then'](removeEntity(_0x4cf21c,null))[_0xbb69('0x44')](handleError(_0x4cf21c,null));};exports[_0xbb69('0x47')]=function(_0x29d331,_0x3494f4){return db[_0xbb69('0x2a')][_0xbb69('0x47')]()[_0xbb69('0x24')](respondWithResult(_0x3494f4,null))[_0xbb69('0x44')](handleError(_0x3494f4,null));}; \ No newline at end of file +var _0xe270=['eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','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','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','error','name','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','rows','catch','show','find','create','body','params','describe'];(function(_0x20876b,_0x2dda29){var _0x424e9e=function(_0x3a7881){while(--_0x3a7881){_0x20876b['push'](_0x20876b['shift']());}};_0x424e9e(++_0x2dda29);}(_0xe270,0x17c));var _0x0e27=function(_0x206a93,_0xa0af93){_0x206a93=_0x206a93-0x0;var _0x44b940=_0xe270[_0x206a93];return _0x44b940;};'use strict';var emlformat=require(_0x0e27('0x0'));var rimraf=require(_0x0e27('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0e27('0x2'));var rp=require('request-promise');var moment=require(_0x0e27('0x3'));var BPromise=require(_0x0e27('0x4'));var Mustache=require(_0x0e27('0x5'));var util=require(_0x0e27('0x6'));var path=require(_0x0e27('0x7'));var sox=require(_0x0e27('0x8'));var csv=require(_0x0e27('0x9'));var ejs=require(_0x0e27('0xa'));var fs=require('fs');var fs_extra=require(_0x0e27('0xb'));var _=require(_0x0e27('0xc'));var squel=require('squel');var crypto=require(_0x0e27('0xd'));var jsforce=require(_0x0e27('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0e27('0x9'));var querystring=require('querystring');var Papa=require(_0x0e27('0xf'));var Redis=require(_0x0e27('0x10'));var authService=require(_0x0e27('0x11'));var qs=require(_0x0e27('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0e27('0x13'));var logger=require(_0x0e27('0x14'))(_0x0e27('0x15'));var utils=require(_0x0e27('0x16'));var config=require(_0x0e27('0x17'));var licenseUtil=require(_0x0e27('0x18'));var db=require(_0x0e27('0x19'))['db'];function respondWithStatusCode(_0x7f86f,_0x3dfc3f){_0x3dfc3f=_0x3dfc3f||0xcc;return function(_0x2ca769){if(_0x2ca769){return _0x7f86f[_0x0e27('0x1a')](_0x3dfc3f);}return _0x7f86f[_0x0e27('0x1b')](_0x3dfc3f)[_0x0e27('0x1c')]();};}function respondWithResult(_0x3b9229,_0x209e2b){_0x209e2b=_0x209e2b||0xc8;return function(_0x2a6fe0){if(_0x2a6fe0){return _0x3b9229[_0x0e27('0x1b')](_0x209e2b)['json'](_0x2a6fe0);}};}function respondWithFilteredResult(_0x283c9a,_0x311efd){return function(_0x2feede){if(_0x2feede){var _0x2f0987=typeof _0x311efd['offset']===_0x0e27('0x1d')&&typeof _0x311efd[_0x0e27('0x1e')]===_0x0e27('0x1d');var _0x21e080=_0x2feede[_0x0e27('0x1f')];var _0x39c0fa=_0x2f0987?0x0:_0x311efd[_0x0e27('0x20')];var _0x7c0645=_0x2f0987?_0x2feede[_0x0e27('0x1f')]:_0x311efd[_0x0e27('0x20')]+_0x311efd[_0x0e27('0x1e')];var _0x28bb96;if(_0x7c0645>=_0x21e080){_0x7c0645=_0x21e080;_0x28bb96=0xc8;}else{_0x28bb96=0xce;}_0x283c9a[_0x0e27('0x1b')](_0x28bb96);return _0x283c9a['set'](_0x0e27('0x21'),_0x39c0fa+'-'+_0x7c0645+'/'+_0x21e080)[_0x0e27('0x22')](_0x2feede);}return null;};}function patchUpdates(_0x422249){return function(_0x503096){try{jsonpatch[_0x0e27('0x23')](_0x503096,_0x422249,!![]);}catch(_0x4e8ed7){return BPromise[_0x0e27('0x24')](_0x4e8ed7);}return _0x503096[_0x0e27('0x25')]();};}function saveUpdates(_0x57d69d,_0x22f177){return function(_0x26be9b){if(_0x26be9b){return _0x26be9b[_0x0e27('0x26')](_0x57d69d)[_0x0e27('0x27')](function(_0xf8e716){return _0xf8e716;});}return null;};}function removeEntity(_0x475fb7,_0x3f14a1){return function(_0x36f3f2){if(_0x36f3f2){return _0x36f3f2[_0x0e27('0x28')]()[_0x0e27('0x27')](function(){_0x475fb7[_0x0e27('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cb3b7,_0x42487b){return function(_0x5a04f8){if(!_0x5a04f8){_0x2cb3b7['sendStatus'](0x194);}return _0x5a04f8;};}function handleError(_0x4914fe,_0x55949b){_0x55949b=_0x55949b||0x1f4;return function(_0xe99821){logger[_0x0e27('0x29')](_0xe99821['stack']);if(_0xe99821[_0x0e27('0x2a')]){delete _0xe99821[_0x0e27('0x2a')];}_0x4914fe[_0x0e27('0x1b')](_0x55949b)['send'](_0xe99821);};}exports[_0x0e27('0x2b')]=function(_0x17426f,_0x31f3f3){var _0x1a4fbc={},_0x284546={},_0x761c26={'count':0x0,'rows':[]};var _0x5173cc=_[_0x0e27('0x2c')](db[_0x0e27('0x2d')][_0x0e27('0x2e')],function(_0x357126){return{'name':_0x357126[_0x0e27('0x2f')],'type':_0x357126[_0x0e27('0x30')][_0x0e27('0x31')]};});_0x284546[_0x0e27('0x32')]=_[_0x0e27('0x2c')](_0x5173cc,_0x0e27('0x2a'));_0x284546[_0x0e27('0x33')]=_[_0x0e27('0x34')](_0x17426f['query']);_0x284546[_0x0e27('0x35')]=_[_0x0e27('0x36')](_0x284546['model'],_0x284546[_0x0e27('0x33')]);_0x1a4fbc[_0x0e27('0x37')]=_[_0x0e27('0x36')](_0x284546[_0x0e27('0x32')],qs[_0x0e27('0x38')](_0x17426f[_0x0e27('0x33')][_0x0e27('0x38')]));_0x1a4fbc['attributes']=_0x1a4fbc[_0x0e27('0x37')]['length']?_0x1a4fbc[_0x0e27('0x37')]:_0x284546[_0x0e27('0x32')];if(!_0x17426f[_0x0e27('0x33')][_0x0e27('0x39')](_0x0e27('0x3a'))){_0x1a4fbc[_0x0e27('0x1e')]=qs['limit'](_0x17426f['query'][_0x0e27('0x1e')]);_0x1a4fbc['offset']=qs[_0x0e27('0x20')](_0x17426f['query'][_0x0e27('0x20')]);}_0x1a4fbc[_0x0e27('0x3b')]=qs['sort'](_0x17426f[_0x0e27('0x33')][_0x0e27('0x3c')]);_0x1a4fbc[_0x0e27('0x3d')]=qs[_0x0e27('0x35')](_[_0x0e27('0x3e')](_0x17426f['query'],_0x284546[_0x0e27('0x35')]),_0x5173cc);if(_0x17426f[_0x0e27('0x33')]['filter']){_0x1a4fbc['where']=_[_0x0e27('0x3f')](_0x1a4fbc['where'],{'$or':_[_0x0e27('0x2c')](_0x5173cc,function(_0x3c32f5){if(_0x3c32f5[_0x0e27('0x30')]!=='VIRTUAL'){var _0x4ca6f7={};_0x4ca6f7[_0x3c32f5['name']]={'$like':'%'+_0x17426f['query'][_0x0e27('0x40')]+'%'};return _0x4ca6f7;}})});}_0x1a4fbc=_[_0x0e27('0x3f')]({},_0x1a4fbc,_0x17426f[_0x0e27('0x41')]);var _0x5d69d6={'where':_0x1a4fbc['where']};return db[_0x0e27('0x2d')][_0x0e27('0x1f')](_0x5d69d6)[_0x0e27('0x27')](function(_0x56d76c){_0x761c26['count']=_0x56d76c;if(_0x17426f[_0x0e27('0x33')][_0x0e27('0x42')]){_0x1a4fbc[_0x0e27('0x43')]=[{'all':!![]}];}return db[_0x0e27('0x2d')]['findAll'](_0x1a4fbc);})[_0x0e27('0x27')](function(_0x1a0a65){_0x761c26[_0x0e27('0x44')]=_0x1a0a65;return _0x761c26;})[_0x0e27('0x27')](respondWithFilteredResult(_0x31f3f3,_0x1a4fbc))[_0x0e27('0x45')](handleError(_0x31f3f3,null));};exports[_0x0e27('0x46')]=function(_0x2cb332,_0x20a528){var _0x3a0cd5={'raw':![],'where':{'id':_0x2cb332['params']['id']}},_0xee0a36={};_0xee0a36['model']=_[_0x0e27('0x34')](db['UserProfileSection'][_0x0e27('0x2e')]);_0xee0a36[_0x0e27('0x33')]=_[_0x0e27('0x34')](_0x2cb332[_0x0e27('0x33')]);_0xee0a36[_0x0e27('0x35')]=_[_0x0e27('0x36')](_0xee0a36[_0x0e27('0x32')],_0xee0a36[_0x0e27('0x33')]);_0x3a0cd5['attributes']=_[_0x0e27('0x36')](_0xee0a36['model'],qs['fields'](_0x2cb332['query'][_0x0e27('0x38')]));_0x3a0cd5[_0x0e27('0x37')]=_0x3a0cd5[_0x0e27('0x37')]['length']?_0x3a0cd5[_0x0e27('0x37')]:_0xee0a36['model'];if(_0x2cb332[_0x0e27('0x33')]['includeAll']){_0x3a0cd5[_0x0e27('0x43')]=[{'all':!![]}];}_0x3a0cd5=_[_0x0e27('0x3f')]({},_0x3a0cd5,_0x2cb332['options']);return db[_0x0e27('0x2d')][_0x0e27('0x47')](_0x3a0cd5)[_0x0e27('0x27')](handleEntityNotFound(_0x20a528,null))[_0x0e27('0x27')](respondWithResult(_0x20a528,null))[_0x0e27('0x45')](handleError(_0x20a528,null));};exports[_0x0e27('0x48')]=function(_0x8cbb8c,_0x2c6334){return db['UserProfileSection'][_0x0e27('0x48')](_0x8cbb8c[_0x0e27('0x49')],{})['then'](respondWithResult(_0x2c6334,0xc9))[_0x0e27('0x45')](handleError(_0x2c6334,null));};exports[_0x0e27('0x26')]=function(_0x3640f5,_0x1cd05c){if(_0x3640f5[_0x0e27('0x49')]['id']){delete _0x3640f5[_0x0e27('0x49')]['id'];}return db[_0x0e27('0x2d')][_0x0e27('0x47')]({'where':{'id':_0x3640f5[_0x0e27('0x4a')]['id']}})[_0x0e27('0x27')](handleEntityNotFound(_0x1cd05c,null))[_0x0e27('0x27')](saveUpdates(_0x3640f5[_0x0e27('0x49')],null))['then'](respondWithResult(_0x1cd05c,null))['catch'](handleError(_0x1cd05c,null));};exports[_0x0e27('0x28')]=function(_0x429436,_0x343d37){return db[_0x0e27('0x2d')]['find']({'where':{'id':_0x429436[_0x0e27('0x4a')]['id']}})[_0x0e27('0x27')](handleEntityNotFound(_0x343d37,null))[_0x0e27('0x27')](removeEntity(_0x343d37,null))['catch'](handleError(_0x343d37,null));};exports[_0x0e27('0x4b')]=function(_0x11134d,_0x424bd9){return db[_0x0e27('0x2d')]['describe']()[_0x0e27('0x27')](respondWithResult(_0x424bd9,null))[_0x0e27('0x45')](handleError(_0x424bd9,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index a6e7fa0..df4b8a1 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 _0xe146=['util','api','moment','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','UserProfileSection','compositeIndex','sectionId','userProfileId'];(function(_0x45f6c9,_0x154bea){var _0x3d5f8f=function(_0x488515){while(--_0x488515){_0x45f6c9['push'](_0x45f6c9['shift']());}};_0x3d5f8f(++_0x154bea);}(_0xe146,0x1d4));var _0x6e14=function(_0x26721d,_0x448ba5){_0x26721d=_0x26721d-0x0;var _0x1035c5=_0xe146[_0x26721d];return _0x1035c5;};'use strict';var _=require('lodash');var util=require(_0x6e14('0x0'));var logger=require('../../config/logger')(_0x6e14('0x1'));var moment=require(_0x6e14('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6e14('0x3'));var rimraf=require(_0x6e14('0x4'));var config=require(_0x6e14('0x5'));var attributes=require(_0x6e14('0x6'));module[_0x6e14('0x7')]=function(_0x489d15,_0x1975b7){return _0x489d15['define'](_0x6e14('0x8'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x6e14('0x9'),'fields':[_0x6e14('0xa'),_0x6e14('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x62cb=['moment','bluebird','request-promise','path','rimraf','exports','define','user_profile_has_sections','sectionId','userProfileId','../../config/logger','api'];(function(_0x18af99,_0x10fe15){var _0x55583c=function(_0x29f6d3){while(--_0x29f6d3){_0x18af99['push'](_0x18af99['shift']());}};_0x55583c(++_0x10fe15);}(_0x62cb,0x196));var _0xb62c=function(_0x1fd675,_0x165dfe){_0x1fd675=_0x1fd675-0x0;var _0x16b554=_0x62cb[_0x1fd675];return _0x16b554;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb62c('0x0'))(_0xb62c('0x1'));var moment=require(_0xb62c('0x2'));var BPromise=require(_0xb62c('0x3'));var rp=require(_0xb62c('0x4'));var fs=require('fs');var path=require(_0xb62c('0x5'));var rimraf=require(_0xb62c('0x6'));var config=require('../../config/environment');var attributes=require('./userProfileSection.attributes');module[_0xb62c('0x7')]=function(_0x2601e,_0x42718c){return _0x2601e[_0xb62c('0x8')]('UserProfileSection',attributes,{'tableName':_0xb62c('0x9'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xb62c('0xa'),_0xb62c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 26df795..ee2f369 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 _0xbc74=['then','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request'];(function(_0x3c2192,_0x46089f){var _0x594d92=function(_0x936eba){while(--_0x936eba){_0x3c2192['push'](_0x3c2192['shift']());}};_0x594d92(++_0x46089f);}(_0xbc74,0x1c3));var _0x4bc7=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0xbc74[_0xc0a3d3];return _0x3386e8;};'use strict';var _=require(_0x4bc7('0x0'));var util=require(_0x4bc7('0x1'));var moment=require(_0x4bc7('0x2'));var BPromise=require('bluebird');var rs=require(_0x4bc7('0x3'));var fs=require('fs');var Redis=require(_0x4bc7('0x4'));var db=require(_0x4bc7('0x5'))['db'];var utils=require(_0x4bc7('0x6'));var logger=require('../../config/logger')(_0x4bc7('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4bc7('0x8')][_0x4bc7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2db5b3,_0xc435eb,_0x10d3cc){return new BPromise(function(_0x148e37,_0x2e55b5){return client[_0x4bc7('0xa')](_0x2db5b3,_0x10d3cc)[_0x4bc7('0xb')](function(_0x52c711){logger['info'](_0x4bc7('0xc'),_0xc435eb,_0x4bc7('0xd'));logger[_0x4bc7('0xe')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0xc435eb,_0x4bc7('0xd'),JSON['stringify'](_0x52c711));if(_0x52c711[_0x4bc7('0xf')]){if(_0x52c711['error'][_0x4bc7('0x10')]===0x1f4){logger[_0x4bc7('0xf')]('UserProfileSection,\x20%s,\x20%s',_0xc435eb,_0x52c711[_0x4bc7('0xf')][_0x4bc7('0x11')]);return _0x2e55b5(_0x52c711[_0x4bc7('0xf')][_0x4bc7('0x11')]);}logger[_0x4bc7('0xf')]('UserProfileSection,\x20%s,\x20%s',_0xc435eb,_0x52c711['error'][_0x4bc7('0x11')]);return _0x148e37(_0x52c711[_0x4bc7('0xf')][_0x4bc7('0x11')]);}else{logger[_0x4bc7('0x12')](_0x4bc7('0xc'),_0xc435eb,'request\x20sent');_0x148e37(_0x52c711[_0x4bc7('0x13')][_0x4bc7('0x11')]);}})[_0x4bc7('0x14')](function(_0x35469b){logger[_0x4bc7('0xf')](_0x4bc7('0xc'),_0xc435eb,_0x35469b);_0x2e55b5(_0x35469b);});});} \ No newline at end of file +var _0xd7a0=['http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x108db1,_0x89896d){var _0x16848d=function(_0x2726f6){while(--_0x2726f6){_0x108db1['push'](_0x108db1['shift']());}};_0x16848d(++_0x89896d);}(_0xd7a0,0xa0));var _0x0d7a=function(_0x4670a6,_0x48156b){_0x4670a6=_0x4670a6-0x0;var _0x2cac9d=_0xd7a0[_0x4670a6];return _0x2cac9d;};'use strict';var _=require(_0x0d7a('0x0'));var util=require('util');var moment=require(_0x0d7a('0x1'));var BPromise=require('bluebird');var rs=require(_0x0d7a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d7a('0x3'))['db'];var utils=require(_0x0d7a('0x4'));var logger=require(_0x0d7a('0x5'))(_0x0d7a('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d7a('0x7')][_0x0d7a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12e36f,_0x62da50,_0x14cbdf){return new BPromise(function(_0x2536e0,_0x532336){return client[_0x0d7a('0x9')](_0x12e36f,_0x14cbdf)[_0x0d7a('0xa')](function(_0x437c32){logger[_0x0d7a('0xb')](_0x0d7a('0xc'),_0x62da50,_0x0d7a('0xd'));logger[_0x0d7a('0xe')](_0x0d7a('0xf'),_0x62da50,_0x0d7a('0xd'),JSON['stringify'](_0x437c32));if(_0x437c32[_0x0d7a('0x10')]){if(_0x437c32[_0x0d7a('0x10')][_0x0d7a('0x11')]===0x1f4){logger[_0x0d7a('0x10')]('UserProfileSection,\x20%s,\x20%s',_0x62da50,_0x437c32['error'][_0x0d7a('0x12')]);return _0x532336(_0x437c32[_0x0d7a('0x10')][_0x0d7a('0x12')]);}logger[_0x0d7a('0x10')](_0x0d7a('0xc'),_0x62da50,_0x437c32[_0x0d7a('0x10')][_0x0d7a('0x12')]);return _0x2536e0(_0x437c32[_0x0d7a('0x10')][_0x0d7a('0x12')]);}else{logger[_0x0d7a('0xb')](_0x0d7a('0xc'),_0x62da50,'request\x20sent');_0x2536e0(_0x437c32[_0x0d7a('0x13')][_0x0d7a('0x12')]);}})[_0x0d7a('0x14')](function(_0x9417ee){logger[_0x0d7a('0x10')](_0x0d7a('0xc'),_0x62da50,_0x9417ee);_0x532336(_0x9417ee);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 6c072c3..4e672c0 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x5544e1,_0x32afaf){var _0x233c4c=function(_0x228720){while(--_0x228720){_0x5544e1['push'](_0x5544e1['shift']());}};_0x233c4c(++_0x32afaf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3211f6,_0x47eb23){var _0x273e60=function(_0x56c994){while(--_0x56c994){_0x3211f6['push'](_0x3211f6['shift']());}};_0x273e60(++_0x47eb23);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 8eded3f..969f4a5 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 _0xb91a=['sequelize','INTEGER'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xb91a,0x112));var _0xab91=function(_0x3cdd4b,_0x333117){_0x3cdd4b=_0x3cdd4b-0x0;var _0xd0d75a=_0xb91a[_0x3cdd4b];return _0xd0d75a;};'use strict';var Sequelize=require(_0xab91('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xab91('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8a25=['sequelize','exports','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8a25,0x1aa));var _0x58a2=function(_0x38ca14,_0x879e4b){_0x38ca14=_0x38ca14-0x0;var _0x30e0a=_0x8a25[_0x38ca14];return _0x30e0a;};'use strict';var Sequelize=require(_0x58a2('0x0'));module[_0x58a2('0x1')]={'penalty':{'type':Sequelize[_0x58a2('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 aa7e262..20e3a54 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 _0xee3c=['./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x181dfe,_0xf84557){var _0x40c38f=function(_0x3aa818){while(--_0x3aa818){_0x181dfe['push'](_0x181dfe['shift']());}};_0x40c38f(++_0xf84557);}(_0xee3c,0x14a));var _0xcee3=function(_0x4a34b3,_0x579a92){_0x4a34b3=_0x4a34b3-0x0;var _0x44f7bc=_0xee3c[_0x4a34b3];return _0x44f7bc;};'use strict';var _=require(_0xcee3('0x0'));var util=require(_0xcee3('0x1'));var logger=require(_0xcee3('0x2'))(_0xcee3('0x3'));var moment=require(_0xcee3('0x4'));var BPromise=require(_0xcee3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xcee3('0x6'));var config=require(_0xcee3('0x7'));var attributes=require(_0xcee3('0x8'));module[_0xcee3('0x9')]=function(_0x9350f3,_0x44e46f){return _0x9350f3[_0xcee3('0xa')](_0xcee3('0xb'),attributes,{'tableName':_0xcee3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fab=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues','lodash','util'];(function(_0x52d776,_0x1290ad){var _0x20c6be=function(_0x5f336f){while(--_0x5f336f){_0x52d776['push'](_0x52d776['shift']());}};_0x20c6be(++_0x1290ad);}(_0x5fab,0x177));var _0xb5fa=function(_0x5de532,_0x2941c4){_0x5de532=_0x5de532-0x0;var _0x4e9192=_0x5fab[_0x5de532];return _0x4e9192;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index bc17af6..7e96fb6 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 _0xe624=['rpc','../../config/environment','http','request','then','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserSmsQueue,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x307100,_0xbbc3a3){var _0xcdc7d5=function(_0x591f64){while(--_0x591f64){_0x307100['push'](_0x307100['shift']());}};_0xcdc7d5(++_0xbbc3a3);}(_0xe624,0x1b1));var _0x4e62=function(_0x3d86f5,_0x257914){_0x3d86f5=_0x3d86f5-0x0;var _0x2d6881=_0xe624[_0x3d86f5];return _0x2d6881;};'use strict';var _=require(_0x4e62('0x0'));var util=require(_0x4e62('0x1'));var moment=require(_0x4e62('0x2'));var BPromise=require(_0x4e62('0x3'));var rs=require(_0x4e62('0x4'));var fs=require('fs');var Redis=require(_0x4e62('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4e62('0x6'))(_0x4e62('0x7'));var config=require(_0x4e62('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4e62('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42cdcd,_0x287ac0,_0x2c80a6){return new BPromise(function(_0x14aa1b,_0x119c9f){return client[_0x4e62('0xa')](_0x42cdcd,_0x2c80a6)[_0x4e62('0xb')](function(_0x243d30){logger[_0x4e62('0xc')]('UserSmsQueue,\x20%s,\x20%s',_0x287ac0,_0x4e62('0xd'));logger[_0x4e62('0xe')](_0x4e62('0xf'),_0x287ac0,_0x4e62('0xd'),JSON[_0x4e62('0x10')](_0x243d30));if(_0x243d30[_0x4e62('0x11')]){if(_0x243d30['error'][_0x4e62('0x12')]===0x1f4){logger[_0x4e62('0x11')](_0x4e62('0x13'),_0x287ac0,_0x243d30[_0x4e62('0x11')]['message']);return _0x119c9f(_0x243d30[_0x4e62('0x11')][_0x4e62('0x14')]);}logger[_0x4e62('0x11')](_0x4e62('0x13'),_0x287ac0,_0x243d30[_0x4e62('0x11')][_0x4e62('0x14')]);return _0x14aa1b(_0x243d30['error'][_0x4e62('0x14')]);}else{logger[_0x4e62('0xc')](_0x4e62('0x13'),_0x287ac0,'request\x20sent');_0x14aa1b(_0x243d30[_0x4e62('0x15')][_0x4e62('0x14')]);}})['catch'](function(_0x27dd40){logger['error'](_0x4e62('0x13'),_0x287ac0,_0x27dd40);_0x119c9f(_0x27dd40);});});} \ No newline at end of file +var _0x3258=['client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xf38492,_0x45d84e){var _0x3e66e3=function(_0xf16ba){while(--_0xf16ba){_0xf38492['push'](_0xf38492['shift']());}};_0x3e66e3(++_0x45d84e);}(_0x3258,0xdf));var _0x8325=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3258[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8325('0x0'));var util=require(_0x8325('0x1'));var moment=require(_0x8325('0x2'));var BPromise=require(_0x8325('0x3'));var rs=require(_0x8325('0x4'));var fs=require('fs');var Redis=require(_0x8325('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8325('0x6'));var logger=require(_0x8325('0x7'))(_0x8325('0x8'));var config=require(_0x8325('0x9'));var jayson=require(_0x8325('0xa'));var client=jayson[_0x8325('0xb')][_0x8325('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x49f886,_0x3a08be,_0x1a0bc7){return new BPromise(function(_0x4a7b49,_0x15a1dc){return client[_0x8325('0xd')](_0x49f886,_0x1a0bc7)[_0x8325('0xe')](function(_0x34d710){logger[_0x8325('0xf')](_0x8325('0x10'),_0x3a08be,_0x8325('0x11'));logger[_0x8325('0x12')](_0x8325('0x13'),_0x3a08be,'request\x20sent',JSON[_0x8325('0x14')](_0x34d710));if(_0x34d710[_0x8325('0x15')]){if(_0x34d710[_0x8325('0x15')][_0x8325('0x16')]===0x1f4){logger['error'](_0x8325('0x10'),_0x3a08be,_0x34d710['error'][_0x8325('0x17')]);return _0x15a1dc(_0x34d710[_0x8325('0x15')][_0x8325('0x17')]);}logger[_0x8325('0x15')]('UserSmsQueue,\x20%s,\x20%s',_0x3a08be,_0x34d710[_0x8325('0x15')][_0x8325('0x17')]);return _0x4a7b49(_0x34d710['error']['message']);}else{logger[_0x8325('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x3a08be,_0x8325('0x11'));_0x4a7b49(_0x34d710[_0x8325('0x18')][_0x8325('0x17')]);}})[_0x8325('0x19')](function(_0x169a76){logger[_0x8325('0x15')](_0x8325('0x10'),_0x3a08be,_0x169a76);_0x15a1dc(_0x169a76);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 9cedcdb..00440b1 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 _0x6ba4=['exports','INTEGER'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x6ba4,0x11e));var _0x46ba=function(_0x421e23,_0x260176){_0x421e23=_0x421e23-0x0;var _0x1c6bac=_0x6ba4[_0x421e23];return _0x1c6bac;};'use strict';var Sequelize=require('sequelize');module[_0x46ba('0x0')]={'UserId':{'type':Sequelize[_0x46ba('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xa490=['INTEGER','exports'];(function(_0x606704,_0x4a08f8){var _0x11a29d=function(_0x36cae3){while(--_0x36cae3){_0x606704['push'](_0x606704['shift']());}};_0x11a29d(++_0x4a08f8);}(_0xa490,0x151));var _0x0a49=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa490[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x0a49('0x0')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x0a49('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index a96c4c2..6a68870 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(_0x134eed,_0x2859d7){var _0x21f18e=function(_0x477483){while(--_0x477483){_0x134eed['push'](_0x134eed['shift']());}};_0x21f18e(++_0x2859d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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(_0x236909,_0x5dd4ee){var _0x42fb15=function(_0x345eb2){while(--_0x345eb2){_0x236909['push'](_0x236909['shift']());}};_0x42fb15(++_0x5dd4ee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 2a68e23..5f4de8a 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x5c315d,_0x3b3245){var _0x3273e8=function(_0x5aab2a){while(--_0x5aab2a){_0x5c315d['push'](_0x5c315d['shift']());}};_0x3273e8(++_0x3b3245);}(_0x70e0,0x17b));var _0x070e=function(_0x5f349a,_0x32a22d){_0x5f349a=_0x5f349a-0x0;var _0x4cd4a9=_0x70e0[_0x5f349a];return _0x4cd4a9;};'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(_0x80f78a,_0x4a7bc9){var _0x2ce3a0=function(_0x550c9a){while(--_0x550c9a){_0x80f78a['push'](_0x80f78a['shift']());}};_0x2ce3a0(++_0x4a7bc9);}(_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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index ebd5295..facaf80 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 _0x6785=['INTEGER','sequelize','exports'];(function(_0x33d2ad,_0x23b818){var _0x3856d8=function(_0x2f095c){while(--_0x2f095c){_0x33d2ad['push'](_0x33d2ad['shift']());}};_0x3856d8(++_0x23b818);}(_0x6785,0xa0));var _0x5678=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x6785[_0x424a9a];return _0xa7831c;};'use strict';var Sequelize=require(_0x5678('0x0'));module[_0x5678('0x1')]={'penalty':{'type':Sequelize[_0x5678('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9f8b=['exports','INTEGER'];(function(_0x2a789f,_0x52d4a2){var _0x43d2d8=function(_0x71e480){while(--_0x71e480){_0x2a789f['push'](_0x2a789f['shift']());}};_0x43d2d8(++_0x52d4a2);}(_0x9f8b,0x9a));var _0xb9f8=function(_0x550168,_0x13e530){_0x550168=_0x550168-0x0;var _0xbc8494=_0x9f8b[_0x550168];return _0xbc8494;};'use strict';var Sequelize=require('sequelize');module[_0xb9f8('0x0')]={'penalty':{'type':Sequelize[_0xb9f8('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 1f9976b..78dcbfb 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 _0x587d=['../../config/logger','moment','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','UserVoiceQueue','lodash','util'];(function(_0x576c1e,_0x49c1d6){var _0x33a3c3=function(_0x5b56fa){while(--_0x5b56fa){_0x576c1e['push'](_0x576c1e['shift']());}};_0x33a3c3(++_0x49c1d6);}(_0x587d,0x134));var _0xd587=function(_0x59bd64,_0x237f2b){_0x59bd64=_0x59bd64-0x0;var _0x378c0e=_0x587d[_0x59bd64];return _0x378c0e;};'use strict';var _=require(_0xd587('0x0'));var util=require(_0xd587('0x1'));var logger=require(_0xd587('0x2'))('api');var moment=require(_0xd587('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd587('0x4'));var rimraf=require(_0xd587('0x5'));var config=require(_0xd587('0x6'));var attributes=require(_0xd587('0x7'));module[_0xd587('0x8')]=function(_0x71b568,_0x270e3e){return _0x71b568['define'](_0xd587('0x9'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3bb5=['api','bluebird','request-promise','rimraf','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','util','../../config/logger'];(function(_0x11319c,_0x5c7967){var _0x3b0930=function(_0x4d190d){while(--_0x4d190d){_0x11319c['push'](_0x11319c['shift']());}};_0x3b0930(++_0x5c7967);}(_0x3bb5,0x10c));var _0x53bb=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x3bb5[_0x1d1779];return _0x2377e9;};'use strict';var _=require('lodash');var util=require(_0x53bb('0x0'));var logger=require(_0x53bb('0x1'))(_0x53bb('0x2'));var moment=require('moment');var BPromise=require(_0x53bb('0x3'));var rp=require(_0x53bb('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x53bb('0x5'));var config=require('../../config/environment');var attributes=require(_0x53bb('0x6'));module[_0x53bb('0x7')]=function(_0x3329f0,_0x38b374){return _0x3329f0[_0x53bb('0x8')](_0x53bb('0x9'),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 385850b..7faeea4 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 _0x5684=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x53136b,_0x64d196){var _0x572292=function(_0xee850e){while(--_0xee850e){_0x53136b['push'](_0x53136b['shift']());}};_0x572292(++_0x64d196);}(_0x5684,0xb6));var _0x4568=function(_0x5d6523,_0x22842b){_0x5d6523=_0x5d6523-0x0;var _0x4c481d=_0x5684[_0x5d6523];return _0x4c481d;};'use strict';var _=require(_0x4568('0x0'));var util=require(_0x4568('0x1'));var moment=require(_0x4568('0x2'));var BPromise=require(_0x4568('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4568('0x4'));var db=require(_0x4568('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4568('0x6'))('rpc');var config=require(_0x4568('0x7'));var jayson=require(_0x4568('0x8'));var client=jayson[_0x4568('0x9')][_0x4568('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x566736,_0x288f3c,_0x326b8b){return new BPromise(function(_0x3000d7,_0x5420a1){return client[_0x4568('0xb')](_0x566736,_0x326b8b)[_0x4568('0xc')](function(_0x24265e){logger['info'](_0x4568('0xd'),_0x288f3c,_0x4568('0xe'));logger[_0x4568('0xf')](_0x4568('0x10'),_0x288f3c,'request\x20sent',JSON[_0x4568('0x11')](_0x24265e));if(_0x24265e[_0x4568('0x12')]){if(_0x24265e[_0x4568('0x12')][_0x4568('0x13')]===0x1f4){logger[_0x4568('0x12')](_0x4568('0xd'),_0x288f3c,_0x24265e[_0x4568('0x12')][_0x4568('0x14')]);return _0x5420a1(_0x24265e[_0x4568('0x12')][_0x4568('0x14')]);}logger[_0x4568('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x288f3c,_0x24265e['error']['message']);return _0x3000d7(_0x24265e[_0x4568('0x12')][_0x4568('0x14')]);}else{logger['info'](_0x4568('0xd'),_0x288f3c,'request\x20sent');_0x3000d7(_0x24265e[_0x4568('0x15')][_0x4568('0x14')]);}})[_0x4568('0x16')](function(_0x31a075){logger['error'](_0x4568('0xd'),_0x288f3c,_0x31a075);_0x5420a1(_0x31a075);});});} \ No newline at end of file +var _0x1c7b=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util'];(function(_0x5de237,_0x2058e8){var _0x3b3d4d=function(_0x3debe1){while(--_0x3debe1){_0x5de237['push'](_0x5de237['shift']());}};_0x3b3d4d(++_0x2058e8);}(_0x1c7b,0x1cc));var _0xb1c7=function(_0x3ed508,_0x5db946){_0x3ed508=_0x3ed508-0x0;var _0x20d2ee=_0x1c7b[_0x3ed508];return _0x20d2ee;};'use strict';var _=require(_0xb1c7('0x0'));var util=require(_0xb1c7('0x1'));var moment=require(_0xb1c7('0x2'));var BPromise=require(_0xb1c7('0x3'));var rs=require(_0xb1c7('0x4'));var fs=require('fs');var Redis=require(_0xb1c7('0x5'));var db=require(_0xb1c7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb1c7('0x7'))('rpc');var config=require(_0xb1c7('0x8'));var jayson=require(_0xb1c7('0x9'));var client=jayson[_0xb1c7('0xa')][_0xb1c7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x26cb7a,_0x1b6e27,_0x40f69c){return new BPromise(function(_0x3735d4,_0x4260dc){return client['request'](_0x26cb7a,_0x40f69c)[_0xb1c7('0xc')](function(_0x33556a){logger[_0xb1c7('0xd')](_0xb1c7('0xe'),_0x1b6e27,_0xb1c7('0xf'));logger[_0xb1c7('0x10')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x1b6e27,'request\x20sent',JSON['stringify'](_0x33556a));if(_0x33556a['error']){if(_0x33556a['error']['code']===0x1f4){logger[_0xb1c7('0x11')](_0xb1c7('0xe'),_0x1b6e27,_0x33556a[_0xb1c7('0x11')][_0xb1c7('0x12')]);return _0x4260dc(_0x33556a['error']['message']);}logger[_0xb1c7('0x11')](_0xb1c7('0xe'),_0x1b6e27,_0x33556a[_0xb1c7('0x11')][_0xb1c7('0x12')]);return _0x3735d4(_0x33556a[_0xb1c7('0x11')][_0xb1c7('0x12')]);}else{logger['info'](_0xb1c7('0xe'),_0x1b6e27,_0xb1c7('0xf'));_0x3735d4(_0x33556a[_0xb1c7('0x13')]['message']);}})[_0xb1c7('0x14')](function(_0x42ed26){logger[_0xb1c7('0x11')](_0xb1c7('0xe'),_0x1b6e27,_0x42ed26);_0x4260dc(_0x42ed26);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index fdfd0a4..b25e87e 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(_0x5b17b4,_0x5a3221){var _0x55af79=function(_0x888225){while(--_0x888225){_0x5b17b4['push'](_0x5b17b4['shift']());}};_0x55af79(++_0x5a3221);}(_0x9c44,0x178));var _0x49c4=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9c44[_0x5d2803];return _0xdcad2c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2fc3f6,_0x4eb88a){var _0x1dabbb=function(_0x3bfc26){while(--_0x3bfc26){_0x2fc3f6['push'](_0x2fc3f6['shift']());}};_0x1dabbb(++_0x4eb88a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x26b5ff,_0x92009a){_0x26b5ff=_0x26b5ff-0x0;var _0x58603e=_0xcb91[_0x26b5ff];return _0x58603e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index cb72c2e..c99a2c8 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 _0x3daf=['STRING','INTEGER','queue_interface','sequelize','exports','Required\x20by\x20Asterisk'];(function(_0x44d869,_0x49425f){var _0x1ed521=function(_0x2c2968){while(--_0x2c2968){_0x44d869['push'](_0x44d869['shift']());}};_0x1ed521(++_0x49425f);}(_0x3daf,0x195));var _0xf3da=function(_0x508198,_0x8c0cee){_0x508198=_0x508198-0x0;var _0xc7fe1a=_0x3daf[_0x508198];return _0xc7fe1a;};'use strict';var Sequelize=require(_0xf3da('0x0'));module[_0xf3da('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0xf3da('0x2')},'membername':{'type':Sequelize[_0xf3da('0x3')],'allowNull':![],'comment':_0xf3da('0x2')},'UserId':{'type':Sequelize[_0xf3da('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xf3da('0x3')],'allowNull':![],'unique':_0xf3da('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xf3da('0x3')],'allowNull':![],'unique':_0xf3da('0x5'),'comment':_0xf3da('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xf3da('0x2')},'paused':{'type':Sequelize[_0xf3da('0x4')](0xb),'defaultValue':0x0,'comment':_0xf3da('0x2')}}; \ No newline at end of file +var _0xa67a=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x174ef5,_0x256e8e){var _0x1cc379=function(_0x3eafcf){while(--_0x3eafcf){_0x174ef5['push'](_0x174ef5['shift']());}};_0x1cc379(++_0x256e8e);}(_0xa67a,0x114));var _0xaa67=function(_0x38d49a,_0x2eec68){_0x38d49a=_0x38d49a-0x0;var _0x3f087c=_0xa67a[_0x38d49a];return _0x3f087c;};'use strict';var Sequelize=require(_0xaa67('0x0'));module[_0xaa67('0x1')]={'uniqueid':{'type':Sequelize[_0xaa67('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xaa67('0x3')},'membername':{'type':Sequelize[_0xaa67('0x4')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xaa67('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xaa67('0x4')],'allowNull':![],'unique':_0xaa67('0x5'),'comment':_0xaa67('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xaa67('0x5'),'comment':_0xaa67('0x3')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xaa67('0x3')},'paused':{'type':Sequelize[_0xaa67('0x2')](0xb),'defaultValue':0x0,'comment':_0xaa67('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 8a68733..53e95a7 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 _0xbfb7=['hook','exports','events','../../mysqldb','save','update','remove','emit','hasOwnProperty'];(function(_0x2ad008,_0x45c253){var _0x4538cf=function(_0xe143e4){while(--_0xe143e4){_0x2ad008['push'](_0x2ad008['shift']());}};_0x4538cf(++_0x45c253);}(_0xbfb7,0x146));var _0x7bfb=function(_0x2fbcf6,_0x2e7155){_0x2fbcf6=_0x2fbcf6-0x0;var _0x3e7265=_0xbfb7[_0x2fbcf6];return _0x3e7265;};'use strict';var EventEmitter=require(_0x7bfb('0x0'));var UserVoiceQueueRt=require(_0x7bfb('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7bfb('0x2'),'afterUpdate':_0x7bfb('0x3'),'afterDestroy':_0x7bfb('0x4')};function emitEvent(_0x5c7237){return function(_0x23e66b,_0x180ea8,_0x3d57e3){UserVoiceQueueRtEvents[_0x7bfb('0x5')](_0x5c7237+':'+_0x23e66b['id'],_0x23e66b);UserVoiceQueueRtEvents[_0x7bfb('0x5')](_0x5c7237,_0x23e66b);_0x3d57e3(null);};}for(var e in events){if(events[_0x7bfb('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x7bfb('0x7')](e,emitEvent(event));}}module[_0x7bfb('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x736a=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x736a,0x11f));var _0xa736=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x736a[_0x11ce46];return _0x368a1e;};'use strict';var EventEmitter=require(_0xa736('0x0'));var UserVoiceQueueRt=require(_0xa736('0x1'))['db'][_0xa736('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xa736('0x3')](0x0);var events={'afterCreate':_0xa736('0x4'),'afterUpdate':'update','afterDestroy':_0xa736('0x5')};function emitEvent(_0x27ca5d){return function(_0x108c5f,_0x377a0a,_0x229260){UserVoiceQueueRtEvents['emit'](_0x27ca5d+':'+_0x108c5f['id'],_0x108c5f);UserVoiceQueueRtEvents[_0xa736('0x6')](_0x27ca5d,_0x108c5f);_0x229260(null);};}for(var e in events){if(events[_0xa736('0x7')](e)){var event=events[e];UserVoiceQueueRt[_0xa736('0x8')](e,emitEvent(event));}}module[_0xa736('0x9')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index b93ecb3..cca0632 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 _0x81b9=['api','moment','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','user_has_voice_queues_rt','lodash','util'];(function(_0x41c381,_0x1176bd){var _0x427981=function(_0x508843){while(--_0x508843){_0x41c381['push'](_0x41c381['shift']());}};_0x427981(++_0x1176bd);}(_0x81b9,0x15c));var _0x981b=function(_0x4c37d7,_0x7134a3){_0x4c37d7=_0x4c37d7-0x0;var _0x5ea63b=_0x81b9[_0x4c37d7];return _0x5ea63b;};'use strict';var _=require(_0x981b('0x0'));var util=require(_0x981b('0x1'));var logger=require('../../config/logger')(_0x981b('0x2'));var moment=require(_0x981b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x981b('0x4'));var config=require(_0x981b('0x5'));var attributes=require(_0x981b('0x6'));module[_0x981b('0x7')]=function(_0x3aaafa,_0x1c31aa){return _0x3aaafa[_0x981b('0x8')]('UserVoiceQueueRt',attributes,{'tableName':_0x981b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3a86=['moment','bluebird','request-promise','../../config/environment','exports','define','lodash'];(function(_0x1922c5,_0x4e6689){var _0x4e7ec2=function(_0x23b1d9){while(--_0x23b1d9){_0x1922c5['push'](_0x1922c5['shift']());}};_0x4e7ec2(++_0x4e6689);}(_0x3a86,0xe6));var _0x63a8=function(_0x2ca9d4,_0x51d5c6){_0x2ca9d4=_0x2ca9d4-0x0;var _0x258956=_0x3a86[_0x2ca9d4];return _0x258956;};'use strict';var _=require(_0x63a8('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x63a8('0x1'));var BPromise=require(_0x63a8('0x2'));var rp=require(_0x63a8('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x63a8('0x4'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x63a8('0x5')]=function(_0x35c0be,_0x18fcaf){return _0x35c0be[_0x63a8('0x6')]('UserVoiceQueueRt',attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 8a13430..ac28e05 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 _0xaffd=['request','info','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','options','raw','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','stringify','GetVoiceQueueRtPauses','util','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register'];(function(_0x4a7435,_0x4d796c){var _0x38ca88=function(_0x25d2ab){while(--_0x25d2ab){_0x4a7435['push'](_0x4a7435['shift']());}};_0x38ca88(++_0x4d796c);}(_0xaffd,0x74));var _0xdaff=function(_0x1404e8,_0x50100e){_0x1404e8=_0x1404e8-0x0;var _0xe8f727=_0xaffd[_0x1404e8];return _0xe8f727;};'use strict';var _=require('lodash');var util=require(_0xdaff('0x0'));var moment=require('moment');var BPromise=require(_0xdaff('0x1'));var rs=require(_0xdaff('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xdaff('0x3'));var logger=require('../../config/logger')(_0xdaff('0x4'));var config=require('../../config/environment');var jayson=require(_0xdaff('0x5'));var client=jayson[_0xdaff('0x6')]['http']({'port':0x232a});config[_0xdaff('0x7')]=_[_0xdaff('0x8')](config[_0xdaff('0x7')],{'host':_0xdaff('0x9'),'port':0x18eb});var socket=require(_0xdaff('0xa'))(new Redis(config[_0xdaff('0x7')]));require('./userVoiceQueueRt.socket')[_0xdaff('0xb')](socket);function respondWithRpcPromise(_0x104d8a,_0x568c87,_0x726304){return new BPromise(function(_0x377ada,_0x5aa2d8){return client[_0xdaff('0xc')](_0x104d8a,_0x726304)['then'](function(_0x5e690c){logger[_0xdaff('0xd')](_0xdaff('0xe'),_0x568c87,'request\x20sent');logger[_0xdaff('0xf')](_0xdaff('0x10'),_0x568c87,_0xdaff('0x11'),JSON['stringify'](_0x5e690c));if(_0x5e690c[_0xdaff('0x12')]){if(_0x5e690c[_0xdaff('0x12')][_0xdaff('0x13')]===0x1f4){logger[_0xdaff('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x568c87,_0x5e690c[_0xdaff('0x12')][_0xdaff('0x14')]);return _0x5aa2d8(_0x5e690c[_0xdaff('0x12')][_0xdaff('0x14')]);}logger[_0xdaff('0x12')](_0xdaff('0xe'),_0x568c87,_0x5e690c[_0xdaff('0x12')][_0xdaff('0x14')]);return _0x377ada(_0x5e690c[_0xdaff('0x12')][_0xdaff('0x14')]);}else{logger[_0xdaff('0xd')](_0xdaff('0xe'),_0x568c87,'request\x20sent');_0x377ada(_0x5e690c['result']['message']);}})[_0xdaff('0x15')](function(_0x266385){logger[_0xdaff('0x12')](_0xdaff('0xe'),_0x568c87,_0x266385);_0x5aa2d8(_0x266385);});});}exports['GetVoiceQueueRtPauses']=function(_0x358de0){var _0x4b68e3=this;return new Promise(function(_0xd85b59,_0x7883bf){return db['UserVoiceQueueRt']['findAll']({'raw':_0x358de0[_0xdaff('0x16')]?_0x358de0[_0xdaff('0x16')][_0xdaff('0x17')]===undefined?!![]:![]:!![],'where':_0x358de0[_0xdaff('0x16')]?_0x358de0[_0xdaff('0x16')]['where']||null:null,'attributes':[[db[_0xdaff('0x18')]['fn'](_0xdaff('0x19'),db[_0xdaff('0x18')]['fn']('IF',db[_0xdaff('0x18')][_0xdaff('0x1a')](_0xdaff('0x1b')))),_0xdaff('0x1c')]]})[_0xdaff('0x1d')](function(_0x16a7f2){logger['info']('GetVoiceQueueRtPauses',_0x358de0);logger[_0xdaff('0xf')]('GetVoiceQueueRtPauses',_0x358de0,JSON[_0xdaff('0x1e')](_0x16a7f2));_0xd85b59(_0x16a7f2);})[_0xdaff('0x15')](function(_0x5b9256){logger[_0xdaff('0x12')](_0xdaff('0x1f'),_0x5b9256[_0xdaff('0x14')],_0x358de0);_0x7883bf(_0x4b68e3['error'](0x1f4,_0x5b9256['message']));});});}; \ No newline at end of file +var _0x0614=['info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then'];(function(_0x3dbbd2,_0x5a260a){var _0x5520bf=function(_0x2ef2fc){while(--_0x2ef2fc){_0x3dbbd2['push'](_0x3dbbd2['shift']());}};_0x5520bf(++_0x5a260a);}(_0x0614,0x1dc));var _0x4061=function(_0xea7265,_0x58f613){_0xea7265=_0xea7265-0x0;var _0x6f92c8=_0x0614[_0xea7265];return _0x6f92c8;};'use strict';var _=require(_0x4061('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4061('0x1'));var rs=require(_0x4061('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4061('0x3'))['db'];var utils=require(_0x4061('0x4'));var logger=require(_0x4061('0x5'))(_0x4061('0x6'));var config=require(_0x4061('0x7'));var jayson=require(_0x4061('0x8'));var client=jayson[_0x4061('0x9')][_0x4061('0xa')]({'port':0x232a});config[_0x4061('0xb')]=_[_0x4061('0xc')](config[_0x4061('0xb')],{'host':_0x4061('0xd'),'port':0x18eb});var socket=require(_0x4061('0xe'))(new Redis(config['redis']));require('./userVoiceQueueRt.socket')[_0x4061('0xf')](socket);function respondWithRpcPromise(_0x4b0ca6,_0x59c26a,_0xc62c3d){return new BPromise(function(_0xe1a859,_0x30a964){return client[_0x4061('0x10')](_0x4b0ca6,_0xc62c3d)[_0x4061('0x11')](function(_0x2e9685){logger[_0x4061('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x59c26a,_0x4061('0x13'));logger[_0x4061('0x14')](_0x4061('0x15'),_0x59c26a,_0x4061('0x13'),JSON[_0x4061('0x16')](_0x2e9685));if(_0x2e9685[_0x4061('0x17')]){if(_0x2e9685[_0x4061('0x17')][_0x4061('0x18')]===0x1f4){logger[_0x4061('0x17')](_0x4061('0x19'),_0x59c26a,_0x2e9685['error']['message']);return _0x30a964(_0x2e9685[_0x4061('0x17')]['message']);}logger[_0x4061('0x17')](_0x4061('0x19'),_0x59c26a,_0x2e9685[_0x4061('0x17')][_0x4061('0x1a')]);return _0xe1a859(_0x2e9685[_0x4061('0x17')]['message']);}else{logger[_0x4061('0x12')](_0x4061('0x19'),_0x59c26a,_0x4061('0x13'));_0xe1a859(_0x2e9685[_0x4061('0x1b')]['message']);}})['catch'](function(_0x40359b){logger['error'](_0x4061('0x19'),_0x59c26a,_0x40359b);_0x30a964(_0x40359b);});});}exports[_0x4061('0x1c')]=function(_0x54488f){var _0x40e8c2=this;return new Promise(function(_0x3d2236,_0x13ccdf){return db['UserVoiceQueueRt'][_0x4061('0x1d')]({'raw':_0x54488f[_0x4061('0x1e')]?_0x54488f[_0x4061('0x1e')][_0x4061('0x1f')]===undefined?!![]:![]:!![],'where':_0x54488f[_0x4061('0x1e')]?_0x54488f['options'][_0x4061('0x20')]||null:null,'attributes':[[db[_0x4061('0x21')]['fn']('COUNT',db[_0x4061('0x21')]['fn']('IF',db[_0x4061('0x21')][_0x4061('0x22')](_0x4061('0x23')))),_0x4061('0x24')]]})[_0x4061('0x11')](function(_0x2383a2){logger['info'](_0x4061('0x1c'),_0x54488f);logger[_0x4061('0x14')](_0x4061('0x1c'),_0x54488f,JSON['stringify'](_0x2383a2));_0x3d2236(_0x2383a2);})[_0x4061('0x25')](function(_0x16f980){logger[_0x4061('0x17')](_0x4061('0x1c'),_0x16f980[_0x4061('0x1a')],_0x54488f);_0x13ccdf(_0x40e8c2[_0x4061('0x17')](0x1f4,_0x16f980['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 62f60d1..afac864 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 _0x287e=['removeListener','register','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update','emit'];(function(_0x4d8fc6,_0x48d079){var _0x4a3a1a=function(_0x2f1058){while(--_0x2f1058){_0x4d8fc6['push'](_0x4d8fc6['shift']());}};_0x4a3a1a(++_0x48d079);}(_0x287e,0x1e3));var _0xe287=function(_0x18425a,_0x395567){_0x18425a=_0x18425a-0x0;var _0x1c680b=_0x287e[_0x18425a];return _0x1c680b;};'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 +var _0xe2fe=['update','emit','register','length','./userVoiceQueueRt.events'];(function(_0x3f2106,_0x1af165){var _0x3db0cf=function(_0x595dd0){while(--_0x595dd0){_0x3f2106['push'](_0x3f2106['shift']());}};_0x3db0cf(++_0x1af165);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var UserVoiceQueueRtEvents=require(_0xee2f('0x0'));var events=['save','remove',_0xee2f('0x1')];function createListener(_0x5e18ae,_0x169cf9){return function(_0x1b6f4c){_0x169cf9[_0xee2f('0x2')](_0x5e18ae,_0x1b6f4c);};}function removeListener(_0x2d2b03,_0xcb45e6){return function(){UserVoiceQueueRtEvents['removeListener'](_0x2d2b03,_0xcb45e6);};}exports[_0xee2f('0x3')]=function(_0x2b7e7c){for(var _0x49926b=0x0,_0x1533a0=events[_0xee2f('0x4')];_0x49926b<_0x1533a0;_0x49926b++){var _0x5a7975=events[_0x49926b];var _0x3c4095=createListener('userVoiceQueueRt:'+_0x5a7975,_0x2b7e7c);UserVoiceQueueRtEvents['on'](_0x5a7975,_0x3c4095);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index e9c64b8..2ee5773 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x253f2f,_0x105fe9){var _0x253912=function(_0x25bfd4){while(--_0x25bfd4){_0x253f2f['push'](_0x253f2f['shift']());}};_0x253912(++_0x105fe9);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x23bd2f,_0x1b4ba7){var _0x44892c=function(_0x15ec0b){while(--_0x15ec0b){_0x23bd2f['push'](_0x23bd2f['shift']());}};_0x44892c(++_0x1b4ba7);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x351509,_0x54725c){_0x351509=_0x351509-0x0;var _0x4e9861=_0xcb91[_0x351509];return _0x4e9861;};'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 43d7346..3f0ebed 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 _0xe38c=['INTEGER','sequelize'];(function(_0x3c86dc,_0x5d22fc){var _0x4aeb79=function(_0x29d7c8){while(--_0x29d7c8){_0x3c86dc['push'](_0x3c86dc['shift']());}};_0x4aeb79(++_0x5d22fc);}(_0xe38c,0xbb));var _0xce38=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xe38c[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0xce38('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xce38('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc431=['sequelize','exports','INTEGER'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0xc431,0x15c));var _0x1c43=function(_0x1c1179,_0x5bfcae){_0x1c1179=_0x1c1179-0x0;var _0x428365=_0xc431[_0x1c1179];return _0x428365;};'use strict';var Sequelize=require(_0x1c43('0x0'));module[_0x1c43('0x1')]={'penalty':{'type':Sequelize[_0x1c43('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 cc83da5..a5ff643 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 _0x7315=['bluebird','request-promise','path','../../config/environment','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger'];(function(_0x2e5038,_0x19cf2d){var _0x2b84d2=function(_0x4cfb8e){while(--_0x4cfb8e){_0x2e5038['push'](_0x2e5038['shift']());}};_0x2b84d2(++_0x19cf2d);}(_0x7315,0x17e));var _0x5731=function(_0x3e5db0,_0x369dc2){_0x3e5db0=_0x3e5db0-0x0;var _0x3864d8=_0x7315[_0x3e5db0];return _0x3864d8;};'use strict';var _=require(_0x5731('0x0'));var util=require(_0x5731('0x1'));var logger=require(_0x5731('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5731('0x3'));var rp=require(_0x5731('0x4'));var fs=require('fs');var path=require(_0x5731('0x5'));var rimraf=require('rimraf');var config=require(_0x5731('0x6'));var attributes=require('./userWhatsappQueue.attributes');module[_0x5731('0x7')]=function(_0x2b97a4,_0x121de1){return _0x2b97a4[_0x5731('0x8')](_0x5731('0x9'),attributes,{'tableName':_0x5731('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x060c=['util','moment','request-promise','path','rimraf','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x060c,0xd0));var _0xc060=function(_0x33e3ef,_0xa69f4b){_0x33e3ef=_0x33e3ef-0x0;var _0x153137=_0x060c[_0x33e3ef];return _0x153137;};'use strict';var _=require(_0xc060('0x0'));var util=require(_0xc060('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc060('0x2'));var BPromise=require('bluebird');var rp=require(_0xc060('0x3'));var fs=require('fs');var path=require(_0xc060('0x4'));var rimraf=require(_0xc060('0x5'));var config=require('../../config/environment');var attributes=require(_0xc060('0x6'));module[_0xc060('0x7')]=function(_0x5ab3da,_0x24e48f){return _0x5ab3da[_0xc060('0x8')](_0xc060('0x9'),attributes,{'tableName':_0xc060('0xa'),'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 cc5f29c..f080aa7 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 _0x4294=['util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash'];(function(_0x59a784,_0x39a9e1){var _0x219cfe=function(_0x2ae8b3){while(--_0x2ae8b3){_0x59a784['push'](_0x59a784['shift']());}};_0x219cfe(++_0x39a9e1);}(_0x4294,0xaa));var _0x4429=function(_0x2e22b4,_0x18a987){_0x2e22b4=_0x2e22b4-0x0;var _0x45f55a=_0x4294[_0x2e22b4];return _0x45f55a;};'use strict';var _=require(_0x4429('0x0'));var util=require(_0x4429('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4429('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x4429('0x3'));var logger=require(_0x4429('0x4'))(_0x4429('0x5'));var config=require(_0x4429('0x6'));var jayson=require(_0x4429('0x7'));var client=jayson[_0x4429('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ef81e,_0x1f81b9,_0x51ca82){return new BPromise(function(_0x5ca5c7,_0x5bfc3d){return client['request'](_0x5ef81e,_0x51ca82)[_0x4429('0x9')](function(_0x27b8c4){logger[_0x4429('0xa')](_0x4429('0xb'),_0x1f81b9,_0x4429('0xc'));logger[_0x4429('0xd')](_0x4429('0xe'),_0x1f81b9,'request\x20sent',JSON['stringify'](_0x27b8c4));if(_0x27b8c4[_0x4429('0xf')]){if(_0x27b8c4['error'][_0x4429('0x10')]===0x1f4){logger[_0x4429('0xf')](_0x4429('0xb'),_0x1f81b9,_0x27b8c4[_0x4429('0xf')][_0x4429('0x11')]);return _0x5bfc3d(_0x27b8c4[_0x4429('0xf')][_0x4429('0x11')]);}logger[_0x4429('0xf')](_0x4429('0xb'),_0x1f81b9,_0x27b8c4[_0x4429('0xf')][_0x4429('0x11')]);return _0x5ca5c7(_0x27b8c4[_0x4429('0xf')][_0x4429('0x11')]);}else{logger[_0x4429('0xa')](_0x4429('0xb'),_0x1f81b9,_0x4429('0xc'));_0x5ca5c7(_0x27b8c4[_0x4429('0x12')][_0x4429('0x11')]);}})['catch'](function(_0x3e02d4){logger[_0x4429('0xf')](_0x4429('0xb'),_0x1f81b9,_0x3e02d4);_0x5bfc3d(_0x3e02d4);});});} \ No newline at end of file +var _0xcf3e=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5eee53,_0x21813a){var _0x186db6=function(_0x2795da){while(--_0x2795da){_0x5eee53['push'](_0x5eee53['shift']());}};_0x186db6(++_0x21813a);}(_0xcf3e,0x1a5));var _0xecf3=function(_0x9d2f05,_0x488ff0){_0x9d2f05=_0x9d2f05-0x0;var _0x1ba001=_0xcf3e[_0x9d2f05];return _0x1ba001;};'use strict';var _=require(_0xecf3('0x0'));var util=require(_0xecf3('0x1'));var moment=require(_0xecf3('0x2'));var BPromise=require(_0xecf3('0x3'));var rs=require(_0xecf3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xecf3('0x5'))['db'];var utils=require(_0xecf3('0x6'));var logger=require(_0xecf3('0x7'))(_0xecf3('0x8'));var config=require(_0xecf3('0x9'));var jayson=require(_0xecf3('0xa'));var client=jayson[_0xecf3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1012c1,_0x56cd2c,_0x35ddd6){return new BPromise(function(_0x21e61e,_0x3bfefd){return client['request'](_0x1012c1,_0x35ddd6)['then'](function(_0x21b6af){logger['info'](_0xecf3('0xc'),_0x56cd2c,_0xecf3('0xd'));logger[_0xecf3('0xe')](_0xecf3('0xf'),_0x56cd2c,_0xecf3('0xd'),JSON[_0xecf3('0x10')](_0x21b6af));if(_0x21b6af[_0xecf3('0x11')]){if(_0x21b6af[_0xecf3('0x11')][_0xecf3('0x12')]===0x1f4){logger[_0xecf3('0x11')](_0xecf3('0xc'),_0x56cd2c,_0x21b6af['error'][_0xecf3('0x13')]);return _0x3bfefd(_0x21b6af[_0xecf3('0x11')][_0xecf3('0x13')]);}logger['error'](_0xecf3('0xc'),_0x56cd2c,_0x21b6af[_0xecf3('0x11')][_0xecf3('0x13')]);return _0x21e61e(_0x21b6af[_0xecf3('0x11')][_0xecf3('0x13')]);}else{logger['info'](_0xecf3('0xc'),_0x56cd2c,_0xecf3('0xd'));_0x21e61e(_0x21b6af[_0xecf3('0x14')]['message']);}})[_0xecf3('0x15')](function(_0x3b3f3e){logger[_0xecf3('0x11')](_0xecf3('0xc'),_0x56cd2c,_0x3b3f3e);_0x3bfefd(_0x3b3f3e);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 14a205e..43f30ba 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 _0x1d5b=['../../config/environment','isAuthenticated','index','get','/:id','show','post','put','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x43bb44,_0x938528){var _0x54a567=function(_0x4887da){while(--_0x4887da){_0x43bb44['push'](_0x43bb44['shift']());}};_0x54a567(++_0x938528);}(_0x1d5b,0x13c));var _0xb1d5=function(_0x54b7f4,_0x595418){_0x54b7f4=_0x54b7f4-0x0;var _0x3f1342=_0x1d5b[_0x54b7f4];return _0x3f1342;};'use strict';var multer=require(_0xb1d5('0x0'));var util=require(_0xb1d5('0x1'));var path=require(_0xb1d5('0x2'));var timeout=require('connect-timeout');var express=require(_0xb1d5('0x3'));var router=express['Router']();var fs_extra=require(_0xb1d5('0x4'));var auth=require(_0xb1d5('0x5'));var interaction=require(_0xb1d5('0x6'));var config=require(_0xb1d5('0x7'));var controller=require('./variable.controller');router['get']('/',auth[_0xb1d5('0x8')](),controller[_0xb1d5('0x9')]);router[_0xb1d5('0xa')](_0xb1d5('0xb'),auth[_0xb1d5('0x8')](),controller[_0xb1d5('0xc')]);router[_0xb1d5('0xd')]('/',auth[_0xb1d5('0x8')](),controller['create']);router[_0xb1d5('0xe')](_0xb1d5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xb1d5('0xf')](_0xb1d5('0xb'),auth[_0xb1d5('0x8')](),controller['destroy']);module[_0xb1d5('0x10')]=router; \ No newline at end of file +var _0x9589=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./variable.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x9589,0xbc));var _0x9958=function(_0x465b44,_0x18b4fd){_0x465b44=_0x465b44-0x0;var _0x551b9f=_0x9589[_0x465b44];return _0x551b9f;};'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 diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 8079225..82328ba 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 _0xff39=['exports','STRING','name'];(function(_0x26e040,_0xd91c1a){var _0x47894b=function(_0xccc38b){while(--_0xccc38b){_0x26e040['push'](_0x26e040['shift']());}};_0x47894b(++_0xd91c1a);}(_0xff39,0xba));var _0x9ff3=function(_0x8f6a2c,_0x435996){_0x8f6a2c=_0x8f6a2c-0x0;var _0x42a718=_0xff39[_0x8f6a2c];return _0x42a718;};'use strict';var Sequelize=require('sequelize');module[_0x9ff3('0x0')]={'name':{'type':Sequelize[_0x9ff3('0x1')],'unique':_0x9ff3('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9ff3('0x1')]}}; \ No newline at end of file +var _0x4a93=['exports','sequelize'];(function(_0xec55,_0x585db9){var _0x43e316=function(_0x4c935e){while(--_0x4c935e){_0xec55['push'](_0xec55['shift']());}};_0x43e316(++_0x585db9);}(_0x4a93,0x1bf));var _0x34a9=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x4a93[_0x5a776b];return _0xbbef59;};'use strict';var Sequelize=require(_0x34a9('0x0'));module[_0x34a9('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 0918213..6d9f832 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 _0xb130=['length','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','findAll','rows','catch','show','rawAttributes','includeAll','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','update','then','Variables','destroy','end','error','stack','name','send','index','map','Variable','fieldName','key','model','query','keys','intersection','fields','attributes'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xb130,0x1cd));var _0x0b13=function(_0x1acc2d,_0x597696){_0x1acc2d=_0x1acc2d-0x0;var _0xabfa6d=_0xb130[_0x1acc2d];return _0xabfa6d;};'use strict';var emlformat=require(_0x0b13('0x0'));var rimraf=require(_0x0b13('0x1'));var zipdir=require(_0x0b13('0x2'));var jsonpatch=require(_0x0b13('0x3'));var rp=require(_0x0b13('0x4'));var moment=require('moment');var BPromise=require(_0x0b13('0x5'));var Mustache=require(_0x0b13('0x6'));var util=require(_0x0b13('0x7'));var path=require('path');var sox=require(_0x0b13('0x8'));var csv=require(_0x0b13('0x9'));var ejs=require(_0x0b13('0xa'));var fs=require('fs');var fs_extra=require(_0x0b13('0xb'));var _=require('lodash');var squel=require(_0x0b13('0xc'));var crypto=require(_0x0b13('0xd'));var jsforce=require(_0x0b13('0xe'));var deskjs=require(_0x0b13('0xf'));var toCsv=require(_0x0b13('0x9'));var querystring=require(_0x0b13('0x10'));var Papa=require('papaparse');var Redis=require(_0x0b13('0x11'));var authService=require(_0x0b13('0x12'));var qs=require(_0x0b13('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0b13('0x14'))(_0x0b13('0x15'));var utils=require(_0x0b13('0x16'));var config=require(_0x0b13('0x17'));var licenseUtil=require(_0x0b13('0x18'));var db=require(_0x0b13('0x19'))['db'];function respondWithStatusCode(_0x4e3f78,_0x5223df){_0x5223df=_0x5223df||0xcc;return function(_0x287873){if(_0x287873){return _0x4e3f78[_0x0b13('0x1a')](_0x5223df);}return _0x4e3f78[_0x0b13('0x1b')](_0x5223df)['end']();};}function respondWithResult(_0x12615d,_0x198180){_0x198180=_0x198180||0xc8;return function(_0x4375a5){if(_0x4375a5){return _0x12615d[_0x0b13('0x1b')](_0x198180)['json'](_0x4375a5);}};}function respondWithFilteredResult(_0x1fb7d9,_0x5d1af7){return function(_0x498f62){if(_0x498f62){var _0x378c01=typeof _0x5d1af7[_0x0b13('0x1c')]===_0x0b13('0x1d')&&typeof _0x5d1af7[_0x0b13('0x1e')]===_0x0b13('0x1d');var _0x26189b=_0x498f62[_0x0b13('0x1f')];var _0x35c34f=_0x378c01?0x0:_0x5d1af7['offset'];var _0x3e2340=_0x378c01?_0x498f62['count']:_0x5d1af7[_0x0b13('0x1c')]+_0x5d1af7['limit'];var _0x33b2bf;if(_0x3e2340>=_0x26189b){_0x3e2340=_0x26189b;_0x33b2bf=0xc8;}else{_0x33b2bf=0xce;}_0x1fb7d9['status'](_0x33b2bf);return _0x1fb7d9[_0x0b13('0x20')](_0x0b13('0x21'),_0x35c34f+'-'+_0x3e2340+'/'+_0x26189b)['json'](_0x498f62);}return null;};}function patchUpdates(_0x17b925){return function(_0x5980fe){try{jsonpatch[_0x0b13('0x22')](_0x5980fe,_0x17b925,!![]);}catch(_0x45cb53){return BPromise['reject'](_0x45cb53);}return _0x5980fe['save']();};}function saveUpdates(_0x451710,_0x57e0ce){return function(_0x58548f){if(_0x58548f){return _0x58548f[_0x0b13('0x23')](_0x451710)[_0x0b13('0x24')](function(_0x34cd1d){return _0x34cd1d;});}return null;};}function removeEntity(_0x3bdc9e,_0x503ddf){return function(_0x34fd7d){if(_0x34fd7d){return _0x34fd7d['destroy']()[_0x0b13('0x24')](function(){var _0xbbd4ea=_0x34fd7d['get']({'plain':!![]});var _0x3c2aee=_0x0b13('0x25');return db['UserProfileResource'][_0x0b13('0x26')]({'where':{'type':_0x3c2aee,'resourceId':_0xbbd4ea['id']}})[_0x0b13('0x24')](function(){return _0x34fd7d;});})['then'](function(){_0x3bdc9e[_0x0b13('0x1b')](0xcc)[_0x0b13('0x27')]();});}};}function handleEntityNotFound(_0x47f431,_0x2eac26){return function(_0x2f8a44){if(!_0x2f8a44){_0x47f431[_0x0b13('0x1a')](0x194);}return _0x2f8a44;};}function handleError(_0x537050,_0x2beaac){_0x2beaac=_0x2beaac||0x1f4;return function(_0x4b2f0e){logger[_0x0b13('0x28')](_0x4b2f0e[_0x0b13('0x29')]);if(_0x4b2f0e[_0x0b13('0x2a')]){delete _0x4b2f0e['name'];}_0x537050[_0x0b13('0x1b')](_0x2beaac)[_0x0b13('0x2b')](_0x4b2f0e);};}exports[_0x0b13('0x2c')]=function(_0xf6f282,_0x21de99){var _0x1451d9={},_0xed3a8e={},_0x225f0d={'count':0x0,'rows':[]};var _0x14b238=_[_0x0b13('0x2d')](db[_0x0b13('0x2e')]['rawAttributes'],function(_0x3770b2){return{'name':_0x3770b2[_0x0b13('0x2f')],'type':_0x3770b2['type'][_0x0b13('0x30')]};});_0xed3a8e[_0x0b13('0x31')]=_['map'](_0x14b238,_0x0b13('0x2a'));_0xed3a8e[_0x0b13('0x32')]=_[_0x0b13('0x33')](_0xf6f282[_0x0b13('0x32')]);_0xed3a8e['filters']=_['intersection'](_0xed3a8e[_0x0b13('0x31')],_0xed3a8e[_0x0b13('0x32')]);_0x1451d9['attributes']=_[_0x0b13('0x34')](_0xed3a8e[_0x0b13('0x31')],qs['fields'](_0xf6f282[_0x0b13('0x32')][_0x0b13('0x35')]));_0x1451d9[_0x0b13('0x36')]=_0x1451d9[_0x0b13('0x36')][_0x0b13('0x37')]?_0x1451d9[_0x0b13('0x36')]:_0xed3a8e[_0x0b13('0x31')];if(!_0xf6f282[_0x0b13('0x32')]['hasOwnProperty'](_0x0b13('0x38'))){_0x1451d9[_0x0b13('0x1e')]=qs['limit'](_0xf6f282['query'][_0x0b13('0x1e')]);_0x1451d9[_0x0b13('0x1c')]=qs['offset'](_0xf6f282[_0x0b13('0x32')][_0x0b13('0x1c')]);}_0x1451d9[_0x0b13('0x39')]=qs[_0x0b13('0x3a')](_0xf6f282[_0x0b13('0x32')][_0x0b13('0x3a')]);_0x1451d9[_0x0b13('0x3b')]=qs[_0x0b13('0x3c')](_[_0x0b13('0x3d')](_0xf6f282[_0x0b13('0x32')],_0xed3a8e[_0x0b13('0x3c')]),_0x14b238);if(_0xf6f282['query'][_0x0b13('0x3e')]){_0x1451d9['where']=_[_0x0b13('0x3f')](_0x1451d9[_0x0b13('0x3b')],{'$or':_[_0x0b13('0x2d')](_0x14b238,function(_0x50fd41){if(_0x50fd41[_0x0b13('0x40')]!==_0x0b13('0x41')){var _0x2f7952={};_0x2f7952[_0x50fd41[_0x0b13('0x2a')]]={'$like':'%'+_0xf6f282['query']['filter']+'%'};return _0x2f7952;}})});}_0x1451d9=_[_0x0b13('0x3f')]({},_0x1451d9,_0xf6f282[_0x0b13('0x42')]);var _0x44fa10={'where':_0x1451d9[_0x0b13('0x3b')]};return db[_0x0b13('0x2e')][_0x0b13('0x1f')](_0x44fa10)[_0x0b13('0x24')](function(_0x4eb8fd){_0x225f0d[_0x0b13('0x1f')]=_0x4eb8fd;if(_0xf6f282[_0x0b13('0x32')]['includeAll']){_0x1451d9['include']=[{'all':!![]}];}return db['Variable'][_0x0b13('0x43')](_0x1451d9);})[_0x0b13('0x24')](function(_0x5e2645){_0x225f0d[_0x0b13('0x44')]=_0x5e2645;return _0x225f0d;})[_0x0b13('0x24')](respondWithFilteredResult(_0x21de99,_0x1451d9))[_0x0b13('0x45')](handleError(_0x21de99,null));};exports[_0x0b13('0x46')]=function(_0x119330,_0xf45ab0){var _0x3c1ce3={'raw':!![],'where':{'id':_0x119330['params']['id']}},_0xa482cd={};_0xa482cd[_0x0b13('0x31')]=_[_0x0b13('0x33')](db[_0x0b13('0x2e')][_0x0b13('0x47')]);_0xa482cd[_0x0b13('0x32')]=_['keys'](_0x119330[_0x0b13('0x32')]);_0xa482cd[_0x0b13('0x3c')]=_[_0x0b13('0x34')](_0xa482cd[_0x0b13('0x31')],_0xa482cd['query']);_0x3c1ce3[_0x0b13('0x36')]=_[_0x0b13('0x34')](_0xa482cd[_0x0b13('0x31')],qs['fields'](_0x119330[_0x0b13('0x32')][_0x0b13('0x35')]));_0x3c1ce3[_0x0b13('0x36')]=_0x3c1ce3[_0x0b13('0x36')]['length']?_0x3c1ce3[_0x0b13('0x36')]:_0xa482cd[_0x0b13('0x31')];if(_0x119330[_0x0b13('0x32')][_0x0b13('0x48')]){_0x3c1ce3['include']=[{'all':!![]}];}_0x3c1ce3=_['merge']({},_0x3c1ce3,_0x119330[_0x0b13('0x42')]);return db[_0x0b13('0x2e')][_0x0b13('0x49')](_0x3c1ce3)['then'](handleEntityNotFound(_0xf45ab0,null))[_0x0b13('0x24')](respondWithResult(_0xf45ab0,null))[_0x0b13('0x45')](handleError(_0xf45ab0,null));};exports[_0x0b13('0x4a')]=function(_0x3cf3b8,_0x36e99f){return db['Variable'][_0x0b13('0x4a')](_0x3cf3b8['body'],{})[_0x0b13('0x24')](function(_0x3c6a3f){var _0xe9a010=_0x3cf3b8['user'][_0x0b13('0x4b')]({'plain':!![]});if(!_0xe9a010)throw new Error(_0x0b13('0x4c'));if(_0xe9a010[_0x0b13('0x4d')]===_0x0b13('0x4e')){var _0x5341e8=_0x3c6a3f[_0x0b13('0x4b')]({'plain':!![]});var _0x2c10a5=_0x0b13('0x25');return db[_0x0b13('0x4f')][_0x0b13('0x49')]({'where':{'name':_0x2c10a5,'userProfileId':_0xe9a010[_0x0b13('0x50')]},'raw':!![]})[_0x0b13('0x24')](function(_0x5ac080){if(_0x5ac080&&_0x5ac080[_0x0b13('0x51')]===0x0){return db[_0x0b13('0x52')][_0x0b13('0x4a')]({'name':_0x5341e8['name'],'resourceId':_0x5341e8['id'],'type':_0x5ac080[_0x0b13('0x2a')],'sectionId':_0x5ac080['id']},{})[_0x0b13('0x24')](function(){return _0x3c6a3f;});}else{return _0x3c6a3f;}})[_0x0b13('0x45')](function(_0x5e9706){logger['error'](_0x0b13('0x53'),_0x5e9706);throw _0x5e9706;});}return _0x3c6a3f;})[_0x0b13('0x24')](respondWithResult(_0x36e99f,0xc9))[_0x0b13('0x45')](handleError(_0x36e99f,null));};exports[_0x0b13('0x23')]=function(_0x251db3,_0x6f5459){if(_0x251db3[_0x0b13('0x54')]['id']){delete _0x251db3[_0x0b13('0x54')]['id'];}return db[_0x0b13('0x2e')][_0x0b13('0x49')]({'where':{'id':_0x251db3[_0x0b13('0x55')]['id']}})[_0x0b13('0x24')](handleEntityNotFound(_0x6f5459,null))[_0x0b13('0x24')](saveUpdates(_0x251db3[_0x0b13('0x54')],null))[_0x0b13('0x24')](respondWithResult(_0x6f5459,null))[_0x0b13('0x45')](handleError(_0x6f5459,null));};exports[_0x0b13('0x26')]=function(_0x4daa09,_0x4502e8){return db[_0x0b13('0x2e')][_0x0b13('0x49')]({'where':{'id':_0x4daa09[_0x0b13('0x55')]['id']}})[_0x0b13('0x24')](handleEntityNotFound(_0x4502e8,null))[_0x0b13('0x24')](removeEntity(_0x4502e8,null))[_0x0b13('0x45')](handleError(_0x4502e8,null));}; \ No newline at end of file +var _0x4413=['pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','Variables','UserProfileResource','destroy','error','stack','name','send','index','Variable','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x53448c,_0x2ef0fe){var _0x233e1a=function(_0x37b75b){while(--_0x37b75b){_0x53448c['push'](_0x53448c['shift']());}};_0x233e1a(++_0x2ef0fe);}(_0x4413,0x158));var _0x3441=function(_0x1ebc32,_0x7cd7cd){_0x1ebc32=_0x1ebc32-0x0;var _0x1d9acb=_0x4413[_0x1ebc32];return _0x1d9acb;};'use strict';var emlformat=require(_0x3441('0x0'));var rimraf=require(_0x3441('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3441('0x2'));var rp=require(_0x3441('0x3'));var moment=require(_0x3441('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3441('0x5'));var util=require(_0x3441('0x6'));var path=require(_0x3441('0x7'));var sox=require(_0x3441('0x8'));var csv=require('to-csv');var ejs=require(_0x3441('0x9'));var fs=require('fs');var fs_extra=require(_0x3441('0xa'));var _=require(_0x3441('0xb'));var squel=require('squel');var crypto=require(_0x3441('0xc'));var jsforce=require(_0x3441('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x3441('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3441('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3441('0x10'))(_0x3441('0x11'));var utils=require(_0x3441('0x12'));var config=require(_0x3441('0x13'));var licenseUtil=require(_0x3441('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49ecc8,_0x5ecc85){_0x5ecc85=_0x5ecc85||0xcc;return function(_0x27e178){if(_0x27e178){return _0x49ecc8[_0x3441('0x15')](_0x5ecc85);}return _0x49ecc8[_0x3441('0x16')](_0x5ecc85)[_0x3441('0x17')]();};}function respondWithResult(_0x514658,_0x3414ab){_0x3414ab=_0x3414ab||0xc8;return function(_0x14a2a0){if(_0x14a2a0){return _0x514658[_0x3441('0x16')](_0x3414ab)[_0x3441('0x18')](_0x14a2a0);}};}function respondWithFilteredResult(_0x40d3fe,_0x29677d){return function(_0x4c6386){if(_0x4c6386){var _0x5f3428=typeof _0x29677d[_0x3441('0x19')]==='undefined'&&typeof _0x29677d[_0x3441('0x1a')]===_0x3441('0x1b');var _0x54d276=_0x4c6386[_0x3441('0x1c')];var _0x2f08fb=_0x5f3428?0x0:_0x29677d[_0x3441('0x19')];var _0x4ff7d4=_0x5f3428?_0x4c6386[_0x3441('0x1c')]:_0x29677d[_0x3441('0x19')]+_0x29677d[_0x3441('0x1a')];var _0x1adc43;if(_0x4ff7d4>=_0x54d276){_0x4ff7d4=_0x54d276;_0x1adc43=0xc8;}else{_0x1adc43=0xce;}_0x40d3fe[_0x3441('0x16')](_0x1adc43);return _0x40d3fe[_0x3441('0x1d')](_0x3441('0x1e'),_0x2f08fb+'-'+_0x4ff7d4+'/'+_0x54d276)['json'](_0x4c6386);}return null;};}function patchUpdates(_0x46127){return function(_0x828537){try{jsonpatch[_0x3441('0x1f')](_0x828537,_0x46127,!![]);}catch(_0x63a4d3){return BPromise[_0x3441('0x20')](_0x63a4d3);}return _0x828537[_0x3441('0x21')]();};}function saveUpdates(_0x2e59a5,_0x112405){return function(_0x1e1eaa){if(_0x1e1eaa){return _0x1e1eaa[_0x3441('0x22')](_0x2e59a5)[_0x3441('0x23')](function(_0xe25148){return _0xe25148;});}return null;};}function removeEntity(_0x29071f,_0x118da2){return function(_0x26bb4c){if(_0x26bb4c){return _0x26bb4c['destroy']()[_0x3441('0x23')](function(){var _0x39afa6=_0x26bb4c[_0x3441('0x24')]({'plain':!![]});var _0x1e18a5=_0x3441('0x25');return db[_0x3441('0x26')][_0x3441('0x27')]({'where':{'type':_0x1e18a5,'resourceId':_0x39afa6['id']}})['then'](function(){return _0x26bb4c;});})[_0x3441('0x23')](function(){_0x29071f[_0x3441('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b0ef4,_0x19d735){return function(_0x53e87a){if(!_0x53e87a){_0x5b0ef4[_0x3441('0x15')](0x194);}return _0x53e87a;};}function handleError(_0x3a9302,_0x188f23){_0x188f23=_0x188f23||0x1f4;return function(_0x3bafac){logger[_0x3441('0x28')](_0x3bafac[_0x3441('0x29')]);if(_0x3bafac['name']){delete _0x3bafac[_0x3441('0x2a')];}_0x3a9302[_0x3441('0x16')](_0x188f23)[_0x3441('0x2b')](_0x3bafac);};}exports[_0x3441('0x2c')]=function(_0x48bd67,_0x48699e){var _0x113f7f={},_0x288ed0={},_0x38d350={'count':0x0,'rows':[]};var _0x2c0ee3=_['map'](db[_0x3441('0x2d')]['rawAttributes'],function(_0x330cc3){return{'name':_0x330cc3[_0x3441('0x2e')],'type':_0x330cc3[_0x3441('0x2f')]['key']};});_0x288ed0[_0x3441('0x30')]=_[_0x3441('0x31')](_0x2c0ee3,_0x3441('0x2a'));_0x288ed0['query']=_[_0x3441('0x32')](_0x48bd67[_0x3441('0x33')]);_0x288ed0[_0x3441('0x34')]=_[_0x3441('0x35')](_0x288ed0[_0x3441('0x30')],_0x288ed0[_0x3441('0x33')]);_0x113f7f[_0x3441('0x36')]=_[_0x3441('0x35')](_0x288ed0[_0x3441('0x30')],qs['fields'](_0x48bd67[_0x3441('0x33')][_0x3441('0x37')]));_0x113f7f['attributes']=_0x113f7f['attributes'][_0x3441('0x38')]?_0x113f7f[_0x3441('0x36')]:_0x288ed0[_0x3441('0x30')];if(!_0x48bd67['query'][_0x3441('0x39')](_0x3441('0x3a'))){_0x113f7f[_0x3441('0x1a')]=qs[_0x3441('0x1a')](_0x48bd67[_0x3441('0x33')][_0x3441('0x1a')]);_0x113f7f[_0x3441('0x19')]=qs[_0x3441('0x19')](_0x48bd67[_0x3441('0x33')][_0x3441('0x19')]);}_0x113f7f[_0x3441('0x3b')]=qs['sort'](_0x48bd67[_0x3441('0x33')][_0x3441('0x3c')]);_0x113f7f['where']=qs['filters'](_[_0x3441('0x3d')](_0x48bd67['query'],_0x288ed0['filters']),_0x2c0ee3);if(_0x48bd67['query'][_0x3441('0x3e')]){_0x113f7f['where']=_[_0x3441('0x3f')](_0x113f7f[_0x3441('0x40')],{'$or':_[_0x3441('0x31')](_0x2c0ee3,function(_0x362afd){if(_0x362afd[_0x3441('0x2f')]!==_0x3441('0x41')){var _0x131fa9={};_0x131fa9[_0x362afd['name']]={'$like':'%'+_0x48bd67[_0x3441('0x33')][_0x3441('0x3e')]+'%'};return _0x131fa9;}})});}_0x113f7f=_[_0x3441('0x3f')]({},_0x113f7f,_0x48bd67[_0x3441('0x42')]);var _0xb5ec1d={'where':_0x113f7f[_0x3441('0x40')]};return db[_0x3441('0x2d')]['count'](_0xb5ec1d)[_0x3441('0x23')](function(_0x58c7b1){_0x38d350[_0x3441('0x1c')]=_0x58c7b1;if(_0x48bd67['query'][_0x3441('0x43')]){_0x113f7f[_0x3441('0x44')]=[{'all':!![]}];}return db['Variable'][_0x3441('0x45')](_0x113f7f);})['then'](function(_0x15874c){_0x38d350[_0x3441('0x46')]=_0x15874c;return _0x38d350;})['then'](respondWithFilteredResult(_0x48699e,_0x113f7f))['catch'](handleError(_0x48699e,null));};exports[_0x3441('0x47')]=function(_0x135b69,_0x384faf){var _0x190171={'raw':!![],'where':{'id':_0x135b69[_0x3441('0x48')]['id']}},_0xebf653={};_0xebf653[_0x3441('0x30')]=_[_0x3441('0x32')](db[_0x3441('0x2d')]['rawAttributes']);_0xebf653['query']=_[_0x3441('0x32')](_0x135b69[_0x3441('0x33')]);_0xebf653['filters']=_['intersection'](_0xebf653['model'],_0xebf653[_0x3441('0x33')]);_0x190171[_0x3441('0x36')]=_[_0x3441('0x35')](_0xebf653[_0x3441('0x30')],qs[_0x3441('0x37')](_0x135b69[_0x3441('0x33')][_0x3441('0x37')]));_0x190171[_0x3441('0x36')]=_0x190171[_0x3441('0x36')]['length']?_0x190171[_0x3441('0x36')]:_0xebf653[_0x3441('0x30')];if(_0x135b69[_0x3441('0x33')][_0x3441('0x43')]){_0x190171['include']=[{'all':!![]}];}_0x190171=_[_0x3441('0x3f')]({},_0x190171,_0x135b69['options']);return db[_0x3441('0x2d')][_0x3441('0x49')](_0x190171)[_0x3441('0x23')](handleEntityNotFound(_0x384faf,null))['then'](respondWithResult(_0x384faf,null))[_0x3441('0x4a')](handleError(_0x384faf,null));};exports['create']=function(_0x34bf38,_0x14eb1d){return db['Variable'][_0x3441('0x4b')](_0x34bf38[_0x3441('0x4c')],{})[_0x3441('0x23')](function(_0x2c3824){var _0x57a72b=_0x34bf38[_0x3441('0x4d')][_0x3441('0x24')]({'plain':!![]});if(!_0x57a72b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57a72b[_0x3441('0x4e')]===_0x3441('0x4d')){var _0x130ee0=_0x2c3824[_0x3441('0x24')]({'plain':!![]});var _0x43da26=_0x3441('0x25');return db['UserProfileSection'][_0x3441('0x49')]({'where':{'name':_0x43da26,'userProfileId':_0x57a72b[_0x3441('0x4f')]},'raw':!![]})[_0x3441('0x23')](function(_0x4e18e9){if(_0x4e18e9&&_0x4e18e9['autoAssociation']===0x0){return db[_0x3441('0x26')][_0x3441('0x4b')]({'name':_0x130ee0[_0x3441('0x2a')],'resourceId':_0x130ee0['id'],'type':_0x4e18e9['name'],'sectionId':_0x4e18e9['id']},{})[_0x3441('0x23')](function(){return _0x2c3824;});}else{return _0x2c3824;}})[_0x3441('0x4a')](function(_0x3f24fa){logger[_0x3441('0x28')](_0x3441('0x50'),_0x3f24fa);throw _0x3f24fa;});}return _0x2c3824;})[_0x3441('0x23')](respondWithResult(_0x14eb1d,0xc9))[_0x3441('0x4a')](handleError(_0x14eb1d,null));};exports[_0x3441('0x22')]=function(_0x1769e1,_0x263ac4){if(_0x1769e1[_0x3441('0x4c')]['id']){delete _0x1769e1[_0x3441('0x4c')]['id'];}return db[_0x3441('0x2d')][_0x3441('0x49')]({'where':{'id':_0x1769e1[_0x3441('0x48')]['id']}})['then'](handleEntityNotFound(_0x263ac4,null))[_0x3441('0x23')](saveUpdates(_0x1769e1[_0x3441('0x4c')],null))[_0x3441('0x23')](respondWithResult(_0x263ac4,null))[_0x3441('0x4a')](handleError(_0x263ac4,null));};exports[_0x3441('0x27')]=function(_0x4dd5fe,_0x17a103){return db['Variable']['find']({'where':{'id':_0x4dd5fe[_0x3441('0x48')]['id']}})[_0x3441('0x23')](handleEntityNotFound(_0x17a103,null))[_0x3441('0x23')](removeEntity(_0x17a103,null))[_0x3441('0x4a')](handleError(_0x17a103,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 3a6e727..e5275cf 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 _0x3562=['exports','define','Variable','tools_variables','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','./variable.attributes'];(function(_0x49266a,_0x3ccec1){var _0x3cc155=function(_0xb4da3f){while(--_0xb4da3f){_0x49266a['push'](_0x49266a['shift']());}};_0x3cc155(++_0x3ccec1);}(_0x3562,0x88));var _0x2356=function(_0x3cff6c,_0x107a6c){_0x3cff6c=_0x3cff6c-0x0;var _0x442fb7=_0x3562[_0x3cff6c];return _0x442fb7;};'use strict';var _=require(_0x2356('0x0'));var util=require(_0x2356('0x1'));var logger=require(_0x2356('0x2'))('api');var moment=require(_0x2356('0x3'));var BPromise=require(_0x2356('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2356('0x5'));var rimraf=require('rimraf');var config=require(_0x2356('0x6'));var attributes=require(_0x2356('0x7'));module[_0x2356('0x8')]=function(_0x2fde68,_0x22b253){return _0x2fde68[_0x2356('0x9')](_0x2356('0xa'),attributes,{'tableName':_0x2356('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x58c0=['request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','tools_variables','lodash','util','../../config/logger','moment','bluebird'];(function(_0x47ec53,_0x5106fd){var _0x54eb20=function(_0x19078e){while(--_0x19078e){_0x47ec53['push'](_0x47ec53['shift']());}};_0x54eb20(++_0x5106fd);}(_0x58c0,0xbf));var _0x058c=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x58c0[_0xc8a931];return _0x28bd27;};'use strict';var _=require(_0x058c('0x0'));var util=require(_0x058c('0x1'));var logger=require(_0x058c('0x2'))('api');var moment=require(_0x058c('0x3'));var BPromise=require(_0x058c('0x4'));var rp=require(_0x058c('0x5'));var fs=require('fs');var path=require(_0x058c('0x6'));var rimraf=require(_0x058c('0x7'));var config=require(_0x058c('0x8'));var attributes=require(_0x058c('0x9'));module[_0x058c('0xa')]=function(_0x456603,_0x36a260){return _0x456603[_0x058c('0xb')](_0x058c('0xc'),attributes,{'tableName':_0x058c('0xd'),'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 38f78e1..bb5824f 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 _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0x4b5f91,_0x26c295){var _0x3c3a04=function(_0x25dbb6){while(--_0x25dbb6){_0x4b5f91['push'](_0x4b5f91['shift']());}};_0x3c3a04(++_0x26c295);}(_0xe14b,0x93));var _0xbe14=function(_0xffd105,_0x2d565a){_0xffd105=_0xffd105-0x0;var _0x34a9a7=_0xe14b[_0xffd105];return _0x34a9a7;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});}; \ No newline at end of file +var _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowVariable','Variable','find'];(function(_0xf94131,_0x58b63d){var _0xdf5c19=function(_0xa00801){while(--_0xa00801){_0xf94131['push'](_0xf94131['shift']());}};_0xdf5c19(++_0x58b63d);}(_0x55ca,0x126));var _0xa55c=function(_0x2ab76b,_0x176579){_0x2ab76b=_0x2ab76b-0x0;var _0x201126=_0x55ca[_0x2ab76b];return _0x201126;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('Variable,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('Variable,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 25e801d..813eefa 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 _0x18e8=['restart','/migrations','migrations','express','Router','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','/reset','/pull','pull'];(function(_0x44ef27,_0xee6206){var _0x3a954c=function(_0x49dd9c){while(--_0x49dd9c){_0x44ef27['push'](_0x44ef27['shift']());}};_0x3a954c(++_0xee6206);}(_0x18e8,0x145));var _0x818e=function(_0x5681b8,_0x4caf5d){_0x5681b8=_0x5681b8-0x0;var _0x2205db=_0x18e8[_0x5681b8];return _0x2205db;};'use strict';var express=require(_0x818e('0x0'));var router=express[_0x818e('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x818e('0x2'));router[_0x818e('0x3')]('/',controller[_0x818e('0x4')]);router[_0x818e('0x3')](_0x818e('0x5'),auth[_0x818e('0x6')](),auth[_0x818e('0x7')](),controller['fetch']);router[_0x818e('0x3')](_0x818e('0x8'),auth[_0x818e('0x6')](),auth[_0x818e('0x7')](),controller['reset']);router[_0x818e('0x3')](_0x818e('0x9'),auth[_0x818e('0x6')](),auth[_0x818e('0x7')](),controller[_0x818e('0xa')]);router[_0x818e('0x3')]('/restart',auth[_0x818e('0x6')](),controller[_0x818e('0xb')]);router[_0x818e('0x3')](_0x818e('0xc'),controller[_0x818e('0xd')]);module['exports']=router; \ No newline at end of file +var _0xc5c8=['reset','/pull','pull','/restart','restart','exports','express','Router','../../components/auth/service','get','index','/fetch','canUpdate','fetch','/reset','isAuthenticated'];(function(_0x49d3dc,_0x16ba22){var _0x3e11a6=function(_0x39a120){while(--_0x39a120){_0x49d3dc['push'](_0x49d3dc['shift']());}};_0x3e11a6(++_0x16ba22);}(_0xc5c8,0x156));var _0x8c5c=function(_0x4d59f1,_0x13f4e3){_0x4d59f1=_0x4d59f1-0x0;var _0x51516c=_0xc5c8[_0x4d59f1];return _0x51516c;};'use strict';var express=require(_0x8c5c('0x0'));var router=express[_0x8c5c('0x1')]();var auth=require(_0x8c5c('0x2'));var controller=require('./version.controller');router[_0x8c5c('0x3')]('/',controller[_0x8c5c('0x4')]);router['get'](_0x8c5c('0x5'),auth['isAuthenticated'](),auth[_0x8c5c('0x6')](),controller[_0x8c5c('0x7')]);router[_0x8c5c('0x3')](_0x8c5c('0x8'),auth[_0x8c5c('0x9')](),auth[_0x8c5c('0x6')](),controller[_0x8c5c('0xa')]);router[_0x8c5c('0x3')](_0x8c5c('0xb'),auth['isAuthenticated'](),auth[_0x8c5c('0x6')](),controller[_0x8c5c('0xc')]);router[_0x8c5c('0x3')](_0x8c5c('0xd'),auth['isAuthenticated'](),controller[_0x8c5c('0xe')]);router[_0x8c5c('0x3')]('/migrations',controller['migrations']);module[_0x8c5c('0xf')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index a8c6fe8..820fe5a 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 _0xdd4f=['master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','root','server','migrations','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.','last','umzug','path','lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','index','exports','query','tags','latest','2.0.0','status','json','fetch','origin'];(function(_0x19b8a1,_0x349bbb){var _0x2b9fe3=function(_0x3affdb){while(--_0x3affdb){_0x19b8a1['push'](_0x19b8a1['shift']());}};_0x2b9fe3(++_0x349bbb);}(_0xdd4f,0xc9));var _0xfdd4=function(_0x5f3b8a,_0x2f1fdb){_0x5f3b8a=_0x5f3b8a-0x0;var _0xc81a91=_0xdd4f[_0x5f3b8a];return _0xc81a91;};'use strict';var Umzug=require(_0xfdd4('0x0'));var path=require(_0xfdd4('0x1'));var fs=require('fs');var _=require(_0xfdd4('0x2'));var pkginfo=require(_0xfdd4('0x3'))(module,_0xfdd4('0x4'));var compareVersions=require(_0xfdd4('0x5'));var exec=require(_0xfdd4('0x6'))[_0xfdd4('0x7')];var db=require(_0xfdd4('0x8'))['db'];var config=require(_0xfdd4('0x9'));var pm2=require(_0xfdd4('0xa'));var logger=require(_0xfdd4('0xb'))(_0xfdd4('0xc'));var git=require('simple-git')(config['root']);exports[_0xfdd4('0xd')]=function(_0x48f969,_0x17d9e6){var _0x435dfb={'current':module[_0xfdd4('0xe')]['version'],'phonebar':0x2};if(_0x48f969[_0xfdd4('0xf')]&&_0x48f969[_0xfdd4('0xf')]['latest']){return git['fetch']()[_0xfdd4('0x10')](function(_0x197792,_0x242333){_0x435dfb[_0xfdd4('0x11')]=(_0x197792?module['exports']['version']:_0x242333[_0xfdd4('0x11')])||_0xfdd4('0x12');return _0x17d9e6[_0xfdd4('0x13')](0xc8)[_0xfdd4('0x14')](_0x435dfb);});}else{return _0x17d9e6[_0xfdd4('0x13')](0xc8)[_0xfdd4('0x14')](_0x435dfb);}};exports[_0xfdd4('0x15')]=function(_0x58d858,_0x36139a){return git['fetch']([_0xfdd4('0x16'),_0xfdd4('0x17')],function(_0xe204a6){if(_0xe204a6){logger[_0xfdd4('0x18')](_0xe204a6);return _0x36139a[_0xfdd4('0x13')](0x1f4)[_0xfdd4('0x14')](_0xe204a6);}logger[_0xfdd4('0x19')](_0xfdd4('0x1a'));return _0x36139a[_0xfdd4('0x13')](0xc8)[_0xfdd4('0x14')]({'output':_0xfdd4('0x1b')});});};exports[_0xfdd4('0x1c')]=function(_0x32ee42,_0x37916a){return git[_0xfdd4('0x1c')](['--hard',_0xfdd4('0x1d')],function(_0x5cd12a){if(_0x5cd12a){logger['error'](_0x5cd12a);return _0x37916a[_0xfdd4('0x13')](0x1f4)[_0xfdd4('0x14')](_0x5cd12a);}logger[_0xfdd4('0x19')](_0xfdd4('0x1e'));return _0x37916a[_0xfdd4('0x13')](0xc8)[_0xfdd4('0x14')]({'output':_0xfdd4('0x1f')});});};exports[_0xfdd4('0x20')]=function(_0x5e18d7,_0x308825){exec(_0xfdd4('0x21'),function(_0x424b62,_0x3a198b,_0x265f08){logger[_0xfdd4('0x19')](_0x3a198b);logger[_0xfdd4('0x19')](_0x265f08);if(_0x424b62){logger[_0xfdd4('0x18')](_0x424b62);return _0x308825['status'](0x1f4)[_0xfdd4('0x14')](_0x424b62);}return _0x308825[_0xfdd4('0x13')](0xc8)[_0xfdd4('0x14')]({'output':_0x3a198b});});};exports[_0xfdd4('0x22')]=function(_0x4884fd,_0x43afef){return pm2[_0xfdd4('0x22')](_0xfdd4('0x23'))[_0xfdd4('0x24')](function(_0x4fc10e){logger['info'](_0xfdd4('0x25'),_0x4fc10e);return _0x43afef[_0xfdd4('0x13')](0xc8)[_0xfdd4('0x14')]({'output':_0xfdd4('0x26')});})[_0xfdd4('0x27')](function(_0xb60878){logger[_0xfdd4('0x18')](_0xb60878);return _0x43afef['status'](0x1f4)[_0xfdd4('0x14')](_0xb60878);});};exports['migrations']=function(_0x4f6518,_0x257d21){var _0x528f4a=fs[_0xfdd4('0x28')](path[_0xfdd4('0x29')](config[_0xfdd4('0x2a')],_0xfdd4('0x2b'),_0xfdd4('0x2c')));var _0x37af47=[];for(var _0x17a461=0x0;_0x17a461<_0x528f4a[_0xfdd4('0x2d')];_0x17a461++){var _0x206510=_0x528f4a[_0x17a461][_0xfdd4('0x2e')](_0xfdd4('0x2f'),'');if(compareVersions(module['exports']['version'],_0x206510)===-0x1){_0x37af47[_0xfdd4('0x30')](_0x206510);}}if(_0x37af47[_0xfdd4('0x2d')]){var _0x1f926c=_0x37af47[_0xfdd4('0x31')](compareVersions);var _0x114fd6=new Umzug({'storage':_0xfdd4('0x32'),'storageOptions':{'model':db[_0xfdd4('0x33')],'modelName':_0xfdd4('0x33'),'columnName':'version'},'migrations':{'params':[db['sequelize'][_0xfdd4('0x34')](),db[_0xfdd4('0x32')][_0xfdd4('0x35')],function(){throw new Error(_0xfdd4('0x36'));}],'path':path[_0xfdd4('0x29')](config['root'],_0xfdd4('0x2b'),_0xfdd4('0x2c')),'pattern':/\.js$/}});_0x114fd6['up']({'migrations':_['map'](_0x1f926c,function(_0x1dee02){return _0x1dee02+_0xfdd4('0x2f');})})['then'](function(){return _0x257d21[_0xfdd4('0x13')](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports'][_0xfdd4('0x4')]+'\x20to\x20'+_[_0xfdd4('0x37')](_0x1f926c),'migrations':_[_0xfdd4('0x29')](_0x1f926c)});})[_0xfdd4('0x27')](function(_0x1086f3){if(_0x1086f3 instanceof db['sequelize']['UniqueConstraintError']){return _0x257d21[_0xfdd4('0x13')](0xc8)[_0xfdd4('0x14')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x257d21['status'](0x1f4)[_0xfdd4('0x14')](_0x1086f3);}});}else{return _0x257d21['status'](0xc8)[_0xfdd4('0x14')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +var _0xd779=['2.0.0','status','origin','master','error','json','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','server','length','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','pkginfo','version','compare-versions','exec','../../config/pm2','../../config/logger','update','root','index','exports','query','latest','fetch','tags'];(function(_0x1c9dd7,_0x275dbb){var _0x4a241a=function(_0x4da5f7){while(--_0x4da5f7){_0x1c9dd7['push'](_0x1c9dd7['shift']());}};_0x4a241a(++_0x275dbb);}(_0xd779,0x92));var _0x9d77=function(_0x43ff33,_0x5322ea){_0x43ff33=_0x43ff33-0x0;var _0x181d7f=_0xd779[_0x43ff33];return _0x181d7f;};'use strict';var Umzug=require(_0x9d77('0x0'));var path=require(_0x9d77('0x1'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x9d77('0x2'))(module,_0x9d77('0x3'));var compareVersions=require(_0x9d77('0x4'));var exec=require('child_process')[_0x9d77('0x5')];var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var pm2=require(_0x9d77('0x6'));var logger=require(_0x9d77('0x7'))(_0x9d77('0x8'));var git=require('simple-git')(config[_0x9d77('0x9')]);exports[_0x9d77('0xa')]=function(_0x1ec7e6,_0x526bc3){var _0xa76d79={'current':module[_0x9d77('0xb')][_0x9d77('0x3')],'phonebar':0x2};if(_0x1ec7e6[_0x9d77('0xc')]&&_0x1ec7e6[_0x9d77('0xc')][_0x9d77('0xd')]){return git[_0x9d77('0xe')]()[_0x9d77('0xf')](function(_0x76260b,_0x24e995){_0xa76d79[_0x9d77('0xd')]=(_0x76260b?module[_0x9d77('0xb')][_0x9d77('0x3')]:_0x24e995[_0x9d77('0xd')])||_0x9d77('0x10');return _0x526bc3[_0x9d77('0x11')](0xc8)['json'](_0xa76d79);});}else{return _0x526bc3[_0x9d77('0x11')](0xc8)['json'](_0xa76d79);}};exports[_0x9d77('0xe')]=function(_0x3043,_0xdd367d){return git[_0x9d77('0xe')]([_0x9d77('0x12'),_0x9d77('0x13')],function(_0x4d9772){if(_0x4d9772){logger[_0x9d77('0x14')](_0x4d9772);return _0xdd367d['status'](0x1f4)[_0x9d77('0x15')](_0x4d9772);}logger[_0x9d77('0x16')](_0x9d77('0x17'));return _0xdd367d[_0x9d77('0x11')](0xc8)['json']({'output':_0x9d77('0x18')});});};exports[_0x9d77('0x19')]=function(_0xd8971c,_0x58a9f6){return git[_0x9d77('0x19')](['--hard',_0x9d77('0x1a')],function(_0x4a8487){if(_0x4a8487){logger[_0x9d77('0x14')](_0x4a8487);return _0x58a9f6['status'](0x1f4)['json'](_0x4a8487);}logger['info'](_0x9d77('0x1b'));return _0x58a9f6['status'](0xc8)[_0x9d77('0x15')]({'output':'git\x20reset\x20--hard'});});};exports[_0x9d77('0x1c')]=function(_0x1aa56d,_0x21add8){exec(_0x9d77('0x1d'),function(_0x5a1c70,_0x3d9a6a,_0x522e5c){logger[_0x9d77('0x16')](_0x3d9a6a);logger['info'](_0x522e5c);if(_0x5a1c70){logger['error'](_0x5a1c70);return _0x21add8[_0x9d77('0x11')](0x1f4)[_0x9d77('0x15')](_0x5a1c70);}return _0x21add8[_0x9d77('0x11')](0xc8)[_0x9d77('0x15')]({'output':_0x3d9a6a});});};exports[_0x9d77('0x1e')]=function(_0x5c2f84,_0x591bdc){return pm2['restart'](_0x9d77('0x1f'))[_0x9d77('0x20')](function(_0xd8acf6){logger[_0x9d77('0x16')](_0x9d77('0x21'),_0xd8acf6);return _0x591bdc['status'](0xc8)['json']({'output':_0x9d77('0x22')});})['catch'](function(_0x47aa20){logger[_0x9d77('0x14')](_0x47aa20);return _0x591bdc[_0x9d77('0x11')](0x1f4)[_0x9d77('0x15')](_0x47aa20);});};exports[_0x9d77('0x23')]=function(_0x2c963a,_0x5cf9c9){var _0x2cac5c=fs[_0x9d77('0x24')](path[_0x9d77('0x25')](config[_0x9d77('0x9')],_0x9d77('0x26'),'migrations'));var _0x5f0a08=[];for(var _0x361245=0x0;_0x361245<_0x2cac5c[_0x9d77('0x27')];_0x361245++){var _0x54d35f=_0x2cac5c[_0x361245]['replace'](_0x9d77('0x28'),'');if(compareVersions(module[_0x9d77('0xb')]['version'],_0x54d35f)===-0x1){_0x5f0a08[_0x9d77('0x29')](_0x54d35f);}}if(_0x5f0a08[_0x9d77('0x27')]){var _0x51dc0e=_0x5f0a08[_0x9d77('0x2a')](compareVersions);var _0x73b16e=new Umzug({'storage':_0x9d77('0x2b'),'storageOptions':{'model':db['Migration'],'modelName':_0x9d77('0x2c'),'columnName':_0x9d77('0x3')},'migrations':{'params':[db[_0x9d77('0x2b')][_0x9d77('0x2d')](),db[_0x9d77('0x2b')][_0x9d77('0x2e')],function(){throw new Error(_0x9d77('0x2f'));}],'path':path[_0x9d77('0x25')](config[_0x9d77('0x9')],_0x9d77('0x26'),_0x9d77('0x23')),'pattern':/\.js$/}});_0x73b16e['up']({'migrations':_[_0x9d77('0x30')](_0x51dc0e,function(_0x48cde2){return _0x48cde2+_0x9d77('0x28');})})[_0x9d77('0x20')](function(){return _0x5cf9c9[_0x9d77('0x11')](0xc8)[_0x9d77('0x15')]({'output':_0x9d77('0x31')+module['exports'][_0x9d77('0x3')]+_0x9d77('0x32')+_[_0x9d77('0x33')](_0x51dc0e),'migrations':_[_0x9d77('0x25')](_0x51dc0e)});})['catch'](function(_0x495973){if(_0x495973 instanceof db[_0x9d77('0x2b')][_0x9d77('0x34')]){return _0x5cf9c9[_0x9d77('0x11')](0xc8)['json']({'output':_0x9d77('0x35')});}else{return _0x5cf9c9[_0x9d77('0x11')](0x1f4)[_0x9d77('0x15')](_0x495973);}});}else{return _0x5cf9c9[_0x9d77('0x11')](0xc8)[_0x9d77('0x15')]({'output':_0x9d77('0x35')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 3c5d364..062f9c7 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 _0x3a50=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','index','/describe','isAuthenticated','describe','/:id','create','put','update','delete','exports','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3a50,0x138));var _0x03a5=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x3a50[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0x03a5('0x0'));var util=require(_0x03a5('0x1'));var path=require(_0x03a5('0x2'));var timeout=require(_0x03a5('0x3'));var express=require(_0x03a5('0x4'));var router=express[_0x03a5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x03a5('0x6'));var interaction=require(_0x03a5('0x7'));var config=require(_0x03a5('0x8'));var controller=require(_0x03a5('0x9'));router[_0x03a5('0xa')]('/',auth['isAuthenticated'](),controller[_0x03a5('0xb')]);router[_0x03a5('0xa')](_0x03a5('0xc'),auth[_0x03a5('0xd')](),controller[_0x03a5('0xe')]);router[_0x03a5('0xa')](_0x03a5('0xf'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x03a5('0x10')]);router[_0x03a5('0x11')]('/:id',auth[_0x03a5('0xd')](),controller[_0x03a5('0x12')]);router[_0x03a5('0x13')](_0x03a5('0xf'),auth[_0x03a5('0xd')](),controller['destroy']);module[_0x03a5('0x14')]=router; \ No newline at end of file +var _0xfdbc=['../../config/environment','./voiceAgentReport.controller','get','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','delete','destroy','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4ba8a5,_0x28cf9d){var _0x2ad234=function(_0x3194ea){while(--_0x3194ea){_0x4ba8a5['push'](_0x4ba8a5['shift']());}};_0x2ad234(++_0x28cf9d);}(_0xfdbc,0xb6));var _0xcfdb=function(_0x2a7f5b,_0xf94549){_0x2a7f5b=_0x2a7f5b-0x0;var _0x5e90e4=_0xfdbc[_0x2a7f5b];return _0x5e90e4;};'use strict';var multer=require(_0xcfdb('0x0'));var util=require('util');var path=require(_0xcfdb('0x1'));var timeout=require(_0xcfdb('0x2'));var express=require(_0xcfdb('0x3'));var router=express['Router']();var fs_extra=require(_0xcfdb('0x4'));var auth=require(_0xcfdb('0x5'));var interaction=require(_0xcfdb('0x6'));var config=require(_0xcfdb('0x7'));var controller=require(_0xcfdb('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xcfdb('0x9')](_0xcfdb('0xa'),auth[_0xcfdb('0xb')](),controller[_0xcfdb('0xc')]);router[_0xcfdb('0x9')]('/:id',auth[_0xcfdb('0xb')](),controller[_0xcfdb('0xd')]);router[_0xcfdb('0xe')]('/',auth['isAuthenticated'](),controller[_0xcfdb('0xf')]);router[_0xcfdb('0x10')](_0xcfdb('0x11'),auth['isAuthenticated'](),controller[_0xcfdb('0x12')]);router[_0xcfdb('0x13')](_0xcfdb('0x11'),auth[_0xcfdb('0xb')](),controller[_0xcfdb('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 11e57cd..602beea 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 _0x69d4=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x391c55,_0x168617){var _0xa434e0=function(_0x51fa5c){while(--_0x51fa5c){_0x391c55['push'](_0x391c55['shift']());}};_0xa434e0(++_0x168617);}(_0x69d4,0x83));var _0x469d=function(_0x310a1b,_0x4c9129){_0x310a1b=_0x310a1b-0x0;var _0xdea206=_0x69d4[_0x310a1b];return _0xdea206;};'use strict';var Sequelize=require(_0x469d('0x0'));module[_0x469d('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x469d('0x2')]},'calleridnum':{'type':Sequelize[_0x469d('0x2')]},'calleridname':{'type':Sequelize[_0x469d('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x469d('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x469d('0x3')]},'agentconnectAt':{'type':Sequelize[_0x469d('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x469d('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x469d('0x3')]},'agentdumpAt':{'type':Sequelize[_0x469d('0x3')]},'holdtime':{'type':Sequelize[_0x469d('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x469d('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x469d('0x4')]},'agentacw':{'type':Sequelize[_0x469d('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x469d('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x469d('0x4')]},'channelstatedesc':{'type':Sequelize[_0x469d('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x469d('0x2')]},'language':{'type':Sequelize[_0x469d('0x2')]},'accountcode':{'type':Sequelize[_0x469d('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x469d('0x2')]},'destchannelstate':{'type':Sequelize[_0x469d('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x469d('0x2')]},'destcalleridnum':{'type':Sequelize[_0x469d('0x2')]},'destcalleridname':{'type':Sequelize[_0x469d('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x469d('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x469d('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x469d('0x2')]},'destcontext':{'type':Sequelize[_0x469d('0x2')]},'destexten':{'type':Sequelize[_0x469d('0x2')]},'destpriority':{'type':Sequelize[_0x469d('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x469d('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x469d('0x2')]},'transfer':{'type':Sequelize[_0x469d('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x469d('0x6')},'transferexten':{'type':Sequelize[_0x469d('0x2')]},'transferuniqueid':{'type':Sequelize[_0x469d('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xe493=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x258028,_0x28e1a3){var _0x3dd217=function(_0x2de6de){while(--_0x2de6de){_0x258028['push'](_0x258028['shift']());}};_0x3dd217(++_0x28e1a3);}(_0xe493,0x7e));var _0x3e49=function(_0x14ab9a,_0x410ae6){_0x14ab9a=_0x14ab9a-0x0;var _0x2be6aa=_0xe493[_0x14ab9a];return _0x2be6aa;};'use strict';var Sequelize=require(_0x3e49('0x0'));module[_0x3e49('0x1')]={'type':{'type':Sequelize[_0x3e49('0x2')]},'uniqueid':{'type':Sequelize[_0x3e49('0x2')]},'calleridnum':{'type':Sequelize[_0x3e49('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x3e49('0x2')]},'interface':{'type':Sequelize[_0x3e49('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x3e49('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x3e49('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x3e49('0x3')]},'agentdumpAt':{'type':Sequelize[_0x3e49('0x3')]},'holdtime':{'type':Sequelize[_0x3e49('0x4')]},'agentcomplete':{'type':Sequelize[_0x3e49('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x3e49('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x3e49('0x4')]},'reason':{'type':Sequelize[_0x3e49('0x2')]},'lastevent':{'type':Sequelize[_0x3e49('0x2')]},'channel':{'type':Sequelize[_0x3e49('0x2')]},'channelstate':{'type':Sequelize[_0x3e49('0x4')]},'channelstatedesc':{'type':Sequelize[_0x3e49('0x2')]},'connectedlinenum':{'type':Sequelize[_0x3e49('0x2')]},'connectedlinename':{'type':Sequelize[_0x3e49('0x2')]},'language':{'type':Sequelize[_0x3e49('0x2')]},'accountcode':{'type':Sequelize[_0x3e49('0x2')]},'context':{'type':Sequelize[_0x3e49('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x3e49('0x2')]},'destchannel':{'type':Sequelize[_0x3e49('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x3e49('0x2')]},'destcalleridnum':{'type':Sequelize[_0x3e49('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x3e49('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x3e49('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x3e49('0x2')]},'destcontext':{'type':Sequelize[_0x3e49('0x2')]},'destexten':{'type':Sequelize[_0x3e49('0x2')]},'destpriority':{'type':Sequelize[_0x3e49('0x2')]},'destuniqueid':{'type':Sequelize[_0x3e49('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x3e49('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x3e49('0x2')]},'transfer':{'type':Sequelize[_0x3e49('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x3e49('0x2')],'comment':_0x3e49('0x6')},'transferexten':{'type':Sequelize[_0x3e49('0x2')]},'transferuniqueid':{'type':Sequelize[_0x3e49('0x2')]},'agententerreason':{'type':Sequelize[_0x3e49('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 832d60f..4675f9f 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(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'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 c1ea6c4..0eeeeb0 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 _0x39c7=['destuniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceAgentReport.attributes','define','uniqueid'];(function(_0x50ce6a,_0xcedfc){var _0x2d4d3e=function(_0x4492cf){while(--_0x4492cf){_0x50ce6a['push'](_0x50ce6a['shift']());}};_0x2d4d3e(++_0xcedfc);}(_0x39c7,0x85));var _0x739c=function(_0x56ccb9,_0x1873b1){_0x56ccb9=_0x56ccb9-0x0;var _0x476c22=_0x39c7[_0x56ccb9];return _0x476c22;};'use strict';var _=require('lodash');var util=require(_0x739c('0x0'));var logger=require(_0x739c('0x1'))(_0x739c('0x2'));var moment=require(_0x739c('0x3'));var BPromise=require(_0x739c('0x4'));var rp=require(_0x739c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x739c('0x6'));var config=require(_0x739c('0x7'));var attributes=require(_0x739c('0x8'));module['exports']=function(_0x4c5030,_0x1923d9){return _0x4c5030[_0x739c('0x9')]('VoiceAgentReport',attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x739c('0xa'),_0x739c('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe574=['../../config/environment','./voiceAgentReport.attributes','exports','report_agent','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5be9fc,_0x3df9af){var _0x329b92=function(_0x57e785){while(--_0x57e785){_0x5be9fc['push'](_0x5be9fc['shift']());}};_0x329b92(++_0x3df9af);}(_0xe574,0x100));var _0x4e57=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xe574[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x4e57('0x0'));var util=require('util');var logger=require(_0x4e57('0x1'))(_0x4e57('0x2'));var moment=require(_0x4e57('0x3'));var BPromise=require(_0x4e57('0x4'));var rp=require(_0x4e57('0x5'));var fs=require('fs');var path=require(_0x4e57('0x6'));var rimraf=require(_0x4e57('0x7'));var config=require(_0x4e57('0x8'));var attributes=require(_0x4e57('0x9'));module[_0x4e57('0xa')]=function(_0x436174,_0x2825a9){return _0x436174['define']('VoiceAgentReport',attributes,{'tableName':_0x4e57('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid','destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 0994b2c..32a4040 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 _0x2b36=['stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','create','body','options','CreateVoiceAgentReport','VoiceAgentReport','raw','attributes'];(function(_0x23ed08,_0x12b212){var _0x1d3f96=function(_0x50abb1){while(--_0x50abb1){_0x23ed08['push'](_0x23ed08['shift']());}};_0x1d3f96(++_0x12b212);}(_0x2b36,0x7d));var _0x62b3=function(_0x1e0beb,_0x37b5a7){_0x1e0beb=_0x1e0beb-0x0;var _0x488b38=_0x2b36[_0x1e0beb];return _0x488b38;};'use strict';var _=require(_0x62b3('0x0'));var util=require(_0x62b3('0x1'));var moment=require(_0x62b3('0x2'));var BPromise=require(_0x62b3('0x3'));var rs=require(_0x62b3('0x4'));var fs=require('fs');var Redis=require(_0x62b3('0x5'));var db=require(_0x62b3('0x6'))['db'];var utils=require(_0x62b3('0x7'));var logger=require(_0x62b3('0x8'))('rpc');var config=require(_0x62b3('0x9'));var jayson=require(_0x62b3('0xa'));var client=jayson[_0x62b3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12a7aa,_0xe6e322,_0x4f7052){return new BPromise(function(_0x1b32e,_0x2b9273){return client['request'](_0x12a7aa,_0x4f7052)[_0x62b3('0xc')](function(_0x28193d){logger[_0x62b3('0xd')](_0x62b3('0xe'),_0xe6e322,'request\x20sent');logger[_0x62b3('0xf')](_0x62b3('0x10'),_0xe6e322,_0x62b3('0x11'),JSON['stringify'](_0x28193d));if(_0x28193d[_0x62b3('0x12')]){if(_0x28193d[_0x62b3('0x12')][_0x62b3('0x13')]===0x1f4){logger[_0x62b3('0x12')](_0x62b3('0xe'),_0xe6e322,_0x28193d[_0x62b3('0x12')][_0x62b3('0x14')]);return _0x2b9273(_0x28193d['error'][_0x62b3('0x14')]);}logger[_0x62b3('0x12')]('VoiceAgentReport,\x20%s,\x20%s',_0xe6e322,_0x28193d[_0x62b3('0x12')]['message']);return _0x1b32e(_0x28193d[_0x62b3('0x12')]['message']);}else{logger[_0x62b3('0xd')](_0x62b3('0xe'),_0xe6e322,_0x62b3('0x11'));_0x1b32e(_0x28193d[_0x62b3('0x15')][_0x62b3('0x14')]);}})[_0x62b3('0x16')](function(_0x21f7bc){logger['error'](_0x62b3('0xe'),_0xe6e322,_0x21f7bc);_0x2b9273(_0x21f7bc);});});}exports['CreateVoiceAgentReport']=function(_0x5f0f76){var _0x1c7359=this;return new Promise(function(_0x227aa9,_0x4a9620){return db['VoiceAgentReport'][_0x62b3('0x17')](_0x5f0f76[_0x62b3('0x18')],{'raw':_0x5f0f76[_0x62b3('0x19')]?_0x5f0f76['options']['raw']===undefined?!![]:![]:!![]})[_0x62b3('0xc')](function(_0x48e92a){logger['info']('CreateVoiceAgentReport',_0x5f0f76);logger[_0x62b3('0xf')](_0x62b3('0x1a'),_0x5f0f76,JSON['stringify'](_0x48e92a));_0x227aa9(_0x48e92a);})['catch'](function(_0x3f244c){logger[_0x62b3('0x12')](_0x62b3('0x1a'),_0x3f244c[_0x62b3('0x14')],_0x5f0f76);_0x4a9620(_0x1c7359['error'](0x1f4,_0x3f244c[_0x62b3('0x14')]));});});};exports['UpdateVoiceAgentReport']=function(_0x3d48dc){var _0x133c9c=this;return new Promise(function(_0x181fc4,_0x4b784c){return db[_0x62b3('0x1b')]['update'](_0x3d48dc['body'],{'raw':_0x3d48dc[_0x62b3('0x19')]?_0x3d48dc[_0x62b3('0x19')][_0x62b3('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d48dc[_0x62b3('0x19')]?_0x3d48dc[_0x62b3('0x19')]['where']||null:null,'attributes':_0x3d48dc[_0x62b3('0x19')]?_0x3d48dc[_0x62b3('0x19')][_0x62b3('0x1d')]||null:null,'limit':_0x3d48dc[_0x62b3('0x19')]?_0x3d48dc[_0x62b3('0x19')]['limit']||null:null})[_0x62b3('0xc')](function(_0x4f9c9c){logger['info']('UpdateVoiceAgentReport',_0x3d48dc);logger[_0x62b3('0xf')]('UpdateVoiceAgentReport',_0x3d48dc,JSON[_0x62b3('0x1e')](_0x4f9c9c));_0x181fc4(_0x4f9c9c);})[_0x62b3('0x16')](function(_0x308ab8){logger['error']('UpdateVoiceAgentReport',_0x308ab8['message'],_0x3d48dc);_0x4b784c(_0x133c9c[_0x62b3('0x12')](0x1f4,_0x308ab8[_0x62b3('0x14')]));});});}; \ No newline at end of file +var _0xed02=['../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceAgentReport,\x20%s,\x20%s','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','update','where','limit','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3b55ce,_0x1e7727){var _0xe4d917=function(_0x5f3c4d){while(--_0x5f3c4d){_0x3b55ce['push'](_0x3b55ce['shift']());}};_0xe4d917(++_0x1e7727);}(_0xed02,0x1c8));var _0x2ed0=function(_0x221840,_0x2a5fb7){_0x221840=_0x221840-0x0;var _0x4706e3=_0xed02[_0x221840];return _0x4706e3;};'use strict';var _=require(_0x2ed0('0x0'));var util=require(_0x2ed0('0x1'));var moment=require(_0x2ed0('0x2'));var BPromise=require(_0x2ed0('0x3'));var rs=require(_0x2ed0('0x4'));var fs=require('fs');var Redis=require(_0x2ed0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2ed0('0x6'));var logger=require(_0x2ed0('0x7'))(_0x2ed0('0x8'));var config=require(_0x2ed0('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2ed0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c580c,_0x11c265,_0xa9425d){return new BPromise(function(_0x423e5f,_0x489892){return client[_0x2ed0('0xb')](_0x4c580c,_0xa9425d)[_0x2ed0('0xc')](function(_0xda8a42){logger[_0x2ed0('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x11c265,_0x2ed0('0xe'));logger[_0x2ed0('0xf')](_0x2ed0('0x10'),_0x11c265,'request\x20sent',JSON[_0x2ed0('0x11')](_0xda8a42));if(_0xda8a42['error']){if(_0xda8a42[_0x2ed0('0x12')][_0x2ed0('0x13')]===0x1f4){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x11c265,_0xda8a42[_0x2ed0('0x12')]['message']);return _0x489892(_0xda8a42['error'][_0x2ed0('0x14')]);}logger[_0x2ed0('0x12')](_0x2ed0('0x15'),_0x11c265,_0xda8a42['error'][_0x2ed0('0x14')]);return _0x423e5f(_0xda8a42[_0x2ed0('0x12')][_0x2ed0('0x14')]);}else{logger[_0x2ed0('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x11c265,_0x2ed0('0xe'));_0x423e5f(_0xda8a42['result']['message']);}})[_0x2ed0('0x16')](function(_0x2f241d){logger[_0x2ed0('0x12')](_0x2ed0('0x15'),_0x11c265,_0x2f241d);_0x489892(_0x2f241d);});});}exports[_0x2ed0('0x17')]=function(_0xa83f06){var _0x3d2f15=this;return new Promise(function(_0x3bae0e,_0x456470){return db[_0x2ed0('0x18')][_0x2ed0('0x19')](_0xa83f06[_0x2ed0('0x1a')],{'raw':_0xa83f06[_0x2ed0('0x1b')]?_0xa83f06[_0x2ed0('0x1b')][_0x2ed0('0x1c')]===undefined?!![]:![]:!![]})[_0x2ed0('0xc')](function(_0x54a638){logger[_0x2ed0('0xd')](_0x2ed0('0x17'),_0xa83f06);logger[_0x2ed0('0xf')]('CreateVoiceAgentReport',_0xa83f06,JSON[_0x2ed0('0x11')](_0x54a638));_0x3bae0e(_0x54a638);})[_0x2ed0('0x16')](function(_0x3986aa){logger[_0x2ed0('0x12')]('CreateVoiceAgentReport',_0x3986aa[_0x2ed0('0x14')],_0xa83f06);_0x456470(_0x3d2f15[_0x2ed0('0x12')](0x1f4,_0x3986aa[_0x2ed0('0x14')]));});});};exports[_0x2ed0('0x1d')]=function(_0x24f67c){var _0x216995=this;return new Promise(function(_0x32e500,_0x544b01){return db[_0x2ed0('0x18')][_0x2ed0('0x1e')](_0x24f67c['body'],{'raw':_0x24f67c[_0x2ed0('0x1b')]?_0x24f67c['options'][_0x2ed0('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24f67c[_0x2ed0('0x1b')]?_0x24f67c[_0x2ed0('0x1b')][_0x2ed0('0x1f')]||null:null,'attributes':_0x24f67c[_0x2ed0('0x1b')]?_0x24f67c[_0x2ed0('0x1b')]['attributes']||null:null,'limit':_0x24f67c['options']?_0x24f67c['options'][_0x2ed0('0x20')]||null:null})[_0x2ed0('0xc')](function(_0x1f8edd){logger[_0x2ed0('0xd')](_0x2ed0('0x1d'),_0x24f67c);logger[_0x2ed0('0xf')](_0x2ed0('0x1d'),_0x24f67c,JSON['stringify'](_0x1f8edd));_0x32e500(_0x1f8edd);})[_0x2ed0('0x16')](function(_0x1be6f6){logger[_0x2ed0('0x12')](_0x2ed0('0x1d'),_0x1be6f6[_0x2ed0('0x14')],_0x24f67c);_0x544b01(_0x216995[_0x2ed0('0x12')](0x1f4,_0x1be6f6[_0x2ed0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index a88a2b5..82a09e5 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 _0x4db2=['index','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','express','../../components/auth/service','./voiceCallReport.controller'];(function(_0x543242,_0xeac9fd){var _0x4c99b6=function(_0x47d087){while(--_0x47d087){_0x543242['push'](_0x543242['shift']());}};_0x4c99b6(++_0xeac9fd);}(_0x4db2,0xb3));var _0x24db=function(_0x57e18a,_0x199383){_0x57e18a=_0x57e18a-0x0;var _0x1181c7=_0x4db2[_0x57e18a];return _0x1181c7;};'use strict';var express=require(_0x24db('0x0'));var router=express['Router']();var auth=require(_0x24db('0x1'));var controller=require(_0x24db('0x2'));router['get']('/',auth['isAuthenticated'](),controller[_0x24db('0x3')]);router[_0x24db('0x4')]('/describe',auth[_0x24db('0x5')](),controller['describe']);router[_0x24db('0x4')](_0x24db('0x6'),auth[_0x24db('0x5')](),controller[_0x24db('0x7')]);router[_0x24db('0x8')]('/',auth[_0x24db('0x5')](),controller['create']);router[_0x24db('0x9')]('/:id',auth[_0x24db('0x5')](),controller[_0x24db('0xa')]);router[_0x24db('0x9')]('/with-retry/:id',auth['isAuthenticated'](),controller['updateWithRetry']);router[_0x24db('0xb')](_0x24db('0x6'),auth[_0x24db('0x5')](),controller[_0x24db('0xc')]);module[_0x24db('0xd')]=router; \ No newline at end of file +var _0xdbfe=['post','create','put','/:id','update','/with-retry/:id','updateWithRetry','delete','exports','express','Router','../../components/auth/service','./voiceCallReport.controller','get','isAuthenticated','/describe'];(function(_0xb43c8f,_0x1f6041){var _0x467ae5=function(_0x33b071){while(--_0x33b071){_0xb43c8f['push'](_0xb43c8f['shift']());}};_0x467ae5(++_0x1f6041);}(_0xdbfe,0x139));var _0xedbf=function(_0x22dba5,_0x524d1e){_0x22dba5=_0x22dba5-0x0;var _0x36e9a7=_0xdbfe[_0x22dba5];return _0x36e9a7;};'use strict';var express=require(_0xedbf('0x0'));var router=express[_0xedbf('0x1')]();var auth=require(_0xedbf('0x2'));var controller=require(_0xedbf('0x3'));router[_0xedbf('0x4')]('/',auth[_0xedbf('0x5')](),controller['index']);router[_0xedbf('0x4')](_0xedbf('0x6'),auth['isAuthenticated'](),controller['describe']);router[_0xedbf('0x4')]('/:id',auth[_0xedbf('0x5')](),controller['show']);router[_0xedbf('0x7')]('/',auth[_0xedbf('0x5')](),controller[_0xedbf('0x8')]);router[_0xedbf('0x9')](_0xedbf('0xa'),auth[_0xedbf('0x5')](),controller[_0xedbf('0xb')]);router['put'](_0xedbf('0xc'),auth[_0xedbf('0x5')](),controller[_0xedbf('0xd')]);router[_0xedbf('0xe')](_0xedbf('0xa'),auth[_0xedbf('0x5')](),controller['destroy']);module[_0xedbf('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index cdd4ee2..de6dd95 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 _0x5f76=['inbound','outbound','inbound-fax','outbound-fax','STRING','DATE','INTEGER','sequelize','ENUM'];(function(_0x1f41e8,_0x236f10){var _0x30fc4d=function(_0x5332fe){while(--_0x5332fe){_0x1f41e8['push'](_0x1f41e8['shift']());}};_0x30fc4d(++_0x236f10);}(_0x5f76,0x8e));var _0x65f7=function(_0x34bc6c,_0x10d089){_0x34bc6c=_0x34bc6c-0x0;var _0x168820=_0x5f76[_0x34bc6c];return _0x168820;};'use strict';var Sequelize=require(_0x65f7('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x65f7('0x1')](_0x65f7('0x2'),'internal',_0x65f7('0x3'),_0x65f7('0x4'),_0x65f7('0x5'),'dialer')},'tag':{'type':Sequelize[_0x65f7('0x6')]},'accountcode':{'type':Sequelize[_0x65f7('0x6')]},'source':{'type':Sequelize[_0x65f7('0x6')]},'destination':{'type':Sequelize[_0x65f7('0x6')]},'destinationcontext':{'type':Sequelize[_0x65f7('0x6')]},'callerid':{'type':Sequelize[_0x65f7('0x6')]},'channel':{'type':Sequelize[_0x65f7('0x6')]},'destinationchannel':{'type':Sequelize[_0x65f7('0x6')]},'lastapplication':{'type':Sequelize[_0x65f7('0x6')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x65f7('0x7')]},'systemanswertime':{'type':Sequelize[_0x65f7('0x7')]},'answertime':{'type':Sequelize[_0x65f7('0x7')]},'endtime':{'type':Sequelize[_0x65f7('0x7')]},'duration':{'type':Sequelize[_0x65f7('0x8')]},'billableseconds':{'type':Sequelize[_0x65f7('0x8')]},'mohtime':{'type':Sequelize[_0x65f7('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x65f7('0x6')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x65f7('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x65f7('0x6')]},'note':{'type':Sequelize[_0x65f7('0x6')]},'prefix':{'type':Sequelize[_0x65f7('0x6')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0x65f7('0x6')]}}; \ No newline at end of file +var _0x2b84=['ENUM','inbound','internal','inbound-fax','dialer','STRING','TEXT','DATE','INTEGER','sequelize','exports'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x2b84,0x1ed));var _0x42b8=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x2b84[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x42b8('0x0'));module[_0x42b8('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x42b8('0x2')](_0x42b8('0x3'),_0x42b8('0x4'),'outbound',_0x42b8('0x5'),'outbound-fax',_0x42b8('0x6'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x42b8('0x7')]},'source':{'type':Sequelize[_0x42b8('0x7')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x42b8('0x7')]},'channel':{'type':Sequelize[_0x42b8('0x7')]},'destinationchannel':{'type':Sequelize[_0x42b8('0x7')]},'lastapplication':{'type':Sequelize[_0x42b8('0x7')]},'lastdata':{'type':Sequelize[_0x42b8('0x8')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x42b8('0x9')]},'answertime':{'type':Sequelize[_0x42b8('0x9')]},'endtime':{'type':Sequelize[_0x42b8('0x9')]},'duration':{'type':Sequelize[_0x42b8('0xa')]},'billableseconds':{'type':Sequelize[_0x42b8('0xa')]},'mohtime':{'type':Sequelize[_0x42b8('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x42b8('0x7')]},'amaflags':{'type':Sequelize[_0x42b8('0x7')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x42b8('0x7')]},'userThirdDisposition':{'type':Sequelize[_0x42b8('0x7')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x42b8('0x7')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index ebfc114..e96afe2 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 _0xebd5=['model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','find','create','body','describe','uniqueid','updateWithRetry','No\x20such\x20report','lodash','../../components/parsers/qs','promise-retry','status','json','undefined','limit','count','offset','Content-Range','update','then','end','sendStatus','error','stack','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','type','key'];(function(_0x2812c2,_0x2b382d){var _0x218ac9=function(_0x2fe4c4){while(--_0x2fe4c4){_0x2812c2['push'](_0x2812c2['shift']());}};_0x218ac9(++_0x2b382d);}(_0xebd5,0xcf));var _0x5ebd=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xebd5[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x5ebd('0x0'));var qs=require(_0x5ebd('0x1'));var logger=require('../../config/logger')('api');var db=require('../../mysqldb')['db'];const promiseRetry=require(_0x5ebd('0x2'));function respondWithResult(_0x16c530,_0xf1a56d){_0xf1a56d=_0xf1a56d||0xc8;return function(_0xe1e48){if(_0xe1e48){return _0x16c530[_0x5ebd('0x3')](_0xf1a56d)[_0x5ebd('0x4')](_0xe1e48);}};}function respondWithFilteredResult(_0x1bfa42,_0x30e9d6){return function(_0x4afd45){if(_0x4afd45){var _0x317018=typeof _0x30e9d6['offset']===_0x5ebd('0x5')&&typeof _0x30e9d6[_0x5ebd('0x6')]===_0x5ebd('0x5');var _0x36d809=_0x4afd45[_0x5ebd('0x7')];var _0x4e6607=_0x317018?0x0:_0x30e9d6[_0x5ebd('0x8')];var _0x3c518a=_0x317018?_0x4afd45[_0x5ebd('0x7')]:_0x30e9d6[_0x5ebd('0x8')]+_0x30e9d6[_0x5ebd('0x6')];var _0x4085ca;if(_0x3c518a>=_0x36d809){_0x3c518a=_0x36d809;_0x4085ca=0xc8;}else{_0x4085ca=0xce;}_0x1bfa42[_0x5ebd('0x3')](_0x4085ca);return _0x1bfa42['set'](_0x5ebd('0x9'),_0x4e6607+'-'+_0x3c518a+'/'+_0x36d809)[_0x5ebd('0x4')](_0x4afd45);}return null;};}function saveUpdates(_0x31cb81){return function(_0x32ae36){if(_0x32ae36){return _0x32ae36[_0x5ebd('0xa')](_0x31cb81)[_0x5ebd('0xb')](function(_0x1ed8fe){return _0x1ed8fe;});}return null;};}function removeEntity(_0x28ed66){return function(_0x3d6415){if(_0x3d6415){return _0x3d6415['destroy']()[_0x5ebd('0xb')](function(){_0x28ed66['status'](0xcc)[_0x5ebd('0xc')]();});}};}function handleEntityNotFound(_0x15b354){return function(_0x30f279){if(!_0x30f279){_0x15b354[_0x5ebd('0xd')](0x194);}return _0x30f279;};}function handleError(_0x502c19,_0x265c56){_0x265c56=_0x265c56||0x1f4;return function(_0x57a741){logger[_0x5ebd('0xe')](_0x57a741[_0x5ebd('0xf')]);if(_0x57a741[_0x5ebd('0x10')]){delete _0x57a741[_0x5ebd('0x10')];}_0x502c19[_0x5ebd('0x3')](_0x265c56)[_0x5ebd('0x11')](_0x57a741);};}exports[_0x5ebd('0x12')]=function(_0xf1a342,_0x763a8a){var _0x30843e={},_0x3cb861={},_0x46dd88={'count':0x0,'rows':[]};var _0x37a7ce=_[_0x5ebd('0x13')](db[_0x5ebd('0x14')][_0x5ebd('0x15')],function(_0x12b223){return{'name':_0x12b223[_0x5ebd('0x16')],'type':_0x12b223[_0x5ebd('0x17')][_0x5ebd('0x18')]};});_0x3cb861[_0x5ebd('0x19')]=_['map'](_0x37a7ce,_0x5ebd('0x10'));_0x3cb861['query']=_[_0x5ebd('0x1a')](_0xf1a342[_0x5ebd('0x1b')]);_0x3cb861['filters']=_[_0x5ebd('0x1c')](_0x3cb861[_0x5ebd('0x19')],_0x3cb861[_0x5ebd('0x1b')]);_0x30843e['attributes']=_[_0x5ebd('0x1c')](_0x3cb861[_0x5ebd('0x19')],qs[_0x5ebd('0x1d')](_0xf1a342[_0x5ebd('0x1b')][_0x5ebd('0x1d')]));_0x30843e[_0x5ebd('0x1e')]=_0x30843e[_0x5ebd('0x1e')][_0x5ebd('0x1f')]?_0x30843e[_0x5ebd('0x1e')]:_0x3cb861[_0x5ebd('0x19')];if(!_0xf1a342[_0x5ebd('0x1b')][_0x5ebd('0x20')](_0x5ebd('0x21'))){_0x30843e[_0x5ebd('0x6')]=qs['limit'](_0xf1a342[_0x5ebd('0x1b')]['limit']);_0x30843e[_0x5ebd('0x8')]=qs[_0x5ebd('0x8')](_0xf1a342['query'][_0x5ebd('0x8')]);}_0x30843e['order']=qs['sort'](_0xf1a342[_0x5ebd('0x1b')]['sort']);_0x30843e[_0x5ebd('0x22')]=qs[_0x5ebd('0x23')](_[_0x5ebd('0x24')](_0xf1a342['query'],_0x3cb861[_0x5ebd('0x23')]),_0x37a7ce);if(_0xf1a342[_0x5ebd('0x1b')]['filter']){_0x30843e[_0x5ebd('0x22')]=_[_0x5ebd('0x25')](_0x30843e[_0x5ebd('0x22')],{'$or':_['map'](_0x37a7ce,function(_0x257916){if(_0x257916[_0x5ebd('0x17')]!==_0x5ebd('0x26')){var _0x57598e={};_0x57598e[_0x257916[_0x5ebd('0x10')]]={'$like':'%'+_0xf1a342['query'][_0x5ebd('0x27')]+'%'};return _0x57598e;}})});}_0x30843e=_['merge']({},_0x30843e,_0xf1a342[_0x5ebd('0x28')]);var _0x188530={'where':_0x30843e[_0x5ebd('0x22')]};return db['VoiceCallReport'][_0x5ebd('0x7')](_0x188530)['then'](function(_0x5f086f){_0x46dd88['count']=_0x5f086f;if(_0xf1a342[_0x5ebd('0x1b')][_0x5ebd('0x29')]){_0x30843e[_0x5ebd('0x2a')]=[{'attributes':['id',_0x5ebd('0x10'),_0x5ebd('0x2b'),_0x5ebd('0x2c')],'model':db[_0x5ebd('0x2d')],'as':_0x5ebd('0x2d')}];}return db['VoiceCallReport'][_0x5ebd('0x2e')](_0x30843e);})[_0x5ebd('0xb')](function(_0x458c5a){_0x46dd88[_0x5ebd('0x2f')]=_0x458c5a;return _0x46dd88;})['then'](respondWithFilteredResult(_0x763a8a,_0x30843e))[_0x5ebd('0x30')](handleError(_0x763a8a,null));};exports[_0x5ebd('0x31')]=function(_0x2fd878,_0x5ca9fc){var _0x18d82f={'raw':!![],'where':{'id':_0x2fd878[_0x5ebd('0x32')]['id']}},_0xf2626f={};_0xf2626f[_0x5ebd('0x19')]=_[_0x5ebd('0x1a')](db[_0x5ebd('0x14')][_0x5ebd('0x15')]);_0xf2626f['query']=_[_0x5ebd('0x1a')](_0x2fd878[_0x5ebd('0x1b')]);_0xf2626f[_0x5ebd('0x23')]=_[_0x5ebd('0x1c')](_0xf2626f[_0x5ebd('0x19')],_0xf2626f[_0x5ebd('0x1b')]);_0x18d82f[_0x5ebd('0x1e')]=_[_0x5ebd('0x1c')](_0xf2626f[_0x5ebd('0x19')],qs['fields'](_0x2fd878[_0x5ebd('0x1b')][_0x5ebd('0x1d')]));_0x18d82f[_0x5ebd('0x1e')]=_0x18d82f[_0x5ebd('0x1e')][_0x5ebd('0x1f')]?_0x18d82f['attributes']:_0xf2626f[_0x5ebd('0x19')];if(_0x2fd878['query']['includeAll']){_0x18d82f[_0x5ebd('0x2a')]=[{'all':!![]}];}_0x18d82f=_[_0x5ebd('0x25')]({},_0x18d82f,_0x2fd878[_0x5ebd('0x28')]);return db['VoiceCallReport'][_0x5ebd('0x33')](_0x18d82f)['then'](handleEntityNotFound(_0x5ca9fc,null))[_0x5ebd('0xb')](respondWithResult(_0x5ca9fc,null))[_0x5ebd('0x30')](handleError(_0x5ca9fc,null));};exports[_0x5ebd('0x34')]=function(_0x22bd5a,_0x1d627e){return db[_0x5ebd('0x14')][_0x5ebd('0x34')](_0x22bd5a[_0x5ebd('0x35')],{})['then'](respondWithResult(_0x1d627e,0xc9))['catch'](handleError(_0x1d627e,null));};exports['destroy']=function(_0xb1fa5c,_0x34fdc7){return db[_0x5ebd('0x14')]['find']({'where':{'id':_0xb1fa5c[_0x5ebd('0x32')]['id']}})[_0x5ebd('0xb')](handleEntityNotFound(_0x34fdc7,null))[_0x5ebd('0xb')](removeEntity(_0x34fdc7,null))[_0x5ebd('0x30')](handleError(_0x34fdc7,null));};exports[_0x5ebd('0x36')]=function(_0x5f3212,_0x5265fb){return db[_0x5ebd('0x14')][_0x5ebd('0x36')]()[_0x5ebd('0xb')](respondWithResult(_0x5265fb,null))[_0x5ebd('0x30')](handleError(_0x5265fb,null));};function findForUpdate(_0x529cae){return db[_0x5ebd('0x14')]['find']({'where':{'uniqueid':_0x529cae[_0x5ebd('0x32')]['id'],'UserId':{'$or':[null,_0x529cae['user']['id']]}}});}exports[_0x5ebd('0xa')]=function(_0x269664,_0x29bd44){if(_0x269664[_0x5ebd('0x35')][_0x5ebd('0x37')]){delete _0x269664['body']['uniqueid'];}return findForUpdate(_0x269664)[_0x5ebd('0xb')](handleEntityNotFound(_0x29bd44,null))[_0x5ebd('0xb')](saveUpdates(_0x269664[_0x5ebd('0x35')],null))['then'](respondWithResult(_0x29bd44,null))[_0x5ebd('0x30')](handleError(_0x29bd44,null));};exports[_0x5ebd('0x38')]=function(_0x431aab,_0x2162af){if(_0x431aab[_0x5ebd('0x35')]['uniqueid']){delete _0x431aab[_0x5ebd('0x35')][_0x5ebd('0x37')];}promiseRetry(function(_0x5571bd){return findForUpdate(_0x431aab)[_0x5ebd('0xb')](function(_0x187f40){if(_0x187f40!==null){return _0x187f40;}else{_0x5571bd(new Error(_0x5ebd('0x39')));}});},{'retries':0x4,'minTimeout':0xfa})[_0x5ebd('0xb')](function(_0x283017){return _0x283017[_0x5ebd('0xa')](_0x431aab['body'])[_0x5ebd('0xb')](function(_0x117e2c){return respondWithResult(_0x2162af)(_0x117e2c);});},handleEntityNotFound(_0x2162af));}; \ No newline at end of file +var _0xf555=['find','create','body','describe','user','uniqueid','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','promise-retry','status','json','offset','undefined','limit','count','set','Content-Range','update','then','end','sendStatus','error','stack','name','send','map','VoiceCallReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','merge','type','includeAll','include','fullname','User','findAll','rows','catch','show','params','keys','options'];(function(_0x44db60,_0x4ec8ca){var _0x3fa929=function(_0x5800a6){while(--_0x5800a6){_0x44db60['push'](_0x44db60['shift']());}};_0x3fa929(++_0x4ec8ca);}(_0xf555,0x1c6));var _0x5f55=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf555[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5f55('0x0'));var qs=require(_0x5f55('0x1'));var logger=require(_0x5f55('0x2'))(_0x5f55('0x3'));var db=require(_0x5f55('0x4'))['db'];const promiseRetry=require(_0x5f55('0x5'));function respondWithResult(_0x19c376,_0x46c094){_0x46c094=_0x46c094||0xc8;return function(_0x53e912){if(_0x53e912){return _0x19c376[_0x5f55('0x6')](_0x46c094)[_0x5f55('0x7')](_0x53e912);}};}function respondWithFilteredResult(_0x58dd7d,_0x378a40){return function(_0x5ddea9){if(_0x5ddea9){var _0x578f3f=typeof _0x378a40[_0x5f55('0x8')]===_0x5f55('0x9')&&typeof _0x378a40[_0x5f55('0xa')]===_0x5f55('0x9');var _0x5ab467=_0x5ddea9['count'];var _0x47882c=_0x578f3f?0x0:_0x378a40[_0x5f55('0x8')];var _0x333dce=_0x578f3f?_0x5ddea9[_0x5f55('0xb')]:_0x378a40[_0x5f55('0x8')]+_0x378a40[_0x5f55('0xa')];var _0x34e85a;if(_0x333dce>=_0x5ab467){_0x333dce=_0x5ab467;_0x34e85a=0xc8;}else{_0x34e85a=0xce;}_0x58dd7d[_0x5f55('0x6')](_0x34e85a);return _0x58dd7d[_0x5f55('0xc')](_0x5f55('0xd'),_0x47882c+'-'+_0x333dce+'/'+_0x5ab467)[_0x5f55('0x7')](_0x5ddea9);}return null;};}function saveUpdates(_0x471385){return function(_0x1276ad){if(_0x1276ad){return _0x1276ad[_0x5f55('0xe')](_0x471385)[_0x5f55('0xf')](function(_0x4e0d81){return _0x4e0d81;});}return null;};}function removeEntity(_0x29c193){return function(_0x52a26e){if(_0x52a26e){return _0x52a26e['destroy']()[_0x5f55('0xf')](function(){_0x29c193[_0x5f55('0x6')](0xcc)[_0x5f55('0x10')]();});}};}function handleEntityNotFound(_0x5b1335){return function(_0x5647e2){if(!_0x5647e2){_0x5b1335[_0x5f55('0x11')](0x194);}return _0x5647e2;};}function handleError(_0x4a538f,_0x5c205b){_0x5c205b=_0x5c205b||0x1f4;return function(_0x55f05c){logger[_0x5f55('0x12')](_0x55f05c[_0x5f55('0x13')]);if(_0x55f05c[_0x5f55('0x14')]){delete _0x55f05c['name'];}_0x4a538f[_0x5f55('0x6')](_0x5c205b)[_0x5f55('0x15')](_0x55f05c);};}exports['index']=function(_0x46528e,_0x51b38f){var _0x302383={},_0x42b1f9={},_0x2e2916={'count':0x0,'rows':[]};var _0x18eccd=_[_0x5f55('0x16')](db[_0x5f55('0x17')][_0x5f55('0x18')],function(_0x11562a){return{'name':_0x11562a['fieldName'],'type':_0x11562a['type'][_0x5f55('0x19')]};});_0x42b1f9[_0x5f55('0x1a')]=_['map'](_0x18eccd,'name');_0x42b1f9[_0x5f55('0x1b')]=_['keys'](_0x46528e[_0x5f55('0x1b')]);_0x42b1f9[_0x5f55('0x1c')]=_[_0x5f55('0x1d')](_0x42b1f9[_0x5f55('0x1a')],_0x42b1f9[_0x5f55('0x1b')]);_0x302383[_0x5f55('0x1e')]=_[_0x5f55('0x1d')](_0x42b1f9['model'],qs[_0x5f55('0x1f')](_0x46528e[_0x5f55('0x1b')][_0x5f55('0x1f')]));_0x302383[_0x5f55('0x1e')]=_0x302383['attributes'][_0x5f55('0x20')]?_0x302383[_0x5f55('0x1e')]:_0x42b1f9[_0x5f55('0x1a')];if(!_0x46528e['query'][_0x5f55('0x21')](_0x5f55('0x22'))){_0x302383[_0x5f55('0xa')]=qs['limit'](_0x46528e[_0x5f55('0x1b')][_0x5f55('0xa')]);_0x302383['offset']=qs[_0x5f55('0x8')](_0x46528e['query'][_0x5f55('0x8')]);}_0x302383[_0x5f55('0x23')]=qs['sort'](_0x46528e[_0x5f55('0x1b')]['sort']);_0x302383[_0x5f55('0x24')]=qs[_0x5f55('0x1c')](_['pick'](_0x46528e['query'],_0x42b1f9[_0x5f55('0x1c')]),_0x18eccd);if(_0x46528e['query']['filter']){_0x302383[_0x5f55('0x24')]=_[_0x5f55('0x25')](_0x302383[_0x5f55('0x24')],{'$or':_['map'](_0x18eccd,function(_0x1f0b5a){if(_0x1f0b5a[_0x5f55('0x26')]!=='VIRTUAL'){var _0x520d47={};_0x520d47[_0x1f0b5a['name']]={'$like':'%'+_0x46528e[_0x5f55('0x1b')]['filter']+'%'};return _0x520d47;}})});}_0x302383=_['merge']({},_0x302383,_0x46528e['options']);var _0x2bf8ab={'where':_0x302383[_0x5f55('0x24')]};return db['VoiceCallReport'][_0x5f55('0xb')](_0x2bf8ab)[_0x5f55('0xf')](function(_0x57d907){_0x2e2916[_0x5f55('0xb')]=_0x57d907;if(_0x46528e[_0x5f55('0x1b')][_0x5f55('0x27')]){_0x302383[_0x5f55('0x28')]=[{'attributes':['id',_0x5f55('0x14'),_0x5f55('0x29'),'alias'],'model':db[_0x5f55('0x2a')],'as':_0x5f55('0x2a')}];}return db['VoiceCallReport'][_0x5f55('0x2b')](_0x302383);})['then'](function(_0x548892){_0x2e2916[_0x5f55('0x2c')]=_0x548892;return _0x2e2916;})[_0x5f55('0xf')](respondWithFilteredResult(_0x51b38f,_0x302383))[_0x5f55('0x2d')](handleError(_0x51b38f,null));};exports[_0x5f55('0x2e')]=function(_0x549096,_0x51196f){var _0x5bef98={'raw':!![],'where':{'id':_0x549096[_0x5f55('0x2f')]['id']}},_0x3c1533={};_0x3c1533[_0x5f55('0x1a')]=_[_0x5f55('0x30')](db[_0x5f55('0x17')][_0x5f55('0x18')]);_0x3c1533[_0x5f55('0x1b')]=_[_0x5f55('0x30')](_0x549096[_0x5f55('0x1b')]);_0x3c1533['filters']=_[_0x5f55('0x1d')](_0x3c1533['model'],_0x3c1533[_0x5f55('0x1b')]);_0x5bef98[_0x5f55('0x1e')]=_[_0x5f55('0x1d')](_0x3c1533['model'],qs[_0x5f55('0x1f')](_0x549096[_0x5f55('0x1b')][_0x5f55('0x1f')]));_0x5bef98[_0x5f55('0x1e')]=_0x5bef98['attributes'][_0x5f55('0x20')]?_0x5bef98[_0x5f55('0x1e')]:_0x3c1533[_0x5f55('0x1a')];if(_0x549096[_0x5f55('0x1b')][_0x5f55('0x27')]){_0x5bef98[_0x5f55('0x28')]=[{'all':!![]}];}_0x5bef98=_['merge']({},_0x5bef98,_0x549096[_0x5f55('0x31')]);return db['VoiceCallReport'][_0x5f55('0x32')](_0x5bef98)['then'](handleEntityNotFound(_0x51196f,null))[_0x5f55('0xf')](respondWithResult(_0x51196f,null))[_0x5f55('0x2d')](handleError(_0x51196f,null));};exports[_0x5f55('0x33')]=function(_0x54fc89,_0xc47851){return db[_0x5f55('0x17')]['create'](_0x54fc89[_0x5f55('0x34')],{})[_0x5f55('0xf')](respondWithResult(_0xc47851,0xc9))[_0x5f55('0x2d')](handleError(_0xc47851,null));};exports['destroy']=function(_0x5f073f,_0x5bde7d){return db['VoiceCallReport'][_0x5f55('0x32')]({'where':{'id':_0x5f073f['params']['id']}})[_0x5f55('0xf')](handleEntityNotFound(_0x5bde7d,null))[_0x5f55('0xf')](removeEntity(_0x5bde7d,null))[_0x5f55('0x2d')](handleError(_0x5bde7d,null));};exports[_0x5f55('0x35')]=function(_0x31392c,_0x5aa2dc){return db[_0x5f55('0x17')][_0x5f55('0x35')]()[_0x5f55('0xf')](respondWithResult(_0x5aa2dc,null))[_0x5f55('0x2d')](handleError(_0x5aa2dc,null));};function findForUpdate(_0xec3fd2){return db['VoiceCallReport']['find']({'where':{'uniqueid':_0xec3fd2[_0x5f55('0x2f')]['id'],'UserId':{'$or':[null,_0xec3fd2[_0x5f55('0x36')]['id']]}}});}exports['update']=function(_0x30d460,_0x1d6870){if(_0x30d460[_0x5f55('0x34')][_0x5f55('0x37')]){delete _0x30d460[_0x5f55('0x34')]['uniqueid'];}return findForUpdate(_0x30d460)[_0x5f55('0xf')](handleEntityNotFound(_0x1d6870,null))[_0x5f55('0xf')](saveUpdates(_0x30d460[_0x5f55('0x34')],null))[_0x5f55('0xf')](respondWithResult(_0x1d6870,null))[_0x5f55('0x2d')](handleError(_0x1d6870,null));};exports['updateWithRetry']=function(_0x31b615,_0x1f057c){if(_0x31b615['body']['uniqueid']){delete _0x31b615['body'][_0x5f55('0x37')];}promiseRetry(function(_0x39bffb){return findForUpdate(_0x31b615)[_0x5f55('0xf')](function(_0x1ea130){if(_0x1ea130!==null){return _0x1ea130;}else{_0x39bffb(new Error('No\x20such\x20report'));}});},{'retries':0x4,'minTimeout':0xfa})[_0x5f55('0xf')](function(_0x406ae9){return _0x406ae9['update'](_0x31b615[_0x5f55('0x34')])['then'](function(_0x484f10){return respondWithResult(_0x1f057c)(_0x484f10);});},function(_0x1803c9){handleEntityNotFound(_0x1f057c)(_0x1803c9);})[_0x5f55('0x2d')](function(_0x2989de){handleEntityNotFound(_0x1f057c)(_0x2989de);});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 482bcab..a386ecb 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 _0x7ed7=['bluebird','request-promise','path','rimraf','exports','define','VoiceCallReport','report_call','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x19bf5f,_0x1ca6b9){var _0x237efa=function(_0x18f2a3){while(--_0x18f2a3){_0x19bf5f['push'](_0x19bf5f['shift']());}};_0x237efa(++_0x1ca6b9);}(_0x7ed7,0x98));var _0x77ed=function(_0x5891c,_0x26c3ab){_0x5891c=_0x5891c-0x0;var _0x82a0a7=_0x7ed7[_0x5891c];return _0x82a0a7;};'use strict';var _=require(_0x77ed('0x0'));var util=require('util');var logger=require(_0x77ed('0x1'))(_0x77ed('0x2'));var moment=require(_0x77ed('0x3'));var BPromise=require(_0x77ed('0x4'));var rp=require(_0x77ed('0x5'));var fs=require('fs');var path=require(_0x77ed('0x6'));var rimraf=require(_0x77ed('0x7'));var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module[_0x77ed('0x8')]=function(_0x3c42c5,_0x39d907){return _0x3c42c5[_0x77ed('0x9')](_0x77ed('0xa'),attributes,{'tableName':_0x77ed('0xb'),'paranoid':![],'indexes':[{'fields':[_0x77ed('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5826=['request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','../../config/logger','bluebird'];(function(_0x1ca767,_0x414f22){var _0x126bb6=function(_0x2e0816){while(--_0x2e0816){_0x1ca767['push'](_0x1ca767['shift']());}};_0x126bb6(++_0x414f22);}(_0x5826,0x1ea));var _0x6582=function(_0x10c9ab,_0x3fdb79){_0x10c9ab=_0x10c9ab-0x0;var _0x28af13=_0x5826[_0x10c9ab];return _0x28af13;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6582('0x0'))('api');var moment=require('moment');var BPromise=require(_0x6582('0x1'));var rp=require(_0x6582('0x2'));var fs=require('fs');var path=require(_0x6582('0x3'));var rimraf=require(_0x6582('0x4'));var config=require(_0x6582('0x5'));var attributes=require(_0x6582('0x6'));module[_0x6582('0x7')]=function(_0x401271,_0x3d0ce3){return _0x401271[_0x6582('0x8')](_0x6582('0x9'),attributes,{'tableName':_0x6582('0xa'),'paranoid':![],'indexes':[{'fields':[_0x6582('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index cb82281..ad367d0 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 _0x7e84=['CreateVoiceCallReport','UpdateVoiceCallReport','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VoiceCallReport','raw','options','where','attributes','include','map','model','GetVoiceCallReport','debug','create','body'];(function(_0x43c415,_0x348779){var _0x4c2c7a=function(_0x5df388){while(--_0x5df388){_0x43c415['push'](_0x43c415['shift']());}};_0x4c2c7a(++_0x348779);}(_0x7e84,0x72));var _0x47e8=function(_0x2f093e,_0x37bfd7){_0x2f093e=_0x2f093e-0x0;var _0x11f2d3=_0x7e84[_0x2f093e];return _0x11f2d3;};'use strict';var _=require(_0x47e8('0x0'));var util=require('util');var moment=require(_0x47e8('0x1'));var BPromise=require(_0x47e8('0x2'));var rs=require(_0x47e8('0x3'));var fs=require('fs');var Redis=require(_0x47e8('0x4'));var db=require(_0x47e8('0x5'))['db'];var utils=require(_0x47e8('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x47e8('0x7'));var client=jayson[_0x47e8('0x8')][_0x47e8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f939c,_0x3d4645,_0x2e2dfc){return new BPromise(function(_0x4e42a0,_0xeb40ea){return client[_0x47e8('0xa')](_0x3f939c,_0x2e2dfc)[_0x47e8('0xb')](function(_0x2996eb){logger[_0x47e8('0xc')](_0x47e8('0xd'),_0x3d4645,_0x47e8('0xe'));logger['debug'](_0x47e8('0xf'),_0x3d4645,_0x47e8('0xe'),JSON[_0x47e8('0x10')](_0x2996eb));if(_0x2996eb[_0x47e8('0x11')]){if(_0x2996eb[_0x47e8('0x11')][_0x47e8('0x12')]===0x1f4){logger[_0x47e8('0x11')](_0x47e8('0xd'),_0x3d4645,_0x2996eb[_0x47e8('0x11')][_0x47e8('0x13')]);return _0xeb40ea(_0x2996eb['error']['message']);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x3d4645,_0x2996eb[_0x47e8('0x11')][_0x47e8('0x13')]);return _0x4e42a0(_0x2996eb[_0x47e8('0x11')][_0x47e8('0x13')]);}else{logger[_0x47e8('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x3d4645,_0x47e8('0xe'));_0x4e42a0(_0x2996eb[_0x47e8('0x14')][_0x47e8('0x13')]);}})[_0x47e8('0x15')](function(_0x27fb8e){logger[_0x47e8('0x11')](_0x47e8('0xd'),_0x3d4645,_0x27fb8e);_0xeb40ea(_0x27fb8e);});});}exports['GetVoiceCallReport']=function(_0x30dee1){var _0x2c1519=this;return new Promise(function(_0x37d282,_0x53cdf9){return db[_0x47e8('0x16')]['findAll']({'raw':_0x30dee1['options']?_0x30dee1['options'][_0x47e8('0x17')]===undefined?!![]:![]:!![],'where':_0x30dee1[_0x47e8('0x18')]?_0x30dee1[_0x47e8('0x18')][_0x47e8('0x19')]||null:null,'attributes':_0x30dee1['options']?_0x30dee1[_0x47e8('0x18')][_0x47e8('0x1a')]||null:null,'limit':_0x30dee1[_0x47e8('0x18')]?_0x30dee1[_0x47e8('0x18')]['limit']||null:null,'include':_0x30dee1['options']?_0x30dee1[_0x47e8('0x18')][_0x47e8('0x1b')]?_[_0x47e8('0x1c')](_0x30dee1[_0x47e8('0x18')]['include'],function(_0x387b9a){return{'model':db[_0x387b9a[_0x47e8('0x1d')]],'as':_0x387b9a['as'],'attributes':_0x387b9a['attributes'],'include':_0x387b9a[_0x47e8('0x1b')]?_['map'](_0x387b9a[_0x47e8('0x1b')],function(_0x831dd6){return{'model':db[_0x831dd6[_0x47e8('0x1d')]],'as':_0x831dd6['as'],'attributes':_0x831dd6[_0x47e8('0x1a')],'include':_0x831dd6[_0x47e8('0x1b')]?_[_0x47e8('0x1c')](_0x831dd6['include'],function(_0x411ddd){return{'model':db[_0x411ddd['model']],'as':_0x411ddd['as'],'attributes':_0x411ddd['attributes']};}):[]};}):[]};}):[]:[]})[_0x47e8('0xb')](function(_0x2f7d27){logger['info'](_0x47e8('0x1e'),_0x30dee1);logger[_0x47e8('0x1f')](_0x47e8('0x1e'),_0x30dee1,JSON['stringify'](_0x2f7d27));_0x37d282(_0x2f7d27);})[_0x47e8('0x15')](function(_0x1d626a){logger[_0x47e8('0x11')](_0x47e8('0x1e'),_0x1d626a[_0x47e8('0x13')],_0x30dee1);_0x53cdf9(_0x2c1519[_0x47e8('0x11')](0x1f4,_0x1d626a[_0x47e8('0x13')]));});});};exports['CreateVoiceCallReport']=function(_0x116ed2){var _0x18d4d6=this;return new Promise(function(_0x4cac34,_0x3df8c7){return db[_0x47e8('0x16')][_0x47e8('0x20')](_0x116ed2[_0x47e8('0x21')],{'raw':_0x116ed2[_0x47e8('0x18')]?_0x116ed2[_0x47e8('0x18')][_0x47e8('0x17')]===undefined?!![]:![]:!![]})[_0x47e8('0xb')](function(_0x41502e){logger[_0x47e8('0xc')]('CreateVoiceCallReport',_0x116ed2);logger['debug'](_0x47e8('0x22'),_0x116ed2,JSON['stringify'](_0x41502e));_0x4cac34(_0x41502e);})[_0x47e8('0x15')](function(_0x3cae59){logger['error'](_0x47e8('0x22'),_0x3cae59[_0x47e8('0x13')],_0x116ed2);_0x3df8c7(_0x18d4d6[_0x47e8('0x11')](0x1f4,_0x3cae59[_0x47e8('0x13')]));});});};exports[_0x47e8('0x23')]=function(_0x1773be){var _0x599dc8=this;return new Promise(function(_0x31ccc8,_0x6b1e24){return db[_0x47e8('0x16')]['update'](_0x1773be['body'],{'raw':_0x1773be[_0x47e8('0x18')]?_0x1773be[_0x47e8('0x18')][_0x47e8('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1773be[_0x47e8('0x18')]?_0x1773be[_0x47e8('0x18')][_0x47e8('0x19')]||null:null,'attributes':_0x1773be[_0x47e8('0x18')]?_0x1773be['options'][_0x47e8('0x1a')]||null:null,'limit':_0x1773be[_0x47e8('0x18')]?_0x1773be[_0x47e8('0x18')][_0x47e8('0x24')]||null:null})[_0x47e8('0xb')](function(_0x3897e9){logger['info'](_0x47e8('0x23'),_0x1773be);logger[_0x47e8('0x1f')](_0x47e8('0x23'),_0x1773be,JSON[_0x47e8('0x10')](_0x3897e9));_0x31ccc8(_0x3897e9);})[_0x47e8('0x15')](function(_0x1f0366){logger['error'](_0x47e8('0x23'),_0x1f0366[_0x47e8('0x13')],_0x1773be);_0x6b1e24(_0x599dc8[_0x47e8('0x11')](0x1f4,_0x1f0366[_0x47e8('0x13')]));});});}; \ No newline at end of file +var _0x7759=['debug','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','then','stringify','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent'];(function(_0x38728a,_0x3079d9){var _0x23118a=function(_0x353a5d){while(--_0x353a5d){_0x38728a['push'](_0x38728a['shift']());}};_0x23118a(++_0x3079d9);}(_0x7759,0x102));var _0x9775=function(_0x113bac,_0x4355bc){_0x113bac=_0x113bac-0x0;var _0x582227=_0x7759[_0x113bac];return _0x582227;};'use strict';var _=require(_0x9775('0x0'));var util=require(_0x9775('0x1'));var moment=require(_0x9775('0x2'));var BPromise=require(_0x9775('0x3'));var rs=require(_0x9775('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9775('0x5'))['db'];var utils=require(_0x9775('0x6'));var logger=require(_0x9775('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9775('0x8'));var client=jayson[_0x9775('0x9')][_0x9775('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe27fe8,_0x21eb15,_0x5ae58a){return new BPromise(function(_0x151783,_0x299bc1){return client[_0x9775('0xb')](_0xe27fe8,_0x5ae58a)['then'](function(_0x11d96a){logger[_0x9775('0xc')](_0x9775('0xd'),_0x21eb15,_0x9775('0xe'));logger[_0x9775('0xf')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x21eb15,_0x9775('0xe'),JSON['stringify'](_0x11d96a));if(_0x11d96a['error']){if(_0x11d96a[_0x9775('0x10')][_0x9775('0x11')]===0x1f4){logger[_0x9775('0x10')](_0x9775('0xd'),_0x21eb15,_0x11d96a[_0x9775('0x10')][_0x9775('0x12')]);return _0x299bc1(_0x11d96a[_0x9775('0x10')]['message']);}logger[_0x9775('0x10')]('VoiceCallReport,\x20%s,\x20%s',_0x21eb15,_0x11d96a[_0x9775('0x10')]['message']);return _0x151783(_0x11d96a[_0x9775('0x10')]['message']);}else{logger['info'](_0x9775('0xd'),_0x21eb15,_0x9775('0xe'));_0x151783(_0x11d96a[_0x9775('0x13')][_0x9775('0x12')]);}})[_0x9775('0x14')](function(_0x25ceef){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x21eb15,_0x25ceef);_0x299bc1(_0x25ceef);});});}exports[_0x9775('0x15')]=function(_0x1684a8){var _0x500363=this;return new Promise(function(_0x2e599f,_0x1ad192){return db[_0x9775('0x16')][_0x9775('0x17')]({'raw':_0x1684a8[_0x9775('0x18')]?_0x1684a8[_0x9775('0x18')][_0x9775('0x19')]===undefined?!![]:![]:!![],'where':_0x1684a8[_0x9775('0x18')]?_0x1684a8[_0x9775('0x18')][_0x9775('0x1a')]||null:null,'attributes':_0x1684a8[_0x9775('0x18')]?_0x1684a8['options'][_0x9775('0x1b')]||null:null,'limit':_0x1684a8['options']?_0x1684a8[_0x9775('0x18')][_0x9775('0x1c')]||null:null,'include':_0x1684a8[_0x9775('0x18')]?_0x1684a8[_0x9775('0x18')][_0x9775('0x1d')]?_[_0x9775('0x1e')](_0x1684a8[_0x9775('0x18')][_0x9775('0x1d')],function(_0x28be98){return{'model':db[_0x28be98[_0x9775('0x1f')]],'as':_0x28be98['as'],'attributes':_0x28be98['attributes'],'include':_0x28be98[_0x9775('0x1d')]?_[_0x9775('0x1e')](_0x28be98[_0x9775('0x1d')],function(_0x36dcef){return{'model':db[_0x36dcef[_0x9775('0x1f')]],'as':_0x36dcef['as'],'attributes':_0x36dcef[_0x9775('0x1b')],'include':_0x36dcef[_0x9775('0x1d')]?_[_0x9775('0x1e')](_0x36dcef[_0x9775('0x1d')],function(_0x356551){return{'model':db[_0x356551[_0x9775('0x1f')]],'as':_0x356551['as'],'attributes':_0x356551[_0x9775('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9775('0x20')](function(_0x476b5){logger[_0x9775('0xc')](_0x9775('0x15'),_0x1684a8);logger[_0x9775('0xf')](_0x9775('0x15'),_0x1684a8,JSON[_0x9775('0x21')](_0x476b5));_0x2e599f(_0x476b5);})[_0x9775('0x14')](function(_0x20340a){logger[_0x9775('0x10')](_0x9775('0x15'),_0x20340a[_0x9775('0x12')],_0x1684a8);_0x1ad192(_0x500363[_0x9775('0x10')](0x1f4,_0x20340a[_0x9775('0x12')]));});});};exports[_0x9775('0x22')]=function(_0x64bbc3){var _0x4353ef=this;return new Promise(function(_0x2687e8,_0x5796a0){return db['VoiceCallReport'][_0x9775('0x23')](_0x64bbc3[_0x9775('0x24')],{'raw':_0x64bbc3[_0x9775('0x18')]?_0x64bbc3[_0x9775('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x9775('0x20')](function(_0x5c7e5c){logger['info']('CreateVoiceCallReport',_0x64bbc3);logger[_0x9775('0xf')](_0x9775('0x22'),_0x64bbc3,JSON[_0x9775('0x21')](_0x5c7e5c));_0x2687e8(_0x5c7e5c);})['catch'](function(_0x350f6b){logger['error'](_0x9775('0x22'),_0x350f6b['message'],_0x64bbc3);_0x5796a0(_0x4353ef[_0x9775('0x10')](0x1f4,_0x350f6b[_0x9775('0x12')]));});});};exports[_0x9775('0x25')]=function(_0x51e3e0){var _0x4fd47b=this;return new Promise(function(_0x255243,_0x4579ab){return db['VoiceCallReport'][_0x9775('0x26')](_0x51e3e0[_0x9775('0x24')],{'raw':_0x51e3e0[_0x9775('0x18')]?_0x51e3e0[_0x9775('0x18')][_0x9775('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51e3e0[_0x9775('0x18')]?_0x51e3e0[_0x9775('0x18')][_0x9775('0x1a')]||null:null,'attributes':_0x51e3e0[_0x9775('0x18')]?_0x51e3e0[_0x9775('0x18')]['attributes']||null:null,'limit':_0x51e3e0[_0x9775('0x18')]?_0x51e3e0[_0x9775('0x18')][_0x9775('0x1c')]||null:null})[_0x9775('0x20')](function(_0x3b8176){logger[_0x9775('0xc')]('UpdateVoiceCallReport',_0x51e3e0);logger[_0x9775('0xf')]('UpdateVoiceCallReport',_0x51e3e0,JSON[_0x9775('0x21')](_0x3b8176));_0x255243(_0x3b8176);})[_0x9775('0x14')](function(_0x43858){logger[_0x9775('0x10')]('UpdateVoiceCallReport',_0x43858[_0x9775('0x12')],_0x51e3e0);_0x4579ab(_0x4fd47b[_0x9775('0x10')](0x1f4,_0x43858[_0x9775('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 923ccac..9bf2cf1 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 _0xdfd5=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3eb64f,_0x3e8dda){var _0x587f3b=function(_0x5de43e){while(--_0x5de43e){_0x3eb64f['push'](_0x3eb64f['shift']());}};_0x587f3b(++_0x3e8dda);}(_0xdfd5,0x1b0));var _0x5dfd=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0xdfd5[_0x22f8ab];return _0x2a70e5;};'use strict';var multer=require(_0x5dfd('0x0'));var util=require(_0x5dfd('0x1'));var path=require(_0x5dfd('0x2'));var timeout=require(_0x5dfd('0x3'));var express=require(_0x5dfd('0x4'));var router=express[_0x5dfd('0x5')]();var fs_extra=require(_0x5dfd('0x6'));var auth=require(_0x5dfd('0x7'));var interaction=require(_0x5dfd('0x8'));var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router[_0x5dfd('0x9')]('/',auth[_0x5dfd('0xa')](),controller['index']);router['get'](_0x5dfd('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x5dfd('0xc')]('/',auth[_0x5dfd('0xa')](),controller[_0x5dfd('0xd')]);router[_0x5dfd('0xe')](_0x5dfd('0xb'),auth[_0x5dfd('0xa')](),controller[_0x5dfd('0xf')]);router[_0x5dfd('0x10')](_0x5dfd('0xb'),auth[_0x5dfd('0xa')](),controller[_0x5dfd('0x11')]);module[_0x5dfd('0x12')]=router; \ No newline at end of file +var _0xaf9a=['index','/:id','show','create','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./voiceChanSpy.controller','get','isAuthenticated'];(function(_0x146a85,_0x529b52){var _0x1b59bf=function(_0x4af0fd){while(--_0x4af0fd){_0x146a85['push'](_0x146a85['shift']());}};_0x1b59bf(++_0x529b52);}(_0xaf9a,0x16c));var _0xaaf9=function(_0x478996,_0x39d8af){_0x478996=_0x478996-0x0;var _0x8fcaea=_0xaf9a[_0x478996];return _0x8fcaea;};'use strict';var multer=require(_0xaaf9('0x0'));var util=require(_0xaaf9('0x1'));var path=require(_0xaaf9('0x2'));var timeout=require(_0xaaf9('0x3'));var express=require('express');var router=express[_0xaaf9('0x4')]();var fs_extra=require(_0xaaf9('0x5'));var auth=require(_0xaaf9('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xaaf9('0x7'));router[_0xaaf9('0x8')]('/',auth[_0xaaf9('0x9')](),controller[_0xaaf9('0xa')]);router[_0xaaf9('0x8')](_0xaaf9('0xb'),auth[_0xaaf9('0x9')](),controller[_0xaaf9('0xc')]);router['post']('/',auth[_0xaaf9('0x9')](),controller[_0xaaf9('0xd')]);router[_0xaaf9('0xe')](_0xaaf9('0xb'),auth[_0xaaf9('0x9')](),controller['update']);router[_0xaaf9('0xf')]('/:id',auth[_0xaaf9('0x9')](),controller[_0xaaf9('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 8b236a8..9b1ae24 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 _0xf2db=['exports','STRING','name','getDataValue','options','split','BOOLEAN','sequelize'];(function(_0x414d0a,_0x5be40e){var _0x42a6cc=function(_0x14b13a){while(--_0x14b13a){_0x414d0a['push'](_0x414d0a['shift']());}};_0x42a6cc(++_0x5be40e);}(_0xf2db,0x177));var _0xbf2d=function(_0x29bc57,_0x3b8e54){_0x29bc57=_0x29bc57-0x0;var _0x5a6c0b=_0xf2db[_0x29bc57];return _0x5a6c0b;};'use strict';var Sequelize=require(_0xbf2d('0x0'));module[_0xbf2d('0x1')]={'name':{'type':Sequelize[_0xbf2d('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0xbf2d('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0xbf2d('0x2')],'set':function(_0x325cc7){this['setDataValue']('options',_0x325cc7?_0x325cc7['join'](''):[]);},'get':function(){return this[_0xbf2d('0x4')](_0xbf2d('0x5'))?this[_0xbf2d('0x4')]('options')[_0xbf2d('0x6')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0xbf2d('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xbf2d('0x2')]},'description':{'type':Sequelize[_0xbf2d('0x2')]}}; \ No newline at end of file +var _0xd97d=['name','setDataValue','options','join','getDataValue','BOOLEAN','sequelize','exports','STRING'];(function(_0x36dee4,_0x657d33){var _0x37d1d6=function(_0x20288c){while(--_0x20288c){_0x36dee4['push'](_0x36dee4['shift']());}};_0x37d1d6(++_0x657d33);}(_0xd97d,0x19b));var _0xdd97=function(_0xbc4560,_0x4020b8){_0xbc4560=_0xbc4560-0x0;var _0x298cfb=_0xd97d[_0xbc4560];return _0x298cfb;};'use strict';var Sequelize=require(_0xdd97('0x0'));module[_0xdd97('0x1')]={'name':{'type':Sequelize[_0xdd97('0x2')]},'prefix':{'type':Sequelize[_0xdd97('0x2')],'unique':_0xdd97('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0xd5d3c5){this[_0xdd97('0x4')](_0xdd97('0x5'),_0xd5d3c5?_0xd5d3c5[_0xdd97('0x6')](''):[]);},'get':function(){return this[_0xdd97('0x7')]('options')?this[_0xdd97('0x7')](_0xdd97('0x5'))['split'](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xdd97('0x2')]},'record':{'type':Sequelize[_0xdd97('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xdd97('0x2')]},'description':{'type':Sequelize[_0xdd97('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 710b8b3..ac8ad60 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 _0x4522=['find','catch','create','role','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','ChanSpies','sendStatus','error','stack','name','VoiceChanSpy','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','filter','where','VIRTUAL','merge','include','rows','show','params','options'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x4522,0x1a0));var _0x2452=function(_0x3dc72d,_0x38ac48){_0x3dc72d=_0x3dc72d-0x0;var _0x19acea=_0x4522[_0x3dc72d];return _0x19acea;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2452('0x0'));var jsonpatch=require(_0x2452('0x1'));var rp=require(_0x2452('0x2'));var moment=require('moment');var BPromise=require(_0x2452('0x3'));var Mustache=require(_0x2452('0x4'));var util=require(_0x2452('0x5'));var path=require(_0x2452('0x6'));var sox=require(_0x2452('0x7'));var csv=require(_0x2452('0x8'));var ejs=require(_0x2452('0x9'));var fs=require('fs');var fs_extra=require(_0x2452('0xa'));var _=require(_0x2452('0xb'));var squel=require(_0x2452('0xc'));var crypto=require(_0x2452('0xd'));var jsforce=require(_0x2452('0xe'));var deskjs=require(_0x2452('0xf'));var toCsv=require(_0x2452('0x8'));var querystring=require(_0x2452('0x10'));var Papa=require(_0x2452('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2452('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2452('0x13'))(_0x2452('0x14'));var utils=require(_0x2452('0x15'));var config=require(_0x2452('0x16'));var licenseUtil=require(_0x2452('0x17'));var db=require(_0x2452('0x18'))['db'];function respondWithStatusCode(_0x2c1e0f,_0x2377b9){_0x2377b9=_0x2377b9||0xcc;return function(_0x4968e8){if(_0x4968e8){return _0x2c1e0f['sendStatus'](_0x2377b9);}return _0x2c1e0f['status'](_0x2377b9)[_0x2452('0x19')]();};}function respondWithResult(_0x4fafa0,_0x33e592){_0x33e592=_0x33e592||0xc8;return function(_0x506cd4){if(_0x506cd4){return _0x4fafa0[_0x2452('0x1a')](_0x33e592)[_0x2452('0x1b')](_0x506cd4);}};}function respondWithFilteredResult(_0x5d0438,_0x1dbadf){return function(_0x47930c){if(_0x47930c){var _0x3dd8cc=typeof _0x1dbadf[_0x2452('0x1c')]===_0x2452('0x1d')&&typeof _0x1dbadf[_0x2452('0x1e')]==='undefined';var _0x2108e4=_0x47930c[_0x2452('0x1f')];var _0x59d89a=_0x3dd8cc?0x0:_0x1dbadf['offset'];var _0x1bfb44=_0x3dd8cc?_0x47930c[_0x2452('0x1f')]:_0x1dbadf[_0x2452('0x1c')]+_0x1dbadf['limit'];var _0x914d2b;if(_0x1bfb44>=_0x2108e4){_0x1bfb44=_0x2108e4;_0x914d2b=0xc8;}else{_0x914d2b=0xce;}_0x5d0438[_0x2452('0x1a')](_0x914d2b);return _0x5d0438[_0x2452('0x20')](_0x2452('0x21'),_0x59d89a+'-'+_0x1bfb44+'/'+_0x2108e4)[_0x2452('0x1b')](_0x47930c);}return null;};}function patchUpdates(_0x1c70cb){return function(_0x3f48c2){try{jsonpatch[_0x2452('0x22')](_0x3f48c2,_0x1c70cb,!![]);}catch(_0x5e921d){return BPromise['reject'](_0x5e921d);}return _0x3f48c2[_0x2452('0x23')]();};}function saveUpdates(_0x32dfe7,_0x4bb3ff){return function(_0x17d0a0){if(_0x17d0a0){return _0x17d0a0[_0x2452('0x24')](_0x32dfe7)[_0x2452('0x25')](function(_0x617ba7){return _0x617ba7;});}return null;};}function removeEntity(_0x285281,_0x397f21){return function(_0x155caa){if(_0x155caa){return _0x155caa['destroy']()[_0x2452('0x25')](function(){var _0x27d049=_0x155caa[_0x2452('0x26')]({'plain':!![]});var _0x231410=_0x2452('0x27');return db['UserProfileResource']['destroy']({'where':{'type':_0x231410,'resourceId':_0x27d049['id']}})[_0x2452('0x25')](function(){return _0x155caa;});})[_0x2452('0x25')](function(){_0x285281[_0x2452('0x1a')](0xcc)[_0x2452('0x19')]();});}};}function handleEntityNotFound(_0x1aac19,_0x48b313){return function(_0x3fba00){if(!_0x3fba00){_0x1aac19[_0x2452('0x28')](0x194);}return _0x3fba00;};}function handleError(_0x5e9184,_0x4a25aa){_0x4a25aa=_0x4a25aa||0x1f4;return function(_0x332878){logger[_0x2452('0x29')](_0x332878[_0x2452('0x2a')]);if(_0x332878[_0x2452('0x2b')]){delete _0x332878[_0x2452('0x2b')];}_0x5e9184[_0x2452('0x1a')](_0x4a25aa)['send'](_0x332878);};}exports['index']=function(_0x46b611,_0x454e0a){var _0x130565={},_0x5c36aa={},_0x2fb2ae={'count':0x0,'rows':[]};var _0x586a20=_['map'](db[_0x2452('0x2c')][_0x2452('0x2d')],function(_0x37b5e6){return{'name':_0x37b5e6[_0x2452('0x2e')],'type':_0x37b5e6[_0x2452('0x2f')][_0x2452('0x30')]};});_0x5c36aa[_0x2452('0x31')]=_[_0x2452('0x32')](_0x586a20,_0x2452('0x2b'));_0x5c36aa[_0x2452('0x33')]=_[_0x2452('0x34')](_0x46b611[_0x2452('0x33')]);_0x5c36aa[_0x2452('0x35')]=_['intersection'](_0x5c36aa[_0x2452('0x31')],_0x5c36aa[_0x2452('0x33')]);_0x130565['attributes']=_[_0x2452('0x36')](_0x5c36aa['model'],qs[_0x2452('0x37')](_0x46b611[_0x2452('0x33')]['fields']));_0x130565[_0x2452('0x38')]=_0x130565[_0x2452('0x38')][_0x2452('0x39')]?_0x130565['attributes']:_0x5c36aa[_0x2452('0x31')];if(!_0x46b611[_0x2452('0x33')]['hasOwnProperty'](_0x2452('0x3a'))){_0x130565[_0x2452('0x1e')]=qs[_0x2452('0x1e')](_0x46b611[_0x2452('0x33')][_0x2452('0x1e')]);_0x130565['offset']=qs['offset'](_0x46b611['query'][_0x2452('0x1c')]);}_0x130565[_0x2452('0x3b')]=qs[_0x2452('0x3c')](_0x46b611[_0x2452('0x33')][_0x2452('0x3c')]);_0x130565['where']=qs[_0x2452('0x35')](_['pick'](_0x46b611['query'],_0x5c36aa[_0x2452('0x35')]),_0x586a20);if(_0x46b611['query'][_0x2452('0x3d')]){_0x130565[_0x2452('0x3e')]=_['merge'](_0x130565[_0x2452('0x3e')],{'$or':_[_0x2452('0x32')](_0x586a20,function(_0x28ca0f){if(_0x28ca0f[_0x2452('0x2f')]!==_0x2452('0x3f')){var _0x112849={};_0x112849[_0x28ca0f[_0x2452('0x2b')]]={'$like':'%'+_0x46b611[_0x2452('0x33')]['filter']+'%'};return _0x112849;}})});}_0x130565=_[_0x2452('0x40')]({},_0x130565,_0x46b611['options']);var _0xaea800={'where':_0x130565[_0x2452('0x3e')]};return db['VoiceChanSpy'][_0x2452('0x1f')](_0xaea800)[_0x2452('0x25')](function(_0xb4e3f5){_0x2fb2ae[_0x2452('0x1f')]=_0xb4e3f5;if(_0x46b611[_0x2452('0x33')]['includeAll']){_0x130565[_0x2452('0x41')]=[{'all':!![]}];}return db[_0x2452('0x2c')]['findAll'](_0x130565);})[_0x2452('0x25')](function(_0x449b89){_0x2fb2ae[_0x2452('0x42')]=_0x449b89;return _0x2fb2ae;})[_0x2452('0x25')](respondWithFilteredResult(_0x454e0a,_0x130565))['catch'](handleError(_0x454e0a,null));};exports[_0x2452('0x43')]=function(_0x304942,_0x1e0d1f){var _0x2da77c={'raw':![],'where':{'id':_0x304942[_0x2452('0x44')]['id']}},_0x40a413={};_0x40a413['model']=_[_0x2452('0x34')](db['VoiceChanSpy'][_0x2452('0x2d')]);_0x40a413[_0x2452('0x33')]=_['keys'](_0x304942['query']);_0x40a413['filters']=_['intersection'](_0x40a413[_0x2452('0x31')],_0x40a413['query']);_0x2da77c[_0x2452('0x38')]=_['intersection'](_0x40a413[_0x2452('0x31')],qs[_0x2452('0x37')](_0x304942['query']['fields']));_0x2da77c[_0x2452('0x38')]=_0x2da77c['attributes'][_0x2452('0x39')]?_0x2da77c[_0x2452('0x38')]:_0x40a413[_0x2452('0x31')];if(_0x304942[_0x2452('0x33')]['includeAll']){_0x2da77c['include']=[{'all':!![]}];}_0x2da77c=_[_0x2452('0x40')]({},_0x2da77c,_0x304942[_0x2452('0x45')]);return db[_0x2452('0x2c')][_0x2452('0x46')](_0x2da77c)[_0x2452('0x25')](handleEntityNotFound(_0x1e0d1f,null))['then'](respondWithResult(_0x1e0d1f,null))[_0x2452('0x47')](handleError(_0x1e0d1f,null));};exports['create']=function(_0x3634f7,_0x53fd05){return db[_0x2452('0x2c')][_0x2452('0x48')](_0x3634f7['body'],{})[_0x2452('0x25')](function(_0x49e542){var _0x252d09=_0x3634f7['user']['get']({'plain':!![]});if(!_0x252d09)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x252d09[_0x2452('0x49')]===_0x2452('0x4a')){var _0x36ebcb=_0x49e542['get']({'plain':!![]});var _0x454eca=_0x2452('0x27');return db[_0x2452('0x4b')][_0x2452('0x46')]({'where':{'name':_0x454eca,'userProfileId':_0x252d09[_0x2452('0x4c')]},'raw':!![]})['then'](function(_0x43507c){if(_0x43507c&&_0x43507c['autoAssociation']===0x0){return db[_0x2452('0x4d')][_0x2452('0x48')]({'name':_0x36ebcb[_0x2452('0x2b')],'resourceId':_0x36ebcb['id'],'type':_0x43507c[_0x2452('0x2b')],'sectionId':_0x43507c['id']},{})[_0x2452('0x25')](function(){return _0x49e542;});}else{return _0x49e542;}})[_0x2452('0x47')](function(_0x3a3a85){logger[_0x2452('0x29')](_0x2452('0x4e'),_0x3a3a85);throw _0x3a3a85;});}return _0x49e542;})['then'](respondWithResult(_0x53fd05,0xc9))[_0x2452('0x47')](handleError(_0x53fd05,null));};exports['update']=function(_0x2d9e86,_0x594845){if(_0x2d9e86[_0x2452('0x4f')]['id']){delete _0x2d9e86[_0x2452('0x4f')]['id'];}return db['VoiceChanSpy'][_0x2452('0x46')]({'where':{'id':_0x2d9e86[_0x2452('0x44')]['id']}})[_0x2452('0x25')](handleEntityNotFound(_0x594845,null))[_0x2452('0x25')](saveUpdates(_0x2d9e86[_0x2452('0x4f')],null))[_0x2452('0x25')](respondWithResult(_0x594845,null))[_0x2452('0x47')](handleError(_0x594845,null));};exports[_0x2452('0x50')]=function(_0x38fffc,_0x207df7){return db[_0x2452('0x2c')]['find']({'where':{'id':_0x38fffc[_0x2452('0x44')]['id']}})['then'](handleEntityNotFound(_0x207df7,null))[_0x2452('0x25')](removeEntity(_0x207df7,null))['catch'](handleError(_0x207df7,null));}; \ No newline at end of file +var _0x2e54=['apply','reject','save','then','get','ChanSpies','stack','name','send','index','map','rawAttributes','fieldName','type','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','VoiceChanSpy','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','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','destroy','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','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'];(function(_0x212bcd,_0x34cd84){var _0x200258=function(_0x425430){while(--_0x425430){_0x212bcd['push'](_0x212bcd['shift']());}};_0x200258(++_0x34cd84);}(_0x2e54,0x1dd));var _0x42e5=function(_0x511bce,_0x132a34){_0x511bce=_0x511bce-0x0;var _0x24ccc8=_0x2e54[_0x511bce];return _0x24ccc8;};'use strict';var emlformat=require(_0x42e5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x42e5('0x1'));var rp=require(_0x42e5('0x2'));var moment=require(_0x42e5('0x3'));var BPromise=require(_0x42e5('0x4'));var Mustache=require(_0x42e5('0x5'));var util=require(_0x42e5('0x6'));var path=require(_0x42e5('0x7'));var sox=require('sox');var csv=require(_0x42e5('0x8'));var ejs=require(_0x42e5('0x9'));var fs=require('fs');var fs_extra=require(_0x42e5('0xa'));var _=require('lodash');var squel=require(_0x42e5('0xb'));var crypto=require('crypto');var jsforce=require(_0x42e5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x42e5('0x8'));var querystring=require(_0x42e5('0xd'));var Papa=require(_0x42e5('0xe'));var Redis=require(_0x42e5('0xf'));var authService=require(_0x42e5('0x10'));var qs=require(_0x42e5('0x11'));var as=require(_0x42e5('0x12'));var hardwareService=require(_0x42e5('0x13'));var logger=require(_0x42e5('0x14'))('api');var utils=require(_0x42e5('0x15'));var config=require(_0x42e5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x42e5('0x17'))['db'];function respondWithStatusCode(_0x12385d,_0x4530ba){_0x4530ba=_0x4530ba||0xcc;return function(_0x41598d){if(_0x41598d){return _0x12385d[_0x42e5('0x18')](_0x4530ba);}return _0x12385d[_0x42e5('0x19')](_0x4530ba)[_0x42e5('0x1a')]();};}function respondWithResult(_0x96fae2,_0x447648){_0x447648=_0x447648||0xc8;return function(_0x23957f){if(_0x23957f){return _0x96fae2['status'](_0x447648)[_0x42e5('0x1b')](_0x23957f);}};}function respondWithFilteredResult(_0x1d8e52,_0x4034bd){return function(_0x388300){if(_0x388300){var _0x2f4999=typeof _0x4034bd[_0x42e5('0x1c')]===_0x42e5('0x1d')&&typeof _0x4034bd[_0x42e5('0x1e')]===_0x42e5('0x1d');var _0x3c7b79=_0x388300[_0x42e5('0x1f')];var _0x38282d=_0x2f4999?0x0:_0x4034bd[_0x42e5('0x1c')];var _0x23fe09=_0x2f4999?_0x388300['count']:_0x4034bd[_0x42e5('0x1c')]+_0x4034bd['limit'];var _0x5f4428;if(_0x23fe09>=_0x3c7b79){_0x23fe09=_0x3c7b79;_0x5f4428=0xc8;}else{_0x5f4428=0xce;}_0x1d8e52[_0x42e5('0x19')](_0x5f4428);return _0x1d8e52[_0x42e5('0x20')]('Content-Range',_0x38282d+'-'+_0x23fe09+'/'+_0x3c7b79)[_0x42e5('0x1b')](_0x388300);}return null;};}function patchUpdates(_0x39a3e2){return function(_0x1c2169){try{jsonpatch[_0x42e5('0x21')](_0x1c2169,_0x39a3e2,!![]);}catch(_0x1150f4){return BPromise[_0x42e5('0x22')](_0x1150f4);}return _0x1c2169[_0x42e5('0x23')]();};}function saveUpdates(_0x58eee5,_0x4da508){return function(_0x283d44){if(_0x283d44){return _0x283d44['update'](_0x58eee5)[_0x42e5('0x24')](function(_0x2e9574){return _0x2e9574;});}return null;};}function removeEntity(_0x37d10e,_0x49490f){return function(_0x32380f){if(_0x32380f){return _0x32380f['destroy']()[_0x42e5('0x24')](function(){var _0xf29221=_0x32380f[_0x42e5('0x25')]({'plain':!![]});var _0x275c80=_0x42e5('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x275c80,'resourceId':_0xf29221['id']}})[_0x42e5('0x24')](function(){return _0x32380f;});})['then'](function(){_0x37d10e['status'](0xcc)[_0x42e5('0x1a')]();});}};}function handleEntityNotFound(_0x5b1727,_0x392c6b){return function(_0x2d9e65){if(!_0x2d9e65){_0x5b1727[_0x42e5('0x18')](0x194);}return _0x2d9e65;};}function handleError(_0x1c8ee4,_0x27ae27){_0x27ae27=_0x27ae27||0x1f4;return function(_0x2f1edc){logger['error'](_0x2f1edc[_0x42e5('0x27')]);if(_0x2f1edc[_0x42e5('0x28')]){delete _0x2f1edc[_0x42e5('0x28')];}_0x1c8ee4[_0x42e5('0x19')](_0x27ae27)[_0x42e5('0x29')](_0x2f1edc);};}exports[_0x42e5('0x2a')]=function(_0x383e97,_0x282cbf){var _0x5a4930={},_0x2ba9ef={},_0x2c7542={'count':0x0,'rows':[]};var _0x3d9e8b=_[_0x42e5('0x2b')](db['VoiceChanSpy'][_0x42e5('0x2c')],function(_0xf5a3dc){return{'name':_0xf5a3dc[_0x42e5('0x2d')],'type':_0xf5a3dc[_0x42e5('0x2e')]['key']};});_0x2ba9ef['model']=_[_0x42e5('0x2b')](_0x3d9e8b,'name');_0x2ba9ef[_0x42e5('0x2f')]=_['keys'](_0x383e97[_0x42e5('0x2f')]);_0x2ba9ef[_0x42e5('0x30')]=_[_0x42e5('0x31')](_0x2ba9ef['model'],_0x2ba9ef[_0x42e5('0x2f')]);_0x5a4930[_0x42e5('0x32')]=_['intersection'](_0x2ba9ef[_0x42e5('0x33')],qs['fields'](_0x383e97[_0x42e5('0x2f')][_0x42e5('0x34')]));_0x5a4930[_0x42e5('0x32')]=_0x5a4930[_0x42e5('0x32')][_0x42e5('0x35')]?_0x5a4930[_0x42e5('0x32')]:_0x2ba9ef[_0x42e5('0x33')];if(!_0x383e97['query']['hasOwnProperty'](_0x42e5('0x36'))){_0x5a4930[_0x42e5('0x1e')]=qs[_0x42e5('0x1e')](_0x383e97['query']['limit']);_0x5a4930['offset']=qs['offset'](_0x383e97[_0x42e5('0x2f')][_0x42e5('0x1c')]);}_0x5a4930[_0x42e5('0x37')]=qs[_0x42e5('0x38')](_0x383e97[_0x42e5('0x2f')][_0x42e5('0x38')]);_0x5a4930[_0x42e5('0x39')]=qs[_0x42e5('0x30')](_['pick'](_0x383e97[_0x42e5('0x2f')],_0x2ba9ef['filters']),_0x3d9e8b);if(_0x383e97[_0x42e5('0x2f')][_0x42e5('0x3a')]){_0x5a4930[_0x42e5('0x39')]=_[_0x42e5('0x3b')](_0x5a4930[_0x42e5('0x39')],{'$or':_[_0x42e5('0x2b')](_0x3d9e8b,function(_0xd5e7f5){if(_0xd5e7f5['type']!==_0x42e5('0x3c')){var _0x356ff6={};_0x356ff6[_0xd5e7f5['name']]={'$like':'%'+_0x383e97[_0x42e5('0x2f')]['filter']+'%'};return _0x356ff6;}})});}_0x5a4930=_['merge']({},_0x5a4930,_0x383e97['options']);var _0x1105ea={'where':_0x5a4930[_0x42e5('0x39')]};return db[_0x42e5('0x3d')][_0x42e5('0x1f')](_0x1105ea)[_0x42e5('0x24')](function(_0x77aa22){_0x2c7542[_0x42e5('0x1f')]=_0x77aa22;if(_0x383e97['query'][_0x42e5('0x3e')]){_0x5a4930[_0x42e5('0x3f')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x42e5('0x40')](_0x5a4930);})[_0x42e5('0x24')](function(_0x5db771){_0x2c7542[_0x42e5('0x41')]=_0x5db771;return _0x2c7542;})[_0x42e5('0x24')](respondWithFilteredResult(_0x282cbf,_0x5a4930))[_0x42e5('0x42')](handleError(_0x282cbf,null));};exports[_0x42e5('0x43')]=function(_0x424304,_0x4d32f4){var _0x41e1fd={'raw':![],'where':{'id':_0x424304[_0x42e5('0x44')]['id']}},_0xc34e51={};_0xc34e51[_0x42e5('0x33')]=_['keys'](db[_0x42e5('0x3d')][_0x42e5('0x2c')]);_0xc34e51[_0x42e5('0x2f')]=_[_0x42e5('0x45')](_0x424304[_0x42e5('0x2f')]);_0xc34e51[_0x42e5('0x30')]=_[_0x42e5('0x31')](_0xc34e51[_0x42e5('0x33')],_0xc34e51['query']);_0x41e1fd[_0x42e5('0x32')]=_['intersection'](_0xc34e51['model'],qs[_0x42e5('0x34')](_0x424304[_0x42e5('0x2f')][_0x42e5('0x34')]));_0x41e1fd[_0x42e5('0x32')]=_0x41e1fd[_0x42e5('0x32')][_0x42e5('0x35')]?_0x41e1fd[_0x42e5('0x32')]:_0xc34e51['model'];if(_0x424304[_0x42e5('0x2f')][_0x42e5('0x3e')]){_0x41e1fd[_0x42e5('0x3f')]=[{'all':!![]}];}_0x41e1fd=_[_0x42e5('0x3b')]({},_0x41e1fd,_0x424304[_0x42e5('0x46')]);return db[_0x42e5('0x3d')][_0x42e5('0x47')](_0x41e1fd)[_0x42e5('0x24')](handleEntityNotFound(_0x4d32f4,null))['then'](respondWithResult(_0x4d32f4,null))[_0x42e5('0x42')](handleError(_0x4d32f4,null));};exports[_0x42e5('0x48')]=function(_0x3616f4,_0x48757e){return db[_0x42e5('0x3d')][_0x42e5('0x48')](_0x3616f4[_0x42e5('0x49')],{})[_0x42e5('0x24')](function(_0x2586b0){var _0x528ddd=_0x3616f4[_0x42e5('0x4a')]['get']({'plain':!![]});if(!_0x528ddd)throw new Error(_0x42e5('0x4b'));if(_0x528ddd[_0x42e5('0x4c')]===_0x42e5('0x4a')){var _0x48b63b=_0x2586b0['get']({'plain':!![]});var _0x4f0639=_0x42e5('0x26');return db[_0x42e5('0x4d')][_0x42e5('0x47')]({'where':{'name':_0x4f0639,'userProfileId':_0x528ddd[_0x42e5('0x4e')]},'raw':!![]})['then'](function(_0x3ae9de){if(_0x3ae9de&&_0x3ae9de[_0x42e5('0x4f')]===0x0){return db[_0x42e5('0x50')]['create']({'name':_0x48b63b[_0x42e5('0x28')],'resourceId':_0x48b63b['id'],'type':_0x3ae9de['name'],'sectionId':_0x3ae9de['id']},{})[_0x42e5('0x24')](function(){return _0x2586b0;});}else{return _0x2586b0;}})[_0x42e5('0x42')](function(_0x53e29b){logger[_0x42e5('0x51')](_0x42e5('0x52'),_0x53e29b);throw _0x53e29b;});}return _0x2586b0;})[_0x42e5('0x24')](respondWithResult(_0x48757e,0xc9))[_0x42e5('0x42')](handleError(_0x48757e,null));};exports[_0x42e5('0x53')]=function(_0x3f043f,_0x41c1dc){if(_0x3f043f[_0x42e5('0x49')]['id']){delete _0x3f043f[_0x42e5('0x49')]['id'];}return db[_0x42e5('0x3d')]['find']({'where':{'id':_0x3f043f[_0x42e5('0x44')]['id']}})[_0x42e5('0x24')](handleEntityNotFound(_0x41c1dc,null))[_0x42e5('0x24')](saveUpdates(_0x3f043f[_0x42e5('0x49')],null))[_0x42e5('0x24')](respondWithResult(_0x41c1dc,null))['catch'](handleError(_0x41c1dc,null));};exports[_0x42e5('0x54')]=function(_0x2b226f,_0x40b633){return db[_0x42e5('0x3d')]['find']({'where':{'id':_0x2b226f['params']['id']}})['then'](handleEntityNotFound(_0x40b633,null))[_0x42e5('0x24')](removeEntity(_0x40b633,null))[_0x42e5('0x42')](handleError(_0x40b633,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 9bf6481..d948020 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 _0xb29f=['VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','prefix','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','concat','internal','User','findAll','agent','then','catch','exports','models','define','VoiceChanSpy','length'];(function(_0x5b7662,_0x2a89f1){var _0x4ddd51=function(_0x431b74){while(--_0x431b74){_0x5b7662['push'](_0x5b7662['shift']());}};_0x4ddd51(++_0x2a89f1);}(_0xb29f,0x13b));var _0xfb29=function(_0x38e878,_0x1a7022){_0x38e878=_0x38e878-0x0;var _0x3b2f73=_0xb29f[_0x38e878];return _0x3b2f73;};'use strict';var _=require(_0xfb29('0x0'));var util=require(_0xfb29('0x1'));var BPromise=require(_0xfb29('0x2'));var attributes=require(_0xfb29('0x3'));var getUserApplications=function(_0x5f5c82,_0x52dbfa,_0x212deb){var _0x36c480=0x1;var _0x5eaad4=[];var _0x874223={'context':_0x52dbfa[_0xfb29('0x4')]||_0xfb29('0x5'),'exten':util[_0xfb29('0x6')]('%s%s',_0x5f5c82[_0xfb29('0x7')],_0x212deb),'type':'system','isApp':![],'ChanSpyId':_0x5f5c82['id'],'UserId':_0x52dbfa['id']};_0x5eaad4[_0xfb29('0x8')](_[_0xfb29('0x9')]({'app':_0xfb29('0xa'),'appdata':util[_0xfb29('0x6')](_0xfb29('0xb'),_0xfb29('0xc')),'priority':_0x36c480++},_0x874223));if(_0x5f5c82[_0xfb29('0xd')]){_0x5eaad4['push'](_['merge']({'app':_0xfb29('0xe'),'appdata':util[_0xfb29('0x6')](_0xfb29('0xf'),_0x5f5c82[_0xfb29('0x10')]),'priority':_0x36c480++},_0x874223));}if(_0x5f5c82['auth']){_0x5eaad4[_0xfb29('0x8')](_[_0xfb29('0x9')]({'app':_0xfb29('0x11'),'appdata':_0x5f5c82[_0xfb29('0x12')],'priority':_0x36c480++},_0x874223));}_0x5eaad4[_0xfb29('0x8')](_[_0xfb29('0x9')]({'app':_0xfb29('0x13'),'appdata':util['format'](_0xfb29('0x14'),_0x52dbfa[_0xfb29('0x15')],_0x5f5c82[_0xfb29('0x16')]?_0x5f5c82[_0xfb29('0x16')][_0xfb29('0x17')](''):''),'priority':_0x36c480++},_0x874223));if(_0x5f5c82[_0xfb29('0xd')]){_0x5eaad4[_0xfb29('0x8')](_[_0xfb29('0x9')]({'app':'StopMixMonitor','priority':_0x36c480++},_0x874223));}return _0x5eaad4;};var getChanSpyApplications=function(_0x32e231,_0x215306){var _0x1dfc8c=[];for(var _0x18634d=0x0,_0xbe0d34=0x1;_0x18634d<_0x215306['length'];_0x18634d++,_0xbe0d34=0x1){_0x1dfc8c=_0x1dfc8c[_0xfb29('0x18')](getUserApplications(_0x32e231,_0x215306[_0x18634d],_0x215306[_0x18634d][_0xfb29('0x19')]));if(_0x215306[_0x18634d][_0xfb29('0x19')]!=_0x215306[_0x18634d][_0xfb29('0x15')]){_0x1dfc8c=_0x1dfc8c['concat'](getUserApplications(_0x32e231,_0x215306[_0x18634d],_0x215306[_0x18634d][_0xfb29('0x15')]));}}return _0x1dfc8c;};var getChanSpyPromise=function(_0xa042fd,_0x585c0a){return new BPromise(function(_0x1a76d3,_0x384b7f){return _0xa042fd[_0xfb29('0x1a')][_0xfb29('0x1b')]({'attributes':['id',_0xfb29('0x15'),_0xfb29('0x19')],'where':{'role':_0xfb29('0x1c'),'chanspy':!![]},'raw':!![]})[_0xfb29('0x1d')](function(_0x2754b2){if(_0x2754b2){return _0x1a76d3(getChanSpyApplications(_0x585c0a,_0x2754b2));}return _0x1a76d3([]);})[_0xfb29('0x1e')](function(_0x8f8ac1){_0x384b7f(_0x8f8ac1);});});};module[_0xfb29('0x1f')]=function(_0x3bc702,_0x37e88b){var _0x4fa3ea=_0x3bc702[_0xfb29('0x20')];return _0x3bc702[_0xfb29('0x21')](_0xfb29('0x22'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x445623,_0x8c20c3,_0x409f08){return getChanSpyPromise(_0x4fa3ea,_0x445623)['then'](function(_0x3eaa3a){if(_0x3eaa3a&&_0x3eaa3a[_0xfb29('0x23')]){return _0x4fa3ea[_0xfb29('0x24')][_0xfb29('0x25')](_0x3eaa3a);}})[_0xfb29('0x1d')](function(){_0x409f08();})['catch'](function(_0x472b0f){_0x409f08(_0x472b0f);});},'afterUpdate':function(_0x302c97,_0x28db61,_0x4aa85f){return _0x4fa3ea['VoiceExtension'][_0xfb29('0x26')]({'where':{'ChanSpyId':_0x302c97['id']}})['then'](function(){return getChanSpyPromise(_0x4fa3ea,_0x302c97);})[_0xfb29('0x1d')](function(_0x4abbbf){if(_0x4abbbf&&_0x4abbbf['length']){return _0x4fa3ea['VoiceExtension'][_0xfb29('0x25')](_0x4abbbf);}})[_0xfb29('0x1d')](function(){_0x4aa85f();})['catch'](function(_0x169571){_0x4aa85f(_0x169571);});},'afterDestroy':function(_0x545219,_0x296d80,_0x38ec15){return _0x4fa3ea[_0xfb29('0x24')][_0xfb29('0x26')]({'where':{'ChanSpyId':_0x545219['id']}})['then'](function(){_0x38ec15();})['catch'](function(_0x1ca438){_0x38ec15(_0x1ca438);});}}});}; \ No newline at end of file +var _0x82d7=['then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','CDR(type)=%s','chanspy','record','push','merge','MixMonitor','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','User','findAll','internal','agent'];(function(_0x3b0345,_0x2326ca){var _0x3dd452=function(_0x5e84ac){while(--_0x5e84ac){_0x3b0345['push'](_0x3b0345['shift']());}};_0x3dd452(++_0x2326ca);}(_0x82d7,0xd2));var _0x782d=function(_0x12c8f7,_0x38edf6){_0x12c8f7=_0x12c8f7-0x0;var _0x43c77a=_0x82d7[_0x12c8f7];return _0x43c77a;};'use strict';var _=require(_0x782d('0x0'));var util=require(_0x782d('0x1'));var BPromise=require(_0x782d('0x2'));var attributes=require(_0x782d('0x3'));var getUserApplications=function(_0x536b12,_0x22fa8d,_0x44cb0c){var _0x2dfff5=0x1;var _0x1f285b=[];var _0xb22e84={'context':_0x22fa8d[_0x782d('0x4')]||_0x782d('0x5'),'exten':util[_0x782d('0x6')](_0x782d('0x7'),_0x536b12['prefix'],_0x44cb0c),'type':'system','isApp':![],'ChanSpyId':_0x536b12['id'],'UserId':_0x22fa8d['id']};_0x1f285b['push'](_['merge']({'app':'Set','appdata':util['format'](_0x782d('0x8'),_0x782d('0x9')),'priority':_0x2dfff5++},_0xb22e84));if(_0x536b12[_0x782d('0xa')]){_0x1f285b[_0x782d('0xb')](_[_0x782d('0xc')]({'app':_0x782d('0xd'),'appdata':util[_0x782d('0x6')]('${UNIQUEID}.%s,a',_0x536b12[_0x782d('0xe')]),'priority':_0x2dfff5++},_0xb22e84));}if(_0x536b12[_0x782d('0xf')]){_0x1f285b[_0x782d('0xb')](_[_0x782d('0xc')]({'app':_0x782d('0x10'),'appdata':_0x536b12[_0x782d('0x11')],'priority':_0x2dfff5++},_0xb22e84));}_0x1f285b[_0x782d('0xb')](_[_0x782d('0xc')]({'app':_0x782d('0x12'),'appdata':util['format'](_0x782d('0x13'),_0x22fa8d[_0x782d('0x14')],_0x536b12[_0x782d('0x15')]?_0x536b12[_0x782d('0x15')][_0x782d('0x16')](''):''),'priority':_0x2dfff5++},_0xb22e84));if(_0x536b12[_0x782d('0xa')]){_0x1f285b['push'](_['merge']({'app':_0x782d('0x17'),'priority':_0x2dfff5++},_0xb22e84));}return _0x1f285b;};var getChanSpyApplications=function(_0x51136f,_0x1dfb13){var _0x58fd3c=[];for(var _0xef1c97=0x0,_0x109b4b=0x1;_0xef1c97<_0x1dfb13[_0x782d('0x18')];_0xef1c97++,_0x109b4b=0x1){_0x58fd3c=_0x58fd3c[_0x782d('0x19')](getUserApplications(_0x51136f,_0x1dfb13[_0xef1c97],_0x1dfb13[_0xef1c97]['internal']));if(_0x1dfb13[_0xef1c97]['internal']!=_0x1dfb13[_0xef1c97][_0x782d('0x14')]){_0x58fd3c=_0x58fd3c[_0x782d('0x19')](getUserApplications(_0x51136f,_0x1dfb13[_0xef1c97],_0x1dfb13[_0xef1c97][_0x782d('0x14')]));}}return _0x58fd3c;};var getChanSpyPromise=function(_0x1be6dc,_0x204e49){return new BPromise(function(_0x4fb845,_0x2b60d7){return _0x1be6dc[_0x782d('0x1a')][_0x782d('0x1b')]({'attributes':['id',_0x782d('0x14'),_0x782d('0x1c')],'where':{'role':_0x782d('0x1d'),'chanspy':!![]},'raw':!![]})[_0x782d('0x1e')](function(_0x511ecf){if(_0x511ecf){return _0x4fb845(getChanSpyApplications(_0x204e49,_0x511ecf));}return _0x4fb845([]);})[_0x782d('0x1f')](function(_0x5e19b6){_0x2b60d7(_0x5e19b6);});});};module[_0x782d('0x20')]=function(_0x501196,_0x8e7c96){var _0x4e0af6=_0x501196[_0x782d('0x21')];return _0x501196[_0x782d('0x22')](_0x782d('0x23'),attributes,{'tableName':_0x782d('0x24'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3d448e,_0x5f3410,_0x32da9b){return getChanSpyPromise(_0x4e0af6,_0x3d448e)[_0x782d('0x1e')](function(_0x5dbe91){if(_0x5dbe91&&_0x5dbe91[_0x782d('0x18')]){return _0x4e0af6[_0x782d('0x25')][_0x782d('0x26')](_0x5dbe91);}})[_0x782d('0x1e')](function(){_0x32da9b();})[_0x782d('0x1f')](function(_0x645a87){_0x32da9b(_0x645a87);});},'afterUpdate':function(_0x1f97c7,_0x54dcd8,_0x3f29fe){return _0x4e0af6[_0x782d('0x25')][_0x782d('0x27')]({'where':{'ChanSpyId':_0x1f97c7['id']}})[_0x782d('0x1e')](function(){return getChanSpyPromise(_0x4e0af6,_0x1f97c7);})[_0x782d('0x1e')](function(_0x597310){if(_0x597310&&_0x597310[_0x782d('0x18')]){return _0x4e0af6[_0x782d('0x25')][_0x782d('0x26')](_0x597310);}})[_0x782d('0x1e')](function(){_0x3f29fe();})[_0x782d('0x1f')](function(_0x17305b){_0x3f29fe(_0x17305b);});},'afterDestroy':function(_0x484500,_0x1984cf,_0x1a7013){return _0x4e0af6[_0x782d('0x25')]['destroy']({'where':{'ChanSpyId':_0x484500['id']}})['then'](function(){_0x1a7013();})[_0x782d('0x1f')](function(_0x1b14a7){_0x1a7013(_0x1b14a7);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index b080a14..6682504 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 _0x26c2=['message','info','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x58a975,_0x4f7451){var _0x47f055=function(_0x4f57e1){while(--_0x4f57e1){_0x58a975['push'](_0x58a975['shift']());}};_0x47f055(++_0x4f7451);}(_0x26c2,0x130));var _0x226c=function(_0x4d8381,_0x4dc51e){_0x4d8381=_0x4d8381-0x0;var _0x1df68f=_0x26c2[_0x4d8381];return _0x1df68f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x226c('0x0'));var rs=require(_0x226c('0x1'));var fs=require('fs');var Redis=require(_0x226c('0x2'));var db=require(_0x226c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x226c('0x4'))(_0x226c('0x5'));var config=require('../../config/environment');var jayson=require(_0x226c('0x6'));var client=jayson[_0x226c('0x7')][_0x226c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c4e5d,_0x4306c9,_0x59804e){return new BPromise(function(_0x34cbc3,_0x461773){return client[_0x226c('0x9')](_0x3c4e5d,_0x59804e)[_0x226c('0xa')](function(_0x127f10){logger['info'](_0x226c('0xb'),_0x4306c9,_0x226c('0xc'));logger['debug']('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x4306c9,_0x226c('0xc'),JSON[_0x226c('0xd')](_0x127f10));if(_0x127f10[_0x226c('0xe')]){if(_0x127f10[_0x226c('0xe')][_0x226c('0xf')]===0x1f4){logger[_0x226c('0xe')](_0x226c('0xb'),_0x4306c9,_0x127f10['error']['message']);return _0x461773(_0x127f10[_0x226c('0xe')][_0x226c('0x10')]);}logger[_0x226c('0xe')](_0x226c('0xb'),_0x4306c9,_0x127f10['error']['message']);return _0x34cbc3(_0x127f10[_0x226c('0xe')][_0x226c('0x10')]);}else{logger[_0x226c('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x4306c9,'request\x20sent');_0x34cbc3(_0x127f10[_0x226c('0x12')][_0x226c('0x10')]);}})[_0x226c('0x13')](function(_0x45a804){logger[_0x226c('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x4306c9,_0x45a804);_0x461773(_0x45a804);});});} \ No newline at end of file +var _0x1752=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','error','message','result','catch','util','moment','bluebird'];(function(_0x5a4f61,_0x1306a1){var _0x2b444e=function(_0x5f05dd){while(--_0x5f05dd){_0x5a4f61['push'](_0x5a4f61['shift']());}};_0x2b444e(++_0x1306a1);}(_0x1752,0xa5));var _0x2175=function(_0x52ece4,_0x42b575){_0x52ece4=_0x52ece4-0x0;var _0x371c2a=_0x1752[_0x52ece4];return _0x371c2a;};'use strict';var _=require('lodash');var util=require(_0x2175('0x0'));var moment=require(_0x2175('0x1'));var BPromise=require(_0x2175('0x2'));var rs=require(_0x2175('0x3'));var fs=require('fs');var Redis=require(_0x2175('0x4'));var db=require(_0x2175('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2175('0x6'))(_0x2175('0x7'));var config=require(_0x2175('0x8'));var jayson=require(_0x2175('0x9'));var client=jayson[_0x2175('0xa')][_0x2175('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19ca87,_0x1bd937,_0x339e4d){return new BPromise(function(_0x672ff1,_0x516ccc){return client[_0x2175('0xc')](_0x19ca87,_0x339e4d)[_0x2175('0xd')](function(_0x407a71){logger[_0x2175('0xe')](_0x2175('0xf'),_0x1bd937,'request\x20sent');logger['debug']('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x1bd937,_0x2175('0x10'),JSON['stringify'](_0x407a71));if(_0x407a71['error']){if(_0x407a71['error']['code']===0x1f4){logger[_0x2175('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x1bd937,_0x407a71[_0x2175('0x11')][_0x2175('0x12')]);return _0x516ccc(_0x407a71['error'][_0x2175('0x12')]);}logger[_0x2175('0x11')](_0x2175('0xf'),_0x1bd937,_0x407a71[_0x2175('0x11')][_0x2175('0x12')]);return _0x672ff1(_0x407a71[_0x2175('0x11')][_0x2175('0x12')]);}else{logger[_0x2175('0xe')]('VoiceChanSpy,\x20%s,\x20%s',_0x1bd937,'request\x20sent');_0x672ff1(_0x407a71[_0x2175('0x13')][_0x2175('0x12')]);}})[_0x2175('0x14')](function(_0x4e7cf1){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x1bd937,_0x4e7cf1);_0x516ccc(_0x4e7cf1);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index ed48fc8..1a21b05 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 _0x0e07=['create','update','delete','destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','/:id','show','post'];(function(_0x4e79c5,_0x25a3e1){var _0x414e63=function(_0x1f53b7){while(--_0x1f53b7){_0x4e79c5['push'](_0x4e79c5['shift']());}};_0x414e63(++_0x25a3e1);}(_0x0e07,0xe2));var _0x70e0=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x0e07[_0x160c73];return _0xd9302;};'use strict';var multer=require('multer');var util=require(_0x70e0('0x0'));var path=require(_0x70e0('0x1'));var timeout=require('connect-timeout');var express=require(_0x70e0('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x70e0('0x3'));var interaction=require(_0x70e0('0x4'));var config=require(_0x70e0('0x5'));var controller=require(_0x70e0('0x6'));router[_0x70e0('0x7')]('/',auth[_0x70e0('0x8')](),controller['index']);router[_0x70e0('0x7')](_0x70e0('0x9'),auth[_0x70e0('0x8')](),controller[_0x70e0('0xa')]);router[_0x70e0('0xb')]('/',auth['isAuthenticated'](),controller[_0x70e0('0xc')]);router['put'](_0x70e0('0x9'),auth[_0x70e0('0x8')](),controller[_0x70e0('0xd')]);router[_0x70e0('0xe')]('/:id',auth[_0x70e0('0x8')](),controller[_0x70e0('0xf')]);module[_0x70e0('0x10')]=router; \ No newline at end of file +var _0xafce=['../../components/interaction/service','../../config/environment','./voiceContext.controller','index','show','post','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x5c665b,_0x31c162){var _0x560cc4=function(_0x5c395f){while(--_0x5c395f){_0x5c665b['push'](_0x5c665b['shift']());}};_0x560cc4(++_0x31c162);}(_0xafce,0x116));var _0xeafc=function(_0x5db2e9,_0x421aaa){_0x5db2e9=_0x5db2e9-0x0;var _0x69a52f=_0xafce[_0x5db2e9];return _0x69a52f;};'use strict';var multer=require(_0xeafc('0x0'));var util=require(_0xeafc('0x1'));var path=require(_0xeafc('0x2'));var timeout=require(_0xeafc('0x3'));var express=require(_0xeafc('0x4'));var router=express[_0xeafc('0x5')]();var fs_extra=require(_0xeafc('0x6'));var auth=require(_0xeafc('0x7'));var interaction=require(_0xeafc('0x8'));var config=require(_0xeafc('0x9'));var controller=require(_0xeafc('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0xeafc('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xeafc('0xc')]);router[_0xeafc('0xd')]('/',auth[_0xeafc('0xe')](),controller[_0xeafc('0xf')]);router[_0xeafc('0x10')](_0xeafc('0x11'),auth[_0xeafc('0xe')](),controller[_0xeafc('0x12')]);router[_0xeafc('0x13')](_0xeafc('0x11'),auth['isAuthenticated'](),controller[_0xeafc('0x14')]);module[_0xeafc('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index e8f8294..d764636 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 _0xa8a7=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x352451,_0x3fa5e0){var _0x5ca2c9=function(_0x218434){while(--_0x218434){_0x352451['push'](_0x352451['shift']());}};_0x5ca2c9(++_0x3fa5e0);}(_0xa8a7,0xdc));var _0x7a8a=function(_0x4bdbc,_0x9238b8){_0x4bdbc=_0x4bdbc-0x0;var _0x3f94a3=_0xa8a7[_0x4bdbc];return _0x3f94a3;};'use strict';var Sequelize=require(_0x7a8a('0x0'));module[_0x7a8a('0x1')]={'name':{'type':Sequelize[_0x7a8a('0x2')],'unique':_0x7a8a('0x3')},'description':{'type':Sequelize[_0x7a8a('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x7a8a('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xac3b=['sequelize','exports','STRING','name'];(function(_0x2e9989,_0x1ec8f5){var _0x2a8e33=function(_0x3c1fbe){while(--_0x3c1fbe){_0x2e9989['push'](_0x2e9989['shift']());}};_0x2a8e33(++_0x1ec8f5);}(_0xac3b,0x70));var _0xbac3=function(_0x581bc7,_0x2ce3c5){_0x581bc7=_0x581bc7-0x0;var _0x2d951d=_0xac3b[_0x581bc7];return _0x2d951d;};'use strict';var Sequelize=require(_0xbac3('0x0'));module[_0xbac3('0x1')]={'name':{'type':Sequelize[_0xbac3('0x2')],'unique':_0xbac3('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 715d316..1749018 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 _0x1fb0=['apply','reject','save','update','then','destroy','UserProfileResource','stack','name','send','map','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','VoiceContext','includeAll','include','findAll','rows','find','create','body','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','Contexts','userProfileId','autoAssociation','params','readFileSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','info','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','error','VoiceContext,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x6f2530,_0x1e05bb){var _0xc1292e=function(_0x24b4fd){while(--_0x24b4fd){_0x6f2530['push'](_0x6f2530['shift']());}};_0xc1292e(++_0x1e05bb);}(_0x1fb0,0xa2));var _0x01fb=function(_0x187c30,_0x238119){_0x187c30=_0x187c30-0x0;var _0x391824=_0x1fb0[_0x187c30];return _0x391824;};'use strict';var emlformat=require(_0x01fb('0x0'));var rimraf=require(_0x01fb('0x1'));var zipdir=require(_0x01fb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x01fb('0x3'));var moment=require(_0x01fb('0x4'));var BPromise=require(_0x01fb('0x5'));var Mustache=require(_0x01fb('0x6'));var util=require(_0x01fb('0x7'));var path=require(_0x01fb('0x8'));var sox=require(_0x01fb('0x9'));var csv=require(_0x01fb('0xa'));var ejs=require(_0x01fb('0xb'));var fs=require('fs');var fs_extra=require(_0x01fb('0xc'));var _=require(_0x01fb('0xd'));var squel=require(_0x01fb('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x01fb('0xf'));var toCsv=require(_0x01fb('0xa'));var querystring=require(_0x01fb('0x10'));var Papa=require(_0x01fb('0x11'));var Redis=require(_0x01fb('0x12'));var authService=require(_0x01fb('0x13'));var qs=require(_0x01fb('0x14'));var as=require(_0x01fb('0x15'));var hardwareService=require(_0x01fb('0x16'));var logger=require(_0x01fb('0x17'))('api');var utils=require(_0x01fb('0x18'));var config=require(_0x01fb('0x19'));var licenseUtil=require(_0x01fb('0x1a'));var db=require(_0x01fb('0x1b'))['db'];var jayson=require(_0x01fb('0x1c'));var client=jayson[_0x01fb('0x1d')][_0x01fb('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x586bfb,_0x5c7b2d,_0x1c5500,_0x5825af){return new BPromise(function(_0x3c7131,_0xb45cf3){var _0x25f96c=_0x5825af||client;return _0x25f96c[_0x01fb('0x1f')](_0x586bfb,_0x1c5500)['then'](function(_0x2561d1){logger[_0x01fb('0x20')]('VoiceContext,\x20%s,\x20%s',_0x5c7b2d,_0x01fb('0x21'));logger['debug'](_0x01fb('0x22'),_0x5c7b2d,_0x01fb('0x21'),JSON['stringify'](_0x2561d1));if(_0x2561d1['error']){if(_0x2561d1[_0x01fb('0x23')]['code']===0x1f4){logger[_0x01fb('0x23')](_0x01fb('0x24'),_0x5c7b2d,_0x2561d1[_0x01fb('0x23')][_0x01fb('0x25')]);return _0xb45cf3(_0x2561d1['error']['message']);}logger[_0x01fb('0x23')](_0x01fb('0x24'),_0x5c7b2d,_0x2561d1['error'][_0x01fb('0x25')]);return _0x3c7131(_0x2561d1['error'][_0x01fb('0x25')]);}else{logger[_0x01fb('0x20')]('VoiceContext,\x20%s,\x20%s',_0x5c7b2d,_0x01fb('0x21'));_0x3c7131(_0x2561d1[_0x01fb('0x26')][_0x01fb('0x25')]);}})[_0x01fb('0x27')](function(_0x44df9d){logger[_0x01fb('0x23')]('VoiceContext,\x20%s,\x20%s',_0x5c7b2d,_0x44df9d);_0xb45cf3(_0x44df9d);});});}function respondWithStatusCode(_0x4ef5bf,_0x2608cd){_0x2608cd=_0x2608cd||0xcc;return function(_0x57e4c5){if(_0x57e4c5){return _0x4ef5bf[_0x01fb('0x28')](_0x2608cd);}return _0x4ef5bf['status'](_0x2608cd)[_0x01fb('0x29')]();};}function respondWithResult(_0x51d883,_0x29fa){_0x29fa=_0x29fa||0xc8;return function(_0x5c7e11){if(_0x5c7e11){return _0x51d883[_0x01fb('0x2a')](_0x29fa)[_0x01fb('0x2b')](_0x5c7e11);}};}function respondWithFilteredResult(_0x352e91,_0x48a520){return function(_0x41e42a){if(_0x41e42a){var _0x199c7b=typeof _0x48a520[_0x01fb('0x2c')]===_0x01fb('0x2d')&&typeof _0x48a520[_0x01fb('0x2e')]==='undefined';var _0x525232=_0x41e42a[_0x01fb('0x2f')];var _0x24739d=_0x199c7b?0x0:_0x48a520[_0x01fb('0x2c')];var _0x1e6de7=_0x199c7b?_0x41e42a[_0x01fb('0x2f')]:_0x48a520['offset']+_0x48a520[_0x01fb('0x2e')];var _0x56ad51;if(_0x1e6de7>=_0x525232){_0x1e6de7=_0x525232;_0x56ad51=0xc8;}else{_0x56ad51=0xce;}_0x352e91[_0x01fb('0x2a')](_0x56ad51);return _0x352e91[_0x01fb('0x30')](_0x01fb('0x31'),_0x24739d+'-'+_0x1e6de7+'/'+_0x525232)[_0x01fb('0x2b')](_0x41e42a);}return null;};}function patchUpdates(_0x501f06){return function(_0x396911){try{jsonpatch[_0x01fb('0x32')](_0x396911,_0x501f06,!![]);}catch(_0x32ba70){return BPromise[_0x01fb('0x33')](_0x32ba70);}return _0x396911[_0x01fb('0x34')]();};}function saveUpdates(_0x39cfd4,_0x15a9d7){return function(_0x220ab1){if(_0x220ab1){return _0x220ab1[_0x01fb('0x35')](_0x39cfd4)[_0x01fb('0x36')](function(_0x3da65b){return _0x3da65b;});}return null;};}function removeEntity(_0x4627f9,_0x52633a){return function(_0x1fc312){if(_0x1fc312){return _0x1fc312[_0x01fb('0x37')]()[_0x01fb('0x36')](function(){var _0x4f24b4=_0x1fc312['get']({'plain':!![]});var _0x1484b9='Contexts';return db[_0x01fb('0x38')][_0x01fb('0x37')]({'where':{'type':_0x1484b9,'resourceId':_0x4f24b4['id']}})[_0x01fb('0x36')](function(){return _0x1fc312;});})[_0x01fb('0x36')](function(){_0x4627f9[_0x01fb('0x2a')](0xcc)[_0x01fb('0x29')]();});}};}function handleEntityNotFound(_0x5baee2,_0x3961e9){return function(_0x3883a8){if(!_0x3883a8){_0x5baee2[_0x01fb('0x28')](0x194);}return _0x3883a8;};}function handleError(_0x547354,_0x331353){_0x331353=_0x331353||0x1f4;return function(_0x414b29){logger[_0x01fb('0x23')](_0x414b29[_0x01fb('0x39')]);if(_0x414b29[_0x01fb('0x3a')]){delete _0x414b29[_0x01fb('0x3a')];}_0x547354[_0x01fb('0x2a')](_0x331353)[_0x01fb('0x3b')](_0x414b29);};}exports['index']=function(_0x56b0d7,_0x2c3aef){var _0x497b81={},_0x2af33b={},_0x30b431={'count':0x0,'rows':[]};var _0x66fafc=_[_0x01fb('0x3c')](db['VoiceContext'][_0x01fb('0x3d')],function(_0x114eb2){return{'name':_0x114eb2[_0x01fb('0x3e')],'type':_0x114eb2['type']['key']};});_0x2af33b[_0x01fb('0x3f')]=_[_0x01fb('0x3c')](_0x66fafc,_0x01fb('0x3a'));_0x2af33b['query']=_[_0x01fb('0x40')](_0x56b0d7[_0x01fb('0x41')]);_0x2af33b[_0x01fb('0x42')]=_[_0x01fb('0x43')](_0x2af33b[_0x01fb('0x3f')],_0x2af33b[_0x01fb('0x41')]);_0x497b81['attributes']=_['intersection'](_0x2af33b[_0x01fb('0x3f')],qs[_0x01fb('0x44')](_0x56b0d7[_0x01fb('0x41')][_0x01fb('0x44')]));_0x497b81[_0x01fb('0x45')]=_0x497b81[_0x01fb('0x45')][_0x01fb('0x46')]?_0x497b81[_0x01fb('0x45')]:_0x2af33b['model'];if(!_0x56b0d7[_0x01fb('0x41')][_0x01fb('0x47')](_0x01fb('0x48'))){_0x497b81[_0x01fb('0x2e')]=qs[_0x01fb('0x2e')](_0x56b0d7['query']['limit']);_0x497b81['offset']=qs['offset'](_0x56b0d7['query'][_0x01fb('0x2c')]);}_0x497b81['order']=qs[_0x01fb('0x49')](_0x56b0d7[_0x01fb('0x41')][_0x01fb('0x49')]);_0x497b81[_0x01fb('0x4a')]=qs[_0x01fb('0x42')](_[_0x01fb('0x4b')](_0x56b0d7[_0x01fb('0x41')],_0x2af33b['filters']),_0x66fafc);if(_0x56b0d7[_0x01fb('0x41')][_0x01fb('0x4c')]){_0x497b81[_0x01fb('0x4a')]=_[_0x01fb('0x4d')](_0x497b81['where'],{'$or':_['map'](_0x66fafc,function(_0x3fc131){if(_0x3fc131['type']!=='VIRTUAL'){var _0x3dc3bc={};_0x3dc3bc[_0x3fc131['name']]={'$like':'%'+_0x56b0d7[_0x01fb('0x41')]['filter']+'%'};return _0x3dc3bc;}})});}_0x497b81=_[_0x01fb('0x4d')]({},_0x497b81,_0x56b0d7[_0x01fb('0x4e')]);var _0x4c74df={'where':_0x497b81['where']};return db[_0x01fb('0x4f')][_0x01fb('0x2f')](_0x4c74df)[_0x01fb('0x36')](function(_0x1979b8){_0x30b431[_0x01fb('0x2f')]=_0x1979b8;if(_0x56b0d7['query'][_0x01fb('0x50')]){_0x497b81[_0x01fb('0x51')]=[{'all':!![]}];}return db[_0x01fb('0x4f')][_0x01fb('0x52')](_0x497b81);})[_0x01fb('0x36')](function(_0x5e3eef){_0x30b431[_0x01fb('0x53')]=_0x5e3eef;return _0x30b431;})[_0x01fb('0x36')](respondWithFilteredResult(_0x2c3aef,_0x497b81))[_0x01fb('0x27')](handleError(_0x2c3aef,null));};exports['show']=function(_0x2df844,_0x2d3172){var _0x3d17b3={'raw':![],'where':{'id':_0x2df844['params']['id']}},_0x3800db={};_0x3800db[_0x01fb('0x3f')]=_[_0x01fb('0x40')](db[_0x01fb('0x4f')][_0x01fb('0x3d')]);_0x3800db[_0x01fb('0x41')]=_[_0x01fb('0x40')](_0x2df844['query']);_0x3800db[_0x01fb('0x42')]=_[_0x01fb('0x43')](_0x3800db['model'],_0x3800db[_0x01fb('0x41')]);_0x3d17b3[_0x01fb('0x45')]=_['intersection'](_0x3800db[_0x01fb('0x3f')],qs[_0x01fb('0x44')](_0x2df844[_0x01fb('0x41')][_0x01fb('0x44')]));_0x3d17b3[_0x01fb('0x45')]=_0x3d17b3['attributes'][_0x01fb('0x46')]?_0x3d17b3[_0x01fb('0x45')]:_0x3800db[_0x01fb('0x3f')];if(_0x2df844[_0x01fb('0x41')][_0x01fb('0x50')]){_0x3d17b3['include']=[{'all':!![]}];}_0x3d17b3=_['merge']({},_0x3d17b3,_0x2df844['options']);return db[_0x01fb('0x4f')][_0x01fb('0x54')](_0x3d17b3)[_0x01fb('0x36')](handleEntityNotFound(_0x2d3172,null))[_0x01fb('0x36')](respondWithResult(_0x2d3172,null))[_0x01fb('0x27')](handleError(_0x2d3172,null));};exports[_0x01fb('0x55')]=function(_0x4664f2,_0x592fd6,_0x339c79){var _0x57da83;return db[_0x01fb('0x4f')][_0x01fb('0x55')](_0x4664f2[_0x01fb('0x56')],{'raw':!![]})[_0x01fb('0x36')](function(_0x2934d9){_0x57da83=_0x2934d9;return db[_0x01fb('0x4f')][_0x01fb('0x52')]({'raw':!![]});})['then'](function(_0x1d008b){var _0x2546b1=fs['readFileSync'](path[_0x01fb('0x57')](config[_0x01fb('0x58')],_0x01fb('0x59')),_0x01fb('0x5a'));var _0x591d7b=ejs[_0x01fb('0x5b')](_0x2546b1,{'contexts':_0x1d008b||[]});fs[_0x01fb('0x5c')](_0x01fb('0x5d'),_0x591d7b);})[_0x01fb('0x36')](function(){return respondWithRpcPromise(_0x01fb('0x5e'),_0x01fb('0x55'),{'module':_0x01fb('0x5f')});})[_0x01fb('0x36')](function(){var _0x452be6=_0x4664f2[_0x01fb('0x60')]['get']({'plain':!![]});if(!_0x452be6)throw new Error(_0x01fb('0x61'));if(_0x452be6[_0x01fb('0x62')]===_0x01fb('0x60')){var _0x5f12f6=_0x57da83[_0x01fb('0x63')]({'plain':!![]});return db[_0x01fb('0x64')][_0x01fb('0x54')]({'where':{'name':_0x01fb('0x65'),'userProfileId':_0x452be6[_0x01fb('0x66')]},'raw':!![]})[_0x01fb('0x36')](function(_0x51f42e){if(_0x51f42e&&_0x51f42e[_0x01fb('0x67')]===0x0){return db[_0x01fb('0x38')][_0x01fb('0x55')]({'name':_0x5f12f6[_0x01fb('0x3a')],'resourceId':_0x5f12f6['id'],'type':_0x51f42e[_0x01fb('0x3a')],'sectionId':_0x51f42e['id']},{})[_0x01fb('0x36')](function(){return _0x57da83;});}else{return _0x57da83;}})[_0x01fb('0x27')](function(_0xf0e185){logger[_0x01fb('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf0e185);throw _0xf0e185;});}return _0x57da83;})[_0x01fb('0x36')](respondWithResult(_0x592fd6,0xc9))[_0x01fb('0x27')](handleError(_0x592fd6,null));};exports[_0x01fb('0x35')]=function(_0x274ed1,_0x507880,_0x1235f3){var _0x41ae33;return db[_0x01fb('0x4f')]['find']({'where':{'id':_0x274ed1[_0x01fb('0x68')]['id']}})[_0x01fb('0x36')](handleEntityNotFound(_0x507880,null))[_0x01fb('0x36')](saveUpdates(_0x274ed1[_0x01fb('0x56')],null))[_0x01fb('0x36')](function(_0x4da2d9){if(_0x4da2d9){_0x41ae33=_0x4da2d9;return db['VoiceContext'][_0x01fb('0x52')]({'raw':!![]});}})[_0x01fb('0x36')](function(_0x1f7cbb){var _0x475170=fs[_0x01fb('0x69')](path[_0x01fb('0x57')](config[_0x01fb('0x58')],_0x01fb('0x59')),_0x01fb('0x5a'));var _0x51da15=ejs[_0x01fb('0x5b')](_0x475170,{'contexts':_0x1f7cbb||[]});fs[_0x01fb('0x5c')](_0x01fb('0x5d'),_0x51da15);})[_0x01fb('0x36')](function(){return respondWithRpcPromise(_0x01fb('0x5e'),_0x01fb('0x35'),{'module':_0x01fb('0x5f')});})[_0x01fb('0x36')](function(){return _0x41ae33;})[_0x01fb('0x36')](respondWithResult(_0x507880,null))['catch'](handleError(_0x507880,null));};exports['destroy']=function(_0x4da9c3,_0x3ed10e,_0x3355ee){var _0x3b00ed;return db[_0x01fb('0x4f')][_0x01fb('0x54')]({'where':{'id':_0x4da9c3[_0x01fb('0x68')]['id']}})[_0x01fb('0x36')](handleEntityNotFound(_0x3ed10e,null))[_0x01fb('0x36')](removeEntity(_0x3ed10e,null))[_0x01fb('0x36')](function(){return db['VoiceContext'][_0x01fb('0x52')]({'raw':!![]});})[_0x01fb('0x36')](function(_0x1bc257){var _0x55afcb=fs['readFileSync'](path[_0x01fb('0x57')](config[_0x01fb('0x58')],_0x01fb('0x59')),_0x01fb('0x5a'));var _0x53ba23=ejs[_0x01fb('0x5b')](_0x55afcb,{'contexts':_0x1bc257});fs[_0x01fb('0x5c')](_0x01fb('0x5d'),_0x53ba23);return respondWithRpcPromise(_0x01fb('0x5e'),_0x01fb('0x37'),{'module':'chan_sip.so'});})['catch'](handleError(_0x3ed10e,null));}; \ No newline at end of file +var _0x1589=['get','UserProfileResource','destroy','sendStatus','stack','name','index','VoiceContext','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','include','findAll','rows','params','includeAll','find','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','create','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Contexts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','bluebird','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save'];(function(_0x1ac1e1,_0x36a4c1){var _0x35bb79=function(_0x3f2667){while(--_0x3f2667){_0x1ac1e1['push'](_0x1ac1e1['shift']());}};_0x35bb79(++_0x36a4c1);}(_0x1589,0x175));var _0x9158=function(_0x154983,_0xc29edf){_0x154983=_0x154983-0x0;var _0x3d1243=_0x1589[_0x154983];return _0x3d1243;};'use strict';var emlformat=require(_0x9158('0x0'));var rimraf=require(_0x9158('0x1'));var zipdir=require(_0x9158('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9158('0x3'));var moment=require('moment');var BPromise=require(_0x9158('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x9158('0x5'));var csv=require(_0x9158('0x6'));var ejs=require(_0x9158('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9158('0x8'));var squel=require('squel');var crypto=require(_0x9158('0x9'));var jsforce=require(_0x9158('0xa'));var deskjs=require(_0x9158('0xb'));var toCsv=require(_0x9158('0x6'));var querystring=require(_0x9158('0xc'));var Papa=require(_0x9158('0xd'));var Redis=require(_0x9158('0xe'));var authService=require(_0x9158('0xf'));var qs=require(_0x9158('0x10'));var as=require(_0x9158('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9158('0x12'))('api');var utils=require(_0x9158('0x13'));var config=require(_0x9158('0x14'));var licenseUtil=require(_0x9158('0x15'));var db=require(_0x9158('0x16'))['db'];var jayson=require(_0x9158('0x17'));var client=jayson[_0x9158('0x18')][_0x9158('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x10e6d1,_0x59117c,_0x321e9a,_0x1a54a7){return new BPromise(function(_0x410aa7,_0x45d52d){var _0x161710=_0x1a54a7||client;return _0x161710[_0x9158('0x1a')](_0x10e6d1,_0x321e9a)[_0x9158('0x1b')](function(_0xf5379c){logger[_0x9158('0x1c')](_0x9158('0x1d'),_0x59117c,'request\x20sent');logger[_0x9158('0x1e')](_0x9158('0x1f'),_0x59117c,_0x9158('0x20'),JSON[_0x9158('0x21')](_0xf5379c));if(_0xf5379c[_0x9158('0x22')]){if(_0xf5379c['error'][_0x9158('0x23')]===0x1f4){logger[_0x9158('0x22')](_0x9158('0x1d'),_0x59117c,_0xf5379c[_0x9158('0x22')]['message']);return _0x45d52d(_0xf5379c[_0x9158('0x22')]['message']);}logger[_0x9158('0x22')](_0x9158('0x1d'),_0x59117c,_0xf5379c[_0x9158('0x22')][_0x9158('0x24')]);return _0x410aa7(_0xf5379c[_0x9158('0x22')][_0x9158('0x24')]);}else{logger[_0x9158('0x1c')]('VoiceContext,\x20%s,\x20%s',_0x59117c,_0x9158('0x20'));_0x410aa7(_0xf5379c[_0x9158('0x25')]['message']);}})[_0x9158('0x26')](function(_0x4ba213){logger[_0x9158('0x22')](_0x9158('0x1d'),_0x59117c,_0x4ba213);_0x45d52d(_0x4ba213);});});}function respondWithStatusCode(_0x5484e5,_0xe3b967){_0xe3b967=_0xe3b967||0xcc;return function(_0x5aa15f){if(_0x5aa15f){return _0x5484e5['sendStatus'](_0xe3b967);}return _0x5484e5[_0x9158('0x27')](_0xe3b967)[_0x9158('0x28')]();};}function respondWithResult(_0x41f4c5,_0x917fb3){_0x917fb3=_0x917fb3||0xc8;return function(_0x196171){if(_0x196171){return _0x41f4c5[_0x9158('0x27')](_0x917fb3)['json'](_0x196171);}};}function respondWithFilteredResult(_0x1ac177,_0x2cc62b){return function(_0x3199c4){if(_0x3199c4){var _0x19c3e6=typeof _0x2cc62b['offset']===_0x9158('0x29')&&typeof _0x2cc62b[_0x9158('0x2a')]===_0x9158('0x29');var _0xe37f28=_0x3199c4[_0x9158('0x2b')];var _0x33623f=_0x19c3e6?0x0:_0x2cc62b[_0x9158('0x2c')];var _0x30ce3f=_0x19c3e6?_0x3199c4[_0x9158('0x2b')]:_0x2cc62b[_0x9158('0x2c')]+_0x2cc62b[_0x9158('0x2a')];var _0x5df4fc;if(_0x30ce3f>=_0xe37f28){_0x30ce3f=_0xe37f28;_0x5df4fc=0xc8;}else{_0x5df4fc=0xce;}_0x1ac177[_0x9158('0x27')](_0x5df4fc);return _0x1ac177[_0x9158('0x2d')](_0x9158('0x2e'),_0x33623f+'-'+_0x30ce3f+'/'+_0xe37f28)[_0x9158('0x2f')](_0x3199c4);}return null;};}function patchUpdates(_0x5cc2aa){return function(_0x512266){try{jsonpatch[_0x9158('0x30')](_0x512266,_0x5cc2aa,!![]);}catch(_0x4dbbb0){return BPromise[_0x9158('0x31')](_0x4dbbb0);}return _0x512266[_0x9158('0x32')]();};}function saveUpdates(_0x7bd4ca,_0x2448ef){return function(_0x1b5d41){if(_0x1b5d41){return _0x1b5d41['update'](_0x7bd4ca)[_0x9158('0x1b')](function(_0x1a43cc){return _0x1a43cc;});}return null;};}function removeEntity(_0xd99b52,_0xb41a91){return function(_0x3eec61){if(_0x3eec61){return _0x3eec61['destroy']()[_0x9158('0x1b')](function(){var _0x2bc3e9=_0x3eec61[_0x9158('0x33')]({'plain':!![]});var _0x139c6c='Contexts';return db[_0x9158('0x34')][_0x9158('0x35')]({'where':{'type':_0x139c6c,'resourceId':_0x2bc3e9['id']}})[_0x9158('0x1b')](function(){return _0x3eec61;});})['then'](function(){_0xd99b52['status'](0xcc)[_0x9158('0x28')]();});}};}function handleEntityNotFound(_0x88537b,_0x512206){return function(_0x36f25a){if(!_0x36f25a){_0x88537b[_0x9158('0x36')](0x194);}return _0x36f25a;};}function handleError(_0x1c73de,_0xc53876){_0xc53876=_0xc53876||0x1f4;return function(_0x2a0759){logger[_0x9158('0x22')](_0x2a0759[_0x9158('0x37')]);if(_0x2a0759[_0x9158('0x38')]){delete _0x2a0759[_0x9158('0x38')];}_0x1c73de[_0x9158('0x27')](_0xc53876)['send'](_0x2a0759);};}exports[_0x9158('0x39')]=function(_0x1d713f,_0x4e1e51){var _0xd9cdc0={},_0x372349={},_0x4d2269={'count':0x0,'rows':[]};var _0x4076fc=_['map'](db[_0x9158('0x3a')][_0x9158('0x3b')],function(_0x579e32){return{'name':_0x579e32['fieldName'],'type':_0x579e32[_0x9158('0x3c')][_0x9158('0x3d')]};});_0x372349[_0x9158('0x3e')]=_[_0x9158('0x3f')](_0x4076fc,_0x9158('0x38'));_0x372349[_0x9158('0x40')]=_[_0x9158('0x41')](_0x1d713f[_0x9158('0x40')]);_0x372349[_0x9158('0x42')]=_[_0x9158('0x43')](_0x372349[_0x9158('0x3e')],_0x372349[_0x9158('0x40')]);_0xd9cdc0[_0x9158('0x44')]=_[_0x9158('0x43')](_0x372349[_0x9158('0x3e')],qs[_0x9158('0x45')](_0x1d713f[_0x9158('0x40')]['fields']));_0xd9cdc0[_0x9158('0x44')]=_0xd9cdc0['attributes'][_0x9158('0x46')]?_0xd9cdc0['attributes']:_0x372349[_0x9158('0x3e')];if(!_0x1d713f[_0x9158('0x40')][_0x9158('0x47')](_0x9158('0x48'))){_0xd9cdc0[_0x9158('0x2a')]=qs[_0x9158('0x2a')](_0x1d713f['query'][_0x9158('0x2a')]);_0xd9cdc0[_0x9158('0x2c')]=qs[_0x9158('0x2c')](_0x1d713f[_0x9158('0x40')]['offset']);}_0xd9cdc0[_0x9158('0x49')]=qs[_0x9158('0x4a')](_0x1d713f['query'][_0x9158('0x4a')]);_0xd9cdc0['where']=qs[_0x9158('0x42')](_[_0x9158('0x4b')](_0x1d713f['query'],_0x372349[_0x9158('0x42')]),_0x4076fc);if(_0x1d713f[_0x9158('0x40')][_0x9158('0x4c')]){_0xd9cdc0['where']=_[_0x9158('0x4d')](_0xd9cdc0[_0x9158('0x4e')],{'$or':_[_0x9158('0x3f')](_0x4076fc,function(_0x85f956){if(_0x85f956['type']!==_0x9158('0x4f')){var _0x10273a={};_0x10273a[_0x85f956[_0x9158('0x38')]]={'$like':'%'+_0x1d713f['query'][_0x9158('0x4c')]+'%'};return _0x10273a;}})});}_0xd9cdc0=_[_0x9158('0x4d')]({},_0xd9cdc0,_0x1d713f[_0x9158('0x50')]);var _0x151891={'where':_0xd9cdc0[_0x9158('0x4e')]};return db[_0x9158('0x3a')]['count'](_0x151891)[_0x9158('0x1b')](function(_0x715074){_0x4d2269[_0x9158('0x2b')]=_0x715074;if(_0x1d713f['query']['includeAll']){_0xd9cdc0[_0x9158('0x51')]=[{'all':!![]}];}return db[_0x9158('0x3a')][_0x9158('0x52')](_0xd9cdc0);})[_0x9158('0x1b')](function(_0xef9094){_0x4d2269[_0x9158('0x53')]=_0xef9094;return _0x4d2269;})[_0x9158('0x1b')](respondWithFilteredResult(_0x4e1e51,_0xd9cdc0))[_0x9158('0x26')](handleError(_0x4e1e51,null));};exports['show']=function(_0x58bd68,_0x400b0d){var _0x4cee00={'raw':![],'where':{'id':_0x58bd68[_0x9158('0x54')]['id']}},_0x4c220f={};_0x4c220f[_0x9158('0x3e')]=_[_0x9158('0x41')](db[_0x9158('0x3a')][_0x9158('0x3b')]);_0x4c220f['query']=_[_0x9158('0x41')](_0x58bd68[_0x9158('0x40')]);_0x4c220f[_0x9158('0x42')]=_[_0x9158('0x43')](_0x4c220f[_0x9158('0x3e')],_0x4c220f[_0x9158('0x40')]);_0x4cee00[_0x9158('0x44')]=_[_0x9158('0x43')](_0x4c220f['model'],qs[_0x9158('0x45')](_0x58bd68['query']['fields']));_0x4cee00[_0x9158('0x44')]=_0x4cee00[_0x9158('0x44')]['length']?_0x4cee00[_0x9158('0x44')]:_0x4c220f[_0x9158('0x3e')];if(_0x58bd68[_0x9158('0x40')][_0x9158('0x55')]){_0x4cee00['include']=[{'all':!![]}];}_0x4cee00=_['merge']({},_0x4cee00,_0x58bd68[_0x9158('0x50')]);return db[_0x9158('0x3a')][_0x9158('0x56')](_0x4cee00)[_0x9158('0x1b')](handleEntityNotFound(_0x400b0d,null))[_0x9158('0x1b')](respondWithResult(_0x400b0d,null))[_0x9158('0x26')](handleError(_0x400b0d,null));};exports['create']=function(_0x514c49,_0x424026,_0x203a7e){var _0x70253;return db[_0x9158('0x3a')]['create'](_0x514c49['body'],{'raw':!![]})[_0x9158('0x1b')](function(_0x4dc884){_0x70253=_0x4dc884;return db['VoiceContext'][_0x9158('0x52')]({'raw':!![]});})[_0x9158('0x1b')](function(_0x4c73a2){var _0x1c6fd0=fs[_0x9158('0x57')](path[_0x9158('0x58')](config[_0x9158('0x59')],_0x9158('0x5a')),_0x9158('0x5b'));var _0x4cbf19=ejs[_0x9158('0x5c')](_0x1c6fd0,{'contexts':_0x4c73a2||[]});fs[_0x9158('0x5d')](_0x9158('0x5e'),_0x4cbf19);})[_0x9158('0x1b')](function(){return respondWithRpcPromise(_0x9158('0x5f'),_0x9158('0x60'),{'module':_0x9158('0x61')});})[_0x9158('0x1b')](function(){var _0x220890=_0x514c49[_0x9158('0x62')]['get']({'plain':!![]});if(!_0x220890)throw new Error(_0x9158('0x63'));if(_0x220890[_0x9158('0x64')]===_0x9158('0x62')){var _0x3f37d6=_0x70253[_0x9158('0x33')]({'plain':!![]});return db['UserProfileSection'][_0x9158('0x56')]({'where':{'name':_0x9158('0x65'),'userProfileId':_0x220890[_0x9158('0x66')]},'raw':!![]})[_0x9158('0x1b')](function(_0x4a2671){if(_0x4a2671&&_0x4a2671[_0x9158('0x67')]===0x0){return db[_0x9158('0x34')]['create']({'name':_0x3f37d6['name'],'resourceId':_0x3f37d6['id'],'type':_0x4a2671[_0x9158('0x38')],'sectionId':_0x4a2671['id']},{})[_0x9158('0x1b')](function(){return _0x70253;});}else{return _0x70253;}})[_0x9158('0x26')](function(_0x4a1c31){logger[_0x9158('0x22')](_0x9158('0x68'),_0x4a1c31);throw _0x4a1c31;});}return _0x70253;})[_0x9158('0x1b')](respondWithResult(_0x424026,0xc9))[_0x9158('0x26')](handleError(_0x424026,null));};exports[_0x9158('0x69')]=function(_0x2e4004,_0x1b8fae,_0x595e1a){var _0x1468a7;return db['VoiceContext'][_0x9158('0x56')]({'where':{'id':_0x2e4004[_0x9158('0x54')]['id']}})[_0x9158('0x1b')](handleEntityNotFound(_0x1b8fae,null))[_0x9158('0x1b')](saveUpdates(_0x2e4004['body'],null))['then'](function(_0x40fb77){if(_0x40fb77){_0x1468a7=_0x40fb77;return db[_0x9158('0x3a')][_0x9158('0x52')]({'raw':!![]});}})['then'](function(_0x2c0dbe){var _0x30cbc4=fs['readFileSync'](path[_0x9158('0x58')](config[_0x9158('0x59')],'server/files/templates/context.ejs'),_0x9158('0x5b'));var _0x2d5185=ejs[_0x9158('0x5c')](_0x30cbc4,{'contexts':_0x2c0dbe||[]});fs[_0x9158('0x5d')](_0x9158('0x5e'),_0x2d5185);})[_0x9158('0x1b')](function(){return respondWithRpcPromise('Reload',_0x9158('0x69'),{'module':_0x9158('0x61')});})[_0x9158('0x1b')](function(){return _0x1468a7;})['then'](respondWithResult(_0x1b8fae,null))['catch'](handleError(_0x1b8fae,null));};exports[_0x9158('0x35')]=function(_0xc2afee,_0x5e0236,_0x469278){var _0x5cea10;return db[_0x9158('0x3a')]['find']({'where':{'id':_0xc2afee['params']['id']}})[_0x9158('0x1b')](handleEntityNotFound(_0x5e0236,null))[_0x9158('0x1b')](removeEntity(_0x5e0236,null))[_0x9158('0x1b')](function(){return db[_0x9158('0x3a')][_0x9158('0x52')]({'raw':!![]});})[_0x9158('0x1b')](function(_0x1d4757){var _0x252244=fs[_0x9158('0x57')](path[_0x9158('0x58')](config[_0x9158('0x59')],_0x9158('0x5a')),_0x9158('0x5b'));var _0x125806=ejs[_0x9158('0x5c')](_0x252244,{'contexts':_0x1d4757});fs[_0x9158('0x5d')](_0x9158('0x5e'),_0x125806);return respondWithRpcPromise('Reload','destroy',{'module':_0x9158('0x61')});})[_0x9158('0x26')](handleError(_0x5e0236,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 070a813..df3ed7e 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 _0xaa61=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util'];(function(_0x505674,_0xeb641a){var _0x21a5e2=function(_0x5b9b0e){while(--_0x5b9b0e){_0x505674['push'](_0x505674['shift']());}};_0x21a5e2(++_0xeb641a);}(_0xaa61,0x1cc));var _0x1aa6=function(_0xebdb6f,_0x7f60f9){_0xebdb6f=_0xebdb6f-0x0;var _0x5b2ac1=_0xaa61[_0xebdb6f];return _0x5b2ac1;};'use strict';var _=require(_0x1aa6('0x0'));var util=require(_0x1aa6('0x1'));var logger=require(_0x1aa6('0x2'))(_0x1aa6('0x3'));var moment=require('moment');var BPromise=require(_0x1aa6('0x4'));var rp=require(_0x1aa6('0x5'));var fs=require('fs');var path=require(_0x1aa6('0x6'));var rimraf=require(_0x1aa6('0x7'));var config=require(_0x1aa6('0x8'));var attributes=require(_0x1aa6('0x9'));module[_0x1aa6('0xa')]=function(_0x1adbcc,_0x263bd4){return _0x1adbcc[_0x1aa6('0xb')](_0x1aa6('0xc'),attributes,{'tableName':_0x1aa6('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb36=['VoiceContext','lodash','util','../../config/logger','api','moment','bluebird','request-promise','exports','define'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xeb36,0x119));var _0x6eb3=function(_0xab2e03,_0x404aec){_0xab2e03=_0xab2e03-0x0;var _0x39b0cf=_0xeb36[_0xab2e03];return _0x39b0cf;};'use strict';var _=require(_0x6eb3('0x0'));var util=require(_0x6eb3('0x1'));var logger=require(_0x6eb3('0x2'))(_0x6eb3('0x3'));var moment=require(_0x6eb3('0x4'));var BPromise=require(_0x6eb3('0x5'));var rp=require(_0x6eb3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceContext.attributes');module[_0x6eb3('0x7')]=function(_0x2ba6a2,_0x443ab3){return _0x2ba6a2[_0x6eb3('0x8')](_0x6eb3('0x9'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 67a0b1d..8f9db20 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 _0x9c00=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','randomstring','ioredis'];(function(_0x113696,_0x1843cc){var _0x1fb234=function(_0x5f1185){while(--_0x5f1185){_0x113696['push'](_0x113696['shift']());}};_0x1fb234(++_0x1843cc);}(_0x9c00,0x1a0));var _0x09c0=function(_0xc6379f,_0x5d0315){_0xc6379f=_0xc6379f-0x0;var _0x437fe8=_0x9c00[_0xc6379f];return _0x437fe8;};'use strict';var _=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x09c0('0x2'));var fs=require('fs');var Redis=require(_0x09c0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x09c0('0x4'));var logger=require(_0x09c0('0x5'))(_0x09c0('0x6'));var config=require(_0x09c0('0x7'));var jayson=require(_0x09c0('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1f3d7e,_0x17d11f,_0x1b633b){return new BPromise(function(_0x3187aa,_0x17cd9d){return client['request'](_0x1f3d7e,_0x1b633b)[_0x09c0('0x9')](function(_0x1c1246){logger[_0x09c0('0xa')](_0x09c0('0xb'),_0x17d11f,_0x09c0('0xc'));logger[_0x09c0('0xd')](_0x09c0('0xe'),_0x17d11f,_0x09c0('0xc'),JSON[_0x09c0('0xf')](_0x1c1246));if(_0x1c1246[_0x09c0('0x10')]){if(_0x1c1246[_0x09c0('0x10')][_0x09c0('0x11')]===0x1f4){logger[_0x09c0('0x10')](_0x09c0('0xb'),_0x17d11f,_0x1c1246[_0x09c0('0x10')][_0x09c0('0x12')]);return _0x17cd9d(_0x1c1246[_0x09c0('0x10')][_0x09c0('0x12')]);}logger[_0x09c0('0x10')](_0x09c0('0xb'),_0x17d11f,_0x1c1246[_0x09c0('0x10')][_0x09c0('0x12')]);return _0x3187aa(_0x1c1246[_0x09c0('0x10')][_0x09c0('0x12')]);}else{logger[_0x09c0('0xa')](_0x09c0('0xb'),_0x17d11f,'request\x20sent');_0x3187aa(_0x1c1246['result']['message']);}})[_0x09c0('0x13')](function(_0x11f4b2){logger[_0x09c0('0x10')](_0x09c0('0xb'),_0x17d11f,_0x11f4b2);_0x17cd9d(_0x11f4b2);});});} \ No newline at end of file +var _0xa169=['request','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x473738,_0x15ea31){var _0x1df4ae=function(_0x417a72){while(--_0x417a72){_0x473738['push'](_0x473738['shift']());}};_0x1df4ae(++_0x15ea31);}(_0xa169,0xaa));var _0x9a16=function(_0x354957,_0x23aeda){_0x354957=_0x354957-0x0;var _0x36b5a6=_0xa169[_0x354957];return _0x36b5a6;};'use strict';var _=require(_0x9a16('0x0'));var util=require(_0x9a16('0x1'));var moment=require(_0x9a16('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a16('0x3'));var db=require(_0x9a16('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9a16('0x5'))(_0x9a16('0x6'));var config=require(_0x9a16('0x7'));var jayson=require(_0x9a16('0x8'));var client=jayson[_0x9a16('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31597a,_0x1b3458,_0xae9d70){return new BPromise(function(_0xe871ab,_0x4d164e){return client[_0x9a16('0xa')](_0x31597a,_0xae9d70)['then'](function(_0x3c0f0a){logger['info'](_0x9a16('0xb'),_0x1b3458,_0x9a16('0xc'));logger[_0x9a16('0xd')](_0x9a16('0xe'),_0x1b3458,_0x9a16('0xc'),JSON['stringify'](_0x3c0f0a));if(_0x3c0f0a['error']){if(_0x3c0f0a[_0x9a16('0xf')]['code']===0x1f4){logger['error'](_0x9a16('0xb'),_0x1b3458,_0x3c0f0a[_0x9a16('0xf')][_0x9a16('0x10')]);return _0x4d164e(_0x3c0f0a[_0x9a16('0xf')]['message']);}logger[_0x9a16('0xf')](_0x9a16('0xb'),_0x1b3458,_0x3c0f0a[_0x9a16('0xf')][_0x9a16('0x10')]);return _0xe871ab(_0x3c0f0a[_0x9a16('0xf')][_0x9a16('0x10')]);}else{logger[_0x9a16('0x11')](_0x9a16('0xb'),_0x1b3458,'request\x20sent');_0xe871ab(_0x3c0f0a[_0x9a16('0x12')][_0x9a16('0x10')]);}})[_0x9a16('0x13')](function(_0x33fecb){logger['error']('VoiceContext,\x20%s,\x20%s',_0x1b3458,_0x33fecb);_0x4d164e(_0x33fecb);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index de71a3a..6b091ef 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 _0x0d47=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','show','post','create','put','/:id','destroy','exports','path'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x0d47,0x1b9));var _0x70d4=function(_0x4e0f41,_0x337fd2){_0x4e0f41=_0x4e0f41-0x0;var _0x2a19fd=_0x0d47[_0x4e0f41];return _0x2a19fd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x70d4('0x0'));var timeout=require(_0x70d4('0x1'));var express=require(_0x70d4('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x70d4('0x3'));var interaction=require(_0x70d4('0x4'));var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router[_0x70d4('0x5')]('/',auth['isAuthenticated'](),controller[_0x70d4('0x6')]);router['get'](_0x70d4('0x7'),auth[_0x70d4('0x8')](),controller[_0x70d4('0x9')]);router['get']('/:id',auth[_0x70d4('0x8')](),controller[_0x70d4('0xa')]);router[_0x70d4('0xb')]('/',auth[_0x70d4('0x8')](),controller[_0x70d4('0xc')]);router[_0x70d4('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x70d4('0xe'),auth[_0x70d4('0x8')](),controller[_0x70d4('0xf')]);module[_0x70d4('0x10')]=router; \ No newline at end of file +var _0x085c=['exports','multer','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','put','delete'];(function(_0x36d291,_0x3c8e13){var _0x45a51a=function(_0x59ff35){while(--_0x59ff35){_0x36d291['push'](_0x36d291['shift']());}};_0x45a51a(++_0x3c8e13);}(_0x085c,0xd9));var _0xc085=function(_0xa911e,_0x1a9f9a){_0xa911e=_0xa911e-0x0;var _0x28bd6f=_0x085c[_0xa911e];return _0x28bd6f;};'use strict';var multer=require(_0xc085('0x0'));var util=require(_0xc085('0x1'));var path=require(_0xc085('0x2'));var timeout=require('connect-timeout');var express=require(_0xc085('0x3'));var router=express['Router']();var fs_extra=require(_0xc085('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc085('0x5'));var config=require(_0xc085('0x6'));var controller=require(_0xc085('0x7'));router[_0xc085('0x8')]('/',auth['isAuthenticated'](),controller[_0xc085('0x9')]);router[_0xc085('0x8')](_0xc085('0xa'),auth[_0xc085('0xb')](),controller[_0xc085('0xc')]);router[_0xc085('0x8')](_0xc085('0xd'),auth['isAuthenticated'](),controller[_0xc085('0xe')]);router['post']('/',auth[_0xc085('0xb')](),controller['create']);router[_0xc085('0xf')](_0xc085('0xd'),auth[_0xc085('0xb')](),controller['update']);router[_0xc085('0x10')](_0xc085('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0xc085('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 3e18d52..4e64c7d 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 _0x4b84=['INTEGER','STRING','DATE','called,connect,complete','sequelize','exports'];(function(_0x50f12f,_0x4f5f82){var _0x275b99=function(_0x5bfa98){while(--_0x5bfa98){_0x50f12f['push'](_0x50f12f['shift']());}};_0x275b99(++_0x4f5f82);}(_0x4b84,0x1cc));var _0x44b8=function(_0x47d6dc,_0xc036cc){_0x47d6dc=_0x47d6dc-0x0;var _0x1a1c93=_0x4b84[_0x47d6dc];return _0x1a1c93;};'use strict';var Sequelize=require(_0x44b8('0x0'));module[_0x44b8('0x1')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x44b8('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x44b8('0x3')]},'connectedlinenum':{'type':Sequelize[_0x44b8('0x3')]},'connectedlinename':{'type':Sequelize[_0x44b8('0x3')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x44b8('0x3')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0x44b8('0x3')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x44b8('0x3')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x44b8('0x3')]},'destcalleridname':{'type':Sequelize[_0x44b8('0x3')]},'destconnectedlinenum':{'type':Sequelize[_0x44b8('0x3')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x44b8('0x3')]},'destaccountcode':{'type':Sequelize[_0x44b8('0x3')]},'destcontext':{'type':Sequelize[_0x44b8('0x3')]},'destexten':{'type':Sequelize[_0x44b8('0x3')]},'destpriority':{'type':Sequelize[_0x44b8('0x2')]},'destuniqueid':{'type':Sequelize[_0x44b8('0x3')]},'destlinkedid':{'type':Sequelize[_0x44b8('0x3')]},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0x44b8('0x3')]},'starttime':{'type':Sequelize[_0x44b8('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x44b8('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x44b8('0x5')},'routeId':{'type':Sequelize[_0x44b8('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x44b8('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x81bd=['exports','STRING','INTEGER','DATE','sequelize'];(function(_0x407461,_0x1cf61c){var _0x2b3ffa=function(_0x2acb31){while(--_0x2acb31){_0x407461['push'](_0x407461['shift']());}};_0x2b3ffa(++_0x1cf61c);}(_0x81bd,0x7c));var _0xd81b=function(_0x2042a4,_0x16f91e){_0x2042a4=_0x2042a4-0x0;var _0x233995=_0x81bd[_0x2042a4];return _0x233995;};'use strict';var Sequelize=require(_0xd81b('0x0'));module[_0xd81b('0x1')]={'privilege':{'type':Sequelize[_0xd81b('0x2')]},'channel':{'type':Sequelize[_0xd81b('0x2')]},'channelstate':{'type':Sequelize[_0xd81b('0x3')]},'channelstatedesc':{'type':Sequelize[_0xd81b('0x2')]},'calleridnum':{'type':Sequelize[_0xd81b('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xd81b('0x2')]},'connectedlinename':{'type':Sequelize[_0xd81b('0x2')]},'language':{'type':Sequelize[_0xd81b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xd81b('0x2')]},'exten':{'type':Sequelize[_0xd81b('0x2')]},'priority':{'type':Sequelize[_0xd81b('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xd81b('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xd81b('0x2')]},'destcalleridnum':{'type':Sequelize[_0xd81b('0x2')]},'destcalleridname':{'type':Sequelize[_0xd81b('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xd81b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xd81b('0x2')]},'destlanguage':{'type':Sequelize[_0xd81b('0x2')]},'destaccountcode':{'type':Sequelize[_0xd81b('0x2')]},'destcontext':{'type':Sequelize[_0xd81b('0x2')]},'destexten':{'type':Sequelize[_0xd81b('0x2')]},'destpriority':{'type':Sequelize[_0xd81b('0x3')]},'destuniqueid':{'type':Sequelize[_0xd81b('0x2')]},'destlinkedid':{'type':Sequelize[_0xd81b('0x2')]},'dialstring':{'type':Sequelize[_0xd81b('0x2')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xd81b('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xd81b('0x4')]},'lastevent':{'type':Sequelize[_0xd81b('0x2')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xd81b('0x3')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xd81b('0x3')]},'billableseconds':{'type':Sequelize[_0xd81b('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index b76607d..bfcc1a8 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 _0xd382=['stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','nolimit','sort','where','pick','filter','merge','options','VoiceDialReport','findAll','rows','catch','show','rawAttributes','fields','length','includeAll','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','limit','offset','count','set','apply','reject','update','then','end','sendStatus','error'];(function(_0x535a55,_0x4c7bf8){var _0x1e5aeb=function(_0x286c72){while(--_0x286c72){_0x535a55['push'](_0x535a55['shift']());}};_0x1e5aeb(++_0x4c7bf8);}(_0xd382,0x1ea));var _0x2d38=function(_0x2c590a,_0x19d6d3){_0x2c590a=_0x2c590a-0x0;var _0x2382e4=_0xd382[_0x2c590a];return _0x2382e4;};'use strict';var emlformat=require(_0x2d38('0x0'));var rimraf=require(_0x2d38('0x1'));var zipdir=require(_0x2d38('0x2'));var jsonpatch=require(_0x2d38('0x3'));var rp=require(_0x2d38('0x4'));var moment=require(_0x2d38('0x5'));var BPromise=require(_0x2d38('0x6'));var Mustache=require('mustache');var util=require(_0x2d38('0x7'));var path=require(_0x2d38('0x8'));var sox=require(_0x2d38('0x9'));var csv=require(_0x2d38('0xa'));var ejs=require(_0x2d38('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2d38('0xc'));var squel=require(_0x2d38('0xd'));var crypto=require(_0x2d38('0xe'));var jsforce=require(_0x2d38('0xf'));var deskjs=require(_0x2d38('0x10'));var toCsv=require(_0x2d38('0xa'));var querystring=require(_0x2d38('0x11'));var Papa=require('papaparse');var Redis=require(_0x2d38('0x12'));var authService=require(_0x2d38('0x13'));var qs=require(_0x2d38('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2d38('0x15'));var logger=require(_0x2d38('0x16'))(_0x2d38('0x17'));var utils=require(_0x2d38('0x18'));var config=require(_0x2d38('0x19'));var licenseUtil=require(_0x2d38('0x1a'));var db=require(_0x2d38('0x1b'))['db'];function respondWithStatusCode(_0x954294,_0x39bd32){_0x39bd32=_0x39bd32||0xcc;return function(_0x5b559b){if(_0x5b559b){return _0x954294['sendStatus'](_0x39bd32);}return _0x954294[_0x2d38('0x1c')](_0x39bd32)['end']();};}function respondWithResult(_0x18df31,_0x3e1fd8){_0x3e1fd8=_0x3e1fd8||0xc8;return function(_0x531191){if(_0x531191){return _0x18df31[_0x2d38('0x1c')](_0x3e1fd8)[_0x2d38('0x1d')](_0x531191);}};}function respondWithFilteredResult(_0x5c557a,_0x1888db){return function(_0x5d2219){if(_0x5d2219){var _0x2c9175=typeof _0x1888db['offset']===_0x2d38('0x1e')&&typeof _0x1888db[_0x2d38('0x1f')]==='undefined';var _0x3d3e26=_0x5d2219['count'];var _0x2ae803=_0x2c9175?0x0:_0x1888db[_0x2d38('0x20')];var _0x47e52b=_0x2c9175?_0x5d2219[_0x2d38('0x21')]:_0x1888db[_0x2d38('0x20')]+_0x1888db[_0x2d38('0x1f')];var _0x17e76d;if(_0x47e52b>=_0x3d3e26){_0x47e52b=_0x3d3e26;_0x17e76d=0xc8;}else{_0x17e76d=0xce;}_0x5c557a['status'](_0x17e76d);return _0x5c557a[_0x2d38('0x22')]('Content-Range',_0x2ae803+'-'+_0x47e52b+'/'+_0x3d3e26)[_0x2d38('0x1d')](_0x5d2219);}return null;};}function patchUpdates(_0xf079dd){return function(_0x14b915){try{jsonpatch[_0x2d38('0x23')](_0x14b915,_0xf079dd,!![]);}catch(_0x40e61b){return BPromise[_0x2d38('0x24')](_0x40e61b);}return _0x14b915['save']();};}function saveUpdates(_0x5440ec,_0x343e0e){return function(_0x157fcb){if(_0x157fcb){return _0x157fcb[_0x2d38('0x25')](_0x5440ec)[_0x2d38('0x26')](function(_0x5c84bf){return _0x5c84bf;});}return null;};}function removeEntity(_0x1b2228,_0x4f7623){return function(_0x22f66f){if(_0x22f66f){return _0x22f66f['destroy']()[_0x2d38('0x26')](function(){_0x1b2228[_0x2d38('0x1c')](0xcc)[_0x2d38('0x27')]();});}};}function handleEntityNotFound(_0xcd83f9,_0x7e3723){return function(_0x260d44){if(!_0x260d44){_0xcd83f9[_0x2d38('0x28')](0x194);}return _0x260d44;};}function handleError(_0x55ed11,_0x468509){_0x468509=_0x468509||0x1f4;return function(_0x549f3e){logger[_0x2d38('0x29')](_0x549f3e[_0x2d38('0x2a')]);if(_0x549f3e[_0x2d38('0x2b')]){delete _0x549f3e[_0x2d38('0x2b')];}_0x55ed11['status'](_0x468509)[_0x2d38('0x2c')](_0x549f3e);};}exports[_0x2d38('0x2d')]=function(_0x37ebb9,_0x37e832){var _0x18e623={},_0x5a82f1={},_0x23457b={'count':0x0,'rows':[]};var _0x22dd2b=_[_0x2d38('0x2e')](db['VoiceDialReport']['rawAttributes'],function(_0x4b4f8f){return{'name':_0x4b4f8f[_0x2d38('0x2f')],'type':_0x4b4f8f[_0x2d38('0x30')][_0x2d38('0x31')]};});_0x5a82f1[_0x2d38('0x32')]=_[_0x2d38('0x2e')](_0x22dd2b,'name');_0x5a82f1[_0x2d38('0x33')]=_[_0x2d38('0x34')](_0x37ebb9['query']);_0x5a82f1[_0x2d38('0x35')]=_[_0x2d38('0x36')](_0x5a82f1['model'],_0x5a82f1['query']);_0x18e623[_0x2d38('0x37')]=_['intersection'](_0x5a82f1[_0x2d38('0x32')],qs['fields'](_0x37ebb9['query']['fields']));_0x18e623[_0x2d38('0x37')]=_0x18e623['attributes']['length']?_0x18e623[_0x2d38('0x37')]:_0x5a82f1[_0x2d38('0x32')];if(!_0x37ebb9[_0x2d38('0x33')]['hasOwnProperty'](_0x2d38('0x38'))){_0x18e623[_0x2d38('0x1f')]=qs['limit'](_0x37ebb9[_0x2d38('0x33')][_0x2d38('0x1f')]);_0x18e623['offset']=qs[_0x2d38('0x20')](_0x37ebb9[_0x2d38('0x33')]['offset']);}_0x18e623['order']=qs[_0x2d38('0x39')](_0x37ebb9['query']['sort']);_0x18e623[_0x2d38('0x3a')]=qs[_0x2d38('0x35')](_[_0x2d38('0x3b')](_0x37ebb9['query'],_0x5a82f1[_0x2d38('0x35')]),_0x22dd2b);if(_0x37ebb9[_0x2d38('0x33')][_0x2d38('0x3c')]){_0x18e623[_0x2d38('0x3a')]=_[_0x2d38('0x3d')](_0x18e623[_0x2d38('0x3a')],{'$or':_[_0x2d38('0x2e')](_0x22dd2b,function(_0x2995ff){if(_0x2995ff[_0x2d38('0x30')]!=='VIRTUAL'){var _0x128914={};_0x128914[_0x2995ff['name']]={'$like':'%'+_0x37ebb9[_0x2d38('0x33')][_0x2d38('0x3c')]+'%'};return _0x128914;}})});}_0x18e623=_[_0x2d38('0x3d')]({},_0x18e623,_0x37ebb9[_0x2d38('0x3e')]);var _0x40a901={'where':_0x18e623[_0x2d38('0x3a')]};return db[_0x2d38('0x3f')]['count'](_0x40a901)[_0x2d38('0x26')](function(_0x55ff72){_0x23457b[_0x2d38('0x21')]=_0x55ff72;if(_0x37ebb9[_0x2d38('0x33')]['includeAll']){_0x18e623['include']=[{'all':!![]}];}return db[_0x2d38('0x3f')][_0x2d38('0x40')](_0x18e623);})[_0x2d38('0x26')](function(_0x437b58){_0x23457b[_0x2d38('0x41')]=_0x437b58;return _0x23457b;})[_0x2d38('0x26')](respondWithFilteredResult(_0x37e832,_0x18e623))[_0x2d38('0x42')](handleError(_0x37e832,null));};exports[_0x2d38('0x43')]=function(_0x3d8176,_0x52b0aa){var _0x49ec99={'raw':!![],'where':{'id':_0x3d8176['params']['id']}},_0xc83d8d={};_0xc83d8d['model']=_['keys'](db[_0x2d38('0x3f')][_0x2d38('0x44')]);_0xc83d8d[_0x2d38('0x33')]=_['keys'](_0x3d8176['query']);_0xc83d8d[_0x2d38('0x35')]=_[_0x2d38('0x36')](_0xc83d8d[_0x2d38('0x32')],_0xc83d8d[_0x2d38('0x33')]);_0x49ec99['attributes']=_['intersection'](_0xc83d8d['model'],qs[_0x2d38('0x45')](_0x3d8176['query'][_0x2d38('0x45')]));_0x49ec99['attributes']=_0x49ec99[_0x2d38('0x37')][_0x2d38('0x46')]?_0x49ec99[_0x2d38('0x37')]:_0xc83d8d[_0x2d38('0x32')];if(_0x3d8176[_0x2d38('0x33')][_0x2d38('0x47')]){_0x49ec99[_0x2d38('0x48')]=[{'all':!![]}];}_0x49ec99=_['merge']({},_0x49ec99,_0x3d8176['options']);return db[_0x2d38('0x3f')][_0x2d38('0x49')](_0x49ec99)['then'](handleEntityNotFound(_0x52b0aa,null))['then'](respondWithResult(_0x52b0aa,null))['catch'](handleError(_0x52b0aa,null));};exports[_0x2d38('0x4a')]=function(_0x49f684,_0x418e1c){return db[_0x2d38('0x3f')]['create'](_0x49f684['body'],{})[_0x2d38('0x26')](respondWithResult(_0x418e1c,0xc9))[_0x2d38('0x42')](handleError(_0x418e1c,null));};exports[_0x2d38('0x25')]=function(_0x4b49d5,_0x332757){if(_0x4b49d5['body']['id']){delete _0x4b49d5[_0x2d38('0x4b')]['id'];}return db[_0x2d38('0x3f')][_0x2d38('0x49')]({'where':{'id':_0x4b49d5['params']['id']}})[_0x2d38('0x26')](handleEntityNotFound(_0x332757,null))[_0x2d38('0x26')](saveUpdates(_0x4b49d5[_0x2d38('0x4b')],null))['then'](respondWithResult(_0x332757,null))[_0x2d38('0x42')](handleError(_0x332757,null));};exports['destroy']=function(_0x1ad999,_0x2c8547){return db['VoiceDialReport'][_0x2d38('0x49')]({'where':{'id':_0x1ad999['params']['id']}})[_0x2d38('0x26')](handleEntityNotFound(_0x2c8547,null))['then'](removeEntity(_0x2c8547,null))[_0x2d38('0x42')](handleError(_0x2c8547,null));};exports['describe']=function(_0x34fae4,_0x5f4d6e){return db['VoiceDialReport']['describe']()[_0x2d38('0x26')](respondWithResult(_0x5f4d6e,null))['catch'](handleError(_0x5f4d6e,null));}; \ No newline at end of file +var _0x7d46=['apply','save','update','then','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','create','body','find','destroy','describe','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','set'];(function(_0x11b5cf,_0xb44a04){var _0x45f33d=function(_0x27a181){while(--_0x27a181){_0x11b5cf['push'](_0x11b5cf['shift']());}};_0x45f33d(++_0xb44a04);}(_0x7d46,0x187));var _0x67d4=function(_0x5f3905,_0x43a651){_0x5f3905=_0x5f3905-0x0;var _0x2923b1=_0x7d46[_0x5f3905];return _0x2923b1;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x67d4('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x67d4('0x1'));var moment=require(_0x67d4('0x2'));var BPromise=require(_0x67d4('0x3'));var Mustache=require(_0x67d4('0x4'));var util=require(_0x67d4('0x5'));var path=require(_0x67d4('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x67d4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x67d4('0x8'));var crypto=require(_0x67d4('0x9'));var jsforce=require(_0x67d4('0xa'));var deskjs=require(_0x67d4('0xb'));var toCsv=require('to-csv');var querystring=require(_0x67d4('0xc'));var Papa=require('papaparse');var Redis=require(_0x67d4('0xd'));var authService=require(_0x67d4('0xe'));var qs=require(_0x67d4('0xf'));var as=require(_0x67d4('0x10'));var hardwareService=require(_0x67d4('0x11'));var logger=require('../../config/logger')(_0x67d4('0x12'));var utils=require('../../config/utils');var config=require(_0x67d4('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x474f24,_0x1ef770){_0x1ef770=_0x1ef770||0xcc;return function(_0x47862b){if(_0x47862b){return _0x474f24[_0x67d4('0x14')](_0x1ef770);}return _0x474f24[_0x67d4('0x15')](_0x1ef770)[_0x67d4('0x16')]();};}function respondWithResult(_0x2a81ce,_0x9d48d6){_0x9d48d6=_0x9d48d6||0xc8;return function(_0x150bc8){if(_0x150bc8){return _0x2a81ce[_0x67d4('0x15')](_0x9d48d6)[_0x67d4('0x17')](_0x150bc8);}};}function respondWithFilteredResult(_0xc2b0a0,_0x4bda83){return function(_0x35e4a0){if(_0x35e4a0){var _0x37e1e2=typeof _0x4bda83[_0x67d4('0x18')]==='undefined'&&typeof _0x4bda83[_0x67d4('0x19')]===_0x67d4('0x1a');var _0x3e2d90=_0x35e4a0['count'];var _0x1a4443=_0x37e1e2?0x0:_0x4bda83['offset'];var _0x1e9b06=_0x37e1e2?_0x35e4a0[_0x67d4('0x1b')]:_0x4bda83[_0x67d4('0x18')]+_0x4bda83[_0x67d4('0x19')];var _0x42787d;if(_0x1e9b06>=_0x3e2d90){_0x1e9b06=_0x3e2d90;_0x42787d=0xc8;}else{_0x42787d=0xce;}_0xc2b0a0[_0x67d4('0x15')](_0x42787d);return _0xc2b0a0[_0x67d4('0x1c')]('Content-Range',_0x1a4443+'-'+_0x1e9b06+'/'+_0x3e2d90)['json'](_0x35e4a0);}return null;};}function patchUpdates(_0x288291){return function(_0x54e7cd){try{jsonpatch[_0x67d4('0x1d')](_0x54e7cd,_0x288291,!![]);}catch(_0x538201){return BPromise['reject'](_0x538201);}return _0x54e7cd[_0x67d4('0x1e')]();};}function saveUpdates(_0x598117,_0x50c94c){return function(_0x3be796){if(_0x3be796){return _0x3be796[_0x67d4('0x1f')](_0x598117)[_0x67d4('0x20')](function(_0x512b42){return _0x512b42;});}return null;};}function removeEntity(_0x2459e3,_0x10cce7){return function(_0x20d66c){if(_0x20d66c){return _0x20d66c['destroy']()['then'](function(){_0x2459e3[_0x67d4('0x15')](0xcc)[_0x67d4('0x16')]();});}};}function handleEntityNotFound(_0x101d1e,_0x35115d){return function(_0x3c7e0b){if(!_0x3c7e0b){_0x101d1e[_0x67d4('0x14')](0x194);}return _0x3c7e0b;};}function handleError(_0x99974b,_0x7381af){_0x7381af=_0x7381af||0x1f4;return function(_0x28433a){logger[_0x67d4('0x21')](_0x28433a[_0x67d4('0x22')]);if(_0x28433a[_0x67d4('0x23')]){delete _0x28433a[_0x67d4('0x23')];}_0x99974b[_0x67d4('0x15')](_0x7381af)[_0x67d4('0x24')](_0x28433a);};}exports[_0x67d4('0x25')]=function(_0x3bf4ad,_0x27f659){var _0x590c83={},_0x351412={},_0x4e99cc={'count':0x0,'rows':[]};var _0x5b4c3a=_[_0x67d4('0x26')](db[_0x67d4('0x27')][_0x67d4('0x28')],function(_0x533bd9){return{'name':_0x533bd9['fieldName'],'type':_0x533bd9[_0x67d4('0x29')][_0x67d4('0x2a')]};});_0x351412[_0x67d4('0x2b')]=_[_0x67d4('0x26')](_0x5b4c3a,_0x67d4('0x23'));_0x351412['query']=_[_0x67d4('0x2c')](_0x3bf4ad['query']);_0x351412[_0x67d4('0x2d')]=_[_0x67d4('0x2e')](_0x351412[_0x67d4('0x2b')],_0x351412[_0x67d4('0x2f')]);_0x590c83[_0x67d4('0x30')]=_[_0x67d4('0x2e')](_0x351412[_0x67d4('0x2b')],qs['fields'](_0x3bf4ad['query'][_0x67d4('0x31')]));_0x590c83[_0x67d4('0x30')]=_0x590c83['attributes']['length']?_0x590c83[_0x67d4('0x30')]:_0x351412['model'];if(!_0x3bf4ad[_0x67d4('0x2f')]['hasOwnProperty'](_0x67d4('0x32'))){_0x590c83[_0x67d4('0x19')]=qs['limit'](_0x3bf4ad[_0x67d4('0x2f')][_0x67d4('0x19')]);_0x590c83['offset']=qs[_0x67d4('0x18')](_0x3bf4ad[_0x67d4('0x2f')][_0x67d4('0x18')]);}_0x590c83['order']=qs['sort'](_0x3bf4ad[_0x67d4('0x2f')][_0x67d4('0x33')]);_0x590c83[_0x67d4('0x34')]=qs[_0x67d4('0x2d')](_[_0x67d4('0x35')](_0x3bf4ad[_0x67d4('0x2f')],_0x351412[_0x67d4('0x2d')]),_0x5b4c3a);if(_0x3bf4ad[_0x67d4('0x2f')][_0x67d4('0x36')]){_0x590c83[_0x67d4('0x34')]=_[_0x67d4('0x37')](_0x590c83[_0x67d4('0x34')],{'$or':_[_0x67d4('0x26')](_0x5b4c3a,function(_0x23793a){if(_0x23793a[_0x67d4('0x29')]!==_0x67d4('0x38')){var _0x524047={};_0x524047[_0x23793a[_0x67d4('0x23')]]={'$like':'%'+_0x3bf4ad['query'][_0x67d4('0x36')]+'%'};return _0x524047;}})});}_0x590c83=_[_0x67d4('0x37')]({},_0x590c83,_0x3bf4ad[_0x67d4('0x39')]);var _0x5921ac={'where':_0x590c83[_0x67d4('0x34')]};return db['VoiceDialReport']['count'](_0x5921ac)[_0x67d4('0x20')](function(_0x3bf6de){_0x4e99cc[_0x67d4('0x1b')]=_0x3bf6de;if(_0x3bf4ad[_0x67d4('0x2f')][_0x67d4('0x3a')]){_0x590c83[_0x67d4('0x3b')]=[{'all':!![]}];}return db[_0x67d4('0x27')][_0x67d4('0x3c')](_0x590c83);})['then'](function(_0xdda2a4){_0x4e99cc[_0x67d4('0x3d')]=_0xdda2a4;return _0x4e99cc;})['then'](respondWithFilteredResult(_0x27f659,_0x590c83))[_0x67d4('0x3e')](handleError(_0x27f659,null));};exports['show']=function(_0x373eaa,_0x10abe7){var _0x483ab3={'raw':!![],'where':{'id':_0x373eaa[_0x67d4('0x3f')]['id']}},_0x95581={};_0x95581[_0x67d4('0x2b')]=_[_0x67d4('0x2c')](db[_0x67d4('0x27')][_0x67d4('0x28')]);_0x95581[_0x67d4('0x2f')]=_[_0x67d4('0x2c')](_0x373eaa['query']);_0x95581[_0x67d4('0x2d')]=_['intersection'](_0x95581[_0x67d4('0x2b')],_0x95581['query']);_0x483ab3[_0x67d4('0x30')]=_[_0x67d4('0x2e')](_0x95581[_0x67d4('0x2b')],qs[_0x67d4('0x31')](_0x373eaa[_0x67d4('0x2f')][_0x67d4('0x31')]));_0x483ab3['attributes']=_0x483ab3[_0x67d4('0x30')][_0x67d4('0x40')]?_0x483ab3['attributes']:_0x95581['model'];if(_0x373eaa[_0x67d4('0x2f')][_0x67d4('0x3a')]){_0x483ab3[_0x67d4('0x3b')]=[{'all':!![]}];}_0x483ab3=_[_0x67d4('0x37')]({},_0x483ab3,_0x373eaa[_0x67d4('0x39')]);return db[_0x67d4('0x27')]['find'](_0x483ab3)[_0x67d4('0x20')](handleEntityNotFound(_0x10abe7,null))[_0x67d4('0x20')](respondWithResult(_0x10abe7,null))['catch'](handleError(_0x10abe7,null));};exports[_0x67d4('0x41')]=function(_0x3b4fb1,_0x561857){return db[_0x67d4('0x27')][_0x67d4('0x41')](_0x3b4fb1['body'],{})[_0x67d4('0x20')](respondWithResult(_0x561857,0xc9))[_0x67d4('0x3e')](handleError(_0x561857,null));};exports[_0x67d4('0x1f')]=function(_0x1b8149,_0x39ed73){if(_0x1b8149['body']['id']){delete _0x1b8149[_0x67d4('0x42')]['id'];}return db[_0x67d4('0x27')][_0x67d4('0x43')]({'where':{'id':_0x1b8149[_0x67d4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x39ed73,null))[_0x67d4('0x20')](saveUpdates(_0x1b8149[_0x67d4('0x42')],null))[_0x67d4('0x20')](respondWithResult(_0x39ed73,null))[_0x67d4('0x3e')](handleError(_0x39ed73,null));};exports[_0x67d4('0x44')]=function(_0x4624a6,_0x51c31f){return db[_0x67d4('0x27')][_0x67d4('0x43')]({'where':{'id':_0x4624a6['params']['id']}})[_0x67d4('0x20')](handleEntityNotFound(_0x51c31f,null))[_0x67d4('0x20')](removeEntity(_0x51c31f,null))[_0x67d4('0x3e')](handleError(_0x51c31f,null));};exports[_0x67d4('0x45')]=function(_0x4b9e9e,_0x1671c6){return db['VoiceDialReport']['describe']()['then'](respondWithResult(_0x1671c6,null))[_0x67d4('0x3e')](handleError(_0x1671c6,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index d3fd51b..42863b6 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 _0x6317=['request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x55abd9,_0x1148af){var _0x3e5669=function(_0x6f2105){while(--_0x6f2105){_0x55abd9['push'](_0x55abd9['shift']());}};_0x3e5669(++_0x1148af);}(_0x6317,0x11a));var _0x7631=function(_0x13c308,_0x5d6285){_0x13c308=_0x13c308-0x0;var _0x5d3080=_0x6317[_0x13c308];return _0x5d3080;};'use strict';var _=require(_0x7631('0x0'));var util=require(_0x7631('0x1'));var logger=require(_0x7631('0x2'))(_0x7631('0x3'));var moment=require(_0x7631('0x4'));var BPromise=require(_0x7631('0x5'));var rp=require(_0x7631('0x6'));var fs=require('fs');var path=require(_0x7631('0x7'));var rimraf=require(_0x7631('0x8'));var config=require(_0x7631('0x9'));var attributes=require(_0x7631('0xa'));module[_0x7631('0xb')]=function(_0x50fd37,_0x4870ae){return _0x50fd37[_0x7631('0xc')](_0x7631('0xd'),attributes,{'tableName':_0x7631('0xe'),'paranoid':![],'indexes':[{'fields':[_0x7631('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfdef=['define','VoiceDialReport','uniqueid','lodash','../../config/logger','api','rimraf','../../config/environment'];(function(_0x579a52,_0x37605d){var _0xca693b=function(_0x5b161d){while(--_0x5b161d){_0x579a52['push'](_0x579a52['shift']());}};_0xca693b(++_0x37605d);}(_0xfdef,0x17b));var _0xffde=function(_0x5518c8,_0x19c9f5){_0x5518c8=_0x5518c8-0x0;var _0x5c39d9=_0xfdef[_0x5518c8];return _0x5c39d9;};'use strict';var _=require(_0xffde('0x0'));var util=require('util');var logger=require(_0xffde('0x1'))(_0xffde('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(_0xffde('0x3'));var config=require(_0xffde('0x4'));var attributes=require('./voiceDialReport.attributes');module['exports']=function(_0x37e216,_0x32107d){return _0x37e216[_0xffde('0x5')](_0xffde('0x6'),attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xffde('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 55410d3..910c857 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 _0x598b=['debug','update','where','attributes','limit','UpdateVoiceDialReport','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','VoiceDialReport,\x20%s,\x20%s','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw'];(function(_0xdc7003,_0x570d3b){var _0x4fa246=function(_0x4f6057){while(--_0x4f6057){_0xdc7003['push'](_0xdc7003['shift']());}};_0x4fa246(++_0x570d3b);}(_0x598b,0x12f));var _0xb598=function(_0x48f061,_0x7d83fc){_0x48f061=_0x48f061-0x0;var _0x3e16c2=_0x598b[_0x48f061];return _0x3e16c2;};'use strict';var _=require(_0xb598('0x0'));var util=require(_0xb598('0x1'));var moment=require('moment');var BPromise=require(_0xb598('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb598('0x3'));var db=require(_0xb598('0x4'))['db'];var utils=require(_0xb598('0x5'));var logger=require(_0xb598('0x6'))(_0xb598('0x7'));var config=require(_0xb598('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb598('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x170b6a,_0x4d42bd,_0x1c6eed){return new BPromise(function(_0x2a6089,_0x306245){return client[_0xb598('0xa')](_0x170b6a,_0x1c6eed)[_0xb598('0xb')](function(_0x160317){logger[_0xb598('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x4d42bd,'request\x20sent');logger['debug'](_0xb598('0xd'),_0x4d42bd,_0xb598('0xe'),JSON[_0xb598('0xf')](_0x160317));if(_0x160317[_0xb598('0x10')]){if(_0x160317[_0xb598('0x10')]['code']===0x1f4){logger[_0xb598('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x4d42bd,_0x160317['error'][_0xb598('0x11')]);return _0x306245(_0x160317[_0xb598('0x10')][_0xb598('0x11')]);}logger[_0xb598('0x10')](_0xb598('0x12'),_0x4d42bd,_0x160317['error'][_0xb598('0x11')]);return _0x2a6089(_0x160317[_0xb598('0x10')][_0xb598('0x11')]);}else{logger[_0xb598('0xc')](_0xb598('0x12'),_0x4d42bd,'request\x20sent');_0x2a6089(_0x160317[_0xb598('0x13')][_0xb598('0x11')]);}})[_0xb598('0x14')](function(_0x20f36b){logger['error'](_0xb598('0x12'),_0x4d42bd,_0x20f36b);_0x306245(_0x20f36b);});});}exports[_0xb598('0x15')]=function(_0x3c97a4){var _0x287511=this;return new Promise(function(_0x5661b3,_0xb1a78a){return db[_0xb598('0x16')][_0xb598('0x17')](_0x3c97a4[_0xb598('0x18')],{'raw':_0x3c97a4['options']?_0x3c97a4[_0xb598('0x19')][_0xb598('0x1a')]===undefined?!![]:![]:!![]})[_0xb598('0xb')](function(_0x5764c9){logger[_0xb598('0xc')](_0xb598('0x15'),_0x3c97a4);logger[_0xb598('0x1b')]('CreateVoiceDialReport',_0x3c97a4,JSON['stringify'](_0x5764c9));_0x5661b3(_0x5764c9);})[_0xb598('0x14')](function(_0x5aa7b8){logger[_0xb598('0x10')](_0xb598('0x15'),_0x5aa7b8['message'],_0x3c97a4);_0xb1a78a(_0x287511[_0xb598('0x10')](0x1f4,_0x5aa7b8[_0xb598('0x11')]));});});};exports['UpdateVoiceDialReport']=function(_0x5beb5c){var _0x8dc788=this;return new Promise(function(_0x3c3944,_0x306140){return db[_0xb598('0x16')][_0xb598('0x1c')](_0x5beb5c[_0xb598('0x18')],{'raw':_0x5beb5c[_0xb598('0x19')]?_0x5beb5c[_0xb598('0x19')][_0xb598('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5beb5c[_0xb598('0x19')]?_0x5beb5c[_0xb598('0x19')][_0xb598('0x1d')]||null:null,'attributes':_0x5beb5c[_0xb598('0x19')]?_0x5beb5c[_0xb598('0x19')][_0xb598('0x1e')]||null:null,'limit':_0x5beb5c['options']?_0x5beb5c[_0xb598('0x19')][_0xb598('0x1f')]||null:null})[_0xb598('0xb')](function(_0x295fda){logger['info']('UpdateVoiceDialReport',_0x5beb5c);logger[_0xb598('0x1b')](_0xb598('0x20'),_0x5beb5c,JSON[_0xb598('0xf')](_0x295fda));_0x3c3944(_0x295fda);})['catch'](function(_0x8d081){logger[_0xb598('0x10')](_0xb598('0x20'),_0x8d081[_0xb598('0x11')],_0x5beb5c);_0x306140(_0x8dc788['error'](0x1f4,_0x8d081[_0xb598('0x11')]));});});}; \ No newline at end of file +var _0xdac9=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','VoiceDialReport','create','body','options','raw','CreateVoiceDialReport','UpdateVoiceDialReport','update','where','then'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0xdac9,0x1ce));var _0x9dac=function(_0x18fb16,_0x45edbc){_0x18fb16=_0x18fb16-0x0;var _0x147b0d=_0xdac9[_0x18fb16];return _0x147b0d;};'use strict';var _=require(_0x9dac('0x0'));var util=require(_0x9dac('0x1'));var moment=require(_0x9dac('0x2'));var BPromise=require(_0x9dac('0x3'));var rs=require(_0x9dac('0x4'));var fs=require('fs');var Redis=require(_0x9dac('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9dac('0x6'));var logger=require(_0x9dac('0x7'))(_0x9dac('0x8'));var config=require(_0x9dac('0x9'));var jayson=require(_0x9dac('0xa'));var client=jayson[_0x9dac('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x50c329,_0x222888,_0xe3f39){return new BPromise(function(_0x3f077d,_0x2a4924){return client[_0x9dac('0xc')](_0x50c329,_0xe3f39)['then'](function(_0x367ce1){logger['info'](_0x9dac('0xd'),_0x222888,_0x9dac('0xe'));logger[_0x9dac('0xf')](_0x9dac('0x10'),_0x222888,_0x9dac('0xe'),JSON[_0x9dac('0x11')](_0x367ce1));if(_0x367ce1[_0x9dac('0x12')]){if(_0x367ce1[_0x9dac('0x12')]['code']===0x1f4){logger[_0x9dac('0x12')](_0x9dac('0xd'),_0x222888,_0x367ce1[_0x9dac('0x12')]['message']);return _0x2a4924(_0x367ce1[_0x9dac('0x12')][_0x9dac('0x13')]);}logger['error'](_0x9dac('0xd'),_0x222888,_0x367ce1[_0x9dac('0x12')][_0x9dac('0x13')]);return _0x3f077d(_0x367ce1['error'][_0x9dac('0x13')]);}else{logger[_0x9dac('0x14')]('VoiceDialReport,\x20%s,\x20%s',_0x222888,_0x9dac('0xe'));_0x3f077d(_0x367ce1[_0x9dac('0x15')][_0x9dac('0x13')]);}})[_0x9dac('0x16')](function(_0xba2685){logger[_0x9dac('0x12')](_0x9dac('0xd'),_0x222888,_0xba2685);_0x2a4924(_0xba2685);});});}exports['CreateVoiceDialReport']=function(_0x17bd76){var _0x57768e=this;return new Promise(function(_0x5266fe,_0x589867){return db[_0x9dac('0x17')][_0x9dac('0x18')](_0x17bd76[_0x9dac('0x19')],{'raw':_0x17bd76[_0x9dac('0x1a')]?_0x17bd76[_0x9dac('0x1a')][_0x9dac('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x33ceb3){logger[_0x9dac('0x14')](_0x9dac('0x1c'),_0x17bd76);logger[_0x9dac('0xf')]('CreateVoiceDialReport',_0x17bd76,JSON[_0x9dac('0x11')](_0x33ceb3));_0x5266fe(_0x33ceb3);})['catch'](function(_0x2621d5){logger[_0x9dac('0x12')](_0x9dac('0x1c'),_0x2621d5[_0x9dac('0x13')],_0x17bd76);_0x589867(_0x57768e[_0x9dac('0x12')](0x1f4,_0x2621d5['message']));});});};exports[_0x9dac('0x1d')]=function(_0xb03a24){var _0x24f160=this;return new Promise(function(_0x3d0f6e,_0x4b58fe){return db['VoiceDialReport'][_0x9dac('0x1e')](_0xb03a24['body'],{'raw':_0xb03a24[_0x9dac('0x1a')]?_0xb03a24[_0x9dac('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb03a24[_0x9dac('0x1a')]?_0xb03a24['options'][_0x9dac('0x1f')]||null:null,'attributes':_0xb03a24[_0x9dac('0x1a')]?_0xb03a24['options']['attributes']||null:null,'limit':_0xb03a24['options']?_0xb03a24[_0x9dac('0x1a')]['limit']||null:null})[_0x9dac('0x20')](function(_0x303dd4){logger[_0x9dac('0x14')](_0x9dac('0x1d'),_0xb03a24);logger[_0x9dac('0xf')]('UpdateVoiceDialReport',_0xb03a24,JSON[_0x9dac('0x11')](_0x303dd4));_0x3d0f6e(_0x303dd4);})[_0x9dac('0x16')](function(_0x5cd883){logger[_0x9dac('0x12')](_0x9dac('0x1d'),_0x5cd883['message'],_0xb03a24);_0x4b58fe(_0x24f160[_0x9dac('0x12')](0x1f4,_0x5cd883[_0x9dac('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index d1b7db1..ad04bbc 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 _0x7bc8=['express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','post','/:id/applications','addApplications','put','update','destroy','exports','multer','util','path'];(function(_0x22cf4c,_0x2e805c){var _0x338cc2=function(_0x3b0a45){while(--_0x3b0a45){_0x22cf4c['push'](_0x22cf4c['shift']());}};_0x338cc2(++_0x2e805c);}(_0x7bc8,0x189));var _0x87bc=function(_0x3aaf69,_0x318ff9){_0x3aaf69=_0x3aaf69-0x0;var _0x4542c6=_0x7bc8[_0x3aaf69];return _0x4542c6;};'use strict';var multer=require(_0x87bc('0x0'));var util=require(_0x87bc('0x1'));var path=require(_0x87bc('0x2'));var timeout=require('connect-timeout');var express=require(_0x87bc('0x3'));var router=express[_0x87bc('0x4')]();var fs_extra=require(_0x87bc('0x5'));var auth=require(_0x87bc('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceExtension.controller');router[_0x87bc('0x7')]('/',auth[_0x87bc('0x8')](),controller[_0x87bc('0x9')]);router['get'](_0x87bc('0xa'),auth[_0x87bc('0x8')](),controller['show']);router[_0x87bc('0xb')]('/',auth[_0x87bc('0x8')](),controller['create']);router['post'](_0x87bc('0xc'),auth[_0x87bc('0x8')](),controller[_0x87bc('0xd')]);router[_0x87bc('0xe')](_0x87bc('0xa'),auth[_0x87bc('0x8')](),controller[_0x87bc('0xf')]);router['delete'](_0x87bc('0xa'),auth[_0x87bc('0x8')](),controller[_0x87bc('0x10')]);module[_0x87bc('0x11')]=router; \ No newline at end of file +var _0xc049=['create','/:id/applications','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','/:id','show','post'];(function(_0x14672d,_0x593b3e){var _0x21d0b8=function(_0x535a3f){while(--_0x535a3f){_0x14672d['push'](_0x14672d['shift']());}};_0x21d0b8(++_0x593b3e);}(_0xc049,0x8c));var _0x9c04=function(_0x4ca42d,_0x19fdb0){_0x4ca42d=_0x4ca42d-0x0;var _0x53c5ac=_0xc049[_0x4ca42d];return _0x53c5ac;};'use strict';var multer=require(_0x9c04('0x0'));var util=require(_0x9c04('0x1'));var path=require(_0x9c04('0x2'));var timeout=require(_0x9c04('0x3'));var express=require(_0x9c04('0x4'));var router=express[_0x9c04('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9c04('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceExtension.controller');router[_0x9c04('0x7')]('/',auth[_0x9c04('0x8')](),controller[_0x9c04('0x9')]);router[_0x9c04('0x7')](_0x9c04('0xa'),auth[_0x9c04('0x8')](),controller[_0x9c04('0xb')]);router[_0x9c04('0xc')]('/',auth['isAuthenticated'](),controller[_0x9c04('0xd')]);router[_0x9c04('0xc')](_0x9c04('0xe'),auth[_0x9c04('0x8')](),controller['addApplications']);router['put'](_0x9c04('0xa'),auth[_0x9c04('0x8')](),controller[_0x9c04('0xf')]);router['delete'](_0x9c04('0xa'),auth[_0x9c04('0x8')](),controller['destroy']);module[_0x9c04('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 86ccc05..c37bd8e 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 _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file +var _0xb7e7=['BOOLEAN','wav','VIRTUAL','getDataValue','sequelize','STRING','NoOp','inbound','outbound','internal','outbound-fax','system','any','*,*,*,*','INTEGER'];(function(_0x2ab7a8,_0x177682){var _0x342299=function(_0x1ab348){while(--_0x1ab348){_0x2ab7a8['push'](_0x2ab7a8['shift']());}};_0x342299(++_0x177682);}(_0xb7e7,0x121));var _0x7b7e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb7e7[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'context':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'defaultValue':_0x7b7e('0x2')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x7b7e('0x3'),_0x7b7e('0x4'),_0x7b7e('0x5'),'inbound-fax',_0x7b7e('0x6'),_0x7b7e('0x7'),_0x7b7e('0x8')),'allowNull':![]},'description':{'type':Sequelize[_0x7b7e('0x1')]},'interval':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'defaultValue':_0x7b7e('0x9')},'IntervalId':{'type':Sequelize[_0x7b7e('0xa')]},'isApp':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x7b7e('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x7b7e('0xa')]},'recordingFormat':{'type':Sequelize[_0x7b7e('0x1')],'defaultValue':_0x7b7e('0xc')},'answer':{'type':Sequelize[_0x7b7e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x7b7e('0xd')],'get':function(){return this[_0x7b7e('0xe')]('exten');}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 2026aa6..46e3aa0 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 _0x608f=['findAll','rows','catch','show','params','keys','find','body','outbound','exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','InboundRoutes','InternalRoutes','internal','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','recordingFormat','mandatoryDisposition','alias','context','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','status','json','offset','undefined','count','set','Content-Range','destroy','then','inbound','OutboundRoutes','map','value','includes','type','name','UserProfileResource','error','send','index','VoiceExtension','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','nolimit','limit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include'];(function(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0x608f,0x137));var _0xf608=function(_0x1ffd30,_0x74e65c){_0x1ffd30=_0x1ffd30-0x0;var _0xf06205=_0x608f[_0x1ffd30];return _0xf06205;};'use strict';var _=require('lodash');var Redis=require(_0xf608('0x0'));var qs=require(_0xf608('0x1'));var logger=require(_0xf608('0x2'))('api');var config=require(_0xf608('0x3'));var db=require('../../mysqldb')['db'];config[_0xf608('0x4')]=_[_0xf608('0x5')](config[_0xf608('0x4')],{'host':_0xf608('0x6'),'port':0x18eb});var socket=require(_0xf608('0x7'))(new Redis(config['redis']));require(_0xf608('0x8'))[_0xf608('0x9')](socket);function respondWithStatusCode(_0x3b47dd,_0x1ee944){_0x1ee944=_0x1ee944||0xcc;return function(_0x457cb0){if(_0x457cb0){return _0x3b47dd[_0xf608('0xa')](_0x1ee944);}return _0x3b47dd[_0xf608('0xb')](_0x1ee944)['end']();};}function respondWithResult(_0x2f6896,_0x3ca217){_0x3ca217=_0x3ca217||0xc8;return function(_0x312506){if(_0x312506){return _0x2f6896[_0xf608('0xb')](_0x3ca217)[_0xf608('0xc')](_0x312506);}};}function respondWithFilteredResult(_0x81c63e,_0x1e701b){return function(_0x3837ff){if(_0x3837ff){var _0x432670=typeof _0x1e701b[_0xf608('0xd')]===_0xf608('0xe')&&typeof _0x1e701b['limit']===_0xf608('0xe');var _0x3b7b32=_0x3837ff['count'];var _0x4937f3=_0x432670?0x0:_0x1e701b[_0xf608('0xd')];var _0x39e366=_0x432670?_0x3837ff[_0xf608('0xf')]:_0x1e701b[_0xf608('0xd')]+_0x1e701b['limit'];var _0x442d2c;if(_0x39e366>=_0x3b7b32){_0x39e366=_0x3b7b32;_0x442d2c=0xc8;}else{_0x442d2c=0xce;}_0x81c63e[_0xf608('0xb')](_0x442d2c);return _0x81c63e[_0xf608('0x10')](_0xf608('0x11'),_0x4937f3+'-'+_0x39e366+'/'+_0x3b7b32)[_0xf608('0xc')](_0x3837ff);}return null;};}function removeEntity(_0x1e75ff){return function(_0x1956ad){if(_0x1956ad){return _0x1956ad[_0xf608('0x12')]()[_0xf608('0x13')](function(){var _0x14cea1=_0x1956ad['get']({'plain':!![]});var _0x2bc33b=[{'name':'InboundRoutes','value':_0xf608('0x14'),'ignore':![]},{'name':_0xf608('0x15'),'value':'outbound','ignore':![]},{'name':'InternalRoutes','value':'internal','ignore':![]}];var _0x59b8d9=_(_0x2bc33b)['filter']('ignore')[_0xf608('0x16')](_0xf608('0x17'))['value']();if(_[_0xf608('0x18')](_0x59b8d9,_0x14cea1[_0xf608('0x19')])){return;}var _0x1a68d8=_['find'](_0x2bc33b,[_0xf608('0x17'),_0x14cea1[_0xf608('0x19')]])[_0xf608('0x1a')];return db[_0xf608('0x1b')][_0xf608('0x12')]({'where':{'type':_0x1a68d8,'resourceId':_0x14cea1['id']}})[_0xf608('0x13')](function(){return _0x1956ad;});})['then'](function(){_0x1e75ff[_0xf608('0xb')](0xcc)['end']();});}};}function handleEntityNotFound(_0x471e0d){return function(_0x200577){if(!_0x200577){_0x471e0d[_0xf608('0xa')](0x194);}return _0x200577;};}function handleError(_0x22a795,_0x4c26b2){_0x4c26b2=_0x4c26b2||0x1f4;return function(_0x39ee0e){logger[_0xf608('0x1c')](_0x39ee0e['stack']);if(_0x39ee0e[_0xf608('0x1a')]){delete _0x39ee0e[_0xf608('0x1a')];}_0x22a795['status'](_0x4c26b2)[_0xf608('0x1d')](_0x39ee0e);};}exports[_0xf608('0x1e')]=function(_0x3a7ee3,_0x2dd06c){var _0x2f5846={},_0x168876={},_0x2b03d7={'count':0x0,'rows':[]};var _0x43dbad=_[_0xf608('0x16')](db[_0xf608('0x1f')][_0xf608('0x20')],function(_0x88bcf6){return{'name':_0x88bcf6[_0xf608('0x21')],'type':_0x88bcf6[_0xf608('0x19')][_0xf608('0x22')]};});_0x168876[_0xf608('0x23')]=_['map'](_0x43dbad,_0xf608('0x1a'));_0x168876[_0xf608('0x24')]=_['keys'](_0x3a7ee3[_0xf608('0x24')]);_0x168876['filters']=_[_0xf608('0x25')](_0x168876[_0xf608('0x23')],_0x168876['query']);_0x2f5846[_0xf608('0x26')]=_[_0xf608('0x25')](_0x168876[_0xf608('0x23')],qs[_0xf608('0x27')](_0x3a7ee3[_0xf608('0x24')][_0xf608('0x27')]));_0x2f5846[_0xf608('0x26')]=_0x2f5846[_0xf608('0x26')]['length']?_0x2f5846['attributes']:_0x168876[_0xf608('0x23')];if(!_0x3a7ee3[_0xf608('0x24')]['hasOwnProperty'](_0xf608('0x28'))){_0x2f5846['limit']=qs[_0xf608('0x29')](_0x3a7ee3[_0xf608('0x24')][_0xf608('0x29')]);_0x2f5846[_0xf608('0xd')]=qs['offset'](_0x3a7ee3['query']['offset']);}_0x2f5846[_0xf608('0x2a')]=qs[_0xf608('0x2b')](_0x3a7ee3['query'][_0xf608('0x2b')]);_0x2f5846['where']=qs[_0xf608('0x2c')](_[_0xf608('0x2d')](_0x3a7ee3[_0xf608('0x24')],_0x168876[_0xf608('0x2c')]),_0x43dbad);if(_0x3a7ee3[_0xf608('0x24')][_0xf608('0x2e')]){_0x2f5846[_0xf608('0x2f')]=_[_0xf608('0x30')](_0x2f5846[_0xf608('0x2f')],{'$or':_[_0xf608('0x16')](_0x43dbad,function(_0x573ede){if(_0x573ede['type']!==_0xf608('0x31')){var _0x19df67={};_0x19df67[_0x573ede['name']]={'$like':'%'+_0x3a7ee3[_0xf608('0x24')]['filter']+'%'};return _0x19df67;}})});}_0x2f5846=_[_0xf608('0x30')]({},_0x2f5846,_0x3a7ee3[_0xf608('0x32')]);var _0x5f4265={'where':_0x2f5846[_0xf608('0x2f')]};return db[_0xf608('0x1f')][_0xf608('0xf')](_0x5f4265)['then'](function(_0x19bb95){_0x2b03d7[_0xf608('0xf')]=_0x19bb95;if(_0x3a7ee3[_0xf608('0x24')][_0xf608('0x33')]){_0x2f5846[_0xf608('0x34')]=[{'all':!![]}];}return db[_0xf608('0x1f')][_0xf608('0x35')](_0x2f5846);})[_0xf608('0x13')](function(_0x3d79f9){_0x2b03d7[_0xf608('0x36')]=_0x3d79f9;return _0x2b03d7;})[_0xf608('0x13')](respondWithFilteredResult(_0x2dd06c,_0x2f5846))[_0xf608('0x37')](handleError(_0x2dd06c,null));};exports[_0xf608('0x38')]=function(_0x3a1042,_0x18ca23){var _0x195d69={'raw':![],'where':{'id':_0x3a1042[_0xf608('0x39')]['id']}},_0x1b1c09={};_0x1b1c09[_0xf608('0x23')]=_['keys'](db['VoiceExtension'][_0xf608('0x20')]);_0x1b1c09[_0xf608('0x24')]=_[_0xf608('0x3a')](_0x3a1042[_0xf608('0x24')]);_0x1b1c09[_0xf608('0x2c')]=_[_0xf608('0x25')](_0x1b1c09[_0xf608('0x23')],_0x1b1c09[_0xf608('0x24')]);_0x195d69[_0xf608('0x26')]=_['intersection'](_0x1b1c09[_0xf608('0x23')],qs[_0xf608('0x27')](_0x3a1042[_0xf608('0x24')][_0xf608('0x27')]));_0x195d69[_0xf608('0x26')]=_0x195d69[_0xf608('0x26')]['length']?_0x195d69[_0xf608('0x26')]:_0x1b1c09[_0xf608('0x23')];if(_0x3a1042[_0xf608('0x24')][_0xf608('0x33')]){_0x195d69[_0xf608('0x34')]=[{'all':!![]}];}_0x195d69=_[_0xf608('0x30')]({},_0x195d69,_0x3a1042[_0xf608('0x32')]);return db[_0xf608('0x1f')][_0xf608('0x3b')](_0x195d69)['then'](handleEntityNotFound(_0x18ca23,null))[_0xf608('0x13')](respondWithResult(_0x18ca23,null))['catch'](handleError(_0x18ca23,null));};exports[_0xf608('0x12')]=function(_0x3f5c7f,_0x1881c6){return db['VoiceExtension']['find']({'where':{'id':_0x3f5c7f[_0xf608('0x39')]['id']}})[_0xf608('0x13')](handleEntityNotFound(_0x1881c6,null))[_0xf608('0x13')](removeEntity(_0x1881c6,null))['catch'](handleError(_0x1881c6,null));};exports['create']=function(_0x1594f2,_0x1c8d31){if(_0x1594f2[_0xf608('0x3c')]['type']===_0xf608('0x3d')&&!_['startsWith'](_0x1594f2[_0xf608('0x3c')][_0xf608('0x3e')],'_')){_0x1594f2['body'][_0xf608('0x3e')]='_'[_0xf608('0x3f')](_0x1594f2['body'][_0xf608('0x3e')]);}return db['VoiceExtension'][_0xf608('0x40')](_0x1594f2[_0xf608('0x3c')],{'raw':![]})['then'](function(_0x41ae94){var _0x4996c8=_0x1594f2[_0xf608('0x41')]['get']({'plain':!![]});if(!_0x4996c8)throw new Error(_0xf608('0x42'));if(_0x4996c8['role']===_0xf608('0x41')){var _0x3a8b5d=_0x41ae94[_0xf608('0x43')]({'plain':!![]});var _0x28ce78=[{'name':_0xf608('0x44'),'value':_0xf608('0x14')},{'name':_0xf608('0x15'),'value':_0xf608('0x3d')},{'name':_0xf608('0x45'),'value':_0xf608('0x46')}];var _0x10c717=_[_0xf608('0x3b')](_0x28ce78,[_0xf608('0x17'),_0x3a8b5d[_0xf608('0x19')]])[_0xf608('0x1a')];return db[_0xf608('0x47')]['find']({'where':{'name':_0x10c717,'userProfileId':_0x4996c8[_0xf608('0x48')]},'raw':!![]})[_0xf608('0x13')](function(_0x2fd96b){if(_0x2fd96b&&_0x2fd96b['autoAssociation']===0x0){return db[_0xf608('0x1b')][_0xf608('0x40')]({'name':_0x3a8b5d[_0xf608('0x1a')],'resourceId':_0x3a8b5d['id'],'type':_0x2fd96b[_0xf608('0x1a')],'sectionId':_0x2fd96b['id']},{})[_0xf608('0x13')](function(){return _0x41ae94;});}else{return _0x41ae94;}})['catch'](function(_0x1549a3){logger[_0xf608('0x1c')](_0xf608('0x49'),_0x1549a3);throw _0x1549a3;});}return _0x41ae94;})[_0xf608('0x13')](respondWithResult(_0x1c8d31,0xc9))[_0xf608('0x37')](handleError(_0x1c8d31,null));};exports[_0xf608('0x4a')]=function(_0x1f83b4,_0xefa10a){if(_0x1f83b4[_0xf608('0x3c')]['id']){delete _0x1f83b4[_0xf608('0x3c')]['id'];}return db[_0xf608('0x1f')][_0xf608('0x3b')]({'where':{'id':_0x1f83b4[_0xf608('0x39')]['id']}})['then'](handleEntityNotFound(_0xefa10a,null))[_0xf608('0x13')](function(_0x55c8b5){if(_0x55c8b5){return db['VoiceExtension'][_0xf608('0x4a')](_['pick'](_0x1f83b4[_0xf608('0x3c')],[_0xf608('0x3e'),'context','description',_0xf608('0x4b'),'cutdigits',_0xf608('0x4c'),_0xf608('0x4d')]),{'where':{'context':_0x55c8b5[_0xf608('0x4e')],'exten':_0x55c8b5[_0xf608('0x3e')]},'individualHooks':!![]})['then'](function(_0x411e98){return _0x411e98;});}return null;})[_0xf608('0x13')](respondWithStatusCode(_0xefa10a,null))[_0xf608('0x37')](handleError(_0xefa10a,null));};exports[_0xf608('0x4f')]=function(_0x5e088f,_0x106b3e){var _0x166a37=_0x5e088f['params']['id'];var _0x5a7457=_0x5e088f[_0xf608('0x3c')];var _0x2e1c10=0xc8;var _0xee933d=null;return db[_0xf608('0x50')]['transaction']({'isolationLevel':db[_0xf608('0x50')]['Transaction'][_0xf608('0x51')][_0xf608('0x52')]},function(_0xf3ff35){return db[_0xf608('0x1f')][_0xf608('0x53')]({'where':{'id':_0x166a37},'transaction':_0xf3ff35})[_0xf608('0x13')](function(_0x14fe10){if(_0x14fe10){return db[_0xf608('0x1f')][_0xf608('0x12')]({'where':{'VoiceExtensionId':_0x166a37},'transaction':_0xf3ff35})[_0xf608('0x13')](function(){var _0x29b88f=_['map'](_0x5a7457,function(_0x288119){_0x288119[_0xf608('0x54')]=_0x166a37;_0x288119[_0xf608('0x55')]=!![];return _0x288119;});return _0x14fe10[_0xf608('0x56')](_0x29b88f);})[_0xf608('0x13')](function(_0x4fa528){return db[_0xf608('0x1f')][_0xf608('0x57')](_0x4fa528,{'transaction':_0xf3ff35});});}else{_0x2e1c10=0x194;_0xee933d=[];}});})['then'](function(){if(_0x2e1c10!==0x194){return db[_0xf608('0x1f')][_0xf608('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0x166a37},'order':_0xf608('0x59')})[_0xf608('0x13')](function(_0x374f4c){_0xee933d=_0x374f4c;});}})[_0xf608('0x37')](function(_0x35fab5){_0x2e1c10=0x1f4;logger[_0xf608('0x1c')](_0x35fab5['stack']);if(_0x35fab5[_0xf608('0x1a')]){delete _0x35fab5[_0xf608('0x1a')];}_0xee933d=_0x35fab5;})[_0xf608('0x5a')](function(){if(_0xee933d===null){_0x106b3e[_0xf608('0xa')](_0x2e1c10);}else{if(_0x2e1c10===0x1f4){_0x106b3e[_0xf608('0xb')](_0x2e1c10)['send'](_0xee933d);}else{_0x106b3e['status'](_0x2e1c10)[_0xf608('0xc')](_0xee933d);}}});}; \ No newline at end of file +var _0xeaf2=['end','status','json','offset','limit','undefined','count','Content-Range','destroy','get','inbound','OutboundRoutes','outbound','InternalRoutes','internal','ignore','map','value','includes','find','type','name','UserProfileResource','then','error','stack','VoiceExtension','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','length','create','exten','body','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InboundRoutes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','update','description','recordingFormat','cutdigits','alias','sequelize','transaction','Transaction','READ_COMMITTED','findOne','VoiceExtensionId','createRouting','findAndCountAll','finally','send','ioredis','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xeaf2,0xfe));var _0x2eaf=function(_0x4225aa,_0x582bf2){_0x4225aa=_0x4225aa-0x0;var _0x3f8fab=_0xeaf2[_0x4225aa];return _0x3f8fab;};'use strict';var _=require('lodash');var Redis=require(_0x2eaf('0x0'));var qs=require(_0x2eaf('0x1'));var logger=require('../../config/logger')('api');var config=require(_0x2eaf('0x2'));var db=require(_0x2eaf('0x3'))['db'];config[_0x2eaf('0x4')]=_['defaults'](config[_0x2eaf('0x4')],{'host':_0x2eaf('0x5'),'port':0x18eb});var socket=require(_0x2eaf('0x6'))(new Redis(config[_0x2eaf('0x4')]));require(_0x2eaf('0x7'))[_0x2eaf('0x8')](socket);function respondWithStatusCode(_0x410e72,_0x4a341e){_0x4a341e=_0x4a341e||0xcc;return function(_0x116daa){if(_0x116daa){return _0x410e72[_0x2eaf('0x9')](_0x4a341e);}return _0x410e72['status'](_0x4a341e)[_0x2eaf('0xa')]();};}function respondWithResult(_0x5c29d6,_0x442473){_0x442473=_0x442473||0xc8;return function(_0x36855b){if(_0x36855b){return _0x5c29d6[_0x2eaf('0xb')](_0x442473)[_0x2eaf('0xc')](_0x36855b);}};}function respondWithFilteredResult(_0x42344d,_0x3c0b42){return function(_0x380ca8){if(_0x380ca8){var _0x57e5b9=typeof _0x3c0b42[_0x2eaf('0xd')]==='undefined'&&typeof _0x3c0b42[_0x2eaf('0xe')]===_0x2eaf('0xf');var _0x21f55a=_0x380ca8[_0x2eaf('0x10')];var _0x2c61cd=_0x57e5b9?0x0:_0x3c0b42[_0x2eaf('0xd')];var _0x46ff7c=_0x57e5b9?_0x380ca8[_0x2eaf('0x10')]:_0x3c0b42['offset']+_0x3c0b42[_0x2eaf('0xe')];var _0xaeeefa;if(_0x46ff7c>=_0x21f55a){_0x46ff7c=_0x21f55a;_0xaeeefa=0xc8;}else{_0xaeeefa=0xce;}_0x42344d[_0x2eaf('0xb')](_0xaeeefa);return _0x42344d['set'](_0x2eaf('0x11'),_0x2c61cd+'-'+_0x46ff7c+'/'+_0x21f55a)[_0x2eaf('0xc')](_0x380ca8);}return null;};}function removeEntity(_0x613a18){return function(_0x17cbb8){if(_0x17cbb8){return _0x17cbb8[_0x2eaf('0x12')]()['then'](function(){var _0xa5df54=_0x17cbb8[_0x2eaf('0x13')]({'plain':!![]});var _0x37162b=[{'name':'InboundRoutes','value':_0x2eaf('0x14'),'ignore':![]},{'name':_0x2eaf('0x15'),'value':_0x2eaf('0x16'),'ignore':![]},{'name':_0x2eaf('0x17'),'value':_0x2eaf('0x18'),'ignore':![]}];var _0x3ace03=_(_0x37162b)['filter'](_0x2eaf('0x19'))[_0x2eaf('0x1a')](_0x2eaf('0x1b'))[_0x2eaf('0x1b')]();if(_[_0x2eaf('0x1c')](_0x3ace03,_0xa5df54['type'])){return;}var _0x12acde=_[_0x2eaf('0x1d')](_0x37162b,['value',_0xa5df54[_0x2eaf('0x1e')]])[_0x2eaf('0x1f')];return db[_0x2eaf('0x20')][_0x2eaf('0x12')]({'where':{'type':_0x12acde,'resourceId':_0xa5df54['id']}})[_0x2eaf('0x21')](function(){return _0x17cbb8;});})[_0x2eaf('0x21')](function(){_0x613a18['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x319ad4){return function(_0x123de5){if(!_0x123de5){_0x319ad4[_0x2eaf('0x9')](0x194);}return _0x123de5;};}function handleError(_0x394fea,_0x11b043){_0x11b043=_0x11b043||0x1f4;return function(_0x548c70){logger[_0x2eaf('0x22')](_0x548c70[_0x2eaf('0x23')]);if(_0x548c70[_0x2eaf('0x1f')]){delete _0x548c70[_0x2eaf('0x1f')];}_0x394fea['status'](_0x11b043)['send'](_0x548c70);};}exports['index']=function(_0x22f00a,_0x41dc64){var _0x5d7ac0={},_0xd87345={},_0x5b4763={'count':0x0,'rows':[]};var _0x15d30d=_[_0x2eaf('0x1a')](db[_0x2eaf('0x24')][_0x2eaf('0x25')],function(_0x50cd05){return{'name':_0x50cd05[_0x2eaf('0x26')],'type':_0x50cd05[_0x2eaf('0x1e')]['key']};});_0xd87345[_0x2eaf('0x27')]=_['map'](_0x15d30d,_0x2eaf('0x1f'));_0xd87345[_0x2eaf('0x28')]=_['keys'](_0x22f00a[_0x2eaf('0x28')]);_0xd87345[_0x2eaf('0x29')]=_[_0x2eaf('0x2a')](_0xd87345[_0x2eaf('0x27')],_0xd87345[_0x2eaf('0x28')]);_0x5d7ac0[_0x2eaf('0x2b')]=_[_0x2eaf('0x2a')](_0xd87345[_0x2eaf('0x27')],qs[_0x2eaf('0x2c')](_0x22f00a[_0x2eaf('0x28')][_0x2eaf('0x2c')]));_0x5d7ac0[_0x2eaf('0x2b')]=_0x5d7ac0[_0x2eaf('0x2b')]['length']?_0x5d7ac0['attributes']:_0xd87345[_0x2eaf('0x27')];if(!_0x22f00a[_0x2eaf('0x28')][_0x2eaf('0x2d')]('nolimit')){_0x5d7ac0['limit']=qs[_0x2eaf('0xe')](_0x22f00a['query'][_0x2eaf('0xe')]);_0x5d7ac0[_0x2eaf('0xd')]=qs[_0x2eaf('0xd')](_0x22f00a['query']['offset']);}_0x5d7ac0['order']=qs[_0x2eaf('0x2e')](_0x22f00a[_0x2eaf('0x28')][_0x2eaf('0x2e')]);_0x5d7ac0[_0x2eaf('0x2f')]=qs['filters'](_[_0x2eaf('0x30')](_0x22f00a[_0x2eaf('0x28')],_0xd87345['filters']),_0x15d30d);if(_0x22f00a['query'][_0x2eaf('0x31')]){_0x5d7ac0['where']=_[_0x2eaf('0x32')](_0x5d7ac0['where'],{'$or':_[_0x2eaf('0x1a')](_0x15d30d,function(_0x144c1d){if(_0x144c1d[_0x2eaf('0x1e')]!==_0x2eaf('0x33')){var _0x4b53f5={};_0x4b53f5[_0x144c1d['name']]={'$like':'%'+_0x22f00a[_0x2eaf('0x28')]['filter']+'%'};return _0x4b53f5;}})});}_0x5d7ac0=_[_0x2eaf('0x32')]({},_0x5d7ac0,_0x22f00a[_0x2eaf('0x34')]);var _0x45ee74={'where':_0x5d7ac0[_0x2eaf('0x2f')]};return db['VoiceExtension'][_0x2eaf('0x10')](_0x45ee74)[_0x2eaf('0x21')](function(_0x1dcac7){_0x5b4763[_0x2eaf('0x10')]=_0x1dcac7;if(_0x22f00a[_0x2eaf('0x28')][_0x2eaf('0x35')]){_0x5d7ac0[_0x2eaf('0x36')]=[{'all':!![]}];}return db[_0x2eaf('0x24')][_0x2eaf('0x37')](_0x5d7ac0);})[_0x2eaf('0x21')](function(_0x557fd6){_0x5b4763[_0x2eaf('0x38')]=_0x557fd6;return _0x5b4763;})[_0x2eaf('0x21')](respondWithFilteredResult(_0x41dc64,_0x5d7ac0))['catch'](handleError(_0x41dc64,null));};exports[_0x2eaf('0x39')]=function(_0x3cfeac,_0x501076){var _0x452100={'raw':![],'where':{'id':_0x3cfeac[_0x2eaf('0x3a')]['id']}},_0x9a3bde={};_0x9a3bde[_0x2eaf('0x27')]=_[_0x2eaf('0x3b')](db[_0x2eaf('0x24')][_0x2eaf('0x25')]);_0x9a3bde['query']=_['keys'](_0x3cfeac[_0x2eaf('0x28')]);_0x9a3bde[_0x2eaf('0x29')]=_[_0x2eaf('0x2a')](_0x9a3bde['model'],_0x9a3bde[_0x2eaf('0x28')]);_0x452100[_0x2eaf('0x2b')]=_[_0x2eaf('0x2a')](_0x9a3bde['model'],qs['fields'](_0x3cfeac[_0x2eaf('0x28')][_0x2eaf('0x2c')]));_0x452100[_0x2eaf('0x2b')]=_0x452100[_0x2eaf('0x2b')][_0x2eaf('0x3c')]?_0x452100['attributes']:_0x9a3bde[_0x2eaf('0x27')];if(_0x3cfeac[_0x2eaf('0x28')][_0x2eaf('0x35')]){_0x452100[_0x2eaf('0x36')]=[{'all':!![]}];}_0x452100=_[_0x2eaf('0x32')]({},_0x452100,_0x3cfeac['options']);return db[_0x2eaf('0x24')]['find'](_0x452100)[_0x2eaf('0x21')](handleEntityNotFound(_0x501076,null))[_0x2eaf('0x21')](respondWithResult(_0x501076,null))['catch'](handleError(_0x501076,null));};exports[_0x2eaf('0x12')]=function(_0x33a6db,_0x332791){return db[_0x2eaf('0x24')][_0x2eaf('0x1d')]({'where':{'id':_0x33a6db[_0x2eaf('0x3a')]['id']}})['then'](handleEntityNotFound(_0x332791,null))[_0x2eaf('0x21')](removeEntity(_0x332791,null))['catch'](handleError(_0x332791,null));};exports[_0x2eaf('0x3d')]=function(_0x6a11c0,_0x549512){if(_0x6a11c0['body'][_0x2eaf('0x1e')]===_0x2eaf('0x16')&&!_['startsWith'](_0x6a11c0['body'][_0x2eaf('0x3e')],'_')){_0x6a11c0[_0x2eaf('0x3f')]['exten']='_'[_0x2eaf('0x40')](_0x6a11c0[_0x2eaf('0x3f')]['exten']);}return db[_0x2eaf('0x24')]['create'](_0x6a11c0[_0x2eaf('0x3f')],{'raw':![]})['then'](function(_0x255250){var _0x5051f6=_0x6a11c0[_0x2eaf('0x41')][_0x2eaf('0x13')]({'plain':!![]});if(!_0x5051f6)throw new Error(_0x2eaf('0x42'));if(_0x5051f6[_0x2eaf('0x43')]===_0x2eaf('0x41')){var _0x245e9f=_0x255250[_0x2eaf('0x13')]({'plain':!![]});var _0x59cc06=[{'name':_0x2eaf('0x44'),'value':_0x2eaf('0x14')},{'name':'OutboundRoutes','value':'outbound'},{'name':_0x2eaf('0x17'),'value':'internal'}];var _0x57fa3b=_[_0x2eaf('0x1d')](_0x59cc06,[_0x2eaf('0x1b'),_0x245e9f[_0x2eaf('0x1e')]])['name'];return db['UserProfileSection']['find']({'where':{'name':_0x57fa3b,'userProfileId':_0x5051f6[_0x2eaf('0x45')]},'raw':!![]})[_0x2eaf('0x21')](function(_0x1fcb51){if(_0x1fcb51&&_0x1fcb51[_0x2eaf('0x46')]===0x0){return db[_0x2eaf('0x20')]['create']({'name':_0x245e9f['name'],'resourceId':_0x245e9f['id'],'type':_0x1fcb51['name'],'sectionId':_0x1fcb51['id']},{})[_0x2eaf('0x21')](function(){return _0x255250;});}else{return _0x255250;}})['catch'](function(_0x50a8ca){logger[_0x2eaf('0x22')](_0x2eaf('0x47'),_0x50a8ca);throw _0x50a8ca;});}return _0x255250;})[_0x2eaf('0x21')](respondWithResult(_0x549512,0xc9))[_0x2eaf('0x48')](handleError(_0x549512,null));};exports[_0x2eaf('0x49')]=function(_0x4141da,_0x1e3be4){if(_0x4141da[_0x2eaf('0x3f')]['id']){delete _0x4141da[_0x2eaf('0x3f')]['id'];}return db[_0x2eaf('0x24')][_0x2eaf('0x1d')]({'where':{'id':_0x4141da['params']['id']}})[_0x2eaf('0x21')](handleEntityNotFound(_0x1e3be4,null))['then'](function(_0x38fd19){if(_0x38fd19){return db[_0x2eaf('0x24')][_0x2eaf('0x49')](_[_0x2eaf('0x30')](_0x4141da[_0x2eaf('0x3f')],[_0x2eaf('0x3e'),'context',_0x2eaf('0x4a'),_0x2eaf('0x4b'),_0x2eaf('0x4c'),'mandatoryDisposition',_0x2eaf('0x4d')]),{'where':{'context':_0x38fd19['context'],'exten':_0x38fd19[_0x2eaf('0x3e')]},'individualHooks':!![]})[_0x2eaf('0x21')](function(_0x342380){return _0x342380;});}return null;})['then'](respondWithStatusCode(_0x1e3be4,null))[_0x2eaf('0x48')](handleError(_0x1e3be4,null));};exports['addApplications']=function(_0x48e799,_0x27a437){var _0x332913=_0x48e799[_0x2eaf('0x3a')]['id'];var _0x2199f2=_0x48e799[_0x2eaf('0x3f')];var _0x242dc1=0xc8;var _0x325d37=null;return db[_0x2eaf('0x4e')][_0x2eaf('0x4f')]({'isolationLevel':db[_0x2eaf('0x4e')][_0x2eaf('0x50')]['ISOLATION_LEVELS'][_0x2eaf('0x51')]},function(_0x500949){return db[_0x2eaf('0x24')][_0x2eaf('0x52')]({'where':{'id':_0x332913},'transaction':_0x500949})[_0x2eaf('0x21')](function(_0x169311){if(_0x169311){return db[_0x2eaf('0x24')][_0x2eaf('0x12')]({'where':{'VoiceExtensionId':_0x332913},'transaction':_0x500949})['then'](function(){var _0x361458=_[_0x2eaf('0x1a')](_0x2199f2,function(_0x125d36){_0x125d36[_0x2eaf('0x53')]=_0x332913;_0x125d36['isApp']=!![];return _0x125d36;});return _0x169311[_0x2eaf('0x54')](_0x361458);})[_0x2eaf('0x21')](function(_0x536503){return db[_0x2eaf('0x24')]['bulkCreate'](_0x536503,{'transaction':_0x500949});});}else{_0x242dc1=0x194;_0x325d37=[];}});})[_0x2eaf('0x21')](function(){if(_0x242dc1!==0x194){return db['VoiceExtension'][_0x2eaf('0x55')]({'where':{'isApp':!![],'VoiceExtensionId':_0x332913},'order':'cast(priority\x20as\x20unsigned)'})[_0x2eaf('0x21')](function(_0x247b26){_0x325d37=_0x247b26;});}})[_0x2eaf('0x48')](function(_0x1d77e6){_0x242dc1=0x1f4;logger['error'](_0x1d77e6[_0x2eaf('0x23')]);if(_0x1d77e6[_0x2eaf('0x1f')]){delete _0x1d77e6[_0x2eaf('0x1f')];}_0x325d37=_0x1d77e6;})[_0x2eaf('0x56')](function(){if(_0x325d37===null){_0x27a437[_0x2eaf('0x9')](_0x242dc1);}else{if(_0x242dc1===0x1f4){_0x27a437[_0x2eaf('0xb')](_0x242dc1)[_0x2eaf('0x57')](_0x325d37);}else{_0x27a437[_0x2eaf('0xb')](_0x242dc1)['json'](_0x325d37);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 447c70b..107f3ec 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 _0x0c7d=['hook','exports','events','../../mysqldb','VoiceExtension','save','update','remove','emit'];(function(_0x2d542a,_0x2c9762){var _0xc6e54b=function(_0xaba0a8){while(--_0xaba0a8){_0x2d542a['push'](_0x2d542a['shift']());}};_0xc6e54b(++_0x2c9762);}(_0x0c7d,0xf5));var _0xd0c7=function(_0x49f67f,_0x4113a4){_0x49f67f=_0x49f67f-0x0;var _0x4779a1=_0x0c7d[_0x49f67f];return _0x4779a1;};'use strict';var EventEmitter=require(_0xd0c7('0x0'));var VoiceExtension=require(_0xd0c7('0x1'))['db'][_0xd0c7('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd0c7('0x3'),'afterUpdate':_0xd0c7('0x4'),'afterDestroy':_0xd0c7('0x5')};function emitEvent(_0x12fb3f){return function(_0x500a32,_0x54ecc3,_0xe524d3){VoiceExtensionEvents['emit'](_0x12fb3f+':'+_0x500a32['id'],_0x500a32);VoiceExtensionEvents[_0xd0c7('0x6')](_0x12fb3f,_0x500a32);_0xe524d3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0xd0c7('0x7')](e,emitEvent(event));}}module[_0xd0c7('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0x0f74=['../../mysqldb','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x0f74,0x14c));var _0x40f7=function(_0x21a735,_0xa8f5a3){_0x21a735=_0x21a735-0x0;var _0xcfd1bb=_0x0f74[_0x21a735];return _0xcfd1bb;};'use strict';var EventEmitter=require(_0x40f7('0x0'));var VoiceExtension=require(_0x40f7('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x40f7('0x2')](0x0);var events={'afterCreate':_0x40f7('0x3'),'afterUpdate':_0x40f7('0x4'),'afterDestroy':_0x40f7('0x5')};function emitEvent(_0x58b3d5){return function(_0xa7ef3d,_0x3a2fa5,_0x32def9){VoiceExtensionEvents[_0x40f7('0x6')](_0x58b3d5+':'+_0xa7ef3d['id'],_0xa7ef3d);VoiceExtensionEvents['emit'](_0x58b3d5,_0xa7ef3d);_0x32def9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x40f7('0x7')](e,emitEvent(event));}}module[_0x40f7('0x8')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 39810e8..e1c4cb3 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 _0xed2e=['split','length','trunk','param','phone','prefix','${EXTEN:','SIP','U(xcally-mixmonitor-context)','replace','join','isEmpty','Interval','findAll','interval','IntervalId','*,*,*,*','intervals','map','toLowerCase','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','answer','queue','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1',',${EXTEN},','outboundDial','last','priority','catch','define','VoiceExtension','voice_extensions','get','then','lodash','./voiceExtension.attributes','type','CDR(type)=','context','exten','inbound','push','Set','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','options','url'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0xed2e,0xc1));var _0xeed2=function(_0x459cdd,_0xec7db){_0x459cdd=_0x459cdd-0x0;var _0x1979b2=_0xed2e[_0x459cdd];return _0x1979b2;};'use strict';var _=require(_0xeed2('0x0'));var attributes=require(_0xeed2('0x1'));module['exports']=function(_0x1fab2d){var _0x179c4f=_0x1fab2d['models'];function _0x30776f(_0x27bf5c){var _0x5328f0=0x2;var _0x1457c6=[{'type':_0x27bf5c[_0xeed2('0x2')],'app':'Set','appdata':_0xeed2('0x3')+_0x27bf5c[_0xeed2('0x2')],'context':_0x27bf5c[_0xeed2('0x4')],'exten':_0x27bf5c[_0xeed2('0x5')],'priority':_0x5328f0++,'VoiceExtensionId':_0x27bf5c['id']}];if(_0x27bf5c['type']===_0xeed2('0x6')){_0x1457c6[_0xeed2('0x7')]({'type':'inbound','app':_0xeed2('0x8'),'appdata':_0xeed2('0x9')+_0x27bf5c['id'],'context':_0x27bf5c[_0xeed2('0x4')],'exten':_0x27bf5c['exten'],'priority':_0x5328f0++,'VoiceExtensionId':_0x27bf5c['id']});}_0x1457c6['push']({'type':_0x27bf5c[_0xeed2('0x2')],'app':_0xeed2('0x8'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x27bf5c['context'],'exten':_0x27bf5c[_0xeed2('0x5')],'priority':_0x5328f0++,'VoiceExtensionId':_0x27bf5c['id']},{'type':_0x27bf5c['type'],'app':'Set','appdata':_0xeed2('0xa'),'context':_0x27bf5c[_0xeed2('0x4')],'exten':_0x27bf5c[_0xeed2('0x5')],'priority':_0x5328f0++,'VoiceExtensionId':_0x27bf5c['id']},{'type':_0x27bf5c[_0xeed2('0x2')],'app':'Set','appdata':_0xeed2('0xb'),'context':_0x27bf5c['context'],'exten':_0x27bf5c[_0xeed2('0x5')],'priority':_0x5328f0++,'VoiceExtensionId':_0x27bf5c['id']});return _0x1457c6;}function _0x517a71(_0x504d05){var _0x473f5a=0x2;var _0x394656=[{'type':_0xeed2('0xc'),'app':_0xeed2('0x8'),'appdata':_0xeed2('0xd'),'context':_0x504d05[_0xeed2('0x4')],'exten':_0x504d05['exten'],'priority':_0x473f5a++,'VoiceExtensionId':_0x504d05['id']},{'type':_0xeed2('0xc'),'app':'Set','appdata':_0xeed2('0xe')+(_0x504d05[_0xeed2('0xf')]?'${EXTEN:'+_0x504d05[_0xeed2('0xf')]+'}':_0xeed2('0x10')),'context':_0x504d05[_0xeed2('0x4')],'exten':_0x504d05['exten'],'priority':_0x473f5a++,'VoiceExtensionId':_0x504d05['id']},{'type':_0xeed2('0xc'),'app':'Set','appdata':_0xeed2('0x9')+_0x504d05['id'],'context':_0x504d05[_0xeed2('0x4')],'exten':_0x504d05[_0xeed2('0x5')],'priority':_0x473f5a++,'VoiceExtensionId':_0x504d05['id']},{'type':_0xeed2('0xc'),'app':'ExecIf','appdata':_0xeed2('0x11')+(_0x473f5a+0x2)+_0xeed2('0x12')+(_0x473f5a+0x1)+')','context':_0x504d05[_0xeed2('0x4')],'exten':_0x504d05[_0xeed2('0x5')],'priority':_0x473f5a++,'VoiceExtensionId':_0x504d05['id']},{'type':_0xeed2('0xc'),'app':_0xeed2('0x8'),'appdata':_0x504d05[_0xeed2('0xf')]?'CDR(prefix)=${EXTEN:0:'+_0x504d05[_0xeed2('0xf')]+'}':_0xeed2('0x13'),'context':_0x504d05[_0xeed2('0x4')],'exten':_0x504d05[_0xeed2('0x5')],'priority':_0x473f5a++,'VoiceExtensionId':_0x504d05['id']},{'type':_0xeed2('0xc'),'app':_0xeed2('0x8'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x504d05[_0xeed2('0x4')],'exten':_0x504d05['exten'],'priority':_0x473f5a++,'VoiceExtensionId':_0x504d05['id']},{'type':_0xeed2('0xc'),'app':_0xeed2('0x8'),'appdata':_0xeed2('0xa'),'context':_0x504d05[_0xeed2('0x4')],'exten':_0x504d05['exten'],'priority':_0x473f5a++,'VoiceExtensionId':_0x504d05['id']},{'type':_0xeed2('0xc'),'app':_0xeed2('0x8'),'appdata':_0xeed2('0xb'),'context':_0x504d05[_0xeed2('0x4')],'exten':_0x504d05[_0xeed2('0x5')],'priority':_0x473f5a++,'VoiceExtensionId':_0x504d05['id']},{'type':_0xeed2('0xc'),'app':_0xeed2('0x8'),'appdata':_0xeed2('0x14')+_0x504d05['id'],'context':_0x504d05[_0xeed2('0x4')],'exten':_0x504d05[_0xeed2('0x5')],'priority':_0x473f5a++,'VoiceExtensionId':_0x504d05['id']}];if(_0x504d05[_0xeed2('0x15')](_0xeed2('0x16'))&&_0x504d05[_0xeed2('0x16')]!==_0xeed2('0x17')){_0x394656['push']({'type':_0xeed2('0xc'),'app':_0xeed2('0x8'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x504d05[_0xeed2('0x4')],'exten':_0x504d05[_0xeed2('0x5')],'priority':_0x473f5a++,'VoiceExtensionId':_0x504d05['id']},{'type':_0xeed2('0xc'),'app':_0xeed2('0x8'),'appdata':_0xeed2('0x18')+_0x504d05[_0xeed2('0x16')]||_0xeed2('0x19'),'context':_0x504d05[_0xeed2('0x4')],'exten':_0x504d05['exten'],'priority':_0x473f5a++,'VoiceExtensionId':_0x504d05['id']});}return _0x394656;}function _0x6745d9(_0x229840,_0x590494){var _0x5ad4f8=[{'name':'trunk','param':0x0},{'name':_0xeed2('0x1a'),'param':0x1},{'name':_0xeed2('0x1b'),'param':0x2},{'name':_0xeed2('0x1c'),'param':0x3}];var _0xe977a4={};var _0x317ef9=_0x590494[_0xeed2('0x1d')](',');var _0x2d50d2=[];for(var _0x4e40b6=0x0;_0x4e40b6<_0x5ad4f8[_0xeed2('0x1e')];_0x4e40b6++){switch(_0x5ad4f8[_0x4e40b6]['name']){case _0xeed2('0x1f'):_0xe977a4[_0xeed2('0x1f')]=_0x317ef9[_0x5ad4f8[_0x4e40b6][_0xeed2('0x20')]][_0xeed2('0x1d')]('/')[0x1];_0xe977a4[_0xeed2('0x21')]=_0x317ef9[_0x5ad4f8[_0x4e40b6][_0xeed2('0x20')]][_0xeed2('0x1d')]('/')[0x2];_0xe977a4[_0xeed2('0x22')]=_0xe977a4[_0xeed2('0x21')]?_0xe977a4[_0xeed2('0x21')][_0xeed2('0x1d')]('$')[0x0]:undefined;_0xe977a4['phone']=_0x229840[_0xeed2('0xf')]?(_0xe977a4['prefix']||'')+_0xeed2('0x23')+_0x229840[_0xeed2('0xf')]+'}':(_0xe977a4[_0xeed2('0x22')]||'')+_0xeed2('0x10');_0x2d50d2[_0x5ad4f8[_0x4e40b6][_0xeed2('0x20')]]=[_0xeed2('0x24'),_0xe977a4[_0xeed2('0x1f')],_0xe977a4['phone']]['join']('/');break;case _0xeed2('0x1b'):_0xe977a4[_0xeed2('0x1b')]=_0x317ef9[_0x5ad4f8[_0x4e40b6][_0xeed2('0x20')]];if(_0x229840['recordingFormat']!==_0xeed2('0x17')){if(_0xe977a4['options']['indexOf']('U(xcally-mixmonitor-context)')<0x0){_0xe977a4[_0xeed2('0x1b')]+=_0xeed2('0x25');}}else{_0xe977a4[_0xeed2('0x1b')]=_0xe977a4['options'][_0xeed2('0x26')](_0xeed2('0x25'),'');}_0x2d50d2[_0x5ad4f8[_0x4e40b6][_0xeed2('0x20')]]=_0xe977a4[_0xeed2('0x1b')];break;default:_0x2d50d2[_0x5ad4f8[_0x4e40b6]['param']]=_0x317ef9[_0x5ad4f8[_0x4e40b6][_0xeed2('0x20')]];}}return _0x2d50d2[_0xeed2('0x27')](',');}function _0x1c865c(_0x42deba,_0x4d00c6,_0x608011){return new Promise(function(_0x37c9a4,_0x56d176){var _0x49a1c3=[];if(_[_0xeed2('0x28')](_0x4d00c6))return _0x37c9a4(_0x49a1c3);_0x179c4f[_0xeed2('0x29')][_0xeed2('0x2a')]({'attributes':['id',_0xeed2('0x2b'),_0xeed2('0x2c')],'raw':!![]})['then'](function(_0x532e85){for(var _0x2eff8f=0x0,_0x3a7474=0x0;_0x2eff8f<_0x4d00c6['length'];_0x2eff8f++,_0x3a7474=0x0){var _0x370915=_0x4d00c6[_0x2eff8f];var _0x37ac1b=[];var _0x1bf986=[];delete _0x370915['id'];if(_0x370915[_0xeed2('0x2b')]!==_0xeed2('0x2d')){_0x370915['intervals']=[_0x370915[_0xeed2('0x2b')]];}else{_0x370915[_0xeed2('0x2e')]=_0x370915[_0xeed2('0x2c')]?_[_0xeed2('0x2f')](_['filter'](_0x532e85,{'IntervalId':_0x370915[_0xeed2('0x2c')]}),_0xeed2('0x2b')):[];}_0x370915[_0xeed2('0x4')]=_0x42deba[_0xeed2('0x4')];_0x370915['exten']=_0x42deba[_0xeed2('0x5')];if(_0x370915[_0xeed2('0x2')])_0x370915[_0xeed2('0x2')]=_0x370915[_0xeed2('0x2')][_0xeed2('0x30')]();if(_0x42deba[_0xeed2('0x2')]===_0xeed2('0xc')){if(_0x370915[_0xeed2('0x15')]('tag')&&_0x370915[_0xeed2('0x31')]&&_0x370915[_0xeed2('0x31')]!=='--'){_0x37ac1b[_0xeed2('0x7')]({'type':_0x370915[_0xeed2('0x2')][_0xeed2('0x30')](),'app':'Set','appdata':_0xeed2('0x32')+_0x370915['tag'],'context':_0x42deba[_0xeed2('0x4')],'exten':_0x42deba['exten'],'priority':_0x370915['intervals'][_0xeed2('0x1e')]+_0x608011+_0x3a7474++,'VoiceExtensionId':_0x42deba['id']});}_0x37ac1b[_0xeed2('0x7')]({'type':_0x370915[_0xeed2('0x2')][_0xeed2('0x30')](),'app':_0xeed2('0x33'),'appdata':_0xeed2('0x34')+(_0x370915[_0xeed2('0x35')]?'Set(CALLERID(all)='+_0x370915['callerID']+')':_0xeed2('0x36')),'context':_0x42deba[_0xeed2('0x4')],'exten':_0x42deba[_0xeed2('0x5')],'priority':_0x370915[_0xeed2('0x2e')][_0xeed2('0x1e')]+_0x608011+_0x3a7474++,'VoiceExtensionId':_0x42deba['id']});}else{if(_0x370915[_0xeed2('0x15')](_0xeed2('0x37'))){if([_0xeed2('0x38'),'playback'][_0xeed2('0x39')](_0x370915[_0xeed2('0x3a')][_0xeed2('0x30')]())&&_0x370915[_0xeed2('0x3b')]!==_0xeed2('0x3c')){if(_0x370915[_0xeed2('0x37')]){_0x37ac1b[_0xeed2('0x7')]({'type':_0x370915[_0xeed2('0x2')][_0xeed2('0x30')](),'app':_0xeed2('0x33'),'appdata':_0xeed2('0x3d'),'context':_0x42deba['context'],'exten':_0x42deba[_0xeed2('0x5')],'priority':_0x370915[_0xeed2('0x2e')]['length']+_0x608011+_0x3a7474++,'VoiceExtensionId':_0x42deba['id']});_0x37ac1b[_0xeed2('0x7')]({'type':_0x370915[_0xeed2('0x2')]['toLowerCase'](),'app':'Set','appdata':_0xeed2('0x3e'),'context':_0x42deba['context'],'exten':_0x42deba['exten'],'priority':_0x370915['intervals'][_0xeed2('0x1e')]+_0x608011+_0x3a7474++,'VoiceExtensionId':_0x42deba['id']});}else{_0x37ac1b['push']({'type':_0x370915[_0xeed2('0x2')][_0xeed2('0x30')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x42deba[_0xeed2('0x4')],'exten':_0x42deba['exten'],'priority':_0x370915[_0xeed2('0x2e')][_0xeed2('0x1e')]+_0x608011+_0x3a7474++,'VoiceExtensionId':_0x42deba['id']});_0x37ac1b[_0xeed2('0x7')]({'type':_0x370915[_0xeed2('0x2')][_0xeed2('0x30')](),'app':_0xeed2('0x8'),'appdata':_0xeed2('0x3f'),'context':_0x42deba[_0xeed2('0x4')],'exten':_0x42deba[_0xeed2('0x5')],'priority':_0x370915[_0xeed2('0x2e')][_0xeed2('0x1e')]+_0x608011+_0x3a7474++,'VoiceExtensionId':_0x42deba['id']});}}}}for(var _0x55b1d3=0x0;_0x55b1d3<_0x370915[_0xeed2('0x2e')][_0xeed2('0x1e')];_0x55b1d3++){var _0x270798=_0x608011+_0x370915[_0xeed2('0x2e')]['length'];var _0x5854c5=_0x55b1d3===_0x370915[_0xeed2('0x2e')]['length']-0x1?_0x608011+_0x37ac1b[_0xeed2('0x1e')]+_0x1bf986['length']+0x2:_0x608011+_0x55b1d3+0x1;_0x37ac1b['splice'](_0x55b1d3,0x0,{'type':_0x42deba['type'],'app':'GotoIfTime','appdata':_0x370915[_0xeed2('0x2e')][_0x55b1d3]+'?'+_0x42deba['context']+',${EXTEN},'+_0x270798+':'+_0x42deba[_0xeed2('0x4')]+_0xeed2('0x40')+_0x5854c5,'exten':_0x42deba['exten'],'context':_0x42deba['context'],'priority':_0x608011+_0x55b1d3,'VoiceExtensionId':_0x42deba['id']});}if(_0x370915[_0xeed2('0x3b')]===_0xeed2('0x41')){_0x370915['appdata']=_0x6745d9(_0x42deba,_0x370915['appdata']);}if(_0x370915['appType']==='agi'){_0x37ac1b[_0xeed2('0x7')]({'type':_0x370915['type']['toLowerCase'](),'app':'Set','appdata':'XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','context':_0x42deba[_0xeed2('0x4')],'exten':_0x42deba[_0xeed2('0x5')],'priority':_0x370915[_0xeed2('0x2e')][_0xeed2('0x1e')]+_0x608011+_0x3a7474++,'VoiceExtensionId':_0x42deba['id']});}_0x370915['priority']=_0x37ac1b[_0xeed2('0x1e')]?_[_0xeed2('0x42')](_0x37ac1b)[_0xeed2('0x43')]+0x1:_0x608011;_0x49a1c3=_['concat'](_0x49a1c3,_0x37ac1b,[_0x370915],_0x1bf986);_0x608011=_[_0xeed2('0x42')](_0x49a1c3)['priority']+0x1;}return _0x37c9a4(_0x49a1c3);})[_0xeed2('0x44')](function(_0x1c5432){_0x56d176(_0x1c5432);});});}return _0x1fab2d[_0xeed2('0x45')](_0xeed2('0x46'),attributes,{'tableName':_0xeed2('0x47'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x3c7139){var _0x1391d3=this[_0xeed2('0x48')]({'plain':!![]});var _0x5e26e1=_0x1391d3[_0xeed2('0x2')]===_0xeed2('0xc')?_0x517a71(_0x1391d3):_0x30776f(_0x1391d3);return _0x1c865c(_0x1391d3,_0x3c7139,_[_0xeed2('0x42')](_0x5e26e1)[_0xeed2('0x43')]+0x1)[_0xeed2('0x49')](function(_0x3f4924){var _0x44df1a=_['concat'](_0x5e26e1,_0x3f4924);_0x44df1a['push']({'type':_0x1391d3['type'],'app':'Hangup','exten':_0x1391d3[_0xeed2('0x5')],'context':_0x1391d3[_0xeed2('0x4')],'priority':_[_0xeed2('0x42')](_0x44df1a)[_0xeed2('0x43')]+0x1,'VoiceExtensionId':_0x1391d3['id']});return _0x44df1a;});}}});}; \ No newline at end of file +var _0xf115=['timeout','options','url','length','name','trunk','param','split','phone','prefix','${EXTEN:','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','filter','hasOwnProperty','tag','CDR(tag)=','toLowerCase','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1',',${EXTEN},','appType','outboundDial','appdata','agi','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last','concat','define','VoiceExtension','voice_extensions','Hangup','./voiceExtension.attributes','exports','models','type','Set','exten','inbound','push','CDR(routeid)=','context','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav'];(function(_0xf61129,_0x523668){var _0xefa38a=function(_0x3c965f){while(--_0x3c965f){_0xf61129['push'](_0xf61129['shift']());}};_0xefa38a(++_0x523668);}(_0xf115,0x1c8));var _0x5f11=function(_0x530348,_0x333d6){_0x530348=_0x530348-0x0;var _0x50a46e=_0xf115[_0x530348];return _0x50a46e;};'use strict';var _=require('lodash');var attributes=require(_0x5f11('0x0'));module[_0x5f11('0x1')]=function(_0x230480){var _0x4a62a7=_0x230480[_0x5f11('0x2')];function _0x3f4505(_0xe76e6d){var _0xd6eda5=0x2;var _0x4599e9=[{'type':_0xe76e6d[_0x5f11('0x3')],'app':_0x5f11('0x4'),'appdata':'CDR(type)='+_0xe76e6d['type'],'context':_0xe76e6d['context'],'exten':_0xe76e6d[_0x5f11('0x5')],'priority':_0xd6eda5++,'VoiceExtensionId':_0xe76e6d['id']}];if(_0xe76e6d[_0x5f11('0x3')]===_0x5f11('0x6')){_0x4599e9[_0x5f11('0x7')]({'type':_0x5f11('0x6'),'app':_0x5f11('0x4'),'appdata':_0x5f11('0x8')+_0xe76e6d['id'],'context':_0xe76e6d[_0x5f11('0x9')],'exten':_0xe76e6d['exten'],'priority':_0xd6eda5++,'VoiceExtensionId':_0xe76e6d['id']});}_0x4599e9[_0x5f11('0x7')]({'type':_0xe76e6d[_0x5f11('0x3')],'app':_0x5f11('0x4'),'appdata':_0x5f11('0xa'),'context':_0xe76e6d[_0x5f11('0x9')],'exten':_0xe76e6d[_0x5f11('0x5')],'priority':_0xd6eda5++,'VoiceExtensionId':_0xe76e6d['id']},{'type':_0xe76e6d['type'],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0xe76e6d[_0x5f11('0x9')],'exten':_0xe76e6d['exten'],'priority':_0xd6eda5++,'VoiceExtensionId':_0xe76e6d['id']},{'type':_0xe76e6d['type'],'app':_0x5f11('0x4'),'appdata':_0x5f11('0xb'),'context':_0xe76e6d['context'],'exten':_0xe76e6d[_0x5f11('0x5')],'priority':_0xd6eda5++,'VoiceExtensionId':_0xe76e6d['id']});return _0x4599e9;}function _0x1de3e4(_0x3927b9){var _0x2cea9d=0x2;var _0x1f3eb5=[{'type':_0x5f11('0xc'),'app':'Set','appdata':_0x5f11('0xd'),'context':_0x3927b9['context'],'exten':_0x3927b9[_0x5f11('0x5')],'priority':_0x2cea9d++,'VoiceExtensionId':_0x3927b9['id']},{'type':_0x5f11('0xc'),'app':_0x5f11('0x4'),'appdata':_0x5f11('0xe')+(_0x3927b9['cutdigits']?'${EXTEN:'+_0x3927b9[_0x5f11('0xf')]+'}':_0x5f11('0x10')),'context':_0x3927b9['context'],'exten':_0x3927b9[_0x5f11('0x5')],'priority':_0x2cea9d++,'VoiceExtensionId':_0x3927b9['id']},{'type':_0x5f11('0xc'),'app':_0x5f11('0x4'),'appdata':_0x5f11('0x8')+_0x3927b9['id'],'context':_0x3927b9[_0x5f11('0x9')],'exten':_0x3927b9['exten'],'priority':_0x2cea9d++,'VoiceExtensionId':_0x3927b9['id']},{'type':'outbound','app':'ExecIf','appdata':_0x5f11('0x11')+(_0x2cea9d+0x2)+'):Goto('+(_0x2cea9d+0x1)+')','context':_0x3927b9[_0x5f11('0x9')],'exten':_0x3927b9[_0x5f11('0x5')],'priority':_0x2cea9d++,'VoiceExtensionId':_0x3927b9['id']},{'type':'outbound','app':'Set','appdata':_0x3927b9['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x3927b9[_0x5f11('0xf')]+'}':'CDR(prefix)=noprefix','context':_0x3927b9['context'],'exten':_0x3927b9[_0x5f11('0x5')],'priority':_0x2cea9d++,'VoiceExtensionId':_0x3927b9['id']},{'type':_0x5f11('0xc'),'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x3927b9[_0x5f11('0x9')],'exten':_0x3927b9[_0x5f11('0x5')],'priority':_0x2cea9d++,'VoiceExtensionId':_0x3927b9['id']},{'type':'outbound','app':_0x5f11('0x4'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x3927b9[_0x5f11('0x9')],'exten':_0x3927b9[_0x5f11('0x5')],'priority':_0x2cea9d++,'VoiceExtensionId':_0x3927b9['id']},{'type':_0x5f11('0xc'),'app':'Set','appdata':_0x5f11('0xb'),'context':_0x3927b9[_0x5f11('0x9')],'exten':_0x3927b9[_0x5f11('0x5')],'priority':_0x2cea9d++,'VoiceExtensionId':_0x3927b9['id']},{'type':_0x5f11('0xc'),'app':_0x5f11('0x4'),'appdata':_0x5f11('0x12')+_0x3927b9['id'],'context':_0x3927b9['context'],'exten':_0x3927b9[_0x5f11('0x5')],'priority':_0x2cea9d++,'VoiceExtensionId':_0x3927b9['id']}];if(_0x3927b9['hasOwnProperty'](_0x5f11('0x13'))&&_0x3927b9['recordingFormat']!==_0x5f11('0x14')){_0x1f3eb5[_0x5f11('0x7')]({'type':_0x5f11('0xc'),'app':_0x5f11('0x4'),'appdata':_0x5f11('0x15'),'context':_0x3927b9[_0x5f11('0x9')],'exten':_0x3927b9[_0x5f11('0x5')],'priority':_0x2cea9d++,'VoiceExtensionId':_0x3927b9['id']},{'type':_0x5f11('0xc'),'app':_0x5f11('0x4'),'appdata':_0x5f11('0x16')+_0x3927b9[_0x5f11('0x13')]||_0x5f11('0x17'),'context':_0x3927b9['context'],'exten':_0x3927b9[_0x5f11('0x5')],'priority':_0x2cea9d++,'VoiceExtensionId':_0x3927b9['id']});}return _0x1f3eb5;}function _0x4ab39c(_0x4405da,_0x16d2e8){var _0x4ccee0=[{'name':'trunk','param':0x0},{'name':_0x5f11('0x18'),'param':0x1},{'name':_0x5f11('0x19'),'param':0x2},{'name':_0x5f11('0x1a'),'param':0x3}];var _0x150714={};var _0x2a1f23=_0x16d2e8['split'](',');var _0x5339c5=[];for(var _0xabd957=0x0;_0xabd957<_0x4ccee0[_0x5f11('0x1b')];_0xabd957++){switch(_0x4ccee0[_0xabd957][_0x5f11('0x1c')]){case _0x5f11('0x1d'):_0x150714[_0x5f11('0x1d')]=_0x2a1f23[_0x4ccee0[_0xabd957][_0x5f11('0x1e')]][_0x5f11('0x1f')]('/')[0x1];_0x150714[_0x5f11('0x20')]=_0x2a1f23[_0x4ccee0[_0xabd957][_0x5f11('0x1e')]][_0x5f11('0x1f')]('/')[0x2];_0x150714[_0x5f11('0x21')]=_0x150714[_0x5f11('0x20')]?_0x150714[_0x5f11('0x20')][_0x5f11('0x1f')]('$')[0x0]:undefined;_0x150714[_0x5f11('0x20')]=_0x4405da[_0x5f11('0xf')]?(_0x150714[_0x5f11('0x21')]||'')+_0x5f11('0x22')+_0x4405da[_0x5f11('0xf')]+'}':(_0x150714['prefix']||'')+'${EXTEN}';_0x5339c5[_0x4ccee0[_0xabd957]['param']]=[_0x5f11('0x23'),_0x150714[_0x5f11('0x1d')],_0x150714[_0x5f11('0x20')]][_0x5f11('0x24')]('/');break;case'options':_0x150714[_0x5f11('0x19')]=_0x2a1f23[_0x4ccee0[_0xabd957][_0x5f11('0x1e')]];if(_0x4405da[_0x5f11('0x13')]!=='none'){if(_0x150714[_0x5f11('0x19')][_0x5f11('0x25')](_0x5f11('0x26'))<0x0){_0x150714[_0x5f11('0x19')]+=_0x5f11('0x26');}}else{_0x150714[_0x5f11('0x19')]=_0x150714[_0x5f11('0x19')][_0x5f11('0x27')]('U(xcally-mixmonitor-context)','');}_0x5339c5[_0x4ccee0[_0xabd957][_0x5f11('0x1e')]]=_0x150714[_0x5f11('0x19')];break;default:_0x5339c5[_0x4ccee0[_0xabd957][_0x5f11('0x1e')]]=_0x2a1f23[_0x4ccee0[_0xabd957][_0x5f11('0x1e')]];}}return _0x5339c5[_0x5f11('0x24')](',');}function _0x334694(_0x2f3342,_0x21924c,_0x32a3cd){return new Promise(function(_0x3e9469,_0x2f29cd){var _0x2434c4=[];if(_[_0x5f11('0x28')](_0x21924c))return _0x3e9469(_0x2434c4);_0x4a62a7[_0x5f11('0x29')][_0x5f11('0x2a')]({'attributes':['id',_0x5f11('0x2b'),_0x5f11('0x2c')],'raw':!![]})[_0x5f11('0x2d')](function(_0x4712d3){for(var _0x3f4289=0x0,_0x185110=0x0;_0x3f4289<_0x21924c[_0x5f11('0x1b')];_0x3f4289++,_0x185110=0x0){var _0x498fd2=_0x21924c[_0x3f4289];var _0x488143=[];var _0xcf440d=[];delete _0x498fd2['id'];if(_0x498fd2[_0x5f11('0x2b')]!==_0x5f11('0x2e')){_0x498fd2[_0x5f11('0x2f')]=[_0x498fd2[_0x5f11('0x2b')]];}else{_0x498fd2['intervals']=_0x498fd2[_0x5f11('0x2c')]?_['map'](_[_0x5f11('0x30')](_0x4712d3,{'IntervalId':_0x498fd2[_0x5f11('0x2c')]}),'interval'):[];}_0x498fd2[_0x5f11('0x9')]=_0x2f3342['context'];_0x498fd2['exten']=_0x2f3342[_0x5f11('0x5')];if(_0x498fd2[_0x5f11('0x3')])_0x498fd2[_0x5f11('0x3')]=_0x498fd2[_0x5f11('0x3')]['toLowerCase']();if(_0x2f3342[_0x5f11('0x3')]===_0x5f11('0xc')){if(_0x498fd2[_0x5f11('0x31')]('tag')&&_0x498fd2[_0x5f11('0x32')]&&_0x498fd2['tag']!=='--'){_0x488143[_0x5f11('0x7')]({'type':_0x498fd2[_0x5f11('0x3')]['toLowerCase'](),'app':_0x5f11('0x4'),'appdata':_0x5f11('0x33')+_0x498fd2[_0x5f11('0x32')],'context':_0x2f3342[_0x5f11('0x9')],'exten':_0x2f3342[_0x5f11('0x5')],'priority':_0x498fd2[_0x5f11('0x2f')][_0x5f11('0x1b')]+_0x32a3cd+_0x185110++,'VoiceExtensionId':_0x2f3342['id']});}_0x488143['push']({'type':_0x498fd2['type'][_0x5f11('0x34')](),'app':_0x5f11('0x35'),'appdata':_0x5f11('0x36')+(_0x498fd2['callerID']?'Set(CALLERID(all)='+_0x498fd2[_0x5f11('0x37')]+')':_0x5f11('0x38')),'context':_0x2f3342[_0x5f11('0x9')],'exten':_0x2f3342[_0x5f11('0x5')],'priority':_0x498fd2[_0x5f11('0x2f')]['length']+_0x32a3cd+_0x185110++,'VoiceExtensionId':_0x2f3342['id']});}else{if(_0x498fd2['hasOwnProperty'](_0x5f11('0x39'))){if([_0x5f11('0x3a'),_0x5f11('0x3b')][_0x5f11('0x3c')](_0x498fd2[_0x5f11('0x3d')][_0x5f11('0x34')]())&&_0x498fd2['appType']!==_0x5f11('0x3e')){if(_0x498fd2[_0x5f11('0x39')]){_0x488143[_0x5f11('0x7')]({'type':_0x498fd2[_0x5f11('0x3')][_0x5f11('0x34')](),'app':_0x5f11('0x35'),'appdata':_0x5f11('0x3f'),'context':_0x2f3342[_0x5f11('0x9')],'exten':_0x2f3342['exten'],'priority':_0x498fd2[_0x5f11('0x2f')][_0x5f11('0x1b')]+_0x32a3cd+_0x185110++,'VoiceExtensionId':_0x2f3342['id']});_0x488143['push']({'type':_0x498fd2[_0x5f11('0x3')]['toLowerCase'](),'app':_0x5f11('0x4'),'appdata':_0x5f11('0x40'),'context':_0x2f3342[_0x5f11('0x9')],'exten':_0x2f3342[_0x5f11('0x5')],'priority':_0x498fd2['intervals'][_0x5f11('0x1b')]+_0x32a3cd+_0x185110++,'VoiceExtensionId':_0x2f3342['id']});}else{_0x488143[_0x5f11('0x7')]({'type':_0x498fd2[_0x5f11('0x3')]['toLowerCase'](),'app':_0x5f11('0x35'),'appdata':_0x5f11('0x41'),'context':_0x2f3342[_0x5f11('0x9')],'exten':_0x2f3342[_0x5f11('0x5')],'priority':_0x498fd2[_0x5f11('0x2f')][_0x5f11('0x1b')]+_0x32a3cd+_0x185110++,'VoiceExtensionId':_0x2f3342['id']});_0x488143[_0x5f11('0x7')]({'type':_0x498fd2[_0x5f11('0x3')][_0x5f11('0x34')](),'app':'Set','appdata':_0x5f11('0x42'),'context':_0x2f3342['context'],'exten':_0x2f3342['exten'],'priority':_0x498fd2[_0x5f11('0x2f')][_0x5f11('0x1b')]+_0x32a3cd+_0x185110++,'VoiceExtensionId':_0x2f3342['id']});}}}}for(var _0x2547a4=0x0;_0x2547a4<_0x498fd2[_0x5f11('0x2f')][_0x5f11('0x1b')];_0x2547a4++){var _0x3a993d=_0x32a3cd+_0x498fd2['intervals'][_0x5f11('0x1b')];var _0x798d72=_0x2547a4===_0x498fd2[_0x5f11('0x2f')][_0x5f11('0x1b')]-0x1?_0x32a3cd+_0x488143['length']+_0xcf440d[_0x5f11('0x1b')]+0x2:_0x32a3cd+_0x2547a4+0x1;_0x488143['splice'](_0x2547a4,0x0,{'type':_0x2f3342[_0x5f11('0x3')],'app':'GotoIfTime','appdata':_0x498fd2[_0x5f11('0x2f')][_0x2547a4]+'?'+_0x2f3342[_0x5f11('0x9')]+_0x5f11('0x43')+_0x3a993d+':'+_0x2f3342[_0x5f11('0x9')]+',${EXTEN},'+_0x798d72,'exten':_0x2f3342[_0x5f11('0x5')],'context':_0x2f3342[_0x5f11('0x9')],'priority':_0x32a3cd+_0x2547a4,'VoiceExtensionId':_0x2f3342['id']});}if(_0x498fd2[_0x5f11('0x44')]===_0x5f11('0x45')){_0x498fd2[_0x5f11('0x46')]=_0x4ab39c(_0x2f3342,_0x498fd2[_0x5f11('0x46')]);}if(_0x498fd2[_0x5f11('0x44')]===_0x5f11('0x47')){_0x488143[_0x5f11('0x7')]({'type':_0x498fd2[_0x5f11('0x3')]['toLowerCase'](),'app':_0x5f11('0x4'),'appdata':_0x5f11('0x48'),'context':_0x2f3342[_0x5f11('0x9')],'exten':_0x2f3342[_0x5f11('0x5')],'priority':_0x498fd2[_0x5f11('0x2f')]['length']+_0x32a3cd+_0x185110++,'VoiceExtensionId':_0x2f3342['id']});}_0x498fd2[_0x5f11('0x49')]=_0x488143[_0x5f11('0x1b')]?_[_0x5f11('0x4a')](_0x488143)[_0x5f11('0x49')]+0x1:_0x32a3cd;_0x2434c4=_[_0x5f11('0x4b')](_0x2434c4,_0x488143,[_0x498fd2],_0xcf440d);_0x32a3cd=_['last'](_0x2434c4)[_0x5f11('0x49')]+0x1;}return _0x3e9469(_0x2434c4);})['catch'](function(_0x41553a){_0x2f29cd(_0x41553a);});});}return _0x230480[_0x5f11('0x4c')](_0x5f11('0x4d'),attributes,{'tableName':_0x5f11('0x4e'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x4abb89){var _0x2bf1e4=this['get']({'plain':!![]});var _0x84f609=_0x2bf1e4[_0x5f11('0x3')]===_0x5f11('0xc')?_0x1de3e4(_0x2bf1e4):_0x3f4505(_0x2bf1e4);return _0x334694(_0x2bf1e4,_0x4abb89,_[_0x5f11('0x4a')](_0x84f609)[_0x5f11('0x49')]+0x1)[_0x5f11('0x2d')](function(_0x5bf7a0){var _0x22d9e7=_[_0x5f11('0x4b')](_0x84f609,_0x5bf7a0);_0x22d9e7['push']({'type':_0x2bf1e4['type'],'app':_0x5f11('0x4f'),'exten':_0x2bf1e4['exten'],'context':_0x2bf1e4['context'],'priority':_[_0x5f11('0x4a')](_0x22d9e7)['priority']+0x1,'VoiceExtensionId':_0x2bf1e4['id']});return _0x22d9e7;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index ac58220..dc9838f 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 _0x1354=['stringify','error','message','catch','GetVoiceExtension','findAll','options','raw','attributes','limit','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','register','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x41554c,_0x406f58){var _0x920839=function(_0x3d3ca7){while(--_0x3d3ca7){_0x41554c['push'](_0x41554c['shift']());}};_0x920839(++_0x406f58);}(_0x1354,0x95));var _0x4135=function(_0x3caeb5,_0x219363){_0x3caeb5=_0x3caeb5-0x0;var _0x5eca7e=_0x1354[_0x3caeb5];return _0x5eca7e;};'use strict';var _=require(_0x4135('0x0'));var util=require(_0x4135('0x1'));var moment=require(_0x4135('0x2'));var BPromise=require(_0x4135('0x3'));var rs=require(_0x4135('0x4'));var fs=require('fs');var Redis=require(_0x4135('0x5'));var db=require(_0x4135('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4135('0x7'))(_0x4135('0x8'));var config=require(_0x4135('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4135('0xa')][_0x4135('0xb')]({'port':0x232a});config['redis']=_[_0x4135('0xc')](config[_0x4135('0xd')],{'host':_0x4135('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4135('0xd')]));require('./voiceExtension.socket')[_0x4135('0xf')](socket);function respondWithRpcPromise(_0x1d0cc6,_0x4447c8,_0x39822e){return new BPromise(function(_0x5dd78a,_0x35d576){return client['request'](_0x1d0cc6,_0x39822e)['then'](function(_0x73c55f){logger[_0x4135('0x10')](_0x4135('0x11'),_0x4447c8,'request\x20sent');logger[_0x4135('0x12')](_0x4135('0x13'),_0x4447c8,_0x4135('0x14'),JSON[_0x4135('0x15')](_0x73c55f));if(_0x73c55f[_0x4135('0x16')]){if(_0x73c55f[_0x4135('0x16')]['code']===0x1f4){logger['error'](_0x4135('0x11'),_0x4447c8,_0x73c55f[_0x4135('0x16')][_0x4135('0x17')]);return _0x35d576(_0x73c55f[_0x4135('0x16')]['message']);}logger[_0x4135('0x16')](_0x4135('0x11'),_0x4447c8,_0x73c55f['error']['message']);return _0x5dd78a(_0x73c55f[_0x4135('0x16')]['message']);}else{logger[_0x4135('0x10')]('VoiceExtension,\x20%s,\x20%s',_0x4447c8,'request\x20sent');_0x5dd78a(_0x73c55f['result']['message']);}})[_0x4135('0x18')](function(_0x55adba){logger[_0x4135('0x16')](_0x4135('0x11'),_0x4447c8,_0x55adba);_0x35d576(_0x55adba);});});}exports[_0x4135('0x19')]=function(_0x5eddcc){var _0x3f7e85=this;return new Promise(function(_0x3dae32,_0x398294){return db['VoiceExtension'][_0x4135('0x1a')]({'raw':_0x5eddcc['options']?_0x5eddcc[_0x4135('0x1b')][_0x4135('0x1c')]===undefined?!![]:![]:!![],'where':_0x5eddcc[_0x4135('0x1b')]?_0x5eddcc[_0x4135('0x1b')]['where']||null:null,'attributes':_0x5eddcc[_0x4135('0x1b')]?_0x5eddcc[_0x4135('0x1b')][_0x4135('0x1d')]||null:null,'limit':_0x5eddcc[_0x4135('0x1b')]?_0x5eddcc[_0x4135('0x1b')][_0x4135('0x1e')]||null:null,'include':_0x5eddcc[_0x4135('0x1b')]?_0x5eddcc[_0x4135('0x1b')][_0x4135('0x1f')]?_[_0x4135('0x20')](_0x5eddcc[_0x4135('0x1b')][_0x4135('0x1f')],function(_0x212228){return{'model':db[_0x212228[_0x4135('0x21')]],'as':_0x212228['as'],'attributes':_0x212228['attributes'],'include':_0x212228[_0x4135('0x1f')]?_[_0x4135('0x20')](_0x212228[_0x4135('0x1f')],function(_0x36b9e3){return{'model':db[_0x36b9e3[_0x4135('0x21')]],'as':_0x36b9e3['as'],'attributes':_0x36b9e3[_0x4135('0x1d')],'include':_0x36b9e3['include']?_[_0x4135('0x20')](_0x36b9e3[_0x4135('0x1f')],function(_0x31b508){return{'model':db[_0x31b508[_0x4135('0x21')]],'as':_0x31b508['as'],'attributes':_0x31b508[_0x4135('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x411ee0){logger[_0x4135('0x10')]('GetVoiceExtension',_0x5eddcc);logger[_0x4135('0x12')]('GetVoiceExtension',_0x5eddcc,JSON[_0x4135('0x15')](_0x411ee0));_0x3dae32(_0x411ee0);})[_0x4135('0x18')](function(_0x25a672){logger[_0x4135('0x16')]('GetVoiceExtension',_0x25a672[_0x4135('0x17')],_0x5eddcc);_0x398294(_0x3f7e85[_0x4135('0x16')](0x1f4,_0x25a672[_0x4135('0x17')]));});});}; \ No newline at end of file +var _0x565f=['../../mysqldb','../../config/utils','../../config/logger','rpc','http','defaults','redis','localhost','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceExtension','VoiceExtension','findAll','options','where','attributes','limit','include','model','map','info','catch','util','moment','bluebird','ioredis'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x565f,0x68));var _0xf565=function(_0x1fe639,_0x5c9728){_0x1fe639=_0x1fe639-0x0;var _0x5338ff=_0x565f[_0x1fe639];return _0x5338ff;};'use strict';var _=require('lodash');var util=require(_0xf565('0x0'));var moment=require(_0xf565('0x1'));var BPromise=require(_0xf565('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf565('0x3'));var db=require(_0xf565('0x4'))['db'];var utils=require(_0xf565('0x5'));var logger=require(_0xf565('0x6'))(_0xf565('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf565('0x8')]({'port':0x232a});config['redis']=_[_0xf565('0x9')](config[_0xf565('0xa')],{'host':_0xf565('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf565('0xa')]));require('./voiceExtension.socket')[_0xf565('0xc')](socket);function respondWithRpcPromise(_0x5aaa3f,_0x2d7f4e,_0x1a362d){return new BPromise(function(_0x80b001,_0x1bc33c){return client[_0xf565('0xd')](_0x5aaa3f,_0x1a362d)[_0xf565('0xe')](function(_0x4c13ed){logger['info'](_0xf565('0xf'),_0x2d7f4e,_0xf565('0x10'));logger[_0xf565('0x11')](_0xf565('0x12'),_0x2d7f4e,_0xf565('0x10'),JSON[_0xf565('0x13')](_0x4c13ed));if(_0x4c13ed[_0xf565('0x14')]){if(_0x4c13ed[_0xf565('0x14')][_0xf565('0x15')]===0x1f4){logger[_0xf565('0x14')]('VoiceExtension,\x20%s,\x20%s',_0x2d7f4e,_0x4c13ed[_0xf565('0x14')][_0xf565('0x16')]);return _0x1bc33c(_0x4c13ed['error'][_0xf565('0x16')]);}logger[_0xf565('0x14')](_0xf565('0xf'),_0x2d7f4e,_0x4c13ed[_0xf565('0x14')][_0xf565('0x16')]);return _0x80b001(_0x4c13ed['error'][_0xf565('0x16')]);}else{logger['info']('VoiceExtension,\x20%s,\x20%s',_0x2d7f4e,_0xf565('0x10'));_0x80b001(_0x4c13ed[_0xf565('0x17')]['message']);}})['catch'](function(_0x2d2197){logger['error'](_0xf565('0xf'),_0x2d7f4e,_0x2d2197);_0x1bc33c(_0x2d2197);});});}exports[_0xf565('0x18')]=function(_0x1f364e){var _0x51215d=this;return new Promise(function(_0x55032c,_0xb7b197){return db[_0xf565('0x19')][_0xf565('0x1a')]({'raw':_0x1f364e[_0xf565('0x1b')]?_0x1f364e[_0xf565('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1f364e[_0xf565('0x1b')]?_0x1f364e[_0xf565('0x1b')][_0xf565('0x1c')]||null:null,'attributes':_0x1f364e[_0xf565('0x1b')]?_0x1f364e[_0xf565('0x1b')][_0xf565('0x1d')]||null:null,'limit':_0x1f364e[_0xf565('0x1b')]?_0x1f364e[_0xf565('0x1b')][_0xf565('0x1e')]||null:null,'include':_0x1f364e[_0xf565('0x1b')]?_0x1f364e['options'][_0xf565('0x1f')]?_['map'](_0x1f364e[_0xf565('0x1b')][_0xf565('0x1f')],function(_0x50da32){return{'model':db[_0x50da32[_0xf565('0x20')]],'as':_0x50da32['as'],'attributes':_0x50da32[_0xf565('0x1d')],'include':_0x50da32[_0xf565('0x1f')]?_[_0xf565('0x21')](_0x50da32[_0xf565('0x1f')],function(_0x1239a7){return{'model':db[_0x1239a7[_0xf565('0x20')]],'as':_0x1239a7['as'],'attributes':_0x1239a7[_0xf565('0x1d')],'include':_0x1239a7['include']?_[_0xf565('0x21')](_0x1239a7[_0xf565('0x1f')],function(_0x18082a){return{'model':db[_0x18082a[_0xf565('0x20')]],'as':_0x18082a['as'],'attributes':_0x18082a[_0xf565('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2288db){logger[_0xf565('0x22')](_0xf565('0x18'),_0x1f364e);logger[_0xf565('0x11')](_0xf565('0x18'),_0x1f364e,JSON['stringify'](_0x2288db));_0x55032c(_0x2288db);})[_0xf565('0x23')](function(_0x41d6bf){logger[_0xf565('0x14')](_0xf565('0x18'),_0x41d6bf[_0xf565('0x16')],_0x1f364e);_0xb7b197(_0x51215d[_0xf565('0x14')](0x1f4,_0x41d6bf['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 1b9f128..76551df 100644 --- a/server/api/voiceExtension/voiceExtension.socket.js +++ b/server/api/voiceExtension/voiceExtension.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['save','remove','update','emit','removeListener','voiceExtension:'];(function(_0x915bb8,_0x3b1f3d){var _0x55eac3=function(_0x1c5c23){while(--_0x1c5c23){_0x915bb8['push'](_0x915bb8['shift']());}};_0x55eac3(++_0x3b1f3d);}(_0x1261,0x144));var _0x1126=function(_0x3d6d05,_0x16c8b8){_0x3d6d05=_0x3d6d05-0x0;var _0x288baf=_0x1261[_0x3d6d05];return _0x288baf;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x1126('0x0'),_0x1126('0x1'),_0x1126('0x2')];function createListener(_0x331a2c,_0x39b786){return function(_0x350f3a){_0x39b786[_0x1126('0x3')](_0x331a2c,_0x350f3a);};}function removeListener(_0x4245ca,_0x21a480){return function(){VoiceExtensionEvents[_0x1126('0x4')](_0x4245ca,_0x21a480);};}exports['register']=function(_0x5c68c8){for(var _0x40ba58=0x0,_0x907180=events['length'];_0x40ba58<_0x907180;_0x40ba58++){var _0x17e5f0=events[_0x40ba58];var _0x28772d=createListener(_0x1126('0x5')+_0x17e5f0,_0x5c68c8);VoiceExtensionEvents['on'](_0x17e5f0,_0x28772d);}}; \ No newline at end of file +var _0x7fbe=['length','voiceExtension:','remove','update','emit','removeListener','register'];(function(_0xd709aa,_0x4674db){var _0x3b763d=function(_0x2c59ab){while(--_0x2c59ab){_0xd709aa['push'](_0xd709aa['shift']());}};_0x3b763d(++_0x4674db);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x87239,_0x38c793){_0x87239=_0x87239-0x0;var _0x53af1e=_0x7fbe[_0x87239];return _0x53af1e;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=['save',_0xe7fb('0x0'),_0xe7fb('0x1')];function createListener(_0x294c21,_0x1703d5){return function(_0x517d3a){_0x1703d5[_0xe7fb('0x2')](_0x294c21,_0x517d3a);};}function removeListener(_0x11d2c4,_0x4524ff){return function(){VoiceExtensionEvents[_0xe7fb('0x3')](_0x11d2c4,_0x4524ff);};}exports[_0xe7fb('0x4')]=function(_0x290172){for(var _0x12d1b0=0x0,_0x24cd67=events[_0xe7fb('0x5')];_0x12d1b0<_0x24cd67;_0x12d1b0++){var _0x5ad75b=events[_0x12d1b0];var _0x213ebc=createListener(_0xe7fb('0x6')+_0x5ad75b,_0x290172);VoiceExtensionEvents['on'](_0x5ad75b,_0x213ebc);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 13b89ee..1f61c35 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 _0x8aad=['delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../config/environment','isAuthenticated','index','get','show','/:id/messages','post','create','put','/:id','update'];(function(_0x4986da,_0x15991c){var _0x489483=function(_0x583bdc){while(--_0x583bdc){_0x4986da['push'](_0x4986da['shift']());}};_0x489483(++_0x15991c);}(_0x8aad,0x146));var _0xd8aa=function(_0x4b1a49,_0x2cf1eb){_0x4b1a49=_0x4b1a49-0x0;var _0x2f69d1=_0x8aad[_0x4b1a49];return _0x2f69d1;};'use strict';var multer=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var path=require('path');var timeout=require(_0xd8aa('0x2'));var express=require('express');var router=express[_0xd8aa('0x3')]();var fs_extra=require(_0xd8aa('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd8aa('0x5'));var controller=require('./voiceMail.controller');router['get']('/',auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x7')]);router[_0xd8aa('0x8')]('/:id',auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x9')]);router[_0xd8aa('0x8')](_0xd8aa('0xa'),auth['isAuthenticated'](),controller['getMessages']);router[_0xd8aa('0xb')]('/',auth[_0xd8aa('0x6')](),controller[_0xd8aa('0xc')]);router[_0xd8aa('0xd')](_0xd8aa('0xe'),auth['isAuthenticated'](),controller[_0xd8aa('0xf')]);router[_0xd8aa('0x10')](_0xd8aa('0xe'),auth[_0xd8aa('0x6')](),controller[_0xd8aa('0x11')]);module[_0xd8aa('0x12')]=router; \ No newline at end of file +var _0x3f8a=['show','/:id/messages','getMessages','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id'];(function(_0x5ea710,_0x40a4f8){var _0x5397e2=function(_0x234979){while(--_0x234979){_0x5ea710['push'](_0x5ea710['shift']());}};_0x5397e2(++_0x40a4f8);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x41b72e,_0x35330e){_0x41b72e=_0x41b72e-0x0;var _0x215097=_0x3f8a[_0x41b72e];return _0x215097;};'use strict';var multer=require(_0xa3f8('0x0'));var util=require(_0xa3f8('0x1'));var path=require(_0xa3f8('0x2'));var timeout=require(_0xa3f8('0x3'));var express=require('express');var router=express[_0xa3f8('0x4')]();var fs_extra=require(_0xa3f8('0x5'));var auth=require(_0xa3f8('0x6'));var interaction=require(_0xa3f8('0x7'));var config=require(_0xa3f8('0x8'));var controller=require(_0xa3f8('0x9'));router[_0xa3f8('0xa')]('/',auth[_0xa3f8('0xb')](),controller[_0xa3f8('0xc')]);router[_0xa3f8('0xa')](_0xa3f8('0xd'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0xe')]);router[_0xa3f8('0xa')](_0xa3f8('0xf'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x10')]);router['post']('/',auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x11')]);router[_0xa3f8('0x12')](_0xa3f8('0xd'),auth['isAuthenticated'](),controller[_0xa3f8('0x13')]);router[_0xa3f8('0x14')](_0xa3f8('0xd'),auth[_0xa3f8('0xb')](),controller[_0xa3f8('0x15')]);module[_0xa3f8('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index df179fe..64c2d59 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 _0xe130=['contest_mailbox','setDataValue','email','trim','central','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','\x20-\x20','getDataValue','mailbox','exports','STRING','from-voicemail'];(function(_0x3bd4db,_0xaefa60){var _0x5ab35e=function(_0x5681c5){while(--_0x5681c5){_0x3bd4db['push'](_0x3bd4db['shift']());}};_0x5ab35e(++_0xaefa60);}(_0xe130,0xb8));var _0x0e13=function(_0x256afb,_0x366986){_0x256afb=_0x256afb-0x0;var _0x40711a=_0xe130[_0x256afb];return _0x40711a;};'use strict';var Sequelize=require('sequelize');module[_0x0e13('0x0')]={'customer_id':{'type':Sequelize[_0x0e13('0x1')]},'context':{'type':Sequelize[_0x0e13('0x1')],'defaultValue':_0x0e13('0x2'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x0e13('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x0e13('0x1')]},'email':{'type':Sequelize[_0x0e13('0x1')],'validate':{'isEmail':!![]},'set':function(_0x163715){this[_0x0e13('0x4')](_0x0e13('0x5'),typeof _0x163715==='string'&&_0x163715[_0x0e13('0x6')]()?_0x163715[_0x0e13('0x6')]():null);}},'pager':{'type':Sequelize[_0x0e13('0x1')]},'tz':{'type':Sequelize[_0x0e13('0x1')],'defaultValue':_0x0e13('0x7')},'attach':{'type':Sequelize['ENUM'](_0x0e13('0x8'),'no'),'defaultValue':_0x0e13('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0x0e13('0x9')](_0x0e13('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x0e13('0x1')]},'callback':{'type':Sequelize[_0x0e13('0x1')]},'review':{'type':Sequelize['ENUM'](_0x0e13('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x0e13('0x9')](_0x0e13('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x0e13('0x9')](_0x0e13('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x0e13('0x9')](_0x0e13('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x0e13('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x0e13('0x9')](_0x0e13('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x0e13('0x9')](_0x0e13('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x0e13('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x0e13('0x9')](_0x0e13('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x0e13('0x8'),'no'),'defaultValue':_0x0e13('0x8'),'allowNull':![]},'stamp':{'type':_0x0e13('0xb')},'emailsubject':{'type':Sequelize[_0x0e13('0x1')]},'emailbody':{'type':Sequelize[_0x0e13('0x1')]},'maxsecs':{'type':Sequelize[_0x0e13('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x0e13('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x0e13('0xd')],'get':function(){return this['getDataValue']('fullname')+_0x0e13('0xe')+this[_0x0e13('0xf')](_0x0e13('0x10'));}}}; \ No newline at end of file +var _0x4882=['ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','getDataValue','fullname','\x20-\x20','mailbox','STRING','from-voicemail','contest_mailbox','email','trim'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4882,0x159));var _0x2488=function(_0x4ca805,_0x27b886){_0x4ca805=_0x4ca805-0x0;var _0x332848=_0x4882[_0x4ca805];return _0x332848;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0x2488('0x0')]},'context':{'type':Sequelize[_0x2488('0x0')],'defaultValue':_0x2488('0x1'),'unique':_0x2488('0x2')},'mailbox':{'type':Sequelize[_0x2488('0x0')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x2488('0x0')]},'fullname':{'type':Sequelize[_0x2488('0x0')]},'email':{'type':Sequelize[_0x2488('0x0')],'validate':{'isEmail':!![]},'set':function(_0x1d8b97){this['setDataValue'](_0x2488('0x3'),typeof _0x1d8b97==='string'&&_0x1d8b97[_0x2488('0x4')]()?_0x1d8b97[_0x2488('0x4')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x2488('0x0')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x2488('0x5')](_0x2488('0x6'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x2488('0x6'),'no'),'defaultValue':_0x2488('0x6'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x2488('0x0')]},'review':{'type':Sequelize[_0x2488('0x5')](_0x2488('0x6'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x2488('0x5')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x2488('0x5')](_0x2488('0x6'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x2488('0x5')](_0x2488('0x6'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x2488('0x7'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x2488('0x5')](_0x2488('0x6'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x2488('0x5')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x2488('0x6'),'allowNull':![]},'forcename':{'type':Sequelize[_0x2488('0x5')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x2488('0x6'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x2488('0x5')](_0x2488('0x6'),'no'),'defaultValue':_0x2488('0x6'),'allowNull':![]},'stamp':{'type':_0x2488('0x8')},'emailsubject':{'type':Sequelize[_0x2488('0x0')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x2488('0x9')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x2488('0x9')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x2488('0xa')](_0x2488('0xb'))+_0x2488('0xc')+this[_0x2488('0xa')](_0x2488('0xd'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index fae196f..aab1490 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 _0x4483=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','then','get','Voicemails','UserProfileResource','error','name','index','VoiceMail','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','find','getMessages','findOne','VoiceMailMessage','findAndCountAll','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3b37d0,_0x5e3d41){var _0x4987b6=function(_0xd63e1c){while(--_0xd63e1c){_0x3b37d0['push'](_0x3b37d0['shift']());}};_0x4987b6(++_0x5e3d41);}(_0x4483,0x1a3));var _0x3448=function(_0x1ed67b,_0x4dd24c){_0x1ed67b=_0x1ed67b-0x0;var _0x5ec1a6=_0x4483[_0x1ed67b];return _0x5ec1a6;};'use strict';var emlformat=require(_0x3448('0x0'));var rimraf=require(_0x3448('0x1'));var zipdir=require(_0x3448('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3448('0x3'));var moment=require(_0x3448('0x4'));var BPromise=require(_0x3448('0x5'));var Mustache=require(_0x3448('0x6'));var util=require(_0x3448('0x7'));var path=require('path');var sox=require(_0x3448('0x8'));var csv=require(_0x3448('0x9'));var ejs=require(_0x3448('0xa'));var fs=require('fs');var fs_extra=require(_0x3448('0xb'));var _=require(_0x3448('0xc'));var squel=require(_0x3448('0xd'));var crypto=require(_0x3448('0xe'));var jsforce=require(_0x3448('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3448('0x10'));var Papa=require(_0x3448('0x11'));var Redis=require(_0x3448('0x12'));var authService=require(_0x3448('0x13'));var qs=require(_0x3448('0x14'));var as=require(_0x3448('0x15'));var hardwareService=require(_0x3448('0x16'));var logger=require(_0x3448('0x17'))(_0x3448('0x18'));var utils=require(_0x3448('0x19'));var config=require(_0x3448('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x298ae6,_0x38fbb1){_0x38fbb1=_0x38fbb1||0xcc;return function(_0x5f52bd){if(_0x5f52bd){return _0x298ae6[_0x3448('0x1b')](_0x38fbb1);}return _0x298ae6[_0x3448('0x1c')](_0x38fbb1)[_0x3448('0x1d')]();};}function respondWithResult(_0x549306,_0x14104c){_0x14104c=_0x14104c||0xc8;return function(_0x2952a6){if(_0x2952a6){return _0x549306['status'](_0x14104c)[_0x3448('0x1e')](_0x2952a6);}};}function respondWithFilteredResult(_0x2c2da6,_0x46784f){return function(_0x4fc70f){if(_0x4fc70f){var _0x472518=typeof _0x46784f[_0x3448('0x1f')]===_0x3448('0x20')&&typeof _0x46784f[_0x3448('0x21')]===_0x3448('0x20');var _0x1b2081=_0x4fc70f[_0x3448('0x22')];var _0x425514=_0x472518?0x0:_0x46784f['offset'];var _0x1658cd=_0x472518?_0x4fc70f['count']:_0x46784f['offset']+_0x46784f['limit'];var _0x1e9774;if(_0x1658cd>=_0x1b2081){_0x1658cd=_0x1b2081;_0x1e9774=0xc8;}else{_0x1e9774=0xce;}_0x2c2da6[_0x3448('0x1c')](_0x1e9774);return _0x2c2da6[_0x3448('0x23')]('Content-Range',_0x425514+'-'+_0x1658cd+'/'+_0x1b2081)[_0x3448('0x1e')](_0x4fc70f);}return null;};}function patchUpdates(_0x392c8d){return function(_0x317de6){try{jsonpatch[_0x3448('0x24')](_0x317de6,_0x392c8d,!![]);}catch(_0x29a15a){return BPromise[_0x3448('0x25')](_0x29a15a);}return _0x317de6['save']();};}function saveUpdates(_0x54c7ee,_0x4e6716){return function(_0x1b3d5a){if(_0x1b3d5a){return _0x1b3d5a[_0x3448('0x26')](_0x54c7ee)['then'](function(_0x5b1f7c){return _0x5b1f7c;});}return null;};}function removeEntity(_0x2dcd40,_0x4371d6){return function(_0x22ad5c){if(_0x22ad5c){return _0x22ad5c[_0x3448('0x27')]()[_0x3448('0x28')](function(){var _0x566ff5=_0x22ad5c[_0x3448('0x29')]({'plain':!![]});var _0x1b5c49=_0x3448('0x2a');return db[_0x3448('0x2b')][_0x3448('0x27')]({'where':{'type':_0x1b5c49,'resourceId':_0x566ff5['id']}})['then'](function(){return _0x22ad5c;});})[_0x3448('0x28')](function(){_0x2dcd40[_0x3448('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x19a479,_0x12c22d){return function(_0x310912){if(!_0x310912){_0x19a479[_0x3448('0x1b')](0x194);}return _0x310912;};}function handleError(_0x38fab2,_0x35f026){_0x35f026=_0x35f026||0x1f4;return function(_0x31be64){logger[_0x3448('0x2c')](_0x31be64['stack']);if(_0x31be64[_0x3448('0x2d')]){delete _0x31be64[_0x3448('0x2d')];}_0x38fab2[_0x3448('0x1c')](_0x35f026)['send'](_0x31be64);};}exports[_0x3448('0x2e')]=function(_0x5dfdf7,_0x486f2c){var _0x493898={},_0x52fb48={},_0xff6513={'count':0x0,'rows':[]};var _0x5e96f0=_['map'](db[_0x3448('0x2f')][_0x3448('0x30')],function(_0x32121c){return{'name':_0x32121c[_0x3448('0x31')],'type':_0x32121c['type'][_0x3448('0x32')]};});_0x52fb48[_0x3448('0x33')]=_[_0x3448('0x34')](_0x5e96f0,'name');_0x52fb48[_0x3448('0x35')]=_[_0x3448('0x36')](_0x5dfdf7['query']);_0x52fb48['filters']=_[_0x3448('0x37')](_0x52fb48[_0x3448('0x33')],_0x52fb48[_0x3448('0x35')]);_0x493898[_0x3448('0x38')]=_['intersection'](_0x52fb48[_0x3448('0x33')],qs[_0x3448('0x39')](_0x5dfdf7[_0x3448('0x35')][_0x3448('0x39')]));_0x493898['attributes']=_0x493898[_0x3448('0x38')][_0x3448('0x3a')]?_0x493898['attributes']:_0x52fb48[_0x3448('0x33')];if(!_0x5dfdf7[_0x3448('0x35')][_0x3448('0x3b')](_0x3448('0x3c'))){_0x493898[_0x3448('0x21')]=qs[_0x3448('0x21')](_0x5dfdf7[_0x3448('0x35')][_0x3448('0x21')]);_0x493898[_0x3448('0x1f')]=qs['offset'](_0x5dfdf7['query'][_0x3448('0x1f')]);}_0x493898['order']=qs[_0x3448('0x3d')](_0x5dfdf7[_0x3448('0x35')][_0x3448('0x3d')]);_0x493898[_0x3448('0x3e')]=qs['filters'](_[_0x3448('0x3f')](_0x5dfdf7[_0x3448('0x35')],_0x52fb48[_0x3448('0x40')]),_0x5e96f0);if(_0x5dfdf7[_0x3448('0x35')][_0x3448('0x41')]){_0x493898[_0x3448('0x3e')]=_[_0x3448('0x42')](_0x493898[_0x3448('0x3e')],{'$or':_[_0x3448('0x34')](_0x5e96f0,function(_0x5a58c5){if(_0x5a58c5[_0x3448('0x43')]!==_0x3448('0x44')){var _0x322b46={};_0x322b46[_0x5a58c5[_0x3448('0x2d')]]={'$like':'%'+_0x5dfdf7[_0x3448('0x35')]['filter']+'%'};return _0x322b46;}})});}_0x493898=_[_0x3448('0x42')]({},_0x493898,_0x5dfdf7[_0x3448('0x45')]);var _0x4a6e5={'where':_0x493898[_0x3448('0x3e')]};return db[_0x3448('0x2f')][_0x3448('0x22')](_0x4a6e5)[_0x3448('0x28')](function(_0x3db5f1){_0xff6513['count']=_0x3db5f1;if(_0x5dfdf7[_0x3448('0x35')][_0x3448('0x46')]){_0x493898[_0x3448('0x47')]=[{'all':!![]}];}return db['VoiceMail'][_0x3448('0x48')](_0x493898);})[_0x3448('0x28')](function(_0x21f989){_0xff6513[_0x3448('0x49')]=_0x21f989;return _0xff6513;})[_0x3448('0x28')](respondWithFilteredResult(_0x486f2c,_0x493898))[_0x3448('0x4a')](handleError(_0x486f2c,null));};exports[_0x3448('0x4b')]=function(_0x4f54e7,_0x2165c7){var _0x46b172={'raw':!![],'where':{'id':_0x4f54e7[_0x3448('0x4c')]['id']}},_0x1e7fb7={};_0x1e7fb7[_0x3448('0x33')]=_[_0x3448('0x36')](db['VoiceMail'][_0x3448('0x30')]);_0x1e7fb7['query']=_['keys'](_0x4f54e7[_0x3448('0x35')]);_0x1e7fb7[_0x3448('0x40')]=_['intersection'](_0x1e7fb7[_0x3448('0x33')],_0x1e7fb7[_0x3448('0x35')]);_0x46b172['attributes']=_[_0x3448('0x37')](_0x1e7fb7[_0x3448('0x33')],qs['fields'](_0x4f54e7[_0x3448('0x35')][_0x3448('0x39')]));_0x46b172[_0x3448('0x38')]=_0x46b172[_0x3448('0x38')][_0x3448('0x3a')]?_0x46b172[_0x3448('0x38')]:_0x1e7fb7[_0x3448('0x33')];if(_0x4f54e7['query']['includeAll']){_0x46b172[_0x3448('0x47')]=[{'all':!![]}];}_0x46b172=_[_0x3448('0x42')]({},_0x46b172,_0x4f54e7[_0x3448('0x45')]);return db[_0x3448('0x2f')]['find'](_0x46b172)[_0x3448('0x28')](handleEntityNotFound(_0x2165c7,null))[_0x3448('0x28')](respondWithResult(_0x2165c7,null))[_0x3448('0x4a')](handleError(_0x2165c7,null));};exports[_0x3448('0x4d')]=function(_0x363374,_0x5d942b){return db[_0x3448('0x2f')]['create'](_0x363374[_0x3448('0x4e')],{})[_0x3448('0x28')](function(_0x5c8e42){var _0x479b79=_0x363374[_0x3448('0x4f')][_0x3448('0x29')]({'plain':!![]});if(!_0x479b79)throw new Error(_0x3448('0x50'));if(_0x479b79[_0x3448('0x51')]===_0x3448('0x4f')){var _0xc769e1=_0x5c8e42['get']({'plain':!![]});var _0x23dbda=_0x3448('0x2a');return db['UserProfileSection']['find']({'where':{'name':_0x23dbda,'userProfileId':_0x479b79[_0x3448('0x52')]},'raw':!![]})[_0x3448('0x28')](function(_0x4d20ba){if(_0x4d20ba&&_0x4d20ba['autoAssociation']===0x0){return db[_0x3448('0x2b')][_0x3448('0x4d')]({'name':_0xc769e1[_0x3448('0x2d')],'resourceId':_0xc769e1['id'],'type':_0x4d20ba[_0x3448('0x2d')],'sectionId':_0x4d20ba['id']},{})[_0x3448('0x28')](function(){return _0x5c8e42;});}else{return _0x5c8e42;}})[_0x3448('0x4a')](function(_0x2aea70){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2aea70);throw _0x2aea70;});}return _0x5c8e42;})['then'](respondWithResult(_0x5d942b,0xc9))[_0x3448('0x4a')](handleError(_0x5d942b,null));};exports[_0x3448('0x26')]=function(_0x5cf3fe,_0x35ce1d){if(_0x5cf3fe[_0x3448('0x4e')]['id']){delete _0x5cf3fe['body']['id'];}return db[_0x3448('0x2f')][_0x3448('0x53')]({'where':{'id':_0x5cf3fe['params']['id']}})[_0x3448('0x28')](handleEntityNotFound(_0x35ce1d,null))[_0x3448('0x28')](saveUpdates(_0x5cf3fe[_0x3448('0x4e')],null))[_0x3448('0x28')](respondWithResult(_0x35ce1d,null))[_0x3448('0x4a')](handleError(_0x35ce1d,null));};exports[_0x3448('0x27')]=function(_0xeda861,_0x1b7d87){return db[_0x3448('0x2f')]['find']({'where':{'id':_0xeda861[_0x3448('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1b7d87,null))[_0x3448('0x28')](removeEntity(_0x1b7d87,null))[_0x3448('0x4a')](handleError(_0x1b7d87,null));};exports[_0x3448('0x54')]=function(_0x58422,_0x1cbeae,_0x332e02){return db['VoiceMail'][_0x3448('0x55')]({'where':{'id':_0x58422['params']['id']}})[_0x3448('0x28')](handleEntityNotFound(_0x1cbeae,null))[_0x3448('0x28')](function(_0x3bf4d2){var _0x5c9320;var _0x3ead11={},_0x4e381f={};_0x4e381f['model']=_[_0x3448('0x36')](db[_0x3448('0x56')][_0x3448('0x30')]);_0x4e381f['query']=_[_0x3448('0x36')](_0x58422[_0x3448('0x35')]);_0x4e381f[_0x3448('0x40')]=_[_0x3448('0x37')](_0x4e381f[_0x3448('0x33')],_0x4e381f[_0x3448('0x35')]);_0x3ead11[_0x3448('0x38')]=_[_0x3448('0x37')](_0x4e381f[_0x3448('0x33')],qs[_0x3448('0x39')](_0x58422[_0x3448('0x35')][_0x3448('0x39')]));_0x3ead11[_0x3448('0x38')]=_0x3ead11[_0x3448('0x38')][_0x3448('0x3a')]?_0x3ead11[_0x3448('0x38')]:_0x4e381f[_0x3448('0x33')];if(!_0x58422[_0x3448('0x35')]['hasOwnProperty'](_0x3448('0x3c'))){_0x3ead11['limit']=qs[_0x3448('0x21')](_0x58422['query'][_0x3448('0x21')]);_0x3ead11[_0x3448('0x1f')]=qs['offset'](_0x58422[_0x3448('0x35')][_0x3448('0x1f')]);}_0x3ead11['order']=qs['sort'](_0x58422[_0x3448('0x35')]['sort']);_0x3ead11['where']=qs[_0x3448('0x40')](_[_0x3448('0x3f')](_0x58422['query'],_0x4e381f['filters']));if(_0x58422[_0x3448('0x35')][_0x3448('0x41')]){_0x3ead11[_0x3448('0x3e')]=_[_0x3448('0x42')](_0x3ead11[_0x3448('0x3e')],{'$or':_[_0x3448('0x34')](_0x3ead11[_0x3448('0x38')],function(_0x10749d){var _0x2cf3ef={};_0x2cf3ef[_0x10749d]={'$like':'%'+_0x58422[_0x3448('0x35')][_0x3448('0x41')]+'%'};return _0x2cf3ef;})});}_0x3ead11[_0x3448('0x3e')]=_[_0x3448('0x42')](_0x3ead11[_0x3448('0x3e')],{'mailboxuser':_0x3bf4d2['mailbox']});_0x3ead11=_[_0x3448('0x42')]({},_0x3ead11,_0x58422[_0x3448('0x45')]);return db['VoiceMailMessage'][_0x3448('0x57')](_0x3ead11)[_0x3448('0x28')](respondWithFilteredResult(_0x1cbeae,_0x3ead11));})['catch'](handleError(_0x1cbeae,null));}; \ No newline at end of file +var _0x3f8c=['create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMessages','findAndCountAll','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','Voicemails','UserProfileResource','destroy','error','stack','name','index','map','VoiceMail','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch'];(function(_0x4f6c7d,_0x258d8f){var _0x5817df=function(_0x16ebc4){while(--_0x16ebc4){_0x4f6c7d['push'](_0x4f6c7d['shift']());}};_0x5817df(++_0x258d8f);}(_0x3f8c,0x104));var _0xc3f8=function(_0x2e607d,_0x36fba6){_0x2e607d=_0x2e607d-0x0;var _0x4432c5=_0x3f8c[_0x2e607d];return _0x4432c5;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc3f8('0x0'));var jsonpatch=require(_0xc3f8('0x1'));var rp=require(_0xc3f8('0x2'));var moment=require(_0xc3f8('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc3f8('0x4'));var ejs=require(_0xc3f8('0x5'));var fs=require('fs');var fs_extra=require(_0xc3f8('0x6'));var _=require(_0xc3f8('0x7'));var squel=require(_0xc3f8('0x8'));var crypto=require(_0xc3f8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc3f8('0xa'));var toCsv=require(_0xc3f8('0x4'));var querystring=require(_0xc3f8('0xb'));var Papa=require(_0xc3f8('0xc'));var Redis=require(_0xc3f8('0xd'));var authService=require(_0xc3f8('0xe'));var qs=require(_0xc3f8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3f8('0x10'));var logger=require(_0xc3f8('0x11'))(_0xc3f8('0x12'));var utils=require(_0xc3f8('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc3f8('0x14'));var db=require(_0xc3f8('0x15'))['db'];function respondWithStatusCode(_0x256e3d,_0x155c80){_0x155c80=_0x155c80||0xcc;return function(_0x511763){if(_0x511763){return _0x256e3d[_0xc3f8('0x16')](_0x155c80);}return _0x256e3d[_0xc3f8('0x17')](_0x155c80)[_0xc3f8('0x18')]();};}function respondWithResult(_0x44632a,_0x6155e9){_0x6155e9=_0x6155e9||0xc8;return function(_0x47754c){if(_0x47754c){return _0x44632a[_0xc3f8('0x17')](_0x6155e9)[_0xc3f8('0x19')](_0x47754c);}};}function respondWithFilteredResult(_0x12b141,_0x2fd8e8){return function(_0x3cb28a){if(_0x3cb28a){var _0x2a9f64=typeof _0x2fd8e8[_0xc3f8('0x1a')]==='undefined'&&typeof _0x2fd8e8[_0xc3f8('0x1b')]==='undefined';var _0x51807b=_0x3cb28a[_0xc3f8('0x1c')];var _0x2e7c0f=_0x2a9f64?0x0:_0x2fd8e8[_0xc3f8('0x1a')];var _0xb4ab67=_0x2a9f64?_0x3cb28a['count']:_0x2fd8e8[_0xc3f8('0x1a')]+_0x2fd8e8[_0xc3f8('0x1b')];var _0x5df6f9;if(_0xb4ab67>=_0x51807b){_0xb4ab67=_0x51807b;_0x5df6f9=0xc8;}else{_0x5df6f9=0xce;}_0x12b141[_0xc3f8('0x17')](_0x5df6f9);return _0x12b141['set'](_0xc3f8('0x1d'),_0x2e7c0f+'-'+_0xb4ab67+'/'+_0x51807b)[_0xc3f8('0x19')](_0x3cb28a);}return null;};}function patchUpdates(_0x3b2e98){return function(_0x53ada5){try{jsonpatch['apply'](_0x53ada5,_0x3b2e98,!![]);}catch(_0x113cd2){return BPromise[_0xc3f8('0x1e')](_0x113cd2);}return _0x53ada5[_0xc3f8('0x1f')]();};}function saveUpdates(_0x25a4c7,_0x6522e9){return function(_0x251bf7){if(_0x251bf7){return _0x251bf7[_0xc3f8('0x20')](_0x25a4c7)[_0xc3f8('0x21')](function(_0x49aeea){return _0x49aeea;});}return null;};}function removeEntity(_0x571f92,_0x4b83f0){return function(_0x2559a4){if(_0x2559a4){return _0x2559a4['destroy']()[_0xc3f8('0x21')](function(){var _0x3f196d=_0x2559a4['get']({'plain':!![]});var _0x4569c2=_0xc3f8('0x22');return db[_0xc3f8('0x23')][_0xc3f8('0x24')]({'where':{'type':_0x4569c2,'resourceId':_0x3f196d['id']}})[_0xc3f8('0x21')](function(){return _0x2559a4;});})[_0xc3f8('0x21')](function(){_0x571f92[_0xc3f8('0x17')](0xcc)[_0xc3f8('0x18')]();});}};}function handleEntityNotFound(_0x21b002,_0xbea3b8){return function(_0x22c8e6){if(!_0x22c8e6){_0x21b002[_0xc3f8('0x16')](0x194);}return _0x22c8e6;};}function handleError(_0x238ff5,_0x429fd8){_0x429fd8=_0x429fd8||0x1f4;return function(_0x59e4dd){logger[_0xc3f8('0x25')](_0x59e4dd[_0xc3f8('0x26')]);if(_0x59e4dd[_0xc3f8('0x27')]){delete _0x59e4dd['name'];}_0x238ff5[_0xc3f8('0x17')](_0x429fd8)['send'](_0x59e4dd);};}exports[_0xc3f8('0x28')]=function(_0x32343e,_0x47ab53){var _0x48b32e={},_0x21a225={},_0x25df65={'count':0x0,'rows':[]};var _0xd32b09=_[_0xc3f8('0x29')](db[_0xc3f8('0x2a')][_0xc3f8('0x2b')],function(_0x680047){return{'name':_0x680047[_0xc3f8('0x2c')],'type':_0x680047[_0xc3f8('0x2d')][_0xc3f8('0x2e')]};});_0x21a225['model']=_[_0xc3f8('0x29')](_0xd32b09,_0xc3f8('0x27'));_0x21a225[_0xc3f8('0x2f')]=_[_0xc3f8('0x30')](_0x32343e[_0xc3f8('0x2f')]);_0x21a225['filters']=_['intersection'](_0x21a225[_0xc3f8('0x31')],_0x21a225[_0xc3f8('0x2f')]);_0x48b32e[_0xc3f8('0x32')]=_[_0xc3f8('0x33')](_0x21a225[_0xc3f8('0x31')],qs['fields'](_0x32343e[_0xc3f8('0x2f')][_0xc3f8('0x34')]));_0x48b32e[_0xc3f8('0x32')]=_0x48b32e['attributes'][_0xc3f8('0x35')]?_0x48b32e[_0xc3f8('0x32')]:_0x21a225[_0xc3f8('0x31')];if(!_0x32343e['query'][_0xc3f8('0x36')](_0xc3f8('0x37'))){_0x48b32e['limit']=qs[_0xc3f8('0x1b')](_0x32343e[_0xc3f8('0x2f')][_0xc3f8('0x1b')]);_0x48b32e[_0xc3f8('0x1a')]=qs[_0xc3f8('0x1a')](_0x32343e[_0xc3f8('0x2f')]['offset']);}_0x48b32e[_0xc3f8('0x38')]=qs[_0xc3f8('0x39')](_0x32343e[_0xc3f8('0x2f')][_0xc3f8('0x39')]);_0x48b32e[_0xc3f8('0x3a')]=qs['filters'](_[_0xc3f8('0x3b')](_0x32343e[_0xc3f8('0x2f')],_0x21a225[_0xc3f8('0x3c')]),_0xd32b09);if(_0x32343e['query'][_0xc3f8('0x3d')]){_0x48b32e[_0xc3f8('0x3a')]=_[_0xc3f8('0x3e')](_0x48b32e[_0xc3f8('0x3a')],{'$or':_['map'](_0xd32b09,function(_0x306182){if(_0x306182[_0xc3f8('0x2d')]!==_0xc3f8('0x3f')){var _0x37b104={};_0x37b104[_0x306182['name']]={'$like':'%'+_0x32343e[_0xc3f8('0x2f')]['filter']+'%'};return _0x37b104;}})});}_0x48b32e=_['merge']({},_0x48b32e,_0x32343e[_0xc3f8('0x40')]);var _0x1f3aef={'where':_0x48b32e[_0xc3f8('0x3a')]};return db[_0xc3f8('0x2a')]['count'](_0x1f3aef)['then'](function(_0x361a85){_0x25df65[_0xc3f8('0x1c')]=_0x361a85;if(_0x32343e[_0xc3f8('0x2f')][_0xc3f8('0x41')]){_0x48b32e[_0xc3f8('0x42')]=[{'all':!![]}];}return db[_0xc3f8('0x2a')][_0xc3f8('0x43')](_0x48b32e);})[_0xc3f8('0x21')](function(_0x13d8dc){_0x25df65[_0xc3f8('0x44')]=_0x13d8dc;return _0x25df65;})[_0xc3f8('0x21')](respondWithFilteredResult(_0x47ab53,_0x48b32e))['catch'](handleError(_0x47ab53,null));};exports[_0xc3f8('0x45')]=function(_0x22e9b3,_0x4b327f){var _0x1aff20={'raw':!![],'where':{'id':_0x22e9b3['params']['id']}},_0x172f1a={};_0x172f1a[_0xc3f8('0x31')]=_[_0xc3f8('0x30')](db[_0xc3f8('0x2a')][_0xc3f8('0x2b')]);_0x172f1a[_0xc3f8('0x2f')]=_[_0xc3f8('0x30')](_0x22e9b3[_0xc3f8('0x2f')]);_0x172f1a[_0xc3f8('0x3c')]=_[_0xc3f8('0x33')](_0x172f1a[_0xc3f8('0x31')],_0x172f1a[_0xc3f8('0x2f')]);_0x1aff20['attributes']=_[_0xc3f8('0x33')](_0x172f1a[_0xc3f8('0x31')],qs['fields'](_0x22e9b3[_0xc3f8('0x2f')][_0xc3f8('0x34')]));_0x1aff20[_0xc3f8('0x32')]=_0x1aff20[_0xc3f8('0x32')]['length']?_0x1aff20['attributes']:_0x172f1a[_0xc3f8('0x31')];if(_0x22e9b3[_0xc3f8('0x2f')][_0xc3f8('0x41')]){_0x1aff20['include']=[{'all':!![]}];}_0x1aff20=_[_0xc3f8('0x3e')]({},_0x1aff20,_0x22e9b3[_0xc3f8('0x40')]);return db[_0xc3f8('0x2a')][_0xc3f8('0x46')](_0x1aff20)[_0xc3f8('0x21')](handleEntityNotFound(_0x4b327f,null))['then'](respondWithResult(_0x4b327f,null))[_0xc3f8('0x47')](handleError(_0x4b327f,null));};exports[_0xc3f8('0x48')]=function(_0x5961ab,_0x1becae){return db[_0xc3f8('0x2a')][_0xc3f8('0x48')](_0x5961ab[_0xc3f8('0x49')],{})[_0xc3f8('0x21')](function(_0x3045bc){var _0x1ca7c9=_0x5961ab['user'][_0xc3f8('0x4a')]({'plain':!![]});if(!_0x1ca7c9)throw new Error(_0xc3f8('0x4b'));if(_0x1ca7c9['role']===_0xc3f8('0x4c')){var _0x2e9f93=_0x3045bc[_0xc3f8('0x4a')]({'plain':!![]});var _0x33e5c5=_0xc3f8('0x22');return db[_0xc3f8('0x4d')][_0xc3f8('0x46')]({'where':{'name':_0x33e5c5,'userProfileId':_0x1ca7c9['userProfileId']},'raw':!![]})[_0xc3f8('0x21')](function(_0x2c6999){if(_0x2c6999&&_0x2c6999[_0xc3f8('0x4e')]===0x0){return db[_0xc3f8('0x23')][_0xc3f8('0x48')]({'name':_0x2e9f93[_0xc3f8('0x27')],'resourceId':_0x2e9f93['id'],'type':_0x2c6999[_0xc3f8('0x27')],'sectionId':_0x2c6999['id']},{})[_0xc3f8('0x21')](function(){return _0x3045bc;});}else{return _0x3045bc;}})['catch'](function(_0x51249a){logger[_0xc3f8('0x25')](_0xc3f8('0x4f'),_0x51249a);throw _0x51249a;});}return _0x3045bc;})['then'](respondWithResult(_0x1becae,0xc9))['catch'](handleError(_0x1becae,null));};exports[_0xc3f8('0x20')]=function(_0x4b4adb,_0x1b1e13){if(_0x4b4adb[_0xc3f8('0x49')]['id']){delete _0x4b4adb[_0xc3f8('0x49')]['id'];}return db['VoiceMail'][_0xc3f8('0x46')]({'where':{'id':_0x4b4adb['params']['id']}})['then'](handleEntityNotFound(_0x1b1e13,null))[_0xc3f8('0x21')](saveUpdates(_0x4b4adb['body'],null))[_0xc3f8('0x21')](respondWithResult(_0x1b1e13,null))[_0xc3f8('0x47')](handleError(_0x1b1e13,null));};exports[_0xc3f8('0x24')]=function(_0x490f37,_0xcb45c1){return db[_0xc3f8('0x2a')][_0xc3f8('0x46')]({'where':{'id':_0x490f37[_0xc3f8('0x50')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0xcb45c1,null))['then'](removeEntity(_0xcb45c1,null))['catch'](handleError(_0xcb45c1,null));};exports[_0xc3f8('0x51')]=function(_0x326dcc,_0x2f1b68,_0x3a268d){return db[_0xc3f8('0x2a')]['findOne']({'where':{'id':_0x326dcc[_0xc3f8('0x50')]['id']}})['then'](handleEntityNotFound(_0x2f1b68,null))[_0xc3f8('0x21')](function(_0x337029){var _0x163264;var _0xd5d6a7={},_0x5c6f6e={};_0x5c6f6e[_0xc3f8('0x31')]=_['keys'](db['VoiceMailMessage']['rawAttributes']);_0x5c6f6e['query']=_[_0xc3f8('0x30')](_0x326dcc[_0xc3f8('0x2f')]);_0x5c6f6e[_0xc3f8('0x3c')]=_[_0xc3f8('0x33')](_0x5c6f6e[_0xc3f8('0x31')],_0x5c6f6e[_0xc3f8('0x2f')]);_0xd5d6a7[_0xc3f8('0x32')]=_[_0xc3f8('0x33')](_0x5c6f6e['model'],qs[_0xc3f8('0x34')](_0x326dcc[_0xc3f8('0x2f')][_0xc3f8('0x34')]));_0xd5d6a7[_0xc3f8('0x32')]=_0xd5d6a7[_0xc3f8('0x32')]['length']?_0xd5d6a7[_0xc3f8('0x32')]:_0x5c6f6e[_0xc3f8('0x31')];if(!_0x326dcc[_0xc3f8('0x2f')][_0xc3f8('0x36')](_0xc3f8('0x37'))){_0xd5d6a7['limit']=qs[_0xc3f8('0x1b')](_0x326dcc[_0xc3f8('0x2f')][_0xc3f8('0x1b')]);_0xd5d6a7[_0xc3f8('0x1a')]=qs[_0xc3f8('0x1a')](_0x326dcc[_0xc3f8('0x2f')]['offset']);}_0xd5d6a7[_0xc3f8('0x38')]=qs[_0xc3f8('0x39')](_0x326dcc[_0xc3f8('0x2f')]['sort']);_0xd5d6a7[_0xc3f8('0x3a')]=qs[_0xc3f8('0x3c')](_['pick'](_0x326dcc['query'],_0x5c6f6e[_0xc3f8('0x3c')]));if(_0x326dcc[_0xc3f8('0x2f')]['filter']){_0xd5d6a7[_0xc3f8('0x3a')]=_[_0xc3f8('0x3e')](_0xd5d6a7[_0xc3f8('0x3a')],{'$or':_[_0xc3f8('0x29')](_0xd5d6a7[_0xc3f8('0x32')],function(_0x30a23a){var _0x1e62ec={};_0x1e62ec[_0x30a23a]={'$like':'%'+_0x326dcc[_0xc3f8('0x2f')]['filter']+'%'};return _0x1e62ec;})});}_0xd5d6a7['where']=_[_0xc3f8('0x3e')](_0xd5d6a7['where'],{'mailboxuser':_0x337029['mailbox']});_0xd5d6a7=_['merge']({},_0xd5d6a7,_0x326dcc['options']);return db['VoiceMailMessage'][_0xc3f8('0x52')](_0xd5d6a7)[_0xc3f8('0x21')](respondWithFilteredResult(_0x2f1b68,_0xd5d6a7));})[_0xc3f8('0x47')](handleError(_0x2f1b68,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index c51430e..5550ff9 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 _0xc7d8=['mailbox_context','mailbox','context','lodash','../../config/logger','moment','bluebird','path','rimraf','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail'];(function(_0x33ca22,_0xbcc94){var _0x1790c3=function(_0x448b06){while(--_0x448b06){_0x33ca22['push'](_0x33ca22['shift']());}};_0x1790c3(++_0xbcc94);}(_0xc7d8,0xf1));var _0x8c7d=function(_0x31700a,_0xbef47){_0x31700a=_0x31700a-0x0;var _0x48014c=_0xc7d8[_0x31700a];return _0x48014c;};'use strict';var _=require(_0x8c7d('0x0'));var util=require('util');var logger=require(_0x8c7d('0x1'))('api');var moment=require(_0x8c7d('0x2'));var BPromise=require(_0x8c7d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8c7d('0x4'));var rimraf=require(_0x8c7d('0x5'));var config=require('../../config/environment');var attributes=require(_0x8c7d('0x6'));module[_0x8c7d('0x7')]=function(_0xfb1cf,_0x1d6d4b){return _0xfb1cf[_0x8c7d('0x8')](_0x8c7d('0x9'),attributes,{'tableName':_0x8c7d('0xa'),'paranoid':![],'indexes':[{'name':_0x8c7d('0xb'),'fields':[_0x8c7d('0xc'),_0x8c7d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd6a3=['../../config/environment','exports','VoiceMail','mailbox_context','context','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x33f5d9,_0x167ee8){var _0xbf8467=function(_0x3512ff){while(--_0x3512ff){_0x33f5d9['push'](_0x33f5d9['shift']());}};_0xbf8467(++_0x167ee8);}(_0xd6a3,0x18b));var _0x3d6a=function(_0x3c34b5,_0x49d1ee){_0x3c34b5=_0x3c34b5-0x0;var _0x39c455=_0xd6a3[_0x3c34b5];return _0x39c455;};'use strict';var _=require(_0x3d6a('0x0'));var util=require(_0x3d6a('0x1'));var logger=require(_0x3d6a('0x2'))(_0x3d6a('0x3'));var moment=require(_0x3d6a('0x4'));var BPromise=require(_0x3d6a('0x5'));var rp=require(_0x3d6a('0x6'));var fs=require('fs');var path=require(_0x3d6a('0x7'));var rimraf=require('rimraf');var config=require(_0x3d6a('0x8'));var attributes=require('./voiceMail.attributes');module[_0x3d6a('0x9')]=function(_0x451d09,_0x59538f){return _0x451d09['define'](_0x3d6a('0xa'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x3d6a('0xb'),'fields':['mailbox',_0x3d6a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 34b753a..79c229a 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 _0x912a=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x501838,_0x1e77fc){var _0x1b7fe9=function(_0x264e21){while(--_0x264e21){_0x501838['push'](_0x501838['shift']());}};_0x1b7fe9(++_0x1e77fc);}(_0x912a,0xf7));var _0xa912=function(_0x44cb92,_0x59afa3){_0x44cb92=_0x44cb92-0x0;var _0x56b9e6=_0x912a[_0x44cb92];return _0x56b9e6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa912('0x0'));var BPromise=require(_0xa912('0x1'));var rs=require(_0xa912('0x2'));var fs=require('fs');var Redis=require(_0xa912('0x3'));var db=require(_0xa912('0x4'))['db'];var utils=require(_0xa912('0x5'));var logger=require(_0xa912('0x6'))(_0xa912('0x7'));var config=require(_0xa912('0x8'));var jayson=require(_0xa912('0x9'));var client=jayson[_0xa912('0xa')][_0xa912('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ef3fc,_0x30c7c9,_0x50820d){return new BPromise(function(_0x3aff13,_0x1a925d){return client[_0xa912('0xc')](_0x4ef3fc,_0x50820d)['then'](function(_0x5a6f2f){logger[_0xa912('0xd')](_0xa912('0xe'),_0x30c7c9,'request\x20sent');logger[_0xa912('0xf')](_0xa912('0x10'),_0x30c7c9,_0xa912('0x11'),JSON[_0xa912('0x12')](_0x5a6f2f));if(_0x5a6f2f[_0xa912('0x13')]){if(_0x5a6f2f[_0xa912('0x13')][_0xa912('0x14')]===0x1f4){logger['error'](_0xa912('0xe'),_0x30c7c9,_0x5a6f2f[_0xa912('0x13')][_0xa912('0x15')]);return _0x1a925d(_0x5a6f2f[_0xa912('0x13')]['message']);}logger[_0xa912('0x13')]('VoiceMail,\x20%s,\x20%s',_0x30c7c9,_0x5a6f2f[_0xa912('0x13')][_0xa912('0x15')]);return _0x3aff13(_0x5a6f2f[_0xa912('0x13')]['message']);}else{logger['info']('VoiceMail,\x20%s,\x20%s',_0x30c7c9,_0xa912('0x11'));_0x3aff13(_0x5a6f2f[_0xa912('0x16')]['message']);}})['catch'](function(_0x4c0b45){logger[_0xa912('0x13')](_0xa912('0xe'),_0x30c7c9,_0x4c0b45);_0x1a925d(_0x4c0b45);});});} \ No newline at end of file +var _0x3763=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','randomstring'];(function(_0xd33d44,_0x398fa4){var _0x3c1655=function(_0x3ad340){while(--_0x3ad340){_0xd33d44['push'](_0xd33d44['shift']());}};_0x3c1655(++_0x398fa4);}(_0x3763,0x1b5));var _0x3376=function(_0x598785,_0x148a9e){_0x598785=_0x598785-0x0;var _0x2235ff=_0x3763[_0x598785];return _0x2235ff;};'use strict';var _=require('lodash');var util=require(_0x3376('0x0'));var moment=require(_0x3376('0x1'));var BPromise=require('bluebird');var rs=require(_0x3376('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3376('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3376('0x4'))(_0x3376('0x5'));var config=require(_0x3376('0x6'));var jayson=require(_0x3376('0x7'));var client=jayson['client'][_0x3376('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x28442f,_0x14a033,_0x4a1b36){return new BPromise(function(_0x423886,_0x2150f2){return client[_0x3376('0x9')](_0x28442f,_0x4a1b36)[_0x3376('0xa')](function(_0x1f8789){logger[_0x3376('0xb')](_0x3376('0xc'),_0x14a033,'request\x20sent');logger[_0x3376('0xd')](_0x3376('0xe'),_0x14a033,_0x3376('0xf'),JSON[_0x3376('0x10')](_0x1f8789));if(_0x1f8789['error']){if(_0x1f8789[_0x3376('0x11')][_0x3376('0x12')]===0x1f4){logger[_0x3376('0x11')](_0x3376('0xc'),_0x14a033,_0x1f8789['error'][_0x3376('0x13')]);return _0x2150f2(_0x1f8789[_0x3376('0x11')]['message']);}logger[_0x3376('0x11')](_0x3376('0xc'),_0x14a033,_0x1f8789[_0x3376('0x11')]['message']);return _0x423886(_0x1f8789[_0x3376('0x11')][_0x3376('0x13')]);}else{logger[_0x3376('0xb')](_0x3376('0xc'),_0x14a033,'request\x20sent');_0x423886(_0x1f8789[_0x3376('0x14')][_0x3376('0x13')]);}})[_0x3376('0x15')](function(_0x2b59db){logger['error'](_0x3376('0xc'),_0x14a033,_0x2b59db);_0x2150f2(_0x2b59db);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 09686e4..05130b4 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 _0x1ffd=['/:id','show','download','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index'];(function(_0x45a8f7,_0x24b581){var _0x42c318=function(_0xdc01e0){while(--_0xdc01e0){_0x45a8f7['push'](_0x45a8f7['shift']());}};_0x42c318(++_0x24b581);}(_0x1ffd,0x1ed));var _0xd1ff=function(_0x2ac58c,_0x2489be){_0x2ac58c=_0x2ac58c-0x0;var _0x459dd8=_0x1ffd[_0x2ac58c];return _0x459dd8;};'use strict';var multer=require(_0xd1ff('0x0'));var util=require('util');var path=require(_0xd1ff('0x1'));var timeout=require(_0xd1ff('0x2'));var express=require(_0xd1ff('0x3'));var router=express[_0xd1ff('0x4')]();var fs_extra=require(_0xd1ff('0x5'));var auth=require(_0xd1ff('0x6'));var interaction=require(_0xd1ff('0x7'));var config=require(_0xd1ff('0x8'));var controller=require(_0xd1ff('0x9'));router[_0xd1ff('0xa')]('/',auth[_0xd1ff('0xb')](),controller[_0xd1ff('0xc')]);router[_0xd1ff('0xa')](_0xd1ff('0xd'),auth[_0xd1ff('0xb')](),controller[_0xd1ff('0xe')]);router['get']('/:id/download',auth[_0xd1ff('0xb')](),controller[_0xd1ff('0xf')]);router['post']('/',auth[_0xd1ff('0xb')](),controller[_0xd1ff('0x10')]);router[_0xd1ff('0x11')](_0xd1ff('0xd'),auth['isAuthenticated'](),controller[_0xd1ff('0x12')]);router[_0xd1ff('0x13')](_0xd1ff('0xd'),auth['isAuthenticated'](),controller[_0xd1ff('0x14')]);module[_0xd1ff('0x15')]=router; \ No newline at end of file +var _0x27ec=['get','index','isAuthenticated','/:id/download','download','post','create','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller'];(function(_0x4e6177,_0x2d4e74){var _0x387878=function(_0x2651f1){while(--_0x2651f1){_0x4e6177['push'](_0x4e6177['shift']());}};_0x387878(++_0x2d4e74);}(_0x27ec,0x138));var _0xc27e=function(_0x2e21a3,_0x323e2b){_0x2e21a3=_0x2e21a3-0x0;var _0xdd774d=_0x27ec[_0x2e21a3];return _0xdd774d;};'use strict';var multer=require(_0xc27e('0x0'));var util=require(_0xc27e('0x1'));var path=require(_0xc27e('0x2'));var timeout=require(_0xc27e('0x3'));var express=require(_0xc27e('0x4'));var router=express[_0xc27e('0x5')]();var fs_extra=require(_0xc27e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc27e('0x7'));var config=require(_0xc27e('0x8'));var controller=require(_0xc27e('0x9'));router[_0xc27e('0xa')]('/',auth['isAuthenticated'](),controller[_0xc27e('0xb')]);router['get']('/:id',auth[_0xc27e('0xc')](),controller['show']);router[_0xc27e('0xa')](_0xc27e('0xd'),auth[_0xc27e('0xc')](),controller[_0xc27e('0xe')]);router[_0xc27e('0xf')]('/',auth[_0xc27e('0xc')](),controller[_0xc27e('0x10')]);router[_0xc27e('0x11')]('/:id',auth[_0xc27e('0xc')](),controller[_0xc27e('0x12')]);router[_0xc27e('0x13')](_0xc27e('0x14'),auth['isAuthenticated'](),controller[_0xc27e('0x15')]);module[_0xc27e('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index f6b7fff..5d6898a 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 _0x0941=['exports','VIRTUAL','getDataValue','STRING','BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x0941,0x81));var _0x1094=function(_0x35d3bd,_0x4d9b60){_0x35d3bd=_0x35d3bd-0x0;var _0x59feda=_0x0941[_0x35d3bd];return _0x59feda;};'use strict';var Sequelize=require(_0x1094('0x0'));module[_0x1094('0x1')]={'name':{'type':Sequelize[_0x1094('0x2')],'get':function(_0x46c863){return this[_0x1094('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x1094('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x1094('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x1094('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x1094('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x1094('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x1094('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x1094('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x1094('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x1094('0x5')](_0x1094('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x1094('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x1094('0x7'),'defaultValue':Sequelize[_0x1094('0x8')](_0x1094('0x9'))}}; \ No newline at end of file +var _0x8684=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','STRING','BLOB','long','TIMESTAMP','literal'];(function(_0x2b99ee,_0xe5ed84){var _0x520b7c=function(_0x3de9b0){while(--_0x3de9b0){_0x2b99ee['push'](_0x2b99ee['shift']());}};_0x520b7c(++_0xe5ed84);}(_0x8684,0x173));var _0x4868=function(_0x12c71b,_0x5cbef0){_0x12c71b=_0x12c71b-0x0;var _0x33bb1a=_0x8684[_0x12c71b];return _0x33bb1a;};'use strict';var Sequelize=require(_0x4868('0x0'));module[_0x4868('0x1')]={'name':{'type':Sequelize[_0x4868('0x2')],'get':function(_0x13cca4){return this[_0x4868('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0x4868('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x4868('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x4868('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x4868('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x4868('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x4868('0x5')](_0x4868('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x4868('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x4868('0x4')],'defaultValue':''},'stamp':{'type':_0x4868('0x7'),'defaultValue':Sequelize[_0x4868('0x8')](_0x4868('0x9'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 794d260..79ed918 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 _0xbdc8=['status','set','apply','reject','update','then','destroy','error','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','type','key','differenceBy','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment;\x20filename=\x22','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count'];(function(_0x2dec4d,_0x535d6b){var _0x4cdffa=function(_0x5da5cf){while(--_0x5da5cf){_0x2dec4d['push'](_0x2dec4d['shift']());}};_0x4cdffa(++_0x535d6b);}(_0xbdc8,0x88));var _0x8bdc=function(_0x38ceeb,_0x30bc58){_0x38ceeb=_0x38ceeb-0x0;var _0x4ae0a2=_0xbdc8[_0x38ceeb];return _0x4ae0a2;};'use strict';var emlformat=require(_0x8bdc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8bdc('0x1'));var jsonpatch=require(_0x8bdc('0x2'));var rp=require(_0x8bdc('0x3'));var moment=require(_0x8bdc('0x4'));var BPromise=require(_0x8bdc('0x5'));var Mustache=require('mustache');var util=require(_0x8bdc('0x6'));var path=require(_0x8bdc('0x7'));var sox=require(_0x8bdc('0x8'));var csv=require(_0x8bdc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8bdc('0xa'));var _=require(_0x8bdc('0xb'));var squel=require(_0x8bdc('0xc'));var crypto=require(_0x8bdc('0xd'));var jsforce=require(_0x8bdc('0xe'));var deskjs=require(_0x8bdc('0xf'));var toCsv=require(_0x8bdc('0x9'));var querystring=require(_0x8bdc('0x10'));var Papa=require(_0x8bdc('0x11'));var Redis=require(_0x8bdc('0x12'));var authService=require(_0x8bdc('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8bdc('0x14'));var hardwareService=require(_0x8bdc('0x15'));var logger=require(_0x8bdc('0x16'))(_0x8bdc('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8bdc('0x18'))['db'];function respondWithStatusCode(_0x3e7dbf,_0x21af62){_0x21af62=_0x21af62||0xcc;return function(_0x290561){if(_0x290561){return _0x3e7dbf[_0x8bdc('0x19')](_0x21af62);}return _0x3e7dbf['status'](_0x21af62)[_0x8bdc('0x1a')]();};}function respondWithResult(_0x5e3160,_0x43837d){_0x43837d=_0x43837d||0xc8;return function(_0x26d0aa){if(_0x26d0aa){return _0x5e3160['status'](_0x43837d)[_0x8bdc('0x1b')](_0x26d0aa);}};}function respondWithFilteredResult(_0x2aa1f5,_0x244740){return function(_0x5f26c8){if(_0x5f26c8){var _0x268a40=typeof _0x244740[_0x8bdc('0x1c')]===_0x8bdc('0x1d')&&typeof _0x244740[_0x8bdc('0x1e')]==='undefined';var _0x33fb9d=_0x5f26c8[_0x8bdc('0x1f')];var _0x516552=_0x268a40?0x0:_0x244740[_0x8bdc('0x1c')];var _0x45c929=_0x268a40?_0x5f26c8[_0x8bdc('0x1f')]:_0x244740[_0x8bdc('0x1c')]+_0x244740[_0x8bdc('0x1e')];var _0xd93f1b;if(_0x45c929>=_0x33fb9d){_0x45c929=_0x33fb9d;_0xd93f1b=0xc8;}else{_0xd93f1b=0xce;}_0x2aa1f5[_0x8bdc('0x20')](_0xd93f1b);return _0x2aa1f5[_0x8bdc('0x21')]('Content-Range',_0x516552+'-'+_0x45c929+'/'+_0x33fb9d)['json'](_0x5f26c8);}return null;};}function patchUpdates(_0x43c055){return function(_0x33d726){try{jsonpatch[_0x8bdc('0x22')](_0x33d726,_0x43c055,!![]);}catch(_0x2fc9ab){return BPromise[_0x8bdc('0x23')](_0x2fc9ab);}return _0x33d726['save']();};}function saveUpdates(_0x42e216,_0x38dfb9){return function(_0x270654){if(_0x270654){return _0x270654[_0x8bdc('0x24')](_0x42e216)[_0x8bdc('0x25')](function(_0x3dccc7){return _0x3dccc7;});}return null;};}function removeEntity(_0x390ed4,_0x5e47fc){return function(_0x3d8bcd){if(_0x3d8bcd){return _0x3d8bcd[_0x8bdc('0x26')]()['then'](function(){_0x390ed4[_0x8bdc('0x20')](0xcc)[_0x8bdc('0x1a')]();});}};}function handleEntityNotFound(_0x49f55b,_0x399b25){return function(_0x4e0ad1){if(!_0x4e0ad1){_0x49f55b['sendStatus'](0x194);}return _0x4e0ad1;};}function handleError(_0x4d84bf,_0x349e0a){_0x349e0a=_0x349e0a||0x1f4;return function(_0x82832c){logger[_0x8bdc('0x27')](_0x82832c['stack']);if(_0x82832c[_0x8bdc('0x28')]){delete _0x82832c[_0x8bdc('0x28')];}_0x4d84bf[_0x8bdc('0x20')](_0x349e0a)[_0x8bdc('0x29')](_0x82832c);};}exports[_0x8bdc('0x2a')]=function(_0xfed695,_0x593687){var _0x763b84={},_0x52bccb={},_0x15db01={'count':0x0,'rows':[]};var _0x425af4=_[_0x8bdc('0x2b')](db[_0x8bdc('0x2c')][_0x8bdc('0x2d')],function(_0x4afc22){return{'name':_0x4afc22[_0x8bdc('0x2e')],'type':_0x4afc22[_0x8bdc('0x2f')][_0x8bdc('0x30')]};});_0x52bccb['model']=_[_0x8bdc('0x31')](_['map'](_0x425af4,'name'),[_0x8bdc('0x28')]);_0x52bccb[_0x8bdc('0x32')]=_['keys'](_0xfed695[_0x8bdc('0x32')]);_0x52bccb[_0x8bdc('0x33')]=_[_0x8bdc('0x34')](_0x52bccb[_0x8bdc('0x35')],_0x52bccb[_0x8bdc('0x32')]);_0x763b84['attributes']=_['intersection'](_0x52bccb['model'],qs[_0x8bdc('0x36')](_0xfed695[_0x8bdc('0x32')]['fields']));_0x763b84['attributes']=_0x763b84[_0x8bdc('0x37')][_0x8bdc('0x38')]?_0x763b84[_0x8bdc('0x37')]:_0x52bccb[_0x8bdc('0x35')];if(!_0xfed695['query'][_0x8bdc('0x39')](_0x8bdc('0x3a'))){_0x763b84['limit']=qs['limit'](_0xfed695[_0x8bdc('0x32')]['limit']);_0x763b84[_0x8bdc('0x1c')]=qs[_0x8bdc('0x1c')](_0xfed695[_0x8bdc('0x32')][_0x8bdc('0x1c')]);}_0x763b84[_0x8bdc('0x3b')]=qs['sort'](_0xfed695[_0x8bdc('0x32')][_0x8bdc('0x3c')]);_0x763b84[_0x8bdc('0x3d')]=qs[_0x8bdc('0x33')](_['pick'](_0xfed695[_0x8bdc('0x32')],_0x52bccb[_0x8bdc('0x33')]),_0x425af4);if(_0xfed695[_0x8bdc('0x32')]['filter']){_0x763b84['where']=_[_0x8bdc('0x3e')](_0x763b84['where'],{'$or':_['map'](_0x425af4,function(_0x4f997b){if(_0x4f997b[_0x8bdc('0x2f')]!==_0x8bdc('0x3f')){var _0x555c8d={};_0x555c8d[_0x4f997b['name']]={'$like':'%'+_0xfed695[_0x8bdc('0x32')][_0x8bdc('0x40')]+'%'};return _0x555c8d;}})});}_0x763b84=_[_0x8bdc('0x3e')]({},_0x763b84,_0xfed695['options']);var _0xe14a79={'where':_0x763b84[_0x8bdc('0x3d')]};return db[_0x8bdc('0x2c')][_0x8bdc('0x1f')](_0xe14a79)[_0x8bdc('0x25')](function(_0x8ae0bd){_0x15db01[_0x8bdc('0x1f')]=_0x8ae0bd;if(_0xfed695[_0x8bdc('0x32')][_0x8bdc('0x41')]){_0x763b84[_0x8bdc('0x42')]=[{'all':!![]}];}return db[_0x8bdc('0x2c')][_0x8bdc('0x43')](_0x763b84);})[_0x8bdc('0x25')](function(_0x37c71d){_0x15db01[_0x8bdc('0x44')]=_0x37c71d;return _0x15db01;})[_0x8bdc('0x25')](respondWithFilteredResult(_0x593687,_0x763b84))[_0x8bdc('0x45')](handleError(_0x593687,null));};exports[_0x8bdc('0x46')]=function(_0x4b8543,_0x440b79){var _0x15a1f5={'raw':!![],'where':{'id':_0x4b8543[_0x8bdc('0x47')]['id']}},_0x21bcd6={};_0x21bcd6[_0x8bdc('0x35')]=_[_0x8bdc('0x48')](db['VoiceMailMessage'][_0x8bdc('0x2d')]);_0x21bcd6[_0x8bdc('0x32')]=_[_0x8bdc('0x48')](_0x4b8543[_0x8bdc('0x32')]);_0x21bcd6[_0x8bdc('0x33')]=_[_0x8bdc('0x34')](_0x21bcd6['model'],_0x21bcd6['query']);_0x15a1f5[_0x8bdc('0x37')]=_[_0x8bdc('0x34')](_0x21bcd6['model'],qs[_0x8bdc('0x36')](_0x4b8543[_0x8bdc('0x32')]['fields']));_0x15a1f5[_0x8bdc('0x37')]=_0x15a1f5[_0x8bdc('0x37')][_0x8bdc('0x38')]?_0x15a1f5['attributes']:_0x21bcd6['model'];if(_0x4b8543['query'][_0x8bdc('0x41')]){_0x15a1f5['include']=[{'all':!![]}];}_0x15a1f5=_[_0x8bdc('0x3e')]({},_0x15a1f5,_0x4b8543[_0x8bdc('0x49')]);return db[_0x8bdc('0x2c')][_0x8bdc('0x4a')](_0x15a1f5)[_0x8bdc('0x25')](handleEntityNotFound(_0x440b79,null))[_0x8bdc('0x25')](respondWithResult(_0x440b79,null))['catch'](handleError(_0x440b79,null));};exports[_0x8bdc('0x4b')]=function(_0x337488,_0x3edf0a){return db[_0x8bdc('0x2c')][_0x8bdc('0x4b')](_0x337488[_0x8bdc('0x4c')],{})[_0x8bdc('0x25')](respondWithResult(_0x3edf0a,0xc9))[_0x8bdc('0x45')](handleError(_0x3edf0a,null));};exports[_0x8bdc('0x24')]=function(_0x318f2b,_0x3470){if(_0x318f2b[_0x8bdc('0x4c')]['id']){delete _0x318f2b[_0x8bdc('0x4c')]['id'];}return db[_0x8bdc('0x2c')]['find']({'where':{'id':_0x318f2b['params']['id']}})[_0x8bdc('0x25')](handleEntityNotFound(_0x3470,null))[_0x8bdc('0x25')](saveUpdates(_0x318f2b[_0x8bdc('0x4c')],null))['then'](respondWithResult(_0x3470,null))['catch'](handleError(_0x3470,null));};exports[_0x8bdc('0x26')]=function(_0x48709d,_0x2a3b44){return db[_0x8bdc('0x2c')][_0x8bdc('0x4a')]({'where':{'id':_0x48709d[_0x8bdc('0x47')]['id']}})[_0x8bdc('0x25')](handleEntityNotFound(_0x2a3b44,null))[_0x8bdc('0x25')](removeEntity(_0x2a3b44,null))[_0x8bdc('0x45')](handleError(_0x2a3b44,null));};exports['download']=function(_0x57b3f3,_0x41a176,_0x556d05){return db[_0x8bdc('0x2c')][_0x8bdc('0x4a')]({'where':{'id':_0x57b3f3[_0x8bdc('0x47')]['id']},'attributes':['id',_0x8bdc('0x4d'),_0x8bdc('0x4e')]})[_0x8bdc('0x25')](handleEntityNotFound(_0x41a176,null))['then'](function(_0x35b44b){if(_0x35b44b){if(!_0x35b44b[_0x8bdc('0x4d')]){throw new db[(_0x8bdc('0x4f'))][(_0x8bdc('0x50'))](_0x8bdc('0x51'));}var _0x1c5b18={'Content-Type':_0x8bdc('0x52'),'Content-Disposition':'attachment'};if(_0x35b44b[_0x8bdc('0x4e')]){_0x1c5b18['Content-Disposition']=_0x8bdc('0x53')+_0x35b44b[_0x8bdc('0x4e')]+'.wav\x22';}_0x41a176['set'](_0x1c5b18);return _0x41a176[_0x8bdc('0x29')](new Buffer(_0x35b44b['recording']));}})['catch'](handleError(_0x41a176,null));}; \ No newline at end of file +var _0x71dc=['includeAll','include','rows','catch','params','create','body','update','find','destroy','recording','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','Content-Disposition','.wav\x22','set','send','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','reject','save','then','stack','name','map','VoiceMailMessage','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','type','VIRTUAL','merge','options'];(function(_0x41bdda,_0x50b470){var _0x827644=function(_0x49bdcb){while(--_0x49bdcb){_0x41bdda['push'](_0x41bdda['shift']());}};_0x827644(++_0x50b470);}(_0x71dc,0x154));var _0xc71d=function(_0x105ed5,_0x48bff3){_0x105ed5=_0x105ed5-0x0;var _0x493752=_0x71dc[_0x105ed5];return _0x493752;};'use strict';var emlformat=require(_0xc71d('0x0'));var rimraf=require(_0xc71d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc71d('0x2'));var rp=require(_0xc71d('0x3'));var moment=require('moment');var BPromise=require(_0xc71d('0x4'));var Mustache=require(_0xc71d('0x5'));var util=require(_0xc71d('0x6'));var path=require('path');var sox=require(_0xc71d('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc71d('0x8'));var _=require(_0xc71d('0x9'));var squel=require(_0xc71d('0xa'));var crypto=require(_0xc71d('0xb'));var jsforce=require(_0xc71d('0xc'));var deskjs=require(_0xc71d('0xd'));var toCsv=require(_0xc71d('0xe'));var querystring=require(_0xc71d('0xf'));var Papa=require(_0xc71d('0x10'));var Redis=require(_0xc71d('0x11'));var authService=require(_0xc71d('0x12'));var qs=require(_0xc71d('0x13'));var as=require(_0xc71d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc71d('0x15'))(_0xc71d('0x16'));var utils=require(_0xc71d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc71d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38a023,_0x458998){_0x458998=_0x458998||0xcc;return function(_0x3c441b){if(_0x3c441b){return _0x38a023[_0xc71d('0x19')](_0x458998);}return _0x38a023[_0xc71d('0x1a')](_0x458998)[_0xc71d('0x1b')]();};}function respondWithResult(_0x4a650b,_0x4f24bf){_0x4f24bf=_0x4f24bf||0xc8;return function(_0x2c57df){if(_0x2c57df){return _0x4a650b[_0xc71d('0x1a')](_0x4f24bf)[_0xc71d('0x1c')](_0x2c57df);}};}function respondWithFilteredResult(_0x339c0c,_0x33a6e9){return function(_0xbecb46){if(_0xbecb46){var _0x1a2717=typeof _0x33a6e9[_0xc71d('0x1d')]===_0xc71d('0x1e')&&typeof _0x33a6e9['limit']===_0xc71d('0x1e');var _0x11ced8=_0xbecb46[_0xc71d('0x1f')];var _0x1dc64e=_0x1a2717?0x0:_0x33a6e9[_0xc71d('0x1d')];var _0xb5d87f=_0x1a2717?_0xbecb46[_0xc71d('0x1f')]:_0x33a6e9[_0xc71d('0x1d')]+_0x33a6e9[_0xc71d('0x20')];var _0x23231a;if(_0xb5d87f>=_0x11ced8){_0xb5d87f=_0x11ced8;_0x23231a=0xc8;}else{_0x23231a=0xce;}_0x339c0c['status'](_0x23231a);return _0x339c0c['set']('Content-Range',_0x1dc64e+'-'+_0xb5d87f+'/'+_0x11ced8)[_0xc71d('0x1c')](_0xbecb46);}return null;};}function patchUpdates(_0x54f831){return function(_0x1eb3bf){try{jsonpatch['apply'](_0x1eb3bf,_0x54f831,!![]);}catch(_0x8533ae){return BPromise[_0xc71d('0x21')](_0x8533ae);}return _0x1eb3bf[_0xc71d('0x22')]();};}function saveUpdates(_0x9fedc8,_0x53e19a){return function(_0x66bd35){if(_0x66bd35){return _0x66bd35['update'](_0x9fedc8)['then'](function(_0x2356cf){return _0x2356cf;});}return null;};}function removeEntity(_0xdd2cb8,_0x35d249){return function(_0x154186){if(_0x154186){return _0x154186['destroy']()[_0xc71d('0x23')](function(){_0xdd2cb8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x594c4d,_0x144580){return function(_0x4556da){if(!_0x4556da){_0x594c4d[_0xc71d('0x19')](0x194);}return _0x4556da;};}function handleError(_0x42ec87,_0xa1fdde){_0xa1fdde=_0xa1fdde||0x1f4;return function(_0x3a758e){logger['error'](_0x3a758e[_0xc71d('0x24')]);if(_0x3a758e[_0xc71d('0x25')]){delete _0x3a758e[_0xc71d('0x25')];}_0x42ec87[_0xc71d('0x1a')](_0xa1fdde)['send'](_0x3a758e);};}exports['index']=function(_0x5d46d6,_0x537a24){var _0xaf470e={},_0x4faf54={},_0x35ae57={'count':0x0,'rows':[]};var _0x1ab2ac=_[_0xc71d('0x26')](db[_0xc71d('0x27')][_0xc71d('0x28')],function(_0xd154d4){return{'name':_0xd154d4[_0xc71d('0x29')],'type':_0xd154d4['type']['key']};});_0x4faf54[_0xc71d('0x2a')]=_['differenceBy'](_['map'](_0x1ab2ac,_0xc71d('0x25')),['name']);_0x4faf54[_0xc71d('0x2b')]=_[_0xc71d('0x2c')](_0x5d46d6[_0xc71d('0x2b')]);_0x4faf54['filters']=_[_0xc71d('0x2d')](_0x4faf54['model'],_0x4faf54['query']);_0xaf470e[_0xc71d('0x2e')]=_['intersection'](_0x4faf54[_0xc71d('0x2a')],qs[_0xc71d('0x2f')](_0x5d46d6[_0xc71d('0x2b')][_0xc71d('0x2f')]));_0xaf470e[_0xc71d('0x2e')]=_0xaf470e[_0xc71d('0x2e')][_0xc71d('0x30')]?_0xaf470e[_0xc71d('0x2e')]:_0x4faf54['model'];if(!_0x5d46d6[_0xc71d('0x2b')]['hasOwnProperty'](_0xc71d('0x31'))){_0xaf470e[_0xc71d('0x20')]=qs[_0xc71d('0x20')](_0x5d46d6[_0xc71d('0x2b')][_0xc71d('0x20')]);_0xaf470e[_0xc71d('0x1d')]=qs[_0xc71d('0x1d')](_0x5d46d6[_0xc71d('0x2b')]['offset']);}_0xaf470e[_0xc71d('0x32')]=qs['sort'](_0x5d46d6[_0xc71d('0x2b')][_0xc71d('0x33')]);_0xaf470e['where']=qs[_0xc71d('0x34')](_[_0xc71d('0x35')](_0x5d46d6['query'],_0x4faf54[_0xc71d('0x34')]),_0x1ab2ac);if(_0x5d46d6[_0xc71d('0x2b')][_0xc71d('0x36')]){_0xaf470e['where']=_['merge'](_0xaf470e[_0xc71d('0x37')],{'$or':_[_0xc71d('0x26')](_0x1ab2ac,function(_0x387e6d){if(_0x387e6d[_0xc71d('0x38')]!==_0xc71d('0x39')){var _0x4d2799={};_0x4d2799[_0x387e6d[_0xc71d('0x25')]]={'$like':'%'+_0x5d46d6[_0xc71d('0x2b')][_0xc71d('0x36')]+'%'};return _0x4d2799;}})});}_0xaf470e=_[_0xc71d('0x3a')]({},_0xaf470e,_0x5d46d6[_0xc71d('0x3b')]);var _0x390467={'where':_0xaf470e[_0xc71d('0x37')]};return db[_0xc71d('0x27')][_0xc71d('0x1f')](_0x390467)[_0xc71d('0x23')](function(_0x18267e){_0x35ae57[_0xc71d('0x1f')]=_0x18267e;if(_0x5d46d6[_0xc71d('0x2b')][_0xc71d('0x3c')]){_0xaf470e[_0xc71d('0x3d')]=[{'all':!![]}];}return db[_0xc71d('0x27')]['findAll'](_0xaf470e);})[_0xc71d('0x23')](function(_0x3a343d){_0x35ae57[_0xc71d('0x3e')]=_0x3a343d;return _0x35ae57;})['then'](respondWithFilteredResult(_0x537a24,_0xaf470e))[_0xc71d('0x3f')](handleError(_0x537a24,null));};exports['show']=function(_0x13ba21,_0x337cb5){var _0x40bf4b={'raw':!![],'where':{'id':_0x13ba21[_0xc71d('0x40')]['id']}},_0x4570da={};_0x4570da[_0xc71d('0x2a')]=_[_0xc71d('0x2c')](db[_0xc71d('0x27')]['rawAttributes']);_0x4570da['query']=_['keys'](_0x13ba21[_0xc71d('0x2b')]);_0x4570da['filters']=_[_0xc71d('0x2d')](_0x4570da[_0xc71d('0x2a')],_0x4570da['query']);_0x40bf4b['attributes']=_[_0xc71d('0x2d')](_0x4570da[_0xc71d('0x2a')],qs[_0xc71d('0x2f')](_0x13ba21[_0xc71d('0x2b')][_0xc71d('0x2f')]));_0x40bf4b['attributes']=_0x40bf4b[_0xc71d('0x2e')][_0xc71d('0x30')]?_0x40bf4b['attributes']:_0x4570da[_0xc71d('0x2a')];if(_0x13ba21['query'][_0xc71d('0x3c')]){_0x40bf4b[_0xc71d('0x3d')]=[{'all':!![]}];}_0x40bf4b=_[_0xc71d('0x3a')]({},_0x40bf4b,_0x13ba21[_0xc71d('0x3b')]);return db[_0xc71d('0x27')]['find'](_0x40bf4b)['then'](handleEntityNotFound(_0x337cb5,null))['then'](respondWithResult(_0x337cb5,null))[_0xc71d('0x3f')](handleError(_0x337cb5,null));};exports['create']=function(_0xd687f1,_0x29d3db){return db[_0xc71d('0x27')][_0xc71d('0x41')](_0xd687f1[_0xc71d('0x42')],{})[_0xc71d('0x23')](respondWithResult(_0x29d3db,0xc9))[_0xc71d('0x3f')](handleError(_0x29d3db,null));};exports[_0xc71d('0x43')]=function(_0x2a1251,_0x141915){if(_0x2a1251[_0xc71d('0x42')]['id']){delete _0x2a1251[_0xc71d('0x42')]['id'];}return db[_0xc71d('0x27')][_0xc71d('0x44')]({'where':{'id':_0x2a1251[_0xc71d('0x40')]['id']}})[_0xc71d('0x23')](handleEntityNotFound(_0x141915,null))[_0xc71d('0x23')](saveUpdates(_0x2a1251[_0xc71d('0x42')],null))[_0xc71d('0x23')](respondWithResult(_0x141915,null))[_0xc71d('0x3f')](handleError(_0x141915,null));};exports[_0xc71d('0x45')]=function(_0x225a7d,_0x235111){return db['VoiceMailMessage'][_0xc71d('0x44')]({'where':{'id':_0x225a7d[_0xc71d('0x40')]['id']}})[_0xc71d('0x23')](handleEntityNotFound(_0x235111,null))[_0xc71d('0x23')](removeEntity(_0x235111,null))[_0xc71d('0x3f')](handleError(_0x235111,null));};exports['download']=function(_0x4252f9,_0xe5741a,_0x3eaf08){return db[_0xc71d('0x27')][_0xc71d('0x44')]({'where':{'id':_0x4252f9[_0xc71d('0x40')]['id']},'attributes':['id','recording','msg_id']})['then'](handleEntityNotFound(_0xe5741a,null))[_0xc71d('0x23')](function(_0x2924ab){if(_0x2924ab){if(!_0x2924ab[_0xc71d('0x46')]){throw new db[(_0xc71d('0x47'))]['ValidationError'](_0xc71d('0x48'));}var _0x19e718={'Content-Type':_0xc71d('0x49'),'Content-Disposition':_0xc71d('0x4a')};if(_0x2924ab[_0xc71d('0x4b')]){_0x19e718[_0xc71d('0x4c')]='attachment;\x20filename=\x22'+_0x2924ab[_0xc71d('0x4b')]+_0xc71d('0x4d');}_0xe5741a[_0xc71d('0x4e')](_0x19e718);return _0xe5741a[_0xc71d('0x4f')](new Buffer(_0x2924ab['recording']));}})['catch'](handleError(_0xe5741a,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index e2fee50..34600dc 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 _0x70b0=['bluebird','request-promise','path','rimraf','../../config/environment','exports','voice_voicemail_messages','dir','lodash','../../config/logger','api','moment'];(function(_0x497ca1,_0xa6ad28){var _0x2dde19=function(_0x22f89c){while(--_0x22f89c){_0x497ca1['push'](_0x497ca1['shift']());}};_0x2dde19(++_0xa6ad28);}(_0x70b0,0xd4));var _0x070b=function(_0x1bc013,_0x7771c6){_0x1bc013=_0x1bc013-0x0;var _0x55df36=_0x70b0[_0x1bc013];return _0x55df36;};'use strict';var _=require(_0x070b('0x0'));var util=require('util');var logger=require(_0x070b('0x1'))(_0x070b('0x2'));var moment=require(_0x070b('0x3'));var BPromise=require(_0x070b('0x4'));var rp=require(_0x070b('0x5'));var fs=require('fs');var path=require(_0x070b('0x6'));var rimraf=require(_0x070b('0x7'));var config=require(_0x070b('0x8'));var attributes=require('./voiceMailMessage.attributes');module[_0x070b('0x9')]=function(_0x13b6dd,_0xf44d72){return _0x13b6dd['define']('VoiceMailMessage',attributes,{'tableName':_0x070b('0xa'),'paranoid':![],'indexes':[{'name':_0x070b('0xb'),'fields':[_0x070b('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0x6a96=['dir','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage'];(function(_0x4fe416,_0x5a310a){var _0x252725=function(_0x1d67db){while(--_0x1d67db){_0x4fe416['push'](_0x4fe416['shift']());}};_0x252725(++_0x5a310a);}(_0x6a96,0x1bb));var _0x66a9=function(_0x2a55f8,_0x540ac4){_0x2a55f8=_0x2a55f8-0x0;var _0x245efd=_0x6a96[_0x2a55f8];return _0x245efd;};'use strict';var _=require(_0x66a9('0x0'));var util=require(_0x66a9('0x1'));var logger=require(_0x66a9('0x2'))(_0x66a9('0x3'));var moment=require(_0x66a9('0x4'));var BPromise=require('bluebird');var rp=require(_0x66a9('0x5'));var fs=require('fs');var path=require(_0x66a9('0x6'));var rimraf=require(_0x66a9('0x7'));var config=require(_0x66a9('0x8'));var attributes=require(_0x66a9('0x9'));module['exports']=function(_0x383e7e,_0x5acd82){return _0x383e7e[_0x66a9('0xa')](_0x66a9('0xb'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x66a9('0xc'),'fields':[_0x66a9('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 298d774..827f9d3 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 _0x688e=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','moment','randomstring','../../mysqldb'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0x688e,0xa3));var _0xe688=function(_0x578850,_0xf59859){_0x578850=_0x578850-0x0;var _0x223ed0=_0x688e[_0x578850];return _0x223ed0;};'use strict';var _=require(_0xe688('0x0'));var util=require(_0xe688('0x1'));var moment=require(_0xe688('0x2'));var BPromise=require('bluebird');var rs=require(_0xe688('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe688('0x4'))['db'];var utils=require(_0xe688('0x5'));var logger=require(_0xe688('0x6'))(_0xe688('0x7'));var config=require(_0xe688('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe688('0x9')][_0xe688('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35648e,_0x3ac2a1,_0x34c565){return new BPromise(function(_0x144e76,_0x134422){return client[_0xe688('0xb')](_0x35648e,_0x34c565)[_0xe688('0xc')](function(_0x128a91){logger[_0xe688('0xd')](_0xe688('0xe'),_0x3ac2a1,_0xe688('0xf'));logger[_0xe688('0x10')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x3ac2a1,'request\x20sent',JSON[_0xe688('0x11')](_0x128a91));if(_0x128a91['error']){if(_0x128a91[_0xe688('0x12')][_0xe688('0x13')]===0x1f4){logger[_0xe688('0x12')](_0xe688('0xe'),_0x3ac2a1,_0x128a91[_0xe688('0x12')][_0xe688('0x14')]);return _0x134422(_0x128a91[_0xe688('0x12')][_0xe688('0x14')]);}logger[_0xe688('0x12')](_0xe688('0xe'),_0x3ac2a1,_0x128a91[_0xe688('0x12')][_0xe688('0x14')]);return _0x144e76(_0x128a91['error'][_0xe688('0x14')]);}else{logger['info'](_0xe688('0xe'),_0x3ac2a1,_0xe688('0xf'));_0x144e76(_0x128a91['result'][_0xe688('0x14')]);}})['catch'](function(_0x5ac4fb){logger[_0xe688('0x12')](_0xe688('0xe'),_0x3ac2a1,_0x5ac4fb);_0x134422(_0x5ac4fb);});});} \ No newline at end of file +var _0x0e74=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','then','info','VoiceMailMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x23017e,_0x3e2ceb){var _0xe0848a=function(_0x103542){while(--_0x103542){_0x23017e['push'](_0x23017e['shift']());}};_0xe0848a(++_0x3e2ceb);}(_0x0e74,0x72));var _0x40e7=function(_0xf90dc0,_0x59229b){_0xf90dc0=_0xf90dc0-0x0;var _0xf72c1a=_0x0e74[_0xf90dc0];return _0xf72c1a;};'use strict';var _=require(_0x40e7('0x0'));var util=require(_0x40e7('0x1'));var moment=require('moment');var BPromise=require(_0x40e7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x40e7('0x3'));var db=require(_0x40e7('0x4'))['db'];var utils=require(_0x40e7('0x5'));var logger=require('../../config/logger')(_0x40e7('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x40e7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf6db46,_0x4b5778,_0x30f789){return new BPromise(function(_0x6ef3d4,_0x500742){return client['request'](_0xf6db46,_0x30f789)[_0x40e7('0x8')](function(_0x2648d3){logger[_0x40e7('0x9')](_0x40e7('0xa'),_0x4b5778,'request\x20sent');logger[_0x40e7('0xb')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x4b5778,_0x40e7('0xc'),JSON[_0x40e7('0xd')](_0x2648d3));if(_0x2648d3[_0x40e7('0xe')]){if(_0x2648d3['error'][_0x40e7('0xf')]===0x1f4){logger[_0x40e7('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x4b5778,_0x2648d3[_0x40e7('0xe')][_0x40e7('0x10')]);return _0x500742(_0x2648d3[_0x40e7('0xe')][_0x40e7('0x10')]);}logger[_0x40e7('0xe')]('VoiceMailMessage,\x20%s,\x20%s',_0x4b5778,_0x2648d3[_0x40e7('0xe')]['message']);return _0x6ef3d4(_0x2648d3[_0x40e7('0xe')][_0x40e7('0x10')]);}else{logger[_0x40e7('0x9')](_0x40e7('0xa'),_0x4b5778,_0x40e7('0xc'));_0x6ef3d4(_0x2648d3[_0x40e7('0x11')][_0x40e7('0x10')]);}})[_0x40e7('0x12')](function(_0x5d1b29){logger[_0x40e7('0xe')](_0x40e7('0xa'),_0x4b5778,_0x5d1b29);_0x500742(_0x5d1b29);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 31c993e..6eb2a9d 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 _0x3670=['index','get','show','getSounds','post','create','put','/:id','update','delete','destroy','/:id/sounds/:id2','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceMusicOnHold.controller','isAuthenticated'];(function(_0x270afc,_0x5117c4){var _0x1f4ede=function(_0x3d779a){while(--_0x3d779a){_0x270afc['push'](_0x270afc['shift']());}};_0x1f4ede(++_0x5117c4);}(_0x3670,0x16d));var _0x0367=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3670[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x0367('0x0'));var util=require(_0x0367('0x1'));var path=require('path');var timeout=require(_0x0367('0x2'));var express=require(_0x0367('0x3'));var router=express[_0x0367('0x4')]();var fs_extra=require(_0x0367('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0367('0x6'));var config=require('../../config/environment');var controller=require(_0x0367('0x7'));router['get']('/',auth[_0x0367('0x8')](),controller[_0x0367('0x9')]);router[_0x0367('0xa')]('/:id',auth[_0x0367('0x8')](),controller[_0x0367('0xb')]);router['get']('/:id/sounds',auth[_0x0367('0x8')](),controller[_0x0367('0xc')]);router[_0x0367('0xd')]('/',auth[_0x0367('0x8')](),controller[_0x0367('0xe')]);router[_0x0367('0xd')]('/:id/sounds',auth[_0x0367('0x8')](),controller['addSound']);router[_0x0367('0xf')](_0x0367('0x10'),auth[_0x0367('0x8')](),controller[_0x0367('0x11')]);router[_0x0367('0x12')](_0x0367('0x10'),auth['isAuthenticated'](),controller[_0x0367('0x13')]);router[_0x0367('0x12')](_0x0367('0x14'),auth[_0x0367('0x8')](),controller['removeSound']);module[_0x0367('0x15')]=router; \ No newline at end of file +var _0xcf3d=['getSounds','post','create','put','delete','destroy','removeSound','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','show','/:id/sounds'];(function(_0x2a1bdf,_0x1291b1){var _0x1b0f13=function(_0x1536ec){while(--_0x1536ec){_0x2a1bdf['push'](_0x2a1bdf['shift']());}};_0x1b0f13(++_0x1291b1);}(_0xcf3d,0x1a6));var _0xdcf3=function(_0x43fab1,_0x2d2876){_0x43fab1=_0x43fab1-0x0;var _0x12c5dd=_0xcf3d[_0x43fab1];return _0x12c5dd;};'use strict';var multer=require(_0xdcf3('0x0'));var util=require(_0xdcf3('0x1'));var path=require(_0xdcf3('0x2'));var timeout=require('connect-timeout');var express=require(_0xdcf3('0x3'));var router=express[_0xdcf3('0x4')]();var fs_extra=require(_0xdcf3('0x5'));var auth=require(_0xdcf3('0x6'));var interaction=require(_0xdcf3('0x7'));var config=require(_0xdcf3('0x8'));var controller=require(_0xdcf3('0x9'));router[_0xdcf3('0xa')]('/',auth[_0xdcf3('0xb')](),controller['index']);router['get'](_0xdcf3('0xc'),auth[_0xdcf3('0xb')](),controller[_0xdcf3('0xd')]);router[_0xdcf3('0xa')](_0xdcf3('0xe'),auth[_0xdcf3('0xb')](),controller[_0xdcf3('0xf')]);router[_0xdcf3('0x10')]('/',auth['isAuthenticated'](),controller[_0xdcf3('0x11')]);router[_0xdcf3('0x10')](_0xdcf3('0xe'),auth[_0xdcf3('0xb')](),controller['addSound']);router[_0xdcf3('0x12')](_0xdcf3('0xc'),auth[_0xdcf3('0xb')](),controller['update']);router[_0xdcf3('0x13')](_0xdcf3('0xc'),auth[_0xdcf3('0xb')](),controller[_0xdcf3('0x14')]);router[_0xdcf3('0x13')]('/:id/sounds/:id2',auth[_0xdcf3('0xb')](),controller[_0xdcf3('0x15')]);module[_0xdcf3('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 51173c4..b0184e3 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 _0x73e5=['mp3','TIMESTAMP','BOOLEAN','sequelize','STRING','ENUM','files','mp3nb','quietmp3nb'];(function(_0x36f0c7,_0x3d5317){var _0x393f26=function(_0x206c09){while(--_0x206c09){_0x36f0c7['push'](_0x36f0c7['shift']());}};_0x393f26(++_0x3d5317);}(_0x73e5,0x174));var _0x573e=function(_0x1fb1c1,_0x4ebe69){_0x1fb1c1=_0x1fb1c1-0x0;var _0x1622df=_0x73e5[_0x1fb1c1];return _0x1622df;};'use strict';var Sequelize=require(_0x573e('0x0'));module['exports']={'name':{'type':Sequelize[_0x573e('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x573e('0x2')]('custom',_0x573e('0x3'),_0x573e('0x4'),_0x573e('0x5'),'quietmp3',_0x573e('0x6')),'allowNull':!![],'defaultValue':_0x573e('0x3')},'directory':{'type':Sequelize[_0x573e('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x573e('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x573e('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x573e('0x1')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x573e('0x7')},'defaultEntry':{'type':Sequelize[_0x573e('0x8')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0c0c=['ENUM','files','mp3nb','quietmp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x55efb4,_0x439d5d){var _0x39042c=function(_0x4a1055){while(--_0x4a1055){_0x55efb4['push'](_0x55efb4['shift']());}};_0x39042c(++_0x439d5d);}(_0x0c0c,0x1a9));var _0xc0c0=function(_0x2283a6,_0x468369){_0x2283a6=_0x2283a6-0x0;var _0x1f87c7=_0x0c0c[_0x2283a6];return _0x1f87c7;};'use strict';var Sequelize=require(_0xc0c0('0x0'));module[_0xc0c0('0x1')]={'name':{'type':Sequelize[_0xc0c0('0x2')],'allowNull':![],'unique':_0xc0c0('0x3')},'mode':{'type':Sequelize[_0xc0c0('0x4')]('custom',_0xc0c0('0x5'),_0xc0c0('0x6'),_0xc0c0('0x7'),_0xc0c0('0x8'),_0xc0c0('0x9')),'allowNull':!![],'defaultValue':_0xc0c0('0x5')},'directory':{'type':Sequelize[_0xc0c0('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xc0c0('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xc0c0('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xc0c0('0x2')],'allowNull':!![],'defaultValue':_0xc0c0('0xa')},'format':{'type':Sequelize[_0xc0c0('0x2')],'allowNull':!![]},'stamp':{'type':_0xc0c0('0xb')},'defaultEntry':{'type':Sequelize[_0xc0c0('0xc')],'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 2e16b45..20ae370 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 _0x6fa2=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','name','send','index','VoiceMusicOnHold','fieldName','type','key','model','map','keys','intersection','attributes','fields','query','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','catch','params','rawAttributes','includeAll','include','find','body','create','sequelize','mode','files','directory','join','root','server/files/moh','mkdirSync','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','transaction','readdirSync','rmdirSync','ValidationError','addSound','Sound','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','save_name','symlinkSync','Sequelize','message','findOne','removeSound','id2','getSounds','nolimit','rimraf'];(function(_0x4a60be,_0x26d952){var _0x74041c=function(_0x1a988d){while(--_0x1a988d){_0x4a60be['push'](_0x4a60be['shift']());}};_0x74041c(++_0x26d952);}(_0x6fa2,0xdb));var _0x26fa=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x6fa2[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x26fa('0x0'));var zipdir=require(_0x26fa('0x1'));var jsonpatch=require(_0x26fa('0x2'));var rp=require(_0x26fa('0x3'));var moment=require(_0x26fa('0x4'));var BPromise=require(_0x26fa('0x5'));var Mustache=require(_0x26fa('0x6'));var util=require(_0x26fa('0x7'));var path=require(_0x26fa('0x8'));var sox=require(_0x26fa('0x9'));var csv=require(_0x26fa('0xa'));var ejs=require(_0x26fa('0xb'));var fs=require('fs');var fs_extra=require(_0x26fa('0xc'));var _=require(_0x26fa('0xd'));var squel=require(_0x26fa('0xe'));var crypto=require('crypto');var jsforce=require(_0x26fa('0xf'));var deskjs=require(_0x26fa('0x10'));var toCsv=require(_0x26fa('0xa'));var querystring=require('querystring');var Papa=require(_0x26fa('0x11'));var Redis=require(_0x26fa('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x26fa('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x26fa('0x14'));var utils=require(_0x26fa('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x26fa('0x16'));var db=require(_0x26fa('0x17'))['db'];function respondWithStatusCode(_0x5f46e9,_0x59f7ce){_0x59f7ce=_0x59f7ce||0xcc;return function(_0x2d5e76){if(_0x2d5e76){return _0x5f46e9[_0x26fa('0x18')](_0x59f7ce);}return _0x5f46e9[_0x26fa('0x19')](_0x59f7ce)[_0x26fa('0x1a')]();};}function respondWithResult(_0x1873f4,_0x490875){_0x490875=_0x490875||0xc8;return function(_0x42e5db){if(_0x42e5db){return _0x1873f4['status'](_0x490875)[_0x26fa('0x1b')](_0x42e5db);}};}function respondWithFilteredResult(_0x4e5015,_0x31ee79){return function(_0x1c68cf){if(_0x1c68cf){var _0x62ed05=typeof _0x31ee79['offset']===_0x26fa('0x1c')&&typeof _0x31ee79[_0x26fa('0x1d')]==='undefined';var _0x5222d8=_0x1c68cf[_0x26fa('0x1e')];var _0x2af6ea=_0x62ed05?0x0:_0x31ee79['offset'];var _0x13e371=_0x62ed05?_0x1c68cf[_0x26fa('0x1e')]:_0x31ee79[_0x26fa('0x1f')]+_0x31ee79[_0x26fa('0x1d')];var _0x5f3089;if(_0x13e371>=_0x5222d8){_0x13e371=_0x5222d8;_0x5f3089=0xc8;}else{_0x5f3089=0xce;}_0x4e5015['status'](_0x5f3089);return _0x4e5015[_0x26fa('0x20')]('Content-Range',_0x2af6ea+'-'+_0x13e371+'/'+_0x5222d8)['json'](_0x1c68cf);}return null;};}function patchUpdates(_0x4ee009){return function(_0x22155a){try{jsonpatch[_0x26fa('0x21')](_0x22155a,_0x4ee009,!![]);}catch(_0x3d0026){return BPromise['reject'](_0x3d0026);}return _0x22155a[_0x26fa('0x22')]();};}function saveUpdates(_0x1b8735,_0x47dca1){return function(_0x16b1be){if(_0x16b1be){return _0x16b1be[_0x26fa('0x23')](_0x1b8735)[_0x26fa('0x24')](function(_0x2bd074){return _0x2bd074;});}return null;};}function removeEntity(_0x471e2f,_0x1d4a86){return function(_0x12ef07){if(_0x12ef07){return _0x12ef07[_0x26fa('0x25')]()[_0x26fa('0x24')](function(){var _0x3173b0=_0x12ef07[_0x26fa('0x26')]({'plain':!![]});var _0x12e758=_0x26fa('0x27');return db[_0x26fa('0x28')][_0x26fa('0x25')]({'where':{'type':_0x12e758,'resourceId':_0x3173b0['id']}})[_0x26fa('0x24')](function(){return _0x12ef07;});})[_0x26fa('0x24')](function(){_0x471e2f[_0x26fa('0x19')](0xcc)[_0x26fa('0x1a')]();});}};}function handleEntityNotFound(_0x42e04f,_0x5de792){return function(_0xa7ae31){if(!_0xa7ae31){_0x42e04f[_0x26fa('0x18')](0x194);}return _0xa7ae31;};}function handleError(_0x5a9b18,_0x5ce930){_0x5ce930=_0x5ce930||0x1f4;return function(_0x154af8){logger[_0x26fa('0x29')](_0x154af8['stack']);if(_0x154af8[_0x26fa('0x2a')]){delete _0x154af8[_0x26fa('0x2a')];}_0x5a9b18['status'](_0x5ce930)[_0x26fa('0x2b')](_0x154af8);};}exports[_0x26fa('0x2c')]=function(_0x4ac537,_0x1b7e84){var _0x23d2d6={},_0x2c6ab1={},_0x256983={'count':0x0,'rows':[]};var _0xee9f26=_['map'](db[_0x26fa('0x2d')]['rawAttributes'],function(_0x23e826){return{'name':_0x23e826[_0x26fa('0x2e')],'type':_0x23e826[_0x26fa('0x2f')][_0x26fa('0x30')]};});_0x2c6ab1[_0x26fa('0x31')]=_[_0x26fa('0x32')](_0xee9f26,_0x26fa('0x2a'));_0x2c6ab1['query']=_[_0x26fa('0x33')](_0x4ac537['query']);_0x2c6ab1['filters']=_[_0x26fa('0x34')](_0x2c6ab1[_0x26fa('0x31')],_0x2c6ab1['query']);_0x23d2d6[_0x26fa('0x35')]=_[_0x26fa('0x34')](_0x2c6ab1[_0x26fa('0x31')],qs[_0x26fa('0x36')](_0x4ac537[_0x26fa('0x37')][_0x26fa('0x36')]));_0x23d2d6[_0x26fa('0x35')]=_0x23d2d6[_0x26fa('0x35')][_0x26fa('0x38')]?_0x23d2d6['attributes']:_0x2c6ab1[_0x26fa('0x31')];if(!_0x4ac537[_0x26fa('0x37')][_0x26fa('0x39')]('nolimit')){_0x23d2d6[_0x26fa('0x1d')]=qs[_0x26fa('0x1d')](_0x4ac537[_0x26fa('0x37')]['limit']);_0x23d2d6['offset']=qs[_0x26fa('0x1f')](_0x4ac537[_0x26fa('0x37')]['offset']);}_0x23d2d6[_0x26fa('0x3a')]=qs[_0x26fa('0x3b')](_0x4ac537[_0x26fa('0x37')][_0x26fa('0x3b')]);delete _0x4ac537[_0x26fa('0x37')]['sort'];_0x23d2d6[_0x26fa('0x3c')]=qs[_0x26fa('0x3d')](_[_0x26fa('0x3e')](_0x4ac537['query'],_0x2c6ab1['filters']),_0xee9f26);if(_0x4ac537[_0x26fa('0x37')][_0x26fa('0x3f')]){_0x23d2d6[_0x26fa('0x3c')]=_[_0x26fa('0x40')](_0x23d2d6[_0x26fa('0x3c')],{'$or':_[_0x26fa('0x32')](_0xee9f26,function(_0x562645){if(_0x562645[_0x26fa('0x2f')]!==_0x26fa('0x41')){var _0x40208a={};_0x40208a[_0x562645['name']]={'$like':'%'+_0x4ac537[_0x26fa('0x37')]['filter']+'%'};return _0x40208a;}})});}_0x23d2d6=_['merge']({},_0x23d2d6,_0x4ac537[_0x26fa('0x42')]);var _0x1f4c23={'where':_0x23d2d6['where']};return db['VoiceMusicOnHold'][_0x26fa('0x1e')](_0x1f4c23)['then'](function(_0x5bc1d8){_0x256983['count']=_0x5bc1d8;if(_0x4ac537[_0x26fa('0x37')]['includeAll']){_0x23d2d6['include']=[{'all':!![]}];}return db['VoiceMusicOnHold']['findAll'](_0x23d2d6);})[_0x26fa('0x24')](function(_0x2e4826){_0x256983[_0x26fa('0x43')]=_0x2e4826;return _0x256983;})[_0x26fa('0x24')](respondWithFilteredResult(_0x1b7e84,_0x23d2d6))[_0x26fa('0x44')](handleError(_0x1b7e84,null));};exports['show']=function(_0x5255aa,_0x3c90eb){var _0x161f8e={'raw':![],'where':{'id':_0x5255aa[_0x26fa('0x45')]['id']}},_0x206ed5={};_0x206ed5['model']=_[_0x26fa('0x33')](db[_0x26fa('0x2d')][_0x26fa('0x46')]);_0x206ed5[_0x26fa('0x37')]=_[_0x26fa('0x33')](_0x5255aa[_0x26fa('0x37')]);_0x206ed5['filters']=_[_0x26fa('0x34')](_0x206ed5['model'],_0x206ed5[_0x26fa('0x37')]);_0x161f8e[_0x26fa('0x35')]=_[_0x26fa('0x34')](_0x206ed5['model'],qs[_0x26fa('0x36')](_0x5255aa['query']['fields']));_0x161f8e['attributes']=_0x161f8e[_0x26fa('0x35')]['length']?_0x161f8e[_0x26fa('0x35')]:_0x206ed5['model'];if(_0x5255aa[_0x26fa('0x37')][_0x26fa('0x47')]){_0x161f8e[_0x26fa('0x48')]=[{'all':!![]}];}_0x161f8e=_[_0x26fa('0x40')]({},_0x161f8e,_0x5255aa[_0x26fa('0x42')]);return db[_0x26fa('0x2d')][_0x26fa('0x49')](_0x161f8e)[_0x26fa('0x24')](handleEntityNotFound(_0x3c90eb,null))[_0x26fa('0x24')](respondWithResult(_0x3c90eb,null))['catch'](handleError(_0x3c90eb,null));};exports['update']=function(_0x26fc4c,_0x52b4d9){if(_0x26fc4c[_0x26fa('0x4a')]['id']){delete _0x26fc4c[_0x26fa('0x4a')]['id'];}return db[_0x26fa('0x2d')][_0x26fa('0x49')]({'where':{'id':_0x26fc4c['params']['id']}})['then'](handleEntityNotFound(_0x52b4d9,null))['then'](saveUpdates(_0x26fc4c[_0x26fa('0x4a')],null))[_0x26fa('0x24')](respondWithResult(_0x52b4d9,null))[_0x26fa('0x44')](handleError(_0x52b4d9,null));};exports[_0x26fa('0x4b')]=function(_0x34ff1e,_0x907ac5,_0x43c9dc){return db[_0x26fa('0x4c')]['transaction'](function(_0x32a3cc){if(_0x34ff1e[_0x26fa('0x4a')][_0x26fa('0x4d')]===_0x26fa('0x4e')){_0x34ff1e[_0x26fa('0x4a')][_0x26fa('0x4f')]=path[_0x26fa('0x50')](config[_0x26fa('0x51')],_0x26fa('0x52'),_0x34ff1e[_0x26fa('0x4a')][_0x26fa('0x2a')]);}return db[_0x26fa('0x2d')][_0x26fa('0x4b')](_0x34ff1e['body'],{'transaction':_0x32a3cc})[_0x26fa('0x24')](function(_0x4f212e){if(_0x34ff1e[_0x26fa('0x4a')][_0x26fa('0x4d')]===_0x26fa('0x4e')){fs[_0x26fa('0x53')](_0x4f212e[_0x26fa('0x4f')],parseInt('0777',0x8));}var _0x5205d1=_0x34ff1e['user']['get']({'plain':!![]});if(!_0x5205d1)throw new Error(_0x26fa('0x54'));if(_0x5205d1[_0x26fa('0x55')]===_0x26fa('0x56')){var _0x3324ac=_0x4f212e['get']({'plain':!![]});return db['UserProfileSection'][_0x26fa('0x49')]({'where':{'name':_0x26fa('0x27'),'userProfileId':_0x5205d1[_0x26fa('0x57')]},'raw':!![]})[_0x26fa('0x24')](function(_0x669007){if(_0x669007&&_0x669007[_0x26fa('0x58')]===0x0){return db[_0x26fa('0x28')][_0x26fa('0x4b')]({'name':_0x3324ac[_0x26fa('0x2a')],'resourceId':_0x3324ac['id'],'type':_0x669007[_0x26fa('0x2a')],'sectionId':_0x669007['id']},{})[_0x26fa('0x24')](function(){return _0x4f212e;});}else{return _0x4f212e;}})[_0x26fa('0x44')](function(_0x87fe21){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x87fe21);});}return _0x4f212e;});})[_0x26fa('0x24')](respondWithResult(_0x907ac5,0xc9))['catch'](handleError(_0x907ac5,null));};exports[_0x26fa('0x25')]=function(_0x2b98c4,_0x305887,_0x3e9071){var _0x334f98;return db[_0x26fa('0x2d')][_0x26fa('0x49')]({'where':{'id':_0x2b98c4[_0x26fa('0x45')]['id']}})[_0x26fa('0x24')](function(_0x116d4b){if(_0x116d4b){return db[_0x26fa('0x4c')][_0x26fa('0x59')](function(_0xf8fac1){return _0x116d4b[_0x26fa('0x25')]({'transaction':_0xf8fac1,'raw':!![]})[_0x26fa('0x24')](function(_0x13b18a){if(_0x13b18a[_0x26fa('0x4f')]){fs[_0x26fa('0x5a')](_0x13b18a['directory'])['forEach'](function(_0x2fe961){fs['unlinkSync'](path[_0x26fa('0x50')](_0x13b18a['directory'],_0x2fe961));});fs[_0x26fa('0x5b')](_0x13b18a[_0x26fa('0x4f')]);}return _0x13b18a;});})['catch'](function(_0x40c767){throw new db['Sequelize'][(_0x26fa('0x5c'))](_0x40c767['message']);});}})['then'](handleEntityNotFound(_0x305887,null))[_0x26fa('0x24')](removeEntity(_0x305887,null))[_0x26fa('0x44')](handleError(_0x305887,null));};exports[_0x26fa('0x5d')]=function(_0x5c0c79,_0x54e50c,_0x3e64b5){return db[_0x26fa('0x4c')]['transaction'](function(_0x575c56){var _0x3e219f;return db[_0x26fa('0x2d')][_0x26fa('0x49')]({'where':{'id':_0x5c0c79[_0x26fa('0x45')]['id']}})[_0x26fa('0x24')](function(_0x25349e){if(_0x25349e){_0x3e219f=_0x25349e;return _0x25349e[_0x26fa('0x5d')](_0x5c0c79[_0x26fa('0x4a')]['id'],{'transaction':_0x575c56});}})[_0x26fa('0x24')](function(_0x59f810){if(_0x59f810){return db[_0x26fa('0x5e')]['findOne']({'where':{'id':_0x5c0c79[_0x26fa('0x4a')]['id']},'attributes':['id',_0x26fa('0x2a'),'save_name',_0x26fa('0x5f'),_0x26fa('0x60')],'raw':!![]});}})[_0x26fa('0x24')](function(_0x18ee56){if(_0x18ee56){var _0x36a083=path[_0x26fa('0x50')](config[_0x26fa('0x51')],_0x26fa('0x61'),util[_0x26fa('0x62')](_0x26fa('0x63'),path[_0x26fa('0x64')](_0x18ee56[_0x26fa('0x65')],path['extname'](_0x18ee56[_0x26fa('0x65')])),_0x18ee56[_0x26fa('0x5f')]));var _0x104692=path[_0x26fa('0x50')](config[_0x26fa('0x51')],'server/files/moh',_0x3e219f[_0x26fa('0x2a')],util[_0x26fa('0x62')](_0x26fa('0x63'),_0x18ee56['name'],_0x18ee56[_0x26fa('0x5f')]));fs[_0x26fa('0x66')](_0x36a083,_0x104692);return _0x18ee56;}})[_0x26fa('0x44')](function(_0x5d8476){throw new db[(_0x26fa('0x67'))][(_0x26fa('0x5c'))](_0x5d8476[_0x26fa('0x68')]);});})[_0x26fa('0x24')](handleEntityNotFound(_0x54e50c,null))[_0x26fa('0x24')](respondWithResult(_0x54e50c,0xc9))[_0x26fa('0x44')](handleError(_0x54e50c,null));};exports['removeSound']=function(_0x43aa92,_0x245262,_0x5b76f5){return db[_0x26fa('0x4c')]['transaction'](function(_0x3eef2e){var _0x1bce91;return db[_0x26fa('0x2d')][_0x26fa('0x69')]({'where':{'id':_0x43aa92[_0x26fa('0x45')]['id']}})['then'](handleEntityNotFound(_0x245262,null))[_0x26fa('0x24')](function(_0x49e484){if(_0x49e484){_0x1bce91=_0x49e484;return _0x49e484[_0x26fa('0x6a')](_0x43aa92['params'][_0x26fa('0x6b')]);}})[_0x26fa('0x24')](function(_0x26f73b){if(_0x26f73b){return db['Sound'][_0x26fa('0x69')]({'where':{'id':_0x43aa92[_0x26fa('0x45')][_0x26fa('0x6b')]},'attributes':['id',_0x26fa('0x2a'),_0x26fa('0x65'),_0x26fa('0x5f'),_0x26fa('0x60')],'raw':!![]});}})[_0x26fa('0x24')](function(_0x2be706){if(_0x2be706){fs['unlinkSync'](path[_0x26fa('0x50')](_0x1bce91[_0x26fa('0x4f')],util[_0x26fa('0x62')]('%s.%s',_0x2be706[_0x26fa('0x2a')],_0x2be706['converted_format'])));return _0x2be706;}})[_0x26fa('0x44')](function(_0x2fb798){throw new db[(_0x26fa('0x67'))][(_0x26fa('0x5c'))](_0x2fb798[_0x26fa('0x68')]);});})[_0x26fa('0x24')](handleEntityNotFound(_0x245262,null))[_0x26fa('0x24')](respondWithStatusCode(_0x245262,0xcc))[_0x26fa('0x44')](handleError(_0x245262,null));};exports[_0x26fa('0x6c')]=function(_0x3e1ee8,_0x16b6ca,_0x47e547){var _0xeb0a18={};var _0x3151e7={};var _0x4f7382;var _0x4939f6;return db[_0x26fa('0x2d')][_0x26fa('0x69')]({'where':{'id':_0x3e1ee8[_0x26fa('0x45')]['id']}})[_0x26fa('0x24')](handleEntityNotFound(_0x16b6ca,null))[_0x26fa('0x24')](function(_0x130016){if(_0x130016){_0x4f7382=_0x130016;_0x3151e7[_0x26fa('0x31')]=_[_0x26fa('0x33')](db[_0x26fa('0x5e')][_0x26fa('0x46')]);_0x3151e7['query']=_[_0x26fa('0x33')](_0x3e1ee8[_0x26fa('0x37')]);_0x3151e7[_0x26fa('0x3d')]=_[_0x26fa('0x34')](_0x3151e7[_0x26fa('0x31')],_0x3151e7[_0x26fa('0x37')]);_0xeb0a18[_0x26fa('0x35')]=_[_0x26fa('0x34')](_0x3151e7[_0x26fa('0x31')],qs['fields'](_0x3e1ee8['query'][_0x26fa('0x36')]));_0xeb0a18[_0x26fa('0x35')]=_0xeb0a18[_0x26fa('0x35')][_0x26fa('0x38')]?_0xeb0a18[_0x26fa('0x35')]:_0x3151e7[_0x26fa('0x31')];_0xeb0a18[_0x26fa('0x3a')]=qs[_0x26fa('0x3b')](_0x3e1ee8[_0x26fa('0x37')][_0x26fa('0x3b')]);_0xeb0a18[_0x26fa('0x3c')]=qs[_0x26fa('0x3d')](_[_0x26fa('0x3e')](_0x3e1ee8['query'],_0x3151e7[_0x26fa('0x3d')]));if(_0x3e1ee8[_0x26fa('0x37')][_0x26fa('0x3f')]){_0xeb0a18[_0x26fa('0x3c')]=_[_0x26fa('0x40')](_0xeb0a18[_0x26fa('0x3c')],{'$or':_['map'](_0xeb0a18[_0x26fa('0x35')],function(_0xfa5fa8){var _0x190563={};_0x190563[_0xfa5fa8]={'$like':'%'+_0x3e1ee8['query']['filter']+'%'};return _0x190563;})});}_0xeb0a18=_[_0x26fa('0x40')]({},_0xeb0a18,_0x3e1ee8[_0x26fa('0x42')]);return _0x4f7382[_0x26fa('0x6c')](_0xeb0a18);}})[_0x26fa('0x24')](function(_0x36b2a0){if(_0x36b2a0){_0x4939f6=_0x36b2a0['length'];if(!_0x3e1ee8['query'][_0x26fa('0x39')](_0x26fa('0x6d'))){_0xeb0a18['limit']=qs[_0x26fa('0x1d')](_0x3e1ee8[_0x26fa('0x37')][_0x26fa('0x1d')]);_0xeb0a18[_0x26fa('0x1f')]=qs[_0x26fa('0x1f')](_0x3e1ee8[_0x26fa('0x37')][_0x26fa('0x1f')]);}return _0x4f7382[_0x26fa('0x6c')](_0xeb0a18);}})['then'](function(_0x2904f5){if(_0x2904f5){return _0x2904f5?{'count':_0x4939f6,'rows':_0x2904f5}:null;}})['then'](respondWithResult(_0x16b6ca,null))['catch'](handleError(_0x16b6ca,null));}; \ No newline at end of file +var _0xf9fe=['sort','where','pick','filter','merge','type','options','includeAll','include','rows','catch','show','find','body','sequelize','transaction','mode','directory','join','root','server/files/moh','create','files','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','server/files/sounds/converted','format','%s.%s','basename','symlinkSync','removeSound','id2','unlinkSync','getSounds','eml-format','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','destroy','then','get','MusicOnHolds','error','stack','name','send','index','VoiceMusicOnHold','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x4eacd0,_0x38ea7e){var _0x4ee53f=function(_0x55d256){while(--_0x55d256){_0x4eacd0['push'](_0x4eacd0['shift']());}};_0x4ee53f(++_0x38ea7e);}(_0xf9fe,0x16e));var _0xef9f=function(_0x5c9f8f,_0x254f0c){_0x5c9f8f=_0x5c9f8f-0x0;var _0x2c554d=_0xf9fe[_0x5c9f8f];return _0x2c554d;};'use strict';var emlformat=require(_0xef9f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xef9f('0x1'));var moment=require('moment');var BPromise=require(_0xef9f('0x2'));var Mustache=require('mustache');var util=require(_0xef9f('0x3'));var path=require(_0xef9f('0x4'));var sox=require(_0xef9f('0x5'));var csv=require(_0xef9f('0x6'));var ejs=require(_0xef9f('0x7'));var fs=require('fs');var fs_extra=require(_0xef9f('0x8'));var _=require(_0xef9f('0x9'));var squel=require(_0xef9f('0xa'));var crypto=require(_0xef9f('0xb'));var jsforce=require(_0xef9f('0xc'));var deskjs=require(_0xef9f('0xd'));var toCsv=require(_0xef9f('0x6'));var querystring=require('querystring');var Papa=require(_0xef9f('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xef9f('0xf'));var as=require(_0xef9f('0x10'));var hardwareService=require(_0xef9f('0x11'));var logger=require('../../config/logger')(_0xef9f('0x12'));var utils=require('../../config/utils');var config=require(_0xef9f('0x13'));var licenseUtil=require(_0xef9f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ffcc2,_0x12edfa){_0x12edfa=_0x12edfa||0xcc;return function(_0x2f3c9f){if(_0x2f3c9f){return _0x2ffcc2[_0xef9f('0x15')](_0x12edfa);}return _0x2ffcc2[_0xef9f('0x16')](_0x12edfa)[_0xef9f('0x17')]();};}function respondWithResult(_0x33f0b4,_0x4ac81e){_0x4ac81e=_0x4ac81e||0xc8;return function(_0x3c3a1c){if(_0x3c3a1c){return _0x33f0b4[_0xef9f('0x16')](_0x4ac81e)[_0xef9f('0x18')](_0x3c3a1c);}};}function respondWithFilteredResult(_0x590542,_0x41a645){return function(_0x4e7a77){if(_0x4e7a77){var _0x10d9d2=typeof _0x41a645[_0xef9f('0x19')]===_0xef9f('0x1a')&&typeof _0x41a645['limit']===_0xef9f('0x1a');var _0x272db1=_0x4e7a77[_0xef9f('0x1b')];var _0x4bb917=_0x10d9d2?0x0:_0x41a645[_0xef9f('0x19')];var _0x5e6620=_0x10d9d2?_0x4e7a77[_0xef9f('0x1b')]:_0x41a645['offset']+_0x41a645[_0xef9f('0x1c')];var _0x4b24bb;if(_0x5e6620>=_0x272db1){_0x5e6620=_0x272db1;_0x4b24bb=0xc8;}else{_0x4b24bb=0xce;}_0x590542[_0xef9f('0x16')](_0x4b24bb);return _0x590542[_0xef9f('0x1d')](_0xef9f('0x1e'),_0x4bb917+'-'+_0x5e6620+'/'+_0x272db1)[_0xef9f('0x18')](_0x4e7a77);}return null;};}function patchUpdates(_0xaabe99){return function(_0x53d1ee){try{jsonpatch['apply'](_0x53d1ee,_0xaabe99,!![]);}catch(_0x4e361d){return BPromise[_0xef9f('0x1f')](_0x4e361d);}return _0x53d1ee['save']();};}function saveUpdates(_0x1199d5,_0x5b3669){return function(_0x45f889){if(_0x45f889){return _0x45f889[_0xef9f('0x20')](_0x1199d5)['then'](function(_0x820c86){return _0x820c86;});}return null;};}function removeEntity(_0x24c855,_0x3bba08){return function(_0x5c0f74){if(_0x5c0f74){return _0x5c0f74[_0xef9f('0x21')]()[_0xef9f('0x22')](function(){var _0x4ec459=_0x5c0f74[_0xef9f('0x23')]({'plain':!![]});var _0x42255d=_0xef9f('0x24');return db['UserProfileResource'][_0xef9f('0x21')]({'where':{'type':_0x42255d,'resourceId':_0x4ec459['id']}})[_0xef9f('0x22')](function(){return _0x5c0f74;});})[_0xef9f('0x22')](function(){_0x24c855['status'](0xcc)[_0xef9f('0x17')]();});}};}function handleEntityNotFound(_0x5cbab3,_0x565ddb){return function(_0x4e552d){if(!_0x4e552d){_0x5cbab3[_0xef9f('0x15')](0x194);}return _0x4e552d;};}function handleError(_0x446e49,_0x4ff815){_0x4ff815=_0x4ff815||0x1f4;return function(_0x46f8f4){logger[_0xef9f('0x25')](_0x46f8f4[_0xef9f('0x26')]);if(_0x46f8f4[_0xef9f('0x27')]){delete _0x46f8f4[_0xef9f('0x27')];}_0x446e49[_0xef9f('0x16')](_0x4ff815)[_0xef9f('0x28')](_0x46f8f4);};}exports[_0xef9f('0x29')]=function(_0x3af0dc,_0x3add1a){var _0x2ce3f2={},_0x5540b0={},_0x12faa3={'count':0x0,'rows':[]};var _0x171357=_['map'](db[_0xef9f('0x2a')][_0xef9f('0x2b')],function(_0x3935c8){return{'name':_0x3935c8[_0xef9f('0x2c')],'type':_0x3935c8['type'][_0xef9f('0x2d')]};});_0x5540b0[_0xef9f('0x2e')]=_[_0xef9f('0x2f')](_0x171357,'name');_0x5540b0[_0xef9f('0x30')]=_[_0xef9f('0x31')](_0x3af0dc[_0xef9f('0x30')]);_0x5540b0[_0xef9f('0x32')]=_[_0xef9f('0x33')](_0x5540b0[_0xef9f('0x2e')],_0x5540b0[_0xef9f('0x30')]);_0x2ce3f2[_0xef9f('0x34')]=_['intersection'](_0x5540b0[_0xef9f('0x2e')],qs[_0xef9f('0x35')](_0x3af0dc[_0xef9f('0x30')]['fields']));_0x2ce3f2['attributes']=_0x2ce3f2[_0xef9f('0x34')][_0xef9f('0x36')]?_0x2ce3f2['attributes']:_0x5540b0[_0xef9f('0x2e')];if(!_0x3af0dc[_0xef9f('0x30')][_0xef9f('0x37')](_0xef9f('0x38'))){_0x2ce3f2[_0xef9f('0x1c')]=qs['limit'](_0x3af0dc[_0xef9f('0x30')][_0xef9f('0x1c')]);_0x2ce3f2[_0xef9f('0x19')]=qs[_0xef9f('0x19')](_0x3af0dc[_0xef9f('0x30')]['offset']);}_0x2ce3f2[_0xef9f('0x39')]=qs['sort'](_0x3af0dc[_0xef9f('0x30')][_0xef9f('0x3a')]);delete _0x3af0dc[_0xef9f('0x30')][_0xef9f('0x3a')];_0x2ce3f2[_0xef9f('0x3b')]=qs[_0xef9f('0x32')](_[_0xef9f('0x3c')](_0x3af0dc['query'],_0x5540b0['filters']),_0x171357);if(_0x3af0dc['query'][_0xef9f('0x3d')]){_0x2ce3f2[_0xef9f('0x3b')]=_[_0xef9f('0x3e')](_0x2ce3f2['where'],{'$or':_[_0xef9f('0x2f')](_0x171357,function(_0x4cc090){if(_0x4cc090[_0xef9f('0x3f')]!=='VIRTUAL'){var _0x21b794={};_0x21b794[_0x4cc090[_0xef9f('0x27')]]={'$like':'%'+_0x3af0dc[_0xef9f('0x30')][_0xef9f('0x3d')]+'%'};return _0x21b794;}})});}_0x2ce3f2=_[_0xef9f('0x3e')]({},_0x2ce3f2,_0x3af0dc[_0xef9f('0x40')]);var _0x1fbdaa={'where':_0x2ce3f2['where']};return db['VoiceMusicOnHold']['count'](_0x1fbdaa)[_0xef9f('0x22')](function(_0x162f71){_0x12faa3[_0xef9f('0x1b')]=_0x162f71;if(_0x3af0dc[_0xef9f('0x30')][_0xef9f('0x41')]){_0x2ce3f2[_0xef9f('0x42')]=[{'all':!![]}];}return db[_0xef9f('0x2a')]['findAll'](_0x2ce3f2);})[_0xef9f('0x22')](function(_0x563f78){_0x12faa3[_0xef9f('0x43')]=_0x563f78;return _0x12faa3;})[_0xef9f('0x22')](respondWithFilteredResult(_0x3add1a,_0x2ce3f2))[_0xef9f('0x44')](handleError(_0x3add1a,null));};exports[_0xef9f('0x45')]=function(_0x49f35e,_0x46204d){var _0x51aa98={'raw':![],'where':{'id':_0x49f35e['params']['id']}},_0x47c2ef={};_0x47c2ef[_0xef9f('0x2e')]=_[_0xef9f('0x31')](db[_0xef9f('0x2a')][_0xef9f('0x2b')]);_0x47c2ef['query']=_[_0xef9f('0x31')](_0x49f35e['query']);_0x47c2ef[_0xef9f('0x32')]=_[_0xef9f('0x33')](_0x47c2ef[_0xef9f('0x2e')],_0x47c2ef['query']);_0x51aa98[_0xef9f('0x34')]=_[_0xef9f('0x33')](_0x47c2ef[_0xef9f('0x2e')],qs['fields'](_0x49f35e[_0xef9f('0x30')][_0xef9f('0x35')]));_0x51aa98['attributes']=_0x51aa98[_0xef9f('0x34')][_0xef9f('0x36')]?_0x51aa98[_0xef9f('0x34')]:_0x47c2ef['model'];if(_0x49f35e[_0xef9f('0x30')][_0xef9f('0x41')]){_0x51aa98[_0xef9f('0x42')]=[{'all':!![]}];}_0x51aa98=_[_0xef9f('0x3e')]({},_0x51aa98,_0x49f35e['options']);return db[_0xef9f('0x2a')][_0xef9f('0x46')](_0x51aa98)[_0xef9f('0x22')](handleEntityNotFound(_0x46204d,null))['then'](respondWithResult(_0x46204d,null))[_0xef9f('0x44')](handleError(_0x46204d,null));};exports[_0xef9f('0x20')]=function(_0x204699,_0x21374c){if(_0x204699[_0xef9f('0x47')]['id']){delete _0x204699[_0xef9f('0x47')]['id'];}return db[_0xef9f('0x2a')][_0xef9f('0x46')]({'where':{'id':_0x204699['params']['id']}})[_0xef9f('0x22')](handleEntityNotFound(_0x21374c,null))['then'](saveUpdates(_0x204699[_0xef9f('0x47')],null))['then'](respondWithResult(_0x21374c,null))[_0xef9f('0x44')](handleError(_0x21374c,null));};exports['create']=function(_0xef6a09,_0x5ea9a8,_0x55adcc){return db[_0xef9f('0x48')][_0xef9f('0x49')](function(_0x1188d7){if(_0xef6a09['body'][_0xef9f('0x4a')]==='files'){_0xef6a09[_0xef9f('0x47')][_0xef9f('0x4b')]=path[_0xef9f('0x4c')](config[_0xef9f('0x4d')],_0xef9f('0x4e'),_0xef6a09['body'][_0xef9f('0x27')]);}return db[_0xef9f('0x2a')][_0xef9f('0x4f')](_0xef6a09[_0xef9f('0x47')],{'transaction':_0x1188d7})[_0xef9f('0x22')](function(_0x3bb3bd){if(_0xef6a09['body']['mode']===_0xef9f('0x50')){fs['mkdirSync'](_0x3bb3bd['directory'],parseInt(_0xef9f('0x51'),0x8));}var _0x2f080a=_0xef6a09['user'][_0xef9f('0x23')]({'plain':!![]});if(!_0x2f080a)throw new Error(_0xef9f('0x52'));if(_0x2f080a[_0xef9f('0x53')]===_0xef9f('0x54')){var _0xec798=_0x3bb3bd[_0xef9f('0x23')]({'plain':!![]});return db[_0xef9f('0x55')]['find']({'where':{'name':_0xef9f('0x24'),'userProfileId':_0x2f080a[_0xef9f('0x56')]},'raw':!![]})[_0xef9f('0x22')](function(_0x1c21be){if(_0x1c21be&&_0x1c21be[_0xef9f('0x57')]===0x0){return db['UserProfileResource'][_0xef9f('0x4f')]({'name':_0xec798['name'],'resourceId':_0xec798['id'],'type':_0x1c21be[_0xef9f('0x27')],'sectionId':_0x1c21be['id']},{})[_0xef9f('0x22')](function(){return _0x3bb3bd;});}else{return _0x3bb3bd;}})[_0xef9f('0x44')](function(_0xed0c5c){logger[_0xef9f('0x25')](_0xef9f('0x58'),_0xed0c5c);});}return _0x3bb3bd;});})[_0xef9f('0x22')](respondWithResult(_0x5ea9a8,0xc9))[_0xef9f('0x44')](handleError(_0x5ea9a8,null));};exports[_0xef9f('0x21')]=function(_0x21ea37,_0x52f500,_0x581f8c){var _0x4a890c;return db[_0xef9f('0x2a')][_0xef9f('0x46')]({'where':{'id':_0x21ea37[_0xef9f('0x59')]['id']}})[_0xef9f('0x22')](function(_0x2be7b9){if(_0x2be7b9){return db[_0xef9f('0x48')]['transaction'](function(_0x5e3ffa){return _0x2be7b9[_0xef9f('0x21')]({'transaction':_0x5e3ffa,'raw':!![]})[_0xef9f('0x22')](function(_0x5828af){if(_0x5828af[_0xef9f('0x4b')]){fs['readdirSync'](_0x5828af[_0xef9f('0x4b')])['forEach'](function(_0x53ba2f){fs['unlinkSync'](path[_0xef9f('0x4c')](_0x5828af[_0xef9f('0x4b')],_0x53ba2f));});fs['rmdirSync'](_0x5828af[_0xef9f('0x4b')]);}return _0x5828af;});})['catch'](function(_0x4bc6d0){throw new db['Sequelize'][(_0xef9f('0x5a'))](_0x4bc6d0[_0xef9f('0x5b')]);});}})[_0xef9f('0x22')](handleEntityNotFound(_0x52f500,null))['then'](removeEntity(_0x52f500,null))[_0xef9f('0x44')](handleError(_0x52f500,null));};exports[_0xef9f('0x5c')]=function(_0x1a6064,_0x518d14,_0x57ad25){return db['sequelize'][_0xef9f('0x49')](function(_0x7e1ac9){var _0x1f5d8c;return db[_0xef9f('0x2a')][_0xef9f('0x46')]({'where':{'id':_0x1a6064['params']['id']}})[_0xef9f('0x22')](function(_0x238659){if(_0x238659){_0x1f5d8c=_0x238659;return _0x238659['addSound'](_0x1a6064[_0xef9f('0x47')]['id'],{'transaction':_0x7e1ac9});}})[_0xef9f('0x22')](function(_0x182957){if(_0x182957){return db[_0xef9f('0x5d')][_0xef9f('0x5e')]({'where':{'id':_0x1a6064['body']['id']},'attributes':['id',_0xef9f('0x27'),_0xef9f('0x5f'),_0xef9f('0x60'),'createdAt'],'raw':!![]});}})['then'](function(_0x207669){if(_0x207669){var _0x1a4bbc=path[_0xef9f('0x4c')](config[_0xef9f('0x4d')],_0xef9f('0x61'),util[_0xef9f('0x62')](_0xef9f('0x63'),path[_0xef9f('0x64')](_0x207669['save_name'],path['extname'](_0x207669[_0xef9f('0x5f')])),_0x207669[_0xef9f('0x60')]));var _0x3ce40d=path['join'](config[_0xef9f('0x4d')],'server/files/moh',_0x1f5d8c[_0xef9f('0x27')],util['format'](_0xef9f('0x63'),_0x207669[_0xef9f('0x27')],_0x207669[_0xef9f('0x60')]));fs[_0xef9f('0x65')](_0x1a4bbc,_0x3ce40d);return _0x207669;}})['catch'](function(_0x5b306e){throw new db['Sequelize'][(_0xef9f('0x5a'))](_0x5b306e[_0xef9f('0x5b')]);});})[_0xef9f('0x22')](handleEntityNotFound(_0x518d14,null))[_0xef9f('0x22')](respondWithResult(_0x518d14,0xc9))['catch'](handleError(_0x518d14,null));};exports[_0xef9f('0x66')]=function(_0x49d820,_0x2f28b4,_0x357f77){return db[_0xef9f('0x48')][_0xef9f('0x49')](function(_0x1a1754){var _0x31aecc;return db[_0xef9f('0x2a')]['findOne']({'where':{'id':_0x49d820[_0xef9f('0x59')]['id']}})[_0xef9f('0x22')](handleEntityNotFound(_0x2f28b4,null))[_0xef9f('0x22')](function(_0xe0aae1){if(_0xe0aae1){_0x31aecc=_0xe0aae1;return _0xe0aae1['removeSound'](_0x49d820['params']['id2']);}})[_0xef9f('0x22')](function(_0x5c2335){if(_0x5c2335){return db['Sound'][_0xef9f('0x5e')]({'where':{'id':_0x49d820[_0xef9f('0x59')][_0xef9f('0x67')]},'attributes':['id','name',_0xef9f('0x5f'),_0xef9f('0x60'),'createdAt'],'raw':!![]});}})[_0xef9f('0x22')](function(_0x1d6f75){if(_0x1d6f75){fs[_0xef9f('0x68')](path[_0xef9f('0x4c')](_0x31aecc[_0xef9f('0x4b')],util[_0xef9f('0x62')](_0xef9f('0x63'),_0x1d6f75['name'],_0x1d6f75['converted_format'])));return _0x1d6f75;}})[_0xef9f('0x44')](function(_0x33ec34){throw new db['Sequelize']['ValidationError'](_0x33ec34['message']);});})[_0xef9f('0x22')](handleEntityNotFound(_0x2f28b4,null))[_0xef9f('0x22')](respondWithStatusCode(_0x2f28b4,0xcc))[_0xef9f('0x44')](handleError(_0x2f28b4,null));};exports[_0xef9f('0x69')]=function(_0x28154f,_0xacfb2b,_0x53d832){var _0x111b5a={};var _0x3aa58d={};var _0x56a95f;var _0x11008e;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0x28154f[_0xef9f('0x59')]['id']}})[_0xef9f('0x22')](handleEntityNotFound(_0xacfb2b,null))[_0xef9f('0x22')](function(_0x39a46b){if(_0x39a46b){_0x56a95f=_0x39a46b;_0x3aa58d[_0xef9f('0x2e')]=_['keys'](db[_0xef9f('0x5d')][_0xef9f('0x2b')]);_0x3aa58d[_0xef9f('0x30')]=_[_0xef9f('0x31')](_0x28154f['query']);_0x3aa58d[_0xef9f('0x32')]=_['intersection'](_0x3aa58d['model'],_0x3aa58d['query']);_0x111b5a[_0xef9f('0x34')]=_[_0xef9f('0x33')](_0x3aa58d['model'],qs[_0xef9f('0x35')](_0x28154f[_0xef9f('0x30')][_0xef9f('0x35')]));_0x111b5a[_0xef9f('0x34')]=_0x111b5a[_0xef9f('0x34')]['length']?_0x111b5a[_0xef9f('0x34')]:_0x3aa58d[_0xef9f('0x2e')];_0x111b5a[_0xef9f('0x39')]=qs[_0xef9f('0x3a')](_0x28154f[_0xef9f('0x30')][_0xef9f('0x3a')]);_0x111b5a[_0xef9f('0x3b')]=qs[_0xef9f('0x32')](_[_0xef9f('0x3c')](_0x28154f['query'],_0x3aa58d[_0xef9f('0x32')]));if(_0x28154f[_0xef9f('0x30')][_0xef9f('0x3d')]){_0x111b5a[_0xef9f('0x3b')]=_[_0xef9f('0x3e')](_0x111b5a[_0xef9f('0x3b')],{'$or':_[_0xef9f('0x2f')](_0x111b5a['attributes'],function(_0x47615c){var _0x2db3fc={};_0x2db3fc[_0x47615c]={'$like':'%'+_0x28154f[_0xef9f('0x30')][_0xef9f('0x3d')]+'%'};return _0x2db3fc;})});}_0x111b5a=_[_0xef9f('0x3e')]({},_0x111b5a,_0x28154f[_0xef9f('0x40')]);return _0x56a95f[_0xef9f('0x69')](_0x111b5a);}})['then'](function(_0x58c802){if(_0x58c802){_0x11008e=_0x58c802['length'];if(!_0x28154f[_0xef9f('0x30')][_0xef9f('0x37')]('nolimit')){_0x111b5a[_0xef9f('0x1c')]=qs[_0xef9f('0x1c')](_0x28154f[_0xef9f('0x30')][_0xef9f('0x1c')]);_0x111b5a[_0xef9f('0x19')]=qs[_0xef9f('0x19')](_0x28154f[_0xef9f('0x30')]['offset']);}return _0x56a95f[_0xef9f('0x69')](_0x111b5a);}})[_0xef9f('0x22')](function(_0x30c61c){if(_0x30c61c){return _0x30c61c?{'count':_0x11008e,'rows':_0x30c61c}:null;}})[_0xef9f('0x22')](respondWithResult(_0xacfb2b,null))['catch'](handleError(_0xacfb2b,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 51fffb9..f697966 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 _0x1fd5=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','voice_musiconhold','lodash','util'];(function(_0x4cfeab,_0x4d1084){var _0x26f1c0=function(_0x1db379){while(--_0x1db379){_0x4cfeab['push'](_0x4cfeab['shift']());}};_0x26f1c0(++_0x4d1084);}(_0x1fd5,0x177));var _0x51fd=function(_0x4f3f42,_0x50f3af){_0x4f3f42=_0x4f3f42-0x0;var _0x30a1a4=_0x1fd5[_0x4f3f42];return _0x30a1a4;};'use strict';var _=require(_0x51fd('0x0'));var util=require(_0x51fd('0x1'));var logger=require(_0x51fd('0x2'))(_0x51fd('0x3'));var moment=require(_0x51fd('0x4'));var BPromise=require(_0x51fd('0x5'));var rp=require(_0x51fd('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x51fd('0x7'));var config=require(_0x51fd('0x8'));var attributes=require(_0x51fd('0x9'));module[_0x51fd('0xa')]=function(_0x440d23,_0x485765){return _0x440d23[_0x51fd('0xb')]('VoiceMusicOnHold',attributes,{'tableName':_0x51fd('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa135=['request-promise','rimraf','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','../../config/logger','api','moment'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0xa135,0x7d));var _0x5a13=function(_0x23a9cc,_0x49aaf7){_0x23a9cc=_0x23a9cc-0x0;var _0x34f9d1=_0xa135[_0x23a9cc];return _0x34f9d1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5a13('0x0'))(_0x5a13('0x1'));var moment=require(_0x5a13('0x2'));var BPromise=require('bluebird');var rp=require(_0x5a13('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5a13('0x4'));var config=require('../../config/environment');var attributes=require(_0x5a13('0x5'));module[_0x5a13('0x6')]=function(_0x95ff05,_0x4913e0){return _0x95ff05['define'](_0x5a13('0x7'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 37f93a7..9f5d20f 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(_0x13d913,_0x379ef3){var _0xf9b111=function(_0x405092){while(--_0x405092){_0x13d913['push'](_0x13d913['shift']());}};_0xf9b111(++_0x379ef3);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x305c31,_0x466b17){_0x305c31=_0x305c31-0x0;var _0x17f39f=_0xcb91[_0x305c31];return _0x17f39f;};'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 _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x1982dd,_0x1a257c){var _0x4c5157=function(_0x2de203){while(--_0x2de203){_0x1982dd['push'](_0x1982dd['shift']());}};_0x4c5157(++_0x1a257c);}(_0x34e8,0x12c));var _0x834e=function(_0x2926a4,_0x54be09){_0x2926a4=_0x2926a4-0x0;var _0x5457d2=_0x34e8[_0x2926a4];return _0x5457d2;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 26d19e6..e86edfc 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 _0xb673=['removeAgents','removeTeams','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','/:id/users','getAgents','/:id/teams','post','addAgents','addTeams','put','/:id','update','destroy','delete'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0xb673,0xa5));var _0x3b67=function(_0x4020ea,_0x88ab57){_0x4020ea=_0x4020ea-0x0;var _0x42557f=_0xb673[_0x4020ea];return _0x42557f;};'use strict';var multer=require(_0x3b67('0x0'));var util=require(_0x3b67('0x1'));var path=require('path');var timeout=require(_0x3b67('0x2'));var express=require(_0x3b67('0x3'));var router=express[_0x3b67('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3b67('0x5'));var interaction=require(_0x3b67('0x6'));var config=require(_0x3b67('0x7'));var controller=require('./voicePrefix.controller');router[_0x3b67('0x8')]('/',auth['isAuthenticated'](),controller[_0x3b67('0x9')]);router[_0x3b67('0x8')](_0x3b67('0xa'),auth[_0x3b67('0xb')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3b67('0xc')]);router['get'](_0x3b67('0xd'),auth['isAuthenticated'](),controller[_0x3b67('0xe')]);router[_0x3b67('0x8')](_0x3b67('0xf'),auth[_0x3b67('0xb')](),controller['getTeams']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3b67('0x10')](_0x3b67('0xd'),auth['isAuthenticated'](),controller[_0x3b67('0x11')]);router[_0x3b67('0x10')]('/:id/teams',auth[_0x3b67('0xb')](),controller[_0x3b67('0x12')]);router[_0x3b67('0x13')](_0x3b67('0x14'),auth[_0x3b67('0xb')](),controller[_0x3b67('0x15')]);router['delete']('/:id',auth[_0x3b67('0xb')](),controller[_0x3b67('0x16')]);router[_0x3b67('0x17')](_0x3b67('0xd'),auth['isAuthenticated'](),controller[_0x3b67('0x18')]);router[_0x3b67('0x17')]('/:id/teams',auth[_0x3b67('0xb')](),controller[_0x3b67('0x19')]);module[_0x3b67('0x1a')]=router; \ No newline at end of file +var _0xdffe=['removeTeams','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users','getAgents','/:id/teams','getTeams','post','create','addTeams','put','update','delete','destroy','removeAgents'];(function(_0x5a7f64,_0x347d57){var _0x3d30f1=function(_0x4bd1d6){while(--_0x4bd1d6){_0x5a7f64['push'](_0x5a7f64['shift']());}};_0x3d30f1(++_0x347d57);}(_0xdffe,0x1d2));var _0xedff=function(_0x2e397f,_0x41b105){_0x2e397f=_0x2e397f-0x0;var _0x24ef43=_0xdffe[_0x2e397f];return _0x24ef43;};'use strict';var multer=require('multer');var util=require(_0xedff('0x0'));var path=require('path');var timeout=require(_0xedff('0x1'));var express=require(_0xedff('0x2'));var router=express[_0xedff('0x3')]();var fs_extra=require(_0xedff('0x4'));var auth=require(_0xedff('0x5'));var interaction=require(_0xedff('0x6'));var config=require('../../config/environment');var controller=require(_0xedff('0x7'));router[_0xedff('0x8')]('/',auth[_0xedff('0x9')](),controller[_0xedff('0xa')]);router['get'](_0xedff('0xb'),auth[_0xedff('0x9')](),controller[_0xedff('0xc')]);router[_0xedff('0x8')](_0xedff('0xd'),auth[_0xedff('0x9')](),controller[_0xedff('0xe')]);router[_0xedff('0x8')](_0xedff('0xf'),auth[_0xedff('0x9')](),controller[_0xedff('0x10')]);router[_0xedff('0x8')](_0xedff('0x11'),auth[_0xedff('0x9')](),controller[_0xedff('0x12')]);router[_0xedff('0x13')]('/',auth[_0xedff('0x9')](),controller[_0xedff('0x14')]);router[_0xedff('0x13')]('/:id/users',auth[_0xedff('0x9')](),controller['addAgents']);router['post'](_0xedff('0x11'),auth['isAuthenticated'](),controller[_0xedff('0x15')]);router[_0xedff('0x16')]('/:id',auth[_0xedff('0x9')](),controller[_0xedff('0x17')]);router[_0xedff('0x18')](_0xedff('0xd'),auth[_0xedff('0x9')](),controller[_0xedff('0x19')]);router[_0xedff('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0xedff('0x1a')]);router[_0xedff('0x18')]('/:id/teams',auth[_0xedff('0x9')](),controller[_0xedff('0x1b')]);module[_0xedff('0x1c')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index b7577d1..03169eb 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 _0x3387=['getDataValue','sequelize','STRING','name','VIRTUAL','system-'];(function(_0x173a8d,_0x55963c){var _0x388290=function(_0x50a17f){while(--_0x50a17f){_0x173a8d['push'](_0x173a8d['shift']());}};_0x388290(++_0x55963c);}(_0x3387,0x97));var _0x7338=function(_0x4f602d,_0x54d3b9){_0x4f602d=_0x4f602d-0x0;var _0x4e0fa4=_0x3387[_0x4f602d];return _0x4e0fa4;};'use strict';var Sequelize=require(_0x7338('0x0'));module['exports']={'name':{'type':Sequelize[_0x7338('0x1')],'allowNull':![],'unique':_0x7338('0x2')},'prefix':{'type':Sequelize[_0x7338('0x3')],'get':function(_0x4a4a1d){return _0x7338('0x4')+this[_0x7338('0x5')]('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0x7338('0x1')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x8161=['INTEGER','sequelize','exports','STRING','name','VIRTUAL','system-'];(function(_0x1d9163,_0x79567d){var _0xb42197=function(_0x3818e8){while(--_0x3818e8){_0x1d9163['push'](_0x1d9163['shift']());}};_0xb42197(++_0x79567d);}(_0x8161,0x9b));var _0x1816=function(_0xaa344c,_0x5032e2){_0xaa344c=_0xaa344c-0x0;var _0x8a22c3=_0x8161[_0xaa344c];return _0x8a22c3;};'use strict';var Sequelize=require(_0x1816('0x0'));module[_0x1816('0x1')]={'name':{'type':Sequelize[_0x1816('0x2')],'allowNull':![],'unique':_0x1816('0x3')},'prefix':{'type':Sequelize[_0x1816('0x4')],'get':function(_0xd52ede){return _0x1816('0x5')+this['getDataValue'](_0x1816('0x3'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x1816('0x6')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index f72ac6a..7cca93a 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 _0xbaf0=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','VoicePrefixes','UserProfileResource','end','error','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','length','find','catch','describe','create','sequelize','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','VoiceExtension','VoicePrefixId','bulkCreate','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','${EXTEN:','charAt','body','prefix','system-','ids','omit','spread','userVoicePrefix:save','params','removeAgents','emit','userVoicePrefix:remove','getAgents','findOne','User','nolimit','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','transaction','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','QueryTypes','SELECT','TeamId','includes','compact','isEmpty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js'];(function(_0x756632,_0xc043cf){var _0x990247=function(_0x21a4b1){while(--_0x21a4b1){_0x756632['push'](_0x756632['shift']());}};_0x990247(++_0xc043cf);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0baf('0x0'));var zipdir=require(_0x0baf('0x1'));var jsonpatch=require(_0x0baf('0x2'));var rp=require(_0x0baf('0x3'));var moment=require(_0x0baf('0x4'));var BPromise=require(_0x0baf('0x5'));var Mustache=require('mustache');var util=require(_0x0baf('0x6'));var path=require(_0x0baf('0x7'));var sox=require(_0x0baf('0x8'));var csv=require(_0x0baf('0x9'));var ejs=require(_0x0baf('0xa'));var fs=require('fs');var fs_extra=require(_0x0baf('0xb'));var _=require(_0x0baf('0xc'));var squel=require(_0x0baf('0xd'));var crypto=require(_0x0baf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0baf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0baf('0x10'));var Papa=require(_0x0baf('0x11'));var Redis=require(_0x0baf('0x12'));var authService=require(_0x0baf('0x13'));var qs=require(_0x0baf('0x14'));var as=require(_0x0baf('0x15'));var hardwareService=require(_0x0baf('0x16'));var logger=require(_0x0baf('0x17'))(_0x0baf('0x18'));var utils=require(_0x0baf('0x19'));var config=require(_0x0baf('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x0baf('0x1b')]=_[_0x0baf('0x1c')](config[_0x0baf('0x1b')],{'host':_0x0baf('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0baf('0x1b')]));require('./voicePrefix.socket')[_0x0baf('0x1e')](socket);function respondWithStatusCode(_0x1f50c3,_0x7fbf67){_0x7fbf67=_0x7fbf67||0xcc;return function(_0x2bc381){if(_0x2bc381){return _0x1f50c3[_0x0baf('0x1f')](_0x7fbf67);}return _0x1f50c3[_0x0baf('0x20')](_0x7fbf67)['end']();};}function respondWithResult(_0x4cd79d,_0x2312c7){_0x2312c7=_0x2312c7||0xc8;return function(_0x38395b){if(_0x38395b){return _0x4cd79d[_0x0baf('0x20')](_0x2312c7)[_0x0baf('0x21')](_0x38395b);}};}function respondWithFilteredResult(_0x2cf7da,_0x288a98){return function(_0x53c338){if(_0x53c338){var _0x63c820=typeof _0x288a98[_0x0baf('0x22')]===_0x0baf('0x23')&&typeof _0x288a98[_0x0baf('0x24')]===_0x0baf('0x23');var _0x42b7f2=_0x53c338['count'];var _0x5cff5d=_0x63c820?0x0:_0x288a98[_0x0baf('0x22')];var _0x154f48=_0x63c820?_0x53c338[_0x0baf('0x25')]:_0x288a98[_0x0baf('0x22')]+_0x288a98[_0x0baf('0x24')];var _0x3e3e20;if(_0x154f48>=_0x42b7f2){_0x154f48=_0x42b7f2;_0x3e3e20=0xc8;}else{_0x3e3e20=0xce;}_0x2cf7da[_0x0baf('0x20')](_0x3e3e20);return _0x2cf7da[_0x0baf('0x26')](_0x0baf('0x27'),_0x5cff5d+'-'+_0x154f48+'/'+_0x42b7f2)[_0x0baf('0x21')](_0x53c338);}return null;};}function patchUpdates(_0x54f2fa){return function(_0x334bd6){try{jsonpatch['apply'](_0x334bd6,_0x54f2fa,!![]);}catch(_0xf6c158){return BPromise['reject'](_0xf6c158);}return _0x334bd6['save']();};}function saveUpdates(_0x2ef0aa,_0x48a0e9){return function(_0x4be1b9){if(_0x4be1b9){return _0x4be1b9[_0x0baf('0x28')](_0x2ef0aa)[_0x0baf('0x29')](function(_0x34e264){return _0x34e264;});}return null;};}function removeEntity(_0x19d9fd,_0x3a1ba1){return function(_0x56b299){if(_0x56b299){return _0x56b299[_0x0baf('0x2a')]()[_0x0baf('0x29')](function(){var _0x1ca35a=_0x56b299[_0x0baf('0x2b')]({'plain':!![]});var _0x3843b8=_0x0baf('0x2c');return db[_0x0baf('0x2d')]['destroy']({'where':{'type':_0x3843b8,'resourceId':_0x1ca35a['id']}})[_0x0baf('0x29')](function(){return _0x56b299;});})[_0x0baf('0x29')](function(){_0x19d9fd[_0x0baf('0x20')](0xcc)[_0x0baf('0x2e')]();});}};}function handleEntityNotFound(_0x55c715,_0x29dbdf){return function(_0x34a58a){if(!_0x34a58a){_0x55c715['sendStatus'](0x194);}return _0x34a58a;};}function handleError(_0x44ec31,_0x32e4fb){_0x32e4fb=_0x32e4fb||0x1f4;return function(_0x478ce8){logger[_0x0baf('0x2f')](_0x478ce8[_0x0baf('0x30')]);if(_0x478ce8[_0x0baf('0x31')]){delete _0x478ce8[_0x0baf('0x31')];}_0x44ec31['status'](_0x32e4fb)[_0x0baf('0x32')](_0x478ce8);};}exports[_0x0baf('0x33')]=function(_0x37be4e,_0x3ed995){var _0x24ecee={},_0x275ea1={},_0x2fc983={'count':0x0,'rows':[]};var _0x2f0a45=_[_0x0baf('0x34')](db[_0x0baf('0x35')][_0x0baf('0x36')],function(_0x165d14){return{'name':_0x165d14[_0x0baf('0x37')],'type':_0x165d14[_0x0baf('0x38')]['key']};});_0x275ea1[_0x0baf('0x39')]=_['map'](_0x2f0a45,_0x0baf('0x31'));_0x275ea1[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x37be4e[_0x0baf('0x3a')]);_0x275ea1['filters']=_[_0x0baf('0x3c')](_0x275ea1[_0x0baf('0x39')],_0x275ea1['query']);_0x24ecee[_0x0baf('0x3d')]=_[_0x0baf('0x3c')](_0x275ea1[_0x0baf('0x39')],qs[_0x0baf('0x3e')](_0x37be4e[_0x0baf('0x3a')][_0x0baf('0x3e')]));_0x24ecee[_0x0baf('0x3d')]=_0x24ecee[_0x0baf('0x3d')]['length']?_0x24ecee[_0x0baf('0x3d')]:_0x275ea1[_0x0baf('0x39')];if(!_0x37be4e['query'][_0x0baf('0x3f')]('nolimit')){_0x24ecee['limit']=qs[_0x0baf('0x24')](_0x37be4e[_0x0baf('0x3a')]['limit']);_0x24ecee['offset']=qs[_0x0baf('0x22')](_0x37be4e[_0x0baf('0x3a')][_0x0baf('0x22')]);}_0x24ecee[_0x0baf('0x40')]=qs[_0x0baf('0x41')](_0x37be4e[_0x0baf('0x3a')][_0x0baf('0x41')]);_0x24ecee[_0x0baf('0x42')]=qs[_0x0baf('0x43')](_[_0x0baf('0x44')](_0x37be4e[_0x0baf('0x3a')],_0x275ea1[_0x0baf('0x43')]),_0x2f0a45);if(_0x37be4e[_0x0baf('0x3a')][_0x0baf('0x45')]){_0x24ecee['where']=_[_0x0baf('0x46')](_0x24ecee[_0x0baf('0x42')],{'$or':_['map'](_0x2f0a45,function(_0x38006a){if(_0x38006a[_0x0baf('0x38')]!==_0x0baf('0x47')){var _0x299f93={};_0x299f93[_0x38006a[_0x0baf('0x31')]]={'$like':'%'+_0x37be4e[_0x0baf('0x3a')]['filter']+'%'};return _0x299f93;}})});}_0x24ecee=_[_0x0baf('0x46')]({},_0x24ecee,_0x37be4e[_0x0baf('0x48')]);var _0x540c41={'where':_0x24ecee[_0x0baf('0x42')]};return db[_0x0baf('0x35')][_0x0baf('0x25')](_0x540c41)[_0x0baf('0x29')](function(_0x504031){_0x2fc983[_0x0baf('0x25')]=_0x504031;if(_0x37be4e[_0x0baf('0x3a')][_0x0baf('0x49')]){_0x24ecee[_0x0baf('0x4a')]=[{'all':!![]}];}return db[_0x0baf('0x35')][_0x0baf('0x4b')](_0x24ecee);})[_0x0baf('0x29')](function(_0x1fa237){_0x2fc983[_0x0baf('0x4c')]=_0x1fa237;return _0x2fc983;})[_0x0baf('0x29')](respondWithFilteredResult(_0x3ed995,_0x24ecee))['catch'](handleError(_0x3ed995,null));};exports[_0x0baf('0x4d')]=function(_0x2bc755,_0x1daf1d){var _0x339aff={'raw':![],'where':{'id':_0x2bc755['params']['id']}},_0x22207a={};_0x22207a[_0x0baf('0x39')]=_[_0x0baf('0x3b')](db[_0x0baf('0x35')][_0x0baf('0x36')]);_0x22207a[_0x0baf('0x3a')]=_['keys'](_0x2bc755[_0x0baf('0x3a')]);_0x22207a[_0x0baf('0x43')]=_[_0x0baf('0x3c')](_0x22207a[_0x0baf('0x39')],_0x22207a[_0x0baf('0x3a')]);_0x339aff[_0x0baf('0x3d')]=_[_0x0baf('0x3c')](_0x22207a['model'],qs[_0x0baf('0x3e')](_0x2bc755[_0x0baf('0x3a')][_0x0baf('0x3e')]));_0x339aff['attributes']=_0x339aff[_0x0baf('0x3d')][_0x0baf('0x4e')]?_0x339aff[_0x0baf('0x3d')]:_0x22207a[_0x0baf('0x39')];if(_0x2bc755[_0x0baf('0x3a')][_0x0baf('0x49')]){_0x339aff[_0x0baf('0x4a')]=[{'all':!![]}];}_0x339aff=_['merge']({},_0x339aff,_0x2bc755[_0x0baf('0x48')]);return db[_0x0baf('0x35')][_0x0baf('0x4f')](_0x339aff)[_0x0baf('0x29')](handleEntityNotFound(_0x1daf1d,null))[_0x0baf('0x29')](respondWithResult(_0x1daf1d,null))[_0x0baf('0x50')](handleError(_0x1daf1d,null));};exports[_0x0baf('0x2a')]=function(_0x1af4aa,_0x2be7fe){return db[_0x0baf('0x35')][_0x0baf('0x4f')]({'where':{'id':_0x1af4aa['params']['id']}})['then'](handleEntityNotFound(_0x2be7fe,null))[_0x0baf('0x29')](removeEntity(_0x2be7fe,null))[_0x0baf('0x50')](handleError(_0x2be7fe,null));};exports[_0x0baf('0x51')]=function(_0xb8fa28,_0x21b108){return db[_0x0baf('0x35')][_0x0baf('0x51')]()['then'](respondWithResult(_0x21b108,null))[_0x0baf('0x50')](handleError(_0x21b108,null));};exports[_0x0baf('0x52')]=function(_0xf2424,_0x16d9fb){var _0x3fdb41;return db[_0x0baf('0x53')]['transaction'](function(_0x3eebe5){return db['VoicePrefix'][_0x0baf('0x52')](_0xf2424['body'],{'transaction':_0x3eebe5})[_0x0baf('0x29')](function(_0x5eaeb2){_0x3fdb41=_0x5eaeb2[_0x0baf('0x2b')]({'plain':!![]});return db['VoiceExtension'][_0x0baf('0x4f')]({'where':{'id':_0x3fdb41[_0x0baf('0x54')]},'raw':!![]})[_0x0baf('0x29')](function(_0x4520d1){return createVoicePrefixExtensions(_0x3fdb41,_0x4520d1,_0x3eebe5);});});})[_0x0baf('0x29')](function(){var _0x576475=_0xf2424[_0x0baf('0x55')][_0x0baf('0x2b')]({'plain':!![]});if(!_0x576475)throw new Error(_0x0baf('0x56'));if(_0x576475[_0x0baf('0x57')]===_0x0baf('0x55')){var _0xa19b21=_0x3fdb41;return db['UserProfileSection'][_0x0baf('0x4f')]({'where':{'name':_0x0baf('0x2c'),'userProfileId':_0x576475[_0x0baf('0x58')]},'raw':!![]})[_0x0baf('0x29')](function(_0xbc7cc2){if(_0xbc7cc2&&_0xbc7cc2[_0x0baf('0x59')]===0x0){return db[_0x0baf('0x2d')]['create']({'name':_0xa19b21['name'],'resourceId':_0xa19b21['id'],'type':_0xbc7cc2[_0x0baf('0x31')],'sectionId':_0xbc7cc2['id']},{})[_0x0baf('0x29')](function(){return _0x3fdb41;});}else{return _0x3fdb41;}})[_0x0baf('0x50')](function(_0x337d94){logger[_0x0baf('0x2f')](_0x0baf('0x5a'),_0x337d94);throw _0x337d94;});}return _0x3fdb41;})[_0x0baf('0x29')](respondWithResult(_0x16d9fb,null))[_0x0baf('0x50')](handleError(_0x16d9fb,null));};function Extension(_0x3d9a32,_0x585969,_0x3238f9,_0x268be8){this[_0x0baf('0x5b')]=_0x0baf('0x5c');this[_0x0baf('0x5d')]=_0x3d9a32;this[_0x0baf('0x5e')]=_0x3238f9;this[_0x0baf('0x38')]='system';this[_0x0baf('0x5f')]=_0x0baf('0x60');this[_0x0baf('0x61')]=_0x585969;this[_0x0baf('0x62')]=_0x268be8;}function createVoicePrefixExtensions(_0x1c7d88,_0x1a6d22,_0x14e6d0){return new BPromise(function(_0x12543e,_0x498405){var _0x178495=new Extension(formatPrefixName(_0x1c7d88['prefix']),0x1,_0x0baf('0x63'),'Voice\x20Prefix');_0x178495['VoicePrefixId']=_0x1c7d88['id'];return db[_0x0baf('0x64')]['create'](_0x178495,{'transaction':_0x14e6d0})[_0x0baf('0x29')](function(_0x2b17f8){var _0x49d713=_0x2b17f8[_0x0baf('0x2b')]({'plain':!![]});var _0xfb6708=_[_0x0baf('0x34')](addVoicePrefixExtensions(_0x1c7d88,_0x1a6d22),function(_0x5b3c1d){_0x5b3c1d['VoiceExtensionId']=_0x49d713['id'];_0x5b3c1d[_0x0baf('0x65')]=_0x1c7d88['id'];return _0x5b3c1d;});return db[_0x0baf('0x64')][_0x0baf('0x66')](_0xfb6708,{'transaction':_0x14e6d0})[_0x0baf('0x29')](function(_0x784e1a){if(!_0x784e1a){return _0x498405('Extensions\x20creation\x20failed');}else{return _0x12543e(_0x784e1a);}})[_0x0baf('0x50')](function(_0x4c02ca){return _0x498405(_0x4c02ca);});});;});};function addVoicePrefixExtensions(_0x5d5751,_0x59a0b2){var _0x427ed1=[];var _0x58a366=formatPrefixName(_0x5d5751['prefix']);_0x427ed1[_0x0baf('0x67')](new Extension(_0x58a366,0x2,_0x0baf('0x68'),_0x0baf('0x69')+_0x5d5751[_0x0baf('0x31')]));if(_0x5d5751[_0x0baf('0x6a')]){_0x427ed1[_0x0baf('0x67')](new Extension(_0x58a366,0x3,'Set',_0x0baf('0x6b')+_0x5d5751[_0x0baf('0x6a')]));}else{_0x427ed1[_0x0baf('0x67')](new Extension(_0x58a366,0x3,_0x0baf('0x63'),_0x0baf('0x6c')));}_0x427ed1[_0x0baf('0x67')](new Extension(_0x58a366,0x4,'goto',_0x59a0b2[_0x0baf('0x5b')]+','+_0x0baf('0x6d')+(0x8+_0x5d5751[_0x0baf('0x31')]['length'])+'}'+','+0x1));return _0x427ed1;}function formatPrefixName(_0x89484d){var _0x1e474f='_';for(var _0x3d333d=0x0;_0x3d333d<_0x89484d[_0x0baf('0x4e')];_0x3d333d++){if(_0x89484d[_0x0baf('0x6e')](_0x3d333d)=='-'){_0x1e474f+=_0x89484d[_0x0baf('0x6e')](_0x3d333d);}else{_0x1e474f+='['+_0x89484d[_0x0baf('0x6e')](_0x3d333d)+']';}}_0x1e474f+='.';return _0x1e474f;}exports['update']=function(_0x54353a,_0x4b7caa,_0x6ce83c){var _0x89bec7=_0x54353a[_0x0baf('0x6f')];_0x89bec7[_0x0baf('0x70')]=_0x0baf('0x71')+_0x89bec7[_0x0baf('0x31')]+'-';return db['sequelize']['transaction'](function(_0x34c1f4){return db['VoicePrefix'][_0x0baf('0x28')](_0x89bec7,{'where':{'id':_0x89bec7['id']},'transaction':_0x34c1f4})[_0x0baf('0x29')](function(){return db['VoiceExtension'][_0x0baf('0x2a')]({'where':{'VoicePrefixId':_0x89bec7['id']},'transaction':_0x34c1f4})[_0x0baf('0x29')](function(){return db[_0x0baf('0x64')][_0x0baf('0x4f')]({'where':{'id':_0x89bec7[_0x0baf('0x54')]},'raw':!![]})[_0x0baf('0x29')](function(_0x1b6b73){return createVoicePrefixExtensions(_0x89bec7,_0x1b6b73,_0x34c1f4);});});});})[_0x0baf('0x29')](function(){return db[_0x0baf('0x35')]['findById'](_0x89bec7['id']);})['then'](respondWithResult(_0x4b7caa,null))['catch'](handleError(_0x4b7caa,null));};exports['addAgents']=function(_0x5361a5,_0x418c45,_0x18963f){return db[_0x0baf('0x35')][_0x0baf('0x4f')]({'where':{'id':_0x5361a5['params']['id']}})[_0x0baf('0x29')](handleEntityNotFound(_0x418c45,null))[_0x0baf('0x29')](function(_0x58caee){if(_0x58caee){return _0x58caee['addAgents'](_0x5361a5[_0x0baf('0x6f')][_0x0baf('0x72')],_[_0x0baf('0x73')](_0x5361a5[_0x0baf('0x6f')],[_0x0baf('0x72'),'id'])||{})[_0x0baf('0x74')](function(_0x3ce111){for(var _0x399f40=0x0;_0x399f40<_0x5361a5['body'][_0x0baf('0x72')][_0x0baf('0x4e')];_0x399f40+=0x1){socket['emit'](_0x0baf('0x75'),{'UserId':Number(_0x5361a5[_0x0baf('0x6f')]['ids'][_0x399f40]),'VoicePrefixId':Number(_0x5361a5[_0x0baf('0x76')]['id'])});}return _0x3ce111;});}})[_0x0baf('0x29')](respondWithResult(_0x418c45,null))[_0x0baf('0x50')](handleError(_0x418c45,null));};exports[_0x0baf('0x77')]=function(_0x167977,_0x4fc5af,_0x4807fc){return db[_0x0baf('0x35')][_0x0baf('0x4f')]({'where':{'id':_0x167977['params']['id']}})[_0x0baf('0x29')](handleEntityNotFound(_0x4fc5af,null))[_0x0baf('0x29')](function(_0x21ad25){if(_0x21ad25){return _0x21ad25['removeAgents'](_0x167977[_0x0baf('0x3a')][_0x0baf('0x72')])[_0x0baf('0x29')](function(){if(_['isArray'](_0x167977[_0x0baf('0x3a')]['ids'])){for(var _0x316397=0x0;_0x316397<_0x167977[_0x0baf('0x3a')][_0x0baf('0x72')][_0x0baf('0x4e')];_0x316397+=0x1){socket[_0x0baf('0x78')]('userVoicePrefix:remove',{'UserId':Number(_0x167977[_0x0baf('0x3a')][_0x0baf('0x72')][_0x316397]),'VoicePrefixId':Number(_0x167977['params']['id'])});}}else{socket[_0x0baf('0x78')](_0x0baf('0x79'),{'UserId':Number(_0x167977[_0x0baf('0x3a')][_0x0baf('0x72')]),'VoicePrefixId':Number(_0x167977[_0x0baf('0x76')]['id'])});}});}})[_0x0baf('0x29')](respondWithStatusCode(_0x4fc5af,null))[_0x0baf('0x50')](handleError(_0x4fc5af,null));};exports[_0x0baf('0x7a')]=function(_0x44ef57,_0x1ca3a6,_0x3b7abf){var _0x2c2f09={};var _0x5985f9={};var _0x599ac0;var _0x29a036;return db[_0x0baf('0x35')][_0x0baf('0x7b')]({'where':{'id':_0x44ef57['params']['id']}})['then'](handleEntityNotFound(_0x1ca3a6,null))[_0x0baf('0x29')](function(_0x368e23){if(_0x368e23){_0x599ac0=_0x368e23;_0x5985f9[_0x0baf('0x39')]=_[_0x0baf('0x3b')](db[_0x0baf('0x7c')][_0x0baf('0x36')]);_0x5985f9[_0x0baf('0x3a')]=_[_0x0baf('0x3b')](_0x44ef57[_0x0baf('0x3a')]);_0x5985f9['filters']=_[_0x0baf('0x3c')](_0x5985f9[_0x0baf('0x39')],_0x5985f9[_0x0baf('0x3a')]);_0x2c2f09[_0x0baf('0x3d')]=_['intersection'](_0x5985f9['model'],qs['fields'](_0x44ef57[_0x0baf('0x3a')][_0x0baf('0x3e')]));_0x2c2f09['attributes']=_0x2c2f09['attributes'][_0x0baf('0x4e')]?_0x2c2f09[_0x0baf('0x3d')]:_0x5985f9['model'];_0x2c2f09[_0x0baf('0x40')]=qs[_0x0baf('0x41')](_0x44ef57[_0x0baf('0x3a')][_0x0baf('0x41')]);_0x2c2f09[_0x0baf('0x42')]=qs[_0x0baf('0x43')](_[_0x0baf('0x44')](_0x44ef57[_0x0baf('0x3a')],_0x5985f9[_0x0baf('0x43')]));if(_0x44ef57[_0x0baf('0x3a')][_0x0baf('0x45')]){_0x2c2f09[_0x0baf('0x42')]=_['merge'](_0x2c2f09[_0x0baf('0x42')],{'$or':_[_0x0baf('0x34')](_0x2c2f09[_0x0baf('0x3d')],function(_0x3bd15b){var _0x3c37b4={};_0x3c37b4[_0x3bd15b]={'$like':'%'+_0x44ef57[_0x0baf('0x3a')]['filter']+'%'};return _0x3c37b4;})});}_0x2c2f09=_[_0x0baf('0x46')]({},_0x2c2f09,_0x44ef57[_0x0baf('0x48')]);return _0x599ac0[_0x0baf('0x7a')](_0x2c2f09);}})[_0x0baf('0x29')](function(_0x4376a1){if(_0x4376a1){_0x29a036=_0x4376a1['length'];if(!_0x44ef57[_0x0baf('0x3a')][_0x0baf('0x3f')](_0x0baf('0x7d'))){_0x2c2f09[_0x0baf('0x24')]=qs[_0x0baf('0x24')](_0x44ef57['query']['limit']);_0x2c2f09[_0x0baf('0x22')]=qs['offset'](_0x44ef57[_0x0baf('0x3a')]['offset']);}return _0x599ac0[_0x0baf('0x7a')](_0x2c2f09);}})[_0x0baf('0x29')](function(_0x1ce7bb){if(_0x1ce7bb){return _0x1ce7bb?{'count':_0x29a036,'rows':_0x1ce7bb}:null;}})[_0x0baf('0x29')](respondWithResult(_0x1ca3a6,null))['catch'](handleError(_0x1ca3a6,null));};exports[_0x0baf('0x7e')]=function(_0x106ffa,_0xf7a9d0,_0x551df3){var _0x487aec={};var _0x591cc2={};var _0x4d4884;var _0x427638;return db[_0x0baf('0x35')][_0x0baf('0x7b')]({'where':{'id':_0x106ffa[_0x0baf('0x76')]['id']}})['then'](handleEntityNotFound(_0xf7a9d0,null))[_0x0baf('0x29')](function(_0x37594e){if(_0x37594e){_0x4d4884=_0x37594e;_0x591cc2[_0x0baf('0x39')]=_['keys'](db[_0x0baf('0x7f')][_0x0baf('0x36')]);_0x591cc2['query']=_[_0x0baf('0x3b')](_0x106ffa['query']);_0x591cc2[_0x0baf('0x43')]=_[_0x0baf('0x3c')](_0x591cc2[_0x0baf('0x39')],_0x591cc2[_0x0baf('0x3a')]);_0x487aec['attributes']=_['intersection'](_0x591cc2[_0x0baf('0x39')],qs['fields'](_0x106ffa[_0x0baf('0x3a')][_0x0baf('0x3e')]));_0x487aec[_0x0baf('0x3d')]=_0x487aec[_0x0baf('0x3d')][_0x0baf('0x4e')]?_0x487aec['attributes']:_0x591cc2[_0x0baf('0x39')];_0x487aec['order']=qs[_0x0baf('0x41')](_0x106ffa['query'][_0x0baf('0x41')]);_0x487aec['where']=qs[_0x0baf('0x43')](_[_0x0baf('0x44')](_0x106ffa[_0x0baf('0x3a')],_0x591cc2['filters']));if(_0x106ffa['query'][_0x0baf('0x45')]){_0x487aec[_0x0baf('0x42')]=_[_0x0baf('0x46')](_0x487aec[_0x0baf('0x42')],{'$or':_[_0x0baf('0x34')](_0x487aec[_0x0baf('0x3d')],function(_0x4e6059){var _0xd4170d={};_0xd4170d[_0x4e6059]={'$like':'%'+_0x106ffa['query'][_0x0baf('0x45')]+'%'};return _0xd4170d;})});}_0x487aec=_['merge']({},_0x487aec,_0x106ffa[_0x0baf('0x48')]);return _0x4d4884[_0x0baf('0x7e')](_0x487aec);}})[_0x0baf('0x29')](function(_0x557a38){if(_0x557a38){_0x427638=_0x557a38[_0x0baf('0x4e')];if(!_0x106ffa[_0x0baf('0x3a')]['hasOwnProperty']('nolimit')){_0x487aec[_0x0baf('0x24')]=qs[_0x0baf('0x24')](_0x106ffa[_0x0baf('0x3a')][_0x0baf('0x24')]);_0x487aec['offset']=qs['offset'](_0x106ffa[_0x0baf('0x3a')][_0x0baf('0x22')]);}return _0x4d4884[_0x0baf('0x7e')](_0x487aec);}})[_0x0baf('0x29')](function(_0xfc91ce){if(_0xfc91ce){return _0xfc91ce?{'count':_0x427638,'rows':_0xfc91ce}:null;}})[_0x0baf('0x29')](respondWithResult(_0xf7a9d0,null))[_0x0baf('0x50')](handleError(_0xf7a9d0,null));};exports[_0x0baf('0x80')]=function(_0x205de6,_0x2369f0,_0x58f95c){var _0xdb96c0=_0x205de6['body'][_0x0baf('0x72')];var _0x42abcf;return db[_0x0baf('0x7f')][_0x0baf('0x4b')]({'where':{'id':_0xdb96c0},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0baf('0x81'),'attributes':['id',_0x0baf('0x31'),_0x0baf('0x82'),_0x0baf('0x83'),_0x0baf('0x84')],'raw':!![]}]})[_0x0baf('0x29')](function(_0x3b9101){if(_0x3b9101){_0x42abcf=_0x3b9101;var _0x205075=_[_0x0baf('0x85')](_0x3b9101,function(_0x4b6cd5){var _0x8d1bae=_0x4b6cd5[_0x0baf('0x2b')]({'plain':!![]});return _0x8d1bae['Agents'];});return db[_0x0baf('0x35')][_0x0baf('0x4f')]({'where':{'id':_0x205de6[_0x0baf('0x76')]['id']}})[_0x0baf('0x29')](function(_0x97f5d6){return db[_0x0baf('0x53')][_0x0baf('0x86')](function(_0x8c1dc2){return _0x97f5d6[_0x0baf('0x80')](_0xdb96c0,{'transaction':_0x8c1dc2})['then'](function(){return BPromise[_0x0baf('0x87')](_0x42abcf,function(_0x218fc5){return db[_0x0baf('0x88')][_0x0baf('0x89')]({'TeamId':_0x218fc5['id'],'VoicePrefixId':_0x205de6[_0x0baf('0x76')]['id']},{'transaction':_0x8c1dc2});});})[_0x0baf('0x29')](function(){return BPromise['each'](_0x205075,function(_0x121718){return db[_0x0baf('0x8a')][_0x0baf('0x8b')]({'where':{'UserId':_0x121718['id'],'VoicePrefixId':_0x205de6['params']['id']},'transaction':_0x8c1dc2});});})['then'](function(){_0x205075[_0x0baf('0x8c')](function(_0x1adb84){socket[_0x0baf('0x78')]('userVoicePrefix:save',{'UserId':_0x1adb84['id'],'VoicePrefixId':_0x97f5d6['id']});});});});});}})[_0x0baf('0x29')](respondWithStatusCode(_0x2369f0,null))['catch'](handleError(_0x2369f0,null));};exports[_0x0baf('0x8d')]=function(_0x5f09be,_0x41b216,_0x3f2838){return db['Team'][_0x0baf('0x4b')]({'where':{'id':_0x5f09be[_0x0baf('0x3a')][_0x0baf('0x72')]},'attributes':['id'],'include':[{'model':db[_0x0baf('0x7c')],'as':_0x0baf('0x81'),'attributes':['id'],'raw':!![]}]})[_0x0baf('0x29')](handleEntityNotFound(_0x41b216,null))[_0x0baf('0x29')](function(_0x5508db){var _0x727cad=_[_0x0baf('0x34')](_0x5508db,'id');var _0x2766fb=[];var _0x2e1629=[];var _0x275cc4=squel[_0x0baf('0x8e')]();_0x275cc4[_0x0baf('0x8f')](_0x0baf('0x90'))[_0x0baf('0x91')](_0x0baf('0x92'),'tq')[_0x0baf('0x93')](_0x0baf('0x94'),'ut',_0x0baf('0x95'))[_0x0baf('0x42')]('VoicePrefixId\x20=\x20?',_0x5f09be['params']['id']);for(var _0x1cd215=0x0;_0x1cd215<_0x5508db[_0x0baf('0x4e')];_0x1cd215+=0x1){let _0x3b9429=_0x5508db[_0x1cd215];for(var _0x41d397=0x0;_0x41d397<_0x3b9429['Agents'][_0x0baf('0x4e')];_0x41d397+=0x1){let _0xc6c049=_0x3b9429[_0x0baf('0x81')][_0x41d397];var _0x2fb267=_0x275cc4[_0x0baf('0x96')]();_0x2fb267[_0x0baf('0x42')]('ut.UserId\x20=\x20?',_0xc6c049['id']);_0x2e1629[_0x0baf('0x67')](db[_0x0baf('0x53')][_0x0baf('0x3a')](_0x2fb267['toString'](),{'type':db[_0x0baf('0x53')][_0x0baf('0x97')][_0x0baf('0x98')]})['then'](function(_0x4f7145){if(_0x4f7145['length']===0x1){return _0xc6c049['id'];}else{var _0x11a85a=_['every'](_[_0x0baf('0x34')](_0x4f7145,_0x0baf('0x99')),function(_0x55124b){return _[_0x0baf('0x9a')](_0x727cad,_0x55124b);});if(_0x11a85a){return _0xc6c049['id'];}}}));}}return BPromise['all'](_0x2e1629)['then'](function(_0x21516f){_0x2766fb=_(_0x2766fb)['union'](_0x21516f)[_0x0baf('0x9b')]()['value']();return db['VoicePrefix']['find']({'where':{'id':_0x5f09be[_0x0baf('0x76')]['id']}})[_0x0baf('0x29')](function(_0x3d1f80){return db[_0x0baf('0x53')][_0x0baf('0x86')](function(_0x4f9904){return _0x3d1f80[_0x0baf('0x8d')](_0x5f09be['query'][_0x0baf('0x72')],{'transaction':_0x4f9904})[_0x0baf('0x29')](function(){if(!_[_0x0baf('0x9c')](_0x2766fb)){return _0x3d1f80['removeAgents'](_0x2766fb,{'transaction':_0x4f9904});}})[_0x0baf('0x29')](function(){_0x2766fb[_0x0baf('0x8c')](function(_0x12311d){socket['emit'](_0x0baf('0x79'),{'UserId':_0x12311d,'VoicePrefixId':_0x3d1f80['id']});});});});});});})['then'](respondWithStatusCode(_0x41b216,null))[_0x0baf('0x50')](handleError(_0x41b216,null));}; \ No newline at end of file +var _0x3266=['index','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','describe','create','transaction','body','get','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','context','${EXTEN:','charAt','findById','addAgents','emit','userVoicePrefix:save','ids','removeAgents','isArray','userVoicePrefix:remove','findOne','User','order','getAgents','getTeams','Team','interface','Agents','addTeams','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','removeTeams','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','VoicePrefixes','UserProfileResource','destroy','error','name'];(function(_0x5161fc,_0x37c5f6){var _0x38490b=function(_0x49ebd8){while(--_0x49ebd8){_0x5161fc['push'](_0x5161fc['shift']());}};_0x38490b(++_0x37c5f6);}(_0x3266,0x6a));var _0x6326=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x3266[_0x4a747d];return _0x3a5b5c;};'use strict';var emlformat=require(_0x6326('0x0'));var rimraf=require(_0x6326('0x1'));var zipdir=require(_0x6326('0x2'));var jsonpatch=require(_0x6326('0x3'));var rp=require(_0x6326('0x4'));var moment=require(_0x6326('0x5'));var BPromise=require(_0x6326('0x6'));var Mustache=require(_0x6326('0x7'));var util=require(_0x6326('0x8'));var path=require('path');var sox=require(_0x6326('0x9'));var csv=require('to-csv');var ejs=require(_0x6326('0xa'));var fs=require('fs');var fs_extra=require(_0x6326('0xb'));var _=require(_0x6326('0xc'));var squel=require('squel');var crypto=require(_0x6326('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6326('0xe'));var toCsv=require(_0x6326('0xf'));var querystring=require(_0x6326('0x10'));var Papa=require(_0x6326('0x11'));var Redis=require(_0x6326('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x6326('0x13'));var as=require(_0x6326('0x14'));var hardwareService=require(_0x6326('0x15'));var logger=require(_0x6326('0x16'))(_0x6326('0x17'));var utils=require(_0x6326('0x18'));var config=require(_0x6326('0x19'));var licenseUtil=require(_0x6326('0x1a'));var db=require(_0x6326('0x1b'))['db'];config[_0x6326('0x1c')]=_['defaults'](config['redis'],{'host':_0x6326('0x1d'),'port':0x18eb});var socket=require(_0x6326('0x1e'))(new Redis(config['redis']));require(_0x6326('0x1f'))['register'](socket);function respondWithStatusCode(_0x2d2d9b,_0x20dcc6){_0x20dcc6=_0x20dcc6||0xcc;return function(_0x3d6ac0){if(_0x3d6ac0){return _0x2d2d9b[_0x6326('0x20')](_0x20dcc6);}return _0x2d2d9b[_0x6326('0x21')](_0x20dcc6)[_0x6326('0x22')]();};}function respondWithResult(_0x55923a,_0x1104c5){_0x1104c5=_0x1104c5||0xc8;return function(_0x518e6f){if(_0x518e6f){return _0x55923a['status'](_0x1104c5)['json'](_0x518e6f);}};}function respondWithFilteredResult(_0x51e7b9,_0x5d402d){return function(_0x58e960){if(_0x58e960){var _0xdf5ced=typeof _0x5d402d[_0x6326('0x23')]===_0x6326('0x24')&&typeof _0x5d402d['limit']==='undefined';var _0x954ed5=_0x58e960[_0x6326('0x25')];var _0x272b5c=_0xdf5ced?0x0:_0x5d402d[_0x6326('0x23')];var _0x3c08db=_0xdf5ced?_0x58e960[_0x6326('0x25')]:_0x5d402d[_0x6326('0x23')]+_0x5d402d['limit'];var _0x22307f;if(_0x3c08db>=_0x954ed5){_0x3c08db=_0x954ed5;_0x22307f=0xc8;}else{_0x22307f=0xce;}_0x51e7b9['status'](_0x22307f);return _0x51e7b9[_0x6326('0x26')](_0x6326('0x27'),_0x272b5c+'-'+_0x3c08db+'/'+_0x954ed5)[_0x6326('0x28')](_0x58e960);}return null;};}function patchUpdates(_0x24fb78){return function(_0x43cdfc){try{jsonpatch[_0x6326('0x29')](_0x43cdfc,_0x24fb78,!![]);}catch(_0x225555){return BPromise[_0x6326('0x2a')](_0x225555);}return _0x43cdfc[_0x6326('0x2b')]();};}function saveUpdates(_0x2d0d00,_0x34954b){return function(_0x4933e1){if(_0x4933e1){return _0x4933e1[_0x6326('0x2c')](_0x2d0d00)[_0x6326('0x2d')](function(_0x575701){return _0x575701;});}return null;};}function removeEntity(_0x4e272b,_0x4d28fd){return function(_0x405474){if(_0x405474){return _0x405474['destroy']()[_0x6326('0x2d')](function(){var _0x1a48da=_0x405474['get']({'plain':!![]});var _0x15e33d=_0x6326('0x2e');return db[_0x6326('0x2f')][_0x6326('0x30')]({'where':{'type':_0x15e33d,'resourceId':_0x1a48da['id']}})[_0x6326('0x2d')](function(){return _0x405474;});})[_0x6326('0x2d')](function(){_0x4e272b[_0x6326('0x21')](0xcc)[_0x6326('0x22')]();});}};}function handleEntityNotFound(_0x461e0f,_0x127744){return function(_0x4980f6){if(!_0x4980f6){_0x461e0f[_0x6326('0x20')](0x194);}return _0x4980f6;};}function handleError(_0x331772,_0x134524){_0x134524=_0x134524||0x1f4;return function(_0x2e0445){logger[_0x6326('0x31')](_0x2e0445['stack']);if(_0x2e0445[_0x6326('0x32')]){delete _0x2e0445[_0x6326('0x32')];}_0x331772[_0x6326('0x21')](_0x134524)['send'](_0x2e0445);};}exports[_0x6326('0x33')]=function(_0x4d7807,_0x4e703a){var _0xfb6b62={},_0x7ac8d9={},_0x160a12={'count':0x0,'rows':[]};var _0x103b1c=_[_0x6326('0x34')](db[_0x6326('0x35')][_0x6326('0x36')],function(_0x46c803){return{'name':_0x46c803[_0x6326('0x37')],'type':_0x46c803[_0x6326('0x38')][_0x6326('0x39')]};});_0x7ac8d9[_0x6326('0x3a')]=_['map'](_0x103b1c,_0x6326('0x32'));_0x7ac8d9[_0x6326('0x3b')]=_['keys'](_0x4d7807[_0x6326('0x3b')]);_0x7ac8d9[_0x6326('0x3c')]=_[_0x6326('0x3d')](_0x7ac8d9['model'],_0x7ac8d9[_0x6326('0x3b')]);_0xfb6b62['attributes']=_['intersection'](_0x7ac8d9[_0x6326('0x3a')],qs[_0x6326('0x3e')](_0x4d7807[_0x6326('0x3b')]['fields']));_0xfb6b62[_0x6326('0x3f')]=_0xfb6b62['attributes'][_0x6326('0x40')]?_0xfb6b62['attributes']:_0x7ac8d9[_0x6326('0x3a')];if(!_0x4d7807[_0x6326('0x3b')][_0x6326('0x41')](_0x6326('0x42'))){_0xfb6b62[_0x6326('0x43')]=qs[_0x6326('0x43')](_0x4d7807['query'][_0x6326('0x43')]);_0xfb6b62[_0x6326('0x23')]=qs['offset'](_0x4d7807[_0x6326('0x3b')]['offset']);}_0xfb6b62['order']=qs[_0x6326('0x44')](_0x4d7807[_0x6326('0x3b')][_0x6326('0x44')]);_0xfb6b62[_0x6326('0x45')]=qs[_0x6326('0x3c')](_[_0x6326('0x46')](_0x4d7807['query'],_0x7ac8d9['filters']),_0x103b1c);if(_0x4d7807[_0x6326('0x3b')]['filter']){_0xfb6b62[_0x6326('0x45')]=_['merge'](_0xfb6b62[_0x6326('0x45')],{'$or':_[_0x6326('0x34')](_0x103b1c,function(_0x335feb){if(_0x335feb[_0x6326('0x38')]!==_0x6326('0x47')){var _0x1b754d={};_0x1b754d[_0x335feb[_0x6326('0x32')]]={'$like':'%'+_0x4d7807[_0x6326('0x3b')][_0x6326('0x48')]+'%'};return _0x1b754d;}})});}_0xfb6b62=_[_0x6326('0x49')]({},_0xfb6b62,_0x4d7807[_0x6326('0x4a')]);var _0x5d36b1={'where':_0xfb6b62[_0x6326('0x45')]};return db['VoicePrefix'][_0x6326('0x25')](_0x5d36b1)[_0x6326('0x2d')](function(_0x16fc33){_0x160a12[_0x6326('0x25')]=_0x16fc33;if(_0x4d7807['query'][_0x6326('0x4b')]){_0xfb6b62[_0x6326('0x4c')]=[{'all':!![]}];}return db['VoicePrefix'][_0x6326('0x4d')](_0xfb6b62);})[_0x6326('0x2d')](function(_0x7a5057){_0x160a12[_0x6326('0x4e')]=_0x7a5057;return _0x160a12;})['then'](respondWithFilteredResult(_0x4e703a,_0xfb6b62))[_0x6326('0x4f')](handleError(_0x4e703a,null));};exports[_0x6326('0x50')]=function(_0x231e15,_0x28504f){var _0x44d852={'raw':![],'where':{'id':_0x231e15[_0x6326('0x51')]['id']}},_0x165953={};_0x165953['model']=_[_0x6326('0x52')](db[_0x6326('0x35')][_0x6326('0x36')]);_0x165953[_0x6326('0x3b')]=_['keys'](_0x231e15[_0x6326('0x3b')]);_0x165953['filters']=_[_0x6326('0x3d')](_0x165953[_0x6326('0x3a')],_0x165953[_0x6326('0x3b')]);_0x44d852[_0x6326('0x3f')]=_[_0x6326('0x3d')](_0x165953['model'],qs[_0x6326('0x3e')](_0x231e15['query']['fields']));_0x44d852[_0x6326('0x3f')]=_0x44d852[_0x6326('0x3f')]['length']?_0x44d852[_0x6326('0x3f')]:_0x165953[_0x6326('0x3a')];if(_0x231e15[_0x6326('0x3b')][_0x6326('0x4b')]){_0x44d852[_0x6326('0x4c')]=[{'all':!![]}];}_0x44d852=_['merge']({},_0x44d852,_0x231e15['options']);return db[_0x6326('0x35')][_0x6326('0x53')](_0x44d852)[_0x6326('0x2d')](handleEntityNotFound(_0x28504f,null))[_0x6326('0x2d')](respondWithResult(_0x28504f,null))[_0x6326('0x4f')](handleError(_0x28504f,null));};exports[_0x6326('0x30')]=function(_0xdc4522,_0x55bcd6){return db[_0x6326('0x35')][_0x6326('0x53')]({'where':{'id':_0xdc4522[_0x6326('0x51')]['id']}})[_0x6326('0x2d')](handleEntityNotFound(_0x55bcd6,null))[_0x6326('0x2d')](removeEntity(_0x55bcd6,null))['catch'](handleError(_0x55bcd6,null));};exports[_0x6326('0x54')]=function(_0x55537a,_0x216972){return db[_0x6326('0x35')]['describe']()[_0x6326('0x2d')](respondWithResult(_0x216972,null))['catch'](handleError(_0x216972,null));};exports[_0x6326('0x55')]=function(_0x202fd3,_0x2ee8df){var _0x35400e;return db['sequelize'][_0x6326('0x56')](function(_0xbe6b3e){return db['VoicePrefix'][_0x6326('0x55')](_0x202fd3[_0x6326('0x57')],{'transaction':_0xbe6b3e})[_0x6326('0x2d')](function(_0x4a42ae){_0x35400e=_0x4a42ae[_0x6326('0x58')]({'plain':!![]});return db[_0x6326('0x59')]['find']({'where':{'id':_0x35400e[_0x6326('0x5a')]},'raw':!![]})['then'](function(_0x1f1463){return createVoicePrefixExtensions(_0x35400e,_0x1f1463,_0xbe6b3e);});});})[_0x6326('0x2d')](function(){var _0x3e9825=_0x202fd3[_0x6326('0x5b')][_0x6326('0x58')]({'plain':!![]});if(!_0x3e9825)throw new Error(_0x6326('0x5c'));if(_0x3e9825[_0x6326('0x5d')]==='user'){var _0x51adce=_0x35400e;return db['UserProfileSection'][_0x6326('0x53')]({'where':{'name':'VoicePrefixes','userProfileId':_0x3e9825[_0x6326('0x5e')]},'raw':!![]})[_0x6326('0x2d')](function(_0xcae454){if(_0xcae454&&_0xcae454[_0x6326('0x5f')]===0x0){return db[_0x6326('0x2f')]['create']({'name':_0x51adce[_0x6326('0x32')],'resourceId':_0x51adce['id'],'type':_0xcae454[_0x6326('0x32')],'sectionId':_0xcae454['id']},{})['then'](function(){return _0x35400e;});}else{return _0x35400e;}})[_0x6326('0x4f')](function(_0xdeba28){logger[_0x6326('0x31')](_0x6326('0x60'),_0xdeba28);throw _0xdeba28;});}return _0x35400e;})[_0x6326('0x2d')](respondWithResult(_0x2ee8df,null))[_0x6326('0x4f')](handleError(_0x2ee8df,null));};function Extension(_0x320d43,_0x2f624f,_0x2c7a8d,_0x37506f){this['context']=_0x6326('0x61');this[_0x6326('0x62')]=_0x320d43;this[_0x6326('0x63')]=_0x2c7a8d;this[_0x6326('0x38')]='system';this['description']=_0x6326('0x64');this[_0x6326('0x65')]=_0x2f624f;this[_0x6326('0x66')]=_0x37506f;}function createVoicePrefixExtensions(_0x10f54b,_0x3ac39d,_0x54a9eb){return new BPromise(function(_0x4cec50,_0x13fc10){var _0x447b34=new Extension(formatPrefixName(_0x10f54b[_0x6326('0x67')]),0x1,_0x6326('0x68'),'Voice\x20Prefix');_0x447b34[_0x6326('0x69')]=_0x10f54b['id'];return db[_0x6326('0x59')][_0x6326('0x55')](_0x447b34,{'transaction':_0x54a9eb})[_0x6326('0x2d')](function(_0x4197d6){var _0xc8f404=_0x4197d6['get']({'plain':!![]});var _0x2bc08a=_['map'](addVoicePrefixExtensions(_0x10f54b,_0x3ac39d),function(_0x4877c8){_0x4877c8[_0x6326('0x5a')]=_0xc8f404['id'];_0x4877c8['VoicePrefixId']=_0x10f54b['id'];return _0x4877c8;});return db[_0x6326('0x59')][_0x6326('0x6a')](_0x2bc08a,{'transaction':_0x54a9eb})[_0x6326('0x2d')](function(_0x3b6de7){if(!_0x3b6de7){return _0x13fc10(_0x6326('0x6b'));}else{return _0x4cec50(_0x3b6de7);}})[_0x6326('0x4f')](function(_0x1e8d86){return _0x13fc10(_0x1e8d86);});});;});};function addVoicePrefixExtensions(_0x75e3a7,_0xa2928e){var _0x3f5e2e=[];var _0x53ff60=formatPrefixName(_0x75e3a7[_0x6326('0x67')]);_0x3f5e2e[_0x6326('0x6c')](new Extension(_0x53ff60,0x2,_0x6326('0x6d'),_0x6326('0x6e')+_0x75e3a7[_0x6326('0x32')]));if(_0x75e3a7['callerIdAll']){_0x3f5e2e[_0x6326('0x6c')](new Extension(_0x53ff60,0x3,_0x6326('0x6d'),_0x6326('0x6f')+_0x75e3a7[_0x6326('0x70')]));}else{_0x3f5e2e[_0x6326('0x6c')](new Extension(_0x53ff60,0x3,'NoOp',_0x6326('0x71')));}_0x3f5e2e['push'](new Extension(_0x53ff60,0x4,'goto',_0xa2928e[_0x6326('0x72')]+','+_0x6326('0x73')+(0x8+_0x75e3a7[_0x6326('0x32')][_0x6326('0x40')])+'}'+','+0x1));return _0x3f5e2e;}function formatPrefixName(_0x4fd921){var _0x4fbede='_';for(var _0x5cadb2=0x0;_0x5cadb2<_0x4fd921['length'];_0x5cadb2++){if(_0x4fd921[_0x6326('0x74')](_0x5cadb2)=='-'){_0x4fbede+=_0x4fd921['charAt'](_0x5cadb2);}else{_0x4fbede+='['+_0x4fd921[_0x6326('0x74')](_0x5cadb2)+']';}}_0x4fbede+='.';return _0x4fbede;}exports[_0x6326('0x2c')]=function(_0x54730e,_0x4c1d7e,_0x5401cf){var _0x5e86bc=_0x54730e['body'];_0x5e86bc[_0x6326('0x67')]='system-'+_0x5e86bc['name']+'-';return db['sequelize']['transaction'](function(_0x19916e){return db['VoicePrefix'][_0x6326('0x2c')](_0x5e86bc,{'where':{'id':_0x5e86bc['id']},'transaction':_0x19916e})[_0x6326('0x2d')](function(){return db['VoiceExtension'][_0x6326('0x30')]({'where':{'VoicePrefixId':_0x5e86bc['id']},'transaction':_0x19916e})['then'](function(){return db[_0x6326('0x59')][_0x6326('0x53')]({'where':{'id':_0x5e86bc[_0x6326('0x5a')]},'raw':!![]})[_0x6326('0x2d')](function(_0x339838){return createVoicePrefixExtensions(_0x5e86bc,_0x339838,_0x19916e);});});});})[_0x6326('0x2d')](function(){return db[_0x6326('0x35')][_0x6326('0x75')](_0x5e86bc['id']);})[_0x6326('0x2d')](respondWithResult(_0x4c1d7e,null))[_0x6326('0x4f')](handleError(_0x4c1d7e,null));};exports[_0x6326('0x76')]=function(_0x19cc2b,_0x3bc5f3,_0x27a505){return db[_0x6326('0x35')][_0x6326('0x53')]({'where':{'id':_0x19cc2b[_0x6326('0x51')]['id']}})['then'](handleEntityNotFound(_0x3bc5f3,null))['then'](function(_0x543792){if(_0x543792){return _0x543792['addAgents'](_0x19cc2b[_0x6326('0x57')]['ids'],_['omit'](_0x19cc2b['body'],['ids','id'])||{})['spread'](function(_0x5a1a9f){for(var _0xe845d6=0x0;_0xe845d6<_0x19cc2b[_0x6326('0x57')]['ids'][_0x6326('0x40')];_0xe845d6+=0x1){socket[_0x6326('0x77')](_0x6326('0x78'),{'UserId':Number(_0x19cc2b['body'][_0x6326('0x79')][_0xe845d6]),'VoicePrefixId':Number(_0x19cc2b[_0x6326('0x51')]['id'])});}return _0x5a1a9f;});}})[_0x6326('0x2d')](respondWithResult(_0x3bc5f3,null))[_0x6326('0x4f')](handleError(_0x3bc5f3,null));};exports[_0x6326('0x7a')]=function(_0x483813,_0x3bff09,_0x4aec22){return db['VoicePrefix'][_0x6326('0x53')]({'where':{'id':_0x483813['params']['id']}})['then'](handleEntityNotFound(_0x3bff09,null))['then'](function(_0x491f2e){if(_0x491f2e){return _0x491f2e['removeAgents'](_0x483813['query']['ids'])[_0x6326('0x2d')](function(){if(_[_0x6326('0x7b')](_0x483813[_0x6326('0x3b')][_0x6326('0x79')])){for(var _0x590e06=0x0;_0x590e06<_0x483813['query']['ids'][_0x6326('0x40')];_0x590e06+=0x1){socket[_0x6326('0x77')]('userVoicePrefix:remove',{'UserId':Number(_0x483813[_0x6326('0x3b')]['ids'][_0x590e06]),'VoicePrefixId':Number(_0x483813['params']['id'])});}}else{socket[_0x6326('0x77')](_0x6326('0x7c'),{'UserId':Number(_0x483813[_0x6326('0x3b')][_0x6326('0x79')]),'VoicePrefixId':Number(_0x483813[_0x6326('0x51')]['id'])});}});}})[_0x6326('0x2d')](respondWithStatusCode(_0x3bff09,null))[_0x6326('0x4f')](handleError(_0x3bff09,null));};exports['getAgents']=function(_0x5afd24,_0x4c8bde,_0x1ec0ef){var _0x5223f4={};var _0x48631a={};var _0xaea64f;var _0x429c41;return db['VoicePrefix'][_0x6326('0x7d')]({'where':{'id':_0x5afd24['params']['id']}})['then'](handleEntityNotFound(_0x4c8bde,null))[_0x6326('0x2d')](function(_0xbca686){if(_0xbca686){_0xaea64f=_0xbca686;_0x48631a['model']=_['keys'](db[_0x6326('0x7e')][_0x6326('0x36')]);_0x48631a[_0x6326('0x3b')]=_[_0x6326('0x52')](_0x5afd24['query']);_0x48631a['filters']=_[_0x6326('0x3d')](_0x48631a[_0x6326('0x3a')],_0x48631a[_0x6326('0x3b')]);_0x5223f4[_0x6326('0x3f')]=_[_0x6326('0x3d')](_0x48631a[_0x6326('0x3a')],qs[_0x6326('0x3e')](_0x5afd24[_0x6326('0x3b')]['fields']));_0x5223f4[_0x6326('0x3f')]=_0x5223f4['attributes'][_0x6326('0x40')]?_0x5223f4[_0x6326('0x3f')]:_0x48631a[_0x6326('0x3a')];_0x5223f4[_0x6326('0x7f')]=qs[_0x6326('0x44')](_0x5afd24[_0x6326('0x3b')]['sort']);_0x5223f4[_0x6326('0x45')]=qs[_0x6326('0x3c')](_['pick'](_0x5afd24[_0x6326('0x3b')],_0x48631a[_0x6326('0x3c')]));if(_0x5afd24[_0x6326('0x3b')][_0x6326('0x48')]){_0x5223f4[_0x6326('0x45')]=_[_0x6326('0x49')](_0x5223f4[_0x6326('0x45')],{'$or':_['map'](_0x5223f4[_0x6326('0x3f')],function(_0x21ccbf){var _0x458a7e={};_0x458a7e[_0x21ccbf]={'$like':'%'+_0x5afd24[_0x6326('0x3b')][_0x6326('0x48')]+'%'};return _0x458a7e;})});}_0x5223f4=_['merge']({},_0x5223f4,_0x5afd24[_0x6326('0x4a')]);return _0xaea64f[_0x6326('0x80')](_0x5223f4);}})['then'](function(_0x411fe5){if(_0x411fe5){_0x429c41=_0x411fe5[_0x6326('0x40')];if(!_0x5afd24[_0x6326('0x3b')][_0x6326('0x41')](_0x6326('0x42'))){_0x5223f4[_0x6326('0x43')]=qs[_0x6326('0x43')](_0x5afd24[_0x6326('0x3b')]['limit']);_0x5223f4[_0x6326('0x23')]=qs[_0x6326('0x23')](_0x5afd24[_0x6326('0x3b')][_0x6326('0x23')]);}return _0xaea64f[_0x6326('0x80')](_0x5223f4);}})[_0x6326('0x2d')](function(_0xcb5683){if(_0xcb5683){return _0xcb5683?{'count':_0x429c41,'rows':_0xcb5683}:null;}})['then'](respondWithResult(_0x4c8bde,null))[_0x6326('0x4f')](handleError(_0x4c8bde,null));};exports['getTeams']=function(_0x44cea5,_0x57e6ad,_0x3a9312){var _0x5b251f={};var _0x2b885b={};var _0xda3005;var _0x29682b;return db[_0x6326('0x35')][_0x6326('0x7d')]({'where':{'id':_0x44cea5[_0x6326('0x51')]['id']}})[_0x6326('0x2d')](handleEntityNotFound(_0x57e6ad,null))['then'](function(_0x1da431){if(_0x1da431){_0xda3005=_0x1da431;_0x2b885b[_0x6326('0x3a')]=_[_0x6326('0x52')](db['Team'][_0x6326('0x36')]);_0x2b885b['query']=_[_0x6326('0x52')](_0x44cea5[_0x6326('0x3b')]);_0x2b885b[_0x6326('0x3c')]=_[_0x6326('0x3d')](_0x2b885b[_0x6326('0x3a')],_0x2b885b[_0x6326('0x3b')]);_0x5b251f[_0x6326('0x3f')]=_['intersection'](_0x2b885b[_0x6326('0x3a')],qs['fields'](_0x44cea5[_0x6326('0x3b')][_0x6326('0x3e')]));_0x5b251f[_0x6326('0x3f')]=_0x5b251f[_0x6326('0x3f')]['length']?_0x5b251f['attributes']:_0x2b885b[_0x6326('0x3a')];_0x5b251f[_0x6326('0x7f')]=qs[_0x6326('0x44')](_0x44cea5[_0x6326('0x3b')]['sort']);_0x5b251f[_0x6326('0x45')]=qs['filters'](_['pick'](_0x44cea5[_0x6326('0x3b')],_0x2b885b[_0x6326('0x3c')]));if(_0x44cea5[_0x6326('0x3b')][_0x6326('0x48')]){_0x5b251f[_0x6326('0x45')]=_[_0x6326('0x49')](_0x5b251f[_0x6326('0x45')],{'$or':_[_0x6326('0x34')](_0x5b251f[_0x6326('0x3f')],function(_0x3884db){var _0x5ccb35={};_0x5ccb35[_0x3884db]={'$like':'%'+_0x44cea5['query'][_0x6326('0x48')]+'%'};return _0x5ccb35;})});}_0x5b251f=_['merge']({},_0x5b251f,_0x44cea5[_0x6326('0x4a')]);return _0xda3005['getTeams'](_0x5b251f);}})['then'](function(_0x10d3c6){if(_0x10d3c6){_0x29682b=_0x10d3c6[_0x6326('0x40')];if(!_0x44cea5[_0x6326('0x3b')][_0x6326('0x41')](_0x6326('0x42'))){_0x5b251f[_0x6326('0x43')]=qs[_0x6326('0x43')](_0x44cea5[_0x6326('0x3b')]['limit']);_0x5b251f['offset']=qs[_0x6326('0x23')](_0x44cea5['query'][_0x6326('0x23')]);}return _0xda3005[_0x6326('0x81')](_0x5b251f);}})['then'](function(_0x5c57e5){if(_0x5c57e5){return _0x5c57e5?{'count':_0x29682b,'rows':_0x5c57e5}:null;}})[_0x6326('0x2d')](respondWithResult(_0x57e6ad,null))['catch'](handleError(_0x57e6ad,null));};exports['addTeams']=function(_0x50d766,_0x4f45a6,_0x3a9a9e){var _0x22c60d=_0x50d766[_0x6326('0x57')][_0x6326('0x79')];var _0x26f784;return db[_0x6326('0x82')]['findAll']({'where':{'id':_0x22c60d},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name','online','voicePause',_0x6326('0x83')],'raw':!![]}]})[_0x6326('0x2d')](function(_0x215db1){if(_0x215db1){_0x26f784=_0x215db1;var _0x2a9f5c=_['flatMap'](_0x215db1,function(_0x20f5ea){var _0x293f72=_0x20f5ea['get']({'plain':!![]});return _0x293f72[_0x6326('0x84')];});return db['VoicePrefix'][_0x6326('0x53')]({'where':{'id':_0x50d766[_0x6326('0x51')]['id']}})[_0x6326('0x2d')](function(_0x5d4b0a){return db['sequelize'][_0x6326('0x56')](function(_0xf912fe){return _0x5d4b0a[_0x6326('0x85')](_0x22c60d,{'transaction':_0xf912fe})['then'](function(){return BPromise[_0x6326('0x86')](_0x26f784,function(_0x464914){return db[_0x6326('0x87')]['upsert']({'TeamId':_0x464914['id'],'VoicePrefixId':_0x50d766[_0x6326('0x51')]['id']},{'transaction':_0xf912fe});});})['then'](function(){return BPromise[_0x6326('0x86')](_0x2a9f5c,function(_0x5a7b49){return db[_0x6326('0x88')][_0x6326('0x89')]({'where':{'UserId':_0x5a7b49['id'],'VoicePrefixId':_0x50d766['params']['id']},'transaction':_0xf912fe});});})[_0x6326('0x2d')](function(){_0x2a9f5c[_0x6326('0x8a')](function(_0x38d8c8){socket[_0x6326('0x77')](_0x6326('0x78'),{'UserId':_0x38d8c8['id'],'VoicePrefixId':_0x5d4b0a['id']});});});});});}})[_0x6326('0x2d')](respondWithStatusCode(_0x4f45a6,null))[_0x6326('0x4f')](handleError(_0x4f45a6,null));};exports[_0x6326('0x8b')]=function(_0x43dc1e,_0x26ea69,_0x1a4b94){return db[_0x6326('0x82')][_0x6326('0x4d')]({'where':{'id':_0x43dc1e['query'][_0x6326('0x79')]},'attributes':['id'],'include':[{'model':db[_0x6326('0x7e')],'as':_0x6326('0x84'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x26ea69,null))['then'](function(_0x489226){var _0x5db6b3=_[_0x6326('0x34')](_0x489226,'id');var _0x5135df=[];var _0x4c15d2=[];var _0xd9c385=squel['select']();_0xd9c385['field'](_0x6326('0x8c'))['from'](_0x6326('0x8d'),'tq')[_0x6326('0x8e')](_0x6326('0x8f'),'ut',_0x6326('0x90'))[_0x6326('0x45')](_0x6326('0x91'),_0x43dc1e[_0x6326('0x51')]['id']);for(var _0x26391c=0x0;_0x26391c<_0x489226[_0x6326('0x40')];_0x26391c+=0x1){let _0x1adcbc=_0x489226[_0x26391c];for(var _0x46bece=0x0;_0x46bece<_0x1adcbc[_0x6326('0x84')][_0x6326('0x40')];_0x46bece+=0x1){let _0x30d31a=_0x1adcbc[_0x6326('0x84')][_0x46bece];var _0x3ec241=_0xd9c385[_0x6326('0x92')]();_0x3ec241[_0x6326('0x45')](_0x6326('0x93'),_0x30d31a['id']);_0x4c15d2[_0x6326('0x6c')](db['sequelize'][_0x6326('0x3b')](_0x3ec241[_0x6326('0x94')](),{'type':db[_0x6326('0x95')][_0x6326('0x96')][_0x6326('0x97')]})[_0x6326('0x2d')](function(_0x292657){if(_0x292657[_0x6326('0x40')]===0x1){return _0x30d31a['id'];}else{var _0x909cce=_[_0x6326('0x98')](_['map'](_0x292657,_0x6326('0x99')),function(_0x4b493a){return _[_0x6326('0x9a')](_0x5db6b3,_0x4b493a);});if(_0x909cce){return _0x30d31a['id'];}}}));}}return BPromise[_0x6326('0x9b')](_0x4c15d2)['then'](function(_0x2b98a4){_0x5135df=_(_0x5135df)[_0x6326('0x9c')](_0x2b98a4)['compact']()['value']();return db[_0x6326('0x35')]['find']({'where':{'id':_0x43dc1e[_0x6326('0x51')]['id']}})['then'](function(_0x4a470e){return db[_0x6326('0x95')][_0x6326('0x56')](function(_0x298a11){return _0x4a470e[_0x6326('0x8b')](_0x43dc1e[_0x6326('0x3b')][_0x6326('0x79')],{'transaction':_0x298a11})[_0x6326('0x2d')](function(){if(!_['isEmpty'](_0x5135df)){return _0x4a470e['removeAgents'](_0x5135df,{'transaction':_0x298a11});}})[_0x6326('0x2d')](function(){_0x5135df[_0x6326('0x8a')](function(_0x42d1db){socket[_0x6326('0x77')](_0x6326('0x7c'),{'UserId':_0x42d1db,'VoicePrefixId':_0x4a470e['id']});});});});});});})['then'](respondWithStatusCode(_0x26ea69,null))[_0x6326('0x4f')](handleError(_0x26ea69,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 8e12da4..316b43b 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 _0x57be=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','VoicePrefix'];(function(_0x4f4c53,_0x58ba7b){var _0x568ff1=function(_0x1b6013){while(--_0x1b6013){_0x4f4c53['push'](_0x4f4c53['shift']());}};_0x568ff1(++_0x58ba7b);}(_0x57be,0x103));var _0xe57b=function(_0x15140c,_0x4bf5fd){_0x15140c=_0x15140c-0x0;var _0x166bd8=_0x57be[_0x15140c];return _0x166bd8;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xe57b('0x0'))['db'][_0xe57b('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xe57b('0x2')](0x0);var events={'afterCreate':_0xe57b('0x3'),'afterUpdate':'update','afterDestroy':_0xe57b('0x4')};function emitEvent(_0x16ee50){return function(_0x328cda,_0x49506c,_0x8e9850){VoicePrefixEvents[_0xe57b('0x5')](_0x16ee50+':'+_0x328cda['id'],_0x328cda);VoicePrefixEvents['emit'](_0x16ee50,_0x328cda);_0x8e9850(null);};}for(var e in events){if(events[_0xe57b('0x6')](e)){var event=events[e];VoicePrefix[_0xe57b('0x7')](e,emitEvent(event));}}module[_0xe57b('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0xb7fd=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x22893c,_0x2d1ab9){var _0x58dc82=function(_0x2055bd){while(--_0x2055bd){_0x22893c['push'](_0x22893c['shift']());}};_0x58dc82(++_0x2d1ab9);}(_0xb7fd,0x112));var _0xdb7f=function(_0x157b8d,_0xa9045a){_0x157b8d=_0x157b8d-0x0;var _0x4107b6=_0xb7fd[_0x157b8d];return _0x4107b6;};'use strict';var EventEmitter=require(_0xdb7f('0x0'));var VoicePrefix=require(_0xdb7f('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xdb7f('0x2')](0x0);var events={'afterCreate':_0xdb7f('0x3'),'afterUpdate':_0xdb7f('0x4'),'afterDestroy':_0xdb7f('0x5')};function emitEvent(_0x5d33bd){return function(_0x36a44a,_0x2592e6,_0x6374f2){VoicePrefixEvents[_0xdb7f('0x6')](_0x5d33bd+':'+_0x36a44a['id'],_0x36a44a);VoicePrefixEvents[_0xdb7f('0x6')](_0x5d33bd,_0x36a44a);_0x6374f2(null);};}for(var e in events){if(events[_0xdb7f('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0xdb7f('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index f8f4d0f..951b3bd 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 _0x1101=['../../config/environment','./voicePrefix.attributes','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x1101,0x143));var _0x1110=function(_0xa106d0,_0x2ee480){_0xa106d0=_0xa106d0-0x0;var _0x158de4=_0x1101[_0xa106d0];return _0x158de4;};'use strict';var _=require(_0x1110('0x0'));var util=require(_0x1110('0x1'));var logger=require(_0x1110('0x2'))(_0x1110('0x3'));var moment=require('moment');var BPromise=require(_0x1110('0x4'));var rp=require(_0x1110('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1110('0x6'));var config=require(_0x1110('0x7'));var attributes=require(_0x1110('0x8'));module['exports']=function(_0x1850b0,_0x212f6b){return _0x1850b0['define'](_0x1110('0x9'),attributes,{'tableName':_0x1110('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1a22=['../../config/environment','exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x1edd20,_0x1dbc2f){var _0x4188b9=function(_0x465e48){while(--_0x465e48){_0x1edd20['push'](_0x1edd20['shift']());}};_0x4188b9(++_0x1dbc2f);}(_0x1a22,0x1d9));var _0x21a2=function(_0x296db4,_0x3244dc){_0x296db4=_0x296db4-0x0;var _0x44e41c=_0x1a22[_0x296db4];return _0x44e41c;};'use strict';var _=require(_0x21a2('0x0'));var util=require(_0x21a2('0x1'));var logger=require(_0x21a2('0x2'))('api');var moment=require('moment');var BPromise=require(_0x21a2('0x3'));var rp=require(_0x21a2('0x4'));var fs=require('fs');var path=require(_0x21a2('0x5'));var rimraf=require(_0x21a2('0x6'));var config=require(_0x21a2('0x7'));var attributes=require('./voicePrefix.attributes');module[_0x21a2('0x8')]=function(_0x1b564f,_0x540e2a){return _0x1b564f[_0x21a2('0x9')](_0x21a2('0xa'),attributes,{'tableName':_0x21a2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 7a45011..0f8b03c 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','lodash','util','moment'];(function(_0x2a0183,_0x3fc93c){var _0x158c3a=function(_0x57a903){while(--_0x57a903){_0x2a0183['push'](_0x2a0183['shift']());}};_0x158c3a(++_0x3fc93c);}(_0x2ef3,0xba));var _0x32ef=function(_0x47a3c3,_0x43162d){_0x47a3c3=_0x47a3c3-0x0;var _0x500b72=_0x2ef3[_0x47a3c3];return _0x500b72;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('VoicePrefix,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});} \ No newline at end of file +var _0x1122=['randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird'];(function(_0x358e5e,_0x25feaf){var _0x411885=function(_0x3966bd){while(--_0x3966bd){_0x358e5e['push'](_0x358e5e['shift']());}};_0x411885(++_0x25feaf);}(_0x1122,0xac));var _0x2112=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1122[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2112('0x0'));var util=require('util');var moment=require(_0x2112('0x1'));var BPromise=require(_0x2112('0x2'));var rs=require(_0x2112('0x3'));var fs=require('fs');var Redis=require(_0x2112('0x4'));var db=require(_0x2112('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2112('0x6'));var config=require('../../config/environment');var jayson=require(_0x2112('0x7'));var client=jayson[_0x2112('0x8')]['http']({'port':0x232a});config[_0x2112('0x9')]=_[_0x2112('0xa')](config[_0x2112('0x9')],{'host':_0x2112('0xb'),'port':0x18eb});var socket=require(_0x2112('0xc'))(new Redis(config[_0x2112('0x9')]));require(_0x2112('0xd'))[_0x2112('0xe')](socket);function respondWithRpcPromise(_0x18a596,_0x485a3d,_0x4690e6){return new BPromise(function(_0x46fc8b,_0x42eddd){return client[_0x2112('0xf')](_0x18a596,_0x4690e6)['then'](function(_0xa0a089){logger[_0x2112('0x10')](_0x2112('0x11'),_0x485a3d,_0x2112('0x12'));logger[_0x2112('0x13')](_0x2112('0x14'),_0x485a3d,_0x2112('0x12'),JSON['stringify'](_0xa0a089));if(_0xa0a089[_0x2112('0x15')]){if(_0xa0a089['error'][_0x2112('0x16')]===0x1f4){logger[_0x2112('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x485a3d,_0xa0a089[_0x2112('0x15')]['message']);return _0x42eddd(_0xa0a089[_0x2112('0x15')]['message']);}logger[_0x2112('0x15')](_0x2112('0x11'),_0x485a3d,_0xa0a089['error'][_0x2112('0x17')]);return _0x46fc8b(_0xa0a089['error'][_0x2112('0x17')]);}else{logger['info']('VoicePrefix,\x20%s,\x20%s',_0x485a3d,_0x2112('0x12'));_0x46fc8b(_0xa0a089['result']['message']);}})[_0x2112('0x18')](function(_0x28d498){logger[_0x2112('0x15')](_0x2112('0x11'),_0x485a3d,_0x28d498);_0x42eddd(_0x28d498);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 44b4390..0a08e67 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 _0x167e=['register','length','./voicePrefix.events','save','remove','update','emit'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x167e,0xa3));var _0xe167=function(_0x543eb1,_0x28ed12){_0x543eb1=_0x543eb1-0x0;var _0x682a85=_0x167e[_0x543eb1];return _0x682a85;};'use strict';var VoicePrefixEvents=require(_0xe167('0x0'));var events=[_0xe167('0x1'),_0xe167('0x2'),_0xe167('0x3')];function createListener(_0x14457a,_0x398408){return function(_0x3958c5){_0x398408[_0xe167('0x4')](_0x14457a,_0x3958c5);};}function removeListener(_0x5e4863,_0x287097){return function(){VoicePrefixEvents['removeListener'](_0x5e4863,_0x287097);};}exports[_0xe167('0x5')]=function(_0x3563b8){for(var _0x3812f5=0x0,_0x3bad0c=events[_0xe167('0x6')];_0x3812f5<_0x3bad0c;_0x3812f5++){var _0x56cf9b=events[_0x3812f5];var _0x3a00d5=createListener('voicePrefix:'+_0x56cf9b,_0x3563b8);VoicePrefixEvents['on'](_0x56cf9b,_0x3a00d5);}}; \ No newline at end of file +var _0x19c3=['emit','removeListener','length','voicePrefix:','./voicePrefix.events','remove','update'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x19c3,0xf9));var _0x319c=function(_0x296866,_0x42c00b){_0x296866=_0x296866-0x0;var _0x52c9d8=_0x19c3[_0x296866];return _0x52c9d8;};'use strict';var VoicePrefixEvents=require(_0x319c('0x0'));var events=['save',_0x319c('0x1'),_0x319c('0x2')];function createListener(_0x55e0b2,_0x1db6c9){return function(_0x259d2e){_0x1db6c9[_0x319c('0x3')](_0x55e0b2,_0x259d2e);};}function removeListener(_0x350517,_0x3a96b1){return function(){VoicePrefixEvents[_0x319c('0x4')](_0x350517,_0x3a96b1);};}exports['register']=function(_0x20f77e){for(var _0x53a1de=0x0,_0x2e38c4=events[_0x319c('0x5')];_0x53a1de<_0x2e38c4;_0x53a1de++){var _0x9a5cf8=events[_0x53a1de];var _0x306a4b=createListener(_0x319c('0x6')+_0x9a5cf8,_0x20f77e);VoicePrefixEvents['on'](_0x9a5cf8,_0x306a4b);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 2d484cd..e158493 100644 --- a/server/api/voiceQueue/index.js +++ b/server/api/voiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x22dd17,_0x56d249){var _0x517196=function(_0xdb7874){while(--_0xdb7874){_0x22dd17['push'](_0x22dd17['shift']());}};_0x517196(++_0x56d249);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file +var _0xa9e0=['addAgents','/:id/blacklists','addBlackLists','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','/:id','getHoppers','/:id/hopper_histories','isAuthenticated','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','create','/:id/clone','clone','addTeams'];(function(_0x350c20,_0x4d634f){var _0x1be143=function(_0x5d1f6e){while(--_0x5d1f6e){_0x350c20['push'](_0x350c20['shift']());}};_0x1be143(++_0x4d634f);}(_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/hoppers',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getTeams']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x8')]('/:id/blacklists',auth[_0x0a9e('0xd')](),controller['getBlackLists']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/users',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller['addLists']);router[_0x0a9e('0x18')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x22')]);router['delete']('/:id/teams',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router[_0x0a9e('0x21')](_0x0a9e('0x12'),auth['isAuthenticated'](),controller[_0x0a9e('0x24')]);router['delete'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x25')]);router[_0x0a9e('0x21')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x26')]);module[_0x0a9e('0x27')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index c702bb5..5e01857 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 _0x1500=['Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#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)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','default','ringall','fewestcalls','random','linear','wrandom','rrordered','setDataValue','strategy','rrmemory','getDataValue','type','outbound','preview','includes','INTEGER','yes','all','TEXT','periodic_announce','join','joinempty','leavewhenempty','split','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','power','booked','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen'];(function(_0x2bb3cc,_0x90d13d){var _0xe053a1=function(_0x312769){while(--_0x312769){_0x2bb3cc['push'](_0x2bb3cc['shift']());}};_0xe053a1(++_0x90d13d);}(_0x1500,0x1af));var _0x0150=function(_0x10bfb1,_0x91cdb4){_0x10bfb1=_0x10bfb1-0x0;var _0x5bc4ad=_0x1500[_0x10bfb1];return _0x5bc4ad;};'use strict';var Sequelize=require(_0x0150('0x0'));module[_0x0150('0x1')]={'name':{'type':Sequelize[_0x0150('0x2')],'allowNull':![],'unique':_0x0150('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0150('0x4')](_0x0150('0x5'),'outbound'),'allowNull':![],'defaultValue':_0x0150('0x5')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0x0150('0x6')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x0150('0x4')]('rr',_0x0150('0x7'),'leastrecent',_0x0150('0x8'),_0x0150('0x9'),'rrmemory',_0x0150('0xa'),_0x0150('0xb'),_0x0150('0xc')),'allowNull':![],'defaultValue':_0x0150('0x7'),'set':function(_0x443506){this[_0x0150('0xd')](_0x0150('0xe'),_0x443506?_0x443506:_0x0150('0xf'));},'get':function(){var _0x2b7207=this[_0x0150('0x10')](_0x0150('0x11'));var _0x5ec321=this[_0x0150('0x10')]('dialMethod');var _0x3b8698=this[_0x0150('0x10')](_0x0150('0xe'));if(_0x2b7207===_0x0150('0x12')){if(_0x5ec321===_0x0150('0x13')){return null;}if(_0x5ec321==='booked'&&!['rrmemory','roundrobin'][_0x0150('0x14')](_0x3b8698)){this[_0x0150('0xd')](_0x0150('0xe'),_0x0150('0xf'));}}return _0x3b8698;}},'servicelevel':{'type':Sequelize[_0x0150('0x15')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x0150('0x15')](0xb)},'timeout':{'type':Sequelize[_0x0150('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0150('0x2')]},'weight':{'type':Sequelize[_0x0150('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0150('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0150('0x4')](_0x0150('0x16'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x0150('0x4')](_0x0150('0x16'),'no',_0x0150('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0x0150('0x4')](_0x0150('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x0150('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0150('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0x0150('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0150('0x4')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x0150('0x4')](_0x0150('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0150('0x4')](_0x0150('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0150('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x0150('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0150('0x4')](_0x0150('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x0150('0x16'),'no'),'defaultValue':_0x0150('0x16')},'announce_holdtime':{'type':Sequelize[_0x0150('0x4')]('yes','no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0150('0x4')](_0x0150('0x16'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0150('0x2')]},'queue_youarenext':{'type':Sequelize[_0x0150('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x0150('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x0150('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0150('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0150('0x2')]},'queue_quantity1':{'type':Sequelize[_0x0150('0x2')]},'queue_quantity2':{'type':Sequelize[_0x0150('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x0150('0x2')]},'queue_less_than':{'type':Sequelize[_0x0150('0x2')]},'periodic_announce':{'type':Sequelize[_0x0150('0x18')],'set':function(_0x309cb8){this['setDataValue'](_0x0150('0x19'),_0x309cb8?_0x309cb8[_0x0150('0x1a')](','):[]);},'get':function(){return this[_0x0150('0x10')](_0x0150('0x19'))?this[_0x0150('0x10')](_0x0150('0x19'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0x0150('0x2')],'defaultValue':_0x0150('0x16'),'set':function(_0x23e135){this[_0x0150('0xd')](_0x0150('0x1b'),_0x23e135?_0x23e135[_0x0150('0x1a')](','):undefined);},'get':function(){return this['getDataValue']('joinempty')?this[_0x0150('0x10')](_0x0150('0x1b'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0150('0x2')],'defaultValue':'no','set':function(_0x2171a4){this['setDataValue']('leavewhenempty',_0x2171a4?_0x2171a4[_0x0150('0x1a')](','):undefined);},'get':function(){return this[_0x0150('0x10')]('leavewhenempty')?this[_0x0150('0x10')](_0x0150('0x1c'))[_0x0150('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0150('0x4')](_0x0150('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x0150('0x4')](_0x0150('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0150('0x2')]},'description':{'type':Sequelize[_0x0150('0x2')]},'acw':{'type':Sequelize[_0x0150('0x1e')],'defaultValue':0x0,'set':function(_0xa75563){this[_0x0150('0xd')](_0x0150('0x1f'),_0xa75563);if(_0xa75563){if(this[_0x0150('0x10')](_0x0150('0x20'))<0x2){this[_0x0150('0xd')](_0x0150('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x0150('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0150('0x1e')],'defaultValue':0x0,'comment':_0x0150('0x21')},'dialMethod':{'type':Sequelize['ENUM'](_0x0150('0x13'),_0x0150('0x22'),_0x0150('0x23'),'predictive',_0x0150('0x24')),'defaultValue':_0x0150('0x22'),'comment':_0x0150('0x25')},'dialLimitChannel':{'type':Sequelize[_0x0150('0x15')](0x4)[_0x0150('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x0150('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0150('0x27')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x0150('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0150('0x28')},'dialPredictiveOptimization':{'type':Sequelize[_0x0150('0x4')](_0x0150('0x29'),_0x0150('0x2a')),'defaultValue':'dropRate','comment':_0x0150('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0150('0x2c')](0x2)[_0x0150('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0150('0x2d')},'dialPredictiveInterval':{'type':Sequelize[_0x0150('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x0150('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0150('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x0150('0x15')](0x3)[_0x0150('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0150('0x2f')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x0150('0x30'),'comment':_0x0150('0x31')},'dialQueueTimeout':{'type':Sequelize[_0x0150('0x15')](0x3)[_0x0150('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0150('0x32')},'dialQueueProject':{'type':Sequelize[_0x0150('0x2')],'comment':_0x0150('0x33')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0150('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0150('0x34')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0150('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0150('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0150('0x35')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0150('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0150('0x36')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0150('0x26')],'defaultValue':0x3,'comment':_0x0150('0x37')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0150('0x15')](0x5)[_0x0150('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0150('0x38')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0150('0x15')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0150('0x39')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x0150('0x3a')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x0150('0x4')]('always',_0x0150('0x3b'),_0x0150('0x3c')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x0150('0x1e')],'defaultValue':0x0,'comment':_0x0150('0x3d')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0150('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0150('0x3e')},'dialAMDGreeting':{'type':Sequelize[_0x0150('0x15')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0150('0x3f')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0150('0x15')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0150('0x40')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0150('0x15')](0x9)[_0x0150('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0150('0x41')},'dialAMDMinWordLength':{'type':Sequelize[_0x0150('0x15')](0x9)[_0x0150('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0150('0x42')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0150('0x15')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x0150('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0150('0x43')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0150('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0150('0x44')},'dialRecallMeTimeout':{'type':Sequelize[_0x0150('0x15')](0x5)[_0x0150('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0150('0x45')},'dialRecallInQueue':{'type':Sequelize[_0x0150('0x1e')],'defaultValue':0x0,'comment':_0x0150('0x46')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0150('0x4')](_0x0150('0x47'),_0x0150('0x48')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x0150('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0150('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0150('0x15')](0x3)[_0x0150('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0150('0x49')},'dialCutDigit':{'type':Sequelize[_0x0150('0x15')](0x3)[_0x0150('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0150('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0150('0x4a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0150('0x4b')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0150('0x4c')},'dialDropRetryFrequency':{'type':Sequelize[_0x0150('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0150('0x4d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0150('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0150('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x0150('0x15')](0x3)[_0x0150('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0150('0x15')](0x5)[_0x0150('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0150('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0150('0x15')](0x5)[_0x0150('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0150('0x4e')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0150('0x15')],'allowNull':!![],'comment':_0x0150('0x4f')},'mandatoryDisposition':{'type':Sequelize[_0x0150('0x1e')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xa3ffd){if(!_0xa3ffd)this[_0x0150('0xd')](_0x0150('0x50'),null);this[_0x0150('0xd')](_0x0150('0x51'),_0xa3ffd);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x0150('0x15')](0x3)[_0x0150('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x0150('0x15')](0x3)[_0x0150('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x0150('0x1e')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0x0150('0x26')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x0150('0x1e')],'defaultValue':![]}}; \ No newline at end of file +var _0xd7f0=['#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','sequelize','exports','STRING','ENUM','inbound','default','leastrecent','fewestcalls','linear','wrandom','rrordered','ringall','setDataValue','strategy','getDataValue','type','outbound','preview','rrmemory','includes','INTEGER','yes','all','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','progressive','power','predictive','booked','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','onlyIfOpen','Active/Disactive\x20AMD'];(function(_0x5657bb,_0x2f1219){var _0x2a5ecb=function(_0x193add){while(--_0x193add){_0x5657bb['push'](_0x5657bb['shift']());}};_0x2a5ecb(++_0x2f1219);}(_0xd7f0,0xba));var _0x0d7f=function(_0x134afa,_0x797f89){_0x134afa=_0x134afa-0x0;var _0x435337=_0xd7f0[_0x134afa];return _0x435337;};'use strict';var Sequelize=require(_0x0d7f('0x0'));module[_0x0d7f('0x1')]={'name':{'type':Sequelize[_0x0d7f('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0d7f('0x3')](_0x0d7f('0x4'),'outbound'),'allowNull':![],'defaultValue':_0x0d7f('0x4')},'musiconhold':{'type':Sequelize[_0x0d7f('0x2')],'defaultValue':_0x0d7f('0x5')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0x0d7f('0x3')]('rr','ringall',_0x0d7f('0x6'),_0x0d7f('0x7'),'random','rrmemory',_0x0d7f('0x8'),_0x0d7f('0x9'),_0x0d7f('0xa')),'allowNull':![],'defaultValue':_0x0d7f('0xb'),'set':function(_0x522c64){this[_0x0d7f('0xc')](_0x0d7f('0xd'),_0x522c64?_0x522c64:'rrmemory');},'get':function(){var _0x1869cc=this[_0x0d7f('0xe')](_0x0d7f('0xf'));var _0x63f879=this[_0x0d7f('0xe')]('dialMethod');var _0x4fee09=this[_0x0d7f('0xe')]('strategy');if(_0x1869cc===_0x0d7f('0x10')){if(_0x63f879===_0x0d7f('0x11')){return null;}if(_0x63f879==='booked'&&![_0x0d7f('0x12'),'roundrobin'][_0x0d7f('0x13')](_0x4fee09)){this['setDataValue'](_0x0d7f('0xd'),'rrmemory');}}return _0x4fee09;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0d7f('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x0d7f('0x14')](0xb)},'timeout':{'type':Sequelize[_0x0d7f('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x0d7f('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x0d7f('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0d7f('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0x0d7f('0x15'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize['ENUM']('yes','no',_0x0d7f('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0d7f('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0x0d7f('0x3')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0d7f('0x3')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0d7f('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0d7f('0x3')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0d7f('0x3')](_0x0d7f('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x0d7f('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0d7f('0x3')](_0x0d7f('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0d7f('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x0d7f('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x0d7f('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0d7f('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0d7f('0x3')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x0d7f('0x3')]('yes','no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x0d7f('0x3')](_0x0d7f('0x15'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0d7f('0x3')](_0x0d7f('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0x0d7f('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0d7f('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0d7f('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'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[_0x0d7f('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0d7f('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x0d7f('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0d7f('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0d7f('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0d7f('0x2')]},'queue_quantity1':{'type':Sequelize[_0x0d7f('0x2')]},'queue_quantity2':{'type':Sequelize[_0x0d7f('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x0d7f('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x1e5565){this[_0x0d7f('0xc')](_0x0d7f('0x17'),_0x1e5565?_0x1e5565[_0x0d7f('0x18')](','):[]);},'get':function(){return this['getDataValue'](_0x0d7f('0x17'))?this[_0x0d7f('0xe')]('periodic_announce')[_0x0d7f('0x19')](','):[];}},'joinempty':{'type':Sequelize[_0x0d7f('0x2')],'defaultValue':_0x0d7f('0x15'),'set':function(_0x4c4a81){this['setDataValue'](_0x0d7f('0x1a'),_0x4c4a81?_0x4c4a81[_0x0d7f('0x18')](','):undefined);},'get':function(){return this['getDataValue'](_0x0d7f('0x1a'))?this[_0x0d7f('0xe')](_0x0d7f('0x1a'))[_0x0d7f('0x19')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0d7f('0x2')],'defaultValue':'no','set':function(_0x1ec921){this[_0x0d7f('0xc')](_0x0d7f('0x1b'),_0x1ec921?_0x1ec921[_0x0d7f('0x18')](','):undefined);},'get':function(){return this[_0x0d7f('0xe')](_0x0d7f('0x1b'))?this[_0x0d7f('0xe')](_0x0d7f('0x1b'))[_0x0d7f('0x19')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0d7f('0x3')](_0x0d7f('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x0d7f('0x3')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x0d7f('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0d7f('0x3')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0d7f('0x2')]},'description':{'type':Sequelize[_0x0d7f('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x544b4e){this[_0x0d7f('0xc')](_0x0d7f('0x1c'),_0x544b4e);if(_0x544b4e){if(this[_0x0d7f('0xe')](_0x0d7f('0x1d'))<0x2){this[_0x0d7f('0xc')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x0d7f('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0d7f('0x1e')],'defaultValue':0x0,'comment':_0x0d7f('0x1f')},'dialMethod':{'type':Sequelize['ENUM'](_0x0d7f('0x11'),_0x0d7f('0x20'),_0x0d7f('0x21'),_0x0d7f('0x22'),_0x0d7f('0x23')),'defaultValue':_0x0d7f('0x20'),'comment':_0x0d7f('0x24')},'dialLimitChannel':{'type':Sequelize[_0x0d7f('0x14')](0x4)[_0x0d7f('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0x0d7f('0x14')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0d7f('0x26')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x0d7f('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0d7f('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0x0d7f('0x3')](_0x0d7f('0x28'),'dropRate'),'defaultValue':_0x0d7f('0x29'),'comment':_0x0d7f('0x2a')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0d7f('0x2b')](0x2)[_0x0d7f('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0d7f('0x2c')},'dialPredictiveInterval':{'type':Sequelize[_0x0d7f('0x14')](0x3)[_0x0d7f('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x0d7f('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0d7f('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0d7f('0x14')](0x3)[_0x0d7f('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0d7f('0x2e')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x0d7f('0x2f'),'comment':_0x0d7f('0x30')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x0d7f('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0d7f('0x31')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x0d7f('0x32')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0d7f('0x14')](0x3)[_0x0d7f('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0d7f('0x33')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0d7f('0x14')](0x5)[_0x0d7f('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x0d7f('0x14')](0x3)[_0x0d7f('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0d7f('0x34')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0d7f('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0d7f('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0d7f('0x25')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x0d7f('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x0d7f('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0d7f('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0d7f('0x36'),'never',_0x0d7f('0x37')),'defaultValue':_0x0d7f('0x36')},'dialAMDActive':{'type':Sequelize[_0x0d7f('0x1e')],'defaultValue':0x0,'comment':_0x0d7f('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0x0d7f('0x14')](0x9)[_0x0d7f('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0d7f('0x39')},'dialAMDGreeting':{'type':Sequelize[_0x0d7f('0x14')](0x9)[_0x0d7f('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0d7f('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0d7f('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0d7f('0x14')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0d7f('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0x0d7f('0x14')](0x9)[_0x0d7f('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0d7f('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0d7f('0x14')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0d7f('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0d7f('0x14')](0x9)[_0x0d7f('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0d7f('0x14')](0x5)[_0x0d7f('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0d7f('0x3f')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0d7f('0x14')](0x9)[_0x0d7f('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0d7f('0x40')},'dialRecallMeTimeout':{'type':Sequelize[_0x0d7f('0x14')](0x5)[_0x0d7f('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0d7f('0x41')},'dialRecallInQueue':{'type':Sequelize[_0x0d7f('0x1e')],'defaultValue':0x0,'comment':_0x0d7f('0x42')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0d7f('0x3')](_0x0d7f('0x43'),_0x0d7f('0x44')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x0d7f('0x2')],'comment':_0x0d7f('0x32')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0d7f('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0d7f('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x0d7f('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0d7f('0x45')},'dialCutDigit':{'type':Sequelize[_0x0d7f('0x14')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0d7f('0x46')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0d7f('0x14')](0x3)[_0x0d7f('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0d7f('0x47')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0d7f('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0d7f('0x48')},'dialDropMaxRetry':{'type':Sequelize[_0x0d7f('0x14')](0x3)[_0x0d7f('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x0d7f('0x14')](0x5)[_0x0d7f('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0d7f('0x49')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0d7f('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0d7f('0x4a')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0d7f('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x0d7f('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0d7f('0x4b')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0d7f('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0d7f('0x4c')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0d7f('0x14')](0x3)[_0x0d7f('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0d7f('0x4d')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0d7f('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0d7f('0x4e')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0x0d7f('0x4f')},'mandatoryDisposition':{'type':Sequelize[_0x0d7f('0x1e')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3c051c){if(!_0x3c051c)this[_0x0d7f('0xc')](_0x0d7f('0x50'),null);this[_0x0d7f('0xc')]('mandatoryDisposition',_0x3c051c);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x0d7f('0x14')](0x3)[_0x0d7f('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0d7f('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x0d7f('0x1e')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0x0d7f('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x0d7f('0x1e')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 62fc2cc..8534c26 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 _0xe14b=['QueueCampaigns','outbound','filter','map','value','type','find','name','end','error','stack','index','VoiceQueue','rawAttributes','fieldName','key','getOptions','where','include','show','params','model','keys','query','intersection','attributes','fields','length','includeAll','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','UserProfileSection','autoAssociation','UserProfileResource','clone','merge','omit','createdAt','updatedAt','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','filters','hasOwnProperty','nolimit','order','sort','pick','VoiceQueueId','findAll','rows','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','Agents','online','interface','flatMap','penalty','sequelize','UserVoiceQueue','UserVoiceQueueRt','upsert','isNil','format','voicePause','forEach','emit','userVoiceQueue:save','ids','User','select','field','tq.TeamId','from','team_has_voice_queues','join','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','compact','transaction','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','CmListId','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','bluebird','squel','ioredis','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','get','inbound'];(function(_0x2cc544,_0x10b2f0){var _0x21503b=function(_0x3a2cde){while(--_0x3a2cde){_0x2cc544['push'](_0x2cc544['shift']());}};_0x21503b(++_0x10b2f0);}(_0xe14b,0x93));var _0xbe14=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xe14b[_0x1da04e];return _0xdd8c41;};'use strict';var moment=require(_0xbe14('0x0'));var BPromise=require(_0xbe14('0x1'));var util=require('util');var _=require('lodash');var squel=require(_0xbe14('0x2'));var Redis=require(_0xbe14('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0xbe14('0x4'))('api');var config=require('../../config/environment');var db=require(_0xbe14('0x5'))['db'];config[_0xbe14('0x6')]=_[_0xbe14('0x7')](config[_0xbe14('0x6')],{'host':_0xbe14('0x8'),'port':0x18eb});var socket=require(_0xbe14('0x9'))(new Redis(config[_0xbe14('0x6')]));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x496063,_0x30c355){_0x30c355=_0x30c355||0xcc;return function(_0x6fceff){if(_0x6fceff){return _0x496063[_0xbe14('0xa')](_0x30c355);}return _0x496063[_0xbe14('0xb')](_0x30c355)['end']();};}function respondWithResult(_0x5b9fc6,_0x113243){_0x113243=_0x113243||0xc8;return function(_0x3f70cb){if(_0x3f70cb){return _0x5b9fc6['status'](_0x113243)[_0xbe14('0xc')](_0x3f70cb);}};}function respondWithFilteredResult(_0x35aa19,_0x886a5e){return function(_0x3d38c2){if(_0x3d38c2){var _0x27792f=typeof _0x886a5e[_0xbe14('0xd')]===_0xbe14('0xe')&&typeof _0x886a5e[_0xbe14('0xf')]===_0xbe14('0xe');var _0xa2cf72=_0x3d38c2[_0xbe14('0x10')];var _0x33fd54=_0x27792f?0x0:_0x886a5e[_0xbe14('0xd')];var _0x530538=_0x27792f?_0x3d38c2['count']:_0x886a5e[_0xbe14('0xd')]+_0x886a5e[_0xbe14('0xf')];var _0xf4ac9;if(_0x530538>=_0xa2cf72){_0x530538=_0xa2cf72;_0xf4ac9=0xc8;}else{_0xf4ac9=0xce;}_0x35aa19[_0xbe14('0xb')](_0xf4ac9);return _0x35aa19['set'](_0xbe14('0x11'),_0x33fd54+'-'+_0x530538+'/'+_0xa2cf72)[_0xbe14('0xc')](_0x3d38c2);}return null;};}function saveUpdates(_0xfd7b8f){return function(_0x123ede){if(_0x123ede){return _0x123ede[_0xbe14('0x12')](_0xfd7b8f)[_0xbe14('0x13')](function(_0x17ae86){return _0x17ae86;});}return null;};}function removeEntity(_0x5ea1f8){return function(_0x137ee5){if(_0x137ee5){return _0x137ee5[_0xbe14('0x14')]()[_0xbe14('0x13')](function(){var _0x433459=_0x137ee5[_0xbe14('0x15')]({'plain':!![]});var _0x37e4c1=[{'name':'VoiceQueues','value':_0xbe14('0x16'),'ignore':![]},{'name':_0xbe14('0x17'),'value':_0xbe14('0x18'),'ignore':![]}];var _0xc12977=_(_0x37e4c1)[_0xbe14('0x19')]('ignore')[_0xbe14('0x1a')]('value')[_0xbe14('0x1b')]();if(_['includes'](_0xc12977,_0x433459[_0xbe14('0x1c')])){return;}var _0x4a25fa=_[_0xbe14('0x1d')](_0x37e4c1,[_0xbe14('0x1b'),_0x433459['type']])[_0xbe14('0x1e')];return db['UserProfileResource'][_0xbe14('0x14')]({'where':{'type':_0x4a25fa,'resourceId':_0x433459['id']}})['then'](function(){return _0x137ee5;});})[_0xbe14('0x13')](function(){_0x5ea1f8[_0xbe14('0xb')](0xcc)[_0xbe14('0x1f')]();});}};}function handleEntityNotFound(_0x39cc81){return function(_0x15ef02){if(!_0x15ef02){_0x39cc81[_0xbe14('0xa')](0x194);}return _0x15ef02;};}function handleError(_0x55d001,_0x1822e0){_0x1822e0=_0x1822e0||0x1f4;return function(_0x1ba46a){logger[_0xbe14('0x20')](_0x1ba46a[_0xbe14('0x21')]);if(_0x1ba46a['name']){delete _0x1ba46a[_0xbe14('0x1e')];}_0x55d001[_0xbe14('0xb')](_0x1822e0)['send'](_0x1ba46a);};}exports[_0xbe14('0x22')]=function(_0x3b3e84,_0x1c7cc7){var _0x19252f={};var _0x34d648={'count':0x0,'rows':[]};var _0x36d4b2=_[_0xbe14('0x1a')](db[_0xbe14('0x23')][_0xbe14('0x24')],function(_0x16a159){return{'name':_0x16a159[_0xbe14('0x25')],'type':_0x16a159[_0xbe14('0x1c')][_0xbe14('0x26')]};});_0x19252f=qs[_0xbe14('0x27')](_0x36d4b2,_0x3b3e84);var _0x223f7a={'where':_0x19252f[_0xbe14('0x28')]};return db[_0xbe14('0x23')][_0xbe14('0x10')](_0x223f7a)[_0xbe14('0x13')](function(_0x14e7c4){_0x34d648['count']=_0x14e7c4;_0x19252f[_0xbe14('0x29')]=qs['include'](_0x3b3e84['query']);return db[_0xbe14('0x23')]['findAll'](_0x19252f);})[_0xbe14('0x13')](function(_0x345b0){_0x34d648['rows']=_0x345b0;return _0x34d648;})['then'](respondWithFilteredResult(_0x1c7cc7,_0x19252f))['catch'](handleError(_0x1c7cc7,null));};exports[_0xbe14('0x2a')]=function(_0xa3d24,_0x5f27b6){var _0x46c570={'raw':![],'where':{'id':_0xa3d24[_0xbe14('0x2b')]['id']}},_0x1faf3e={};_0x1faf3e[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db['VoiceQueue']['rawAttributes']);_0x1faf3e[_0xbe14('0x2e')]=_['keys'](_0xa3d24['query']);_0x1faf3e['filters']=_[_0xbe14('0x2f')](_0x1faf3e[_0xbe14('0x2c')],_0x1faf3e[_0xbe14('0x2e')]);_0x46c570[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x1faf3e[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0xa3d24[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x46c570[_0xbe14('0x30')]=_0x46c570[_0xbe14('0x30')][_0xbe14('0x32')]?_0x46c570['attributes']:_0x1faf3e['model'];if(_0xa3d24[_0xbe14('0x2e')][_0xbe14('0x33')]){_0x46c570[_0xbe14('0x29')]=[{'all':!![]}];}_0x46c570=_['merge']({},_0x46c570,_0xa3d24[_0xbe14('0x34')]);return db[_0xbe14('0x23')][_0xbe14('0x1d')](_0x46c570)[_0xbe14('0x13')](handleEntityNotFound(_0x5f27b6,null))[_0xbe14('0x13')](respondWithResult(_0x5f27b6,null))[_0xbe14('0x35')](handleError(_0x5f27b6,null));};exports[_0xbe14('0x36')]=function(_0x128843,_0x1b2608){return db['VoiceQueue'][_0xbe14('0x36')](_0x128843[_0xbe14('0x37')],{})[_0xbe14('0x13')](function(_0x1b3118){var _0x3287b9=_0x128843[_0xbe14('0x38')]['get']({'plain':!![]});if(!_0x3287b9)throw new Error(_0xbe14('0x39'));if(_0x3287b9[_0xbe14('0x3a')]===_0xbe14('0x38')){var _0x36263c=_0x1b3118['get']({'plain':!![]});var _0x4bfa96=[{'name':_0xbe14('0x3b'),'value':_0xbe14('0x16')},{'name':_0xbe14('0x17'),'value':'outbound'}];var _0x5d5318=_[_0xbe14('0x1d')](_0x4bfa96,['value',_0x36263c['type']])[_0xbe14('0x1e')];return db[_0xbe14('0x3c')][_0xbe14('0x1d')]({'where':{'name':_0x5d5318,'userProfileId':_0x3287b9['userProfileId']},'raw':!![]})['then'](function(_0x5aaa4f){if(_0x5aaa4f&&_0x5aaa4f[_0xbe14('0x3d')]===0x0){return db[_0xbe14('0x3e')][_0xbe14('0x36')]({'name':_0x36263c['name'],'resourceId':_0x36263c['id'],'type':_0x5aaa4f[_0xbe14('0x1e')],'sectionId':_0x5aaa4f['id']},{})[_0xbe14('0x13')](function(){return _0x1b3118;});}else{return _0x1b3118;}})[_0xbe14('0x35')](function(_0x3ab0f6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ab0f6);throw _0x3ab0f6;});}return _0x1b3118;})[_0xbe14('0x13')](respondWithResult(_0x1b2608,0xc9))[_0xbe14('0x35')](handleError(_0x1b2608,null));};exports[_0xbe14('0x3f')]=function(_0xb2b285,_0x2550dc){var _0x4f2d95={'where':{'id':_0xb2b285[_0xbe14('0x2b')]['id']}},_0x51023a={};_0x51023a[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x23')]['rawAttributes']);_0x4f2d95[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x51023a['model'],qs[_0xbe14('0x31')](_0xb2b285[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x4f2d95[_0xbe14('0x30')]=_0x4f2d95['attributes']['length']?_0x4f2d95[_0xbe14('0x30')]:_0x51023a[_0xbe14('0x2c')];if(_0xb2b285['query']['includeAll']){_0x4f2d95[_0xbe14('0x29')]=[{'all':!![]}];}_0x4f2d95=_[_0xbe14('0x40')]({},_0x4f2d95,_0xb2b285[_0xbe14('0x34')]);return db[_0xbe14('0x23')][_0xbe14('0x1d')](_0x4f2d95)[_0xbe14('0x13')](handleEntityNotFound(_0x2550dc,null))[_0xbe14('0x13')](function(_0x5a4068){if(_0x5a4068){var _0xf32e93=_0x5a4068[_0xbe14('0x15')]({'plain':!![]});_0xf32e93=qs[_0xbe14('0x41')](_0xf32e93,['id',_0xbe14('0x42'),_0xbe14('0x43')]);_0xb2b285['body']=_[_0xbe14('0x41')](_0xb2b285[_0xbe14('0x37')],['id',_0xbe14('0x42'),_0xbe14('0x43')]);return db[_0xbe14('0x23')][_0xbe14('0x36')](_['merge'](_0xf32e93,_0xb2b285['body']),{'include':_0xb2b285[_0xbe14('0x2e')][_0xbe14('0x33')]?[{'all':!![]}]:undefined})[_0xbe14('0x13')](function(_0x48554a){var _0x497b00=_0xb2b285[_0xbe14('0x38')][_0xbe14('0x15')]({'plain':!![]});if(!_0x497b00)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x497b00[_0xbe14('0x3a')]===_0xbe14('0x38')){var _0x50c2a0=_0x48554a[_0xbe14('0x15')]({'plain':!![]});var _0x4a40d2=[{'name':_0xbe14('0x3b'),'value':_0xbe14('0x16')},{'name':_0xbe14('0x17'),'value':'outbound'}];var _0x435c8d=_[_0xbe14('0x1d')](_0x4a40d2,['value',_0x50c2a0[_0xbe14('0x1c')]])[_0xbe14('0x1e')];return db[_0xbe14('0x3c')][_0xbe14('0x1d')]({'where':{'name':_0x435c8d,'userProfileId':_0x497b00[_0xbe14('0x44')]},'raw':!![]})['then'](function(_0x42a346){if(_0x42a346&&_0x42a346[_0xbe14('0x3d')]===0x0){return db[_0xbe14('0x3e')][_0xbe14('0x36')]({'name':_0x50c2a0[_0xbe14('0x1e')],'resourceId':_0x50c2a0['id'],'type':_0x42a346[_0xbe14('0x1e')],'sectionId':_0x42a346['id']},{})[_0xbe14('0x13')](function(){return _0x48554a;});}else{return _0x48554a;}})['catch'](function(_0x72c875){logger[_0xbe14('0x20')](_0xbe14('0x45'),_0x72c875);throw _0x72c875;});}return _0x48554a;});}})[_0xbe14('0x13')](respondWithResult(_0x2550dc,0xc9))[_0xbe14('0x35')](handleError(_0x2550dc,null));};exports[_0xbe14('0x12')]=function(_0xd8f78f,_0x32df3c){if(_0xd8f78f[_0xbe14('0x37')]['id']){delete _0xd8f78f[_0xbe14('0x37')]['id'];}return db[_0xbe14('0x23')]['find']({'where':{'id':_0xd8f78f['params']['id']}})['then'](handleEntityNotFound(_0x32df3c,null))[_0xbe14('0x13')](saveUpdates(_0xd8f78f[_0xbe14('0x37')],null))[_0xbe14('0x13')](respondWithResult(_0x32df3c,null))[_0xbe14('0x35')](handleError(_0x32df3c,null));};exports[_0xbe14('0x14')]=function(_0x66ddf,_0x16ee48){return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0x66ddf[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x16ee48,null))[_0xbe14('0x13')](removeEntity(_0x16ee48,null))[_0xbe14('0x35')](handleError(_0x16ee48,null));};exports[_0xbe14('0x46')]=function(_0x1c831a,_0xcef8e3){var _0x179077={'raw':![],'where':{}};var _0x2225d9={};var _0x29761b={'count':0x0,'rows':[]};return db[_0xbe14('0x23')]['findOne']({'where':{'id':_0x1c831a[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0xcef8e3,null))[_0xbe14('0x13')](function(_0x46b49c){if(_0x46b49c){_0x2225d9[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x47')][_0xbe14('0x24')]);_0x2225d9[_0xbe14('0x2e')]=_[_0xbe14('0x2d')](_0x1c831a['query']);_0x2225d9[_0xbe14('0x48')]=_[_0xbe14('0x2f')](_0x2225d9[_0xbe14('0x2c')],_0x2225d9[_0xbe14('0x2e')]);_0x179077[_0xbe14('0x30')]=_['intersection'](_0x2225d9[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0x1c831a[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x179077[_0xbe14('0x30')]=_0x179077['attributes'][_0xbe14('0x32')]?_0x179077[_0xbe14('0x30')]:_0x2225d9[_0xbe14('0x2c')];if(!_0x1c831a[_0xbe14('0x2e')][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x179077[_0xbe14('0xf')]=qs[_0xbe14('0xf')](_0x1c831a['query'][_0xbe14('0xf')]);_0x179077[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x1c831a[_0xbe14('0x2e')][_0xbe14('0xd')]);}_0x179077[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0x1c831a['query']['sort']);_0x179077[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_[_0xbe14('0x4d')](_0x1c831a[_0xbe14('0x2e')],_0x2225d9[_0xbe14('0x48')]));_0x179077[_0xbe14('0x28')][_0xbe14('0x4e')]=_0x46b49c['id'];if(_0x1c831a[_0xbe14('0x2e')]['filter']){_0x179077['where']=_[_0xbe14('0x40')](_0x179077[_0xbe14('0x28')],{'$or':_[_0xbe14('0x1a')](_0x179077['attributes'],function(_0x76e91e){var _0x16bca1={};_0x16bca1[_0x76e91e]={'$like':'%'+_0x1c831a[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x16bca1;})});}_0x179077=_[_0xbe14('0x40')]({},_0x179077,_0x1c831a[_0xbe14('0x34')]);return db[_0xbe14('0x47')]['count']({'where':_0x179077[_0xbe14('0x28')]})[_0xbe14('0x13')](function(_0x3baa26){_0x29761b[_0xbe14('0x10')]=_0x3baa26;if(_0x1c831a[_0xbe14('0x2e')][_0xbe14('0x33')]){_0x179077[_0xbe14('0x29')]=[{'all':!![]}];}return db['CmHopper'][_0xbe14('0x4f')](_0x179077);})[_0xbe14('0x13')](function(_0x3cd17e){_0x29761b[_0xbe14('0x50')]=_0x3cd17e;return _0x29761b;});}})[_0xbe14('0x13')](respondWithFilteredResult(_0xcef8e3,_0x179077))[_0xbe14('0x35')](handleError(_0xcef8e3,null));};exports[_0xbe14('0x51')]=function(_0xd756b2,_0x5d064e){var _0x1e5ce1={'raw':!![],'where':{}};var _0x401968={};var _0x362999={'count':0x0,'rows':[]};return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0xd756b2[_0xbe14('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5d064e,null))[_0xbe14('0x13')](function(_0x175213){if(_0x175213){_0x401968[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db['CmHopperHistory'][_0xbe14('0x24')]);_0x401968[_0xbe14('0x2e')]=_[_0xbe14('0x2d')](_0xd756b2[_0xbe14('0x2e')]);_0x401968[_0xbe14('0x48')]=_[_0xbe14('0x2f')](_0x401968[_0xbe14('0x2c')],_0x401968['query']);_0x1e5ce1[_0xbe14('0x30')]=_['intersection'](_0x401968[_0xbe14('0x2c')],qs['fields'](_0xd756b2[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x1e5ce1[_0xbe14('0x30')]=_0x1e5ce1['attributes'][_0xbe14('0x32')]?_0x1e5ce1[_0xbe14('0x30')]:_0x401968[_0xbe14('0x2c')];if(!_0xd756b2['query'][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x1e5ce1[_0xbe14('0xf')]=qs[_0xbe14('0xf')](_0xd756b2['query'][_0xbe14('0xf')]);_0x1e5ce1[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0xd756b2[_0xbe14('0x2e')][_0xbe14('0xd')]);}_0x1e5ce1[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0xd756b2['query'][_0xbe14('0x4c')]);_0x1e5ce1[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_['pick'](_0xd756b2[_0xbe14('0x2e')],_0x401968[_0xbe14('0x48')]));_0x1e5ce1[_0xbe14('0x28')]['VoiceQueueId']=_0x175213['id'];if(_0xd756b2[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x1e5ce1['where']=_[_0xbe14('0x40')](_0x1e5ce1['where'],{'$or':_[_0xbe14('0x1a')](_0x1e5ce1[_0xbe14('0x30')],function(_0x4dfa19){var _0x55d729={};_0x55d729[_0x4dfa19]={'$like':'%'+_0xd756b2[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x55d729;})});}_0x1e5ce1=_[_0xbe14('0x40')]({},_0x1e5ce1,_0xd756b2['options']);return db[_0xbe14('0x53')][_0xbe14('0x10')]({'where':_0x1e5ce1[_0xbe14('0x28')]})[_0xbe14('0x13')](function(_0x5ee624){_0x362999['count']=_0x5ee624;if(_0xd756b2[_0xbe14('0x2e')][_0xbe14('0x33')]){_0x1e5ce1[_0xbe14('0x29')]=[{'all':!![]}];}return db[_0xbe14('0x53')][_0xbe14('0x4f')](_0x1e5ce1);})[_0xbe14('0x13')](function(_0x139aab){_0x362999['rows']=_0x139aab;return _0x362999;});}})[_0xbe14('0x13')](respondWithFilteredResult(_0x5d064e,_0x1e5ce1))['catch'](handleError(_0x5d064e,null));};exports[_0xbe14('0x54')]=function(_0x3a01bb,_0x8d47f2){var _0x2382c4={'raw':!![],'where':{}};var _0x55a3ae={};var _0x1e160b={'count':0x0,'rows':[]};return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0x3a01bb['params']['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x8d47f2,null))[_0xbe14('0x13')](function(_0x4090bc){if(_0x4090bc){_0x55a3ae[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x55')][_0xbe14('0x24')]);_0x55a3ae[_0xbe14('0x2e')]=_[_0xbe14('0x2d')](_0x3a01bb[_0xbe14('0x2e')]);_0x55a3ae[_0xbe14('0x48')]=_[_0xbe14('0x2f')](_0x55a3ae[_0xbe14('0x2c')],_0x55a3ae[_0xbe14('0x2e')]);_0x2382c4[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x55a3ae[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x2382c4['attributes']=_0x2382c4[_0xbe14('0x30')]['length']?_0x2382c4[_0xbe14('0x30')]:_0x55a3ae[_0xbe14('0x2c')];if(!_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x2382c4['limit']=qs['limit'](_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0xf')]);_0x2382c4[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x3a01bb['query'][_0xbe14('0xd')]);}_0x2382c4[_0xbe14('0x4b')]=qs['sort'](_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0x4c')]);_0x2382c4[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_['pick'](_0x3a01bb[_0xbe14('0x2e')],_0x55a3ae['filters']));_0x2382c4['where'][_0xbe14('0x4e')]=_0x4090bc['id'];if(_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x2382c4[_0xbe14('0x28')]=_[_0xbe14('0x40')](_0x2382c4['where'],{'$or':_[_0xbe14('0x1a')](_0x2382c4[_0xbe14('0x30')],function(_0x5dc793){var _0x4e35ed={};_0x4e35ed[_0x5dc793]={'$like':'%'+_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x4e35ed;})});}_0x2382c4=_['merge']({},_0x2382c4,_0x3a01bb[_0xbe14('0x34')]);return db['CmHopperFinal'][_0xbe14('0x10')]({'where':_0x2382c4['where']})[_0xbe14('0x13')](function(_0x5d4431){_0x1e160b[_0xbe14('0x10')]=_0x5d4431;if(_0x3a01bb['query'][_0xbe14('0x33')]){_0x2382c4[_0xbe14('0x29')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x2382c4);})[_0xbe14('0x13')](function(_0x4db7e8){_0x1e160b['rows']=_0x4db7e8;return _0x1e160b;});}})[_0xbe14('0x13')](respondWithFilteredResult(_0x8d47f2,_0x2382c4))[_0xbe14('0x35')](handleError(_0x8d47f2,null));};exports[_0xbe14('0x56')]=function(_0x11c341,_0x1a780a){var _0x313a87={'raw':!![],'where':{}};var _0x30d2b0={};var _0x57ad22={'count':0x0,'rows':[]};return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0x11c341[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x1a780a,null))['then'](function(_0x26372a){if(_0x26372a){_0x30d2b0[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db['CmHopperBlack'][_0xbe14('0x24')]);_0x30d2b0[_0xbe14('0x2e')]=_['keys'](_0x11c341[_0xbe14('0x2e')]);_0x30d2b0['filters']=_[_0xbe14('0x2f')](_0x30d2b0[_0xbe14('0x2c')],_0x30d2b0[_0xbe14('0x2e')]);_0x313a87['attributes']=_[_0xbe14('0x2f')](_0x30d2b0['model'],qs[_0xbe14('0x31')](_0x11c341['query']['fields']));_0x313a87[_0xbe14('0x30')]=_0x313a87['attributes'][_0xbe14('0x32')]?_0x313a87['attributes']:_0x30d2b0[_0xbe14('0x2c')];if(!_0x11c341[_0xbe14('0x2e')][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x313a87[_0xbe14('0xf')]=qs[_0xbe14('0xf')](_0x11c341[_0xbe14('0x2e')][_0xbe14('0xf')]);_0x313a87[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x11c341[_0xbe14('0x2e')][_0xbe14('0xd')]);}_0x313a87[_0xbe14('0x4b')]=qs['sort'](_0x11c341[_0xbe14('0x2e')][_0xbe14('0x4c')]);_0x313a87[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_[_0xbe14('0x4d')](_0x11c341['query'],_0x30d2b0['filters']));_0x313a87[_0xbe14('0x28')][_0xbe14('0x4e')]=_0x26372a['id'];if(_0x11c341[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x313a87[_0xbe14('0x28')]=_[_0xbe14('0x40')](_0x313a87[_0xbe14('0x28')],{'$or':_[_0xbe14('0x1a')](_0x313a87[_0xbe14('0x30')],function(_0x26e7a7){var _0x761b3d={};_0x761b3d[_0x26e7a7]={'$like':'%'+_0x11c341[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x761b3d;})});}_0x313a87=_[_0xbe14('0x40')]({},_0x313a87,_0x11c341[_0xbe14('0x34')]);return db[_0xbe14('0x57')][_0xbe14('0x10')]({'where':_0x313a87[_0xbe14('0x28')]})[_0xbe14('0x13')](function(_0x28a1e9){_0x57ad22[_0xbe14('0x10')]=_0x28a1e9;if(_0x11c341[_0xbe14('0x2e')][_0xbe14('0x33')]){_0x313a87[_0xbe14('0x29')]=[{'all':!![]}];}return db[_0xbe14('0x57')]['findAll'](_0x313a87);})[_0xbe14('0x13')](function(_0x3303a4){_0x57ad22[_0xbe14('0x50')]=_0x3303a4;return _0x57ad22;});}})[_0xbe14('0x13')](respondWithFilteredResult(_0x1a780a,_0x313a87))[_0xbe14('0x35')](handleError(_0x1a780a,null));};exports[_0xbe14('0x58')]=function(_0x52b75d,_0x5b161c){var _0x165b7a={};var _0x4a44e0={};var _0x3730d1;var _0x4babba;return db[_0xbe14('0x23')]['findOne']({'where':{'id':_0x52b75d[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x5b161c,null))[_0xbe14('0x13')](function(_0x12498f){if(_0x12498f){_0x3730d1=_0x12498f;_0x4a44e0[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x59')][_0xbe14('0x24')]);_0x4a44e0[_0xbe14('0x2e')]=_['keys'](_0x52b75d[_0xbe14('0x2e')]);_0x4a44e0[_0xbe14('0x48')]=_[_0xbe14('0x2f')](_0x4a44e0[_0xbe14('0x2c')],_0x4a44e0['query']);_0x165b7a[_0xbe14('0x30')]=_['intersection'](_0x4a44e0[_0xbe14('0x2c')],qs['fields'](_0x52b75d[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x165b7a[_0xbe14('0x30')]=_0x165b7a['attributes'][_0xbe14('0x32')]?_0x165b7a['attributes']:_0x4a44e0[_0xbe14('0x2c')];_0x165b7a[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0x52b75d[_0xbe14('0x2e')][_0xbe14('0x4c')]);_0x165b7a[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_[_0xbe14('0x4d')](_0x52b75d[_0xbe14('0x2e')],_0x4a44e0['filters']));if(_0x52b75d[_0xbe14('0x2e')]['filter']){_0x165b7a[_0xbe14('0x28')]=_[_0xbe14('0x40')](_0x165b7a[_0xbe14('0x28')],{'$or':_['map'](_0x165b7a[_0xbe14('0x30')],function(_0x1c5fbc){var _0x219403={};_0x219403[_0x1c5fbc]={'$like':'%'+_0x52b75d[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x219403;})});}_0x165b7a=_['merge']({},_0x165b7a,_0x52b75d['options']);return _0x3730d1[_0xbe14('0x58')](_0x165b7a);}})['then'](function(_0x16b1c8){if(_0x16b1c8){_0x4babba=_0x16b1c8[_0xbe14('0x32')];if(!_0x52b75d[_0xbe14('0x2e')][_0xbe14('0x49')]('nolimit')){_0x165b7a[_0xbe14('0xf')]=qs[_0xbe14('0xf')](_0x52b75d['query'][_0xbe14('0xf')]);_0x165b7a[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x52b75d[_0xbe14('0x2e')]['offset']);}return _0x3730d1[_0xbe14('0x58')](_0x165b7a);}})[_0xbe14('0x13')](function(_0x37aff6){if(_0x37aff6){return _0x37aff6?{'count':_0x4babba,'rows':_0x37aff6}:null;}})[_0xbe14('0x13')](respondWithResult(_0x5b161c,null))[_0xbe14('0x35')](handleError(_0x5b161c,null));};exports[_0xbe14('0x5a')]=function(_0x208fae,_0x310d42){var _0x9c229f=_0x208fae[_0xbe14('0x37')]['teams'];var _0xdb5515=_[_0xbe14('0x1a')](_0x9c229f,'id');return db[_0xbe14('0x59')][_0xbe14('0x4f')]({'where':{'id':_0xdb5515},'attributes':['id'],'include':[{'model':db['User'],'as':_0xbe14('0x5b'),'attributes':['id',_0xbe14('0x1e'),_0xbe14('0x5c'),'voicePause',_0xbe14('0x5d')],'raw':!![]}]})[_0xbe14('0x13')](function(_0x1ec868){if(_0x1ec868){var _0x1a7321=_[_0xbe14('0x5e')](_0x1ec868,function(_0x2306f6){var _0x426189=_0x2306f6['get']({'plain':!![]});_0x426189[_0xbe14('0x5b')]['forEach'](function(_0x24d528){_0x24d528[_0xbe14('0x5f')]=_[_0xbe14('0x1d')](_0x9c229f,{'id':_0x426189['id']})[_0xbe14('0x5f')];});return _0x426189[_0xbe14('0x5b')];});return db['VoiceQueue']['find']({'where':{'id':_0x208fae[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](function(_0x29a892){return db[_0xbe14('0x60')]['transaction'](function(_0x46a251){return _0x29a892[_0xbe14('0x5a')](_0xdb5515,{'transaction':_0x46a251})[_0xbe14('0x13')](function(){return BPromise['each'](_0x9c229f,function(_0xe69b0e){return db['TeamVoiceQueue']['upsert']({'TeamId':_0xe69b0e['id'],'VoiceQueueId':_0x208fae[_0xbe14('0x2b')]['id'],'penalty':_0xe69b0e[_0xbe14('0x5f')]},{'transaction':_0x46a251});});})[_0xbe14('0x13')](function(){return BPromise['each'](_0x1a7321,function(_0x3ea9c2){return db[_0xbe14('0x61')]['findOrCreate']({'where':{'UserId':_0x3ea9c2['id'],'VoiceQueueId':_0x208fae[_0xbe14('0x2b')]['id']},'defaults':{'penalty':_0x3ea9c2[_0xbe14('0x5f')]},'transaction':_0x46a251});});})[_0xbe14('0x13')](function(){return BPromise['each'](_[_0xbe14('0x19')](_0x1a7321,{'online':!![]}),function(_0x1e2559){return db[_0xbe14('0x62')][_0xbe14('0x63')]({'membername':_0x1e2559[_0xbe14('0x1e')],'UserId':_0x1e2559['id'],'queue_name':_0x29a892['name'],'VoiceQueueId':_0x29a892['id'],'interface':_[_0xbe14('0x64')](_0x1e2559[_0xbe14('0x5d')])?util[_0xbe14('0x65')]('SIP/%s',_0x1e2559[_0xbe14('0x1e')]):_0x1e2559[_0xbe14('0x5d')],'paused':_0x1e2559[_0xbe14('0x66')]||![],'penalty':_0x1e2559[_0xbe14('0x5f')]},{'transaction':_0x46a251});});})[_0xbe14('0x13')](function(){_0x1a7321[_0xbe14('0x67')](function(_0x1b22a0){socket[_0xbe14('0x68')](_0xbe14('0x69'),{'UserId':_0x1b22a0['id'],'VoiceQueueId':_0x29a892['id']});});});});});}})[_0xbe14('0x13')](respondWithStatusCode(_0x310d42,null))[_0xbe14('0x35')](handleError(_0x310d42,null));};exports['removeTeams']=function(_0xf549ec,_0x2c3647){return db[_0xbe14('0x59')]['findAll']({'where':{'id':_0xf549ec[_0xbe14('0x2e')][_0xbe14('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xbe14('0x6b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xbe14('0x13')](handleEntityNotFound(_0x2c3647,null))['then'](function(_0x2d4b18){var _0xcd8cf6=_['map'](_0x2d4b18,'id');var _0x269e5a=[];var _0x4c7e2b=[];var _0x587f58=squel[_0xbe14('0x6c')]();_0x587f58[_0xbe14('0x6d')](_0xbe14('0x6e'))[_0xbe14('0x6f')](_0xbe14('0x70'),'tq')[_0xbe14('0x71')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xbe14('0x28')](_0xbe14('0x72'),_0xf549ec[_0xbe14('0x2b')]['id']);for(var _0x3c23fc=0x0;_0x3c23fc<_0x2d4b18['length'];_0x3c23fc+=0x1){let _0x1d5333=_0x2d4b18[_0x3c23fc];for(var _0x4cb29c=0x0;_0x4cb29c<_0x1d5333[_0xbe14('0x5b')][_0xbe14('0x32')];_0x4cb29c+=0x1){let _0x5270b2=_0x1d5333[_0xbe14('0x5b')][_0x4cb29c];var _0x273df5=_0x587f58[_0xbe14('0x3f')]();_0x273df5[_0xbe14('0x28')](_0xbe14('0x73'),_0x5270b2['id']);_0x4c7e2b[_0xbe14('0x74')](db[_0xbe14('0x60')][_0xbe14('0x2e')](_0x273df5[_0xbe14('0x75')](),{'type':db[_0xbe14('0x60')][_0xbe14('0x76')][_0xbe14('0x77')]})['then'](function(_0x20f196){if(_0x20f196[_0xbe14('0x32')]===0x1){return _0x5270b2['id'];}else{var _0x1eb33b=_[_0xbe14('0x78')](_['map'](_0x20f196,_0xbe14('0x79')),function(_0xede1c1){return _['includes'](_0xcd8cf6,_0xede1c1);});if(_0x1eb33b){return _0x5270b2['id'];}}}));}}return BPromise[_0xbe14('0x7a')](_0x4c7e2b)[_0xbe14('0x13')](function(_0x11085c){_0x269e5a=_(_0x269e5a)['union'](_0x11085c)[_0xbe14('0x7b')]()[_0xbe14('0x1b')]();return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0xf549ec[_0xbe14('0x2b')]['id']}})['then'](function(_0x23208d){return db[_0xbe14('0x60')][_0xbe14('0x7c')](function(_0x3f7732){return _0x23208d[_0xbe14('0x7d')](_0xf549ec['query'][_0xbe14('0x6a')],{'transaction':_0x3f7732})[_0xbe14('0x13')](function(){if(!_[_0xbe14('0x7e')](_0x269e5a)){return _0x23208d[_0xbe14('0x7f')](_0x269e5a,{'transaction':_0x3f7732})[_0xbe14('0x13')](function(){return db[_0xbe14('0x62')][_0xbe14('0x14')]({'where':{'VoiceQueueId':_0xf549ec[_0xbe14('0x2b')]['id'],'UserId':_0x269e5a},'transaction':_0x3f7732});});}})['then'](function(){_0x269e5a['forEach'](function(_0x129ef6){socket[_0xbe14('0x68')](_0xbe14('0x80'),{'UserId':_0x129ef6,'VoiceQueueId':_0x23208d['id']});});});});});});})[_0xbe14('0x13')](respondWithStatusCode(_0x2c3647,null))[_0xbe14('0x35')](handleError(_0x2c3647,null));};exports['addAgents']=function(_0x15c93c,_0xf6ff8){var _0x3eaabe,_0x1ea11a;return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0x15c93c[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0xf6ff8,null))['then'](function(_0xf6da38){if(_0xf6da38){_0x1ea11a=_0xf6da38;return _0xf6da38[_0xbe14('0x81')](_0x15c93c['body']['ids'],_[_0xbe14('0x41')](_0x15c93c['body'],[_0xbe14('0x6a'),'id'])||{})[_0xbe14('0x82')](function(_0x776e93){for(var _0x3f5ca3=0x0;_0x3f5ca3<_0x15c93c[_0xbe14('0x37')]['ids'][_0xbe14('0x32')];_0x3f5ca3+=0x1){socket[_0xbe14('0x68')](_0xbe14('0x69'),{'UserId':Number(_0x15c93c[_0xbe14('0x37')][_0xbe14('0x6a')][_0x3f5ca3]),'VoiceQueueId':Number(_0x15c93c[_0xbe14('0x2b')]['id'])});}return _0x776e93;});}})['then'](function(_0x4eea48){_0x3eaabe=_0x4eea48||[];if(_0x1ea11a){return db[_0xbe14('0x6b')]['findAll']({'where':{'id':_0x15c93c[_0xbe14('0x37')][_0xbe14('0x6a')]},'attributes':['id',_0xbe14('0x1e'),'online',_0xbe14('0x66'),_0xbe14('0x5d')],'raw':!![]});}})[_0xbe14('0x13')](function(_0x1ad15d){if(!_[_0xbe14('0x7e')](_0x1ad15d)){var _0x2e5106=[];for(var _0x156fb3=0x0;_0x156fb3<_0x1ad15d['length'];_0x156fb3++){if(_0x1ad15d[_0x156fb3][_0xbe14('0x5c')]){_0x2e5106['push'](db['UserVoiceQueueRt']['upsert']({'membername':_0x1ad15d[_0x156fb3]['name'],'UserId':_0x1ad15d[_0x156fb3]['id'],'queue_name':_0x1ea11a[_0xbe14('0x1e')],'VoiceQueueId':_0x1ea11a['id'],'interface':_[_0xbe14('0x64')](_0x1ad15d[_0x156fb3]['interface'])?util[_0xbe14('0x65')]('SIP/%s',_0x1ad15d[_0x156fb3][_0xbe14('0x1e')]):_0x1ad15d[_0x156fb3]['interface'],'paused':_0x1ad15d[_0x156fb3][_0xbe14('0x66')]||![],'penalty':_0x15c93c[_0xbe14('0x37')][_0xbe14('0x5f')]||0x0}));}}return BPromise[_0xbe14('0x7a')](_0x2e5106);}})[_0xbe14('0x13')](function(){return _0x3eaabe;})['then'](respondWithResult(_0xf6ff8,null))[_0xbe14('0x35')](handleError(_0xf6ff8,null));};exports[_0xbe14('0x7f')]=function(_0x3aaa54,_0x413893){return db['VoiceQueue']['find']({'where':{'id':_0x3aaa54['params']['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x413893,null))[_0xbe14('0x13')](function(_0x3826cf){if(_0x3826cf){return _0x3826cf[_0xbe14('0x7f')](_0x3aaa54[_0xbe14('0x2e')]['ids'])['then'](function(){if(_[_0xbe14('0x83')](_0x3aaa54[_0xbe14('0x2e')][_0xbe14('0x6a')])){for(var _0x26092b=0x0;_0x26092b<_0x3aaa54[_0xbe14('0x2e')]['ids'][_0xbe14('0x32')];_0x26092b+=0x1){socket['emit'](_0xbe14('0x80'),{'UserId':Number(_0x3aaa54[_0xbe14('0x2e')][_0xbe14('0x6a')][_0x26092b]),'VoiceQueueId':Number(_0x3aaa54[_0xbe14('0x2b')]['id'])});}}else{socket['emit'](_0xbe14('0x80'),{'UserId':Number(_0x3aaa54[_0xbe14('0x2e')][_0xbe14('0x6a')]),'VoiceQueueId':Number(_0x3aaa54[_0xbe14('0x2b')]['id'])});}});}})['then'](function(_0x44c341){return db[_0xbe14('0x62')][_0xbe14('0x14')]({'where':{'VoiceQueueId':_0x3aaa54['params']['id'],'UserId':_0x3aaa54['query'][_0xbe14('0x6a')]}})[_0xbe14('0x13')](function(){return _0x44c341;});})[_0xbe14('0x13')](respondWithStatusCode(_0x413893,null))['catch'](handleError(_0x413893,null));};exports[_0xbe14('0x84')]=function(_0x2f0d14,_0x180e61){var _0x952322={};var _0x3ae00b={};var _0x41962a;var _0x4ebf01;return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0x2f0d14[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x180e61,null))[_0xbe14('0x13')](function(_0x5f28dd){if(_0x5f28dd){_0x41962a=_0x5f28dd;_0x3ae00b['model']=_[_0xbe14('0x2d')](db['User'][_0xbe14('0x24')]);_0x3ae00b['query']=_[_0xbe14('0x2d')](_0x2f0d14[_0xbe14('0x2e')]);_0x3ae00b[_0xbe14('0x48')]=_['intersection'](_0x3ae00b[_0xbe14('0x2c')],_0x3ae00b[_0xbe14('0x2e')]);_0x952322[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x3ae00b[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x952322[_0xbe14('0x30')]=_0x952322[_0xbe14('0x30')]['length']?_0x952322[_0xbe14('0x30')]:_0x3ae00b[_0xbe14('0x2c')];_0x952322[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0x4c')]);_0x952322[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_['pick'](_0x2f0d14[_0xbe14('0x2e')],_0x3ae00b[_0xbe14('0x48')]));if(_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x952322[_0xbe14('0x28')]=_[_0xbe14('0x40')](_0x952322['where'],{'$or':_['map'](_0x952322['attributes'],function(_0x598ccc){var _0x446b3f={};_0x446b3f[_0x598ccc]={'$like':'%'+_0x2f0d14[_0xbe14('0x2e')]['filter']+'%'};return _0x446b3f;})});}_0x952322=_[_0xbe14('0x40')]({},_0x952322,_0x2f0d14['options']);return _0x41962a[_0xbe14('0x84')](_0x952322);}})[_0xbe14('0x13')](function(_0x111ff0){if(_0x111ff0){_0x4ebf01=_0x111ff0[_0xbe14('0x32')];if(!_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0x49')]('nolimit')){_0x952322[_0xbe14('0xf')]=qs[_0xbe14('0xf')](_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0xf')]);_0x952322[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0xd')]);}return _0x41962a[_0xbe14('0x84')](_0x952322);}})['then'](function(_0x2eb5e6){if(_0x2eb5e6){return _0x2eb5e6?{'count':_0x4ebf01,'rows':_0x2eb5e6}:null;}})['then'](respondWithResult(_0x180e61,null))[_0xbe14('0x35')](handleError(_0x180e61,null));};exports['getMembers']=function(_0x49cddc,_0x3bdbf7){var _0x19a1ae={};var _0x167dee={};var _0x4f6252;var _0x4536b9;return db['VoiceQueue'][_0xbe14('0x52')]({'where':{'id':_0x49cddc['params']['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x3bdbf7,null))[_0xbe14('0x13')](function(_0x21f14e){if(_0x21f14e){_0x4f6252=_0x21f14e;_0x167dee[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x62')]['rawAttributes']);_0x167dee[_0xbe14('0x2e')]=_[_0xbe14('0x2d')](_0x49cddc['query']);_0x167dee['filters']=_['intersection'](_0x167dee[_0xbe14('0x2c')],_0x167dee[_0xbe14('0x2e')]);_0x19a1ae[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x167dee[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0x49cddc[_0xbe14('0x2e')]['fields']));_0x19a1ae[_0xbe14('0x30')]=_0x19a1ae[_0xbe14('0x30')][_0xbe14('0x32')]?_0x19a1ae['attributes']:_0x167dee[_0xbe14('0x2c')];_0x19a1ae[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0x49cddc['query']['sort']);_0x19a1ae[_0xbe14('0x28')]=qs['filters'](_[_0xbe14('0x4d')](_0x49cddc[_0xbe14('0x2e')],_0x167dee[_0xbe14('0x48')]));if(_0x49cddc[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x19a1ae[_0xbe14('0x28')]=_['merge'](_0x19a1ae[_0xbe14('0x28')],{'$or':_['map'](_0x19a1ae[_0xbe14('0x30')],function(_0x2d0568){var _0x26bb56={};_0x26bb56[_0x2d0568]={'$like':'%'+_0x49cddc['query'][_0xbe14('0x19')]+'%'};return _0x26bb56;})});}_0x19a1ae=_[_0xbe14('0x40')]({},_0x19a1ae,_0x49cddc['options']);return _0x4f6252['getMembers'](_0x19a1ae);}})[_0xbe14('0x13')](function(_0x3d9061){if(_0x3d9061){_0x4536b9=_0x3d9061[_0xbe14('0x32')];if(!_0x49cddc['query'][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x19a1ae['limit']=qs['limit'](_0x49cddc['query']['limit']);_0x19a1ae[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x49cddc['query']['offset']);}return _0x4f6252[_0xbe14('0x85')](_0x19a1ae);}})[_0xbe14('0x13')](function(_0x1046a0){return _0x1046a0?{'count':_0x4536b9,'rows':_0x1046a0}:null;})['then'](respondWithResult(_0x3bdbf7,null))[_0xbe14('0x35')](handleError(_0x3bdbf7,null));};exports[_0xbe14('0x86')]=function(_0x3933c7,_0x416c65){var _0x56f870={};var _0x28b3c4={};var _0x6fe862;var _0x5f4675;return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0x3933c7[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x416c65,null))[_0xbe14('0x13')](function(_0x4c4ab9){if(_0x4c4ab9){_0x6fe862=_0x4c4ab9;_0x28b3c4['model']=_[_0xbe14('0x2d')](db[_0xbe14('0x87')][_0xbe14('0x24')]);_0x28b3c4[_0xbe14('0x2e')]=_['keys'](_0x3933c7[_0xbe14('0x2e')]);_0x28b3c4[_0xbe14('0x48')]=_['intersection'](_0x28b3c4[_0xbe14('0x2c')],_0x28b3c4['query']);_0x56f870[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x28b3c4['model'],qs[_0xbe14('0x31')](_0x3933c7[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x56f870[_0xbe14('0x30')]=_0x56f870[_0xbe14('0x30')][_0xbe14('0x32')]?_0x56f870[_0xbe14('0x30')]:_0x28b3c4[_0xbe14('0x2c')];_0x56f870['order']=qs[_0xbe14('0x4c')](_0x3933c7[_0xbe14('0x2e')][_0xbe14('0x4c')]);_0x56f870['where']=qs['filters'](_['pick'](_0x3933c7[_0xbe14('0x2e')],_0x28b3c4[_0xbe14('0x48')]));if(_0x3933c7[_0xbe14('0x2e')]['filter']){_0x56f870['where']=_[_0xbe14('0x40')](_0x56f870[_0xbe14('0x28')],{'$or':_[_0xbe14('0x1a')](_0x56f870[_0xbe14('0x30')],function(_0x2ac6c0){var _0x3d381e={};_0x3d381e[_0x2ac6c0]={'$like':'%'+_0x3933c7[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x3d381e;})});}_0x56f870=_[_0xbe14('0x40')]({},_0x56f870,_0x3933c7['options']);return _0x6fe862[_0xbe14('0x86')](_0x56f870);}})[_0xbe14('0x13')](function(_0x2ca4de){if(_0x2ca4de){_0x5f4675=_0x2ca4de[_0xbe14('0x32')];if(!_0x3933c7[_0xbe14('0x2e')]['hasOwnProperty'](_0xbe14('0x4a'))){_0x56f870['limit']=qs['limit'](_0x3933c7[_0xbe14('0x2e')][_0xbe14('0xf')]);_0x56f870['offset']=qs['offset'](_0x3933c7[_0xbe14('0x2e')][_0xbe14('0xd')]);}return _0x6fe862[_0xbe14('0x86')](_0x56f870);}})[_0xbe14('0x13')](function(_0x2e7c31){if(_0x2e7c31){return _0x2e7c31?{'count':_0x5f4675,'rows':_0x2e7c31}:null;}})['then'](respondWithResult(_0x416c65,null))['catch'](handleError(_0x416c65,null));};exports[_0xbe14('0x88')]=function(_0x4b07fc,_0x76e84){var _0x3f687f=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x4f4b69,_0x43d760;return db['VoiceQueue'][_0xbe14('0x1d')]({'where':{'id':_0x4b07fc[_0xbe14('0x2b')]['id']}})['then'](handleEntityNotFound(_0x76e84,null))[_0xbe14('0x13')](function(_0x30657c){if(_0x30657c){_0x43d760=_0x30657c;return _0x30657c[_0xbe14('0x88')](_0x4b07fc[_0xbe14('0x37')][_0xbe14('0x6a')],_['omit'](_0x4b07fc[_0xbe14('0x37')],[_0xbe14('0x6a'),'id'])||{});}return null;})[_0xbe14('0x82')](function(_0xd97d02){var _0x15082b;_0x4f4b69=_0xd97d02||[];var _0x5d15c7=[];if(_0xd97d02){for(var _0x66b6a7=0x0;_0x66b6a7<_0xd97d02[_0xbe14('0x32')];_0x66b6a7+=0x1){var _0x4dfe2c=_0xd97d02[_0x66b6a7][_0xbe14('0x15')]({'plain':!![]});_0x43d760['dialCheckDuplicateType']=_0x4b07fc[_0xbe14('0x37')][_0xbe14('0x89')]?_0x4b07fc[_0xbe14('0x37')][_0xbe14('0x89')]:_0x43d760[_0xbe14('0x89')];switch(_0x43d760[_0xbe14('0x89')]){case'always':_0x15082b=squel[_0xbe14('0x8a')]()[_0xbe14('0x8b')](_0xbe14('0x8c'))[_0xbe14('0x8d')]([_0xbe14('0x8e'),_0xbe14('0x8f'),_0xbe14('0x90'),_0xbe14('0x91'),_0xbe14('0x4e'),_0xbe14('0x42'),'updatedAt'],squel[_0xbe14('0x6c')]()[_0xbe14('0x6d')]('phone',_0xbe14('0x8e'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x8f'))[_0xbe14('0x6d')]('id',_0xbe14('0x90'))[_0xbe14('0x6d')](_0x4dfe2c[_0xbe14('0x92')][_0xbe14('0x75')](),'ListId')[_0xbe14('0x6d')](_0x4b07fc['params']['id'][_0xbe14('0x75')](),_0xbe14('0x4e'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x42'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x43'))[_0xbe14('0x6f')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0xbe14('0x28')](_0xbe14('0x93'),_0x4dfe2c['CmListId'][_0xbe14('0x75')]())[_0xbe14('0x28')](_0xbe14('0x94'))[_0xbe14('0x28')](_0xbe14('0x95'),squel[_0xbe14('0x6c')]()[_0xbe14('0x6d')](_0xbe14('0x96'))[_0xbe14('0x6f')](_0xbe14('0x97'))[_0xbe14('0x28')]('VoiceQueueId\x20=\x20?',_0x4b07fc[_0xbe14('0x2b')]['id']['toString']()))[_0xbe14('0x28')](_0xbe14('0x95'),squel[_0xbe14('0x6c')]()['field'](_0xbe14('0x98'))[_0xbe14('0x6f')]('cm_hopper')[_0xbe14('0x28')](_0xbe14('0x72'),_0x4b07fc[_0xbe14('0x2b')]['id']['toString']())))[_0xbe14('0x75')]();break;case _0xbe14('0x99'):_0x15082b=squel['insert']()[_0xbe14('0x8b')]('cm_hopper')[_0xbe14('0x8d')]([_0xbe14('0x8e'),_0xbe14('0x8f'),_0xbe14('0x90'),'ListId','VoiceQueueId',_0xbe14('0x42'),_0xbe14('0x43')],squel['select']()['field'](_0xbe14('0x8e'),'phone')[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x8f'))[_0xbe14('0x6d')]('id',_0xbe14('0x90'))[_0xbe14('0x6d')](_0x4dfe2c[_0xbe14('0x92')][_0xbe14('0x75')](),_0xbe14('0x91'))[_0xbe14('0x6d')](_0x4b07fc[_0xbe14('0x2b')]['id']['toString'](),'VoiceQueueId')['field']('\x27'+_0x3f687f+'\x27',_0xbe14('0x42'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x43'))[_0xbe14('0x6f')](_0xbe14('0x9a'))[_0xbe14('0x28')](_0xbe14('0x9b'))[_0xbe14('0x28')](_0xbe14('0x93'),_0x4dfe2c['CmListId'][_0xbe14('0x75')]())[_0xbe14('0x28')](_0xbe14('0x94'))['where'](_0xbe14('0x95'),squel[_0xbe14('0x6c')]()[_0xbe14('0x6d')](_0xbe14('0x98'))[_0xbe14('0x6f')](_0xbe14('0x8c'))[_0xbe14('0x28')]('VoiceQueueId\x20=\x20?',_0x4b07fc[_0xbe14('0x2b')]['id'][_0xbe14('0x75')]())))['toString']();break;default:_0x15082b=squel['insert']()[_0xbe14('0x8b')](_0xbe14('0x8c'))[_0xbe14('0x8d')](['phone',_0xbe14('0x8f'),_0xbe14('0x90'),_0xbe14('0x91'),_0xbe14('0x4e'),_0xbe14('0x42'),_0xbe14('0x43')],squel['select']()[_0xbe14('0x6d')]('phone',_0xbe14('0x8e'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x8f'))['field']('id',_0xbe14('0x90'))[_0xbe14('0x6d')](_0x4dfe2c['CmListId'][_0xbe14('0x75')](),'ListId')[_0xbe14('0x6d')](_0x4b07fc['params']['id'][_0xbe14('0x75')](),'VoiceQueueId')[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x42'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x43'))[_0xbe14('0x6f')]('cm_contacts')[_0xbe14('0x28')](_0xbe14('0x9b'))['where'](_0xbe14('0x93'),_0x4dfe2c[_0xbe14('0x92')]['toString']())[_0xbe14('0x28')](_0xbe14('0x94')))[_0xbe14('0x75')]();}_0x5d15c7['push'](db[_0xbe14('0x60')][_0xbe14('0x2e')](_0x15082b));}return BPromise[_0xbe14('0x7a')](_0x5d15c7);}})[_0xbe14('0x13')](function(){var _0x4bc564=[];var _0x19e7ce=squel[_0xbe14('0x8a')]()[_0xbe14('0x8b')](_0xbe14('0x9c'))[_0xbe14('0x8d')]([_0xbe14('0x9d'),_0xbe14('0x8e'),_0xbe14('0x9e'),_0xbe14('0x42'),'updatedAt'],squel[_0xbe14('0x6c')]()['field']('h.id')[_0xbe14('0x6d')](_0xbe14('0x9f'))['field'](_0xbe14('0xa0'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27','createdAt')[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x43'))[_0xbe14('0x6f')](_0xbe14('0xa1'),'ci')[_0xbe14('0x71')](_0xbe14('0x8c'),'h','h.ContactId=ci.CmContactId')['where'](_0xbe14('0xa2'),_0x3f687f)['where'](_0xbe14('0xa3'),_0xbe14('0xa4')))['toString']();_0x4bc564[_0xbe14('0x74')](db[_0xbe14('0x60')][_0xbe14('0x2e')](_0x19e7ce));return BPromise[_0xbe14('0x7a')](_0x4bc564);})[_0xbe14('0x13')](function(){return _0x4f4b69;})[_0xbe14('0x13')](respondWithResult(_0x76e84,null))[_0xbe14('0x35')](handleError(_0x76e84,null));};exports['removeLists']=function(_0x4ceca6,_0x23f4a3){return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0x4ceca6[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x23f4a3,null))[_0xbe14('0x13')](function(_0x2fe8b0){if(_0x2fe8b0){return _0x2fe8b0[_0xbe14('0xa5')](_0x4ceca6['query'][_0xbe14('0x6a')]);}})[_0xbe14('0x13')](function(_0x186284){if(_0x186284){return db['CmHopper'][_0xbe14('0x14')]({'where':{'ListId':_0x4ceca6[_0xbe14('0x2e')][_0xbe14('0x6a')],'VoiceQueueId':_0x4ceca6[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](function(){return _0x186284;});}})['then'](respondWithStatusCode(_0x23f4a3,null))[_0xbe14('0x35')](handleError(_0x23f4a3,null));};exports[_0xbe14('0xa6')]=function(_0x4c9319,_0x1173f0){var _0x1e0c81={};var _0x5349a7={};var _0x5e3819;var _0x28c5fe;return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0x4c9319['params']['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x1173f0,null))[_0xbe14('0x13')](function(_0x59434a){if(_0x59434a){_0x5e3819=_0x59434a;_0x5349a7[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x87')]['rawAttributes']);_0x5349a7[_0xbe14('0x2e')]=_[_0xbe14('0x2d')](_0x4c9319[_0xbe14('0x2e')]);_0x5349a7[_0xbe14('0x48')]=_[_0xbe14('0x2f')](_0x5349a7[_0xbe14('0x2c')],_0x5349a7[_0xbe14('0x2e')]);_0x1e0c81[_0xbe14('0x30')]=_['intersection'](_0x5349a7[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0x4c9319[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x1e0c81[_0xbe14('0x30')]=_0x1e0c81['attributes'][_0xbe14('0x32')]?_0x1e0c81[_0xbe14('0x30')]:_0x5349a7[_0xbe14('0x2c')];_0x1e0c81[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0x4c9319[_0xbe14('0x2e')]['sort']);_0x1e0c81['where']=qs['filters'](_[_0xbe14('0x4d')](_0x4c9319[_0xbe14('0x2e')],_0x5349a7['filters']));if(_0x4c9319[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x1e0c81[_0xbe14('0x28')]=_[_0xbe14('0x40')](_0x1e0c81['where'],{'$or':_[_0xbe14('0x1a')](_0x1e0c81[_0xbe14('0x30')],function(_0x52bbc1){var _0x2797ef={};_0x2797ef[_0x52bbc1]={'$like':'%'+_0x4c9319['query']['filter']+'%'};return _0x2797ef;})});}_0x1e0c81=_[_0xbe14('0x40')]({},_0x1e0c81,_0x4c9319[_0xbe14('0x34')]);return _0x5e3819[_0xbe14('0xa6')](_0x1e0c81);}})[_0xbe14('0x13')](function(_0x47bba1){if(_0x47bba1){_0x28c5fe=_0x47bba1[_0xbe14('0x32')];if(!_0x4c9319[_0xbe14('0x2e')][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x1e0c81['limit']=qs[_0xbe14('0xf')](_0x4c9319[_0xbe14('0x2e')][_0xbe14('0xf')]);_0x1e0c81[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x4c9319[_0xbe14('0x2e')][_0xbe14('0xd')]);}return _0x5e3819[_0xbe14('0xa6')](_0x1e0c81);}})['then'](function(_0x2592ab){if(_0x2592ab){return _0x2592ab?{'count':_0x28c5fe,'rows':_0x2592ab}:null;}})[_0xbe14('0x13')](respondWithResult(_0x1173f0,null))['catch'](handleError(_0x1173f0,null));};exports['addBlackLists']=function(_0x6a0f29,_0x3d04b9){var _0x21f793;return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0x6a0f29[_0xbe14('0x2b')]['id']}})['then'](handleEntityNotFound(_0x3d04b9,null))[_0xbe14('0x13')](function(_0x37e5e8){if(_0x37e5e8){return _0x37e5e8['addBlackLists'](_0x6a0f29[_0xbe14('0x37')][_0xbe14('0x6a')],_[_0xbe14('0x41')](_0x6a0f29[_0xbe14('0x37')],[_0xbe14('0x6a'),'id'])||{});}return null;})[_0xbe14('0x82')](function(_0x14cec7){var _0x524603;_0x21f793=_0x14cec7||[];var _0x38d720=[];if(_0x14cec7){for(var _0x379446=0x0;_0x379446<_0x14cec7[_0xbe14('0x32')];_0x379446+=0x1){var _0x1489c9=_0x14cec7[_0x379446][_0xbe14('0x15')]({'plain':!![]});_0x524603=squel[_0xbe14('0x8a')]()[_0xbe14('0x8b')](_0xbe14('0xa7'))['fromQuery']([_0xbe14('0x8e'),_0xbe14('0x90'),_0xbe14('0x91'),'VoiceQueueId',_0xbe14('0x42'),_0xbe14('0x43')],squel[_0xbe14('0x6c')]()['field'](_0xbe14('0x8e'),'phone')[_0xbe14('0x6d')]('id',_0xbe14('0x90'))[_0xbe14('0x6d')](_0x1489c9[_0xbe14('0x92')][_0xbe14('0x75')](),_0xbe14('0x91'))[_0xbe14('0x6d')](_0x6a0f29['params']['id'][_0xbe14('0x75')](),_0xbe14('0x4e'))[_0xbe14('0x6d')](_0xbe14('0xa8'),_0xbe14('0x42'))[_0xbe14('0x6d')](_0xbe14('0xa8'),'updatedAt')[_0xbe14('0x6f')](_0xbe14('0x9a'))[_0xbe14('0x28')](_0xbe14('0x9b'))[_0xbe14('0x28')](_0xbe14('0x93'),_0x1489c9[_0xbe14('0x92')][_0xbe14('0x75')]())[_0xbe14('0x28')](_0xbe14('0x94')))[_0xbe14('0x75')]();_0x38d720[_0xbe14('0x74')](db['sequelize'][_0xbe14('0x2e')](_0x524603));}return BPromise[_0xbe14('0x7a')](_0x38d720);}})['then'](function(){return _0x21f793;})['then'](respondWithResult(_0x3d04b9,null))[_0xbe14('0x35')](handleError(_0x3d04b9,null));};exports[_0xbe14('0xa9')]=function(_0x7533c3,_0x3ec670){return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0x7533c3[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x3ec670,null))['then'](function(_0x3ee9e2){if(_0x3ee9e2){return _0x3ee9e2['removeBlackLists'](_0x7533c3[_0xbe14('0x2e')][_0xbe14('0x6a')]);}})[_0xbe14('0x13')](function(_0x1d343a){if(_0x1d343a){return db[_0xbe14('0x57')][_0xbe14('0x14')]({'where':{'ListId':_0x7533c3['query']['ids'],'VoiceQueueId':_0x7533c3['params']['id']}})['then'](function(){return _0x1d343a;});}})['then'](respondWithStatusCode(_0x3ec670,null))[_0xbe14('0x35')](handleError(_0x3ec670,null));}; \ No newline at end of file +var _0xe14b=['QueueCampaigns','outbound','filter','map','value','type','find','name','end','error','stack','index','VoiceQueue','rawAttributes','fieldName','key','getOptions','where','include','show','params','model','keys','query','intersection','attributes','fields','length','includeAll','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoiceQueues','UserProfileSection','autoAssociation','UserProfileResource','clone','merge','omit','createdAt','updatedAt','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','filters','hasOwnProperty','nolimit','order','sort','pick','VoiceQueueId','findAll','rows','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','Agents','online','interface','flatMap','penalty','sequelize','UserVoiceQueue','UserVoiceQueueRt','upsert','isNil','format','voicePause','forEach','emit','userVoiceQueue:save','ids','User','select','field','tq.TeamId','from','team_has_voice_queues','join','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','compact','transaction','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','CmListId','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_contacts','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','h.scheduledat=?','ci.ItemClass=?','PHONE','removeLists','getBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','bluebird','squel','ioredis','../../config/logger','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','Content-Range','update','then','destroy','get','inbound'];(function(_0x668ef9,_0x217ad4){var _0x4641dc=function(_0x551422){while(--_0x551422){_0x668ef9['push'](_0x668ef9['shift']());}};_0x4641dc(++_0x217ad4);}(_0xe14b,0x93));var _0xbe14=function(_0x44ebfe,_0x5c4d5a){_0x44ebfe=_0x44ebfe-0x0;var _0x48d4b8=_0xe14b[_0x44ebfe];return _0x48d4b8;};'use strict';var moment=require(_0xbe14('0x0'));var BPromise=require(_0xbe14('0x1'));var util=require('util');var _=require('lodash');var squel=require(_0xbe14('0x2'));var Redis=require(_0xbe14('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0xbe14('0x4'))('api');var config=require('../../config/environment');var db=require(_0xbe14('0x5'))['db'];config[_0xbe14('0x6')]=_[_0xbe14('0x7')](config[_0xbe14('0x6')],{'host':_0xbe14('0x8'),'port':0x18eb});var socket=require(_0xbe14('0x9'))(new Redis(config[_0xbe14('0x6')]));require('./voiceQueue.socket')['register'](socket);function respondWithStatusCode(_0x496063,_0x30c355){_0x30c355=_0x30c355||0xcc;return function(_0x6fceff){if(_0x6fceff){return _0x496063[_0xbe14('0xa')](_0x30c355);}return _0x496063[_0xbe14('0xb')](_0x30c355)['end']();};}function respondWithResult(_0x5b9fc6,_0x113243){_0x113243=_0x113243||0xc8;return function(_0x3f70cb){if(_0x3f70cb){return _0x5b9fc6['status'](_0x113243)[_0xbe14('0xc')](_0x3f70cb);}};}function respondWithFilteredResult(_0x35aa19,_0x886a5e){return function(_0x3d38c2){if(_0x3d38c2){var _0x27792f=typeof _0x886a5e[_0xbe14('0xd')]===_0xbe14('0xe')&&typeof _0x886a5e[_0xbe14('0xf')]===_0xbe14('0xe');var _0xa2cf72=_0x3d38c2[_0xbe14('0x10')];var _0x33fd54=_0x27792f?0x0:_0x886a5e[_0xbe14('0xd')];var _0x530538=_0x27792f?_0x3d38c2['count']:_0x886a5e[_0xbe14('0xd')]+_0x886a5e[_0xbe14('0xf')];var _0xf4ac9;if(_0x530538>=_0xa2cf72){_0x530538=_0xa2cf72;_0xf4ac9=0xc8;}else{_0xf4ac9=0xce;}_0x35aa19[_0xbe14('0xb')](_0xf4ac9);return _0x35aa19['set'](_0xbe14('0x11'),_0x33fd54+'-'+_0x530538+'/'+_0xa2cf72)[_0xbe14('0xc')](_0x3d38c2);}return null;};}function saveUpdates(_0xfd7b8f){return function(_0x123ede){if(_0x123ede){return _0x123ede[_0xbe14('0x12')](_0xfd7b8f)[_0xbe14('0x13')](function(_0x17ae86){return _0x17ae86;});}return null;};}function removeEntity(_0x5ea1f8){return function(_0x137ee5){if(_0x137ee5){return _0x137ee5[_0xbe14('0x14')]()[_0xbe14('0x13')](function(){var _0x433459=_0x137ee5[_0xbe14('0x15')]({'plain':!![]});var _0x37e4c1=[{'name':'VoiceQueues','value':_0xbe14('0x16'),'ignore':![]},{'name':_0xbe14('0x17'),'value':_0xbe14('0x18'),'ignore':![]}];var _0xc12977=_(_0x37e4c1)[_0xbe14('0x19')]('ignore')[_0xbe14('0x1a')]('value')[_0xbe14('0x1b')]();if(_['includes'](_0xc12977,_0x433459[_0xbe14('0x1c')])){return;}var _0x4a25fa=_[_0xbe14('0x1d')](_0x37e4c1,[_0xbe14('0x1b'),_0x433459['type']])[_0xbe14('0x1e')];return db['UserProfileResource'][_0xbe14('0x14')]({'where':{'type':_0x4a25fa,'resourceId':_0x433459['id']}})['then'](function(){return _0x137ee5;});})[_0xbe14('0x13')](function(){_0x5ea1f8[_0xbe14('0xb')](0xcc)[_0xbe14('0x1f')]();});}};}function handleEntityNotFound(_0x39cc81){return function(_0x15ef02){if(!_0x15ef02){_0x39cc81[_0xbe14('0xa')](0x194);}return _0x15ef02;};}function handleError(_0x55d001,_0x1822e0){_0x1822e0=_0x1822e0||0x1f4;return function(_0x1ba46a){logger[_0xbe14('0x20')](_0x1ba46a[_0xbe14('0x21')]);if(_0x1ba46a['name']){delete _0x1ba46a[_0xbe14('0x1e')];}_0x55d001[_0xbe14('0xb')](_0x1822e0)['send'](_0x1ba46a);};}exports[_0xbe14('0x22')]=function(_0x3b3e84,_0x1c7cc7){var _0x19252f={};var _0x34d648={'count':0x0,'rows':[]};var _0x36d4b2=_[_0xbe14('0x1a')](db[_0xbe14('0x23')][_0xbe14('0x24')],function(_0x16a159){return{'name':_0x16a159[_0xbe14('0x25')],'type':_0x16a159[_0xbe14('0x1c')][_0xbe14('0x26')]};});_0x19252f=qs[_0xbe14('0x27')](_0x36d4b2,_0x3b3e84);var _0x223f7a={'where':_0x19252f[_0xbe14('0x28')]};return db[_0xbe14('0x23')][_0xbe14('0x10')](_0x223f7a)[_0xbe14('0x13')](function(_0x14e7c4){_0x34d648['count']=_0x14e7c4;_0x19252f[_0xbe14('0x29')]=qs['include'](_0x3b3e84['query']);return db[_0xbe14('0x23')]['findAll'](_0x19252f);})[_0xbe14('0x13')](function(_0x345b0){_0x34d648['rows']=_0x345b0;return _0x34d648;})['then'](respondWithFilteredResult(_0x1c7cc7,_0x19252f))['catch'](handleError(_0x1c7cc7,null));};exports[_0xbe14('0x2a')]=function(_0xa3d24,_0x5f27b6){var _0x46c570={'raw':![],'where':{'id':_0xa3d24[_0xbe14('0x2b')]['id']}},_0x1faf3e={};_0x1faf3e[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db['VoiceQueue']['rawAttributes']);_0x1faf3e[_0xbe14('0x2e')]=_['keys'](_0xa3d24['query']);_0x1faf3e['filters']=_[_0xbe14('0x2f')](_0x1faf3e[_0xbe14('0x2c')],_0x1faf3e[_0xbe14('0x2e')]);_0x46c570[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x1faf3e[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0xa3d24[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x46c570[_0xbe14('0x30')]=_0x46c570[_0xbe14('0x30')][_0xbe14('0x32')]?_0x46c570['attributes']:_0x1faf3e['model'];if(_0xa3d24[_0xbe14('0x2e')][_0xbe14('0x33')]){_0x46c570[_0xbe14('0x29')]=[{'all':!![]}];}_0x46c570=_['merge']({},_0x46c570,_0xa3d24[_0xbe14('0x34')]);return db[_0xbe14('0x23')][_0xbe14('0x1d')](_0x46c570)[_0xbe14('0x13')](handleEntityNotFound(_0x5f27b6,null))[_0xbe14('0x13')](respondWithResult(_0x5f27b6,null))[_0xbe14('0x35')](handleError(_0x5f27b6,null));};exports[_0xbe14('0x36')]=function(_0x128843,_0x1b2608){return db['VoiceQueue'][_0xbe14('0x36')](_0x128843[_0xbe14('0x37')],{})[_0xbe14('0x13')](function(_0x1b3118){var _0x3287b9=_0x128843[_0xbe14('0x38')]['get']({'plain':!![]});if(!_0x3287b9)throw new Error(_0xbe14('0x39'));if(_0x3287b9[_0xbe14('0x3a')]===_0xbe14('0x38')){var _0x36263c=_0x1b3118['get']({'plain':!![]});var _0x4bfa96=[{'name':_0xbe14('0x3b'),'value':_0xbe14('0x16')},{'name':_0xbe14('0x17'),'value':'outbound'}];var _0x5d5318=_[_0xbe14('0x1d')](_0x4bfa96,['value',_0x36263c['type']])[_0xbe14('0x1e')];return db[_0xbe14('0x3c')][_0xbe14('0x1d')]({'where':{'name':_0x5d5318,'userProfileId':_0x3287b9['userProfileId']},'raw':!![]})['then'](function(_0x5aaa4f){if(_0x5aaa4f&&_0x5aaa4f[_0xbe14('0x3d')]===0x0){return db[_0xbe14('0x3e')][_0xbe14('0x36')]({'name':_0x36263c['name'],'resourceId':_0x36263c['id'],'type':_0x5aaa4f[_0xbe14('0x1e')],'sectionId':_0x5aaa4f['id']},{})[_0xbe14('0x13')](function(){return _0x1b3118;});}else{return _0x1b3118;}})[_0xbe14('0x35')](function(_0x3ab0f6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ab0f6);throw _0x3ab0f6;});}return _0x1b3118;})[_0xbe14('0x13')](respondWithResult(_0x1b2608,0xc9))[_0xbe14('0x35')](handleError(_0x1b2608,null));};exports[_0xbe14('0x3f')]=function(_0xb2b285,_0x2550dc){var _0x4f2d95={'where':{'id':_0xb2b285[_0xbe14('0x2b')]['id']}},_0x51023a={};_0x51023a[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x23')]['rawAttributes']);_0x4f2d95[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x51023a['model'],qs[_0xbe14('0x31')](_0xb2b285[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x4f2d95[_0xbe14('0x30')]=_0x4f2d95['attributes']['length']?_0x4f2d95[_0xbe14('0x30')]:_0x51023a[_0xbe14('0x2c')];if(_0xb2b285['query']['includeAll']){_0x4f2d95[_0xbe14('0x29')]=[{'all':!![]}];}_0x4f2d95=_[_0xbe14('0x40')]({},_0x4f2d95,_0xb2b285[_0xbe14('0x34')]);return db[_0xbe14('0x23')][_0xbe14('0x1d')](_0x4f2d95)[_0xbe14('0x13')](handleEntityNotFound(_0x2550dc,null))[_0xbe14('0x13')](function(_0x5a4068){if(_0x5a4068){var _0xf32e93=_0x5a4068[_0xbe14('0x15')]({'plain':!![]});_0xf32e93=qs[_0xbe14('0x41')](_0xf32e93,['id',_0xbe14('0x42'),_0xbe14('0x43')]);_0xb2b285['body']=_[_0xbe14('0x41')](_0xb2b285[_0xbe14('0x37')],['id',_0xbe14('0x42'),_0xbe14('0x43')]);return db[_0xbe14('0x23')][_0xbe14('0x36')](_['merge'](_0xf32e93,_0xb2b285['body']),{'include':_0xb2b285[_0xbe14('0x2e')][_0xbe14('0x33')]?[{'all':!![]}]:undefined})[_0xbe14('0x13')](function(_0x48554a){var _0x497b00=_0xb2b285[_0xbe14('0x38')][_0xbe14('0x15')]({'plain':!![]});if(!_0x497b00)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x497b00[_0xbe14('0x3a')]===_0xbe14('0x38')){var _0x50c2a0=_0x48554a[_0xbe14('0x15')]({'plain':!![]});var _0x4a40d2=[{'name':_0xbe14('0x3b'),'value':_0xbe14('0x16')},{'name':_0xbe14('0x17'),'value':'outbound'}];var _0x435c8d=_[_0xbe14('0x1d')](_0x4a40d2,['value',_0x50c2a0[_0xbe14('0x1c')]])[_0xbe14('0x1e')];return db[_0xbe14('0x3c')][_0xbe14('0x1d')]({'where':{'name':_0x435c8d,'userProfileId':_0x497b00[_0xbe14('0x44')]},'raw':!![]})['then'](function(_0x42a346){if(_0x42a346&&_0x42a346[_0xbe14('0x3d')]===0x0){return db[_0xbe14('0x3e')][_0xbe14('0x36')]({'name':_0x50c2a0[_0xbe14('0x1e')],'resourceId':_0x50c2a0['id'],'type':_0x42a346[_0xbe14('0x1e')],'sectionId':_0x42a346['id']},{})[_0xbe14('0x13')](function(){return _0x48554a;});}else{return _0x48554a;}})['catch'](function(_0x72c875){logger[_0xbe14('0x20')](_0xbe14('0x45'),_0x72c875);throw _0x72c875;});}return _0x48554a;});}})[_0xbe14('0x13')](respondWithResult(_0x2550dc,0xc9))[_0xbe14('0x35')](handleError(_0x2550dc,null));};exports[_0xbe14('0x12')]=function(_0xd8f78f,_0x32df3c){if(_0xd8f78f[_0xbe14('0x37')]['id']){delete _0xd8f78f[_0xbe14('0x37')]['id'];}return db[_0xbe14('0x23')]['find']({'where':{'id':_0xd8f78f['params']['id']}})['then'](handleEntityNotFound(_0x32df3c,null))[_0xbe14('0x13')](saveUpdates(_0xd8f78f[_0xbe14('0x37')],null))[_0xbe14('0x13')](respondWithResult(_0x32df3c,null))[_0xbe14('0x35')](handleError(_0x32df3c,null));};exports[_0xbe14('0x14')]=function(_0x66ddf,_0x16ee48){return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0x66ddf[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x16ee48,null))[_0xbe14('0x13')](removeEntity(_0x16ee48,null))[_0xbe14('0x35')](handleError(_0x16ee48,null));};exports[_0xbe14('0x46')]=function(_0x1c831a,_0xcef8e3){var _0x179077={'raw':![],'where':{}};var _0x2225d9={};var _0x29761b={'count':0x0,'rows':[]};return db[_0xbe14('0x23')]['findOne']({'where':{'id':_0x1c831a[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0xcef8e3,null))[_0xbe14('0x13')](function(_0x46b49c){if(_0x46b49c){_0x2225d9[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x47')][_0xbe14('0x24')]);_0x2225d9[_0xbe14('0x2e')]=_[_0xbe14('0x2d')](_0x1c831a['query']);_0x2225d9[_0xbe14('0x48')]=_[_0xbe14('0x2f')](_0x2225d9[_0xbe14('0x2c')],_0x2225d9[_0xbe14('0x2e')]);_0x179077[_0xbe14('0x30')]=_['intersection'](_0x2225d9[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0x1c831a[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x179077[_0xbe14('0x30')]=_0x179077['attributes'][_0xbe14('0x32')]?_0x179077[_0xbe14('0x30')]:_0x2225d9[_0xbe14('0x2c')];if(!_0x1c831a[_0xbe14('0x2e')][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x179077[_0xbe14('0xf')]=qs[_0xbe14('0xf')](_0x1c831a['query'][_0xbe14('0xf')]);_0x179077[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x1c831a[_0xbe14('0x2e')][_0xbe14('0xd')]);}_0x179077[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0x1c831a['query']['sort']);_0x179077[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_[_0xbe14('0x4d')](_0x1c831a[_0xbe14('0x2e')],_0x2225d9[_0xbe14('0x48')]));_0x179077[_0xbe14('0x28')][_0xbe14('0x4e')]=_0x46b49c['id'];if(_0x1c831a[_0xbe14('0x2e')]['filter']){_0x179077['where']=_[_0xbe14('0x40')](_0x179077[_0xbe14('0x28')],{'$or':_[_0xbe14('0x1a')](_0x179077['attributes'],function(_0x76e91e){var _0x16bca1={};_0x16bca1[_0x76e91e]={'$like':'%'+_0x1c831a[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x16bca1;})});}_0x179077=_[_0xbe14('0x40')]({},_0x179077,_0x1c831a[_0xbe14('0x34')]);return db[_0xbe14('0x47')]['count']({'where':_0x179077[_0xbe14('0x28')]})[_0xbe14('0x13')](function(_0x3baa26){_0x29761b[_0xbe14('0x10')]=_0x3baa26;if(_0x1c831a[_0xbe14('0x2e')][_0xbe14('0x33')]){_0x179077[_0xbe14('0x29')]=[{'all':!![]}];}return db['CmHopper'][_0xbe14('0x4f')](_0x179077);})[_0xbe14('0x13')](function(_0x3cd17e){_0x29761b[_0xbe14('0x50')]=_0x3cd17e;return _0x29761b;});}})[_0xbe14('0x13')](respondWithFilteredResult(_0xcef8e3,_0x179077))[_0xbe14('0x35')](handleError(_0xcef8e3,null));};exports[_0xbe14('0x51')]=function(_0xd756b2,_0x5d064e){var _0x1e5ce1={'raw':!![],'where':{}};var _0x401968={};var _0x362999={'count':0x0,'rows':[]};return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0xd756b2[_0xbe14('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5d064e,null))[_0xbe14('0x13')](function(_0x175213){if(_0x175213){_0x401968[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db['CmHopperHistory'][_0xbe14('0x24')]);_0x401968[_0xbe14('0x2e')]=_[_0xbe14('0x2d')](_0xd756b2[_0xbe14('0x2e')]);_0x401968[_0xbe14('0x48')]=_[_0xbe14('0x2f')](_0x401968[_0xbe14('0x2c')],_0x401968['query']);_0x1e5ce1[_0xbe14('0x30')]=_['intersection'](_0x401968[_0xbe14('0x2c')],qs['fields'](_0xd756b2[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x1e5ce1[_0xbe14('0x30')]=_0x1e5ce1['attributes'][_0xbe14('0x32')]?_0x1e5ce1[_0xbe14('0x30')]:_0x401968[_0xbe14('0x2c')];if(!_0xd756b2['query'][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x1e5ce1[_0xbe14('0xf')]=qs[_0xbe14('0xf')](_0xd756b2['query'][_0xbe14('0xf')]);_0x1e5ce1[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0xd756b2[_0xbe14('0x2e')][_0xbe14('0xd')]);}_0x1e5ce1[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0xd756b2['query'][_0xbe14('0x4c')]);_0x1e5ce1[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_['pick'](_0xd756b2[_0xbe14('0x2e')],_0x401968[_0xbe14('0x48')]));_0x1e5ce1[_0xbe14('0x28')]['VoiceQueueId']=_0x175213['id'];if(_0xd756b2[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x1e5ce1['where']=_[_0xbe14('0x40')](_0x1e5ce1['where'],{'$or':_[_0xbe14('0x1a')](_0x1e5ce1[_0xbe14('0x30')],function(_0x4dfa19){var _0x55d729={};_0x55d729[_0x4dfa19]={'$like':'%'+_0xd756b2[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x55d729;})});}_0x1e5ce1=_[_0xbe14('0x40')]({},_0x1e5ce1,_0xd756b2['options']);return db[_0xbe14('0x53')][_0xbe14('0x10')]({'where':_0x1e5ce1[_0xbe14('0x28')]})[_0xbe14('0x13')](function(_0x5ee624){_0x362999['count']=_0x5ee624;if(_0xd756b2[_0xbe14('0x2e')][_0xbe14('0x33')]){_0x1e5ce1[_0xbe14('0x29')]=[{'all':!![]}];}return db[_0xbe14('0x53')][_0xbe14('0x4f')](_0x1e5ce1);})[_0xbe14('0x13')](function(_0x139aab){_0x362999['rows']=_0x139aab;return _0x362999;});}})[_0xbe14('0x13')](respondWithFilteredResult(_0x5d064e,_0x1e5ce1))['catch'](handleError(_0x5d064e,null));};exports[_0xbe14('0x54')]=function(_0x3a01bb,_0x8d47f2){var _0x2382c4={'raw':!![],'where':{}};var _0x55a3ae={};var _0x1e160b={'count':0x0,'rows':[]};return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0x3a01bb['params']['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x8d47f2,null))[_0xbe14('0x13')](function(_0x4090bc){if(_0x4090bc){_0x55a3ae[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x55')][_0xbe14('0x24')]);_0x55a3ae[_0xbe14('0x2e')]=_[_0xbe14('0x2d')](_0x3a01bb[_0xbe14('0x2e')]);_0x55a3ae[_0xbe14('0x48')]=_[_0xbe14('0x2f')](_0x55a3ae[_0xbe14('0x2c')],_0x55a3ae[_0xbe14('0x2e')]);_0x2382c4[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x55a3ae[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x2382c4['attributes']=_0x2382c4[_0xbe14('0x30')]['length']?_0x2382c4[_0xbe14('0x30')]:_0x55a3ae[_0xbe14('0x2c')];if(!_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x2382c4['limit']=qs['limit'](_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0xf')]);_0x2382c4[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x3a01bb['query'][_0xbe14('0xd')]);}_0x2382c4[_0xbe14('0x4b')]=qs['sort'](_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0x4c')]);_0x2382c4[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_['pick'](_0x3a01bb[_0xbe14('0x2e')],_0x55a3ae['filters']));_0x2382c4['where'][_0xbe14('0x4e')]=_0x4090bc['id'];if(_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x2382c4[_0xbe14('0x28')]=_[_0xbe14('0x40')](_0x2382c4['where'],{'$or':_[_0xbe14('0x1a')](_0x2382c4[_0xbe14('0x30')],function(_0x5dc793){var _0x4e35ed={};_0x4e35ed[_0x5dc793]={'$like':'%'+_0x3a01bb[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x4e35ed;})});}_0x2382c4=_['merge']({},_0x2382c4,_0x3a01bb[_0xbe14('0x34')]);return db['CmHopperFinal'][_0xbe14('0x10')]({'where':_0x2382c4['where']})[_0xbe14('0x13')](function(_0x5d4431){_0x1e160b[_0xbe14('0x10')]=_0x5d4431;if(_0x3a01bb['query'][_0xbe14('0x33')]){_0x2382c4[_0xbe14('0x29')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x2382c4);})[_0xbe14('0x13')](function(_0x4db7e8){_0x1e160b['rows']=_0x4db7e8;return _0x1e160b;});}})[_0xbe14('0x13')](respondWithFilteredResult(_0x8d47f2,_0x2382c4))[_0xbe14('0x35')](handleError(_0x8d47f2,null));};exports[_0xbe14('0x56')]=function(_0x11c341,_0x1a780a){var _0x313a87={'raw':!![],'where':{}};var _0x30d2b0={};var _0x57ad22={'count':0x0,'rows':[]};return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0x11c341[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x1a780a,null))['then'](function(_0x26372a){if(_0x26372a){_0x30d2b0[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db['CmHopperBlack'][_0xbe14('0x24')]);_0x30d2b0[_0xbe14('0x2e')]=_['keys'](_0x11c341[_0xbe14('0x2e')]);_0x30d2b0['filters']=_[_0xbe14('0x2f')](_0x30d2b0[_0xbe14('0x2c')],_0x30d2b0[_0xbe14('0x2e')]);_0x313a87['attributes']=_[_0xbe14('0x2f')](_0x30d2b0['model'],qs[_0xbe14('0x31')](_0x11c341['query']['fields']));_0x313a87[_0xbe14('0x30')]=_0x313a87['attributes'][_0xbe14('0x32')]?_0x313a87['attributes']:_0x30d2b0[_0xbe14('0x2c')];if(!_0x11c341[_0xbe14('0x2e')][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x313a87[_0xbe14('0xf')]=qs[_0xbe14('0xf')](_0x11c341[_0xbe14('0x2e')][_0xbe14('0xf')]);_0x313a87[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x11c341[_0xbe14('0x2e')][_0xbe14('0xd')]);}_0x313a87[_0xbe14('0x4b')]=qs['sort'](_0x11c341[_0xbe14('0x2e')][_0xbe14('0x4c')]);_0x313a87[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_[_0xbe14('0x4d')](_0x11c341['query'],_0x30d2b0['filters']));_0x313a87[_0xbe14('0x28')][_0xbe14('0x4e')]=_0x26372a['id'];if(_0x11c341[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x313a87[_0xbe14('0x28')]=_[_0xbe14('0x40')](_0x313a87[_0xbe14('0x28')],{'$or':_[_0xbe14('0x1a')](_0x313a87[_0xbe14('0x30')],function(_0x26e7a7){var _0x761b3d={};_0x761b3d[_0x26e7a7]={'$like':'%'+_0x11c341[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x761b3d;})});}_0x313a87=_[_0xbe14('0x40')]({},_0x313a87,_0x11c341[_0xbe14('0x34')]);return db[_0xbe14('0x57')][_0xbe14('0x10')]({'where':_0x313a87[_0xbe14('0x28')]})[_0xbe14('0x13')](function(_0x28a1e9){_0x57ad22[_0xbe14('0x10')]=_0x28a1e9;if(_0x11c341[_0xbe14('0x2e')][_0xbe14('0x33')]){_0x313a87[_0xbe14('0x29')]=[{'all':!![]}];}return db[_0xbe14('0x57')]['findAll'](_0x313a87);})[_0xbe14('0x13')](function(_0x3303a4){_0x57ad22[_0xbe14('0x50')]=_0x3303a4;return _0x57ad22;});}})[_0xbe14('0x13')](respondWithFilteredResult(_0x1a780a,_0x313a87))[_0xbe14('0x35')](handleError(_0x1a780a,null));};exports[_0xbe14('0x58')]=function(_0x52b75d,_0x5b161c){var _0x165b7a={};var _0x4a44e0={};var _0x3730d1;var _0x4babba;return db[_0xbe14('0x23')]['findOne']({'where':{'id':_0x52b75d[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x5b161c,null))[_0xbe14('0x13')](function(_0x12498f){if(_0x12498f){_0x3730d1=_0x12498f;_0x4a44e0[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x59')][_0xbe14('0x24')]);_0x4a44e0[_0xbe14('0x2e')]=_['keys'](_0x52b75d[_0xbe14('0x2e')]);_0x4a44e0[_0xbe14('0x48')]=_[_0xbe14('0x2f')](_0x4a44e0[_0xbe14('0x2c')],_0x4a44e0['query']);_0x165b7a[_0xbe14('0x30')]=_['intersection'](_0x4a44e0[_0xbe14('0x2c')],qs['fields'](_0x52b75d[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x165b7a[_0xbe14('0x30')]=_0x165b7a['attributes'][_0xbe14('0x32')]?_0x165b7a['attributes']:_0x4a44e0[_0xbe14('0x2c')];_0x165b7a[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0x52b75d[_0xbe14('0x2e')][_0xbe14('0x4c')]);_0x165b7a[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_[_0xbe14('0x4d')](_0x52b75d[_0xbe14('0x2e')],_0x4a44e0['filters']));if(_0x52b75d[_0xbe14('0x2e')]['filter']){_0x165b7a[_0xbe14('0x28')]=_[_0xbe14('0x40')](_0x165b7a[_0xbe14('0x28')],{'$or':_['map'](_0x165b7a[_0xbe14('0x30')],function(_0x1c5fbc){var _0x219403={};_0x219403[_0x1c5fbc]={'$like':'%'+_0x52b75d[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x219403;})});}_0x165b7a=_['merge']({},_0x165b7a,_0x52b75d['options']);return _0x3730d1[_0xbe14('0x58')](_0x165b7a);}})['then'](function(_0x16b1c8){if(_0x16b1c8){_0x4babba=_0x16b1c8[_0xbe14('0x32')];if(!_0x52b75d[_0xbe14('0x2e')][_0xbe14('0x49')]('nolimit')){_0x165b7a[_0xbe14('0xf')]=qs[_0xbe14('0xf')](_0x52b75d['query'][_0xbe14('0xf')]);_0x165b7a[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x52b75d[_0xbe14('0x2e')]['offset']);}return _0x3730d1[_0xbe14('0x58')](_0x165b7a);}})[_0xbe14('0x13')](function(_0x37aff6){if(_0x37aff6){return _0x37aff6?{'count':_0x4babba,'rows':_0x37aff6}:null;}})[_0xbe14('0x13')](respondWithResult(_0x5b161c,null))[_0xbe14('0x35')](handleError(_0x5b161c,null));};exports[_0xbe14('0x5a')]=function(_0x208fae,_0x310d42){var _0x9c229f=_0x208fae[_0xbe14('0x37')]['teams'];var _0xdb5515=_[_0xbe14('0x1a')](_0x9c229f,'id');return db[_0xbe14('0x59')][_0xbe14('0x4f')]({'where':{'id':_0xdb5515},'attributes':['id'],'include':[{'model':db['User'],'as':_0xbe14('0x5b'),'attributes':['id',_0xbe14('0x1e'),_0xbe14('0x5c'),'voicePause',_0xbe14('0x5d')],'raw':!![]}]})[_0xbe14('0x13')](function(_0x1ec868){if(_0x1ec868){var _0x1a7321=_[_0xbe14('0x5e')](_0x1ec868,function(_0x2306f6){var _0x426189=_0x2306f6['get']({'plain':!![]});_0x426189[_0xbe14('0x5b')]['forEach'](function(_0x24d528){_0x24d528[_0xbe14('0x5f')]=_[_0xbe14('0x1d')](_0x9c229f,{'id':_0x426189['id']})[_0xbe14('0x5f')];});return _0x426189[_0xbe14('0x5b')];});return db['VoiceQueue']['find']({'where':{'id':_0x208fae[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](function(_0x29a892){return db[_0xbe14('0x60')]['transaction'](function(_0x46a251){return _0x29a892[_0xbe14('0x5a')](_0xdb5515,{'transaction':_0x46a251})[_0xbe14('0x13')](function(){return BPromise['each'](_0x9c229f,function(_0xe69b0e){return db['TeamVoiceQueue']['upsert']({'TeamId':_0xe69b0e['id'],'VoiceQueueId':_0x208fae[_0xbe14('0x2b')]['id'],'penalty':_0xe69b0e[_0xbe14('0x5f')]},{'transaction':_0x46a251});});})[_0xbe14('0x13')](function(){return BPromise['each'](_0x1a7321,function(_0x3ea9c2){return db[_0xbe14('0x61')]['findOrCreate']({'where':{'UserId':_0x3ea9c2['id'],'VoiceQueueId':_0x208fae[_0xbe14('0x2b')]['id']},'defaults':{'penalty':_0x3ea9c2[_0xbe14('0x5f')]},'transaction':_0x46a251});});})[_0xbe14('0x13')](function(){return BPromise['each'](_[_0xbe14('0x19')](_0x1a7321,{'online':!![]}),function(_0x1e2559){return db[_0xbe14('0x62')][_0xbe14('0x63')]({'membername':_0x1e2559[_0xbe14('0x1e')],'UserId':_0x1e2559['id'],'queue_name':_0x29a892['name'],'VoiceQueueId':_0x29a892['id'],'interface':_[_0xbe14('0x64')](_0x1e2559[_0xbe14('0x5d')])?util[_0xbe14('0x65')]('SIP/%s',_0x1e2559[_0xbe14('0x1e')]):_0x1e2559[_0xbe14('0x5d')],'paused':_0x1e2559[_0xbe14('0x66')]||![],'penalty':_0x1e2559[_0xbe14('0x5f')]},{'transaction':_0x46a251});});})[_0xbe14('0x13')](function(){_0x1a7321[_0xbe14('0x67')](function(_0x1b22a0){socket[_0xbe14('0x68')](_0xbe14('0x69'),{'UserId':_0x1b22a0['id'],'VoiceQueueId':_0x29a892['id']});});});});});}})[_0xbe14('0x13')](respondWithStatusCode(_0x310d42,null))[_0xbe14('0x35')](handleError(_0x310d42,null));};exports['removeTeams']=function(_0xf549ec,_0x2c3647){return db[_0xbe14('0x59')]['findAll']({'where':{'id':_0xf549ec[_0xbe14('0x2e')][_0xbe14('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xbe14('0x6b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xbe14('0x13')](handleEntityNotFound(_0x2c3647,null))['then'](function(_0x2d4b18){var _0xcd8cf6=_['map'](_0x2d4b18,'id');var _0x269e5a=[];var _0x4c7e2b=[];var _0x587f58=squel[_0xbe14('0x6c')]();_0x587f58[_0xbe14('0x6d')](_0xbe14('0x6e'))[_0xbe14('0x6f')](_0xbe14('0x70'),'tq')[_0xbe14('0x71')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xbe14('0x28')](_0xbe14('0x72'),_0xf549ec[_0xbe14('0x2b')]['id']);for(var _0x3c23fc=0x0;_0x3c23fc<_0x2d4b18['length'];_0x3c23fc+=0x1){let _0x1d5333=_0x2d4b18[_0x3c23fc];for(var _0x4cb29c=0x0;_0x4cb29c<_0x1d5333[_0xbe14('0x5b')][_0xbe14('0x32')];_0x4cb29c+=0x1){let _0x5270b2=_0x1d5333[_0xbe14('0x5b')][_0x4cb29c];var _0x273df5=_0x587f58[_0xbe14('0x3f')]();_0x273df5[_0xbe14('0x28')](_0xbe14('0x73'),_0x5270b2['id']);_0x4c7e2b[_0xbe14('0x74')](db[_0xbe14('0x60')][_0xbe14('0x2e')](_0x273df5[_0xbe14('0x75')](),{'type':db[_0xbe14('0x60')][_0xbe14('0x76')][_0xbe14('0x77')]})['then'](function(_0x20f196){if(_0x20f196[_0xbe14('0x32')]===0x1){return _0x5270b2['id'];}else{var _0x1eb33b=_[_0xbe14('0x78')](_['map'](_0x20f196,_0xbe14('0x79')),function(_0xede1c1){return _['includes'](_0xcd8cf6,_0xede1c1);});if(_0x1eb33b){return _0x5270b2['id'];}}}));}}return BPromise[_0xbe14('0x7a')](_0x4c7e2b)[_0xbe14('0x13')](function(_0x11085c){_0x269e5a=_(_0x269e5a)['union'](_0x11085c)[_0xbe14('0x7b')]()[_0xbe14('0x1b')]();return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0xf549ec[_0xbe14('0x2b')]['id']}})['then'](function(_0x23208d){return db[_0xbe14('0x60')][_0xbe14('0x7c')](function(_0x3f7732){return _0x23208d[_0xbe14('0x7d')](_0xf549ec['query'][_0xbe14('0x6a')],{'transaction':_0x3f7732})[_0xbe14('0x13')](function(){if(!_[_0xbe14('0x7e')](_0x269e5a)){return _0x23208d[_0xbe14('0x7f')](_0x269e5a,{'transaction':_0x3f7732})[_0xbe14('0x13')](function(){return db[_0xbe14('0x62')][_0xbe14('0x14')]({'where':{'VoiceQueueId':_0xf549ec[_0xbe14('0x2b')]['id'],'UserId':_0x269e5a},'transaction':_0x3f7732});});}})['then'](function(){_0x269e5a['forEach'](function(_0x129ef6){socket[_0xbe14('0x68')](_0xbe14('0x80'),{'UserId':_0x129ef6,'VoiceQueueId':_0x23208d['id']});});});});});});})[_0xbe14('0x13')](respondWithStatusCode(_0x2c3647,null))[_0xbe14('0x35')](handleError(_0x2c3647,null));};exports['addAgents']=function(_0x15c93c,_0xf6ff8){var _0x3eaabe,_0x1ea11a;return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0x15c93c[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0xf6ff8,null))['then'](function(_0xf6da38){if(_0xf6da38){_0x1ea11a=_0xf6da38;return _0xf6da38[_0xbe14('0x81')](_0x15c93c['body']['ids'],_[_0xbe14('0x41')](_0x15c93c['body'],[_0xbe14('0x6a'),'id'])||{})[_0xbe14('0x82')](function(_0x776e93){for(var _0x3f5ca3=0x0;_0x3f5ca3<_0x15c93c[_0xbe14('0x37')]['ids'][_0xbe14('0x32')];_0x3f5ca3+=0x1){socket[_0xbe14('0x68')](_0xbe14('0x69'),{'UserId':Number(_0x15c93c[_0xbe14('0x37')][_0xbe14('0x6a')][_0x3f5ca3]),'VoiceQueueId':Number(_0x15c93c[_0xbe14('0x2b')]['id'])});}return _0x776e93;});}})['then'](function(_0x4eea48){_0x3eaabe=_0x4eea48||[];if(_0x1ea11a){return db[_0xbe14('0x6b')]['findAll']({'where':{'id':_0x15c93c[_0xbe14('0x37')][_0xbe14('0x6a')]},'attributes':['id',_0xbe14('0x1e'),'online',_0xbe14('0x66'),_0xbe14('0x5d')],'raw':!![]});}})[_0xbe14('0x13')](function(_0x1ad15d){if(!_[_0xbe14('0x7e')](_0x1ad15d)){var _0x2e5106=[];for(var _0x156fb3=0x0;_0x156fb3<_0x1ad15d['length'];_0x156fb3++){if(_0x1ad15d[_0x156fb3][_0xbe14('0x5c')]){_0x2e5106['push'](db['UserVoiceQueueRt']['upsert']({'membername':_0x1ad15d[_0x156fb3]['name'],'UserId':_0x1ad15d[_0x156fb3]['id'],'queue_name':_0x1ea11a[_0xbe14('0x1e')],'VoiceQueueId':_0x1ea11a['id'],'interface':_[_0xbe14('0x64')](_0x1ad15d[_0x156fb3]['interface'])?util[_0xbe14('0x65')]('SIP/%s',_0x1ad15d[_0x156fb3][_0xbe14('0x1e')]):_0x1ad15d[_0x156fb3]['interface'],'paused':_0x1ad15d[_0x156fb3][_0xbe14('0x66')]||![],'penalty':_0x15c93c[_0xbe14('0x37')][_0xbe14('0x5f')]||0x0}));}}return BPromise[_0xbe14('0x7a')](_0x2e5106);}})[_0xbe14('0x13')](function(){return _0x3eaabe;})['then'](respondWithResult(_0xf6ff8,null))[_0xbe14('0x35')](handleError(_0xf6ff8,null));};exports[_0xbe14('0x7f')]=function(_0x3aaa54,_0x413893){return db['VoiceQueue']['find']({'where':{'id':_0x3aaa54['params']['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x413893,null))[_0xbe14('0x13')](function(_0x3826cf){if(_0x3826cf){return _0x3826cf[_0xbe14('0x7f')](_0x3aaa54[_0xbe14('0x2e')]['ids'])['then'](function(){if(_[_0xbe14('0x83')](_0x3aaa54[_0xbe14('0x2e')][_0xbe14('0x6a')])){for(var _0x26092b=0x0;_0x26092b<_0x3aaa54[_0xbe14('0x2e')]['ids'][_0xbe14('0x32')];_0x26092b+=0x1){socket['emit'](_0xbe14('0x80'),{'UserId':Number(_0x3aaa54[_0xbe14('0x2e')][_0xbe14('0x6a')][_0x26092b]),'VoiceQueueId':Number(_0x3aaa54[_0xbe14('0x2b')]['id'])});}}else{socket['emit'](_0xbe14('0x80'),{'UserId':Number(_0x3aaa54[_0xbe14('0x2e')][_0xbe14('0x6a')]),'VoiceQueueId':Number(_0x3aaa54[_0xbe14('0x2b')]['id'])});}});}})['then'](function(_0x44c341){return db[_0xbe14('0x62')][_0xbe14('0x14')]({'where':{'VoiceQueueId':_0x3aaa54['params']['id'],'UserId':_0x3aaa54['query'][_0xbe14('0x6a')]}})[_0xbe14('0x13')](function(){return _0x44c341;});})[_0xbe14('0x13')](respondWithStatusCode(_0x413893,null))['catch'](handleError(_0x413893,null));};exports[_0xbe14('0x84')]=function(_0x2f0d14,_0x180e61){var _0x952322={};var _0x3ae00b={};var _0x41962a;var _0x4ebf01;return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0x2f0d14[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x180e61,null))[_0xbe14('0x13')](function(_0x5f28dd){if(_0x5f28dd){_0x41962a=_0x5f28dd;_0x3ae00b['model']=_[_0xbe14('0x2d')](db['User'][_0xbe14('0x24')]);_0x3ae00b['query']=_[_0xbe14('0x2d')](_0x2f0d14[_0xbe14('0x2e')]);_0x3ae00b[_0xbe14('0x48')]=_['intersection'](_0x3ae00b[_0xbe14('0x2c')],_0x3ae00b[_0xbe14('0x2e')]);_0x952322[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x3ae00b[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x952322[_0xbe14('0x30')]=_0x952322[_0xbe14('0x30')]['length']?_0x952322[_0xbe14('0x30')]:_0x3ae00b[_0xbe14('0x2c')];_0x952322[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0x4c')]);_0x952322[_0xbe14('0x28')]=qs[_0xbe14('0x48')](_['pick'](_0x2f0d14[_0xbe14('0x2e')],_0x3ae00b[_0xbe14('0x48')]));if(_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x952322[_0xbe14('0x28')]=_[_0xbe14('0x40')](_0x952322['where'],{'$or':_['map'](_0x952322['attributes'],function(_0x598ccc){var _0x446b3f={};_0x446b3f[_0x598ccc]={'$like':'%'+_0x2f0d14[_0xbe14('0x2e')]['filter']+'%'};return _0x446b3f;})});}_0x952322=_[_0xbe14('0x40')]({},_0x952322,_0x2f0d14['options']);return _0x41962a[_0xbe14('0x84')](_0x952322);}})[_0xbe14('0x13')](function(_0x111ff0){if(_0x111ff0){_0x4ebf01=_0x111ff0[_0xbe14('0x32')];if(!_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0x49')]('nolimit')){_0x952322[_0xbe14('0xf')]=qs[_0xbe14('0xf')](_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0xf')]);_0x952322[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x2f0d14[_0xbe14('0x2e')][_0xbe14('0xd')]);}return _0x41962a[_0xbe14('0x84')](_0x952322);}})['then'](function(_0x2eb5e6){if(_0x2eb5e6){return _0x2eb5e6?{'count':_0x4ebf01,'rows':_0x2eb5e6}:null;}})['then'](respondWithResult(_0x180e61,null))[_0xbe14('0x35')](handleError(_0x180e61,null));};exports['getMembers']=function(_0x49cddc,_0x3bdbf7){var _0x19a1ae={};var _0x167dee={};var _0x4f6252;var _0x4536b9;return db['VoiceQueue'][_0xbe14('0x52')]({'where':{'id':_0x49cddc['params']['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x3bdbf7,null))[_0xbe14('0x13')](function(_0x21f14e){if(_0x21f14e){_0x4f6252=_0x21f14e;_0x167dee[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x62')]['rawAttributes']);_0x167dee[_0xbe14('0x2e')]=_[_0xbe14('0x2d')](_0x49cddc['query']);_0x167dee['filters']=_['intersection'](_0x167dee[_0xbe14('0x2c')],_0x167dee[_0xbe14('0x2e')]);_0x19a1ae[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x167dee[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0x49cddc[_0xbe14('0x2e')]['fields']));_0x19a1ae[_0xbe14('0x30')]=_0x19a1ae[_0xbe14('0x30')][_0xbe14('0x32')]?_0x19a1ae['attributes']:_0x167dee[_0xbe14('0x2c')];_0x19a1ae[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0x49cddc['query']['sort']);_0x19a1ae[_0xbe14('0x28')]=qs['filters'](_[_0xbe14('0x4d')](_0x49cddc[_0xbe14('0x2e')],_0x167dee[_0xbe14('0x48')]));if(_0x49cddc[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x19a1ae[_0xbe14('0x28')]=_['merge'](_0x19a1ae[_0xbe14('0x28')],{'$or':_['map'](_0x19a1ae[_0xbe14('0x30')],function(_0x2d0568){var _0x26bb56={};_0x26bb56[_0x2d0568]={'$like':'%'+_0x49cddc['query'][_0xbe14('0x19')]+'%'};return _0x26bb56;})});}_0x19a1ae=_[_0xbe14('0x40')]({},_0x19a1ae,_0x49cddc['options']);return _0x4f6252['getMembers'](_0x19a1ae);}})[_0xbe14('0x13')](function(_0x3d9061){if(_0x3d9061){_0x4536b9=_0x3d9061[_0xbe14('0x32')];if(!_0x49cddc['query'][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x19a1ae['limit']=qs['limit'](_0x49cddc['query']['limit']);_0x19a1ae[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x49cddc['query']['offset']);}return _0x4f6252[_0xbe14('0x85')](_0x19a1ae);}})[_0xbe14('0x13')](function(_0x1046a0){return _0x1046a0?{'count':_0x4536b9,'rows':_0x1046a0}:null;})['then'](respondWithResult(_0x3bdbf7,null))[_0xbe14('0x35')](handleError(_0x3bdbf7,null));};exports[_0xbe14('0x86')]=function(_0x3933c7,_0x416c65){var _0x56f870={};var _0x28b3c4={};var _0x6fe862;var _0x5f4675;return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0x3933c7[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x416c65,null))[_0xbe14('0x13')](function(_0x4c4ab9){if(_0x4c4ab9){_0x6fe862=_0x4c4ab9;_0x28b3c4['model']=_[_0xbe14('0x2d')](db[_0xbe14('0x87')][_0xbe14('0x24')]);_0x28b3c4[_0xbe14('0x2e')]=_['keys'](_0x3933c7[_0xbe14('0x2e')]);_0x28b3c4[_0xbe14('0x48')]=_['intersection'](_0x28b3c4[_0xbe14('0x2c')],_0x28b3c4['query']);_0x56f870[_0xbe14('0x30')]=_[_0xbe14('0x2f')](_0x28b3c4['model'],qs[_0xbe14('0x31')](_0x3933c7[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x56f870[_0xbe14('0x30')]=_0x56f870[_0xbe14('0x30')][_0xbe14('0x32')]?_0x56f870[_0xbe14('0x30')]:_0x28b3c4[_0xbe14('0x2c')];_0x56f870['order']=qs[_0xbe14('0x4c')](_0x3933c7[_0xbe14('0x2e')][_0xbe14('0x4c')]);_0x56f870['where']=qs['filters'](_['pick'](_0x3933c7[_0xbe14('0x2e')],_0x28b3c4[_0xbe14('0x48')]));if(_0x3933c7[_0xbe14('0x2e')]['filter']){_0x56f870['where']=_[_0xbe14('0x40')](_0x56f870[_0xbe14('0x28')],{'$or':_[_0xbe14('0x1a')](_0x56f870[_0xbe14('0x30')],function(_0x2ac6c0){var _0x3d381e={};_0x3d381e[_0x2ac6c0]={'$like':'%'+_0x3933c7[_0xbe14('0x2e')][_0xbe14('0x19')]+'%'};return _0x3d381e;})});}_0x56f870=_[_0xbe14('0x40')]({},_0x56f870,_0x3933c7['options']);return _0x6fe862[_0xbe14('0x86')](_0x56f870);}})[_0xbe14('0x13')](function(_0x2ca4de){if(_0x2ca4de){_0x5f4675=_0x2ca4de[_0xbe14('0x32')];if(!_0x3933c7[_0xbe14('0x2e')]['hasOwnProperty'](_0xbe14('0x4a'))){_0x56f870['limit']=qs['limit'](_0x3933c7[_0xbe14('0x2e')][_0xbe14('0xf')]);_0x56f870['offset']=qs['offset'](_0x3933c7[_0xbe14('0x2e')][_0xbe14('0xd')]);}return _0x6fe862[_0xbe14('0x86')](_0x56f870);}})[_0xbe14('0x13')](function(_0x2e7c31){if(_0x2e7c31){return _0x2e7c31?{'count':_0x5f4675,'rows':_0x2e7c31}:null;}})['then'](respondWithResult(_0x416c65,null))['catch'](handleError(_0x416c65,null));};exports[_0xbe14('0x88')]=function(_0x4b07fc,_0x76e84){var _0x3f687f=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x4f4b69,_0x43d760;return db['VoiceQueue'][_0xbe14('0x1d')]({'where':{'id':_0x4b07fc[_0xbe14('0x2b')]['id']}})['then'](handleEntityNotFound(_0x76e84,null))[_0xbe14('0x13')](function(_0x30657c){if(_0x30657c){_0x43d760=_0x30657c;return _0x30657c[_0xbe14('0x88')](_0x4b07fc[_0xbe14('0x37')][_0xbe14('0x6a')],_['omit'](_0x4b07fc[_0xbe14('0x37')],[_0xbe14('0x6a'),'id'])||{});}return null;})[_0xbe14('0x82')](function(_0xd97d02){var _0x15082b;_0x4f4b69=_0xd97d02||[];var _0x5d15c7=[];if(_0xd97d02){for(var _0x66b6a7=0x0;_0x66b6a7<_0xd97d02[_0xbe14('0x32')];_0x66b6a7+=0x1){var _0x4dfe2c=_0xd97d02[_0x66b6a7][_0xbe14('0x15')]({'plain':!![]});_0x43d760['dialCheckDuplicateType']=_0x4b07fc[_0xbe14('0x37')][_0xbe14('0x89')]?_0x4b07fc[_0xbe14('0x37')][_0xbe14('0x89')]:_0x43d760[_0xbe14('0x89')];switch(_0x43d760[_0xbe14('0x89')]){case'always':_0x15082b=squel[_0xbe14('0x8a')]()[_0xbe14('0x8b')](_0xbe14('0x8c'))[_0xbe14('0x8d')]([_0xbe14('0x8e'),_0xbe14('0x8f'),_0xbe14('0x90'),_0xbe14('0x91'),_0xbe14('0x4e'),_0xbe14('0x42'),'updatedAt'],squel[_0xbe14('0x6c')]()[_0xbe14('0x6d')]('phone',_0xbe14('0x8e'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x8f'))[_0xbe14('0x6d')]('id',_0xbe14('0x90'))[_0xbe14('0x6d')](_0x4dfe2c[_0xbe14('0x92')][_0xbe14('0x75')](),'ListId')[_0xbe14('0x6d')](_0x4b07fc['params']['id'][_0xbe14('0x75')](),_0xbe14('0x4e'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x42'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x43'))[_0xbe14('0x6f')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0xbe14('0x28')](_0xbe14('0x93'),_0x4dfe2c['CmListId'][_0xbe14('0x75')]())[_0xbe14('0x28')](_0xbe14('0x94'))[_0xbe14('0x28')](_0xbe14('0x95'),squel[_0xbe14('0x6c')]()[_0xbe14('0x6d')](_0xbe14('0x96'))[_0xbe14('0x6f')](_0xbe14('0x97'))[_0xbe14('0x28')]('VoiceQueueId\x20=\x20?',_0x4b07fc[_0xbe14('0x2b')]['id']['toString']()))[_0xbe14('0x28')](_0xbe14('0x95'),squel[_0xbe14('0x6c')]()['field'](_0xbe14('0x98'))[_0xbe14('0x6f')]('cm_hopper')[_0xbe14('0x28')](_0xbe14('0x72'),_0x4b07fc[_0xbe14('0x2b')]['id']['toString']())))[_0xbe14('0x75')]();break;case _0xbe14('0x99'):_0x15082b=squel['insert']()[_0xbe14('0x8b')]('cm_hopper')[_0xbe14('0x8d')]([_0xbe14('0x8e'),_0xbe14('0x8f'),_0xbe14('0x90'),'ListId','VoiceQueueId',_0xbe14('0x42'),_0xbe14('0x43')],squel['select']()['field'](_0xbe14('0x8e'),'phone')[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x8f'))[_0xbe14('0x6d')]('id',_0xbe14('0x90'))[_0xbe14('0x6d')](_0x4dfe2c[_0xbe14('0x92')][_0xbe14('0x75')](),_0xbe14('0x91'))[_0xbe14('0x6d')](_0x4b07fc[_0xbe14('0x2b')]['id']['toString'](),'VoiceQueueId')['field']('\x27'+_0x3f687f+'\x27',_0xbe14('0x42'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x43'))[_0xbe14('0x6f')](_0xbe14('0x9a'))[_0xbe14('0x28')](_0xbe14('0x9b'))[_0xbe14('0x28')](_0xbe14('0x93'),_0x4dfe2c['CmListId'][_0xbe14('0x75')]())[_0xbe14('0x28')](_0xbe14('0x94'))['where'](_0xbe14('0x95'),squel[_0xbe14('0x6c')]()[_0xbe14('0x6d')](_0xbe14('0x98'))[_0xbe14('0x6f')](_0xbe14('0x8c'))[_0xbe14('0x28')]('VoiceQueueId\x20=\x20?',_0x4b07fc[_0xbe14('0x2b')]['id'][_0xbe14('0x75')]())))['toString']();break;default:_0x15082b=squel['insert']()[_0xbe14('0x8b')](_0xbe14('0x8c'))[_0xbe14('0x8d')](['phone',_0xbe14('0x8f'),_0xbe14('0x90'),_0xbe14('0x91'),_0xbe14('0x4e'),_0xbe14('0x42'),_0xbe14('0x43')],squel['select']()[_0xbe14('0x6d')]('phone',_0xbe14('0x8e'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x8f'))['field']('id',_0xbe14('0x90'))[_0xbe14('0x6d')](_0x4dfe2c['CmListId'][_0xbe14('0x75')](),'ListId')[_0xbe14('0x6d')](_0x4b07fc['params']['id'][_0xbe14('0x75')](),'VoiceQueueId')[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x42'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x43'))[_0xbe14('0x6f')]('cm_contacts')[_0xbe14('0x28')](_0xbe14('0x9b'))['where'](_0xbe14('0x93'),_0x4dfe2c[_0xbe14('0x92')]['toString']())[_0xbe14('0x28')](_0xbe14('0x94')))[_0xbe14('0x75')]();}_0x5d15c7['push'](db[_0xbe14('0x60')][_0xbe14('0x2e')](_0x15082b));}return BPromise[_0xbe14('0x7a')](_0x5d15c7);}})[_0xbe14('0x13')](function(){var _0x4bc564=[];var _0x19e7ce=squel[_0xbe14('0x8a')]()[_0xbe14('0x8b')](_0xbe14('0x9c'))[_0xbe14('0x8d')]([_0xbe14('0x9d'),_0xbe14('0x8e'),_0xbe14('0x9e'),_0xbe14('0x42'),'updatedAt'],squel[_0xbe14('0x6c')]()['field']('h.id')[_0xbe14('0x6d')](_0xbe14('0x9f'))['field'](_0xbe14('0xa0'))[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27','createdAt')[_0xbe14('0x6d')]('\x27'+_0x3f687f+'\x27',_0xbe14('0x43'))[_0xbe14('0x6f')](_0xbe14('0xa1'),'ci')[_0xbe14('0x71')](_0xbe14('0x8c'),'h','h.ContactId=ci.CmContactId')['where'](_0xbe14('0xa2'),_0x3f687f)['where'](_0xbe14('0xa3'),_0xbe14('0xa4')))['toString']();_0x4bc564[_0xbe14('0x74')](db[_0xbe14('0x60')][_0xbe14('0x2e')](_0x19e7ce));return BPromise[_0xbe14('0x7a')](_0x4bc564);})[_0xbe14('0x13')](function(){return _0x4f4b69;})[_0xbe14('0x13')](respondWithResult(_0x76e84,null))[_0xbe14('0x35')](handleError(_0x76e84,null));};exports['removeLists']=function(_0x4ceca6,_0x23f4a3){return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0x4ceca6[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x23f4a3,null))[_0xbe14('0x13')](function(_0x2fe8b0){if(_0x2fe8b0){return _0x2fe8b0[_0xbe14('0xa5')](_0x4ceca6['query'][_0xbe14('0x6a')]);}})[_0xbe14('0x13')](function(_0x186284){if(_0x186284){return db['CmHopper'][_0xbe14('0x14')]({'where':{'ListId':_0x4ceca6[_0xbe14('0x2e')][_0xbe14('0x6a')],'VoiceQueueId':_0x4ceca6[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](function(){return _0x186284;});}})['then'](respondWithStatusCode(_0x23f4a3,null))[_0xbe14('0x35')](handleError(_0x23f4a3,null));};exports[_0xbe14('0xa6')]=function(_0x4c9319,_0x1173f0){var _0x1e0c81={};var _0x5349a7={};var _0x5e3819;var _0x28c5fe;return db[_0xbe14('0x23')][_0xbe14('0x52')]({'where':{'id':_0x4c9319['params']['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x1173f0,null))[_0xbe14('0x13')](function(_0x59434a){if(_0x59434a){_0x5e3819=_0x59434a;_0x5349a7[_0xbe14('0x2c')]=_[_0xbe14('0x2d')](db[_0xbe14('0x87')]['rawAttributes']);_0x5349a7[_0xbe14('0x2e')]=_[_0xbe14('0x2d')](_0x4c9319[_0xbe14('0x2e')]);_0x5349a7[_0xbe14('0x48')]=_[_0xbe14('0x2f')](_0x5349a7[_0xbe14('0x2c')],_0x5349a7[_0xbe14('0x2e')]);_0x1e0c81[_0xbe14('0x30')]=_['intersection'](_0x5349a7[_0xbe14('0x2c')],qs[_0xbe14('0x31')](_0x4c9319[_0xbe14('0x2e')][_0xbe14('0x31')]));_0x1e0c81[_0xbe14('0x30')]=_0x1e0c81['attributes'][_0xbe14('0x32')]?_0x1e0c81[_0xbe14('0x30')]:_0x5349a7[_0xbe14('0x2c')];_0x1e0c81[_0xbe14('0x4b')]=qs[_0xbe14('0x4c')](_0x4c9319[_0xbe14('0x2e')]['sort']);_0x1e0c81['where']=qs['filters'](_[_0xbe14('0x4d')](_0x4c9319[_0xbe14('0x2e')],_0x5349a7['filters']));if(_0x4c9319[_0xbe14('0x2e')][_0xbe14('0x19')]){_0x1e0c81[_0xbe14('0x28')]=_[_0xbe14('0x40')](_0x1e0c81['where'],{'$or':_[_0xbe14('0x1a')](_0x1e0c81[_0xbe14('0x30')],function(_0x52bbc1){var _0x2797ef={};_0x2797ef[_0x52bbc1]={'$like':'%'+_0x4c9319['query']['filter']+'%'};return _0x2797ef;})});}_0x1e0c81=_[_0xbe14('0x40')]({},_0x1e0c81,_0x4c9319[_0xbe14('0x34')]);return _0x5e3819[_0xbe14('0xa6')](_0x1e0c81);}})[_0xbe14('0x13')](function(_0x47bba1){if(_0x47bba1){_0x28c5fe=_0x47bba1[_0xbe14('0x32')];if(!_0x4c9319[_0xbe14('0x2e')][_0xbe14('0x49')](_0xbe14('0x4a'))){_0x1e0c81['limit']=qs[_0xbe14('0xf')](_0x4c9319[_0xbe14('0x2e')][_0xbe14('0xf')]);_0x1e0c81[_0xbe14('0xd')]=qs[_0xbe14('0xd')](_0x4c9319[_0xbe14('0x2e')][_0xbe14('0xd')]);}return _0x5e3819[_0xbe14('0xa6')](_0x1e0c81);}})['then'](function(_0x2592ab){if(_0x2592ab){return _0x2592ab?{'count':_0x28c5fe,'rows':_0x2592ab}:null;}})[_0xbe14('0x13')](respondWithResult(_0x1173f0,null))['catch'](handleError(_0x1173f0,null));};exports['addBlackLists']=function(_0x6a0f29,_0x3d04b9){var _0x21f793;return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0x6a0f29[_0xbe14('0x2b')]['id']}})['then'](handleEntityNotFound(_0x3d04b9,null))[_0xbe14('0x13')](function(_0x37e5e8){if(_0x37e5e8){return _0x37e5e8['addBlackLists'](_0x6a0f29[_0xbe14('0x37')][_0xbe14('0x6a')],_[_0xbe14('0x41')](_0x6a0f29[_0xbe14('0x37')],[_0xbe14('0x6a'),'id'])||{});}return null;})[_0xbe14('0x82')](function(_0x14cec7){var _0x524603;_0x21f793=_0x14cec7||[];var _0x38d720=[];if(_0x14cec7){for(var _0x379446=0x0;_0x379446<_0x14cec7[_0xbe14('0x32')];_0x379446+=0x1){var _0x1489c9=_0x14cec7[_0x379446][_0xbe14('0x15')]({'plain':!![]});_0x524603=squel[_0xbe14('0x8a')]()[_0xbe14('0x8b')](_0xbe14('0xa7'))['fromQuery']([_0xbe14('0x8e'),_0xbe14('0x90'),_0xbe14('0x91'),'VoiceQueueId',_0xbe14('0x42'),_0xbe14('0x43')],squel[_0xbe14('0x6c')]()['field'](_0xbe14('0x8e'),'phone')[_0xbe14('0x6d')]('id',_0xbe14('0x90'))[_0xbe14('0x6d')](_0x1489c9[_0xbe14('0x92')][_0xbe14('0x75')](),_0xbe14('0x91'))[_0xbe14('0x6d')](_0x6a0f29['params']['id'][_0xbe14('0x75')](),_0xbe14('0x4e'))[_0xbe14('0x6d')](_0xbe14('0xa8'),_0xbe14('0x42'))[_0xbe14('0x6d')](_0xbe14('0xa8'),'updatedAt')[_0xbe14('0x6f')](_0xbe14('0x9a'))[_0xbe14('0x28')](_0xbe14('0x9b'))[_0xbe14('0x28')](_0xbe14('0x93'),_0x1489c9[_0xbe14('0x92')][_0xbe14('0x75')]())[_0xbe14('0x28')](_0xbe14('0x94')))[_0xbe14('0x75')]();_0x38d720[_0xbe14('0x74')](db['sequelize'][_0xbe14('0x2e')](_0x524603));}return BPromise[_0xbe14('0x7a')](_0x38d720);}})['then'](function(){return _0x21f793;})['then'](respondWithResult(_0x3d04b9,null))[_0xbe14('0x35')](handleError(_0x3d04b9,null));};exports[_0xbe14('0xa9')]=function(_0x7533c3,_0x3ec670){return db[_0xbe14('0x23')][_0xbe14('0x1d')]({'where':{'id':_0x7533c3[_0xbe14('0x2b')]['id']}})[_0xbe14('0x13')](handleEntityNotFound(_0x3ec670,null))['then'](function(_0x3ee9e2){if(_0x3ee9e2){return _0x3ee9e2['removeBlackLists'](_0x7533c3[_0xbe14('0x2e')][_0xbe14('0x6a')]);}})[_0xbe14('0x13')](function(_0x1d343a){if(_0x1d343a){return db[_0xbe14('0x57')][_0xbe14('0x14')]({'where':{'ListId':_0x7533c3['query']['ids'],'VoiceQueueId':_0x7533c3['params']['id']}})['then'](function(){return _0x1d343a;});}})['then'](respondWithStatusCode(_0x3ec670,null))[_0xbe14('0x35')](handleError(_0x3ec670,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 711b467..64a53f5 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 _0x09fa=['events','VoiceQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x420d8d,_0x78b67f){var _0x4865d7=function(_0x2965df){while(--_0x2965df){_0x420d8d['push'](_0x420d8d['shift']());}};_0x4865d7(++_0x78b67f);}(_0x09fa,0xd8));var _0xa09f=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x09fa[_0x413feb];return _0x40ee88;};'use strict';var EventEmitter=require(_0xa09f('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xa09f('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xa09f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa09f('0x3'),'afterDestroy':_0xa09f('0x4')};function emitEvent(_0x58b66d){return function(_0x39f269,_0x4afd10,_0x5965ea){VoiceQueueEvents[_0xa09f('0x5')](_0x58b66d+':'+_0x39f269['id'],_0x39f269);VoiceQueueEvents['emit'](_0x58b66d,_0x39f269);_0x5965ea(null);};}for(var e in events){if(events[_0xa09f('0x6')](e)){var event=events[e];VoiceQueue[_0xa09f('0x7')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0xb7a0=['update','remove','emit','hook','exports','VoiceQueue','setMaxListeners','save'];(function(_0x3d2e4b,_0x1f6653){var _0x509e78=function(_0x307037){while(--_0x307037){_0x3d2e4b['push'](_0x3d2e4b['shift']());}};_0x509e78(++_0x1f6653);}(_0xb7a0,0x12d));var _0x0b7a=function(_0x59b2ed,_0x122ae1){_0x59b2ed=_0x59b2ed-0x0;var _0x101c29=_0xb7a0[_0x59b2ed];return _0x101c29;};'use strict';var EventEmitter=require('events');var VoiceQueue=require('../../mysqldb')['db'][_0x0b7a('0x0')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x0b7a('0x1')](0x0);var events={'afterCreate':_0x0b7a('0x2'),'afterUpdate':_0x0b7a('0x3'),'afterDestroy':_0x0b7a('0x4')};function emitEvent(_0x5c5eae){return function(_0x4313f1,_0x1f6f00,_0x58041a){VoiceQueueEvents['emit'](_0x5c5eae+':'+_0x4313f1['id'],_0x4313f1);VoiceQueueEvents[_0x0b7a('0x5')](_0x5c5eae,_0x4313f1);_0x58041a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x0b7a('0x6')](e,emitEvent(event));}}module[_0x0b7a('0x7')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 08e6f01..583e1f6 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(_0x51eb77,_0x436673){var _0x4b26fe=function(_0x4db9dc){while(--_0x4db9dc){_0x51eb77['push'](_0x51eb77['shift']());}};_0x4b26fe(++_0x436673);}(_0x70e0,0x17b));var _0x070e=function(_0x589780,_0x3b288d){_0x589780=_0x589780-0x0;var _0x3ac66b=_0x70e0[_0x589780];return _0x3ac66b;};'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 _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0xadf6e1,_0x37aa83){var _0x93d3b3=function(_0x529436){while(--_0x529436){_0xadf6e1['push'](_0xadf6e1['shift']());}};_0x93d3b3(++_0x37aa83);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index af3e08f..ca1ce44 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 _0xf6c4=['VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetVoiceQueue','VoiceQueue','options','raw','where','attributes','limit','include','model','map','ShowVoiceQueue','find','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voiceQueue.socket','register','request','then','info'];(function(_0x4bed75,_0x211cc7){var _0x2dd8e8=function(_0x6369c7){while(--_0x6369c7){_0x4bed75['push'](_0x4bed75['shift']());}};_0x2dd8e8(++_0x211cc7);}(_0xf6c4,0x144));var _0x4f6c=function(_0x1753c4,_0x10125b){_0x1753c4=_0x1753c4-0x0;var _0x45a679=_0xf6c4[_0x1753c4];return _0x45a679;};'use strict';var _=require(_0x4f6c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4f6c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f6c('0x2'));var db=require(_0x4f6c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4f6c('0x4'))(_0x4f6c('0x5'));var config=require(_0x4f6c('0x6'));var jayson=require(_0x4f6c('0x7'));var client=jayson[_0x4f6c('0x8')][_0x4f6c('0x9')]({'port':0x232a});config[_0x4f6c('0xa')]=_[_0x4f6c('0xb')](config['redis'],{'host':_0x4f6c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4f6c('0xd'))[_0x4f6c('0xe')](socket);function respondWithRpcPromise(_0x2ef5b1,_0x19c5dd,_0x34cfbd){return new BPromise(function(_0x13b440,_0x590af4){return client[_0x4f6c('0xf')](_0x2ef5b1,_0x34cfbd)[_0x4f6c('0x10')](function(_0x4f9fb8){logger[_0x4f6c('0x11')](_0x4f6c('0x12'),_0x19c5dd,_0x4f6c('0x13'));logger[_0x4f6c('0x14')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x19c5dd,'request\x20sent',JSON[_0x4f6c('0x15')](_0x4f9fb8));if(_0x4f9fb8[_0x4f6c('0x16')]){if(_0x4f9fb8[_0x4f6c('0x16')]['code']===0x1f4){logger[_0x4f6c('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x19c5dd,_0x4f9fb8[_0x4f6c('0x16')][_0x4f6c('0x17')]);return _0x590af4(_0x4f9fb8['error'][_0x4f6c('0x17')]);}logger[_0x4f6c('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x19c5dd,_0x4f9fb8['error'][_0x4f6c('0x17')]);return _0x13b440(_0x4f9fb8[_0x4f6c('0x16')]['message']);}else{logger[_0x4f6c('0x11')]('VoiceQueue,\x20%s,\x20%s',_0x19c5dd,'request\x20sent');_0x13b440(_0x4f9fb8[_0x4f6c('0x18')][_0x4f6c('0x17')]);}})[_0x4f6c('0x19')](function(_0x3fd067){logger[_0x4f6c('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x19c5dd,_0x3fd067);_0x590af4(_0x3fd067);});});}exports[_0x4f6c('0x1a')]=function(_0x52fd2d){var _0x360051=this;return new Promise(function(_0x33d392,_0x59f46d){return db[_0x4f6c('0x1b')]['findAll']({'raw':_0x52fd2d[_0x4f6c('0x1c')]?_0x52fd2d[_0x4f6c('0x1c')][_0x4f6c('0x1d')]===undefined?!![]:![]:!![],'where':_0x52fd2d[_0x4f6c('0x1c')]?_0x52fd2d[_0x4f6c('0x1c')][_0x4f6c('0x1e')]||null:null,'attributes':_0x52fd2d[_0x4f6c('0x1c')]?_0x52fd2d['options'][_0x4f6c('0x1f')]||null:null,'limit':_0x52fd2d[_0x4f6c('0x1c')]?_0x52fd2d[_0x4f6c('0x1c')][_0x4f6c('0x20')]||null:null,'include':_0x52fd2d[_0x4f6c('0x1c')]?_0x52fd2d['options'][_0x4f6c('0x21')]?_['map'](_0x52fd2d[_0x4f6c('0x1c')][_0x4f6c('0x21')],function(_0x45059b){return{'model':db[_0x45059b[_0x4f6c('0x22')]],'as':_0x45059b['as'],'attributes':_0x45059b['attributes'],'include':_0x45059b[_0x4f6c('0x21')]?_[_0x4f6c('0x23')](_0x45059b[_0x4f6c('0x21')],function(_0x6c6773){return{'model':db[_0x6c6773[_0x4f6c('0x22')]],'as':_0x6c6773['as'],'attributes':_0x6c6773[_0x4f6c('0x1f')],'include':_0x6c6773[_0x4f6c('0x21')]?_[_0x4f6c('0x23')](_0x6c6773[_0x4f6c('0x21')],function(_0x49a2fa){return{'model':db[_0x49a2fa['model']],'as':_0x49a2fa['as'],'attributes':_0x49a2fa[_0x4f6c('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xc9ec32){logger[_0x4f6c('0x11')](_0x4f6c('0x1a'),_0x52fd2d);logger['debug'](_0x4f6c('0x1a'),_0x52fd2d,JSON[_0x4f6c('0x15')](_0xc9ec32));_0x33d392(_0xc9ec32);})['catch'](function(_0x312eb9){logger[_0x4f6c('0x16')]('GetVoiceQueue',_0x312eb9[_0x4f6c('0x17')],_0x52fd2d);_0x59f46d(_0x360051[_0x4f6c('0x16')](0x1f4,_0x312eb9[_0x4f6c('0x17')]));});});};exports[_0x4f6c('0x24')]=function(_0x439a07){var _0x2ccd37=this;return new Promise(function(_0x404264,_0x43f016){return db[_0x4f6c('0x1b')][_0x4f6c('0x25')]({'raw':_0x439a07['options']?_0x439a07[_0x4f6c('0x1c')][_0x4f6c('0x1d')]===undefined?!![]:![]:!![],'where':_0x439a07[_0x4f6c('0x1c')]?_0x439a07[_0x4f6c('0x1c')][_0x4f6c('0x1e')]||null:null,'attributes':_0x439a07[_0x4f6c('0x1c')]?_0x439a07[_0x4f6c('0x1c')]['attributes']||null:null,'include':_0x439a07['options']?_0x439a07['options'][_0x4f6c('0x21')]?_[_0x4f6c('0x23')](_0x439a07[_0x4f6c('0x1c')][_0x4f6c('0x21')],function(_0x370995){return{'model':db[_0x370995[_0x4f6c('0x22')]],'as':_0x370995['as'],'attributes':_0x370995[_0x4f6c('0x1f')],'include':_0x370995[_0x4f6c('0x21')]?_[_0x4f6c('0x23')](_0x370995[_0x4f6c('0x21')],function(_0x38ccb0){return{'model':db[_0x38ccb0['model']],'as':_0x38ccb0['as'],'attributes':_0x38ccb0[_0x4f6c('0x1f')],'include':_0x38ccb0[_0x4f6c('0x21')]?_[_0x4f6c('0x23')](_0x38ccb0[_0x4f6c('0x21')],function(_0x3c1f66){return{'model':db[_0x3c1f66[_0x4f6c('0x22')]],'as':_0x3c1f66['as'],'attributes':_0x3c1f66['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ec288){logger['info'](_0x4f6c('0x24'),_0x439a07);logger[_0x4f6c('0x14')](_0x4f6c('0x24'),_0x439a07,JSON[_0x4f6c('0x15')](_0x3ec288));_0x404264(_0x3ec288);})[_0x4f6c('0x19')](function(_0xaa0bf2){logger[_0x4f6c('0x16')](_0x4f6c('0x24'),_0xaa0bf2[_0x4f6c('0x17')],_0x439a07);_0x43f016(_0x2ccd37[_0x4f6c('0x16')](0x1f4,_0xaa0bf2['message']));});});}; \ No newline at end of file +var _0x2e1b=['find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceQueue,\x20%s,\x20%s','message','result','catch','GetVoiceQueue','VoiceQueue','options','raw','where','attributes','limit','include','map','model','info','ShowVoiceQueue'];(function(_0x4091ae,_0x33008a){var _0x40776d=function(_0x1e4749){while(--_0x1e4749){_0x4091ae['push'](_0x4091ae['shift']());}};_0x40776d(++_0x33008a);}(_0x2e1b,0x19b));var _0xb2e1=function(_0x4fb0ca,_0xfe887b){_0x4fb0ca=_0x4fb0ca-0x0;var _0x152efb=_0x2e1b[_0x4fb0ca];return _0x152efb;};'use strict';var _=require(_0xb2e1('0x0'));var util=require(_0xb2e1('0x1'));var moment=require(_0xb2e1('0x2'));var BPromise=require(_0xb2e1('0x3'));var rs=require(_0xb2e1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb2e1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb2e1('0x6'))(_0xb2e1('0x7'));var config=require(_0xb2e1('0x8'));var jayson=require(_0xb2e1('0x9'));var client=jayson[_0xb2e1('0xa')][_0xb2e1('0xb')]({'port':0x232a});config[_0xb2e1('0xc')]=_[_0xb2e1('0xd')](config['redis'],{'host':_0xb2e1('0xe'),'port':0x18eb});var socket=require(_0xb2e1('0xf'))(new Redis(config[_0xb2e1('0xc')]));require('./voiceQueue.socket')[_0xb2e1('0x10')](socket);function respondWithRpcPromise(_0x552d86,_0x19e802,_0x31fc36){return new BPromise(function(_0x2cb5a9,_0x3cefe4){return client['request'](_0x552d86,_0x31fc36)[_0xb2e1('0x11')](function(_0x4cff28){logger['info']('VoiceQueue,\x20%s,\x20%s',_0x19e802,'request\x20sent');logger[_0xb2e1('0x12')](_0xb2e1('0x13'),_0x19e802,_0xb2e1('0x14'),JSON[_0xb2e1('0x15')](_0x4cff28));if(_0x4cff28[_0xb2e1('0x16')]){if(_0x4cff28[_0xb2e1('0x16')][_0xb2e1('0x17')]===0x1f4){logger['error'](_0xb2e1('0x18'),_0x19e802,_0x4cff28[_0xb2e1('0x16')]['message']);return _0x3cefe4(_0x4cff28[_0xb2e1('0x16')]['message']);}logger[_0xb2e1('0x16')](_0xb2e1('0x18'),_0x19e802,_0x4cff28[_0xb2e1('0x16')][_0xb2e1('0x19')]);return _0x2cb5a9(_0x4cff28['error'][_0xb2e1('0x19')]);}else{logger['info'](_0xb2e1('0x18'),_0x19e802,_0xb2e1('0x14'));_0x2cb5a9(_0x4cff28[_0xb2e1('0x1a')][_0xb2e1('0x19')]);}})[_0xb2e1('0x1b')](function(_0x76a517){logger['error'](_0xb2e1('0x18'),_0x19e802,_0x76a517);_0x3cefe4(_0x76a517);});});}exports[_0xb2e1('0x1c')]=function(_0x2dd167){var _0xdd852=this;return new Promise(function(_0x4b8c32,_0x374ea4){return db[_0xb2e1('0x1d')]['findAll']({'raw':_0x2dd167['options']?_0x2dd167[_0xb2e1('0x1e')][_0xb2e1('0x1f')]===undefined?!![]:![]:!![],'where':_0x2dd167['options']?_0x2dd167[_0xb2e1('0x1e')][_0xb2e1('0x20')]||null:null,'attributes':_0x2dd167[_0xb2e1('0x1e')]?_0x2dd167[_0xb2e1('0x1e')][_0xb2e1('0x21')]||null:null,'limit':_0x2dd167[_0xb2e1('0x1e')]?_0x2dd167[_0xb2e1('0x1e')][_0xb2e1('0x22')]||null:null,'include':_0x2dd167['options']?_0x2dd167[_0xb2e1('0x1e')][_0xb2e1('0x23')]?_[_0xb2e1('0x24')](_0x2dd167[_0xb2e1('0x1e')][_0xb2e1('0x23')],function(_0x2c96fb){return{'model':db[_0x2c96fb[_0xb2e1('0x25')]],'as':_0x2c96fb['as'],'attributes':_0x2c96fb[_0xb2e1('0x21')],'include':_0x2c96fb[_0xb2e1('0x23')]?_[_0xb2e1('0x24')](_0x2c96fb[_0xb2e1('0x23')],function(_0x3cece9){return{'model':db[_0x3cece9['model']],'as':_0x3cece9['as'],'attributes':_0x3cece9[_0xb2e1('0x21')],'include':_0x3cece9['include']?_['map'](_0x3cece9[_0xb2e1('0x23')],function(_0x59e711){return{'model':db[_0x59e711[_0xb2e1('0x25')]],'as':_0x59e711['as'],'attributes':_0x59e711[_0xb2e1('0x21')]};}):[]};}):[]};}):[]:[]})[_0xb2e1('0x11')](function(_0x5d4d5d){logger[_0xb2e1('0x26')](_0xb2e1('0x1c'),_0x2dd167);logger['debug'](_0xb2e1('0x1c'),_0x2dd167,JSON[_0xb2e1('0x15')](_0x5d4d5d));_0x4b8c32(_0x5d4d5d);})[_0xb2e1('0x1b')](function(_0x2a7d54){logger['error'](_0xb2e1('0x1c'),_0x2a7d54['message'],_0x2dd167);_0x374ea4(_0xdd852[_0xb2e1('0x16')](0x1f4,_0x2a7d54[_0xb2e1('0x19')]));});});};exports[_0xb2e1('0x27')]=function(_0x224e51){var _0x2a7796=this;return new Promise(function(_0xa08c5c,_0x37532b){return db['VoiceQueue'][_0xb2e1('0x28')]({'raw':_0x224e51[_0xb2e1('0x1e')]?_0x224e51['options'][_0xb2e1('0x1f')]===undefined?!![]:![]:!![],'where':_0x224e51[_0xb2e1('0x1e')]?_0x224e51[_0xb2e1('0x1e')]['where']||null:null,'attributes':_0x224e51[_0xb2e1('0x1e')]?_0x224e51[_0xb2e1('0x1e')][_0xb2e1('0x21')]||null:null,'include':_0x224e51[_0xb2e1('0x1e')]?_0x224e51[_0xb2e1('0x1e')]['include']?_[_0xb2e1('0x24')](_0x224e51[_0xb2e1('0x1e')]['include'],function(_0x3ddca1){return{'model':db[_0x3ddca1[_0xb2e1('0x25')]],'as':_0x3ddca1['as'],'attributes':_0x3ddca1[_0xb2e1('0x21')],'include':_0x3ddca1[_0xb2e1('0x23')]?_['map'](_0x3ddca1[_0xb2e1('0x23')],function(_0x17dfe2){return{'model':db[_0x17dfe2[_0xb2e1('0x25')]],'as':_0x17dfe2['as'],'attributes':_0x17dfe2[_0xb2e1('0x21')],'include':_0x17dfe2[_0xb2e1('0x23')]?_[_0xb2e1('0x24')](_0x17dfe2[_0xb2e1('0x23')],function(_0x393fdc){return{'model':db[_0x393fdc['model']],'as':_0x393fdc['as'],'attributes':_0x393fdc[_0xb2e1('0x21')]};}):[]};}):[]};}):[]:[]})[_0xb2e1('0x11')](function(_0x3a4f27){logger[_0xb2e1('0x26')](_0xb2e1('0x27'),_0x224e51);logger[_0xb2e1('0x12')]('ShowVoiceQueue',_0x224e51,JSON[_0xb2e1('0x15')](_0x3a4f27));_0xa08c5c(_0x3a4f27);})[_0xb2e1('0x1b')](function(_0x58f125){logger[_0xb2e1('0x16')]('ShowVoiceQueue',_0x58f125[_0xb2e1('0x19')],_0x224e51);_0x37532b(_0x2a7796['error'](0x1f4,_0x58f125[_0xb2e1('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 2b5907b..7f10cb6 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 _0xa9b0=['save','update','removeListener','length','voiceQueue:','./voiceQueue.events'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xa9b0,0x1a3));var _0x0a9b=function(_0xac0de1,_0x12d3d9){_0xac0de1=_0xac0de1-0x0;var _0x1c1995=_0xa9b0[_0xac0de1];return _0x1c1995;};'use strict';var VoiceQueueEvents=require(_0x0a9b('0x0'));var events=[_0x0a9b('0x1'),'remove',_0x0a9b('0x2')];function createListener(_0x59db60,_0x55d52a){return function(_0x4ed08b){_0x55d52a['emit'](_0x59db60,_0x4ed08b);};}function removeListener(_0x14ae2a,_0x58e73e){return function(){VoiceQueueEvents[_0x0a9b('0x3')](_0x14ae2a,_0x58e73e);};}exports['register']=function(_0x113557){for(var _0x3fba26=0x0,_0x3234dc=events[_0x0a9b('0x4')];_0x3fba26<_0x3234dc;_0x3fba26++){var _0x51cc95=events[_0x3fba26];var _0xf92c45=createListener(_0x0a9b('0x5')+_0x51cc95,_0x113557);VoiceQueueEvents['on'](_0x51cc95,_0xf92c45);}}; \ No newline at end of file +var _0x520b=['save','remove','update','emit','removeListener','register','length','voiceQueue:'];(function(_0x5377a1,_0x22e1e4){var _0x45ff6f=function(_0x2510d7){while(--_0x2510d7){_0x5377a1['push'](_0x5377a1['shift']());}};_0x45ff6f(++_0x22e1e4);}(_0x520b,0x1c8));var _0xb520=function(_0x277721,_0x46971e){_0x277721=_0x277721-0x0;var _0x286051=_0x520b[_0x277721];return _0x286051;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xb520('0x0'),_0xb520('0x1'),_0xb520('0x2')];function createListener(_0x5296b2,_0xbce8cf){return function(_0x2328b7){_0xbce8cf[_0xb520('0x3')](_0x5296b2,_0x2328b7);};}function removeListener(_0x581cce,_0x23cf26){return function(){VoiceQueueEvents[_0xb520('0x4')](_0x581cce,_0x23cf26);};}exports[_0xb520('0x5')]=function(_0x33e257){for(var _0x2a661e=0x0,_0x2ce21b=events[_0xb520('0x6')];_0x2a661e<_0x2ce21b;_0x2a661e++){var _0x8bfa1e=events[_0x2a661e];var _0x5e36a0=createListener(_0xb520('0x7')+_0x8bfa1e,_0x33e257);VoiceQueueEvents['on'](_0x8bfa1e,_0x5e36a0);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 4ec99bb..d145a17 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 _0xa015=['update','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','/index','getVoiceQueuesReport','show','post','create','put'];(function(_0xfd53a8,_0x1c2ae4){var _0x3bb815=function(_0xbfc792){while(--_0xbfc792){_0xfd53a8['push'](_0xfd53a8['shift']());}};_0x3bb815(++_0x1c2ae4);}(_0xa015,0x12f));var _0x5a01=function(_0x220075,_0x513a4d){_0x220075=_0x220075-0x0;var _0x367334=_0xa015[_0x220075];return _0x367334;};'use strict';var multer=require(_0x5a01('0x0'));var util=require(_0x5a01('0x1'));var path=require(_0x5a01('0x2'));var timeout=require(_0x5a01('0x3'));var express=require(_0x5a01('0x4'));var router=express[_0x5a01('0x5')]();var fs_extra=require(_0x5a01('0x6'));var auth=require(_0x5a01('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x5a01('0x8'));var controller=require('./voiceQueueReport.controller');router[_0x5a01('0x9')]('/',auth[_0x5a01('0xa')](),controller[_0x5a01('0xb')]);router[_0x5a01('0x9')](_0x5a01('0xc'),auth[_0x5a01('0xa')](),controller['describe']);router['get'](_0x5a01('0xd'),auth[_0x5a01('0xa')](),controller[_0x5a01('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x5a01('0xf')]);router[_0x5a01('0x10')]('/',auth[_0x5a01('0xa')](),controller[_0x5a01('0x11')]);router[_0x5a01('0x12')]('/:id',auth[_0x5a01('0xa')](),controller[_0x5a01('0x13')]);router['delete'](_0x5a01('0x14'),auth[_0x5a01('0xa')](),controller[_0x5a01('0x15')]);module[_0x5a01('0x16')]=router; \ No newline at end of file +var _0x7316=['isAuthenticated','index','/describe','describe','/index','/:id','show','post','create','update','delete','exports','multer','util','connect-timeout','Router','./voiceQueueReport.controller','get'];(function(_0x394b9b,_0x581ef4){var _0xdc7e37=function(_0x3f00c4){while(--_0x3f00c4){_0x394b9b['push'](_0x394b9b['shift']());}};_0xdc7e37(++_0x581ef4);}(_0x7316,0xe4));var _0x6731=function(_0x1daaa9,_0x220393){_0x1daaa9=_0x1daaa9-0x0;var _0x1dd221=_0x7316[_0x1daaa9];return _0x1dd221;};'use strict';var multer=require(_0x6731('0x0'));var util=require(_0x6731('0x1'));var path=require('path');var timeout=require(_0x6731('0x2'));var express=require('express');var router=express[_0x6731('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6731('0x4'));router[_0x6731('0x5')]('/',auth[_0x6731('0x6')](),controller[_0x6731('0x7')]);router[_0x6731('0x5')](_0x6731('0x8'),auth['isAuthenticated'](),controller[_0x6731('0x9')]);router[_0x6731('0x5')](_0x6731('0xa'),auth[_0x6731('0x6')](),controller['getVoiceQueuesReport']);router['get'](_0x6731('0xb'),auth[_0x6731('0x6')](),controller[_0x6731('0xc')]);router[_0x6731('0xd')]('/',auth['isAuthenticated'](),controller[_0x6731('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x6731('0xf')]);router[_0x6731('0x10')](_0x6731('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x6731('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index 00793ee..0251157 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 _0x4a1f=['STRING','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','holdtime','INTEGER','BOOLEAN','DATE','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x36c87d,_0x2ab247){var _0x54dc55=function(_0x2b4112){while(--_0x2b4112){_0x36c87d['push'](_0x36c87d['shift']());}};_0x54dc55(++_0x2ab247);}(_0x4a1f,0x143));var _0xf4a1=function(_0x225915,_0x2eaa2f){_0x225915=_0x225915-0x0;var _0x3b8d10=_0x4a1f[_0x225915];return _0x3b8d10;};'use strict';var Sequelize=require(_0xf4a1('0x0'));var moment=require('moment');module[_0xf4a1('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xf4a1('0x2')]},'calleridname':{'type':Sequelize[_0xf4a1('0x2')]},'queue':{'type':Sequelize[_0xf4a1('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x5ec646){var _0x35f35e=moment(_0x5ec646);var _0xbae737=moment(this[_0xf4a1('0x3')](_0xf4a1('0x4')))['format'](_0xf4a1('0x5'));var _0x165eb9=_0x35f35e[_0xf4a1('0x6')](_0xbae737,_0xf4a1('0x7'));this['setDataValue']('queuecallerleaveAt',_0x5ec646);this['setDataValue'](_0xf4a1('0x8'),_0x165eb9||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0xf4a1('0x9')]},'queuecallerabandon':{'type':Sequelize[_0xf4a1('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xf4a1('0xb')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0xf4a1('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0xf4a1('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0xf4a1('0x9')]},'channel':{'type':Sequelize[_0xf4a1('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xf4a1('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xf4a1('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xf4a1('0x2')]},'holdtime':{'type':Sequelize[_0xf4a1('0x9')]},'mohtime':{'type':Sequelize[_0xf4a1('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xf4a1('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xf4a1('0x2')],'comment':_0xf4a1('0xc')},'transferexten':{'type':Sequelize[_0xf4a1('0x2')]},'transferuniqueid':{'type':Sequelize[_0xf4a1('0x2')]},'disposition':{'type':Sequelize[_0xf4a1('0x2')]},'secondDisposition':{'type':Sequelize[_0xf4a1('0x2')]},'thirdDisposition':{'type':Sequelize[_0xf4a1('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xf4a1('0x9')],'defaultValue':0x0},'note':{'type':Sequelize[_0xf4a1('0x2')]}}; \ No newline at end of file +var _0x663f=['moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x5ad3f1,_0x28729c){var _0x31595b=function(_0x2b2dc0){while(--_0x2b2dc0){_0x5ad3f1['push'](_0x5ad3f1['shift']());}};_0x31595b(++_0x28729c);}(_0x663f,0xf0));var _0xf663=function(_0x5581ba,_0x268887){_0x5581ba=_0x5581ba-0x0;var _0x1e927f=_0x663f[_0x5581ba];return _0x1e927f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf663('0x0'));module[_0xf663('0x1')]={'type':{'type':Sequelize[_0xf663('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xf663('0x2')]},'calleridname':{'type':Sequelize[_0xf663('0x2')]},'queue':{'type':Sequelize[_0xf663('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xf663('0x3')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x21cf96){var _0x3f47fd=moment(_0x21cf96);var _0x5e6fe2=moment(this[_0xf663('0x4')](_0xf663('0x5')))['format'](_0xf663('0x6'));var _0x4bdc96=_0x3f47fd[_0xf663('0x7')](_0x5e6fe2,_0xf663('0x8'));this[_0xf663('0x9')](_0xf663('0xa'),_0x21cf96);this[_0xf663('0x9')](_0xf663('0xb'),_0x4bdc96||null);}},'position':{'type':Sequelize[_0xf663('0xc')]},'count':{'type':Sequelize[_0xf663('0xc')]},'queuecallerabandon':{'type':Sequelize[_0xf663('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xf663('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xf663('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xf663('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xf663('0x2')],'comment':_0xf663('0xe')},'originalposition':{'type':Sequelize[_0xf663('0xc')]},'channel':{'type':Sequelize[_0xf663('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xf663('0x2')]},'exten':{'type':Sequelize[_0xf663('0x2')]},'priority':{'type':Sequelize['STRING']},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xf663('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xf663('0x2')]},'transfer':{'type':Sequelize[_0xf663('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xf663('0x2')],'comment':_0xf663('0xf')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xf663('0x2')]},'disposition':{'type':Sequelize[_0xf663('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xf663('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xf663('0xc')],'defaultValue':0x0},'note':{'type':Sequelize[_0xf663('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 128b55e..f3ff5b5 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 _0xdebb=['destroy','error','stack','name','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','model','keys','include','find','create','body','describe','getVoiceQueuesReport','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','update','then'];(function(_0x599c94,_0x464f0e){var _0x34e215=function(_0x36295a){while(--_0x36295a){_0x599c94['push'](_0x599c94['shift']());}};_0x34e215(++_0x464f0e);}(_0xdebb,0x7a));var _0xbdeb=function(_0x1fb3f2,_0x1eacf4){_0x1fb3f2=_0x1fb3f2-0x0;var _0x220105=_0xdebb[_0x1fb3f2];return _0x220105;};'use strict';var emlformat=require(_0xbdeb('0x0'));var rimraf=require(_0xbdeb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbdeb('0x2'));var rp=require(_0xbdeb('0x3'));var moment=require('moment');var BPromise=require(_0xbdeb('0x4'));var Mustache=require(_0xbdeb('0x5'));var util=require(_0xbdeb('0x6'));var path=require(_0xbdeb('0x7'));var sox=require(_0xbdeb('0x8'));var csv=require(_0xbdeb('0x9'));var ejs=require(_0xbdeb('0xa'));var fs=require('fs');var fs_extra=require(_0xbdeb('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbdeb('0xc'));var jsforce=require(_0xbdeb('0xd'));var deskjs=require(_0xbdeb('0xe'));var toCsv=require(_0xbdeb('0x9'));var querystring=require(_0xbdeb('0xf'));var Papa=require('papaparse');var Redis=require(_0xbdeb('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbdeb('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbdeb('0x12'))(_0xbdeb('0x13'));var utils=require(_0xbdeb('0x14'));var config=require(_0xbdeb('0x15'));var licenseUtil=require(_0xbdeb('0x16'));var db=require(_0xbdeb('0x17'))['db'];config[_0xbdeb('0x18')]=_[_0xbdeb('0x19')](config[_0xbdeb('0x18')],{'host':_0xbdeb('0x1a'),'port':0x18eb});var socket=require(_0xbdeb('0x1b'))(new Redis(config['redis']));require(_0xbdeb('0x1c'))[_0xbdeb('0x1d')](socket);function respondWithStatusCode(_0x525496,_0x2136ea){_0x2136ea=_0x2136ea||0xcc;return function(_0x350410){if(_0x350410){return _0x525496[_0xbdeb('0x1e')](_0x2136ea);}return _0x525496[_0xbdeb('0x1f')](_0x2136ea)[_0xbdeb('0x20')]();};}function respondWithResult(_0x4de252,_0x2e084f){_0x2e084f=_0x2e084f||0xc8;return function(_0x1811e7){if(_0x1811e7){return _0x4de252[_0xbdeb('0x1f')](_0x2e084f)['json'](_0x1811e7);}};}function respondWithFilteredResult(_0x418674,_0x11edd9){return function(_0x496661){if(_0x496661){var _0x8e6c38=typeof _0x11edd9[_0xbdeb('0x21')]===_0xbdeb('0x22')&&typeof _0x11edd9[_0xbdeb('0x23')]===_0xbdeb('0x22');var _0x4a08b1=_0x496661[_0xbdeb('0x24')];var _0xb5ecbc=_0x8e6c38?0x0:_0x11edd9[_0xbdeb('0x21')];var _0x5b6b9e=_0x8e6c38?_0x496661['count']:_0x11edd9[_0xbdeb('0x21')]+_0x11edd9[_0xbdeb('0x23')];var _0x547f3b;if(_0x5b6b9e>=_0x4a08b1){_0x5b6b9e=_0x4a08b1;_0x547f3b=0xc8;}else{_0x547f3b=0xce;}_0x418674['status'](_0x547f3b);return _0x418674['set'](_0xbdeb('0x25'),_0xb5ecbc+'-'+_0x5b6b9e+'/'+_0x4a08b1)['json'](_0x496661);}return null;};}function patchUpdates(_0x19449e){return function(_0x5ca2a5){try{jsonpatch[_0xbdeb('0x26')](_0x5ca2a5,_0x19449e,!![]);}catch(_0x235451){return BPromise[_0xbdeb('0x27')](_0x235451);}return _0x5ca2a5['save']();};}function saveUpdates(_0x5d61e5,_0x2dfd39){return function(_0x5245eb){if(_0x5245eb){return _0x5245eb[_0xbdeb('0x28')](_0x5d61e5)[_0xbdeb('0x29')](function(_0x43bd23){return _0x43bd23;});}return null;};}function removeEntity(_0x5962d2,_0x54bce4){return function(_0x2d4a32){if(_0x2d4a32){return _0x2d4a32[_0xbdeb('0x2a')]()[_0xbdeb('0x29')](function(){_0x5962d2[_0xbdeb('0x1f')](0xcc)[_0xbdeb('0x20')]();});}};}function handleEntityNotFound(_0x3ce7ea,_0x2bc76a){return function(_0x1d9f39){if(!_0x1d9f39){_0x3ce7ea[_0xbdeb('0x1e')](0x194);}return _0x1d9f39;};}function handleError(_0x5d8d5f,_0x590e13){_0x590e13=_0x590e13||0x1f4;return function(_0x5e06d5){logger[_0xbdeb('0x2b')](_0x5e06d5[_0xbdeb('0x2c')]);if(_0x5e06d5['name']){delete _0x5e06d5[_0xbdeb('0x2d')];}_0x5d8d5f[_0xbdeb('0x1f')](_0x590e13)['send'](_0x5e06d5);};}exports[_0xbdeb('0x2e')]=function(_0x2db4f8,_0x99d0bc){var _0x54cb5c={},_0xe56f4b={},_0x37c046={'count':0x0,'rows':[]};var _0x48bef7=_[_0xbdeb('0x2f')](db[_0xbdeb('0x30')][_0xbdeb('0x31')],function(_0x19f384){return{'name':_0x19f384[_0xbdeb('0x32')],'type':_0x19f384[_0xbdeb('0x33')][_0xbdeb('0x34')]};});_0xe56f4b['model']=_[_0xbdeb('0x2f')](_0x48bef7,_0xbdeb('0x2d'));_0xe56f4b[_0xbdeb('0x35')]=_['keys'](_0x2db4f8[_0xbdeb('0x35')]);_0xe56f4b[_0xbdeb('0x36')]=_[_0xbdeb('0x37')](_0xe56f4b['model'],_0xe56f4b[_0xbdeb('0x35')]);_0x54cb5c[_0xbdeb('0x38')]=_['intersection'](_0xe56f4b['model'],qs['fields'](_0x2db4f8['query'][_0xbdeb('0x39')]));_0x54cb5c[_0xbdeb('0x38')]=_0x54cb5c[_0xbdeb('0x38')][_0xbdeb('0x3a')]?_0x54cb5c[_0xbdeb('0x38')]:_0xe56f4b['model'];if(!_0x2db4f8[_0xbdeb('0x35')][_0xbdeb('0x3b')](_0xbdeb('0x3c'))){_0x54cb5c[_0xbdeb('0x23')]=qs[_0xbdeb('0x23')](_0x2db4f8[_0xbdeb('0x35')][_0xbdeb('0x23')]);_0x54cb5c['offset']=qs['offset'](_0x2db4f8['query'][_0xbdeb('0x21')]);}_0x54cb5c[_0xbdeb('0x3d')]=qs[_0xbdeb('0x3e')](_0x2db4f8['query'][_0xbdeb('0x3e')]);_0x54cb5c['where']=qs[_0xbdeb('0x36')](_[_0xbdeb('0x3f')](_0x2db4f8['query'],_0xe56f4b['filters']),_0x48bef7);if(_0x2db4f8['query'][_0xbdeb('0x40')]){_0x54cb5c[_0xbdeb('0x41')]=_[_0xbdeb('0x42')](_0x54cb5c[_0xbdeb('0x41')],{'$or':_[_0xbdeb('0x2f')](_0x48bef7,function(_0x570a38){if(_0x570a38[_0xbdeb('0x33')]!==_0xbdeb('0x43')){var _0x16ffad={};_0x16ffad[_0x570a38['name']]={'$like':'%'+_0x2db4f8[_0xbdeb('0x35')][_0xbdeb('0x40')]+'%'};return _0x16ffad;}})});}_0x54cb5c=_[_0xbdeb('0x42')]({},_0x54cb5c,_0x2db4f8[_0xbdeb('0x44')]);var _0x2babca={'where':_0x54cb5c[_0xbdeb('0x41')]};return db['VoiceQueueReport'][_0xbdeb('0x24')](_0x2babca)[_0xbdeb('0x29')](function(_0x331be1){_0x37c046[_0xbdeb('0x24')]=_0x331be1;if(_0x2db4f8['query'][_0xbdeb('0x45')]){_0x54cb5c['include']=[{'all':!![]}];}return db[_0xbdeb('0x30')][_0xbdeb('0x46')](_0x54cb5c);})[_0xbdeb('0x29')](function(_0x512fa7){_0x37c046[_0xbdeb('0x47')]=_0x512fa7;return _0x37c046;})['then'](respondWithFilteredResult(_0x99d0bc,_0x54cb5c))[_0xbdeb('0x48')](handleError(_0x99d0bc,null));};exports['show']=function(_0x35750f,_0x5298a2){var _0x143f4b={'raw':![],'where':{'id':_0x35750f[_0xbdeb('0x49')]['id']}},_0x39ceb7={};_0x39ceb7[_0xbdeb('0x4a')]=_['keys'](db[_0xbdeb('0x30')]['rawAttributes']);_0x39ceb7['query']=_[_0xbdeb('0x4b')](_0x35750f[_0xbdeb('0x35')]);_0x39ceb7[_0xbdeb('0x36')]=_[_0xbdeb('0x37')](_0x39ceb7['model'],_0x39ceb7[_0xbdeb('0x35')]);_0x143f4b[_0xbdeb('0x38')]=_[_0xbdeb('0x37')](_0x39ceb7[_0xbdeb('0x4a')],qs[_0xbdeb('0x39')](_0x35750f[_0xbdeb('0x35')][_0xbdeb('0x39')]));_0x143f4b[_0xbdeb('0x38')]=_0x143f4b[_0xbdeb('0x38')][_0xbdeb('0x3a')]?_0x143f4b['attributes']:_0x39ceb7[_0xbdeb('0x4a')];if(_0x35750f[_0xbdeb('0x35')]['includeAll']){_0x143f4b[_0xbdeb('0x4c')]=[{'all':!![]}];}_0x143f4b=_['merge']({},_0x143f4b,_0x35750f[_0xbdeb('0x44')]);return db[_0xbdeb('0x30')][_0xbdeb('0x4d')](_0x143f4b)['then'](handleEntityNotFound(_0x5298a2,null))[_0xbdeb('0x29')](respondWithResult(_0x5298a2,null))['catch'](handleError(_0x5298a2,null));};exports[_0xbdeb('0x4e')]=function(_0x12a5cb,_0x19ae0c){return db[_0xbdeb('0x30')][_0xbdeb('0x4e')](_0x12a5cb['body'],{})[_0xbdeb('0x29')](respondWithResult(_0x19ae0c,0xc9))[_0xbdeb('0x48')](handleError(_0x19ae0c,null));};exports['update']=function(_0x4b1ef8,_0x2c8f21){if(_0x4b1ef8[_0xbdeb('0x4f')]['id']){delete _0x4b1ef8[_0xbdeb('0x4f')]['id'];}return db['VoiceQueueReport'][_0xbdeb('0x4d')]({'where':{'id':_0x4b1ef8[_0xbdeb('0x49')]['id']}})[_0xbdeb('0x29')](handleEntityNotFound(_0x2c8f21,null))[_0xbdeb('0x29')](saveUpdates(_0x4b1ef8[_0xbdeb('0x4f')],null))['then'](respondWithResult(_0x2c8f21,null))['catch'](handleError(_0x2c8f21,null));};exports[_0xbdeb('0x2a')]=function(_0x417ff4,_0x365c32){return db[_0xbdeb('0x30')]['find']({'where':{'id':_0x417ff4[_0xbdeb('0x49')]['id']}})['then'](handleEntityNotFound(_0x365c32,null))[_0xbdeb('0x29')](removeEntity(_0x365c32,null))[_0xbdeb('0x48')](handleError(_0x365c32,null));};exports['describe']=function(_0x4fd3b0,_0x15e2c4){return db[_0xbdeb('0x30')][_0xbdeb('0x50')]()[_0xbdeb('0x29')](respondWithResult(_0x15e2c4,null))[_0xbdeb('0x48')](handleError(_0x15e2c4,null));};exports[_0xbdeb('0x51')]=function(_0x5b78fe,_0x3ad18e){var _0xd5ec93={},_0xa6d5aa={},_0x356312={'count':0x0,'rows':[]};_0xa6d5aa[_0xbdeb('0x4a')]=_[_0xbdeb('0x4b')](db[_0xbdeb('0x30')][_0xbdeb('0x31')]);_0xa6d5aa[_0xbdeb('0x35')]=_['keys'](_0x5b78fe['query']);_0xa6d5aa[_0xbdeb('0x36')]=_[_0xbdeb('0x37')](_0xa6d5aa[_0xbdeb('0x4a')],_0xa6d5aa[_0xbdeb('0x35')]);_0xd5ec93[_0xbdeb('0x38')]=_[_0xbdeb('0x37')](_0xa6d5aa[_0xbdeb('0x4a')],qs[_0xbdeb('0x39')](_0x5b78fe[_0xbdeb('0x35')]['fields']));_0xd5ec93['attributes']=_0xd5ec93['attributes'][_0xbdeb('0x3a')]?_0xd5ec93[_0xbdeb('0x38')]:_0xa6d5aa[_0xbdeb('0x4a')];if(!_0x5b78fe['query'][_0xbdeb('0x3b')](_0xbdeb('0x3c'))){_0xd5ec93[_0xbdeb('0x23')]=qs[_0xbdeb('0x23')](_0x5b78fe[_0xbdeb('0x35')][_0xbdeb('0x23')]);_0xd5ec93[_0xbdeb('0x21')]=qs[_0xbdeb('0x21')](_0x5b78fe[_0xbdeb('0x35')]['offset']);}_0xd5ec93[_0xbdeb('0x3d')]=qs[_0xbdeb('0x3e')](_0x5b78fe['query'][_0xbdeb('0x3e')]);_0xd5ec93[_0xbdeb('0x41')]=qs[_0xbdeb('0x36')](_[_0xbdeb('0x3f')](_0x5b78fe[_0xbdeb('0x35')],_0xa6d5aa[_0xbdeb('0x36')]));if(_0x5b78fe[_0xbdeb('0x35')][_0xbdeb('0x40')]){_0xd5ec93[_0xbdeb('0x41')]=_['merge'](_0xd5ec93['where'],{'$or':_[_0xbdeb('0x2f')](_0xd5ec93[_0xbdeb('0x38')],function(_0x58871a){var _0x1ca8b4={};_0x1ca8b4[_0x58871a]={'$like':'%'+_0x5b78fe[_0xbdeb('0x35')][_0xbdeb('0x40')]+'%'};return _0x1ca8b4;})});}_0xd5ec93=_[_0xbdeb('0x42')]({},_0xd5ec93,_0x5b78fe[_0xbdeb('0x44')]);var _0x5f2b48={'where':_0xd5ec93[_0xbdeb('0x41')]};return db[_0xbdeb('0x30')][_0xbdeb('0x24')](_0x5f2b48)[_0xbdeb('0x29')](function(_0x541b38){_0x356312[_0xbdeb('0x24')]=_0x541b38;if(_0x5b78fe[_0xbdeb('0x35')]['includeAll']){_0xd5ec93[_0xbdeb('0x4c')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0xbdeb('0x46')](_0xd5ec93);})[_0xbdeb('0x29')](function(_0x18adea){_0x356312['rows']=_0x18adea;return _0x356312;})['then'](respondWithFilteredResult(_0x3ad18e,_0xd5ec93,_0xbdeb('0x51')))[_0xbdeb('0x48')](handleError(_0x3ad18e,null,_0xbdeb('0x51')));}; \ No newline at end of file +var _0x68dd=['moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','defaults','redis','localhost','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','filter','VoiceQueueReport','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','describe','getVoiceQueuesReport','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x46dfda,_0x31a106){var _0x86d52=function(_0x4de4f0){while(--_0x4de4f0){_0x46dfda['push'](_0x46dfda['shift']());}};_0x86d52(++_0x31a106);}(_0x68dd,0xa0));var _0xd68d=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x68dd[_0x279d37];return _0x530173;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd68d('0x0'));var zipdir=require(_0xd68d('0x1'));var jsonpatch=require(_0xd68d('0x2'));var rp=require(_0xd68d('0x3'));var moment=require(_0xd68d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd68d('0x5'));var util=require(_0xd68d('0x6'));var path=require(_0xd68d('0x7'));var sox=require(_0xd68d('0x8'));var csv=require(_0xd68d('0x9'));var ejs=require(_0xd68d('0xa'));var fs=require('fs');var fs_extra=require(_0xd68d('0xb'));var _=require('lodash');var squel=require(_0xd68d('0xc'));var crypto=require('crypto');var jsforce=require(_0xd68d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd68d('0xe'));var Papa=require(_0xd68d('0xf'));var Redis=require(_0xd68d('0x10'));var authService=require(_0xd68d('0x11'));var qs=require(_0xd68d('0x12'));var as=require(_0xd68d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd68d('0x14'))(_0xd68d('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd68d('0x16'))['db'];config['redis']=_[_0xd68d('0x17')](config[_0xd68d('0x18')],{'host':_0xd68d('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd68d('0x18')]));require(_0xd68d('0x1a'))[_0xd68d('0x1b')](socket);function respondWithStatusCode(_0x2e46c1,_0x1b69ba){_0x1b69ba=_0x1b69ba||0xcc;return function(_0x347b1e){if(_0x347b1e){return _0x2e46c1[_0xd68d('0x1c')](_0x1b69ba);}return _0x2e46c1[_0xd68d('0x1d')](_0x1b69ba)[_0xd68d('0x1e')]();};}function respondWithResult(_0xec211c,_0x166d07){_0x166d07=_0x166d07||0xc8;return function(_0x58408e){if(_0x58408e){return _0xec211c['status'](_0x166d07)[_0xd68d('0x1f')](_0x58408e);}};}function respondWithFilteredResult(_0x349ab9,_0x41a13b){return function(_0x4894e5){if(_0x4894e5){var _0x3db67f=typeof _0x41a13b[_0xd68d('0x20')]===_0xd68d('0x21')&&typeof _0x41a13b[_0xd68d('0x22')]===_0xd68d('0x21');var _0x58668e=_0x4894e5[_0xd68d('0x23')];var _0x3d3cf3=_0x3db67f?0x0:_0x41a13b['offset'];var _0x292a76=_0x3db67f?_0x4894e5[_0xd68d('0x23')]:_0x41a13b[_0xd68d('0x20')]+_0x41a13b[_0xd68d('0x22')];var _0x51b08a;if(_0x292a76>=_0x58668e){_0x292a76=_0x58668e;_0x51b08a=0xc8;}else{_0x51b08a=0xce;}_0x349ab9[_0xd68d('0x1d')](_0x51b08a);return _0x349ab9[_0xd68d('0x24')](_0xd68d('0x25'),_0x3d3cf3+'-'+_0x292a76+'/'+_0x58668e)['json'](_0x4894e5);}return null;};}function patchUpdates(_0xb3ded3){return function(_0x4eb120){try{jsonpatch['apply'](_0x4eb120,_0xb3ded3,!![]);}catch(_0x833418){return BPromise[_0xd68d('0x26')](_0x833418);}return _0x4eb120[_0xd68d('0x27')]();};}function saveUpdates(_0x29aae0,_0x1fdbbb){return function(_0x5d14c4){if(_0x5d14c4){return _0x5d14c4[_0xd68d('0x28')](_0x29aae0)['then'](function(_0x54ec72){return _0x54ec72;});}return null;};}function removeEntity(_0x13a2fe,_0x5b2c58){return function(_0x3031d3){if(_0x3031d3){return _0x3031d3[_0xd68d('0x29')]()[_0xd68d('0x2a')](function(){_0x13a2fe[_0xd68d('0x1d')](0xcc)[_0xd68d('0x1e')]();});}};}function handleEntityNotFound(_0x5016e3,_0x19b00c){return function(_0x126991){if(!_0x126991){_0x5016e3['sendStatus'](0x194);}return _0x126991;};}function handleError(_0x3741f5,_0x196399){_0x196399=_0x196399||0x1f4;return function(_0x3249c7){logger['error'](_0x3249c7[_0xd68d('0x2b')]);if(_0x3249c7[_0xd68d('0x2c')]){delete _0x3249c7[_0xd68d('0x2c')];}_0x3741f5[_0xd68d('0x1d')](_0x196399)[_0xd68d('0x2d')](_0x3249c7);};}exports[_0xd68d('0x2e')]=function(_0x11ef22,_0x78da2c){var _0x554254={},_0x3b69f4={},_0x1947b8={'count':0x0,'rows':[]};var _0xbbf6c6=_[_0xd68d('0x2f')](db['VoiceQueueReport'][_0xd68d('0x30')],function(_0x4f265e){return{'name':_0x4f265e[_0xd68d('0x31')],'type':_0x4f265e[_0xd68d('0x32')]['key']};});_0x3b69f4[_0xd68d('0x33')]=_[_0xd68d('0x2f')](_0xbbf6c6,'name');_0x3b69f4[_0xd68d('0x34')]=_[_0xd68d('0x35')](_0x11ef22[_0xd68d('0x34')]);_0x3b69f4[_0xd68d('0x36')]=_[_0xd68d('0x37')](_0x3b69f4[_0xd68d('0x33')],_0x3b69f4['query']);_0x554254[_0xd68d('0x38')]=_[_0xd68d('0x37')](_0x3b69f4['model'],qs[_0xd68d('0x39')](_0x11ef22[_0xd68d('0x34')][_0xd68d('0x39')]));_0x554254[_0xd68d('0x38')]=_0x554254[_0xd68d('0x38')][_0xd68d('0x3a')]?_0x554254['attributes']:_0x3b69f4[_0xd68d('0x33')];if(!_0x11ef22['query'][_0xd68d('0x3b')](_0xd68d('0x3c'))){_0x554254[_0xd68d('0x22')]=qs[_0xd68d('0x22')](_0x11ef22['query'][_0xd68d('0x22')]);_0x554254[_0xd68d('0x20')]=qs[_0xd68d('0x20')](_0x11ef22[_0xd68d('0x34')][_0xd68d('0x20')]);}_0x554254[_0xd68d('0x3d')]=qs[_0xd68d('0x3e')](_0x11ef22['query'][_0xd68d('0x3e')]);_0x554254['where']=qs[_0xd68d('0x36')](_[_0xd68d('0x3f')](_0x11ef22['query'],_0x3b69f4[_0xd68d('0x36')]),_0xbbf6c6);if(_0x11ef22['query']['filter']){_0x554254['where']=_[_0xd68d('0x40')](_0x554254[_0xd68d('0x41')],{'$or':_[_0xd68d('0x2f')](_0xbbf6c6,function(_0x41ac81){if(_0x41ac81[_0xd68d('0x32')]!==_0xd68d('0x42')){var _0x2104b5={};_0x2104b5[_0x41ac81[_0xd68d('0x2c')]]={'$like':'%'+_0x11ef22[_0xd68d('0x34')][_0xd68d('0x43')]+'%'};return _0x2104b5;}})});}_0x554254=_['merge']({},_0x554254,_0x11ef22['options']);var _0x17eb45={'where':_0x554254[_0xd68d('0x41')]};return db[_0xd68d('0x44')][_0xd68d('0x23')](_0x17eb45)[_0xd68d('0x2a')](function(_0x4d519c){_0x1947b8[_0xd68d('0x23')]=_0x4d519c;if(_0x11ef22[_0xd68d('0x34')][_0xd68d('0x45')]){_0x554254['include']=[{'all':!![]}];}return db[_0xd68d('0x44')][_0xd68d('0x46')](_0x554254);})[_0xd68d('0x2a')](function(_0x500860){_0x1947b8[_0xd68d('0x47')]=_0x500860;return _0x1947b8;})[_0xd68d('0x2a')](respondWithFilteredResult(_0x78da2c,_0x554254))[_0xd68d('0x48')](handleError(_0x78da2c,null));};exports[_0xd68d('0x49')]=function(_0x4eaa4b,_0x5e12af){var _0x31f1c9={'raw':![],'where':{'id':_0x4eaa4b[_0xd68d('0x4a')]['id']}},_0xab54a9={};_0xab54a9[_0xd68d('0x33')]=_['keys'](db[_0xd68d('0x44')]['rawAttributes']);_0xab54a9[_0xd68d('0x34')]=_['keys'](_0x4eaa4b[_0xd68d('0x34')]);_0xab54a9[_0xd68d('0x36')]=_[_0xd68d('0x37')](_0xab54a9[_0xd68d('0x33')],_0xab54a9['query']);_0x31f1c9['attributes']=_[_0xd68d('0x37')](_0xab54a9[_0xd68d('0x33')],qs[_0xd68d('0x39')](_0x4eaa4b[_0xd68d('0x34')][_0xd68d('0x39')]));_0x31f1c9['attributes']=_0x31f1c9[_0xd68d('0x38')][_0xd68d('0x3a')]?_0x31f1c9['attributes']:_0xab54a9['model'];if(_0x4eaa4b[_0xd68d('0x34')][_0xd68d('0x45')]){_0x31f1c9[_0xd68d('0x4b')]=[{'all':!![]}];}_0x31f1c9=_['merge']({},_0x31f1c9,_0x4eaa4b[_0xd68d('0x4c')]);return db['VoiceQueueReport'][_0xd68d('0x4d')](_0x31f1c9)[_0xd68d('0x2a')](handleEntityNotFound(_0x5e12af,null))[_0xd68d('0x2a')](respondWithResult(_0x5e12af,null))[_0xd68d('0x48')](handleError(_0x5e12af,null));};exports[_0xd68d('0x4e')]=function(_0x2298f1,_0x15eb79){return db[_0xd68d('0x44')][_0xd68d('0x4e')](_0x2298f1[_0xd68d('0x4f')],{})[_0xd68d('0x2a')](respondWithResult(_0x15eb79,0xc9))[_0xd68d('0x48')](handleError(_0x15eb79,null));};exports['update']=function(_0x438342,_0x27bb76){if(_0x438342[_0xd68d('0x4f')]['id']){delete _0x438342[_0xd68d('0x4f')]['id'];}return db[_0xd68d('0x44')][_0xd68d('0x4d')]({'where':{'id':_0x438342['params']['id']}})[_0xd68d('0x2a')](handleEntityNotFound(_0x27bb76,null))[_0xd68d('0x2a')](saveUpdates(_0x438342[_0xd68d('0x4f')],null))[_0xd68d('0x2a')](respondWithResult(_0x27bb76,null))[_0xd68d('0x48')](handleError(_0x27bb76,null));};exports[_0xd68d('0x29')]=function(_0x21ed04,_0x5e1ecc){return db[_0xd68d('0x44')]['find']({'where':{'id':_0x21ed04[_0xd68d('0x4a')]['id']}})[_0xd68d('0x2a')](handleEntityNotFound(_0x5e1ecc,null))[_0xd68d('0x2a')](removeEntity(_0x5e1ecc,null))[_0xd68d('0x48')](handleError(_0x5e1ecc,null));};exports[_0xd68d('0x50')]=function(_0x3161ff,_0x23881e){return db[_0xd68d('0x44')]['describe']()[_0xd68d('0x2a')](respondWithResult(_0x23881e,null))['catch'](handleError(_0x23881e,null));};exports['getVoiceQueuesReport']=function(_0x1351c0,_0x2c7ea5){var _0x58ceb6={},_0x2b8d0e={},_0x3bff27={'count':0x0,'rows':[]};_0x2b8d0e[_0xd68d('0x33')]=_[_0xd68d('0x35')](db[_0xd68d('0x44')][_0xd68d('0x30')]);_0x2b8d0e[_0xd68d('0x34')]=_[_0xd68d('0x35')](_0x1351c0['query']);_0x2b8d0e[_0xd68d('0x36')]=_[_0xd68d('0x37')](_0x2b8d0e[_0xd68d('0x33')],_0x2b8d0e[_0xd68d('0x34')]);_0x58ceb6[_0xd68d('0x38')]=_['intersection'](_0x2b8d0e['model'],qs[_0xd68d('0x39')](_0x1351c0[_0xd68d('0x34')][_0xd68d('0x39')]));_0x58ceb6['attributes']=_0x58ceb6[_0xd68d('0x38')][_0xd68d('0x3a')]?_0x58ceb6[_0xd68d('0x38')]:_0x2b8d0e['model'];if(!_0x1351c0[_0xd68d('0x34')]['hasOwnProperty']('nolimit')){_0x58ceb6[_0xd68d('0x22')]=qs[_0xd68d('0x22')](_0x1351c0[_0xd68d('0x34')][_0xd68d('0x22')]);_0x58ceb6['offset']=qs[_0xd68d('0x20')](_0x1351c0[_0xd68d('0x34')][_0xd68d('0x20')]);}_0x58ceb6['order']=qs[_0xd68d('0x3e')](_0x1351c0[_0xd68d('0x34')]['sort']);_0x58ceb6[_0xd68d('0x41')]=qs['filters'](_[_0xd68d('0x3f')](_0x1351c0[_0xd68d('0x34')],_0x2b8d0e[_0xd68d('0x36')]));if(_0x1351c0[_0xd68d('0x34')][_0xd68d('0x43')]){_0x58ceb6[_0xd68d('0x41')]=_[_0xd68d('0x40')](_0x58ceb6[_0xd68d('0x41')],{'$or':_[_0xd68d('0x2f')](_0x58ceb6['attributes'],function(_0x380559){var _0x4c1cda={};_0x4c1cda[_0x380559]={'$like':'%'+_0x1351c0[_0xd68d('0x34')]['filter']+'%'};return _0x4c1cda;})});}_0x58ceb6=_[_0xd68d('0x40')]({},_0x58ceb6,_0x1351c0[_0xd68d('0x4c')]);var _0x49b73f={'where':_0x58ceb6[_0xd68d('0x41')]};return db[_0xd68d('0x44')][_0xd68d('0x23')](_0x49b73f)['then'](function(_0x194df7){_0x3bff27['count']=_0x194df7;if(_0x1351c0[_0xd68d('0x34')][_0xd68d('0x45')]){_0x58ceb6[_0xd68d('0x4b')]=[{'all':!![]}];}return db[_0xd68d('0x44')][_0xd68d('0x46')](_0x58ceb6);})[_0xd68d('0x2a')](function(_0x4ada29){_0x3bff27['rows']=_0x4ada29;return _0x3bff27;})['then'](respondWithFilteredResult(_0x2c7ea5,_0x58ceb6,'getVoiceQueuesReport'))[_0xd68d('0x48')](handleError(_0x2c7ea5,null,_0xd68d('0x51')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 878bbdc..aea6dea 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 _0x4e04=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x4e04,0xed));var _0x44e0=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x4e04[_0x4cf98e];return _0x1623ac;};'use strict';var EventEmitter=require(_0x44e0('0x0'));var VoiceQueueReport=require(_0x44e0('0x1'))['db'][_0x44e0('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x44e0('0x3')](0x0);var events={'afterCreate':_0x44e0('0x4'),'afterUpdate':_0x44e0('0x5'),'afterDestroy':_0x44e0('0x6')};function emitEvent(_0x188a22){return function(_0x5d5f49,_0x2f2ad2,_0x596193){VoiceQueueReportEvents[_0x44e0('0x7')](_0x188a22+':'+_0x5d5f49['id'],_0x5d5f49);VoiceQueueReportEvents[_0x44e0('0x7')](_0x188a22,_0x5d5f49);_0x596193(null);};}for(var e in events){if(events[_0x44e0('0x8')](e)){var event=events[e];VoiceQueueReport[_0x44e0('0x9')](e,emitEvent(event));}}module[_0x44e0('0xa')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xdb4b=['emit','hook','exports','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove'];(function(_0x540511,_0x201e3b){var _0x5c1ac6=function(_0xdacf37){while(--_0xdacf37){_0x540511['push'](_0x540511['shift']());}};_0x5c1ac6(++_0x201e3b);}(_0xdb4b,0x1a1));var _0xbdb4=function(_0x33aefe,_0x371ccd){_0x33aefe=_0x33aefe-0x0;var _0x471d19=_0xdb4b[_0x33aefe];return _0x471d19;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xbdb4('0x0'))['db'][_0xbdb4('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xbdb4('0x2')](0x0);var events={'afterCreate':_0xbdb4('0x3'),'afterUpdate':_0xbdb4('0x4'),'afterDestroy':_0xbdb4('0x5')};function emitEvent(_0x447a15){return function(_0x457e24,_0x2ddc64,_0x126dcf){VoiceQueueReportEvents[_0xbdb4('0x6')](_0x447a15+':'+_0x457e24['id'],_0x457e24);VoiceQueueReportEvents[_0xbdb4('0x6')](_0x447a15,_0x457e24);_0x126dcf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xbdb4('0x7')](e,emitEvent(event));}}module[_0xbdb4('0x8')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index af23e36..22516d2 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 _0x2896=['../../config/environment','./voiceQueueReport.attributes','define','VoiceQueueReport','calleridnum','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x236df7,_0x3a00eb){var _0x125d69=function(_0x4a4411){while(--_0x4a4411){_0x236df7['push'](_0x236df7['shift']());}};_0x125d69(++_0x3a00eb);}(_0x2896,0x157));var _0x6289=function(_0x1d55d1,_0xbedf34){_0x1d55d1=_0x1d55d1-0x0;var _0x20596a=_0x2896[_0x1d55d1];return _0x20596a;};'use strict';var _=require(_0x6289('0x0'));var util=require(_0x6289('0x1'));var logger=require(_0x6289('0x2'))(_0x6289('0x3'));var moment=require('moment');var BPromise=require(_0x6289('0x4'));var rp=require(_0x6289('0x5'));var fs=require('fs');var path=require(_0x6289('0x6'));var rimraf=require(_0x6289('0x7'));var config=require(_0x6289('0x8'));var attributes=require(_0x6289('0x9'));module['exports']=function(_0x365460,_0x1c9fae){return _0x365460[_0x6289('0xa')](_0x6289('0xb'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x6289('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x93a0=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','report_queue','uniqueid','calleridnum','lodash'];(function(_0x5b79c1,_0x360bf0){var _0x248497=function(_0x1b1dad){while(--_0x1b1dad){_0x5b79c1['push'](_0x5b79c1['shift']());}};_0x248497(++_0x360bf0);}(_0x93a0,0x12b));var _0x093a=function(_0x4334de,_0x4c8031){_0x4334de=_0x4334de-0x0;var _0x54dc66=_0x93a0[_0x4334de];return _0x54dc66;};'use strict';var _=require(_0x093a('0x0'));var util=require('util');var logger=require(_0x093a('0x1'))('api');var moment=require(_0x093a('0x2'));var BPromise=require(_0x093a('0x3'));var rp=require(_0x093a('0x4'));var fs=require('fs');var path=require(_0x093a('0x5'));var rimraf=require('rimraf');var config=require(_0x093a('0x6'));var attributes=require('./voiceQueueReport.attributes');module[_0x093a('0x7')]=function(_0x10eb5a,_0xc7db32){return _0x10eb5a[_0x093a('0x8')]('VoiceQueueReport',attributes,{'tableName':_0x093a('0x9'),'paranoid':![],'indexes':[{'fields':[_0x093a('0xa')]},{'fields':[_0x093a('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 18d9aad..47daa8f 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 _0x8e16=['http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','options','raw','attributes','limit','include','model','map','GetVoiceQueueReport','debug','CreateVoiceQueueReport','VoiceQueueReport','create','body','catch','UpdateVoiceQueueReport','update','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x8e16,0x11e));var _0x68e1=function(_0x4e9d4a,_0x6203c4){_0x4e9d4a=_0x4e9d4a-0x0;var _0x288d6a=_0x8e16[_0x4e9d4a];return _0x288d6a;};'use strict';var _=require(_0x68e1('0x0'));var util=require(_0x68e1('0x1'));var moment=require('moment');var BPromise=require(_0x68e1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x68e1('0x3'))['db'];var utils=require(_0x68e1('0x4'));var logger=require(_0x68e1('0x5'))(_0x68e1('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x68e1('0x7')][_0x68e1('0x8')]({'port':0x232a});config[_0x68e1('0x9')]=_[_0x68e1('0xa')](config['redis'],{'host':_0x68e1('0xb'),'port':0x18eb});var socket=require(_0x68e1('0xc'))(new Redis(config[_0x68e1('0x9')]));require(_0x68e1('0xd'))[_0x68e1('0xe')](socket);function respondWithRpcPromise(_0x1bb820,_0x8100ff,_0x22d008){return new BPromise(function(_0x4ed30f,_0x29cd0e){return client[_0x68e1('0xf')](_0x1bb820,_0x22d008)[_0x68e1('0x10')](function(_0x11ce37){logger[_0x68e1('0x11')](_0x68e1('0x12'),_0x8100ff,_0x68e1('0x13'));logger['debug'](_0x68e1('0x14'),_0x8100ff,_0x68e1('0x13'),JSON[_0x68e1('0x15')](_0x11ce37));if(_0x11ce37[_0x68e1('0x16')]){if(_0x11ce37[_0x68e1('0x16')][_0x68e1('0x17')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x8100ff,_0x11ce37[_0x68e1('0x16')][_0x68e1('0x18')]);return _0x29cd0e(_0x11ce37[_0x68e1('0x16')]['message']);}logger[_0x68e1('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x8100ff,_0x11ce37[_0x68e1('0x16')]['message']);return _0x4ed30f(_0x11ce37[_0x68e1('0x16')][_0x68e1('0x18')]);}else{logger[_0x68e1('0x11')](_0x68e1('0x12'),_0x8100ff,'request\x20sent');_0x4ed30f(_0x11ce37[_0x68e1('0x19')][_0x68e1('0x18')]);}})['catch'](function(_0x4c3422){logger[_0x68e1('0x16')](_0x68e1('0x12'),_0x8100ff,_0x4c3422);_0x29cd0e(_0x4c3422);});});}exports['GetVoiceQueueReport']=function(_0x1bce89){var _0x1e6a62=this;return new Promise(function(_0x461de5,_0x172dad){return db['VoiceQueueReport']['findAll']({'raw':_0x1bce89[_0x68e1('0x1a')]?_0x1bce89[_0x68e1('0x1a')][_0x68e1('0x1b')]===undefined?!![]:![]:!![],'where':_0x1bce89[_0x68e1('0x1a')]?_0x1bce89[_0x68e1('0x1a')]['where']||null:null,'attributes':_0x1bce89[_0x68e1('0x1a')]?_0x1bce89[_0x68e1('0x1a')][_0x68e1('0x1c')]||null:null,'limit':_0x1bce89[_0x68e1('0x1a')]?_0x1bce89['options'][_0x68e1('0x1d')]||null:null,'include':_0x1bce89['options']?_0x1bce89[_0x68e1('0x1a')][_0x68e1('0x1e')]?_['map'](_0x1bce89[_0x68e1('0x1a')][_0x68e1('0x1e')],function(_0x1fb626){return{'model':db[_0x1fb626[_0x68e1('0x1f')]],'as':_0x1fb626['as'],'attributes':_0x1fb626['attributes'],'include':_0x1fb626[_0x68e1('0x1e')]?_[_0x68e1('0x20')](_0x1fb626[_0x68e1('0x1e')],function(_0x2e5d94){return{'model':db[_0x2e5d94[_0x68e1('0x1f')]],'as':_0x2e5d94['as'],'attributes':_0x2e5d94[_0x68e1('0x1c')],'include':_0x2e5d94[_0x68e1('0x1e')]?_['map'](_0x2e5d94[_0x68e1('0x1e')],function(_0x598a83){return{'model':db[_0x598a83[_0x68e1('0x1f')]],'as':_0x598a83['as'],'attributes':_0x598a83[_0x68e1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x68e1('0x10')](function(_0x180cb6){logger[_0x68e1('0x11')](_0x68e1('0x21'),_0x1bce89);logger[_0x68e1('0x22')](_0x68e1('0x21'),_0x1bce89,JSON[_0x68e1('0x15')](_0x180cb6));_0x461de5(_0x180cb6);})['catch'](function(_0x3e8bf4){logger['error'](_0x68e1('0x21'),_0x3e8bf4[_0x68e1('0x18')],_0x1bce89);_0x172dad(_0x1e6a62['error'](0x1f4,_0x3e8bf4[_0x68e1('0x18')]));});});};exports[_0x68e1('0x23')]=function(_0xd55fb6){var _0x32829b=this;return new Promise(function(_0x565de1,_0x5459f9){return db[_0x68e1('0x24')][_0x68e1('0x25')](_0xd55fb6[_0x68e1('0x26')],{'raw':_0xd55fb6[_0x68e1('0x1a')]?_0xd55fb6[_0x68e1('0x1a')][_0x68e1('0x1b')]===undefined?!![]:![]:!![]})[_0x68e1('0x10')](function(_0x179c20){logger['info'](_0x68e1('0x23'),_0xd55fb6);logger[_0x68e1('0x22')](_0x68e1('0x23'),_0xd55fb6,JSON['stringify'](_0x179c20));_0x565de1(_0x179c20);})[_0x68e1('0x27')](function(_0x39544a){logger[_0x68e1('0x16')](_0x68e1('0x23'),_0x39544a[_0x68e1('0x18')],_0xd55fb6);_0x5459f9(_0x32829b['error'](0x1f4,_0x39544a[_0x68e1('0x18')]));});});};exports[_0x68e1('0x28')]=function(_0x22da1e){var _0x32f98a=this;return new Promise(function(_0x44d88d,_0x4193e1){return db['VoiceQueueReport'][_0x68e1('0x29')](_0x22da1e[_0x68e1('0x26')],{'raw':_0x22da1e['options']?_0x22da1e[_0x68e1('0x1a')][_0x68e1('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22da1e[_0x68e1('0x1a')]?_0x22da1e[_0x68e1('0x1a')]['where']||null:null,'attributes':_0x22da1e[_0x68e1('0x1a')]?_0x22da1e[_0x68e1('0x1a')]['attributes']||null:null,'limit':_0x22da1e[_0x68e1('0x1a')]?_0x22da1e[_0x68e1('0x1a')][_0x68e1('0x1d')]||null:null})[_0x68e1('0x10')](function(_0x524b72){logger[_0x68e1('0x11')](_0x68e1('0x28'),_0x22da1e);logger['debug'](_0x68e1('0x28'),_0x22da1e,JSON[_0x68e1('0x15')](_0x524b72));_0x44d88d(_0x524b72);})[_0x68e1('0x27')](function(_0x358bfb){logger['error'](_0x68e1('0x28'),_0x358bfb[_0x68e1('0x18')],_0x22da1e);_0x4193e1(_0x32f98a['error'](0x1f4,_0x358bfb[_0x68e1('0x18')]));});});}; \ No newline at end of file +var _0x3df7=['options','where','attributes','limit','map','include','model','debug','GetVoiceQueueReport','catch','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','update','raw','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','then','info','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','VoiceQueueReport','findAll'];(function(_0x478c8a,_0x9afc92){var _0x3b6b3e=function(_0x37634e){while(--_0x37634e){_0x478c8a['push'](_0x478c8a['shift']());}};_0x3b6b3e(++_0x9afc92);}(_0x3df7,0x1c8));var _0x73df=function(_0x3e4fd6,_0x584a06){_0x3e4fd6=_0x3e4fd6-0x0;var _0x370a11=_0x3df7[_0x3e4fd6];return _0x370a11;};'use strict';var _=require(_0x73df('0x0'));var util=require('util');var moment=require(_0x73df('0x1'));var BPromise=require(_0x73df('0x2'));var rs=require(_0x73df('0x3'));var fs=require('fs');var Redis=require(_0x73df('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x73df('0x5'));var logger=require(_0x73df('0x6'))('rpc');var config=require(_0x73df('0x7'));var jayson=require(_0x73df('0x8'));var client=jayson[_0x73df('0x9')][_0x73df('0xa')]({'port':0x232a});config[_0x73df('0xb')]=_[_0x73df('0xc')](config[_0x73df('0xb')],{'host':_0x73df('0xd'),'port':0x18eb});var socket=require(_0x73df('0xe'))(new Redis(config[_0x73df('0xb')]));require(_0x73df('0xf'))['register'](socket);function respondWithRpcPromise(_0x51f40c,_0x31f733,_0x75f40a){return new BPromise(function(_0xb5bb13,_0x4f5481){return client['request'](_0x51f40c,_0x75f40a)[_0x73df('0x10')](function(_0x1d7c23){logger[_0x73df('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x31f733,_0x73df('0x12'));logger['debug'](_0x73df('0x13'),_0x31f733,'request\x20sent',JSON[_0x73df('0x14')](_0x1d7c23));if(_0x1d7c23[_0x73df('0x15')]){if(_0x1d7c23[_0x73df('0x15')][_0x73df('0x16')]===0x1f4){logger[_0x73df('0x15')](_0x73df('0x17'),_0x31f733,_0x1d7c23['error']['message']);return _0x4f5481(_0x1d7c23[_0x73df('0x15')][_0x73df('0x18')]);}logger[_0x73df('0x15')](_0x73df('0x17'),_0x31f733,_0x1d7c23[_0x73df('0x15')][_0x73df('0x18')]);return _0xb5bb13(_0x1d7c23[_0x73df('0x15')]['message']);}else{logger[_0x73df('0x11')](_0x73df('0x17'),_0x31f733,_0x73df('0x12'));_0xb5bb13(_0x1d7c23[_0x73df('0x19')]['message']);}})['catch'](function(_0x3fbf12){logger[_0x73df('0x15')](_0x73df('0x17'),_0x31f733,_0x3fbf12);_0x4f5481(_0x3fbf12);});});}exports['GetVoiceQueueReport']=function(_0xf6641b){var _0x53a158=this;return new Promise(function(_0x21912a,_0x5f542e){return db[_0x73df('0x1a')][_0x73df('0x1b')]({'raw':_0xf6641b[_0x73df('0x1c')]?_0xf6641b[_0x73df('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0xf6641b['options']?_0xf6641b['options'][_0x73df('0x1d')]||null:null,'attributes':_0xf6641b[_0x73df('0x1c')]?_0xf6641b['options'][_0x73df('0x1e')]||null:null,'limit':_0xf6641b[_0x73df('0x1c')]?_0xf6641b['options'][_0x73df('0x1f')]||null:null,'include':_0xf6641b[_0x73df('0x1c')]?_0xf6641b[_0x73df('0x1c')]['include']?_[_0x73df('0x20')](_0xf6641b[_0x73df('0x1c')][_0x73df('0x21')],function(_0x2d7bb8){return{'model':db[_0x2d7bb8['model']],'as':_0x2d7bb8['as'],'attributes':_0x2d7bb8['attributes'],'include':_0x2d7bb8[_0x73df('0x21')]?_[_0x73df('0x20')](_0x2d7bb8['include'],function(_0x276f91){return{'model':db[_0x276f91[_0x73df('0x22')]],'as':_0x276f91['as'],'attributes':_0x276f91[_0x73df('0x1e')],'include':_0x276f91['include']?_[_0x73df('0x20')](_0x276f91[_0x73df('0x21')],function(_0x1095d3){return{'model':db[_0x1095d3['model']],'as':_0x1095d3['as'],'attributes':_0x1095d3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xed60ff){logger[_0x73df('0x11')]('GetVoiceQueueReport',_0xf6641b);logger[_0x73df('0x23')](_0x73df('0x24'),_0xf6641b,JSON[_0x73df('0x14')](_0xed60ff));_0x21912a(_0xed60ff);})[_0x73df('0x25')](function(_0x1c0c2b){logger['error'](_0x73df('0x24'),_0x1c0c2b[_0x73df('0x18')],_0xf6641b);_0x5f542e(_0x53a158['error'](0x1f4,_0x1c0c2b['message']));});});};exports[_0x73df('0x26')]=function(_0x214c3a){var _0x58a991=this;return new Promise(function(_0x477a5b,_0x305a79){return db['VoiceQueueReport'][_0x73df('0x27')](_0x214c3a[_0x73df('0x28')],{'raw':_0x214c3a[_0x73df('0x1c')]?_0x214c3a[_0x73df('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x73df('0x10')](function(_0x5a03ed){logger[_0x73df('0x11')](_0x73df('0x26'),_0x214c3a);logger[_0x73df('0x23')]('CreateVoiceQueueReport',_0x214c3a,JSON['stringify'](_0x5a03ed));_0x477a5b(_0x5a03ed);})[_0x73df('0x25')](function(_0x1064dc){logger[_0x73df('0x15')](_0x73df('0x26'),_0x1064dc[_0x73df('0x18')],_0x214c3a);_0x305a79(_0x58a991[_0x73df('0x15')](0x1f4,_0x1064dc['message']));});});};exports[_0x73df('0x29')]=function(_0x168bee){var _0x1db36a=this;return new Promise(function(_0x13f691,_0x156b8b){return db[_0x73df('0x1a')][_0x73df('0x2a')](_0x168bee[_0x73df('0x28')],{'raw':_0x168bee['options']?_0x168bee[_0x73df('0x1c')][_0x73df('0x2b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x168bee[_0x73df('0x1c')]?_0x168bee['options'][_0x73df('0x1d')]||null:null,'attributes':_0x168bee[_0x73df('0x1c')]?_0x168bee[_0x73df('0x1c')][_0x73df('0x1e')]||null:null,'limit':_0x168bee['options']?_0x168bee[_0x73df('0x1c')][_0x73df('0x1f')]||null:null})[_0x73df('0x10')](function(_0x39f35e){logger[_0x73df('0x11')]('UpdateVoiceQueueReport',_0x168bee);logger['debug'](_0x73df('0x29'),_0x168bee,JSON[_0x73df('0x14')](_0x39f35e));_0x13f691(_0x39f35e);})[_0x73df('0x25')](function(_0x43889b){logger[_0x73df('0x15')](_0x73df('0x29'),_0x43889b['message'],_0x168bee);_0x156b8b(_0x1db36a[_0x73df('0x15')](0x1f4,_0x43889b[_0x73df('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 48d24e5..c508e85 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 _0x6934=['save','remove','update','emit','register','length','voiceQueueReport:','./voiceQueueReport.events'];(function(_0x40dc5e,_0x2116a5){var _0x5b07b4=function(_0x4b0028){while(--_0x4b0028){_0x40dc5e['push'](_0x40dc5e['shift']());}};_0x5b07b4(++_0x2116a5);}(_0x6934,0x17f));var _0x4693=function(_0x58a2b3,_0x411b78){_0x58a2b3=_0x58a2b3-0x0;var _0x3df529=_0x6934[_0x58a2b3];return _0x3df529;};'use strict';var VoiceQueueReportEvents=require(_0x4693('0x0'));var events=[_0x4693('0x1'),_0x4693('0x2'),_0x4693('0x3')];function createListener(_0x438c15,_0x5940cd){return function(_0x1bc798){_0x5940cd[_0x4693('0x4')](_0x438c15,_0x1bc798);};}function removeListener(_0x2812a9,_0x2cc753){return function(){VoiceQueueReportEvents['removeListener'](_0x2812a9,_0x2cc753);};}exports[_0x4693('0x5')]=function(_0x19e7d1){for(var _0x344c63=0x0,_0x9f08b0=events[_0x4693('0x6')];_0x344c63<_0x9f08b0;_0x344c63++){var _0x389ea6=events[_0x344c63];var _0x259149=createListener(_0x4693('0x7')+_0x389ea6,_0x19e7d1);VoiceQueueReportEvents['on'](_0x389ea6,_0x259149);}}; \ No newline at end of file +var _0xac31=['remove','update','length','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0x3500a2,_0x2ce6e5){var _0x5bdf7a=function(_0x465bc1){while(--_0x465bc1){_0x3500a2['push'](_0x3500a2['shift']());}};_0x5bdf7a(++_0x2ce6e5);}(_0xac31,0xca));var _0x1ac3=function(_0x183f08,_0x155653){_0x183f08=_0x183f08-0x0;var _0x557516=_0xac31[_0x183f08];return _0x557516;};'use strict';var VoiceQueueReportEvents=require(_0x1ac3('0x0'));var events=[_0x1ac3('0x1'),_0x1ac3('0x2'),_0x1ac3('0x3')];function createListener(_0xd6934,_0x11dd6d){return function(_0x95548d){_0x11dd6d['emit'](_0xd6934,_0x95548d);};}function removeListener(_0x33b5ab,_0x434b5e){return function(){VoiceQueueReportEvents['removeListener'](_0x33b5ab,_0x434b5e);};}exports['register']=function(_0xbe22b7){for(var _0x20027f=0x0,_0x2bf9b1=events[_0x1ac3('0x4')];_0x20027f<_0x2bf9b1;_0x20027f++){var _0x157604=events[_0x20027f];var _0x57893c=createListener(_0x1ac3('0x5')+_0x157604,_0xbe22b7);VoiceQueueReportEvents['on'](_0x157604,_0x57893c);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index b664164..10c61bd 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 _0xe40b=['get','isAuthenticated','index','show','put','update','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller'];(function(_0x11b19b,_0x213234){var _0x1daac1=function(_0x516d3b){while(--_0x516d3b){_0x11b19b['push'](_0x11b19b['shift']());}};_0x1daac1(++_0x213234);}(_0xe40b,0x1d5));var _0xbe40=function(_0x405261,_0x7d07ee){_0x405261=_0x405261-0x0;var _0x101203=_0xe40b[_0x405261];return _0x101203;};'use strict';var multer=require(_0xbe40('0x0'));var util=require(_0xbe40('0x1'));var path=require(_0xbe40('0x2'));var timeout=require(_0xbe40('0x3'));var express=require(_0xbe40('0x4'));var router=express[_0xbe40('0x5')]();var fs_extra=require(_0xbe40('0x6'));var auth=require(_0xbe40('0x7'));var interaction=require(_0xbe40('0x8'));var config=require(_0xbe40('0x9'));var controller=require(_0xbe40('0xa'));router[_0xbe40('0xb')]('/',auth[_0xbe40('0xc')](),controller[_0xbe40('0xd')]);router[_0xbe40('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xbe40('0xe')]);router['post']('/',auth[_0xbe40('0xc')](),controller['create']);router[_0xbe40('0xf')]('/:id',auth[_0xbe40('0xc')](),controller[_0xbe40('0x10')]);router[_0xbe40('0x11')](_0xbe40('0x12'),auth['isAuthenticated'](),controller['destroy']);module[_0xbe40('0x13')]=router; \ No newline at end of file +var _0x3620=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','post','/:id','update','delete','destroy','exports','connect-timeout'];(function(_0xcc24e8,_0x230fe5){var _0x279917=function(_0x5838ad){while(--_0x5838ad){_0xcc24e8['push'](_0xcc24e8['shift']());}};_0x279917(++_0x230fe5);}(_0x3620,0xcf));var _0x0362=function(_0x30ca24,_0x5e963e){_0x30ca24=_0x30ca24-0x0;var _0x338b02=_0x3620[_0x30ca24];return _0x338b02;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x0362('0x0'));var express=require(_0x0362('0x1'));var router=express[_0x0362('0x2')]();var fs_extra=require(_0x0362('0x3'));var auth=require(_0x0362('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0362('0x5'));var controller=require(_0x0362('0x6'));router[_0x0362('0x7')]('/',auth[_0x0362('0x8')](),controller[_0x0362('0x9')]);router[_0x0362('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x0362('0xa')]('/',auth[_0x0362('0x8')](),controller['create']);router['put'](_0x0362('0xb'),auth[_0x0362('0x8')](),controller[_0x0362('0xc')]);router[_0x0362('0xd')](_0x0362('0xb'),auth[_0x0362('0x8')](),controller[_0x0362('0xe')]);module[_0x0362('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 02ca362..524e892 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 _0x51f1=['literal','sequelize','moment','exports','STRING','DATE'];(function(_0x3d6785,_0x492ea3){var _0x39a624=function(_0x27d7db){while(--_0x27d7db){_0x3d6785['push'](_0x3d6785['shift']());}};_0x39a624(++_0x492ea3);}(_0x51f1,0x139));var _0x151f=function(_0x2a7fa8,_0x413c0e){_0x2a7fa8=_0x2a7fa8-0x0;var _0xf7e306=_0x51f1[_0x2a7fa8];return _0xf7e306;};'use strict';var Sequelize=require(_0x151f('0x0'));var moment=require(_0x151f('0x1'));module[_0x151f('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x151f('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x151f('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x151f('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x151f('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x151f('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x151f('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x151f('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x151f('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x151f('0x4')],'allowNull':![],'defaultValue':Sequelize[_0x151f('0x5')]('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +var _0x119b=['exports','STRING','DATE','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','moment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x119b,0xd1));var _0xb119=function(_0x2adfb1,_0x406e6e){_0x2adfb1=_0x2adfb1-0x0;var _0xa52d45=_0x119b[_0x2adfb1];return _0xa52d45;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb119('0x0'));module[_0xb119('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0xb119('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xb119('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xb119('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xb119('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xb119('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xb119('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xb119('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xb119('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xb119('0x3')],'allowNull':![],'defaultValue':Sequelize['literal'](_0xb119('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 19c1d84..607fbdb 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 _0xbd4f=['filters','includeAll','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','VoiceQueuesLog','rawAttributes','fieldName','type','key','map','query','intersection','model','attributes','fields','length','hasOwnProperty','sort','pick','filter','merge','options','where','count','include','rows','catch','show','params','keys'];(function(_0x8c33b2,_0x372ac7){var _0x4a11a1=function(_0x3cf6ed){while(--_0x3cf6ed){_0x8c33b2['push'](_0x8c33b2['shift']());}};_0x4a11a1(++_0x372ac7);}(_0xbd4f,0xe9));var _0xfbd4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xbd4f[_0x1694f5];return _0x5b4321;};'use strict';var emlformat=require(_0xfbd4('0x0'));var rimraf=require(_0xfbd4('0x1'));var zipdir=require(_0xfbd4('0x2'));var jsonpatch=require(_0xfbd4('0x3'));var rp=require('request-promise');var moment=require(_0xfbd4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfbd4('0x5'));var util=require(_0xfbd4('0x6'));var path=require(_0xfbd4('0x7'));var sox=require(_0xfbd4('0x8'));var csv=require('to-csv');var ejs=require(_0xfbd4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfbd4('0xa'));var squel=require(_0xfbd4('0xb'));var crypto=require(_0xfbd4('0xc'));var jsforce=require(_0xfbd4('0xd'));var deskjs=require(_0xfbd4('0xe'));var toCsv=require(_0xfbd4('0xf'));var querystring=require(_0xfbd4('0x10'));var Papa=require(_0xfbd4('0x11'));var Redis=require(_0xfbd4('0x12'));var authService=require(_0xfbd4('0x13'));var qs=require(_0xfbd4('0x14'));var as=require(_0xfbd4('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfbd4('0x16'))('api');var utils=require(_0xfbd4('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xfbd4('0x18'));var db=require(_0xfbd4('0x19'))['db'];function respondWithStatusCode(_0x2c9ec0,_0x5eaaf5){_0x5eaaf5=_0x5eaaf5||0xcc;return function(_0x1348e0){if(_0x1348e0){return _0x2c9ec0['sendStatus'](_0x5eaaf5);}return _0x2c9ec0['status'](_0x5eaaf5)[_0xfbd4('0x1a')]();};}function respondWithResult(_0x591d54,_0x51d8e6){_0x51d8e6=_0x51d8e6||0xc8;return function(_0xb4e62d){if(_0xb4e62d){return _0x591d54[_0xfbd4('0x1b')](_0x51d8e6)[_0xfbd4('0x1c')](_0xb4e62d);}};}function respondWithFilteredResult(_0x2f30e8,_0x14cf69){return function(_0xdb4e90){if(_0xdb4e90){var _0xfa5747=typeof _0x14cf69[_0xfbd4('0x1d')]===_0xfbd4('0x1e')&&typeof _0x14cf69[_0xfbd4('0x1f')]==='undefined';var _0x38606b=_0xdb4e90['count'];var _0x1215c6=_0xfa5747?0x0:_0x14cf69[_0xfbd4('0x1d')];var _0x5931e4=_0xfa5747?_0xdb4e90['count']:_0x14cf69[_0xfbd4('0x1d')]+_0x14cf69[_0xfbd4('0x1f')];var _0x138023;if(_0x5931e4>=_0x38606b){_0x5931e4=_0x38606b;_0x138023=0xc8;}else{_0x138023=0xce;}_0x2f30e8[_0xfbd4('0x1b')](_0x138023);return _0x2f30e8[_0xfbd4('0x20')](_0xfbd4('0x21'),_0x1215c6+'-'+_0x5931e4+'/'+_0x38606b)[_0xfbd4('0x1c')](_0xdb4e90);}return null;};}function patchUpdates(_0x23e235){return function(_0xa565eb){try{jsonpatch[_0xfbd4('0x22')](_0xa565eb,_0x23e235,!![]);}catch(_0x5c6670){return BPromise[_0xfbd4('0x23')](_0x5c6670);}return _0xa565eb[_0xfbd4('0x24')]();};}function saveUpdates(_0x546569,_0x5753e8){return function(_0x3881f2){if(_0x3881f2){return _0x3881f2[_0xfbd4('0x25')](_0x546569)[_0xfbd4('0x26')](function(_0x336c55){return _0x336c55;});}return null;};}function removeEntity(_0x30d761,_0xaeb2bb){return function(_0xbdcd91){if(_0xbdcd91){return _0xbdcd91['destroy']()['then'](function(){_0x30d761['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c8635,_0x179b28){return function(_0x5b993f){if(!_0x5b993f){_0x3c8635[_0xfbd4('0x27')](0x194);}return _0x5b993f;};}function handleError(_0x5b6236,_0x53335b){_0x53335b=_0x53335b||0x1f4;return function(_0x22dbcc){logger[_0xfbd4('0x28')](_0x22dbcc[_0xfbd4('0x29')]);if(_0x22dbcc[_0xfbd4('0x2a')]){delete _0x22dbcc[_0xfbd4('0x2a')];}_0x5b6236[_0xfbd4('0x1b')](_0x53335b)[_0xfbd4('0x2b')](_0x22dbcc);};}exports[_0xfbd4('0x2c')]=function(_0x39bfac,_0x49aac1){var _0x29a9f3={},_0x289b18={},_0x44239e={'count':0x0,'rows':[]};var _0x47d2a7=_['map'](db[_0xfbd4('0x2d')][_0xfbd4('0x2e')],function(_0x906677){return{'name':_0x906677[_0xfbd4('0x2f')],'type':_0x906677[_0xfbd4('0x30')][_0xfbd4('0x31')]};});_0x289b18['model']=_[_0xfbd4('0x32')](_0x47d2a7,_0xfbd4('0x2a'));_0x289b18[_0xfbd4('0x33')]=_['keys'](_0x39bfac[_0xfbd4('0x33')]);_0x289b18['filters']=_[_0xfbd4('0x34')](_0x289b18[_0xfbd4('0x35')],_0x289b18['query']);_0x29a9f3[_0xfbd4('0x36')]=_[_0xfbd4('0x34')](_0x289b18[_0xfbd4('0x35')],qs[_0xfbd4('0x37')](_0x39bfac['query'][_0xfbd4('0x37')]));_0x29a9f3['attributes']=_0x29a9f3[_0xfbd4('0x36')][_0xfbd4('0x38')]?_0x29a9f3[_0xfbd4('0x36')]:_0x289b18[_0xfbd4('0x35')];if(!_0x39bfac['query'][_0xfbd4('0x39')]('nolimit')){_0x29a9f3[_0xfbd4('0x1f')]=qs[_0xfbd4('0x1f')](_0x39bfac[_0xfbd4('0x33')][_0xfbd4('0x1f')]);_0x29a9f3['offset']=qs[_0xfbd4('0x1d')](_0x39bfac['query'][_0xfbd4('0x1d')]);}_0x29a9f3['order']=qs[_0xfbd4('0x3a')](_0x39bfac['query']['sort']);_0x29a9f3['where']=qs['filters'](_[_0xfbd4('0x3b')](_0x39bfac[_0xfbd4('0x33')],_0x289b18['filters']),_0x47d2a7);if(_0x39bfac['query'][_0xfbd4('0x3c')]){_0x29a9f3['where']=_[_0xfbd4('0x3d')](_0x29a9f3['where'],{'$or':_[_0xfbd4('0x32')](_0x47d2a7,function(_0x46691b){if(_0x46691b[_0xfbd4('0x30')]!=='VIRTUAL'){var _0xb905ea={};_0xb905ea[_0x46691b[_0xfbd4('0x2a')]]={'$like':'%'+_0x39bfac['query'][_0xfbd4('0x3c')]+'%'};return _0xb905ea;}})});}_0x29a9f3=_[_0xfbd4('0x3d')]({},_0x29a9f3,_0x39bfac[_0xfbd4('0x3e')]);var _0x39fd6a={'where':_0x29a9f3[_0xfbd4('0x3f')]};return db[_0xfbd4('0x2d')][_0xfbd4('0x40')](_0x39fd6a)['then'](function(_0x32b24e){_0x44239e[_0xfbd4('0x40')]=_0x32b24e;if(_0x39bfac[_0xfbd4('0x33')]['includeAll']){_0x29a9f3[_0xfbd4('0x41')]=[{'all':!![]}];}return db['VoiceQueuesLog']['findAll'](_0x29a9f3);})[_0xfbd4('0x26')](function(_0x2a7ea4){_0x44239e[_0xfbd4('0x42')]=_0x2a7ea4;return _0x44239e;})['then'](respondWithFilteredResult(_0x49aac1,_0x29a9f3))[_0xfbd4('0x43')](handleError(_0x49aac1,null));};exports[_0xfbd4('0x44')]=function(_0x104dc5,_0x54e7aa){var _0x8a417f={'raw':!![],'where':{'id':_0x104dc5[_0xfbd4('0x45')]['id']}},_0x3f96da={};_0x3f96da[_0xfbd4('0x35')]=_[_0xfbd4('0x46')](db[_0xfbd4('0x2d')][_0xfbd4('0x2e')]);_0x3f96da['query']=_[_0xfbd4('0x46')](_0x104dc5[_0xfbd4('0x33')]);_0x3f96da[_0xfbd4('0x47')]=_[_0xfbd4('0x34')](_0x3f96da[_0xfbd4('0x35')],_0x3f96da['query']);_0x8a417f[_0xfbd4('0x36')]=_[_0xfbd4('0x34')](_0x3f96da[_0xfbd4('0x35')],qs[_0xfbd4('0x37')](_0x104dc5[_0xfbd4('0x33')][_0xfbd4('0x37')]));_0x8a417f['attributes']=_0x8a417f[_0xfbd4('0x36')]['length']?_0x8a417f[_0xfbd4('0x36')]:_0x3f96da['model'];if(_0x104dc5[_0xfbd4('0x33')][_0xfbd4('0x48')]){_0x8a417f[_0xfbd4('0x41')]=[{'all':!![]}];}_0x8a417f=_[_0xfbd4('0x3d')]({},_0x8a417f,_0x104dc5['options']);return db[_0xfbd4('0x2d')]['find'](_0x8a417f)[_0xfbd4('0x26')](handleEntityNotFound(_0x54e7aa,null))[_0xfbd4('0x26')](respondWithResult(_0x54e7aa,null))[_0xfbd4('0x43')](handleError(_0x54e7aa,null));};exports['create']=function(_0xb8613c,_0x346548){return db[_0xfbd4('0x2d')]['create'](_0xb8613c[_0xfbd4('0x49')],{})['then'](respondWithResult(_0x346548,0xc9))[_0xfbd4('0x43')](handleError(_0x346548,null));};exports['update']=function(_0x1c3f73,_0x3b6f2b){if(_0x1c3f73['body']['id']){delete _0x1c3f73[_0xfbd4('0x49')]['id'];}return db['VoiceQueuesLog'][_0xfbd4('0x4a')]({'where':{'id':_0x1c3f73[_0xfbd4('0x45')]['id']}})['then'](handleEntityNotFound(_0x3b6f2b,null))[_0xfbd4('0x26')](saveUpdates(_0x1c3f73[_0xfbd4('0x49')],null))[_0xfbd4('0x26')](respondWithResult(_0x3b6f2b,null))[_0xfbd4('0x43')](handleError(_0x3b6f2b,null));};exports[_0xfbd4('0x4b')]=function(_0x28302d,_0x2639bb){return db[_0xfbd4('0x2d')][_0xfbd4('0x4a')]({'where':{'id':_0x28302d['params']['id']}})[_0xfbd4('0x26')](handleEntityNotFound(_0x2639bb,null))['then'](removeEntity(_0x2639bb,null))['catch'](handleError(_0x2639bb,null));}; \ No newline at end of file +var _0x0c4d=['create','body','update','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','json','destroy','then','end','stack','send','index','map','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','VoiceQueuesLog','includeAll','findAll','rows','catch','show','include','find'];(function(_0x30e307,_0x24cabd){var _0xc5e1e6=function(_0xe881ef){while(--_0xe881ef){_0x30e307['push'](_0x30e307['shift']());}};_0xc5e1e6(++_0x24cabd);}(_0x0c4d,0x94));var _0xd0c4=function(_0x5ab634,_0x3d9e91){_0x5ab634=_0x5ab634-0x0;var _0xfab104=_0x0c4d[_0x5ab634];return _0xfab104;};'use strict';var emlformat=require(_0xd0c4('0x0'));var rimraf=require(_0xd0c4('0x1'));var zipdir=require(_0xd0c4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd0c4('0x3'));var moment=require(_0xd0c4('0x4'));var BPromise=require(_0xd0c4('0x5'));var Mustache=require('mustache');var util=require(_0xd0c4('0x6'));var path=require('path');var sox=require(_0xd0c4('0x7'));var csv=require(_0xd0c4('0x8'));var ejs=require(_0xd0c4('0x9'));var fs=require('fs');var fs_extra=require(_0xd0c4('0xa'));var _=require(_0xd0c4('0xb'));var squel=require(_0xd0c4('0xc'));var crypto=require(_0xd0c4('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd0c4('0x8'));var querystring=require(_0xd0c4('0xe'));var Papa=require(_0xd0c4('0xf'));var Redis=require(_0xd0c4('0x10'));var authService=require(_0xd0c4('0x11'));var qs=require(_0xd0c4('0x12'));var as=require(_0xd0c4('0x13'));var hardwareService=require(_0xd0c4('0x14'));var logger=require(_0xd0c4('0x15'))(_0xd0c4('0x16'));var utils=require('../../config/utils');var config=require(_0xd0c4('0x17'));var licenseUtil=require(_0xd0c4('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x33f284,_0x37bf28){_0x37bf28=_0x37bf28||0xcc;return function(_0x56f1bf){if(_0x56f1bf){return _0x33f284[_0xd0c4('0x19')](_0x37bf28);}return _0x33f284['status'](_0x37bf28)['end']();};}function respondWithResult(_0x2f655a,_0x3cfa0e){_0x3cfa0e=_0x3cfa0e||0xc8;return function(_0x3523c9){if(_0x3523c9){return _0x2f655a[_0xd0c4('0x1a')](_0x3cfa0e)['json'](_0x3523c9);}};}function respondWithFilteredResult(_0xacb47d,_0x52dbb7){return function(_0x3d1af2){if(_0x3d1af2){var _0x1901a6=typeof _0x52dbb7[_0xd0c4('0x1b')]===_0xd0c4('0x1c')&&typeof _0x52dbb7[_0xd0c4('0x1d')]===_0xd0c4('0x1c');var _0x341ad1=_0x3d1af2[_0xd0c4('0x1e')];var _0x1ed733=_0x1901a6?0x0:_0x52dbb7[_0xd0c4('0x1b')];var _0x32336b=_0x1901a6?_0x3d1af2['count']:_0x52dbb7[_0xd0c4('0x1b')]+_0x52dbb7[_0xd0c4('0x1d')];var _0x30bdc9;if(_0x32336b>=_0x341ad1){_0x32336b=_0x341ad1;_0x30bdc9=0xc8;}else{_0x30bdc9=0xce;}_0xacb47d[_0xd0c4('0x1a')](_0x30bdc9);return _0xacb47d[_0xd0c4('0x1f')]('Content-Range',_0x1ed733+'-'+_0x32336b+'/'+_0x341ad1)[_0xd0c4('0x20')](_0x3d1af2);}return null;};}function patchUpdates(_0x5b04eb){return function(_0x4c34fe){try{jsonpatch['apply'](_0x4c34fe,_0x5b04eb,!![]);}catch(_0x115261){return BPromise['reject'](_0x115261);}return _0x4c34fe['save']();};}function saveUpdates(_0x3ce32d,_0x587c76){return function(_0x1b1611){if(_0x1b1611){return _0x1b1611['update'](_0x3ce32d)['then'](function(_0x552d85){return _0x552d85;});}return null;};}function removeEntity(_0x5a4b01,_0x36de69){return function(_0x5b5f09){if(_0x5b5f09){return _0x5b5f09[_0xd0c4('0x21')]()[_0xd0c4('0x22')](function(){_0x5a4b01['status'](0xcc)[_0xd0c4('0x23')]();});}};}function handleEntityNotFound(_0x33592b,_0x4c1247){return function(_0xf97e28){if(!_0xf97e28){_0x33592b[_0xd0c4('0x19')](0x194);}return _0xf97e28;};}function handleError(_0xf6041d,_0x10c3fb){_0x10c3fb=_0x10c3fb||0x1f4;return function(_0x4c67de){logger['error'](_0x4c67de[_0xd0c4('0x24')]);if(_0x4c67de['name']){delete _0x4c67de['name'];}_0xf6041d['status'](_0x10c3fb)[_0xd0c4('0x25')](_0x4c67de);};}exports[_0xd0c4('0x26')]=function(_0x148afb,_0x4946eb){var _0xd33fec={},_0xd1cd3={},_0x4aea16={'count':0x0,'rows':[]};var _0x5d6b38=_[_0xd0c4('0x27')](db['VoiceQueuesLog'][_0xd0c4('0x28')],function(_0x52f159){return{'name':_0x52f159[_0xd0c4('0x29')],'type':_0x52f159[_0xd0c4('0x2a')]['key']};});_0xd1cd3[_0xd0c4('0x2b')]=_['map'](_0x5d6b38,_0xd0c4('0x2c'));_0xd1cd3[_0xd0c4('0x2d')]=_[_0xd0c4('0x2e')](_0x148afb[_0xd0c4('0x2d')]);_0xd1cd3[_0xd0c4('0x2f')]=_[_0xd0c4('0x30')](_0xd1cd3['model'],_0xd1cd3[_0xd0c4('0x2d')]);_0xd33fec[_0xd0c4('0x31')]=_['intersection'](_0xd1cd3[_0xd0c4('0x2b')],qs[_0xd0c4('0x32')](_0x148afb['query']['fields']));_0xd33fec[_0xd0c4('0x31')]=_0xd33fec[_0xd0c4('0x31')]['length']?_0xd33fec['attributes']:_0xd1cd3[_0xd0c4('0x2b')];if(!_0x148afb[_0xd0c4('0x2d')][_0xd0c4('0x33')](_0xd0c4('0x34'))){_0xd33fec['limit']=qs[_0xd0c4('0x1d')](_0x148afb[_0xd0c4('0x2d')][_0xd0c4('0x1d')]);_0xd33fec[_0xd0c4('0x1b')]=qs[_0xd0c4('0x1b')](_0x148afb[_0xd0c4('0x2d')]['offset']);}_0xd33fec[_0xd0c4('0x35')]=qs[_0xd0c4('0x36')](_0x148afb[_0xd0c4('0x2d')][_0xd0c4('0x36')]);_0xd33fec[_0xd0c4('0x37')]=qs[_0xd0c4('0x2f')](_[_0xd0c4('0x38')](_0x148afb[_0xd0c4('0x2d')],_0xd1cd3[_0xd0c4('0x2f')]),_0x5d6b38);if(_0x148afb['query'][_0xd0c4('0x39')]){_0xd33fec[_0xd0c4('0x37')]=_[_0xd0c4('0x3a')](_0xd33fec[_0xd0c4('0x37')],{'$or':_[_0xd0c4('0x27')](_0x5d6b38,function(_0x5d767a){if(_0x5d767a['type']!=='VIRTUAL'){var _0x46c479={};_0x46c479[_0x5d767a[_0xd0c4('0x2c')]]={'$like':'%'+_0x148afb[_0xd0c4('0x2d')][_0xd0c4('0x39')]+'%'};return _0x46c479;}})});}_0xd33fec=_[_0xd0c4('0x3a')]({},_0xd33fec,_0x148afb[_0xd0c4('0x3b')]);var _0x13ab14={'where':_0xd33fec[_0xd0c4('0x37')]};return db[_0xd0c4('0x3c')]['count'](_0x13ab14)[_0xd0c4('0x22')](function(_0x2e2826){_0x4aea16['count']=_0x2e2826;if(_0x148afb[_0xd0c4('0x2d')][_0xd0c4('0x3d')]){_0xd33fec['include']=[{'all':!![]}];}return db[_0xd0c4('0x3c')][_0xd0c4('0x3e')](_0xd33fec);})[_0xd0c4('0x22')](function(_0x40a073){_0x4aea16[_0xd0c4('0x3f')]=_0x40a073;return _0x4aea16;})['then'](respondWithFilteredResult(_0x4946eb,_0xd33fec))[_0xd0c4('0x40')](handleError(_0x4946eb,null));};exports[_0xd0c4('0x41')]=function(_0x1c7da0,_0x28aa27){var _0x252a5f={'raw':!![],'where':{'id':_0x1c7da0['params']['id']}},_0x4b79cd={};_0x4b79cd[_0xd0c4('0x2b')]=_[_0xd0c4('0x2e')](db[_0xd0c4('0x3c')][_0xd0c4('0x28')]);_0x4b79cd[_0xd0c4('0x2d')]=_['keys'](_0x1c7da0[_0xd0c4('0x2d')]);_0x4b79cd[_0xd0c4('0x2f')]=_['intersection'](_0x4b79cd['model'],_0x4b79cd[_0xd0c4('0x2d')]);_0x252a5f[_0xd0c4('0x31')]=_[_0xd0c4('0x30')](_0x4b79cd[_0xd0c4('0x2b')],qs[_0xd0c4('0x32')](_0x1c7da0['query'][_0xd0c4('0x32')]));_0x252a5f[_0xd0c4('0x31')]=_0x252a5f['attributes']['length']?_0x252a5f[_0xd0c4('0x31')]:_0x4b79cd[_0xd0c4('0x2b')];if(_0x1c7da0['query'][_0xd0c4('0x3d')]){_0x252a5f[_0xd0c4('0x42')]=[{'all':!![]}];}_0x252a5f=_[_0xd0c4('0x3a')]({},_0x252a5f,_0x1c7da0[_0xd0c4('0x3b')]);return db[_0xd0c4('0x3c')][_0xd0c4('0x43')](_0x252a5f)['then'](handleEntityNotFound(_0x28aa27,null))[_0xd0c4('0x22')](respondWithResult(_0x28aa27,null))['catch'](handleError(_0x28aa27,null));};exports[_0xd0c4('0x44')]=function(_0x21bd54,_0x351120){return db['VoiceQueuesLog'][_0xd0c4('0x44')](_0x21bd54[_0xd0c4('0x45')],{})['then'](respondWithResult(_0x351120,0xc9))[_0xd0c4('0x40')](handleError(_0x351120,null));};exports[_0xd0c4('0x46')]=function(_0x2dd930,_0x4d074d){if(_0x2dd930['body']['id']){delete _0x2dd930[_0xd0c4('0x45')]['id'];}return db['VoiceQueuesLog']['find']({'where':{'id':_0x2dd930[_0xd0c4('0x47')]['id']}})[_0xd0c4('0x22')](handleEntityNotFound(_0x4d074d,null))['then'](saveUpdates(_0x2dd930[_0xd0c4('0x45')],null))[_0xd0c4('0x22')](respondWithResult(_0x4d074d,null))[_0xd0c4('0x40')](handleError(_0x4d074d,null));};exports[_0xd0c4('0x21')]=function(_0x5acea8,_0x1fd4da){return db['VoiceQueuesLog']['find']({'where':{'id':_0x5acea8[_0xd0c4('0x47')]['id']}})[_0xd0c4('0x22')](handleEntityNotFound(_0x1fd4da,null))[_0xd0c4('0x22')](removeEntity(_0x1fd4da,null))[_0xd0c4('0x40')](handleError(_0x1fd4da,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 7aae544..28edf76 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 _0x4f73=['../../config/logger','api','bluebird','path','../../config/environment','./voiceQueuesLog.attributes','exports','voice_queues_log','event_dtm','event','dtm','lodash','util'];(function(_0x209fcd,_0x1ecccc){var _0x501d5e=function(_0x8d74fe){while(--_0x8d74fe){_0x209fcd['push'](_0x209fcd['shift']());}};_0x501d5e(++_0x1ecccc);}(_0x4f73,0x10f));var _0x34f7=function(_0x1be9ce,_0x27443d){_0x1be9ce=_0x1be9ce-0x0;var _0x164439=_0x4f73[_0x1be9ce];return _0x164439;};'use strict';var _=require(_0x34f7('0x0'));var util=require(_0x34f7('0x1'));var logger=require(_0x34f7('0x2'))(_0x34f7('0x3'));var moment=require('moment');var BPromise=require(_0x34f7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x34f7('0x5'));var rimraf=require('rimraf');var config=require(_0x34f7('0x6'));var attributes=require(_0x34f7('0x7'));module[_0x34f7('0x8')]=function(_0x3125aa,_0x27053f){return _0x3125aa['define']('VoiceQueuesLog',attributes,{'tableName':_0x34f7('0x9'),'paranoid':![],'indexes':[{'name':_0x34f7('0xa'),'fields':[_0x34f7('0xb'),_0x34f7('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0x6183=['voice_queues_log','event','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','VoiceQueuesLog'];(function(_0x2a94cf,_0x2b970d){var _0x22147f=function(_0xfc71ab){while(--_0xfc71ab){_0x2a94cf['push'](_0x2a94cf['shift']());}};_0x22147f(++_0x2b970d);}(_0x6183,0x1e2));var _0x3618=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0x6183[_0x2aecb2];return _0x3ebb80;};'use strict';var _=require(_0x3618('0x0'));var util=require(_0x3618('0x1'));var logger=require(_0x3618('0x2'))(_0x3618('0x3'));var moment=require(_0x3618('0x4'));var BPromise=require(_0x3618('0x5'));var rp=require(_0x3618('0x6'));var fs=require('fs');var path=require(_0x3618('0x7'));var rimraf=require(_0x3618('0x8'));var config=require(_0x3618('0x9'));var attributes=require(_0x3618('0xa'));module[_0x3618('0xb')]=function(_0x2f4ab4,_0x430360){return _0x2f4ab4['define'](_0x3618('0xc'),attributes,{'tableName':_0x3618('0xd'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0x3618('0xe'),'dtm']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 147a415..0063454 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 _0x210d=['request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VoiceQueuesLog,\x20%s,\x20%s'];(function(_0x2e7b28,_0x14094e){var _0x24e5bd=function(_0x3a762d){while(--_0x3a762d){_0x2e7b28['push'](_0x2e7b28['shift']());}};_0x24e5bd(++_0x14094e);}(_0x210d,0x7c));var _0xd210=function(_0xd336fa,_0x39d1b2){_0xd336fa=_0xd336fa-0x0;var _0x3370b1=_0x210d[_0xd336fa];return _0x3370b1;};'use strict';var _=require(_0xd210('0x0'));var util=require(_0xd210('0x1'));var moment=require('moment');var BPromise=require(_0xd210('0x2'));var rs=require(_0xd210('0x3'));var fs=require('fs');var Redis=require(_0xd210('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd210('0x5'))(_0xd210('0x6'));var config=require(_0xd210('0x7'));var jayson=require(_0xd210('0x8'));var client=jayson[_0xd210('0x9')][_0xd210('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e63bd,_0x288c98,_0x2e8df7){return new BPromise(function(_0xc3fd08,_0x26bd4e){return client[_0xd210('0xb')](_0x3e63bd,_0x2e8df7)['then'](function(_0x14a04e){logger[_0xd210('0xc')](_0xd210('0xd'),_0x288c98,_0xd210('0xe'));logger[_0xd210('0xf')](_0xd210('0x10'),_0x288c98,'request\x20sent',JSON[_0xd210('0x11')](_0x14a04e));if(_0x14a04e[_0xd210('0x12')]){if(_0x14a04e[_0xd210('0x12')][_0xd210('0x13')]===0x1f4){logger[_0xd210('0x12')](_0xd210('0xd'),_0x288c98,_0x14a04e[_0xd210('0x12')]['message']);return _0x26bd4e(_0x14a04e[_0xd210('0x12')][_0xd210('0x14')]);}logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x288c98,_0x14a04e[_0xd210('0x12')][_0xd210('0x14')]);return _0xc3fd08(_0x14a04e[_0xd210('0x12')][_0xd210('0x14')]);}else{logger[_0xd210('0xc')](_0xd210('0xd'),_0x288c98,'request\x20sent');_0xc3fd08(_0x14a04e[_0xd210('0x15')][_0xd210('0x14')]);}})[_0xd210('0x16')](function(_0x8c0b8){logger[_0xd210('0x12')](_0xd210('0xd'),_0x288c98,_0x8c0b8);_0x26bd4e(_0x8c0b8);});});} \ No newline at end of file +var _0x138d=['VoiceQueuesLog,\x20%s,\x20%s','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then'];(function(_0xffe84a,_0x55007d){var _0x227656=function(_0x267c9a){while(--_0x267c9a){_0xffe84a['push'](_0xffe84a['shift']());}};_0x227656(++_0x55007d);}(_0x138d,0x1ab));var _0xd138=function(_0x34bc6c,_0x10d089){_0x34bc6c=_0x34bc6c-0x0;var _0x168820=_0x138d[_0x34bc6c];return _0x168820;};'use strict';var _=require(_0xd138('0x0'));var util=require(_0xd138('0x1'));var moment=require('moment');var BPromise=require(_0xd138('0x2'));var rs=require(_0xd138('0x3'));var fs=require('fs');var Redis=require(_0xd138('0x4'));var db=require(_0xd138('0x5'))['db'];var utils=require(_0xd138('0x6'));var logger=require(_0xd138('0x7'))('rpc');var config=require(_0xd138('0x8'));var jayson=require(_0xd138('0x9'));var client=jayson[_0xd138('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19869d,_0x1edfa7,_0x117c23){return new BPromise(function(_0x5790ff,_0x54e1f2){return client[_0xd138('0xb')](_0x19869d,_0x117c23)[_0xd138('0xc')](function(_0x121cce){logger['info'](_0xd138('0xd'),_0x1edfa7,'request\x20sent');logger['debug'](_0xd138('0xe'),_0x1edfa7,_0xd138('0xf'),JSON[_0xd138('0x10')](_0x121cce));if(_0x121cce[_0xd138('0x11')]){if(_0x121cce['error'][_0xd138('0x12')]===0x1f4){logger['error'](_0xd138('0xd'),_0x1edfa7,_0x121cce[_0xd138('0x11')][_0xd138('0x13')]);return _0x54e1f2(_0x121cce[_0xd138('0x11')][_0xd138('0x13')]);}logger[_0xd138('0x11')](_0xd138('0xd'),_0x1edfa7,_0x121cce[_0xd138('0x11')][_0xd138('0x13')]);return _0x5790ff(_0x121cce[_0xd138('0x11')][_0xd138('0x13')]);}else{logger[_0xd138('0x14')]('VoiceQueuesLog,\x20%s,\x20%s',_0x1edfa7,_0xd138('0xf'));_0x5790ff(_0x121cce[_0xd138('0x15')]['message']);}})['catch'](function(_0x502d3b){logger[_0xd138('0x11')](_0xd138('0xd'),_0x1edfa7,_0x502d3b);_0x54e1f2(_0x502d3b);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 8e2eef9..e09beec 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 _0xed73=['express','Router','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','show','download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','runTranscribe','/:id','delete','destroy','util','path','connect-timeout'];(function(_0x10b6ba,_0x54fd78){var _0x149282=function(_0x45b829){while(--_0x45b829){_0x10b6ba['push'](_0x10b6ba['shift']());}};_0x149282(++_0x54fd78);}(_0xed73,0x14d));var _0x3ed7=function(_0x3f2b79,_0x371c8a){_0x3f2b79=_0x3f2b79-0x0;var _0x5d0033=_0xed73[_0x3f2b79];return _0x5d0033;};'use strict';var multer=require('multer');var util=require(_0x3ed7('0x0'));var path=require(_0x3ed7('0x1'));var timeout=require(_0x3ed7('0x2'));var express=require(_0x3ed7('0x3'));var router=express[_0x3ed7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3ed7('0x5'));var interaction=require(_0x3ed7('0x6'));var config=require('../../config/environment');var controller=require(_0x3ed7('0x7'));router[_0x3ed7('0x8')]('/',auth[_0x3ed7('0x9')](),controller[_0x3ed7('0xa')]);router['get'](_0x3ed7('0xb'),auth[_0x3ed7('0x9')](),controller[_0x3ed7('0xc')]);router[_0x3ed7('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x3ed7('0xd')]);router[_0x3ed7('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x3ed7('0xe')]);router[_0x3ed7('0x8')](_0x3ed7('0xf'),controller[_0x3ed7('0x10')]);router[_0x3ed7('0x8')](_0x3ed7('0x11'),auth[_0x3ed7('0x9')](),controller[_0x3ed7('0x12')]);router['post']('/',auth[_0x3ed7('0x9')](),controller['create']);router[_0x3ed7('0x13')](_0x3ed7('0x11'),auth['isAuthenticated'](),controller[_0x3ed7('0x14')]);router['put'](_0x3ed7('0x15'),auth[_0x3ed7('0x9')](),controller['update']);router[_0x3ed7('0x16')](_0x3ed7('0x15'),auth[_0x3ed7('0x9')](),controller[_0x3ed7('0x17')]);module['exports']=router; \ No newline at end of file +var _0xd41b=['download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','put','update','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','get','isAuthenticated','index','/describe','show'];(function(_0x47c412,_0x5d84b9){var _0x5930af=function(_0xec1613){while(--_0xec1613){_0x47c412['push'](_0x47c412['shift']());}};_0x5930af(++_0x5d84b9);}(_0xd41b,0x1e0));var _0xbd41=function(_0x12ce22,_0x3f9f96){_0x12ce22=_0x12ce22-0x0;var _0xbabcc4=_0xd41b[_0x12ce22];return _0xbabcc4;};'use strict';var multer=require(_0xbd41('0x0'));var util=require('util');var path=require(_0xbd41('0x1'));var timeout=require(_0xbd41('0x2'));var express=require(_0xbd41('0x3'));var router=express[_0xbd41('0x4')]();var fs_extra=require(_0xbd41('0x5'));var auth=require(_0xbd41('0x6'));var interaction=require(_0xbd41('0x7'));var config=require('../../config/environment');var controller=require(_0xbd41('0x8'));router[_0xbd41('0x9')]('/',auth[_0xbd41('0xa')](),controller[_0xbd41('0xb')]);router[_0xbd41('0x9')](_0xbd41('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xbd41('0x9')]('/:id',auth[_0xbd41('0xa')](),controller[_0xbd41('0xd')]);router[_0xbd41('0x9')]('/:id/download',auth[_0xbd41('0xa')](),controller[_0xbd41('0xe')]);router[_0xbd41('0x9')](_0xbd41('0xf'),controller[_0xbd41('0x10')]);router[_0xbd41('0x9')](_0xbd41('0x11'),auth['isAuthenticated'](),controller[_0xbd41('0x12')]);router[_0xbd41('0x13')]('/',auth[_0xbd41('0xa')](),controller[_0xbd41('0x14')]);router[_0xbd41('0x13')](_0xbd41('0x11'),auth[_0xbd41('0xa')](),controller['runTranscribe']);router[_0xbd41('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xbd41('0x16')]);router['delete'](_0xbd41('0x17'),auth[_0xbd41('0xa')](),controller[_0xbd41('0x18')]);module[_0xbd41('0x19')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index ca41a82..4ed15e9 100644 --- a/server/api/voiceRecording/voiceRecording.attributes.js +++ b/server/api/voiceRecording/voiceRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'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(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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 6c68556..dee2bcc 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 _0xb90c=['Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data1','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','transcribeStatus','NEW','transcribeRegion','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','fileText','.txt','Transcript\x20not\x20available','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','map','VoiceRecording','rawAttributes','fieldName','key','format','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','download','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','filename','extname','unlink','Not\x20found','../../components/encryptor','sequelize','col','token','$and','push','Entity\x20not\x20found','info','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','listBuckets','createBucket','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribeAccountId','language','bucket','ValidationError','runSentiment','sentiment','sentimentAccountId'];(function(_0xd07790,_0x3db009){var _0x32f10e=function(_0x1f4911){while(--_0x1f4911){_0xd07790['push'](_0xd07790['shift']());}};_0x32f10e(++_0x3db009);}(_0xb90c,0x140));var _0xcb90=function(_0x12d121,_0x1ef59d){_0x12d121=_0x12d121-0x0;var _0x1af836=_0xb90c[_0x12d121];return _0x1af836;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcb90('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcb90('0x1'));var rp=require(_0xcb90('0x2'));var moment=require(_0xcb90('0x3'));var BPromise=require(_0xcb90('0x4'));var Mustache=require(_0xcb90('0x5'));var util=require(_0xcb90('0x6'));var path=require('path');var sox=require(_0xcb90('0x7'));var csv=require(_0xcb90('0x8'));var ejs=require(_0xcb90('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xcb90('0xa'));var crypto=require(_0xcb90('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xcb90('0xc'));var toCsv=require(_0xcb90('0x8'));var querystring=require('querystring');var Papa=require(_0xcb90('0xd'));var AWS=require(_0xcb90('0xe'));var uuidv4=require(_0xcb90('0xf'));var Redis=require(_0xcb90('0x10'));var authService=require(_0xcb90('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xcb90('0x12'));var hardwareService=require(_0xcb90('0x13'));var logger=require(_0xcb90('0x14'))(_0xcb90('0x15'));var utils=require('../../config/utils');var config=require(_0xcb90('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcb90('0x17'))['db'];function respondWithStatusCode(_0x2a9dcb,_0x47cd90){_0x47cd90=_0x47cd90||0xcc;return function(_0x50bcaa){if(_0x50bcaa){return _0x2a9dcb[_0xcb90('0x18')](_0x47cd90);}return _0x2a9dcb[_0xcb90('0x19')](_0x47cd90)[_0xcb90('0x1a')]();};}function respondWithResult(_0x44c28a,_0x376483){_0x376483=_0x376483||0xc8;return function(_0x10a052){if(_0x10a052){return _0x44c28a[_0xcb90('0x19')](_0x376483)[_0xcb90('0x1b')](_0x10a052);}};}function respondWithFilteredResult(_0x421813,_0x8fce9){return function(_0x326851){if(_0x326851){var _0x4e619=typeof _0x8fce9[_0xcb90('0x1c')]===_0xcb90('0x1d')&&typeof _0x8fce9['limit']===_0xcb90('0x1d');var _0x2b7667=_0x326851[_0xcb90('0x1e')];var _0x1667e8=_0x4e619?0x0:_0x8fce9[_0xcb90('0x1c')];var _0x2e8458=_0x4e619?_0x326851[_0xcb90('0x1e')]:_0x8fce9[_0xcb90('0x1c')]+_0x8fce9[_0xcb90('0x1f')];var _0x7242bd;if(_0x2e8458>=_0x2b7667){_0x2e8458=_0x2b7667;_0x7242bd=0xc8;}else{_0x7242bd=0xce;}_0x421813[_0xcb90('0x19')](_0x7242bd);return _0x421813[_0xcb90('0x20')](_0xcb90('0x21'),_0x1667e8+'-'+_0x2e8458+'/'+_0x2b7667)[_0xcb90('0x1b')](_0x326851);}return null;};}function patchUpdates(_0x138aa7){return function(_0x5dc8bc){try{jsonpatch[_0xcb90('0x22')](_0x5dc8bc,_0x138aa7,!![]);}catch(_0x7e6b68){return BPromise['reject'](_0x7e6b68);}return _0x5dc8bc[_0xcb90('0x23')]();};}function saveUpdates(_0x4c46db,_0x175dc2){return function(_0x245e21){if(_0x245e21){return _0x245e21[_0xcb90('0x24')](_0x4c46db)['then'](function(_0xdd9be9){return _0xdd9be9;});}return null;};}function removeEntity(_0x1ab5fe,_0x5d995c){return function(_0x50983c){if(_0x50983c){return _0x50983c[_0xcb90('0x25')]()[_0xcb90('0x26')](function(){_0x1ab5fe[_0xcb90('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd3c76,_0x3bd764){return function(_0x24b742){if(!_0x24b742){_0xd3c76['sendStatus'](0x194);}return _0x24b742;};}function handleError(_0x3d9bef,_0x49561a){_0x49561a=_0x49561a||0x1f4;return function(_0x42b72a){logger[_0xcb90('0x27')](_0x42b72a[_0xcb90('0x28')]);if(_0x42b72a[_0xcb90('0x29')]){delete _0x42b72a['name'];}_0x3d9bef[_0xcb90('0x19')](_0x49561a)[_0xcb90('0x2a')](_0x42b72a);};}exports['index']=function(_0xf956bf,_0x3c1e7c){var _0x2fb75b={},_0x53ce84={},_0x4cb0c1={'count':0x0,'rows':[]};var _0x3235e9=_[_0xcb90('0x2b')](db[_0xcb90('0x2c')][_0xcb90('0x2d')],function(_0xf4fd65){return{'name':_0xf4fd65[_0xcb90('0x2e')],'type':_0xf4fd65['type'][_0xcb90('0x2f')]};});_0x53ce84['model']=_['differenceBy'](_[_0xcb90('0x2b')](_0x3235e9,_0xcb90('0x29')),[_0xcb90('0x30')]);_0x53ce84[_0xcb90('0x31')]=_[_0xcb90('0x32')](_0xf956bf[_0xcb90('0x31')]);_0x53ce84['filters']=_[_0xcb90('0x33')](_0x53ce84[_0xcb90('0x34')],_0x53ce84[_0xcb90('0x31')]);_0x2fb75b[_0xcb90('0x35')]=_[_0xcb90('0x33')](_0x53ce84[_0xcb90('0x34')],qs[_0xcb90('0x36')](_0xf956bf[_0xcb90('0x31')]['fields']));_0x2fb75b['attributes']=_0x2fb75b[_0xcb90('0x35')][_0xcb90('0x37')]?_0x2fb75b[_0xcb90('0x35')]:_0x53ce84[_0xcb90('0x34')];if(!_0xf956bf['query']['hasOwnProperty'](_0xcb90('0x38'))){_0x2fb75b['limit']=qs[_0xcb90('0x1f')](_0xf956bf[_0xcb90('0x31')][_0xcb90('0x1f')]);_0x2fb75b['offset']=qs[_0xcb90('0x1c')](_0xf956bf[_0xcb90('0x31')][_0xcb90('0x1c')]);}_0x2fb75b[_0xcb90('0x39')]=qs[_0xcb90('0x3a')](_0xf956bf['query'][_0xcb90('0x3a')]);_0x2fb75b[_0xcb90('0x3b')]=qs[_0xcb90('0x3c')](_[_0xcb90('0x3d')](_0xf956bf[_0xcb90('0x31')],_0x53ce84['filters']),_0x3235e9);if(_0xf956bf['query'][_0xcb90('0x3e')]){_0x2fb75b[_0xcb90('0x3b')]=_[_0xcb90('0x3f')](_0x2fb75b[_0xcb90('0x3b')],{'$or':_[_0xcb90('0x2b')](_0x3235e9,function(_0x2e5247){if(_0x2e5247[_0xcb90('0x40')]!==_0xcb90('0x41')){var _0x2ac75c={};_0x2ac75c[_0x2e5247[_0xcb90('0x29')]]={'$like':'%'+_0xf956bf['query'][_0xcb90('0x3e')]+'%'};return _0x2ac75c;}})});}_0x2fb75b=_['merge']({},_0x2fb75b,_0xf956bf[_0xcb90('0x42')]);var _0x3612bd={'where':_0x2fb75b[_0xcb90('0x3b')]};return db[_0xcb90('0x2c')][_0xcb90('0x1e')](_0x3612bd)['then'](function(_0x976955){_0x4cb0c1['count']=_0x976955;if(_0xf956bf[_0xcb90('0x31')][_0xcb90('0x43')]){_0x2fb75b[_0xcb90('0x44')]=[{'all':!![]}];}return db['VoiceRecording'][_0xcb90('0x45')](_0x2fb75b);})[_0xcb90('0x26')](function(_0x42760d){_0x4cb0c1[_0xcb90('0x46')]=_0x42760d;return _0x4cb0c1;})[_0xcb90('0x26')](respondWithFilteredResult(_0x3c1e7c,_0x2fb75b))['catch'](handleError(_0x3c1e7c,null));};exports[_0xcb90('0x47')]=function(_0x1f174e,_0x37c156){var _0x42f12e={'raw':![],'where':{'id':_0x1f174e[_0xcb90('0x48')]['id']}},_0x504715={};_0x504715[_0xcb90('0x34')]=_['keys'](db['VoiceRecording'][_0xcb90('0x2d')]);_0x504715[_0xcb90('0x31')]=_[_0xcb90('0x32')](_0x1f174e[_0xcb90('0x31')]);_0x504715[_0xcb90('0x3c')]=_[_0xcb90('0x33')](_0x504715['model'],_0x504715['query']);_0x42f12e[_0xcb90('0x35')]=_[_0xcb90('0x33')](_0x504715[_0xcb90('0x34')],qs['fields'](_0x1f174e[_0xcb90('0x31')][_0xcb90('0x36')]));_0x42f12e[_0xcb90('0x35')]=_0x42f12e[_0xcb90('0x35')][_0xcb90('0x37')]?_0x42f12e[_0xcb90('0x35')]:_0x504715[_0xcb90('0x34')];if(_0x1f174e[_0xcb90('0x31')][_0xcb90('0x43')]){_0x42f12e[_0xcb90('0x44')]=[{'all':!![]}];}_0x42f12e=_[_0xcb90('0x3f')]({},_0x42f12e,_0x1f174e[_0xcb90('0x42')]);return db[_0xcb90('0x2c')][_0xcb90('0x49')](_0x42f12e)[_0xcb90('0x26')](handleEntityNotFound(_0x37c156,null))[_0xcb90('0x26')](respondWithResult(_0x37c156,null))[_0xcb90('0x4a')](handleError(_0x37c156,null));};exports['create']=function(_0x352eda,_0x313c4f){return db['VoiceRecording'][_0xcb90('0x4b')](_0x352eda[_0xcb90('0x4c')],{})[_0xcb90('0x26')](respondWithResult(_0x313c4f,0xc9))[_0xcb90('0x4a')](handleError(_0x313c4f,null));};exports[_0xcb90('0x24')]=function(_0x57328e,_0x456ac2){if(_0x57328e[_0xcb90('0x4c')]['id']){delete _0x57328e[_0xcb90('0x4c')]['id'];}return db[_0xcb90('0x2c')]['find']({'where':{'id':_0x57328e[_0xcb90('0x48')]['id']}})[_0xcb90('0x26')](handleEntityNotFound(_0x456ac2,null))['then'](saveUpdates(_0x57328e[_0xcb90('0x4c')],null))[_0xcb90('0x26')](respondWithResult(_0x456ac2,null))['catch'](handleError(_0x456ac2,null));};exports[_0xcb90('0x4d')]=function(_0x4fc9ea,_0x320231){return db[_0xcb90('0x2c')][_0xcb90('0x4d')]()[_0xcb90('0x26')](respondWithResult(_0x320231,null))['catch'](handleError(_0x320231,null));};exports[_0xcb90('0x4e')]=function(_0x3bd402,_0x375e9f,_0x2100d9){var _0x5b3836=require('../../components/encryptor');var _0xa134a6=![];var _0x52b27d={};if(_0x3bd402['query'][_0xcb90('0x40')]&&_0x3bd402['query'][_0xcb90('0x40')]==='uniqueid'){_0x52b27d[_0xcb90('0x4f')]=_0x3bd402[_0xcb90('0x48')]['id'];}else{_0x52b27d['id']=_0x3bd402[_0xcb90('0x48')]['id'];}return db['VoiceRecording'][_0xcb90('0x49')]({'where':_0x52b27d,'attributes':['id',_0xcb90('0x50')],'raw':!![]})['then'](handleEntityNotFound(_0x375e9f,null))['then'](function(_0x2fd2a9){if(_0x2fd2a9){var _0x293ecc=_0x2fd2a9[_0xcb90('0x50')];var _0x50c399=util[_0xcb90('0x30')](_0xcb90('0x51'),_0x293ecc);if(fs[_0xcb90('0x52')](_0x50c399)){_0xa134a6=!![];return _0x5b3836[_0xcb90('0x53')](_0x50c399,_0x293ecc,config[_0xcb90('0x54')][_0xcb90('0x55')])['then'](function(){return _0x2fd2a9;});}return _0x2fd2a9;}})[_0xcb90('0x26')](function(_0x772f65){if(_0x772f65){var _0x101b17=_0x772f65[_0xcb90('0x50')];if(!fs[_0xcb90('0x52')](_0x101b17)){throw new db[(_0xcb90('0x56'))]['ValidationError'](_0xcb90('0x57'));}if(_0x772f65['filename']){return _0x375e9f[_0xcb90('0x4e')](_0x101b17,_0x772f65[_0xcb90('0x58')]+path[_0xcb90('0x59')](_0x101b17),function(){if(_0xa134a6){fs[_0xcb90('0x5a')](_0x101b17);}});}else{return _0x375e9f[_0xcb90('0x4e')](_0x101b17,function(_0x599699){if(_0xa134a6){fs[_0xcb90('0x5a')](_0x101b17);}});}}})[_0xcb90('0x4a')](function(_0x3cd527){if(_0x3cd527['message']===_0xcb90('0x57')){_0x375e9f[_0xcb90('0x19')](0x194)[_0xcb90('0x2a')](_0xcb90('0x5b'));}else{return handleError(_0x375e9f,null);}});};exports['downloads']=function(_0x4b975f,_0x252147,_0x34ebe5){var _0x25fa12=require(_0xcb90('0x5c'));var _0x14f060=![];var _0xe1d2b2={'$and':[db[_0xcb90('0x5d')][_0xcb90('0x3b')](db['sequelize']['fn']('MD5',db[_0xcb90('0x5d')][_0xcb90('0x5e')](_0xcb90('0x4f'))),_0x4b975f[_0xcb90('0x31')][_0xcb90('0x5f')])]};if(_0x4b975f['query'][_0xcb90('0x40')]&&_0x4b975f[_0xcb90('0x31')][_0xcb90('0x40')]===_0xcb90('0x4f')){_0xe1d2b2[_0xcb90('0x60')]['push']({'uniqueid':_0x4b975f[_0xcb90('0x48')]['id']});}else{_0xe1d2b2[_0xcb90('0x60')][_0xcb90('0x61')]({'id':_0x4b975f[_0xcb90('0x48')]['id']});}return db[_0xcb90('0x2c')][_0xcb90('0x49')]({'where':_0xe1d2b2,'attributes':['id',_0xcb90('0x50')],'raw':!![]})[_0xcb90('0x26')](handleEntityNotFound(_0x252147,null))['then'](function(_0x5ae755){if(_0x5ae755){var _0x26e25a=util[_0xcb90('0x30')](_0xcb90('0x51'),_0x5ae755['value']);if(fs[_0xcb90('0x52')](_0x26e25a)){_0x14f060=!![];return _0x25fa12[_0xcb90('0x53')](_0x26e25a,_0x5ae755[_0xcb90('0x50')],config[_0xcb90('0x54')][_0xcb90('0x55')])[_0xcb90('0x26')](function(){return _0x5ae755;});}return _0x5ae755;}})[_0xcb90('0x26')](function(_0x50e270){if(_0x50e270){if(!fs[_0xcb90('0x52')](_0x50e270[_0xcb90('0x50')])){throw new db[(_0xcb90('0x56'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x50e270[_0xcb90('0x58')]){return _0x252147['download'](_0x50e270[_0xcb90('0x50')],_0x50e270[_0xcb90('0x58')]+path[_0xcb90('0x59')](_0x50e270['value']),function(){if(_0x14f060){fs[_0xcb90('0x5a')](_0x50e270[_0xcb90('0x50')]);}});}else{return _0x252147[_0xcb90('0x4e')](_0x50e270[_0xcb90('0x50')],function(_0x4307b0){if(_0x14f060){fs[_0xcb90('0x5a')](_0x50e270['value']);}});}}})['catch'](handleError(_0x252147,null));};exports[_0xcb90('0x25')]=function(_0x9c7b5c,_0x49583f){return db[_0xcb90('0x2c')][_0xcb90('0x49')]({'where':{'id':_0x9c7b5c[_0xcb90('0x48')]['id']}})[_0xcb90('0x26')](function(_0x1bfd21){if(_['isNil'](_0x1bfd21)){throw new ReferenceError(_0xcb90('0x62'));}return _0x1bfd21;})[_0xcb90('0x26')](function(_0x130a58){var _0x408a31=_0x130a58['value'];logger[_0xcb90('0x63')]('cancellazione\x20fisica\x20documento\x20%s',_0x408a31);if(!_[_0xcb90('0x64')](_0x130a58[_0xcb90('0x50')])&&fs['existsSync'](_0x408a31)){logger['info']('File:\x20\x22'+_0x408a31+_0xcb90('0x65'));fs[_0xcb90('0x66')](_0x408a31);}_0x408a31=_0x408a31+_0xcb90('0x67');if(!_['isNil'](_0x130a58[_0xcb90('0x50')])&&fs[_0xcb90('0x52')](_0x408a31)){logger['info'](_0xcb90('0x68')+_0x408a31+_0xcb90('0x65'));fs[_0xcb90('0x66')](_0x408a31);}return _0x130a58;})['then'](function(_0x7f2300){if(!_0x7f2300)throw new InternalError();return _0x7f2300[_0xcb90('0x25')]();})['then'](function(){_0x49583f[_0xcb90('0x19')](0xcc)[_0xcb90('0x1a')]();})['catch'](handleError(_0x49583f,null));};function getBucketslist(_0x2ec259,_0x4723a5,_0x385941){return new Promise(function(_0x365b94,_0xf59fdc){var _0x2a98c3=new AWS['S3']({'accessKeyId':_0x4723a5,'secretAccessKey':_0x2ec259,'region':_0x385941});_0x2a98c3[_0xcb90('0x69')]({},function(_0x389199,_0x209f09){if(_0x389199){return _0xf59fdc(_0x389199);}else{return _0x365b94(_0x209f09);}});});}function createBucket(_0x5bb1ed,_0x1e1f60,_0x3cf344,_0x5960c8){return new Promise(function(_0x5d49e7,_0x1e94bc){var _0xef4c20=new AWS['S3']({'accessKeyId':_0x1e1f60,'secretAccessKey':_0x5bb1ed,'region':_0x3cf344});_0xef4c20[_0xcb90('0x6a')]({'Bucket':_0x5960c8},function(_0xe17798,_0x4bd7f0){if(_0xe17798){return _0x1e94bc(_0xe17798);}else{return _0x5d49e7(_0x4bd7f0);}});});}function uploadFile(_0x3a9a85,_0x2e7e4a,_0x1180a2,_0x113488,_0x461181,_0x3f163f){return new Promise(function(_0x3dd42a,_0x526aa5){var _0x4d50e8=new AWS['S3']({'accessKeyId':_0x2e7e4a,'secretAccessKey':_0x3a9a85,'region':_0x1180a2});_0x4d50e8['upload']({'Bucket':_0x113488,'Key':_0x461181,'Body':_0x3f163f},function(_0x17b14d,_0xef7969){if(_0x17b14d){return _0x526aa5(_0x17b14d);}else{return _0x3dd42a(_0xef7969);}});});}function startTranscribe(_0x3cb8bd,_0x2e170b,_0x1882c0,_0x4ebec1,_0xadd8bd,_0x33b31b){return new Promise(function(_0x564129,_0x307f21){var _0x1cd43d=new AWS[(_0xcb90('0x6b'))]({'accessKeyId':_0x2e170b,'secretAccessKey':_0x3cb8bd,'region':_0x1882c0});_0x1cd43d[_0xcb90('0x6c')]({'TranscriptionJobName':_0x4ebec1,'LanguageCode':_0xadd8bd,'Media':{'MediaFileUri':_0x33b31b}},function(_0x2fd816,_0x44b826){if(_0x2fd816){return _0x307f21(_0x2fd816);}else{return _0x564129(_0x44b826);}});});}function transcribe(_0x177b1f,_0x2bcb5c,_0x4fcef1,_0x3a632c,_0xbe54ae,_0x24efa0,_0xe6d700){return new Promise(function(_0x12d64d,_0x3107c8){var _0x38b208={};logger[_0xcb90('0x63')](util[_0xcb90('0x30')](_0xcb90('0x6d'),_0x177b1f,_0xbe54ae));return uploadFile(_0x2bcb5c,_0x4fcef1,_0x3a632c,_0xbe54ae,path[_0xcb90('0x6e')](_0x24efa0),fs[_0xcb90('0x6f')](_0x24efa0))[_0xcb90('0x26')](function(_0x53d86b){logger[_0xcb90('0x63')](util['format'](_0xcb90('0x70'),_0x177b1f,_0xbe54ae,_0x53d86b[_0xcb90('0x71')]));_0x38b208['bucket']=_0x53d86b[_0xcb90('0x72')];_0x38b208[_0xcb90('0x73')]=_0x53d86b[_0xcb90('0x71')];logger[_0xcb90('0x63')](util[_0xcb90('0x30')](_0xcb90('0x74'),_0x177b1f));return startTranscribe(_0x2bcb5c,_0x4fcef1,_0x3a632c,uuidv4(),_0xe6d700,_0x53d86b[_0xcb90('0x71')]);})[_0xcb90('0x26')](function(_0x34364a){logger['info'](util[_0xcb90('0x30')](_0xcb90('0x75'),_0x177b1f,_0x34364a['TranscriptionJob'][_0xcb90('0x76')]));_0x38b208[_0xcb90('0x77')]=_0x34364a['TranscriptionJob'][_0xcb90('0x76')];_0x38b208['transcribeStatus']=_0x34364a[_0xcb90('0x78')][_0xcb90('0x79')];return _0x12d64d(_0x38b208);})[_0xcb90('0x4a')](function(_0x495548){return _0x3107c8(_0x495548);});});}exports[_0xcb90('0x7a')]=function(_0x1b0754,_0x4a81e5,_0x4f7e22){var _0x248a9e;var _0x49ddc4;var _0x315cde;var _0x8c344b=require(_0xcb90('0x5c'));return db[_0xcb90('0x2c')][_0xcb90('0x7b')]({'where':{'id':_0x1b0754[_0xcb90('0x48')]['id']}})['then'](function(_0x299620){if(_0x299620){var _0x18ca19=util[_0xcb90('0x30')](_0xcb90('0x51'),_0x299620['value']);if(fs[_0xcb90('0x52')](_0x18ca19)){cypher=!![];return _0x8c344b[_0xcb90('0x53')](_0x18ca19,_0x299620['value'],config[_0xcb90('0x54')][_0xcb90('0x55')])[_0xcb90('0x26')](function(){return _0x299620;});}return _0x299620;}})['then'](function(_0x3beda7){if(!_0x3beda7){throw new db['Sequelize']['ValidationError'](_0xcb90('0x7c'));}_0x49ddc4=_0x3beda7;return db[_0xcb90('0x7d')]['findOne']({'where':{'id':0x1}});})[_0xcb90('0x26')](handleEntityNotFound(_0x4a81e5,null))[_0xcb90('0x26')](function(_0x458974){if(_0x458974){_0x248a9e=_0x458974;if(!_0x248a9e['transcribe']||!_0x248a9e[_0xcb90('0x7e')]||!_0x248a9e['transcribeRegion']||!_0x248a9e[_0xcb90('0x7f')]||!_0x248a9e[_0xcb90('0x80')]){throw new db[(_0xcb90('0x56'))][(_0xcb90('0x81'))]('Transcribe\x20not\x20configured');}if(_0x1b0754[_0xcb90('0x4c')][_0xcb90('0x82')]&&(!_0x248a9e[_0xcb90('0x83')]||!_0x248a9e[_0xcb90('0x84')]||!_0x248a9e['sentimentRegion']||!_0x248a9e['language']||!_0x248a9e[_0xcb90('0x80')])){throw new db[(_0xcb90('0x56'))]['ValidationError'](_0xcb90('0x85'));}return db['CloudProvider'][_0xcb90('0x7b')]({'where':{'id':_0x248a9e[_0xcb90('0x7e')]}});}})[_0xcb90('0x26')](function(_0x53b354){if(!_0x53b354){throw new db[(_0xcb90('0x56'))][(_0xcb90('0x81'))](_0xcb90('0x86'));}if(!_0x53b354[_0xcb90('0x87')]||!_0x53b354[_0xcb90('0x88')]){throw new db[(_0xcb90('0x56'))][(_0xcb90('0x81'))]('Cloud\x20Provider\x20not\x20configured');}_0x315cde=_0x53b354;return getBucketslist(_0x315cde[_0xcb90('0x87')],_0x315cde[_0xcb90('0x88')],_0x248a9e['transcribeRegion']);})['then'](function(_0x3aaf09){if(_0x3aaf09&&_0x3aaf09['Buckets']){var _0x2bf1cb=_['find'](_0x3aaf09[_0xcb90('0x89')],function(_0x56d38e){return _0x56d38e[_0xcb90('0x8a')]===_0x248a9e['bucket'];});if(!_0x2bf1cb){logger['info'](util[_0xcb90('0x30')](_0xcb90('0x8b'),_0x1b0754[_0xcb90('0x48')]['id'],_0x248a9e[_0xcb90('0x80')]));return createBucket(_0x315cde[_0xcb90('0x87')],_0x315cde[_0xcb90('0x88')],_0x248a9e['transcribeRegion'],_0x248a9e['bucket']);}logger['info'](util[_0xcb90('0x30')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x1b0754['params']['id'],_0x248a9e[_0xcb90('0x80')]));return;}})[_0xcb90('0x26')](function(_0x57c67e){if(_0x49ddc4[_0xcb90('0x8c')]===_0xcb90('0x8d')){return transcribe(_0x1b0754[_0xcb90('0x48')]['id'],_0x315cde[_0xcb90('0x87')],_0x315cde[_0xcb90('0x88')],_0x248a9e[_0xcb90('0x8e')],_0x248a9e[_0xcb90('0x80')],_0x49ddc4[_0xcb90('0x50')],_0x248a9e[_0xcb90('0x7f')]);}else{logger[_0xcb90('0x63')](util[_0xcb90('0x30')](_0xcb90('0x8f'),_0x1b0754[_0xcb90('0x48')]['id']));return{'transcribeStatus':_0xcb90('0x90')};}})[_0xcb90('0x26')](function(_0x18aebb){if(_0x18aebb){_0x18aebb[_0xcb90('0x91')]=_0x1b0754['body'][_0xcb90('0x82')];return _0x49ddc4[_0xcb90('0x92')](_0x18aebb);}})[_0xcb90('0x26')](respondWithResult(_0x4a81e5,null))[_0xcb90('0x4a')](handleError(_0x4a81e5,null));};function writeFile(_0x1acd7d,_0x59b8e1){return new Promise(function(_0x153903,_0x3334e6){fs[_0xcb90('0x93')](_0x59b8e1,_0x1acd7d,function(_0xc89809,_0x2ea283){if(_0xc89809){return _0x3334e6(_0xc89809);}else{return _0x153903(_0x2ea283);}});});}exports['downloadTranscribe']=function(_0x3246e9,_0x56d57b,_0x4dcce4){return db[_0xcb90('0x2c')]['findOne']({'where':{'id':_0x3246e9[_0xcb90('0x48')]['id']}})[_0xcb90('0x26')](handleEntityNotFound(_0x56d57b))[_0xcb90('0x26')](function(_0x44fb7d){if(_0x44fb7d&&_0x44fb7d[_0xcb90('0x94')]){var _0x538c17=_0x44fb7d['fileText'];var _0xa487fb=config['root']+'/server/files/transcribes/transcribe_'+_0x44fb7d['id']+_0xcb90('0x95');if(fs[_0xcb90('0x52')](_0xa487fb)){return _0xa487fb;}return writeFile(_0x538c17,_0xa487fb)['then'](function(){return _0xa487fb;});}else{throw new db['Sequelize']['ValidationError'](_0xcb90('0x96'));}})['then'](function(_0x5834a2){return _0x56d57b[_0xcb90('0x4e')](_0x5834a2);})[_0xcb90('0x4a')](handleError(_0x56d57b));}; \ No newline at end of file +var _0x74fc=['params','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','decryptFile','recording','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','secrets','existsSync','Entity\x20not\x20found','info','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','listBuckets','createBucket','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','transcribeStatus','runTranscribe','findOne','Sequelize','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','desk.js','to-csv','querystring','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','name','send','map','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','VoiceRecording','includeAll','findAll','show','include','find','create','body','catch'];(function(_0x18edfb,_0x5303af){var _0x1884a0=function(_0x3b42db){while(--_0x3b42db){_0x18edfb['push'](_0x18edfb['shift']());}};_0x1884a0(++_0x5303af);}(_0x74fc,0x17a));var _0xc74f=function(_0x3ecafd,_0x592c37){_0x3ecafd=_0x3ecafd-0x0;var _0x12c422=_0x74fc[_0x3ecafd];return _0x12c422;};'use strict';var emlformat=require(_0xc74f('0x0'));var rimraf=require(_0xc74f('0x1'));var zipdir=require(_0xc74f('0x2'));var jsonpatch=require(_0xc74f('0x3'));var rp=require(_0xc74f('0x4'));var moment=require(_0xc74f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc74f('0x6'));var util=require(_0xc74f('0x7'));var path=require(_0xc74f('0x8'));var sox=require(_0xc74f('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc74f('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc74f('0xb'));var toCsv=require(_0xc74f('0xc'));var querystring=require(_0xc74f('0xd'));var Papa=require('papaparse');var AWS=require('aws-sdk');var uuidv4=require(_0xc74f('0xe'));var Redis=require(_0xc74f('0xf'));var authService=require(_0xc74f('0x10'));var qs=require(_0xc74f('0x11'));var as=require(_0xc74f('0x12'));var hardwareService=require(_0xc74f('0x13'));var logger=require(_0xc74f('0x14'))(_0xc74f('0x15'));var utils=require(_0xc74f('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc74f('0x17'));var db=require(_0xc74f('0x18'))['db'];function respondWithStatusCode(_0x5cc4ac,_0x1753fe){_0x1753fe=_0x1753fe||0xcc;return function(_0x81cfa){if(_0x81cfa){return _0x5cc4ac[_0xc74f('0x19')](_0x1753fe);}return _0x5cc4ac['status'](_0x1753fe)[_0xc74f('0x1a')]();};}function respondWithResult(_0x2859b8,_0x3d6847){_0x3d6847=_0x3d6847||0xc8;return function(_0x47d8b7){if(_0x47d8b7){return _0x2859b8[_0xc74f('0x1b')](_0x3d6847)[_0xc74f('0x1c')](_0x47d8b7);}};}function respondWithFilteredResult(_0x4687c3,_0x5a8cbb){return function(_0x1676d1){if(_0x1676d1){var _0x2d8968=typeof _0x5a8cbb[_0xc74f('0x1d')]===_0xc74f('0x1e')&&typeof _0x5a8cbb[_0xc74f('0x1f')]===_0xc74f('0x1e');var _0x274965=_0x1676d1['count'];var _0x3cbb49=_0x2d8968?0x0:_0x5a8cbb['offset'];var _0x460aad=_0x2d8968?_0x1676d1[_0xc74f('0x20')]:_0x5a8cbb[_0xc74f('0x1d')]+_0x5a8cbb[_0xc74f('0x1f')];var _0x5b9998;if(_0x460aad>=_0x274965){_0x460aad=_0x274965;_0x5b9998=0xc8;}else{_0x5b9998=0xce;}_0x4687c3[_0xc74f('0x1b')](_0x5b9998);return _0x4687c3['set'](_0xc74f('0x21'),_0x3cbb49+'-'+_0x460aad+'/'+_0x274965)[_0xc74f('0x1c')](_0x1676d1);}return null;};}function patchUpdates(_0x533489){return function(_0x13a5f2){try{jsonpatch[_0xc74f('0x22')](_0x13a5f2,_0x533489,!![]);}catch(_0x1d2f9a){return BPromise[_0xc74f('0x23')](_0x1d2f9a);}return _0x13a5f2[_0xc74f('0x24')]();};}function saveUpdates(_0x155414,_0x474156){return function(_0x2e84d5){if(_0x2e84d5){return _0x2e84d5[_0xc74f('0x25')](_0x155414)[_0xc74f('0x26')](function(_0x24d610){return _0x24d610;});}return null;};}function removeEntity(_0x5075ee,_0x22b396){return function(_0x45f5f4){if(_0x45f5f4){return _0x45f5f4[_0xc74f('0x27')]()[_0xc74f('0x26')](function(){_0x5075ee[_0xc74f('0x1b')](0xcc)[_0xc74f('0x1a')]();});}};}function handleEntityNotFound(_0x51b642,_0x42147f){return function(_0x2c6536){if(!_0x2c6536){_0x51b642[_0xc74f('0x19')](0x194);}return _0x2c6536;};}function handleError(_0xccd16b,_0x1909b8){_0x1909b8=_0x1909b8||0x1f4;return function(_0x507554){logger['error'](_0x507554['stack']);if(_0x507554[_0xc74f('0x28')]){delete _0x507554['name'];}_0xccd16b[_0xc74f('0x1b')](_0x1909b8)[_0xc74f('0x29')](_0x507554);};}exports['index']=function(_0x2f88cc,_0x4b7e54){var _0x1dec60={},_0x144e39={},_0x163271={'count':0x0,'rows':[]};var _0x148d34=_[_0xc74f('0x2a')](db['VoiceRecording'][_0xc74f('0x2b')],function(_0x423763){return{'name':_0x423763[_0xc74f('0x2c')],'type':_0x423763[_0xc74f('0x2d')][_0xc74f('0x2e')]};});_0x144e39[_0xc74f('0x2f')]=_[_0xc74f('0x30')](_['map'](_0x148d34,'name'),[_0xc74f('0x31')]);_0x144e39[_0xc74f('0x32')]=_[_0xc74f('0x33')](_0x2f88cc[_0xc74f('0x32')]);_0x144e39[_0xc74f('0x34')]=_['intersection'](_0x144e39[_0xc74f('0x2f')],_0x144e39[_0xc74f('0x32')]);_0x1dec60[_0xc74f('0x35')]=_[_0xc74f('0x36')](_0x144e39[_0xc74f('0x2f')],qs[_0xc74f('0x37')](_0x2f88cc[_0xc74f('0x32')]['fields']));_0x1dec60[_0xc74f('0x35')]=_0x1dec60[_0xc74f('0x35')][_0xc74f('0x38')]?_0x1dec60['attributes']:_0x144e39[_0xc74f('0x2f')];if(!_0x2f88cc[_0xc74f('0x32')][_0xc74f('0x39')]('nolimit')){_0x1dec60[_0xc74f('0x1f')]=qs['limit'](_0x2f88cc[_0xc74f('0x32')]['limit']);_0x1dec60[_0xc74f('0x1d')]=qs[_0xc74f('0x1d')](_0x2f88cc[_0xc74f('0x32')]['offset']);}_0x1dec60[_0xc74f('0x3a')]=qs[_0xc74f('0x3b')](_0x2f88cc[_0xc74f('0x32')]['sort']);_0x1dec60[_0xc74f('0x3c')]=qs['filters'](_[_0xc74f('0x3d')](_0x2f88cc[_0xc74f('0x32')],_0x144e39['filters']),_0x148d34);if(_0x2f88cc['query']['filter']){_0x1dec60[_0xc74f('0x3c')]=_[_0xc74f('0x3e')](_0x1dec60[_0xc74f('0x3c')],{'$or':_[_0xc74f('0x2a')](_0x148d34,function(_0x5c2ae6){if(_0x5c2ae6['type']!==_0xc74f('0x3f')){var _0x408167={};_0x408167[_0x5c2ae6[_0xc74f('0x28')]]={'$like':'%'+_0x2f88cc[_0xc74f('0x32')][_0xc74f('0x40')]+'%'};return _0x408167;}})});}_0x1dec60=_[_0xc74f('0x3e')]({},_0x1dec60,_0x2f88cc[_0xc74f('0x41')]);var _0x10bbb4={'where':_0x1dec60[_0xc74f('0x3c')]};return db[_0xc74f('0x42')]['count'](_0x10bbb4)['then'](function(_0x2d5d94){_0x163271[_0xc74f('0x20')]=_0x2d5d94;if(_0x2f88cc[_0xc74f('0x32')][_0xc74f('0x43')]){_0x1dec60['include']=[{'all':!![]}];}return db[_0xc74f('0x42')][_0xc74f('0x44')](_0x1dec60);})['then'](function(_0x3e21af){_0x163271['rows']=_0x3e21af;return _0x163271;})[_0xc74f('0x26')](respondWithFilteredResult(_0x4b7e54,_0x1dec60))['catch'](handleError(_0x4b7e54,null));};exports[_0xc74f('0x45')]=function(_0x1e5981,_0x1f91c2){var _0x4042be={'raw':![],'where':{'id':_0x1e5981['params']['id']}},_0x454a73={};_0x454a73[_0xc74f('0x2f')]=_['keys'](db[_0xc74f('0x42')][_0xc74f('0x2b')]);_0x454a73[_0xc74f('0x32')]=_[_0xc74f('0x33')](_0x1e5981[_0xc74f('0x32')]);_0x454a73[_0xc74f('0x34')]=_[_0xc74f('0x36')](_0x454a73[_0xc74f('0x2f')],_0x454a73[_0xc74f('0x32')]);_0x4042be[_0xc74f('0x35')]=_[_0xc74f('0x36')](_0x454a73[_0xc74f('0x2f')],qs[_0xc74f('0x37')](_0x1e5981[_0xc74f('0x32')][_0xc74f('0x37')]));_0x4042be['attributes']=_0x4042be['attributes'][_0xc74f('0x38')]?_0x4042be[_0xc74f('0x35')]:_0x454a73['model'];if(_0x1e5981[_0xc74f('0x32')][_0xc74f('0x43')]){_0x4042be[_0xc74f('0x46')]=[{'all':!![]}];}_0x4042be=_['merge']({},_0x4042be,_0x1e5981[_0xc74f('0x41')]);return db['VoiceRecording'][_0xc74f('0x47')](_0x4042be)[_0xc74f('0x26')](handleEntityNotFound(_0x1f91c2,null))['then'](respondWithResult(_0x1f91c2,null))['catch'](handleError(_0x1f91c2,null));};exports[_0xc74f('0x48')]=function(_0x53ad2f,_0x492b3e){return db['VoiceRecording']['create'](_0x53ad2f[_0xc74f('0x49')],{})[_0xc74f('0x26')](respondWithResult(_0x492b3e,0xc9))[_0xc74f('0x4a')](handleError(_0x492b3e,null));};exports[_0xc74f('0x25')]=function(_0x6854bf,_0x428525){if(_0x6854bf['body']['id']){delete _0x6854bf['body']['id'];}return db[_0xc74f('0x42')][_0xc74f('0x47')]({'where':{'id':_0x6854bf[_0xc74f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x428525,null))[_0xc74f('0x26')](saveUpdates(_0x6854bf['body'],null))[_0xc74f('0x26')](respondWithResult(_0x428525,null))[_0xc74f('0x4a')](handleError(_0x428525,null));};exports[_0xc74f('0x4c')]=function(_0x15b94d,_0x14e39a){return db[_0xc74f('0x42')][_0xc74f('0x4c')]()[_0xc74f('0x26')](respondWithResult(_0x14e39a,null))[_0xc74f('0x4a')](handleError(_0x14e39a,null));};exports[_0xc74f('0x4d')]=function(_0x503675,_0x33639a,_0x2cd68a){var _0x3e16ba=require(_0xc74f('0x4e'));var _0x3b083a=![];var _0x3f88ba={};if(_0x503675[_0xc74f('0x32')][_0xc74f('0x2d')]&&_0x503675[_0xc74f('0x32')][_0xc74f('0x2d')]==='uniqueid'){_0x3f88ba[_0xc74f('0x4f')]=_0x503675[_0xc74f('0x4b')]['id'];}else{_0x3f88ba['id']=_0x503675[_0xc74f('0x4b')]['id'];}return db[_0xc74f('0x42')][_0xc74f('0x47')]({'where':_0x3f88ba,'attributes':['id',_0xc74f('0x50')],'raw':!![]})[_0xc74f('0x26')](handleEntityNotFound(_0x33639a,null))[_0xc74f('0x26')](function(_0x456b0c){if(_0x456b0c){var _0x24aee6=_0x456b0c[_0xc74f('0x50')];var _0x472114=util[_0xc74f('0x31')](_0xc74f('0x51'),_0x24aee6);if(fs['existsSync'](_0x472114)){_0x3b083a=!![];return _0x3e16ba[_0xc74f('0x52')](_0x472114,_0x24aee6,config['secrets'][_0xc74f('0x53')])[_0xc74f('0x26')](function(){return _0x456b0c;});}return _0x456b0c;}})[_0xc74f('0x26')](function(_0x266ef3){if(_0x266ef3){var _0xcf438b=_0x266ef3['value'];if(!fs['existsSync'](_0xcf438b)){throw new db['Sequelize'][(_0xc74f('0x54'))](_0xc74f('0x55'));}if(_0x266ef3[_0xc74f('0x56')]){return _0x33639a[_0xc74f('0x4d')](_0xcf438b,_0x266ef3[_0xc74f('0x56')]+path[_0xc74f('0x57')](_0xcf438b),function(){if(_0x3b083a){fs[_0xc74f('0x58')](_0xcf438b);}});}else{return _0x33639a[_0xc74f('0x4d')](_0xcf438b,function(_0x4e4fc6){if(_0x3b083a){fs[_0xc74f('0x58')](_0xcf438b);}});}}})[_0xc74f('0x4a')](function(_0x1f7982){if(_0x1f7982[_0xc74f('0x59')]===_0xc74f('0x55')){_0x33639a['status'](0x194)[_0xc74f('0x29')](_0xc74f('0x5a'));}else{return handleError(_0x33639a,null);}});};exports[_0xc74f('0x5b')]=function(_0x3439c2,_0x457afb,_0x1dae0a){var _0xba7b9b=require(_0xc74f('0x4e'));var _0x1ce873=![];var _0x263c83={'$and':[db[_0xc74f('0x5c')][_0xc74f('0x3c')](db[_0xc74f('0x5c')]['fn'](_0xc74f('0x5d'),db[_0xc74f('0x5c')][_0xc74f('0x5e')]('uniqueid')),_0x3439c2['query'][_0xc74f('0x5f')])]};if(_0x3439c2[_0xc74f('0x32')][_0xc74f('0x2d')]&&_0x3439c2['query'][_0xc74f('0x2d')]===_0xc74f('0x4f')){_0x263c83[_0xc74f('0x60')][_0xc74f('0x61')]({'uniqueid':_0x3439c2['params']['id']});}else{_0x263c83[_0xc74f('0x60')][_0xc74f('0x61')]({'id':_0x3439c2[_0xc74f('0x4b')]['id']});}return db['VoiceRecording']['find']({'where':_0x263c83,'attributes':['id',_0xc74f('0x50')],'raw':!![]})[_0xc74f('0x26')](handleEntityNotFound(_0x457afb,null))[_0xc74f('0x26')](function(_0x33b17b){if(_0x33b17b){var _0xc5f57f=util[_0xc74f('0x31')](_0xc74f('0x51'),_0x33b17b[_0xc74f('0x50')]);if(fs['existsSync'](_0xc5f57f)){_0x1ce873=!![];return _0xba7b9b[_0xc74f('0x52')](_0xc5f57f,_0x33b17b['value'],config[_0xc74f('0x62')]['recording'])[_0xc74f('0x26')](function(){return _0x33b17b;});}return _0x33b17b;}})[_0xc74f('0x26')](function(_0x13b861){if(_0x13b861){if(!fs[_0xc74f('0x63')](_0x13b861[_0xc74f('0x50')])){throw new db['Sequelize'][(_0xc74f('0x54'))](_0xc74f('0x55'));}if(_0x13b861[_0xc74f('0x56')]){return _0x457afb['download'](_0x13b861[_0xc74f('0x50')],_0x13b861[_0xc74f('0x56')]+path[_0xc74f('0x57')](_0x13b861[_0xc74f('0x50')]),function(){if(_0x1ce873){fs['unlink'](_0x13b861[_0xc74f('0x50')]);}});}else{return _0x457afb[_0xc74f('0x4d')](_0x13b861[_0xc74f('0x50')],function(_0x3cf874){if(_0x1ce873){fs[_0xc74f('0x58')](_0x13b861[_0xc74f('0x50')]);}});}}})[_0xc74f('0x4a')](handleError(_0x457afb,null));};exports['destroy']=function(_0x43c174,_0x2a8acf){return db[_0xc74f('0x42')][_0xc74f('0x47')]({'where':{'id':_0x43c174[_0xc74f('0x4b')]['id']}})[_0xc74f('0x26')](function(_0x5b115d){if(_['isNil'](_0x5b115d)){throw new ReferenceError(_0xc74f('0x64'));}return _0x5b115d;})[_0xc74f('0x26')](function(_0x5eb355){var _0x247218=_0x5eb355[_0xc74f('0x50')];logger[_0xc74f('0x65')]('cancellazione\x20fisica\x20documento\x20%s',_0x247218);if(!_[_0xc74f('0x66')](_0x5eb355['value'])&&fs['existsSync'](_0x247218)){logger[_0xc74f('0x65')]('File:\x20\x22'+_0x247218+_0xc74f('0x67'));fs[_0xc74f('0x68')](_0x247218);}_0x247218=_0x247218+'.cypher';if(!_[_0xc74f('0x66')](_0x5eb355[_0xc74f('0x50')])&&fs[_0xc74f('0x63')](_0x247218)){logger[_0xc74f('0x65')](_0xc74f('0x69')+_0x247218+_0xc74f('0x67'));fs[_0xc74f('0x68')](_0x247218);}return _0x5eb355;})['then'](function(_0x4c0944){if(!_0x4c0944)throw new InternalError();return _0x4c0944[_0xc74f('0x27')]();})[_0xc74f('0x26')](function(){_0x2a8acf['status'](0xcc)[_0xc74f('0x1a')]();})[_0xc74f('0x4a')](handleError(_0x2a8acf,null));};function getBucketslist(_0x557155,_0x589e97,_0x2c9786){return new Promise(function(_0x4f2f7c,_0x324ffb){var _0x1fd652=new AWS['S3']({'accessKeyId':_0x589e97,'secretAccessKey':_0x557155,'region':_0x2c9786});_0x1fd652[_0xc74f('0x6a')]({},function(_0x38a812,_0x25803b){if(_0x38a812){return _0x324ffb(_0x38a812);}else{return _0x4f2f7c(_0x25803b);}});});}function createBucket(_0x347815,_0x4c214,_0x57d94e,_0x18bb86){return new Promise(function(_0x3616da,_0x455373){var _0x3538c2=new AWS['S3']({'accessKeyId':_0x4c214,'secretAccessKey':_0x347815,'region':_0x57d94e});_0x3538c2[_0xc74f('0x6b')]({'Bucket':_0x18bb86},function(_0x1343c4,_0x52fe02){if(_0x1343c4){return _0x455373(_0x1343c4);}else{return _0x3616da(_0x52fe02);}});});}function uploadFile(_0x2dd9cc,_0x2937c2,_0x516d0f,_0x522333,_0x5cb8c7,_0x189087){return new Promise(function(_0x5b763f,_0x53539a){var _0xc8337d=new AWS['S3']({'accessKeyId':_0x2937c2,'secretAccessKey':_0x2dd9cc,'region':_0x516d0f});_0xc8337d['upload']({'Bucket':_0x522333,'Key':_0x5cb8c7,'Body':_0x189087},function(_0x1a65b4,_0x2c3847){if(_0x1a65b4){return _0x53539a(_0x1a65b4);}else{return _0x5b763f(_0x2c3847);}});});}function startTranscribe(_0x4402b4,_0x2ed1b8,_0x1bde86,_0x188103,_0x2b87b3,_0xe0fd1b){return new Promise(function(_0x539e22,_0x232ae1){var _0xe6d68d=new AWS[(_0xc74f('0x6c'))]({'accessKeyId':_0x2ed1b8,'secretAccessKey':_0x4402b4,'region':_0x1bde86});_0xe6d68d[_0xc74f('0x6d')]({'TranscriptionJobName':_0x188103,'LanguageCode':_0x2b87b3,'Media':{'MediaFileUri':_0xe0fd1b}},function(_0x3f1ab9,_0x40f810){if(_0x3f1ab9){return _0x232ae1(_0x3f1ab9);}else{return _0x539e22(_0x40f810);}});});}function transcribe(_0x46e4ac,_0x4b0bb4,_0x3336c0,_0x528d9c,_0x1b5ccb,_0x20eb9e,_0x17833f){return new Promise(function(_0x56c1cc,_0x36c6fe){var _0x47559d={};logger[_0xc74f('0x65')](util[_0xc74f('0x31')](_0xc74f('0x6e'),_0x46e4ac,_0x1b5ccb));return uploadFile(_0x4b0bb4,_0x3336c0,_0x528d9c,_0x1b5ccb,path[_0xc74f('0x6f')](_0x20eb9e),fs[_0xc74f('0x70')](_0x20eb9e))[_0xc74f('0x26')](function(_0x208908){logger[_0xc74f('0x65')](util[_0xc74f('0x31')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x46e4ac,_0x1b5ccb,_0x208908[_0xc74f('0x71')]));_0x47559d[_0xc74f('0x72')]=_0x208908['Bucket'];_0x47559d[_0xc74f('0x73')]=_0x208908[_0xc74f('0x71')];logger[_0xc74f('0x65')](util[_0xc74f('0x31')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x46e4ac));return startTranscribe(_0x4b0bb4,_0x3336c0,_0x528d9c,uuidv4(),_0x17833f,_0x208908[_0xc74f('0x71')]);})[_0xc74f('0x26')](function(_0x56e52e){logger[_0xc74f('0x65')](util['format'](_0xc74f('0x74'),_0x46e4ac,_0x56e52e[_0xc74f('0x75')]['TranscriptionJobName']));_0x47559d[_0xc74f('0x76')]=_0x56e52e[_0xc74f('0x75')][_0xc74f('0x77')];_0x47559d[_0xc74f('0x78')]=_0x56e52e[_0xc74f('0x75')]['TranscriptionJobStatus'];return _0x56c1cc(_0x47559d);})['catch'](function(_0x4b8c05){return _0x36c6fe(_0x4b8c05);});});}exports[_0xc74f('0x79')]=function(_0x552b7b,_0x54a42e,_0x3a9459){var _0x86a559;var _0x3cd9ba;var _0x251e17;var _0x1fd6a2=require('../../components/encryptor');return db['VoiceRecording'][_0xc74f('0x7a')]({'where':{'id':_0x552b7b[_0xc74f('0x4b')]['id']}})['then'](function(_0x4c3b1e){if(_0x4c3b1e){var _0x400e36=util['format'](_0xc74f('0x51'),_0x4c3b1e['value']);if(fs[_0xc74f('0x63')](_0x400e36)){cypher=!![];return _0x1fd6a2['decryptFile'](_0x400e36,_0x4c3b1e[_0xc74f('0x50')],config[_0xc74f('0x62')][_0xc74f('0x53')])['then'](function(){return _0x4c3b1e;});}return _0x4c3b1e;}})[_0xc74f('0x26')](function(_0x5b8cf9){if(!_0x5b8cf9){throw new db[(_0xc74f('0x7b'))][(_0xc74f('0x54'))]('Voice\x20Recording\x20not\x20found');}_0x3cd9ba=_0x5b8cf9;return db[_0xc74f('0x7c')][_0xc74f('0x7a')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x54a42e,null))['then'](function(_0x42557b){if(_0x42557b){_0x86a559=_0x42557b;if(!_0x86a559[_0xc74f('0x7d')]||!_0x86a559[_0xc74f('0x7e')]||!_0x86a559[_0xc74f('0x7f')]||!_0x86a559[_0xc74f('0x80')]||!_0x86a559['bucket']){throw new db[(_0xc74f('0x7b'))]['ValidationError'](_0xc74f('0x81'));}if(_0x552b7b[_0xc74f('0x49')]['runSentiment']&&(!_0x86a559[_0xc74f('0x82')]||!_0x86a559[_0xc74f('0x83')]||!_0x86a559[_0xc74f('0x84')]||!_0x86a559[_0xc74f('0x80')]||!_0x86a559[_0xc74f('0x72')])){throw new db['Sequelize'][(_0xc74f('0x54'))](_0xc74f('0x85'));}return db[_0xc74f('0x86')]['findOne']({'where':{'id':_0x86a559['transcribeAccountId']}});}})[_0xc74f('0x26')](function(_0x3d6021){if(!_0x3d6021){throw new db[(_0xc74f('0x7b'))][(_0xc74f('0x54'))](_0xc74f('0x87'));}if(!_0x3d6021[_0xc74f('0x88')]||!_0x3d6021[_0xc74f('0x89')]){throw new db['Sequelize'][(_0xc74f('0x54'))](_0xc74f('0x8a'));}_0x251e17=_0x3d6021;return getBucketslist(_0x251e17['data1'],_0x251e17[_0xc74f('0x89')],_0x86a559[_0xc74f('0x7f')]);})[_0xc74f('0x26')](function(_0x47d95f){if(_0x47d95f&&_0x47d95f[_0xc74f('0x8b')]){var _0x307ecb=_['find'](_0x47d95f['Buckets'],function(_0x290426){return _0x290426['Name']===_0x86a559[_0xc74f('0x72')];});if(!_0x307ecb){logger[_0xc74f('0x65')](util['format'](_0xc74f('0x8c'),_0x552b7b['params']['id'],_0x86a559[_0xc74f('0x72')]));return createBucket(_0x251e17[_0xc74f('0x88')],_0x251e17[_0xc74f('0x89')],_0x86a559[_0xc74f('0x7f')],_0x86a559[_0xc74f('0x72')]);}logger[_0xc74f('0x65')](util[_0xc74f('0x31')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x552b7b[_0xc74f('0x4b')]['id'],_0x86a559['bucket']));return;}})['then'](function(_0x43d690){if(_0x3cd9ba[_0xc74f('0x78')]==='NEW'){return transcribe(_0x552b7b[_0xc74f('0x4b')]['id'],_0x251e17[_0xc74f('0x88')],_0x251e17[_0xc74f('0x89')],_0x86a559['transcribeRegion'],_0x86a559[_0xc74f('0x72')],_0x3cd9ba[_0xc74f('0x50')],_0x86a559[_0xc74f('0x80')]);}else{logger[_0xc74f('0x65')](util[_0xc74f('0x31')](_0xc74f('0x8d'),_0x552b7b[_0xc74f('0x4b')]['id']));return{'transcribeStatus':_0xc74f('0x8e')};}})[_0xc74f('0x26')](function(_0x463885){if(_0x463885){_0x463885[_0xc74f('0x8f')]=_0x552b7b[_0xc74f('0x49')][_0xc74f('0x90')];return _0x3cd9ba[_0xc74f('0x91')](_0x463885);}})[_0xc74f('0x26')](respondWithResult(_0x54a42e,null))[_0xc74f('0x4a')](handleError(_0x54a42e,null));};function writeFile(_0x11312a,_0x576a75){return new Promise(function(_0x5e92a0,_0x3ffed2){fs[_0xc74f('0x92')](_0x576a75,_0x11312a,function(_0x1e52a6,_0x13f710){if(_0x1e52a6){return _0x3ffed2(_0x1e52a6);}else{return _0x5e92a0(_0x13f710);}});});}exports[_0xc74f('0x93')]=function(_0x420633,_0x3cc16a,_0x8e9fdf){return db[_0xc74f('0x42')]['findOne']({'where':{'id':_0x420633[_0xc74f('0x4b')]['id']}})[_0xc74f('0x26')](handleEntityNotFound(_0x3cc16a))[_0xc74f('0x26')](function(_0x509a22){if(_0x509a22&&_0x509a22[_0xc74f('0x94')]){var _0x3f9c1c=_0x509a22[_0xc74f('0x94')];var _0x21d1d4=config[_0xc74f('0x95')]+_0xc74f('0x96')+_0x509a22['id']+'.txt';if(fs['existsSync'](_0x21d1d4)){return _0x21d1d4;}return writeFile(_0x3f9c1c,_0x21d1d4)[_0xc74f('0x26')](function(){return _0x21d1d4;});}else{throw new db['Sequelize'][(_0xc74f('0x54'))]('Transcript\x20not\x20available');}})[_0xc74f('0x26')](function(_0x216501){return _0x3cc16a[_0xc74f('0x4d')](_0x216501);})[_0xc74f('0x4a')](handleError(_0x3cc16a));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index e779881..3ecc342 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 _0xb201=['transcribeStatus','./voiceRecording.attributes','define','VoiceRecording','voice_recordings','uniqueid'];(function(_0x57b2ef,_0x2f3ad2){var _0x198ece=function(_0x565828){while(--_0x565828){_0x57b2ef['push'](_0x57b2ef['shift']());}};_0x198ece(++_0x2f3ad2);}(_0xb201,0x1b1));var _0x1b20=function(_0x17ea10,_0x24330e){_0x17ea10=_0x17ea10-0x0;var _0x362886=_0xb201[_0x17ea10];return _0x362886;};'use strict';var attributes=require(_0x1b20('0x0'));module['exports']=function(_0x333586,_0x1db4d5){return _0x333586[_0x1b20('0x1')](_0x1b20('0x2'),attributes,{'tableName':_0x1b20('0x3'),'paranoid':![],'indexes':[{'name':_0x1b20('0x4'),'fields':['uniqueid']},{'name':_0x1b20('0x5'),'fields':[_0x1b20('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x668b=['uniqueid','transcribeStatus','./voiceRecording.attributes','exports','define','voice_recordings'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x668b,0x140));var _0xb668=function(_0x130705,_0x2d266b){_0x130705=_0x130705-0x0;var _0x1fa991=_0x668b[_0x130705];return _0x1fa991;};'use strict';var attributes=require(_0xb668('0x0'));module[_0xb668('0x1')]=function(_0x51555f,_0x15fbea){return _0x51555f[_0xb668('0x2')]('VoiceRecording',attributes,{'tableName':_0xb668('0x3'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb668('0x4')]},{'name':_0xb668('0x5'),'fields':[_0xb668('0x5')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 30a9ebe..35eeb5c 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 _0xeb3b=['rpc','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','raw','options','attributes','limit','stringify','../../components/encryptor','findOne','value','format','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','debug','lodash','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x48291a,_0x5a29dc){var _0xf76871=function(_0x2a4be5){while(--_0x2a4be5){_0x48291a['push'](_0x48291a['shift']());}};_0xf76871(++_0x5a29dc);}(_0xeb3b,0x19e));var _0xbeb3=function(_0x421263,_0x18187d){_0x421263=_0x421263-0x0;var _0x34e4b5=_0xeb3b[_0x421263];return _0x34e4b5;};'use strict';var _=require(_0xbeb3('0x0'));var util=require(_0xbeb3('0x1'));var moment=require(_0xbeb3('0x2'));var BPromise=require(_0xbeb3('0x3'));var rs=require(_0xbeb3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbeb3('0x5'));var logger=require('../../config/logger')(_0xbeb3('0x6'));var config=require('../../config/environment');var jayson=require(_0xbeb3('0x7'));var client=jayson[_0xbeb3('0x8')][_0xbeb3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x294cc9,_0x406927,_0x143255){return new BPromise(function(_0x5a6a06,_0x241dbb){return client[_0xbeb3('0xa')](_0x294cc9,_0x143255)[_0xbeb3('0xb')](function(_0x3b61ac){logger[_0xbeb3('0xc')](_0xbeb3('0xd'),_0x406927,_0xbeb3('0xe'));logger['debug'](_0xbeb3('0xf'),_0x406927,_0xbeb3('0xe'),JSON['stringify'](_0x3b61ac));if(_0x3b61ac[_0xbeb3('0x10')]){if(_0x3b61ac[_0xbeb3('0x10')][_0xbeb3('0x11')]===0x1f4){logger[_0xbeb3('0x10')](_0xbeb3('0xd'),_0x406927,_0x3b61ac[_0xbeb3('0x10')]['message']);return _0x241dbb(_0x3b61ac['error'][_0xbeb3('0x12')]);}logger[_0xbeb3('0x10')]('VoiceRecording,\x20%s,\x20%s',_0x406927,_0x3b61ac['error'][_0xbeb3('0x12')]);return _0x5a6a06(_0x3b61ac[_0xbeb3('0x10')][_0xbeb3('0x12')]);}else{logger[_0xbeb3('0xc')](_0xbeb3('0xd'),_0x406927,'request\x20sent');_0x5a6a06(_0x3b61ac[_0xbeb3('0x13')]['message']);}})[_0xbeb3('0x14')](function(_0x4e7d99){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x406927,_0x4e7d99);_0x241dbb(_0x4e7d99);});});}exports[_0xbeb3('0x15')]=function(_0x44a4bb){var _0x32275b=this;return new Promise(function(_0x10b15d,_0x5d0689){return db[_0xbeb3('0x16')][_0xbeb3('0x17')](_0x44a4bb[_0xbeb3('0x18')],{'raw':_0x44a4bb['options']?_0x44a4bb['options'][_0xbeb3('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44a4bb['options']?_0x44a4bb[_0xbeb3('0x1a')]['where']||null:null,'attributes':_0x44a4bb['options']?_0x44a4bb[_0xbeb3('0x1a')][_0xbeb3('0x1b')]||null:null,'limit':_0x44a4bb[_0xbeb3('0x1a')]?_0x44a4bb['options'][_0xbeb3('0x1c')]||null:null})[_0xbeb3('0xb')](function(_0x5e047e){logger[_0xbeb3('0xc')](_0xbeb3('0x15'),_0x44a4bb);logger['debug'](_0xbeb3('0x15'),_0x44a4bb,JSON[_0xbeb3('0x1d')](_0x5e047e));_0x10b15d(_0x5e047e);})[_0xbeb3('0x14')](function(_0x42c6c3){logger[_0xbeb3('0x10')](_0xbeb3('0x15'),_0x42c6c3[_0xbeb3('0x12')],_0x44a4bb);_0x5d0689(_0x32275b[_0xbeb3('0x10')](0x1f4,_0x42c6c3[_0xbeb3('0x12')]));});});};exports['CreateVoiceRecording']=function(_0x4e695e){var _0x1f36b9=this;return new Promise(function(_0x520116,_0x3e7f7d){var _0xda808c=require(_0xbeb3('0x1e'));var _0x400f65;return db['Setting'][_0xbeb3('0x1f')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0xbeb3('0xb')](function(_0xab301c){_0x400f65=_0xab301c;return db['VoiceRecording']['create'](_0x4e695e[_0xbeb3('0x18')]);})['then'](function(_0x51f7ef){if(_0x400f65['callRecordingEncryption']&&fs['existsSync'](_0x51f7ef[_0xbeb3('0x20')])){var _0x4e9a04=util[_0xbeb3('0x21')](_0xbeb3('0x22'),_0x51f7ef[_0xbeb3('0x20')]);return _0xda808c[_0xbeb3('0x23')](_0x51f7ef[_0xbeb3('0x20')],_0x4e9a04,config[_0xbeb3('0x24')][_0xbeb3('0x25')])[_0xbeb3('0xb')](function(){fs[_0xbeb3('0x26')](_0x51f7ef[_0xbeb3('0x20')]);logger['info'](_0xbeb3('0x27'));return _0x51f7ef;});}return _0x51f7ef;})[_0xbeb3('0xb')](function(_0x5821dd){logger[_0xbeb3('0xc')](_0xbeb3('0x28'),_0x4e695e);logger[_0xbeb3('0x29')](_0xbeb3('0x28'),_0x4e695e,JSON['stringify'](_0x5821dd));_0x520116(_0x5821dd);})[_0xbeb3('0x14')](function(_0x18f2be){logger[_0xbeb3('0x10')](_0xbeb3('0x28'),_0x18f2be[_0xbeb3('0x12')],_0x4e695e);_0x3e7f7d(_0x1f36b9[_0xbeb3('0x10')](0x1f4,_0x18f2be[_0xbeb3('0x12')]));});});}; \ No newline at end of file +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(_0x578afc,_0x152817){var _0x5e46a2=function(_0x12947f){while(--_0x12947f){_0x578afc['push'](_0x578afc['shift']());}};_0x5e46a2(++_0x152817);}(_0x66fa,0x117));var _0xa66f=function(_0x46d11a,_0x29a6d9){_0x46d11a=_0x46d11a-0x0;var _0x5a08c7=_0x66fa[_0x46d11a];return _0x5a08c7;};'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 diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 4534378..168cdef 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 _0x817a=['get','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller'];(function(_0x5b5960,_0x2bab09){var _0x16b671=function(_0x430f0b){while(--_0x430f0b){_0x5b5960['push'](_0x5b5960['shift']());}};_0x16b671(++_0x2bab09);}(_0x817a,0x1aa));var _0xa817=function(_0x2c0621,_0x453189){_0x2c0621=_0x2c0621-0x0;var _0x544a02=_0x817a[_0x2c0621];return _0x544a02;};'use strict';var multer=require(_0xa817('0x0'));var util=require(_0xa817('0x1'));var path=require(_0xa817('0x2'));var timeout=require(_0xa817('0x3'));var express=require(_0xa817('0x4'));var router=express[_0xa817('0x5')]();var fs_extra=require(_0xa817('0x6'));var auth=require(_0xa817('0x7'));var interaction=require(_0xa817('0x8'));var config=require(_0xa817('0x9'));var controller=require(_0xa817('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xa817('0xb')](_0xa817('0xc'),auth[_0xa817('0xd')](),controller[_0xa817('0xe')]);router[_0xa817('0xb')]('/:id',auth[_0xa817('0xd')](),controller[_0xa817('0xf')]);router[_0xa817('0x10')]('/',auth[_0xa817('0xd')](),controller[_0xa817('0x11')]);router[_0xa817('0x12')](_0xa817('0x13'),auth['isAuthenticated'](),controller[_0xa817('0x14')]);router['delete'](_0xa817('0x13'),auth[_0xa817('0xd')](),controller[_0xa817('0x15')]);module[_0xa817('0x16')]=router; \ No newline at end of file +var _0x6a9e=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','index','describe','isAuthenticated','show','post','create','put','/:id','update','delete'];(function(_0x5e2e39,_0x5f43c1){var _0x8b3070=function(_0x233cae){while(--_0x233cae){_0x5e2e39['push'](_0x5e2e39['shift']());}};_0x8b3070(++_0x5f43c1);}(_0x6a9e,0x6a));var _0xe6a9=function(_0x2181d2,_0x33ff0e){_0x2181d2=_0x2181d2-0x0;var _0x52e2bb=_0x6a9e[_0x2181d2];return _0x52e2bb;};'use strict';var multer=require('multer');var util=require(_0xe6a9('0x0'));var path=require(_0xe6a9('0x1'));var timeout=require(_0xe6a9('0x2'));var express=require(_0xe6a9('0x3'));var router=express[_0xe6a9('0x4')]();var fs_extra=require(_0xe6a9('0x5'));var auth=require(_0xe6a9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe6a9('0x7'));var controller=require(_0xe6a9('0x8'));router[_0xe6a9('0x9')]('/',auth['isAuthenticated'](),controller[_0xe6a9('0xa')]);router[_0xe6a9('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xe6a9('0xb')]);router['get']('/:id',auth[_0xe6a9('0xc')](),controller[_0xe6a9('0xd')]);router[_0xe6a9('0xe')]('/',auth['isAuthenticated'](),controller[_0xe6a9('0xf')]);router[_0xe6a9('0x10')](_0xe6a9('0x11'),auth['isAuthenticated'](),controller[_0xe6a9('0x12')]);router[_0xe6a9('0x13')](_0xe6a9('0x11'),auth[_0xe6a9('0xc')](),controller['destroy']);module[_0xe6a9('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index ffbafe0..04e0668 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 _0x33fb=['blind','STRING','Yes','sequelize','moment','exports','ENUM'];(function(_0x226829,_0x38daf2){var _0x32dca7=function(_0x14caa9){while(--_0x14caa9){_0x226829['push'](_0x226829['shift']());}};_0x32dca7(++_0x38daf2);}(_0x33fb,0xc7));var _0xb33f=function(_0x273270,_0x220787){_0x273270=_0x273270-0x0;var _0x209651=_0x33fb[_0x273270];return _0x209651;};'use strict';var Sequelize=require(_0xb33f('0x0'));var moment=require(_0xb33f('0x1'));module[_0xb33f('0x2')]={'type':{'type':Sequelize[_0xb33f('0x3')](_0xb33f('0x4'),'attended')},'result':{'type':Sequelize[_0xb33f('0x5')]},'transfererchannel':{'type':Sequelize[_0xb33f('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0xb33f('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0xb33f('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xb33f('0x5')]},'transferercontext':{'type':Sequelize[_0xb33f('0x5')]},'transfererexten':{'type':Sequelize[_0xb33f('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xb33f('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0xb33f('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xb33f('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xb33f('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0xb33f('0x5')]},'transfereecontext':{'type':Sequelize[_0xb33f('0x5')]},'transfereeexten':{'type':Sequelize[_0xb33f('0x5')]},'transfereelinkedid':{'type':Sequelize[_0xb33f('0x5')]},'isexternal':{'type':Sequelize[_0xb33f('0x3')](_0xb33f('0x6'),'No')},'context':{'type':Sequelize[_0xb33f('0x5')]},'extension':{'type':Sequelize[_0xb33f('0x5')]}}; \ No newline at end of file +var _0xa381=['ENUM','blind','attended','STRING','sequelize','moment','exports'];(function(_0x53e3bf,_0x547106){var _0x59b198=function(_0x329bb4){while(--_0x329bb4){_0x53e3bf['push'](_0x53e3bf['shift']());}};_0x59b198(++_0x547106);}(_0xa381,0xdd));var _0x1a38=function(_0x54e1e3,_0x362b34){_0x54e1e3=_0x54e1e3-0x0;var _0x491335=_0xa381[_0x54e1e3];return _0x491335;};'use strict';var Sequelize=require(_0x1a38('0x0'));var moment=require(_0x1a38('0x1'));module[_0x1a38('0x2')]={'type':{'type':Sequelize[_0x1a38('0x3')](_0x1a38('0x4'),_0x1a38('0x5'))},'result':{'type':Sequelize[_0x1a38('0x6')]},'transfererchannel':{'type':Sequelize[_0x1a38('0x6')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x1a38('0x6')]},'transfererconnectedlinenum':{'type':Sequelize[_0x1a38('0x6')]},'transfererconnectedlinename':{'type':Sequelize[_0x1a38('0x6')]},'transfereraccountcode':{'type':Sequelize[_0x1a38('0x6')]},'transferercontext':{'type':Sequelize[_0x1a38('0x6')]},'transfererexten':{'type':Sequelize[_0x1a38('0x6')]},'transfererlinkedid':{'type':Sequelize[_0x1a38('0x6')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x1a38('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x1a38('0x6')]},'transfereeaccountcode':{'type':Sequelize[_0x1a38('0x6')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x1a38('0x6')]},'transfereelinkedid':{'type':Sequelize[_0x1a38('0x6')]},'isexternal':{'type':Sequelize[_0x1a38('0x3')]('Yes','No')},'context':{'type':Sequelize[_0x1a38('0x6')]},'extension':{'type':Sequelize[_0x1a38('0x6')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index b4af5e6..61fe3d2 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 _0xd8e4=['bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','destroy','then','error','name','send','index','type','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','options','include','VoiceTransferReport','findAll','rows','catch','params','rawAttributes','includeAll','merge','find','create','body','update','describe','rimraf','fast-json-patch','request-promise','moment'];(function(_0x1c84d2,_0x10b9a9){var _0x50d239=function(_0xcb64da){while(--_0xcb64da){_0x1c84d2['push'](_0x1c84d2['shift']());}};_0x50d239(++_0x10b9a9);}(_0xd8e4,0xda));var _0x4d8e=function(_0x37ad9f,_0xc6429a){_0x37ad9f=_0x37ad9f-0x0;var _0x47344d=_0xd8e4[_0x37ad9f];return _0x47344d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4d8e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4d8e('0x1'));var rp=require(_0x4d8e('0x2'));var moment=require(_0x4d8e('0x3'));var BPromise=require(_0x4d8e('0x4'));var Mustache=require(_0x4d8e('0x5'));var util=require(_0x4d8e('0x6'));var path=require('path');var sox=require(_0x4d8e('0x7'));var csv=require(_0x4d8e('0x8'));var ejs=require(_0x4d8e('0x9'));var fs=require('fs');var fs_extra=require(_0x4d8e('0xa'));var _=require(_0x4d8e('0xb'));var squel=require(_0x4d8e('0xc'));var crypto=require('crypto');var jsforce=require(_0x4d8e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4d8e('0x8'));var querystring=require(_0x4d8e('0xe'));var Papa=require(_0x4d8e('0xf'));var Redis=require(_0x4d8e('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4d8e('0x11'));var logger=require(_0x4d8e('0x12'))(_0x4d8e('0x13'));var utils=require(_0x4d8e('0x14'));var config=require(_0x4d8e('0x15'));var licenseUtil=require(_0x4d8e('0x16'));var db=require(_0x4d8e('0x17'))['db'];function respondWithStatusCode(_0x3246ab,_0x395c09){_0x395c09=_0x395c09||0xcc;return function(_0x576a86){if(_0x576a86){return _0x3246ab[_0x4d8e('0x18')](_0x395c09);}return _0x3246ab['status'](_0x395c09)[_0x4d8e('0x19')]();};}function respondWithResult(_0x234480,_0x27628c){_0x27628c=_0x27628c||0xc8;return function(_0x53dbb7){if(_0x53dbb7){return _0x234480[_0x4d8e('0x1a')](_0x27628c)[_0x4d8e('0x1b')](_0x53dbb7);}};}function respondWithFilteredResult(_0xaf68ba,_0x6f040e){return function(_0x3256a6){if(_0x3256a6){var _0x398d34=typeof _0x6f040e[_0x4d8e('0x1c')]==='undefined'&&typeof _0x6f040e[_0x4d8e('0x1d')]===_0x4d8e('0x1e');var _0x2b0543=_0x3256a6[_0x4d8e('0x1f')];var _0x73f8b1=_0x398d34?0x0:_0x6f040e[_0x4d8e('0x1c')];var _0x1cc8e9=_0x398d34?_0x3256a6['count']:_0x6f040e[_0x4d8e('0x1c')]+_0x6f040e[_0x4d8e('0x1d')];var _0x274fa9;if(_0x1cc8e9>=_0x2b0543){_0x1cc8e9=_0x2b0543;_0x274fa9=0xc8;}else{_0x274fa9=0xce;}_0xaf68ba[_0x4d8e('0x1a')](_0x274fa9);return _0xaf68ba[_0x4d8e('0x20')](_0x4d8e('0x21'),_0x73f8b1+'-'+_0x1cc8e9+'/'+_0x2b0543)['json'](_0x3256a6);}return null;};}function patchUpdates(_0x1a1ea0){return function(_0x2fea17){try{jsonpatch[_0x4d8e('0x22')](_0x2fea17,_0x1a1ea0,!![]);}catch(_0x243445){return BPromise[_0x4d8e('0x23')](_0x243445);}return _0x2fea17[_0x4d8e('0x24')]();};}function saveUpdates(_0x8020bc,_0x100893){return function(_0x2036e0){if(_0x2036e0){return _0x2036e0['update'](_0x8020bc)['then'](function(_0x464ba0){return _0x464ba0;});}return null;};}function removeEntity(_0x278d8f,_0x21c7b9){return function(_0x8fdb50){if(_0x8fdb50){return _0x8fdb50[_0x4d8e('0x25')]()[_0x4d8e('0x26')](function(){_0x278d8f['status'](0xcc)[_0x4d8e('0x19')]();});}};}function handleEntityNotFound(_0x467146,_0x3dd177){return function(_0x2cdcc5){if(!_0x2cdcc5){_0x467146['sendStatus'](0x194);}return _0x2cdcc5;};}function handleError(_0x1f6dfc,_0x19dfab){_0x19dfab=_0x19dfab||0x1f4;return function(_0x191901){logger[_0x4d8e('0x27')](_0x191901['stack']);if(_0x191901['name']){delete _0x191901[_0x4d8e('0x28')];}_0x1f6dfc['status'](_0x19dfab)[_0x4d8e('0x29')](_0x191901);};}exports[_0x4d8e('0x2a')]=function(_0x30f2eb,_0x10f621){var _0x25f6cf={},_0xef8e74={},_0x405080={'count':0x0,'rows':[]};var _0x5a0748=_['map'](db['VoiceTransferReport']['rawAttributes'],function(_0x482ca0){return{'name':_0x482ca0['fieldName'],'type':_0x482ca0[_0x4d8e('0x2b')]['key']};});_0xef8e74[_0x4d8e('0x2c')]=_[_0x4d8e('0x2d')](_0x5a0748,_0x4d8e('0x28'));_0xef8e74[_0x4d8e('0x2e')]=_[_0x4d8e('0x2f')](_0x30f2eb[_0x4d8e('0x2e')]);_0xef8e74['filters']=_[_0x4d8e('0x30')](_0xef8e74['model'],_0xef8e74[_0x4d8e('0x2e')]);_0x25f6cf[_0x4d8e('0x31')]=_['intersection'](_0xef8e74[_0x4d8e('0x2c')],qs[_0x4d8e('0x32')](_0x30f2eb[_0x4d8e('0x2e')][_0x4d8e('0x32')]));_0x25f6cf[_0x4d8e('0x31')]=_0x25f6cf['attributes']['length']?_0x25f6cf['attributes']:_0xef8e74[_0x4d8e('0x2c')];if(!_0x30f2eb['query'][_0x4d8e('0x33')](_0x4d8e('0x34'))){_0x25f6cf[_0x4d8e('0x1d')]=qs[_0x4d8e('0x1d')](_0x30f2eb[_0x4d8e('0x2e')][_0x4d8e('0x1d')]);_0x25f6cf[_0x4d8e('0x1c')]=qs['offset'](_0x30f2eb[_0x4d8e('0x2e')]['offset']);}_0x25f6cf[_0x4d8e('0x35')]=qs['sort'](_0x30f2eb[_0x4d8e('0x2e')][_0x4d8e('0x36')]);_0x25f6cf[_0x4d8e('0x37')]=qs[_0x4d8e('0x38')](_[_0x4d8e('0x39')](_0x30f2eb[_0x4d8e('0x2e')],_0xef8e74['filters']),_0x5a0748);if(_0x30f2eb[_0x4d8e('0x2e')][_0x4d8e('0x3a')]){_0x25f6cf[_0x4d8e('0x37')]=_['merge'](_0x25f6cf['where'],{'$or':_[_0x4d8e('0x2d')](_0x5a0748,function(_0x3401cb){if(_0x3401cb[_0x4d8e('0x2b')]!=='VIRTUAL'){var _0x5d3f44={};_0x5d3f44[_0x3401cb['name']]={'$like':'%'+_0x30f2eb[_0x4d8e('0x2e')][_0x4d8e('0x3a')]+'%'};return _0x5d3f44;}})});}_0x25f6cf=_['merge']({},_0x25f6cf,_0x30f2eb[_0x4d8e('0x3b')]);var _0x2287d4={'where':_0x25f6cf[_0x4d8e('0x37')]};return db['VoiceTransferReport'][_0x4d8e('0x1f')](_0x2287d4)[_0x4d8e('0x26')](function(_0x316348){_0x405080[_0x4d8e('0x1f')]=_0x316348;if(_0x30f2eb[_0x4d8e('0x2e')]['includeAll']){_0x25f6cf[_0x4d8e('0x3c')]=[{'all':!![]}];}return db[_0x4d8e('0x3d')][_0x4d8e('0x3e')](_0x25f6cf);})[_0x4d8e('0x26')](function(_0x23ad8f){_0x405080[_0x4d8e('0x3f')]=_0x23ad8f;return _0x405080;})[_0x4d8e('0x26')](respondWithFilteredResult(_0x10f621,_0x25f6cf))[_0x4d8e('0x40')](handleError(_0x10f621,null));};exports['show']=function(_0x24df36,_0x3af410){var _0x5bf50={'raw':!![],'where':{'id':_0x24df36[_0x4d8e('0x41')]['id']}},_0x3d6bc6={};_0x3d6bc6[_0x4d8e('0x2c')]=_[_0x4d8e('0x2f')](db[_0x4d8e('0x3d')][_0x4d8e('0x42')]);_0x3d6bc6[_0x4d8e('0x2e')]=_['keys'](_0x24df36[_0x4d8e('0x2e')]);_0x3d6bc6[_0x4d8e('0x38')]=_[_0x4d8e('0x30')](_0x3d6bc6['model'],_0x3d6bc6['query']);_0x5bf50[_0x4d8e('0x31')]=_[_0x4d8e('0x30')](_0x3d6bc6[_0x4d8e('0x2c')],qs[_0x4d8e('0x32')](_0x24df36[_0x4d8e('0x2e')][_0x4d8e('0x32')]));_0x5bf50['attributes']=_0x5bf50[_0x4d8e('0x31')]['length']?_0x5bf50[_0x4d8e('0x31')]:_0x3d6bc6[_0x4d8e('0x2c')];if(_0x24df36[_0x4d8e('0x2e')][_0x4d8e('0x43')]){_0x5bf50[_0x4d8e('0x3c')]=[{'all':!![]}];}_0x5bf50=_[_0x4d8e('0x44')]({},_0x5bf50,_0x24df36[_0x4d8e('0x3b')]);return db[_0x4d8e('0x3d')][_0x4d8e('0x45')](_0x5bf50)['then'](handleEntityNotFound(_0x3af410,null))['then'](respondWithResult(_0x3af410,null))[_0x4d8e('0x40')](handleError(_0x3af410,null));};exports['create']=function(_0x54993f,_0x56c9b1){return db[_0x4d8e('0x3d')][_0x4d8e('0x46')](_0x54993f[_0x4d8e('0x47')],{})[_0x4d8e('0x26')](respondWithResult(_0x56c9b1,0xc9))['catch'](handleError(_0x56c9b1,null));};exports[_0x4d8e('0x48')]=function(_0x6aff43,_0x39c3e0){if(_0x6aff43['body']['id']){delete _0x6aff43['body']['id'];}return db['VoiceTransferReport']['find']({'where':{'id':_0x6aff43[_0x4d8e('0x41')]['id']}})[_0x4d8e('0x26')](handleEntityNotFound(_0x39c3e0,null))['then'](saveUpdates(_0x6aff43[_0x4d8e('0x47')],null))[_0x4d8e('0x26')](respondWithResult(_0x39c3e0,null))[_0x4d8e('0x40')](handleError(_0x39c3e0,null));};exports['destroy']=function(_0x53c946,_0x22aa43){return db[_0x4d8e('0x3d')]['find']({'where':{'id':_0x53c946[_0x4d8e('0x41')]['id']}})[_0x4d8e('0x26')](handleEntityNotFound(_0x22aa43,null))[_0x4d8e('0x26')](removeEntity(_0x22aa43,null))[_0x4d8e('0x40')](handleError(_0x22aa43,null));};exports[_0x4d8e('0x49')]=function(_0x238a64,_0xab8d77){return db[_0x4d8e('0x3d')][_0x4d8e('0x49')]()['then'](respondWithResult(_0xab8d77,null))[_0x4d8e('0x40')](handleError(_0xab8d77,null));}; \ No newline at end of file +var _0x5b45=['include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','sendStatus','stack','send','index','VoiceTransferReport','fieldName','type','key','map','name','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','options','includeAll'];(function(_0x586ca2,_0x114748){var _0x326509=function(_0x4a5331){while(--_0x4a5331){_0x586ca2['push'](_0x586ca2['shift']());}};_0x326509(++_0x114748);}(_0x5b45,0x17d));var _0x55b4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x5b45[_0x8c43de];return _0xa6591b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x55b4('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x55b4('0x1'));var BPromise=require(_0x55b4('0x2'));var Mustache=require(_0x55b4('0x3'));var util=require(_0x55b4('0x4'));var path=require(_0x55b4('0x5'));var sox=require('sox');var csv=require(_0x55b4('0x6'));var ejs=require(_0x55b4('0x7'));var fs=require('fs');var fs_extra=require(_0x55b4('0x8'));var _=require(_0x55b4('0x9'));var squel=require(_0x55b4('0xa'));var crypto=require(_0x55b4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x55b4('0xc'));var toCsv=require('to-csv');var querystring=require(_0x55b4('0xd'));var Papa=require(_0x55b4('0xe'));var Redis=require(_0x55b4('0xf'));var authService=require(_0x55b4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x55b4('0x11'));var hardwareService=require(_0x55b4('0x12'));var logger=require(_0x55b4('0x13'))(_0x55b4('0x14'));var utils=require(_0x55b4('0x15'));var config=require(_0x55b4('0x16'));var licenseUtil=require(_0x55b4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34e038,_0xdd586){_0xdd586=_0xdd586||0xcc;return function(_0x55ac3a){if(_0x55ac3a){return _0x34e038['sendStatus'](_0xdd586);}return _0x34e038[_0x55b4('0x18')](_0xdd586)['end']();};}function respondWithResult(_0x5ed855,_0x35c2d6){_0x35c2d6=_0x35c2d6||0xc8;return function(_0x48bfce){if(_0x48bfce){return _0x5ed855['status'](_0x35c2d6)[_0x55b4('0x19')](_0x48bfce);}};}function respondWithFilteredResult(_0x3d6da4,_0x513a35){return function(_0x42a9e1){if(_0x42a9e1){var _0x422518=typeof _0x513a35[_0x55b4('0x1a')]===_0x55b4('0x1b')&&typeof _0x513a35[_0x55b4('0x1c')]==='undefined';var _0x2d2a65=_0x42a9e1[_0x55b4('0x1d')];var _0x890ccb=_0x422518?0x0:_0x513a35[_0x55b4('0x1a')];var _0xbad9fd=_0x422518?_0x42a9e1['count']:_0x513a35[_0x55b4('0x1a')]+_0x513a35[_0x55b4('0x1c')];var _0x34af34;if(_0xbad9fd>=_0x2d2a65){_0xbad9fd=_0x2d2a65;_0x34af34=0xc8;}else{_0x34af34=0xce;}_0x3d6da4['status'](_0x34af34);return _0x3d6da4[_0x55b4('0x1e')]('Content-Range',_0x890ccb+'-'+_0xbad9fd+'/'+_0x2d2a65)[_0x55b4('0x19')](_0x42a9e1);}return null;};}function patchUpdates(_0x1ae50d){return function(_0x34f3a6){try{jsonpatch['apply'](_0x34f3a6,_0x1ae50d,!![]);}catch(_0x116bc2){return BPromise[_0x55b4('0x1f')](_0x116bc2);}return _0x34f3a6[_0x55b4('0x20')]();};}function saveUpdates(_0xf01ae6,_0x4f58bf){return function(_0x151601){if(_0x151601){return _0x151601[_0x55b4('0x21')](_0xf01ae6)[_0x55b4('0x22')](function(_0x350a11){return _0x350a11;});}return null;};}function removeEntity(_0x1e2b06,_0x59fc77){return function(_0x32d1fc){if(_0x32d1fc){return _0x32d1fc[_0x55b4('0x23')]()[_0x55b4('0x22')](function(){_0x1e2b06[_0x55b4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x353d98,_0x1ddc13){return function(_0x63892b){if(!_0x63892b){_0x353d98[_0x55b4('0x24')](0x194);}return _0x63892b;};}function handleError(_0xcd3106,_0x42f45a){_0x42f45a=_0x42f45a||0x1f4;return function(_0x28a29e){logger['error'](_0x28a29e[_0x55b4('0x25')]);if(_0x28a29e['name']){delete _0x28a29e['name'];}_0xcd3106['status'](_0x42f45a)[_0x55b4('0x26')](_0x28a29e);};}exports[_0x55b4('0x27')]=function(_0xf19be1,_0x211579){var _0x4cff32={},_0x3fd84a={},_0x5233f7={'count':0x0,'rows':[]};var _0x565095=_['map'](db[_0x55b4('0x28')]['rawAttributes'],function(_0x29f72f){return{'name':_0x29f72f[_0x55b4('0x29')],'type':_0x29f72f[_0x55b4('0x2a')][_0x55b4('0x2b')]};});_0x3fd84a['model']=_[_0x55b4('0x2c')](_0x565095,_0x55b4('0x2d'));_0x3fd84a[_0x55b4('0x2e')]=_[_0x55b4('0x2f')](_0xf19be1[_0x55b4('0x2e')]);_0x3fd84a['filters']=_[_0x55b4('0x30')](_0x3fd84a[_0x55b4('0x31')],_0x3fd84a['query']);_0x4cff32[_0x55b4('0x32')]=_[_0x55b4('0x30')](_0x3fd84a['model'],qs[_0x55b4('0x33')](_0xf19be1[_0x55b4('0x2e')][_0x55b4('0x33')]));_0x4cff32[_0x55b4('0x32')]=_0x4cff32['attributes'][_0x55b4('0x34')]?_0x4cff32['attributes']:_0x3fd84a[_0x55b4('0x31')];if(!_0xf19be1[_0x55b4('0x2e')][_0x55b4('0x35')](_0x55b4('0x36'))){_0x4cff32[_0x55b4('0x1c')]=qs[_0x55b4('0x1c')](_0xf19be1['query']['limit']);_0x4cff32[_0x55b4('0x1a')]=qs[_0x55b4('0x1a')](_0xf19be1[_0x55b4('0x2e')]['offset']);}_0x4cff32['order']=qs[_0x55b4('0x37')](_0xf19be1['query']['sort']);_0x4cff32[_0x55b4('0x38')]=qs['filters'](_[_0x55b4('0x39')](_0xf19be1[_0x55b4('0x2e')],_0x3fd84a[_0x55b4('0x3a')]),_0x565095);if(_0xf19be1['query'][_0x55b4('0x3b')]){_0x4cff32[_0x55b4('0x38')]=_['merge'](_0x4cff32['where'],{'$or':_['map'](_0x565095,function(_0x43130c){if(_0x43130c[_0x55b4('0x2a')]!=='VIRTUAL'){var _0x330748={};_0x330748[_0x43130c[_0x55b4('0x2d')]]={'$like':'%'+_0xf19be1[_0x55b4('0x2e')][_0x55b4('0x3b')]+'%'};return _0x330748;}})});}_0x4cff32=_[_0x55b4('0x3c')]({},_0x4cff32,_0xf19be1[_0x55b4('0x3d')]);var _0x1c4a88={'where':_0x4cff32[_0x55b4('0x38')]};return db['VoiceTransferReport'][_0x55b4('0x1d')](_0x1c4a88)[_0x55b4('0x22')](function(_0x14e009){_0x5233f7[_0x55b4('0x1d')]=_0x14e009;if(_0xf19be1[_0x55b4('0x2e')][_0x55b4('0x3e')]){_0x4cff32[_0x55b4('0x3f')]=[{'all':!![]}];}return db[_0x55b4('0x28')][_0x55b4('0x40')](_0x4cff32);})['then'](function(_0x574eaa){_0x5233f7[_0x55b4('0x41')]=_0x574eaa;return _0x5233f7;})[_0x55b4('0x22')](respondWithFilteredResult(_0x211579,_0x4cff32))[_0x55b4('0x42')](handleError(_0x211579,null));};exports[_0x55b4('0x43')]=function(_0x3d73ec,_0xf77cea){var _0xb69989={'raw':!![],'where':{'id':_0x3d73ec[_0x55b4('0x44')]['id']}},_0x3e946f={};_0x3e946f[_0x55b4('0x31')]=_[_0x55b4('0x2f')](db['VoiceTransferReport'][_0x55b4('0x45')]);_0x3e946f[_0x55b4('0x2e')]=_[_0x55b4('0x2f')](_0x3d73ec['query']);_0x3e946f[_0x55b4('0x3a')]=_[_0x55b4('0x30')](_0x3e946f[_0x55b4('0x31')],_0x3e946f['query']);_0xb69989['attributes']=_[_0x55b4('0x30')](_0x3e946f[_0x55b4('0x31')],qs[_0x55b4('0x33')](_0x3d73ec[_0x55b4('0x2e')][_0x55b4('0x33')]));_0xb69989['attributes']=_0xb69989[_0x55b4('0x32')][_0x55b4('0x34')]?_0xb69989['attributes']:_0x3e946f[_0x55b4('0x31')];if(_0x3d73ec[_0x55b4('0x2e')][_0x55b4('0x3e')]){_0xb69989[_0x55b4('0x3f')]=[{'all':!![]}];}_0xb69989=_[_0x55b4('0x3c')]({},_0xb69989,_0x3d73ec[_0x55b4('0x3d')]);return db[_0x55b4('0x28')]['find'](_0xb69989)[_0x55b4('0x22')](handleEntityNotFound(_0xf77cea,null))[_0x55b4('0x22')](respondWithResult(_0xf77cea,null))[_0x55b4('0x42')](handleError(_0xf77cea,null));};exports[_0x55b4('0x46')]=function(_0x1b87d7,_0x16e2a9){return db[_0x55b4('0x28')][_0x55b4('0x46')](_0x1b87d7[_0x55b4('0x47')],{})['then'](respondWithResult(_0x16e2a9,0xc9))[_0x55b4('0x42')](handleError(_0x16e2a9,null));};exports['update']=function(_0x1ecc02,_0x30b7a5){if(_0x1ecc02[_0x55b4('0x47')]['id']){delete _0x1ecc02['body']['id'];}return db[_0x55b4('0x28')][_0x55b4('0x48')]({'where':{'id':_0x1ecc02[_0x55b4('0x44')]['id']}})[_0x55b4('0x22')](handleEntityNotFound(_0x30b7a5,null))['then'](saveUpdates(_0x1ecc02[_0x55b4('0x47')],null))[_0x55b4('0x22')](respondWithResult(_0x30b7a5,null))[_0x55b4('0x42')](handleError(_0x30b7a5,null));};exports[_0x55b4('0x23')]=function(_0x4dbd04,_0x100f9f){return db['VoiceTransferReport'][_0x55b4('0x48')]({'where':{'id':_0x4dbd04['params']['id']}})[_0x55b4('0x22')](handleEntityNotFound(_0x100f9f,null))[_0x55b4('0x22')](removeEntity(_0x100f9f,null))['catch'](handleError(_0x100f9f,null));};exports[_0x55b4('0x49')]=function(_0x5dcd50,_0x2722fa){return db[_0x55b4('0x28')][_0x55b4('0x49')]()[_0x55b4('0x22')](respondWithResult(_0x2722fa,null))[_0x55b4('0x42')](handleError(_0x2722fa,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 1759772..d2d8fd2 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 _0xa422=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport'];(function(_0x1411dd,_0x264b3b){var _0x48d5a9=function(_0x2650a5){while(--_0x2650a5){_0x1411dd['push'](_0x1411dd['shift']());}};_0x48d5a9(++_0x264b3b);}(_0xa422,0xd1));var _0x2a42=function(_0x504b7c,_0x589ab2){_0x504b7c=_0x504b7c-0x0;var _0x4e286d=_0xa422[_0x504b7c];return _0x4e286d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x2a42('0x0'));var moment=require(_0x2a42('0x1'));var BPromise=require(_0x2a42('0x2'));var rp=require(_0x2a42('0x3'));var fs=require('fs');var path=require(_0x2a42('0x4'));var rimraf=require(_0x2a42('0x5'));var config=require(_0x2a42('0x6'));var attributes=require(_0x2a42('0x7'));module[_0x2a42('0x8')]=function(_0x1c4fa8,_0x4b6623){return _0x1c4fa8[_0x2a42('0x9')](_0x2a42('0xa'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb88=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','VoiceTransferReport','report_call_transfer','lodash'];(function(_0x46efd7,_0x43f84d){var _0x5637e4=function(_0x54e078){while(--_0x54e078){_0x46efd7['push'](_0x46efd7['shift']());}};_0x5637e4(++_0x43f84d);}(_0xeb88,0x1db));var _0x8eb8=function(_0x10f945,_0x3c92c4){_0x10f945=_0x10f945-0x0;var _0x3e2160=_0xeb88[_0x10f945];return _0x3e2160;};'use strict';var _=require(_0x8eb8('0x0'));var util=require(_0x8eb8('0x1'));var logger=require(_0x8eb8('0x2'))(_0x8eb8('0x3'));var moment=require(_0x8eb8('0x4'));var BPromise=require(_0x8eb8('0x5'));var rp=require(_0x8eb8('0x6'));var fs=require('fs');var path=require(_0x8eb8('0x7'));var rimraf=require(_0x8eb8('0x8'));var config=require(_0x8eb8('0x9'));var attributes=require(_0x8eb8('0xa'));module[_0x8eb8('0xb')]=function(_0x12c8ce,_0x2e71c3){return _0x12c8ce['define'](_0x8eb8('0xc'),attributes,{'tableName':_0x8eb8('0xd'),'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 4f531b8..9fba6f7 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 _0xef32=['catch','CreateVoiceTransferReport','VoiceTransferReport','create','options','raw','then','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','message','result'];(function(_0x26f118,_0x4e17d9){var _0x450dda=function(_0x3e2147){while(--_0x3e2147){_0x26f118['push'](_0x26f118['shift']());}};_0x450dda(++_0x4e17d9);}(_0xef32,0x159));var _0x2ef3=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0xef32[_0x4dcc2d];return _0x1bbd79;};'use strict';var _=require(_0x2ef3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2ef3('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2ef3('0x2'))['db'];var utils=require(_0x2ef3('0x3'));var logger=require(_0x2ef3('0x4'))(_0x2ef3('0x5'));var config=require(_0x2ef3('0x6'));var jayson=require(_0x2ef3('0x7'));var client=jayson['client'][_0x2ef3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b243b,_0xd3192d,_0x301a59){return new BPromise(function(_0x435ac1,_0x357e04){return client['request'](_0x2b243b,_0x301a59)['then'](function(_0x57de92){logger[_0x2ef3('0x9')]('VoiceTransferReport,\x20%s,\x20%s',_0xd3192d,_0x2ef3('0xa'));logger[_0x2ef3('0xb')](_0x2ef3('0xc'),_0xd3192d,_0x2ef3('0xa'),JSON[_0x2ef3('0xd')](_0x57de92));if(_0x57de92['error']){if(_0x57de92[_0x2ef3('0xe')][_0x2ef3('0xf')]===0x1f4){logger['error'](_0x2ef3('0x10'),_0xd3192d,_0x57de92[_0x2ef3('0xe')][_0x2ef3('0x11')]);return _0x357e04(_0x57de92['error'][_0x2ef3('0x11')]);}logger[_0x2ef3('0xe')](_0x2ef3('0x10'),_0xd3192d,_0x57de92[_0x2ef3('0xe')][_0x2ef3('0x11')]);return _0x435ac1(_0x57de92[_0x2ef3('0xe')]['message']);}else{logger[_0x2ef3('0x9')](_0x2ef3('0x10'),_0xd3192d,'request\x20sent');_0x435ac1(_0x57de92[_0x2ef3('0x12')]['message']);}})[_0x2ef3('0x13')](function(_0x4b572f){logger['error'](_0x2ef3('0x10'),_0xd3192d,_0x4b572f);_0x357e04(_0x4b572f);});});}exports[_0x2ef3('0x14')]=function(_0x24d96a){var _0x3549f5=this;return new Promise(function(_0x52187f,_0x230daa){return db[_0x2ef3('0x15')][_0x2ef3('0x16')](_0x24d96a['body'],{'raw':_0x24d96a[_0x2ef3('0x17')]?_0x24d96a[_0x2ef3('0x17')][_0x2ef3('0x18')]===undefined?!![]:![]:!![]})[_0x2ef3('0x19')](function(_0x112738){logger['info']('CreateVoiceTransferReport',_0x24d96a);logger[_0x2ef3('0xb')](_0x2ef3('0x14'),_0x24d96a,JSON['stringify'](_0x112738));_0x52187f(_0x112738);})['catch'](function(_0x521784){logger[_0x2ef3('0xe')](_0x2ef3('0x14'),_0x521784[_0x2ef3('0x11')],_0x24d96a);_0x230daa(_0x3549f5['error'](0x1f4,_0x521784[_0x2ef3('0x11')]));});});}; \ No newline at end of file +var _0x01af=['VoiceTransferReport,\x20%s,\x20%s','message','result','CreateVoiceTransferReport','VoiceTransferReport','create','options','raw','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x30988e,_0x556a9c){var _0x1c9942=function(_0x2b450e){while(--_0x2b450e){_0x30988e['push'](_0x30988e['shift']());}};_0x1c9942(++_0x556a9c);}(_0x01af,0x79));var _0xf01a=function(_0x4efd94,_0x5ae15e){_0x4efd94=_0x4efd94-0x0;var _0x4002dd=_0x01af[_0x4efd94];return _0x4002dd;};'use strict';var _=require('lodash');var util=require(_0xf01a('0x0'));var moment=require(_0xf01a('0x1'));var BPromise=require('bluebird');var rs=require(_0xf01a('0x2'));var fs=require('fs');var Redis=require(_0xf01a('0x3'));var db=require(_0xf01a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf01a('0x5'))(_0xf01a('0x6'));var config=require(_0xf01a('0x7'));var jayson=require(_0xf01a('0x8'));var client=jayson[_0xf01a('0x9')][_0xf01a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x523d42,_0x4481b0,_0x10e717){return new BPromise(function(_0x50e579,_0x4b81e9){return client[_0xf01a('0xb')](_0x523d42,_0x10e717)[_0xf01a('0xc')](function(_0xed1d45){logger[_0xf01a('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x4481b0,_0xf01a('0xe'));logger[_0xf01a('0xf')](_0xf01a('0x10'),_0x4481b0,'request\x20sent',JSON[_0xf01a('0x11')](_0xed1d45));if(_0xed1d45[_0xf01a('0x12')]){if(_0xed1d45[_0xf01a('0x12')]['code']===0x1f4){logger['error'](_0xf01a('0x13'),_0x4481b0,_0xed1d45[_0xf01a('0x12')][_0xf01a('0x14')]);return _0x4b81e9(_0xed1d45[_0xf01a('0x12')][_0xf01a('0x14')]);}logger[_0xf01a('0x12')](_0xf01a('0x13'),_0x4481b0,_0xed1d45[_0xf01a('0x12')][_0xf01a('0x14')]);return _0x50e579(_0xed1d45[_0xf01a('0x12')]['message']);}else{logger[_0xf01a('0xd')](_0xf01a('0x13'),_0x4481b0,'request\x20sent');_0x50e579(_0xed1d45[_0xf01a('0x15')][_0xf01a('0x14')]);}})['catch'](function(_0x7a3549){logger[_0xf01a('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x4481b0,_0x7a3549);_0x4b81e9(_0x7a3549);});});}exports[_0xf01a('0x16')]=function(_0x4497fb){var _0x3cc6ea=this;return new Promise(function(_0xade017,_0x7caa18){return db[_0xf01a('0x17')][_0xf01a('0x18')](_0x4497fb['body'],{'raw':_0x4497fb[_0xf01a('0x19')]?_0x4497fb[_0xf01a('0x19')][_0xf01a('0x1a')]===undefined?!![]:![]:!![]})[_0xf01a('0xc')](function(_0x5d319b){logger[_0xf01a('0xd')](_0xf01a('0x16'),_0x4497fb);logger[_0xf01a('0xf')](_0xf01a('0x16'),_0x4497fb,JSON[_0xf01a('0x11')](_0x5d319b));_0xade017(_0x5d319b);})[_0xf01a('0x1b')](function(_0x5762ae){logger[_0xf01a('0x12')](_0xf01a('0x16'),_0x5762ae[_0xf01a('0x14')],_0x4497fb);_0x7caa18(_0x3cc6ea[_0xf01a('0x12')](0x1f4,_0x5762ae[_0xf01a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 1c1294e..7ba656e 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 _0xb43b=['/transfer','transfer','express','Router','./webbar.controller','post','/originate','isWebrtcLicence','originate','/hangup','hangup','/answer','isAuthenticated','answer','/unhold','unhold'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xb43b,0x1b2));var _0xbb43=function(_0x59c376,_0x30b609){_0x59c376=_0x59c376-0x0;var _0x1fc48a=_0xb43b[_0x59c376];return _0x1fc48a;};'use strict';var express=require(_0xbb43('0x0'));var router=express[_0xbb43('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xbb43('0x2'));router[_0xbb43('0x3')](_0xbb43('0x4'),auth['isAuthenticated'](),auth[_0xbb43('0x5')](),controller[_0xbb43('0x6')]);router[_0xbb43('0x3')](_0xbb43('0x7'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbb43('0x8')]);router['post'](_0xbb43('0x9'),auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller[_0xbb43('0xb')]);router[_0xbb43('0x3')]('/hold',auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller['hold']);router[_0xbb43('0x3')](_0xbb43('0xc'),auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller[_0xbb43('0xd')]);router[_0xbb43('0x3')]('/calls',auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller['calls']);router['post'](_0xbb43('0xe'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbb43('0xf')]);module['exports']=router; \ No newline at end of file +var _0x9c44=['/answer','answer','/hold','/unhold','unhold','/transfer','transfer','exports','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','/hangup','hangup'];(function(_0x879e31,_0x139d02){var _0x3467e8=function(_0x544fc6){while(--_0x544fc6){_0x879e31['push'](_0x879e31['shift']());}};_0x3467e8(++_0x139d02);}(_0x9c44,0x178));var _0x49c4=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x9c44[_0x36c5b0];return _0xf19333;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x49c4('0x0'));var controller=require(_0x49c4('0x1'));router[_0x49c4('0x2')](_0x49c4('0x3'),auth[_0x49c4('0x4')](),auth[_0x49c4('0x5')](),controller['originate']);router['post'](_0x49c4('0x6'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0x7')]);router[_0x49c4('0x2')](_0x49c4('0x8'),auth[_0x49c4('0x4')](),auth['isWebrtcLicence'](),controller[_0x49c4('0x9')]);router[_0x49c4('0x2')](_0x49c4('0xa'),auth[_0x49c4('0x4')](),auth['isWebrtcLicence'](),controller['hold']);router[_0x49c4('0x2')](_0x49c4('0xb'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0xc')]);router['post']('/calls',auth[_0x49c4('0x4')](),auth[_0x49c4('0x5')](),controller['calls']);router[_0x49c4('0x2')](_0x49c4('0xd'),auth['isAuthenticated'](),auth[_0x49c4('0x5')](),controller[_0x49c4('0xe')]);module[_0x49c4('0xf')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 7fd1b05..ab731db 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 _0xc102=['callerId','callbackUrl','entityFound:','format','user:%s','originate\x20executed!','hangup\x20fired:','webbar:hangup','hangup\x20executed!','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls','calls\x20fired:','VoiceChannels','all','rows','conference','webbar:conference','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','validate','userId\x20is\x20required','string','callNumber\x20is\x20required','number','info','stringify','log','handleError:','error','stack','name','status','NotFound','request','code','message','catch','User','findOne','then','filter','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate','body','json','userId'];(function(_0x16dfcc,_0x4ef8d7){var _0x324ef5=function(_0x23f438){while(--_0x23f438){_0x16dfcc['push'](_0x16dfcc['shift']());}};_0x324ef5(++_0x4ef8d7);}(_0xc102,0xb8));var _0x2c10=function(_0x8e4de5,_0xb5ba1c){_0x8e4de5=_0x8e4de5-0x0;var _0x447ef9=_0xc102[_0x8e4de5];return _0x447ef9;};'use strict';var path=require(_0x2c10('0x0'));var fs=require('fs');var _=require(_0x2c10('0x1'));var db=require(_0x2c10('0x2'))['db'];var config=require(_0x2c10('0x3'));var util=require(_0x2c10('0x4'));var BPromise=require(_0x2c10('0x5'));var jayson=require(_0x2c10('0x6'));var amiClient=jayson[_0x2c10('0x7')][_0x2c10('0x8')]({'port':0x232a});var logger=require(_0x2c10('0x9'))(_0x2c10('0xa'));var Redis=require(_0x2c10('0xb'));config[_0x2c10('0xc')]=_[_0x2c10('0xd')](config[_0x2c10('0xc')],{'host':_0x2c10('0xe'),'port':0x18eb});var io=require(_0x2c10('0xf'))(new Redis(config[_0x2c10('0xc')]));var Schema=require(_0x2c10('0x10'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x2c10('0x11')]},'callNumber':{'type':_0x2c10('0x12'),'required':[!![],_0x2c10('0x13')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0x2c10('0x12')}});var hangupValidation=new Schema({'userId':{'type':_0x2c10('0x14'),'required':[!![],_0x2c10('0x11')]},'sessionId':{'type':_0x2c10('0x12'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x2c10('0x11')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x2c10('0x14'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x2c10('0x12'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x2c10('0x12'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0x2c10('0x14'),'required':[!![],_0x2c10('0x11')]},'sessionId':{'type':_0x2c10('0x12'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x2c10('0x14'),'required':[!![],_0x2c10('0x11')]},'sessionId':{'type':_0x2c10('0x12'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x2c10('0x14'),'required':[!![],_0x2c10('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0x2c10('0x14'),'required':[!![],_0x2c10('0x11')]}});function emit(_0x16c971,_0x21e155,_0x4a5ce5){logger[_0x2c10('0x15')](_0x16c971,_0x21e155,JSON[_0x2c10('0x16')](_0x4a5ce5));io['to'](_0x16c971)['emit'](_0x21e155,_0x4a5ce5);}function handleError(_0x47d90a){return function(_0x43adaa){console[_0x2c10('0x17')](_0x2c10('0x18'),_0x43adaa,_0x43adaa instanceof RangeError);logger[_0x2c10('0x19')](_0x43adaa[_0x2c10('0x1a')]);if(_0x43adaa instanceof RangeError){if(_0x43adaa[_0x2c10('0x1b')]){delete _0x43adaa[_0x2c10('0x1b')];}_0x47d90a[_0x2c10('0x1c')](0x194)['send'](_0x43adaa);}else{if(_0x43adaa[_0x2c10('0x1b')]){delete _0x43adaa['name'];}_0x47d90a[_0x2c10('0x1c')](0x1f4)['send'](_0x43adaa);}};}function checkError(){return function(_0x50e19e){if(!_0x50e19e){throw new RangeError(_0x2c10('0x1d'));}return _0x50e19e;};}function respondWithRpcPromise(_0x4885c1,_0x4bf024){return new BPromise(function(_0x3aad40,_0x145ed9){var _0x32c97a=amiClient;return _0x32c97a[_0x2c10('0x1e')](_0x4885c1,_0x4bf024)['then'](function(_0x2f9a5b){if(_0x2f9a5b[_0x2c10('0x19')]){if(_0x2f9a5b[_0x2c10('0x19')][_0x2c10('0x1f')]===0x1f4){return _0x145ed9(_0x2f9a5b[_0x2c10('0x19')][_0x2c10('0x20')]);}return _0x3aad40(_0x2f9a5b[_0x2c10('0x19')]['message']);}else{_0x3aad40(_0x2f9a5b['result']);}})[_0x2c10('0x21')](function(_0x5e7c2e){_0x145ed9(_0x5e7c2e);});});}function getAgent(_0x683f8f){return db[_0x2c10('0x22')][_0x2c10('0x23')]({'where':{'id':_0x683f8f,'role':'agent'}})[_0x2c10('0x24')](checkError());}function getAgentCheckSession(_0x488aab,_0x2dcf9e){return new BPromise(function(_0x3045db,_0x37d18c){var _0xc43e86=respondWithRpcPromise('VoiceChannels');var _0xff2f84=getAgent(_0x488aab);Promise['all']([_0xc43e86,_0xff2f84])['then'](function(_0xa50422){var _0x318a90=_0xa50422[0x0];var _0xfb43ca=_0xa50422[0x1];var _0x3ab77a=_[_0x2c10('0x25')](_0x318a90['rows'],function(_0x2c3538){return _0x2c3538[_0x2c10('0x26')]==_0xfb43ca['id']&&_0x2c3538[_0x2c10('0x27')]==_0x2dcf9e;});if(_0x3ab77a[_0x2c10('0x28')]==0x1){_0x3045db(_0xfb43ca);}else{_0x37d18c(new RangeError(_0x2c10('0x29')+_0x2dcf9e+_0x2c10('0x2a')));}});});}exports[_0x2c10('0x2b')]=function(_0x1bb6b1,_0x50fde){logger[_0x2c10('0x15')]('originate\x20fired:',_0x1bb6b1[_0x2c10('0x2c')]);var _0x5a4951=originateValidation[_0x2c10('0x10')](_0x1bb6b1[_0x2c10('0x2c')]);if(_0x5a4951[_0x2c10('0x28')]>0x0){return _0x50fde[_0x2c10('0x1c')](0x190)[_0x2c10('0x2d')](_0x5a4951);}var _0x2666fc=_0x1bb6b1[_0x2c10('0x2c')][_0x2c10('0x2e')];var _0x549a63=_0x1bb6b1[_0x2c10('0x2c')]['callNumber'];var _0xf329d6=_0x1bb6b1['body'][_0x2c10('0x2f')];var _0x2c374d=_0x1bb6b1[_0x2c10('0x2c')][_0x2c10('0x30')];return getAgent(_0x2666fc)[_0x2c10('0x24')](function(_0x2c2b2a){logger['info'](_0x2c10('0x31'),_0x2c2b2a['name']);emit(util[_0x2c10('0x32')](_0x2c10('0x33'),_0x2c2b2a['name']),'webbar:originate',{'callNumber':_0x549a63,'callerId':_0xf329d6,'callbackUrl':_0x2c374d});return _0x50fde[_0x2c10('0x1c')](0xc8)[_0x2c10('0x2d')]({'error':![],'message':_0x2c10('0x34')});})['catch'](handleError(_0x50fde));};exports['hangup']=function(_0x15ba65,_0x5e74f3){logger[_0x2c10('0x15')](_0x2c10('0x35'),_0x15ba65[_0x2c10('0x2c')]);var _0x2b49db=hangupValidation[_0x2c10('0x10')](_0x15ba65['body']);if(_0x2b49db[_0x2c10('0x28')]>0x0){return _0x5e74f3[_0x2c10('0x1c')](0x190)[_0x2c10('0x2d')](_0x2b49db);}var _0x406c81=_0x15ba65['body'][_0x2c10('0x2e')];var _0x225b63=_0x15ba65[_0x2c10('0x2c')][_0x2c10('0x27')];return getAgent(_0x406c81)[_0x2c10('0x24')](function(_0x49c938){logger[_0x2c10('0x15')](_0x2c10('0x31'),_0x49c938[_0x2c10('0x1b')]);emit(util[_0x2c10('0x32')]('user:%s',_0x49c938[_0x2c10('0x1b')]),_0x2c10('0x36'),{'sessionId':_0x225b63});return _0x5e74f3[_0x2c10('0x1c')](0xc8)[_0x2c10('0x2d')]({'error':![],'message':_0x2c10('0x37')});})[_0x2c10('0x21')](handleError(_0x5e74f3));};exports['answer']=function(_0x535e78,_0x38916d){logger['info'](_0x2c10('0x38'),_0x535e78[_0x2c10('0x2c')]);var _0x2566fd=answerValidation['validate'](_0x535e78['body']);if(_0x2566fd[_0x2c10('0x28')]>0x0){return _0x38916d[_0x2c10('0x1c')](0x190)['json'](_0x2566fd);}var _0x118782=_0x535e78[_0x2c10('0x2c')][_0x2c10('0x2e')];var _0x5aa3bf=_0x535e78['body'][_0x2c10('0x27')];return getAgent(_0x118782)[_0x2c10('0x24')](function(_0x59ec17){logger[_0x2c10('0x15')]('entityFound:',_0x59ec17[_0x2c10('0x1b')]);emit(util[_0x2c10('0x32')](_0x2c10('0x33'),_0x59ec17[_0x2c10('0x1b')]),_0x2c10('0x39'),{'sessionId':_0x5aa3bf});return _0x38916d[_0x2c10('0x1c')](0xc8)[_0x2c10('0x2d')]({'error':![],'message':_0x2c10('0x3a')});})[_0x2c10('0x21')](handleError(_0x38916d));};exports[_0x2c10('0x3b')]=function(_0x5c8eef,_0x2d4c35){logger[_0x2c10('0x15')](_0x2c10('0x3c'),_0x5c8eef[_0x2c10('0x2c')]);var _0x2714ad=holdValidation['validate'](_0x5c8eef['body']);if(_0x2714ad[_0x2c10('0x28')]>0x0){return _0x2d4c35[_0x2c10('0x1c')](0x190)[_0x2c10('0x2d')](_0x2714ad);}var _0x469b87=_0x5c8eef[_0x2c10('0x2c')][_0x2c10('0x2e')];var _0x5d7a4f=_0x5c8eef[_0x2c10('0x2c')][_0x2c10('0x27')];return getAgent(_0x469b87)[_0x2c10('0x24')](function(_0x57c90e){logger[_0x2c10('0x15')](_0x2c10('0x31'),_0x57c90e[_0x2c10('0x1b')]);emit(util[_0x2c10('0x32')](_0x2c10('0x33'),_0x57c90e[_0x2c10('0x1b')]),'webbar:hold',{'sessionId':_0x5d7a4f});return _0x2d4c35[_0x2c10('0x1c')](0xc8)[_0x2c10('0x2d')]({'error':![],'message':_0x2c10('0x3d')});})['catch'](handleError(_0x2d4c35));};exports[_0x2c10('0x3e')]=function(_0x20a738,_0x2f6a2a){logger['info'](_0x2c10('0x3f'),_0x20a738[_0x2c10('0x2c')]);var _0x4a6787=unholdValidation[_0x2c10('0x10')](_0x20a738[_0x2c10('0x2c')]);if(_0x4a6787[_0x2c10('0x28')]>0x0){return _0x2f6a2a[_0x2c10('0x1c')](0x190)[_0x2c10('0x2d')](_0x4a6787);}var _0x6e5c56=_0x20a738[_0x2c10('0x2c')]['userId'];var _0x548def=_0x20a738[_0x2c10('0x2c')][_0x2c10('0x27')];return getAgent(_0x6e5c56)[_0x2c10('0x24')](function(_0x4da2ef){logger[_0x2c10('0x15')](_0x2c10('0x31'),_0x4da2ef[_0x2c10('0x1b')]);emit(util[_0x2c10('0x32')](_0x2c10('0x33'),_0x4da2ef[_0x2c10('0x1b')]),'webbar:unhold',{'sessionId':_0x548def});return _0x2f6a2a['status'](0xc8)[_0x2c10('0x2d')]({'error':![],'message':_0x2c10('0x40')});})['catch'](handleError(_0x2f6a2a));};exports[_0x2c10('0x41')]=function(_0x8ddee6,_0x49322f){logger[_0x2c10('0x15')](_0x2c10('0x42'),_0x49322f[_0x2c10('0x2c')]);var _0x1dc9cc=callsValidation[_0x2c10('0x10')](_0x8ddee6[_0x2c10('0x2c')]);if(_0x1dc9cc[_0x2c10('0x28')]>0x0){return _0x49322f[_0x2c10('0x1c')](0x190)['json'](_0x1dc9cc);}var _0x422222=_0x8ddee6[_0x2c10('0x2c')][_0x2c10('0x2e')];var _0x190b55=respondWithRpcPromise(_0x2c10('0x43'));var _0x3e500f=getAgent(_0x422222);return Promise[_0x2c10('0x44')]([_0x190b55,_0x3e500f])['then'](function(_0xf69c36){var _0x5af363=_0xf69c36[0x0];var _0x446504=_0xf69c36[0x1];var _0x52e5eb=_[_0x2c10('0x25')](_0x5af363[_0x2c10('0x45')],function(_0x14faaa){return _0x14faaa[_0x2c10('0x26')]==_0x446504['id'];});return _0x49322f[_0x2c10('0x1c')](0xc8)[_0x2c10('0x2d')]({'count':_0x52e5eb[_0x2c10('0x28')],'rows':_0x52e5eb});})[_0x2c10('0x21')](handleError(_0x49322f));};exports[_0x2c10('0x46')]=function(_0x108c21,_0x21dd7e){logger['info']('conference\x20fired:',_0x108c21[_0x2c10('0x2c')]);var _0x2abc55=conferenceValidation['validate'](_0x108c21[_0x2c10('0x2c')]);if(_0x2abc55['length']>0x0){return _0x21dd7e['status'](0x190)[_0x2c10('0x2d')](_0x2abc55);}var _0x38d00b=_0x108c21[_0x2c10('0x2c')][_0x2c10('0x2e')];return getAgent(_0x38d00b)[_0x2c10('0x24')](function(_0x242e54){logger[_0x2c10('0x15')](_0x2c10('0x31'),_0x242e54[_0x2c10('0x1b')]);emit(util[_0x2c10('0x32')](_0x2c10('0x33'),_0x242e54[_0x2c10('0x1b')]),_0x2c10('0x47'));return _0x21dd7e[_0x2c10('0x1c')](0xc8)[_0x2c10('0x2d')]({'error':![],'message':'conference\x20executed!'});})[_0x2c10('0x21')](handleError(_0x21dd7e));};exports[_0x2c10('0x48')]=function(_0x3dc383,_0x3b98a9){logger[_0x2c10('0x15')](_0x2c10('0x49'),_0x3dc383[_0x2c10('0x2c')]);var _0x1b744c=transferValidation[_0x2c10('0x10')](_0x3dc383[_0x2c10('0x2c')]);if(_0x1b744c[_0x2c10('0x28')]>0x0){return _0x3b98a9[_0x2c10('0x1c')](0x190)[_0x2c10('0x2d')](_0x1b744c);}var _0x45667f=_0x3dc383[_0x2c10('0x2c')][_0x2c10('0x2e')];var _0x2dd6bd=_0x3dc383['body'][_0x2c10('0x27')];var _0x4b7310=_0x3dc383['body'][_0x2c10('0x4a')];return getAgent(_0x45667f)[_0x2c10('0x24')](function(_0x5737c7){logger[_0x2c10('0x15')](_0x2c10('0x31'),_0x5737c7[_0x2c10('0x1b')]);emit(util[_0x2c10('0x32')]('user:%s',_0x5737c7[_0x2c10('0x1b')]),_0x2c10('0x4b'),{'sessionId':_0x2dd6bd,'transferNumber':_0x4b7310});return _0x3b98a9[_0x2c10('0x1c')](0xc8)['json']({'error':![],'message':_0x2c10('0x4c')});})[_0x2c10('0x21')](handleError(_0x3b98a9));}; \ No newline at end of file +var _0xacae=['callerId','callbackUrl','entityFound:','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','sessionId','format','webbar:hangup','hangup\x20executed!','catch','webbar:answer','answer\x20executed!','hold','hold\x20fired:','hold\x20executed!','unhold\x20fired:','calls','calls\x20fired:','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','util','bluebird','client','http','ioredis','redis','localhost','socket.io-emitter','number','string','callNumber\x20is\x20required','userId\x20is\x20required','transferNumber\x20is\x20required','emit','log','handleError:','error','stack','name','status','send','NotFound','request','then','message','result','User','findOne','agent','VoiceChannels','all','filter','rows','UserId','length','info','body','validate','json','userId','callNumber'];(function(_0x3883e5,_0x1e1b05){var _0x10ae71=function(_0x110986){while(--_0x110986){_0x3883e5['push'](_0x3883e5['shift']());}};_0x10ae71(++_0x1e1b05);}(_0xacae,0x67));var _0xeaca=function(_0x3bbda5,_0x6e3256){_0x3bbda5=_0x3bbda5-0x0;var _0x16b40a=_0xacae[_0x3bbda5];return _0x16b40a;};'use strict';var path=require(_0xeaca('0x0'));var fs=require('fs');var _=require(_0xeaca('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var util=require(_0xeaca('0x2'));var BPromise=require(_0xeaca('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0xeaca('0x4')][_0xeaca('0x5')]({'port':0x232a});var logger=require('../../config/logger')('webbarapi');var Redis=require(_0xeaca('0x6'));config[_0xeaca('0x7')]=_['defaults'](config[_0xeaca('0x7')],{'host':_0xeaca('0x8'),'port':0x18eb});var io=require(_0xeaca('0x9'))(new Redis(config[_0xeaca('0x7')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0xeaca('0xa'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0xeaca('0xb'),'required':[!![],_0xeaca('0xc')]},'callerId':{'type':'string'},'callbackUrl':{'type':_0xeaca('0xb')}});var hangupValidation=new Schema({'userId':{'type':_0xeaca('0xa'),'required':[!![],_0xeaca('0xd')]},'sessionId':{'type':_0xeaca('0xb'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xeaca('0xa'),'required':[!![],_0xeaca('0xd')]},'sessionId':{'type':_0xeaca('0xb'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xeaca('0xa'),'required':[!![],_0xeaca('0xd')]},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':'string','required':[!![],_0xeaca('0xe')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xeaca('0xd')]},'sessionId':{'type':_0xeaca('0xb'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xeaca('0xa'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xeaca('0xb'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xeaca('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':_0xeaca('0xa'),'required':[!![],'userId\x20is\x20required']}});function emit(_0x109875,_0x1a6d3b,_0xa09ced){logger['info'](_0x109875,_0x1a6d3b,JSON['stringify'](_0xa09ced));io['to'](_0x109875)[_0xeaca('0xf')](_0x1a6d3b,_0xa09ced);}function handleError(_0x26a0d7){return function(_0x29dc34){console[_0xeaca('0x10')](_0xeaca('0x11'),_0x29dc34,_0x29dc34 instanceof RangeError);logger[_0xeaca('0x12')](_0x29dc34[_0xeaca('0x13')]);if(_0x29dc34 instanceof RangeError){if(_0x29dc34[_0xeaca('0x14')]){delete _0x29dc34[_0xeaca('0x14')];}_0x26a0d7[_0xeaca('0x15')](0x194)[_0xeaca('0x16')](_0x29dc34);}else{if(_0x29dc34['name']){delete _0x29dc34[_0xeaca('0x14')];}_0x26a0d7['status'](0x1f4)[_0xeaca('0x16')](_0x29dc34);}};}function checkError(){return function(_0x261af1){if(!_0x261af1){throw new RangeError(_0xeaca('0x17'));}return _0x261af1;};}function respondWithRpcPromise(_0x3043f0,_0x108151){return new BPromise(function(_0x4c4f5e,_0x28437a){var _0x1528ed=amiClient;return _0x1528ed[_0xeaca('0x18')](_0x3043f0,_0x108151)[_0xeaca('0x19')](function(_0x2fb31f){if(_0x2fb31f['error']){if(_0x2fb31f[_0xeaca('0x12')]['code']===0x1f4){return _0x28437a(_0x2fb31f[_0xeaca('0x12')][_0xeaca('0x1a')]);}return _0x4c4f5e(_0x2fb31f[_0xeaca('0x12')][_0xeaca('0x1a')]);}else{_0x4c4f5e(_0x2fb31f[_0xeaca('0x1b')]);}})['catch'](function(_0x179a83){_0x28437a(_0x179a83);});});}function getAgent(_0x5affec){return db[_0xeaca('0x1c')][_0xeaca('0x1d')]({'where':{'id':_0x5affec,'role':_0xeaca('0x1e')}})[_0xeaca('0x19')](checkError());}function getAgentCheckSession(_0x4a5a81,_0x39f71d){return new BPromise(function(_0x3c9f8f,_0x224c17){var _0x209a7b=respondWithRpcPromise(_0xeaca('0x1f'));var _0x3bb328=getAgent(_0x4a5a81);Promise[_0xeaca('0x20')]([_0x209a7b,_0x3bb328])[_0xeaca('0x19')](function(_0xfe2575){var _0x25b185=_0xfe2575[0x0];var _0x5c77b7=_0xfe2575[0x1];var _0x468d0c=_[_0xeaca('0x21')](_0x25b185[_0xeaca('0x22')],function(_0x4ff445){return _0x4ff445[_0xeaca('0x23')]==_0x5c77b7['id']&&_0x4ff445['sessionId']==_0x39f71d;});if(_0x468d0c[_0xeaca('0x24')]==0x1){_0x3c9f8f(_0x5c77b7);}else{_0x224c17(new RangeError('sessionId\x20'+_0x39f71d+'\x20not\x20found!'));}});});}exports['originate']=function(_0x3accea,_0x2ada45){logger[_0xeaca('0x25')]('originate\x20fired:',_0x3accea[_0xeaca('0x26')]);var _0x3ab2b4=originateValidation[_0xeaca('0x27')](_0x3accea[_0xeaca('0x26')]);if(_0x3ab2b4[_0xeaca('0x24')]>0x0){return _0x2ada45[_0xeaca('0x15')](0x190)[_0xeaca('0x28')](_0x3ab2b4);}var _0x442eeb=_0x3accea['body'][_0xeaca('0x29')];var _0x21859a=_0x3accea[_0xeaca('0x26')][_0xeaca('0x2a')];var _0x16e569=_0x3accea['body'][_0xeaca('0x2b')];var _0xc7e961=_0x3accea[_0xeaca('0x26')][_0xeaca('0x2c')];return getAgent(_0x442eeb)[_0xeaca('0x19')](function(_0x1b9bf0){logger[_0xeaca('0x25')](_0xeaca('0x2d'),_0x1b9bf0[_0xeaca('0x14')]);emit(util['format'](_0xeaca('0x2e'),_0x1b9bf0[_0xeaca('0x14')]),_0xeaca('0x2f'),{'callNumber':_0x21859a,'callerId':_0x16e569,'callbackUrl':_0xc7e961});return _0x2ada45['status'](0xc8)[_0xeaca('0x28')]({'error':![],'message':_0xeaca('0x30')});})['catch'](handleError(_0x2ada45));};exports[_0xeaca('0x31')]=function(_0x136c06,_0x2a5ad3){logger[_0xeaca('0x25')](_0xeaca('0x32'),_0x136c06[_0xeaca('0x26')]);var _0x310f17=hangupValidation[_0xeaca('0x27')](_0x136c06[_0xeaca('0x26')]);if(_0x310f17[_0xeaca('0x24')]>0x0){return _0x2a5ad3[_0xeaca('0x15')](0x190)[_0xeaca('0x28')](_0x310f17);}var _0x462feb=_0x136c06[_0xeaca('0x26')][_0xeaca('0x29')];var _0x47b41d=_0x136c06['body'][_0xeaca('0x33')];return getAgent(_0x462feb)[_0xeaca('0x19')](function(_0x43dfd6){logger[_0xeaca('0x25')](_0xeaca('0x2d'),_0x43dfd6[_0xeaca('0x14')]);emit(util[_0xeaca('0x34')]('user:%s',_0x43dfd6[_0xeaca('0x14')]),_0xeaca('0x35'),{'sessionId':_0x47b41d});return _0x2a5ad3[_0xeaca('0x15')](0xc8)[_0xeaca('0x28')]({'error':![],'message':_0xeaca('0x36')});})[_0xeaca('0x37')](handleError(_0x2a5ad3));};exports['answer']=function(_0x5e4142,_0x91eb68){logger[_0xeaca('0x25')]('answer\x20fired:',_0x5e4142[_0xeaca('0x26')]);var _0x190901=answerValidation[_0xeaca('0x27')](_0x5e4142['body']);if(_0x190901[_0xeaca('0x24')]>0x0){return _0x91eb68[_0xeaca('0x15')](0x190)[_0xeaca('0x28')](_0x190901);}var _0x1a3321=_0x5e4142[_0xeaca('0x26')][_0xeaca('0x29')];var _0x2ca874=_0x5e4142[_0xeaca('0x26')]['sessionId'];return getAgent(_0x1a3321)['then'](function(_0x3651a5){logger[_0xeaca('0x25')](_0xeaca('0x2d'),_0x3651a5[_0xeaca('0x14')]);emit(util['format'](_0xeaca('0x2e'),_0x3651a5[_0xeaca('0x14')]),_0xeaca('0x38'),{'sessionId':_0x2ca874});return _0x91eb68[_0xeaca('0x15')](0xc8)[_0xeaca('0x28')]({'error':![],'message':_0xeaca('0x39')});})[_0xeaca('0x37')](handleError(_0x91eb68));};exports[_0xeaca('0x3a')]=function(_0x3d0ac7,_0x16cc96){logger[_0xeaca('0x25')](_0xeaca('0x3b'),_0x3d0ac7[_0xeaca('0x26')]);var _0x39f2a3=holdValidation[_0xeaca('0x27')](_0x3d0ac7['body']);if(_0x39f2a3[_0xeaca('0x24')]>0x0){return _0x16cc96[_0xeaca('0x15')](0x190)['json'](_0x39f2a3);}var _0x10ff5b=_0x3d0ac7[_0xeaca('0x26')][_0xeaca('0x29')];var _0x301dcb=_0x3d0ac7['body']['sessionId'];return getAgent(_0x10ff5b)[_0xeaca('0x19')](function(_0xe16d23){logger['info'](_0xeaca('0x2d'),_0xe16d23[_0xeaca('0x14')]);emit(util[_0xeaca('0x34')](_0xeaca('0x2e'),_0xe16d23[_0xeaca('0x14')]),'webbar:hold',{'sessionId':_0x301dcb});return _0x16cc96[_0xeaca('0x15')](0xc8)[_0xeaca('0x28')]({'error':![],'message':_0xeaca('0x3c')});})[_0xeaca('0x37')](handleError(_0x16cc96));};exports['unhold']=function(_0x1fec71,_0x46ce33){logger[_0xeaca('0x25')](_0xeaca('0x3d'),_0x1fec71['body']);var _0x347395=unholdValidation[_0xeaca('0x27')](_0x1fec71[_0xeaca('0x26')]);if(_0x347395[_0xeaca('0x24')]>0x0){return _0x46ce33['status'](0x190)['json'](_0x347395);}var _0x2cf431=_0x1fec71[_0xeaca('0x26')][_0xeaca('0x29')];var _0x1b1c8c=_0x1fec71[_0xeaca('0x26')][_0xeaca('0x33')];return getAgent(_0x2cf431)['then'](function(_0x637a33){logger['info'](_0xeaca('0x2d'),_0x637a33['name']);emit(util['format'](_0xeaca('0x2e'),_0x637a33['name']),'webbar:unhold',{'sessionId':_0x1b1c8c});return _0x46ce33[_0xeaca('0x15')](0xc8)['json']({'error':![],'message':'unhold\x20executed!'});})['catch'](handleError(_0x46ce33));};exports[_0xeaca('0x3e')]=function(_0x146799,_0x30f935){logger[_0xeaca('0x25')](_0xeaca('0x3f'),_0x30f935[_0xeaca('0x26')]);var _0x29a6c0=callsValidation['validate'](_0x146799[_0xeaca('0x26')]);if(_0x29a6c0[_0xeaca('0x24')]>0x0){return _0x30f935[_0xeaca('0x15')](0x190)[_0xeaca('0x28')](_0x29a6c0);}var _0x204c5f=_0x146799[_0xeaca('0x26')]['userId'];var _0x3c2387=respondWithRpcPromise(_0xeaca('0x1f'));var _0x15c5cb=getAgent(_0x204c5f);return Promise['all']([_0x3c2387,_0x15c5cb])[_0xeaca('0x19')](function(_0x43e776){var _0x125252=_0x43e776[0x0];var _0xeffe6b=_0x43e776[0x1];var _0x4b72da=_['filter'](_0x125252[_0xeaca('0x22')],function(_0x3bebd1){return _0x3bebd1[_0xeaca('0x23')]==_0xeffe6b['id'];});return _0x30f935['status'](0xc8)[_0xeaca('0x28')]({'count':_0x4b72da[_0xeaca('0x24')],'rows':_0x4b72da});})[_0xeaca('0x37')](handleError(_0x30f935));};exports[_0xeaca('0x40')]=function(_0x20806f,_0x503a20){logger[_0xeaca('0x25')](_0xeaca('0x41'),_0x20806f[_0xeaca('0x26')]);var _0x4b227b=conferenceValidation[_0xeaca('0x27')](_0x20806f[_0xeaca('0x26')]);if(_0x4b227b[_0xeaca('0x24')]>0x0){return _0x503a20['status'](0x190)['json'](_0x4b227b);}var _0x42bdf0=_0x20806f[_0xeaca('0x26')][_0xeaca('0x29')];return getAgent(_0x42bdf0)[_0xeaca('0x19')](function(_0x166ff1){logger[_0xeaca('0x25')](_0xeaca('0x2d'),_0x166ff1[_0xeaca('0x14')]);emit(util['format'](_0xeaca('0x2e'),_0x166ff1['name']),_0xeaca('0x42'));return _0x503a20[_0xeaca('0x15')](0xc8)[_0xeaca('0x28')]({'error':![],'message':_0xeaca('0x43')});})['catch'](handleError(_0x503a20));};exports[_0xeaca('0x44')]=function(_0x3d8e07,_0x32e082){logger[_0xeaca('0x25')](_0xeaca('0x45'),_0x3d8e07['body']);var _0x1530ac=transferValidation[_0xeaca('0x27')](_0x3d8e07[_0xeaca('0x26')]);if(_0x1530ac[_0xeaca('0x24')]>0x0){return _0x32e082[_0xeaca('0x15')](0x190)[_0xeaca('0x28')](_0x1530ac);}var _0x1f4ae1=_0x3d8e07[_0xeaca('0x26')][_0xeaca('0x29')];var _0x25312a=_0x3d8e07[_0xeaca('0x26')][_0xeaca('0x33')];var _0x263c92=_0x3d8e07[_0xeaca('0x26')][_0xeaca('0x46')];return getAgent(_0x1f4ae1)[_0xeaca('0x19')](function(_0x3346fc){logger['info'](_0xeaca('0x2d'),_0x3346fc[_0xeaca('0x14')]);emit(util[_0xeaca('0x34')](_0xeaca('0x2e'),_0x3346fc[_0xeaca('0x14')]),_0xeaca('0x47'),{'sessionId':_0x25312a,'transferNumber':_0x263c92});return _0x32e082[_0xeaca('0x15')](0xc8)['json']({'error':![],'message':_0xeaca('0x48')});})[_0xeaca('0x37')](handleError(_0x32e082));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index d43f59e..768d8e7 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 _0x17f2=['getAnswers','/:id/users','getAgents','/:id/applications','getApplications','create','post','addDisposition','addAnswer','addApplications','/:id/notify','/:id/send','send','put','update','destroy','delete','removeDispositions','removeAnswers','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers'];(function(_0x3900be,_0x59a4f5){var _0x1ca48e=function(_0x1885ee){while(--_0x1885ee){_0x3900be['push'](_0x3900be['shift']());}};_0x1ca48e(++_0x59a4f5);}(_0x17f2,0x14e));var _0x217f=function(_0x3cec8c,_0x3f6c1d){_0x3cec8c=_0x3cec8c-0x0;var _0x38032e=_0x17f2[_0x3cec8c];return _0x38032e;};'use strict';var multer=require(_0x217f('0x0'));var util=require('util');var path=require(_0x217f('0x1'));var timeout=require(_0x217f('0x2'));var express=require(_0x217f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x217f('0x4'));var interaction=require(_0x217f('0x5'));var config=require('../../config/environment');var controller=require(_0x217f('0x6'));router[_0x217f('0x7')]('/',auth[_0x217f('0x8')](),controller[_0x217f('0x9')]);router[_0x217f('0x7')](_0x217f('0xa'),auth[_0x217f('0x8')](),controller[_0x217f('0xb')]);router[_0x217f('0x7')](_0x217f('0xc'),auth[_0x217f('0x8')](),controller['show']);router[_0x217f('0x7')](_0x217f('0xd'),auth[_0x217f('0x8')](),controller[_0x217f('0xe')]);router['get'](_0x217f('0xf'),auth[_0x217f('0x8')](),controller[_0x217f('0x10')]);router['get'](_0x217f('0x11'),auth[_0x217f('0x8')](),controller[_0x217f('0x12')]);router[_0x217f('0x7')](_0x217f('0x13'),auth[_0x217f('0x8')](),controller[_0x217f('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0x217f('0x15')]);router[_0x217f('0x16')]('/:id/dispositions',auth[_0x217f('0x8')](),controller[_0x217f('0x17')]);router[_0x217f('0x16')](_0x217f('0xf'),auth[_0x217f('0x8')](),controller[_0x217f('0x18')]);router[_0x217f('0x16')](_0x217f('0x11'),auth[_0x217f('0x8')](),controller['addAgents']);router['post'](_0x217f('0x13'),auth[_0x217f('0x8')](),controller[_0x217f('0x19')]);router[_0x217f('0x16')](_0x217f('0x1a'),controller['notify']);router[_0x217f('0x16')](_0x217f('0x1b'),auth[_0x217f('0x8')](),controller[_0x217f('0x1c')]);router[_0x217f('0x1d')](_0x217f('0xc'),auth[_0x217f('0x8')](),controller[_0x217f('0x1e')]);router['delete']('/:id',auth[_0x217f('0x8')](),controller[_0x217f('0x1f')]);router[_0x217f('0x20')](_0x217f('0xd'),auth[_0x217f('0x8')](),controller[_0x217f('0x21')]);router[_0x217f('0x20')](_0x217f('0xf'),auth[_0x217f('0x8')](),controller[_0x217f('0x22')]);router[_0x217f('0x20')]('/:id/users',auth[_0x217f('0x8')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x0bf7=['/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getAgents','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addAgents','addApplications','/:id/notify','notify','delete','destroy','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x51ed62,_0x574379){var _0x34aee3=function(_0x2958bc){while(--_0x2958bc){_0x51ed62['push'](_0x51ed62['shift']());}};_0x34aee3(++_0x574379);}(_0x0bf7,0xd1));var _0x70bf=function(_0x1af2e4,_0x3c4f9e){_0x1af2e4=_0x1af2e4-0x0;var _0x39bd89=_0x0bf7[_0x1af2e4];return _0x39bd89;};'use strict';var multer=require('multer');var util=require(_0x70bf('0x0'));var path=require(_0x70bf('0x1'));var timeout=require('connect-timeout');var express=require(_0x70bf('0x2'));var router=express['Router']();var fs_extra=require(_0x70bf('0x3'));var auth=require(_0x70bf('0x4'));var interaction=require(_0x70bf('0x5'));var config=require(_0x70bf('0x6'));var controller=require(_0x70bf('0x7'));router[_0x70bf('0x8')]('/',auth[_0x70bf('0x9')](),controller[_0x70bf('0xa')]);router[_0x70bf('0x8')](_0x70bf('0xb'),auth[_0x70bf('0x9')](),controller[_0x70bf('0xc')]);router[_0x70bf('0x8')](_0x70bf('0xd'),auth[_0x70bf('0x9')](),controller[_0x70bf('0xe')]);router[_0x70bf('0x8')](_0x70bf('0xf'),auth[_0x70bf('0x9')](),controller[_0x70bf('0x10')]);router[_0x70bf('0x8')](_0x70bf('0x11'),auth[_0x70bf('0x9')](),controller[_0x70bf('0x12')]);router[_0x70bf('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0x70bf('0x13')]);router[_0x70bf('0x8')](_0x70bf('0x14'),auth[_0x70bf('0x9')](),controller[_0x70bf('0x15')]);router[_0x70bf('0x16')]('/',auth[_0x70bf('0x9')](),controller[_0x70bf('0x17')]);router['post'](_0x70bf('0xf'),auth[_0x70bf('0x9')](),controller[_0x70bf('0x18')]);router['post'](_0x70bf('0x11'),auth['isAuthenticated'](),controller[_0x70bf('0x19')]);router[_0x70bf('0x16')]('/:id/users',auth[_0x70bf('0x9')](),controller[_0x70bf('0x1a')]);router[_0x70bf('0x16')](_0x70bf('0x14'),auth['isAuthenticated'](),controller[_0x70bf('0x1b')]);router[_0x70bf('0x16')](_0x70bf('0x1c'),controller[_0x70bf('0x1d')]);router[_0x70bf('0x16')]('/:id/send',auth[_0x70bf('0x9')](),controller['send']);router['put'](_0x70bf('0xd'),auth[_0x70bf('0x9')](),controller['update']);router[_0x70bf('0x1e')]('/:id',auth[_0x70bf('0x9')](),controller[_0x70bf('0x1f')]);router['delete'](_0x70bf('0xf'),auth[_0x70bf('0x9')](),controller[_0x70bf('0x20')]);router[_0x70bf('0x1e')](_0x70bf('0x11'),auth[_0x70bf('0x9')](),controller[_0x70bf('0x21')]);router[_0x70bf('0x1e')](_0x70bf('0x22'),auth[_0x70bf('0x9')](),controller[_0x70bf('0x23')]);module[_0x70bf('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 5375b1a..e9aa03e 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 _0x6012=['mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM','twilio','sinch','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'];(function(_0xc30587,_0x301ea6){var _0x4ffaa1=function(_0xa99cdf){while(--_0xa99cdf){_0xc30587['push'](_0xc30587['shift']());}};_0x4ffaa1(++_0x301ea6);}(_0x6012,0xeb));var _0x2601=function(_0x4ec13d,_0x358a8f){_0x4ec13d=_0x4ec13d-0x0;var _0x3c3fa7=_0x6012[_0x4ec13d];return _0x3c3fa7;};'use strict';var Sequelize=require(_0x2601('0x0'));var rs=require(_0x2601('0x1'));module[_0x2601('0x2')]={'name':{'type':Sequelize[_0x2601('0x3')],'unique':_0x2601('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x2601('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x2601('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x2601('0x3')],'defaultValue':function(){return rs[_0x2601('0x5')]();}},'phone':{'type':Sequelize[_0x2601('0x3')]},'type':{'type':Sequelize[_0x2601('0x6')](_0x2601('0x7'),_0x2601('0x8'))},'accountSid':{'type':Sequelize[_0x2601('0x3')]},'baseUrl':{'type':Sequelize[_0x2601('0x3')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x2601('0x9')],'defaultValue':function(){return _0x2601('0xa');}},'notificationSound':{'type':Sequelize[_0x2601('0xb')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2601('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2601('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2601('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2601('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2601('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2601('0xc')],'comment':_0x2601('0xd')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x2601('0xe'),'set':function(_0x552690){if(!_0x552690){this[_0x2601('0xf')](_0x2601('0x10'),null);}this[_0x2601('0xf')](_0x2601('0x11'),_0x552690);}},'description':{'type':Sequelize[_0x2601('0x3')]}}; \ No newline at end of file +var _0xb5d6=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','generate','twilio','sinch'];(function(_0x46aa6b,_0x978c0d){var _0x42cfdd=function(_0x4cbb05){while(--_0x4cbb05){_0x46aa6b['push'](_0x46aa6b['shift']());}};_0x42cfdd(++_0x978c0d);}(_0xb5d6,0x165));var _0x6b5d=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xb5d6[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x6b5d('0x0'));var rs=require('randomstring');module[_0x6b5d('0x1')]={'name':{'type':Sequelize[_0x6b5d('0x2')],'unique':_0x6b5d('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x6b5d('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x6b5d('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x6b5d('0x2')],'defaultValue':function(){return rs[_0x6b5d('0x4')]();}},'phone':{'type':Sequelize[_0x6b5d('0x2')]},'type':{'type':Sequelize['ENUM'](_0x6b5d('0x5'),_0x6b5d('0x6'))},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize[_0x6b5d('0x2')]},'authToken':{'type':Sequelize[_0x6b5d('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x6b5d('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x6b5d('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x6b5d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6b5d('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6b5d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6b5d('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6b5d('0x9')],'comment':_0x6b5d('0xa')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2483ab){if(!_0x2483ab){this[_0x6b5d('0xb')](_0x6b5d('0xc'),null);}this[_0x6b5d('0xb')](_0x6b5d('0xd'),_0x2483ab);}},'description':{'type':Sequelize[_0x6b5d('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index c8bfb6f..871de69 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 _0x27bd=['show','params','options','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','removeDispositions','getAnswers','CannedAnswer','removeAnswers','ids','addAgents','omit','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','findAndCountAll','stack','getApplications','notify','Applications','account','statuses','state','read','WhatsappMessage','update','timestamp','message_id','orderBy','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','whatsapp:','Body','MessageSid','sinch','notifications','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','contact','WhatsappInteraction','spread','interaction','created','applications','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','unshift','agent','queueId','WhatsappQueue','queue','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','http','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','destroy','WhatsappAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','WhatsappAccount','includeAll','include','findAll','rows'];(function(_0x172096,_0x1efae4){var _0x5eb274=function(_0x4b9f26){while(--_0x4b9f26){_0x172096['push'](_0x172096['shift']());}};_0x5eb274(++_0x1efae4);}(_0x27bd,0x136));var _0xd27b=function(_0x198cef,_0x2dda04){_0x198cef=_0x198cef-0x0;var _0x4c4788=_0x27bd[_0x198cef];return _0x4c4788;};'use strict';var emlformat=require(_0xd27b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd27b('0x1'));var jsonpatch=require(_0xd27b('0x2'));var rp=require(_0xd27b('0x3'));var moment=require(_0xd27b('0x4'));var BPromise=require(_0xd27b('0x5'));var Mustache=require(_0xd27b('0x6'));var util=require(_0xd27b('0x7'));var path=require(_0xd27b('0x8'));var sox=require('sox');var csv=require(_0xd27b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd27b('0xa'));var _=require(_0xd27b('0xb'));var squel=require(_0xd27b('0xc'));var crypto=require(_0xd27b('0xd'));var jsforce=require(_0xd27b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd27b('0x9'));var querystring=require('querystring');var Papa=require(_0xd27b('0xf'));var Redis=require(_0xd27b('0x10'));var authService=require(_0xd27b('0x11'));var qs=require(_0xd27b('0x12'));var as=require(_0xd27b('0x13'));var hardwareService=require(_0xd27b('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xd27b('0x15'));var config=require(_0xd27b('0x16'));var licenseUtil=require(_0xd27b('0x17'));var db=require('../../mysqldb')['db'];config[_0xd27b('0x18')]=_[_0xd27b('0x19')](config[_0xd27b('0x18')],{'host':_0xd27b('0x1a'),'port':0x18eb});var socket=require(_0xd27b('0x1b'))(new Redis(config[_0xd27b('0x18')]));require(_0xd27b('0x1c'))['register'](socket);var jayson=require(_0xd27b('0x1d'));var client=jayson['client'][_0xd27b('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x283726,_0x1e5d93,_0x3f6590,_0x4f7109){return new BPromise(function(_0x11378b,_0x545c26){var _0x395a98=_0x4f7109||client;return _0x395a98['request'](_0x283726,_0x3f6590)[_0xd27b('0x1f')](function(_0x182763){logger[_0xd27b('0x20')](_0xd27b('0x21'),_0x1e5d93,_0xd27b('0x22'));logger[_0xd27b('0x23')](_0xd27b('0x24'),_0x1e5d93,_0xd27b('0x22'),JSON[_0xd27b('0x25')](_0x182763));if(_0x182763[_0xd27b('0x26')]){if(_0x182763[_0xd27b('0x26')][_0xd27b('0x27')]===0x1f4){logger['error'](_0xd27b('0x21'),_0x1e5d93,_0x182763['error'][_0xd27b('0x28')]);return _0x545c26(_0x182763['error'][_0xd27b('0x28')]);}logger[_0xd27b('0x26')]('WhatsappAccount,\x20%s,\x20%s',_0x1e5d93,_0x182763['error'][_0xd27b('0x28')]);return _0x11378b(_0x182763[_0xd27b('0x26')]['message']);}else{logger[_0xd27b('0x20')](_0xd27b('0x21'),_0x1e5d93,_0xd27b('0x22'));_0x11378b(_0x182763[_0xd27b('0x29')][_0xd27b('0x28')]);}})[_0xd27b('0x2a')](function(_0x52e88c){logger[_0xd27b('0x26')](_0xd27b('0x21'),_0x1e5d93,_0x52e88c);_0x545c26(_0x52e88c);});});}function respondWithStatusCode(_0x4b2a33,_0x121f8e){_0x121f8e=_0x121f8e||0xcc;return function(_0x17404b){if(_0x17404b){return _0x4b2a33[_0xd27b('0x2b')](_0x121f8e);}return _0x4b2a33[_0xd27b('0x2c')](_0x121f8e)[_0xd27b('0x2d')]();};}function respondWithResult(_0x12e4f9,_0x12e3fd){_0x12e3fd=_0x12e3fd||0xc8;return function(_0x382550){if(_0x382550){return _0x12e4f9['status'](_0x12e3fd)[_0xd27b('0x2e')](_0x382550);}};}function respondWithFilteredResult(_0x2717e8,_0x6ce8ec){return function(_0x49e848){if(_0x49e848){var _0xaf1d0a=typeof _0x6ce8ec[_0xd27b('0x2f')]===_0xd27b('0x30')&&typeof _0x6ce8ec[_0xd27b('0x31')]===_0xd27b('0x30');var _0x12f7b5=_0x49e848['count'];var _0x6ef125=_0xaf1d0a?0x0:_0x6ce8ec[_0xd27b('0x2f')];var _0x56760b=_0xaf1d0a?_0x49e848[_0xd27b('0x32')]:_0x6ce8ec['offset']+_0x6ce8ec['limit'];var _0x357a81;if(_0x56760b>=_0x12f7b5){_0x56760b=_0x12f7b5;_0x357a81=0xc8;}else{_0x357a81=0xce;}_0x2717e8[_0xd27b('0x2c')](_0x357a81);return _0x2717e8['set'](_0xd27b('0x33'),_0x6ef125+'-'+_0x56760b+'/'+_0x12f7b5)[_0xd27b('0x2e')](_0x49e848);}return null;};}function patchUpdates(_0x2d6a14){return function(_0x4fd85c){try{jsonpatch[_0xd27b('0x34')](_0x4fd85c,_0x2d6a14,!![]);}catch(_0x21fb0c){return BPromise['reject'](_0x21fb0c);}return _0x4fd85c['save']();};}function saveUpdates(_0x2c5e91,_0x774c94){return function(_0x1bcc82){if(_0x1bcc82){return _0x1bcc82['update'](_0x2c5e91)[_0xd27b('0x1f')](function(_0x1228a1){return _0x1228a1;});}return null;};}function removeEntity(_0x367c6c,_0x3f208d){return function(_0x1a963a){if(_0x1a963a){return _0x1a963a[_0xd27b('0x35')]()['then'](function(){var _0x5ea67a=_0x1a963a['get']({'plain':!![]});var _0x2ae489=_0xd27b('0x36');return db[_0xd27b('0x37')][_0xd27b('0x35')]({'where':{'type':_0x2ae489,'resourceId':_0x5ea67a['id']}})[_0xd27b('0x1f')](function(){return _0x1a963a;});})[_0xd27b('0x1f')](function(){_0x367c6c['status'](0xcc)[_0xd27b('0x2d')]();});}};}function handleEntityNotFound(_0x4ad6dd,_0x4782fa){return function(_0x34acb8){if(!_0x34acb8){_0x4ad6dd['sendStatus'](0x194);}return _0x34acb8;};}function handleError(_0x2db7c4,_0x4f8aab){_0x4f8aab=_0x4f8aab||0x1f4;return function(_0x3a7615){logger[_0xd27b('0x26')](_0x3a7615['stack']);if(_0x3a7615[_0xd27b('0x38')]){delete _0x3a7615[_0xd27b('0x38')];}_0x2db7c4[_0xd27b('0x2c')](_0x4f8aab)[_0xd27b('0x39')](_0x3a7615);};}exports[_0xd27b('0x3a')]=function(_0x4de64a,_0x19dbc5){var _0x3b5f50={'include':[{'model':db[_0xd27b('0x3b')],'as':_0xd27b('0x3c')}]},_0x526494={},_0x35a82e={'count':0x0,'rows':[]};var _0x475aaa=_[_0xd27b('0x3d')](db['WhatsappAccount'][_0xd27b('0x3e')],function(_0x26b4a){return{'name':_0x26b4a['fieldName'],'type':_0x26b4a[_0xd27b('0x3f')][_0xd27b('0x40')]};});_0x526494['model']=_[_0xd27b('0x3d')](_0x475aaa,_0xd27b('0x38'));_0x526494[_0xd27b('0x41')]=_[_0xd27b('0x42')](_0x4de64a[_0xd27b('0x41')]);_0x526494[_0xd27b('0x43')]=_[_0xd27b('0x44')](_0x526494[_0xd27b('0x45')],_0x526494[_0xd27b('0x41')]);_0x3b5f50[_0xd27b('0x46')]=_[_0xd27b('0x44')](_0x526494[_0xd27b('0x45')],qs['fields'](_0x4de64a[_0xd27b('0x41')][_0xd27b('0x47')]));_0x3b5f50[_0xd27b('0x46')]=_0x3b5f50[_0xd27b('0x46')][_0xd27b('0x48')]?_0x3b5f50[_0xd27b('0x46')]:_0x526494[_0xd27b('0x45')];if(!_0x4de64a['query'][_0xd27b('0x49')](_0xd27b('0x4a'))){_0x3b5f50[_0xd27b('0x31')]=qs[_0xd27b('0x31')](_0x4de64a['query'][_0xd27b('0x31')]);_0x3b5f50['offset']=qs[_0xd27b('0x2f')](_0x4de64a['query'][_0xd27b('0x2f')]);}_0x3b5f50[_0xd27b('0x4b')]=qs[_0xd27b('0x4c')](_0x4de64a['query'][_0xd27b('0x4c')]);_0x3b5f50[_0xd27b('0x4d')]=qs[_0xd27b('0x43')](_[_0xd27b('0x4e')](_0x4de64a[_0xd27b('0x41')],_0x526494[_0xd27b('0x43')]),_0x475aaa);if(_0x4de64a[_0xd27b('0x41')][_0xd27b('0x4f')]){_0x3b5f50[_0xd27b('0x4d')]=_['merge'](_0x3b5f50['where'],{'$or':_[_0xd27b('0x3d')](_0x475aaa,function(_0xfb1982){if(_0xfb1982[_0xd27b('0x3f')]!=='VIRTUAL'){var _0x48acdc={};_0x48acdc[_0xfb1982[_0xd27b('0x38')]]={'$like':'%'+_0x4de64a['query'][_0xd27b('0x4f')]+'%'};return _0x48acdc;}})});}_0x3b5f50=_[_0xd27b('0x50')]({},_0x3b5f50,_0x4de64a['options']);var _0x540930={'where':_0x3b5f50[_0xd27b('0x4d')]};return db[_0xd27b('0x51')][_0xd27b('0x32')](_0x540930)[_0xd27b('0x1f')](function(_0x5605a4){_0x35a82e['count']=_0x5605a4;if(_0x4de64a[_0xd27b('0x41')][_0xd27b('0x52')]){_0x3b5f50[_0xd27b('0x53')]=[{'all':!![]}];}return db[_0xd27b('0x51')][_0xd27b('0x54')](_0x3b5f50);})[_0xd27b('0x1f')](function(_0x298567){_0x35a82e[_0xd27b('0x55')]=_0x298567;return _0x35a82e;})[_0xd27b('0x1f')](respondWithFilteredResult(_0x19dbc5,_0x3b5f50))[_0xd27b('0x2a')](handleError(_0x19dbc5,null));};exports[_0xd27b('0x56')]=function(_0x3feab4,_0x45226a){var _0x5149a3={'raw':![],'where':{'id':_0x3feab4[_0xd27b('0x57')]['id']},'include':[{'model':db[_0xd27b('0x3b')],'as':_0xd27b('0x3c')}]},_0x18aead={};_0x18aead[_0xd27b('0x45')]=_[_0xd27b('0x42')](db['WhatsappAccount'][_0xd27b('0x3e')]);_0x18aead[_0xd27b('0x41')]=_['keys'](_0x3feab4[_0xd27b('0x41')]);_0x18aead[_0xd27b('0x43')]=_[_0xd27b('0x44')](_0x18aead[_0xd27b('0x45')],_0x18aead['query']);_0x5149a3[_0xd27b('0x46')]=_[_0xd27b('0x44')](_0x18aead[_0xd27b('0x45')],qs[_0xd27b('0x47')](_0x3feab4[_0xd27b('0x41')][_0xd27b('0x47')]));_0x5149a3[_0xd27b('0x46')]=_0x5149a3[_0xd27b('0x46')]['length']?_0x5149a3[_0xd27b('0x46')]:_0x18aead[_0xd27b('0x45')];if(_0x3feab4[_0xd27b('0x41')][_0xd27b('0x52')]){_0x5149a3[_0xd27b('0x53')]=[{'all':!![]}];}_0x5149a3=_[_0xd27b('0x50')]({},_0x5149a3,_0x3feab4[_0xd27b('0x58')]);return db[_0xd27b('0x51')][_0xd27b('0x59')](_0x5149a3)[_0xd27b('0x1f')](handleEntityNotFound(_0x45226a,null))[_0xd27b('0x1f')](respondWithResult(_0x45226a,null))['catch'](handleError(_0x45226a,null));};exports['create']=function(_0x2af9cb,_0x378eaf){return db['WhatsappAccount']['create'](_0x2af9cb[_0xd27b('0x5a')],{})['then'](function(_0x3ab89f){var _0x573c4b=_0x2af9cb[_0xd27b('0x5b')][_0xd27b('0x5c')]({'plain':!![]});if(!_0x573c4b)throw new Error(_0xd27b('0x5d'));if(_0x573c4b['role']===_0xd27b('0x5b')){var _0x12f7f8=_0x3ab89f['get']({'plain':!![]});var _0x27ec84=_0xd27b('0x36');return db[_0xd27b('0x5e')][_0xd27b('0x59')]({'where':{'name':_0x27ec84,'userProfileId':_0x573c4b['userProfileId']},'raw':!![]})[_0xd27b('0x1f')](function(_0x5aa164){if(_0x5aa164&&_0x5aa164[_0xd27b('0x5f')]===0x0){return db['UserProfileResource'][_0xd27b('0x60')]({'name':_0x12f7f8[_0xd27b('0x38')],'resourceId':_0x12f7f8['id'],'type':_0x5aa164[_0xd27b('0x38')],'sectionId':_0x5aa164['id']},{})['then'](function(){return _0x3ab89f;});}else{return _0x3ab89f;}})[_0xd27b('0x2a')](function(_0x10c83b){logger[_0xd27b('0x26')](_0xd27b('0x61'),_0x10c83b);throw _0x10c83b;});}return _0x3ab89f;})[_0xd27b('0x1f')](respondWithResult(_0x378eaf,0xc9))['catch'](handleError(_0x378eaf,null));};exports['update']=function(_0x474f7e,_0x29a770){if(_0x474f7e[_0xd27b('0x5a')]['id']){delete _0x474f7e['body']['id'];}return db[_0xd27b('0x51')][_0xd27b('0x59')]({'where':{'id':_0x474f7e[_0xd27b('0x57')]['id']},'include':[{'model':db[_0xd27b('0x3b')],'as':_0xd27b('0x3c')}]})[_0xd27b('0x1f')](handleEntityNotFound(_0x29a770,null))[_0xd27b('0x1f')](saveUpdates(_0x474f7e[_0xd27b('0x5a')],null))[_0xd27b('0x1f')](respondWithResult(_0x29a770,null))[_0xd27b('0x2a')](handleError(_0x29a770,null));};exports['destroy']=function(_0x17305d,_0x58a47b){return db[_0xd27b('0x51')][_0xd27b('0x59')]({'where':{'id':_0x17305d['params']['id']}})[_0xd27b('0x1f')](handleEntityNotFound(_0x58a47b,null))['then'](removeEntity(_0x58a47b,null))['catch'](handleError(_0x58a47b,null));};exports[_0xd27b('0x62')]=function(_0x2a8e55,_0x3ec57d){return db[_0xd27b('0x51')]['describe']()['then'](respondWithResult(_0x3ec57d,null))['catch'](handleError(_0x3ec57d,null));};exports[_0xd27b('0x63')]=function(_0x120220,_0x15556e,_0x2e9127){if(_0x120220[_0xd27b('0x5a')]['id']){delete _0x120220[_0xd27b('0x5a')]['id'];}return db['WhatsappAccount'][_0xd27b('0x59')]({'where':{'id':_0x120220[_0xd27b('0x57')]['id']}})[_0xd27b('0x1f')](handleEntityNotFound(_0x15556e,null))[_0xd27b('0x1f')](function(_0x3f6985){if(_0x3f6985){_0x120220['body'][_0xd27b('0x64')]=_0x3f6985['id'];return db[_0xd27b('0x65')][_0xd27b('0x60')](_0x120220[_0xd27b('0x5a')]);}})[_0xd27b('0x1f')](respondWithResult(_0x15556e,null))[_0xd27b('0x2a')](handleError(_0x15556e,null));};exports[_0xd27b('0x66')]=function(_0x2f368f,_0x13ab29,_0x462ed8){var _0x4447e2={'raw':![],'where':{}};var _0x50ebcf={};var _0x5b44b5={'count':0x0,'rows':[]};return db[_0xd27b('0x51')][_0xd27b('0x67')]({'where':{'id':_0x2f368f[_0xd27b('0x57')]['id']}})['then'](handleEntityNotFound(_0x13ab29,null))[_0xd27b('0x1f')](function(_0xd6d9d){if(_0xd6d9d){_0x50ebcf[_0xd27b('0x45')]=_[_0xd27b('0x42')](db[_0xd27b('0x65')][_0xd27b('0x3e')]);_0x50ebcf[_0xd27b('0x41')]=_[_0xd27b('0x42')](_0x2f368f['query']);_0x50ebcf[_0xd27b('0x43')]=_[_0xd27b('0x44')](_0x50ebcf[_0xd27b('0x45')],_0x50ebcf[_0xd27b('0x41')]);_0x4447e2[_0xd27b('0x46')]=_['intersection'](_0x50ebcf['model'],qs['fields'](_0x2f368f[_0xd27b('0x41')]['fields']));_0x4447e2['attributes']=_0x4447e2['attributes'][_0xd27b('0x48')]?_0x4447e2['attributes']:_0x50ebcf['model'];if(!_0x2f368f[_0xd27b('0x41')]['hasOwnProperty']('nolimit')){_0x4447e2[_0xd27b('0x31')]=qs[_0xd27b('0x31')](_0x2f368f['query'][_0xd27b('0x31')]);_0x4447e2[_0xd27b('0x2f')]=qs[_0xd27b('0x2f')](_0x2f368f[_0xd27b('0x41')][_0xd27b('0x2f')]);}_0x4447e2['order']=qs['sort'](_0x2f368f['query'][_0xd27b('0x4c')]);_0x4447e2[_0xd27b('0x4d')]=qs[_0xd27b('0x43')](_[_0xd27b('0x4e')](_0x2f368f[_0xd27b('0x41')],_0x50ebcf['filters']));_0x4447e2[_0xd27b('0x4d')][_0xd27b('0x64')]=_0xd6d9d['id'];if(_0x2f368f['query'][_0xd27b('0x4f')]){_0x4447e2[_0xd27b('0x4d')]=_[_0xd27b('0x50')](_0x4447e2[_0xd27b('0x4d')],{'$or':_[_0xd27b('0x3d')](_0x4447e2[_0xd27b('0x46')],function(_0x47a420){var _0x17155e={};_0x17155e[_0x47a420]={'$like':'%'+_0x2f368f[_0xd27b('0x41')][_0xd27b('0x4f')]+'%'};return _0x17155e;})});}_0x4447e2=_[_0xd27b('0x50')]({},_0x4447e2,_0x2f368f[_0xd27b('0x58')]);return db[_0xd27b('0x65')][_0xd27b('0x32')]({'where':_0x4447e2[_0xd27b('0x4d')]})['then'](function(_0x347507){_0x5b44b5[_0xd27b('0x32')]=_0x347507;if(_0x2f368f[_0xd27b('0x41')]['includeAll']){_0x4447e2[_0xd27b('0x53')]=[{'all':!![]}];}return db[_0xd27b('0x65')][_0xd27b('0x54')](_0x4447e2);})[_0xd27b('0x1f')](function(_0x390001){_0x5b44b5[_0xd27b('0x55')]=_0x390001;return _0x5b44b5;});}})[_0xd27b('0x1f')](respondWithFilteredResult(_0x13ab29,_0x4447e2))['catch'](handleError(_0x13ab29,null));};exports[_0xd27b('0x68')]=function(_0x4b16a7,_0x555401,_0x171962){return db[_0xd27b('0x51')][_0xd27b('0x59')]({'where':{'id':_0x4b16a7[_0xd27b('0x57')]['id']}})[_0xd27b('0x1f')](handleEntityNotFound(_0x555401,null))[_0xd27b('0x1f')](function(_0x616764){if(_0x616764){return _0x616764[_0xd27b('0x68')](_0x4b16a7['query']['ids']);}})[_0xd27b('0x1f')](respondWithStatusCode(_0x555401,null))['catch'](handleError(_0x555401,null));};exports['addAnswer']=function(_0xae8f4a,_0x20afdb,_0x469ee3){if(_0xae8f4a[_0xd27b('0x5a')]['id']){delete _0xae8f4a[_0xd27b('0x5a')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0xae8f4a['params']['id']}})[_0xd27b('0x1f')](handleEntityNotFound(_0x20afdb,null))[_0xd27b('0x1f')](function(_0x347702){if(_0x347702){_0xae8f4a[_0xd27b('0x5a')][_0xd27b('0x64')]=_0x347702['id'];return db['CannedAnswer'][_0xd27b('0x60')](_0xae8f4a[_0xd27b('0x5a')]);}})[_0xd27b('0x1f')](respondWithResult(_0x20afdb,null))['catch'](handleError(_0x20afdb,null));};exports[_0xd27b('0x69')]=function(_0xfa7f10,_0x4afb27,_0x19453b){var _0x3cb0ce={'raw':![],'where':{}};var _0x4134b1={};var _0x37e17b={'count':0x0,'rows':[]};return db[_0xd27b('0x51')][_0xd27b('0x67')]({'where':{'id':_0xfa7f10['params']['id']}})[_0xd27b('0x1f')](handleEntityNotFound(_0x4afb27,null))['then'](function(_0x23caeb){if(_0x23caeb){_0x4134b1[_0xd27b('0x45')]=_['keys'](db[_0xd27b('0x6a')][_0xd27b('0x3e')]);_0x4134b1[_0xd27b('0x41')]=_[_0xd27b('0x42')](_0xfa7f10[_0xd27b('0x41')]);_0x4134b1[_0xd27b('0x43')]=_['intersection'](_0x4134b1[_0xd27b('0x45')],_0x4134b1[_0xd27b('0x41')]);_0x3cb0ce[_0xd27b('0x46')]=_[_0xd27b('0x44')](_0x4134b1[_0xd27b('0x45')],qs[_0xd27b('0x47')](_0xfa7f10['query'][_0xd27b('0x47')]));_0x3cb0ce[_0xd27b('0x46')]=_0x3cb0ce['attributes'][_0xd27b('0x48')]?_0x3cb0ce['attributes']:_0x4134b1[_0xd27b('0x45')];if(!_0xfa7f10['query'][_0xd27b('0x49')](_0xd27b('0x4a'))){_0x3cb0ce[_0xd27b('0x31')]=qs[_0xd27b('0x31')](_0xfa7f10[_0xd27b('0x41')][_0xd27b('0x31')]);_0x3cb0ce[_0xd27b('0x2f')]=qs[_0xd27b('0x2f')](_0xfa7f10['query'][_0xd27b('0x2f')]);}_0x3cb0ce[_0xd27b('0x4b')]=qs[_0xd27b('0x4c')](_0xfa7f10[_0xd27b('0x41')][_0xd27b('0x4c')]);_0x3cb0ce[_0xd27b('0x4d')]=qs[_0xd27b('0x43')](_[_0xd27b('0x4e')](_0xfa7f10['query'],_0x4134b1['filters']));_0x3cb0ce[_0xd27b('0x4d')][_0xd27b('0x64')]=_0x23caeb['id'];if(_0xfa7f10['query'][_0xd27b('0x4f')]){_0x3cb0ce['where']=_[_0xd27b('0x50')](_0x3cb0ce['where'],{'$or':_['map'](_0x3cb0ce['attributes'],function(_0x3164e8){var _0x492379={};_0x492379[_0x3164e8]={'$like':'%'+_0xfa7f10[_0xd27b('0x41')]['filter']+'%'};return _0x492379;})});}_0x3cb0ce=_['merge']({},_0x3cb0ce,_0xfa7f10['options']);return db['CannedAnswer'][_0xd27b('0x32')]({'where':_0x3cb0ce['where']})[_0xd27b('0x1f')](function(_0x275145){_0x37e17b[_0xd27b('0x32')]=_0x275145;if(_0xfa7f10[_0xd27b('0x41')][_0xd27b('0x52')]){_0x3cb0ce[_0xd27b('0x53')]=[{'all':!![]}];}return db[_0xd27b('0x6a')][_0xd27b('0x54')](_0x3cb0ce);})[_0xd27b('0x1f')](function(_0x213df5){_0x37e17b['rows']=_0x213df5;return _0x37e17b;});}})[_0xd27b('0x1f')](respondWithFilteredResult(_0x4afb27,_0x3cb0ce))['catch'](handleError(_0x4afb27,null));};exports[_0xd27b('0x6b')]=function(_0x22ef82,_0x345464,_0x56e460){return db[_0xd27b('0x51')]['find']({'where':{'id':_0x22ef82['params']['id']}})[_0xd27b('0x1f')](handleEntityNotFound(_0x345464,null))[_0xd27b('0x1f')](function(_0x503bca){if(_0x503bca){return _0x503bca[_0xd27b('0x6b')](_0x22ef82[_0xd27b('0x41')][_0xd27b('0x6c')]);}})[_0xd27b('0x1f')](respondWithStatusCode(_0x345464,null))[_0xd27b('0x2a')](handleError(_0x345464,null));};exports[_0xd27b('0x6d')]=function(_0x4a1c63,_0x45db8b,_0x37db5a){return db[_0xd27b('0x51')][_0xd27b('0x59')]({'where':{'id':_0x4a1c63[_0xd27b('0x57')]['id']}})[_0xd27b('0x1f')](handleEntityNotFound(_0x45db8b,null))[_0xd27b('0x1f')](function(_0x59e8c2){if(_0x59e8c2){return _0x59e8c2[_0xd27b('0x6d')](_0x4a1c63['body'][_0xd27b('0x6c')],_[_0xd27b('0x6e')](_0x4a1c63[_0xd27b('0x5a')],['ids','id'])||{})['spread'](function(_0x45efc0){for(var _0x44f8d8=0x0;_0x44f8d8<_0x4a1c63[_0xd27b('0x5a')][_0xd27b('0x6c')][_0xd27b('0x48')];_0x44f8d8+=0x1){socket['emit'](_0xd27b('0x6f'),{'UserId':Number(_0x4a1c63['body'][_0xd27b('0x6c')][_0x44f8d8]),'WhatsappAccountId':Number(_0x4a1c63['params']['id'])});}return _0x45efc0;});}})[_0xd27b('0x1f')](respondWithResult(_0x45db8b,null))[_0xd27b('0x2a')](handleError(_0x45db8b,null));};exports['removeAgents']=function(_0x3662d3,_0x377182,_0x433fd2){return db[_0xd27b('0x51')][_0xd27b('0x59')]({'where':{'id':_0x3662d3[_0xd27b('0x57')]['id']}})[_0xd27b('0x1f')](handleEntityNotFound(_0x377182,null))['then'](function(_0x475f3f){if(_0x475f3f){return _0x475f3f[_0xd27b('0x70')](_0x3662d3[_0xd27b('0x41')][_0xd27b('0x6c')])[_0xd27b('0x1f')](function(){if(_[_0xd27b('0x71')](_0x3662d3[_0xd27b('0x41')][_0xd27b('0x6c')])){for(var _0x48a87e=0x0;_0x48a87e<_0x3662d3[_0xd27b('0x41')][_0xd27b('0x6c')][_0xd27b('0x48')];_0x48a87e+=0x1){socket[_0xd27b('0x72')]('userWhatsappAccount:remove',{'UserId':Number(_0x3662d3[_0xd27b('0x41')]['ids'][_0x48a87e]),'WhatsappAccountId':Number(_0x3662d3[_0xd27b('0x57')]['id'])});}}else{socket[_0xd27b('0x72')](_0xd27b('0x73'),{'UserId':Number(_0x3662d3[_0xd27b('0x41')][_0xd27b('0x6c')]),'WhatsappAccountId':Number(_0x3662d3[_0xd27b('0x57')]['id'])});}});}})[_0xd27b('0x1f')](respondWithStatusCode(_0x377182,null))[_0xd27b('0x2a')](handleError(_0x377182,null));};exports[_0xd27b('0x74')]=function(_0x49346a,_0x476e63,_0x2b0922){var _0x4df9eb={};var _0x21da22={};var _0xa5456f;var _0x2aa137;return db[_0xd27b('0x51')][_0xd27b('0x67')]({'where':{'id':_0x49346a['params']['id']}})[_0xd27b('0x1f')](handleEntityNotFound(_0x476e63,null))['then'](function(_0x160277){if(_0x160277){_0xa5456f=_0x160277;_0x21da22[_0xd27b('0x45')]=_['keys'](db[_0xd27b('0x75')][_0xd27b('0x3e')]);_0x21da22[_0xd27b('0x41')]=_[_0xd27b('0x42')](_0x49346a['query']);_0x21da22[_0xd27b('0x43')]=_[_0xd27b('0x44')](_0x21da22['model'],_0x21da22[_0xd27b('0x41')]);_0x4df9eb[_0xd27b('0x46')]=_[_0xd27b('0x44')](_0x21da22[_0xd27b('0x45')],qs[_0xd27b('0x47')](_0x49346a[_0xd27b('0x41')]['fields']));_0x4df9eb[_0xd27b('0x46')]=_0x4df9eb[_0xd27b('0x46')][_0xd27b('0x48')]?_0x4df9eb[_0xd27b('0x46')]:_0x21da22[_0xd27b('0x45')];_0x4df9eb[_0xd27b('0x4b')]=qs[_0xd27b('0x4c')](_0x49346a[_0xd27b('0x41')][_0xd27b('0x4c')]);_0x4df9eb['where']=qs[_0xd27b('0x43')](_[_0xd27b('0x4e')](_0x49346a['query'],_0x21da22[_0xd27b('0x43')]));if(_0x49346a[_0xd27b('0x41')][_0xd27b('0x4f')]){_0x4df9eb[_0xd27b('0x4d')]=_['merge'](_0x4df9eb[_0xd27b('0x4d')],{'$or':_[_0xd27b('0x3d')](_0x4df9eb['attributes'],function(_0x3b7c45){var _0x16570f={};_0x16570f[_0x3b7c45]={'$like':'%'+_0x49346a['query'][_0xd27b('0x4f')]+'%'};return _0x16570f;})});}_0x4df9eb=_[_0xd27b('0x50')]({},_0x4df9eb,_0x49346a[_0xd27b('0x58')]);return _0xa5456f[_0xd27b('0x74')](_0x4df9eb);}})[_0xd27b('0x1f')](function(_0x4548e3){if(_0x4548e3){_0x2aa137=_0x4548e3[_0xd27b('0x48')];if(!_0x49346a[_0xd27b('0x41')][_0xd27b('0x49')](_0xd27b('0x4a'))){_0x4df9eb[_0xd27b('0x31')]=qs[_0xd27b('0x31')](_0x49346a[_0xd27b('0x41')][_0xd27b('0x31')]);_0x4df9eb[_0xd27b('0x2f')]=qs[_0xd27b('0x2f')](_0x49346a['query'][_0xd27b('0x2f')]);}return _0xa5456f[_0xd27b('0x74')](_0x4df9eb);}})['then'](function(_0x14b130){if(_0x14b130){return _0x14b130?{'count':_0x2aa137,'rows':_0x14b130}:null;}})['then'](respondWithResult(_0x476e63,null))[_0xd27b('0x2a')](handleError(_0x476e63,null));};exports[_0xd27b('0x76')]=function(_0x559697,_0x8d6bf7){var _0x52e959=_0x559697[_0xd27b('0x57')]['id'];var _0x324420=_0x559697[_0xd27b('0x5a')];var _0x54236d=0xc8;var _0x6c2b50=null;return db[_0xd27b('0x77')]['transaction']({'isolationLevel':db[_0xd27b('0x77')][_0xd27b('0x78')][_0xd27b('0x79')][_0xd27b('0x7a')]},function(_0x246311){return db['WhatsappAccount']['findOne']({'where':{'id':_0x52e959},'transaction':_0x246311})['then'](function(_0x1452ca){if(_0x1452ca){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0x52e959},'transaction':_0x246311})['then'](function(){var _0x7c9bb8=_[_0xd27b('0x3d')](_0x324420,function(_0x44b40c){_0x44b40c[_0xd27b('0x64')]=_0x52e959;return _0x44b40c;});return db['WhatsappApplication']['bulkCreate'](_0x7c9bb8,{'transaction':_0x246311});});}else{_0x54236d=0x194;_0x6c2b50=[];}});})[_0xd27b('0x1f')](function(){if(_0x54236d!==0x194){return db[_0xd27b('0x7b')][_0xd27b('0x7c')]({'where':{'WhatsappAccountId':_0x52e959},'order':'priority'})[_0xd27b('0x1f')](function(_0x511b94){_0x6c2b50=_0x511b94;});}})[_0xd27b('0x2a')](function(_0x10f030){_0x54236d=0x1f4;logger[_0xd27b('0x26')](_0x10f030[_0xd27b('0x7d')]);if(_0x10f030[_0xd27b('0x38')]){delete _0x10f030['name'];}_0x6c2b50=_0x10f030;})['finally'](function(){if(_0x6c2b50===null){_0x8d6bf7[_0xd27b('0x2b')](_0x54236d);}else{if(_0x54236d===0x1f4){_0x8d6bf7[_0xd27b('0x2c')](_0x54236d)[_0xd27b('0x39')](_0x6c2b50);}else{_0x8d6bf7[_0xd27b('0x2c')](_0x54236d)['json'](_0x6c2b50);}}});};exports['getApplications']=function(_0x23b5c2,_0x19428f,_0x5ec022){var _0x5e4528={};var _0x50e0d0={};var _0x1f21b2;var _0x3ce6ee;return db[_0xd27b('0x51')][_0xd27b('0x67')]({'where':{'id':_0x23b5c2[_0xd27b('0x57')]['id']}})[_0xd27b('0x1f')](handleEntityNotFound(_0x19428f,null))['then'](function(_0x4cfa30){if(_0x4cfa30){_0x1f21b2=_0x4cfa30;_0x50e0d0['model']=_[_0xd27b('0x42')](db[_0xd27b('0x7b')][_0xd27b('0x3e')]);_0x50e0d0['query']=_[_0xd27b('0x42')](_0x23b5c2[_0xd27b('0x41')]);_0x50e0d0[_0xd27b('0x43')]=_[_0xd27b('0x44')](_0x50e0d0[_0xd27b('0x45')],_0x50e0d0[_0xd27b('0x41')]);_0x5e4528[_0xd27b('0x46')]=_[_0xd27b('0x44')](_0x50e0d0[_0xd27b('0x45')],qs[_0xd27b('0x47')](_0x23b5c2[_0xd27b('0x41')][_0xd27b('0x47')]));_0x5e4528['attributes']=_0x5e4528[_0xd27b('0x46')][_0xd27b('0x48')]?_0x5e4528[_0xd27b('0x46')]:_0x50e0d0[_0xd27b('0x45')];_0x5e4528['order']=qs['sort'](_0x23b5c2[_0xd27b('0x41')]['sort']);_0x5e4528['where']=qs['filters'](_[_0xd27b('0x4e')](_0x23b5c2[_0xd27b('0x41')],_0x50e0d0[_0xd27b('0x43')]));if(_0x23b5c2[_0xd27b('0x41')][_0xd27b('0x4f')]){_0x5e4528[_0xd27b('0x4d')]=_['merge'](_0x5e4528[_0xd27b('0x4d')],{'$or':_[_0xd27b('0x3d')](_0x5e4528['attributes'],function(_0x42ed39){var _0x5a7601={};_0x5a7601[_0x42ed39]={'$like':'%'+_0x23b5c2[_0xd27b('0x41')]['filter']+'%'};return _0x5a7601;})});}_0x5e4528=_[_0xd27b('0x50')]({},_0x5e4528,_0x23b5c2[_0xd27b('0x58')]);return _0x1f21b2[_0xd27b('0x7e')](_0x5e4528);}})[_0xd27b('0x1f')](function(_0x57575a){if(_0x57575a){_0x3ce6ee=_0x57575a[_0xd27b('0x48')];if(!_0x23b5c2[_0xd27b('0x41')][_0xd27b('0x49')](_0xd27b('0x4a'))){_0x5e4528['limit']=qs['limit'](_0x23b5c2[_0xd27b('0x41')][_0xd27b('0x31')]);_0x5e4528[_0xd27b('0x2f')]=qs[_0xd27b('0x2f')](_0x23b5c2[_0xd27b('0x41')][_0xd27b('0x2f')]);}return _0x1f21b2[_0xd27b('0x7e')](_0x5e4528);}})[_0xd27b('0x1f')](function(_0x30dfcb){if(_0x30dfcb){return _0x30dfcb?{'count':_0x3ce6ee,'rows':_0x30dfcb}:null;}})[_0xd27b('0x1f')](respondWithResult(_0x19428f,null))[_0xd27b('0x2a')](handleError(_0x19428f,null));};exports[_0xd27b('0x7f')]=function(_0x3762f5,_0x3bfafe,_0x338814){var _0x3f13f0={'channel':'whatsapp'};var _0x2e867e=[];var _0x35ded1=[];var _0x4425e8={};return db[_0xd27b('0x51')][_0xd27b('0x59')]({'where':{'id':_0x3762f5[_0xd27b('0x57')]['id']},'include':[{'model':db[_0xd27b('0x7b')],'as':_0xd27b('0x80')}]})[_0xd27b('0x1f')](handleEntityNotFound(_0x3bfafe,null))[_0xd27b('0x1f')](function(_0x62816c){_0x3f13f0[_0xd27b('0x81')]=_0x62816c;if(_0x3f13f0[_0xd27b('0x81')]&&_0x3f13f0['account'][_0xd27b('0x3f')]==='sinch'&&_0x3762f5[_0xd27b('0x5a')][_0xd27b('0x82')]){if(_0x3762f5[_0xd27b('0x5a')][_0xd27b('0x82')][_0xd27b('0x48')]===0x0)return;if(_0x3762f5['body'][_0xd27b('0x82')][0x0][_0xd27b('0x83')]!==_0xd27b('0x84'))return;return db[_0xd27b('0x85')][_0xd27b('0x86')]({'read':!![],'readAt':_0x3762f5['body'][_0xd27b('0x82')][0x0][_0xd27b('0x87')]},{'where':{'messageId':_0x3762f5['body'][_0xd27b('0x82')][0x0][_0xd27b('0x88')]},'individualHooks':!![]})[_0xd27b('0x1f')](function(_0x46cab0){return _0x3bfafe[_0xd27b('0x2c')](0xc8)[_0xd27b('0x2e')](_0x46cab0);});}_0x3f13f0['applications']=_[_0xd27b('0x89')](_0x62816c[_0xd27b('0x80')],[_0xd27b('0x8a')],[_0xd27b('0x8b')]);if(_0x3f13f0[_0xd27b('0x81')][_0xd27b('0x80')]){delete _0x3f13f0[_0xd27b('0x81')][_0xd27b('0x80')];}return db[_0xd27b('0x8c')][_0xd27b('0x62')]()[_0xd27b('0x1f')](function(_0xace37c){if(!_0xace37c){throw new db[(_0xd27b('0x8d'))][(_0xd27b('0x8e'))](_0xd27b('0x8f'));}_0x2e867e=_[_0xd27b('0x90')](_[_0xd27b('0x42')](_0xace37c),[_0xd27b('0x91'),_0xd27b('0x92')]);_0x35ded1=_[_0xd27b('0x90')](_['keys'](_0xace37c),[_0xd27b('0x91'),'updatedAt',_0xd27b('0x93'),_0xd27b('0x94')]);_0x3f13f0[_0xd27b('0x5a')]={'mapKey':_0xd27b('0x95')};if(_0x3f13f0['account']&&_0x3f13f0[_0xd27b('0x81')][_0xd27b('0x3f')]===_0xd27b('0x96')){_0x3f13f0[_0xd27b('0x5a')][_0xd27b('0x97')]=_0x3762f5[_0xd27b('0x5a')][_0xd27b('0x98')]['replace'](_0xd27b('0x99'),'');_0x3f13f0['body'][_0xd27b('0x5a')]=_0x3762f5[_0xd27b('0x5a')][_0xd27b('0x9a')];_0x3f13f0[_0xd27b('0x5a')]['messageId']=_0x3762f5[_0xd27b('0x5a')][_0xd27b('0x9b')];}if(_0x3f13f0['account']&&_0x3f13f0[_0xd27b('0x81')][_0xd27b('0x3f')]===_0xd27b('0x9c')){_0x3f13f0[_0xd27b('0x5a')][_0xd27b('0x97')]=_0x3762f5['body'][_0xd27b('0x9d')][0x0][_0xd27b('0x97')];_0x3f13f0['body'][_0xd27b('0x5a')]=_0x3762f5['body']['notifications'][0x0][_0xd27b('0x28')][_0xd27b('0x5a')];_0x3f13f0['body']['messageId']=_0x3762f5[_0xd27b('0x5a')][_0xd27b('0x9d')][0x0]['message_id'];}if(_0x3f13f0[_0xd27b('0x5a')]['id']){delete _0x3f13f0[_0xd27b('0x5a')]['id'];}if(_[_0xd27b('0x9e')](_0x3f13f0[_0xd27b('0x5a')][_0xd27b('0x97')])){throw new db[(_0xd27b('0x8d'))]['ValidationError'](_0xd27b('0x9f'));}if(_[_0xd27b('0x9e')](_0x3f13f0['body']['body'])||_0x3f13f0['body']['body']===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x3f13f0[_0xd27b('0x5a')][_0xd27b('0xa0')])){throw new db[(_0xd27b('0x8d'))][(_0xd27b('0x8e'))](_0xd27b('0xa1')+_0x35ded1);}if(!_['includes'](_0x35ded1,_0x3f13f0[_0xd27b('0x5a')][_0xd27b('0xa0')])){throw new db['Sequelize'][(_0xd27b('0x8e'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x35ded1);}_0x4425e8[_0x3f13f0[_0xd27b('0x5a')]['mapKey']]=_0x3f13f0[_0xd27b('0x5a')][_0xd27b('0x97')];return db['CmList'][_0xd27b('0x59')]({'where':{'id':_0x3f13f0[_0xd27b('0x81')][_0xd27b('0x94')]},'include':[{'model':db[_0xd27b('0x8c')],'as':_0xd27b('0xa2'),'where':_0x4425e8,'limit':0x1,'order':[[_0xd27b('0x92'),_0xd27b('0xa3')]]}]});})[_0xd27b('0x1f')](handleEntityNotFound(_0x3bfafe,null))['then'](function(_0x86a44b){if(_0x86a44b){_0x3f13f0[_0xd27b('0xa4')]=_[_0xd27b('0x6e')](_0x86a44b,[_0xd27b('0xa2')]);if(_0x86a44b[_0xd27b('0xa2')]['length']){return _0x86a44b[_0xd27b('0xa2')][0x0];}var _0x4a60ab=_[_0xd27b('0x19')](_0x3f13f0[_0xd27b('0x5a')],{'firstName':_0x3f13f0['body'][_0xd27b('0x97')],'ListId':_0x86a44b['id']});_0x4a60ab[_0x3f13f0[_0xd27b('0x5a')][_0xd27b('0xa0')]]=_0x3f13f0[_0xd27b('0x5a')][_0xd27b('0x97')];return db[_0xd27b('0x8c')][_0xd27b('0x60')](_0x4a60ab,{'fields':_0x2e867e,'raw':!![]});}})[_0xd27b('0x1f')](handleEntityNotFound(_0x3bfafe,null))[_0xd27b('0x1f')](function(_0x12a56b){if(_0x12a56b){_0x3f13f0[_0xd27b('0xa5')]=_0x12a56b;var _0x1fc38e={'ContactId':_0x12a56b['id'],'phone':_0x3f13f0['body'][_0xd27b('0x97')],'WhatsappAccountId':_0x3762f5[_0xd27b('0x57')]['id']};var _0x4d1686={'ContactId':_0x12a56b['id'],'WhatsappAccountId':_0x3762f5['params']['id'],'closed':![]};return db[_0xd27b('0xa6')][_0xd27b('0x59')]({'where':_0x4d1686})['then'](function(_0x4c9551){if(_0x4c9551){return[_0x4c9551,![]];}return db[_0xd27b('0xa6')][_0xd27b('0x60')](_0x1fc38e)[_0xd27b('0x1f')](function(_0x514c4a){return[_0x514c4a,!![]];});});}})[_0xd27b('0xa7')](function(_0x52bd85,_0x4cf7c6){_0x3f13f0[_0xd27b('0xa8')]=_0x52bd85[_0xd27b('0x5c')]({'plain':!![]});_0x3f13f0['interaction'][_0xd27b('0xa9')]=![];if(_0x4cf7c6){if(_0x3f13f0[_0xd27b('0x81')]['autoclose']){_0x3f13f0[_0xd27b('0xaa')][_0xd27b('0xab')]({'id':0x0,'priority':_0x3f13f0['applications'][_0xd27b('0x48')]+0x1,'app':_0xd27b('0xac'),'appdata':_0xd27b('0xad'),'interval':_0xd27b('0xae')});}_0x3f13f0[_0xd27b('0xa8')]['created']=!![];}return db[_0xd27b('0x85')][_0xd27b('0x60')]({'phone':_0x3f13f0[_0xd27b('0x5a')][_0xd27b('0x97')],'messageId':_0x3f13f0[_0xd27b('0x5a')]['messageId'],'body':_0x3f13f0[_0xd27b('0x5a')][_0xd27b('0x5a')],'WhatsappAccountId':_0x3762f5['params']['id'],'WhatsappInteractionId':_0x52bd85['id'],'direction':'in','ContactId':_0x52bd85[_0xd27b('0xaf')],'AttachmentId':_0x3f13f0[_0xd27b('0x5a')][_0xd27b('0xb0')]});})[_0xd27b('0x1f')](function(_0x4ce924){_0x3f13f0['message']=_0x4ce924;if(!_0x3f13f0[_0xd27b('0xa8')]['UserId'])return;return db[_0xd27b('0x75')]['find']({'attributes':['id',_0xd27b('0x38')],'where':{'id':_0x3f13f0[_0xd27b('0xa8')][_0xd27b('0xb1')]}});})[_0xd27b('0x1f')](function(_0xc319f6){if(_0xc319f6){_0x3f13f0[_0xd27b('0xaa')][_0xd27b('0xb2')]({'id':0x0,'priority':0x0,'app':_0xd27b('0xb3'),'appdata':_0xc319f6[_0xd27b('0x38')]+','+(_0x3f13f0[_0xd27b('0x81')]['waitForTheAssignedAgent']||0xa),'interval':_0xd27b('0xae')});}if(!_0x3f13f0[_0xd27b('0xa8')][_0xd27b('0xb4')])return;return db[_0xd27b('0xb5')][_0xd27b('0x59')]({'attributes':['id',_0xd27b('0x38')],'where':{'id':_0x3f13f0[_0xd27b('0xa8')][_0xd27b('0xb4')]}});})[_0xd27b('0x1f')](function(_0x5edd2f){if(_0x5edd2f){_0x3f13f0[_0xd27b('0xaa')][_0xd27b('0xb2')]({'id':0x0,'priority':0x1,'app':_0xd27b('0xb6'),'appdata':_0x5edd2f[_0xd27b('0x38')]+','+(_0x3f13f0[_0xd27b('0x81')]['waitForTheAssignedQueue']||0x12c),'interval':_0xd27b('0xae')});}return respondWithRpcPromise(_0xd27b('0xb7'),_0xd27b('0xb8'),_0x3f13f0);})[_0xd27b('0x1f')](function(_0x52c1ec){if(_0x52c1ec){var _0x4a8dcc=0xc8;var _0x5a36ae=_0xd27b('0xb9');logger[_0xd27b('0x20')](_0xd27b('0x24'),_0x5a36ae,_0x4a8dcc,'entity\x20found');logger['debug'](_0xd27b('0xba'),_0x5a36ae,_0x4a8dcc,'entity\x20found',JSON[_0xd27b('0x25')](_0x52c1ec));if(_0x3f13f0['account']['type']===_0xd27b('0x96')){return _0x3bfafe[_0xd27b('0x2c')](_0x4a8dcc)[_0xd27b('0xbb')](_0xd27b('0xbc'),_0xd27b('0xbd'))[_0xd27b('0x39')](_0xd27b('0xbe'));}else{return _0x3bfafe['status'](_0x4a8dcc)[_0xd27b('0x2e')](_0x52c1ec);}}});})[_0xd27b('0x2a')](handleError(_0x3bfafe,null));};exports['send']=function(_0x516259,_0x2525dc,_0x59b3f5){var _0x1de3a8,_0x9a4419,_0x5bcf6a;if(_[_0xd27b('0x9e')](_0x516259[_0xd27b('0x5a')][_0xd27b('0x5a')])||_0x516259[_0xd27b('0x5a')][_0xd27b('0x5a')]===''){throw new db[(_0xd27b('0x8d'))][(_0xd27b('0x8e'))](_0xd27b('0xbf'));}if(_['isNil'](_0x516259['body']['to'])){throw new db['Sequelize'][(_0xd27b('0x8e'))](_0xd27b('0xc0'));}_0x1de3a8=_0x516259['body']['to'];return db[_0xd27b('0x51')][_0xd27b('0x59')]({'where':{'id':_0x516259[_0xd27b('0x57')]['id']},'include':[{'model':db[_0xd27b('0xc1')],'as':_0xd27b('0xc2'),'include':[{'model':db[_0xd27b('0x8c')],'as':_0xd27b('0xa2'),'where':{'mobile':_0x1de3a8},'limit':0x1,'order':[[_0xd27b('0x92'),_0xd27b('0xa3')]]}]}]})[_0xd27b('0x1f')](handleEntityNotFound(_0x2525dc,null))['then'](function(_0x1de2e8){if(_0x1de2e8&&_0x1de2e8['List']){_0x9a4419=_0x1de2e8[_0xd27b('0x5c')]({'plain':!![]});if(_0x9a4419[_0xd27b('0xc2')]&&_0x9a4419['List']['Contacts'][_0xd27b('0x48')]){return _0x9a4419[_0xd27b('0xc2')]['Contacts'][0x0];}return db['CmContact']['create'](_[_0xd27b('0x19')](_0x516259['body'],{'firstName':_0x1de3a8,'mobile':_0x1de3a8,'phone':_0x1de3a8,'ListId':_0x9a4419[_0xd27b('0x94')]}));}})[_0xd27b('0x1f')](handleEntityNotFound(_0x2525dc,null))['then'](function(_0x4b539e){if(_0x4b539e){_0x5bcf6a=_0x4b539e;return db[_0xd27b('0xa6')][_0xd27b('0x59')]({'where':{'ContactId':_0x5bcf6a['id'],'closed':![],'WhatsappAccountId':_0x9a4419['id']}})['then'](function(_0x22e741){if(_0x22e741){return[_0x22e741,![]];}return db[_0xd27b('0xa6')]['create']({'UserId':_0x516259[_0xd27b('0x5b')]['id'],'ContactId':_0x5bcf6a['id'],'WhatsappAccountId':_0x9a4419['id'],'phone':_0x1de3a8,'firstMsgDirection':_0xd27b('0xc3'),'Messages':[_[_0xd27b('0x50')](_0x516259[_0xd27b('0x5a')],{'read':![],'body':_0x516259[_0xd27b('0x5a')]['body'],'phone':_0x1de3a8,'WhatsappAccountId':_0x9a4419['id'],'UserId':_0x516259['user']['id'],'ContactId':_0x5bcf6a['id']})]},{'include':[{'model':db[_0xd27b('0x85')],'as':_0xd27b('0xc4')}]})[_0xd27b('0x1f')](function(_0x465b1b){return[_0x465b1b,!![]];});});}})[_0xd27b('0xa7')](function(_0x1c882a,_0x56759b){if(_0x56759b){return _0x1c882a;}return db[_0xd27b('0x85')][_0xd27b('0x60')](_['merge'](_0x516259[_0xd27b('0x5a')],{'read':![],'body':_0x516259[_0xd27b('0x5a')][_0xd27b('0x5a')],'phone':_0x1de3a8,'WhatsappAccountId':_0x9a4419['id'],'WhatsappInteractionId':_0x1c882a['id'],'UserId':_0x516259['user']['id'],'ContactId':_0x5bcf6a['id']}))[_0xd27b('0x1f')](function(_0x505724){_0x1c882a[_0xd27b('0xc5')][_0xd27b('0xc4')]=[];_0x1c882a['dataValues'][_0xd27b('0xc4')][_0xd27b('0xab')](_0x505724[_0xd27b('0xc5')]);return _0x1c882a;});})[_0xd27b('0x1f')](respondWithResult(_0x2525dc,null))[_0xd27b('0x2a')](handleError(_0x2525dc,null));}; \ No newline at end of file +var _0x8c11=['message_id','applications','orderBy','Sequelize','ValidationError','difference','createdAt','updatedAt','ListId','mobile','twilio','from','replace','whatsapp:','messageId','MessageSid','notifications','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','list','contact','WhatsappInteraction','spread','interaction','autoclose','push','close','unmanaged','created','ContactId','AttachmentId','UserId','*,*,*,*','queueId','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','entity\x20found','stringify','text/xml','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','./whatsappAccount.socket','register','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','error','message','result','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','get','WhatsappAccounts','UserProfileResource','destroy','end','stack','name','send','Pause','mandatoryDispositionPause','map','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','type','VIRTUAL','options','WhatsappAccount','includeAll','findAll','rows','catch','show','params','include','merge','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','describe','WhatsappAccountId','Disposition','rawAttributes','hasOwnProperty','filter','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','pick','removeAnswers','addAgents','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','User','addApplications','transaction','sequelize','Transaction','READ_COMMITTED','WhatsappApplication','priority','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp'];(function(_0x4e8403,_0x2f04c1){var _0x245e4f=function(_0x3f0814){while(--_0x3f0814){_0x4e8403['push'](_0x4e8403['shift']());}};_0x245e4f(++_0x2f04c1);}(_0x8c11,0xf5));var _0x18c1=function(_0x5ba5e4,_0x64c96f){_0x5ba5e4=_0x5ba5e4-0x0;var _0x18b643=_0x8c11[_0x5ba5e4];return _0x18b643;};'use strict';var emlformat=require(_0x18c1('0x0'));var rimraf=require(_0x18c1('0x1'));var zipdir=require(_0x18c1('0x2'));var jsonpatch=require(_0x18c1('0x3'));var rp=require(_0x18c1('0x4'));var moment=require(_0x18c1('0x5'));var BPromise=require(_0x18c1('0x6'));var Mustache=require('mustache');var util=require(_0x18c1('0x7'));var path=require(_0x18c1('0x8'));var sox=require(_0x18c1('0x9'));var csv=require(_0x18c1('0xa'));var ejs=require(_0x18c1('0xb'));var fs=require('fs');var fs_extra=require(_0x18c1('0xc'));var _=require(_0x18c1('0xd'));var squel=require(_0x18c1('0xe'));var crypto=require('crypto');var jsforce=require(_0x18c1('0xf'));var deskjs=require(_0x18c1('0x10'));var toCsv=require('to-csv');var querystring=require(_0x18c1('0x11'));var Papa=require(_0x18c1('0x12'));var Redis=require(_0x18c1('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x18c1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x18c1('0x15'))(_0x18c1('0x16'));var utils=require(_0x18c1('0x17'));var config=require(_0x18c1('0x18'));var licenseUtil=require(_0x18c1('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x18c1('0x1a')](config[_0x18c1('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x18c1('0x1b')]));require(_0x18c1('0x1c'))[_0x18c1('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x7e1efb,_0x118952,_0xf5817c,_0x142974){return new BPromise(function(_0x50c969,_0x459947){var _0x6306f1=_0x142974||client;return _0x6306f1[_0x18c1('0x1e')](_0x7e1efb,_0xf5817c)['then'](function(_0x253964){logger[_0x18c1('0x1f')](_0x18c1('0x20'),_0x118952,_0x18c1('0x21'));logger[_0x18c1('0x22')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x118952,_0x18c1('0x21'),JSON['stringify'](_0x253964));if(_0x253964[_0x18c1('0x23')]){if(_0x253964['error']['code']===0x1f4){logger[_0x18c1('0x23')](_0x18c1('0x20'),_0x118952,_0x253964[_0x18c1('0x23')][_0x18c1('0x24')]);return _0x459947(_0x253964[_0x18c1('0x23')]['message']);}logger[_0x18c1('0x23')](_0x18c1('0x20'),_0x118952,_0x253964['error']['message']);return _0x50c969(_0x253964[_0x18c1('0x23')][_0x18c1('0x24')]);}else{logger[_0x18c1('0x1f')](_0x18c1('0x20'),_0x118952,_0x18c1('0x21'));_0x50c969(_0x253964[_0x18c1('0x25')][_0x18c1('0x24')]);}})['catch'](function(_0x24c1e4){logger[_0x18c1('0x23')](_0x18c1('0x20'),_0x118952,_0x24c1e4);_0x459947(_0x24c1e4);});});}function respondWithStatusCode(_0x40e1e1,_0x1498e9){_0x1498e9=_0x1498e9||0xcc;return function(_0x211a1f){if(_0x211a1f){return _0x40e1e1[_0x18c1('0x26')](_0x1498e9);}return _0x40e1e1[_0x18c1('0x27')](_0x1498e9)['end']();};}function respondWithResult(_0x1f198c,_0x5b8d67){_0x5b8d67=_0x5b8d67||0xc8;return function(_0x504047){if(_0x504047){return _0x1f198c['status'](_0x5b8d67)['json'](_0x504047);}};}function respondWithFilteredResult(_0x26d649,_0x195dc9){return function(_0x2e2988){if(_0x2e2988){var _0x1d3ffc=typeof _0x195dc9[_0x18c1('0x28')]===_0x18c1('0x29')&&typeof _0x195dc9['limit']===_0x18c1('0x29');var _0x19b10a=_0x2e2988[_0x18c1('0x2a')];var _0x228850=_0x1d3ffc?0x0:_0x195dc9[_0x18c1('0x28')];var _0xdfcb2=_0x1d3ffc?_0x2e2988[_0x18c1('0x2a')]:_0x195dc9['offset']+_0x195dc9[_0x18c1('0x2b')];var _0x1431f3;if(_0xdfcb2>=_0x19b10a){_0xdfcb2=_0x19b10a;_0x1431f3=0xc8;}else{_0x1431f3=0xce;}_0x26d649[_0x18c1('0x27')](_0x1431f3);return _0x26d649[_0x18c1('0x2c')](_0x18c1('0x2d'),_0x228850+'-'+_0xdfcb2+'/'+_0x19b10a)[_0x18c1('0x2e')](_0x2e2988);}return null;};}function patchUpdates(_0x2fe8d7){return function(_0x7b41ae){try{jsonpatch['apply'](_0x7b41ae,_0x2fe8d7,!![]);}catch(_0xb0a211){return BPromise[_0x18c1('0x2f')](_0xb0a211);}return _0x7b41ae[_0x18c1('0x30')]();};}function saveUpdates(_0x3683bb,_0x78736f){return function(_0x26fa93){if(_0x26fa93){return _0x26fa93[_0x18c1('0x31')](_0x3683bb)[_0x18c1('0x32')](function(_0x54bc73){return _0x54bc73;});}return null;};}function removeEntity(_0x2c8874,_0x2332c5){return function(_0x19d2ea){if(_0x19d2ea){return _0x19d2ea['destroy']()[_0x18c1('0x32')](function(){var _0x31405e=_0x19d2ea[_0x18c1('0x33')]({'plain':!![]});var _0x4f87b0=_0x18c1('0x34');return db[_0x18c1('0x35')][_0x18c1('0x36')]({'where':{'type':_0x4f87b0,'resourceId':_0x31405e['id']}})[_0x18c1('0x32')](function(){return _0x19d2ea;});})['then'](function(){_0x2c8874[_0x18c1('0x27')](0xcc)[_0x18c1('0x37')]();});}};}function handleEntityNotFound(_0x3d59c6,_0x344c8){return function(_0x8e213d){if(!_0x8e213d){_0x3d59c6['sendStatus'](0x194);}return _0x8e213d;};}function handleError(_0x33d108,_0x523cfa){_0x523cfa=_0x523cfa||0x1f4;return function(_0x98428e){logger['error'](_0x98428e[_0x18c1('0x38')]);if(_0x98428e[_0x18c1('0x39')]){delete _0x98428e['name'];}_0x33d108[_0x18c1('0x27')](_0x523cfa)[_0x18c1('0x3a')](_0x98428e);};}exports['index']=function(_0x558fde,_0x1dc89a){var _0x5eee5b={'include':[{'model':db[_0x18c1('0x3b')],'as':_0x18c1('0x3c')}]},_0x5bbeec={},_0x15e234={'count':0x0,'rows':[]};var _0x1b0113=_[_0x18c1('0x3d')](db['WhatsappAccount']['rawAttributes'],function(_0xd37174){return{'name':_0xd37174[_0x18c1('0x3e')],'type':_0xd37174['type'][_0x18c1('0x3f')]};});_0x5bbeec[_0x18c1('0x40')]=_[_0x18c1('0x3d')](_0x1b0113,_0x18c1('0x39'));_0x5bbeec[_0x18c1('0x41')]=_[_0x18c1('0x42')](_0x558fde['query']);_0x5bbeec[_0x18c1('0x43')]=_['intersection'](_0x5bbeec[_0x18c1('0x40')],_0x5bbeec['query']);_0x5eee5b[_0x18c1('0x44')]=_[_0x18c1('0x45')](_0x5bbeec['model'],qs[_0x18c1('0x46')](_0x558fde[_0x18c1('0x41')][_0x18c1('0x46')]));_0x5eee5b[_0x18c1('0x44')]=_0x5eee5b[_0x18c1('0x44')][_0x18c1('0x47')]?_0x5eee5b['attributes']:_0x5bbeec[_0x18c1('0x40')];if(!_0x558fde['query']['hasOwnProperty'](_0x18c1('0x48'))){_0x5eee5b[_0x18c1('0x2b')]=qs[_0x18c1('0x2b')](_0x558fde['query'][_0x18c1('0x2b')]);_0x5eee5b[_0x18c1('0x28')]=qs[_0x18c1('0x28')](_0x558fde[_0x18c1('0x41')][_0x18c1('0x28')]);}_0x5eee5b[_0x18c1('0x49')]=qs[_0x18c1('0x4a')](_0x558fde[_0x18c1('0x41')][_0x18c1('0x4a')]);_0x5eee5b[_0x18c1('0x4b')]=qs[_0x18c1('0x43')](_['pick'](_0x558fde[_0x18c1('0x41')],_0x5bbeec[_0x18c1('0x43')]),_0x1b0113);if(_0x558fde[_0x18c1('0x41')]['filter']){_0x5eee5b[_0x18c1('0x4b')]=_['merge'](_0x5eee5b[_0x18c1('0x4b')],{'$or':_[_0x18c1('0x3d')](_0x1b0113,function(_0x28f0e6){if(_0x28f0e6[_0x18c1('0x4c')]!==_0x18c1('0x4d')){var _0x2795e6={};_0x2795e6[_0x28f0e6[_0x18c1('0x39')]]={'$like':'%'+_0x558fde[_0x18c1('0x41')]['filter']+'%'};return _0x2795e6;}})});}_0x5eee5b=_['merge']({},_0x5eee5b,_0x558fde[_0x18c1('0x4e')]);var _0x140fd8={'where':_0x5eee5b[_0x18c1('0x4b')]};return db[_0x18c1('0x4f')][_0x18c1('0x2a')](_0x140fd8)[_0x18c1('0x32')](function(_0x3dfee4){_0x15e234[_0x18c1('0x2a')]=_0x3dfee4;if(_0x558fde[_0x18c1('0x41')][_0x18c1('0x50')]){_0x5eee5b['include']=[{'all':!![]}];}return db['WhatsappAccount'][_0x18c1('0x51')](_0x5eee5b);})[_0x18c1('0x32')](function(_0x4d2fb0){_0x15e234[_0x18c1('0x52')]=_0x4d2fb0;return _0x15e234;})[_0x18c1('0x32')](respondWithFilteredResult(_0x1dc89a,_0x5eee5b))[_0x18c1('0x53')](handleError(_0x1dc89a,null));};exports[_0x18c1('0x54')]=function(_0x102081,_0x179e35){var _0xe7bce7={'raw':![],'where':{'id':_0x102081[_0x18c1('0x55')]['id']},'include':[{'model':db[_0x18c1('0x3b')],'as':'mandatoryDispositionPause'}]},_0x37b26f={};_0x37b26f[_0x18c1('0x40')]=_['keys'](db[_0x18c1('0x4f')]['rawAttributes']);_0x37b26f[_0x18c1('0x41')]=_[_0x18c1('0x42')](_0x102081['query']);_0x37b26f[_0x18c1('0x43')]=_[_0x18c1('0x45')](_0x37b26f[_0x18c1('0x40')],_0x37b26f[_0x18c1('0x41')]);_0xe7bce7[_0x18c1('0x44')]=_[_0x18c1('0x45')](_0x37b26f[_0x18c1('0x40')],qs[_0x18c1('0x46')](_0x102081[_0x18c1('0x41')][_0x18c1('0x46')]));_0xe7bce7[_0x18c1('0x44')]=_0xe7bce7['attributes'][_0x18c1('0x47')]?_0xe7bce7[_0x18c1('0x44')]:_0x37b26f[_0x18c1('0x40')];if(_0x102081[_0x18c1('0x41')]['includeAll']){_0xe7bce7[_0x18c1('0x56')]=[{'all':!![]}];}_0xe7bce7=_[_0x18c1('0x57')]({},_0xe7bce7,_0x102081[_0x18c1('0x4e')]);return db[_0x18c1('0x4f')][_0x18c1('0x58')](_0xe7bce7)[_0x18c1('0x32')](handleEntityNotFound(_0x179e35,null))[_0x18c1('0x32')](respondWithResult(_0x179e35,null))[_0x18c1('0x53')](handleError(_0x179e35,null));};exports[_0x18c1('0x59')]=function(_0x45f36a,_0x44d4ce){return db[_0x18c1('0x4f')][_0x18c1('0x59')](_0x45f36a[_0x18c1('0x5a')],{})[_0x18c1('0x32')](function(_0x582cb2){var _0x9c0b02=_0x45f36a[_0x18c1('0x5b')][_0x18c1('0x33')]({'plain':!![]});if(!_0x9c0b02)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x9c0b02[_0x18c1('0x5c')]===_0x18c1('0x5b')){var _0x4d6ab8=_0x582cb2['get']({'plain':!![]});var _0x3d8f2b=_0x18c1('0x34');return db[_0x18c1('0x5d')][_0x18c1('0x58')]({'where':{'name':_0x3d8f2b,'userProfileId':_0x9c0b02[_0x18c1('0x5e')]},'raw':!![]})[_0x18c1('0x32')](function(_0x537897){if(_0x537897&&_0x537897[_0x18c1('0x5f')]===0x0){return db['UserProfileResource'][_0x18c1('0x59')]({'name':_0x4d6ab8[_0x18c1('0x39')],'resourceId':_0x4d6ab8['id'],'type':_0x537897['name'],'sectionId':_0x537897['id']},{})['then'](function(){return _0x582cb2;});}else{return _0x582cb2;}})[_0x18c1('0x53')](function(_0x135354){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x135354);throw _0x135354;});}return _0x582cb2;})[_0x18c1('0x32')](respondWithResult(_0x44d4ce,0xc9))['catch'](handleError(_0x44d4ce,null));};exports['update']=function(_0xba9ac1,_0x3a26c7){if(_0xba9ac1[_0x18c1('0x5a')]['id']){delete _0xba9ac1[_0x18c1('0x5a')]['id'];}return db[_0x18c1('0x4f')][_0x18c1('0x58')]({'where':{'id':_0xba9ac1['params']['id']},'include':[{'model':db['Pause'],'as':_0x18c1('0x3c')}]})[_0x18c1('0x32')](handleEntityNotFound(_0x3a26c7,null))[_0x18c1('0x32')](saveUpdates(_0xba9ac1[_0x18c1('0x5a')],null))[_0x18c1('0x32')](respondWithResult(_0x3a26c7,null))[_0x18c1('0x53')](handleError(_0x3a26c7,null));};exports[_0x18c1('0x36')]=function(_0x374377,_0x521a6d){return db[_0x18c1('0x4f')][_0x18c1('0x58')]({'where':{'id':_0x374377[_0x18c1('0x55')]['id']}})[_0x18c1('0x32')](handleEntityNotFound(_0x521a6d,null))[_0x18c1('0x32')](removeEntity(_0x521a6d,null))[_0x18c1('0x53')](handleError(_0x521a6d,null));};exports[_0x18c1('0x60')]=function(_0x2be454,_0x4d2aef){return db['WhatsappAccount'][_0x18c1('0x60')]()['then'](respondWithResult(_0x4d2aef,null))[_0x18c1('0x53')](handleError(_0x4d2aef,null));};exports['addDisposition']=function(_0x3a1146,_0x319cf4,_0x592a2c){if(_0x3a1146['body']['id']){delete _0x3a1146['body']['id'];}return db['WhatsappAccount'][_0x18c1('0x58')]({'where':{'id':_0x3a1146[_0x18c1('0x55')]['id']}})[_0x18c1('0x32')](handleEntityNotFound(_0x319cf4,null))[_0x18c1('0x32')](function(_0x4d44b0){if(_0x4d44b0){_0x3a1146['body'][_0x18c1('0x61')]=_0x4d44b0['id'];return db[_0x18c1('0x62')][_0x18c1('0x59')](_0x3a1146[_0x18c1('0x5a')]);}})[_0x18c1('0x32')](respondWithResult(_0x319cf4,null))[_0x18c1('0x53')](handleError(_0x319cf4,null));};exports['getDispositions']=function(_0x1ba277,_0x5a5245,_0x191d70){var _0x5ec772={'raw':![],'where':{}};var _0xbe55de={};var _0x8cbce5={'count':0x0,'rows':[]};return db[_0x18c1('0x4f')]['findOne']({'where':{'id':_0x1ba277[_0x18c1('0x55')]['id']}})['then'](handleEntityNotFound(_0x5a5245,null))['then'](function(_0x1b7379){if(_0x1b7379){_0xbe55de['model']=_['keys'](db['Disposition'][_0x18c1('0x63')]);_0xbe55de[_0x18c1('0x41')]=_[_0x18c1('0x42')](_0x1ba277['query']);_0xbe55de['filters']=_['intersection'](_0xbe55de[_0x18c1('0x40')],_0xbe55de['query']);_0x5ec772[_0x18c1('0x44')]=_['intersection'](_0xbe55de[_0x18c1('0x40')],qs[_0x18c1('0x46')](_0x1ba277[_0x18c1('0x41')]['fields']));_0x5ec772[_0x18c1('0x44')]=_0x5ec772[_0x18c1('0x44')]['length']?_0x5ec772[_0x18c1('0x44')]:_0xbe55de['model'];if(!_0x1ba277['query'][_0x18c1('0x64')]('nolimit')){_0x5ec772[_0x18c1('0x2b')]=qs['limit'](_0x1ba277[_0x18c1('0x41')][_0x18c1('0x2b')]);_0x5ec772['offset']=qs['offset'](_0x1ba277[_0x18c1('0x41')][_0x18c1('0x28')]);}_0x5ec772[_0x18c1('0x49')]=qs[_0x18c1('0x4a')](_0x1ba277[_0x18c1('0x41')][_0x18c1('0x4a')]);_0x5ec772['where']=qs['filters'](_['pick'](_0x1ba277[_0x18c1('0x41')],_0xbe55de[_0x18c1('0x43')]));_0x5ec772[_0x18c1('0x4b')][_0x18c1('0x61')]=_0x1b7379['id'];if(_0x1ba277['query'][_0x18c1('0x65')]){_0x5ec772[_0x18c1('0x4b')]=_['merge'](_0x5ec772[_0x18c1('0x4b')],{'$or':_[_0x18c1('0x3d')](_0x5ec772[_0x18c1('0x44')],function(_0x15a3f6){var _0x29e3b5={};_0x29e3b5[_0x15a3f6]={'$like':'%'+_0x1ba277[_0x18c1('0x41')]['filter']+'%'};return _0x29e3b5;})});}_0x5ec772=_['merge']({},_0x5ec772,_0x1ba277['options']);return db[_0x18c1('0x62')]['count']({'where':_0x5ec772[_0x18c1('0x4b')]})[_0x18c1('0x32')](function(_0x59e386){_0x8cbce5[_0x18c1('0x2a')]=_0x59e386;if(_0x1ba277[_0x18c1('0x41')]['includeAll']){_0x5ec772[_0x18c1('0x56')]=[{'all':!![]}];}return db[_0x18c1('0x62')][_0x18c1('0x51')](_0x5ec772);})[_0x18c1('0x32')](function(_0x682bcd){_0x8cbce5['rows']=_0x682bcd;return _0x8cbce5;});}})[_0x18c1('0x32')](respondWithFilteredResult(_0x5a5245,_0x5ec772))[_0x18c1('0x53')](handleError(_0x5a5245,null));};exports['removeDispositions']=function(_0x30ddd,_0x27ddb0,_0x27f8f6){return db['WhatsappAccount']['find']({'where':{'id':_0x30ddd[_0x18c1('0x55')]['id']}})['then'](handleEntityNotFound(_0x27ddb0,null))['then'](function(_0x4fc3d6){if(_0x4fc3d6){return _0x4fc3d6[_0x18c1('0x66')](_0x30ddd[_0x18c1('0x41')][_0x18c1('0x67')]);}})[_0x18c1('0x32')](respondWithStatusCode(_0x27ddb0,null))[_0x18c1('0x53')](handleError(_0x27ddb0,null));};exports[_0x18c1('0x68')]=function(_0x4eb066,_0xf40248,_0x4bf306){if(_0x4eb066[_0x18c1('0x5a')]['id']){delete _0x4eb066[_0x18c1('0x5a')]['id'];}return db[_0x18c1('0x4f')][_0x18c1('0x58')]({'where':{'id':_0x4eb066[_0x18c1('0x55')]['id']}})['then'](handleEntityNotFound(_0xf40248,null))[_0x18c1('0x32')](function(_0x3a1f8b){if(_0x3a1f8b){_0x4eb066['body'][_0x18c1('0x61')]=_0x3a1f8b['id'];return db['CannedAnswer']['create'](_0x4eb066[_0x18c1('0x5a')]);}})[_0x18c1('0x32')](respondWithResult(_0xf40248,null))[_0x18c1('0x53')](handleError(_0xf40248,null));};exports[_0x18c1('0x69')]=function(_0x5d3773,_0x2c62ed,_0x728fa9){var _0x5bd92d={'raw':![],'where':{}};var _0x494a07={};var _0x2f382e={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x18c1('0x6a')]({'where':{'id':_0x5d3773[_0x18c1('0x55')]['id']}})['then'](handleEntityNotFound(_0x2c62ed,null))[_0x18c1('0x32')](function(_0x4a3c6){if(_0x4a3c6){_0x494a07['model']=_['keys'](db[_0x18c1('0x6b')][_0x18c1('0x63')]);_0x494a07['query']=_[_0x18c1('0x42')](_0x5d3773[_0x18c1('0x41')]);_0x494a07[_0x18c1('0x43')]=_[_0x18c1('0x45')](_0x494a07[_0x18c1('0x40')],_0x494a07[_0x18c1('0x41')]);_0x5bd92d[_0x18c1('0x44')]=_[_0x18c1('0x45')](_0x494a07[_0x18c1('0x40')],qs[_0x18c1('0x46')](_0x5d3773[_0x18c1('0x41')][_0x18c1('0x46')]));_0x5bd92d[_0x18c1('0x44')]=_0x5bd92d[_0x18c1('0x44')][_0x18c1('0x47')]?_0x5bd92d['attributes']:_0x494a07['model'];if(!_0x5d3773[_0x18c1('0x41')][_0x18c1('0x64')](_0x18c1('0x48'))){_0x5bd92d['limit']=qs[_0x18c1('0x2b')](_0x5d3773[_0x18c1('0x41')][_0x18c1('0x2b')]);_0x5bd92d[_0x18c1('0x28')]=qs[_0x18c1('0x28')](_0x5d3773[_0x18c1('0x41')][_0x18c1('0x28')]);}_0x5bd92d[_0x18c1('0x49')]=qs[_0x18c1('0x4a')](_0x5d3773[_0x18c1('0x41')]['sort']);_0x5bd92d[_0x18c1('0x4b')]=qs[_0x18c1('0x43')](_[_0x18c1('0x6c')](_0x5d3773[_0x18c1('0x41')],_0x494a07['filters']));_0x5bd92d[_0x18c1('0x4b')][_0x18c1('0x61')]=_0x4a3c6['id'];if(_0x5d3773[_0x18c1('0x41')][_0x18c1('0x65')]){_0x5bd92d['where']=_[_0x18c1('0x57')](_0x5bd92d[_0x18c1('0x4b')],{'$or':_['map'](_0x5bd92d[_0x18c1('0x44')],function(_0x57480c){var _0x415631={};_0x415631[_0x57480c]={'$like':'%'+_0x5d3773[_0x18c1('0x41')][_0x18c1('0x65')]+'%'};return _0x415631;})});}_0x5bd92d=_[_0x18c1('0x57')]({},_0x5bd92d,_0x5d3773[_0x18c1('0x4e')]);return db['CannedAnswer']['count']({'where':_0x5bd92d[_0x18c1('0x4b')]})['then'](function(_0x266095){_0x2f382e[_0x18c1('0x2a')]=_0x266095;if(_0x5d3773[_0x18c1('0x41')][_0x18c1('0x50')]){_0x5bd92d[_0x18c1('0x56')]=[{'all':!![]}];}return db[_0x18c1('0x6b')][_0x18c1('0x51')](_0x5bd92d);})[_0x18c1('0x32')](function(_0x177bbe){_0x2f382e['rows']=_0x177bbe;return _0x2f382e;});}})[_0x18c1('0x32')](respondWithFilteredResult(_0x2c62ed,_0x5bd92d))[_0x18c1('0x53')](handleError(_0x2c62ed,null));};exports[_0x18c1('0x6d')]=function(_0xb602af,_0xc9f2c2,_0x1aadc4){return db[_0x18c1('0x4f')][_0x18c1('0x58')]({'where':{'id':_0xb602af[_0x18c1('0x55')]['id']}})[_0x18c1('0x32')](handleEntityNotFound(_0xc9f2c2,null))[_0x18c1('0x32')](function(_0x571039){if(_0x571039){return _0x571039[_0x18c1('0x6d')](_0xb602af[_0x18c1('0x41')]['ids']);}})[_0x18c1('0x32')](respondWithStatusCode(_0xc9f2c2,null))[_0x18c1('0x53')](handleError(_0xc9f2c2,null));};exports['addAgents']=function(_0x44dd12,_0x1d1365,_0xb94295){return db['WhatsappAccount'][_0x18c1('0x58')]({'where':{'id':_0x44dd12[_0x18c1('0x55')]['id']}})[_0x18c1('0x32')](handleEntityNotFound(_0x1d1365,null))['then'](function(_0xfc8a16){if(_0xfc8a16){return _0xfc8a16[_0x18c1('0x6e')](_0x44dd12[_0x18c1('0x5a')][_0x18c1('0x67')],_['omit'](_0x44dd12[_0x18c1('0x5a')],[_0x18c1('0x67'),'id'])||{})['spread'](function(_0x5c94f9){for(var _0x53df84=0x0;_0x53df84<_0x44dd12[_0x18c1('0x5a')]['ids'][_0x18c1('0x47')];_0x53df84+=0x1){socket['emit'](_0x18c1('0x6f'),{'UserId':Number(_0x44dd12['body'][_0x18c1('0x67')][_0x53df84]),'WhatsappAccountId':Number(_0x44dd12[_0x18c1('0x55')]['id'])});}return _0x5c94f9;});}})['then'](respondWithResult(_0x1d1365,null))[_0x18c1('0x53')](handleError(_0x1d1365,null));};exports[_0x18c1('0x70')]=function(_0x3f786a,_0x57dd54,_0x3339a3){return db[_0x18c1('0x4f')][_0x18c1('0x58')]({'where':{'id':_0x3f786a[_0x18c1('0x55')]['id']}})[_0x18c1('0x32')](handleEntityNotFound(_0x57dd54,null))[_0x18c1('0x32')](function(_0x1b3a66){if(_0x1b3a66){return _0x1b3a66[_0x18c1('0x70')](_0x3f786a[_0x18c1('0x41')][_0x18c1('0x67')])[_0x18c1('0x32')](function(){if(_[_0x18c1('0x71')](_0x3f786a[_0x18c1('0x41')][_0x18c1('0x67')])){for(var _0x187a2c=0x0;_0x187a2c<_0x3f786a['query'][_0x18c1('0x67')][_0x18c1('0x47')];_0x187a2c+=0x1){socket[_0x18c1('0x72')](_0x18c1('0x73'),{'UserId':Number(_0x3f786a[_0x18c1('0x41')][_0x18c1('0x67')][_0x187a2c]),'WhatsappAccountId':Number(_0x3f786a['params']['id'])});}}else{socket[_0x18c1('0x72')](_0x18c1('0x73'),{'UserId':Number(_0x3f786a[_0x18c1('0x41')][_0x18c1('0x67')]),'WhatsappAccountId':Number(_0x3f786a[_0x18c1('0x55')]['id'])});}});}})[_0x18c1('0x32')](respondWithStatusCode(_0x57dd54,null))[_0x18c1('0x53')](handleError(_0x57dd54,null));};exports[_0x18c1('0x74')]=function(_0x2b61d2,_0x10676a,_0x4b1008){var _0x8a66b0={};var _0x10a182={};var _0x8a3048;var _0x32fee2;return db[_0x18c1('0x4f')][_0x18c1('0x6a')]({'where':{'id':_0x2b61d2['params']['id']}})[_0x18c1('0x32')](handleEntityNotFound(_0x10676a,null))['then'](function(_0x37257c){if(_0x37257c){_0x8a3048=_0x37257c;_0x10a182[_0x18c1('0x40')]=_[_0x18c1('0x42')](db[_0x18c1('0x75')][_0x18c1('0x63')]);_0x10a182[_0x18c1('0x41')]=_[_0x18c1('0x42')](_0x2b61d2['query']);_0x10a182[_0x18c1('0x43')]=_[_0x18c1('0x45')](_0x10a182[_0x18c1('0x40')],_0x10a182['query']);_0x8a66b0[_0x18c1('0x44')]=_[_0x18c1('0x45')](_0x10a182[_0x18c1('0x40')],qs[_0x18c1('0x46')](_0x2b61d2[_0x18c1('0x41')][_0x18c1('0x46')]));_0x8a66b0['attributes']=_0x8a66b0[_0x18c1('0x44')]['length']?_0x8a66b0[_0x18c1('0x44')]:_0x10a182[_0x18c1('0x40')];_0x8a66b0[_0x18c1('0x49')]=qs[_0x18c1('0x4a')](_0x2b61d2[_0x18c1('0x41')][_0x18c1('0x4a')]);_0x8a66b0[_0x18c1('0x4b')]=qs[_0x18c1('0x43')](_[_0x18c1('0x6c')](_0x2b61d2[_0x18c1('0x41')],_0x10a182[_0x18c1('0x43')]));if(_0x2b61d2['query'][_0x18c1('0x65')]){_0x8a66b0[_0x18c1('0x4b')]=_[_0x18c1('0x57')](_0x8a66b0[_0x18c1('0x4b')],{'$or':_[_0x18c1('0x3d')](_0x8a66b0[_0x18c1('0x44')],function(_0x4ad894){var _0x53e94e={};_0x53e94e[_0x4ad894]={'$like':'%'+_0x2b61d2[_0x18c1('0x41')][_0x18c1('0x65')]+'%'};return _0x53e94e;})});}_0x8a66b0=_[_0x18c1('0x57')]({},_0x8a66b0,_0x2b61d2[_0x18c1('0x4e')]);return _0x8a3048[_0x18c1('0x74')](_0x8a66b0);}})[_0x18c1('0x32')](function(_0x4c8045){if(_0x4c8045){_0x32fee2=_0x4c8045['length'];if(!_0x2b61d2[_0x18c1('0x41')][_0x18c1('0x64')](_0x18c1('0x48'))){_0x8a66b0[_0x18c1('0x2b')]=qs[_0x18c1('0x2b')](_0x2b61d2['query'][_0x18c1('0x2b')]);_0x8a66b0[_0x18c1('0x28')]=qs[_0x18c1('0x28')](_0x2b61d2[_0x18c1('0x41')]['offset']);}return _0x8a3048[_0x18c1('0x74')](_0x8a66b0);}})['then'](function(_0x4ac998){if(_0x4ac998){return _0x4ac998?{'count':_0x32fee2,'rows':_0x4ac998}:null;}})[_0x18c1('0x32')](respondWithResult(_0x10676a,null))[_0x18c1('0x53')](handleError(_0x10676a,null));};exports[_0x18c1('0x76')]=function(_0x22183b,_0x2b57a6){var _0xc41bb9=_0x22183b[_0x18c1('0x55')]['id'];var _0x2c5c66=_0x22183b[_0x18c1('0x5a')];var _0x4c8ef6=0xc8;var _0xf0306d=null;return db['sequelize'][_0x18c1('0x77')]({'isolationLevel':db[_0x18c1('0x78')][_0x18c1('0x79')]['ISOLATION_LEVELS'][_0x18c1('0x7a')]},function(_0x1fee64){return db[_0x18c1('0x4f')][_0x18c1('0x6a')]({'where':{'id':_0xc41bb9},'transaction':_0x1fee64})['then'](function(_0x310e47){if(_0x310e47){return db['WhatsappApplication'][_0x18c1('0x36')]({'where':{'WhatsappAccountId':_0xc41bb9},'transaction':_0x1fee64})[_0x18c1('0x32')](function(){var _0x323d2e=_['map'](_0x2c5c66,function(_0x28df1d){_0x28df1d[_0x18c1('0x61')]=_0xc41bb9;return _0x28df1d;});return db[_0x18c1('0x7b')]['bulkCreate'](_0x323d2e,{'transaction':_0x1fee64});});}else{_0x4c8ef6=0x194;_0xf0306d=[];}});})[_0x18c1('0x32')](function(){if(_0x4c8ef6!==0x194){return db['WhatsappApplication']['findAndCountAll']({'where':{'WhatsappAccountId':_0xc41bb9},'order':_0x18c1('0x7c')})[_0x18c1('0x32')](function(_0x2ee37b){_0xf0306d=_0x2ee37b;});}})[_0x18c1('0x53')](function(_0x39a397){_0x4c8ef6=0x1f4;logger[_0x18c1('0x23')](_0x39a397[_0x18c1('0x38')]);if(_0x39a397['name']){delete _0x39a397[_0x18c1('0x39')];}_0xf0306d=_0x39a397;})[_0x18c1('0x7d')](function(){if(_0xf0306d===null){_0x2b57a6[_0x18c1('0x26')](_0x4c8ef6);}else{if(_0x4c8ef6===0x1f4){_0x2b57a6[_0x18c1('0x27')](_0x4c8ef6)[_0x18c1('0x3a')](_0xf0306d);}else{_0x2b57a6[_0x18c1('0x27')](_0x4c8ef6)[_0x18c1('0x2e')](_0xf0306d);}}});};exports[_0x18c1('0x7e')]=function(_0xa2ed50,_0x1cd42a,_0x96eeb6){var _0x2ca680={};var _0x4cccf6={};var _0x30ef86;var _0x1df8d6;return db[_0x18c1('0x4f')][_0x18c1('0x6a')]({'where':{'id':_0xa2ed50['params']['id']}})['then'](handleEntityNotFound(_0x1cd42a,null))['then'](function(_0x2c91d2){if(_0x2c91d2){_0x30ef86=_0x2c91d2;_0x4cccf6['model']=_[_0x18c1('0x42')](db[_0x18c1('0x7b')][_0x18c1('0x63')]);_0x4cccf6['query']=_[_0x18c1('0x42')](_0xa2ed50[_0x18c1('0x41')]);_0x4cccf6[_0x18c1('0x43')]=_['intersection'](_0x4cccf6[_0x18c1('0x40')],_0x4cccf6[_0x18c1('0x41')]);_0x2ca680[_0x18c1('0x44')]=_[_0x18c1('0x45')](_0x4cccf6[_0x18c1('0x40')],qs[_0x18c1('0x46')](_0xa2ed50[_0x18c1('0x41')][_0x18c1('0x46')]));_0x2ca680[_0x18c1('0x44')]=_0x2ca680[_0x18c1('0x44')][_0x18c1('0x47')]?_0x2ca680[_0x18c1('0x44')]:_0x4cccf6[_0x18c1('0x40')];_0x2ca680[_0x18c1('0x49')]=qs[_0x18c1('0x4a')](_0xa2ed50[_0x18c1('0x41')][_0x18c1('0x4a')]);_0x2ca680[_0x18c1('0x4b')]=qs[_0x18c1('0x43')](_[_0x18c1('0x6c')](_0xa2ed50[_0x18c1('0x41')],_0x4cccf6[_0x18c1('0x43')]));if(_0xa2ed50[_0x18c1('0x41')][_0x18c1('0x65')]){_0x2ca680[_0x18c1('0x4b')]=_[_0x18c1('0x57')](_0x2ca680['where'],{'$or':_['map'](_0x2ca680[_0x18c1('0x44')],function(_0xb4f4ab){var _0x4c5df3={};_0x4c5df3[_0xb4f4ab]={'$like':'%'+_0xa2ed50[_0x18c1('0x41')]['filter']+'%'};return _0x4c5df3;})});}_0x2ca680=_['merge']({},_0x2ca680,_0xa2ed50[_0x18c1('0x4e')]);return _0x30ef86[_0x18c1('0x7e')](_0x2ca680);}})[_0x18c1('0x32')](function(_0x419197){if(_0x419197){_0x1df8d6=_0x419197[_0x18c1('0x47')];if(!_0xa2ed50[_0x18c1('0x41')]['hasOwnProperty'](_0x18c1('0x48'))){_0x2ca680[_0x18c1('0x2b')]=qs['limit'](_0xa2ed50[_0x18c1('0x41')][_0x18c1('0x2b')]);_0x2ca680[_0x18c1('0x28')]=qs['offset'](_0xa2ed50[_0x18c1('0x41')][_0x18c1('0x28')]);}return _0x30ef86[_0x18c1('0x7e')](_0x2ca680);}})[_0x18c1('0x32')](function(_0xd585d2){if(_0xd585d2){return _0xd585d2?{'count':_0x1df8d6,'rows':_0xd585d2}:null;}})[_0x18c1('0x32')](respondWithResult(_0x1cd42a,null))['catch'](handleError(_0x1cd42a,null));};exports[_0x18c1('0x7f')]=function(_0x501a7f,_0x1a9ab0,_0x16bb9c){var _0x49e632={'channel':_0x18c1('0x80')};var _0x41e767=[];var _0x41c74d=[];var _0x35550e={};return db['WhatsappAccount'][_0x18c1('0x58')]({'where':{'id':_0x501a7f[_0x18c1('0x55')]['id']},'include':[{'model':db[_0x18c1('0x7b')],'as':_0x18c1('0x81')}]})[_0x18c1('0x32')](handleEntityNotFound(_0x1a9ab0,null))[_0x18c1('0x32')](function(_0x299ff4){_0x49e632['account']=_0x299ff4;if(_0x49e632['account']&&_0x49e632[_0x18c1('0x82')][_0x18c1('0x4c')]===_0x18c1('0x83')&&_0x501a7f[_0x18c1('0x5a')][_0x18c1('0x84')]){if(_0x501a7f[_0x18c1('0x5a')][_0x18c1('0x84')]['length']===0x0)return;if(_0x501a7f[_0x18c1('0x5a')][_0x18c1('0x84')][0x0][_0x18c1('0x85')]!==_0x18c1('0x86'))return;return db[_0x18c1('0x87')][_0x18c1('0x31')]({'read':!![],'readAt':_0x501a7f['body']['statuses'][0x0][_0x18c1('0x88')]},{'where':{'messageId':_0x501a7f['body']['statuses'][0x0][_0x18c1('0x89')]},'individualHooks':!![]})['then'](function(_0x5bf176){return _0x1a9ab0[_0x18c1('0x27')](0xc8)['json'](_0x5bf176);});}_0x49e632[_0x18c1('0x8a')]=_[_0x18c1('0x8b')](_0x299ff4[_0x18c1('0x81')],[_0x18c1('0x7c')],['asc']);if(_0x49e632[_0x18c1('0x82')][_0x18c1('0x81')]){delete _0x49e632[_0x18c1('0x82')][_0x18c1('0x81')];}return db['CmContact'][_0x18c1('0x60')]()[_0x18c1('0x32')](function(_0xce8b2){if(!_0xce8b2){throw new db[(_0x18c1('0x8c'))][(_0x18c1('0x8d'))]('no\x20available\x20attributes');}_0x41e767=_[_0x18c1('0x8e')](_[_0x18c1('0x42')](_0xce8b2),[_0x18c1('0x8f'),_0x18c1('0x90')]);_0x41c74d=_[_0x18c1('0x8e')](_[_0x18c1('0x42')](_0xce8b2),['createdAt',_0x18c1('0x90'),'CompanyId',_0x18c1('0x91')]);_0x49e632[_0x18c1('0x5a')]={'mapKey':_0x18c1('0x92')};if(_0x49e632[_0x18c1('0x82')]&&_0x49e632[_0x18c1('0x82')][_0x18c1('0x4c')]===_0x18c1('0x93')){_0x49e632['body'][_0x18c1('0x94')]=_0x501a7f[_0x18c1('0x5a')]['From'][_0x18c1('0x95')](_0x18c1('0x96'),'');_0x49e632[_0x18c1('0x5a')][_0x18c1('0x5a')]=_0x501a7f[_0x18c1('0x5a')]['Body'];_0x49e632[_0x18c1('0x5a')][_0x18c1('0x97')]=_0x501a7f['body'][_0x18c1('0x98')];}if(_0x49e632['account']&&_0x49e632[_0x18c1('0x82')][_0x18c1('0x4c')]===_0x18c1('0x83')){_0x49e632[_0x18c1('0x5a')][_0x18c1('0x94')]=_0x501a7f[_0x18c1('0x5a')][_0x18c1('0x99')][0x0][_0x18c1('0x94')];_0x49e632[_0x18c1('0x5a')][_0x18c1('0x5a')]=_0x501a7f['body'][_0x18c1('0x99')][0x0]['message'][_0x18c1('0x5a')];_0x49e632['body']['messageId']=_0x501a7f[_0x18c1('0x5a')]['notifications'][0x0][_0x18c1('0x89')];}if(_0x49e632['body']['id']){delete _0x49e632[_0x18c1('0x5a')]['id'];}if(_[_0x18c1('0x9a')](_0x49e632['body'][_0x18c1('0x94')])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_['isNil'](_0x49e632['body'][_0x18c1('0x5a')])||_0x49e632[_0x18c1('0x5a')][_0x18c1('0x5a')]===''){throw new db[(_0x18c1('0x8c'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x49e632[_0x18c1('0x5a')][_0x18c1('0x9b')])){throw new db['Sequelize'][(_0x18c1('0x8d'))](_0x18c1('0x9c')+_0x41c74d);}if(!_['includes'](_0x41c74d,_0x49e632[_0x18c1('0x5a')][_0x18c1('0x9b')])){throw new db[(_0x18c1('0x8c'))][(_0x18c1('0x8d'))](_0x18c1('0x9d')+_0x41c74d);}_0x35550e[_0x49e632[_0x18c1('0x5a')][_0x18c1('0x9b')]]=_0x49e632[_0x18c1('0x5a')][_0x18c1('0x94')];return db[_0x18c1('0x9e')][_0x18c1('0x58')]({'where':{'id':_0x49e632[_0x18c1('0x82')][_0x18c1('0x91')]},'include':[{'model':db[_0x18c1('0x9f')],'as':_0x18c1('0xa0'),'where':_0x35550e,'limit':0x1,'order':[[_0x18c1('0x90'),_0x18c1('0xa1')]]}]});})[_0x18c1('0x32')](handleEntityNotFound(_0x1a9ab0,null))[_0x18c1('0x32')](function(_0x5b77f5){if(_0x5b77f5){_0x49e632[_0x18c1('0xa2')]=_['omit'](_0x5b77f5,[_0x18c1('0xa0')]);if(_0x5b77f5[_0x18c1('0xa0')][_0x18c1('0x47')]){return _0x5b77f5[_0x18c1('0xa0')][0x0];}var _0x1a145f=_[_0x18c1('0x1a')](_0x49e632[_0x18c1('0x5a')],{'firstName':_0x49e632[_0x18c1('0x5a')]['from'],'ListId':_0x5b77f5['id']});_0x1a145f[_0x49e632[_0x18c1('0x5a')][_0x18c1('0x9b')]]=_0x49e632[_0x18c1('0x5a')][_0x18c1('0x94')];return db['CmContact'][_0x18c1('0x59')](_0x1a145f,{'fields':_0x41e767,'raw':!![]});}})['then'](handleEntityNotFound(_0x1a9ab0,null))[_0x18c1('0x32')](function(_0x133d89){if(_0x133d89){_0x49e632[_0x18c1('0xa3')]=_0x133d89;var _0x11bea4={'ContactId':_0x133d89['id'],'phone':_0x49e632[_0x18c1('0x5a')][_0x18c1('0x94')],'WhatsappAccountId':_0x501a7f['params']['id']};var _0x19a479={'ContactId':_0x133d89['id'],'WhatsappAccountId':_0x501a7f[_0x18c1('0x55')]['id'],'closed':![]};return db[_0x18c1('0xa4')][_0x18c1('0x58')]({'where':_0x19a479})[_0x18c1('0x32')](function(_0x553007){if(_0x553007){return[_0x553007,![]];}return db[_0x18c1('0xa4')][_0x18c1('0x59')](_0x11bea4)[_0x18c1('0x32')](function(_0x3f8dae){return[_0x3f8dae,!![]];});});}})[_0x18c1('0xa5')](function(_0x5b6c15,_0x32a15a){_0x49e632[_0x18c1('0xa6')]=_0x5b6c15['get']({'plain':!![]});_0x49e632['interaction']['created']=![];if(_0x32a15a){if(_0x49e632[_0x18c1('0x82')][_0x18c1('0xa7')]){_0x49e632[_0x18c1('0x8a')][_0x18c1('0xa8')]({'id':0x0,'priority':_0x49e632[_0x18c1('0x8a')]['length']+0x1,'app':_0x18c1('0xa9'),'appdata':_0x18c1('0xaa'),'interval':'*,*,*,*'});}_0x49e632['interaction'][_0x18c1('0xab')]=!![];}return db[_0x18c1('0x87')][_0x18c1('0x59')]({'phone':_0x49e632[_0x18c1('0x5a')][_0x18c1('0x94')],'messageId':_0x49e632[_0x18c1('0x5a')][_0x18c1('0x97')],'body':_0x49e632[_0x18c1('0x5a')]['body'],'WhatsappAccountId':_0x501a7f['params']['id'],'WhatsappInteractionId':_0x5b6c15['id'],'direction':'in','ContactId':_0x5b6c15[_0x18c1('0xac')],'AttachmentId':_0x49e632['body'][_0x18c1('0xad')]});})[_0x18c1('0x32')](function(_0x522b29){_0x49e632[_0x18c1('0x24')]=_0x522b29;if(!_0x49e632[_0x18c1('0xa6')]['UserId'])return;return db['User'][_0x18c1('0x58')]({'attributes':['id',_0x18c1('0x39')],'where':{'id':_0x49e632['interaction'][_0x18c1('0xae')]}});})['then'](function(_0xd805bd){if(_0xd805bd){_0x49e632[_0x18c1('0x8a')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xd805bd[_0x18c1('0x39')]+','+(_0x49e632[_0x18c1('0x82')]['waitForTheAssignedAgent']||0xa),'interval':_0x18c1('0xaf')});}if(!_0x49e632['interaction']['queueId'])return;return db['WhatsappQueue'][_0x18c1('0x58')]({'attributes':['id','name'],'where':{'id':_0x49e632[_0x18c1('0xa6')][_0x18c1('0xb0')]}});})['then'](function(_0x3cecd2){if(_0x3cecd2){_0x49e632[_0x18c1('0x8a')]['unshift']({'id':0x0,'priority':0x1,'app':_0x18c1('0xb1'),'appdata':_0x3cecd2['name']+','+(_0x49e632[_0x18c1('0x82')][_0x18c1('0xb2')]||0x12c),'interval':_0x18c1('0xaf')});}return respondWithRpcPromise(_0x18c1('0xb3'),_0x18c1('0xb4'),_0x49e632);})[_0x18c1('0x32')](function(_0x17e534){if(_0x17e534){var _0x489fbb=0xc8;var _0xe7f775=_0x18c1('0xb5');logger['info']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xe7f775,_0x489fbb,'entity\x20found');logger[_0x18c1('0x22')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0xe7f775,_0x489fbb,_0x18c1('0xb6'),JSON[_0x18c1('0xb7')](_0x17e534));if(_0x49e632[_0x18c1('0x82')][_0x18c1('0x4c')]===_0x18c1('0x93')){return _0x1a9ab0['status'](_0x489fbb)[_0x18c1('0x2c')]('Content-Type',_0x18c1('0xb8'))[_0x18c1('0x3a')]('\x0a');}else{return _0x1a9ab0['status'](_0x489fbb)[_0x18c1('0x2e')](_0x17e534);}}});})['catch'](handleError(_0x1a9ab0,null));};exports[_0x18c1('0x3a')]=function(_0x3307d1,_0x97ec4f,_0x39f4d3){var _0x4d2b58,_0x3e8391,_0x108299;if(_[_0x18c1('0x9a')](_0x3307d1[_0x18c1('0x5a')][_0x18c1('0x5a')])||_0x3307d1[_0x18c1('0x5a')][_0x18c1('0x5a')]===''){throw new db[(_0x18c1('0x8c'))][(_0x18c1('0x8d'))](_0x18c1('0xb9'));}if(_[_0x18c1('0x9a')](_0x3307d1[_0x18c1('0x5a')]['to'])){throw new db[(_0x18c1('0x8c'))][(_0x18c1('0x8d'))](_0x18c1('0xba'));}_0x4d2b58=_0x3307d1[_0x18c1('0x5a')]['to'];return db[_0x18c1('0x4f')]['find']({'where':{'id':_0x3307d1[_0x18c1('0x55')]['id']},'include':[{'model':db[_0x18c1('0x9e')],'as':'List','include':[{'model':db[_0x18c1('0x9f')],'as':'Contacts','where':{'mobile':_0x4d2b58},'limit':0x1,'order':[[_0x18c1('0x90'),'DESC']]}]}]})[_0x18c1('0x32')](handleEntityNotFound(_0x97ec4f,null))[_0x18c1('0x32')](function(_0x15d675){if(_0x15d675&&_0x15d675['List']){_0x3e8391=_0x15d675[_0x18c1('0x33')]({'plain':!![]});if(_0x3e8391[_0x18c1('0xbb')]&&_0x3e8391['List'][_0x18c1('0xa0')][_0x18c1('0x47')]){return _0x3e8391[_0x18c1('0xbb')][_0x18c1('0xa0')][0x0];}return db['CmContact'][_0x18c1('0x59')](_['defaults'](_0x3307d1[_0x18c1('0x5a')],{'firstName':_0x4d2b58,'mobile':_0x4d2b58,'phone':_0x4d2b58,'ListId':_0x3e8391[_0x18c1('0x91')]}));}})[_0x18c1('0x32')](handleEntityNotFound(_0x97ec4f,null))['then'](function(_0x38a295){if(_0x38a295){_0x108299=_0x38a295;return db['WhatsappInteraction'][_0x18c1('0x58')]({'where':{'ContactId':_0x108299['id'],'closed':![],'WhatsappAccountId':_0x3e8391['id']}})[_0x18c1('0x32')](function(_0x220410){if(_0x220410){return[_0x220410,![]];}return db[_0x18c1('0xa4')]['create']({'UserId':_0x3307d1[_0x18c1('0x5b')]['id'],'ContactId':_0x108299['id'],'WhatsappAccountId':_0x3e8391['id'],'phone':_0x4d2b58,'firstMsgDirection':_0x18c1('0xbc'),'Messages':[_[_0x18c1('0x57')](_0x3307d1['body'],{'read':![],'body':_0x3307d1['body'][_0x18c1('0x5a')],'phone':_0x4d2b58,'WhatsappAccountId':_0x3e8391['id'],'UserId':_0x3307d1[_0x18c1('0x5b')]['id'],'ContactId':_0x108299['id']})]},{'include':[{'model':db[_0x18c1('0x87')],'as':_0x18c1('0xbd')}]})[_0x18c1('0x32')](function(_0x2f15fc){return[_0x2f15fc,!![]];});});}})['spread'](function(_0xc7d6c4,_0x25af78){if(_0x25af78){return _0xc7d6c4;}return db[_0x18c1('0x87')][_0x18c1('0x59')](_[_0x18c1('0x57')](_0x3307d1['body'],{'read':![],'body':_0x3307d1[_0x18c1('0x5a')][_0x18c1('0x5a')],'phone':_0x4d2b58,'WhatsappAccountId':_0x3e8391['id'],'WhatsappInteractionId':_0xc7d6c4['id'],'UserId':_0x3307d1[_0x18c1('0x5b')]['id'],'ContactId':_0x108299['id']}))[_0x18c1('0x32')](function(_0x116ed1){_0xc7d6c4[_0x18c1('0xbe')][_0x18c1('0xbd')]=[];_0xc7d6c4['dataValues']['Messages'][_0x18c1('0xa8')](_0x116ed1[_0x18c1('0xbe')]);return _0xc7d6c4;});})[_0x18c1('0x32')](respondWithResult(_0x97ec4f,null))[_0x18c1('0x53')](handleError(_0x97ec4f,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index c8980b6..c77fd57 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 _0x14d4=['WhatsappAccount','save','update','remove','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3e62e3,_0x312502){var _0x170059=function(_0x249261){while(--_0x249261){_0x3e62e3['push'](_0x3e62e3['shift']());}};_0x170059(++_0x312502);}(_0x14d4,0x127));var _0x414d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x14d4[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x414d('0x0'));var WhatsappAccount=require(_0x414d('0x1'))['db'][_0x414d('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x414d('0x3'),'afterUpdate':_0x414d('0x4'),'afterDestroy':_0x414d('0x5')};function emitEvent(_0x2e3223){return function(_0x695af,_0x395634,_0x2ff9e2){WhatsappAccountEvents['emit'](_0x2e3223+':'+_0x695af['id'],_0x695af);WhatsappAccountEvents['emit'](_0x2e3223,_0x695af);_0x2ff9e2(null);};}for(var e in events){if(events[_0x414d('0x6')](e)){var event=events[e];WhatsappAccount[_0x414d('0x7')](e,emitEvent(event));}}module[_0x414d('0x8')]=WhatsappAccountEvents; \ No newline at end of file +var _0x8e02=['WhatsappAccount','save','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x504a84,_0x19e541){var _0x4ccfa3=function(_0x11e502){while(--_0x11e502){_0x504a84['push'](_0x504a84['shift']());}};_0x4ccfa3(++_0x19e541);}(_0x8e02,0x91));var _0x28e0=function(_0x1a68f6,_0x3241d2){_0x1a68f6=_0x1a68f6-0x0;var _0x2272d0=_0x8e02[_0x1a68f6];return _0x2272d0;};'use strict';var EventEmitter=require(_0x28e0('0x0'));var WhatsappAccount=require(_0x28e0('0x1'))['db'][_0x28e0('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x28e0('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2346b3){return function(_0x550f46,_0x2db366,_0x125db9){WhatsappAccountEvents[_0x28e0('0x4')](_0x2346b3+':'+_0x550f46['id'],_0x550f46);WhatsappAccountEvents[_0x28e0('0x4')](_0x2346b3,_0x550f46);_0x125db9(null);};}for(var e in events){if(events[_0x28e0('0x5')](e)){var event=events[e];WhatsappAccount['hook'](e,emitEvent(event));}}module[_0x28e0('0x6')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 00c40a9..0266cfe 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 _0xcab1=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','define','util'];(function(_0xb80aed,_0x48b106){var _0x2759eb=function(_0x370ea1){while(--_0x370ea1){_0xb80aed['push'](_0xb80aed['shift']());}};_0x2759eb(++_0x48b106);}(_0xcab1,0x143));var _0x1cab=function(_0x394f38,_0x231727){_0x394f38=_0x394f38-0x0;var _0x168347=_0xcab1[_0x394f38];return _0x168347;};'use strict';var _=require('lodash');var util=require(_0x1cab('0x0'));var logger=require(_0x1cab('0x1'))('api');var moment=require(_0x1cab('0x2'));var BPromise=require('bluebird');var rp=require(_0x1cab('0x3'));var fs=require('fs');var path=require(_0x1cab('0x4'));var rimraf=require(_0x1cab('0x5'));var config=require(_0x1cab('0x6'));var attributes=require(_0x1cab('0x7'));module['exports']=function(_0x2a697b,_0x523d32){return _0x2a697b[_0x1cab('0x8')]('WhatsappAccount',attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa2ba=['WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappAccount.attributes','define'];(function(_0x2b6bb5,_0x2629dd){var _0x548237=function(_0x1ad47e){while(--_0x1ad47e){_0x2b6bb5['push'](_0x2b6bb5['shift']());}};_0x548237(++_0x2629dd);}(_0xa2ba,0xab));var _0xaa2b=function(_0x3a2a35,_0x52ebd6){_0x3a2a35=_0x3a2a35-0x0;var _0x3ca3b9=_0xa2ba[_0x3a2a35];return _0x3ca3b9;};'use strict';var _=require(_0xaa2b('0x0'));var util=require(_0xaa2b('0x1'));var logger=require(_0xaa2b('0x2'))(_0xaa2b('0x3'));var moment=require(_0xaa2b('0x4'));var BPromise=require(_0xaa2b('0x5'));var rp=require(_0xaa2b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaa2b('0x7'));var config=require(_0xaa2b('0x8'));var attributes=require(_0xaa2b('0x9'));module['exports']=function(_0x5b21d1,_0x53bf62){return _0x5b21d1[_0xaa2b('0xa')](_0xaa2b('0xb'),attributes,{'tableName':_0xaa2b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index 8b34bd6..589e20b 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 _0x7d34=['then','info','request\x20sent','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','WhatsappAccount','find','options','where','attributes','include','map','model','ShowWhatsappAccount','debug','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./whatsappAccount.socket','register','request'];(function(_0x253288,_0xcc6c27){var _0x4fe96f=function(_0x32dbc1){while(--_0x32dbc1){_0x253288['push'](_0x253288['shift']());}};_0x4fe96f(++_0xcc6c27);}(_0x7d34,0xe6));var _0x47d3=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7d34[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require(_0x47d3('0x0'));var moment=require(_0x47d3('0x1'));var BPromise=require(_0x47d3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x47d3('0x3'));var db=require(_0x47d3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x47d3('0x5'))('rpc');var config=require(_0x47d3('0x6'));var jayson=require(_0x47d3('0x7'));var client=jayson[_0x47d3('0x8')][_0x47d3('0x9')]({'port':0x232a});config[_0x47d3('0xa')]=_['defaults'](config[_0x47d3('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x47d3('0xb'))(new Redis(config[_0x47d3('0xa')]));require(_0x47d3('0xc'))[_0x47d3('0xd')](socket);function respondWithRpcPromise(_0x14310d,_0x3c0db1,_0x22f773){return new BPromise(function(_0x2a9fae,_0x52767e){return client[_0x47d3('0xe')](_0x14310d,_0x22f773)[_0x47d3('0xf')](function(_0x21b4a8){logger[_0x47d3('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x3c0db1,_0x47d3('0x11'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x3c0db1,'request\x20sent',JSON[_0x47d3('0x12')](_0x21b4a8));if(_0x21b4a8[_0x47d3('0x13')]){if(_0x21b4a8[_0x47d3('0x13')][_0x47d3('0x14')]===0x1f4){logger['error'](_0x47d3('0x15'),_0x3c0db1,_0x21b4a8[_0x47d3('0x13')]['message']);return _0x52767e(_0x21b4a8[_0x47d3('0x13')][_0x47d3('0x16')]);}logger[_0x47d3('0x13')](_0x47d3('0x15'),_0x3c0db1,_0x21b4a8[_0x47d3('0x13')][_0x47d3('0x16')]);return _0x2a9fae(_0x21b4a8['error'][_0x47d3('0x16')]);}else{logger[_0x47d3('0x10')]('WhatsappAccount,\x20%s,\x20%s',_0x3c0db1,_0x47d3('0x11'));_0x2a9fae(_0x21b4a8[_0x47d3('0x17')][_0x47d3('0x16')]);}})['catch'](function(_0x2c3aea){logger[_0x47d3('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x3c0db1,_0x2c3aea);_0x52767e(_0x2c3aea);});});}exports['ShowWhatsappAccount']=function(_0x553ec6){var _0x1cd25f=this;return new Promise(function(_0x3b8fce,_0x4634fd){return db[_0x47d3('0x18')][_0x47d3('0x19')]({'raw':_0x553ec6[_0x47d3('0x1a')]?_0x553ec6[_0x47d3('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x553ec6['options']?_0x553ec6[_0x47d3('0x1a')][_0x47d3('0x1b')]||null:null,'attributes':_0x553ec6['options']?_0x553ec6[_0x47d3('0x1a')][_0x47d3('0x1c')]||null:null,'include':_0x553ec6[_0x47d3('0x1a')]?_0x553ec6[_0x47d3('0x1a')][_0x47d3('0x1d')]?_[_0x47d3('0x1e')](_0x553ec6['options']['include'],function(_0x213aa9){return{'model':db[_0x213aa9['model']],'as':_0x213aa9['as'],'attributes':_0x213aa9[_0x47d3('0x1c')],'include':_0x213aa9[_0x47d3('0x1d')]?_[_0x47d3('0x1e')](_0x213aa9[_0x47d3('0x1d')],function(_0x5703ef){return{'model':db[_0x5703ef[_0x47d3('0x1f')]],'as':_0x5703ef['as'],'attributes':_0x5703ef[_0x47d3('0x1c')],'include':_0x5703ef[_0x47d3('0x1d')]?_['map'](_0x5703ef[_0x47d3('0x1d')],function(_0x5905e0){return{'model':db[_0x5905e0[_0x47d3('0x1f')]],'as':_0x5905e0['as'],'attributes':_0x5905e0[_0x47d3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x47d3('0xf')](function(_0x14ad89){logger[_0x47d3('0x10')](_0x47d3('0x20'),_0x553ec6);logger[_0x47d3('0x21')](_0x47d3('0x20'),_0x553ec6,JSON[_0x47d3('0x12')](_0x14ad89));_0x3b8fce(_0x14ad89);})[_0x47d3('0x22')](function(_0x1fabf6){logger[_0x47d3('0x13')](_0x47d3('0x20'),_0x1fabf6[_0x47d3('0x16')],_0x553ec6);_0x4634fd(_0x1cd25f[_0x47d3('0x13')](0x1f4,_0x1fabf6['message']));});});}; \ No newline at end of file +var _0xb3dd=['ShowWhatsappAccount','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','catch','WhatsappAccount','find','options','raw','where','include','map','model','attributes'];(function(_0x551218,_0x5dc26b){var _0x50e036=function(_0x1a61c6){while(--_0x1a61c6){_0x551218['push'](_0x551218['shift']());}};_0x50e036(++_0x5dc26b);}(_0xb3dd,0x76));var _0xdb3d=function(_0x4ce78c,_0x5e82e9){_0x4ce78c=_0x4ce78c-0x0;var _0x3a3534=_0xb3dd[_0x4ce78c];return _0x3a3534;};'use strict';var _=require('lodash');var util=require(_0xdb3d('0x0'));var moment=require(_0xdb3d('0x1'));var BPromise=require(_0xdb3d('0x2'));var rs=require(_0xdb3d('0x3'));var fs=require('fs');var Redis=require(_0xdb3d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdb3d('0x5'));var logger=require(_0xdb3d('0x6'))(_0xdb3d('0x7'));var config=require('../../config/environment');var jayson=require(_0xdb3d('0x8'));var client=jayson[_0xdb3d('0x9')][_0xdb3d('0xa')]({'port':0x232a});config[_0xdb3d('0xb')]=_[_0xdb3d('0xc')](config[_0xdb3d('0xb')],{'host':_0xdb3d('0xd'),'port':0x18eb});var socket=require(_0xdb3d('0xe'))(new Redis(config['redis']));require(_0xdb3d('0xf'))[_0xdb3d('0x10')](socket);function respondWithRpcPromise(_0xfd6996,_0x4fa86a,_0x3e45bd){return new BPromise(function(_0x28517d,_0x2dd2e7){return client[_0xdb3d('0x11')](_0xfd6996,_0x3e45bd)[_0xdb3d('0x12')](function(_0x57ad24){logger[_0xdb3d('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0x4fa86a,'request\x20sent');logger[_0xdb3d('0x14')](_0xdb3d('0x15'),_0x4fa86a,_0xdb3d('0x16'),JSON[_0xdb3d('0x17')](_0x57ad24));if(_0x57ad24[_0xdb3d('0x18')]){if(_0x57ad24[_0xdb3d('0x18')][_0xdb3d('0x19')]===0x1f4){logger[_0xdb3d('0x18')](_0xdb3d('0x1a'),_0x4fa86a,_0x57ad24[_0xdb3d('0x18')][_0xdb3d('0x1b')]);return _0x2dd2e7(_0x57ad24[_0xdb3d('0x18')][_0xdb3d('0x1b')]);}logger[_0xdb3d('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x4fa86a,_0x57ad24[_0xdb3d('0x18')][_0xdb3d('0x1b')]);return _0x28517d(_0x57ad24[_0xdb3d('0x18')]['message']);}else{logger[_0xdb3d('0x13')](_0xdb3d('0x1a'),_0x4fa86a,'request\x20sent');_0x28517d(_0x57ad24['result'][_0xdb3d('0x1b')]);}})[_0xdb3d('0x1c')](function(_0x3bbaf7){logger[_0xdb3d('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x4fa86a,_0x3bbaf7);_0x2dd2e7(_0x3bbaf7);});});}exports['ShowWhatsappAccount']=function(_0x9c978e){var _0x20eec4=this;return new Promise(function(_0x4c8efc,_0x51b6d3){return db[_0xdb3d('0x1d')][_0xdb3d('0x1e')]({'raw':_0x9c978e[_0xdb3d('0x1f')]?_0x9c978e[_0xdb3d('0x1f')][_0xdb3d('0x20')]===undefined?!![]:![]:!![],'where':_0x9c978e[_0xdb3d('0x1f')]?_0x9c978e[_0xdb3d('0x1f')][_0xdb3d('0x21')]||null:null,'attributes':_0x9c978e[_0xdb3d('0x1f')]?_0x9c978e[_0xdb3d('0x1f')]['attributes']||null:null,'include':_0x9c978e[_0xdb3d('0x1f')]?_0x9c978e['options'][_0xdb3d('0x22')]?_[_0xdb3d('0x23')](_0x9c978e[_0xdb3d('0x1f')][_0xdb3d('0x22')],function(_0x5865bf){return{'model':db[_0x5865bf[_0xdb3d('0x24')]],'as':_0x5865bf['as'],'attributes':_0x5865bf[_0xdb3d('0x25')],'include':_0x5865bf[_0xdb3d('0x22')]?_[_0xdb3d('0x23')](_0x5865bf['include'],function(_0x3fa6d0){return{'model':db[_0x3fa6d0[_0xdb3d('0x24')]],'as':_0x3fa6d0['as'],'attributes':_0x3fa6d0[_0xdb3d('0x25')],'include':_0x3fa6d0[_0xdb3d('0x22')]?_[_0xdb3d('0x23')](_0x3fa6d0[_0xdb3d('0x22')],function(_0x3d6bcc){return{'model':db[_0x3d6bcc['model']],'as':_0x3d6bcc['as'],'attributes':_0x3d6bcc[_0xdb3d('0x25')]};}):[]};}):[]};}):[]:[]})[_0xdb3d('0x12')](function(_0x4157bb){logger[_0xdb3d('0x13')]('ShowWhatsappAccount',_0x9c978e);logger['debug'](_0xdb3d('0x26'),_0x9c978e,JSON[_0xdb3d('0x17')](_0x4157bb));_0x4c8efc(_0x4157bb);})[_0xdb3d('0x1c')](function(_0x658211){logger['error'](_0xdb3d('0x26'),_0x658211['message'],_0x9c978e);_0x51b6d3(_0x20eec4['error'](0x1f4,_0x658211[_0xdb3d('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 34580d9..5844406 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 _0x5cf2=['length','./whatsappAccount.events','remove','update','emit','removeListener'];(function(_0x32767b,_0x4ac09d){var _0x45f047=function(_0x49dce2){while(--_0x49dce2){_0x32767b['push'](_0x32767b['shift']());}};_0x45f047(++_0x4ac09d);}(_0x5cf2,0x133));var _0x25cf=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x5cf2[_0x2ec461];return _0x28603d;};'use strict';var WhatsappAccountEvents=require(_0x25cf('0x0'));var events=['save',_0x25cf('0x1'),_0x25cf('0x2')];function createListener(_0xac8c81,_0x127819){return function(_0x3e9bc4){_0x127819[_0x25cf('0x3')](_0xac8c81,_0x3e9bc4);};}function removeListener(_0x4c0c17,_0x2c3b9c){return function(){WhatsappAccountEvents[_0x25cf('0x4')](_0x4c0c17,_0x2c3b9c);};}exports['register']=function(_0x4e57d7){for(var _0x14678a=0x0,_0x7b7943=events[_0x25cf('0x5')];_0x14678a<_0x7b7943;_0x14678a++){var _0x2a377a=events[_0x14678a];var _0x13cb97=createListener('whatsappAccount:'+_0x2a377a,_0x4e57d7);WhatsappAccountEvents['on'](_0x2a377a,_0x13cb97);}}; \ No newline at end of file +var _0x46d6=['register','length','whatsappAccount:','./whatsappAccount.events','save','remove','emit','removeListener'];(function(_0x2b62c8,_0x36c80b){var _0x569ebb=function(_0x1f2f37){while(--_0x1f2f37){_0x2b62c8['push'](_0x2b62c8['shift']());}};_0x569ebb(++_0x36c80b);}(_0x46d6,0x1bb));var _0x646d=function(_0x1fb6be,_0x2fd9a3){_0x1fb6be=_0x1fb6be-0x0;var _0x1eebff=_0x46d6[_0x1fb6be];return _0x1eebff;};'use strict';var WhatsappAccountEvents=require(_0x646d('0x0'));var events=[_0x646d('0x1'),_0x646d('0x2'),'update'];function createListener(_0x3be5a7,_0x2a9cfe){return function(_0x3cb158){_0x2a9cfe[_0x646d('0x3')](_0x3be5a7,_0x3cb158);};}function removeListener(_0x51403b,_0xc4a619){return function(){WhatsappAccountEvents[_0x646d('0x4')](_0x51403b,_0xc4a619);};}exports[_0x646d('0x5')]=function(_0x5602ad){for(var _0xb8afb3=0x0,_0x44e524=events[_0x646d('0x6')];_0xb8afb3<_0x44e524;_0xb8afb3++){var _0x9bd856=events[_0xb8afb3];var _0x83b8e5=createListener(_0x646d('0x7')+_0x9bd856,_0x5602ad);WhatsappAccountEvents['on'](_0x9bd856,_0x83b8e5);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index ca3cd1c..30bbdec 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 _0x0a46=['get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappApplication.controller'];(function(_0x22ca9e,_0x197d6c){var _0x19c927=function(_0x38c5d8){while(--_0x38c5d8){_0x22ca9e['push'](_0x22ca9e['shift']());}};_0x19c927(++_0x197d6c);}(_0x0a46,0xbf));var _0x60a4=function(_0x4a92b9,_0x5f108e){_0x4a92b9=_0x4a92b9-0x0;var _0x4bd487=_0x0a46[_0x4a92b9];return _0x4bd487;};'use strict';var multer=require(_0x60a4('0x0'));var util=require(_0x60a4('0x1'));var path=require('path');var timeout=require(_0x60a4('0x2'));var express=require(_0x60a4('0x3'));var router=express[_0x60a4('0x4')]();var fs_extra=require(_0x60a4('0x5'));var auth=require(_0x60a4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x60a4('0x7'));var controller=require(_0x60a4('0x8'));router[_0x60a4('0x9')]('/',auth[_0x60a4('0xa')](),controller[_0x60a4('0xb')]);router[_0x60a4('0x9')](_0x60a4('0xc'),auth[_0x60a4('0xa')](),controller[_0x60a4('0xd')]);router[_0x60a4('0xe')]('/',auth[_0x60a4('0xa')](),controller[_0x60a4('0xf')]);router['put']('/:id',auth[_0x60a4('0xa')](),controller[_0x60a4('0x10')]);router[_0x60a4('0x11')](_0x60a4('0xc'),auth[_0x60a4('0xa')](),controller[_0x60a4('0x12')]);module[_0x60a4('0x13')]=router; \ No newline at end of file +var _0x7cb3=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x7cb3,0x7d));var _0x37cb=function(_0x1a79ac,_0x8ef293){_0x1a79ac=_0x1a79ac-0x0;var _0x185fe5=_0x7cb3[_0x1a79ac];return _0x185fe5;};'use strict';var multer=require(_0x37cb('0x0'));var util=require(_0x37cb('0x1'));var path=require(_0x37cb('0x2'));var timeout=require(_0x37cb('0x3'));var express=require(_0x37cb('0x4'));var router=express[_0x37cb('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x37cb('0x6'));var config=require(_0x37cb('0x7'));var controller=require(_0x37cb('0x8'));router[_0x37cb('0x9')]('/',auth[_0x37cb('0xa')](),controller[_0x37cb('0xb')]);router[_0x37cb('0x9')]('/:id',auth[_0x37cb('0xa')](),controller[_0x37cb('0xc')]);router[_0x37cb('0xd')]('/',auth[_0x37cb('0xa')](),controller[_0x37cb('0xe')]);router[_0x37cb('0xf')](_0x37cb('0x10'),auth[_0x37cb('0xa')](),controller[_0x37cb('0x11')]);router[_0x37cb('0x12')](_0x37cb('0x10'),auth[_0x37cb('0xa')](),controller[_0x37cb('0x13')]);module[_0x37cb('0x14')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index 52bbd28..a7911d2 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 _0xe0d2=['*,*,*,*','exports','STRING','noop','TEXT'];(function(_0x162b4e,_0x4d9f28){var _0x4f0fed=function(_0x499948){while(--_0x499948){_0x162b4e['push'](_0x162b4e['shift']());}};_0x4f0fed(++_0x4d9f28);}(_0xe0d2,0x164));var _0x2e0d=function(_0x25df01,_0x3f0b06){_0x25df01=_0x25df01-0x0;var _0x5577ff=_0xe0d2[_0x25df01];return _0x5577ff;};'use strict';var Sequelize=require('sequelize');module[_0x2e0d('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x2e0d('0x1')],'allowNull':![],'defaultValue':_0x2e0d('0x2')},'appdata':{'type':Sequelize[_0x2e0d('0x3')]()},'description':{'type':Sequelize[_0x2e0d('0x1')]},'interval':{'type':Sequelize[_0x2e0d('0x1')],'defaultValue':_0x2e0d('0x4')}}; \ No newline at end of file +var _0xd358=['noop','TEXT','sequelize','INTEGER','STRING'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xd358,0x1dd));var _0x8d35=function(_0x38b147,_0x1801fd){_0x38b147=_0x38b147-0x0;var _0x32125f=_0xd358[_0x38b147];return _0x32125f;};'use strict';var Sequelize=require(_0x8d35('0x0'));module['exports']={'priority':{'type':Sequelize[_0x8d35('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x8d35('0x2')],'allowNull':![],'defaultValue':_0x8d35('0x3')},'appdata':{'type':Sequelize[_0x8d35('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8d35('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index c1f213c..c6619a5 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 _0xb114=['../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb114,0x11f));var _0x4b11=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xb114[_0x465a0c];return _0x1e202e;};'use strict';var emlformat=require(_0x4b11('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4b11('0x1'));var jsonpatch=require(_0x4b11('0x2'));var rp=require('request-promise');var moment=require(_0x4b11('0x3'));var BPromise=require(_0x4b11('0x4'));var Mustache=require(_0x4b11('0x5'));var util=require(_0x4b11('0x6'));var path=require(_0x4b11('0x7'));var sox=require(_0x4b11('0x8'));var csv=require('to-csv');var ejs=require(_0x4b11('0x9'));var fs=require('fs');var fs_extra=require(_0x4b11('0xa'));var _=require(_0x4b11('0xb'));var squel=require(_0x4b11('0xc'));var crypto=require(_0x4b11('0xd'));var jsforce=require(_0x4b11('0xe'));var deskjs=require(_0x4b11('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4b11('0x10'));var Papa=require('papaparse');var Redis=require(_0x4b11('0x11'));var authService=require(_0x4b11('0x12'));var qs=require(_0x4b11('0x13'));var as=require(_0x4b11('0x14'));var hardwareService=require(_0x4b11('0x15'));var logger=require(_0x4b11('0x16'))('api');var utils=require(_0x4b11('0x17'));var config=require(_0x4b11('0x18'));var licenseUtil=require(_0x4b11('0x19'));var db=require(_0x4b11('0x1a'))['db'];function respondWithStatusCode(_0x5f1c08,_0x53d05e){_0x53d05e=_0x53d05e||0xcc;return function(_0x1782f8){if(_0x1782f8){return _0x5f1c08[_0x4b11('0x1b')](_0x53d05e);}return _0x5f1c08[_0x4b11('0x1c')](_0x53d05e)[_0x4b11('0x1d')]();};}function respondWithResult(_0x3119d8,_0x46ca74){_0x46ca74=_0x46ca74||0xc8;return function(_0x3f8523){if(_0x3f8523){return _0x3119d8[_0x4b11('0x1c')](_0x46ca74)['json'](_0x3f8523);}};}function respondWithFilteredResult(_0x50e9d4,_0x287df3){return function(_0x26c3e2){if(_0x26c3e2){var _0x3910c7=typeof _0x287df3['offset']==='undefined'&&typeof _0x287df3['limit']===_0x4b11('0x1e');var _0x4a573f=_0x26c3e2[_0x4b11('0x1f')];var _0xf14a7f=_0x3910c7?0x0:_0x287df3[_0x4b11('0x20')];var _0x2db145=_0x3910c7?_0x26c3e2[_0x4b11('0x1f')]:_0x287df3[_0x4b11('0x20')]+_0x287df3[_0x4b11('0x21')];var _0x2f2f6b;if(_0x2db145>=_0x4a573f){_0x2db145=_0x4a573f;_0x2f2f6b=0xc8;}else{_0x2f2f6b=0xce;}_0x50e9d4['status'](_0x2f2f6b);return _0x50e9d4[_0x4b11('0x22')](_0x4b11('0x23'),_0xf14a7f+'-'+_0x2db145+'/'+_0x4a573f)[_0x4b11('0x24')](_0x26c3e2);}return null;};}function patchUpdates(_0x55e18e){return function(_0x30c80f){try{jsonpatch['apply'](_0x30c80f,_0x55e18e,!![]);}catch(_0x32021a){return BPromise[_0x4b11('0x25')](_0x32021a);}return _0x30c80f[_0x4b11('0x26')]();};}function saveUpdates(_0x12a7cc,_0x113a1e){return function(_0x28b219){if(_0x28b219){return _0x28b219[_0x4b11('0x27')](_0x12a7cc)[_0x4b11('0x28')](function(_0x34aeae){return _0x34aeae;});}return null;};}function removeEntity(_0x398b12,_0x3e9a73){return function(_0x49a69c){if(_0x49a69c){return _0x49a69c[_0x4b11('0x29')]()['then'](function(){_0x398b12[_0x4b11('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x479e85,_0x32bc7e){return function(_0x3c0a9c){if(!_0x3c0a9c){_0x479e85[_0x4b11('0x1b')](0x194);}return _0x3c0a9c;};}function handleError(_0x347d32,_0x2abb0b){_0x2abb0b=_0x2abb0b||0x1f4;return function(_0x5b904a){logger[_0x4b11('0x2a')](_0x5b904a[_0x4b11('0x2b')]);if(_0x5b904a[_0x4b11('0x2c')]){delete _0x5b904a[_0x4b11('0x2c')];}_0x347d32[_0x4b11('0x1c')](_0x2abb0b)[_0x4b11('0x2d')](_0x5b904a);};}exports[_0x4b11('0x2e')]=function(_0xc3c5d0,_0x5897ea){var _0x22948f={},_0x15d27d={},_0x4ff92d={'count':0x0,'rows':[]};var _0x25e87f=_[_0x4b11('0x2f')](db[_0x4b11('0x30')][_0x4b11('0x31')],function(_0x3a0d9e){return{'name':_0x3a0d9e[_0x4b11('0x32')],'type':_0x3a0d9e[_0x4b11('0x33')]['key']};});_0x15d27d[_0x4b11('0x34')]=_[_0x4b11('0x2f')](_0x25e87f,_0x4b11('0x2c'));_0x15d27d['query']=_[_0x4b11('0x35')](_0xc3c5d0[_0x4b11('0x36')]);_0x15d27d[_0x4b11('0x37')]=_[_0x4b11('0x38')](_0x15d27d[_0x4b11('0x34')],_0x15d27d[_0x4b11('0x36')]);_0x22948f['attributes']=_['intersection'](_0x15d27d[_0x4b11('0x34')],qs[_0x4b11('0x39')](_0xc3c5d0[_0x4b11('0x36')][_0x4b11('0x39')]));_0x22948f[_0x4b11('0x3a')]=_0x22948f[_0x4b11('0x3a')][_0x4b11('0x3b')]?_0x22948f['attributes']:_0x15d27d[_0x4b11('0x34')];if(!_0xc3c5d0[_0x4b11('0x36')][_0x4b11('0x3c')](_0x4b11('0x3d'))){_0x22948f[_0x4b11('0x21')]=qs['limit'](_0xc3c5d0['query'][_0x4b11('0x21')]);_0x22948f[_0x4b11('0x20')]=qs[_0x4b11('0x20')](_0xc3c5d0[_0x4b11('0x36')]['offset']);}_0x22948f['order']=qs['sort'](_0xc3c5d0[_0x4b11('0x36')][_0x4b11('0x3e')]);_0x22948f['where']=qs[_0x4b11('0x37')](_['pick'](_0xc3c5d0[_0x4b11('0x36')],_0x15d27d[_0x4b11('0x37')]),_0x25e87f);if(_0xc3c5d0[_0x4b11('0x36')][_0x4b11('0x3f')]){_0x22948f[_0x4b11('0x40')]=_[_0x4b11('0x41')](_0x22948f[_0x4b11('0x40')],{'$or':_[_0x4b11('0x2f')](_0x25e87f,function(_0x3847f3){if(_0x3847f3[_0x4b11('0x33')]!=='VIRTUAL'){var _0x4fbce5={};_0x4fbce5[_0x3847f3[_0x4b11('0x2c')]]={'$like':'%'+_0xc3c5d0[_0x4b11('0x36')][_0x4b11('0x3f')]+'%'};return _0x4fbce5;}})});}_0x22948f=_[_0x4b11('0x41')]({},_0x22948f,_0xc3c5d0[_0x4b11('0x42')]);var _0x1477cb={'where':_0x22948f[_0x4b11('0x40')]};return db[_0x4b11('0x30')][_0x4b11('0x1f')](_0x1477cb)[_0x4b11('0x28')](function(_0x554866){_0x4ff92d['count']=_0x554866;if(_0xc3c5d0['query'][_0x4b11('0x43')]){_0x22948f[_0x4b11('0x44')]=[{'all':!![]}];}return db[_0x4b11('0x30')][_0x4b11('0x45')](_0x22948f);})[_0x4b11('0x28')](function(_0x2884f1){_0x4ff92d[_0x4b11('0x46')]=_0x2884f1;return _0x4ff92d;})[_0x4b11('0x28')](respondWithFilteredResult(_0x5897ea,_0x22948f))[_0x4b11('0x47')](handleError(_0x5897ea,null));};exports[_0x4b11('0x48')]=function(_0x489080,_0x1786e1){var _0xfd58a7={'raw':!![],'where':{'id':_0x489080[_0x4b11('0x49')]['id']}},_0x58e4ba={};_0x58e4ba[_0x4b11('0x34')]=_[_0x4b11('0x35')](db[_0x4b11('0x30')]['rawAttributes']);_0x58e4ba[_0x4b11('0x36')]=_[_0x4b11('0x35')](_0x489080['query']);_0x58e4ba[_0x4b11('0x37')]=_[_0x4b11('0x38')](_0x58e4ba['model'],_0x58e4ba[_0x4b11('0x36')]);_0xfd58a7[_0x4b11('0x3a')]=_[_0x4b11('0x38')](_0x58e4ba['model'],qs[_0x4b11('0x39')](_0x489080[_0x4b11('0x36')]['fields']));_0xfd58a7[_0x4b11('0x3a')]=_0xfd58a7[_0x4b11('0x3a')][_0x4b11('0x3b')]?_0xfd58a7[_0x4b11('0x3a')]:_0x58e4ba[_0x4b11('0x34')];if(_0x489080[_0x4b11('0x36')][_0x4b11('0x43')]){_0xfd58a7['include']=[{'all':!![]}];}_0xfd58a7=_['merge']({},_0xfd58a7,_0x489080[_0x4b11('0x42')]);return db[_0x4b11('0x30')][_0x4b11('0x4a')](_0xfd58a7)[_0x4b11('0x28')](handleEntityNotFound(_0x1786e1,null))[_0x4b11('0x28')](respondWithResult(_0x1786e1,null))[_0x4b11('0x47')](handleError(_0x1786e1,null));};exports['create']=function(_0x2222f0,_0x5dd014){return db[_0x4b11('0x30')][_0x4b11('0x4b')](_0x2222f0[_0x4b11('0x4c')],{})[_0x4b11('0x28')](respondWithResult(_0x5dd014,0xc9))[_0x4b11('0x47')](handleError(_0x5dd014,null));};exports[_0x4b11('0x27')]=function(_0x1f0949,_0x42a3d6){if(_0x1f0949[_0x4b11('0x4c')]['id']){delete _0x1f0949[_0x4b11('0x4c')]['id'];}return db['WhatsappApplication']['find']({'where':{'id':_0x1f0949[_0x4b11('0x49')]['id']}})[_0x4b11('0x28')](handleEntityNotFound(_0x42a3d6,null))[_0x4b11('0x28')](saveUpdates(_0x1f0949[_0x4b11('0x4c')],null))[_0x4b11('0x28')](respondWithResult(_0x42a3d6,null))[_0x4b11('0x47')](handleError(_0x42a3d6,null));};exports['destroy']=function(_0x56297d,_0x5b1ca6){return db[_0x4b11('0x30')][_0x4b11('0x4a')]({'where':{'id':_0x56297d['params']['id']}})[_0x4b11('0x28')](handleEntityNotFound(_0x5b1ca6,null))[_0x4b11('0x28')](removeEntity(_0x5b1ca6,null))['catch'](handleError(_0x5b1ca6,null));}; \ No newline at end of file +var _0x6333=['VIRTUAL','options','includeAll','include','catch','params','create','body','find','fast-json-patch','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','end','error','stack','name','send','map','WhatsappApplication','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x6333,0x83));var _0x3633=function(_0x3883ef,_0x4bfa0f){_0x3883ef=_0x3883ef-0x0;var _0x59531a=_0x6333[_0x3883ef];return _0x59531a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3633('0x0'));var rp=require('request-promise');var moment=require(_0x3633('0x1'));var BPromise=require(_0x3633('0x2'));var Mustache=require('mustache');var util=require(_0x3633('0x3'));var path=require('path');var sox=require(_0x3633('0x4'));var csv=require(_0x3633('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3633('0x6'));var squel=require(_0x3633('0x7'));var crypto=require(_0x3633('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3633('0x5'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3633('0x9'));var authService=require(_0x3633('0xa'));var qs=require(_0x3633('0xb'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3633('0xc'));var logger=require(_0x3633('0xd'))('api');var utils=require('../../config/utils');var config=require(_0x3633('0xe'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x337f72,_0xf1346){_0xf1346=_0xf1346||0xcc;return function(_0x51a78a){if(_0x51a78a){return _0x337f72[_0x3633('0xf')](_0xf1346);}return _0x337f72[_0x3633('0x10')](_0xf1346)['end']();};}function respondWithResult(_0x3231f9,_0x28f08e){_0x28f08e=_0x28f08e||0xc8;return function(_0x5bf51b){if(_0x5bf51b){return _0x3231f9[_0x3633('0x10')](_0x28f08e)['json'](_0x5bf51b);}};}function respondWithFilteredResult(_0x4c71ea,_0x1b5728){return function(_0x377f19){if(_0x377f19){var _0x2f5eab=typeof _0x1b5728[_0x3633('0x11')]===_0x3633('0x12')&&typeof _0x1b5728[_0x3633('0x13')]==='undefined';var _0x2d123e=_0x377f19[_0x3633('0x14')];var _0x578e08=_0x2f5eab?0x0:_0x1b5728['offset'];var _0x38a7bc=_0x2f5eab?_0x377f19['count']:_0x1b5728['offset']+_0x1b5728[_0x3633('0x13')];var _0x13f7af;if(_0x38a7bc>=_0x2d123e){_0x38a7bc=_0x2d123e;_0x13f7af=0xc8;}else{_0x13f7af=0xce;}_0x4c71ea[_0x3633('0x10')](_0x13f7af);return _0x4c71ea['set'](_0x3633('0x15'),_0x578e08+'-'+_0x38a7bc+'/'+_0x2d123e)[_0x3633('0x16')](_0x377f19);}return null;};}function patchUpdates(_0x107b5a){return function(_0x47d57b){try{jsonpatch[_0x3633('0x17')](_0x47d57b,_0x107b5a,!![]);}catch(_0x2b7f86){return BPromise[_0x3633('0x18')](_0x2b7f86);}return _0x47d57b['save']();};}function saveUpdates(_0x55686f,_0x17a013){return function(_0x4ed8e3){if(_0x4ed8e3){return _0x4ed8e3[_0x3633('0x19')](_0x55686f)[_0x3633('0x1a')](function(_0x1d5270){return _0x1d5270;});}return null;};}function removeEntity(_0x1115dd,_0x4306ef){return function(_0x27511a){if(_0x27511a){return _0x27511a[_0x3633('0x1b')]()[_0x3633('0x1a')](function(){_0x1115dd[_0x3633('0x10')](0xcc)[_0x3633('0x1c')]();});}};}function handleEntityNotFound(_0x2c781f,_0x3844d5){return function(_0x4b0ad7){if(!_0x4b0ad7){_0x2c781f[_0x3633('0xf')](0x194);}return _0x4b0ad7;};}function handleError(_0x145e3c,_0x493e14){_0x493e14=_0x493e14||0x1f4;return function(_0x19c36c){logger[_0x3633('0x1d')](_0x19c36c[_0x3633('0x1e')]);if(_0x19c36c[_0x3633('0x1f')]){delete _0x19c36c[_0x3633('0x1f')];}_0x145e3c[_0x3633('0x10')](_0x493e14)[_0x3633('0x20')](_0x19c36c);};}exports['index']=function(_0x9fa0fd,_0x55d70a){var _0x1ea384={},_0xbf7c64={},_0x2306e4={'count':0x0,'rows':[]};var _0x142c48=_[_0x3633('0x21')](db[_0x3633('0x22')][_0x3633('0x23')],function(_0x2ceabb){return{'name':_0x2ceabb['fieldName'],'type':_0x2ceabb[_0x3633('0x24')][_0x3633('0x25')]};});_0xbf7c64[_0x3633('0x26')]=_[_0x3633('0x21')](_0x142c48,_0x3633('0x1f'));_0xbf7c64[_0x3633('0x27')]=_[_0x3633('0x28')](_0x9fa0fd['query']);_0xbf7c64[_0x3633('0x29')]=_[_0x3633('0x2a')](_0xbf7c64['model'],_0xbf7c64[_0x3633('0x27')]);_0x1ea384[_0x3633('0x2b')]=_[_0x3633('0x2a')](_0xbf7c64[_0x3633('0x26')],qs[_0x3633('0x2c')](_0x9fa0fd['query'][_0x3633('0x2c')]));_0x1ea384['attributes']=_0x1ea384['attributes'][_0x3633('0x2d')]?_0x1ea384['attributes']:_0xbf7c64[_0x3633('0x26')];if(!_0x9fa0fd[_0x3633('0x27')]['hasOwnProperty'](_0x3633('0x2e'))){_0x1ea384[_0x3633('0x13')]=qs['limit'](_0x9fa0fd['query'][_0x3633('0x13')]);_0x1ea384[_0x3633('0x11')]=qs[_0x3633('0x11')](_0x9fa0fd[_0x3633('0x27')]['offset']);}_0x1ea384[_0x3633('0x2f')]=qs[_0x3633('0x30')](_0x9fa0fd[_0x3633('0x27')]['sort']);_0x1ea384[_0x3633('0x31')]=qs['filters'](_[_0x3633('0x32')](_0x9fa0fd[_0x3633('0x27')],_0xbf7c64[_0x3633('0x29')]),_0x142c48);if(_0x9fa0fd[_0x3633('0x27')]['filter']){_0x1ea384[_0x3633('0x31')]=_[_0x3633('0x33')](_0x1ea384['where'],{'$or':_[_0x3633('0x21')](_0x142c48,function(_0x4c4647){if(_0x4c4647[_0x3633('0x24')]!==_0x3633('0x34')){var _0x1b1302={};_0x1b1302[_0x4c4647['name']]={'$like':'%'+_0x9fa0fd[_0x3633('0x27')]['filter']+'%'};return _0x1b1302;}})});}_0x1ea384=_[_0x3633('0x33')]({},_0x1ea384,_0x9fa0fd[_0x3633('0x35')]);var _0x10bbfd={'where':_0x1ea384[_0x3633('0x31')]};return db['WhatsappApplication'][_0x3633('0x14')](_0x10bbfd)[_0x3633('0x1a')](function(_0x1dfdcb){_0x2306e4[_0x3633('0x14')]=_0x1dfdcb;if(_0x9fa0fd[_0x3633('0x27')][_0x3633('0x36')]){_0x1ea384[_0x3633('0x37')]=[{'all':!![]}];}return db[_0x3633('0x22')]['findAll'](_0x1ea384);})['then'](function(_0x2cdeee){_0x2306e4['rows']=_0x2cdeee;return _0x2306e4;})[_0x3633('0x1a')](respondWithFilteredResult(_0x55d70a,_0x1ea384))[_0x3633('0x38')](handleError(_0x55d70a,null));};exports['show']=function(_0x192561,_0x3cf8d9){var _0x1edb4b={'raw':!![],'where':{'id':_0x192561[_0x3633('0x39')]['id']}},_0x399a80={};_0x399a80['model']=_['keys'](db[_0x3633('0x22')][_0x3633('0x23')]);_0x399a80[_0x3633('0x27')]=_[_0x3633('0x28')](_0x192561[_0x3633('0x27')]);_0x399a80[_0x3633('0x29')]=_[_0x3633('0x2a')](_0x399a80['model'],_0x399a80[_0x3633('0x27')]);_0x1edb4b[_0x3633('0x2b')]=_[_0x3633('0x2a')](_0x399a80['model'],qs['fields'](_0x192561[_0x3633('0x27')]['fields']));_0x1edb4b[_0x3633('0x2b')]=_0x1edb4b['attributes'][_0x3633('0x2d')]?_0x1edb4b[_0x3633('0x2b')]:_0x399a80[_0x3633('0x26')];if(_0x192561[_0x3633('0x27')][_0x3633('0x36')]){_0x1edb4b[_0x3633('0x37')]=[{'all':!![]}];}_0x1edb4b=_[_0x3633('0x33')]({},_0x1edb4b,_0x192561[_0x3633('0x35')]);return db['WhatsappApplication']['find'](_0x1edb4b)[_0x3633('0x1a')](handleEntityNotFound(_0x3cf8d9,null))[_0x3633('0x1a')](respondWithResult(_0x3cf8d9,null))['catch'](handleError(_0x3cf8d9,null));};exports[_0x3633('0x3a')]=function(_0x352260,_0x2f14e5){return db['WhatsappApplication']['create'](_0x352260[_0x3633('0x3b')],{})[_0x3633('0x1a')](respondWithResult(_0x2f14e5,0xc9))[_0x3633('0x38')](handleError(_0x2f14e5,null));};exports[_0x3633('0x19')]=function(_0xb39d18,_0x2ae7bd){if(_0xb39d18['body']['id']){delete _0xb39d18[_0x3633('0x3b')]['id'];}return db[_0x3633('0x22')][_0x3633('0x3c')]({'where':{'id':_0xb39d18[_0x3633('0x39')]['id']}})[_0x3633('0x1a')](handleEntityNotFound(_0x2ae7bd,null))[_0x3633('0x1a')](saveUpdates(_0xb39d18[_0x3633('0x3b')],null))['then'](respondWithResult(_0x2ae7bd,null))[_0x3633('0x38')](handleError(_0x2ae7bd,null));};exports['destroy']=function(_0x321429,_0x31a072){return db['WhatsappApplication'][_0x3633('0x3c')]({'where':{'id':_0x321429['params']['id']}})[_0x3633('0x1a')](handleEntityNotFound(_0x31a072,null))[_0x3633('0x1a')](removeEntity(_0x31a072,null))[_0x3633('0x38')](handleError(_0x31a072,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 43903d8..ebde0a2 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 _0xc43c=['rimraf','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0xc43c,0x152));var _0xcc43=function(_0x1ee5a9,_0x2ae8eb){_0x1ee5a9=_0x1ee5a9-0x0;var _0x2ab626=_0xc43c[_0x1ee5a9];return _0x2ab626;};'use strict';var _=require(_0xcc43('0x0'));var util=require(_0xcc43('0x1'));var logger=require(_0xcc43('0x2'))(_0xcc43('0x3'));var moment=require(_0xcc43('0x4'));var BPromise=require(_0xcc43('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc43('0x6'));var rimraf=require(_0xcc43('0x7'));var config=require('../../config/environment');var attributes=require(_0xcc43('0x8'));module[_0xcc43('0x9')]=function(_0x217a5e,_0x17d1a2){return _0x217a5e[_0xcc43('0xa')](_0xcc43('0xb'),attributes,{'tableName':_0xcc43('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcc43('0xd'),'collate':_0xcc43('0xe')});}; \ No newline at end of file +var _0x0f89=['../../config/environment','./whatsappApplication.attributes','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x317cc3,_0xac1185){var _0x281c9a=function(_0x114f48){while(--_0x114f48){_0x317cc3['push'](_0x317cc3['shift']());}};_0x281c9a(++_0xac1185);}(_0x0f89,0x111));var _0x90f8=function(_0x39d62a,_0x366229){_0x39d62a=_0x39d62a-0x0;var _0x266a40=_0x0f89[_0x39d62a];return _0x266a40;};'use strict';var _=require(_0x90f8('0x0'));var util=require(_0x90f8('0x1'));var logger=require(_0x90f8('0x2'))('api');var moment=require(_0x90f8('0x3'));var BPromise=require(_0x90f8('0x4'));var rp=require(_0x90f8('0x5'));var fs=require('fs');var path=require(_0x90f8('0x6'));var rimraf=require('rimraf');var config=require(_0x90f8('0x7'));var attributes=require(_0x90f8('0x8'));module['exports']=function(_0x7b8d25,_0x4439a9){return _0x7b8d25[_0x90f8('0x9')](_0x90f8('0xa'),attributes,{'tableName':_0x90f8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x90f8('0xc'),'collate':_0x90f8('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 3abaeb4..993cf0b 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 _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','catch','util'];(function(_0x5af089,_0x524923){var _0x38f5bc=function(_0x35b57a){while(--_0x35b57a){_0x5af089['push'](_0x5af089['shift']());}};_0x38f5bc(++_0x524923);}(_0xedd9,0xfc));var _0x9edd=function(_0x5a9130,_0x1a32f3){_0x5a9130=_0x5a9130-0x0;var _0x53580d=_0xedd9[_0x5a9130];return _0x53580d;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file +var _0x6f0d=['WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x50c912,_0x42b23b){var _0x4b51e5=function(_0x305da9){while(--_0x305da9){_0x50c912['push'](_0x50c912['shift']());}};_0x4b51e5(++_0x42b23b);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x2883ca,_0xda104d){_0x2883ca=_0x2883ca-0x0;var _0x4ba901=_0x6f0d[_0x2883ca];return _0x4ba901;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var moment=require(_0xd6f0('0x1'));var BPromise=require(_0xd6f0('0x2'));var rs=require(_0xd6f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6f0('0x4'))['db'];var utils=require(_0xd6f0('0x5'));var logger=require(_0xd6f0('0x6'))(_0xd6f0('0x7'));var config=require(_0xd6f0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd6f0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe21ac4,_0x1af29c,_0x8b89a9){return new BPromise(function(_0x1a48a0,_0x4c4916){return client['request'](_0xe21ac4,_0x8b89a9)[_0xd6f0('0xa')](function(_0x272c4e){logger[_0xd6f0('0xb')](_0xd6f0('0xc'),_0x1af29c,_0xd6f0('0xd'));logger['debug'](_0xd6f0('0xe'),_0x1af29c,_0xd6f0('0xd'),JSON[_0xd6f0('0xf')](_0x272c4e));if(_0x272c4e[_0xd6f0('0x10')]){if(_0x272c4e['error'][_0xd6f0('0x11')]===0x1f4){logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x272c4e[_0xd6f0('0x10')][_0xd6f0('0x12')]);return _0x4c4916(_0x272c4e[_0xd6f0('0x10')][_0xd6f0('0x12')]);}logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x272c4e['error'][_0xd6f0('0x12')]);return _0x1a48a0(_0x272c4e[_0xd6f0('0x10')]['message']);}else{logger[_0xd6f0('0xb')]('WhatsappApplication,\x20%s,\x20%s',_0x1af29c,_0xd6f0('0xd'));_0x1a48a0(_0x272c4e[_0xd6f0('0x13')][_0xd6f0('0x12')]);}})[_0xd6f0('0x14')](function(_0x64ff5f){logger[_0xd6f0('0x10')](_0xd6f0('0xc'),_0x1af29c,_0x64ff5f);_0x4c4916(_0x64ff5f);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index cbbcb4e..23c3532 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 _0x3831=['whatsappinteraction:destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./whatsappInteraction.controller','get','isAuthenticated','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','whatsappinteraction:update','update','delete'];(function(_0x8b2f2c,_0x5c3fa9){var _0x3ce00d=function(_0x47d820){while(--_0x47d820){_0x8b2f2c['push'](_0x8b2f2c['shift']());}};_0x3ce00d(++_0x5c3fa9);}(_0x3831,0x14c));var _0x1383=function(_0x1c3b41,_0x50f776){_0x1c3b41=_0x1c3b41-0x0;var _0x41e3fe=_0x3831[_0x1c3b41];return _0x41e3fe;};'use strict';var multer=require(_0x1383('0x0'));var util=require('util');var path=require(_0x1383('0x1'));var timeout=require(_0x1383('0x2'));var express=require(_0x1383('0x3'));var router=express[_0x1383('0x4')]();var fs_extra=require(_0x1383('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1383('0x6'));var config=require('../../config/environment');var controller=require(_0x1383('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1383('0x8')]('/describe',auth[_0x1383('0x9')](),controller[_0x1383('0xa')]);router[_0x1383('0x8')](_0x1383('0xb'),auth[_0x1383('0x9')](),controller[_0x1383('0xc')]);router[_0x1383('0x8')](_0x1383('0xd'),auth['isAuthenticated'](),controller[_0x1383('0xe')]);router[_0x1383('0x8')](_0x1383('0xf'),auth[_0x1383('0x9')](),controller[_0x1383('0x10')]);router['post']('/',auth[_0x1383('0x9')](),controller[_0x1383('0x11')]);router[_0x1383('0x12')]('/:id/messages',auth['isAuthenticated'](),controller[_0x1383('0x13')]);router[_0x1383('0x12')](_0x1383('0x14'),auth[_0x1383('0x9')](),interaction[_0x1383('0x15')](_0x1383('0x16'),_0x1383('0x17')),controller[_0x1383('0x18')]);router['put'](_0x1383('0xb'),auth[_0x1383('0x9')](),interaction[_0x1383('0x15')](_0x1383('0x16'),_0x1383('0x19')),controller[_0x1383('0x1a')]);router[_0x1383('0x1b')]('/:id',auth['isAuthenticated'](),interaction[_0x1383('0x15')]('whatsapp',_0x1383('0x1c')),controller['destroy']);router['delete']('/:id/tags',auth[_0x1383('0x9')](),controller['removeTags']);module[_0x1383('0x1d')]=router; \ No newline at end of file +var _0xc7a3=['show','/:id/messages','post','create','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','addTags','whatsapp','update','whatsappinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc7a3,0xbd));var _0x3c7a=function(_0x4176cc,_0x35766d){_0x4176cc=_0x4176cc-0x0;var _0x4e5532=_0xc7a3[_0x4176cc];return _0x4e5532;};'use strict';var multer=require('multer');var util=require(_0x3c7a('0x0'));var path=require(_0x3c7a('0x1'));var timeout=require(_0x3c7a('0x2'));var express=require(_0x3c7a('0x3'));var router=express[_0x3c7a('0x4')]();var fs_extra=require(_0x3c7a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3c7a('0x6'));var config=require(_0x3c7a('0x7'));var controller=require('./whatsappInteraction.controller');router[_0x3c7a('0x8')]('/',auth[_0x3c7a('0x9')](),controller[_0x3c7a('0xa')]);router['get'](_0x3c7a('0xb'),auth['isAuthenticated'](),controller[_0x3c7a('0xc')]);router['get'](_0x3c7a('0xd'),auth[_0x3c7a('0x9')](),controller[_0x3c7a('0xe')]);router['get'](_0x3c7a('0xf'),auth[_0x3c7a('0x9')](),controller['getMessages']);router[_0x3c7a('0x8')]('/:id/download',auth[_0x3c7a('0x9')](),controller['download']);router[_0x3c7a('0x10')]('/',auth[_0x3c7a('0x9')](),controller[_0x3c7a('0x11')]);router[_0x3c7a('0x10')](_0x3c7a('0xf'),auth['isAuthenticated'](),controller[_0x3c7a('0x12')]);router[_0x3c7a('0x10')](_0x3c7a('0x13'),auth[_0x3c7a('0x9')](),interaction[_0x3c7a('0x14')]('whatsapp',_0x3c7a('0x15')),controller[_0x3c7a('0x16')]);router['put']('/:id',auth[_0x3c7a('0x9')](),interaction[_0x3c7a('0x14')](_0x3c7a('0x17'),'whatsappinteraction:update'),controller[_0x3c7a('0x18')]);router['delete'](_0x3c7a('0xd'),auth[_0x3c7a('0x9')](),interaction[_0x3c7a('0x14')](_0x3c7a('0x17'),_0x3c7a('0x19')),controller[_0x3c7a('0x1a')]);router['delete'](_0x3c7a('0x13'),auth[_0x3c7a('0x9')](),controller[_0x3c7a('0x1b')]);module[_0x3c7a('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 2f8a3e9..8ba4084 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 _0xfaf2=['INTEGER','sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfaf2,0x169));var _0x2faf=function(_0x4a4b2f,_0x15a25a){_0x4a4b2f=_0x4a4b2f-0x0;var _0x43fb3f=_0xfaf2[_0x4a4b2f];return _0x43fb3f;};'use strict';var Sequelize=require(_0x2faf('0x0'));var moment=require(_0x2faf('0x1'));module[_0x2faf('0x2')]={'closed':{'type':Sequelize[_0x2faf('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2faf('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x2faf('0x5')]},'thirdDisposition':{'type':Sequelize[_0x2faf('0x5')]},'note':{'type':Sequelize[_0x2faf('0x5')]},'phone':{'type':Sequelize[_0x2faf('0x5')]},'read1stAt':{'type':Sequelize[_0x2faf('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x2faf('0x6')]('in',_0x2faf('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x2faf('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x2faf('0x8')]}}; \ No newline at end of file +var _0x56c8=['moment','exports','BOOLEAN','STRING','ENUM','out','DATE','sequelize'];(function(_0x55595e,_0x3de1f2){var _0x36e1c2=function(_0x272dbd){while(--_0x272dbd){_0x55595e['push'](_0x55595e['shift']());}};_0x36e1c2(++_0x3de1f2);}(_0x56c8,0x12f));var _0x856c=function(_0x3d4860,_0x15c37e){_0x3d4860=_0x3d4860-0x0;var _0x12519a=_0x56c8[_0x3d4860];return _0x12519a;};'use strict';var Sequelize=require(_0x856c('0x0'));var moment=require(_0x856c('0x1'));module[_0x856c('0x2')]={'closed':{'type':Sequelize[_0x856c('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x856c('0x4')]},'secondDisposition':{'type':Sequelize[_0x856c('0x4')]},'thirdDisposition':{'type':Sequelize[_0x856c('0x4')]},'note':{'type':Sequelize[_0x856c('0x4')]},'phone':{'type':Sequelize[_0x856c('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x856c('0x5')]('in',_0x856c('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x856c('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x856c('0x5')]('in',_0x856c('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x856c('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 422b213..ee6a771 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 _0x8b26=['zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','json','offset','undefined','count','limit','then','destroy','error','stack','name','send','WhatsappInteraction','fieldName','type','key','findAll','whatsapp','user','catch','params','keys','query','filters','intersection','model','fields','attributes','length','includeAll','include','options','find','create','update','body','describe','addMessage','WhatsappMessage','omit','getMessages','findOne','rawAttributes','hasOwnProperty','order','sort','where','WhatsappInteractionId','filter','merge','map','split','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','ids','color','emit','whatsappInteractionTags:save','removeTags','download','root','server','files','tmp','attachments','join','format','transcript-%d-%s.zip','User','push','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','closed','closedAt','toString','basename','existsSync','createReadStream','pipe','createWriteStream','out','fullname','System','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','rimraf'];(function(_0x123be2,_0x547a9e){var _0x47fd4c=function(_0x133bbb){while(--_0x133bbb){_0x123be2['push'](_0x123be2['shift']());}};_0x47fd4c(++_0x547a9e);}(_0x8b26,0x1f3));var _0x68b2=function(_0x336c8b,_0x56b55b){_0x336c8b=_0x336c8b-0x0;var _0x4dd2f6=_0x8b26[_0x336c8b];return _0x4dd2f6;};'use strict';var rimraf=require(_0x68b2('0x0'));var zipdir=require(_0x68b2('0x1'));var moment=require(_0x68b2('0x2'));var BPromise=require('bluebird');var util=require(_0x68b2('0x3'));var path=require(_0x68b2('0x4'));var ejs=require(_0x68b2('0x5'));var fs=require('fs');var _=require(_0x68b2('0x6'));var Redis=require(_0x68b2('0x7'));var interaction=require(_0x68b2('0x8'));var qs=require(_0x68b2('0x9'));var pdf=require(_0x68b2('0xa'));var logger=require(_0x68b2('0xb'))(_0x68b2('0xc'));var config=require('../../config/environment');var db=require(_0x68b2('0xd'))['db'];config[_0x68b2('0xe')]=_[_0x68b2('0xf')](config[_0x68b2('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x68b2('0x10'))(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0x68b2('0x11')](socket);function respondWithStatusCode(_0x17fd91,_0x179350){_0x179350=_0x179350||0xcc;return function(_0x4b31c6){if(_0x4b31c6){return _0x17fd91[_0x68b2('0x12')](_0x179350);}return _0x17fd91['status'](_0x179350)['end']();};}function respondWithResult(_0x856dfe,_0x1a12d3){_0x1a12d3=_0x1a12d3||0xc8;return function(_0x2688a8){if(_0x2688a8){return _0x856dfe[_0x68b2('0x13')](_0x1a12d3)[_0x68b2('0x14')](_0x2688a8);}};}function respondWithFilteredResult(_0x3a57c2,_0x26ac07){return function(_0x3b216f){if(_0x3b216f){var _0x43536e=typeof _0x26ac07[_0x68b2('0x15')]===_0x68b2('0x16')&&typeof _0x26ac07['limit']===_0x68b2('0x16');var _0x34881a=_0x3b216f[_0x68b2('0x17')];var _0x1f1e43=_0x43536e?0x0:_0x26ac07[_0x68b2('0x15')];var _0x528823=_0x43536e?_0x3b216f[_0x68b2('0x17')]:_0x26ac07['offset']+_0x26ac07[_0x68b2('0x18')];var _0x306167;if(_0x528823>=_0x34881a){_0x528823=_0x34881a;_0x306167=0xc8;}else{_0x306167=0xce;}_0x3a57c2[_0x68b2('0x13')](_0x306167);return _0x3a57c2['set']('Content-Range',_0x1f1e43+'-'+_0x528823+'/'+_0x34881a)[_0x68b2('0x14')](_0x3b216f);}return null;};}function saveUpdates(_0x200bf5){return function(_0x42e318){if(_0x42e318){return _0x42e318['update'](_0x200bf5)[_0x68b2('0x19')](function(_0x3b8a4a){return _0x3b8a4a;});}return null;};}function removeEntity(_0x3a969f){return function(_0x28af4d){if(_0x28af4d){return _0x28af4d[_0x68b2('0x1a')]()[_0x68b2('0x19')](function(){_0x3a969f[_0x68b2('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f1c44){return function(_0x128c6b){if(!_0x128c6b){_0x2f1c44[_0x68b2('0x12')](0x194);}return _0x128c6b;};}function handleError(_0x46b5c4,_0x3df744){_0x3df744=_0x3df744||0x1f4;return function(_0x5e0271){logger[_0x68b2('0x1b')](_0x5e0271[_0x68b2('0x1c')]);if(_0x5e0271[_0x68b2('0x1d')]){delete _0x5e0271[_0x68b2('0x1d')];}_0x46b5c4['status'](_0x3df744)[_0x68b2('0x1e')](_0x5e0271);};}exports['index']=function(_0x1ed70d,_0x25eed7){var _0x41d80d={};var _0x4a81b3=_['map'](db[_0x68b2('0x1f')]['rawAttributes'],function(_0x1ceb95){return{'name':_0x1ceb95[_0x68b2('0x20')],'type':_0x1ceb95[_0x68b2('0x21')][_0x68b2('0x22')]};});_0x41d80d=qs['getOptions'](_0x4a81b3,_0x1ed70d);return interaction[_0x68b2('0x23')](_0x68b2('0x24'),_0x1ed70d['query'],_0x1ed70d[_0x68b2('0x25')],_0x41d80d,_0x4a81b3)['then'](respondWithFilteredResult(_0x25eed7,_0x41d80d))[_0x68b2('0x26')](handleError(_0x25eed7,null));};exports['show']=function(_0x360dd2,_0x432822){var _0x4248f8={'raw':![],'where':{'id':_0x360dd2[_0x68b2('0x27')]['id']}},_0x356899={};_0x356899['model']=_[_0x68b2('0x28')](db[_0x68b2('0x1f')]['rawAttributes']);_0x356899[_0x68b2('0x29')]=_['keys'](_0x360dd2[_0x68b2('0x29')]);_0x356899[_0x68b2('0x2a')]=_[_0x68b2('0x2b')](_0x356899[_0x68b2('0x2c')],_0x356899[_0x68b2('0x29')]);_0x4248f8['attributes']=_['intersection'](_0x356899[_0x68b2('0x2c')],qs[_0x68b2('0x2d')](_0x360dd2[_0x68b2('0x29')][_0x68b2('0x2d')]));_0x4248f8[_0x68b2('0x2e')]=_0x4248f8['attributes'][_0x68b2('0x2f')]?_0x4248f8[_0x68b2('0x2e')]:_0x356899[_0x68b2('0x2c')];if(_0x360dd2[_0x68b2('0x29')][_0x68b2('0x30')]){_0x4248f8[_0x68b2('0x31')]=[{'all':!![]}];}_0x4248f8=_['merge']({},_0x4248f8,_0x360dd2[_0x68b2('0x32')]);return db['WhatsappInteraction'][_0x68b2('0x33')](_0x4248f8)[_0x68b2('0x19')](handleEntityNotFound(_0x432822,null))[_0x68b2('0x19')](respondWithResult(_0x432822,null))[_0x68b2('0x26')](handleError(_0x432822,null));};exports['create']=function(_0x58552d,_0x37bfbc){return db[_0x68b2('0x1f')][_0x68b2('0x34')](_0x58552d['body'],{})[_0x68b2('0x19')](respondWithResult(_0x37bfbc,0xc9))['catch'](handleError(_0x37bfbc,null));};exports[_0x68b2('0x35')]=function(_0x14be76,_0x2066d3){if(_0x14be76[_0x68b2('0x36')]['id']){delete _0x14be76[_0x68b2('0x36')]['id'];}return db[_0x68b2('0x1f')][_0x68b2('0x33')]({'where':{'id':_0x14be76[_0x68b2('0x27')]['id']}})[_0x68b2('0x19')](handleEntityNotFound(_0x2066d3,null))['then'](saveUpdates(_0x14be76[_0x68b2('0x36')],null))[_0x68b2('0x19')](respondWithResult(_0x2066d3,null))[_0x68b2('0x26')](handleError(_0x2066d3,null));};exports[_0x68b2('0x1a')]=function(_0x275aeb,_0x3d0829){return db[_0x68b2('0x1f')][_0x68b2('0x33')]({'where':{'id':_0x275aeb[_0x68b2('0x27')]['id']}})[_0x68b2('0x19')](handleEntityNotFound(_0x3d0829,null))[_0x68b2('0x19')](removeEntity(_0x3d0829,null))[_0x68b2('0x26')](handleError(_0x3d0829,null));};exports[_0x68b2('0x37')]=function(_0x373171,_0x355c6d){return db['WhatsappInteraction']['describe']()[_0x68b2('0x19')](respondWithResult(_0x355c6d,null))[_0x68b2('0x26')](handleError(_0x355c6d,null));};exports[_0x68b2('0x38')]=function(_0x47ab66,_0xb370cb){return db[_0x68b2('0x39')][_0x68b2('0x33')]({'where':{'id':_0x47ab66['params']['id']}})['then'](handleEntityNotFound(_0xb370cb,null))[_0x68b2('0x19')](function(_0x39a50c){if(_0x39a50c){return _0x39a50c['addMessage'](_0x47ab66[_0x68b2('0x36')]['ids'],_[_0x68b2('0x3a')](_0x47ab66[_0x68b2('0x36')],['ids','id'])||{});}})[_0x68b2('0x19')](respondWithResult(_0xb370cb,null))[_0x68b2('0x26')](handleError(_0xb370cb,null));};exports[_0x68b2('0x3b')]=function(_0xe3f8a9,_0x42df60){var _0x4ede8f={'raw':![],'where':{}};var _0x4a3c80={};var _0x1e2828={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x68b2('0x3c')]({'where':{'id':_0xe3f8a9['params']['id']}})[_0x68b2('0x19')](handleEntityNotFound(_0x42df60,null))['then'](function(_0x299298){if(_0x299298){_0x4a3c80[_0x68b2('0x2c')]=_[_0x68b2('0x28')](db['WhatsappMessage'][_0x68b2('0x3d')]);_0x4a3c80[_0x68b2('0x29')]=_[_0x68b2('0x28')](_0xe3f8a9['query']);_0x4a3c80[_0x68b2('0x2a')]=_[_0x68b2('0x2b')](_0x4a3c80[_0x68b2('0x2c')],_0x4a3c80['query']);_0x4ede8f[_0x68b2('0x2e')]=_[_0x68b2('0x2b')](_0x4a3c80[_0x68b2('0x2c')],qs['fields'](_0xe3f8a9['query'][_0x68b2('0x2d')]));_0x4ede8f[_0x68b2('0x2e')]=_0x4ede8f[_0x68b2('0x2e')][_0x68b2('0x2f')]?_0x4ede8f[_0x68b2('0x2e')]:_0x4a3c80[_0x68b2('0x2c')];if(!_0xe3f8a9[_0x68b2('0x29')][_0x68b2('0x3e')]('nolimit')){_0x4ede8f['limit']=qs[_0x68b2('0x18')](_0xe3f8a9[_0x68b2('0x29')][_0x68b2('0x18')]);_0x4ede8f[_0x68b2('0x15')]=qs[_0x68b2('0x15')](_0xe3f8a9[_0x68b2('0x29')][_0x68b2('0x15')]);}_0x4ede8f[_0x68b2('0x3f')]=qs[_0x68b2('0x40')](_0xe3f8a9['query'][_0x68b2('0x40')]);_0x4ede8f['where']=qs[_0x68b2('0x2a')](_['pick'](_0xe3f8a9['query'],_0x4a3c80[_0x68b2('0x2a')]));_0x4ede8f[_0x68b2('0x41')][_0x68b2('0x42')]=_0x299298['id'];if(_0xe3f8a9[_0x68b2('0x29')][_0x68b2('0x43')]){_0x4ede8f['where']=_[_0x68b2('0x44')](_0x4ede8f[_0x68b2('0x41')],{'$or':_[_0x68b2('0x45')](_0x4ede8f[_0x68b2('0x2e')],function(_0x156919){var _0x5df08a={};_0x5df08a[_0x156919]={'$like':'%'+_0xe3f8a9[_0x68b2('0x29')][_0x68b2('0x43')]+'%'};return _0x5df08a;})});}if(_0xe3f8a9['query']['$gte']){var _0x3915d1=_0xe3f8a9[_0x68b2('0x29')]['$gte'][_0x68b2('0x46')](',');var _0x3a2205={};_0x3a2205[_0x3915d1[0x0]]={'$gte':moment(_0x3915d1[0x1])['format'](_0x68b2('0x47'))};_0x4ede8f['where']=_[_0x68b2('0x44')](_0x4ede8f[_0x68b2('0x41')],_0x3a2205);}_0x4ede8f=_['merge']({},_0x4ede8f,_0xe3f8a9[_0x68b2('0x32')]);return db[_0x68b2('0x39')]['count']({'where':_0x4ede8f[_0x68b2('0x41')]})['then'](function(_0x3a472f){_0x1e2828[_0x68b2('0x17')]=_0x3a472f;if(_0xe3f8a9['query']['includeAll']){_0x4ede8f[_0x68b2('0x31')]=[{'all':!![]}];}return db[_0x68b2('0x39')][_0x68b2('0x23')](_0x4ede8f);})[_0x68b2('0x19')](function(_0xcdde95){_0x1e2828[_0x68b2('0x48')]=_0xcdde95;return _0x1e2828;});}})[_0x68b2('0x19')](respondWithFilteredResult(_0x42df60,_0x4ede8f))['catch'](handleError(_0x42df60,null));};exports['addTags']=function(_0x108308,_0x3c75af){return db[_0x68b2('0x1f')][_0x68b2('0x33')]({'where':{'id':_0x108308['params']['id']}})[_0x68b2('0x19')](handleEntityNotFound(_0x3c75af,null))['then'](function(_0x407002){if(_0x407002){return _0x407002[_0x68b2('0x49')](_0x108308[_0x68b2('0x36')][_0x68b2('0x4a')],_[_0x68b2('0x3a')](_0x108308[_0x68b2('0x36')],[_0x68b2('0x4a'),'id'])||{})['spread'](function(){return db['Tag'][_0x68b2('0x23')]({'attributes':['id','name',_0x68b2('0x4b')],'where':{'id':_0x108308['body'][_0x68b2('0x4a')]}});})[_0x68b2('0x19')](function(_0x18c6c2){socket[_0x68b2('0x4c')](_0x68b2('0x4d'),{'id':Number(_0x108308[_0x68b2('0x27')]['id']),'tags':_0x18c6c2||[]});return{'id':Number(_0x108308[_0x68b2('0x27')]['id']),'tags':_0x18c6c2||[]};});}})[_0x68b2('0x19')](respondWithResult(_0x3c75af,null))['catch'](handleError(_0x3c75af,null));};exports[_0x68b2('0x4e')]=function(_0x593377,_0x55268c){return db[_0x68b2('0x1f')][_0x68b2('0x33')]({'where':{'id':_0x593377[_0x68b2('0x27')]['id']}})[_0x68b2('0x19')](handleEntityNotFound(_0x55268c,null))[_0x68b2('0x19')](function(_0x1cdee1){if(_0x1cdee1){return _0x1cdee1[_0x68b2('0x4e')](_0x593377['query'][_0x68b2('0x4a')]);}})['then'](respondWithStatusCode(_0x55268c,null))['catch'](handleError(_0x55268c,null));};exports[_0x68b2('0x4f')]=function(_0x48224d,_0x53e801){var _0xe86f45=moment()['unix']()['toString']();var _0x8c9e9b=path['join'](config[_0x68b2('0x50')],_0x68b2('0x51'),_0x68b2('0x52'),_0x68b2('0x53'));var _0x4c0e40=path['join'](config['root'],'server',_0x68b2('0x52'),_0x68b2('0x54'));var _0x465f2a=path[_0x68b2('0x55')](_0x8c9e9b,_0xe86f45);var _0x425628=util[_0x68b2('0x56')](_0x68b2('0x57'),_0x48224d[_0x68b2('0x27')]['id'],_0xe86f45);var _0x4d03d9=path[_0x68b2('0x55')](_0x8c9e9b,_0x425628);var _0x3f84c0=[];_0x3f84c0['push']({'model':db[_0x68b2('0x58')],'as':_0x68b2('0x58'),'attributes':['id','fullname'],'raw':!![]});_0x3f84c0[_0x68b2('0x59')]({'model':db[_0x68b2('0x5a')],'as':_0x68b2('0x5b'),'attributes':['id',_0x68b2('0x5c'),_0x68b2('0x5d')],'raw':!![]});if(_0x48224d[_0x68b2('0x29')][_0x68b2('0x54')]){_0x3f84c0[_0x68b2('0x59')]({'model':db[_0x68b2('0x5e')],'as':'Attachment','raw':!![]});}var _0x3e7fcb=[{'model':db['WhatsappMessage'],'as':_0x68b2('0x5f'),'attributes':['id',_0x68b2('0x36'),_0x68b2('0x60'),_0x68b2('0x61'),_0x68b2('0x62'),_0x68b2('0x63')],'include':_0x3f84c0}];_0x3e7fcb['push']({'model':db[_0x68b2('0x64')],'as':_0x68b2('0x65'),'attributes':['id',_0x68b2('0x1d')]});_0x3e7fcb[_0x68b2('0x59')]({'model':db[_0x68b2('0x58')],'as':_0x68b2('0x66'),'attributes':['id','fullname']});return db[_0x68b2('0x1f')][_0x68b2('0x33')]({'where':{'id':_0x48224d['params']['id']},'include':_0x3e7fcb})[_0x68b2('0x19')](handleEntityNotFound(_0x53e801,null))[_0x68b2('0x19')](function(_0xdcd43){if(_0xdcd43){var _0x4e74be=_0xdcd43[_0x68b2('0x67')]({'plain':!![]});fs[_0x68b2('0x68')](_0x465f2a);var _0x4b52be={'channel':_0x68b2('0x69'),'account':_0x4e74be['Account'][_0x68b2('0x1d')],'agent':_0x4e74be[_0x68b2('0x66')]?_0x4e74be[_0x68b2('0x66')]['fullname']:_0x68b2('0x6a'),'createdAt':moment(_0x4e74be[_0x68b2('0x60')])[_0x68b2('0x56')](_0x68b2('0x47'))['toString'](),'closedAt':_0x4e74be[_0x68b2('0x6b')]?moment(_0x4e74be[_0x68b2('0x6c')])['format'](_0x68b2('0x47'))[_0x68b2('0x6d')]():'','disposition':_0x4e74be['disposition'],'messages':_(_0x4e74be[_0x68b2('0x5f')])[_0x68b2('0x43')]({'secret':![]})[_0x68b2('0x45')](function(_0x3b60e6){if(_0x3b60e6[_0x68b2('0x5e')]){var _0x34788f=path[_0x68b2('0x55')](_0x4c0e40,_0x3b60e6[_0x68b2('0x5e')][_0x68b2('0x6e')]);if(fs[_0x68b2('0x6f')](_0x34788f)){fs[_0x68b2('0x70')](_0x34788f)[_0x68b2('0x71')](fs[_0x68b2('0x72')](path[_0x68b2('0x55')](_0x465f2a,_0x3b60e6[_0x68b2('0x5e')][_0x68b2('0x6e')])));}}return{'date':moment(_0x3b60e6[_0x68b2('0x60')])[_0x68b2('0x56')]('YYYY-MM-DD\x20HH:mm:ss')[_0x68b2('0x6d')](),'sender':_0x3b60e6[_0x68b2('0x61')]===_0x68b2('0x73')?_0x3b60e6[_0x68b2('0x58')]?_0x3b60e6['User'][_0x68b2('0x74')]:_0x68b2('0x75'):_0x3b60e6[_0x68b2('0x5b')][_0x68b2('0x5c')]+(_0x3b60e6[_0x68b2('0x5b')][_0x68b2('0x5d')]?'\x20'+_0x3b60e6['Contact']['lastName']:''),'body':_0x3b60e6[_0x68b2('0x5e')]?_0x3b60e6[_0x68b2('0x5e')][_0x68b2('0x6e')]:_0x3b60e6['body'],'direction':_0x3b60e6[_0x68b2('0x61')]===_0x68b2('0x73')?'A':'C','secret':_0x3b60e6[_0x68b2('0x62')],'read':_0x3b60e6[_0x68b2('0x63')],'attachment':_0x3b60e6[_0x68b2('0x5e')]};})['value']()};return ejs[_0x68b2('0x76')](path['join'](config[_0x68b2('0x50')],'server',_0x68b2('0x77'),_0x68b2('0x78')),{'interaction':_0x4b52be})['then'](function(_0x370d02){var _0x2f4104=path[_0x68b2('0x55')](_0x465f2a,'transcript-'+_0x4e74be['id']+'-'+_0xe86f45+_0x68b2('0x79'));var _0x2628ef={'path':_0x2f4104,'channel':_0x68b2('0x69'),'interactionId':_0x4e74be['id']};return pdf[_0x68b2('0x7a')](_0x370d02,_0x2628ef);})[_0x68b2('0x19')](function(){return new BPromise(function(_0x2ae924,_0x4d339f){zipdir(_0x465f2a,{'saveTo':_0x4d03d9},function(_0x6afd39,_0x2218dc){if(_0x6afd39)return _0x4d339f(_0x6afd39);return _0x2ae924(_0x2218dc);});})[_0x68b2('0x19')](function(){return new BPromise(function(_0x7bffed,_0xfcf711){rimraf(_0x465f2a,function(_0x1a2aef){if(_0x1a2aef)_0xfcf711(_0x1a2aef);return _0x7bffed();});});})[_0x68b2('0x19')](function(){return _0x53e801[_0x68b2('0x4f')](_0x4d03d9,_0x425628,function(_0x4d9b14){if(_0x4d9b14){console[_0x68b2('0x7b')](_0x68b2('0x7c'),_0x4d9b14);}else{fs['unlinkSync'](_0x4d03d9);}});});});}else{return _0x53e801[_0x68b2('0x12')](0xc8);}})[_0x68b2('0x26')](handleError(_0x53e801,null));}; \ No newline at end of file +var _0xd65c=['pipe','direction','out','value','views','downloadInteraction.ejs','createPdfFromHTML','log','unlinkSync','rimraf','zip-dir','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','register','status','end','offset','undefined','limit','count','set','Content-Range','json','then','destroy','sendStatus','error','stack','name','send','map','WhatsappInteraction','fieldName','type','key','findAll','user','catch','show','params','model','keys','query','filters','intersection','attributes','fields','length','include','merge','options','find','create','body','update','describe','addMessage','WhatsappMessage','ids','omit','getMessages','findOne','rawAttributes','hasOwnProperty','nolimit','order','where','pick','WhatsappInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','setTags','spread','Tag','emit','whatsappInteractionTags:save','removeTags','download','toString','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','User','fullname','Contact','firstName','lastName','Attachment','createdAt','read','WhatsappAccount','Account','Owner','get','Whatsapp','N.A.','format','closed','closedAt','Messages','basename','existsSync'];(function(_0x1a6c7f,_0x5aee3f){var _0x1d378d=function(_0x3faee3){while(--_0x3faee3){_0x1a6c7f['push'](_0x1a6c7f['shift']());}};_0x1d378d(++_0x5aee3f);}(_0xd65c,0x177));var _0xcd65=function(_0x5e0092,_0x4ad55b){_0x5e0092=_0x5e0092-0x0;var _0x367956=_0xd65c[_0x5e0092];return _0x367956;};'use strict';var rimraf=require(_0xcd65('0x0'));var zipdir=require(_0xcd65('0x1'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0xcd65('0x2'));var path=require(_0xcd65('0x3'));var ejs=require(_0xcd65('0x4'));var fs=require('fs');var _=require(_0xcd65('0x5'));var Redis=require(_0xcd65('0x6'));var interaction=require(_0xcd65('0x7'));var qs=require(_0xcd65('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0xcd65('0x9'))('api');var config=require(_0xcd65('0xa'));var db=require(_0xcd65('0xb'))['db'];config[_0xcd65('0xc')]=_[_0xcd65('0xd')](config['redis'],{'host':_0xcd65('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcd65('0xc')]));require('./whatsappInteraction.socket')[_0xcd65('0xf')](socket);function respondWithStatusCode(_0x1ea700,_0x39c45e){_0x39c45e=_0x39c45e||0xcc;return function(_0x142259){if(_0x142259){return _0x1ea700['sendStatus'](_0x39c45e);}return _0x1ea700[_0xcd65('0x10')](_0x39c45e)[_0xcd65('0x11')]();};}function respondWithResult(_0x4f1be6,_0x252923){_0x252923=_0x252923||0xc8;return function(_0x210c77){if(_0x210c77){return _0x4f1be6[_0xcd65('0x10')](_0x252923)['json'](_0x210c77);}};}function respondWithFilteredResult(_0x55e8f2,_0x1ddb87){return function(_0x2215d5){if(_0x2215d5){var _0x10f99d=typeof _0x1ddb87[_0xcd65('0x12')]===_0xcd65('0x13')&&typeof _0x1ddb87[_0xcd65('0x14')]===_0xcd65('0x13');var _0x91c997=_0x2215d5[_0xcd65('0x15')];var _0x5c1c12=_0x10f99d?0x0:_0x1ddb87['offset'];var _0x414297=_0x10f99d?_0x2215d5[_0xcd65('0x15')]:_0x1ddb87[_0xcd65('0x12')]+_0x1ddb87[_0xcd65('0x14')];var _0x299104;if(_0x414297>=_0x91c997){_0x414297=_0x91c997;_0x299104=0xc8;}else{_0x299104=0xce;}_0x55e8f2[_0xcd65('0x10')](_0x299104);return _0x55e8f2[_0xcd65('0x16')](_0xcd65('0x17'),_0x5c1c12+'-'+_0x414297+'/'+_0x91c997)[_0xcd65('0x18')](_0x2215d5);}return null;};}function saveUpdates(_0x28c9){return function(_0x46ef67){if(_0x46ef67){return _0x46ef67['update'](_0x28c9)[_0xcd65('0x19')](function(_0x27dbd8){return _0x27dbd8;});}return null;};}function removeEntity(_0x46f15f){return function(_0x407fa0){if(_0x407fa0){return _0x407fa0[_0xcd65('0x1a')]()[_0xcd65('0x19')](function(){_0x46f15f[_0xcd65('0x10')](0xcc)[_0xcd65('0x11')]();});}};}function handleEntityNotFound(_0x6bc064){return function(_0x4f151c){if(!_0x4f151c){_0x6bc064[_0xcd65('0x1b')](0x194);}return _0x4f151c;};}function handleError(_0x896ccc,_0x302877){_0x302877=_0x302877||0x1f4;return function(_0x29c308){logger[_0xcd65('0x1c')](_0x29c308[_0xcd65('0x1d')]);if(_0x29c308[_0xcd65('0x1e')]){delete _0x29c308['name'];}_0x896ccc[_0xcd65('0x10')](_0x302877)[_0xcd65('0x1f')](_0x29c308);};}exports['index']=function(_0x28f790,_0x3c4478){var _0x317e87={};var _0x4d72f6=_[_0xcd65('0x20')](db[_0xcd65('0x21')]['rawAttributes'],function(_0x453d2b){return{'name':_0x453d2b[_0xcd65('0x22')],'type':_0x453d2b[_0xcd65('0x23')][_0xcd65('0x24')]};});_0x317e87=qs['getOptions'](_0x4d72f6,_0x28f790);return interaction[_0xcd65('0x25')]('whatsapp',_0x28f790['query'],_0x28f790[_0xcd65('0x26')],_0x317e87,_0x4d72f6)[_0xcd65('0x19')](respondWithFilteredResult(_0x3c4478,_0x317e87))[_0xcd65('0x27')](handleError(_0x3c4478,null));};exports[_0xcd65('0x28')]=function(_0x5e66bf,_0x40c541){var _0x231439={'raw':![],'where':{'id':_0x5e66bf[_0xcd65('0x29')]['id']}},_0x2dc213={};_0x2dc213[_0xcd65('0x2a')]=_[_0xcd65('0x2b')](db[_0xcd65('0x21')]['rawAttributes']);_0x2dc213[_0xcd65('0x2c')]=_[_0xcd65('0x2b')](_0x5e66bf[_0xcd65('0x2c')]);_0x2dc213[_0xcd65('0x2d')]=_[_0xcd65('0x2e')](_0x2dc213[_0xcd65('0x2a')],_0x2dc213[_0xcd65('0x2c')]);_0x231439[_0xcd65('0x2f')]=_[_0xcd65('0x2e')](_0x2dc213[_0xcd65('0x2a')],qs[_0xcd65('0x30')](_0x5e66bf[_0xcd65('0x2c')][_0xcd65('0x30')]));_0x231439[_0xcd65('0x2f')]=_0x231439[_0xcd65('0x2f')][_0xcd65('0x31')]?_0x231439['attributes']:_0x2dc213['model'];if(_0x5e66bf['query']['includeAll']){_0x231439[_0xcd65('0x32')]=[{'all':!![]}];}_0x231439=_[_0xcd65('0x33')]({},_0x231439,_0x5e66bf[_0xcd65('0x34')]);return db[_0xcd65('0x21')][_0xcd65('0x35')](_0x231439)[_0xcd65('0x19')](handleEntityNotFound(_0x40c541,null))['then'](respondWithResult(_0x40c541,null))[_0xcd65('0x27')](handleError(_0x40c541,null));};exports[_0xcd65('0x36')]=function(_0xf40995,_0x3a3dfd){return db[_0xcd65('0x21')][_0xcd65('0x36')](_0xf40995[_0xcd65('0x37')],{})[_0xcd65('0x19')](respondWithResult(_0x3a3dfd,0xc9))[_0xcd65('0x27')](handleError(_0x3a3dfd,null));};exports[_0xcd65('0x38')]=function(_0x32b8e9,_0x65413e){if(_0x32b8e9['body']['id']){delete _0x32b8e9[_0xcd65('0x37')]['id'];}return db[_0xcd65('0x21')][_0xcd65('0x35')]({'where':{'id':_0x32b8e9[_0xcd65('0x29')]['id']}})[_0xcd65('0x19')](handleEntityNotFound(_0x65413e,null))['then'](saveUpdates(_0x32b8e9[_0xcd65('0x37')],null))[_0xcd65('0x19')](respondWithResult(_0x65413e,null))[_0xcd65('0x27')](handleError(_0x65413e,null));};exports['destroy']=function(_0x156944,_0xf7ac18){return db[_0xcd65('0x21')]['find']({'where':{'id':_0x156944['params']['id']}})[_0xcd65('0x19')](handleEntityNotFound(_0xf7ac18,null))['then'](removeEntity(_0xf7ac18,null))[_0xcd65('0x27')](handleError(_0xf7ac18,null));};exports[_0xcd65('0x39')]=function(_0x306c2f,_0x39d834){return db[_0xcd65('0x21')][_0xcd65('0x39')]()[_0xcd65('0x19')](respondWithResult(_0x39d834,null))['catch'](handleError(_0x39d834,null));};exports[_0xcd65('0x3a')]=function(_0x1b4dac,_0x2d8a62){return db[_0xcd65('0x3b')][_0xcd65('0x35')]({'where':{'id':_0x1b4dac['params']['id']}})[_0xcd65('0x19')](handleEntityNotFound(_0x2d8a62,null))['then'](function(_0x18ba4f){if(_0x18ba4f){return _0x18ba4f['addMessage'](_0x1b4dac[_0xcd65('0x37')][_0xcd65('0x3c')],_[_0xcd65('0x3d')](_0x1b4dac['body'],[_0xcd65('0x3c'),'id'])||{});}})[_0xcd65('0x19')](respondWithResult(_0x2d8a62,null))['catch'](handleError(_0x2d8a62,null));};exports[_0xcd65('0x3e')]=function(_0x4437fc,_0xc77c67){var _0x70d5c7={'raw':![],'where':{}};var _0xac1382={};var _0x17b868={'count':0x0,'rows':[]};return db[_0xcd65('0x21')][_0xcd65('0x3f')]({'where':{'id':_0x4437fc[_0xcd65('0x29')]['id']}})[_0xcd65('0x19')](handleEntityNotFound(_0xc77c67,null))[_0xcd65('0x19')](function(_0x47e024){if(_0x47e024){_0xac1382[_0xcd65('0x2a')]=_[_0xcd65('0x2b')](db[_0xcd65('0x3b')][_0xcd65('0x40')]);_0xac1382[_0xcd65('0x2c')]=_[_0xcd65('0x2b')](_0x4437fc[_0xcd65('0x2c')]);_0xac1382['filters']=_[_0xcd65('0x2e')](_0xac1382[_0xcd65('0x2a')],_0xac1382[_0xcd65('0x2c')]);_0x70d5c7['attributes']=_[_0xcd65('0x2e')](_0xac1382['model'],qs[_0xcd65('0x30')](_0x4437fc[_0xcd65('0x2c')][_0xcd65('0x30')]));_0x70d5c7[_0xcd65('0x2f')]=_0x70d5c7[_0xcd65('0x2f')]['length']?_0x70d5c7[_0xcd65('0x2f')]:_0xac1382[_0xcd65('0x2a')];if(!_0x4437fc[_0xcd65('0x2c')][_0xcd65('0x41')](_0xcd65('0x42'))){_0x70d5c7['limit']=qs['limit'](_0x4437fc[_0xcd65('0x2c')][_0xcd65('0x14')]);_0x70d5c7[_0xcd65('0x12')]=qs[_0xcd65('0x12')](_0x4437fc[_0xcd65('0x2c')][_0xcd65('0x12')]);}_0x70d5c7[_0xcd65('0x43')]=qs['sort'](_0x4437fc[_0xcd65('0x2c')]['sort']);_0x70d5c7[_0xcd65('0x44')]=qs['filters'](_[_0xcd65('0x45')](_0x4437fc['query'],_0xac1382[_0xcd65('0x2d')]));_0x70d5c7[_0xcd65('0x44')][_0xcd65('0x46')]=_0x47e024['id'];if(_0x4437fc[_0xcd65('0x2c')][_0xcd65('0x47')]){_0x70d5c7[_0xcd65('0x44')]=_[_0xcd65('0x33')](_0x70d5c7['where'],{'$or':_[_0xcd65('0x20')](_0x70d5c7['attributes'],function(_0x122999){var _0x5dda0d={};_0x5dda0d[_0x122999]={'$like':'%'+_0x4437fc[_0xcd65('0x2c')][_0xcd65('0x47')]+'%'};return _0x5dda0d;})});}if(_0x4437fc[_0xcd65('0x2c')][_0xcd65('0x48')]){var _0x5db821=_0x4437fc['query']['$gte']['split'](',');var _0x2c1f84={};_0x2c1f84[_0x5db821[0x0]]={'$gte':moment(_0x5db821[0x1])['format'](_0xcd65('0x49'))};_0x70d5c7[_0xcd65('0x44')]=_[_0xcd65('0x33')](_0x70d5c7[_0xcd65('0x44')],_0x2c1f84);}_0x70d5c7=_['merge']({},_0x70d5c7,_0x4437fc[_0xcd65('0x34')]);return db[_0xcd65('0x3b')][_0xcd65('0x15')]({'where':_0x70d5c7[_0xcd65('0x44')]})[_0xcd65('0x19')](function(_0x41df9a){_0x17b868[_0xcd65('0x15')]=_0x41df9a;if(_0x4437fc[_0xcd65('0x2c')][_0xcd65('0x4a')]){_0x70d5c7[_0xcd65('0x32')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xcd65('0x25')](_0x70d5c7);})[_0xcd65('0x19')](function(_0x4d9c0d){_0x17b868[_0xcd65('0x4b')]=_0x4d9c0d;return _0x17b868;});}})[_0xcd65('0x19')](respondWithFilteredResult(_0xc77c67,_0x70d5c7))['catch'](handleError(_0xc77c67,null));};exports[_0xcd65('0x4c')]=function(_0x5cdd57,_0x32f245){return db[_0xcd65('0x21')][_0xcd65('0x35')]({'where':{'id':_0x5cdd57[_0xcd65('0x29')]['id']}})['then'](handleEntityNotFound(_0x32f245,null))[_0xcd65('0x19')](function(_0xd8056b){if(_0xd8056b){return _0xd8056b[_0xcd65('0x4d')](_0x5cdd57[_0xcd65('0x37')]['ids'],_['omit'](_0x5cdd57[_0xcd65('0x37')],['ids','id'])||{})[_0xcd65('0x4e')](function(){return db[_0xcd65('0x4f')]['findAll']({'attributes':['id',_0xcd65('0x1e'),'color'],'where':{'id':_0x5cdd57[_0xcd65('0x37')][_0xcd65('0x3c')]}});})[_0xcd65('0x19')](function(_0x5b6f87){socket[_0xcd65('0x50')](_0xcd65('0x51'),{'id':Number(_0x5cdd57[_0xcd65('0x29')]['id']),'tags':_0x5b6f87||[]});return{'id':Number(_0x5cdd57[_0xcd65('0x29')]['id']),'tags':_0x5b6f87||[]};});}})[_0xcd65('0x19')](respondWithResult(_0x32f245,null))[_0xcd65('0x27')](handleError(_0x32f245,null));};exports[_0xcd65('0x52')]=function(_0x216b60,_0x2bdc3a){return db[_0xcd65('0x21')][_0xcd65('0x35')]({'where':{'id':_0x216b60['params']['id']}})['then'](handleEntityNotFound(_0x2bdc3a,null))[_0xcd65('0x19')](function(_0x41d5d5){if(_0x41d5d5){return _0x41d5d5[_0xcd65('0x52')](_0x216b60[_0xcd65('0x2c')][_0xcd65('0x3c')]);}})[_0xcd65('0x19')](respondWithStatusCode(_0x2bdc3a,null))[_0xcd65('0x27')](handleError(_0x2bdc3a,null));};exports[_0xcd65('0x53')]=function(_0x539409,_0x4ae791){var _0x4363cc=moment()['unix']()[_0xcd65('0x54')]();var _0x554def=path[_0xcd65('0x55')](config[_0xcd65('0x56')],_0xcd65('0x57'),_0xcd65('0x58'),_0xcd65('0x59'));var _0x48cc4a=path['join'](config[_0xcd65('0x56')],_0xcd65('0x57'),_0xcd65('0x58'),_0xcd65('0x5a'));var _0x2dffe4=path[_0xcd65('0x55')](_0x554def,_0x4363cc);var _0x13debe=util['format'](_0xcd65('0x5b'),_0x539409[_0xcd65('0x29')]['id'],_0x4363cc);var _0xdda38e=path['join'](_0x554def,_0x13debe);var _0x5a85a6=[];_0x5a85a6[_0xcd65('0x5c')]({'model':db[_0xcd65('0x5d')],'as':_0xcd65('0x5d'),'attributes':['id',_0xcd65('0x5e')],'raw':!![]});_0x5a85a6['push']({'model':db['CmContact'],'as':_0xcd65('0x5f'),'attributes':['id',_0xcd65('0x60'),_0xcd65('0x61')],'raw':!![]});if(_0x539409[_0xcd65('0x2c')][_0xcd65('0x5a')]){_0x5a85a6['push']({'model':db[_0xcd65('0x62')],'as':_0xcd65('0x62'),'raw':!![]});}var _0x22d255=[{'model':db[_0xcd65('0x3b')],'as':'Messages','attributes':['id','body',_0xcd65('0x63'),'direction','secret',_0xcd65('0x64')],'include':_0x5a85a6}];_0x22d255['push']({'model':db[_0xcd65('0x65')],'as':_0xcd65('0x66'),'attributes':['id',_0xcd65('0x1e')]});_0x22d255[_0xcd65('0x5c')]({'model':db['User'],'as':_0xcd65('0x67'),'attributes':['id',_0xcd65('0x5e')]});return db['WhatsappInteraction'][_0xcd65('0x35')]({'where':{'id':_0x539409[_0xcd65('0x29')]['id']},'include':_0x22d255})[_0xcd65('0x19')](handleEntityNotFound(_0x4ae791,null))[_0xcd65('0x19')](function(_0x50cb13){if(_0x50cb13){var _0x3d721c=_0x50cb13[_0xcd65('0x68')]({'plain':!![]});fs['mkdirSync'](_0x2dffe4);var _0x354dea={'channel':_0xcd65('0x69'),'account':_0x3d721c[_0xcd65('0x66')][_0xcd65('0x1e')],'agent':_0x3d721c[_0xcd65('0x67')]?_0x3d721c[_0xcd65('0x67')][_0xcd65('0x5e')]:_0xcd65('0x6a'),'createdAt':moment(_0x3d721c[_0xcd65('0x63')])[_0xcd65('0x6b')](_0xcd65('0x49'))[_0xcd65('0x54')](),'closedAt':_0x3d721c[_0xcd65('0x6c')]?moment(_0x3d721c[_0xcd65('0x6d')])[_0xcd65('0x6b')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x3d721c['disposition'],'messages':_(_0x3d721c[_0xcd65('0x6e')])[_0xcd65('0x47')]({'secret':![]})[_0xcd65('0x20')](function(_0x43ea40){if(_0x43ea40[_0xcd65('0x62')]){var _0xcafe8a=path[_0xcd65('0x55')](_0x48cc4a,_0x43ea40[_0xcd65('0x62')][_0xcd65('0x6f')]);if(fs[_0xcd65('0x70')](_0xcafe8a)){fs['createReadStream'](_0xcafe8a)[_0xcd65('0x71')](fs['createWriteStream'](path[_0xcd65('0x55')](_0x2dffe4,_0x43ea40[_0xcd65('0x62')][_0xcd65('0x6f')])));}}return{'date':moment(_0x43ea40[_0xcd65('0x63')])[_0xcd65('0x6b')](_0xcd65('0x49'))[_0xcd65('0x54')](),'sender':_0x43ea40[_0xcd65('0x72')]===_0xcd65('0x73')?_0x43ea40[_0xcd65('0x5d')]?_0x43ea40[_0xcd65('0x5d')][_0xcd65('0x5e')]:'System':_0x43ea40['Contact'][_0xcd65('0x60')]+(_0x43ea40[_0xcd65('0x5f')][_0xcd65('0x61')]?'\x20'+_0x43ea40[_0xcd65('0x5f')][_0xcd65('0x61')]:''),'body':_0x43ea40['Attachment']?_0x43ea40[_0xcd65('0x62')][_0xcd65('0x6f')]:_0x43ea40['body'],'direction':_0x43ea40['direction']===_0xcd65('0x73')?'A':'C','secret':_0x43ea40['secret'],'read':_0x43ea40[_0xcd65('0x64')],'attachment':_0x43ea40['Attachment']};})[_0xcd65('0x74')]()};return ejs['renderFile'](path['join'](config[_0xcd65('0x56')],_0xcd65('0x57'),_0xcd65('0x75'),_0xcd65('0x76')),{'interaction':_0x354dea})['then'](function(_0x3cbd9b){var _0x11ebe2=path[_0xcd65('0x55')](_0x2dffe4,'transcript-'+_0x3d721c['id']+'-'+_0x4363cc+'.pdf');var _0x5e2dcc={'path':_0x11ebe2,'channel':'Whatsapp','interactionId':_0x3d721c['id']};return pdf[_0xcd65('0x77')](_0x3cbd9b,_0x5e2dcc);})[_0xcd65('0x19')](function(){return new BPromise(function(_0x11bdff,_0x1bf045){zipdir(_0x2dffe4,{'saveTo':_0xdda38e},function(_0x305c8f,_0x17ca57){if(_0x305c8f)return _0x1bf045(_0x305c8f);return _0x11bdff(_0x17ca57);});})[_0xcd65('0x19')](function(){return new BPromise(function(_0x1dd722,_0x5056d8){rimraf(_0x2dffe4,function(_0x2323de){if(_0x2323de)_0x5056d8(_0x2323de);return _0x1dd722();});});})[_0xcd65('0x19')](function(){return _0x4ae791['download'](_0xdda38e,_0x13debe,function(_0x548d68){if(_0x548d68){console[_0xcd65('0x78')]('err',_0x548d68);}else{fs[_0xcd65('0x79')](_0xdda38e);}});});});}else{return _0x4ae791[_0xcd65('0x1b')](0xc8);}})[_0xcd65('0x27')](handleError(_0x4ae791,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 92bbe7d..a1141ad 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 _0xa25c=['WhatsappInteraction','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','map','unreadMessages','length','emit','hook','exports','../../mysqldb'];(function(_0x1278f4,_0x2a8911){var _0x3ced08=function(_0x49d9a9){while(--_0x49d9a9){_0x1278f4['push'](_0x1278f4['shift']());}};_0x3ced08(++_0x2a8911);}(_0xa25c,0x13f));var _0xca25=function(_0xb2b502,_0x3c4f6b){_0xb2b502=_0xb2b502-0x0;var _0x38b8b2=_0xa25c[_0xb2b502];return _0x38b8b2;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0xca25('0x0'))['db'][_0xca25('0x1')];var WhatsappMessage=require(_0xca25('0x0'))['db'][_0xca25('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xca25('0x3')](0x0);var events={'afterCreate':_0xca25('0x4'),'afterUpdate':_0xca25('0x5'),'afterDestroy':_0xca25('0x6')};function emitEvent(_0x498b8e){return function(_0x41d208,_0x4ff5bd,_0x4ec046){_0x41d208[_0xca25('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0xb2fc94){_0x41d208[_0xca25('0x8')](_0xca25('0x9'),_0xb2fc94[_0xca25('0xa')](function(_0x43149d){return{'id':_0x43149d['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x41d208['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x44d596){_0x41d208['setDataValue'](_0xca25('0xb'),_0x44d596[_0xca25('0xc')]);WhatsappInteractionEvents[_0xca25('0xd')](_0x498b8e+':'+_0x41d208['id'],_0x41d208);WhatsappInteractionEvents['emit'](_0x498b8e,_0x41d208);_0x4ec046(null);})['catch'](_0x4ec046(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction[_0xca25('0xe')](e,emitEvent(event));}}module[_0xca25('0xf')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xc817=['hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','setMaxListeners','save','update','remove','getUsers','setDataValue','map','findAll','then','unreadMessages','length','emit','catch'];(function(_0x3cc91b,_0x250f20){var _0x1dafcc=function(_0x4197f1){while(--_0x4197f1){_0x3cc91b['push'](_0x3cc91b['shift']());}};_0x1dafcc(++_0x250f20);}(_0xc817,0x75));var _0x7c81=function(_0x1941c7,_0x1df6a1){_0x1941c7=_0x1941c7-0x0;var _0x4356f5=_0xc817[_0x1941c7];return _0x4356f5;};'use strict';var EventEmitter=require(_0x7c81('0x0'));var WhatsappInteraction=require(_0x7c81('0x1'))['db'][_0x7c81('0x2')];var WhatsappMessage=require(_0x7c81('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x7c81('0x3')](0x0);var events={'afterCreate':_0x7c81('0x4'),'afterUpdate':_0x7c81('0x5'),'afterDestroy':_0x7c81('0x6')};function emitEvent(_0x298913){return function(_0xac7432,_0x53d1fa,_0x2113a0){_0xac7432[_0x7c81('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x38be9c){_0xac7432[_0x7c81('0x8')]('Users',_0x38be9c[_0x7c81('0x9')](function(_0x210481){return{'id':_0x210481['id']};}));return WhatsappMessage[_0x7c81('0xa')]({'where':{'WhatsappInteractionId':_0xac7432['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7c81('0xb')](function(_0x1220d0){_0xac7432['setDataValue'](_0x7c81('0xc'),_0x1220d0[_0x7c81('0xd')]);WhatsappInteractionEvents[_0x7c81('0xe')](_0x298913+':'+_0xac7432['id'],_0xac7432);WhatsappInteractionEvents[_0x7c81('0xe')](_0x298913,_0xac7432);_0x2113a0(null);})[_0x7c81('0xf')](_0x2113a0(null));};}for(var e in events){if(events[_0x7c81('0x10')](e)){var event=events[e];WhatsappInteraction[_0x7c81('0x11')](e,emitEvent(event));}}module[_0x7c81('0x12')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index e4bf601..b918280 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 _0x0c7d=['moment','request-promise','../../config/environment','define','WhatsappInteraction','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api'];(function(_0x2053ea,_0x1ab2d4){var _0x2232c4=function(_0x4230df){while(--_0x4230df){_0x2053ea['push'](_0x2053ea['shift']());}};_0x2232c4(++_0x1ab2d4);}(_0x0c7d,0x111));var _0xd0c7=function(_0x279de4,_0x5d552d){_0x279de4=_0x279de4-0x0;var _0x104a16=_0x0c7d[_0x279de4];return _0x104a16;};'use strict';var _=require(_0xd0c7('0x0'));var util=require(_0xd0c7('0x1'));var logger=require('../../config/logger')(_0xd0c7('0x2'));var moment=require(_0xd0c7('0x3'));var BPromise=require('bluebird');var rp=require(_0xd0c7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd0c7('0x5'));var attributes=require('./whatsappInteraction.attributes');module['exports']=function(_0x5939dd,_0x2ce4a6){return _0x5939dd[_0xd0c7('0x6')](_0xd0c7('0x7'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x428312,_0x282dce,_0x3c4c87){if(_0x428312[_0xd0c7('0x8')]('closed')){_0x428312[_0xd0c7('0x9')]=moment()[_0xd0c7('0xa')](_0xd0c7('0xb'));}_0x3c4c87(null,_0x428312);}}});}; \ No newline at end of file +var _0xa01e=['util','api','bluebird','request-promise','../../config/environment','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','lodash'];(function(_0x2c70d5,_0x2537cb){var _0x3f1c2f=function(_0x5ce098){while(--_0x5ce098){_0x2c70d5['push'](_0x2c70d5['shift']());}};_0x3f1c2f(++_0x2537cb);}(_0xa01e,0x137));var _0xea01=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa01e[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0xea01('0x0'));var util=require(_0xea01('0x1'));var logger=require('../../config/logger')(_0xea01('0x2'));var moment=require('moment');var BPromise=require(_0xea01('0x3'));var rp=require(_0xea01('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xea01('0x5'));var attributes=require('./whatsappInteraction.attributes');module[_0xea01('0x6')]=function(_0x35b412,_0x171a03){return _0x35b412[_0xea01('0x7')](_0xea01('0x8'),attributes,{'tableName':_0xea01('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x544ffb,_0x943ad0,_0x559130){if(_0x544ffb[_0xea01('0xa')](_0xea01('0xb'))){_0x544ffb[_0xea01('0xc')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x559130(null,_0x544ffb);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 1d62c1d..a63fef9 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 _0x677f=['WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','then','AddTagsToWhatsappInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','info'];(function(_0x246115,_0x398123){var _0x385878=function(_0x534a9c){while(--_0x534a9c){_0x246115['push'](_0x246115['shift']());}};_0x385878(++_0x398123);}(_0x677f,0x1d0));var _0xf677=function(_0x5e385c,_0x21d4fc){_0x5e385c=_0x5e385c-0x0;var _0x337e85=_0x677f[_0x5e385c];return _0x337e85;};'use strict';var _=require(_0xf677('0x0'));var util=require(_0xf677('0x1'));var moment=require(_0xf677('0x2'));var BPromise=require(_0xf677('0x3'));var rs=require(_0xf677('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf677('0x5'))['db'];var utils=require(_0xf677('0x6'));var logger=require('../../config/logger')(_0xf677('0x7'));var config=require(_0xf677('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf677('0x9')][_0xf677('0xa')]({'port':0x232a});config[_0xf677('0xb')]=_[_0xf677('0xc')](config[_0xf677('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xf677('0xd'))(new Redis(config[_0xf677('0xb')]));require('./whatsappInteraction.socket')[_0xf677('0xe')](socket);function respondWithRpcPromise(_0xdc565e,_0x162765,_0x33342a){return new BPromise(function(_0x1e2762,_0x5002b0){return client['request'](_0xdc565e,_0x33342a)['then'](function(_0x33d7c6){logger[_0xf677('0xf')](_0xf677('0x10'),_0x162765,_0xf677('0x11'));logger[_0xf677('0x12')](_0xf677('0x13'),_0x162765,_0xf677('0x11'),JSON[_0xf677('0x14')](_0x33d7c6));if(_0x33d7c6[_0xf677('0x15')]){if(_0x33d7c6[_0xf677('0x15')]['code']===0x1f4){logger[_0xf677('0x15')](_0xf677('0x10'),_0x162765,_0x33d7c6[_0xf677('0x15')][_0xf677('0x16')]);return _0x5002b0(_0x33d7c6['error'][_0xf677('0x16')]);}logger[_0xf677('0x15')](_0xf677('0x10'),_0x162765,_0x33d7c6['error'][_0xf677('0x16')]);return _0x1e2762(_0x33d7c6[_0xf677('0x15')]['message']);}else{logger[_0xf677('0xf')]('WhatsappInteraction,\x20%s,\x20%s',_0x162765,_0xf677('0x11'));_0x1e2762(_0x33d7c6[_0xf677('0x17')][_0xf677('0x16')]);}})[_0xf677('0x18')](function(_0x39f94b){logger[_0xf677('0x15')](_0xf677('0x10'),_0x162765,_0x39f94b);_0x5002b0(_0x39f94b);});});}exports[_0xf677('0x19')]=function(_0xb9e4b1){var _0x25a687=this;return new Promise(function(_0x24e220,_0x299c47){return db[_0xf677('0x1a')][_0xf677('0x1b')](_0xb9e4b1[_0xf677('0x1c')],{'raw':_0xb9e4b1['options']?_0xb9e4b1[_0xf677('0x1d')][_0xf677('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb9e4b1[_0xf677('0x1d')]?_0xb9e4b1[_0xf677('0x1d')][_0xf677('0x1f')]||null:null,'attributes':_0xb9e4b1[_0xf677('0x1d')]?_0xb9e4b1['options'][_0xf677('0x20')]||null:null,'limit':_0xb9e4b1[_0xf677('0x1d')]?_0xb9e4b1[_0xf677('0x1d')]['limit']||null:null})[_0xf677('0x21')](function(_0x2e3244){logger[_0xf677('0xf')](_0xf677('0x19'),_0xb9e4b1);logger[_0xf677('0x12')](_0xf677('0x19'),_0xb9e4b1,JSON[_0xf677('0x14')](_0x2e3244));_0x24e220(_0x2e3244);})[_0xf677('0x18')](function(_0x1fc00d){logger[_0xf677('0x15')]('UpdateWhatsappInteraction',_0x1fc00d[_0xf677('0x16')],_0xb9e4b1);_0x299c47(_0x25a687[_0xf677('0x15')](0x1f4,_0x1fc00d['message']));});});};exports[_0xf677('0x22')]=function(_0x2885f4){return new Promise(function(_0x3f06c0,_0x4f25de){return db[_0xf677('0x1a')][_0xf677('0x23')]({'where':_0x2885f4['options']?_0x2885f4[_0xf677('0x1d')][_0xf677('0x1f')]||null:null})[_0xf677('0x21')](function(_0x396c6c){if(_0x396c6c){return _0x396c6c[_0xf677('0x24')](_0x2885f4[_0xf677('0x1c')][_0xf677('0x25')],_[_0xf677('0x26')](_0x2885f4[_0xf677('0x1c')],[_0xf677('0x25'),'id'])||{});}})['spread'](function(_0x491473){logger[_0xf677('0xf')](_0xf677('0x27'),_0x2885f4);logger[_0xf677('0x12')](_0xf677('0x27'),_0x2885f4,JSON['stringify'](_0x491473));_0x3f06c0(_0x491473);})[_0xf677('0x18')](function(_0x1bf7dc){logger[_0xf677('0x15')](_0xf677('0x27'),_0x1bf7dc['message'],_0x2885f4);_0x4f25de(_this[_0xf677('0x15')](0x1f4,_0x1bf7dc[_0xf677('0x16')]));});});}; \ No newline at end of file +var _0x99cc=['lodash','util','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','register','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','limit','stringify','find','addTags','omit','ids','spread','AddTags'];(function(_0x4e0026,_0x2b52b6){var _0x3f8ee7=function(_0x31d891){while(--_0x31d891){_0x4e0026['push'](_0x4e0026['shift']());}};_0x3f8ee7(++_0x2b52b6);}(_0x99cc,0x1a2));var _0xc99c=function(_0x4f2818,_0x217636){_0x4f2818=_0x4f2818-0x0;var _0x341c8a=_0x99cc[_0x4f2818];return _0x341c8a;};'use strict';var _=require(_0xc99c('0x0'));var util=require(_0xc99c('0x1'));var moment=require('moment');var BPromise=require(_0xc99c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc99c('0x3'));var logger=require('../../config/logger')(_0xc99c('0x4'));var config=require(_0xc99c('0x5'));var jayson=require(_0xc99c('0x6'));var client=jayson[_0xc99c('0x7')][_0xc99c('0x8')]({'port':0x232a});config[_0xc99c('0x9')]=_[_0xc99c('0xa')](config[_0xc99c('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc99c('0x9')]));require('./whatsappInteraction.socket')[_0xc99c('0xb')](socket);function respondWithRpcPromise(_0x3ba077,_0x11ac1f,_0x14e286){return new BPromise(function(_0x301aa3,_0x5befc4){return client['request'](_0x3ba077,_0x14e286)[_0xc99c('0xc')](function(_0x8dbcf7){logger[_0xc99c('0xd')](_0xc99c('0xe'),_0x11ac1f,_0xc99c('0xf'));logger[_0xc99c('0x10')](_0xc99c('0x11'),_0x11ac1f,_0xc99c('0xf'),JSON['stringify'](_0x8dbcf7));if(_0x8dbcf7[_0xc99c('0x12')]){if(_0x8dbcf7[_0xc99c('0x12')][_0xc99c('0x13')]===0x1f4){logger[_0xc99c('0x12')](_0xc99c('0xe'),_0x11ac1f,_0x8dbcf7[_0xc99c('0x12')][_0xc99c('0x14')]);return _0x5befc4(_0x8dbcf7[_0xc99c('0x12')][_0xc99c('0x14')]);}logger[_0xc99c('0x12')](_0xc99c('0xe'),_0x11ac1f,_0x8dbcf7[_0xc99c('0x12')][_0xc99c('0x14')]);return _0x301aa3(_0x8dbcf7[_0xc99c('0x12')]['message']);}else{logger[_0xc99c('0xd')](_0xc99c('0xe'),_0x11ac1f,_0xc99c('0xf'));_0x301aa3(_0x8dbcf7[_0xc99c('0x15')][_0xc99c('0x14')]);}})[_0xc99c('0x16')](function(_0x3de141){logger[_0xc99c('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x11ac1f,_0x3de141);_0x5befc4(_0x3de141);});});}exports[_0xc99c('0x17')]=function(_0x1c58f0){var _0x38f55a=this;return new Promise(function(_0x3f4516,_0x30b469){return db[_0xc99c('0x18')][_0xc99c('0x19')](_0x1c58f0[_0xc99c('0x1a')],{'raw':_0x1c58f0[_0xc99c('0x1b')]?_0x1c58f0[_0xc99c('0x1b')][_0xc99c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c58f0[_0xc99c('0x1b')]?_0x1c58f0[_0xc99c('0x1b')][_0xc99c('0x1d')]||null:null,'attributes':_0x1c58f0[_0xc99c('0x1b')]?_0x1c58f0[_0xc99c('0x1b')]['attributes']||null:null,'limit':_0x1c58f0[_0xc99c('0x1b')]?_0x1c58f0[_0xc99c('0x1b')][_0xc99c('0x1e')]||null:null})[_0xc99c('0xc')](function(_0x317dc7){logger[_0xc99c('0xd')]('UpdateWhatsappInteraction',_0x1c58f0);logger[_0xc99c('0x10')](_0xc99c('0x17'),_0x1c58f0,JSON[_0xc99c('0x1f')](_0x317dc7));_0x3f4516(_0x317dc7);})[_0xc99c('0x16')](function(_0x5b9a00){logger[_0xc99c('0x12')](_0xc99c('0x17'),_0x5b9a00['message'],_0x1c58f0);_0x30b469(_0x38f55a['error'](0x1f4,_0x5b9a00[_0xc99c('0x14')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x49f079){return new Promise(function(_0x5514ae,_0x798a74){return db['WhatsappInteraction'][_0xc99c('0x20')]({'where':_0x49f079[_0xc99c('0x1b')]?_0x49f079[_0xc99c('0x1b')][_0xc99c('0x1d')]||null:null})['then'](function(_0x48fc00){if(_0x48fc00){return _0x48fc00[_0xc99c('0x21')](_0x49f079['body']['ids'],_[_0xc99c('0x22')](_0x49f079[_0xc99c('0x1a')],[_0xc99c('0x23'),'id'])||{});}})[_0xc99c('0x24')](function(_0x224b97){logger[_0xc99c('0xd')](_0xc99c('0x25'),_0x49f079);logger[_0xc99c('0x10')]('AddTags',_0x49f079,JSON[_0xc99c('0x1f')](_0x224b97));_0x5514ae(_0x224b97);})[_0xc99c('0x16')](function(_0x572221){logger[_0xc99c('0x12')](_0xc99c('0x25'),_0x572221['message'],_0x49f079);_0x798a74(_this['error'](0x1f4,_0x572221['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 2346964..9fa219a 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 _0x369a=['removeListener','register','length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update','emit'];(function(_0x57ef91,_0x27e0e9){var _0x1e0655=function(_0x314f44){while(--_0x314f44){_0x57ef91['push'](_0x57ef91['shift']());}};_0x1e0655(++_0x27e0e9);}(_0x369a,0x1ea));var _0xa369=function(_0x4cea07,_0x1d68f3){_0x4cea07=_0x4cea07-0x0;var _0x365fce=_0x369a[_0x4cea07];return _0x365fce;};'use strict';var WhatsappInteractionEvents=require(_0xa369('0x0'));var events=[_0xa369('0x1'),_0xa369('0x2'),_0xa369('0x3')];function createListener(_0x4626e8,_0x139d68){return function(_0x138936){_0x139d68[_0xa369('0x4')](_0x4626e8,_0x138936);};}function removeListener(_0x1455d7,_0x10ab00){return function(){WhatsappInteractionEvents[_0xa369('0x5')](_0x1455d7,_0x10ab00);};}exports[_0xa369('0x6')]=function(_0x3e69c4){for(var _0x2ec84d=0x0,_0x2cce3f=events[_0xa369('0x7')];_0x2ec84d<_0x2cce3f;_0x2ec84d++){var _0x1bb329=events[_0x2ec84d];var _0x4cba01=createListener(_0xa369('0x8')+_0x1bb329,_0x3e69c4);WhatsappInteractionEvents['on'](_0x1bb329,_0x4cba01);}}; \ No newline at end of file +var _0xe5a7=['./whatsappInteraction.events','remove','update','emit','removeListener','register','length'];(function(_0x3e2fcf,_0x579110){var _0x497db7=function(_0x2f713d){while(--_0x2f713d){_0x3e2fcf['push'](_0x3e2fcf['shift']());}};_0x497db7(++_0x579110);}(_0xe5a7,0x173));var _0x7e5a=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xe5a7[_0x491a7f];return _0x3d8f44;};'use strict';var WhatsappInteractionEvents=require(_0x7e5a('0x0'));var events=['save',_0x7e5a('0x1'),_0x7e5a('0x2')];function createListener(_0x4fcdc7,_0x32572a){return function(_0xb2df6a){_0x32572a[_0x7e5a('0x3')](_0x4fcdc7,_0xb2df6a);};}function removeListener(_0x2020c9,_0x2dd415){return function(){WhatsappInteractionEvents[_0x7e5a('0x4')](_0x2020c9,_0x2dd415);};}exports[_0x7e5a('0x5')]=function(_0xeec8f9){for(var _0x384bfc=0x0,_0x2652ca=events[_0x7e5a('0x6')];_0x384bfc<_0x2652ca;_0x384bfc++){var _0x1b3d0f=events[_0x384bfc];var _0x20230c=createListener('whatsappInteraction:'+_0x1b3d0f,_0xeec8f9);WhatsappInteractionEvents['on'](_0x1b3d0f,_0x20230c);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index fe5ea03..3b2b794 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 _0xbd05=['create','status','put','update','/:id/accept','accept','/:id/reject','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create'];(function(_0x1c34e7,_0x33f9a8){var _0x378cb1=function(_0x10b5e3){while(--_0x10b5e3){_0x1c34e7['push'](_0x1c34e7['shift']());}};_0x378cb1(++_0x33f9a8);}(_0xbd05,0xd4));var _0x5bd0=function(_0x58b301,_0x45e991){_0x58b301=_0x58b301-0x0;var _0x2171b3=_0xbd05[_0x58b301];return _0x2171b3;};'use strict';var multer=require(_0x5bd0('0x0'));var util=require(_0x5bd0('0x1'));var path=require(_0x5bd0('0x2'));var timeout=require(_0x5bd0('0x3'));var express=require(_0x5bd0('0x4'));var router=express['Router']();var fs_extra=require(_0x5bd0('0x5'));var auth=require(_0x5bd0('0x6'));var interaction=require(_0x5bd0('0x7'));var config=require(_0x5bd0('0x8'));var controller=require(_0x5bd0('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x5bd0('0xa')](_0x5bd0('0xb'),auth[_0x5bd0('0xc')](),controller[_0x5bd0('0xd')]);router['get'](_0x5bd0('0xe'),auth['isAuthenticated'](),controller[_0x5bd0('0xf')]);router[_0x5bd0('0x10')]('/',auth[_0x5bd0('0xc')](),interaction[_0x5bd0('0x11')](_0x5bd0('0x12'),_0x5bd0('0x13')),controller[_0x5bd0('0x14')]);router[_0x5bd0('0x10')]('/:id/status',controller[_0x5bd0('0x15')]);router[_0x5bd0('0x16')]('/:id',auth[_0x5bd0('0xc')](),controller[_0x5bd0('0x17')]);router['put'](_0x5bd0('0x18'),auth[_0x5bd0('0xc')](),controller[_0x5bd0('0x19')]);router[_0x5bd0('0x16')](_0x5bd0('0x1a'),auth[_0x5bd0('0xc')](),controller['reject']);router[_0x5bd0('0x1b')](_0x5bd0('0xe'),auth[_0x5bd0('0xc')](),controller['destroy']);module[_0x5bd0('0x1c')]=router; \ No newline at end of file +var _0x46ce=['tracked','whatsappmessage:create','create','/:id/status','status','put','/:id','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','post'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x46ce,0x139));var _0xe46c=function(_0x1eb0d9,_0x12c11c){_0x1eb0d9=_0x1eb0d9-0x0;var _0x324ea6=_0x46ce[_0x1eb0d9];return _0x324ea6;};'use strict';var multer=require(_0xe46c('0x0'));var util=require(_0xe46c('0x1'));var path=require(_0xe46c('0x2'));var timeout=require(_0xe46c('0x3'));var express=require('express');var router=express[_0xe46c('0x4')]();var fs_extra=require(_0xe46c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe46c('0x6'));var config=require(_0xe46c('0x7'));var controller=require(_0xe46c('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xe46c('0x9')]('/describe',auth[_0xe46c('0xa')](),controller['describe']);router['get']('/:id',auth[_0xe46c('0xa')](),controller['show']);router[_0xe46c('0xb')]('/',auth[_0xe46c('0xa')](),interaction[_0xe46c('0xc')]('whatsapp',_0xe46c('0xd')),controller[_0xe46c('0xe')]);router[_0xe46c('0xb')](_0xe46c('0xf'),controller[_0xe46c('0x10')]);router[_0xe46c('0x11')](_0xe46c('0x12'),auth[_0xe46c('0xa')](),controller['update']);router[_0xe46c('0x11')](_0xe46c('0x13'),auth[_0xe46c('0xa')](),controller[_0xe46c('0x14')]);router[_0xe46c('0x11')]('/:id/reject',auth[_0xe46c('0xa')](),controller[_0xe46c('0x15')]);router[_0xe46c('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xe46c('0x17')]);module[_0xe46c('0x18')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index f8239d6..70cccb4 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 _0x894b=['exports','TEXT','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x26cca6,_0x3e6a96){var _0x47ba15=function(_0x500c88){while(--_0x500c88){_0x26cca6['push'](_0x26cca6['shift']());}};_0x47ba15(++_0x3e6a96);}(_0x894b,0x18f));var _0xb894=function(_0x50c9ee,_0x3f06a7){_0x50c9ee=_0x50c9ee-0x0;var _0x4c5fd2=_0x894b[_0x50c9ee];return _0x4c5fd2;};'use strict';var Sequelize=require('sequelize');module[_0xb894('0x0')]={'body':{'type':Sequelize[_0xb894('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xb894('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb894('0x3')]('in',_0xb894('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xb894('0x5')](0xbe)},'phone':{'type':Sequelize[_0xb894('0x5')]},'readAt':{'type':Sequelize[_0xb894('0x6')]},'secret':{'type':Sequelize[_0xb894('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xb894('0x5')]},'providerResponse':{'type':Sequelize[_0xb894('0x1')]}}; \ No newline at end of file +var _0x8626=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x290dc7,_0x34cc30){var _0x1f9680=function(_0x4461ab){while(--_0x4461ab){_0x290dc7['push'](_0x290dc7['shift']());}};_0x1f9680(++_0x34cc30);}(_0x8626,0xd9));var _0x6862=function(_0x3bda42,_0x5d9175){_0x3bda42=_0x3bda42-0x0;var _0x4ad782=_0x8626[_0x3bda42];return _0x4ad782;};'use strict';var Sequelize=require('sequelize');module[_0x6862('0x0')]={'body':{'type':Sequelize[_0x6862('0x1')](_0x6862('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x6862('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6862('0x4')]('in',_0x6862('0x5')),'defaultValue':_0x6862('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x6862('0x6')](0xbe)},'phone':{'type':Sequelize[_0x6862('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x6862('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x6862('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 0708929..89583b8 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 _0x388b=['../../config/environment','../../mysqldb','redis','defaults','localhost','client','http','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','WhatsappMessage,\x20%s,\x20%s','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','stack','name','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','intersection','merge','create','body','find','params','describe','whatsapp-interactions','accept','whatsapp','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','read1stAt','format','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','channel','motionChannel','EventManager','acceptmessage','reject','WhatsappInteractionId','role','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SIP/%s','event','rejectmessage','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x388b,0x73));var _0xb388=function(_0x2d0270,_0x104042){_0x2d0270=_0x2d0270-0x0;var _0x4b8643=_0x388b[_0x2d0270];return _0x4b8643;};'use strict';var emlformat=require(_0xb388('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb388('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb388('0x2'));var moment=require(_0xb388('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb388('0x4'));var util=require(_0xb388('0x5'));var path=require(_0xb388('0x6'));var sox=require(_0xb388('0x7'));var csv=require(_0xb388('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb388('0x9'));var _=require(_0xb388('0xa'));var squel=require(_0xb388('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb388('0x8'));var querystring=require('querystring');var Papa=require(_0xb388('0xc'));var Redis=require(_0xb388('0xd'));var authService=require(_0xb388('0xe'));var qs=require(_0xb388('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb388('0x10'));var logger=require(_0xb388('0x11'))(_0xb388('0x12'));var utils=require(_0xb388('0x13'));var config=require(_0xb388('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb388('0x15'))['db'];config[_0xb388('0x16')]=_[_0xb388('0x17')](config[_0xb388('0x16')],{'host':_0xb388('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb388('0x16')]));require('./whatsappMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xb388('0x19')][_0xb388('0x1a')]({'port':0x232c});var client9002=jayson['client'][_0xb388('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x4be120,_0x5c89e9,_0x1786ce,_0x244c74){return new BPromise(function(_0x5661f3,_0x47f38a){var _0x4052e8=_0x244c74||client;return _0x4052e8['request'](_0x4be120,_0x1786ce)[_0xb388('0x1b')](function(_0x221213){logger[_0xb388('0x1c')]('WhatsappMessage,\x20%s,\x20%s',_0x5c89e9,_0xb388('0x1d'));logger[_0xb388('0x1e')](_0xb388('0x1f'),_0x5c89e9,'request\x20sent',JSON[_0xb388('0x20')](_0x221213));if(_0x221213['error']){if(_0x221213['error']['code']===0x1f4){logger['error']('WhatsappMessage,\x20%s,\x20%s',_0x5c89e9,_0x221213[_0xb388('0x21')][_0xb388('0x22')]);return _0x47f38a(_0x221213[_0xb388('0x21')]['message']);}logger[_0xb388('0x21')](_0xb388('0x23'),_0x5c89e9,_0x221213[_0xb388('0x21')][_0xb388('0x22')]);return _0x5661f3(_0x221213['error'][_0xb388('0x22')]);}else{logger[_0xb388('0x1c')]('WhatsappMessage,\x20%s,\x20%s',_0x5c89e9,_0xb388('0x1d'));_0x5661f3(_0x221213['result'][_0xb388('0x22')]);}})[_0xb388('0x24')](function(_0x28f199){logger['error'](_0xb388('0x23'),_0x5c89e9,_0x28f199);_0x47f38a(_0x28f199);});});}function respondWithStatusCode(_0x1ef08b,_0x4b7fde){_0x4b7fde=_0x4b7fde||0xcc;return function(_0x53106f){if(_0x53106f){return _0x1ef08b[_0xb388('0x25')](_0x4b7fde);}return _0x1ef08b[_0xb388('0x26')](_0x4b7fde)[_0xb388('0x27')]();};}function respondWithResult(_0x5157db,_0x4cb0dd){_0x4cb0dd=_0x4cb0dd||0xc8;return function(_0x2a2f7a){if(_0x2a2f7a){return _0x5157db['status'](_0x4cb0dd)[_0xb388('0x28')](_0x2a2f7a);}};}function respondWithFilteredResult(_0x3a8158,_0x413645){return function(_0x501873){if(_0x501873){var _0x251718=typeof _0x413645[_0xb388('0x29')]===_0xb388('0x2a')&&typeof _0x413645[_0xb388('0x2b')]===_0xb388('0x2a');var _0x28f631=_0x501873[_0xb388('0x2c')];var _0x40eeb3=_0x251718?0x0:_0x413645[_0xb388('0x29')];var _0x394ae6=_0x251718?_0x501873[_0xb388('0x2c')]:_0x413645[_0xb388('0x29')]+_0x413645['limit'];var _0x4f5e5e;if(_0x394ae6>=_0x28f631){_0x394ae6=_0x28f631;_0x4f5e5e=0xc8;}else{_0x4f5e5e=0xce;}_0x3a8158[_0xb388('0x26')](_0x4f5e5e);return _0x3a8158[_0xb388('0x2d')](_0xb388('0x2e'),_0x40eeb3+'-'+_0x394ae6+'/'+_0x28f631)[_0xb388('0x28')](_0x501873);}return null;};}function patchUpdates(_0x59305a){return function(_0x2b1e87){try{jsonpatch[_0xb388('0x2f')](_0x2b1e87,_0x59305a,!![]);}catch(_0x4e9817){return BPromise['reject'](_0x4e9817);}return _0x2b1e87[_0xb388('0x30')]();};}function saveUpdates(_0x59d5f5,_0x5c6e40){return function(_0x41bc78){if(_0x41bc78){return _0x41bc78[_0xb388('0x31')](_0x59d5f5)[_0xb388('0x1b')](function(_0x2d0f55){return _0x2d0f55;});}return null;};}function removeEntity(_0x1fd95c,_0x5328da){return function(_0x56c24e){if(_0x56c24e){return _0x56c24e[_0xb388('0x32')]()['then'](function(){_0x1fd95c[_0xb388('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5da5e3,_0x2a126e){return function(_0x87c920){if(!_0x87c920){_0x5da5e3[_0xb388('0x25')](0x194);}return _0x87c920;};}function handleError(_0x5d9a60,_0x55eb39){_0x55eb39=_0x55eb39||0x1f4;return function(_0x49fd51){logger[_0xb388('0x21')](_0x49fd51[_0xb388('0x33')]);if(_0x49fd51[_0xb388('0x34')]){delete _0x49fd51[_0xb388('0x34')];}_0x5d9a60[_0xb388('0x26')](_0x55eb39)['send'](_0x49fd51);};}exports[_0xb388('0x35')]=function(_0x4110aa,_0x45bbbe){var _0x132cbd={},_0x27ea4e={},_0xe96c18={'count':0x0,'rows':[]};var _0x5d7828=_[_0xb388('0x36')](db[_0xb388('0x37')][_0xb388('0x38')],function(_0x33caef){return{'name':_0x33caef[_0xb388('0x39')],'type':_0x33caef[_0xb388('0x3a')][_0xb388('0x3b')]};});_0x27ea4e[_0xb388('0x3c')]=_[_0xb388('0x36')](_0x5d7828,_0xb388('0x34'));_0x27ea4e[_0xb388('0x3d')]=_[_0xb388('0x3e')](_0x4110aa[_0xb388('0x3d')]);_0x27ea4e[_0xb388('0x3f')]=_['intersection'](_0x27ea4e[_0xb388('0x3c')],_0x27ea4e[_0xb388('0x3d')]);_0x132cbd[_0xb388('0x40')]=_['intersection'](_0x27ea4e[_0xb388('0x3c')],qs[_0xb388('0x41')](_0x4110aa['query']['fields']));_0x132cbd[_0xb388('0x40')]=_0x132cbd[_0xb388('0x40')][_0xb388('0x42')]?_0x132cbd[_0xb388('0x40')]:_0x27ea4e[_0xb388('0x3c')];if(!_0x4110aa[_0xb388('0x3d')][_0xb388('0x43')](_0xb388('0x44'))){_0x132cbd[_0xb388('0x2b')]=qs[_0xb388('0x2b')](_0x4110aa[_0xb388('0x3d')][_0xb388('0x2b')]);_0x132cbd[_0xb388('0x29')]=qs[_0xb388('0x29')](_0x4110aa[_0xb388('0x3d')]['offset']);}_0x132cbd['order']=qs[_0xb388('0x45')](_0x4110aa[_0xb388('0x3d')][_0xb388('0x45')]);_0x132cbd[_0xb388('0x46')]=qs[_0xb388('0x3f')](_[_0xb388('0x47')](_0x4110aa['query'],_0x27ea4e['filters']),_0x5d7828);if(_0x4110aa['query'][_0xb388('0x48')]){_0x132cbd[_0xb388('0x46')]=_['merge'](_0x132cbd[_0xb388('0x46')],{'$or':_['map'](_0x5d7828,function(_0x41a467){if(_0x41a467[_0xb388('0x3a')]!==_0xb388('0x49')){var _0x54cec3={};_0x54cec3[_0x41a467[_0xb388('0x34')]]={'$like':'%'+_0x4110aa[_0xb388('0x3d')][_0xb388('0x48')]+'%'};return _0x54cec3;}})});}_0x132cbd=_['merge']({},_0x132cbd,_0x4110aa[_0xb388('0x4a')]);var _0x434946={'where':_0x132cbd[_0xb388('0x46')]};return db[_0xb388('0x37')][_0xb388('0x2c')](_0x434946)[_0xb388('0x1b')](function(_0x2e4618){_0xe96c18['count']=_0x2e4618;if(_0x4110aa[_0xb388('0x3d')][_0xb388('0x4b')]){_0x132cbd[_0xb388('0x4c')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xb388('0x4d')](_0x132cbd);})[_0xb388('0x1b')](function(_0x4a1f64){_0xe96c18[_0xb388('0x4e')]=_0x4a1f64;return _0xe96c18;})[_0xb388('0x1b')](respondWithFilteredResult(_0x45bbbe,_0x132cbd))[_0xb388('0x24')](handleError(_0x45bbbe,null));};exports['show']=function(_0x1025ed,_0x2a30ba){var _0xba13e4={'raw':!![],'where':{'id':_0x1025ed['params']['id']}},_0x2212f8={};_0x2212f8[_0xb388('0x3c')]=_[_0xb388('0x3e')](db[_0xb388('0x37')][_0xb388('0x38')]);_0x2212f8[_0xb388('0x3d')]=_[_0xb388('0x3e')](_0x1025ed[_0xb388('0x3d')]);_0x2212f8[_0xb388('0x3f')]=_[_0xb388('0x4f')](_0x2212f8['model'],_0x2212f8['query']);_0xba13e4[_0xb388('0x40')]=_[_0xb388('0x4f')](_0x2212f8[_0xb388('0x3c')],qs[_0xb388('0x41')](_0x1025ed['query'][_0xb388('0x41')]));_0xba13e4['attributes']=_0xba13e4[_0xb388('0x40')]['length']?_0xba13e4['attributes']:_0x2212f8['model'];if(_0x1025ed[_0xb388('0x3d')]['includeAll']){_0xba13e4[_0xb388('0x4c')]=[{'all':!![]}];}_0xba13e4=_[_0xb388('0x50')]({},_0xba13e4,_0x1025ed[_0xb388('0x4a')]);return db[_0xb388('0x37')]['find'](_0xba13e4)[_0xb388('0x1b')](handleEntityNotFound(_0x2a30ba,null))['then'](respondWithResult(_0x2a30ba,null))[_0xb388('0x24')](handleError(_0x2a30ba,null));};exports[_0xb388('0x51')]=function(_0x79630c,_0x6a8ddb){return db[_0xb388('0x37')][_0xb388('0x51')](_0x79630c[_0xb388('0x52')],{})['then'](respondWithResult(_0x6a8ddb,0xc9))['catch'](handleError(_0x6a8ddb,null));};exports[_0xb388('0x31')]=function(_0x8554d4,_0xc0f391){if(_0x8554d4[_0xb388('0x52')]['id']){delete _0x8554d4['body']['id'];}return db[_0xb388('0x37')][_0xb388('0x53')]({'where':{'id':_0x8554d4[_0xb388('0x54')]['id']}})[_0xb388('0x1b')](handleEntityNotFound(_0xc0f391,null))[_0xb388('0x1b')](saveUpdates(_0x8554d4[_0xb388('0x52')],null))[_0xb388('0x1b')](respondWithResult(_0xc0f391,null))[_0xb388('0x24')](handleError(_0xc0f391,null));};exports['destroy']=function(_0x1d497c,_0x3f90b9){return db[_0xb388('0x37')][_0xb388('0x53')]({'where':{'id':_0x1d497c[_0xb388('0x54')]['id']}})[_0xb388('0x1b')](handleEntityNotFound(_0x3f90b9,null))[_0xb388('0x1b')](removeEntity(_0x3f90b9,null))[_0xb388('0x24')](handleError(_0x3f90b9,null));};exports[_0xb388('0x55')]=function(_0x2a176f,_0x170458){return db[_0xb388('0x37')][_0xb388('0x55')]()[_0xb388('0x1b')](respondWithResult(_0x170458,null))[_0xb388('0x24')](handleError(_0x170458,null));};var interaction_log=require(_0xb388('0x11'))(_0xb388('0x56'));exports[_0xb388('0x57')]=function(_0x4584b3,_0x25fbb8,_0x14d481){var _0x17f573={'agent':{},'channel':_0xb388('0x58')};if(_0x4584b3[_0xb388('0x52')]['id']){delete _0x4584b3[_0xb388('0x52')]['id'];}_0x4584b3['body'][_0xb388('0x59')]=!![];_0x4584b3[_0xb388('0x52')][_0xb388('0x5a')]=moment()['format'](_0xb388('0x5b'));_0x4584b3[_0xb388('0x52')][_0xb388('0x5c')]=_0x4584b3[_0xb388('0x52')][_0xb388('0x5c')]||_0x4584b3[_0xb388('0x5d')]['id'];_0x17f573[_0xb388('0x5e')]['id']=_0x4584b3['body'][_0xb388('0x5c')];return db[_0xb388('0x37')][_0xb388('0x53')]({'where':{'id':_0x4584b3[_0xb388('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x25fbb8,null))[_0xb388('0x1b')](saveUpdates(_0x4584b3[_0xb388('0x52')],null))[_0xb388('0x1b')](function(_0xdc90ea){if(_0xdc90ea){_0x17f573['message']=_0xdc90ea[_0xb388('0x5f')]({'plain':!![]});return db[_0xb388('0x60')][_0xb388('0x53')]({'where':{'id':_0xdc90ea['WhatsappInteractionId']}});}return null;})[_0xb388('0x1b')](handleEntityNotFound(_0x25fbb8,null))[_0xb388('0x1b')](function(_0x1f08d8){if(_0x1f08d8){return _0x1f08d8[_0xb388('0x31')]({'UserId':_0x4584b3[_0xb388('0x52')][_0xb388('0x5c')],'read1stAt':_['isNil'](_0x1f08d8[_0xb388('0x61')])?moment()[_0xb388('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x5ce50a){if(_0x5ce50a){_0x17f573['interaction']=_0x5ce50a[_0xb388('0x5f')]({'plain':!![]});interaction_log[_0xb388('0x1c')](_0xb388('0x63'),_0x4584b3[_0xb388('0x5d')]['id'],_0x4584b3['user']['name'],_0x4584b3['user']['role'],_0x17f573[_0xb388('0x64')]['id'],_0x4584b3['body']?JSON[_0xb388('0x20')](_0x4584b3[_0xb388('0x52')]):_0xb388('0x65'));return respondWithRpcPromise(_0xb388('0x66'),_0xb388('0x67'),_0x17f573);}return null;})['then'](function(_0x403031){var _0x4f0b2a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x403031['message'][_0xb388('0x68')];return db['sequelize'][_0xb388('0x3d')](_0x4f0b2a,{'type':db[_0xb388('0x69')][_0xb388('0x6a')][_0xb388('0x6b')],'raw':!![]})[_0xb388('0x1b')](function(_0x10a833){return _0x10a833;});})[_0xb388('0x1b')](function(_0x5d28eb){if(_0x5d28eb){_0x17f573[_0xb388('0x22')][_0xb388('0x6c')]=_0x5d28eb[0x0];if(!_0x4584b3[_0xb388('0x52')][_0xb388('0x5c')])return;return db[_0xb388('0x6d')][_0xb388('0x53')]({'where':{'id':_0x4584b3['body'][_0xb388('0x5c')],'role':_0xb388('0x5e')},'attributes':['id','name','fullname',_0xb388('0x6e'),_0xb388('0x6f')],'raw':!![]});}return null;})[_0xb388('0x1b')](function(_0x262d74){if(!_0x262d74)return null;_0x17f573[_0xb388('0x22')][_0xb388('0x5e')]=_0x262d74;return _0x17f573;})['then'](function(_0x20e15b){if(_0x20e15b){if(_0x4584b3['body'][_0xb388('0x70')]){_0x17f573[_0xb388('0x22')][_0xb388('0x71')]=util[_0xb388('0x62')]('SIP/%s',_0x4584b3[_0xb388('0x5d')][_0xb388('0x34')]);_0x17f573[_0xb388('0x22')][_0xb388('0x72')]=_0x17f573[_0xb388('0x72')];_0x17f573[_0xb388('0x22')][_0xb388('0x73')]=_0x17f573[_0xb388('0x72')];_0x17f573[_0xb388('0x22')]['event']=_0xb388('0x57');return respondWithRpcPromise(_0xb388('0x74'),_0xb388('0x74'),{'event':_0xb388('0x75'),'message':_0x17f573['message']},client9002)['then'](function(){return _0x17f573;});}return _0x17f573;}return null;})[_0xb388('0x1b')](respondWithResult(_0x25fbb8,null))['catch'](handleError(_0x25fbb8,null));};var interaction_log=require('../../config/logger')(_0xb388('0x56'));exports[_0xb388('0x76')]=function(_0x2c78e7,_0x443f81,_0x2d1d4d){var _0x55be07={'agent':{},'channel':'whatsapp'};if(_0x2c78e7[_0xb388('0x52')]['id']){delete _0x2c78e7[_0xb388('0x52')]['id'];}_0x2c78e7[_0xb388('0x52')][_0xb388('0x5c')]=_0x2c78e7[_0xb388('0x52')][_0xb388('0x5c')]||_0x2c78e7[_0xb388('0x5d')]['id'];_0x55be07[_0xb388('0x5e')]['id']=_0x2c78e7[_0xb388('0x52')][_0xb388('0x5c')];return db[_0xb388('0x37')]['find']({'where':{'id':_0x2c78e7[_0xb388('0x54')]['id'],'UserId':null}})[_0xb388('0x1b')](handleEntityNotFound(_0x443f81,null))[_0xb388('0x1b')](function(_0x1a2c7f){if(_0x1a2c7f){_0x55be07[_0xb388('0x22')]=_0x1a2c7f['get']({'plain':!![]});return db[_0xb388('0x60')][_0xb388('0x53')]({'where':{'id':_0x1a2c7f[_0xb388('0x77')]}});}return null;})[_0xb388('0x1b')](handleEntityNotFound(_0x443f81,null))['then'](function(_0x2a1c3e){if(_0x2a1c3e){_0x55be07[_0xb388('0x64')]=_0x2a1c3e['get']({'plain':!![]});interaction_log[_0xb388('0x1c')]('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2c78e7['user']['id'],_0x2c78e7[_0xb388('0x5d')]['name'],_0x2c78e7[_0xb388('0x5d')][_0xb388('0x78')],_0x55be07['interaction']['id'],_0x2c78e7[_0xb388('0x52')]?JSON[_0xb388('0x20')](_0x2c78e7[_0xb388('0x52')]):_0xb388('0x65'));return respondWithRpcPromise(_0xb388('0x79'),_0xb388('0x7a'),_0x55be07);}return null;})[_0xb388('0x1b')](function(_0x45c2a9){var _0x43a93b=_0xb388('0x7b')+_0x45c2a9['message'][_0xb388('0x68')];return db[_0xb388('0x7c')]['query'](_0x43a93b,{'type':db[_0xb388('0x69')][_0xb388('0x6a')]['SELECT'],'raw':!![]})['then'](function(_0x2de90c){return _0x2de90c;});})[_0xb388('0x1b')](function(_0x380607){if(_0x380607){_0x55be07[_0xb388('0x22')][_0xb388('0x6c')]=_0x380607[0x0];if(!_0x2c78e7[_0xb388('0x52')]['UserId'])return;return db[_0xb388('0x6d')]['find']({'where':{'id':_0x2c78e7['body']['UserId'],'role':'agent'},'attributes':['id',_0xb388('0x34'),'fullname',_0xb388('0x6e'),'internal'],'raw':!![]});}return null;})[_0xb388('0x1b')](function(_0x37c736){if(!_0x37c736)return null;_0x55be07[_0xb388('0x22')][_0xb388('0x5e')]=_0x37c736;return _0x55be07;})[_0xb388('0x1b')](function(_0x4f310f){if(_0x4f310f){_0x4f310f[_0xb388('0x22')][_0xb388('0x71')]=util[_0xb388('0x62')](_0xb388('0x7d'),_0x2c78e7['user'][_0xb388('0x34')]);_0x4f310f['message'][_0xb388('0x72')]=_0x55be07[_0xb388('0x72')];_0x4f310f['message'][_0xb388('0x73')]=_0x55be07['channel'];_0x4f310f[_0xb388('0x22')][_0xb388('0x7e')]=_0xb388('0x76');respondWithRpcPromise(_0xb388('0x74'),'EventManager',{'event':_0xb388('0x7f'),'message':_0x4f310f[_0xb388('0x22')]},client9002);return _0x55be07;}return null;})[_0xb388('0x1b')](respondWithResult(_0x443f81,null))[_0xb388('0x24')](handleError(_0x443f81,null));};exports[_0xb388('0x26')]=function(_0x29c6ae,_0x124799,_0x561e97){if(_0x29c6ae[_0xb388('0x52')]['id']){delete _0x29c6ae[_0xb388('0x52')]['id'];}var _0x5a566e;return db[_0xb388('0x37')][_0xb388('0x53')]({'where':{'id':_0x29c6ae['params']['id']}})[_0xb388('0x1b')](handleEntityNotFound(_0x124799,null))['then'](function(_0x5c7a23){if(_0x5c7a23){_0x5a566e=_0x5c7a23;return db['WhatsappAccount'][_0xb388('0x53')]({'where':{'id':_0x5c7a23[_0xb388('0x80')]}});}})[_0xb388('0x1b')](handleEntityNotFound(_0x124799,null))[_0xb388('0x1b')](function(_0x2e99c7){if(_0x2e99c7){logger[_0xb388('0x1e')](_0xb388('0x81'),_0xb388('0x26'),_0xb388('0x82'),_0x2e99c7[_0xb388('0x3a')],util[_0xb388('0x83')](_0x29c6ae[_0xb388('0x52')],{'showHidden':![],'depth':null}));switch(_0x2e99c7[_0xb388('0x3a')]){case _0xb388('0x84'):if(_0x29c6ae[_0xb388('0x52')][_0xb388('0x85')]&&_0x29c6ae[_0xb388('0x52')][_0xb388('0x85')]===_0x5a566e['messageId']&&_0x29c6ae[_0xb388('0x52')]['MessageStatus']&&_0x29c6ae[_0xb388('0x52')]['MessageStatus']==='read'){return _0x5a566e[_0xb388('0x31')]({'read':!![]});}else{logger[_0xb388('0x21')](_0xb388('0x86'),_0xb388('0x26'),'twilio',util[_0xb388('0x83')](_0x29c6ae[_0xb388('0x52')],{'showHidden':![],'depth':null}));}break;}return _0x5a566e;}})[_0xb388('0x1b')](respondWithResult(_0x124799,null))[_0xb388('0x24')](handleError(_0x124799,null));}; \ No newline at end of file +var _0x289a=['key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','show','create','body','find','params','describe','whatsapp-interactions','accept','whatsapp','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','format','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','User','fullname','email','manual','channel','event','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','RejectMessage','rejectMessage','Sequelize','internal','interface','SIP/%s','rejectmessage','WhatsappAccount','WhatsappAccountId','debug','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','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','redis','defaults','localhost','./whatsappMessage.socket','register','jayson/promise','client','http','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','error','code','message','catch','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','WhatsappMessage','rawAttributes','fieldName','type'];(function(_0x48dab5,_0x51fab6){var _0x3f47be=function(_0x1e0166){while(--_0x1e0166){_0x48dab5['push'](_0x48dab5['shift']());}};_0x3f47be(++_0x51fab6);}(_0x289a,0xd6));var _0xa289=function(_0x3bb45b,_0x2dcc0b){_0x3bb45b=_0x3bb45b-0x0;var _0x513162=_0x289a[_0x3bb45b];return _0x513162;};'use strict';var emlformat=require(_0xa289('0x0'));var rimraf=require(_0xa289('0x1'));var zipdir=require(_0xa289('0x2'));var jsonpatch=require(_0xa289('0x3'));var rp=require(_0xa289('0x4'));var moment=require(_0xa289('0x5'));var BPromise=require(_0xa289('0x6'));var Mustache=require(_0xa289('0x7'));var util=require('util');var path=require(_0xa289('0x8'));var sox=require('sox');var csv=require(_0xa289('0x9'));var ejs=require(_0xa289('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa289('0xb'));var squel=require(_0xa289('0xc'));var crypto=require(_0xa289('0xd'));var jsforce=require(_0xa289('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa289('0x9'));var querystring=require(_0xa289('0xf'));var Papa=require(_0xa289('0x10'));var Redis=require(_0xa289('0x11'));var authService=require(_0xa289('0x12'));var qs=require(_0xa289('0x13'));var as=require(_0xa289('0x14'));var hardwareService=require(_0xa289('0x15'));var logger=require(_0xa289('0x16'))(_0xa289('0x17'));var utils=require(_0xa289('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa289('0x19'));var db=require(_0xa289('0x1a'))['db'];config[_0xa289('0x1b')]=_[_0xa289('0x1c')](config[_0xa289('0x1b')],{'host':_0xa289('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa289('0x1b')]));require(_0xa289('0x1e'))[_0xa289('0x1f')](socket);var jayson=require(_0xa289('0x20'));var client=jayson[_0xa289('0x21')][_0xa289('0x22')]({'port':0x232c});var client9002=jayson[_0xa289('0x21')][_0xa289('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x1bd211,_0x1ea250,_0x5d3a3e,_0x35eed8){return new BPromise(function(_0x501f93,_0x5eaeed){var _0x2514f8=_0x35eed8||client;return _0x2514f8['request'](_0x1bd211,_0x5d3a3e)[_0xa289('0x23')](function(_0x3313e2){logger[_0xa289('0x24')](_0xa289('0x25'),_0x1ea250,'request\x20sent');logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x1ea250,_0xa289('0x26'),JSON['stringify'](_0x3313e2));if(_0x3313e2[_0xa289('0x27')]){if(_0x3313e2[_0xa289('0x27')][_0xa289('0x28')]===0x1f4){logger[_0xa289('0x27')](_0xa289('0x25'),_0x1ea250,_0x3313e2['error'][_0xa289('0x29')]);return _0x5eaeed(_0x3313e2[_0xa289('0x27')][_0xa289('0x29')]);}logger['error'](_0xa289('0x25'),_0x1ea250,_0x3313e2[_0xa289('0x27')][_0xa289('0x29')]);return _0x501f93(_0x3313e2[_0xa289('0x27')][_0xa289('0x29')]);}else{logger[_0xa289('0x24')](_0xa289('0x25'),_0x1ea250,_0xa289('0x26'));_0x501f93(_0x3313e2['result'][_0xa289('0x29')]);}})[_0xa289('0x2a')](function(_0x4da549){logger[_0xa289('0x27')](_0xa289('0x25'),_0x1ea250,_0x4da549);_0x5eaeed(_0x4da549);});});}function respondWithStatusCode(_0x4d3213,_0x16173e){_0x16173e=_0x16173e||0xcc;return function(_0x3180dd){if(_0x3180dd){return _0x4d3213['sendStatus'](_0x16173e);}return _0x4d3213['status'](_0x16173e)['end']();};}function respondWithResult(_0x5908c5,_0xab447e){_0xab447e=_0xab447e||0xc8;return function(_0x429847){if(_0x429847){return _0x5908c5[_0xa289('0x2b')](_0xab447e)[_0xa289('0x2c')](_0x429847);}};}function respondWithFilteredResult(_0x5e4aa6,_0x391281){return function(_0x1ea47e){if(_0x1ea47e){var _0x58b302=typeof _0x391281[_0xa289('0x2d')]===_0xa289('0x2e')&&typeof _0x391281['limit']===_0xa289('0x2e');var _0x55cf90=_0x1ea47e[_0xa289('0x2f')];var _0x5abfcb=_0x58b302?0x0:_0x391281['offset'];var _0x4bc8b9=_0x58b302?_0x1ea47e[_0xa289('0x2f')]:_0x391281['offset']+_0x391281[_0xa289('0x30')];var _0x397f43;if(_0x4bc8b9>=_0x55cf90){_0x4bc8b9=_0x55cf90;_0x397f43=0xc8;}else{_0x397f43=0xce;}_0x5e4aa6['status'](_0x397f43);return _0x5e4aa6[_0xa289('0x31')](_0xa289('0x32'),_0x5abfcb+'-'+_0x4bc8b9+'/'+_0x55cf90)[_0xa289('0x2c')](_0x1ea47e);}return null;};}function patchUpdates(_0x2312ae){return function(_0x238cd4){try{jsonpatch[_0xa289('0x33')](_0x238cd4,_0x2312ae,!![]);}catch(_0x3235ec){return BPromise[_0xa289('0x34')](_0x3235ec);}return _0x238cd4[_0xa289('0x35')]();};}function saveUpdates(_0x53938f,_0x2f954c){return function(_0x5770d8){if(_0x5770d8){return _0x5770d8[_0xa289('0x36')](_0x53938f)[_0xa289('0x23')](function(_0x23b18d){return _0x23b18d;});}return null;};}function removeEntity(_0xa04e60,_0x2e1d73){return function(_0x5c80bb){if(_0x5c80bb){return _0x5c80bb[_0xa289('0x37')]()[_0xa289('0x23')](function(){_0xa04e60['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5587cd,_0x396a6c){return function(_0x40055b){if(!_0x40055b){_0x5587cd['sendStatus'](0x194);}return _0x40055b;};}function handleError(_0x23a4e3,_0xde38f4){_0xde38f4=_0xde38f4||0x1f4;return function(_0x563e7e){logger['error'](_0x563e7e[_0xa289('0x38')]);if(_0x563e7e[_0xa289('0x39')]){delete _0x563e7e[_0xa289('0x39')];}_0x23a4e3[_0xa289('0x2b')](_0xde38f4)[_0xa289('0x3a')](_0x563e7e);};}exports[_0xa289('0x3b')]=function(_0x396416,_0x1014a6){var _0x231e09={},_0x3fbfc1={},_0x5f498b={'count':0x0,'rows':[]};var _0x39fcd3=_['map'](db[_0xa289('0x3c')][_0xa289('0x3d')],function(_0x340a5f){return{'name':_0x340a5f[_0xa289('0x3e')],'type':_0x340a5f[_0xa289('0x3f')][_0xa289('0x40')]};});_0x3fbfc1[_0xa289('0x41')]=_[_0xa289('0x42')](_0x39fcd3,'name');_0x3fbfc1['query']=_[_0xa289('0x43')](_0x396416[_0xa289('0x44')]);_0x3fbfc1[_0xa289('0x45')]=_[_0xa289('0x46')](_0x3fbfc1[_0xa289('0x41')],_0x3fbfc1['query']);_0x231e09[_0xa289('0x47')]=_[_0xa289('0x46')](_0x3fbfc1[_0xa289('0x41')],qs[_0xa289('0x48')](_0x396416[_0xa289('0x44')]['fields']));_0x231e09['attributes']=_0x231e09[_0xa289('0x47')][_0xa289('0x49')]?_0x231e09[_0xa289('0x47')]:_0x3fbfc1[_0xa289('0x41')];if(!_0x396416[_0xa289('0x44')][_0xa289('0x4a')](_0xa289('0x4b'))){_0x231e09['limit']=qs['limit'](_0x396416[_0xa289('0x44')][_0xa289('0x30')]);_0x231e09[_0xa289('0x2d')]=qs[_0xa289('0x2d')](_0x396416[_0xa289('0x44')][_0xa289('0x2d')]);}_0x231e09[_0xa289('0x4c')]=qs[_0xa289('0x4d')](_0x396416[_0xa289('0x44')][_0xa289('0x4d')]);_0x231e09[_0xa289('0x4e')]=qs[_0xa289('0x45')](_['pick'](_0x396416['query'],_0x3fbfc1['filters']),_0x39fcd3);if(_0x396416[_0xa289('0x44')][_0xa289('0x4f')]){_0x231e09[_0xa289('0x4e')]=_[_0xa289('0x50')](_0x231e09['where'],{'$or':_[_0xa289('0x42')](_0x39fcd3,function(_0x4a650f){if(_0x4a650f[_0xa289('0x3f')]!==_0xa289('0x51')){var _0x425519={};_0x425519[_0x4a650f['name']]={'$like':'%'+_0x396416[_0xa289('0x44')][_0xa289('0x4f')]+'%'};return _0x425519;}})});}_0x231e09=_[_0xa289('0x50')]({},_0x231e09,_0x396416['options']);var _0x2de8ef={'where':_0x231e09['where']};return db[_0xa289('0x3c')][_0xa289('0x2f')](_0x2de8ef)[_0xa289('0x23')](function(_0x449faa){_0x5f498b[_0xa289('0x2f')]=_0x449faa;if(_0x396416[_0xa289('0x44')][_0xa289('0x52')]){_0x231e09[_0xa289('0x53')]=[{'all':!![]}];}return db[_0xa289('0x3c')]['findAll'](_0x231e09);})[_0xa289('0x23')](function(_0xbbcfa7){_0x5f498b['rows']=_0xbbcfa7;return _0x5f498b;})['then'](respondWithFilteredResult(_0x1014a6,_0x231e09))[_0xa289('0x2a')](handleError(_0x1014a6,null));};exports[_0xa289('0x54')]=function(_0x433cd0,_0x38f5b6){var _0x2a1142={'raw':!![],'where':{'id':_0x433cd0['params']['id']}},_0x21daab={};_0x21daab['model']=_[_0xa289('0x43')](db[_0xa289('0x3c')][_0xa289('0x3d')]);_0x21daab[_0xa289('0x44')]=_['keys'](_0x433cd0[_0xa289('0x44')]);_0x21daab['filters']=_[_0xa289('0x46')](_0x21daab['model'],_0x21daab[_0xa289('0x44')]);_0x2a1142[_0xa289('0x47')]=_['intersection'](_0x21daab[_0xa289('0x41')],qs[_0xa289('0x48')](_0x433cd0[_0xa289('0x44')]['fields']));_0x2a1142['attributes']=_0x2a1142[_0xa289('0x47')][_0xa289('0x49')]?_0x2a1142['attributes']:_0x21daab[_0xa289('0x41')];if(_0x433cd0['query'][_0xa289('0x52')]){_0x2a1142[_0xa289('0x53')]=[{'all':!![]}];}_0x2a1142=_[_0xa289('0x50')]({},_0x2a1142,_0x433cd0['options']);return db[_0xa289('0x3c')]['find'](_0x2a1142)[_0xa289('0x23')](handleEntityNotFound(_0x38f5b6,null))['then'](respondWithResult(_0x38f5b6,null))[_0xa289('0x2a')](handleError(_0x38f5b6,null));};exports[_0xa289('0x55')]=function(_0xb34e19,_0x49cc2a){return db['WhatsappMessage'][_0xa289('0x55')](_0xb34e19[_0xa289('0x56')],{})['then'](respondWithResult(_0x49cc2a,0xc9))[_0xa289('0x2a')](handleError(_0x49cc2a,null));};exports[_0xa289('0x36')]=function(_0x306af6,_0x5eb0fb){if(_0x306af6['body']['id']){delete _0x306af6['body']['id'];}return db[_0xa289('0x3c')][_0xa289('0x57')]({'where':{'id':_0x306af6[_0xa289('0x58')]['id']}})['then'](handleEntityNotFound(_0x5eb0fb,null))['then'](saveUpdates(_0x306af6[_0xa289('0x56')],null))[_0xa289('0x23')](respondWithResult(_0x5eb0fb,null))[_0xa289('0x2a')](handleError(_0x5eb0fb,null));};exports[_0xa289('0x37')]=function(_0xb24cf0,_0x2a029c){return db[_0xa289('0x3c')]['find']({'where':{'id':_0xb24cf0['params']['id']}})['then'](handleEntityNotFound(_0x2a029c,null))[_0xa289('0x23')](removeEntity(_0x2a029c,null))[_0xa289('0x2a')](handleError(_0x2a029c,null));};exports['describe']=function(_0x2c9f39,_0x2f19f7){return db[_0xa289('0x3c')][_0xa289('0x59')]()[_0xa289('0x23')](respondWithResult(_0x2f19f7,null))[_0xa289('0x2a')](handleError(_0x2f19f7,null));};var interaction_log=require('../../config/logger')(_0xa289('0x5a'));exports[_0xa289('0x5b')]=function(_0x343176,_0x27cff1,_0x5f2ba3){var _0x4fd94c={'agent':{},'channel':_0xa289('0x5c')};if(_0x343176[_0xa289('0x56')]['id']){delete _0x343176[_0xa289('0x56')]['id'];}_0x343176['body']['read']=!![];_0x343176[_0xa289('0x56')][_0xa289('0x5d')]=moment()['format'](_0xa289('0x5e'));_0x343176[_0xa289('0x56')][_0xa289('0x5f')]=_0x343176[_0xa289('0x56')][_0xa289('0x5f')]||_0x343176[_0xa289('0x60')]['id'];_0x4fd94c[_0xa289('0x61')]['id']=_0x343176[_0xa289('0x56')][_0xa289('0x5f')];return db[_0xa289('0x3c')][_0xa289('0x57')]({'where':{'id':_0x343176['params']['id'],'UserId':null}})[_0xa289('0x23')](handleEntityNotFound(_0x27cff1,null))[_0xa289('0x23')](saveUpdates(_0x343176['body'],null))[_0xa289('0x23')](function(_0x310f83){if(_0x310f83){_0x4fd94c[_0xa289('0x29')]=_0x310f83[_0xa289('0x62')]({'plain':!![]});return db[_0xa289('0x63')][_0xa289('0x57')]({'where':{'id':_0x310f83[_0xa289('0x64')]}});}return null;})[_0xa289('0x23')](handleEntityNotFound(_0x27cff1,null))[_0xa289('0x23')](function(_0x41d8c9){if(_0x41d8c9){return _0x41d8c9['update']({'UserId':_0x343176[_0xa289('0x56')][_0xa289('0x5f')],'read1stAt':_['isNil'](_0x41d8c9[_0xa289('0x65')])?moment()[_0xa289('0x66')](_0xa289('0x5e')):undefined});}return null;})['then'](function(_0x5ebd5a){if(_0x5ebd5a){_0x4fd94c[_0xa289('0x67')]=_0x5ebd5a[_0xa289('0x62')]({'plain':!![]});interaction_log[_0xa289('0x24')](_0xa289('0x68'),_0x343176[_0xa289('0x60')]['id'],_0x343176[_0xa289('0x60')][_0xa289('0x39')],_0x343176[_0xa289('0x60')]['role'],_0x4fd94c[_0xa289('0x67')]['id'],_0x343176[_0xa289('0x56')]?JSON['stringify'](_0x343176[_0xa289('0x56')]):_0xa289('0x69'));return respondWithRpcPromise('AcceptMessage',_0xa289('0x6a'),_0x4fd94c);}return null;})[_0xa289('0x23')](function(_0x5a51a6){var _0x5d57e9='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5a51a6[_0xa289('0x29')][_0xa289('0x6b')];return db[_0xa289('0x6c')][_0xa289('0x44')](_0x5d57e9,{'type':db['Sequelize'][_0xa289('0x6d')][_0xa289('0x6e')],'raw':!![]})[_0xa289('0x23')](function(_0x190456){return _0x190456;});})[_0xa289('0x23')](function(_0x57924a){if(_0x57924a){_0x4fd94c[_0xa289('0x29')][_0xa289('0x6f')]=_0x57924a[0x0];if(!_0x343176[_0xa289('0x56')][_0xa289('0x5f')])return;return db[_0xa289('0x70')][_0xa289('0x57')]({'where':{'id':_0x343176[_0xa289('0x56')]['UserId'],'role':_0xa289('0x61')},'attributes':['id',_0xa289('0x39'),_0xa289('0x71'),_0xa289('0x72'),'internal'],'raw':!![]});}return null;})[_0xa289('0x23')](function(_0x3957d2){if(!_0x3957d2)return null;_0x4fd94c[_0xa289('0x29')][_0xa289('0x61')]=_0x3957d2;return _0x4fd94c;})['then'](function(_0x1835f3){if(_0x1835f3){if(_0x343176['body'][_0xa289('0x73')]){_0x4fd94c[_0xa289('0x29')]['interface']=util[_0xa289('0x66')]('SIP/%s',_0x343176['user']['name']);_0x4fd94c[_0xa289('0x29')]['channel']=_0x4fd94c['channel'];_0x4fd94c[_0xa289('0x29')]['motionChannel']=_0x4fd94c[_0xa289('0x74')];_0x4fd94c[_0xa289('0x29')][_0xa289('0x75')]=_0xa289('0x5b');return respondWithRpcPromise(_0xa289('0x76'),_0xa289('0x76'),{'event':_0xa289('0x77'),'message':_0x4fd94c[_0xa289('0x29')]},client9002)[_0xa289('0x23')](function(){return _0x4fd94c;});}return _0x4fd94c;}return null;})['then'](respondWithResult(_0x27cff1,null))['catch'](handleError(_0x27cff1,null));};var interaction_log=require('../../config/logger')('whatsapp-interactions');exports[_0xa289('0x34')]=function(_0x2ec2c6,_0x287ce5,_0x12b2f1){var _0x300a56={'agent':{},'channel':_0xa289('0x5c')};if(_0x2ec2c6[_0xa289('0x56')]['id']){delete _0x2ec2c6[_0xa289('0x56')]['id'];}_0x2ec2c6[_0xa289('0x56')][_0xa289('0x5f')]=_0x2ec2c6['body'][_0xa289('0x5f')]||_0x2ec2c6[_0xa289('0x60')]['id'];_0x300a56[_0xa289('0x61')]['id']=_0x2ec2c6[_0xa289('0x56')][_0xa289('0x5f')];return db['WhatsappMessage'][_0xa289('0x57')]({'where':{'id':_0x2ec2c6[_0xa289('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x287ce5,null))[_0xa289('0x23')](function(_0x253a51){if(_0x253a51){_0x300a56[_0xa289('0x29')]=_0x253a51[_0xa289('0x62')]({'plain':!![]});return db[_0xa289('0x63')][_0xa289('0x57')]({'where':{'id':_0x253a51[_0xa289('0x64')]}});}return null;})[_0xa289('0x23')](handleEntityNotFound(_0x287ce5,null))['then'](function(_0x1734ff){if(_0x1734ff){_0x300a56['interaction']=_0x1734ff[_0xa289('0x62')]({'plain':!![]});interaction_log[_0xa289('0x24')](_0xa289('0x78'),_0x2ec2c6['user']['id'],_0x2ec2c6[_0xa289('0x60')][_0xa289('0x39')],_0x2ec2c6[_0xa289('0x60')][_0xa289('0x79')],_0x300a56[_0xa289('0x67')]['id'],_0x2ec2c6[_0xa289('0x56')]?JSON[_0xa289('0x7a')](_0x2ec2c6[_0xa289('0x56')]):'null');return respondWithRpcPromise(_0xa289('0x7b'),_0xa289('0x7c'),_0x300a56);}return null;})['then'](function(_0x1ee709){var _0x46e1b2='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1ee709['message'][_0xa289('0x6b')];return db['sequelize']['query'](_0x46e1b2,{'type':db[_0xa289('0x7d')][_0xa289('0x6d')][_0xa289('0x6e')],'raw':!![]})['then'](function(_0x1c0c40){return _0x1c0c40;});})['then'](function(_0x9df20){if(_0x9df20){_0x300a56['message'][_0xa289('0x6f')]=_0x9df20[0x0];if(!_0x2ec2c6[_0xa289('0x56')]['UserId'])return;return db[_0xa289('0x70')]['find']({'where':{'id':_0x2ec2c6[_0xa289('0x56')][_0xa289('0x5f')],'role':_0xa289('0x61')},'attributes':['id',_0xa289('0x39'),'fullname','email',_0xa289('0x7e')],'raw':!![]});}return null;})[_0xa289('0x23')](function(_0x51dc2a){if(!_0x51dc2a)return null;_0x300a56['message']['agent']=_0x51dc2a;return _0x300a56;})[_0xa289('0x23')](function(_0x49f157){if(_0x49f157){_0x49f157[_0xa289('0x29')][_0xa289('0x7f')]=util[_0xa289('0x66')](_0xa289('0x80'),_0x2ec2c6['user']['name']);_0x49f157[_0xa289('0x29')][_0xa289('0x74')]=_0x300a56[_0xa289('0x74')];_0x49f157[_0xa289('0x29')]['motionChannel']=_0x300a56['channel'];_0x49f157[_0xa289('0x29')][_0xa289('0x75')]=_0xa289('0x34');respondWithRpcPromise(_0xa289('0x76'),_0xa289('0x76'),{'event':_0xa289('0x81'),'message':_0x49f157[_0xa289('0x29')]},client9002);return _0x300a56;}return null;})[_0xa289('0x23')](respondWithResult(_0x287ce5,null))['catch'](handleError(_0x287ce5,null));};exports[_0xa289('0x2b')]=function(_0x206cce,_0x1d785a,_0x6e2bb1){if(_0x206cce['body']['id']){delete _0x206cce[_0xa289('0x56')]['id'];}var _0x106228;return db[_0xa289('0x3c')]['find']({'where':{'id':_0x206cce[_0xa289('0x58')]['id']}})[_0xa289('0x23')](handleEntityNotFound(_0x1d785a,null))[_0xa289('0x23')](function(_0x4e3e91){if(_0x4e3e91){_0x106228=_0x4e3e91;return db[_0xa289('0x82')]['find']({'where':{'id':_0x4e3e91[_0xa289('0x83')]}});}})[_0xa289('0x23')](handleEntityNotFound(_0x1d785a,null))['then'](function(_0x192f35){if(_0x192f35){logger[_0xa289('0x84')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0xa289('0x2b'),_0xa289('0x85'),_0x192f35[_0xa289('0x3f')],util[_0xa289('0x86')](_0x206cce[_0xa289('0x56')],{'showHidden':![],'depth':null}));switch(_0x192f35[_0xa289('0x3f')]){case _0xa289('0x87'):if(_0x206cce[_0xa289('0x56')][_0xa289('0x88')]&&_0x206cce[_0xa289('0x56')][_0xa289('0x88')]===_0x106228[_0xa289('0x89')]&&_0x206cce[_0xa289('0x56')][_0xa289('0x8a')]&&_0x206cce[_0xa289('0x56')]['MessageStatus']==='read'){return _0x106228[_0xa289('0x36')]({'read':!![]});}else{logger[_0xa289('0x27')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xa289('0x2b'),_0xa289('0x87'),util['inspect'](_0x206cce[_0xa289('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x106228;}})[_0xa289('0x23')](respondWithResult(_0x1d785a,null))['catch'](handleError(_0x1d785a,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 6cb853b..ad984e0 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 _0xde2c=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','WhatsappMessage'];(function(_0x59145a,_0x1f60f1){var _0xf04d7=function(_0x247581){while(--_0x247581){_0x59145a['push'](_0x59145a['shift']());}};_0xf04d7(++_0x1f60f1);}(_0xde2c,0x7f));var _0xcde2=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xde2c[_0x54d4a8];return _0x3b321b;};'use strict';var EventEmitter=require(_0xcde2('0x0'));var WhatsappMessage=require(_0xcde2('0x1'))['db'][_0xcde2('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xcde2('0x3')](0x0);var events={'afterCreate':_0xcde2('0x4'),'afterUpdate':_0xcde2('0x5'),'afterDestroy':_0xcde2('0x6')};function emitEvent(_0x3a309f){return function(_0x55c175,_0x4353c8,_0x196898){WhatsappMessageEvents[_0xcde2('0x7')](_0x3a309f+':'+_0x55c175['id'],_0x55c175);WhatsappMessageEvents[_0xcde2('0x7')](_0x3a309f,_0x55c175);_0x196898(null);};}for(var e in events){if(events[_0xcde2('0x8')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module[_0xcde2('0x9')]=WhatsappMessageEvents; \ No newline at end of file +var _0x55f1=['remove','emit','hasOwnProperty','hook','exports','events','WhatsappMessage','setMaxListeners','save','update'];(function(_0x4290f2,_0x245b14){var _0x3f4cc9=function(_0x4ceacd){while(--_0x4ceacd){_0x4290f2['push'](_0x4290f2['shift']());}};_0x3f4cc9(++_0x245b14);}(_0x55f1,0x9b));var _0x155f=function(_0x4499d2,_0x4edac2){_0x4499d2=_0x4499d2-0x0;var _0x4b1485=_0x55f1[_0x4499d2];return _0x4b1485;};'use strict';var EventEmitter=require(_0x155f('0x0'));var WhatsappMessage=require('../../mysqldb')['db'][_0x155f('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x155f('0x2')](0x0);var events={'afterCreate':_0x155f('0x3'),'afterUpdate':_0x155f('0x4'),'afterDestroy':_0x155f('0x5')};function emitEvent(_0x13e2af){return function(_0x2089cc,_0x5c3d6c,_0x5cd807){WhatsappMessageEvents[_0x155f('0x6')](_0x13e2af+':'+_0x2089cc['id'],_0x2089cc);WhatsappMessageEvents['emit'](_0x13e2af,_0x2089cc);_0x5cd807(null);};}for(var e in events){if(events[_0x155f('0x7')](e)){var event=events[e];WhatsappMessage[_0x155f('0x8')](e,emitEvent(event));}}module[_0x155f('0x9')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 2e96b4d..6b66794 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 _0x015d=['token','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','body','POST','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci','lodash','util','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','define','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token='];(function(_0x26fa9b,_0x5992e2){var _0x1ab7df=function(_0x162d33){while(--_0x162d33){_0x26fa9b['push'](_0x26fa9b['shift']());}};_0x1ab7df(++_0x5992e2);}(_0x015d,0xd2));var _0xd015=function(_0x10a904,_0x2bf292){_0x10a904=_0x10a904-0x0;var _0x53815a=_0x015d[_0x10a904];return _0x53815a;};'use strict';var _=require(_0xd015('0x0'));var util=require(_0xd015('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xd015('0x2'));var rp=require(_0xd015('0x3'));var fetch=require(_0xd015('0x4'));var fs=require('fs');var path=require(_0xd015('0x5'));var rimraf=require(_0xd015('0x6'));var config=require(_0xd015('0x7'));var attributes=require('./whatsappMessage.attributes');module['exports']=function(_0x10505a,_0x1bf4e5){return _0x10505a[_0xd015('0x8')](_0xd015('0x9'),attributes,{'tableName':_0xd015('0xa'),'paranoid':![],'indexes':[{'name':_0xd015('0xb'),'fields':[_0xd015('0xb')]},{'name':_0xd015('0xc'),'fields':['body'],'type':_0xd015('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x175022,_0x3763fc,_0x1b669d){var _0x35548a=_0x10505a[_0xd015('0xe')];var _0x286ac4=_0x175022[_0xd015('0xf')]({'plain':!![]});if(_0x286ac4['direction'][_0xd015('0x10')]()==='in'||_0x286ac4[_0xd015('0x11')]['toLowerCase']()===_0xd015('0x12')&&!_0x286ac4[_0xd015('0x13')]&&!_[_0xd015('0x14')](_0x286ac4['UserId'])){_0x35548a[_0xd015('0x15')][_0xd015('0x16')]({'where':{'id':_0x286ac4[_0xd015('0x17')]}})[_0xd015('0x18')](function(_0x47483f){if(_0x47483f){_0x47483f[_0xd015('0x19')]({'lastMsgAt':_0x286ac4[_0xd015('0x1a')],'lastMsgDirection':_0x286ac4[_0xd015('0x11')][_0xd015('0x10')]()});}})[_0xd015('0x1b')](function(_0x55590b){console['error'](_0x55590b);});}if(_0x286ac4[_0xd015('0x11')]==='out'&&!_0x286ac4[_0xd015('0x13')]){var _0x4583cd;_0x35548a[_0xd015('0x1c')][_0xd015('0x1d')]({'where':{'id':_0x286ac4[_0xd015('0x1e')]},'raw':!![]})[_0xd015('0x18')](function(_0x34c9f2){_0x4583cd=_0x34c9f2;if(_0x4583cd&&_0x4583cd[_0xd015('0x1f')]){switch(_0x4583cd['type']){case _0xd015('0x20'):var _0x569e11=require('twilio');if(_0x4583cd[_0xd015('0x21')]&&_0x4583cd[_0xd015('0x22')]&&_0x4583cd[_0xd015('0x23')]){var _0x538357=new _0x569e11(_0x4583cd['accountSid'],_0x4583cd[_0xd015('0x22')]);_0x538357[_0xd015('0x24')][_0xd015('0x25')]({'body':_0x286ac4['body'],'to':'whatsapp:'+_0x286ac4['phone'],'from':_0xd015('0x26')+_0x4583cd['phone'],'statusCallback':_0x4583cd[_0xd015('0x27')]+_0xd015('0x28')+_0x286ac4['id']+_0xd015('0x29')+_0x4583cd[_0xd015('0x2a')]})[_0xd015('0x18')](function(_0x5290da){if(_0x5290da[_0xd015('0x2b')]){return _0x175022[_0xd015('0x19')]({'messageId':_0x5290da[_0xd015('0x2b')]});}})[_0xd015('0x1b')](function(_0x3d024d){logger[_0xd015('0x2c')](_0xd015('0x2d'),_0xd015('0x2e'),_0xd015('0x20'),util[_0xd015('0x2f')](_0x3d024d,{'showHidden':![],'depth':null}));});}else{logger[_0xd015('0x2c')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xd015('0x2e'),_0xd015('0x20'),_0xd015('0x30'));}break;case _0xd015('0x31'):var _0xe9ad04=_0x4583cd[_0xd015('0x21')];var _0x453906=_0x4583cd[_0xd015('0x22')];var _0x1fb308=_0x4583cd[_0xd015('0x32')]+_0xd015('0x33')+_0xe9ad04+_0xd015('0x34');var _0x4fd7fb={'to':[_0x286ac4[_0xd015('0x23')]],'message':{'type':_0xd015('0x35'),'text':_0x286ac4[_0xd015('0x36')]}};var _0x657199={'method':_0xd015('0x37'),'uri':_0x1fb308,'headers':{'Authorization':'Bearer\x20'+_0x453906,'Content-Type':_0xd015('0x38')},'body':_0x4fd7fb,'json':!![]};rp(_0x657199)[_0xd015('0x18')](function(_0x2951cb){if(_0x2951cb[_0xd015('0x39')][0x0][_0xd015('0x3a')]){return _0x175022[_0xd015('0x19')]({'messageId':_0x2951cb[_0xd015('0x39')][0x0][_0xd015('0x3a')]});}})[_0xd015('0x1b')](function(_0x2a02d3){logger[_0xd015('0x3b')](_0xd015('0x3c'),_0x2a02d3);});break;}}})[_0xd015('0x3d')](function(){_0x1b669d();});}else{_0x1b669d();}}},'charset':'utf8mb4','collate':_0xd015('0x3e')});}; \ No newline at end of file +var _0xde9f=['sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','sinch','baseUrl','/whatsapp/v1/','/messages/','text','Bearer\x20','statuses','message_id','err','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','WhatsappMessage','messageId','fti_whatsapp_messages','body','models','get','direction','toLowerCase','out','isNil','WhatsappInteraction','findOne','WhatsappInteractionId','update','createdAt','catch','WhatsappAccount','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/status?token=','token'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xde9f,0x16d));var _0xfde9=function(_0x28d225,_0x43be18){_0x28d225=_0x28d225-0x0;var _0x1f79e1=_0xde9f[_0x28d225];return _0x1f79e1;};'use strict';var _=require(_0xfde9('0x0'));var util=require(_0xfde9('0x1'));var logger=require('../../config/logger')(_0xfde9('0x2'));var moment=require('moment');var BPromise=require(_0xfde9('0x3'));var rp=require(_0xfde9('0x4'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0xfde9('0x5'));var rimraf=require(_0xfde9('0x6'));var config=require(_0xfde9('0x7'));var attributes=require(_0xfde9('0x8'));module['exports']=function(_0x506122,_0x48d38d){return _0x506122[_0xfde9('0x9')](_0xfde9('0xa'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0xfde9('0xb'),'fields':['messageId']},{'name':_0xfde9('0xc'),'fields':[_0xfde9('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x408148,_0x3cdb94,_0xe8a94b){var _0x19a902=_0x506122[_0xfde9('0xe')];var _0x5d682b=_0x408148[_0xfde9('0xf')]({'plain':!![]});if(_0x5d682b[_0xfde9('0x10')][_0xfde9('0x11')]()==='in'||_0x5d682b[_0xfde9('0x10')][_0xfde9('0x11')]()===_0xfde9('0x12')&&!_0x5d682b['secret']&&!_[_0xfde9('0x13')](_0x5d682b['UserId'])){_0x19a902[_0xfde9('0x14')][_0xfde9('0x15')]({'where':{'id':_0x5d682b[_0xfde9('0x16')]}})['then'](function(_0x200ef6){if(_0x200ef6){_0x200ef6[_0xfde9('0x17')]({'lastMsgAt':_0x5d682b[_0xfde9('0x18')],'lastMsgDirection':_0x5d682b[_0xfde9('0x10')]['toLowerCase']()});}})[_0xfde9('0x19')](function(_0x196e80){console['error'](_0x196e80);});}if(_0x5d682b[_0xfde9('0x10')]==='out'&&!_0x5d682b['secret']){var _0x451061;_0x19a902[_0xfde9('0x1a')][_0xfde9('0x1b')]({'where':{'id':_0x5d682b[_0xfde9('0x1c')]},'raw':!![]})[_0xfde9('0x1d')](function(_0x207b7b){_0x451061=_0x207b7b;if(_0x451061&&_0x451061[_0xfde9('0x1e')]){switch(_0x451061[_0xfde9('0x1e')]){case _0xfde9('0x1f'):var _0xa2072d=require(_0xfde9('0x1f'));if(_0x451061[_0xfde9('0x20')]&&_0x451061[_0xfde9('0x21')]&&_0x451061[_0xfde9('0x22')]){var _0x290328=new _0xa2072d(_0x451061[_0xfde9('0x20')],_0x451061['authToken']);_0x290328[_0xfde9('0x23')][_0xfde9('0x24')]({'body':_0x5d682b[_0xfde9('0xd')],'to':'whatsapp:'+_0x5d682b[_0xfde9('0x22')],'from':_0xfde9('0x25')+_0x451061[_0xfde9('0x22')],'statusCallback':_0x451061[_0xfde9('0x26')]+'/api/whatsapp/messages/'+_0x5d682b['id']+_0xfde9('0x27')+_0x451061[_0xfde9('0x28')]})[_0xfde9('0x1d')](function(_0x5c888a){if(_0x5c888a[_0xfde9('0x29')]){return _0x408148[_0xfde9('0x17')]({'messageId':_0x5c888a[_0xfde9('0x29')]});}})[_0xfde9('0x19')](function(_0x2f4b3e){logger[_0xfde9('0x2a')](_0xfde9('0x2b'),_0xfde9('0x2c'),'twilio',util[_0xfde9('0x2d')](_0x2f4b3e,{'showHidden':![],'depth':null}));});}else{logger[_0xfde9('0x2a')](_0xfde9('0x2b'),_0xfde9('0x2c'),_0xfde9('0x1f'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xfde9('0x2e'):var _0x366dcd=_0x451061[_0xfde9('0x20')];var _0x41f70c=_0x451061[_0xfde9('0x21')];var _0x455b7b=_0x451061[_0xfde9('0x2f')]+_0xfde9('0x30')+_0x366dcd+_0xfde9('0x31');var _0x554ea0={'to':[_0x5d682b[_0xfde9('0x22')]],'message':{'type':_0xfde9('0x32'),'text':_0x5d682b[_0xfde9('0xd')]}};var _0x345445={'method':'POST','uri':_0x455b7b,'headers':{'Authorization':_0xfde9('0x33')+_0x41f70c,'Content-Type':'application/json'},'body':_0x554ea0,'json':!![]};rp(_0x345445)[_0xfde9('0x1d')](function(_0x30dd29){if(_0x30dd29[_0xfde9('0x34')][0x0][_0xfde9('0x35')]){return _0x408148[_0xfde9('0x17')]({'messageId':_0x30dd29['statuses'][0x0][_0xfde9('0x35')]});}})[_0xfde9('0x19')](function(_0x27edc9){logger[_0xfde9('0x36')]('WhatsappMessage,\x20%s',_0x27edc9);});break;}}})[_0xfde9('0x37')](function(){_0xe8a94b();});}else{_0xe8a94b();}}},'charset':_0xfde9('0x38'),'collate':_0xfde9('0x39')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 2519557..a946a53 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 _0x00dd=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateWhatsappMessage','create','body','options','raw','debug','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x2c6760,_0x487080){var _0x704576=function(_0x30f235){while(--_0x30f235){_0x2c6760['push'](_0x2c6760['shift']());}};_0x704576(++_0x487080);}(_0x00dd,0x17c));var _0xd00d=function(_0x7dd3c0,_0x43d5b7){_0x7dd3c0=_0x7dd3c0-0x0;var _0x30cbf8=_0x00dd[_0x7dd3c0];return _0x30cbf8;};'use strict';var _=require(_0xd00d('0x0'));var util=require('util');var moment=require(_0xd00d('0x1'));var BPromise=require(_0xd00d('0x2'));var rs=require(_0xd00d('0x3'));var fs=require('fs');var Redis=require(_0xd00d('0x4'));var db=require(_0xd00d('0x5'))['db'];var utils=require(_0xd00d('0x6'));var logger=require(_0xd00d('0x7'))(_0xd00d('0x8'));var config=require('../../config/environment');var jayson=require(_0xd00d('0x9'));var client=jayson['client'][_0xd00d('0xa')]({'port':0x232a});config[_0xd00d('0xb')]=_[_0xd00d('0xc')](config[_0xd00d('0xb')],{'host':_0xd00d('0xd'),'port':0x18eb});var socket=require(_0xd00d('0xe'))(new Redis(config[_0xd00d('0xb')]));require(_0xd00d('0xf'))[_0xd00d('0x10')](socket);function respondWithRpcPromise(_0x522eaf,_0x4351f6,_0x4ba9eb){return new BPromise(function(_0x168992,_0x4bad9f){return client[_0xd00d('0x11')](_0x522eaf,_0x4ba9eb)[_0xd00d('0x12')](function(_0x42ac48){logger[_0xd00d('0x13')](_0xd00d('0x14'),_0x4351f6,_0xd00d('0x15'));logger['debug'](_0xd00d('0x16'),_0x4351f6,_0xd00d('0x15'),JSON[_0xd00d('0x17')](_0x42ac48));if(_0x42ac48[_0xd00d('0x18')]){if(_0x42ac48[_0xd00d('0x18')][_0xd00d('0x19')]===0x1f4){logger[_0xd00d('0x18')](_0xd00d('0x14'),_0x4351f6,_0x42ac48[_0xd00d('0x18')]['message']);return _0x4bad9f(_0x42ac48[_0xd00d('0x18')]['message']);}logger[_0xd00d('0x18')](_0xd00d('0x14'),_0x4351f6,_0x42ac48[_0xd00d('0x18')][_0xd00d('0x1a')]);return _0x168992(_0x42ac48[_0xd00d('0x18')]['message']);}else{logger[_0xd00d('0x13')](_0xd00d('0x14'),_0x4351f6,'request\x20sent');_0x168992(_0x42ac48[_0xd00d('0x1b')][_0xd00d('0x1a')]);}})[_0xd00d('0x1c')](function(_0x99bba5){logger[_0xd00d('0x18')]('WhatsappMessage,\x20%s,\x20%s',_0x4351f6,_0x99bba5);_0x4bad9f(_0x99bba5);});});}exports[_0xd00d('0x1d')]=function(_0x22d736){var _0x14d0d1=this;return new Promise(function(_0x953ebc,_0x2082a4){return db['WhatsappMessage'][_0xd00d('0x1e')](_0x22d736[_0xd00d('0x1f')],{'raw':_0x22d736[_0xd00d('0x20')]?_0x22d736[_0xd00d('0x20')][_0xd00d('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x5acca8){logger[_0xd00d('0x13')](_0xd00d('0x1d'),_0x22d736);logger[_0xd00d('0x22')](_0xd00d('0x1d'),_0x22d736,JSON[_0xd00d('0x17')](_0x5acca8));_0x953ebc(_0x5acca8);})[_0xd00d('0x1c')](function(_0x2417a6){logger[_0xd00d('0x18')](_0xd00d('0x1d'),_0x2417a6[_0xd00d('0x1a')],_0x22d736);_0x2082a4(_0x14d0d1[_0xd00d('0x18')](0x1f4,_0x2417a6[_0xd00d('0x1a')]));});});}; \ No newline at end of file +var _0xbd37=['client','http','redis','defaults','localhost','./whatsappMessage.socket','register','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','WhatsappMessage','create','body','options','raw','catch','CreateWhatsappMessage','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2e9f5f,_0x56b80b){var _0x5bdc62=function(_0x34edc2){while(--_0x34edc2){_0x2e9f5f['push'](_0x2e9f5f['shift']());}};_0x5bdc62(++_0x56b80b);}(_0xbd37,0x1ed));var _0x7bd3=function(_0x291ec3,_0x2f19a7){_0x291ec3=_0x291ec3-0x0;var _0x423b99=_0xbd37[_0x291ec3];return _0x423b99;};'use strict';var _=require(_0x7bd3('0x0'));var util=require(_0x7bd3('0x1'));var moment=require('moment');var BPromise=require(_0x7bd3('0x2'));var rs=require(_0x7bd3('0x3'));var fs=require('fs');var Redis=require(_0x7bd3('0x4'));var db=require(_0x7bd3('0x5'))['db'];var utils=require(_0x7bd3('0x6'));var logger=require(_0x7bd3('0x7'))(_0x7bd3('0x8'));var config=require(_0x7bd3('0x9'));var jayson=require(_0x7bd3('0xa'));var client=jayson[_0x7bd3('0xb')][_0x7bd3('0xc')]({'port':0x232a});config[_0x7bd3('0xd')]=_[_0x7bd3('0xe')](config[_0x7bd3('0xd')],{'host':_0x7bd3('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7bd3('0xd')]));require(_0x7bd3('0x10'))[_0x7bd3('0x11')](socket);function respondWithRpcPromise(_0x5909fd,_0x438f78,_0x4c9be6){return new BPromise(function(_0x144ba2,_0x3333c9){return client[_0x7bd3('0x12')](_0x5909fd,_0x4c9be6)[_0x7bd3('0x13')](function(_0x4fef8d){logger['info'](_0x7bd3('0x14'),_0x438f78,_0x7bd3('0x15'));logger[_0x7bd3('0x16')](_0x7bd3('0x17'),_0x438f78,_0x7bd3('0x15'),JSON[_0x7bd3('0x18')](_0x4fef8d));if(_0x4fef8d[_0x7bd3('0x19')]){if(_0x4fef8d['error'][_0x7bd3('0x1a')]===0x1f4){logger[_0x7bd3('0x19')](_0x7bd3('0x14'),_0x438f78,_0x4fef8d[_0x7bd3('0x19')][_0x7bd3('0x1b')]);return _0x3333c9(_0x4fef8d['error'][_0x7bd3('0x1b')]);}logger[_0x7bd3('0x19')]('WhatsappMessage,\x20%s,\x20%s',_0x438f78,_0x4fef8d[_0x7bd3('0x19')][_0x7bd3('0x1b')]);return _0x144ba2(_0x4fef8d[_0x7bd3('0x19')]['message']);}else{logger[_0x7bd3('0x1c')]('WhatsappMessage,\x20%s,\x20%s',_0x438f78,_0x7bd3('0x15'));_0x144ba2(_0x4fef8d['result'][_0x7bd3('0x1b')]);}})['catch'](function(_0x480573){logger[_0x7bd3('0x19')](_0x7bd3('0x14'),_0x438f78,_0x480573);_0x3333c9(_0x480573);});});}exports['CreateWhatsappMessage']=function(_0x21d680){var _0x458f3e=this;return new Promise(function(_0x5840c5,_0x2453fd){return db[_0x7bd3('0x1d')][_0x7bd3('0x1e')](_0x21d680[_0x7bd3('0x1f')],{'raw':_0x21d680[_0x7bd3('0x20')]?_0x21d680[_0x7bd3('0x20')][_0x7bd3('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x47ba04){logger[_0x7bd3('0x1c')]('CreateWhatsappMessage',_0x21d680);logger[_0x7bd3('0x16')]('CreateWhatsappMessage',_0x21d680,JSON['stringify'](_0x47ba04));_0x5840c5(_0x47ba04);})[_0x7bd3('0x22')](function(_0x40e900){logger[_0x7bd3('0x19')](_0x7bd3('0x23'),_0x40e900['message'],_0x21d680);_0x2453fd(_0x458f3e[_0x7bd3('0x19')](0x1f4,_0x40e900[_0x7bd3('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 87bf991..6ea951b 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 _0x81d6=['register','save','remove','update','emit'];(function(_0x5d18a6,_0x416183){var _0x335faf=function(_0x46ee0a){while(--_0x46ee0a){_0x5d18a6['push'](_0x5d18a6['shift']());}};_0x335faf(++_0x416183);}(_0x81d6,0x155));var _0x681d=function(_0x1ea4ff,_0x30e7cf){_0x1ea4ff=_0x1ea4ff-0x0;var _0x4c2e46=_0x81d6[_0x1ea4ff];return _0x4c2e46;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x681d('0x0'),_0x681d('0x1'),_0x681d('0x2')];function createListener(_0xa66384,_0x4eb6c3){return function(_0x191da9){_0x4eb6c3[_0x681d('0x3')](_0xa66384,_0x191da9);};}function removeListener(_0x1f4b17,_0x21de7a){return function(){WhatsappMessageEvents['removeListener'](_0x1f4b17,_0x21de7a);};}exports[_0x681d('0x4')]=function(_0xa8daca){for(var _0x17d4fc=0x0,_0x256cf8=events['length'];_0x17d4fc<_0x256cf8;_0x17d4fc++){var _0x470efa=events[_0x17d4fc];var _0x6e30b4=createListener('whatsappMessage:'+_0x470efa,_0xa8daca);WhatsappMessageEvents['on'](_0x470efa,_0x6e30b4);}}; \ No newline at end of file +var _0x9e8d=['remove','update','emit','length','whatsappMessage:','save'];(function(_0x2600c7,_0xb9a210){var _0x39ecb3=function(_0x316613){while(--_0x316613){_0x2600c7['push'](_0x2600c7['shift']());}};_0x39ecb3(++_0xb9a210);}(_0x9e8d,0x6b));var _0xd9e8=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x9e8d[_0x46aff0];return _0x9d78cf;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0xd9e8('0x0'),_0xd9e8('0x1'),_0xd9e8('0x2')];function createListener(_0x247ee0,_0x25023){return function(_0x287384){_0x25023[_0xd9e8('0x3')](_0x247ee0,_0x287384);};}function removeListener(_0x4a395f,_0x52916b){return function(){WhatsappMessageEvents['removeListener'](_0x4a395f,_0x52916b);};}exports['register']=function(_0x1a3297){for(var _0x591fc0=0x0,_0x2735b9=events[_0xd9e8('0x4')];_0x591fc0<_0x2735b9;_0x591fc0++){var _0xeacd92=events[_0x591fc0];var _0x49ad09=createListener(_0xd9e8('0x5')+_0xeacd92,_0x1a3297);WhatsappMessageEvents['on'](_0xeacd92,_0x49ad09);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 033a207..d387076 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 _0x114b=['Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/members','/:id/teams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','delete','destroy','removeAgents','exports','util','path','connect-timeout','express'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0x114b,0x1e9));var _0xb114=function(_0x2e2c5d,_0x412e2d){_0x2e2c5d=_0x2e2c5d-0x0;var _0x7d45da=_0x114b[_0x2e2c5d];return _0x7d45da;};'use strict';var multer=require('multer');var util=require(_0xb114('0x0'));var path=require(_0xb114('0x1'));var timeout=require(_0xb114('0x2'));var express=require(_0xb114('0x3'));var router=express[_0xb114('0x4')]();var fs_extra=require(_0xb114('0x5'));var auth=require(_0xb114('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb114('0x7'));var controller=require(_0xb114('0x8'));router[_0xb114('0x9')]('/',auth[_0xb114('0xa')](),controller['index']);router['get'](_0xb114('0xb'),auth[_0xb114('0xa')](),controller[_0xb114('0xc')]);router[_0xb114('0x9')](_0xb114('0xd'),auth[_0xb114('0xa')](),controller[_0xb114('0xe')]);router[_0xb114('0x9')](_0xb114('0xf'),auth[_0xb114('0xa')](),controller['getMembers']);router[_0xb114('0x9')](_0xb114('0x10'),auth[_0xb114('0xa')](),controller['getTeams']);router[_0xb114('0x9')](_0xb114('0x11'),auth[_0xb114('0xa')](),controller[_0xb114('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb114('0x13')]);router[_0xb114('0x14')](_0xb114('0x10'),auth['isAuthenticated'](),controller[_0xb114('0x15')]);router['post']('/:id/users',auth[_0xb114('0xa')](),controller[_0xb114('0x16')]);router[_0xb114('0x17')](_0xb114('0xd'),auth[_0xb114('0xa')](),controller[_0xb114('0x18')]);router[_0xb114('0x19')](_0xb114('0xd'),auth[_0xb114('0xa')](),controller[_0xb114('0x1a')]);router[_0xb114('0x19')](_0xb114('0x10'),auth[_0xb114('0xa')](),controller['removeTeams']);router[_0xb114('0x19')](_0xb114('0x11'),auth[_0xb114('0xa')](),controller[_0xb114('0x1b')]);module[_0xb114('0x1c')]=router; \ No newline at end of file +var _0x523e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout'];(function(_0x4511e6,_0x2c3afe){var _0x573951=function(_0x24f895){while(--_0x24f895){_0x4511e6['push'](_0x4511e6['shift']());}};_0x573951(++_0x2c3afe);}(_0x523e,0x146));var _0xe523=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x523e[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0xe523('0x0'));var util=require(_0xe523('0x1'));var path=require(_0xe523('0x2'));var timeout=require(_0xe523('0x3'));var express=require(_0xe523('0x4'));var router=express[_0xe523('0x5')]();var fs_extra=require(_0xe523('0x6'));var auth=require(_0xe523('0x7'));var interaction=require(_0xe523('0x8'));var config=require(_0xe523('0x9'));var controller=require('./whatsappQueue.controller');router[_0xe523('0xa')]('/',auth[_0xe523('0xb')](),controller['index']);router['get']('/describe',auth[_0xe523('0xb')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe523('0xc')]);router[_0xe523('0xa')](_0xe523('0xd'),auth[_0xe523('0xb')](),controller[_0xe523('0xe')]);router[_0xe523('0xa')](_0xe523('0xf'),auth[_0xe523('0xb')](),controller['getTeams']);router['get'](_0xe523('0x10'),auth['isAuthenticated'](),controller[_0xe523('0x11')]);router[_0xe523('0x12')]('/',auth[_0xe523('0xb')](),controller[_0xe523('0x13')]);router['post']('/:id/teams',auth[_0xe523('0xb')](),controller[_0xe523('0x14')]);router[_0xe523('0x12')](_0xe523('0x10'),auth['isAuthenticated'](),controller[_0xe523('0x15')]);router[_0xe523('0x16')](_0xe523('0x17'),auth[_0xe523('0xb')](),controller[_0xe523('0x18')]);router[_0xe523('0x19')](_0xe523('0x17'),auth[_0xe523('0xb')](),controller[_0xe523('0x1a')]);router[_0xe523('0x19')](_0xe523('0xf'),auth[_0xe523('0xb')](),controller[_0xe523('0x1b')]);router[_0xe523('0x19')](_0xe523('0x10'),auth['isAuthenticated'](),controller[_0xe523('0x1c')]);module[_0xe523('0x1d')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 6065074..13808b0 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 _0x26bc=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','rrmemory'];(function(_0x302695,_0x3dea91){var _0x3f0fd7=function(_0x905b0a){while(--_0x905b0a){_0x302695['push'](_0x302695['shift']());}};_0x3f0fd7(++_0x3dea91);}(_0x26bc,0x162));var _0xc26b=function(_0x56634f,_0x21d65b){_0x56634f=_0x56634f-0x0;var _0x3c676f=_0x26bc[_0x56634f];return _0x3c676f;};'use strict';var Sequelize=require(_0xc26b('0x0'));module[_0xc26b('0x1')]={'name':{'type':Sequelize[_0xc26b('0x2')],'unique':_0xc26b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xc26b('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xc26b('0x5'),_0xc26b('0x6'),_0xc26b('0x7'))},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3360=['STRING','sequelize','exports','ENUM','roundrobin'];(function(_0x2e9754,_0x36d727){var _0xcfb848=function(_0x433286){while(--_0x433286){_0x2e9754['push'](_0x2e9754['shift']());}};_0xcfb848(++_0x36d727);}(_0x3360,0x1d7));var _0x0336=function(_0x348914,_0x59ede3){_0x348914=_0x348914-0x0;var _0x39d759=_0x3360[_0x348914];return _0x39d759;};'use strict';var Sequelize=require(_0x0336('0x0'));module[_0x0336('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0336('0x2')]('rrmemory','beepall',_0x0336('0x3'))},'description':{'type':Sequelize[_0x0336('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 7384049..1a41a20 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 _0x92d7=['value','isEmpty','userWhatsappQueue:remove','addAgents','spread','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/environment','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','status','end','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','get','WhatsappQueues','UserProfileResource','sendStatus','error','stack','name','index','WhatsappQueue','rawAttributes','type','key','getOptions','where','include','query','findAll','show','params','model','intersection','fields','attributes','length','merge','options','find','catch','create','body','userProfileId','autoAssociation','describe','getMembers','UserWhatsappQueue','filters','hasOwnProperty','nolimit','order','sort','pick','WhatsappQueueId','map','filter','findAndCountAll','agent','rows','format','%s/%s','SIP','whatsappPause','createdAt','updatedAt','findOne','keys','Team','getTeams','addTeams','ids','User','Agents','voicePause','interface','flatMap','sequelize','transaction','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','WhatsappQueueId\x20=\x20?','clone','push','SELECT','includes','union','compact'];(function(_0x2a6bc,_0x761a07){var _0x288d3a=function(_0x3c52d8){while(--_0x3c52d8){_0x2a6bc['push'](_0x2a6bc['shift']());}};_0x288d3a(++_0x761a07);}(_0x92d7,0x1cf));var _0x792d=function(_0x2ad9f5,_0xb0ed16){_0x2ad9f5=_0x2ad9f5-0x0;var _0x3ea170=_0x92d7[_0x2ad9f5];return _0x3ea170;};'use strict';var BPromise=require(_0x792d('0x0'));var util=require(_0x792d('0x1'));var _=require(_0x792d('0x2'));var squel=require(_0x792d('0x3'));var Redis=require(_0x792d('0x4'));var qs=require(_0x792d('0x5'));var logger=require('../../config/logger')('api');var config=require(_0x792d('0x6'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x792d('0x7')](config[_0x792d('0x8')],{'host':_0x792d('0x9'),'port':0x18eb});var socket=require(_0x792d('0xa'))(new Redis(config[_0x792d('0x8')]));require(_0x792d('0xb'))['register'](socket);function respondWithStatusCode(_0xaf0aa8,_0x59f005){_0x59f005=_0x59f005||0xcc;return function(_0x2419ad){if(_0x2419ad){return _0xaf0aa8['sendStatus'](_0x59f005);}return _0xaf0aa8[_0x792d('0xc')](_0x59f005)[_0x792d('0xd')]();};}function respondWithResult(_0x3b0599,_0x214bff){_0x214bff=_0x214bff||0xc8;return function(_0x17b450){if(_0x17b450){return _0x3b0599[_0x792d('0xc')](_0x214bff)[_0x792d('0xe')](_0x17b450);}};}function respondWithFilteredResult(_0x24d03f,_0x2f790b){return function(_0x852112){if(_0x852112){var _0x4f00d0=typeof _0x2f790b[_0x792d('0xf')]===_0x792d('0x10')&&typeof _0x2f790b[_0x792d('0x11')]===_0x792d('0x10');var _0x33c3f8=_0x852112[_0x792d('0x12')];var _0x59f271=_0x4f00d0?0x0:_0x2f790b['offset'];var _0x8f2764=_0x4f00d0?_0x852112['count']:_0x2f790b[_0x792d('0xf')]+_0x2f790b[_0x792d('0x11')];var _0x342bb0;if(_0x8f2764>=_0x33c3f8){_0x8f2764=_0x33c3f8;_0x342bb0=0xc8;}else{_0x342bb0=0xce;}_0x24d03f[_0x792d('0xc')](_0x342bb0);return _0x24d03f[_0x792d('0x13')](_0x792d('0x14'),_0x59f271+'-'+_0x8f2764+'/'+_0x33c3f8)[_0x792d('0xe')](_0x852112);}return null;};}function saveUpdates(_0x534eaa){return function(_0x41da86){if(_0x41da86){return _0x41da86[_0x792d('0x15')](_0x534eaa)['then'](function(_0x313aee){return _0x313aee;});}return null;};}function removeEntity(_0x2db4ac){return function(_0xdd23d5){if(_0xdd23d5){return _0xdd23d5[_0x792d('0x16')]()[_0x792d('0x17')](function(){var _0x3fda64=_0xdd23d5[_0x792d('0x18')]({'plain':!![]});var _0x1ec3c5=_0x792d('0x19');return db[_0x792d('0x1a')][_0x792d('0x16')]({'where':{'type':_0x1ec3c5,'resourceId':_0x3fda64['id']}})[_0x792d('0x17')](function(){return _0xdd23d5;});})[_0x792d('0x17')](function(){_0x2db4ac['status'](0xcc)[_0x792d('0xd')]();});}};}function handleEntityNotFound(_0x361f34){return function(_0xcdb00){if(!_0xcdb00){_0x361f34[_0x792d('0x1b')](0x194);}return _0xcdb00;};}function handleError(_0x8d1ca3,_0x422f43){_0x422f43=_0x422f43||0x1f4;return function(_0x524753){logger[_0x792d('0x1c')](_0x524753[_0x792d('0x1d')]);if(_0x524753['name']){delete _0x524753[_0x792d('0x1e')];}_0x8d1ca3[_0x792d('0xc')](_0x422f43)['send'](_0x524753);};}exports[_0x792d('0x1f')]=function(_0x320db4,_0x3fe1de){var _0x3e4112={};var _0x4f61c9={'count':0x0,'rows':[]};var _0x442d26=_['map'](db[_0x792d('0x20')][_0x792d('0x21')],function(_0x287026){return{'name':_0x287026['fieldName'],'type':_0x287026[_0x792d('0x22')][_0x792d('0x23')]};});_0x3e4112=qs[_0x792d('0x24')](_0x442d26,_0x320db4);var _0x554133={'where':_0x3e4112[_0x792d('0x25')]};return db[_0x792d('0x20')][_0x792d('0x12')](_0x554133)[_0x792d('0x17')](function(_0x241726){_0x4f61c9[_0x792d('0x12')]=_0x241726;_0x3e4112[_0x792d('0x26')]=qs[_0x792d('0x26')](_0x320db4[_0x792d('0x27')]);return db[_0x792d('0x20')][_0x792d('0x28')](_0x3e4112);})['then'](function(_0x2bd249){_0x4f61c9['rows']=_0x2bd249;return _0x4f61c9;})[_0x792d('0x17')](respondWithFilteredResult(_0x3fe1de,_0x3e4112))['catch'](handleError(_0x3fe1de,null));};exports[_0x792d('0x29')]=function(_0x338db4,_0x5542aa){var _0x428432={'raw':!![],'where':{'id':_0x338db4[_0x792d('0x2a')]['id']}},_0x679590={};_0x679590[_0x792d('0x2b')]=_['keys'](db[_0x792d('0x20')][_0x792d('0x21')]);_0x679590[_0x792d('0x27')]=_['keys'](_0x338db4['query']);_0x679590['filters']=_[_0x792d('0x2c')](_0x679590['model'],_0x679590[_0x792d('0x27')]);_0x428432['attributes']=_[_0x792d('0x2c')](_0x679590[_0x792d('0x2b')],qs[_0x792d('0x2d')](_0x338db4[_0x792d('0x27')]['fields']));_0x428432[_0x792d('0x2e')]=_0x428432[_0x792d('0x2e')][_0x792d('0x2f')]?_0x428432['attributes']:_0x679590[_0x792d('0x2b')];if(_0x338db4[_0x792d('0x27')]['includeAll']){_0x428432['include']=[{'all':!![]}];}_0x428432=_[_0x792d('0x30')]({},_0x428432,_0x338db4[_0x792d('0x31')]);return db['WhatsappQueue'][_0x792d('0x32')](_0x428432)[_0x792d('0x17')](handleEntityNotFound(_0x5542aa,null))['then'](respondWithResult(_0x5542aa,null))[_0x792d('0x33')](handleError(_0x5542aa,null));};exports[_0x792d('0x34')]=function(_0x485583,_0x37a2d1){return db['WhatsappQueue'][_0x792d('0x34')](_0x485583[_0x792d('0x35')],{})[_0x792d('0x17')](function(_0x16233d){var _0x47b1e0=_0x485583['user'][_0x792d('0x18')]({'plain':!![]});if(!_0x47b1e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x47b1e0['role']==='user'){var _0x13c0bf=_0x16233d[_0x792d('0x18')]({'plain':!![]});var _0x511166='WhatsappQueues';return db['UserProfileSection'][_0x792d('0x32')]({'where':{'name':_0x511166,'userProfileId':_0x47b1e0[_0x792d('0x36')]},'raw':!![]})[_0x792d('0x17')](function(_0x41ffed){if(_0x41ffed&&_0x41ffed[_0x792d('0x37')]===0x0){return db[_0x792d('0x1a')]['create']({'name':_0x13c0bf[_0x792d('0x1e')],'resourceId':_0x13c0bf['id'],'type':_0x41ffed[_0x792d('0x1e')],'sectionId':_0x41ffed['id']},{})[_0x792d('0x17')](function(){return _0x16233d;});}else{return _0x16233d;}})[_0x792d('0x33')](function(_0x5e4642){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e4642);throw _0x5e4642;});}return _0x16233d;})[_0x792d('0x17')](respondWithResult(_0x37a2d1,0xc9))['catch'](handleError(_0x37a2d1,null));};exports[_0x792d('0x15')]=function(_0x43eae2,_0x53253f){if(_0x43eae2[_0x792d('0x35')]['id']){delete _0x43eae2['body']['id'];}return db['WhatsappQueue'][_0x792d('0x32')]({'where':{'id':_0x43eae2[_0x792d('0x2a')]['id']}})[_0x792d('0x17')](handleEntityNotFound(_0x53253f,null))[_0x792d('0x17')](saveUpdates(_0x43eae2[_0x792d('0x35')],null))[_0x792d('0x17')](respondWithResult(_0x53253f,null))[_0x792d('0x33')](handleError(_0x53253f,null));};exports['destroy']=function(_0x3f96b6,_0x4bf466){return db[_0x792d('0x20')][_0x792d('0x32')]({'where':{'id':_0x3f96b6[_0x792d('0x2a')]['id']}})[_0x792d('0x17')](handleEntityNotFound(_0x4bf466,null))['then'](removeEntity(_0x4bf466,null))[_0x792d('0x33')](handleError(_0x4bf466,null));};exports[_0x792d('0x38')]=function(_0x46ce92,_0x1acc3c){return db[_0x792d('0x20')][_0x792d('0x38')]()[_0x792d('0x17')](respondWithResult(_0x1acc3c,null))[_0x792d('0x33')](handleError(_0x1acc3c,null));};exports[_0x792d('0x39')]=function(_0x26491f,_0x4a8483){var _0x3c1088={'raw':!![],'where':{}},_0x36be01={},_0x1f2333;return db[_0x792d('0x20')]['findOne']({'where':{'id':_0x26491f['params']['id']}})[_0x792d('0x17')](handleEntityNotFound(_0x4a8483,null))[_0x792d('0x17')](function(_0x321255){if(_0x321255){_0x1f2333=_0x321255[_0x792d('0x18')]({'plain':!![]});_0x36be01[_0x792d('0x2b')]=_['keys'](db[_0x792d('0x3a')][_0x792d('0x21')]);_0x36be01[_0x792d('0x27')]=_['keys'](_0x26491f['query']);_0x36be01[_0x792d('0x3b')]=_[_0x792d('0x2c')](_0x36be01[_0x792d('0x2b')],_0x36be01[_0x792d('0x27')]);_0x3c1088[_0x792d('0x2e')]=_[_0x792d('0x2c')](_0x36be01[_0x792d('0x2b')],qs[_0x792d('0x2d')](_0x26491f['query'][_0x792d('0x2d')]));_0x3c1088[_0x792d('0x2e')]=_0x3c1088[_0x792d('0x2e')]['length']?_0x3c1088['attributes']:_0x36be01[_0x792d('0x2b')];if(!_0x26491f[_0x792d('0x27')][_0x792d('0x3c')](_0x792d('0x3d'))){_0x3c1088[_0x792d('0x11')]=qs[_0x792d('0x11')](_0x26491f[_0x792d('0x27')][_0x792d('0x11')]);_0x3c1088[_0x792d('0xf')]=qs[_0x792d('0xf')](_0x26491f[_0x792d('0x27')][_0x792d('0xf')]);}_0x3c1088[_0x792d('0x3e')]=qs[_0x792d('0x3f')](_0x26491f[_0x792d('0x27')][_0x792d('0x3f')]);_0x3c1088[_0x792d('0x25')]=qs[_0x792d('0x3b')](_[_0x792d('0x40')](_0x26491f[_0x792d('0x27')],_0x36be01[_0x792d('0x3b')]));_0x3c1088['where'][_0x792d('0x41')]=_0x321255['id'];if(_0x26491f[_0x792d('0x27')]['filter']){_0x3c1088[_0x792d('0x25')]=_[_0x792d('0x30')](_0x3c1088[_0x792d('0x25')],{'$or':_[_0x792d('0x42')](_0x3c1088['attributes'],function(_0x1b6922){var _0x26ebc2={};_0x26ebc2[_0x1b6922]={'$like':'%'+_0x26491f[_0x792d('0x27')][_0x792d('0x43')]+'%'};return _0x26ebc2;})});}_0x3c1088=_['merge']({},_0x3c1088,_0x26491f['options']);return db[_0x792d('0x3a')][_0x792d('0x28')](_0x3c1088);}})[_0x792d('0x17')](function(_0x4437d0){if(_0x4437d0){return db['User'][_0x792d('0x44')]({'where':{'id':_['map'](_0x4437d0,'UserId'),'role':_0x792d('0x45')},'attributes':['id','name','whatsappPause','updatedAt','createdAt']});}})['then'](function(_0x5548c1){if(_0x5548c1){return{'count':_0x5548c1[_0x792d('0x12')],'rows':_['map'](_0x5548c1[_0x792d('0x46')],function(_0x17b96c){return{'membername':_0x17b96c[_0x792d('0x1e')],'UserId':_0x17b96c['id'],'queue_name':_0x1f2333[_0x792d('0x1e')],'WhatsappQueueId':_0x1f2333['id'],'interface':util[_0x792d('0x47')](_0x792d('0x48'),_0x792d('0x49'),_0x17b96c[_0x792d('0x1e')]),'penalty':0x0,'paused':_0x17b96c[_0x792d('0x4a')],'createdAt':_0x17b96c[_0x792d('0x4b')],'updatedAt':_0x17b96c[_0x792d('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x792d('0x17')](respondWithFilteredResult(_0x4a8483,_0x3c1088))['catch'](handleError(_0x4a8483,null));};exports['getTeams']=function(_0x10716f,_0x46f4ed){var _0x4d0a13={};var _0xbf54db={};var _0x4aa0a1;var _0x546a0f;return db[_0x792d('0x20')][_0x792d('0x4d')]({'where':{'id':_0x10716f[_0x792d('0x2a')]['id']}})[_0x792d('0x17')](handleEntityNotFound(_0x46f4ed,null))[_0x792d('0x17')](function(_0x2f025e){if(_0x2f025e){_0x4aa0a1=_0x2f025e;_0xbf54db[_0x792d('0x2b')]=_[_0x792d('0x4e')](db[_0x792d('0x4f')][_0x792d('0x21')]);_0xbf54db['query']=_[_0x792d('0x4e')](_0x10716f[_0x792d('0x27')]);_0xbf54db[_0x792d('0x3b')]=_[_0x792d('0x2c')](_0xbf54db[_0x792d('0x2b')],_0xbf54db[_0x792d('0x27')]);_0x4d0a13[_0x792d('0x2e')]=_[_0x792d('0x2c')](_0xbf54db['model'],qs['fields'](_0x10716f['query'][_0x792d('0x2d')]));_0x4d0a13[_0x792d('0x2e')]=_0x4d0a13[_0x792d('0x2e')][_0x792d('0x2f')]?_0x4d0a13[_0x792d('0x2e')]:_0xbf54db['model'];_0x4d0a13[_0x792d('0x3e')]=qs['sort'](_0x10716f[_0x792d('0x27')][_0x792d('0x3f')]);_0x4d0a13[_0x792d('0x25')]=qs[_0x792d('0x3b')](_[_0x792d('0x40')](_0x10716f['query'],_0xbf54db['filters']));if(_0x10716f[_0x792d('0x27')][_0x792d('0x43')]){_0x4d0a13[_0x792d('0x25')]=_[_0x792d('0x30')](_0x4d0a13[_0x792d('0x25')],{'$or':_[_0x792d('0x42')](_0x4d0a13[_0x792d('0x2e')],function(_0x4e08a3){var _0x5649e1={};_0x5649e1[_0x4e08a3]={'$like':'%'+_0x10716f[_0x792d('0x27')][_0x792d('0x43')]+'%'};return _0x5649e1;})});}_0x4d0a13=_[_0x792d('0x30')]({},_0x4d0a13,_0x10716f[_0x792d('0x31')]);return _0x4aa0a1[_0x792d('0x50')](_0x4d0a13);}})[_0x792d('0x17')](function(_0x4ae47b){if(_0x4ae47b){_0x546a0f=_0x4ae47b[_0x792d('0x2f')];if(!_0x10716f[_0x792d('0x27')][_0x792d('0x3c')](_0x792d('0x3d'))){_0x4d0a13[_0x792d('0x11')]=qs[_0x792d('0x11')](_0x10716f[_0x792d('0x27')][_0x792d('0x11')]);_0x4d0a13['offset']=qs[_0x792d('0xf')](_0x10716f[_0x792d('0x27')][_0x792d('0xf')]);}return _0x4aa0a1[_0x792d('0x50')](_0x4d0a13);}})[_0x792d('0x17')](function(_0x36e335){if(_0x36e335){return _0x36e335?{'count':_0x546a0f,'rows':_0x36e335}:null;}})['then'](respondWithResult(_0x46f4ed,null))[_0x792d('0x33')](handleError(_0x46f4ed,null));};exports[_0x792d('0x51')]=function(_0x1656da,_0x46747f){var _0x3e51e1=_0x1656da[_0x792d('0x35')][_0x792d('0x52')];return db[_0x792d('0x4f')][_0x792d('0x28')]({'where':{'id':_0x3e51e1},'attributes':['id'],'include':[{'model':db[_0x792d('0x53')],'as':_0x792d('0x54'),'attributes':['id',_0x792d('0x1e'),'online',_0x792d('0x55'),_0x792d('0x56')],'raw':!![]}]})[_0x792d('0x17')](function(_0x250653){if(_0x250653){var _0x4ebe0e=_[_0x792d('0x57')](_0x250653,function(_0x337b5b){var _0x253b69=_0x337b5b['get']({'plain':!![]});return _0x253b69[_0x792d('0x54')];});return db['WhatsappQueue']['find']({'where':{'id':_0x1656da[_0x792d('0x2a')]['id']}})[_0x792d('0x17')](function(_0x2880bc){return db[_0x792d('0x58')][_0x792d('0x59')](function(_0xbd1247){return _0x2880bc[_0x792d('0x51')](_0x3e51e1,{'transaction':_0xbd1247})[_0x792d('0x17')](function(){return BPromise['each'](_0x4ebe0e,function(_0x22599c){return db[_0x792d('0x3a')]['findOrCreate']({'where':{'UserId':_0x22599c['id'],'WhatsappQueueId':_0x1656da[_0x792d('0x2a')]['id']},'transaction':_0xbd1247});});})[_0x792d('0x17')](function(){_0x4ebe0e[_0x792d('0x5a')](function(_0x4f5107){socket[_0x792d('0x5b')](_0x792d('0x5c'),{'UserId':_0x4f5107['id'],'WhatsappQueueId':_0x2880bc['id']});});});});});}})[_0x792d('0x17')](respondWithStatusCode(_0x46747f,null))['catch'](handleError(_0x46747f,null));};exports[_0x792d('0x5d')]=function(_0x348f1f,_0x5d9fd4){return db[_0x792d('0x4f')][_0x792d('0x28')]({'where':{'id':_0x348f1f[_0x792d('0x27')][_0x792d('0x52')]},'attributes':['id'],'include':[{'model':db[_0x792d('0x53')],'as':_0x792d('0x54'),'attributes':['id'],'raw':!![]}]})[_0x792d('0x17')](handleEntityNotFound(_0x5d9fd4,null))[_0x792d('0x17')](function(_0x2a02a7){var _0x2701f3=_[_0x792d('0x42')](_0x2a02a7,'id');var _0x4e52e9=[];var _0x46269b=[];var _0x2947f2=squel[_0x792d('0x5e')]();_0x2947f2[_0x792d('0x5f')](_0x792d('0x60'))[_0x792d('0x61')](_0x792d('0x62'),'tq')[_0x792d('0x63')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x792d('0x25')](_0x792d('0x64'),_0x348f1f[_0x792d('0x2a')]['id']);for(var _0x3af1e5=0x0;_0x3af1e5<_0x2a02a7[_0x792d('0x2f')];_0x3af1e5+=0x1){let _0x36183f=_0x2a02a7[_0x3af1e5];for(var _0x1174c0=0x0;_0x1174c0<_0x36183f['Agents'][_0x792d('0x2f')];_0x1174c0+=0x1){let _0x4fe7af=_0x36183f[_0x792d('0x54')][_0x1174c0];var _0x1a9679=_0x2947f2[_0x792d('0x65')]();_0x1a9679[_0x792d('0x25')]('ut.UserId\x20=\x20?',_0x4fe7af['id']);_0x46269b[_0x792d('0x66')](db['sequelize'][_0x792d('0x27')](_0x1a9679['toString'](),{'type':db[_0x792d('0x58')]['QueryTypes'][_0x792d('0x67')]})[_0x792d('0x17')](function(_0x5ab8dc){if(_0x5ab8dc[_0x792d('0x2f')]===0x1){return _0x4fe7af['id'];}else{var _0xe78093=_['every'](_[_0x792d('0x42')](_0x5ab8dc,'TeamId'),function(_0x4aca61){return _[_0x792d('0x68')](_0x2701f3,_0x4aca61);});if(_0xe78093){return _0x4fe7af['id'];}}}));}}return BPromise['all'](_0x46269b)[_0x792d('0x17')](function(_0x4fe249){_0x4e52e9=_(_0x4e52e9)[_0x792d('0x69')](_0x4fe249)[_0x792d('0x6a')]()[_0x792d('0x6b')]();return db[_0x792d('0x20')][_0x792d('0x32')]({'where':{'id':_0x348f1f[_0x792d('0x2a')]['id']}})[_0x792d('0x17')](function(_0xff254f){return db[_0x792d('0x58')][_0x792d('0x59')](function(_0x1a69dd){return _0xff254f['removeTeams'](_0x348f1f[_0x792d('0x27')][_0x792d('0x52')],{'transaction':_0x1a69dd})[_0x792d('0x17')](function(){if(!_[_0x792d('0x6c')](_0x4e52e9)){return _0xff254f['removeAgents'](_0x4e52e9,{'transaction':_0x1a69dd});}})['then'](function(){_0x4e52e9['forEach'](function(_0x220632){socket[_0x792d('0x5b')](_0x792d('0x6d'),{'UserId':_0x220632,'WhatsappQueueId':_0xff254f['id']});});});});});});})[_0x792d('0x17')](respondWithStatusCode(_0x5d9fd4,null))[_0x792d('0x33')](handleError(_0x5d9fd4,null));};exports[_0x792d('0x6e')]=function(_0x3377c9,_0x3db7c7){return db[_0x792d('0x20')][_0x792d('0x32')]({'where':{'id':_0x3377c9[_0x792d('0x2a')]['id']}})[_0x792d('0x17')](handleEntityNotFound(_0x3db7c7,null))[_0x792d('0x17')](function(_0x3c3b02){if(_0x3c3b02){return _0x3c3b02[_0x792d('0x6e')](_0x3377c9[_0x792d('0x35')]['ids'],_['omit'](_0x3377c9[_0x792d('0x35')],['ids','id'])||{})[_0x792d('0x6f')](function(_0x24f326){for(var _0x37005e=0x0;_0x37005e<_0x3377c9['body'][_0x792d('0x52')][_0x792d('0x2f')];_0x37005e+=0x1){socket[_0x792d('0x5b')](_0x792d('0x5c'),{'UserId':Number(_0x3377c9[_0x792d('0x35')]['ids'][_0x37005e]),'WhatsappQueueId':Number(_0x3377c9['params']['id'])});}return _0x24f326;});}})[_0x792d('0x17')](respondWithResult(_0x3db7c7,null))[_0x792d('0x33')](handleError(_0x3db7c7,null));};exports['removeAgents']=function(_0x1ed1bd,_0x2e30c6){return db[_0x792d('0x20')][_0x792d('0x32')]({'where':{'id':_0x1ed1bd[_0x792d('0x2a')]['id']}})[_0x792d('0x17')](handleEntityNotFound(_0x2e30c6,null))[_0x792d('0x17')](function(_0x15e21e){if(_0x15e21e){return _0x15e21e['removeAgents'](_0x1ed1bd[_0x792d('0x27')][_0x792d('0x52')])['then'](function(){if(_[_0x792d('0x70')](_0x1ed1bd[_0x792d('0x27')][_0x792d('0x52')])){for(var _0x55c2d4=0x0;_0x55c2d4<_0x1ed1bd[_0x792d('0x27')][_0x792d('0x52')][_0x792d('0x2f')];_0x55c2d4+=0x1){socket[_0x792d('0x5b')](_0x792d('0x6d'),{'UserId':Number(_0x1ed1bd[_0x792d('0x27')][_0x792d('0x52')][_0x55c2d4]),'WhatsappQueueId':Number(_0x1ed1bd['params']['id'])});}}else{socket['emit'](_0x792d('0x6d'),{'UserId':Number(_0x1ed1bd['query'][_0x792d('0x52')]),'WhatsappQueueId':Number(_0x1ed1bd[_0x792d('0x2a')]['id'])});}});}})[_0x792d('0x17')](respondWithStatusCode(_0x2e30c6,null))[_0x792d('0x33')](handleError(_0x2e30c6,null));};exports[_0x792d('0x71')]=function(_0x20434b,_0x5eb073){var _0x2bfb90={};var _0x445f2a={};var _0x54c63c;var _0x90ee7f;return db[_0x792d('0x20')]['findOne']({'where':{'id':_0x20434b['params']['id']}})[_0x792d('0x17')](handleEntityNotFound(_0x5eb073,null))[_0x792d('0x17')](function(_0x1528b7){if(_0x1528b7){_0x54c63c=_0x1528b7;_0x445f2a[_0x792d('0x2b')]=_[_0x792d('0x4e')](db[_0x792d('0x53')]['rawAttributes']);_0x445f2a[_0x792d('0x27')]=_[_0x792d('0x4e')](_0x20434b[_0x792d('0x27')]);_0x445f2a[_0x792d('0x3b')]=_[_0x792d('0x2c')](_0x445f2a[_0x792d('0x2b')],_0x445f2a[_0x792d('0x27')]);_0x2bfb90[_0x792d('0x2e')]=_['intersection'](_0x445f2a[_0x792d('0x2b')],qs[_0x792d('0x2d')](_0x20434b[_0x792d('0x27')][_0x792d('0x2d')]));_0x2bfb90[_0x792d('0x2e')]=_0x2bfb90[_0x792d('0x2e')][_0x792d('0x2f')]?_0x2bfb90[_0x792d('0x2e')]:_0x445f2a[_0x792d('0x2b')];_0x2bfb90[_0x792d('0x3e')]=qs[_0x792d('0x3f')](_0x20434b[_0x792d('0x27')][_0x792d('0x3f')]);_0x2bfb90[_0x792d('0x25')]=qs['filters'](_[_0x792d('0x40')](_0x20434b[_0x792d('0x27')],_0x445f2a[_0x792d('0x3b')]));if(_0x20434b[_0x792d('0x27')][_0x792d('0x43')]){_0x2bfb90['where']=_[_0x792d('0x30')](_0x2bfb90['where'],{'$or':_[_0x792d('0x42')](_0x2bfb90[_0x792d('0x2e')],function(_0x556b8a){var _0x4cd92a={};_0x4cd92a[_0x556b8a]={'$like':'%'+_0x20434b[_0x792d('0x27')][_0x792d('0x43')]+'%'};return _0x4cd92a;})});}_0x2bfb90=_['merge']({},_0x2bfb90,_0x20434b[_0x792d('0x31')]);return _0x54c63c[_0x792d('0x71')](_0x2bfb90);}})[_0x792d('0x17')](function(_0xa222da){if(_0xa222da){_0x90ee7f=_0xa222da[_0x792d('0x2f')];if(!_0x20434b[_0x792d('0x27')]['hasOwnProperty'](_0x792d('0x3d'))){_0x2bfb90['limit']=qs[_0x792d('0x11')](_0x20434b[_0x792d('0x27')][_0x792d('0x11')]);_0x2bfb90[_0x792d('0xf')]=qs[_0x792d('0xf')](_0x20434b['query']['offset']);}return _0x54c63c[_0x792d('0x71')](_0x2bfb90);}})[_0x792d('0x17')](function(_0x3b82f6){if(_0x3b82f6){return _0x3b82f6?{'count':_0x90ee7f,'rows':_0x3b82f6}:null;}})[_0x792d('0x17')](respondWithResult(_0x5eb073,null))[_0x792d('0x33')](handleError(_0x5eb073,null));}; \ No newline at end of file +var _0x11cb=['fields','length','includeAll','merge','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','WhatsappQueues','UserProfileSection','userProfileId','autoAssociation','describe','findOne','model','UserWhatsappQueue','filters','nolimit','order','sort','pick','filter','findAll','User','findAndCountAll','UserId','agent','whatsappPause','updatedAt','rows','format','%s/%s','SIP','createdAt','getTeams','hasOwnProperty','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','each','findOrCreate','userWhatsappQueue:save','removeTeams','select','join','user_has_teams','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','forEach','userWhatsappQueue:remove','addAgents','omit','emit','isArray','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','api','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','then','get','UserProfileResource','end','stack','name','index','map','WhatsappQueue','rawAttributes','fieldName','type','key','getOptions','where','include','query','show','params','keys','attributes','intersection'];(function(_0x114d1f,_0x55548e){var _0x5b91d4=function(_0x358415){while(--_0x358415){_0x114d1f['push'](_0x114d1f['shift']());}};_0x5b91d4(++_0x55548e);}(_0x11cb,0xc4));var _0xb11c=function(_0x4bcec5,_0x4578c1){_0x4bcec5=_0x4bcec5-0x0;var _0x3dfe8d=_0x11cb[_0x4bcec5];return _0x3dfe8d;};'use strict';var BPromise=require(_0xb11c('0x0'));var util=require(_0xb11c('0x1'));var _=require(_0xb11c('0x2'));var squel=require(_0xb11c('0x3'));var Redis=require(_0xb11c('0x4'));var qs=require(_0xb11c('0x5'));var logger=require('../../config/logger')(_0xb11c('0x6'));var config=require('../../config/environment');var db=require(_0xb11c('0x7'))['db'];config[_0xb11c('0x8')]=_[_0xb11c('0x9')](config[_0xb11c('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xb11c('0xa'))(new Redis(config['redis']));require(_0xb11c('0xb'))[_0xb11c('0xc')](socket);function respondWithStatusCode(_0x978ac7,_0x567f6a){_0x567f6a=_0x567f6a||0xcc;return function(_0x1ec5bb){if(_0x1ec5bb){return _0x978ac7[_0xb11c('0xd')](_0x567f6a);}return _0x978ac7[_0xb11c('0xe')](_0x567f6a)['end']();};}function respondWithResult(_0x30e4b8,_0x4f8cd6){_0x4f8cd6=_0x4f8cd6||0xc8;return function(_0x1fb801){if(_0x1fb801){return _0x30e4b8[_0xb11c('0xe')](_0x4f8cd6)[_0xb11c('0xf')](_0x1fb801);}};}function respondWithFilteredResult(_0x52d489,_0x2c1d0e){return function(_0xf72ea8){if(_0xf72ea8){var _0x5d9bae=typeof _0x2c1d0e[_0xb11c('0x10')]==='undefined'&&typeof _0x2c1d0e[_0xb11c('0x11')]===_0xb11c('0x12');var _0x8cc3be=_0xf72ea8[_0xb11c('0x13')];var _0x635c50=_0x5d9bae?0x0:_0x2c1d0e[_0xb11c('0x10')];var _0x18cfd6=_0x5d9bae?_0xf72ea8['count']:_0x2c1d0e[_0xb11c('0x10')]+_0x2c1d0e[_0xb11c('0x11')];var _0x248e36;if(_0x18cfd6>=_0x8cc3be){_0x18cfd6=_0x8cc3be;_0x248e36=0xc8;}else{_0x248e36=0xce;}_0x52d489[_0xb11c('0xe')](_0x248e36);return _0x52d489[_0xb11c('0x14')](_0xb11c('0x15'),_0x635c50+'-'+_0x18cfd6+'/'+_0x8cc3be)[_0xb11c('0xf')](_0xf72ea8);}return null;};}function saveUpdates(_0x5881e4){return function(_0x512b09){if(_0x512b09){return _0x512b09[_0xb11c('0x16')](_0x5881e4)['then'](function(_0x51b514){return _0x51b514;});}return null;};}function removeEntity(_0x161059){return function(_0x38bea4){if(_0x38bea4){return _0x38bea4[_0xb11c('0x17')]()[_0xb11c('0x18')](function(){var _0x3cadb6=_0x38bea4[_0xb11c('0x19')]({'plain':!![]});var _0xbca260='WhatsappQueues';return db[_0xb11c('0x1a')]['destroy']({'where':{'type':_0xbca260,'resourceId':_0x3cadb6['id']}})[_0xb11c('0x18')](function(){return _0x38bea4;});})[_0xb11c('0x18')](function(){_0x161059[_0xb11c('0xe')](0xcc)[_0xb11c('0x1b')]();});}};}function handleEntityNotFound(_0x29320a){return function(_0x4e060c){if(!_0x4e060c){_0x29320a['sendStatus'](0x194);}return _0x4e060c;};}function handleError(_0x5c6df9,_0x5f6011){_0x5f6011=_0x5f6011||0x1f4;return function(_0x363b16){logger['error'](_0x363b16[_0xb11c('0x1c')]);if(_0x363b16[_0xb11c('0x1d')]){delete _0x363b16[_0xb11c('0x1d')];}_0x5c6df9[_0xb11c('0xe')](_0x5f6011)['send'](_0x363b16);};}exports[_0xb11c('0x1e')]=function(_0x48339e,_0x2865f2){var _0x10b64c={};var _0x37b086={'count':0x0,'rows':[]};var _0x1670c0=_[_0xb11c('0x1f')](db[_0xb11c('0x20')][_0xb11c('0x21')],function(_0x4764d3){return{'name':_0x4764d3[_0xb11c('0x22')],'type':_0x4764d3[_0xb11c('0x23')][_0xb11c('0x24')]};});_0x10b64c=qs[_0xb11c('0x25')](_0x1670c0,_0x48339e);var _0x46fa5a={'where':_0x10b64c[_0xb11c('0x26')]};return db[_0xb11c('0x20')][_0xb11c('0x13')](_0x46fa5a)['then'](function(_0x1271bb){_0x37b086[_0xb11c('0x13')]=_0x1271bb;_0x10b64c['include']=qs[_0xb11c('0x27')](_0x48339e[_0xb11c('0x28')]);return db['WhatsappQueue']['findAll'](_0x10b64c);})[_0xb11c('0x18')](function(_0x4afa08){_0x37b086['rows']=_0x4afa08;return _0x37b086;})['then'](respondWithFilteredResult(_0x2865f2,_0x10b64c))['catch'](handleError(_0x2865f2,null));};exports[_0xb11c('0x29')]=function(_0x3fe012,_0x197eaa){var _0x5868c5={'raw':!![],'where':{'id':_0x3fe012[_0xb11c('0x2a')]['id']}},_0x5573ac={};_0x5573ac['model']=_[_0xb11c('0x2b')](db[_0xb11c('0x20')]['rawAttributes']);_0x5573ac[_0xb11c('0x28')]=_[_0xb11c('0x2b')](_0x3fe012[_0xb11c('0x28')]);_0x5573ac['filters']=_['intersection'](_0x5573ac['model'],_0x5573ac[_0xb11c('0x28')]);_0x5868c5[_0xb11c('0x2c')]=_[_0xb11c('0x2d')](_0x5573ac['model'],qs[_0xb11c('0x2e')](_0x3fe012['query']['fields']));_0x5868c5[_0xb11c('0x2c')]=_0x5868c5[_0xb11c('0x2c')][_0xb11c('0x2f')]?_0x5868c5[_0xb11c('0x2c')]:_0x5573ac['model'];if(_0x3fe012['query'][_0xb11c('0x30')]){_0x5868c5['include']=[{'all':!![]}];}_0x5868c5=_[_0xb11c('0x31')]({},_0x5868c5,_0x3fe012[_0xb11c('0x32')]);return db[_0xb11c('0x20')][_0xb11c('0x33')](_0x5868c5)[_0xb11c('0x18')](handleEntityNotFound(_0x197eaa,null))['then'](respondWithResult(_0x197eaa,null))[_0xb11c('0x34')](handleError(_0x197eaa,null));};exports[_0xb11c('0x35')]=function(_0x2b9b30,_0x3c34e6){return db[_0xb11c('0x20')][_0xb11c('0x35')](_0x2b9b30[_0xb11c('0x36')],{})['then'](function(_0x837bda){var _0x402486=_0x2b9b30[_0xb11c('0x37')][_0xb11c('0x19')]({'plain':!![]});if(!_0x402486)throw new Error(_0xb11c('0x38'));if(_0x402486['role']===_0xb11c('0x37')){var _0x27e6f9=_0x837bda[_0xb11c('0x19')]({'plain':!![]});var _0x1600cc=_0xb11c('0x39');return db[_0xb11c('0x3a')][_0xb11c('0x33')]({'where':{'name':_0x1600cc,'userProfileId':_0x402486[_0xb11c('0x3b')]},'raw':!![]})[_0xb11c('0x18')](function(_0x43ef12){if(_0x43ef12&&_0x43ef12[_0xb11c('0x3c')]===0x0){return db[_0xb11c('0x1a')][_0xb11c('0x35')]({'name':_0x27e6f9[_0xb11c('0x1d')],'resourceId':_0x27e6f9['id'],'type':_0x43ef12[_0xb11c('0x1d')],'sectionId':_0x43ef12['id']},{})[_0xb11c('0x18')](function(){return _0x837bda;});}else{return _0x837bda;}})[_0xb11c('0x34')](function(_0x4d9f2b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4d9f2b);throw _0x4d9f2b;});}return _0x837bda;})[_0xb11c('0x18')](respondWithResult(_0x3c34e6,0xc9))[_0xb11c('0x34')](handleError(_0x3c34e6,null));};exports[_0xb11c('0x16')]=function(_0x3ad310,_0x264d70){if(_0x3ad310[_0xb11c('0x36')]['id']){delete _0x3ad310[_0xb11c('0x36')]['id'];}return db[_0xb11c('0x20')][_0xb11c('0x33')]({'where':{'id':_0x3ad310[_0xb11c('0x2a')]['id']}})[_0xb11c('0x18')](handleEntityNotFound(_0x264d70,null))['then'](saveUpdates(_0x3ad310[_0xb11c('0x36')],null))['then'](respondWithResult(_0x264d70,null))[_0xb11c('0x34')](handleError(_0x264d70,null));};exports[_0xb11c('0x17')]=function(_0x3c86e4,_0x7762d9){return db[_0xb11c('0x20')][_0xb11c('0x33')]({'where':{'id':_0x3c86e4[_0xb11c('0x2a')]['id']}})['then'](handleEntityNotFound(_0x7762d9,null))[_0xb11c('0x18')](removeEntity(_0x7762d9,null))[_0xb11c('0x34')](handleError(_0x7762d9,null));};exports['describe']=function(_0x56886f,_0x488370){return db[_0xb11c('0x20')][_0xb11c('0x3d')]()[_0xb11c('0x18')](respondWithResult(_0x488370,null))[_0xb11c('0x34')](handleError(_0x488370,null));};exports['getMembers']=function(_0x3ca4df,_0x367ea3){var _0x3c4761={'raw':!![],'where':{}},_0xecbfcf={},_0x5bc8bb;return db[_0xb11c('0x20')][_0xb11c('0x3e')]({'where':{'id':_0x3ca4df['params']['id']}})[_0xb11c('0x18')](handleEntityNotFound(_0x367ea3,null))['then'](function(_0x561447){if(_0x561447){_0x5bc8bb=_0x561447['get']({'plain':!![]});_0xecbfcf[_0xb11c('0x3f')]=_[_0xb11c('0x2b')](db[_0xb11c('0x40')][_0xb11c('0x21')]);_0xecbfcf[_0xb11c('0x28')]=_[_0xb11c('0x2b')](_0x3ca4df[_0xb11c('0x28')]);_0xecbfcf[_0xb11c('0x41')]=_[_0xb11c('0x2d')](_0xecbfcf[_0xb11c('0x3f')],_0xecbfcf[_0xb11c('0x28')]);_0x3c4761[_0xb11c('0x2c')]=_[_0xb11c('0x2d')](_0xecbfcf[_0xb11c('0x3f')],qs['fields'](_0x3ca4df[_0xb11c('0x28')][_0xb11c('0x2e')]));_0x3c4761['attributes']=_0x3c4761['attributes'][_0xb11c('0x2f')]?_0x3c4761[_0xb11c('0x2c')]:_0xecbfcf['model'];if(!_0x3ca4df[_0xb11c('0x28')]['hasOwnProperty'](_0xb11c('0x42'))){_0x3c4761['limit']=qs[_0xb11c('0x11')](_0x3ca4df[_0xb11c('0x28')][_0xb11c('0x11')]);_0x3c4761[_0xb11c('0x10')]=qs['offset'](_0x3ca4df[_0xb11c('0x28')][_0xb11c('0x10')]);}_0x3c4761[_0xb11c('0x43')]=qs['sort'](_0x3ca4df[_0xb11c('0x28')][_0xb11c('0x44')]);_0x3c4761[_0xb11c('0x26')]=qs['filters'](_[_0xb11c('0x45')](_0x3ca4df[_0xb11c('0x28')],_0xecbfcf[_0xb11c('0x41')]));_0x3c4761[_0xb11c('0x26')]['WhatsappQueueId']=_0x561447['id'];if(_0x3ca4df[_0xb11c('0x28')]['filter']){_0x3c4761[_0xb11c('0x26')]=_['merge'](_0x3c4761['where'],{'$or':_[_0xb11c('0x1f')](_0x3c4761[_0xb11c('0x2c')],function(_0x460fcc){var _0x13ed63={};_0x13ed63[_0x460fcc]={'$like':'%'+_0x3ca4df[_0xb11c('0x28')][_0xb11c('0x46')]+'%'};return _0x13ed63;})});}_0x3c4761=_[_0xb11c('0x31')]({},_0x3c4761,_0x3ca4df['options']);return db['UserWhatsappQueue'][_0xb11c('0x47')](_0x3c4761);}})[_0xb11c('0x18')](function(_0x414df2){if(_0x414df2){return db[_0xb11c('0x48')][_0xb11c('0x49')]({'where':{'id':_[_0xb11c('0x1f')](_0x414df2,_0xb11c('0x4a')),'role':_0xb11c('0x4b')},'attributes':['id',_0xb11c('0x1d'),_0xb11c('0x4c'),_0xb11c('0x4d'),'createdAt']});}})[_0xb11c('0x18')](function(_0x12ac69){if(_0x12ac69){return{'count':_0x12ac69[_0xb11c('0x13')],'rows':_[_0xb11c('0x1f')](_0x12ac69[_0xb11c('0x4e')],function(_0x420443){return{'membername':_0x420443[_0xb11c('0x1d')],'UserId':_0x420443['id'],'queue_name':_0x5bc8bb[_0xb11c('0x1d')],'WhatsappQueueId':_0x5bc8bb['id'],'interface':util[_0xb11c('0x4f')](_0xb11c('0x50'),_0xb11c('0x51'),_0x420443[_0xb11c('0x1d')]),'penalty':0x0,'paused':_0x420443[_0xb11c('0x4c')],'createdAt':_0x420443[_0xb11c('0x52')],'updatedAt':_0x420443[_0xb11c('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb11c('0x18')](respondWithFilteredResult(_0x367ea3,_0x3c4761))[_0xb11c('0x34')](handleError(_0x367ea3,null));};exports[_0xb11c('0x53')]=function(_0x1db9c7,_0x24285f){var _0x5e70b5={};var _0x3b7fe2={};var _0x27aa89;var _0x4278a1;return db['WhatsappQueue'][_0xb11c('0x3e')]({'where':{'id':_0x1db9c7['params']['id']}})['then'](handleEntityNotFound(_0x24285f,null))[_0xb11c('0x18')](function(_0x443fa2){if(_0x443fa2){_0x27aa89=_0x443fa2;_0x3b7fe2[_0xb11c('0x3f')]=_['keys'](db['Team']['rawAttributes']);_0x3b7fe2['query']=_[_0xb11c('0x2b')](_0x1db9c7[_0xb11c('0x28')]);_0x3b7fe2['filters']=_[_0xb11c('0x2d')](_0x3b7fe2[_0xb11c('0x3f')],_0x3b7fe2[_0xb11c('0x28')]);_0x5e70b5['attributes']=_[_0xb11c('0x2d')](_0x3b7fe2[_0xb11c('0x3f')],qs[_0xb11c('0x2e')](_0x1db9c7[_0xb11c('0x28')][_0xb11c('0x2e')]));_0x5e70b5['attributes']=_0x5e70b5[_0xb11c('0x2c')]['length']?_0x5e70b5[_0xb11c('0x2c')]:_0x3b7fe2[_0xb11c('0x3f')];_0x5e70b5[_0xb11c('0x43')]=qs[_0xb11c('0x44')](_0x1db9c7['query'][_0xb11c('0x44')]);_0x5e70b5['where']=qs['filters'](_[_0xb11c('0x45')](_0x1db9c7[_0xb11c('0x28')],_0x3b7fe2[_0xb11c('0x41')]));if(_0x1db9c7['query'][_0xb11c('0x46')]){_0x5e70b5[_0xb11c('0x26')]=_[_0xb11c('0x31')](_0x5e70b5['where'],{'$or':_[_0xb11c('0x1f')](_0x5e70b5['attributes'],function(_0x185b46){var _0xd99385={};_0xd99385[_0x185b46]={'$like':'%'+_0x1db9c7[_0xb11c('0x28')][_0xb11c('0x46')]+'%'};return _0xd99385;})});}_0x5e70b5=_['merge']({},_0x5e70b5,_0x1db9c7['options']);return _0x27aa89['getTeams'](_0x5e70b5);}})[_0xb11c('0x18')](function(_0x314eb0){if(_0x314eb0){_0x4278a1=_0x314eb0[_0xb11c('0x2f')];if(!_0x1db9c7[_0xb11c('0x28')][_0xb11c('0x54')](_0xb11c('0x42'))){_0x5e70b5[_0xb11c('0x11')]=qs['limit'](_0x1db9c7[_0xb11c('0x28')][_0xb11c('0x11')]);_0x5e70b5[_0xb11c('0x10')]=qs['offset'](_0x1db9c7[_0xb11c('0x28')][_0xb11c('0x10')]);}return _0x27aa89[_0xb11c('0x53')](_0x5e70b5);}})['then'](function(_0x3c6dca){if(_0x3c6dca){return _0x3c6dca?{'count':_0x4278a1,'rows':_0x3c6dca}:null;}})[_0xb11c('0x18')](respondWithResult(_0x24285f,null))[_0xb11c('0x34')](handleError(_0x24285f,null));};exports[_0xb11c('0x55')]=function(_0x5bde05,_0x37d726){var _0x19ed05=_0x5bde05[_0xb11c('0x36')][_0xb11c('0x56')];return db[_0xb11c('0x57')]['findAll']({'where':{'id':_0x19ed05},'attributes':['id'],'include':[{'model':db[_0xb11c('0x48')],'as':_0xb11c('0x58'),'attributes':['id',_0xb11c('0x1d'),_0xb11c('0x59'),_0xb11c('0x5a'),_0xb11c('0x5b')],'raw':!![]}]})['then'](function(_0x38280b){if(_0x38280b){var _0x46eb63=_[_0xb11c('0x5c')](_0x38280b,function(_0x15d923){var _0x168099=_0x15d923[_0xb11c('0x19')]({'plain':!![]});return _0x168099[_0xb11c('0x58')];});return db[_0xb11c('0x20')][_0xb11c('0x33')]({'where':{'id':_0x5bde05['params']['id']}})[_0xb11c('0x18')](function(_0xb01a6e){return db[_0xb11c('0x5d')]['transaction'](function(_0x3adf41){return _0xb01a6e[_0xb11c('0x55')](_0x19ed05,{'transaction':_0x3adf41})[_0xb11c('0x18')](function(){return BPromise[_0xb11c('0x5e')](_0x46eb63,function(_0x3f6608){return db[_0xb11c('0x40')][_0xb11c('0x5f')]({'where':{'UserId':_0x3f6608['id'],'WhatsappQueueId':_0x5bde05[_0xb11c('0x2a')]['id']},'transaction':_0x3adf41});});})['then'](function(){_0x46eb63['forEach'](function(_0x3de743){socket['emit'](_0xb11c('0x60'),{'UserId':_0x3de743['id'],'WhatsappQueueId':_0xb01a6e['id']});});});});});}})[_0xb11c('0x18')](respondWithStatusCode(_0x37d726,null))[_0xb11c('0x34')](handleError(_0x37d726,null));};exports[_0xb11c('0x61')]=function(_0x36d5ba,_0x50ac8a){return db[_0xb11c('0x57')][_0xb11c('0x47')]({'where':{'id':_0x36d5ba[_0xb11c('0x28')][_0xb11c('0x56')]},'attributes':['id'],'include':[{'model':db[_0xb11c('0x48')],'as':_0xb11c('0x58'),'attributes':['id'],'raw':!![]}]})[_0xb11c('0x18')](handleEntityNotFound(_0x50ac8a,null))[_0xb11c('0x18')](function(_0x37816a){var _0x35ebb1=_['map'](_0x37816a,'id');var _0x4f3aac=[];var _0x4d14c1=[];var _0x555704=squel[_0xb11c('0x62')]();_0x555704['field']('tq.TeamId')['from']('team_has_whatsapp_queues','tq')[_0xb11c('0x63')](_0xb11c('0x64'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xb11c('0x65'),_0x36d5ba['params']['id']);for(var _0x5bd7c6=0x0;_0x5bd7c6<_0x37816a[_0xb11c('0x2f')];_0x5bd7c6+=0x1){let _0x3752b9=_0x37816a[_0x5bd7c6];for(var _0x2b2938=0x0;_0x2b2938<_0x3752b9[_0xb11c('0x58')]['length'];_0x2b2938+=0x1){let _0x1d59a4=_0x3752b9['Agents'][_0x2b2938];var _0x53f309=_0x555704[_0xb11c('0x66')]();_0x53f309[_0xb11c('0x26')](_0xb11c('0x67'),_0x1d59a4['id']);_0x4d14c1['push'](db[_0xb11c('0x5d')][_0xb11c('0x28')](_0x53f309['toString'](),{'type':db['sequelize'][_0xb11c('0x68')][_0xb11c('0x69')]})[_0xb11c('0x18')](function(_0x402918){if(_0x402918[_0xb11c('0x2f')]===0x1){return _0x1d59a4['id'];}else{var _0x4eb438=_[_0xb11c('0x6a')](_[_0xb11c('0x1f')](_0x402918,_0xb11c('0x6b')),function(_0x228084){return _[_0xb11c('0x6c')](_0x35ebb1,_0x228084);});if(_0x4eb438){return _0x1d59a4['id'];}}}));}}return BPromise[_0xb11c('0x6d')](_0x4d14c1)[_0xb11c('0x18')](function(_0x377701){_0x4f3aac=_(_0x4f3aac)['union'](_0x377701)[_0xb11c('0x6e')]()[_0xb11c('0x6f')]();return db['WhatsappQueue']['find']({'where':{'id':_0x36d5ba[_0xb11c('0x2a')]['id']}})[_0xb11c('0x18')](function(_0x48e3b8){return db[_0xb11c('0x5d')]['transaction'](function(_0xebb41){return _0x48e3b8[_0xb11c('0x61')](_0x36d5ba[_0xb11c('0x28')][_0xb11c('0x56')],{'transaction':_0xebb41})['then'](function(){if(!_[_0xb11c('0x70')](_0x4f3aac)){return _0x48e3b8[_0xb11c('0x71')](_0x4f3aac,{'transaction':_0xebb41});}})[_0xb11c('0x18')](function(){_0x4f3aac[_0xb11c('0x72')](function(_0x58841c){socket['emit'](_0xb11c('0x73'),{'UserId':_0x58841c,'WhatsappQueueId':_0x48e3b8['id']});});});});});});})['then'](respondWithStatusCode(_0x50ac8a,null))['catch'](handleError(_0x50ac8a,null));};exports[_0xb11c('0x74')]=function(_0x313e27,_0x1fbeda){return db[_0xb11c('0x20')]['find']({'where':{'id':_0x313e27[_0xb11c('0x2a')]['id']}})['then'](handleEntityNotFound(_0x1fbeda,null))[_0xb11c('0x18')](function(_0x1e9686){if(_0x1e9686){return _0x1e9686['addAgents'](_0x313e27[_0xb11c('0x36')][_0xb11c('0x56')],_[_0xb11c('0x75')](_0x313e27[_0xb11c('0x36')],[_0xb11c('0x56'),'id'])||{})['spread'](function(_0x4d78ca){for(var _0x572661=0x0;_0x572661<_0x313e27[_0xb11c('0x36')][_0xb11c('0x56')]['length'];_0x572661+=0x1){socket[_0xb11c('0x76')](_0xb11c('0x60'),{'UserId':Number(_0x313e27[_0xb11c('0x36')][_0xb11c('0x56')][_0x572661]),'WhatsappQueueId':Number(_0x313e27[_0xb11c('0x2a')]['id'])});}return _0x4d78ca;});}})[_0xb11c('0x18')](respondWithResult(_0x1fbeda,null))['catch'](handleError(_0x1fbeda,null));};exports[_0xb11c('0x71')]=function(_0x5eb1c6,_0xf2c3f9){return db['WhatsappQueue'][_0xb11c('0x33')]({'where':{'id':_0x5eb1c6[_0xb11c('0x2a')]['id']}})[_0xb11c('0x18')](handleEntityNotFound(_0xf2c3f9,null))[_0xb11c('0x18')](function(_0xf63754){if(_0xf63754){return _0xf63754[_0xb11c('0x71')](_0x5eb1c6[_0xb11c('0x28')][_0xb11c('0x56')])['then'](function(){if(_[_0xb11c('0x77')](_0x5eb1c6[_0xb11c('0x28')][_0xb11c('0x56')])){for(var _0x3c986a=0x0;_0x3c986a<_0x5eb1c6[_0xb11c('0x28')]['ids'][_0xb11c('0x2f')];_0x3c986a+=0x1){socket[_0xb11c('0x76')](_0xb11c('0x73'),{'UserId':Number(_0x5eb1c6[_0xb11c('0x28')][_0xb11c('0x56')][_0x3c986a]),'WhatsappQueueId':Number(_0x5eb1c6[_0xb11c('0x2a')]['id'])});}}else{socket[_0xb11c('0x76')]('userWhatsappQueue:remove',{'UserId':Number(_0x5eb1c6[_0xb11c('0x28')][_0xb11c('0x56')]),'WhatsappQueueId':Number(_0x5eb1c6['params']['id'])});}});}})['then'](respondWithStatusCode(_0xf2c3f9,null))[_0xb11c('0x34')](handleError(_0xf2c3f9,null));};exports['getAgents']=function(_0x2edd9b,_0xc2cccc){var _0x4a2820={};var _0x56c4bf={};var _0x13ddba;var _0x5b0993;return db[_0xb11c('0x20')]['findOne']({'where':{'id':_0x2edd9b[_0xb11c('0x2a')]['id']}})[_0xb11c('0x18')](handleEntityNotFound(_0xc2cccc,null))[_0xb11c('0x18')](function(_0x282354){if(_0x282354){_0x13ddba=_0x282354;_0x56c4bf[_0xb11c('0x3f')]=_[_0xb11c('0x2b')](db[_0xb11c('0x48')]['rawAttributes']);_0x56c4bf[_0xb11c('0x28')]=_[_0xb11c('0x2b')](_0x2edd9b['query']);_0x56c4bf['filters']=_[_0xb11c('0x2d')](_0x56c4bf[_0xb11c('0x3f')],_0x56c4bf[_0xb11c('0x28')]);_0x4a2820[_0xb11c('0x2c')]=_[_0xb11c('0x2d')](_0x56c4bf[_0xb11c('0x3f')],qs[_0xb11c('0x2e')](_0x2edd9b[_0xb11c('0x28')][_0xb11c('0x2e')]));_0x4a2820[_0xb11c('0x2c')]=_0x4a2820['attributes'][_0xb11c('0x2f')]?_0x4a2820[_0xb11c('0x2c')]:_0x56c4bf[_0xb11c('0x3f')];_0x4a2820['order']=qs['sort'](_0x2edd9b[_0xb11c('0x28')]['sort']);_0x4a2820[_0xb11c('0x26')]=qs['filters'](_['pick'](_0x2edd9b[_0xb11c('0x28')],_0x56c4bf[_0xb11c('0x41')]));if(_0x2edd9b[_0xb11c('0x28')][_0xb11c('0x46')]){_0x4a2820['where']=_['merge'](_0x4a2820[_0xb11c('0x26')],{'$or':_[_0xb11c('0x1f')](_0x4a2820[_0xb11c('0x2c')],function(_0x256035){var _0x20c465={};_0x20c465[_0x256035]={'$like':'%'+_0x2edd9b[_0xb11c('0x28')][_0xb11c('0x46')]+'%'};return _0x20c465;})});}_0x4a2820=_[_0xb11c('0x31')]({},_0x4a2820,_0x2edd9b[_0xb11c('0x32')]);return _0x13ddba[_0xb11c('0x78')](_0x4a2820);}})[_0xb11c('0x18')](function(_0x18463d){if(_0x18463d){_0x5b0993=_0x18463d[_0xb11c('0x2f')];if(!_0x2edd9b['query'][_0xb11c('0x54')]('nolimit')){_0x4a2820[_0xb11c('0x11')]=qs[_0xb11c('0x11')](_0x2edd9b['query']['limit']);_0x4a2820[_0xb11c('0x10')]=qs['offset'](_0x2edd9b['query'][_0xb11c('0x10')]);}return _0x13ddba[_0xb11c('0x78')](_0x4a2820);}})[_0xb11c('0x18')](function(_0x446ad9){if(_0x446ad9){return _0x446ad9?{'count':_0x5b0993,'rows':_0x446ad9}:null;}})[_0xb11c('0x18')](respondWithResult(_0xc2cccc,null))[_0xb11c('0x34')](handleError(_0xc2cccc,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index bf8161d..0e597e5 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 _0x37d2=['../../mysqldb','WhatsappQueue','save','remove','emit','exports','events'];(function(_0xa9b067,_0x2047eb){var _0x492156=function(_0x32a056){while(--_0x32a056){_0xa9b067['push'](_0xa9b067['shift']());}};_0x492156(++_0x2047eb);}(_0x37d2,0x14f));var _0x237d=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x37d2[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0x237d('0x0'));var WhatsappQueue=require(_0x237d('0x1'))['db'][_0x237d('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x237d('0x3'),'afterUpdate':'update','afterDestroy':_0x237d('0x4')};function emitEvent(_0xdfb42){return function(_0x5efae6,_0x4b9286,_0x1bbf6b){WhatsappQueueEvents[_0x237d('0x5')](_0xdfb42+':'+_0x5efae6['id'],_0x5efae6);WhatsappQueueEvents[_0x237d('0x5')](_0xdfb42,_0x5efae6);_0x1bbf6b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x237d('0x6')]=WhatsappQueueEvents; \ No newline at end of file +var _0x531e=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappQueue'];(function(_0x16bb50,_0x4248fa){var _0x38a236=function(_0x31576b){while(--_0x31576b){_0x16bb50['push'](_0x16bb50['shift']());}};_0x38a236(++_0x4248fa);}(_0x531e,0x19c));var _0xe531=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x531e[_0x2d8fc2];return _0x3a9e53;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0xe531('0x0'))['db'][_0xe531('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe531('0x2'),'afterUpdate':_0xe531('0x3'),'afterDestroy':_0xe531('0x4')};function emitEvent(_0x34fa1b){return function(_0x158d30,_0x3f9d96,_0x2f868f){WhatsappQueueEvents[_0xe531('0x5')](_0x34fa1b+':'+_0x158d30['id'],_0x158d30);WhatsappQueueEvents['emit'](_0x34fa1b,_0x158d30);_0x2f868f(null);};}for(var e in events){if(events[_0xe531('0x6')](e)){var event=events[e];WhatsappQueue[_0xe531('0x7')](e,emitEvent(event));}}module[_0xe531('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index d3ccb0d..62e4e29 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 _0x0fa8=['./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0fa8,0xbb));var _0x80fa=function(_0x466410,_0x4069d9){_0x466410=_0x466410-0x0;var _0x3d758e=_0x0fa8[_0x466410];return _0x3d758e;};'use strict';var _=require('lodash');var util=require(_0x80fa('0x0'));var logger=require(_0x80fa('0x1'))(_0x80fa('0x2'));var moment=require(_0x80fa('0x3'));var BPromise=require(_0x80fa('0x4'));var rp=require(_0x80fa('0x5'));var fs=require('fs');var path=require(_0x80fa('0x6'));var rimraf=require(_0x80fa('0x7'));var config=require('../../config/environment');var attributes=require(_0x80fa('0x8'));module[_0x80fa('0x9')]=function(_0x6eca35,_0x4a11c3){return _0x6eca35[_0x80fa('0xa')](_0x80fa('0xb'),attributes,{'tableName':_0x80fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf6a9=['lodash','util','api','request-promise','path','../../config/environment','./whatsappQueue.attributes','define'];(function(_0x289a67,_0x1e5a3c){var _0x572b49=function(_0x22e036){while(--_0x22e036){_0x289a67['push'](_0x289a67['shift']());}};_0x572b49(++_0x1e5a3c);}(_0xf6a9,0xf8));var _0x9f6a=function(_0x2f4cb1,_0x5b84cc){_0x2f4cb1=_0x2f4cb1-0x0;var _0xd3e972=_0xf6a9[_0x2f4cb1];return _0xd3e972;};'use strict';var _=require(_0x9f6a('0x0'));var util=require(_0x9f6a('0x1'));var logger=require('../../config/logger')(_0x9f6a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f6a('0x3'));var fs=require('fs');var path=require(_0x9f6a('0x4'));var rimraf=require('rimraf');var config=require(_0x9f6a('0x5'));var attributes=require(_0x9f6a('0x6'));module['exports']=function(_0x496013,_0x246073){return _0x496013[_0x9f6a('0x7')]('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 e97f37c..719a882 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 _0x0a7b=['WhatsappQueue,\x20%s,\x20%s','message','info','result','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','attributes','include','map','model','catch','find','where','ShowWhatsappQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','register','request','then','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x193fb1,_0xb02d80){var _0x55b300=function(_0x20cbc4){while(--_0x20cbc4){_0x193fb1['push'](_0x193fb1['shift']());}};_0x55b300(++_0xb02d80);}(_0x0a7b,0x107));var _0xb0a7=function(_0x411926,_0x30d5f0){_0x411926=_0x411926-0x0;var _0x457e62=_0x0a7b[_0x411926];return _0x457e62;};'use strict';var _=require(_0xb0a7('0x0'));var util=require(_0xb0a7('0x1'));var moment=require(_0xb0a7('0x2'));var BPromise=require(_0xb0a7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb0a7('0x4'));var db=require(_0xb0a7('0x5'))['db'];var utils=require(_0xb0a7('0x6'));var logger=require(_0xb0a7('0x7'))(_0xb0a7('0x8'));var config=require('../../config/environment');var jayson=require(_0xb0a7('0x9'));var client=jayson[_0xb0a7('0xa')][_0xb0a7('0xb')]({'port':0x232a});config['redis']=_[_0xb0a7('0xc')](config[_0xb0a7('0xd')],{'host':_0xb0a7('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb0a7('0xd')]));require('./whatsappQueue.socket')[_0xb0a7('0xf')](socket);function respondWithRpcPromise(_0x2dd68a,_0x5c9dfd,_0x30e8a6){return new BPromise(function(_0x4f7dd8,_0x343917){return client[_0xb0a7('0x10')](_0x2dd68a,_0x30e8a6)[_0xb0a7('0x11')](function(_0x16bdda){logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x5c9dfd,_0xb0a7('0x12'));logger[_0xb0a7('0x13')](_0xb0a7('0x14'),_0x5c9dfd,'request\x20sent',JSON[_0xb0a7('0x15')](_0x16bdda));if(_0x16bdda['error']){if(_0x16bdda[_0xb0a7('0x16')][_0xb0a7('0x17')]===0x1f4){logger[_0xb0a7('0x16')](_0xb0a7('0x18'),_0x5c9dfd,_0x16bdda[_0xb0a7('0x16')][_0xb0a7('0x19')]);return _0x343917(_0x16bdda[_0xb0a7('0x16')]['message']);}logger[_0xb0a7('0x16')](_0xb0a7('0x18'),_0x5c9dfd,_0x16bdda[_0xb0a7('0x16')][_0xb0a7('0x19')]);return _0x4f7dd8(_0x16bdda[_0xb0a7('0x16')]['message']);}else{logger[_0xb0a7('0x1a')](_0xb0a7('0x18'),_0x5c9dfd,_0xb0a7('0x12'));_0x4f7dd8(_0x16bdda[_0xb0a7('0x1b')][_0xb0a7('0x19')]);}})['catch'](function(_0x1fdf18){logger[_0xb0a7('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0x5c9dfd,_0x1fdf18);_0x343917(_0x1fdf18);});});}exports[_0xb0a7('0x1c')]=function(_0x25ca8a){var _0x593d42=this;return new Promise(function(_0x39e1ef,_0x555378){return db[_0xb0a7('0x1d')][_0xb0a7('0x1e')]({'raw':_0x25ca8a[_0xb0a7('0x1f')]?_0x25ca8a[_0xb0a7('0x1f')][_0xb0a7('0x20')]===undefined?!![]:![]:!![],'where':_0x25ca8a[_0xb0a7('0x1f')]?_0x25ca8a[_0xb0a7('0x1f')]['where']||null:null,'attributes':_0x25ca8a['options']?_0x25ca8a['options'][_0xb0a7('0x21')]||null:null,'limit':_0x25ca8a[_0xb0a7('0x1f')]?_0x25ca8a['options']['limit']||null:null,'include':_0x25ca8a[_0xb0a7('0x1f')]?_0x25ca8a['options'][_0xb0a7('0x22')]?_[_0xb0a7('0x23')](_0x25ca8a['options'][_0xb0a7('0x22')],function(_0x308d98){return{'model':db[_0x308d98[_0xb0a7('0x24')]],'as':_0x308d98['as'],'attributes':_0x308d98['attributes'],'include':_0x308d98[_0xb0a7('0x22')]?_[_0xb0a7('0x23')](_0x308d98[_0xb0a7('0x22')],function(_0x204a33){return{'model':db[_0x204a33['model']],'as':_0x204a33['as'],'attributes':_0x204a33[_0xb0a7('0x21')],'include':_0x204a33[_0xb0a7('0x22')]?_[_0xb0a7('0x23')](_0x204a33[_0xb0a7('0x22')],function(_0x1e45b2){return{'model':db[_0x1e45b2['model']],'as':_0x1e45b2['as'],'attributes':_0x1e45b2[_0xb0a7('0x21')]};}):[]};}):[]};}):[]:[]})[_0xb0a7('0x11')](function(_0x5a6eb4){logger[_0xb0a7('0x1a')](_0xb0a7('0x1c'),_0x25ca8a);logger[_0xb0a7('0x13')](_0xb0a7('0x1c'),_0x25ca8a,JSON[_0xb0a7('0x15')](_0x5a6eb4));_0x39e1ef(_0x5a6eb4);})[_0xb0a7('0x25')](function(_0x16ff05){logger[_0xb0a7('0x16')]('GetWhatsappQueue',_0x16ff05[_0xb0a7('0x19')],_0x25ca8a);_0x555378(_0x593d42[_0xb0a7('0x16')](0x1f4,_0x16ff05['message']));});});};exports['ShowWhatsappQueue']=function(_0x1d3a83){var _0x307424=this;return new Promise(function(_0x4bffb3,_0x1b7fab){return db[_0xb0a7('0x1d')][_0xb0a7('0x26')]({'raw':_0x1d3a83[_0xb0a7('0x1f')]?_0x1d3a83[_0xb0a7('0x1f')][_0xb0a7('0x20')]===undefined?!![]:![]:!![],'where':_0x1d3a83[_0xb0a7('0x1f')]?_0x1d3a83[_0xb0a7('0x1f')][_0xb0a7('0x27')]||null:null,'attributes':_0x1d3a83[_0xb0a7('0x1f')]?_0x1d3a83[_0xb0a7('0x1f')]['attributes']||null:null,'include':_0x1d3a83[_0xb0a7('0x1f')]?_0x1d3a83[_0xb0a7('0x1f')]['include']?_['map'](_0x1d3a83[_0xb0a7('0x1f')][_0xb0a7('0x22')],function(_0xcc4920){return{'model':db[_0xcc4920[_0xb0a7('0x24')]],'as':_0xcc4920['as'],'attributes':_0xcc4920[_0xb0a7('0x21')],'include':_0xcc4920[_0xb0a7('0x22')]?_[_0xb0a7('0x23')](_0xcc4920[_0xb0a7('0x22')],function(_0x1d100c){return{'model':db[_0x1d100c[_0xb0a7('0x24')]],'as':_0x1d100c['as'],'attributes':_0x1d100c[_0xb0a7('0x21')],'include':_0x1d100c[_0xb0a7('0x22')]?_[_0xb0a7('0x23')](_0x1d100c[_0xb0a7('0x22')],function(_0x2fe5a6){return{'model':db[_0x2fe5a6[_0xb0a7('0x24')]],'as':_0x2fe5a6['as'],'attributes':_0x2fe5a6['attributes']};}):[]};}):[]};}):[]:[]})[_0xb0a7('0x11')](function(_0x1da041){logger[_0xb0a7('0x1a')](_0xb0a7('0x28'),_0x1d3a83);logger[_0xb0a7('0x13')]('ShowWhatsappQueue',_0x1d3a83,JSON[_0xb0a7('0x15')](_0x1da041));_0x4bffb3(_0x1da041);})[_0xb0a7('0x25')](function(_0x182243){logger[_0xb0a7('0x16')](_0xb0a7('0x28'),_0x182243[_0xb0a7('0x19')],_0x1d3a83);_0x1b7fab(_0x307424[_0xb0a7('0x16')](0x1f4,_0x182243['message']));});});}; \ No newline at end of file +var _0x821e=['redis','localhost','socket.io-emitter','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','WhatsappQueue','options','where','limit','map','include','model','attributes','GetWhatsappQueue','ShowWhatsappQueue','find','raw','debug','stringify','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1a2455,_0xdaa32e){var _0xd2286c=function(_0x1427b2){while(--_0x1427b2){_0x1a2455['push'](_0x1a2455['shift']());}};_0xd2286c(++_0xdaa32e);}(_0x821e,0x100));var _0xe821=function(_0x1c0f41,_0x26d95d){_0x1c0f41=_0x1c0f41-0x0;var _0x369a9f=_0x821e[_0x1c0f41];return _0x369a9f;};'use strict';var _=require(_0xe821('0x0'));var util=require(_0xe821('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe821('0x2'));var fs=require('fs');var Redis=require(_0xe821('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe821('0x4'));var logger=require(_0xe821('0x5'))(_0xe821('0x6'));var config=require(_0xe821('0x7'));var jayson=require(_0xe821('0x8'));var client=jayson[_0xe821('0x9')]['http']({'port':0x232a});config[_0xe821('0xa')]=_['defaults'](config['redis'],{'host':_0xe821('0xb'),'port':0x18eb});var socket=require(_0xe821('0xc'))(new Redis(config[_0xe821('0xa')]));require('./whatsappQueue.socket')[_0xe821('0xd')](socket);function respondWithRpcPromise(_0x34924c,_0x55a216,_0x5ce207){return new BPromise(function(_0xa9d237,_0x367fb0){return client[_0xe821('0xe')](_0x34924c,_0x5ce207)[_0xe821('0xf')](function(_0x2ebfde){logger[_0xe821('0x10')](_0xe821('0x11'),_0x55a216,'request\x20sent');logger['debug']('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x55a216,'request\x20sent',JSON['stringify'](_0x2ebfde));if(_0x2ebfde[_0xe821('0x12')]){if(_0x2ebfde['error'][_0xe821('0x13')]===0x1f4){logger[_0xe821('0x12')](_0xe821('0x11'),_0x55a216,_0x2ebfde[_0xe821('0x12')][_0xe821('0x14')]);return _0x367fb0(_0x2ebfde[_0xe821('0x12')][_0xe821('0x14')]);}logger[_0xe821('0x12')](_0xe821('0x11'),_0x55a216,_0x2ebfde[_0xe821('0x12')][_0xe821('0x14')]);return _0xa9d237(_0x2ebfde[_0xe821('0x12')][_0xe821('0x14')]);}else{logger[_0xe821('0x10')]('WhatsappQueue,\x20%s,\x20%s',_0x55a216,_0xe821('0x15'));_0xa9d237(_0x2ebfde[_0xe821('0x16')][_0xe821('0x14')]);}})[_0xe821('0x17')](function(_0x82ec74){logger[_0xe821('0x12')](_0xe821('0x11'),_0x55a216,_0x82ec74);_0x367fb0(_0x82ec74);});});}exports['GetWhatsappQueue']=function(_0x385c22){var _0x4f108f=this;return new Promise(function(_0x26e130,_0x365c6b){return db[_0xe821('0x18')]['findAll']({'raw':_0x385c22[_0xe821('0x19')]?_0x385c22[_0xe821('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x385c22[_0xe821('0x19')]?_0x385c22[_0xe821('0x19')][_0xe821('0x1a')]||null:null,'attributes':_0x385c22[_0xe821('0x19')]?_0x385c22['options']['attributes']||null:null,'limit':_0x385c22[_0xe821('0x19')]?_0x385c22['options'][_0xe821('0x1b')]||null:null,'include':_0x385c22['options']?_0x385c22[_0xe821('0x19')]['include']?_[_0xe821('0x1c')](_0x385c22[_0xe821('0x19')][_0xe821('0x1d')],function(_0x19faf0){return{'model':db[_0x19faf0[_0xe821('0x1e')]],'as':_0x19faf0['as'],'attributes':_0x19faf0[_0xe821('0x1f')],'include':_0x19faf0[_0xe821('0x1d')]?_[_0xe821('0x1c')](_0x19faf0[_0xe821('0x1d')],function(_0x46efe5){return{'model':db[_0x46efe5['model']],'as':_0x46efe5['as'],'attributes':_0x46efe5[_0xe821('0x1f')],'include':_0x46efe5['include']?_[_0xe821('0x1c')](_0x46efe5[_0xe821('0x1d')],function(_0x33dcdf){return{'model':db[_0x33dcdf['model']],'as':_0x33dcdf['as'],'attributes':_0x33dcdf['attributes']};}):[]};}):[]};}):[]:[]})[_0xe821('0xf')](function(_0x30b1ab){logger[_0xe821('0x10')](_0xe821('0x20'),_0x385c22);logger['debug'](_0xe821('0x20'),_0x385c22,JSON['stringify'](_0x30b1ab));_0x26e130(_0x30b1ab);})['catch'](function(_0x5f0550){logger[_0xe821('0x12')](_0xe821('0x20'),_0x5f0550[_0xe821('0x14')],_0x385c22);_0x365c6b(_0x4f108f['error'](0x1f4,_0x5f0550[_0xe821('0x14')]));});});};exports[_0xe821('0x21')]=function(_0xd1d23d){var _0x2022f1=this;return new Promise(function(_0x142368,_0x21776d){return db[_0xe821('0x18')][_0xe821('0x22')]({'raw':_0xd1d23d[_0xe821('0x19')]?_0xd1d23d[_0xe821('0x19')][_0xe821('0x23')]===undefined?!![]:![]:!![],'where':_0xd1d23d['options']?_0xd1d23d[_0xe821('0x19')][_0xe821('0x1a')]||null:null,'attributes':_0xd1d23d[_0xe821('0x19')]?_0xd1d23d['options'][_0xe821('0x1f')]||null:null,'include':_0xd1d23d[_0xe821('0x19')]?_0xd1d23d[_0xe821('0x19')]['include']?_[_0xe821('0x1c')](_0xd1d23d[_0xe821('0x19')][_0xe821('0x1d')],function(_0x212d14){return{'model':db[_0x212d14['model']],'as':_0x212d14['as'],'attributes':_0x212d14[_0xe821('0x1f')],'include':_0x212d14[_0xe821('0x1d')]?_[_0xe821('0x1c')](_0x212d14[_0xe821('0x1d')],function(_0x97ea3a){return{'model':db[_0x97ea3a['model']],'as':_0x97ea3a['as'],'attributes':_0x97ea3a['attributes'],'include':_0x97ea3a[_0xe821('0x1d')]?_[_0xe821('0x1c')](_0x97ea3a[_0xe821('0x1d')],function(_0x2e4b92){return{'model':db[_0x2e4b92[_0xe821('0x1e')]],'as':_0x2e4b92['as'],'attributes':_0x2e4b92[_0xe821('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x56e521){logger[_0xe821('0x10')](_0xe821('0x21'),_0xd1d23d);logger[_0xe821('0x24')]('ShowWhatsappQueue',_0xd1d23d,JSON[_0xe821('0x25')](_0x56e521));_0x142368(_0x56e521);})[_0xe821('0x17')](function(_0x35b36f){logger['error']('ShowWhatsappQueue',_0x35b36f[_0xe821('0x14')],_0xd1d23d);_0x21776d(_0x2022f1['error'](0x1f4,_0x35b36f['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 59c9906..33ea55a 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 _0x1874=['save','remove','update','emit','removeListener','register','whatsappQueue:','./whatsappQueue.events'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x1874,0x8f));var _0x4187=function(_0x3666ef,_0x373d7b){_0x3666ef=_0x3666ef-0x0;var _0x4f4289=_0x1874[_0x3666ef];return _0x4f4289;};'use strict';var WhatsappQueueEvents=require(_0x4187('0x0'));var events=[_0x4187('0x1'),_0x4187('0x2'),_0x4187('0x3')];function createListener(_0x3d222a,_0x28801){return function(_0x4071ec){_0x28801[_0x4187('0x4')](_0x3d222a,_0x4071ec);};}function removeListener(_0x3bce11,_0x306296){return function(){WhatsappQueueEvents[_0x4187('0x5')](_0x3bce11,_0x306296);};}exports[_0x4187('0x6')]=function(_0x1467ce){for(var _0x35fbd3=0x0,_0x2815af=events['length'];_0x35fbd3<_0x2815af;_0x35fbd3++){var _0x2cf2a6=events[_0x35fbd3];var _0xac9934=createListener(_0x4187('0x7')+_0x2cf2a6,_0x1467ce);WhatsappQueueEvents['on'](_0x2cf2a6,_0xac9934);}}; \ No newline at end of file +var _0xe911=['remove','removeListener','register','length','whatsappQueue:','./whatsappQueue.events','save'];(function(_0x40fcb3,_0x135010){var _0x251fe8=function(_0x261d3b){while(--_0x261d3b){_0x40fcb3['push'](_0x40fcb3['shift']());}};_0x251fe8(++_0x135010);}(_0xe911,0x18d));var _0x1e91=function(_0x3e7052,_0x3a1c65){_0x3e7052=_0x3e7052-0x0;var _0x566f5f=_0xe911[_0x3e7052];return _0x566f5f;};'use strict';var WhatsappQueueEvents=require(_0x1e91('0x0'));var events=[_0x1e91('0x1'),_0x1e91('0x2'),'update'];function createListener(_0x466479,_0xdb6ada){return function(_0x49548a){_0xdb6ada['emit'](_0x466479,_0x49548a);};}function removeListener(_0x3c2682,_0x3441b7){return function(){WhatsappQueueEvents[_0x1e91('0x3')](_0x3c2682,_0x3441b7);};}exports[_0x1e91('0x4')]=function(_0x491adc){for(var _0x43e7a0=0x0,_0x48c78b=events[_0x1e91('0x5')];_0x43e7a0<_0x48c78b;_0x43e7a0++){var _0x388fe5=events[_0x43e7a0];var _0x17ab2f=createListener(_0x1e91('0x6')+_0x388fe5,_0x491adc);WhatsappQueueEvents['on'](_0x388fe5,_0x17ab2f);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 7fa402a..d7dfbb2 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 _0x51f3=['../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id','show','create','multer','util','express','Router','fs-extra','../../components/auth/service'];(function(_0x50d698,_0x50f292){var _0x3279d0=function(_0x3a0b16){while(--_0x3a0b16){_0x50d698['push'](_0x50d698['shift']());}};_0x3279d0(++_0x50f292);}(_0x51f3,0x9f));var _0x351f=function(_0x269ef5,_0x3c17a3){_0x269ef5=_0x269ef5-0x0;var _0x590ccc=_0x51f3[_0x269ef5];return _0x590ccc;};'use strict';var multer=require(_0x351f('0x0'));var util=require(_0x351f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x351f('0x2'));var router=express[_0x351f('0x3')]();var fs_extra=require(_0x351f('0x4'));var auth=require(_0x351f('0x5'));var interaction=require(_0x351f('0x6'));var config=require(_0x351f('0x7'));var controller=require('./whatsappQueueReport.controller');router[_0x351f('0x8')]('/',auth['isAuthenticated'](),controller[_0x351f('0x9')]);router[_0x351f('0x8')]('/describe',auth[_0x351f('0xa')](),controller[_0x351f('0xb')]);router[_0x351f('0x8')](_0x351f('0xc'),auth['isAuthenticated'](),controller[_0x351f('0xd')]);router['post']('/',auth[_0x351f('0xa')](),controller[_0x351f('0xe')]);router['put'](_0x351f('0xc'),auth[_0x351f('0xa')](),controller['update']);router['delete'](_0x351f('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x62b0=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer'];(function(_0x53accd,_0x636b7c){var _0x448716=function(_0x460ecb){while(--_0x460ecb){_0x53accd['push'](_0x53accd['shift']());}};_0x448716(++_0x636b7c);}(_0x62b0,0x1e2));var _0x062b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x62b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x062b('0x0'));var util=require(_0x062b('0x1'));var path=require(_0x062b('0x2'));var timeout=require(_0x062b('0x3'));var express=require(_0x062b('0x4'));var router=express[_0x062b('0x5')]();var fs_extra=require(_0x062b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x062b('0x7'));var config=require(_0x062b('0x8'));var controller=require(_0x062b('0x9'));router[_0x062b('0xa')]('/',auth[_0x062b('0xb')](),controller[_0x062b('0xc')]);router[_0x062b('0xa')](_0x062b('0xd'),auth[_0x062b('0xb')](),controller[_0x062b('0xe')]);router['get'](_0x062b('0xf'),auth['isAuthenticated'](),controller[_0x062b('0x10')]);router[_0x062b('0x11')]('/',auth[_0x062b('0xb')](),controller[_0x062b('0x12')]);router[_0x062b('0x13')](_0x062b('0xf'),auth[_0x062b('0xb')](),controller[_0x062b('0x14')]);router['delete'](_0x062b('0xf'),auth[_0x062b('0xb')](),controller[_0x062b('0x15')]);module[_0x062b('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 5544511..b2188f2 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x249227,_0x4cb466){var _0x504046=function(_0x5e0daf){while(--_0x5e0daf){_0x249227['push'](_0x249227['shift']());}};_0x504046(++_0x4cb466);}(_0x7a54,0x106));var _0x47a5=function(_0x4bf6b7,_0x9307ec){_0x4bf6b7=_0x4bf6b7-0x0;var _0x63c961=_0x7a54[_0x4bf6b7];return _0x63c961;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x28fd76,_0x37608c){var _0x434cdc=function(_0x5b87b2){while(--_0x5b87b2){_0x28fd76['push'](_0x28fd76['shift']());}};_0x434cdc(++_0x37608c);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 b4a151c..fcd8c99 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 _0x1339=['../../config/license/util','status','json','undefined','limit','offset','Content-Range','then','destroy','end','sendStatus','error','name','send','index','map','WhatsappQueueReport','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','create','body','update','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0xf801da,_0x362fea){var _0x359bed=function(_0x9bbfac){while(--_0x9bbfac){_0xf801da['push'](_0xf801da['shift']());}};_0x359bed(++_0x362fea);}(_0x1339,0x1ed));var _0x9133=function(_0x41c4b3,_0x1e67c7){_0x41c4b3=_0x41c4b3-0x0;var _0x32e75e=_0x1339[_0x41c4b3];return _0x32e75e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9133('0x0'));var jsonpatch=require(_0x9133('0x1'));var rp=require(_0x9133('0x2'));var moment=require(_0x9133('0x3'));var BPromise=require(_0x9133('0x4'));var Mustache=require(_0x9133('0x5'));var util=require(_0x9133('0x6'));var path=require(_0x9133('0x7'));var sox=require('sox');var csv=require(_0x9133('0x8'));var ejs=require(_0x9133('0x9'));var fs=require('fs');var fs_extra=require(_0x9133('0xa'));var _=require('lodash');var squel=require(_0x9133('0xb'));var crypto=require(_0x9133('0xc'));var jsforce=require(_0x9133('0xd'));var deskjs=require(_0x9133('0xe'));var toCsv=require(_0x9133('0x8'));var querystring=require(_0x9133('0xf'));var Papa=require(_0x9133('0x10'));var Redis=require(_0x9133('0x11'));var authService=require(_0x9133('0x12'));var qs=require(_0x9133('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9133('0x14'));var logger=require(_0x9133('0x15'))(_0x9133('0x16'));var utils=require(_0x9133('0x17'));var config=require(_0x9133('0x18'));var licenseUtil=require(_0x9133('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb64550,_0x7cc59e){_0x7cc59e=_0x7cc59e||0xcc;return function(_0x4bbfdc){if(_0x4bbfdc){return _0xb64550['sendStatus'](_0x7cc59e);}return _0xb64550[_0x9133('0x1a')](_0x7cc59e)['end']();};}function respondWithResult(_0x22132a,_0x439e1a){_0x439e1a=_0x439e1a||0xc8;return function(_0x17dfd1){if(_0x17dfd1){return _0x22132a[_0x9133('0x1a')](_0x439e1a)[_0x9133('0x1b')](_0x17dfd1);}};}function respondWithFilteredResult(_0x4327b3,_0x49cc5d){return function(_0x13f8fc){if(_0x13f8fc){var _0x1e23ce=typeof _0x49cc5d['offset']===_0x9133('0x1c')&&typeof _0x49cc5d[_0x9133('0x1d')]===_0x9133('0x1c');var _0x427663=_0x13f8fc['count'];var _0x1f3484=_0x1e23ce?0x0:_0x49cc5d['offset'];var _0x3c48ef=_0x1e23ce?_0x13f8fc['count']:_0x49cc5d[_0x9133('0x1e')]+_0x49cc5d[_0x9133('0x1d')];var _0x5e8620;if(_0x3c48ef>=_0x427663){_0x3c48ef=_0x427663;_0x5e8620=0xc8;}else{_0x5e8620=0xce;}_0x4327b3[_0x9133('0x1a')](_0x5e8620);return _0x4327b3['set'](_0x9133('0x1f'),_0x1f3484+'-'+_0x3c48ef+'/'+_0x427663)['json'](_0x13f8fc);}return null;};}function patchUpdates(_0x5e4f0c){return function(_0x2f7354){try{jsonpatch['apply'](_0x2f7354,_0x5e4f0c,!![]);}catch(_0x12c2d4){return BPromise['reject'](_0x12c2d4);}return _0x2f7354['save']();};}function saveUpdates(_0x4c846e,_0x2e99a1){return function(_0x2dcfb8){if(_0x2dcfb8){return _0x2dcfb8['update'](_0x4c846e)[_0x9133('0x20')](function(_0x3f5d0e){return _0x3f5d0e;});}return null;};}function removeEntity(_0xff08d5,_0x26190c){return function(_0x4f26e8){if(_0x4f26e8){return _0x4f26e8[_0x9133('0x21')]()['then'](function(){_0xff08d5[_0x9133('0x1a')](0xcc)[_0x9133('0x22')]();});}};}function handleEntityNotFound(_0x3f278d,_0x14c1cb){return function(_0x4483ef){if(!_0x4483ef){_0x3f278d[_0x9133('0x23')](0x194);}return _0x4483ef;};}function handleError(_0x294332,_0x313d43){_0x313d43=_0x313d43||0x1f4;return function(_0x1b6b3e){logger[_0x9133('0x24')](_0x1b6b3e['stack']);if(_0x1b6b3e['name']){delete _0x1b6b3e[_0x9133('0x25')];}_0x294332[_0x9133('0x1a')](_0x313d43)[_0x9133('0x26')](_0x1b6b3e);};}exports[_0x9133('0x27')]=function(_0x4de894,_0x4ecd9e){var _0x3e2404={},_0x45966d={},_0x188c49={'count':0x0,'rows':[]};var _0x26d351=_[_0x9133('0x28')](db[_0x9133('0x29')]['rawAttributes'],function(_0x58afe0){return{'name':_0x58afe0['fieldName'],'type':_0x58afe0[_0x9133('0x2a')]['key']};});_0x45966d[_0x9133('0x2b')]=_[_0x9133('0x28')](_0x26d351,'name');_0x45966d[_0x9133('0x2c')]=_['keys'](_0x4de894[_0x9133('0x2c')]);_0x45966d[_0x9133('0x2d')]=_[_0x9133('0x2e')](_0x45966d['model'],_0x45966d[_0x9133('0x2c')]);_0x3e2404[_0x9133('0x2f')]=_[_0x9133('0x2e')](_0x45966d['model'],qs[_0x9133('0x30')](_0x4de894[_0x9133('0x2c')][_0x9133('0x30')]));_0x3e2404['attributes']=_0x3e2404[_0x9133('0x2f')][_0x9133('0x31')]?_0x3e2404[_0x9133('0x2f')]:_0x45966d[_0x9133('0x2b')];if(!_0x4de894['query'][_0x9133('0x32')](_0x9133('0x33'))){_0x3e2404['limit']=qs[_0x9133('0x1d')](_0x4de894[_0x9133('0x2c')][_0x9133('0x1d')]);_0x3e2404[_0x9133('0x1e')]=qs[_0x9133('0x1e')](_0x4de894[_0x9133('0x2c')][_0x9133('0x1e')]);}_0x3e2404[_0x9133('0x34')]=qs[_0x9133('0x35')](_0x4de894[_0x9133('0x2c')][_0x9133('0x35')]);_0x3e2404['where']=qs[_0x9133('0x2d')](_[_0x9133('0x36')](_0x4de894['query'],_0x45966d[_0x9133('0x2d')]),_0x26d351);if(_0x4de894[_0x9133('0x2c')][_0x9133('0x37')]){_0x3e2404[_0x9133('0x38')]=_[_0x9133('0x39')](_0x3e2404[_0x9133('0x38')],{'$or':_['map'](_0x26d351,function(_0x4e16d2){if(_0x4e16d2[_0x9133('0x2a')]!==_0x9133('0x3a')){var _0x156905={};_0x156905[_0x4e16d2[_0x9133('0x25')]]={'$like':'%'+_0x4de894[_0x9133('0x2c')][_0x9133('0x37')]+'%'};return _0x156905;}})});}_0x3e2404=_[_0x9133('0x39')]({},_0x3e2404,_0x4de894[_0x9133('0x3b')]);var _0x720048={'where':_0x3e2404['where']};return db[_0x9133('0x29')][_0x9133('0x3c')](_0x720048)[_0x9133('0x20')](function(_0x199ae9){_0x188c49[_0x9133('0x3c')]=_0x199ae9;if(_0x4de894['query'][_0x9133('0x3d')]){_0x3e2404[_0x9133('0x3e')]=[{'all':!![]}];}return db[_0x9133('0x29')][_0x9133('0x3f')](_0x3e2404);})['then'](function(_0x146734){_0x188c49[_0x9133('0x40')]=_0x146734;return _0x188c49;})[_0x9133('0x20')](respondWithFilteredResult(_0x4ecd9e,_0x3e2404))[_0x9133('0x41')](handleError(_0x4ecd9e,null));};exports[_0x9133('0x42')]=function(_0x338049,_0x3b2287){var _0x4ca1a3={'raw':!![],'where':{'id':_0x338049['params']['id']}},_0x7f6cd9={};_0x7f6cd9['model']=_[_0x9133('0x43')](db[_0x9133('0x29')][_0x9133('0x44')]);_0x7f6cd9[_0x9133('0x2c')]=_[_0x9133('0x43')](_0x338049[_0x9133('0x2c')]);_0x7f6cd9[_0x9133('0x2d')]=_[_0x9133('0x2e')](_0x7f6cd9[_0x9133('0x2b')],_0x7f6cd9['query']);_0x4ca1a3[_0x9133('0x2f')]=_[_0x9133('0x2e')](_0x7f6cd9[_0x9133('0x2b')],qs['fields'](_0x338049['query'][_0x9133('0x30')]));_0x4ca1a3[_0x9133('0x2f')]=_0x4ca1a3['attributes'][_0x9133('0x31')]?_0x4ca1a3[_0x9133('0x2f')]:_0x7f6cd9[_0x9133('0x2b')];if(_0x338049[_0x9133('0x2c')][_0x9133('0x3d')]){_0x4ca1a3['include']=[{'all':!![]}];}_0x4ca1a3=_[_0x9133('0x39')]({},_0x4ca1a3,_0x338049[_0x9133('0x3b')]);return db[_0x9133('0x29')]['find'](_0x4ca1a3)[_0x9133('0x20')](handleEntityNotFound(_0x3b2287,null))[_0x9133('0x20')](respondWithResult(_0x3b2287,null))['catch'](handleError(_0x3b2287,null));};exports['create']=function(_0x42c188,_0x2cd935){return db[_0x9133('0x29')][_0x9133('0x45')](_0x42c188[_0x9133('0x46')],{})[_0x9133('0x20')](respondWithResult(_0x2cd935,0xc9))[_0x9133('0x41')](handleError(_0x2cd935,null));};exports[_0x9133('0x47')]=function(_0x23f134,_0xf07fbb){if(_0x23f134[_0x9133('0x46')]['id']){delete _0x23f134[_0x9133('0x46')]['id'];}return db['WhatsappQueueReport']['find']({'where':{'id':_0x23f134[_0x9133('0x48')]['id']}})['then'](handleEntityNotFound(_0xf07fbb,null))[_0x9133('0x20')](saveUpdates(_0x23f134[_0x9133('0x46')],null))[_0x9133('0x20')](respondWithResult(_0xf07fbb,null))[_0x9133('0x41')](handleError(_0xf07fbb,null));};exports['destroy']=function(_0x2a3848,_0x25750f){return db[_0x9133('0x29')]['find']({'where':{'id':_0x2a3848[_0x9133('0x48')]['id']}})[_0x9133('0x20')](handleEntityNotFound(_0x25750f,null))[_0x9133('0x20')](removeEntity(_0x25750f,null))['catch'](handleError(_0x25750f,null));};exports[_0x9133('0x49')]=function(_0x4f7b1e,_0x2342f4){return db[_0x9133('0x29')][_0x9133('0x49')]()[_0x9133('0x20')](respondWithResult(_0x2342f4,null))['catch'](handleError(_0x2342f4,null));}; \ No newline at end of file +var _0xea28=['end','stack','name','map','WhatsappQueueReport','rawAttributes','fieldName','type','query','intersection','model','attributes','length','hasOwnProperty','nolimit','order','where','filters','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','fields','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then'];(function(_0x40197b,_0x4e763f){var _0x3b9c2f=function(_0x41c34f){while(--_0x41c34f){_0x40197b['push'](_0x40197b['shift']());}};_0x3b9c2f(++_0x4e763f);}(_0xea28,0x13a));var _0x8ea2=function(_0x13e774,_0x488ee1){_0x13e774=_0x13e774-0x0;var _0x1a87f5=_0xea28[_0x13e774];return _0x1a87f5;};'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'];function respondWithStatusCode(_0x1dfb6e,_0x10aead){_0x10aead=_0x10aead||0xcc;return function(_0xe47c0e){if(_0xe47c0e){return _0x1dfb6e['sendStatus'](_0x10aead);}return _0x1dfb6e[_0x8ea2('0x1b')](_0x10aead)['end']();};}function respondWithResult(_0x4b2192,_0x772bad){_0x772bad=_0x772bad||0xc8;return function(_0x4726a7){if(_0x4726a7){return _0x4b2192[_0x8ea2('0x1b')](_0x772bad)[_0x8ea2('0x1c')](_0x4726a7);}};}function respondWithFilteredResult(_0x393faf,_0xbb9bd1){return function(_0x3cff96){if(_0x3cff96){var _0x11f5e8=typeof _0xbb9bd1[_0x8ea2('0x1d')]===_0x8ea2('0x1e')&&typeof _0xbb9bd1[_0x8ea2('0x1f')]===_0x8ea2('0x1e');var _0x3bc774=_0x3cff96[_0x8ea2('0x20')];var _0x1b64cf=_0x11f5e8?0x0:_0xbb9bd1[_0x8ea2('0x1d')];var _0x467045=_0x11f5e8?_0x3cff96[_0x8ea2('0x20')]:_0xbb9bd1[_0x8ea2('0x1d')]+_0xbb9bd1[_0x8ea2('0x1f')];var _0x134cbe;if(_0x467045>=_0x3bc774){_0x467045=_0x3bc774;_0x134cbe=0xc8;}else{_0x134cbe=0xce;}_0x393faf[_0x8ea2('0x1b')](_0x134cbe);return _0x393faf['set']('Content-Range',_0x1b64cf+'-'+_0x467045+'/'+_0x3bc774)[_0x8ea2('0x1c')](_0x3cff96);}return null;};}function patchUpdates(_0x248c18){return function(_0x29151a){try{jsonpatch['apply'](_0x29151a,_0x248c18,!![]);}catch(_0x46f4fe){return BPromise[_0x8ea2('0x21')](_0x46f4fe);}return _0x29151a['save']();};}function saveUpdates(_0x3d593b,_0x283f00){return function(_0x37229a){if(_0x37229a){return _0x37229a[_0x8ea2('0x22')](_0x3d593b)[_0x8ea2('0x23')](function(_0xe5c943){return _0xe5c943;});}return null;};}function removeEntity(_0x199417,_0x1e4cc9){return function(_0x18ec34){if(_0x18ec34){return _0x18ec34['destroy']()[_0x8ea2('0x23')](function(){_0x199417['status'](0xcc)[_0x8ea2('0x24')]();});}};}function handleEntityNotFound(_0x42bec8,_0x29b38f){return function(_0x4e2106){if(!_0x4e2106){_0x42bec8['sendStatus'](0x194);}return _0x4e2106;};}function handleError(_0x2e4da3,_0x4dc7bf){_0x4dc7bf=_0x4dc7bf||0x1f4;return function(_0x200a49){logger['error'](_0x200a49[_0x8ea2('0x25')]);if(_0x200a49[_0x8ea2('0x26')]){delete _0x200a49[_0x8ea2('0x26')];}_0x2e4da3[_0x8ea2('0x1b')](_0x4dc7bf)['send'](_0x200a49);};}exports['index']=function(_0xacaa6c,_0x4da5b3){var _0x4a9875={},_0x287078={},_0x24f187={'count':0x0,'rows':[]};var _0x41f482=_[_0x8ea2('0x27')](db[_0x8ea2('0x28')][_0x8ea2('0x29')],function(_0x316707){return{'name':_0x316707[_0x8ea2('0x2a')],'type':_0x316707[_0x8ea2('0x2b')]['key']};});_0x287078['model']=_[_0x8ea2('0x27')](_0x41f482,_0x8ea2('0x26'));_0x287078['query']=_['keys'](_0xacaa6c[_0x8ea2('0x2c')]);_0x287078['filters']=_[_0x8ea2('0x2d')](_0x287078[_0x8ea2('0x2e')],_0x287078['query']);_0x4a9875[_0x8ea2('0x2f')]=_[_0x8ea2('0x2d')](_0x287078[_0x8ea2('0x2e')],qs['fields'](_0xacaa6c['query']['fields']));_0x4a9875[_0x8ea2('0x2f')]=_0x4a9875[_0x8ea2('0x2f')][_0x8ea2('0x30')]?_0x4a9875['attributes']:_0x287078[_0x8ea2('0x2e')];if(!_0xacaa6c[_0x8ea2('0x2c')][_0x8ea2('0x31')](_0x8ea2('0x32'))){_0x4a9875[_0x8ea2('0x1f')]=qs[_0x8ea2('0x1f')](_0xacaa6c[_0x8ea2('0x2c')][_0x8ea2('0x1f')]);_0x4a9875['offset']=qs[_0x8ea2('0x1d')](_0xacaa6c[_0x8ea2('0x2c')][_0x8ea2('0x1d')]);}_0x4a9875[_0x8ea2('0x33')]=qs['sort'](_0xacaa6c[_0x8ea2('0x2c')]['sort']);_0x4a9875[_0x8ea2('0x34')]=qs[_0x8ea2('0x35')](_[_0x8ea2('0x36')](_0xacaa6c[_0x8ea2('0x2c')],_0x287078['filters']),_0x41f482);if(_0xacaa6c[_0x8ea2('0x2c')]['filter']){_0x4a9875['where']=_[_0x8ea2('0x37')](_0x4a9875['where'],{'$or':_[_0x8ea2('0x27')](_0x41f482,function(_0x2f0779){if(_0x2f0779[_0x8ea2('0x2b')]!==_0x8ea2('0x38')){var _0x134584={};_0x134584[_0x2f0779['name']]={'$like':'%'+_0xacaa6c[_0x8ea2('0x2c')]['filter']+'%'};return _0x134584;}})});}_0x4a9875=_[_0x8ea2('0x37')]({},_0x4a9875,_0xacaa6c[_0x8ea2('0x39')]);var _0x6d0e0c={'where':_0x4a9875[_0x8ea2('0x34')]};return db['WhatsappQueueReport'][_0x8ea2('0x20')](_0x6d0e0c)['then'](function(_0x3f0c78){_0x24f187['count']=_0x3f0c78;if(_0xacaa6c[_0x8ea2('0x2c')][_0x8ea2('0x3a')]){_0x4a9875[_0x8ea2('0x3b')]=[{'all':!![]}];}return db[_0x8ea2('0x28')][_0x8ea2('0x3c')](_0x4a9875);})[_0x8ea2('0x23')](function(_0x2f4fa8){_0x24f187['rows']=_0x2f4fa8;return _0x24f187;})['then'](respondWithFilteredResult(_0x4da5b3,_0x4a9875))[_0x8ea2('0x3d')](handleError(_0x4da5b3,null));};exports['show']=function(_0x4b03fa,_0x59e2fa){var _0x3cbc09={'raw':!![],'where':{'id':_0x4b03fa[_0x8ea2('0x3e')]['id']}},_0x5d9ba0={};_0x5d9ba0[_0x8ea2('0x2e')]=_[_0x8ea2('0x3f')](db[_0x8ea2('0x28')][_0x8ea2('0x29')]);_0x5d9ba0[_0x8ea2('0x2c')]=_[_0x8ea2('0x3f')](_0x4b03fa[_0x8ea2('0x2c')]);_0x5d9ba0['filters']=_[_0x8ea2('0x2d')](_0x5d9ba0[_0x8ea2('0x2e')],_0x5d9ba0[_0x8ea2('0x2c')]);_0x3cbc09['attributes']=_[_0x8ea2('0x2d')](_0x5d9ba0[_0x8ea2('0x2e')],qs[_0x8ea2('0x40')](_0x4b03fa[_0x8ea2('0x2c')][_0x8ea2('0x40')]));_0x3cbc09['attributes']=_0x3cbc09[_0x8ea2('0x2f')][_0x8ea2('0x30')]?_0x3cbc09[_0x8ea2('0x2f')]:_0x5d9ba0['model'];if(_0x4b03fa[_0x8ea2('0x2c')][_0x8ea2('0x3a')]){_0x3cbc09[_0x8ea2('0x3b')]=[{'all':!![]}];}_0x3cbc09=_[_0x8ea2('0x37')]({},_0x3cbc09,_0x4b03fa[_0x8ea2('0x39')]);return db[_0x8ea2('0x28')][_0x8ea2('0x41')](_0x3cbc09)[_0x8ea2('0x23')](handleEntityNotFound(_0x59e2fa,null))[_0x8ea2('0x23')](respondWithResult(_0x59e2fa,null))[_0x8ea2('0x3d')](handleError(_0x59e2fa,null));};exports[_0x8ea2('0x42')]=function(_0x52d203,_0x220970){return db[_0x8ea2('0x28')]['create'](_0x52d203[_0x8ea2('0x43')],{})[_0x8ea2('0x23')](respondWithResult(_0x220970,0xc9))[_0x8ea2('0x3d')](handleError(_0x220970,null));};exports[_0x8ea2('0x22')]=function(_0x182a46,_0x1daa25){if(_0x182a46[_0x8ea2('0x43')]['id']){delete _0x182a46[_0x8ea2('0x43')]['id'];}return db['WhatsappQueueReport'][_0x8ea2('0x41')]({'where':{'id':_0x182a46[_0x8ea2('0x3e')]['id']}})[_0x8ea2('0x23')](handleEntityNotFound(_0x1daa25,null))['then'](saveUpdates(_0x182a46['body'],null))[_0x8ea2('0x23')](respondWithResult(_0x1daa25,null))[_0x8ea2('0x3d')](handleError(_0x1daa25,null));};exports[_0x8ea2('0x44')]=function(_0x5e5c37,_0x3d86f3){return db[_0x8ea2('0x28')][_0x8ea2('0x41')]({'where':{'id':_0x5e5c37[_0x8ea2('0x3e')]['id']}})[_0x8ea2('0x23')](handleEntityNotFound(_0x3d86f3,null))['then'](removeEntity(_0x3d86f3,null))['catch'](handleError(_0x3d86f3,null));};exports[_0x8ea2('0x45')]=function(_0x4148c1,_0x1b8c4b){return db['WhatsappQueueReport'][_0x8ea2('0x45')]()[_0x8ea2('0x23')](respondWithResult(_0x1b8c4b,null))[_0x8ea2('0x3d')](handleError(_0x1b8c4b,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 6464440..acf725d 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 _0x044c=['define','uniqueid','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./whatsappQueueReport.attributes'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x044c,0x142));var _0xc044=function(_0x4a4d83,_0x33fafb){_0x4a4d83=_0x4a4d83-0x0;var _0x262b54=_0x044c[_0x4a4d83];return _0x262b54;};'use strict';var _=require(_0xc044('0x0'));var util=require('util');var logger=require(_0xc044('0x1'))(_0xc044('0x2'));var moment=require(_0xc044('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc044('0x4'));var rimraf=require(_0xc044('0x5'));var config=require(_0xc044('0x6'));var attributes=require(_0xc044('0x7'));module['exports']=function(_0x12261a,_0x21196e){return _0x12261a[_0xc044('0x8')]('WhatsappQueueReport',attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0xc044('0x9'),'fields':[_0xc044('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x35aa=['lodash','util','../../config/logger','moment','bluebird','path','./whatsappQueueReport.attributes','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid'];(function(_0xd7d0d0,_0xf533cf){var _0x3c6e6d=function(_0x33d253){while(--_0x33d253){_0xd7d0d0['push'](_0xd7d0d0['shift']());}};_0x3c6e6d(++_0xf533cf);}(_0x35aa,0xa5));var _0xa35a=function(_0x508823,_0x316707){_0x508823=_0x508823-0x0;var _0x13523b=_0x35aa[_0x508823];return _0x13523b;};'use strict';var _=require(_0xa35a('0x0'));var util=require(_0xa35a('0x1'));var logger=require(_0xa35a('0x2'))('api');var moment=require(_0xa35a('0x3'));var BPromise=require(_0xa35a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa35a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa35a('0x6'));module['exports']=function(_0x468857,_0x513dbe){return _0x468857[_0xa35a('0x7')](_0xa35a('0x8'),attributes,{'tableName':_0xa35a('0x9'),'paranoid':![],'indexes':[{'name':_0xa35a('0xa'),'fields':[_0xa35a('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 72d541a..4637d7b 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 _0x415d=['../../config/environment','jayson/promise','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateWhatsappQueueReport','create','body','options','raw','update','where','attributes','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x177435,_0x47939f){var _0x229744=function(_0x3e8051){while(--_0x3e8051){_0x177435['push'](_0x177435['shift']());}};_0x229744(++_0x47939f);}(_0x415d,0x1e6));var _0xd415=function(_0x3f9cce,_0x424731){_0x3f9cce=_0x3f9cce-0x0;var _0x485d40=_0x415d[_0x3f9cce];return _0x485d40;};'use strict';var _=require(_0xd415('0x0'));var util=require(_0xd415('0x1'));var moment=require(_0xd415('0x2'));var BPromise=require(_0xd415('0x3'));var rs=require(_0xd415('0x4'));var fs=require('fs');var Redis=require(_0xd415('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd415('0x6'));var logger=require(_0xd415('0x7'))(_0xd415('0x8'));var config=require(_0xd415('0x9'));var jayson=require(_0xd415('0xa'));var client=jayson[_0xd415('0xb')][_0xd415('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2dfd9b,_0x66e567,_0x46463e){return new BPromise(function(_0x30cc7b,_0x341b90){return client[_0xd415('0xd')](_0x2dfd9b,_0x46463e)[_0xd415('0xe')](function(_0x4d36ea){logger[_0xd415('0xf')](_0xd415('0x10'),_0x66e567,_0xd415('0x11'));logger[_0xd415('0x12')](_0xd415('0x13'),_0x66e567,_0xd415('0x11'),JSON[_0xd415('0x14')](_0x4d36ea));if(_0x4d36ea['error']){if(_0x4d36ea[_0xd415('0x15')][_0xd415('0x16')]===0x1f4){logger[_0xd415('0x15')](_0xd415('0x10'),_0x66e567,_0x4d36ea['error'][_0xd415('0x17')]);return _0x341b90(_0x4d36ea[_0xd415('0x15')]['message']);}logger[_0xd415('0x15')](_0xd415('0x10'),_0x66e567,_0x4d36ea[_0xd415('0x15')][_0xd415('0x17')]);return _0x30cc7b(_0x4d36ea[_0xd415('0x15')]['message']);}else{logger['info'](_0xd415('0x10'),_0x66e567,_0xd415('0x11'));_0x30cc7b(_0x4d36ea['result'][_0xd415('0x17')]);}})['catch'](function(_0x4e1e96){logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x66e567,_0x4e1e96);_0x341b90(_0x4e1e96);});});}exports[_0xd415('0x18')]=function(_0x463699){var _0x1fed7e=this;return new Promise(function(_0xfc461e,_0x4014d6){return db['WhatsappQueueReport'][_0xd415('0x19')](_0x463699[_0xd415('0x1a')],{'raw':_0x463699[_0xd415('0x1b')]?_0x463699['options'][_0xd415('0x1c')]===undefined?!![]:![]:!![]})[_0xd415('0xe')](function(_0x4e26a8){logger['info'](_0xd415('0x18'),_0x463699);logger[_0xd415('0x12')](_0xd415('0x18'),_0x463699,JSON[_0xd415('0x14')](_0x4e26a8));_0xfc461e(_0x4e26a8);})['catch'](function(_0xde3323){logger[_0xd415('0x15')]('CreateWhatsappQueueReport',_0xde3323['message'],_0x463699);_0x4014d6(_0x1fed7e[_0xd415('0x15')](0x1f4,_0xde3323['message']));});});};exports['UpdateWhatsappQueueReport']=function(_0x41d9be){var _0x4c7fa1=this;return new Promise(function(_0x21efc0,_0x15a8b5){return db['WhatsappQueueReport'][_0xd415('0x1d')](_0x41d9be[_0xd415('0x1a')],{'raw':_0x41d9be[_0xd415('0x1b')]?_0x41d9be['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x41d9be[_0xd415('0x1b')]?_0x41d9be[_0xd415('0x1b')][_0xd415('0x1e')]||null:null,'attributes':_0x41d9be[_0xd415('0x1b')]?_0x41d9be[_0xd415('0x1b')][_0xd415('0x1f')]||null:null,'limit':_0x41d9be[_0xd415('0x1b')]?_0x41d9be['options']['limit']||null:null})[_0xd415('0xe')](function(_0x5956b7){logger['info']('UpdateWhatsappQueueReport',_0x41d9be);logger[_0xd415('0x12')]('UpdateWhatsappQueueReport',_0x41d9be,JSON['stringify'](_0x5956b7));_0x21efc0(_0x5956b7);})[_0xd415('0x20')](function(_0x39f07a){logger['error']('UpdateWhatsappQueueReport',_0x39f07a[_0xd415('0x17')],_0x41d9be);_0x15a8b5(_0x4c7fa1['error'](0x1f4,_0x39f07a[_0xd415('0x17')]));});});}; \ No newline at end of file +var _0xf765=['message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','body','raw','UpdateWhatsappQueueReport','update','options','where','limit','lodash','util','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error'];(function(_0x5f2973,_0xb7a143){var _0x2478dd=function(_0x303101){while(--_0x303101){_0x5f2973['push'](_0x5f2973['shift']());}};_0x2478dd(++_0xb7a143);}(_0xf765,0xd7));var _0x5f76=function(_0x20f2e4,_0x20e4cc){_0x20f2e4=_0x20f2e4-0x0;var _0x303401=_0xf765[_0x20f2e4];return _0x303401;};'use strict';var _=require(_0x5f76('0x0'));var util=require(_0x5f76('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5f76('0x2'));var fs=require('fs');var Redis=require(_0x5f76('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5f76('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x5f76('0x5'));var jayson=require(_0x5f76('0x6'));var client=jayson[_0x5f76('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x81de35,_0x2c4c8a,_0x2116ee){return new BPromise(function(_0x1ad041,_0x58fe82){return client[_0x5f76('0x8')](_0x81de35,_0x2116ee)[_0x5f76('0x9')](function(_0x12a880){logger[_0x5f76('0xa')](_0x5f76('0xb'),_0x2c4c8a,_0x5f76('0xc'));logger[_0x5f76('0xd')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x2c4c8a,_0x5f76('0xc'),JSON[_0x5f76('0xe')](_0x12a880));if(_0x12a880['error']){if(_0x12a880['error'][_0x5f76('0xf')]===0x1f4){logger[_0x5f76('0x10')](_0x5f76('0xb'),_0x2c4c8a,_0x12a880['error'][_0x5f76('0x11')]);return _0x58fe82(_0x12a880[_0x5f76('0x10')][_0x5f76('0x11')]);}logger[_0x5f76('0x10')](_0x5f76('0xb'),_0x2c4c8a,_0x12a880['error'][_0x5f76('0x11')]);return _0x1ad041(_0x12a880[_0x5f76('0x10')][_0x5f76('0x11')]);}else{logger[_0x5f76('0xa')](_0x5f76('0xb'),_0x2c4c8a,_0x5f76('0xc'));_0x1ad041(_0x12a880[_0x5f76('0x12')][_0x5f76('0x11')]);}})[_0x5f76('0x13')](function(_0x2963a5){logger[_0x5f76('0x10')]('WhatsappQueueReport,\x20%s,\x20%s',_0x2c4c8a,_0x2963a5);_0x58fe82(_0x2963a5);});});}exports[_0x5f76('0x14')]=function(_0x572f1f){var _0x2d3e4a=this;return new Promise(function(_0x3a921f,_0x814ee){return db[_0x5f76('0x15')]['create'](_0x572f1f[_0x5f76('0x16')],{'raw':_0x572f1f['options']?_0x572f1f['options'][_0x5f76('0x17')]===undefined?!![]:![]:!![]})[_0x5f76('0x9')](function(_0x3ff877){logger['info'](_0x5f76('0x14'),_0x572f1f);logger['debug'](_0x5f76('0x14'),_0x572f1f,JSON[_0x5f76('0xe')](_0x3ff877));_0x3a921f(_0x3ff877);})['catch'](function(_0x4c421d){logger['error']('CreateWhatsappQueueReport',_0x4c421d[_0x5f76('0x11')],_0x572f1f);_0x814ee(_0x2d3e4a[_0x5f76('0x10')](0x1f4,_0x4c421d[_0x5f76('0x11')]));});});};exports[_0x5f76('0x18')]=function(_0x559dc0){var _0x3217d9=this;return new Promise(function(_0x2b044a,_0x1948e9){return db['WhatsappQueueReport'][_0x5f76('0x19')](_0x559dc0[_0x5f76('0x16')],{'raw':_0x559dc0[_0x5f76('0x1a')]?_0x559dc0[_0x5f76('0x1a')][_0x5f76('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x559dc0[_0x5f76('0x1a')]?_0x559dc0[_0x5f76('0x1a')][_0x5f76('0x1b')]||null:null,'attributes':_0x559dc0[_0x5f76('0x1a')]?_0x559dc0[_0x5f76('0x1a')]['attributes']||null:null,'limit':_0x559dc0[_0x5f76('0x1a')]?_0x559dc0['options'][_0x5f76('0x1c')]||null:null})[_0x5f76('0x9')](function(_0x29788e){logger[_0x5f76('0xa')](_0x5f76('0x18'),_0x559dc0);logger[_0x5f76('0xd')](_0x5f76('0x18'),_0x559dc0,JSON['stringify'](_0x29788e));_0x2b044a(_0x29788e);})['catch'](function(_0x21821e){logger[_0x5f76('0x10')](_0x5f76('0x18'),_0x21821e[_0x5f76('0x11')],_0x559dc0);_0x1948e9(_0x3217d9[_0x5f76('0x10')](0x1f4,_0x21821e[_0x5f76('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 4630bef..90313f6 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 _0x03bd=['update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe','post','create','put','/:id'];(function(_0x211193,_0x5530fa){var _0x2f256c=function(_0x233843){while(--_0x233843){_0x211193['push'](_0x211193['shift']());}};_0x2f256c(++_0x5530fa);}(_0x03bd,0x1bb));var _0xd03b=function(_0x6d30d9,_0x4b5705){_0x6d30d9=_0x6d30d9-0x0;var _0x1e47c=_0x03bd[_0x6d30d9];return _0x1e47c;};'use strict';var multer=require(_0xd03b('0x0'));var util=require(_0xd03b('0x1'));var path=require('path');var timeout=require(_0xd03b('0x2'));var express=require(_0xd03b('0x3'));var router=express['Router']();var fs_extra=require(_0xd03b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd03b('0x5'));var config=require(_0xd03b('0x6'));var controller=require(_0xd03b('0x7'));router[_0xd03b('0x8')]('/',auth[_0xd03b('0x9')](),controller[_0xd03b('0xa')]);router[_0xd03b('0x8')](_0xd03b('0xb'),auth['isAuthenticated'](),controller[_0xd03b('0xc')]);router['get']('/:id',auth[_0xd03b('0x9')](),controller['show']);router[_0xd03b('0xd')]('/',auth['isAuthenticated'](),controller[_0xd03b('0xe')]);router[_0xd03b('0xf')](_0xd03b('0x10'),auth[_0xd03b('0x9')](),controller[_0xd03b('0x11')]);router['delete'](_0xd03b('0x10'),auth[_0xd03b('0x9')](),controller[_0xd03b('0x12')]);module[_0xd03b('0x13')]=router; \ No newline at end of file +var _0x2de5=['index','describe','show','post','create','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated'];(function(_0x2236cb,_0x2e8bfd){var _0x5d9487=function(_0x27c147){while(--_0x27c147){_0x2236cb['push'](_0x2236cb['shift']());}};_0x5d9487(++_0x2e8bfd);}(_0x2de5,0xa0));var _0x52de=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x2de5[_0x2c7618];return _0x5ce3f0;};'use strict';var multer=require(_0x52de('0x0'));var util=require(_0x52de('0x1'));var path=require('path');var timeout=require(_0x52de('0x2'));var express=require('express');var router=express[_0x52de('0x3')]();var fs_extra=require(_0x52de('0x4'));var auth=require(_0x52de('0x5'));var interaction=require(_0x52de('0x6'));var config=require(_0x52de('0x7'));var controller=require(_0x52de('0x8'));router[_0x52de('0x9')]('/',auth[_0x52de('0xa')](),controller[_0x52de('0xb')]);router[_0x52de('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x52de('0xc')]);router[_0x52de('0x9')]('/:id',auth[_0x52de('0xa')](),controller[_0x52de('0xd')]);router[_0x52de('0xe')]('/',auth[_0x52de('0xa')](),controller[_0x52de('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x52de('0x10')]);router[_0x52de('0x11')]('/:id',auth[_0x52de('0xa')](),controller['destroy']);module[_0x52de('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index f637fd4..28c7749 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 _0x85de=['STRING','ENUM','account','queue','sequelize','exports'];(function(_0x53abe5,_0x33a9e5){var _0xc1c37e=function(_0xd53c6e){while(--_0xd53c6e){_0x53abe5['push'](_0x53abe5['shift']());}};_0xc1c37e(++_0x33a9e5);}(_0x85de,0x1f0));var _0xe85d=function(_0x2c6d3a,_0x497e41){_0x2c6d3a=_0x2c6d3a-0x0;var _0x33a2e3=_0x85de[_0x2c6d3a];return _0x33a2e3;};'use strict';var Sequelize=require(_0xe85d('0x0'));module[_0xe85d('0x1')]={'uniqueid':{'type':Sequelize[_0xe85d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xe85d('0x3')](_0xe85d('0x4'),'agent',_0xe85d('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x689b=['queue','DATE','sequelize','STRING','agent'];(function(_0x154911,_0x570fd9){var _0x40764b=function(_0x2a153a){while(--_0x2a153a){_0x154911['push'](_0x154911['shift']());}};_0x40764b(++_0x570fd9);}(_0x689b,0x142));var _0xb689=function(_0x3e06a2,_0x2be4d2){_0x3e06a2=_0x3e06a2-0x0;var _0x5c5827=_0x689b[_0x3e06a2];return _0x5c5827;};'use strict';var Sequelize=require(_0xb689('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xb689('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0xb689('0x2'),_0xb689('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xb689('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 9c93fd0..6570605 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 _0x63a6=['findAll','rows','catch','show','rawAttributes','options','find','create','body','params','describe','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','json','undefined','count','status','apply','reject','save','update','then','destroy','error','name','send','index','map','WhatsappTransferReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','include'];(function(_0x34132a,_0xda2d88){var _0x5777e3=function(_0x1d1195){while(--_0x1d1195){_0x34132a['push'](_0x34132a['shift']());}};_0x5777e3(++_0xda2d88);}(_0x63a6,0x1c7));var _0x663a=function(_0x915908,_0x333bc8){_0x915908=_0x915908-0x0;var _0x26a3ea=_0x63a6[_0x915908];return _0x26a3ea;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x663a('0x0'));var zipdir=require(_0x663a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x663a('0x2'));var moment=require(_0x663a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x663a('0x4'));var util=require(_0x663a('0x5'));var path=require(_0x663a('0x6'));var sox=require(_0x663a('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x663a('0x8'));var squel=require(_0x663a('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x663a('0xa'));var toCsv=require(_0x663a('0xb'));var querystring=require(_0x663a('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x663a('0xd'));var qs=require(_0x663a('0xe'));var as=require(_0x663a('0xf'));var hardwareService=require(_0x663a('0x10'));var logger=require(_0x663a('0x11'))(_0x663a('0x12'));var utils=require('../../config/utils');var config=require(_0x663a('0x13'));var licenseUtil=require(_0x663a('0x14'));var db=require(_0x663a('0x15'))['db'];function respondWithStatusCode(_0x581440,_0x583366){_0x583366=_0x583366||0xcc;return function(_0x3f3ef4){if(_0x3f3ef4){return _0x581440['sendStatus'](_0x583366);}return _0x581440['status'](_0x583366)[_0x663a('0x16')]();};}function respondWithResult(_0x39d5d4,_0x558f2f){_0x558f2f=_0x558f2f||0xc8;return function(_0x1eaf35){if(_0x1eaf35){return _0x39d5d4['status'](_0x558f2f)[_0x663a('0x17')](_0x1eaf35);}};}function respondWithFilteredResult(_0x1eab42,_0x15afa0){return function(_0x2d794f){if(_0x2d794f){var _0x1a8d76=typeof _0x15afa0['offset']===_0x663a('0x18')&&typeof _0x15afa0['limit']===_0x663a('0x18');var _0x45f489=_0x2d794f[_0x663a('0x19')];var _0x1508ab=_0x1a8d76?0x0:_0x15afa0['offset'];var _0x2a1f33=_0x1a8d76?_0x2d794f['count']:_0x15afa0['offset']+_0x15afa0['limit'];var _0x2d006c;if(_0x2a1f33>=_0x45f489){_0x2a1f33=_0x45f489;_0x2d006c=0xc8;}else{_0x2d006c=0xce;}_0x1eab42[_0x663a('0x1a')](_0x2d006c);return _0x1eab42['set']('Content-Range',_0x1508ab+'-'+_0x2a1f33+'/'+_0x45f489)[_0x663a('0x17')](_0x2d794f);}return null;};}function patchUpdates(_0x173a10){return function(_0x89d455){try{jsonpatch[_0x663a('0x1b')](_0x89d455,_0x173a10,!![]);}catch(_0x221c83){return BPromise[_0x663a('0x1c')](_0x221c83);}return _0x89d455[_0x663a('0x1d')]();};}function saveUpdates(_0x52d97b,_0x1586f3){return function(_0x21152c){if(_0x21152c){return _0x21152c[_0x663a('0x1e')](_0x52d97b)[_0x663a('0x1f')](function(_0x3d4e7c){return _0x3d4e7c;});}return null;};}function removeEntity(_0x207b26,_0x5e1bd1){return function(_0x310339){if(_0x310339){return _0x310339[_0x663a('0x20')]()['then'](function(){_0x207b26[_0x663a('0x1a')](0xcc)[_0x663a('0x16')]();});}};}function handleEntityNotFound(_0x5463d5,_0x3cb58a){return function(_0x2b2762){if(!_0x2b2762){_0x5463d5['sendStatus'](0x194);}return _0x2b2762;};}function handleError(_0x1e2653,_0x41c552){_0x41c552=_0x41c552||0x1f4;return function(_0x57131d){logger[_0x663a('0x21')](_0x57131d['stack']);if(_0x57131d[_0x663a('0x22')]){delete _0x57131d[_0x663a('0x22')];}_0x1e2653[_0x663a('0x1a')](_0x41c552)[_0x663a('0x23')](_0x57131d);};}exports[_0x663a('0x24')]=function(_0x57f93d,_0xcf9f0a){var _0x71efb={},_0x1ab286={},_0xf68801={'count':0x0,'rows':[]};var _0x210f03=_[_0x663a('0x25')](db[_0x663a('0x26')]['rawAttributes'],function(_0x3b4329){return{'name':_0x3b4329[_0x663a('0x27')],'type':_0x3b4329[_0x663a('0x28')][_0x663a('0x29')]};});_0x1ab286[_0x663a('0x2a')]=_['map'](_0x210f03,_0x663a('0x22'));_0x1ab286['query']=_[_0x663a('0x2b')](_0x57f93d[_0x663a('0x2c')]);_0x1ab286[_0x663a('0x2d')]=_[_0x663a('0x2e')](_0x1ab286[_0x663a('0x2a')],_0x1ab286['query']);_0x71efb[_0x663a('0x2f')]=_['intersection'](_0x1ab286[_0x663a('0x2a')],qs[_0x663a('0x30')](_0x57f93d[_0x663a('0x2c')][_0x663a('0x30')]));_0x71efb['attributes']=_0x71efb[_0x663a('0x2f')][_0x663a('0x31')]?_0x71efb[_0x663a('0x2f')]:_0x1ab286[_0x663a('0x2a')];if(!_0x57f93d[_0x663a('0x2c')][_0x663a('0x32')](_0x663a('0x33'))){_0x71efb[_0x663a('0x34')]=qs['limit'](_0x57f93d[_0x663a('0x2c')][_0x663a('0x34')]);_0x71efb['offset']=qs[_0x663a('0x35')](_0x57f93d[_0x663a('0x2c')][_0x663a('0x35')]);}_0x71efb[_0x663a('0x36')]=qs[_0x663a('0x37')](_0x57f93d['query'][_0x663a('0x37')]);_0x71efb['where']=qs[_0x663a('0x2d')](_[_0x663a('0x38')](_0x57f93d['query'],_0x1ab286['filters']),_0x210f03);if(_0x57f93d[_0x663a('0x2c')][_0x663a('0x39')]){_0x71efb['where']=_[_0x663a('0x3a')](_0x71efb[_0x663a('0x3b')],{'$or':_[_0x663a('0x25')](_0x210f03,function(_0x4d0b8d){if(_0x4d0b8d[_0x663a('0x28')]!==_0x663a('0x3c')){var _0x5e2826={};_0x5e2826[_0x4d0b8d[_0x663a('0x22')]]={'$like':'%'+_0x57f93d['query'][_0x663a('0x39')]+'%'};return _0x5e2826;}})});}_0x71efb=_[_0x663a('0x3a')]({},_0x71efb,_0x57f93d['options']);var _0x1aff26={'where':_0x71efb[_0x663a('0x3b')]};return db['WhatsappTransferReport'][_0x663a('0x19')](_0x1aff26)[_0x663a('0x1f')](function(_0x5de40d){_0xf68801['count']=_0x5de40d;if(_0x57f93d[_0x663a('0x2c')][_0x663a('0x3d')]){_0x71efb[_0x663a('0x3e')]=[{'all':!![]}];}return db[_0x663a('0x26')][_0x663a('0x3f')](_0x71efb);})[_0x663a('0x1f')](function(_0x110afa){_0xf68801[_0x663a('0x40')]=_0x110afa;return _0xf68801;})['then'](respondWithFilteredResult(_0xcf9f0a,_0x71efb))[_0x663a('0x41')](handleError(_0xcf9f0a,null));};exports[_0x663a('0x42')]=function(_0x252963,_0x2e0df7){var _0x51fd91={'raw':!![],'where':{'id':_0x252963['params']['id']}},_0x285ed3={};_0x285ed3['model']=_['keys'](db['WhatsappTransferReport'][_0x663a('0x43')]);_0x285ed3[_0x663a('0x2c')]=_[_0x663a('0x2b')](_0x252963['query']);_0x285ed3[_0x663a('0x2d')]=_['intersection'](_0x285ed3[_0x663a('0x2a')],_0x285ed3[_0x663a('0x2c')]);_0x51fd91['attributes']=_[_0x663a('0x2e')](_0x285ed3[_0x663a('0x2a')],qs[_0x663a('0x30')](_0x252963[_0x663a('0x2c')][_0x663a('0x30')]));_0x51fd91[_0x663a('0x2f')]=_0x51fd91[_0x663a('0x2f')][_0x663a('0x31')]?_0x51fd91['attributes']:_0x285ed3[_0x663a('0x2a')];if(_0x252963[_0x663a('0x2c')]['includeAll']){_0x51fd91['include']=[{'all':!![]}];}_0x51fd91=_[_0x663a('0x3a')]({},_0x51fd91,_0x252963[_0x663a('0x44')]);return db[_0x663a('0x26')][_0x663a('0x45')](_0x51fd91)['then'](handleEntityNotFound(_0x2e0df7,null))['then'](respondWithResult(_0x2e0df7,null))[_0x663a('0x41')](handleError(_0x2e0df7,null));};exports[_0x663a('0x46')]=function(_0x55b3ed,_0x5efe40){return db[_0x663a('0x26')][_0x663a('0x46')](_0x55b3ed[_0x663a('0x47')],{})[_0x663a('0x1f')](respondWithResult(_0x5efe40,0xc9))[_0x663a('0x41')](handleError(_0x5efe40,null));};exports[_0x663a('0x1e')]=function(_0x1c3bc4,_0x5ec404){if(_0x1c3bc4[_0x663a('0x47')]['id']){delete _0x1c3bc4[_0x663a('0x47')]['id'];}return db[_0x663a('0x26')][_0x663a('0x45')]({'where':{'id':_0x1c3bc4[_0x663a('0x48')]['id']}})[_0x663a('0x1f')](handleEntityNotFound(_0x5ec404,null))[_0x663a('0x1f')](saveUpdates(_0x1c3bc4[_0x663a('0x47')],null))[_0x663a('0x1f')](respondWithResult(_0x5ec404,null))[_0x663a('0x41')](handleError(_0x5ec404,null));};exports[_0x663a('0x20')]=function(_0x4a61f5,_0x32fbe2){return db[_0x663a('0x26')]['find']({'where':{'id':_0x4a61f5[_0x663a('0x48')]['id']}})[_0x663a('0x1f')](handleEntityNotFound(_0x32fbe2,null))[_0x663a('0x1f')](removeEntity(_0x32fbe2,null))['catch'](handleError(_0x32fbe2,null));};exports[_0x663a('0x49')]=function(_0x384629,_0x5462d4){return db[_0x663a('0x26')][_0x663a('0x49')]()['then'](respondWithResult(_0x5462d4,null))['catch'](handleError(_0x5462d4,null));}; \ No newline at end of file +var _0xc7d5=['destroy','then','stack','name','WhatsappTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','map','options','include','findAll','catch','show','params','includeAll','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','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/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','update'];(function(_0x38ea25,_0x3231de){var _0x5afea6=function(_0x4243b6){while(--_0x4243b6){_0x38ea25['push'](_0x38ea25['shift']());}};_0x5afea6(++_0x3231de);}(_0xc7d5,0x6b));var _0x5c7d=function(_0x3429b5,_0x3e7d3b){_0x3429b5=_0x3429b5-0x0;var _0x559b14=_0xc7d5[_0x3429b5];return _0x559b14;};'use strict';var emlformat=require(_0x5c7d('0x0'));var rimraf=require(_0x5c7d('0x1'));var zipdir=require(_0x5c7d('0x2'));var jsonpatch=require(_0x5c7d('0x3'));var rp=require(_0x5c7d('0x4'));var moment=require(_0x5c7d('0x5'));var BPromise=require(_0x5c7d('0x6'));var Mustache=require('mustache');var util=require(_0x5c7d('0x7'));var path=require(_0x5c7d('0x8'));var sox=require(_0x5c7d('0x9'));var csv=require(_0x5c7d('0xa'));var ejs=require(_0x5c7d('0xb'));var fs=require('fs');var fs_extra=require(_0x5c7d('0xc'));var _=require(_0x5c7d('0xd'));var squel=require(_0x5c7d('0xe'));var crypto=require(_0x5c7d('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x5c7d('0x10'));var toCsv=require('to-csv');var querystring=require(_0x5c7d('0x11'));var Papa=require(_0x5c7d('0x12'));var Redis=require(_0x5c7d('0x13'));var authService=require(_0x5c7d('0x14'));var qs=require(_0x5c7d('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5c7d('0x16'));var logger=require(_0x5c7d('0x17'))('api');var utils=require(_0x5c7d('0x18'));var config=require(_0x5c7d('0x19'));var licenseUtil=require(_0x5c7d('0x1a'));var db=require(_0x5c7d('0x1b'))['db'];function respondWithStatusCode(_0x1e5510,_0x1bff69){_0x1bff69=_0x1bff69||0xcc;return function(_0x263fbf){if(_0x263fbf){return _0x1e5510[_0x5c7d('0x1c')](_0x1bff69);}return _0x1e5510[_0x5c7d('0x1d')](_0x1bff69)[_0x5c7d('0x1e')]();};}function respondWithResult(_0x3af70c,_0x6bb486){_0x6bb486=_0x6bb486||0xc8;return function(_0x25c295){if(_0x25c295){return _0x3af70c['status'](_0x6bb486)['json'](_0x25c295);}};}function respondWithFilteredResult(_0x1deffa,_0x382ffb){return function(_0x406154){if(_0x406154){var _0x3052a7=typeof _0x382ffb[_0x5c7d('0x1f')]==='undefined'&&typeof _0x382ffb[_0x5c7d('0x20')]===_0x5c7d('0x21');var _0x47c882=_0x406154[_0x5c7d('0x22')];var _0x54386c=_0x3052a7?0x0:_0x382ffb[_0x5c7d('0x1f')];var _0x5349b3=_0x3052a7?_0x406154[_0x5c7d('0x22')]:_0x382ffb[_0x5c7d('0x1f')]+_0x382ffb[_0x5c7d('0x20')];var _0x54e1b5;if(_0x5349b3>=_0x47c882){_0x5349b3=_0x47c882;_0x54e1b5=0xc8;}else{_0x54e1b5=0xce;}_0x1deffa[_0x5c7d('0x1d')](_0x54e1b5);return _0x1deffa[_0x5c7d('0x23')](_0x5c7d('0x24'),_0x54386c+'-'+_0x5349b3+'/'+_0x47c882)['json'](_0x406154);}return null;};}function patchUpdates(_0x454644){return function(_0x215d85){try{jsonpatch[_0x5c7d('0x25')](_0x215d85,_0x454644,!![]);}catch(_0xfa9b3d){return BPromise['reject'](_0xfa9b3d);}return _0x215d85['save']();};}function saveUpdates(_0x51b60b,_0x24230c){return function(_0xe55249){if(_0xe55249){return _0xe55249[_0x5c7d('0x26')](_0x51b60b)['then'](function(_0x4cf542){return _0x4cf542;});}return null;};}function removeEntity(_0x5f5da5,_0x8cd3c3){return function(_0x27332b){if(_0x27332b){return _0x27332b[_0x5c7d('0x27')]()[_0x5c7d('0x28')](function(){_0x5f5da5[_0x5c7d('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20e234,_0x15f4ff){return function(_0x1355ee){if(!_0x1355ee){_0x20e234[_0x5c7d('0x1c')](0x194);}return _0x1355ee;};}function handleError(_0x4fd478,_0x1d04a2){_0x1d04a2=_0x1d04a2||0x1f4;return function(_0x5bcbd1){logger['error'](_0x5bcbd1[_0x5c7d('0x29')]);if(_0x5bcbd1['name']){delete _0x5bcbd1[_0x5c7d('0x2a')];}_0x4fd478['status'](_0x1d04a2)['send'](_0x5bcbd1);};}exports['index']=function(_0x307480,_0x4b85bd){var _0x3dbebe={},_0x2f4c3e={},_0x158dfd={'count':0x0,'rows':[]};var _0x22a841=_['map'](db[_0x5c7d('0x2b')][_0x5c7d('0x2c')],function(_0x3ae164){return{'name':_0x3ae164[_0x5c7d('0x2d')],'type':_0x3ae164[_0x5c7d('0x2e')][_0x5c7d('0x2f')]};});_0x2f4c3e['model']=_['map'](_0x22a841,_0x5c7d('0x2a'));_0x2f4c3e[_0x5c7d('0x30')]=_[_0x5c7d('0x31')](_0x307480[_0x5c7d('0x30')]);_0x2f4c3e[_0x5c7d('0x32')]=_['intersection'](_0x2f4c3e[_0x5c7d('0x33')],_0x2f4c3e[_0x5c7d('0x30')]);_0x3dbebe['attributes']=_[_0x5c7d('0x34')](_0x2f4c3e[_0x5c7d('0x33')],qs[_0x5c7d('0x35')](_0x307480[_0x5c7d('0x30')]['fields']));_0x3dbebe[_0x5c7d('0x36')]=_0x3dbebe[_0x5c7d('0x36')][_0x5c7d('0x37')]?_0x3dbebe[_0x5c7d('0x36')]:_0x2f4c3e[_0x5c7d('0x33')];if(!_0x307480[_0x5c7d('0x30')][_0x5c7d('0x38')]('nolimit')){_0x3dbebe[_0x5c7d('0x20')]=qs[_0x5c7d('0x20')](_0x307480[_0x5c7d('0x30')][_0x5c7d('0x20')]);_0x3dbebe['offset']=qs['offset'](_0x307480[_0x5c7d('0x30')][_0x5c7d('0x1f')]);}_0x3dbebe[_0x5c7d('0x39')]=qs['sort'](_0x307480['query'][_0x5c7d('0x3a')]);_0x3dbebe['where']=qs[_0x5c7d('0x32')](_[_0x5c7d('0x3b')](_0x307480[_0x5c7d('0x30')],_0x2f4c3e[_0x5c7d('0x32')]),_0x22a841);if(_0x307480[_0x5c7d('0x30')][_0x5c7d('0x3c')]){_0x3dbebe[_0x5c7d('0x3d')]=_[_0x5c7d('0x3e')](_0x3dbebe['where'],{'$or':_[_0x5c7d('0x3f')](_0x22a841,function(_0x3719f5){if(_0x3719f5[_0x5c7d('0x2e')]!=='VIRTUAL'){var _0x4881e6={};_0x4881e6[_0x3719f5[_0x5c7d('0x2a')]]={'$like':'%'+_0x307480[_0x5c7d('0x30')][_0x5c7d('0x3c')]+'%'};return _0x4881e6;}})});}_0x3dbebe=_['merge']({},_0x3dbebe,_0x307480[_0x5c7d('0x40')]);var _0x596bf1={'where':_0x3dbebe['where']};return db[_0x5c7d('0x2b')][_0x5c7d('0x22')](_0x596bf1)[_0x5c7d('0x28')](function(_0x3fb4b1){_0x158dfd[_0x5c7d('0x22')]=_0x3fb4b1;if(_0x307480[_0x5c7d('0x30')]['includeAll']){_0x3dbebe[_0x5c7d('0x41')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0x5c7d('0x42')](_0x3dbebe);})[_0x5c7d('0x28')](function(_0x15fa2f){_0x158dfd['rows']=_0x15fa2f;return _0x158dfd;})[_0x5c7d('0x28')](respondWithFilteredResult(_0x4b85bd,_0x3dbebe))[_0x5c7d('0x43')](handleError(_0x4b85bd,null));};exports[_0x5c7d('0x44')]=function(_0x9b2864,_0x20cad6){var _0x172350={'raw':!![],'where':{'id':_0x9b2864[_0x5c7d('0x45')]['id']}},_0x190d14={};_0x190d14[_0x5c7d('0x33')]=_[_0x5c7d('0x31')](db['WhatsappTransferReport'][_0x5c7d('0x2c')]);_0x190d14['query']=_[_0x5c7d('0x31')](_0x9b2864['query']);_0x190d14['filters']=_[_0x5c7d('0x34')](_0x190d14[_0x5c7d('0x33')],_0x190d14['query']);_0x172350[_0x5c7d('0x36')]=_[_0x5c7d('0x34')](_0x190d14[_0x5c7d('0x33')],qs['fields'](_0x9b2864[_0x5c7d('0x30')]['fields']));_0x172350[_0x5c7d('0x36')]=_0x172350[_0x5c7d('0x36')][_0x5c7d('0x37')]?_0x172350[_0x5c7d('0x36')]:_0x190d14[_0x5c7d('0x33')];if(_0x9b2864[_0x5c7d('0x30')][_0x5c7d('0x46')]){_0x172350[_0x5c7d('0x41')]=[{'all':!![]}];}_0x172350=_[_0x5c7d('0x3e')]({},_0x172350,_0x9b2864[_0x5c7d('0x40')]);return db[_0x5c7d('0x2b')]['find'](_0x172350)[_0x5c7d('0x28')](handleEntityNotFound(_0x20cad6,null))['then'](respondWithResult(_0x20cad6,null))[_0x5c7d('0x43')](handleError(_0x20cad6,null));};exports['create']=function(_0x4d3a46,_0x34569f){return db[_0x5c7d('0x2b')]['create'](_0x4d3a46[_0x5c7d('0x47')],{})[_0x5c7d('0x28')](respondWithResult(_0x34569f,0xc9))['catch'](handleError(_0x34569f,null));};exports[_0x5c7d('0x26')]=function(_0x4159e0,_0x3da3b8){if(_0x4159e0[_0x5c7d('0x47')]['id']){delete _0x4159e0[_0x5c7d('0x47')]['id'];}return db[_0x5c7d('0x2b')]['find']({'where':{'id':_0x4159e0[_0x5c7d('0x45')]['id']}})[_0x5c7d('0x28')](handleEntityNotFound(_0x3da3b8,null))['then'](saveUpdates(_0x4159e0['body'],null))[_0x5c7d('0x28')](respondWithResult(_0x3da3b8,null))['catch'](handleError(_0x3da3b8,null));};exports[_0x5c7d('0x27')]=function(_0x2636e3,_0x1abe29){return db[_0x5c7d('0x2b')]['find']({'where':{'id':_0x2636e3[_0x5c7d('0x45')]['id']}})['then'](handleEntityNotFound(_0x1abe29,null))[_0x5c7d('0x28')](removeEntity(_0x1abe29,null))[_0x5c7d('0x43')](handleError(_0x1abe29,null));};exports[_0x5c7d('0x48')]=function(_0x464f03,_0x1221d0){return db[_0x5c7d('0x2b')][_0x5c7d('0x48')]()[_0x5c7d('0x28')](respondWithResult(_0x1221d0,null))[_0x5c7d('0x43')](handleError(_0x1221d0,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index b809a9f..77ef9b5 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 _0x6bb7=['rimraf','../../config/environment','./whatsappTransferReport.attributes','report_whatsapp_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','path'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x6bb7,0x1b2));var _0x76bb=function(_0x49859e,_0x1eae28){_0x49859e=_0x49859e-0x0;var _0xa3d5c2=_0x6bb7[_0x49859e];return _0xa3d5c2;};'use strict';var _=require('lodash');var util=require(_0x76bb('0x0'));var logger=require(_0x76bb('0x1'))(_0x76bb('0x2'));var moment=require(_0x76bb('0x3'));var BPromise=require(_0x76bb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x76bb('0x5'));var rimraf=require(_0x76bb('0x6'));var config=require(_0x76bb('0x7'));var attributes=require(_0x76bb('0x8'));module['exports']=function(_0x4adde2,_0x8784d5){return _0x4adde2['define']('WhatsappTransferReport',attributes,{'tableName':_0x76bb('0x9'),'paranoid':![],'indexes':[{'name':_0x76bb('0xa'),'fields':[_0x76bb('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe55d=['WhatsappTransferReport','report_whatsapp_transfer','uniqueid','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define'];(function(_0x36d8d9,_0x17b58a){var _0x1ac3a2=function(_0x392196){while(--_0x392196){_0x36d8d9['push'](_0x36d8d9['shift']());}};_0x1ac3a2(++_0x17b58a);}(_0xe55d,0xd3));var _0xde55=function(_0x2be481,_0x3ea049){_0x2be481=_0x2be481-0x0;var _0x43a610=_0xe55d[_0x2be481];return _0x43a610;};'use strict';var _=require('lodash');var util=require(_0xde55('0x0'));var logger=require(_0xde55('0x1'))(_0xde55('0x2'));var moment=require('moment');var BPromise=require(_0xde55('0x3'));var rp=require(_0xde55('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde55('0x5'));var config=require(_0xde55('0x6'));var attributes=require(_0xde55('0x7'));module[_0xde55('0x8')]=function(_0x1b7f0d,_0x5be13f){return _0x1b7f0d[_0xde55('0x9')](_0xde55('0xa'),attributes,{'tableName':_0xde55('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xde55('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 491edb7..37cfde4 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 _0xb66f=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0xb66f,0x83));var _0xfb66=function(_0x5304c0,_0x240d71){_0x5304c0=_0x5304c0-0x0;var _0x11d983=_0xb66f[_0x5304c0];return _0x11d983;};'use strict';var _=require(_0xfb66('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfb66('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb66('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xfb66('0x3'));var logger=require(_0xfb66('0x4'))('rpc');var config=require(_0xfb66('0x5'));var jayson=require(_0xfb66('0x6'));var client=jayson['client'][_0xfb66('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x593120,_0x456949,_0xff699c){return new BPromise(function(_0x2d422e,_0x3d9d68){return client[_0xfb66('0x8')](_0x593120,_0xff699c)[_0xfb66('0x9')](function(_0x2d1863){logger[_0xfb66('0xa')](_0xfb66('0xb'),_0x456949,_0xfb66('0xc'));logger['debug']('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x456949,'request\x20sent',JSON[_0xfb66('0xd')](_0x2d1863));if(_0x2d1863['error']){if(_0x2d1863[_0xfb66('0xe')][_0xfb66('0xf')]===0x1f4){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x456949,_0x2d1863[_0xfb66('0xe')][_0xfb66('0x10')]);return _0x3d9d68(_0x2d1863[_0xfb66('0xe')]['message']);}logger[_0xfb66('0xe')](_0xfb66('0xb'),_0x456949,_0x2d1863[_0xfb66('0xe')][_0xfb66('0x10')]);return _0x2d422e(_0x2d1863[_0xfb66('0xe')]['message']);}else{logger[_0xfb66('0xa')](_0xfb66('0xb'),_0x456949,_0xfb66('0xc'));_0x2d422e(_0x2d1863[_0xfb66('0x11')][_0xfb66('0x10')]);}})[_0xfb66('0x12')](function(_0x4d7a49){logger[_0xfb66('0xe')](_0xfb66('0xb'),_0x456949,_0x4d7a49);_0x3d9d68(_0x4d7a49);});});} \ No newline at end of file +var _0xc1bc=['../../config/logger','rpc','../../config/environment','client','http','request','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3cb41d,_0x2d7f6d){var _0x4dc372=function(_0x2e7351){while(--_0x2e7351){_0x3cb41d['push'](_0x3cb41d['shift']());}};_0x4dc372(++_0x2d7f6d);}(_0xc1bc,0x173));var _0xcc1b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xc1bc[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xcc1b('0x0'));var util=require(_0xcc1b('0x1'));var moment=require('moment');var BPromise=require(_0xcc1b('0x2'));var rs=require(_0xcc1b('0x3'));var fs=require('fs');var Redis=require(_0xcc1b('0x4'));var db=require(_0xcc1b('0x5'))['db'];var utils=require(_0xcc1b('0x6'));var logger=require(_0xcc1b('0x7'))(_0xcc1b('0x8'));var config=require(_0xcc1b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xcc1b('0xa')][_0xcc1b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x172878,_0x5ca729,_0x4a45b9){return new BPromise(function(_0x16c769,_0x594ff8){return client[_0xcc1b('0xc')](_0x172878,_0x4a45b9)['then'](function(_0x24becd){logger['info'](_0xcc1b('0xd'),_0x5ca729,_0xcc1b('0xe'));logger[_0xcc1b('0xf')](_0xcc1b('0x10'),_0x5ca729,'request\x20sent',JSON[_0xcc1b('0x11')](_0x24becd));if(_0x24becd[_0xcc1b('0x12')]){if(_0x24becd['error']['code']===0x1f4){logger[_0xcc1b('0x12')](_0xcc1b('0xd'),_0x5ca729,_0x24becd[_0xcc1b('0x12')][_0xcc1b('0x13')]);return _0x594ff8(_0x24becd[_0xcc1b('0x12')]['message']);}logger[_0xcc1b('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5ca729,_0x24becd[_0xcc1b('0x12')]['message']);return _0x16c769(_0x24becd[_0xcc1b('0x12')][_0xcc1b('0x13')]);}else{logger['info'](_0xcc1b('0xd'),_0x5ca729,_0xcc1b('0xe'));_0x16c769(_0x24becd['result'][_0xcc1b('0x13')]);}})[_0xcc1b('0x14')](function(_0x4c8acf){logger['error'](_0xcc1b('0xd'),_0x5ca729,_0x4c8acf);_0x594ff8(_0x4c8acf);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index cbad083..0c869e0 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc46=['Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./config/seedDB','./config/license','./rpc','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','seedDB','then','default','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','pm2_env','Online\x20apps:','map','online','name','join','Offline\x20apps:','status','None','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!'];(function(_0x13b18b,_0x5553c4){var _0x33ee5a=function(_0x51c78b){while(--_0x51c78b){_0x13b18b['push'](_0x13b18b['shift']());}};_0x33ee5a(++_0x5553c4);}(_0xfc46,0x9a));var _0x6fc4=function(_0x9c8b4a,_0x2387ff){_0x9c8b4a=_0x9c8b4a-0x0;var _0x198bef=_0xfc46[_0x9c8b4a];return _0x198bef;};'use strict';var _=require(_0x6fc4('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0x6fc4('0x1'));var checkLicense=require(_0x6fc4('0x2'));var rpc=require(_0x6fc4('0x3'));var config=require('./config/environment');var logger=require(_0x6fc4('0x4'))(_0x6fc4('0x5'));var pm2=require(_0x6fc4('0x6'));var pm2Config=require(_0x6fc4('0x7'));var schedule=require('./config/schedule');var chat=require(_0x6fc4('0x8'));var whatsapp=require(_0x6fc4('0x9'));var transcribe=require(_0x6fc4('0xa'));var provider=require(_0x6fc4('0xb'));function main(){return db[_0x6fc4('0xc')][_0x6fc4('0xd')]()['then'](function(){if(config[_0x6fc4('0xe')]){return seedDb['default']();}})[_0x6fc4('0xf')](function(){return checkLicense[_0x6fc4('0x10')]();})['then'](function(){return rpc[_0x6fc4('0x11')]();})[_0x6fc4('0xf')](function(_0x3a8f51){logger[_0x6fc4('0x12')](_0x3a8f51);return chat[_0x6fc4('0x13')]();})[_0x6fc4('0xf')](function(){return whatsapp[_0x6fc4('0x13')]();})[_0x6fc4('0xf')](function(){return schedule[_0x6fc4('0x13')]();})[_0x6fc4('0xf')](function(){return transcribe[_0x6fc4('0x13')]();})[_0x6fc4('0xf')](function(){return provider[_0x6fc4('0x13')]();})[_0x6fc4('0xf')](function(_0x13eb64){logger[_0x6fc4('0x12')](_0x13eb64);return pm2[_0x6fc4('0x13')](pm2Config);})['then'](function(_0x56383b){var _0x15305c=_0x56383b[_0x6fc4('0x14')](function(_0x3b42a5){return typeof _0x3b42a5[_0x6fc4('0x15')]===_0x6fc4('0x16')&&_0x3b42a5[_0x6fc4('0x15')]>=0x0;});if(_0x15305c[_0x6fc4('0x17')]>0x0){throw new Error(_0x15305c[_0x6fc4('0x17')]+_0x6fc4('0x18')+_['map'](_0x15305c,function(_0xf85d9b){return'\x22'+_0xf85d9b[_0x6fc4('0x19')]['name']+'\x22';}));}logger['info'](_0x6fc4('0x1a'),_[_0x6fc4('0x1b')](_['filter'](_0x56383b,{'status':_0x6fc4('0x1c')}),_0x6fc4('0x1d'))[_0x6fc4('0x1e')]());logger['info'](_0x6fc4('0x1f'),_[_0x6fc4('0x1b')](_[_0x6fc4('0x14')](_0x56383b,function(_0x518579){return _0x518579[_0x6fc4('0x20')]!==_0x6fc4('0x1c');}),'name')['join']()||_0x6fc4('0x21'));console['log']('App\x20Ready!');})['catch'](function(_0x417ce6){console[_0x6fc4('0x22')](_0x6fc4('0x23'),_0x417ce6);logger['error'](_0x6fc4('0x24'),_0x417ce6);process[_0x6fc4('0x25')](0x1);});}main(); \ No newline at end of file +var _0x6a88=['Online\x20apps:','online','join','Offline\x20apps:','log','App\x20Ready!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','./config/pm2','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/cloud-provider','then','seedDB','default','info','start','filter','number','exitCode','length','map','pm2_env','name'];(function(_0x2f6dfe,_0x115dab){var _0x5e5c9c=function(_0x502840){while(--_0x502840){_0x2f6dfe['push'](_0x2f6dfe['shift']());}};_0x5e5c9c(++_0x115dab);}(_0x6a88,0xa9));var _0x86a8=function(_0x38d8e2,_0x48603c){_0x38d8e2=_0x38d8e2-0x0;var _0x5afbee=_0x6a88[_0x38d8e2];return _0x5afbee;};'use strict';var _=require(_0x86a8('0x0'));var db=require(_0x86a8('0x1'))['db'];var seedDb=require(_0x86a8('0x2'));var checkLicense=require(_0x86a8('0x3'));var rpc=require(_0x86a8('0x4'));var config=require(_0x86a8('0x5'));var logger=require(_0x86a8('0x6'))('app');var pm2=require(_0x86a8('0x7'));var pm2Config=require('./config/pm2/config');var schedule=require('./config/schedule');var chat=require(_0x86a8('0x8'));var whatsapp=require(_0x86a8('0x9'));var transcribe=require('./config/schedule/transcribe');var provider=require(_0x86a8('0xa'));function main(){return db['sequelize']['sync']()[_0x86a8('0xb')](function(){if(config[_0x86a8('0xc')]){return seedDb['default']();}})[_0x86a8('0xb')](function(){return checkLicense[_0x86a8('0xd')]();})['then'](function(){return rpc['listen']();})[_0x86a8('0xb')](function(_0x413416){logger[_0x86a8('0xe')](_0x413416);return chat[_0x86a8('0xf')]();})[_0x86a8('0xb')](function(){return whatsapp[_0x86a8('0xf')]();})[_0x86a8('0xb')](function(){return schedule[_0x86a8('0xf')]();})[_0x86a8('0xb')](function(){return transcribe[_0x86a8('0xf')]();})['then'](function(){return provider[_0x86a8('0xf')]();})['then'](function(_0x54194f){logger[_0x86a8('0xe')](_0x54194f);return pm2[_0x86a8('0xf')](pm2Config);})['then'](function(_0x520697){var _0x4f8076=_0x520697[_0x86a8('0x10')](function(_0x2554be){return typeof _0x2554be['exitCode']===_0x86a8('0x11')&&_0x2554be[_0x86a8('0x12')]>=0x0;});if(_0x4f8076[_0x86a8('0x13')]>0x0){throw new Error(_0x4f8076[_0x86a8('0x13')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0x86a8('0x14')](_0x4f8076,function(_0x4e1147){return'\x22'+_0x4e1147[_0x86a8('0x15')][_0x86a8('0x16')]+'\x22';}));}logger[_0x86a8('0xe')](_0x86a8('0x17'),_[_0x86a8('0x14')](_[_0x86a8('0x10')](_0x520697,{'status':_0x86a8('0x18')}),_0x86a8('0x16'))[_0x86a8('0x19')]());logger['info'](_0x86a8('0x1a'),_[_0x86a8('0x14')](_[_0x86a8('0x10')](_0x520697,function(_0x20e4a6){return _0x20e4a6['status']!=='online';}),_0x86a8('0x16'))[_0x86a8('0x19')]()||'None');console[_0x86a8('0x1b')](_0x86a8('0x1c'));})['catch'](function(_0x3a2060){console[_0x86a8('0x1b')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x3a2060);logger[_0x86a8('0x1d')](_0x86a8('0x1e'),_0x3a2060);process[_0x86a8('0x1f')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index a4d0632..09df22b 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 _0x6852=['emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','faxAutoanswer','whatsappAutoanswer','messengerSoundNotification','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','then','query','forceDownload','unmanaged','Unmanaged.','Forbidden.','catch','headers','authorization','User','name','authenticate','pass','status','json','Wrong\x20credentials.','Unknown\x20authorization\x20format','getUuid','apikey','find','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','update','Forbidden','isWebrtcLicence','getLicense','webrtc','isMiddleware','setTokenCookie','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','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~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','updatePasswordsHistory','encryptString','join','promisify','sign','secret','options','verify','session','randomBytes','toString','hex','floor','now','../../mysqldb','../../config/environment','../../config/license/hardware','jsonwebtoken','express-jwt','basic-auth','crypto','util','moment','secrets','role','fullname','internal','email','userpic','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','pauseType','showWebBar','lastPauseAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer'];(function(_0x5dcd44,_0x5f3963){var _0x3e496e=function(_0x413ba5){while(--_0x413ba5){_0x5dcd44['push'](_0x5dcd44['shift']());}};_0x3e496e(++_0x5f3963);}(_0x6852,0xd5));var _0x2685=function(_0xd8f9a7,_0x36778f){_0xd8f9a7=_0xd8f9a7-0x0;var _0x2b77ab=_0x6852[_0xd8f9a7];return _0x2b77ab;};'use strict';var db=require(_0x2685('0x0'))['db'];var config=require(_0x2685('0x1'));var hardwareConf=require(_0x2685('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require('lodash');var jwt=require(_0x2685('0x3'));var expressJwt=require(_0x2685('0x4'));var compose=require('composable-middleware');var basicAuth=require(_0x2685('0x5'));var crypto=require(_0x2685('0x6'));var BPromise=require('bluebird');var util=require(_0x2685('0x7'));var moment=require(_0x2685('0x8'));var validateJwt=expressJwt({'secret':config[_0x2685('0x9')]['session']});var userAttributes=['id',_0x2685('0xa'),_0x2685('0xb'),'name',_0x2685('0xc'),_0x2685('0xd'),_0x2685('0xe'),'permissions',_0x2685('0xf'),_0x2685('0x10'),_0x2685('0x11'),_0x2685('0x12'),_0x2685('0x13'),_0x2685('0x14'),'openchannelPause',_0x2685('0x15'),_0x2685('0x16'),'lastLoginAt',_0x2685('0x17'),_0x2685('0x18'),'allowmessenger',_0x2685('0x19'),_0x2685('0x1a'),_0x2685('0x1b'),_0x2685('0x1c'),_0x2685('0x1d'),_0x2685('0x1e'),_0x2685('0x1f'),_0x2685('0x20'),'phoneBarExpires',_0x2685('0x21'),_0x2685('0x22'),_0x2685('0x23'),'hotdesk',_0x2685('0x24'),_0x2685('0x25'),_0x2685('0x26'),_0x2685('0x27'),_0x2685('0x28'),_0x2685('0x29'),_0x2685('0x2a'),_0x2685('0x2b'),_0x2685('0x2c'),_0x2685('0x2d'),_0x2685('0x2e'),'chatAutoanswerDelay','emailAutoanswer',_0x2685('0x2f'),_0x2685('0x30'),_0x2685('0x31'),_0x2685('0x32'),'openchannelAutoanswerDelay',_0x2685('0x33'),'faxAutoanswerDelay',_0x2685('0x34'),'whatsappAutoanswerDelay',_0x2685('0x35')];exports['isChatInteractionAuthorized']=function(){return this[_0x2685('0x36')](!![])[_0x2685('0x37')](function(_0x3e86b9,_0x266b17,_0x5d09cf){if(_0x3e86b9[_0x2685('0x38')]){_0x5d09cf();}else{return db[_0x2685('0x39')][_0x2685('0x3a')]({'where':{'id':_0x3e86b9[_0x2685('0x3b')]['id']},'attributes':['id',_0x2685('0x3c'),_0x2685('0x3d')],'raw':!![]})[_0x2685('0x3e')](function(_0x46e59b){if(_0x46e59b&&_0x46e59b['closed']&&!_0x3e86b9[_0x2685('0x3f')][_0x2685('0x40')]){return _0x266b17['status'](_0x46e59b[_0x2685('0x3d')]==='unmanaged'?0x195:0x193)['json']({'message':_0x46e59b[_0x2685('0x3d')]===_0x2685('0x41')?_0x2685('0x42'):_0x2685('0x43')});}else{_0x5d09cf();}})[_0x2685('0x44')](function(_0x5a15d7){_0x5d09cf(_0x5a15d7);});}});};exports[_0x2685('0x36')]=function isAuthenticated(_0x5b549e){return compose()[_0x2685('0x37')](function(_0x47e62a,_0x258560,_0x3675bb){var _0x2dbbf1;if(_0x47e62a[_0x2685('0x45')][_0x2685('0x46')]){if(_['startsWith'](_0x47e62a['headers'][_0x2685('0x46')],'Basic')){var _0x345187=basicAuth(_0x47e62a);db[_0x2685('0x47')]['find']({'where':{'name':_0x345187[_0x2685('0x48')]}})[_0x2685('0x3e')](function(_0x402b41){if(!_0x402b41||!_0x402b41[_0x2685('0x49')](_0x345187[_0x2685('0x4a')])){return _0x258560[_0x2685('0x4b')](0x191)[_0x2685('0x4c')]({'message':_0x2685('0x4d')});}_0x47e62a[_0x2685('0x38')]={'id':_0x402b41['id']};_0x3675bb();})[_0x2685('0x44')](function(_0x1a4647){_0x3675bb(_0x1a4647);});}else if(_['startsWith'](_0x47e62a['headers']['authorization'],'Bearer')){validateJwt(_0x47e62a,_0x258560,_0x3675bb);}else{if(_0x5b549e){_0x3675bb();}else{return _0x258560[_0x2685('0x4b')](0x193)[_0x2685('0x4c')]({'message':_0x2685('0x4e')});}}}else if(_0x47e62a['query']['apikey']){try{var _0x5d740b={'audience':hardwareConf[_0x2685('0x4f')](),'issuer':hardwareConf[_0x2685('0x4f')]()};verifyJwt(_0x47e62a[_0x2685('0x3f')][_0x2685('0x50')],_0x5d740b)[_0x2685('0x3e')](function(_0x3c4321){return db[_0x2685('0x47')][_0x2685('0x51')]({'where':{'id':_0x3c4321['sub']}})[_0x2685('0x3e')](function(_0x268ce1){_0x2dbbf1=_0x268ce1;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x2685('0x52')],'raw':!![]});})[_0x2685('0x3e')](function(_0x41e11d){if(!_0x2dbbf1||!_['isEqual'](_0x2dbbf1[_0x2685('0x53')],_0x3c4321[_0x2685('0x54')])){return _0x258560[_0x2685('0x4b')](0x191)[_0x2685('0x4c')]({'message':_0x2685('0x55')});}if(_0x2dbbf1['disabled']){return _0x258560[_0x2685('0x4b')](0x191)[_0x2685('0x4c')]({'message':_0x2685('0x56')});}if(_0x2dbbf1['blocked']){if(_0x41e11d[_0x2685('0x52')]>0x0){if(moment(_0x2dbbf1['blockedAt'])[_0x2685('0x57')](_0x41e11d[_0x2685('0x52')],_0x2685('0x58'))>moment()){return _0x258560[_0x2685('0x4b')](0x191)[_0x2685('0x4c')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x258560['status'](0x191)[_0x2685('0x4c')]({'message':_0x2685('0x56')});}}_0x47e62a[_0x2685('0x38')]={'id':_0x2dbbf1['id']};_0x3675bb();});})['catch'](function(){return _0x258560[_0x2685('0x4b')](0x191)[_0x2685('0x4c')]({'message':_0x2685('0x56')});});}catch(_0x25375a){_0x3675bb(_0x25375a);}}else if(_0x5b549e){_0x3675bb();}else{return _0x258560[_0x2685('0x4b')](0x193)[_0x2685('0x4c')]({'message':'Unknown\x20authorization\x20format'});}})[_0x2685('0x37')](function(_0x1340e4,_0x22c46c,_0x216c31){if(_0x1340e4[_0x2685('0x38')]){db[_0x2685('0x47')][_0x2685('0x51')]({'where':{'id':_0x1340e4[_0x2685('0x38')]['id']},'attributes':userAttributes})[_0x2685('0x3e')](function(_0x2f625c){if(!_0x2f625c){return _0x22c46c[_0x2685('0x4b')](0x194)['json']({'message':_0x2685('0x59')});}_0x1340e4[_0x2685('0x38')]=_0x2f625c;_0x216c31();})[_0x2685('0x44')](function(_0x509369){_0x216c31(_0x509369);});}else if(_0x5b549e){_0x216c31();}else{return _0x22c46c[_0x2685('0x4b')](0x194)[_0x2685('0x4c')]({'message':_0x2685('0x5a')});}});};exports[_0x2685('0x5b')]=function canUpdate(){return compose()[_0x2685('0x37')](function(_0x5b1a7b,_0x2061b6,_0x46bb87){return licenseUtil['getLicense']()[_0x2685('0x3e')](function(_0x33eaa6){if(_0x33eaa6[_0x2685('0x5c')]){_0x46bb87();}else{return _0x2061b6[_0x2685('0x4b')](0x193)[_0x2685('0x4c')]({'message':_0x2685('0x5d')});}})['catch'](function(_0x500138){_0x46bb87(_0x500138);});});};exports[_0x2685('0x5e')]=function isWebrtcLicence(){return compose()[_0x2685('0x37')](function(_0x15df74,_0x407044,_0x125953){return licenseUtil[_0x2685('0x5f')]()['then'](function(_0x9de1d3){if(_0x9de1d3[_0x2685('0x60')]){_0x125953();}else{return _0x407044[_0x2685('0x4b')](0x193)['json']({'message':_0x2685('0x5d')});}})['catch'](function(_0x2f19bb){_0x125953(_0x2f19bb);});});};exports[_0x2685('0x61')]=function(_0x43f58c,_0x6a98ca,_0x570355){_0x43f58c[_0x2685('0x61')]=!![];return _0x570355();};exports['signToken']=function signToken(_0x3a4b62){return signJwt(_0x3a4b62);};exports[_0x2685('0x62')]=function(_0x1a4e1b,_0x4faf2f){if(!_0x1a4e1b[_0x2685('0x38')]){return _0x4faf2f['status'](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x38d60a={'payload':{'id':_0x1a4e1b['user']['id'],'role':_0x1a4e1b[_0x2685('0x38')][_0x2685('0xa')]},'options':{'expiresIn':0x15180}};return signJwt(_0x38d60a)['then'](function(_0x9df4d8){_0x4faf2f[_0x2685('0x63')](_0x2685('0x64'),_0x9df4d8);_0x4faf2f[_0x2685('0x65')](_0x2685('0x66'));})['catch'](function(_0xca065d){return _0x4faf2f['status'](0x1f4)['send'](_0xca065d);});};exports[_0x2685('0x67')]=function(_0xbbab48){if(_['isNil'](_0xbbab48[_0x2685('0x53')])||_[_0x2685('0x68')](_0xbbab48['apiKeyIat'])){return null;}else{return createJwt(_0xbbab48);}};exports[_0x2685('0x69')]=function(_0x4767e9){_0x4767e9[_0x2685('0x53')]=generateNonce();_0x4767e9[_0x2685('0x6a')]=generateIssuedAt();return createJwt(_0x4767e9);};exports[_0x2685('0x6b')]=function(_0x48406d,_0x67dd81){var _0x2d6432=_0x48406d['query'][_0x2685('0x50')];if(_0x2d6432){var _0x4b7c03={'nonce':_0x67dd81[_0x2685('0x53')],'iat':_0x67dd81[_0x2685('0x6a')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x2685('0x4f')]()};return verifyJwt(_0x2d6432,_0x4b7c03)[_0x2685('0x3e')](function(){return generateApiKey(_0x67dd81);});}else{throw{'message':_0x2685('0x6c')};}};exports['validatePasswordPattern']=function(_0x2694c3){var _0x43d275=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x43d275['test'](_0x2694c3))throw new db[(_0x2685('0x6d'))][(_0x2685('0x6e'))](_0x2685('0x6f'));return;};exports['validatePasswordHistory']=function(_0x234afc,_0x1461cd,_0x37572f){var _0x2bc3b2=encryptor[_0x2685('0x70')](_0x1461cd)[_0x2685('0x71')](',');for(var _0x5da4d2=0x0;_0x5da4d2<_0x37572f;_0x5da4d2++){if(!_0x2bc3b2[_0x5da4d2])break;if(_0x234afc[_0x2685('0x72')]()===_0x2bc3b2[_0x5da4d2]['toLowerCase']()){var _0x3ef083=util[_0x2685('0x73')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x37572f);if(_0x37572f===0x1){_0x3ef083='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0x2685('0x6d'))][(_0x2685('0x6e'))](_0x3ef083);}}return;};exports[_0x2685('0x74')]=function(_0xe83708,_0x2845fc){var _0x3a48bb=_0x2845fc?encryptor[_0x2685('0x70')](_0x2845fc)['split'](','):[];if(_0x3a48bb['length']===0x5){_0x3a48bb['splice'](-0x1,0x1);}_0x3a48bb['unshift'](_0xe83708);return encryptor[_0x2685('0x75')](_0x3a48bb[_0x2685('0x76')](','));};function signJwt(_0x57bf3d){var _0x396dc5=BPromise[_0x2685('0x77')](jwt[_0x2685('0x78')],{'context':jwt});var _0x3950a2=_0x57bf3d[_0x2685('0x79')]||config[_0x2685('0x9')]['session'];return new BPromise(function(_0x4c66cb,_0x2a9710){_0x396dc5(_0x57bf3d['payload'],_0x3950a2,_0x57bf3d[_0x2685('0x7a')])['then'](function(_0x34d97a){_0x4c66cb(_0x34d97a);})[_0x2685('0x44')](function(_0x378fe2){_0x2a9710(_0x378fe2);});});}function verifyJwt(_0x183fae,_0x33f78e,_0x336428){var _0x1a8dd2=BPromise[_0x2685('0x77')](jwt[_0x2685('0x7b')],{'context':jwt});var _0x24e879=_0x336428||config[_0x2685('0x9')][_0x2685('0x7c')];return new BPromise(function(_0x281673,_0x2e4e72){_0x1a8dd2(_0x183fae,_0x24e879,_0x33f78e)[_0x2685('0x3e')](function(_0x59d887){_0x281673(_0x59d887);})[_0x2685('0x44')](function(_0x428290){_0x2e4e72(_0x428290);});});}function generateNonce(){return crypto[_0x2685('0x7d')](0x10)[_0x2685('0x7e')](_0x2685('0x7f'));}function generateIssuedAt(){return Math[_0x2685('0x80')](Date[_0x2685('0x81')]()/0x3e8)['toString']();}function createJwt(_0x22c100){var _0x3ed283={'payload':{'iat':_0x22c100[_0x2685('0x6a')],'nonce':_0x22c100[_0x2685('0x53')]},'options':{'algorithm':'HS512','subject':_0x22c100['id'][_0x2685('0x7e')](),'issuer':hardwareConf[_0x2685('0x4f')](),'audience':hardwareConf[_0x2685('0x4f')]()}};return signJwt(_0x3ed283)[_0x2685('0x3e')](function(_0x343f05){return{'iat':_0x22c100[_0x2685('0x6a')],'nonce':_0x22c100[_0x2685('0x53')],'token':_0x343f05};});} \ No newline at end of file +var _0x2ffe=['findOne','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','blocked','add','minutes','Invalid\x20API\x20access\x20key','use','User\x20not\x20found.','update','Forbidden','getLicense','webrtc','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','/dashboards/general','send','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','encryptString','join','promisify','sign','secret','payload','options','randomBytes','toString','hex','floor','HS512','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','basic-auth','crypto','bluebird','util','moment','secrets','session','name','internal','email','userpic','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','messengerSoundNotification','isAuthenticated','user','ChatInteraction','params','closed','disposition','then','query','forceDownload','status','unmanaged','catch','headers','authorization','Basic','find','pass','json','Wrong\x20credentials.','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','User','sub','Setting'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2ffe,0x151));var _0xe2ff=function(_0x1c8222,_0x18a20a){_0x1c8222=_0x1c8222-0x0;var _0x154a0a=_0x2ffe[_0x1c8222];return _0x154a0a;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xe2ff('0x0'));var hardwareConf=require(_0xe2ff('0x1'));var licenseUtil=require(_0xe2ff('0x2'));var encryptor=require(_0xe2ff('0x3'));var _=require(_0xe2ff('0x4'));var jwt=require(_0xe2ff('0x5'));var expressJwt=require(_0xe2ff('0x6'));var compose=require('composable-middleware');var basicAuth=require(_0xe2ff('0x7'));var crypto=require(_0xe2ff('0x8'));var BPromise=require(_0xe2ff('0x9'));var util=require(_0xe2ff('0xa'));var moment=require(_0xe2ff('0xb'));var validateJwt=expressJwt({'secret':config[_0xe2ff('0xc')][_0xe2ff('0xd')]});var userAttributes=['id','role','fullname',_0xe2ff('0xe'),_0xe2ff('0xf'),_0xe2ff('0x10'),_0xe2ff('0x11'),'permissions','md5secret',_0xe2ff('0x12'),_0xe2ff('0x13'),_0xe2ff('0x14'),_0xe2ff('0x15'),_0xe2ff('0x16'),_0xe2ff('0x17'),_0xe2ff('0x18'),'showWebBar',_0xe2ff('0x19'),_0xe2ff('0x1a'),_0xe2ff('0x1b'),_0xe2ff('0x1c'),_0xe2ff('0x1d'),'alias','phoneBarAutoAnswer',_0xe2ff('0x1e'),_0xe2ff('0x1f'),_0xe2ff('0x20'),_0xe2ff('0x21'),_0xe2ff('0x22'),_0xe2ff('0x23'),'phoneBarPrefixRequired',_0xe2ff('0x24'),'phoneBarRemoteControlPort','hotdesk','interface',_0xe2ff('0x25'),_0xe2ff('0x26'),_0xe2ff('0x27'),_0xe2ff('0x28'),_0xe2ff('0x29'),'downloadOmnichannelInteractions','downloadAttachments',_0xe2ff('0x2a'),_0xe2ff('0x2b'),_0xe2ff('0x2c'),_0xe2ff('0x2d'),_0xe2ff('0x2e'),_0xe2ff('0x2f'),_0xe2ff('0x30'),_0xe2ff('0x31'),_0xe2ff('0x32'),_0xe2ff('0x33'),_0xe2ff('0x34'),_0xe2ff('0x35'),_0xe2ff('0x36'),_0xe2ff('0x37'),_0xe2ff('0x38')];exports['isChatInteractionAuthorized']=function(){return this[_0xe2ff('0x39')](!![])['use'](function(_0x34fbf3,_0x596a22,_0x386827){if(_0x34fbf3[_0xe2ff('0x3a')]){_0x386827();}else{return db[_0xe2ff('0x3b')]['findOne']({'where':{'id':_0x34fbf3[_0xe2ff('0x3c')]['id']},'attributes':['id',_0xe2ff('0x3d'),_0xe2ff('0x3e')],'raw':!![]})[_0xe2ff('0x3f')](function(_0x174812){if(_0x174812&&_0x174812[_0xe2ff('0x3d')]&&!_0x34fbf3[_0xe2ff('0x40')][_0xe2ff('0x41')]){return _0x596a22[_0xe2ff('0x42')](_0x174812[_0xe2ff('0x3e')]==='unmanaged'?0x195:0x193)['json']({'message':_0x174812[_0xe2ff('0x3e')]===_0xe2ff('0x43')?'Unmanaged.':'Forbidden.'});}else{_0x386827();}})[_0xe2ff('0x44')](function(_0x380224){_0x386827(_0x380224);});}});};exports['isAuthenticated']=function isAuthenticated(_0x4cfa6c){return compose()['use'](function(_0x35428c,_0x14a9e0,_0x128225){var _0x2d5169;if(_0x35428c[_0xe2ff('0x45')][_0xe2ff('0x46')]){if(_['startsWith'](_0x35428c[_0xe2ff('0x45')][_0xe2ff('0x46')],_0xe2ff('0x47'))){var _0x1de907=basicAuth(_0x35428c);db['User'][_0xe2ff('0x48')]({'where':{'name':_0x1de907[_0xe2ff('0xe')]}})[_0xe2ff('0x3f')](function(_0x312f16){if(!_0x312f16||!_0x312f16['authenticate'](_0x1de907[_0xe2ff('0x49')])){return _0x14a9e0[_0xe2ff('0x42')](0x191)[_0xe2ff('0x4a')]({'message':_0xe2ff('0x4b')});}_0x35428c[_0xe2ff('0x3a')]={'id':_0x312f16['id']};_0x128225();})[_0xe2ff('0x44')](function(_0x35f536){_0x128225(_0x35f536);});}else if(_['startsWith'](_0x35428c[_0xe2ff('0x45')][_0xe2ff('0x46')],_0xe2ff('0x4c'))){validateJwt(_0x35428c,_0x14a9e0,_0x128225);}else{if(_0x4cfa6c){_0x128225();}else{return _0x14a9e0[_0xe2ff('0x42')](0x193)[_0xe2ff('0x4a')]({'message':_0xe2ff('0x4d')});}}}else if(_0x35428c[_0xe2ff('0x40')][_0xe2ff('0x4e')]){try{var _0x48f44d={'audience':hardwareConf[_0xe2ff('0x4f')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x35428c[_0xe2ff('0x40')][_0xe2ff('0x4e')],_0x48f44d)['then'](function(_0x26eb66){return db[_0xe2ff('0x50')][_0xe2ff('0x48')]({'where':{'id':_0x26eb66[_0xe2ff('0x51')]}})[_0xe2ff('0x3f')](function(_0x31f1ce){_0x2d5169=_0x31f1ce;return db[_0xe2ff('0x52')][_0xe2ff('0x53')]({'where':{'id':0x1},'attributes':[_0xe2ff('0x54'),_0xe2ff('0x55')],'raw':!![]});})['then'](function(_0x5265ef){if(!_0x2d5169||!_[_0xe2ff('0x56')](_0x2d5169[_0xe2ff('0x57')],_0x26eb66[_0xe2ff('0x58')])){return _0x14a9e0[_0xe2ff('0x42')](0x191)[_0xe2ff('0x4a')]({'message':_0xe2ff('0x59')});}if(_0x2d5169['disabled']){return _0x14a9e0['status'](0x191)[_0xe2ff('0x4a')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x2d5169[_0xe2ff('0x5a')]){if(_0x5265ef['blockDuration']>0x0){if(moment(_0x2d5169['blockedAt'])[_0xe2ff('0x5b')](_0x5265ef[_0xe2ff('0x55')],_0xe2ff('0x5c'))>moment()){return _0x14a9e0[_0xe2ff('0x42')](0x191)[_0xe2ff('0x4a')]({'message':_0xe2ff('0x5d')});}}else{return _0x14a9e0[_0xe2ff('0x42')](0x191)[_0xe2ff('0x4a')]({'message':_0xe2ff('0x5d')});}}_0x35428c[_0xe2ff('0x3a')]={'id':_0x2d5169['id']};_0x128225();});})[_0xe2ff('0x44')](function(){return _0x14a9e0['status'](0x191)[_0xe2ff('0x4a')]({'message':_0xe2ff('0x5d')});});}catch(_0x2f0a63){_0x128225(_0x2f0a63);}}else if(_0x4cfa6c){_0x128225();}else{return _0x14a9e0[_0xe2ff('0x42')](0x193)[_0xe2ff('0x4a')]({'message':_0xe2ff('0x4d')});}})[_0xe2ff('0x5e')](function(_0x5de640,_0x547b96,_0x218292){if(_0x5de640['user']){db[_0xe2ff('0x50')][_0xe2ff('0x48')]({'where':{'id':_0x5de640[_0xe2ff('0x3a')]['id']},'attributes':userAttributes})[_0xe2ff('0x3f')](function(_0x324a1b){if(!_0x324a1b){return _0x547b96[_0xe2ff('0x42')](0x194)['json']({'message':_0xe2ff('0x5f')});}_0x5de640[_0xe2ff('0x3a')]=_0x324a1b;_0x218292();})[_0xe2ff('0x44')](function(_0x486acc){_0x218292(_0x486acc);});}else if(_0x4cfa6c){_0x218292();}else{return _0x547b96[_0xe2ff('0x42')](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xe2ff('0x5e')](function(_0x5c57a7,_0x3be482,_0x3cbc36){return licenseUtil['getLicense']()[_0xe2ff('0x3f')](function(_0x537ca9){if(_0x537ca9[_0xe2ff('0x60')]){_0x3cbc36();}else{return _0x3be482['status'](0x193)[_0xe2ff('0x4a')]({'message':_0xe2ff('0x61')});}})['catch'](function(_0x4fab02){_0x3cbc36(_0x4fab02);});});};exports['isWebrtcLicence']=function isWebrtcLicence(){return compose()[_0xe2ff('0x5e')](function(_0x959ba7,_0x30111e,_0x4deaa6){return licenseUtil[_0xe2ff('0x62')]()[_0xe2ff('0x3f')](function(_0x43e6e3){if(_0x43e6e3[_0xe2ff('0x63')]){_0x4deaa6();}else{return _0x30111e['status'](0x193)[_0xe2ff('0x4a')]({'message':'Forbidden'});}})[_0xe2ff('0x44')](function(_0x511970){_0x4deaa6(_0x511970);});});};exports[_0xe2ff('0x64')]=function(_0xd2b1d7,_0x13dabb,_0x1ddef6){_0xd2b1d7[_0xe2ff('0x64')]=!![];return _0x1ddef6();};exports[_0xe2ff('0x65')]=function signToken(_0x361efa){return signJwt(_0x361efa);};exports['setTokenCookie']=function(_0x465ab8,_0x5c23d4){if(!_0x465ab8[_0xe2ff('0x3a')]){return _0x5c23d4[_0xe2ff('0x42')](0x194)[_0xe2ff('0x4a')]({'message':_0xe2ff('0x66')});}var _0x4fb5fe={'payload':{'id':_0x465ab8['user']['id'],'role':_0x465ab8[_0xe2ff('0x3a')][_0xe2ff('0x67')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4fb5fe)[_0xe2ff('0x3f')](function(_0x5f0dce){_0x5c23d4[_0xe2ff('0x68')](_0xe2ff('0x69'),_0x5f0dce);_0x5c23d4[_0xe2ff('0x6a')](_0xe2ff('0x6b'));})['catch'](function(_0x3894a0){return _0x5c23d4['status'](0x1f4)[_0xe2ff('0x6c')](_0x3894a0);});};exports['retrieveApiKey']=function(_0x40c507){if(_[_0xe2ff('0x6d')](_0x40c507[_0xe2ff('0x57')])||_[_0xe2ff('0x6d')](_0x40c507[_0xe2ff('0x6e')])){return null;}else{return createJwt(_0x40c507);}};exports['generateApiKey']=function(_0x16c74d){_0x16c74d[_0xe2ff('0x57')]=generateNonce();_0x16c74d[_0xe2ff('0x6e')]=generateIssuedAt();return createJwt(_0x16c74d);};exports[_0xe2ff('0x6f')]=function(_0x41f350,_0x5c320b){var _0x41010e=_0x41f350['query'][_0xe2ff('0x4e')];if(_0x41010e){var _0x1a6342={'nonce':_0x5c320b[_0xe2ff('0x57')],'iat':_0x5c320b['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xe2ff('0x4f')]()};return verifyJwt(_0x41010e,_0x1a6342)[_0xe2ff('0x3f')](function(){return generateApiKey(_0x5c320b);});}else{throw{'message':_0xe2ff('0x70')};}};exports[_0xe2ff('0x71')]=function(_0x3f12d5){var _0x32e454=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x32e454[_0xe2ff('0x72')](_0x3f12d5))throw new db[(_0xe2ff('0x73'))][(_0xe2ff('0x74'))](_0xe2ff('0x75'));return;};exports['validatePasswordHistory']=function(_0x362e59,_0x2ac201,_0x1737ed){var _0x5bc158=encryptor[_0xe2ff('0x76')](_0x2ac201)[_0xe2ff('0x77')](',');for(var _0x2c2a83=0x0;_0x2c2a83<_0x1737ed;_0x2c2a83++){if(!_0x5bc158[_0x2c2a83])break;if(_0x362e59[_0xe2ff('0x78')]()===_0x5bc158[_0x2c2a83][_0xe2ff('0x78')]()){var _0x24e852=util[_0xe2ff('0x79')](_0xe2ff('0x7a'),_0x1737ed);if(_0x1737ed===0x1){_0x24e852=_0xe2ff('0x7b');}throw new db[(_0xe2ff('0x73'))][(_0xe2ff('0x74'))](_0x24e852);}}return;};exports[_0xe2ff('0x7c')]=function(_0x24766e,_0xfb1f30){var _0x416d6e=_0xfb1f30?encryptor['decryptString'](_0xfb1f30)[_0xe2ff('0x77')](','):[];if(_0x416d6e[_0xe2ff('0x7d')]===0x5){_0x416d6e[_0xe2ff('0x7e')](-0x1,0x1);}_0x416d6e[_0xe2ff('0x7f')](_0x24766e);return encryptor[_0xe2ff('0x80')](_0x416d6e[_0xe2ff('0x81')](','));};function signJwt(_0x353c69){var _0x4677dd=BPromise[_0xe2ff('0x82')](jwt[_0xe2ff('0x83')],{'context':jwt});var _0x3b71ae=_0x353c69[_0xe2ff('0x84')]||config['secrets']['session'];return new BPromise(function(_0x5f062f,_0x2c77fe){_0x4677dd(_0x353c69[_0xe2ff('0x85')],_0x3b71ae,_0x353c69[_0xe2ff('0x86')])[_0xe2ff('0x3f')](function(_0x362234){_0x5f062f(_0x362234);})[_0xe2ff('0x44')](function(_0x51db18){_0x2c77fe(_0x51db18);});});}function verifyJwt(_0x1319a6,_0x2d3622,_0x20e60e){var _0x5967b5=BPromise[_0xe2ff('0x82')](jwt['verify'],{'context':jwt});var _0x569afa=_0x20e60e||config[_0xe2ff('0xc')][_0xe2ff('0xd')];return new BPromise(function(_0x4e1062,_0x58622e){_0x5967b5(_0x1319a6,_0x569afa,_0x2d3622)[_0xe2ff('0x3f')](function(_0x37aa1c){_0x4e1062(_0x37aa1c);})[_0xe2ff('0x44')](function(_0x1ff63a){_0x58622e(_0x1ff63a);});});}function generateNonce(){return crypto[_0xe2ff('0x87')](0x10)[_0xe2ff('0x88')](_0xe2ff('0x89'));}function generateIssuedAt(){return Math[_0xe2ff('0x8a')](Date['now']()/0x3e8)[_0xe2ff('0x88')]();}function createJwt(_0x181995){var _0x117364={'payload':{'iat':_0x181995[_0xe2ff('0x6e')],'nonce':_0x181995[_0xe2ff('0x57')]},'options':{'algorithm':_0xe2ff('0x8b'),'subject':_0x181995['id'][_0xe2ff('0x88')](),'issuer':hardwareConf[_0xe2ff('0x4f')](),'audience':hardwareConf[_0xe2ff('0x4f')]()}};return signJwt(_0x117364)[_0xe2ff('0x3f')](function(_0x115735){return{'iat':_0x181995[_0xe2ff('0x6e')],'nonce':_0x181995[_0xe2ff('0x57')],'token':_0x115735};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 520ea6c..db61899 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x07e9=['lodash','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','search','parseAdvancedSearchFilter','parseQueryParameters','then','default','where','filter','user','clause','skip','checkListsRestrictions','ids','tag','countFilteredContacts','count','buildContactsQuery','fields','getFilteredContacts','catch','describe','keys','startsWith','CmCustomField','all','length','map','type'];(function(_0x230d85,_0x44b12a){var _0x566458=function(_0x1a5aaa){while(--_0x1a5aaa){_0x230d85['push'](_0x230d85['shift']());}};_0x566458(++_0x44b12a);}(_0x07e9,0xcc));var _0x907e=function(_0x182d8c,_0x32c47c){_0x182d8c=_0x182d8c-0x0;var _0x58b4a3=_0x07e9[_0x182d8c];return _0x58b4a3;};'use strict';var _=require(_0x907e('0x0'));var sqlUtils=require(_0x907e('0x1'));var db=require(_0x907e('0x2'))['db'];exports[_0x907e('0x3')]=function(_0x4f7821,_0x3f7f3f,_0xd21c53,_0x343335){var _0x28bf7a={'count':0x0,'rows':[]};var _0x3aea5a=sqlUtils[_0x907e('0x4')](_0x3f7f3f,_0x4f7821);if(_0x3aea5a){return Promise[_0x907e('0x5')](_0x28bf7a);}var _0xeb62b0=sqlUtils[_0x907e('0x6')]();var _0x5be8cb={};var _0x3bf493=![];var _0x26ad68=![];return Promise[_0x907e('0x5')]()['then'](function(){if(_0x4f7821[_0x907e('0x7')]){return sqlUtils[_0x907e('0x8')](_0x4f7821[_0x907e('0x7')],_0x343335);}else{return sqlUtils[_0x907e('0x9')](_0x4f7821,_0x343335);}})[_0x907e('0xa')](function(_0x1d964a){_0xeb62b0['where'](_0x1d964a[_0x907e('0xb')]);_0xeb62b0[_0x907e('0xc')](_0x1d964a['fields']);_0xeb62b0[_0x907e('0xc')](_0x1d964a[_0x907e('0xd')]);_0xeb62b0[_0x907e('0xc')](_0x1d964a[_0x907e('0xe')][_0x907e('0xf')]);_0x5be8cb=_0x1d964a['tags'];_0x26ad68=_0x1d964a[_0x907e('0xe')][_0x907e('0x10')];return sqlUtils[_0x907e('0x11')](_0x3f7f3f,_0x4f7821,_0x26ad68);})[_0x907e('0xa')](function(_0x2a3954){_0xeb62b0[_0x907e('0xc')](_0x2a3954);var _0x293d31=_0x4f7821[_0x907e('0x7')]?_0x5be8cb[_0x907e('0x12')]:_0x4f7821[_0x907e('0x13')];_0x3bf493=_0x293d31?!![]:![];return sqlUtils[_0x907e('0x14')](_0xeb62b0,_0x293d31);})[_0x907e('0xa')](function(_0x5ed451){_0x28bf7a[_0x907e('0x15')]=_0x5ed451;if(_0x28bf7a[_0x907e('0x15')]===0x0){return;}if(_0x4f7821['User']){_0x26ad68=!![];}return sqlUtils[_0x907e('0x16')](_0xeb62b0,_0x4f7821[_0x907e('0x17')],_0xd21c53,_0x3bf493,_0x5be8cb[_0x907e('0xf')],_0x26ad68);})[_0x907e('0xa')](function(_0x3d052f){if(!_0x3d052f){return[];}return sqlUtils[_0x907e('0x18')](_0x3d052f,_0x4f7821,_0xd21c53);})[_0x907e('0xa')](function(_0x5ef8e0){_0x28bf7a['rows']=_0x5ef8e0;return _0x28bf7a;})[_0x907e('0x19')](function(_0x401071){throw _0x401071;});};exports[_0x907e('0x1a')]=function(){var _0x4a7c47={};var _0x3c25c3=[];return db['CmContact'][_0x907e('0x1a')]()[_0x907e('0xa')](function(_0x4dd2a0){_0x4a7c47=_0x4dd2a0;var _0x2baad6=Object[_0x907e('0x1b')](_0x4a7c47)[_0x907e('0xd')](function(_0x407606){return _[_0x907e('0x1c')](_0x407606,'cf_')?_0x407606:undefined;});var _0x5bd8c1=_0x2baad6['map'](function(_0x930d9){return db[_0x907e('0x1d')]['findOne']({'where':{'id':_0x930d9['slice'](0x3)},'raw':!![]});});return Promise[_0x907e('0x1e')](_0x5bd8c1);})[_0x907e('0xa')](function(_0x108de2){for(var _0x5ca2c1=0x0;_0x5ca2c1<_0x108de2[_0x907e('0x1f')];_0x5ca2c1++){if(_0x108de2[_0x5ca2c1]){var _0x480d33='cf_'+_0x108de2[_0x5ca2c1]['id'];_0x4a7c47[_0x480d33]['fieldType']=_0x108de2[_0x5ca2c1]['type'];}}_0x3c25c3=_[_0x907e('0x20')](Object[_0x907e('0x1b')](_0x4a7c47),function(_0x33e12b){return{'name':_0x33e12b,'type':_0x4a7c47[_0x33e12b][_0x907e('0x21')]};});return _0x3c25c3;})[_0x907e('0x19')](function(_0x1a2aa6){throw _0x1a2aa6;});}; \ No newline at end of file +var _0x557f=['User','buildContactsQuery','fields','getFilteredContacts','rows','catch','describe','CmContact','filter','startsWith','cf_','CmCustomField','slice','all','length','fieldType','type','map','keys','lodash','./sql-utils','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','default','where','clause','user','skip','checkListsRestrictions','ids','countFilteredContacts','count'];(function(_0x203ab8,_0x3db544){var _0x3034fe=function(_0x214417){while(--_0x214417){_0x203ab8['push'](_0x203ab8['shift']());}};_0x3034fe(++_0x3db544);}(_0x557f,0x1e7));var _0xf557=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x557f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf557('0x0'));var sqlUtils=require(_0xf557('0x1'));var db=require('../../mysqldb')['db'];exports['findAll']=function(_0x199e8b,_0x415eaf,_0x4f1068,_0x34ce9b){var _0x8ca18b={'count':0x0,'rows':[]};var _0x106f0c=sqlUtils[_0xf557('0x2')](_0x415eaf,_0x199e8b);if(_0x106f0c){return Promise[_0xf557('0x3')](_0x8ca18b);}var _0x2be493=sqlUtils[_0xf557('0x4')]();var _0x581f39={};var _0x15d127=![];var _0x105171=![];return Promise[_0xf557('0x3')]()[_0xf557('0x5')](function(){if(_0x199e8b[_0xf557('0x6')]){return sqlUtils[_0xf557('0x7')](_0x199e8b[_0xf557('0x6')],_0x34ce9b);}else{return sqlUtils['parseQueryParameters'](_0x199e8b,_0x34ce9b);}})[_0xf557('0x5')](function(_0x4e7bbd){_0x2be493['where'](_0x4e7bbd[_0xf557('0x8')]);_0x2be493['where'](_0x4e7bbd['fields']);_0x2be493['where'](_0x4e7bbd['filter']);_0x2be493[_0xf557('0x9')](_0x4e7bbd['user'][_0xf557('0xa')]);_0x581f39=_0x4e7bbd['tags'];_0x105171=_0x4e7bbd[_0xf557('0xb')][_0xf557('0xc')];return sqlUtils[_0xf557('0xd')](_0x415eaf,_0x199e8b,_0x105171);})[_0xf557('0x5')](function(_0x2b4851){_0x2be493['where'](_0x2b4851);var _0x2f42d9=_0x199e8b[_0xf557('0x6')]?_0x581f39[_0xf557('0xe')]:_0x199e8b['tag'];_0x15d127=_0x2f42d9?!![]:![];return sqlUtils[_0xf557('0xf')](_0x2be493,_0x2f42d9);})[_0xf557('0x5')](function(_0x4af885){_0x8ca18b[_0xf557('0x10')]=_0x4af885;if(_0x8ca18b['count']===0x0){return;}if(_0x199e8b[_0xf557('0x11')]){_0x105171=!![];}return sqlUtils[_0xf557('0x12')](_0x2be493,_0x199e8b[_0xf557('0x13')],_0x4f1068,_0x15d127,_0x581f39['clause'],_0x105171);})[_0xf557('0x5')](function(_0x40a64f){if(!_0x40a64f){return[];}return sqlUtils[_0xf557('0x14')](_0x40a64f,_0x199e8b,_0x4f1068);})[_0xf557('0x5')](function(_0x4d8628){_0x8ca18b[_0xf557('0x15')]=_0x4d8628;return _0x8ca18b;})[_0xf557('0x16')](function(_0x2db90e){throw _0x2db90e;});};exports[_0xf557('0x17')]=function(){var _0x43b1d4={};var _0x2c802a=[];return db[_0xf557('0x18')][_0xf557('0x17')]()[_0xf557('0x5')](function(_0x32ddc4){_0x43b1d4=_0x32ddc4;var _0x4c3b1d=Object['keys'](_0x43b1d4)[_0xf557('0x19')](function(_0x466024){return _[_0xf557('0x1a')](_0x466024,_0xf557('0x1b'))?_0x466024:undefined;});var _0x61ac51=_0x4c3b1d['map'](function(_0x180f69){return db[_0xf557('0x1c')]['findOne']({'where':{'id':_0x180f69[_0xf557('0x1d')](0x3)},'raw':!![]});});return Promise[_0xf557('0x1e')](_0x61ac51);})[_0xf557('0x5')](function(_0x5924f9){for(var _0x252e23=0x0;_0x252e23<_0x5924f9[_0xf557('0x1f')];_0x252e23++){if(_0x5924f9[_0x252e23]){var _0x4662c5=_0xf557('0x1b')+_0x5924f9[_0x252e23]['id'];_0x43b1d4[_0x4662c5][_0xf557('0x20')]=_0x5924f9[_0x252e23][_0xf557('0x21')];}}_0x2c802a=_[_0xf557('0x22')](Object[_0xf557('0x23')](_0x43b1d4),function(_0x5f4284){return{'name':_0x5f4284,'type':_0x43b1d4[_0x5f4284][_0xf557('0x21')]};});return _0x2c802a;})[_0xf557('0x16')](function(_0x46612a){throw _0x46612a;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 455e42b..58cc805 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1183=['subqry','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20','cm_contact_has_tags','ct.CmContactId\x20=\x20','.id','tools_tags','t.id\x20=\x20ct.TagId','firstName','mobile','fax','email','CompanyId','updatedAt','TagIds','includes','push','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','name','dateOfBirth','fieldType','datetime','DATE','buildExpression','type','default','value','Tag','split','map','tags','clause','and','User','user','skip','some','compact','Contact','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','resolve','then','fields','tag','filter','role','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','select','group','limit','offset','subqry.id','having','order','DESC','subqry.','findAll','color','keyBy','Sequelize','SELECT','sequelize','query','toString','Tags','clone','COUNT(*)','c.id','getSelectedTags','isEmpty','exports','squel','../parsers/qs','../../mysqldb','agent','search','ListId','autocomplete','true','from','where','c.deletedAt\x20IS\x20NULL'];(function(_0x2fd69e,_0xb96bc3){var _0x51770f=function(_0x41adf5){while(--_0x41adf5){_0x2fd69e['push'](_0x2fd69e['shift']());}};_0x51770f(++_0xb96bc3);}(_0x1183,0x127));var _0x3118=function(_0x35d291,_0x1a131b){_0x35d291=_0x35d291-0x0;var _0x370b86=_0x1183[_0x35d291];return _0x370b86;};'use strict';var _=require('lodash');var squel=require(_0x3118('0x0'));var as=require('../parsers/advancedSearch');var qs=require(_0x3118('0x1'));var utils=require('../interaction/utils');var db=require(_0x3118('0x2'))['db'];function skipContactsQuery(_0x2ee7a9,_0x330617){var _0x528282=![];if(_0x2ee7a9['role']===_0x3118('0x3')&&!_0x330617[_0x3118('0x4')]&&!_0x330617[_0x3118('0x5')]&&_0x330617[_0x3118('0x6')]!==_0x3118('0x7')){_0x528282=!![];}return _0x528282;}function getContactsSubquery(){return squel['select']()[_0x3118('0x8')]('cm_contacts','c')[_0x3118('0x9')](_0x3118('0xa'));}function applyJoinClauses(_0x25a333,_0x143f02){var _0x378d05=_0x143f02?'c':_0x3118('0xb');_0x25a333[_0x3118('0xc')](_0x3118('0xd'),'uc',_0x3118('0xe')+_0x378d05+'.id')['left_join'](_0x3118('0xf'),'ct',_0x3118('0x10')+_0x378d05+_0x3118('0x11'))[_0x3118('0xc')](_0x3118('0x12'),'t',_0x3118('0x13'));return _0x25a333;}function addFieldsToQuery(_0x4ba31f,_0x53a31f,_0x10a302,_0x452825,_0x19e053){var _0x411c57=_0x19e053?'c':_0x3118('0xb');if(!_0x53a31f){_0x53a31f=['id',_0x3118('0x14'),'lastName','phone',_0x3118('0x15'),_0x3118('0x16'),_0x3118('0x17'),_0x3118('0x5'),_0x3118('0x18'),'createdAt',_0x3118('0x19'),'deletedAt',_0x3118('0x1a')];}else if(!_0x53a31f[_0x3118('0x1b')]('id')){_0x53a31f[_0x3118('0x1c')]('id');}var _0x3554b0=_0x10a302&&_0x19e053||!_0x10a302&&!_0x19e053;if(_0x452825){_0x3554b0=_0x452825&&_0x19e053||!_0x452825&&!_0x19e053;}_0x53a31f[_0x3118('0x1d')](function(_0x333c9a){if(_0x333c9a===_0x3118('0x1a')){if(_0x3554b0){_0x4ba31f[_0x3118('0x1e')](_0x3118('0x1f'),_0x333c9a);}else if(_0x10a302||_0x452825){_0x4ba31f[_0x3118('0x1e')](_0x411c57+'.'+_0x333c9a);}}else{_0x4ba31f[_0x3118('0x1e')](_0x411c57+'.'+_0x333c9a);}});return _0x4ba31f;}function getSqlClauses(){var _0x180377={'default':squel[_0x3118('0x20')](),'fields':squel[_0x3118('0x20')](),'filter':squel['expr'](),'tags':{'clause':squel[_0x3118('0x20')](),'ids':null},'user':{'clause':squel['expr'](),'skip':![]}};return _0x180377;}function parseTagParameter(_0x58a024){var _0x26b0c5=squel[_0x3118('0x20')]();if(_0x58a024){var _0x4539a2=utils['getSelectedTags'](_0x58a024);_0x4539a2['forEach'](function(_0x168e24){_0x26b0c5['or'](_0x3118('0x21'),'%,'+_0x168e24+',%');});}return _0x26b0c5;}function parseSearchFilter(_0x5f3cbe){var _0x2bbc9b=squel[_0x3118('0x20')]();if(_0x5f3cbe){var _0x340db7=_0x5f3cbe['replace']('\x5c','\x5c\x5c')[_0x3118('0x22')](/'/g,'\x27\x27');if(_0x340db7['split']('\x20')[_0x3118('0x23')]>0x1){_0x2bbc9b['or'](_0x3118('0x24'),qs[_0x3118('0x25')](_0x340db7,!![]),null);}else{if(qs[_0x3118('0x26')](_0x340db7)){_0x2bbc9b['or'](_0x3118('0x27'),_0x340db7+'%');_0x2bbc9b['or']('c.phone\x20LIKE\x20?',_0x340db7+'%');_0x2bbc9b['or']('c.mobile\x20LIKE\x20?',_0x340db7+'%');_0x2bbc9b['or']('c.fax\x20LIKE\x20?',_0x340db7+'%');}else if(qs[_0x3118('0x28')](_0x340db7)){_0x2bbc9b['or'](_0x3118('0x29'),_0x340db7+'%');}else{_0x2bbc9b['or']('c.firstName\x20LIKE\x20?','%'+_0x340db7+'%');_0x2bbc9b['or'](_0x3118('0x2a'),'%'+_0x340db7+'%');_0x2bbc9b['or'](_0x3118('0x29'),'%'+_0x340db7+'%');}}}return _0x2bbc9b;}function parseAdvancedSearchFilter(_0x5e21d3,_0x415180){var _0x55960d=getSqlClauses();var _0x2a91b6=as[_0x3118('0x2b')](_0x5e21d3);var _0x8c873f=_0x2a91b6[_0x3118('0x2c')];for(var _0x590caa=0x0;_0x590caa<_0x2a91b6['conditions']['length'];_0x590caa++){var _0x1144ff=_0x2a91b6[_0x3118('0x2d')][_0x590caa];var _0x1ac03f='c';var _0xad1005=_[_0x3118('0x2e')](_0x415180,[_0x3118('0x2f'),_0x1144ff[_0x3118('0x1e')]]);if(_0xad1005){if(_0x1144ff[_0x3118('0x1e')]===_0x3118('0x30')||_0xad1005[_0x3118('0x31')]===_0x3118('0x32')){_0x1144ff['castTo']=_0x3118('0x33');}var _0x3f45bf=as[_0x3118('0x34')](_0x1ac03f,_0xad1005[_0x3118('0x35')],_0x1144ff);_0x55960d[_0x3118('0x36')][_0x8c873f](_0x3f45bf['text'],_0x3f45bf[_0x3118('0x37')]['start'],_0x3f45bf[_0x3118('0x37')]['end']);}else{if(_0x1144ff[_0x3118('0x1e')]===_0x3118('0x38')){var _0x399fa8=_0x1144ff[_0x3118('0x37')][_0x3118('0x39')](',')[_0x3118('0x3a')](function(_0x6c637){return Number(_0x6c637);});var _0x3f48b0=parseTagParameter(_0x399fa8);_0x55960d[_0x3118('0x3b')][_0x3118('0x3c')][_0x3118('0x3d')](_0x3f48b0);_0x55960d[_0x3118('0x3b')]['ids']=_0x399fa8;}else if(_0x1144ff[_0x3118('0x1e')]===_0x3118('0x3e')){_0x55960d[_0x3118('0x3f')][_0x3118('0x3c')][_0x3118('0x3d')]('uc.UserId\x20=\x20?',_0x1144ff[_0x3118('0x37')]);_0x55960d[_0x3118('0x3f')][_0x3118('0x40')]=!![];}}}return _0x55960d;}function parseModelFields(_0x56c518,_0x55f4b4){var _0x5d4432=squel[_0x3118('0x20')]();var _0x4e1c47=_(_0x56c518)['keys']()[_0x3118('0x3a')](function(_0x37405c){return _[_0x3118('0x41')](_0x55f4b4,[_0x3118('0x2f'),_0x37405c])?_0x37405c:undefined;})[_0x3118('0x42')]()[_0x3118('0x37')]();if(_0x56c518[_0x3118('0x43')]){_0x4e1c47[_0x3118('0x1c')]('Contact');}if(_0x56c518['User']){_0x4e1c47[_0x3118('0x1c')](_0x3118('0x3e'));}if(_0x4e1c47[_0x3118('0x23')]>0x0){_0x4e1c47[_0x3118('0x1d')](function(_0x4b4e78){if(_0x4b4e78===_0x3118('0x5')){_0x5d4432[_0x3118('0x3d')]('c.ListId\x20IN\x20?',[]['concat'](_0x56c518[_0x4b4e78]));}else if(_0x4b4e78===_0x3118('0x43')){var _0x3f8249='%'+_0x56c518[_0x4b4e78]+'%';_0x5d4432[_0x3118('0x3d')](_0x3118('0x44'),_0x3f8249);}else if(_0x4b4e78===_0x3118('0x3e')){_0x5d4432[_0x3118('0x3d')]('uc.UserId\x20=\x20?',_0x56c518[_0x4b4e78]);}else{_0x5d4432[_0x3118('0x3d')]('c.'+_0x4b4e78+'\x20=\x20?',_0x56c518[_0x4b4e78]);}});}return _0x5d4432;}function parseQueryParameters(_0x365cfe,_0x35be3d){var _0x220cef=getSqlClauses();return Promise[_0x3118('0x45')]()[_0x3118('0x46')](function(){return parseModelFields(_0x365cfe,_0x35be3d);})[_0x3118('0x46')](function(_0x3271d2){_0x220cef[_0x3118('0x47')]['and'](_0x3271d2);return parseTagParameter(_0x365cfe[_0x3118('0x48')]);})['then'](function(_0x15c2f7){_0x220cef[_0x3118('0x3b')]['clause']['and'](_0x15c2f7);return parseSearchFilter(_0x365cfe[_0x3118('0x49')]);})[_0x3118('0x46')](function(_0x3bfd7e){_0x220cef['filter']=_0x3bfd7e;return _0x220cef;});}function checkListsRestrictions(_0x37acde,_0x4e94ba,_0x5b417d){var _0x7e129b=squel[_0x3118('0x20')]();return Promise['resolve']()[_0x3118('0x46')](function(){if(_0x4e94ba[_0x3118('0x4')]&&_0x37acde[_0x3118('0x4a')]===_0x3118('0x3')&&!_0x5b417d){return _0x37acde[_0x3118('0x4b')]({'attributes':['id'],'raw':!![]});}})[_0x3118('0x46')](function(_0x539740){if(_0x539740){if(_0x539740[_0x3118('0x23')]===0x0){_0x7e129b[_0x3118('0x3d')](_0x3118('0x4c'));}else{_0x7e129b[_0x3118('0x3d')](_0x3118('0x4d'),_[_0x3118('0x3a')](_0x539740,'id'));}}})['then'](function(){return _0x7e129b;});}function buildContactsQuery(_0x4032c2,_0x26bd24,_0x516759,_0x249d28,_0x99a39d,_0x50f058){if(_0x26bd24){_0x26bd24=_0x516759['attributes'];}_0x4032c2=addFieldsToQuery(_0x4032c2,_0x26bd24,_0x249d28,_0x50f058,!![]);var _0x1f85a1=squel[_0x3118('0x4e')]();_0x1f85a1=addFieldsToQuery(_0x1f85a1,_0x26bd24,_0x249d28,_0x50f058,![]);if(_0x249d28||_0x50f058){_0x4032c2=applyJoinClauses(_0x4032c2,!![]);_0x4032c2[_0x3118('0x4f')]('c.id');if(_0x516759[_0x3118('0x50')]){_0x1f85a1[_0x3118('0x50')](_0x516759[_0x3118('0x50')]);}if(_0x516759[_0x3118('0x51')]){_0x1f85a1[_0x3118('0x51')](_0x516759[_0x3118('0x51')]);}}else{_0x1f85a1=applyJoinClauses(_0x1f85a1,![]);_0x1f85a1[_0x3118('0x4f')](_0x3118('0x52'));if(_0x516759[_0x3118('0x50')]){_0x4032c2[_0x3118('0x50')](_0x516759[_0x3118('0x50')]);}if(_0x516759[_0x3118('0x51')]){_0x4032c2[_0x3118('0x51')](_0x516759[_0x3118('0x51')]);}}_0x1f85a1[_0x3118('0x53')](_0x99a39d);if(_0x516759[_0x3118('0x54')]){_0x516759[_0x3118('0x54')]['forEach'](function(_0x3c6b4f){_0x4032c2[_0x3118('0x54')]('c.'+_0x3c6b4f[0x0],_0x3c6b4f[0x1]===_0x3118('0x55')?![]:!![]);_0x1f85a1[_0x3118('0x54')](_0x3118('0x56')+_0x3c6b4f[0x0],_0x3c6b4f[0x1]===_0x3118('0x55')?![]:!![]);});}_0x1f85a1[_0x3118('0x8')](_0x4032c2,_0x3118('0xb'));return _0x1f85a1;}function getFilteredContacts(_0x5a28){var _0x1f4cf5=[];return db[_0x3118('0x38')][_0x3118('0x57')]({'attributes':['id','name',_0x3118('0x58')],'raw':!![]})[_0x3118('0x46')](function(_0x5600f3){_0x1f4cf5=_[_0x3118('0x59')](_0x5600f3,'id');var _0x5a7522={'type':db[_0x3118('0x5a')]['QueryTypes'][_0x3118('0x5b')],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x3118('0x5c')][_0x3118('0x5d')](_0x5a28[_0x3118('0x5e')](),_0x5a7522);})[_0x3118('0x46')](function(_0x40fa25){_0x40fa25['forEach'](function(_0x5f0b13){if(_0x5f0b13[_0x3118('0x1a')]){_0x5f0b13[_0x3118('0x5f')]=[];_0x5f0b13[_0x3118('0x1a')]['split'](',')[_0x3118('0x1d')](function(_0x1e7943){_0x5f0b13[_0x3118('0x5f')][_0x3118('0x1c')](_0x1f4cf5[_0x1e7943]);});}delete _0x5f0b13['TagIds'];});return _0x40fa25;});}function countFilteredContacts(_0x785fa4,_0x214857){var _0x331882=_0x785fa4[_0x3118('0x60')]();_0x331882[_0x3118('0x1e')](_0x3118('0x61'));_0x331882=applyJoinClauses(_0x331882,!![]);_0x785fa4[_0x3118('0x4f')](_0x3118('0x62'));var _0x421a2d=utils[_0x3118('0x63')](_0x214857);if(!_[_0x3118('0x64')](_0x421a2d)){_0x331882['where']('t.id\x20IN\x20?',_0x421a2d);}var _0x187a20={'type':db[_0x3118('0x5a')]['QueryTypes'][_0x3118('0x5b')],'raw':!![]};return db['sequelize']['query'](_0x331882[_0x3118('0x5e')](),_0x187a20)[_0x3118('0x46')](function(_0x348d6d){return _0x348d6d[0x0][_0x3118('0x61')];});}module[_0x3118('0x65')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0xc366=['search','ListId','true','select','from','cm_contacts','where','subqry','left_join','cm_user_has_contacts','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','phone','email','CompanyId','createdAt','updatedAt','deletedAt','TagIds','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','dateOfBirth','fieldType','datetime','castTo','buildExpression','type','default','text','value','start','Tag','map','tags','clause','and','ids','User','user','uc.UserId\x20=\x20?','skip','keys','some','name','compact','Contact','c.ListId\x20IN\x20?','concat','resolve','then','fields','tag','filter','getLists','c.ListId\x20IS\x20NULL','attributes','c.id','limit','offset','group','having','order','DESC','subqry.','findAll','color','keyBy','Sequelize','QueryTypes','sequelize','toString','Tags','clone','getSelectedTags','t.id\x20IN\x20?','SELECT','COUNT(*)','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../../mysqldb','role','agent'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc366,0x65));var _0x6c36=function(_0x16027d,_0x43be7c){_0x16027d=_0x16027d-0x0;var _0x1c72b5=_0xc366[_0x16027d];return _0x1c72b5;};'use strict';var _=require(_0x6c36('0x0'));var squel=require(_0x6c36('0x1'));var as=require(_0x6c36('0x2'));var qs=require(_0x6c36('0x3'));var utils=require('../interaction/utils');var db=require(_0x6c36('0x4'))['db'];function skipContactsQuery(_0x4242e9,_0x1a5cd0){var _0xeb44b3=![];if(_0x4242e9[_0x6c36('0x5')]===_0x6c36('0x6')&&!_0x1a5cd0[_0x6c36('0x7')]&&!_0x1a5cd0[_0x6c36('0x8')]&&_0x1a5cd0['autocomplete']!==_0x6c36('0x9')){_0xeb44b3=!![];}return _0xeb44b3;}function getContactsSubquery(){return squel[_0x6c36('0xa')]()[_0x6c36('0xb')](_0x6c36('0xc'),'c')[_0x6c36('0xd')]('c.deletedAt\x20IS\x20NULL');}function applyJoinClauses(_0xbdf060,_0x385d30){var _0x543d70=_0x385d30?'c':_0x6c36('0xe');_0xbdf060[_0x6c36('0xf')](_0x6c36('0x10'),'uc','uc.CmContactId\x20=\x20'+_0x543d70+_0x6c36('0x11'))['left_join'](_0x6c36('0x12'),'ct',_0x6c36('0x13')+_0x543d70+_0x6c36('0x11'))['left_join'](_0x6c36('0x14'),'t',_0x6c36('0x15'));return _0xbdf060;}function addFieldsToQuery(_0x5821f2,_0x2892fa,_0x3afd78,_0x3e58f0,_0x1942a6){var _0x34016b=_0x1942a6?'c':'subqry';if(!_0x2892fa){_0x2892fa=['id',_0x6c36('0x16'),_0x6c36('0x17'),_0x6c36('0x18'),'mobile','fax',_0x6c36('0x19'),_0x6c36('0x8'),_0x6c36('0x1a'),_0x6c36('0x1b'),_0x6c36('0x1c'),_0x6c36('0x1d'),_0x6c36('0x1e')];}else if(!_0x2892fa['includes']('id')){_0x2892fa['push']('id');}var _0x3ef849=_0x3afd78&&_0x1942a6||!_0x3afd78&&!_0x1942a6;if(_0x3e58f0){_0x3ef849=_0x3e58f0&&_0x1942a6||!_0x3e58f0&&!_0x1942a6;}_0x2892fa[_0x6c36('0x1f')](function(_0x44d098){if(_0x44d098===_0x6c36('0x1e')){if(_0x3ef849){_0x5821f2[_0x6c36('0x20')](_0x6c36('0x21'),_0x44d098);}else if(_0x3afd78||_0x3e58f0){_0x5821f2[_0x6c36('0x20')](_0x34016b+'.'+_0x44d098);}}else{_0x5821f2['field'](_0x34016b+'.'+_0x44d098);}});return _0x5821f2;}function getSqlClauses(){var _0x4c366c={'default':squel['expr'](),'fields':squel['expr'](),'filter':squel['expr'](),'tags':{'clause':squel[_0x6c36('0x22')](),'ids':null},'user':{'clause':squel[_0x6c36('0x22')](),'skip':![]}};return _0x4c366c;}function parseTagParameter(_0x1f7346){var _0x36f73f=squel[_0x6c36('0x22')]();if(_0x1f7346){var _0x185bb6=utils['getSelectedTags'](_0x1f7346);_0x185bb6[_0x6c36('0x1f')](function(_0x1ba039){_0x36f73f['or'](_0x6c36('0x23'),'%,'+_0x1ba039+',%');});}return _0x36f73f;}function parseSearchFilter(_0x4fc3f3){var _0x11ebda=squel[_0x6c36('0x22')]();if(_0x4fc3f3){var _0x29121f=_0x4fc3f3[_0x6c36('0x24')]('\x5c','\x5c\x5c')[_0x6c36('0x24')](/'/g,'\x27\x27');if(_0x29121f[_0x6c36('0x25')]('\x20')[_0x6c36('0x26')]>0x1){_0x11ebda['or'](_0x6c36('0x27'),qs[_0x6c36('0x28')](_0x29121f,!![]),null);}else{if(qs[_0x6c36('0x29')](_0x29121f)){_0x11ebda['or']('c.id\x20LIKE\x20?',_0x29121f+'%');_0x11ebda['or'](_0x6c36('0x2a'),_0x29121f+'%');_0x11ebda['or'](_0x6c36('0x2b'),_0x29121f+'%');_0x11ebda['or'](_0x6c36('0x2c'),_0x29121f+'%');}else if(qs[_0x6c36('0x2d')](_0x29121f)){_0x11ebda['or'](_0x6c36('0x2e'),_0x29121f+'%');}else{_0x11ebda['or']('c.firstName\x20LIKE\x20?','%'+_0x29121f+'%');_0x11ebda['or']('c.lastName\x20LIKE\x20?','%'+_0x29121f+'%');_0x11ebda['or']('c.email\x20LIKE\x20?','%'+_0x29121f+'%');}}}return _0x11ebda;}function parseAdvancedSearchFilter(_0x5d2583,_0x2e0bd7){var _0x1feb26=getSqlClauses();var _0x598e5b=as[_0x6c36('0x2f')](_0x5d2583);var _0x75deb0=_0x598e5b[_0x6c36('0x30')];for(var _0x49c667=0x0;_0x49c667<_0x598e5b[_0x6c36('0x31')][_0x6c36('0x26')];_0x49c667++){var _0x2cc3c1=_0x598e5b['conditions'][_0x49c667];var _0x8c1a04='c';var _0x44ab9f=_[_0x6c36('0x32')](_0x2e0bd7,['name',_0x2cc3c1['field']]);if(_0x44ab9f){if(_0x2cc3c1['field']===_0x6c36('0x33')||_0x44ab9f[_0x6c36('0x34')]===_0x6c36('0x35')){_0x2cc3c1[_0x6c36('0x36')]='DATE';}var _0x2ed2cc=as[_0x6c36('0x37')](_0x8c1a04,_0x44ab9f[_0x6c36('0x38')],_0x2cc3c1);_0x1feb26[_0x6c36('0x39')][_0x75deb0](_0x2ed2cc[_0x6c36('0x3a')],_0x2ed2cc[_0x6c36('0x3b')][_0x6c36('0x3c')],_0x2ed2cc[_0x6c36('0x3b')]['end']);}else{if(_0x2cc3c1['field']===_0x6c36('0x3d')){var _0x3e4c22=_0x2cc3c1[_0x6c36('0x3b')][_0x6c36('0x25')](',')[_0x6c36('0x3e')](function(_0x3d5a65){return Number(_0x3d5a65);});var _0x28c929=parseTagParameter(_0x3e4c22);_0x1feb26[_0x6c36('0x3f')][_0x6c36('0x40')][_0x6c36('0x41')](_0x28c929);_0x1feb26[_0x6c36('0x3f')][_0x6c36('0x42')]=_0x3e4c22;}else if(_0x2cc3c1[_0x6c36('0x20')]===_0x6c36('0x43')){_0x1feb26[_0x6c36('0x44')][_0x6c36('0x40')]['and'](_0x6c36('0x45'),_0x2cc3c1['value']);_0x1feb26[_0x6c36('0x44')][_0x6c36('0x46')]=!![];}}}return _0x1feb26;}function parseModelFields(_0x1228fb,_0x1e7ee8){var _0x286c7d=squel[_0x6c36('0x22')]();var _0x353f50=_(_0x1228fb)[_0x6c36('0x47')]()[_0x6c36('0x3e')](function(_0x352b5b){return _[_0x6c36('0x48')](_0x1e7ee8,[_0x6c36('0x49'),_0x352b5b])?_0x352b5b:undefined;})[_0x6c36('0x4a')]()[_0x6c36('0x3b')]();if(_0x1228fb['Contact']){_0x353f50['push'](_0x6c36('0x4b'));}if(_0x1228fb[_0x6c36('0x43')]){_0x353f50['push'](_0x6c36('0x43'));}if(_0x353f50[_0x6c36('0x26')]>0x0){_0x353f50[_0x6c36('0x1f')](function(_0x35ca0c){if(_0x35ca0c===_0x6c36('0x8')){_0x286c7d[_0x6c36('0x41')](_0x6c36('0x4c'),[][_0x6c36('0x4d')](_0x1228fb[_0x35ca0c]));}else if(_0x35ca0c===_0x6c36('0x4b')){var _0x750857='%'+_0x1228fb[_0x35ca0c]+'%';_0x286c7d['and']('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x750857);}else if(_0x35ca0c==='User'){_0x286c7d[_0x6c36('0x41')](_0x6c36('0x45'),_0x1228fb[_0x35ca0c]);}else{_0x286c7d[_0x6c36('0x41')]('c.'+_0x35ca0c+'\x20=\x20?',_0x1228fb[_0x35ca0c]);}});}return _0x286c7d;}function parseQueryParameters(_0x4fd530,_0x416640){var _0x5267ee=getSqlClauses();return Promise[_0x6c36('0x4e')]()[_0x6c36('0x4f')](function(){return parseModelFields(_0x4fd530,_0x416640);})[_0x6c36('0x4f')](function(_0x16fd88){_0x5267ee[_0x6c36('0x50')][_0x6c36('0x41')](_0x16fd88);return parseTagParameter(_0x4fd530[_0x6c36('0x51')]);})[_0x6c36('0x4f')](function(_0x8c002b){_0x5267ee[_0x6c36('0x3f')][_0x6c36('0x40')][_0x6c36('0x41')](_0x8c002b);return parseSearchFilter(_0x4fd530[_0x6c36('0x52')]);})['then'](function(_0x3c6158){_0x5267ee['filter']=_0x3c6158;return _0x5267ee;});}function checkListsRestrictions(_0x30c31b,_0x5c6a6d,_0x1cb1db){var _0x4dcac9=squel['expr']();return Promise[_0x6c36('0x4e')]()[_0x6c36('0x4f')](function(){if(_0x5c6a6d['search']&&_0x30c31b['role']==='agent'&&!_0x1cb1db){return _0x30c31b[_0x6c36('0x53')]({'attributes':['id'],'raw':!![]});}})[_0x6c36('0x4f')](function(_0x1b1771){if(_0x1b1771){if(_0x1b1771[_0x6c36('0x26')]===0x0){_0x4dcac9['and'](_0x6c36('0x54'));}else{_0x4dcac9['and']('c.ListId\x20IN\x20?',_['map'](_0x1b1771,'id'));}}})[_0x6c36('0x4f')](function(){return _0x4dcac9;});}function buildContactsQuery(_0x1f9b6f,_0x44f660,_0x2039b3,_0x5799a9,_0x3e6b12,_0x5e77b){if(_0x44f660){_0x44f660=_0x2039b3[_0x6c36('0x55')];}_0x1f9b6f=addFieldsToQuery(_0x1f9b6f,_0x44f660,_0x5799a9,_0x5e77b,!![]);var _0x1481d2=squel[_0x6c36('0xa')]();_0x1481d2=addFieldsToQuery(_0x1481d2,_0x44f660,_0x5799a9,_0x5e77b,![]);if(_0x5799a9||_0x5e77b){_0x1f9b6f=applyJoinClauses(_0x1f9b6f,!![]);_0x1f9b6f['group'](_0x6c36('0x56'));if(_0x2039b3['limit']){_0x1481d2[_0x6c36('0x57')](_0x2039b3[_0x6c36('0x57')]);}if(_0x2039b3[_0x6c36('0x58')]){_0x1481d2[_0x6c36('0x58')](_0x2039b3[_0x6c36('0x58')]);}}else{_0x1481d2=applyJoinClauses(_0x1481d2,![]);_0x1481d2[_0x6c36('0x59')]('subqry.id');if(_0x2039b3[_0x6c36('0x57')]){_0x1f9b6f[_0x6c36('0x57')](_0x2039b3['limit']);}if(_0x2039b3[_0x6c36('0x58')]){_0x1f9b6f['offset'](_0x2039b3[_0x6c36('0x58')]);}}_0x1481d2[_0x6c36('0x5a')](_0x3e6b12);if(_0x2039b3[_0x6c36('0x5b')]){_0x2039b3[_0x6c36('0x5b')]['forEach'](function(_0x396fa1){_0x1f9b6f[_0x6c36('0x5b')]('c.'+_0x396fa1[0x0],_0x396fa1[0x1]===_0x6c36('0x5c')?![]:!![]);_0x1481d2['order'](_0x6c36('0x5d')+_0x396fa1[0x0],_0x396fa1[0x1]===_0x6c36('0x5c')?![]:!![]);});}_0x1481d2[_0x6c36('0xb')](_0x1f9b6f,'subqry');return _0x1481d2;}function getFilteredContacts(_0x2c3b15){var _0x2a776b=[];return db['Tag'][_0x6c36('0x5e')]({'attributes':['id','name',_0x6c36('0x5f')],'raw':!![]})['then'](function(_0xeb0130){_0x2a776b=_[_0x6c36('0x60')](_0xeb0130,'id');var _0xd234c7={'type':db[_0x6c36('0x61')][_0x6c36('0x62')]['SELECT'],'model':db['CmContact'],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x6c36('0x63')]['query'](_0x2c3b15[_0x6c36('0x64')](),_0xd234c7);})['then'](function(_0xfc3567){_0xfc3567[_0x6c36('0x1f')](function(_0x27f5e6){if(_0x27f5e6[_0x6c36('0x1e')]){_0x27f5e6[_0x6c36('0x65')]=[];_0x27f5e6[_0x6c36('0x1e')][_0x6c36('0x25')](',')[_0x6c36('0x1f')](function(_0x397baf){_0x27f5e6[_0x6c36('0x65')]['push'](_0x2a776b[_0x397baf]);});}delete _0x27f5e6['TagIds'];});return _0xfc3567;});}function countFilteredContacts(_0x43817f,_0x4e59ed){var _0x568a63=_0x43817f[_0x6c36('0x66')]();_0x568a63[_0x6c36('0x20')]('COUNT(*)');_0x568a63=applyJoinClauses(_0x568a63,!![]);_0x43817f['group'](_0x6c36('0x56'));var _0x57a756=utils[_0x6c36('0x67')](_0x4e59ed);if(!_['isEmpty'](_0x57a756)){_0x568a63[_0x6c36('0xd')](_0x6c36('0x68'),_0x57a756);}var _0x1f22d4={'type':db[_0x6c36('0x61')][_0x6c36('0x62')][_0x6c36('0x69')],'raw':!![]};return db[_0x6c36('0x63')]['query'](_0x568a63[_0x6c36('0x64')](),_0x1f22d4)[_0x6c36('0x4f')](function(_0x5c6897){return _0x5c6897[0x0][_0x6c36('0x6a')];});}module[_0x6c36('0x6b')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index a7bb785..970de26 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 _0xbf5f=['update','binary','write','end','final','close','unlink','decryptFile','createReadStream','createDecipher','encryptString','createCipher','base64','secret','utf8','crypto','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','indexOf','hasOwnProperty','encryptFile','createWriteStream','data'];(function(_0x9e1c1a,_0x329c91){var _0x4ae1a1=function(_0x1a2006){while(--_0x1a2006){_0x9e1c1a['push'](_0x9e1c1a['shift']());}};_0x4ae1a1(++_0x329c91);}(_0xbf5f,0x19b));var _0xfbf5=function(_0x24a0c9,_0x4fd67e){_0x24a0c9=_0x24a0c9-0x0;var _0x2902a8=_0xbf5f[_0x24a0c9];return _0x2902a8;};'use strict';var crypto=require(_0xfbf5('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xfbf5('0x1'));var config=require(_0xfbf5('0x2'));var logger=require(_0xfbf5('0x3'))(_0xfbf5('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xfbf5('0x5')][_0xfbf5('0x6')],'algorithm':_0xfbf5('0x7')};const fileOptions={'algorithm':_0xfbf5('0x8')};if(config['encrypt']&&config[_0xfbf5('0x9')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0xfbf5('0x9')][_0xfbf5('0xa')]);if(isSupported){fileOptions[_0xfbf5('0xa')]=config[_0xfbf5('0x9')][_0xfbf5('0xa')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xfbf5('0xb')](',\x20');logger[_0xfbf5('0xc')](config[_0xfbf5('0x9')]['algorithm'],_0xfbf5('0xd'),supportedAlgorithms);}}function isASupportedCipher(_0x10e900){return AES_SUPPORTED_RX[_0xfbf5('0xe')](_0x10e900);}function getSupportedCiphers(){return crypto['getCiphers']()[_0xfbf5('0xf')](isASupportedCipher);}function isAlgorithmSupported(_0x13f022){return getSupportedCiphers()[_0xfbf5('0x10')](_0x13f022)>-0x1;}function combineOptions(_0x5af634){var _0x3ddb77={};for(var _0x5926c4 in fileOptions){if(fileOptions['hasOwnProperty'](_0x5926c4)){_0x3ddb77[_0x5926c4]=fileOptions[_0x5926c4];}}if(_0x5af634){for(var _0x2b1509 in _0x5af634){if(_0x5af634[_0xfbf5('0x11')](_0x2b1509)){_0x3ddb77[_0x2b1509]=_0x5af634[_0x2b1509];}}}return _0x3ddb77;}exports[_0xfbf5('0x12')]=function(_0x511563,_0x370440,_0x36c644,_0x388887){return new BPromise(function(_0x1666c2,_0x44a12c){_0x388887=combineOptions(_0x388887);var _0x111de3=new Buffer(_0x36c644);var _0x5604c4=fs['createReadStream'](_0x511563);var _0x1305b5=fs[_0xfbf5('0x13')](_0x370440);var _0x54f0e9=crypto['createCipher'](_0x388887[_0xfbf5('0xa')],_0x111de3);_0x5604c4['on'](_0xfbf5('0x14'),function(_0x366919){var _0x5402ae=new Buffer(_0x54f0e9[_0xfbf5('0x15')](_0x366919),_0xfbf5('0x16'));_0x1305b5[_0xfbf5('0x17')](_0x5402ae);});_0x5604c4['on'](_0xfbf5('0x18'),function(){try{var _0x13f185=new Buffer(_0x54f0e9[_0xfbf5('0x19')]('binary'),_0xfbf5('0x16'));_0x1305b5[_0xfbf5('0x17')](_0x13f185);_0x1305b5[_0xfbf5('0x18')]();_0x1305b5['on'](_0xfbf5('0x1a'),function(){return _0x1666c2(_0x370440);});}catch(_0x40ce8e){fs[_0xfbf5('0x1b')](_0x370440);return _0x44a12c(_0x40ce8e);}});});};exports[_0xfbf5('0x1c')]=function(_0x3c3cc0,_0x3050f3,_0x41bb,_0x444ace){return new BPromise(function(_0x5f298c,_0x323ad8){_0x444ace=combineOptions(_0x444ace);var _0x118429=new Buffer(_0x41bb);var _0xbd00de=fs[_0xfbf5('0x1d')](_0x3c3cc0);var _0x12a570=fs[_0xfbf5('0x13')](_0x3050f3);var _0x2f0073=crypto[_0xfbf5('0x1e')](_0x444ace[_0xfbf5('0xa')],_0x118429);_0xbd00de['on'](_0xfbf5('0x14'),function(_0x2f5c1e){var _0x14f86d=new Buffer(_0x2f0073[_0xfbf5('0x15')](_0x2f5c1e),_0xfbf5('0x16'));_0x12a570['write'](_0x14f86d);});_0xbd00de['on']('end',function(){try{var _0x51d897=new Buffer(_0x2f0073[_0xfbf5('0x19')]('binary'),_0xfbf5('0x16'));_0x12a570[_0xfbf5('0x17')](_0x51d897);_0x12a570[_0xfbf5('0x18')]();_0x12a570['on'](_0xfbf5('0x1a'),function(){return _0x5f298c(_0x3050f3);});}catch(_0x1cd6a3){fs[_0xfbf5('0x1b')](_0x3050f3);return _0x323ad8(_0x1cd6a3);}});});};exports[_0xfbf5('0x1f')]=function(_0x5bfe24,_0x447ea1,_0x3ecc48){var _0xdf0e84=_0x3ecc48||stringOptions[_0xfbf5('0xa')];var _0x903377=_0x447ea1||stringOptions['secret'];var _0x403706=crypto[_0xfbf5('0x20')](_0xdf0e84,_0x903377);var _0x3f825b=_0x403706[_0xfbf5('0x15')](_0x5bfe24,'utf8',_0xfbf5('0x21'));_0x3f825b+=_0x403706[_0xfbf5('0x19')]('base64');return _0x3f825b;};exports['decryptString']=function(_0x59aae4,_0x3130cc,_0x377c94){var _0xd0d669=_0x377c94||stringOptions[_0xfbf5('0xa')];var _0x4c249f=_0x3130cc||stringOptions[_0xfbf5('0x22')];var _0x602bdb=crypto[_0xfbf5('0x1e')](_0xd0d669,_0x4c249f);var _0x4ae725=_0x602bdb[_0xfbf5('0x15')](_0x59aae4,_0xfbf5('0x21'),_0xfbf5('0x23'));_0x4ae725+=_0x602bdb[_0xfbf5('0x19')](_0xfbf5('0x23'));return _0x4ae725;}; \ No newline at end of file +var _0xb695=['test','filter','hasOwnProperty','encryptFile','createReadStream','createWriteStream','data','update','binary','write','end','unlink','decryptFile','createDecipher','final','close','secret','utf8','base64','decryptString','crypto','bluebird','lodash','app','session','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:'];(function(_0x578f1f,_0x1e7c32){var _0x31e4e1=function(_0x3d5a77){while(--_0x3d5a77){_0x578f1f['push'](_0x578f1f['shift']());}};_0x31e4e1(++_0x1e7c32);}(_0xb695,0x1a7));var _0x5b69=function(_0xf2f347,_0x22d5a7){_0xf2f347=_0xf2f347-0x0;var _0x37a440=_0xb695[_0xf2f347];return _0x37a440;};'use strict';var crypto=require(_0x5b69('0x0'));var fs=require('fs');var BPromise=require(_0x5b69('0x1'));var _=require(_0x5b69('0x2'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x5b69('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets'][_0x5b69('0x4')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x5b69('0x5')};if(config[_0x5b69('0x6')]&&config[_0x5b69('0x6')][_0x5b69('0x7')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x5b69('0x7')]);if(isSupported){fileOptions[_0x5b69('0x7')]=config[_0x5b69('0x6')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x5b69('0x8')](',\x20');logger[_0x5b69('0x9')](config[_0x5b69('0x6')][_0x5b69('0x7')],_0x5b69('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x22e478){return AES_SUPPORTED_RX[_0x5b69('0xb')](_0x22e478);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x5b69('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x2fce25){return getSupportedCiphers()['indexOf'](_0x2fce25)>-0x1;}function combineOptions(_0x98a90d){var _0x372d6={};for(var _0x53c116 in fileOptions){if(fileOptions[_0x5b69('0xd')](_0x53c116)){_0x372d6[_0x53c116]=fileOptions[_0x53c116];}}if(_0x98a90d){for(var _0x5d707c in _0x98a90d){if(_0x98a90d[_0x5b69('0xd')](_0x5d707c)){_0x372d6[_0x5d707c]=_0x98a90d[_0x5d707c];}}}return _0x372d6;}exports[_0x5b69('0xe')]=function(_0x56b951,_0x3eba40,_0x562392,_0x4dd123){return new BPromise(function(_0x3afd2b,_0x47a89c){_0x4dd123=combineOptions(_0x4dd123);var _0x281d63=new Buffer(_0x562392);var _0x25652a=fs[_0x5b69('0xf')](_0x56b951);var _0x26e4b8=fs[_0x5b69('0x10')](_0x3eba40);var _0x3f3ba5=crypto['createCipher'](_0x4dd123[_0x5b69('0x7')],_0x281d63);_0x25652a['on'](_0x5b69('0x11'),function(_0x2a2ee0){var _0x5293be=new Buffer(_0x3f3ba5[_0x5b69('0x12')](_0x2a2ee0),_0x5b69('0x13'));_0x26e4b8[_0x5b69('0x14')](_0x5293be);});_0x25652a['on'](_0x5b69('0x15'),function(){try{var _0x139783=new Buffer(_0x3f3ba5['final'](_0x5b69('0x13')),_0x5b69('0x13'));_0x26e4b8[_0x5b69('0x14')](_0x139783);_0x26e4b8['end']();_0x26e4b8['on']('close',function(){return _0x3afd2b(_0x3eba40);});}catch(_0x376233){fs[_0x5b69('0x16')](_0x3eba40);return _0x47a89c(_0x376233);}});});};exports[_0x5b69('0x17')]=function(_0x532e51,_0x2d269e,_0x1850d0,_0x2f9940){return new BPromise(function(_0x527491,_0x5ebcb8){_0x2f9940=combineOptions(_0x2f9940);var _0x3ec19c=new Buffer(_0x1850d0);var _0xf87693=fs[_0x5b69('0xf')](_0x532e51);var _0x2637c4=fs[_0x5b69('0x10')](_0x2d269e);var _0x1bbbc9=crypto[_0x5b69('0x18')](_0x2f9940[_0x5b69('0x7')],_0x3ec19c);_0xf87693['on'](_0x5b69('0x11'),function(_0x282f26){var _0xcb4f52=new Buffer(_0x1bbbc9[_0x5b69('0x12')](_0x282f26),_0x5b69('0x13'));_0x2637c4[_0x5b69('0x14')](_0xcb4f52);});_0xf87693['on'](_0x5b69('0x15'),function(){try{var _0x5b1a2d=new Buffer(_0x1bbbc9[_0x5b69('0x19')](_0x5b69('0x13')),'binary');_0x2637c4[_0x5b69('0x14')](_0x5b1a2d);_0x2637c4[_0x5b69('0x15')]();_0x2637c4['on'](_0x5b69('0x1a'),function(){return _0x527491(_0x2d269e);});}catch(_0x58ae2e){fs[_0x5b69('0x16')](_0x2d269e);return _0x5ebcb8(_0x58ae2e);}});});};exports['encryptString']=function(_0x3dead6,_0x13948d,_0x33c35e){var _0x3413bf=_0x33c35e||stringOptions[_0x5b69('0x7')];var _0x221e65=_0x13948d||stringOptions[_0x5b69('0x1b')];var _0x10600c=crypto['createCipher'](_0x3413bf,_0x221e65);var _0x4de9c2=_0x10600c[_0x5b69('0x12')](_0x3dead6,_0x5b69('0x1c'),_0x5b69('0x1d'));_0x4de9c2+=_0x10600c[_0x5b69('0x19')](_0x5b69('0x1d'));return _0x4de9c2;};exports[_0x5b69('0x1e')]=function(_0xdc327c,_0x71433d,_0x4aac69){var _0x479f20=_0x4aac69||stringOptions['algorithm'];var _0x37c2ad=_0x71433d||stringOptions[_0x5b69('0x1b')];var _0x535892=crypto['createDecipher'](_0x479f20,_0x37c2ad);var _0x3e4317=_0x535892[_0x5b69('0x12')](_0xdc327c,'base64',_0x5b69('0x1c'));_0x3e4317+=_0x535892[_0x5b69('0x19')]('utf8');return _0x3e4317;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 21c7f6c..acc376c 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 _0x0660=['length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.csv','split','join','each','%s%d.%s','csv','%s.%s','writeFileSync','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','catch','inspect','Failed','exit','util','path','lodash','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','then','splitSizeCsv','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0x0660,0x1bd));var _0x0066=function(_0x284a10,_0x302410){_0x284a10=_0x284a10-0x0;var _0x33557a=_0x0660[_0x284a10];return _0x33557a;};'use strict';var util=require(_0x0066('0x0'));var path=require(_0x0066('0x1'));var _=require(_0x0066('0x2'));var csv=require('to-csv');var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x0066('0x3'));var rimraf=require(_0x0066('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0x0066('0x5'))[_0x0066('0x6')];var logger=require(_0x0066('0x7'))(_0x0066('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x0066('0x9')][0x2]);var QUERY=process[_0x0066('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3c1a03,_0x21de20){var _0x1acc73={'status':_0x3c1a03};var _0x35983d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x21de20){_0x1acc73['savename']=_0x21de20;}return db[_0x0066('0xa')][_0x0066('0xb')](_0x1acc73,_0x35983d);}function main(){var _0x6647a9=0x1388;var _0x41f4e9;logger[_0x0066('0xc')](util[_0x0066('0xd')](_0x0066('0xe'),EXTRACTED_REPORT_ID,'CSV'));return db['Setting'][_0x0066('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeCsv']})[_0x0066('0x10')](function(_0x499c13){if(_0x499c13){_0x41f4e9=_0x499c13;_0x6647a9=_0x41f4e9[_0x0066('0x11')]||0x1388;}})['then'](function(){return dbH[_0x0066('0x12')][_0x0066('0x13')](util[_0x0066('0xd')](_0x0066('0x14'),QUERY),{'type':dbH['sequelize'][_0x0066('0x15')][_0x0066('0x16')]});})[_0x0066('0x10')](function(_0x584ac7){if(!_0x584ac7[0x0][_0x0066('0x17')]){return analyticExtractedReport(_0x0066('0x18'));}var _0x14dde4=[];var _0xed4c53=0x0;if(_0x41f4e9['split']){if(_0x584ac7&&_0x584ac7[_0x0066('0x19')]){var _0x290b94=_[_0x0066('0x1a')](_0x584ac7[0x0][_0x0066('0x17')]/_0x6647a9);var _0x1c5c93=Number[_0x0066('0x1b')](_0x584ac7[0x0]['num']/_0x6647a9)?_0x584ac7[0x0][_0x0066('0x17')]%_0x6647a9:0x0;_0x290b94[_0x0066('0x1c')](function(_0x4e86bc){if(_0x4e86bc>0x0){_0xed4c53+=_0x6647a9;}_0x14dde4[_0x0066('0x1d')](dbH[_0x0066('0x12')][_0x0066('0x13')](util[_0x0066('0xd')](_0x0066('0x1e'),QUERY,_0x6647a9,_0xed4c53),{'type':dbH[_0x0066('0x12')][_0x0066('0x15')][_0x0066('0x16')]}));});if(_0x1c5c93>0x0){_0xed4c53+=_0x6647a9;_0x14dde4[_0x0066('0x1d')](dbH['sequelize'][_0x0066('0x13')](util[_0x0066('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x1c5c93,_0xed4c53),{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}}else{_0x14dde4[_0x0066('0x1d')](dbH[_0x0066('0x12')][_0x0066('0x13')](QUERY,{'type':dbH[_0x0066('0x12')][_0x0066('0x15')][_0x0066('0x16')]}));}var _0x18d8ac=path['dirname'](PATH);var _0x4315bf=path[_0x0066('0x1f')](PATH,_0x0066('0x20'));var _0x5ba9ec=_0x41f4e9[_0x0066('0x21')]&&_0x14dde4['length']>0x1;var _0xebaf36=[];if(!fs['existsSync'](path[_0x0066('0x22')](_0x18d8ac,_0x4315bf))&&_0x5ba9ec){fs['mkdirSync'](path[_0x0066('0x22')](_0x18d8ac,_0x4315bf));}return BPromise[_0x0066('0x23')](_0x14dde4,function(_0x2b69d9){_0xebaf36[_0x0066('0x1d')](_0x2b69d9);})[_0x0066('0x10')](function(){for(var _0xb7b220=0x0;_0xb7b220<_0xebaf36[_0x0066('0x19')];_0xb7b220+=0x1){var _0x10b3ef;var _0xc325d2=_0xebaf36[_0xb7b220];if(_0x5ba9ec){_0x10b3ef=path[_0x0066('0x22')](_0x18d8ac,_0x4315bf,util['format'](_0x0066('0x24'),_0x4315bf,_0xb7b220,_0x0066('0x25')));}else{_0x10b3ef=path['join'](_0x18d8ac,util[_0x0066('0xd')](_0x0066('0x26'),_0x4315bf,_0x0066('0x25')));}fs[_0x0066('0x27')](_0x10b3ef,csv(_0xc325d2));}})[_0x0066('0x10')](function(){if(_0x5ba9ec){return new Promise(function(_0x530b9b){zipdir(path[_0x0066('0x22')](_0x18d8ac,_0x4315bf),{'saveTo':path[_0x0066('0x22')](_0x18d8ac,util[_0x0066('0xd')](_0x0066('0x26'),_0x4315bf,_0x0066('0x28')))},function(_0x33f123,_0x25c2c2){rimraf(path[_0x0066('0x22')](_0x18d8ac,_0x4315bf),function(){});_0x530b9b('zip\x20finished');});});}})['then'](function(){logger['info'](util[_0x0066('0xd')](_0x0066('0x29'),EXTRACTED_REPORT_ID,_0x0066('0x2a')));return analyticExtractedReport('Completed',_0x5ba9ec?util['format'](_0x0066('0x26'),_0x4315bf,_0x5ba9ec?'zip':_0x0066('0x25')):null);});})[_0x0066('0x2b')](function(_0x32940e){logger[_0x0066('0xc')](util[_0x0066('0xd')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'),util[_0x0066('0x2c')](_0x32940e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x0066('0x2d'));})['finally'](function(){process[_0x0066('0x2e')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xcaa9=['exit','util','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','csv','writeFileSync','zip','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','Failed','finally'];(function(_0x12387e,_0x4a34f2){var _0x50657c=function(_0x44dfb5){while(--_0x44dfb5){_0x12387e['push'](_0x12387e['shift']());}};_0x50657c(++_0x4a34f2);}(_0xcaa9,0x65));var _0x9caa=function(_0x13a585,_0x3bf10d){_0x13a585=_0x13a585-0x0;var _0x459345=_0xcaa9[_0x13a585];return _0x459345;};'use strict';var util=require(_0x9caa('0x0'));var path=require(_0x9caa('0x1'));var _=require(_0x9caa('0x2'));var csv=require(_0x9caa('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x9caa('0x4'));var rimraf=require(_0x9caa('0x5'));var db=require(_0x9caa('0x6'))['db'];var dbH=require(_0x9caa('0x6'))[_0x9caa('0x7')];var logger=require(_0x9caa('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x9caa('0x9')][0x2]);var QUERY=process[_0x9caa('0x9')][0x3];var PATH=process[_0x9caa('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x37f928,_0x982a94){var _0x400b6c={'status':_0x37f928};var _0xb72913={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x982a94){_0x400b6c['savename']=_0x982a94;}return db[_0x9caa('0xa')]['update'](_0x400b6c,_0xb72913);}function main(){var _0x5f46fc=0x1388;var _0x47d24b;logger['info'](util[_0x9caa('0xb')](_0x9caa('0xc'),EXTRACTED_REPORT_ID,_0x9caa('0xd')));return db[_0x9caa('0xe')][_0x9caa('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x9caa('0x10'),_0x9caa('0x11')]})[_0x9caa('0x12')](function(_0x5524e6){if(_0x5524e6){_0x47d24b=_0x5524e6;_0x5f46fc=_0x47d24b[_0x9caa('0x11')]||0x1388;}})[_0x9caa('0x12')](function(){return dbH[_0x9caa('0x13')][_0x9caa('0x14')](util[_0x9caa('0xb')](_0x9caa('0x15'),QUERY),{'type':dbH[_0x9caa('0x13')][_0x9caa('0x16')][_0x9caa('0x17')]});})['then'](function(_0xdc3267){if(!_0xdc3267[0x0][_0x9caa('0x18')]){return analyticExtractedReport(_0x9caa('0x19'));}var _0x168a31=[];var _0x5ac9b7=0x0;if(_0x47d24b['split']){if(_0xdc3267&&_0xdc3267[_0x9caa('0x1a')]){var _0x5f13c9=_[_0x9caa('0x1b')](_0xdc3267[0x0][_0x9caa('0x18')]/_0x5f46fc);var _0x5f48f5=Number[_0x9caa('0x1c')](_0xdc3267[0x0][_0x9caa('0x18')]/_0x5f46fc)?_0xdc3267[0x0][_0x9caa('0x18')]%_0x5f46fc:0x0;_0x5f13c9[_0x9caa('0x1d')](function(_0x54fcf1){if(_0x54fcf1>0x0){_0x5ac9b7+=_0x5f46fc;}_0x168a31[_0x9caa('0x1e')](dbH[_0x9caa('0x13')][_0x9caa('0x14')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5f46fc,_0x5ac9b7),{'type':dbH[_0x9caa('0x13')][_0x9caa('0x16')]['SELECT']}));});if(_0x5f48f5>0x0){_0x5ac9b7+=_0x5f46fc;_0x168a31[_0x9caa('0x1e')](dbH[_0x9caa('0x13')]['query'](util['format'](_0x9caa('0x1f'),QUERY,_0x5f48f5,_0x5ac9b7),{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}}else{_0x168a31['push'](dbH[_0x9caa('0x13')][_0x9caa('0x14')](QUERY,{'type':dbH[_0x9caa('0x13')][_0x9caa('0x16')][_0x9caa('0x17')]}));}var _0x137f50=path['dirname'](PATH);var _0x285ce4=path['basename'](PATH,'.csv');var _0x3884ec=_0x47d24b[_0x9caa('0x10')]&&_0x168a31[_0x9caa('0x1a')]>0x1;var _0x210144=[];if(!fs[_0x9caa('0x20')](path[_0x9caa('0x21')](_0x137f50,_0x285ce4))&&_0x3884ec){fs[_0x9caa('0x22')](path[_0x9caa('0x21')](_0x137f50,_0x285ce4));}return BPromise[_0x9caa('0x23')](_0x168a31,function(_0x92978b){_0x210144[_0x9caa('0x1e')](_0x92978b);})[_0x9caa('0x12')](function(){for(var _0xb8441b=0x0;_0xb8441b<_0x210144['length'];_0xb8441b+=0x1){var _0x2f2af5;var _0x53c7f5=_0x210144[_0xb8441b];if(_0x3884ec){_0x2f2af5=path['join'](_0x137f50,_0x285ce4,util[_0x9caa('0xb')](_0x9caa('0x24'),_0x285ce4,_0xb8441b,'csv'));}else{_0x2f2af5=path[_0x9caa('0x21')](_0x137f50,util[_0x9caa('0xb')](_0x9caa('0x25'),_0x285ce4,_0x9caa('0x26')));}fs[_0x9caa('0x27')](_0x2f2af5,csv(_0x53c7f5));}})['then'](function(){if(_0x3884ec){return new Promise(function(_0x43496d){zipdir(path['join'](_0x137f50,_0x285ce4),{'saveTo':path['join'](_0x137f50,util[_0x9caa('0xb')](_0x9caa('0x25'),_0x285ce4,_0x9caa('0x28')))},function(_0xfe6b3f,_0xa067ec){rimraf(path['join'](_0x137f50,_0x285ce4),function(){});_0x43496d('zip\x20finished');});});}})['then'](function(){logger[_0x9caa('0x29')](util[_0x9caa('0xb')](_0x9caa('0x2a'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x9caa('0x2b'),_0x3884ec?util[_0x9caa('0xb')](_0x9caa('0x25'),_0x285ce4,_0x3884ec?_0x9caa('0x28'):_0x9caa('0x26')):null);});})[_0x9caa('0x2c')](function(_0x4e67e0){logger['info'](util['format'](_0x9caa('0x2d'),EXTRACTED_REPORT_ID,_0x9caa('0xd')),util[_0x9caa('0x2e')](_0x4e67e0,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x9caa('0x2f'));})[_0x9caa('0x30')](function(){process[_0x9caa('0x31')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 9cf7df6..4b407ec 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 _0x0ced=['findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','end','createPdfFromHTML','lodash','util','path','zip-dir','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','tableHeader','map','pick','toString','value','auto','body','concat','chunk','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','length','push','header','pageBreak','before','margin','landscape','footer','Arial','black','right','num','split','splitSizePdf','then','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.pdf','existsSync','mkdirSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF'];(function(_0x424501,_0x42096d){var _0xb719af=function(_0x37adcf){while(--_0x37adcf){_0x424501['push'](_0x424501['shift']());}};_0xb719af(++_0x42096d);}(_0x0ced,0x72));var _0xd0ce=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x0ced[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0xd0ce('0x0'));var fs=require('fs');var util=require(_0xd0ce('0x1'));var path=require(_0xd0ce('0x2'));var moment=require('moment');var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xd0ce('0x3'));var rimraf=require('rimraf');var JSDOM=require(_0xd0ce('0x4'))[_0xd0ce('0x5')];var window=new JSDOM('')[_0xd0ce('0x6')];var BPromise=require(_0xd0ce('0x7'));var db=require('../../mysqldb')['db'];var dbH=require(_0xd0ce('0x8'))[_0xd0ce('0x9')];var logger=require('../../config/logger')(_0xd0ce('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xd0ce('0xb')][0x2]);var QUERY=process[_0xd0ce('0xb')][0x3];var PATH=process[_0xd0ce('0xb')][0x4];var NAME=process[_0xd0ce('0xb')][0x5];var FORMAT=_0xd0ce('0xc');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0xab8685,_0xa9f1d8){var _0x43c3e4={'status':_0xab8685};var _0x54a68b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xa9f1d8){_0x43c3e4[_0xd0ce('0xd')]=_0xa9f1d8;}return db[_0xd0ce('0xe')]['update'](_0x43c3e4,_0x54a68b);}function getHeaders(_0x4e8347){return _['map'](_0x4e8347,function(_0x27d738){return{'text':_0x27d738,'style':_0xd0ce('0xf')};});}function getRows(_0x1794c6,_0x463ebe){return _[_0xd0ce('0x10')](_0x463ebe,function(_0x28d9d7){return _(_0x28d9d7)[_0xd0ce('0x11')](_0x1794c6)[_0xd0ce('0x10')](function(_0x8dbb6b){return _0x8dbb6b?_[_0xd0ce('0x12')](_0x8dbb6b):'';})[_0xd0ce('0x13')]();});}function createTable(_0x5a6976,_0x408042){var _0x41f9cb={'widths':_['fill'](Array(_0x5a6976['length']),0x91),'heights':function(_0x24cfb6){return _0x24cfb6===0x0?_0xd0ce('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x47c46e=getHeaders(_0x5a6976);_0x41f9cb['body']['push'](_0x47c46e);var _0x249683=getRows(_0x5a6976,_0x408042);_0x41f9cb['body']=_0x41f9cb[_0xd0ce('0x15')][_0xd0ce('0x16')](_0x249683);return _0x41f9cb;}function createTables(_0x20ea87){var _0x365974=[];var _0x3cdb0e=_[_0xd0ce('0x17')](Object['keys'](_0x20ea87[0x0]),0x5);_0x3cdb0e[_0xd0ce('0x18')](function(_0x4c0783){_0x365974['push'](createTable(_0x4c0783,_0x20ea87));});return _0x365974;}function getPDFDocDefinition(_0x2304ce){var _0x40ace6=util[_0xd0ce('0x19')](_0xd0ce('0x1a'),NAME,EXTRACTED_REPORT[_0xd0ce('0x1b')],moment(EXTRACTED_REPORT['startDate'])[_0xd0ce('0x19')](FORMAT),moment(EXTRACTED_REPORT[_0xd0ce('0x1c')])['format'](FORMAT));var _0xc465e=[];for(var _0x5adfa1=0x0;_0x5adfa1<_0x2304ce[_0xd0ce('0x1d')];_0x5adfa1++){var _0x39cbd3=[];if(_0x5adfa1===0x0){_0x39cbd3[_0xd0ce('0x1e')]({'text':_0x40ace6,'style':_0xd0ce('0x1f')});}var _0x2a9c30={'table':_0x2304ce[_0x5adfa1]};if(_0x5adfa1>0x0){_0x2a9c30[_0xd0ce('0x20')]=_0xd0ce('0x21');_0x2a9c30[_0xd0ce('0x22')]=[0x0,0x46,0x0,0x0];}_0x39cbd3[_0xd0ce('0x1e')](_0x2a9c30);_0xc465e[_0xd0ce('0x1e')](_0x39cbd3);}return{'pageSize':'A4','pageOrientation':_0xd0ce('0x23'),'content':_0xc465e,'footer':function(_0x2a3a81,_0x337b34){return{'text':_0x2a3a81['toString']()+'\x20/\x20'+_0x337b34,'style':_0xd0ce('0x24')};},'defaultStyle':{'font':_0xd0ce('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xd0ce('0x26')},'footer':{'alignment':_0xd0ce('0x27'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4585ee){var _0x11ab00=0x1388;var _0x34f967;if(!_0x4585ee[0x0][_0xd0ce('0x28')]){return analyticExtractedReport('Empty');}return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xd0ce('0x29'),_0xd0ce('0x2a')]})['then'](function(_0xb95ccf){if(_0xb95ccf){_0x34f967=_0xb95ccf;_0x11ab00=_0x34f967[_0xd0ce('0x2a')]||0x3e8;}})[_0xd0ce('0x2b')](function(){var _0x42c32b=[];var _0x5e93d4=0x0;if(_0x34f967['split']){if(_0x4585ee&&_0x4585ee[_0xd0ce('0x1d')]){var _0x311e14=_[_0xd0ce('0x2c')](_0x4585ee[0x0][_0xd0ce('0x28')]/_0x11ab00);var _0x483f4c=Number[_0xd0ce('0x2d')](_0x4585ee[0x0][_0xd0ce('0x28')]/_0x11ab00)?_0x4585ee[0x0][_0xd0ce('0x28')]%_0x11ab00:0x0;_0x311e14['forEach'](function(_0x2c9bc0){if(_0x2c9bc0>0x0){_0x5e93d4+=_0x11ab00;}_0x42c32b[_0xd0ce('0x1e')](dbH[_0xd0ce('0x2e')][_0xd0ce('0x2f')](util['format'](_0xd0ce('0x30'),QUERY,_0x11ab00,_0x5e93d4),{'type':dbH['sequelize']['QueryTypes'][_0xd0ce('0x31')]}));});if(_0x483f4c>0x0){_0x5e93d4+=_0x11ab00;_0x42c32b[_0xd0ce('0x1e')](dbH[_0xd0ce('0x2e')][_0xd0ce('0x2f')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x483f4c,_0x5e93d4),{'type':dbH['sequelize']['QueryTypes'][_0xd0ce('0x31')]}));}}}else{_0x42c32b[_0xd0ce('0x1e')](dbH[_0xd0ce('0x2e')]['query'](QUERY,{'type':dbH[_0xd0ce('0x2e')]['QueryTypes'][_0xd0ce('0x31')]}));}var _0x40f22e=path[_0xd0ce('0x32')](PATH);var _0x404386=path[_0xd0ce('0x33')](PATH,_0xd0ce('0x34'));var _0xe3e51e=_0x34f967[_0xd0ce('0x29')]&&_0x42c32b[_0xd0ce('0x1d')]>0x1;var _0x511f8e=[];if(!fs[_0xd0ce('0x35')](path['join'](_0x40f22e,_0x404386))&&_0xe3e51e){fs[_0xd0ce('0x36')](path[_0xd0ce('0x37')](_0x40f22e,_0x404386));}return BPromise[_0xd0ce('0x38')](_0x42c32b,function(_0x35d4e3){_0x511f8e[_0xd0ce('0x1e')](_0x35d4e3);})[_0xd0ce('0x2b')](function(){var _0x14334b=[];for(var _0x582827=0x0;_0x582827<_0x511f8e['length'];_0x582827+=0x1){var _0x58228c=_0x511f8e[_0x582827];var _0x5224b1=createTables(_[_0xd0ce('0x39')](_0x58228c));var _0x1dfb86;var _0x5c8dde=getPDFDocDefinition(_0x5224b1);var _0x20f8e1=getPDFPrinter();var _0x45ab33=_0x20f8e1[_0xd0ce('0x3a')](_0x5c8dde);if(_0xe3e51e){_0x1dfb86=path[_0xd0ce('0x37')](_0x40f22e,_0x404386,util[_0xd0ce('0x19')](_0xd0ce('0x3b'),_0x404386,_0x582827,_0xd0ce('0x3c')));}else{_0x1dfb86=path[_0xd0ce('0x37')](_0x40f22e,util[_0xd0ce('0x19')](_0xd0ce('0x3d'),_0x404386,_0xd0ce('0x3c')));}_0x14334b['push'](writePDFDocument(_0x45ab33,_0x1dfb86));}return Promise[_0xd0ce('0x3e')](_0x14334b);})['then'](function(){if(_0xe3e51e){return new Promise(function(_0x5b1bd3){zipdir(path[_0xd0ce('0x37')](_0x40f22e,_0x404386),{'saveTo':path[_0xd0ce('0x37')](_0x40f22e,util[_0xd0ce('0x19')](_0xd0ce('0x3d'),_0x404386,_0xd0ce('0x3f')))},function(){rimraf(path[_0xd0ce('0x37')](_0x40f22e,_0x404386),function(){});_0x5b1bd3(_0xd0ce('0x40'));});});}})[_0xd0ce('0x2b')](function(){if(!_0xe3e51e)return;rimraf(path['join'](_0x40f22e,_0x404386),function(){});})[_0xd0ce('0x2b')](function(){logger[_0xd0ce('0x41')](util[_0xd0ce('0x19')](_0xd0ce('0x42'),EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0xd0ce('0x43'),_0xe3e51e?util[_0xd0ce('0x19')](_0xd0ce('0x3d'),_0x404386,_0xe3e51e?_0xd0ce('0x3f'):_0xd0ce('0x3c')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xd0ce('0x41')](util['format'](_0xd0ce('0x44'),EXTRACTED_REPORT_ID,_0xd0ce('0x45')));return db[_0xd0ce('0xe')][_0xd0ce('0x46')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xd0ce('0x2b')](function(_0x565701){EXTRACTED_REPORT=_0x565701;return dbH['sequelize'][_0xd0ce('0x2f')](util[_0xd0ce('0x19')](_0xd0ce('0x47'),QUERY),{'type':dbH[_0xd0ce('0x2e')][_0xd0ce('0x48')]['SELECT']});})['then'](extractReport)[_0xd0ce('0x49')](function(_0x477228){logger[_0xd0ce('0x41')](util[_0xd0ce('0x19')](_0xd0ce('0x4a'),EXTRACTED_REPORT_ID,_0xd0ce('0x45')),util[_0xd0ce('0x4b')](_0x477228,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd0ce('0x4c'));})[_0xd0ce('0x4d')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1d825b=new PdfPrinter({'Arial':{'normal':__dirname+_0xd0ce('0x4e'),'bold':__dirname+_0xd0ce('0x4f'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0xd0ce('0x50')}});return _0x1d825b;}function getPDFDocDefinitionFromHTML(_0x1d346a,_0x1448c4){var _0x202c6e=util['format'](_0xd0ce('0x51'),_0x1448c4[_0xd0ce('0x52')],_0x1448c4[_0xd0ce('0x53')]);var _0x7eea95=moment()[_0xd0ce('0x19')](_0xd0ce('0x54'))[_0xd0ce('0x12')]();var _0x295d88=htmlToPdfmake(_0x1d346a,{'window':window,'tableAutoSize':!![]});return{'content':[_0x295d88],'defaultStyle':{'font':_0xd0ce('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xd0ce('0x55'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xd0ce('0x55')}},'header':function(){return[{'text':_0xd0ce('0x56'),'style':_0xd0ce('0x1f')}];},'footer':function(_0x1e68a0,_0x2bd81c){return[{'text':util[_0xd0ce('0x19')](_0xd0ce('0x57'),_0x202c6e,_0x1e68a0,_0x2bd81c,_0x7eea95),'style':_0xd0ce('0x24')}];}};}function writePDFDocument(_0x5d2ed7,_0x46094c){return new Promise(function(_0x184a11,_0x1c8e2b){var _0x28fe46=_0x5d2ed7[_0xd0ce('0x58')](fs['createWriteStream'](_0x46094c));_0x28fe46['on'](_0xd0ce('0x59'),function(){_0x184a11(_0xd0ce('0x59'));});_0x28fe46['on']('error',function(_0x1ac1cc){_0x1c8e2b(_0x1ac1cc);});_0x5d2ed7[_0xd0ce('0x5a')]();});}exports[_0xd0ce('0x5b')]=function(_0x5886c7,_0x288bf1){var _0x4e6eea=getPDFPrinter();var _0x4157e5=getPDFDocDefinitionFromHTML(_0x5886c7,_0x288bf1);var _0x317131=_0x4e6eea['createPdfKitDocument'](_0x4157e5);return writePDFDocument(_0x317131,_0x288bf1[_0xd0ce('0x2')])[_0xd0ce('0x49')](function(_0x357063){throw _0x357063;});}; \ No newline at end of file +var _0x5e9f=['inspect','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','Arial','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','error','end','createPdfFromHTML','lodash','util','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','JSDOM','window','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','map','pick','toString','value','fill','length','auto','push','body','concat','chunk','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','header','pageBreak','before','margin','\x20/\x20','footer','black','right','Setting','find','split','splitSizePdf','then','range','isInteger','num','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','pdf','all','%s.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format'];(function(_0x5db8ab,_0x3ab288){var _0x10ddc4=function(_0x37b9dc){while(--_0x37b9dc){_0x5db8ab['push'](_0x5db8ab['shift']());}};_0x10ddc4(++_0x3ab288);}(_0x5e9f,0x12b));var _0xf5e9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e9f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf5e9('0x0'));var fs=require('fs');var util=require(_0xf5e9('0x1'));var path=require(_0xf5e9('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0xf5e9('0x3'));var PdfPrinter=require(_0xf5e9('0x4'));var zipdir=require(_0xf5e9('0x5'));var rimraf=require('rimraf');var JSDOM=require(_0xf5e9('0x6'))[_0xf5e9('0x7')];var window=new JSDOM('')[_0xf5e9('0x8')];var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xf5e9('0x9')];var logger=require(_0xf5e9('0xa'))(_0xf5e9('0xb'));var EXTRACTED_REPORT_ID=Number(process[_0xf5e9('0xc')][0x2]);var QUERY=process[_0xf5e9('0xc')][0x3];var PATH=process[_0xf5e9('0xc')][0x4];var NAME=process[_0xf5e9('0xc')][0x5];var FORMAT=_0xf5e9('0xd');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x4c4175,_0x4e5d08){var _0x5d5936={'status':_0x4c4175};var _0x1895df={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4e5d08){_0x5d5936[_0xf5e9('0xe')]=_0x4e5d08;}return db[_0xf5e9('0xf')][_0xf5e9('0x10')](_0x5d5936,_0x1895df);}function getHeaders(_0x5926ff){return _[_0xf5e9('0x11')](_0x5926ff,function(_0x4f8092){return{'text':_0x4f8092,'style':'tableHeader'};});}function getRows(_0x29547b,_0x1cd86c){return _[_0xf5e9('0x11')](_0x1cd86c,function(_0xd3ac9f){return _(_0xd3ac9f)[_0xf5e9('0x12')](_0x29547b)[_0xf5e9('0x11')](function(_0x311bf3){return _0x311bf3?_[_0xf5e9('0x13')](_0x311bf3):'';})[_0xf5e9('0x14')]();});}function createTable(_0x462692,_0x17719b){var _0x515cda={'widths':_[_0xf5e9('0x15')](Array(_0x462692[_0xf5e9('0x16')]),0x91),'heights':function(_0x3133ac){return _0x3133ac===0x0?_0xf5e9('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x147251=getHeaders(_0x462692);_0x515cda['body'][_0xf5e9('0x18')](_0x147251);var _0x30173e=getRows(_0x462692,_0x17719b);_0x515cda['body']=_0x515cda[_0xf5e9('0x19')][_0xf5e9('0x1a')](_0x30173e);return _0x515cda;}function createTables(_0x4bbce3){var _0x55121b=[];var _0x3743a3=_[_0xf5e9('0x1b')](Object[_0xf5e9('0x1c')](_0x4bbce3[0x0]),0x5);_0x3743a3[_0xf5e9('0x1d')](function(_0x148924){_0x55121b[_0xf5e9('0x18')](createTable(_0x148924,_0x4bbce3));});return _0x55121b;}function getPDFDocDefinition(_0xcbe526){var _0x501bc9=util[_0xf5e9('0x1e')](_0xf5e9('0x1f'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0xf5e9('0x20')])[_0xf5e9('0x1e')](FORMAT),moment(EXTRACTED_REPORT[_0xf5e9('0x21')])['format'](FORMAT));var _0x12c6f9=[];for(var _0x1d9386=0x0;_0x1d9386<_0xcbe526[_0xf5e9('0x16')];_0x1d9386++){var _0x200fc3=[];if(_0x1d9386===0x0){_0x200fc3[_0xf5e9('0x18')]({'text':_0x501bc9,'style':_0xf5e9('0x22')});}var _0x28d4bc={'table':_0xcbe526[_0x1d9386]};if(_0x1d9386>0x0){_0x28d4bc[_0xf5e9('0x23')]=_0xf5e9('0x24');_0x28d4bc[_0xf5e9('0x25')]=[0x0,0x46,0x0,0x0];}_0x200fc3['push'](_0x28d4bc);_0x12c6f9['push'](_0x200fc3);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x12c6f9,'footer':function(_0x4b4da1,_0x4d969e){return{'text':_0x4b4da1[_0xf5e9('0x13')]()+_0xf5e9('0x26')+_0x4d969e,'style':_0xf5e9('0x27')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xf5e9('0x28')},'footer':{'alignment':_0xf5e9('0x29'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x32184c){var _0x455733=0x1388;var _0x1af884;if(!_0x32184c[0x0]['num']){return analyticExtractedReport('Empty');}return db[_0xf5e9('0x2a')][_0xf5e9('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf5e9('0x2c'),_0xf5e9('0x2d')]})['then'](function(_0x2e4f2a){if(_0x2e4f2a){_0x1af884=_0x2e4f2a;_0x455733=_0x1af884[_0xf5e9('0x2d')]||0x3e8;}})[_0xf5e9('0x2e')](function(){var _0x229d17=[];var _0x2c59b8=0x0;if(_0x1af884['split']){if(_0x32184c&&_0x32184c['length']){var _0x602eac=_[_0xf5e9('0x2f')](_0x32184c[0x0]['num']/_0x455733);var _0x171923=Number[_0xf5e9('0x30')](_0x32184c[0x0][_0xf5e9('0x31')]/_0x455733)?_0x32184c[0x0][_0xf5e9('0x31')]%_0x455733:0x0;_0x602eac['forEach'](function(_0x2c40ce){if(_0x2c40ce>0x0){_0x2c59b8+=_0x455733;}_0x229d17[_0xf5e9('0x18')](dbH[_0xf5e9('0x32')][_0xf5e9('0x33')](util[_0xf5e9('0x1e')](_0xf5e9('0x34'),QUERY,_0x455733,_0x2c59b8),{'type':dbH['sequelize'][_0xf5e9('0x35')][_0xf5e9('0x36')]}));});if(_0x171923>0x0){_0x2c59b8+=_0x455733;_0x229d17['push'](dbH['sequelize'][_0xf5e9('0x33')](util[_0xf5e9('0x1e')](_0xf5e9('0x34'),QUERY,_0x171923,_0x2c59b8),{'type':dbH['sequelize'][_0xf5e9('0x35')]['SELECT']}));}}}else{_0x229d17[_0xf5e9('0x18')](dbH['sequelize'][_0xf5e9('0x33')](QUERY,{'type':dbH['sequelize'][_0xf5e9('0x35')][_0xf5e9('0x36')]}));}var _0x36fe90=path[_0xf5e9('0x37')](PATH);var _0x442cee=path[_0xf5e9('0x38')](PATH,_0xf5e9('0x39'));var _0x13bd87=_0x1af884[_0xf5e9('0x2c')]&&_0x229d17[_0xf5e9('0x16')]>0x1;var _0x5a00f4=[];if(!fs[_0xf5e9('0x3a')](path[_0xf5e9('0x3b')](_0x36fe90,_0x442cee))&&_0x13bd87){fs[_0xf5e9('0x3c')](path[_0xf5e9('0x3b')](_0x36fe90,_0x442cee));}return BPromise[_0xf5e9('0x3d')](_0x229d17,function(_0x893313){_0x5a00f4[_0xf5e9('0x18')](_0x893313);})[_0xf5e9('0x2e')](function(){var _0x49406b=[];for(var _0x15600d=0x0;_0x15600d<_0x5a00f4[_0xf5e9('0x16')];_0x15600d+=0x1){var _0x1562b4=_0x5a00f4[_0x15600d];var _0x4b9dc0=createTables(_[_0xf5e9('0x3e')](_0x1562b4));var _0x1b41cc;var _0x15ea75=getPDFDocDefinition(_0x4b9dc0);var _0x52fe2f=getPDFPrinter();var _0x46cf29=_0x52fe2f[_0xf5e9('0x3f')](_0x15ea75);if(_0x13bd87){_0x1b41cc=path[_0xf5e9('0x3b')](_0x36fe90,_0x442cee,util['format'](_0xf5e9('0x40'),_0x442cee,_0x15600d,'pdf'));}else{_0x1b41cc=path[_0xf5e9('0x3b')](_0x36fe90,util[_0xf5e9('0x1e')]('%s.%s',_0x442cee,_0xf5e9('0x41')));}_0x49406b['push'](writePDFDocument(_0x46cf29,_0x1b41cc));}return Promise[_0xf5e9('0x42')](_0x49406b);})[_0xf5e9('0x2e')](function(){if(_0x13bd87){return new Promise(function(_0x244545){zipdir(path[_0xf5e9('0x3b')](_0x36fe90,_0x442cee),{'saveTo':path[_0xf5e9('0x3b')](_0x36fe90,util[_0xf5e9('0x1e')](_0xf5e9('0x43'),_0x442cee,_0xf5e9('0x44')))},function(){rimraf(path[_0xf5e9('0x3b')](_0x36fe90,_0x442cee),function(){});_0x244545('zip\x20finished');});});}})[_0xf5e9('0x2e')](function(){if(!_0x13bd87)return;rimraf(path[_0xf5e9('0x3b')](_0x36fe90,_0x442cee),function(){});})['then'](function(){logger[_0xf5e9('0x45')](util['format'](_0xf5e9('0x46'),EXTRACTED_REPORT_ID,_0xf5e9('0x47')));return analyticExtractedReport('Completed',_0x13bd87?util[_0xf5e9('0x1e')](_0xf5e9('0x43'),_0x442cee,_0x13bd87?_0xf5e9('0x44'):_0xf5e9('0x41')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xf5e9('0x45')](util[_0xf5e9('0x1e')](_0xf5e9('0x48'),EXTRACTED_REPORT_ID,_0xf5e9('0x47')));return db[_0xf5e9('0xf')][_0xf5e9('0x49')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xf5e9('0x2e')](function(_0x4798ae){EXTRACTED_REPORT=_0x4798ae;return dbH['sequelize'][_0xf5e9('0x33')](util[_0xf5e9('0x1e')](_0xf5e9('0x4a'),QUERY),{'type':dbH[_0xf5e9('0x32')][_0xf5e9('0x35')][_0xf5e9('0x36')]});})['then'](extractReport)[_0xf5e9('0x4b')](function(_0x460fc1){logger['info'](util[_0xf5e9('0x1e')](_0xf5e9('0x4c'),EXTRACTED_REPORT_ID,_0xf5e9('0x47')),util[_0xf5e9('0x4d')](_0x460fc1,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0xf5e9('0x4e')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x276c11=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xf5e9('0x4f'),'italics':__dirname+_0xf5e9('0x50'),'bolditalics':__dirname+_0xf5e9('0x51')}});return _0x276c11;}function getPDFDocDefinitionFromHTML(_0x56e468,_0x38b2cf){var _0x4f4b3d=util[_0xf5e9('0x1e')]('%s\x20#%d',_0x38b2cf[_0xf5e9('0x52')],_0x38b2cf[_0xf5e9('0x53')]);var _0xa80cdd=moment()[_0xf5e9('0x1e')](_0xf5e9('0x54'))[_0xf5e9('0x13')]();var _0x3c2d59=htmlToPdfmake(_0x56e468,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3c2d59],'defaultStyle':{'font':_0xf5e9('0x55')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xf5e9('0x56'),'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':_0xf5e9('0x56')}},'header':function(){return[{'text':_0xf5e9('0x57'),'style':_0xf5e9('0x22')}];},'footer':function(_0x572670,_0x2d5b59){return[{'text':util[_0xf5e9('0x1e')](_0xf5e9('0x58'),_0x4f4b3d,_0x572670,_0x2d5b59,_0xa80cdd),'style':_0xf5e9('0x27')}];}};}function writePDFDocument(_0x4373b0,_0x45eb58){return new Promise(function(_0x4206e3,_0x25aace){var _0x452bfd=_0x4373b0[_0xf5e9('0x59')](fs[_0xf5e9('0x5a')](_0x45eb58));_0x452bfd['on']('finish',function(){_0x4206e3('finish');});_0x452bfd['on'](_0xf5e9('0x5b'),function(_0x6dbeb5){_0x25aace(_0x6dbeb5);});_0x4373b0[_0xf5e9('0x5c')]();});}exports[_0xf5e9('0x5d')]=function(_0x1732aa,_0x5c0130){var _0x68955f=getPDFPrinter();var _0x6e66b0=getPDFDocDefinitionFromHTML(_0x1732aa,_0x5c0130);var _0x4d75b7=_0x68955f['createPdfKitDocument'](_0x6e66b0);return writePDFDocument(_0x4d75b7,_0x5c0130[_0xf5e9('0x2')])[_0xf5e9('0x4b')](function(_0x43cf4d){throw _0x43cf4d;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 46ecc36..a0ac9bd 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 _0x1833=['../../config/logger','analytics','argv','savename','AnalyticExtractedReport','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','QueryTypes','SELECT','num','Empty','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','%s%d.%s','%s.%s','xlsx','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','catch','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH'];(function(_0x49a3b7,_0x5d2586){var _0x569e43=function(_0x4ddf94){while(--_0x4ddf94){_0x49a3b7['push'](_0x49a3b7['shift']());}};_0x569e43(++_0x5d2586);}(_0x1833,0x93));var _0x3183=function(_0x4587fe,_0x4b740c){_0x4587fe=_0x4587fe-0x0;var _0x379355=_0x1833[_0x4587fe];return _0x379355;};'use strict';var util=require(_0x3183('0x0'));var path=require(_0x3183('0x1'));var _=require(_0x3183('0x2'));var fs=require('fs');var json2xls=require(_0x3183('0x3'));var BPromise=require(_0x3183('0x4'));var zipdir=require(_0x3183('0x5'));var rimraf=require(_0x3183('0x6'));var db=require(_0x3183('0x7'))['db'];var dbH=require('../../mysqldb')[_0x3183('0x8')];var logger=require(_0x3183('0x9'))(_0x3183('0xa'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x3183('0xb')][0x3];var PATH=process[_0x3183('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xf7fc91,_0x3bd649){var _0x18829d={'status':_0xf7fc91};var _0xcb6ace={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3bd649){_0x18829d[_0x3183('0xc')]=_0x3bd649;}return db[_0x3183('0xd')]['update'](_0x18829d,_0xcb6ace);}function main(){var _0x5e3077=0x1388;var _0x15e8bf;logger['info'](util[_0x3183('0xe')](_0x3183('0xf'),EXTRACTED_REPORT_ID,_0x3183('0x10')));return db[_0x3183('0x11')][_0x3183('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3183('0x13'),_0x3183('0x14')]})[_0x3183('0x15')](function(_0xb906d3){if(_0xb906d3){_0x15e8bf=_0xb906d3;_0x5e3077=_0x15e8bf[_0x3183('0x14')]||0x1388;}})[_0x3183('0x15')](function(){return dbH[_0x3183('0x16')][_0x3183('0x17')](util[_0x3183('0xe')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x3183('0x16')][_0x3183('0x18')][_0x3183('0x19')]});})[_0x3183('0x15')](function(_0x382051){if(!_0x382051[0x0][_0x3183('0x1a')]){return analyticExtractedReport(_0x3183('0x1b'));}var _0x3ea34e=[];var _0x5d10d2=0x0;if(_0x15e8bf['split']){if(_0x382051&&_0x382051['length']){var _0xa071fa=_[_0x3183('0x1c')](_0x382051[0x0][_0x3183('0x1a')]/_0x5e3077);var _0x547c70=Number[_0x3183('0x1d')](_0x382051[0x0][_0x3183('0x1a')]/_0x5e3077)?_0x382051[0x0][_0x3183('0x1a')]%_0x5e3077:0x0;_0xa071fa[_0x3183('0x1e')](function(_0x2491c3){if(_0x2491c3>0x0){_0x5d10d2+=_0x5e3077;}_0x3ea34e[_0x3183('0x1f')](dbH[_0x3183('0x16')][_0x3183('0x17')](util[_0x3183('0xe')](_0x3183('0x20'),QUERY,_0x5e3077,_0x5d10d2),{'type':dbH[_0x3183('0x16')][_0x3183('0x18')][_0x3183('0x19')]}));});if(_0x547c70>0x0){_0x5d10d2+=_0x5e3077;_0x3ea34e[_0x3183('0x1f')](dbH[_0x3183('0x16')][_0x3183('0x17')](util[_0x3183('0xe')](_0x3183('0x20'),QUERY,_0x547c70,_0x5d10d2),{'type':dbH[_0x3183('0x16')][_0x3183('0x18')]['SELECT']}));}}}else{_0x3ea34e[_0x3183('0x1f')](dbH[_0x3183('0x16')]['query'](QUERY,{'type':dbH[_0x3183('0x16')][_0x3183('0x18')][_0x3183('0x19')]}));}var _0x252dda=path[_0x3183('0x21')](PATH);var _0x10c7a9=path[_0x3183('0x22')](PATH,_0x3183('0x23'));var _0x22beff=_0x15e8bf['split']&&_0x3ea34e['length']>0x1;var _0x9826a6=[];if(!fs[_0x3183('0x24')](path[_0x3183('0x25')](_0x252dda,_0x10c7a9))&&_0x22beff){fs['mkdirSync'](path[_0x3183('0x25')](_0x252dda,_0x10c7a9));}return BPromise['each'](_0x3ea34e,function(_0x5509c2){_0x9826a6[_0x3183('0x1f')](_0x5509c2);})['then'](function(){for(var _0x256b59=0x0;_0x256b59<_0x9826a6['length'];_0x256b59+=0x1){var _0x239a3a;var _0x1edf98=_0x9826a6[_0x256b59];if(_0x22beff){_0x239a3a=path[_0x3183('0x25')](_0x252dda,_0x10c7a9,util['format'](_0x3183('0x26'),_0x10c7a9,_0x256b59,'xlsx'));}else{_0x239a3a=path['join'](_0x252dda,util[_0x3183('0xe')](_0x3183('0x27'),_0x10c7a9,_0x3183('0x28')));}fs[_0x3183('0x29')](_0x239a3a,json2xls(_0x1edf98),_0x3183('0x2a'));}})[_0x3183('0x15')](function(){if(_0x22beff){return new Promise(function(_0x2b6e6e){zipdir(path[_0x3183('0x25')](_0x252dda,_0x10c7a9),{'saveTo':path[_0x3183('0x25')](_0x252dda,util['format'](_0x3183('0x27'),_0x10c7a9,_0x3183('0x2b')))},function(_0x5f00e8,_0x1a1149){rimraf(path[_0x3183('0x25')](_0x252dda,_0x10c7a9),function(){});_0x2b6e6e(_0x3183('0x2c'));});});}})['then'](function(){logger['info'](util[_0x3183('0xe')](_0x3183('0x2d'),EXTRACTED_REPORT_ID,_0x3183('0x10')));return analyticExtractedReport('Completed',_0x22beff?util[_0x3183('0xe')](_0x3183('0x27'),_0x10c7a9,_0x22beff?_0x3183('0x2b'):'xlsx'):null);});})[_0x3183('0x2e')](function(_0x1afe1c){logger[_0x3183('0x2f')](util['format'](_0x3183('0x30'),EXTRACTED_REPORT_ID,_0x3183('0x10')),util['inspect'](_0x1afe1c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x3183('0x31'));})[_0x3183('0x32')](function(){process[_0x3183('0x33')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xaa1b=['bluebird','rimraf','../../mysqldb','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','length','range','isInteger','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','%s.%s','binary','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','xlsx','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','util','path','lodash'];(function(_0xc838b8,_0x2f4309){var _0x18c0be=function(_0x2d81cd){while(--_0x2d81cd){_0xc838b8['push'](_0xc838b8['shift']());}};_0x18c0be(++_0x2f4309);}(_0xaa1b,0x123));var _0xbaa1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa1b[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0xbaa1('0x0'));var path=require(_0xbaa1('0x1'));var _=require(_0xbaa1('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xbaa1('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xbaa1('0x4'));var db=require(_0xbaa1('0x5'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require('../../config/logger')(_0xbaa1('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xbaa1('0x7')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xbaa1('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x56e7ec,_0x364ce9){var _0x15b968={'status':_0x56e7ec};var _0x339e3e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x364ce9){_0x15b968[_0xbaa1('0x8')]=_0x364ce9;}return db[_0xbaa1('0x9')][_0xbaa1('0xa')](_0x15b968,_0x339e3e);}function main(){var _0x4f8933=0x1388;var _0x39b669;logger[_0xbaa1('0xb')](util[_0xbaa1('0xc')](_0xbaa1('0xd'),EXTRACTED_REPORT_ID,_0xbaa1('0xe')));return db[_0xbaa1('0xf')][_0xbaa1('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbaa1('0x11'),_0xbaa1('0x12')]})[_0xbaa1('0x13')](function(_0x8ce72d){if(_0x8ce72d){_0x39b669=_0x8ce72d;_0x4f8933=_0x39b669[_0xbaa1('0x12')]||0x1388;}})['then'](function(){return dbH['sequelize']['query'](util['format'](_0xbaa1('0x14'),QUERY),{'type':dbH[_0xbaa1('0x15')][_0xbaa1('0x16')][_0xbaa1('0x17')]});})[_0xbaa1('0x13')](function(_0x2e7db5){if(!_0x2e7db5[0x0][_0xbaa1('0x18')]){return analyticExtractedReport(_0xbaa1('0x19'));}var _0x35a3fd=[];var _0x2a0c0b=0x0;if(_0x39b669[_0xbaa1('0x11')]){if(_0x2e7db5&&_0x2e7db5[_0xbaa1('0x1a')]){var _0x449dfc=_[_0xbaa1('0x1b')](_0x2e7db5[0x0][_0xbaa1('0x18')]/_0x4f8933);var _0x155a16=Number[_0xbaa1('0x1c')](_0x2e7db5[0x0][_0xbaa1('0x18')]/_0x4f8933)?_0x2e7db5[0x0][_0xbaa1('0x18')]%_0x4f8933:0x0;_0x449dfc['forEach'](function(_0x10bfd3){if(_0x10bfd3>0x0){_0x2a0c0b+=_0x4f8933;}_0x35a3fd[_0xbaa1('0x1d')](dbH[_0xbaa1('0x15')][_0xbaa1('0x1e')](util[_0xbaa1('0xc')](_0xbaa1('0x1f'),QUERY,_0x4f8933,_0x2a0c0b),{'type':dbH['sequelize'][_0xbaa1('0x16')][_0xbaa1('0x17')]}));});if(_0x155a16>0x0){_0x2a0c0b+=_0x4f8933;_0x35a3fd[_0xbaa1('0x1d')](dbH[_0xbaa1('0x15')][_0xbaa1('0x1e')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x155a16,_0x2a0c0b),{'type':dbH[_0xbaa1('0x15')][_0xbaa1('0x16')][_0xbaa1('0x17')]}));}}}else{_0x35a3fd[_0xbaa1('0x1d')](dbH[_0xbaa1('0x15')][_0xbaa1('0x1e')](QUERY,{'type':dbH['sequelize'][_0xbaa1('0x16')][_0xbaa1('0x17')]}));}var _0x28e508=path[_0xbaa1('0x20')](PATH);var _0x1204f4=path[_0xbaa1('0x21')](PATH,_0xbaa1('0x22'));var _0x2d208e=_0x39b669[_0xbaa1('0x11')]&&_0x35a3fd['length']>0x1;var _0x2b80a4=[];if(!fs[_0xbaa1('0x23')](path[_0xbaa1('0x24')](_0x28e508,_0x1204f4))&&_0x2d208e){fs[_0xbaa1('0x25')](path[_0xbaa1('0x24')](_0x28e508,_0x1204f4));}return BPromise[_0xbaa1('0x26')](_0x35a3fd,function(_0x594578){_0x2b80a4['push'](_0x594578);})[_0xbaa1('0x13')](function(){for(var _0x1e1869=0x0;_0x1e1869<_0x2b80a4[_0xbaa1('0x1a')];_0x1e1869+=0x1){var _0x48cbc0;var _0xf3ff18=_0x2b80a4[_0x1e1869];if(_0x2d208e){_0x48cbc0=path[_0xbaa1('0x24')](_0x28e508,_0x1204f4,util['format'](_0xbaa1('0x27'),_0x1204f4,_0x1e1869,'xlsx'));}else{_0x48cbc0=path[_0xbaa1('0x24')](_0x28e508,util[_0xbaa1('0xc')](_0xbaa1('0x28'),_0x1204f4,'xlsx'));}fs['writeFileSync'](_0x48cbc0,json2xls(_0xf3ff18),_0xbaa1('0x29'));}})[_0xbaa1('0x13')](function(){if(_0x2d208e){return new Promise(function(_0x279b72){zipdir(path[_0xbaa1('0x24')](_0x28e508,_0x1204f4),{'saveTo':path[_0xbaa1('0x24')](_0x28e508,util[_0xbaa1('0xc')]('%s.%s',_0x1204f4,_0xbaa1('0x2a')))},function(_0xe4036e,_0x2cfabc){rimraf(path[_0xbaa1('0x24')](_0x28e508,_0x1204f4),function(){});_0x279b72('zip\x20finished');});});}})[_0xbaa1('0x13')](function(){logger['info'](util[_0xbaa1('0xc')](_0xbaa1('0x2b'),EXTRACTED_REPORT_ID,_0xbaa1('0xe')));return analyticExtractedReport(_0xbaa1('0x2c'),_0x2d208e?util['format'](_0xbaa1('0x28'),_0x1204f4,_0x2d208e?_0xbaa1('0x2a'):_0xbaa1('0x2d')):null);});})['catch'](function(_0x38eeb4){logger[_0xbaa1('0xb')](util['format'](_0xbaa1('0x2e'),EXTRACTED_REPORT_ID,_0xbaa1('0xe')),util[_0xbaa1('0x2f')](_0x38eeb4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xbaa1('0x30')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 78bb031..18c1797 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 _0x2e4b=['Set','format','CDR(type)=%s','context','inbound','CDR(routeid)=','VoiceExtensionId','outbound','cutdigits','${EXTEN:','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','toLowerCase','updatedAt','interval','filter','tag','CDR(tag)=','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','transaction','catch','error','rewrite','util','models','Interval','findAll','then','IntervalId','VoiceExtension','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find','exten','push','type'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x2e4b,0xef));var _0xb2e4=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x2e4b[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require('lodash');var util=require(_0xb2e4('0x0'));function rewrite(_0x43e39b,_0x130455){var _0x762eea=this;return _0x43e39b[_0xb2e4('0x1')][_0xb2e4('0x2')][_0xb2e4('0x3')]({'raw':!![]})[_0xb2e4('0x4')](function(_0x5c1a09){_0x762eea['intervals']=_0x5c1a09;return _0x43e39b[_0xb2e4('0x1')]['VoiceExtension']['findAll']({'where':{'IntervalId':_0x130455[_0xb2e4('0x5')]},'raw':!![]});})[_0xb2e4('0x4')](function(_0x50b5f8){return _0x43e39b[_0xb2e4('0x1')][_0xb2e4('0x6')][_0xb2e4('0x3')]({'where':{'exten':{'$in':_[_0xb2e4('0x7')](_[_0xb2e4('0x8')](_0x50b5f8,'exten'))}},'order':[{'raw':_0xb2e4('0x9')}],'raw':!![]});})[_0xb2e4('0x4')](function(_0x3b2482){var _0x4ed466=_['filter'](_0x3b2482,{'priority':'1'});var _0x39444e=_['filter'](_0x3b2482,{'isApp':0x1});var _0x37a304=_[_0xb2e4('0xa')](_0x39444e,'exten');var _0x1752d6=[_0xb2e4('0xb'),_0xb2e4('0xc')];var _0x40a733=[];var _0x29232b=[];for(var _0x1ccddf in _0x37a304){if(_0x37a304[_0xb2e4('0xd')](_0x1ccddf)){_0x762eea[_0xb2e4('0xe')]=0x2;_0x762eea[_0xb2e4('0xf')]=[];_0x762eea[_0xb2e4('0x10')]=_[_0xb2e4('0x11')](_0x4ed466,{'exten':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x12')]});_0x762eea[_0xb2e4('0xf')][_0xb2e4('0x13')]({'type':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x14')],'app':_0xb2e4('0x15'),'appdata':util[_0xb2e4('0x16')](_0xb2e4('0x17'),_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x14')]),'context':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x18')],'exten':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x12')],'priority':_0x762eea[_0xb2e4('0xe')]++,'VoiceExtensionId':_0x37a304[_0x1ccddf][0x0]['VoiceExtensionId']});if(_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x14')]===_0xb2e4('0x19')){_0x762eea[_0xb2e4('0xf')][_0xb2e4('0x13')]({'type':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x14')],'app':_0xb2e4('0x15'),'appdata':_0xb2e4('0x1a')+_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x1b')],'context':_0x37a304[_0x1ccddf][0x0]['context'],'exten':_0x37a304[_0x1ccddf][0x0]['exten'],'priority':_0x762eea[_0xb2e4('0xe')]++,'VoiceExtensionId':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x1b')]});}else if(_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x14')]===_0xb2e4('0x1c')){if(_0x762eea['extension']){_0x762eea[_0xb2e4('0xf')][_0xb2e4('0x13')]({'type':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x14')],'app':_0xb2e4('0x15'),'appdata':'CDR(destination)='+(_0x762eea[_0xb2e4('0x10')][_0xb2e4('0x1d')]?_0xb2e4('0x1e')+_0x762eea[_0xb2e4('0x10')][_0xb2e4('0x1d')]+'}':'${EXTEN}'),'context':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x18')],'exten':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x12')],'priority':_0x762eea[_0xb2e4('0xe')]++,'VoiceExtensionId':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x1b')]});}_0x762eea[_0xb2e4('0xf')][_0xb2e4('0x13')]({'type':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x14')],'app':_0xb2e4('0x15'),'appdata':_0xb2e4('0x1a')+_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x1b')],'context':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x18')],'exten':_0x37a304[_0x1ccddf][0x0]['exten'],'priority':_0x762eea['priority']++,'VoiceExtensionId':_0x37a304[_0x1ccddf][0x0]['VoiceExtensionId']});var _0x38a212=_0x762eea['priority']++;_0x762eea[_0xb2e4('0xf')][_0xb2e4('0x13')]({'type':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x14')],'app':_0xb2e4('0x1f'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x38a212+0x2)+_0xb2e4('0x20')+(_0x38a212+0x1)+')','context':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x18')],'exten':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x12')],'priority':_0x38a212,'VoiceExtensionId':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x1b')]});if(_0x762eea['extension']){_0x762eea[_0xb2e4('0xf')][_0xb2e4('0x13')]({'type':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x14')],'app':'Set','appdata':_0x762eea[_0xb2e4('0x10')][_0xb2e4('0x1d')]?_0xb2e4('0x21')+_0x762eea[_0xb2e4('0x10')][_0xb2e4('0x1d')]+'}':'CDR(prefix)=noprefix','context':_0x37a304[_0x1ccddf][0x0]['context'],'exten':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x12')],'priority':_0x762eea[_0xb2e4('0xe')]++,'VoiceExtensionId':_0x37a304[_0x1ccddf][0x0]['VoiceExtensionId']});}_0x762eea[_0xb2e4('0xf')][_0xb2e4('0x13')]({'type':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x14')],'app':_0xb2e4('0x15'),'appdata':_0xb2e4('0x22')+_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x1b')],'context':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x18')],'exten':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x12')],'priority':_0x762eea[_0xb2e4('0xe')]++,'VoiceExtensionId':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x1b')]});if(_0x762eea[_0xb2e4('0x10')]&&_0x762eea['extension'][_0xb2e4('0xd')](_0xb2e4('0x23'))&&_0x762eea[_0xb2e4('0x10')][_0xb2e4('0x23')]!==_0xb2e4('0x24')){_0x762eea['extensions'][_0xb2e4('0x13')]({'type':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x14')],'app':_0xb2e4('0x15'),'appdata':_0xb2e4('0x25'),'context':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x18')],'exten':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x12')],'priority':_0x762eea[_0xb2e4('0xe')]++,'VoiceExtensionId':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x1b')]});_0x762eea['extensions']['push']({'type':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x14')],'app':_0xb2e4('0x15'),'appdata':_0xb2e4('0x26')+_0x762eea[_0xb2e4('0x10')][_0xb2e4('0x23')]||_0xb2e4('0x27'),'context':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x18')],'exten':_0x37a304[_0x1ccddf][0x0]['exten'],'priority':_0x762eea[_0xb2e4('0xe')]++,'VoiceExtensionId':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x1b')]});}}_0x762eea[_0xb2e4('0xf')][_0xb2e4('0x13')]({'type':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x14')],'app':_0xb2e4('0x15'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x37a304[_0x1ccddf][0x0]['context'],'exten':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x12')],'priority':_0x762eea[_0xb2e4('0xe')]++,'VoiceExtensionId':_0x37a304[_0x1ccddf][0x0]['VoiceExtensionId']});_0x762eea[_0xb2e4('0xf')]['push']({'type':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x14')],'app':_0xb2e4('0x15'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x18')],'exten':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x12')],'priority':_0x762eea[_0xb2e4('0xe')]++,'VoiceExtensionId':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x1b')]});_0x762eea[_0xb2e4('0xf')][_0xb2e4('0x13')]({'type':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x14')],'app':_0xb2e4('0x15'),'appdata':'MONITOR_OPTIONS=ab','context':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x18')],'exten':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x12')],'priority':_0x762eea[_0xb2e4('0xe')]++,'VoiceExtensionId':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x1b')]});for(var _0x1b5b3b=0x0,_0x2f4033=0x0;_0x1b5b3b<_0x37a304[_0x1ccddf]['length'];_0x1b5b3b+=0x1,_0x2f4033=0x0){var _0x9af66c=_0x37a304[_0x1ccddf][_0x1b5b3b];if(_0x9af66c['type']){_0x9af66c[_0xb2e4('0x14')]=_0x9af66c['type'][_0xb2e4('0x28')]();}var _0x45443c=[];var _0x44fe0b=[];delete _0x9af66c['id'];delete _0x9af66c['createdAt'];delete _0x9af66c[_0xb2e4('0x29')];var _0x5e9388=_0x9af66c[_0xb2e4('0x2a')]!=='*,*,*,*'?[_0x9af66c[_0xb2e4('0x2a')]]:_0x9af66c['IntervalId']?_[_0xb2e4('0x8')](_[_0xb2e4('0x2b')](_0x762eea['intervals'],{'IntervalId':_0x9af66c[_0xb2e4('0x5')]}),_0xb2e4('0x2a')):[];if(_0x9af66c[_0xb2e4('0xd')]('tag')){if(_0x9af66c[_0xb2e4('0x2c')]&&_0x9af66c[_0xb2e4('0x2c')]!=='--'){_0x45443c[_0xb2e4('0x13')]({'type':_0x9af66c[_0xb2e4('0x14')],'app':_0xb2e4('0x15'),'appdata':_0xb2e4('0x2d')+_0x9af66c['tag'],'context':_0x9af66c[_0xb2e4('0x18')],'exten':_0x9af66c[_0xb2e4('0x12')],'priority':_0x5e9388[_0xb2e4('0x2e')]+_0x762eea['priority']+_0x2f4033++,'VoiceExtensionId':_0x9af66c[_0xb2e4('0x1b')]});}}if(_0x9af66c[_0xb2e4('0x14')]===_0xb2e4('0x1c')&&_0x9af66c[_0xb2e4('0xd')]('callerID')){if(_0x9af66c[_0xb2e4('0x2f')]){_0x45443c[_0xb2e4('0x13')]({'type':_0x9af66c[_0xb2e4('0x14')],'app':_0xb2e4('0x1f'),'appdata':_0xb2e4('0x30')+_0x9af66c[_0xb2e4('0x2f')]+')','context':_0x9af66c[_0xb2e4('0x18')],'exten':_0x9af66c[_0xb2e4('0x12')],'priority':_0x5e9388[_0xb2e4('0x2e')]+_0x762eea[_0xb2e4('0xe')]+_0x2f4033++,'VoiceExtensionId':_0x9af66c[_0xb2e4('0x1b')]});}else{_0x45443c['push']({'type':_0x9af66c['type'],'app':_0xb2e4('0x1f'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x9af66c[_0xb2e4('0x18')],'exten':_0x9af66c[_0xb2e4('0x12')],'priority':_0x5e9388[_0xb2e4('0x2e')]+_0x762eea[_0xb2e4('0xe')]+_0x2f4033++,'VoiceExtensionId':_0x9af66c[_0xb2e4('0x1b')]});}}if(_0x9af66c[_0xb2e4('0xd')](_0xb2e4('0x31'))){if(_0x1752d6[_0xb2e4('0x32')](_0x9af66c['app']['toLowerCase']())>=0x0&&_0x9af66c[_0xb2e4('0x33')]!==_0xb2e4('0x34')){if(_0x9af66c[_0xb2e4('0x31')]){_0x45443c['push']({'type':_0x9af66c[_0xb2e4('0x14')],'app':_0xb2e4('0x1f'),'appdata':_0xb2e4('0x35'),'context':_0x9af66c['context'],'exten':_0x9af66c[_0xb2e4('0x12')],'priority':_0x5e9388['length']+_0x762eea[_0xb2e4('0xe')]+_0x2f4033++,'VoiceExtensionId':_0x9af66c['VoiceExtensionId']});_0x45443c['push']({'type':_0x9af66c[_0xb2e4('0x14')],'app':_0xb2e4('0x15'),'appdata':_0xb2e4('0x36'),'context':_0x9af66c[_0xb2e4('0x18')],'exten':_0x9af66c['exten'],'priority':_0x5e9388[_0xb2e4('0x2e')]+_0x762eea[_0xb2e4('0xe')]+_0x2f4033++,'VoiceExtensionId':_0x9af66c[_0xb2e4('0x1b')]});}else{_0x45443c['push']({'type':_0x9af66c[_0xb2e4('0x14')],'app':_0xb2e4('0x1f'),'appdata':_0xb2e4('0x37'),'context':_0x9af66c[_0xb2e4('0x18')],'exten':_0x9af66c[_0xb2e4('0x12')],'priority':_0x5e9388[_0xb2e4('0x2e')]+_0x762eea['priority']+_0x2f4033++,'VoiceExtensionId':_0x9af66c[_0xb2e4('0x1b')]});_0x45443c[_0xb2e4('0x13')]({'type':_0x9af66c['type'],'app':_0xb2e4('0x15'),'appdata':_0xb2e4('0x38'),'context':_0x9af66c['context'],'exten':_0x9af66c[_0xb2e4('0x12')],'priority':_0x5e9388['length']+_0x762eea[_0xb2e4('0xe')]+_0x2f4033++,'VoiceExtensionId':_0x9af66c[_0xb2e4('0x1b')]});}}}for(var _0x3fcae4=0x0;_0x3fcae4<_0x5e9388[_0xb2e4('0x2e')];_0x3fcae4+=0x1){var _0x3d2dde=_0x762eea['priority']+_0x5e9388['length'];var _0x1ba8df=_0x3fcae4===_0x5e9388[_0xb2e4('0x2e')]-0x1?_0x762eea[_0xb2e4('0xe')]+_0x45443c[_0xb2e4('0x2e')]+_0x44fe0b[_0xb2e4('0x2e')]+0x2:_0x762eea[_0xb2e4('0xe')]+_0x3fcae4+0x1;_0x45443c['splice'](_0x3fcae4,0x0,{'type':_0x9af66c['type'],'app':_0xb2e4('0x39'),'appdata':_0x5e9388[_0x3fcae4]+'?'+_0x9af66c[_0xb2e4('0x18')]+_0xb2e4('0x3a')+_0x3d2dde+':'+_0x9af66c[_0xb2e4('0x18')]+',${EXTEN},'+_0x1ba8df,'exten':_0x9af66c[_0xb2e4('0x12')],'context':_0x9af66c['context'],'priority':_0x762eea[_0xb2e4('0xe')]+_0x3fcae4,'VoiceExtensionId':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x1b')]});}_0x9af66c[_0xb2e4('0xe')]=_0x45443c[_0xb2e4('0x2e')]?_['last'](_0x45443c)['priority']+0x1:_0x762eea[_0xb2e4('0xe')];_0x762eea[_0xb2e4('0xe')]=(_0x44fe0b[_0xb2e4('0x2e')]?_[_0xb2e4('0x3b')](_0x44fe0b)[_0xb2e4('0xe')]:_0x9af66c['priority'])+0x1;_0x762eea[_0xb2e4('0xf')]=_[_0xb2e4('0x3c')](_0x762eea[_0xb2e4('0xf')],_0x45443c,[_0x9af66c],_0x44fe0b);}_0x762eea[_0xb2e4('0xf')]['push']({'type':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x14')],'app':'Hangup','exten':_0x37a304[_0x1ccddf][0x0]['exten'],'context':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x18')],'priority':_0x762eea[_0xb2e4('0xe')],'VoiceExtensionId':_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x1b')]});_0x40a733[_0xb2e4('0x13')](_0x37a304[_0x1ccddf][0x0][_0xb2e4('0x1b')]);_0x29232b=_['concat'](_0x29232b,_0x762eea[_0xb2e4('0xf')]);}}return _0x43e39b[_0xb2e4('0x3d')](function(_0x15ac4b){return _0x43e39b[_0xb2e4('0x1')][_0xb2e4('0x6')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x40a733}},'transaction':_0x15ac4b})[_0xb2e4('0x4')](function(_0x1e3a3d){return _0x43e39b['models'][_0xb2e4('0x6')]['bulkCreate'](_['sortBy'](_0x29232b,_0xb2e4('0xe')),{'transaction':_0x15ac4b});});});})[_0xb2e4('0x3e')](function(_0x4b8b34){console[_0xb2e4('0x3f')](_0x4b8b34);});}exports[_0xb2e4('0x40')]=rewrite; \ No newline at end of file +var _0x5cc8=['updatedAt','interval','*,*,*,*','tag','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','appType','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','util','then','intervals','models','findAll','IntervalId','VoiceExtension','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','playback','priority','extensions','extension','find','push','type','Set','format','context','inbound','CDR(routeid)=','VoiceExtensionId','outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt'];(function(_0x1e4e40,_0x4ea87d){var _0x5e93fa=function(_0xc08b86){while(--_0xc08b86){_0x1e4e40['push'](_0x1e4e40['shift']());}};_0x5e93fa(++_0x4ea87d);}(_0x5cc8,0x183));var _0x85cc=function(_0x4bee3e,_0x94b87a){_0x4bee3e=_0x4bee3e-0x0;var _0x2749b0=_0x5cc8[_0x4bee3e];return _0x2749b0;};'use strict';var _=require('lodash');var util=require(_0x85cc('0x0'));function rewrite(_0x5ed8a4,_0x32be79){var _0xd98514=this;return _0x5ed8a4['models']['Interval']['findAll']({'raw':!![]})[_0x85cc('0x1')](function(_0x10812){_0xd98514[_0x85cc('0x2')]=_0x10812;return _0x5ed8a4[_0x85cc('0x3')]['VoiceExtension'][_0x85cc('0x4')]({'where':{'IntervalId':_0x32be79[_0x85cc('0x5')]},'raw':!![]});})[_0x85cc('0x1')](function(_0x41fca7){return _0x5ed8a4['models'][_0x85cc('0x6')][_0x85cc('0x4')]({'where':{'exten':{'$in':_['uniq'](_[_0x85cc('0x7')](_0x41fca7,_0x85cc('0x8')))}},'order':[{'raw':_0x85cc('0x9')}],'raw':!![]});})['then'](function(_0x4935e0){var _0x547ca3=_[_0x85cc('0xa')](_0x4935e0,{'priority':'1'});var _0x57df87=_['filter'](_0x4935e0,{'isApp':0x1});var _0x1d9636=_['groupBy'](_0x57df87,_0x85cc('0x8'));var _0x57cc85=[_0x85cc('0xb'),_0x85cc('0xc')];var _0x456d5b=[];var _0x273acb=[];for(var _0x12a708 in _0x1d9636){if(_0x1d9636['hasOwnProperty'](_0x12a708)){_0xd98514[_0x85cc('0xd')]=0x2;_0xd98514[_0x85cc('0xe')]=[];_0xd98514[_0x85cc('0xf')]=_[_0x85cc('0x10')](_0x547ca3,{'exten':_0x1d9636[_0x12a708][0x0][_0x85cc('0x8')]});_0xd98514[_0x85cc('0xe')][_0x85cc('0x11')]({'type':_0x1d9636[_0x12a708][0x0][_0x85cc('0x12')],'app':_0x85cc('0x13'),'appdata':util[_0x85cc('0x14')]('CDR(type)=%s',_0x1d9636[_0x12a708][0x0][_0x85cc('0x12')]),'context':_0x1d9636[_0x12a708][0x0][_0x85cc('0x15')],'exten':_0x1d9636[_0x12a708][0x0][_0x85cc('0x8')],'priority':_0xd98514[_0x85cc('0xd')]++,'VoiceExtensionId':_0x1d9636[_0x12a708][0x0]['VoiceExtensionId']});if(_0x1d9636[_0x12a708][0x0][_0x85cc('0x12')]===_0x85cc('0x16')){_0xd98514[_0x85cc('0xe')][_0x85cc('0x11')]({'type':_0x1d9636[_0x12a708][0x0][_0x85cc('0x12')],'app':'Set','appdata':_0x85cc('0x17')+_0x1d9636[_0x12a708][0x0][_0x85cc('0x18')],'context':_0x1d9636[_0x12a708][0x0][_0x85cc('0x15')],'exten':_0x1d9636[_0x12a708][0x0][_0x85cc('0x8')],'priority':_0xd98514[_0x85cc('0xd')]++,'VoiceExtensionId':_0x1d9636[_0x12a708][0x0]['VoiceExtensionId']});}else if(_0x1d9636[_0x12a708][0x0][_0x85cc('0x12')]===_0x85cc('0x19')){if(_0xd98514[_0x85cc('0xf')]){_0xd98514[_0x85cc('0xe')][_0x85cc('0x11')]({'type':_0x1d9636[_0x12a708][0x0][_0x85cc('0x12')],'app':'Set','appdata':_0x85cc('0x1a')+(_0xd98514[_0x85cc('0xf')]['cutdigits']?'${EXTEN:'+_0xd98514[_0x85cc('0xf')][_0x85cc('0x1b')]+'}':_0x85cc('0x1c')),'context':_0x1d9636[_0x12a708][0x0][_0x85cc('0x15')],'exten':_0x1d9636[_0x12a708][0x0][_0x85cc('0x8')],'priority':_0xd98514['priority']++,'VoiceExtensionId':_0x1d9636[_0x12a708][0x0]['VoiceExtensionId']});}_0xd98514[_0x85cc('0xe')][_0x85cc('0x11')]({'type':_0x1d9636[_0x12a708][0x0]['type'],'app':_0x85cc('0x13'),'appdata':_0x85cc('0x17')+_0x1d9636[_0x12a708][0x0][_0x85cc('0x18')],'context':_0x1d9636[_0x12a708][0x0]['context'],'exten':_0x1d9636[_0x12a708][0x0][_0x85cc('0x8')],'priority':_0xd98514[_0x85cc('0xd')]++,'VoiceExtensionId':_0x1d9636[_0x12a708][0x0]['VoiceExtensionId']});var _0x58c8dd=_0xd98514['priority']++;_0xd98514[_0x85cc('0xe')][_0x85cc('0x11')]({'type':_0x1d9636[_0x12a708][0x0][_0x85cc('0x12')],'app':_0x85cc('0x1d'),'appdata':_0x85cc('0x1e')+(_0x58c8dd+0x2)+_0x85cc('0x1f')+(_0x58c8dd+0x1)+')','context':_0x1d9636[_0x12a708][0x0][_0x85cc('0x15')],'exten':_0x1d9636[_0x12a708][0x0][_0x85cc('0x8')],'priority':_0x58c8dd,'VoiceExtensionId':_0x1d9636[_0x12a708][0x0][_0x85cc('0x18')]});if(_0xd98514['extension']){_0xd98514[_0x85cc('0xe')][_0x85cc('0x11')]({'type':_0x1d9636[_0x12a708][0x0]['type'],'app':'Set','appdata':_0xd98514['extension'][_0x85cc('0x1b')]?_0x85cc('0x20')+_0xd98514[_0x85cc('0xf')][_0x85cc('0x1b')]+'}':_0x85cc('0x21'),'context':_0x1d9636[_0x12a708][0x0][_0x85cc('0x15')],'exten':_0x1d9636[_0x12a708][0x0][_0x85cc('0x8')],'priority':_0xd98514[_0x85cc('0xd')]++,'VoiceExtensionId':_0x1d9636[_0x12a708][0x0]['VoiceExtensionId']});}_0xd98514[_0x85cc('0xe')][_0x85cc('0x11')]({'type':_0x1d9636[_0x12a708][0x0][_0x85cc('0x12')],'app':_0x85cc('0x13'),'appdata':'outboundrouteid='+_0x1d9636[_0x12a708][0x0][_0x85cc('0x18')],'context':_0x1d9636[_0x12a708][0x0][_0x85cc('0x15')],'exten':_0x1d9636[_0x12a708][0x0]['exten'],'priority':_0xd98514[_0x85cc('0xd')]++,'VoiceExtensionId':_0x1d9636[_0x12a708][0x0][_0x85cc('0x18')]});if(_0xd98514[_0x85cc('0xf')]&&_0xd98514[_0x85cc('0xf')][_0x85cc('0x22')]('recordingFormat')&&_0xd98514[_0x85cc('0xf')][_0x85cc('0x23')]!==_0x85cc('0x24')){_0xd98514[_0x85cc('0xe')][_0x85cc('0x11')]({'type':_0x1d9636[_0x12a708][0x0][_0x85cc('0x12')],'app':_0x85cc('0x13'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x1d9636[_0x12a708][0x0][_0x85cc('0x15')],'exten':_0x1d9636[_0x12a708][0x0][_0x85cc('0x8')],'priority':_0xd98514[_0x85cc('0xd')]++,'VoiceExtensionId':_0x1d9636[_0x12a708][0x0][_0x85cc('0x18')]});_0xd98514[_0x85cc('0xe')]['push']({'type':_0x1d9636[_0x12a708][0x0][_0x85cc('0x12')],'app':'Set','appdata':_0x85cc('0x25')+_0xd98514[_0x85cc('0xf')][_0x85cc('0x23')]||_0x85cc('0x26'),'context':_0x1d9636[_0x12a708][0x0][_0x85cc('0x15')],'exten':_0x1d9636[_0x12a708][0x0][_0x85cc('0x8')],'priority':_0xd98514[_0x85cc('0xd')]++,'VoiceExtensionId':_0x1d9636[_0x12a708][0x0][_0x85cc('0x18')]});}}_0xd98514[_0x85cc('0xe')][_0x85cc('0x11')]({'type':_0x1d9636[_0x12a708][0x0][_0x85cc('0x12')],'app':_0x85cc('0x13'),'appdata':_0x85cc('0x27'),'context':_0x1d9636[_0x12a708][0x0][_0x85cc('0x15')],'exten':_0x1d9636[_0x12a708][0x0][_0x85cc('0x8')],'priority':_0xd98514['priority']++,'VoiceExtensionId':_0x1d9636[_0x12a708][0x0]['VoiceExtensionId']});_0xd98514[_0x85cc('0xe')][_0x85cc('0x11')]({'type':_0x1d9636[_0x12a708][0x0][_0x85cc('0x12')],'app':_0x85cc('0x13'),'appdata':_0x85cc('0x28'),'context':_0x1d9636[_0x12a708][0x0][_0x85cc('0x15')],'exten':_0x1d9636[_0x12a708][0x0][_0x85cc('0x8')],'priority':_0xd98514['priority']++,'VoiceExtensionId':_0x1d9636[_0x12a708][0x0][_0x85cc('0x18')]});_0xd98514[_0x85cc('0xe')]['push']({'type':_0x1d9636[_0x12a708][0x0][_0x85cc('0x12')],'app':_0x85cc('0x13'),'appdata':_0x85cc('0x29'),'context':_0x1d9636[_0x12a708][0x0][_0x85cc('0x15')],'exten':_0x1d9636[_0x12a708][0x0][_0x85cc('0x8')],'priority':_0xd98514[_0x85cc('0xd')]++,'VoiceExtensionId':_0x1d9636[_0x12a708][0x0][_0x85cc('0x18')]});for(var _0x4e78f9=0x0,_0x38fc39=0x0;_0x4e78f9<_0x1d9636[_0x12a708][_0x85cc('0x2a')];_0x4e78f9+=0x1,_0x38fc39=0x0){var _0x5aa228=_0x1d9636[_0x12a708][_0x4e78f9];if(_0x5aa228[_0x85cc('0x12')]){_0x5aa228['type']=_0x5aa228[_0x85cc('0x12')][_0x85cc('0x2b')]();}var _0xf08134=[];var _0x12c4d2=[];delete _0x5aa228['id'];delete _0x5aa228[_0x85cc('0x2c')];delete _0x5aa228[_0x85cc('0x2d')];var _0x4d1cd5=_0x5aa228[_0x85cc('0x2e')]!==_0x85cc('0x2f')?[_0x5aa228['interval']]:_0x5aa228['IntervalId']?_['map'](_[_0x85cc('0xa')](_0xd98514['intervals'],{'IntervalId':_0x5aa228[_0x85cc('0x5')]}),'interval'):[];if(_0x5aa228['hasOwnProperty']('tag')){if(_0x5aa228['tag']&&_0x5aa228[_0x85cc('0x30')]!=='--'){_0xf08134[_0x85cc('0x11')]({'type':_0x5aa228[_0x85cc('0x12')],'app':_0x85cc('0x13'),'appdata':'CDR(tag)='+_0x5aa228[_0x85cc('0x30')],'context':_0x5aa228[_0x85cc('0x15')],'exten':_0x5aa228[_0x85cc('0x8')],'priority':_0x4d1cd5[_0x85cc('0x2a')]+_0xd98514[_0x85cc('0xd')]+_0x38fc39++,'VoiceExtensionId':_0x5aa228[_0x85cc('0x18')]});}}if(_0x5aa228['type']===_0x85cc('0x19')&&_0x5aa228['hasOwnProperty'](_0x85cc('0x31'))){if(_0x5aa228[_0x85cc('0x31')]){_0xf08134[_0x85cc('0x11')]({'type':_0x5aa228[_0x85cc('0x12')],'app':_0x85cc('0x1d'),'appdata':_0x85cc('0x32')+_0x5aa228['callerID']+')','context':_0x5aa228[_0x85cc('0x15')],'exten':_0x5aa228['exten'],'priority':_0x4d1cd5[_0x85cc('0x2a')]+_0xd98514[_0x85cc('0xd')]+_0x38fc39++,'VoiceExtensionId':_0x5aa228['VoiceExtensionId']});}else{_0xf08134[_0x85cc('0x11')]({'type':_0x5aa228[_0x85cc('0x12')],'app':'ExecIf','appdata':_0x85cc('0x33'),'context':_0x5aa228['context'],'exten':_0x5aa228['exten'],'priority':_0x4d1cd5[_0x85cc('0x2a')]+_0xd98514[_0x85cc('0xd')]+_0x38fc39++,'VoiceExtensionId':_0x5aa228[_0x85cc('0x18')]});}}if(_0x5aa228[_0x85cc('0x22')]('answer')){if(_0x57cc85[_0x85cc('0x34')](_0x5aa228[_0x85cc('0x35')][_0x85cc('0x2b')]())>=0x0&&_0x5aa228[_0x85cc('0x36')]!==_0x85cc('0x37')){if(_0x5aa228[_0x85cc('0x38')]){_0xf08134['push']({'type':_0x5aa228['type'],'app':_0x85cc('0x1d'),'appdata':_0x85cc('0x39'),'context':_0x5aa228[_0x85cc('0x15')],'exten':_0x5aa228[_0x85cc('0x8')],'priority':_0x4d1cd5[_0x85cc('0x2a')]+_0xd98514[_0x85cc('0xd')]+_0x38fc39++,'VoiceExtensionId':_0x5aa228[_0x85cc('0x18')]});_0xf08134[_0x85cc('0x11')]({'type':_0x5aa228['type'],'app':_0x85cc('0x13'),'appdata':_0x85cc('0x3a'),'context':_0x5aa228[_0x85cc('0x15')],'exten':_0x5aa228[_0x85cc('0x8')],'priority':_0x4d1cd5['length']+_0xd98514[_0x85cc('0xd')]+_0x38fc39++,'VoiceExtensionId':_0x5aa228['VoiceExtensionId']});}else{_0xf08134['push']({'type':_0x5aa228[_0x85cc('0x12')],'app':_0x85cc('0x1d'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x5aa228[_0x85cc('0x15')],'exten':_0x5aa228[_0x85cc('0x8')],'priority':_0x4d1cd5[_0x85cc('0x2a')]+_0xd98514[_0x85cc('0xd')]+_0x38fc39++,'VoiceExtensionId':_0x5aa228[_0x85cc('0x18')]});_0xf08134[_0x85cc('0x11')]({'type':_0x5aa228[_0x85cc('0x12')],'app':_0x85cc('0x13'),'appdata':_0x85cc('0x3b'),'context':_0x5aa228['context'],'exten':_0x5aa228[_0x85cc('0x8')],'priority':_0x4d1cd5[_0x85cc('0x2a')]+_0xd98514[_0x85cc('0xd')]+_0x38fc39++,'VoiceExtensionId':_0x5aa228[_0x85cc('0x18')]});}}}for(var _0x1e3a71=0x0;_0x1e3a71<_0x4d1cd5[_0x85cc('0x2a')];_0x1e3a71+=0x1){var _0x1dcb89=_0xd98514[_0x85cc('0xd')]+_0x4d1cd5[_0x85cc('0x2a')];var _0x142985=_0x1e3a71===_0x4d1cd5[_0x85cc('0x2a')]-0x1?_0xd98514[_0x85cc('0xd')]+_0xf08134[_0x85cc('0x2a')]+_0x12c4d2['length']+0x2:_0xd98514[_0x85cc('0xd')]+_0x1e3a71+0x1;_0xf08134[_0x85cc('0x3c')](_0x1e3a71,0x0,{'type':_0x5aa228[_0x85cc('0x12')],'app':'GotoIfTime','appdata':_0x4d1cd5[_0x1e3a71]+'?'+_0x5aa228[_0x85cc('0x15')]+_0x85cc('0x3d')+_0x1dcb89+':'+_0x5aa228['context']+',${EXTEN},'+_0x142985,'exten':_0x5aa228[_0x85cc('0x8')],'context':_0x5aa228[_0x85cc('0x15')],'priority':_0xd98514[_0x85cc('0xd')]+_0x1e3a71,'VoiceExtensionId':_0x1d9636[_0x12a708][0x0][_0x85cc('0x18')]});}_0x5aa228[_0x85cc('0xd')]=_0xf08134[_0x85cc('0x2a')]?_[_0x85cc('0x3e')](_0xf08134)[_0x85cc('0xd')]+0x1:_0xd98514['priority'];_0xd98514[_0x85cc('0xd')]=(_0x12c4d2[_0x85cc('0x2a')]?_[_0x85cc('0x3e')](_0x12c4d2)[_0x85cc('0xd')]:_0x5aa228[_0x85cc('0xd')])+0x1;_0xd98514['extensions']=_[_0x85cc('0x3f')](_0xd98514[_0x85cc('0xe')],_0xf08134,[_0x5aa228],_0x12c4d2);}_0xd98514[_0x85cc('0xe')][_0x85cc('0x11')]({'type':_0x1d9636[_0x12a708][0x0]['type'],'app':_0x85cc('0x40'),'exten':_0x1d9636[_0x12a708][0x0][_0x85cc('0x8')],'context':_0x1d9636[_0x12a708][0x0][_0x85cc('0x15')],'priority':_0xd98514['priority'],'VoiceExtensionId':_0x1d9636[_0x12a708][0x0][_0x85cc('0x18')]});_0x456d5b[_0x85cc('0x11')](_0x1d9636[_0x12a708][0x0][_0x85cc('0x18')]);_0x273acb=_[_0x85cc('0x3f')](_0x273acb,_0xd98514[_0x85cc('0xe')]);}}return _0x5ed8a4[_0x85cc('0x41')](function(_0x1afab1){return _0x5ed8a4[_0x85cc('0x3')][_0x85cc('0x6')][_0x85cc('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x456d5b}},'transaction':_0x1afab1})[_0x85cc('0x1')](function(_0x1ee142){return _0x5ed8a4['models'][_0x85cc('0x6')][_0x85cc('0x43')](_[_0x85cc('0x44')](_0x273acb,_0x85cc('0xd')),{'transaction':_0x1afab1});});});})[_0x85cc('0x45')](function(_0x2f5501){console[_0x85cc('0x46')](_0x2f5501);});}exports[_0x85cc('0x47')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 2174dc6..677825e 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 _0x8143=['Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','resolve','split','CmContact','createReadStream','parse','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','bluebird','util','lodash','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','index','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','duplicate','Duplicate\x20Contact','create','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','cm_hopper','fromQuery','ContactId','createdAt','select','field','NOW()','scheduledAt','toString','updatedAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','into','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','always','query','onlyIfOpen','sequelize','VoiceQueueId','get','all','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s'];(function(_0x318256,_0xa773f3){var _0xb1e352=function(_0x4bb14e){while(--_0x4bb14e){_0x318256['push'](_0x318256['shift']());}};_0xb1e352(++_0xa773f3);}(_0x8143,0x1dd));var _0x3814=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8143[_0x122ef9];return _0x42fba0;};'use strict';var BPromise=require(_0x3814('0x0'));var util=require(_0x3814('0x1'));var _=require(_0x3814('0x2'));var fs=require('fs');var squel=require(_0x3814('0x3'));var Papa=require(_0x3814('0x4'));var Redis=require(_0x3814('0x5'));var db=require(_0x3814('0x6'))['db'];var config=require(_0x3814('0x7'));var logger=require(_0x3814('0x8'))(_0x3814('0x9'));config[_0x3814('0xa')]=_[_0x3814('0xb')](config[_0x3814('0xa')],{'host':_0x3814('0xc'),'port':0x18eb});var socket=require(_0x3814('0xd'))(new Redis(config[_0x3814('0xa')]));require(_0x3814('0xe'))[_0x3814('0xf')](socket);try{if(!process[_0x3814('0x10')][0x2]||process[_0x3814('0x10')][0x2]===_0x3814('0x11')||process[_0x3814('0x10')][0x2]==='null'){throw new Error(_0x3814('0x12'));}var FILEPATH=process[_0x3814('0x10')][0x2];if(!process[_0x3814('0x10')][0x3]||process['argv'][0x3]===_0x3814('0x11')||process[_0x3814('0x10')][0x3]===_0x3814('0x13')||!process[_0x3814('0x10')][0x4]||process[_0x3814('0x10')][0x4]===_0x3814('0x11')||process[_0x3814('0x10')][0x4]===_0x3814('0x13')){throw new Error(_0x3814('0x14'));}var FIELDS=_[_0x3814('0x15')](process[_0x3814('0x10')][0x3]['split'](','),process['argv'][0x4]['split'](','));if(!process[_0x3814('0x10')][0x5]||process['argv'][0x5]===_0x3814('0x11')||process[_0x3814('0x10')][0x5]==='null'){throw new Error(_0x3814('0x16'));}var LISTID=process[_0x3814('0x10')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x3814('0x10')][0x6]!==_0x3814('0x11')&&process[_0x3814('0x10')][0x6]!==_0x3814('0x13')?process[_0x3814('0x10')][0x6]:null;var DUPLICATES=process[_0x3814('0x10')][0x7]&&process['argv'][0x7]!==_0x3814('0x11')&&process[_0x3814('0x10')][0x7]!=='null'?process['argv'][0x7]:null;if(!process['argv'][0x8]||process['argv'][0x8]===_0x3814('0x11')||process[_0x3814('0x10')][0x8]===_0x3814('0x13')){throw new Error(_0x3814('0x17'));}var SOCKET_TIMESTAMP=process[_0x3814('0x10')][0x8];}catch(_0x5d6944){logger[_0x3814('0x18')](_0x5d6944);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(_0x49266d,_0x1b768c,_0x4894f4,_0x5e9730){var _0x1aefe7={'message':_0x1b768c};_0x1aefe7[_0x49266d]=!![];if(_0x4894f4){_0x1aefe7['contact']=_0x4894f4;}if(_0x5e9730){_0x1aefe7[_0x3814('0x19')]=_0x5e9730;}return _0x1aefe7;}function isEmail(_0x3753a0){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'](_0x3753a0);}function checkRow(_0x25b779,_0x2ebe59,_0x630e54){return new BPromise(function(_0x2313d9,_0x15c9fb){if(_['isNil'](_0x25b779)){return _0x15c9fb(handleCheckRowError(_0x3814('0x18'),_0x3814('0x1a'),null,_0x630e54));}if(_0x25b779['errors']&&_0x25b779[_0x3814('0x1b')][_0x3814('0x1c')]){var _0x56ffcf=_['map'](_0x25b779[_0x3814('0x1b')],_0x3814('0x1d'))[_0x3814('0x1e')](';');return _0x15c9fb(handleCheckRowError(_0x3814('0x18'),_0x56ffcf,null,_0x630e54));}var _0x368327={};for(var _0x4581db in FIELDS){if(FIELDS[_0x3814('0x1f')](_0x4581db)&&FIELDS[_0x4581db]){_0x368327[_0x4581db]=_0x25b779[_0x3814('0x20')][0x0][FIELDS[_0x4581db]]||_0x25b779[_0x3814('0x20')][0x0]['\ufeff'+FIELDS[_0x4581db]];}}if(!_0x368327[_0x3814('0x21')]){return _0x15c9fb(handleCheckRowError(_0x3814('0x18'),_0x3814('0x22'),null,_0x630e54));}if(!_0x368327[_0x3814('0x23')]){return _0x15c9fb(handleCheckRowError(_0x3814('0x18'),_0x3814('0x24'),null,_0x630e54));}if(_0x368327[_0x3814('0x25')]){var _0x458216=moment(_0x368327[_0x3814('0x25')],_0x3814('0x26'));if(!_0x458216['isValid']()){return _0x15c9fb(handleCheckRowError(_0x3814('0x18'),_0x3814('0x27'),null,_0x630e54));}}if(_0x368327[_0x3814('0x28')]){if(!isEmail(_0x368327[_0x3814('0x28')])){return _0x15c9fb(handleCheckRowError(_0x3814('0x18'),_0x3814('0x29'),null,_0x630e54));}}_0x368327[_0x3814('0x2a')]=LISTID;_0x368327[_0x3814('0x2b')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x2ebe59){var _0x5d8af0={};for(var _0x41dd23=0x0,_0x3ea644=DUPLICATES[_0x3814('0x1c')];_0x41dd23<_0x3ea644;_0x41dd23+=0x1){_0x5d8af0[DUPLICATES[_0x41dd23]]=_0x368327[DUPLICATES[_0x41dd23]];}var _0x293255=_['find'](_0x2ebe59,_0x5d8af0);if(_0x293255){return _0x15c9fb(handleCheckRowError(_0x3814('0x2c'),_0x3814('0x2d'),_0x293255,_0x630e54));}}return db['CmContact'][_0x3814('0x2e')](_0x368327,{'raw':!![],'hooks':![],'fields':_['keys'](_0x368327)})[_0x3814('0x2f')](function(_0x5f4206){if(DUPLICATES&&DUPLICATES[_0x3814('0x1c')]&&_0x2ebe59){_0x2ebe59[_0x3814('0x30')](_[_0x3814('0x31')](_0x368327,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x5f4206['id'];return _0x2313d9();})[_0x3814('0x32')](function(_0x465d86){return _0x15c9fb(handleCheckRowError(_0x3814('0x18'),_0x3814('0x33')+(_0x465d86[_0x3814('0x1d')]||JSON[_0x3814('0x34')](_0x465d86)),null,_0x630e54));});});}function checkHopper(){function _0xce8ea(){return function(_0x41b9e7){logger[_0x3814('0x18')](_0x3814('0x35'),_0x3814('0x36'),util[_0x3814('0x37')](_0x41b9e7,{'showHidden':![],'depth':null}));};}var _0x248a93=function(_0x57bee6,_0x2a78f9){var _0x39a706=squel[_0x3814('0x38')]()['into'](_0x3814('0x39'))[_0x3814('0x3a')]([_0x3814('0x23'),'scheduledAt',_0x3814('0x3b'),_0x3814('0x2a'),_0x2a78f9,_0x3814('0x3c'),'updatedAt'],squel[_0x3814('0x3d')]()[_0x3814('0x3e')]('phone',_0x3814('0x23'))['field'](_0x3814('0x3f'),_0x3814('0x40'))[_0x3814('0x3e')]('id',_0x3814('0x3b'))[_0x3814('0x3e')](LISTID[_0x3814('0x41')](),_0x3814('0x2a'))[_0x3814('0x3e')](_0x57bee6['id'][_0x3814('0x41')](),_0x2a78f9)[_0x3814('0x3e')]('NOW()',_0x3814('0x3c'))['field'](_0x3814('0x3f'),_0x3814('0x42'))[_0x3814('0x43')](_0x3814('0x44'))[_0x3814('0x45')](_0x3814('0x46'))['where'](_0x3814('0x47'),LISTID[_0x3814('0x41')]())[_0x3814('0x45')](_0x3814('0x48'))[_0x3814('0x45')](_0x3814('0x49'),squel[_0x3814('0x3d')]()[_0x3814('0x3e')](_0x3814('0x23'))['from'](_0x3814('0x39'))[_0x3814('0x45')](_0x2a78f9+_0x3814('0x4a'),_0x57bee6['id']['toString']())))['toString']();return _0x39a706;};var _0x5d14a8=function(_0x454d7c,_0x5c6132){var _0x319b7a=squel[_0x3814('0x38')]()[_0x3814('0x4b')]('cm_hopper')['fromQuery']([_0x3814('0x23'),_0x3814('0x40'),_0x3814('0x3b'),_0x3814('0x2a'),_0x5c6132,_0x3814('0x3c'),_0x3814('0x42')],squel['select']()[_0x3814('0x3e')](_0x3814('0x23'),_0x3814('0x23'))[_0x3814('0x3e')]('NOW()',_0x3814('0x40'))[_0x3814('0x3e')]('id',_0x3814('0x3b'))[_0x3814('0x3e')](LISTID['toString'](),_0x3814('0x2a'))['field'](_0x454d7c['id']['toString'](),_0x5c6132)[_0x3814('0x3e')](_0x3814('0x3f'),_0x3814('0x3c'))[_0x3814('0x3e')]('NOW()',_0x3814('0x42'))[_0x3814('0x43')]('cm_contacts')[_0x3814('0x45')](_0x3814('0x46'))['where'](_0x3814('0x47'),LISTID[_0x3814('0x41')]())[_0x3814('0x45')](_0x3814('0x4c'),squel[_0x3814('0x4d')](hopperContacts))[_0x3814('0x45')](_0x3814('0x48'))[_0x3814('0x45')](_0x3814('0x49'),squel['select']()[_0x3814('0x3e')](_0x3814('0x4e'))[_0x3814('0x43')](_0x3814('0x4f'))['where'](_0x5c6132+_0x3814('0x4a'),_0x454d7c['id']['toString']()))[_0x3814('0x45')](_0x3814('0x49'),squel[_0x3814('0x3d')]()[_0x3814('0x3e')]('phone')[_0x3814('0x43')]('cm_hopper')['where'](_0x5c6132+_0x3814('0x4a'),_0x454d7c['id'][_0x3814('0x41')]())))[_0x3814('0x41')]();return _0x319b7a;};function _0x522029(_0x9fb85,_0x1284b1){var _0x37682b=squel['insert']()[_0x3814('0x4b')](_0x3814('0x39'))[_0x3814('0x3a')]([_0x3814('0x23'),_0x3814('0x40'),'ContactId',_0x3814('0x2a'),_0x1284b1,_0x3814('0x3c'),'updatedAt'],squel[_0x3814('0x3d')]()[_0x3814('0x3e')](_0x3814('0x23'),_0x3814('0x23'))[_0x3814('0x3e')](_0x3814('0x3f'),_0x3814('0x40'))[_0x3814('0x3e')]('id',_0x3814('0x3b'))[_0x3814('0x3e')](LISTID[_0x3814('0x41')](),_0x3814('0x2a'))[_0x3814('0x3e')](_0x9fb85['id']['toString'](),_0x1284b1)[_0x3814('0x3e')](_0x3814('0x3f'),_0x3814('0x3c'))['field'](_0x3814('0x3f'),_0x3814('0x42'))[_0x3814('0x43')](_0x3814('0x44'))[_0x3814('0x45')](_0x3814('0x46'))['where'](_0x3814('0x47'),LISTID[_0x3814('0x41')]())['where'](_0x3814('0x4c'),squel['str'](hopperContacts))['where'](_0x3814('0x48')))[_0x3814('0x41')]();return _0x37682b;}function _0x5a67b4(_0x28e24e,_0x15831a){var _0x132586=squel['insert']()[_0x3814('0x4b')](_0x3814('0x50'))[_0x3814('0x3a')]([_0x3814('0x23'),_0x3814('0x3b'),_0x3814('0x2a'),_0x15831a,'createdAt',_0x3814('0x42')],squel[_0x3814('0x3d')]()[_0x3814('0x3e')](_0x3814('0x23'),_0x3814('0x23'))[_0x3814('0x3e')]('id','ContactId')[_0x3814('0x3e')](LISTID[_0x3814('0x41')](),'ListId')[_0x3814('0x3e')](_0x28e24e['id'][_0x3814('0x41')](),_0x15831a)[_0x3814('0x3e')](_0x3814('0x3f'),_0x3814('0x3c'))[_0x3814('0x3e')](_0x3814('0x3f'),_0x3814('0x42'))[_0x3814('0x43')](_0x3814('0x44'))[_0x3814('0x45')](_0x3814('0x46'))[_0x3814('0x45')](_0x3814('0x47'),LISTID['toString']())[_0x3814('0x45')](_0x3814('0x4c'),squel[_0x3814('0x4d')](hopperContacts))[_0x3814('0x45')]('phone\x20IS\x20NOT\x20NULL'))[_0x3814('0x41')]();return _0x132586;}return db[_0x3814('0x51')][_0x3814('0x52')]({'where':{'type':_0x3814('0x53')},'attributes':['id',_0x3814('0x54')],'include':[{'model':db[_0x3814('0x55')],'as':_0x3814('0x56'),'where':{'id':LISTID}}]})[_0x3814('0x2f')](function(_0x301cdd){var _0x584b5e=[];if(_0x301cdd){var _0x54c31c;for(var _0x591fea=0x0,_0x266552;_0x591fea<_0x301cdd[_0x3814('0x1c')];_0x591fea+=0x1){_0x266552=_0x301cdd[_0x591fea]['get']({'plain':!![]});switch(_0x266552[_0x3814('0x54')]){case _0x3814('0x57'):_0x584b5e['push'](db['sequelize'][_0x3814('0x58')](_0x5d14a8(_0x266552,'VoiceQueueId'))['then'](function(){})[_0x3814('0x32')](_0xce8ea()));break;case _0x3814('0x59'):_0x584b5e['push'](db[_0x3814('0x5a')][_0x3814('0x58')](_0x248a93(_0x266552,'VoiceQueueId'))[_0x3814('0x2f')](function(){})[_0x3814('0x32')](_0xce8ea()));break;default:_0x584b5e['push'](db[_0x3814('0x5a')][_0x3814('0x58')](_0x522029(_0x266552,_0x3814('0x5b')))[_0x3814('0x2f')](function(){})[_0x3814('0x32')](_0xce8ea()));}}}return _0x584b5e;})['all']()[_0x3814('0x2f')](function(){return db[_0x3814('0x51')][_0x3814('0x52')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x3814('0x55')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x3814('0x2f')](function(_0x42742d){var _0xdeeca4=[];if(_0x42742d){var _0x1e9d9d;for(var _0x257c73=0x0,_0x2f9434;_0x257c73<_0x42742d['length'];_0x257c73+=0x1){_0x2f9434=_0x42742d[_0x257c73][_0x3814('0x5c')]({'plain':!![]});_0xdeeca4[_0x3814('0x30')](db[_0x3814('0x5a')][_0x3814('0x58')](_0x5a67b4(_0x2f9434,_0x3814('0x5b')))[_0x3814('0x2f')](function(){})[_0x3814('0x32')](_0xce8ea()));}}return _0xdeeca4;})[_0x3814('0x5d')]();})[_0x3814('0x2f')](function(){return db[_0x3814('0x5e')]['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x3814('0x55')],'as':_0x3814('0x56'),'where':{'id':LISTID}}]})['then'](function(_0x4f9a82){var _0x12691a=[];if(_0x4f9a82){for(var _0x67e10a=0x0,_0x9bb8df;_0x67e10a<_0x4f9a82[_0x3814('0x1c')];_0x67e10a+=0x1){_0x9bb8df=_0x4f9a82[_0x67e10a]['get']({'plain':!![]});switch(_0x9bb8df[_0x3814('0x54')]){case _0x3814('0x57'):_0x12691a[_0x3814('0x30')](db[_0x3814('0x5a')]['query'](_0x5d14a8(_0x9bb8df,_0x3814('0x5f')))[_0x3814('0x2f')](function(){})[_0x3814('0x32')](_0xce8ea()));break;case _0x3814('0x59'):_0x12691a[_0x3814('0x30')](db[_0x3814('0x5a')][_0x3814('0x58')](_0x248a93(_0x9bb8df,_0x3814('0x5f')))[_0x3814('0x2f')](function(){})[_0x3814('0x32')](_0xce8ea()));break;default:_0x12691a[_0x3814('0x30')](db[_0x3814('0x5a')][_0x3814('0x58')](_0x522029(_0x9bb8df,_0x3814('0x5f')))[_0x3814('0x2f')](function(){})[_0x3814('0x32')](_0xce8ea()));}}}return _0x12691a;})[_0x3814('0x5d')]();})[_0x3814('0x2f')](function(){return db[_0x3814('0x5e')][_0x3814('0x52')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x3814('0x60'),'where':{'id':LISTID}}]})[_0x3814('0x2f')](function(_0x367cf7){var _0x5043ee=[];if(_0x367cf7){for(var _0x1bbbf1=0x0,_0x4126c2;_0x1bbbf1<_0x367cf7[_0x3814('0x1c')];_0x1bbbf1+=0x1){_0x4126c2=_0x367cf7[_0x1bbbf1]['get']({'plain':!![]});_0x5043ee['push'](db[_0x3814('0x5a')]['query'](_0x5a67b4(_0x4126c2,_0x3814('0x5f')))[_0x3814('0x2f')](function(){})[_0x3814('0x32')](_0xce8ea()));}}return _0x5043ee;})[_0x3814('0x5d')]();})[_0x3814('0x32')](function(_0x3d440b){logger[_0x3814('0x18')](_0x3814('0x61'),'generalCheckHopper',_0x3d440b['message']);});}var processPromises=function(_0x961247){return BPromise['all'](promises)['then'](function(_0xc0778d){})['catch'](function(_0x4b07f9){logger[_0x3814('0x18')](_0x3814('0x62'),JSON[_0x3814('0x34')](_0x4b07f9));})['finally'](function(){socket[_0x3814('0x63')](_0x3814('0x64')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x961247){return _0x961247[_0x3814('0x65')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x3814('0x2f')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x3814('0x66')](FILEPATH);}catch(_0x467850){logger[_0x3814('0x18')](_0x3814('0x67'),JSON[_0x3814('0x34')](_0x467850));}finally{process[_0x3814('0x68')](0x0);}});};process['on'](_0x3814('0x69'),function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x3814('0x6a')]()[_0x3814('0x2f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x3814('0x6b')](',');return db[_0x3814('0x6c')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x3814('0x2f')](function(_0x1f141c){var _0x2a3189=fs[_0x3814('0x6d')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x3814('0x6e')](_0x2a3189,{'header':!![],'skipEmptyLines':!![],'step':function(_0x541bc1,_0x364344){total+=0x1;var _0x307232=total;promises[_0x3814('0x30')](checkRow(_0x541bc1,_0x1f141c,_0x307232)[_0x3814('0x2f')](function(){success+=0x1;})[_0x3814('0x32')](function(_0x5dc2c7){if(_0x5dc2c7[_0x3814('0x18')]){errors+=0x1;delete _0x5dc2c7[_0x3814('0x18')];}else if(_0x5dc2c7[_0x3814('0x2c')]){duplicates+=0x1;delete _0x5dc2c7['duplicate'];}rows[_0x3814('0x30')](_0x5dc2c7);}));if(total%0xc8===0x0){_0x364344[_0x3814('0x6f')]();return processPromises(_0x364344);}},'complete':function(){return processPromises()[_0x3814('0x2f')](function(){logger[_0x3814('0x70')](_0x3814('0x71'));endCsv();});},'error':function(_0x497da0,_0x326fea){logger['info'](_0x3814('0x72'),JSON[_0x3814('0x34')](_0x497da0));endCsv();}});})[_0x3814('0x32')](function(_0x5da723){logger['error']('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x3814('0x34')](_0x5da723));});}main(); \ No newline at end of file +var _0x5616=['get','sequelize','query','VoiceQueueId','catch','onlyIfOpen','all','BlackLists','Lists','always','CampaignId','generalCheckHopper','Error\x20processing\x20rows\x20block:','stringify','finally','emit','resume','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','CSV\x20import\x20process\x20stopped!','resolve','createReadStream','parse','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','undefined','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','duplicate','CmContact','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','ContactId','ListId','createdAt','updatedAt','select','field','NOW()','scheduledAt','toString','from','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList'];(function(_0x5cac4a,_0x35926e){var _0x1e7dbb=function(_0x4ade69){while(--_0x4ade69){_0x5cac4a['push'](_0x5cac4a['shift']());}};_0x1e7dbb(++_0x35926e);}(_0x5616,0x15c));var _0x6561=function(_0x4d94fa,_0x2c0d1e){_0x4d94fa=_0x4d94fa-0x0;var _0x312217=_0x5616[_0x4d94fa];return _0x312217;};'use strict';var BPromise=require(_0x6561('0x0'));var util=require(_0x6561('0x1'));var _=require(_0x6561('0x2'));var fs=require('fs');var squel=require(_0x6561('0x3'));var Papa=require(_0x6561('0x4'));var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require(_0x6561('0x5'));var logger=require(_0x6561('0x6'))(_0x6561('0x7'));config[_0x6561('0x8')]=_[_0x6561('0x9')](config[_0x6561('0x8')],{'host':_0x6561('0xa'),'port':0x18eb});var socket=require(_0x6561('0xb'))(new Redis(config[_0x6561('0x8')]));require(_0x6561('0xc'))[_0x6561('0xd')](socket);try{if(!process[_0x6561('0xe')][0x2]||process['argv'][0x2]==='undefined'||process[_0x6561('0xe')][0x2]===_0x6561('0xf')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x6561('0xe')][0x2];if(!process[_0x6561('0xe')][0x3]||process['argv'][0x3]===_0x6561('0x10')||process['argv'][0x3]==='null'||!process[_0x6561('0xe')][0x4]||process['argv'][0x4]===_0x6561('0x10')||process[_0x6561('0xe')][0x4]===_0x6561('0xf')){throw new Error(_0x6561('0x11'));}var FIELDS=_[_0x6561('0x12')](process[_0x6561('0xe')][0x3][_0x6561('0x13')](','),process[_0x6561('0xe')][0x4][_0x6561('0x13')](','));if(!process[_0x6561('0xe')][0x5]||process[_0x6561('0xe')][0x5]===_0x6561('0x10')||process[_0x6561('0xe')][0x5]===_0x6561('0xf')){throw new Error(_0x6561('0x14'));}var LISTID=process[_0x6561('0xe')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x6561('0xe')][0x6]!==_0x6561('0x10')&&process[_0x6561('0xe')][0x6]!==_0x6561('0xf')?process['argv'][0x6]:null;var DUPLICATES=process[_0x6561('0xe')][0x7]&&process[_0x6561('0xe')][0x7]!=='undefined'&&process[_0x6561('0xe')][0x7]!==_0x6561('0xf')?process['argv'][0x7]:null;if(!process['argv'][0x8]||process[_0x6561('0xe')][0x8]===_0x6561('0x10')||process[_0x6561('0xe')][0x8]===_0x6561('0xf')){throw new Error(_0x6561('0x15'));}var SOCKET_TIMESTAMP=process[_0x6561('0xe')][0x8];}catch(_0x158c74){logger[_0x6561('0x16')](_0x158c74);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(_0x40609c,_0x444bbc,_0x18e93a,_0x30719c){var _0x1c3914={'message':_0x444bbc};_0x1c3914[_0x40609c]=!![];if(_0x18e93a){_0x1c3914['contact']=_0x18e93a;}if(_0x30719c){_0x1c3914['index']=_0x30719c;}return _0x1c3914;}function isEmail(_0x5e5e37){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'](_0x5e5e37);}function checkRow(_0x2e1cce,_0x4b3eaf,_0x4937c4){return new BPromise(function(_0x5349ed,_0x438426){if(_['isNil'](_0x2e1cce)){return _0x438426(handleCheckRowError(_0x6561('0x16'),_0x6561('0x17'),null,_0x4937c4));}if(_0x2e1cce[_0x6561('0x18')]&&_0x2e1cce[_0x6561('0x18')][_0x6561('0x19')]){var _0x39f94d=_[_0x6561('0x1a')](_0x2e1cce[_0x6561('0x18')],_0x6561('0x1b'))[_0x6561('0x1c')](';');return _0x438426(handleCheckRowError(_0x6561('0x16'),_0x39f94d,null,_0x4937c4));}var _0x118cc6={};for(var _0x5c64a7 in FIELDS){if(FIELDS['hasOwnProperty'](_0x5c64a7)&&FIELDS[_0x5c64a7]){_0x118cc6[_0x5c64a7]=_0x2e1cce[_0x6561('0x1d')][0x0][FIELDS[_0x5c64a7]]||_0x2e1cce[_0x6561('0x1d')][0x0]['\ufeff'+FIELDS[_0x5c64a7]];}}if(!_0x118cc6[_0x6561('0x1e')]){return _0x438426(handleCheckRowError(_0x6561('0x16'),_0x6561('0x1f'),null,_0x4937c4));}if(!_0x118cc6[_0x6561('0x20')]){return _0x438426(handleCheckRowError('error',_0x6561('0x21'),null,_0x4937c4));}if(_0x118cc6[_0x6561('0x22')]){var _0x57e581=moment(_0x118cc6[_0x6561('0x22')],'YYYY-MM-DD');if(!_0x57e581[_0x6561('0x23')]()){return _0x438426(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x4937c4));}}if(_0x118cc6[_0x6561('0x24')]){if(!isEmail(_0x118cc6[_0x6561('0x24')])){return _0x438426(handleCheckRowError(_0x6561('0x16'),_0x6561('0x25'),null,_0x4937c4));}}_0x118cc6['ListId']=LISTID;_0x118cc6[_0x6561('0x26')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x6561('0x19')]&&_0x4b3eaf){var _0x267fb2={};for(var _0x311223=0x0,_0x40480b=DUPLICATES['length'];_0x311223<_0x40480b;_0x311223+=0x1){_0x267fb2[DUPLICATES[_0x311223]]=_0x118cc6[DUPLICATES[_0x311223]];}var _0x310c94=_[_0x6561('0x27')](_0x4b3eaf,_0x267fb2);if(_0x310c94){return _0x438426(handleCheckRowError(_0x6561('0x28'),'Duplicate\x20Contact',_0x310c94,_0x4937c4));}}return db[_0x6561('0x29')]['create'](_0x118cc6,{'raw':!![],'hooks':![],'fields':_[_0x6561('0x2a')](_0x118cc6)})[_0x6561('0x2b')](function(_0x9e3c4f){if(DUPLICATES&&DUPLICATES[_0x6561('0x19')]&&_0x4b3eaf){_0x4b3eaf[_0x6561('0x2c')](_[_0x6561('0x2d')](_0x118cc6,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x9e3c4f['id'];return _0x5349ed();})['catch'](function(_0x15f2b2){return _0x438426(handleCheckRowError(_0x6561('0x16'),_0x6561('0x2e')+(_0x15f2b2[_0x6561('0x1b')]||JSON['stringify'](_0x15f2b2)),null,_0x4937c4));});});}function checkHopper(){function _0xb18af5(){return function(_0x2074fe){logger['error'](_0x6561('0x2f'),_0x6561('0x30'),util[_0x6561('0x31')](_0x2074fe,{'showHidden':![],'depth':null}));};}var _0x134278=function(_0x1051e0,_0x552524){var _0xf61c3e=squel[_0x6561('0x32')]()[_0x6561('0x33')](_0x6561('0x34'))[_0x6561('0x35')]([_0x6561('0x20'),'scheduledAt',_0x6561('0x36'),_0x6561('0x37'),_0x552524,_0x6561('0x38'),_0x6561('0x39')],squel[_0x6561('0x3a')]()[_0x6561('0x3b')](_0x6561('0x20'),_0x6561('0x20'))[_0x6561('0x3b')](_0x6561('0x3c'),_0x6561('0x3d'))['field']('id','ContactId')[_0x6561('0x3b')](LISTID[_0x6561('0x3e')](),_0x6561('0x37'))[_0x6561('0x3b')](_0x1051e0['id'][_0x6561('0x3e')](),_0x552524)['field'](_0x6561('0x3c'),_0x6561('0x38'))[_0x6561('0x3b')](_0x6561('0x3c'),_0x6561('0x39'))[_0x6561('0x3f')](_0x6561('0x40'))['where']('deletedAt\x20IS\x20NULL')[_0x6561('0x41')](_0x6561('0x42'),LISTID[_0x6561('0x3e')]())[_0x6561('0x41')](_0x6561('0x43'))[_0x6561('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6561('0x3a')]()[_0x6561('0x3b')](_0x6561('0x20'))[_0x6561('0x3f')](_0x6561('0x34'))['where'](_0x552524+_0x6561('0x44'),_0x1051e0['id'][_0x6561('0x3e')]())))[_0x6561('0x3e')]();return _0xf61c3e;};var _0x267085=function(_0x57a6b2,_0x16dd8b){var _0x34ef12=squel[_0x6561('0x32')]()[_0x6561('0x33')](_0x6561('0x34'))[_0x6561('0x35')](['phone',_0x6561('0x3d'),'ContactId','ListId',_0x16dd8b,_0x6561('0x38'),_0x6561('0x39')],squel[_0x6561('0x3a')]()[_0x6561('0x3b')](_0x6561('0x20'),_0x6561('0x20'))[_0x6561('0x3b')](_0x6561('0x3c'),_0x6561('0x3d'))['field']('id','ContactId')['field'](LISTID[_0x6561('0x3e')](),_0x6561('0x37'))[_0x6561('0x3b')](_0x57a6b2['id'][_0x6561('0x3e')](),_0x16dd8b)[_0x6561('0x3b')]('NOW()','createdAt')[_0x6561('0x3b')](_0x6561('0x3c'),_0x6561('0x39'))[_0x6561('0x3f')](_0x6561('0x40'))['where'](_0x6561('0x45'))[_0x6561('0x41')](_0x6561('0x42'),LISTID['toString']())[_0x6561('0x41')](_0x6561('0x46'),squel[_0x6561('0x47')](hopperContacts))[_0x6561('0x41')](_0x6561('0x43'))[_0x6561('0x41')](_0x6561('0x48'),squel[_0x6561('0x3a')]()[_0x6561('0x3b')]('calleridnum')[_0x6561('0x3f')](_0x6561('0x49'))['where'](_0x16dd8b+'\x20=\x20?',_0x57a6b2['id'][_0x6561('0x3e')]()))[_0x6561('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6561('0x3a')]()['field'](_0x6561('0x20'))[_0x6561('0x3f')](_0x6561('0x34'))['where'](_0x16dd8b+_0x6561('0x44'),_0x57a6b2['id'][_0x6561('0x3e')]())))[_0x6561('0x3e')]();return _0x34ef12;};function _0x34e4b4(_0x5530da,_0x48439b){var _0x103f97=squel[_0x6561('0x32')]()[_0x6561('0x33')](_0x6561('0x34'))['fromQuery']([_0x6561('0x20'),_0x6561('0x3d'),_0x6561('0x36'),_0x6561('0x37'),_0x48439b,_0x6561('0x38'),_0x6561('0x39')],squel[_0x6561('0x3a')]()['field'](_0x6561('0x20'),_0x6561('0x20'))[_0x6561('0x3b')](_0x6561('0x3c'),_0x6561('0x3d'))[_0x6561('0x3b')]('id',_0x6561('0x36'))[_0x6561('0x3b')](LISTID[_0x6561('0x3e')](),'ListId')[_0x6561('0x3b')](_0x5530da['id']['toString'](),_0x48439b)['field'](_0x6561('0x3c'),_0x6561('0x38'))[_0x6561('0x3b')](_0x6561('0x3c'),_0x6561('0x39'))[_0x6561('0x3f')]('cm_contacts')[_0x6561('0x41')](_0x6561('0x45'))[_0x6561('0x41')](_0x6561('0x42'),LISTID['toString']())['where']('id\x20IN\x20?',squel[_0x6561('0x47')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x6561('0x3e')]();return _0x103f97;}function _0x1955a1(_0x3d34b5,_0x58be18){var _0x90ac6c=squel[_0x6561('0x32')]()[_0x6561('0x33')](_0x6561('0x4a'))[_0x6561('0x35')]([_0x6561('0x20'),'ContactId',_0x6561('0x37'),_0x58be18,_0x6561('0x38'),_0x6561('0x39')],squel[_0x6561('0x3a')]()[_0x6561('0x3b')]('phone','phone')['field']('id',_0x6561('0x36'))[_0x6561('0x3b')](LISTID[_0x6561('0x3e')](),'ListId')[_0x6561('0x3b')](_0x3d34b5['id'][_0x6561('0x3e')](),_0x58be18)['field'](_0x6561('0x3c'),_0x6561('0x38'))['field']('NOW()',_0x6561('0x39'))[_0x6561('0x3f')]('cm_contacts')[_0x6561('0x41')](_0x6561('0x45'))[_0x6561('0x41')](_0x6561('0x42'),LISTID['toString']())['where']('id\x20IN\x20?',squel['str'](hopperContacts))[_0x6561('0x41')](_0x6561('0x43')))[_0x6561('0x3e')]();return _0x90ac6c;}return db[_0x6561('0x4b')][_0x6561('0x4c')]({'where':{'type':_0x6561('0x4d')},'attributes':['id',_0x6561('0x4e')],'include':[{'model':db[_0x6561('0x4f')],'as':'Lists','where':{'id':LISTID}}]})[_0x6561('0x2b')](function(_0x504099){var _0xc58249=[];if(_0x504099){var _0x1b78d1;for(var _0x4cbac4=0x0,_0xb7bcf5;_0x4cbac4<_0x504099[_0x6561('0x19')];_0x4cbac4+=0x1){_0xb7bcf5=_0x504099[_0x4cbac4][_0x6561('0x50')]({'plain':!![]});switch(_0xb7bcf5['dialCheckDuplicateType']){case'always':_0xc58249[_0x6561('0x2c')](db[_0x6561('0x51')][_0x6561('0x52')](_0x267085(_0xb7bcf5,_0x6561('0x53')))[_0x6561('0x2b')](function(){})[_0x6561('0x54')](_0xb18af5()));break;case _0x6561('0x55'):_0xc58249[_0x6561('0x2c')](db[_0x6561('0x51')][_0x6561('0x52')](_0x134278(_0xb7bcf5,'VoiceQueueId'))['then'](function(){})[_0x6561('0x54')](_0xb18af5()));break;default:_0xc58249[_0x6561('0x2c')](db[_0x6561('0x51')]['query'](_0x34e4b4(_0xb7bcf5,'VoiceQueueId'))[_0x6561('0x2b')](function(){})[_0x6561('0x54')](_0xb18af5()));}}}return _0xc58249;})[_0x6561('0x56')]()[_0x6561('0x2b')](function(){return db[_0x6561('0x4b')][_0x6561('0x4c')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x6561('0x4f')],'as':_0x6561('0x57'),'where':{'id':LISTID}}]})['then'](function(_0x22f71f){var _0x506ccb=[];if(_0x22f71f){var _0x5d9473;for(var _0x563139=0x0,_0x392e0a;_0x563139<_0x22f71f['length'];_0x563139+=0x1){_0x392e0a=_0x22f71f[_0x563139][_0x6561('0x50')]({'plain':!![]});_0x506ccb[_0x6561('0x2c')](db[_0x6561('0x51')][_0x6561('0x52')](_0x1955a1(_0x392e0a,'VoiceQueueId'))[_0x6561('0x2b')](function(){})[_0x6561('0x54')](_0xb18af5()));}}return _0x506ccb;})[_0x6561('0x56')]();})['then'](function(){return db['Campaign'][_0x6561('0x4c')]({'attributes':['id',_0x6561('0x4e')],'include':[{'model':db[_0x6561('0x4f')],'as':_0x6561('0x58'),'where':{'id':LISTID}}]})[_0x6561('0x2b')](function(_0xb6fda1){var _0x2225d0=[];if(_0xb6fda1){for(var _0x4c9a83=0x0,_0x302cf7;_0x4c9a83<_0xb6fda1[_0x6561('0x19')];_0x4c9a83+=0x1){_0x302cf7=_0xb6fda1[_0x4c9a83]['get']({'plain':!![]});switch(_0x302cf7[_0x6561('0x4e')]){case _0x6561('0x59'):_0x2225d0[_0x6561('0x2c')](db['sequelize'][_0x6561('0x52')](_0x267085(_0x302cf7,_0x6561('0x5a')))[_0x6561('0x2b')](function(){})[_0x6561('0x54')](_0xb18af5()));break;case _0x6561('0x55'):_0x2225d0['push'](db[_0x6561('0x51')][_0x6561('0x52')](_0x134278(_0x302cf7,_0x6561('0x5a')))['then'](function(){})[_0x6561('0x54')](_0xb18af5()));break;default:_0x2225d0[_0x6561('0x2c')](db[_0x6561('0x51')][_0x6561('0x52')](_0x34e4b4(_0x302cf7,_0x6561('0x5a')))['then'](function(){})[_0x6561('0x54')](_0xb18af5()));}}}return _0x2225d0;})[_0x6561('0x56')]();})[_0x6561('0x2b')](function(){return db['Campaign'][_0x6561('0x4c')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x43bd67){var _0x19e576=[];if(_0x43bd67){for(var _0x45f17d=0x0,_0x396f0f;_0x45f17d<_0x43bd67[_0x6561('0x19')];_0x45f17d+=0x1){_0x396f0f=_0x43bd67[_0x45f17d][_0x6561('0x50')]({'plain':!![]});_0x19e576[_0x6561('0x2c')](db[_0x6561('0x51')][_0x6561('0x52')](_0x1955a1(_0x396f0f,_0x6561('0x5a')))[_0x6561('0x2b')](function(){})['catch'](_0xb18af5()));}}return _0x19e576;})['all']();})[_0x6561('0x54')](function(_0x48f13f){logger[_0x6561('0x16')]('cmContact,\x20%s,\x20%s',_0x6561('0x5b'),_0x48f13f[_0x6561('0x1b')]);});}var processPromises=function(_0xe263da){return BPromise[_0x6561('0x56')](promises)[_0x6561('0x2b')](function(_0x19372a){})[_0x6561('0x54')](function(_0x525d2b){logger[_0x6561('0x16')](_0x6561('0x5c'),JSON[_0x6561('0x5d')](_0x525d2b));})[_0x6561('0x5e')](function(){socket[_0x6561('0x5f')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0xe263da){return _0xe263da[_0x6561('0x60')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x6561('0x2b')](function(){if(hopperContacts){return checkHopper();}})[_0x6561('0x2b')](function(){socket[_0x6561('0x5f')](_0x6561('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x6561('0x62')](FILEPATH);}catch(_0x193d33){logger[_0x6561('0x16')](_0x6561('0x63'),JSON[_0x6561('0x5d')](_0x193d33));}finally{process[_0x6561('0x64')](0x0);}});};process['on']('SIGINT',function(){logger[_0x6561('0x65')](_0x6561('0x66'));endCsv();});function main(){return BPromise[_0x6561('0x67')]()[_0x6561('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x6561('0x13')](',');return db[_0x6561('0x29')][_0x6561('0x4c')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x6561('0x2b')](function(_0x26a52b){var _0x5cd7a6=fs[_0x6561('0x68')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x6561('0x69')](_0x5cd7a6,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2ccb2f,_0x3d81ae){total+=0x1;var _0x439e43=total;promises['push'](checkRow(_0x2ccb2f,_0x26a52b,_0x439e43)[_0x6561('0x2b')](function(){success+=0x1;})['catch'](function(_0x46204d){if(_0x46204d[_0x6561('0x16')]){errors+=0x1;delete _0x46204d[_0x6561('0x16')];}else if(_0x46204d['duplicate']){duplicates+=0x1;delete _0x46204d['duplicate'];}rows[_0x6561('0x2c')](_0x46204d);}));if(total%0xc8===0x0){_0x3d81ae['pause']();return processPromises(_0x3d81ae);}},'complete':function(){return processPromises()['then'](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x148d94,_0x2dda29){logger['info']('CSV\x20parse\x20error',JSON[_0x6561('0x5d')](_0x148d94));endCsv();}});})['catch'](function(_0x1e51d2){logger[_0x6561('0x16')](_0x6561('0x6a'),JSON[_0x6561('0x5d')](_0x1e51d2));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 4db8e46..30b28ab 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 _0x4d05=['select','.CmListId\x20=\x20?','ListId\x20=\x20?','cm_contacts.phone','.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.UserId','scheduledat','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','keys','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','info','Received\x20SIGINT','error','message','errors','code','sequelize','query','spread','catch','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues.dialTimezone','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','set','offset','stringify','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','includes','header','ContactItemType','name','_description','AdditionalPhones','writeFileSync','parse','createReadStream','data','rows','find','hasOwnProperty','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','utcOffset','firstName','\x20not\x20specified','trim','itemTypeId','description','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','CREATE\x20TABLE\x20','each','dialTimezone,utcOffset',',\x20scheduledAt\x20=\x20NOW()','contactId','contactTypeId','orderBy','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','DROP\x20TABLE\x20','affectedRows','unlink','exit','complete','argv','arguments\x20\x20\x20','existsSync','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','bluebird','moment','squel','ioredis','../../../config/environment/shared','defaults','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','from','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','length','all','then','split','push','isNil','filter','CmContactHasItem','updated','create','PHONE','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','insert','into','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_contacts.updatedAt','cm_hopper_black','fromQuery'];(function(_0x37794e,_0x5f0c78){var _0x2a8426=function(_0x26cc5b){while(--_0x26cc5b){_0x37794e['push'](_0x37794e['shift']());}};_0x2a8426(++_0x5f0c78);}(_0x4d05,0x73));var _0x54d0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4d05[_0x2dafbe];return _0x58a45a;};'use strict';var fs=require('fs');var path=require(_0x54d0('0x0'));var _=require(_0x54d0('0x1'));var Papa=require(_0x54d0('0x2'));var util=require('util');var BPromise=require(_0x54d0('0x3'));var moment=require(_0x54d0('0x4'));var squel=require(_0x54d0('0x5'));var Redis=require(_0x54d0('0x6'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var shared=require(_0x54d0('0x7'));var logger=require('../../../config/logger')('import');config['redis']=_[_0x54d0('0x8')](config[_0x54d0('0x9')],{'host':_0x54d0('0xa'),'port':0x18eb});var socket=require(_0x54d0('0xb'))(new Redis(config[_0x54d0('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x54d0('0xc')](_0x54d0('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x54d0('0xc')](_0x54d0('0xd'));function isEmail(_0x2b2d65){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))*$/[_0x54d0('0xe')](_0x2b2d65);}function selectNotIn(_0x3c5286,_0x1e2112,_0x1c2542,_0x17bdc5,_0x584775){return squel['select']()[_0x54d0('0xf')](_0x54d0('0x10'))[_0x54d0('0x11')](_0x17bdc5)[_0x54d0('0x12')](_0x1e2112,null,_0x1e2112+_0x54d0('0x13')+_0x17bdc5+'.'+_0x1c2542)['where'](_0x17bdc5+'.'+_0x1c2542+_0x54d0('0x14')+_0x3c5286+'.'+_0x1c2542)[_0x54d0('0x15')](_0x1e2112+_0x54d0('0x16')+_0x584775['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x144f24,_0x5f01ff){promisesAdditionalPhones=[];return db[_0x54d0('0x17')][_0x54d0('0x18')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})['then'](function(_0x3e52f6){if(_0x3e52f6!==null){var _0x514d78=[];for(var _0x2109b1=0x0;_0x2109b1<_0x3e52f6[_0x54d0('0x19')];_0x2109b1++){var _0x30ef5f=_0x3e52f6[_0x2109b1];_0x514d78['push'](insertAdditionalPhones(_0x30ef5f));}}Promise[_0x54d0('0x1a')](_0x514d78)[_0x54d0('0x1b')](function(){_0x144f24({'val':0x1});});});});}function insertAdditionalPhones(_0x5e2537){return new Promise(function(_0x505f09,_0x5d56cd){var _0x3ec975=_0x5e2537['AdditionalPhones'];var _0x29bb0c=_0x3ec975[_0x54d0('0x1c')](';');var _0xed9701=[];orderBy=0x0;for(var _0x3d1cfc=0x0;_0x3d1cfc<_0x29bb0c['length'];_0x3d1cfc++){_0xed9701[_0x54d0('0x1d')](splitAdditionalPhone(_0x5e2537['id'],_0x29bb0c[_0x3d1cfc]));}Promise[_0x54d0('0x1a')](_0xed9701)[_0x54d0('0x1b')](function(){_0x505f09({'val':_0x29bb0c[_0x54d0('0x19')]});});});}function splitAdditionalPhone(_0x171e35,_0x3e1785){return new Promise(function(_0x594ea4,_0x10ab77){var _0x53b177=_0x3e1785['split'](':');var _0x47a19c=_0x53b177[0x0];var _0x4d3cd4=_0x53b177[0x1];if(!_[_0x54d0('0x1e')](_0x4d3cd4)){var _0x152d3f=_0x4d3cd4[_0x54d0('0x1c')]('|');var _0x45da98=[];for(var _0xcba099=0x0;_0xcba099<_0x152d3f[_0x54d0('0x19')];_0xcba099++){if(_0x152d3f[_0xcba099]!==''){var _0x8dae51=_[_0x54d0('0x1f')](promisesAdditionalPhones,{'contactId':_0x171e35,'phone':_0x152d3f[_0xcba099]});if(_0x8dae51[_0x54d0('0x19')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x171e35,'contactTypeId':_0x47a19c,'phone':_0x152d3f[_0xcba099],'orderBy':orderBy});}}}_0x594ea4({'ok':0x1});}else _0x594ea4({'res':0x0});});}function createAdditionalPhone(_0xc6ae84,_0x50a5ac,_0x40af37,_0x9d4b13){var _0x408d82='';var _0x480c60='';var _0x131442=_0x40af37[_0x54d0('0x1c')]('§');_0x408d82=_0x131442[0x0];if(_0x131442[_0x54d0('0x19')]==0x2)_0x480c60=_0x131442[0x1];return new Promise(function(_0x5aef3e,_0x24d3cd){return db[_0x54d0('0x20')]['findOne']({'where':{'CmContactId':_0xc6ae84,'item':_0x408d82}})[_0x54d0('0x1b')](function(_0x15ea1a){if(_0x15ea1a){return db[_0x54d0('0x20')]['update']({'ItemTypeId':_0x50a5ac,'description':_0x480c60,'OrderBy':_0x9d4b13},{'where':{'CmContactId':_0xc6ae84,'item':_0x408d82}})['then'](function(_0x16784c){_0x5aef3e({'res':_0x54d0('0x21')});});}else{return db[_0x54d0('0x20')][_0x54d0('0x22')]({'CmContactId':_0xc6ae84,'item':_0x408d82,'description':_0x480c60,'ItemTypeId':_0x50a5ac,'OrderBy':_0x9d4b13,'ItemClass':_0x54d0('0x23')})['then'](function(_0x5d488b){_0x5aef3e({'res':'inserted'});});}});});}function insertCmHopper(_0x31bc84,_0x265fa5,_0x58c5ae,_0x4566c8,_0x4713da){var _0x447cea=['cm_contacts.phone','cm_contacts.scheduledat',_0x54d0('0x24'),_0x54d0('0x25'),_0x265fa5+'.'+_0x4566c8,_0x54d0('0x26'),'cm_contacts.updatedAt',_0x54d0('0x27'),'cm_contacts.UserId','\x22'+_0x4713da+'\x22'];return squel[_0x54d0('0x28')]()[_0x54d0('0x29')]('cm_hopper')['fromQuery']([_0x54d0('0x10'),'scheduledat',_0x54d0('0x2a'),_0x54d0('0x2b'),_0x4566c8,_0x54d0('0x2c'),_0x54d0('0x2d'),_0x54d0('0x2e'),_0x54d0('0x2f'),_0x54d0('0x30')],squel['select']()[_0x54d0('0x31')](_0x447cea)[_0x54d0('0x11')](_0x265fa5)[_0x54d0('0x12')](_0x54d0('0x32'),null,_0x54d0('0x33')+_0x265fa5+_0x54d0('0x34'))['join'](_0x58c5ae,null,_0x58c5ae+_0x54d0('0x13')+_0x265fa5+'.'+_0x4566c8)['where'](_0x265fa5+'.CmListId\x20=\x20?',_0x31bc84)[_0x54d0('0x15')](_0x54d0('0x35'),NOW)['where'](_0x54d0('0x36'),selectNotIn(_0x265fa5,_0x58c5ae,_0x4566c8,_0x54d0('0x37'),['\x22always\x22',_0x54d0('0x38')]))[_0x54d0('0x15')](_0x54d0('0x36'),selectNotIn(_0x265fa5,_0x58c5ae,_0x4566c8,_0x54d0('0x37'),[_0x54d0('0x39')])))[_0x54d0('0x3a')]();}function insertCmHopperBlack(_0x1d678e,_0x1afbce,_0x2f093c,_0x518f2d){var _0x1c3076=['cm_contacts.phone',_0x54d0('0x24'),'cm_contacts.ListId',_0x1afbce+'.'+_0x518f2d,'cm_contacts.createdAt',_0x54d0('0x3b')];return squel[_0x54d0('0x28')]()['into'](_0x54d0('0x3c'))[_0x54d0('0x3d')]([_0x54d0('0x10'),'ContactId',_0x54d0('0x2b'),_0x518f2d,'createdAt',_0x54d0('0x2d')],squel[_0x54d0('0x3e')]()[_0x54d0('0x31')](_0x1c3076)[_0x54d0('0x11')](_0x1afbce)[_0x54d0('0x12')]('cm_contacts',null,_0x54d0('0x33')+_0x1afbce+_0x54d0('0x34'))[_0x54d0('0x12')](_0x2f093c,null,_0x2f093c+'.id\x20=\x20'+_0x1afbce+'.'+_0x518f2d)[_0x54d0('0x15')](_0x1afbce+_0x54d0('0x3f'),_0x1d678e)[_0x54d0('0x15')](_0x54d0('0x35'),NOW)[_0x54d0('0x15')](_0x54d0('0x36'),squel[_0x54d0('0x3e')]()[_0x54d0('0xf')](_0x54d0('0x10'))[_0x54d0('0x11')](_0x54d0('0x3c'))[_0x54d0('0x15')](_0x54d0('0x40'),_0x1d678e)['where'](_0x518f2d+_0x54d0('0x14')+_0x1afbce+'.'+_0x518f2d)))[_0x54d0('0x3a')]();}function insertTzCmHopper(_0xd8fe06,_0x1be7ff,_0x3942da,_0x91f164,_0x4e5a53,_0x10755a){var _0x1e0211=[_0x54d0('0x41'),'date_add(cm_contacts.scheduledat,interval\x20'+_0x10755a+_0x54d0('0x42'),_0x54d0('0x24'),'cm_contacts.ListId',_0x1be7ff+'.'+_0x91f164,_0x54d0('0x26'),_0x54d0('0x3b'),'cm_contacts.priority',_0x54d0('0x43'),'\x22'+_0x4e5a53+'\x22'];var _0x49eb8d=squel[_0x54d0('0x28')]()[_0x54d0('0x29')](_0x54d0('0x37'))[_0x54d0('0x3d')]([_0x54d0('0x10'),_0x54d0('0x44'),_0x54d0('0x2a'),_0x54d0('0x2b'),_0x91f164,_0x54d0('0x2c'),_0x54d0('0x2d'),_0x54d0('0x2e'),_0x54d0('0x2f'),_0x54d0('0x30')],squel[_0x54d0('0x3e')]()['fields'](_0x1e0211)[_0x54d0('0x11')](_0x1be7ff)[_0x54d0('0x12')]('cm_contacts',null,_0x54d0('0x33')+_0x1be7ff+_0x54d0('0x34'))['join'](_0x3942da,null,_0x3942da+_0x54d0('0x13')+_0x1be7ff+'.'+_0x91f164)[_0x54d0('0x12')](_0x10755a,null,_0x10755a+_0x54d0('0x13')+_0x1be7ff+'.'+_0x91f164)['where'](_0x1be7ff+_0x54d0('0x3f'),_0xd8fe06)[_0x54d0('0x15')](_0x54d0('0x35'),NOW)[_0x54d0('0x15')](_0x54d0('0x36'),selectNotIn(_0x1be7ff,_0x3942da,_0x91f164,_0x54d0('0x37'),[_0x54d0('0x39'),_0x54d0('0x38')]))['where'](_0x54d0('0x36'),selectNotIn(_0x1be7ff,_0x3942da,_0x91f164,_0x54d0('0x37'),[_0x54d0('0x39')])))[_0x54d0('0x3a')]();return _0x49eb8d;}function insertTzCmHopperBlack(_0x1c51ae,_0x5b485a,_0x371e07,_0x35a80a){var _0x3b1600=[_0x54d0('0x41'),_0x54d0('0x24'),_0x54d0('0x25'),_0x5b485a+'.'+_0x35a80a,_0x54d0('0x26'),'cm_contacts.updatedAt'];return squel[_0x54d0('0x28')]()[_0x54d0('0x29')]('cm_hopper_black')[_0x54d0('0x3d')]([_0x54d0('0x10'),'ContactId',_0x54d0('0x2b'),_0x35a80a,_0x54d0('0x2c'),_0x54d0('0x2d')],squel[_0x54d0('0x3e')]()[_0x54d0('0x31')](_0x3b1600)[_0x54d0('0x11')](_0x5b485a)[_0x54d0('0x12')]('cm_contacts',null,_0x54d0('0x33')+_0x5b485a+_0x54d0('0x34'))['join'](_0x371e07,null,_0x371e07+_0x54d0('0x13')+_0x5b485a+'.'+_0x35a80a)['where'](_0x5b485a+'.CmListId\x20=\x20?',_0x1c51ae)[_0x54d0('0x15')](_0x54d0('0x35'),NOW)[_0x54d0('0x15')](_0x54d0('0x36'),squel[_0x54d0('0x3e')]()[_0x54d0('0xf')](_0x54d0('0x10'))['from'](_0x54d0('0x3c'))['where'](_0x54d0('0x40'),_0x1c51ae)[_0x54d0('0x15')](_0x35a80a+_0x54d0('0x14')+_0x5b485a+'.'+_0x35a80a)))[_0x54d0('0x3a')]();}function insertCmHopperAdditionalPhones(_0x4b9882){var _0x498434=[_0x54d0('0x45'),_0x54d0('0x46'),'cm_contact_has_items.OrderBy',_0x54d0('0x47'),'cm_contact_has_items.updatedAt'];return squel[_0x54d0('0x28')]()[_0x54d0('0x29')](_0x54d0('0x48'))[_0x54d0('0x3d')]([_0x54d0('0x49'),_0x54d0('0x10'),_0x54d0('0x4a'),_0x54d0('0x2c'),'updatedAt'],squel[_0x54d0('0x3e')]()[_0x54d0('0x31')](_0x498434)[_0x54d0('0x11')](_0x54d0('0x37'))[_0x54d0('0x12')](_0x54d0('0x32'),null,_0x54d0('0x4b'))[_0x54d0('0x12')]('cm_contact_has_items',null,_0x54d0('0x4c'))[_0x54d0('0x15')]('cm_hopper.ListId\x20=\x20?',_0x4b9882)[_0x54d0('0x15')](_0x54d0('0x35'),NOW))['toString']();}function insertCmContact(_0x90af70,_0x5bb50d,_0x9b5c49,_0x26d96a){var _0x3ae744=_[_0x54d0('0x4d')](_[_0x54d0('0x4e')](_0x26d96a),[_0x54d0('0x2b'),'CompanyId',_0x54d0('0x2c'),_0x54d0('0x2d'),'scheduledAt']);return squel[_0x54d0('0x28')]()['into'](_0x54d0('0x32'))[_0x54d0('0x3d')](_0x3ae744,squel[_0x54d0('0x3e')]()[_0x54d0('0x31')](_0x3ae744)[_0x54d0('0x11')](_0x5bb50d)[_0x54d0('0x15')]('('+_0x9b5c49[_0x54d0('0x12')](',')+')\x20NOT\x20IN\x20?',squel[_0x54d0('0x3e')]()['fields'](_0x9b5c49)[_0x54d0('0x11')](_0x54d0('0x32'))[_0x54d0('0x15')](_0x54d0('0x40'),_0x90af70)[_0x54d0('0x15')](_0x54d0('0x4f')))[_0x54d0('0x15')](_0x54d0('0x50'),squel['select']()[_0x54d0('0xf')](_0x54d0('0x51'),'min_id')['from'](_0x5bb50d)[_0x54d0('0x52')](_0x9b5c49[_0x54d0('0x12')](','))))['toString']();}function handleStop(){logger[_0x54d0('0x53')](_0x54d0('0x54'));stopped=!![];}function handleUncaughtException(_0x568350){logger[_0x54d0('0x55')](_0x568350[_0x54d0('0x56')]);process['exit'](0x1);}function handleError(_0x1ac8b0,_0x2cd851){stats[_0x54d0('0x57')][_0x54d0('0x1d')]({'name':_0x2cd851[_0x54d0('0x58')],'message':_0x2cd851['message'],'row':_0x1ac8b0});}function handleQuery(_0x1a9eb8){logger['info'](_0x1a9eb8);return db[_0x54d0('0x59')][_0x54d0('0x5a')](_0x1a9eb8)[_0x54d0('0x5b')](function(_0x159f5e){results['push'](_0x159f5e);})[_0x54d0('0x5c')](function(_0x43979c){logger[_0x54d0('0x55')](_0x43979c[_0x54d0('0x56')]);});}function updateTzCampaigns(_0x387301){return new Promise(function(_0x5ae654,_0x1f3629){var _0x49f028=squel['select']()[_0x54d0('0x31')](['campaigns.id','campaigns.dialTimezone'])['from'](_0x54d0('0x5d'))[_0x54d0('0x12')](_0x54d0('0x5e'),null,_0x54d0('0x5f'))['where'](_0x54d0('0x60')+_0x387301);db[_0x54d0('0x59')][_0x54d0('0x5a')](_0x49f028['toString']())[_0x54d0('0x5b')](function(_0x5c87af){var _0x157f0f=[];for(var _0x581b09=0x0;_0x581b09<_0x5c87af[_0x54d0('0x19')];_0x581b09++){_0x157f0f[_0x54d0('0x1d')](getTimezoneData(_0x5c87af[_0x581b09],tmp_campaigns));}BPromise['all'](_0x157f0f)[_0x54d0('0x1b')](function(){_0x5ae654({'val':0x1});});})['catch'](function(_0x4216c1){logger[_0x54d0('0x55')](_0x4216c1[_0x54d0('0x56')]);_0x5ae654({'val':0x0});});});}function updateTzVoiceQueues(_0x5ad165){return new Promise(function(_0x32e2b7,_0x104cf1){var _0x6f60f3=squel[_0x54d0('0x3e')]()[_0x54d0('0x31')](['voice_queues.id',_0x54d0('0x61')])[_0x54d0('0x11')]('voice_queues')[_0x54d0('0x12')](_0x54d0('0x62'),null,_0x54d0('0x63'))['where'](_0x54d0('0x64')+_0x5ad165);db[_0x54d0('0x59')][_0x54d0('0x5a')](_0x6f60f3[_0x54d0('0x3a')]())[_0x54d0('0x5b')](function(_0x5911d0){var _0x9bcf4=[];for(var _0x3dbf7f=0x0;_0x3dbf7f<_0x5911d0[_0x54d0('0x19')];_0x3dbf7f++){_0x9bcf4[_0x54d0('0x1d')](getTimezoneData(_0x5911d0[_0x3dbf7f],tmp_voice_queues));}BPromise[_0x54d0('0x1a')](_0x9bcf4)[_0x54d0('0x1b')](function(){_0x32e2b7({'val':0x1});});})[_0x54d0('0x5c')](function(_0x1f5563){logger['error'](_0x1f5563[_0x54d0('0x56')]);_0x32e2b7({'val':0x0});});});}function getTimezoneData(_0x5ec60f,_0x1088ee){return new Promise(function(_0x241d30,_0x287e1d){var _0x4c251f=shared[_0x54d0('0x65')];var _0x5f56c2=_0x4c251f[_0x5ec60f[_0x54d0('0x66')]];if(_[_0x54d0('0x1e')](_0x5f56c2)){_0x241d30({'ret':0x1});}else{var _0x100426=_0x5f56c2['utcOffset'];var _0x1defbe=squel['insert']()[_0x54d0('0x29')](_0x1088ee)[_0x54d0('0x67')]('id',_0x5ec60f['id'])[_0x54d0('0x67')](_0x54d0('0x68'),_0x100426)['set'](_0x54d0('0x66'),_0x5ec60f[_0x54d0('0x66')])[_0x54d0('0x3a')]();return db[_0x54d0('0x59')][_0x54d0('0x5a')](_0x1defbe)[_0x54d0('0x5b')](function(_0x2d3c05){_0x241d30({'ret':0x1});})[_0x54d0('0x5c')](function(_0x13b6bf){logger['error'](_0x13b6bf['message']);_0x287e1d({'ret':0x1});});}});}function handleTZQuery(_0x380f8a){logger[_0x54d0('0x53')](_0x380f8a);return db[_0x54d0('0x59')][_0x54d0('0x5a')](_0x380f8a)[_0x54d0('0x5b')](function(_0xced438){})['catch'](function(_0x4419a8){logger[_0x54d0('0x55')](_0x4419a8[_0x54d0('0x56')]);});}function main(_0xaa5e5,_0x440ca5,_0x4495d8,_0x3ab8d0){logger['info']('main',_0xaa5e5,JSON[_0x54d0('0x69')](_0x440ca5));process['send'](_0x54d0('0x6a'));var _0x1eadf1=_0x440ca5[_0x54d0('0x6b')];var _0x52513e=_[_0x54d0('0x6c')](_0x1eadf1);var _0x45d637=_0x440ca5[_0x54d0('0x6d')];var _0x310d5f=path[_0x54d0('0x12')](config[_0x54d0('0x6e')],_0x54d0('0x6f'),_0x45d637+_0x54d0('0x70'));hasTZ=_[_0x54d0('0x4e')](_0x1eadf1)[_0x54d0('0x71')](_0x54d0('0x66'));var _0x21f735=_[_0x54d0('0x4e')](_0x1eadf1)['join']();logger[_0x54d0('0x53')](_0x54d0('0x72'),_0x21f735);db[_0x54d0('0x73')][_0x54d0('0x18')]({'raw':!![],'attributes':['id',_0x54d0('0x74')]})[_0x54d0('0x1b')](function(_0x4d07ec){for(var _0x1917f1=0x0;_0x1917f1<_0x4d07ec['length'];_0x1917f1++){if(_0x4d07ec[_0x1917f1][_0x54d0('0x74')]in _0x1eadf1){contactItemTypes[_0x54d0('0x1d')](_0x4d07ec[_0x1917f1]);delete _0x52513e[_0x4d07ec[_0x1917f1][_0x54d0('0x74')]];hasAdditionalPhones=!![];}for(var _0x1263af in _0x1eadf1){if(_0x4d07ec[_0x1917f1]['name']+_0x54d0('0x75')===_0x1263af){phoneDescriptions[_0x54d0('0x1d')]({'itemTypeId':_0x4d07ec[_0x1917f1]['id'],'description':_0x1263af});delete _0x52513e[_0x1263af];}}}if(hasAdditionalPhones)_0x52513e[_0x54d0('0x76')]='';var _0xf7553c=_[_0x54d0('0x4e')](_0x52513e)['join']();logger[_0x54d0('0x53')](_0x54d0('0x72'),_0xf7553c);fs[_0x54d0('0x77')](_0x310d5f,_0xf7553c+'\x0a');Papa[_0x54d0('0x78')](fs[_0x54d0('0x79')](_0xaa5e5),{'header':!![],'skipEmptyLines':!![],'step':function(_0xf2661f,_0x4249e2){try{for(var _0xa4f851=0x0,_0x29aa0d=[];_0xa4f851<_0xf2661f[_0x54d0('0x7a')]['length'];_0xa4f851++){stats[_0x54d0('0x7b')]+=0x1;if(_0xf2661f['errors'][_0xa4f851]){handleError(_0xf2661f['data'][_0xa4f851],_0xf2661f['errors'][_0xa4f851]);}else{var _0x5d6968=[];var _0x18a2d4=[];var _0x4d68e9={};for(var _0xc60d9e in _0x1eadf1){let _0x55ac71=contactItemTypes[_0x54d0('0x7c')](_0x1478be=>_0x1478be['name']===_0xc60d9e);let _0xae6f19=contactItemTypes[_0x54d0('0x7c')](_0x1922d0=>_0x1922d0['name']+_0x54d0('0x75')===_0xc60d9e);if(_[_0x54d0('0x1e')](_0x55ac71)&&_[_0x54d0('0x1e')](_0xae6f19)){if(_0x1eadf1[_0x54d0('0x7d')](_0xc60d9e)){if(_0xf2661f[_0x54d0('0x7a')][_0xa4f851][_0x1eadf1[_0xc60d9e]]){var _0x3e7e91=_['trim'](_0xf2661f[_0x54d0('0x7a')][_0xa4f851][_0x1eadf1[_0xc60d9e]][_0x54d0('0x7e')](/"/g,'\x27'));switch(_0xc60d9e){case'scheduledat':var _0xc8fd03=moment(_0x3e7e91,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0xc8fd03['isValid']()){_0x29aa0d[_0x54d0('0x1d')]('\x22'+_0x3e7e91+'\x22');}else{_0x5d6968['push'](_0x54d0('0x7f'));}break;case'priority':var _0xb307bb=parseInt(_0x3e7e91);_0x3e7e91=_['isNaN'](_0xb307bb)||_0xb307bb<0x0||_0xb307bb>0x4?_0x3ab8d0?0x3:0x2:_0xb307bb;_0x29aa0d[_0x54d0('0x1d')]('\x22'+_0x3e7e91+'\x22');break;case _0x54d0('0x2f'):var _0x5e5efe=parseInt(_0x3e7e91);if(_['isNumber'](_0x5e5efe)&&_['includes'](_0x4495d8,_0x5e5efe)){_0x29aa0d[_0x54d0('0x1d')]('\x22'+_0x5e5efe+'\x22');}else{_0x5d6968['push'](_0x54d0('0x80'));}break;case _0x54d0('0x81'):if(isEmail(_0x3e7e91)){_0x29aa0d[_0x54d0('0x1d')]('\x22'+_0x3e7e91+'\x22');}else{_0x5d6968[_0x54d0('0x1d')](_0x54d0('0x82'));}break;case _0x54d0('0x83'):var _0x4fa5a1=moment(_0x3e7e91,_0x54d0('0x84'),!![]);if(_0x4fa5a1[_0x54d0('0x85')]()){_0x29aa0d[_0x54d0('0x1d')]('\x22'+_0x3e7e91+'\x22');}else{_0x5d6968[_0x54d0('0x1d')](_0x54d0('0x86'));}break;case _0x54d0('0x66'):var _0x219a95=shared['timezones'];var _0x2d3f82=_0x219a95[_0x3e7e91];if(!_[_0x54d0('0x1e')](_0x2d3f82)){var _0x280d2f=_0x2d3f82[_0x54d0('0x87')];_0x29aa0d[_0x54d0('0x1d')]('\x22'+_0x3e7e91+'\x22');_0x29aa0d[_0x54d0('0x1d')]('\x22'+_0x280d2f+'\x22');}break;default:_0x29aa0d[_0x54d0('0x1d')]('\x22'+_0x3e7e91+'\x22');}}else{switch(_0xc60d9e){case _0x54d0('0x88'):case'phone':_0x5d6968[_0x54d0('0x1d')](_0xc60d9e+_0x54d0('0x89'));break;default:_0x29aa0d[_0x54d0('0x1d')]('\x22\x22');}}}}else{var _0x17d5a7='';if(!_[_0x54d0('0x1e')](_0x55ac71)){if(!_0x4d68e9['hasOwnProperty'](_0x55ac71['id'])){if(!_[_0x54d0('0x1e')](_0xf2661f[_0x54d0('0x7a')][_0xa4f851][_0x1eadf1[_0xc60d9e]])){var _0x3e7e91=_[_0x54d0('0x8a')](_0xf2661f['data'][_0xa4f851][_0x1eadf1[_0xc60d9e]][_0x54d0('0x7e')](/"/g,'\x27'));var _0x5e8126=phoneDescriptions['find'](_0x2b998d=>_0x2b998d[_0x54d0('0x8b')]===_0x55ac71['id']);if(!_[_0x54d0('0x1e')](_0x5e8126)){var _0x4abe03=_[_0x54d0('0x8a')](_0xf2661f[_0x54d0('0x7a')][_0xa4f851][_0x1eadf1[_0x5e8126[_0x54d0('0x8c')]]][_0x54d0('0x7e')](/"/g,'\x27'));if(!_[_0x54d0('0x1e')](_0x4abe03))_0x3e7e91=_0x3e7e91+'§'+_0x4abe03;}if(_0x17d5a7=='')_0x17d5a7=_0x3e7e91;else _0x17d5a7+='|'+_0x3e7e91;}_0x18a2d4[_0x54d0('0x1d')](_0x55ac71['id']+':'+_0x17d5a7);_0x4d68e9[_0x55ac71['id']]=0x1;}}}}if(hasAdditionalPhones){_0x29aa0d[_0x54d0('0x1d')]('\x22'+_0x18a2d4[_0x54d0('0x12')](';')+'\x22');}if(_0x5d6968[_0x54d0('0x19')]){handleError(_0xf2661f[_0x54d0('0x7a')][_0xa4f851],{'code':_0x54d0('0x8d'),'message':_0x5d6968[_0x54d0('0x12')]()});}else{fs[_0x54d0('0x8e')](_0x310d5f,_0x29aa0d['join']()+'\x0a');}_0x29aa0d=[];}if(!(stats[_0x54d0('0x7b')]%0xc8)){socket[_0x54d0('0x8f')](_0x54d0('0x90')+_0x45d637,stats);stats[_0x54d0('0x57')]=[];}}if(stopped){logger[_0x54d0('0x53')](_0x54d0('0x91'));_0x4249e2[_0x54d0('0x92')]();}}catch(_0x59a88f){handleError(_0xf2661f[_0x54d0('0x7a')][_0xa4f851],{'code':'SystemError','message':_0x59a88f[_0x54d0('0x56')]});logger['error'](_0x54d0('0x93'),_0x59a88f['message']);}},'complete':function(){try{var _0x4d9bd9=[];var _0x1a1fe3=[];var _0x2586b8='cm_contacts';if(_0x440ca5[_0x54d0('0x94')]&&_0x440ca5[_0x54d0('0x94')]['length']){_0x2586b8=_0x54d0('0x95')+_0x45d637;_0x4d9bd9[_0x54d0('0x1d')]('CREATE\x20TABLE\x20'+_0x2586b8+_0x54d0('0x96'));}tmp_campaigns=_0x54d0('0x97')+_0x45d637;tmp_voice_queues=_0x54d0('0x98')+_0x45d637;_0x1a1fe3['push']('CREATE\x20TABLE\x20'+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x1a1fe3[_0x54d0('0x1d')](_0x54d0('0x99')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x54d0('0x9a')](_0x1a1fe3,handleTZQuery)[_0x54d0('0x1b')](function(_0x3ad5f6){updateTzCampaigns(_0x440ca5[_0x54d0('0x2b')])['then'](function(_0x34b841){updateTzVoiceQueues(_0x440ca5[_0x54d0('0x2b')])[_0x54d0('0x1b')](function(_0x2e69e8){if(hasTZ)_0xf7553c=_0xf7553c[_0x54d0('0x7e')]('dialTimezone',_0x54d0('0x9b'));var _0x66d024=util[_0x54d0('0xc')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x310d5f,_0x2586b8,_0xf7553c,_0x440ca5[_0x54d0('0x2b')],_0x440ca5['CompanyId']||null,NOW,NOW);if(_[_0x54d0('0x1e')](_0x1eadf1[_0x54d0('0x44')])){_0x66d024+=_0x54d0('0x9c');}_0x4d9bd9[_0x54d0('0x1d')](_0x66d024);if(_0x440ca5[_0x54d0('0x94')]&&_0x440ca5['duplicates'][_0x54d0('0x19')]){_0x4d9bd9[_0x54d0('0x1d')](insertCmContact(_0x440ca5[_0x54d0('0x2b')],_0x2586b8,_0x440ca5[_0x54d0('0x94')],_0x1eadf1));_0x4d9bd9['push']('DROP\x20TABLE\x20'+_0x2586b8+';');}BPromise['each'](_0x4d9bd9,handleQuery)['then'](function(_0x235987){BPromise['all']([handleAdditionalPhones()])[_0x54d0('0x1b')](function(){_0x4d9bd9=[];for(var _0x39d2fe=0x0;_0x39d2fe\x20\x20','existsSync','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','papaparse','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','then','length','all','AdditionalPhones','push','split','isNil','filter','CmContactHasItem','PHONE','inserted','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','cm_hopper','fromQuery','ListId','createdAt','updatedAt','UserId','fields','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.phone','into','cm_hopper_black','.CmListId','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','cm_contacts.id','cm_contacts.UserId','scheduledat','ContactId','priority','recallme','cm_contacts','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','keys','scheduledAt','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','Received\x20SIGINT','error','exit','errors','code','message','sequelize','query','spread','catch','campaigns.id','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','voice_queues.id','voice_queues.dialTimezone','voice_queues_has_cm_lists','utcOffset','set','offset','dialTimezone','main','send','start','binding','socket_timestamp','server/files/tmp','.csv','header','ContactItemType','name','_description'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0xd189,0x1a6));var _0x9d18=function(_0x3f2475,_0x587901){_0x3f2475=_0x3f2475-0x0;var _0x47520b=_0xd189[_0x3f2475];return _0x47520b;};'use strict';var fs=require('fs');var path=require('path');var _=require('lodash');var Papa=require(_0x9d18('0x0'));var util=require('util');var BPromise=require(_0x9d18('0x1'));var moment=require('moment');var squel=require(_0x9d18('0x2'));var Redis=require(_0x9d18('0x3'));var db=require(_0x9d18('0x4'))['db'];var config=require('../../../config/environment');var shared=require(_0x9d18('0x5'));var logger=require(_0x9d18('0x6'))(_0x9d18('0x7'));config[_0x9d18('0x8')]=_[_0x9d18('0x9')](config[_0x9d18('0x8')],{'host':_0x9d18('0xa'),'port':0x18eb});var socket=require(_0x9d18('0xb'))(new Redis(config[_0x9d18('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x9d18('0xc')](_0x9d18('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x3a5458){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))*$/[_0x9d18('0xe')](_0x3a5458);}function selectNotIn(_0x5d1288,_0x36dae3,_0x5c710b,_0x5a28fd,_0x92509){return squel[_0x9d18('0xf')]()[_0x9d18('0x10')](_0x9d18('0x11'))[_0x9d18('0x12')](_0x5a28fd)[_0x9d18('0x13')](_0x36dae3,null,_0x36dae3+_0x9d18('0x14')+_0x5a28fd+'.'+_0x5c710b)[_0x9d18('0x15')](_0x5a28fd+'.'+_0x5c710b+_0x9d18('0x16')+_0x5d1288+'.'+_0x5c710b)[_0x9d18('0x15')](_0x36dae3+_0x9d18('0x17')+_0x92509['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x4923cd,_0x357380){promisesAdditionalPhones=[];return db[_0x9d18('0x18')][_0x9d18('0x19')]({'raw':!![],'attributes':['id','AdditionalPhones'],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x9d18('0x1a')](function(_0x2c14db){if(_0x2c14db!==null){var _0x4473ee=[];for(var _0x41a4fe=0x0;_0x41a4fe<_0x2c14db[_0x9d18('0x1b')];_0x41a4fe++){var _0x2c05f2=_0x2c14db[_0x41a4fe];_0x4473ee['push'](insertAdditionalPhones(_0x2c05f2));}}Promise[_0x9d18('0x1c')](_0x4473ee)[_0x9d18('0x1a')](function(){_0x4923cd({'val':0x1});});});});}function insertAdditionalPhones(_0x3174c4){return new Promise(function(_0xcfec5e,_0x54653e){var _0x5bd23e=_0x3174c4[_0x9d18('0x1d')];var _0x3bfddf=_0x5bd23e['split'](';');var _0x3b252f=[];orderBy=0x0;for(var _0x4077e2=0x0;_0x4077e2<_0x3bfddf[_0x9d18('0x1b')];_0x4077e2++){_0x3b252f[_0x9d18('0x1e')](splitAdditionalPhone(_0x3174c4['id'],_0x3bfddf[_0x4077e2]));}Promise[_0x9d18('0x1c')](_0x3b252f)['then'](function(){_0xcfec5e({'val':_0x3bfddf[_0x9d18('0x1b')]});});});}function splitAdditionalPhone(_0x4c7da3,_0x1f44d0){return new Promise(function(_0x59f00b,_0x4b640f){var _0x3f13d8=_0x1f44d0[_0x9d18('0x1f')](':');var _0x51fcda=_0x3f13d8[0x0];var _0x27ec47=_0x3f13d8[0x1];if(!_[_0x9d18('0x20')](_0x27ec47)){var _0x21be22=_0x27ec47[_0x9d18('0x1f')]('|');var _0x3c035=[];for(var _0x59aefd=0x0;_0x59aefd<_0x21be22[_0x9d18('0x1b')];_0x59aefd++){if(_0x21be22[_0x59aefd]!==''){var _0x5c3b5b=_[_0x9d18('0x21')](promisesAdditionalPhones,{'contactId':_0x4c7da3,'phone':_0x21be22[_0x59aefd]});if(_0x5c3b5b[_0x9d18('0x1b')]==0x0){orderBy++;promisesAdditionalPhones[_0x9d18('0x1e')]({'contactId':_0x4c7da3,'contactTypeId':_0x51fcda,'phone':_0x21be22[_0x59aefd],'orderBy':orderBy});}}}_0x59f00b({'ok':0x1});}else _0x59f00b({'res':0x0});});}function createAdditionalPhone(_0x2d8735,_0x406ae9,_0x483803,_0x308894){var _0x1088fb='';var _0x2c51bd='';var _0x265266=_0x483803['split']('§');_0x1088fb=_0x265266[0x0];if(_0x265266[_0x9d18('0x1b')]==0x2)_0x2c51bd=_0x265266[0x1];return new Promise(function(_0x595be8,_0xd35710){return db[_0x9d18('0x22')]['findOne']({'where':{'CmContactId':_0x2d8735,'item':_0x1088fb}})[_0x9d18('0x1a')](function(_0x393fd7){if(_0x393fd7){return db[_0x9d18('0x22')]['update']({'ItemTypeId':_0x406ae9,'description':_0x2c51bd,'OrderBy':_0x308894},{'where':{'CmContactId':_0x2d8735,'item':_0x1088fb}})[_0x9d18('0x1a')](function(_0x3523c9){_0x595be8({'res':'updated'});});}else{return db[_0x9d18('0x22')]['create']({'CmContactId':_0x2d8735,'item':_0x1088fb,'description':_0x2c51bd,'ItemTypeId':_0x406ae9,'OrderBy':_0x308894,'ItemClass':_0x9d18('0x23')})['then'](function(_0x4bd992){_0x595be8({'res':_0x9d18('0x24')});});}});});}function insertCmHopper(_0x834f8a,_0x4f9bed,_0x3d8ca2,_0x188287,_0x413ff9){var _0x26b205=['cm_contacts.phone',_0x9d18('0x25'),'cm_contacts.id',_0x9d18('0x26'),_0x4f9bed+'.'+_0x188287,_0x9d18('0x27'),_0x9d18('0x28'),_0x9d18('0x29'),'cm_contacts.UserId','\x22'+_0x413ff9+'\x22'];return squel[_0x9d18('0x2a')]()['into'](_0x9d18('0x2b'))[_0x9d18('0x2c')]([_0x9d18('0x11'),'scheduledat','ContactId',_0x9d18('0x2d'),_0x188287,_0x9d18('0x2e'),_0x9d18('0x2f'),'priority',_0x9d18('0x30'),'recallme'],squel['select']()[_0x9d18('0x31')](_0x26b205)[_0x9d18('0x12')](_0x4f9bed)[_0x9d18('0x13')]('cm_contacts',null,_0x9d18('0x32')+_0x4f9bed+'.CmListId')[_0x9d18('0x13')](_0x3d8ca2,null,_0x3d8ca2+_0x9d18('0x14')+_0x4f9bed+'.'+_0x188287)[_0x9d18('0x15')](_0x4f9bed+_0x9d18('0x33'),_0x834f8a)[_0x9d18('0x15')](_0x9d18('0x34'),NOW)[_0x9d18('0x15')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x4f9bed,_0x3d8ca2,_0x188287,_0x9d18('0x2b'),['\x22always\x22',_0x9d18('0x35')]))[_0x9d18('0x15')](_0x9d18('0x36'),selectNotIn(_0x4f9bed,_0x3d8ca2,_0x188287,_0x9d18('0x2b'),[_0x9d18('0x37')])))[_0x9d18('0x38')]();}function insertCmHopperBlack(_0x15762b,_0x4e6cc7,_0x3a095c,_0x276442){var _0x51f920=[_0x9d18('0x39'),'cm_contacts.id',_0x9d18('0x26'),_0x4e6cc7+'.'+_0x276442,_0x9d18('0x27'),'cm_contacts.updatedAt'];return squel[_0x9d18('0x2a')]()[_0x9d18('0x3a')](_0x9d18('0x3b'))['fromQuery']([_0x9d18('0x11'),'ContactId',_0x9d18('0x2d'),_0x276442,_0x9d18('0x2e'),_0x9d18('0x2f')],squel[_0x9d18('0xf')]()[_0x9d18('0x31')](_0x51f920)[_0x9d18('0x12')](_0x4e6cc7)[_0x9d18('0x13')]('cm_contacts',null,_0x9d18('0x32')+_0x4e6cc7+_0x9d18('0x3c'))[_0x9d18('0x13')](_0x3a095c,null,_0x3a095c+'.id\x20=\x20'+_0x4e6cc7+'.'+_0x276442)[_0x9d18('0x15')](_0x4e6cc7+_0x9d18('0x33'),_0x15762b)[_0x9d18('0x15')](_0x9d18('0x34'),NOW)['where'](_0x9d18('0x36'),squel[_0x9d18('0xf')]()['field'](_0x9d18('0x11'))[_0x9d18('0x12')](_0x9d18('0x3b'))[_0x9d18('0x15')](_0x9d18('0x3d'),_0x15762b)[_0x9d18('0x15')](_0x276442+'\x20=\x20'+_0x4e6cc7+'.'+_0x276442)))[_0x9d18('0x38')]();}function insertTzCmHopper(_0x5bc4d4,_0x529760,_0x1edfdc,_0x312309,_0x4c222f,_0x42d836){var _0x35678f=['cm_contacts.phone',_0x9d18('0x3e')+_0x42d836+'.offset-cm_contacts.utcOffset\x20minute)',_0x9d18('0x3f'),_0x9d18('0x26'),_0x529760+'.'+_0x312309,'cm_contacts.createdAt',_0x9d18('0x28'),'cm_contacts.priority',_0x9d18('0x40'),'\x22'+_0x4c222f+'\x22'];var _0x424021=squel[_0x9d18('0x2a')]()[_0x9d18('0x3a')](_0x9d18('0x2b'))['fromQuery']([_0x9d18('0x11'),_0x9d18('0x41'),_0x9d18('0x42'),_0x9d18('0x2d'),_0x312309,_0x9d18('0x2e'),_0x9d18('0x2f'),_0x9d18('0x43'),_0x9d18('0x30'),_0x9d18('0x44')],squel[_0x9d18('0xf')]()[_0x9d18('0x31')](_0x35678f)[_0x9d18('0x12')](_0x529760)[_0x9d18('0x13')]('cm_contacts',null,_0x9d18('0x32')+_0x529760+'.CmListId')['join'](_0x1edfdc,null,_0x1edfdc+_0x9d18('0x14')+_0x529760+'.'+_0x312309)[_0x9d18('0x13')](_0x42d836,null,_0x42d836+_0x9d18('0x14')+_0x529760+'.'+_0x312309)[_0x9d18('0x15')](_0x529760+'.CmListId\x20=\x20?',_0x5bc4d4)[_0x9d18('0x15')](_0x9d18('0x34'),NOW)[_0x9d18('0x15')](_0x9d18('0x36'),selectNotIn(_0x529760,_0x1edfdc,_0x312309,'cm_hopper',[_0x9d18('0x37'),_0x9d18('0x35')]))[_0x9d18('0x15')](_0x9d18('0x36'),selectNotIn(_0x529760,_0x1edfdc,_0x312309,_0x9d18('0x2b'),[_0x9d18('0x37')])))[_0x9d18('0x38')]();return _0x424021;}function insertTzCmHopperBlack(_0x378114,_0x3e8eee,_0xa65413,_0x3d4bd6){var _0x5c287d=[_0x9d18('0x39'),_0x9d18('0x3f'),_0x9d18('0x26'),_0x3e8eee+'.'+_0x3d4bd6,'cm_contacts.createdAt',_0x9d18('0x28')];return squel[_0x9d18('0x2a')]()[_0x9d18('0x3a')](_0x9d18('0x3b'))[_0x9d18('0x2c')]([_0x9d18('0x11'),'ContactId',_0x9d18('0x2d'),_0x3d4bd6,_0x9d18('0x2e'),_0x9d18('0x2f')],squel[_0x9d18('0xf')]()[_0x9d18('0x31')](_0x5c287d)[_0x9d18('0x12')](_0x3e8eee)['join'](_0x9d18('0x45'),null,_0x9d18('0x32')+_0x3e8eee+_0x9d18('0x3c'))['join'](_0xa65413,null,_0xa65413+_0x9d18('0x14')+_0x3e8eee+'.'+_0x3d4bd6)['where'](_0x3e8eee+_0x9d18('0x33'),_0x378114)[_0x9d18('0x15')](_0x9d18('0x34'),NOW)['where'](_0x9d18('0x36'),squel[_0x9d18('0xf')]()['field'](_0x9d18('0x11'))[_0x9d18('0x12')](_0x9d18('0x3b'))[_0x9d18('0x15')](_0x9d18('0x3d'),_0x378114)['where'](_0x3d4bd6+_0x9d18('0x16')+_0x3e8eee+'.'+_0x3d4bd6)))[_0x9d18('0x38')]();}function insertCmHopperAdditionalPhones(_0x244082){var _0x56dc26=[_0x9d18('0x46'),_0x9d18('0x47'),_0x9d18('0x48'),_0x9d18('0x49'),_0x9d18('0x4a')];return squel[_0x9d18('0x2a')]()[_0x9d18('0x3a')](_0x9d18('0x4b'))[_0x9d18('0x2c')]([_0x9d18('0x4c'),_0x9d18('0x11'),_0x9d18('0x4d'),_0x9d18('0x2e'),_0x9d18('0x2f')],squel[_0x9d18('0xf')]()[_0x9d18('0x31')](_0x56dc26)[_0x9d18('0x12')]('cm_hopper')[_0x9d18('0x13')]('cm_contacts',null,_0x9d18('0x4e'))['join'](_0x9d18('0x4f'),null,_0x9d18('0x50'))['where'](_0x9d18('0x51'),_0x244082)[_0x9d18('0x15')](_0x9d18('0x34'),NOW))[_0x9d18('0x38')]();}function insertCmContact(_0x269d7d,_0x1d3891,_0x5c84cb,_0x5dcdf4){var _0x24ef30=_[_0x9d18('0x52')](_[_0x9d18('0x53')](_0x5dcdf4),[_0x9d18('0x2d'),'CompanyId',_0x9d18('0x2e'),_0x9d18('0x2f'),_0x9d18('0x54')]);return squel['insert']()[_0x9d18('0x3a')](_0x9d18('0x45'))[_0x9d18('0x2c')](_0x24ef30,squel[_0x9d18('0xf')]()[_0x9d18('0x31')](_0x24ef30)[_0x9d18('0x12')](_0x1d3891)['where']('('+_0x5c84cb[_0x9d18('0x13')](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0x9d18('0x31')](_0x5c84cb)[_0x9d18('0x12')]('cm_contacts')[_0x9d18('0x15')]('ListId\x20=\x20?',_0x269d7d)[_0x9d18('0x15')](_0x9d18('0x55')))[_0x9d18('0x15')]('id\x20IN\x20?',squel['select']()['field'](_0x9d18('0x56'),_0x9d18('0x57'))['from'](_0x1d3891)[_0x9d18('0x58')](_0x5c84cb[_0x9d18('0x13')](','))))[_0x9d18('0x38')]();}function handleStop(){logger[_0x9d18('0x59')](_0x9d18('0x5a'));stopped=!![];}function handleUncaughtException(_0x2ab815){logger[_0x9d18('0x5b')](_0x2ab815['message']);process[_0x9d18('0x5c')](0x1);}function handleError(_0x66647c,_0x5e90d8){stats[_0x9d18('0x5d')][_0x9d18('0x1e')]({'name':_0x5e90d8[_0x9d18('0x5e')],'message':_0x5e90d8[_0x9d18('0x5f')],'row':_0x66647c});}function handleQuery(_0x45d8dd){logger[_0x9d18('0x59')](_0x45d8dd);return db[_0x9d18('0x60')][_0x9d18('0x61')](_0x45d8dd)[_0x9d18('0x62')](function(_0x39bb4b){results[_0x9d18('0x1e')](_0x39bb4b);})[_0x9d18('0x63')](function(_0x4a1ee7){logger[_0x9d18('0x5b')](_0x4a1ee7['message']);});}function updateTzCampaigns(_0x2dd977){return new Promise(function(_0x2706c5,_0x2081ab){var _0xb11451=squel[_0x9d18('0xf')]()[_0x9d18('0x31')]([_0x9d18('0x64'),'campaigns.dialTimezone'])[_0x9d18('0x12')]('campaigns')['join'](_0x9d18('0x65'),null,_0x9d18('0x66'))[_0x9d18('0x15')]('campaigns_has_cm_lists.CmListId='+_0x2dd977);db['sequelize'][_0x9d18('0x61')](_0xb11451[_0x9d18('0x38')]())[_0x9d18('0x62')](function(_0x1ebab0){var _0xefc070=[];for(var _0x225ecf=0x0;_0x225ecf<_0x1ebab0[_0x9d18('0x1b')];_0x225ecf++){_0xefc070[_0x9d18('0x1e')](getTimezoneData(_0x1ebab0[_0x225ecf],tmp_campaigns));}BPromise[_0x9d18('0x1c')](_0xefc070)[_0x9d18('0x1a')](function(){_0x2706c5({'val':0x1});});})[_0x9d18('0x63')](function(_0x59655d){logger[_0x9d18('0x5b')](_0x59655d[_0x9d18('0x5f')]);_0x2706c5({'val':0x0});});});}function updateTzVoiceQueues(_0x43bc63){return new Promise(function(_0x4f0ea9,_0x24dd75){var _0xc2afe4=squel[_0x9d18('0xf')]()['fields']([_0x9d18('0x67'),_0x9d18('0x68')])[_0x9d18('0x12')]('voice_queues')[_0x9d18('0x13')](_0x9d18('0x69'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')[_0x9d18('0x15')]('voice_queues_has_cm_lists.CmListId='+_0x43bc63);db[_0x9d18('0x60')][_0x9d18('0x61')](_0xc2afe4['toString']())['spread'](function(_0x31d83a){var _0x128c0d=[];for(var _0x5822c1=0x0;_0x5822c1<_0x31d83a[_0x9d18('0x1b')];_0x5822c1++){_0x128c0d[_0x9d18('0x1e')](getTimezoneData(_0x31d83a[_0x5822c1],tmp_voice_queues));}BPromise[_0x9d18('0x1c')](_0x128c0d)[_0x9d18('0x1a')](function(){_0x4f0ea9({'val':0x1});});})[_0x9d18('0x63')](function(_0x4931a8){logger[_0x9d18('0x5b')](_0x4931a8['message']);_0x4f0ea9({'val':0x0});});});}function getTimezoneData(_0x5651f9,_0x7ecbe3){return new Promise(function(_0x426748,_0x39c4e4){var _0x5ed2f6=shared['timezones'];var _0x53743c=_0x5ed2f6[_0x5651f9['dialTimezone']];if(_[_0x9d18('0x20')](_0x53743c)){_0x426748({'ret':0x1});}else{var _0xd886=_0x53743c[_0x9d18('0x6a')];var _0x23b9e4=squel[_0x9d18('0x2a')]()[_0x9d18('0x3a')](_0x7ecbe3)[_0x9d18('0x6b')]('id',_0x5651f9['id'])[_0x9d18('0x6b')](_0x9d18('0x6c'),_0xd886)[_0x9d18('0x6b')](_0x9d18('0x6d'),_0x5651f9[_0x9d18('0x6d')])[_0x9d18('0x38')]();return db[_0x9d18('0x60')][_0x9d18('0x61')](_0x23b9e4)[_0x9d18('0x62')](function(_0x103624){_0x426748({'ret':0x1});})[_0x9d18('0x63')](function(_0xa0005a){logger['error'](_0xa0005a[_0x9d18('0x5f')]);_0x39c4e4({'ret':0x1});});}});}function handleTZQuery(_0x282004){logger[_0x9d18('0x59')](_0x282004);return db[_0x9d18('0x60')][_0x9d18('0x61')](_0x282004)[_0x9d18('0x62')](function(_0x5c5d33){})[_0x9d18('0x63')](function(_0x1af823){logger['error'](_0x1af823['message']);});}function main(_0x5f2d3b,_0x1c406e,_0x5ad1db,_0x722456){logger[_0x9d18('0x59')](_0x9d18('0x6e'),_0x5f2d3b,JSON['stringify'](_0x1c406e));process[_0x9d18('0x6f')](_0x9d18('0x70'));var _0x3ea154=_0x1c406e[_0x9d18('0x71')];var _0x5c0ad1=_['clone'](_0x3ea154);var _0x44207f=_0x1c406e[_0x9d18('0x72')];var _0x3bf81d=path['join'](config['root'],_0x9d18('0x73'),_0x44207f+_0x9d18('0x74'));hasTZ=_['keys'](_0x3ea154)['includes'](_0x9d18('0x6d'));var _0x28f70c=_[_0x9d18('0x53')](_0x3ea154)['join']();logger[_0x9d18('0x59')](_0x9d18('0x75'),_0x28f70c);db[_0x9d18('0x76')][_0x9d18('0x19')]({'raw':!![],'attributes':['id',_0x9d18('0x77')]})[_0x9d18('0x1a')](function(_0x1b5881){for(var _0x235c88=0x0;_0x235c88<_0x1b5881[_0x9d18('0x1b')];_0x235c88++){if(_0x1b5881[_0x235c88]['name']in _0x3ea154){contactItemTypes[_0x9d18('0x1e')](_0x1b5881[_0x235c88]);delete _0x5c0ad1[_0x1b5881[_0x235c88][_0x9d18('0x77')]];hasAdditionalPhones=!![];}for(var _0x22201b in _0x3ea154){if(_0x1b5881[_0x235c88][_0x9d18('0x77')]+_0x9d18('0x78')===_0x22201b){phoneDescriptions[_0x9d18('0x1e')]({'itemTypeId':_0x1b5881[_0x235c88]['id'],'description':_0x22201b});delete _0x5c0ad1[_0x22201b];}}}if(hasAdditionalPhones)_0x5c0ad1[_0x9d18('0x1d')]='';var _0x566e0d=_['keys'](_0x5c0ad1)[_0x9d18('0x13')]();logger[_0x9d18('0x59')]('header',_0x566e0d);fs[_0x9d18('0x79')](_0x3bf81d,_0x566e0d+'\x0a');Papa[_0x9d18('0x7a')](fs[_0x9d18('0x7b')](_0x5f2d3b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3c4fb2,_0x1fa542){try{for(var _0x1a2b64=0x0,_0x3bf623=[];_0x1a2b64<_0x3c4fb2[_0x9d18('0x7c')][_0x9d18('0x1b')];_0x1a2b64++){stats[_0x9d18('0x7d')]+=0x1;if(_0x3c4fb2[_0x9d18('0x5d')][_0x1a2b64]){handleError(_0x3c4fb2[_0x9d18('0x7c')][_0x1a2b64],_0x3c4fb2[_0x9d18('0x5d')][_0x1a2b64]);}else{var _0xdeba24=[];var _0x48192d=[];var _0x2b68ef={};for(var _0x39e72c in _0x3ea154){let _0x243502=contactItemTypes[_0x9d18('0x7e')](_0x5989d9=>_0x5989d9[_0x9d18('0x77')]===_0x39e72c);let _0x371271=contactItemTypes[_0x9d18('0x7e')](_0x45672c=>_0x45672c[_0x9d18('0x77')]+_0x9d18('0x78')===_0x39e72c);if(_['isNil'](_0x243502)&&_[_0x9d18('0x20')](_0x371271)){if(_0x3ea154[_0x9d18('0x7f')](_0x39e72c)){if(_0x3c4fb2[_0x9d18('0x7c')][_0x1a2b64][_0x3ea154[_0x39e72c]]){var _0x4b85d1=_[_0x9d18('0x80')](_0x3c4fb2['data'][_0x1a2b64][_0x3ea154[_0x39e72c]][_0x9d18('0x81')](/"/g,'\x27'));switch(_0x39e72c){case _0x9d18('0x41'):var _0x42569d=moment(_0x4b85d1,_0x9d18('0xd'),!![]);if(_0x42569d[_0x9d18('0x82')]()){_0x3bf623[_0x9d18('0x1e')]('\x22'+_0x4b85d1+'\x22');}else{_0xdeba24[_0x9d18('0x1e')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case'priority':var _0x256590=parseInt(_0x4b85d1);_0x4b85d1=_[_0x9d18('0x83')](_0x256590)||_0x256590<0x0||_0x256590>0x4?_0x722456?0x3:0x2:_0x256590;_0x3bf623[_0x9d18('0x1e')]('\x22'+_0x4b85d1+'\x22');break;case _0x9d18('0x30'):var _0x6ef16=parseInt(_0x4b85d1);if(_['isNumber'](_0x6ef16)&&_['includes'](_0x5ad1db,_0x6ef16)){_0x3bf623['push']('\x22'+_0x6ef16+'\x22');}else{_0xdeba24[_0x9d18('0x1e')](_0x9d18('0x84'));}break;case _0x9d18('0x85'):if(isEmail(_0x4b85d1)){_0x3bf623[_0x9d18('0x1e')]('\x22'+_0x4b85d1+'\x22');}else{_0xdeba24[_0x9d18('0x1e')]('email\x20wrong\x20format');}break;case _0x9d18('0x86'):var _0x379e47=moment(_0x4b85d1,_0x9d18('0x87'),!![]);if(_0x379e47['isValid']()){_0x3bf623[_0x9d18('0x1e')]('\x22'+_0x4b85d1+'\x22');}else{_0xdeba24[_0x9d18('0x1e')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0x9d18('0x6d'):var _0x19e3e4=shared[_0x9d18('0x88')];var _0x3021e5=_0x19e3e4[_0x4b85d1];if(!_['isNil'](_0x3021e5)){var _0x17e8d2=_0x3021e5[_0x9d18('0x6a')];_0x3bf623[_0x9d18('0x1e')]('\x22'+_0x4b85d1+'\x22');_0x3bf623['push']('\x22'+_0x17e8d2+'\x22');}break;default:_0x3bf623[_0x9d18('0x1e')]('\x22'+_0x4b85d1+'\x22');}}else{switch(_0x39e72c){case _0x9d18('0x89'):case'phone':_0xdeba24[_0x9d18('0x1e')](_0x39e72c+_0x9d18('0x8a'));break;default:_0x3bf623[_0x9d18('0x1e')]('\x22\x22');}}}}else{var _0x17e168='';if(!_['isNil'](_0x243502)){if(!_0x2b68ef[_0x9d18('0x7f')](_0x243502['id'])){if(!_[_0x9d18('0x20')](_0x3c4fb2[_0x9d18('0x7c')][_0x1a2b64][_0x3ea154[_0x39e72c]])){var _0x4b85d1=_[_0x9d18('0x80')](_0x3c4fb2[_0x9d18('0x7c')][_0x1a2b64][_0x3ea154[_0x39e72c]][_0x9d18('0x81')](/"/g,'\x27'));var _0x7592c3=phoneDescriptions[_0x9d18('0x7e')](_0x4639c0=>_0x4639c0[_0x9d18('0x8b')]===_0x243502['id']);if(!_[_0x9d18('0x20')](_0x7592c3)){var _0x2915cd=_[_0x9d18('0x80')](_0x3c4fb2[_0x9d18('0x7c')][_0x1a2b64][_0x3ea154[_0x7592c3[_0x9d18('0x8c')]]][_0x9d18('0x81')](/"/g,'\x27'));if(!_['isNil'](_0x2915cd))_0x4b85d1=_0x4b85d1+'§'+_0x2915cd;}if(_0x17e168=='')_0x17e168=_0x4b85d1;else _0x17e168+='|'+_0x4b85d1;}_0x48192d[_0x9d18('0x1e')](_0x243502['id']+':'+_0x17e168);_0x2b68ef[_0x243502['id']]=0x1;}}}}if(hasAdditionalPhones){_0x3bf623[_0x9d18('0x1e')]('\x22'+_0x48192d['join'](';')+'\x22');}if(_0xdeba24[_0x9d18('0x1b')]){handleError(_0x3c4fb2[_0x9d18('0x7c')][_0x1a2b64],{'code':_0x9d18('0x8d'),'message':_0xdeba24[_0x9d18('0x13')]()});}else{fs[_0x9d18('0x8e')](_0x3bf81d,_0x3bf623[_0x9d18('0x13')]()+'\x0a');}_0x3bf623=[];}if(!(stats[_0x9d18('0x7d')]%0xc8)){socket[_0x9d18('0x8f')]('contact:import:'+_0x44207f,stats);stats['errors']=[];}}if(stopped){logger[_0x9d18('0x59')](_0x9d18('0x90'));_0x1fa542[_0x9d18('0x91')]();}}catch(_0x257e83){handleError(_0x3c4fb2[_0x9d18('0x7c')][_0x1a2b64],{'code':_0x9d18('0x92'),'message':_0x257e83['message']});logger['error'](_0x9d18('0x93'),_0x257e83[_0x9d18('0x5f')]);}},'complete':function(){try{var _0x1fb2e2=[];var _0x3d9b30=[];var _0x153e43='cm_contacts';if(_0x1c406e[_0x9d18('0x94')]&&_0x1c406e[_0x9d18('0x94')]['length']){_0x153e43=_0x9d18('0x95')+_0x44207f;_0x1fb2e2[_0x9d18('0x1e')](_0x9d18('0x96')+_0x153e43+_0x9d18('0x97'));}tmp_campaigns=_0x9d18('0x98')+_0x44207f;tmp_voice_queues=_0x9d18('0x99')+_0x44207f;_0x3d9b30['push'](_0x9d18('0x96')+tmp_campaigns+_0x9d18('0x9a'));_0x3d9b30[_0x9d18('0x1e')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0x9d18('0x9a'));BPromise[_0x9d18('0x9b')](_0x3d9b30,handleTZQuery)[_0x9d18('0x1a')](function(_0x5877e9){updateTzCampaigns(_0x1c406e[_0x9d18('0x2d')])[_0x9d18('0x1a')](function(_0x558250){updateTzVoiceQueues(_0x1c406e[_0x9d18('0x2d')])[_0x9d18('0x1a')](function(_0xc27327){if(hasTZ)_0x566e0d=_0x566e0d[_0x9d18('0x81')](_0x9d18('0x6d'),_0x9d18('0x9c'));var _0xfc487=util['format'](_0x9d18('0x9d'),_0x3bf81d,_0x153e43,_0x566e0d,_0x1c406e[_0x9d18('0x2d')],_0x1c406e[_0x9d18('0x9e')]||null,NOW,NOW);if(_[_0x9d18('0x20')](_0x3ea154[_0x9d18('0x41')])){_0xfc487+=_0x9d18('0x9f');}_0x1fb2e2[_0x9d18('0x1e')](_0xfc487);if(_0x1c406e[_0x9d18('0x94')]&&_0x1c406e[_0x9d18('0x94')][_0x9d18('0x1b')]){_0x1fb2e2['push'](insertCmContact(_0x1c406e['ListId'],_0x153e43,_0x1c406e[_0x9d18('0x94')],_0x3ea154));_0x1fb2e2[_0x9d18('0x1e')](_0x9d18('0xa0')+_0x153e43+';');}BPromise[_0x9d18('0x9b')](_0x1fb2e2,handleQuery)[_0x9d18('0x1a')](function(_0x4955eb){BPromise[_0x9d18('0x1c')]([handleAdditionalPhones()])[_0x9d18('0x1a')](function(){_0x1fb2e2=[];for(var _0x5e9e8c=0x0;_0x5e9e8c\x20\x20','existsSync','binding\x20doesn\x27t\x20exists','binding','ListId\x20is\x20mandatory','map','parse','No\x20agent\x20available','SIGINT','uncaughtException','lodash','papaparse','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','defaults','localhost','socket.io-emitter','redis','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','format','YYYYMMDDHHmmss','test','select','field','phone','from','.id\x20=\x20','where','\x20=\x20','sequelize','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push'];(function(_0x3f8be7,_0x2ac068){var _0x37ecc7=function(_0x623a19){while(--_0x623a19){_0x3f8be7['push'](_0x3f8be7['shift']());}};_0x37ecc7(++_0x2ac068);}(_0xc234,0x7f));var _0x4c23=function(_0x15d06f,_0x1c388f){_0x15d06f=_0x15d06f-0x0;var _0x2438e8=_0xc234[_0x15d06f];return _0x2438e8;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x4c23('0x0'));var Papa=require(_0x4c23('0x1'));var util=require('util');var BPromise=require(_0x4c23('0x2'));var moment=require(_0x4c23('0x3'));var squel=require(_0x4c23('0x4'));var Redis=require(_0x4c23('0x5'));var db=require(_0x4c23('0x6'))['db'];var config=require(_0x4c23('0x7'));var logger=require(_0x4c23('0x8'))(_0x4c23('0x9'));config['redis']=_[_0x4c23('0xa')](config['redis'],{'host':_0x4c23('0xb'),'port':0x18eb});var socket=require(_0x4c23('0xc'))(new Redis(config[_0x4c23('0xd')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()['format'](_0x4c23('0xe'));var tempTableName=_0x4c23('0xf')+moment()[_0x4c23('0x10')](_0x4c23('0x11'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x49edff){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))*$/[_0x4c23('0x12')](_0x49edff);}function selectNotIn(_0x1a4f40,_0x117ad5,_0x4de15a,_0x2d6c76,_0x4effe9){return squel[_0x4c23('0x13')]()[_0x4c23('0x14')](_0x4c23('0x15'))[_0x4c23('0x16')](_0x2d6c76)['join'](_0x117ad5,null,_0x117ad5+_0x4c23('0x17')+_0x2d6c76+'.'+_0x4de15a)[_0x4c23('0x18')](_0x2d6c76+'.'+_0x4de15a+_0x4c23('0x19')+_0x1a4f40+'.'+_0x4de15a)[_0x4c23('0x18')](_0x117ad5+'.dialCheckDuplicateType\x20IN\x20('+_0x4effe9['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x508ec6,_0x3645af){promisesAdditionalPhones=[];promisesContact=[];return db[_0x4c23('0x1a')]['query'](_0x4c23('0x1b')+tempTableName)[_0x4c23('0x1c')](function(_0x1020f9){if(_0x1020f9!==null){var _0x87b529=[];for(var _0x12f985=0x0;_0x12f985<_0x1020f9[_0x4c23('0x1d')];_0x12f985++){var _0x4b6cbd=_0x1020f9[_0x12f985];if(!_['isNil'](_0x4b6cbd[_0x4c23('0x15')])){if(!_[_0x4c23('0x1e')](_0x4b6cbd[_0x4c23('0x1f')]))_0x87b529[_0x4c23('0x20')](insertAdditionalPhones(_0x4b6cbd));promisesContact[_0x4c23('0x20')]({'contact':_0x4b6cbd});}}}Promise[_0x4c23('0x21')](_0x87b529)[_0x4c23('0x22')](function(){_0x508ec6({'val':0x1});});})['catch'](function(_0x256210){logger['error'](_0x256210['message']);});});}function insertAdditionalPhones(_0x9ab69d){return new Promise(function(_0x5d8c9f,_0x749259){var _0x27253b=_0x9ab69d[_0x4c23('0x1f')];if(_['isNil'](_0x27253b))_0x749259({'val':0x0});else{var _0x444287=_0x27253b[_0x4c23('0x23')](';');var _0x23785f=[];orderBy=0x0;for(var _0x23c660=0x0;_0x23c660<_0x444287['length'];_0x23c660++){_0x23785f['push'](splitAdditionalPhone(_0x9ab69d['id'],_0x444287[_0x23c660]));}Promise['all'](_0x23785f)[_0x4c23('0x22')](function(){_0x5d8c9f({'val':_0x444287[_0x4c23('0x1d')]});});}});}function splitAdditionalPhone(_0xdea3b2,_0x3f05d3){return new Promise(function(_0x1dc97b,_0x57ef57){var _0x2db670=_0x3f05d3[_0x4c23('0x23')](':');var _0x56aac8=_0x2db670[0x0];var _0xf6a6f5=_0x2db670[0x1];if(_0xf6a6f5!==''){var _0x2f8cd7=_0xf6a6f5[_0x4c23('0x23')]('|');var _0xf7d5fd=[];for(var _0x4646b5=0x0;_0x4646b5<_0x2f8cd7[_0x4c23('0x1d')];_0x4646b5++){if(_0x2f8cd7[_0x4646b5]!==''){var _0x378270=_[_0x4c23('0x24')](promisesAdditionalPhones,{'contactId':_0xdea3b2,'phone':_0x2f8cd7[_0x4646b5]});if(_0x378270[_0x4c23('0x1d')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0xdea3b2,'contactTypeId':_0x56aac8,'phone':_0x2f8cd7[_0x4646b5],'orderBy':orderBy});}}}_0x1dc97b({'ok':0x1});}else _0x1dc97b({'res':0x0});});}function createAdditionalPhone(_0x521500,_0x4537a2,_0x15afeb,_0x59f257){var _0x12b6a9='';var _0x237cd3='';var _0x3bb66a=_0x15afeb['split']('§');_0x12b6a9=_0x3bb66a[0x0];if(_0x3bb66a['length']==0x2)_0x237cd3=_0x3bb66a[0x1];return new Promise(function(_0x3ae82d,_0x5026e5){return db[_0x4c23('0x25')][_0x4c23('0x26')]({'where':{'CmContactId':_0x521500,'item':_0x12b6a9}})[_0x4c23('0x22')](function(_0x483d02){if(_0x483d02){return db['CmContactHasItem']['update']({'ItemTypeId':_0x4537a2,'description':_0x237cd3,'OrderBy':_0x59f257},{'where':{'CmContactId':_0x521500,'item':_0x12b6a9}})['then'](function(_0x5af8d8){_0x3ae82d({'res':_0x4c23('0x27')});});}else{return db['CmContactHasItem'][_0x4c23('0x28')]({'CmContactId':_0x521500,'item':_0x12b6a9,'ItemTypeId':_0x4537a2,'description':_0x237cd3,'OrderBy':_0x59f257,'ItemClass':_0x4c23('0x29')})['then'](function(_0x34a694){_0x3ae82d({'res':_0x4c23('0x2a')});});}});});}function updateContact(_0x3a8024){return new Promise(function(_0x2cb144,_0xc0cb72){var _0x194fe4=_0x3a8024['id'];delete _0x3a8024['id'];return db[_0x4c23('0x2b')][_0x4c23('0x2c')](_0x3a8024,{'where':{'id':_0x194fe4}})[_0x4c23('0x22')](function(_0x47085c){updatedRows+=0x1;return db['CmHopper'][_0x4c23('0x2c')]({'phone':_0x3a8024[_0x4c23('0x15')]},{'where':{'ContactId':_0x194fe4}})[_0x4c23('0x22')](function(_0x2f144d){_0x2cb144({'ret':'OK'});});});});}function insertCmHopper(_0x54d69a,_0x583161,_0xe66917,_0x902137,_0x4c6dd6){var _0x5f5728=[_0x4c23('0x2d'),_0x4c23('0x2e'),_0x4c23('0x2f'),_0x4c23('0x30'),_0x583161+'.'+_0x902137,_0x4c23('0x31'),_0x4c23('0x32'),'cm_contacts.priority',_0x4c23('0x33'),'\x22'+_0x4c6dd6+'\x22'];return squel['insert']()[_0x4c23('0x34')](_0x4c23('0x35'))[_0x4c23('0x36')](['phone',_0x4c23('0x37'),_0x4c23('0x38'),'ListId',_0x902137,_0x4c23('0x39'),_0x4c23('0x3a'),_0x4c23('0x3b'),_0x4c23('0x3c'),_0x4c23('0x3d')],squel[_0x4c23('0x13')]()['fields'](_0x5f5728)[_0x4c23('0x16')](_0x583161)[_0x4c23('0x3e')]('cm_contacts',null,_0x4c23('0x3f')+_0x583161+_0x4c23('0x40'))[_0x4c23('0x3e')](_0xe66917,null,_0xe66917+_0x4c23('0x17')+_0x583161+'.'+_0x902137)[_0x4c23('0x18')](_0x583161+_0x4c23('0x41'),_0x54d69a)[_0x4c23('0x18')](_0x4c23('0x42'),NOW)['where'](_0x4c23('0x43'),selectNotIn(_0x583161,_0xe66917,_0x902137,'cm_hopper',[_0x4c23('0x44'),_0x4c23('0x45')]))[_0x4c23('0x18')](_0x4c23('0x43'),selectNotIn(_0x583161,_0xe66917,_0x902137,_0x4c23('0x35'),['\x22always\x22'])))[_0x4c23('0x46')]();}function insertCmHopperBlack(_0x48f115,_0x27837b,_0x1b60cf,_0x30eacf){var _0x13cef9=['cm_contacts.phone','cm_contacts.id',_0x4c23('0x30'),_0x27837b+'.'+_0x30eacf,_0x4c23('0x31'),_0x4c23('0x32')];return squel[_0x4c23('0x47')]()['into']('cm_hopper_black')[_0x4c23('0x36')](['phone',_0x4c23('0x38'),_0x4c23('0x48'),_0x30eacf,'createdAt',_0x4c23('0x3a')],squel['select']()[_0x4c23('0x49')](_0x13cef9)[_0x4c23('0x16')](_0x27837b)[_0x4c23('0x3e')](_0x4c23('0x4a'),null,_0x4c23('0x3f')+_0x27837b+'.CmListId')[_0x4c23('0x3e')](_0x1b60cf,null,_0x1b60cf+'.id\x20=\x20'+_0x27837b+'.'+_0x30eacf)[_0x4c23('0x18')](_0x27837b+_0x4c23('0x41'),_0x48f115)['where'](_0x4c23('0x42'),NOW)['where'](_0x4c23('0x43'),squel[_0x4c23('0x13')]()[_0x4c23('0x14')]('phone')['from'](_0x4c23('0x4b'))['where'](_0x4c23('0x4c'),_0x48f115)[_0x4c23('0x18')](_0x30eacf+_0x4c23('0x4d'),_0x27837b+'.'+_0x30eacf)))[_0x4c23('0x46')]();}function insertCmHopperAdditionalPhones(_0x2dde42){var _0x580b03=[_0x4c23('0x4e'),_0x4c23('0x4f'),'cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt',_0x4c23('0x50')];return squel['insert']()[_0x4c23('0x34')]('cm_hopper_additional_phones')['fromQuery']([_0x4c23('0x51'),'phone',_0x4c23('0x52'),_0x4c23('0x39'),'updatedAt'],squel[_0x4c23('0x13')]()[_0x4c23('0x49')](_0x580b03)[_0x4c23('0x16')](_0x4c23('0x35'))['join'](_0x4c23('0x4a'),null,_0x4c23('0x53'))[_0x4c23('0x3e')]('cm_contact_has_items',null,_0x4c23('0x54'))[_0x4c23('0x18')](_0x4c23('0x55'),_0x2dde42)['where']('cm_contacts.createdAt\x20=\x20?',NOW))[_0x4c23('0x46')]();}function insertCmContact(_0xf20024,_0x3e8ba8,_0x166df5,_0x2c02d1){var _0x1c28d1=_[_0x4c23('0x56')](_['keys'](_0x2c02d1),['ListId',_0x4c23('0x57'),_0x4c23('0x39'),'updatedAt']);return squel[_0x4c23('0x47')]()[_0x4c23('0x34')](_0x4c23('0x4a'))[_0x4c23('0x36')](_0x1c28d1,squel['select']()[_0x4c23('0x49')](_0x1c28d1)[_0x4c23('0x16')](_0x3e8ba8)['where']('('+_0x166df5[_0x4c23('0x3e')](',')+_0x4c23('0x58'),squel['select']()[_0x4c23('0x49')](_0x166df5)[_0x4c23('0x16')](_0x4c23('0x4a'))[_0x4c23('0x18')](_0x4c23('0x4c'),_0xf20024))[_0x4c23('0x18')]('id\x20IN\x20?',squel[_0x4c23('0x13')]()['field'](_0x4c23('0x59'),_0x4c23('0x5a'))[_0x4c23('0x16')](_0x3e8ba8)['group'](_0x166df5[_0x4c23('0x3e')](','))))[_0x4c23('0x46')]();}function handleStop(){logger[_0x4c23('0x5b')](_0x4c23('0x5c'));stopped=!![];}function handleUncaughtException(_0x1f1aba){logger[_0x4c23('0x5d')](_0x1f1aba[_0x4c23('0x5e')]);process[_0x4c23('0x5f')](0x1);}function handleError(_0x521c26,_0x547974){stats['errors']['push']({'name':_0x547974[_0x4c23('0x60')],'message':_0x547974[_0x4c23('0x5e')],'row':_0x521c26});}function handleQuery(_0x12e055){logger['info'](_0x12e055);return db[_0x4c23('0x1a')][_0x4c23('0x61')](_0x12e055)[_0x4c23('0x1c')](function(_0x46a5fe){results['push'](_0x46a5fe);})['catch'](function(_0x488c52){logger['error'](_0x488c52['message']);});}function main(_0x23f450,_0x5bdfec,_0x43201f,_0x5c2a2e){logger[_0x4c23('0x5b')](_0x4c23('0x62'),_0x23f450,JSON[_0x4c23('0x63')](_0x5bdfec));process['send'](_0x4c23('0x64'));var _0x51a9f0=_0x5bdfec['binding'];var _0x2a552b=_[_0x4c23('0x65')](_0x51a9f0);var _0x1c3980=_0x5bdfec['socket_timestamp'];var _0x49ed96=path[_0x4c23('0x3e')](config[_0x4c23('0x66')],_0x4c23('0x67'),_0x1c3980+_0x4c23('0x68'));logger[_0x4c23('0x5b')](_0x4c23('0x69'),_0x5bdfec);db[_0x4c23('0x6a')][_0x4c23('0x6b')]({'raw':!![],'attributes':['id',_0x4c23('0x6c')]})['then'](function(_0x53f504){for(var _0x471455=0x0;_0x471455<_0x53f504['length'];_0x471455++){if(_0x53f504[_0x471455]['name']in _0x51a9f0){contactItemTypes['push'](_0x53f504[_0x471455]);delete _0x2a552b[_0x53f504[_0x471455]['name']];hasAdditionalPhones=!![];}for(var _0x317dd4 in _0x51a9f0){if(_0x53f504[_0x471455][_0x4c23('0x6c')]+_0x4c23('0x6d')===_0x317dd4){phoneDescriptions[_0x4c23('0x20')]({'itemTypeId':_0x53f504[_0x471455]['id'],'description':_0x317dd4});delete _0x2a552b[_0x317dd4];}}}if(hasAdditionalPhones)_0x2a552b[_0x4c23('0x1f')]='';var _0x391b04=_[_0x4c23('0x6e')](_0x2a552b)['join']();logger[_0x4c23('0x5b')](_0x4c23('0x6f'),_0x391b04);fs[_0x4c23('0x70')](_0x49ed96,_0x391b04+'\x0a');Papa['parse'](fs[_0x4c23('0x71')](_0x23f450),{'header':!![],'skipEmptyLines':!![],'step':function(_0x366eb5,_0x371425){try{for(var _0x478361=0x0,_0x10bde5=[];_0x478361<_0x366eb5['data'][_0x4c23('0x1d')];_0x478361++){stats[_0x4c23('0x72')]+=0x1;if(_0x366eb5[_0x4c23('0x73')][_0x478361]){handleError(_0x366eb5[_0x4c23('0x74')][_0x478361],_0x366eb5[_0x4c23('0x73')][_0x478361]);}else{var _0x36b755=[];var _0x63066d=[];var _0x46ae45={};for(var _0xfa3a18 in _0x51a9f0){let _0x434219=contactItemTypes[_0x4c23('0x75')](_0x83ec0b=>_0x83ec0b['name']===_0xfa3a18);let _0x5419a0=contactItemTypes[_0x4c23('0x75')](_0x5f31ca=>_0x5f31ca[_0x4c23('0x6c')]+_0x4c23('0x6d')===_0xfa3a18);if(_[_0x4c23('0x1e')](_0x434219)&&_[_0x4c23('0x1e')](_0x5419a0)){if(_0x51a9f0['hasOwnProperty'](_0xfa3a18)){if(_0x366eb5['data'][_0x478361][_0x51a9f0[_0xfa3a18]]){var _0x1957e9=_['trim'](_0x366eb5[_0x4c23('0x74')][_0x478361][_0x51a9f0[_0xfa3a18]][_0x4c23('0x76')](/"/g,'\x27'));switch(_0xfa3a18){case'scheduledat':var _0x5b45d5=moment(_0x1957e9,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x5b45d5[_0x4c23('0x77')]()){_0x10bde5[_0x4c23('0x20')]('\x22'+_0x1957e9+'\x22');}else{_0x36b755[_0x4c23('0x20')](_0x4c23('0x78'));}break;case'priority':var _0x31a695=parseInt(_0x1957e9);_0x1957e9=_[_0x4c23('0x79')](_0x31a695)||_0x31a695<0x0||_0x31a695>0x4?_0x5c2a2e?0x3:0x2:_0x31a695;_0x10bde5[_0x4c23('0x20')]('\x22'+_0x1957e9+'\x22');break;case _0x4c23('0x3c'):var _0x806ed7=parseInt(_0x1957e9);if(_[_0x4c23('0x7a')](_0x806ed7)&&_['includes'](_0x43201f,_0x806ed7)){_0x10bde5['push']('\x22'+_0x806ed7+'\x22');}else{_0x36b755[_0x4c23('0x20')](_0x4c23('0x7b'));}break;case _0x4c23('0x7c'):if(isEmail(_0x1957e9)){_0x10bde5[_0x4c23('0x20')]('\x22'+_0x1957e9+'\x22');}else{_0x36b755[_0x4c23('0x20')](_0x4c23('0x7d'));}break;case _0x4c23('0x7e'):var _0x11616d=moment(_0x1957e9,'YYYY-MM-DD',!![]);if(_0x11616d[_0x4c23('0x77')]()){_0x10bde5[_0x4c23('0x20')]('\x22'+_0x1957e9+'\x22');}else{_0x36b755[_0x4c23('0x20')](_0x4c23('0x7f'));}break;default:_0x10bde5['push']('\x22'+_0x1957e9+'\x22');}}else{switch(_0xfa3a18){case _0x4c23('0x80'):case _0x4c23('0x15'):_0x36b755[_0x4c23('0x20')](_0xfa3a18+'\x20not\x20specified');break;default:_0x10bde5[_0x4c23('0x20')]('\x22\x22');}}}}else{var _0x29c5a3='';if(!_['isNil'](_0x434219)){if(!_0x46ae45['hasOwnProperty'](_0x434219['id'])){for(var _0x2d500f=0x0;_0x2d500f<_0x51a9f0[_0xfa3a18][_0x4c23('0x1d')];_0x2d500f++){var _0x1957e9=_[_0x4c23('0x81')](_0x366eb5['data'][_0x478361][_0x51a9f0[_0xfa3a18][_0x2d500f]]['replace'](/"/g,'\x27'));var _0x36803c=phoneDescriptions[_0x4c23('0x75')](_0x2a9bb2=>_0x2a9bb2['itemTypeId']===_0x434219['id']);if(!_[_0x4c23('0x1e')](_0x36803c)){var _0x2d8aeb=_[_0x4c23('0x81')](_0x366eb5['data'][_0x478361][_0x51a9f0[_0x36803c[_0x4c23('0x82')]][0x0]][_0x4c23('0x76')](/"/g,'\x27'));if(!_[_0x4c23('0x1e')](_0x2d8aeb))_0x1957e9=_0x1957e9+'§'+_0x2d8aeb;}if(_0x29c5a3=='')_0x29c5a3=_0x1957e9;else _0x29c5a3+='|'+_0x1957e9;}_0x63066d['push'](_0x434219['id']+':'+_0x29c5a3);_0x46ae45[_0x434219['id']]=0x1;}}}}if(hasAdditionalPhones){_0x10bde5[_0x4c23('0x20')]('\x22'+_0x63066d['join'](';')+'\x22');}if(_0x36b755[_0x4c23('0x1d')]){handleError(_0x366eb5[_0x4c23('0x74')][_0x478361],{'code':'SystemRow','message':_0x36b755[_0x4c23('0x3e')]()});}else{fs['appendFileSync'](_0x49ed96,_0x10bde5[_0x4c23('0x3e')]()+'\x0a');}_0x10bde5=[];}if(!(stats[_0x4c23('0x72')]%0xc8)){socket[_0x4c23('0x83')](_0x4c23('0x84')+_0x1c3980,stats);stats[_0x4c23('0x73')]=[];}}if(stopped){logger[_0x4c23('0x5b')](_0x4c23('0x85'));_0x371425['abort']();}}catch(_0x34f7f0){handleError(_0x366eb5[_0x4c23('0x74')][_0x478361],{'code':_0x4c23('0x86'),'message':_0x34f7f0[_0x4c23('0x5e')]});logger[_0x4c23('0x5d')]('step',_0x34f7f0[_0x4c23('0x5e')]);}},'complete':function(){try{var _0x377905=[];var _0x447cc3=tempTableName;_0x377905[_0x4c23('0x20')](_0x4c23('0x87')+_0x447cc3+_0x4c23('0x88'));logger['info'](_0x4c23('0x89'),contactItemTypes[_0x4c23('0x1d')]);var _0x4ac3e8=util[_0x4c23('0x10')](_0x4c23('0x8a'),_0x49ed96,_0x447cc3,_0x391b04,_0x5bdfec['ListId'],_0x5bdfec[_0x4c23('0x57')]||null,NOW,NOW);if(_[_0x4c23('0x1e')](_0x51a9f0[_0x4c23('0x37')])){_0x4ac3e8+=',\x20scheduledAt\x20=\x20NOW()';}_0x377905['push'](_0x4ac3e8);BPromise['each'](_0x377905,handleQuery)[_0x4c23('0x22')](function(_0x16d0e4){BPromise[_0x4c23('0x21')]([handleAdditionalPhones()])['then'](function(){_0x377905=[];for(var _0x4f426=0x0;_0x4f426\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','binding','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','util','bluebird','moment','squel','ioredis','../../../config/logger','import','defaults','socket.io-emitter','redis','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_','YYYYMMDDHHmmss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','all','then','catch','message','split','filter','CmContactHasItem','findOne','update','create','PHONE','CmContact','cm_contacts.scheduledat','cm_contacts.createdAt','cm_contacts.updatedAt','fromQuery','ContactId','ListId','createdAt','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_hopper','cm_contacts.ListId','insert','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','cm_contact_has_items.item','cm_contact_has_items.OrderBy'];(function(_0x5f1617,_0x46277b){var _0x3af5da=function(_0x15b934){while(--_0x15b934){_0x5f1617['push'](_0x5f1617['shift']());}};_0x3af5da(++_0x46277b);}(_0x3134,0xdf));var _0x4313=function(_0x430041,_0x484afa){_0x430041=_0x430041-0x0;var _0x50dc27=_0x3134[_0x430041];return _0x50dc27;};'use strict';var fs=require('fs');var path=require(_0x4313('0x0'));var _=require('lodash');var Papa=require('papaparse');var util=require(_0x4313('0x1'));var BPromise=require(_0x4313('0x2'));var moment=require(_0x4313('0x3'));var squel=require(_0x4313('0x4'));var Redis=require(_0x4313('0x5'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0x4313('0x6'))(_0x4313('0x7'));config['redis']=_[_0x4313('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4313('0x9'))(new Redis(config[_0x4313('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x4313('0xb')](_0x4313('0xc'));var tempTableName=_0x4313('0xd')+moment()[_0x4313('0xb')](_0x4313('0xe'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x333913){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))*$/[_0x4313('0xf')](_0x333913);}function selectNotIn(_0x49e6c0,_0x3dfa75,_0x11329a,_0x7d6c8,_0x523cea){return squel[_0x4313('0x10')]()[_0x4313('0x11')](_0x4313('0x12'))[_0x4313('0x13')](_0x7d6c8)[_0x4313('0x14')](_0x3dfa75,null,_0x3dfa75+_0x4313('0x15')+_0x7d6c8+'.'+_0x11329a)[_0x4313('0x16')](_0x7d6c8+'.'+_0x11329a+_0x4313('0x17')+_0x49e6c0+'.'+_0x11329a)[_0x4313('0x16')](_0x3dfa75+_0x4313('0x18')+_0x523cea[_0x4313('0x14')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x2ca18f,_0x176aac){promisesAdditionalPhones=[];promisesContact=[];return db[_0x4313('0x19')][_0x4313('0x1a')](_0x4313('0x1b')+tempTableName)[_0x4313('0x1c')](function(_0x3750c7){if(_0x3750c7!==null){var _0x4826d5=[];for(var _0x3eaf4a=0x0;_0x3eaf4a<_0x3750c7[_0x4313('0x1d')];_0x3eaf4a++){var _0x5c37e9=_0x3750c7[_0x3eaf4a];if(!_[_0x4313('0x1e')](_0x5c37e9['phone'])){if(!_[_0x4313('0x1e')](_0x5c37e9[_0x4313('0x1f')]))_0x4826d5[_0x4313('0x20')](insertAdditionalPhones(_0x5c37e9));promisesContact[_0x4313('0x20')]({'contact':_0x5c37e9});}}}Promise[_0x4313('0x21')](_0x4826d5)[_0x4313('0x22')](function(){_0x2ca18f({'val':0x1});});})[_0x4313('0x23')](function(_0x20d36a){logger['error'](_0x20d36a[_0x4313('0x24')]);});});}function insertAdditionalPhones(_0x18a981){return new Promise(function(_0x2ecec2,_0x57706c){var _0xff5a30=_0x18a981['AdditionalPhones'];if(_[_0x4313('0x1e')](_0xff5a30))_0x57706c({'val':0x0});else{var _0x5eedd8=_0xff5a30[_0x4313('0x25')](';');var _0x5e21f6=[];orderBy=0x0;for(var _0x926b7f=0x0;_0x926b7f<_0x5eedd8['length'];_0x926b7f++){_0x5e21f6[_0x4313('0x20')](splitAdditionalPhone(_0x18a981['id'],_0x5eedd8[_0x926b7f]));}Promise[_0x4313('0x21')](_0x5e21f6)[_0x4313('0x22')](function(){_0x2ecec2({'val':_0x5eedd8[_0x4313('0x1d')]});});}});}function splitAdditionalPhone(_0x47ffc7,_0x29c151){return new Promise(function(_0x5782bf,_0x28ed3b){var _0x451d9a=_0x29c151[_0x4313('0x25')](':');var _0x5e4730=_0x451d9a[0x0];var _0x2a1b10=_0x451d9a[0x1];if(_0x2a1b10!==''){var _0x29209e=_0x2a1b10[_0x4313('0x25')]('|');var _0x192211=[];for(var _0x7bfba3=0x0;_0x7bfba3<_0x29209e[_0x4313('0x1d')];_0x7bfba3++){if(_0x29209e[_0x7bfba3]!==''){var _0x4739f1=_[_0x4313('0x26')](promisesAdditionalPhones,{'contactId':_0x47ffc7,'phone':_0x29209e[_0x7bfba3]});if(_0x4739f1['length']==0x0){orderBy++;promisesAdditionalPhones[_0x4313('0x20')]({'contactId':_0x47ffc7,'contactTypeId':_0x5e4730,'phone':_0x29209e[_0x7bfba3],'orderBy':orderBy});}}}_0x5782bf({'ok':0x1});}else _0x5782bf({'res':0x0});});}function createAdditionalPhone(_0x10b3f9,_0x21b235,_0x180b46,_0x4fd186){var _0x5cf20f='';var _0x3376b4='';var _0xe69494=_0x180b46['split']('§');_0x5cf20f=_0xe69494[0x0];if(_0xe69494[_0x4313('0x1d')]==0x2)_0x3376b4=_0xe69494[0x1];return new Promise(function(_0x5ed99b,_0x31f8d8){return db[_0x4313('0x27')][_0x4313('0x28')]({'where':{'CmContactId':_0x10b3f9,'item':_0x5cf20f}})[_0x4313('0x22')](function(_0x2d1bef){if(_0x2d1bef){return db['CmContactHasItem'][_0x4313('0x29')]({'ItemTypeId':_0x21b235,'description':_0x3376b4,'OrderBy':_0x4fd186},{'where':{'CmContactId':_0x10b3f9,'item':_0x5cf20f}})[_0x4313('0x22')](function(_0x21d15f){_0x5ed99b({'res':'updated'});});}else{return db['CmContactHasItem'][_0x4313('0x2a')]({'CmContactId':_0x10b3f9,'item':_0x5cf20f,'ItemTypeId':_0x21b235,'description':_0x3376b4,'OrderBy':_0x4fd186,'ItemClass':_0x4313('0x2b')})[_0x4313('0x22')](function(_0x179ec9){_0x5ed99b({'res':'inserted'});});}});});}function updateContact(_0xeea6a3){return new Promise(function(_0x844a6,_0x224f5c){var _0xf9e0f7=_0xeea6a3['id'];delete _0xeea6a3['id'];return db[_0x4313('0x2c')][_0x4313('0x29')](_0xeea6a3,{'where':{'id':_0xf9e0f7}})[_0x4313('0x22')](function(_0xee20b8){updatedRows+=0x1;return db['CmHopper'][_0x4313('0x29')]({'phone':_0xeea6a3[_0x4313('0x12')]},{'where':{'ContactId':_0xf9e0f7}})[_0x4313('0x22')](function(_0x2b88b9){_0x844a6({'ret':'OK'});});});});}function insertCmHopper(_0x4f4070,_0x376118,_0x3401bd,_0x4a64ad,_0x340eee){var _0x2296a3=['cm_contacts.phone',_0x4313('0x2d'),'cm_contacts.id','cm_contacts.ListId',_0x376118+'.'+_0x4a64ad,_0x4313('0x2e'),_0x4313('0x2f'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x340eee+'\x22'];return squel['insert']()['into']('cm_hopper')[_0x4313('0x30')]([_0x4313('0x12'),'scheduledat',_0x4313('0x31'),_0x4313('0x32'),_0x4a64ad,_0x4313('0x33'),_0x4313('0x34'),_0x4313('0x35'),_0x4313('0x36'),_0x4313('0x37')],squel[_0x4313('0x10')]()[_0x4313('0x38')](_0x2296a3)[_0x4313('0x13')](_0x376118)[_0x4313('0x14')](_0x4313('0x39'),null,_0x4313('0x3a')+_0x376118+_0x4313('0x3b'))[_0x4313('0x14')](_0x3401bd,null,_0x3401bd+'.id\x20=\x20'+_0x376118+'.'+_0x4a64ad)[_0x4313('0x16')](_0x376118+_0x4313('0x3c'),_0x4f4070)[_0x4313('0x16')](_0x4313('0x3d'),NOW)[_0x4313('0x16')](_0x4313('0x3e'),selectNotIn(_0x376118,_0x3401bd,_0x4a64ad,'cm_hopper',[_0x4313('0x3f'),_0x4313('0x40')]))[_0x4313('0x16')](_0x4313('0x3e'),selectNotIn(_0x376118,_0x3401bd,_0x4a64ad,_0x4313('0x41'),[_0x4313('0x3f')])))['toString']();}function insertCmHopperBlack(_0x1e29b5,_0x47f3a8,_0x42c3cb,_0x28902f){var _0x4d59d3=['cm_contacts.phone','cm_contacts.id',_0x4313('0x42'),_0x47f3a8+'.'+_0x28902f,_0x4313('0x2e'),_0x4313('0x2f')];return squel[_0x4313('0x43')]()['into']('cm_hopper_black')['fromQuery'](['phone',_0x4313('0x31'),'ListId',_0x28902f,_0x4313('0x33'),'updatedAt'],squel[_0x4313('0x10')]()[_0x4313('0x38')](_0x4d59d3)[_0x4313('0x13')](_0x47f3a8)[_0x4313('0x14')](_0x4313('0x39'),null,_0x4313('0x3a')+_0x47f3a8+_0x4313('0x3b'))[_0x4313('0x14')](_0x42c3cb,null,_0x42c3cb+'.id\x20=\x20'+_0x47f3a8+'.'+_0x28902f)['where'](_0x47f3a8+_0x4313('0x3c'),_0x1e29b5)[_0x4313('0x16')](_0x4313('0x3d'),NOW)[_0x4313('0x16')](_0x4313('0x3e'),squel[_0x4313('0x10')]()[_0x4313('0x11')]('phone')[_0x4313('0x13')](_0x4313('0x44'))[_0x4313('0x16')](_0x4313('0x45'),_0x1e29b5)[_0x4313('0x16')](_0x28902f+_0x4313('0x46'),_0x47f3a8+'.'+_0x28902f)))['toString']();}function insertCmHopperAdditionalPhones(_0x5c6e83){var _0x16bec5=['cm_hopper.id',_0x4313('0x47'),_0x4313('0x48'),'cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt'];return squel[_0x4313('0x43')]()[_0x4313('0x49')]('cm_hopper_additional_phones')[_0x4313('0x30')]([_0x4313('0x4a'),_0x4313('0x12'),_0x4313('0x4b'),_0x4313('0x33'),_0x4313('0x34')],squel[_0x4313('0x10')]()[_0x4313('0x38')](_0x16bec5)[_0x4313('0x13')]('cm_hopper')[_0x4313('0x14')](_0x4313('0x39'),null,_0x4313('0x4c'))[_0x4313('0x14')](_0x4313('0x4d'),null,_0x4313('0x4e'))[_0x4313('0x16')](_0x4313('0x4f'),_0x5c6e83)['where']('cm_contacts.createdAt\x20=\x20?',NOW))[_0x4313('0x50')]();}function insertCmContact(_0x1003ed,_0x2d81ea,_0x4e7c73,_0xbaa949){var _0x20a804=_[_0x4313('0x51')](_['keys'](_0xbaa949),[_0x4313('0x32'),_0x4313('0x52'),_0x4313('0x33'),_0x4313('0x34')]);return squel[_0x4313('0x43')]()[_0x4313('0x49')](_0x4313('0x39'))[_0x4313('0x30')](_0x20a804,squel[_0x4313('0x10')]()[_0x4313('0x38')](_0x20a804)[_0x4313('0x13')](_0x2d81ea)[_0x4313('0x16')]('('+_0x4e7c73[_0x4313('0x14')](',')+_0x4313('0x53'),squel['select']()[_0x4313('0x38')](_0x4e7c73)[_0x4313('0x13')]('cm_contacts')[_0x4313('0x16')](_0x4313('0x45'),_0x1003ed))[_0x4313('0x16')](_0x4313('0x54'),squel['select']()[_0x4313('0x11')]('MIN(id)',_0x4313('0x55'))[_0x4313('0x13')](_0x2d81ea)['group'](_0x4e7c73['join'](','))))[_0x4313('0x50')]();}function handleStop(){logger[_0x4313('0x56')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x373c72){logger[_0x4313('0x57')](_0x373c72[_0x4313('0x24')]);process[_0x4313('0x58')](0x1);}function handleError(_0x209eb5,_0xa287e0){stats[_0x4313('0x59')][_0x4313('0x20')]({'name':_0xa287e0['code'],'message':_0xa287e0[_0x4313('0x24')],'row':_0x209eb5});}function handleQuery(_0x177b65){logger[_0x4313('0x56')](_0x177b65);return db[_0x4313('0x19')][_0x4313('0x1a')](_0x177b65)[_0x4313('0x1c')](function(_0x3a67dd){results['push'](_0x3a67dd);})[_0x4313('0x23')](function(_0x500479){logger[_0x4313('0x57')](_0x500479[_0x4313('0x24')]);});}function main(_0x4f0bd2,_0x592392,_0x35c26e,_0x4ac2df){logger[_0x4313('0x56')](_0x4313('0x5a'),_0x4f0bd2,JSON[_0x4313('0x5b')](_0x592392));process[_0x4313('0x5c')](_0x4313('0x5d'));var _0x2b9cd7=_0x592392['binding'];var _0x4f344d=_[_0x4313('0x5e')](_0x2b9cd7);var _0x2585b9=_0x592392['socket_timestamp'];var _0x3ea44e=path['join'](config[_0x4313('0x5f')],_0x4313('0x60'),_0x2585b9+'.csv');logger[_0x4313('0x56')](_0x4313('0x61'),_0x592392);db[_0x4313('0x62')][_0x4313('0x63')]({'raw':!![],'attributes':['id','name']})[_0x4313('0x22')](function(_0x475352){for(var _0x805bec=0x0;_0x805bec<_0x475352[_0x4313('0x1d')];_0x805bec++){if(_0x475352[_0x805bec][_0x4313('0x64')]in _0x2b9cd7){contactItemTypes[_0x4313('0x20')](_0x475352[_0x805bec]);delete _0x4f344d[_0x475352[_0x805bec][_0x4313('0x64')]];hasAdditionalPhones=!![];}for(var _0xea8c32 in _0x2b9cd7){if(_0x475352[_0x805bec][_0x4313('0x64')]+_0x4313('0x65')===_0xea8c32){phoneDescriptions[_0x4313('0x20')]({'itemTypeId':_0x475352[_0x805bec]['id'],'description':_0xea8c32});delete _0x4f344d[_0xea8c32];}}}if(hasAdditionalPhones)_0x4f344d[_0x4313('0x1f')]='';var _0x50bcb6=_['keys'](_0x4f344d)[_0x4313('0x14')]();logger[_0x4313('0x56')]('header',_0x50bcb6);fs[_0x4313('0x66')](_0x3ea44e,_0x50bcb6+'\x0a');Papa[_0x4313('0x67')](fs[_0x4313('0x68')](_0x4f0bd2),{'header':!![],'skipEmptyLines':!![],'step':function(_0x351871,_0x3e33e4){try{for(var _0x5cad0e=0x0,_0x1d5623=[];_0x5cad0e<_0x351871[_0x4313('0x69')][_0x4313('0x1d')];_0x5cad0e++){stats[_0x4313('0x6a')]+=0x1;if(_0x351871[_0x4313('0x59')][_0x5cad0e]){handleError(_0x351871[_0x4313('0x69')][_0x5cad0e],_0x351871[_0x4313('0x59')][_0x5cad0e]);}else{var _0x38e711=[];var _0x27c7e2=[];var _0x4dd156={};for(var _0x34a4e5 in _0x2b9cd7){let _0x59bf76=contactItemTypes['find'](_0x41c123=>_0x41c123['name']===_0x34a4e5);let _0x3ddbcf=contactItemTypes[_0x4313('0x6b')](_0x26044f=>_0x26044f['name']+'_description'===_0x34a4e5);if(_[_0x4313('0x1e')](_0x59bf76)&&_[_0x4313('0x1e')](_0x3ddbcf)){if(_0x2b9cd7[_0x4313('0x6c')](_0x34a4e5)){if(_0x351871[_0x4313('0x69')][_0x5cad0e][_0x2b9cd7[_0x34a4e5]]){var _0x3c1402=_['trim'](_0x351871[_0x4313('0x69')][_0x5cad0e][_0x2b9cd7[_0x34a4e5]][_0x4313('0x6d')](/"/g,'\x27'));switch(_0x34a4e5){case'scheduledat':var _0x5565a1=moment(_0x3c1402,_0x4313('0xc'),!![]);if(_0x5565a1[_0x4313('0x6e')]()){_0x1d5623[_0x4313('0x20')]('\x22'+_0x3c1402+'\x22');}else{_0x38e711[_0x4313('0x20')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x4313('0x35'):var _0xe01b2d=parseInt(_0x3c1402);_0x3c1402=_[_0x4313('0x6f')](_0xe01b2d)||_0xe01b2d<0x0||_0xe01b2d>0x4?_0x4ac2df?0x3:0x2:_0xe01b2d;_0x1d5623[_0x4313('0x20')]('\x22'+_0x3c1402+'\x22');break;case _0x4313('0x36'):var _0xdddcf8=parseInt(_0x3c1402);if(_[_0x4313('0x70')](_0xdddcf8)&&_['includes'](_0x35c26e,_0xdddcf8)){_0x1d5623[_0x4313('0x20')]('\x22'+_0xdddcf8+'\x22');}else{_0x38e711['push']('agent\x20not\x20exists');}break;case _0x4313('0x71'):if(isEmail(_0x3c1402)){_0x1d5623['push']('\x22'+_0x3c1402+'\x22');}else{_0x38e711['push'](_0x4313('0x72'));}break;case _0x4313('0x73'):var _0x2aa3af=moment(_0x3c1402,_0x4313('0x74'),!![]);if(_0x2aa3af['isValid']()){_0x1d5623['push']('\x22'+_0x3c1402+'\x22');}else{_0x38e711['push'](_0x4313('0x75'));}break;default:_0x1d5623['push']('\x22'+_0x3c1402+'\x22');}}else{switch(_0x34a4e5){case'firstName':case'phone':_0x38e711['push'](_0x34a4e5+'\x20not\x20specified');break;default:_0x1d5623[_0x4313('0x20')]('\x22\x22');}}}}else{var _0xe74264='';if(!_['isNil'](_0x59bf76)){if(!_0x4dd156['hasOwnProperty'](_0x59bf76['id'])){for(var _0xf5de2=0x0;_0xf5de2<_0x2b9cd7[_0x34a4e5][_0x4313('0x1d')];_0xf5de2++){var _0x3c1402=_[_0x4313('0x76')](_0x351871['data'][_0x5cad0e][_0x2b9cd7[_0x34a4e5][_0xf5de2]][_0x4313('0x6d')](/"/g,'\x27'));var _0x465fd4=phoneDescriptions[_0x4313('0x6b')](_0x2b6e0d=>_0x2b6e0d['itemTypeId']===_0x59bf76['id']);if(!_['isNil'](_0x465fd4)){var _0x12a816=_[_0x4313('0x76')](_0x351871[_0x4313('0x69')][_0x5cad0e][_0x2b9cd7[_0x465fd4[_0x4313('0x77')]][0x0]][_0x4313('0x6d')](/"/g,'\x27'));if(!_[_0x4313('0x1e')](_0x12a816))_0x3c1402=_0x3c1402+'§'+_0x12a816;}if(_0xe74264=='')_0xe74264=_0x3c1402;else _0xe74264+='|'+_0x3c1402;}_0x27c7e2['push'](_0x59bf76['id']+':'+_0xe74264);_0x4dd156[_0x59bf76['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1d5623['push']('\x22'+_0x27c7e2[_0x4313('0x14')](';')+'\x22');}if(_0x38e711['length']){handleError(_0x351871[_0x4313('0x69')][_0x5cad0e],{'code':'SystemRow','message':_0x38e711[_0x4313('0x14')]()});}else{fs[_0x4313('0x78')](_0x3ea44e,_0x1d5623[_0x4313('0x14')]()+'\x0a');}_0x1d5623=[];}if(!(stats[_0x4313('0x6a')]%0xc8)){socket[_0x4313('0x79')](_0x4313('0x7a')+_0x2585b9,stats);stats[_0x4313('0x59')]=[];}}if(stopped){logger['info']('Abort\x20parser');_0x3e33e4[_0x4313('0x7b')]();}}catch(_0x1308af){handleError(_0x351871['data'][_0x5cad0e],{'code':'SystemError','message':_0x1308af[_0x4313('0x24')]});logger[_0x4313('0x57')](_0x4313('0x7c'),_0x1308af[_0x4313('0x24')]);}},'complete':function(){try{var _0x3404d6=[];var _0x1ecd6a=tempTableName;_0x3404d6[_0x4313('0x20')](_0x4313('0x7d')+_0x1ecd6a+_0x4313('0x7e'));logger[_0x4313('0x56')](_0x4313('0x7f'),contactItemTypes[_0x4313('0x1d')]);var _0x19121e=util['format'](_0x4313('0x80'),_0x3ea44e,_0x1ecd6a,_0x50bcb6,_0x592392['ListId'],_0x592392[_0x4313('0x52')]||null,NOW,NOW);if(_[_0x4313('0x1e')](_0x2b9cd7['scheduledat'])){_0x19121e+=_0x4313('0x81');}_0x3404d6[_0x4313('0x20')](_0x19121e);BPromise[_0x4313('0x82')](_0x3404d6,handleQuery)['then'](function(_0x313ab6){BPromise[_0x4313('0x21')]([handleAdditionalPhones()])[_0x4313('0x22')](function(){_0x3404d6=[];for(var _0x3118a0=0x0;_0x3118a00x0){_0x540f0e[_0xacc2('0x16')](_0xacc2('0x11')+_0x223288+_0xacc2('0x17'),_[_0xacc2('0x18')](_0x5447c2,'id'));}return _0x540f0e;}function getInteractionsQuery(_0x11e4d8){var _0x2313eb=utils[_0xacc2('0x19')](_0x11e4d8);var _0x5942ad=utils[_0xacc2('0x6')](_0x11e4d8);var _0x38aeae=utils[_0xacc2('0xd')](_0x11e4d8);return squel['select']()[_0xacc2('0x12')](_0x2313eb[_0xacc2('0x1a')],'i')['left_join'](_0xacc2('0x1b'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xacc2('0x1c')](_0xacc2('0x13'),'o',_0xacc2('0x1d'))[_0xacc2('0x1c')](_0x2313eb[_0xacc2('0x1e')],'a','a.id\x20=\x20i.'+_0x5942ad)[_0xacc2('0x1c')](_0x2313eb[_0xacc2('0x1f')],'me','me.'+_0x38aeae+_0xacc2('0x20'))[_0xacc2('0x1c')](_0x2313eb['interactionsTags'],'it',_0xacc2('0x21')+_0x38aeae+_0xacc2('0x20'))['left_join'](_0xacc2('0xc'),'t',_0xacc2('0x22'));}function getSqlClauses(){var _0xe66f3={'body':squel[_0xacc2('0x23')](),'contact':squel[_0xacc2('0x23')](),'default':squel['expr'](),'fields':squel[_0xacc2('0x23')](),'filter':squel[_0xacc2('0x23')](),'read':squel['expr'](),'tags':{'clause':squel[_0xacc2('0x23')](),'ids':null},'user':squel[_0xacc2('0x23')]()};return _0xe66f3;}function parseTagParameter(_0x49ab73){var _0x17949d=squel[_0xacc2('0x23')]();if(_0x49ab73){var _0x56ec6d=utils[_0xacc2('0x24')](_0x49ab73);_0x56ec6d[_0xacc2('0x25')](function(_0x268c06){_0x17949d['or'](_0xacc2('0x26'),'%,'+_0x268c06+',%');});}return _0x17949d;}function parseReadParameter(_0x554587){var _0x2da3e6='';if(_0x554587){_0x2da3e6=_0xacc2('0x27');if(_0x554587==='1'){_0x2da3e6=_0x2da3e6[_0xacc2('0x28')]('{OPERATOR}','=');}else{_0x2da3e6=_0x2da3e6[_0xacc2('0x28')]('{OPERATOR}','>');}}return _0x2da3e6;}function parseSearchFilter(_0x19a6a8,_0x4ceab8){var _0x1ca6ed=squel[_0xacc2('0x23')]();if(_0x4ceab8){var _0x4ee33d=_0x4ceab8['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xacc2('0x29')](_0x4ee33d)){_0x1ca6ed['or'](_0xacc2('0x2a'),_0x4ee33d+'%');switch(_0x19a6a8){case _0xacc2('0x2b'):case'whatsapp':_0x1ca6ed['or'](_0xacc2('0x2c'),_0x4ee33d+'%');break;case _0xacc2('0x2d'):_0x1ca6ed['or']('i.fax\x20LIKE\x20?',_0x4ee33d+'%');break;case _0xacc2('0x2e'):_0x1ca6ed['or'](_0xacc2('0x2f'),_0x4ee33d+'%');break;case _0xacc2('0x30'):_0x1ca6ed['or'](_0xacc2('0x31'),qs[_0xacc2('0x32')](_0x4ee33d,!![]))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xacc2('0x32')](_0x4ee33d));break;}}else if(_0x19a6a8===_0xacc2('0x30')&&qs['isEmail'](_0x4ee33d)){_0x1ca6ed['or']('c.email\x20LIKE\x20?',_0x4ee33d+'%');}else{if(_0x19a6a8==='mail'){_0x1ca6ed['or'](_0xacc2('0x31'),qs['getFullTextValue'](_0x4ee33d,!![]))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xacc2('0x32')](_0x4ee33d));}else if(_0x19a6a8!=='fax'){_0x1ca6ed['or'](_0xacc2('0x33'),qs['getFullTextValue'](_0x4ee33d));}_0x1ca6ed['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x4ee33d,!![]),null);}}return _0x1ca6ed;}function parseAdvancedSearchFilter(_0x5f5c98,_0x2dce73){var _0x15bcb1=getSqlClauses();var _0xc25043=as[_0xacc2('0x34')](_0x5f5c98);var _0x3186cd=_0xc25043[_0xacc2('0x35')];for(var _0x45ce09=0x0;_0x45ce09<_0xc25043[_0xacc2('0x36')][_0xacc2('0x15')];_0x45ce09++){var _0x5b12e3=_0xc25043[_0xacc2('0x36')][_0x45ce09];var _0xce3056='i';var _0x3dc436=_['find'](_0x2dce73,[_0xacc2('0xa'),_0x5b12e3[_0xacc2('0x9')]]);if(_0x3dc436){var _0x5d5454=as[_0xacc2('0x37')](_0xce3056,_0x3dc436[_0xacc2('0x38')],_0x5b12e3);_0x15bcb1[_0xacc2('0x39')][_0x3186cd](_0x5d5454[_0xacc2('0x3a')],_0x5d5454['value'][_0xacc2('0x3b')],_0x5d5454[_0xacc2('0x3c')][_0xacc2('0x3d')]);}else{switch(_0x5b12e3[_0xacc2('0x9')]){case _0xacc2('0x3e'):var _0x23ecb6=parseReadParameter(_0x5b12e3[_0xacc2('0x3c')]);_0x15bcb1[_0xacc2('0x3f')][_0xacc2('0x40')](_0x23ecb6);break;case _0xacc2('0x41'):if(_0x5b12e3['operator']===_0xacc2('0x42')){if(_0x5b12e3['value'][_0xacc2('0x43')]('\x20')['length']>0x1){_0x15bcb1[_0xacc2('0x44')][_0x3186cd](_0xacc2('0x45'),qs['getFullTextValue'](_0x5b12e3['value'],!![]),null);}else{var _0x4dcf50='%'+_0x5b12e3['value']+'%';_0x15bcb1[_0xacc2('0x44')][_0x3186cd]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x4dcf50,_0x4dcf50,_0x4dcf50);}}else{_0x3dc436=_[_0xacc2('0x46')](_0x2dce73,['name','ContactId']);_0x5b12e3[_0xacc2('0x9')]='ContactId';_0x5d5454=as[_0xacc2('0x37')](_0xce3056,_0x3dc436[_0xacc2('0x38')],_0x5b12e3);_0x15bcb1[_0xacc2('0x44')][_0x3186cd](_0x5d5454['text'],_0x5d5454['value'][_0xacc2('0x3b')],_0x5d5454['value'][_0xacc2('0x3d')]);}break;case _0xacc2('0x47'):var _0x367c96=_0x5b12e3['value'][_0xacc2('0x43')](',')[_0xacc2('0x18')](function(_0xacc6b5){return Number(_0xacc6b5);});var _0x5ce88d=parseTagParameter(_0x367c96);_0x15bcb1[_0xacc2('0x48')][_0xacc2('0x49')][_0xacc2('0x40')](_0x5ce88d);_0x15bcb1[_0xacc2('0x48')][_0xacc2('0x4a')]=_0x367c96;break;case _0xacc2('0x4b'):if(_0x5b12e3[_0xacc2('0x4c')]==='$substring'){_0x15bcb1['user'][_0x3186cd](_0xacc2('0x4d'),'%'+_0x5b12e3[_0xacc2('0x3c')]+'%',null);}else{_0x3dc436=_[_0xacc2('0x46')](_0x2dce73,[_0xacc2('0xa'),_0xacc2('0x4e')]);_0x5b12e3[_0xacc2('0x9')]=_0xacc2('0x4e');_0x5d5454=as[_0xacc2('0x37')](_0xce3056,_0x3dc436['type'],_0x5b12e3);_0x15bcb1[_0xacc2('0x4f')][_0x3186cd](_0x5d5454['text'],_0x5d5454[_0xacc2('0x3c')][_0xacc2('0x3b')],_0x5d5454[_0xacc2('0x3c')]['end']);}break;case _0xacc2('0x50'):case _0xacc2('0x51'):_0x5d5454=as[_0xacc2('0x37')]('me',null,_0x5b12e3);_0x15bcb1[_0xacc2('0x50')][_0x3186cd](_0x5d5454[_0xacc2('0x3a')],_0x5d5454[_0xacc2('0x3c')]['start'],_0x5d5454[_0xacc2('0x3c')][_0xacc2('0x3d')]);break;}}}return _0x15bcb1;}function parseModelFields(_0x2c1633,_0x202a23,_0x47351d){var _0x427abe=utils['getAccountFK'](_0x2c1633);var _0x2e8f5f=squel['expr']();var _0x1a3496=_(_0x202a23)[_0xacc2('0x52')]()['map'](function(_0x506634){return _[_0xacc2('0x53')](_0x47351d,[_0xacc2('0xa'),_0x506634])?_0x506634:undefined;})[_0xacc2('0x54')]()[_0xacc2('0x3c')]();if(_0x1a3496['length']>0x0){_0x1a3496[_0xacc2('0x25')](function(_0x480571){if(_0x480571===_0x427abe){_0x2e8f5f[_0xacc2('0x40')]('i.'+_0x427abe+'\x20IN\x20?',[]['concat'](_0x202a23[_0x480571]));}else if(_0x480571===_0xacc2('0x55')){var _0x5f1a74=JSON[_0xacc2('0x56')](_0x202a23[_0x480571])[_0xacc2('0x57')];var _0x5eee93=JSON[_0xacc2('0x56')](_0x202a23[_0x480571])[_0xacc2('0x58')];_0x2e8f5f['and']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5f1a74,_0x5eee93);}else{if(_0x202a23[_0x480571]==='null'){_0x2e8f5f[_0xacc2('0x40')]('i.'+_0x480571+_0xacc2('0x59'));}else{_0x2e8f5f[_0xacc2('0x40')]('i.'+_0x480571+'\x20=\x20?',_0x202a23[_0x480571]);}}});}return _0x2e8f5f;}function parseQueryParameters(_0x1e5257,_0xfbe5ba,_0x2d4191){var _0x53ceb6=getSqlClauses();return Promise[_0xacc2('0x5a')]()['then'](function(){return parseModelFields(_0x1e5257,_0xfbe5ba,_0x2d4191);})[_0xacc2('0x5b')](function(_0x231c75){_0x53ceb6[_0xacc2('0x5c')]['and'](_0x231c75);return parseReadParameter(_0xfbe5ba[_0xacc2('0x3f')]);})[_0xacc2('0x5b')](function(_0x27c957){_0x53ceb6['read'][_0xacc2('0x40')](_0x27c957);return parseTagParameter(_0xfbe5ba[_0xacc2('0x5d')]);})['then'](function(_0x50533d){_0x53ceb6['tags']['clause'][_0xacc2('0x40')](_0x50533d);return parseSearchFilter(_0x1e5257,_0xfbe5ba[_0xacc2('0x5e')]);})[_0xacc2('0x5b')](function(_0x2c1e5a){_0x53ceb6['filter']=_0x2c1e5a;return _0x53ceb6;});}function checkAccountsRestrictions(_0x51a1e6,_0x27a048,_0x22c11e){var _0x5f0d6f=utils['getAccountFK'](_0x51a1e6);var _0x3d77ec='get'+_[_0xacc2('0x5f')](_0x51a1e6)+(_0x51a1e6===_0xacc2('0x60')?_0xacc2('0x61'):_0xacc2('0x62'));var _0x2c41fd=squel['expr']();return Promise['resolve']()[_0xacc2('0x5b')](function(){if(_0x22c11e[_0xacc2('0x63')]&&_0x27a048[_0xacc2('0x64')]==='agent'){return _0x27a048[_0x3d77ec]({'attributes':['id'],'raw':!![]});}})[_0xacc2('0x5b')](function(_0x439e17){if(_0x439e17){if(_0x439e17['length']===0x0){_0x2c41fd[_0xacc2('0x40')]('i.'+_0x5f0d6f+_0xacc2('0x59'));}else{_0x2c41fd[_0xacc2('0x40')]('i.'+_0x5f0d6f+'\x20IN\x20?',_[_0xacc2('0x18')](_0x439e17,'id'));}}else if(!_0x22c11e[_0x5f0d6f]){_0x2c41fd[_0xacc2('0x40')]('i.'+_0x5f0d6f+_0xacc2('0x65'));}})['then'](function(){return _0x2c41fd;});}function getClosedOrderClause(_0x43fb43,_0x4461a0){var _0x3f875b='';var _0x53c20e=[_0xacc2('0x66'),_0xacc2('0x67'),_0xacc2('0x68')];if(_0x43fb43===_0xacc2('0x30')){_0x53c20e[_0xacc2('0x69')](_0xacc2('0x6a'));}if(_0x4461a0[_0xacc2('0x6b')]==='0'&&_0x43fb43===_0xacc2('0x30')){_0x3f875b=_0xacc2('0x6a');}else{if(_0x4461a0[_0xacc2('0x6b')]==='1'){_0x53c20e[_0xacc2('0x6c')]();}_0x3f875b=_0xacc2('0x6d')+_0x53c20e['join'](',\x20')+')';}return _0x3f875b;}function getFilteredInteractions(_0x4dbbcf,_0x3c6e8,_0x4f4436,_0x4d021b){var _0x71cccc=utils[_0xacc2('0xd')](_0x4dbbcf);var _0x326263=_[_0xacc2('0x5f')](_0x4dbbcf)+'Interaction';var _0x4f94e4=[];var _0x195447=getTagsQuery();var _0x227da4={'type':db[_0xacc2('0x6e')][_0xacc2('0x6f')]['SELECT'],'raw':!![]};var _0x1ea802=[];var _0x2411bc=[];return db[_0xacc2('0x70')][_0xacc2('0x71')](_0x195447[_0xacc2('0x72')](),_0x227da4)[_0xacc2('0x5b')](function(_0x444f8f){_0x4f94e4=_[_0xacc2('0x73')](_0x444f8f,'id');_0x227da4=_['merge'](_0x227da4,{'model':db[_0x326263],'mapToModel':!![],'nest':!![]});if(_0x4f4436[_0xacc2('0x5c')]){_0x4d021b['attributes']['forEach'](function(_0x5ce314){_0x3c6e8[_0xacc2('0x9')]('i.'+_0x5ce314);});}else{_0x3c6e8[_0xacc2('0x9')](_0xacc2('0x74'),_0xacc2('0x3e'));_0x3c6e8[_0xacc2('0x9')](_0xacc2('0x75'),_0xacc2('0x76'));_0x3c6e8[_0xacc2('0x9')](_0xacc2('0x77'),'Account.mandatoryDisposition');if(_0x4dbbcf==='mail'){_0x3c6e8[_0xacc2('0x9')](_0xacc2('0x78'),'Account.email');_0x3c6e8[_0xacc2('0x9')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xacc2('0x79'));_0x3c6e8[_0xacc2('0x9')](_0xacc2('0x7a'));_0x3c6e8[_0xacc2('0x9')](_0xacc2('0x7b'));_0x3c6e8[_0xacc2('0x9')](_0xacc2('0x7c'));_0x3c6e8[_0xacc2('0x9')](_0xacc2('0x7d'));_0x3c6e8[_0xacc2('0x9')](_0xacc2('0x7e'));_0x3c6e8[_0xacc2('0x9')]('i.attach');_0x3c6e8['field'](_0xacc2('0x7f'));_0x3c6e8[_0xacc2('0x9')](_0xacc2('0x80'));_0x3c6e8['field'](_0xacc2('0x81'));_0x3c6e8['field'](_0xacc2('0x68'));_0x3c6e8['field']('i.secondDisposition');_0x3c6e8[_0xacc2('0x9')](_0xacc2('0x66'));_0x3c6e8['field'](_0xacc2('0x6a'));_0x3c6e8[_0xacc2('0x9')](_0xacc2('0x82'));_0x3c6e8['field'](_0xacc2('0x83'));_0x3c6e8[_0xacc2('0x9')](_0xacc2('0x84'));_0x3c6e8[_0xacc2('0x9')](_0xacc2('0x85'));}else if(_0x4dbbcf===_0xacc2('0x2e')){_0x3c6e8[_0xacc2('0x9')]('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');}else{_0x3c6e8[_0xacc2('0x9')]('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');}if(_0x4dbbcf!==_0xacc2('0x30')){_0x3c6e8[_0xacc2('0x9')]('i.*');}_0x3c6e8[_0xacc2('0x9')]('c.firstName',_0xacc2('0x86'));_0x3c6e8['field']('c.lastName',_0xacc2('0x87'));_0x3c6e8[_0xacc2('0x9')](_0xacc2('0x88'),_0xacc2('0x89'));_0x3c6e8[_0xacc2('0x9')]('c.phone','Contact.phone');_0x3c6e8['field']('c.mobile',_0xacc2('0x8a'));_0x3c6e8[_0xacc2('0x9')]('c.fax','Contact.fax');_0x3c6e8['field'](_0xacc2('0x8b'),_0xacc2('0x8c'));_0x3c6e8[_0xacc2('0x9')]('o.internal',_0xacc2('0x8d'));_0x3c6e8[_0xacc2('0x9')](_0xacc2('0x8e'),_0xacc2('0x8f'));}if(_0x4d021b[_0xacc2('0x90')]){_0x3c6e8['limit'](_0x4d021b[_0xacc2('0x90')]);}if(_0x4d021b[_0xacc2('0x91')]){_0x3c6e8[_0xacc2('0x91')](_0x4d021b['offset']);}return db['sequelize'][_0xacc2('0x71')](_0x3c6e8['toString'](),_0x227da4);})['then'](function(_0x39b94e){_0x1ea802=_0x39b94e;var _0x4b1d9f=getUsersQuery(_0x4dbbcf,_0x1ea802);return db[_0xacc2('0x70')][_0xacc2('0x71')](_0x4b1d9f[_0xacc2('0x72')](),_0x227da4);})[_0xacc2('0x5b')](function(_0x1596a0){_0x2411bc=_[_0xacc2('0x92')](_0x1596a0,_0x71cccc);if(_0x4dbbcf===_0xacc2('0x30')){return db[_0xacc2('0x93')][_0xacc2('0x94')]({'attributes':[_0xacc2('0x95')],'raw':!![]});}})[_0xacc2('0x5b')](function(_0x182330){var _0x2aad53=_0x182330?_0x182330['enableEmailPreview']:undefined;var _0x81ce2e=_0x1ea802[_0xacc2('0x18')](function(_0x445f31){return updateInteraction(_0x445f31,_0x4f94e4,_0x2411bc,_0x2aad53);});return Promise[_0xacc2('0x96')](_0x81ce2e);});}function countFilteredInteractions(_0x2025ad,_0x4bb66f){var _0xd8679b=_0x2025ad[_0xacc2('0x97')]();_0xd8679b[_0xacc2('0x9')]('COUNT(*)');_0xd8679b[_0xacc2('0x9')](_0xacc2('0x74'),'unreadMessages');var _0x159658=utils[_0xacc2('0x24')](_0x4bb66f);if(!_[_0xacc2('0x98')](_0x159658)){_0xd8679b[_0xacc2('0x16')](_0xacc2('0x99'),_0x159658);}var _0x2539d4={'type':db['Sequelize']['QueryTypes'][_0xacc2('0x9a')],'raw':!![]};return db[_0xacc2('0x70')][_0xacc2('0x71')](_0xd8679b[_0xacc2('0x72')](),_0x2539d4);}module[_0xacc2('0x9b')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0xbba6=['parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','resolve','then','read','tag','filter','get','capitalize','Websites','Accounts','role','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.disposition','unshift','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','Interaction','Sequelize','QueryTypes','SELECT','sequelize','query','toString','fields','attributes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','a.email','Account.email','contactName','i.id','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.secondDisposition','i.to','i.ContactId','i.MailAccountId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.mobile','c.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','groupBy','Setting','enableEmailPreview','clone','COUNT(*)','isEmpty','exports','lodash','../parsers/qs','./update-interaction','updateInteraction','./utils','agent','search','select','field','name','tools_tags','user_has_','_interactions','u.fullname','ui.','from','left_join','users','u.id\x20=\x20ui.UserId','\x20IN\x20?','map','getInteractionsTables','getAccountFK','getInteractionFK','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','it.','t.id\x20=\x20it.TagId','expr','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','sms','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','openchannel','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.email\x20LIKE\x20?','mail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','parseSearch','length','conditions','find','buildExpression','type','default','start','end','value','operator','$substring','split','contact','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','text','Tag','tags','clause','and','ids','User','user','UserId','body','plainBody','keys','some','compact'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xbba6,0xf4));var _0x6bba=function(_0x344cca,_0x523392){_0x344cca=_0x344cca-0x0;var _0x420a87=_0xbba6[_0x344cca];return _0x420a87;};'use strict';var _=require(_0x6bba('0x0'));var squel=require('squel');var as=require('../parsers/advancedSearch');var qs=require(_0x6bba('0x1'));var updateInteraction=require(_0x6bba('0x2'))[_0x6bba('0x3')];var utils=require(_0x6bba('0x4'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x47fc85,_0x22e4fb,_0x3a027c){var _0x23aac7=![];var _0x20f7f0=utils['getAccountFK'](_0x47fc85);if(_0x22e4fb['role']===_0x6bba('0x5')&&!_0x3a027c[_0x6bba('0x6')]&&!_0x3a027c[_0x20f7f0]){_0x23aac7=!![];}return _0x23aac7;}function getTagsQuery(){return squel[_0x6bba('0x7')]()[_0x6bba('0x8')]('id')['field'](_0x6bba('0x9'))[_0x6bba('0x8')]('color')['from'](_0x6bba('0xa'));}function getUsersQuery(_0x362feb,_0x40b190){var _0x3fe1c8=utils['getInteractionFK'](_0x362feb);var _0x2147e8=_0x6bba('0xb')+_0x362feb+_0x6bba('0xc');var _0x3761b7=squel['select']()['field']('u.id')[_0x6bba('0x8')](_0x6bba('0xd'))[_0x6bba('0x8')](_0x6bba('0xe')+_0x3fe1c8)[_0x6bba('0xf')](_0x2147e8,'ui')[_0x6bba('0x10')](_0x6bba('0x11'),'u',_0x6bba('0x12'));if(_0x40b190['length']>0x0){_0x3761b7['where'](_0x6bba('0xe')+_0x3fe1c8+_0x6bba('0x13'),_[_0x6bba('0x14')](_0x40b190,'id'));}return _0x3761b7;}function getInteractionsQuery(_0x4f4fb5){var _0x3f81fb=utils[_0x6bba('0x15')](_0x4f4fb5);var _0x58d621=utils[_0x6bba('0x16')](_0x4f4fb5);var _0x3f56be=utils[_0x6bba('0x17')](_0x4f4fb5);return squel[_0x6bba('0x7')]()[_0x6bba('0xf')](_0x3f81fb['interactions'],'i')[_0x6bba('0x10')](_0x6bba('0x18'),'c',_0x6bba('0x19'))['left_join']('users','o',_0x6bba('0x1a'))[_0x6bba('0x10')](_0x3f81fb['accounts'],'a',_0x6bba('0x1b')+_0x58d621)[_0x6bba('0x10')](_0x3f81fb[_0x6bba('0x1c')],'me',_0x6bba('0x1d')+_0x3f56be+_0x6bba('0x1e'))[_0x6bba('0x10')](_0x3f81fb[_0x6bba('0x1f')],'it',_0x6bba('0x20')+_0x3f56be+'\x20=\x20i.id')[_0x6bba('0x10')](_0x6bba('0xa'),'t',_0x6bba('0x21'));}function getSqlClauses(){var _0x1dc544={'body':squel['expr'](),'contact':squel[_0x6bba('0x22')](),'default':squel[_0x6bba('0x22')](),'fields':squel['expr'](),'filter':squel['expr'](),'read':squel[_0x6bba('0x22')](),'tags':{'clause':squel['expr'](),'ids':null},'user':squel[_0x6bba('0x22')]()};return _0x1dc544;}function parseTagParameter(_0x4e9c23){var _0x462aea=squel['expr']();if(_0x4e9c23){var _0x1e43d6=utils['getSelectedTags'](_0x4e9c23);_0x1e43d6[_0x6bba('0x23')](function(_0xe81f4d){_0x462aea['or'](_0x6bba('0x24'),'%,'+_0xe81f4d+',%');});}return _0x462aea;}function parseReadParameter(_0x1747ba){var _0xd00c84='';if(_0x1747ba){_0xd00c84='unreadMessages\x20{OPERATOR}\x200';if(_0x1747ba==='1'){_0xd00c84=_0xd00c84[_0x6bba('0x25')]('{OPERATOR}','=');}else{_0xd00c84=_0xd00c84['replace'](_0x6bba('0x26'),'>');}}return _0xd00c84;}function parseSearchFilter(_0x5093d4,_0x195173){var _0x5b86fe=squel[_0x6bba('0x22')]();if(_0x195173){var _0x326af6=_0x195173[_0x6bba('0x25')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x6bba('0x27')](_0x326af6)){_0x5b86fe['or'](_0x6bba('0x28'),_0x326af6+'%');switch(_0x5093d4){case _0x6bba('0x29'):case'whatsapp':_0x5b86fe['or'](_0x6bba('0x2a'),_0x326af6+'%');break;case _0x6bba('0x2b'):_0x5b86fe['or'](_0x6bba('0x2c'),_0x326af6+'%');break;case _0x6bba('0x2d'):_0x5b86fe['or']('i.from\x20LIKE\x20?',_0x326af6+'%');break;case'mail':_0x5b86fe['or'](_0x6bba('0x2e'),qs['getFullTextValue'](_0x326af6,!![]))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x6bba('0x2f')](_0x326af6));break;}}else if(_0x5093d4==='mail'&&qs['isEmail'](_0x326af6)){_0x5b86fe['or'](_0x6bba('0x30'),_0x326af6+'%');}else{if(_0x5093d4===_0x6bba('0x31')){_0x5b86fe['or'](_0x6bba('0x2e'),qs[_0x6bba('0x2f')](_0x326af6,!![]))['or'](_0x6bba('0x32'),qs['getFullTextValue'](_0x326af6));}else if(_0x5093d4!==_0x6bba('0x2b')){_0x5b86fe['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x6bba('0x2f')](_0x326af6));}_0x5b86fe['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x6bba('0x2f')](_0x326af6,!![]),null);}}return _0x5b86fe;}function parseAdvancedSearchFilter(_0x5c1251,_0x3fbd6e){var _0x2bcd3b=getSqlClauses();var _0xb2dbea=as[_0x6bba('0x33')](_0x5c1251);var _0x3466f5=_0xb2dbea['sqlOperator'];for(var _0x301cdd=0x0;_0x301cdd<_0xb2dbea['conditions'][_0x6bba('0x34')];_0x301cdd++){var _0x385971=_0xb2dbea[_0x6bba('0x35')][_0x301cdd];var _0x2337a8='i';var _0x4de6b3=_[_0x6bba('0x36')](_0x3fbd6e,['name',_0x385971[_0x6bba('0x8')]]);if(_0x4de6b3){var _0x25844f=as[_0x6bba('0x37')](_0x2337a8,_0x4de6b3[_0x6bba('0x38')],_0x385971);_0x2bcd3b[_0x6bba('0x39')][_0x3466f5](_0x25844f['text'],_0x25844f['value'][_0x6bba('0x3a')],_0x25844f['value'][_0x6bba('0x3b')]);}else{switch(_0x385971['field']){case'unreadMessages':var _0x29803d=parseReadParameter(_0x385971[_0x6bba('0x3c')]);_0x2bcd3b['read']['and'](_0x29803d);break;case'Contact':if(_0x385971[_0x6bba('0x3d')]===_0x6bba('0x3e')){if(_0x385971['value'][_0x6bba('0x3f')]('\x20')[_0x6bba('0x34')]>0x1){_0x2bcd3b[_0x6bba('0x40')][_0x3466f5](_0x6bba('0x41'),qs[_0x6bba('0x2f')](_0x385971[_0x6bba('0x3c')],!![]),null);}else{var _0x16e720='%'+_0x385971['value']+'%';_0x2bcd3b[_0x6bba('0x40')][_0x3466f5](_0x6bba('0x42'),_0x16e720,_0x16e720,_0x16e720);}}else{_0x4de6b3=_[_0x6bba('0x36')](_0x3fbd6e,[_0x6bba('0x9'),_0x6bba('0x43')]);_0x385971[_0x6bba('0x8')]='ContactId';_0x25844f=as[_0x6bba('0x37')](_0x2337a8,_0x4de6b3[_0x6bba('0x38')],_0x385971);_0x2bcd3b[_0x6bba('0x40')][_0x3466f5](_0x25844f[_0x6bba('0x44')],_0x25844f['value']['start'],_0x25844f['value']['end']);}break;case _0x6bba('0x45'):var _0x56dcc5=_0x385971[_0x6bba('0x3c')][_0x6bba('0x3f')](',')['map'](function(_0x464640){return Number(_0x464640);});var _0x664af0=parseTagParameter(_0x56dcc5);_0x2bcd3b[_0x6bba('0x46')][_0x6bba('0x47')][_0x6bba('0x48')](_0x664af0);_0x2bcd3b[_0x6bba('0x46')][_0x6bba('0x49')]=_0x56dcc5;break;case _0x6bba('0x4a'):if(_0x385971[_0x6bba('0x3d')]===_0x6bba('0x3e')){_0x2bcd3b[_0x6bba('0x4b')][_0x3466f5]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname,\x20o.internal)\x20LIKE\x20?','%'+_0x385971[_0x6bba('0x3c')]+'%',null);}else{_0x4de6b3=_[_0x6bba('0x36')](_0x3fbd6e,['name',_0x6bba('0x4c')]);_0x385971[_0x6bba('0x8')]=_0x6bba('0x4c');_0x25844f=as[_0x6bba('0x37')](_0x2337a8,_0x4de6b3[_0x6bba('0x38')],_0x385971);_0x2bcd3b[_0x6bba('0x4b')][_0x3466f5](_0x25844f[_0x6bba('0x44')],_0x25844f[_0x6bba('0x3c')][_0x6bba('0x3a')],_0x25844f[_0x6bba('0x3c')][_0x6bba('0x3b')]);}break;case _0x6bba('0x4d'):case _0x6bba('0x4e'):_0x25844f=as[_0x6bba('0x37')]('me',null,_0x385971);_0x2bcd3b[_0x6bba('0x4d')][_0x3466f5](_0x25844f[_0x6bba('0x44')],_0x25844f['value'][_0x6bba('0x3a')],_0x25844f[_0x6bba('0x3c')][_0x6bba('0x3b')]);break;}}}return _0x2bcd3b;}function parseModelFields(_0x58c496,_0x1cf170,_0x30f1cd){var _0x3ef5ef=utils['getAccountFK'](_0x58c496);var _0x2c1a33=squel[_0x6bba('0x22')]();var _0x3fd8a4=_(_0x1cf170)[_0x6bba('0x4f')]()[_0x6bba('0x14')](function(_0x4a8936){return _[_0x6bba('0x50')](_0x30f1cd,[_0x6bba('0x9'),_0x4a8936])?_0x4a8936:undefined;})[_0x6bba('0x51')]()['value']();if(_0x3fd8a4[_0x6bba('0x34')]>0x0){_0x3fd8a4[_0x6bba('0x23')](function(_0x2f0207){if(_0x2f0207===_0x3ef5ef){_0x2c1a33[_0x6bba('0x48')]('i.'+_0x3ef5ef+_0x6bba('0x13'),[]['concat'](_0x1cf170[_0x2f0207]));}else if(_0x2f0207==='createdAt'){var _0x552b68=JSON[_0x6bba('0x52')](_0x1cf170[_0x2f0207])[_0x6bba('0x53')];var _0x11fe69=JSON[_0x6bba('0x52')](_0x1cf170[_0x2f0207])[_0x6bba('0x54')];_0x2c1a33['and'](_0x6bba('0x55'),_0x552b68,_0x11fe69);}else{if(_0x1cf170[_0x2f0207]===_0x6bba('0x56')){_0x2c1a33[_0x6bba('0x48')]('i.'+_0x2f0207+_0x6bba('0x57'));}else{_0x2c1a33['and']('i.'+_0x2f0207+_0x6bba('0x58'),_0x1cf170[_0x2f0207]);}}});}return _0x2c1a33;}function parseQueryParameters(_0x246e67,_0x3c736f,_0x32ace2){var _0x41ac97=getSqlClauses();return Promise[_0x6bba('0x59')]()[_0x6bba('0x5a')](function(){return parseModelFields(_0x246e67,_0x3c736f,_0x32ace2);})[_0x6bba('0x5a')](function(_0x10bc59){_0x41ac97['fields'][_0x6bba('0x48')](_0x10bc59);return parseReadParameter(_0x3c736f[_0x6bba('0x5b')]);})[_0x6bba('0x5a')](function(_0x57d562){_0x41ac97[_0x6bba('0x5b')]['and'](_0x57d562);return parseTagParameter(_0x3c736f[_0x6bba('0x5c')]);})['then'](function(_0x43767a){_0x41ac97['tags'][_0x6bba('0x47')][_0x6bba('0x48')](_0x43767a);return parseSearchFilter(_0x246e67,_0x3c736f[_0x6bba('0x5d')]);})['then'](function(_0x356cc9){_0x41ac97[_0x6bba('0x5d')]=_0x356cc9;return _0x41ac97;});}function checkAccountsRestrictions(_0x4d7f83,_0x1a8aee,_0x1663eb){var _0x3d6993=utils[_0x6bba('0x16')](_0x4d7f83);var _0x2e7dd5=_0x6bba('0x5e')+_[_0x6bba('0x5f')](_0x4d7f83)+(_0x4d7f83==='chat'?_0x6bba('0x60'):_0x6bba('0x61'));var _0x206ecc=squel[_0x6bba('0x22')]();return Promise[_0x6bba('0x59')]()[_0x6bba('0x5a')](function(){if(_0x1663eb[_0x6bba('0x6')]&&_0x1a8aee[_0x6bba('0x62')]==='agent'){return _0x1a8aee[_0x2e7dd5]({'attributes':['id'],'raw':!![]});}})['then'](function(_0xf54391){if(_0xf54391){if(_0xf54391[_0x6bba('0x34')]===0x0){_0x206ecc[_0x6bba('0x48')]('i.'+_0x3d6993+_0x6bba('0x57'));}else{_0x206ecc['and']('i.'+_0x3d6993+'\x20IN\x20?',_[_0x6bba('0x14')](_0xf54391,'id'));}}else if(!_0x1663eb[_0x3d6993]){_0x206ecc[_0x6bba('0x48')]('i.'+_0x3d6993+_0x6bba('0x63'));}})[_0x6bba('0x5a')](function(){return _0x206ecc;});}function getClosedOrderClause(_0x44bce1,_0x2f062f){var _0x1af822='';var _0xd8160c=[_0x6bba('0x64'),'i.secondDisposition',_0x6bba('0x65')];if(_0x44bce1===_0x6bba('0x31')){_0xd8160c[_0x6bba('0x66')](_0x6bba('0x67'));}if(_0x2f062f[_0x6bba('0x68')]==='0'&&_0x44bce1===_0x6bba('0x31')){_0x1af822='i.substatus';}else{if(_0x2f062f['closed']==='1'){_0xd8160c[_0x6bba('0x69')]();}_0x1af822=_0x6bba('0x6a')+_0xd8160c[_0x6bba('0x6b')](',\x20')+')';}return _0x1af822;}function getFilteredInteractions(_0x4c3162,_0x4cacd4,_0x3f54b5,_0x453db0){var _0xb784f0=utils[_0x6bba('0x17')](_0x4c3162);var _0x504a6d=_[_0x6bba('0x5f')](_0x4c3162)+_0x6bba('0x6c');var _0x14b504=[];var _0x2da198=getTagsQuery();var _0x20ee1b={'type':db[_0x6bba('0x6d')][_0x6bba('0x6e')][_0x6bba('0x6f')],'raw':!![]};var _0x5740b7=[];var _0x5a2251=[];return db[_0x6bba('0x70')][_0x6bba('0x71')](_0x2da198[_0x6bba('0x72')](),_0x20ee1b)[_0x6bba('0x5a')](function(_0xce296e){_0x14b504=_['keyBy'](_0xce296e,'id');_0x20ee1b=_['merge'](_0x20ee1b,{'model':db[_0x504a6d],'mapToModel':!![],'nest':!![]});if(_0x3f54b5[_0x6bba('0x73')]){_0x453db0[_0x6bba('0x74')][_0x6bba('0x23')](function(_0x37ba15){_0x4cacd4[_0x6bba('0x8')]('i.'+_0x37ba15);});}else{_0x4cacd4['field'](_0x6bba('0x75'),_0x6bba('0x76'));_0x4cacd4[_0x6bba('0x8')](_0x6bba('0x77'),_0x6bba('0x78'));_0x4cacd4[_0x6bba('0x8')](_0x6bba('0x79'),_0x6bba('0x7a'));if(_0x4c3162===_0x6bba('0x31')){_0x4cacd4[_0x6bba('0x8')](_0x6bba('0x7b'),_0x6bba('0x7c'));_0x4cacd4[_0x6bba('0x8')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x6bba('0x7d'));_0x4cacd4[_0x6bba('0x8')](_0x6bba('0x7e'));_0x4cacd4[_0x6bba('0x8')](_0x6bba('0x7f'));_0x4cacd4[_0x6bba('0x8')](_0x6bba('0x80'));_0x4cacd4['field'](_0x6bba('0x81'));_0x4cacd4[_0x6bba('0x8')]('i.closedAt');_0x4cacd4['field'](_0x6bba('0x82'));_0x4cacd4[_0x6bba('0x8')](_0x6bba('0x83'));_0x4cacd4['field'](_0x6bba('0x84'));_0x4cacd4[_0x6bba('0x8')](_0x6bba('0x85'));_0x4cacd4[_0x6bba('0x8')](_0x6bba('0x65'));_0x4cacd4['field'](_0x6bba('0x86'));_0x4cacd4['field'](_0x6bba('0x64'));_0x4cacd4[_0x6bba('0x8')]('i.substatus');_0x4cacd4[_0x6bba('0x8')](_0x6bba('0x87'));_0x4cacd4[_0x6bba('0x8')](_0x6bba('0x88'));_0x4cacd4[_0x6bba('0x8')](_0x6bba('0x89'));_0x4cacd4['field']('i.UserId');}else if(_0x4c3162===_0x6bba('0x2d')){_0x4cacd4['field'](_0x6bba('0x8a'),_0x6bba('0x7d'));}else{_0x4cacd4['field'](_0x6bba('0x8b'),_0x6bba('0x7d'));}if(_0x4c3162!==_0x6bba('0x31')){_0x4cacd4[_0x6bba('0x8')](_0x6bba('0x8c'));}_0x4cacd4['field'](_0x6bba('0x8d'),_0x6bba('0x8e'));_0x4cacd4[_0x6bba('0x8')]('c.lastName',_0x6bba('0x8f'));_0x4cacd4[_0x6bba('0x8')](_0x6bba('0x90'),_0x6bba('0x91'));_0x4cacd4[_0x6bba('0x8')](_0x6bba('0x92'),'Contact.phone');_0x4cacd4[_0x6bba('0x8')]('c.mobile',_0x6bba('0x93'));_0x4cacd4[_0x6bba('0x8')](_0x6bba('0x94'),'Contact.fax');_0x4cacd4[_0x6bba('0x8')]('o.fullname',_0x6bba('0x95'));_0x4cacd4[_0x6bba('0x8')](_0x6bba('0x96'),_0x6bba('0x97'));_0x4cacd4[_0x6bba('0x8')](_0x6bba('0x98'),_0x6bba('0x99'));}if(_0x453db0['limit']){_0x4cacd4[_0x6bba('0x9a')](_0x453db0[_0x6bba('0x9a')]);}if(_0x453db0[_0x6bba('0x9b')]){_0x4cacd4['offset'](_0x453db0['offset']);}return db[_0x6bba('0x70')][_0x6bba('0x71')](_0x4cacd4[_0x6bba('0x72')](),_0x20ee1b);})[_0x6bba('0x5a')](function(_0x338452){_0x5740b7=_0x338452;var _0x43d934=getUsersQuery(_0x4c3162,_0x5740b7);return db[_0x6bba('0x70')][_0x6bba('0x71')](_0x43d934[_0x6bba('0x72')](),_0x20ee1b);})[_0x6bba('0x5a')](function(_0x2ccd16){_0x5a2251=_[_0x6bba('0x9c')](_0x2ccd16,_0xb784f0);if(_0x4c3162===_0x6bba('0x31')){return db[_0x6bba('0x9d')]['findOne']({'attributes':[_0x6bba('0x9e')],'raw':!![]});}})[_0x6bba('0x5a')](function(_0x110da9){var _0x1f160e=_0x110da9?_0x110da9['enableEmailPreview']:undefined;var _0x62fc9d=_0x5740b7[_0x6bba('0x14')](function(_0x484896){return updateInteraction(_0x484896,_0x14b504,_0x5a2251,_0x1f160e);});return Promise['all'](_0x62fc9d);});}function countFilteredInteractions(_0x4629d0,_0x9f59ac){var _0x16bec4=_0x4629d0[_0x6bba('0x9f')]();_0x16bec4[_0x6bba('0x8')](_0x6bba('0xa0'));_0x16bec4[_0x6bba('0x8')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');var _0x46fc58=utils['getSelectedTags'](_0x9f59ac);if(!_[_0x6bba('0xa1')](_0x46fc58)){_0x16bec4['where']('t.id\x20IN\x20?',_0x46fc58);}var _0x273b24={'type':db['Sequelize'][_0x6bba('0x6e')]['SELECT'],'raw':!![]};return db[_0x6bba('0x70')][_0x6bba('0x71')](_0x16bec4[_0x6bba('0x72')](),_0x273b24);}module[_0x6bba('0xa2')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index c257f88..1fb4b4c 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcbc9=['UserId','answered','unmanaged','MailMessage','findOne','out','plainBody','lastMsgText','then','Users','TagIds','Tags','catch','../../mysqldb','map','fullname','split','forEach','push','waiting','talking','abandoned','total','closed','disposition'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xcbc9,0x152));var _0x9cbc=function(_0x49f67f,_0x4113a4){_0x49f67f=_0x49f67f-0x0;var _0x4779a1=_0xcbc9[_0x49f67f];return _0x4779a1;};'use strict';var _=require('lodash');var db=require(_0x9cbc('0x0'))['db'];function getInteractionUsers(_0x22645d,_0xc210b4){return new Promise(function(_0x549f61,_0x58d0a6){try{var _0x563f90=[];if(_0xc210b4[_0x22645d]){_0x563f90=_0xc210b4[_0x22645d][_0x9cbc('0x1')](function(_0x301425){return{'id':_0x301425['id'],'fullname':_0x301425[_0x9cbc('0x2')]};});}return _0x549f61(_0x563f90);}catch(_0x371273){_0x58d0a6(_0x371273);}});}function getInteractionTags(_0x2b2b3c,_0x33bc61){var _0x3d26a5=[];if(_0x2b2b3c){_0x2b2b3c[_0x9cbc('0x3')](',')[_0x9cbc('0x4')](function(_0x4b2316){_0x3d26a5[_0x9cbc('0x5')](_0x33bc61[_0x4b2316]);});}return _0x3d26a5;}function updateWaitingCounter(_0x59caad){if(_0x59caad[_0x9cbc('0x6')]){_0x59caad[_0x9cbc('0x6')]-=0x1;}}function updateInteractionCounters(_0x54c3b4){_0x54c3b4[_0x9cbc('0x6')]=0x0;_0x54c3b4[_0x9cbc('0x7')]=0x0;_0x54c3b4['answered']=0x0;_0x54c3b4['unmanaged']=0x0;_0x54c3b4[_0x9cbc('0x8')]=0x0;_0x54c3b4[_0x9cbc('0x9')]=0x0;if(_0x54c3b4[_0x9cbc('0xa')]){if(_0x54c3b4[_0x9cbc('0xb')]==='abandoned'){_0x54c3b4[_0x9cbc('0x8')]+=0x1;updateWaitingCounter(_0x54c3b4);}if(_0x54c3b4[_0x9cbc('0xc')]){_0x54c3b4[_0x9cbc('0xd')]+=0x1;if(_0x54c3b4[_0x9cbc('0x7')]){_0x54c3b4[_0x9cbc('0x7')]-=0x1;}}else{if(_0x54c3b4[_0x9cbc('0xb')]){_0x54c3b4[_0x9cbc('0xe')]+=0x1;updateWaitingCounter(_0x54c3b4);}}}else{if(!_0x54c3b4['UserId']){_0x54c3b4[_0x9cbc('0x6')]+=0x1;}if(_0x54c3b4[_0x9cbc('0xc')]){_0x54c3b4['talking']+=0x1;updateWaitingCounter(_0x54c3b4);}}_0x54c3b4['total']+=0x1;return _0x54c3b4;}function getLastMessageText(_0x583f98){return db[_0x9cbc('0xf')][_0x9cbc('0x10')]({'where':{'$and':[{'MailInteractionId':_0x583f98['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x9cbc('0x11')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x9cbc('0x12')],'order':'-id','raw':!![]})['then'](function(_0x5efae3){if(_0x5efae3&&_0x5efae3[_0x9cbc('0x12')]){_0x583f98[_0x9cbc('0x13')]=_['trimStart'](_0x5efae3[_0x9cbc('0x12')]);}return _0x583f98;})['catch'](function(_0x32a7f8){throw _0x32a7f8;});}exports['updateInteraction']=function(_0x20231e,_0x4cadab,_0x58601f,_0x5bb6d8){return new Promise(function(_0xee0d53,_0x59d9e7){return getInteractionUsers(_0x20231e['id'],_0x58601f)[_0x9cbc('0x14')](function(_0xe30738){_0x20231e[_0x9cbc('0x15')]=_0xe30738;return getInteractionTags(_0x20231e[_0x9cbc('0x16')],_0x4cadab);})['then'](function(_0x2fd641){_0x20231e[_0x9cbc('0x17')]=_0x2fd641;delete _0x20231e[_0x9cbc('0x16')];return updateInteractionCounters(_0x20231e);})['then'](function(_0x1f9c1f){if(_0x5bb6d8){return getLastMessageText(_0x1f9c1f);}else{return _0x1f9c1f;}})[_0x9cbc('0x14')](function(_0x4db54e){_0xee0d53(_0x4db54e);})[_0x9cbc('0x18')](function(_0xf14af1){_0x59d9e7(_0xf14af1);});});}; \ No newline at end of file +var _0x87ed=['talking','answered','unmanaged','total','closed','disposition','abandoned','UserId','MailMessage','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','updateInteraction','then','Users','TagIds','Tags','lodash','../../mysqldb','map','fullname','split','forEach','push','waiting'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x87ed,0x1e5));var _0xd87e=function(_0x554b32,_0x577efd){_0x554b32=_0x554b32-0x0;var _0x2d896d=_0x87ed[_0x554b32];return _0x2d896d;};'use strict';var _=require(_0xd87e('0x0'));var db=require(_0xd87e('0x1'))['db'];function getInteractionUsers(_0x2891b1,_0x51bf97){return new Promise(function(_0x2da767,_0x8ce900){try{var _0x5f0064=[];if(_0x51bf97[_0x2891b1]){_0x5f0064=_0x51bf97[_0x2891b1][_0xd87e('0x2')](function(_0x27e869){return{'id':_0x27e869['id'],'fullname':_0x27e869[_0xd87e('0x3')]};});}return _0x2da767(_0x5f0064);}catch(_0x4347bc){_0x8ce900(_0x4347bc);}});}function getInteractionTags(_0x34e1ea,_0x34f337){var _0x6fdf5d=[];if(_0x34e1ea){_0x34e1ea[_0xd87e('0x4')](',')[_0xd87e('0x5')](function(_0x14bc16){_0x6fdf5d[_0xd87e('0x6')](_0x34f337[_0x14bc16]);});}return _0x6fdf5d;}function updateWaitingCounter(_0x3fe7e6){if(_0x3fe7e6[_0xd87e('0x7')]){_0x3fe7e6['waiting']-=0x1;}}function updateInteractionCounters(_0x433f2a){_0x433f2a[_0xd87e('0x7')]=0x0;_0x433f2a[_0xd87e('0x8')]=0x0;_0x433f2a[_0xd87e('0x9')]=0x0;_0x433f2a[_0xd87e('0xa')]=0x0;_0x433f2a['abandoned']=0x0;_0x433f2a[_0xd87e('0xb')]=0x0;if(_0x433f2a[_0xd87e('0xc')]){if(_0x433f2a[_0xd87e('0xd')]==='abandoned'){_0x433f2a[_0xd87e('0xe')]+=0x1;updateWaitingCounter(_0x433f2a);}if(_0x433f2a[_0xd87e('0xf')]){_0x433f2a['answered']+=0x1;if(_0x433f2a[_0xd87e('0x8')]){_0x433f2a[_0xd87e('0x8')]-=0x1;}}else{if(_0x433f2a['disposition']){_0x433f2a[_0xd87e('0xa')]+=0x1;updateWaitingCounter(_0x433f2a);}}}else{if(!_0x433f2a[_0xd87e('0xf')]){_0x433f2a['waiting']+=0x1;}if(_0x433f2a[_0xd87e('0xf')]){_0x433f2a['talking']+=0x1;updateWaitingCounter(_0x433f2a);}}_0x433f2a[_0xd87e('0xb')]+=0x1;return _0x433f2a;}function getLastMessageText(_0x59dbec){return db[_0xd87e('0x10')][_0xd87e('0x11')]({'where':{'$and':[{'MailInteractionId':_0x59dbec['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xd87e('0x12')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xd87e('0x13')],'order':_0xd87e('0x14'),'raw':!![]})['then'](function(_0x3e1e4d){if(_0x3e1e4d&&_0x3e1e4d[_0xd87e('0x13')]){_0x59dbec[_0xd87e('0x15')]=_[_0xd87e('0x16')](_0x3e1e4d[_0xd87e('0x13')]);}return _0x59dbec;})[_0xd87e('0x17')](function(_0x5c97cc){throw _0x5c97cc;});}exports[_0xd87e('0x18')]=function(_0x3b33fe,_0x1f23c4,_0x480ae8,_0xd7c98b){return new Promise(function(_0x275905,_0x3a04aa){return getInteractionUsers(_0x3b33fe['id'],_0x480ae8)[_0xd87e('0x19')](function(_0x294251){_0x3b33fe[_0xd87e('0x1a')]=_0x294251;return getInteractionTags(_0x3b33fe[_0xd87e('0x1b')],_0x1f23c4);})[_0xd87e('0x19')](function(_0x9f53e3){_0x3b33fe[_0xd87e('0x1c')]=_0x9f53e3;delete _0x3b33fe['TagIds'];return updateInteractionCounters(_0x3b33fe);})[_0xd87e('0x19')](function(_0x37e23c){if(_0xd7c98b){return getLastMessageText(_0x37e23c);}else{return _0x37e23c;}})[_0xd87e('0x19')](function(_0x4a4249){_0x275905(_0x4a4249);})[_0xd87e('0x17')](function(_0x22f97d){_0x3a04aa(_0x22f97d);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 8a5aae9..7410fc1 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc45=['../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat','Website','Account','capitalize','InteractionId','upperFirst','websites','accounts','_interactions','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','null','Interaction','findOne','update','info','catch','error','exports','lodash','../../mysqldb'];(function(_0x2a8204,_0x1eed4a){var _0x9acde3=function(_0x56b957){while(--_0x56b957){_0x2a8204['push'](_0x2a8204['shift']());}};_0x9acde3(++_0x1eed4a);}(_0xdc45,0x184));var _0x5dc4=function(_0x45efa3,_0x3f5578){_0x45efa3=_0x45efa3-0x0;var _0x475953=_0xdc45[_0x45efa3];return _0x475953;};'use strict';var _=require(_0x5dc4('0x0'));var db=require(_0x5dc4('0x1'))['db'];var loggers={'openchannel':require(_0x5dc4('0x2'))(_0x5dc4('0x3')),'mail':require('../../config/logger')(_0x5dc4('0x4')),'fax':require(_0x5dc4('0x2'))(_0x5dc4('0x5')),'sms':require(_0x5dc4('0x2'))(_0x5dc4('0x6')),'chat':require(_0x5dc4('0x2'))('chat-interactions'),'whatsapp':require(_0x5dc4('0x2'))('whatsapp-interactions')};function getAccountFK(_0x12480e){return _['capitalize'](_0x12480e)+(_0x12480e===_0x5dc4('0x7')?_0x5dc4('0x8'):_0x5dc4('0x9'))+'Id';}function getInteractionFK(_0x683a83){return _[_0x5dc4('0xa')](_0x683a83)+_0x5dc4('0xb');}function getInteractionId(_0x32ff52,_0x5c6c5d,_0x12ab78){if(_0x32ff52&&_0x32ff52[_[_0x5dc4('0xc')](_0x12ab78)+_0x5dc4('0xb')]){return _0x32ff52[_[_0x5dc4('0xc')](_0x12ab78)+'InteractionId'];}else if(_0x32ff52&&_0x32ff52['id']){return _0x32ff52['id'];}else if(_0x5c6c5d&&_0x5c6c5d['id']){return _0x5c6c5d['id'];}else{return'unknown';}}function getInteractionsTables(_0x54f125){return{'accounts':_0x54f125+'_'+(_0x54f125===_0x5dc4('0x7')?_0x5dc4('0xd'):_0x5dc4('0xe')),'interactions':_0x54f125+'_interactions','interactionsTags':_0x54f125+'_interaction_has_tags','messages':_0x54f125+'_messages','userInteractions':'user_has_'+_0x54f125+_0x5dc4('0xf')};}function getSelectedTags(_0x327064){var _0x4f43f8=[];if(_0x327064){_0x4f43f8=Array[_0x5dc4('0x10')](_0x327064)?_0x327064:[_0x327064];}return _0x4f43f8;}function log(_0x4106c6,_0xf60eb7,_0x2a9709,_0x2aed96,_0x4a698e,_0x3b7f28){loggers[_0x4a698e[_0x5dc4('0x11')]()][_0x4106c6](_0x5dc4('0x12'),_0x3b7f28[_0x5dc4('0x13')](),_0xf60eb7?_0xf60eb7['id']:null,_0xf60eb7?_0xf60eb7[_0x5dc4('0x14')]:null,_0xf60eb7?_0xf60eb7[_0x5dc4('0x15')]:null,getInteractionId(_0x2a9709,_0x2aed96,_0x4a698e),_0x2a9709?JSON['stringify'](_0x2a9709):_0x5dc4('0x16'));}function updateUser(_0x5dddc0,_0x33a628,_0x3225b8,_0x29584a,_0x148cde){db[_['upperFirst'](_0x29584a)+_0x5dc4('0x17')][_0x5dc4('0x18')]({'where':{'id':getInteractionId(_0x33a628,_0x3225b8,_0x29584a)}})['then'](function(_0x4ce97c){if(_0x4ce97c){return _0x4ce97c[_0x5dc4('0x19')]({'UserId':_0x5dddc0?_0x5dddc0['id']:null});}})['then'](function(_0x8588df){if(_0x8588df){log(_0x5dc4('0x1a'),_0x5dddc0,_0x33a628,_0x3225b8,_0x29584a,_0x148cde);}})[_0x5dc4('0x1b')](function(){log(_0x5dc4('0x1c'),_0x5dddc0,_0x33a628,_0x3225b8,_0x29584a,_0x148cde);});}module[_0x5dc4('0x1d')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x3aab=['name','role','null','Interaction','findOne','then','update','info','catch','error','lodash','openchannel-interactions','../../config/logger','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','InteractionId','upperFirst','unknown','accounts','_interactions','_interaction_has_tags','_messages','user_has_','isArray','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0xe9ffcd,_0x2627fe){var _0x144bae=function(_0x3554fe){while(--_0x3554fe){_0xe9ffcd['push'](_0xe9ffcd['shift']());}};_0x144bae(++_0x2627fe);}(_0x3aab,0x13e));var _0xb3aa=function(_0x5004cf,_0x67fc6c){_0x5004cf=_0x5004cf-0x0;var _0x2c42b2=_0x3aab[_0x5004cf];return _0x2c42b2;};'use strict';var _=require(_0xb3aa('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require('../../config/logger')(_0xb3aa('0x1')),'mail':require('../../config/logger')('mail-interactions'),'fax':require(_0xb3aa('0x2'))(_0xb3aa('0x3')),'sms':require('../../config/logger')(_0xb3aa('0x4')),'chat':require(_0xb3aa('0x2'))(_0xb3aa('0x5')),'whatsapp':require(_0xb3aa('0x2'))(_0xb3aa('0x6'))};function getAccountFK(_0x4c5a4c){return _[_0xb3aa('0x7')](_0x4c5a4c)+(_0x4c5a4c==='chat'?'Website':'Account')+'Id';}function getInteractionFK(_0x44e48c){return _['capitalize'](_0x44e48c)+_0xb3aa('0x8');}function getInteractionId(_0x306576,_0xc05c27,_0x40e539){if(_0x306576&&_0x306576[_[_0xb3aa('0x9')](_0x40e539)+_0xb3aa('0x8')]){return _0x306576[_['upperFirst'](_0x40e539)+'InteractionId'];}else if(_0x306576&&_0x306576['id']){return _0x306576['id'];}else if(_0xc05c27&&_0xc05c27['id']){return _0xc05c27['id'];}else{return _0xb3aa('0xa');}}function getInteractionsTables(_0x8c9213){return{'accounts':_0x8c9213+'_'+(_0x8c9213==='chat'?'websites':_0xb3aa('0xb')),'interactions':_0x8c9213+_0xb3aa('0xc'),'interactionsTags':_0x8c9213+_0xb3aa('0xd'),'messages':_0x8c9213+_0xb3aa('0xe'),'userInteractions':_0xb3aa('0xf')+_0x8c9213+_0xb3aa('0xc')};}function getSelectedTags(_0x259ea4){var _0x42284a=[];if(_0x259ea4){_0x42284a=Array[_0xb3aa('0x10')](_0x259ea4)?_0x259ea4:[_0x259ea4];}return _0x42284a;}function log(_0x448bce,_0x236aaa,_0x1dbea3,_0x27a2dd,_0x4ec865,_0x167196){loggers[_0x4ec865['toLowerCase']()][_0x448bce](_0xb3aa('0x11'),_0x167196['toUpperCase'](),_0x236aaa?_0x236aaa['id']:null,_0x236aaa?_0x236aaa[_0xb3aa('0x12')]:null,_0x236aaa?_0x236aaa[_0xb3aa('0x13')]:null,getInteractionId(_0x1dbea3,_0x27a2dd,_0x4ec865),_0x1dbea3?JSON['stringify'](_0x1dbea3):_0xb3aa('0x14'));}function updateUser(_0x208f1c,_0x141e64,_0x427f69,_0x44845e,_0x19d44e){db[_[_0xb3aa('0x9')](_0x44845e)+_0xb3aa('0x15')][_0xb3aa('0x16')]({'where':{'id':getInteractionId(_0x141e64,_0x427f69,_0x44845e)}})[_0xb3aa('0x17')](function(_0x4cbefb){if(_0x4cbefb){return _0x4cbefb[_0xb3aa('0x18')]({'UserId':_0x208f1c?_0x208f1c['id']:null});}})['then'](function(_0x71b44b){if(_0x71b44b){log(_0xb3aa('0x19'),_0x208f1c,_0x141e64,_0x427f69,_0x44845e,_0x19d44e);}})[_0xb3aa('0x1a')](function(){log(_0xb3aa('0x1b'),_0x208f1c,_0x141e64,_0x427f69,_0x44845e,_0x19d44e);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 9eaeffd..bbe2242 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 _0xb239=['isUserLimit','crypto','composable-middleware','../../config/environment','data1','license','split','createDecipher','format','%s:%s:%s','update','utf8','final','parse','hasOwnProperty','use','License','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','user'];(function(_0x81430c,_0x16bdcc){var _0x39402a=function(_0x2efc90){while(--_0x2efc90){_0x81430c['push'](_0x81430c['shift']());}};_0x39402a(++_0x16bdcc);}(_0xb239,0x139));var _0x9b23=function(_0x3501e2,_0x283304){_0x3501e2=_0x3501e2-0x0;var _0x5a6399=_0xb239[_0x3501e2];return _0x5a6399;};'use strict';var crypto=require(_0x9b23('0x0'));var util=require('util');var compose=require(_0x9b23('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0x9b23('0x2'));function getValueFromLicense(_0x1201d2,_0x1cdd7c){if(_0x1201d2&&_0x1cdd7c){if(_0x1cdd7c['data1']&&_0x1cdd7c['license']){var _0xf13515=_0x1cdd7c[_0x9b23('0x3')];var _0x25dc0b=_0x1cdd7c[_0x9b23('0x4')];var _0x1ffcfb=_0xf13515[_0x9b23('0x5')]('-')[0x4];var _0x508100=_0xf13515[_0x9b23('0x5')]('-')[0x0];var _0x198b2f=crypto[_0x9b23('0x6')]('aes-256-ctr',util[_0x9b23('0x7')](_0x9b23('0x8'),_0x1ffcfb,_0xf13515,_0x508100));var _0x2fc238=_0x198b2f[_0x9b23('0x9')](_0x25dc0b,'base64',_0x9b23('0xa'));_0x2fc238+=_0x198b2f[_0x9b23('0xb')](_0x9b23('0xa'));var _0x225ff6=JSON[_0x9b23('0xc')](_0x2fc238);return _0x225ff6[_0x9b23('0xd')](_0x1201d2)?_0x225ff6[_0x1201d2]:null;}}return null;}function isLimit(_0x2c83fe,_0x57d1ee,_0x222f67,_0x2caa13){var _0x550080=_0x57d1ee;return compose()[_0x9b23('0xe')](function(_0x222317,_0x6500dc,_0x4a83f6){return db[_0x9b23('0xf')][_0x9b23('0x10')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x23b4ac){var _0x350e33=getValueFromLicense(_0x2c83fe,_0x23b4ac);return _0x350e33?_0x350e33:_0x550080;})[_0x9b23('0x11')](function(_0x3789a0){_0x550080=_0x3789a0;return _0x222f67['count'](_0x2caa13);})[_0x9b23('0x11')](function(_0x4071db){if(_0x4071db>=_0x550080){return _0x6500dc[_0x9b23('0x12')](0x193)[_0x9b23('0x13')]({'message':util['format'](_0x9b23('0x14'),_0x2c83fe)});}_0x4a83f6();})[_0x9b23('0x15')](function(_0xca956a){_0x4a83f6(_0xca956a);});});}function isUserLimit(){return isLimit(_0x9b23('0x16'),0x1,db['User'],{'where':{'$or':[{'role':_0x9b23('0x17')},{'role':_0x9b23('0x18')}]}});}exports[_0x9b23('0x19')]=isUserLimit; \ No newline at end of file +var _0x5fd6=['crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','format','%s:%s:%s','update','utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','User','admin','user','isUserLimit'];(function(_0x4284e4,_0x9f2d2a){var _0x5a14ce=function(_0x2a40cd){while(--_0x2a40cd){_0x4284e4['push'](_0x4284e4['shift']());}};_0x5a14ce(++_0x9f2d2a);}(_0x5fd6,0xfc));var _0x65fd=function(_0x24d810,_0x12ca85){_0x24d810=_0x24d810-0x0;var _0x14f990=_0x5fd6[_0x24d810];return _0x14f990;};'use strict';var crypto=require(_0x65fd('0x0'));var util=require(_0x65fd('0x1'));var compose=require(_0x65fd('0x2'));var db=require(_0x65fd('0x3'))['db'];var config=require(_0x65fd('0x4'));function getValueFromLicense(_0x485409,_0x5e04b0){if(_0x485409&&_0x5e04b0){if(_0x5e04b0[_0x65fd('0x5')]&&_0x5e04b0[_0x65fd('0x6')]){var _0x5383eb=_0x5e04b0[_0x65fd('0x5')];var _0x224548=_0x5e04b0['license'];var _0x5cb199=_0x5383eb[_0x65fd('0x7')]('-')[0x4];var _0x41a459=_0x5383eb['split']('-')[0x0];var _0x48141c=crypto[_0x65fd('0x8')]('aes-256-ctr',util[_0x65fd('0x9')](_0x65fd('0xa'),_0x5cb199,_0x5383eb,_0x41a459));var _0x32714b=_0x48141c[_0x65fd('0xb')](_0x224548,'base64',_0x65fd('0xc'));_0x32714b+=_0x48141c[_0x65fd('0xd')](_0x65fd('0xc'));var _0x27622d=JSON[_0x65fd('0xe')](_0x32714b);return _0x27622d[_0x65fd('0xf')](_0x485409)?_0x27622d[_0x485409]:null;}}return null;}function isLimit(_0x17d5e5,_0x243a3c,_0x1ebdcc,_0x1b36ce){var _0x7c4530=_0x243a3c;return compose()[_0x65fd('0x10')](function(_0x1141c9,_0x38dd72,_0x1a1485){return db[_0x65fd('0x11')][_0x65fd('0x12')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x3a5b4c){var _0x339279=getValueFromLicense(_0x17d5e5,_0x3a5b4c);return _0x339279?_0x339279:_0x7c4530;})[_0x65fd('0x13')](function(_0x46a03f){_0x7c4530=_0x46a03f;return _0x1ebdcc[_0x65fd('0x14')](_0x1b36ce);})['then'](function(_0xe23e2f){if(_0xe23e2f>=_0x7c4530){return _0x38dd72[_0x65fd('0x15')](0x193)[_0x65fd('0x16')]({'message':util[_0x65fd('0x9')](_0x65fd('0x17'),_0x17d5e5)});}_0x1a1485();})['catch'](function(_0x253380){_0x1a1485(_0x253380);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x65fd('0x18')],{'where':{'$or':[{'role':_0x65fd('0x19')},{'role':_0x65fd('0x1a')}]}});}exports[_0x65fd('0x1b')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index bca7fe3..0a066c0 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 _0x83c5=['$startsWith','pop','utcOffset','hours','minutes','seconds','lodash','moment','sqlOperator','startsWith','[$or]','and','replace','[$and]','split','slice','forEach','shift','match','indexOf','map','push','buildExpression','$eq','operator','includes','$gt','$lte','value','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$endsWith','$lt','<\x20?','<=\x20?','$between','start'];(function(_0x24243b,_0x55c567){var _0x1a85ce=function(_0x28c017){while(--_0x28c017){_0x24243b['push'](_0x24243b['shift']());}};_0x1a85ce(++_0x55c567);}(_0x83c5,0x114));var _0x583c=function(_0x3a24b5,_0x313359){_0x3a24b5=_0x3a24b5-0x0;var _0x3c6702=_0x83c5[_0x3a24b5];return _0x3c6702;};'use strict';var _=require(_0x583c('0x0'));var moment=require(_0x583c('0x1'));exports['parseSearch']=function(_0x242287){var _0x54ee49={'conditions':[]};_0x54ee49[_0x583c('0x2')]=_[_0x583c('0x3')](_0x242287,_0x583c('0x4'))?'or':_0x583c('0x5');var _0x5c32b9=_0x242287[_0x583c('0x6')](_0x583c('0x7'),'')[_0x583c('0x6')]('[$or]','')[_0x583c('0x8')]('||');for(var _0x1b6b50=0x0;_0x1b6b50<_0x5c32b9['length'];_0x1b6b50++){var _0x1b6214=_0x5c32b9[_0x1b6b50][_0x583c('0x8')](':=');var _0x300d9f=_0x1b6214[0x0];var _0x102639=_0x1b6214[_0x583c('0x9')](0x1);_0x102639[_0x583c('0xa')](function(_0x21c261){var _0x5c58f0=_0x21c261[_0x583c('0x8')]('[')[_0x583c('0xb')]();var _0x17a703=_0x21c261[_0x583c('0xc')](/\[(.*?)\]/g);_0x17a703[_0x583c('0xa')](function(_0x293e2e){var _0x4a85a2=_0x293e2e[_0x583c('0x8')]('[')['filter'](function(_0x1ba57b){return _0x1ba57b[_0x583c('0xd')](']')>-0x1;})[_0x583c('0xe')](function(_0x4d1cd8){return _0x4d1cd8[_0x583c('0x8')](']')[0x0];})[0x0];_0x54ee49['conditions'][_0x583c('0xf')]({'field':_0x300d9f,'operator':_0x5c58f0,'value':_0x4a85a2});});});}return _0x54ee49;};exports[_0x583c('0x10')]=function(_0x1c183e,_0x9b9e00,_0x35dcda){var _0x38ac29={};if(_0x9b9e00==='DATE'){if(_0x35dcda['operator']===_0x583c('0x11')){_0x35dcda[_0x583c('0x12')]='$between';_0x35dcda['value']+=','+_0x35dcda['value'];}else if(_[_0x583c('0x13')]([_0x583c('0x14'),_0x583c('0x15')],_0x35dcda[_0x583c('0x12')])){_0x35dcda[_0x583c('0x16')]=moment(_0x35dcda['value'])[_0x583c('0x17')](0x1,_0x583c('0x18'))[_0x583c('0x19')](_0x583c('0x1a'));}}if(_0x35dcda[_0x583c('0x1b')]){_0x9b9e00=_0x35dcda[_0x583c('0x1b')];_0x38ac29[_0x583c('0x1c')]=_0x583c('0x1d')+_0x1c183e+'.'+_0x35dcda[_0x583c('0x1e')]+_0x583c('0x1f')+_0x35dcda['castTo']+')\x20'+parseOperator(_0x35dcda[_0x583c('0x12')]);}else{_0x38ac29[_0x583c('0x1c')]=_0x1c183e+'.'+_0x35dcda[_0x583c('0x1e')]+'\x20'+parseOperator(_0x35dcda[_0x583c('0x12')]);}if(_['includes']([_0x583c('0x20'),'$notIn'],_0x35dcda[_0x583c('0x12')]))_0x38ac29[_0x583c('0x1c')]='('+_0x38ac29[_0x583c('0x1c')]+_0x583c('0x21')+_0x1c183e+'.'+_0x35dcda[_0x583c('0x1e')]+_0x583c('0x22');_0x38ac29['value']=parseValue(_0x9b9e00,_0x35dcda[_0x583c('0x12')],_0x35dcda['value']);return _0x38ac29;};function parseOperator(_0xc2f8bf){var _0x243058;switch(_0xc2f8bf){case _0x583c('0x23'):_0x243058=_0x583c('0x24');break;case _0x583c('0x25'):_0x243058=_0x583c('0x26');break;case _0x583c('0x11'):_0x243058=_0x583c('0x27');break;case _0x583c('0x20'):_0x243058=_0x583c('0x28');break;case _0x583c('0x29'):case'$startsWith':case _0x583c('0x2a'):_0x243058='LIKE\x20?';break;case _0x583c('0x2b'):_0x243058=_0x583c('0x2c');break;case _0x583c('0x14'):_0x243058='>\x20?';break;case _0x583c('0x15'):_0x243058=_0x583c('0x2d');break;case'$gte':_0x243058='>=\x20?';break;case _0x583c('0x2e'):_0x243058='BETWEEN\x20?\x20AND\x20?';break;}return _0x243058;}function parseValue(_0x47c318,_0x4f45ac,_0x592d49){var _0x40fa53={'start':undefined,'end':undefined};switch(_0x4f45ac){case _0x583c('0x23'):case _0x583c('0x25'):_0x40fa53[_0x583c('0x2f')]=_0x592d49[_0x583c('0x8')](',');break;case _0x583c('0x29'):_0x40fa53[_0x583c('0x2f')]='%'+_0x592d49+'%';break;case _0x583c('0x30'):_0x40fa53[_0x583c('0x2f')]=_0x592d49+'%';break;case _0x583c('0x2a'):_0x40fa53[_0x583c('0x2f')]='%'+_0x592d49;break;case _0x583c('0x2e'):var _0x337949=_0x592d49['split'](',');var _0x592d49=_0x337949[_0x583c('0xb')]();var _0x110839=_0x337949[_0x583c('0x31')]();if(_0x47c318==='DATE'){_0x592d49=moment(_0x592d49)['utcOffset'](0x0,!![])[_0x583c('0x19')]();_0x110839=moment(_0x110839)[_0x583c('0x32')](0x0,!![])['add'](0x17,_0x583c('0x33'))['add'](0x3b,_0x583c('0x34'))['add'](0x3b,_0x583c('0x35'))[_0x583c('0x19')]();}_0x40fa53={'start':_0x592d49,'end':_0x110839};break;default:_0x40fa53[_0x583c('0x2f')]=_0x592d49;break;}return _0x40fa53;} \ No newline at end of file +var _0x9c62=['[$and]','[$or]','split','length','slice','match','forEach','filter','indexOf','map','conditions','push','buildExpression','DATE','operator','$eq','$between','value','$gt','add','days','format','castTo','CAST(','field','\x20AS\x20','includes','$ne','$notIn','text','\x20OR\x20','\x20IS\x20NULL)','NOT\x20IN\x20?','=\x20?','<>\x20?','$startsWith','$endsWith','<\x20?','>\x20?','$lte','<=\x20?','$gte','start','shift','utcOffset','hours','minutes','seconds','lodash','parseSearch','and','replace'];(function(_0x2a0738,_0x3c0bc5){var _0x159679=function(_0x9c9ec7){while(--_0x9c9ec7){_0x2a0738['push'](_0x2a0738['shift']());}};_0x159679(++_0x3c0bc5);}(_0x9c62,0x98));var _0x29c6=function(_0x362fa2,_0x42ff83){_0x362fa2=_0x362fa2-0x0;var _0x507057=_0x9c62[_0x362fa2];return _0x507057;};'use strict';var _=require(_0x29c6('0x0'));var moment=require('moment');exports[_0x29c6('0x1')]=function(_0x2bcf7c){var _0x127da7={'conditions':[]};_0x127da7['sqlOperator']=_['startsWith'](_0x2bcf7c,'[$or]')?'or':_0x29c6('0x2');var _0x24f369=_0x2bcf7c[_0x29c6('0x3')](_0x29c6('0x4'),'')[_0x29c6('0x3')](_0x29c6('0x5'),'')[_0x29c6('0x6')]('||');for(var _0x769f89=0x0;_0x769f89<_0x24f369[_0x29c6('0x7')];_0x769f89++){var _0x5a13ed=_0x24f369[_0x769f89][_0x29c6('0x6')](':=');var _0x7c0631=_0x5a13ed[0x0];var _0x3500c5=_0x5a13ed[_0x29c6('0x8')](0x1);_0x3500c5['forEach'](function(_0x2153e0){var _0x460d76=_0x2153e0[_0x29c6('0x6')]('[')['shift']();var _0x252ff5=_0x2153e0[_0x29c6('0x9')](/\[(.*?)\]/g);_0x252ff5[_0x29c6('0xa')](function(_0x20a9ba){var _0x3d3e74=_0x20a9ba[_0x29c6('0x6')]('[')[_0x29c6('0xb')](function(_0x4e1946){return _0x4e1946[_0x29c6('0xc')](']')>-0x1;})[_0x29c6('0xd')](function(_0x17163e){return _0x17163e['split'](']')[0x0];})[0x0];_0x127da7[_0x29c6('0xe')][_0x29c6('0xf')]({'field':_0x7c0631,'operator':_0x460d76,'value':_0x3d3e74});});});}return _0x127da7;};exports[_0x29c6('0x10')]=function(_0x3c2818,_0x4da4d4,_0x3d14be){var _0xa0ee76={};if(_0x4da4d4===_0x29c6('0x11')){if(_0x3d14be[_0x29c6('0x12')]===_0x29c6('0x13')){_0x3d14be['operator']=_0x29c6('0x14');_0x3d14be[_0x29c6('0x15')]+=','+_0x3d14be['value'];}else if(_['includes']([_0x29c6('0x16'),'$lte'],_0x3d14be['operator'])){_0x3d14be[_0x29c6('0x15')]=moment(_0x3d14be[_0x29c6('0x15')])[_0x29c6('0x17')](0x1,_0x29c6('0x18'))[_0x29c6('0x19')]('YYYY-MM-DD');}}if(_0x3d14be[_0x29c6('0x1a')]){_0x4da4d4=_0x3d14be[_0x29c6('0x1a')];_0xa0ee76['text']=_0x29c6('0x1b')+_0x3c2818+'.'+_0x3d14be[_0x29c6('0x1c')]+_0x29c6('0x1d')+_0x3d14be[_0x29c6('0x1a')]+')\x20'+parseOperator(_0x3d14be['operator']);}else{_0xa0ee76['text']=_0x3c2818+'.'+_0x3d14be[_0x29c6('0x1c')]+'\x20'+parseOperator(_0x3d14be[_0x29c6('0x12')]);}if(_[_0x29c6('0x1e')]([_0x29c6('0x1f'),_0x29c6('0x20')],_0x3d14be['operator']))_0xa0ee76[_0x29c6('0x21')]='('+_0xa0ee76['text']+_0x29c6('0x22')+_0x3c2818+'.'+_0x3d14be[_0x29c6('0x1c')]+_0x29c6('0x23');_0xa0ee76[_0x29c6('0x15')]=parseValue(_0x4da4d4,_0x3d14be[_0x29c6('0x12')],_0x3d14be[_0x29c6('0x15')]);return _0xa0ee76;};function parseOperator(_0x50a684){var _0x2cbc81;switch(_0x50a684){case'$in':_0x2cbc81='IN\x20?';break;case _0x29c6('0x20'):_0x2cbc81=_0x29c6('0x24');break;case _0x29c6('0x13'):_0x2cbc81=_0x29c6('0x25');break;case _0x29c6('0x1f'):_0x2cbc81=_0x29c6('0x26');break;case'$substring':case _0x29c6('0x27'):case _0x29c6('0x28'):_0x2cbc81='LIKE\x20?';break;case'$lt':_0x2cbc81=_0x29c6('0x29');break;case _0x29c6('0x16'):_0x2cbc81=_0x29c6('0x2a');break;case _0x29c6('0x2b'):_0x2cbc81=_0x29c6('0x2c');break;case _0x29c6('0x2d'):_0x2cbc81='>=\x20?';break;case'$between':_0x2cbc81='BETWEEN\x20?\x20AND\x20?';break;}return _0x2cbc81;}function parseValue(_0x1f4f9a,_0x5be21a,_0x18c45e){var _0x3de07d={'start':undefined,'end':undefined};switch(_0x5be21a){case'$in':case _0x29c6('0x20'):_0x3de07d[_0x29c6('0x2e')]=_0x18c45e[_0x29c6('0x6')](',');break;case'$substring':_0x3de07d[_0x29c6('0x2e')]='%'+_0x18c45e+'%';break;case'$startsWith':_0x3de07d['start']=_0x18c45e+'%';break;case _0x29c6('0x28'):_0x3de07d[_0x29c6('0x2e')]='%'+_0x18c45e;break;case _0x29c6('0x14'):var _0x4f8365=_0x18c45e[_0x29c6('0x6')](',');var _0x18c45e=_0x4f8365[_0x29c6('0x2f')]();var _0xe18e30=_0x4f8365['pop']();if(_0x1f4f9a===_0x29c6('0x11')){_0x18c45e=moment(_0x18c45e)[_0x29c6('0x30')](0x0,!![])[_0x29c6('0x19')]();_0xe18e30=moment(_0xe18e30)[_0x29c6('0x30')](0x0,!![])[_0x29c6('0x17')](0x17,_0x29c6('0x31'))[_0x29c6('0x17')](0x3b,_0x29c6('0x32'))[_0x29c6('0x17')](0x3b,_0x29c6('0x33'))[_0x29c6('0x19')]();}_0x3de07d={'start':_0x18c45e,'end':_0xe18e30};break;default:_0x3de07d[_0x29c6('0x2e')]=_0x18c45e;break;}return _0x3de07d;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index d7742d9..6381df5 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 _0x44fd=['isEmail','\x22{EXPR}\x22','{EXPR}','forEach','replace','push','join','getOptions','query','$id','model','intersection','attributes','nolimit','limit','order','where','pick','filter','object','columns','value','type','lower','merge','includeAll','include','moment','../../mysqldb','parse','keys','includes','alias','fields','split','filters','isEmpty','find','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','offset','sort','map','indexOf','cast','col','unsigned','DESC','priority','omit','length','isObject','isString','unset','hasOwnProperty','match','^[+]?[0-9]*$'];(function(_0xa656d,_0xc5f407){var _0x17aedd=function(_0x1ef1a9){while(--_0x1ef1a9){_0xa656d['push'](_0xa656d['shift']());}};_0x17aedd(++_0xc5f407);}(_0x44fd,0x123));var _0xd44f=function(_0x2d9c6a,_0x59393d){_0x2d9c6a=_0x2d9c6a-0x0;var _0xf3c918=_0x44fd[_0x2d9c6a];return _0xf3c918;};'use strict';var _=require('lodash');var sequelize=require('sequelize');var moment=require(_0xd44f('0x0'));var db=require(_0xd44f('0x1'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x458bea){var _0x3f2791=['ne'];try{var _0x4bc9a1=JSON[_0xd44f('0x2')](_0x458bea);var _0x5ca990=Object[_0xd44f('0x3')](_0x4bc9a1)[0x0];return _0x3f2791[_0xd44f('0x4')](_0x5ca990);}catch(_0xf990bf){return![];}}function getOperatorValue(_0xb14d0b){var _0x22c0ab=JSON[_0xd44f('0x2')](_0xb14d0b);var _0x6e1926=Object[_0xd44f('0x3')](_0x22c0ab)[0x0];var _0x4e5e68=_0x22c0ab[_0x6e1926];return{['$'+_0x6e1926]:_0x4e5e68};}function parseIncludeModel(_0x17fb72){var _0x4230b7=JSON[_0xd44f('0x2')](_0x17fb72);return{'model':db[_0x4230b7['model']],'as':_0x4230b7[_0xd44f('0x5')],'attributes':_0x4230b7[_0xd44f('0x6')],'raw':_0x4230b7['raw']};}exports[_0xd44f('0x6')]=function(_0x1f6d10){var _0x21dcb7=null;if(_0x1f6d10){_0x21dcb7=_0x1f6d10[_0xd44f('0x7')](',');}return _0x21dcb7;};exports[_0xd44f('0x8')]=function(_0x4c2c9f,_0x2bb1b8){var _0x410ceb={};if(!_[_0xd44f('0x9')](_0x4c2c9f)){_['forOwn'](_0x4c2c9f,function(_0x1dac66,_0x2c5602){try{if(_0x2bb1b8){var _0x148c98=_[_0xd44f('0xa')](_0x2bb1b8,{'name':_0x2c5602})||{};if(hasSequelizeOperator(_0x1dac66)){_0x410ceb[_0x2c5602]=getOperatorValue(_0x1dac66);}else if(_0x148c98['type']===_0xd44f('0xb')&&_[_0xd44f('0xc')](_0x1dac66)){var _0x6ee63=JSON['parse'](_0x1dac66);var _0x5e789d={'$gte':moment(moment(_0x6ee63[_0xd44f('0xd')])[_0xd44f('0xe')](_0xd44f('0xf')))[_0xd44f('0x10')]()['format'](),'$lte':moment(moment(_0x6ee63[_0xd44f('0x11')])[_0xd44f('0xe')]('YYYY-MM-DD'))['utc']()[_0xd44f('0x12')](0x1,'s')[_0xd44f('0xe')]()};_0x410ceb[_0x2c5602]=_0x5e789d;}else if(_0x148c98[_0xd44f('0x13')]===_0xd44f('0x14')){_0x410ceb[_0x2c5602]=_0x1dac66;}else{_0x410ceb[_0x2c5602]=_[_0xd44f('0x15')](_0x1dac66)?_0x1dac66:JSON[_0xd44f('0x2')](_0x1dac66);}}else{_0x410ceb[_0x2c5602]=_[_0xd44f('0x15')](_0x1dac66)?_0x1dac66:JSON['parse'](_0x1dac66);}}catch(_0x50381c){_0x410ceb[_0x2c5602]=_0x1dac66[_0xd44f('0x7')](',');}});}return _0x410ceb;};exports['limit']=function(_0x5a0951){_0x5a0951=parseInt(_0x5a0951,0xa);if(!_0x5a0951||_0x5a0951<0x0){_0x5a0951=LIMIT_VALUE;}return _0x5a0951;};exports[_0xd44f('0x16')]=function(_0x174e55){_0x174e55=parseInt(_0x174e55,0xa);if(!_0x174e55||_0x174e55<0x0){_0x174e55=0x0;}return _0x174e55;};exports[_0xd44f('0x17')]=function(_0x36673c){var _0x28f530,_0x342b7c=null;if(_0x36673c){_0x28f530=_0x36673c['split'](',');_0x342b7c=_[_0xd44f('0x18')](_0x28f530,function(_0x44b286){if(_0x44b286[_0xd44f('0x19')]('-')===0x0){return[_0x44b286==='priority'?sequelize[_0xd44f('0x1a')](sequelize[_0xd44f('0x1b')]('priority'),_0xd44f('0x1c')):_0x44b286['substr'](0x1),_0xd44f('0x1d')];}else{return[_0x44b286===_0xd44f('0x1e')?sequelize[_0xd44f('0x1a')](sequelize[_0xd44f('0x1b')]('priority'),_0xd44f('0x1c')):_0x44b286,'ASC'];}});}return _0x342b7c;};exports[_0xd44f('0x1f')]=function(_0x2762e4,_0x8c9492){if(_['isEmpty'](_0x2762e4)){return _0x2762e4;}if(_[_0xd44f('0x15')](_0x2762e4)){for(var _0x2450f9=0x0;_0x2450f9<_0x2762e4[_0xd44f('0x20')];_0x2450f9+=0x1){_0x2762e4[_0x2450f9]=this['omit'](_0x2762e4[_0x2450f9],_0x8c9492);}return _0x2762e4;}if(!_[_0xd44f('0x21')](_0x2762e4)){return _0x2762e4;}if(_[_0xd44f('0x22')](_0x8c9492)){_0x8c9492=[_0x8c9492];}if(!_[_0xd44f('0x15')](_0x8c9492)){return _0x2762e4;}for(var _0x197aa2=0x0;_0x197aa2<_0x8c9492[_0xd44f('0x20')];_0x197aa2+=0x1){_[_0xd44f('0x23')](_0x2762e4,_0x8c9492[_0x197aa2]);}for(var _0xecacfb in _0x2762e4){if(_0x2762e4[_0xd44f('0x24')](_0xecacfb)){_0x2762e4[_0xecacfb]=this[_0xd44f('0x1f')](_0x2762e4[_0xecacfb],_0x8c9492);}}return _0x2762e4;};exports['isNumeric']=function(_0x54beee){return _0x54beee[_0xd44f('0x25')](RegExp(_0xd44f('0x26')))?!![]:![];};exports[_0xd44f('0x27')]=function(_0x551ee8){return _0x551ee8[_0xd44f('0x25')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x2a5847,_0x1047fc){var _0x40cb3a=[];var _0x247e8e=/[ `!@#$%^&*()_\-?~]/;var _0x2412a8=_0x1047fc?_0xd44f('0x28'):_0xd44f('0x29');_0x2a5847[_0xd44f('0x7')](/[ ,]+/)[_0xd44f('0x2a')](function(_0x35d514){_0x35d514=_0x35d514[_0xd44f('0x2b')](/([^:]")"+/g,'$1');_0x35d514='+'+_0x35d514+'*';var _0x42aff5=_0x35d514[_0xd44f('0x25')](_0x247e8e);if(_0x42aff5){_0x35d514='\x22'+_0x35d514+'\x22';}_0x40cb3a[_0xd44f('0x2c')](_0x35d514);});_0x2412a8=_0x2412a8[_0xd44f('0x2b')](_0xd44f('0x29'),_0x40cb3a[_0xd44f('0x2d')]('\x20'));return _0x2412a8;};exports[_0xd44f('0x2e')]=function(_0xfd11a,_0x54d673,_0x427493){var _0x23bda7={},_0x2a5d48={};if(_0x54d673[_0xd44f('0x2f')][_0xd44f('0x30')]){_0x54d673[_0xd44f('0x2f')]['id']=_0x54d673['query']['$id'];delete _0x54d673[_0xd44f('0x2f')][_0xd44f('0x30')];}_0x23bda7[_0xd44f('0x31')]=_[_0xd44f('0x18')](_0xfd11a,_0xd44f('0x13'));_0x23bda7['query']=_[_0xd44f('0x3')](_0x54d673[_0xd44f('0x2f')]);_0x23bda7[_0xd44f('0x8')]=_[_0xd44f('0x32')](_0x23bda7[_0xd44f('0x31')],_0x23bda7[_0xd44f('0x2f')]);_0x2a5d48[_0xd44f('0x33')]=_[_0xd44f('0x32')](_0x23bda7['model'],this['fields'](_0x54d673[_0xd44f('0x2f')][_0xd44f('0x6')]));_0x2a5d48[_0xd44f('0x33')]=_0x2a5d48[_0xd44f('0x33')]['length']?_0x2a5d48['attributes']:_0x23bda7[_0xd44f('0x31')];if(!_0x54d673[_0xd44f('0x2f')][_0xd44f('0x24')](_0xd44f('0x34'))){_0x2a5d48[_0xd44f('0x35')]=this[_0xd44f('0x35')](_0x54d673[_0xd44f('0x2f')][_0xd44f('0x35')]);_0x2a5d48[_0xd44f('0x16')]=this[_0xd44f('0x16')](_0x54d673[_0xd44f('0x2f')][_0xd44f('0x16')]);}_0x2a5d48[_0xd44f('0x36')]=this['sort'](_0x54d673[_0xd44f('0x2f')][_0xd44f('0x17')]);_0x2a5d48[_0xd44f('0x37')]=this['filters'](_[_0xd44f('0x38')](_0x54d673[_0xd44f('0x2f')],_0x23bda7['filters']),_0xfd11a);if(_0x54d673[_0xd44f('0x2f')]['filter']){var _0x411552=_0xfd11a;var _0x2ac47d=_0x54d673['query'][_0xd44f('0x39')];if(typeof _0x2ac47d===_0xd44f('0x3a')){_0x411552=_[_0xd44f('0x39')](_0xfd11a,function(_0x5a4f6a){return _[_0xd44f('0x4')](_0x2ac47d[_0xd44f('0x3b')],_0x5a4f6a['name']);});_0x2ac47d=_0x2ac47d[_0xd44f('0x3c')];}_0x2a5d48[_0xd44f('0x37')]=_['merge'](_0x2a5d48[_0xd44f('0x37')],{'$or':_['map'](_0x411552,function(_0x54ccc3){if(_0x54ccc3[_0xd44f('0x3d')]!=='VIRTUAL'){if(_0x427493){return sequelize[_0xd44f('0x37')](sequelize['fn'](_0xd44f('0x3e'),sequelize[_0xd44f('0x1b')](_0x54ccc3[_0xd44f('0x13')])),{'$like':sequelize['fn'](_0xd44f('0x3e'),'%'+_0x54d673[_0xd44f('0x2f')]['filter']+'%')});}else{var _0x275ab2={};_0x275ab2[_0x54ccc3[_0xd44f('0x13')]]={'$like':'%'+_0x54d673['query']['filter']+'%'};return _0x275ab2;}}})});}_0x2a5d48=_[_0xd44f('0x3f')]({},_0x2a5d48,_0x54d673['options']);return _0x2a5d48;};exports['include']=function(_0x2f33e3){var _0x220142=[];if(_0x2f33e3[_0xd44f('0x40')]){_0x220142['push']({'all':!![]});}else if(_0x2f33e3[_0xd44f('0x41')]){if(Array[_0xd44f('0x15')](_0x2f33e3[_0xd44f('0x41')])){_0x220142=Object[_0xd44f('0x3')](_0x2f33e3[_0xd44f('0x41')])[_0xd44f('0x18')](function(_0x4be3b3){return parseIncludeModel(_0x2f33e3[_0xd44f('0x41')][_0x4be3b3]);});}else{var _0x55db9c=parseIncludeModel(_0x2f33e3['include']);_0x220142[_0xd44f('0x2c')](_0x55db9c);}}return _0x220142;}; \ No newline at end of file +var _0xf5a7=['parse','keys','includes','model','alias','fields','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','utc','$lte','subtract','name','isArray','split','limit','offset','sort','priority','cast','col','unsigned','DESC','omit','length','isObject','unset','match','isEmail','getFullTextValue','\x22{EXPR}\x22','replace','push','{EXPR}','getOptions','$id','query','map','intersection','attributes','nolimit','pick','filter','object','columns','value','merge','where','VIRTUAL','lower','options','includeAll','include','lodash','sequelize','../../mysqldb'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf5a7,0x133));var _0x7f5a=function(_0x311572,_0x4c8a6b){_0x311572=_0x311572-0x0;var _0x35763e=_0xf5a7[_0x311572];return _0x35763e;};'use strict';var _=require(_0x7f5a('0x0'));var sequelize=require(_0x7f5a('0x1'));var moment=require('moment');var db=require(_0x7f5a('0x2'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x13cc6f){var _0x15a24a=['ne'];try{var _0x25616d=JSON[_0x7f5a('0x3')](_0x13cc6f);var _0x342fa0=Object[_0x7f5a('0x4')](_0x25616d)[0x0];return _0x15a24a[_0x7f5a('0x5')](_0x342fa0);}catch(_0x35ec90){return![];}}function getOperatorValue(_0x520bf9){var _0x2808f2=JSON[_0x7f5a('0x3')](_0x520bf9);var _0x585e25=Object[_0x7f5a('0x4')](_0x2808f2)[0x0];var _0x46d6d5=_0x2808f2[_0x585e25];return{['$'+_0x585e25]:_0x46d6d5};}function parseIncludeModel(_0x2a21fe){var _0x4da417=JSON['parse'](_0x2a21fe);return{'model':db[_0x4da417[_0x7f5a('0x6')]],'as':_0x4da417[_0x7f5a('0x7')],'attributes':_0x4da417['fields'],'raw':_0x4da417['raw']};}exports[_0x7f5a('0x8')]=function(_0x3bf4bd){var _0x4b2af6=null;if(_0x3bf4bd){_0x4b2af6=_0x3bf4bd['split'](',');}return _0x4b2af6;};exports[_0x7f5a('0x9')]=function(_0x276766,_0x2882a2){var _0x25efad={};if(!_[_0x7f5a('0xa')](_0x276766)){_[_0x7f5a('0xb')](_0x276766,function(_0x55ca4b,_0xc6795b){try{if(_0x2882a2){var _0x405223=_[_0x7f5a('0xc')](_0x2882a2,{'name':_0xc6795b})||{};if(hasSequelizeOperator(_0x55ca4b)){_0x25efad[_0xc6795b]=getOperatorValue(_0x55ca4b);}else if(_0x405223[_0x7f5a('0xd')]===_0x7f5a('0xe')&&_[_0x7f5a('0xf')](_0x55ca4b)){var _0x117772=JSON[_0x7f5a('0x3')](_0x55ca4b);var _0x4ce5c2={'$gte':moment(moment(_0x117772[_0x7f5a('0x10')])[_0x7f5a('0x11')]('YYYY-MM-DD'))[_0x7f5a('0x12')]()[_0x7f5a('0x11')](),'$lte':moment(moment(_0x117772[_0x7f5a('0x13')])[_0x7f5a('0x11')]('YYYY-MM-DD'))[_0x7f5a('0x12')]()[_0x7f5a('0x14')](0x1,'s')[_0x7f5a('0x11')]()};_0x25efad[_0xc6795b]=_0x4ce5c2;}else if(_0x405223[_0x7f5a('0x15')]==='uniqueid'){_0x25efad[_0xc6795b]=_0x55ca4b;}else{_0x25efad[_0xc6795b]=_[_0x7f5a('0x16')](_0x55ca4b)?_0x55ca4b:JSON[_0x7f5a('0x3')](_0x55ca4b);}}else{_0x25efad[_0xc6795b]=_['isArray'](_0x55ca4b)?_0x55ca4b:JSON['parse'](_0x55ca4b);}}catch(_0x137dea){_0x25efad[_0xc6795b]=_0x55ca4b[_0x7f5a('0x17')](',');}});}return _0x25efad;};exports[_0x7f5a('0x18')]=function(_0x90c080){_0x90c080=parseInt(_0x90c080,0xa);if(!_0x90c080||_0x90c080<0x0){_0x90c080=LIMIT_VALUE;}return _0x90c080;};exports[_0x7f5a('0x19')]=function(_0xa06d71){_0xa06d71=parseInt(_0xa06d71,0xa);if(!_0xa06d71||_0xa06d71<0x0){_0xa06d71=0x0;}return _0xa06d71;};exports[_0x7f5a('0x1a')]=function(_0x440a5f){var _0x589a64,_0x4b8d6b=null;if(_0x440a5f){_0x589a64=_0x440a5f[_0x7f5a('0x17')](',');_0x4b8d6b=_['map'](_0x589a64,function(_0x1a4734){if(_0x1a4734['indexOf']('-')===0x0){return[_0x1a4734===_0x7f5a('0x1b')?sequelize[_0x7f5a('0x1c')](sequelize[_0x7f5a('0x1d')](_0x7f5a('0x1b')),_0x7f5a('0x1e')):_0x1a4734['substr'](0x1),_0x7f5a('0x1f')];}else{return[_0x1a4734==='priority'?sequelize[_0x7f5a('0x1c')](sequelize[_0x7f5a('0x1d')]('priority'),_0x7f5a('0x1e')):_0x1a4734,'ASC'];}});}return _0x4b8d6b;};exports[_0x7f5a('0x20')]=function(_0x2bfbfe,_0x3d0d6b){if(_[_0x7f5a('0xa')](_0x2bfbfe)){return _0x2bfbfe;}if(_['isArray'](_0x2bfbfe)){for(var _0xf07e85=0x0;_0xf07e85<_0x2bfbfe[_0x7f5a('0x21')];_0xf07e85+=0x1){_0x2bfbfe[_0xf07e85]=this[_0x7f5a('0x20')](_0x2bfbfe[_0xf07e85],_0x3d0d6b);}return _0x2bfbfe;}if(!_[_0x7f5a('0x22')](_0x2bfbfe)){return _0x2bfbfe;}if(_['isString'](_0x3d0d6b)){_0x3d0d6b=[_0x3d0d6b];}if(!_['isArray'](_0x3d0d6b)){return _0x2bfbfe;}for(var _0x550e81=0x0;_0x550e81<_0x3d0d6b[_0x7f5a('0x21')];_0x550e81+=0x1){_[_0x7f5a('0x23')](_0x2bfbfe,_0x3d0d6b[_0x550e81]);}for(var _0x332baa in _0x2bfbfe){if(_0x2bfbfe['hasOwnProperty'](_0x332baa)){_0x2bfbfe[_0x332baa]=this[_0x7f5a('0x20')](_0x2bfbfe[_0x332baa],_0x3d0d6b);}}return _0x2bfbfe;};exports['isNumeric']=function(_0x347d5c){return _0x347d5c[_0x7f5a('0x24')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0x7f5a('0x25')]=function(_0x33d54c){return _0x33d54c[_0x7f5a('0x24')](/^\S+@\S+$/)?!![]:![];};exports[_0x7f5a('0x26')]=function(_0x1db97,_0x974d87){var _0xe0e60f=[];var _0x9cc236=/[ `!@#$%^&*()_\-?~]/;var _0x5d706c=_0x974d87?_0x7f5a('0x27'):'{EXPR}';_0x1db97['split'](/[ ,]+/)['forEach'](function(_0x2ed581){_0x2ed581=_0x2ed581[_0x7f5a('0x28')](/([^:]")"+/g,'$1');_0x2ed581='+'+_0x2ed581+'*';var _0x276c8c=_0x2ed581[_0x7f5a('0x24')](_0x9cc236);if(_0x276c8c){_0x2ed581='\x22'+_0x2ed581+'\x22';}_0xe0e60f[_0x7f5a('0x29')](_0x2ed581);});_0x5d706c=_0x5d706c['replace'](_0x7f5a('0x2a'),_0xe0e60f['join']('\x20'));return _0x5d706c;};exports[_0x7f5a('0x2b')]=function(_0x5ecb31,_0x777184,_0x2e6964){var _0x3bf019={},_0x5d24cc={};if(_0x777184['query'][_0x7f5a('0x2c')]){_0x777184[_0x7f5a('0x2d')]['id']=_0x777184[_0x7f5a('0x2d')]['$id'];delete _0x777184[_0x7f5a('0x2d')]['$id'];}_0x3bf019['model']=_[_0x7f5a('0x2e')](_0x5ecb31,_0x7f5a('0x15'));_0x3bf019['query']=_[_0x7f5a('0x4')](_0x777184[_0x7f5a('0x2d')]);_0x3bf019[_0x7f5a('0x9')]=_[_0x7f5a('0x2f')](_0x3bf019[_0x7f5a('0x6')],_0x3bf019['query']);_0x5d24cc['attributes']=_['intersection'](_0x3bf019['model'],this[_0x7f5a('0x8')](_0x777184['query'][_0x7f5a('0x8')]));_0x5d24cc[_0x7f5a('0x30')]=_0x5d24cc[_0x7f5a('0x30')][_0x7f5a('0x21')]?_0x5d24cc[_0x7f5a('0x30')]:_0x3bf019['model'];if(!_0x777184[_0x7f5a('0x2d')]['hasOwnProperty'](_0x7f5a('0x31'))){_0x5d24cc[_0x7f5a('0x18')]=this[_0x7f5a('0x18')](_0x777184['query'][_0x7f5a('0x18')]);_0x5d24cc['offset']=this[_0x7f5a('0x19')](_0x777184[_0x7f5a('0x2d')]['offset']);}_0x5d24cc['order']=this['sort'](_0x777184[_0x7f5a('0x2d')]['sort']);_0x5d24cc['where']=this[_0x7f5a('0x9')](_[_0x7f5a('0x32')](_0x777184[_0x7f5a('0x2d')],_0x3bf019[_0x7f5a('0x9')]),_0x5ecb31);if(_0x777184[_0x7f5a('0x2d')][_0x7f5a('0x33')]){var _0x121fdf=_0x5ecb31;var _0x29b022=_0x777184[_0x7f5a('0x2d')][_0x7f5a('0x33')];if(typeof _0x29b022===_0x7f5a('0x34')){_0x121fdf=_['filter'](_0x5ecb31,function(_0x15d141){return _['includes'](_0x29b022[_0x7f5a('0x35')],_0x15d141[_0x7f5a('0x15')]);});_0x29b022=_0x29b022[_0x7f5a('0x36')];}_0x5d24cc['where']=_[_0x7f5a('0x37')](_0x5d24cc[_0x7f5a('0x38')],{'$or':_[_0x7f5a('0x2e')](_0x121fdf,function(_0xf36d39){if(_0xf36d39[_0x7f5a('0xd')]!==_0x7f5a('0x39')){if(_0x2e6964){return sequelize[_0x7f5a('0x38')](sequelize['fn']('lower',sequelize[_0x7f5a('0x1d')](_0xf36d39[_0x7f5a('0x15')])),{'$like':sequelize['fn'](_0x7f5a('0x3a'),'%'+_0x777184[_0x7f5a('0x2d')][_0x7f5a('0x33')]+'%')});}else{var _0x3c4325={};_0x3c4325[_0xf36d39['name']]={'$like':'%'+_0x777184[_0x7f5a('0x2d')][_0x7f5a('0x33')]+'%'};return _0x3c4325;}}})});}_0x5d24cc=_[_0x7f5a('0x37')]({},_0x5d24cc,_0x777184[_0x7f5a('0x3b')]);return _0x5d24cc;};exports['include']=function(_0x2d6242){var _0x340d5b=[];if(_0x2d6242[_0x7f5a('0x3c')]){_0x340d5b[_0x7f5a('0x29')]({'all':!![]});}else if(_0x2d6242[_0x7f5a('0x3d')]){if(Array[_0x7f5a('0x16')](_0x2d6242[_0x7f5a('0x3d')])){_0x340d5b=Object[_0x7f5a('0x4')](_0x2d6242[_0x7f5a('0x3d')])[_0x7f5a('0x2e')](function(_0x3ef20a){return parseIncludeModel(_0x2d6242[_0x7f5a('0x3d')][_0x3ef20a]);});}else{var _0xaabf0f=parseIncludeModel(_0x2d6242[_0x7f5a('0x3d')]);_0x340d5b['push'](_0xaabf0f);}}return _0x340d5b;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 8546c57..c9d7191 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4af8=['getRealtimeAgents','busy','getAgentStatus','isArray','Queue','map','findOne','getAgents','all','flatten','uniq','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','User','name','fullname','faxPause','smsPause','pauseType','fields','startsWith','DESC','ASC','internal','substring','sort','globalStatus','toLowerCase','lastLoginAt','lastPauseAt','address','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','mailStatus','smsStatus','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','voiceStatusTime','destconnectedlinenum','phoneBarEnableAutomaticScreenRecording','online','omit','pick','filterAgentAttributes','role','userpic','faxStatusTime','whatsappCurrentCapacity','onhold','queue','screenrecording','getRealtimeAgentsQueryFields','http','client','chatPause','mailPause','openchannelPause','voicePause','whatsappPause','filter','length','idle','unknown','unavailable','ringing','pause','every','chatStatus','faxStatus','openchannelStatus','voiceStatus','whatsappStatus','Agents','then','error','result','merge','catch'];(function(_0x3181cc,_0x28447f){var _0x547a4a=function(_0x3ede80){while(--_0x3ede80){_0x3181cc['push'](_0x3181cc['shift']());}};_0x547a4a(++_0x28447f);}(_0x4af8,0x1ad));var _0x84af=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x4af8[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var jayson=require('jayson/promise');var db=require('../../mysqldb')['db'];var amiClient=jayson['client'][_0x84af('0x0')]({'port':0x232a});var routingClient=jayson[_0x84af('0x1')][_0x84af('0x0')]({'port':0x232c});function isAgentPaused(_0x1446d3,_0x482825){var _0x294e04=[_0x1446d3[_0x84af('0x2')],_0x1446d3['faxPause'],_0x1446d3[_0x84af('0x3')],_0x1446d3[_0x84af('0x4')],_0x1446d3['smsPause'],_0x1446d3[_0x84af('0x5')],_0x1446d3[_0x84af('0x6')]];if(!_0x482825)return _['every'](_0x294e04);var _0x5b5e45=_[_0x84af('0x7')](_0x294e04);return _0x5b5e45[_0x84af('0x8')]>0x0&&_0x5b5e45['length']<_0x294e04[_0x84af('0x8')]?!![]:![];}function isIdle(_0x535556){return _0x535556===_0x84af('0x9')||_0x535556===_0x84af('0xa')||_0x535556===_0x84af('0xb')||_0x535556===_0x84af('0xc')||_['isNil'](_0x535556);}function isAgentIdle(_0x31f283){if(_0x31f283['voiceStatus']!==_0x84af('0x9')&&_0x31f283[_0x84af('0x5')]){_0x31f283['voiceStatus']=_0x84af('0xd');return![];}return _[_0x84af('0xe')]([_0x31f283[_0x84af('0xf')],_0x31f283[_0x84af('0x10')],_0x31f283['mailStatus'],_0x31f283[_0x84af('0x11')],_0x31f283['smsStatus'],_0x31f283[_0x84af('0x12')],_0x31f283[_0x84af('0x13')]],isIdle);}function getRealtimeAgents(){return amiClient['request'](_0x84af('0x14'),{})[_0x84af('0x15')](function(_0x49c38d){if(_0x49c38d[_0x84af('0x16')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x3c7b43=_0x49c38d[_0x84af('0x17')];return routingClient['request']('Agents',{})[_0x84af('0x15')](function(_0xd8120b){if(_0xd8120b[_0x84af('0x16')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x4d0cf0=_0xd8120b[_0x84af('0x17')];return _[_0x84af('0x18')]({},_0x3c7b43,_0x4d0cf0);});})[_0x84af('0x19')](function(_0x13e2be){throw _0x13e2be;});}exports[_0x84af('0x1a')]=getRealtimeAgents;function getAgentStatus(_0xad929e){var _0x44e19b=_0x84af('0xa');if(isAgentPaused(_0xad929e))_0x44e19b=_0x84af('0xd');else if(isAgentPaused(_0xad929e,!![]))_0x44e19b='*pause';else if(isAgentIdle(_0xad929e))_0x44e19b=_0x84af('0x9');else _0x44e19b=_0x84af('0x1b');return _0x44e19b;}exports[_0x84af('0x1c')]=getAgentStatus;function getAgentIdsByQueues(_0x4ee3d1,_0x2f40d6){var _0xaea1ea=_[_0x84af('0x1d')](_0x4ee3d1)?_0x4ee3d1:[_0x4ee3d1];var _0x5af3ce=_['startCase'](_0x2f40d6)+_0x84af('0x1e');var _0x2a73ff=_[_0x84af('0x1f')](_0xaea1ea,function(_0x24aa07){return db[_0x5af3ce][_0x84af('0x20')]({'where':{'id':_0x24aa07}})[_0x84af('0x15')](function(_0x2e5ff4){if(!_0x2e5ff4)return[];return _0x2e5ff4[_0x84af('0x21')]({'attributes':['id'],'raw':!![]});});});return Promise[_0x84af('0x22')](_0x2a73ff)[_0x84af('0x15')](function(_0x40ca9d){var _0x52ec78=_(_0x40ca9d)[_0x84af('0x23')]()[_0x84af('0x1f')]('id')[_0x84af('0x24')]()[_0x84af('0x25')]();return _0x52ec78;});}exports[_0x84af('0x26')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x881a95,_0x6e50b,_0x4c01e3){try{if(_0x6e50b[_0x84af('0x8')]>0x0){_0x881a95=_0x881a95[_0x84af('0x7')](function(_0x59417e){return _0x6e50b[_0x84af('0x27')](_0x59417e['id']);});}var _0x1f5d85=_0x881a95[_0x84af('0x7')](function(_0x42fb39){var _0x5e124a='busy';if(isAgentIdle(_0x42fb39)){_0x5e124a=_0x84af('0x9');}return _0x5e124a===_0x4c01e3;});return _[_0x84af('0x1f')](_0x1f5d85,'id');}catch(_0x238d03){throw _0x238d03;}}exports[_0x84af('0x28')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x302e67,_0x91a269,_0x47bdda){return Promise[_0x84af('0x29')]()[_0x84af('0x15')](function(){if(_0x91a269['length']>0x0){_0x302e67=_0x302e67[_0x84af('0x7')](function(_0x27a45e){return _0x91a269['includes'](_0x27a45e['id']);});}return _0x302e67;})['then'](function(){return db[_0x84af('0x2a')]['findAll']({'attributes':['id',_0x84af('0x2b'),_0x84af('0x2c'),'chatPause',_0x84af('0x2d'),_0x84af('0x3'),_0x84af('0x4'),_0x84af('0x2e'),_0x84af('0x5'),_0x84af('0x6'),_0x84af('0x2f')],'where':{'id':{'$in':_[_0x84af('0x1f')](_0x302e67,'id')}},'raw':!![]});})[_0x84af('0x15')](function(_0x2c2ee7){return _0x2c2ee7['map'](function(_0x1b5fc7){var _0x51cb6c=_['find'](_0x302e67,['id',_0x1b5fc7['id']]);var _0xea9e91=filterAgentAttributes(_0x51cb6c);_['merge'](_0x1b5fc7,_0xea9e91);_0x1b5fc7['globalStatus']=getAgentStatus(_0x1b5fc7);return _0x1b5fc7;});})[_0x84af('0x15')](function(_0x284826){var _0x292a0e=sortAgentsByStatus(_0x284826,_0x47bdda);return _['map'](_0x292a0e,'id');})[_0x84af('0x19')](function(_0x3b4389){throw _0x3b4389;});}exports['getSortedAgentsIdsByStatus']=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x663d64){var _0x41be31={'fields':[],'order':null};var _0x4b7dab=_0x663d64['split'](',');_0x41be31[_0x84af('0x30')]=_['filter'](_0x4b7dab,function(_0x2dca64){if(!_0x2dca64[_0x84af('0x27')]('globalStatus')){return!![];}_0x41be31['order']=_[_0x84af('0x31')](_0x2dca64,'-')?_0x84af('0x32'):_0x84af('0x33');return![];});return _0x41be31;}exports['getUpdatedSortOptions']=getUpdatedSortOptions;function validateSortParameter(_0x3bd070){if(!_0x3bd070){_0x3bd070='fullname,internal';}if(_0x3bd070['includes'](_0x84af('0x2c'))&&!_0x3bd070['includes'](_0x84af('0x34'))){var _0x4717e1=_0x3bd070[_0x84af('0x35')](0x0,_0x3bd070['indexOf'](_0x84af('0x2c')));_0x3bd070+=','+_0x4717e1+_0x84af('0x34');}return _0x3bd070;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0x4769ee,_0x355150){var _0x1d0f94=_0x4769ee[_0x84af('0x36')](function(_0x4f096b,_0x14608f){if(_0x4f096b[_0x84af('0x37')]===_0x14608f['globalStatus']){if(_0x4f096b[_0x84af('0x37')]===_0x84af('0xd')){if(_0x355150===_0x84af('0x32')){return(_0x4f096b[_0x84af('0x2f')]||'')<(_0x14608f['pauseType']||'')||_0x4f096b[_0x84af('0x2c')][_0x84af('0x38')]()>_0x14608f[_0x84af('0x2c')][_0x84af('0x38')]()?0x1:-0x1;}else{return(_0x4f096b[_0x84af('0x2f')]||'')<(_0x14608f[_0x84af('0x2f')]||'')||_0x4f096b['fullname'][_0x84af('0x38')]()>_0x14608f['fullname'][_0x84af('0x38')]()?-0x1:0x1;}}else{if(_0x355150===_0x84af('0x32')){return _0x4f096b['fullname'][_0x84af('0x38')]()<_0x14608f[_0x84af('0x2c')][_0x84af('0x38')]()?0x1:-0x1;}else{return _0x4f096b[_0x84af('0x2c')][_0x84af('0x38')]()<_0x14608f[_0x84af('0x2c')][_0x84af('0x38')]()?-0x1:0x1;}}}else{if(_0x355150===_0x84af('0x32')){return _0x4f096b[_0x84af('0x37')]<_0x14608f[_0x84af('0x37')]?0x1:-0x1;}else{return _0x4f096b[_0x84af('0x37')]<_0x14608f['globalStatus']?-0x1:0x1;}}});return _0x1d0f94;}exports['sortAgentsByStatus']=sortAgentsByStatus;function filterAgentAttributes(_0x4145dd){var _0x594dbd=['userpic','online',_0x84af('0x39'),_0x84af('0x3a'),_0x84af('0x2f'),_0x84af('0x3a'),_0x84af('0x34'),_0x84af('0x3b'),_0x84af('0x2'),'openchannelPause',_0x84af('0x3'),_0x84af('0x2e'),'whatsappPause',_0x84af('0x2d'),_0x84af('0x5'),'chatCapacity',_0x84af('0x3c'),_0x84af('0x3d'),_0x84af('0x3e'),_0x84af('0x3f'),_0x84af('0x40'),_0x84af('0x41'),_0x84af('0x42'),'mailCurrentCapacity',_0x84af('0x43'),'whatsappCurrentCapacity',_0x84af('0x44'),_0x84af('0xf'),_0x84af('0x11'),_0x84af('0x45'),_0x84af('0x46'),_0x84af('0x13'),'faxStatus',_0x84af('0x12'),_0x84af('0x47'),_0x84af('0x48'),_0x84af('0x49'),_0x84af('0x4a'),_0x84af('0x4b'),'faxStatusTime',_0x84af('0x4c'),'queue',_0x84af('0x4d'),'screenrecording','phoneBarEnableScreenRecordingByAgent',_0x84af('0x4e')];var _0x60a939=[_0x84af('0x2'),_0x84af('0x4'),_0x84af('0x3'),_0x84af('0x2e'),_0x84af('0x6'),_0x84af('0x2d'),_0x84af('0x5'),_0x84af('0x4f')];var _0x3bf724=_(_0x4145dd)[_0x84af('0x50')](_0x60a939)[_0x84af('0x51')](_0x594dbd)[_0x84af('0x25')]();return _0x3bf724;}exports[_0x84af('0x52')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x84af('0x2b'),_0x84af('0x2c'),_0x84af('0x53'),_0x84af('0x34'),_0x84af('0x4f'),_0x84af('0x37'),_0x84af('0x54'),'lastLoginAt',_0x84af('0x2f'),_0x84af('0x3a'),'faxPause',_0x84af('0x2'),'mailPause','openchannelPause',_0x84af('0x2e'),_0x84af('0x5'),'whatsappPause',_0x84af('0xf'),_0x84af('0x10'),_0x84af('0x45'),_0x84af('0x11'),_0x84af('0x46'),_0x84af('0x12'),'whatsappStatus',_0x84af('0x47'),_0x84af('0x55'),_0x84af('0x49'),_0x84af('0x48'),_0x84af('0x4a'),_0x84af('0x4c'),_0x84af('0x4b'),'chatCapacity',_0x84af('0x40'),'mailCapacity',_0x84af('0x3c'),'smsCapacity',_0x84af('0x3f'),_0x84af('0x41'),'faxCurrentCapacity','mailCurrentCapacity',_0x84af('0x42'),'smsCurrentCapacity',_0x84af('0x56'),'phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','destconnectedlinenum',_0x84af('0x57'),_0x84af('0x58'),_0x84af('0x59')];}exports[_0x84af('0x5a')]=getRealtimeAgentsQueryFields; \ No newline at end of file +var _0xb6a6=['smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','voiceStatusTime','queue','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','pick','filterAgentAttributes','openchannelStatus','mailCurrentCapacity','whatsappCurrentCapacity','destconnectedlinenum','onhold','getRealtimeAgentsQueryFields','lodash','jayson/promise','http','client','chatPause','faxPause','mailPause','smsPause','voicePause','every','length','idle','ringing','isNil','pause','faxStatus','mailStatus','smsStatus','voiceStatus','whatsappStatus','request','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Agents','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','catch','getRealtimeAgents','unknown','isArray','startCase','Queue','map','getAgents','flatten','uniq','filter','busy','getAgentIdsByStatus','resolve','includes','User','findAll','name','fullname','openchannelPause','whatsappPause','pauseType','find','merge','globalStatus','getSortedAgentsIdsByStatus','split','fields','order','startsWith','DESC','ASC','getUpdatedSortOptions','fullname,internal','internal','indexOf','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','chatCapacity','openchannelCapacity','mailCapacity'];(function(_0x16bb4b,_0x5fe431){var _0x8aeb84=function(_0x36ba6e){while(--_0x36ba6e){_0x16bb4b['push'](_0x16bb4b['shift']());}};_0x8aeb84(++_0x5fe431);}(_0xb6a6,0x1a0));var _0x6b6a=function(_0x388932,_0x140e78){_0x388932=_0x388932-0x0;var _0x252ae4=_0xb6a6[_0x388932];return _0x252ae4;};'use strict';var _=require(_0x6b6a('0x0'));var jayson=require(_0x6b6a('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson['client'][_0x6b6a('0x2')]({'port':0x232a});var routingClient=jayson[_0x6b6a('0x3')][_0x6b6a('0x2')]({'port':0x232c});function isAgentPaused(_0x8abe65,_0xe80650){var _0x494fb4=[_0x8abe65[_0x6b6a('0x4')],_0x8abe65[_0x6b6a('0x5')],_0x8abe65[_0x6b6a('0x6')],_0x8abe65['openchannelPause'],_0x8abe65[_0x6b6a('0x7')],_0x8abe65[_0x6b6a('0x8')],_0x8abe65['whatsappPause']];if(!_0xe80650)return _[_0x6b6a('0x9')](_0x494fb4);var _0x15ccc9=_['filter'](_0x494fb4);return _0x15ccc9[_0x6b6a('0xa')]>0x0&&_0x15ccc9['length']<_0x494fb4[_0x6b6a('0xa')]?!![]:![];}function isIdle(_0x39fc5b){return _0x39fc5b===_0x6b6a('0xb')||_0x39fc5b==='unknown'||_0x39fc5b==='unavailable'||_0x39fc5b===_0x6b6a('0xc')||_[_0x6b6a('0xd')](_0x39fc5b);}function isAgentIdle(_0x47c2dd){if(_0x47c2dd['voiceStatus']!==_0x6b6a('0xb')&&_0x47c2dd[_0x6b6a('0x8')]){_0x47c2dd['voiceStatus']=_0x6b6a('0xe');return![];}return _[_0x6b6a('0x9')]([_0x47c2dd['chatStatus'],_0x47c2dd[_0x6b6a('0xf')],_0x47c2dd[_0x6b6a('0x10')],_0x47c2dd['openchannelStatus'],_0x47c2dd[_0x6b6a('0x11')],_0x47c2dd[_0x6b6a('0x12')],_0x47c2dd[_0x6b6a('0x13')]],isIdle);}function getRealtimeAgents(){return amiClient[_0x6b6a('0x14')]('Agents',{})[_0x6b6a('0x15')](function(_0x3b58cb){if(_0x3b58cb['error']){throw new Error(_0x6b6a('0x16'));}var _0x12faf8=_0x3b58cb[_0x6b6a('0x17')];return routingClient[_0x6b6a('0x14')](_0x6b6a('0x18'),{})['then'](function(_0x36c02e){if(_0x36c02e[_0x6b6a('0x19')]){throw new Error(_0x6b6a('0x1a'));}var _0x580d86=_0x36c02e[_0x6b6a('0x17')];return _['merge']({},_0x12faf8,_0x580d86);});})[_0x6b6a('0x1b')](function(_0x7a82bc){throw _0x7a82bc;});}exports[_0x6b6a('0x1c')]=getRealtimeAgents;function getAgentStatus(_0x351306){var _0x84b0e5=_0x6b6a('0x1d');if(isAgentPaused(_0x351306))_0x84b0e5='pause';else if(isAgentPaused(_0x351306,!![]))_0x84b0e5='*pause';else if(isAgentIdle(_0x351306))_0x84b0e5=_0x6b6a('0xb');else _0x84b0e5='busy';return _0x84b0e5;}exports['getAgentStatus']=getAgentStatus;function getAgentIdsByQueues(_0x1edaf0,_0x4c29eb){var _0x7f44b1=_[_0x6b6a('0x1e')](_0x1edaf0)?_0x1edaf0:[_0x1edaf0];var _0x1327e9=_[_0x6b6a('0x1f')](_0x4c29eb)+_0x6b6a('0x20');var _0xcea9de=_[_0x6b6a('0x21')](_0x7f44b1,function(_0x8dffc0){return db[_0x1327e9]['findOne']({'where':{'id':_0x8dffc0}})['then'](function(_0x4d0f5d){if(!_0x4d0f5d)return[];return _0x4d0f5d[_0x6b6a('0x22')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0xcea9de)[_0x6b6a('0x15')](function(_0x4c4ca5){var _0x56f08f=_(_0x4c4ca5)[_0x6b6a('0x23')]()['map']('id')[_0x6b6a('0x24')]()['value']();return _0x56f08f;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x5ce125,_0x30f322,_0x207a1b){try{if(_0x30f322[_0x6b6a('0xa')]>0x0){_0x5ce125=_0x5ce125['filter'](function(_0xa6ce4b){return _0x30f322['includes'](_0xa6ce4b['id']);});}var _0x12a4d2=_0x5ce125[_0x6b6a('0x25')](function(_0x313f20){var _0x2278e0=_0x6b6a('0x26');if(isAgentIdle(_0x313f20)){_0x2278e0=_0x6b6a('0xb');}return _0x2278e0===_0x207a1b;});return _['map'](_0x12a4d2,'id');}catch(_0x484f6d){throw _0x484f6d;}}exports[_0x6b6a('0x27')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x5edac0,_0x4b68eb,_0x57e5b7){return Promise[_0x6b6a('0x28')]()[_0x6b6a('0x15')](function(){if(_0x4b68eb[_0x6b6a('0xa')]>0x0){_0x5edac0=_0x5edac0[_0x6b6a('0x25')](function(_0x31384d){return _0x4b68eb[_0x6b6a('0x29')](_0x31384d['id']);});}return _0x5edac0;})[_0x6b6a('0x15')](function(){return db[_0x6b6a('0x2a')][_0x6b6a('0x2b')]({'attributes':['id',_0x6b6a('0x2c'),_0x6b6a('0x2d'),_0x6b6a('0x4'),'faxPause',_0x6b6a('0x6'),_0x6b6a('0x2e'),_0x6b6a('0x7'),_0x6b6a('0x8'),_0x6b6a('0x2f'),_0x6b6a('0x30')],'where':{'id':{'$in':_['map'](_0x5edac0,'id')}},'raw':!![]});})[_0x6b6a('0x15')](function(_0x134c77){return _0x134c77[_0x6b6a('0x21')](function(_0x5c6416){var _0x1d23e=_[_0x6b6a('0x31')](_0x5edac0,['id',_0x5c6416['id']]);var _0x11b8f7=filterAgentAttributes(_0x1d23e);_[_0x6b6a('0x32')](_0x5c6416,_0x11b8f7);_0x5c6416[_0x6b6a('0x33')]=getAgentStatus(_0x5c6416);return _0x5c6416;});})['then'](function(_0x371ccf){var _0x559522=sortAgentsByStatus(_0x371ccf,_0x57e5b7);return _[_0x6b6a('0x21')](_0x559522,'id');})[_0x6b6a('0x1b')](function(_0x1fda57){throw _0x1fda57;});}exports[_0x6b6a('0x34')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x4025c4){var _0x2dbde3={'fields':[],'order':null};var _0x2caa9a=_0x4025c4[_0x6b6a('0x35')](',');_0x2dbde3[_0x6b6a('0x36')]=_['filter'](_0x2caa9a,function(_0x31782f){if(!_0x31782f[_0x6b6a('0x29')](_0x6b6a('0x33'))){return!![];}_0x2dbde3[_0x6b6a('0x37')]=_[_0x6b6a('0x38')](_0x31782f,'-')?_0x6b6a('0x39'):_0x6b6a('0x3a');return![];});return _0x2dbde3;}exports[_0x6b6a('0x3b')]=getUpdatedSortOptions;function validateSortParameter(_0x2c1959){if(!_0x2c1959){_0x2c1959=_0x6b6a('0x3c');}if(_0x2c1959[_0x6b6a('0x29')](_0x6b6a('0x2d'))&&!_0x2c1959[_0x6b6a('0x29')](_0x6b6a('0x3d'))){var _0x19c361=_0x2c1959['substring'](0x0,_0x2c1959[_0x6b6a('0x3e')](_0x6b6a('0x2d')));_0x2c1959+=','+_0x19c361+_0x6b6a('0x3d');}return _0x2c1959;}exports[_0x6b6a('0x3f')]=validateSortParameter;function sortAgentsByStatus(_0x62ff02,_0x110482){var _0x445a2f=_0x62ff02[_0x6b6a('0x40')](function(_0x55580f,_0x2d4cd1){if(_0x55580f[_0x6b6a('0x33')]===_0x2d4cd1['globalStatus']){if(_0x55580f[_0x6b6a('0x33')]===_0x6b6a('0xe')){if(_0x110482===_0x6b6a('0x39')){return(_0x55580f[_0x6b6a('0x30')]||'')<(_0x2d4cd1[_0x6b6a('0x30')]||'')||_0x55580f[_0x6b6a('0x2d')]['toLowerCase']()>_0x2d4cd1[_0x6b6a('0x2d')][_0x6b6a('0x41')]()?0x1:-0x1;}else{return(_0x55580f[_0x6b6a('0x30')]||'')<(_0x2d4cd1['pauseType']||'')||_0x55580f[_0x6b6a('0x2d')]['toLowerCase']()>_0x2d4cd1['fullname'][_0x6b6a('0x41')]()?-0x1:0x1;}}else{if(_0x110482==='DESC'){return _0x55580f['fullname'][_0x6b6a('0x41')]()<_0x2d4cd1[_0x6b6a('0x2d')]['toLowerCase']()?0x1:-0x1;}else{return _0x55580f[_0x6b6a('0x2d')][_0x6b6a('0x41')]()<_0x2d4cd1['fullname'][_0x6b6a('0x41')]()?-0x1:0x1;}}}else{if(_0x110482===_0x6b6a('0x39')){return _0x55580f[_0x6b6a('0x33')]<_0x2d4cd1['globalStatus']?0x1:-0x1;}else{return _0x55580f[_0x6b6a('0x33')]<_0x2d4cd1['globalStatus']?-0x1:0x1;}}});return _0x445a2f;}exports[_0x6b6a('0x42')]=sortAgentsByStatus;function filterAgentAttributes(_0x315709){var _0x5264d2=[_0x6b6a('0x43'),_0x6b6a('0x44'),_0x6b6a('0x45'),_0x6b6a('0x46'),_0x6b6a('0x30'),_0x6b6a('0x46'),'internal','address',_0x6b6a('0x4'),_0x6b6a('0x2e'),_0x6b6a('0x6'),'smsPause',_0x6b6a('0x2f'),_0x6b6a('0x5'),_0x6b6a('0x8'),_0x6b6a('0x47'),_0x6b6a('0x48'),_0x6b6a('0x49'),_0x6b6a('0x4a'),_0x6b6a('0x4b'),_0x6b6a('0x4c'),_0x6b6a('0x4d'),_0x6b6a('0x4e'),'mailCurrentCapacity',_0x6b6a('0x4f'),'whatsappCurrentCapacity',_0x6b6a('0x50'),'chatStatus','openchannelStatus','mailStatus',_0x6b6a('0x11'),'whatsappStatus','faxStatus','voiceStatus',_0x6b6a('0x51'),_0x6b6a('0x52'),_0x6b6a('0x53'),_0x6b6a('0x54'),_0x6b6a('0x55'),'faxStatusTime',_0x6b6a('0x56'),_0x6b6a('0x57'),'destconnectedlinenum','screenrecording',_0x6b6a('0x58'),_0x6b6a('0x59')];var _0x15fac4=['chatPause',_0x6b6a('0x2e'),_0x6b6a('0x6'),_0x6b6a('0x7'),_0x6b6a('0x2f'),_0x6b6a('0x5'),'voicePause',_0x6b6a('0x44')];var _0x216659=_(_0x315709)['omit'](_0x15fac4)[_0x6b6a('0x5a')](_0x5264d2)['value']();return _0x216659;}exports[_0x6b6a('0x5b')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0x6b6a('0x2c'),_0x6b6a('0x2d'),'role',_0x6b6a('0x3d'),'online',_0x6b6a('0x33'),'userpic','lastLoginAt',_0x6b6a('0x30'),_0x6b6a('0x46'),_0x6b6a('0x5'),_0x6b6a('0x4'),'mailPause',_0x6b6a('0x2e'),_0x6b6a('0x7'),_0x6b6a('0x8'),_0x6b6a('0x2f'),'chatStatus',_0x6b6a('0xf'),_0x6b6a('0x10'),_0x6b6a('0x5c'),'smsStatus',_0x6b6a('0x12'),_0x6b6a('0x13'),_0x6b6a('0x51'),'faxStatusTime',_0x6b6a('0x53'),_0x6b6a('0x52'),_0x6b6a('0x54'),_0x6b6a('0x56'),_0x6b6a('0x55'),'chatCapacity',_0x6b6a('0x4c'),_0x6b6a('0x49'),_0x6b6a('0x48'),_0x6b6a('0x4a'),_0x6b6a('0x4b'),_0x6b6a('0x4d'),_0x6b6a('0x50'),_0x6b6a('0x5d'),_0x6b6a('0x4e'),_0x6b6a('0x4f'),_0x6b6a('0x5e'),_0x6b6a('0x58'),_0x6b6a('0x59'),_0x6b6a('0x5f'),_0x6b6a('0x60'),'queue','screenrecording'];}exports[_0x6b6a('0x61')]=getRealtimeAgentsQueryFields; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 2eb4ddf..d6e364f 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd6ec=['request','startCase','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','inbound','concat','outbound','map','get','waiting','busy','pTalking','find','pick','initializeQueues','lodash','http','available','loggedIn','paused','inUse','invalid','loggedInDb','notInUse','onHold','ringInUse','talking','unavailable','unknown','originated','statusMessage','dialActive','dialMethod','Trunk','startPredictive','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgTalktime','voice'];(function(_0x1954f8,_0x4d1cbb){var _0x12e1c2=function(_0x53ca30){while(--_0x53ca30){_0x1954f8['push'](_0x1954f8['shift']());}};_0x12e1c2(++_0x4d1cbb);}(_0xd6ec,0xdb));var _0xcd6e=function(_0x385509,_0x1a9683){_0x385509=_0x385509-0x0;var _0x3b7e5e=_0xd6ec[_0x385509];return _0x3b7e5e;};'use strict';var _=require(_0xcd6e('0x0'));var jayson=require('jayson/promise');var util=require('util');var amiClient=jayson['client'][_0xcd6e('0x1')]({'port':0x232a});var routingClient=jayson['client'][_0xcd6e('0x1')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0xcd6e('0x2'),_0xcd6e('0x3'),_0xcd6e('0x4'),'waiting'];var VOICE_QUEUE_ATTRIBUTES=['busy',_0xcd6e('0x5'),_0xcd6e('0x6'),_0xcd6e('0x7'),_0xcd6e('0x8'),_0xcd6e('0x9'),'ringing',_0xcd6e('0xa'),_0xcd6e('0xb'),_0xcd6e('0xc'),_0xcd6e('0xd')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking',_0xcd6e('0xe'),'message',_0xcd6e('0xf'),_0xcd6e('0x10'),_0xcd6e('0x11'),_0xcd6e('0x12'),_0xcd6e('0x13'),'startProgressive','erlangCalls',_0xcd6e('0x14'),_0xcd6e('0x15'),_0xcd6e('0x16'),_0xcd6e('0x17'),_0xcd6e('0x18'),_0xcd6e('0x19'),'predictiveIntervalAvailable',_0xcd6e('0x1a'),_0xcd6e('0x1b'),'predictiveIntervalDroppedCallsTimeout',_0xcd6e('0x1c'),'predictiveIntervalAvgHoldtime',_0xcd6e('0x1d')];function getRealtimeQueues(_0xfb0a1e,_0x2f0dfe){var _0x678451=_0x2f0dfe===_0xcd6e('0x1e')?amiClient:routingClient;return _0x678451[_0xcd6e('0x1f')](_[_0xcd6e('0x20')](_0x2f0dfe)+'Queues',_0xfb0a1e)['then'](function(_0x348bf1){if(_0x348bf1[_0xcd6e('0x21')])throw new Error(util[_0xcd6e('0x22')](_0xcd6e('0x23'),_0x2f0dfe));return _0x348bf1[_0xcd6e('0x24')];})[_0xcd6e('0x25')](function(_0x1fd8e5){throw _0x1fd8e5;});}exports[_0xcd6e('0x26')]=getRealtimeQueues;function initializeQueues(_0x150b68,_0x4b4720,_0xb98216,_0x2ed4f3){var _0x28bbc7=DEFAULT_QUEUE_ATTRIBUTES;if(_0xb98216===_0xcd6e('0x1e')){if(_0x2ed4f3===_0xcd6e('0x27')){_0x28bbc7=_0x28bbc7[_0xcd6e('0x28')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x2ed4f3===_0xcd6e('0x29')){_0x28bbc7=_0x28bbc7[_0xcd6e('0x28')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x150b68[_0xcd6e('0x2a')](function(_0x2bfe49){var _0x5a9d84=_0x2bfe49[_0xcd6e('0x2b')]({'plain':!![]});_0x5a9d84[_0xcd6e('0x4')]=0x0;_0x5a9d84[_0xcd6e('0x7')]=0x0;_0x5a9d84[_0xcd6e('0x3')]=0x0;_0x5a9d84[_0xcd6e('0x2')]=0x0;_0x5a9d84[_0xcd6e('0x2c')]=0x0;if(_0xb98216==='voice'){_0x5a9d84[_0xcd6e('0xb')]=0x0;_0x5a9d84[_0xcd6e('0x2d')]=0x0;if(_0x2ed4f3===_0xcd6e('0x29')){_0x5a9d84[_0xcd6e('0x2e')]=0x0;_0x5a9d84[_0xcd6e('0xe')]=0x0;}}var _0x6d92b2=_[_0xcd6e('0x2f')](_0x4b4720,['id',_0x5a9d84['id']]);if(_0x6d92b2){_['merge'](_0x5a9d84,_[_0xcd6e('0x30')](_0x6d92b2,_0x28bbc7));}return _0x5a9d84;});}exports[_0xcd6e('0x31')]=initializeQueues; \ No newline at end of file +var _0x0540=['unknown','pTalking','originated','message','dialActive','Trunk','startPredictive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','voice','startCase','then','error','format','result','catch','getRealtimeQueues','concat','get','talking','outbound','find','pick','jayson/promise','client','http','available','paused','waiting','busy','inUse','invalid','loggedInDb','notInUse','onHold','ringing','ringInUse','unavailable'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x0540,0x1c7));var _0x0054=function(_0x17c70f,_0x4ed9b7){_0x17c70f=_0x17c70f-0x0;var _0xa66a2=_0x0540[_0x17c70f];return _0xa66a2;};'use strict';var _=require('lodash');var jayson=require(_0x0054('0x0'));var util=require('util');var amiClient=jayson[_0x0054('0x1')][_0x0054('0x2')]({'port':0x232a});var routingClient=jayson[_0x0054('0x1')][_0x0054('0x2')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x0054('0x3'),'loggedIn',_0x0054('0x4'),_0x0054('0x5')];var VOICE_QUEUE_ATTRIBUTES=[_0x0054('0x6'),_0x0054('0x7'),_0x0054('0x8'),_0x0054('0x9'),_0x0054('0xa'),_0x0054('0xb'),_0x0054('0xc'),_0x0054('0xd'),'talking',_0x0054('0xe'),_0x0054('0xf')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x0054('0x10'),_0x0054('0x11'),_0x0054('0x12'),'statusMessage',_0x0054('0x13'),'dialMethod',_0x0054('0x14'),_0x0054('0x15'),'startProgressive',_0x0054('0x16'),_0x0054('0x17'),_0x0054('0x18'),_0x0054('0x19'),_0x0054('0x1a'),_0x0054('0x1b'),'dialPredictiveIntervalMinThreshold',_0x0054('0x1c'),'predictiveIntervalTotalCalls',_0x0054('0x1d'),'predictiveIntervalDroppedCallsTimeout',_0x0054('0x1e'),_0x0054('0x1f'),_0x0054('0x20')];function getRealtimeQueues(_0x3b647f,_0x4f2a48){var _0x2a5d50=_0x4f2a48===_0x0054('0x21')?amiClient:routingClient;return _0x2a5d50['request'](_[_0x0054('0x22')](_0x4f2a48)+'Queues',_0x3b647f)[_0x0054('0x23')](function(_0x55fec9){if(_0x55fec9[_0x0054('0x24')])throw new Error(util[_0x0054('0x25')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0x4f2a48));return _0x55fec9[_0x0054('0x26')];})[_0x0054('0x27')](function(_0x4805b8){throw _0x4805b8;});}exports[_0x0054('0x28')]=getRealtimeQueues;function initializeQueues(_0x26276f,_0x3a8301,_0xef63f7,_0x4f6531){var _0x21dea1=DEFAULT_QUEUE_ATTRIBUTES;if(_0xef63f7==='voice'){if(_0x4f6531==='inbound'){_0x21dea1=_0x21dea1[_0x0054('0x29')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x4f6531==='outbound'){_0x21dea1=_0x21dea1[_0x0054('0x29')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x26276f['map'](function(_0x2cceea){var _0x2c13c6=_0x2cceea[_0x0054('0x2a')]({'plain':!![]});_0x2c13c6[_0x0054('0x4')]=0x0;_0x2c13c6[_0x0054('0x9')]=0x0;_0x2c13c6['loggedIn']=0x0;_0x2c13c6[_0x0054('0x3')]=0x0;_0x2c13c6['waiting']=0x0;if(_0xef63f7===_0x0054('0x21')){_0x2c13c6[_0x0054('0x2b')]=0x0;_0x2c13c6[_0x0054('0x6')]=0x0;if(_0x4f6531===_0x0054('0x2c')){_0x2c13c6[_0x0054('0x10')]=0x0;_0x2c13c6[_0x0054('0x11')]=0x0;}}var _0x3d2fd2=_[_0x0054('0x2d')](_0x3a8301,['id',_0x2c13c6['id']]);if(_0x3d2fd2){_['merge'](_0x2c13c6,_[_0x0054('0x2e')](_0x3d2fd2,_0x21dea1));}return _0x2c13c6;});}exports['initializeQueues']=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index c084c80..1eaa295 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x2e50a2,_0x27f31e){var _0x47e5de=function(_0x4e1f70){while(--_0x4e1f70){_0x2e50a2['push'](_0x2e50a2['shift']());}};_0x47e5de(++_0x27f31e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x3520b8,_0x2d2034){var _0x262768=function(_0xd3aab){while(--_0xd3aab){_0x3520b8['push'](_0x3520b8['shift']());}};_0x262768(++_0x2d2034);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 5b0d38a..2a32ac3 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 _0xddf9=['IPv4','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','md5','digest','hex','getUuid','platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','ipAddress','update','substring','crypto','bimedia-machine-uuid','child_process','../environment','networkInterfaces','orderBy','length','filter','family'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xddf9,0xc3));var _0x9ddf=function(_0xcf8f87,_0x5f5772){_0xcf8f87=_0xcf8f87-0x0;var _0x485b48=_0xddf9[_0xcf8f87];return _0x485b48;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x9ddf('0x0'));var machine=require(_0x9ddf('0x1'));var exec=require(_0x9ddf('0x2'))['execSync'];var config=require(_0x9ddf('0x3'));function getInterfaces(){var _0xadb580=[];var _0x531875=os[_0x9ddf('0x4')]();var _0x5d2515=_[_0x9ddf('0x5')](_['keys'](_0x531875));for(var _0x2c610c=0x0;_0x2c610c<_0x5d2515[_0x9ddf('0x6')];_0x2c610c++){var _0x3d1dd3=_0x531875[_0x5d2515[_0x2c610c]][_0x9ddf('0x7')](function(_0x9c0a81){return _0x9c0a81[_0x9ddf('0x8')]===_0x9ddf('0x9')&&_0x9c0a81['internal']===![];});_0xadb580=_0xadb580['concat'](_0x3d1dd3);}return _0xadb580;}function getFirstInterface(){var _0x36b46d=_['head'](getInterfaces());return{'macAddress':_0x36b46d&&_0x36b46d[_0x9ddf('0xa')]?_0x36b46d[_0x9ddf('0xa')]:_0x9ddf('0xb'),'ipAddress':_0x36b46d&&_0x36b46d[_0x9ddf('0xc')]?_0x36b46d[_0x9ddf('0xc')]:_0x9ddf('0xd')};}exports[_0x9ddf('0xe')]=getFirstInterface;function getCPUhash(){var _0x1e9212=_[_0x9ddf('0x5')](os[_0x9ddf('0xf')]()[_0x9ddf('0x10')](function(_0x21e4e0){return _0x21e4e0[_0x9ddf('0x11')];}))[_0x9ddf('0x12')](':');return crypto[_0x9ddf('0x13')](_0x9ddf('0x14'))['update'](_0x1e9212)[_0x9ddf('0x15')](_0x9ddf('0x16'));}exports[_0x9ddf('0x17')]=function(){var _0x26fee5=os[_0x9ddf('0x18')]();var _0x116dea=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x116dea['test'](config['licenseToken'])){return config[_0x9ddf('0x19')];}else if(_0x26fee5===_0x9ddf('0x1a')){return exec(_0x9ddf('0x1b'),{'encoding':_0x9ddf('0x1c')})['replace']('\x0d\x0a','');}else{var _0x20e020=getFirstInterface();var _0x146bcd=getCPUhash();var _0x2813d5=_0x146bcd+'|'+os[_0x9ddf('0x1d')]()+'|'+_0x20e020[_0x9ddf('0x1e')]+'|'+_0x20e020[_0x9ddf('0x1f')];var _0x262144=crypto[_0x9ddf('0x13')](_0x9ddf('0x14'))[_0x9ddf('0x20')](_0x2813d5)[_0x9ddf('0x15')](_0x9ddf('0x16'));return _0x262144[_0x9ddf('0x21')](0x0,0x8)+'-'+_0x262144[_0x9ddf('0x21')](0x8,0xc)+'-'+_0x262144[_0x9ddf('0x21')](0xc,0x10)+'-'+_0x262144[_0x9ddf('0x21')](0x10,0x14)+'-'+_0x262144['substring'](0x14);}}; \ No newline at end of file +var _0xac06=['win32','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','ipAddress','substring','execSync','../environment','keys','length','filter','family','IPv4','concat','head','mac','00:00:00:00:00:00','address','getFirstInterface','orderBy','cpus','model','join','createHash','md5','update','digest','hex','platform','licenseToken','test'];(function(_0x2cf4b1,_0x568919){var _0xa06d2e=function(_0x3e0faf){while(--_0x3e0faf){_0x2cf4b1['push'](_0x2cf4b1['shift']());}};_0xa06d2e(++_0x568919);}(_0xac06,0x187));var _0x6ac0=function(_0x32d785,_0x2934f5){_0x32d785=_0x32d785-0x0;var _0x24dcc7=_0xac06[_0x32d785];return _0x24dcc7;};'use strict';var _=require('lodash');var os=require('os');var crypto=require('crypto');var machine=require('bimedia-machine-uuid');var exec=require('child_process')[_0x6ac0('0x0')];var config=require(_0x6ac0('0x1'));function getInterfaces(){var _0x25c700=[];var _0x37a2b5=os['networkInterfaces']();var _0x4fc9dd=_['orderBy'](_[_0x6ac0('0x2')](_0x37a2b5));for(var _0x5788c5=0x0;_0x5788c5<_0x4fc9dd[_0x6ac0('0x3')];_0x5788c5++){var _0xc8995c=_0x37a2b5[_0x4fc9dd[_0x5788c5]][_0x6ac0('0x4')](function(_0x5e2a76){return _0x5e2a76[_0x6ac0('0x5')]===_0x6ac0('0x6')&&_0x5e2a76['internal']===![];});_0x25c700=_0x25c700[_0x6ac0('0x7')](_0xc8995c);}return _0x25c700;}function getFirstInterface(){var _0x4e7aa7=_[_0x6ac0('0x8')](getInterfaces());return{'macAddress':_0x4e7aa7&&_0x4e7aa7[_0x6ac0('0x9')]?_0x4e7aa7[_0x6ac0('0x9')]:_0x6ac0('0xa'),'ipAddress':_0x4e7aa7&&_0x4e7aa7[_0x6ac0('0xb')]?_0x4e7aa7[_0x6ac0('0xb')]:'127.0.0.1'};}exports[_0x6ac0('0xc')]=getFirstInterface;function getCPUhash(){var _0x4f3581=_[_0x6ac0('0xd')](os[_0x6ac0('0xe')]()['map'](function(_0x295c7f){return _0x295c7f[_0x6ac0('0xf')];}))[_0x6ac0('0x10')](':');return crypto[_0x6ac0('0x11')](_0x6ac0('0x12'))[_0x6ac0('0x13')](_0x4f3581)[_0x6ac0('0x14')](_0x6ac0('0x15'));}exports['getUuid']=function(){var _0x2dd727=os[_0x6ac0('0x16')]();var _0x2fc310=/[0-9a-f-]{36}/;if(config[_0x6ac0('0x17')]&&_0x2fc310[_0x6ac0('0x18')](config[_0x6ac0('0x17')])){return config['licenseToken'];}else if(_0x2dd727===_0x6ac0('0x19')){return exec(_0x6ac0('0x1a'),{'encoding':'utf8'})[_0x6ac0('0x1b')]('\x0d\x0a','');}else{var _0x2239ba=getFirstInterface();var _0x361824=getCPUhash();var _0x3eed18=_0x361824+'|'+os[_0x6ac0('0x1c')]()+'|'+_0x2239ba[_0x6ac0('0x1d')]+'|'+_0x2239ba[_0x6ac0('0x1e')];var _0x3c7273=crypto['createHash'](_0x6ac0('0x12'))[_0x6ac0('0x13')](_0x3eed18)['digest'](_0x6ac0('0x15'));return _0x3c7273[_0x6ac0('0x1f')](0x0,0x8)+'-'+_0x3c7273['substring'](0x8,0xc)+'-'+_0x3c7273[_0x6ac0('0x1f')](0xc,0x10)+'-'+_0x3c7273[_0x6ac0('0x1f')](0x10,0x14)+'-'+_0x3c7273[_0x6ac0('0x1f')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index cc46d20..a66dcf1 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 _0xd84a=['data1','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data2','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','update','encryptString','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','then','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','util','moment','request-promise','version','../../mysqldb','./hardware','../logger','license','https://www.xcallymotion.com','exports','format','GET','catch','get'];(function(_0x33adc3,_0x844bfc){var _0x4679f4=function(_0x4a49e8){while(--_0x4a49e8){_0x33adc3['push'](_0x33adc3['shift']());}};_0x4679f4(++_0x844bfc);}(_0xd84a,0x96));var _0xad84=function(_0x10f0dc,_0x5c81bd){_0x10f0dc=_0x10f0dc-0x0;var _0x424070=_0xd84a[_0x10f0dc];return _0x424070;};'use strict';var util=require(_0xad84('0x0'));var moment=require(_0xad84('0x1'));var rp=require(_0xad84('0x2'));var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,_0xad84('0x3'));var db=require(_0xad84('0x4'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0xad84('0x5'));var logger=require(_0xad84('0x6'))(_0xad84('0x7'));var HOST=_0xad84('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x15f94b){return new BPromise(function(_0x36be80,_0x1652be){var _0x1b606b=util['format']('%s/api/servers/%s/check?version=%s',HOST,_0x15f94b,module[_0xad84('0x9')][_0xad84('0x3')]);if(oldToken){_0x1b606b=util[_0xad84('0xa')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x15f94b,module[_0xad84('0x9')][_0xad84('0x3')],oldToken);}var _0x59e6a2={'uri':_0x1b606b,'method':_0xad84('0xb'),'timeout':0xea60,'json':!![]};return rp(_0x59e6a2)['then'](function(_0x2733df){_0x36be80(_0x2733df);})[_0xad84('0xc')](function(_0x596756){_0x1652be(_0x596756);});});}function manageLicense(_0x26ece1,_0x483d98){var _0x2e181f=_0x483d98[_0xad84('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x2e181f['data1']!==_0x26ece1&&!_0x2e181f['data2']){oldToken=_0x2e181f[_0xad84('0xe')];}httpRequest(_0x26ece1)['then'](function(_0x21da99){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x21da99[_0xad84('0xf')]){isOldTokenSent=![];if(!_0x2e181f[_0xad84('0x7')]&&_0x2e181f[_0xad84('0x7')]!=_0x21da99[_0xad84('0x7')]||_0x2e181f[_0xad84('0x7')]&&_0x2e181f['data2']){logger[_0xad84('0x10')](_0xad84('0x11'));}if(_0x2e181f[_0xad84('0x7')]&&!_0x2e181f[_0xad84('0x12')]&&_0x2e181f[_0xad84('0x7')]!=_0x21da99[_0xad84('0x7')]){logger[_0xad84('0x10')](_0xad84('0x13'));}if(_0x2e181f[_0xad84('0x7')]&&!_0x2e181f[_0xad84('0x12')]&&_0x2e181f['license']==_0x21da99[_0xad84('0x7')]){return _0x483d98;}return _0x483d98['update']({'data1':_0x26ece1,'data2':null,'license':_0x21da99[_0xad84('0x7')]});}else{if(_0x21da99['license']||_0x2e181f[_0xad84('0x7')]){if(!_0x2e181f[_0xad84('0x12')]){if(_0x2e181f[_0xad84('0xe')]==_0x26ece1){GRAY_PERIOD_REASON=_0xad84('0x14');logger[_0xad84('0x10')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xad84('0x15');logger['info'](_0xad84('0x16'),_0x2e181f[_0xad84('0xe')],_0x26ece1);}logger[_0xad84('0x10')](_0xad84('0x17'),GRAY_PERIOD_REASON[_0xad84('0x18')](),moment()[_0xad84('0xa')]('YYYY-MM-DD\x20HH:mm'));return _0x483d98[_0xad84('0x19')]({'data2':encryptor[_0xad84('0x1a')](moment()[_0xad84('0xa')](_0xad84('0x1b')))});}else{if(moment()[_0xad84('0x1c')](encryptor[_0xad84('0x1d')](_0x2e181f[_0xad84('0x12')]),_0xad84('0x1e'))>DAYS){logger[_0xad84('0x10')](_0xad84('0x1f'),moment()['format'](_0xad84('0x1b')));isOldTokenSent=![];return _0x483d98['update']({'data1':_0x26ece1,'data2':null,'license':null});}}}else{if(_0x2e181f[_0xad84('0xe')]!=_0x26ece1){logger['info'](_0xad84('0x16'),_0x2e181f['data1'],_0x26ece1);return _0x483d98[_0xad84('0x19')]({'data1':_0x26ece1,'data2':null,'license':null});}}}return _0x483d98;})[_0xad84('0x20')](function(_0x18e21f){_0x483d98=_0x18e21f;})['catch'](function(_0xfb4494){logger['error'](_0xfb4494[_0xad84('0x21')]);})[_0xad84('0x22')](function(){setTimeout(function(){manageLicense(hardware[_0xad84('0x23')](),_0x483d98);},TIME);});}function defaultLicense(){var _0x4984d5=hardware['getUuid']();if(_0x4984d5){return db[_0xad84('0x24')][_0xad84('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x4984d5}})[_0xad84('0x26')](function(_0x4d86bb,_0x1807a1){logger[_0xad84('0x10')](_0xad84('0x27'),_0x4984d5);manageLicense(_0x4984d5,_0x4d86bb);})['catch'](function(_0x3a6eb7){logger[_0xad84('0x28')](_0x3a6eb7[_0xad84('0x21')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x28b0=['findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','request-promise','bluebird','pkginfo','../../mysqldb','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','get','data1','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','catch','error','message','getUuid','License'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0x28b0,0x114));var _0x028b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28b0[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x028b('0x0'));var moment=require('moment');var rp=require(_0x028b('0x1'));var BPromise=require(_0x028b('0x2'));var pkginfo=require(_0x028b('0x3'))(module,'version');var db=require(_0x028b('0x4'))['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0x028b('0x5'));var logger=require(_0x028b('0x6'))(_0x028b('0x7'));var HOST=_0x028b('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x40e6a7){return new BPromise(function(_0x2b713a,_0x2ce9aa){var _0x42b8dd=util[_0x028b('0x9')](_0x028b('0xa'),HOST,_0x40e6a7,module[_0x028b('0xb')][_0x028b('0xc')]);if(oldToken){_0x42b8dd=util[_0x028b('0x9')](_0x028b('0xd'),HOST,_0x40e6a7,module[_0x028b('0xb')][_0x028b('0xc')],oldToken);}var _0x46d333={'uri':_0x42b8dd,'method':_0x028b('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x46d333)[_0x028b('0xf')](function(_0x2e0e05){_0x2b713a(_0x2e0e05);})['catch'](function(_0x530896){_0x2ce9aa(_0x530896);});});}function manageLicense(_0x3b071e,_0x570d8c){var _0xd1e031=_0x570d8c[_0x028b('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0xd1e031[_0x028b('0x11')]!==_0x3b071e&&!_0xd1e031[_0x028b('0x12')]){oldToken=_0xd1e031[_0x028b('0x11')];}httpRequest(_0x3b071e)[_0x028b('0xf')](function(_0x66ee1d){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x66ee1d['active']){isOldTokenSent=![];if(!_0xd1e031[_0x028b('0x7')]&&_0xd1e031['license']!=_0x66ee1d[_0x028b('0x7')]||_0xd1e031[_0x028b('0x7')]&&_0xd1e031[_0x028b('0x12')]){logger[_0x028b('0x13')](_0x028b('0x14'));}if(_0xd1e031[_0x028b('0x7')]&&!_0xd1e031['data2']&&_0xd1e031[_0x028b('0x7')]!=_0x66ee1d['license']){logger[_0x028b('0x13')](_0x028b('0x15'));}if(_0xd1e031['license']&&!_0xd1e031[_0x028b('0x12')]&&_0xd1e031['license']==_0x66ee1d['license']){return _0x570d8c;}return _0x570d8c[_0x028b('0x16')]({'data1':_0x3b071e,'data2':null,'license':_0x66ee1d[_0x028b('0x7')]});}else{if(_0x66ee1d[_0x028b('0x7')]||_0xd1e031[_0x028b('0x7')]){if(!_0xd1e031[_0x028b('0x12')]){if(_0xd1e031['data1']==_0x3b071e){GRAY_PERIOD_REASON=_0x028b('0x17');logger[_0x028b('0x13')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x028b('0x18');logger['info'](_0x028b('0x19'),_0xd1e031[_0x028b('0x11')],_0x3b071e);}logger[_0x028b('0x13')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x028b('0x1a')](),moment()[_0x028b('0x9')](_0x028b('0x1b')));return _0x570d8c[_0x028b('0x16')]({'data2':encryptor['encryptString'](moment()[_0x028b('0x9')](_0x028b('0x1b')))});}else{if(moment()[_0x028b('0x1c')](encryptor[_0x028b('0x1d')](_0xd1e031[_0x028b('0x12')]),_0x028b('0x1e'))>DAYS){logger[_0x028b('0x13')]('DEMO\x20START\x20AT\x20%s',moment()[_0x028b('0x9')](_0x028b('0x1b')));isOldTokenSent=![];return _0x570d8c['update']({'data1':_0x3b071e,'data2':null,'license':null});}}}else{if(_0xd1e031[_0x028b('0x11')]!=_0x3b071e){logger[_0x028b('0x13')](_0x028b('0x19'),_0xd1e031['data1'],_0x3b071e);return _0x570d8c[_0x028b('0x16')]({'data1':_0x3b071e,'data2':null,'license':null});}}}return _0x570d8c;})['then'](function(_0x1ee706){_0x570d8c=_0x1ee706;})[_0x028b('0x1f')](function(_0x56a966){logger[_0x028b('0x20')](_0x56a966[_0x028b('0x21')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x028b('0x22')](),_0x570d8c);},TIME);});}function defaultLicense(){var _0x330a98=hardware['getUuid']();if(_0x330a98){return db[_0x028b('0x23')][_0x028b('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x330a98}})['spread'](function(_0xff5b31,_0x425c7b){logger[_0x028b('0x13')](_0x028b('0x25'),_0x330a98);manageLicense(_0x330a98,_0xff5b31);})[_0x028b('0x1f')](function(_0x2f17a3){logger[_0x028b('0x20')](_0x2f17a3[_0x028b('0x21')]);});}}exports[_0x028b('0x26')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index d219739..c6b0096 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 _0xecdb=['Demo\x20license','getUuid','License','find','defaults','then','catch','uuid','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','decryptString','format','parse','demo','gray','deadline','days','grayReason','machineUuid','disabled','data1','message','User','role','sequelize','COUNT','count','admin','user','users','pick','countBy','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z'];(function(_0x5b69f6,_0x2e28bd){var _0x37abab=function(_0x5b1fda){while(--_0x5b1fda){_0x5b69f6['push'](_0x5b69f6['shift']());}};_0x37abab(++_0x2e28bd);}(_0xecdb,0x1e7));var _0xbecd=function(_0x3811f0,_0x4ed435){_0x3811f0=_0x3811f0-0x0;var _0x1a6d56=_0xecdb[_0x3811f0];return _0x1a6d56;};'use strict';var util=require(_0xbecd('0x0'));var _=require(_0xbecd('0x1'));var moment=require(_0xbecd('0x2'));var BPromise=require(_0xbecd('0x3'));var hardware=require(_0xbecd('0x4'));var encryptor=require(_0xbecd('0x5'));var db=require(_0xbecd('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xbecd('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xbecd('0x8'),'machineUuid':hardware[_0xbecd('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xbecd('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0xbecd('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x56b3fa){return new BPromise(function(_0x4c379b,_0x5d027f){return db[_0xbecd('0xa')][_0xbecd('0xb')](_[_0xbecd('0xc')](_0x56b3fa,{'raw':!![],'where':{'id':0x1}}))[_0xbecd('0xd')](function(_0x2d8b7a){return checkLicense(_0x2d8b7a,null);})[_0xbecd('0xd')](function(_0x15bae8){_0x4c379b(_0x15bae8);return;})[_0xbecd('0xe')](function(_0x1f83f5){_0x5d027f(_0x1f83f5);});});}function checkLicense(_0x300067,_0xcedc22){if(!_0x300067){demoLicense[_0xbecd('0xf')]=_0x300067['data1'];return demoLicense;}try{var _0x2dd562=_0xcedc22||_0x300067[_0xbecd('0x10')];if(_[_0xbecd('0x11')](_0x2dd562)){throw new Error(_0xbecd('0x12'));}var _0x68e848=_0x300067['data1'];var _0x1bf949=_0x300067[_0xbecd('0x13')];var _0x348e8d=_0x68e848['split']('-')[0x4];var _0x2792e6=_0x68e848['split']('-')[0x0];var _0x209656=encryptor[_0xbecd('0x14')](_0x2dd562,util[_0xbecd('0x15')]('%s:%s:%s',_0x348e8d,_0x68e848,_0x2792e6));var _0x1e2017=JSON[_0xbecd('0x16')](_0x209656);_0x1e2017[_0xbecd('0x17')]=![];_0x1e2017[_0xbecd('0xf')]=_0x68e848;_0x1e2017['machineUuid']=hardware[_0xbecd('0x9')]();if(_0x1bf949){var _0x15eae8=encryptor[_0xbecd('0x14')](_0x1bf949);_0x1e2017[_0xbecd('0x18')]=_0x15eae8;_0x1e2017[_0xbecd('0x19')]=moment(_0x15eae8)['add'](0x7,_0xbecd('0x1a'))[_0xbecd('0x15')]();_0x1e2017[_0xbecd('0x1b')]=_0x1e2017[_0xbecd('0xf')]!=_0x1e2017[_0xbecd('0x1c')]?'changed':_0xbecd('0x1d');}return _0x1e2017;}catch(_0x3efc9c){breakingLicense[_0xbecd('0xf')]=_0x300067[_0xbecd('0x1e')];breakingLicense[_0xbecd('0x1f')]=_0x3efc9c[_0xbecd('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x2d7091,_0x543d91){getLicense()[_0xbecd('0xd')](function(_0x1f44b8){return db[_0xbecd('0x20')]['findAll']({'attributes':[_0xbecd('0x21'),[db[_0xbecd('0x22')]['fn'](_0xbecd('0x23'),db[_0xbecd('0x22')]['col'](_0xbecd('0x21'))),_0xbecd('0x24')]],'group':_0xbecd('0x21'),'where':{'role':{'$or':[_0xbecd('0x25'),_0xbecd('0x26'),'telephone']}},'raw':!![]})[_0xbecd('0xd')](function(_0xdfb3f4){var _0x5ca090={'user':_0x1f44b8[_0xbecd('0x27')]||0x0,'telephone':_0x1f44b8['telephones']||0x0};_0xdfb3f4['forEach'](function(_0x4fca1e){var _0x4f2c81=_0x4fca1e['role']===_0xbecd('0x25')?_0xbecd('0x26'):_0x4fca1e['role'];_0x5ca090[_0x4f2c81]-=_0x4fca1e[_0xbecd('0x24')];if(_0x5ca090[_0x4f2c81]<0x0)_0x5ca090[_0x4f2c81]=0x0;});_0x2d7091(_0x5ca090);return;});})['catch'](function(_0x3dd199){_0x543d91(_0x3dd199);});});}function checkUserLimits(_0x107eba){return new BPromise(function(_0x568518,_0x3eacb9){getLimits()[_0xbecd('0xd')](function(_0x426b3d){var _0x34c34b=_[_0xbecd('0x28')](_[_0xbecd('0x29')](_0x107eba,'role'),[_0xbecd('0x25'),_0xbecd('0x26'),_0xbecd('0x2a')]);var _0x1c04b7=(_0x34c34b[_0xbecd('0x25')]||0x0)+(_0x34c34b[_0xbecd('0x26')]||0x0);var _0x32a6bd=_0x34c34b['telephone']||0x0;if(_0x1c04b7>_0x426b3d[_0xbecd('0x26')])return _0x3eacb9(_0xbecd('0x2b'));if(_0x32a6bd>_0x426b3d['telephone'])return _0x3eacb9(_0xbecd('0x2c'));return _0x568518();})[_0xbecd('0xe')](function(_0x5e8f7b){_0x3eacb9(_0x5e8f7b);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x308a=['role','sequelize','COUNT','col','count','admin','user','telephone','telephones','forEach','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','bluebird','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','defaults','then','catch','data1','isEmpty','data2','split','decryptString','format','%s:%s:%s','uuid','machineUuid','gray','deadline','add','days','grayReason','message','findAll'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x308a,0x1bb));var _0xa308=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x308a[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xa308('0x0'));var _=require('lodash');var moment=require('moment');var BPromise=require(_0xa308('0x1'));var hardware=require('./hardware');var encryptor=require('../../components/encryptor');var db=require(_0xa308('0x2'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xa308('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xa308('0x4'),'machineUuid':hardware[_0xa308('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xa308('0x3'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0xa308('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4188ee){return new BPromise(function(_0x5d422e,_0x3114d2){return db['License']['find'](_[_0xa308('0x6')](_0x4188ee,{'raw':!![],'where':{'id':0x1}}))[_0xa308('0x7')](function(_0x48027a){return checkLicense(_0x48027a,null);})[_0xa308('0x7')](function(_0x15cc8d){_0x5d422e(_0x15cc8d);return;})[_0xa308('0x8')](function(_0x54b368){_0x3114d2(_0x54b368);});});}function checkLicense(_0x16baec,_0x43780b){if(!_0x16baec){demoLicense['uuid']=_0x16baec[_0xa308('0x9')];return demoLicense;}try{var _0x23b2d2=_0x43780b||_0x16baec['license'];if(_[_0xa308('0xa')](_0x23b2d2)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x39ae1e=_0x16baec[_0xa308('0x9')];var _0x3977ef=_0x16baec[_0xa308('0xb')];var _0x22e054=_0x39ae1e[_0xa308('0xc')]('-')[0x4];var _0x351a33=_0x39ae1e[_0xa308('0xc')]('-')[0x0];var _0x1e6846=encryptor[_0xa308('0xd')](_0x23b2d2,util[_0xa308('0xe')](_0xa308('0xf'),_0x22e054,_0x39ae1e,_0x351a33));var _0x464aad=JSON['parse'](_0x1e6846);_0x464aad['demo']=![];_0x464aad[_0xa308('0x10')]=_0x39ae1e;_0x464aad[_0xa308('0x11')]=hardware[_0xa308('0x5')]();if(_0x3977ef){var _0x409820=encryptor[_0xa308('0xd')](_0x3977ef);_0x464aad[_0xa308('0x12')]=_0x409820;_0x464aad[_0xa308('0x13')]=moment(_0x409820)[_0xa308('0x14')](0x7,_0xa308('0x15'))['format']();_0x464aad[_0xa308('0x16')]=_0x464aad[_0xa308('0x10')]!=_0x464aad['machineUuid']?'changed':'disabled';}return _0x464aad;}catch(_0x277d39){breakingLicense[_0xa308('0x10')]=_0x16baec[_0xa308('0x9')];breakingLicense[_0xa308('0x17')]=_0x277d39[_0xa308('0x17')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x37b762,_0x22c227){getLicense()[_0xa308('0x7')](function(_0x23ad79){return db['User'][_0xa308('0x18')]({'attributes':[_0xa308('0x19'),[db[_0xa308('0x1a')]['fn'](_0xa308('0x1b'),db[_0xa308('0x1a')][_0xa308('0x1c')](_0xa308('0x19'))),_0xa308('0x1d')]],'group':_0xa308('0x19'),'where':{'role':{'$or':[_0xa308('0x1e'),_0xa308('0x1f'),_0xa308('0x20')]}},'raw':!![]})[_0xa308('0x7')](function(_0x62cfaf){var _0x2839b2={'user':_0x23ad79['users']||0x0,'telephone':_0x23ad79[_0xa308('0x21')]||0x0};_0x62cfaf[_0xa308('0x22')](function(_0x24e4bd){var _0x2a1a7c=_0x24e4bd[_0xa308('0x19')]==='admin'?'user':_0x24e4bd[_0xa308('0x19')];_0x2839b2[_0x2a1a7c]-=_0x24e4bd[_0xa308('0x1d')];if(_0x2839b2[_0x2a1a7c]<0x0)_0x2839b2[_0x2a1a7c]=0x0;});_0x37b762(_0x2839b2);return;});})[_0xa308('0x8')](function(_0x3e87b3){_0x22c227(_0x3e87b3);});});}function checkUserLimits(_0x551dd7){return new BPromise(function(_0x156626,_0x131e8a){getLimits()['then'](function(_0x1b501c){var _0x368a1b=_['pick'](_[_0xa308('0x23')](_0x551dd7,_0xa308('0x19')),['admin','user','telephone']);var _0x264edc=(_0x368a1b[_0xa308('0x1e')]||0x0)+(_0x368a1b[_0xa308('0x1f')]||0x0);var _0x5da068=_0x368a1b[_0xa308('0x20')]||0x0;if(_0x264edc>_0x1b501c['user'])return _0x131e8a(_0xa308('0x24'));if(_0x5da068>_0x1b501c[_0xa308('0x20')])return _0x131e8a(_0xa308('0x25'));return _0x156626();})[_0xa308('0x8')](function(_0x5481d1){_0x131e8a(_0x5481d1);});});}module[_0xa308('0x26')]={'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 2fc319f..143193d 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 _0x8e3f=['secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x4c44dc,_0x3d0d9d){var _0xa56cba=function(_0x43991d){while(--_0x43991d){_0x4c44dc['push'](_0x4c44dc['shift']());}};_0xa56cba(++_0x3d0d9d);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x8e3f[_0x4565bf];return _0x5610ba;};'use strict';module[_0xf8e3('0x0')]={'DOMAIN':_0xf8e3('0x1'),'SESSION_SECRET':_0xf8e3('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xf8e3('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x160f=['http://localhost:9000','myappanuglar-secret','app-id','exports'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';module[_0xf160('0x0')]={'DOMAIN':_0xf160('0x1'),'SESSION_SECRET':_0xf160('0x2'),'GOOGLE_ID':_0xf160('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 3352a1b..52dc063 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe083=['fileLogger','../utils/loggers'];(function(_0x1bc019,_0x3b33ec){var _0x4dc25f=function(_0x18168c){while(--_0x18168c){_0x1bc019['push'](_0x1bc019['shift']());}};_0x4dc25f(++_0x3b33ec);}(_0xe083,0x1af));var _0x3e08=function(_0x49bd64,_0x527c06){_0x49bd64=_0x49bd64-0x0;var _0xd4dd7c=_0xe083[_0x49bd64];return _0xd4dd7c;};'use strict';var fileLogger=require(_0x3e08('0x0'))[_0x3e08('0x1')];module['exports']=fileLogger; \ No newline at end of file +var _0xd5a4=['exports','../utils/loggers','fileLogger'];(function(_0x3b838f,_0x445acf){var _0x200ed6=function(_0x5894b3){while(--_0x5894b3){_0x3b838f['push'](_0x3b838f['shift']());}};_0x200ed6(++_0x445acf);}(_0xd5a4,0x1f0));var _0x4d5a=function(_0x4cdb25,_0x3d068e){_0x4cdb25=_0x4cdb25-0x0;var _0x1c0419=_0xd5a4[_0x4cdb25];return _0x1c0419;};'use strict';var fileLogger=require(_0x4d5a('0x0'))[_0x4d5a('0x1')];module[_0x4d5a('0x2')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index e019ee5..1c4d3d3 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 _0xce73=['../../services/express/index.js','../../services/ami/index.js','agi','email','../../services/email/index.js','routing','../../services/routing/index.js','../../services/xdr/index.js','exports','path','../../config/environment','resolve','join','legacy-libs'];(function(_0x4a5884,_0x493748){var _0xf8898b=function(_0x394456){while(--_0x394456){_0x4a5884['push'](_0x4a5884['shift']());}};_0xf8898b(++_0x493748);}(_0xce73,0x87));var _0x3ce7=function(_0xe9cb41,_0x17d273){_0xe9cb41=_0xe9cb41-0x0;var _0xb7b234=_0xce73[_0xe9cb41];return _0xb7b234;};'use strict';var path=require(_0x3ce7('0x0'));var cfg=require(_0x3ce7('0x1'));var env={'NODE_PATH':path[_0x3ce7('0x2')](path[_0x3ce7('0x3')](cfg['root'],_0x3ce7('0x4')))};var pm2config={'apps':[{'name':'express','script':path[_0x3ce7('0x3')](__dirname,_0x3ce7('0x5')),'env':env},{'name':'ami','script':path['join'](__dirname,_0x3ce7('0x6')),'env':env},{'name':_0x3ce7('0x7'),'script':path[_0x3ce7('0x3')](__dirname,'../../services/agi/index.js'),'env':env},{'name':_0x3ce7('0x8'),'script':path[_0x3ce7('0x3')](__dirname,_0x3ce7('0x9')),'env':env},{'name':_0x3ce7('0xa'),'script':path['join'](__dirname,_0x3ce7('0xb')),'env':env},{'name':'xdr','script':path[_0x3ce7('0x3')](__dirname,_0x3ce7('0xc')),'env':env}]};module[_0x3ce7('0xd')]=pm2config; \ No newline at end of file +var _0xa2c0=['../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','path','../../config/environment','resolve','join','legacy-libs','express','../../services/ami/index.js'];(function(_0x12c3e7,_0x3e3488){var _0x48406d=function(_0x21d5bc){while(--_0x21d5bc){_0x12c3e7['push'](_0x12c3e7['shift']());}};_0x48406d(++_0x3e3488);}(_0xa2c0,0x172));var _0x0a2c=function(_0x1aa710,_0x48395){_0x1aa710=_0x1aa710-0x0;var _0x557557=_0xa2c0[_0x1aa710];return _0x557557;};'use strict';var path=require(_0x0a2c('0x0'));var cfg=require(_0x0a2c('0x1'));var env={'NODE_PATH':path[_0x0a2c('0x2')](path[_0x0a2c('0x3')](cfg['root'],_0x0a2c('0x4')))};var pm2config={'apps':[{'name':_0x0a2c('0x5'),'script':path[_0x0a2c('0x3')](__dirname,'../../services/express/index.js'),'env':env},{'name':'ami','script':path[_0x0a2c('0x3')](__dirname,_0x0a2c('0x6')),'env':env},{'name':'agi','script':path['join'](__dirname,_0x0a2c('0x7')),'env':env},{'name':_0x0a2c('0x8'),'script':path['join'](__dirname,_0x0a2c('0x9')),'env':env},{'name':_0x0a2c('0xa'),'script':path[_0x0a2c('0x3')](__dirname,_0x0a2c('0xb')),'env':env},{'name':_0x0a2c('0xc'),'script':path[_0x0a2c('0x3')](__dirname,'../../services/xdr/index.js'),'env':env}]};module['exports']=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index eaa2c67..9ad9d52 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 _0xbfdc=['restart','list','describe','delete','saved','pm2','bluebird','connect','connected','then','disconnect','stop'];(function(_0x19f3d7,_0x446871){var _0x35503f=function(_0x838b00){while(--_0x838b00){_0x19f3d7['push'](_0x19f3d7['shift']());}};_0x35503f(++_0x446871);}(_0xbfdc,0x1cd));var _0xcbfd=function(_0x475961,_0x2c7aee){_0x475961=_0x475961-0x0;var _0x2cb203=_0xbfdc[_0x475961];return _0x2cb203;};'use strict';var pm2=require(_0xcbfd('0x0'));var BPromise=require(_0xcbfd('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x16d8c2,_0x490e13){return pm2[_0xcbfd('0x2')](function(_0x324c71){if(_0x324c71){return _0x490e13(_0x324c71);}return _0x16d8c2(_0xcbfd('0x3'));});});};exports['start']=function(_0x5021be){return connect()[_0xcbfd('0x4')](function(){return new BPromise(function(_0xea6130,_0x50f7cb){return pm2['start'](_0x5021be,function(_0x478e91,_0x45bdd1){if(_0x478e91){return _0x50f7cb(_0x478e91);}pm2[_0xcbfd('0x5')]();return _0xea6130(_0x45bdd1);});});});};exports['stop']=function(_0x4cb473){return connect()[_0xcbfd('0x4')](function(){return new BPromise(function(_0x438488,_0x3c56ca){return pm2[_0xcbfd('0x6')](_0x4cb473,function(_0x2ee27e,_0x57edee){if(_0x2ee27e){return _0x3c56ca(_0x2ee27e);}pm2[_0xcbfd('0x5')]();return _0x438488(_0x57edee);});});});};exports[_0xcbfd('0x7')]=function(_0x4eabd6){return connect()[_0xcbfd('0x4')](function(){return new BPromise(function(_0x47cef1,_0x38d327){return pm2[_0xcbfd('0x7')](_0x4eabd6,function(_0x4ed721,_0x351fa1){if(_0x4ed721){return _0x38d327(_0x4ed721);}pm2[_0xcbfd('0x5')]();return _0x47cef1(_0x351fa1);});});});};exports['list']=function(){return connect()[_0xcbfd('0x4')](function(){return new BPromise(function(_0x39d054,_0x1b0a71){return pm2[_0xcbfd('0x8')](function(_0x89f6fa,_0x5288a8){if(_0x89f6fa){return _0x1b0a71(_0x89f6fa);}pm2[_0xcbfd('0x5')]();return _0x39d054(_0x5288a8);});});});};exports['describe']=function(_0x399e54){return connect()[_0xcbfd('0x4')](function(){return new BPromise(function(_0xa3eaca,_0x3b9d23){return pm2[_0xcbfd('0x9')](_0x399e54,function(_0x27dba3,_0x32ebc2){if(_0x27dba3){return _0x3b9d23(_0x27dba3);}pm2['disconnect']();return _0xa3eaca(_0x32ebc2);});});});};exports['delete']=function(_0x37a20e){return connect()['then'](function(){return new BPromise(function(_0x5e7c1c,_0x378719){return pm2[_0xcbfd('0xa')](_0x37a20e,function(_0x483919,_0x461028){if(_0x483919){return _0x378719(_0x483919);}pm2[_0xcbfd('0x5')]();return _0x5e7c1c(_0x461028);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x3b9887,_0x2a4ab4){return pm2['dump'](function(_0x419d83){if(_0x419d83){return _0x2a4ab4(_0x419d83);}return _0x3b9887(_0xcbfd('0xb'));});});});}; \ No newline at end of file +var _0xce43=['connect','connected','start','then','disconnect','stop','restart','list','describe','delete','dump','bluebird','./config'];(function(_0x2ffc46,_0x35ce3c){var _0x1eda8f=function(_0x285344){while(--_0x285344){_0x2ffc46['push'](_0x2ffc46['shift']());}};_0x1eda8f(++_0x35ce3c);}(_0xce43,0xa7));var _0x3ce4=function(_0x37b70c,_0x27750){_0x37b70c=_0x37b70c-0x0;var _0x54bc7e=_0xce43[_0x37b70c];return _0x54bc7e;};'use strict';var pm2=require('pm2');var BPromise=require(_0x3ce4('0x0'));var config=require(_0x3ce4('0x1'));function connect(){return new BPromise(function(_0x3e2ea1,_0x2a0d8c){return pm2[_0x3ce4('0x2')](function(_0x25f0d9){if(_0x25f0d9){return _0x2a0d8c(_0x25f0d9);}return _0x3e2ea1(_0x3ce4('0x3'));});});};exports[_0x3ce4('0x4')]=function(_0x58a846){return connect()[_0x3ce4('0x5')](function(){return new BPromise(function(_0x35500d,_0x4ce968){return pm2['start'](_0x58a846,function(_0xa61002,_0xab8f0b){if(_0xa61002){return _0x4ce968(_0xa61002);}pm2[_0x3ce4('0x6')]();return _0x35500d(_0xab8f0b);});});});};exports[_0x3ce4('0x7')]=function(_0x35bc38){return connect()['then'](function(){return new BPromise(function(_0x325ea4,_0x52c086){return pm2[_0x3ce4('0x7')](_0x35bc38,function(_0x424059,_0x21688e){if(_0x424059){return _0x52c086(_0x424059);}pm2['disconnect']();return _0x325ea4(_0x21688e);});});});};exports[_0x3ce4('0x8')]=function(_0x586d0e){return connect()[_0x3ce4('0x5')](function(){return new BPromise(function(_0x272c90,_0x5cc562){return pm2[_0x3ce4('0x8')](_0x586d0e,function(_0x5c0425,_0x2e99e4){if(_0x5c0425){return _0x5cc562(_0x5c0425);}pm2[_0x3ce4('0x6')]();return _0x272c90(_0x2e99e4);});});});};exports[_0x3ce4('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0x4ba40e,_0x3801ba){return pm2[_0x3ce4('0x9')](function(_0x2546a6,_0x840416){if(_0x2546a6){return _0x3801ba(_0x2546a6);}pm2['disconnect']();return _0x4ba40e(_0x840416);});});});};exports[_0x3ce4('0xa')]=function(_0x3c0750){return connect()[_0x3ce4('0x5')](function(){return new BPromise(function(_0x91573c,_0x449b8d){return pm2['describe'](_0x3c0750,function(_0x25c727,_0x284c39){if(_0x25c727){return _0x449b8d(_0x25c727);}pm2[_0x3ce4('0x6')]();return _0x91573c(_0x284c39);});});});};exports[_0x3ce4('0xb')]=function(_0x4a4359){return connect()[_0x3ce4('0x5')](function(){return new BPromise(function(_0x32f6af,_0x1e1e6c){return pm2[_0x3ce4('0xb')](_0x4a4359,function(_0xc69d04,_0x30a7b6){if(_0xc69d04){return _0x1e1e6c(_0xc69d04);}pm2[_0x3ce4('0x6')]();return _0x32f6af(_0x30a7b6);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x303929,_0x2c96e4){return pm2[_0x3ce4('0xc')](function(_0x44d988){if(_0x44d988){return _0x2c96e4(_0x44d988);}return _0x303929('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 83624f3..2e76d04 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 _0x6f71=['map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','socket.io-emitter','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','length'];(function(_0x2d95d8,_0x1a1f94){var _0x4a93c0=function(_0x559ba9){while(--_0x559ba9){_0x2d95d8['push'](_0x2d95d8['shift']());}};_0x4a93c0(++_0x1a1f94);}(_0x6f71,0x163));var _0x16f7=function(_0x458ef0,_0x366adb){_0x458ef0=_0x458ef0-0x0;var _0x10eab7=_0x6f71[_0x458ef0];return _0x10eab7;};'use strict';var _=require(_0x16f7('0x0'));var moment=require('moment');var Redis=require(_0x16f7('0x1'));var util=require(_0x16f7('0x2'));var config=require(_0x16f7('0x3'));var db=require(_0x16f7('0x4'))['db'];var logger=require(_0x16f7('0x5'))(_0x16f7('0x6'));config[_0x16f7('0x7')]=_[_0x16f7('0x8')](config[_0x16f7('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x16f7('0x9'))(new Redis(config[_0x16f7('0x7')]));function closeInteractions(){var _0x5eac56=0x0;var _0x31ba4d=[];return db['Setting'][_0x16f7('0xa')]({'raw':!![],'attributes':['id',_0x16f7('0xb')],'where':{'id':0x1}})[_0x16f7('0xc')](function(_0x371cd3){_0x5eac56=_0x371cd3[_0x16f7('0xb')];if(_0x5eac56){return db[_0x16f7('0xd')][_0x16f7('0xe')]({'raw':!![],'attributes':['id',_0x16f7('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x16f7('0x10')](_0x371cd3[_0x16f7('0xb')],_0x16f7('0x11'))}}});}else{return[];}})[_0x16f7('0xc')](function(_0x57c80c){if(_0x57c80c&&_0x57c80c[_0x16f7('0x12')]){_0x31ba4d=_[_0x16f7('0x13')](_0x57c80c||[],'id');logger[_0x16f7('0x14')](_0x16f7('0x15'),_0x31ba4d[_0x16f7('0x16')]());return db[_0x16f7('0xd')][_0x16f7('0x17')]({'closeReason':_0x16f7('0x18'),'disposition':_0x16f7('0x19'),'closed':!![],'closedAt':moment()[_0x16f7('0x1a')](_0x16f7('0x1b'))},{'where':{'id':_0x31ba4d}});}})[_0x16f7('0xc')](function(){if(_0x31ba4d&&_0x31ba4d[_0x16f7('0x12')]){logger[_0x16f7('0x14')](_0x16f7('0x1c'),_0x31ba4d[_0x16f7('0x16')]());for(var _0x47a098=0x0;_0x47a098<_0x31ba4d[_0x16f7('0x12')];_0x47a098++){io[_0x16f7('0x1d')](_0x16f7('0x1e'),{'id':_0x31ba4d[_0x47a098],'closed':!![]});}}})[_0x16f7('0x1f')](function(_0x4b7074){logger['error'](_0x16f7('0x20'),_0x4b7074?util[_0x16f7('0x21')](_0x4b7074,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xd29c=['ChatInteraction','findAll','lastMsgAt','subtract','minutes','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','ioredis','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','Setting','find','then','chatTimeout'];(function(_0x2e5baf,_0x4b77a1){var _0x4c0797=function(_0x32f4fc){while(--_0x32f4fc){_0x2e5baf['push'](_0x2e5baf['shift']());}};_0x4c0797(++_0x4b77a1);}(_0xd29c,0x175));var _0xcd29=function(_0xf414e4,_0x569702){_0xf414e4=_0xf414e4-0x0;var _0x5db5d1=_0xd29c[_0xf414e4];return _0x5db5d1;};'use strict';var _=require(_0xcd29('0x0'));var moment=require('moment');var Redis=require(_0xcd29('0x1'));var util=require('util');var config=require(_0xcd29('0x2'));var db=require(_0xcd29('0x3'))['db'];var logger=require(_0xcd29('0x4'))(_0xcd29('0x5'));config[_0xcd29('0x6')]=_[_0xcd29('0x7')](config[_0xcd29('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcd29('0x6')]));function closeInteractions(){var _0x1046cb=0x0;var _0x250445=[];return db[_0xcd29('0x8')][_0xcd29('0x9')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0xcd29('0xa')](function(_0x148509){_0x1046cb=_0x148509[_0xcd29('0xb')];if(_0x1046cb){return db[_0xcd29('0xc')][_0xcd29('0xd')]({'raw':!![],'attributes':['id',_0xcd29('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xcd29('0xf')](_0x148509[_0xcd29('0xb')],_0xcd29('0x10'))}}});}else{return[];}})[_0xcd29('0xa')](function(_0x13e8cb){if(_0x13e8cb&&_0x13e8cb[_0xcd29('0x11')]){_0x250445=_[_0xcd29('0x12')](_0x13e8cb||[],'id');logger[_0xcd29('0x13')](_0xcd29('0x14'),_0x250445[_0xcd29('0x15')]());return db[_0xcd29('0xc')][_0xcd29('0x16')]({'closeReason':_0xcd29('0x17'),'disposition':_0xcd29('0x18'),'closed':!![],'closedAt':moment()[_0xcd29('0x19')](_0xcd29('0x1a'))},{'where':{'id':_0x250445}});}})[_0xcd29('0xa')](function(){if(_0x250445&&_0x250445['length']){logger[_0xcd29('0x13')](_0xcd29('0x1b'),_0x250445[_0xcd29('0x15')]());for(var _0x41cf7f=0x0;_0x41cf7f<_0x250445[_0xcd29('0x11')];_0x41cf7f++){io[_0xcd29('0x1c')](_0xcd29('0x1d'),{'id':_0x250445[_0x41cf7f],'closed':!![]});}}})[_0xcd29('0x1e')](function(_0x5aead7){logger[_0xcd29('0x1f')](_0xcd29('0x20'),_0x5aead7?util[_0xcd29('0x21')](_0x5aead7,{'showHidden':![],'depth':null}):'');});}exports[_0xcd29('0x22')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index 15409dd..7821064 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd93=['exports','../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals'];(function(_0x49ba22,_0x4b4feb){var _0x499290=function(_0x39702d){while(--_0x39702d){_0x49ba22['push'](_0x49ba22['shift']());}};_0x499290(++_0x4b4feb);}(_0xcd93,0x16f));var _0x3cd9=function(_0x3e0027,_0x5eb3d6){_0x3e0027=_0x3e0027-0x0;var _0x305ca5=_0xcd93[_0x3e0027];return _0x305ca5;};'use strict';function start(){var _0x4f1dfc=require(_0x3cd9('0x0'));return _0x4f1dfc[_0x3cd9('0x1')]();}module[_0x3cd9('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0xbb99=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals','exports'];(function(_0x38ba7c,_0x4594fb){var _0x1251a3=function(_0x5b7d77){while(--_0x5b7d77){_0x38ba7c['push'](_0x38ba7c['shift']());}};_0x1251a3(++_0x4594fb);}(_0xbb99,0x1e6));var _0x9bb9=function(_0x4099ee,_0x38495a){_0x4099ee=_0x4099ee-0x0;var _0x1b7bfc=_0xbb99[_0x4099ee];return _0x1b7bfc;};'use strict';function start(){var _0x5e9c54=require(_0x9bb9('0x0'));return _0x5e9c54[_0x9bb9('0x1')]();}module[_0x9bb9('0x2')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 3e1576b..ef88b9a 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 _0x9842=['error\x20mail','currentAttempt','retryOptions','retries','job','operation','case\x20completed','data','stop','case\x20empty','case\x20failed','entity','attempt','Job\x20ID\x20','\x20Attempt\x20#:','report\x20status:','dataValues','sendMail','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','name','exec\x20defaul\x20report\x20id:%s','runReport','DefaultReportId','exec\x20custom\x20report\x20id:%s','CustomReportId','Schedule','MailServerOut','CloudProvider','jobs','map','toString','intersection','difference','length','deleteJob','delete\x20cron','resolve','isBetween','startAt','add','cron','start','stop\x20cron','exists','active','endAt','update','update\x20cron','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','../../mysqldb','retry','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','number','AnalyticExtractedReport','then','catch','Try\x20to\x20send\x20a\x20mail\x20to','email','getSmtpOptions','format','\x22%s\x22\x20<%s>','MailAccount','Smtp','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','savename','%s.%s','basename','zip','existsSync','status','Sent','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','Empty','message','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','Loading','Report\x20still\x20running\x20after\x20timeout.\x0aYou\x20can\x20find\x20the\x20report\x20when\x20it\x20will\x20be\x20completed\x20in\x20Analytics\x20->\x20Extracted\x20Reports.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','Completed','Report\x20file\x20creation\x20still\x20running\x20after\x20timeout.\x0aYou\x20can\x20find\x20the\x20report\x20when\x20it\x20will\x20be\x20completed\x20in\x20Analytics\x20->\x20Extracted\x20Reports.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','Failed','Report\x20extraction\x20procedure\x20has\x20run\x20into\x20an\x20unexpected\x20error.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','error','[handleSendEmail]\x20Unrecognized\x20status:','request','SendMail','info','email\x20sent'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0x9842,0x1f2));var _0x2984=function(_0x4d6601,_0x4b0b22){_0x4d6601=_0x4d6601-0x0;var _0x2d0e52=_0x9842[_0x4d6601];return _0x2d0e52;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x2984('0x0'));var _=require(_0x2984('0x1'));var moment=require(_0x2984('0x2'));var CronJobManager=require(_0x2984('0x3'));var jayson=require(_0x2984('0x4'));var BPromise=require(_0x2984('0x5'));var logger=require(_0x2984('0x6'))('schedule');var db=require(_0x2984('0x7'))['db'];const retry=require(_0x2984('0x8'));var analyticCustomReportController=require(_0x2984('0x9'));var analyticDefaultReportController=require(_0x2984('0xa'));var client=jayson[_0x2984('0xb')][_0x2984('0xc')]({'port':0x232b});var manager=new CronJobManager();function getReportData(_0x436444){const _0xfd819f={};if(typeof _0x436444===_0x2984('0xd')){_0xfd819f['id']=_0x436444;}return db[_0x2984('0xe')]['findOne']({'where':_0xfd819f})[_0x2984('0xf')](function(_0x2bd3e7){return _0x2bd3e7;})[_0x2984('0x10')](function(_0x4b7fb4){logger['error'](_0x4b7fb4);});}function handleSendEmail(_0x2d2c92,_0x2be692){logger['info'](_0x2984('0x11'),_0x2d2c92[_0x2984('0x12')]);var _0x162552=!![];var _0x7d8e97=_0x2d2c92['MailAccount'][_0x2984('0x13')]();var _0x2ebec4={'account':_0x7d8e97,'message':{'from':util[_0x2984('0x14')](_0x2984('0x15'),_0x2d2c92['MailAccount']['name'],_0x2d2c92[_0x2984('0x16')]['email']||_0x2d2c92[_0x2984('0x16')][_0x2984('0x17')]['user']),'to':_0x2d2c92['email'],'cc':_0x2d2c92['cc'],'bcc':_0x2d2c92[_0x2984('0x18')],'subject':util[_0x2984('0x14')](_0x2984('0x19'),_0x2be692['name'],_0x2d2c92[_0x2984('0x1a')],_0x2d2c92[_0x2984('0x1b')])}};var _0x5920bf=path[_0x2984('0x1c')](__dirname,'../../files/reports');var _0x370728=_0x2be692[_0x2984('0x1d')];var _0x4629fb=util[_0x2984('0x14')](_0x2984('0x1e'),path[_0x2984('0x1f')](_0x2be692[_0x2984('0x1d')],path['extname'](_0x2be692['savename'])),_0x2984('0x20'));var _0x3d18e8=path['join'](_0x5920bf,_0x370728);var _0x1679d1=path['join'](_0x5920bf,_0x4629fb);if(fs[_0x2984('0x21')](_0x3d18e8)){_0x2be692[_0x2984('0x22')]=_0x2984('0x23');_0x2ebec4['message'][_0x2984('0x24')]=[{'filename':_0x370728,'path':_0x3d18e8}];_0x2ebec4['message'][_0x2984('0x25')]=util[_0x2984('0x14')](_0x2984('0x26'),JSON[_0x2984('0x27')](_0x2be692,null,0x2));}else if(fs[_0x2984('0x21')](_0x1679d1)){_0x2be692['status']='Sent';_0x2ebec4['message'][_0x2984('0x24')]=[{'filename':_0x4629fb,'path':_0x1679d1}];}else{if(_0x2be692[_0x2984('0x22')]===_0x2984('0x28')){_0x2ebec4[_0x2984('0x29')][_0x2984('0x25')]=_0x2984('0x2a');if(!_0x2d2c92[_0x2984('0x2b')]){_0x162552=![];logger['info'](_0x2984('0x2c'));}}else if(_0x2be692[_0x2984('0x22')]===_0x2984('0x2d')){_0x2ebec4['message'][_0x2984('0x25')]=_0x2984('0x2e');}else if(_0x2be692[_0x2984('0x22')]===_0x2984('0x2f')){_0x2ebec4['message']['text']=_0x2984('0x30');}else if(_0x2be692['status']===_0x2984('0x31')){_0x2ebec4[_0x2984('0x29')]['text']=_0x2984('0x32');}else{logger[_0x2984('0x33')](_0x2984('0x34'),_0x2be692[_0x2984('0x22')]);}}if(_0x162552){return client[_0x2984('0x35')](_0x2984('0x36'),_0x2ebec4)[_0x2984('0xf')](function(_0x4ca3b4){if(_0x4ca3b4[_0x2984('0x33')]){return logger[_0x2984('0x33')]('error\x20mail',JSON['stringify'](_0x4ca3b4));}return logger[_0x2984('0x37')](_0x2984('0x38'));})['catch'](function(_0x166f2b){return logger['error'](_0x2984('0x39'),JSON[_0x2984('0x27')](_0x166f2b));});}}function handleError(){return function(_0x1a9a5a){return logger[_0x2984('0x33')](JSON[_0x2984('0x27')](_0x1a9a5a));};}function loading(_0x48e1f7){logger[_0x2984('0x37')]('case\x20loading');if(_0x48e1f7[_0x2984('0x3a')]===_0x48e1f7[_0x2984('0x3b')][_0x2984('0x3c')]){handleSendEmail(_0x48e1f7[_0x2984('0x3d')],_0x48e1f7['data']);_0x48e1f7[_0x2984('0x3e')]['stop']();}else{_0x48e1f7[_0x2984('0x3e')][_0x2984('0x8')]('still\x20loading');}}function completed(_0x443e4b){logger[_0x2984('0x37')](_0x2984('0x3f'));handleSendEmail(_0x443e4b[_0x2984('0x3d')],_0x443e4b[_0x2984('0x40')]);_0x443e4b[_0x2984('0x3e')][_0x2984('0x41')]();}function empty(_0x575d5b){logger[_0x2984('0x37')](_0x2984('0x42'));handleSendEmail(_0x575d5b[_0x2984('0x3d')],_0x575d5b[_0x2984('0x40')]);_0x575d5b[_0x2984('0x3e')][_0x2984('0x41')]();}function failed(_0x219b4c){logger['info'](_0x2984('0x43'));handleSendEmail(_0x219b4c['job'],_0x219b4c[_0x2984('0x40')]);_0x219b4c[_0x2984('0x3e')][_0x2984('0x41')]();}function urecognized(_0x437ec0){logger[_0x2984('0x33')]('Unrecognized\x20status:',_0x437ec0[_0x2984('0x44')]['dataValues'][_0x2984('0x22')]);_0x437ec0['operation'][_0x2984('0x41')]();}const reportStatusStrategies={'Loading':loading,'Completed':completed,'Empty':empty,'Failed':failed,'Unrecognized':urecognized};function retryer(_0x486760,_0x2ee07c){const _0x3a05b2={'retries':0x3,'factor':0x2,'minTimeout':0x5b*0x3e8,'maxTimeout':0xa*0x3c*0x3e8};const _0x500634=retry['operation'](_0x3a05b2);_0x500634[_0x2984('0x45')](_0xd26104=>{logger[_0x2984('0x37')](_0x2984('0x46')+_0x486760['id']+_0x2984('0x47')+_0xd26104);try{getReportData(_0x2ee07c['id'])[_0x2984('0xf')](function(_0x2aeb0f){_0x2ee07c=_0x2aeb0f;logger['info'](_0x2984('0x48'),_0x2aeb0f['dataValues'][_0x2984('0x22')]);if(!reportStatusStrategies[_0x2aeb0f[_0x2984('0x49')][_0x2984('0x22')]]){logger[_0x2984('0x33')]('report\x20status:',_0x2aeb0f['dataValues']['status']);_0x500634[_0x2984('0x8')]();}reportStatusStrategies[_0x2aeb0f['dataValues'][_0x2984('0x22')]]({'operation':_0x500634,'currentAttempt':_0xd26104,'retryOptions':_0x3a05b2,'job':_0x486760,'data':_0x2ee07c,'entity':_0x2aeb0f});});}catch(_0x21e75f){_0x500634[_0x2984('0x8')](_0x21e75f);}});}function handleResult(_0x418e91){return function(_0x25a07a){if(_0x418e91[_0x2984('0x4a')]&&_0x418e91[_0x2984('0x16')]&&_0x418e91[_0x2984('0x16')]['Smtp']&&!_[_0x2984('0x4b')](_0x418e91['email'])){retryer(_0x418e91,_0x25a07a);}};}function handleJob(_0x81b3de){return function(){try{if(_[_0x2984('0x4b')](_0x81b3de[_0x2984('0x1a')])){return logger['info'](_0x2984('0x4c'));}if(_['isNil'](_0x81b3de[_0x2984('0x1b')])){return logger['info'](_0x2984('0x4d'));}var _0x7e5213={'startDate':moment()[_0x2984('0x4e')](_0x81b3de[_0x2984('0x1a')],_0x81b3de['subtractUnit'])[_0x2984('0x14')](_0x2984('0x4f')),'endDate':moment()[_0x2984('0x14')](_0x2984('0x4f')),'type':_0x2984('0x50'),'output':_0x81b3de[_0x2984('0x51')],'name':_0x81b3de[_0x2984('0x52')]};if(!_[_0x2984('0x4b')](_0x81b3de['DefaultReportId'])){logger[_0x2984('0x37')](_0x2984('0x53'),_0x81b3de['DefaultReportId']);return analyticDefaultReportController[_0x2984('0x54')]({'id':_0x81b3de[_0x2984('0x55')]},_0x7e5213)['then'](handleResult(_0x81b3de))[_0x2984('0x10')](handleError());}if(!_[_0x2984('0x4b')](_0x81b3de['CustomReportId'])){logger[_0x2984('0x37')](_0x2984('0x56'),_0x81b3de[_0x2984('0x57')]);return analyticCustomReportController[_0x2984('0x54')]({'id':_0x81b3de['CustomReportId']},_0x7e5213)[_0x2984('0xf')](handleResult(_0x81b3de))[_0x2984('0x10')](handleError());}}catch(_0x3fb13a){logger[_0x2984('0x33')](JSON[_0x2984('0x27')](_0x3fb13a));}return logger[_0x2984('0x37')]('no\x20report\x20id');};}function getJobs(_0x2c526d){var _0x5e1cb7={};if(_0x2c526d){_0x5e1cb7['id']=_0x2c526d;}return db[_0x2984('0x58')]['findAll']({'where':_0x5e1cb7,'include':[{'model':db[_0x2984('0x16')],'attributes':['id',_0x2984('0x52'),_0x2984('0x12')],'include':[{'model':db[_0x2984('0x59')],'as':_0x2984('0x17'),'include':[{'model':db[_0x2984('0x5a')],'as':_0x2984('0x5a')}]}]}]})[_0x2984('0xf')](function(_0xcad43a){var _0x129fbf=_['keys'](manager[_0x2984('0x5b')]);var _0x2b52b9=_[_0x2984('0x5c')](_0xcad43a,function(_0x39c5e6){return _0x39c5e6['id'][_0x2984('0x5d')]();});var _0x2238d8=_['keyBy'](_0xcad43a,function(_0x1d87e8){return _0x1d87e8['id'][_0x2984('0x5d')]();});var _0x5b3640=_0x2c526d?_0x2b52b9:_['difference'](_0x2b52b9,_0x129fbf);var _0x1fe1a9=_[_0x2984('0x5e')](_0x2b52b9,_0x129fbf);var _0x2f128e=_[_0x2984('0x5f')](_0x129fbf,_0x2b52b9);var _0x3808cd;var _0x2e2a29;for(_0x3808cd=0x0;_0x3808cd<_0x2f128e[_0x2984('0x60')]&&!_0x2c526d;_0x3808cd+=0x1){_0x2e2a29=_0x2f128e[_0x3808cd][_0x2984('0x5d')]();if(manager['exists'](_0x2e2a29)){manager[_0x2984('0x41')](_0x2e2a29);manager[_0x2984('0x61')](_0x2e2a29);logger[_0x2984('0x37')](_0x2984('0x62'),_0x2e2a29);}}logger['info']('toRun',JSON[_0x2984('0x27')](_0x5b3640));for(_0x3808cd=0x0;_0x3808cd<_0x5b3640[_0x2984('0x60')];_0x3808cd+=0x1){_0x2e2a29=_0x5b3640[_0x3808cd][_0x2984('0x5d')]();if(_0x2c526d){logger[_0x2984('0x37')](JSON[_0x2984('0x27')](_0x2238d8[_0x2e2a29]));BPromise[_0x2984('0x63')]()[_0x2984('0xf')](handleJob(_0x2238d8[_0x2e2a29]));logger['info']('run\x20job',_0x2238d8[_0x2e2a29][_0x2984('0x52')],_0x2238d8[_0x2e2a29]['cron']);}else if(_0x2238d8[_0x2e2a29]['cron']&&_0x2238d8[_0x2e2a29]['active']&&moment()[_0x2984('0x64')](_0x2238d8[_0x2e2a29][_0x2984('0x65')],_0x2238d8[_0x2e2a29]['endAt'])){manager[_0x2984('0x66')](_0x2e2a29,_0x2238d8[_0x2e2a29][_0x2984('0x67')],handleJob(_0x2238d8[_0x2e2a29]));manager[_0x2984('0x68')](_0x2e2a29);logger[_0x2984('0x37')]('add\x20cron',_0x2238d8[_0x2e2a29][_0x2984('0x52')],_0x2238d8[_0x2e2a29][_0x2984('0x67')]);}else if(manager['exists'](_0x2e2a29)){manager['stop'](_0x2e2a29);manager[_0x2984('0x61')](_0x2e2a29);logger[_0x2984('0x37')](_0x2984('0x69'),_0x2238d8[_0x2e2a29]['name'],_0x2238d8[_0x2e2a29][_0x2984('0x67')]);}}for(_0x3808cd=0x0,_0x2e2a29;_0x3808cd<_0x1fe1a9[_0x2984('0x60')]&&!_0x2c526d;_0x3808cd+=0x1){_0x2e2a29=_0x1fe1a9[_0x3808cd][_0x2984('0x5d')]();if(manager[_0x2984('0x6a')](_0x2e2a29)){if(_0x2238d8[_0x2e2a29]['cron']&&_0x2238d8[_0x2e2a29][_0x2984('0x6b')]&&moment()[_0x2984('0x64')](_0x2238d8[_0x2e2a29][_0x2984('0x65')],_0x2238d8[_0x2e2a29][_0x2984('0x6c')])){manager[_0x2984('0x6d')](_0x2e2a29,_0x2238d8[_0x2e2a29][_0x2984('0x67')],handleJob(_0x2238d8[_0x2e2a29]));logger[_0x2984('0x37')](_0x2984('0x6e'),_0x2238d8[_0x2e2a29][_0x2984('0x52')],_0x2238d8[_0x2e2a29][_0x2984('0x67')]);}else{manager[_0x2984('0x41')](_0x2e2a29);manager[_0x2984('0x61')](_0x2e2a29);logger['info'](_0x2984('0x69'),_0x2238d8[_0x2e2a29][_0x2984('0x52')],_0x2238d8[_0x2e2a29][_0x2984('0x67')]);}}}})[_0x2984('0x10')](function(_0x464697){logger[_0x2984('0x33')](JSON[_0x2984('0x27')](_0x464697));});}exports['run']=function(_0x4fa592){return getJobs(_0x4fa592);};exports[_0x2984('0x68')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0xb155=['startAt','update','update\x20cron','stop\x20cron','run','util','path','lodash','moment','cron-job-manager','jayson/promise','../logger','schedule','../../mysqldb','retry','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','AnalyticExtractedReport','then','catch','error','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','format','\x22%s\x22\x20<%s>','name','Smtp','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','basename','zip','Sent','attachments','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','status','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','Report\x20still\x20running\x20after\x20timeout.\x0aYou\x20can\x20find\x20the\x20report\x20when\x20it\x20will\x20be\x20completed\x20in\x20Analytics\x20->\x20Extracted\x20Reports.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','Completed','[handleSendEmail]\x20Unrecognized\x20status:','request','SendMail','email\x20sent','error\x20mail','case\x20loading','currentAttempt','retries','job','operation','stop','data','case\x20failed','Unrecognized\x20status:','dataValues','Job\x20ID\x20','report\x20status:','sendMail','isNil','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','CloudProvider','keys','jobs','toString','keyBy','difference','intersection','length','delete\x20cron','toRun','resolve','run\x20job','cron','active','isBetween','endAt','add','start','exists','deleteJob'];(function(_0x1102f5,_0x571721){var _0x442222=function(_0x261ce0){while(--_0x261ce0){_0x1102f5['push'](_0x1102f5['shift']());}};_0x442222(++_0x571721);}(_0xb155,0x134));var _0x5b15=function(_0x57da0a,_0x284aed){_0x57da0a=_0x57da0a-0x0;var _0x3145d5=_0xb155[_0x57da0a];return _0x3145d5;};'use strict';var fs=require('fs');var util=require(_0x5b15('0x0'));var path=require(_0x5b15('0x1'));var _=require(_0x5b15('0x2'));var moment=require(_0x5b15('0x3'));var CronJobManager=require(_0x5b15('0x4'));var jayson=require(_0x5b15('0x5'));var BPromise=require('bluebird');var logger=require(_0x5b15('0x6'))(_0x5b15('0x7'));var db=require(_0x5b15('0x8'))['db'];const retry=require(_0x5b15('0x9'));var analyticCustomReportController=require(_0x5b15('0xa'));var analyticDefaultReportController=require(_0x5b15('0xb'));var client=jayson[_0x5b15('0xc')]['http']({'port':0x232b});var manager=new CronJobManager();function getReportData(_0x4f79d4){const _0x7ba906={};if(typeof _0x4f79d4==='number'){_0x7ba906['id']=_0x4f79d4;}return db[_0x5b15('0xd')]['findOne']({'where':_0x7ba906})[_0x5b15('0xe')](function(_0x2ec5e7){return _0x2ec5e7;})[_0x5b15('0xf')](function(_0x579b8c){logger[_0x5b15('0x10')](_0x579b8c);});}function handleSendEmail(_0x215eec,_0x155ee6){logger['info'](_0x5b15('0x11'),_0x215eec[_0x5b15('0x12')]);var _0x23c69b=!![];var _0x217441=_0x215eec[_0x5b15('0x13')]['getSmtpOptions']();var _0x5d286a={'account':_0x217441,'message':{'from':util[_0x5b15('0x14')](_0x5b15('0x15'),_0x215eec[_0x5b15('0x13')][_0x5b15('0x16')],_0x215eec[_0x5b15('0x13')]['email']||_0x215eec[_0x5b15('0x13')][_0x5b15('0x17')][_0x5b15('0x18')]),'to':_0x215eec[_0x5b15('0x12')],'cc':_0x215eec['cc'],'bcc':_0x215eec[_0x5b15('0x19')],'subject':util['format'](_0x5b15('0x1a'),_0x155ee6[_0x5b15('0x16')],_0x215eec[_0x5b15('0x1b')],_0x215eec[_0x5b15('0x1c')])}};var _0x638421=path[_0x5b15('0x1d')](__dirname,_0x5b15('0x1e'));var _0x3e1ccc=_0x155ee6[_0x5b15('0x1f')];var _0x43f0b4=util[_0x5b15('0x14')]('%s.%s',path[_0x5b15('0x20')](_0x155ee6[_0x5b15('0x1f')],path['extname'](_0x155ee6['savename'])),_0x5b15('0x21'));var _0x52706e=path[_0x5b15('0x1d')](_0x638421,_0x3e1ccc);var _0x419cd4=path[_0x5b15('0x1d')](_0x638421,_0x43f0b4);if(fs['existsSync'](_0x52706e)){_0x155ee6['status']=_0x5b15('0x22');_0x5d286a['message'][_0x5b15('0x23')]=[{'filename':_0x3e1ccc,'path':_0x52706e}];_0x5d286a[_0x5b15('0x24')]['text']=util[_0x5b15('0x14')](_0x5b15('0x25'),JSON[_0x5b15('0x26')](_0x155ee6,null,0x2));}else if(fs[_0x5b15('0x27')](_0x419cd4)){_0x155ee6[_0x5b15('0x28')]=_0x5b15('0x22');_0x5d286a['message']['attachments']=[{'filename':_0x43f0b4,'path':_0x419cd4}];}else{if(_0x155ee6[_0x5b15('0x28')]==='Empty'){_0x5d286a['message'][_0x5b15('0x29')]=_0x5b15('0x2a');if(!_0x215eec[_0x5b15('0x2b')]){_0x23c69b=![];logger[_0x5b15('0x2c')](_0x5b15('0x2d'));}}else if(_0x155ee6[_0x5b15('0x28')]==='Loading'){_0x5d286a['message']['text']=_0x5b15('0x2e');}else if(_0x155ee6['status']===_0x5b15('0x2f')){_0x5d286a[_0x5b15('0x24')][_0x5b15('0x29')]='Report\x20file\x20creation\x20still\x20running\x20after\x20timeout.\x0aYou\x20can\x20find\x20the\x20report\x20when\x20it\x20will\x20be\x20completed\x20in\x20Analytics\x20->\x20Extracted\x20Reports.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';}else if(_0x155ee6['status']==='Failed'){_0x5d286a[_0x5b15('0x24')][_0x5b15('0x29')]='Report\x20extraction\x20procedure\x20has\x20run\x20into\x20an\x20unexpected\x20error.\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';}else{logger[_0x5b15('0x10')](_0x5b15('0x30'),_0x155ee6[_0x5b15('0x28')]);}}if(_0x23c69b){return client[_0x5b15('0x31')](_0x5b15('0x32'),_0x5d286a)[_0x5b15('0xe')](function(_0x1c565a){if(_0x1c565a[_0x5b15('0x10')]){return logger[_0x5b15('0x10')]('error\x20mail',JSON['stringify'](_0x1c565a));}return logger[_0x5b15('0x2c')](_0x5b15('0x33'));})[_0x5b15('0xf')](function(_0x468b99){return logger[_0x5b15('0x10')](_0x5b15('0x34'),JSON['stringify'](_0x468b99));});}}function handleError(){return function(_0x5da25d){return logger['error'](JSON[_0x5b15('0x26')](_0x5da25d));};}function loading(_0x5660da){logger[_0x5b15('0x2c')](_0x5b15('0x35'));if(_0x5660da[_0x5b15('0x36')]===_0x5660da['retryOptions'][_0x5b15('0x37')]){handleSendEmail(_0x5660da[_0x5b15('0x38')],_0x5660da['data']);_0x5660da[_0x5b15('0x39')][_0x5b15('0x3a')]();}else{_0x5660da['operation'][_0x5b15('0x9')]('still\x20loading');}}function completed(_0x3e186b){logger['info']('case\x20completed');handleSendEmail(_0x3e186b[_0x5b15('0x38')],_0x3e186b[_0x5b15('0x3b')]);_0x3e186b[_0x5b15('0x39')][_0x5b15('0x3a')]();}function empty(_0x19f832){logger[_0x5b15('0x2c')]('case\x20empty');handleSendEmail(_0x19f832[_0x5b15('0x38')],_0x19f832[_0x5b15('0x3b')]);_0x19f832[_0x5b15('0x39')][_0x5b15('0x3a')]();}function failed(_0x30e164){logger[_0x5b15('0x2c')](_0x5b15('0x3c'));handleSendEmail(_0x30e164[_0x5b15('0x38')],_0x30e164[_0x5b15('0x3b')]);_0x30e164[_0x5b15('0x39')][_0x5b15('0x3a')]();}function urecognized(_0x5a10e6){logger['error'](_0x5b15('0x3d'),_0x5a10e6['entity'][_0x5b15('0x3e')]['status']);_0x5a10e6[_0x5b15('0x39')][_0x5b15('0x3a')]();}const reportStatusStrategies={'Loading':loading,'Completed':completed,'Empty':empty,'Failed':failed,'Unrecognized':urecognized};function retryer(_0x356e4e,_0x7e2434){const _0x32b08d={'retries':0x3,'factor':0x2,'minTimeout':0x5b*0x3e8,'maxTimeout':0xa*0x3c*0x3e8};const _0x6c1ba5=retry[_0x5b15('0x39')](_0x32b08d);_0x6c1ba5['attempt'](_0x4b36bf=>{logger[_0x5b15('0x2c')](_0x5b15('0x3f')+_0x356e4e['id']+'\x20Attempt\x20#:'+_0x4b36bf);try{getReportData(_0x7e2434['id'])[_0x5b15('0xe')](function(_0x5638bf){_0x7e2434=_0x5638bf;logger[_0x5b15('0x2c')]('report\x20status:',_0x5638bf[_0x5b15('0x3e')][_0x5b15('0x28')]);if(!reportStatusStrategies[_0x5638bf[_0x5b15('0x3e')][_0x5b15('0x28')]]){logger[_0x5b15('0x10')](_0x5b15('0x40'),_0x5638bf[_0x5b15('0x3e')][_0x5b15('0x28')]);_0x6c1ba5['retry']();}reportStatusStrategies[_0x5638bf['dataValues'][_0x5b15('0x28')]]({'operation':_0x6c1ba5,'currentAttempt':_0x4b36bf,'retryOptions':_0x32b08d,'job':_0x356e4e,'data':_0x7e2434,'entity':_0x5638bf});});}catch(_0x3b9823){_0x6c1ba5[_0x5b15('0x9')](_0x3b9823);}});}function handleResult(_0x1bff63){return function(_0x6b35fc){if(_0x1bff63[_0x5b15('0x41')]&&_0x1bff63['MailAccount']&&_0x1bff63[_0x5b15('0x13')][_0x5b15('0x17')]&&!_[_0x5b15('0x42')](_0x1bff63['email'])){retryer(_0x1bff63,_0x6b35fc);}};}function handleJob(_0x4c09a1){return function(){try{if(_[_0x5b15('0x42')](_0x4c09a1[_0x5b15('0x1b')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x5b15('0x42')](_0x4c09a1[_0x5b15('0x1c')])){return logger['info'](_0x5b15('0x43'));}var _0xd7bc0f={'startDate':moment()['subtract'](_0x4c09a1[_0x5b15('0x1b')],_0x4c09a1['subtractUnit'])[_0x5b15('0x14')](_0x5b15('0x44')),'endDate':moment()[_0x5b15('0x14')](_0x5b15('0x44')),'type':'scheduled','output':_0x4c09a1[_0x5b15('0x45')],'name':_0x4c09a1[_0x5b15('0x16')]};if(!_[_0x5b15('0x42')](_0x4c09a1[_0x5b15('0x46')])){logger['info']('exec\x20defaul\x20report\x20id:%s',_0x4c09a1['DefaultReportId']);return analyticDefaultReportController[_0x5b15('0x47')]({'id':_0x4c09a1[_0x5b15('0x46')]},_0xd7bc0f)[_0x5b15('0xe')](handleResult(_0x4c09a1))[_0x5b15('0xf')](handleError());}if(!_[_0x5b15('0x42')](_0x4c09a1[_0x5b15('0x48')])){logger['info'](_0x5b15('0x49'),_0x4c09a1[_0x5b15('0x48')]);return analyticCustomReportController[_0x5b15('0x47')]({'id':_0x4c09a1[_0x5b15('0x48')]},_0xd7bc0f)[_0x5b15('0xe')](handleResult(_0x4c09a1))[_0x5b15('0xf')](handleError());}}catch(_0x5d4b9f){logger[_0x5b15('0x10')](JSON[_0x5b15('0x26')](_0x5d4b9f));}return logger[_0x5b15('0x2c')](_0x5b15('0x4a'));};}function getJobs(_0x577379){var _0x4a03ed={};if(_0x577379){_0x4a03ed['id']=_0x577379;}return db[_0x5b15('0x4b')]['findAll']({'where':_0x4a03ed,'include':[{'model':db[_0x5b15('0x13')],'attributes':['id',_0x5b15('0x16'),_0x5b15('0x12')],'include':[{'model':db['MailServerOut'],'as':_0x5b15('0x17'),'include':[{'model':db[_0x5b15('0x4c')],'as':_0x5b15('0x4c')}]}]}]})[_0x5b15('0xe')](function(_0x1de88a){var _0x7bb0d2=_[_0x5b15('0x4d')](manager[_0x5b15('0x4e')]);var _0x4cd8f6=_['map'](_0x1de88a,function(_0x492e5c){return _0x492e5c['id'][_0x5b15('0x4f')]();});var _0x2199d5=_[_0x5b15('0x50')](_0x1de88a,function(_0x5926ad){return _0x5926ad['id'][_0x5b15('0x4f')]();});var _0x5088c8=_0x577379?_0x4cd8f6:_[_0x5b15('0x51')](_0x4cd8f6,_0x7bb0d2);var _0x566f1b=_[_0x5b15('0x52')](_0x4cd8f6,_0x7bb0d2);var _0x3fb239=_['difference'](_0x7bb0d2,_0x4cd8f6);var _0x5ed2c6;var _0x56f04b;for(_0x5ed2c6=0x0;_0x5ed2c6<_0x3fb239[_0x5b15('0x53')]&&!_0x577379;_0x5ed2c6+=0x1){_0x56f04b=_0x3fb239[_0x5ed2c6][_0x5b15('0x4f')]();if(manager['exists'](_0x56f04b)){manager['stop'](_0x56f04b);manager['deleteJob'](_0x56f04b);logger[_0x5b15('0x2c')](_0x5b15('0x54'),_0x56f04b);}}logger[_0x5b15('0x2c')](_0x5b15('0x55'),JSON[_0x5b15('0x26')](_0x5088c8));for(_0x5ed2c6=0x0;_0x5ed2c6<_0x5088c8[_0x5b15('0x53')];_0x5ed2c6+=0x1){_0x56f04b=_0x5088c8[_0x5ed2c6][_0x5b15('0x4f')]();if(_0x577379){logger[_0x5b15('0x2c')](JSON[_0x5b15('0x26')](_0x2199d5[_0x56f04b]));BPromise[_0x5b15('0x56')]()[_0x5b15('0xe')](handleJob(_0x2199d5[_0x56f04b]));logger[_0x5b15('0x2c')](_0x5b15('0x57'),_0x2199d5[_0x56f04b]['name'],_0x2199d5[_0x56f04b]['cron']);}else if(_0x2199d5[_0x56f04b][_0x5b15('0x58')]&&_0x2199d5[_0x56f04b][_0x5b15('0x59')]&&moment()[_0x5b15('0x5a')](_0x2199d5[_0x56f04b]['startAt'],_0x2199d5[_0x56f04b][_0x5b15('0x5b')])){manager[_0x5b15('0x5c')](_0x56f04b,_0x2199d5[_0x56f04b][_0x5b15('0x58')],handleJob(_0x2199d5[_0x56f04b]));manager[_0x5b15('0x5d')](_0x56f04b);logger[_0x5b15('0x2c')]('add\x20cron',_0x2199d5[_0x56f04b][_0x5b15('0x16')],_0x2199d5[_0x56f04b][_0x5b15('0x58')]);}else if(manager[_0x5b15('0x5e')](_0x56f04b)){manager[_0x5b15('0x3a')](_0x56f04b);manager[_0x5b15('0x5f')](_0x56f04b);logger[_0x5b15('0x2c')]('stop\x20cron',_0x2199d5[_0x56f04b][_0x5b15('0x16')],_0x2199d5[_0x56f04b]['cron']);}}for(_0x5ed2c6=0x0,_0x56f04b;_0x5ed2c6<_0x566f1b[_0x5b15('0x53')]&&!_0x577379;_0x5ed2c6+=0x1){_0x56f04b=_0x566f1b[_0x5ed2c6][_0x5b15('0x4f')]();if(manager[_0x5b15('0x5e')](_0x56f04b)){if(_0x2199d5[_0x56f04b][_0x5b15('0x58')]&&_0x2199d5[_0x56f04b][_0x5b15('0x59')]&&moment()[_0x5b15('0x5a')](_0x2199d5[_0x56f04b][_0x5b15('0x60')],_0x2199d5[_0x56f04b][_0x5b15('0x5b')])){manager[_0x5b15('0x61')](_0x56f04b,_0x2199d5[_0x56f04b][_0x5b15('0x58')],handleJob(_0x2199d5[_0x56f04b]));logger[_0x5b15('0x2c')](_0x5b15('0x62'),_0x2199d5[_0x56f04b][_0x5b15('0x16')],_0x2199d5[_0x56f04b][_0x5b15('0x58')]);}else{manager[_0x5b15('0x3a')](_0x56f04b);manager['deleteJob'](_0x56f04b);logger[_0x5b15('0x2c')](_0x5b15('0x63'),_0x2199d5[_0x56f04b][_0x5b15('0x16')],_0x2199d5[_0x56f04b][_0x5b15('0x58')]);}}}})[_0x5b15('0xf')](function(_0x1a01e4){logger['error'](JSON[_0x5b15('0x26')](_0x1a01e4));});}exports[_0x5b15('0x64')]=function(_0x3c2d61){return getJobs(_0x3c2d61);};exports[_0x5b15('0x5d')]=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 5fd303d..eb58642 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 _0xe0c0=['name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','error','lodash','request-promise','util','bluebird','../../mysqldb','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data2','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','data1','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Positive','Negative','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','catch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe0c0,0xa7));var _0x0e0c=function(_0x38852f,_0x492996){_0x38852f=_0x38852f-0x0;var _0x5f7075=_0xe0c0[_0x38852f];return _0x5f7075;};var _=require(_0x0e0c('0x0'));var AWS=require('aws-sdk');var rp=require(_0x0e0c('0x1'));var util=require(_0x0e0c('0x2'));var BPromise=require(_0x0e0c('0x3'));var db=require(_0x0e0c('0x4'))['db'];var logger=require('../../config/logger')(_0x0e0c('0x5'));function getTranscriptionJob(_0x289810,_0x373046,_0x54c73b,_0x4271d1){return new Promise(function(_0x2856d7,_0x4a094c){var _0x14e5de=new AWS[(_0x0e0c('0x6'))]({'accessKeyId':_0x373046,'secretAccessKey':_0x289810,'region':_0x54c73b});_0x14e5de[_0x0e0c('0x7')]({'TranscriptionJobName':_0x4271d1},function(_0x13e45d,_0xe3ccce){if(_0x13e45d){return _0x4a094c(_0x13e45d);}else{return _0x2856d7(_0xe3ccce);}});});}function sentiment(_0x512f83,_0x4bc377,_0x518486,_0x2bd09c,_0x5b347b){return new Promise(function(_0xb2aa1d,_0xe4469){var _0x1ae848=new AWS[(_0x0e0c('0x8'))]({'accessKeyId':_0x4bc377,'secretAccessKey':_0x512f83,'region':_0x518486});_0x1ae848[_0x0e0c('0x9')]({'Text':_0x2bd09c,'LanguageCode':_0x5b347b[_0x0e0c('0xa')](0x0,0x2)},function(_0x45b7fb,_0x348502){if(_0x45b7fb){return _0xe4469(_0x45b7fb);}else{return _0xb2aa1d(_0x348502);}});});}function checkTranscribeJob(_0x5b514a,_0x246fd6,_0x5c31c7){var _0x5794fa;return new BPromise(function(_0x117d5b,_0x190751){logger[_0x0e0c('0xb')](util[_0x0e0c('0xc')](_0x0e0c('0xd'),_0x5b514a['id'],_0x5b514a[_0x0e0c('0xe')]));return getTranscriptionJob(_0x5c31c7['data1'],_0x5c31c7[_0x0e0c('0xf')],_0x246fd6[_0x0e0c('0x10')],_0x5b514a[_0x0e0c('0xe')])['then'](function(_0x368ba0){logger[_0x0e0c('0xb')](util[_0x0e0c('0xc')](_0x0e0c('0x11'),_0x5b514a['id'],_0x5b514a[_0x0e0c('0xe')],_0x368ba0[_0x0e0c('0x12')][_0x0e0c('0x13')]));if(!_0x5b514a[_0x0e0c('0x14')]){switch(_0x368ba0[_0x0e0c('0x12')]['TranscriptionJobStatus']){case _0x0e0c('0x15'):var _0x4dcc04={'transcribeStatus':_0x368ba0['TranscriptionJob']['TranscriptionJobStatus'],'fileUri':_0x368ba0[_0x0e0c('0x12')][_0x0e0c('0x16')][_0x0e0c('0x17')]};logger[_0x0e0c('0xb')](util[_0x0e0c('0xc')](_0x0e0c('0x18'),_0x5b514a['id']));return rp({'uri':_0x368ba0['TranscriptionJob'][_0x0e0c('0x16')]['TranscriptFileUri'],'json':!![]})[_0x0e0c('0x19')](function(_0x4419e9){logger[_0x0e0c('0xb')](util[_0x0e0c('0xc')](_0x0e0c('0x1a'),_0x5b514a['id']));if(_0x4419e9&&_0x4419e9['results']&&_0x4419e9[_0x0e0c('0x1b')][_0x0e0c('0x1c')]&&_0x4419e9[_0x0e0c('0x1b')][_0x0e0c('0x1c')][_0x0e0c('0x1d')]){_0x4dcc04[_0x0e0c('0x14')]='';for(var _0x3564cc=0x0;_0x3564cc<_0x4419e9[_0x0e0c('0x1b')][_0x0e0c('0x1c')][_0x0e0c('0x1d')];_0x3564cc++){_0x4dcc04['fileText']+=_0x4419e9[_0x0e0c('0x1b')][_0x0e0c('0x1c')][_0x3564cc]['transcript']+'';}}return _0x5b514a[_0x0e0c('0x1e')](_0x4dcc04);})[_0x0e0c('0x19')](function(){logger['info'](util[_0x0e0c('0xc')](_0x0e0c('0x1f'),_0x5b514a['id']));if(!_0x5b514a[_0x0e0c('0x20')]){throw new db[(_0x0e0c('0x21'))][(_0x0e0c('0x22'))](_0x0e0c('0x23'));}if(!_0x246fd6[_0x0e0c('0x24')]||!_0x246fd6[_0x0e0c('0x25')]||!_0x246fd6[_0x0e0c('0x26')]||!_0x246fd6[_0x0e0c('0x27')]||!_0x246fd6[_0x0e0c('0x28')]){throw new db[(_0x0e0c('0x21'))][(_0x0e0c('0x22'))](_0x0e0c('0x29'));}if(!_0x4dcc04[_0x0e0c('0x14')]){throw new Error(_0x0e0c('0x2a'));}if(_0x246fd6['sentimentAccountId']===_0x5c31c7['id']){return _0x5c31c7;}else{return db[_0x0e0c('0x2b')][_0x0e0c('0x2c')]({'where':{'id':_settings[_0x0e0c('0x25')]}});}})[_0x0e0c('0x19')](function(_0x289fc6){if(!_0x289fc6){throw new db['Sequelize'][(_0x0e0c('0x22'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x289fc6[_0x0e0c('0x2d')]||!_0x289fc6[_0x0e0c('0xf')]){throw new db['Sequelize']['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x5794fa=_0x289fc6;logger['info'](util[_0x0e0c('0xc')](_0x0e0c('0x2e'),_0x5b514a['id']));return sentiment(_0x5794fa[_0x0e0c('0x2d')],_0x5794fa['data2'],_0x246fd6['sentimentRegion'],_0x4dcc04[_0x0e0c('0x14')],_0x246fd6[_0x0e0c('0x27')]);})['then'](function(_0x569e69){logger[_0x0e0c('0xb')](util['format'](_0x0e0c('0x2f'),_0x5b514a['id']));return _0x5b514a[_0x0e0c('0x1e')]({'sentiment':_0x569e69[_0x0e0c('0x30')],'sPositive':_0x569e69[_0x0e0c('0x31')][_0x0e0c('0x32')],'sNegative':_0x569e69[_0x0e0c('0x31')][_0x0e0c('0x33')],'sMixed':_0x569e69['SentimentScore'][_0x0e0c('0x34')],'sNeutral':_0x569e69[_0x0e0c('0x31')][_0x0e0c('0x35')]});})[_0x0e0c('0x19')](function(){logger[_0x0e0c('0xb')](util[_0x0e0c('0xc')](_0x0e0c('0x1f'),_0x5b514a['id']));_0x117d5b();});case _0x0e0c('0x36'):return _0x5b514a['update']({'transcribeStatus':'FAILED','failureReason':_0x368ba0[_0x0e0c('0x12')][_0x0e0c('0x37')]})[_0x0e0c('0x19')](function(){logger[_0x0e0c('0xb')](util['format'](_0x0e0c('0x1f'),_0x5b514a['id']));_0x117d5b();});default:logger['info'](util['format'](_0x0e0c('0x38'),_0x5b514a['id']));break;}}else{return BPromise[_0x0e0c('0x39')]()[_0x0e0c('0x19')](function(){if(!_0x5b514a[_0x0e0c('0x20')]){throw new db[(_0x0e0c('0x21'))][(_0x0e0c('0x22'))](_0x0e0c('0x23'));}if(!_0x246fd6[_0x0e0c('0x24')]||!_0x246fd6[_0x0e0c('0x25')]||!_0x246fd6[_0x0e0c('0x26')]||!_0x246fd6['language']||!_0x246fd6[_0x0e0c('0x28')]){throw new db[(_0x0e0c('0x21'))]['ValidationError'](_0x0e0c('0x29'));}if(!_0x5b514a[_0x0e0c('0x14')]){throw new Error(_0x0e0c('0x2a'));}if(_0x246fd6[_0x0e0c('0x25')]===_0x5c31c7['id']){return _0x5c31c7;}else{return db[_0x0e0c('0x2b')][_0x0e0c('0x2c')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x0e0c('0x19')](function(_0x372061){if(!_0x372061){throw new db[(_0x0e0c('0x21'))][(_0x0e0c('0x22'))](_0x0e0c('0x3a'));}if(!_0x372061[_0x0e0c('0x2d')]||!_0x372061[_0x0e0c('0xf')]){throw new db['Sequelize']['ValidationError'](_0x0e0c('0x3b'));}_0x5794fa=_0x372061;logger['info'](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x5b514a['id']));return sentiment(_0x5794fa[_0x0e0c('0x2d')],_0x5794fa[_0x0e0c('0xf')],_0x246fd6[_0x0e0c('0x26')],_0x5b514a[_0x0e0c('0x14')],_0x246fd6[_0x0e0c('0x27')]);})[_0x0e0c('0x19')](function(_0x7bcc2b){logger[_0x0e0c('0xb')](util[_0x0e0c('0xc')](_0x0e0c('0x2f'),_0x5b514a['id']));return _0x5b514a[_0x0e0c('0x1e')]({'sentiment':_0x7bcc2b[_0x0e0c('0x30')],'sPositive':_0x7bcc2b['SentimentScore'][_0x0e0c('0x32')],'sNegative':_0x7bcc2b[_0x0e0c('0x31')][_0x0e0c('0x33')],'sMixed':_0x7bcc2b[_0x0e0c('0x31')]['Mixed'],'sNeutral':_0x7bcc2b[_0x0e0c('0x31')][_0x0e0c('0x35')],'transcribeStatus':_0x0e0c('0x15')});})[_0x0e0c('0x19')](function(){logger[_0x0e0c('0xb')](util[_0x0e0c('0xc')](_0x0e0c('0x1f'),_0x5b514a['id']));_0x117d5b();});}})[_0x0e0c('0x3c')](function(_0x1554de){if(_0x1554de){if(!_0x1554de['name']||_0x1554de[_0x0e0c('0x3d')]!==_0x0e0c('0x3e')){logger['error'](util['format'](_0x0e0c('0x3f'),_0x5b514a['id']),util[_0x0e0c('0x40')](_0x1554de,{'showHidden':![],'depth':null}));}}_0x117d5b();});});}function checkTranscribe(){var _0x321990;var _0x541e90;var _0x29c971;return db[_0x0e0c('0x41')][_0x0e0c('0x42')]({'where':{'transcribeStatus':_0x0e0c('0x43')}})['then'](function(_0x5e8c7a){if(!_0x5e8c7a||!_0x5e8c7a[_0x0e0c('0x1d')]){throw new db[(_0x0e0c('0x21'))][(_0x0e0c('0x22'))](_0x0e0c('0x44'));}_0x321990=_0x5e8c7a;return db[_0x0e0c('0x45')]['findOne']({'where':{'id':0x1}});})['then'](function(_0x6e907c){if(!_0x6e907c){throw new db['Sequelize'][(_0x0e0c('0x22'))](_0x0e0c('0x46'));}_0x541e90=_0x6e907c;if(!_0x541e90[_0x0e0c('0x5')]||!_0x541e90[_0x0e0c('0x47')]||!_0x541e90['transcribeRegion']||!_0x541e90[_0x0e0c('0x27')]||!_0x541e90['bucket']){throw new db[(_0x0e0c('0x21'))][(_0x0e0c('0x22'))](_0x0e0c('0x48'));}return db[_0x0e0c('0x2b')][_0x0e0c('0x2c')]({'where':{'id':_0x541e90[_0x0e0c('0x47')]}});})['then'](function(_0x4faf89){if(!_0x4faf89){throw new db[(_0x0e0c('0x21'))][(_0x0e0c('0x22'))](_0x0e0c('0x3a'));}if(!_0x4faf89[_0x0e0c('0x2d')]||!_0x4faf89['data2']){throw new db[(_0x0e0c('0x21'))][(_0x0e0c('0x22'))]('Cloud\x20Provider\x20not\x20configured');}_0x29c971=_0x4faf89;var _0x4d5095=[];_0x321990[_0x0e0c('0x49')](function(_0x166427){_0x4d5095[_0x0e0c('0x4a')](checkTranscribeJob(_0x166427,_0x541e90,_0x29c971));});return BPromise['all'](_0x4d5095);})[_0x0e0c('0x3c')](function(_0x8fafa3){if(_0x8fafa3){if(!_0x8fafa3[_0x0e0c('0x3d')]||_0x8fafa3[_0x0e0c('0x3d')]!==_0x0e0c('0x3e')){logger[_0x0e0c('0x4b')](util[_0x0e0c('0x40')](_0x8fafa3,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x220b=['transcribeName','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','sentimentAccountId','sentimentRegion','language','bucket','Sequelize','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Negative','Mixed','SentimentScore','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20requested','sentiment','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Positive','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Settings\x20not\x20available','transcribe','transcribeAccountId','Transcribe\x20not\x20configured','all','aws-sdk','request-promise','util','bluebird','../../config/logger','TranscribeService','getTranscriptionJob','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','data2','transcribeRegion'];(function(_0x364bad,_0xa51113){var _0x1153a0=function(_0x41c2ef){while(--_0x41c2ef){_0x364bad['push'](_0x364bad['shift']());}};_0x1153a0(++_0xa51113);}(_0x220b,0x1a2));var _0xb220=function(_0x2c9b79,_0x7cf58b){_0x2c9b79=_0x2c9b79-0x0;var _0x265032=_0x220b[_0x2c9b79];return _0x265032;};var _=require('lodash');var AWS=require(_0xb220('0x0'));var rp=require(_0xb220('0x1'));var util=require(_0xb220('0x2'));var BPromise=require(_0xb220('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0xb220('0x4'))('transcribe');function getTranscriptionJob(_0x1aa3b8,_0x4dc358,_0x124b93,_0x2ff855){return new Promise(function(_0x1d2be4,_0x366a4d){var _0x5d7d19=new AWS[(_0xb220('0x5'))]({'accessKeyId':_0x4dc358,'secretAccessKey':_0x1aa3b8,'region':_0x124b93});_0x5d7d19[_0xb220('0x6')]({'TranscriptionJobName':_0x2ff855},function(_0x5b83b9,_0x12c68c){if(_0x5b83b9){return _0x366a4d(_0x5b83b9);}else{return _0x1d2be4(_0x12c68c);}});});}function sentiment(_0x3697f3,_0x33ae28,_0x2821a6,_0x16edb6,_0x2aaf7c){return new Promise(function(_0x24e6d9,_0x301978){var _0x1f30ee=new AWS['Comprehend']({'accessKeyId':_0x33ae28,'secretAccessKey':_0x3697f3,'region':_0x2821a6});_0x1f30ee[_0xb220('0x7')]({'Text':_0x16edb6,'LanguageCode':_0x2aaf7c[_0xb220('0x8')](0x0,0x2)},function(_0x5b39d5,_0x5c9af1){if(_0x5b39d5){return _0x301978(_0x5b39d5);}else{return _0x24e6d9(_0x5c9af1);}});});}function checkTranscribeJob(_0x4e6ba7,_0x528ce0,_0x59ef3e){var _0x11229c;return new BPromise(function(_0x573971,_0x3c310c){logger[_0xb220('0x9')](util[_0xb220('0xa')](_0xb220('0xb'),_0x4e6ba7['id'],_0x4e6ba7['transcribeName']));return getTranscriptionJob(_0x59ef3e['data1'],_0x59ef3e[_0xb220('0xc')],_0x528ce0[_0xb220('0xd')],_0x4e6ba7[_0xb220('0xe')])[_0xb220('0xf')](function(_0x16a34b){logger[_0xb220('0x9')](util[_0xb220('0xa')](_0xb220('0x10'),_0x4e6ba7['id'],_0x4e6ba7[_0xb220('0xe')],_0x16a34b[_0xb220('0x11')][_0xb220('0x12')]));if(!_0x4e6ba7[_0xb220('0x13')]){switch(_0x16a34b[_0xb220('0x11')][_0xb220('0x12')]){case _0xb220('0x14'):var _0xe10309={'transcribeStatus':_0x16a34b[_0xb220('0x11')][_0xb220('0x12')],'fileUri':_0x16a34b[_0xb220('0x11')][_0xb220('0x15')][_0xb220('0x16')]};logger[_0xb220('0x9')](util[_0xb220('0xa')](_0xb220('0x17'),_0x4e6ba7['id']));return rp({'uri':_0x16a34b['TranscriptionJob'][_0xb220('0x15')]['TranscriptFileUri'],'json':!![]})[_0xb220('0xf')](function(_0x5c4d46){logger[_0xb220('0x9')](util['format'](_0xb220('0x18'),_0x4e6ba7['id']));if(_0x5c4d46&&_0x5c4d46[_0xb220('0x19')]&&_0x5c4d46[_0xb220('0x19')][_0xb220('0x1a')]&&_0x5c4d46[_0xb220('0x19')][_0xb220('0x1a')]['length']){_0xe10309[_0xb220('0x13')]='';for(var _0x108450=0x0;_0x108450<_0x5c4d46[_0xb220('0x19')][_0xb220('0x1a')][_0xb220('0x1b')];_0x108450++){_0xe10309['fileText']+=_0x5c4d46[_0xb220('0x19')][_0xb220('0x1a')][_0x108450]['transcript']+'';}}return _0x4e6ba7[_0xb220('0x1c')](_0xe10309);})[_0xb220('0xf')](function(){logger[_0xb220('0x9')](util[_0xb220('0xa')](_0xb220('0x1d'),_0x4e6ba7['id']));if(!_0x4e6ba7[_0xb220('0x1e')]){throw new db['Sequelize'][(_0xb220('0x1f'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x528ce0['sentiment']||!_0x528ce0[_0xb220('0x20')]||!_0x528ce0[_0xb220('0x21')]||!_0x528ce0[_0xb220('0x22')]||!_0x528ce0[_0xb220('0x23')]){throw new db[(_0xb220('0x24'))][(_0xb220('0x1f'))](_0xb220('0x25'));}if(!_0xe10309[_0xb220('0x13')]){throw new Error(_0xb220('0x26'));}if(_0x528ce0[_0xb220('0x20')]===_0x59ef3e['id']){return _0x59ef3e;}else{return db['CloudProvider'][_0xb220('0x27')]({'where':{'id':_settings[_0xb220('0x20')]}});}})[_0xb220('0xf')](function(_0x5edd84){if(!_0x5edd84){throw new db['Sequelize'][(_0xb220('0x1f'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x5edd84['data1']||!_0x5edd84['data2']){throw new db[(_0xb220('0x24'))][(_0xb220('0x1f'))](_0xb220('0x28'));}_0x11229c=_0x5edd84;logger[_0xb220('0x9')](util[_0xb220('0xa')](_0xb220('0x29'),_0x4e6ba7['id']));return sentiment(_0x11229c['data1'],_0x11229c['data2'],_0x528ce0[_0xb220('0x21')],_0xe10309[_0xb220('0x13')],_0x528ce0['language']);})[_0xb220('0xf')](function(_0x4d855d){logger[_0xb220('0x9')](util[_0xb220('0xa')](_0xb220('0x2a'),_0x4e6ba7['id']));return _0x4e6ba7[_0xb220('0x1c')]({'sentiment':_0x4d855d[_0xb220('0x2b')],'sPositive':_0x4d855d['SentimentScore']['Positive'],'sNegative':_0x4d855d['SentimentScore'][_0xb220('0x2c')],'sMixed':_0x4d855d['SentimentScore'][_0xb220('0x2d')],'sNeutral':_0x4d855d[_0xb220('0x2e')][_0xb220('0x2f')]});})['then'](function(){logger['info'](util[_0xb220('0xa')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4e6ba7['id']));_0x573971();});case _0xb220('0x30'):return _0x4e6ba7[_0xb220('0x1c')]({'transcribeStatus':'FAILED','failureReason':_0x16a34b[_0xb220('0x11')][_0xb220('0x31')]})[_0xb220('0xf')](function(){logger[_0xb220('0x9')](util[_0xb220('0xa')](_0xb220('0x1d'),_0x4e6ba7['id']));_0x573971();});default:logger[_0xb220('0x9')](util[_0xb220('0xa')](_0xb220('0x32'),_0x4e6ba7['id']));break;}}else{return BPromise[_0xb220('0x33')]()[_0xb220('0xf')](function(){if(!_0x4e6ba7[_0xb220('0x1e')]){throw new db[(_0xb220('0x24'))]['ValidationError'](_0xb220('0x34'));}if(!_0x528ce0[_0xb220('0x35')]||!_0x528ce0[_0xb220('0x20')]||!_0x528ce0[_0xb220('0x21')]||!_0x528ce0[_0xb220('0x22')]||!_0x528ce0['bucket']){throw new db[(_0xb220('0x24'))][(_0xb220('0x1f'))](_0xb220('0x25'));}if(!_0x4e6ba7[_0xb220('0x13')]){throw new Error('Transcript\x20not\x20available');}if(_0x528ce0['sentimentAccountId']===_0x59ef3e['id']){return _0x59ef3e;}else{return db[_0xb220('0x36')]['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0xb220('0xf')](function(_0x5dc84b){if(!_0x5dc84b){throw new db['Sequelize'][(_0xb220('0x1f'))](_0xb220('0x37'));}if(!_0x5dc84b[_0xb220('0x38')]||!_0x5dc84b[_0xb220('0xc')]){throw new db[(_0xb220('0x24'))]['ValidationError'](_0xb220('0x28'));}_0x11229c=_0x5dc84b;logger[_0xb220('0x9')](util[_0xb220('0xa')](_0xb220('0x29'),_0x4e6ba7['id']));return sentiment(_0x11229c[_0xb220('0x38')],_0x11229c[_0xb220('0xc')],_0x528ce0[_0xb220('0x21')],_0x4e6ba7[_0xb220('0x13')],_0x528ce0[_0xb220('0x22')]);})['then'](function(_0x494089){logger['info'](util[_0xb220('0xa')](_0xb220('0x2a'),_0x4e6ba7['id']));return _0x4e6ba7[_0xb220('0x1c')]({'sentiment':_0x494089[_0xb220('0x2b')],'sPositive':_0x494089[_0xb220('0x2e')][_0xb220('0x39')],'sNegative':_0x494089[_0xb220('0x2e')][_0xb220('0x2c')],'sMixed':_0x494089[_0xb220('0x2e')][_0xb220('0x2d')],'sNeutral':_0x494089[_0xb220('0x2e')][_0xb220('0x2f')],'transcribeStatus':_0xb220('0x14')});})['then'](function(){logger[_0xb220('0x9')](util[_0xb220('0xa')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4e6ba7['id']));_0x573971();});}})[_0xb220('0x3a')](function(_0x431af1){if(_0x431af1){if(!_0x431af1[_0xb220('0x3b')]||_0x431af1[_0xb220('0x3b')]!==_0xb220('0x3c')){logger[_0xb220('0x3d')](util[_0xb220('0xa')](_0xb220('0x3e'),_0x4e6ba7['id']),util[_0xb220('0x3f')](_0x431af1,{'showHidden':![],'depth':null}));}}_0x573971();});});}function checkTranscribe(){var _0x124901;var _0x4b50d3;var _0x56fb72;return db['VoiceRecording'][_0xb220('0x40')]({'where':{'transcribeStatus':_0xb220('0x41')}})[_0xb220('0xf')](function(_0x375d14){if(!_0x375d14||!_0x375d14['length']){throw new db['Sequelize'][(_0xb220('0x1f'))](_0xb220('0x42'));}_0x124901=_0x375d14;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0xb220('0xf')](function(_0x5ef174){if(!_0x5ef174){throw new db[(_0xb220('0x24'))][(_0xb220('0x1f'))](_0xb220('0x43'));}_0x4b50d3=_0x5ef174;if(!_0x4b50d3[_0xb220('0x44')]||!_0x4b50d3[_0xb220('0x45')]||!_0x4b50d3[_0xb220('0xd')]||!_0x4b50d3['language']||!_0x4b50d3[_0xb220('0x23')]){throw new db[(_0xb220('0x24'))][(_0xb220('0x1f'))](_0xb220('0x46'));}return db[_0xb220('0x36')][_0xb220('0x27')]({'where':{'id':_0x4b50d3['transcribeAccountId']}});})['then'](function(_0x179cc5){if(!_0x179cc5){throw new db[(_0xb220('0x24'))][(_0xb220('0x1f'))](_0xb220('0x37'));}if(!_0x179cc5[_0xb220('0x38')]||!_0x179cc5[_0xb220('0xc')]){throw new db[(_0xb220('0x24'))][(_0xb220('0x1f'))](_0xb220('0x28'));}_0x56fb72=_0x179cc5;var _0x212521=[];_0x124901['forEach'](function(_0x1c5065){_0x212521['push'](checkTranscribeJob(_0x1c5065,_0x4b50d3,_0x56fb72));});return BPromise[_0xb220('0x47')](_0x212521);})[_0xb220('0x3a')](function(_0x139c69){if(_0x139c69){if(!_0x139c69[_0xb220('0x3b')]||_0x139c69[_0xb220('0x3b')]!==_0xb220('0x3c')){logger[_0xb220('0x3d')](util['inspect'](_0x139c69,{'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 ce84ccd..fd3da8f 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 _0x3715=['update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','ioredis','../../mysqldb','../logger','schedule','redis','defaults','localhost','lastMsgAt','subtract','hours','then','length','map','[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction'];(function(_0xd0e64a,_0x4c58d4){var _0x2fad2c=function(_0xa04463){while(--_0xa04463){_0xd0e64a['push'](_0xd0e64a['shift']());}};_0x2fad2c(++_0x4c58d4);}(_0x3715,0x124));var _0x5371=function(_0x53d79e,_0x48919d){_0x53d79e=_0x53d79e-0x0;var _0x14f2d8=_0x3715[_0x53d79e];return _0x14f2d8;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0x5371('0x0'));var util=require('util');var config=require('../../config/environment');var db=require(_0x5371('0x1'))['db'];var logger=require(_0x5371('0x2'))(_0x5371('0x3'));config[_0x5371('0x4')]=_[_0x5371('0x5')](config[_0x5371('0x4')],{'host':_0x5371('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5371('0x4')]));function closeInteractions(){var _0x31985f=[];return db['WhatsappInteraction']['findAll']({'raw':!![],'attributes':['id',_0x5371('0x7')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x5371('0x8')](0x18,_0x5371('0x9'))}}})[_0x5371('0xa')](function(_0x282b77){if(_0x282b77&&_0x282b77[_0x5371('0xb')]){_0x31985f=_[_0x5371('0xc')](_0x282b77||[],'id');logger['info'](_0x5371('0xd'),_0x31985f[_0x5371('0xe')]());return db[_0x5371('0xf')][_0x5371('0x10')]({'closeReason':'system','disposition':_0x5371('0x11'),'closed':!![],'closedAt':moment()[_0x5371('0x12')](_0x5371('0x13'))},{'where':{'id':_0x31985f}});}})['then'](function(){if(_0x31985f&&_0x31985f['length']){logger[_0x5371('0x14')]('[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:',_0x31985f['join']());for(var _0xa8e813=0x0;_0xa8e813<_0x31985f[_0x5371('0xb')];_0xa8e813++){io[_0x5371('0x15')](_0x5371('0x16'),{'id':_0x31985f[_0xa8e813],'closed':!![]});}}})[_0x5371('0x17')](function(_0x551952){logger[_0x5371('0x18')](_0x5371('0x19'),_0x551952?util[_0x5371('0x1a')](_0x551952,{'showHidden':![],'depth':null}):'');});}exports[_0x5371('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xc731=['WhatsappInteraction','update','system','timeout','format','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','inspect','start','lodash','moment','util','../../config/environment','../../mysqldb','schedule','defaults','redis','localhost','findAll','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join'];(function(_0xdef646,_0xc790bc){var _0x245ef3=function(_0x57d1ba){while(--_0x57d1ba){_0xdef646['push'](_0xdef646['shift']());}};_0x245ef3(++_0xc790bc);}(_0xc731,0x1e6));var _0x1c73=function(_0x3b31ad,_0x5c016d){_0x3b31ad=_0x3b31ad-0x0;var _0x5d6986=_0xc731[_0x3b31ad];return _0x5d6986;};'use strict';var _=require(_0x1c73('0x0'));var moment=require(_0x1c73('0x1'));var Redis=require('ioredis');var util=require(_0x1c73('0x2'));var config=require(_0x1c73('0x3'));var db=require(_0x1c73('0x4'))['db'];var logger=require('../logger')(_0x1c73('0x5'));config['redis']=_[_0x1c73('0x6')](config[_0x1c73('0x7')],{'host':_0x1c73('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1c73('0x7')]));function closeInteractions(){var _0xb0a620=[];return db['WhatsappInteraction'][_0x1c73('0x9')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x1c73('0xa')](0x18,_0x1c73('0xb'))}}})[_0x1c73('0xc')](function(_0x1bfa81){if(_0x1bfa81&&_0x1bfa81[_0x1c73('0xd')]){_0xb0a620=_[_0x1c73('0xe')](_0x1bfa81||[],'id');logger[_0x1c73('0xf')](_0x1c73('0x10'),_0xb0a620[_0x1c73('0x11')]());return db[_0x1c73('0x12')][_0x1c73('0x13')]({'closeReason':_0x1c73('0x14'),'disposition':_0x1c73('0x15'),'closed':!![],'closedAt':moment()[_0x1c73('0x16')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0xb0a620}});}})['then'](function(){if(_0xb0a620&&_0xb0a620[_0x1c73('0xd')]){logger[_0x1c73('0xf')](_0x1c73('0x17'),_0xb0a620[_0x1c73('0x11')]());for(var _0x6ec87=0x0;_0x6ec87<_0xb0a620[_0x1c73('0xd')];_0x6ec87++){io[_0x1c73('0x18')](_0x1c73('0x19'),{'id':_0xb0a620[_0x6ec87],'closed':!![]});}}})['catch'](function(_0x2d756f){logger['error']('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x2d756f?util[_0x1c73('0x1a')](_0x2d756f,{'showHidden':![],'depth':null}):'');});}exports[_0x1c73('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index d9178b1..512114b 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb452=['hopper1','hopper2','catch','util','../mysqldb','Biondo','innocenzo.biondo','push','now','@xcally.com','CmContact','destroy','then','bulkCreate','log','contacts1','CmHopper','finished\x20populating'];(function(_0x3ff17d,_0x265605){var _0x5dc636=function(_0x23e6d6){while(--_0x23e6d6){_0x3ff17d['push'](_0x3ff17d['shift']());}};_0x5dc636(++_0x265605);}(_0xb452,0x6f));var _0x2b45=function(_0x3a1f91,_0x15fe8b){_0x3a1f91=_0x3a1f91-0x0;var _0x451178=_0xb452[_0x3a1f91];return _0x451178;};'use strict';var util=require(_0x2b45('0x0'));var db=require(_0x2b45('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x2b45('0x2')+i,'phone':0xf879fb460+i,'email':_0x2b45('0x3')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x2b45('0x4')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x2b45('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x2b45('0x4')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x2b45('0x2')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x2b45('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x2b45('0x4')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}db[_0x2b45('0x7')][_0x2b45('0x8')]({'where':{}})[_0x2b45('0x9')](function(){return db[_0x2b45('0x7')][_0x2b45('0xa')](contacts);})[_0x2b45('0x9')](function(){console[_0x2b45('0xb')]('finished\x20populating',_0x2b45('0xc'));return db[_0x2b45('0xd')][_0x2b45('0x8')]({'where':{}});})[_0x2b45('0x9')](function(){return db['CmHopper'][_0x2b45('0xa')](hopper);})[_0x2b45('0x9')](function(){console['log'](_0x2b45('0xe'),_0x2b45('0xf'));return db[_0x2b45('0x7')][_0x2b45('0xa')](contacts2);})[_0x2b45('0x9')](function(){console[_0x2b45('0xb')](_0x2b45('0xe'),'contacts2');return db[_0x2b45('0xd')][_0x2b45('0xa')](hopper2);})['then'](function(){console['log'](_0x2b45('0xe'),_0x2b45('0x10'));})[_0x2b45('0x11')](function(_0xdc9a94){console[_0x2b45('0xb')](_0xdc9a94);}); \ No newline at end of file +var _0x8409=['now','@xcally.com','CmContact','destroy','then','log','finished\x20populating','contacts1','CmHopper','bulkCreate','hopper1','contacts2','catch','util','push','Innocenzo','Biondo','innocenzo.biondo'];(function(_0x3a5c9c,_0x5040d1){var _0x32dec7=function(_0x70eced){while(--_0x70eced){_0x3a5c9c['push'](_0x3a5c9c['shift']());}};_0x32dec7(++_0x5040d1);}(_0x8409,0x199));var _0x9840=function(_0x236209,_0x51b840){_0x236209=_0x236209-0x0;var _0x2afd5b=_0x8409[_0x236209];return _0x2afd5b;};'use strict';var util=require(_0x9840('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x9840('0x1')]({'id':i,'firstName':_0x9840('0x2')+i,'lastName':_0x9840('0x3')+i,'phone':0xf879fb460+i,'email':_0x9840('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x9840('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x9840('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x9840('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x9840('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x9840('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x9840('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x9840('0x5')](),'updatedAt':Date[_0x9840('0x5')]()});}db[_0x9840('0x7')][_0x9840('0x8')]({'where':{}})[_0x9840('0x9')](function(){return db[_0x9840('0x7')]['bulkCreate'](contacts);})[_0x9840('0x9')](function(){console[_0x9840('0xa')](_0x9840('0xb'),_0x9840('0xc'));return db['CmHopper']['destroy']({'where':{}});})['then'](function(){return db[_0x9840('0xd')][_0x9840('0xe')](hopper);})['then'](function(){console['log'](_0x9840('0xb'),_0x9840('0xf'));return db[_0x9840('0x7')][_0x9840('0xe')](contacts2);})[_0x9840('0x9')](function(){console['log'](_0x9840('0xb'),_0x9840('0x10'));return db[_0x9840('0xd')][_0x9840('0xe')](hopper2);})[_0x9840('0x9')](function(){console[_0x9840('0xa')](_0x9840('0xb'),'hopper2');})[_0x9840('0x11')](function(_0x1c6233){console[_0x9840('0xa')](_0x1c6233);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index ada70e5..6baf19d 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3fe0=['User','bulkCreate','then','log','catch','util','push','format','%s%s','agent','password','friend','udp','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x3fe0,0x1c7));var _0x03fe=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3fe0[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x03fe('0x0'));var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x03fe('0x1')]({'name':util[_0x03fe('0x2')](_0x03fe('0x3'),_0x03fe('0x4'),i),'fullname':util[_0x03fe('0x2')](_0x03fe('0x3'),_0x03fe('0x4'),i),'email':util[_0x03fe('0x2')]('%s%s@xcally.com',_0x03fe('0x4'),i),'role':_0x03fe('0x4'),'password':_0x03fe('0x5'),'internal':0xfa0+i,'type':_0x03fe('0x6'),'transport':[_0x03fe('0x7'),'ws','wss'],'disallow':['all'],'allow':['ulaw'],'defaultuser':util[_0x03fe('0x2')](_0x03fe('0x3'),'agent',i),'encryption':_0x03fe('0x8'),'avpf':_0x03fe('0x8'),'force_avp':_0x03fe('0x8'),'icesupport':_0x03fe('0x8'),'dtlsenable':_0x03fe('0x8'),'dtlsverify':'no','dtlscertfile':_0x03fe('0x9'),'dtlsprivatekey':_0x03fe('0xa'),'dtlssetup':_0x03fe('0xb'),'callerid':util[_0x03fe('0x2')](_0x03fe('0xc'),util['format'](_0x03fe('0x3'),_0x03fe('0x4'),i),0xfa0+i)});}db[_0x03fe('0xd')][_0x03fe('0xe')](users)[_0x03fe('0xf')](function(){console[_0x03fe('0x10')]('add\x20user');})[_0x03fe('0x11')](function(_0x50e68c){console[_0x03fe('0x10')](_0x50e68c);}); \ No newline at end of file +var _0xb3ff=['wss','all','agent','yes','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','then','add\x20user','log','util','../mysqldb','push','format','%s%s','%s%s@xcally.com','password','friend','udp'];(function(_0x44d1c0,_0x492f77){var _0x53ed87=function(_0x158a81){while(--_0x158a81){_0x44d1c0['push'](_0x44d1c0['shift']());}};_0x53ed87(++_0x492f77);}(_0xb3ff,0x15f));var _0xfb3f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb3ff[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xfb3f('0x0'));var db=require(_0xfb3f('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xfb3f('0x2')]({'name':util[_0xfb3f('0x3')](_0xfb3f('0x4'),'agent',i),'fullname':util[_0xfb3f('0x3')](_0xfb3f('0x4'),'agent',i),'email':util[_0xfb3f('0x3')](_0xfb3f('0x5'),'agent',i),'role':'agent','password':_0xfb3f('0x6'),'internal':0xfa0+i,'type':_0xfb3f('0x7'),'transport':[_0xfb3f('0x8'),'ws',_0xfb3f('0x9')],'disallow':[_0xfb3f('0xa')],'allow':['ulaw'],'defaultuser':util[_0xfb3f('0x3')](_0xfb3f('0x4'),_0xfb3f('0xb'),i),'encryption':'yes','avpf':'yes','force_avp':_0xfb3f('0xc'),'icesupport':_0xfb3f('0xc'),'dtlsenable':_0xfb3f('0xc'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xfb3f('0xd'),'dtlssetup':_0xfb3f('0xe'),'callerid':util['format'](_0xfb3f('0xf'),util[_0xfb3f('0x3')](_0xfb3f('0x4'),_0xfb3f('0xb'),i),0xfa0+i)});}db[_0xfb3f('0x10')]['bulkCreate'](users)[_0xfb3f('0x11')](function(){console['log'](_0xfb3f('0x12'));})['catch'](function(_0x468f49){console[_0xfb3f('0x13')](_0x468f49);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index fe804a3..d275b25 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a71=['role','telephone','Campaign','%s:queue:%s','length','user:%s','Agents','handshake','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','format','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','FaxQueue','WhatsappQueue','Trunks','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getWhatsappQueues','all','voice','fax','sms','mail','openchannel','telephone:%s','trunk:%s','campaign:%s:%s','map','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','leave','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','default','setMaxListeners','address','request','connection','remoteAddress','remotePort','nsp','disconnect','DISCONNECTED','lodash','util','bluebird','./environment','name','agent','type','ivr','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','Telephones','findAll','IvrCampaigns','UserProfileResource','resourceId','User','where'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7a71,0xad));var _0x17a7=function(_0x25d97d,_0x4ab15a){_0x25d97d=_0x25d97d-0x0;var _0x364e60=_0x7a71[_0x25d97d];return _0x364e60;};'use strict';var _=require(_0x17a7('0x0'));var util=require(_0x17a7('0x1'));var BPromise=require(_0x17a7('0x2'));var db=require('../mysqldb')['db'];var config=require(_0x17a7('0x3'));var queryQueues={'attributes':['id',_0x17a7('0x4')],'include':[{'as':'Agents','model':db['User'],'attributes':['id',_0x17a7('0x4'),'role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x17a7('0x4')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x17a7('0x4')],'where':{'role':_0x17a7('0x5')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x17a7('0x4'),_0x17a7('0x6')],'where':{'type':_0x17a7('0x7')}};function getAssociatedResources(_0x30dc7e,_0xc2aa0d,_0x4b5a8a){return db['UserProfileSection'][_0x17a7('0x8')]({'where':{'name':_0x30dc7e,'userProfileId':_0xc2aa0d},'raw':!![]})[_0x17a7('0x9')](function(_0x24ea8f){if(_0x24ea8f){if(_0x24ea8f[_0x17a7('0xa')]){switch(_0x30dc7e){case _0x17a7('0xb'):case _0x17a7('0xc'):case _0x17a7('0xd'):case _0x17a7('0xe'):case _0x17a7('0xf'):case _0x17a7('0x10'):case _0x17a7('0x11'):return db[_0x4b5a8a]['findAll'](queryQueues);case _0x17a7('0x12'):return db[_0x4b5a8a][_0x17a7('0x13')](queryTelephones);case'Trunks':return db[_0x4b5a8a][_0x17a7('0x13')](queryTrunks);case _0x17a7('0x14'):return db[_0x4b5a8a][_0x17a7('0x13')](queryCampaigns);}}else{return db[_0x17a7('0x15')][_0x17a7('0x13')]({'attributes':[_0x17a7('0x16')],'where':{'sectionId':_0x24ea8f['id']},'raw':!![]})[_0x17a7('0x9')](function(_0x2938c5){if(_0x2938c5){var _0x437c87={'where':{'id':_['map'](_0x2938c5,'resourceId')},'raw':!![]};switch(_0x4b5a8a){case _0x17a7('0x17'):_0x437c87[_0x17a7('0x18')][_0x17a7('0x19')]=_0x17a7('0x1a');break;case _0x17a7('0x1b'):_0x437c87[_0x17a7('0x18')][_0x17a7('0x6')]=_0x17a7('0x7');break;}return db[_0x4b5a8a][_0x17a7('0x13')](_0x437c87);}else{return[];}});}}else{return[];}})[_0x17a7('0x9')](function(_0x5a85dc){return _0x5a85dc;});}function joinOrLeaveQueues(_0x3753f4,_0x4f520e,_0x1aaf9c,_0x571f7a){_0x3753f4[_0x4f520e](util['format'](_0x17a7('0x1c'),_0x1aaf9c,_0x571f7a[_0x17a7('0x4')]));if(_0x571f7a['Agents']){for(var _0x2cf646=0x0;_0x2cf646<_0x571f7a['Agents'][_0x17a7('0x1d')];_0x2cf646+=0x1){_0x3753f4[_0x4f520e](util['format'](_0x17a7('0x1e'),_0x571f7a[_0x17a7('0x1f')][_0x2cf646][_0x17a7('0x4')]));}}}function joinOrLeave(_0xad46dd,_0x35d20f,_0x47afec){var _0x2abf8a;if(_0xad46dd[_0x17a7('0x20')]['query']['id']){db[_0x17a7('0x17')]['find']({'attributes':['id',_0x17a7('0x4'),_0x17a7('0x19'),_0x17a7('0x21')],'where':{'id':_0xad46dd['handshake']['query']['id']},'include':[{'model':db[_0x17a7('0x22')],'as':_0x17a7('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x17a7('0x24')],'as':_0x17a7('0x25'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x17a7('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x17a7('0x27')],'as':_0x17a7('0x28'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x17a7('0x29'),'attributes':['id'],'raw':!![]}]})[_0x17a7('0x9')](function(_0x30733b){if(_0x30733b){_0x2abf8a=_0x30733b;_0xad46dd[_0x35d20f](util[_0x17a7('0x2a')](_0x17a7('0x1e'),_0x30733b[_0x17a7('0x4')]));var _0xcffe70=[];switch(_0x30733b[_0x17a7('0x19')]){case _0x17a7('0x2b'):_0xad46dd[_0x35d20f](_0x17a7('0x2c'));_0xad46dd[_0x35d20f](_0x17a7('0x2d'));if(queryQueues[_0x17a7('0x2e')]('include')){delete queryQueues[_0x17a7('0x2f')];}_0xcffe70[_0x17a7('0x30')](db[_0x17a7('0x31')]['findAll'](queryQueues));_0xcffe70['push'](db[_0x17a7('0x32')][_0x17a7('0x13')](queryQueues));_0xcffe70[_0x17a7('0x30')](db['FaxQueue'][_0x17a7('0x13')](queryQueues));_0xcffe70['push'](db[_0x17a7('0x33')][_0x17a7('0x13')](queryQueues));_0xcffe70[_0x17a7('0x30')](db[_0x17a7('0x34')]['findAll'](queryQueues));_0xcffe70[_0x17a7('0x30')](db[_0x17a7('0x35')][_0x17a7('0x13')](queryQueues));_0xcffe70[_0x17a7('0x30')](db['WhatsappQueue'][_0x17a7('0x13')](queryQueues));_0xcffe70[_0x17a7('0x30')](db[_0x17a7('0x17')][_0x17a7('0x13')](queryTelephones));_0xcffe70['push'](db[_0x17a7('0x36')][_0x17a7('0x13')](queryTrunks));_0xcffe70[_0x17a7('0x30')](db['Campaign'][_0x17a7('0x13')](queryCampaigns));_0xcffe70[_0x17a7('0x30')](db['User'][_0x17a7('0x13')](queryAgents));break;case'user':_0xad46dd[_0x35d20f](_0x17a7('0x2c'));_0xad46dd[_0x35d20f]('voice:outbound');_0xcffe70['push'](getAssociatedResources('VoiceQueues',_0x30733b[_0x17a7('0x21')],_0x17a7('0x31')));_0xcffe70[_0x17a7('0x30')](getAssociatedResources(_0x17a7('0xc'),_0x30733b['userProfileId'],_0x17a7('0x32')));_0xcffe70[_0x17a7('0x30')](getAssociatedResources(_0x17a7('0xd'),_0x30733b[_0x17a7('0x21')],_0x17a7('0x37')));_0xcffe70[_0x17a7('0x30')](getAssociatedResources('SmsQueues',_0x30733b[_0x17a7('0x21')],_0x17a7('0x33')));_0xcffe70[_0x17a7('0x30')](getAssociatedResources(_0x17a7('0xf'),_0x30733b[_0x17a7('0x21')],_0x17a7('0x34')));_0xcffe70[_0x17a7('0x30')](getAssociatedResources(_0x17a7('0x10'),_0x30733b[_0x17a7('0x21')],_0x17a7('0x35')));_0xcffe70[_0x17a7('0x30')](getAssociatedResources(_0x17a7('0x11'),_0x30733b[_0x17a7('0x21')],_0x17a7('0x38')));_0xcffe70['push'](getAssociatedResources(_0x17a7('0x12'),_0x30733b['userProfileId'],_0x17a7('0x17')));_0xcffe70['push'](getAssociatedResources(_0x17a7('0x39'),_0x30733b[_0x17a7('0x21')],'Trunk'));_0xcffe70['push'](getAssociatedResources('IvrCampaigns',_0x30733b[_0x17a7('0x21')],_0x17a7('0x1b')));_0xcffe70[_0x17a7('0x30')](db[_0x17a7('0x17')][_0x17a7('0x13')](queryAgents));break;case _0x17a7('0x5'):_0xad46dd[_0x35d20f]('voice:inbound');_0xad46dd[_0x35d20f](_0x17a7('0x2d'));_0xcffe70[_0x17a7('0x30')](_0x30733b[_0x17a7('0x3a')]({'attributes':['id',_0x17a7('0x4')]}));_0xcffe70['push'](_0x30733b[_0x17a7('0x3b')]({'attributes':['id','name']}));_0xcffe70[_0x17a7('0x30')](_0x30733b[_0x17a7('0x3c')]({'attributes':['id',_0x17a7('0x4')]}));_0xcffe70[_0x17a7('0x30')](_0x30733b[_0x17a7('0x3d')]({'attributes':['id',_0x17a7('0x4')]}));_0xcffe70[_0x17a7('0x30')](_0x30733b[_0x17a7('0x3e')]({'attributes':['id',_0x17a7('0x4')]}));_0xcffe70['push'](_0x30733b['getOpenchannelQueues']({'attributes':['id','name']}));_0xcffe70[_0x17a7('0x30')](_0x30733b[_0x17a7('0x3f')]({'attributes':['id',_0x17a7('0x4')]}));break;}return BPromise[_0x17a7('0x40')](_0xcffe70);}})[_0x17a7('0x9')](function(_0x39c529){if(_0x39c529&&_0x39c529[_0x17a7('0x1d')]){for(var _0x13a39d=0x0;_0x13a39d<_0x39c529[_0x17a7('0x1d')];_0x13a39d+=0x1){for(var _0x4949c1=0x0;_0x4949c1<_0x39c529[_0x13a39d][_0x17a7('0x1d')];_0x4949c1+=0x1){switch(_0x13a39d){case 0x0:joinOrLeaveQueues(_0xad46dd,_0x35d20f,_0x17a7('0x41'),_0x39c529[_0x13a39d][_0x4949c1]);break;case 0x1:joinOrLeaveQueues(_0xad46dd,_0x35d20f,'chat',_0x39c529[_0x13a39d][_0x4949c1]);break;case 0x2:joinOrLeaveQueues(_0xad46dd,_0x35d20f,_0x17a7('0x42'),_0x39c529[_0x13a39d][_0x4949c1]);break;case 0x3:joinOrLeaveQueues(_0xad46dd,_0x35d20f,_0x17a7('0x43'),_0x39c529[_0x13a39d][_0x4949c1]);break;case 0x4:joinOrLeaveQueues(_0xad46dd,_0x35d20f,_0x17a7('0x44'),_0x39c529[_0x13a39d][_0x4949c1]);break;case 0x5:joinOrLeaveQueues(_0xad46dd,_0x35d20f,_0x17a7('0x45'),_0x39c529[_0x13a39d][_0x4949c1]);break;case 0x6:joinOrLeaveQueues(_0xad46dd,_0x35d20f,'whatsapp',_0x39c529[_0x13a39d][_0x4949c1]);break;case 0x7:if(_0x2abf8a['role']!=='agent')_0xad46dd[_0x35d20f](util[_0x17a7('0x2a')](_0x17a7('0x46'),_0x39c529[_0x13a39d][_0x4949c1]['name']));break;case 0x8:if(_0x2abf8a[_0x17a7('0x19')]!==_0x17a7('0x5'))_0xad46dd[_0x35d20f](util[_0x17a7('0x2a')](_0x17a7('0x47'),_0x39c529[_0x13a39d][_0x4949c1]['name']));break;case 0x9:if(_0x2abf8a[_0x17a7('0x19')]!==_0x17a7('0x5'))_0xad46dd[_0x35d20f](util[_0x17a7('0x2a')](_0x17a7('0x48'),_0x39c529[_0x13a39d][_0x4949c1][_0x17a7('0x6')],_0x39c529[_0x13a39d][_0x4949c1][_0x17a7('0x4')]));break;case 0xa:_0xad46dd[_0x35d20f](util[_0x17a7('0x2a')](_0x17a7('0x1e'),_0x39c529[_0x13a39d][_0x4949c1][_0x17a7('0x4')]));break;}}}}})[_0x17a7('0x9')](function(){if(_0x35d20f==='leave'){var _0x36d3bf=_[_0x17a7('0x49')](_0x2abf8a[_0x17a7('0x23')],'id');return _0x2abf8a[_0x17a7('0x4a')](_0x36d3bf)[_0x17a7('0x9')](function(){for(var _0xdc8581=0x0;_0xdc8581<_0x36d3bf['length'];_0xdc8581+=0x1){_0x47afec[_0x17a7('0x4b')](_0x17a7('0x4c'),{'ChatInteractionId':Number(_0x36d3bf[_0xdc8581]),'UserId':Number(_0x2abf8a['id'])});}});}})[_0x17a7('0x9')](function(){if(_0x35d20f==='leave'){var _0x1a3624=_[_0x17a7('0x49')](_0x2abf8a[_0x17a7('0x25')],'id');return _0x2abf8a[_0x17a7('0x4d')](_0x1a3624)['then'](function(){for(var _0xd6bb44=0x0;_0xd6bb44<_0x1a3624[_0x17a7('0x1d')];_0xd6bb44+=0x1){_0x47afec['emit'](_0x17a7('0x4e'),{'MailInteractionId':Number(_0x1a3624[_0xd6bb44]),'UserId':Number(_0x2abf8a['id'])});}});}})['then'](function(){if(_0x35d20f===_0x17a7('0x4f')){var _0x52344f=_[_0x17a7('0x49')](_0x2abf8a['FaxInteractions'],'id');return _0x2abf8a[_0x17a7('0x50')](_0x52344f)[_0x17a7('0x9')](function(){for(var _0x4c17ff=0x0;_0x4c17ff<_0x52344f['length'];_0x4c17ff+=0x1){_0x47afec['emit'](_0x17a7('0x51'),{'FaxInteractionId':Number(_0x52344f[_0x4c17ff]),'UserId':Number(_0x2abf8a['id'])});}});}})['then'](function(){if(_0x35d20f==='leave'){var _0x4931a1=_['map'](_0x2abf8a[_0x17a7('0x26')],'id');return _0x2abf8a['removeSmsInteractions'](_0x4931a1)[_0x17a7('0x9')](function(){for(var _0x386a8f=0x0;_0x386a8f<_0x4931a1[_0x17a7('0x1d')];_0x386a8f+=0x1){_0x47afec['emit'](_0x17a7('0x52'),{'SmsInteractionId':Number(_0x4931a1[_0x386a8f]),'UserId':Number(_0x2abf8a['id'])});}});}})[_0x17a7('0x9')](function(){if(_0x35d20f===_0x17a7('0x4f')){var _0x42cd04=_[_0x17a7('0x49')](_0x2abf8a[_0x17a7('0x28')],'id');return _0x2abf8a[_0x17a7('0x53')](_0x42cd04)[_0x17a7('0x9')](function(){for(var _0x52b4aa=0x0;_0x52b4aa<_0x42cd04[_0x17a7('0x1d')];_0x52b4aa+=0x1){_0x47afec[_0x17a7('0x4b')](_0x17a7('0x54'),{'OpenchannelInteractionId':Number(_0x42cd04[_0x52b4aa]),'UserId':Number(_0x2abf8a['id'])});}});}})[_0x17a7('0x9')](function(){if(_0x35d20f===_0x17a7('0x4f')){var _0x2c6836=_[_0x17a7('0x49')](_0x2abf8a[_0x17a7('0x29')],'id');return _0x2abf8a[_0x17a7('0x55')](_0x2c6836)[_0x17a7('0x9')](function(){for(var _0x48638e=0x0;_0x48638e<_0x2c6836[_0x17a7('0x1d')];_0x48638e+=0x1){_0x47afec[_0x17a7('0x4b')](_0x17a7('0x56'),{'WhatsappInteractionId':Number(_0x2c6836[_0x48638e]),'UserId':Number(_0x2abf8a['id'])});}});}})['catch'](function(_0x12edcc){_0xad46dd[_0x17a7('0x57')](_0x12edcc);});}}function onDisconnect(_0x62caa2,_0x3b2131){joinOrLeave(_0x62caa2,_0x17a7('0x4f'),_0x3b2131);}function onConnect(_0x3c34cc){joinOrLeave(_0x3c34cc,_0x17a7('0x58'));}exports[_0x17a7('0x59')]=function(_0x3fc083){_0x3fc083['on']('connection',function(_0x359b21){_0x359b21[_0x17a7('0x5a')](0x0);_0x359b21[_0x17a7('0x5b')]=_0x359b21[_0x17a7('0x5c')][_0x17a7('0x5d')][_0x17a7('0x5e')]+':'+_0x359b21[_0x17a7('0x5c')][_0x17a7('0x5d')][_0x17a7('0x5f')];_0x359b21['connectedAt']=new Date();_0x359b21[_0x17a7('0x57')]=function(_0x206719){console[_0x17a7('0x57')]('SocketIO\x20'+_0x359b21[_0x17a7('0x60')][_0x17a7('0x4')]+'['+_0x359b21['address']+']',_0x206719);};_0x359b21['on'](_0x17a7('0x61'),function(){onDisconnect(_0x359b21,_0x3fc083);_0x359b21[_0x17a7('0x57')](_0x17a7('0x62'));});onConnect(_0x359b21);_0x359b21[_0x17a7('0x57')]('CONNECTED');});}; \ No newline at end of file +var _0xf1d4=['Trunks','UserProfileResource','map','role','Campaign','%s:queue:%s','Agents','length','user:%s','query','find','userProfileId','ChatInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','WhatsappInteractions','then','format','admin','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','push','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','ChatQueue','FaxQueue','SmsQueues','WhatsappQueues','IvrCampaigns','getVoiceQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','voice','chat','fax','sms','mail','openchannel','whatsapp','trunk:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','log','connection','request','remotePort','connectedAt','SocketIO\x20','address','disconnect','DISCONNECTED','lodash','bluebird','./environment','name','User','telephone','agent','type','ivr','findOne','autoAssociation','ChatQueues','FaxQueues','OpenchannelQueues','findAll','Telephones'];(function(_0x91dc26,_0x37be23){var _0x2ffcb1=function(_0x219cca){while(--_0x219cca){_0x91dc26['push'](_0x91dc26['shift']());}};_0x2ffcb1(++_0x37be23);}(_0xf1d4,0x158));var _0x4f1d=function(_0x803493,_0x76ae83){_0x803493=_0x803493-0x0;var _0x59c118=_0xf1d4[_0x803493];return _0x59c118;};'use strict';var _=require(_0x4f1d('0x0'));var util=require('util');var BPromise=require(_0x4f1d('0x1'));var db=require('../mysqldb')['db'];var config=require(_0x4f1d('0x2'));var queryQueues={'attributes':['id',_0x4f1d('0x3')],'include':[{'as':'Agents','model':db[_0x4f1d('0x4')],'attributes':['id',_0x4f1d('0x3'),'role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x4f1d('0x3')],'where':{'role':_0x4f1d('0x5')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x4f1d('0x3')],'where':{'role':_0x4f1d('0x6')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x4f1d('0x3'),_0x4f1d('0x7')],'where':{'type':_0x4f1d('0x8')}};function getAssociatedResources(_0x24c3a3,_0x27f368,_0x47df2f){return db['UserProfileSection'][_0x4f1d('0x9')]({'where':{'name':_0x24c3a3,'userProfileId':_0x27f368},'raw':!![]})['then'](function(_0xe0b6fe){if(_0xe0b6fe){if(_0xe0b6fe[_0x4f1d('0xa')]){switch(_0x24c3a3){case'VoiceQueues':case _0x4f1d('0xb'):case _0x4f1d('0xc'):case'SmsQueues':case'MailQueues':case _0x4f1d('0xd'):case'WhatsappQueues':return db[_0x47df2f][_0x4f1d('0xe')](queryQueues);case _0x4f1d('0xf'):return db[_0x47df2f][_0x4f1d('0xe')](queryTelephones);case _0x4f1d('0x10'):return db[_0x47df2f][_0x4f1d('0xe')](queryTrunks);case'IvrCampaigns':return db[_0x47df2f]['findAll'](queryCampaigns);}}else{return db[_0x4f1d('0x11')]['findAll']({'attributes':['resourceId'],'where':{'sectionId':_0xe0b6fe['id']},'raw':!![]})['then'](function(_0x115f7f){if(_0x115f7f){var _0x5081e3={'where':{'id':_[_0x4f1d('0x12')](_0x115f7f,'resourceId')},'raw':!![]};switch(_0x47df2f){case _0x4f1d('0x4'):_0x5081e3['where'][_0x4f1d('0x13')]=_0x4f1d('0x5');break;case _0x4f1d('0x14'):_0x5081e3['where'][_0x4f1d('0x7')]=_0x4f1d('0x8');break;}return db[_0x47df2f][_0x4f1d('0xe')](_0x5081e3);}else{return[];}});}}else{return[];}})['then'](function(_0x218d12){return _0x218d12;});}function joinOrLeaveQueues(_0x57bee9,_0x1b45c5,_0x56634c,_0x62b4f6){_0x57bee9[_0x1b45c5](util['format'](_0x4f1d('0x15'),_0x56634c,_0x62b4f6[_0x4f1d('0x3')]));if(_0x62b4f6[_0x4f1d('0x16')]){for(var _0x2775b7=0x0;_0x2775b7<_0x62b4f6[_0x4f1d('0x16')][_0x4f1d('0x17')];_0x2775b7+=0x1){_0x57bee9[_0x1b45c5](util['format'](_0x4f1d('0x18'),_0x62b4f6[_0x4f1d('0x16')][_0x2775b7][_0x4f1d('0x3')]));}}}function joinOrLeave(_0xbe98,_0x53ead6,_0x17b47b){var _0x1d00bf;if(_0xbe98['handshake'][_0x4f1d('0x19')]['id']){db[_0x4f1d('0x4')][_0x4f1d('0x1a')]({'attributes':['id',_0x4f1d('0x3'),_0x4f1d('0x13'),_0x4f1d('0x1b')],'where':{'id':_0xbe98['handshake'][_0x4f1d('0x19')]['id']},'include':[{'model':db[_0x4f1d('0x1c')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x4f1d('0x1d'),'attributes':['id'],'raw':!![]},{'model':db[_0x4f1d('0x1e')],'as':_0x4f1d('0x1f'),'attributes':['id'],'raw':!![]},{'model':db[_0x4f1d('0x20')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x4f1d('0x21')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x4f1d('0x22'),'attributes':['id'],'raw':!![]}]})[_0x4f1d('0x23')](function(_0x4eabb0){if(_0x4eabb0){_0x1d00bf=_0x4eabb0;_0xbe98[_0x53ead6](util[_0x4f1d('0x24')]('user:%s',_0x4eabb0['name']));var _0x16ba23=[];switch(_0x4eabb0[_0x4f1d('0x13')]){case _0x4f1d('0x25'):_0xbe98[_0x53ead6](_0x4f1d('0x26'));_0xbe98[_0x53ead6](_0x4f1d('0x27'));if(queryQueues[_0x4f1d('0x28')](_0x4f1d('0x29'))){delete queryQueues[_0x4f1d('0x29')];}_0x16ba23['push'](db[_0x4f1d('0x2a')][_0x4f1d('0xe')](queryQueues));_0x16ba23[_0x4f1d('0x2b')](db['ChatQueue'][_0x4f1d('0xe')](queryQueues));_0x16ba23[_0x4f1d('0x2b')](db['FaxQueue']['findAll'](queryQueues));_0x16ba23[_0x4f1d('0x2b')](db[_0x4f1d('0x2c')][_0x4f1d('0xe')](queryQueues));_0x16ba23['push'](db[_0x4f1d('0x2d')][_0x4f1d('0xe')](queryQueues));_0x16ba23[_0x4f1d('0x2b')](db[_0x4f1d('0x2e')][_0x4f1d('0xe')](queryQueues));_0x16ba23['push'](db[_0x4f1d('0x2f')]['findAll'](queryQueues));_0x16ba23['push'](db[_0x4f1d('0x4')][_0x4f1d('0xe')](queryTelephones));_0x16ba23[_0x4f1d('0x2b')](db[_0x4f1d('0x30')][_0x4f1d('0xe')](queryTrunks));_0x16ba23['push'](db[_0x4f1d('0x14')]['findAll'](queryCampaigns));_0x16ba23[_0x4f1d('0x2b')](db[_0x4f1d('0x4')][_0x4f1d('0xe')](queryAgents));break;case _0x4f1d('0x31'):_0xbe98[_0x53ead6](_0x4f1d('0x26'));_0xbe98[_0x53ead6](_0x4f1d('0x27'));_0x16ba23[_0x4f1d('0x2b')](getAssociatedResources('VoiceQueues',_0x4eabb0['userProfileId'],'VoiceQueue'));_0x16ba23[_0x4f1d('0x2b')](getAssociatedResources(_0x4f1d('0xb'),_0x4eabb0[_0x4f1d('0x1b')],_0x4f1d('0x32')));_0x16ba23['push'](getAssociatedResources(_0x4f1d('0xc'),_0x4eabb0[_0x4f1d('0x1b')],_0x4f1d('0x33')));_0x16ba23['push'](getAssociatedResources(_0x4f1d('0x34'),_0x4eabb0[_0x4f1d('0x1b')],_0x4f1d('0x2c')));_0x16ba23[_0x4f1d('0x2b')](getAssociatedResources('MailQueues',_0x4eabb0['userProfileId'],'MailQueue'));_0x16ba23[_0x4f1d('0x2b')](getAssociatedResources(_0x4f1d('0xd'),_0x4eabb0['userProfileId'],'OpenchannelQueue'));_0x16ba23[_0x4f1d('0x2b')](getAssociatedResources(_0x4f1d('0x35'),_0x4eabb0[_0x4f1d('0x1b')],_0x4f1d('0x2f')));_0x16ba23[_0x4f1d('0x2b')](getAssociatedResources('Telephones',_0x4eabb0[_0x4f1d('0x1b')],'User'));_0x16ba23['push'](getAssociatedResources(_0x4f1d('0x10'),_0x4eabb0['userProfileId'],_0x4f1d('0x30')));_0x16ba23[_0x4f1d('0x2b')](getAssociatedResources(_0x4f1d('0x36'),_0x4eabb0[_0x4f1d('0x1b')],_0x4f1d('0x14')));_0x16ba23[_0x4f1d('0x2b')](db['User']['findAll'](queryAgents));break;case _0x4f1d('0x6'):_0xbe98[_0x53ead6](_0x4f1d('0x26'));_0xbe98[_0x53ead6](_0x4f1d('0x27'));_0x16ba23[_0x4f1d('0x2b')](_0x4eabb0[_0x4f1d('0x37')]({'attributes':['id',_0x4f1d('0x3')]}));_0x16ba23[_0x4f1d('0x2b')](_0x4eabb0['getChatQueues']({'attributes':['id',_0x4f1d('0x3')]}));_0x16ba23[_0x4f1d('0x2b')](_0x4eabb0[_0x4f1d('0x38')]({'attributes':['id',_0x4f1d('0x3')]}));_0x16ba23[_0x4f1d('0x2b')](_0x4eabb0[_0x4f1d('0x39')]({'attributes':['id',_0x4f1d('0x3')]}));_0x16ba23['push'](_0x4eabb0[_0x4f1d('0x3a')]({'attributes':['id',_0x4f1d('0x3')]}));_0x16ba23[_0x4f1d('0x2b')](_0x4eabb0[_0x4f1d('0x3b')]({'attributes':['id',_0x4f1d('0x3')]}));_0x16ba23[_0x4f1d('0x2b')](_0x4eabb0['getWhatsappQueues']({'attributes':['id',_0x4f1d('0x3')]}));break;}return BPromise['all'](_0x16ba23);}})[_0x4f1d('0x23')](function(_0x5502d6){if(_0x5502d6&&_0x5502d6['length']){for(var _0x2f7dad=0x0;_0x2f7dad<_0x5502d6[_0x4f1d('0x17')];_0x2f7dad+=0x1){for(var _0x810fc6=0x0;_0x810fc6<_0x5502d6[_0x2f7dad][_0x4f1d('0x17')];_0x810fc6+=0x1){switch(_0x2f7dad){case 0x0:joinOrLeaveQueues(_0xbe98,_0x53ead6,_0x4f1d('0x3c'),_0x5502d6[_0x2f7dad][_0x810fc6]);break;case 0x1:joinOrLeaveQueues(_0xbe98,_0x53ead6,_0x4f1d('0x3d'),_0x5502d6[_0x2f7dad][_0x810fc6]);break;case 0x2:joinOrLeaveQueues(_0xbe98,_0x53ead6,_0x4f1d('0x3e'),_0x5502d6[_0x2f7dad][_0x810fc6]);break;case 0x3:joinOrLeaveQueues(_0xbe98,_0x53ead6,_0x4f1d('0x3f'),_0x5502d6[_0x2f7dad][_0x810fc6]);break;case 0x4:joinOrLeaveQueues(_0xbe98,_0x53ead6,_0x4f1d('0x40'),_0x5502d6[_0x2f7dad][_0x810fc6]);break;case 0x5:joinOrLeaveQueues(_0xbe98,_0x53ead6,_0x4f1d('0x41'),_0x5502d6[_0x2f7dad][_0x810fc6]);break;case 0x6:joinOrLeaveQueues(_0xbe98,_0x53ead6,_0x4f1d('0x42'),_0x5502d6[_0x2f7dad][_0x810fc6]);break;case 0x7:if(_0x1d00bf[_0x4f1d('0x13')]!==_0x4f1d('0x6'))_0xbe98[_0x53ead6](util['format']('telephone:%s',_0x5502d6[_0x2f7dad][_0x810fc6][_0x4f1d('0x3')]));break;case 0x8:if(_0x1d00bf[_0x4f1d('0x13')]!==_0x4f1d('0x6'))_0xbe98[_0x53ead6](util['format'](_0x4f1d('0x43'),_0x5502d6[_0x2f7dad][_0x810fc6][_0x4f1d('0x3')]));break;case 0x9:if(_0x1d00bf[_0x4f1d('0x13')]!==_0x4f1d('0x6'))_0xbe98[_0x53ead6](util['format'](_0x4f1d('0x44'),_0x5502d6[_0x2f7dad][_0x810fc6][_0x4f1d('0x7')],_0x5502d6[_0x2f7dad][_0x810fc6][_0x4f1d('0x3')]));break;case 0xa:_0xbe98[_0x53ead6](util[_0x4f1d('0x24')](_0x4f1d('0x18'),_0x5502d6[_0x2f7dad][_0x810fc6]['name']));break;}}}}})[_0x4f1d('0x23')](function(){if(_0x53ead6===_0x4f1d('0x45')){var _0x43525d=_[_0x4f1d('0x12')](_0x1d00bf[_0x4f1d('0x46')],'id');return _0x1d00bf[_0x4f1d('0x47')](_0x43525d)['then'](function(){for(var _0x220ff5=0x0;_0x220ff5<_0x43525d[_0x4f1d('0x17')];_0x220ff5+=0x1){_0x17b47b[_0x4f1d('0x48')](_0x4f1d('0x49'),{'ChatInteractionId':Number(_0x43525d[_0x220ff5]),'UserId':Number(_0x1d00bf['id'])});}});}})['then'](function(){if(_0x53ead6===_0x4f1d('0x45')){var _0x1de008=_[_0x4f1d('0x12')](_0x1d00bf[_0x4f1d('0x1d')],'id');return _0x1d00bf['removeMailInteractions'](_0x1de008)[_0x4f1d('0x23')](function(){for(var _0x18eb59=0x0;_0x18eb59<_0x1de008[_0x4f1d('0x17')];_0x18eb59+=0x1){_0x17b47b[_0x4f1d('0x48')](_0x4f1d('0x4a'),{'MailInteractionId':Number(_0x1de008[_0x18eb59]),'UserId':Number(_0x1d00bf['id'])});}});}})[_0x4f1d('0x23')](function(){if(_0x53ead6===_0x4f1d('0x45')){var _0x3553a5=_['map'](_0x1d00bf[_0x4f1d('0x1f')],'id');return _0x1d00bf[_0x4f1d('0x4b')](_0x3553a5)['then'](function(){for(var _0x8f690d=0x0;_0x8f690d<_0x3553a5[_0x4f1d('0x17')];_0x8f690d+=0x1){_0x17b47b['emit'](_0x4f1d('0x4c'),{'FaxInteractionId':Number(_0x3553a5[_0x8f690d]),'UserId':Number(_0x1d00bf['id'])});}});}})[_0x4f1d('0x23')](function(){if(_0x53ead6===_0x4f1d('0x45')){var _0x57f9ef=_[_0x4f1d('0x12')](_0x1d00bf[_0x4f1d('0x4d')],'id');return _0x1d00bf[_0x4f1d('0x4e')](_0x57f9ef)[_0x4f1d('0x23')](function(){for(var _0x1b99f6=0x0;_0x1b99f6<_0x57f9ef[_0x4f1d('0x17')];_0x1b99f6+=0x1){_0x17b47b['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x57f9ef[_0x1b99f6]),'UserId':Number(_0x1d00bf['id'])});}});}})[_0x4f1d('0x23')](function(){if(_0x53ead6==='leave'){var _0x1252a4=_[_0x4f1d('0x12')](_0x1d00bf['OpenchannelInteractions'],'id');return _0x1d00bf[_0x4f1d('0x4f')](_0x1252a4)['then'](function(){for(var _0x25af64=0x0;_0x25af64<_0x1252a4['length'];_0x25af64+=0x1){_0x17b47b['emit'](_0x4f1d('0x50'),{'OpenchannelInteractionId':Number(_0x1252a4[_0x25af64]),'UserId':Number(_0x1d00bf['id'])});}});}})[_0x4f1d('0x23')](function(){if(_0x53ead6===_0x4f1d('0x45')){var _0x3453d3=_[_0x4f1d('0x12')](_0x1d00bf[_0x4f1d('0x22')],'id');return _0x1d00bf['removeWhatsappInteractions'](_0x3453d3)['then'](function(){for(var _0x39535d=0x0;_0x39535d<_0x3453d3[_0x4f1d('0x17')];_0x39535d+=0x1){_0x17b47b['emit']('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x3453d3[_0x39535d]),'UserId':Number(_0x1d00bf['id'])});}});}})['catch'](function(_0x3fb623){_0xbe98[_0x4f1d('0x51')](_0x3fb623);});}}function onDisconnect(_0x5574b5,_0x5ad0b1){joinOrLeave(_0x5574b5,_0x4f1d('0x45'),_0x5ad0b1);}function onConnect(_0x31076a){joinOrLeave(_0x31076a,'join');}exports['default']=function(_0x273f1d){_0x273f1d['on'](_0x4f1d('0x52'),function(_0x6059d4){_0x6059d4['setMaxListeners'](0x0);_0x6059d4['address']=_0x6059d4[_0x4f1d('0x53')][_0x4f1d('0x52')]['remoteAddress']+':'+_0x6059d4['request'][_0x4f1d('0x52')][_0x4f1d('0x54')];_0x6059d4[_0x4f1d('0x55')]=new Date();_0x6059d4[_0x4f1d('0x51')]=function(_0x486164){console[_0x4f1d('0x51')](_0x4f1d('0x56')+_0x6059d4['nsp'][_0x4f1d('0x3')]+'['+_0x6059d4[_0x4f1d('0x57')]+']',_0x486164);};_0x6059d4['on'](_0x4f1d('0x58'),function(){onDisconnect(_0x6059d4,_0x273f1d);_0x6059d4['log'](_0x4f1d('0x59'));});onConnect(_0x6059d4);_0x6059d4[_0x4f1d('0x51')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index a7f338c..d531de9 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 _0x92ba=['Trigger,\x20%s','channel','event','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','query','Sequelize','QueryTypes','SELECT','contact','format','SIP/%s','agent','AfterCreateMessage','get','offlineMessage','motionChannel','opened','interface','AfterCreate','changed','substatus','closed','sequelize','UserId','AfterUpdate','User','find','name','fullname','internal','model','hook','callback','toLowerCase','../../mysqldb','jayson/promise','../logger','triggers','client','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','ChatOfflineMessage','Sms','SmsInteraction','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','then','info','EventManager','error','code'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x92ba,0x1d0));var _0xa92b=function(_0x526e88,_0x391f9f){_0x526e88=_0x526e88-0x0;var _0x2e85de=_0x92ba[_0x526e88];return _0x2e85de;};'use strict';var util=require('util');var db=require(_0xa92b('0x0'))['db'];var jayson=require(_0xa92b('0x1'));var logger=require(_0xa92b('0x2'))(_0xa92b('0x3'));var client=jayson[_0xa92b('0x4')]['http']({'port':0x232a});var triggers=[{'channel':_0xa92b('0x5'),'model':_0xa92b('0x6'),'event':_0xa92b('0x7'),'condition':_0xa92b('0x8'),'callback':afterCreate},{'channel':_0xa92b('0x5'),'model':_0xa92b('0x6'),'event':_0xa92b('0x9'),'condition':_0xa92b('0xa'),'callback':afterUpdate},{'channel':'Chat','model':_0xa92b('0xb'),'event':_0xa92b('0x7'),'condition':_0xa92b('0xc'),'callback':afterCreateMessage},{'channel':'Chat','model':_0xa92b('0xd'),'event':_0xa92b('0x7'),'condition':'newmessage','callback':afterCreateOfflineMessage},{'channel':_0xa92b('0xe'),'model':_0xa92b('0xf'),'event':_0xa92b('0x7'),'condition':_0xa92b('0x8'),'callback':afterCreate},{'channel':'Sms','model':'SmsInteraction','event':_0xa92b('0x9'),'condition':_0xa92b('0xa'),'callback':afterUpdate},{'channel':'Sms','model':'SmsMessage','event':_0xa92b('0x7'),'condition':_0xa92b('0xc'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':'WhatsappInteraction','event':_0xa92b('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xa92b('0x10'),'model':_0xa92b('0x11'),'event':_0xa92b('0x9'),'condition':_0xa92b('0xa'),'callback':afterUpdate},{'channel':'Whatsapp','model':_0xa92b('0x12'),'event':_0xa92b('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Fax','model':'FaxInteraction','event':_0xa92b('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xa92b('0x13'),'model':_0xa92b('0x14'),'event':_0xa92b('0x9'),'condition':_0xa92b('0xa'),'callback':afterUpdate},{'channel':_0xa92b('0x13'),'model':_0xa92b('0x15'),'event':_0xa92b('0x7'),'condition':_0xa92b('0xc'),'callback':afterCreateMessage},{'channel':_0xa92b('0x16'),'model':_0xa92b('0x17'),'event':_0xa92b('0x7'),'condition':_0xa92b('0x8'),'callback':afterCreate},{'channel':_0xa92b('0x16'),'model':_0xa92b('0x17'),'event':_0xa92b('0x9'),'condition':_0xa92b('0xa'),'callback':afterUpdate},{'channel':_0xa92b('0x16'),'model':_0xa92b('0x18'),'event':_0xa92b('0x7'),'condition':_0xa92b('0xc'),'callback':afterCreateMessage},{'channel':_0xa92b('0x19'),'model':_0xa92b('0x1a'),'event':_0xa92b('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0xa92b('0x19'),'model':_0xa92b('0x1a'),'event':_0xa92b('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Openchannel','model':_0xa92b('0x1b'),'event':_0xa92b('0x7'),'condition':_0xa92b('0xc'),'callback':afterCreateMessage}];function request(_0x46c74d){return client['request']('EventManager',_0x46c74d)[_0xa92b('0x1c')](function(_0x2607fc){logger[_0xa92b('0x1d')]('Trigger,\x20%s',_0xa92b('0x1e'),_0x2607fc);if(_0x2607fc[_0xa92b('0x1f')]){if(_0x2607fc[_0xa92b('0x1f')][_0xa92b('0x20')]===0x1f4){logger['error'](_0xa92b('0x21'),_0xa92b('0x1e'),_0x2607fc['error']);}}})['catch'](function(_0x401ad7){logger['error'](_0xa92b('0x21'),_0xa92b('0x1e'),_0x401ad7);});}function afterCreateMessage(_0xe0e7b2){return function(_0x5ccc8a){_0x5ccc8a=_0x5ccc8a['get']({'plain':!![]});_0x5ccc8a[_0xa92b('0x22')]=_0xe0e7b2;_0x5ccc8a['motionChannel']=_0xe0e7b2;_0x5ccc8a[_0xa92b('0x23')]=_0x5ccc8a[_0xa92b('0x24')];Promise[_0xa92b('0x25')]()['then'](function(){if(typeof _0x5ccc8a[_0xa92b('0x26')]===_0xa92b('0x27'))return null;var _0xf864fd=_0xa92b('0x28')+_0x5ccc8a[_0xa92b('0x26')];return db['sequelize'][_0xa92b('0x29')](_0xf864fd,{'type':db[_0xa92b('0x2a')][_0xa92b('0x2b')][_0xa92b('0x2c')],'raw':!![]});})['then'](function(_0x1f8202){if(_0x1f8202){_0x5ccc8a[_0xa92b('0x2d')]=_0x1f8202[0x0];}if(typeof _0x5ccc8a['UserId']===_0xa92b('0x27'))return;return getAgent(_0x5ccc8a['UserId']);})['then'](function(_0x7dc39b){if(_0x7dc39b){_0x5ccc8a['interface']=util[_0xa92b('0x2e')](_0xa92b('0x2f'),_0x7dc39b['name']);_0x5ccc8a[_0xa92b('0x30')]=_0x7dc39b;_0x5ccc8a[_0xa92b('0x22')]=_0xe0e7b2;return request({'event':'incomingmessage','message':_0x5ccc8a});}else{return request({'event':'outgoingmessage','message':_0x5ccc8a});}})['catch'](function(_0x2a2ba3){logger['error'](_0xa92b('0x21'),_0xa92b('0x31'),_0x2a2ba3);});};}function afterCreateOfflineMessage(_0x1bd75a){return function(_0x28f33f){_0x28f33f=_0x28f33f[_0xa92b('0x32')]({'plain':!![]});_0x28f33f[_0xa92b('0x22')]=_0x1bd75a;_0x28f33f['motionChannel']=_0x1bd75a;_0x28f33f['event']=_0xa92b('0x33');return request({'event':_0x28f33f[_0xa92b('0x23')],'message':_0x28f33f});};}function afterCreate(_0x2ca4a6,_0x4e8db6){return function(_0x18812a){_0x18812a=_0x18812a[_0xa92b('0x32')]({'plain':!![]});_0x18812a[_0xa92b('0x22')]=_0x2ca4a6;_0x18812a[_0xa92b('0x34')]=_0x2ca4a6;_0x18812a[_0xa92b('0x23')]=_0xa92b('0x35');Promise[_0xa92b('0x25')]()[_0xa92b('0x1c')](function(){var _0x21084b='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x18812a[_0xa92b('0x26')];return db['sequelize'][_0xa92b('0x29')](_0x21084b,{'type':db['Sequelize']['QueryTypes'][_0xa92b('0x2c')],'raw':!![]});})[_0xa92b('0x1c')](function(_0x2f0107){if(_0x2f0107){_0x18812a['contact']=_0x2f0107[0x0];}if(typeof _0x18812a['UserId']===_0xa92b('0x27'))return;return getAgent(_0x18812a['UserId']);})[_0xa92b('0x1c')](function(_0x4d6201){if(_0x4d6201){_0x18812a[_0xa92b('0x36')]=util[_0xa92b('0x2e')](_0xa92b('0x2f'),_0x4d6201['name']);_0x18812a[_0xa92b('0x30')]=_0x4d6201;}return request({'event':_0x4e8db6,'message':_0x18812a});})['catch'](function(_0x44ded5){logger[_0xa92b('0x1f')](_0xa92b('0x21'),_0xa92b('0x37'),_0x44ded5);});};}function afterUpdate(_0x33d0d5){return function(_0x4b3db1){var _0x2ce8ae=_0x4b3db1['changed']('closed')&&_0x4b3db1['closed'];var _0x526414=_0x4b3db1[_0xa92b('0x38')](_0xa92b('0x39'));if(_0x2ce8ae||_0x526414){var _0x24e6a4=_0x2ce8ae?_0xa92b('0xa'):_0xa92b('0x39');var _0x55919b=_0x4b3db1[_0xa92b('0x32')]({'plain':!![]});_0x55919b[_0xa92b('0x22')]=_0x33d0d5;_0x55919b[_0xa92b('0x34')]=_0x33d0d5;_0x55919b[_0xa92b('0x23')]=_0x2ce8ae?_0xa92b('0x3a'):_0xa92b('0x39');var _0x23f0ff=_0xa92b('0x28')+_0x55919b[_0xa92b('0x26')];return db[_0xa92b('0x3b')][_0xa92b('0x29')](_0x23f0ff,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0xa92b('0x1c')](function(_0x514ef5){if(_0x514ef5){_0x55919b[_0xa92b('0x2d')]=_0x514ef5[0x0];}if(typeof _0x55919b[_0xa92b('0x3c')]===_0xa92b('0x27'))return;return getAgent(_0x55919b[_0xa92b('0x3c')]);})[_0xa92b('0x1c')](function(_0x3fbd3b){if(_0x3fbd3b){_0x55919b[_0xa92b('0x36')]=util['format']('SIP/%s',_0x3fbd3b['name']);_0x55919b[_0xa92b('0x30')]=_0x3fbd3b;}return request({'event':_0x24e6a4,'message':_0x55919b});})['catch'](function(_0x5d2c4d){logger[_0xa92b('0x1f')](_0xa92b('0x21'),_0xa92b('0x3d'),_0x5d2c4d);});}};}function getAgent(_0x338fce){return db[_0xa92b('0x3e')][_0xa92b('0x3f')]({'where':{'id':_0x338fce},'attributes':['id',_0xa92b('0x40'),_0xa92b('0x41'),'email',_0xa92b('0x42')],'raw':!![]})[_0xa92b('0x1c')](function(_0x44f95e){return _0x44f95e;});}exports['default']=function(){for(var _0x35260e=0x0;_0x35260e=_0x37ac6f[_0xadb5('0x12')]){throw Error(_0xadb5('0x13'));}_0x532834(_0x9cc52c);})[_0xadb5('0x14')](function(_0x4e5298){_0x305f7b(_0x4e5298);});});}; \ No newline at end of file +var _0x48bc=['agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','../mysqldb','./license/util','voice','chat','fax','openchannel','getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','blockedAt','updateAttributes','getLicense','count','then'];(function(_0xfc0976,_0x33776f){var _0x23579f=function(_0x4143d9){while(--_0x4143d9){_0xfc0976['push'](_0xfc0976['shift']());}};_0x23579f(++_0x33776f);}(_0x48bc,0x12f));var _0xc48b=function(_0x32f17c,_0x304c60){_0x32f17c=_0x32f17c-0x0;var _0x3bc76d=_0x48bc[_0x32f17c];return _0x3bc76d;};'use strict';var _=require(_0xc48b('0x0'));var BPromise=require('bluebird');var db=require(_0xc48b('0x1'))['db'];var util=require(_0xc48b('0x2'));var channels=[_0xc48b('0x3'),'mail',_0xc48b('0x4'),_0xc48b('0x5'),'sms','whatsapp',_0xc48b('0x6')];exports[_0xc48b('0x7')]=function(){return channels;};exports[_0xc48b('0x8')]=function(_0xc267ee){_0xc267ee=_0xc267ee[_0xc48b('0x9')]();return _[_0xc48b('0xa')](channels,_0xc267ee);};exports[_0xc48b('0xb')]=function(_0x4d4ff2,_0x52eec8,_0x30d8e6,_0x3ca345){var _0x51b3bb={'loginAttempts':_0x52eec8,'blocked':_0x30d8e6};if(!_['isUndefined'](_0x3ca345)){_0x51b3bb[_0xc48b('0xc')]=_0x3ca345;}return _0x4d4ff2[_0xc48b('0xd')](_0x51b3bb);};exports[_0xc48b('0xe')]=function(_0xc08a66){return new BPromise(function(_0x34a0a3,_0x5407ed){var _0x85f649=0x0;if(_0xc08a66['role']!=='agent'){_0x34a0a3(_0xc08a66);}db['User'][_0xc48b('0xf')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0xc08a66['id']}}})['then'](function(_0x3437c1){_0x85f649=_0x3437c1;return util[_0xc48b('0xe')]();})[_0xc48b('0x10')](function(_0x109ae4){if(_0x109ae4&&_0x109ae4[_0xc48b('0x11')]&&_0x85f649>=_0x109ae4[_0xc48b('0x11')]){throw Error(_0xc48b('0x12'));}_0x34a0a3(_0xc08a66);})[_0xc48b('0x13')](function(_0x5eea76){_0x5407ed(_0x5eea76);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 3d18155..9472263 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x20e2=['stack','statusMessage','send','exports','util','../config/logger','api','Internal\x20Server\x20Error','name','Error','message','Bad\x20Request','Forbidden','inherits','Not\x20Found','Out\x20Of\x20Interval','code','details','Resource\x20Conflict','Conflict','error'];(function(_0x3fe7fa,_0xa4f071){var _0x32d401=function(_0xe79eac){while(--_0xe79eac){_0x3fe7fa['push'](_0x3fe7fa['shift']());}};_0x32d401(++_0xa4f071);}(_0x20e2,0x1bd));var _0x220e=function(_0x541754,_0x57c3f8){_0x541754=_0x541754-0x0;var _0x52344f=_0x20e2[_0x541754];return _0x52344f;};'use strict';var util=require(_0x220e('0x0'));var logger=require(_0x220e('0x1'))(_0x220e('0x2'));var APIError=function(_0x3b7ad1,_0x5e2fe9){this['message']=_0x3b7ad1||_0x220e('0x3');this[_0x220e('0x4')]=_0x5e2fe9||_0x220e('0x5');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x3b4f49){this[_0x220e('0x6')]=_0x3b4f49||_0x220e('0x7');this[_0x220e('0x4')]=_0x220e('0x7');util['inherits'](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x3057db){this[_0x220e('0x6')]=_0x3057db||_0x220e('0x8');this[_0x220e('0x4')]=_0x220e('0x8');util[_0x220e('0x9')](APIForbiddenError,APIError);};var APINotFoundError=function(_0x1817c6){this[_0x220e('0x6')]=_0x1817c6||'Entity\x20not\x20found';this[_0x220e('0x4')]=_0x220e('0xa');util['inherits'](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x3eda7e){this[_0x220e('0x6')]=_0x3eda7e||'Message\x20sent\x20outside\x20a\x20valid\x20interval';this['name']=_0x220e('0xb');this[_0x220e('0xc')]=0x193;this[_0x220e('0xd')]={'type':'OutOfInterval'};util[_0x220e('0x9')](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x4c57c6){this[_0x220e('0x6')]=_0x4c57c6||_0x220e('0xe');this[_0x220e('0x4')]=_0x220e('0xf');util[_0x220e('0x9')](APIBadRequestError,APIError);};function getStatusCode(_0x10201){switch(_0x10201){case _0x220e('0x7'):return 0x190;case'Forbidden',_0x220e('0xb'):return 0x193;case _0x220e('0xa'):return 0x194;case'Conflict':return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0xa16006){if(_0xa16006===_0x220e('0xb'))return _0xa16006;return null;}function handleError(_0x2a2fb7){return function(_0x360104){logger[_0x220e('0x10')](_0x360104[_0x220e('0x11')]);var _0x240a74=getStatusCode(_0x360104[_0x220e('0x4')]);var _0xe86192=getCustomStatusMessage(_0x360104[_0x220e('0x4')]);if(_0x360104['name']){delete _0x360104[_0x220e('0x4')];}if(_0xe86192){_0x2a2fb7[_0x220e('0x12')]=_0xe86192;}return _0x2a2fb7['status'](_0x240a74)[_0x220e('0x13')](_0x360104);};}module[_0x220e('0x14')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file +var _0x55fe=['inherits','Bad\x20Request','Forbidden','Not\x20Found','OutOfInterval','Resource\x20Conflict','Conflict','Out\x20Of\x20Interval','error','stack','statusMessage','status','send','exports','../config/logger','api','message','Internal\x20Server\x20Error','name','Error'];(function(_0x310d76,_0x511586){var _0x54ebcd=function(_0x1063e7){while(--_0x1063e7){_0x310d76['push'](_0x310d76['shift']());}};_0x54ebcd(++_0x511586);}(_0x55fe,0x1c6));var _0xe55f=function(_0x56595f,_0x5114af){_0x56595f=_0x56595f-0x0;var _0x34d012=_0x55fe[_0x56595f];return _0x34d012;};'use strict';var util=require('util');var logger=require(_0xe55f('0x0'))(_0xe55f('0x1'));var APIError=function(_0x4ad098,_0xc1c65){this[_0xe55f('0x2')]=_0x4ad098||_0xe55f('0x3');this[_0xe55f('0x4')]=_0xc1c65||_0xe55f('0x5');util[_0xe55f('0x6')](APIError,Error);};var APIBadRequestError=function(_0x312220){this[_0xe55f('0x2')]=_0x312220||'Bad\x20Request';this[_0xe55f('0x4')]=_0xe55f('0x7');util[_0xe55f('0x6')](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x76e405){this[_0xe55f('0x2')]=_0x76e405||_0xe55f('0x8');this[_0xe55f('0x4')]=_0xe55f('0x8');util[_0xe55f('0x6')](APIForbiddenError,APIError);};var APINotFoundError=function(_0x4224d8){this[_0xe55f('0x2')]=_0x4224d8||'Entity\x20not\x20found';this[_0xe55f('0x4')]=_0xe55f('0x9');util[_0xe55f('0x6')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x4b8f61){this[_0xe55f('0x2')]=_0x4b8f61||'Message\x20sent\x20outside\x20a\x20valid\x20interval';this[_0xe55f('0x4')]='Out\x20Of\x20Interval';this['code']=0x193;this['details']={'type':_0xe55f('0xa')};util[_0xe55f('0x6')](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x4c548e){this[_0xe55f('0x2')]=_0x4c548e||_0xe55f('0xb');this[_0xe55f('0x4')]=_0xe55f('0xc');util[_0xe55f('0x6')](APIBadRequestError,APIError);};function getStatusCode(_0x30fe26){switch(_0x30fe26){case'Bad\x20Request':return 0x190;case _0xe55f('0x8'),_0xe55f('0xd'):return 0x193;case'Not\x20Found':return 0x194;case _0xe55f('0xc'):return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0x1b83be){if(_0x1b83be===_0xe55f('0xd'))return _0x1b83be;return null;}function handleError(_0xabb5a9){return function(_0x3a8670){logger[_0xe55f('0xe')](_0x3a8670[_0xe55f('0xf')]);var _0xf14320=getStatusCode(_0x3a8670['name']);var _0x4f1a96=getCustomStatusMessage(_0x3a8670[_0xe55f('0x4')]);if(_0x3a8670[_0xe55f('0x4')]){delete _0x3a8670[_0xe55f('0x4')];}if(_0x4f1a96){_0xabb5a9[_0xe55f('0x10')]=_0x4f1a96;}return _0xabb5a9[_0xe55f('0x11')](_0xf14320)[_0xe55f('0x12')](_0x3a8670);};}module[_0xe55f('0x13')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 1cec34a..b8773fc 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe65c=['exports','404','status','render','json','send'];(function(_0x3ceda0,_0x40e069){var _0x4f087c=function(_0x33c82c){while(--_0x33c82c){_0x3ceda0['push'](_0x3ceda0['shift']());}};_0x4f087c(++_0x40e069);}(_0xe65c,0x19e));var _0xce65=function(_0x3ab0ac,_0x1ea9cf){_0x3ab0ac=_0x3ab0ac-0x0;var _0x1f743d=_0xe65c[_0x3ab0ac];return _0x1f743d;};'use strict';module[_0xce65('0x0')][0x194]=function pageNotFound(_0xb5f4e,_0x2572d7){var _0x7dc233=_0xce65('0x1');var _0x48ad8f=0x194;var _0x39be2a={'status':_0x48ad8f};_0x2572d7['status'](_0x39be2a[_0xce65('0x2')]);_0x2572d7[_0xce65('0x3')](_0x7dc233,{},function(_0x4f98fb,_0x409997){if(_0x4f98fb){return _0x2572d7[_0xce65('0x2')](_0x39be2a[_0xce65('0x2')])[_0xce65('0x4')](_0x39be2a);}_0x2572d7[_0xce65('0x5')](_0x409997);});}; \ No newline at end of file +var _0x4dd2=['send','status','render','json'];(function(_0x23c02b,_0x411b4d){var _0x25efc5=function(_0x50e9e4){while(--_0x50e9e4){_0x23c02b['push'](_0x23c02b['shift']());}};_0x25efc5(++_0x411b4d);}(_0x4dd2,0xf1));var _0x24dd=function(_0x1809c5,_0x46cabc){_0x1809c5=_0x1809c5-0x0;var _0x5254a4=_0x4dd2[_0x1809c5];return _0x5254a4;};'use strict';module['exports'][0x194]=function pageNotFound(_0x772476,_0x2ee27b){var _0x2f171a='404';var _0x3d8377=0x194;var _0x5c459c={'status':_0x3d8377};_0x2ee27b[_0x24dd('0x0')](_0x5c459c['status']);_0x2ee27b[_0x24dd('0x1')](_0x2f171a,{},function(_0x2cbda5,_0x317135){if(_0x2cbda5){return _0x2ee27b['status'](_0x5c459c['status'])[_0x24dd('0x2')](_0x5c459c);}_0x2ee27b[_0x24dd('0x3')](_0x317135);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 282c9a5..b031b6a 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf5c4=['SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','Pause','Cdr','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','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','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/mailInteractionHasTag/mailInteractionHasTag.model','hasOne','cascade','userSetting','UserId','hasMany','Recordings','VoiceQueuesRt','VoiceExtension','Extensions','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteraction','UserNotifications','SenderId','Hoppers','belongsTo','userProfileId','belongsToMany','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','Lists','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','UserMailQueue','ChatQueues','FaxQueue','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','WhatsappAccounts','user_has_whatsapp_accounts','Applications','Sound','moh_has_sounds','Members','VoiceQueueId','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Team','Teams','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailboxuser','Contact','ContactId','MailServerIn','MailAccountId','CloudProviderId','restrict','Smtp','CannedAnswer','Answers','Interactions','List','ListId','mandatoryDispositionPause','team_has_mail_queues','MailInteractionId','Account','Tag','mail_interaction_has_tags','Tags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','Items','FaxAccountId','TagId','FaxInteractionId','Owner','fax_interaction_has_tags','ThroughTags','team_has_fax_queues','Dispositions','SmsAccountId','SmsApplication','user_has_sms_accounts','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','AttachmentId','team_has_openchannel_queues','ProactiveActions','user_has_chat_websites','Agent','Queue','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Website','CmCompany','CompanyId','Phones','CmContactId','HopperHistories','Company','cm_contact_has_tags','AdditionalPhones','CampaignId','All','OneAll','OneAny','AutomationAnyId','Automation','Actions','ParentId','Intervals','MailApplications','FaxApplications','SmsApplications','AnalyticDefaultReport','DefaultReportId','AnalyticCustomReport','CustomReportId','whatsapp_interaction_has_tags','ItemType','Hopper','CmHopperId','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','Configurations','AccountId','SalesforceConfiguration','Subjects','SubjectId','Descriptions','FieldId','Subject','Description','DescriptionId','VariableId','SugarcrmConfiguration','DeskAccount','DeskField','int_desk_configuration_has_tags','Field','ZohoConfiguration','ZohoField','ZendeskAccount','int_zendesk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerField','ServicenowAccount','Dynamics365Field','FreshsalesAccount','ChatQueueReport','ToId','SessionId','ProjectId','user_has_teams','team_has_whatsapp_queues','HopperBlacks','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromAgent','ToUserId','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','CmCustomField','CustomFields','Queues','UserProfileSection','UserProfileSections','Resources','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','WhatsappQueueReport','ToQueueId','WhatsappQueueId','user','Imap','exports','../config/environment','sequelize','lodash','jstz','determine','xC@LL1234','127.0.0.1','mysql','name','utf8','sequelizeHistory','defaultsDeep','xcall','utf8_general_ci','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','VoiceContext','../api/voiceContext/voiceContext.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','../api/smsApplication/smsApplication.model'];(function(_0x4114dd,_0x2ad862){var _0x26f44c=function(_0xad2246){while(--_0xad2246){_0x4114dd['push'](_0x4114dd['shift']());}};_0x26f44c(++_0x2ad862);}(_0xf5c4,0x1ae));var _0x4f5c=function(_0x1ee3d1,_0x41d916){_0x1ee3d1=_0x1ee3d1-0x0;var _0x495c8c=_0xf5c4[_0x1ee3d1];return _0x495c8c;};'use strict';var config=require(_0x4f5c('0x0'));var Sequelize=require(_0x4f5c('0x1'));var _=require(_0x4f5c('0x2'));var jstz=require(_0x4f5c('0x3'));var timezone=jstz[_0x4f5c('0x4')]();config[_0x4f5c('0x1')]=_['defaultsDeep'](config[_0x4f5c('0x1')],{'database':'motion2','username':'xcall','password':_0x4f5c('0x5'),'options':{'host':_0x4f5c('0x6'),'port':0xcea,'dialect':_0x4f5c('0x7'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x4f5c('0x8')](),'define':{'charset':_0x4f5c('0x9'),'collate':'utf8_general_ci'}}});config[_0x4f5c('0xa')]=_[_0x4f5c('0xb')](config['sequelizeHistory'],{'database':'motion2','username':_0x4f5c('0xc'),'password':_0x4f5c('0x5'),'options':{'host':_0x4f5c('0x6'),'port':0xcea,'dialect':_0x4f5c('0x7'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x4f5c('0x8')](),'define':{'charset':'utf8','collate':_0x4f5c('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4f5c('0x1')][_0x4f5c('0xe')],config[_0x4f5c('0x1')][_0x4f5c('0xf')],config['sequelize'][_0x4f5c('0x10')],config['sequelize'][_0x4f5c('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4f5c('0xa')]['database'],config['sequelizeHistory'][_0x4f5c('0xf')],config[_0x4f5c('0xa')][_0x4f5c('0x10')],config['sequelizeHistory'][_0x4f5c('0x11')])};db[_0x4f5c('0x12')]=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0x14'));db[_0x4f5c('0x15')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0x4f5c('0x16')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x17'));db['VoiceExtension']=db[_0x4f5c('0x1')][_0x4f5c('0x13')]('../api/voiceExtension/voiceExtension.model');db[_0x4f5c('0x18')]=db[_0x4f5c('0x1')]['import'](_0x4f5c('0x19'));db[_0x4f5c('0x1a')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x1b'));db[_0x4f5c('0x1c')]=db['sequelize']['import'](_0x4f5c('0x1d'));db[_0x4f5c('0x1e')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x1f'));db[_0x4f5c('0x20')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x21'));db['VoiceMailMessage']=db[_0x4f5c('0x1')][_0x4f5c('0x13')]('../api/voiceMailMessage/voiceMailMessage.model');db[_0x4f5c('0x22')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x23'));db[_0x4f5c('0x24')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x25'));db[_0x4f5c('0x26')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x4f5c('0x27')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x28'));db[_0x4f5c('0x29')]=db[_0x4f5c('0x1')]['import'](_0x4f5c('0x2a'));db[_0x4f5c('0x2b')]=db[_0x4f5c('0x1')]['import'](_0x4f5c('0x2c'));db['VoiceTransferReport']=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0x2d'));db[_0x4f5c('0x2e')]=db['sequelize'][_0x4f5c('0x13')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x4f5c('0x2f')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x30'));db[_0x4f5c('0x31')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x32'));db['UserMailQueue']=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x33'));db[_0x4f5c('0x34')]=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0x35'));db[_0x4f5c('0x36')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x37'));db[_0x4f5c('0x38')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x4f5c('0x39')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x3a'));db['MailServerIn']=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x3b'));db[_0x4f5c('0x3c')]=db['sequelize']['import'](_0x4f5c('0x3d'));db[_0x4f5c('0x3e')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x3f'));db['MailQueue']=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0x40'));db['MailSubstatus']=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x41'));db[_0x4f5c('0x42')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x43'));db[_0x4f5c('0x44')]=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0x45'));db[_0x4f5c('0x46')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x47'));db[_0x4f5c('0x48')]=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0x49'));db[_0x4f5c('0x4a')]=db[_0x4f5c('0x1')]['import'](_0x4f5c('0x4b'));db['DashboardItem']=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0x4c'));db[_0x4f5c('0x4d')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')]('../api/faxAccount/faxAccount.model');db[_0x4f5c('0x4e')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x4f'));db[_0x4f5c('0x50')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x51'));db[_0x4f5c('0x52')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x53'));db['FaxQueue']=db[_0x4f5c('0x1')][_0x4f5c('0x13')]('../api/faxQueue/faxQueue.model');db[_0x4f5c('0x54')]=db[_0x4f5c('0x1')]['import'](_0x4f5c('0x55'));db[_0x4f5c('0x56')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x57'));db['SmsApplication']=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x58'));db[_0x4f5c('0x59')]=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0x5a'));db[_0x4f5c('0x5b')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x5c'));db[_0x4f5c('0x5d')]=db['sequelize']['import'](_0x4f5c('0x5e'));db[_0x4f5c('0x5f')]=db['sequelize'][_0x4f5c('0x13')]('../api/openchannelAccount/openchannelAccount.model');db[_0x4f5c('0x60')]=db[_0x4f5c('0x1')]['import'](_0x4f5c('0x61'));db[_0x4f5c('0x62')]=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0x63'));db[_0x4f5c('0x64')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x65'));db[_0x4f5c('0x66')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x67'));db[_0x4f5c('0x68')]=db['sequelize']['import'](_0x4f5c('0x69'));db[_0x4f5c('0x6a')]=db[_0x4f5c('0x1')]['import'](_0x4f5c('0x6b'));db[_0x4f5c('0x6c')]=db[_0x4f5c('0x1')]['import'](_0x4f5c('0x6d'));db[_0x4f5c('0x6e')]=db[_0x4f5c('0x1')]['import'](_0x4f5c('0x6f'));db[_0x4f5c('0x70')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')]('../api/chatMessage/chatMessage.model');db[_0x4f5c('0x71')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x4f5c('0x72')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x73'));db[_0x4f5c('0x74')]=db[_0x4f5c('0x1')]['import'](_0x4f5c('0x75'));db[_0x4f5c('0x76')]=db[_0x4f5c('0x1')]['import'](_0x4f5c('0x77'));db['CmCompany']=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x78'));db[_0x4f5c('0x79')]=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0x7a'));db[_0x4f5c('0x7b')]=db[_0x4f5c('0x1')]['import'](_0x4f5c('0x7c'));db[_0x4f5c('0x7d')]=db[_0x4f5c('0x1')]['import']('../api/cmHopperBlack/cmHopperBlack.model');db[_0x4f5c('0x7e')]=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0x7f'));db[_0x4f5c('0x80')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x81'));db['ReportAgentPreview']=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0x82'));db['CmCustomField']=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x83'));db[_0x4f5c('0x84')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x85'));db['Automation']=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x86'));db['CannedAnswer']=db[_0x4f5c('0x1')]['import'](_0x4f5c('0x87'));db[_0x4f5c('0x88')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x89'));db[_0x4f5c('0x8a')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')]('../api/condition/condition.model');db[_0x4f5c('0x8b')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x8c'));db[_0x4f5c('0x8d')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')]('../api/pause/pause.model');db[_0x4f5c('0x8e')]=db['sequelize'][_0x4f5c('0x13')]('../api/cdr/cdr.model');db[_0x4f5c('0x8f')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x90'));db[_0x4f5c('0x91')]=db['sequelize']['import'](_0x4f5c('0x92'));db['Sound']=db[_0x4f5c('0x1')][_0x4f5c('0x13')]('../api/sound/sound.model');db['Tag']=db[_0x4f5c('0x1')][_0x4f5c('0x13')]('../api/tag/tag.model');db[_0x4f5c('0x93')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x94'));db[_0x4f5c('0x95')]=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0x96'));db[_0x4f5c('0x97')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x98'));db[_0x4f5c('0x99')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x9a'));db[_0x4f5c('0x9b')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')]('../api/trigger/trigger.model');db[_0x4f5c('0x9c')]=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0x9d'));db[_0x4f5c('0x9e')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x9f'));db[_0x4f5c('0xa0')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')]('../api/integrationReport/integrationReport.model');db['AnalyticCustomReport']=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xa1'));db['AnalyticDefaultReport']=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0xa2'));db[_0x4f5c('0xa3')]=db['sequelize'][_0x4f5c('0x13')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x4f5c('0xa4')]=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0xa5'));db[_0x4f5c('0xa6')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xa7'));db[_0x4f5c('0xa8')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xa9'));db[_0x4f5c('0xaa')]=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0xab'));db['SalesforceConfiguration']=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xac'));db[_0x4f5c('0xad')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xae'));db[_0x4f5c('0xaf')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xb0'));db['SugarcrmConfiguration']=db[_0x4f5c('0x1')][_0x4f5c('0x13')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x4f5c('0xb1')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xb2'));db['DeskAccount']=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xb3'));db[_0x4f5c('0xb4')]=db['sequelize']['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db['DeskField']=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0xb5'));db[_0x4f5c('0xb6')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xb7'));db['ZohoConfiguration']=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0xb8'));db['ZohoField']=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xb9'));db['ZendeskAccount']=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xba'));db[_0x4f5c('0xbb')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xbc'));db[_0x4f5c('0xbd')]=db[_0x4f5c('0x1')]['import'](_0x4f5c('0xbe'));db[_0x4f5c('0xbf')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xc0'));db['FreshdeskConfiguration']=db['sequelize'][_0x4f5c('0x13')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x4f5c('0xc1')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xc2'));db[_0x4f5c('0xc3')]=db['sequelize']['import'](_0x4f5c('0xc4'));db[_0x4f5c('0xc5')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db['VtigerField']=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xc6'));db['ServicenowAccount']=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0xc7'));db[_0x4f5c('0xc8')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xc9'));db[_0x4f5c('0xca')]=db[_0x4f5c('0x1')]['import'](_0x4f5c('0xcb'));db[_0x4f5c('0xcc')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xcd'));db[_0x4f5c('0xce')]=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0xcf'));db['Dynamics365Field']=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0xd0'));db['FreshsalesAccount']=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xd1'));db[_0x4f5c('0xd2')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xd3'));db[_0x4f5c('0xd4')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x4f5c('0x9e')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x9f'));db[_0x4f5c('0xd5')]=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0xd6'));db['ChatQueueReport']=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xd7'));db[_0x4f5c('0xd8')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xd9'));db[_0x4f5c('0xda')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xdb'));db[_0x4f5c('0xdc')]=db[_0x4f5c('0x1')]['import'](_0x4f5c('0xdd'));db[_0x4f5c('0xde')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x4f5c('0xdf')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xe0'));db[_0x4f5c('0xe1')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xe2'));db[_0x4f5c('0xe3')]=db[_0x4f5c('0x1')]['import'](_0x4f5c('0xe4'));db[_0x4f5c('0xe5')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xe6'));db[_0x4f5c('0xe7')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xe8'));db['SquareOdbc']=db['sequelize'][_0x4f5c('0x13')]('../api/squareOdbc/squareOdbc.model');db[_0x4f5c('0xe9')]=db[_0x4f5c('0x1')]['import'](_0x4f5c('0xea'));db[_0x4f5c('0xeb')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xec'));db[_0x4f5c('0xed')]=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0xee'));db['Team']=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xef'));db[_0x4f5c('0xf0')]=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0xf1'));db[_0x4f5c('0xf2')]=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0xf3'));db[_0x4f5c('0xf4')]=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0xf5'));db[_0x4f5c('0xf6')]=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0xf7'));db[_0x4f5c('0xf8')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')]('../api/plugin/plugin.model');db['MailTransferReport']=db[_0x4f5c('0x1')][_0x4f5c('0x13')]('../api/mailTransferReport/mailTransferReport.model');db[_0x4f5c('0xf9')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0xfa'));db['FaxTransferReport']=db[_0x4f5c('0x1')]['import'](_0x4f5c('0xfb'));db[_0x4f5c('0xfc')]=db[_0x4f5c('0x1')]['import'](_0x4f5c('0xfd'));db[_0x4f5c('0xfe')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')]('../api/smsTransferReport/smsTransferReport.model');db[_0x4f5c('0xff')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x100'));db[_0x4f5c('0x101')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x102'));db[_0x4f5c('0x103')]=db[_0x4f5c('0x1')]['import']('../api/userProfile/userProfile.model');db['UserProfileSection']=db[_0x4f5c('0x1')][_0x4f5c('0x13')]('../api/userProfileSection/userProfileSection.model');db[_0x4f5c('0x104')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x105'));db[_0x4f5c('0x106')]=db[_0x4f5c('0x1')]['import'](_0x4f5c('0x107'));db[_0x4f5c('0x108')]=db[_0x4f5c('0x1')]['import'](_0x4f5c('0x109'));db['WhatsappApplication']=db[_0x4f5c('0x1')]['import'](_0x4f5c('0x10a'));db['WhatsappInteraction']=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0x10b'));db[_0x4f5c('0x10c')]=db['sequelize'][_0x4f5c('0x13')]('../api/whatsappMessage/whatsappMessage.model');db['WhatsappQueueReport']=db[_0x4f5c('0x1')]['import'](_0x4f5c('0x10d'));db[_0x4f5c('0x10e')]=db['sequelize'][_0x4f5c('0x13')](_0x4f5c('0x10f'));db[_0x4f5c('0x110')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x111'));db[_0x4f5c('0x112')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x113'));db[_0x4f5c('0x114')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x115'));db[_0x4f5c('0x116')]=db[_0x4f5c('0x1')]['import']('../api/teamVoicePrefix/teamVoicePrefix.model');db[_0x4f5c('0x117')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x118'));db[_0x4f5c('0x119')]=db[_0x4f5c('0x1')][_0x4f5c('0x13')]('../api/user-setting/user-setting.model');db['MailInteractionHasTag']=db[_0x4f5c('0x1')][_0x4f5c('0x13')](_0x4f5c('0x11a'));db['User'][_0x4f5c('0x11b')](db[_0x4f5c('0x20')],{'as':'VoiceMail','onDelete':_0x4f5c('0x11c'),'foreignKey':'UserId'});db['User']['hasOne'](db['UserSetting'],{'as':_0x4f5c('0x11d'),'onDelete':_0x4f5c('0x11c'),'foreignKey':_0x4f5c('0x11e')});db['User'][_0x4f5c('0x11f')](db['VoiceRecording'],{'as':_0x4f5c('0x120'),'foreignKey':_0x4f5c('0x11e')});db[_0x4f5c('0x12')][_0x4f5c('0x11f')](db[_0x4f5c('0x2e')],{'as':_0x4f5c('0x121'),'foreignKey':_0x4f5c('0x11e')});db['User'][_0x4f5c('0x11f')](db[_0x4f5c('0x122')],{'as':_0x4f5c('0x123'),'onDelete':_0x4f5c('0x11c'),'hooks':!![]});db[_0x4f5c('0x12')][_0x4f5c('0x11f')](db[_0x4f5c('0x7e')],{'as':_0x4f5c('0x124'),'foreignKey':_0x4f5c('0x11e')});db[_0x4f5c('0x12')][_0x4f5c('0x11f')](db[_0x4f5c('0x80')],{'as':_0x4f5c('0x125'),'foreignKey':'UserId'});db[_0x4f5c('0x12')][_0x4f5c('0x11f')](db[_0x4f5c('0x126')],{'as':'ReportAgentPreview','foreignKey':'UserId'});db[_0x4f5c('0x12')][_0x4f5c('0x11f')](db[_0x4f5c('0x62')],{'as':_0x4f5c('0x127'),'foreignKey':_0x4f5c('0x11e')});db[_0x4f5c('0x12')][_0x4f5c('0x11f')](db[_0x4f5c('0x6e')],{'as':_0x4f5c('0x128'),'foreignKey':_0x4f5c('0x11e')});db[_0x4f5c('0x12')][_0x4f5c('0x11f')](db[_0x4f5c('0x59')],{'as':_0x4f5c('0x129'),'foreignKey':'UserId'});db['User'][_0x4f5c('0x11f')](db['FaxInteraction'],{'as':_0x4f5c('0x12a'),'foreignKey':'UserId'});db[_0x4f5c('0x12')]['hasMany'](db[_0x4f5c('0x42')],{'as':_0x4f5c('0x12b'),'foreignKey':_0x4f5c('0x11e')});db['User'][_0x4f5c('0x11f')](db[_0x4f5c('0x12c')],{'as':'WhatsappInteractions','foreignKey':'UserId'});db[_0x4f5c('0x12')][_0x4f5c('0x11f')](db[_0x4f5c('0x106')],{'as':_0x4f5c('0x12d'),'foreignKey':_0x4f5c('0x12e')});db[_0x4f5c('0x12')][_0x4f5c('0x11f')](db['CmHopper'],{'as':_0x4f5c('0x12f'),'foreignKey':'UserId','onDelete':'SET\x20NULL'});db[_0x4f5c('0x12')][_0x4f5c('0x130')](db['UserProfile'],{'as':_0x4f5c('0x103'),'foreignKey':_0x4f5c('0x131')});db[_0x4f5c('0x12')][_0x4f5c('0x132')](db[_0x4f5c('0x74')],{'as':_0x4f5c('0x133'),'through':_0x4f5c('0x134')});db[_0x4f5c('0x12')][_0x4f5c('0x132')](db[_0x4f5c('0x79')],{'as':_0x4f5c('0x135'),'through':_0x4f5c('0x136')});db[_0x4f5c('0x12')][_0x4f5c('0x132')](db[_0x4f5c('0xff')],{'as':_0x4f5c('0x137'),'through':_0x4f5c('0x138')});db[_0x4f5c('0x12')]['belongsToMany'](db['Team'],{'through':'user_has_teams'});db[_0x4f5c('0x12')]['belongsToMany'](db[_0x4f5c('0x42')],{'as':_0x4f5c('0x12b'),'through':_0x4f5c('0x139')});db['User']['belongsToMany'](db[_0x4f5c('0x6e')],{'as':_0x4f5c('0x128'),'through':_0x4f5c('0x13a')});db[_0x4f5c('0x12')]['belongsToMany'](db['FaxInteraction'],{'as':_0x4f5c('0x12a'),'through':_0x4f5c('0x13b')});db[_0x4f5c('0x12')][_0x4f5c('0x132')](db['SmsInteraction'],{'as':_0x4f5c('0x129'),'through':_0x4f5c('0x13c')});db[_0x4f5c('0x12')]['belongsToMany'](db[_0x4f5c('0x62')],{'as':_0x4f5c('0x127'),'through':'user_has_openchannel_interactions'});db[_0x4f5c('0x12')][_0x4f5c('0x132')](db[_0x4f5c('0x12c')],{'as':'WhatsappInteractions','through':_0x4f5c('0x13d')});db[_0x4f5c('0x12')][_0x4f5c('0x132')](db[_0x4f5c('0x1a')],{'as':_0x4f5c('0x13e'),'through':_0x4f5c('0x2f'),'required':![]});db['User'][_0x4f5c('0x132')](db[_0x4f5c('0x101')],{'as':_0x4f5c('0x13f'),'through':_0x4f5c('0x117'),'required':![]});db[_0x4f5c('0x12')][_0x4f5c('0x132')](db[_0x4f5c('0x140')],{'as':_0x4f5c('0x141'),'through':_0x4f5c('0x142'),'required':![]});db[_0x4f5c('0x12')]['belongsToMany'](db[_0x4f5c('0x72')],{'as':_0x4f5c('0x143'),'through':_0x4f5c('0x31'),'required':![],'hooks':!![]});db[_0x4f5c('0x12')][_0x4f5c('0x132')](db[_0x4f5c('0x144')],{'as':_0x4f5c('0x145'),'through':_0x4f5c('0x34'),'required':![]});db[_0x4f5c('0x12')][_0x4f5c('0x132')](db[_0x4f5c('0x5d')],{'as':_0x4f5c('0x146'),'through':_0x4f5c('0x36'),'required':![]});db['User'][_0x4f5c('0x132')](db['OpenchannelQueue'],{'as':_0x4f5c('0x147'),'through':_0x4f5c('0x38'),'required':![]});db['User'][_0x4f5c('0x132')](db['WhatsappQueue'],{'as':_0x4f5c('0x148'),'through':'UserWhatsappQueue','required':![]});db[_0x4f5c('0x12')][_0x4f5c('0x132')](db['CmList'],{'through':_0x4f5c('0x138')});db[_0x4f5c('0x12')]['belongsToMany'](db[_0x4f5c('0x68')],{'as':_0x4f5c('0x149'),'through':'user_has_chat_websites'});db['User']['belongsToMany'](db[_0x4f5c('0x4d')],{'as':_0x4f5c('0x14a'),'through':_0x4f5c('0x14b')});db['User'][_0x4f5c('0x132')](db[_0x4f5c('0x3e')],{'as':_0x4f5c('0x14c'),'through':_0x4f5c('0x14d')});db[_0x4f5c('0x12')][_0x4f5c('0x132')](db[_0x4f5c('0x5f')],{'as':_0x4f5c('0x14e'),'through':_0x4f5c('0x14f')});db[_0x4f5c('0x12')]['belongsToMany'](db[_0x4f5c('0x56')],{'as':'SmsAccounts','through':'user_has_sms_accounts'});db['User']['belongsToMany'](db[_0x4f5c('0x108')],{'as':_0x4f5c('0x150'),'through':_0x4f5c('0x151')});db[_0x4f5c('0x15')][_0x4f5c('0x11f')](db['VoiceExtension'],{'as':'SpiedAgents','onDelete':'cascade','foreignKey':'ChanSpyId'});db[_0x4f5c('0x16')][_0x4f5c('0x11f')](db[_0x4f5c('0x122')],{'onDelete':_0x4f5c('0x11c')});db[_0x4f5c('0x122')][_0x4f5c('0x11f')](db['VoiceExtension'],{'as':_0x4f5c('0x152'),'onDelete':'cascade'});db[_0x4f5c('0x18')][_0x4f5c('0x132')](db[_0x4f5c('0x153')],{'as':'Sounds','through':_0x4f5c('0x154')});db['VoiceQueue'][_0x4f5c('0x11f')](db['UserVoiceQueueRt'],{'as':_0x4f5c('0x155'),'foreignKey':'VoiceQueueId'});db[_0x4f5c('0x1a')][_0x4f5c('0x11f')](db[_0x4f5c('0x7b')],{'as':_0x4f5c('0x12f'),'foreignKey':_0x4f5c('0x156')});db[_0x4f5c('0x1a')][_0x4f5c('0x11f')](db[_0x4f5c('0x7e')],{'as':'HopperFinals','foreignKey':_0x4f5c('0x156')});db[_0x4f5c('0x1a')][_0x4f5c('0x11f')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0x4f5c('0x156')});db[_0x4f5c('0x1a')][_0x4f5c('0x11f')](db[_0x4f5c('0x126')],{'as':'ReportAgentPreview','foreignKey':_0x4f5c('0x156')});db[_0x4f5c('0x1a')][_0x4f5c('0x11f')](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0x4f5c('0x156')});db['VoiceQueue']['hasMany'](db[_0x4f5c('0xde')],{'as':_0x4f5c('0x157'),'foreignKey':_0x4f5c('0x156')});db[_0x4f5c('0x1a')][_0x4f5c('0x130')](db['Trunk'],{'as':_0x4f5c('0x2b'),'foreignKey':_0x4f5c('0x158')});db[_0x4f5c('0x1a')][_0x4f5c('0x130')](db['Trunk'],{'as':_0x4f5c('0x159'),'foreignKey':_0x4f5c('0x15a')});db[_0x4f5c('0x1a')]['belongsTo'](db['Interval'],{'as':_0x4f5c('0x8b'),'foreignKey':_0x4f5c('0x15b')});db[_0x4f5c('0x1a')][_0x4f5c('0x130')](db[_0x4f5c('0x8d')],{'as':'mandatoryDispositionPause','foreignKey':_0x4f5c('0x15c')});db[_0x4f5c('0x1a')][_0x4f5c('0x132')](db[_0x4f5c('0xff')],{'as':_0x4f5c('0x137'),'through':_0x4f5c('0x15d')});db['VoiceQueue'][_0x4f5c('0x132')](db[_0x4f5c('0x12')],{'as':_0x4f5c('0x15e'),'through':_0x4f5c('0x2f')});db[_0x4f5c('0x1a')][_0x4f5c('0x132')](db[_0x4f5c('0x15f')],{'as':_0x4f5c('0x160'),'through':_0x4f5c('0x114')});db[_0x4f5c('0x1a')][_0x4f5c('0x132')](db[_0x4f5c('0xff')],{'as':_0x4f5c('0x161'),'through':_0x4f5c('0x162')});db[_0x4f5c('0x1c')][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'as':'User','foreignKey':_0x4f5c('0x11e')});db[_0x4f5c('0x1e')][_0x4f5c('0x130')](db['User'],{'as':_0x4f5c('0x12'),'foreignKey':_0x4f5c('0x11e')});db['VoiceMail'][_0x4f5c('0x11f')](db[_0x4f5c('0x163')],{'as':_0x4f5c('0x164'),'onDelete':_0x4f5c('0x11c'),'foreignKey':_0x4f5c('0x165'),'sourceKey':'mailbox'});db[_0x4f5c('0x163')]['belongsTo'](db['VoiceMail'],{'foreignKey':_0x4f5c('0x165'),'targetKey':'mailbox'});db[_0x4f5c('0x22')]['hasMany'](db[_0x4f5c('0x27')],{'as':'QueueCalls','foreignKey':'uniqueid','constraints':![]});db[_0x4f5c('0x22')][_0x4f5c('0x11f')](db[_0x4f5c('0x26')],{'as':'AgentReports','foreignKey':'uniqueid','constraints':![]});db[_0x4f5c('0x22')][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'as':_0x4f5c('0x12'),'foreignKey':'UserId'});db[_0x4f5c('0x22')][_0x4f5c('0x130')](db['CmContact'],{'as':_0x4f5c('0x166'),'foreignKey':_0x4f5c('0x167')});db[_0x4f5c('0x168')]['belongsTo'](db['MailAccount'],{'as':_0x4f5c('0x3e'),'foreignKey':_0x4f5c('0x169')});db[_0x4f5c('0x168')][_0x4f5c('0x130')](db[_0x4f5c('0x112')],{'as':'CloudProvider','foreignKey':_0x4f5c('0x16a'),'onDelete':_0x4f5c('0x16b')});db[_0x4f5c('0x3c')][_0x4f5c('0x130')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0x4f5c('0x169')});db[_0x4f5c('0x3c')][_0x4f5c('0x130')](db[_0x4f5c('0x112')],{'as':'CloudProvider','foreignKey':_0x4f5c('0x16a'),'onDelete':_0x4f5c('0x16b')});db[_0x4f5c('0x3e')][_0x4f5c('0x11b')](db[_0x4f5c('0x168')],{'as':'Imap','onDelete':_0x4f5c('0x11c')});db['MailAccount']['hasOne'](db[_0x4f5c('0x3c')],{'as':_0x4f5c('0x16c'),'onDelete':_0x4f5c('0x11c')});db[_0x4f5c('0x3e')][_0x4f5c('0x11f')](db[_0x4f5c('0x88')],{'as':'Dispositions','foreignKey':'MailAccountId','onDelete':'cascade'});db[_0x4f5c('0x3e')][_0x4f5c('0x11f')](db[_0x4f5c('0x16d')],{'as':_0x4f5c('0x16e'),'foreignKey':_0x4f5c('0x169')});db[_0x4f5c('0x3e')][_0x4f5c('0x11f')](db[_0x4f5c('0x44')],{'as':_0x4f5c('0x164'),'foreignKey':'MailAccountId'});db[_0x4f5c('0x3e')][_0x4f5c('0x11f')](db[_0x4f5c('0x42')],{'as':_0x4f5c('0x16f')});db[_0x4f5c('0x3e')][_0x4f5c('0x11f')](db[_0x4f5c('0x46')],{'as':_0x4f5c('0x152'),'foreignKey':_0x4f5c('0x169'),'onDelete':'cascade'});db['MailAccount'][_0x4f5c('0x130')](db['CmList'],{'as':_0x4f5c('0x170'),'foreignKey':_0x4f5c('0x171')});db['MailAccount'][_0x4f5c('0x130')](db[_0x4f5c('0x99')],{'as':_0x4f5c('0x99'),'foreignKey':'TemplateId'});db['MailAccount'][_0x4f5c('0x130')](db[_0x4f5c('0x8d')],{'as':_0x4f5c('0x172'),'foreignKey':_0x4f5c('0x15c')});db[_0x4f5c('0x3e')][_0x4f5c('0x132')](db[_0x4f5c('0x12')],{'as':'Agents','through':'user_has_mail_accounts'});db[_0x4f5c('0x140')][_0x4f5c('0x132')](db[_0x4f5c('0x12')],{'as':_0x4f5c('0x15e'),'through':_0x4f5c('0x142')});db[_0x4f5c('0x140')][_0x4f5c('0x132')](db[_0x4f5c('0x15f')],{'through':_0x4f5c('0x173'),'as':_0x4f5c('0x160')});db[_0x4f5c('0x42')][_0x4f5c('0x11f')](db[_0x4f5c('0x44')],{'as':'Messages','onDelete':_0x4f5c('0x11c'),'foreignKey':_0x4f5c('0x174')});db[_0x4f5c('0x42')][_0x4f5c('0x130')](db[_0x4f5c('0x3e')],{'as':_0x4f5c('0x175'),'foreignKey':_0x4f5c('0x169')});db[_0x4f5c('0x42')]['belongsTo'](db[_0x4f5c('0x79')],{'as':'Contact','foreignKey':_0x4f5c('0x167')});db['MailInteraction'][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'as':'Owner','foreignKey':'UserId'});db['MailInteraction'][_0x4f5c('0x132')](db[_0x4f5c('0x176')],{'through':_0x4f5c('0x177'),'as':_0x4f5c('0x178')});db[_0x4f5c('0x42')][_0x4f5c('0x132')](db[_0x4f5c('0x176')],{'through':'mail_interaction_has_tags','as':'ThroughTags'});db[_0x4f5c('0x42')][_0x4f5c('0x132')](db[_0x4f5c('0x12')],{'as':_0x4f5c('0x179'),'through':'user_has_mail_interactions','foreignKey':_0x4f5c('0x174')});db['MailMessage'][_0x4f5c('0x11f')](db[_0x4f5c('0xf6')],{'as':_0x4f5c('0x17a'),'onDelete':_0x4f5c('0x11c')});db[_0x4f5c('0x44')][_0x4f5c('0x130')](db['User'],{'as':'User'});db[_0x4f5c('0x44')][_0x4f5c('0x130')](db['CmContact'],{'onDelete':_0x4f5c('0x11c'),'as':_0x4f5c('0x166')});db[_0x4f5c('0x44')][_0x4f5c('0x130')](db[_0x4f5c('0x42')],{'as':_0x4f5c('0x17b'),'foreignKey':_0x4f5c('0x174')});db[_0x4f5c('0x44')]['belongsTo'](db[_0x4f5c('0x3e')],{'as':_0x4f5c('0x175'),'foreignKey':_0x4f5c('0x169')});db[_0x4f5c('0x44')][_0x4f5c('0x130')](db[_0x4f5c('0x68')],{'as':_0x4f5c('0x68'),'foreignKey':_0x4f5c('0x17c')});db[_0x4f5c('0x44')][_0x4f5c('0x130')](db['ChatOfflineMessage'],{'as':_0x4f5c('0x71'),'foreignKey':_0x4f5c('0x17d')});db['MailApplication'][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'onDelete':'restrict'});db[_0x4f5c('0x46')][_0x4f5c('0x130')](db['MailQueue'],{'onDelete':_0x4f5c('0x16b')});db[_0x4f5c('0x46')][_0x4f5c('0x130')](db[_0x4f5c('0x3e')],{'onDelete':_0x4f5c('0x16b')});db[_0x4f5c('0x46')][_0x4f5c('0x130')](db[_0x4f5c('0x8b')],{'onDelete':_0x4f5c('0x16b'),'foreignKey':_0x4f5c('0x15b')});db[_0x4f5c('0x46')][_0x4f5c('0x130')](db[_0x4f5c('0x176')],{'onDelete':_0x4f5c('0x16b'),'foreignKey':'TagId'});db[_0x4f5c('0x48')][_0x4f5c('0x130')](db[_0x4f5c('0x3e')],{});db['MailQueueReport'][_0x4f5c('0x130')](db[_0x4f5c('0xff')],{'as':_0x4f5c('0x170'),'foreignKey':_0x4f5c('0x171')});db[_0x4f5c('0x48')][_0x4f5c('0x130')](db[_0x4f5c('0x79')],{'as':'Contact','foreignKey':_0x4f5c('0x167')});db['MailQueueReport']['belongsTo'](db[_0x4f5c('0x42')],{});db[_0x4f5c('0x48')]['belongsTo'](db[_0x4f5c('0x44')],{});db[_0x4f5c('0x48')][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{});db[_0x4f5c('0x48')][_0x4f5c('0x130')](db[_0x4f5c('0x140')],{});db['Dashboard'][_0x4f5c('0x11f')](db['DashboardItem'],{'as':_0x4f5c('0x17e'),'onDelete':'cascade'});db[_0x4f5c('0x4d')][_0x4f5c('0x11f')](db[_0x4f5c('0x88')],{'as':'Dispositions','foreignKey':_0x4f5c('0x17f'),'onDelete':_0x4f5c('0x11c')});db[_0x4f5c('0x4d')][_0x4f5c('0x11f')](db[_0x4f5c('0x16d')],{'as':_0x4f5c('0x16e'),'foreignKey':_0x4f5c('0x17f')});db['FaxAccount']['hasMany'](db[_0x4f5c('0x50')],{'as':'Interactions'});db['FaxAccount']['hasMany'](db[_0x4f5c('0x4e')],{'as':_0x4f5c('0x152'),'foreignKey':_0x4f5c('0x17f'),'onDelete':_0x4f5c('0x11c')});db['FaxAccount']['hasMany'](db[_0x4f5c('0x122')],{'as':'Exntensions','onDelete':_0x4f5c('0x11c')});db['FaxAccount'][_0x4f5c('0x11f')](db['FaxMessage'],{'as':_0x4f5c('0x164')});db['FaxAccount'][_0x4f5c('0x130')](db[_0x4f5c('0x2b')],{'as':'Trunk'});db[_0x4f5c('0x4d')]['belongsTo'](db[_0x4f5c('0xff')],{'as':_0x4f5c('0x170'),'foreignKey':_0x4f5c('0x171')});db[_0x4f5c('0x4d')][_0x4f5c('0x130')](db[_0x4f5c('0x8d')],{'as':_0x4f5c('0x172'),'foreignKey':_0x4f5c('0x15c')});db['FaxAccount'][_0x4f5c('0x132')](db[_0x4f5c('0x12')],{'as':_0x4f5c('0x15e'),'through':_0x4f5c('0x14b')});db[_0x4f5c('0x4e')][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'onDelete':_0x4f5c('0x16b')});db[_0x4f5c('0x4e')][_0x4f5c('0x130')](db[_0x4f5c('0x144')],{'onDelete':'restrict'});db['FaxApplication'][_0x4f5c('0x130')](db[_0x4f5c('0x4d')],{'onDelete':_0x4f5c('0x16b')});db[_0x4f5c('0x4e')]['belongsTo'](db[_0x4f5c('0x176')],{'onDelete':'restrict','foreignKey':_0x4f5c('0x180')});db[_0x4f5c('0x50')][_0x4f5c('0x11f')](db[_0x4f5c('0x52')],{'as':_0x4f5c('0x164'),'onDelete':_0x4f5c('0x11c'),'foreignKey':_0x4f5c('0x181')});db[_0x4f5c('0x50')]['belongsTo'](db['FaxAccount'],{'as':_0x4f5c('0x175'),'foreignKey':'FaxAccountId'});db[_0x4f5c('0x50')]['belongsTo'](db['CmContact'],{'as':_0x4f5c('0x166'),'foreignKey':_0x4f5c('0x167')});db['FaxInteraction'][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'as':_0x4f5c('0x182'),'foreignKey':_0x4f5c('0x11e')});db[_0x4f5c('0x50')][_0x4f5c('0x132')](db[_0x4f5c('0x176')],{'through':'fax_interaction_has_tags','as':'Tags'});db[_0x4f5c('0x50')][_0x4f5c('0x132')](db[_0x4f5c('0x176')],{'through':_0x4f5c('0x183'),'as':_0x4f5c('0x184')});db[_0x4f5c('0x50')][_0x4f5c('0x132')](db['User'],{'as':_0x4f5c('0x179'),'through':_0x4f5c('0x13b'),'foreignKey':'FaxInteractionId'});db[_0x4f5c('0x52')]['belongsTo'](db['User'],{'onDelete':_0x4f5c('0x11c'),'as':_0x4f5c('0x12')});db[_0x4f5c('0x52')][_0x4f5c('0x130')](db[_0x4f5c('0x50')],{'as':'Interaction','foreignKey':_0x4f5c('0x181')});db[_0x4f5c('0x52')]['belongsTo'](db[_0x4f5c('0x79')],{'onDelete':_0x4f5c('0x11c'),'as':_0x4f5c('0x166')});db['FaxMessage'][_0x4f5c('0x130')](db['Attachment'],{'as':_0x4f5c('0xf6'),'foreignKey':'AttachmentId'});db[_0x4f5c('0x52')][_0x4f5c('0x130')](db[_0x4f5c('0x4d')],{'as':'Account','foreignKey':_0x4f5c('0x17f')});db['FaxQueue'][_0x4f5c('0x132')](db[_0x4f5c('0x12')],{'as':_0x4f5c('0x15e'),'through':_0x4f5c('0x34')});db[_0x4f5c('0x144')][_0x4f5c('0x132')](db[_0x4f5c('0x15f')],{'through':_0x4f5c('0x185'),'as':_0x4f5c('0x160')});db[_0x4f5c('0x54')][_0x4f5c('0x130')](db[_0x4f5c('0x4d')],{});db[_0x4f5c('0x54')][_0x4f5c('0x130')](db[_0x4f5c('0xff')],{'as':_0x4f5c('0x170'),'foreignKey':'ListId'});db['FaxQueueReport']['belongsTo'](db[_0x4f5c('0x79')],{'as':_0x4f5c('0x166'),'foreignKey':_0x4f5c('0x167')});db[_0x4f5c('0x54')][_0x4f5c('0x130')](db[_0x4f5c('0x50')],{});db[_0x4f5c('0x54')][_0x4f5c('0x130')](db[_0x4f5c('0x52')],{});db['FaxQueueReport'][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{});db[_0x4f5c('0x54')][_0x4f5c('0x130')](db[_0x4f5c('0x144')],{});db[_0x4f5c('0x56')]['hasMany'](db[_0x4f5c('0x88')],{'as':_0x4f5c('0x186'),'foreignKey':_0x4f5c('0x187'),'onDelete':_0x4f5c('0x11c')});db[_0x4f5c('0x56')][_0x4f5c('0x11f')](db['CannedAnswer'],{'as':_0x4f5c('0x16e'),'foreignKey':_0x4f5c('0x187')});db['SmsAccount']['hasMany'](db[_0x4f5c('0x5b')],{'as':_0x4f5c('0x164'),'foreignKey':_0x4f5c('0x187')});db[_0x4f5c('0x56')][_0x4f5c('0x11f')](db[_0x4f5c('0x59')],{'as':_0x4f5c('0x16f')});db[_0x4f5c('0x56')][_0x4f5c('0x11f')](db[_0x4f5c('0x188')],{'as':_0x4f5c('0x152'),'foreignKey':_0x4f5c('0x187'),'onDelete':_0x4f5c('0x11c')});db['SmsAccount'][_0x4f5c('0x130')](db[_0x4f5c('0xff')],{'as':_0x4f5c('0x170'),'foreignKey':_0x4f5c('0x171')});db[_0x4f5c('0x56')][_0x4f5c('0x130')](db[_0x4f5c('0x8d')],{'as':_0x4f5c('0x172'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x4f5c('0x56')]['belongsToMany'](db['User'],{'as':_0x4f5c('0x15e'),'through':_0x4f5c('0x189')});db['SmsApplication'][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'onDelete':_0x4f5c('0x16b')});db['SmsApplication']['belongsTo'](db[_0x4f5c('0x5d')],{'onDelete':'restrict'});db[_0x4f5c('0x188')][_0x4f5c('0x130')](db[_0x4f5c('0x56')],{'onDelete':_0x4f5c('0x16b')});db[_0x4f5c('0x188')][_0x4f5c('0x130')](db[_0x4f5c('0x8b')],{'onDelete':'restrict','foreignKey':'IntervalId'});db['SmsApplication'][_0x4f5c('0x130')](db[_0x4f5c('0x176')],{'onDelete':_0x4f5c('0x16b'),'foreignKey':_0x4f5c('0x180')});db[_0x4f5c('0x59')][_0x4f5c('0x11f')](db[_0x4f5c('0x5b')],{'as':_0x4f5c('0x164'),'onDelete':'cascade','foreignKey':_0x4f5c('0x18a')});db[_0x4f5c('0x59')][_0x4f5c('0x130')](db[_0x4f5c('0x56')],{'as':_0x4f5c('0x175'),'foreignKey':_0x4f5c('0x187')});db['SmsInteraction'][_0x4f5c('0x130')](db[_0x4f5c('0x79')],{'as':_0x4f5c('0x166'),'foreignKey':_0x4f5c('0x167')});db[_0x4f5c('0x59')][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'as':_0x4f5c('0x182'),'foreignKey':_0x4f5c('0x11e')});db['SmsInteraction'][_0x4f5c('0x132')](db[_0x4f5c('0x176')],{'through':_0x4f5c('0x18b'),'as':'Tags'});db['SmsInteraction'][_0x4f5c('0x132')](db[_0x4f5c('0x176')],{'through':_0x4f5c('0x18b'),'as':'ThroughTags'});db[_0x4f5c('0x59')][_0x4f5c('0x132')](db[_0x4f5c('0x12')],{'as':'Users','through':_0x4f5c('0x13c'),'foreignKey':_0x4f5c('0x18a')});db[_0x4f5c('0x5b')][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'as':'User'});db[_0x4f5c('0x5b')][_0x4f5c('0x130')](db[_0x4f5c('0x79')],{'onDelete':_0x4f5c('0x11c'),'as':_0x4f5c('0x166')});db[_0x4f5c('0x5b')][_0x4f5c('0x130')](db[_0x4f5c('0x59')],{'onDelete':_0x4f5c('0x11c'),'as':_0x4f5c('0x17b'),'foreignKey':_0x4f5c('0x18a')});db['SmsMessage'][_0x4f5c('0x130')](db[_0x4f5c('0x56')],{'as':_0x4f5c('0x175'),'foreignKey':_0x4f5c('0x187')});db[_0x4f5c('0x5d')][_0x4f5c('0x132')](db[_0x4f5c('0x12')],{'as':_0x4f5c('0x15e'),'through':_0x4f5c('0x36'),'foreignKey':_0x4f5c('0x18c')});db[_0x4f5c('0x5d')][_0x4f5c('0x132')](db[_0x4f5c('0x15f')],{'through':_0x4f5c('0x18d'),'as':'Teams'});db[_0x4f5c('0x5f')]['hasMany'](db[_0x4f5c('0x88')],{'as':_0x4f5c('0x186'),'foreignKey':'OpenchannelAccountId','onDelete':_0x4f5c('0x11c')});db[_0x4f5c('0x5f')]['hasMany'](db[_0x4f5c('0x16d')],{'as':_0x4f5c('0x16e'),'foreignKey':_0x4f5c('0x18e')});db[_0x4f5c('0x5f')][_0x4f5c('0x11f')](db['OpenchannelInteraction'],{'as':_0x4f5c('0x16f'),'foreignKey':_0x4f5c('0x18e')});db['OpenchannelAccount']['hasMany'](db['OpenchannelMessage'],{'as':_0x4f5c('0x164'),'foreignKey':'OpenchannelAccountId'});db[_0x4f5c('0x5f')][_0x4f5c('0x11f')](db[_0x4f5c('0x60')],{'as':_0x4f5c('0x152'),'foreignKey':_0x4f5c('0x18e'),'onDelete':_0x4f5c('0x11c')});db[_0x4f5c('0x5f')][_0x4f5c('0x130')](db[_0x4f5c('0xff')],{'as':_0x4f5c('0x170'),'foreignKey':_0x4f5c('0x171')});db['OpenchannelAccount'][_0x4f5c('0x130')](db['Pause'],{'as':_0x4f5c('0x172'),'foreignKey':'mandatoryDispositionPauseId'});db['OpenchannelAccount'][_0x4f5c('0x132')](db[_0x4f5c('0x12')],{'as':_0x4f5c('0x15e'),'through':_0x4f5c('0x14f')});db['OpenchannelApplication']['belongsTo'](db[_0x4f5c('0x12')],{'onDelete':_0x4f5c('0x16b')});db[_0x4f5c('0x60')][_0x4f5c('0x130')](db[_0x4f5c('0x66')],{'onDelete':_0x4f5c('0x16b'),'foreignKey':_0x4f5c('0x18f')});db['OpenchannelApplication'][_0x4f5c('0x130')](db[_0x4f5c('0x5f')],{'onDelete':_0x4f5c('0x16b'),'foreignKey':_0x4f5c('0x18e')});db['OpenchannelApplication']['belongsTo'](db[_0x4f5c('0x8b')],{'onDelete':_0x4f5c('0x16b'),'foreignKey':_0x4f5c('0x15b')});db['OpenchannelApplication'][_0x4f5c('0x130')](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x4f5c('0x62')][_0x4f5c('0x11f')](db[_0x4f5c('0x64')],{'as':_0x4f5c('0x164'),'onDelete':_0x4f5c('0x11c'),'foreignKey':_0x4f5c('0x190')});db[_0x4f5c('0x62')]['belongsTo'](db[_0x4f5c('0x5f')],{'as':_0x4f5c('0x175'),'foreignKey':_0x4f5c('0x18e')});db[_0x4f5c('0x62')][_0x4f5c('0x130')](db[_0x4f5c('0x79')],{'as':_0x4f5c('0x166'),'foreignKey':_0x4f5c('0x167')});db[_0x4f5c('0x62')][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'as':_0x4f5c('0x182'),'foreignKey':_0x4f5c('0x11e')});db[_0x4f5c('0x62')][_0x4f5c('0x132')](db[_0x4f5c('0x176')],{'through':'openchannel_interaction_has_tags','as':_0x4f5c('0x178')});db[_0x4f5c('0x62')][_0x4f5c('0x132')](db[_0x4f5c('0x176')],{'through':_0x4f5c('0x191'),'as':_0x4f5c('0x184')});db[_0x4f5c('0x62')]['belongsToMany'](db[_0x4f5c('0x12')],{'as':_0x4f5c('0x179'),'through':'user_has_openchannel_interactions','foreignKey':_0x4f5c('0x190')});db[_0x4f5c('0x64')][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'onDelete':_0x4f5c('0x11c'),'as':'User'});db[_0x4f5c('0x64')][_0x4f5c('0x130')](db['CmContact'],{'onDelete':_0x4f5c('0x11c'),'as':_0x4f5c('0x166')});db[_0x4f5c('0x64')]['belongsTo'](db[_0x4f5c('0x62')],{'onDelete':_0x4f5c('0x11c'),'as':_0x4f5c('0x17b'),'foreignKey':_0x4f5c('0x190')});db[_0x4f5c('0x64')][_0x4f5c('0x130')](db['Attachment'],{'as':_0x4f5c('0xf6'),'foreignKey':_0x4f5c('0x192')});db[_0x4f5c('0x64')][_0x4f5c('0x130')](db[_0x4f5c('0x5f')],{'as':_0x4f5c('0x175'),'foreignKey':_0x4f5c('0x18e')});db['OpenchannelQueue']['belongsToMany'](db[_0x4f5c('0x12')],{'as':_0x4f5c('0x15e'),'through':_0x4f5c('0x38'),'foreignKey':_0x4f5c('0x18f')});db[_0x4f5c('0x66')]['belongsToMany'](db[_0x4f5c('0x15f')],{'through':_0x4f5c('0x193'),'as':'Teams'});db[_0x4f5c('0x68')][_0x4f5c('0x11f')](db[_0x4f5c('0x88')],{'as':_0x4f5c('0x186'),'foreignKey':_0x4f5c('0x17c'),'onDelete':_0x4f5c('0x11c')});db[_0x4f5c('0x68')][_0x4f5c('0x11f')](db[_0x4f5c('0x16d')],{'as':_0x4f5c('0x16e'),'foreignKey':'ChatWebsiteId'});db['ChatWebsite'][_0x4f5c('0x11f')](db[_0x4f5c('0x76')],{'as':_0x4f5c('0x194')});db[_0x4f5c('0x68')][_0x4f5c('0x11f')](db[_0x4f5c('0x6e')],{'as':'Interactions'});db[_0x4f5c('0x68')][_0x4f5c('0x11f')](db[_0x4f5c('0x6c')],{'as':_0x4f5c('0x152'),'foreignKey':'ChatWebsiteId','onDelete':'cascade'});db[_0x4f5c('0x68')][_0x4f5c('0x11f')](db[_0x4f5c('0x70')],{'as':'Messages'});db['ChatWebsite'][_0x4f5c('0x130')](db[_0x4f5c('0xff')],{'as':_0x4f5c('0x170'),'foreignKey':_0x4f5c('0x171')});db['ChatWebsite'][_0x4f5c('0x130')](db['Interval'],{'as':_0x4f5c('0x8b'),'foreignKey':_0x4f5c('0x15b')});db[_0x4f5c('0x68')][_0x4f5c('0x130')](db[_0x4f5c('0x3e')],{'as':'MailAccount','foreignKey':_0x4f5c('0x169')});db[_0x4f5c('0x68')]['belongsTo'](db[_0x4f5c('0x8d')],{'as':'mandatoryDispositionPause','foreignKey':_0x4f5c('0x15c')});db[_0x4f5c('0x68')][_0x4f5c('0x132')](db[_0x4f5c('0x12')],{'as':_0x4f5c('0x15e'),'through':_0x4f5c('0x195')});db[_0x4f5c('0x6a')][_0x4f5c('0x130')](db[_0x4f5c('0x5f')],{});db[_0x4f5c('0x6a')]['belongsTo'](db[_0x4f5c('0xff')],{'as':_0x4f5c('0x170'),'foreignKey':_0x4f5c('0x171')});db[_0x4f5c('0x6a')][_0x4f5c('0x130')](db['CmContact'],{'as':_0x4f5c('0x166'),'foreignKey':_0x4f5c('0x167')});db['OpenchannelQueueReport'][_0x4f5c('0x130')](db[_0x4f5c('0x62')],{});db['OpenchannelQueueReport'][_0x4f5c('0x130')](db[_0x4f5c('0x64')],{});db[_0x4f5c('0x6a')][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{});db[_0x4f5c('0x6a')]['belongsTo'](db[_0x4f5c('0x66')],{});db[_0x4f5c('0x6c')][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'as':_0x4f5c('0x196'),'foreignKey':_0x4f5c('0x11e'),'onDelete':_0x4f5c('0x16b')});db[_0x4f5c('0x6c')][_0x4f5c('0x130')](db['ChatQueue'],{'as':_0x4f5c('0x197'),'foreignKey':'ChatQueueId','onDelete':_0x4f5c('0x16b')});db['ChatApplication'][_0x4f5c('0x130')](db[_0x4f5c('0x68')],{'as':'Website','foreignKey':_0x4f5c('0x17c'),'onDelete':_0x4f5c('0x16b')});db[_0x4f5c('0x6c')][_0x4f5c('0x130')](db[_0x4f5c('0x176')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x4f5c('0x6e')][_0x4f5c('0x11f')](db[_0x4f5c('0x70')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x4f5c('0x198')});db[_0x4f5c('0x6e')][_0x4f5c('0x130')](db[_0x4f5c('0x68')],{'as':_0x4f5c('0x175'),'foreignKey':_0x4f5c('0x17c')});db[_0x4f5c('0x6e')][_0x4f5c('0x130')](db[_0x4f5c('0x79')],{'as':_0x4f5c('0x166'),'foreignKey':_0x4f5c('0x167')});db[_0x4f5c('0x6e')][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'as':_0x4f5c('0x182'),'foreignKey':_0x4f5c('0x11e')});db[_0x4f5c('0x6e')][_0x4f5c('0x132')](db[_0x4f5c('0x176')],{'through':_0x4f5c('0x199'),'as':'Tags'});db['ChatInteraction']['belongsToMany'](db[_0x4f5c('0x176')],{'through':_0x4f5c('0x199'),'as':_0x4f5c('0x184')});db[_0x4f5c('0x6e')][_0x4f5c('0x132')](db[_0x4f5c('0x12')],{'as':_0x4f5c('0x179'),'through':_0x4f5c('0x13a'),'foreignKey':_0x4f5c('0x198')});db[_0x4f5c('0x70')][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'onDelete':_0x4f5c('0x11c'),'as':'User'});db[_0x4f5c('0x70')]['belongsTo'](db['CmContact'],{'onDelete':_0x4f5c('0x11c'),'as':_0x4f5c('0x166'),'foreignKey':'ContactId'});db['ChatMessage'][_0x4f5c('0x130')](db[_0x4f5c('0x6e')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x4f5c('0x198')});db['ChatMessage']['belongsTo'](db[_0x4f5c('0xf6')],{'as':_0x4f5c('0xf6'),'foreignKey':'AttachmentId'});db[_0x4f5c('0x70')][_0x4f5c('0x130')](db['ChatWebsite'],{'as':_0x4f5c('0x175'),'foreignKey':_0x4f5c('0x17c')});db['ChatOfflineMessage'][_0x4f5c('0x11f')](db[_0x4f5c('0xf6')],{'as':_0x4f5c('0x17a'),'foreignKey':_0x4f5c('0x17d'),'onDelete':_0x4f5c('0x11c'),'hooks':!![]});db['ChatOfflineMessage'][_0x4f5c('0x130')](db['CmContact'],{'onDelete':_0x4f5c('0x11c'),'as':_0x4f5c('0x166'),'foreignKey':_0x4f5c('0x167')});db['ChatOfflineMessage']['belongsTo'](db[_0x4f5c('0x68')],{'as':_0x4f5c('0x175'),'foreignKey':_0x4f5c('0x17c')});db[_0x4f5c('0x72')]['belongsToMany'](db['User'],{'as':_0x4f5c('0x15e'),'through':_0x4f5c('0x31'),'hooks':!![]});db[_0x4f5c('0x72')][_0x4f5c('0x132')](db[_0x4f5c('0x15f')],{'through':_0x4f5c('0x19a'),'as':_0x4f5c('0x160')});db[_0x4f5c('0x74')][_0x4f5c('0x11f')](db['ChatInternalMessage'],{'as':_0x4f5c('0x164'),'foreignKey':_0x4f5c('0x19b'),'onDelete':_0x4f5c('0x11c')});db[_0x4f5c('0x74')][_0x4f5c('0x132')](db[_0x4f5c('0x12')],{'as':_0x4f5c('0x155'),'through':_0x4f5c('0x134')});db[_0x4f5c('0x76')]['belongsTo'](db[_0x4f5c('0x68')],{'as':_0x4f5c('0x19c'),'foreignKey':_0x4f5c('0x17c')});db[_0x4f5c('0x19d')]['hasMany'](db[_0x4f5c('0x79')],{'as':'Contacts','foreignKey':_0x4f5c('0x19e')});db[_0x4f5c('0x79')][_0x4f5c('0x11f')](db[_0x4f5c('0x95')],{'as':_0x4f5c('0x19f'),'foreignKey':_0x4f5c('0x1a0')});db[_0x4f5c('0x79')][_0x4f5c('0x11f')](db[_0x4f5c('0x7b')],{'as':_0x4f5c('0x12f'),'foreignKey':_0x4f5c('0x167')});db['CmContact'][_0x4f5c('0x11f')](db['CmHopperFinal'],{'as':_0x4f5c('0x124'),'foreignKey':_0x4f5c('0x167')});db[_0x4f5c('0x79')][_0x4f5c('0x11f')](db[_0x4f5c('0x80')],{'as':_0x4f5c('0x1a1'),'foreignKey':_0x4f5c('0x167')});db['CmContact'][_0x4f5c('0x11f')](db[_0x4f5c('0x126')],{'as':'ReportAgentPreview','foreignKey':'ContactId'});db['CmContact']['hasMany'](db[_0x4f5c('0xde')],{'as':_0x4f5c('0x157'),'foreignKey':'ContactId'});db[_0x4f5c('0x79')]['hasMany'](db[_0x4f5c('0x62')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0x4f5c('0x16b')});db[_0x4f5c('0x79')][_0x4f5c('0x11f')](db[_0x4f5c('0x6e')],{'as':'ChatInteractions','foreignKey':_0x4f5c('0x167'),'onDelete':_0x4f5c('0x16b')});db['CmContact'][_0x4f5c('0x11f')](db[_0x4f5c('0x59')],{'as':'SmsInteractions','foreignKey':_0x4f5c('0x167'),'onDelete':_0x4f5c('0x16b')});db[_0x4f5c('0x79')][_0x4f5c('0x11f')](db[_0x4f5c('0x50')],{'as':_0x4f5c('0x12a'),'foreignKey':_0x4f5c('0x167'),'onDelete':_0x4f5c('0x16b')});db['CmContact'][_0x4f5c('0x11f')](db['MailInteraction'],{'as':_0x4f5c('0x12b'),'foreignKey':_0x4f5c('0x167'),'onDelete':'restrict'});db[_0x4f5c('0x79')][_0x4f5c('0x130')](db['CmCompany'],{'as':_0x4f5c('0x1a2'),'foreignKey':'CompanyId'});db[_0x4f5c('0x79')][_0x4f5c('0x130')](db[_0x4f5c('0xff')],{'as':_0x4f5c('0x170'),'foreignKey':'ListId','onDelete':'cascade'});db[_0x4f5c('0x79')][_0x4f5c('0x132')](db[_0x4f5c('0x12')],{'as':'Users','through':_0x4f5c('0x136')});db['CmContact'][_0x4f5c('0x132')](db[_0x4f5c('0x176')],{'as':_0x4f5c('0x178'),'through':_0x4f5c('0x1a3')});db[_0x4f5c('0x79')][_0x4f5c('0x132')](db[_0x4f5c('0x176')],{'through':_0x4f5c('0x1a3'),'as':'ThroughTags'});db[_0x4f5c('0x7b')][_0x4f5c('0x11f')](db[_0x4f5c('0x97')],{'as':_0x4f5c('0x1a4'),'foreignKey':'CmHopperId'});db[_0x4f5c('0x7b')][_0x4f5c('0x130')](db['CmContact'],{'as':_0x4f5c('0x166'),'foreignKey':_0x4f5c('0x167'),'onDelete':_0x4f5c('0x11c')});db[_0x4f5c('0x7b')][_0x4f5c('0x130')](db['CmList'],{'as':_0x4f5c('0x170'),'foreignKey':_0x4f5c('0x171'),'onDelete':'cascade'});db['CmHopper'][_0x4f5c('0x130')](db['User'],{'as':_0x4f5c('0x196'),'foreignKey':_0x4f5c('0x11e')});db[_0x4f5c('0x7b')][_0x4f5c('0x130')](db['VoiceQueue'],{'as':_0x4f5c('0x197'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db['CmHopper'][_0x4f5c('0x130')](db[_0x4f5c('0xf2')],{'as':'Campaign','foreignKey':_0x4f5c('0x1a5'),'onDelete':_0x4f5c('0x11c')});db[_0x4f5c('0x7b')][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'as':_0x4f5c('0x182'),'foreignKey':'OwnerId'});db[_0x4f5c('0x7d')][_0x4f5c('0x130')](db[_0x4f5c('0x79')],{'as':_0x4f5c('0x166'),'foreignKey':_0x4f5c('0x167'),'onDelete':'cascade'});db[_0x4f5c('0x7d')][_0x4f5c('0x130')](db[_0x4f5c('0xff')],{'as':'List','foreignKey':_0x4f5c('0x171'),'onDelete':_0x4f5c('0x11c')});db[_0x4f5c('0x7d')][_0x4f5c('0x130')](db[_0x4f5c('0x1a')],{'as':_0x4f5c('0x197'),'foreignKey':_0x4f5c('0x156'),'onDelete':_0x4f5c('0x11c')});db[_0x4f5c('0x7d')][_0x4f5c('0x130')](db[_0x4f5c('0xf2')],{'as':_0x4f5c('0xf2'),'foreignKey':_0x4f5c('0x1a5'),'onDelete':_0x4f5c('0x11c')});db['Automation'][_0x4f5c('0x11f')](db[_0x4f5c('0x8a')],{'as':{'plural':_0x4f5c('0x1a6'),'singular':_0x4f5c('0x1a7')},'foreignKey':'AutomationAllId','onDelete':_0x4f5c('0x11c'),'hooks':!![]});db['Automation'][_0x4f5c('0x11f')](db[_0x4f5c('0x8a')],{'as':{'plural':'Any','singular':_0x4f5c('0x1a8')},'foreignKey':_0x4f5c('0x1a9'),'onDelete':_0x4f5c('0x11c'),'hooks':!![]});db[_0x4f5c('0x1aa')][_0x4f5c('0x11f')](db['Action'],{'as':_0x4f5c('0x1ab'),'foreignKey':'AutomationId','onDelete':_0x4f5c('0x11c'),'hooks':!![]});db[_0x4f5c('0x88')]['hasMany'](db[_0x4f5c('0x88')],{'as':_0x4f5c('0x186'),'foreignKey':_0x4f5c('0x1ac'),'onDelete':_0x4f5c('0x11c')});db[_0x4f5c('0x8b')][_0x4f5c('0x11f')](db[_0x4f5c('0x8b')],{'as':_0x4f5c('0x1ad'),'foreignKey':_0x4f5c('0x15b'),'onDelete':_0x4f5c('0x11c'),'hooks':!![],'required':![]});db[_0x4f5c('0x8b')][_0x4f5c('0x11f')](db['VoiceExtension'],{'as':_0x4f5c('0x123'),'foreignKey':'IntervalId','onDelete':_0x4f5c('0x16b')});db[_0x4f5c('0x8b')][_0x4f5c('0x11f')](db[_0x4f5c('0x46')],{'as':_0x4f5c('0x1ae'),'foreignKey':_0x4f5c('0x15b')});db[_0x4f5c('0x8b')][_0x4f5c('0x11f')](db[_0x4f5c('0x6c')],{'as':'ChatApplications','foreignKey':'IntervalId'});db[_0x4f5c('0x8b')]['hasMany'](db['FaxApplication'],{'as':_0x4f5c('0x1af'),'foreignKey':_0x4f5c('0x15b')});db[_0x4f5c('0x8b')][_0x4f5c('0x11f')](db['SmsApplication'],{'as':_0x4f5c('0x1b0'),'foreignKey':_0x4f5c('0x15b')});db[_0x4f5c('0x91')][_0x4f5c('0x130')](db['MailAccount'],{});db[_0x4f5c('0x91')][_0x4f5c('0x130')](db[_0x4f5c('0x1b1')],{'foreignKey':_0x4f5c('0x1b2')});db[_0x4f5c('0x91')][_0x4f5c('0x130')](db[_0x4f5c('0x1b3')],{'foreignKey':_0x4f5c('0x1b4')});db[_0x4f5c('0x153')]['belongsToMany'](db[_0x4f5c('0x18')],{'as':'Mohs','through':'moh_has_sounds','onDelete':_0x4f5c('0x16b')});db[_0x4f5c('0x176')]['belongsToMany'](db[_0x4f5c('0x79')],{'through':_0x4f5c('0x1a3')});db['Tag']['belongsToMany'](db['ChatInteraction'],{'through':'chat_interaction_has_tags'});db[_0x4f5c('0x176')][_0x4f5c('0x132')](db[_0x4f5c('0x42')],{'through':_0x4f5c('0x177')});db['Tag']['belongsToMany'](db['SmsInteraction'],{'through':'sms_interaction_has_tags'});db[_0x4f5c('0x176')][_0x4f5c('0x132')](db[_0x4f5c('0x50')],{'through':_0x4f5c('0x183')});db[_0x4f5c('0x176')][_0x4f5c('0x132')](db[_0x4f5c('0x62')],{'through':_0x4f5c('0x191')});db['Tag']['belongsToMany'](db['WhatsappInteraction'],{'through':_0x4f5c('0x1b5')});db[_0x4f5c('0x95')][_0x4f5c('0x130')](db[_0x4f5c('0x93')],{'as':_0x4f5c('0x1b6'),'foreignKey':'ItemTypeId'});db[_0x4f5c('0x97')]['belongsTo'](db[_0x4f5c('0x7b')],{'as':_0x4f5c('0x1b7'),'foreignKey':_0x4f5c('0x1b8')});db[_0x4f5c('0x95')][_0x4f5c('0x130')](db[_0x4f5c('0x79')],{'as':_0x4f5c('0x166'),'foreignKey':'CmContactId'});db['Trigger'][_0x4f5c('0x11f')](db[_0x4f5c('0x8a')],{'as':{'plural':_0x4f5c('0x1b9'),'singular':'AllCondition'},'foreignKey':_0x4f5c('0x1ba'),'onDelete':_0x4f5c('0x11c'),'hooks':!![]});db[_0x4f5c('0x9b')][_0x4f5c('0x11f')](db[_0x4f5c('0x8a')],{'as':{'plural':_0x4f5c('0x1bb'),'singular':_0x4f5c('0x1bc')},'foreignKey':_0x4f5c('0x1bd'),'onDelete':_0x4f5c('0x11c'),'hooks':!![]});db['Trigger'][_0x4f5c('0x11f')](db[_0x4f5c('0x84')],{'as':_0x4f5c('0x1ab'),'foreignKey':_0x4f5c('0x1be'),'onDelete':_0x4f5c('0x11c'),'hooks':!![]});db['AnalyticCustomReport'][_0x4f5c('0x11f')](db['AnalyticFieldReport'],{'as':_0x4f5c('0x1bf'),'onDelete':'cascade','foreignKey':_0x4f5c('0x1b4'),'hooks':!![]});db[_0x4f5c('0x1b1')][_0x4f5c('0x11f')](db['AnalyticFieldReport'],{'as':_0x4f5c('0x1bf'),'onDelete':'cascade','foreignKey':_0x4f5c('0x1b2')});db[_0x4f5c('0xa4')][_0x4f5c('0x11f')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0x4f5c('0x11c'),'foreignKey':_0x4f5c('0x1c0')});db[_0x4f5c('0xa6')]['belongsTo'](db['AnalyticMetric'],{'foreignKey':'MetricId'});db[_0x4f5c('0xaa')][_0x4f5c('0x11f')](db['SalesforceConfiguration'],{'as':_0x4f5c('0x1c1'),'onDelete':'cascade','foreignKey':_0x4f5c('0x1c2')});db[_0x4f5c('0x1c3')][_0x4f5c('0x11f')](db[_0x4f5c('0xad')],{'as':_0x4f5c('0x1c4'),'onDelete':_0x4f5c('0x11c'),'foreignKey':_0x4f5c('0x1c5')});db[_0x4f5c('0x1c3')][_0x4f5c('0x11f')](db[_0x4f5c('0xad')],{'as':_0x4f5c('0x1c6'),'onDelete':_0x4f5c('0x11c'),'foreignKey':'DescriptionId'});db[_0x4f5c('0x1c3')][_0x4f5c('0x11f')](db[_0x4f5c('0xad')],{'as':_0x4f5c('0x1bf'),'onDelete':'cascade','foreignKey':_0x4f5c('0x1c7')});db[_0x4f5c('0x1c3')][_0x4f5c('0x130')](db[_0x4f5c('0xaa')],{'as':_0x4f5c('0x175'),'foreignKey':_0x4f5c('0x1c2')});db[_0x4f5c('0xad')]['hasMany'](db[_0x4f5c('0xad')],{'as':_0x4f5c('0x1c8'),'foreignKey':_0x4f5c('0x1c5')});db[_0x4f5c('0xad')][_0x4f5c('0x11f')](db['SalesforceField'],{'as':_0x4f5c('0x1c9'),'foreignKey':_0x4f5c('0x1ca')});db[_0x4f5c('0xad')][_0x4f5c('0x11f')](db[_0x4f5c('0xad')],{'as':'Field','foreignKey':'FieldId'});db[_0x4f5c('0xad')][_0x4f5c('0x130')](db[_0x4f5c('0x9c')],{'as':_0x4f5c('0x9c'),'foreignKey':_0x4f5c('0x1cb')});db[_0x4f5c('0xaf')][_0x4f5c('0x11f')](db[_0x4f5c('0x1cc')],{'as':_0x4f5c('0x1c1'),'onDelete':_0x4f5c('0x11c'),'foreignKey':_0x4f5c('0x1c2')});db[_0x4f5c('0x1cc')]['hasMany'](db[_0x4f5c('0xb1')],{'as':_0x4f5c('0x1c4'),'onDelete':_0x4f5c('0x11c'),'foreignKey':'SubjectId'});db[_0x4f5c('0x1cc')][_0x4f5c('0x11f')](db['SugarcrmField'],{'as':_0x4f5c('0x1c6'),'onDelete':_0x4f5c('0x11c'),'foreignKey':'DescriptionId'});db[_0x4f5c('0x1cc')]['hasMany'](db[_0x4f5c('0xb1')],{'as':_0x4f5c('0x1bf'),'onDelete':_0x4f5c('0x11c'),'foreignKey':_0x4f5c('0x1c7')});db['SugarcrmConfiguration'][_0x4f5c('0x130')](db['SugarcrmAccount'],{'as':'Account','foreignKey':_0x4f5c('0x1c2')});db[_0x4f5c('0xb1')][_0x4f5c('0x11f')](db[_0x4f5c('0xb1')],{'as':_0x4f5c('0x1c8'),'foreignKey':_0x4f5c('0x1c5')});db[_0x4f5c('0xb1')][_0x4f5c('0x11f')](db['SugarcrmField'],{'as':'Description','foreignKey':'DescriptionId'});db['SugarcrmField'][_0x4f5c('0x11f')](db[_0x4f5c('0xb1')],{'as':'Field','foreignKey':_0x4f5c('0x1c7')});db[_0x4f5c('0xb1')][_0x4f5c('0x130')](db['Variable'],{'as':_0x4f5c('0x9c'),'foreignKey':_0x4f5c('0x1cb')});db[_0x4f5c('0x1cd')][_0x4f5c('0x11f')](db[_0x4f5c('0xb4')],{'as':_0x4f5c('0x1c1'),'onDelete':_0x4f5c('0x11c'),'foreignKey':_0x4f5c('0x1c2')});db[_0x4f5c('0xb4')]['hasMany'](db[_0x4f5c('0x1ce')],{'as':'Subjects','onDelete':_0x4f5c('0x11c'),'foreignKey':'SubjectId'});db[_0x4f5c('0xb4')][_0x4f5c('0x11f')](db[_0x4f5c('0x1ce')],{'as':_0x4f5c('0x1c6'),'onDelete':_0x4f5c('0x11c'),'foreignKey':_0x4f5c('0x1ca')});db[_0x4f5c('0xb4')][_0x4f5c('0x11f')](db[_0x4f5c('0x1ce')],{'as':_0x4f5c('0x1bf'),'onDelete':_0x4f5c('0x11c'),'foreignKey':_0x4f5c('0x1c7')});db[_0x4f5c('0xb4')][_0x4f5c('0x130')](db[_0x4f5c('0x1cd')],{'as':'Account','foreignKey':_0x4f5c('0x1c2')});db[_0x4f5c('0xb4')]['belongsToMany'](db[_0x4f5c('0x176')],{'through':_0x4f5c('0x1cf')});db[_0x4f5c('0x1ce')][_0x4f5c('0x11f')](db[_0x4f5c('0x1ce')],{'as':_0x4f5c('0x1c8'),'foreignKey':'SubjectId'});db[_0x4f5c('0x1ce')][_0x4f5c('0x11f')](db['DeskField'],{'as':_0x4f5c('0x1c9'),'foreignKey':_0x4f5c('0x1ca')});db['DeskField']['hasMany'](db[_0x4f5c('0x1ce')],{'as':_0x4f5c('0x1d0'),'foreignKey':_0x4f5c('0x1c7')});db[_0x4f5c('0x1ce')][_0x4f5c('0x130')](db[_0x4f5c('0x9c')],{'as':'Variable','foreignKey':_0x4f5c('0x1cb')});db['ZohoAccount'][_0x4f5c('0x11f')](db[_0x4f5c('0x1d1')],{'as':_0x4f5c('0x1c1'),'onDelete':_0x4f5c('0x11c'),'foreignKey':'AccountId'});db[_0x4f5c('0x1d1')]['hasMany'](db['ZohoField'],{'as':_0x4f5c('0x1c4'),'onDelete':_0x4f5c('0x11c'),'foreignKey':_0x4f5c('0x1c5')});db['ZohoConfiguration'][_0x4f5c('0x11f')](db[_0x4f5c('0x1d2')],{'as':_0x4f5c('0x1c6'),'onDelete':'cascade','foreignKey':_0x4f5c('0x1ca')});db['ZohoConfiguration']['hasMany'](db[_0x4f5c('0x1d2')],{'as':_0x4f5c('0x1bf'),'onDelete':'cascade','foreignKey':_0x4f5c('0x1c7')});db[_0x4f5c('0x1d1')]['belongsTo'](db[_0x4f5c('0xb6')],{'as':_0x4f5c('0x175'),'foreignKey':_0x4f5c('0x1c2')});db[_0x4f5c('0x1d2')][_0x4f5c('0x11f')](db[_0x4f5c('0x1d2')],{'as':_0x4f5c('0x1c8'),'foreignKey':_0x4f5c('0x1c5')});db[_0x4f5c('0x1d2')][_0x4f5c('0x11f')](db[_0x4f5c('0x1d2')],{'as':'Description','foreignKey':_0x4f5c('0x1ca')});db[_0x4f5c('0x1d2')][_0x4f5c('0x11f')](db[_0x4f5c('0x1d2')],{'as':_0x4f5c('0x1d0'),'foreignKey':_0x4f5c('0x1c7')});db['ZohoField'][_0x4f5c('0x130')](db[_0x4f5c('0x9c')],{'as':_0x4f5c('0x9c'),'foreignKey':'VariableId'});db[_0x4f5c('0x1d3')][_0x4f5c('0x11f')](db[_0x4f5c('0xbb')],{'as':'Configurations','onDelete':_0x4f5c('0x11c'),'foreignKey':_0x4f5c('0x1c2')});db[_0x4f5c('0xbb')][_0x4f5c('0x11f')](db[_0x4f5c('0xbd')],{'as':_0x4f5c('0x1c4'),'foreignKey':_0x4f5c('0x1c5')});db[_0x4f5c('0xbb')][_0x4f5c('0x11f')](db[_0x4f5c('0xbd')],{'as':_0x4f5c('0x1c6'),'foreignKey':_0x4f5c('0x1ca')});db[_0x4f5c('0xbb')][_0x4f5c('0x11f')](db[_0x4f5c('0xbd')],{'as':_0x4f5c('0x1bf'),'foreignKey':_0x4f5c('0x1c7')});db['ZendeskConfiguration'][_0x4f5c('0x130')](db['ZendeskAccount'],{'as':_0x4f5c('0x175'),'foreignKey':_0x4f5c('0x1c2')});db[_0x4f5c('0xbb')][_0x4f5c('0x132')](db[_0x4f5c('0x176')],{'through':_0x4f5c('0x1d4')});db[_0x4f5c('0xbd')][_0x4f5c('0x11f')](db[_0x4f5c('0xbd')],{'as':_0x4f5c('0x1c8'),'foreignKey':_0x4f5c('0x1c5')});db[_0x4f5c('0xbd')]['hasMany'](db[_0x4f5c('0xbd')],{'as':_0x4f5c('0x1c9'),'foreignKey':_0x4f5c('0x1ca')});db[_0x4f5c('0xbd')][_0x4f5c('0x11f')](db[_0x4f5c('0xbd')],{'as':_0x4f5c('0x1d0'),'foreignKey':_0x4f5c('0x1c7')});db[_0x4f5c('0xbd')][_0x4f5c('0x130')](db[_0x4f5c('0x9c')],{'as':'Variable','foreignKey':_0x4f5c('0x1cb')});db[_0x4f5c('0xbf')][_0x4f5c('0x11f')](db[_0x4f5c('0x1d5')],{'as':'Configurations','onDelete':_0x4f5c('0x11c'),'foreignKey':'AccountId'});db[_0x4f5c('0x1d5')][_0x4f5c('0x11f')](db[_0x4f5c('0xc1')],{'as':_0x4f5c('0x1c4'),'onDelete':_0x4f5c('0x11c'),'foreignKey':_0x4f5c('0x1c5')});db[_0x4f5c('0x1d5')]['hasMany'](db[_0x4f5c('0xc1')],{'as':'Descriptions','onDelete':_0x4f5c('0x11c'),'foreignKey':_0x4f5c('0x1ca')});db[_0x4f5c('0x1d5')][_0x4f5c('0x11f')](db[_0x4f5c('0xc1')],{'as':'Fields','onDelete':_0x4f5c('0x11c'),'foreignKey':_0x4f5c('0x1c7')});db[_0x4f5c('0x1d5')][_0x4f5c('0x130')](db[_0x4f5c('0xbf')],{'as':_0x4f5c('0x175'),'foreignKey':'AccountId'});db[_0x4f5c('0x1d5')][_0x4f5c('0x132')](db[_0x4f5c('0x176')],{'through':_0x4f5c('0x1d6')});db[_0x4f5c('0xc1')][_0x4f5c('0x11f')](db['FreshdeskField'],{'as':_0x4f5c('0x1c8'),'foreignKey':_0x4f5c('0x1c5')});db['FreshdeskField']['hasMany'](db[_0x4f5c('0xc1')],{'as':_0x4f5c('0x1c9'),'foreignKey':_0x4f5c('0x1ca')});db[_0x4f5c('0xc1')][_0x4f5c('0x11f')](db[_0x4f5c('0xc1')],{'as':_0x4f5c('0x1d0'),'foreignKey':_0x4f5c('0x1c7')});db[_0x4f5c('0xc1')][_0x4f5c('0x130')](db[_0x4f5c('0x9c')],{'as':_0x4f5c('0x9c'),'foreignKey':_0x4f5c('0x1cb')});db[_0x4f5c('0xc3')][_0x4f5c('0x11f')](db[_0x4f5c('0xc5')],{'as':_0x4f5c('0x1c1'),'onDelete':'cascade','foreignKey':'AccountId'});db['VtigerConfiguration']['hasMany'](db[_0x4f5c('0x1d7')],{'as':_0x4f5c('0x1c4'),'foreignKey':'SubjectId'});db[_0x4f5c('0xc5')][_0x4f5c('0x11f')](db[_0x4f5c('0x1d7')],{'as':_0x4f5c('0x1c6'),'foreignKey':_0x4f5c('0x1ca')});db[_0x4f5c('0xc5')][_0x4f5c('0x11f')](db[_0x4f5c('0x1d7')],{'as':'Fields','foreignKey':_0x4f5c('0x1c7')});db['VtigerConfiguration']['belongsTo'](db['VtigerAccount'],{'as':'Account','foreignKey':'AccountId'});db[_0x4f5c('0x1d7')]['hasMany'](db[_0x4f5c('0x1d7')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x4f5c('0x1d7')][_0x4f5c('0x11f')](db[_0x4f5c('0x1d7')],{'as':'Description','foreignKey':'DescriptionId'});db['VtigerField'][_0x4f5c('0x11f')](db[_0x4f5c('0x1d7')],{'as':_0x4f5c('0x1d0'),'foreignKey':_0x4f5c('0x1c7')});db[_0x4f5c('0x1d7')][_0x4f5c('0x130')](db['Variable'],{'as':_0x4f5c('0x9c'),'foreignKey':_0x4f5c('0x1cb')});db[_0x4f5c('0x1d8')][_0x4f5c('0x11f')](db[_0x4f5c('0xc8')],{'as':'Configurations','onDelete':_0x4f5c('0x11c'),'foreignKey':_0x4f5c('0x1c2')});db[_0x4f5c('0xc8')][_0x4f5c('0x11f')](db['ServicenowField'],{'as':_0x4f5c('0x1c4'),'foreignKey':_0x4f5c('0x1c5')});db[_0x4f5c('0xc8')][_0x4f5c('0x11f')](db['ServicenowField'],{'as':'Descriptions','foreignKey':_0x4f5c('0x1ca')});db[_0x4f5c('0xc8')][_0x4f5c('0x11f')](db[_0x4f5c('0xca')],{'as':_0x4f5c('0x1bf'),'foreignKey':_0x4f5c('0x1c7')});db[_0x4f5c('0xc8')][_0x4f5c('0x130')](db[_0x4f5c('0x1d8')],{'as':_0x4f5c('0x175'),'foreignKey':_0x4f5c('0x1c2')});db[_0x4f5c('0xca')]['hasMany'](db['ServicenowField'],{'as':_0x4f5c('0x1c8'),'foreignKey':_0x4f5c('0x1c5')});db[_0x4f5c('0xca')][_0x4f5c('0x11f')](db['ServicenowField'],{'as':'Description','foreignKey':_0x4f5c('0x1ca')});db[_0x4f5c('0xca')][_0x4f5c('0x11f')](db[_0x4f5c('0xca')],{'as':_0x4f5c('0x1d0'),'foreignKey':_0x4f5c('0x1c7')});db[_0x4f5c('0xca')][_0x4f5c('0x130')](db[_0x4f5c('0x9c')],{'as':_0x4f5c('0x9c'),'foreignKey':_0x4f5c('0x1cb')});db['Dynamics365Account'][_0x4f5c('0x11f')](db[_0x4f5c('0xce')],{'as':_0x4f5c('0x1c1'),'onDelete':'cascade','foreignKey':_0x4f5c('0x1c2')});db[_0x4f5c('0xcc')][_0x4f5c('0x130')](db['CloudProvider'],{'as':_0x4f5c('0x112'),'foreignKey':_0x4f5c('0x16a')});db[_0x4f5c('0xce')][_0x4f5c('0x11f')](db[_0x4f5c('0x1d9')],{'as':_0x4f5c('0x1c4'),'onDelete':_0x4f5c('0x11c'),'foreignKey':_0x4f5c('0x1c5')});db[_0x4f5c('0xce')]['hasMany'](db['Dynamics365Field'],{'as':_0x4f5c('0x1c6'),'onDelete':_0x4f5c('0x11c'),'foreignKey':'DescriptionId'});db['Dynamics365Configuration'][_0x4f5c('0x11f')](db[_0x4f5c('0x1d9')],{'as':_0x4f5c('0x1bf'),'onDelete':_0x4f5c('0x11c'),'foreignKey':'FieldId'});db['Dynamics365Configuration'][_0x4f5c('0x130')](db[_0x4f5c('0xcc')],{'as':_0x4f5c('0x175'),'foreignKey':_0x4f5c('0x1c2')});db[_0x4f5c('0x1d9')]['hasMany'](db['Dynamics365Field'],{'as':'Subject','foreignKey':_0x4f5c('0x1c5')});db['Dynamics365Field'][_0x4f5c('0x11f')](db['Dynamics365Field'],{'as':'Description','foreignKey':_0x4f5c('0x1ca')});db[_0x4f5c('0x1d9')][_0x4f5c('0x11f')](db['Dynamics365Field'],{'as':_0x4f5c('0x1d0'),'foreignKey':_0x4f5c('0x1c7')});db[_0x4f5c('0x1d9')][_0x4f5c('0x130')](db[_0x4f5c('0x9c')],{'as':_0x4f5c('0x9c'),'foreignKey':_0x4f5c('0x1cb')});db[_0x4f5c('0x1da')][_0x4f5c('0x11f')](db[_0x4f5c('0xd2')],{'as':'Configurations','onDelete':_0x4f5c('0x11c'),'foreignKey':_0x4f5c('0x1c2')});db[_0x4f5c('0xd2')][_0x4f5c('0x11f')](db[_0x4f5c('0xd4')],{'as':_0x4f5c('0x1c4'),'foreignKey':'SubjectId'});db[_0x4f5c('0xd2')][_0x4f5c('0x11f')](db['FreshsalesField'],{'as':_0x4f5c('0x1c6'),'foreignKey':_0x4f5c('0x1ca')});db[_0x4f5c('0xd2')][_0x4f5c('0x11f')](db['FreshsalesField'],{'as':'Fields','foreignKey':_0x4f5c('0x1c7')});db['FreshsalesConfiguration']['belongsTo'](db['FreshsalesAccount'],{'as':_0x4f5c('0x175'),'foreignKey':_0x4f5c('0x1c2')});db[_0x4f5c('0xd4')][_0x4f5c('0x11f')](db[_0x4f5c('0xd4')],{'as':_0x4f5c('0x1c8'),'foreignKey':_0x4f5c('0x1c5')});db['FreshsalesField'][_0x4f5c('0x11f')](db['FreshsalesField'],{'as':'Description','foreignKey':_0x4f5c('0x1ca')});db['FreshsalesField'][_0x4f5c('0x11f')](db[_0x4f5c('0xd4')],{'as':'Field','foreignKey':_0x4f5c('0x1c7')});db['FreshsalesField'][_0x4f5c('0x130')](db['Variable'],{'as':'Variable','foreignKey':_0x4f5c('0x1cb')});db[_0x4f5c('0x1db')]['belongsTo'](db['ChatWebsite'],{});db[_0x4f5c('0x1db')][_0x4f5c('0x130')](db[_0x4f5c('0xff')],{'as':_0x4f5c('0x170'),'foreignKey':_0x4f5c('0x171')});db[_0x4f5c('0x1db')][_0x4f5c('0x130')](db[_0x4f5c('0x79')],{'as':_0x4f5c('0x166'),'foreignKey':_0x4f5c('0x167')});db[_0x4f5c('0x1db')]['belongsTo'](db[_0x4f5c('0x6e')],{});db[_0x4f5c('0x1db')]['belongsTo'](db[_0x4f5c('0x70')],{});db[_0x4f5c('0x1db')][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{});db[_0x4f5c('0x1db')][_0x4f5c('0x130')](db[_0x4f5c('0x72')],{});db[_0x4f5c('0xd8')][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'onDelete':_0x4f5c('0x11c'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'onDelete':_0x4f5c('0x11c'),'foreignKey':_0x4f5c('0x1dc')});db[_0x4f5c('0xde')][_0x4f5c('0x11f')](db[_0x4f5c('0xdc')],{'foreignKey':'SessionId','onDelete':_0x4f5c('0x11c')});db[_0x4f5c('0xde')]['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':_0x4f5c('0x1dd'),'onDelete':_0x4f5c('0x11c')});db[_0x4f5c('0xdf')][_0x4f5c('0x130')](db[_0x4f5c('0x56')],{});db[_0x4f5c('0xdf')][_0x4f5c('0x130')](db[_0x4f5c('0xff')],{'as':'List','foreignKey':'ListId'});db['SmsQueueReport'][_0x4f5c('0x130')](db['CmContact'],{'as':_0x4f5c('0x166'),'foreignKey':_0x4f5c('0x167')});db[_0x4f5c('0xdf')][_0x4f5c('0x130')](db[_0x4f5c('0x59')],{});db['SmsQueueReport'][_0x4f5c('0x130')](db[_0x4f5c('0x5b')],{});db['SmsQueueReport'][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{});db[_0x4f5c('0xdf')][_0x4f5c('0x130')](db[_0x4f5c('0x5d')],{});db['JscriptyProject'][_0x4f5c('0x11f')](db[_0x4f5c('0xde')],{'foreignKey':_0x4f5c('0x1de')});db['JscriptyProject'][_0x4f5c('0x11f')](db[_0x4f5c('0xdc')],{'foreignKey':_0x4f5c('0x1de')});db[_0x4f5c('0xe5')][_0x4f5c('0x11f')](db[_0x4f5c('0xda')],{'foreignKey':_0x4f5c('0x1de')});db[_0x4f5c('0x15f')][_0x4f5c('0x132')](db[_0x4f5c('0x12')],{'as':_0x4f5c('0x15e'),'through':_0x4f5c('0x1df')});db[_0x4f5c('0x15f')][_0x4f5c('0x132')](db[_0x4f5c('0x1a')],{'through':_0x4f5c('0x114'),'as':'VoiceQueues'});db[_0x4f5c('0x15f')][_0x4f5c('0x132')](db['MailQueue'],{'through':_0x4f5c('0x173'),'as':'MailQueues'});db[_0x4f5c('0x15f')][_0x4f5c('0x132')](db[_0x4f5c('0x72')],{'through':'team_has_chat_queues','as':_0x4f5c('0x143')});db[_0x4f5c('0x15f')]['belongsToMany'](db[_0x4f5c('0x144')],{'through':'team_has_fax_queues','as':_0x4f5c('0x145')});db[_0x4f5c('0x15f')]['belongsToMany'](db['SmsQueue'],{'through':_0x4f5c('0x18d'),'as':'SmsQueues'});db['Team'][_0x4f5c('0x132')](db[_0x4f5c('0x66')],{'through':'team_has_openchannel_queues','as':'OpenchannelQueues'});db[_0x4f5c('0x15f')]['belongsToMany'](db[_0x4f5c('0x110')],{'through':_0x4f5c('0x1e0'),'as':_0x4f5c('0x148')});db[_0x4f5c('0x15f')][_0x4f5c('0x132')](db[_0x4f5c('0x101')],{'through':_0x4f5c('0x116'),'as':_0x4f5c('0x13f')});db[_0x4f5c('0xf2')]['hasMany'](db[_0x4f5c('0x7b')],{'as':_0x4f5c('0x12f'),'foreignKey':_0x4f5c('0x1a5')});db[_0x4f5c('0xf2')][_0x4f5c('0x11f')](db[_0x4f5c('0x7e')],{'as':_0x4f5c('0x124'),'foreignKey':'CampaignId'});db[_0x4f5c('0xf2')][_0x4f5c('0x11f')](db[_0x4f5c('0x80')],{'as':_0x4f5c('0x1a1'),'foreignKey':_0x4f5c('0x1a5')});db[_0x4f5c('0xf2')][_0x4f5c('0x11f')](db[_0x4f5c('0x7d')],{'as':_0x4f5c('0x1e1'),'foreignKey':'CampaignId'});db[_0x4f5c('0xf2')][_0x4f5c('0x130')](db['Trunk'],{'as':_0x4f5c('0x2b'),'foreignKey':_0x4f5c('0x158')});db[_0x4f5c('0xf2')][_0x4f5c('0x130')](db['Trunk'],{'as':_0x4f5c('0x159'),'foreignKey':'TrunkBackupId'});db['Campaign']['belongsTo'](db['Interval'],{'as':_0x4f5c('0x8b'),'foreignKey':_0x4f5c('0x15b')});db[_0x4f5c('0xf2')][_0x4f5c('0x130')](db[_0x4f5c('0xe9')],{'as':_0x4f5c('0xe9'),'foreignKey':'SquareProjectId'});db[_0x4f5c('0xf2')][_0x4f5c('0x132')](db['CmList'],{'as':'Lists','through':_0x4f5c('0x1e2')});db[_0x4f5c('0xf2')][_0x4f5c('0x132')](db['CmList'],{'as':'BlackLists','through':_0x4f5c('0x1e3')});db['Attachment'][_0x4f5c('0x130')](db[_0x4f5c('0x71')],{'as':'ChatOfflineMessage','foreignKey':_0x4f5c('0x17d')});db[_0x4f5c('0x1e4')][_0x4f5c('0x130')](db[_0x4f5c('0x44')],{});db[_0x4f5c('0x1e4')][_0x4f5c('0x130')](db[_0x4f5c('0x42')],{});db[_0x4f5c('0x1e4')][_0x4f5c('0x130')](db[_0x4f5c('0x3e')],{'foreignKey':_0x4f5c('0x1e5'),'as':_0x4f5c('0x1e6')});db['MailTransferReport'][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'foreignKey':_0x4f5c('0x1e7'),'as':'FromAgent'});db[_0x4f5c('0x1e4')][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'foreignKey':'ToUserId','as':_0x4f5c('0x1e8')});db['MailTransferReport']['belongsTo'](db[_0x4f5c('0x140')],{'foreignKey':_0x4f5c('0x1e9'),'as':_0x4f5c('0x1ea')});db[_0x4f5c('0x1e4')][_0x4f5c('0x130')](db[_0x4f5c('0x3e')],{'foreignKey':_0x4f5c('0x1eb'),'as':_0x4f5c('0x1ec')});db[_0x4f5c('0xf9')][_0x4f5c('0x130')](db[_0x4f5c('0x70')],{});db[_0x4f5c('0xf9')]['belongsTo'](db[_0x4f5c('0x6e')],{});db[_0x4f5c('0xf9')]['belongsTo'](db['ChatWebsite'],{'foreignKey':'FromChatWebsiteId','as':_0x4f5c('0x1e6')});db[_0x4f5c('0xf9')][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'foreignKey':_0x4f5c('0x1e7'),'as':_0x4f5c('0x1ed')});db[_0x4f5c('0xf9')][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'foreignKey':_0x4f5c('0x1ee'),'as':_0x4f5c('0x1e8')});db[_0x4f5c('0xf9')][_0x4f5c('0x130')](db[_0x4f5c('0x72')],{'foreignKey':'ToChatQueueId','as':'ToQueue'});db[_0x4f5c('0xf9')][_0x4f5c('0x130')](db[_0x4f5c('0x68')],{'foreignKey':_0x4f5c('0x1ef'),'as':_0x4f5c('0x1ec')});db[_0x4f5c('0x1f0')]['belongsTo'](db['FaxMessage'],{});db['FaxTransferReport'][_0x4f5c('0x130')](db[_0x4f5c('0x50')],{});db['FaxTransferReport'][_0x4f5c('0x130')](db[_0x4f5c('0x4d')],{'foreignKey':_0x4f5c('0x1f1'),'as':_0x4f5c('0x1e6')});db[_0x4f5c('0x1f0')][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'foreignKey':_0x4f5c('0x1e7'),'as':_0x4f5c('0x1ed')});db['FaxTransferReport'][_0x4f5c('0x130')](db['User'],{'foreignKey':_0x4f5c('0x1ee'),'as':_0x4f5c('0x1e8')});db['FaxTransferReport'][_0x4f5c('0x130')](db[_0x4f5c('0x144')],{'foreignKey':'ToFaxQueueId','as':_0x4f5c('0x1ea')});db[_0x4f5c('0x1f0')][_0x4f5c('0x130')](db['FaxAccount'],{'foreignKey':_0x4f5c('0x1f2'),'as':_0x4f5c('0x1ec')});db[_0x4f5c('0xfc')][_0x4f5c('0x130')](db['OpenchannelMessage'],{});db[_0x4f5c('0xfc')][_0x4f5c('0x130')](db['OpenchannelInteraction'],{});db[_0x4f5c('0xfc')][_0x4f5c('0x130')](db[_0x4f5c('0x5f')],{'foreignKey':_0x4f5c('0x1f3'),'as':_0x4f5c('0x1e6')});db['OpenchannelTransferReport'][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'foreignKey':'FromUserId','as':_0x4f5c('0x1ed')});db[_0x4f5c('0xfc')]['belongsTo'](db[_0x4f5c('0x12')],{'foreignKey':_0x4f5c('0x1ee'),'as':_0x4f5c('0x1e8')});db[_0x4f5c('0xfc')][_0x4f5c('0x130')](db[_0x4f5c('0x66')],{'foreignKey':_0x4f5c('0x1f4'),'as':_0x4f5c('0x1ea')});db[_0x4f5c('0xfc')][_0x4f5c('0x130')](db[_0x4f5c('0x5f')],{'foreignKey':_0x4f5c('0x1f5'),'as':_0x4f5c('0x1ec')});db[_0x4f5c('0xfe')][_0x4f5c('0x130')](db[_0x4f5c('0x5b')],{});db['SmsTransferReport'][_0x4f5c('0x130')](db['SmsInteraction'],{});db[_0x4f5c('0xfe')][_0x4f5c('0x130')](db['SmsAccount'],{'foreignKey':'FromSmsAccountId','as':'FromAccount'});db[_0x4f5c('0xfe')][_0x4f5c('0x130')](db['User'],{'foreignKey':_0x4f5c('0x1e7'),'as':_0x4f5c('0x1ed')});db[_0x4f5c('0xfe')][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'foreignKey':_0x4f5c('0x1ee'),'as':_0x4f5c('0x1e8')});db[_0x4f5c('0xfe')][_0x4f5c('0x130')](db[_0x4f5c('0x5d')],{'foreignKey':_0x4f5c('0x1f6'),'as':_0x4f5c('0x1ea')});db['SmsTransferReport'][_0x4f5c('0x130')](db['SmsAccount'],{'foreignKey':_0x4f5c('0x1f7'),'as':_0x4f5c('0x1ec')});db[_0x4f5c('0xff')]['hasMany'](db[_0x4f5c('0x88')],{'as':_0x4f5c('0x186'),'foreignKey':'ListId','onDelete':_0x4f5c('0x11c')});db[_0x4f5c('0xff')][_0x4f5c('0x11f')](db[_0x4f5c('0x1f8')],{'as':_0x4f5c('0x1f9'),'foreignKey':_0x4f5c('0x171')});db[_0x4f5c('0xff')][_0x4f5c('0x11f')](db[_0x4f5c('0x79')],{'as':_0x4f5c('0x135'),'onDelete':'cascade','foreignKey':'ListId'});db[_0x4f5c('0xff')]['hasMany'](db[_0x4f5c('0x7e')],{'as':'HopperFinals','foreignKey':'ListId'});db[_0x4f5c('0xff')][_0x4f5c('0x11f')](db[_0x4f5c('0x80')],{'as':_0x4f5c('0x125'),'foreignKey':'ListId'});db[_0x4f5c('0xff')]['hasMany'](db[_0x4f5c('0x126')],{'as':_0x4f5c('0x126'),'foreignKey':'ListId'});db[_0x4f5c('0xff')][_0x4f5c('0x132')](db[_0x4f5c('0x1a')],{'as':_0x4f5c('0x1fa'),'through':'voice_queues_has_cm_lists'});db[_0x4f5c('0xff')][_0x4f5c('0x132')](db[_0x4f5c('0x12')],{'as':_0x4f5c('0x15e'),'through':_0x4f5c('0x138')});db['VoicePrefix'][_0x4f5c('0x11f')](db['VoiceExtension'],{'as':_0x4f5c('0x123'),'onDelete':'cascade'});db[_0x4f5c('0x101')][_0x4f5c('0x132')](db[_0x4f5c('0x12')],{'as':'Agents','through':_0x4f5c('0x117')});db[_0x4f5c('0x101')][_0x4f5c('0x132')](db['Team'],{'through':_0x4f5c('0x116'),'as':_0x4f5c('0x160')});db[_0x4f5c('0x103')][_0x4f5c('0x11f')](db[_0x4f5c('0x12')],{'as':_0x4f5c('0x179'),'foreignKey':_0x4f5c('0x131')});db['UserProfile']['hasMany'](db[_0x4f5c('0x1fb')],{'as':_0x4f5c('0x1fc'),'foreignKey':_0x4f5c('0x131'),'onDelete':_0x4f5c('0x11c')});db[_0x4f5c('0x1fb')][_0x4f5c('0x11f')](db[_0x4f5c('0x104')],{'as':_0x4f5c('0x1fd'),'foreignKey':'sectionId','onDelete':_0x4f5c('0x11c')});db[_0x4f5c('0x108')][_0x4f5c('0x11f')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x4f5c('0x1fe'),'onDelete':_0x4f5c('0x11c')});db[_0x4f5c('0x108')][_0x4f5c('0x11f')](db['CannedAnswer'],{'as':_0x4f5c('0x16e'),'foreignKey':'WhatsappAccountId'});db[_0x4f5c('0x108')][_0x4f5c('0x11f')](db[_0x4f5c('0x10c')],{'as':_0x4f5c('0x164'),'foreignKey':_0x4f5c('0x1fe')});db[_0x4f5c('0x108')]['hasMany'](db[_0x4f5c('0x12c')],{'as':_0x4f5c('0x16f')});db[_0x4f5c('0x108')][_0x4f5c('0x11f')](db[_0x4f5c('0x1ff')],{'as':'Applications','foreignKey':_0x4f5c('0x1fe'),'onDelete':'cascade'});db[_0x4f5c('0x108')][_0x4f5c('0x130')](db[_0x4f5c('0xff')],{'as':_0x4f5c('0x170'),'foreignKey':_0x4f5c('0x171')});db[_0x4f5c('0x108')]['belongsTo'](db[_0x4f5c('0x8d')],{'as':_0x4f5c('0x172'),'foreignKey':_0x4f5c('0x15c')});db[_0x4f5c('0x108')][_0x4f5c('0x132')](db[_0x4f5c('0x12')],{'as':'Agents','through':_0x4f5c('0x151')});db[_0x4f5c('0x1ff')][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'onDelete':'restrict'});db[_0x4f5c('0x1ff')]['belongsTo'](db[_0x4f5c('0x110')],{'onDelete':_0x4f5c('0x16b')});db['WhatsappApplication'][_0x4f5c('0x130')](db[_0x4f5c('0x108')],{'onDelete':'restrict'});db['WhatsappApplication'][_0x4f5c('0x130')](db[_0x4f5c('0x8b')],{'onDelete':_0x4f5c('0x16b'),'foreignKey':_0x4f5c('0x15b')});db['WhatsappApplication']['belongsTo'](db[_0x4f5c('0x176')],{'onDelete':'restrict','foreignKey':_0x4f5c('0x180')});db[_0x4f5c('0x12c')]['hasMany'](db[_0x4f5c('0x10c')],{'as':_0x4f5c('0x164'),'onDelete':_0x4f5c('0x11c'),'foreignKey':_0x4f5c('0x200')});db[_0x4f5c('0x12c')][_0x4f5c('0x130')](db[_0x4f5c('0x108')],{'as':_0x4f5c('0x175'),'foreignKey':'WhatsappAccountId'});db[_0x4f5c('0x12c')][_0x4f5c('0x130')](db[_0x4f5c('0x79')],{'as':_0x4f5c('0x166'),'foreignKey':'ContactId'});db['WhatsappInteraction'][_0x4f5c('0x130')](db['User'],{'as':_0x4f5c('0x182'),'foreignKey':_0x4f5c('0x11e')});db[_0x4f5c('0x12c')][_0x4f5c('0x132')](db[_0x4f5c('0x176')],{'through':_0x4f5c('0x1b5'),'as':'Tags'});db['WhatsappInteraction'][_0x4f5c('0x132')](db['Tag'],{'through':_0x4f5c('0x1b5'),'as':'ThroughTags'});db['WhatsappInteraction']['belongsToMany'](db[_0x4f5c('0x12')],{'as':_0x4f5c('0x179'),'through':'user_has_whatsapp_interactions','foreignKey':_0x4f5c('0x200')});db[_0x4f5c('0x10c')][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'as':_0x4f5c('0x12')});db[_0x4f5c('0x10c')][_0x4f5c('0x130')](db[_0x4f5c('0x79')],{'onDelete':_0x4f5c('0x11c'),'as':_0x4f5c('0x166')});db[_0x4f5c('0x10c')]['belongsTo'](db[_0x4f5c('0x12c')],{'onDelete':_0x4f5c('0x11c'),'as':_0x4f5c('0x17b'),'foreignKey':_0x4f5c('0x200')});db[_0x4f5c('0x10c')][_0x4f5c('0x130')](db[_0x4f5c('0x108')],{'as':_0x4f5c('0x175'),'foreignKey':_0x4f5c('0x1fe')});db['WhatsappQueueReport']['belongsTo'](db[_0x4f5c('0x108')],{});db[_0x4f5c('0x201')]['belongsTo'](db[_0x4f5c('0xff')],{'as':_0x4f5c('0x170'),'foreignKey':_0x4f5c('0x171')});db[_0x4f5c('0x201')][_0x4f5c('0x130')](db['CmContact'],{'as':_0x4f5c('0x166'),'foreignKey':_0x4f5c('0x167')});db['WhatsappQueueReport']['belongsTo'](db['WhatsappInteraction'],{});db[_0x4f5c('0x201')]['belongsTo'](db[_0x4f5c('0x110')],{});db[_0x4f5c('0x201')]['belongsTo'](db[_0x4f5c('0x10c')],{});db[_0x4f5c('0x201')]['belongsTo'](db[_0x4f5c('0x12')],{});db['WhatsappTransferReport'][_0x4f5c('0x130')](db[_0x4f5c('0x10c')],{});db['WhatsappTransferReport'][_0x4f5c('0x130')](db[_0x4f5c('0x12c')],{});db[_0x4f5c('0x10e')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':'FromWhatsappAccountId','as':'FromAccount'});db[_0x4f5c('0x10e')][_0x4f5c('0x130')](db['WhatsappAccount'],{'foreignKey':'ToWhatsappAccountId','as':_0x4f5c('0x1ec')});db[_0x4f5c('0x10e')][_0x4f5c('0x130')](db[_0x4f5c('0x110')],{'foreignKey':_0x4f5c('0x202'),'as':'ToQueue'});db[_0x4f5c('0x10e')][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'foreignKey':_0x4f5c('0x1e7'),'as':_0x4f5c('0x1ed')});db['WhatsappTransferReport'][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'foreignKey':'ToUserId','as':_0x4f5c('0x1e8')});db[_0x4f5c('0x110')][_0x4f5c('0x132')](db[_0x4f5c('0x12')],{'as':_0x4f5c('0x15e'),'through':_0x4f5c('0x39'),'foreignKey':_0x4f5c('0x203')});db[_0x4f5c('0x110')][_0x4f5c('0x132')](db[_0x4f5c('0x15f')],{'through':_0x4f5c('0x1e0'),'as':_0x4f5c('0x160')});db['UserSetting'][_0x4f5c('0x130')](db[_0x4f5c('0x12')],{'as':_0x4f5c('0x204'),'foreignKey':_0x4f5c('0x11e'),'onDelete':_0x4f5c('0x11c'),'hooks':!![]});db[_0x4f5c('0x112')][_0x4f5c('0x11b')](db[_0x4f5c('0xcc')],{'as':_0x4f5c('0xcc'),'onDelete':_0x4f5c('0x16b')});db['CloudProvider'][_0x4f5c('0x11b')](db[_0x4f5c('0x168')],{'as':_0x4f5c('0x205'),'onDelete':_0x4f5c('0x16b')});db[_0x4f5c('0x112')][_0x4f5c('0x11b')](db[_0x4f5c('0x3c')],{'as':_0x4f5c('0x16c'),'onDelete':_0x4f5c('0x16b')});module[_0x4f5c('0x206')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x8bc6=['WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','Applications','VoiceMusicOnHold','Sounds','moh_has_sounds','VoiceQueueId','Hoppers','CmHopperFinal','CmHopperBlack','HopperBlacks','JscriptySessions','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Lists','voice_queues_has_cm_lists','Agents','TeamVoiceQueue','BlackLists','voice_queues_has_cm_blacklists','mailboxuser','mailbox','QueueCalls','uniqueid','Contact','ContactId','MailAccountId','CloudProvider','CloudProviderId','restrict','Imap','Smtp','Dispositions','Interactions','ListId','TemplateId','team_has_mail_queues','Messages','MailInteractionId','Account','Owner','Tag','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','TagId','List','DashboardItem','Items','FaxAccountId','Answers','Exntensions','user_has_fax_accounts','FaxInteractionId','fax_interaction_has_tags','team_has_fax_queues','Teams','FaxQueueReport','SmsAccountId','user_has_sms_accounts','SmsInteractionId','sms_interaction_has_tags','OpenchannelAccountId','OpenchannelQueueId','openchannel_interaction_has_tags','user_has_openchannel_interactions','OpenchannelInteractionId','AttachmentId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','OpenchannelQueueReport','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Members','chat_group_has_users','CmContactId','HopperHistories','Company','CompanyId','cm_contact_has_tags','AdditionalPhones','CmHopperId','Campaign','OwnerId','Queue','Condition','OneAll','AutomationAllId','Any','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','ChatApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','CmContactHasItem','ContactItemType','ItemType','AllConditions','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','DescriptionId','FieldId','Subject','Description','Field','Descriptions','VariableId','int_desk_configuration_has_tags','ZohoAccount','ZendeskAccount','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskField','FreshdeskAccount','int_freshdesk_configuration_has_tags','VtigerAccount','VtigerField','ServicenowAccount','FreshsalesAccount','FromId','ToId','SessionId','ProjectId','JscriptyAnswerReport','team_has_sms_queues','team_has_whatsapp_queues','CampaignId','TrunkId','SquareProject','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToMailQueueId','ToQueue','ToAccount','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToAgent','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','CmCustomField','CustomFields','Queues','UserProfile','UserProfileSections','UserProfileResource','WhatsappAccountId','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','user','exports','../config/environment','sequelize','jstz','determine','defaultsDeep','motion2','xcall','127.0.0.1','mysql','utf8','utf8_general_ci','sequelizeHistory','xC@LL1234','utf8mb4','database','username','password','options','User','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','import','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','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','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','../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','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/sound/sound.model','../api/tag/tag.model','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','FreshdeskConfiguration','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/integration/integration.model','Network','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','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/setting/setting.model','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','UserProfileSection','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','UserId','cascade','hasMany','Recordings','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','MailInteraction','MailInteractions','WhatsappInteractions','UserNotification','UserNotifications','SenderId','SET\x20NULL','belongsTo','userProfileId','belongsToMany','Groups','CmContact','Contacts','cm_user_has_contacts','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','MailQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueue','WhatsappQueues','cm_user_has_lists','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_mail_accounts','OpenchannelAccount','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','WhatsappAccount'];(function(_0x68e1a6,_0x188baa){var _0x49ad62=function(_0x1c2de2){while(--_0x1c2de2){_0x68e1a6['push'](_0x68e1a6['shift']());}};_0x49ad62(++_0x188baa);}(_0x8bc6,0xc4));var _0x68bc=function(_0x47ab21,_0x3907b6){_0x47ab21=_0x47ab21-0x0;var _0x1104e3=_0x8bc6[_0x47ab21];return _0x1104e3;};'use strict';var config=require(_0x68bc('0x0'));var Sequelize=require(_0x68bc('0x1'));var _=require('lodash');var jstz=require(_0x68bc('0x2'));var timezone=jstz[_0x68bc('0x3')]();config['sequelize']=_[_0x68bc('0x4')](config[_0x68bc('0x1')],{'database':_0x68bc('0x5'),'username':_0x68bc('0x6'),'password':'xC@LL1234','options':{'host':_0x68bc('0x7'),'port':0xcea,'dialect':_0x68bc('0x8'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x68bc('0x9'),'collate':_0x68bc('0xa')}}});config[_0x68bc('0xb')]=_['defaultsDeep'](config['sequelizeHistory'],{'database':_0x68bc('0x5'),'username':_0x68bc('0x6'),'password':_0x68bc('0xc'),'options':{'host':_0x68bc('0x7'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x68bc('0xd')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0x68bc('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x68bc('0x1')][_0x68bc('0xe')],config[_0x68bc('0x1')][_0x68bc('0xf')],config[_0x68bc('0x1')][_0x68bc('0x10')],config[_0x68bc('0x1')][_0x68bc('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x68bc('0xb')][_0x68bc('0xe')],config[_0x68bc('0xb')][_0x68bc('0xf')],config[_0x68bc('0xb')][_0x68bc('0x10')],config[_0x68bc('0xb')][_0x68bc('0x11')])};db[_0x68bc('0x12')]=db[_0x68bc('0x1')]['import'](_0x68bc('0x13'));db[_0x68bc('0x14')]=db[_0x68bc('0x1')]['import'](_0x68bc('0x15'));db[_0x68bc('0x16')]=db['sequelize'][_0x68bc('0x17')](_0x68bc('0x18'));db[_0x68bc('0x19')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x1a'));db['VoiceMusicOnHold']=db['sequelize'][_0x68bc('0x17')](_0x68bc('0x1b'));db[_0x68bc('0x1c')]=db['sequelize'][_0x68bc('0x17')](_0x68bc('0x1d'));db[_0x68bc('0x1e')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x1f'));db[_0x68bc('0x20')]=db['sequelize'][_0x68bc('0x17')](_0x68bc('0x21'));db[_0x68bc('0x22')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x23'));db[_0x68bc('0x24')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x25'));db[_0x68bc('0x26')]=db['sequelize'][_0x68bc('0x17')](_0x68bc('0x27'));db['VoiceDialReport']=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x28'));db[_0x68bc('0x29')]=db[_0x68bc('0x1')]['import'](_0x68bc('0x2a'));db['VoiceQueueReport']=db[_0x68bc('0x1')]['import'](_0x68bc('0x2b'));db[_0x68bc('0x2c')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x2d'));db[_0x68bc('0x2e')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x2f'));db[_0x68bc('0x30')]=db['sequelize']['import']('../api/voiceTransferReport/voiceTransferReport.model');db[_0x68bc('0x31')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x32'));db[_0x68bc('0x33')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x34'));db[_0x68bc('0x35')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x36'));db[_0x68bc('0x37')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x38'));db[_0x68bc('0x39')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x3a'));db[_0x68bc('0x3b')]=db[_0x68bc('0x1')]['import'](_0x68bc('0x3c'));db[_0x68bc('0x3d')]=db[_0x68bc('0x1')]['import'](_0x68bc('0x3e'));db[_0x68bc('0x3f')]=db[_0x68bc('0x1')]['import']('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x68bc('0x40')]=db['sequelize'][_0x68bc('0x17')](_0x68bc('0x41'));db[_0x68bc('0x42')]=db[_0x68bc('0x1')]['import'](_0x68bc('0x43'));db[_0x68bc('0x44')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x45'));db[_0x68bc('0x46')]=db['sequelize'][_0x68bc('0x17')]('../api/mailQueue/mailQueue.model');db[_0x68bc('0x47')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x48'));db['MailInteraction']=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x49'));db[_0x68bc('0x4a')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x4b'));db[_0x68bc('0x4c')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x4d'));db[_0x68bc('0x4e')]=db['sequelize'][_0x68bc('0x17')]('../api/mailQueueReport/mailQueueReport.model');db[_0x68bc('0x4f')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x50'));db['DashboardItem']=db[_0x68bc('0x1')][_0x68bc('0x17')]('../api/dashboardItem/dashboardItem.model');db[_0x68bc('0x51')]=db[_0x68bc('0x1')]['import']('../api/faxAccount/faxAccount.model');db[_0x68bc('0x52')]=db['sequelize'][_0x68bc('0x17')](_0x68bc('0x53'));db[_0x68bc('0x54')]=db[_0x68bc('0x1')]['import']('../api/faxInteraction/faxInteraction.model');db[_0x68bc('0x55')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x56'));db[_0x68bc('0x57')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x58'));db['FaxQueueReport']=db['sequelize'][_0x68bc('0x17')](_0x68bc('0x59'));db[_0x68bc('0x5a')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x5b'));db[_0x68bc('0x5c')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x5d'));db[_0x68bc('0x5e')]=db['sequelize']['import'](_0x68bc('0x5f'));db[_0x68bc('0x60')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x61'));db[_0x68bc('0x62')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x63'));db['OpenchannelAccount']=db['sequelize'][_0x68bc('0x17')](_0x68bc('0x64'));db[_0x68bc('0x65')]=db[_0x68bc('0x1')][_0x68bc('0x17')]('../api/openchannelApplication/openchannelApplication.model');db[_0x68bc('0x66')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x67'));db[_0x68bc('0x68')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x69'));db[_0x68bc('0x6a')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x6b'));db['ChatWebsite']=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x6c'));db['OpenchannelQueueReport']=db['sequelize']['import'](_0x68bc('0x6d'));db[_0x68bc('0x6e')]=db[_0x68bc('0x1')]['import'](_0x68bc('0x6f'));db[_0x68bc('0x70')]=db[_0x68bc('0x1')][_0x68bc('0x17')]('../api/chatInteraction/chatInteraction.model');db[_0x68bc('0x71')]=db[_0x68bc('0x1')]['import'](_0x68bc('0x72'));db[_0x68bc('0x73')]=db[_0x68bc('0x1')]['import'](_0x68bc('0x74'));db[_0x68bc('0x75')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x76'));db[_0x68bc('0x77')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x78'));db['ChatProactiveAction']=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x79'));db[_0x68bc('0x7a')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x7b'));db['CmContact']=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x7c'));db[_0x68bc('0x7d')]=db['sequelize'][_0x68bc('0x17')](_0x68bc('0x7e'));db['CmHopperBlack']=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x7f'));db['CmHopperFinal']=db[_0x68bc('0x1')]['import'](_0x68bc('0x80'));db[_0x68bc('0x81')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x82'));db[_0x68bc('0x83')]=db['sequelize'][_0x68bc('0x17')](_0x68bc('0x84'));db['CmCustomField']=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x85'));db[_0x68bc('0x86')]=db['sequelize'][_0x68bc('0x17')](_0x68bc('0x87'));db[_0x68bc('0x88')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x89'));db[_0x68bc('0x8a')]=db[_0x68bc('0x1')][_0x68bc('0x17')]('../api/cannedAnswer/cannedAnswer.model');db[_0x68bc('0x8b')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x8c'));db['Condition']=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x8d'));db[_0x68bc('0x8e')]=db['sequelize'][_0x68bc('0x17')](_0x68bc('0x8f'));db[_0x68bc('0x90')]=db[_0x68bc('0x1')]['import'](_0x68bc('0x91'));db[_0x68bc('0x92')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x93'));db[_0x68bc('0x94')]=db['sequelize']['import'](_0x68bc('0x95'));db[_0x68bc('0x96')]=db[_0x68bc('0x1')]['import']('../api/schedule/schedule.model');db[_0x68bc('0x97')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x98'));db['Tag']=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x99'));db['ContactItemType']=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x9a'));db['CmContactHasItem']=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x9b'));db[_0x68bc('0x9c')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x9d'));db[_0x68bc('0x9e')]=db[_0x68bc('0x1')][_0x68bc('0x17')]('../api/template/template.model');db[_0x68bc('0x9f')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xa0'));db[_0x68bc('0xa1')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xa2'));db[_0x68bc('0xa3')]=db['sequelize'][_0x68bc('0x17')]('../api/integration/integration.model');db[_0x68bc('0xa4')]=db['sequelize'][_0x68bc('0x17')](_0x68bc('0xa5'));db[_0x68bc('0xa6')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xa7'));db[_0x68bc('0xa8')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xa9'));db[_0x68bc('0xaa')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xab'));db[_0x68bc('0xac')]=db[_0x68bc('0x1')][_0x68bc('0x17')]('../api/analyticMetric/analyticMetric.model');db['AnalyticFieldReport']=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xad'));db[_0x68bc('0xae')]=db[_0x68bc('0x1')][_0x68bc('0x17')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0x68bc('0xaf')]=db[_0x68bc('0x1')][_0x68bc('0x17')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x68bc('0xb0')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xb1'));db[_0x68bc('0xb2')]=db['sequelize']['import'](_0x68bc('0xb3'));db[_0x68bc('0xb4')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xb5'));db[_0x68bc('0xb6')]=db['sequelize'][_0x68bc('0x17')](_0x68bc('0xb7'));db[_0x68bc('0xb8')]=db['sequelize'][_0x68bc('0x17')](_0x68bc('0xb9'));db[_0x68bc('0xba')]=db[_0x68bc('0x1')]['import'](_0x68bc('0xbb'));db[_0x68bc('0xbc')]=db['sequelize'][_0x68bc('0x17')](_0x68bc('0xbd'));db[_0x68bc('0xbe')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xbf'));db['ZohoAccount']=db['sequelize'][_0x68bc('0x17')](_0x68bc('0xc0'));db[_0x68bc('0xc1')]=db[_0x68bc('0x1')]['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x68bc('0xc2')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xc3'));db['ZendeskAccount']=db[_0x68bc('0x1')][_0x68bc('0x17')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x68bc('0xc4')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xc5'));db['ZendeskField']=db[_0x68bc('0x1')]['import'](_0x68bc('0xc6'));db['FreshdeskAccount']=db[_0x68bc('0x1')][_0x68bc('0x17')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0x68bc('0xc7')]=db[_0x68bc('0x1')]['import']('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db['FreshdeskField']=db[_0x68bc('0x1')]['import']('../api/intFreshdeskField/intFreshdeskField.model');db['VtigerAccount']=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xc8'));db[_0x68bc('0xc9')]=db['sequelize'][_0x68bc('0x17')](_0x68bc('0xca'));db['VtigerField']=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xcb'));db['ServicenowAccount']=db['sequelize'][_0x68bc('0x17')](_0x68bc('0xcc'));db[_0x68bc('0xcd')]=db[_0x68bc('0x1')][_0x68bc('0x17')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x68bc('0xce')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xcf'));db[_0x68bc('0xd0')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xd1'));db[_0x68bc('0xd2')]=db[_0x68bc('0x1')][_0x68bc('0x17')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x68bc('0xd3')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xd4'));db['FreshsalesAccount']=db[_0x68bc('0x1')][_0x68bc('0x17')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x68bc('0xd5')]=db[_0x68bc('0x1')]['import'](_0x68bc('0xd6'));db[_0x68bc('0xd7')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xd8'));db[_0x68bc('0xa3')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xd9'));db[_0x68bc('0xda')]=db[_0x68bc('0x1')]['import']('../api/network/network.model');db[_0x68bc('0xdb')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xdc'));db[_0x68bc('0xdd')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xde'));db['JscriptyAnswerReport']=db['sequelize'][_0x68bc('0x17')](_0x68bc('0xdf'));db[_0x68bc('0xe0')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xe1'));db[_0x68bc('0xe2')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xe3'));db[_0x68bc('0xe4')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xe5'));db[_0x68bc('0xe6')]=db[_0x68bc('0x1')]['import'](_0x68bc('0xe7'));db[_0x68bc('0xe8')]=db['sequelize'][_0x68bc('0x17')](_0x68bc('0xe9'));db[_0x68bc('0xea')]=db[_0x68bc('0x1')]['import']('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xeb'));db['SquareOdbc']=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xec'));db['SquareProject']=db['sequelize'][_0x68bc('0x17')](_0x68bc('0xed'));db['SquareRecording']=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xee'));db[_0x68bc('0xef')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xf0'));db[_0x68bc('0xf1')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xf2'));db[_0x68bc('0xf3')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xf4'));db['Campaign']=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xf5'));db[_0x68bc('0xf6')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xf7'));db[_0x68bc('0xf8')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0xf9'));db['Plugin']=db[_0x68bc('0x1')]['import'](_0x68bc('0xfa'));db[_0x68bc('0xfb')]=db['sequelize'][_0x68bc('0x17')]('../api/mailTransferReport/mailTransferReport.model');db[_0x68bc('0xfc')]=db['sequelize'][_0x68bc('0x17')](_0x68bc('0xfd'));db[_0x68bc('0xfe')]=db[_0x68bc('0x1')][_0x68bc('0x17')]('../api/faxTransferReport/faxTransferReport.model');db[_0x68bc('0xff')]=db['sequelize'][_0x68bc('0x17')](_0x68bc('0x100'));db['SmsTransferReport']=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x101'));db[_0x68bc('0x102')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x103'));db[_0x68bc('0x104')]=db['sequelize']['import']('../api/voicePrefix/voicePrefix.model');db['UserProfile']=db[_0x68bc('0x1')][_0x68bc('0x17')]('../api/userProfile/userProfile.model');db[_0x68bc('0x105')]=db[_0x68bc('0x1')]['import']('../api/userProfileSection/userProfileSection.model');db['UserProfileResource']=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x106'));db['UserNotification']=db['sequelize'][_0x68bc('0x17')](_0x68bc('0x107'));db['WhatsappAccount']=db[_0x68bc('0x1')]['import']('../api/whatsappAccount/whatsappAccount.model');db[_0x68bc('0x108')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x109'));db[_0x68bc('0x10a')]=db[_0x68bc('0x1')]['import'](_0x68bc('0x10b'));db[_0x68bc('0x10c')]=db['sequelize'][_0x68bc('0x17')](_0x68bc('0x10d'));db[_0x68bc('0x10e')]=db[_0x68bc('0x1')][_0x68bc('0x17')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x68bc('0x10f')]=db[_0x68bc('0x1')][_0x68bc('0x17')]('../api/whatsappTransferReport/whatsappTransferReport.model');db['WhatsappQueue']=db['sequelize']['import']('../api/whatsappQueue/whatsappQueue.model');db['CloudProvider']=db[_0x68bc('0x1')]['import'](_0x68bc('0x110'));db['TeamVoiceQueue']=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x111'));db[_0x68bc('0x112')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x113'));db[_0x68bc('0x114')]=db[_0x68bc('0x1')][_0x68bc('0x17')](_0x68bc('0x115'));db[_0x68bc('0x116')]=db['sequelize'][_0x68bc('0x17')](_0x68bc('0x117'));db['MailInteractionHasTag']=db[_0x68bc('0x1')][_0x68bc('0x17')]('../api/mailInteractionHasTag/mailInteractionHasTag.model');db[_0x68bc('0x12')][_0x68bc('0x118')](db['VoiceMail'],{'as':_0x68bc('0x22'),'onDelete':'cascade','foreignKey':_0x68bc('0x119')});db[_0x68bc('0x12')]['hasOne'](db[_0x68bc('0x116')],{'as':'userSetting','onDelete':_0x68bc('0x11a'),'foreignKey':_0x68bc('0x119')});db['User'][_0x68bc('0x11b')](db['VoiceRecording'],{'as':_0x68bc('0x11c'),'foreignKey':_0x68bc('0x119')});db[_0x68bc('0x12')]['hasMany'](db[_0x68bc('0x31')],{'as':_0x68bc('0x11d'),'foreignKey':_0x68bc('0x119')});db[_0x68bc('0x12')][_0x68bc('0x11b')](db[_0x68bc('0x19')],{'as':_0x68bc('0x11e'),'onDelete':'cascade','hooks':!![]});db['User']['hasMany'](db['CmHopperFinal'],{'as':_0x68bc('0x11f'),'foreignKey':_0x68bc('0x119')});db[_0x68bc('0x12')]['hasMany'](db[_0x68bc('0x81')],{'as':_0x68bc('0x120'),'foreignKey':_0x68bc('0x119')});db[_0x68bc('0x12')]['hasMany'](db['ReportAgentPreview'],{'as':_0x68bc('0x83'),'foreignKey':_0x68bc('0x119')});db['User']['hasMany'](db['OpenchannelInteraction'],{'as':_0x68bc('0x121'),'foreignKey':_0x68bc('0x119')});db[_0x68bc('0x12')][_0x68bc('0x11b')](db['ChatInteraction'],{'as':_0x68bc('0x122'),'foreignKey':_0x68bc('0x119')});db[_0x68bc('0x12')][_0x68bc('0x11b')](db[_0x68bc('0x5e')],{'as':'SmsInteractions','foreignKey':_0x68bc('0x119')});db[_0x68bc('0x12')][_0x68bc('0x11b')](db[_0x68bc('0x54')],{'as':'FaxInteractions','foreignKey':_0x68bc('0x119')});db['User'][_0x68bc('0x11b')](db[_0x68bc('0x123')],{'as':_0x68bc('0x124'),'foreignKey':_0x68bc('0x119')});db[_0x68bc('0x12')]['hasMany'](db[_0x68bc('0x10a')],{'as':_0x68bc('0x125'),'foreignKey':_0x68bc('0x119')});db[_0x68bc('0x12')][_0x68bc('0x11b')](db[_0x68bc('0x126')],{'as':_0x68bc('0x127'),'foreignKey':_0x68bc('0x128')});db[_0x68bc('0x12')]['hasMany'](db['CmHopper'],{'as':'Hoppers','foreignKey':'UserId','onDelete':_0x68bc('0x129')});db['User'][_0x68bc('0x12a')](db['UserProfile'],{'as':'UserProfile','foreignKey':_0x68bc('0x12b')});db[_0x68bc('0x12')][_0x68bc('0x12c')](db[_0x68bc('0x77')],{'as':_0x68bc('0x12d'),'through':'chat_group_has_users'});db[_0x68bc('0x12')][_0x68bc('0x12c')](db[_0x68bc('0x12e')],{'as':_0x68bc('0x12f'),'through':_0x68bc('0x130')});db['User']['belongsToMany'](db[_0x68bc('0x102')],{'as':'Lists','through':'cm_user_has_lists'});db['User'][_0x68bc('0x12c')](db[_0x68bc('0xf1')],{'through':_0x68bc('0x131')});db['User'][_0x68bc('0x12c')](db[_0x68bc('0x123')],{'as':'MailInteractions','through':_0x68bc('0x132')});db[_0x68bc('0x12')][_0x68bc('0x12c')](db['ChatInteraction'],{'as':_0x68bc('0x122'),'through':_0x68bc('0x133')});db[_0x68bc('0x12')][_0x68bc('0x12c')](db[_0x68bc('0x54')],{'as':_0x68bc('0x134'),'through':_0x68bc('0x135')});db[_0x68bc('0x12')][_0x68bc('0x12c')](db[_0x68bc('0x5e')],{'as':_0x68bc('0x136'),'through':_0x68bc('0x137')});db[_0x68bc('0x12')][_0x68bc('0x12c')](db[_0x68bc('0x66')],{'as':_0x68bc('0x121'),'through':'user_has_openchannel_interactions'});db[_0x68bc('0x12')][_0x68bc('0x12c')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','through':_0x68bc('0x138')});db[_0x68bc('0x12')]['belongsToMany'](db[_0x68bc('0x1c')],{'as':_0x68bc('0x139'),'through':_0x68bc('0x33'),'required':![]});db['User'][_0x68bc('0x12c')](db[_0x68bc('0x104')],{'as':_0x68bc('0x13a'),'through':'UserVoicePrefix','required':![]});db[_0x68bc('0x12')][_0x68bc('0x12c')](db[_0x68bc('0x46')],{'as':_0x68bc('0x13b'),'through':_0x68bc('0x37'),'required':![]});db[_0x68bc('0x12')][_0x68bc('0x12c')](db[_0x68bc('0x75')],{'as':_0x68bc('0x13c'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User'][_0x68bc('0x12c')](db[_0x68bc('0x57')],{'as':_0x68bc('0x13d'),'through':_0x68bc('0x39'),'required':![]});db[_0x68bc('0x12')][_0x68bc('0x12c')](db[_0x68bc('0x62')],{'as':_0x68bc('0x13e'),'through':_0x68bc('0x3b'),'required':![]});db[_0x68bc('0x12')][_0x68bc('0x12c')](db[_0x68bc('0x6a')],{'as':_0x68bc('0x13f'),'through':_0x68bc('0x3d'),'required':![]});db[_0x68bc('0x12')][_0x68bc('0x12c')](db[_0x68bc('0x140')],{'as':_0x68bc('0x141'),'through':'UserWhatsappQueue','required':![]});db['User'][_0x68bc('0x12c')](db[_0x68bc('0x102')],{'through':_0x68bc('0x142')});db[_0x68bc('0x12')][_0x68bc('0x12c')](db[_0x68bc('0x143')],{'as':_0x68bc('0x144'),'through':_0x68bc('0x145')});db[_0x68bc('0x12')][_0x68bc('0x12c')](db[_0x68bc('0x51')],{'as':_0x68bc('0x146'),'through':'user_has_fax_accounts'});db[_0x68bc('0x12')][_0x68bc('0x12c')](db[_0x68bc('0x44')],{'as':'MailAccounts','through':_0x68bc('0x147')});db[_0x68bc('0x12')][_0x68bc('0x12c')](db[_0x68bc('0x148')],{'as':_0x68bc('0x149'),'through':_0x68bc('0x14a')});db['User'][_0x68bc('0x12c')](db['SmsAccount'],{'as':_0x68bc('0x14b'),'through':'user_has_sms_accounts'});db[_0x68bc('0x12')]['belongsToMany'](db[_0x68bc('0x14c')],{'as':_0x68bc('0x14d'),'through':_0x68bc('0x14e')});db['VoiceChanSpy'][_0x68bc('0x11b')](db[_0x68bc('0x19')],{'as':_0x68bc('0x14f'),'onDelete':_0x68bc('0x11a'),'foreignKey':_0x68bc('0x150')});db[_0x68bc('0x16')][_0x68bc('0x11b')](db['VoiceExtension'],{'onDelete':'cascade'});db[_0x68bc('0x19')]['hasMany'](db[_0x68bc('0x19')],{'as':_0x68bc('0x151'),'onDelete':_0x68bc('0x11a')});db[_0x68bc('0x152')][_0x68bc('0x12c')](db[_0x68bc('0x97')],{'as':_0x68bc('0x153'),'through':_0x68bc('0x154')});db[_0x68bc('0x1c')]['hasMany'](db[_0x68bc('0x31')],{'as':'Members','foreignKey':_0x68bc('0x155')});db[_0x68bc('0x1c')][_0x68bc('0x11b')](db['CmHopper'],{'as':_0x68bc('0x156'),'foreignKey':_0x68bc('0x155')});db['VoiceQueue'][_0x68bc('0x11b')](db[_0x68bc('0x157')],{'as':'HopperFinals','foreignKey':'VoiceQueueId'});db[_0x68bc('0x1c')]['hasMany'](db[_0x68bc('0x81')],{'as':'HopperHistories','foreignKey':_0x68bc('0x155')});db['VoiceQueue'][_0x68bc('0x11b')](db[_0x68bc('0x83')],{'as':_0x68bc('0x83'),'foreignKey':_0x68bc('0x155')});db['VoiceQueue'][_0x68bc('0x11b')](db[_0x68bc('0x158')],{'as':_0x68bc('0x159'),'foreignKey':_0x68bc('0x155')});db[_0x68bc('0x1c')][_0x68bc('0x11b')](db['JscriptySessionReport'],{'as':_0x68bc('0x15a'),'foreignKey':_0x68bc('0x155')});db[_0x68bc('0x1c')]['belongsTo'](db[_0x68bc('0x2e')],{'as':_0x68bc('0x2e'),'foreignKey':'TrunkId'});db['VoiceQueue']['belongsTo'](db[_0x68bc('0x2e')],{'as':_0x68bc('0x15b'),'foreignKey':_0x68bc('0x15c')});db['VoiceQueue']['belongsTo'](db[_0x68bc('0x8e')],{'as':_0x68bc('0x8e'),'foreignKey':_0x68bc('0x15d')});db[_0x68bc('0x1c')][_0x68bc('0x12a')](db[_0x68bc('0x90')],{'as':_0x68bc('0x15e'),'foreignKey':_0x68bc('0x15f')});db[_0x68bc('0x1c')]['belongsToMany'](db[_0x68bc('0x102')],{'as':_0x68bc('0x160'),'through':_0x68bc('0x161')});db[_0x68bc('0x1c')]['belongsToMany'](db[_0x68bc('0x12')],{'as':_0x68bc('0x162'),'through':_0x68bc('0x33')});db[_0x68bc('0x1c')][_0x68bc('0x12c')](db['Team'],{'as':'Teams','through':_0x68bc('0x163')});db['VoiceQueue'][_0x68bc('0x12c')](db[_0x68bc('0x102')],{'as':_0x68bc('0x164'),'through':_0x68bc('0x165')});db[_0x68bc('0x1e')][_0x68bc('0x12a')](db['User'],{'as':_0x68bc('0x12'),'foreignKey':_0x68bc('0x119')});db[_0x68bc('0x20')][_0x68bc('0x12a')](db[_0x68bc('0x12')],{'as':_0x68bc('0x12'),'foreignKey':_0x68bc('0x119')});db['VoiceMail'][_0x68bc('0x11b')](db['VoiceMailMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x68bc('0x166'),'sourceKey':_0x68bc('0x167')});db['VoiceMailMessage']['belongsTo'](db[_0x68bc('0x22')],{'foreignKey':'mailboxuser','targetKey':_0x68bc('0x167')});db['VoiceCallReport']['hasMany'](db['VoiceQueueReport'],{'as':_0x68bc('0x168'),'foreignKey':_0x68bc('0x169'),'constraints':![]});db[_0x68bc('0x26')][_0x68bc('0x11b')](db[_0x68bc('0x29')],{'as':'AgentReports','foreignKey':_0x68bc('0x169'),'constraints':![]});db[_0x68bc('0x26')]['belongsTo'](db[_0x68bc('0x12')],{'as':'User','foreignKey':_0x68bc('0x119')});db[_0x68bc('0x26')]['belongsTo'](db['CmContact'],{'as':_0x68bc('0x16a'),'foreignKey':_0x68bc('0x16b')});db['MailServerIn'][_0x68bc('0x12a')](db['MailAccount'],{'as':_0x68bc('0x44'),'foreignKey':_0x68bc('0x16c')});db[_0x68bc('0x40')][_0x68bc('0x12a')](db['CloudProvider'],{'as':_0x68bc('0x16d'),'foreignKey':_0x68bc('0x16e'),'onDelete':_0x68bc('0x16f')});db[_0x68bc('0x42')][_0x68bc('0x12a')](db[_0x68bc('0x44')],{'as':_0x68bc('0x44'),'foreignKey':_0x68bc('0x16c')});db[_0x68bc('0x42')][_0x68bc('0x12a')](db[_0x68bc('0x16d')],{'as':'CloudProvider','foreignKey':_0x68bc('0x16e'),'onDelete':'restrict'});db[_0x68bc('0x44')][_0x68bc('0x118')](db['MailServerIn'],{'as':_0x68bc('0x170'),'onDelete':_0x68bc('0x11a')});db[_0x68bc('0x44')][_0x68bc('0x118')](db[_0x68bc('0x42')],{'as':_0x68bc('0x171'),'onDelete':'cascade'});db[_0x68bc('0x44')]['hasMany'](db[_0x68bc('0x8b')],{'as':_0x68bc('0x172'),'foreignKey':_0x68bc('0x16c'),'onDelete':_0x68bc('0x11a')});db['MailAccount']['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x68bc('0x16c')});db[_0x68bc('0x44')][_0x68bc('0x11b')](db[_0x68bc('0x4a')],{'as':'Messages','foreignKey':'MailAccountId'});db[_0x68bc('0x44')]['hasMany'](db[_0x68bc('0x123')],{'as':_0x68bc('0x173')});db[_0x68bc('0x44')][_0x68bc('0x11b')](db[_0x68bc('0x4c')],{'as':_0x68bc('0x151'),'foreignKey':_0x68bc('0x16c'),'onDelete':_0x68bc('0x11a')});db[_0x68bc('0x44')]['belongsTo'](db[_0x68bc('0x102')],{'as':'List','foreignKey':_0x68bc('0x174')});db[_0x68bc('0x44')][_0x68bc('0x12a')](db[_0x68bc('0x9e')],{'as':_0x68bc('0x9e'),'foreignKey':_0x68bc('0x175')});db[_0x68bc('0x44')][_0x68bc('0x12a')](db[_0x68bc('0x90')],{'as':_0x68bc('0x15e'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x68bc('0x44')][_0x68bc('0x12c')](db[_0x68bc('0x12')],{'as':_0x68bc('0x162'),'through':_0x68bc('0x147')});db[_0x68bc('0x46')]['belongsToMany'](db[_0x68bc('0x12')],{'as':_0x68bc('0x162'),'through':_0x68bc('0x37')});db['MailQueue'][_0x68bc('0x12c')](db[_0x68bc('0xf1')],{'through':_0x68bc('0x176'),'as':'Teams'});db['MailInteraction'][_0x68bc('0x11b')](db[_0x68bc('0x4a')],{'as':_0x68bc('0x177'),'onDelete':_0x68bc('0x11a'),'foreignKey':_0x68bc('0x178')});db[_0x68bc('0x123')][_0x68bc('0x12a')](db[_0x68bc('0x44')],{'as':_0x68bc('0x179'),'foreignKey':_0x68bc('0x16c')});db['MailInteraction']['belongsTo'](db['CmContact'],{'as':_0x68bc('0x16a'),'foreignKey':_0x68bc('0x16b')});db[_0x68bc('0x123')][_0x68bc('0x12a')](db['User'],{'as':_0x68bc('0x17a'),'foreignKey':'UserId'});db[_0x68bc('0x123')][_0x68bc('0x12c')](db[_0x68bc('0x17b')],{'through':_0x68bc('0x17c'),'as':_0x68bc('0x17d')});db[_0x68bc('0x123')][_0x68bc('0x12c')](db[_0x68bc('0x17b')],{'through':_0x68bc('0x17c'),'as':_0x68bc('0x17e')});db[_0x68bc('0x123')][_0x68bc('0x12c')](db[_0x68bc('0x12')],{'as':_0x68bc('0x17f'),'through':_0x68bc('0x132'),'foreignKey':_0x68bc('0x178')});db[_0x68bc('0x4a')]['hasMany'](db['Attachment'],{'as':_0x68bc('0x180'),'onDelete':'cascade'});db['MailMessage'][_0x68bc('0x12a')](db[_0x68bc('0x12')],{'as':_0x68bc('0x12')});db[_0x68bc('0x4a')]['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db[_0x68bc('0x4a')][_0x68bc('0x12a')](db[_0x68bc('0x123')],{'as':_0x68bc('0x181'),'foreignKey':'MailInteractionId'});db[_0x68bc('0x4a')]['belongsTo'](db[_0x68bc('0x44')],{'as':_0x68bc('0x179'),'foreignKey':_0x68bc('0x16c')});db[_0x68bc('0x4a')][_0x68bc('0x12a')](db[_0x68bc('0x143')],{'as':_0x68bc('0x143'),'foreignKey':_0x68bc('0x182')});db[_0x68bc('0x4a')]['belongsTo'](db[_0x68bc('0x73')],{'as':_0x68bc('0x73'),'foreignKey':_0x68bc('0x183')});db['MailApplication']['belongsTo'](db['User'],{'onDelete':'restrict'});db['MailApplication']['belongsTo'](db[_0x68bc('0x46')],{'onDelete':_0x68bc('0x16f')});db['MailApplication'][_0x68bc('0x12a')](db[_0x68bc('0x44')],{'onDelete':'restrict'});db[_0x68bc('0x4c')][_0x68bc('0x12a')](db[_0x68bc('0x8e')],{'onDelete':_0x68bc('0x16f'),'foreignKey':_0x68bc('0x15d')});db[_0x68bc('0x4c')][_0x68bc('0x12a')](db[_0x68bc('0x17b')],{'onDelete':_0x68bc('0x16f'),'foreignKey':_0x68bc('0x184')});db['MailQueueReport'][_0x68bc('0x12a')](db[_0x68bc('0x44')],{});db[_0x68bc('0x4e')][_0x68bc('0x12a')](db[_0x68bc('0x102')],{'as':_0x68bc('0x185'),'foreignKey':_0x68bc('0x174')});db[_0x68bc('0x4e')][_0x68bc('0x12a')](db['CmContact'],{'as':_0x68bc('0x16a'),'foreignKey':_0x68bc('0x16b')});db['MailQueueReport']['belongsTo'](db['MailInteraction'],{});db[_0x68bc('0x4e')]['belongsTo'](db['MailMessage'],{});db[_0x68bc('0x4e')]['belongsTo'](db[_0x68bc('0x12')],{});db['MailQueueReport'][_0x68bc('0x12a')](db[_0x68bc('0x46')],{});db[_0x68bc('0x4f')][_0x68bc('0x11b')](db[_0x68bc('0x186')],{'as':_0x68bc('0x187'),'onDelete':_0x68bc('0x11a')});db['FaxAccount']['hasMany'](db['Disposition'],{'as':_0x68bc('0x172'),'foreignKey':_0x68bc('0x188'),'onDelete':_0x68bc('0x11a')});db[_0x68bc('0x51')]['hasMany'](db['CannedAnswer'],{'as':_0x68bc('0x189'),'foreignKey':_0x68bc('0x188')});db[_0x68bc('0x51')][_0x68bc('0x11b')](db[_0x68bc('0x54')],{'as':_0x68bc('0x173')});db[_0x68bc('0x51')][_0x68bc('0x11b')](db['FaxApplication'],{'as':_0x68bc('0x151'),'foreignKey':'FaxAccountId','onDelete':'cascade'});db['FaxAccount'][_0x68bc('0x11b')](db[_0x68bc('0x19')],{'as':_0x68bc('0x18a'),'onDelete':_0x68bc('0x11a')});db[_0x68bc('0x51')]['hasMany'](db[_0x68bc('0x55')],{'as':_0x68bc('0x177')});db['FaxAccount']['belongsTo'](db[_0x68bc('0x2e')],{'as':_0x68bc('0x2e')});db[_0x68bc('0x51')][_0x68bc('0x12a')](db['CmList'],{'as':_0x68bc('0x185'),'foreignKey':'ListId'});db[_0x68bc('0x51')][_0x68bc('0x12a')](db[_0x68bc('0x90')],{'as':'mandatoryDispositionPause','foreignKey':_0x68bc('0x15f')});db['FaxAccount'][_0x68bc('0x12c')](db[_0x68bc('0x12')],{'as':_0x68bc('0x162'),'through':_0x68bc('0x18b')});db[_0x68bc('0x52')][_0x68bc('0x12a')](db['User'],{'onDelete':_0x68bc('0x16f')});db[_0x68bc('0x52')]['belongsTo'](db[_0x68bc('0x57')],{'onDelete':_0x68bc('0x16f')});db[_0x68bc('0x52')][_0x68bc('0x12a')](db[_0x68bc('0x51')],{'onDelete':_0x68bc('0x16f')});db[_0x68bc('0x52')][_0x68bc('0x12a')](db[_0x68bc('0x17b')],{'onDelete':'restrict','foreignKey':_0x68bc('0x184')});db['FaxInteraction']['hasMany'](db[_0x68bc('0x55')],{'as':_0x68bc('0x177'),'onDelete':_0x68bc('0x11a'),'foreignKey':_0x68bc('0x18c')});db[_0x68bc('0x54')]['belongsTo'](db[_0x68bc('0x51')],{'as':_0x68bc('0x179'),'foreignKey':_0x68bc('0x188')});db[_0x68bc('0x54')][_0x68bc('0x12a')](db[_0x68bc('0x12e')],{'as':_0x68bc('0x16a'),'foreignKey':_0x68bc('0x16b')});db[_0x68bc('0x54')][_0x68bc('0x12a')](db[_0x68bc('0x12')],{'as':'Owner','foreignKey':_0x68bc('0x119')});db[_0x68bc('0x54')][_0x68bc('0x12c')](db['Tag'],{'through':_0x68bc('0x18d'),'as':_0x68bc('0x17d')});db[_0x68bc('0x54')]['belongsToMany'](db['Tag'],{'through':'fax_interaction_has_tags','as':_0x68bc('0x17e')});db['FaxInteraction'][_0x68bc('0x12c')](db[_0x68bc('0x12')],{'as':_0x68bc('0x17f'),'through':_0x68bc('0x135'),'foreignKey':_0x68bc('0x18c')});db['FaxMessage'][_0x68bc('0x12a')](db[_0x68bc('0x12')],{'onDelete':_0x68bc('0x11a'),'as':_0x68bc('0x12')});db[_0x68bc('0x55')][_0x68bc('0x12a')](db[_0x68bc('0x54')],{'as':'Interaction','foreignKey':'FaxInteractionId'});db[_0x68bc('0x55')][_0x68bc('0x12a')](db[_0x68bc('0x12e')],{'onDelete':_0x68bc('0x11a'),'as':'Contact'});db['FaxMessage'][_0x68bc('0x12a')](db['Attachment'],{'as':_0x68bc('0xf8'),'foreignKey':'AttachmentId'});db['FaxMessage'][_0x68bc('0x12a')](db[_0x68bc('0x51')],{'as':_0x68bc('0x179'),'foreignKey':_0x68bc('0x188')});db[_0x68bc('0x57')][_0x68bc('0x12c')](db[_0x68bc('0x12')],{'as':_0x68bc('0x162'),'through':_0x68bc('0x39')});db[_0x68bc('0x57')][_0x68bc('0x12c')](db[_0x68bc('0xf1')],{'through':_0x68bc('0x18e'),'as':_0x68bc('0x18f')});db['FaxQueueReport'][_0x68bc('0x12a')](db[_0x68bc('0x51')],{});db[_0x68bc('0x190')][_0x68bc('0x12a')](db[_0x68bc('0x102')],{'as':_0x68bc('0x185'),'foreignKey':_0x68bc('0x174')});db['FaxQueueReport']['belongsTo'](db[_0x68bc('0x12e')],{'as':_0x68bc('0x16a'),'foreignKey':_0x68bc('0x16b')});db[_0x68bc('0x190')]['belongsTo'](db[_0x68bc('0x54')],{});db[_0x68bc('0x190')][_0x68bc('0x12a')](db[_0x68bc('0x55')],{});db[_0x68bc('0x190')][_0x68bc('0x12a')](db['User'],{});db[_0x68bc('0x190')][_0x68bc('0x12a')](db[_0x68bc('0x57')],{});db[_0x68bc('0x5a')][_0x68bc('0x11b')](db['Disposition'],{'as':_0x68bc('0x172'),'foreignKey':_0x68bc('0x191'),'onDelete':_0x68bc('0x11a')});db[_0x68bc('0x5a')][_0x68bc('0x11b')](db[_0x68bc('0x8a')],{'as':_0x68bc('0x189'),'foreignKey':_0x68bc('0x191')});db['SmsAccount'][_0x68bc('0x11b')](db[_0x68bc('0x60')],{'as':_0x68bc('0x177'),'foreignKey':_0x68bc('0x191')});db['SmsAccount'][_0x68bc('0x11b')](db['SmsInteraction'],{'as':_0x68bc('0x173')});db[_0x68bc('0x5a')][_0x68bc('0x11b')](db[_0x68bc('0x5c')],{'as':'Applications','foreignKey':_0x68bc('0x191'),'onDelete':_0x68bc('0x11a')});db['SmsAccount'][_0x68bc('0x12a')](db[_0x68bc('0x102')],{'as':_0x68bc('0x185'),'foreignKey':_0x68bc('0x174')});db['SmsAccount'][_0x68bc('0x12a')](db[_0x68bc('0x90')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x68bc('0x5a')][_0x68bc('0x12c')](db[_0x68bc('0x12')],{'as':_0x68bc('0x162'),'through':_0x68bc('0x192')});db['SmsApplication'][_0x68bc('0x12a')](db[_0x68bc('0x12')],{'onDelete':_0x68bc('0x16f')});db[_0x68bc('0x5c')][_0x68bc('0x12a')](db['SmsQueue'],{'onDelete':_0x68bc('0x16f')});db['SmsApplication']['belongsTo'](db[_0x68bc('0x5a')],{'onDelete':'restrict'});db[_0x68bc('0x5c')][_0x68bc('0x12a')](db[_0x68bc('0x8e')],{'onDelete':_0x68bc('0x16f'),'foreignKey':_0x68bc('0x15d')});db[_0x68bc('0x5c')]['belongsTo'](db['Tag'],{'onDelete':_0x68bc('0x16f'),'foreignKey':_0x68bc('0x184')});db[_0x68bc('0x5e')][_0x68bc('0x11b')](db['SmsMessage'],{'as':_0x68bc('0x177'),'onDelete':'cascade','foreignKey':_0x68bc('0x193')});db[_0x68bc('0x5e')][_0x68bc('0x12a')](db[_0x68bc('0x5a')],{'as':_0x68bc('0x179'),'foreignKey':'SmsAccountId'});db['SmsInteraction'][_0x68bc('0x12a')](db[_0x68bc('0x12e')],{'as':_0x68bc('0x16a'),'foreignKey':_0x68bc('0x16b')});db['SmsInteraction'][_0x68bc('0x12a')](db['User'],{'as':_0x68bc('0x17a'),'foreignKey':'UserId'});db[_0x68bc('0x5e')][_0x68bc('0x12c')](db[_0x68bc('0x17b')],{'through':_0x68bc('0x194'),'as':_0x68bc('0x17d')});db['SmsInteraction']['belongsToMany'](db[_0x68bc('0x17b')],{'through':_0x68bc('0x194'),'as':_0x68bc('0x17e')});db['SmsInteraction']['belongsToMany'](db[_0x68bc('0x12')],{'as':_0x68bc('0x17f'),'through':_0x68bc('0x137'),'foreignKey':_0x68bc('0x193')});db[_0x68bc('0x60')][_0x68bc('0x12a')](db[_0x68bc('0x12')],{'as':_0x68bc('0x12')});db['SmsMessage'][_0x68bc('0x12a')](db[_0x68bc('0x12e')],{'onDelete':'cascade','as':'Contact'});db['SmsMessage'][_0x68bc('0x12a')](db[_0x68bc('0x5e')],{'onDelete':_0x68bc('0x11a'),'as':_0x68bc('0x181'),'foreignKey':_0x68bc('0x193')});db[_0x68bc('0x60')][_0x68bc('0x12a')](db[_0x68bc('0x5a')],{'as':_0x68bc('0x179'),'foreignKey':'SmsAccountId'});db[_0x68bc('0x62')]['belongsToMany'](db[_0x68bc('0x12')],{'as':_0x68bc('0x162'),'through':_0x68bc('0x3b'),'foreignKey':'SmsQueueId'});db[_0x68bc('0x62')][_0x68bc('0x12c')](db[_0x68bc('0xf1')],{'through':'team_has_sms_queues','as':_0x68bc('0x18f')});db['OpenchannelAccount']['hasMany'](db[_0x68bc('0x8b')],{'as':'Dispositions','foreignKey':_0x68bc('0x195'),'onDelete':_0x68bc('0x11a')});db[_0x68bc('0x148')][_0x68bc('0x11b')](db[_0x68bc('0x8a')],{'as':_0x68bc('0x189'),'foreignKey':_0x68bc('0x195')});db[_0x68bc('0x148')][_0x68bc('0x11b')](db[_0x68bc('0x66')],{'as':'Interactions','foreignKey':_0x68bc('0x195')});db[_0x68bc('0x148')][_0x68bc('0x11b')](db[_0x68bc('0x68')],{'as':_0x68bc('0x177'),'foreignKey':_0x68bc('0x195')});db[_0x68bc('0x148')][_0x68bc('0x11b')](db[_0x68bc('0x65')],{'as':_0x68bc('0x151'),'foreignKey':_0x68bc('0x195'),'onDelete':'cascade'});db['OpenchannelAccount'][_0x68bc('0x12a')](db['CmList'],{'as':_0x68bc('0x185'),'foreignKey':'ListId'});db[_0x68bc('0x148')]['belongsTo'](db[_0x68bc('0x90')],{'as':_0x68bc('0x15e'),'foreignKey':_0x68bc('0x15f')});db['OpenchannelAccount'][_0x68bc('0x12c')](db[_0x68bc('0x12')],{'as':_0x68bc('0x162'),'through':_0x68bc('0x14a')});db[_0x68bc('0x65')][_0x68bc('0x12a')](db[_0x68bc('0x12')],{'onDelete':_0x68bc('0x16f')});db[_0x68bc('0x65')][_0x68bc('0x12a')](db[_0x68bc('0x6a')],{'onDelete':_0x68bc('0x16f'),'foreignKey':_0x68bc('0x196')});db[_0x68bc('0x65')]['belongsTo'](db['OpenchannelAccount'],{'onDelete':_0x68bc('0x16f'),'foreignKey':_0x68bc('0x195')});db[_0x68bc('0x65')][_0x68bc('0x12a')](db['Interval'],{'onDelete':_0x68bc('0x16f'),'foreignKey':'IntervalId'});db['OpenchannelApplication'][_0x68bc('0x12a')](db['Tag'],{'onDelete':_0x68bc('0x16f'),'foreignKey':_0x68bc('0x184')});db[_0x68bc('0x66')][_0x68bc('0x11b')](db[_0x68bc('0x68')],{'as':_0x68bc('0x177'),'onDelete':_0x68bc('0x11a'),'foreignKey':'OpenchannelInteractionId'});db[_0x68bc('0x66')]['belongsTo'](db['OpenchannelAccount'],{'as':_0x68bc('0x179'),'foreignKey':_0x68bc('0x195')});db[_0x68bc('0x66')]['belongsTo'](db[_0x68bc('0x12e')],{'as':_0x68bc('0x16a'),'foreignKey':'ContactId'});db['OpenchannelInteraction'][_0x68bc('0x12a')](db[_0x68bc('0x12')],{'as':_0x68bc('0x17a'),'foreignKey':_0x68bc('0x119')});db[_0x68bc('0x66')][_0x68bc('0x12c')](db[_0x68bc('0x17b')],{'through':_0x68bc('0x197'),'as':'Tags'});db[_0x68bc('0x66')][_0x68bc('0x12c')](db[_0x68bc('0x17b')],{'through':_0x68bc('0x197'),'as':_0x68bc('0x17e')});db['OpenchannelInteraction'][_0x68bc('0x12c')](db[_0x68bc('0x12')],{'as':_0x68bc('0x17f'),'through':_0x68bc('0x198'),'foreignKey':_0x68bc('0x199')});db[_0x68bc('0x68')][_0x68bc('0x12a')](db[_0x68bc('0x12')],{'onDelete':'cascade','as':_0x68bc('0x12')});db['OpenchannelMessage'][_0x68bc('0x12a')](db[_0x68bc('0x12e')],{'onDelete':'cascade','as':'Contact'});db[_0x68bc('0x68')][_0x68bc('0x12a')](db[_0x68bc('0x66')],{'onDelete':_0x68bc('0x11a'),'as':_0x68bc('0x181'),'foreignKey':_0x68bc('0x199')});db['OpenchannelMessage'][_0x68bc('0x12a')](db[_0x68bc('0xf8')],{'as':_0x68bc('0xf8'),'foreignKey':_0x68bc('0x19a')});db[_0x68bc('0x68')][_0x68bc('0x12a')](db[_0x68bc('0x148')],{'as':_0x68bc('0x179'),'foreignKey':'OpenchannelAccountId'});db[_0x68bc('0x6a')][_0x68bc('0x12c')](db['User'],{'as':_0x68bc('0x162'),'through':_0x68bc('0x3d'),'foreignKey':_0x68bc('0x196')});db[_0x68bc('0x6a')][_0x68bc('0x12c')](db[_0x68bc('0xf1')],{'through':_0x68bc('0x19b'),'as':'Teams'});db['ChatWebsite']['hasMany'](db[_0x68bc('0x8b')],{'as':_0x68bc('0x172'),'foreignKey':'ChatWebsiteId','onDelete':_0x68bc('0x11a')});db[_0x68bc('0x143')][_0x68bc('0x11b')](db[_0x68bc('0x8a')],{'as':_0x68bc('0x189'),'foreignKey':_0x68bc('0x182')});db[_0x68bc('0x143')][_0x68bc('0x11b')](db[_0x68bc('0x19c')],{'as':_0x68bc('0x19d')});db[_0x68bc('0x143')][_0x68bc('0x11b')](db['ChatInteraction'],{'as':_0x68bc('0x173')});db[_0x68bc('0x143')][_0x68bc('0x11b')](db[_0x68bc('0x6e')],{'as':_0x68bc('0x151'),'foreignKey':'ChatWebsiteId','onDelete':_0x68bc('0x11a')});db['ChatWebsite'][_0x68bc('0x11b')](db[_0x68bc('0x71')],{'as':_0x68bc('0x177')});db[_0x68bc('0x143')][_0x68bc('0x12a')](db[_0x68bc('0x102')],{'as':_0x68bc('0x185'),'foreignKey':_0x68bc('0x174')});db[_0x68bc('0x143')][_0x68bc('0x12a')](db[_0x68bc('0x8e')],{'as':'Interval','foreignKey':'IntervalId'});db[_0x68bc('0x143')][_0x68bc('0x12a')](db['MailAccount'],{'as':_0x68bc('0x44'),'foreignKey':'MailAccountId'});db[_0x68bc('0x143')][_0x68bc('0x12a')](db[_0x68bc('0x90')],{'as':_0x68bc('0x15e'),'foreignKey':_0x68bc('0x15f')});db['ChatWebsite'][_0x68bc('0x12c')](db[_0x68bc('0x12')],{'as':'Agents','through':'user_has_chat_websites'});db['OpenchannelQueueReport'][_0x68bc('0x12a')](db[_0x68bc('0x148')],{});db[_0x68bc('0x19e')][_0x68bc('0x12a')](db[_0x68bc('0x102')],{'as':_0x68bc('0x185'),'foreignKey':_0x68bc('0x174')});db['OpenchannelQueueReport'][_0x68bc('0x12a')](db['CmContact'],{'as':_0x68bc('0x16a'),'foreignKey':_0x68bc('0x16b')});db[_0x68bc('0x19e')]['belongsTo'](db[_0x68bc('0x66')],{});db[_0x68bc('0x19e')][_0x68bc('0x12a')](db[_0x68bc('0x68')],{});db[_0x68bc('0x19e')][_0x68bc('0x12a')](db[_0x68bc('0x12')],{});db[_0x68bc('0x19e')][_0x68bc('0x12a')](db[_0x68bc('0x6a')],{});db[_0x68bc('0x6e')][_0x68bc('0x12a')](db['User'],{'as':'Agent','foreignKey':'UserId','onDelete':_0x68bc('0x16f')});db[_0x68bc('0x6e')][_0x68bc('0x12a')](db[_0x68bc('0x75')],{'as':'Queue','foreignKey':_0x68bc('0x19f'),'onDelete':'restrict'});db[_0x68bc('0x6e')][_0x68bc('0x12a')](db[_0x68bc('0x143')],{'as':_0x68bc('0x1a0'),'foreignKey':_0x68bc('0x182'),'onDelete':'restrict'});db[_0x68bc('0x6e')][_0x68bc('0x12a')](db[_0x68bc('0x17b')],{'onDelete':'restrict','foreignKey':_0x68bc('0x184')});db[_0x68bc('0x70')]['hasMany'](db[_0x68bc('0x71')],{'as':_0x68bc('0x177'),'onDelete':_0x68bc('0x11a'),'foreignKey':_0x68bc('0x1a1')});db['ChatInteraction'][_0x68bc('0x12a')](db['ChatWebsite'],{'as':_0x68bc('0x179'),'foreignKey':_0x68bc('0x182')});db[_0x68bc('0x70')][_0x68bc('0x12a')](db[_0x68bc('0x12e')],{'as':'Contact','foreignKey':_0x68bc('0x16b')});db[_0x68bc('0x70')][_0x68bc('0x12a')](db[_0x68bc('0x12')],{'as':_0x68bc('0x17a'),'foreignKey':_0x68bc('0x119')});db['ChatInteraction']['belongsToMany'](db[_0x68bc('0x17b')],{'through':_0x68bc('0x1a2'),'as':_0x68bc('0x17d')});db[_0x68bc('0x70')][_0x68bc('0x12c')](db[_0x68bc('0x17b')],{'through':_0x68bc('0x1a2'),'as':_0x68bc('0x17e')});db[_0x68bc('0x70')]['belongsToMany'](db[_0x68bc('0x12')],{'as':_0x68bc('0x17f'),'through':_0x68bc('0x133'),'foreignKey':'ChatInteractionId'});db[_0x68bc('0x71')][_0x68bc('0x12a')](db[_0x68bc('0x12')],{'onDelete':_0x68bc('0x11a'),'as':_0x68bc('0x12')});db[_0x68bc('0x71')][_0x68bc('0x12a')](db[_0x68bc('0x12e')],{'onDelete':'cascade','as':_0x68bc('0x16a'),'foreignKey':_0x68bc('0x16b')});db[_0x68bc('0x71')][_0x68bc('0x12a')](db[_0x68bc('0x70')],{'onDelete':'cascade','as':_0x68bc('0x181'),'foreignKey':'ChatInteractionId'});db[_0x68bc('0x71')][_0x68bc('0x12a')](db['Attachment'],{'as':_0x68bc('0xf8'),'foreignKey':_0x68bc('0x19a')});db[_0x68bc('0x71')][_0x68bc('0x12a')](db[_0x68bc('0x143')],{'as':'Account','foreignKey':_0x68bc('0x182')});db[_0x68bc('0x73')]['hasMany'](db[_0x68bc('0xf8')],{'as':_0x68bc('0x180'),'foreignKey':_0x68bc('0x183'),'onDelete':_0x68bc('0x11a'),'hooks':!![]});db[_0x68bc('0x73')][_0x68bc('0x12a')](db[_0x68bc('0x12e')],{'onDelete':_0x68bc('0x11a'),'as':_0x68bc('0x16a'),'foreignKey':_0x68bc('0x16b')});db[_0x68bc('0x73')][_0x68bc('0x12a')](db[_0x68bc('0x143')],{'as':_0x68bc('0x179'),'foreignKey':_0x68bc('0x182')});db['ChatQueue'][_0x68bc('0x12c')](db[_0x68bc('0x12')],{'as':_0x68bc('0x162'),'through':_0x68bc('0x35'),'hooks':!![]});db[_0x68bc('0x75')]['belongsToMany'](db[_0x68bc('0xf1')],{'through':_0x68bc('0x1a3'),'as':_0x68bc('0x18f')});db[_0x68bc('0x77')][_0x68bc('0x11b')](db[_0x68bc('0xdd')],{'as':_0x68bc('0x177'),'foreignKey':_0x68bc('0x1a4'),'onDelete':_0x68bc('0x11a')});db[_0x68bc('0x77')][_0x68bc('0x12c')](db[_0x68bc('0x12')],{'as':_0x68bc('0x1a5'),'through':_0x68bc('0x1a6')});db['ChatProactiveAction'][_0x68bc('0x12a')](db[_0x68bc('0x143')],{'as':_0x68bc('0x1a0'),'foreignKey':_0x68bc('0x182')});db[_0x68bc('0x7a')]['hasMany'](db['CmContact'],{'as':_0x68bc('0x12f'),'foreignKey':'CompanyId'});db[_0x68bc('0x12e')]['hasMany'](db['CmContactHasItem'],{'as':'Phones','foreignKey':_0x68bc('0x1a7')});db[_0x68bc('0x12e')][_0x68bc('0x11b')](db[_0x68bc('0x7d')],{'as':_0x68bc('0x156'),'foreignKey':_0x68bc('0x16b')});db[_0x68bc('0x12e')][_0x68bc('0x11b')](db[_0x68bc('0x157')],{'as':_0x68bc('0x11f'),'foreignKey':_0x68bc('0x16b')});db[_0x68bc('0x12e')][_0x68bc('0x11b')](db[_0x68bc('0x81')],{'as':_0x68bc('0x1a8'),'foreignKey':_0x68bc('0x16b')});db[_0x68bc('0x12e')]['hasMany'](db[_0x68bc('0x83')],{'as':_0x68bc('0x83'),'foreignKey':_0x68bc('0x16b')});db['CmContact'][_0x68bc('0x11b')](db[_0x68bc('0xe2')],{'as':_0x68bc('0x15a'),'foreignKey':_0x68bc('0x16b')});db[_0x68bc('0x12e')][_0x68bc('0x11b')](db['OpenchannelInteraction'],{'as':_0x68bc('0x121'),'foreignKey':'ContactId','onDelete':_0x68bc('0x16f')});db[_0x68bc('0x12e')]['hasMany'](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0x68bc('0x16b'),'onDelete':'restrict'});db[_0x68bc('0x12e')][_0x68bc('0x11b')](db[_0x68bc('0x5e')],{'as':_0x68bc('0x136'),'foreignKey':_0x68bc('0x16b'),'onDelete':_0x68bc('0x16f')});db[_0x68bc('0x12e')]['hasMany'](db[_0x68bc('0x54')],{'as':_0x68bc('0x134'),'foreignKey':_0x68bc('0x16b'),'onDelete':_0x68bc('0x16f')});db[_0x68bc('0x12e')][_0x68bc('0x11b')](db[_0x68bc('0x123')],{'as':_0x68bc('0x124'),'foreignKey':_0x68bc('0x16b'),'onDelete':_0x68bc('0x16f')});db['CmContact'][_0x68bc('0x12a')](db[_0x68bc('0x7a')],{'as':_0x68bc('0x1a9'),'foreignKey':_0x68bc('0x1aa')});db[_0x68bc('0x12e')][_0x68bc('0x12a')](db['CmList'],{'as':_0x68bc('0x185'),'foreignKey':_0x68bc('0x174'),'onDelete':'cascade'});db[_0x68bc('0x12e')][_0x68bc('0x12c')](db[_0x68bc('0x12')],{'as':'Users','through':_0x68bc('0x130')});db['CmContact'][_0x68bc('0x12c')](db[_0x68bc('0x17b')],{'as':_0x68bc('0x17d'),'through':_0x68bc('0x1ab')});db[_0x68bc('0x12e')][_0x68bc('0x12c')](db[_0x68bc('0x17b')],{'through':'cm_contact_has_tags','as':_0x68bc('0x17e')});db['CmHopper'][_0x68bc('0x11b')](db[_0x68bc('0x9c')],{'as':_0x68bc('0x1ac'),'foreignKey':_0x68bc('0x1ad')});db[_0x68bc('0x7d')][_0x68bc('0x12a')](db[_0x68bc('0x12e')],{'as':_0x68bc('0x16a'),'foreignKey':_0x68bc('0x16b'),'onDelete':_0x68bc('0x11a')});db['CmHopper'][_0x68bc('0x12a')](db[_0x68bc('0x102')],{'as':_0x68bc('0x185'),'foreignKey':_0x68bc('0x174'),'onDelete':'cascade'});db[_0x68bc('0x7d')]['belongsTo'](db[_0x68bc('0x12')],{'as':'Agent','foreignKey':'UserId'});db['CmHopper']['belongsTo'](db[_0x68bc('0x1c')],{'as':'Queue','foreignKey':_0x68bc('0x155'),'onDelete':'cascade'});db['CmHopper'][_0x68bc('0x12a')](db[_0x68bc('0x1ae')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':_0x68bc('0x11a')});db[_0x68bc('0x7d')][_0x68bc('0x12a')](db[_0x68bc('0x12')],{'as':_0x68bc('0x17a'),'foreignKey':_0x68bc('0x1af')});db[_0x68bc('0x158')][_0x68bc('0x12a')](db[_0x68bc('0x12e')],{'as':_0x68bc('0x16a'),'foreignKey':_0x68bc('0x16b'),'onDelete':_0x68bc('0x11a')});db[_0x68bc('0x158')]['belongsTo'](db[_0x68bc('0x102')],{'as':'List','foreignKey':_0x68bc('0x174'),'onDelete':_0x68bc('0x11a')});db[_0x68bc('0x158')]['belongsTo'](db['VoiceQueue'],{'as':_0x68bc('0x1b0'),'foreignKey':_0x68bc('0x155'),'onDelete':_0x68bc('0x11a')});db[_0x68bc('0x158')]['belongsTo'](db['Campaign'],{'as':_0x68bc('0x1ae'),'foreignKey':'CampaignId','onDelete':'cascade'});db[_0x68bc('0x88')][_0x68bc('0x11b')](db[_0x68bc('0x1b1')],{'as':{'plural':'All','singular':_0x68bc('0x1b2')},'foreignKey':_0x68bc('0x1b3'),'onDelete':_0x68bc('0x11a'),'hooks':!![]});db[_0x68bc('0x88')][_0x68bc('0x11b')](db[_0x68bc('0x1b1')],{'as':{'plural':_0x68bc('0x1b4'),'singular':'OneAny'},'foreignKey':_0x68bc('0x1b5'),'onDelete':_0x68bc('0x11a'),'hooks':!![]});db['Automation'][_0x68bc('0x11b')](db['Action'],{'as':_0x68bc('0x1b6'),'foreignKey':_0x68bc('0x1b7'),'onDelete':'cascade','hooks':!![]});db[_0x68bc('0x8b')][_0x68bc('0x11b')](db[_0x68bc('0x8b')],{'as':_0x68bc('0x172'),'foreignKey':_0x68bc('0x1b8'),'onDelete':_0x68bc('0x11a')});db['Interval'][_0x68bc('0x11b')](db[_0x68bc('0x8e')],{'as':_0x68bc('0x1b9'),'foreignKey':'IntervalId','onDelete':_0x68bc('0x11a'),'hooks':!![],'required':![]});db[_0x68bc('0x8e')][_0x68bc('0x11b')](db[_0x68bc('0x19')],{'as':_0x68bc('0x11e'),'foreignKey':_0x68bc('0x15d'),'onDelete':'restrict'});db[_0x68bc('0x8e')][_0x68bc('0x11b')](db[_0x68bc('0x4c')],{'as':'MailApplications','foreignKey':_0x68bc('0x15d')});db[_0x68bc('0x8e')]['hasMany'](db[_0x68bc('0x6e')],{'as':_0x68bc('0x1ba'),'foreignKey':'IntervalId'});db[_0x68bc('0x8e')][_0x68bc('0x11b')](db['FaxApplication'],{'as':'FaxApplications','foreignKey':'IntervalId'});db[_0x68bc('0x8e')][_0x68bc('0x11b')](db[_0x68bc('0x5c')],{'as':_0x68bc('0x1bb'),'foreignKey':_0x68bc('0x15d')});db['Schedule'][_0x68bc('0x12a')](db[_0x68bc('0x44')],{});db[_0x68bc('0x96')][_0x68bc('0x12a')](db[_0x68bc('0xa8')],{'foreignKey':_0x68bc('0x1bc')});db[_0x68bc('0x96')]['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x68bc('0x1bd')});db[_0x68bc('0x97')][_0x68bc('0x12c')](db[_0x68bc('0x152')],{'as':_0x68bc('0x1be'),'through':_0x68bc('0x154'),'onDelete':_0x68bc('0x16f')});db[_0x68bc('0x17b')][_0x68bc('0x12c')](db[_0x68bc('0x12e')],{'through':_0x68bc('0x1ab')});db['Tag'][_0x68bc('0x12c')](db[_0x68bc('0x70')],{'through':_0x68bc('0x1a2')});db[_0x68bc('0x17b')][_0x68bc('0x12c')](db[_0x68bc('0x123')],{'through':_0x68bc('0x17c')});db[_0x68bc('0x17b')][_0x68bc('0x12c')](db[_0x68bc('0x5e')],{'through':_0x68bc('0x194')});db[_0x68bc('0x17b')][_0x68bc('0x12c')](db[_0x68bc('0x54')],{'through':_0x68bc('0x18d')});db[_0x68bc('0x17b')][_0x68bc('0x12c')](db[_0x68bc('0x66')],{'through':_0x68bc('0x197')});db[_0x68bc('0x17b')][_0x68bc('0x12c')](db[_0x68bc('0x10a')],{'through':_0x68bc('0x1bf')});db[_0x68bc('0x1c0')][_0x68bc('0x12a')](db[_0x68bc('0x1c1')],{'as':_0x68bc('0x1c2'),'foreignKey':'ItemTypeId'});db[_0x68bc('0x9c')][_0x68bc('0x12a')](db[_0x68bc('0x7d')],{'as':'Hopper','foreignKey':_0x68bc('0x1ad')});db['CmContactHasItem']['belongsTo'](db[_0x68bc('0x12e')],{'as':_0x68bc('0x16a'),'foreignKey':_0x68bc('0x1a7')});db['Trigger'][_0x68bc('0x11b')](db[_0x68bc('0x1b1')],{'as':{'plural':_0x68bc('0x1c3'),'singular':_0x68bc('0x1c4')},'foreignKey':'TriggerAllId','onDelete':_0x68bc('0x11a'),'hooks':!![]});db['Trigger']['hasMany'](db[_0x68bc('0x1b1')],{'as':{'plural':_0x68bc('0x1c5'),'singular':_0x68bc('0x1c6')},'foreignKey':_0x68bc('0x1c7'),'onDelete':'cascade','hooks':!![]});db[_0x68bc('0x9f')][_0x68bc('0x11b')](db[_0x68bc('0x86')],{'as':_0x68bc('0x1b6'),'foreignKey':_0x68bc('0x1c8'),'onDelete':_0x68bc('0x11a'),'hooks':!![]});db[_0x68bc('0xa6')][_0x68bc('0x11b')](db[_0x68bc('0x1c9')],{'as':_0x68bc('0x1ca'),'onDelete':_0x68bc('0x11a'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x68bc('0xa8')][_0x68bc('0x11b')](db[_0x68bc('0x1c9')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x68bc('0x1bc')});db['AnalyticMetric'][_0x68bc('0x11b')](db[_0x68bc('0x1c9')],{'as':_0x68bc('0x1ca'),'onDelete':_0x68bc('0x11a'),'foreignKey':_0x68bc('0x1cb')});db[_0x68bc('0x1c9')][_0x68bc('0x12a')](db[_0x68bc('0xac')],{'foreignKey':'MetricId'});db[_0x68bc('0xaf')][_0x68bc('0x11b')](db[_0x68bc('0xb0')],{'as':_0x68bc('0x1cc'),'onDelete':_0x68bc('0x11a'),'foreignKey':_0x68bc('0x1cd')});db[_0x68bc('0xb0')]['hasMany'](db[_0x68bc('0xb2')],{'as':_0x68bc('0x1ce'),'onDelete':_0x68bc('0x11a'),'foreignKey':_0x68bc('0x1cf')});db[_0x68bc('0xb0')]['hasMany'](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x68bc('0x11a'),'foreignKey':_0x68bc('0x1d0')});db[_0x68bc('0xb0')][_0x68bc('0x11b')](db[_0x68bc('0xb2')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x68bc('0x1d1')});db[_0x68bc('0xb0')][_0x68bc('0x12a')](db[_0x68bc('0xaf')],{'as':'Account','foreignKey':'AccountId'});db[_0x68bc('0xb2')][_0x68bc('0x11b')](db['SalesforceField'],{'as':_0x68bc('0x1d2'),'foreignKey':_0x68bc('0x1cf')});db[_0x68bc('0xb2')][_0x68bc('0x11b')](db[_0x68bc('0xb2')],{'as':_0x68bc('0x1d3'),'foreignKey':_0x68bc('0x1d0')});db[_0x68bc('0xb2')][_0x68bc('0x11b')](db[_0x68bc('0xb2')],{'as':_0x68bc('0x1d4'),'foreignKey':_0x68bc('0x1d1')});db[_0x68bc('0xb2')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x68bc('0xb4')][_0x68bc('0x11b')](db['SugarcrmConfiguration'],{'as':_0x68bc('0x1cc'),'onDelete':_0x68bc('0x11a'),'foreignKey':_0x68bc('0x1cd')});db['SugarcrmConfiguration'][_0x68bc('0x11b')](db[_0x68bc('0xb8')],{'as':_0x68bc('0x1ce'),'onDelete':_0x68bc('0x11a'),'foreignKey':'SubjectId'});db[_0x68bc('0xb6')][_0x68bc('0x11b')](db[_0x68bc('0xb8')],{'as':_0x68bc('0x1d5'),'onDelete':'cascade','foreignKey':_0x68bc('0x1d0')});db[_0x68bc('0xb6')][_0x68bc('0x11b')](db[_0x68bc('0xb8')],{'as':_0x68bc('0x1ca'),'onDelete':_0x68bc('0x11a'),'foreignKey':_0x68bc('0x1d1')});db['SugarcrmConfiguration'][_0x68bc('0x12a')](db['SugarcrmAccount'],{'as':'Account','foreignKey':'AccountId'});db[_0x68bc('0xb8')][_0x68bc('0x11b')](db[_0x68bc('0xb8')],{'as':_0x68bc('0x1d2'),'foreignKey':'SubjectId'});db[_0x68bc('0xb8')]['hasMany'](db[_0x68bc('0xb8')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x68bc('0xb8')][_0x68bc('0x11b')](db[_0x68bc('0xb8')],{'as':'Field','foreignKey':_0x68bc('0x1d1')});db[_0x68bc('0xb8')][_0x68bc('0x12a')](db[_0x68bc('0xa1')],{'as':_0x68bc('0xa1'),'foreignKey':_0x68bc('0x1d6')});db[_0x68bc('0xba')][_0x68bc('0x11b')](db[_0x68bc('0xbc')],{'as':_0x68bc('0x1cc'),'onDelete':_0x68bc('0x11a'),'foreignKey':'AccountId'});db[_0x68bc('0xbc')][_0x68bc('0x11b')](db[_0x68bc('0xbe')],{'as':_0x68bc('0x1ce'),'onDelete':_0x68bc('0x11a'),'foreignKey':_0x68bc('0x1cf')});db['DeskConfiguration'][_0x68bc('0x11b')](db[_0x68bc('0xbe')],{'as':'Descriptions','onDelete':_0x68bc('0x11a'),'foreignKey':'DescriptionId'});db['DeskConfiguration'][_0x68bc('0x11b')](db['DeskField'],{'as':_0x68bc('0x1ca'),'onDelete':'cascade','foreignKey':_0x68bc('0x1d1')});db[_0x68bc('0xbc')]['belongsTo'](db[_0x68bc('0xba')],{'as':_0x68bc('0x179'),'foreignKey':_0x68bc('0x1cd')});db[_0x68bc('0xbc')]['belongsToMany'](db['Tag'],{'through':_0x68bc('0x1d7')});db[_0x68bc('0xbe')][_0x68bc('0x11b')](db[_0x68bc('0xbe')],{'as':_0x68bc('0x1d2'),'foreignKey':_0x68bc('0x1cf')});db[_0x68bc('0xbe')][_0x68bc('0x11b')](db[_0x68bc('0xbe')],{'as':_0x68bc('0x1d3'),'foreignKey':_0x68bc('0x1d0')});db[_0x68bc('0xbe')][_0x68bc('0x11b')](db['DeskField'],{'as':_0x68bc('0x1d4'),'foreignKey':_0x68bc('0x1d1')});db[_0x68bc('0xbe')][_0x68bc('0x12a')](db[_0x68bc('0xa1')],{'as':'Variable','foreignKey':_0x68bc('0x1d6')});db['ZohoAccount'][_0x68bc('0x11b')](db[_0x68bc('0xc1')],{'as':_0x68bc('0x1cc'),'onDelete':_0x68bc('0x11a'),'foreignKey':_0x68bc('0x1cd')});db[_0x68bc('0xc1')]['hasMany'](db['ZohoField'],{'as':_0x68bc('0x1ce'),'onDelete':'cascade','foreignKey':_0x68bc('0x1cf')});db[_0x68bc('0xc1')][_0x68bc('0x11b')](db[_0x68bc('0xc2')],{'as':_0x68bc('0x1d5'),'onDelete':'cascade','foreignKey':_0x68bc('0x1d0')});db[_0x68bc('0xc1')]['hasMany'](db[_0x68bc('0xc2')],{'as':_0x68bc('0x1ca'),'onDelete':_0x68bc('0x11a'),'foreignKey':'FieldId'});db[_0x68bc('0xc1')]['belongsTo'](db[_0x68bc('0x1d8')],{'as':_0x68bc('0x179'),'foreignKey':'AccountId'});db[_0x68bc('0xc2')][_0x68bc('0x11b')](db[_0x68bc('0xc2')],{'as':_0x68bc('0x1d2'),'foreignKey':_0x68bc('0x1cf')});db['ZohoField']['hasMany'](db[_0x68bc('0xc2')],{'as':'Description','foreignKey':_0x68bc('0x1d0')});db[_0x68bc('0xc2')][_0x68bc('0x11b')](db['ZohoField'],{'as':'Field','foreignKey':_0x68bc('0x1d1')});db[_0x68bc('0xc2')]['belongsTo'](db['Variable'],{'as':_0x68bc('0xa1'),'foreignKey':_0x68bc('0x1d6')});db[_0x68bc('0x1d9')][_0x68bc('0x11b')](db['ZendeskConfiguration'],{'as':_0x68bc('0x1cc'),'onDelete':_0x68bc('0x11a'),'foreignKey':_0x68bc('0x1cd')});db[_0x68bc('0xc4')][_0x68bc('0x11b')](db[_0x68bc('0x1da')],{'as':_0x68bc('0x1ce'),'foreignKey':'SubjectId'});db[_0x68bc('0xc4')]['hasMany'](db[_0x68bc('0x1da')],{'as':_0x68bc('0x1d5'),'foreignKey':_0x68bc('0x1d0')});db[_0x68bc('0xc4')]['hasMany'](db[_0x68bc('0x1da')],{'as':_0x68bc('0x1ca'),'foreignKey':_0x68bc('0x1d1')});db[_0x68bc('0xc4')][_0x68bc('0x12a')](db[_0x68bc('0x1d9')],{'as':_0x68bc('0x179'),'foreignKey':_0x68bc('0x1cd')});db[_0x68bc('0xc4')]['belongsToMany'](db[_0x68bc('0x17b')],{'through':_0x68bc('0x1db')});db[_0x68bc('0x1da')]['hasMany'](db['ZendeskField'],{'as':_0x68bc('0x1d2'),'foreignKey':_0x68bc('0x1cf')});db[_0x68bc('0x1da')][_0x68bc('0x11b')](db[_0x68bc('0x1da')],{'as':'Description','foreignKey':_0x68bc('0x1d0')});db[_0x68bc('0x1da')][_0x68bc('0x11b')](db[_0x68bc('0x1da')],{'as':_0x68bc('0x1d4'),'foreignKey':_0x68bc('0x1d1')});db[_0x68bc('0x1da')][_0x68bc('0x12a')](db['Variable'],{'as':_0x68bc('0xa1'),'foreignKey':_0x68bc('0x1d6')});db['FreshdeskAccount'][_0x68bc('0x11b')](db['FreshdeskConfiguration'],{'as':'Configurations','onDelete':_0x68bc('0x11a'),'foreignKey':_0x68bc('0x1cd')});db['FreshdeskConfiguration']['hasMany'](db[_0x68bc('0x1dc')],{'as':_0x68bc('0x1ce'),'onDelete':_0x68bc('0x11a'),'foreignKey':_0x68bc('0x1cf')});db[_0x68bc('0xc7')]['hasMany'](db['FreshdeskField'],{'as':_0x68bc('0x1d5'),'onDelete':_0x68bc('0x11a'),'foreignKey':'DescriptionId'});db['FreshdeskConfiguration']['hasMany'](db[_0x68bc('0x1dc')],{'as':_0x68bc('0x1ca'),'onDelete':_0x68bc('0x11a'),'foreignKey':'FieldId'});db[_0x68bc('0xc7')][_0x68bc('0x12a')](db[_0x68bc('0x1dd')],{'as':_0x68bc('0x179'),'foreignKey':_0x68bc('0x1cd')});db[_0x68bc('0xc7')][_0x68bc('0x12c')](db[_0x68bc('0x17b')],{'through':_0x68bc('0x1de')});db[_0x68bc('0x1dc')]['hasMany'](db[_0x68bc('0x1dc')],{'as':'Subject','foreignKey':_0x68bc('0x1cf')});db[_0x68bc('0x1dc')][_0x68bc('0x11b')](db[_0x68bc('0x1dc')],{'as':_0x68bc('0x1d3'),'foreignKey':_0x68bc('0x1d0')});db[_0x68bc('0x1dc')][_0x68bc('0x11b')](db[_0x68bc('0x1dc')],{'as':'Field','foreignKey':_0x68bc('0x1d1')});db['FreshdeskField']['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0x68bc('0x1d6')});db[_0x68bc('0x1df')][_0x68bc('0x11b')](db[_0x68bc('0xc9')],{'as':'Configurations','onDelete':_0x68bc('0x11a'),'foreignKey':_0x68bc('0x1cd')});db[_0x68bc('0xc9')]['hasMany'](db['VtigerField'],{'as':_0x68bc('0x1ce'),'foreignKey':'SubjectId'});db[_0x68bc('0xc9')][_0x68bc('0x11b')](db[_0x68bc('0x1e0')],{'as':_0x68bc('0x1d5'),'foreignKey':_0x68bc('0x1d0')});db['VtigerConfiguration']['hasMany'](db[_0x68bc('0x1e0')],{'as':'Fields','foreignKey':'FieldId'});db[_0x68bc('0xc9')]['belongsTo'](db[_0x68bc('0x1df')],{'as':_0x68bc('0x179'),'foreignKey':'AccountId'});db[_0x68bc('0x1e0')][_0x68bc('0x11b')](db['VtigerField'],{'as':'Subject','foreignKey':_0x68bc('0x1cf')});db[_0x68bc('0x1e0')][_0x68bc('0x11b')](db['VtigerField'],{'as':_0x68bc('0x1d3'),'foreignKey':_0x68bc('0x1d0')});db['VtigerField'][_0x68bc('0x11b')](db[_0x68bc('0x1e0')],{'as':_0x68bc('0x1d4'),'foreignKey':_0x68bc('0x1d1')});db['VtigerField'][_0x68bc('0x12a')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x68bc('0x1e1')][_0x68bc('0x11b')](db[_0x68bc('0xcd')],{'as':_0x68bc('0x1cc'),'onDelete':_0x68bc('0x11a'),'foreignKey':'AccountId'});db['ServicenowConfiguration'][_0x68bc('0x11b')](db[_0x68bc('0xce')],{'as':_0x68bc('0x1ce'),'foreignKey':_0x68bc('0x1cf')});db[_0x68bc('0xcd')][_0x68bc('0x11b')](db[_0x68bc('0xce')],{'as':'Descriptions','foreignKey':_0x68bc('0x1d0')});db[_0x68bc('0xcd')][_0x68bc('0x11b')](db[_0x68bc('0xce')],{'as':_0x68bc('0x1ca'),'foreignKey':_0x68bc('0x1d1')});db[_0x68bc('0xcd')][_0x68bc('0x12a')](db[_0x68bc('0x1e1')],{'as':_0x68bc('0x179'),'foreignKey':_0x68bc('0x1cd')});db[_0x68bc('0xce')][_0x68bc('0x11b')](db[_0x68bc('0xce')],{'as':'Subject','foreignKey':_0x68bc('0x1cf')});db['ServicenowField'][_0x68bc('0x11b')](db[_0x68bc('0xce')],{'as':_0x68bc('0x1d3'),'foreignKey':_0x68bc('0x1d0')});db[_0x68bc('0xce')][_0x68bc('0x11b')](db['ServicenowField'],{'as':_0x68bc('0x1d4'),'foreignKey':_0x68bc('0x1d1')});db[_0x68bc('0xce')][_0x68bc('0x12a')](db[_0x68bc('0xa1')],{'as':'Variable','foreignKey':'VariableId'});db[_0x68bc('0xd0')][_0x68bc('0x11b')](db[_0x68bc('0xd2')],{'as':_0x68bc('0x1cc'),'onDelete':'cascade','foreignKey':_0x68bc('0x1cd')});db[_0x68bc('0xd0')][_0x68bc('0x12a')](db[_0x68bc('0x16d')],{'as':'CloudProvider','foreignKey':_0x68bc('0x16e')});db[_0x68bc('0xd2')][_0x68bc('0x11b')](db['Dynamics365Field'],{'as':_0x68bc('0x1ce'),'onDelete':_0x68bc('0x11a'),'foreignKey':_0x68bc('0x1cf')});db[_0x68bc('0xd2')]['hasMany'](db[_0x68bc('0xd3')],{'as':_0x68bc('0x1d5'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['Dynamics365Configuration'][_0x68bc('0x11b')](db[_0x68bc('0xd3')],{'as':_0x68bc('0x1ca'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x68bc('0xd2')]['belongsTo'](db[_0x68bc('0xd0')],{'as':_0x68bc('0x179'),'foreignKey':'AccountId'});db['Dynamics365Field'][_0x68bc('0x11b')](db[_0x68bc('0xd3')],{'as':'Subject','foreignKey':_0x68bc('0x1cf')});db[_0x68bc('0xd3')][_0x68bc('0x11b')](db[_0x68bc('0xd3')],{'as':'Description','foreignKey':_0x68bc('0x1d0')});db[_0x68bc('0xd3')]['hasMany'](db['Dynamics365Field'],{'as':_0x68bc('0x1d4'),'foreignKey':_0x68bc('0x1d1')});db[_0x68bc('0xd3')]['belongsTo'](db[_0x68bc('0xa1')],{'as':_0x68bc('0xa1'),'foreignKey':_0x68bc('0x1d6')});db['FreshsalesAccount'][_0x68bc('0x11b')](db['FreshsalesConfiguration'],{'as':_0x68bc('0x1cc'),'onDelete':_0x68bc('0x11a'),'foreignKey':'AccountId'});db[_0x68bc('0xd5')][_0x68bc('0x11b')](db[_0x68bc('0xd7')],{'as':_0x68bc('0x1ce'),'foreignKey':'SubjectId'});db[_0x68bc('0xd5')][_0x68bc('0x11b')](db[_0x68bc('0xd7')],{'as':_0x68bc('0x1d5'),'foreignKey':'DescriptionId'});db[_0x68bc('0xd5')][_0x68bc('0x11b')](db[_0x68bc('0xd7')],{'as':_0x68bc('0x1ca'),'foreignKey':'FieldId'});db[_0x68bc('0xd5')][_0x68bc('0x12a')](db[_0x68bc('0x1e2')],{'as':_0x68bc('0x179'),'foreignKey':_0x68bc('0x1cd')});db[_0x68bc('0xd7')][_0x68bc('0x11b')](db[_0x68bc('0xd7')],{'as':_0x68bc('0x1d2'),'foreignKey':_0x68bc('0x1cf')});db[_0x68bc('0xd7')]['hasMany'](db['FreshsalesField'],{'as':'Description','foreignKey':_0x68bc('0x1d0')});db[_0x68bc('0xd7')]['hasMany'](db['FreshsalesField'],{'as':_0x68bc('0x1d4'),'foreignKey':_0x68bc('0x1d1')});db[_0x68bc('0xd7')]['belongsTo'](db['Variable'],{'as':_0x68bc('0xa1'),'foreignKey':_0x68bc('0x1d6')});db[_0x68bc('0xdb')]['belongsTo'](db['ChatWebsite'],{});db[_0x68bc('0xdb')]['belongsTo'](db[_0x68bc('0x102')],{'as':_0x68bc('0x185'),'foreignKey':_0x68bc('0x174')});db[_0x68bc('0xdb')][_0x68bc('0x12a')](db[_0x68bc('0x12e')],{'as':_0x68bc('0x16a'),'foreignKey':'ContactId'});db['ChatQueueReport']['belongsTo'](db[_0x68bc('0x70')],{});db[_0x68bc('0xdb')][_0x68bc('0x12a')](db[_0x68bc('0x71')],{});db[_0x68bc('0xdb')][_0x68bc('0x12a')](db[_0x68bc('0x12')],{});db[_0x68bc('0xdb')][_0x68bc('0x12a')](db[_0x68bc('0x75')],{});db[_0x68bc('0xdd')][_0x68bc('0x12a')](db[_0x68bc('0x12')],{'onDelete':_0x68bc('0x11a'),'foreignKey':_0x68bc('0x1e3')});db[_0x68bc('0xdd')]['belongsTo'](db[_0x68bc('0x12')],{'onDelete':_0x68bc('0x11a'),'foreignKey':_0x68bc('0x1e4')});db[_0x68bc('0xe2')][_0x68bc('0x11b')](db[_0x68bc('0xe0')],{'foreignKey':_0x68bc('0x1e5'),'onDelete':_0x68bc('0x11a')});db['JscriptySessionReport']['hasMany'](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':'cascade'});db['SmsQueueReport']['belongsTo'](db[_0x68bc('0x5a')],{});db[_0x68bc('0xe4')][_0x68bc('0x12a')](db[_0x68bc('0x102')],{'as':'List','foreignKey':_0x68bc('0x174')});db[_0x68bc('0xe4')][_0x68bc('0x12a')](db[_0x68bc('0x12e')],{'as':'Contact','foreignKey':_0x68bc('0x16b')});db[_0x68bc('0xe4')][_0x68bc('0x12a')](db[_0x68bc('0x5e')],{});db[_0x68bc('0xe4')][_0x68bc('0x12a')](db[_0x68bc('0x60')],{});db[_0x68bc('0xe4')]['belongsTo'](db[_0x68bc('0x12')],{});db[_0x68bc('0xe4')][_0x68bc('0x12a')](db['SmsQueue'],{});db[_0x68bc('0xea')]['hasMany'](db['JscriptySessionReport'],{'foreignKey':_0x68bc('0x1e6')});db[_0x68bc('0xea')][_0x68bc('0x11b')](db[_0x68bc('0xe0')],{'foreignKey':_0x68bc('0x1e6')});db[_0x68bc('0xea')][_0x68bc('0x11b')](db[_0x68bc('0x1e7')],{'foreignKey':_0x68bc('0x1e6')});db[_0x68bc('0xf1')]['belongsToMany'](db[_0x68bc('0x12')],{'as':_0x68bc('0x162'),'through':_0x68bc('0x131')});db[_0x68bc('0xf1')][_0x68bc('0x12c')](db[_0x68bc('0x1c')],{'through':'TeamVoiceQueue','as':_0x68bc('0x139')});db[_0x68bc('0xf1')][_0x68bc('0x12c')](db[_0x68bc('0x46')],{'through':'team_has_mail_queues','as':_0x68bc('0x13b')});db[_0x68bc('0xf1')][_0x68bc('0x12c')](db[_0x68bc('0x75')],{'through':_0x68bc('0x1a3'),'as':_0x68bc('0x13c')});db['Team'][_0x68bc('0x12c')](db[_0x68bc('0x57')],{'through':_0x68bc('0x18e'),'as':_0x68bc('0x13d')});db[_0x68bc('0xf1')]['belongsToMany'](db[_0x68bc('0x62')],{'through':_0x68bc('0x1e8'),'as':'SmsQueues'});db['Team']['belongsToMany'](db[_0x68bc('0x6a')],{'through':_0x68bc('0x19b'),'as':_0x68bc('0x13f')});db[_0x68bc('0xf1')][_0x68bc('0x12c')](db['WhatsappQueue'],{'through':_0x68bc('0x1e9'),'as':_0x68bc('0x141')});db[_0x68bc('0xf1')][_0x68bc('0x12c')](db[_0x68bc('0x104')],{'through':_0x68bc('0x112'),'as':_0x68bc('0x13a')});db['Campaign']['hasMany'](db[_0x68bc('0x7d')],{'as':'Hoppers','foreignKey':'CampaignId'});db['Campaign'][_0x68bc('0x11b')](db[_0x68bc('0x157')],{'as':_0x68bc('0x11f'),'foreignKey':'CampaignId'});db[_0x68bc('0x1ae')][_0x68bc('0x11b')](db[_0x68bc('0x81')],{'as':_0x68bc('0x1a8'),'foreignKey':_0x68bc('0x1ea')});db['Campaign'][_0x68bc('0x11b')](db[_0x68bc('0x158')],{'as':_0x68bc('0x159'),'foreignKey':'CampaignId'});db['Campaign']['belongsTo'](db[_0x68bc('0x2e')],{'as':_0x68bc('0x2e'),'foreignKey':_0x68bc('0x1eb')});db[_0x68bc('0x1ae')][_0x68bc('0x12a')](db[_0x68bc('0x2e')],{'as':_0x68bc('0x15b'),'foreignKey':_0x68bc('0x15c')});db['Campaign'][_0x68bc('0x12a')](db[_0x68bc('0x8e')],{'as':_0x68bc('0x8e'),'foreignKey':_0x68bc('0x15d')});db[_0x68bc('0x1ae')][_0x68bc('0x12a')](db[_0x68bc('0x1ec')],{'as':_0x68bc('0x1ec'),'foreignKey':_0x68bc('0x1ed')});db[_0x68bc('0x1ae')]['belongsToMany'](db[_0x68bc('0x102')],{'as':_0x68bc('0x160'),'through':_0x68bc('0x1ee')});db[_0x68bc('0x1ae')]['belongsToMany'](db[_0x68bc('0x102')],{'as':'BlackLists','through':_0x68bc('0x1ef')});db[_0x68bc('0xf8')]['belongsTo'](db[_0x68bc('0x73')],{'as':'ChatOfflineMessage','foreignKey':'ChatOfflineMessageId'});db[_0x68bc('0xfb')][_0x68bc('0x12a')](db['MailMessage'],{});db[_0x68bc('0xfb')][_0x68bc('0x12a')](db[_0x68bc('0x123')],{});db[_0x68bc('0xfb')][_0x68bc('0x12a')](db[_0x68bc('0x44')],{'foreignKey':_0x68bc('0x1f0'),'as':_0x68bc('0x1f1')});db[_0x68bc('0xfb')][_0x68bc('0x12a')](db['User'],{'foreignKey':_0x68bc('0x1f2'),'as':_0x68bc('0x1f3')});db[_0x68bc('0xfb')]['belongsTo'](db[_0x68bc('0x12')],{'foreignKey':_0x68bc('0x1f4'),'as':'ToAgent'});db[_0x68bc('0xfb')][_0x68bc('0x12a')](db['MailQueue'],{'foreignKey':_0x68bc('0x1f5'),'as':_0x68bc('0x1f6')});db[_0x68bc('0xfb')][_0x68bc('0x12a')](db[_0x68bc('0x44')],{'foreignKey':'ToMailAccountId','as':_0x68bc('0x1f7')});db[_0x68bc('0xfc')]['belongsTo'](db[_0x68bc('0x71')],{});db['ChatTransferReport'][_0x68bc('0x12a')](db[_0x68bc('0x70')],{});db[_0x68bc('0xfc')][_0x68bc('0x12a')](db[_0x68bc('0x143')],{'foreignKey':_0x68bc('0x1f8'),'as':_0x68bc('0x1f1')});db[_0x68bc('0xfc')][_0x68bc('0x12a')](db[_0x68bc('0x12')],{'foreignKey':_0x68bc('0x1f2'),'as':'FromAgent'});db['ChatTransferReport']['belongsTo'](db[_0x68bc('0x12')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x68bc('0xfc')][_0x68bc('0x12a')](db[_0x68bc('0x75')],{'foreignKey':_0x68bc('0x1f9'),'as':_0x68bc('0x1f6')});db[_0x68bc('0xfc')]['belongsTo'](db['ChatWebsite'],{'foreignKey':_0x68bc('0x1fa'),'as':'ToAccount'});db[_0x68bc('0xfe')][_0x68bc('0x12a')](db[_0x68bc('0x55')],{});db['FaxTransferReport']['belongsTo'](db[_0x68bc('0x54')],{});db[_0x68bc('0xfe')][_0x68bc('0x12a')](db[_0x68bc('0x51')],{'foreignKey':_0x68bc('0x1fb'),'as':_0x68bc('0x1f1')});db[_0x68bc('0xfe')][_0x68bc('0x12a')](db[_0x68bc('0x12')],{'foreignKey':'FromUserId','as':_0x68bc('0x1f3')});db[_0x68bc('0xfe')]['belongsTo'](db[_0x68bc('0x12')],{'foreignKey':_0x68bc('0x1f4'),'as':_0x68bc('0x1fc')});db[_0x68bc('0xfe')][_0x68bc('0x12a')](db[_0x68bc('0x57')],{'foreignKey':'ToFaxQueueId','as':_0x68bc('0x1f6')});db[_0x68bc('0xfe')][_0x68bc('0x12a')](db['FaxAccount'],{'foreignKey':_0x68bc('0x1fd'),'as':_0x68bc('0x1f7')});db[_0x68bc('0xff')][_0x68bc('0x12a')](db[_0x68bc('0x68')],{});db[_0x68bc('0xff')][_0x68bc('0x12a')](db[_0x68bc('0x66')],{});db[_0x68bc('0xff')][_0x68bc('0x12a')](db[_0x68bc('0x148')],{'foreignKey':_0x68bc('0x1fe'),'as':_0x68bc('0x1f1')});db[_0x68bc('0xff')][_0x68bc('0x12a')](db[_0x68bc('0x12')],{'foreignKey':_0x68bc('0x1f2'),'as':'FromAgent'});db[_0x68bc('0xff')][_0x68bc('0x12a')](db['User'],{'foreignKey':'ToUserId','as':_0x68bc('0x1fc')});db[_0x68bc('0xff')][_0x68bc('0x12a')](db[_0x68bc('0x6a')],{'foreignKey':_0x68bc('0x1ff'),'as':_0x68bc('0x1f6')});db[_0x68bc('0xff')][_0x68bc('0x12a')](db[_0x68bc('0x148')],{'foreignKey':_0x68bc('0x200'),'as':_0x68bc('0x1f7')});db[_0x68bc('0x201')][_0x68bc('0x12a')](db[_0x68bc('0x60')],{});db['SmsTransferReport']['belongsTo'](db[_0x68bc('0x5e')],{});db['SmsTransferReport']['belongsTo'](db[_0x68bc('0x5a')],{'foreignKey':_0x68bc('0x202'),'as':_0x68bc('0x1f1')});db[_0x68bc('0x201')][_0x68bc('0x12a')](db[_0x68bc('0x12')],{'foreignKey':'FromUserId','as':_0x68bc('0x1f3')});db[_0x68bc('0x201')]['belongsTo'](db[_0x68bc('0x12')],{'foreignKey':_0x68bc('0x1f4'),'as':_0x68bc('0x1fc')});db[_0x68bc('0x201')][_0x68bc('0x12a')](db[_0x68bc('0x62')],{'foreignKey':_0x68bc('0x203'),'as':_0x68bc('0x1f6')});db['SmsTransferReport'][_0x68bc('0x12a')](db[_0x68bc('0x5a')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db['Disposition'],{'as':_0x68bc('0x172'),'foreignKey':'ListId','onDelete':_0x68bc('0x11a')});db[_0x68bc('0x102')][_0x68bc('0x11b')](db[_0x68bc('0x204')],{'as':_0x68bc('0x205'),'foreignKey':_0x68bc('0x174')});db[_0x68bc('0x102')][_0x68bc('0x11b')](db[_0x68bc('0x12e')],{'as':_0x68bc('0x12f'),'onDelete':'cascade','foreignKey':_0x68bc('0x174')});db[_0x68bc('0x102')][_0x68bc('0x11b')](db[_0x68bc('0x157')],{'as':_0x68bc('0x11f'),'foreignKey':'ListId'});db[_0x68bc('0x102')][_0x68bc('0x11b')](db[_0x68bc('0x81')],{'as':_0x68bc('0x120'),'foreignKey':_0x68bc('0x174')});db[_0x68bc('0x102')][_0x68bc('0x11b')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x68bc('0x174')});db[_0x68bc('0x102')][_0x68bc('0x12c')](db['VoiceQueue'],{'as':_0x68bc('0x206'),'through':_0x68bc('0x161')});db[_0x68bc('0x102')][_0x68bc('0x12c')](db[_0x68bc('0x12')],{'as':'Agents','through':'cm_user_has_lists'});db[_0x68bc('0x104')]['hasMany'](db[_0x68bc('0x19')],{'as':_0x68bc('0x11e'),'onDelete':'cascade'});db['VoicePrefix']['belongsToMany'](db[_0x68bc('0x12')],{'as':'Agents','through':_0x68bc('0x114')});db[_0x68bc('0x104')][_0x68bc('0x12c')](db[_0x68bc('0xf1')],{'through':'TeamVoicePrefix','as':_0x68bc('0x18f')});db['UserProfile'][_0x68bc('0x11b')](db[_0x68bc('0x12')],{'as':_0x68bc('0x17f'),'foreignKey':_0x68bc('0x12b')});db[_0x68bc('0x207')][_0x68bc('0x11b')](db[_0x68bc('0x105')],{'as':_0x68bc('0x208'),'foreignKey':_0x68bc('0x12b'),'onDelete':_0x68bc('0x11a')});db['UserProfileSection'][_0x68bc('0x11b')](db[_0x68bc('0x209')],{'as':'Resources','foreignKey':'sectionId','onDelete':'cascade'});db[_0x68bc('0x14c')]['hasMany'](db['Disposition'],{'as':_0x68bc('0x172'),'foreignKey':_0x68bc('0x20a'),'onDelete':_0x68bc('0x11a')});db['WhatsappAccount']['hasMany'](db[_0x68bc('0x8a')],{'as':_0x68bc('0x189'),'foreignKey':_0x68bc('0x20a')});db[_0x68bc('0x14c')][_0x68bc('0x11b')](db[_0x68bc('0x10c')],{'as':_0x68bc('0x177'),'foreignKey':_0x68bc('0x20a')});db[_0x68bc('0x14c')][_0x68bc('0x11b')](db[_0x68bc('0x10a')],{'as':_0x68bc('0x173')});db['WhatsappAccount']['hasMany'](db[_0x68bc('0x108')],{'as':'Applications','foreignKey':_0x68bc('0x20a'),'onDelete':_0x68bc('0x11a')});db[_0x68bc('0x14c')][_0x68bc('0x12a')](db[_0x68bc('0x102')],{'as':_0x68bc('0x185'),'foreignKey':_0x68bc('0x174')});db[_0x68bc('0x14c')][_0x68bc('0x12a')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x68bc('0x14c')][_0x68bc('0x12c')](db['User'],{'as':'Agents','through':_0x68bc('0x14e')});db[_0x68bc('0x108')][_0x68bc('0x12a')](db[_0x68bc('0x12')],{'onDelete':_0x68bc('0x16f')});db[_0x68bc('0x108')]['belongsTo'](db[_0x68bc('0x140')],{'onDelete':_0x68bc('0x16f')});db['WhatsappApplication']['belongsTo'](db['WhatsappAccount'],{'onDelete':_0x68bc('0x16f')});db['WhatsappApplication'][_0x68bc('0x12a')](db[_0x68bc('0x8e')],{'onDelete':_0x68bc('0x16f'),'foreignKey':_0x68bc('0x15d')});db[_0x68bc('0x108')][_0x68bc('0x12a')](db['Tag'],{'onDelete':_0x68bc('0x16f'),'foreignKey':_0x68bc('0x184')});db[_0x68bc('0x10a')]['hasMany'](db['WhatsappMessage'],{'as':_0x68bc('0x177'),'onDelete':_0x68bc('0x11a'),'foreignKey':_0x68bc('0x20b')});db[_0x68bc('0x10a')][_0x68bc('0x12a')](db[_0x68bc('0x14c')],{'as':_0x68bc('0x179'),'foreignKey':_0x68bc('0x20a')});db[_0x68bc('0x10a')][_0x68bc('0x12a')](db[_0x68bc('0x12e')],{'as':_0x68bc('0x16a'),'foreignKey':_0x68bc('0x16b')});db[_0x68bc('0x10a')][_0x68bc('0x12a')](db[_0x68bc('0x12')],{'as':_0x68bc('0x17a'),'foreignKey':'UserId'});db[_0x68bc('0x10a')][_0x68bc('0x12c')](db[_0x68bc('0x17b')],{'through':_0x68bc('0x1bf'),'as':_0x68bc('0x17d')});db[_0x68bc('0x10a')][_0x68bc('0x12c')](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':_0x68bc('0x17e')});db[_0x68bc('0x10a')][_0x68bc('0x12c')](db[_0x68bc('0x12')],{'as':_0x68bc('0x17f'),'through':_0x68bc('0x138'),'foreignKey':'WhatsappInteractionId'});db[_0x68bc('0x10c')][_0x68bc('0x12a')](db[_0x68bc('0x12')],{'as':_0x68bc('0x12')});db[_0x68bc('0x10c')][_0x68bc('0x12a')](db[_0x68bc('0x12e')],{'onDelete':_0x68bc('0x11a'),'as':'Contact'});db['WhatsappMessage']['belongsTo'](db[_0x68bc('0x10a')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x68bc('0x20b')});db[_0x68bc('0x10c')][_0x68bc('0x12a')](db[_0x68bc('0x14c')],{'as':_0x68bc('0x179'),'foreignKey':_0x68bc('0x20a')});db[_0x68bc('0x10e')][_0x68bc('0x12a')](db[_0x68bc('0x14c')],{});db[_0x68bc('0x10e')][_0x68bc('0x12a')](db[_0x68bc('0x102')],{'as':_0x68bc('0x185'),'foreignKey':_0x68bc('0x174')});db[_0x68bc('0x10e')][_0x68bc('0x12a')](db['CmContact'],{'as':_0x68bc('0x16a'),'foreignKey':_0x68bc('0x16b')});db[_0x68bc('0x10e')]['belongsTo'](db[_0x68bc('0x10a')],{});db[_0x68bc('0x10e')]['belongsTo'](db['WhatsappQueue'],{});db[_0x68bc('0x10e')][_0x68bc('0x12a')](db[_0x68bc('0x10c')],{});db[_0x68bc('0x10e')][_0x68bc('0x12a')](db[_0x68bc('0x12')],{});db[_0x68bc('0x10f')][_0x68bc('0x12a')](db[_0x68bc('0x10c')],{});db['WhatsappTransferReport'][_0x68bc('0x12a')](db[_0x68bc('0x10a')],{});db[_0x68bc('0x10f')]['belongsTo'](db[_0x68bc('0x14c')],{'foreignKey':_0x68bc('0x20c'),'as':_0x68bc('0x1f1')});db['WhatsappTransferReport'][_0x68bc('0x12a')](db[_0x68bc('0x14c')],{'foreignKey':_0x68bc('0x20d'),'as':_0x68bc('0x1f7')});db[_0x68bc('0x10f')]['belongsTo'](db[_0x68bc('0x140')],{'foreignKey':'ToQueueId','as':_0x68bc('0x1f6')});db[_0x68bc('0x10f')][_0x68bc('0x12a')](db['User'],{'foreignKey':_0x68bc('0x1f2'),'as':_0x68bc('0x1f3')});db[_0x68bc('0x10f')][_0x68bc('0x12a')](db['User'],{'foreignKey':_0x68bc('0x1f4'),'as':'ToAgent'});db[_0x68bc('0x140')][_0x68bc('0x12c')](db[_0x68bc('0x12')],{'as':_0x68bc('0x162'),'through':'UserWhatsappQueue','foreignKey':_0x68bc('0x20e')});db['WhatsappQueue'][_0x68bc('0x12c')](db['Team'],{'through':'team_has_whatsapp_queues','as':'Teams'});db[_0x68bc('0x116')][_0x68bc('0x12a')](db[_0x68bc('0x12')],{'as':_0x68bc('0x20f'),'foreignKey':_0x68bc('0x119'),'onDelete':'cascade','hooks':!![]});db[_0x68bc('0x16d')][_0x68bc('0x118')](db[_0x68bc('0xd0')],{'as':_0x68bc('0xd0'),'onDelete':_0x68bc('0x16f')});db['CloudProvider'][_0x68bc('0x118')](db[_0x68bc('0x40')],{'as':_0x68bc('0x170'),'onDelete':_0x68bc('0x16f')});db[_0x68bc('0x16d')][_0x68bc('0x118')](db[_0x68bc('0x42')],{'as':_0x68bc('0x171'),'onDelete':_0x68bc('0x16f')});module[_0x68bc('0x210')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 6ae5186..5ceaf6e 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1883=['/api/cm/hopper_final','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','/api/pauses','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','./api/template','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/field_reports','/api/analytics/tree_reports','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/jscriptyProject','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','/api/teams','/api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','./api/attachment','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/user-settings','./api/user-setting','/api/mail_interaction_has_tags','./api/mailInteractionHasTag','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','/api/rpc','/api/version','./api/system','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','static','join','/www','root','/demo','/snippet','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','./api/voiceCallReport','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','/api/mail/out_servers','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/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/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1883,0xab));var _0x3188=function(_0xe1236,_0x3d8554){_0xe1236=_0xe1236-0x0;var _0x15a665=_0x1883[_0xe1236];return _0x15a665;};'use strict';var path=require(_0x3188('0x0'));var express=require(_0x3188('0x1'));var errors=require(_0x3188('0x2'));var config=require(_0x3188('0x3'));var setupLoggers=require(_0x3188('0x4'))[_0x3188('0x5')];var clientSideLogs=require(_0x3188('0x6'));exports[_0x3188('0x7')]=function(_0x1c7c86){return setupLoggers(_0x1c7c86)[_0x3188('0x8')](function(){_0x1c7c86[_0x3188('0x9')](_0x3188('0xa'),require(_0x3188('0xb')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xc'),require(_0x3188('0xd')));_0x1c7c86[_0x3188('0x9')]('/api/voice/contexts',require(_0x3188('0xe')));_0x1c7c86[_0x3188('0x9')]('/api/voice/extensions',require(_0x3188('0xf')));_0x1c7c86['use'](_0x3188('0x10'),require(_0x3188('0x11')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x12'),require('./api/voiceQueue'));_0x1c7c86[_0x3188('0x9')](_0x3188('0x13'),require('./api/voiceRecording'));_0x1c7c86['use'](_0x3188('0x14'),require(_0x3188('0x15')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x16'),require(_0x3188('0x17')));_0x1c7c86[_0x3188('0x9')]('/api/voice/mails/messages',require(_0x3188('0x18')));_0x1c7c86['use']('/api/voice/calls/reports',require(_0x3188('0x19')));_0x1c7c86['use']('/api/voice/dials/reports',require(_0x3188('0x1a')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x1b'),require(_0x3188('0x1c')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x1d'),require('./api/voiceQueueReport'));_0x1c7c86[_0x3188('0x9')](_0x3188('0x1e'),require(_0x3188('0x1f')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x20'),require(_0x3188('0x21')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x22'),require('./api/voiceTransferReport'));_0x1c7c86[_0x3188('0x9')](_0x3188('0x23'),require('./api/mailServerOut'));_0x1c7c86['use']('/api/mail/accounts',require(_0x3188('0x24')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x25'),require('./api/mailQueue'));_0x1c7c86['use'](_0x3188('0x26'),require(_0x3188('0x27')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x28'),require(_0x3188('0x29')));_0x1c7c86['use'](_0x3188('0x2a'),require(_0x3188('0x2b')));_0x1c7c86['use'](_0x3188('0x2c'),require('./api/mailApplication'));_0x1c7c86['use'](_0x3188('0x2d'),require(_0x3188('0x2e')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x2f'),require(_0x3188('0x30')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x31'),require(_0x3188('0x32')));_0x1c7c86['use'](_0x3188('0x33'),require(_0x3188('0x34')));_0x1c7c86['use'](_0x3188('0x35'),require(_0x3188('0x36')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x37'),require(_0x3188('0x38')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x39'),require(_0x3188('0x3a')));_0x1c7c86['use'](_0x3188('0x3b'),require('./api/faxQueue'));_0x1c7c86[_0x3188('0x9')]('/api/fax/reports/queue',require(_0x3188('0x3c')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x3d'),require(_0x3188('0x3e')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x3f'),require(_0x3188('0x40')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x41'),require(_0x3188('0x42')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x43'),require(_0x3188('0x44')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x45'),require(_0x3188('0x46')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x47'),require('./api/openchannelAccount'));_0x1c7c86[_0x3188('0x9')]('/api/openchannel/applications',require(_0x3188('0x48')));_0x1c7c86[_0x3188('0x9')]('/api/openchannel/interactions',require(_0x3188('0x49')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x4a'),require(_0x3188('0x4b')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x4c'),require(_0x3188('0x4d')));_0x1c7c86['use']('/api/chat/websites',require(_0x3188('0x4e')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x4f'),require(_0x3188('0x50')));_0x1c7c86['use'](_0x3188('0x51'),require(_0x3188('0x52')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x53'),require('./api/chatInteraction'));_0x1c7c86[_0x3188('0x9')]('/api/chat/messages',require(_0x3188('0x54')));_0x1c7c86['use'](_0x3188('0x55'),require(_0x3188('0x56')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x57'),require(_0x3188('0x58')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x59'),require(_0x3188('0x5a')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x5b'),require('./api/chatProactiveAction'));_0x1c7c86[_0x3188('0x9')](_0x3188('0x5c'),require(_0x3188('0x5d')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x5e'),require(_0x3188('0x5f')));_0x1c7c86['use'](_0x3188('0x60'),require('./api/cmHopper'));_0x1c7c86[_0x3188('0x9')](_0x3188('0x61'),require(_0x3188('0x62')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x63'),require('./api/cmHopperFinal'));_0x1c7c86['use']('/api/cm/hopper_history',require('./api/cmHopperHistory'));_0x1c7c86['use'](_0x3188('0x64'),require(_0x3188('0x65')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x66'),require(_0x3188('0x67')));_0x1c7c86['use'](_0x3188('0x68'),require('./api/automation'));_0x1c7c86[_0x3188('0x9')](_0x3188('0x69'),require(_0x3188('0x6a')));_0x1c7c86[_0x3188('0x9')]('/api/dispositions',require(_0x3188('0x6b')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x6c'),require(_0x3188('0x6d')));_0x1c7c86[_0x3188('0x9')]('/api/intervals',require('./api/interval'));_0x1c7c86[_0x3188('0x9')](_0x3188('0x6e'),require('./api/pause'));_0x1c7c86[_0x3188('0x9')](_0x3188('0x6f'),require('./api/cdr'));_0x1c7c86[_0x3188('0x9')](_0x3188('0x70'),require(_0x3188('0x71')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x72'),require('./api/schedule'));_0x1c7c86[_0x3188('0x9')]('/api/sounds',require(_0x3188('0x73')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x74'),require(_0x3188('0x75')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x76'),require(_0x3188('0x77')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x78'),require(_0x3188('0x79')));_0x1c7c86[_0x3188('0x9')]('/api/cm_hopper_additional_phones',require('./api/cmHopperAdditionalPhone'));_0x1c7c86[_0x3188('0x9')]('/api/templates',require(_0x3188('0x7a')));_0x1c7c86[_0x3188('0x9')]('/api/triggers',require(_0x3188('0x7b')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x7c'),require(_0x3188('0x7d')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x7e'),require(_0x3188('0x7f')));_0x1c7c86[_0x3188('0x9')]('/api/integrations/reports',require(_0x3188('0x80')));_0x1c7c86[_0x3188('0x9')]('/api/analytics/custom_reports',require(_0x3188('0x81')));_0x1c7c86['use'](_0x3188('0x82'),require(_0x3188('0x83')));_0x1c7c86[_0x3188('0x9')]('/api/analytics/extracted_reports',require('./api/analyticExtractedReport'));_0x1c7c86['use']('/api/analytics/metrics',require('./api/analyticMetric'));_0x1c7c86[_0x3188('0x9')](_0x3188('0x84'),require('./api/analyticFieldReport'));_0x1c7c86[_0x3188('0x9')](_0x3188('0x85'),require('./api/analyticTreeReport'));_0x1c7c86['use']('/api/integrations/salesforce/accounts',require('./api/intSalesforceAccount'));_0x1c7c86['use'](_0x3188('0x86'),require(_0x3188('0x87')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x88'),require(_0x3188('0x89')));_0x1c7c86['use'](_0x3188('0x8a'),require(_0x3188('0x8b')));_0x1c7c86['use']('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0x1c7c86[_0x3188('0x9')](_0x3188('0x8c'),require(_0x3188('0x8d')));_0x1c7c86['use'](_0x3188('0x8e'),require(_0x3188('0x8f')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x90'),require(_0x3188('0x91')));_0x1c7c86['use'](_0x3188('0x92'),require(_0x3188('0x93')));_0x1c7c86[_0x3188('0x9')]('/api/integrations/zoho/accounts',require(_0x3188('0x94')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x95'),require(_0x3188('0x96')));_0x1c7c86['use'](_0x3188('0x97'),require(_0x3188('0x98')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x99'),require(_0x3188('0x9a')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x9b'),require('./api/intZendeskConfiguration'));_0x1c7c86[_0x3188('0x9')](_0x3188('0x9c'),require(_0x3188('0x9d')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x9e'),require(_0x3188('0x9f')));_0x1c7c86[_0x3188('0x9')]('/api/integrations/freshdesk/configurations',require(_0x3188('0xa0')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xa1'),require(_0x3188('0xa2')));_0x1c7c86[_0x3188('0x9')]('/api/integrations/vtiger/accounts',require(_0x3188('0xa3')));_0x1c7c86[_0x3188('0x9')]('/api/integrations/vtiger/configurations',require('./api/intVtigerConfiguration'));_0x1c7c86[_0x3188('0x9')](_0x3188('0xa4'),require(_0x3188('0xa5')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xa6'),require(_0x3188('0xa7')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xa8'),require(_0x3188('0xa9')));_0x1c7c86[_0x3188('0x9')]('/api/integrations/servicenow/fields',require(_0x3188('0xaa')));_0x1c7c86['use']('/api/integrations/dynamics365/accounts',require(_0x3188('0xab')));_0x1c7c86['use'](_0x3188('0xac'),require(_0x3188('0xad')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xae'),require(_0x3188('0xaf')));_0x1c7c86[_0x3188('0x9')]('/api/integrations/freshsales/accounts',require(_0x3188('0xb0')));_0x1c7c86[_0x3188('0x9')]('/api/integrations/freshsales/configurations',require(_0x3188('0xb1')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xb2'),require(_0x3188('0xb3')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xb4'),require('./api/network'));_0x1c7c86[_0x3188('0x9')](_0x3188('0xb5'),require('./api/chatQueueReport'));_0x1c7c86[_0x3188('0x9')](_0x3188('0xb6'),require(_0x3188('0xb7')));_0x1c7c86['use'](_0x3188('0xb8'),require(_0x3188('0xb9')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xba'),require(_0x3188('0xbb')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xbc'),require('./api/jscriptySessionReport'));_0x1c7c86['use']('/api/sms/reports/queue',require('./api/smsQueueReport'));_0x1c7c86[_0x3188('0x9')](_0x3188('0xbd'),require(_0x3188('0xbe')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xbf'),require('./api/squareReportDetail'));_0x1c7c86[_0x3188('0x9')]('/api/jscripty/projects',require(_0x3188('0xc0')));_0x1c7c86[_0x3188('0x9')]('/api/settings',require(_0x3188('0xc1')));_0x1c7c86['use'](_0x3188('0xc2'),require(_0x3188('0xc3')));_0x1c7c86['use'](_0x3188('0xc4'),require('./api/squareProject'));_0x1c7c86[_0x3188('0x9')](_0x3188('0xc5'),require(_0x3188('0xc6')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xc7'),require('./api/squareMessage'));_0x1c7c86[_0x3188('0x9')](_0x3188('0xc8'),require('./api/team'));_0x1c7c86[_0x3188('0x9')](_0x3188('0xc9'),require('./api/license'));_0x1c7c86['use'](_0x3188('0xca'),require(_0x3188('0xcb')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xcc'),require(_0x3188('0xcd')));_0x1c7c86[_0x3188('0x9')]('/api/attachments',require(_0x3188('0xce')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xcf'),require('./api/plugin'));_0x1c7c86[_0x3188('0x9')](_0x3188('0xd0'),require(_0x3188('0xd1')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xd2'),require(_0x3188('0xd3')));_0x1c7c86['use']('/api/fax/reports/transfer',require('./api/faxTransferReport'));_0x1c7c86[_0x3188('0x9')](_0x3188('0xd4'),require('./api/openchannelTransferReport'));_0x1c7c86[_0x3188('0x9')](_0x3188('0xd5'),require(_0x3188('0xd6')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xd7'),require(_0x3188('0xd8')));_0x1c7c86['use'](_0x3188('0xd9'),require(_0x3188('0xda')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xdb'),require(_0x3188('0xdc')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xdd'),require(_0x3188('0xde')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xdf'),require(_0x3188('0xe0')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xe1'),require(_0x3188('0xe2')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xe3'),require(_0x3188('0xe4')));_0x1c7c86[_0x3188('0x9')]('/api/whatsapp/applications',require(_0x3188('0xe5')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xe6'),require(_0x3188('0xe7')));_0x1c7c86[_0x3188('0x9')]('/api/whatsapp/messages',require(_0x3188('0xe8')));_0x1c7c86[_0x3188('0x9')]('/api/whatsapp/reports/queue',require(_0x3188('0xe9')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xea'),require('./api/whatsappTransferReport'));_0x1c7c86[_0x3188('0x9')]('/api/whatsapp/queues',require(_0x3188('0xeb')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xec'),require(_0x3188('0xed')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xee'),require('./api/realtime'));_0x1c7c86['use'](_0x3188('0xef'),require(_0x3188('0xf0')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xf1'),require(_0x3188('0xf2')));_0x1c7c86[_0x3188('0x9')]('/api/auth/local',require(_0x3188('0xf3')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xf4'),require(_0x3188('0xf5')));_0x1c7c86['use'](_0x3188('0xf6'),require('./api/authActiveDirectory'));_0x1c7c86['use']('/api/jira',require('./api/jira'));_0x1c7c86[_0x3188('0x9')](_0x3188('0xf7'),require('./api/rpc'));_0x1c7c86[_0x3188('0x9')](_0x3188('0xf8'),require('./api/version'));_0x1c7c86[_0x3188('0x9')]('/api/system',require(_0x3188('0xf9')));_0x1c7c86[_0x3188('0x9')]('/api/pm2',require(_0x3188('0xfa')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xfb'),require(_0x3188('0xfc')));_0x1c7c86[_0x3188('0x9')](_0x3188('0xfd'),clientSideLogs);_0x1c7c86[_0x3188('0x9')](_0x3188('0xfe'),express[_0x3188('0xff')](path[_0x3188('0x100')](config['root'],_0x3188('0xfe'))));_0x1c7c86[_0x3188('0x9')](_0x3188('0x101'),express['static'](path[_0x3188('0x100')](config['root'],_0x3188('0x101'))));_0x1c7c86['use']('/demo',express['static'](path['join'](config[_0x3188('0x102')],_0x3188('0x103'))));_0x1c7c86[_0x3188('0x9')](_0x3188('0x104'),express[_0x3188('0xff')](path['join'](config[_0x3188('0x102')],'snippet','3.10.1')));_0x1c7c86[_0x3188('0x9')](_0x3188('0x105'),express['static'](path[_0x3188('0x100')](config[_0x3188('0x102')],_0x3188('0x106'))));_0x1c7c86[_0x3188('0x107')](_0x3188('0x108'))[_0x3188('0x109')](errors[0x194]);_0x1c7c86[_0x3188('0x107')]('/*')['get'](function(_0x354b60,_0xa54e8a){_0xa54e8a[_0x3188('0x10a')](path[_0x3188('0x10b')](_0x1c7c86[_0x3188('0x109')](_0x3188('0x10c'))+_0x3188('0x10d')));});return _0x1c7c86;});}; \ No newline at end of file +var _0x7f05=['./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','./api/contactItemType','/api/cm_contact_has_items','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','./api/integrationReport','./api/analyticCustomReport','/api/analytics/extracted_reports','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','/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/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/fields','/api/networks','./api/network','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','/api/license','/api/campaigns','./api/campaign','/api/migrations','./api/attachment','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/mail_interaction_has_tags','./api/mailInteractionHasTag','./api/authLocal','/api/auth/google','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/system','/api/pm2','./api/pm2','./api/webbar','static','join','/apidoc','/www','root','/demo','3.10.1','/plugins','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','resolve','appPath','/index.html','path','express','./errors','./utils/client-side-logger','./api/client-side-logs','default','then','use','./api/user','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','./api/memberReport','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages'];(function(_0xb94781,_0xa2314b){var _0x3e1881=function(_0x57c689){while(--_0x57c689){_0xb94781['push'](_0xb94781['shift']());}};_0x3e1881(++_0xa2314b);}(_0x7f05,0xdc));var _0x57f0=function(_0x2d980a,_0x3f6769){_0x2d980a=_0x2d980a-0x0;var _0x1fa864=_0x7f05[_0x2d980a];return _0x1fa864;};'use strict';var path=require(_0x57f0('0x0'));var express=require(_0x57f0('0x1'));var errors=require(_0x57f0('0x2'));var config=require('./config/environment');var setupLoggers=require(_0x57f0('0x3'))['setupLoggers'];var clientSideLogs=require(_0x57f0('0x4'));exports[_0x57f0('0x5')]=function(_0x52bde5){return setupLoggers(_0x52bde5)[_0x57f0('0x6')](function(){_0x52bde5[_0x57f0('0x7')]('/api/users',require(_0x57f0('0x8')));_0x52bde5[_0x57f0('0x7')]('/api/voice/chanspy',require(_0x57f0('0x9')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xa'),require('./api/voiceContext'));_0x52bde5['use'](_0x57f0('0xb'),require('./api/voiceExtension'));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xc'),require(_0x57f0('0xd')));_0x52bde5[_0x57f0('0x7')]('/api/voice/queues',require('./api/voiceQueue'));_0x52bde5[_0x57f0('0x7')]('/api/voice/recordings',require('./api/voiceRecording'));_0x52bde5['use']('/api/screen/recordings',require('./api/screenRecording'));_0x52bde5['use'](_0x57f0('0xe'),require(_0x57f0('0xf')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x10'),require('./api/voiceMailMessage'));_0x52bde5['use'](_0x57f0('0x11'),require(_0x57f0('0x12')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x13'),require(_0x57f0('0x14')));_0x52bde5[_0x57f0('0x7')]('/api/voice/agents/reports',require('./api/voiceAgentReport'));_0x52bde5[_0x57f0('0x7')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x52bde5['use']('/api/members/reports',require(_0x57f0('0x15')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x16'),require('./api/trunk'));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x17'),require(_0x57f0('0x18')));_0x52bde5['use'](_0x57f0('0x19'),require(_0x57f0('0x1a')));_0x52bde5['use']('/api/mail/accounts',require(_0x57f0('0x1b')));_0x52bde5[_0x57f0('0x7')]('/api/mail/queues',require(_0x57f0('0x1c')));_0x52bde5['use'](_0x57f0('0x1d'),require(_0x57f0('0x1e')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x1f'),require('./api/mailInteraction'));_0x52bde5['use'](_0x57f0('0x20'),require('./api/mailMessage'));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x21'),require(_0x57f0('0x22')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x23'),require(_0x57f0('0x24')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x25'),require('./api/dashboard'));_0x52bde5[_0x57f0('0x7')]('/api/dashboards/items',require('./api/dashboardItem'));_0x52bde5[_0x57f0('0x7')]('/api/fax/accounts',require(_0x57f0('0x26')));_0x52bde5['use']('/api/fax/applications',require(_0x57f0('0x27')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x28'),require(_0x57f0('0x29')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x2a'),require(_0x57f0('0x2b')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x2c'),require(_0x57f0('0x2d')));_0x52bde5['use'](_0x57f0('0x2e'),require(_0x57f0('0x2f')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x30'),require(_0x57f0('0x31')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x32'),require(_0x57f0('0x33')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x34'),require(_0x57f0('0x35')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x36'),require(_0x57f0('0x37')));_0x52bde5['use'](_0x57f0('0x38'),require(_0x57f0('0x39')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x3a'),require('./api/openchannelAccount'));_0x52bde5['use']('/api/openchannel/applications',require(_0x57f0('0x3b')));_0x52bde5['use'](_0x57f0('0x3c'),require(_0x57f0('0x3d')));_0x52bde5[_0x57f0('0x7')]('/api/openchannel/messages',require(_0x57f0('0x3e')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x3f'),require(_0x57f0('0x40')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x41'),require(_0x57f0('0x42')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x43'),require(_0x57f0('0x44')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x45'),require(_0x57f0('0x46')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x47'),require(_0x57f0('0x48')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x49'),require(_0x57f0('0x4a')));_0x52bde5['use']('/api/chat/offline_messages',require(_0x57f0('0x4b')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x4c'),require('./api/chatQueue'));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x4d'),require(_0x57f0('0x4e')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x4f'),require(_0x57f0('0x50')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x51'),require(_0x57f0('0x52')));_0x52bde5['use'](_0x57f0('0x53'),require(_0x57f0('0x54')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x55'),require('./api/cmHopper'));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x56'),require('./api/cmHopperBlack'));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x57'),require(_0x57f0('0x58')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x59'),require(_0x57f0('0x5a')));_0x52bde5[_0x57f0('0x7')]('/api/cm/custom_fields',require(_0x57f0('0x5b')));_0x52bde5['use'](_0x57f0('0x5c'),require('./api/action'));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x5d'),require(_0x57f0('0x5e')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x5f'),require(_0x57f0('0x60')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x61'),require(_0x57f0('0x62')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x63'),require('./api/condition'));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x64'),require('./api/interval'));_0x52bde5['use'](_0x57f0('0x65'),require('./api/pause'));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x66'),require(_0x57f0('0x67')));_0x52bde5['use'](_0x57f0('0x68'),require(_0x57f0('0x69')));_0x52bde5['use'](_0x57f0('0x6a'),require(_0x57f0('0x6b')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x6c'),require(_0x57f0('0x6d')));_0x52bde5[_0x57f0('0x7')]('/api/tags',require(_0x57f0('0x6e')));_0x52bde5[_0x57f0('0x7')]('/api/contact_item_types',require(_0x57f0('0x6f')));_0x52bde5['use'](_0x57f0('0x70'),require('./api/cmContactHasItem'));_0x52bde5[_0x57f0('0x7')]('/api/cm_hopper_additional_phones',require('./api/cmHopperAdditionalPhone'));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x71'),require(_0x57f0('0x72')));_0x52bde5['use'](_0x57f0('0x73'),require(_0x57f0('0x74')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x75'),require(_0x57f0('0x76')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x77'),require(_0x57f0('0x78')));_0x52bde5[_0x57f0('0x7')]('/api/integrations/reports',require(_0x57f0('0x79')));_0x52bde5[_0x57f0('0x7')]('/api/analytics/custom_reports',require(_0x57f0('0x7a')));_0x52bde5[_0x57f0('0x7')]('/api/analytics/default_reports',require('./api/analyticDefaultReport'));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x7b'),require('./api/analyticExtractedReport'));_0x52bde5['use']('/api/analytics/metrics',require(_0x57f0('0x7c')));_0x52bde5[_0x57f0('0x7')]('/api/analytics/field_reports',require(_0x57f0('0x7d')));_0x52bde5['use'](_0x57f0('0x7e'),require(_0x57f0('0x7f')));_0x52bde5['use'](_0x57f0('0x80'),require(_0x57f0('0x81')));_0x52bde5['use'](_0x57f0('0x82'),require(_0x57f0('0x83')));_0x52bde5['use'](_0x57f0('0x84'),require(_0x57f0('0x85')));_0x52bde5[_0x57f0('0x7')]('/api/integrations/sugarcrm/accounts',require(_0x57f0('0x86')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x87'),require('./api/intSugarcrmConfiguration'));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x88'),require(_0x57f0('0x89')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x8a'),require(_0x57f0('0x8b')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x8c'),require(_0x57f0('0x8d')));_0x52bde5['use'](_0x57f0('0x8e'),require(_0x57f0('0x8f')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x90'),require(_0x57f0('0x91')));_0x52bde5[_0x57f0('0x7')]('/api/integrations/zoho/configurations',require(_0x57f0('0x92')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x93'),require('./api/intZohoField'));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x94'),require(_0x57f0('0x95')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x96'),require(_0x57f0('0x97')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x98'),require(_0x57f0('0x99')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x9a'),require(_0x57f0('0x9b')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x9c'),require(_0x57f0('0x9d')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0x9e'),require(_0x57f0('0x9f')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xa0'),require('./api/intVtigerAccount'));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xa1'),require('./api/intVtigerConfiguration'));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xa2'),require('./api/intVtigerField'));_0x52bde5['use'](_0x57f0('0xa3'),require(_0x57f0('0xa4')));_0x52bde5[_0x57f0('0x7')]('/api/integrations/servicenow/configurations',require(_0x57f0('0xa5')));_0x52bde5[_0x57f0('0x7')]('/api/integrations/servicenow/fields',require('./api/intServicenowField'));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xa6'),require('./api/intDynamics365Account'));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xa7'),require(_0x57f0('0xa8')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xa9'),require(_0x57f0('0xaa')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xab'),require(_0x57f0('0xac')));_0x52bde5[_0x57f0('0x7')]('/api/integrations/freshsales/configurations',require('./api/intFreshsalesConfiguration'));_0x52bde5['use'](_0x57f0('0xad'),require('./api/intFreshsalesField'));_0x52bde5['use'](_0x57f0('0xae'),require(_0x57f0('0xaf')));_0x52bde5[_0x57f0('0x7')]('/api/chat/reports/queue',require('./api/chatQueueReport'));_0x52bde5[_0x57f0('0x7')]('/api/chat/internal/messages',require(_0x57f0('0xb0')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xb1'),require(_0x57f0('0xb2')));_0x52bde5['use'](_0x57f0('0xb3'),require('./api/jscriptyQuestionReport'));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xb4'),require(_0x57f0('0xb5')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xb6'),require(_0x57f0('0xb7')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xb8'),require(_0x57f0('0xb9')));_0x52bde5['use'](_0x57f0('0xba'),require(_0x57f0('0xbb')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xbc'),require(_0x57f0('0xbd')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xbe'),require(_0x57f0('0xbf')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xc0'),require(_0x57f0('0xc1')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xc2'),require('./api/squareProject'));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xc3'),require(_0x57f0('0xc4')));_0x52bde5['use'](_0x57f0('0xc5'),require(_0x57f0('0xc6')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xc7'),require('./api/team'));_0x52bde5['use'](_0x57f0('0xc8'),require('./api/license'));_0x52bde5['use'](_0x57f0('0xc9'),require(_0x57f0('0xca')));_0x52bde5['use'](_0x57f0('0xcb'),require('./api/migration'));_0x52bde5[_0x57f0('0x7')]('/api/attachments',require(_0x57f0('0xcc')));_0x52bde5[_0x57f0('0x7')]('/api/plugins',require(_0x57f0('0xcd')));_0x52bde5['use'](_0x57f0('0xce'),require('./api/mailTransferReport'));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xcf'),require(_0x57f0('0xd0')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xd1'),require('./api/faxTransferReport'));_0x52bde5[_0x57f0('0x7')]('/api/openchannel/reports/transfer',require(_0x57f0('0xd2')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xd3'),require(_0x57f0('0xd4')));_0x52bde5[_0x57f0('0x7')]('/api/cm/lists',require(_0x57f0('0xd5')));_0x52bde5[_0x57f0('0x7')]('/api/voice/prefixes',require(_0x57f0('0xd6')));_0x52bde5[_0x57f0('0x7')]('/api/userProfiles',require(_0x57f0('0xd7')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xd8'),require(_0x57f0('0xd9')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xda'),require(_0x57f0('0xdb')));_0x52bde5[_0x57f0('0x7')]('/api/userNotifications',require(_0x57f0('0xdc')));_0x52bde5['use'](_0x57f0('0xdd'),require(_0x57f0('0xde')));_0x52bde5['use'](_0x57f0('0xdf'),require(_0x57f0('0xe0')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xe1'),require(_0x57f0('0xe2')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xe3'),require(_0x57f0('0xe4')));_0x52bde5[_0x57f0('0x7')]('/api/whatsapp/reports/queue',require('./api/whatsappQueueReport'));_0x52bde5[_0x57f0('0x7')]('/api/whatsapp/reports/transfer',require('./api/whatsappTransferReport'));_0x52bde5[_0x57f0('0x7')]('/api/whatsapp/queues',require(_0x57f0('0xe5')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xe6'),require(_0x57f0('0xe7')));_0x52bde5['use'](_0x57f0('0xe8'),require(_0x57f0('0xe9')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xea'),require(_0x57f0('0xeb')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xec'),require(_0x57f0('0xed')));_0x52bde5['use']('/api/auth/local',require(_0x57f0('0xee')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xef'),require('./api/authGoogle'));_0x52bde5['use']('/api/auth/activedirectory',require('./api/authActiveDirectory'));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xf0'),require(_0x57f0('0xf1')));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xf2'),require(_0x57f0('0xf3')));_0x52bde5['use']('/api/version',require('./api/version'));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xf4'),require('./api/system'));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xf5'),require(_0x57f0('0xf6')));_0x52bde5[_0x57f0('0x7')]('/api/webbar',require(_0x57f0('0xf7')));_0x52bde5[_0x57f0('0x7')]('/api/logs',clientSideLogs);_0x52bde5[_0x57f0('0x7')]('/apidoc',express[_0x57f0('0xf8')](path[_0x57f0('0xf9')](config['root'],_0x57f0('0xfa'))));_0x52bde5['use'](_0x57f0('0xfb'),express['static'](path[_0x57f0('0xf9')](config[_0x57f0('0xfc')],_0x57f0('0xfb'))));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xfd'),express['static'](path[_0x57f0('0xf9')](config[_0x57f0('0xfc')],_0x57f0('0xfd'))));_0x52bde5[_0x57f0('0x7')]('/snippet',express['static'](path[_0x57f0('0xf9')](config['root'],'snippet',_0x57f0('0xfe'))));_0x52bde5[_0x57f0('0x7')](_0x57f0('0xff'),express['static'](path[_0x57f0('0xf9')](config[_0x57f0('0xfc')],_0x57f0('0x100'))));_0x52bde5['route'](_0x57f0('0x101'))[_0x57f0('0x102')](errors[0x194]);_0x52bde5[_0x57f0('0x103')]('/*')[_0x57f0('0x102')](function(_0x179dcb,_0x4bd1eb){_0x4bd1eb['sendFile'](path[_0x57f0('0x104')](_0x52bde5['get'](_0x57f0('0x105'))+_0x57f0('0x106')));});return _0x52bde5;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 5bb51cc..cb209fe 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f0e=['../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/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/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxApplication/faxApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc'];(function(_0x84a188,_0x2d2aae){var _0x46cb97=function(_0x2b2bc7){while(--_0x2b2bc7){_0x84a188['push'](_0x84a188['shift']());}};_0x46cb97(++_0x2d2aae);}(_0x1f0e,0xe7));var _0xe1f0=function(_0x5da0d9,_0x49ee54){_0x5da0d9=_0x5da0d9-0x0;var _0x4b6d2f=_0x1f0e[_0x5da0d9];return _0x4b6d2f;};'use strict';var jayson=require(_0xe1f0('0x0'));var _=require('lodash');var config=require(_0xe1f0('0x1'));exports[_0xe1f0('0x2')]=function(){return new Promise(function(_0x329738,_0x2106b1){var _0x58b237={};_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x4')));_0x58b237=_['merge'](_0x58b237,require('../api/voiceExtension/voiceExtension.rpc'));_0x58b237=_['merge'](_0x58b237,require(_0xe1f0('0x5')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x6')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x7')));_0x58b237=_['merge'](_0x58b237,require(_0xe1f0('0x8')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x9')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0xa')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0xb')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0xc')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0xd')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0xe')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require('../api/mailServerIn/mailServerIn.rpc'));_0x58b237=_['merge'](_0x58b237,require(_0xe1f0('0xf')));_0x58b237=_['merge'](_0x58b237,require(_0xe1f0('0x10')));_0x58b237=_['merge'](_0x58b237,require('../api/mailInteraction/mailInteraction.rpc'));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x11')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x12')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x58b237=_['merge'](_0x58b237,require('../api/faxAccount/faxAccount.rpc'));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x13')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require('../api/faxInteraction/faxInteraction.rpc'));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x14')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x15')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x16')));_0x58b237=_['merge'](_0x58b237,require('../api/smsInteraction/smsInteraction.rpc'));_0x58b237=_['merge'](_0x58b237,require(_0xe1f0('0x17')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x18')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x19')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x1a')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x1b')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x1c')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require('../api/chatInteraction/chatInteraction.rpc'));_0x58b237=_['merge'](_0x58b237,require(_0xe1f0('0x1d')));_0x58b237=_['merge'](_0x58b237,require(_0xe1f0('0x1e')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require('../api/cmContact/cmContact.rpc'));_0x58b237=_['merge'](_0x58b237,require(_0xe1f0('0x1f')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x20')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x21')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x22')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x23')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x24')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x25')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x26')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x58b237=_['merge'](_0x58b237,require('../api/template/template.rpc'));_0x58b237=_['merge'](_0x58b237,require(_0xe1f0('0x27')));_0x58b237=_['merge'](_0x58b237,require('../api/variable/variable.rpc'));_0x58b237=_['merge'](_0x58b237,require(_0xe1f0('0x28')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x29')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x2a')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x2b')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x2c')));_0x58b237=_['merge'](_0x58b237,require(_0xe1f0('0x2d')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x2e')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x2f')));_0x58b237=_['merge'](_0x58b237,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x58b237=_['merge'](_0x58b237,require(_0xe1f0('0x30')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x31')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x58b237=_['merge'](_0x58b237,require(_0xe1f0('0x32')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x33')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x34')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x35')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require('../api/squareRecording/squareRecording.rpc'));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require('../api/squareMessage/squareMessage.rpc'));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require('../api/campaign/campaign.rpc'));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require('../api/attachment/attachment.rpc'));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x36')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x37')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x38')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x39')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x3a')));_0x58b237=_[_0xe1f0('0x3')](_0x58b237,require(_0xe1f0('0x3b')));var _0x510d3b=jayson[_0xe1f0('0x3c')](_0x58b237)[_0xe1f0('0x3d')]();var _0x17297b=config[_0xe1f0('0x3e')][_0xe1f0('0x3f')]||config[_0xe1f0('0x3f')]+0x1;var _0xc9fdb4=config[_0xe1f0('0x3e')]['ip']||_0xe1f0('0x40');_0x510d3b['on'](_0xe1f0('0x41'),function(_0x1cf45f){return _0x2106b1(_0x1cf45f);});_0x510d3b[_0xe1f0('0x2')](_0x17297b,_0xc9fdb4,function(){console['log'](_0xe1f0('0x42'),_0xc9fdb4,_0x17297b);require(_0xe1f0('0x43'))[_0xe1f0('0x44')]();return _0x329738(_0xe1f0('0x45')+_0xc9fdb4+':'+_0x17297b);});});}; \ No newline at end of file +var _0xd5b1=['../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/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/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.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/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReportDetail/squareReportDetail.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/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueue/whatsappQueue.rpc','http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','listen','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','merge','../api/voiceQueue/voiceQueue.rpc'];(function(_0xc87d08,_0x59c9be){var _0x30a714=function(_0x437c0d){while(--_0x437c0d){_0xc87d08['push'](_0xc87d08['shift']());}};_0x30a714(++_0x59c9be);}(_0xd5b1,0x116));var _0x1d5b=function(_0x4f7e37,_0x291c9f){_0x4f7e37=_0x4f7e37-0x0;var _0x442ea8=_0xd5b1[_0x4f7e37];return _0x442ea8;};'use strict';var jayson=require(_0x1d5b('0x0'));var _=require('lodash');var config=require('../config/environment');exports[_0x1d5b('0x1')]=function(){return new Promise(function(_0x510342,_0x151066){var _0x2d3bcc={};_0x2d3bcc=_['merge'](_0x2d3bcc,require(_0x1d5b('0x2')));_0x2d3bcc=_['merge'](_0x2d3bcc,require(_0x1d5b('0x3')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x5')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x6')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x7')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x8')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x9')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0xa')));_0x2d3bcc=_['merge'](_0x2d3bcc,require(_0x1d5b('0xb')));_0x2d3bcc=_['merge'](_0x2d3bcc,require(_0x1d5b('0xc')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0xd')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0xe')));_0x2d3bcc=_['merge'](_0x2d3bcc,require(_0x1d5b('0xf')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x10')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x11')));_0x2d3bcc=_['merge'](_0x2d3bcc,require(_0x1d5b('0x12')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x13')));_0x2d3bcc=_['merge'](_0x2d3bcc,require(_0x1d5b('0x14')));_0x2d3bcc=_['merge'](_0x2d3bcc,require(_0x1d5b('0x15')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x16')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x17')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require('../api/faxMessage/faxMessage.rpc'));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x18')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x19')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x1a')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require('../api/smsInteraction/smsInteraction.rpc'));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x1b')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require('../api/smsQueue/smsQueue.rpc'));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x1c')));_0x2d3bcc=_['merge'](_0x2d3bcc,require(_0x1d5b('0x1d')));_0x2d3bcc=_['merge'](_0x2d3bcc,require(_0x1d5b('0x1e')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x1f')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x20')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require('../api/chatInteraction/chatInteraction.rpc'));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x21')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x22')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x23')));_0x2d3bcc=_['merge'](_0x2d3bcc,require('../api/cmHopper/cmHopper.rpc'));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x24')));_0x2d3bcc=_['merge'](_0x2d3bcc,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x25')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x26')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x27')));_0x2d3bcc=_['merge'](_0x2d3bcc,require('../api/sound/sound.rpc'));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x28')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x29')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x2a')));_0x2d3bcc=_['merge'](_0x2d3bcc,require(_0x1d5b('0x2b')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x2c')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x2d')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x2e')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x2f')));_0x2d3bcc=_['merge'](_0x2d3bcc,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x30')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x31')));_0x2d3bcc=_['merge'](_0x2d3bcc,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x2d3bcc=_['merge'](_0x2d3bcc,require(_0x1d5b('0x32')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require('../api/squareReport/squareReport.rpc'));_0x2d3bcc=_['merge'](_0x2d3bcc,require(_0x1d5b('0x33')));_0x2d3bcc=_['merge'](_0x2d3bcc,require('../api/setting/setting.rpc'));_0x2d3bcc=_['merge'](_0x2d3bcc,require('../api/squareOdbc/squareOdbc.rpc'));_0x2d3bcc=_['merge'](_0x2d3bcc,require(_0x1d5b('0x34')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x35')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x36')));_0x2d3bcc=_['merge'](_0x2d3bcc,require(_0x1d5b('0x37')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x38')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x39')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x3a')));_0x2d3bcc=_['merge'](_0x2d3bcc,require(_0x1d5b('0x3b')));_0x2d3bcc=_[_0x1d5b('0x4')](_0x2d3bcc,require(_0x1d5b('0x3c')));_0x2d3bcc=_['merge'](_0x2d3bcc,require('../api/whatsappQueueReport/whatsappQueueReport.rpc'));_0x2d3bcc=_['merge'](_0x2d3bcc,require(_0x1d5b('0x3d')));var _0x2a3f48=jayson['server'](_0x2d3bcc)[_0x1d5b('0x3e')]();var _0xf15e44=config[_0x1d5b('0x3f')][_0x1d5b('0x40')]||config['port']+0x1;var _0x425ef8=config[_0x1d5b('0x3f')]['ip']||_0x1d5b('0x41');_0x2a3f48['on'](_0x1d5b('0x42'),function(_0x13796e){return _0x151066(_0x13796e);});_0x2a3f48['listen'](_0xf15e44,_0x425ef8,function(){console[_0x1d5b('0x43')](_0x1d5b('0x44'),_0x425ef8,_0xf15e44);require(_0x1d5b('0x45'))['default']();return _0x510342(_0x1d5b('0x46')+_0x425ef8+':'+_0xf15e44);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 449a1af..739299b 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 _0xf693=['sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','WAIT','error','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','replace','result=','indexOf','startsWith','length','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','function','inherits','sendRequest','prototype','answer','ANSWER','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','join','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits'];(function(_0x277257,_0x3bf305){var _0x1560ff=function(_0x5c2af2){while(--_0x5c2af2){_0x277257['push'](_0x277257['shift']());}};_0x1560ff(++_0x3bf305);}(_0xf693,0x181));var _0x3f69=function(_0x1e8284,_0x300361){_0x1e8284=_0x1e8284-0x0;var _0xbc4db0=_0xf693[_0x1e8284];return _0xbc4db0;};'use strict';var util=require('util');var _=require(_0x3f69('0x0'));var EventEmitter=require(_0x3f69('0x1'))[_0x3f69('0x2')];var AGIReply=require(_0x3f69('0x3'));var AGIError=require(_0x3f69('0x4'));function AGIChannel(_0x3dcdd6){var _0x414ca5=this,_0x527646=new AGIReply(),_0xf2fdd8=![],_0x300282={};EventEmitter[_0x3f69('0x5')](_0x414ca5);_0x3dcdd6[_0x3f69('0x6')](_0x3f69('0x7'));_0x3dcdd6[_0x3f69('0x8')](0x8*0x3c*0x3c*0x3e8);_0x527646[_0x3f69('0x6')](_0x3f69('0x7'));_0x527646['on'](_0x3f69('0x9'),function(_0xad860e){for(var _0x8fd1e5 in _0xad860e){_0x414ca5[_0x8fd1e5]=_0xad860e[_0x8fd1e5];}_0x414ca5[_0x3f69('0xa')](_0x3f69('0xb'));});_0x527646['on'](_0x3f69('0xc'),function(_0x3214f9){if(_0x3214f9[_0x3f69('0xd')]()==_0x3f69('0xe')){_0x414ca5['emit'](_0x3f69('0xe'));return;}if(_0x3214f9[_0x3f69('0xf')](0x0,0xb)==_0x3f69('0x10')){_0xf2fdd8=!![];}if(_0xf2fdd8){_0x300282['rx']+=_0x3214f9+'\x0a';if(_0x3214f9[_0x3f69('0x11')](_0x3f69('0x12'))!=-0x1){_0xf2fdd8=![];}}else{_0x300282['rx']=_0x3214f9;}if(_0xf2fdd8){return;}if(typeof _0x300282['cb']=='function'){var _0x37f1e5=_0x300282['rx'][_0x3f69('0xf')](0x0,0x3),_0x17a969=null,_0x5db35d=null;_0x37f1e5=parseInt(_0x37f1e5);if(isNaN(_0x37f1e5)){_0x300282['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x37f1e5!=0xc8){_0x300282['cb'](null,{'code':_0x37f1e5,'result':-0x1,'extra':'KO'});return;}_0x17a969=_0x300282['rx']['substring'](0x4)[_0x3f69('0x13')](_0x3f69('0x14'),'');if(_0x17a969[_0x3f69('0x15')]('\x20')!=-0x1){_0x17a969=_0x17a969['substr'](0x0,_0x17a969[_0x3f69('0x15')]('\x20'));}if(_[_0x3f69('0x16')](_0x17a969,'-1')){_0x17a969=parseInt(_0x17a969);}_0x5db35d=_0x300282['rx']['split']('\x20');if(_0x5db35d[_0x3f69('0x17')]==0x3){_0x5db35d=_0x5db35d[0x2][_0x3f69('0xf')](0x1,_0x5db35d[0x2][_0x3f69('0x17')]-0x1);}else if(_0x5db35d[_0x3f69('0x17')]>0x3){var _0x18f60a=/\((.+)\)/;var _0x54cfdd=_0x300282['rx']['match'](_0x18f60a);if(_0x54cfdd){_0x5db35d=_0x54cfdd[0x1];}else{_0x5db35d=null;}}else{_0x5db35d=null;}_0x300282['cb'](null,{'code':_0x37f1e5,'result':_0x17a969,'extra':_0x5db35d});}});_0x3dcdd6['on']('error',function(_0x1a3cb5){_0x414ca5['emit']('error',new AGIError('E_AGI_SOCKET_ERROR',_0x1a3cb5[_0x3f69('0x18')]));});_0x3dcdd6['on']('close',function(){_0x414ca5[_0x3f69('0xa')](_0x3f69('0x19'),new AGIError(_0x3f69('0x1a')));});_0x3dcdd6['on'](_0x3f69('0x1b'),function(){_0x414ca5[_0x3f69('0xa')](_0x3f69('0x1b'),new AGIError(_0x3f69('0x1c')));_0x3dcdd6['destroy']();});_0x3dcdd6[_0x3f69('0x1d')](_0x527646);this[_0x3f69('0x1e')]=function(_0x1e99eb,_0x461aa9){var _0x1e99eb=_0x1e99eb||'',_0x461aa9=typeof _0x461aa9==_0x3f69('0x1f')?_0x461aa9:new Function();_0x300282={'tx':_0x1e99eb,'rx':'','cb':_0x461aa9};_0x3dcdd6['write'](_0x1e99eb+'\x0a');},this[_0x3f69('0x19')]=function(){_0x3dcdd6['destroy']();};}util[_0x3f69('0x20')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x3f69('0x21')]=function(_0x5a9c52){return this[_0x3f69('0x1e')]['sync'](this,_0x5a9c52);};AGIChannel[_0x3f69('0x22')][_0x3f69('0x23')]=function(){return this['sendRequest'](_0x3f69('0x24'));};AGIChannel[_0x3f69('0x22')]['getData']=function(_0x3605ad,_0x4e0966,_0x42c056){_0x3605ad=_0x3605ad===undefined?_0x3f69('0x25'):_0x3605ad;_0x4e0966=_0x4e0966===undefined?'5':_0x4e0966;_0x42c056=_0x42c056===undefined?'1':_0x42c056;return this[_0x3f69('0x21')](util[_0x3f69('0x26')](_0x3f69('0x27'),_0x3605ad,_0x4e0966*0x3e8,_0x42c056));};AGIChannel[_0x3f69('0x22')][_0x3f69('0x28')]=function(_0x534a0c){_0x534a0c=_0x534a0c||_0x3f69('0x29');return this[_0x3f69('0x21')](util[_0x3f69('0x26')](_0x3f69('0x2a'),_0x534a0c));};AGIChannel[_0x3f69('0x22')][_0x3f69('0x2b')]=function(_0x2926c9,_0x5b7148){if(_['isArray'](_0x5b7148)){return this['sendRequest'](util[_0x3f69('0x26')]('EXEC\x20%s\x20%s',_0x2926c9,_0x5b7148[_0x3f69('0x2c')](',')));}return this[_0x3f69('0x21')](util[_0x3f69('0x26')](_0x3f69('0x2d'),_0x2926c9,_0x5b7148));};AGIChannel[_0x3f69('0x22')][_0x3f69('0x2e')]=function(_0x11597f){return this[_0x3f69('0x21')](util[_0x3f69('0x26')](_0x3f69('0x2f'),_0x11597f));};AGIChannel['prototype'][_0x3f69('0x30')]=function(_0x451a1f){return this['sendRequest'](util[_0x3f69('0x26')](_0x3f69('0x31'),_0x451a1f));};AGIChannel[_0x3f69('0x22')][_0x3f69('0x32')]=function(_0x8ae9fb){return this[_0x3f69('0x21')](util['format']('SET\x20PRIORITY\x20%s',_0x8ae9fb));};AGIChannel[_0x3f69('0x22')][_0x3f69('0xe')]=function(){return this[_0x3f69('0x21')]('HANGUP');};AGIChannel[_0x3f69('0x22')][_0x3f69('0x33')]=function(_0x255e40,_0x419d7e){var _0x581d54=_[_0x3f69('0x34')](_0x419d7e)||_[_0x3f69('0x35')](_0x419d7e)?_0x419d7e[_0x3f69('0x36')]():_0x419d7e;return this['sendRequest'](util[_0x3f69('0x26')](_0x3f69('0x37'),_0x255e40,_0x581d54?_0x581d54[_0x3f69('0x36')]()[_0x3f69('0x13')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x3f69('0x22')][_0x3f69('0x38')]=function(_0x3f4b0a,_0x3b24f4){return this[_0x3f69('0x21')](util[_0x3f69('0x26')](_0x3f69('0x39'),_0x3f4b0a,_0x3b24f4));};AGIChannel[_0x3f69('0x22')][_0x3f69('0x3a')]=function(_0x529522,_0x494b69){return this[_0x3f69('0x21')](util[_0x3f69('0x26')]('SAY\x20DIGITS\x20%s\x20%s',_0x529522,_0x494b69));};AGIChannel[_0x3f69('0x22')][_0x3f69('0x3b')]=function(_0x27b2c0,_0x25f6c6){return this['sendRequest'](util[_0x3f69('0x26')](_0x3f69('0x3c'),_0x27b2c0,_0x25f6c6));};AGIChannel['prototype'][_0x3f69('0x3d')]=function(_0x54bb87,_0x44971b,_0x10d2b7){_0x44971b=_0x44971b||this['extension'];_0x10d2b7=_0x10d2b7||0x1;this['setContext'](_0x54bb87);this[_0x3f69('0x30')](_0x44971b);this['setPriority'](_0x10d2b7);return this[_0x3f69('0x28')](util[_0x3f69('0x26')]('GOTO\x20%s\x20%s\x20%s',_0x54bb87,_0x44971b,_0x10d2b7));};AGIChannel['prototype'][_0x3f69('0x3e')]=function(_0x34035f){return this['sendRequest'](util['format'](_0x3f69('0x3f'),_0x34035f));};AGIChannel[_0x3f69('0x22')][_0x3f69('0x40')]=function(_0x2247ee,_0x1f66b8,_0x3ba4dd,_0x146c9,_0x2d992f,_0x4e9702){_0x1f66b8=_0x1f66b8||'wav';_0x3ba4dd=_0x3ba4dd||'';_0x146c9=_0x146c9===undefined?-0x1:_0x146c9==='-1'?-0x1:_0x146c9*0x3e8;_0x2d992f=_0x2d992f===undefined?'':'s='+_0x2d992f;_0x4e9702=_0x4e9702?_0x3f69('0x41'):'';return this[_0x3f69('0x21')](util[_0x3f69('0x26')]('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x2247ee,_0x1f66b8,_0x3ba4dd,_0x146c9,_0x4e9702,_0x2d992f));};AGIChannel[_0x3f69('0x22')]['streamFile']=function(_0x2af029,_0x5ed579){_0x5ed579=_0x5ed579||'';return this[_0x3f69('0x21')](util['format'](_0x3f69('0x42'),_0x2af029,_0x5ed579));};AGIChannel['prototype']['agi']=function(_0x5bd3fb){return this[_0x3f69('0x2b')](_0x3f69('0x43'),_0x5bd3fb);};AGIChannel[_0x3f69('0x22')][_0x3f69('0x44')]=function(_0x35c25d){return this[_0x3f69('0x2b')](_0x3f69('0x45'),_0x35c25d);};AGIChannel[_0x3f69('0x22')][_0x3f69('0x46')]=function(_0x293327,_0x1783ba){this[_0x3f69('0x28')](util[_0x3f69('0x26')](_0x3f69('0x47'),_0x293327['id'],_0x293327[_0x3f69('0x48')],_0x1783ba));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x3f69('0x49')]=AGIChannel; \ No newline at end of file +var _0x6f8e=['command','write','inherits','prototype','sync','sendRequest','ANSWER','getData','beep','format','noop','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','setVariable','isNumber','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','setExtension','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','exec','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','lodash','events','./reply','call','setEncoding','utf8','setTimeout','headers','ready','line','toLowerCase','hangup','emit','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe'];(function(_0x3b0c35,_0x19bcbe){var _0x3e1971=function(_0x762a43){while(--_0x762a43){_0x3b0c35['push'](_0x3b0c35['shift']());}};_0x3e1971(++_0x19bcbe);}(_0x6f8e,0x15a));var _0xe6f8=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x6f8e[_0x5ddb1c];return _0x354adc;};'use strict';var util=require(_0xe6f8('0x0'));var _=require(_0xe6f8('0x1'));var EventEmitter=require(_0xe6f8('0x2'))['EventEmitter'];var AGIReply=require(_0xe6f8('0x3'));var AGIError=require('./error');function AGIChannel(_0x50033d){var _0x448909=this,_0x1ca3f0=new AGIReply(),_0x99844e=![],_0x2c9515={};EventEmitter[_0xe6f8('0x4')](_0x448909);_0x50033d[_0xe6f8('0x5')](_0xe6f8('0x6'));_0x50033d[_0xe6f8('0x7')](0x8*0x3c*0x3c*0x3e8);_0x1ca3f0['setEncoding'](_0xe6f8('0x6'));_0x1ca3f0['on'](_0xe6f8('0x8'),function(_0x3ec0b2){for(var _0x1524dd in _0x3ec0b2){_0x448909[_0x1524dd]=_0x3ec0b2[_0x1524dd];}_0x448909['emit'](_0xe6f8('0x9'));});_0x1ca3f0['on'](_0xe6f8('0xa'),function(_0x1e3610){if(_0x1e3610[_0xe6f8('0xb')]()==_0xe6f8('0xc')){_0x448909[_0xe6f8('0xd')](_0xe6f8('0xc'));return;}if(_0x1e3610[_0xe6f8('0xe')](0x0,0xb)==_0xe6f8('0xf')){_0x99844e=!![];}if(_0x99844e){_0x2c9515['rx']+=_0x1e3610+'\x0a';if(_0x1e3610[_0xe6f8('0x10')](_0xe6f8('0x11'))!=-0x1){_0x99844e=![];}}else{_0x2c9515['rx']=_0x1e3610;}if(_0x99844e){return;}if(typeof _0x2c9515['cb']==_0xe6f8('0x12')){var _0x4d7669=_0x2c9515['rx'][_0xe6f8('0xe')](0x0,0x3),_0xa7df3c=null,_0x31679a=null;_0x4d7669=parseInt(_0x4d7669);if(isNaN(_0x4d7669)){_0x2c9515['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xe6f8('0x13')});return;}if(_0x4d7669!=0xc8){_0x2c9515['cb'](null,{'code':_0x4d7669,'result':-0x1,'extra':'KO'});return;}_0xa7df3c=_0x2c9515['rx']['substring'](0x4)[_0xe6f8('0x14')](_0xe6f8('0x15'),'');if(_0xa7df3c[_0xe6f8('0x16')]('\x20')!=-0x1){_0xa7df3c=_0xa7df3c['substr'](0x0,_0xa7df3c[_0xe6f8('0x16')]('\x20'));}if(_[_0xe6f8('0x17')](_0xa7df3c,'-1')){_0xa7df3c=parseInt(_0xa7df3c);}_0x31679a=_0x2c9515['rx'][_0xe6f8('0x18')]('\x20');if(_0x31679a[_0xe6f8('0x19')]==0x3){_0x31679a=_0x31679a[0x2][_0xe6f8('0xe')](0x1,_0x31679a[0x2][_0xe6f8('0x19')]-0x1);}else if(_0x31679a[_0xe6f8('0x19')]>0x3){var _0x31d72a=/\((.+)\)/;var _0x2e71c0=_0x2c9515['rx'][_0xe6f8('0x1a')](_0x31d72a);if(_0x2e71c0){_0x31679a=_0x2e71c0[0x1];}else{_0x31679a=null;}}else{_0x31679a=null;}_0x2c9515['cb'](null,{'code':_0x4d7669,'result':_0xa7df3c,'extra':_0x31679a});}});_0x50033d['on'](_0xe6f8('0x1b'),function(_0x225a29){_0x448909[_0xe6f8('0xd')]('error',new AGIError(_0xe6f8('0x1c'),_0x225a29['code']));});_0x50033d['on']('close',function(){_0x448909[_0xe6f8('0xd')](_0xe6f8('0x1d'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x50033d['on'](_0xe6f8('0x1e'),function(){_0x448909[_0xe6f8('0xd')](_0xe6f8('0x1e'),new AGIError(_0xe6f8('0x1f')));_0x50033d[_0xe6f8('0x20')]();});_0x50033d[_0xe6f8('0x21')](_0x1ca3f0);this[_0xe6f8('0x22')]=function(_0x582dcc,_0x37ab06){var _0x582dcc=_0x582dcc||'',_0x37ab06=typeof _0x37ab06==_0xe6f8('0x12')?_0x37ab06:new Function();_0x2c9515={'tx':_0x582dcc,'rx':'','cb':_0x37ab06};_0x50033d[_0xe6f8('0x23')](_0x582dcc+'\x0a');},this[_0xe6f8('0x1d')]=function(){_0x50033d[_0xe6f8('0x20')]();};}util[_0xe6f8('0x24')](AGIChannel,EventEmitter);AGIChannel[_0xe6f8('0x25')]['sendRequest']=function(_0x52c810){return this[_0xe6f8('0x22')][_0xe6f8('0x26')](this,_0x52c810);};AGIChannel[_0xe6f8('0x25')]['answer']=function(){return this[_0xe6f8('0x27')](_0xe6f8('0x28'));};AGIChannel[_0xe6f8('0x25')][_0xe6f8('0x29')]=function(_0x3ee83d,_0x2abe5d,_0x4fc462){_0x3ee83d=_0x3ee83d===undefined?_0xe6f8('0x2a'):_0x3ee83d;_0x2abe5d=_0x2abe5d===undefined?'5':_0x2abe5d;_0x4fc462=_0x4fc462===undefined?'1':_0x4fc462;return this[_0xe6f8('0x27')](util[_0xe6f8('0x2b')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x3ee83d,_0x2abe5d*0x3e8,_0x4fc462));};AGIChannel[_0xe6f8('0x25')][_0xe6f8('0x2c')]=function(_0x5e023e){_0x5e023e=_0x5e023e||'NO\x20MESSAGE';return this['sendRequest'](util['format'](_0xe6f8('0x2d'),_0x5e023e));};AGIChannel[_0xe6f8('0x25')]['exec']=function(_0x45ae3d,_0x3cee1d){if(_[_0xe6f8('0x2e')](_0x3cee1d)){return this['sendRequest'](util['format'](_0xe6f8('0x2f'),_0x45ae3d,_0x3cee1d[_0xe6f8('0x30')](',')));}return this['sendRequest'](util[_0xe6f8('0x2b')]('EXEC\x20%s\x20%s',_0x45ae3d,_0x3cee1d));};AGIChannel[_0xe6f8('0x25')][_0xe6f8('0x31')]=function(_0x301c84){return this['sendRequest'](util[_0xe6f8('0x2b')]('SET\x20CONTEXT\x20%s',_0x301c84));};AGIChannel[_0xe6f8('0x25')]['setExtension']=function(_0x4f6fdd){return this[_0xe6f8('0x27')](util[_0xe6f8('0x2b')](_0xe6f8('0x32'),_0x4f6fdd));};AGIChannel[_0xe6f8('0x25')][_0xe6f8('0x33')]=function(_0x39d073){return this['sendRequest'](util[_0xe6f8('0x2b')](_0xe6f8('0x34'),_0x39d073));};AGIChannel['prototype']['hangup']=function(){return this[_0xe6f8('0x27')]('HANGUP');};AGIChannel[_0xe6f8('0x25')][_0xe6f8('0x35')]=function(_0x3d180b,_0x3208f0){var _0x2fb4ba=_['isBoolean'](_0x3208f0)||_[_0xe6f8('0x36')](_0x3208f0)?_0x3208f0['toString']():_0x3208f0;return this[_0xe6f8('0x27')](util[_0xe6f8('0x2b')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x3d180b,_0x2fb4ba?_0x2fb4ba['toString']()[_0xe6f8('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xe6f8('0x25')][_0xe6f8('0x37')]=function(_0x272eb1,_0x24bbc3){return this[_0xe6f8('0x27')](util['format'](_0xe6f8('0x38'),_0x272eb1,_0x24bbc3));};AGIChannel[_0xe6f8('0x25')][_0xe6f8('0x39')]=function(_0x2cd8a2,_0x15500c){return this[_0xe6f8('0x27')](util['format'](_0xe6f8('0x3a'),_0x2cd8a2,_0x15500c));};AGIChannel[_0xe6f8('0x25')][_0xe6f8('0x3b')]=function(_0x4761e3,_0x3a15e2){return this[_0xe6f8('0x27')](util[_0xe6f8('0x2b')](_0xe6f8('0x3c'),_0x4761e3,_0x3a15e2));};AGIChannel[_0xe6f8('0x25')][_0xe6f8('0x3d')]=function(_0x11c43f,_0x4b2e12,_0xa87cb9){_0x4b2e12=_0x4b2e12||this[_0xe6f8('0x3e')];_0xa87cb9=_0xa87cb9||0x1;this[_0xe6f8('0x31')](_0x11c43f);this[_0xe6f8('0x3f')](_0x4b2e12);this[_0xe6f8('0x33')](_0xa87cb9);return this[_0xe6f8('0x2c')](util[_0xe6f8('0x2b')](_0xe6f8('0x40'),_0x11c43f,_0x4b2e12,_0xa87cb9));};AGIChannel[_0xe6f8('0x25')]['getVariable']=function(_0x3ba474){return this[_0xe6f8('0x27')](util[_0xe6f8('0x2b')](_0xe6f8('0x41'),_0x3ba474));};AGIChannel[_0xe6f8('0x25')][_0xe6f8('0x42')]=function(_0x434ef4,_0x1db2a5,_0x77717b,_0x353310,_0x2f38a1,_0x3fb216){_0x1db2a5=_0x1db2a5||'wav';_0x77717b=_0x77717b||'';_0x353310=_0x353310===undefined?-0x1:_0x353310==='-1'?-0x1:_0x353310*0x3e8;_0x2f38a1=_0x2f38a1===undefined?'':'s='+_0x2f38a1;_0x3fb216=_0x3fb216?'BEEP':'';return this[_0xe6f8('0x27')](util[_0xe6f8('0x2b')](_0xe6f8('0x43'),_0x434ef4,_0x1db2a5,_0x77717b,_0x353310,_0x3fb216,_0x2f38a1));};AGIChannel['prototype'][_0xe6f8('0x44')]=function(_0x10c3bb,_0x25288a){_0x25288a=_0x25288a||'';return this[_0xe6f8('0x27')](util[_0xe6f8('0x2b')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x10c3bb,_0x25288a));};AGIChannel[_0xe6f8('0x25')][_0xe6f8('0x45')]=function(_0x38c246){return this[_0xe6f8('0x46')](_0xe6f8('0x47'),_0x38c246);};AGIChannel[_0xe6f8('0x25')][_0xe6f8('0x48')]=function(_0x2c250f){return this[_0xe6f8('0x46')](_0xe6f8('0x49'),_0x2c250f);};AGIChannel['prototype']['error']=function(_0x44e2c7,_0xffc4e5){this[_0xe6f8('0x2c')](util[_0xe6f8('0x2b')](_0xe6f8('0x4a'),_0x44e2c7['id'],_0x44e2c7[_0xe6f8('0x4b')],_0xffc4e5));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index c13a56b..5a7bb4e 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 _0xf07b=['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','format','name','exports','util','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0xf07b,0x19b));var _0xbf07=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xf07b[_0x3ab51d];return _0x29a04e;};'use strict';var util=require(_0xbf07('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xbf07('0x1'),'E_AGI_SERVER_CLOSE':_0xbf07('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0xbf07('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0xbf07('0x4'),'E_AGI_SOCKET_ERROR':_0xbf07('0x5'),'E_AGI_SOCKET_CLOSE':_0xbf07('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xbf07('0x7'),'E_AGI_COMMAND_EMPTY':_0xbf07('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xbf07('0x9'),'E_AGI_IVR_ENTRY':_0xbf07('0xa')};function AGIError(_0x280b86){var _0x280b86=_0x280b86||null,_0x1ef7be=_0x1ef7be||[],_0xcdcc12=0x1,_0x2c6212='';if(!error[_0x280b86]){_0x280b86=_0xbf07('0xb');}_0x1ef7be['push'](error[_0x280b86]);while(arguments[_0xcdcc12]){_0x1ef7be[_0xbf07('0xc')](arguments[_0xcdcc12]);_0xcdcc12++;}_0x2c6212=util[_0xbf07('0xd')]['apply'](util,_0x1ef7be);this['message']=_0x2c6212;this[_0xbf07('0xe')]=_0x280b86;}module[_0xbf07('0xf')]=AGIError; \ No newline at end of file +var _0x68fe=['name','util','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.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','apply','message'];(function(_0x4e6e52,_0x6e340b){var _0x5779d9=function(_0x472604){while(--_0x472604){_0x4e6e52['push'](_0x4e6e52['shift']());}};_0x5779d9(++_0x6e340b);}(_0x68fe,0xc4));var _0xe68f=function(_0x3dac27,_0x1bcf24){_0x3dac27=_0x3dac27-0x0;var _0x2281d5=_0x68fe[_0x3dac27];return _0x2281d5;};'use strict';var util=require(_0xe68f('0x0'));var error={'E_AGI_UNDEFINED':_0xe68f('0x1'),'E_AGI_ARGUMENT_PORT':_0xe68f('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0xe68f('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xe68f('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0xe68f('0x5'),'E_AGI_SOCKET_CLOSE':_0xe68f('0x6'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0xe68f('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xe68f('0x8'),'E_AGI_IVR_ENTRY':_0xe68f('0x9')};function AGIError(_0x50074){var _0x50074=_0x50074||null,_0x21a3be=_0x21a3be||[],_0x6e0a42=0x1,_0x2630ec='';if(!error[_0x50074]){_0x50074=_0xe68f('0xa');}_0x21a3be[_0xe68f('0xb')](error[_0x50074]);while(arguments[_0x6e0a42]){_0x21a3be[_0xe68f('0xb')](arguments[_0x6e0a42]);_0x6e0a42++;}_0x2630ec=util['format'][_0xe68f('0xc')](util,_0x21a3be);this[_0xe68f('0xd')]=_0x2630ec;this[_0xe68f('0xe')]=_0x50074;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index aef5d7b..9ef075b 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb01=['EventEmitter','./error','../../config/environment','redis','defaults','localhost','subscribe','emit','error','E_AGI_SERVER_ERROR','message','projectUpdate','lodash','events'];(function(_0x4e5fc8,_0x1ff94c){var _0x425116=function(_0x31b7af){while(--_0x31b7af){_0x4e5fc8['push'](_0x4e5fc8['shift']());}};_0x425116(++_0x1ff94c);}(_0xeb01,0x14e));var _0x1eb0=function(_0x209dd8,_0x3e8fe6){_0x209dd8=_0x209dd8-0x0;var _0x1b171c=_0xeb01[_0x209dd8];return _0x1b171c;};'use strict';var _=require(_0x1eb0('0x0'));var EventEmitter=require(_0x1eb0('0x1'))[_0x1eb0('0x2')];var Redis=require('ioredis');var AGIError=require(_0x1eb0('0x3'));var config=require(_0x1eb0('0x4'));config[_0x1eb0('0x5')]=_[_0x1eb0('0x6')](config['redis'],{'host':_0x1eb0('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x1eb0('0x5')]);sub[_0x1eb0('0x8')]('agi',function(_0x55d625){if(_0x55d625)return eventEmitter[_0x1eb0('0x9')](_0x1eb0('0xa'),new AGIError(_0x1eb0('0xb'),_0x55d625));});sub['on'](_0x1eb0('0xc'),function(_0x5368e4,_0x2ca26b){if(_0x5368e4!=='agi')return;try{var _0x353c7a=JSON['parse'](_0x2ca26b);eventEmitter[_0x1eb0('0x9')](_0x1eb0('0xd'),_0x353c7a);}catch(_0x165d45){eventEmitter[_0x1eb0('0x9')]('error',new AGIError(_0x1eb0('0xb'),_0x165d45));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xb752=['EventEmitter','ioredis','./error','../../config/environment','redis','defaults','subscribe','agi','emit','error','E_AGI_SERVER_ERROR','events'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb752,0x107));var _0x2b75=function(_0x3cfad3,_0x2e7f32){_0x3cfad3=_0x3cfad3-0x0;var _0x1c5b45=_0xb752[_0x3cfad3];return _0x1c5b45;};'use strict';var _=require('lodash');var EventEmitter=require(_0x2b75('0x0'))[_0x2b75('0x1')];var Redis=require(_0x2b75('0x2'));var AGIError=require(_0x2b75('0x3'));var config=require(_0x2b75('0x4'));config[_0x2b75('0x5')]=_[_0x2b75('0x6')](config[_0x2b75('0x5')],{'host':'localhost','port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x2b75('0x5')]);sub[_0x2b75('0x7')](_0x2b75('0x8'),function(_0x186360){if(_0x186360)return eventEmitter[_0x2b75('0x9')](_0x2b75('0xa'),new AGIError(_0x2b75('0xb'),_0x186360));});sub['on']('message',function(_0x5a5bbd,_0x3bd80d){if(_0x5a5bbd!==_0x2b75('0x8'))return;try{var _0x201aae=JSON['parse'](_0x3bd80d);eventEmitter[_0x2b75('0x9')]('projectUpdate',_0x201aae);}catch(_0x31d7e9){eventEmitter[_0x2b75('0x9')]('error',new AGIError(_0x2b75('0xb'),_0x31d7e9));}});module['exports']={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 3da6422..8997843 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 _0x66d8=['max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getdigits','vertices','edges','numberOfEdges','addVertex','prototype','addEdge','push','size','relations','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','no\x20edge/s\x20available','split','agicommand','vswitch','target','default','invalid','default\x20on\x20switch\x20not\x20found','includes'];(function(_0x473159,_0x38f4dc){var _0x181e7a=function(_0x33f205){while(--_0x33f205){_0x473159['push'](_0x473159['shift']());}};_0x181e7a(++_0x38f4dc);}(_0x66d8,0x143));var _0x866d=function(_0x3e19da,_0x5797a7){_0x3e19da=_0x3e19da-0x0;var _0x369c1c=_0x66d8[_0x3e19da];return _0x369c1c;};'use strict';var _=require(_0x866d('0x0'));var logger=require(_0x866d('0x1'))(_0x866d('0x2'));var verticesWithRetry=[_0x866d('0x3'),_0x866d('0x4'),'getsecretdigits'];var Graph=function(){this[_0x866d('0x5')]={};this[_0x866d('0x6')]={};this[_0x866d('0x7')]=0x0;};Graph['prototype'][_0x866d('0x8')]=function(_0x338125){this['vertices'][_0x338125['id']]=_0x338125;this['edges'][_0x338125['id']]=[];};Graph[_0x866d('0x9')][_0x866d('0xa')]=function(_0x4fb988,_0x49e198,_0x19d742){this[_0x866d('0x6')][_0x4fb988][_0x866d('0xb')]({'target':_0x49e198,'condition':_0x19d742});this[_0x866d('0x7')]+=0x1;};Graph[_0x866d('0x9')][_0x866d('0xc')]=function(){return _['size'](this['vertices']);};Graph[_0x866d('0x9')][_0x866d('0xd')]=function(){return this['numberOfEdges'];};Graph['prototype'][_0x866d('0xe')]=function(_0x49171b){return this[_0x866d('0x5')][_0x49171b];};Graph[_0x866d('0x9')][_0x866d('0xf')]=function(_0x296400,_0x4c1983){if(!this[_0x866d('0x5')][_0x296400]){return logger[_0x866d('0x10')](_0x866d('0x11'));}var _0x282841=_0x4c1983(this[_0x866d('0x5')][_0x296400]);if(!_0x282841){return logger[_0x866d('0x10')](_0x866d('0x12'));}if(this[_0x866d('0x6')][_0x296400][_0x866d('0x13')]===0x0){return logger['info'](_0x866d('0x14'));}for(var _0x586851=0x0,_0x5b717e=[],_0xa16291=![];_0x586851\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','hangup','find','handleNotFound','production','handleUnpublished','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','finally','./server','listening','connection','lodash','syncho','util','../../config/environment','../../config/logger','agi','./events','defaults','127.0.0.1','projectUpdate','error','stack','findIndex','deleted','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','createSquareReport','then','catch'];(function(_0x24a82,_0x836580){var _0x37095d=function(_0x5bb2fc){while(--_0x5bb2fc){_0x24a82['push'](_0x24a82['shift']());}};_0x37095d(++_0x836580);}(_0x1993,0x1e7));var _0x3199=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x1993[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x3199('0x0'));var syncho=require(_0x3199('0x1'));var util=require(_0x3199('0x2'));var config=require(_0x3199('0x3'));var logger=require(_0x3199('0x4'))(_0x3199('0x5'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var Project=require('./project');var AGIEmitter=require(_0x3199('0x6'))['EventEmitter'];var projects=[];config[_0x3199('0x5')]=_[_0x3199('0x7')](config[_0x3199('0x5')],{'ip':_0x3199('0x8'),'port':0x11dd});AGIEmitter['on'](_0x3199('0x9'),projectUpdateHandler);function connectionHandler(_0x185abe){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x185abe);agiHandler(_0x185abe);}catch(_0x1dc2db){logger[_0x3199('0xa')](_0x1dc2db[_0x3199('0xb')]);}});});}function projectUpdateHandler(_0xcc5ee9){try{var _0x257ae0=_[_0x3199('0xc')](projects,['id',_0xcc5ee9['id']]);if(_0x257ae0>-0x1){if(_0xcc5ee9[_0x3199('0xd')]===!![]){projects['splice'](_0x257ae0,0x1);}else{projects[_0x257ae0]=_0xcc5ee9;}}else{projects[_0x3199('0xe')](_0xcc5ee9);}}catch(_0x697556){logger['error'](_0x697556[_0x3199('0xb')]);}}function listeningHandler(){console[_0x3199('0xf')](_0x3199('0x10'),config[_0x3199('0x5')][_0x3199('0x11')]);logger[_0x3199('0x12')](util[_0x3199('0x13')](_0x3199('0x14'),config[_0x3199('0x5')]['ip'],config[_0x3199('0x5')][_0x3199('0x11')]));}function errorHandler(_0x186512){if(_0x186512&&_0x186512[_0x3199('0x15')]&&_0x186512[_0x3199('0x16')]){logger[_0x3199('0xa')](util[_0x3199('0x13')]('[%s]\x20%s',_0x186512[_0x3199('0x15')],_0x186512[_0x3199('0x16')]));}else{logger[_0x3199('0xa')](util[_0x3199('0x13')](_0x3199('0x17'),_0x186512[_0x3199('0xb')]));}}function closeHandler(){logger['info'](util['format'](_0x3199('0x18'),this['arg_1'],this['calleridname'],this[_0x3199('0x19')],this[_0x3199('0x1a')],this[_0x3199('0x1b')]));try{createSquareReport(this);}catch(_0x1d09b8){logger[_0x3199('0xa')](_0x1d09b8[_0x3199('0xb')]);}}function timeoutHandler(){logger[_0x3199('0x12')](util[_0x3199('0x13')](_0x3199('0x1c'),this[_0x3199('0x1d')],this[_0x3199('0x1e')],this[_0x3199('0x19')],this['dnid'],this['uniqueid']));}function hangupHandler(){logger[_0x3199('0x12')](util[_0x3199('0x13')](_0x3199('0x1f'),this['arg_1'],this[_0x3199('0x1e')],this[_0x3199('0x19')],this[_0x3199('0x1a')],this[_0x3199('0x1b')]));this['evtHangup']=!![];}function createSquareReport(_0x372d3f,_0x2fdc7f){rpc[_0x3199('0x20')](_0x372d3f)[_0x3199('0x21')](function(_0x108338){if(_0x2fdc7f){_0x2fdc7f(null,_0x108338);}})[_0x3199('0x22')](function(_0x8c32ca){if(_0x2fdc7f){_0x2fdc7f(null,_0x8c32ca);}});}function setChannelVariables(_0x43cba0){for(var _0x3c66c9 in _0x43cba0){if(_0x43cba0[_0x3199('0x23')](_0x3c66c9)){if(_0x3c66c9[_0x3199('0x24')]('agi_')===0x0){_0x43cba0[_0x3c66c9[_0x3199('0x25')](0x4)]=_0x43cba0[_0x3c66c9];delete _0x43cba0[_0x3c66c9];}}}}function agiHandler(_0x3d11f0){logger[_0x3199('0x26')](_0x3199('0x27'),JSON[_0x3199('0x28')](_0x3d11f0,null,0x2));logger['info'](util['format'](_0x3199('0x29'),_0x3d11f0[_0x3199('0x1d')],_0x3d11f0[_0x3199('0x1e')],_0x3d11f0[_0x3199('0x19')],_0x3d11f0['dnid'],_0x3d11f0[_0x3199('0x1b')]));_0x3d11f0['on']('error',errorHandler);_0x3d11f0['on'](_0x3199('0x2a'),closeHandler);_0x3d11f0['on']('timeout',timeoutHandler);_0x3d11f0['evtHangup']=![];_0x3d11f0['on'](_0x3199('0x2b'),hangupHandler);var _0x14b4a2=_[_0x3199('0x2c')](projects,['name',_0x3d11f0[_0x3199('0x1d')]]);if(!_0x14b4a2)return Project[_0x3199('0x2d')](_0x3d11f0);if(!_0x14b4a2[_0x3199('0x2e')])return Project[_0x3199('0x2f')](_0x3d11f0);return Project['initialize'](_0x14b4a2,_0x3d11f0);}function main(){var _0x30d997;return utilLicense[_0x3199('0x30')]()[_0x3199('0x21')](function(_0x54358c){if(!_0x54358c)return;if(_0x54358c[_0x3199('0x31')]){if(_0x54358c[_0x3199('0x32')]&&_0x54358c[_0x3199('0x32')]>0x0){logger[_0x3199('0x12')](util[_0x3199('0x13')]('[LICENSE]\x20CHANNELS:\x20%s',_0x54358c['callysquare']));_0x30d997=_0x54358c[_0x3199('0x32')];}else{logger['info'](_0x3199('0x33'));}}else{logger['info'](_0x3199('0x34'));_0x30d997=-0x1;}})[_0x3199('0x21')](function(){return Project[_0x3199('0x35')]();})[_0x3199('0x21')](function(_0x5c67ec){projects=_0x5c67ec;return;})[_0x3199('0x22')](function(_0x5dcaa8){logger[_0x3199('0xa')]('[LICENSE]',_0x5dcaa8['stack']);})[_0x3199('0x36')](function(){var _0x2c3dff=require(_0x3199('0x37'))(config['agi'][_0x3199('0x11')],config[_0x3199('0x5')]['ip'],_0x30d997);_0x2c3dff['on']('error',errorHandler);_0x2c3dff['on'](_0x3199('0x38'),listeningHandler);_0x2c3dff['on'](_0x3199('0x39'),connectionHandler);_0x2c3dff['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0xf9de=['127.0.0.1','nextTick','error','stack','findIndex','deleted','splice','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','[%s]\x20%s','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','catch','indexOf','agi_','substring','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','hangup','find','handleNotFound','handleUnpublished','getLicense','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','listening','connection','lodash','../../config/environment','agi','../../config/license/util','./rpc','./project','./events','EventEmitter','defaults'];(function(_0x582ce5,_0x195e26){var _0x4d4bb5=function(_0x16a7c2){while(--_0x16a7c2){_0x582ce5['push'](_0x582ce5['shift']());}};_0x4d4bb5(++_0x195e26);}(_0xf9de,0x1c7));var _0xef9d=function(_0x4978ff,_0x43edd8){_0x4978ff=_0x4978ff-0x0;var _0x53b488=_0xf9de[_0x4978ff];return _0x53b488;};'use strict';var _=require(_0xef9d('0x0'));var syncho=require('syncho');var util=require('util');var config=require(_0xef9d('0x1'));var logger=require('../../config/logger')(_0xef9d('0x2'));var utilLicense=require(_0xef9d('0x3'));var rpc=require(_0xef9d('0x4'));var Project=require(_0xef9d('0x5'));var AGIEmitter=require(_0xef9d('0x6'))[_0xef9d('0x7')];var projects=[];config[_0xef9d('0x2')]=_[_0xef9d('0x8')](config['agi'],{'ip':_0xef9d('0x9'),'port':0x11dd});AGIEmitter['on']('projectUpdate',projectUpdateHandler);function connectionHandler(_0x10b905){process[_0xef9d('0xa')](function(){syncho(function(){try{setChannelVariables(_0x10b905);agiHandler(_0x10b905);}catch(_0x369fee){logger[_0xef9d('0xb')](_0x369fee[_0xef9d('0xc')]);}});});}function projectUpdateHandler(_0x3b2fd6){try{var _0x3b9454=_[_0xef9d('0xd')](projects,['id',_0x3b2fd6['id']]);if(_0x3b9454>-0x1){if(_0x3b2fd6[_0xef9d('0xe')]===!![]){projects[_0xef9d('0xf')](_0x3b9454,0x1);}else{projects[_0x3b9454]=_0x3b2fd6;}}else{projects['push'](_0x3b2fd6);}}catch(_0x382a0a){logger['error'](_0x382a0a[_0xef9d('0xc')]);}}function listeningHandler(){console[_0xef9d('0x10')](_0xef9d('0x11'),config[_0xef9d('0x2')][_0xef9d('0x12')]);logger[_0xef9d('0x13')](util[_0xef9d('0x14')](_0xef9d('0x15'),config['agi']['ip'],config[_0xef9d('0x2')][_0xef9d('0x12')]));}function errorHandler(_0x4cdcca){if(_0x4cdcca&&_0x4cdcca[_0xef9d('0x16')]&&_0x4cdcca['message']){logger[_0xef9d('0xb')](util[_0xef9d('0x14')](_0xef9d('0x17'),_0x4cdcca[_0xef9d('0x16')],_0x4cdcca[_0xef9d('0x18')]));}else{logger['error'](util[_0xef9d('0x14')](_0xef9d('0x19'),_0x4cdcca[_0xef9d('0xc')]));}}function closeHandler(){logger[_0xef9d('0x13')](util[_0xef9d('0x14')](_0xef9d('0x1a'),this[_0xef9d('0x1b')],this[_0xef9d('0x1c')],this[_0xef9d('0x1d')],this[_0xef9d('0x1e')],this[_0xef9d('0x1f')]));try{createSquareReport(this);}catch(_0x343626){logger[_0xef9d('0xb')](_0x343626[_0xef9d('0xc')]);}}function timeoutHandler(){logger[_0xef9d('0x13')](util[_0xef9d('0x14')](_0xef9d('0x20'),this[_0xef9d('0x1b')],this['calleridname'],this['callerid'],this[_0xef9d('0x1e')],this[_0xef9d('0x1f')]));}function hangupHandler(){logger[_0xef9d('0x13')](util['format'](_0xef9d('0x21'),this['arg_1'],this['calleridname'],this[_0xef9d('0x1d')],this[_0xef9d('0x1e')],this[_0xef9d('0x1f')]));this[_0xef9d('0x22')]=!![];}function createSquareReport(_0x5588e0,_0x3d386e){rpc[_0xef9d('0x23')](_0x5588e0)['then'](function(_0x3f3234){if(_0x3d386e){_0x3d386e(null,_0x3f3234);}})[_0xef9d('0x24')](function(_0x4c254f){if(_0x3d386e){_0x3d386e(null,_0x4c254f);}});}function setChannelVariables(_0xe3e1dd){for(var _0x8067a2 in _0xe3e1dd){if(_0xe3e1dd['hasOwnProperty'](_0x8067a2)){if(_0x8067a2[_0xef9d('0x25')](_0xef9d('0x26'))===0x0){_0xe3e1dd[_0x8067a2[_0xef9d('0x27')](0x4)]=_0xe3e1dd[_0x8067a2];delete _0xe3e1dd[_0x8067a2];}}}}function agiHandler(_0x516804){logger['debug']('variables',JSON[_0xef9d('0x28')](_0x516804,null,0x2));logger[_0xef9d('0x13')](util[_0xef9d('0x14')](_0xef9d('0x29'),_0x516804[_0xef9d('0x1b')],_0x516804[_0xef9d('0x1c')],_0x516804[_0xef9d('0x1d')],_0x516804[_0xef9d('0x1e')],_0x516804['uniqueid']));_0x516804['on'](_0xef9d('0xb'),errorHandler);_0x516804['on'](_0xef9d('0x2a'),closeHandler);_0x516804['on']('timeout',timeoutHandler);_0x516804[_0xef9d('0x22')]=![];_0x516804['on'](_0xef9d('0x2b'),hangupHandler);var _0x147020=_[_0xef9d('0x2c')](projects,[_0xef9d('0x16'),_0x516804[_0xef9d('0x1b')]]);if(!_0x147020)return Project[_0xef9d('0x2d')](_0x516804);if(!_0x147020['production'])return Project[_0xef9d('0x2e')](_0x516804);return Project['initialize'](_0x147020,_0x516804);}function main(){var _0x58f773;return utilLicense[_0xef9d('0x2f')]()[_0xef9d('0x30')](function(_0x44a75f){if(!_0x44a75f)return;if(_0x44a75f[_0xef9d('0x31')]){if(_0x44a75f[_0xef9d('0x32')]&&_0x44a75f[_0xef9d('0x32')]>0x0){logger[_0xef9d('0x13')](util[_0xef9d('0x14')]('[LICENSE]\x20CHANNELS:\x20%s',_0x44a75f[_0xef9d('0x32')]));_0x58f773=_0x44a75f[_0xef9d('0x32')];}else{logger[_0xef9d('0x13')](_0xef9d('0x33'));}}else{logger[_0xef9d('0x13')](_0xef9d('0x34'));_0x58f773=-0x1;}})[_0xef9d('0x30')](function(){return Project[_0xef9d('0x35')]();})[_0xef9d('0x30')](function(_0xe9196b){projects=_0xe9196b;return;})['catch'](function(_0x45f95b){logger[_0xef9d('0xb')](_0xef9d('0x36'),_0x45f95b[_0xef9d('0xc')]);})[_0xef9d('0x37')](function(){var _0x562c43=require('./server')(config[_0xef9d('0x2')][_0xef9d('0x12')],config[_0xef9d('0x2')]['ip'],_0x58f773);_0x562c43['on']('error',errorHandler);_0x562c43['on'](_0xef9d('0x38'),listeningHandler);_0x562c43['on'](_0xef9d('0x39'),connectionHandler);_0x562c43['on'](_0xef9d('0x2a'),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 fe8d6f4..b734cf7 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 _0xf1f1=['sendMailMessage','SendMail','bluebird','client','request','then','error','message'];(function(_0x1274eb,_0x14edc0){var _0x425046=function(_0x3241cf){while(--_0x3241cf){_0x1274eb['push'](_0x1274eb['shift']());}};_0x425046(++_0x14edc0);}(_0xf1f1,0x122));var _0x1f1f=function(_0x51122a,_0x4be905){_0x51122a=_0x51122a-0x0;var _0x2d0bb0=_0xf1f1[_0x51122a];return _0x2d0bb0;};'use strict';var BPromise=require(_0x1f1f('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x1f1f('0x1')]['http']({'port':0x232b});function request(_0x76b205,_0x495d18){return new BPromise(function(_0x1bd199,_0x169695){return client[_0x1f1f('0x2')](_0x76b205,_0x495d18)[_0x1f1f('0x3')](function(_0x17fd78){if(_0x17fd78[_0x1f1f('0x4')]){return _0x169695(_0x17fd78['error'][_0x1f1f('0x5')]);}else{return _0x1bd199(_0x17fd78['result']);}})['catch'](function(_0x513759){return _0x169695(_0x513759);});});}exports[_0x1f1f('0x6')]=function(_0x5821c4,_0x490382){return request(_0x1f1f('0x7'),{'account':_0x5821c4,'message':_0x490382});}; \ No newline at end of file +var _0x3d28=['SendMail','bluebird','jayson/promise','http','then','error','message','result','catch','sendMailMessage'];(function(_0x1d04b5,_0x30792c){var _0x161342=function(_0x94ff92){while(--_0x94ff92){_0x1d04b5['push'](_0x1d04b5['shift']());}};_0x161342(++_0x30792c);}(_0x3d28,0x169));var _0x83d2=function(_0x5df26e,_0x18c475){_0x5df26e=_0x5df26e-0x0;var _0xf4d985=_0x3d28[_0x5df26e];return _0xf4d985;};'use strict';var BPromise=require(_0x83d2('0x0'));var jayson=require(_0x83d2('0x1'));var client=jayson['client'][_0x83d2('0x2')]({'port':0x232b});function request(_0xe7debf,_0x51af10){return new BPromise(function(_0x4a8585,_0x4b340c){return client['request'](_0xe7debf,_0x51af10)[_0x83d2('0x3')](function(_0x3ed0d8){if(_0x3ed0d8[_0x83d2('0x4')]){return _0x4b340c(_0x3ed0d8['error'][_0x83d2('0x5')]);}else{return _0x4a8585(_0x3ed0d8[_0x83d2('0x6')]);}})[_0x83d2('0x7')](function(_0x50fce7){return _0x4b340c(_0x50fce7);});});}exports[_0x83d2('0x8')]=function(_0x77d65,_0x206257){return request(_0x83d2('0x9'),{'account':_0x77d65,'message':_0x206257});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 381f56a..d7d55a7 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x612e=['./mailRpc','getSquareProjects','error','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','target','addEdge','source','toJson','mxGraphModel','root','inspect','production','start','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','traverseBFS','clear','vertex','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','toString','agicommand\x20not\x20found','finally','arg_1','uniqueid','isUndefined','stack','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','continueAt','Project\x20%s\x20not\x20published','close','exports','lodash','xml2json','util','../../config/logger','./rpc'];(function(_0x12009b,_0x385bbb){var _0x168254=function(_0x1fbeea){while(--_0x1fbeea){_0x12009b['push'](_0x12009b['shift']());}};_0x168254(++_0x385bbb);}(_0x612e,0xa9));var _0xe612=function(_0x12d085,_0x489d6b){_0x12d085=_0x12d085-0x0;var _0xeee8ce=_0x612e[_0x12d085];return _0xeee8ce;};'use strict';var _=require(_0xe612('0x0'));var moment=require('moment');var parser=require(_0xe612('0x1'));var util=require(_0xe612('0x2'));var logger=require(_0xe612('0x3'))('agi');var rpc=require(_0xe612('0x4'));var mailRpc=require(_0xe612('0x5'));var Graph=require('./graph');var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xe612('0x6')]()['catch'](function(_0x4c82be){logger[_0xe612('0x7')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x4c82be['stack']);return[];});}function addVertex(_0x455260,_0x25f0fd,_0x118fbb){_0x25f0fd[_0xe612('0x8')]=_0x118fbb;if(_0x25f0fd[_0xe612('0x9')](_0xe612('0xa'))){_0x25f0fd[_0xe612('0xb')]=parseInt(_0x25f0fd[_0xe612('0xa')],0xa);}_0x455260[_0xe612('0xc')](_[_0xe612('0xd')](_0x25f0fd,_0xe612('0xe')));}function initGraph(_0x23345a,_0x342563){var _0x15e905=new Graph();for(var _0x41c115 in _0x23345a){if(_0x23345a[_0xe612('0x9')](_0x41c115)){if(_[_0xe612('0xf')](_0x23345a[_0x41c115])){for(var _0x45b558=0x0;_0x45b558<_0x23345a[_0x41c115]['length'];_0x45b558+=0x1){addVertex(_0x15e905,_0x23345a[_0x41c115][_0x45b558],_0x41c115);}}else{addVertex(_0x15e905,_0x23345a[_0x41c115],_0x41c115);}}}for(var _0x4bf7ee=0x0;_0x4bf7ee<_0x342563[_0xe612('0x10')];_0x4bf7ee+=0x1){if(_0x342563[_0x4bf7ee]['source']&&_0x342563[_0x4bf7ee][_0xe612('0x11')]){_0x15e905[_0xe612('0x12')](_0x342563[_0x4bf7ee][_0xe612('0x13')],_0x342563[_0x4bf7ee][_0xe612('0x11')],_0x342563[_0x4bf7ee]['value']);}}return _0x15e905;}function getRoot(_0x4a80d7){return parser[_0xe612('0x14')](_0x4a80d7,{'object':!![]})[_0xe612('0x15')][_0xe612('0x16')];}function inspect(_0x51be0c){return util[_0xe612('0x17')](_0x51be0c,{'showHidden':![],'depth':null});}function initialize(_0x3d28f5,_0x29213f){var _0x413ffc=getRoot(_0x3d28f5[_0xe612('0x18')]);if(!_0x413ffc||!_0x413ffc[_0xe612('0x19')])return;var _0x4eb136,_0x318451,_0x362b12;logger[_0xe612('0x1a')]('root',JSON[_0xe612('0x1b')](_0x413ffc,null,0x2));_0x29213f[_0xe612('0x1c')]=moment()[_0xe612('0x1d')](_0xe612('0x1e'));_0x4eb136=initGraph(_[_0xe612('0xd')](_0x413ffc,_0xe612('0xe')),_0x413ffc[_0xe612('0xe')]);_0x318451=new Vertices(_0x29213f,rpc,mailRpc);logger[_0xe612('0x1f')](util[_0xe612('0x1d')](_0xe612('0x20'),_0x29213f['arg_1'],_0x29213f[_0xe612('0x21')],_0x29213f[_0xe612('0x22')],_0x29213f[_0xe612('0x23')],_0x29213f['uniqueid']));_0x4eb136[_0xe612('0x24')](_0x413ffc[_0xe612('0x19')]['id'],function(_0x897545){try{_0x897545=_0x318451[_0xe612('0x25')](_0x897545);logger['debug'](_0xe612('0x26'),JSON[_0xe612('0x1b')](_0x897545,null,0x2));if(_0x897545[_0xe612('0x8')]==='gotoc'){logger[_0xe612('0x1f')](_0xe612('0x27'));_0x29213f[_0xe612('0x28')]=_0x897545[_0xe612('0x28')]||_0x29213f['context'];_0x29213f[_0xe612('0x29')]=_0x897545[_0xe612('0x29')];_0x29213f['priority']=_0x897545[_0xe612('0x2a')]?_0x897545['priority']-0x1:0x1;return null;}else if(_0x897545&&_0x318451[_0x897545['agicommand']]){_0x362b12=_0x318451[_0x897545[_0xe612('0x8')]](_0x897545);logger[_0xe612('0x1f')](_0xe612('0x2b'),JSON['stringify'](_0x362b12,null,0x2));if(_0x362b12&&_0x362b12[_0xe612('0x2c')]===AGI_CODE_SUCCESS&&_0x362b12['result']!==AGI_RESULT_ERROR&&!_0x29213f['evtHangup']){logger[_0xe612('0x1a')](_0xe612('0x2b'),inspect(_0x362b12));return _['isUndefined'](_0x362b12[_0xe612('0x2d')])?null:_0x362b12[_0xe612('0x2d')][_0xe612('0x2e')]();}else{logger[_0xe612('0x7')](_0xe612('0x2b'),inspect(_0x362b12));return null;}}else{logger[_0xe612('0x7')](_0xe612('0x2f'));return null;}}catch(_0x1cf560){logger[_0xe612('0x7')](_0x1cf560['stack']);return null;}});if(_0x413ffc[_0xe612('0x30')]){logger['info'](util['format']('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x29213f[_0xe612('0x31')],_0x29213f[_0xe612('0x21')],_0x29213f[_0xe612('0x22')],_0x29213f[_0xe612('0x23')],_0x29213f[_0xe612('0x32')]));_0x4eb136[_0xe612('0x24')](_0x413ffc['finally']['id'],function(_0x25da1a){try{_0x25da1a=_0x318451[_0xe612('0x25')](_0x25da1a);logger['debug'](_0xe612('0x26'),JSON[_0xe612('0x1b')](_0x25da1a,null,0x2));if(_0x25da1a&&_0x318451[_0x25da1a[_0xe612('0x8')]]){_0x362b12=_0x318451[_0x25da1a[_0xe612('0x8')]](_0x25da1a);if(_0x362b12){logger[_0xe612('0x1a')](_0xe612('0x2b'),inspect(_0x362b12));return _[_0xe612('0x33')](_0x362b12[_0xe612('0x2d')])?null:_0x362b12['result'][_0xe612('0x2e')]();}else{logger['error'](_0xe612('0x2b'),inspect(_0x362b12));return null;}}else{logger[_0xe612('0x7')](_0xe612('0x2f'));return null;}}catch(_0x2021ca){logger[_0xe612('0x7')](_0x2021ca[_0xe612('0x34')]);return null;}});}logger[_0xe612('0x1f')](util[_0xe612('0x1d')](_0xe612('0x35'),_0x29213f['arg_1'],_0x29213f[_0xe612('0x21')],_0x29213f[_0xe612('0x22')],_0x29213f[_0xe612('0x23')],_0x29213f[_0xe612('0x32')]));logger[_0xe612('0x1f')](util[_0xe612('0x1d')]('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x29213f[_0xe612('0x28')],_0x29213f[_0xe612('0x29')],parseInt(_0x29213f['priority'],0xa)+0x1));_0x29213f[_0xe612('0x36')](_0x29213f[_0xe612('0x28')],_0x29213f[_0xe612('0x29')],parseInt(_0x29213f['priority'],0xa)+0x1);_0x29213f['close']();}function handleNotFound(_0x4ba1b1){logger[_0xe612('0x7')](util[_0xe612('0x1d')]('Project\x20%s\x20not\x20found',_0x4ba1b1[_0xe612('0x31')]));_0x4ba1b1['continueAt'](_0x4ba1b1[_0xe612('0x28')],_0x4ba1b1[_0xe612('0x29')],parseInt(_0x4ba1b1[_0xe612('0x2a')],0xa)+0x1);_0x4ba1b1['close']();}function handleUnpublished(_0x5a781a){logger[_0xe612('0x7')](util[_0xe612('0x1d')](_0xe612('0x37'),_0x5a781a[_0xe612('0x31')]));_0x5a781a['continueAt'](_0x5a781a['context'],_0x5a781a[_0xe612('0x29')],parseInt(_0x5a781a[_0xe612('0x2a')],0xa)+0x1);_0x5a781a[_0xe612('0x38')]();}module[_0xe612('0x39')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xabe2=['util','../../config/logger','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','stack','hasOwnProperty','retry','maxRetry','addVertex','omit','isArray','length','source','target','value','mxGraphModel','root','inspect','start','debug','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','mxCell','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','traverseBFS','clear','vertex','agicommand','gotoc','context','extension','priority','result','evtHangup','isUndefined','toString','response','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','lodash','moment','xml2json'];(function(_0x3c3ad3,_0x3b98c1){var _0x2c628f=function(_0x3527e3){while(--_0x3527e3){_0x3c3ad3['push'](_0x3c3ad3['shift']());}};_0x2c628f(++_0x3b98c1);}(_0xabe2,0x1bd));var _0x2abe=function(_0x210d1d,_0x131cc9){_0x210d1d=_0x210d1d-0x0;var _0x5b1608=_0xabe2[_0x210d1d];return _0x5b1608;};'use strict';var _=require(_0x2abe('0x0'));var moment=require(_0x2abe('0x1'));var parser=require(_0x2abe('0x2'));var util=require(_0x2abe('0x3'));var logger=require(_0x2abe('0x4'))('agi');var rpc=require(_0x2abe('0x5'));var mailRpc=require(_0x2abe('0x6'));var Graph=require(_0x2abe('0x7'));var Vertices=require(_0x2abe('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x2abe('0x9')]()[_0x2abe('0xa')](function(_0x36f177){logger[_0x2abe('0xb')](_0x2abe('0xc'),_0x36f177[_0x2abe('0xd')]);return[];});}function addVertex(_0x3492e5,_0x2fa0e6,_0x5f58a7){_0x2fa0e6['agicommand']=_0x5f58a7;if(_0x2fa0e6[_0x2abe('0xe')](_0x2abe('0xf'))){_0x2fa0e6[_0x2abe('0x10')]=parseInt(_0x2fa0e6[_0x2abe('0xf')],0xa);}_0x3492e5[_0x2abe('0x11')](_[_0x2abe('0x12')](_0x2fa0e6,'mxCell'));}function initGraph(_0x225ca9,_0x30d6f2){var _0x232927=new Graph();for(var _0xe61379 in _0x225ca9){if(_0x225ca9[_0x2abe('0xe')](_0xe61379)){if(_[_0x2abe('0x13')](_0x225ca9[_0xe61379])){for(var _0x2fe13d=0x0;_0x2fe13d<_0x225ca9[_0xe61379][_0x2abe('0x14')];_0x2fe13d+=0x1){addVertex(_0x232927,_0x225ca9[_0xe61379][_0x2fe13d],_0xe61379);}}else{addVertex(_0x232927,_0x225ca9[_0xe61379],_0xe61379);}}}for(var _0x2b71aa=0x0;_0x2b71aa<_0x30d6f2[_0x2abe('0x14')];_0x2b71aa+=0x1){if(_0x30d6f2[_0x2b71aa][_0x2abe('0x15')]&&_0x30d6f2[_0x2b71aa][_0x2abe('0x16')]){_0x232927['addEdge'](_0x30d6f2[_0x2b71aa][_0x2abe('0x15')],_0x30d6f2[_0x2b71aa]['target'],_0x30d6f2[_0x2b71aa][_0x2abe('0x17')]);}}return _0x232927;}function getRoot(_0x1fae99){return parser['toJson'](_0x1fae99,{'object':!![]})[_0x2abe('0x18')][_0x2abe('0x19')];}function inspect(_0x2436b6){return util[_0x2abe('0x1a')](_0x2436b6,{'showHidden':![],'depth':null});}function initialize(_0x4327e6,_0x3567fc){var _0x4b8040=getRoot(_0x4327e6['production']);if(!_0x4b8040||!_0x4b8040[_0x2abe('0x1b')])return;var _0x476c80,_0x115093,_0x18e15f;logger[_0x2abe('0x1c')]('root',JSON[_0x2abe('0x1d')](_0x4b8040,null,0x2));_0x3567fc[_0x2abe('0x1e')]=moment()[_0x2abe('0x1f')](_0x2abe('0x20'));_0x476c80=initGraph(_[_0x2abe('0x12')](_0x4b8040,_0x2abe('0x21')),_0x4b8040[_0x2abe('0x21')]);_0x115093=new Vertices(_0x3567fc,rpc,mailRpc);logger[_0x2abe('0x22')](util['format'](_0x2abe('0x23'),_0x3567fc[_0x2abe('0x24')],_0x3567fc[_0x2abe('0x25')],_0x3567fc[_0x2abe('0x26')],_0x3567fc['dnid'],_0x3567fc[_0x2abe('0x27')]));_0x476c80[_0x2abe('0x28')](_0x4b8040[_0x2abe('0x1b')]['id'],function(_0x1ecd2d){try{_0x1ecd2d=_0x115093[_0x2abe('0x29')](_0x1ecd2d);logger[_0x2abe('0x1c')](_0x2abe('0x2a'),JSON['stringify'](_0x1ecd2d,null,0x2));if(_0x1ecd2d[_0x2abe('0x2b')]===_0x2abe('0x2c')){logger['info']('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x3567fc[_0x2abe('0x2d')]=_0x1ecd2d[_0x2abe('0x2d')]||_0x3567fc['context'];_0x3567fc['extension']=_0x1ecd2d[_0x2abe('0x2e')];_0x3567fc[_0x2abe('0x2f')]=_0x1ecd2d[_0x2abe('0x2f')]?_0x1ecd2d[_0x2abe('0x2f')]-0x1:0x1;return null;}else if(_0x1ecd2d&&_0x115093[_0x1ecd2d['agicommand']]){_0x18e15f=_0x115093[_0x1ecd2d[_0x2abe('0x2b')]](_0x1ecd2d);logger[_0x2abe('0x22')]('response',JSON[_0x2abe('0x1d')](_0x18e15f,null,0x2));if(_0x18e15f&&_0x18e15f['code']===AGI_CODE_SUCCESS&&_0x18e15f[_0x2abe('0x30')]!==AGI_RESULT_ERROR&&!_0x3567fc[_0x2abe('0x31')]){logger['debug']('response',inspect(_0x18e15f));return _[_0x2abe('0x32')](_0x18e15f[_0x2abe('0x30')])?null:_0x18e15f[_0x2abe('0x30')][_0x2abe('0x33')]();}else{logger[_0x2abe('0xb')](_0x2abe('0x34'),inspect(_0x18e15f));return null;}}else{logger[_0x2abe('0xb')](_0x2abe('0x35'));return null;}}catch(_0x312de4){logger[_0x2abe('0xb')](_0x312de4[_0x2abe('0xd')]);return null;}});if(_0x4b8040[_0x2abe('0x36')]){logger[_0x2abe('0x22')](util[_0x2abe('0x1f')](_0x2abe('0x37'),_0x3567fc[_0x2abe('0x24')],_0x3567fc[_0x2abe('0x25')],_0x3567fc[_0x2abe('0x26')],_0x3567fc[_0x2abe('0x38')],_0x3567fc[_0x2abe('0x27')]));_0x476c80[_0x2abe('0x28')](_0x4b8040[_0x2abe('0x36')]['id'],function(_0x53a8b9){try{_0x53a8b9=_0x115093[_0x2abe('0x29')](_0x53a8b9);logger[_0x2abe('0x1c')](_0x2abe('0x2a'),JSON['stringify'](_0x53a8b9,null,0x2));if(_0x53a8b9&&_0x115093[_0x53a8b9[_0x2abe('0x2b')]]){_0x18e15f=_0x115093[_0x53a8b9[_0x2abe('0x2b')]](_0x53a8b9);if(_0x18e15f){logger['debug'](_0x2abe('0x34'),inspect(_0x18e15f));return _['isUndefined'](_0x18e15f[_0x2abe('0x30')])?null:_0x18e15f['result'][_0x2abe('0x33')]();}else{logger[_0x2abe('0xb')](_0x2abe('0x34'),inspect(_0x18e15f));return null;}}else{logger['error'](_0x2abe('0x35'));return null;}}catch(_0x3cc340){logger[_0x2abe('0xb')](_0x3cc340['stack']);return null;}});}logger[_0x2abe('0x22')](util['format'](_0x2abe('0x39'),_0x3567fc['arg_1'],_0x3567fc[_0x2abe('0x25')],_0x3567fc[_0x2abe('0x26')],_0x3567fc['dnid'],_0x3567fc[_0x2abe('0x27')]));logger[_0x2abe('0x22')](util[_0x2abe('0x1f')](_0x2abe('0x3a'),_0x3567fc[_0x2abe('0x2d')],_0x3567fc[_0x2abe('0x2e')],parseInt(_0x3567fc[_0x2abe('0x2f')],0xa)+0x1));_0x3567fc[_0x2abe('0x3b')](_0x3567fc[_0x2abe('0x2d')],_0x3567fc[_0x2abe('0x2e')],parseInt(_0x3567fc['priority'],0xa)+0x1);_0x3567fc[_0x2abe('0x3c')]();}function handleNotFound(_0x5af7b3){logger[_0x2abe('0xb')](util['format'](_0x2abe('0x3d'),_0x5af7b3[_0x2abe('0x24')]));_0x5af7b3[_0x2abe('0x3b')](_0x5af7b3[_0x2abe('0x2d')],_0x5af7b3[_0x2abe('0x2e')],parseInt(_0x5af7b3[_0x2abe('0x2f')],0xa)+0x1);_0x5af7b3[_0x2abe('0x3c')]();}function handleUnpublished(_0x46aa29){logger['error'](util['format'](_0x2abe('0x3e'),_0x46aa29[_0x2abe('0x24')]));_0x46aa29['continueAt'](_0x46aa29[_0x2abe('0x2d')],_0x46aa29[_0x2abe('0x2e')],parseInt(_0x46aa29['priority'],0xa)+0x1);_0x46aa29[_0x2abe('0x3c')]();}module[_0x2abe('0x3f')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index ff56f25..0854f98 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 _0x9085=['\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','trim','slice','emit','line','exports','stream','Transform','call','_localBuffer','_inBody','inherits'];(function(_0x9cae0c,_0x42b12d){var _0x45542e=function(_0x31623a){while(--_0x31623a){_0x9cae0c['push'](_0x9cae0c['shift']());}};_0x45542e(++_0x42b12d);}(_0x9085,0x192));var _0x5908=function(_0x4350c2,_0x112f3c){_0x4350c2=_0x4350c2-0x0;var _0x8b6406=_0x9085[_0x4350c2];return _0x8b6406;};'use strict';var util=require('util');var Transform=require(_0x5908('0x0'))[_0x5908('0x1')];function AGIReply(_0x5e6177){Transform[_0x5908('0x2')](this,_0x5e6177);this[_0x5908('0x3')]='';this[_0x5908('0x4')]=![];}util[_0x5908('0x5')](AGIReply,Transform);AGIReply['prototype']['_transform']=function(_0x59c5d2,_0x13f775,_0x24a5d1){var _0x2b6afa='\x0a',_0x32458b=['\x0a\x0a',_0x5908('0x6')],_0x3cfa4f=-0x1,_0x53a700=-0x1,_0x4aaffb='',_0x228dc3=0x0,_0x5e10bb='',_0x82f453='';this[_0x5908('0x3')]+=_0x59c5d2[_0x5908('0x7')]();_0x5e10bb=this[_0x5908('0x3')];if(!this['_inBody']){_0x228dc3=0x0;while(_0x32458b[_0x228dc3]){while((_0x53a700=_0x5e10bb[_0x5908('0x8')](_0x32458b[_0x228dc3]))!=-0x1){_0x4aaffb=_0x32458b[_0x228dc3];_0x82f453=_0x5e10bb[_0x5908('0x9')](0x0,_0x53a700);_0x5e10bb=_0x5e10bb['substring'](_0x53a700+_0x4aaffb[_0x5908('0xa')]);var _0x4def13=_0x82f453[_0x5908('0xb')](_0x2b6afa),_0x133d4d=0x0,_0x591fcc={},_0x5f38b7='',_0x2cb73b='',_0xd023a6=-0x1;while(_0x4def13[_0x133d4d]){_0xd023a6=_0x4def13[_0x133d4d][_0x5908('0x8')](':');if(_0xd023a6!=-0x1){_0x5f38b7=_0x4def13[_0x133d4d]['slice'](0x0,_0xd023a6)[_0x5908('0xc')]();_0x2cb73b=_0x4def13[_0x133d4d][_0x5908('0xd')](_0xd023a6+0x1)[_0x5908('0xc')]();if(_0x5f38b7['length']>0x0){_0x591fcc[_0x5f38b7]=_0x2cb73b;}}else{}_0x133d4d++;}this[_0x5908('0xe')]('headers',_0x591fcc);this[_0x5908('0x4')]=!![];}_0x228dc3++;}this['_localBuffer']=_0x5e10bb;}else{while((_0x3cfa4f=_0x5e10bb['indexOf'](_0x2b6afa))!=-0x1){_0x82f453=_0x5e10bb[_0x5908('0x9')](0x0,_0x3cfa4f);this[_0x5908('0xe')](_0x5908('0xf'),_0x82f453);_0x5e10bb=_0x5e10bb[_0x5908('0x9')](_0x3cfa4f+_0x2b6afa[_0x5908('0xa')]);}this['_localBuffer']=_0x5e10bb;}_0x24a5d1();};module[_0x5908('0x10')]=AGIReply; \ No newline at end of file +var _0xce5b=['_localBuffer','toString','substring','length','slice','trim','emit','headers','indexOf','exports','util','stream','Transform','call','_inBody','prototype','_transform','\x0d\x0a\x0d\x0a'];(function(_0x19f8b6,_0x2b4e8c){var _0x213ebc=function(_0x40fc8c){while(--_0x40fc8c){_0x19f8b6['push'](_0x19f8b6['shift']());}};_0x213ebc(++_0x2b4e8c);}(_0xce5b,0x76));var _0xbce5=function(_0x192c4b,_0x1ad8ae){_0x192c4b=_0x192c4b-0x0;var _0x15f32b=_0xce5b[_0x192c4b];return _0x15f32b;};'use strict';var util=require(_0xbce5('0x0'));var Transform=require(_0xbce5('0x1'))[_0xbce5('0x2')];function AGIReply(_0x222f3c){Transform[_0xbce5('0x3')](this,_0x222f3c);this['_localBuffer']='';this[_0xbce5('0x4')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0xbce5('0x5')][_0xbce5('0x6')]=function(_0x4e4b04,_0x5dee20,_0x8def8){var _0x154abc='\x0a',_0x45a360=['\x0a\x0a',_0xbce5('0x7')],_0x2e2d25=-0x1,_0xbf3f37=-0x1,_0x48dabf='',_0x529566=0x0,_0x522416='',_0x5eea49='';this[_0xbce5('0x8')]+=_0x4e4b04[_0xbce5('0x9')]();_0x522416=this['_localBuffer'];if(!this[_0xbce5('0x4')]){_0x529566=0x0;while(_0x45a360[_0x529566]){while((_0xbf3f37=_0x522416['indexOf'](_0x45a360[_0x529566]))!=-0x1){_0x48dabf=_0x45a360[_0x529566];_0x5eea49=_0x522416[_0xbce5('0xa')](0x0,_0xbf3f37);_0x522416=_0x522416['substring'](_0xbf3f37+_0x48dabf[_0xbce5('0xb')]);var _0x2dc1ea=_0x5eea49['split'](_0x154abc),_0x3cf258=0x0,_0x255196={},_0x1b6e71='',_0x28c6ae='',_0xae4570=-0x1;while(_0x2dc1ea[_0x3cf258]){_0xae4570=_0x2dc1ea[_0x3cf258]['indexOf'](':');if(_0xae4570!=-0x1){_0x1b6e71=_0x2dc1ea[_0x3cf258][_0xbce5('0xc')](0x0,_0xae4570)[_0xbce5('0xd')]();_0x28c6ae=_0x2dc1ea[_0x3cf258][_0xbce5('0xc')](_0xae4570+0x1)['trim']();if(_0x1b6e71[_0xbce5('0xb')]>0x0){_0x255196[_0x1b6e71]=_0x28c6ae;}}else{}_0x3cf258++;}this[_0xbce5('0xe')](_0xbce5('0xf'),_0x255196);this['_inBody']=!![];}_0x529566++;}this[_0xbce5('0x8')]=_0x522416;}else{while((_0x2e2d25=_0x522416[_0xbce5('0x10')](_0x154abc))!=-0x1){_0x5eea49=_0x522416[_0xbce5('0xa')](0x0,_0x2e2d25);this['emit']('line',_0x5eea49);_0x522416=_0x522416['substring'](_0x2e2d25+_0x154abc[_0xbce5('0xb')]);}this[_0xbce5('0x8')]=_0x522416;}_0x8def8();};module[_0xbce5('0x11')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 79d193c..573a77c 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 _0xb377=['getPauseById','ShowPause','agentLogin','LoginUser','agentUnpause','UnpauseUser','lodash','moment','jayson/promise','client','http','request','then','message','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','getMailAccountById','Smtp','CloudProvider','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc','ShowUser','GetContactByPhone','phone','ShowTrunk','getSoundById','ShowSound','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','CreateCmContact'];(function(_0x1a3002,_0x537a37){var _0xfef306=function(_0x53ea0f){while(--_0x53ea0f){_0x1a3002['push'](_0x1a3002['shift']());}};_0xfef306(++_0x537a37);}(_0xb377,0x1b6));var _0x7b37=function(_0xb7e6fb,_0x874303){_0xb7e6fb=_0xb7e6fb-0x0;var _0x54e3ce=_0xb377[_0xb7e6fb];return _0x54e3ce;};'use strict';var _=require(_0x7b37('0x0'));var moment=require(_0x7b37('0x1'));var jayson=require(_0x7b37('0x2'));var client=jayson[_0x7b37('0x3')][_0x7b37('0x4')]({'port':0x2329});function request(_0x36868b,_0x15bc68){return new Promise(function(_0x3c4851,_0x2018bd){return client[_0x7b37('0x5')](_0x36868b,_0x15bc68)[_0x7b37('0x6')](function(_0x38d1b4){if(_0x38d1b4['error']){return _0x2018bd(_0x38d1b4['error'][_0x7b37('0x7')]);}else{return _0x3c4851(_0x38d1b4['result']);}})['catch'](function(_0x3de992){return _0x2018bd(_0x3de992);});});}exports[_0x7b37('0x8')]=function(){return request(_0x7b37('0x9'),{'options':{'raw':![],'attributes':['id',_0x7b37('0xa'),_0x7b37('0xb')]}});};exports[_0x7b37('0xc')]=function(_0x4610cd){return request(_0x7b37('0xd'),{'options':{'raw':![],'where':{'name':_0x4610cd},'attributes':['production']}});};exports[_0x7b37('0xe')]=function(_0x20f993){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x20f993},'include':[{'model':'MailServerOut','as':_0x7b37('0xf'),'include':[{'model':_0x7b37('0x10'),'as':_0x7b37('0x10')}]}],'attributes':['id',_0x7b37('0xa'),_0x7b37('0x11')],'smtp':!![]}});};exports[_0x7b37('0x12')]=function(_0x28dd9c){return request(_0x7b37('0xd'),{'options':{'where':{'id':_0x28dd9c},'attributes':[_0x7b37('0xa')]}});};exports[_0x7b37('0x13')]=function(_0x1a381a){return request(_0x7b37('0x14'),{'options':{'where':{'id':_0x1a381a},'attributes':[_0x7b37('0xa')]}});};exports[_0x7b37('0x15')]=function(_0xbfdc78){return request(_0x7b37('0x16'),{'options':{'where':{'id':_0xbfdc78},'attributes':[_0x7b37('0xa')]}});};exports['getSquareOdbcById']=function(_0x537c83){return request(_0x7b37('0x17'),{'options':{'where':{'id':_0x537c83},'attributes':['dsn']}});};exports['getUserById']=function(_0x32ee3e){return request(_0x7b37('0x18'),{'options':{'where':{'id':_0x32ee3e},'attributes':[_0x7b37('0xa')]}});};exports['getContactByPhone']=function(_0x29a9dd){return request(_0x7b37('0x19'),{'options':{'where':{'phone':_0x29a9dd[_0x7b37('0x1a')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x58c906){return request(_0x7b37('0x1b'),{'options':{'where':{'id':_0x58c906},'attributes':[_0x7b37('0xa')]}});};exports[_0x7b37('0x1c')]=function(_0x28c427){return request(_0x7b37('0x1d'),{'options':{'where':{'id':_0x28c427},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x57f7f2){return request(_0x7b37('0x1e'),{'options':{'raw':![],'where':{'id':_0x57f7f2},'include':[{'model':_0x7b37('0x1f'),'as':_0x7b37('0x20')}]}});};exports[_0x7b37('0x21')]=function(_0x184bdd){return request(_0x7b37('0x22'),{'options':{'where':{'id':_0x184bdd},'attributes':['id',_0x7b37('0xa')]}});};exports['createSmsMessage']=function(_0x4066ea){return request(_0x7b37('0x23'),{'body':_0x4066ea});};exports['createSquareDetailsReport']=function(_0x239cfc){return request('CreateSquareDetailsReport',{'body':_0x239cfc});};exports[_0x7b37('0x24')]=function(_0x49cafd){return request('CreateSquareReport',{'body':_[_0x7b37('0x25')](_0x49cafd,{'project_name':_0x49cafd[_0x7b37('0x26')],'prev_project_name':_0x49cafd[_0x7b37('0x27')]||'','is_subproject':_0x49cafd[_0x7b37('0x27')]?!![]:![],'leaveAt':moment()[_0x7b37('0x28')](_0x7b37('0x29'))})});};exports['createSquareRecording']=function(_0x20a3cc){return request(_0x7b37('0x2a'),{'body':_0x20a3cc});};exports[_0x7b37('0x2b')]=function(_0x3d0cc1){return request(_0x7b37('0x2c'),{'body':_0x3d0cc1});};exports[_0x7b37('0x2d')]=function(_0x46810f){return request(_0x7b37('0x2e'),{'options':{'raw':![],'where':{'phone':_0x46810f[_0x7b37('0x1a')],'ListId':_0x46810f['ListId']}}})[_0x7b37('0x6')](function(_0x461858){if(_0x461858){return _0x461858;}return request(_0x7b37('0x2f'),{'body':_0x46810f});});};exports[_0x7b37('0x30')]=function(_0x50ac54){return request(_0x7b37('0x31'),{'options':{'where':{'id':_0x50ac54},'attributes':[_0x7b37('0xa')]}});};exports[_0x7b37('0x32')]=function(_0x3e408c,_0x212185){return request(_0x7b37('0x33'),{'body':{'interface':_0x212185},'options':{'where':_0x3e408c}});};exports['agentPause']=function(_0x29ec63,_0x4a1def,_0x2cec69){return request('PauseUser',{'body':{'type':_0x4a1def,'uniqueid':_0x2cec69},'options':{'where':_0x29ec63}});};exports[_0x7b37('0x34')]=function(_0x1710f3){return request(_0x7b37('0x35'),{'body':{},'options':{'where':_0x1710f3}});};exports['agentLogout']=function(_0x1b88b7){return request('LogoutUser',{'body':{},'options':{'where':_0x1b88b7}});}; \ No newline at end of file +var _0xf873=['getMailAccountById','ShowMailAccount','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','then','CreateCmContact','getPauseById','ShowPause','agentLogin','PauseUser','agentUnpause','UnpauseUser','LogoutUser','moment','jayson/promise','client','http','request','error','result','catch','getSquareProjects','GetSquareProjects','name','getSquareProject','ShowSquareProject','production'];(function(_0x41d5a4,_0x186f91){var _0x20fb36=function(_0x15c2ed){while(--_0x15c2ed){_0x41d5a4['push'](_0x41d5a4['shift']());}};_0x20fb36(++_0x186f91);}(_0xf873,0xb2));var _0x3f87=function(_0x38b246,_0x5c875c){_0x38b246=_0x38b246-0x0;var _0x401469=_0xf873[_0x38b246];return _0x401469;};'use strict';var _=require('lodash');var moment=require(_0x3f87('0x0'));var jayson=require(_0x3f87('0x1'));var client=jayson[_0x3f87('0x2')][_0x3f87('0x3')]({'port':0x2329});function request(_0x1c56a3,_0xd4592c){return new Promise(function(_0x2fbb4f,_0x1d68dd){return client[_0x3f87('0x4')](_0x1c56a3,_0xd4592c)['then'](function(_0x2e2177){if(_0x2e2177[_0x3f87('0x5')]){return _0x1d68dd(_0x2e2177[_0x3f87('0x5')]['message']);}else{return _0x2fbb4f(_0x2e2177[_0x3f87('0x6')]);}})[_0x3f87('0x7')](function(_0x3b8e92){return _0x1d68dd(_0x3b8e92);});});}exports[_0x3f87('0x8')]=function(){return request(_0x3f87('0x9'),{'options':{'raw':![],'attributes':['id',_0x3f87('0xa'),'production']}});};exports[_0x3f87('0xb')]=function(_0x435ca8){return request(_0x3f87('0xc'),{'options':{'raw':![],'where':{'name':_0x435ca8},'attributes':[_0x3f87('0xd')]}});};exports[_0x3f87('0xe')]=function(_0xd41ca0){return request(_0x3f87('0xf'),{'options':{'raw':![],'where':{'id':_0xd41ca0},'include':[{'model':_0x3f87('0x10'),'as':_0x3f87('0x11'),'include':[{'model':_0x3f87('0x12'),'as':_0x3f87('0x12')}]}],'attributes':['id',_0x3f87('0xa'),_0x3f87('0x13')],'smtp':!![]}});};exports[_0x3f87('0x14')]=function(_0x5aff02){return request(_0x3f87('0xc'),{'options':{'where':{'id':_0x5aff02},'attributes':[_0x3f87('0xa')]}});};exports['getVoiceQueueById']=function(_0x1cfba3){return request(_0x3f87('0x15'),{'options':{'where':{'id':_0x1cfba3},'attributes':[_0x3f87('0xa')]}});};exports[_0x3f87('0x16')]=function(_0x3f192a){return request(_0x3f87('0x17'),{'options':{'where':{'id':_0x3f192a},'attributes':[_0x3f87('0xa')]}});};exports[_0x3f87('0x18')]=function(_0x5f0b2b){return request(_0x3f87('0x19'),{'options':{'where':{'id':_0x5f0b2b},'attributes':[_0x3f87('0x1a')]}});};exports[_0x3f87('0x1b')]=function(_0x4e1df8){return request(_0x3f87('0x1c'),{'options':{'where':{'id':_0x4e1df8},'attributes':['name']}});};exports[_0x3f87('0x1d')]=function(_0x13550c){return request(_0x3f87('0x1e'),{'options':{'where':{'phone':_0x13550c[_0x3f87('0x1f')]},'attributes':['id']}});};exports[_0x3f87('0x20')]=function(_0x4fe75c){return request(_0x3f87('0x21'),{'options':{'where':{'id':_0x4fe75c},'attributes':[_0x3f87('0xa')]}});};exports[_0x3f87('0x22')]=function(_0x3a602a){return request('ShowSound',{'options':{'where':{'id':_0x3a602a},'attributes':['save_name']}});};exports['getIntervalById']=function(_0x73aba6){return request(_0x3f87('0x23'),{'options':{'raw':![],'where':{'id':_0x73aba6},'include':[{'model':_0x3f87('0x24'),'as':'Intervals'}]}});};exports[_0x3f87('0x25')]=function(_0xb01673){return request(_0x3f87('0x26'),{'options':{'where':{'id':_0xb01673},'attributes':['id',_0x3f87('0xa')]}});};exports[_0x3f87('0x27')]=function(_0x46d773){return request(_0x3f87('0x28'),{'body':_0x46d773});};exports[_0x3f87('0x29')]=function(_0x197ff4){return request(_0x3f87('0x2a'),{'body':_0x197ff4});};exports[_0x3f87('0x2b')]=function(_0x37b8b9){return request('CreateSquareReport',{'body':_[_0x3f87('0x2c')](_0x37b8b9,{'project_name':_0x37b8b9[_0x3f87('0x2d')],'prev_project_name':_0x37b8b9[_0x3f87('0x2e')]||'','is_subproject':_0x37b8b9['arg_2']?!![]:![],'leaveAt':moment()['format'](_0x3f87('0x2f'))})});};exports[_0x3f87('0x30')]=function(_0x18df70){return request(_0x3f87('0x31'),{'body':_0x18df70});};exports[_0x3f87('0x32')]=function(_0x148d8e){return request(_0x3f87('0x33'),{'body':_0x148d8e});};exports[_0x3f87('0x34')]=function(_0x113e40){return request(_0x3f87('0x35'),{'options':{'raw':![],'where':{'phone':_0x113e40[_0x3f87('0x1f')],'ListId':_0x113e40[_0x3f87('0x36')]}}})[_0x3f87('0x37')](function(_0x241d88){if(_0x241d88){return _0x241d88;}return request(_0x3f87('0x38'),{'body':_0x113e40});});};exports[_0x3f87('0x39')]=function(_0x5d6fc2){return request(_0x3f87('0x3a'),{'options':{'where':{'id':_0x5d6fc2},'attributes':[_0x3f87('0xa')]}});};exports[_0x3f87('0x3b')]=function(_0x2f0f05,_0x5495ed){return request('LoginUser',{'body':{'interface':_0x5495ed},'options':{'where':_0x2f0f05}});};exports['agentPause']=function(_0x221800,_0xcafb7d,_0x1d90d4){return request(_0x3f87('0x3c'),{'body':{'type':_0xcafb7d,'uniqueid':_0x1d90d4},'options':{'where':_0x221800}});};exports[_0x3f87('0x3d')]=function(_0x5e4570){return request(_0x3f87('0x3e'),{'body':{},'options':{'where':_0x5e4570}});};exports['agentLogout']=function(_0x2e4bc7){return request(_0x3f87('0x3f'),{'body':{},'options':{'where':_0x2e4bc7}});}; \ 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 99e17d4..c4cbf58 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 _0xfcbe=['exports','./lex'];(function(_0x119629,_0x246787){var _0x49a771=function(_0x23624c){while(--_0x23624c){_0x119629['push'](_0x119629['shift']());}};_0x49a771(++_0x246787);}(_0xfcbe,0x1b1));var _0xefcb=function(_0x18eb8c,_0x2a1a1e){_0x18eb8c=_0x18eb8c-0x0;var _0x33beda=_0xfcbe[_0x18eb8c];return _0x33beda;};var polly=require('./polly');var lex=require(_0xefcb('0x0'));module[_0xefcb('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x3981=['./polly','exports'];(function(_0x2a532c,_0x3f5c49){var _0xe7d81d=function(_0x49d469){while(--_0x49d469){_0x2a532c['push'](_0x2a532c['shift']());}};_0xe7d81d(++_0x3f5c49);}(_0x3981,0x144));var _0x1398=function(_0x1bfb3c,_0x2ac29a){_0x1bfb3c=_0x1bfb3c-0x0;var _0xcaac0c=_0x3981[_0x1bfb3c];return _0xcaac0c;};var polly=require(_0x1398('0x0'));var lex=require('./lex');module[_0x1398('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 06ddc9a..d10b0a3 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 _0x13f6=['./lib/api','exports'];(function(_0x5e5d56,_0x104665){var _0x6a42ea=function(_0x56688b){while(--_0x56688b){_0x5e5d56['push'](_0x5e5d56['shift']());}};_0x6a42ea(++_0x104665);}(_0x13f6,0x124));var _0x613f=function(_0x1699e6,_0x38cb2d){_0x1699e6=_0x1699e6-0x0;var _0x4d8b9f=_0x13f6[_0x1699e6];return _0x4d8b9f;};'use strict';var lex=require(_0x613f('0x0'));module[_0x613f('0x1')]=function(_0x5f1b3e,_0x563492,_0xd04cfd,_0x13b50a,_0x12dc5a,_0x5414ff){return lex(_0x5f1b3e,_0x563492,_0xd04cfd,_0x13b50a,_0x12dc5a,_0x5414ff);}; \ No newline at end of file +var _0x2dae=['./lib/api'];(function(_0x1e919d,_0x1f7d59){var _0x32e36c=function(_0x259582){while(--_0x259582){_0x1e919d['push'](_0x1e919d['shift']());}};_0x32e36c(++_0x1f7d59);}(_0x2dae,0xc3));var _0xe2da=function(_0x176317,_0x4897b3){_0x176317=_0x176317-0x0;var _0xef2759=_0x2dae[_0x176317];return _0xef2759;};'use strict';var lex=require(_0xe2da('0x0'));module['exports']=function(_0x11ec30,_0x31359d,_0xcd0055,_0x167432,_0x99b46f,_0x481d97){return lex(_0x11ec30,_0x31359d,_0xcd0055,_0x167432,_0x99b46f,_0x481d97);}; \ 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 f7b4dca..816d8a9 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(_0x3e2d1b,_0x43cb81){var _0xad99e6=function(_0x331594){while(--_0x331594){_0x3e2d1b['push'](_0x3e2d1b['shift']());}};_0xad99e6(++_0x43cb81);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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(_0x37a299,_0x5d10c3){var _0x390267=function(_0x32b0a1){while(--_0x32b0a1){_0x37a299['push'](_0x37a299['shift']());}};_0x390267(++_0x5d10c3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 4b8d923..8cbdc1d 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 _0x64b0=['exports'];(function(_0x2d1596,_0x330dba){var _0x46a36d=function(_0x32227b){while(--_0x32227b){_0x2d1596['push'](_0x2d1596['shift']());}};_0x46a36d(++_0x330dba);}(_0x64b0,0x7f));var _0x064b=function(_0x4f14ec,_0x3e7175){_0x4f14ec=_0x4f14ec-0x0;var _0x212bb2=_0x64b0[_0x4f14ec];return _0x212bb2;};'use strict';var polly=require('./lib/api');module[_0x064b('0x0')]=function(_0x59bc58,_0x74b68a,_0x726fb4,_0x4d8e6c,_0x30423a,_0x16bfd4,_0x4fa697){return polly(_0x59bc58,_0x74b68a,_0x726fb4,_0x4d8e6c,_0x30423a,_0x16bfd4,_0x4fa697);}; \ No newline at end of file +var _0xeed2=['exports'];(function(_0xbf3f5b,_0x45c769){var _0x6afa06=function(_0x431d06){while(--_0x431d06){_0xbf3f5b['push'](_0xbf3f5b['shift']());}};_0x6afa06(++_0x45c769);}(_0xeed2,0xcc));var _0x2eed=function(_0x50ca2c,_0xe9fb09){_0x50ca2c=_0x50ca2c-0x0;var _0x44f0ac=_0xeed2[_0x50ca2c];return _0x44f0ac;};'use strict';var polly=require('./lib/api');module[_0x2eed('0x0')]=function(_0x4051c6,_0x1077c4,_0x1dbc57,_0x5aa036,_0xbdc22e,_0x5972dc,_0x392bd2){return polly(_0x4051c6,_0x1077c4,_0x1dbc57,_0x5aa036,_0xbdc22e,_0x5972dc,_0x392bd2);}; \ 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 5779d78..9b88cb1 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 _0xecd2=['path','bluebird','randomstring','aws-sdk','synthesizeSpeech','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3'];(function(_0x3ccc5f,_0x17ba72){var _0x15de37=function(_0x255971){while(--_0x255971){_0x3ccc5f['push'](_0x3ccc5f['shift']());}};_0x15de37(++_0x17ba72);}(_0xecd2,0xd0));var _0x2ecd=function(_0x4debf8,_0x5ac3d9){_0x4debf8=_0x4debf8-0x0;var _0x111419=_0xecd2[_0x4debf8];return _0x111419;};'use strict';var fs=require('fs');var path=require(_0x2ecd('0x0'));var BPromise=require(_0x2ecd('0x1'));var rs=require(_0x2ecd('0x2'));var AWS=require(_0x2ecd('0x3'));function pollyResult(_0x3fdfaf,_0x1e376f,_0x31da6f){return new BPromise(function(_0x1d90fc,_0x1df043){_0x3fdfaf[_0x2ecd('0x4')](_0x1e376f,function(_0x4a6fc2,_0x1fb482){if(_0x4a6fc2){_0x1df043(_0x4a6fc2);}else if(_0x1fb482){if(_0x1fb482['AudioStream']instanceof Buffer){fs[_0x2ecd('0x5')](_0x31da6f,_0x1fb482[_0x2ecd('0x6')],function(_0x4e0c49){if(_0x4e0c49){_0x1df043(_0x4e0c49);}else{_0x1d90fc();}});}else{_0x1df043(new Error(_0x2ecd('0x7')));}}else{_0x1df043(new Error(_0x2ecd('0x8')));}});});}module[_0x2ecd('0x9')]=function(_0x57ea49,_0x398c79,_0x5b3662,_0x31bc43,_0x25a419,_0x4d3833,_0xcba1c){var _0x5cb39e=new AWS[(_0x2ecd('0xa'))]({'accessKeyId':_0x57ea49,'secretAccessKey':_0x398c79,'region':_0x5b3662});var _0x2f9485={'Text':_0x25a419,'TextType':_0x4d3833||_0x2ecd('0xb'),'OutputFormat':_0x2ecd('0xc'),'VoiceId':_0x31bc43};return pollyResult(_0x5cb39e,_0x2f9485,_0xcba1c);}; \ No newline at end of file +var _0xc4b0=['AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','randomstring','writeFile'];(function(_0x144114,_0x5f0b0d){var _0x2d84f5=function(_0x2a71c8){while(--_0x2a71c8){_0x144114['push'](_0x144114['shift']());}};_0x2d84f5(++_0x5f0b0d);}(_0xc4b0,0x114));var _0x0c4b=function(_0x58f9a8,_0x46cc13){_0x58f9a8=_0x58f9a8-0x0;var _0x551362=_0xc4b0[_0x58f9a8];return _0x551362;};'use strict';var fs=require('fs');var path=require(_0x0c4b('0x0'));var BPromise=require('bluebird');var rs=require(_0x0c4b('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x26189f,_0x47bb1e,_0x460e73){return new BPromise(function(_0x36fc54,_0x2de9bc){_0x26189f['synthesizeSpeech'](_0x47bb1e,function(_0x5b47f5,_0x4667ab){if(_0x5b47f5){_0x2de9bc(_0x5b47f5);}else if(_0x4667ab){if(_0x4667ab['AudioStream']instanceof Buffer){fs[_0x0c4b('0x2')](_0x460e73,_0x4667ab[_0x0c4b('0x3')],function(_0x3f8984){if(_0x3f8984){_0x2de9bc(_0x3f8984);}else{_0x36fc54();}});}else{_0x2de9bc(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x2de9bc(new Error(_0x0c4b('0x4')));}});});}module[_0x0c4b('0x5')]=function(_0x5625f4,_0x4d69af,_0x4675b5,_0x4ea8bc,_0x3a4485,_0x36c2d9,_0x47a651){var _0x4bda69=new AWS[(_0x0c4b('0x6'))]({'accessKeyId':_0x5625f4,'secretAccessKey':_0x4d69af,'region':_0x4675b5});var _0x25dc4e={'Text':_0x3a4485,'TextType':_0x36c2d9||_0x0c4b('0x7'),'OutputFormat':_0x0c4b('0x8'),'VoiceId':_0x4ea8bc};return pollyResult(_0x4bda69,_0x25dc4e,_0x47a651);}; \ 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 c0a4a7b..43e800d 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 _0x98f2=['./lib/api','exports'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x98f2,0x118));var _0x298f=function(_0x16d7d8,_0x43a6cd){_0x16d7d8=_0x16d7d8-0x0;var _0x4f9dbf=_0x98f2[_0x16d7d8];return _0x4f9dbf;};'use strict';var asr=require(_0x298f('0x0'));module[_0x298f('0x1')]=function(_0x4c20fd,_0x16b012,_0x1f0317,_0xf76805){return asr(_0x4c20fd,_0x16b012,_0x1f0317);}; \ No newline at end of file +var _0x624d=['./lib/api'];(function(_0x2e8a6f,_0x118c61){var _0x30cbb4=function(_0x3f5c8b){while(--_0x3f5c8b){_0x2e8a6f['push'](_0x2e8a6f['shift']());}};_0x30cbb4(++_0x118c61);}(_0x624d,0x1a0));var _0xd624=function(_0x1d1d09,_0x504d77){_0x1d1d09=_0x1d1d09-0x0;var _0x8827e=_0x624d[_0x1d1d09];return _0x8827e;};'use strict';var asr=require(_0xd624('0x0'));module['exports']=function(_0x57e0f4,_0x9f608b,_0x574b7a,_0x4d6c90){return asr(_0x57e0f4,_0x9f608b,_0x574b7a);}; \ 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 361e1d2..b280ef4 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 _0x6ae0=['exports','string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','LINEAR16','8000','url','bluebird','https://speech.googleapis.com'];(function(_0x451151,_0x567944){var _0x11950c=function(_0x3d2d5b){while(--_0x3d2d5b){_0x451151['push'](_0x451151['shift']());}};_0x11950c(++_0x567944);}(_0x6ae0,0x192));var _0x06ae=function(_0x4a0ecf,_0x49d5bc){_0x4a0ecf=_0x4a0ecf-0x0;var _0x24057e=_0x6ae0[_0x4a0ecf];return _0x24057e;};'use strict';var url=require(_0x06ae('0x0'));var BPromise=require(_0x06ae('0x1'));var fs=require('fs');var host=_0x06ae('0x2');module[_0x06ae('0x3')]=function(_0x54e586,_0x52f385,_0x319535){return new BPromise(function(_0x58c780,_0x104bb4){var _0x5ec2f9;if(typeof _0x54e586!==_0x06ae('0x4')||_0x54e586[_0x06ae('0x5')]===0x0){return _0x104bb4('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x52f385!==_0x06ae('0x4')||_0x52f385['length']===0x0){return _0x104bb4(_0x06ae('0x6'));}if(typeof _0x319535!==_0x06ae('0x7')&&(typeof _0x319535!=='string'||_0x319535[_0x06ae('0x5')]===0x0)){return _0x104bb4(_0x06ae('0x8'));}try{_0x5ec2f9=fs[_0x06ae('0x9')](_0x54e586)[_0x06ae('0xa')](_0x06ae('0xb'));}catch(_0x1a667c){return _0x104bb4(_0x1a667c);}return _0x58c780({'method':_0x06ae('0xc'),'uri':host+'/v1/speech:recognize?key='+_0x52f385,'body':{'config':{'encoding':_0x06ae('0xd'),'sampleRateHertz':_0x06ae('0xe'),'languageCode':_0x319535},'audio':{'content':_0x5ec2f9}},'json':!![]});});}; \ No newline at end of file +var _0x0a12=['base64','POST','/v1/speech:recognize?key=','8000','bluebird','string','length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString'];(function(_0x503287,_0x252ead){var _0x3709ef=function(_0x39e5f5){while(--_0x39e5f5){_0x503287['push'](_0x503287['shift']());}};_0x3709ef(++_0x252ead);}(_0x0a12,0xb8));var _0x20a1=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x0a12[_0x27af45];return _0x18df21;};'use strict';var url=require('url');var BPromise=require(_0x20a1('0x0'));var fs=require('fs');var host='https://speech.googleapis.com';module['exports']=function(_0x538550,_0x38a7da,_0x4ec1f1){return new BPromise(function(_0x3fe991,_0x2079d8){var _0x2cd34f;if(typeof _0x538550!==_0x20a1('0x1')||_0x538550[_0x20a1('0x2')]===0x0){return _0x2079d8(_0x20a1('0x3'));}if(typeof _0x38a7da!==_0x20a1('0x1')||_0x38a7da['length']===0x0){return _0x2079d8('key\x20should\x20be\x20a\x20string');}if(typeof _0x4ec1f1!==_0x20a1('0x4')&&(typeof _0x4ec1f1!=='string'||_0x4ec1f1['length']===0x0)){return _0x2079d8(_0x20a1('0x5'));}try{_0x2cd34f=fs[_0x20a1('0x6')](_0x538550)[_0x20a1('0x7')](_0x20a1('0x8'));}catch(_0x24f114){return _0x2079d8(_0x24f114);}return _0x3fe991({'method':_0x20a1('0x9'),'uri':host+_0x20a1('0xa')+_0x38a7da,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x20a1('0xb'),'languageCode':_0x4ec1f1},'audio':{'content':_0x2cd34f}},'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 55df85a..f93e12c 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 _0x7215=['exports'];(function(_0x1dc191,_0x47f271){var _0x32a87e=function(_0x531bfd){while(--_0x531bfd){_0x1dc191['push'](_0x1dc191['shift']());}};_0x32a87e(++_0x47f271);}(_0x7215,0xc9));var _0x5721=function(_0x3fd165,_0x5e2e2f){_0x3fd165=_0x3fd165-0x0;var _0x50f970=_0x7215[_0x3fd165];return _0x50f970;};var asr=require('./asr');module[_0x5721('0x0')]={'asr':asr}; \ No newline at end of file +var _0x4abf=['exports'];(function(_0x28dcbe,_0x1f0cd6){var _0x5ce45d=function(_0x3b595b){while(--_0x3b595b){_0x28dcbe['push'](_0x28dcbe['shift']());}};_0x5ce45d(++_0x1f0cd6);}(_0x4abf,0xf4));var _0xf4ab=function(_0x3aff71,_0x493a7c){_0x3aff71=_0x3aff71-0x0;var _0x23b3ed=_0x4abf[_0x3aff71];return _0x23b3ed;};var asr=require('./asr');module[_0xf4ab('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index c44a9c4..c4c8199 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 _0xf83c=['uri','results','map','alternatives','transcript','confidence','join','googleASR\x20confidence','[%s]\x20%s:%s','message','googleDialogflow','textRequest','result','source','resolvedQuery','action','actionIncomplete','fulfillment','speech','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','name','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','parse','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','querystring','randomstring','google-tts-api','url','util','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','https:','WHAT_EVER','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','download\x20error','end','protocol','get','transcode','wav','finish\x20to\x20convert','start','tmp','generate','.wav','writeFileSync','base64','then','unlink','chmodSync','777','split','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','input','audioConfig','MP3','text:synthesize','POST','resolve','from','writeFile','googleCloudTTS\x20path','utf8','application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','null','parse\x20response\x20failed:\x0a','data','length','lang\x20\x22','\x22\x20might\x20not\x20exist','.mp3','goggleTTS\x20path','googleASR','asr'];(function(_0x45003a,_0x563b74){var _0x4e09f9=function(_0x50cd1e){while(--_0x50cd1e){_0x45003a['push'](_0x45003a['shift']());}};_0x4e09f9(++_0x563b74);}(_0xf83c,0x150));var _0xcf83=function(_0x452968,_0x31e391){_0x452968=_0x452968-0x0;var _0xb6f9ae=_0xf83c[_0x452968];return _0xb6f9ae;};'use strict';var apiai=require(_0xcf83('0x0'));var BPromise=require(_0xcf83('0x1'));var dialogflow=require(_0xcf83('0x2'));var fs=require('fs');var http=require(_0xcf83('0x3'));var https=require(_0xcf83('0x4'));var md5=require(_0xcf83('0x5'));var path=require(_0xcf83('0x6'));var querystring=require(_0xcf83('0x7'));var rp=require('request-promise');var rs=require(_0xcf83('0x8'));var sox=require('sox');var tts=require(_0xcf83('0x9'));var urlParse=require(_0xcf83('0xa'))['parse'];var util=require(_0xcf83('0xb'));var aws=require('./aws');var google=require(_0xcf83('0xc'));var sestek=require(_0xcf83('0xd'));var tilde=require(_0xcf83('0xe'));var logger=require(_0xcf83('0xf'))(_0xcf83('0x10'));var ISPEECH_API=_0xcf83('0x11');function downloadFile(_0x39ae5a,_0x3ec217){return new BPromise(function(_0x33f870,_0x2f3ceb){var _0x300324=urlParse(_0x39ae5a);var _0x23f66f=_0x300324['protocol']===_0xcf83('0x12')?https:http;var _0x45087b={'host':_0x300324['host'],'path':_0x300324[_0xcf83('0x6')],'headers':{'user-agent':_0xcf83('0x13')}};_0x23f66f['get'](_0x45087b,function(_0xc86822){if(_0xc86822[_0xcf83('0x14')]!==0xc8){logger[_0xcf83('0x15')](_0xcf83('0x16')+_0x39ae5a+_0xcf83('0x17')+_0xc86822[_0xcf83('0x14')]+'\x20('+_0xc86822[_0xcf83('0x18')]+')');_0x2f3ceb(new Error(_0xcf83('0x16')+_0x39ae5a+_0xcf83('0x17')+_0xc86822[_0xcf83('0x14')]+'\x20('+_0xc86822[_0xcf83('0x18')]+')'));return;}var _0x30a727=fs[_0xcf83('0x19')](_0x3ec217);_0x30a727['on'](_0xcf83('0x1a'),function(){logger[_0xcf83('0x1b')](_0xcf83('0x1c'));_0x30a727[_0xcf83('0x1d')](_0x33f870);});_0x30a727['on'](_0xcf83('0x15'),function(_0x5343e0){fs['unlink'](_0x3ec217);logger['error'](_0xcf83('0x1e'),_0x5343e0);_0x2f3ceb(_0x5343e0);});_0xc86822['pipe'](_0x30a727);})['on']('error',function(_0xbf1321){logger[_0xcf83('0x15')](_0xbf1321);_0x2f3ceb(_0xbf1321);})[_0xcf83('0x1f')]();});}function uploadFile(_0x4c4183){return new BPromise(function(_0xd4fcc2,_0x317bf1){var _0x3e945e=urlParse(_0x4c4183);var _0x23c56a=_0x3e945e[_0xcf83('0x20')]===_0xcf83('0x12')?https:http;var _0x52df6d={'host':_0x3e945e['host'],'path':_0x3e945e[_0xcf83('0x6')],'headers':{'user-agent':'WHAT_EVER'}};_0x23c56a[_0xcf83('0x21')](_0x52df6d,function(_0x32fa79){if(_0x32fa79[_0xcf83('0x14')]!==0xc8){_0x317bf1(new Error(_0xcf83('0x16')+_0x4c4183+_0xcf83('0x17')+_0x32fa79['statusCode']+'\x20('+_0x32fa79['statusMessage']+')'));return;}var _0x13e4ec='';_0x32fa79['on']('data',function(_0x2313fb){_0x13e4ec+=_0x2313fb;});_0x32fa79['on']('end',function(){_0xd4fcc2(_0x13e4ec);});})['on']('error',function(_0x2b8d73){_0x317bf1(_0x2b8d73);})[_0xcf83('0x1f')]();});}function convertFile(_0x2a9355,_0x920c1b){return new BPromise(function(_0x1a3d6a,_0x11edbb){var _0x5c1510=sox[_0xcf83('0x22')](_0x2a9355,_0x920c1b,{'sampleRate':0x1f40,'format':_0xcf83('0x23'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5c1510['on'](_0xcf83('0x15'),function(_0x3bb433){logger[_0xcf83('0x15')]('error\x20convert',_0x3bb433);_0x11edbb(_0x3bb433);});_0x5c1510['on'](_0xcf83('0x1f'),function(){logger[_0xcf83('0x1b')](_0xcf83('0x24'));_0x1a3d6a();});_0x5c1510[_0xcf83('0x25')]();});}function base64Decode(_0x427804,_0x36cde9){var _0x417db4=path['resolve'](__dirname,_0xcf83('0x26'),rs[_0xcf83('0x27')](0x4)+_0xcf83('0x28'));fs[_0xcf83('0x29')](_0x417db4,_0x427804,_0xcf83('0x2a'));return convertFile(_0x417db4,_0x36cde9)[_0xcf83('0x2b')](function(){try{fs[_0xcf83('0x2c')](_0x417db4);fs[_0xcf83('0x2d')](_0x36cde9,_0xcf83('0x2e'));}catch(_0x561bb1){logger[_0xcf83('0x15')](_0x561bb1);}return _0x36cde9[_0xcf83('0x2f')]('.')[0x0];});}function base64Encode(_0x4fbf80){var _0x143500=fs['readFileSync'](_0x4fbf80);return new Buffer(_0x143500)['toString'](_0xcf83('0x2a'));}exports[_0xcf83('0x30')]=function(_0x16a9be,_0x3d0de7,_0x4dbd19,_0x3b4aee,_0x39f180,_0x1823d0){var _0x2184da,_0x2c878d;var _0x619a2c=_0xcf83('0x31');var _0x516dc6=_0xcf83('0x32')+_0x16a9be;var _0x2c9bd0={};if(_0x3d0de7==='ssml'){_0x2c9bd0[_0xcf83('0x33')]={'ssml':_0x4dbd19};}else{_0x2c9bd0[_0xcf83('0x33')]={'text':_0x4dbd19};};_0x2c9bd0['voice']={'languageCode':_0x3b4aee,'ssmlGender':_0x39f180};_0x2c9bd0[_0xcf83('0x34')]={'audioEncoding':_0xcf83('0x35'),'sampleRateHertz':0x1f40};var _0xb55f07={'url':_0x619a2c+_0xcf83('0x36')+_0x516dc6,'method':_0xcf83('0x37'),'json':!![],'body':_0x2c9bd0};return rp(_0xb55f07)['then'](function(_0x2ed2f9){return new BPromise(function(_0x2f0010,_0xd86ba3){_0x2184da=path[_0xcf83('0x38')](__dirname,'tmp',rs[_0xcf83('0x27')](0x4)+'.mp3');var _0x5bfd89=Buffer[_0xcf83('0x39')](_0x2ed2f9['audioContent'],'base64');return fs[_0xcf83('0x3a')](_0x2184da,_0x5bfd89,function(_0x5f3332){_0xd86ba3(_0x5f3332);},function(_0x31ea9b){fs['chmodSync'](_0x2184da,_0xcf83('0x2e'));_0x2f0010(_0x31ea9b);});});})['then'](function(_0x1aa33b){_0x2c878d=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+'.wav');return convertFile(_0x2184da,_0x2c878d);})[_0xcf83('0x2b')](function(){try{fs[_0xcf83('0x2c')](_0x2184da);fs['chmodSync'](_0x2c878d,'777');}catch(_0x58b659){logger[_0xcf83('0x15')](_0x58b659);}logger[_0xcf83('0x1b')](_0xcf83('0x3b'),_0x2c878d[_0xcf83('0x2f')]('.')[0x0]);return _0x2c878d[_0xcf83('0x2f')]('.')[0x0];});};exports['googleTTS']=function(_0x1e12a4,_0x253ce8){var _0x1aa0a4='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x530fc2,_0x260901;var _0x1de4e9;var _0x135519={'encoding':_0xcf83('0x3c'),'method':_0xcf83('0x37'),'timeout':0x2710,'url':_0x1aa0a4,'headers':{'Content-Type':_0xcf83('0x3d')},'body':_0xcf83('0x3e')+encodeURIComponent(JSON['stringify']([[[_0xcf83('0x3f'),JSON[_0xcf83('0x40')]([_0x1e12a4,_0x253ce8||'en',![],_0xcf83('0x41')]),null,'generic']]]))};return rp(_0x135519)['then'](function(_0x4ea4fb){try{_0x1de4e9=eval(_0x4ea4fb['slice'](0x5))[0x0][0x2];}catch(_0x5dd388){throw new Error(_0xcf83('0x42')+_0x4ea4fb[_0xcf83('0x43')]);}if(!_0x1de4e9){if(_0x1e12a4[_0xcf83('0x44')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0xcf83('0x45')+_0x253ce8+_0xcf83('0x46'));}}try{_0x1de4e9=eval(_0x1de4e9)[0x0];}catch(_0x1f94eb){throw new Error('parse\x20response\x20failed:\x0a'+res['data']);}const _0x149d19=_0x1de4e9;_0x530fc2=path[_0xcf83('0x38')](__dirname,_0xcf83('0x26'),rs[_0xcf83('0x27')](0x4)+_0xcf83('0x47'));fs[_0xcf83('0x29')](_0x530fc2,_0x1de4e9,{'encoding':_0xcf83('0x2a')});_0x260901=path[_0xcf83('0x38')](__dirname,'tmp',rs[_0xcf83('0x27')](0x4)+_0xcf83('0x28'));return convertFile(_0x530fc2,_0x260901);})[_0xcf83('0x2b')](function(){try{fs['unlink'](_0x530fc2);fs[_0xcf83('0x2d')](_0x260901,_0xcf83('0x2e'));}catch(_0x34e9de){logger[_0xcf83('0x15')](_0x34e9de);}logger[_0xcf83('0x1b')](_0xcf83('0x48'),_0x260901[_0xcf83('0x2f')]('.')[0x0]);return _0x260901[_0xcf83('0x2f')]('.')[0x0];});};exports[_0xcf83('0x49')]=function(_0x58101c,_0x2e8424,_0x5bc076){return google[_0xcf83('0x4a')](_0x58101c,_0x2e8424,_0x5bc076)['then'](function(_0x5bd066){logger[_0xcf83('0x1b')](_0x5bd066[_0xcf83('0x4b')]);return rp(_0x5bd066);})[_0xcf83('0x2b')](function(_0x161a9c){var _0x5de0c7='';var _0x27bdff=0x0;try{fs[_0xcf83('0x2c')](_0x58101c);}catch(_0x243caa){logger[_0xcf83('0x15')](_0x243caa);}if(_0x161a9c&&_0x161a9c['results']){_0x5de0c7=_0x161a9c[_0xcf83('0x4c')][_0xcf83('0x4d')](function(_0xfff178){return _0xfff178&&_0xfff178[_0xcf83('0x4e')][0x0]&&_0xfff178[_0xcf83('0x4e')][0x0][_0xcf83('0x4f')]?_0xfff178[_0xcf83('0x4e')][0x0][_0xcf83('0x4f')]:'';})['join']('\x0a');_0x27bdff=_0x161a9c[_0xcf83('0x4c')][_0xcf83('0x4d')](function(_0x46d7d9){return _0x46d7d9&&_0x46d7d9[_0xcf83('0x4e')][0x0]&&_0x46d7d9[_0xcf83('0x4e')][0x0][_0xcf83('0x50')]?_0x46d7d9[_0xcf83('0x4e')][0x0][_0xcf83('0x50')]:0x0;})[_0xcf83('0x51')]('\x0a');}logger[_0xcf83('0x1b')]('googleASR\x20transcription',_0x5de0c7);logger[_0xcf83('0x1b')](_0xcf83('0x52'),_0x27bdff);return{'transcript':_0x5de0c7,'confidence':_0x27bdff};})['catch'](function(_0x3b55e4){logger[_0xcf83('0x15')](_0xcf83('0x53'),_0x3b55e4[_0xcf83('0x14')],_0x3b55e4['name'],_0x3b55e4[_0xcf83('0x54')]);});};exports[_0xcf83('0x55')]=function(_0x568b26,_0x46216c,_0x3ceed3,_0x13f26f){var _0x1d2118=apiai(_0x46216c,{'language':_0x13f26f||'en'});return _0x1d2118[_0xcf83('0x56')](_0x3ceed3,{'sessionId':md5(_0x568b26)})['then'](function(_0x3c3fdf){logger['info'](JSON['stringify'](_0x3c3fdf));return{'source':_0x3c3fdf[_0xcf83('0x57')][_0xcf83('0x58')],'resolvedQuery':_0x3c3fdf[_0xcf83('0x57')][_0xcf83('0x59')],'action':_0x3c3fdf[_0xcf83('0x57')][_0xcf83('0x5a')],'actionIncomplete':_0x3c3fdf[_0xcf83('0x57')][_0xcf83('0x5b')],'speech':_0x3c3fdf['result'][_0xcf83('0x5c')][_0xcf83('0x5d')],'score':_0x3c3fdf[_0xcf83('0x57')]['score'],'statusCode':_0x3c3fdf['status'][_0xcf83('0x5e')],'endConversation':_0x3c3fdf['result'][_0xcf83('0x5f')][_0xcf83('0x60')]||![],'isFallbackIntent':_0x3c3fdf['result'][_0xcf83('0x5f')][_0xcf83('0x61')]};});};exports[_0xcf83('0x62')]=function(_0x2cfb5d,_0x304de0,_0x40f0ea,_0x29b7aa,_0x394da8,_0x2576f2){var _0x154666=_0x29b7aa[_0xcf83('0x63')](/\\n/g,'\x0a');var _0x440f7f={'credentials':{'private_key':_0x154666,'client_email':_0x40f0ea}};var _0x2569fc=new dialogflow[(_0xcf83('0x64'))](_0x440f7f);var _0x39c892=_0x2569fc[_0xcf83('0x65')](_0x304de0,md5(_0x2cfb5d));var _0xe99a41={'session':_0x39c892,'queryInput':{'text':{'text':_0x394da8,'languageCode':_0x2576f2}}};return _0x2569fc['detectIntent'](_0xe99a41)['then'](function(_0x2eee72){if(_0x2eee72&&_0x2eee72[_0xcf83('0x44')]){logger[_0xcf83('0x1b')](_0xcf83('0x66'),JSON[_0xcf83('0x40')](_0x2eee72));var _0x56d641=_0x2eee72[0x0];if(_0x56d641){var _0x28b8da={'action':_0x56d641['queryResult'][_0xcf83('0x5a')],'allRequiredParamsPresent':_0x56d641[_0xcf83('0x67')][_0xcf83('0x68')],'endConversation':_0x56d641[_0xcf83('0x67')][_0xcf83('0x69')]&&_0x56d641[_0xcf83('0x67')][_0xcf83('0x69')]['fields']?_0x56d641[_0xcf83('0x67')]['diagnosticInfo'][_0xcf83('0x6a')][_0xcf83('0x6b')][_0xcf83('0x6c')]:![],'fulfillmentText':_0x56d641[_0xcf83('0x67')][_0xcf83('0x6d')],'intentName':_0x56d641['queryResult'][_0xcf83('0x6e')][_0xcf83('0x6f')],'intentDisplayName':_0x56d641[_0xcf83('0x67')][_0xcf83('0x6e')][_0xcf83('0x70')],'isFallbackIntent':_0x56d641['queryResult'][_0xcf83('0x6e')][_0xcf83('0x71')],'languageCode':_0x56d641['queryResult'][_0xcf83('0x72')],'queryText':_0x56d641[_0xcf83('0x67')][_0xcf83('0x73')],'responseId':_0x56d641[_0xcf83('0x74')],'score':_0x56d641[_0xcf83('0x67')][_0xcf83('0x75')],'speech':_0x56d641[_0xcf83('0x67')][_0xcf83('0x6d')],'providerResponse':JSON['stringify'](_0x2eee72)};return _0x28b8da;}}});};exports['tildeASR']=function(_0x2a14ad,_0x377373,_0x2312a2,_0x32cff6){return tilde[_0xcf83('0x4a')](_0x2a14ad,_0x377373,_0x2312a2,_0x32cff6)[_0xcf83('0x2b')](function(_0x7991f4){try{fs['unlink'](_0x2a14ad);}catch(_0x6d30c5){logger['error'](_0x6d30c5);}logger[_0xcf83('0x1b')](_0xcf83('0x76'),_0x7991f4[_0xcf83('0x4f')]);logger[_0xcf83('0x1b')](_0xcf83('0x77'),_0x7991f4[_0xcf83('0x50')]);return _0x7991f4;});};exports[_0xcf83('0x78')]=function(_0x449aff,_0x55a966,_0x551be8,_0x191471,_0x5db6ab,_0x42c7a3){var _0x260935=path[_0xcf83('0x38')](__dirname,'tmp',rs['generate'](0x4)+_0xcf83('0x47'));var _0x3ab249;return aws['polly'](_0x449aff,_0x55a966,_0x551be8,_0x191471,_0x5db6ab,_0x42c7a3,_0x260935)[_0xcf83('0x2b')](function(){_0x3ab249=path[_0xcf83('0x38')](__dirname,_0xcf83('0x26'),rs['generate'](0x4)+'.wav');return convertFile(_0x260935,_0x3ab249);})[_0xcf83('0x2b')](function(){try{fs[_0xcf83('0x2c')](_0x260935);fs['chmodSync'](_0x3ab249,_0xcf83('0x2e'));}catch(_0x15cdc5){logger[_0xcf83('0x15')](_0x15cdc5);}return _0x3ab249['split']('.')[0x0];});};exports[_0xcf83('0x79')]=function(_0x1a0d8c,_0x51d399,_0x2da16f,_0xf1bc40,_0x3f04c8,_0x4c8dcb){return aws[_0xcf83('0x7a')](_0x1a0d8c,_0x51d399,_0x2da16f,_0xf1bc40,_0x3f04c8,_0x4c8dcb)[_0xcf83('0x2b')](function(_0x43893e){logger[_0xcf83('0x1b')](JSON[_0xcf83('0x40')](_0x43893e));return _0x43893e;});};exports['ispeechTTS']=function(_0x233476,_0x39456a,_0x40ecba,_0x420b06){var _0x557774=util[_0xcf83('0x7b')](_0xcf83('0x7c'),ISPEECH_API,_0x233476,encodeURIComponent(_0x39456a),_0x40ecba,_0x420b06);var _0x242fea=path[_0xcf83('0x38')](__dirname,'tmp',rs[_0xcf83('0x27')](0x4)+_0xcf83('0x47'));var _0x1187c3;return downloadFile(_0x557774,_0x242fea)[_0xcf83('0x2b')](function(){_0x1187c3=path[_0xcf83('0x38')](__dirname,_0xcf83('0x26'),rs[_0xcf83('0x27')](0x4)+_0xcf83('0x28'));return convertFile(_0x242fea,_0x1187c3);})[_0xcf83('0x2b')](function(){try{fs['unlink'](_0x242fea);fs['chmodSync'](_0x1187c3,_0xcf83('0x2e'));}catch(_0x75850){logger[_0xcf83('0x15')](_0x75850);}return _0x1187c3['split']('.')[0x0];});};exports[_0xcf83('0x7d')]=function(_0x5c9194,_0x48ca5e,_0x2e4e22,_0x4b675e){var _0x1aa47b=util['format'](_0xcf83('0x7e'),ISPEECH_API,_0x48ca5e,_0x2e4e22,base64Encode(_0x5c9194),_0x4b675e?util[_0xcf83('0x7b')](_0xcf83('0x7f'),encodeURIComponent(_0x4b675e)):_0xcf83('0x80'));return uploadFile(_0x1aa47b)[_0xcf83('0x2b')](function(_0x17c2a4){return querystring[_0xcf83('0x81')](_0x17c2a4);});};exports['sestekNDA']=function(_0x28165b,_0x512207){return sestek['nda'](_0x28165b,_0x512207)['then'](function(_0x282723){logger[_0xcf83('0x1b')](JSON[_0xcf83('0x40')](_0x282723));var _0x11f2b8={'speech':_0x282723[_0xcf83('0x82')],'action':_0x282723[_0xcf83('0x83')]?_0x282723[_0xcf83('0x83')][_0xcf83('0x84')]:undefined,'actiondata':_0x282723[_0xcf83('0x83')]?_0x282723[_0xcf83('0x83')][_0xcf83('0x85')]:undefined};if(_0x282723[_0xcf83('0x83')]&&_0x282723['channelData']['AudioFromTts']){return base64Decode(_0x282723[_0xcf83('0x83')][_0xcf83('0x86')][_0xcf83('0x87')],path[_0xcf83('0x38')](__dirname,'tmp',rs[_0xcf83('0x27')](0x4)+_0xcf83('0x28')))[_0xcf83('0x2b')](function(_0x54d2a0){_0x11f2b8['audiofile']=_0x54d2a0;return _0x11f2b8;});}return _0x11f2b8;});};exports[_0xcf83('0x88')]=function(){return __dirname;}; \ No newline at end of file +var _0xd3e6=['transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','name','message','googleDialogflow','source','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','code','endConversation','metadata','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','fulfillmentText','intent','isFallback','languageCode','queryText','responseId','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','parse','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','https','path','querystring','request-promise','randomstring','sox','google-tts-api','url','util','./google','./sestek','./tilde','../../../config/logger','agi','protocol','https:','host','WHAT_EVER','get','statusCode','request\x20to\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','error','unlink','download\x20error','pipe','end','\x20failed,\x20status\x20code\x20=\x20','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','?key=','input','audioConfig','MP3','text:synthesize','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','POST','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','parse\x20response\x20failed:\x0a','length','lang\x20\x22','\x22\x20might\x20not\x20exist','writeFileSync','asr','uri','results','map','alternatives'];(function(_0x3fa4bd,_0x14a72d){var _0x358c95=function(_0x55c7fc){while(--_0x55c7fc){_0x3fa4bd['push'](_0x3fa4bd['shift']());}};_0x358c95(++_0x14a72d);}(_0xd3e6,0x153));var _0x6d3e=function(_0x105390,_0x261196){_0x105390=_0x105390-0x0;var _0x1b742c=_0xd3e6[_0x105390];return _0x1b742c;};'use strict';var apiai=require(_0x6d3e('0x0'));var BPromise=require(_0x6d3e('0x1'));var dialogflow=require(_0x6d3e('0x2'));var fs=require('fs');var http=require('http');var https=require(_0x6d3e('0x3'));var md5=require('md5');var path=require(_0x6d3e('0x4'));var querystring=require(_0x6d3e('0x5'));var rp=require(_0x6d3e('0x6'));var rs=require(_0x6d3e('0x7'));var sox=require(_0x6d3e('0x8'));var tts=require(_0x6d3e('0x9'));var urlParse=require(_0x6d3e('0xa'))['parse'];var util=require(_0x6d3e('0xb'));var aws=require('./aws');var google=require(_0x6d3e('0xc'));var sestek=require(_0x6d3e('0xd'));var tilde=require(_0x6d3e('0xe'));var logger=require(_0x6d3e('0xf'))(_0x6d3e('0x10'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x3bed96,_0x32f4f0){return new BPromise(function(_0x4acdfb,_0x28bba9){var _0x363f4d=urlParse(_0x3bed96);var _0xbd2cd6=_0x363f4d[_0x6d3e('0x11')]===_0x6d3e('0x12')?https:http;var _0x2cd039={'host':_0x363f4d[_0x6d3e('0x13')],'path':_0x363f4d[_0x6d3e('0x4')],'headers':{'user-agent':_0x6d3e('0x14')}};_0xbd2cd6[_0x6d3e('0x15')](_0x2cd039,function(_0x20b903){if(_0x20b903[_0x6d3e('0x16')]!==0xc8){logger['error'](_0x6d3e('0x17')+_0x3bed96+'\x20failed,\x20status\x20code\x20=\x20'+_0x20b903[_0x6d3e('0x16')]+'\x20('+_0x20b903[_0x6d3e('0x18')]+')');_0x28bba9(new Error(_0x6d3e('0x17')+_0x3bed96+'\x20failed,\x20status\x20code\x20=\x20'+_0x20b903['statusCode']+'\x20('+_0x20b903[_0x6d3e('0x18')]+')'));return;}var _0x59ba58=fs[_0x6d3e('0x19')](_0x32f4f0);_0x59ba58['on'](_0x6d3e('0x1a'),function(){logger[_0x6d3e('0x1b')](_0x6d3e('0x1c'));_0x59ba58[_0x6d3e('0x1d')](_0x4acdfb);});_0x59ba58['on'](_0x6d3e('0x1e'),function(_0x3abd7c){fs[_0x6d3e('0x1f')](_0x32f4f0);logger[_0x6d3e('0x1e')](_0x6d3e('0x20'),_0x3abd7c);_0x28bba9(_0x3abd7c);});_0x20b903[_0x6d3e('0x21')](_0x59ba58);})['on'](_0x6d3e('0x1e'),function(_0x308438){logger['error'](_0x308438);_0x28bba9(_0x308438);})[_0x6d3e('0x22')]();});}function uploadFile(_0x53141f){return new BPromise(function(_0x2f26fc,_0x2c00b3){var _0x21f336=urlParse(_0x53141f);var _0x427b42=_0x21f336[_0x6d3e('0x11')]===_0x6d3e('0x12')?https:http;var _0x4d0fba={'host':_0x21f336['host'],'path':_0x21f336[_0x6d3e('0x4')],'headers':{'user-agent':_0x6d3e('0x14')}};_0x427b42['get'](_0x4d0fba,function(_0x1d0908){if(_0x1d0908[_0x6d3e('0x16')]!==0xc8){_0x2c00b3(new Error(_0x6d3e('0x17')+_0x53141f+_0x6d3e('0x23')+_0x1d0908[_0x6d3e('0x16')]+'\x20('+_0x1d0908[_0x6d3e('0x18')]+')'));return;}var _0x389485='';_0x1d0908['on'](_0x6d3e('0x24'),function(_0x27a771){_0x389485+=_0x27a771;});_0x1d0908['on']('end',function(){_0x2f26fc(_0x389485);});})['on'](_0x6d3e('0x1e'),function(_0x906a1e){_0x2c00b3(_0x906a1e);})[_0x6d3e('0x22')]();});}function convertFile(_0x36f084,_0x24907f){return new BPromise(function(_0x3cadbc,_0x1bf3d0){var _0x4f70a3=sox[_0x6d3e('0x25')](_0x36f084,_0x24907f,{'sampleRate':0x1f40,'format':_0x6d3e('0x26'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4f70a3['on'](_0x6d3e('0x1e'),function(_0x493232){logger[_0x6d3e('0x1e')](_0x6d3e('0x27'),_0x493232);_0x1bf3d0(_0x493232);});_0x4f70a3['on']('end',function(){logger['info'](_0x6d3e('0x28'));_0x3cadbc();});_0x4f70a3[_0x6d3e('0x29')]();});}function base64Decode(_0x255c4f,_0x81c141){var _0x3c00bb=path[_0x6d3e('0x2a')](__dirname,_0x6d3e('0x2b'),rs[_0x6d3e('0x2c')](0x4)+_0x6d3e('0x2d'));fs['writeFileSync'](_0x3c00bb,_0x255c4f,_0x6d3e('0x2e'));return convertFile(_0x3c00bb,_0x81c141)[_0x6d3e('0x2f')](function(){try{fs[_0x6d3e('0x1f')](_0x3c00bb);fs[_0x6d3e('0x30')](_0x81c141,_0x6d3e('0x31'));}catch(_0xc0e96b){logger[_0x6d3e('0x1e')](_0xc0e96b);}return _0x81c141[_0x6d3e('0x32')]('.')[0x0];});}function base64Encode(_0x35d58c){var _0xe99cab=fs[_0x6d3e('0x33')](_0x35d58c);return new Buffer(_0xe99cab)[_0x6d3e('0x34')](_0x6d3e('0x2e'));}exports[_0x6d3e('0x35')]=function(_0x58248f,_0x320c09,_0x1b1313,_0x2f0be4,_0x5a3747,_0x166ae9){var _0x4c7d6e,_0x2794e8;var _0x35c302='https://texttospeech.googleapis.com/v1/';var _0x54b86a=_0x6d3e('0x36')+_0x58248f;var _0x27f1ea={};if(_0x320c09==='ssml'){_0x27f1ea[_0x6d3e('0x37')]={'ssml':_0x1b1313};}else{_0x27f1ea['input']={'text':_0x1b1313};};_0x27f1ea['voice']={'languageCode':_0x2f0be4,'ssmlGender':_0x5a3747};_0x27f1ea[_0x6d3e('0x38')]={'audioEncoding':_0x6d3e('0x39'),'sampleRateHertz':0x1f40};var _0xd5f8e8={'url':_0x35c302+_0x6d3e('0x3a')+_0x54b86a,'method':'POST','json':!![],'body':_0x27f1ea};return rp(_0xd5f8e8)[_0x6d3e('0x2f')](function(_0x33ccb4){return new BPromise(function(_0x226b1d,_0x2b1959){_0x4c7d6e=path[_0x6d3e('0x2a')](__dirname,'tmp',rs['generate'](0x4)+_0x6d3e('0x3b'));var _0xf491fd=Buffer[_0x6d3e('0x3c')](_0x33ccb4[_0x6d3e('0x3d')],_0x6d3e('0x2e'));return fs[_0x6d3e('0x3e')](_0x4c7d6e,_0xf491fd,function(_0x33bab7){_0x2b1959(_0x33bab7);},function(_0x588b22){fs[_0x6d3e('0x30')](_0x4c7d6e,_0x6d3e('0x31'));_0x226b1d(_0x588b22);});});})[_0x6d3e('0x2f')](function(_0x88c2eb){_0x2794e8=path[_0x6d3e('0x2a')](__dirname,'tmp',rs[_0x6d3e('0x2c')](0x4)+'.wav');return convertFile(_0x4c7d6e,_0x2794e8);})[_0x6d3e('0x2f')](function(){try{fs['unlink'](_0x4c7d6e);fs[_0x6d3e('0x30')](_0x2794e8,_0x6d3e('0x31'));}catch(_0x5722dd){logger[_0x6d3e('0x1e')](_0x5722dd);}logger[_0x6d3e('0x1b')](_0x6d3e('0x3f'),_0x2794e8[_0x6d3e('0x32')]('.')[0x0]);return _0x2794e8['split']('.')[0x0];});};exports[_0x6d3e('0x40')]=function(_0x31b206,_0x26d4ef){var _0x542a7c=_0x6d3e('0x41');var _0x190d4a,_0x5118e0;var _0x22fd0d;var _0x576b6={'encoding':'utf8','method':_0x6d3e('0x42'),'timeout':0x2710,'url':_0x542a7c,'headers':{'Content-Type':_0x6d3e('0x43')},'body':_0x6d3e('0x44')+encodeURIComponent(JSON[_0x6d3e('0x45')]([[[_0x6d3e('0x46'),JSON[_0x6d3e('0x45')]([_0x31b206,_0x26d4ef||'en',![],'null']),null,'generic']]]))};return rp(_0x576b6)[_0x6d3e('0x2f')](function(_0x224b74){try{_0x22fd0d=eval(_0x224b74['slice'](0x5))[0x0][0x2];}catch(_0x35165a){throw new Error(_0x6d3e('0x47')+_0x224b74['data']);}if(!_0x22fd0d){if(_0x31b206[_0x6d3e('0x48')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error(_0x6d3e('0x49')+_0x26d4ef+_0x6d3e('0x4a'));}}try{_0x22fd0d=eval(_0x22fd0d)[0x0];}catch(_0xe5ab86){throw new Error(_0x6d3e('0x47')+res[_0x6d3e('0x24')]);}const _0xbb85fb=_0x22fd0d;_0x190d4a=path[_0x6d3e('0x2a')](__dirname,_0x6d3e('0x2b'),rs[_0x6d3e('0x2c')](0x4)+'.mp3');fs[_0x6d3e('0x4b')](_0x190d4a,_0x22fd0d,{'encoding':'base64'});_0x5118e0=path[_0x6d3e('0x2a')](__dirname,_0x6d3e('0x2b'),rs['generate'](0x4)+_0x6d3e('0x2d'));return convertFile(_0x190d4a,_0x5118e0);})[_0x6d3e('0x2f')](function(){try{fs[_0x6d3e('0x1f')](_0x190d4a);fs[_0x6d3e('0x30')](_0x5118e0,_0x6d3e('0x31'));}catch(_0xd08c57){logger[_0x6d3e('0x1e')](_0xd08c57);}logger[_0x6d3e('0x1b')]('goggleTTS\x20path',_0x5118e0['split']('.')[0x0]);return _0x5118e0[_0x6d3e('0x32')]('.')[0x0];});};exports['googleASR']=function(_0x1a1ad1,_0x40b15a,_0x3dca0c){return google[_0x6d3e('0x4c')](_0x1a1ad1,_0x40b15a,_0x3dca0c)[_0x6d3e('0x2f')](function(_0x42367c){logger[_0x6d3e('0x1b')](_0x42367c[_0x6d3e('0x4d')]);return rp(_0x42367c);})[_0x6d3e('0x2f')](function(_0x3fd4ab){var _0x1597da='';var _0x39855a=0x0;try{fs[_0x6d3e('0x1f')](_0x1a1ad1);}catch(_0x4ba2a1){logger['error'](_0x4ba2a1);}if(_0x3fd4ab&&_0x3fd4ab[_0x6d3e('0x4e')]){_0x1597da=_0x3fd4ab[_0x6d3e('0x4e')][_0x6d3e('0x4f')](function(_0x5e3ac6){return _0x5e3ac6&&_0x5e3ac6['alternatives'][0x0]&&_0x5e3ac6[_0x6d3e('0x50')][0x0][_0x6d3e('0x51')]?_0x5e3ac6[_0x6d3e('0x50')][0x0]['transcript']:'';})[_0x6d3e('0x52')]('\x0a');_0x39855a=_0x3fd4ab[_0x6d3e('0x4e')]['map'](function(_0x3f3d9b){return _0x3f3d9b&&_0x3f3d9b[_0x6d3e('0x50')][0x0]&&_0x3f3d9b[_0x6d3e('0x50')][0x0][_0x6d3e('0x53')]?_0x3f3d9b[_0x6d3e('0x50')][0x0]['confidence']:0x0;})[_0x6d3e('0x52')]('\x0a');}logger['info'](_0x6d3e('0x54'),_0x1597da);logger[_0x6d3e('0x1b')](_0x6d3e('0x55'),_0x39855a);return{'transcript':_0x1597da,'confidence':_0x39855a};})['catch'](function(_0x1841ca){logger[_0x6d3e('0x1e')](_0x6d3e('0x56'),_0x1841ca['statusCode'],_0x1841ca[_0x6d3e('0x57')],_0x1841ca[_0x6d3e('0x58')]);});};exports[_0x6d3e('0x59')]=function(_0x257812,_0x1f97a9,_0x2a6422,_0x25bfdc){var _0x38e2c5=apiai(_0x1f97a9,{'language':_0x25bfdc||'en'});return _0x38e2c5['textRequest'](_0x2a6422,{'sessionId':md5(_0x257812)})['then'](function(_0x149aef){logger[_0x6d3e('0x1b')](JSON['stringify'](_0x149aef));return{'source':_0x149aef['result'][_0x6d3e('0x5a')],'resolvedQuery':_0x149aef[_0x6d3e('0x5b')][_0x6d3e('0x5c')],'action':_0x149aef[_0x6d3e('0x5b')][_0x6d3e('0x5d')],'actionIncomplete':_0x149aef['result'][_0x6d3e('0x5e')],'speech':_0x149aef[_0x6d3e('0x5b')][_0x6d3e('0x5f')][_0x6d3e('0x60')],'score':_0x149aef['result'][_0x6d3e('0x61')],'statusCode':_0x149aef[_0x6d3e('0x62')][_0x6d3e('0x63')],'endConversation':_0x149aef[_0x6d3e('0x5b')]['metadata'][_0x6d3e('0x64')]||![],'isFallbackIntent':_0x149aef['result'][_0x6d3e('0x65')]['isFallbackIntent']};});};exports[_0x6d3e('0x66')]=function(_0x3a02ac,_0x49a6d4,_0x44c057,_0x3e2455,_0x56c4f3,_0x2c8981){var _0x3df7aa=_0x3e2455[_0x6d3e('0x67')](/\\n/g,'\x0a');var _0x4544bd={'credentials':{'private_key':_0x3df7aa,'client_email':_0x44c057}};var _0x56296d=new dialogflow[(_0x6d3e('0x68'))](_0x4544bd);var _0x180b30=_0x56296d[_0x6d3e('0x69')](_0x49a6d4,md5(_0x3a02ac));var _0x368690={'session':_0x180b30,'queryInput':{'text':{'text':_0x56c4f3,'languageCode':_0x2c8981}}};return _0x56296d[_0x6d3e('0x6a')](_0x368690)[_0x6d3e('0x2f')](function(_0x26368b){if(_0x26368b&&_0x26368b['length']){logger['info']('Dialogflow\x20V2\x20response:',JSON[_0x6d3e('0x45')](_0x26368b));var _0x27d784=_0x26368b[0x0];if(_0x27d784){var _0x1f35ef={'action':_0x27d784[_0x6d3e('0x6b')][_0x6d3e('0x5d')],'allRequiredParamsPresent':_0x27d784[_0x6d3e('0x6b')][_0x6d3e('0x6c')],'endConversation':_0x27d784[_0x6d3e('0x6b')]['diagnosticInfo']&&_0x27d784[_0x6d3e('0x6b')][_0x6d3e('0x6d')][_0x6d3e('0x6e')]?_0x27d784[_0x6d3e('0x6b')]['diagnosticInfo'][_0x6d3e('0x6e')][_0x6d3e('0x6f')]['boolValue']:![],'fulfillmentText':_0x27d784[_0x6d3e('0x6b')][_0x6d3e('0x70')],'intentName':_0x27d784[_0x6d3e('0x6b')]['intent'][_0x6d3e('0x57')],'intentDisplayName':_0x27d784[_0x6d3e('0x6b')]['intent']['displayName'],'isFallbackIntent':_0x27d784[_0x6d3e('0x6b')][_0x6d3e('0x71')][_0x6d3e('0x72')],'languageCode':_0x27d784[_0x6d3e('0x6b')][_0x6d3e('0x73')],'queryText':_0x27d784[_0x6d3e('0x6b')][_0x6d3e('0x74')],'responseId':_0x27d784[_0x6d3e('0x75')],'score':_0x27d784[_0x6d3e('0x6b')]['intentDetectionConfidence'],'speech':_0x27d784['queryResult'][_0x6d3e('0x70')],'providerResponse':JSON[_0x6d3e('0x45')](_0x26368b)};return _0x1f35ef;}}});};exports[_0x6d3e('0x76')]=function(_0xa7f7c,_0x1ebed7,_0x1ce22b,_0x5e9b62){return tilde['asr'](_0xa7f7c,_0x1ebed7,_0x1ce22b,_0x5e9b62)[_0x6d3e('0x2f')](function(_0x4c35b1){try{fs[_0x6d3e('0x1f')](_0xa7f7c);}catch(_0x443082){logger[_0x6d3e('0x1e')](_0x443082);}logger['info'](_0x6d3e('0x77'),_0x4c35b1[_0x6d3e('0x51')]);logger['info'](_0x6d3e('0x78'),_0x4c35b1['confidence']);return _0x4c35b1;});};exports[_0x6d3e('0x79')]=function(_0x275bb3,_0x3f73a3,_0xa5be96,_0x3c6d4b,_0x485ce7,_0x22f0b1){var _0x442647=path['resolve'](__dirname,_0x6d3e('0x2b'),rs['generate'](0x4)+'.mp3');var _0x568821;return aws[_0x6d3e('0x7a')](_0x275bb3,_0x3f73a3,_0xa5be96,_0x3c6d4b,_0x485ce7,_0x22f0b1,_0x442647)[_0x6d3e('0x2f')](function(){_0x568821=path[_0x6d3e('0x2a')](__dirname,'tmp',rs[_0x6d3e('0x2c')](0x4)+_0x6d3e('0x2d'));return convertFile(_0x442647,_0x568821);})['then'](function(){try{fs[_0x6d3e('0x1f')](_0x442647);fs[_0x6d3e('0x30')](_0x568821,_0x6d3e('0x31'));}catch(_0x432d34){logger[_0x6d3e('0x1e')](_0x432d34);}return _0x568821[_0x6d3e('0x32')]('.')[0x0];});};exports[_0x6d3e('0x7b')]=function(_0x10c60c,_0x5c1562,_0xffd8b,_0x5ae729,_0x3a82c0,_0x3e826f){return aws[_0x6d3e('0x7c')](_0x10c60c,_0x5c1562,_0xffd8b,_0x5ae729,_0x3a82c0,_0x3e826f)['then'](function(_0x4bbdf3){logger['info'](JSON[_0x6d3e('0x45')](_0x4bbdf3));return _0x4bbdf3;});};exports['ispeechTTS']=function(_0x3c8877,_0x1a2c70,_0x8cfa8e,_0x23dc74){var _0x48f917=util[_0x6d3e('0x7d')](_0x6d3e('0x7e'),ISPEECH_API,_0x3c8877,encodeURIComponent(_0x1a2c70),_0x8cfa8e,_0x23dc74);var _0xb541d0=path[_0x6d3e('0x2a')](__dirname,_0x6d3e('0x2b'),rs['generate'](0x4)+_0x6d3e('0x3b'));var _0xdb2152;return downloadFile(_0x48f917,_0xb541d0)['then'](function(){_0xdb2152=path['resolve'](__dirname,_0x6d3e('0x2b'),rs[_0x6d3e('0x2c')](0x4)+_0x6d3e('0x2d'));return convertFile(_0xb541d0,_0xdb2152);})[_0x6d3e('0x2f')](function(){try{fs[_0x6d3e('0x1f')](_0xb541d0);fs[_0x6d3e('0x30')](_0xdb2152,_0x6d3e('0x31'));}catch(_0x47a787){logger[_0x6d3e('0x1e')](_0x47a787);}return _0xdb2152[_0x6d3e('0x32')]('.')[0x0];});};exports[_0x6d3e('0x7f')]=function(_0x4ef0be,_0x3b754c,_0x426045,_0x1e397b){var _0x4dcddf=util[_0x6d3e('0x7d')](_0x6d3e('0x80'),ISPEECH_API,_0x3b754c,_0x426045,base64Encode(_0x4ef0be),_0x1e397b?util['format'](_0x6d3e('0x81'),encodeURIComponent(_0x1e397b)):_0x6d3e('0x82'));return uploadFile(_0x4dcddf)[_0x6d3e('0x2f')](function(_0x587e23){return querystring[_0x6d3e('0x83')](_0x587e23);});};exports['sestekNDA']=function(_0x59adce,_0xa712c2){return sestek[_0x6d3e('0x84')](_0x59adce,_0xa712c2)[_0x6d3e('0x2f')](function(_0x15ff68){logger[_0x6d3e('0x1b')](JSON[_0x6d3e('0x45')](_0x15ff68));var _0x212575={'speech':_0x15ff68['text'],'action':_0x15ff68['channelData']?_0x15ff68[_0x6d3e('0x85')][_0x6d3e('0x86')]:undefined,'actiondata':_0x15ff68[_0x6d3e('0x85')]?_0x15ff68['channelData'][_0x6d3e('0x87')]:undefined};if(_0x15ff68[_0x6d3e('0x85')]&&_0x15ff68[_0x6d3e('0x85')][_0x6d3e('0x88')]){return base64Decode(_0x15ff68['channelData'][_0x6d3e('0x88')][_0x6d3e('0x89')],path[_0x6d3e('0x2a')](__dirname,_0x6d3e('0x2b'),rs[_0x6d3e('0x2c')](0x4)+_0x6d3e('0x2d')))[_0x6d3e('0x2f')](function(_0x401611){_0x212575[_0x6d3e('0x8a')]=_0x401611;return _0x212575;});}return _0x212575;});};exports[_0x6d3e('0x8b')]=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 ab623c9..33c8ee4 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 _0x456d=['./nda'];(function(_0x12b8ec,_0x1655be){var _0x21af77=function(_0xe59f){while(--_0xe59f){_0x12b8ec['push'](_0x12b8ec['shift']());}};_0x21af77(++_0x1655be);}(_0x456d,0x1d4));var _0xd456=function(_0x4af5cd,_0x22abee){_0x4af5cd=_0x4af5cd-0x0;var _0x56ae09=_0x456d[_0x4af5cd];return _0x56ae09;};var nda=require(_0xd456('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var _0x205e=['./nda'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x205e,0x15d));var _0xe205=function(_0x129c94,_0x25f95a){_0x129c94=_0x129c94-0x0;var _0x100742=_0x205e[_0x129c94];return _0x100742;};var nda=require(_0xe205('0x0'));module['exports']={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index dbbda2b..00bcaa9 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 _0x5ebe=['exports','resolve','ndauth_url','/token','password','username','then','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','calleridname','dnid','extension','text','Bearer\x20','project','body','channelData','ndagenerate_audio','audio/wav','custom_action','custom_action_data','stringify','url','../../../../../config/logger','agi'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x5ebe,0x69));var _0xe5eb=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5ebe[_0x122ef9];return _0x42fba0;};'use strict';var rp=require('request-promise');var url=require(_0xe5eb('0x0'));var logger=require(_0xe5eb('0x1'))(_0xe5eb('0x2'));module[_0xe5eb('0x3')]=function(_0x1f85f8,_0x3912d6){var _0x4aa14d={'method':'POST','uri':url[_0xe5eb('0x4')](_0x3912d6[_0xe5eb('0x5')],_0xe5eb('0x6')),'form':{'grant_type':_0xe5eb('0x7'),'username':_0x3912d6[_0xe5eb('0x8')],'password':_0x3912d6[_0xe5eb('0x7')]},'json':!![]};return rp(_0x4aa14d)[_0xe5eb('0x9')](function(_0x1acd9d){var _0x5158f0={'method':'POST','uri':url['resolve'](_0x3912d6['ndassistant_url'],_0xe5eb('0xa')),'body':{'type':_0x3912d6['ndaactivity_type']||_0xe5eb('0xb'),'channelId':_0xe5eb('0xc'),'conversation':{'id':_0x1f85f8[_0xe5eb('0xd')]},'from':{'id':_0x1f85f8['callerid'],'name':_0x1f85f8[_0xe5eb('0xe')]},'recipient':{'id':_0x1f85f8[_0xe5eb('0xf')],'name':_0x1f85f8[_0xe5eb('0x10')]},'text':_0x3912d6[_0xe5eb('0x11')],'channelData':{}},'headers':{'Authorization':_0xe5eb('0x12')+_0x1acd9d['access_token']},'json':!![]};if(_0x3912d6[_0xe5eb('0x13')]){_0x5158f0[_0xe5eb('0x14')][_0xe5eb('0x15')]['ProjectName']=_0x3912d6['project'];}if(_0x3912d6[_0xe5eb('0x16')]=='1'){_0x5158f0[_0xe5eb('0x14')][_0xe5eb('0x15')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xe5eb('0x17')};}if(_0x3912d6[_0xe5eb('0x18')]){_0x5158f0['body'][_0xe5eb('0x15')]['CustomAction']=_0x3912d6['custom_action'];if(_0x3912d6['custom_action_data']){_0x5158f0[_0xe5eb('0x14')][_0xe5eb('0x15')]['CustomActionData']=_0x3912d6[_0xe5eb('0x19')];}}logger['info'](JSON[_0xe5eb('0x1a')](_0x5158f0));return rp(_0x5158f0);});}; \ No newline at end of file +var _0xcf14=['Nda','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','CustomActionData','custom_action_data','info','stringify','request-promise','../../../../../config/logger','agi','POST','ndauth_url','/token','password','username','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message'];(function(_0x26f14e,_0x2f5ad0){var _0x31f4b2=function(_0x57d1fe){while(--_0x57d1fe){_0x26f14e['push'](_0x26f14e['shift']());}};_0x31f4b2(++_0x2f5ad0);}(_0xcf14,0xa1));var _0x4cf1=function(_0x5928e,_0x15b268){_0x5928e=_0x5928e-0x0;var _0x11e5cd=_0xcf14[_0x5928e];return _0x11e5cd;};'use strict';var rp=require(_0x4cf1('0x0'));var url=require('url');var logger=require(_0x4cf1('0x1'))(_0x4cf1('0x2'));module['exports']=function(_0x3401df,_0x15f9b9){var _0x46add7={'method':_0x4cf1('0x3'),'uri':url['resolve'](_0x15f9b9[_0x4cf1('0x4')],_0x4cf1('0x5')),'form':{'grant_type':_0x4cf1('0x6'),'username':_0x15f9b9[_0x4cf1('0x7')],'password':_0x15f9b9[_0x4cf1('0x6')]},'json':!![]};return rp(_0x46add7)[_0x4cf1('0x8')](function(_0x9efe60){var _0x50273f={'method':_0x4cf1('0x3'),'uri':url[_0x4cf1('0x9')](_0x15f9b9[_0x4cf1('0xa')],_0x4cf1('0xb')),'body':{'type':_0x15f9b9[_0x4cf1('0xc')]||_0x4cf1('0xd'),'channelId':_0x4cf1('0xe'),'conversation':{'id':_0x3401df[_0x4cf1('0xf')]},'from':{'id':_0x3401df[_0x4cf1('0x10')],'name':_0x3401df[_0x4cf1('0x11')]},'recipient':{'id':_0x3401df[_0x4cf1('0x12')],'name':_0x3401df[_0x4cf1('0x13')]},'text':_0x15f9b9[_0x4cf1('0x14')],'channelData':{}},'headers':{'Authorization':_0x4cf1('0x15')+_0x9efe60['access_token']},'json':!![]};if(_0x15f9b9[_0x4cf1('0x16')]){_0x50273f[_0x4cf1('0x17')][_0x4cf1('0x18')][_0x4cf1('0x19')]=_0x15f9b9[_0x4cf1('0x16')];}if(_0x15f9b9[_0x4cf1('0x1a')]=='1'){_0x50273f[_0x4cf1('0x17')][_0x4cf1('0x18')][_0x4cf1('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x4cf1('0x1c')};}if(_0x15f9b9[_0x4cf1('0x1d')]){_0x50273f[_0x4cf1('0x17')][_0x4cf1('0x18')][_0x4cf1('0x1e')]=_0x15f9b9[_0x4cf1('0x1d')];if(_0x15f9b9['custom_action_data']){_0x50273f[_0x4cf1('0x17')]['channelData'][_0x4cf1('0x1f')]=_0x15f9b9[_0x4cf1('0x20')];}}logger[_0x4cf1('0x21')](JSON[_0x4cf1('0x22')](_0x50273f));return rp(_0x50273f);});}; \ 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 e77e528..3f0b246 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 _0xe30d=['exports','./lib/api'];(function(_0x15cd42,_0x179ac7){var _0x5d9b6e=function(_0x28ae58){while(--_0x28ae58){_0x15cd42['push'](_0x15cd42['shift']());}};_0x5d9b6e(++_0x179ac7);}(_0xe30d,0x13b));var _0xde30=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe30d[_0x3dd15e];return _0x231fd0;};'use strict';var asr=require(_0xde30('0x0'));module[_0xde30('0x1')]=function(_0x3eaf8a,_0x5501a1,_0x470a7e,_0x1f3aba){return asr(_0x3eaf8a,_0x5501a1,_0x470a7e,_0x1f3aba);}; \ No newline at end of file +var _0xb064=['./lib/api','exports'];(function(_0x14e74f,_0x4ff83e){var _0x318fa6=function(_0x2b7615){while(--_0x2b7615){_0x14e74f['push'](_0x14e74f['shift']());}};_0x318fa6(++_0x4ff83e);}(_0xb064,0x19e));var _0x4b06=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xb064[_0x1caf6a];return _0x1bf493;};'use strict';var asr=require(_0x4b06('0x0'));module[_0x4b06('0x1')]=function(_0x51a420,_0x3a0eb9,_0x51dab3,_0x11a9bb){return asr(_0x51a420,_0x3a0eb9,_0x51dab3,_0x11a9bb);}; \ 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 4b0ac5d..2938138 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 _0xe39a=['agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','digest','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','data','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','message','close','moment','../../../../../../config/logger'];(function(_0x26160d,_0x4b16e1){var _0x10ec15=function(_0x4b09d7){while(--_0x4b09d7){_0x26160d['push'](_0x26160d['shift']());}};_0x10ec15(++_0x4b16e1);}(_0xe39a,0xe8));var _0xae39=function(_0x9e81e6,_0x5ecac7){_0x9e81e6=_0x9e81e6-0x0;var _0x415212=_0xe39a[_0x9e81e6];return _0x415212;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xae39('0x0'));var crypto=require('crypto');var logger=require(_0xae39('0x1'))(_0xae39('0x2'));module[_0xae39('0x3')]=function(_0x1cc972,_0x57a0a5,_0x561b7a,_0x2f6f42){return new BPromise(function(_0x25c136,_0xdc6bf9){logger[_0xae39('0x4')](_0xae39('0x5'),_0x2f6f42||_0xae39('0x6'));var _0x3471df=new WebSocket(_0x2f6f42||_0xae39('0x6'),{'perMessageDeflate':![]});var _0x44c2be='';var _0x1a6d73='0';var _0x5f4f19='1';var _0xb9fc3a=_0xae39('0x7');function _0x2226ee(_0x2116a0){var _0x2c20c5=crypto[_0xae39('0x8')](_0xae39('0x9'));_0x2c20c5['update'](_0x2116a0);return _0x2c20c5[_0xae39('0xa')]('hex');}function _0x30eff1(){try{logger[_0xae39('0x4')](_0xae39('0xb'));var _0x42820=moment()[_0xae39('0xc')]();var _0x5c0a89=_0x2226ee(_0x42820+_0x57a0a5+_0x561b7a);_0x3471df[_0xae39('0xd')](JSON[_0xae39('0xe')]({'appID':_0x57a0a5,'timestamp':_0x42820,'appKey':_0x5c0a89}));var _0x72d2b=fs['createReadStream'](_0x1cc972);_0x72d2b['on'](_0xae39('0xf'),function(_0x556df6){_0x3471df[_0xae39('0xd')](_0x556df6);});_0x72d2b['on']('close',function(){_0x3471df['send'](_0xae39('0x10'));});}catch(_0x351bc5){logger[_0xae39('0x11')](_0xae39('0x12'),JSON[_0xae39('0xe')](_0x351bc5));_0x3471df[_0xae39('0x13')]();}}function _0x1c774e(_0x46cc5c){try{if(_0x46cc5c){var _0x75e7c3=JSON[_0xae39('0x14')](_0x46cc5c);switch(_0x75e7c3[_0xae39('0x15')]){case 0x0:if(_0x75e7c3[_0xae39('0x16')]){if(_0x75e7c3[_0xae39('0x16')][_0xae39('0x17')]){logger['info'](_0xae39('0x18'),JSON['stringify'](_0x75e7c3[_0xae39('0x16')][_0xae39('0x19')]));_0x44c2be=_0x75e7c3[_0xae39('0x16')]['hypotheses'][0x0][_0xae39('0x1a')];_0x1a6d73=_0x75e7c3[_0xae39('0x16')][_0xae39('0x19')][0x0][_0xae39('0x1b')];_0x5f4f19='0';_0xb9fc3a=_0xae39('0x1c');_0x3471df[_0xae39('0x13')]();}}break;case 0x1:logger[_0xae39('0x4')](_0xae39('0x7'));_0x5f4f19='1';_0xb9fc3a=_0xae39('0x7');break;case 0x2:logger['info'](_0xae39('0x1d'));_0x5f4f19='2';_0xb9fc3a='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0xae39('0x4')](_0xae39('0x1e'));_0x5f4f19='9';_0xb9fc3a=_0xae39('0x1e');break;case 0xa:logger['info'](_0xae39('0x1f'));_0x5f4f19='10';_0xb9fc3a=_0xae39('0x1f');break;case 0xb:logger[_0xae39('0x4')](_0xae39('0x20'));_0x5f4f19='11';_0xb9fc3a=_0xae39('0x20');}}}catch(_0x3d48b1){logger[_0xae39('0x11')](_0xae39('0x21'),JSON[_0xae39('0xe')](_0x3d48b1));_0x3471df[_0xae39('0x13')]();}}function _0x10044a(){logger[_0xae39('0x4')]('Close\x20Tilde\x20ASR\x20socket');_0x25c136({'transcript':_0x44c2be,'confidence':_0x1a6d73,'status':_0x5f4f19,'status_message':_0xb9fc3a});}function _0x3af1fe(_0x16044b){logger['error'](_0xae39('0x22'));if(!_[_0xae39('0x23')](_0x16044b)){logger[_0xae39('0x11')](_[_0xae39('0x24')](_0x16044b)?JSON[_0xae39('0xe')](_0x16044b):_0x16044b);}}_0x3471df['on']('open',_0x30eff1);_0x3471df['on'](_0xae39('0x25'),_0x1c774e);_0x3471df['on'](_0xae39('0x26'),_0x10044a);_0x3471df['on']('error',_0x3af1fe);});}; \ No newline at end of file +var _0xb74f=['agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','update','digest','hex','info','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','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.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','lodash','moment','../../../../../../config/logger'];(function(_0x4ad97d,_0x442617){var _0x1e6c22=function(_0xd152a0){while(--_0xd152a0){_0x4ad97d['push'](_0x4ad97d['shift']());}};_0x1e6c22(++_0x442617);}(_0xb74f,0x1b5));var _0xfb74=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb74f[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require('bluebird');var _=require(_0xfb74('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xfb74('0x1'));var crypto=require('crypto');var logger=require(_0xfb74('0x2'))(_0xfb74('0x3'));module[_0xfb74('0x4')]=function(_0x2bc6bd,_0x262fde,_0x4a97e2,_0x86a170){return new BPromise(function(_0x4921bb,_0x4fb248){logger['info'](_0xfb74('0x5'),_0x86a170||_0xfb74('0x6'));var _0x560938=new WebSocket(_0x86a170||_0xfb74('0x6'),{'perMessageDeflate':![]});var _0x458c53='';var _0x19acb0='0';var _0x1da7bf='1';var _0x1fa77b='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x3b0664(_0x187fd2){var _0x33341c=crypto[_0xfb74('0x7')](_0xfb74('0x8'));_0x33341c[_0xfb74('0x9')](_0x187fd2);return _0x33341c[_0xfb74('0xa')](_0xfb74('0xb'));}function _0x32c8ff(){try{logger[_0xfb74('0xc')]('Open\x20Tilde\x20ASR\x20socket');var _0x346b85=moment()[_0xfb74('0xd')]();var _0xfa3514=_0x3b0664(_0x346b85+_0x262fde+_0x4a97e2);_0x560938[_0xfb74('0xe')](JSON[_0xfb74('0xf')]({'appID':_0x262fde,'timestamp':_0x346b85,'appKey':_0xfa3514}));var _0x4f4691=fs[_0xfb74('0x10')](_0x2bc6bd);_0x4f4691['on'](_0xfb74('0x11'),function(_0x29ee21){_0x560938[_0xfb74('0xe')](_0x29ee21);});_0x4f4691['on'](_0xfb74('0x12'),function(){_0x560938['send'](_0xfb74('0x13'));});}catch(_0x480971){logger[_0xfb74('0x14')](_0xfb74('0x15'),JSON[_0xfb74('0xf')](_0x480971));_0x560938[_0xfb74('0x16')]();}}function _0x12bf8d(_0x5142fa){try{if(_0x5142fa){var _0x2d1103=JSON[_0xfb74('0x17')](_0x5142fa);switch(_0x2d1103[_0xfb74('0x18')]){case 0x0:if(_0x2d1103[_0xfb74('0x19')]){if(_0x2d1103[_0xfb74('0x19')][_0xfb74('0x1a')]){logger['info'](_0xfb74('0x1b'),JSON[_0xfb74('0xf')](_0x2d1103['result'][_0xfb74('0x1c')]));_0x458c53=_0x2d1103[_0xfb74('0x19')][_0xfb74('0x1c')][0x0][_0xfb74('0x1d')];_0x19acb0=_0x2d1103[_0xfb74('0x19')][_0xfb74('0x1c')][0x0]['likelihood'];_0x1da7bf='0';_0x1fa77b='Success.';_0x560938['terminate']();}}break;case 0x1:logger[_0xfb74('0xc')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x1da7bf='1';_0x1fa77b=_0xfb74('0x1e');break;case 0x2:logger[_0xfb74('0xc')](_0xfb74('0x1f'));_0x1da7bf='2';_0x1fa77b=_0xfb74('0x1f');break;case 0x9:logger[_0xfb74('0xc')](_0xfb74('0x20'));_0x1da7bf='9';_0x1fa77b=_0xfb74('0x20');break;case 0xa:logger[_0xfb74('0xc')]('Authentication\x20failed.');_0x1da7bf='10';_0x1fa77b='Authentication\x20failed.';break;case 0xb:logger[_0xfb74('0xc')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x1da7bf='11';_0x1fa77b=_0xfb74('0x21');}}}catch(_0x1ed81a){logger[_0xfb74('0x14')](_0xfb74('0x22'),JSON[_0xfb74('0xf')](_0x1ed81a));_0x560938[_0xfb74('0x16')]();}}function _0x3d6906(){logger['info'](_0xfb74('0x23'));_0x4921bb({'transcript':_0x458c53,'confidence':_0x19acb0,'status':_0x1da7bf,'status_message':_0x1fa77b});}function _0x3394e8(_0xfb73f1){logger[_0xfb74('0x14')](_0xfb74('0x24'));if(!_['isNil'](_0xfb73f1)){logger[_0xfb74('0x14')](_[_0xfb74('0x25')](_0xfb73f1)?JSON[_0xfb74('0xf')](_0xfb73f1):_0xfb73f1);}}_0x560938['on'](_0xfb74('0x26'),_0x32c8ff);_0x560938['on'](_0xfb74('0x27'),_0x12bf8d);_0x560938['on'](_0xfb74('0x12'),_0x3d6906);_0x560938['on'](_0xfb74('0x14'),_0x3394e8);});}; \ 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 f3739b2..10cb4be 100644 --- a/server/services/agi/scripts/tilde/index.js +++ b/server/services/agi/scripts/tilde/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe8a1=['exports','./asr'];(function(_0x441678,_0x4cdd69){var _0xbf89c3=function(_0x4c92f9){while(--_0x4c92f9){_0x441678['push'](_0x441678['shift']());}};_0xbf89c3(++_0x4cdd69);}(_0xe8a1,0x7f));var _0x1e8a=function(_0x4c1f8,_0x5220fa){_0x4c1f8=_0x4c1f8-0x0;var _0x2e710b=_0xe8a1[_0x4c1f8];return _0x2e710b;};var asr=require(_0x1e8a('0x0'));module[_0x1e8a('0x1')]={'asr':asr}; \ No newline at end of file +var asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 0a45cf5..eff2afb 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 _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x23292a,_0x1e08ea){var _0x4564f2=function(_0x1ae201){while(--_0x1ae201){_0x23292a['push'](_0x23292a['shift']());}};_0x4564f2(++_0x1e08ea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file +var _0xd8b0=['getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','./channel','127.0.0.1','call','error','E_AGI_ARGUMENT_PORT','listen','listening','emit','connection'];(function(_0x2b6618,_0x506202){var _0x139943=function(_0x411128){while(--_0x411128){_0x2b6618['push'](_0x2b6618['shift']());}};_0x139943(++_0x506202);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0x0d8b('0x0'));var net=require(_0x0d8b('0x1'));var EventEmitter=require('events')['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0d8b('0x2'));var AGIServer=function(_0x5b9b89,_0x43bca1,_0x364286){var _0x8196ed=this;var _0x577834=null;var _0x5e15e6=0x0;if(!_0x5b9b89)_0x5b9b89=0x11dd;if(!_0x43bca1)_0x43bca1=_0x0d8b('0x3');EventEmitter[_0x0d8b('0x4')](_0x8196ed);function _0x39f43a(){if(!_0x5b9b89){_0x8196ed['emit'](_0x0d8b('0x5'),new AGIError(_0x0d8b('0x6')));return![];}_0x577834=net['createServer']();_0x577834[_0x0d8b('0x7')](_0x5b9b89,_0x43bca1);_0x577834['on'](_0x0d8b('0x8'),function(){_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0x8'));});_0x577834['on'](_0x0d8b('0xa'),function(_0x1cac62){_0x577834[_0x0d8b('0xb')](function(_0x28f87c,_0x48fa16){if(_0x28f87c){_0x8196ed[_0x0d8b('0x9')]('error',new AGIError(_0x0d8b('0xc'),_0x28f87c));}else if(_0x364286&&_0x364286<0x0){_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0x5'),new AGIError(_0x0d8b('0xd')));_0x1cac62[_0x0d8b('0xe')]();}else if(_0x364286&&_0x364286>0x0&&_0x364286<_0x48fa16){_0x5e15e6+=0x1;_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0x5'),new AGIError(_0x0d8b('0xf'),_0x5e15e6));_0x1cac62[_0x0d8b('0xe')]();}else{var _0x2ce75e=new AGIChannel(_0x1cac62);_0x2ce75e['on'](_0x0d8b('0x10'),function(){_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x2ce75e);});}});});_0x577834['on'](_0x0d8b('0x5'),function(_0x4f6f21){_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0x5'),new AGIError(_0x0d8b('0xc'),_0x4f6f21[_0x0d8b('0x11')]));});_0x577834['on'](_0x0d8b('0x12'),function(){_0x8196ed['emit'](_0x0d8b('0x12'),new AGIError(_0x0d8b('0x13')));});}process[_0x0d8b('0x14')](function(){_0x39f43a();});};util[_0x0d8b('0x15')](AGIServer,EventEmitter);module[_0x0d8b('0x16')]=function(_0x18dd2d,_0x264b39,_0xa3612a){return new AGIServer(_0x18dd2d,_0x264b39,_0xa3612a);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 0f51915..dac3e19 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 _0xed95=['SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','generate','hiddendigitspos','first','substr','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','streamFile','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','message','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','NOBEEP','recordFile','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','%s/recordings/%s','beep','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeechTTS','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','agentPause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue_id','no\x20queue\x20selected','getVoiceQueue','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','Executed\x20command\x20%s\x20%s','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','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','email','user','subject','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','Answer','Skipped\x20Answer','no\x20subproject\x20selected','getSquareProject','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','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','unpause','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','exports','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','rawBody','menu','getdigits','getsecretdigits','rpc','mailRpc','prototype','getVariable','getVariableById','then','catch','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUserById','name','getTrunk','getTrunkById','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','interval','map','format','%s/sounds/converted/%s','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','close','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','label','arg_1','callerid','createSquareRecording','uniqueid','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','agent','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','MP3','googleTTS','google_tts_language','restAPI','timeout','number','includes','POST','method','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','parse','computedVariables','sync','render','url','stringify','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','key','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','tildeASR','appid','appsecret','uri','agicommand','hasOwnProperty','replaceAllVariables','recursiveNodeIndex','isArray','length','isString','saveRestApiResult','isPlainObject','%s.%s','setVariable','replaceObjectAllVariables','split','replaceAll','extra','getAndSetVariable','result','retry','maxRetry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','no\x20list\x20selected','add','delay','minutes','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','no\x20grammar\x20configured','MRCPRecog','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','query','no\x20query\x20configured','replace','getQueryOdbc','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','SIP/%s','opts','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','DIALOGFLOW_%s','speech','out','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','unlink','.wav','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name'];(function(_0x3bd498,_0x2cf55b){var _0x1743b4=function(_0x412f38){while(--_0x412f38){_0x3bd498['push'](_0x3bd498['shift']());}};_0x1743b4(++_0x2cf55b);}(_0xed95,0xb9));var _0x5ed9=function(_0x1db547,_0x55d50e){_0x1db547=_0x1db547-0x0;var _0x1f1a58=_0xed95[_0x1db547];return _0x1f1a58;};'use strict';var fs=require('fs');var util=require(_0x5ed9('0x0'));var _=require(_0x5ed9('0x1'));var sh=require(_0x5ed9('0x2'));var odbc=require(_0x5ed9('0x3'))();var rs=require(_0x5ed9('0x4'));var moment=require(_0x5ed9('0x5'));var Mustache=require(_0x5ed9('0x6'));var rp=require(_0x5ed9('0x7'));var logger=require(_0x5ed9('0x8'))(_0x5ed9('0x9'));var config=require(_0x5ed9('0xa'));var scripts=require(_0x5ed9('0xb'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders',_0x5ed9('0xc')];var verticesWithRetry=[_0x5ed9('0xd'),_0x5ed9('0xe'),_0x5ed9('0xf')];var AGIVertices=function(_0x2d5474,_0x40e8eb,_0x5b48b1){this['channel']=_0x2d5474;this[_0x5ed9('0x10')]=_0x40e8eb;this[_0x5ed9('0x11')]=_0x5b48b1;};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x13')]=function(_0x526924,_0x575782){this[_0x5ed9('0x10')][_0x5ed9('0x14')](_0x526924)[_0x5ed9('0x15')](function(_0x2ed72e){_0x575782(null,_0x2ed72e?_0x2ed72e['name']:![]);})[_0x5ed9('0x16')](function(_0x110d83){_0x575782(_0x110d83);});};AGIVertices[_0x5ed9('0x12')]['getVoiceQueue']=function(_0x56695a,_0x3de296){this[_0x5ed9('0x10')]['getVoiceQueueById'](_0x56695a)[_0x5ed9('0x15')](function(_0x34ed28){_0x3de296(null,_0x34ed28?_0x34ed28['name']:![]);})['catch'](function(_0x1d2d60){_0x3de296(_0x1d2d60);});};AGIVertices[_0x5ed9('0x12')]['getSquareProject']=function(_0x3de09e,_0x10b784){this['rpc'][_0x5ed9('0x17')](_0x3de09e)[_0x5ed9('0x15')](function(_0x54a570){_0x10b784(null,_0x54a570?_0x54a570['name']:![]);})['catch'](function(_0x510ffe){_0x10b784(_0x510ffe);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x18')]=function(_0x3892d8,_0x44b8ca){this['rpc'][_0x5ed9('0x19')](_0x3892d8)[_0x5ed9('0x15')](function(_0x5cb2c1){_0x44b8ca(null,_0x5cb2c1?_0x5cb2c1['dsn']:![]);})['catch'](function(_0x302ec1){_0x44b8ca(_0x302ec1);});};AGIVertices[_0x5ed9('0x12')]['getUser']=function(_0x5eda05,_0xe7680){this[_0x5ed9('0x10')][_0x5ed9('0x1a')](_0x5eda05)['then'](function(_0x18b8c8){_0xe7680(null,_0x18b8c8?_0x18b8c8[_0x5ed9('0x1b')]:![]);})[_0x5ed9('0x16')](function(_0x40244e){_0xe7680(_0x40244e);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x1c')]=function(_0x5da4d5,_0x492f36){this[_0x5ed9('0x10')][_0x5ed9('0x1d')](_0x5da4d5)[_0x5ed9('0x15')](function(_0x5b56df){_0x492f36(null,_0x5b56df?_0x5b56df['name']:![]);})[_0x5ed9('0x16')](function(_0x3a4968){_0x492f36(_0x3a4968);});};AGIVertices[_0x5ed9('0x12')]['getSound']=function(_0x1bc137,_0x7de1d2){var _0x389a73=this;this['rpc'][_0x5ed9('0x1e')](_0x1bc137)[_0x5ed9('0x15')](function(_0x411729){_0x7de1d2(null,_0x411729?_0x389a73[_0x5ed9('0x1f')](_0x411729['save_name']):![]);})['catch'](function(_0x43863c){_0x7de1d2(_0x43863c);});};AGIVertices['prototype'][_0x5ed9('0x20')]=function(_0xb39190,_0x1585e3){this[_0x5ed9('0x10')][_0x5ed9('0x21')](_0xb39190)[_0x5ed9('0x15')](function(_0xba5b97){_0x1585e3(null,_0xba5b97?_0xba5b97:![]);})['catch'](function(_0x58e2d0){_0x1585e3(_0x58e2d0);});};AGIVertices['prototype'][_0x5ed9('0x22')]=function(_0x36d050,_0x2cb3d2,_0x5da46e){this[_0x5ed9('0x11')]['sendMailMessage'](_0x36d050,_0x2cb3d2)[_0x5ed9('0x15')](function(){_0x5da46e(null);})[_0x5ed9('0x16')](function(_0x3061cd){_0x5da46e(_0x3061cd);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x23')]=function(_0x448778,_0x4a6567){this[_0x5ed9('0x10')][_0x5ed9('0x24')](_0x448778)[_0x5ed9('0x15')](function(_0x4c573e){if(_0x4c573e){if(_0x4c573e['IntervalId']){_0x4a6567(null,[_0x4c573e[_0x5ed9('0x25')]]);}else{_0x4a6567(null,_[_0x5ed9('0x26')](_0x4c573e['Intervals'],'interval'));}}else{_0x4a6567(null,![]);}})[_0x5ed9('0x16')](function(_0x1536c3){_0x4a6567(_0x1536c3);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x1f')]=function(_0x29346d){return util[_0x5ed9('0x27')](_0x5ed9('0x28'),FILES_PATH,_0x29346d);};AGIVertices[_0x5ed9('0x12')]['getQueryOdbc']=function(_0x4bfe28,_0x59896b,_0x4699a0){odbc[_0x5ed9('0x29')](_0x4bfe28,function(_0x4f261f){if(_0x4f261f){logger[_0x5ed9('0x2a')](_0x5ed9('0x2b'),_0x4f261f);_0x4699a0(_0x4f261f);}else{logger[_0x5ed9('0x2c')](_0x5ed9('0x2d'));odbc['query'](_0x59896b,function(_0x34e190,_0x89486e){if(_0x34e190){logger[_0x5ed9('0x2c')](_0x5ed9('0x2e'),_0x59896b);_0x4699a0(_0x34e190);}else{logger[_0x5ed9('0x2c')]('Query\x20executed\x20correctly\x20%s',_0x59896b);odbc[_0x5ed9('0x2f')](function(_0x2f728e){if(_0x2f728e){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x2f728e);}_0x4699a0(null,_0x89486e);});}});}});};AGIVertices[_0x5ed9('0x12')]['getSmsAccount']=function(_0x4fedbe,_0x5a9287){this[_0x5ed9('0x10')][_0x5ed9('0x30')](_0x4fedbe)['then'](function(_0x5f20a1){_0x5a9287(null,_0x5f20a1?_0x5f20a1:![]);})[_0x5ed9('0x16')](function(_0xb6ac0d){_0x5a9287(_0xb6ac0d);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x31')]=function(_0x3c4bbe,_0x3e844b){this[_0x5ed9('0x10')][_0x5ed9('0x31')](_0x3c4bbe)[_0x5ed9('0x15')](function(_0xbc9f61){_0x3e844b(null,_0xbc9f61);})[_0x5ed9('0x16')](function(_0xba8cc){_0x3e844b(_0xba8cc);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x32')]=function(_0x5b61af,_0x4494d1,_0x18bf88){this[_0x5ed9('0x10')][_0x5ed9('0x32')]({'uniqueid':this[_0x5ed9('0x33')]['uniqueid'],'node':_0x5b61af[_0x5ed9('0x34')],'application':_0x5b61af['agicommand'],'data':_0x4494d1||null,'project_name':this[_0x5ed9('0x33')][_0x5ed9('0x35')],'callerid':this[_0x5ed9('0x33')][_0x5ed9('0x36')]})[_0x5ed9('0x15')](function(_0x38e960){if(_0x18bf88){_0x18bf88(null,_0x38e960);}})[_0x5ed9('0x16')](function(_0x53c64f){if(_0x18bf88){_0x18bf88(_0x53c64f);}});};AGIVertices['prototype'][_0x5ed9('0x37')]=function(_0x41a1bf,_0x5a0ea6,_0x39ea43,_0x290508){this['rpc']['createSquareRecording']({'uniqueid':this[_0x5ed9('0x33')][_0x5ed9('0x38')],'callerid':this['channel'][_0x5ed9('0x36')],'calleridname':this[_0x5ed9('0x33')][_0x5ed9('0x39')],'context':this[_0x5ed9('0x33')][_0x5ed9('0x3a')],'extension':this[_0x5ed9('0x33')][_0x5ed9('0x3b')],'priority':this[_0x5ed9('0x33')][_0x5ed9('0x3c')],'accountcode':this[_0x5ed9('0x33')][_0x5ed9('0x3d')],'dnid':this[_0x5ed9('0x33')][_0x5ed9('0x3e')],'projectName':this['channel'][_0x5ed9('0x35')],'saveName':_0x5a0ea6,'filename':_0x41a1bf[_0x5ed9('0x3f')]||_0x5a0ea6,'savePath':_0x39ea43})[_0x5ed9('0x15')](function(_0x5e6515){_0x290508(null,_0x5e6515);})[_0x5ed9('0x16')](function(_0x4e65ed){_0x290508(_0x4e65ed);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x40')]=function(_0x1acd7b,_0x77d6df,_0x24b54,_0x3717fb,_0x17c434){this[_0x5ed9('0x10')][_0x5ed9('0x40')]({'uniqueid':this[_0x5ed9('0x33')][_0x5ed9('0x38')],'body':_0x1acd7b,'direction':_0x77d6df,'providerName':_0x24b54,'providerResponse':_0x3717fb})[_0x5ed9('0x15')](function(_0x533510){if(_0x17c434){_0x17c434(null,_0x533510);}})[_0x5ed9('0x16')](function(_0x1b5ff9){if(_0x17c434){_0x17c434(_0x1b5ff9);}});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x41')]=function(_0x2ca6d7,_0x550892){this['rpc']['createCmContact']({'firstName':_['isEmpty'](_0x2ca6d7['name'])||_[_0x5ed9('0x42')](_0x2ca6d7[_0x5ed9('0x1b')])?_0x5ed9('0x43')+Math[_0x5ed9('0x44')]():_0x2ca6d7[_0x5ed9('0x1b')],'lastName':_[_0x5ed9('0x45')](_0x2ca6d7[_0x5ed9('0x46')])||_[_0x5ed9('0x42')](_0x2ca6d7[_0x5ed9('0x46')])?null:_0x2ca6d7[_0x5ed9('0x46')],'phone':_0x2ca6d7[_0x5ed9('0x47')],'ListId':_0x2ca6d7[_0x5ed9('0x48')],'scheduledat':_0x2ca6d7[_0x5ed9('0x49')],'callbackUniqueid':this[_0x5ed9('0x33')]['uniqueid'],'tags':_0x5ed9('0x4a'),'description':_0x5ed9('0x4b')+_0x2ca6d7[_0x5ed9('0x49')][_0x5ed9('0x4c')](),'priority':_0x2ca6d7[_0x5ed9('0x4d')]})[_0x5ed9('0x15')](function(_0x5a090d){_0x550892(null,_0x5a090d);})[_0x5ed9('0x16')](function(_0x5dda6c){_0x550892(_0x5dda6c);});};AGIVertices['prototype'][_0x5ed9('0x4e')]=function(_0x53206f,_0x8fe239){this[_0x5ed9('0x10')]['getPauseById'](_0x53206f)[_0x5ed9('0x15')](function(_0x1bf047){_0x8fe239(null,_0x1bf047?_0x1bf047[_0x5ed9('0x1b')]:![]);})[_0x5ed9('0x16')](function(_0x573530){_0x8fe239(_0x573530);});};AGIVertices['prototype']['agentPause']=function(_0x354f7a,_0x2a66a6,_0x5f41d6){var _0x2e6f74={'role':_0x5ed9('0x4f')};_0x2e6f74[_0x354f7a]=this['channel'][_0x5ed9('0x36')];this[_0x5ed9('0x10')]['agentPause'](_0x2e6f74,_0x2a66a6,this[_0x5ed9('0x33')][_0x5ed9('0x38')])[_0x5ed9('0x15')](function(_0x4acc3d){_0x5f41d6(null,_[_0x5ed9('0x42')](_0x4acc3d)?![]:!![]);})[_0x5ed9('0x16')](function(_0x33f184){logger[_0x5ed9('0x2a')](_0x33f184);_0x5f41d6(null,![]);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x50')]=function(_0x21be65,_0xe72d99){var _0x59ecf6={'role':_0x5ed9('0x4f')};_0x59ecf6[_0x21be65]=this[_0x5ed9('0x33')][_0x5ed9('0x36')];this[_0x5ed9('0x10')][_0x5ed9('0x50')](_0x59ecf6)[_0x5ed9('0x15')](function(_0x252cac){_0xe72d99(null,_[_0x5ed9('0x42')](_0x252cac)?![]:!![]);})[_0x5ed9('0x16')](function(_0x1f6767){logger[_0x5ed9('0x2a')](_0x1f6767);_0xe72d99(null,![]);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x51')]=function(_0xa68a6c,_0x1e6c73){var _0x3d51b6={'role':'agent'};_0x3d51b6[_0xa68a6c]=this[_0x5ed9('0x33')][_0x5ed9('0x36')];this['rpc'][_0x5ed9('0x51')](_0x3d51b6)[_0x5ed9('0x15')](function(_0x15b345){_0x1e6c73(null,_[_0x5ed9('0x42')](_0x15b345)?![]:!![]);})[_0x5ed9('0x16')](function(_0x23e16d){logger[_0x5ed9('0x2a')](_0x23e16d);_0x1e6c73(null,![]);});};AGIVertices[_0x5ed9('0x12')]['agentLogin']=function(_0x30b77e,_0x575398){var _0x510c19={'role':_0x5ed9('0x4f')};_0x510c19[_0x30b77e]=this[_0x5ed9('0x33')][_0x5ed9('0x36')];var _0x570fc3=_0x30b77e!=_0x5ed9('0x52')?util[_0x5ed9('0x27')](_0x5ed9('0x53'),_0x5ed9('0x54'),this[_0x5ed9('0x33')][_0x5ed9('0x36')]):undefined;this[_0x5ed9('0x10')]['agentLogin'](_0x510c19,_0x570fc3)['then'](function(_0x4d387c){_0x575398(null,_[_0x5ed9('0x42')](_0x4d387c)?![]:!![]);})[_0x5ed9('0x16')](function(_0x5c15d3){logger[_0x5ed9('0x2a')](_0x5c15d3);_0x575398(null,![]);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x55')]=function(_0x31efd8,_0x18b411){sh[_0x5ed9('0x56')](_[_0x5ed9('0x57')](_0x31efd8),function(_0x279257,_0x1c0012){var _0x246763=_0x1c0012['replace'](/(\r\n|\n|\r)/gm,'');_0x18b411(null,_0x246763);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x58')]=function(_0x19d09c,_0x36768c){scripts[_0x5ed9('0x58')](_0x19d09c[_0x5ed9('0x59')],_0x19d09c[_0x5ed9('0x5a')]||_0x5ed9('0x5b'),_0x19d09c[_0x5ed9('0x5b')],_0x19d09c[_0x5ed9('0x5c')]||_0x5ed9('0x5d'),_0x19d09c[_0x5ed9('0x5e')]||_0x5ed9('0x5f'),_0x19d09c['audioEncoding']||_0x5ed9('0x60'))['then'](function(_0x28d100){_0x36768c(null,_0x28d100);})[_0x5ed9('0x16')](function(_0x5aa5a8){_0x36768c(_0x5aa5a8);});};AGIVertices['prototype']['googleTTS']=function(_0x1088ef,_0x29f0f3){scripts[_0x5ed9('0x61')](_0x1088ef[_0x5ed9('0x5b')],_0x1088ef[_0x5ed9('0x62')]||'en',0x1)['then'](function(_0x5c05a4){_0x29f0f3(null,_0x5c05a4);})[_0x5ed9('0x16')](function(_0x2dba3b){_0x29f0f3(_0x2dba3b);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x63')]=function(_0x55821c,_0x5bf1c0){var _0xbe0e06={'uri':_0x55821c['url'],'method':_0x55821c['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x55821c[_0x5ed9('0x64')])===_0x5ed9('0x65')&&parseInt(_0x55821c[_0x5ed9('0x64')])>=0x1?parseInt(_0x55821c['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x5ed9('0x66')]([_0x5ed9('0x67'),'PUT'],_0xbe0e06[_0x5ed9('0x68')][_0x5ed9('0x69')]())){try{_0xbe0e06[_0x5ed9('0x6a')]=_0x55821c[_0x5ed9('0xc')]?JSON['parse'](_0x55821c[_0x5ed9('0xc')]):{};}catch(_0x5bdb42){logger[_0x5ed9('0x2a')](_0x5ed9('0x6b'),_0x5bdb42);}}try{_0xbe0e06[_0x5ed9('0x6c')]=_0x55821c[_0x5ed9('0x6d')]?JSON[_0x5ed9('0x6e')](_0x55821c['rawHeaders']):{};}catch(_0x4d105e){logger['error']('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x4d105e);}if(_0x55821c[_0x5ed9('0x6f')]){try{var _0xa3e738=require(_0x55821c[_0x5ed9('0x6f')])[_0x5ed9('0x70')](this,_0xbe0e06);_0xbe0e06['uri']=Mustache[_0x5ed9('0x71')](_0x55821c[_0x5ed9('0x72')],_0xa3e738,{},['$$','$$']);if(_0xbe0e06['headers']){_0xbe0e06[_0x5ed9('0x6c')]=JSON[_0x5ed9('0x6e')](Mustache[_0x5ed9('0x71')](JSON[_0x5ed9('0x73')](_0xbe0e06[_0x5ed9('0x6c')]),_0xa3e738,{},['$$','$$']));}if(_0xbe0e06['body']){_0xbe0e06[_0x5ed9('0x6a')]=JSON[_0x5ed9('0x6e')](Mustache[_0x5ed9('0x71')](JSON[_0x5ed9('0x73')](_0xbe0e06[_0x5ed9('0x6a')]),_0xa3e738,{},['$$','$$']));}}catch(_0x24d9fe){logger[_0x5ed9('0x2a')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x24d9fe);}}rp(_0xbe0e06)[_0x5ed9('0x15')](function(_0x174a48){var _0x4200dd={'statusCode':_0x174a48[_0x5ed9('0x74')]||0xc8,'statusMessage':_0x174a48[_0x5ed9('0x75')]||'OK','headers':_0x174a48[_0x5ed9('0x6c')]||{},'body':_0x174a48['body']||{}};_0x5bf1c0(null,_0x4200dd);})[_0x5ed9('0x16')](function(_0x38176b){var _0x2fa06e={'statusCode':_0x38176b[_0x5ed9('0x74')]||0x1f4,'statusMessage':_0x38176b['message']||_0x5ed9('0x76'),'headers':_0x38176b['options'][_0x5ed9('0x6c')]||{},'body':_0x38176b[_0x5ed9('0x77')][_0x5ed9('0x6a')]||{}};_0x5bf1c0(null,_0x2fa06e);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x78')]=function(_0x5db252,_0x37b98a){scripts[_0x5ed9('0x78')](this[_0x5ed9('0x33')][_0x5ed9('0x38')],_0x5db252['key'],_0x5db252[_0x5ed9('0x5b')],_0x5db252[_0x5ed9('0x79')]||'en')[_0x5ed9('0x15')](function(_0x5d5ff3){_0x37b98a(null,_0x5d5ff3);})[_0x5ed9('0x16')](function(_0x44afb0){_0x37b98a(_0x44afb0);});};AGIVertices['prototype'][_0x5ed9('0x7a')]=function(_0x2d8868,_0x2164f1){scripts['googleDialogflowV2'](this[_0x5ed9('0x33')][_0x5ed9('0x38')],_0x2d8868[_0x5ed9('0x7b')],_0x2d8868[_0x5ed9('0x7c')],_0x2d8868[_0x5ed9('0x7d')],_0x2d8868[_0x5ed9('0x5b')],_0x2d8868[_0x5ed9('0x7e')]||'en')[_0x5ed9('0x15')](function(_0x43c8c7){_0x2164f1(null,_0x43c8c7);})[_0x5ed9('0x16')](function(_0x9a16d5){_0x2164f1(_0x9a16d5);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x7f')]=function(_0x548fee,_0x1185c8){scripts[_0x5ed9('0x7f')](this[_0x5ed9('0x33')],_0x548fee)[_0x5ed9('0x15')](function(_0x5bc97c){_0x1185c8(null,_0x5bc97c);})['catch'](function(_0x12fc45){_0x1185c8(_0x12fc45);});};AGIVertices[_0x5ed9('0x12')]['ispeechTTS']=function(_0x508e02,_0x1ddcc8){scripts['ispeechTTS'](_0x508e02[_0x5ed9('0x80')],_0x508e02[_0x5ed9('0x5b')],_0x508e02[_0x5ed9('0x81')]||_0x5ed9('0x5d'),_0x508e02[_0x5ed9('0x82')])[_0x5ed9('0x15')](function(_0x5d5d10){_0x1ddcc8(null,_0x5d5d10);})['catch'](function(_0x323e4f){_0x1ddcc8(_0x323e4f);});};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x83')]=function(_0x3fad48,_0x511069,_0x2da35f){scripts['ispeechASR'](_0x511069,_0x3fad48[_0x5ed9('0x80')],_0x3fad48[_0x5ed9('0x84')]||_0x5ed9('0x5d'),this[_0x5ed9('0x85')](_0x3fad48[_0x5ed9('0x86')])?_0x3fad48['model']:undefined)[_0x5ed9('0x15')](function(_0x1d8ce2){_0x2da35f(null,_0x1d8ce2);})[_0x5ed9('0x16')](function(_0x3994a0){_0x2da35f(_0x3994a0);});};AGIVertices['prototype']['awsPolly']=function(_0x4701a2,_0x4b84ad){scripts[_0x5ed9('0x87')](_0x4701a2[_0x5ed9('0x88')],_0x4701a2['aws_secret_access_key'],_0x4701a2['aws_polly_region'],_0x4701a2['aws_polly_voice']||_0x5ed9('0x89'),_0x4701a2[_0x5ed9('0x5b')],_0x4701a2[_0x5ed9('0x8a')]||'text')[_0x5ed9('0x15')](function(_0x4d438e){_0x4b84ad(null,_0x4d438e);})[_0x5ed9('0x16')](function(_0x46629f){_0x4b84ad(_0x46629f);});};AGIVertices[_0x5ed9('0x12')]['awsLex']=function(_0xa2b99e,_0x1481bf){scripts[_0x5ed9('0x8b')](this[_0x5ed9('0x33')][_0x5ed9('0x38')],_0xa2b99e[_0x5ed9('0x88')],_0xa2b99e[_0x5ed9('0x8c')],_0xa2b99e[_0x5ed9('0x8d')],_0xa2b99e[_0x5ed9('0x5b')],_0xa2b99e[_0x5ed9('0x8e')])[_0x5ed9('0x15')](function(_0x2b1032){_0x1481bf(null,_0x2b1032);})[_0x5ed9('0x16')](function(_0x308015){_0x1481bf(_0x308015);});};AGIVertices[_0x5ed9('0x12')]['googleASR']=function(_0x16c26e,_0xbd9ea,_0x5ad38f){scripts[_0x5ed9('0x8f')](_0xbd9ea,_0x16c26e[_0x5ed9('0x80')],_0x16c26e['google_asr_language']||_0x5ed9('0x5d'))['then'](function(_0x28a050){_0x5ad38f(null,_0x28a050);})[_0x5ed9('0x16')](function(_0x23f6dc){_0x5ad38f(_0x23f6dc);});};AGIVertices[_0x5ed9('0x12')]['tildeASR']=function(_0x3b9d38,_0x483aa0,_0x203dbd){scripts[_0x5ed9('0x90')](_0x483aa0,_0x3b9d38[_0x5ed9('0x91')],_0x3b9d38[_0x5ed9('0x92')],_0x3b9d38[_0x5ed9('0x93')])[_0x5ed9('0x15')](function(_0xda9d33){_0x203dbd(null,_0xda9d33);})[_0x5ed9('0x16')](function(_0x97d3aa){_0x203dbd(_0x97d3aa);});};AGIVertices[_0x5ed9('0x12')]['clear']=function(_0x2d4236){var _0x7d5055=_[_0x5ed9('0x66')](verticesWithRetry,_0x2d4236[_0x5ed9('0x94')])?_0x2d4236:_['clone'](_0x2d4236);for(var _0x482ff1 in _0x7d5055){if(_0x7d5055[_0x5ed9('0x95')](_0x482ff1)){if(_0x7d5055[_0x482ff1]&&_['isString'](_0x7d5055[_0x482ff1])){if(_[_0x5ed9('0x66')](recursiveMapAttributes,_0x482ff1)){_0x7d5055[_0x482ff1]=this['replaceObjectAllVariables'](_0x7d5055[_0x482ff1]);}else{_0x7d5055[_0x482ff1]=this[_0x5ed9('0x96')](_0x7d5055[_0x482ff1]);}}}}return _0x7d5055;};AGIVertices['prototype'][_0x5ed9('0x97')]=function(_0x28abb9){for(var _0x14b4c0 in _0x28abb9){if(_0x28abb9[_0x5ed9('0x95')](_0x14b4c0)){if(_['isPlainObject'](_0x28abb9[_0x14b4c0])){this['recursiveNodeIndex'](_0x28abb9[_0x14b4c0]);}else if(_[_0x5ed9('0x98')](_0x28abb9[_0x14b4c0])){for(var _0x4a8455=0x0;_0x4a8455<_0x28abb9[_0x14b4c0][_0x5ed9('0x99')];_0x4a8455++){this[_0x5ed9('0x97')](_0x28abb9[_0x14b4c0][_0x4a8455]);}}else if(_[_0x5ed9('0x9a')](_0x28abb9[_0x14b4c0])){_0x28abb9[_0x14b4c0]=this[_0x5ed9('0x96')](_0x28abb9[_0x14b4c0]);}}}};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x9b')]=function(_0x442c46,_0x5638d0){for(var _0xd776a7 in _0x442c46){if(_0x442c46[_0x5ed9('0x95')](_0xd776a7)){if(_[_0x5ed9('0x9c')](_0x442c46[_0xd776a7])){if(!_[_0x5ed9('0x45')](_0x442c46[_0xd776a7])){this[_0x5ed9('0x9b')](_0x442c46[_0xd776a7],util[_0x5ed9('0x27')](_0x5ed9('0x9d'),_0x5638d0,_0xd776a7));}}else if(_[_0x5ed9('0x98')](_0x442c46[_0xd776a7])){for(var _0xc7e0ae=0x0;_0xc7e0ae<_0x442c46[_0xd776a7][_0x5ed9('0x99')];_0xc7e0ae++){this[_0x5ed9('0x9b')](_0x442c46[_0xd776a7][_0xc7e0ae],util[_0x5ed9('0x27')]('%s.%s',_0x5638d0,_0xd776a7+'['+_0xc7e0ae+']'));}}else{if(!_[_0x5ed9('0x42')](_0x442c46[_0xd776a7])){this['channel'][_0x5ed9('0x9e')](util[_0x5ed9('0x27')](_0x5ed9('0x9d'),_0x5638d0,_0xd776a7),_0x442c46[_0xd776a7]);}}}}};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x9f')]=function(_0x27ebd5){try{var _0xfb4219=JSON[_0x5ed9('0x6e')](_0x27ebd5);this['recursiveNodeIndex'](_0xfb4219);return JSON['stringify'](_0xfb4219);}catch(_0x4a13f6){return this[_0x5ed9('0x96')](_0x27ebd5);}};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x96')]=function(_0x776c98){var _0xcd09fc=_0x776c98[_0x5ed9('0xa0')]('{');for(var _0x203b55=0x1;_0x203b55<_0xcd09fc[_0x5ed9('0x99')];_0x203b55+=0x1){var _0x437d69=_0xcd09fc[_0x203b55]['split']('}');if(_0x437d69[_0x5ed9('0x99')]>0x1){_0x776c98=_0x776c98[_0x5ed9('0xa1')]('{'+_0x437d69[0x0]+'}',this[_0x5ed9('0x33')][_0x5ed9('0x13')](_0x437d69[0x0])[_0x5ed9('0xa2')]||_0x437d69[0x0]);}}if(_0xcd09fc[_0x5ed9('0x99')]===0x1){return _0x776c98[_0x5ed9('0x4c')]();}return this['replaceAllVariables'](_0x776c98);};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0xa3')]=function(_0x2e143f,_0x5e6f9f){var _0x5d6141=this[_0x5ed9('0x33')][_0x5ed9('0x13')](_0x2e143f);if(_0x5d6141[_0x5ed9('0xa4')]===-0x1){return _0x5d6141;}logger['info'](util['format']('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x5e6f9f,_0x5d6141[_0x5ed9('0xa2')]));return this[_0x5ed9('0x33')][_0x5ed9('0x9e')](_0x5e6f9f,_0x5d6141[_0x5ed9('0xa2')]);};AGIVertices['prototype']['isConfigured']=function(_0x5d5b6d){return _0x5d5b6d&&_0x5d5b6d!=='0'&&_0x5d5b6d!=='-1'&&_0x5d5b6d!=='';};AGIVertices[_0x5ed9('0x12')]['maxRetry']=function(_0xee1a2d){this[_0x5ed9('0x32')]['sync'](this,_0xee1a2d,'-');_0xee1a2d[_0x5ed9('0xa5')]=_0xee1a2d[_0x5ed9('0xa6')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0xa7')]=function(_0x261853){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0xa8'),_0x261853[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x261853['text'])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xaa'));}var _0x30846e='\x22'+_0x261853[_0x5ed9('0x5b')]+'\x22';if(this[_0x5ed9('0x85')](_0x261853['options'])){_0x30846e+=','+_0x261853[_0x5ed9('0x77')];}var _0x1f6a3c=this[_0x5ed9('0x33')]['exec'](_0x5ed9('0xab'),_0x30846e);if(_0x1f6a3c[_0x5ed9('0xa4')]===-0x1){return _0x1f6a3c;}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0xac'),_0x30846e));};AGIVertices[_0x5ed9('0x12')]['mrcprecog']=function(_0x6fb15f){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0xad'),_0x6fb15f[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x6fb15f[_0x5ed9('0xae')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')]('no\x20grammar\x20configured');}var _0x6d7e5e=_0x6fb15f['grammar'];if(this['isConfigured'](_0x6fb15f[_0x5ed9('0x77')])){_0x6d7e5e+=','+_0x6fb15f['options'];}var _0x5a714b=this[_0x5ed9('0x33')][_0x5ed9('0x56')]('MRCPRecog',_0x6d7e5e);if(_0x5a714b[_0x5ed9('0xa4')]===-0x1){return _0x5a714b;}var _0x4e3bd8=this[_0x5ed9('0xa3')](_0x5ed9('0xaf'),_0x5ed9('0xb0'));if(_0x4e3bd8['result']===-0x1){return _0x4e3bd8;}var _0x497fca=this['getAndSetVariable'](_0x5ed9('0xb1'),'MRCP_RECOG_TRANSCRIPT');if(_0x497fca['result']===-0x1){return _0x497fca;}var _0x5c0b01=this['getAndSetVariable'](_0x5ed9('0xb2'),_0x5ed9('0xb3'));if(_0x5c0b01[_0x5ed9('0xa4')]===-0x1){return _0x5c0b01;}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('Executed\x20command\x20MRCPRecog\x20%s',_0x6d7e5e));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x9')]=function(_0x7ae298){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0xb4'),_0x7ae298[_0x5ed9('0x34')]));return this[_0x5ed9('0x33')][_0x5ed9('0x9')]([_0x7ae298[_0x5ed9('0xb5')],_0x7ae298[_0x5ed9('0xb6')]]);};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0xb7')]=function(_0x1dcc51){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0xb8'),_0x1dcc51[_0x5ed9('0x34')]));if(this[_0x5ed9('0x85')](_0x1dcc51['timeout'])){logger[_0x5ed9('0x2c')](util['format'](_0x5ed9('0xb9'),_0x1dcc51[_0x5ed9('0x64')]));var _0x20d284=this[_0x5ed9('0x33')]['wait'](_0x1dcc51['timeout']);if(_0x20d284[_0x5ed9('0xa4')]===-0x1){return _0x20d284;}}return this['channel'][_0x5ed9('0xb7')]();};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x4a')]=function(_0x455a84){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x455a84[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x455a84[_0x5ed9('0x48')])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x455a84,_0x5ed9('0xba'));}_0x455a84[_0x5ed9('0x49')]=moment();if(this[_0x5ed9('0x85')](_0x455a84['delay'])){_0x455a84[_0x5ed9('0x49')]=moment()[_0x5ed9('0xbb')](_0x455a84[_0x5ed9('0xbc')],_0x5ed9('0xbd'));}if(!this[_0x5ed9('0x85')](_0x455a84[_0x5ed9('0x4d')])){_0x455a84[_0x5ed9('0x4d')]=0x2;}this[_0x5ed9('0x41')][_0x5ed9('0x70')](this,_0x455a84);return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x455a84[_0x5ed9('0x47')],_0x455a84[_0x5ed9('0x48')],_0x455a84[_0x5ed9('0x49')]));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0xbe')]=function(_0x11fdcf){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0xbf'),_0x11fdcf[_0x5ed9('0x34')]));var _0x87b220=this[_0x5ed9('0x33')]['exec'](_0x11fdcf[_0x5ed9('0xc0')],_0x11fdcf['options']);if(_0x87b220[_0x5ed9('0xa4')]===-0x1){return _0x87b220;}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('Executed\x20command\x20%s\x20%s',_0x11fdcf[_0x5ed9('0xc0')],_0x11fdcf[_0x5ed9('0x77')]));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0xc1')]=function(_0xacf47e){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0xc2'),_0xacf47e[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0xacf47e['text'])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xaa'));}var _0x416f88='\x22'+_0xacf47e['text']+'\x22';if(this[_0x5ed9('0x85')](_0xacf47e[_0x5ed9('0x77')])){_0x416f88+=','+_0xacf47e[_0x5ed9('0x77')];}var _0x436b73=this[_0x5ed9('0x33')][_0x5ed9('0x56')]('MRCPSynth',_0x416f88);if(_0x436b73[_0x5ed9('0xa4')]===-0x1){return _0x436b73;}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0x416f88));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0xc3')]=function(_0x22b027){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0xc4'),_0x22b027[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x22b027['text'])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xaa'));}var _0x3ca355='\x22'+_0x22b027['text']+'\x22';if(this[_0x5ed9('0x85')](_0x22b027[_0x5ed9('0x77')])){_0x3ca355+=','+_0x22b027['options'];}var _0x594af1=this['channel']['exec'](_0x5ed9('0xab'),_0x3ca355);if(_0x594af1['result']===-0x1){return _0x594af1;}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0xac'),_0x3ca355));};AGIVertices['prototype']['lumenvoxasr']=function(_0x2f079c){logger[_0x5ed9('0x2c')](util['format'](_0x5ed9('0xc5'),_0x2f079c[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x2f079c['grammar'])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xc6'));}var _0x5f0fc3=_0x2f079c[_0x5ed9('0xae')];if(this[_0x5ed9('0x85')](_0x2f079c[_0x5ed9('0x77')])){_0x5f0fc3+=','+_0x2f079c['options'];}var _0x552d8b=this[_0x5ed9('0x33')][_0x5ed9('0x56')](_0x5ed9('0xc7'),_0x5f0fc3);if(_0x552d8b[_0x5ed9('0xa4')]===-0x1){return _0x552d8b;}var _0x57a8f5=this[_0x5ed9('0xa3')](_0x5ed9('0xaf'),_0x5ed9('0xc8'));if(_0x57a8f5[_0x5ed9('0xa4')]===-0x1){return _0x57a8f5;}var _0x339976=this[_0x5ed9('0xa3')]('RECOG_INPUT()',_0x5ed9('0xc9'));if(_0x339976[_0x5ed9('0xa4')]===-0x1){return _0x339976;}var _0x48de82=this['getAndSetVariable'](_0x5ed9('0xb2'),_0x5ed9('0xca'));if(_0x48de82[_0x5ed9('0xa4')]===-0x1){return _0x48de82;}return this['channel'][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0xcb'),_0x5f0fc3));};AGIVertices[_0x5ed9('0x12')]['sestekasr']=function(_0x1b1be0){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0xcc'),_0x1b1be0[_0x5ed9('0x34')]));if(!this['isConfigured'](_0x1b1be0['grammar'])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xc6'));}var _0x52412c=_0x1b1be0[_0x5ed9('0xae')];if(this[_0x5ed9('0x85')](_0x1b1be0[_0x5ed9('0x77')])){_0x52412c+=','+_0x1b1be0[_0x5ed9('0x77')];}var _0x4b8d23=this[_0x5ed9('0x33')]['exec']('MRCPRecog',_0x52412c);if(_0x4b8d23[_0x5ed9('0xa4')]===-0x1){return _0x4b8d23;}var _0x51ef1f=this[_0x5ed9('0xa3')](_0x5ed9('0xaf'),_0x5ed9('0xcd'));if(_0x51ef1f[_0x5ed9('0xa4')]===-0x1){return _0x51ef1f;}var _0x5835e9=this[_0x5ed9('0xa3')](_0x5ed9('0xb1'),'SESTEK_ASR_TRANSCRIPT');if(_0x5835e9[_0x5ed9('0xa4')]===-0x1){return _0x5835e9;}var _0x38719c=this['getAndSetVariable']('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x38719c['result']===-0x1){return _0x38719c;}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0xcb'),_0x52412c));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0xce')]=function(_0x42fefd){logger['info'](util[_0x5ed9('0x27')](_0x5ed9('0xcf'),_0x42fefd[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x42fefd[_0x5ed9('0xd0')])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x42fefd,'no\x20database\x20selected');}var _0x3c86d9=this[_0x5ed9('0x18')][_0x5ed9('0x70')](this,_0x42fefd['odbc_id']);if(!_0x3c86d9){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x42fefd,'no\x20odbc\x20database\x20found');}if(!this[_0x5ed9('0x85')](_0x42fefd[_0x5ed9('0xd1')])){return this['channel'][_0x5ed9('0x2a')](_0x42fefd,_0x5ed9('0xd2'));}var _0x4cb62c=_0x42fefd['query'][_0x5ed9('0xd3')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x5ed9('0xa9')](util['format']('query:\x20%s',_0x4cb62c));var _0x36205b=this[_0x5ed9('0xd4')][_0x5ed9('0x70')](this,_0x3c86d9,_0x4cb62c);this['createSquareDetailsReport']['sync'](this,_0x42fefd,_0x4cb62c);if(!this[_0x5ed9('0x85')](_0x42fefd['variable_id'])){return this[_0x5ed9('0x33')]['noop'](_0x5ed9('0xd5'));}var _0x18e11f=this[_0x5ed9('0x13')]['sync'](this,_0x42fefd[_0x5ed9('0xd6')]);if(!_0x18e11f){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x42fefd,_0x5ed9('0xd7'));}var _0x21f0d2=this;_0x36205b[_0x5ed9('0xd8')](function(_0xb381c2,_0x583c90){Object[_0x5ed9('0xd9')](_0xb381c2)[_0x5ed9('0xd8')](function(_0x4c668f){_0x21f0d2[_0x5ed9('0x33')][_0x5ed9('0x9e')](util[_0x5ed9('0x27')](_0x5ed9('0xda'),_0x18e11f,_0x583c90,_0x4c668f),_0xb381c2[_0x4c668f]);});});this['channel'][_0x5ed9('0x9e')](util[_0x5ed9('0x27')](_0x5ed9('0xdb'),_0x18e11f),_0x36205b[_0x5ed9('0x99')]);return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0xdc'),_0x18e11f));};AGIVertices[_0x5ed9('0x12')]['dial']=function(_0x3178af){logger[_0x5ed9('0xdd')](util[_0x5ed9('0x27')](_0x5ed9('0xde'),_0x3178af['label']));if(!this['isConfigured'](_0x3178af[_0x5ed9('0xdf')])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x3178af,_0x5ed9('0xe0'));}var _0x2d9594=this['getUser'][_0x5ed9('0x70')](this,_0x3178af[_0x5ed9('0xdf')]);if(!_0x2d9594){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x3178af,'no\x20user\x20found');}var _0x330de6=this[_0x5ed9('0x33')][_0x5ed9('0x56')](_0x5ed9('0xe1'),[util[_0x5ed9('0x27')](_0x5ed9('0xe2'),_0x2d9594),_0x3178af[_0x5ed9('0x64')],_0x3178af[_0x5ed9('0xe3')],_0x3178af['url']]);if(_0x330de6[_0x5ed9('0xa4')]===-0x1){return _0x330de6;}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('Executed\x20command\x20%s','DIAL'));};AGIVertices['prototype']['dialogflow']=function(_0x572dc2){logger[_0x5ed9('0x2c')](util['format'](_0x5ed9('0xe4'),_0x572dc2[_0x5ed9('0x34')]));if(!this['isConfigured'](_0x572dc2[_0x5ed9('0x80')])){return this['channel'][_0x5ed9('0xa9')](_0x5ed9('0xe5'));}if(!this[_0x5ed9('0x85')](_0x572dc2[_0x5ed9('0x5b')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xaa'));}this[_0x5ed9('0x33')][_0x5ed9('0xe6')]=!![];this[_0x5ed9('0x32')](_0x572dc2);this[_0x5ed9('0x40')](_0x572dc2[_0x5ed9('0x5b')],'in','','');this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util['format']('Trying\x20Dialogflow:\x20%s',_0x572dc2[_0x5ed9('0x5b')]));var _0x60630d=this[_0x5ed9('0x78')][_0x5ed9('0x70')](this,_0x572dc2);if(_0x60630d){for(var _0x1a0cf8 in _0x60630d){if(_0x60630d['hasOwnProperty'](_0x1a0cf8)){this[_0x5ed9('0x33')]['setVariable'](util['format'](_0x5ed9('0xe7'),_0x1a0cf8[_0x5ed9('0x69')]()),_0x60630d[_0x1a0cf8]);}}this['createSquareMessage'](_0x60630d[_0x5ed9('0xe8')],_0x5ed9('0xe9'),_0x5ed9('0xea'),'');return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util['format'](_0x5ed9('0xeb'),_0x60630d['speech']));}return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x572dc2,_0x5ed9('0xec'));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0xed')]=function(_0x323db1){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x323db1[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x323db1[_0x5ed9('0x7b')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xee'));}if(!this[_0x5ed9('0x85')](_0x323db1[_0x5ed9('0x7c')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xef'));}if(!this[_0x5ed9('0x85')](_0x323db1[_0x5ed9('0x7d')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')]('no\x20private_key\x20configured');}if(!this[_0x5ed9('0x85')](_0x323db1[_0x5ed9('0x7e')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xf0'));}if(!this[_0x5ed9('0x85')](_0x323db1[_0x5ed9('0x5b')])){return this['channel'][_0x5ed9('0xa9')](_0x5ed9('0xaa'));}this['channel'][_0x5ed9('0xe6')]=!![];this[_0x5ed9('0x32')](_0x323db1);this[_0x5ed9('0x40')](_0x323db1['text'],'in','','');this['channel'][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0xf1'),_0x323db1[_0x5ed9('0x5b')]));var _0x1eec46=this[_0x5ed9('0x7a')][_0x5ed9('0x70')](this,_0x323db1);if(_0x1eec46){for(var _0x24eed6 in _0x1eec46){if(_0x1eec46[_0x5ed9('0x95')](_0x24eed6)){if(_0x24eed6!==_0x5ed9('0xf2')){this[_0x5ed9('0x33')]['setVariable'](util[_0x5ed9('0x27')](_0x5ed9('0xe7'),_0x24eed6[_0x5ed9('0x69')]()),_0x1eec46[_0x24eed6]);}}}this[_0x5ed9('0x40')](_0x1eec46['speech'],'out',_0x5ed9('0xed'),_0x1eec46[_0x5ed9('0xf2')]);return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util['format'](_0x5ed9('0xf3'),_0x1eec46[_0x5ed9('0xe8')]));}return this['channel'][_0x5ed9('0x2a')](_0x323db1,_0x5ed9('0xf4'));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0xf5')]=function(_0x21dc3e){logger['info'](util[_0x5ed9('0x27')](_0x5ed9('0xf6'),_0x21dc3e['label']));if(!this[_0x5ed9('0x85')](_0x21dc3e[_0x5ed9('0xf7')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xf8'));}if(!this[_0x5ed9('0x85')](_0x21dc3e[_0x5ed9('0xf9')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xfa'));}if(!this[_0x5ed9('0x85')](_0x21dc3e[_0x5ed9('0xfb')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')]('no\x20password\x20configured');}if(!this[_0x5ed9('0x85')](_0x21dc3e['ndassistant_url'])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')]('no\x20text\x20configured');}this[_0x5ed9('0x33')][_0x5ed9('0xe6')]=!![];this[_0x5ed9('0x32')](_0x21dc3e);this['createSquareMessage'](_0x21dc3e['text'],'in','','');this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0xfc'),_0x21dc3e[_0x5ed9('0x5b')]));var _0x49a0e8=this['sestekNDA']['sync'](this,_0x21dc3e);if(_0x49a0e8){for(var _0x4b95b7 in _0x49a0e8){if(_0x49a0e8[_0x5ed9('0x95')](_0x4b95b7)){this[_0x5ed9('0x33')]['setVariable'](util['format'](_0x5ed9('0xfd'),_0x4b95b7['toUpperCase']()),_0x49a0e8[_0x4b95b7]);}}this[_0x5ed9('0x40')](_0x49a0e8[_0x5ed9('0xe8')],_0x5ed9('0xe9'),_0x5ed9('0xf5'),'');if(_0x49a0e8[_0x5ed9('0xfe')]){this['channel'][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0xff'),_0x49a0e8[_0x5ed9('0xfe')]));var _0x547ebc=this[_0x5ed9('0x33')]['streamFile'](_0x49a0e8[_0x5ed9('0xfe')]);try{fs[_0x5ed9('0x100')](_0x49a0e8[_0x5ed9('0xfe')]+_0x5ed9('0x101'));}catch(_0x3dd1ea){logger[_0x5ed9('0x2a')](_0x3dd1ea);}return _0x547ebc;}else{return this['channel'][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('SestekNDA\x20Result\x20%s',_0x49a0e8['speech']));}}return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x21dc3e,_0x5ed9('0x102'));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x103')]=function(_0x1b20a8){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x104'),_0x1b20a8[_0x5ed9('0x34')]));return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0x103'));};AGIVertices['prototype']['ext_dial']=function(_0x283620){logger['info'](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x283620[_0x5ed9('0x34')]));var _0x1eb44e='';if(_0x283620['trunk_id']){if(!this['isConfigured'](_0x283620[_0x5ed9('0x105')])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x283620,_0x5ed9('0x106'));}else{var _0x1350e7=parseInt(_0x283620[_0x5ed9('0x105')],0xa);if(isNaN(_0x1350e7)){_0x1eb44e=_0x283620[_0x5ed9('0x105')];}else{_0x1eb44e=this[_0x5ed9('0x1c')][_0x5ed9('0x70')](this,_0x283620['trunk_id']);if(!_0x1eb44e){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x283620,_0x5ed9('0x107'));}}}}else if(_0x283620[_0x5ed9('0x108')]){_0x1eb44e=_0x283620['trunk_name'];}else{return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x283620,_0x5ed9('0x106'));}var _0x2e6cc0=this[_0x5ed9('0x33')][_0x5ed9('0x56')](_0x5ed9('0xe1'),[util['format'](_0x5ed9('0x109'),_0x1eb44e,_0x283620[_0x5ed9('0x47')]),_0x283620['timeout'],_0x283620[_0x5ed9('0xe3')],_0x283620[_0x5ed9('0x72')]]);if(_0x2e6cc0['result']===-0x1){return _0x2e6cc0;}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x10a'),'DIAL'));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x10b')]=function(_0x5700e1){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')]('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x5700e1['label']));return this[_0x5ed9('0x33')][_0x5ed9('0xa9')]('finally');};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0xe')]=function(_0x3c2e8c){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x10c'),_0x3c2e8c[_0x5ed9('0x34')]));if(_0x3c2e8c[_0x5ed9('0xa5')]===0x0){return this[_0x5ed9('0xa6')](_0x3c2e8c);}_0x3c2e8c[_0x5ed9('0xa5')]-=0x1;if(!this[_0x5ed9('0x85')](_0x3c2e8c[_0x5ed9('0x10d')])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x3c2e8c,_0x5ed9('0x10e'));}var _0x7f634f=this[_0x5ed9('0x10f')][_0x5ed9('0x70')](this,_0x3c2e8c['file_id']);if(!_0x7f634f){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x3c2e8c,_0x5ed9('0x110'));}if(!this[_0x5ed9('0x85')](_0x3c2e8c[_0x5ed9('0xd6')])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x5ed9('0xd5'));}var _0x4d7fab=this[_0x5ed9('0x33')][_0x5ed9('0x111')](_0x7f634f,_0x3c2e8c[_0x5ed9('0x112')],_0x3c2e8c[_0x5ed9('0x113')]);var _0x27500b=_0x4d7fab['result']?_0x4d7fab[_0x5ed9('0xa4')][_0x5ed9('0x4c')]():'';logger['info'](_0x5ed9('0x114'),JSON[_0x5ed9('0x73')](_0x4d7fab));if(_0x4d7fab[_0x5ed9('0xa4')]===-0x1){this[_0x5ed9('0x32')]['sync'](this,_0x3c2e8c,_0x27500b);return _0x4d7fab;}else if(_0x4d7fab['extra']===_0x5ed9('0x64')){_0x4d7fab['result']=_0x27500b[_0x5ed9('0x99')]>=parseInt(_0x3c2e8c['mindigit'])?'x':'i';}else{_0x4d7fab[_0x5ed9('0xa4')]=_0x27500b[_0x5ed9('0x99')]>=parseInt(_0x3c2e8c[_0x5ed9('0x115')])&&_0x27500b['length']<=parseInt(_0x3c2e8c[_0x5ed9('0x113')])?'x':'i';}var _0x37efee=this[_0x5ed9('0x13')][_0x5ed9('0x70')](this,_0x3c2e8c[_0x5ed9('0xd6')]);if(!_0x37efee){return this['channel'][_0x5ed9('0x2a')](_0x3c2e8c,'no\x20variable\x20found');}this['channel'][_0x5ed9('0x9e')](_0x37efee,_0x27500b);if(this[_0x5ed9('0x85')](_0x3c2e8c['hiddendigitsnum'])){var _0x548288=parseInt(_0x3c2e8c['hiddendigitsnum'],0xa);var _0x15a414=rs[_0x5ed9('0x116')]({'charset':'*','length':_0x548288});var _0x4b0f73=_0x27500b[_0x5ed9('0x99')];if(_0x4b0f73>0x0){if(_0x4b0f73>_0x548288){this[_0x5ed9('0x32')][_0x5ed9('0x70')](this,_0x3c2e8c,_0x3c2e8c[_0x5ed9('0x117')]===_0x5ed9('0x118')?_0x15a414+_0x27500b['substr'](_0x548288):_0x27500b[_0x5ed9('0x119')](0x0,_0x4b0f73-_0x548288)+_0x15a414);}else{this[_0x5ed9('0x32')][_0x5ed9('0x70')](this,_0x3c2e8c,rs[_0x5ed9('0x116')]({'charset':'*','length':_0x4b0f73}));}}else{this[_0x5ed9('0x32')]['sync'](this,_0x3c2e8c,'');}}else{this[_0x5ed9('0x32')][_0x5ed9('0x70')](this,_0x3c2e8c,_0x27500b);}return _0x4d7fab;};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0xf')]=function(_0x36ba69){logger['info'](util[_0x5ed9('0x27')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x36ba69[_0x5ed9('0x34')]));return this[_0x5ed9('0xe')](_0x36ba69);};AGIVertices[_0x5ed9('0x12')]['goal']=function(_0x51a1ee){logger[_0x5ed9('0x2c')](util['format'](_0x5ed9('0x11a'),_0x51a1ee[_0x5ed9('0x34')]));this[_0x5ed9('0x32')][_0x5ed9('0x70')](this,_0x51a1ee,_0x51a1ee[_0x5ed9('0x11b')]);return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('GOAL\x20%s',_0x51a1ee[_0x5ed9('0x11b')]));};AGIVertices[_0x5ed9('0x12')]['awspolly']=function(_0x222287){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x11c'),_0x222287['label']));if(!this[_0x5ed9('0x85')](_0x222287['aws_access_key_id'])||!this['isConfigured'](_0x222287[_0x5ed9('0x8c')])){return this[_0x5ed9('0x33')]['noop'](_0x5ed9('0x11d'));}if(!this['isConfigured'](_0x222287['text'])){return this['channel'][_0x5ed9('0xa9')](_0x5ed9('0xaa'));}this[_0x5ed9('0x33')]['noop'](util['format'](_0x5ed9('0x11e'),_0x222287['text']));var _0x54e644=this[_0x5ed9('0x87')][_0x5ed9('0x70')](this,_0x222287);if(_0x54e644){this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('aws\x20Polly\x20%s\x20file\x20created',_0x54e644));var _0x11bef2=this[_0x5ed9('0x33')][_0x5ed9('0x11f')](_0x54e644);try{fs[_0x5ed9('0x100')](_0x54e644+_0x5ed9('0x101'));}catch(_0x19ed70){logger[_0x5ed9('0x2a')](_0x19ed70);}return _0x11bef2;}return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x222287,_0x5ed9('0x120'));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x121')]=function(_0x51aebd){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x122'),_0x51aebd[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x51aebd[_0x5ed9('0x88')])||!this[_0x5ed9('0x85')](_0x51aebd[_0x5ed9('0x8c')])){return this['channel'][_0x5ed9('0xa9')](_0x5ed9('0x11d'));}if(!this['isConfigured'](_0x51aebd['aws_bot_name'])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0x123'));}if(!this[_0x5ed9('0x85')](_0x51aebd[_0x5ed9('0x5b')])){return this['channel'][_0x5ed9('0xa9')](_0x5ed9('0xaa'));}this[_0x5ed9('0x33')]['bot']=!![];this[_0x5ed9('0x32')](_0x51aebd);this[_0x5ed9('0x40')](_0x51aebd[_0x5ed9('0x5b')],'in','','');this['channel'][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x124'),_0x51aebd[_0x5ed9('0x5b')]));var _0x3f2924=this[_0x5ed9('0x8b')]['sync'](this,_0x51aebd);if(_0x3f2924){for(var _0x1db916 in _0x3f2924){if(_0x3f2924[_0x5ed9('0x95')](_0x1db916)&&_[_0x5ed9('0x9a')](_0x3f2924[_0x1db916])){this['channel'][_0x5ed9('0x9e')](util['format']('AWS_LEX_%s',_0x1db916['toUpperCase']()),_0x3f2924[_0x1db916]);}}if(_[_0x5ed9('0x42')](_0x3f2924[_0x5ed9('0x125')])){return this['channel'][_0x5ed9('0xa9')](_0x5ed9('0x126'));}else{this['createSquareMessage'](_0x3f2924[_0x5ed9('0x125')],_0x5ed9('0xe9'),_0x5ed9('0x127'),'');return this['channel'][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('Amazon\x20Lex\x20Result\x20%s',_0x3f2924['message']));}}return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x51aebd,_0x5ed9('0x128'));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x129')]=function(_0x38fcf9){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x12a'),_0x38fcf9['label'],_0x38fcf9[_0x5ed9('0x64')]));if(!this[_0x5ed9('0x85')](_0x38fcf9[_0x5ed9('0x80')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xe5'));}var _0x1d8ba7=_0x5ed9('0x12b');var _0x2f360c=util[_0x5ed9('0x27')]('%s/recordings/%s',FILES_PATH,rs[_0x5ed9('0x116')](0x4));var _0x5a8d33=util['format'](_0x5ed9('0x9d'),_0x2f360c,_0x1d8ba7);var _0x59ae5d=!![];if(_0x38fcf9['beep']===_0x5ed9('0x12c')){_0x59ae5d=![];}var _0x5306e6=this['channel'][_0x5ed9('0x12d')](_0x2f360c,_0x1d8ba7,_0x38fcf9['intKey'],_0x38fcf9[_0x5ed9('0x64')],undefined,_0x59ae5d);if(_0x5306e6[_0x5ed9('0xa4')]!==-0x1){this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x12e'),_0x5a8d33));var _0x15f290=this['googleASR']['sync'](this,_0x38fcf9,_0x5a8d33);if(_0x15f290){for(var _0xba7ef1 in _0x15f290){if(_0x15f290[_0x5ed9('0x95')](_0xba7ef1)){this[_0x5ed9('0x33')][_0x5ed9('0x9e')](util[_0x5ed9('0x27')]('GOOGLE_ASR_%s',_0xba7ef1[_0x5ed9('0x69')]()),_0x15f290[_0xba7ef1]);}}return this['channel'][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x12f'),JSON[_0x5ed9('0x73')](_0x15f290)));}}return _0x5306e6;};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x130')]=function(_0x402e3d){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x402e3d[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x402e3d[_0x5ed9('0x91')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')]('no\x20appid\x20configured');}if(!this[_0x5ed9('0x85')](_0x402e3d[_0x5ed9('0x92')])){return this['channel'][_0x5ed9('0xa9')]('no\x20appsecret\x20configured');}var _0x253951=_0x5ed9('0x12b');var _0x2e5cb6=util[_0x5ed9('0x27')](_0x5ed9('0x131'),FILES_PATH,rs[_0x5ed9('0x116')](0x4));var _0x5b569b=util[_0x5ed9('0x27')](_0x5ed9('0x9d'),_0x2e5cb6,_0x253951);var _0x5ce05c=!![];if(_0x402e3d[_0x5ed9('0x132')]===_0x5ed9('0x12c')){_0x5ce05c=![];}var _0x3b2384=this['channel'][_0x5ed9('0x12d')](_0x2e5cb6,_0x253951,_0x402e3d[_0x5ed9('0x133')],_0x402e3d['timeout'],undefined,_0x5ce05c);if(_0x3b2384[_0x5ed9('0xa4')]!==-0x1){this[_0x5ed9('0x33')]['noop'](util[_0x5ed9('0x27')](_0x5ed9('0x134'),_0x5b569b));var _0x35d9a4=this[_0x5ed9('0x90')][_0x5ed9('0x70')](this,_0x402e3d,_0x5b569b);if(_0x35d9a4){for(var _0xc9bb13 in _0x35d9a4){if(_0x35d9a4[_0x5ed9('0x95')](_0xc9bb13)){this[_0x5ed9('0x33')][_0x5ed9('0x9e')](util['format'](_0x5ed9('0x135'),_0xc9bb13[_0x5ed9('0x69')]()),_0x35d9a4[_0xc9bb13]);}}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x136'),JSON[_0x5ed9('0x73')](_0x35d9a4)));}}return _0x3b2384;};AGIVertices['prototype'][_0x5ed9('0x137')]=function(_0x321796){logger[_0x5ed9('0x2c')](util['format'](_0x5ed9('0x138'),_0x321796[_0x5ed9('0x34')]));return this[_0x5ed9('0x33')][_0x5ed9('0x139')](_0x321796[_0x5ed9('0x3a')],_0x321796[_0x5ed9('0x3b')],_0x321796['priority']);};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x13a')]=function(_0x3070f4){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x13b'),_0x3070f4[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x3070f4[_0x5ed9('0x13c')])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x3070f4,_0x5ed9('0x13d'));}try{var _0x28d63d=eval(_0x3070f4[_0x5ed9('0x13c')])?_0x5ed9('0x13e'):_0x5ed9('0x13f');this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x3070f4[_0x5ed9('0x13c')],_0x28d63d));return{'code':0xc8,'result':_0x28d63d};}catch(_0x1e50d6){return{'code':0xc8,'result':_0x5ed9('0x13f')};}};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x140')]=function(_0x3dddbc){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x3dddbc[_0x5ed9('0x34')]));if(!this['isConfigured'](_0x3dddbc[_0x5ed9('0x141')])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x3dddbc,_0x5ed9('0x142'));}var _0x5a9989=this['getIntervals'][_0x5ed9('0x70')](this,_0x3dddbc[_0x5ed9('0x141')]);if(!_0x5a9989){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x3dddbc,_0x5ed9('0x143'));}for(var _0xf96148=0x0;_0xf96148<_0x5a9989[_0x5ed9('0x99')];_0xf96148+=0x1){var _0x4d685b=this[_0x5ed9('0x33')][_0x5ed9('0x13')](util[_0x5ed9('0x27')](_0x5ed9('0x144'),_0x5a9989[_0xf96148]));if(_0x4d685b[_0x5ed9('0xa4')]===-0x1){return _0x4d685b;}logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')]('IFTIME\x20%s\x20%s',_0x5a9989[_0xf96148],_0x4d685b[_0x5ed9('0xa2')]));if(_0x4d685b[_0x5ed9('0xa2')]===_0x5ed9('0x13e')){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')]('IFTIME\x20%s\x20%s',_0x5a9989[_0xf96148],_0x5ed9('0x13e')));this[_0x5ed9('0x33')]['noop'](util[_0x5ed9('0x27')]('IFTIME\x20%s\x20%s',_0x5a9989[_0xf96148],'true'));return{'code':0xc8,'result':'true'};}else{logger[_0x5ed9('0x2c')](util['format'](_0x5ed9('0x145'),_0x5a9989[_0xf96148],_0x5ed9('0x13f')));this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x145'),_0x5a9989[_0xf96148],_0x5ed9('0x13f')));}}return{'code':0xc8,'result':'false'};};AGIVertices['prototype'][_0x5ed9('0x146')]=function(_0x325e39){logger['info'](util[_0x5ed9('0x27')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x325e39[_0x5ed9('0x34')]));return this['channel'][_0x5ed9('0x146')]();};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x147')]=function(_0x3f86b8){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x148'),_0x3f86b8[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x3f86b8['key'])){return this[_0x5ed9('0x33')]['noop'](_0x5ed9('0xe5'));}var _0x17ddd9=_0x5ed9('0x12b');var _0x467271=util[_0x5ed9('0x27')](_0x5ed9('0x131'),FILES_PATH,rs[_0x5ed9('0x116')](0x4));var _0x5a7d12=util[_0x5ed9('0x27')](_0x5ed9('0x9d'),_0x467271,_0x17ddd9);var _0x5b4884=!![];if(_0x3f86b8[_0x5ed9('0x132')]===_0x5ed9('0x12c')){_0x5b4884=![];}var _0x2344a9=this[_0x5ed9('0x33')][_0x5ed9('0x12d')](_0x467271,_0x17ddd9,_0x3f86b8['intKey'],_0x3f86b8['timeout'],undefined,_0x5b4884);if(_0x2344a9['result']!==-0x1){this['channel'][_0x5ed9('0xa9')](util['format']('ispeech\x20%s\x20file\x20created',_0x5a7d12));var _0x2a0316=this['ispeechASR'][_0x5ed9('0x70')](this,_0x3f86b8,_0x5a7d12);if(_0x2a0316){for(var _0x46c75b in _0x2a0316){if(_0x2a0316[_0x5ed9('0x95')](_0x46c75b)){this[_0x5ed9('0x33')][_0x5ed9('0x9e')](util[_0x5ed9('0x27')](_0x5ed9('0x149'),_0x46c75b[_0x5ed9('0x69')]()),_0x2a0316[_0x46c75b]);}}return this[_0x5ed9('0x33')]['noop'](util[_0x5ed9('0x27')](_0x5ed9('0x14a'),JSON[_0x5ed9('0x73')](_0x2a0316)));}}return _0x2344a9;};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x14b')]=function(_0x37dc92){logger['info'](util[_0x5ed9('0x27')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x37dc92[_0x5ed9('0x34')]));if(!this['isConfigured'](_0x37dc92[_0x5ed9('0x80')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x37dc92['text'])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xaa'));}this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x14c'),_0x37dc92[_0x5ed9('0x5b')]));var _0x55558f=this[_0x5ed9('0x14d')]['sync'](this,_0x37dc92);if(_0x55558f){this[_0x5ed9('0x33')]['noop'](util[_0x5ed9('0x27')](_0x5ed9('0x14e'),_0x55558f));var _0x30f6ad=this[_0x5ed9('0x33')]['streamFile'](_0x55558f,_0x37dc92[_0x5ed9('0x133')]);try{fs[_0x5ed9('0x100')](_0x55558f+_0x5ed9('0x101'));}catch(_0x1e687f){logger[_0x5ed9('0x2a')](_0x1e687f);}return _0x30f6ad;}return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x37dc92,_0x5ed9('0x14f'));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x150')]=function(_0x5b7cf1){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x151'),_0x5b7cf1['label']));if(!this[_0x5ed9('0x85')](_0x5b7cf1[_0x5ed9('0x152')])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x5b7cf1,_0x5ed9('0x153'));}logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x154'),this[_0x5ed9('0x33')][_0x5ed9('0x36')],_0x5b7cf1['findBy']));var _0x2658cb=this['agentLogin']['sync'](this,_0x5b7cf1[_0x5ed9('0x152')]);if(_0x2658cb){logger['info'](util[_0x5ed9('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x5b7cf1[_0x5ed9('0x152')]));this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x155'),this['channel']['callerid'],_0x5b7cf1[_0x5ed9('0x152')]));return{'code':0xc8,'result':_0x5ed9('0x156')};}else{logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x157'),this[_0x5ed9('0x33')][_0x5ed9('0x36')],_0x5b7cf1[_0x5ed9('0x152')]));this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x157'),this[_0x5ed9('0x33')]['callerid'],_0x5b7cf1[_0x5ed9('0x152')]));return{'code':0xc8,'result':_0x5ed9('0x158')};}};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x159')]=function(_0x223af1){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x15a'),_0x223af1['label']));if(!this[_0x5ed9('0x85')](_0x223af1['findBy'])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x223af1,_0x5ed9('0x153'));}logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x154'),this[_0x5ed9('0x33')][_0x5ed9('0x36')],_0x223af1['findBy']));var _0x4c1b1a=this[_0x5ed9('0x51')]['sync'](this,_0x223af1['findBy']);if(_0x4c1b1a){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x5ed9('0x33')]['callerid'],_0x223af1[_0x5ed9('0x152')]));this[_0x5ed9('0x33')]['noop'](util[_0x5ed9('0x27')](_0x5ed9('0x155'),this[_0x5ed9('0x33')][_0x5ed9('0x36')],_0x223af1['findBy']));return{'code':0xc8,'result':_0x5ed9('0x156')};}else{logger['info'](util['format'](_0x5ed9('0x157'),this['channel'][_0x5ed9('0x36')],_0x223af1[_0x5ed9('0x152')]));this['channel'][_0x5ed9('0xa9')](util['format'](_0x5ed9('0x157'),this[_0x5ed9('0x33')][_0x5ed9('0x36')],_0x223af1[_0x5ed9('0x152')]));return{'code':0xc8,'result':_0x5ed9('0x158')};}};AGIVertices['prototype']['math']=function(_0x3f9fae){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x15b'),_0x3f9fae[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x3f9fae['operation'])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x3f9fae,_0x5ed9('0x15c'));}this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x15d'),_0x3f9fae[_0x5ed9('0x15e')]));var _0x4b3cc6=eval(_0x3f9fae[_0x5ed9('0x15e')]);if(!this['isConfigured'](_0x3f9fae[_0x5ed9('0xd6')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x3f8f1e=this[_0x5ed9('0x13')]['sync'](this,_0x3f9fae['variable_id']);if(!_0x3f8f1e){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x3f9fae,_0x5ed9('0xd7'));}if(_['isArray'](_0x4b3cc6)){var _0xdf7514=this;_0x4b3cc6[_0x5ed9('0xd8')](function(_0x45697b,_0x4ad1c4){_0xdf7514[_0x5ed9('0x33')][_0x5ed9('0x9e')](util[_0x5ed9('0x27')]('%s[%s]',_0x3f8f1e,_0x4ad1c4),_0x45697b);});return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x15f'),_0x3f8f1e));}else{return this[_0x5ed9('0x33')][_0x5ed9('0x9e')](_0x3f8f1e,_0x4b3cc6);}};AGIVertices[_0x5ed9('0x12')]['menu']=function(_0x387a20){logger[_0x5ed9('0x2c')](util['format'](_0x5ed9('0x160'),_0x387a20[_0x5ed9('0x34')]));if(_0x387a20[_0x5ed9('0xa5')]===0x0){return this[_0x5ed9('0xa6')](_0x387a20);}_0x387a20[_0x5ed9('0xa5')]-=0x1;if(!this[_0x5ed9('0x85')](_0x387a20[_0x5ed9('0x10d')])){return this['channel'][_0x5ed9('0x2a')](_0x387a20,_0x5ed9('0x10e'));}var _0x32c2d3=this[_0x5ed9('0x10f')][_0x5ed9('0x70')](this,_0x387a20['file_id']);if(!_0x32c2d3){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x387a20,'no\x20file\x20audio\x20found');}var _0x180e50=this[_0x5ed9('0x33')][_0x5ed9('0x111')](_0x32c2d3,_0x387a20['response'],_0x387a20[_0x5ed9('0x161')]);var _0x2cebad=_0x180e50['result'];if(_0x180e50[_0x5ed9('0xa4')]===-0x1){this[_0x5ed9('0x32')][_0x5ed9('0x70')](this,_0x387a20,'-1');return _0x180e50;}else if(_0x180e50[_0x5ed9('0xa2')]===_0x5ed9('0x64')){_0x180e50[_0x5ed9('0xa4')]=_0x180e50[_0x5ed9('0xa4')]['length']>0x0?_0x180e50['result']:'t';}else if(_[_0x5ed9('0x45')](_0x180e50['result'])){_0x180e50[_0x5ed9('0xa4')]='#';_0x2cebad='#';}if(!this['isConfigured'](_0x387a20['variable_id'])){this[_0x5ed9('0x33')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x78f076=this[_0x5ed9('0x13')]['sync'](this,_0x387a20[_0x5ed9('0xd6')]);if(!_0x78f076){return this['channel'][_0x5ed9('0x2a')](_0x387a20,_0x5ed9('0xd7'));}this[_0x5ed9('0x33')][_0x5ed9('0x9e')](_0x78f076,_0x2cebad);}this['createSquareDetailsReport'][_0x5ed9('0x70')](this,_0x387a20,_0x2cebad);return _0x180e50;};AGIVertices['prototype'][_0x5ed9('0xa9')]=function(_0x1458ec){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x162'),_0x1458ec['label']));return this['channel'][_0x5ed9('0xa9')](_0x1458ec[_0x5ed9('0x163')]||_0x1458ec[_0x5ed9('0x34')]);};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x164')]=function(_0x50d41e){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x165'),_0x50d41e['label']));if(!this[_0x5ed9('0x85')](_0x50d41e[_0x5ed9('0x152')])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x50d41e,_0x5ed9('0x153'));}logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x154'),this[_0x5ed9('0x33')][_0x5ed9('0x36')],_0x50d41e[_0x5ed9('0x152')]));var _0x17a0ea=this[_0x5ed9('0x4e')][_0x5ed9('0x70')](this,_0x50d41e[_0x5ed9('0x166')]);var _0x284d87=this[_0x5ed9('0x167')]['sync'](this,_0x50d41e[_0x5ed9('0x152')],_0x17a0ea);if(_0x284d87){logger['info'](util[_0x5ed9('0x27')](_0x5ed9('0x155'),this[_0x5ed9('0x33')][_0x5ed9('0x36')],_0x50d41e[_0x5ed9('0x152')]));this['channel'][_0x5ed9('0xa9')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x5ed9('0x33')][_0x5ed9('0x36')],_0x50d41e[_0x5ed9('0x152')]));return{'code':0xc8,'result':'success'};}else{logger[_0x5ed9('0x2c')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x5ed9('0x33')][_0x5ed9('0x36')],_0x50d41e[_0x5ed9('0x152')]));this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x155'),this[_0x5ed9('0x33')][_0x5ed9('0x36')],_0x50d41e['findBy']));return{'code':0xc8,'result':_0x5ed9('0x158')};}};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x168')]=function(_0x4c504c){logger['info'](util[_0x5ed9('0x27')](_0x5ed9('0x169'),_0x4c504c[_0x5ed9('0x34')]));if(!this['isConfigured'](_0x4c504c['file_id'])){return this['channel']['error'](_0x4c504c,_0x5ed9('0x10e'));}var _0x38c90c=this[_0x5ed9('0x10f')]['sync'](this,_0x4c504c[_0x5ed9('0x10d')]);if(!_0x38c90c){return this['channel'][_0x5ed9('0x2a')](_0x4c504c,'no\x20file\x20audio\x20found');}var _0xa420e3=this['channel'][_0x5ed9('0x56')](_0x5ed9('0x16a'),[_0x38c90c,_0x4c504c['opts']]);if(_0xa420e3[_0x5ed9('0xa4')]===-0x1){return _0xa420e3;}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('Executed\x20command\x20%s\x20%s','PLAYBACK',_0x38c90c));};AGIVertices[_0x5ed9('0x12')]['queue']=function(_0xfc8e0e){logger['info'](util[_0x5ed9('0x27')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0xfc8e0e[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0xfc8e0e[_0x5ed9('0x16b')])){return this['channel']['error'](_0xfc8e0e,_0x5ed9('0x16c'));}var _0xddabbd='';var _0x2e0823=parseInt(_0xfc8e0e[_0x5ed9('0x16b')],0xa);if(isNaN(_0x2e0823)){_0xddabbd=_0xfc8e0e[_0x5ed9('0x16b')];}else{_0xddabbd=this[_0x5ed9('0x16d')][_0x5ed9('0x70')](this,_0xfc8e0e[_0x5ed9('0x16b')]);if(!_0xddabbd){return this[_0x5ed9('0x33')]['error'](_0xfc8e0e,'no\x20queue\x20found');}}var _0x5980d0='';if(this['isConfigured'](_0xfc8e0e['file_id'])){var _0x57a7e3=this[_0x5ed9('0x10f')][_0x5ed9('0x70')](this,_0xfc8e0e[_0x5ed9('0x10d')]);if(_0x57a7e3){_0x5980d0=_0x57a7e3;}}this[_0x5ed9('0x32')][_0x5ed9('0x70')](this,_0xfc8e0e,_0xddabbd);if(_0xfc8e0e[_0x5ed9('0xe3')][_0x5ed9('0x16e')]('x')<0x0){_0xfc8e0e[_0x5ed9('0xe3')]+='x';}if(_0xfc8e0e['opts'][_0x5ed9('0x16e')]('X')<0x0){_0xfc8e0e[_0x5ed9('0xe3')]+='X';}this[_0x5ed9('0x33')][_0x5ed9('0x9e')](_0x5ed9('0x16f'),_0xddabbd?_0xddabbd[_0x5ed9('0x170')]():'');var _0x54e3a9=this['channel'][_0x5ed9('0x56')](_0x5ed9('0x171'),[_0xddabbd,_0xfc8e0e['opts'],_0xfc8e0e[_0x5ed9('0x72')],_0x5980d0,_0xfc8e0e['timeout'],_0xfc8e0e[_0x5ed9('0x9')],_0xfc8e0e[_0x5ed9('0x172')],_0xfc8e0e[_0x5ed9('0x173')],'',_0xfc8e0e[_0x5ed9('0x174')]]);if(_0x54e3a9[_0x5ed9('0xa4')]===-0x1){return _0x54e3a9;}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x175'),_0x5ed9('0x171'),_0xddabbd));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x176')]=function(_0x28f044){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x177'),_0x28f044[_0x5ed9('0x34')]));var _0x1b7a87=_0x28f044['recordingFormat']||'wav';var _0x33abf2=util[_0x5ed9('0x27')]('%s_%s',this['channel']['uniqueid'],rs[_0x5ed9('0x116')](0x5));var _0xf8a790=util[_0x5ed9('0x27')](_0x5ed9('0x178'),FILES_PATH,_0x33abf2,_0x1b7a87);var _0x1bc5d7=util['format']('%s/recordings/%s',FILES_PATH,_0x33abf2);this['createSquareRecording'][_0x5ed9('0x70')](this,_0x28f044,_0x33abf2,_0xf8a790);this[_0x5ed9('0x33')][_0x5ed9('0x9e')](_0x5ed9('0x179'),_0x33abf2);logger[_0x5ed9('0x2c')](_0x5ed9('0x17a'),_0x1bc5d7,_0x1b7a87,_0x28f044[_0x5ed9('0x17b')],_0x28f044['timeout']);return this[_0x5ed9('0x33')][_0x5ed9('0x12d')](_0x1bc5d7,_0x1b7a87,_0x28f044[_0x5ed9('0x17b')],_0x28f044[_0x5ed9('0x64')],undefined,!![]);};AGIVertices[_0x5ed9('0x12')]['restapi']=function(_0x27a703){logger['info'](util[_0x5ed9('0x27')](_0x5ed9('0x17c'),_0x27a703['label']));if(!this[_0x5ed9('0x85')](_0x27a703['url'])){return this[_0x5ed9('0x33')]['noop'](_0x5ed9('0x17d'));}var _0x5596e5=this['restAPI'][_0x5ed9('0x70')](this,_0x27a703);logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x17e'),util[_0x5ed9('0x17f')](_0x5596e5,{'showHidden':![],'depth':null})));if(!this[_0x5ed9('0x85')](_0x27a703[_0x5ed9('0xd6')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0x180'));}var _0x48434a=this[_0x5ed9('0x13')]['sync'](this,_0x27a703[_0x5ed9('0xd6')]);if(!_0x48434a){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x27a703,_0x5ed9('0xd7'));}this[_0x5ed9('0x33')][_0x5ed9('0x9e')](util['format']('%s_STATUS_CODE',_0x48434a),_0x5596e5[_0x5ed9('0x74')]?_0x5596e5['statusCode']:_0x5ed9('0x181'));this[_0x5ed9('0x33')]['setVariable'](util[_0x5ed9('0x27')](_0x5ed9('0x182'),_0x48434a),_0x5596e5['statusMessage']?_0x5596e5[_0x5ed9('0x75')]:'OK');if(_0x5596e5[_0x5ed9('0x6a')]){try{this['saveRestApiResult'](_0x5596e5['body'],_0x48434a);}catch(_0x413e07){logger['error'](util[_0x5ed9('0x27')](_0x5ed9('0x183'),_0x48434a));}}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util['format']('variable\x20%s\x20set',_0x48434a));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x184')]=function(_0xc10fce){logger['info'](util[_0x5ed9('0x27')](_0x5ed9('0x185'),_0xc10fce[_0x5ed9('0x34')]));return this[_0x5ed9('0x33')]['sayDigits'](_0xc10fce[_0x5ed9('0x186')]['replace'](/\s+/g,''),_0xc10fce['escape_digits']);};AGIVertices['prototype']['saynumber']=function(_0x3f219f){logger[_0x5ed9('0x2c')](util['format'](_0x5ed9('0x187'),_0x3f219f[_0x5ed9('0x34')]));return this[_0x5ed9('0x33')]['sayNumber'](_0x3f219f[_0x5ed9('0x65')]['replace'](/\s+/g,''),_0x3f219f[_0x5ed9('0x17b')]);};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x188')]=function(_0xfa8f32){logger['info'](util[_0x5ed9('0x27')](_0x5ed9('0x189'),_0xfa8f32[_0x5ed9('0x34')]));return this['channel']['sayPhonetic'](_0xfa8f32['text'],_0xfa8f32[_0x5ed9('0x17b')]);};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x18a')]=function(_0x2cbcd9){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x18b'),_0x2cbcd9[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x2cbcd9[_0x5ed9('0x18c')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0x18d'));}var _0x5d5ca2=this[_0x5ed9('0x20')]['sync'](this,_0x2cbcd9[_0x5ed9('0x18c')]);if(!_0x5d5ca2||!_0x5d5ca2[_0x5ed9('0x18e')]){return this[_0x5ed9('0x33')]['error'](_0x2cbcd9,_0x5ed9('0x18f'));}var _0x19647b={'from':util[_0x5ed9('0x27')]('\x22%s\x22\x20<%s>',_0x5d5ca2[_0x5ed9('0x1b')],_0x5d5ca2[_0x5ed9('0x190')]||_0x5d5ca2['Smtp'][_0x5ed9('0x191')]),'to':_0x2cbcd9['to']||'','cc':_0x2cbcd9['cc']||'','bcc':_0x2cbcd9['bcc']||'','subject':_0x2cbcd9[_0x5ed9('0x192')],'html':_0x2cbcd9[_0x5ed9('0x5b')],'text':_0x2cbcd9[_0x5ed9('0x5b')]};if(this[_0x5ed9('0x85')](_0x2cbcd9['template_id'])){}logger[_0x5ed9('0xdd')]('sendMail\x20message',JSON[_0x5ed9('0x73')](_0x19647b));this['createSquareDetailsReport'][_0x5ed9('0x70')](this,_0x2cbcd9,_0x2cbcd9['account_id']);this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x193'),_0x5d5ca2[_0x5ed9('0x1b')]));this[_0x5ed9('0x22')][_0x5ed9('0x70')](this,_0x5d5ca2[_0x5ed9('0x194')],_0x19647b);return this['channel'][_0x5ed9('0xa9')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x195')]=function(_0x162437){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x196'),_0x162437[_0x5ed9('0x34')]));return this['channel'][_0x5ed9('0xa9')](_0x5ed9('0x197'));};AGIVertices['prototype'][_0x5ed9('0x198')]=function(_0x3e5a70){logger['info'](util['format'](_0x5ed9('0x199'),_0x3e5a70[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x3e5a70[_0x5ed9('0x19a')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0x19b'));}var _0x12eaad=this['getSmsAccount'][_0x5ed9('0x70')](this,_0x3e5a70['sms_account_id']);if(!_0x12eaad){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x3e5a70,_0x5ed9('0x19c'));}var _0x5766a3={'body':_0x3e5a70[_0x5ed9('0x19d')],'phone':_0x3e5a70['to']||'','SmsAccountId':_0x12eaad['id']};logger[_0x5ed9('0xdd')]('sendSMS\x20message',JSON[_0x5ed9('0x73')](_0x5766a3));this['createSquareDetailsReport']['sync'](this,_0x3e5a70,_0x3e5a70['sms_account_id']);this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x12eaad[_0x5ed9('0x1b')]));this['createSmsMessage']['sync'](this,_0x5766a3);return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0x19e'));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x19f')]=function(_0x54f2ae){logger['info'](util[_0x5ed9('0x27')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x54f2ae[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x54f2ae['variable_id'])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x54f2ae,'no\x20variable\x20selected');}var _0x6c58c8=this[_0x5ed9('0x13')][_0x5ed9('0x70')](this,_0x54f2ae[_0x5ed9('0xd6')]);if(!_0x6c58c8){return this[_0x5ed9('0x33')]['error'](_0x54f2ae,_0x5ed9('0xd7'));}return this[_0x5ed9('0x33')]['setVariable'](_0x6c58c8,_0x54f2ae[_0x5ed9('0x1a0')]);};AGIVertices[_0x5ed9('0x12')]['start']=function(_0x1d29a4){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x1a1'),_0x1d29a4['label']));this['channel'][_0x5ed9('0xa9')](_0x5ed9('0x1a2'));var _0xc32db9=this['channel'][_0x5ed9('0x13')](_0x5ed9('0x1a3'));if(!_[_0x5ed9('0x45')](_0xc32db9[_0x5ed9('0xa2')])){this[_0x5ed9('0x33')][_0x5ed9('0x38')]=_0xc32db9[_0x5ed9('0xa2')];}if(_0x1d29a4[_0x5ed9('0xb7')]===_0x5ed9('0x1a4')){this['channel'][_0x5ed9('0xa9')](_0x5ed9('0x1a5'));return this['channel'][_0x5ed9('0xb7')]();}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0x1a6'));};AGIVertices[_0x5ed9('0x12')]['subproject']=function(_0x4f3631){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x4f3631['label']));if(!this[_0x5ed9('0x85')](_0x4f3631['project_id'])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x4f3631,_0x5ed9('0x1a7'));}var _0x2993e8=this[_0x5ed9('0x1a8')][_0x5ed9('0x70')](this,_0x4f3631[_0x5ed9('0x1a9')]);if(!this['isConfigured'](_0x2993e8)){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x4f3631,util[_0x5ed9('0x27')](_0x5ed9('0x1aa'),_0x4f3631[_0x5ed9('0x1a9')]));}if(_0x2993e8===this['channel'][_0x5ed9('0x35')]){return this[_0x5ed9('0x33')]['error'](_0x4f3631,_0x5ed9('0x1ab'));}this['createSquareDetailsReport'][_0x5ed9('0x70')](this,_0x4f3631,_0x2993e8);var _0x51e879=this[_0x5ed9('0x33')][_0x5ed9('0x56')](_0x5ed9('0x1ac'),util[_0x5ed9('0x27')](_0x5ed9('0x1ad'),config[_0x5ed9('0x9')][_0x5ed9('0x1ae')]||_0x5ed9('0x1af'),_0x2993e8,this[_0x5ed9('0x33')][_0x5ed9('0x35')]));if(_0x51e879[_0x5ed9('0xa4')]===-0x1){return _0x51e879;}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('Executed\x20command\x20%s\x20%s',_0x5ed9('0x1ac'),_0x2993e8));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x1b0')]=function(_0x1cc206){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x1cc206['label']));var _0x30d98f=this[_0x5ed9('0x55')][_0x5ed9('0x70')](this,_0x1cc206[_0x5ed9('0xb5')]);this[_0x5ed9('0x32')][_0x5ed9('0x70')](this,_0x1cc206,_0x1cc206[_0x5ed9('0xb5')]);if(this[_0x5ed9('0x85')](_0x1cc206[_0x5ed9('0xd6')])){var _0x2ce58f=this[_0x5ed9('0x13')][_0x5ed9('0x70')](this,_0x1cc206['variable_id']);if(_0x2ce58f){this[_0x5ed9('0x33')][_0x5ed9('0x9e')](_0x2ce58f,_0x30d98f);return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x1b1'),_0x1cc206[_0x5ed9('0xb5')],_0x2ce58f));}}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x1b2'),_0x1cc206[_0x5ed9('0xb5')]));};AGIVertices['prototype'][_0x5ed9('0x1b3')]=function(_0x2ed555){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x1b4'),_0x2ed555['label']));_0x2ed555[_0x5ed9('0x5b')]=_0x2ed555[_0x5ed9('0x5b')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x5ed9('0x85')](_0x2ed555['apiKey'])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0x1b5'));}if(!this['isConfigured'](_0x2ed555['text'])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](_0x5ed9('0xaa'));}this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x2ed555[_0x5ed9('0x5b')]));var _0x54dd80=this[_0x5ed9('0x58')][_0x5ed9('0x70')](this,_0x2ed555);if(_0x54dd80){this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x1b6'),_0x54dd80));var _0x3f7bbc=this[_0x5ed9('0x33')][_0x5ed9('0x11f')](_0x54dd80);try{fs[_0x5ed9('0x100')](_0x54dd80+'.wav');}catch(_0x17e409){logger[_0x5ed9('0x2a')](_0x17e409);}return _0x3f7bbc;}return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x2ed555,_0x5ed9('0x1b7'));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x1b8')]=function(_0x4ad5df){logger['info'](util[_0x5ed9('0x27')](_0x5ed9('0x1b9'),_0x4ad5df[_0x5ed9('0x34')]));_0x4ad5df[_0x5ed9('0x5b')]=_0x4ad5df[_0x5ed9('0x5b')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x5ed9('0x85')](_0x4ad5df[_0x5ed9('0x5b')])){return this[_0x5ed9('0x33')][_0x5ed9('0xa9')]('no\x20text\x20configured');}this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util['format']('Trying\x20Google\x20TTS\x20%s',_0x4ad5df['text']));var _0x1d1204=this['googleTTS'][_0x5ed9('0x70')](this,_0x4ad5df);if(_0x1d1204){this['channel']['noop'](util[_0x5ed9('0x27')](_0x5ed9('0x1ba'),_0x1d1204));var _0x567dcb=this['channel'][_0x5ed9('0x11f')](_0x1d1204);try{fs['unlink'](_0x1d1204+'.wav');}catch(_0x4dccb5){logger['error'](_0x4dccb5);}return _0x567dcb;}return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x4ad5df,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x1bb')]=function(_0x11d626){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x11d626[_0x5ed9('0x34')]));if(!this['isConfigured'](_0x11d626[_0x5ed9('0x152')])){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x11d626,_0x5ed9('0x153'));}logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x154'),this[_0x5ed9('0x33')]['callerid'],_0x11d626[_0x5ed9('0x152')]));var _0x33da83=this[_0x5ed9('0x50')][_0x5ed9('0x70')](this,_0x11d626[_0x5ed9('0x152')]);if(_0x33da83){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x5ed9('0x33')][_0x5ed9('0x36')],_0x11d626[_0x5ed9('0x152')]));this['channel']['noop'](util[_0x5ed9('0x27')](_0x5ed9('0x155'),this[_0x5ed9('0x33')]['callerid'],_0x11d626[_0x5ed9('0x152')]));return{'code':0xc8,'result':'success'};}else{logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x157'),this[_0x5ed9('0x33')]['callerid'],_0x11d626['findBy']));this['channel'][_0x5ed9('0xa9')](util[_0x5ed9('0x27')](_0x5ed9('0x157'),this[_0x5ed9('0x33')][_0x5ed9('0x36')],_0x11d626[_0x5ed9('0x152')]));return{'code':0xc8,'result':_0x5ed9('0x158')};}};AGIVertices[_0x5ed9('0x12')]['voicemail']=function(_0x162790){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x162790[_0x5ed9('0x34')]));var _0xb01a74=this[_0x5ed9('0x33')][_0x5ed9('0x56')]('VOICEMAIL',[_0x162790['mailbox'],_0x162790[_0x5ed9('0x77')]]);if(_0xb01a74[_0x5ed9('0xa4')]===-0x1){return _0xb01a74;}return this[_0x5ed9('0x33')][_0x5ed9('0xa9')](util[_0x5ed9('0x27')]('Executed\x20command\x20%s\x20%s',_0x5ed9('0x1bc'),_0x162790[_0x5ed9('0x1bd')]));};AGIVertices[_0x5ed9('0x12')][_0x5ed9('0x1be')]=function(_0x43d948){logger[_0x5ed9('0x2c')](util[_0x5ed9('0x27')](_0x5ed9('0x1bf'),_0x43d948[_0x5ed9('0x34')]));if(!this[_0x5ed9('0x85')](_0x43d948[_0x5ed9('0xd6')])){return this[_0x5ed9('0x33')]['error'](_0x43d948,_0x5ed9('0x1c0'));}var _0x5343fb=this['getVariable']['sync'](this,_0x43d948[_0x5ed9('0xd6')]);if(!_0x5343fb){return this[_0x5ed9('0x33')][_0x5ed9('0x2a')](_0x43d948,_0x5ed9('0xd7'));}var _0x32f6b3=this[_0x5ed9('0x33')]['getVariable'](_0x5343fb);return{'code':0xc8,'result':_0x32f6b3['extra']?_0x32f6b3[_0x5ed9('0xa2')]:'-'};};String[_0x5ed9('0x12')][_0x5ed9('0xa1')]=function(_0x1118e6,_0x54db1c){return this['split'](_0x1118e6)['join'](_0x54db1c);};module[_0x5ed9('0x1c1')]=AGIVertices; \ No newline at end of file +var _0xec39=['getSmsAccount','getSmsAccountById','createSmsMessage','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','Callback\x20scheduled\x20at\x20','scheduledAt','callback_priority','getPause','agentPause','agent','uniqueid','agentLogout','agentLogin','internal','format','%s/%s@from-sip/n','LOCAL','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','googleTTS','google_tts_language','url','method','timeout','number','includes','PUT','toUpperCase','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','uri','render','stringify','body','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','dialogflowV2_language','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','replaceAllVariables','split','replaceAll','getVariable','toString','getAndSetVariable','sync','retry','maxRetry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','result','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','no\x20grammar\x20configured','grammar','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','callback','no\x20list\x20selected','delay','add','minutes','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','getSquareOdbc','query:\x20%s','getQueryOdbc','createSquareDetailsReport','variable_id','forEach','%s[%s][%s]','dial','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','speech','out','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20project_id\x20configured','no\x20client_email\x20configured','private_key','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','response','test','mindigit','no\x20variable\x20found','hiddendigitsnum','generate','hiddendigitspos','first','substr','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','extra','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','beep','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','success','math','math\x20%s','operation','no\x20variable\x20selected\x20for\x20the\x20result','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20found','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','statusMessage','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','user','subject','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','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','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','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\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','agentUnpause','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','no\x20variable\x20selected','join','exports','util','lodash','shelljs','odbc','randomstring','moment','mustache','../../config/logger','agi','../../config/environment','rawBody','menu','getdigits','channel','rpc','mailRpc','prototype','getVariableById','then','name','getVoiceQueue','getVoiceQueueById','catch','getSquareProject','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s'];(function(_0xd4f90b,_0x148333){var _0x451848=function(_0x12c95c){while(--_0x12c95c){_0xd4f90b['push'](_0xd4f90b['shift']());}};_0x451848(++_0x148333);}(_0xec39,0x19f));var _0x9ec3=function(_0xd9295b,_0x121f60){_0xd9295b=_0xd9295b-0x0;var _0x53d62e=_0xec39[_0xd9295b];return _0x53d62e;};'use strict';var fs=require('fs');var util=require(_0x9ec3('0x0'));var _=require(_0x9ec3('0x1'));var sh=require(_0x9ec3('0x2'));var odbc=require(_0x9ec3('0x3'))();var rs=require(_0x9ec3('0x4'));var moment=require(_0x9ec3('0x5'));var Mustache=require(_0x9ec3('0x6'));var rp=require('request-promise');var logger=require(_0x9ec3('0x7'))(_0x9ec3('0x8'));var config=require(_0x9ec3('0x9'));var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders',_0x9ec3('0xa')];var verticesWithRetry=[_0x9ec3('0xb'),_0x9ec3('0xc'),'getsecretdigits'];var AGIVertices=function(_0x570a91,_0xb10fef,_0x2e49f3){this[_0x9ec3('0xd')]=_0x570a91;this[_0x9ec3('0xe')]=_0xb10fef;this[_0x9ec3('0xf')]=_0x2e49f3;};AGIVertices[_0x9ec3('0x10')]['getVariable']=function(_0x1a0555,_0xaa1307){this[_0x9ec3('0xe')][_0x9ec3('0x11')](_0x1a0555)[_0x9ec3('0x12')](function(_0x18ef85){_0xaa1307(null,_0x18ef85?_0x18ef85[_0x9ec3('0x13')]:![]);})['catch'](function(_0x2790dc){_0xaa1307(_0x2790dc);});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x14')]=function(_0x4bb1b3,_0x2b9f69){this['rpc'][_0x9ec3('0x15')](_0x4bb1b3)[_0x9ec3('0x12')](function(_0xcbb897){_0x2b9f69(null,_0xcbb897?_0xcbb897[_0x9ec3('0x13')]:![]);})[_0x9ec3('0x16')](function(_0x2c0ad5){_0x2b9f69(_0x2c0ad5);});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x17')]=function(_0x453010,_0x58dd6f){this[_0x9ec3('0xe')]['getSquareProjectById'](_0x453010)['then'](function(_0x2ae9bd){_0x58dd6f(null,_0x2ae9bd?_0x2ae9bd[_0x9ec3('0x13')]:![]);})[_0x9ec3('0x16')](function(_0xa3bade){_0x58dd6f(_0xa3bade);});};AGIVertices[_0x9ec3('0x10')]['getSquareOdbc']=function(_0x16e34d,_0x4a413c){this[_0x9ec3('0xe')]['getSquareOdbcById'](_0x16e34d)[_0x9ec3('0x12')](function(_0x28e31f){_0x4a413c(null,_0x28e31f?_0x28e31f[_0x9ec3('0x18')]:![]);})['catch'](function(_0x70227a){_0x4a413c(_0x70227a);});};AGIVertices['prototype'][_0x9ec3('0x19')]=function(_0x4a8c62,_0xcb54c){this[_0x9ec3('0xe')][_0x9ec3('0x1a')](_0x4a8c62)[_0x9ec3('0x12')](function(_0x36f64c){_0xcb54c(null,_0x36f64c?_0x36f64c[_0x9ec3('0x13')]:![]);})[_0x9ec3('0x16')](function(_0x5efa81){_0xcb54c(_0x5efa81);});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x1b')]=function(_0x484891,_0x3b11db){this[_0x9ec3('0xe')][_0x9ec3('0x1c')](_0x484891)[_0x9ec3('0x12')](function(_0x4782c9){_0x3b11db(null,_0x4782c9?_0x4782c9[_0x9ec3('0x13')]:![]);})[_0x9ec3('0x16')](function(_0xb99216){_0x3b11db(_0xb99216);});};AGIVertices['prototype'][_0x9ec3('0x1d')]=function(_0x2c9e39,_0x30abfb){var _0x1fd911=this;this['rpc'][_0x9ec3('0x1e')](_0x2c9e39)[_0x9ec3('0x12')](function(_0x141149){_0x30abfb(null,_0x141149?_0x1fd911[_0x9ec3('0x1f')](_0x141149[_0x9ec3('0x20')]):![]);})[_0x9ec3('0x16')](function(_0x3d67be){_0x30abfb(_0x3d67be);});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x21')]=function(_0x15a602,_0xe21f81){this[_0x9ec3('0xe')][_0x9ec3('0x22')](_0x15a602)[_0x9ec3('0x12')](function(_0x2b7113){_0xe21f81(null,_0x2b7113?_0x2b7113:![]);})[_0x9ec3('0x16')](function(_0x2f4224){_0xe21f81(_0x2f4224);});};AGIVertices['prototype']['sendMailMessage']=function(_0x4c50fd,_0x1e86a7,_0x3c18a7){this[_0x9ec3('0xf')][_0x9ec3('0x23')](_0x4c50fd,_0x1e86a7)[_0x9ec3('0x12')](function(){_0x3c18a7(null);})[_0x9ec3('0x16')](function(_0x2891fc){_0x3c18a7(_0x2891fc);});};AGIVertices['prototype'][_0x9ec3('0x24')]=function(_0x22910c,_0x1f8962){this['rpc'][_0x9ec3('0x25')](_0x22910c)[_0x9ec3('0x12')](function(_0x5bb3db){if(_0x5bb3db){if(_0x5bb3db[_0x9ec3('0x26')]){_0x1f8962(null,[_0x5bb3db[_0x9ec3('0x27')]]);}else{_0x1f8962(null,_[_0x9ec3('0x28')](_0x5bb3db[_0x9ec3('0x29')],_0x9ec3('0x27')));}}else{_0x1f8962(null,![]);}})[_0x9ec3('0x16')](function(_0x29103d){_0x1f8962(_0x29103d);});};AGIVertices['prototype'][_0x9ec3('0x1f')]=function(_0x32581e){return util['format']('%s/sounds/converted/%s',FILES_PATH,_0x32581e);};AGIVertices[_0x9ec3('0x10')]['getQueryOdbc']=function(_0x338298,_0x1bd8a0,_0x1b9704){odbc[_0x9ec3('0x2a')](_0x338298,function(_0x57e954){if(_0x57e954){logger[_0x9ec3('0x2b')](_0x9ec3('0x2c'),_0x57e954);_0x1b9704(_0x57e954);}else{logger[_0x9ec3('0x2d')](_0x9ec3('0x2e'));odbc[_0x9ec3('0x2f')](_0x1bd8a0,function(_0x149bf1,_0x51a6ad){if(_0x149bf1){logger['info']('Error\x20executing\x20query\x20%s',_0x1bd8a0);_0x1b9704(_0x149bf1);}else{logger[_0x9ec3('0x2d')](_0x9ec3('0x30'),_0x1bd8a0);odbc[_0x9ec3('0x31')](function(_0x2ab229){if(_0x2ab229){logger[_0x9ec3('0x2b')](_0x9ec3('0x32'),_0x2ab229);}_0x1b9704(null,_0x51a6ad);});}});}});};AGIVertices['prototype'][_0x9ec3('0x33')]=function(_0x4241b1,_0x58ed33){this[_0x9ec3('0xe')][_0x9ec3('0x34')](_0x4241b1)[_0x9ec3('0x12')](function(_0x2bafea){_0x58ed33(null,_0x2bafea?_0x2bafea:![]);})['catch'](function(_0xc41a94){_0x58ed33(_0xc41a94);});};AGIVertices['prototype'][_0x9ec3('0x35')]=function(_0x3f6cbe,_0x3d16ce){this[_0x9ec3('0xe')][_0x9ec3('0x35')](_0x3f6cbe)['then'](function(_0x5ef1dc){_0x3d16ce(null,_0x5ef1dc);})[_0x9ec3('0x16')](function(_0x512e5c){_0x3d16ce(_0x512e5c);});};AGIVertices[_0x9ec3('0x10')]['createSquareDetailsReport']=function(_0x3d54e4,_0x4e279c,_0x14b1f1){this[_0x9ec3('0xe')]['createSquareDetailsReport']({'uniqueid':this[_0x9ec3('0xd')]['uniqueid'],'node':_0x3d54e4[_0x9ec3('0x36')],'application':_0x3d54e4[_0x9ec3('0x37')],'data':_0x4e279c||null,'project_name':this['channel'][_0x9ec3('0x38')],'callerid':this[_0x9ec3('0xd')][_0x9ec3('0x39')]})['then'](function(_0x42347e){if(_0x14b1f1){_0x14b1f1(null,_0x42347e);}})[_0x9ec3('0x16')](function(_0x551be3){if(_0x14b1f1){_0x14b1f1(_0x551be3);}});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x3a')]=function(_0x341b8d,_0xc0900b,_0x46ad5f,_0xd2b4a7){this[_0x9ec3('0xe')][_0x9ec3('0x3a')]({'uniqueid':this['channel']['uniqueid'],'callerid':this[_0x9ec3('0xd')][_0x9ec3('0x39')],'calleridname':this['channel'][_0x9ec3('0x3b')],'context':this[_0x9ec3('0xd')]['context'],'extension':this[_0x9ec3('0xd')][_0x9ec3('0x3c')],'priority':this[_0x9ec3('0xd')][_0x9ec3('0x3d')],'accountcode':this[_0x9ec3('0xd')][_0x9ec3('0x3e')],'dnid':this[_0x9ec3('0xd')][_0x9ec3('0x3f')],'projectName':this[_0x9ec3('0xd')][_0x9ec3('0x38')],'saveName':_0xc0900b,'filename':_0x341b8d[_0x9ec3('0x40')]||_0xc0900b,'savePath':_0x46ad5f})[_0x9ec3('0x12')](function(_0x284088){_0xd2b4a7(null,_0x284088);})['catch'](function(_0x60ac46){_0xd2b4a7(_0x60ac46);});};AGIVertices['prototype'][_0x9ec3('0x41')]=function(_0x1e7766,_0x7713b5,_0x58c812,_0x55c7e2,_0x53bb29){this[_0x9ec3('0xe')][_0x9ec3('0x41')]({'uniqueid':this[_0x9ec3('0xd')]['uniqueid'],'body':_0x1e7766,'direction':_0x7713b5,'providerName':_0x58c812,'providerResponse':_0x55c7e2})['then'](function(_0x5d48d1){if(_0x53bb29){_0x53bb29(null,_0x5d48d1);}})[_0x9ec3('0x16')](function(_0x25333a){if(_0x53bb29){_0x53bb29(_0x25333a);}});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x42')]=function(_0x3c837b,_0x38e099){this['rpc'][_0x9ec3('0x42')]({'firstName':_[_0x9ec3('0x43')](_0x3c837b[_0x9ec3('0x13')])||_[_0x9ec3('0x44')](_0x3c837b[_0x9ec3('0x13')])?_0x9ec3('0x45')+Math[_0x9ec3('0x46')]():_0x3c837b[_0x9ec3('0x13')],'lastName':_[_0x9ec3('0x43')](_0x3c837b[_0x9ec3('0x47')])||_[_0x9ec3('0x44')](_0x3c837b['lastName'])?null:_0x3c837b['lastName'],'phone':_0x3c837b[_0x9ec3('0x48')],'ListId':_0x3c837b[_0x9ec3('0x49')],'scheduledat':_0x3c837b['scheduledAt'],'callbackUniqueid':this[_0x9ec3('0xd')]['uniqueid'],'tags':'callback','description':_0x9ec3('0x4a')+_0x3c837b[_0x9ec3('0x4b')]['toString'](),'priority':_0x3c837b[_0x9ec3('0x4c')]})[_0x9ec3('0x12')](function(_0x13e9f1){_0x38e099(null,_0x13e9f1);})[_0x9ec3('0x16')](function(_0x38f161){_0x38e099(_0x38f161);});};AGIVertices['prototype'][_0x9ec3('0x4d')]=function(_0xa3153a,_0x5a8b24){this[_0x9ec3('0xe')]['getPauseById'](_0xa3153a)[_0x9ec3('0x12')](function(_0x1d7b7d){_0x5a8b24(null,_0x1d7b7d?_0x1d7b7d[_0x9ec3('0x13')]:![]);})[_0x9ec3('0x16')](function(_0x18813b){_0x5a8b24(_0x18813b);});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x4e')]=function(_0x4d30aa,_0x5baa8c,_0x508c7f){var _0x41bbd7={'role':_0x9ec3('0x4f')};_0x41bbd7[_0x4d30aa]=this[_0x9ec3('0xd')][_0x9ec3('0x39')];this[_0x9ec3('0xe')][_0x9ec3('0x4e')](_0x41bbd7,_0x5baa8c,this[_0x9ec3('0xd')][_0x9ec3('0x50')])[_0x9ec3('0x12')](function(_0x1d41ff){_0x508c7f(null,_[_0x9ec3('0x44')](_0x1d41ff)?![]:!![]);})[_0x9ec3('0x16')](function(_0x1ac7ba){logger[_0x9ec3('0x2b')](_0x1ac7ba);_0x508c7f(null,![]);});};AGIVertices[_0x9ec3('0x10')]['agentUnpause']=function(_0x54fa71,_0x4f96d3){var _0xe85f62={'role':_0x9ec3('0x4f')};_0xe85f62[_0x54fa71]=this[_0x9ec3('0xd')][_0x9ec3('0x39')];this[_0x9ec3('0xe')]['agentUnpause'](_0xe85f62)[_0x9ec3('0x12')](function(_0x4842e0){_0x4f96d3(null,_[_0x9ec3('0x44')](_0x4842e0)?![]:!![]);})[_0x9ec3('0x16')](function(_0x1d0b50){logger[_0x9ec3('0x2b')](_0x1d0b50);_0x4f96d3(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x2cf716,_0x5e04f9){var _0x30dc77={'role':_0x9ec3('0x4f')};_0x30dc77[_0x2cf716]=this['channel'][_0x9ec3('0x39')];this['rpc'][_0x9ec3('0x51')](_0x30dc77)[_0x9ec3('0x12')](function(_0x401d93){_0x5e04f9(null,_[_0x9ec3('0x44')](_0x401d93)?![]:!![]);})[_0x9ec3('0x16')](function(_0x56f621){logger['error'](_0x56f621);_0x5e04f9(null,![]);});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x52')]=function(_0x333e11,_0x3428d8){var _0x53c877={'role':'agent'};_0x53c877[_0x333e11]=this[_0x9ec3('0xd')][_0x9ec3('0x39')];var _0x16deb9=_0x333e11!=_0x9ec3('0x53')?util[_0x9ec3('0x54')](_0x9ec3('0x55'),_0x9ec3('0x56'),this['channel'][_0x9ec3('0x39')]):undefined;this[_0x9ec3('0xe')]['agentLogin'](_0x53c877,_0x16deb9)[_0x9ec3('0x12')](function(_0x4a1bd7){_0x3428d8(null,_[_0x9ec3('0x44')](_0x4a1bd7)?![]:!![]);})['catch'](function(_0x38506d){logger[_0x9ec3('0x2b')](_0x38506d);_0x3428d8(null,![]);});};AGIVertices[_0x9ec3('0x10')]['shellCommand']=function(_0x4e9f91,_0x379841){sh[_0x9ec3('0x57')](_['trim'](_0x4e9f91),function(_0x2fed2b,_0x299d23){var _0x3f3e2b=_0x299d23[_0x9ec3('0x58')](/(\r\n|\n|\r)/gm,'');_0x379841(null,_0x3f3e2b);});};AGIVertices[_0x9ec3('0x10')]['googleCloudTTS']=function(_0x2bcc6e,_0x27d979){scripts[_0x9ec3('0x59')](_0x2bcc6e[_0x9ec3('0x5a')],_0x2bcc6e[_0x9ec3('0x5b')]||_0x9ec3('0x5c'),_0x2bcc6e[_0x9ec3('0x5c')],_0x2bcc6e[_0x9ec3('0x5d')]||_0x9ec3('0x5e'),_0x2bcc6e[_0x9ec3('0x5f')]||_0x9ec3('0x60'),_0x2bcc6e[_0x9ec3('0x61')]||'MP3')[_0x9ec3('0x12')](function(_0x1d6a70){_0x27d979(null,_0x1d6a70);})['catch'](function(_0x2cc923){_0x27d979(_0x2cc923);});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x62')]=function(_0x3d4f76,_0x253876){scripts[_0x9ec3('0x62')](_0x3d4f76[_0x9ec3('0x5c')],_0x3d4f76[_0x9ec3('0x63')]||'en',0x1)[_0x9ec3('0x12')](function(_0x5a147a){_0x253876(null,_0x5a147a);})[_0x9ec3('0x16')](function(_0x5261d0){_0x253876(_0x5261d0);});};AGIVertices['prototype']['restAPI']=function(_0xe1b497,_0x2edfe5){var _0x4881ff={'uri':_0xe1b497[_0x9ec3('0x64')],'method':_0xe1b497[_0x9ec3('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0xe1b497[_0x9ec3('0x66')])===_0x9ec3('0x67')&&parseInt(_0xe1b497[_0x9ec3('0x66')])>=0x1?parseInt(_0xe1b497[_0x9ec3('0x66')])*0x3e8:0x5*0x3e8};if(_[_0x9ec3('0x68')](['POST',_0x9ec3('0x69')],_0x4881ff[_0x9ec3('0x65')][_0x9ec3('0x6a')]())){try{_0x4881ff['body']=_0xe1b497[_0x9ec3('0xa')]?JSON[_0x9ec3('0x6b')](_0xe1b497[_0x9ec3('0xa')]):{};}catch(_0x15b7ec){logger[_0x9ec3('0x2b')](_0x9ec3('0x6c'),_0x15b7ec);}}try{_0x4881ff[_0x9ec3('0x6d')]=_0xe1b497[_0x9ec3('0x6e')]?JSON[_0x9ec3('0x6b')](_0xe1b497[_0x9ec3('0x6e')]):{};}catch(_0x3e0c77){logger[_0x9ec3('0x2b')](_0x9ec3('0x6f'),_0x3e0c77);}if(_0xe1b497[_0x9ec3('0x70')]){try{var _0xd43828=require(_0xe1b497[_0x9ec3('0x70')])['sync'](this,_0x4881ff);_0x4881ff[_0x9ec3('0x71')]=Mustache[_0x9ec3('0x72')](_0xe1b497[_0x9ec3('0x64')],_0xd43828,{},['$$','$$']);if(_0x4881ff[_0x9ec3('0x6d')]){_0x4881ff[_0x9ec3('0x6d')]=JSON[_0x9ec3('0x6b')](Mustache[_0x9ec3('0x72')](JSON[_0x9ec3('0x73')](_0x4881ff[_0x9ec3('0x6d')]),_0xd43828,{},['$$','$$']));}if(_0x4881ff['body']){_0x4881ff['body']=JSON[_0x9ec3('0x6b')](Mustache[_0x9ec3('0x72')](JSON[_0x9ec3('0x73')](_0x4881ff[_0x9ec3('0x74')]),_0xd43828,{},['$$','$$']));}}catch(_0x274845){logger[_0x9ec3('0x2b')](_0x9ec3('0x75'),_0x274845);}}rp(_0x4881ff)[_0x9ec3('0x12')](function(_0x2ec1a4){var _0x39bfdd={'statusCode':_0x2ec1a4[_0x9ec3('0x76')]||0xc8,'statusMessage':_0x2ec1a4['statusMessage']||'OK','headers':_0x2ec1a4['headers']||{},'body':_0x2ec1a4[_0x9ec3('0x74')]||{}};_0x2edfe5(null,_0x39bfdd);})['catch'](function(_0x15bc09){var _0x5cdec1={'statusCode':_0x15bc09[_0x9ec3('0x76')]||0x1f4,'statusMessage':_0x15bc09[_0x9ec3('0x77')]||_0x9ec3('0x78'),'headers':_0x15bc09['options'][_0x9ec3('0x6d')]||{},'body':_0x15bc09[_0x9ec3('0x79')][_0x9ec3('0x74')]||{}};_0x2edfe5(null,_0x5cdec1);});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x7a')]=function(_0x2f0b22,_0x54258d){scripts[_0x9ec3('0x7a')](this['channel'][_0x9ec3('0x50')],_0x2f0b22[_0x9ec3('0x7b')],_0x2f0b22['text'],_0x2f0b22[_0x9ec3('0x7c')]||'en')['then'](function(_0x30e0cd){_0x54258d(null,_0x30e0cd);})[_0x9ec3('0x16')](function(_0x5df3a4){_0x54258d(_0x5df3a4);});};AGIVertices['prototype'][_0x9ec3('0x7d')]=function(_0xc2ba5b,_0x40cb7f){scripts[_0x9ec3('0x7d')](this[_0x9ec3('0xd')][_0x9ec3('0x50')],_0xc2ba5b[_0x9ec3('0x7e')],_0xc2ba5b[_0x9ec3('0x7f')],_0xc2ba5b['private_key'],_0xc2ba5b[_0x9ec3('0x5c')],_0xc2ba5b[_0x9ec3('0x80')]||'en')['then'](function(_0x1a760f){_0x40cb7f(null,_0x1a760f);})[_0x9ec3('0x16')](function(_0x4f2584){_0x40cb7f(_0x4f2584);});};AGIVertices[_0x9ec3('0x10')]['sestekNDA']=function(_0x839158,_0x5f2bcf){scripts['sestekNDA'](this[_0x9ec3('0xd')],_0x839158)[_0x9ec3('0x12')](function(_0x39339e){_0x5f2bcf(null,_0x39339e);})[_0x9ec3('0x16')](function(_0x586cc5){_0x5f2bcf(_0x586cc5);});};AGIVertices['prototype'][_0x9ec3('0x81')]=function(_0x56feee,_0x4485de){scripts[_0x9ec3('0x81')](_0x56feee['key'],_0x56feee['text'],_0x56feee[_0x9ec3('0x82')]||_0x9ec3('0x5e'),_0x56feee[_0x9ec3('0x83')])[_0x9ec3('0x12')](function(_0x3ceb8d){_0x4485de(null,_0x3ceb8d);})['catch'](function(_0x472e62){_0x4485de(_0x472e62);});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x84')]=function(_0x3cb91d,_0x5cc4ee,_0x540df8){scripts[_0x9ec3('0x84')](_0x5cc4ee,_0x3cb91d[_0x9ec3('0x7b')],_0x3cb91d[_0x9ec3('0x85')]||_0x9ec3('0x5e'),this[_0x9ec3('0x86')](_0x3cb91d[_0x9ec3('0x87')])?_0x3cb91d['model']:undefined)[_0x9ec3('0x12')](function(_0x55c74e){_0x540df8(null,_0x55c74e);})[_0x9ec3('0x16')](function(_0x4216c8){_0x540df8(_0x4216c8);});};AGIVertices['prototype'][_0x9ec3('0x88')]=function(_0x1d36a7,_0x4fadc3){scripts[_0x9ec3('0x88')](_0x1d36a7[_0x9ec3('0x89')],_0x1d36a7['aws_secret_access_key'],_0x1d36a7['aws_polly_region'],_0x1d36a7[_0x9ec3('0x8a')]||_0x9ec3('0x8b'),_0x1d36a7[_0x9ec3('0x5c')],_0x1d36a7[_0x9ec3('0x8c')]||'text')[_0x9ec3('0x12')](function(_0x48c901){_0x4fadc3(null,_0x48c901);})[_0x9ec3('0x16')](function(_0x20bde9){_0x4fadc3(_0x20bde9);});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x8d')]=function(_0x59b75e,_0x1f4137){scripts['awsLex'](this[_0x9ec3('0xd')]['uniqueid'],_0x59b75e[_0x9ec3('0x89')],_0x59b75e[_0x9ec3('0x8e')],_0x59b75e[_0x9ec3('0x8f')],_0x59b75e['text'],_0x59b75e[_0x9ec3('0x90')])['then'](function(_0x4b9178){_0x1f4137(null,_0x4b9178);})[_0x9ec3('0x16')](function(_0xd8dca8){_0x1f4137(_0xd8dca8);});};AGIVertices['prototype'][_0x9ec3('0x91')]=function(_0x491c73,_0x1608b7,_0x122853){scripts[_0x9ec3('0x91')](_0x1608b7,_0x491c73[_0x9ec3('0x7b')],_0x491c73[_0x9ec3('0x92')]||_0x9ec3('0x5e'))[_0x9ec3('0x12')](function(_0x39a344){_0x122853(null,_0x39a344);})[_0x9ec3('0x16')](function(_0x3386a6){_0x122853(_0x3386a6);});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x93')]=function(_0x5ab726,_0x3e7b12,_0xde6002){scripts[_0x9ec3('0x93')](_0x3e7b12,_0x5ab726['appid'],_0x5ab726[_0x9ec3('0x94')],_0x5ab726['uri'])['then'](function(_0x5c47a0){_0xde6002(null,_0x5c47a0);})['catch'](function(_0x4571b6){_0xde6002(_0x4571b6);});};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x95')]=function(_0x1abda8){var _0x41f8e5=_[_0x9ec3('0x68')](verticesWithRetry,_0x1abda8['agicommand'])?_0x1abda8:_[_0x9ec3('0x96')](_0x1abda8);for(var _0x1b31d0 in _0x41f8e5){if(_0x41f8e5[_0x9ec3('0x97')](_0x1b31d0)){if(_0x41f8e5[_0x1b31d0]&&_[_0x9ec3('0x98')](_0x41f8e5[_0x1b31d0])){if(_[_0x9ec3('0x68')](recursiveMapAttributes,_0x1b31d0)){_0x41f8e5[_0x1b31d0]=this[_0x9ec3('0x99')](_0x41f8e5[_0x1b31d0]);}else{_0x41f8e5[_0x1b31d0]=this['replaceAllVariables'](_0x41f8e5[_0x1b31d0]);}}}}return _0x41f8e5;};AGIVertices['prototype'][_0x9ec3('0x9a')]=function(_0x2a3493){for(var _0x4ce718 in _0x2a3493){if(_0x2a3493[_0x9ec3('0x97')](_0x4ce718)){if(_[_0x9ec3('0x9b')](_0x2a3493[_0x4ce718])){this[_0x9ec3('0x9a')](_0x2a3493[_0x4ce718]);}else if(_[_0x9ec3('0x9c')](_0x2a3493[_0x4ce718])){for(var _0x311661=0x0;_0x311661<_0x2a3493[_0x4ce718][_0x9ec3('0x9d')];_0x311661++){this[_0x9ec3('0x9a')](_0x2a3493[_0x4ce718][_0x311661]);}}else if(_[_0x9ec3('0x98')](_0x2a3493[_0x4ce718])){_0x2a3493[_0x4ce718]=this['replaceAllVariables'](_0x2a3493[_0x4ce718]);}}}};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x9e')]=function(_0x129ffe,_0x2afa71){for(var _0x465fce in _0x129ffe){if(_0x129ffe[_0x9ec3('0x97')](_0x465fce)){if(_[_0x9ec3('0x9b')](_0x129ffe[_0x465fce])){if(!_[_0x9ec3('0x43')](_0x129ffe[_0x465fce])){this[_0x9ec3('0x9e')](_0x129ffe[_0x465fce],util[_0x9ec3('0x54')]('%s.%s',_0x2afa71,_0x465fce));}}else if(_[_0x9ec3('0x9c')](_0x129ffe[_0x465fce])){for(var _0x21da07=0x0;_0x21da07<_0x129ffe[_0x465fce][_0x9ec3('0x9d')];_0x21da07++){this[_0x9ec3('0x9e')](_0x129ffe[_0x465fce][_0x21da07],util[_0x9ec3('0x54')](_0x9ec3('0x9f'),_0x2afa71,_0x465fce+'['+_0x21da07+']'));}}else{if(!_[_0x9ec3('0x44')](_0x129ffe[_0x465fce])){this['channel'][_0x9ec3('0xa0')](util[_0x9ec3('0x54')](_0x9ec3('0x9f'),_0x2afa71,_0x465fce),_0x129ffe[_0x465fce]);}}}}};AGIVertices['prototype'][_0x9ec3('0x99')]=function(_0x240a88){try{var _0x4ddd4f=JSON[_0x9ec3('0x6b')](_0x240a88);this[_0x9ec3('0x9a')](_0x4ddd4f);return JSON[_0x9ec3('0x73')](_0x4ddd4f);}catch(_0x29e21a){return this['replaceAllVariables'](_0x240a88);}};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xa1')]=function(_0x537330){var _0x1900a6=_0x537330[_0x9ec3('0xa2')]('{');for(var _0x1a0575=0x1;_0x1a0575<_0x1900a6[_0x9ec3('0x9d')];_0x1a0575+=0x1){var _0x266d3c=_0x1900a6[_0x1a0575]['split']('}');if(_0x266d3c[_0x9ec3('0x9d')]>0x1){_0x537330=_0x537330[_0x9ec3('0xa3')]('{'+_0x266d3c[0x0]+'}',this[_0x9ec3('0xd')][_0x9ec3('0xa4')](_0x266d3c[0x0])['extra']||_0x266d3c[0x0]);}}if(_0x1900a6[_0x9ec3('0x9d')]===0x1){return _0x537330[_0x9ec3('0xa5')]();}return this[_0x9ec3('0xa1')](_0x537330);};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xa6')]=function(_0x4c7054,_0x3eec3e){var _0x50980d=this[_0x9ec3('0xd')][_0x9ec3('0xa4')](_0x4c7054);if(_0x50980d['result']===-0x1){return _0x50980d;}logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x3eec3e,_0x50980d['extra']));return this[_0x9ec3('0xd')][_0x9ec3('0xa0')](_0x3eec3e,_0x50980d['extra']);};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x86')]=function(_0x16bdf1){return _0x16bdf1&&_0x16bdf1!=='0'&&_0x16bdf1!=='-1'&&_0x16bdf1!=='';};AGIVertices[_0x9ec3('0x10')]['maxRetry']=function(_0x158a3a){this['createSquareDetailsReport'][_0x9ec3('0xa7')](this,_0x158a3a,'-');_0x158a3a[_0x9ec3('0xa8')]=_0x158a3a[_0x9ec3('0xa9')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x9ec3('0x10')]['mrcpsynth']=function(_0x12ccca){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0xaa'),_0x12ccca[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x12ccca[_0x9ec3('0x5c')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0xac'));}var _0x2ab6b1='\x22'+_0x12ccca[_0x9ec3('0x5c')]+'\x22';if(this[_0x9ec3('0x86')](_0x12ccca[_0x9ec3('0x79')])){_0x2ab6b1+=','+_0x12ccca[_0x9ec3('0x79')];}var _0x1fc8e5=this['channel'][_0x9ec3('0x57')](_0x9ec3('0xad'),_0x2ab6b1);if(_0x1fc8e5[_0x9ec3('0xae')]===-0x1){return _0x1fc8e5;}return this[_0x9ec3('0xd')][_0x9ec3('0xab')](util['format'](_0x9ec3('0xaf'),_0x2ab6b1));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xb0')]=function(_0x226558){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0xb1'),_0x226558['label']));if(!this[_0x9ec3('0x86')](_0x226558['grammar'])){return this[_0x9ec3('0xd')]['noop'](_0x9ec3('0xb2'));}var _0x29b75e=_0x226558[_0x9ec3('0xb3')];if(this[_0x9ec3('0x86')](_0x226558[_0x9ec3('0x79')])){_0x29b75e+=','+_0x226558[_0x9ec3('0x79')];}var _0x26665b=this['channel'][_0x9ec3('0x57')](_0x9ec3('0xb4'),_0x29b75e);if(_0x26665b[_0x9ec3('0xae')]===-0x1){return _0x26665b;}var _0x25d32e=this[_0x9ec3('0xa6')](_0x9ec3('0xb5'),_0x9ec3('0xb6'));if(_0x25d32e[_0x9ec3('0xae')]===-0x1){return _0x25d32e;}var _0xff2974=this[_0x9ec3('0xa6')](_0x9ec3('0xb7'),_0x9ec3('0xb8'));if(_0xff2974[_0x9ec3('0xae')]===-0x1){return _0xff2974;}var _0x4bcaee=this[_0x9ec3('0xa6')](_0x9ec3('0xb9'),_0x9ec3('0xba'));if(_0x4bcaee[_0x9ec3('0xae')]===-0x1){return _0x4bcaee;}return this['channel'][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0xbb'),_0x29b75e));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x8')]=function(_0x26db44){logger['info'](util[_0x9ec3('0x54')](_0x9ec3('0xbc'),_0x26db44[_0x9ec3('0x36')]));return this['channel']['agi']([_0x26db44[_0x9ec3('0xbd')],_0x26db44[_0x9ec3('0xbe')]]);};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xbf')]=function(_0xf7e31e){logger['info'](util[_0x9ec3('0x54')](_0x9ec3('0xc0'),_0xf7e31e[_0x9ec3('0x36')]));if(this[_0x9ec3('0x86')](_0xf7e31e[_0x9ec3('0x66')])){logger[_0x9ec3('0x2d')](util['format'](_0x9ec3('0xc1'),_0xf7e31e['timeout']));var _0x2f7884=this[_0x9ec3('0xd')][_0x9ec3('0xc2')](_0xf7e31e['timeout']);if(_0x2f7884[_0x9ec3('0xae')]===-0x1){return _0x2f7884;}}return this[_0x9ec3('0xd')][_0x9ec3('0xbf')]();};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xc3')]=function(_0x56943b){logger[_0x9ec3('0x2d')](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x56943b[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x56943b[_0x9ec3('0x49')])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x56943b,_0x9ec3('0xc4'));}_0x56943b[_0x9ec3('0x4b')]=moment();if(this[_0x9ec3('0x86')](_0x56943b[_0x9ec3('0xc5')])){_0x56943b[_0x9ec3('0x4b')]=moment()[_0x9ec3('0xc6')](_0x56943b[_0x9ec3('0xc5')],_0x9ec3('0xc7'));}if(!this[_0x9ec3('0x86')](_0x56943b[_0x9ec3('0x4c')])){_0x56943b['callback_priority']=0x2;}this['createCmContact'][_0x9ec3('0xa7')](this,_0x56943b);return this[_0x9ec3('0xd')][_0x9ec3('0xab')](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x56943b[_0x9ec3('0x48')],_0x56943b[_0x9ec3('0x49')],_0x56943b[_0x9ec3('0x4b')]));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xc8')]=function(_0x4a838f){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0xc9'),_0x4a838f[_0x9ec3('0x36')]));var _0x141034=this[_0x9ec3('0xd')][_0x9ec3('0x57')](_0x4a838f[_0x9ec3('0xca')],_0x4a838f[_0x9ec3('0x79')]);if(_0x141034[_0x9ec3('0xae')]===-0x1){return _0x141034;}return this['channel'][_0x9ec3('0xab')](util[_0x9ec3('0x54')]('Executed\x20command\x20%s\x20%s',_0x4a838f['application'],_0x4a838f[_0x9ec3('0x79')]));};AGIVertices[_0x9ec3('0x10')]['lumenvoxtts']=function(_0x5ae9a9){logger[_0x9ec3('0x2d')](util['format']('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x5ae9a9[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x5ae9a9[_0x9ec3('0x5c')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')]('no\x20text\x20configured');}var _0x13ed62='\x22'+_0x5ae9a9[_0x9ec3('0x5c')]+'\x22';if(this[_0x9ec3('0x86')](_0x5ae9a9['options'])){_0x13ed62+=','+_0x5ae9a9[_0x9ec3('0x79')];}var _0x44d37d=this[_0x9ec3('0xd')][_0x9ec3('0x57')]('MRCPSynth',_0x13ed62);if(_0x44d37d['result']===-0x1){return _0x44d37d;}return this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0xaf'),_0x13ed62));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xcb')]=function(_0xa500f5){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0xcc'),_0xa500f5[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0xa500f5['text'])){return this[_0x9ec3('0xd')]['noop']('no\x20text\x20configured');}var _0x145895='\x22'+_0xa500f5[_0x9ec3('0x5c')]+'\x22';if(this[_0x9ec3('0x86')](_0xa500f5[_0x9ec3('0x79')])){_0x145895+=','+_0xa500f5['options'];}var _0x1ea438=this[_0x9ec3('0xd')]['exec']('MRCPSynth',_0x145895);if(_0x1ea438[_0x9ec3('0xae')]===-0x1){return _0x1ea438;}return this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')]('Executed\x20command\x20MRCPSynth\x20%s',_0x145895));};AGIVertices[_0x9ec3('0x10')]['lumenvoxasr']=function(_0x29e6cd){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0xcd'),_0x29e6cd['label']));if(!this[_0x9ec3('0x86')](_0x29e6cd[_0x9ec3('0xb3')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0xb2'));}var _0x27f467=_0x29e6cd[_0x9ec3('0xb3')];if(this[_0x9ec3('0x86')](_0x29e6cd[_0x9ec3('0x79')])){_0x27f467+=','+_0x29e6cd[_0x9ec3('0x79')];}var _0x482df8=this['channel'][_0x9ec3('0x57')](_0x9ec3('0xb4'),_0x27f467);if(_0x482df8[_0x9ec3('0xae')]===-0x1){return _0x482df8;}var _0x2d3033=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x9ec3('0xce'));if(_0x2d3033[_0x9ec3('0xae')]===-0x1){return _0x2d3033;}var _0x14b172=this['getAndSetVariable'](_0x9ec3('0xb7'),_0x9ec3('0xcf'));if(_0x14b172[_0x9ec3('0xae')]===-0x1){return _0x14b172;}var _0x55039d=this[_0x9ec3('0xa6')](_0x9ec3('0xb9'),'LUMENVOX_ASR_INSTANCE');if(_0x55039d['result']===-0x1){return _0x55039d;}return this['channel'][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0xbb'),_0x27f467));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xd0')]=function(_0x4c8c59){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0xd1'),_0x4c8c59[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x4c8c59[_0x9ec3('0xb3')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0xb2'));}var _0x465257=_0x4c8c59[_0x9ec3('0xb3')];if(this[_0x9ec3('0x86')](_0x4c8c59[_0x9ec3('0x79')])){_0x465257+=','+_0x4c8c59[_0x9ec3('0x79')];}var _0x40a753=this[_0x9ec3('0xd')][_0x9ec3('0x57')](_0x9ec3('0xb4'),_0x465257);if(_0x40a753[_0x9ec3('0xae')]===-0x1){return _0x40a753;}var _0x3b3d76=this[_0x9ec3('0xa6')](_0x9ec3('0xb5'),_0x9ec3('0xd2'));if(_0x3b3d76[_0x9ec3('0xae')]===-0x1){return _0x3b3d76;}var _0x59aa74=this['getAndSetVariable'](_0x9ec3('0xb7'),'SESTEK_ASR_TRANSCRIPT');if(_0x59aa74[_0x9ec3('0xae')]===-0x1){return _0x59aa74;}var _0x5e30f8=this[_0x9ec3('0xa6')]('RECOG_INSTANCE()',_0x9ec3('0xd3'));if(_0x5e30f8['result']===-0x1){return _0x5e30f8;}return this['channel'][_0x9ec3('0xab')](util[_0x9ec3('0x54')]('Executed\x20command\x20MRCPRecog\x20%s',_0x465257));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xd4')]=function(_0x12eab9){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0xd5'),_0x12eab9[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x12eab9[_0x9ec3('0xd6')])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x12eab9,_0x9ec3('0xd7'));}var _0x1b6720=this[_0x9ec3('0xd8')][_0x9ec3('0xa7')](this,_0x12eab9[_0x9ec3('0xd6')]);if(!_0x1b6720){return this['channel'][_0x9ec3('0x2b')](_0x12eab9,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0x12eab9[_0x9ec3('0x2f')])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x12eab9,'no\x20query\x20configured');}var _0x22e517=_0x12eab9[_0x9ec3('0x2f')][_0x9ec3('0x58')](/(\r\n|\n|\r)/gm,'\x20');this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0xd9'),_0x22e517));var _0x57313b=this[_0x9ec3('0xda')][_0x9ec3('0xa7')](this,_0x1b6720,_0x22e517);this[_0x9ec3('0xdb')][_0x9ec3('0xa7')](this,_0x12eab9,_0x22e517);if(!this[_0x9ec3('0x86')](_0x12eab9[_0x9ec3('0xdc')])){return this[_0x9ec3('0xd')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2ecb7c=this[_0x9ec3('0xa4')]['sync'](this,_0x12eab9[_0x9ec3('0xdc')]);if(!_0x2ecb7c){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x12eab9,'no\x20variable\x20found');}var _0x121331=this;_0x57313b[_0x9ec3('0xdd')](function(_0x252d62,_0x48abe0){Object['keys'](_0x252d62)[_0x9ec3('0xdd')](function(_0x1e1165){_0x121331[_0x9ec3('0xd')]['setVariable'](util['format'](_0x9ec3('0xde'),_0x2ecb7c,_0x48abe0,_0x1e1165),_0x252d62[_0x1e1165]);});});this['channel'][_0x9ec3('0xa0')](util[_0x9ec3('0x54')]('%s_ROWS_COUNT',_0x2ecb7c),_0x57313b[_0x9ec3('0x9d')]);return this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')]('variable\x20%s\x20set',_0x2ecb7c));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xdf')]=function(_0x379199){logger[_0x9ec3('0xe0')](util[_0x9ec3('0x54')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x379199['label']));if(!this[_0x9ec3('0x86')](_0x379199[_0x9ec3('0xe1')])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x379199,_0x9ec3('0xe2'));}var _0x3090e9=this[_0x9ec3('0x19')][_0x9ec3('0xa7')](this,_0x379199['sip_id']);if(!_0x3090e9){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x379199,_0x9ec3('0xe3'));}var _0x2e65cf=this[_0x9ec3('0xd')][_0x9ec3('0x57')]('DIAL',[util[_0x9ec3('0x54')](_0x9ec3('0xe4'),_0x3090e9),_0x379199[_0x9ec3('0x66')],_0x379199[_0x9ec3('0xe5')],_0x379199[_0x9ec3('0x64')]]);if(_0x2e65cf[_0x9ec3('0xae')]===-0x1){return _0x2e65cf;}return this[_0x9ec3('0xd')]['noop'](util[_0x9ec3('0x54')](_0x9ec3('0xe6'),_0x9ec3('0xe7')));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xe8')]=function(_0xd10e34){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0xe9'),_0xd10e34['label']));if(!this[_0x9ec3('0x86')](_0xd10e34[_0x9ec3('0x7b')])){return this[_0x9ec3('0xd')]['noop']('no\x20key\x20configured');}if(!this[_0x9ec3('0x86')](_0xd10e34[_0x9ec3('0x5c')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0xac'));}this[_0x9ec3('0xd')][_0x9ec3('0xea')]=!![];this[_0x9ec3('0xdb')](_0xd10e34);this[_0x9ec3('0x41')](_0xd10e34[_0x9ec3('0x5c')],'in','','');this['channel'][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0xeb'),_0xd10e34[_0x9ec3('0x5c')]));var _0x16ad23=this[_0x9ec3('0x7a')][_0x9ec3('0xa7')](this,_0xd10e34);if(_0x16ad23){for(var _0xebc4a in _0x16ad23){if(_0x16ad23[_0x9ec3('0x97')](_0xebc4a)){this[_0x9ec3('0xd')][_0x9ec3('0xa0')](util[_0x9ec3('0x54')]('DIALOGFLOW_%s',_0xebc4a[_0x9ec3('0x6a')]()),_0x16ad23[_0xebc4a]);}}this[_0x9ec3('0x41')](_0x16ad23[_0x9ec3('0xec')],_0x9ec3('0xed'),_0x9ec3('0xe8'),'');return this[_0x9ec3('0xd')][_0x9ec3('0xab')](util['format']('Dialogflow\x20Result\x20%s',_0x16ad23[_0x9ec3('0xec')]));}return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0xd10e34,_0x9ec3('0xee'));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xef')]=function(_0x3d6248){logger[_0x9ec3('0x2d')](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x3d6248['label']));if(!this[_0x9ec3('0x86')](_0x3d6248[_0x9ec3('0x7e')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0xf0'));}if(!this['isConfigured'](_0x3d6248[_0x9ec3('0x7f')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0xf1'));}if(!this[_0x9ec3('0x86')](_0x3d6248[_0x9ec3('0xf2')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0xf3'));}if(!this[_0x9ec3('0x86')](_0x3d6248[_0x9ec3('0x80')])){return this['channel']['noop'](_0x9ec3('0xf4'));}if(!this[_0x9ec3('0x86')](_0x3d6248[_0x9ec3('0x5c')])){return this['channel']['noop']('no\x20text\x20configured');}this[_0x9ec3('0xd')][_0x9ec3('0xea')]=!![];this[_0x9ec3('0xdb')](_0x3d6248);this[_0x9ec3('0x41')](_0x3d6248[_0x9ec3('0x5c')],'in','','');this[_0x9ec3('0xd')]['noop'](util[_0x9ec3('0x54')](_0x9ec3('0xf5'),_0x3d6248['text']));var _0x466fa3=this[_0x9ec3('0x7d')][_0x9ec3('0xa7')](this,_0x3d6248);if(_0x466fa3){for(var _0x59cefe in _0x466fa3){if(_0x466fa3[_0x9ec3('0x97')](_0x59cefe)){if(_0x59cefe!==_0x9ec3('0xf6')){this[_0x9ec3('0xd')][_0x9ec3('0xa0')](util['format'](_0x9ec3('0xf7'),_0x59cefe[_0x9ec3('0x6a')]()),_0x466fa3[_0x59cefe]);}}}this[_0x9ec3('0x41')](_0x466fa3[_0x9ec3('0xec')],_0x9ec3('0xed'),'dialogflowV2',_0x466fa3[_0x9ec3('0xf6')]);return this[_0x9ec3('0xd')]['noop'](util[_0x9ec3('0x54')]('DialogflowV2\x20Result\x20%s',_0x466fa3[_0x9ec3('0xec')]));}return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x3d6248,_0x9ec3('0xf8'));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xf9')]=function(_0x14b340){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0xfa'),_0x14b340[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x14b340[_0x9ec3('0xfb')])){return this['channel'][_0x9ec3('0xab')](_0x9ec3('0xfc'));}if(!this[_0x9ec3('0x86')](_0x14b340['username'])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0xfd'));}if(!this[_0x9ec3('0x86')](_0x14b340[_0x9ec3('0xfe')])){return this[_0x9ec3('0xd')]['noop']('no\x20password\x20configured');}if(!this[_0x9ec3('0x86')](_0x14b340[_0x9ec3('0xff')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0xac'));}this[_0x9ec3('0xd')][_0x9ec3('0xea')]=!![];this[_0x9ec3('0xdb')](_0x14b340);this[_0x9ec3('0x41')](_0x14b340['text'],'in','','');this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x100'),_0x14b340[_0x9ec3('0x5c')]));var _0x2e6b2c=this['sestekNDA'][_0x9ec3('0xa7')](this,_0x14b340);if(_0x2e6b2c){for(var _0x5ab381 in _0x2e6b2c){if(_0x2e6b2c[_0x9ec3('0x97')](_0x5ab381)){this[_0x9ec3('0xd')][_0x9ec3('0xa0')](util[_0x9ec3('0x54')]('SESTEK_NDA_%s',_0x5ab381[_0x9ec3('0x6a')]()),_0x2e6b2c[_0x5ab381]);}}this['createSquareMessage'](_0x2e6b2c['speech'],_0x9ec3('0xed'),_0x9ec3('0xf9'),'');if(_0x2e6b2c['audiofile']){this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x101'),_0x2e6b2c[_0x9ec3('0x102')]));var _0x127863=this[_0x9ec3('0xd')][_0x9ec3('0x103')](_0x2e6b2c['audiofile']);try{fs[_0x9ec3('0x104')](_0x2e6b2c[_0x9ec3('0x102')]+_0x9ec3('0x105'));}catch(_0x526195){logger[_0x9ec3('0x2b')](_0x526195);}return _0x127863;}else{return this[_0x9ec3('0xd')]['noop'](util[_0x9ec3('0x54')](_0x9ec3('0x106'),_0x2e6b2c[_0x9ec3('0xec')]));}}return this['channel'][_0x9ec3('0x2b')](_0x14b340,_0x9ec3('0x107'));};AGIVertices['prototype'][_0x9ec3('0x108')]=function(_0x13bb35){logger['info'](util[_0x9ec3('0x54')](_0x9ec3('0x109'),_0x13bb35[_0x9ec3('0x36')]));return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0x108'));};AGIVertices[_0x9ec3('0x10')]['ext_dial']=function(_0x2273f9){logger['info'](util['format'](_0x9ec3('0x10a'),_0x2273f9[_0x9ec3('0x36')]));var _0x48f931='';if(_0x2273f9[_0x9ec3('0x10b')]){if(!this[_0x9ec3('0x86')](_0x2273f9[_0x9ec3('0x10b')])){return this['channel']['error'](_0x2273f9,_0x9ec3('0x10c'));}else{var _0x3b507a=parseInt(_0x2273f9[_0x9ec3('0x10b')],0xa);if(isNaN(_0x3b507a)){_0x48f931=_0x2273f9['trunk_id'];}else{_0x48f931=this[_0x9ec3('0x1b')][_0x9ec3('0xa7')](this,_0x2273f9['trunk_id']);if(!_0x48f931){return this[_0x9ec3('0xd')]['error'](_0x2273f9,_0x9ec3('0x10d'));}}}}else if(_0x2273f9[_0x9ec3('0x10e')]){_0x48f931=_0x2273f9[_0x9ec3('0x10e')];}else{return this[_0x9ec3('0xd')]['error'](_0x2273f9,_0x9ec3('0x10c'));}var _0x4ccbc1=this['channel'][_0x9ec3('0x57')](_0x9ec3('0xe7'),[util[_0x9ec3('0x54')](_0x9ec3('0x10f'),_0x48f931,_0x2273f9[_0x9ec3('0x48')]),_0x2273f9[_0x9ec3('0x66')],_0x2273f9['opts'],_0x2273f9['url']]);if(_0x4ccbc1[_0x9ec3('0xae')]===-0x1){return _0x4ccbc1;}return this[_0x9ec3('0xd')][_0x9ec3('0xab')](util['format'](_0x9ec3('0xe6'),_0x9ec3('0xe7')));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x110')]=function(_0x467d3f){logger['info'](util[_0x9ec3('0x54')](_0x9ec3('0x111'),_0x467d3f[_0x9ec3('0x36')]));return this[_0x9ec3('0xd')][_0x9ec3('0xab')]('finally');};AGIVertices['prototype'][_0x9ec3('0xc')]=function(_0x14ad2b){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x112'),_0x14ad2b[_0x9ec3('0x36')]));if(_0x14ad2b['retry']===0x0){return this[_0x9ec3('0xa9')](_0x14ad2b);}_0x14ad2b['retry']-=0x1;if(!this['isConfigured'](_0x14ad2b[_0x9ec3('0x113')])){return this['channel'][_0x9ec3('0x2b')](_0x14ad2b,_0x9ec3('0x114'));}var _0x4f2998=this[_0x9ec3('0x1d')][_0x9ec3('0xa7')](this,_0x14ad2b['file_id']);if(!_0x4f2998){return this[_0x9ec3('0xd')]['error'](_0x14ad2b,'no\x20file\x20audio\x20found');}if(!this[_0x9ec3('0x86')](_0x14ad2b[_0x9ec3('0xdc')])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x14a34b=this[_0x9ec3('0xd')][_0x9ec3('0x115')](_0x4f2998,_0x14ad2b[_0x9ec3('0x116')],_0x14ad2b['maxdigit']);var _0x5b5284=_0x14a34b['result']?_0x14a34b[_0x9ec3('0xae')]['toString']():'';logger[_0x9ec3('0x2d')](_0x9ec3('0x117'),JSON[_0x9ec3('0x73')](_0x14a34b));if(_0x14a34b[_0x9ec3('0xae')]===-0x1){this[_0x9ec3('0xdb')][_0x9ec3('0xa7')](this,_0x14ad2b,_0x5b5284);return _0x14a34b;}else if(_0x14a34b['extra']===_0x9ec3('0x66')){_0x14a34b[_0x9ec3('0xae')]=_0x5b5284['length']>=parseInt(_0x14ad2b[_0x9ec3('0x118')])?'x':'i';}else{_0x14a34b['result']=_0x5b5284[_0x9ec3('0x9d')]>=parseInt(_0x14ad2b[_0x9ec3('0x118')])&&_0x5b5284[_0x9ec3('0x9d')]<=parseInt(_0x14ad2b['maxdigit'])?'x':'i';}var _0x56362b=this[_0x9ec3('0xa4')][_0x9ec3('0xa7')](this,_0x14ad2b[_0x9ec3('0xdc')]);if(!_0x56362b){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x14ad2b,_0x9ec3('0x119'));}this[_0x9ec3('0xd')][_0x9ec3('0xa0')](_0x56362b,_0x5b5284);if(this['isConfigured'](_0x14ad2b[_0x9ec3('0x11a')])){var _0x18f487=parseInt(_0x14ad2b[_0x9ec3('0x11a')],0xa);var _0x4b008e=rs[_0x9ec3('0x11b')]({'charset':'*','length':_0x18f487});var _0x407fca=_0x5b5284[_0x9ec3('0x9d')];if(_0x407fca>0x0){if(_0x407fca>_0x18f487){this[_0x9ec3('0xdb')][_0x9ec3('0xa7')](this,_0x14ad2b,_0x14ad2b[_0x9ec3('0x11c')]===_0x9ec3('0x11d')?_0x4b008e+_0x5b5284[_0x9ec3('0x11e')](_0x18f487):_0x5b5284[_0x9ec3('0x11e')](0x0,_0x407fca-_0x18f487)+_0x4b008e);}else{this[_0x9ec3('0xdb')]['sync'](this,_0x14ad2b,rs[_0x9ec3('0x11b')]({'charset':'*','length':_0x407fca}));}}else{this[_0x9ec3('0xdb')][_0x9ec3('0xa7')](this,_0x14ad2b,'');}}else{this[_0x9ec3('0xdb')][_0x9ec3('0xa7')](this,_0x14ad2b,_0x5b5284);}return _0x14a34b;};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x11f')]=function(_0x33ecf3){logger['info'](util['format'](_0x9ec3('0x120'),_0x33ecf3[_0x9ec3('0x36')]));return this[_0x9ec3('0xc')](_0x33ecf3);};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x121')]=function(_0x2aa113){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x122'),_0x2aa113['label']));this['createSquareDetailsReport'][_0x9ec3('0xa7')](this,_0x2aa113,_0x2aa113[_0x9ec3('0x123')]);return this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x124'),_0x2aa113[_0x9ec3('0x123')]));};AGIVertices[_0x9ec3('0x10')]['awspolly']=function(_0x40dd8e){logger['info'](util[_0x9ec3('0x54')](_0x9ec3('0x125'),_0x40dd8e['label']));if(!this['isConfigured'](_0x40dd8e[_0x9ec3('0x89')])||!this['isConfigured'](_0x40dd8e['aws_secret_access_key'])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0x126'));}if(!this[_0x9ec3('0x86')](_0x40dd8e[_0x9ec3('0x5c')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0xac'));}this['channel']['noop'](util[_0x9ec3('0x54')](_0x9ec3('0x127'),_0x40dd8e['text']));var _0x454558=this[_0x9ec3('0x88')][_0x9ec3('0xa7')](this,_0x40dd8e);if(_0x454558){this['channel'][_0x9ec3('0xab')](util['format'](_0x9ec3('0x128'),_0x454558));var _0x3ae314=this[_0x9ec3('0xd')][_0x9ec3('0x103')](_0x454558);try{fs[_0x9ec3('0x104')](_0x454558+_0x9ec3('0x105'));}catch(_0x44054f){logger[_0x9ec3('0x2b')](_0x44054f);}return _0x3ae314;}return this['channel'][_0x9ec3('0x2b')](_0x40dd8e,_0x9ec3('0x129'));};AGIVertices['prototype'][_0x9ec3('0x12a')]=function(_0x4c49a1){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x12b'),_0x4c49a1[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x4c49a1['aws_access_key_id'])||!this['isConfigured'](_0x4c49a1[_0x9ec3('0x8e')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0x126'));}if(!this[_0x9ec3('0x86')](_0x4c49a1['aws_bot_name'])){return this['channel']['noop']('no\x20bot\x20name\x20configured');}if(!this[_0x9ec3('0x86')](_0x4c49a1['text'])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0xac'));}this[_0x9ec3('0xd')]['bot']=!![];this[_0x9ec3('0xdb')](_0x4c49a1);this[_0x9ec3('0x41')](_0x4c49a1[_0x9ec3('0x5c')],'in','','');this['channel']['noop'](util[_0x9ec3('0x54')]('Trying\x20Amazon\x20Lex:\x20%s',_0x4c49a1['text']));var _0x529dc6=this[_0x9ec3('0x8d')][_0x9ec3('0xa7')](this,_0x4c49a1);if(_0x529dc6){for(var _0x15fefd in _0x529dc6){if(_0x529dc6['hasOwnProperty'](_0x15fefd)&&_[_0x9ec3('0x98')](_0x529dc6[_0x15fefd])){this[_0x9ec3('0xd')][_0x9ec3('0xa0')](util[_0x9ec3('0x54')]('AWS_LEX_%s',_0x15fefd[_0x9ec3('0x6a')]()),_0x529dc6[_0x15fefd]);}}if(_[_0x9ec3('0x44')](_0x529dc6[_0x9ec3('0x77')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0x12c'));}else{this[_0x9ec3('0x41')](_0x529dc6[_0x9ec3('0x77')],_0x9ec3('0xed'),'amazonlex','');return this[_0x9ec3('0xd')]['noop'](util[_0x9ec3('0x54')](_0x9ec3('0x12d'),_0x529dc6[_0x9ec3('0x77')]));}}return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x4c49a1,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x12e')]=function(_0x5d36db){logger[_0x9ec3('0x2d')](util['format'](_0x9ec3('0x12f'),_0x5d36db[_0x9ec3('0x36')],_0x5d36db[_0x9ec3('0x66')]));if(!this['isConfigured'](_0x5d36db['key'])){return this[_0x9ec3('0xd')]['noop'](_0x9ec3('0x130'));}var _0x38de5b=_0x9ec3('0x131');var _0x5ce27b=util['format'](_0x9ec3('0x132'),FILES_PATH,rs['generate'](0x4));var _0x106242=util[_0x9ec3('0x54')]('%s.%s',_0x5ce27b,_0x38de5b);var _0x4f245b=!![];if(_0x5d36db['beep']===_0x9ec3('0x133')){_0x4f245b=![];}var _0x36e3f1=this[_0x9ec3('0xd')][_0x9ec3('0x134')](_0x5ce27b,_0x38de5b,_0x5d36db[_0x9ec3('0x135')],_0x5d36db[_0x9ec3('0x66')],undefined,_0x4f245b);if(_0x36e3f1[_0x9ec3('0xae')]!==-0x1){this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x136'),_0x106242));var _0x21c57a=this[_0x9ec3('0x91')][_0x9ec3('0xa7')](this,_0x5d36db,_0x106242);if(_0x21c57a){for(var _0x709f6a in _0x21c57a){if(_0x21c57a[_0x9ec3('0x97')](_0x709f6a)){this[_0x9ec3('0xd')]['setVariable'](util[_0x9ec3('0x54')](_0x9ec3('0x137'),_0x709f6a[_0x9ec3('0x6a')]()),_0x21c57a[_0x709f6a]);}}return this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x138'),JSON['stringify'](_0x21c57a)));}}return _0x36e3f1;};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x139')]=function(_0x1f4663){logger[_0x9ec3('0x2d')](util['format'](_0x9ec3('0x13a'),_0x1f4663[_0x9ec3('0x36')]));if(!this['isConfigured'](_0x1f4663['appid'])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0x13b'));}if(!this[_0x9ec3('0x86')](_0x1f4663[_0x9ec3('0x94')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0x13c'));}var _0x5d18e2=_0x9ec3('0x131');var _0x3c5229=util[_0x9ec3('0x54')]('%s/recordings/%s',FILES_PATH,rs[_0x9ec3('0x11b')](0x4));var _0x19f06a=util[_0x9ec3('0x54')](_0x9ec3('0x9f'),_0x3c5229,_0x5d18e2);var _0x52fc43=!![];if(_0x1f4663['beep']==='NOBEEP'){_0x52fc43=![];}var _0x564056=this[_0x9ec3('0xd')][_0x9ec3('0x134')](_0x3c5229,_0x5d18e2,_0x1f4663[_0x9ec3('0x135')],_0x1f4663['timeout'],undefined,_0x52fc43);if(_0x564056[_0x9ec3('0xae')]!==-0x1){this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x13d'),_0x19f06a));var _0x103b96=this['tildeASR'][_0x9ec3('0xa7')](this,_0x1f4663,_0x19f06a);if(_0x103b96){for(var _0x5ef8c5 in _0x103b96){if(_0x103b96[_0x9ec3('0x97')](_0x5ef8c5)){this[_0x9ec3('0xd')][_0x9ec3('0xa0')](util[_0x9ec3('0x54')](_0x9ec3('0x13e'),_0x5ef8c5[_0x9ec3('0x6a')]()),_0x103b96[_0x5ef8c5]);}}return this['channel']['noop'](util['format'](_0x9ec3('0x13f'),JSON['stringify'](_0x103b96)));}}return _0x564056;};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x140')]=function(_0x51be70){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x51be70[_0x9ec3('0x36')]));return this['channel'][_0x9ec3('0x141')](_0x51be70[_0x9ec3('0x142')],_0x51be70[_0x9ec3('0x3c')],_0x51be70[_0x9ec3('0x3d')]);};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x143')]=function(_0x51d704){logger['info'](util[_0x9ec3('0x54')](_0x9ec3('0x144'),_0x51d704[_0x9ec3('0x36')]));if(!this['isConfigured'](_0x51d704[_0x9ec3('0x145')])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x51d704,_0x9ec3('0x146'));}try{var _0x1d5792=eval(_0x51d704[_0x9ec3('0x145')])?_0x9ec3('0x147'):_0x9ec3('0x148');this[_0x9ec3('0xd')]['noop'](util['format'](_0x9ec3('0x149'),_0x51d704[_0x9ec3('0x145')],_0x1d5792));return{'code':0xc8,'result':_0x1d5792};}catch(_0x5cf6db){return{'code':0xc8,'result':_0x9ec3('0x148')};}};AGIVertices['prototype'][_0x9ec3('0x14a')]=function(_0x21d95c){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x14b'),_0x21d95c[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x21d95c['interval_id'])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x21d95c,_0x9ec3('0x14c'));}var _0x54ad8a=this[_0x9ec3('0x24')][_0x9ec3('0xa7')](this,_0x21d95c[_0x9ec3('0x14d')]);if(!_0x54ad8a){return this['channel'][_0x9ec3('0x2b')](_0x21d95c,_0x9ec3('0x14e'));}for(var _0x1e9e3e=0x0;_0x1e9e3e<_0x54ad8a[_0x9ec3('0x9d')];_0x1e9e3e+=0x1){var _0x46136a=this[_0x9ec3('0xd')]['getVariable'](util['format'](_0x9ec3('0x14f'),_0x54ad8a[_0x1e9e3e]));if(_0x46136a[_0x9ec3('0xae')]===-0x1){return _0x46136a;}logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x150'),_0x54ad8a[_0x1e9e3e],_0x46136a[_0x9ec3('0x151')]));if(_0x46136a['extra']==='true'){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x150'),_0x54ad8a[_0x1e9e3e],_0x9ec3('0x147')));this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x150'),_0x54ad8a[_0x1e9e3e],_0x9ec3('0x147')));return{'code':0xc8,'result':_0x9ec3('0x147')};}else{logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x150'),_0x54ad8a[_0x1e9e3e],_0x9ec3('0x148')));this['channel'][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x150'),_0x54ad8a[_0x1e9e3e],'false'));}}return{'code':0xc8,'result':_0x9ec3('0x148')};};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x152')]=function(_0x5ddb5f){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x153'),_0x5ddb5f[_0x9ec3('0x36')]));return this[_0x9ec3('0xd')][_0x9ec3('0x152')]();};AGIVertices['prototype'][_0x9ec3('0x154')]=function(_0x54b848){logger['info'](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x54b848[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x54b848[_0x9ec3('0x7b')])){return this['channel'][_0x9ec3('0xab')]('no\x20key\x20configured');}var _0x33347a=_0x9ec3('0x131');var _0x10aeae=util[_0x9ec3('0x54')](_0x9ec3('0x132'),FILES_PATH,rs['generate'](0x4));var _0x1ea25f=util[_0x9ec3('0x54')](_0x9ec3('0x9f'),_0x10aeae,_0x33347a);var _0x21d022=!![];if(_0x54b848[_0x9ec3('0x155')]===_0x9ec3('0x133')){_0x21d022=![];}var _0x36d3ea=this['channel'][_0x9ec3('0x134')](_0x10aeae,_0x33347a,_0x54b848[_0x9ec3('0x135')],_0x54b848[_0x9ec3('0x66')],undefined,_0x21d022);if(_0x36d3ea[_0x9ec3('0xae')]!==-0x1){this['channel'][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x156'),_0x1ea25f));var _0x41dbcc=this[_0x9ec3('0x84')]['sync'](this,_0x54b848,_0x1ea25f);if(_0x41dbcc){for(var _0x20dc08 in _0x41dbcc){if(_0x41dbcc[_0x9ec3('0x97')](_0x20dc08)){this[_0x9ec3('0xd')][_0x9ec3('0xa0')](util[_0x9ec3('0x54')](_0x9ec3('0x157'),_0x20dc08[_0x9ec3('0x6a')]()),_0x41dbcc[_0x20dc08]);}}return this['channel'][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x158'),JSON['stringify'](_0x41dbcc)));}}return _0x36d3ea;};AGIVertices['prototype'][_0x9ec3('0x159')]=function(_0x541fd1){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x541fd1[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x541fd1[_0x9ec3('0x7b')])){return this['channel'][_0x9ec3('0xab')]('no\x20key\x20configured');}if(!this[_0x9ec3('0x86')](_0x541fd1['text'])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0xac'));}this[_0x9ec3('0xd')]['noop'](util[_0x9ec3('0x54')](_0x9ec3('0x15a'),_0x541fd1[_0x9ec3('0x5c')]));var _0x40f10b=this['ispeechTTS'][_0x9ec3('0xa7')](this,_0x541fd1);if(_0x40f10b){this['channel']['noop'](util[_0x9ec3('0x54')](_0x9ec3('0x156'),_0x40f10b));var _0x4c185b=this['channel']['streamFile'](_0x40f10b,_0x541fd1[_0x9ec3('0x135')]);try{fs[_0x9ec3('0x104')](_0x40f10b+_0x9ec3('0x105'));}catch(_0x21eaa8){logger[_0x9ec3('0x2b')](_0x21eaa8);}return _0x4c185b;}return this[_0x9ec3('0xd')]['error'](_0x541fd1,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x15b')]=function(_0x489958){logger[_0x9ec3('0x2d')](util['format'](_0x9ec3('0x15c'),_0x489958[_0x9ec3('0x36')]));if(!this['isConfigured'](_0x489958[_0x9ec3('0x15d')])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x489958,_0x9ec3('0x15e'));}logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x9ec3('0xd')][_0x9ec3('0x39')],_0x489958[_0x9ec3('0x15d')]));var _0x137d02=this[_0x9ec3('0x52')][_0x9ec3('0xa7')](this,_0x489958[_0x9ec3('0x15d')]);if(_0x137d02){logger[_0x9ec3('0x2d')](util['format'](_0x9ec3('0x15f'),this['channel'][_0x9ec3('0x39')],_0x489958[_0x9ec3('0x15d')]));this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x15f'),this['channel'][_0x9ec3('0x39')],_0x489958[_0x9ec3('0x15d')]));return{'code':0xc8,'result':'success'};}else{logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x160'),this[_0x9ec3('0xd')]['callerid'],_0x489958[_0x9ec3('0x15d')]));this[_0x9ec3('0xd')]['noop'](util[_0x9ec3('0x54')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x9ec3('0xd')][_0x9ec3('0x39')],_0x489958[_0x9ec3('0x15d')]));return{'code':0xc8,'result':_0x9ec3('0x161')};}};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x162')]=function(_0x597476){logger[_0x9ec3('0x2d')](util['format'](_0x9ec3('0x163'),_0x597476['label']));if(!this['isConfigured'](_0x597476[_0x9ec3('0x15d')])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x597476,'no\x20find\x20by\x20configured');}logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x164'),this[_0x9ec3('0xd')][_0x9ec3('0x39')],_0x597476[_0x9ec3('0x15d')]));var _0xc18e08=this[_0x9ec3('0x51')][_0x9ec3('0xa7')](this,_0x597476['findBy']);if(_0xc18e08){logger['info'](util[_0x9ec3('0x54')](_0x9ec3('0x15f'),this[_0x9ec3('0xd')][_0x9ec3('0x39')],_0x597476['findBy']));this['channel']['noop'](util[_0x9ec3('0x54')](_0x9ec3('0x15f'),this['channel'][_0x9ec3('0x39')],_0x597476[_0x9ec3('0x15d')]));return{'code':0xc8,'result':_0x9ec3('0x165')};}else{logger['info'](util[_0x9ec3('0x54')](_0x9ec3('0x160'),this[_0x9ec3('0xd')][_0x9ec3('0x39')],_0x597476[_0x9ec3('0x15d')]));this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x9ec3('0xd')][_0x9ec3('0x39')],_0x597476[_0x9ec3('0x15d')]));return{'code':0xc8,'result':_0x9ec3('0x161')};}};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x166')]=function(_0x5ae8fc){logger['info'](util[_0x9ec3('0x54')]('Enter\x20in\x20MATH\x20(%s)\x20block',_0x5ae8fc[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x5ae8fc['operation'])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x5ae8fc,'no\x20operation\x20configured');}this[_0x9ec3('0xd')][_0x9ec3('0xab')](util['format'](_0x9ec3('0x167'),_0x5ae8fc[_0x9ec3('0x168')]));var _0x417a73=eval(_0x5ae8fc[_0x9ec3('0x168')]);if(!this[_0x9ec3('0x86')](_0x5ae8fc[_0x9ec3('0xdc')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0x169'));}var _0x568065=this[_0x9ec3('0xa4')][_0x9ec3('0xa7')](this,_0x5ae8fc[_0x9ec3('0xdc')]);if(!_0x568065){return this[_0x9ec3('0xd')]['error'](_0x5ae8fc,_0x9ec3('0x119'));}if(_[_0x9ec3('0x9c')](_0x417a73)){var _0x301159=this;_0x417a73[_0x9ec3('0xdd')](function(_0x1fbce6,_0x1af158){_0x301159[_0x9ec3('0xd')][_0x9ec3('0xa0')](util['format'](_0x9ec3('0x16a'),_0x568065,_0x1af158),_0x1fbce6);});return this['channel'][_0x9ec3('0xab')](util[_0x9ec3('0x54')]('variable\x20%s[key]\x20set',_0x568065));}else{return this[_0x9ec3('0xd')][_0x9ec3('0xa0')](_0x568065,_0x417a73);}};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xb')]=function(_0x56dd18){logger['info'](util[_0x9ec3('0x54')](_0x9ec3('0x16b'),_0x56dd18[_0x9ec3('0x36')]));if(_0x56dd18[_0x9ec3('0xa8')]===0x0){return this[_0x9ec3('0xa9')](_0x56dd18);}_0x56dd18[_0x9ec3('0xa8')]-=0x1;if(!this[_0x9ec3('0x86')](_0x56dd18['file_id'])){return this[_0x9ec3('0xd')]['error'](_0x56dd18,_0x9ec3('0x114'));}var _0x379aed=this['getSound'][_0x9ec3('0xa7')](this,_0x56dd18['file_id']);if(!_0x379aed){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x56dd18,_0x9ec3('0x16c'));}var _0x1aaf8c=this['channel'][_0x9ec3('0x115')](_0x379aed,_0x56dd18['response'],_0x56dd18[_0x9ec3('0x16d')]);var _0x53f208=_0x1aaf8c['result'];if(_0x1aaf8c[_0x9ec3('0xae')]===-0x1){this[_0x9ec3('0xdb')][_0x9ec3('0xa7')](this,_0x56dd18,'-1');return _0x1aaf8c;}else if(_0x1aaf8c[_0x9ec3('0x151')]===_0x9ec3('0x66')){_0x1aaf8c[_0x9ec3('0xae')]=_0x1aaf8c[_0x9ec3('0xae')][_0x9ec3('0x9d')]>0x0?_0x1aaf8c[_0x9ec3('0xae')]:'t';}else if(_[_0x9ec3('0x43')](_0x1aaf8c[_0x9ec3('0xae')])){_0x1aaf8c[_0x9ec3('0xae')]='#';_0x53f208='#';}if(!this['isConfigured'](_0x56dd18[_0x9ec3('0xdc')])){this['channel'][_0x9ec3('0xab')]('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x443a3b=this[_0x9ec3('0xa4')][_0x9ec3('0xa7')](this,_0x56dd18['variable_id']);if(!_0x443a3b){return this['channel'][_0x9ec3('0x2b')](_0x56dd18,_0x9ec3('0x119'));}this[_0x9ec3('0xd')][_0x9ec3('0xa0')](_0x443a3b,_0x53f208);}this['createSquareDetailsReport'][_0x9ec3('0xa7')](this,_0x56dd18,_0x53f208);return _0x1aaf8c;};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0xab')]=function(_0x3fa738){logger[_0x9ec3('0x2d')](util['format'](_0x9ec3('0x16e'),_0x3fa738[_0x9ec3('0x36')]));return this[_0x9ec3('0xd')]['noop'](_0x3fa738[_0x9ec3('0x16f')]||_0x3fa738[_0x9ec3('0x36')]);};AGIVertices[_0x9ec3('0x10')]['pause']=function(_0x4a47a9){logger['info'](util[_0x9ec3('0x54')](_0x9ec3('0x170'),_0x4a47a9[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x4a47a9['findBy'])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x4a47a9,_0x9ec3('0x15e'));}logger['info'](util[_0x9ec3('0x54')](_0x9ec3('0x164'),this[_0x9ec3('0xd')][_0x9ec3('0x39')],_0x4a47a9[_0x9ec3('0x15d')]));var _0x43e876=this[_0x9ec3('0x4d')]['sync'](this,_0x4a47a9[_0x9ec3('0x171')]);var _0x782c27=this[_0x9ec3('0x4e')][_0x9ec3('0xa7')](this,_0x4a47a9[_0x9ec3('0x15d')],_0x43e876);if(_0x782c27){logger[_0x9ec3('0x2d')](util['format'](_0x9ec3('0x15f'),this[_0x9ec3('0xd')]['callerid'],_0x4a47a9[_0x9ec3('0x15d')]));this['channel'][_0x9ec3('0xab')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x9ec3('0xd')][_0x9ec3('0x39')],_0x4a47a9[_0x9ec3('0x15d')]));return{'code':0xc8,'result':'success'};}else{logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x160'),this[_0x9ec3('0xd')]['callerid'],_0x4a47a9[_0x9ec3('0x15d')]));this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x15f'),this[_0x9ec3('0xd')][_0x9ec3('0x39')],_0x4a47a9[_0x9ec3('0x15d')]));return{'code':0xc8,'result':_0x9ec3('0x161')};}};AGIVertices['prototype'][_0x9ec3('0x172')]=function(_0x5c2973){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x173'),_0x5c2973[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x5c2973[_0x9ec3('0x113')])){return this['channel'][_0x9ec3('0x2b')](_0x5c2973,_0x9ec3('0x114'));}var _0x5e535c=this[_0x9ec3('0x1d')][_0x9ec3('0xa7')](this,_0x5c2973['file_id']);if(!_0x5e535c){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x5c2973,'no\x20file\x20audio\x20found');}var _0x2b2c24=this[_0x9ec3('0xd')][_0x9ec3('0x57')](_0x9ec3('0x174'),[_0x5e535c,_0x5c2973[_0x9ec3('0xe5')]]);if(_0x2b2c24['result']===-0x1){return _0x2b2c24;}return this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x175'),_0x9ec3('0x174'),_0x5e535c));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x176')]=function(_0x53f036){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x177'),_0x53f036[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x53f036[_0x9ec3('0x178')])){return this[_0x9ec3('0xd')]['error'](_0x53f036,_0x9ec3('0x179'));}var _0x5c1b38='';var _0x4a4ede=parseInt(_0x53f036[_0x9ec3('0x178')],0xa);if(isNaN(_0x4a4ede)){_0x5c1b38=_0x53f036['queue_id'];}else{_0x5c1b38=this['getVoiceQueue'][_0x9ec3('0xa7')](this,_0x53f036[_0x9ec3('0x178')]);if(!_0x5c1b38){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x53f036,_0x9ec3('0x17a'));}}var _0x1990c5='';if(this[_0x9ec3('0x86')](_0x53f036[_0x9ec3('0x113')])){var _0x30a67c=this['getSound'][_0x9ec3('0xa7')](this,_0x53f036[_0x9ec3('0x113')]);if(_0x30a67c){_0x1990c5=_0x30a67c;}}this[_0x9ec3('0xdb')][_0x9ec3('0xa7')](this,_0x53f036,_0x5c1b38);if(_0x53f036[_0x9ec3('0xe5')][_0x9ec3('0x17b')]('x')<0x0){_0x53f036[_0x9ec3('0xe5')]+='x';}if(_0x53f036['opts'][_0x9ec3('0x17b')]('X')<0x0){_0x53f036[_0x9ec3('0xe5')]+='X';}this[_0x9ec3('0xd')][_0x9ec3('0xa0')]('XMCS-QUEUE',_0x5c1b38?_0x5c1b38[_0x9ec3('0x17c')]():'');var _0x2b4869=this[_0x9ec3('0xd')][_0x9ec3('0x57')](_0x9ec3('0x17d'),[_0x5c1b38,_0x53f036[_0x9ec3('0xe5')],_0x53f036['url'],_0x1990c5,_0x53f036[_0x9ec3('0x66')],_0x53f036[_0x9ec3('0x8')],_0x53f036[_0x9ec3('0x17e')],_0x53f036[_0x9ec3('0x17f')],'',_0x53f036[_0x9ec3('0x180')]]);if(_0x2b4869['result']===-0x1){return _0x2b4869;}return this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x175'),'QUEUE',_0x5c1b38));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x181')]=function(_0x24c50e){logger['info'](util['format'](_0x9ec3('0x182'),_0x24c50e[_0x9ec3('0x36')]));var _0x5cc028=_0x24c50e[_0x9ec3('0x183')]||_0x9ec3('0x131');var _0x195eb6=util[_0x9ec3('0x54')](_0x9ec3('0x184'),this[_0x9ec3('0xd')][_0x9ec3('0x50')],rs[_0x9ec3('0x11b')](0x5));var _0x538a2b=util[_0x9ec3('0x54')](_0x9ec3('0x185'),FILES_PATH,_0x195eb6,_0x5cc028);var _0x11978d=util[_0x9ec3('0x54')]('%s/recordings/%s',FILES_PATH,_0x195eb6);this[_0x9ec3('0x3a')][_0x9ec3('0xa7')](this,_0x24c50e,_0x195eb6,_0x538a2b);this[_0x9ec3('0xd')][_0x9ec3('0xa0')](_0x9ec3('0x186'),_0x195eb6);logger[_0x9ec3('0x2d')]('Recording\x20%s\x20%s\x20%s\x20%s',_0x11978d,_0x5cc028,_0x24c50e[_0x9ec3('0x187')],_0x24c50e[_0x9ec3('0x66')]);return this['channel'][_0x9ec3('0x134')](_0x11978d,_0x5cc028,_0x24c50e[_0x9ec3('0x187')],_0x24c50e['timeout'],undefined,!![]);};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x188')]=function(_0x15d92d){logger[_0x9ec3('0x2d')](util['format'](_0x9ec3('0x189'),_0x15d92d[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x15d92d[_0x9ec3('0x64')])){return this[_0x9ec3('0xd')]['noop'](_0x9ec3('0x18a'));}var _0xe067d9=this['restAPI'][_0x9ec3('0xa7')](this,_0x15d92d);logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')]('Response:',util['inspect'](_0xe067d9,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x15d92d[_0x9ec3('0xdc')])){return this[_0x9ec3('0xd')]['noop'](_0x9ec3('0x18b'));}var _0x46173b=this[_0x9ec3('0xa4')][_0x9ec3('0xa7')](this,_0x15d92d[_0x9ec3('0xdc')]);if(!_0x46173b){return this['channel'][_0x9ec3('0x2b')](_0x15d92d,_0x9ec3('0x119'));}this[_0x9ec3('0xd')]['setVariable'](util[_0x9ec3('0x54')](_0x9ec3('0x18c'),_0x46173b),_0xe067d9[_0x9ec3('0x76')]?_0xe067d9[_0x9ec3('0x76')]:_0x9ec3('0x18d'));this[_0x9ec3('0xd')][_0x9ec3('0xa0')](util[_0x9ec3('0x54')](_0x9ec3('0x18e'),_0x46173b),_0xe067d9[_0x9ec3('0x18f')]?_0xe067d9['statusMessage']:'OK');if(_0xe067d9[_0x9ec3('0x74')]){try{this[_0x9ec3('0x9e')](_0xe067d9['body'],_0x46173b);}catch(_0x4a1d8c){logger[_0x9ec3('0x2b')](util['format']('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x46173b));}}return this[_0x9ec3('0xd')]['noop'](util[_0x9ec3('0x54')](_0x9ec3('0x190'),_0x46173b));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x191')]=function(_0x1f30ec){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x192'),_0x1f30ec[_0x9ec3('0x36')]));return this[_0x9ec3('0xd')]['sayDigits'](_0x1f30ec[_0x9ec3('0x193')][_0x9ec3('0x58')](/\s+/g,''),_0x1f30ec['escape_digits']);};AGIVertices['prototype'][_0x9ec3('0x194')]=function(_0x3aa3f0){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x195'),_0x3aa3f0['label']));return this[_0x9ec3('0xd')][_0x9ec3('0x196')](_0x3aa3f0['number']['replace'](/\s+/g,''),_0x3aa3f0['escape_digits']);};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x197')]=function(_0x11aa1a){logger['info'](util[_0x9ec3('0x54')](_0x9ec3('0x198'),_0x11aa1a[_0x9ec3('0x36')]));return this['channel'][_0x9ec3('0x199')](_0x11aa1a[_0x9ec3('0x5c')],_0x11aa1a['escape_digits']);};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x19a')]=function(_0x27bc2d){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x27bc2d['label']));if(!this[_0x9ec3('0x86')](_0x27bc2d[_0x9ec3('0x19b')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')]('no\x20mail\x20account\x20configured');}var _0x3a2868=this[_0x9ec3('0x21')][_0x9ec3('0xa7')](this,_0x27bc2d[_0x9ec3('0x19b')]);if(!_0x3a2868||!_0x3a2868[_0x9ec3('0x19c')]){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x27bc2d,_0x9ec3('0x19d'));}var _0x3471e0={'from':util[_0x9ec3('0x54')](_0x9ec3('0x19e'),_0x3a2868['name'],_0x3a2868['email']||_0x3a2868[_0x9ec3('0x19c')][_0x9ec3('0x19f')]),'to':_0x27bc2d['to']||'','cc':_0x27bc2d['cc']||'','bcc':_0x27bc2d['bcc']||'','subject':_0x27bc2d[_0x9ec3('0x1a0')],'html':_0x27bc2d['text'],'text':_0x27bc2d[_0x9ec3('0x5c')]};if(this[_0x9ec3('0x86')](_0x27bc2d['template_id'])){}logger[_0x9ec3('0xe0')]('sendMail\x20message',JSON[_0x9ec3('0x73')](_0x3471e0));this[_0x9ec3('0xdb')][_0x9ec3('0xa7')](this,_0x27bc2d,_0x27bc2d[_0x9ec3('0x19b')]);this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x1a1'),_0x3a2868['name']));this['sendMailMessage'][_0x9ec3('0xa7')](this,_0x3a2868['smtpOptions'],_0x3471e0);return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0x1a2'));};AGIVertices[_0x9ec3('0x10')]['sendFax']=function(_0x3fa3ef){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x1a3'),_0x3fa3ef[_0x9ec3('0x36')]));return this[_0x9ec3('0xd')]['noop'](_0x9ec3('0x1a4'));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x1a5')]=function(_0x2221db){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x1a6'),_0x2221db[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x2221db['sms_account_id'])){return this['channel'][_0x9ec3('0xab')]('no\x20sms\x20account\x20configured');}var _0x13f35e=this[_0x9ec3('0x33')][_0x9ec3('0xa7')](this,_0x2221db['sms_account_id']);if(!_0x13f35e){return this['channel'][_0x9ec3('0x2b')](_0x2221db,_0x9ec3('0x1a7'));}var _0x3f149f={'body':_0x2221db[_0x9ec3('0x1a8')],'phone':_0x2221db['to']||'','SmsAccountId':_0x13f35e['id']};logger[_0x9ec3('0xe0')](_0x9ec3('0x1a9'),JSON[_0x9ec3('0x73')](_0x3f149f));this[_0x9ec3('0xdb')]['sync'](this,_0x2221db,_0x2221db['sms_account_id']);this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x1aa'),_0x13f35e[_0x9ec3('0x13')]));this[_0x9ec3('0x35')]['sync'](this,_0x3f149f);return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0x1ab'));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x1ac')]=function(_0x353a24){logger['info'](util['format'](_0x9ec3('0x1ad'),_0x353a24['label']));if(!this[_0x9ec3('0x86')](_0x353a24[_0x9ec3('0xdc')])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x353a24,'no\x20variable\x20selected');}var _0x33d41d=this[_0x9ec3('0xa4')]['sync'](this,_0x353a24[_0x9ec3('0xdc')]);if(!_0x33d41d){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x353a24,_0x9ec3('0x119'));}return this['channel'][_0x9ec3('0xa0')](_0x33d41d,_0x353a24[_0x9ec3('0x1ae')]);};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x1af')]=function(_0xddee15){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x1b0'),_0xddee15[_0x9ec3('0x36')]));this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0x1b1'));var _0x212f78=this[_0x9ec3('0xd')][_0x9ec3('0xa4')](_0x9ec3('0x1b2'));if(!_[_0x9ec3('0x43')](_0x212f78[_0x9ec3('0x151')])){this[_0x9ec3('0xd')]['uniqueid']=_0x212f78[_0x9ec3('0x151')];}if(_0xddee15['answer']===_0x9ec3('0x1b3')){this['channel'][_0x9ec3('0xab')](_0x9ec3('0x1b4'));return this[_0x9ec3('0xd')][_0x9ec3('0xbf')]();}return this[_0x9ec3('0xd')]['noop'](_0x9ec3('0x1b5'));};AGIVertices[_0x9ec3('0x10')]['subproject']=function(_0x4d918a){logger['info'](util['format'](_0x9ec3('0x1b6'),_0x4d918a[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x4d918a['project_id'])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x4d918a,_0x9ec3('0x1b7'));}var _0x510ffc=this[_0x9ec3('0x17')][_0x9ec3('0xa7')](this,_0x4d918a['project_id']);if(!this[_0x9ec3('0x86')](_0x510ffc)){return this['channel'][_0x9ec3('0x2b')](_0x4d918a,util['format'](_0x9ec3('0x1b8'),_0x4d918a[_0x9ec3('0x1b9')]));}if(_0x510ffc===this[_0x9ec3('0xd')][_0x9ec3('0x38')]){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x4d918a,_0x9ec3('0x1ba'));}this['createSquareDetailsReport'][_0x9ec3('0xa7')](this,_0x4d918a,_0x510ffc);var _0x330d3d=this[_0x9ec3('0xd')]['exec']('AGI',util[_0x9ec3('0x54')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x9ec3('0x8')]['host']||_0x9ec3('0x1bb'),_0x510ffc,this['channel']['arg_1']));if(_0x330d3d[_0x9ec3('0xae')]===-0x1){return _0x330d3d;}return this['channel']['noop'](util['format'](_0x9ec3('0x175'),'AGI',_0x510ffc));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x1bc')]=function(_0x54b21d){logger['info'](util[_0x9ec3('0x54')](_0x9ec3('0x1bd'),_0x54b21d[_0x9ec3('0x36')]));var _0x416181=this['shellCommand'][_0x9ec3('0xa7')](this,_0x54b21d[_0x9ec3('0xbd')]);this[_0x9ec3('0xdb')][_0x9ec3('0xa7')](this,_0x54b21d,_0x54b21d[_0x9ec3('0xbd')]);if(this[_0x9ec3('0x86')](_0x54b21d[_0x9ec3('0xdc')])){var _0x231289=this[_0x9ec3('0xa4')][_0x9ec3('0xa7')](this,_0x54b21d[_0x9ec3('0xdc')]);if(_0x231289){this['channel'][_0x9ec3('0xa0')](_0x231289,_0x416181);return this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x54b21d[_0x9ec3('0xbd')],_0x231289));}}return this[_0x9ec3('0xd')]['noop'](util[_0x9ec3('0x54')](_0x9ec3('0x1be'),_0x54b21d[_0x9ec3('0xbd')]));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x1bf')]=function(_0x440133){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x1c0'),_0x440133[_0x9ec3('0x36')]));_0x440133[_0x9ec3('0x5c')]=_0x440133['text'][_0x9ec3('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x9ec3('0x86')](_0x440133['apiKey'])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0x1c1'));}if(!this[_0x9ec3('0x86')](_0x440133[_0x9ec3('0x5c')])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')](_0x9ec3('0xac'));}this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x1c2'),_0x440133[_0x9ec3('0x5c')]));var _0x293723=this[_0x9ec3('0x59')][_0x9ec3('0xa7')](this,_0x440133);if(_0x293723){this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x1c3'),_0x293723));var _0x5d224a=this[_0x9ec3('0xd')][_0x9ec3('0x103')](_0x293723);try{fs['unlink'](_0x293723+_0x9ec3('0x105'));}catch(_0x5fd47f){logger[_0x9ec3('0x2b')](_0x5fd47f);}return _0x5d224a;}return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x440133,_0x9ec3('0x1c4'));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x1c5')]=function(_0x1676a1){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x1676a1[_0x9ec3('0x36')]));_0x1676a1[_0x9ec3('0x5c')]=_0x1676a1[_0x9ec3('0x5c')][_0x9ec3('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x1676a1['text'])){return this[_0x9ec3('0xd')][_0x9ec3('0xab')]('no\x20text\x20configured');}this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x1c6'),_0x1676a1[_0x9ec3('0x5c')]));var _0x2319e0=this['googleTTS'][_0x9ec3('0xa7')](this,_0x1676a1);if(_0x2319e0){this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x1c7'),_0x2319e0));var _0x3bdc82=this['channel']['streamFile'](_0x2319e0);try{fs[_0x9ec3('0x104')](_0x2319e0+_0x9ec3('0x105'));}catch(_0x2105ec){logger[_0x9ec3('0x2b')](_0x2105ec);}return _0x3bdc82;}return this[_0x9ec3('0xd')]['error'](_0x1676a1,_0x9ec3('0x1c8'));};AGIVertices[_0x9ec3('0x10')][_0x9ec3('0x1c9')]=function(_0x493194){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x493194[_0x9ec3('0x36')]));if(!this[_0x9ec3('0x86')](_0x493194[_0x9ec3('0x15d')])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x493194,_0x9ec3('0x15e'));}logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x164'),this[_0x9ec3('0xd')][_0x9ec3('0x39')],_0x493194[_0x9ec3('0x15d')]));var _0x2ba433=this[_0x9ec3('0x1ca')]['sync'](this,_0x493194[_0x9ec3('0x15d')]);if(_0x2ba433){logger['info'](util['format'](_0x9ec3('0x15f'),this[_0x9ec3('0xd')][_0x9ec3('0x39')],_0x493194[_0x9ec3('0x15d')]));this[_0x9ec3('0xd')]['noop'](util['format'](_0x9ec3('0x15f'),this['channel'][_0x9ec3('0x39')],_0x493194[_0x9ec3('0x15d')]));return{'code':0xc8,'result':_0x9ec3('0x165')};}else{logger['info'](util[_0x9ec3('0x54')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x9ec3('0xd')][_0x9ec3('0x39')],_0x493194[_0x9ec3('0x15d')]));this[_0x9ec3('0xd')]['noop'](util[_0x9ec3('0x54')](_0x9ec3('0x160'),this[_0x9ec3('0xd')][_0x9ec3('0x39')],_0x493194[_0x9ec3('0x15d')]));return{'code':0xc8,'result':_0x9ec3('0x161')};}};AGIVertices[_0x9ec3('0x10')]['voicemail']=function(_0x25b582){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')](_0x9ec3('0x1cb'),_0x25b582[_0x9ec3('0x36')]));var _0xcc4749=this[_0x9ec3('0xd')][_0x9ec3('0x57')](_0x9ec3('0x1cc'),[_0x25b582[_0x9ec3('0x1cd')],_0x25b582['options']]);if(_0xcc4749['result']===-0x1){return _0xcc4749;}return this[_0x9ec3('0xd')][_0x9ec3('0xab')](util[_0x9ec3('0x54')](_0x9ec3('0x175'),'VOICEMAIL',_0x25b582[_0x9ec3('0x1cd')]));};AGIVertices['prototype'][_0x9ec3('0x1ce')]=function(_0x14907f){logger[_0x9ec3('0x2d')](util[_0x9ec3('0x54')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x14907f[_0x9ec3('0x36')]));if(!this['isConfigured'](_0x14907f['variable_id'])){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x14907f,_0x9ec3('0x1cf'));}var _0x1f2295=this['getVariable']['sync'](this,_0x14907f['variable_id']);if(!_0x1f2295){return this[_0x9ec3('0xd')][_0x9ec3('0x2b')](_0x14907f,_0x9ec3('0x119'));}var _0x572d4f=this['channel'][_0x9ec3('0xa4')](_0x1f2295);return{'code':0xc8,'result':_0x572d4f[_0x9ec3('0x151')]?_0x572d4f[_0x9ec3('0x151')]:'-'};};String[_0x9ec3('0x10')][_0x9ec3('0xa3')]=function(_0x3b5384,_0xd42c2b){return this[_0x9ec3('0xa2')](_0x3b5384)[_0x9ec3('0x1d0')](_0xd42c2b);};module[_0x9ec3('0x1d1')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index e5e80c9..079e1ee 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 _0xce4b=['[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','deleteChannelAfterTimeout','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','all','[ACW][syncAgentRingNoAnswer]\x20%s','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','agentringnoanswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','updateAcw','lastPauseAt','timer','update','uniqueid','info','catch','error','[%s][UPDATE][ERRORS:%s]','finally','startAcw','interface','queue','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','getAgent','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','available','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','ACW','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnect]\x20%s','syncHangupRequest','isUndefined'];(function(_0x1fafa5,_0x1aa281){var _0xcf08c9=function(_0x3af1b4){while(--_0x3af1b4){_0x1fafa5['push'](_0x1fafa5['shift']());}};_0xcf08c9(++_0x1aa281);}(_0xce4b,0x1bc));var _0xbce4=function(_0x21fd94,_0x19102c){_0x21fd94=_0x21fd94-0x0;var _0x5f9c17=_0xce4b[_0x21fd94];return _0x5f9c17;};'use strict';var _=require('lodash');var moment=require('moment');var ami=require(_0xbce4('0x0'));var logger=require(_0xbce4('0x1'))(_0xbce4('0x2'));var RpcUser=require(_0xbce4('0x3'));var RpcVoiceAgentReport=require(_0xbce4('0x4'));function Acw(_0x3f0b0a){this[_0xbce4('0x5')]=_0x3f0b0a[_0xbce4('0x5')];this[_0xbce4('0x6')]=_0x3f0b0a[_0xbce4('0x6')];this[_0xbce4('0x7')]=_0x3f0b0a[_0xbce4('0x7')];this[_0xbce4('0x8')]={};ami['on'](_0xbce4('0x9'),this[_0xbce4('0xa')][_0xbce4('0xb')](this));ami['on'](_0xbce4('0xc'),this['syncHangupRequest'][_0xbce4('0xb')](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0xbce4('0xd'),this['syncAgentRingNoAnswer'][_0xbce4('0xb')](this));ami['on'](_0xbce4('0xe'),this['syncAttendedTransfer'][_0xbce4('0xb')](this));ami['on'](_0xbce4('0xf'),this[_0xbce4('0x10')][_0xbce4('0xb')](this));ami['on'](_0xbce4('0x11'),this[_0xbce4('0x12')][_0xbce4('0xb')](this));}function getDiff(_0x386c58){var _0x19b5a6=moment()[_0xbce4('0x13')](0x0);var _0x4fab98=moment(_0x386c58)['milliseconds'](0x0);return _0x19b5a6[_0xbce4('0x14')](_0x4fab98,_0xbce4('0x15'));}Acw[_0xbce4('0x16')][_0xbce4('0x17')]=function(_0x556893,_0x1b09ce){var _0x2d7ead=this;var _0x59cfab=getDiff(_0x2d7ead[_0xbce4('0x7')][_0x556893][_0xbce4('0x18')]);clearTimeout(_0x2d7ead['timers'][_0x556893][_0xbce4('0x19')]);_0x2d7ead[_0xbce4('0x7')][_0x556893]['timer']=![];return RpcVoiceAgentReport[_0xbce4('0x1a')]({'acwtime':_0x59cfab},_0x2d7ead[_0xbce4('0x7')][_0x556893][_0xbce4('0x1b')],_0x556893)['then'](function(_0x428890){logger[_0xbce4('0x1c')]('[%s][UPDATE][ACWTIME:%s]',_0x1b09ce,_0x59cfab,_0x428890);})[_0xbce4('0x1d')](function(_0x439922){logger[_0xbce4('0x1e')](_0xbce4('0x1f'),_0x1b09ce,_0x439922);})[_0xbce4('0x20')](function(){delete _0x2d7ead[_0xbce4('0x7')][_0x556893];});};Acw['prototype'][_0xbce4('0x21')]=function(_0x18a6a8){try{var _0x3d3855=this;var _0x44d11e=this[_0xbce4('0x8')][_0x18a6a8][_0xbce4('0x22')];var _0x56437b=this[_0xbce4('0x8')][_0x18a6a8][_0xbce4('0x23')];var _0x276553=this[_0xbce4('0x5')][_0x56437b];var _0xe29f89=![];var _0x4fc5c4='ACW';if(_0x276553[_0xbce4('0x24')]&&_0x276553[_0xbce4('0x25')]['name']){_0xe29f89=!![];_0x4fc5c4=_0x276553[_0xbce4('0x25')][_0xbce4('0x26')];}return ami[_0xbce4('0x27')]({'action':_0xbce4('0x28'),'interface':_0x44d11e,'paused':!![],'reason':_0x4fc5c4})[_0xbce4('0x29')](function(){if(_0x3d3855[_0xbce4('0x6')][_0x44d11e]){return RpcUser[_0xbce4('0x2a')](_0x3d3855['agents'][_0x44d11e]['id'])[_0xbce4('0x29')](function(_0x5698d5){if(!_0x5698d5||_0x5698d5[_0xbce4('0x2b')]){logger[_0xbce4('0x1c')](_0xbce4('0x2c'),_0x18a6a8,_0x44d11e,_0x56437b);return;}logger[_0xbce4('0x1c')](_0xbce4('0x2d'),_0x18a6a8,_0x44d11e,_0x56437b);var _0x18384a=_0x3d3855[_0xbce4('0x8')][_0x18a6a8][_0xbce4('0x2e')]&&_0x3d3855[_0xbce4('0x8')][_0x18a6a8][_0xbce4('0x2f')]?_0x3d3855['channels'][_0x18a6a8]['destlinkedid']:_0x18a6a8;return RpcUser[_0xbce4('0x30')](_0x3d3855['agents'][_0x44d11e],_0x4fc5c4,_0x18384a)['then'](function(_0x6fc4a7){_0x3d3855[_0xbce4('0x5')][_0x56437b][_0xbce4('0x31')]-=0x1;_0x3d3855['voiceQueues'][_0x56437b]['paused']+=0x1;return _0x6fc4a7;});})[_0xbce4('0x29')](function(_0x29b50b){if(_0xe29f89||!_0x29b50b){return;}_0x3d3855[_0xbce4('0x7')][_0x44d11e]={};logger['info'](_0xbce4('0x32'),_0x18a6a8,_0x3d3855[_0xbce4('0x5')][_0x56437b][_0xbce4('0x33')],_0x44d11e,_0x56437b);_0x3d3855[_0xbce4('0x7')][_0x44d11e][_0xbce4('0x19')]=setTimeout(_0x3d3855[_0xbce4('0x34')]['bind'](_0x3d3855,_0x44d11e),_0x3d3855[_0xbce4('0x5')][_0x56437b][_0xbce4('0x33')]*0x3e8);_0x3d3855[_0xbce4('0x7')][_0x44d11e][_0xbce4('0x18')]=moment()[_0xbce4('0x35')]('YYYY-MM-DD\x20HH:mm:ss');_0x3d3855[_0xbce4('0x7')][_0x44d11e][_0xbce4('0x1b')]=_0x18a6a8;_0x3d3855[_0xbce4('0x7')][_0x44d11e][_0xbce4('0x23')]=_0x56437b;_0x3d3855[_0xbce4('0x7')][_0x44d11e][_0xbce4('0x17')]=_0x3d3855['updateAcw']['bind'](_0x3d3855,_0x44d11e,_0x18a6a8);});}})[_0xbce4('0x1d')](function(){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x18a6a8,_0x3d3855[_0xbce4('0x5')][_0x56437b]['acwTimeout'],_0x44d11e,_0x56437b);})['finally'](function(){delete _0x3d3855[_0xbce4('0x8')][_0x18a6a8];});}catch(_0x4e433c){logger[_0xbce4('0x1e')](_0xbce4('0x36'),_0x4e433c[_0xbce4('0x37')]);}};Acw[_0xbce4('0x16')]['stopAcw']=function(_0x1cbec5){try{var _0x352f3f=this;if(_0x352f3f[_0xbce4('0x7')][_0x1cbec5]){_0x352f3f[_0xbce4('0x7')][_0x1cbec5]['timer']=![];var _0x26f512=_0x352f3f[_0xbce4('0x7')][_0x1cbec5][_0xbce4('0x1b')];var _0x3c3121=_0x352f3f[_0xbce4('0x7')][_0x1cbec5][_0xbce4('0x23')];var _0x37c7b4=_0x352f3f['voiceQueues'][_0x3c3121][_0xbce4('0x33')];logger[_0xbce4('0x1c')](_0xbce4('0x38'),_0x26f512,_0x1cbec5);RpcUser[_0xbce4('0x2a')](this[_0xbce4('0x6')][_0x1cbec5]['id'])[_0xbce4('0x29')](function(_0x204f55){if(_0x204f55['pauseType']===_0xbce4('0x39')){return RpcUser['saveUnpause'](_0x352f3f[_0xbce4('0x6')][_0x1cbec5]);}});RpcVoiceAgentReport['update']({'acwtime':_0x37c7b4,'agentacw':!![]},_0x26f512,_0x1cbec5)[_0xbce4('0x29')](function(_0x3006a){logger[_0xbce4('0x1c')](_0xbce4('0x3a'),_0x26f512,_0x37c7b4,_0x3006a);})[_0xbce4('0x1d')](function(_0x1f3bef){logger[_0xbce4('0x1e')](_0xbce4('0x1f'),_0x26f512,_0x1f3bef);});}else{logger[_0xbce4('0x1e')](_0xbce4('0x3b'),_0x1cbec5);if(_0x352f3f[_0xbce4('0x7')]){logger[_0xbce4('0x1c')](_0xbce4('0x3c'),JSON[_0xbce4('0x3d')](_0x352f3f['timers']));}}}catch(_0x55fc46){logger[_0xbce4('0x1e')](_0xbce4('0x3e'),_0x55fc46[_0xbce4('0x37')]);}};Acw[_0xbce4('0x16')]['syncAgentConnect']=function(_0x70da88){try{if(this[_0xbce4('0x5')][_0x70da88['queue']]&&(this[_0xbce4('0x5')][_0x70da88[_0xbce4('0x23')]][_0xbce4('0x2')]||this['voiceQueues'][_0x70da88[_0xbce4('0x23')]][_0xbce4('0x24')])){if(this[_0xbce4('0x6')][_0x70da88[_0xbce4('0x22')]]){this[_0xbce4('0x8')][_0x70da88[_0xbce4('0x1b')]]={'queue':_0x70da88[_0xbce4('0x23')],'interface':_0x70da88[_0xbce4('0x22')],'destlinkedid':_0x70da88['destlinkedid']};}}}catch(_0x40de34){logger[_0xbce4('0x1e')](_0xbce4('0x3f'),_0x40de34['message']);}};Acw[_0xbce4('0x16')][_0xbce4('0x12')]=function(_0x588740){try{if(this['voiceQueues'][_0x588740[_0xbce4('0x23')]]&&(this[_0xbce4('0x5')][_0x588740['queue']]['acw']||this[_0xbce4('0x5')][_0x588740[_0xbce4('0x23')]][_0xbce4('0x24')])){if(this[_0xbce4('0x6')][_0x588740[_0xbce4('0x22')]]){this[_0xbce4('0x8')][_0x588740[_0xbce4('0x1b')]]={'queue':_0x588740[_0xbce4('0x23')],'interface':_0x588740[_0xbce4('0x22')]};}}}catch(_0x277110){logger[_0xbce4('0x1e')]('[ACW][syncAgentConnectPreview]\x20%s',_0x277110[_0xbce4('0x37')]);}};Acw[_0xbce4('0x16')][_0xbce4('0x40')]=function(_0x4175ec){try{if(this['channels'][_0x4175ec[_0xbce4('0x1b')]]&&_[_0xbce4('0x41')](this[_0xbce4('0x8')][_0x4175ec['uniqueid']][_0xbce4('0x2e')])){logger[_0xbce4('0x1c')](_0xbce4('0x42'),_0x4175ec['uniqueid']);this[_0xbce4('0x21')](_0x4175ec[_0xbce4('0x1b')]);}else if(this[_0xbce4('0x8')][_0x4175ec[_0xbce4('0x43')]]&&_[_0xbce4('0x41')](this[_0xbce4('0x8')][_0x4175ec[_0xbce4('0x43')]]['attended'])){logger['info'](_0xbce4('0x44'),_0x4175ec['linkedid']);this['startAcw'](_0x4175ec[_0xbce4('0x43')]);}}catch(_0x31d43f){logger[_0xbce4('0x1e')](_0xbce4('0x45'),_0x31d43f[_0xbce4('0x37')]);}};Acw[_0xbce4('0x16')]['syncHangup']=function(_0x3a67d7){try{if(this['channels'][_0x3a67d7[_0xbce4('0x1b')]]&&this[_0xbce4('0x8')][_0x3a67d7[_0xbce4('0x1b')]][_0xbce4('0x2e')]){logger[_0xbce4('0x1c')](_0xbce4('0x46'),_0x3a67d7['uniqueid']);this['startAcw'](_0x3a67d7['uniqueid']);}else if(this['channels'][_0x3a67d7['linkedid']]&&this[_0xbce4('0x8')][_0x3a67d7['linkedid']]['attended']){logger[_0xbce4('0x1c')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x3a67d7[_0xbce4('0x43')]);this[_0xbce4('0x21')](_0x3a67d7[_0xbce4('0x43')]);}}catch(_0x3040d0){logger[_0xbce4('0x1e')]('[ACW][syncHangup]\x20%s',_0x3040d0[_0xbce4('0x37')]);}};Acw[_0xbce4('0x16')]['syncAttendedTransfer']=function(_0x7d3f16){try{if(!_[_0xbce4('0x47')](this[_0xbce4('0x8')][_0x7d3f16[_0xbce4('0x48')]])){this[_0xbce4('0x21')](_0x7d3f16[_0xbce4('0x48')]);if(this['channels'][_0x7d3f16[_0xbce4('0x49')]]){this[_0xbce4('0x8')][_0x7d3f16[_0xbce4('0x49')]]['attended']=!![];this[_0xbce4('0x8')][_0x7d3f16[_0xbce4('0x4a')]]=this[_0xbce4('0x8')][_0x7d3f16[_0xbce4('0x49')]];this[_0xbce4('0x4b')](_0x7d3f16[_0xbce4('0x49')]);}}else if(!_[_0xbce4('0x47')](this[_0xbce4('0x8')][_0x7d3f16[_0xbce4('0x4a')]])){this[_0xbce4('0x21')](_0x7d3f16[_0xbce4('0x4a')]);if(this[_0xbce4('0x8')][_0x7d3f16['origtransfereruniqueid']]){this[_0xbce4('0x8')][_0x7d3f16[_0xbce4('0x4c')]][_0xbce4('0x2e')]=!![];this[_0xbce4('0x8')][_0x7d3f16['transfereeuniqueid']]=this[_0xbce4('0x8')][_0x7d3f16[_0xbce4('0x4c')]];this['deleteChannelAfterTimeout'](_0x7d3f16[_0xbce4('0x4c')]);}}}catch(_0x4fce08){logger[_0xbce4('0x1e')](_0xbce4('0x4d'),_0x4fce08['message']);}};Acw['prototype'][_0xbce4('0x10')]=function(_0x1e1446){try{if(this[_0xbce4('0x8')][_0x1e1446[_0xbce4('0x4e')]]){logger[_0xbce4('0x1c')](_0xbce4('0x4f'),JSON[_0xbce4('0x3d')](_0x1e1446[_0xbce4('0x4e')]));this['startAcw'](_0x1e1446[_0xbce4('0x4e')]);}else if(this['channels'][_0x1e1446[_0xbce4('0x50')]]){logger[_0xbce4('0x1c')](_0xbce4('0x51'),JSON[_0xbce4('0x3d')](_0x1e1446[_0xbce4('0x50')]));this['startAcw'](_0x1e1446[_0xbce4('0x50')]);}}catch(_0x115f99){logger[_0xbce4('0x1e')]('[ACW][syncBlindTransfer]\x20%s',_0x115f99['message']);}};Acw[_0xbce4('0x16')]['syncAgentRingNoAnswer']=function(_0x1155a9){try{if(this[_0xbce4('0x5')][_0x1155a9[_0xbce4('0x23')]]&&this['voiceQueues'][_0x1155a9[_0xbce4('0x23')]][_0xbce4('0x52')]===_0xbce4('0x53')){if(this[_0xbce4('0x6')][_0x1155a9[_0xbce4('0x22')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x1155a9['uniqueid'],_0x1155a9[_0xbce4('0x22')],_0x1155a9[_0xbce4('0x23')]);return RpcUser[_0xbce4('0x30')](this[_0xbce4('0x6')][_0x1155a9[_0xbce4('0x22')]],'Auto-Pause',_0x1155a9[_0xbce4('0x1b')]);}}}catch(_0x234cb5){logger[_0xbce4('0x1e')](_0xbce4('0x54'),_0x234cb5[_0xbce4('0x37')]);}};Acw['prototype'][_0xbce4('0x4b')]=function(_0x32c146,_0x2ac849=0x2710){if(this[_0xbce4('0x8')][_0x32c146]){setTimeout(()=>{delete this['channels'][_0x32c146];},_0x2ac849);}};module['exports']=Acw; \ No newline at end of file +var _0x53ef=['uniqueid','then','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','finally','startAcw','channels','interface','ACW','mandatoryDispositionPause','name','QueuePause','voicePause','info','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','available','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','queue','updateAcw','[ACW][START]\x20%s','message','getAgent','pauseType','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','mandatoryDisposition','[ACW][syncAgentConnect]\x20%s','isUndefined','attended','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','deleteChannelAfterTimeout','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','stringify','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','../ami','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangup','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','lastPauseAt','timer','update'];(function(_0x5fa520,_0xaf0e7d){var _0x1bf6c4=function(_0x2a7440){while(--_0x2a7440){_0x5fa520['push'](_0x5fa520['shift']());}};_0x1bf6c4(++_0xaf0e7d);}(_0x53ef,0x13e));var _0xf53e=function(_0x57fa33,_0x2b8222){_0x57fa33=_0x57fa33-0x0;var _0x12e724=_0x53ef[_0x57fa33];return _0x12e724;};'use strict';var _=require(_0xf53e('0x0'));var moment=require('moment');var ami=require(_0xf53e('0x1'));var logger=require(_0xf53e('0x2'))(_0xf53e('0x3'));var RpcUser=require(_0xf53e('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x5dda47){this['voiceQueues']=_0x5dda47[_0xf53e('0x5')];this[_0xf53e('0x6')]=_0x5dda47[_0xf53e('0x6')];this[_0xf53e('0x7')]=_0x5dda47[_0xf53e('0x7')];this['channels']={};ami['on'](_0xf53e('0x8'),this[_0xf53e('0x9')][_0xf53e('0xa')](this));ami['on'](_0xf53e('0xb'),this['syncHangupRequest'][_0xf53e('0xa')](this));ami['on']('hangup',this[_0xf53e('0xc')][_0xf53e('0xa')](this));ami['on']('agentringnoanswer',this[_0xf53e('0xd')][_0xf53e('0xa')](this));ami['on'](_0xf53e('0xe'),this[_0xf53e('0xf')][_0xf53e('0xa')](this));ami['on'](_0xf53e('0x10'),this[_0xf53e('0x11')]['bind'](this));ami['on']('custom:agentConnectPreview',this[_0xf53e('0x12')][_0xf53e('0xa')](this));}function getDiff(_0x2d63f8){var _0x281411=moment()[_0xf53e('0x13')](0x0);var _0x485273=moment(_0x2d63f8)[_0xf53e('0x13')](0x0);return _0x281411[_0xf53e('0x14')](_0x485273,_0xf53e('0x15'));}Acw[_0xf53e('0x16')]['updateAcw']=function(_0x19e2fb,_0x3061a2){var _0x95f37c=this;var _0x7137a9=getDiff(_0x95f37c[_0xf53e('0x7')][_0x19e2fb][_0xf53e('0x17')]);clearTimeout(_0x95f37c[_0xf53e('0x7')][_0x19e2fb][_0xf53e('0x18')]);_0x95f37c[_0xf53e('0x7')][_0x19e2fb][_0xf53e('0x18')]=![];return RpcVoiceAgentReport[_0xf53e('0x19')]({'acwtime':_0x7137a9},_0x95f37c[_0xf53e('0x7')][_0x19e2fb][_0xf53e('0x1a')],_0x19e2fb)[_0xf53e('0x1b')](function(_0x322044){logger['info'](_0xf53e('0x1c'),_0x3061a2,_0x7137a9,_0x322044);})[_0xf53e('0x1d')](function(_0x30e922){logger[_0xf53e('0x1e')](_0xf53e('0x1f'),_0x3061a2,_0x30e922);})[_0xf53e('0x20')](function(){delete _0x95f37c[_0xf53e('0x7')][_0x19e2fb];});};Acw['prototype'][_0xf53e('0x21')]=function(_0x38cdf3){try{var _0x347d0b=this;var _0x20c454=this[_0xf53e('0x22')][_0x38cdf3][_0xf53e('0x23')];var _0x3c7ab9=this[_0xf53e('0x22')][_0x38cdf3]['queue'];var _0x4b2238=this[_0xf53e('0x5')][_0x3c7ab9];var _0x38a91e=![];var _0x14dca0=_0xf53e('0x24');if(_0x4b2238['mandatoryDisposition']&&_0x4b2238[_0xf53e('0x25')][_0xf53e('0x26')]){_0x38a91e=!![];_0x14dca0=_0x4b2238[_0xf53e('0x25')]['name'];}return ami['Action']({'action':_0xf53e('0x27'),'interface':_0x20c454,'paused':!![],'reason':_0x14dca0})['then'](function(){if(_0x347d0b['agents'][_0x20c454]){return RpcUser['getAgent'](_0x347d0b[_0xf53e('0x6')][_0x20c454]['id'])[_0xf53e('0x1b')](function(_0x3a4d01){if(!_0x3a4d01||_0x3a4d01[_0xf53e('0x28')]){logger[_0xf53e('0x29')](_0xf53e('0x2a'),_0x38cdf3,_0x20c454,_0x3c7ab9);return;}logger[_0xf53e('0x29')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x38cdf3,_0x20c454,_0x3c7ab9);var _0x4d802f=_0x347d0b[_0xf53e('0x22')][_0x38cdf3]['attended']&&_0x347d0b[_0xf53e('0x22')][_0x38cdf3]['destlinkedid']?_0x347d0b['channels'][_0x38cdf3][_0xf53e('0x2b')]:_0x38cdf3;return RpcUser[_0xf53e('0x2c')](_0x347d0b[_0xf53e('0x6')][_0x20c454],_0x14dca0,_0x4d802f)['then'](function(_0x1e25d2){_0x347d0b[_0xf53e('0x5')][_0x3c7ab9][_0xf53e('0x2d')]-=0x1;_0x347d0b['voiceQueues'][_0x3c7ab9][_0xf53e('0x2e')]+=0x1;return _0x1e25d2;});})[_0xf53e('0x1b')](function(_0x1edd95){if(_0x38a91e||!_0x1edd95){return;}_0x347d0b['timers'][_0x20c454]={};logger[_0xf53e('0x29')](_0xf53e('0x2f'),_0x38cdf3,_0x347d0b[_0xf53e('0x5')][_0x3c7ab9][_0xf53e('0x30')],_0x20c454,_0x3c7ab9);_0x347d0b[_0xf53e('0x7')][_0x20c454]['timer']=setTimeout(_0x347d0b[_0xf53e('0x31')]['bind'](_0x347d0b,_0x20c454),_0x347d0b[_0xf53e('0x5')][_0x3c7ab9][_0xf53e('0x30')]*0x3e8);_0x347d0b['timers'][_0x20c454][_0xf53e('0x17')]=moment()[_0xf53e('0x32')](_0xf53e('0x33'));_0x347d0b[_0xf53e('0x7')][_0x20c454][_0xf53e('0x1a')]=_0x38cdf3;_0x347d0b[_0xf53e('0x7')][_0x20c454][_0xf53e('0x34')]=_0x3c7ab9;_0x347d0b[_0xf53e('0x7')][_0x20c454][_0xf53e('0x35')]=_0x347d0b[_0xf53e('0x35')][_0xf53e('0xa')](_0x347d0b,_0x20c454,_0x38cdf3);});}})[_0xf53e('0x1d')](function(){logger[_0xf53e('0x1e')](_0xf53e('0x2f'),_0x38cdf3,_0x347d0b[_0xf53e('0x5')][_0x3c7ab9][_0xf53e('0x30')],_0x20c454,_0x3c7ab9);})[_0xf53e('0x20')](function(){delete _0x347d0b[_0xf53e('0x22')][_0x38cdf3];});}catch(_0x3b7b7f){logger[_0xf53e('0x1e')](_0xf53e('0x36'),_0x3b7b7f[_0xf53e('0x37')]);}};Acw[_0xf53e('0x16')][_0xf53e('0x31')]=function(_0x53567f){try{var _0x447400=this;if(_0x447400['timers'][_0x53567f]){_0x447400['timers'][_0x53567f][_0xf53e('0x18')]=![];var _0x5e045b=_0x447400[_0xf53e('0x7')][_0x53567f][_0xf53e('0x1a')];var _0xf5587c=_0x447400[_0xf53e('0x7')][_0x53567f][_0xf53e('0x34')];var _0x816c7c=_0x447400[_0xf53e('0x5')][_0xf5587c][_0xf53e('0x30')];logger[_0xf53e('0x29')]('[%s][TIMER][STOP][AGENT:%s]',_0x5e045b,_0x53567f);RpcUser[_0xf53e('0x38')](this[_0xf53e('0x6')][_0x53567f]['id'])[_0xf53e('0x1b')](function(_0x5260bb){if(_0x5260bb[_0xf53e('0x39')]==='ACW'){return RpcUser[_0xf53e('0x3a')](_0x447400[_0xf53e('0x6')][_0x53567f]);}});RpcVoiceAgentReport['update']({'acwtime':_0x816c7c,'agentacw':!![]},_0x5e045b,_0x53567f)['then'](function(_0x40b448){logger[_0xf53e('0x29')](_0xf53e('0x1c'),_0x5e045b,_0x816c7c,_0x40b448);})['catch'](function(_0x3fb534){logger[_0xf53e('0x1e')](_0xf53e('0x1f'),_0x5e045b,_0x3fb534);});}else{logger[_0xf53e('0x1e')](_0xf53e('0x3b'),_0x53567f);if(_0x447400[_0xf53e('0x7')]){logger[_0xf53e('0x29')](_0xf53e('0x3c'),JSON['stringify'](_0x447400['timers']));}}}catch(_0x7bc65c){logger[_0xf53e('0x1e')]('[ACW][STOP]\x20%s',_0x7bc65c[_0xf53e('0x37')]);}};Acw[_0xf53e('0x16')]['syncAgentConnect']=function(_0x1c3add){try{if(this[_0xf53e('0x5')][_0x1c3add['queue']]&&(this[_0xf53e('0x5')][_0x1c3add[_0xf53e('0x34')]][_0xf53e('0x3')]||this[_0xf53e('0x5')][_0x1c3add[_0xf53e('0x34')]][_0xf53e('0x3d')])){if(this[_0xf53e('0x6')][_0x1c3add['interface']]){this[_0xf53e('0x22')][_0x1c3add[_0xf53e('0x1a')]]={'queue':_0x1c3add['queue'],'interface':_0x1c3add['interface'],'destlinkedid':_0x1c3add[_0xf53e('0x2b')]};}}}catch(_0x549e45){logger[_0xf53e('0x1e')](_0xf53e('0x3e'),_0x549e45[_0xf53e('0x37')]);}};Acw[_0xf53e('0x16')]['syncAgentConnectPreview']=function(_0x15d5c4){try{if(this[_0xf53e('0x5')][_0x15d5c4[_0xf53e('0x34')]]&&(this['voiceQueues'][_0x15d5c4[_0xf53e('0x34')]][_0xf53e('0x3')]||this['voiceQueues'][_0x15d5c4['queue']][_0xf53e('0x3d')])){if(this[_0xf53e('0x6')][_0x15d5c4[_0xf53e('0x23')]]){this['channels'][_0x15d5c4['uniqueid']]={'queue':_0x15d5c4[_0xf53e('0x34')],'interface':_0x15d5c4[_0xf53e('0x23')]};}}}catch(_0x2e52df){logger[_0xf53e('0x1e')]('[ACW][syncAgentConnectPreview]\x20%s',_0x2e52df[_0xf53e('0x37')]);}};Acw[_0xf53e('0x16')]['syncHangupRequest']=function(_0x287c51){try{if(this[_0xf53e('0x22')][_0x287c51[_0xf53e('0x1a')]]&&_[_0xf53e('0x3f')](this[_0xf53e('0x22')][_0x287c51[_0xf53e('0x1a')]][_0xf53e('0x40')])){logger[_0xf53e('0x29')]('[%s][HANGUP:UNIQUEID]',_0x287c51['uniqueid']);this['startAcw'](_0x287c51['uniqueid']);}else if(this['channels'][_0x287c51[_0xf53e('0x41')]]&&_['isUndefined'](this[_0xf53e('0x22')][_0x287c51[_0xf53e('0x41')]]['attended'])){logger['info'](_0xf53e('0x42'),_0x287c51[_0xf53e('0x41')]);this['startAcw'](_0x287c51[_0xf53e('0x41')]);}}catch(_0x24914f){logger[_0xf53e('0x1e')](_0xf53e('0x43'),_0x24914f[_0xf53e('0x37')]);}};Acw[_0xf53e('0x16')][_0xf53e('0xc')]=function(_0x3e16f3){try{if(this[_0xf53e('0x22')][_0x3e16f3[_0xf53e('0x1a')]]&&this[_0xf53e('0x22')][_0x3e16f3[_0xf53e('0x1a')]][_0xf53e('0x40')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x3e16f3[_0xf53e('0x1a')]);this[_0xf53e('0x21')](_0x3e16f3['uniqueid']);}else if(this['channels'][_0x3e16f3[_0xf53e('0x41')]]&&this[_0xf53e('0x22')][_0x3e16f3['linkedid']][_0xf53e('0x40')]){logger[_0xf53e('0x29')](_0xf53e('0x44'),_0x3e16f3['linkedid']);this[_0xf53e('0x21')](_0x3e16f3[_0xf53e('0x41')]);}}catch(_0x1b42c3){logger[_0xf53e('0x1e')]('[ACW][syncHangup]\x20%s',_0x1b42c3[_0xf53e('0x37')]);}};Acw['prototype'][_0xf53e('0xf')]=function(_0x3c0b88){try{if(!_[_0xf53e('0x45')](this[_0xf53e('0x22')][_0x3c0b88['transfereeuniqueid']])){this[_0xf53e('0x21')](_0x3c0b88[_0xf53e('0x46')]);if(this['channels'][_0x3c0b88[_0xf53e('0x47')]]){this['channels'][_0x3c0b88['secondtransfereruniqueid']][_0xf53e('0x40')]=!![];this['channels'][_0x3c0b88[_0xf53e('0x48')]]=this['channels'][_0x3c0b88[_0xf53e('0x47')]];this[_0xf53e('0x49')](_0x3c0b88['secondtransfereruniqueid']);}}else if(!_[_0xf53e('0x45')](this[_0xf53e('0x22')][_0x3c0b88[_0xf53e('0x48')]])){this[_0xf53e('0x21')](_0x3c0b88[_0xf53e('0x48')]);if(this[_0xf53e('0x22')][_0x3c0b88[_0xf53e('0x4a')]]){this['channels'][_0x3c0b88[_0xf53e('0x4a')]][_0xf53e('0x40')]=!![];this[_0xf53e('0x22')][_0x3c0b88[_0xf53e('0x46')]]=this[_0xf53e('0x22')][_0x3c0b88[_0xf53e('0x4a')]];this['deleteChannelAfterTimeout'](_0x3c0b88[_0xf53e('0x4a')]);}}}catch(_0x3e6507){logger[_0xf53e('0x1e')](_0xf53e('0x4b'),_0x3e6507[_0xf53e('0x37')]);}};Acw[_0xf53e('0x16')][_0xf53e('0x11')]=function(_0xb49605){try{if(this['channels'][_0xb49605['transfereruniqueid']]){logger[_0xf53e('0x29')](_0xf53e('0x4c'),JSON['stringify'](_0xb49605[_0xf53e('0x4d')]));this[_0xf53e('0x21')](_0xb49605[_0xf53e('0x4d')]);}else if(this[_0xf53e('0x22')][_0xb49605[_0xf53e('0x4e')]]){logger[_0xf53e('0x29')](_0xf53e('0x4f'),JSON[_0xf53e('0x50')](_0xb49605[_0xf53e('0x4e')]));this[_0xf53e('0x21')](_0xb49605[_0xf53e('0x4e')]);}}catch(_0x132d34){logger[_0xf53e('0x1e')]('[ACW][syncBlindTransfer]\x20%s',_0x132d34[_0xf53e('0x37')]);}};Acw[_0xf53e('0x16')][_0xf53e('0xd')]=function(_0x529891){try{if(this['voiceQueues'][_0x529891[_0xf53e('0x34')]]&&this[_0xf53e('0x5')][_0x529891['queue']][_0xf53e('0x51')]===_0xf53e('0x52')){if(this[_0xf53e('0x6')][_0x529891['interface']]){logger[_0xf53e('0x29')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x529891['uniqueid'],_0x529891[_0xf53e('0x23')],_0x529891[_0xf53e('0x34')]);return RpcUser[_0xf53e('0x2c')](this[_0xf53e('0x6')][_0x529891[_0xf53e('0x23')]],_0xf53e('0x53'),_0x529891['uniqueid']);}}}catch(_0x458a77){logger[_0xf53e('0x1e')](_0xf53e('0x54'),_0x458a77[_0xf53e('0x37')]);}};Acw[_0xf53e('0x16')]['deleteChannelAfterTimeout']=function(_0x4ebcaf,_0x415a4c=0x2710){if(this[_0xf53e('0x22')][_0x4ebcaf]){setTimeout(()=>{delete this[_0xf53e('0x22')][_0x4ebcaf];},_0x415a4c);}};module[_0xf53e('0x55')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 34f2072..4313798 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 _0xc99c=['exports','bluebird','util','../../config/logger','ami','../../config/environment','asterisk','port','username','password','keepConnected','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionSipPeerStatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionDeviceStateList','catch','[ami.js][fullybooted]'];(function(_0x5ea887,_0x5bb376){var _0x45c71b=function(_0x2353a3){while(--_0x2353a3){_0x5ea887['push'](_0x5ea887['shift']());}};_0x45c71b(++_0x5bb376);}(_0xc99c,0x1a3));var _0xcc99=function(_0x3b5ddb,_0x5c61da){_0x3b5ddb=_0x3b5ddb-0x0;var _0x5e95e4=_0xc99c[_0x3b5ddb];return _0x5e95e4;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xcc99('0x0'));var util=require(_0xcc99('0x1'));var logger=require(_0xcc99('0x2'))(_0xcc99('0x3'));var config=require(_0xcc99('0x4'));var ami=new Manager(config[_0xcc99('0x5')][_0xcc99('0x6')],config[_0xcc99('0x5')]['ip'],config[_0xcc99('0x5')][_0xcc99('0x7')],config[_0xcc99('0x5')][_0xcc99('0x8')],!![]);ami[_0xcc99('0x9')]();ami[_0xcc99('0xa')]=BPromise[_0xcc99('0xb')](ami[_0xcc99('0xc')]);function error(_0x39431c){logger[_0xcc99('0xd')](util[_0xcc99('0xe')](_0xcc99('0xf'),config[_0xcc99('0x5')][_0xcc99('0x7')],config['asterisk']['ip'],config[_0xcc99('0x5')][_0xcc99('0x6')],util[_0xcc99('0x10')](_0x39431c,![],null)));}function close(){logger[_0xcc99('0xd')](util[_0xcc99('0xe')](_0xcc99('0x11'),config['asterisk'][_0xcc99('0x7')],config[_0xcc99('0x5')]['ip'],config[_0xcc99('0x5')][_0xcc99('0x6')]));}ami[_0xcc99('0x12')]=function(){return function(){return ami[_0xcc99('0xa')]({'action':_0xcc99('0x13')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0xcc99('0xa')]({'action':'devicestatelist'});};};ami[_0xcc99('0x14')]=function(){return function(){return ami[_0xcc99('0xa')]({'action':'sippeerstatus'});};};ami[_0xcc99('0x15')]=function(){return function(){return ami[_0xcc99('0xa')]({'action':'queuesummary'});};};ami[_0xcc99('0x16')]=function(){return function(){return ami['Action']({'action':_0xcc99('0x17')});};};function connect(){logger[_0xcc99('0x18')](util[_0xcc99('0xe')](_0xcc99('0x19'),config[_0xcc99('0x5')][_0xcc99('0x7')],config[_0xcc99('0x5')]['ip'],config[_0xcc99('0x5')]['port']));ami[_0xcc99('0x1a')](_0xcc99('0xd'),error);ami['once'](_0xcc99('0x1b'),close);}ami['on'](_0xcc99('0x1c'),connect);ami['on'](_0xcc99('0x1d'),function(_0xfece2b){logger['info'](util[_0xcc99('0xe')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xcc99('0x5')]['username'],config['asterisk']['ip'],config[_0xcc99('0x5')][_0xcc99('0x6')],util[_0xcc99('0x10')](_0xfece2b,![],null)));});ami['on'](_0xcc99('0x1e'),function(){logger['info'](util[_0xcc99('0xe')](_0xcc99('0x1f'),config[_0xcc99('0x5')][_0xcc99('0x7')],config[_0xcc99('0x5')]['ip'],config[_0xcc99('0x5')][_0xcc99('0x6')]));return Promise[_0xcc99('0x20')]()[_0xcc99('0x21')](ami['actionSipShowRegistry']())[_0xcc99('0x21')](ami[_0xcc99('0x22')]())[_0xcc99('0x21')](ami[_0xcc99('0x14')]())[_0xcc99('0x21')](ami[_0xcc99('0x15')]())[_0xcc99('0x21')](ami[_0xcc99('0x16')]())[_0xcc99('0x23')](function(_0x2aa599){logger[_0xcc99('0xd')](_0xcc99('0x24'),util[_0xcc99('0x10')](_0x2aa599,{'showHidden':![],'depth':null}));});});ami[_0xcc99('0x1a')](_0xcc99('0xd'),error);ami[_0xcc99('0x1a')](_0xcc99('0x1b'),close);module[_0xcc99('0x25')]=ami; \ No newline at end of file +var _0x9a08=['error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','Action','sipshowregistry','actionSipPeerStatus','sippeerstatus','actionQueueSummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','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','actionDeviceStateList','catch','[ami.js][fullybooted]','exports','bluebird','../../config/logger','../../config/environment','asterisk','port','username','password','keepConnected','promisify'];(function(_0x4dfb8a,_0x332d52){var _0x37aaea=function(_0x281884){while(--_0x281884){_0x4dfb8a['push'](_0x4dfb8a['shift']());}};_0x37aaea(++_0x332d52);}(_0x9a08,0xf3));var _0x89a0=function(_0x44d88c,_0x4e0cb4){_0x44d88c=_0x44d88c-0x0;var _0x508da7=_0x9a08[_0x44d88c];return _0x508da7;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x89a0('0x0'));var util=require('util');var logger=require(_0x89a0('0x1'))('ami');var config=require(_0x89a0('0x2'));var ami=new Manager(config[_0x89a0('0x3')][_0x89a0('0x4')],config[_0x89a0('0x3')]['ip'],config['asterisk'][_0x89a0('0x5')],config[_0x89a0('0x3')][_0x89a0('0x6')],!![]);ami[_0x89a0('0x7')]();ami['Action']=BPromise[_0x89a0('0x8')](ami['action']);function error(_0x329fee){logger[_0x89a0('0x9')](util[_0x89a0('0xa')](_0x89a0('0xb'),config[_0x89a0('0x3')]['username'],config[_0x89a0('0x3')]['ip'],config['asterisk'][_0x89a0('0x4')],util[_0x89a0('0xc')](_0x329fee,![],null)));}function close(){logger[_0x89a0('0x9')](util['format'](_0x89a0('0xd'),config[_0x89a0('0x3')]['username'],config[_0x89a0('0x3')]['ip'],config[_0x89a0('0x3')][_0x89a0('0x4')]));}ami[_0x89a0('0xe')]=function(){return function(){return ami[_0x89a0('0xf')]({'action':_0x89a0('0x10')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x89a0('0xf')]({'action':'devicestatelist'});};};ami[_0x89a0('0x11')]=function(){return function(){return ami[_0x89a0('0xf')]({'action':_0x89a0('0x12')});};};ami[_0x89a0('0x13')]=function(){return function(){return ami[_0x89a0('0xf')]({'action':'queuesummary'});};};ami[_0x89a0('0x14')]=function(){return function(){return ami[_0x89a0('0xf')]({'action':_0x89a0('0x15')});};};function connect(){logger['info'](util[_0x89a0('0xa')](_0x89a0('0x16'),config[_0x89a0('0x3')][_0x89a0('0x5')],config[_0x89a0('0x3')]['ip'],config[_0x89a0('0x3')][_0x89a0('0x4')]));ami[_0x89a0('0x17')](_0x89a0('0x9'),error);ami[_0x89a0('0x17')](_0x89a0('0x18'),close);}ami['on']('connect',connect);ami['on'](_0x89a0('0x19'),function(_0x2f80af){logger[_0x89a0('0x1a')](util[_0x89a0('0xa')](_0x89a0('0x1b'),config[_0x89a0('0x3')][_0x89a0('0x5')],config[_0x89a0('0x3')]['ip'],config[_0x89a0('0x3')][_0x89a0('0x4')],util[_0x89a0('0xc')](_0x2f80af,![],null)));});ami['on'](_0x89a0('0x1c'),function(){logger[_0x89a0('0x1a')](util['format'](_0x89a0('0x1d'),config[_0x89a0('0x3')][_0x89a0('0x5')],config['asterisk']['ip'],config[_0x89a0('0x3')][_0x89a0('0x4')]));return Promise[_0x89a0('0x1e')]()[_0x89a0('0x1f')](ami[_0x89a0('0xe')]())[_0x89a0('0x1f')](ami[_0x89a0('0x20')]())['then'](ami['actionSipPeerStatus']())['then'](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())[_0x89a0('0x21')](function(_0x2e2663){logger[_0x89a0('0x9')](_0x89a0('0x22'),util[_0x89a0('0xc')](_0x2e2663,{'showHidden':![],'depth':null}));});});ami['once'](_0x89a0('0x9'),error);ami[_0x89a0('0x17')]('close',close);module[_0x89a0('0x23')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 02a0754..15c34bf 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['catch','exports','jayson/promise','bluebird','ami','client','http','rpc','memberReport','error','message','result'];(function(_0x52c553,_0x273e5a){var _0x425607=function(_0x25f443){while(--_0x25f443){_0x52c553['push'](_0x52c553['shift']());}};_0x425607(++_0x273e5a);}(_0xb43b,0x1b2));var _0xbb43=function(_0x2e67f6,_0x171766){_0x2e67f6=_0x2e67f6-0x0;var _0x56ff30=_0xb43b[_0x2e67f6];return _0x56ff30;};'use strict';var jayson=require(_0xbb43('0x0'));var BPromise=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var client=jayson[_0xbb43('0x3')][_0xbb43('0x4')]({'port':0x2329});client['Request']=function(_0x131e9e,_0x41aff6){return new BPromise(function(_0x351254,_0x16432a){return client['request'](_0x131e9e,_0x41aff6)['then'](function(_0x378df5){logger['debug'](_0xbb43('0x5'),_0xbb43('0x6'),_0x131e9e,_0x41aff6,_0x378df5);if(_0x378df5[_0xbb43('0x7')]){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x378df5[_0xbb43('0x7')][_0xbb43('0x8')],_0x41aff6);return _0x16432a(_0x378df5['error'][_0xbb43('0x8')]);}else{return _0x351254(_0x378df5[_0xbb43('0x9')]);}})[_0xbb43('0xa')](function(_0x5e3611){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x5e3611,_0x41aff6);return _0x16432a(_0x5e3611);});});};module[_0xbb43('0xb')]=client; \ No newline at end of file +var _0xac4a=['ami','client','http','then','debug','memberReport','error','message','result','catch','rpc','jayson/promise','bluebird','../../config/logger'];(function(_0x296144,_0x26bbbf){var _0x5329b1=function(_0x5d321b){while(--_0x5d321b){_0x296144['push'](_0x296144['shift']());}};_0x5329b1(++_0x26bbbf);}(_0xac4a,0x13f));var _0xaac4=function(_0xaac358,_0x2ae01c){_0xaac358=_0xaac358-0x0;var _0x3394ae=_0xac4a[_0xaac358];return _0x3394ae;};'use strict';var jayson=require(_0xaac4('0x0'));var BPromise=require(_0xaac4('0x1'));var logger=require(_0xaac4('0x2'))(_0xaac4('0x3'));var client=jayson[_0xaac4('0x4')][_0xaac4('0x5')]({'port':0x2329});client['Request']=function(_0x58626e,_0x2af0f6){return new BPromise(function(_0x2a5762,_0x32d34c){return client['request'](_0x58626e,_0x2af0f6)[_0xaac4('0x6')](function(_0x53d03a){logger[_0xaac4('0x7')]('rpc',_0xaac4('0x8'),_0x58626e,_0x2af0f6,_0x53d03a);if(_0x53d03a[_0xaac4('0x9')]){logger['error']('rpc',_0xaac4('0x8'),_0x58626e,_0x53d03a['error'][_0xaac4('0xa')],_0x2af0f6);return _0x32d34c(_0x53d03a['error']['message']);}else{return _0x2a5762(_0x53d03a[_0xaac4('0xb')]);}})[_0xaac4('0xc')](function(_0x38d1d0){logger[_0xaac4('0x9')](_0xaac4('0xd'),'memberReport',_0x58626e,_0x38d1d0,_0x2af0f6);return _0x32d34c(_0x38d1d0);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index c23cfe8..75e55be 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 _0x22b8=['Interval','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','originated','sendMessageOneNotActive','is\x20not\x20active','DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','[ifTime][Action]','isTrunkReachable','active','trunks','SIP/%s','reachable','status','checkIsTrunkReachable','Trunk','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','NULL_INTERVAL','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','Action','iftime\x20%s,%s','interval','then','content','true','catch','command','all','some','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','syncCampaigns','undefined','resolve','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','power','handlePower','dialPowerLevel','booked','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','OVERTIME_GLOBAL_INTERVAL','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','Error','queue','ivr','updateOriginated','uniqueid','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','agiafterat','dialQueueProject2','createHistory','moveContactManagedDialer','[syncAgentComplete]','droptime','getSeconds','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','dropreason','TIMEOUT','countdropretry','countglobal','dialDropRetryFrequency','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','minutes','ContactId','ListId','CampaignId','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','dialAbandonedMaxRetry','VoiceQueueId','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','swapAdditionalPhones','actions','channel','actionid','strategy','rrmemory','locked','paused','stateinterface','isNil','idHopper','roundrobin','run','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[Catch][Preview][syncQueueStatusComplete]','finally','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','getQueue','response','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','xcally-motion-dialer','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','custom:amd','buildObj','[syncHangupInAMD][createHistory]','dialAMDActive','MACHINE','Machine','AMD','countmachineretry','emit','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countagentrejectretry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','[syncHangupInAMDIvr]','countnosuchnumberretry','dialGlobalMaxRetry','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','cause-txt','Normal\x20Clearing','[syncAgentComplete][createHistory]','outboundUnknownCallsDay','Unknow','running','isPreviewCampaign','getQueueCampaignStatusMessage','statusMessage','available','inUse','talking','pTalking','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','syncQueueSummaryComplete','filter','dialPreviewRecallmeReminder','online','map','Agent','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','[actions]','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','saveInDb','UserId','[emptyContact][createHistory]','[emptyContact]','handlePreviewRecallNotifications','user:dialPreviewRecallReminder','handleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','dialQueueOptions','dialAgiAfterHangupAgent','dialer','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Contact','assign','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','TrunkBackup','getCallerIdRandom','XMD-ORIGINATECALLERIDNAME','variables','SIP/%s/%s%s','dialPrefix','trim','substring','dialCutDigit','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','countcongestionretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','reason','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','queuestatus','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','Blacklist','[Originate][historyBlacklist]','inBlackList','limitCalls','temp','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','push','getContactDialer','[countReScheduled]\x20','checkIsBlackList','loggerHandler','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','countReScheduled','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','interval\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','exports','util','lodash','uuid','moment','./utils','../../../config/environment/','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/history','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','maxNumberOriginate','channels','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','syncVarSet','queuemember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','getSettings','previewRecallmeReminderInterval','type','outbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','format','voice:queue:%s','name','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalTotalCalls','isUndefined','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','erlangBusyFactor','merge','debug','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','inspect','checkContactLowerLimitOriginate','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','stringify','pick'];(function(_0x417fba,_0x49c253){var _0x20b9f0=function(_0x4aef4f){while(--_0x4aef4f){_0x417fba['push'](_0x417fba['shift']());}};_0x20b9f0(++_0x49c253);}(_0x22b8,0x1a9));var _0x822b=function(_0x31e982,_0x521c6a){_0x31e982=_0x31e982-0x0;var _0x3efb59=_0x22b8[_0x31e982];return _0x3efb59;};'use strict';var util=require(_0x822b('0x0'));var _=require(_0x822b('0x1'));var uuid=require(_0x822b('0x2'));var moment=require(_0x822b('0x3'));var rr=require('rr');var Redis=require('ioredis');var utils=require(_0x822b('0x4'));var hopperUtils=require('./utils/hopper');var ut=require('../preview/util/util');var config=require(_0x822b('0x5'));var logger=require('../../../config/logger')('dialer');var loggerBooked=require(_0x822b('0x6'))('booked');var loggerPredictive=require(_0x822b('0x6'))(_0x822b('0x7'));var loggerPredictiveCalls=require(_0x822b('0x6'))(_0x822b('0x8'));var loggerSyncQueueSummary=require(_0x822b('0x6'))(_0x822b('0x9'));var ami=require(_0x822b('0xa'));config[_0x822b('0xb')]=_[_0x822b('0xc')](config['redis'],{'host':_0x822b('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x822b('0xb')]));var cmHopper=require(_0x822b('0xe'));var voiceQueueRt=require(_0x822b('0xf'));var RpcSetting=require(_0x822b('0x10'));var Interval=require(_0x822b('0x11'));var Action=require('./models/action');var History=require(_0x822b('0x12'));var Final=require('./models/final');var AgentComplete=require(_0x822b('0x13'));var QueueCallerAbandon=require(_0x822b('0x14'));var Hangup=require(_0x822b('0x15'));var ipAgi=process['env'][_0x822b('0x16')]||_0x822b('0x17');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x822b('0x18')][_0x822b('0x19')]=function(_0x10ccd5){this['tail']=this[_0x822b('0x1a')]?this[_0x822b('0x1a')]['finally'](_0x10ccd5):_0x10ccd5();};function Dialer(_0x239206,_0x3650f3){this[_0x822b('0x1b')]=new Sequence();this[_0x822b('0x1c')]=_0x3650f3;this[_0x822b('0x1d')]=_0x239206[_0x822b('0x1d')];this[_0x822b('0x1e')]=_0x239206[_0x822b('0x1e')];this[_0x822b('0x1f')]=_0x239206['agents'];this['trunks']=_0x239206['trunks'];this[_0x822b('0x20')]=config['maxNumberOriginate']||0x2;this[_0x822b('0x21')]={};this['actions']={};this['contactsId']={};this[_0x822b('0x22')]={};this['optionPredictive']={};this[_0x822b('0x23')]={};this[_0x822b('0x24')]={};this[_0x822b('0x25')]={};this[_0x822b('0x26')]={};this['queueBookedRR']={};this[_0x822b('0x27')]={};ami['on'](_0x822b('0x28'),this[_0x822b('0x29')][_0x822b('0x2a')](this));ami['on'](_0x822b('0x2b'),this['syncQueueCallerAbandon'][_0x822b('0x2a')](this));ami['on'](_0x822b('0x2c'),this[_0x822b('0x2d')][_0x822b('0x2a')](this));ami['on'](_0x822b('0x2e'),this[_0x822b('0x2f')][_0x822b('0x2a')](this));ami['on'](_0x822b('0x30'),this['syncQueueSummary'][_0x822b('0x2a')](this));ami['on']('custom:queuesummarycomplete',this['syncQueueSummaryComplete']['bind'](this));ami['on'](_0x822b('0x31'),this[_0x822b('0x32')][_0x822b('0x2a')](this));ami['on'](_0x822b('0x33'),this[_0x822b('0x34')][_0x822b('0x2a')](this));ami['on']('varset',this[_0x822b('0x35')][_0x822b('0x2a')](this));ami['on'](_0x822b('0x36'),this['syncQueueMember'][_0x822b('0x2a')](this));ami['on'](_0x822b('0x37'),this[_0x822b('0x38')][_0x822b('0x2a')](this));this[_0x822b('0x39')]();this[_0x822b('0x3a')]();RpcSetting[_0x822b('0x3b')]()['then'](function(_0x40a603){previewRecallmeReminderInterval=_0x40a603[_0x822b('0x3c')];});}function isNotNull(_0x451275){return _0x451275!==null&&!_['isUndefined'](_0x451275);}function msgResponse(_0x45199d,_0x56b224,_0x111200){return{'action':_0x45199d,'response':_0x56b224,'message':_0x111200,'stack':_0x111200};}function emit(_0x13463c,_0x52a2bc,_0x184aff){io['to'](_0x13463c)['emit'](_0x52a2bc,_0x184aff);}function emitOutboundVoiceQueueSummary(_0x4f01e7){if(_0x4f01e7[_0x822b('0x3d')]===_0x822b('0x3e')){logger['debug'](_0x822b('0x3f'),util['inspect'](_0x4f01e7,{'showHidden':![],'depth':null}));emit(util[_0x822b('0x40')](_0x822b('0x41'),_0x4f01e7[_0x822b('0x42')]),_0x822b('0x43'),_0x4f01e7);}}function checkGetDataPredictive(_0xda90e1){if(isNotNull(_0xda90e1)&&!_[_0x822b('0x44')](_0xda90e1)){loggerPredictive[_0x822b('0x45')](_0x822b('0x46'));loggerPredictive[_0x822b('0x45')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xda90e1['predictiveIntervalTotalCalls']);loggerPredictive[_0x822b('0x45')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xda90e1['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x822b('0x45')](_0x822b('0x47'),_0xda90e1[_0x822b('0x48')]);loggerPredictive[_0x822b('0x45')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xda90e1[_0x822b('0x49')]);loggerPredictive['info'](_0x822b('0x4a'),_0xda90e1['predictiveIntervalAvgHoldtime']);loggerPredictive['info'](_0x822b('0x4b'),_0xda90e1['predictiveIntervalAvgTalktime']);loggerPredictive[_0x822b('0x45')](_0x822b('0x4c'));if(_0xda90e1[_0x822b('0x4d')]>0x0){if(!_[_0x822b('0x4e')](_0xda90e1[_0x822b('0x4f')])&&_0xda90e1[_0x822b('0x4f')]>0x0){return!![];}loggerPredictive[_0x822b('0x45')](_0x822b('0x50'));if(!_[_0x822b('0x4e')](_0xda90e1[_0x822b('0x51')])&&_0xda90e1['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x822b('0x45')](_0x822b('0x52'));}else{loggerPredictive['info'](_0x822b('0x53'));}}else{loggerPredictive[_0x822b('0x45')](_0x822b('0x54'));}return![];}function mergeDataErlangB(_0x335443){return function(_0x5bb864){loggerPredictive['info']('---------\x20ErlangB\x20---------');loggerPredictive[_0x822b('0x45')](_0x822b('0x55'),_0x5bb864[_0x822b('0x56')]);loggerPredictive['info']('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5bb864[_0x822b('0x57')]);loggerPredictive[_0x822b('0x45')](_0x822b('0x58'),_0x5bb864[_0x822b('0x59')]);loggerPredictive['info']('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5bb864[_0x822b('0x5a')]);loggerPredictive['info'](_0x822b('0x58'),_0x5bb864[_0x822b('0x59')]);loggerPredictive[_0x822b('0x45')]('---------------------------');_[_0x822b('0x5b')](_0x335443,_0x5bb864);};}function ifInterval(_0x2f1ed6,_0x462ffa){if(_[_0x822b('0x4e')](_0x462ffa)){return![];}return utils['getSeconds'](undefined,_0x462ffa)<_0x2f1ed6*0x3c;}function clearPredictiveAttributes(_0x462a65){if(_0x462a65['startProgressive']){_0x462a65[_0x822b('0x24')]=undefined;loggerPredictive[_0x822b('0x5c')](_0x462a65[_0x822b('0x42')],'startProgressive\x20value\x20cleared');}if(_0x462a65['startPredictive']){_0x462a65[_0x822b('0x23')]=undefined;loggerPredictive[_0x822b('0x5c')](_0x462a65['name'],_0x822b('0x5d'));}if(_0x462a65[_0x822b('0x5e')]){clearInterval(_0x462a65[_0x822b('0x5e')]);_0x462a65[_0x822b('0x5e')]=undefined;loggerPredictive[_0x822b('0x5c')](_0x462a65[_0x822b('0x42')],_0x822b('0x5f'));}}function loggerCatchPredictive(_0x1c3209,_0x4cc6fd){return function(_0x1c6b12){loggerPredictive[_0x822b('0x60')](_0x4cc6fd[_0x822b('0x42')],_0x1c3209);loggerPredictive[_0x822b('0x60')](_0x1c6b12[_0x822b('0x61')]);clearPredictiveAttributes(_0x4cc6fd);};}function loggerCatch(_0x586af6){return function(_0x304dac){logger[_0x822b('0x60')](_0x586af6,util[_0x822b('0x62')](_0x304dac,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x4c0b50,_0x26bf1a,_0x2b1e51){return function(_0x14a278){utils[_0x822b('0x63')](_0x26bf1a,_0x2b1e51,0x0);_0x26bf1a['temp']=0x0;logger[_0x822b('0x60')](_0x4c0b50,util[_0x822b('0x62')](_0x14a278,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x426833){return function(_0x4af486){if(isNotNull(_0x4af486)&&isNotNull(_0x4af486[0x0])){if(_0x4af486[0x0]['contactsRescheduled']>0x0){_0x426833[_0x822b('0x64')]=utils[_0x822b('0x65')][_0x822b('0x66')];logger[_0x822b('0x45')](_0x822b('0x67')+_0x426833['name'],_0x4af486[0x0][_0x822b('0x68')],_0x822b('0x69'));}else{_0x426833[_0x822b('0x64')]=utils[_0x822b('0x65')][_0x822b('0x6a')];logger[_0x822b('0x45')](_0x822b('0x6b')+_0x426833[_0x822b('0x42')]);}}};}function createObjHistory(_0x5dc64e,_0x236a88,_0x4648fc,_0x5294e6,_0x53bb71){_0x5dc64e[_0x822b('0x64')]=_0x4648fc;var _0x4a97aa=new Action(_0x5dc64e,_0x236a88);var _0xc7a79f=new History(_0x4a97aa);_0xc7a79f[_0x822b('0x6c')]=_0x5294e6;_0xc7a79f[_0x822b('0x6d')]=_0x53bb71;_0xc7a79f[_0x822b('0x6e')]=_0x4a97aa[_0x822b('0x6f')];return _0xc7a79f;}function unlockQueueStatus(_0x5ec4c7,_0xcb8e2d){setTimeout(function(){if(_[_0x822b('0x4e')](_0x5ec4c7[_0x822b('0x70')])){loggerBooked['error'](_0x822b('0x71'),_0xcb8e2d);}_0x5ec4c7[_0x822b('0x70')]=!![];loggerBooked['info']('[booked][unlockQueueStatus]',_0xcb8e2d,JSON[_0x822b('0x72')](_[_0x822b('0x73')](_0x5ec4c7,[_0x822b('0x42'),_0x822b('0x70')])));},0x1f3);}function checkInterval(_0x2e1f9d){return function(){if(!isNotNull(_0x2e1f9d[_0x822b('0x74')])){_0x2e1f9d['message']=utils[_0x822b('0x65')]['NULL_INTERVAL'];throw _0x2e1f9d['name']+_0x822b('0x75');}if(!isNotNull(_0x2e1f9d[_0x822b('0x74')][_0x822b('0x76')])){_0x2e1f9d[_0x822b('0x64')]=utils[_0x822b('0x65')]['NULL_INTERVAL'];throw _0x2e1f9d[_0x822b('0x42')]+_0x822b('0x75');}if(!isNotNull(_[_0x822b('0x44')](_0x2e1f9d[_0x822b('0x74')][_0x822b('0x76')]))){_0x2e1f9d['message']=utils[_0x822b('0x65')]['NULL_INTERVAL'];throw _0x2e1f9d[_0x822b('0x42')]+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x102b93){return function(){if(!utils[_0x822b('0x77')](_0x102b93)){_0x102b93[_0x822b('0x64')]=utils[_0x822b('0x65')][_0x822b('0x78')];throw _0x102b93[_0x822b('0x42')]+_0x822b('0x79');}};}function emitCampaignSummary(_0x2cb45a){if(utils[_0x822b('0x7a')](_0x2cb45a)){emit(util[_0x822b('0x40')](_0x822b('0x7b'),_0x2cb45a[_0x822b('0x42')]),'campaign:save',_0x2cb45a);}}function loggerCatchQueueSummary(_0x123860,_0x4f99ff){return function(_0x2c4900){clearPredictiveAttributes(_0x4f99ff);emitCampaignSummary(_0x4f99ff);loggerSyncQueueSummary[_0x822b('0x5c')](_0x123860,util[_0x822b('0x62')](_0x2c4900,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x355787){if(_0x355787['sendMessageOneNotActive']){if(_0x355787[_0x822b('0x7c')]===0x0){_0x355787[_0x822b('0x7d')]=![];_0x355787[_0x822b('0x64')]=utils['CAMPAIGN_STATUS'][_0x822b('0x78')];loggerSyncQueueSummary[_0x822b('0x5c')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x355787[_0x822b('0x42')],_0x822b('0x7e'));}else{_0x355787['message']=utils['CAMPAIGN_STATUS'][_0x822b('0x7f')];loggerSyncQueueSummary[_0x822b('0x5c')](_0x822b('0x80'),_0x355787[_0x822b('0x42')],_0x822b('0x81'));}emitCampaignSummary(_0x355787);}}function myreject(_0x17780b){return function(_0x12ca5c){return _0x17780b(msgResponse(_0x822b('0x82'),'Error',JSON[_0x822b('0x72')](_0x12ca5c)));};}Dialer[_0x822b('0x18')][_0x822b('0x83')]=function(_0x246df1){return!_['isUndefined'](_0x246df1)&&_0x246df1&&!_[_0x822b('0x4e')](_0x246df1[_0x822b('0x42')])&&!_[_0x822b('0x4e')](_0x246df1['active'])&&_0x246df1[_0x822b('0x84')]&&(this[_0x822b('0x85')][util[_0x822b('0x40')](_0x822b('0x86'),_0x246df1[_0x822b('0x42')])]['status']===_0x822b('0x87')||this[_0x822b('0x85')][util['format']('SIP/%s',_0x246df1[_0x822b('0x42')])][_0x822b('0x88')]==='unmonitored');};Dialer['prototype'][_0x822b('0x89')]=function(_0x2a59a4){var _0x340f0d=this;return function(){if(!_0x340f0d[_0x822b('0x83')](_0x2a59a4[_0x822b('0x8a')])){if(!_0x340f0d['isTrunkReachable'](_0x2a59a4['TrunkBackup'])){_0x2a59a4[_0x822b('0x64')]=utils[_0x822b('0x65')][_0x822b('0x8b')];throw _0x2a59a4['name']+_0x822b('0x8c');}}};};Dialer[_0x822b('0x18')][_0x822b('0x8d')]=function(_0x23a4dc,_0x26dea8,_0x117a28,_0x454dfb){var _0xf16079=this;return function(){var _0x2f423d=!![];return _0xf16079['ifTimeIvr'](_0x23a4dc,_0x26dea8,_0x117a28,_0x454dfb,_0x2f423d);};};Dialer[_0x822b('0x18')][_0x822b('0x8e')]=function(_0x587c8b,_0x431440,_0x2a34f4,_0x124a1b){var _0x7a14e0=this;return function(){var _0x1555f8=![];return _0x7a14e0['ifTimeIvr'](_0x587c8b[_0x822b('0x76')],_0x431440,_0x2a34f4,_0x124a1b,_0x1555f8);};};Dialer[_0x822b('0x18')]['ifTimeIvr']=function(_0x528de4,_0x1d88ff,_0xb93f49,_0x178feb,_0xc62e3f){var _0x3758cb=[];return new Promise(function(_0x1a24af,_0x391213){if(!isNotNull(_0x528de4)){_0x178feb[_0x822b('0x64')]=utils[_0x822b('0x65')][_0x822b('0x8f')];return _0x391213(msgResponse(_0x822b('0x90'),_0x822b('0x91'),_0xb93f49+_0x822b('0x92')));}if(_['isEmpty'](_0x528de4)){_0x178feb[_0x822b('0x64')]=utils[_0x822b('0x65')][_0x822b('0x93')];return _0x391213(msgResponse('ifTime',_0x822b('0x91'),_0xb93f49+_0x822b('0x94')));}if(_0x1d88ff&&_[_0x822b('0x4e')](config[_0x822b('0x95')][_0x1d88ff])){_0x178feb[_0x822b('0x64')]=utils[_0x822b('0x65')][_0x822b('0x96')];return _0x391213(msgResponse(_0x822b('0x90'),_0x822b('0x91'),_0xb93f49+_0x822b('0x97')+_0x1d88ff));}if(_[_0x822b('0x98')](_0x528de4)){for(var _0x2deb2c=0x0;_0x2deb2c<_0x528de4[_0x822b('0x99')];_0x2deb2c+=0x1){_0x3758cb['push'](ami[_0x822b('0x9a')]({'action':'command','command':util[_0x822b('0x40')](_0x822b('0x9b'),_0x528de4[_0x2deb2c][_0x822b('0x9c')],!_['isUndefined'](config[_0x822b('0x95')][_0x1d88ff])?_0x1d88ff:'')})[_0x822b('0x9d')](function(_0x7580a1){return _0x7580a1[_0x822b('0x9e')]['indexOf'](_0x822b('0x9f'))>=0x0;})[_0x822b('0xa0')](myreject(_0x391213)));}}else{_0x3758cb['push'](ami[_0x822b('0x9a')]({'action':_0x822b('0xa1'),'command':util['format'](_0x822b('0x9b'),_0x528de4,!_[_0x822b('0x4e')](config[_0x822b('0x95')][_0x1d88ff])?_0x1d88ff:'')})['then'](function(_0x1a4357){return _0x1a4357[_0x822b('0x9e')]['indexOf'](_0x822b('0x9f'))>=0x0;})['catch'](myreject(_0x391213)));}Promise[_0x822b('0xa2')](_0x3758cb)[_0x822b('0x9d')](function(_0xa4e341){var _0x41e509=_[_0x822b('0xa3')](_0xa4e341);if(_0x41e509){return _0x1a24af(_0x41e509);}else{_0x178feb[_0x822b('0x64')]=_0xc62e3f?utils[_0x822b('0x65')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0x822b('0x65')][_0x822b('0xa4')];return _0x391213(msgResponse(_0x822b('0xa5'),_0x822b('0x91'),_0x822b('0xa6')+_0xc62e3f+'\x20'+_0xb93f49+_0x822b('0xa7')+util[_0x822b('0x62')](_0x528de4,{'showHidden':![],'depth':null})+_0x822b('0xa8')+_0x1d88ff));}})[_0x822b('0xa0')](function(_0x231d35){return _0x391213(msgResponse(_0x822b('0x90'),_0x822b('0x91'),JSON['stringify'](_0x231d35)));});});};Dialer[_0x822b('0x18')][_0x822b('0x39')]=function(){var _0x1d9fd1=this;return cmHopper[_0x822b('0xa9')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x1d9fd1[_0x822b('0xaa')]();},0x3e8);});};Dialer['prototype'][_0x822b('0xaa')]=function(){var _0x3d99d6=this;var _0x5027d2;for(var _0x259438 in this[_0x822b('0x1e')]){if(typeof this[_0x822b('0x1e')][_0x259438]!==_0x822b('0xab')){_0x5027d2=this['campaigns'][_0x259438];if(utils[_0x822b('0x7a')](_0x5027d2)&&utils[_0x822b('0x77')](_0x5027d2)){_0x5027d2[_0x822b('0x7d')]=!![];Promise[_0x822b('0xac')]()[_0x822b('0x9d')](checkIsIVRCampaignActive(_0x5027d2))[_0x822b('0x9d')](checkInterval(_0x5027d2))[_0x822b('0x9d')](_0x3d99d6[_0x822b('0x89')](_0x5027d2))[_0x822b('0x9d')](_0x3d99d6['checkIfTime'](_0x5027d2[_0x822b('0xad')],_0x5027d2['dialTimezone'],_0x5027d2[_0x822b('0x42')],_0x5027d2))[_0x822b('0x9d')](_0x3d99d6['checkIfTimeIntervals'](_0x5027d2[_0x822b('0x74')],_0x5027d2[_0x822b('0xae')],_0x5027d2[_0x822b('0x42')],_0x5027d2))[_0x822b('0x9d')](_0x3d99d6[_0x822b('0xaf')](_0x5027d2))[_0x822b('0xa0')](loggerCatchQueueSummary(_0x822b('0xb0'),_0x5027d2));}else{notSendMessagesCampaign(_0x5027d2);}}}};Dialer[_0x822b('0x18')][_0x822b('0xb1')]=function(_0x477224){if(_0x477224['dialMethod']!==_0x822b('0x7')){clearPredictiveAttributes(_0x477224);}switch(_0x477224[_0x822b('0xb2')]){case _0x822b('0xb3'):this['handlePower'](_0x477224,0x1);break;case _0x822b('0xb4'):this[_0x822b('0xb5')](_0x477224,_0x477224[_0x822b('0xb6')]);break;case'predictive':this['predictive'](_0x477224);break;case _0x822b('0xb7'):this['handlePower'](_0x477224,0x1);break;default:logger['error'](_0x822b('0xb8'),_0x477224['name'],_0x822b('0xb9'));}};Dialer['prototype'][_0x822b('0x90')]=function(_0x54145f,_0x59c9ec){var _0x4f3e14=_0x54145f[_0x822b('0xae')];var _0x40a03a=_0x59c9ec?_0x54145f[_0x822b('0xad')]:_0x54145f[_0x822b('0x74')][_0x822b('0x76')];logger[_0x822b('0xba')](_0x822b('0xbb'),_0x40a03a,_0x4f3e14,_0x54145f[_0x822b('0x42')],util[_0x822b('0x40')](_0x822b('0xbc'),_0x54145f[_0x822b('0x42')],_0x54145f['id']));var _0x53b79f=null;return Interval[_0x822b('0xbd')](_0x40a03a,_0x4f3e14)[_0x822b('0x9d')](function(_0x3ff499){if(_0x3ff499===!![]){return _0x3ff499;}else{_0x54145f[_0x822b('0x64')]=_0x59c9ec?utils[_0x822b('0x65')][_0x822b('0xbe')]:utils['CAMPAIGN_STATUS']['OVERTIME_INTERVAL'];_0x53b79f=msgResponse('[ifTime][promiseAll]',_0x822b('0x91'),_0x822b('0xa6')+_0x59c9ec+'\x20'+_0x54145f[_0x822b('0x42')]+_0x822b('0xa7')+util[_0x822b('0x62')](_0x40a03a,{'showHidden':![],'depth':null})+_0x822b('0xa8')+_0x4f3e14);}if(_0x53b79f!==null){logger[_0x822b('0xba')](_0x822b('0xbf'),_0x53b79f);_0x53b79f[_0x822b('0xc0')]=_0x59c9ec;throw _0x53b79f;}})[_0x822b('0xa0')](function(_0x52a50e){logger[_0x822b('0x60')]('AMI\x20IfTime',_0x52a50e);throw msgResponse(_0x822b('0x82'),_0x822b('0xc1'),util[_0x822b('0x62')](_0x52a50e,{'showHidden':![],'depth':null}));});};Dialer[_0x822b('0x18')][_0x822b('0x29')]=function(_0x25abfd){if(this[_0x822b('0x1d')][_0x25abfd[_0x822b('0xc2')]]){if(this['uniqueId'][_0x25abfd['uniqueid']]&&this['uniqueId'][_0x25abfd['uniqueid']][_0x822b('0x3d')]!==_0x822b('0xc3')){this[_0x822b('0xc4')](this['voiceQueues'][_0x25abfd['queue']]);this[_0x822b('0x22')][_0x25abfd[_0x822b('0xc5')]][_0x822b('0xc6')]=moment()[_0x822b('0x40')](_0x822b('0xc7'));}}};Dialer['prototype']['syncAgentComplete']=function(_0xb6af9b){var _0xe087a6=this['uniqueId'][_0xb6af9b[_0x822b('0xc5')]];if(this['voiceQueues'][_0xb6af9b['queue']]){if(_0xe087a6&&_0xe087a6[_0x822b('0x3d')]!==_0x822b('0xc3')){delete this[_0x822b('0x22')][_0xb6af9b['uniqueid']];this[_0x822b('0x1d')][_0xb6af9b[_0x822b('0xc2')]][_0x822b('0xc8')]+=0x1;var _0x5ac28b=new AgentComplete(_0xe087a6,_0xb6af9b);if(_0xb6af9b['reason']==='agent'){_0x5ac28b[_0x822b('0xc9')]=this[_0x822b('0x1d')][_0xb6af9b[_0x822b('0xc2')]][_0x822b('0xca')]&&this[_0x822b('0x1d')][_0xb6af9b[_0x822b('0xc2')]]['dialAgiAfterHangupAgent']?moment()[_0x822b('0x40')](_0x822b('0xc7')):undefined;}hopperUtils[_0x822b('0xcb')](_0x5ac28b)[_0x822b('0xa0')](loggerCatch('[syncAgentComplete][createHistory]'));hopperUtils[_0x822b('0xcc')](_0x5ac28b)[_0x822b('0xa0')](loggerCatch(_0x822b('0xcd')));}}};Dialer[_0x822b('0x18')]['syncQueueCallerAbandon']=function(_0x4ea108){var _0x54c980=this[_0x822b('0x22')][_0x4ea108[_0x822b('0xc5')]];var _0x2691b2=this;var _0x349711=![];var _0x54ac2c;var _0x402f05;if(this['voiceQueues'][_0x4ea108[_0x822b('0xc2')]]){if(_0x54c980&&_0x54c980['type']!==_0x822b('0xc3')){delete this[_0x822b('0x22')][_0x4ea108[_0x822b('0xc5')]];this[_0x822b('0xc4')](this[_0x822b('0x1d')][_0x4ea108['queue']]);_0x54c980[_0x822b('0xce')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0xbc88f1=new QueueCallerAbandon(_0x54c980,_0x4ea108);if(utils[_0x822b('0xcf')](_0x54c980[_0x822b('0xce')],_0x54c980[_0x822b('0xd0')])>=_0x54c980[_0x822b('0xd1')]){this[_0x822b('0x1d')][_0x4ea108[_0x822b('0xc2')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x822b('0x1d')][_0x4ea108[_0x822b('0xc2')]][_0x822b('0xd2')]+=0x1;this[_0x822b('0x1d')][_0x4ea108[_0x822b('0xc2')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0xbc88f1['state']=0xa;_0xbc88f1['statedesc']=_0x822b('0xd3');_0xbc88f1[_0x822b('0xd4')]=_0x822b('0xd5');_0xbc88f1[_0x822b('0xc9')]=this[_0x822b('0x1d')][_0x4ea108[_0x822b('0xc2')]][_0x822b('0xca')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0xbc88f1[_0x822b('0xd6')]+=0x1;_0xbc88f1[_0x822b('0xd7')]+=0x1;_0x54ac2c=this[_0x822b('0x1d')][_0x4ea108['queue']][_0x822b('0xd8')];_0x402f05=this[_0x822b('0x1d')][_0x4ea108['queue']]['callAdditionalPhoneAfterMin'];hopperUtils['verifyAdditionalPhones'](_0xbc88f1,_0xbc88f1[_0x822b('0x6c')],_0x54c980[_0x822b('0xd9')])[_0x822b('0x9d')](function(_0x1aa7f2){_0x349711=_0x1aa7f2[_0x822b('0xda')]==0x1;if(_0xbc88f1['countdropretry']>=_0x2691b2[_0x822b('0x1d')][_0x4ea108[_0x822b('0xc2')]][_0x822b('0xdb')]){_0x2691b2[_0x822b('0xdc')](_0xbc88f1,_0x1aa7f2[_0x822b('0xda')]);}else{hopperUtils[_0x822b('0xdd')]({'active':![],'countdropretry':_0xbc88f1['countdropretry'],'scheduledat':moment()[_0x822b('0xde')](_0x2691b2[_0x822b('0x1d')][_0x4ea108['queue']]['dialDropRetryFrequency'],_0x822b('0xdf'))[_0x822b('0x40')](_0x822b('0xc7')),'ContactId':_0x54c980[_0x822b('0xe0')],'ListId':_0x54c980[_0x822b('0xe1')],'VoiceQueueId':_0x54c980['VoiceQueueId']||undefined,'CampaignId':_0x54c980[_0x822b('0xe2')]||undefined})['catch'](loggerCatch(_0x822b('0xe3')));var _0x5aa356=new History(_0xbc88f1);_0x5aa356[_0x822b('0x6c')]=0xa;_0x5aa356[_0x822b('0x6d')]=_0x822b('0xd3');_0x5aa356[_0x822b('0x6f')]=moment()[_0x822b('0x40')](_0x822b('0xc7'));_0x5aa356[_0x822b('0x6e')]=_0x5aa356[_0x822b('0x6f')];_0x5aa356[_0x822b('0xe4')]=_0xbc88f1['calleridname'];_0x5aa356[_0x822b('0xe5')]=_0xbc88f1['calleridnum'];hopperUtils['createHistory'](_0x5aa356)[_0x822b('0xa0')](loggerCatch(_0x822b('0xe6')));}})[_0x822b('0x9d')](function(){if(_0x349711)hopperUtils['swapAdditionalPhones'](_0xbc88f1,_0x54ac2c,_0x402f05)[_0x822b('0x9d')](function(){return 0x1;});});}else{this['voiceQueues'][_0x4ea108['queue']][_0x822b('0x49')]+=0x1;this['voiceQueues'][_0x4ea108['queue']][_0x822b('0xe7')]+=0x1;_0xbc88f1[_0x822b('0x6c')]=0xb;_0xbc88f1[_0x822b('0x6d')]=_0x822b('0xe8');_0xbc88f1[_0x822b('0xd4')]=_0x822b('0xe9');_0xbc88f1[_0x822b('0xea')]+=0x1;_0xbc88f1['countglobal']+=0x1;_0x54ac2c=this['voiceQueues'][_0x4ea108[_0x822b('0xc2')]][_0x822b('0xeb')];_0x402f05=this[_0x822b('0x1d')][_0x4ea108[_0x822b('0xc2')]][_0x822b('0xec')];hopperUtils[_0x822b('0xed')](_0xbc88f1,_0xbc88f1[_0x822b('0x6c')],_0x54c980[_0x822b('0xd9')])[_0x822b('0x9d')](function(_0x4f1a6a){if(_0xbc88f1[_0x822b('0xea')]>=_0x2691b2[_0x822b('0x1d')][_0x4ea108['queue']][_0x822b('0xee')]){_0x2691b2[_0x822b('0xdc')](_0xbc88f1,_0x4f1a6a['additional']);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0xbc88f1[_0x822b('0xea')],'scheduledat':moment()['add'](_0x2691b2[_0x822b('0x1d')][_0x4ea108[_0x822b('0xc2')]][_0x822b('0xeb')],_0x822b('0xdf'))[_0x822b('0x40')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x54c980[_0x822b('0xe0')],'ListId':_0x54c980[_0x822b('0xe1')],'VoiceQueueId':_0x54c980[_0x822b('0xef')]||undefined,'CampaignId':_0x54c980[_0x822b('0xe2')]||undefined})[_0x822b('0xa0')](loggerCatch(_0x822b('0xf0')));var _0x2540dc=new History(_0xbc88f1);_0x2540dc[_0x822b('0x6c')]=0xb;_0x2540dc[_0x822b('0x6d')]=_0x822b('0xe8');_0x2540dc[_0x822b('0x6f')]=moment()[_0x822b('0x40')]('YYYY-MM-DD\x20HH:mm:ss');_0x2540dc['endtime']=_0x2540dc[_0x822b('0x6f')];_0x2540dc[_0x822b('0xe4')]=_0xbc88f1[_0x822b('0xe4')];_0x2540dc[_0x822b('0xe5')]=_0xbc88f1[_0x822b('0xe5')];hopperUtils[_0x822b('0xcb')](_0x2540dc)[_0x822b('0xa0')](loggerCatch(_0x822b('0xf1')));}})[_0x822b('0x9d')](function(){if(_0x349711)hopperUtils[_0x822b('0xf2')](_0xbc88f1,_0x54ac2c,_0x402f05)[_0x822b('0x9d')](function(){return 0x1;});});}}}};Dialer[_0x822b('0x18')]['syncNewExten']=function(_0x2997b9){if(this[_0x822b('0xf3')][_0x2997b9[_0x822b('0xc5')]]){this[_0x822b('0xf3')][_0x2997b9[_0x822b('0xc5')]][_0x822b('0xf4')]=_0x2997b9[_0x822b('0xf4')];}if(this[_0x822b('0x22')][_0x2997b9[_0x822b('0xc5')]]){this[_0x822b('0x22')][_0x2997b9['uniqueid']][_0x822b('0xf4')]=_0x2997b9[_0x822b('0xf4')];}};Dialer[_0x822b('0x18')]['syncQueueMember']=function(_0x49ec33){if(!this['actions'][_0x49ec33[_0x822b('0xf5')]]){return;}var _0x554c09=this['voiceQueues'][this[_0x822b('0xf3')][_0x49ec33[_0x822b('0xf5')]][_0x822b('0xc2')]][_0x822b('0xf6')]||_0x822b('0xf7');if(_0x554c09==='roundrobin'){if(this[_0x822b('0xf3')][_0x49ec33[_0x822b('0xf5')]]&&_['isNil'](this['actions'][_0x49ec33[_0x822b('0xf5')]][_0x822b('0xf8')])&&_0x49ec33[_0x822b('0x88')]==='1'&&_0x49ec33[_0x822b('0xf9')]==='0'){if(this[_0x822b('0x1f')][_0x49ec33[_0x822b('0xfa')]]){if(!this['agents'][_0x49ec33[_0x822b('0xfa')]][_0x822b('0xf8')]){this[_0x822b('0x1f')][_0x49ec33['stateinterface']][_0x822b('0xf8')]=!![];this[_0x822b('0xf3')][_0x49ec33[_0x822b('0xf5')]][_0x822b('0xf8')]=!![];this[_0x822b('0xf3')][_0x49ec33[_0x822b('0xf5')]][_0x822b('0xfa')]=_0x49ec33['stateinterface'];}}}}else if(_0x554c09===_0x822b('0xf7')){if(this[_0x822b('0xf3')][_0x49ec33[_0x822b('0xf5')]]){if(this[_0x822b('0x1f')][_0x49ec33[_0x822b('0xfa')]]){this[_0x822b('0xf3')][_0x49ec33[_0x822b('0xf5')]][_0x822b('0xfa')]=_0x49ec33['stateinterface'];if(_[_0x822b('0xfb')](this[_0x822b('0x26')][this['actions'][_0x49ec33[_0x822b('0xf5')]][_0x822b('0xc2')]])){this['queueBooked'][this[_0x822b('0xf3')][_0x49ec33['actionid']][_0x822b('0xc2')]]=[];}this[_0x822b('0x26')][this[_0x822b('0xf3')][_0x49ec33[_0x822b('0xf5')]]['queue']]['push'](_[_0x822b('0x5b')](_[_0x822b('0x73')](this[_0x822b('0xf3')][_0x49ec33['actionid']],[_0x822b('0xfc'),_0x822b('0xfa')]),{'status':_0x49ec33[_0x822b('0x88')],'paused':_0x49ec33[_0x822b('0xf9')]}));}}}};Dialer['prototype']['syncQueueStatusComplete']=function(_0x386221){if(!this['actions'][_0x386221[_0x822b('0xf5')]]){return;}var _0x241b1f=this;var _0x153d9f=this[_0x822b('0x1d')][this['actions'][_0x386221[_0x822b('0xf5')]][_0x822b('0xc2')]];var _0x40ff98=_0x153d9f['strategy']||_0x822b('0xf7');if(_0x40ff98===_0x822b('0xfd')){if(this['actions'][_0x386221['actionid']]&&this[_0x822b('0xf3')][_0x386221['actionid']][_0x822b('0xfa')]){this[_0x822b('0x1c')][_0x822b('0xfe')](this['actions'][_0x386221['actionid']]['idHopper'],this[_0x822b('0xf3')][_0x386221[_0x822b('0xf5')]][_0x822b('0xfa')])[_0x822b('0xa0')](function(_0x3e6e9c){logger[_0x822b('0x60')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x822b('0x62')](_0x3e6e9c,{'showHidden':![],'depth':null}));})['finally'](function(){_0x241b1f[_0x822b('0xc4')](_0x241b1f['voiceQueues'][_0x241b1f[_0x822b('0xf3')][_0x386221[_0x822b('0xf5')]][_0x822b('0xc2')]]);_0x241b1f[_0x822b('0x1f')][_0x241b1f[_0x822b('0xf3')][_0x386221[_0x822b('0xf5')]][_0x822b('0xfa')]]['locked']=![];delete _0x241b1f[_0x822b('0xf3')][_0x386221[_0x822b('0xf5')]];unlockQueueStatus(_0x153d9f);});}else{this['updateOriginated'](this['voiceQueues'][this[_0x822b('0xf3')][_0x386221[_0x822b('0xf5')]][_0x822b('0xc2')]]);hopperUtils[_0x822b('0xdd')]({'active':![],'ContactId':this[_0x822b('0xf3')][_0x386221[_0x822b('0xf5')]][_0x822b('0xe0')],'ListId':this[_0x822b('0xf3')][_0x386221[_0x822b('0xf5')]][_0x822b('0xe1')],'VoiceQueueId':this['actions'][_0x386221[_0x822b('0xf5')]][_0x822b('0xef')]||undefined,'CampaignId':this[_0x822b('0xf3')][_0x386221['actionid']][_0x822b('0xe2')]||undefined})[_0x822b('0xa0')](loggerCatch(_0x822b('0xff')));delete this[_0x822b('0xf3')][_0x386221[_0x822b('0xf5')]];unlockQueueStatus(_0x153d9f);}}else if(_0x40ff98==='rrmemory'){var _0x3b35fc;if(this[_0x822b('0xf3')][_0x386221[_0x822b('0xf5')]]&&!_[_0x822b('0x44')](this['queueBooked'][this[_0x822b('0xf3')][_0x386221['actionid']]['queue']])){if(this[_0x822b('0x100')][_0x241b1f['actions'][_0x386221['actionid']][_0x822b('0xc2')]]){this[_0x822b('0x100')][_0x241b1f[_0x822b('0xf3')][_0x386221['actionid']]['queue']]=this[_0x822b('0x100')][this[_0x822b('0xf3')][_0x386221[_0x822b('0xf5')]][_0x822b('0xc2')]]?this[_0x822b('0x100')][this[_0x822b('0xf3')][_0x386221[_0x822b('0xf5')]][_0x822b('0xc2')]]:this[_0x822b('0x26')][this[_0x822b('0xf3')][_0x386221['actionid']][_0x822b('0xc2')]]?this[_0x822b('0x26')][this[_0x822b('0xf3')][_0x386221[_0x822b('0xf5')]][_0x822b('0xc2')]][_0x822b('0x101')]||0x0:0x0;}this[_0x822b('0x26')][this[_0x822b('0xf3')][_0x386221[_0x822b('0xf5')]][_0x822b('0xc2')]][_0x822b('0x101')]=this['queueBookedRR'][this[_0x822b('0xf3')][_0x386221[_0x822b('0xf5')]][_0x822b('0xc2')]];for(var _0x122882=0x0;_0x122882=_0x100dcf['dialGlobalMaxRetry']){_0x22737b[_0x822b('0x129')](_0x58bb5e,_0x7b1c2f,_0x3b03e0,_0x822b('0x12a'));}else{if(_0x58bb5e[_0x822b('0x122')]>=_0x100dcf[_0x822b('0x12b')]){_0x22737b[_0x822b('0x12c')](_0x58bb5e,_0x7b1c2f,_0x3b03e0,_0x822b('0x12d'));}else{hopperUtils[_0x822b('0xdd')]({'active':![],'countmachineretry':_0x58bb5e[_0x822b('0x122')],'scheduledat':moment()[_0x822b('0xde')](_0x100dcf['dialMachineRetryFrequency'],_0x822b('0xdf'))[_0x822b('0x40')](_0x822b('0xc7')),'ContactId':_0x58bb5e[_0x822b('0xe0')],'ListId':_0x58bb5e[_0x822b('0xe1')],'VoiceQueueId':_0x58bb5e[_0x822b('0xef')]||undefined,'CampaignId':_0x58bb5e[_0x822b('0xe2')]||undefined})[_0x822b('0xa0')](loggerCatch('[rescheduleContact][Machine]'));_0x7b1c2f({'reschedule':0x1});}}});}if(_0x56a82b['type']===_0x822b('0xc3')&&this[_0x822b('0x1e')][_0x56a82b['queue']]['dialAMDActive']&&_0x53ad2d['value']===_0x822b('0x117')){delete this['uniqueId'][_0x53ad2d[_0x822b('0xc5')]];this[_0x822b('0xc4')](this['campaigns'][_0x56a82b['queue']]);_0x8cbf01=new Hangup(_0x56a82b,_0x53ad2d);_0x8cbf01[_0x822b('0x6c')]=0x12;_0x8cbf01[_0x822b('0x6d')]=_0x822b('0x119');_0x8cbf01[_0x822b('0x11a')]='AMD';ami[_0x822b('0x123')](_0x822b('0x11b'),ut['buildObj'](_0x8cbf01,_0x822b('0x124')));this['saveInDb'](_0x8cbf01,'[syncHangupInAMDIvr][createHistory]',_0x822b('0x12e'));}if(_0x56a82b[_0x822b('0x3d')]===_0x822b('0xc3')&&this[_0x822b('0x1e')][_0x56a82b[_0x822b('0xc2')]][_0x822b('0x11e')]&&_0x53ad2d[_0x822b('0x116')]===_0x822b('0x11f')){return new Promise(function(_0x8bf226,_0x3b97b2){delete _0x22737b[_0x822b('0x22')][_0x53ad2d[_0x822b('0xc5')]];_0x22737b[_0x822b('0xc4')](_0x22737b[_0x822b('0x1e')][_0x56a82b[_0x822b('0xc2')]]);_0x22737b[_0x822b('0x1e')][_0x56a82b['queue']][_0x822b('0xc8')]+=0x1;_0x22737b[_0x822b('0x1e')][_0x56a82b[_0x822b('0xc2')]][_0x822b('0x118')]+=0x1;var _0x3eea42=_0x22737b[_0x822b('0x1e')][_0x56a82b[_0x822b('0xc2')]];var _0x4a9b4e=new Hangup(_0x56a82b,_0x53ad2d);_0x4a9b4e['state']=0x13;_0x4a9b4e['statedesc']='Machine';_0x4a9b4e[_0x822b('0x11a')]=_0x822b('0x121');_0x4a9b4e['countmachineretry']+=0x1;_0x4a9b4e[_0x822b('0xd7')]+=0x1;_0x4a9b4e[_0x822b('0x124')]=!![];ami['emit'](_0x822b('0x11b'),ut['buildObj'](_0x4a9b4e,_0x822b('0x124')));hopperUtils['createHistory'](_0x4a9b4e)[_0x822b('0xa0')](loggerCatch(_0x822b('0x125')));if(_0x4a9b4e[_0x822b('0x126')]+_0x4a9b4e['countcongestionretry']+_0x4a9b4e[_0x822b('0x127')]+_0x4a9b4e[_0x822b('0x12f')]+_0x4a9b4e['countdropretry']+_0x4a9b4e[_0x822b('0xea')]+_0x4a9b4e['countmachineretry']+_0x4a9b4e[_0x822b('0x128')]>=_0x3eea42[_0x822b('0x130')]){_0x22737b[_0x822b('0x129')](_0x4a9b4e,_0x8bf226,_0x3b97b2,'reason19\x20machine....');}else{if(_0x4a9b4e['countmachineretry']>=_0x3eea42['dialMachineMaxRetry']){_0x22737b['createStateFinal'](_0x4a9b4e,_0x8bf226,_0x3b97b2,_0x822b('0x12d'));}else{hopperUtils[_0x822b('0xdd')]({'active':![],'countmachineretry':_0x4a9b4e[_0x822b('0x122')],'scheduledat':moment()[_0x822b('0xde')](_0x3eea42['dialMachineRetryFrequency'],_0x822b('0xdf'))[_0x822b('0x40')](_0x822b('0xc7')),'ContactId':_0x4a9b4e['ContactId'],'ListId':_0x4a9b4e[_0x822b('0xe1')],'VoiceQueueId':_0x4a9b4e[_0x822b('0xef')]||undefined,'CampaignId':_0x4a9b4e[_0x822b('0xe2')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x8bf226({'reschedule':0x1});}}});}}};Dialer[_0x822b('0x18')][_0x822b('0x32')]=function(_0xfb6f83){var _0x31100b=this['uniqueId'][_0xfb6f83[_0x822b('0xc5')]];var _0x38e1d3;if(_0x31100b&&_0x31100b['type']===_0x822b('0xc3')){delete this[_0x822b('0x22')][_0xfb6f83['uniqueid']];this[_0x822b('0xc4')](this[_0x822b('0x1e')][_0x31100b[_0x822b('0xc2')]]);this['campaigns'][_0x31100b[_0x822b('0xc2')]]['ivrAnswerCallsDay']+=0x1;_0x38e1d3=new Hangup(_0x31100b,_0xfb6f83);hopperUtils[_0x822b('0xcb')](_0x38e1d3)['catch'](loggerCatch(_0x822b('0x131')));hopperUtils[_0x822b('0xcc')](_0x38e1d3)[_0x822b('0xa0')](loggerCatch(_0x822b('0x132')));}if(_0x31100b&&_0x31100b['type']!=='ivr'&&isNotNull(this['voiceQueues'][_0x31100b[_0x822b('0xc2')]][_0x822b('0x133')])){delete this[_0x822b('0x22')][_0xfb6f83['uniqueid']];this['updateOriginated'](this['voiceQueues'][_0x31100b[_0x822b('0xc2')]]);this[_0x822b('0x1d')][_0x31100b[_0x822b('0xc2')]]['outboundAnswerCallsDay']+=0x1;this[_0x822b('0x1d')][_0x31100b['queue']][_0x822b('0x118')]+=0x1;_0x38e1d3=new Hangup(_0x31100b,_0xfb6f83);_0x38e1d3['state']=0x10;_0x38e1d3['statedesc']='AnswerAGI';_0x38e1d3['membername']=_0x822b('0x134');hopperUtils[_0x822b('0xcb')](_0x38e1d3)[_0x822b('0xa0')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x822b('0xcc')](_0x38e1d3)['catch'](loggerCatch(_0x822b('0x132')));}if(_0x31100b&&_0x31100b[_0x822b('0x3d')]!==_0x822b('0xc3')&&!isNotNull(this['voiceQueues'][_0x31100b['queue']][_0x822b('0x133')])){if(_0xfb6f83[_0x822b('0x135')]===_0x822b('0x136')){delete this[_0x822b('0x22')][_0xfb6f83[_0x822b('0xc5')]];this[_0x822b('0x1d')][_0x31100b[_0x822b('0xc2')]][_0x822b('0xc8')]+=0x1;const _0x386021=new AgentComplete(_0x31100b,_0xfb6f83);_0x386021[_0x822b('0xe2')]=this[_0x822b('0x1d')][_0x31100b[_0x822b('0xc2')]]['id'];hopperUtils[_0x822b('0xcb')](_0x386021)['catch'](loggerCatch(_0x822b('0x137')));hopperUtils[_0x822b('0xcc')](_0x386021)[_0x822b('0xa0')](loggerCatch(_0x822b('0xcd')));}else{delete this['uniqueId'][_0xfb6f83[_0x822b('0xc5')]];this[_0x822b('0xc4')](this[_0x822b('0x1d')][_0x31100b[_0x822b('0xc2')]]);this[_0x822b('0x1d')][_0x31100b[_0x822b('0xc2')]][_0x822b('0x138')]+=0x1;_0x38e1d3=new Hangup(_0x31100b,_0xfb6f83);_0x38e1d3[_0x822b('0x6c')]=0xc;_0x38e1d3['statedesc']=_0xfb6f83[_0x822b('0x135')];_0x38e1d3[_0x822b('0x11a')]=_0x822b('0x139');hopperUtils[_0x822b('0xcb')](_0x38e1d3)[_0x822b('0xa0')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils[_0x822b('0xcc')](_0x38e1d3)[_0x822b('0xa0')](loggerCatch(_0x822b('0x132')));}}};Dialer['prototype'][_0x822b('0x9')]=function(_0x14f3b2){var _0x345511=this;if(!_0x345511[_0x822b('0x27')][_0x14f3b2['name']]){_0x345511[_0x822b('0x27')][_0x14f3b2[_0x822b('0x42')]]={'running':![]};}else if(_0x345511[_0x822b('0x27')][_0x14f3b2[_0x822b('0x42')]][_0x822b('0x13a')]===!![]){return;}else if(_0x345511[_0x822b('0x27')][_0x14f3b2['name']][_0x822b('0x13a')]===![]){_0x345511[_0x822b('0x27')][_0x14f3b2['name']]['running']=!![];}var _0x589702=_0x345511[_0x822b('0x1d')][_0x14f3b2[_0x822b('0x42')]];var _0x34d1d4=_0x589702[_0x822b('0x64')]!==utils[_0x822b('0x65')][_0x822b('0x78')];var _0x5106ec=utils[_0x822b('0x13b')](_0x589702);_0x589702['statusMessage']=utils[_0x822b('0x13c')](_0x589702,_0x345511['trunks']);Promise[_0x822b('0xac')]()[_0x822b('0x9d')](function(){if(_0x589702[_0x822b('0x13d')]===utils[_0x822b('0x65')][_0x822b('0x78')]){if(_0x34d1d4){clearPredictiveAttributes(_0x589702);_0x14f3b2[_0x822b('0x23')]=undefined;_0x14f3b2[_0x822b('0x24')]=undefined;}if(_0x589702[_0x822b('0x13d')]===utils[_0x822b('0x65')]['INACTIVE']){_0x14f3b2[_0x822b('0x13e')]=0x0;_0x14f3b2[_0x822b('0xf9')]=0x0;_0x14f3b2[_0x822b('0x13f')]=0x0;_0x14f3b2[_0x822b('0x140')]=0x0;_0x14f3b2[_0x822b('0x141')]=0x0;}}else if(_0x589702[_0x822b('0x13d')]===utils[_0x822b('0x65')]['ACTIVE']&&!_0x5106ec){return _0x345511[_0x822b('0x90')](_0x589702,!![])['then'](function(){return _0x345511[_0x822b('0x90')](_0x589702,![]);})['then'](function(){return _0x345511['checkDialMethod'](_0x589702);})[_0x822b('0xa0')](function(_0x8ce7f0){loggerSyncQueueSummary['debug'](_0x822b('0x142'),util[_0x822b('0x62')](_0x8ce7f0,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x589702);});}else{clearPredictiveAttributes(_0x589702);}})[_0x822b('0x9d')](function(){var _0x28b80f=_0x14f3b2[_0x822b('0x143')](_0x589702);if(_0x28b80f||_0x589702[_0x822b('0x144')]){_0x589702[_0x822b('0x144')]=![];_0x14f3b2[_0x822b('0x145')](_0x589702);Object['assign'](_0x589702,_0x14f3b2);emitOutboundVoiceQueueSummary(_0x14f3b2);}_0x345511['queuesSummary'][_0x589702['name']][_0x822b('0x13a')]=![];})['catch'](function(_0x2be98f){logger[_0x822b('0x60')](_0x822b('0x142'),util[_0x822b('0x62')](_0x2be98f,{'showHidden':![],'depth':null}));_0x345511[_0x822b('0x27')][_0x589702[_0x822b('0x42')]]['running']=![];});};Dialer['prototype'][_0x822b('0x146')]=_['throttle'](function(){var _0xa687b1=_[_0x822b('0x147')](this['voiceQueues'],function(_0x4126a7){return _0x4126a7[_0x822b('0x148')];});var _0x31c2c6=_['filter'](this[_0x822b('0x1f')],function(_0x37e8cb){return _0x37e8cb[_0x822b('0x149')]&&_0x37e8cb[_0x822b('0x88')]==='reachable';});if(_0xa687b1[_0x822b('0x99')]>0x0&&_0x31c2c6['length']>0x0){return Promise[_0x822b('0xac')]()[_0x822b('0x9d')](cmHopper['handlePreviewRecallNotifications'](_[_0x822b('0x14a')](_0xa687b1,'id'),previewRecallmeReminderInterval,_[_0x822b('0x14a')](_0x31c2c6,'id')))[_0x822b('0x9d')](function(_0x50e149){for(var _0x21213e=0x0;_0x21213e<_0x50e149['length'];_0x21213e++){var _0x5383ba=_0x50e149[_0x21213e][_0x822b('0x14b')][_0x822b('0x42')];if(_0x5383ba)io['to'](util[_0x822b('0x40')]('user:%s',_0x5383ba))[_0x822b('0x123')]('user:dialPreviewRecallReminder',{'hopper':_0x50e149[_0x21213e]});}})[_0x822b('0xa0')](function(_0x12a9b4){logger['error'](_0x822b('0x14c'),_0x12a9b4);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0x822b('0x3a')]=function(){var _0x20b419=this;setInterval(function(){_0x20b419[_0x822b('0x14d')](_0x20b419['uniqueId'],_0x822b('0x14e'));_0x20b419['clearZombieChannels'](_0x20b419['actions'],_0x822b('0x14f'));},0x32c8);};Dialer[_0x822b('0x18')][_0x822b('0x14d')]=function(_0x1efbbe,_0x255c25){var _0x12b74a=this;for(var _0x33c2a7 in _0x1efbbe){if(typeof _0x1efbbe[_0x33c2a7]!==_0x822b('0xab')){this[_0x822b('0x1b')][_0x822b('0x19')](function(){if(!_['isNil'](_0x1efbbe[_0x33c2a7])){return ami[_0x822b('0x9a')]({'action':_0x822b('0x88'),'channel':_0x1efbbe[_0x33c2a7][_0x822b('0xf4')]})['catch'](function(_0x27adb6){if(_0x27adb6[_0x822b('0x64')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x1efbbe[_0x33c2a7]&&_0x1efbbe[_0x33c2a7][_0x822b('0x3d')]!==_0x822b('0xc3')){_0x12b74a[_0x822b('0xc4')](_0x12b74a[_0x822b('0x1d')][_0x1efbbe[_0x33c2a7]['queue']]);logger['error'](_0x822b('0x150'),_0x255c25,_0x33c2a7,_0x1efbbe[_0x33c2a7][_0x822b('0xc2')]);delete _0x1efbbe[_0x33c2a7];}if(_0x1efbbe[_0x33c2a7]&&_0x1efbbe[_0x33c2a7][_0x822b('0x3d')]===_0x822b('0xc3')){_0x12b74a['updateOriginated'](_0x12b74a[_0x822b('0x1e')][_0x1efbbe[_0x33c2a7]['queue']]);logger['error'](_0x822b('0x151'),_0x255c25,_0x33c2a7,_0x1efbbe[_0x33c2a7][_0x822b('0xc2')]);delete _0x1efbbe[_0x33c2a7];}},0x2328);}});}});}}};Dialer['prototype'][_0x822b('0x152')]=function(_0x6c8b09){return Promise[_0x822b('0xac')]()[_0x822b('0x9d')](voiceQueueRt['getVoiceQueueRtPauses'](_0x6c8b09))[_0x822b('0xa0')](loggerCatch(_0x822b('0x153')));};Dialer['prototype'][_0x822b('0xc4')]=function(_0x1ad7a0){if(!_[_0x822b('0x4e')](_0x1ad7a0)&&_0x1ad7a0!==null){if(typeof _0x1ad7a0['originated']!==_0x822b('0xab')){if(_0x1ad7a0['originated']>0x0){_0x1ad7a0[_0x822b('0x7c')]-=0x1;}else{logger[_0x822b('0x60')](_0x822b('0x154'));}}}else{logger[_0x822b('0x60')](_0x822b('0x155'));}};Dialer['prototype']['loggerHandler']=function(_0x1263ea,_0x3e03c2){var _0x430edf=this;return function(_0x507f08){_0x430edf[_0x822b('0xc4')](_0x3e03c2);logger[_0x822b('0x60')](_0x1263ea,util[_0x822b('0x62')](_0x507f08,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x822b('0x156')]=function(_0x5a194d,_0xfc902b,_0x40c6fb){var _0x13c2d8={'state':0x19,'statedesc':_0x822b('0x157')};this[_0x822b('0xc4')](_0xfc902b);this[_0x822b('0x158')](_[_0x822b('0x5b')](_0x13c2d8,_[_0x822b('0x73')](_0x40c6fb,['ContactId',_0x822b('0xe1'),_0x822b('0x159'),_0x822b('0xef'),_0x822b('0xe2')])),_0x822b('0x15a'),_0x822b('0x15b'));logger['error'](_0x5a194d);};Dialer[_0x822b('0x18')][_0x822b('0x158')]=function(_0x3c84c6,_0x47a796,_0x234c53){hopperUtils['createHistory'](_0x3c84c6)[_0x822b('0xa0')](loggerCatch(_0x47a796));hopperUtils[_0x822b('0xcc')](_0x3c84c6)[_0x822b('0xa0')](loggerCatch(_0x234c53));};Dialer[_0x822b('0x18')][_0x822b('0xdc')]=function(_0x57e813,_0x2d8575){hopperUtils[_0x822b('0xcb')](_0x57e813)['catch'](loggerCatch(_0x822b('0x137')));if(_0x2d8575==0x0){hopperUtils['moveContactManagedDialer'](_0x57e813)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0x822b('0x18')][_0x822b('0x14c')]=function(_0x30a22a){return Promise['resolve']()[_0x822b('0x9d')](cmHopper[_0x822b('0x15c')](_0x30a22a['id'],previewRecallmeReminderInterval))['then'](function(_0x5760c3){for(var _0x16a755=0x0;_0x16a755<_0x5760c3['length'];_0x16a755++){var _0x4157c8=_0x5760c3[_0x16a755]['Agent'][_0x822b('0x42')];if(_0x4157c8)io['to'](util[_0x822b('0x40')]('user:%s',_0x4157c8))['emit'](_0x822b('0x15d'),{'hopper':_0x5760c3[_0x16a755]});}})[_0x822b('0xa0')](function(){});};Dialer[_0x822b('0x18')][_0x822b('0xaf')]=function(_0x181ee4){var _0x50d7ec=this;return function(){_0x50d7ec[_0x822b('0x15e')](_0x181ee4);};};Dialer['prototype'][_0x822b('0x15f')]=function(_0x351fd8,_0x1d0a3c){var _0x488245=this;var _0x5f228c=uuid['v4']();this[_0x822b('0xf3')][_0x5f228c]=new Action(_0x351fd8,_0x1d0a3c,_0x5f228c);return new Promise(function(_0x5c051b,_0x41f2c9){if(_[_0x822b('0x4e')](_0x351fd8)&&typeof _0x351fd8!==_0x822b('0x160')){return _0x41f2c9(msgResponse(_0x822b('0x161'),_0x822b('0x91'),_0x822b('0x162')));}if(_[_0x822b('0x4e')](_0x1d0a3c['phone'])||_0x1d0a3c[_0x822b('0x163')]===null){return _0x41f2c9(msgResponse(_0x822b('0x161'),'Failure','contact\x20is\x20undefine'));}var _0x2ea360={'XMD-CALLERID':_0x488245[_0x822b('0xf3')][_0x5f228c][_0x822b('0x164')](),'XMD-AGI':_0x351fd8[_0x822b('0x133')]?util[_0x822b('0x40')](_0x822b('0x165'),ipAgi,_0x351fd8[_0x822b('0x133')]):_0x822b('0x166'),'XMD-AGIAFTER':_0x351fd8[_0x822b('0xca')]?util['format'](_0x822b('0x165'),ipAgi,_0x351fd8[_0x822b('0xca')]):_0x822b('0x166'),'XMD-QUEUE':utils[_0x822b('0x167')](_0x351fd8)?util[_0x822b('0x40')]('\x22%s,%s%s,,,%s\x22',_0x351fd8['name'],_0x351fd8[_0x822b('0x168')]||'',_0x351fd8[_0x822b('0x169')]?'c':'',_0x351fd8['dialQueueTimeout']||0x3):_0x822b('0x166'),'XMD-CONTACTID':_0x1d0a3c[_0x822b('0xe0')],'XMD-CDRTYPE':_0x822b('0x16a'),'CALLERID(all)':_0x488245[_0x822b('0xf3')][_0x5f228c][_0x822b('0x164')](),'XMD-AMD':_0x351fd8[_0x822b('0x11e')]?_0x822b('0x16b'):'NONE','XMD-DESTINATION':_0x822b('0x115')};if(_0x351fd8[_0x822b('0x11e')]){_0x2ea360[_0x822b('0x16c')]=_0x351fd8['dialAMDInitialSilence']||0x9c4;_0x2ea360[_0x822b('0x16d')]=_0x351fd8[_0x822b('0x16e')]||0x5dc;_0x2ea360[_0x822b('0x16f')]=_0x351fd8['dialAMDAfterGreetingSilence']||0x320;_0x2ea360[_0x822b('0x170')]=_0x351fd8[_0x822b('0x171')]||0x1388;_0x2ea360[_0x822b('0x172')]=_0x351fd8['dialAMDMinWordLength']||0x64;_0x2ea360['XMD-AMDBETWEENWORDSSILENCE']=_0x351fd8['dialAMDBetweenWordsSilence']||0x32;_0x2ea360[_0x822b('0x173')]=_0x351fd8[_0x822b('0x174')]||0x3;_0x2ea360['XMD-AMDSILENCETHRESHOLD']=_0x351fd8['dialAMDSilenceThreshold']||0x100;_0x2ea360[_0x822b('0x175')]=_0x351fd8[_0x822b('0x176')]||0x1388;}if(utils[_0x822b('0x167')](_0x351fd8)){_0x2ea360[_0x822b('0x177')]=_0x1d0a3c['VoiceQueueId'];}else{_0x2ea360[_0x822b('0x178')]=_0x1d0a3c[_0x822b('0xe2')];}var _0x4fa8f9=utils[_0x822b('0x179')](_0x1d0a3c[_0x822b('0x17a')]);Object[_0x822b('0x17b')](_0x2ea360,_0x4fa8f9);var _0xc0495f=_0x488245[_0x822b('0x83')](_0x351fd8[_0x822b('0x8a')])?utils[_0x822b('0x17c')](_0x351fd8[_0x822b('0x8a')][_0x822b('0x17d')],_0x351fd8[_0x822b('0x17e')],_0x351fd8[_0x822b('0x17f')]>0x0?utils['getCallerIdRandom'](_0x351fd8[_0x822b('0x180')],_0x351fd8[_0x822b('0x17f')]):_0x351fd8[_0x822b('0x180')]):utils[_0x822b('0x17c')](_['isNil'](_0x351fd8[_0x822b('0x181')])?_0x351fd8[_0x822b('0x8a')][_0x822b('0x17d')]:_0x351fd8[_0x822b('0x181')][_0x822b('0x17d')],_0x351fd8[_0x822b('0x17e')],_0x351fd8[_0x822b('0x17f')]>0x0?utils[_0x822b('0x182')](_0x351fd8[_0x822b('0x180')],_0x351fd8['dialRandomLastDigitCallerIdNumber']):_0x351fd8[_0x822b('0x180')]);if(_0xc0495f){_0x2ea360[_0x822b('0x183')]=_0x488245['actions'][_0x5f228c]['originatecalleridname']=utils['extractCalleridName'](_0xc0495f);_0x2ea360['XMD-ORIGINATECALLERIDNUM']=_0x1d0a3c[_0x822b('0x163')];}_0x351fd8[_0x822b('0x184')]=_0x2ea360;return ami[_0x822b('0x9a')]({'actionid':_0x5f228c,'action':_0x822b('0x161'),'channel':_0x488245[_0x822b('0x83')](_0x351fd8[_0x822b('0x8a')])?util[_0x822b('0x40')](_0x822b('0x185'),_0x351fd8[_0x822b('0x8a')][_0x822b('0x42')],isNotNull(_0x351fd8['dialPrefix'])?_0x351fd8[_0x822b('0x186')][_0x822b('0x187')]()||'':'',_0x351fd8['dialCutDigit']>0x0?_0x1d0a3c[_0x822b('0x163')][_0x822b('0x188')](_0x351fd8[_0x822b('0x189')]):_0x1d0a3c[_0x822b('0x163')]):util[_0x822b('0x40')](_0x822b('0x185'),_['isNil'](_0x351fd8[_0x822b('0x181')])?_0x351fd8[_0x822b('0x8a')]['name']:_0x351fd8[_0x822b('0x181')][_0x822b('0x42')],isNotNull(_0x351fd8[_0x822b('0x186')])?_0x351fd8[_0x822b('0x186')][_0x822b('0x187')]()||'':'',_0x351fd8[_0x822b('0x189')]>0x0?_0x1d0a3c[_0x822b('0x163')][_0x822b('0x188')](_0x351fd8[_0x822b('0x189')]):_0x1d0a3c[_0x822b('0x163')]),'callerid':_0xc0495f,'Exten':_0x822b('0x115'),'Context':_0x822b('0x18a'),'Priority':'1','variable':_0x2ea360,'timeout':(_0x351fd8[_0x822b('0x18b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5f228c})[_0x822b('0x9d')](function(_0x2657d5){return _0x5c051b(_0x2657d5);})[_0x822b('0xa0')](function(_0x10e4cd){_0x351fd8[_0x822b('0x18c')]+=0x1;var _0x2bd21f=new History(_0x488245[_0x822b('0xf3')][_0x5f228c]);logger[_0x822b('0x60')](util['format'](_0x822b('0x18d'),JSON['stringify'](_0x10e4cd)));_0x2bd21f[_0x822b('0x6c')]=0xe;_0x2bd21f[_0x822b('0x6d')]=_0x822b('0x18e');_0x2bd21f['starttime']=moment()[_0x822b('0x40')](_0x822b('0xc7'));_0x2bd21f['endtime']=_0x2bd21f[_0x822b('0x6f')];hopperUtils[_0x822b('0xcb')](_0x2bd21f)[_0x822b('0xa0')](loggerCatch(_0x822b('0x18f')));_0x488245['moveContactManagedDialer'](_0x2bd21f)[_0x822b('0xa0')](loggerCatch(_0x822b('0x18f')))[_0x822b('0x107')](function(){delete _0x488245[_0x822b('0xf3')][_0x5f228c];return _0x41f2c9(msgResponse(_0x822b('0x161'),_0x822b('0xc1'),_0x822b('0x190')));});});});};Dialer[_0x822b('0x18')][_0x822b('0x191')]=function(_0x53ccf3,_0xda08c3,_0x31b6c9){var _0x588244=new History(_0xda08c3);if(_0x588244[_0x822b('0x126')]+_0x588244[_0x822b('0x192')]+_0x588244['countnoanswerretry']+_0x588244['countnosuchnumberretry']+_0x588244[_0x822b('0xd6')]+_0x588244['countabandonedretry']+_0x588244[_0x822b('0x122')]+_0x588244[_0x822b('0x128')]>=_0x31b6c9[_0x822b('0x130')]-0x1){return!![];}switch(_0x53ccf3){case 0x3:if(_0x588244['countnoanswerretry']>=_0x31b6c9[_0x822b('0x193')]-0x1){return!![];}hopperUtils[_0x822b('0xdd')]({'active':![],'countnoanswerretry':_0x588244['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x822b('0xde')](_0x31b6c9[_0x822b('0x194')],'minutes')[_0x822b('0x40')](_0x822b('0xc7')),'ContactId':_0x588244['ContactId'],'ListId':_0x588244['ListId'],'VoiceQueueId':_0x588244[_0x822b('0xef')]||undefined,'CampaignId':_0x588244['CampaignId']||undefined})['catch'](loggerCatch(_0x822b('0x195')));break;case 0x5:if(_0x588244['countbusyretry']>=_0x31b6c9[_0x822b('0x196')]-0x1){return!![];}hopperUtils[_0x822b('0xdd')]({'active':![],'countbusyretry':_0x588244[_0x822b('0x126')]+=0x1,'scheduledat':moment()['add'](_0x31b6c9[_0x822b('0x197')],_0x822b('0xdf'))['format'](_0x822b('0xc7')),'ContactId':_0x588244[_0x822b('0xe0')],'ListId':_0x588244[_0x822b('0xe1')],'VoiceQueueId':_0x588244[_0x822b('0xef')]||undefined,'CampaignId':_0x588244['CampaignId']||undefined})[_0x822b('0xa0')](loggerCatch(_0x822b('0x198')));break;case 0x8:if(_0x588244['countcongestionretry']>=_0x31b6c9[_0x822b('0x199')]-0x1){return!![];}hopperUtils[_0x822b('0xdd')]({'active':![],'countcongestionretry':_0x588244[_0x822b('0x192')]+=0x1,'scheduledat':moment()['add'](_0x31b6c9[_0x822b('0x19a')],_0x822b('0xdf'))[_0x822b('0x40')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x588244[_0x822b('0xe0')],'ListId':_0x588244['ListId'],'VoiceQueueId':_0x588244[_0x822b('0xef')]||undefined,'CampaignId':_0x588244['CampaignId']||undefined})[_0x822b('0xa0')](loggerCatch(_0x822b('0x19b')));break;case 0x0:if(_0x588244[_0x822b('0x12f')]>=_0x31b6c9[_0x822b('0x19c')]-0x1){return!![];}else{hopperUtils[_0x822b('0xdd')]({'active':![],'countnosuchnumberretry':_0x588244[_0x822b('0x12f')]+=0x1,'scheduledat':moment()[_0x822b('0xde')](_0x31b6c9['dialNoSuchNumberRetryFrequency'],_0x822b('0xdf'))[_0x822b('0x40')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x588244[_0x822b('0xe0')],'ListId':_0x588244[_0x822b('0xe1')],'VoiceQueueId':_0x588244['VoiceQueueId']||undefined,'CampaignId':_0x588244[_0x822b('0xe2')]||undefined})[_0x822b('0xa0')](loggerCatch(_0x822b('0x19d')));}break;case 0xa:if(_0x588244[_0x822b('0xd6')]>=_0x31b6c9[_0x822b('0xdb')]-0x1){return!![];}hopperUtils[_0x822b('0xdd')]({'active':![],'countdropretry':_0x588244[_0x822b('0xd6')]+=0x1,'scheduledat':moment()[_0x822b('0xde')](_0x31b6c9[_0x822b('0xd8')],'minutes')['format'](_0x822b('0xc7')),'ContactId':_0x588244[_0x822b('0xe0')],'ListId':_0x588244[_0x822b('0xe1')],'VoiceQueueId':_0x588244[_0x822b('0xef')]||undefined,'CampaignId':_0x588244[_0x822b('0xe2')]||undefined})['catch'](loggerCatch('[rescheduleContact][Drop]'));break;case 0xb:if(_0x588244[_0x822b('0xea')]>=_0x31b6c9[_0x822b('0xee')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x588244[_0x822b('0xea')]+=0x1,'scheduledat':moment()['add'](_0x31b6c9[_0x822b('0xeb')],'minutes')[_0x822b('0x40')](_0x822b('0xc7')),'ContactId':_0x588244[_0x822b('0xe0')],'ListId':_0x588244['ListId'],'VoiceQueueId':_0x588244[_0x822b('0xef')]||undefined,'CampaignId':_0x588244[_0x822b('0xe2')]||undefined})[_0x822b('0xa0')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x588244[_0x822b('0x122')]>=_0x31b6c9['dialMachineMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x588244['countmachineretry']+=0x1,'scheduledat':moment()['add'](_0x31b6c9['dialMachineRetryFrequency'],'minutes')[_0x822b('0x40')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x588244[_0x822b('0xe0')],'ListId':_0x588244[_0x822b('0xe1')],'VoiceQueueId':_0x588244[_0x822b('0xef')]||undefined,'CampaignId':_0x588244[_0x822b('0xe2')]||undefined})[_0x822b('0xa0')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x588244[_0x822b('0x128')]>=_0x31b6c9[_0x822b('0x19e')]-0x1){return!![];}hopperUtils[_0x822b('0xdd')]({'active':![],'countagentrejectretry':_0x588244['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x822b('0xde')](_0x31b6c9[_0x822b('0x19f')],_0x822b('0xdf'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x588244['ContactId'],'ListId':_0x588244[_0x822b('0xe1')],'VoiceQueueId':_0x588244[_0x822b('0xef')]||undefined,'CampaignId':_0x588244['CampaignId']||undefined})[_0x822b('0xa0')](loggerCatch(_0x822b('0x1a0')));break;default:return!![];}};Dialer[_0x822b('0x18')][_0x822b('0x111')]=function(_0x317ef0,_0x3e7b81,_0x574980){var _0x1d4036=this;var _0x539686=new History(_0x317ef0);var _0x248538=![];var _0x48885d;var _0x522bd2;return new Promise(function(_0x3ad1af,_0x1352f3){if(_['isUndefined'](_0x3e7b81)&&typeof _0x3e7b81!==_0x822b('0x160')){return _0x1352f3(msgResponse('[callProgressDetecting]',_0x822b('0x91'),_0x822b('0x1a1')));}if(_[_0x822b('0x4e')](_0x574980)&&typeof _0x574980!==_0x822b('0x160')){return _0x1352f3(msgResponse(_0x822b('0x1a2'),'Failure',_0x822b('0x1a3')));}hopperUtils[_0x822b('0xed')](_0x539686,_0x574980[_0x822b('0x1a4')],_0x3e7b81)[_0x822b('0x9d')](function(_0x7ff479){if(_0x7ff479[_0x822b('0xda')]==0x1)_0x248538=!![];switch(_0x574980[_0x822b('0x1a4')]){case'0':_0x3e7b81[_0x822b('0x1a5')]+=0x1;_0x539686[_0x822b('0x6c')]=0x0;_0x539686[_0x822b('0x6d')]=_0x822b('0x1a6');_0x539686[_0x822b('0x12f')]+=0x1;_0x539686['countglobal']+=0x1;ami[_0x822b('0x123')](_0x822b('0x1a7'),ut[_0x822b('0x11c')](_0x317ef0,_0x822b('0x1a8')));_0x48885d=_0x3e7b81['dialNoSuchNumberRetryFrequency'];_0x522bd2=_0x3e7b81[_0x822b('0xec')];hopperUtils['createHistory'](_0x539686)[_0x822b('0xa0')](loggerCatch(_0x822b('0x125')));if(_0x1d4036[_0x822b('0x191')](0x0,_0x317ef0,_0x3e7b81)&&!_0x248538){if(_0x539686[_0x822b('0x12f')]>=_0x3e7b81[_0x822b('0x19c')]){_0x1d4036[_0x822b('0x12c')](_0x539686,_0x3ad1af,_0x1352f3,'reason\x200\x20no\x20such\x20number....');}else{_0x1d4036['stateGlobal'](_0x539686,_0x3ad1af,_0x1352f3,_0x822b('0x1a9'));}}break;case'3':_0x3e7b81[_0x822b('0x1aa')]+=0x1;_0x539686[_0x822b('0x6c')]=0x3;_0x539686[_0x822b('0x6d')]=_0x822b('0x1ab');_0x539686['countnoanswerretry']+=0x1;_0x539686['countglobal']+=0x1;var _0x2fd58c=ut['buildNoAnswerEventPayload'](_0x317ef0,_0x3e7b81);ami[_0x822b('0x123')](_0x822b('0x1ac'),_0x2fd58c);_0x48885d=_0x3e7b81[_0x822b('0x194')];_0x522bd2=_0x3e7b81[_0x822b('0xec')];hopperUtils[_0x822b('0xcb')](_0x539686)['catch'](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x1d4036[_0x822b('0x191')](0x3,_0x317ef0,_0x3e7b81)&&!_0x248538){if(_0x539686[_0x822b('0x127')]>=_0x3e7b81['dialNoAnswerMaxRetry']){_0x1d4036[_0x822b('0x12c')](_0x539686,_0x3ad1af,_0x1352f3,_0x822b('0x1ad'));}else{_0x1d4036['stateGlobal'](_0x539686,_0x3ad1af,_0x1352f3,_0x822b('0x1ad'));}}break;case'5':_0x3e7b81[_0x822b('0x1ae')]+=0x1;_0x539686[_0x822b('0x6c')]=0x5;_0x539686[_0x822b('0x6d')]=_0x822b('0x1af');_0x539686[_0x822b('0x126')]+=0x1;_0x539686[_0x822b('0xd7')]+=0x1;ami[_0x822b('0x123')](_0x822b('0x1b0'),ut[_0x822b('0x11c')](_0x317ef0,'busy'));_0x48885d=_0x3e7b81[_0x822b('0x197')];_0x522bd2=_0x3e7b81[_0x822b('0xec')];hopperUtils[_0x822b('0xcb')](_0x539686)[_0x822b('0xa0')](loggerCatch(_0x822b('0x1b1')));if(_0x1d4036[_0x822b('0x191')](0x5,_0x317ef0,_0x3e7b81)&&!_0x248538){if(_0x539686[_0x822b('0x126')]>=_0x3e7b81[_0x822b('0x196')]){_0x1d4036[_0x822b('0x12c')](_0x539686,_0x3ad1af,_0x1352f3,_0x822b('0x1b2'));}else{_0x1d4036[_0x822b('0x129')](_0x539686,_0x3ad1af,_0x1352f3,_0x822b('0x1b2'));}}break;case'8':_0x3e7b81[_0x822b('0x1b3')]+=0x1;_0x539686[_0x822b('0x6c')]=0x8;_0x539686[_0x822b('0x6d')]=_0x822b('0x1b4');_0x539686[_0x822b('0x192')]+=0x1;_0x539686[_0x822b('0xd7')]+=0x1;_0x48885d=_0x3e7b81[_0x822b('0x19a')];_0x522bd2=_0x3e7b81['callAdditionalPhoneAfterMin'];ami[_0x822b('0x123')](_0x822b('0x1b5'),ut['buildObj'](_0x317ef0,_0x822b('0x1b6')));hopperUtils[_0x822b('0xcb')](_0x539686)['catch'](loggerCatch(_0x822b('0x1b7')));if(_0x1d4036['checkRetriveMax'](0x8,_0x317ef0,_0x3e7b81)&&!_0x248538){if(_0x539686[_0x822b('0x192')]>=_0x3e7b81[_0x822b('0x199')]){_0x1d4036[_0x822b('0x12c')](_0x539686,_0x3ad1af,_0x1352f3,_0x822b('0x1b8'));}else{_0x1d4036[_0x822b('0x129')](_0x539686,_0x3ad1af,_0x1352f3,_0x822b('0x1b8'));}}break;case'11':_0x3e7b81[_0x822b('0x1b9')]+=0x1;_0x539686['state']=0xb;_0x539686[_0x822b('0x6d')]=_0x822b('0xe8');_0x539686[_0x822b('0xea')]+=0x1;_0x539686[_0x822b('0xd7')]+=0x1;_0x48885d=_0x3e7b81['dialAbandonedRetryFrequency'];_0x522bd2=_0x3e7b81[_0x822b('0xec')];hopperUtils[_0x822b('0xcb')](_0x539686)['catch'](loggerCatch(_0x822b('0xf1')));if(_0x1d4036[_0x822b('0x191')](0xb,_0x317ef0,_0x3e7b81)&&!_0x248538){if(_0x539686['countabandonedretry']>=_0x3e7b81[_0x822b('0xee')]){_0x1d4036[_0x822b('0x12c')](_0x539686,_0x3ad1af,_0x1352f3,_0x822b('0x1ba'));}else{_0x1d4036[_0x822b('0x129')](_0x539686,_0x3ad1af,_0x1352f3,_0x822b('0x1ba'));}}break;case'20':_0x3e7b81[_0x822b('0x1bb')]+=0x1;_0x539686['state']=0x14;_0x539686[_0x822b('0x6d')]=_0x822b('0x1bc');_0x539686['countagentrejectretry']+=0x1;_0x539686[_0x822b('0xd7')]+=0x1;_0x48885d=_0x3e7b81['dialAgentRejectRetryFrequency'];_0x522bd2=_0x3e7b81[_0x822b('0xec')];ami[_0x822b('0x123')]('custom:agentreject',ut[_0x822b('0x11c')](_0x317ef0,_0x822b('0x1bd')));hopperUtils[_0x822b('0xcb')](_0x539686)[_0x822b('0xa0')](loggerCatch(_0x822b('0x1be')));if(_0x1d4036[_0x822b('0x191')](0x14,_0x317ef0,_0x3e7b81)&&!_0x248538){if(_0x539686[_0x822b('0x128')]>=_0x3e7b81[_0x822b('0x19e')]){_0x1d4036[_0x822b('0x12c')](_0x539686,_0x3ad1af,_0x1352f3,_0x822b('0x1bf'));}else{_0x1d4036[_0x822b('0x129')](_0x539686,_0x3ad1af,_0x1352f3,'reason\x2020\x20agentreject');}}break;default:_0x3e7b81[_0x822b('0x138')]+=0x1;_0x539686[_0x822b('0x6c')]=0xc;_0x539686[_0x822b('0x6d')]=_0x574980[_0x822b('0x1a4')];_0x48885d=_0x3e7b81[_0x822b('0x19f')];_0x522bd2=_0x3e7b81['callAdditionalPhoneAfterMin'];hopperUtils[_0x822b('0xcb')](_0x539686)[_0x822b('0xa0')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x1d4036[_0x822b('0x191')](_0x574980[_0x822b('0x1a4')],_0x317ef0,_0x3e7b81)&&!_0x248538){if(_0x539686['countbusyretry']+_0x539686[_0x822b('0x192')]+_0x539686['countnoanswerretry']+_0x539686[_0x822b('0x12f')]+_0x539686[_0x822b('0xd6')]+_0x539686['countabandonedretry']+_0x539686[_0x822b('0x122')]+_0x539686['countagentrejectretry']>=_0x3e7b81['dialGlobalMaxRetry']){_0x1d4036[_0x822b('0x129')](_0x539686,_0x3ad1af,_0x1352f3,_0x574980[_0x822b('0x1a4')]);}else{_0x1d4036[_0x822b('0x12c')](_0x539686,_0x3ad1af,_0x1352f3,_0x574980[_0x822b('0x1a4')]);}}}})[_0x822b('0x9d')](function(){if(_0x248538){hopperUtils[_0x822b('0xf2')](_0x539686,_0x48885d,_0x522bd2)[_0x822b('0x9d')](function(){return _0x3ad1af(0x1);});}});});};Dialer[_0x822b('0x18')][_0x822b('0x129')]=function(_0x1d8dd0,_0x3ed4d6,_0x10eef7,_0x365170){var _0x53ecf8=new Final(_0x1d8dd0);_0x53ecf8[_0x822b('0x6c')]=0xf;_0x53ecf8[_0x822b('0x6d')]=_0x822b('0x1c0');this[_0x822b('0x12c')](_0x53ecf8,_0x3ed4d6,_0x10eef7,_0x365170);};Dialer[_0x822b('0x18')][_0x822b('0x12c')]=function(_0x3413dd,_0x262101,_0x17c48b,_0x56322a){hopperUtils[_0x822b('0xcc')](_0x3413dd)[_0x822b('0x9d')](function(){return _0x262101(msgResponse(_0x822b('0x1a2'),_0x822b('0x110'),_0x56322a));})[_0x822b('0xa0')](function(){return _0x17c48b(msgResponse(_0x822b('0x1c1'),_0x822b('0x91'),_0x822b('0x1c2')));});};Dialer[_0x822b('0x18')]['predictive']=function(_0x4f2ebc){var _0x2e10c8=_0x4f2ebc[_0x822b('0x1c3')]/0x64;var _0x210ce7=_0x4f2ebc[_0x822b('0xd2')]/(_0x4f2ebc[_0x822b('0xd2')]+_0x4f2ebc[_0x822b('0xc8')]);var _0x4bcb82=Math[_0x822b('0x1c4')](_0x4f2ebc[_0x822b('0x1c5')]*(_0x4f2ebc[_0x822b('0x1c6')]/0x64));var _0x4cc5fa=Math[_0x822b('0x1c4')](_0x4f2ebc[_0x822b('0x1c5')]*(_0x4f2ebc['predictiveIntervalMinThreshold']/0x64));var _0x5b1790=_0x4f2ebc[_0x822b('0x13e')]+_0x4f2ebc[_0x822b('0x140')];var _0x44ab7b=Math[_0x822b('0x1c7')](_0x4f2ebc['erlangCalls']*_0x4f2ebc['erlangAbandonmentRate']*_0x4f2ebc[_0x822b('0x1c8')]*_0x4f2ebc[_0x822b('0x1c9')]);if(_[_0x822b('0x4e')](_0x4f2ebc[_0x822b('0x24')])){if(!_['isUndefined'](_0x4f2ebc['startPredictive'])){_0x4f2ebc['startPredictive']=undefined;loggerPredictive[_0x822b('0x60')](_0x822b('0x1ca'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_['isUndefined'](_0x4f2ebc[_0x822b('0x5e')])){loggerPredictive[_0x822b('0x60')](_0x822b('0x1ca'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x4f2ebc[_0x822b('0x5e')]);_0x4f2ebc[_0x822b('0x5e')]=undefined;}_0x4f2ebc[_0x822b('0x24')]=moment()[_0x822b('0x40')](_0x822b('0xc7'));loggerPredictive['info'](_0x4f2ebc[_0x822b('0x42')],'collection\x20data\x20in\x20progressive\x20at',_0x4f2ebc[_0x822b('0x24')]);this[_0x822b('0xb5')](_0x4f2ebc,0x1);}else if(ifInterval(_0x4f2ebc[_0x822b('0x1cb')],_0x4f2ebc[_0x822b('0x24')])){this[_0x822b('0xb5')](_0x4f2ebc,0x1);loggerPredictiveCalls[_0x822b('0x45')](_0x822b('0x1cc'),_0x4f2ebc['startProgressive'],_0x4f2ebc[_0x822b('0x42')]);_0x4f2ebc['erlangCalls']=0x0;_0x4f2ebc[_0x822b('0x1cd')]=0x0;}else if(_0x2e10c8<_0x210ce7&&_0x4f2ebc[_0x822b('0x1ce')]===_0x822b('0x1cf')){clearPredictiveAttributes(_0x4f2ebc);loggerPredictive['info'](_0x822b('0x1d0'),'Dropped\x20calls\x20day',_0x210ce7,_0x822b('0x24'),_0x4f2ebc['name']);}else if(_0x44ab7b<_0x4f2ebc[_0x822b('0x1cd')]&&_0x4f2ebc['dialPredictiveOptimization']===_0x822b('0x1cf')){clearPredictiveAttributes(_0x4f2ebc);loggerPredictive[_0x822b('0x45')](_0x822b('0x1d1'),'Max\x20Drop\x20',_0x44ab7b,'Drop\x20in\x20this\x20interval',_0x4f2ebc[_0x822b('0x1cd')],'startProgressive',_0x4f2ebc[_0x822b('0x42')]);}else if(!ifInterval(_0x4f2ebc[_0x822b('0x1cb')],_0x4f2ebc['startProgressive'])&&_['isUndefined'](_0x4f2ebc[_0x822b('0x23')])&&!_['isUndefined'](_0x4f2ebc[_0x822b('0x24')])){_0x4f2ebc[_0x822b('0x23')]=moment()[_0x822b('0x40')](_0x822b('0xc7'));loggerPredictive[_0x822b('0x45')](_0x4f2ebc[_0x822b('0x42')],_0x822b('0x1d2'),_0x4f2ebc[_0x822b('0x23')]);hopperUtils[_0x822b('0x1d3')](_0x4f2ebc[_0x822b('0x1cb')])[_0x822b('0x9d')](this[_0x822b('0x1d4')](_0x4f2ebc))[_0x822b('0x9d')](mergeDataErlangB(_0x4f2ebc))[_0x822b('0x9d')](this['startMethodPredictive'](_0x4f2ebc))[_0x822b('0xa0')](loggerCatchPredictive(_0x822b('0x1d5'),_0x4f2ebc));}else if(!ifInterval(_0x4f2ebc[_0x822b('0x1cb')],_0x4f2ebc[_0x822b('0x23')])){_0x4f2ebc['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x4f2ebc['startPredictive']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x4f2ebc['name'],_0x822b('0x1d6'),_0x4f2ebc[_0x822b('0x23')]);clearInterval(_0x4f2ebc[_0x822b('0x5e')]);_0x4f2ebc[_0x822b('0x5e')]=undefined;hopperUtils[_0x822b('0x1d3')](_0x4f2ebc[_0x822b('0x1cb')])[_0x822b('0x9d')](this[_0x822b('0x1d4')](_0x4f2ebc))[_0x822b('0x9d')](mergeDataErlangB(_0x4f2ebc))[_0x822b('0x9d')](this[_0x822b('0x1d7')](_0x4f2ebc))[_0x822b('0xa0')](loggerCatchPredictive(_0x822b('0x1d8'),_0x4f2ebc));}else if(_0x4f2ebc[_0x822b('0x1c5')]&&_0x5b1790<_0x4f2ebc['predictiveIntervalAvailable']-_0x4cc5fa){clearPredictiveAttributes(_0x4f2ebc);loggerPredictive[_0x822b('0x45')](_0x4f2ebc[_0x822b('0x42')],_0x822b('0x1d9'),_0x5b1790,')\x20are\x20less\x20than\x20threshold\x20(',_0x4f2ebc[_0x822b('0x1c5')],'-',_0x4cc5fa,'=',_0x4f2ebc[_0x822b('0x1c5')]-_0x4cc5fa,')');}else if(_0x4f2ebc[_0x822b('0x1c5')]&&_0x5b1790>_0x4f2ebc['predictiveIntervalAvailable']+_0x4bcb82){clearPredictiveAttributes(_0x4f2ebc);loggerPredictive[_0x822b('0x45')](_0x4f2ebc['name'],_0x822b('0x1d9'),_0x5b1790,_0x822b('0x1da'),_0x4f2ebc[_0x822b('0x1c5')],'+',_0x4bcb82,'=',_0x4f2ebc[_0x822b('0x1c5')]+_0x4bcb82,')');}};Dialer[_0x822b('0x18')][_0x822b('0x1d4')]=function(_0x58896a){var _0x3cf56b=this;return function(_0x3ed782){return new Promise(function(_0x134624,_0x55de08){_[_0x822b('0x5b')](_0x58896a,_0x3ed782[0x0]);if(checkGetDataPredictive(_0x3ed782[0x0])){var _0x3d7f4a=_0x58896a[_0x822b('0x1c5')]=_0x58896a['talking']+_0x58896a[_0x822b('0x13e')];var _0xdb4297=_0x58896a[_0x822b('0x1cb')]*0x3c;var _0x673db9=_0x3ed782[0x0][_0x822b('0x4f')]+_0x3ed782[0x0][_0x822b('0x51')];var _0x18863b=(_0x3ed782[0x0][_0x822b('0x1db')]+_0x3ed782[0x0][_0x822b('0x48')]+_0x3ed782[0x0][_0x822b('0x49')])/_0x3ed782[0x0][_0x822b('0x4d')];_0x58896a[_0x822b('0x1c8')]=_0x18863b>0x0?_0x18863b:0x1;switch(_0x58896a[_0x822b('0x1ce')]){case _0x822b('0x1cf'):var _0x67e890=_0x58896a['dialPredictiveOptimizationPercentage']/0x64;return _0x3cf56b[_0x822b('0x1dc')](_0x3d7f4a,_0xdb4297,_0x673db9,_0x18863b,_0x67e890)['then'](function(_0x5c18db){return _0x134624(_0x5c18db);});case _0x822b('0x1dd'):var _0x3f1fa5=_0x58896a[_0x822b('0x1c3')]/0x64;return _0x3cf56b[_0x822b('0x1de')](_0x3d7f4a,_0xdb4297,_0x673db9,_0x18863b,_0x3f1fa5)[_0x822b('0x9d')](function(_0x752d07){return _0x134624(_0x752d07);});default:return _0x55de08(msgResponse(_0x822b('0x1df'),_0x822b('0x91'),_0x822b('0x1e0')));}}else{return _0x55de08(msgResponse(_0x822b('0x1df'),'Failure',_0x822b('0x1e1')));}});};};Dialer[_0x822b('0x18')]['getDataPredictiveOld']=function(_0x17d180){var _0x4df4b7=this;return function(_0x8a13e4){return new Promise(function(_0x266df0,_0x23c5c4){_['merge'](_0x17d180,_0x8a13e4[0x0]);if(checkGetDataPredictive(_0x8a13e4[0x0])){loggerPredictive['info'](JSON[_0x822b('0x72')](_0x8a13e4[0x0]));if(_0x17d180['dialPredictiveOptimization']===_0x822b('0x1cf')){return _0x4df4b7['getVoiceQueueRtPauses'](_0x17d180['id'])[_0x822b('0x9d')](function(_0x1da728){var _0x63219b=_0x17d180[_0x822b('0x1e2')]-_0x1da728[0x0][_0x822b('0x1e3')];var _0x380df8=_0x17d180[_0x822b('0x1cb')]*0x3c;var _0x47d778=_0x8a13e4[0x0][_0x822b('0x4f')]+_0x8a13e4[0x0][_0x822b('0x51')];var _0x21f140=(_0x8a13e4[0x0][_0x822b('0x1db')]+_0x8a13e4[0x0][_0x822b('0x48')]+_0x8a13e4[0x0][_0x822b('0x49')])/_0x8a13e4[0x0][_0x822b('0x4d')];var _0x3f69a4=_0x17d180[_0x822b('0x1c3')]/0x64;_0x17d180[_0x822b('0x1e4')]=_0x1da728[0x0]['outboundQueuePauses']||0x0;_0x17d180[_0x822b('0x1c8')]=_0x21f140>0x0?_0x21f140:0x1;return _0x4df4b7[_0x822b('0x1dc')](_0x63219b,_0x380df8,_0x47d778,_0x21f140,_0x3f69a4);})[_0x822b('0x9d')](function(_0x542f19){return _0x266df0(_0x542f19);})[_0x822b('0xa0')](function(_0x106b0b){return _0x23c5c4(msgResponse('[CatchErlangB]','Failure',JSON[_0x822b('0x72')](_0x106b0b)));});}if(_0x17d180[_0x822b('0x1ce')]===_0x822b('0x1dd')){return _0x4df4b7[_0x822b('0x152')](_0x17d180['id'])[_0x822b('0x9d')](function(_0x14adcb){var _0x3ba3d8=_0x17d180[_0x822b('0x1e2')]-_0x14adcb[0x0]['outboundQueuePauses'];var _0x380771=_0x17d180['dialPredictiveInterval']*0x3c;var _0x8a3b69=_0x8a13e4[0x0][_0x822b('0x4f')]+_0x8a13e4[0x0][_0x822b('0x51')];var _0x130971=(_0x8a13e4[0x0][_0x822b('0x1db')]+_0x8a13e4[0x0][_0x822b('0x48')]+_0x8a13e4[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x8a13e4[0x0]['predictiveIntervalTotalCalls'];var _0x53cd2b=_0x17d180[_0x822b('0x1c3')]/0x64;_0x17d180[_0x822b('0x1e4')]=_0x14adcb[0x0][_0x822b('0x1e3')]||0x0;_0x17d180[_0x822b('0x1c8')]=_0x130971>0x0?_0x130971:0x1;return _0x4df4b7[_0x822b('0x1de')](_0x3ba3d8,_0x380771,_0x8a3b69,_0x130971,_0x53cd2b);})[_0x822b('0x9d')](function(_0x6698c3){return _0x266df0(_0x6698c3);})[_0x822b('0xa0')](function(_0x530949){return _0x23c5c4(msgResponse(_0x822b('0x1e5'),_0x822b('0x91'),JSON[_0x822b('0x72')](_0x530949)));});}}else{return _0x23c5c4(msgResponse(_0x822b('0x1df'),'Failure',_0x822b('0x1e1')));}});};};Dialer[_0x822b('0x18')][_0x822b('0x1d7')]=function(_0x1da6b5){var _0xbe3149=this;return function(){var _0x505558=0x0;var _0x58ed8b=Math[_0x822b('0x1c7')](_0x1da6b5['erlangCallToSecond']*0x3e8);if(_0x58ed8b>0x0){_0x58ed8b=_0x58ed8b<0x64?0x64:_0x58ed8b;loggerPredictive[_0x822b('0x45')](_0x1da6b5[_0x822b('0x42')],_0x822b('0x1e6'),_0x58ed8b,'milliseconds');_0x1da6b5['handlePredictive']=setInterval(function(){_0xbe3149[_0x822b('0x5e')](_0x1da6b5);loggerPredictiveCalls[_0x822b('0x45')](_0x822b('0x1e7'),_0x505558+=0x1);},_0x58ed8b);}else{loggerPredictive[_0x822b('0x45')](_0x1da6b5[_0x822b('0x42')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x822b('0x18')][_0x822b('0x1e8')]=function(_0x3e554f,_0x462206){var _0x3b9ee8=this;return function(_0x26a136){if(_[_0x822b('0x44')](_0x26a136)){if(_[_0x822b('0xfb')](_0x462206['UserId'])||!_0x462206[_0x822b('0x1e9')]){if(_0x3e554f[_0x822b('0xb2')]===_0x822b('0xb7')){_0x3e554f[_0x822b('0x70')]=_[_0x822b('0x4e')](_0x3e554f[_0x822b('0x70')])?!![]:_0x3e554f[_0x822b('0x70')];var _0x2769ba=uuid['v4']();_0x3b9ee8[_0x822b('0xf3')][_0x2769ba]=new Action(_0x3e554f,_0x462206,_0x2769ba);loggerBooked[_0x822b('0x45')](_0x822b('0x1ea'),_0x2769ba,'queueStatusComplete:\x20',JSON['stringify'](_0x3e554f[_0x822b('0x70')]),_0x822b('0x1eb'),_0x3e554f['name']);if(_0x3e554f['queueStatusComplete']){_0x3e554f[_0x822b('0x70')]=![];_0x3b9ee8[_0x822b('0x26')][_0x3b9ee8['actions'][_0x2769ba][_0x822b('0xc2')]]=[];ami['Action']({'actionid':_0x2769ba,'action':_0x822b('0x1ec'),'queue':_0x3e554f['name']})['catch'](function(){_0x3b9ee8[_0x822b('0xc4')](_0x3e554f);hopperUtils[_0x822b('0xdd')]({'active':![],'ContactId':_0x3b9ee8[_0x822b('0xf3')][_0x2769ba][_0x822b('0xe0')],'ListId':_0x3b9ee8[_0x822b('0xf3')][_0x2769ba][_0x822b('0xe1')],'VoiceQueueId':_0x3b9ee8[_0x822b('0xf3')][_0x2769ba][_0x822b('0xef')]||undefined,'CampaignId':_0x3b9ee8[_0x822b('0xf3')][_0x2769ba]['CampaignId']||undefined})[_0x822b('0xa0')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x3b9ee8[_0x822b('0xf3')][_0x2769ba];});}else{loggerBooked['info']('[booked][checkContactBlack][else]',JSON[_0x822b('0x72')](_0x3e554f[_0x822b('0x70')]),_0x822b('0x1eb'),_0x3e554f[_0x822b('0x42')]);_0x3b9ee8[_0x822b('0xc4')](_0x3e554f);hopperUtils[_0x822b('0xdd')]({'active':![],'ContactId':_0x3b9ee8[_0x822b('0xf3')][_0x2769ba][_0x822b('0xe0')],'ListId':_0x3b9ee8[_0x822b('0xf3')][_0x2769ba][_0x822b('0xe1')],'VoiceQueueId':_0x3b9ee8[_0x822b('0xf3')][_0x2769ba][_0x822b('0xef')]||undefined,'CampaignId':_0x3b9ee8['actions'][_0x2769ba][_0x822b('0xe2')]||undefined})[_0x822b('0xa0')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x3b9ee8[_0x822b('0xf3')][_0x2769ba];}}else{return _0x3b9ee8[_0x822b('0x15f')](_0x3e554f,_0x462206);}}else{if(utils['getSeconds'](undefined,_0x462206['scheduledat'])<_0x3e554f['dialRecallMeTimeout']*0x3c){if(_0x462206[_0x822b('0x14b')]&&!_0x462206[_0x822b('0x14b')][_0x822b('0x1ed')]){_0x3b9ee8[_0x822b('0x1c')][_0x822b('0xfe')](_0x462206['id'])[_0x822b('0x107')](function(){_0x3b9ee8['updateOriginated'](_0x3e554f);});}else{hopperUtils[_0x822b('0x1ee')]({'active':![]},_0x462206['id'],0x1)[_0x822b('0x107')](function(){_0x3b9ee8[_0x822b('0xc4')](_0x3e554f);});}}else{_0x3e554f[_0x822b('0x1ef')]+=0x1;_0x3b9ee8[_0x822b('0xc4')](_0x3e554f);if(_0x3e554f[_0x822b('0x1f0')]){hopperUtils[_0x822b('0xdd')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x462206[_0x822b('0xe0')],'ListId':_0x462206[_0x822b('0xe1')],'VoiceQueueId':_0x462206[_0x822b('0xef')]||undefined,'CampaignId':_0x462206['CampaignId']||undefined})[_0x822b('0xa0')](loggerCatch(_0x822b('0x1f1')));hopperUtils[_0x822b('0xcb')](createObjHistory(_0x3e554f,_0x462206,utils[_0x822b('0x65')]['QUEUE_RECALL'],0x17,_0x822b('0x1f2')))[_0x822b('0xa0')](loggerCatch(_0x822b('0x1f3')));}else{_0x3b9ee8[_0x822b('0x158')](createObjHistory(_0x3e554f,_0x462206,utils['CAMPAIGN_STATUS']['RECALL_TIMEOUT'],0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x3e554f['outboundBlacklistCallsDay']+=0x1;_0x3b9ee8[_0x822b('0x158')](createObjHistory(_0x3e554f,_0x462206,utils[_0x822b('0x65')]['BLACKLIST'],0xd,_0x822b('0x1f4')),_0x822b('0x1f5'),'[Originate][MoveBlacklist]');throw _0x822b('0x1f6');}};};Dialer[_0x822b('0x18')][_0x822b('0x15e')]=function(_0x42f10c){var _0x2e6030=this;var _0x26512c=_0x42f10c[_0x822b('0x1f7')]-_0x42f10c['originated'];emitCampaignSummary(_0x42f10c);if(_0x26512c>0x0&&_0x42f10c['temp']==0x0){if(_0x26512c>this[_0x822b('0x20')]){_0x26512c=this['maxNumberOriginate'];}_0x42f10c['temp']=0x1;hopperUtils['getContactDialerIvr'](_0x42f10c,_0x26512c)[_0x822b('0x9d')](function(_0x52a65e){_0x42f10c[_0x822b('0x1f8')]=0x0;if(_0x52a65e){if(!utils[_0x822b('0x1f9')](_0x52a65e)){_0x42f10c[_0x822b('0x64')]=utils['CAMPAIGN_STATUS'][_0x822b('0x6a')];logger[_0x822b('0x45')](_0x822b('0x1fa')+_0x42f10c[_0x822b('0x42')]);}else{_0x42f10c['originated']+=_0x52a65e[_0x822b('0x99')];_0x42f10c['message']=utils[_0x822b('0x65')][_0x822b('0x1fb')];for(var _0x1f2775=0x0;_0x1f2775<_0x52a65e[_0x822b('0x99')];_0x1f2775+=0x1){_0x42f10c[_0x822b('0x1fc')]+=0x1;if(_[_0x822b('0xfb')](_0x52a65e[_0x1f2775])||_[_0x822b('0xfb')](_0x52a65e[_0x1f2775]['Contact'])||_['isNil'](_0x52a65e[_0x1f2775][_0x822b('0x163')])){_0x2e6030[_0x822b('0x156')](_0x822b('0x1fd'),_0x42f10c,_0x52a65e[_0x1f2775]);}else{hopperUtils[_0x822b('0x1fe')](_[_0x822b('0x73')](_0x52a65e[_0x1f2775],[_0x822b('0xe2'),_0x822b('0x163')]))[_0x822b('0x9d')](_0x2e6030[_0x822b('0x1e8')](_0x42f10c,_0x52a65e[_0x1f2775]))[_0x822b('0xa0')](_0x2e6030['loggerHandler'](_0x822b('0x1ff'),_0x42f10c));}}}}})[_0x822b('0xa0')](loggerGetContactDialer(_0x822b('0x200'),_0x42f10c,_0x26512c));}};Dialer[_0x822b('0x18')][_0x822b('0xb5')]=function(_0x4ee140,_0x113750){var _0x26cec6=this;var _0x481b6d=[];if(_0x113750<0x1||_0x4ee140['dialMethod']===_0x822b('0xb7')){_0x113750=0x1;}var _0x2a0503=Math[_0x822b('0x1c7')](_0x4ee140[_0x822b('0x13e')]*_0x113750)-_0x4ee140[_0x822b('0x7c')];if(_0x4ee140[_0x822b('0x201')]>0x0){var _0x3e8362=_0x4ee140[_0x822b('0x201')]-_0x4ee140[_0x822b('0x7c')]-_0x4ee140[_0x822b('0x140')]-_0x4ee140['pTalking'];if(_0x2a0503>_0x3e8362){_0x2a0503=_0x3e8362;}}if(_0x2a0503>0x0&&_0x4ee140['temp']==0x0){if(_0x4ee140[_0x822b('0xb2')]===_0x822b('0xb7')){_0x2a0503=0x1;}if(_0x2a0503>this['maxNumberOriginate']){_0x2a0503=this[_0x822b('0x20')];}for(var _0x3244c8 in this[_0x822b('0x1f')]){if(typeof this[_0x822b('0x1f')][_0x3244c8]!=='undefined'){if(this['agents'][_0x3244c8][_0x822b('0x6c')]==='not_inuse'&&this['agents'][_0x3244c8][_0x822b('0x88')]===_0x822b('0x87')){_0x481b6d[_0x822b('0x202')](this[_0x822b('0x1f')][_0x3244c8]['id']);}}}_0x4ee140[_0x822b('0x1f8')]=0x1;hopperUtils[_0x822b('0x203')](_0x4ee140,_0x481b6d,_0x2a0503)[_0x822b('0x9d')](function(_0x641317){_0x4ee140[_0x822b('0x1f8')]=0x0;if(_0x641317){if(!utils[_0x822b('0x1f9')](_0x641317)){hopperUtils['countReScheduled'](_0x4ee140)['then'](sendMessageReschedule(_0x4ee140))[_0x822b('0xa0')](loggerCatch(_0x822b('0x204')));}else{_0x4ee140[_0x822b('0x7c')]+=_0x641317[_0x822b('0x99')];_0x4ee140['message']=_0x4ee140[_0x822b('0xb2')]===_0x822b('0xb7')?utils[_0x822b('0x65')]['ACTIVE']:utils[_0x822b('0x65')][_0x822b('0x1fb')];for(var _0x10e70a=0x0;_0x10e70a<_0x641317['length'];_0x10e70a+=0x1){if(_['isNil'](_0x641317[_0x10e70a])||_[_0x822b('0xfb')](_0x641317[_0x10e70a][_0x822b('0x17a')])||_[_0x822b('0xfb')](_0x641317[_0x10e70a]['phone'])){_0x26cec6[_0x822b('0x156')](_0x822b('0x1fd'),_0x4ee140,_0x641317[_0x10e70a]);}else{hopperUtils[_0x822b('0x205')](_[_0x822b('0x73')](_0x641317[_0x10e70a],[_0x822b('0xef'),_0x822b('0x163')]))['then'](_0x26cec6['checkContactBlack'](_0x4ee140,_0x641317[_0x10e70a]))[_0x822b('0xa0')](_0x26cec6[_0x822b('0x206')](_0x822b('0x1fd'),_0x4ee140));}}}}})['catch'](loggerGetContactDialer(_0x822b('0x207'),_0x4ee140,_0x2a0503));}};Dialer[_0x822b('0x18')][_0x822b('0x5e')]=function(_0x4e2f6d){if(_0x4e2f6d[_0x822b('0x201')]>0x0){var _0x4404a6=_0x4e2f6d['dialLimitQueue']-_0x4e2f6d[_0x822b('0x7c')]-_0x4e2f6d[_0x822b('0x140')];if(_0x4404a6>0x0&&_0x4e2f6d['temp']==0x0){this[_0x822b('0x208')](_0x4e2f6d);}else{loggerPredictiveCalls['info'](_0x822b('0x209'));}}else{this['tryOriginatePredictive'](_0x4e2f6d);}};Dialer[_0x822b('0x18')][_0x822b('0x208')]=function(_0x3a9abd){var _0x9679c7=this;var _0x795874=[];_0x3a9abd[_0x822b('0x7c')]+=0x1;for(var _0x53e452 in this[_0x822b('0x1f')]){if(typeof this[_0x822b('0x1f')][_0x53e452]!==_0x822b('0xab')){if(this[_0x822b('0x1f')][_0x53e452][_0x822b('0x6c')]==='not_inuse'&&this[_0x822b('0x1f')][_0x53e452]['status']===_0x822b('0x87')){_0x795874[_0x822b('0x202')](this[_0x822b('0x1f')][_0x53e452]['id']);}}}_0x3a9abd[_0x822b('0x1f8')]=0x1;return this[_0x822b('0x203')](_0x3a9abd['id'],_0x795874,0x1,_0x3a9abd[_0x822b('0x20a')],_0x3a9abd)['then'](function(_0x2326a2){_0x3a9abd[_0x822b('0x1f8')]=0x1;if(_0x2326a2){if(!utils['checkContactEmpty'](_0x2326a2)){utils['checkContactLowerLimitOriginate'](_0x3a9abd,0x1,0x0);return hopperUtils[_0x822b('0x20b')](_0x3a9abd)[_0x822b('0x9d')](sendMessageReschedule(_0x3a9abd))[_0x822b('0xa0')](loggerCatch(_0x822b('0x204')));}else{_0x3a9abd[_0x822b('0x64')]=utils[_0x822b('0x65')]['RUNNING'];if(_[_0x822b('0xfb')](_0x2326a2[0x0])||_[_0x822b('0xfb')](_0x2326a2[0x0][_0x822b('0x17a')])||_[_0x822b('0xfb')](_0x2326a2[0x0]['phone'])){_0x9679c7['emptyContact'](_0x822b('0x1fd'),_0x3a9abd,_0x2326a2[0x0]);}else{return hopperUtils['checkIsBlackList'](_['pick'](_0x2326a2[0x0],['VoiceQueueId',_0x822b('0x163')]))[_0x822b('0x9d')](_0x9679c7['checkContactBlack'](_0x3a9abd,_0x2326a2[0x0]))[_0x822b('0xa0')](_0x9679c7[_0x822b('0x206')](_0x822b('0x20c'),_0x3a9abd));}}}})[_0x822b('0xa0')](loggerGetContactDialer(_0x822b('0x20d'),_0x3a9abd,0x1));};Dialer[_0x822b('0x18')][_0x822b('0x1dc')]=function(_0x590b97,_0x561cee,_0x435648,_0x37864a,_0x2113b8,_0x4a9cf0){loggerPredictive['info'](_0x822b('0x20e'));loggerPredictive['info'](_0x822b('0x20f'),_0x590b97);loggerPredictive[_0x822b('0x45')](_0x822b('0x210'),_0x561cee);loggerPredictive[_0x822b('0x45')](_0x822b('0x211'),_0x435648);loggerPredictive['info'](_0x822b('0x212'),_0x37864a);loggerPredictive[_0x822b('0x45')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2113b8);loggerPredictive[_0x822b('0x45')]('---------------------------');return new Promise(function(_0x178f7e,_0x44d4b9){if(_0x590b97<=0x0||isNaN(_0x590b97)){return _0x44d4b9(msgResponse(_0x822b('0x213'),_0x822b('0xc1'),_0x822b('0x214')+_0x590b97));}if(_0x435648<=0x0||isNaN(_0x435648)){return _0x44d4b9(msgResponse('[abandonmentRate]',_0x822b('0xc1'),_0x822b('0x215')+_0x435648));}if(_0x37864a<=0x0||isNaN(_0x37864a)){return _0x44d4b9(msgResponse(_0x822b('0x213'),'Error','p\x20=\x20'+_0x37864a));}if(_0x561cee<=0x0||isNaN(_0x561cee)){return _0x44d4b9(msgResponse(_0x822b('0x213'),_0x822b('0xc1'),_0x822b('0x216')+_0x561cee));}if(_0x2113b8<=0x0||isNaN(_0x2113b8)){return _0x44d4b9(msgResponse(_0x822b('0x213'),_0x822b('0xc1'),'Amax\x20=\x20'+_0x2113b8));}_0x4a9cf0=_0x4a9cf0||0x0;var _0x3aba13=0x1/_0x435648;var _0x246422=0x0;var _0x36231c=0x0;var _0x55ac7e=0x0;var _0x35b9ec=0x0;for(var _0x4e1b7f=0x0;_0x55ac7e<_0x2113b8;_0x4e1b7f+=0x1){_0x36231c=_0x4e1b7f/_0x561cee;_0x246422=(_0x37864a*_0x36231c+_0x4a9cf0)/_0x3aba13;_0x55ac7e=utils[_0x822b('0x217')](_0x246422,_0x590b97);_0x35b9ec=_0x246422/_0x590b97*(0x1-utils[_0x822b('0x217')](_0x246422,_0x590b97));}return _0x178f7e({'erlangCalls':_0x4e1b7f,'erlangCallToSecond':_0x561cee/_0x4e1b7f,'erlangAbandonmentRate':_0x55ac7e,'erlangBusyFactor':_0x35b9ec});});};Dialer[_0x822b('0x18')]['busyFactor']=function(_0x49fabc,_0x1953da,_0x38a868,_0x3fd1fa,_0x57891f,_0x10a292){loggerPredictive[_0x822b('0x45')](_0x822b('0x218'));loggerPredictive[_0x822b('0x45')](_0x822b('0x20f'),_0x49fabc);loggerPredictive[_0x822b('0x45')](_0x822b('0x210'),_0x1953da);loggerPredictive[_0x822b('0x45')](_0x822b('0x211'),_0x38a868);loggerPredictive[_0x822b('0x45')](_0x822b('0x212'),_0x3fd1fa);loggerPredictive[_0x822b('0x45')](_0x822b('0x219'),_0x57891f);loggerPredictive['info'](_0x822b('0x4c'));return new Promise(function(_0x4e60a2,_0xa2c2ec){if(_0x49fabc<=0x0||isNaN(_0x49fabc)){return _0xa2c2ec(msgResponse(_0x822b('0x21a'),_0x822b('0xc1'),_0x822b('0x214')+_0x49fabc));}if(_0x38a868<=0x0||isNaN(_0x38a868)){return _0xa2c2ec(msgResponse(_0x822b('0x21a'),_0x822b('0xc1'),_0x822b('0x215')+_0x38a868));}if(_0x3fd1fa<=0x0||isNaN(_0x3fd1fa)){return _0xa2c2ec(msgResponse(_0x822b('0x21a'),_0x822b('0xc1'),_0x822b('0x21b')+_0x3fd1fa));}if(_0x1953da<=0x0||isNaN(_0x1953da)){return _0xa2c2ec(msgResponse('[busyFactor]',_0x822b('0xc1'),_0x822b('0x216')+_0x1953da));}if(_0x57891f<=0x0||isNaN(_0x57891f)){return _0xa2c2ec(msgResponse(_0x822b('0x21a'),_0x822b('0xc1'),'Umin\x20=\x20'+_0x57891f));}_0x10a292=_0x10a292||0x0;var _0x1dfe6b=0x1/_0x38a868;var _0x16bd3d=0x0;var _0x2cac3d=0x0;var _0x235d06=0x0;var _0x32a32b=0x0;for(var _0x390008=0x0;_0x32a32b<_0x57891f;_0x390008+=0x1){_0x2cac3d=_0x390008/_0x1953da;_0x16bd3d=(_0x3fd1fa*_0x2cac3d+_0x10a292)/_0x1dfe6b;_0x235d06=utils[_0x822b('0x217')](_0x16bd3d,_0x49fabc);_0x32a32b=_0x16bd3d/_0x49fabc*(0x1-utils[_0x822b('0x217')](_0x16bd3d,_0x49fabc));}return _0x4e60a2({'erlangCalls':_0x390008,'erlangCallToSecond':_0x1953da/_0x390008,'erlangAbandonmentRate':_0x235d06,'erlangBusyFactor':_0x32a32b});});};module[_0x822b('0x21c')]=Dialer; \ No newline at end of file +var _0x9046=['actions','channel','actionid','strategy','roundrobin','isNil','locked','paused','stateinterface','rrmemory','merge','pick','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','[booked][RR][finaly]','Agent:\x20','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','Success','callProgressDetecting','variable','exten','xcally-motion-dialer','value','HANGUP','outboundAnswerAgiCallsDay','membername','AMD','custom:amd','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','MACHINE','Machine','countmachineretry','buildObj','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','stateGlobal','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','Normal\x20Clearing','outboundUnknownCallsDay','cause-txt','running','statusMessage','available','talking','ACTIVE','queueSummaryCountersUpdated','assign','[syncQueueSummary]','syncQueueSummaryComplete','throttle','reachable','resolve','handlePreviewRecallNotifications','map','Agent','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','loopClearZombieChannels','clearZombieChannels','[uniqueid]','[actions]','undefined','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','UserId','[emptyContact][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueTimeout','getCaller','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDTOTALANALYSISTIME','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','Contact','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','countbusyretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','custom:agentnosuchnumber','nosuchnumber','[syncAgentComplete][createHistory][0]','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','NoAnswer','buildNoAnswerEventPayload','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','agentreject','[syncAgentComplete][createHistory][20]','[syncAgentComplete][createHistory][?]','swapAdditionalPhones','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','floor','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','dialPredictiveInterval','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','predictiveIntervalTotalCalls','predictiveIntervalHitRate','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','getDataPredictiveOld','loggedIn','predictiveIntervalPauses','outboundQueuePauses','[CatchErlangB]','check\x20failure','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','voicePause','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','dialLimitQueue','pTalking','not_inuse','getContactDialer','countReScheduled','[countReScheduled]\x20','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','checkIsBlackList','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','m\x20=\x20','Ts\x20=\x20','[abandonmentRate]','p\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','interval\x20=\x20','exports','util','uuid','moment','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/final','./models/agentComplete','./models/queueCallerAbandon','XCALLY_IP_AGI','127.0.0.1','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncHangup','syncNewExten','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','then','isUndefined','emit','type','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','voice:queue:%s','voice_queue:save','isEmpty','info','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','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','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','getSeconds','startProgressive','name','startProgressive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','stack','inspect','checkContactLowerLimitOriginate','temp','contactsRescheduled','message','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','starttime','queueStatusComplete','error','stringify','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Intervals','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','format','campaign:save','sendMessageOneNotActive','originated','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','[ifTime][Action]','Error','isTrunkReachable','active','status','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','checkIfTime','ifTimeIvr','checkIfTimeIntervals','ifTime','Failure','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','Action','iftime\x20%s,%s','content','true','push','command','all','some','OVERTIME_INTERVAL','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','catch','resetActiveCalls','syncCampaigns','dialTimezone','Interval','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','power','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','dialGlobalInterval','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','OVERTIME_GLOBAL_INTERVAL','Global:\x20','silly','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','queue','uniqueid','ivr','updateOriginated','answertime','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','droptime','responsetime','predictiveIntervalDroppedCallsTimeout','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','TIMEOUT','countdropretry','countglobal','dialDropRetryFrequency','verifyAdditionalPhones','voiceQueue','additional','queueCallerAbandonCreateState','add','minutes','ContactId','ListId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','endtime','calleridname','calleridnum','createHistory','[syncAgentComplete][createHistory][10]','predictiveIntervalDroppedCallsCallersExit','outboundDropCallsDayCallersExit','Abandoned','dropreason','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','callAdditionalPhoneAfterMin','dialAbandonedMaxRetry','rescheduleContact','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]'];(function(_0x3e055e,_0x37c730){var _0x3e792f=function(_0x1ac384){while(--_0x1ac384){_0x3e055e['push'](_0x3e055e['shift']());}};_0x3e792f(++_0x37c730);}(_0x9046,0x125));var _0x6904=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x9046[_0x20ef64];return _0x3707d8;};'use strict';var util=require(_0x6904('0x0'));var _=require('lodash');var uuid=require(_0x6904('0x1'));var moment=require(_0x6904('0x2'));var rr=require('rr');var Redis=require(_0x6904('0x3'));var utils=require(_0x6904('0x4'));var hopperUtils=require(_0x6904('0x5'));var ut=require(_0x6904('0x6'));var config=require(_0x6904('0x7'));var logger=require(_0x6904('0x8'))(_0x6904('0x9'));var loggerBooked=require(_0x6904('0x8'))(_0x6904('0xa'));var loggerPredictive=require(_0x6904('0x8'))(_0x6904('0xb'));var loggerPredictiveCalls=require(_0x6904('0x8'))(_0x6904('0xc'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x6904('0xd'));var ami=require(_0x6904('0xe'));config[_0x6904('0xf')]=_[_0x6904('0x10')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x6904('0x11'))(new Redis(config[_0x6904('0xf')]));var cmHopper=require(_0x6904('0x12'));var voiceQueueRt=require(_0x6904('0x13'));var RpcSetting=require(_0x6904('0x14'));var Interval=require(_0x6904('0x15'));var Action=require(_0x6904('0x16'));var History=require('./models/history');var Final=require(_0x6904('0x17'));var AgentComplete=require(_0x6904('0x18'));var QueueCallerAbandon=require(_0x6904('0x19'));var Hangup=require('./models/hangup');var ipAgi=process['env'][_0x6904('0x1a')]||_0x6904('0x1b');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x6904('0x1c')][_0x6904('0x1d')]=function(_0x2c895c){this['tail']=this[_0x6904('0x1e')]?this[_0x6904('0x1e')][_0x6904('0x1f')](_0x2c895c):_0x2c895c();};function Dialer(_0x546a3f,_0x2ee263){this[_0x6904('0x20')]=new Sequence();this[_0x6904('0x21')]=_0x2ee263;this[_0x6904('0x22')]=_0x546a3f[_0x6904('0x22')];this['campaigns']=_0x546a3f[_0x6904('0x23')];this[_0x6904('0x24')]=_0x546a3f['agents'];this['trunks']=_0x546a3f[_0x6904('0x25')];this['maxNumberOriginate']=config[_0x6904('0x26')]||0x2;this[_0x6904('0x27')]={};this['actions']={};this['contactsId']={};this[_0x6904('0x28')]={};this[_0x6904('0x29')]={};this[_0x6904('0x2a')]={};this['startProgressive']={};this[_0x6904('0x2b')]={};this[_0x6904('0x2c')]={};this[_0x6904('0x2d')]={};this[_0x6904('0x2e')]={};ami['on'](_0x6904('0x2f'),this[_0x6904('0x30')][_0x6904('0x31')](this));ami['on'](_0x6904('0x32'),this[_0x6904('0x33')]['bind'](this));ami['on'](_0x6904('0x34'),this[_0x6904('0x35')][_0x6904('0x31')](this));ami['on'](_0x6904('0x36'),this[_0x6904('0x37')][_0x6904('0x31')](this));ami['on'](_0x6904('0x38'),this[_0x6904('0xd')][_0x6904('0x31')](this));ami['on']('custom:queuesummarycomplete',this['syncQueueSummaryComplete'][_0x6904('0x31')](this));ami['on']('hangup',this[_0x6904('0x39')]['bind'](this));ami['on']('newexten',this[_0x6904('0x3a')][_0x6904('0x31')](this));ami['on']('varset',this[_0x6904('0x3b')]['bind'](this));ami['on'](_0x6904('0x3c'),this[_0x6904('0x3d')][_0x6904('0x31')](this));ami['on'](_0x6904('0x3e'),this[_0x6904('0x3f')][_0x6904('0x31')](this));this[_0x6904('0x40')]();this['loopClearZombieChannels']();RpcSetting['getSettings']()[_0x6904('0x41')](function(_0x314edc){previewRecallmeReminderInterval=_0x314edc['previewRecallmeReminderInterval'];});}function isNotNull(_0x13ee0e){return _0x13ee0e!==null&&!_[_0x6904('0x42')](_0x13ee0e);}function msgResponse(_0x22614c,_0x4c9533,_0x5a60eb){return{'action':_0x22614c,'response':_0x4c9533,'message':_0x5a60eb,'stack':_0x5a60eb};}function emit(_0x147b7a,_0x1df29f,_0x2186f7){io['to'](_0x147b7a)[_0x6904('0x43')](_0x1df29f,_0x2186f7);}function emitOutboundVoiceQueueSummary(_0x1c440c){if(_0x1c440c[_0x6904('0x44')]==='outbound'){logger[_0x6904('0x45')](_0x6904('0x46'),util['inspect'](_0x1c440c,{'showHidden':![],'depth':null}));emit(util['format'](_0x6904('0x47'),_0x1c440c['name']),_0x6904('0x48'),_0x1c440c);}}function checkGetDataPredictive(_0x5039a9){if(isNotNull(_0x5039a9)&&!_[_0x6904('0x49')](_0x5039a9)){loggerPredictive[_0x6904('0x4a')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0x6904('0x4a')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5039a9['predictiveIntervalTotalCalls']);loggerPredictive[_0x6904('0x4a')](_0x6904('0x4b'),_0x5039a9[_0x6904('0x4c')]);loggerPredictive[_0x6904('0x4a')](_0x6904('0x4d'),_0x5039a9['predictiveIntervalDroppedCallsTimeout']);loggerPredictive['info'](_0x6904('0x4e'),_0x5039a9['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive['info'](_0x6904('0x4f'),_0x5039a9[_0x6904('0x50')]);loggerPredictive[_0x6904('0x4a')](_0x6904('0x51'),_0x5039a9['predictiveIntervalAvgTalktime']);loggerPredictive['info'](_0x6904('0x52'));if(_0x5039a9['predictiveIntervalTotalCalls']>0x0){if(!_[_0x6904('0x42')](_0x5039a9[_0x6904('0x53')])&&_0x5039a9[_0x6904('0x53')]>0x0){return!![];}loggerPredictive[_0x6904('0x4a')](_0x6904('0x54'));if(!_[_0x6904('0x42')](_0x5039a9['predictiveIntervalAvgHoldtime'])&&_0x5039a9[_0x6904('0x50')]>0x0){return!![];}loggerPredictive[_0x6904('0x4a')](_0x6904('0x55'));}else{loggerPredictive[_0x6904('0x4a')](_0x6904('0x56'));}}else{loggerPredictive[_0x6904('0x4a')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x33fa29){return function(_0x5c0807){loggerPredictive[_0x6904('0x4a')](_0x6904('0x57'));loggerPredictive[_0x6904('0x4a')](_0x6904('0x58'),_0x5c0807[_0x6904('0x59')]);loggerPredictive[_0x6904('0x4a')](_0x6904('0x5a'),_0x5c0807[_0x6904('0x5b')]);loggerPredictive[_0x6904('0x4a')](_0x6904('0x5c'),_0x5c0807[_0x6904('0x5d')]);loggerPredictive['info'](_0x6904('0x5e'),_0x5c0807[_0x6904('0x5f')]);loggerPredictive[_0x6904('0x4a')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5c0807[_0x6904('0x5d')]);loggerPredictive['info'](_0x6904('0x52'));_['merge'](_0x33fa29,_0x5c0807);};}function ifInterval(_0x5e7ece,_0x4c5426){if(_[_0x6904('0x42')](_0x4c5426)){return![];}return utils[_0x6904('0x60')](undefined,_0x4c5426)<_0x5e7ece*0x3c;}function clearPredictiveAttributes(_0x3e21b5){if(_0x3e21b5[_0x6904('0x61')]){_0x3e21b5[_0x6904('0x61')]=undefined;loggerPredictive['debug'](_0x3e21b5[_0x6904('0x62')],_0x6904('0x63'));}if(_0x3e21b5['startPredictive']){_0x3e21b5[_0x6904('0x2a')]=undefined;loggerPredictive['debug'](_0x3e21b5['name'],'startPredictive\x20value\x20cleared');}if(_0x3e21b5[_0x6904('0x64')]){clearInterval(_0x3e21b5['handlePredictive']);_0x3e21b5['handlePredictive']=undefined;loggerPredictive[_0x6904('0x45')](_0x3e21b5[_0x6904('0x62')],_0x6904('0x65'));}}function loggerCatchPredictive(_0x55f3cc,_0x11f830){return function(_0x220b0f){loggerPredictive['error'](_0x11f830[_0x6904('0x62')],_0x55f3cc);loggerPredictive['error'](_0x220b0f[_0x6904('0x66')]);clearPredictiveAttributes(_0x11f830);};}function loggerCatch(_0x4d5ac9){return function(_0x99e899){logger['error'](_0x4d5ac9,util[_0x6904('0x67')](_0x99e899,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x4e3146,_0x4b3491,_0x19ae87){return function(_0x568584){utils[_0x6904('0x68')](_0x4b3491,_0x19ae87,0x0);_0x4b3491[_0x6904('0x69')]=0x0;logger['error'](_0x4e3146,util[_0x6904('0x67')](_0x568584,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x43d734){return function(_0x17aa03){if(isNotNull(_0x17aa03)&&isNotNull(_0x17aa03[0x0])){if(_0x17aa03[0x0][_0x6904('0x6a')]>0x0){_0x43d734[_0x6904('0x6b')]=utils[_0x6904('0x6c')][_0x6904('0x6d')];logger[_0x6904('0x4a')]('[getContactDialer2][ReScheduled]'+_0x43d734['name'],_0x17aa03[0x0][_0x6904('0x6a')],_0x6904('0x6e'));}else{_0x43d734[_0x6904('0x6b')]=utils['CAMPAIGN_STATUS'][_0x6904('0x6f')];logger['info'](_0x6904('0x70')+_0x43d734[_0x6904('0x62')]);}}};}function createObjHistory(_0x7fe7b9,_0x428f12,_0x58beeb,_0x273d6c,_0x367974){_0x7fe7b9[_0x6904('0x6b')]=_0x58beeb;var _0x155953=new Action(_0x7fe7b9,_0x428f12);var _0x286700=new History(_0x155953);_0x286700[_0x6904('0x71')]=_0x273d6c;_0x286700[_0x6904('0x72')]=_0x367974;_0x286700['endtime']=_0x155953[_0x6904('0x73')];return _0x286700;}function unlockQueueStatus(_0x5a983f,_0x1e1b1a){setTimeout(function(){if(_[_0x6904('0x42')](_0x5a983f[_0x6904('0x74')])){loggerBooked[_0x6904('0x75')]('[unlockQueueStatus][undefined]',_0x1e1b1a);}_0x5a983f[_0x6904('0x74')]=!![];loggerBooked[_0x6904('0x4a')]('[booked][unlockQueueStatus]',_0x1e1b1a,JSON[_0x6904('0x76')](_['pick'](_0x5a983f,['name',_0x6904('0x74')])));},0x1f3);}function checkInterval(_0x37dea1){return function(){if(!isNotNull(_0x37dea1['Interval'])){_0x37dea1[_0x6904('0x6b')]=utils['CAMPAIGN_STATUS'][_0x6904('0x77')];throw _0x37dea1[_0x6904('0x62')]+_0x6904('0x78');}if(!isNotNull(_0x37dea1['Interval'][_0x6904('0x79')])){_0x37dea1[_0x6904('0x6b')]=utils['CAMPAIGN_STATUS'][_0x6904('0x77')];throw _0x37dea1[_0x6904('0x62')]+_0x6904('0x78');}if(!isNotNull(_[_0x6904('0x49')](_0x37dea1['Interval'][_0x6904('0x79')]))){_0x37dea1[_0x6904('0x6b')]=utils[_0x6904('0x6c')][_0x6904('0x77')];throw _0x37dea1[_0x6904('0x62')]+'\x20INTERVAL_IS_NULL';}};}function checkIsIVRCampaignActive(_0x464d0){return function(){if(!utils[_0x6904('0x7a')](_0x464d0)){_0x464d0[_0x6904('0x6b')]=utils['CAMPAIGN_STATUS'][_0x6904('0x7b')];throw _0x464d0['name']+_0x6904('0x7c');}};}function emitCampaignSummary(_0x24081e){if(utils[_0x6904('0x7d')](_0x24081e)){emit(util[_0x6904('0x7e')]('campaign:ivr:%s',_0x24081e[_0x6904('0x62')]),_0x6904('0x7f'),_0x24081e);}}function loggerCatchQueueSummary(_0x1aa8b2,_0x5de5a8){return function(_0x3b644c){clearPredictiveAttributes(_0x5de5a8);emitCampaignSummary(_0x5de5a8);loggerSyncQueueSummary[_0x6904('0x45')](_0x1aa8b2,util[_0x6904('0x67')](_0x3b644c,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x16e7c4){if(_0x16e7c4[_0x6904('0x80')]){if(_0x16e7c4[_0x6904('0x81')]===0x0){_0x16e7c4['sendMessageOneNotActive']=![];_0x16e7c4[_0x6904('0x6b')]=utils[_0x6904('0x6c')][_0x6904('0x7b')];loggerSyncQueueSummary[_0x6904('0x45')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x16e7c4['name'],_0x6904('0x82'));}else{_0x16e7c4['message']=utils[_0x6904('0x6c')]['DISACTIVED'];loggerSyncQueueSummary[_0x6904('0x45')](_0x6904('0x83'),_0x16e7c4['name'],'is\x20disactive');}emitCampaignSummary(_0x16e7c4);}}function myreject(_0x4138db){return function(_0x1a1cb9){return _0x4138db(msgResponse(_0x6904('0x84'),_0x6904('0x85'),JSON[_0x6904('0x76')](_0x1a1cb9)));};}Dialer[_0x6904('0x1c')][_0x6904('0x86')]=function(_0x35ead2){return!_[_0x6904('0x42')](_0x35ead2)&&_0x35ead2&&!_['isUndefined'](_0x35ead2[_0x6904('0x62')])&&!_[_0x6904('0x42')](_0x35ead2[_0x6904('0x87')])&&_0x35ead2[_0x6904('0x87')]&&(this[_0x6904('0x25')][util[_0x6904('0x7e')]('SIP/%s',_0x35ead2[_0x6904('0x62')])][_0x6904('0x88')]==='reachable'||this[_0x6904('0x25')][util['format']('SIP/%s',_0x35ead2[_0x6904('0x62')])][_0x6904('0x88')]===_0x6904('0x89'));};Dialer[_0x6904('0x1c')][_0x6904('0x8a')]=function(_0x179db3){var _0x50852c=this;return function(){if(!_0x50852c['isTrunkReachable'](_0x179db3[_0x6904('0x8b')])){if(!_0x50852c[_0x6904('0x86')](_0x179db3[_0x6904('0x8c')])){_0x179db3[_0x6904('0x6b')]=utils[_0x6904('0x6c')][_0x6904('0x8d')];throw _0x179db3[_0x6904('0x62')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer['prototype'][_0x6904('0x8e')]=function(_0x564ffb,_0x2603bd,_0x3ba22b,_0x23e943){var _0x17461e=this;return function(){var _0xd56d04=!![];return _0x17461e[_0x6904('0x8f')](_0x564ffb,_0x2603bd,_0x3ba22b,_0x23e943,_0xd56d04);};};Dialer['prototype'][_0x6904('0x90')]=function(_0x261e22,_0x2b3211,_0xdef309,_0x5839e2){var _0x5492f2=this;return function(){var _0x410430=![];return _0x5492f2[_0x6904('0x8f')](_0x261e22['Intervals'],_0x2b3211,_0xdef309,_0x5839e2,_0x410430);};};Dialer['prototype'][_0x6904('0x8f')]=function(_0x55f62e,_0x42ce80,_0x354fc3,_0x51fba9,_0x1060ac){var _0x2fd1bc=[];return new Promise(function(_0x16731d,_0x160b63){if(!isNotNull(_0x55f62e)){_0x51fba9[_0x6904('0x6b')]=utils['CAMPAIGN_STATUS'][_0x6904('0x77')];return _0x160b63(msgResponse(_0x6904('0x91'),_0x6904('0x92'),_0x354fc3+'\x20Intervals\x20is\x20null\x20'));}if(_[_0x6904('0x49')](_0x55f62e)){_0x51fba9[_0x6904('0x6b')]=utils[_0x6904('0x6c')][_0x6904('0x93')];return _0x160b63(msgResponse(_0x6904('0x91'),_0x6904('0x92'),_0x354fc3+_0x6904('0x94')));}if(_0x42ce80&&_['isUndefined'](config[_0x6904('0x95')][_0x42ce80])){_0x51fba9[_0x6904('0x6b')]=utils['CAMPAIGN_STATUS'][_0x6904('0x96')];return _0x160b63(msgResponse(_0x6904('0x91'),_0x6904('0x92'),_0x354fc3+_0x6904('0x97')+_0x42ce80));}if(_[_0x6904('0x98')](_0x55f62e)){for(var _0x2a97e1=0x0;_0x2a97e1<_0x55f62e['length'];_0x2a97e1+=0x1){_0x2fd1bc['push'](ami[_0x6904('0x99')]({'action':'command','command':util[_0x6904('0x7e')](_0x6904('0x9a'),_0x55f62e[_0x2a97e1]['interval'],!_[_0x6904('0x42')](config['timezones'][_0x42ce80])?_0x42ce80:'')})['then'](function(_0x38a11b){return _0x38a11b[_0x6904('0x9b')]['indexOf'](_0x6904('0x9c'))>=0x0;})['catch'](myreject(_0x160b63)));}}else{_0x2fd1bc[_0x6904('0x9d')](ami[_0x6904('0x99')]({'action':_0x6904('0x9e'),'command':util[_0x6904('0x7e')](_0x6904('0x9a'),_0x55f62e,!_['isUndefined'](config[_0x6904('0x95')][_0x42ce80])?_0x42ce80:'')})[_0x6904('0x41')](function(_0xd84ec8){return _0xd84ec8[_0x6904('0x9b')]['indexOf'](_0x6904('0x9c'))>=0x0;})['catch'](myreject(_0x160b63)));}Promise[_0x6904('0x9f')](_0x2fd1bc)[_0x6904('0x41')](function(_0x399c13){var _0x3d0feb=_[_0x6904('0xa0')](_0x399c13);if(_0x3d0feb){return _0x16731d(_0x3d0feb);}else{_0x51fba9[_0x6904('0x6b')]=_0x1060ac?utils[_0x6904('0x6c')]['OVERTIME_GLOBAL_INTERVAL']:utils['CAMPAIGN_STATUS'][_0x6904('0xa1')];return _0x160b63(msgResponse(_0x6904('0xa2'),_0x6904('0x92'),'Global:\x20'+_0x1060ac+'\x20'+_0x354fc3+_0x6904('0xa3')+util[_0x6904('0x67')](_0x55f62e,{'showHidden':![],'depth':null})+_0x6904('0xa4')+_0x42ce80));}})[_0x6904('0xa5')](function(_0x526a6c){return _0x160b63(msgResponse(_0x6904('0x91'),'Failure',JSON['stringify'](_0x526a6c)));});});};Dialer[_0x6904('0x1c')][_0x6904('0x40')]=function(){var _0x117918=this;return cmHopper[_0x6904('0xa6')]({'active':![]},{'where':{'active':!![]}})[_0x6904('0x41')](function(){setInterval(function(){_0x117918[_0x6904('0xa7')]();},0x3e8);});};Dialer[_0x6904('0x1c')][_0x6904('0xa7')]=function(){var _0x3e2777=this;var _0x1a788e;for(var _0x5ac3f3 in this[_0x6904('0x23')]){if(typeof this[_0x6904('0x23')][_0x5ac3f3]!=='undefined'){_0x1a788e=this[_0x6904('0x23')][_0x5ac3f3];if(utils[_0x6904('0x7d')](_0x1a788e)&&utils[_0x6904('0x7a')](_0x1a788e)){_0x1a788e[_0x6904('0x80')]=!![];Promise['resolve']()['then'](checkIsIVRCampaignActive(_0x1a788e))[_0x6904('0x41')](checkInterval(_0x1a788e))[_0x6904('0x41')](_0x3e2777[_0x6904('0x8a')](_0x1a788e))['then'](_0x3e2777['checkIfTime'](_0x1a788e['dialGlobalInterval'],_0x1a788e[_0x6904('0xa8')],_0x1a788e[_0x6904('0x62')],_0x1a788e))[_0x6904('0x41')](_0x3e2777[_0x6904('0x90')](_0x1a788e[_0x6904('0xa9')],_0x1a788e['dialTimezone'],_0x1a788e[_0x6904('0x62')],_0x1a788e))[_0x6904('0x41')](_0x3e2777[_0x6904('0xaa')](_0x1a788e))[_0x6904('0xa5')](loggerCatchQueueSummary(_0x6904('0xab'),_0x1a788e));}else{notSendMessagesCampaign(_0x1a788e);}}}};Dialer[_0x6904('0x1c')][_0x6904('0xac')]=function(_0x2f46dc){if(_0x2f46dc[_0x6904('0xad')]!==_0x6904('0xb')){clearPredictiveAttributes(_0x2f46dc);}switch(_0x2f46dc[_0x6904('0xad')]){case'progressive':this['handlePower'](_0x2f46dc,0x1);break;case _0x6904('0xae'):this[_0x6904('0xaf')](_0x2f46dc,_0x2f46dc[_0x6904('0xb0')]);break;case _0x6904('0xb'):this[_0x6904('0xb')](_0x2f46dc);break;case _0x6904('0xa'):this[_0x6904('0xaf')](_0x2f46dc,0x1);break;default:logger[_0x6904('0x75')](_0x6904('0xb1'),_0x2f46dc[_0x6904('0x62')],_0x6904('0xb2'));}};Dialer['prototype'][_0x6904('0x91')]=function(_0x2e1b2e,_0x3e7761){var _0xff7ff6=_0x2e1b2e['dialTimezone'];var _0x5ea369=_0x3e7761?_0x2e1b2e[_0x6904('0xb3')]:_0x2e1b2e[_0x6904('0xa9')][_0x6904('0x79')];logger['silly'](_0x6904('0xb4'),_0x5ea369,_0xff7ff6,_0x2e1b2e[_0x6904('0x62')],util[_0x6904('0x7e')](_0x6904('0xb5'),_0x2e1b2e[_0x6904('0x62')],_0x2e1b2e['id']));var _0x5cb81b=null;return Interval[_0x6904('0xb6')](_0x5ea369,_0xff7ff6)[_0x6904('0x41')](function(_0x2eb7cf){if(_0x2eb7cf===!![]){return _0x2eb7cf;}else{_0x2e1b2e[_0x6904('0x6b')]=_0x3e7761?utils[_0x6904('0x6c')][_0x6904('0xb7')]:utils[_0x6904('0x6c')][_0x6904('0xa1')];_0x5cb81b=msgResponse(_0x6904('0xa2'),_0x6904('0x92'),_0x6904('0xb8')+_0x3e7761+'\x20'+_0x2e1b2e[_0x6904('0x62')]+'\x20Interval\x20is\x20overtime:\x20'+util[_0x6904('0x67')](_0x5ea369,{'showHidden':![],'depth':null})+_0x6904('0xa4')+_0xff7ff6);}if(_0x5cb81b!==null){logger[_0x6904('0xb9')](_0x6904('0xba'),_0x5cb81b);_0x5cb81b[_0x6904('0xbb')]=_0x3e7761;throw _0x5cb81b;}})[_0x6904('0xa5')](function(_0x234058){logger['error'](_0x6904('0xbc'),_0x234058);throw msgResponse(_0x6904('0x84'),_0x6904('0x85'),util['inspect'](_0x234058,{'showHidden':![],'depth':null}));});};Dialer[_0x6904('0x1c')]['syncAgentConnect']=function(_0x40c5a6){if(this[_0x6904('0x22')][_0x40c5a6[_0x6904('0xbd')]]){if(this[_0x6904('0x28')][_0x40c5a6['uniqueid']]&&this[_0x6904('0x28')][_0x40c5a6[_0x6904('0xbe')]][_0x6904('0x44')]!==_0x6904('0xbf')){this[_0x6904('0xc0')](this[_0x6904('0x22')][_0x40c5a6['queue']]);this[_0x6904('0x28')][_0x40c5a6[_0x6904('0xbe')]][_0x6904('0xc1')]=moment()[_0x6904('0x7e')](_0x6904('0xc2'));}}};Dialer[_0x6904('0x1c')][_0x6904('0x37')]=function(_0x267913){var _0x4d9a79=this[_0x6904('0x28')][_0x267913[_0x6904('0xbe')]];if(this[_0x6904('0x22')][_0x267913[_0x6904('0xbd')]]){if(_0x4d9a79&&_0x4d9a79[_0x6904('0x44')]!==_0x6904('0xbf')){delete this[_0x6904('0x28')][_0x267913['uniqueid']];this['voiceQueues'][_0x267913[_0x6904('0xbd')]][_0x6904('0xc3')]+=0x1;var _0xaa6a81=new AgentComplete(_0x4d9a79,_0x267913);if(_0x267913[_0x6904('0xc4')]===_0x6904('0xc5')){_0xaa6a81[_0x6904('0xc6')]=this['voiceQueues'][_0x267913['queue']][_0x6904('0xc7')]&&this['voiceQueues'][_0x267913['queue']][_0x6904('0xc8')]?moment()[_0x6904('0x7e')](_0x6904('0xc2')):undefined;}hopperUtils['createHistory'](_0xaa6a81)[_0x6904('0xa5')](loggerCatch(_0x6904('0xc9')));hopperUtils[_0x6904('0xca')](_0xaa6a81)['catch'](loggerCatch(_0x6904('0xcb')));}}};Dialer[_0x6904('0x1c')][_0x6904('0x33')]=function(_0x59c471){var _0x3b9cc5=this[_0x6904('0x28')][_0x59c471[_0x6904('0xbe')]];var _0x5f4fe9=this;var _0x43358d=![];var _0x4f8043;var _0x1477c4;if(this[_0x6904('0x22')][_0x59c471[_0x6904('0xbd')]]){if(_0x3b9cc5&&_0x3b9cc5[_0x6904('0x44')]!=='ivr'){delete this['uniqueId'][_0x59c471[_0x6904('0xbe')]];this[_0x6904('0xc0')](this[_0x6904('0x22')][_0x59c471[_0x6904('0xbd')]]);_0x3b9cc5[_0x6904('0xcc')]=moment()[_0x6904('0x7e')](_0x6904('0xc2'));var _0x578f82=new QueueCallerAbandon(_0x3b9cc5,_0x59c471);if(utils[_0x6904('0x60')](_0x3b9cc5[_0x6904('0xcc')],_0x3b9cc5[_0x6904('0xcd')])>=_0x3b9cc5['dialQueueTimeout']){this[_0x6904('0x22')][_0x59c471['queue']][_0x6904('0xce')]+=0x1;this['voiceQueues'][_0x59c471[_0x6904('0xbd')]][_0x6904('0xcf')]+=0x1;this[_0x6904('0x22')][_0x59c471[_0x6904('0xbd')]][_0x6904('0xd0')]+=0x1;_0x578f82[_0x6904('0x71')]=0xa;_0x578f82[_0x6904('0x72')]=_0x6904('0xd1');_0x578f82['dropreason']=_0x6904('0xd2');_0x578f82[_0x6904('0xc6')]=this['voiceQueues'][_0x59c471[_0x6904('0xbd')]][_0x6904('0xc7')]?moment()[_0x6904('0x7e')](_0x6904('0xc2')):undefined;_0x578f82[_0x6904('0xd3')]+=0x1;_0x578f82[_0x6904('0xd4')]+=0x1;_0x4f8043=this[_0x6904('0x22')][_0x59c471[_0x6904('0xbd')]][_0x6904('0xd5')];_0x1477c4=this[_0x6904('0x22')][_0x59c471[_0x6904('0xbd')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0x6904('0xd6')](_0x578f82,_0x578f82[_0x6904('0x71')],_0x3b9cc5[_0x6904('0xd7')])[_0x6904('0x41')](function(_0x228b7a){_0x43358d=_0x228b7a[_0x6904('0xd8')]==0x1;if(_0x578f82[_0x6904('0xd3')]>=_0x5f4fe9[_0x6904('0x22')][_0x59c471[_0x6904('0xbd')]]['dialDropMaxRetry']){_0x5f4fe9[_0x6904('0xd9')](_0x578f82,_0x228b7a['additional']);}else{hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x578f82['countdropretry'],'scheduledat':moment()[_0x6904('0xda')](_0x5f4fe9[_0x6904('0x22')][_0x59c471[_0x6904('0xbd')]][_0x6904('0xd5')],_0x6904('0xdb'))[_0x6904('0x7e')](_0x6904('0xc2')),'ContactId':_0x3b9cc5[_0x6904('0xdc')],'ListId':_0x3b9cc5[_0x6904('0xdd')],'VoiceQueueId':_0x3b9cc5[_0x6904('0xde')]||undefined,'CampaignId':_0x3b9cc5[_0x6904('0xdf')]||undefined})[_0x6904('0xa5')](loggerCatch(_0x6904('0xe0')));var _0x59cf58=new History(_0x578f82);_0x59cf58[_0x6904('0x71')]=0xa;_0x59cf58[_0x6904('0x72')]=_0x6904('0xd1');_0x59cf58[_0x6904('0x73')]=moment()['format'](_0x6904('0xc2'));_0x59cf58[_0x6904('0xe1')]=_0x59cf58[_0x6904('0x73')];_0x59cf58[_0x6904('0xe2')]=_0x578f82[_0x6904('0xe2')];_0x59cf58['calleridnum']=_0x578f82[_0x6904('0xe3')];hopperUtils[_0x6904('0xe4')](_0x59cf58)[_0x6904('0xa5')](loggerCatch(_0x6904('0xe5')));}})['then'](function(){if(_0x43358d)hopperUtils['swapAdditionalPhones'](_0x578f82,_0x4f8043,_0x1477c4)['then'](function(){return 0x1;});});}else{this[_0x6904('0x22')][_0x59c471[_0x6904('0xbd')]][_0x6904('0xe6')]+=0x1;this[_0x6904('0x22')][_0x59c471[_0x6904('0xbd')]][_0x6904('0xe7')]+=0x1;_0x578f82[_0x6904('0x71')]=0xb;_0x578f82[_0x6904('0x72')]=_0x6904('0xe8');_0x578f82[_0x6904('0xe9')]=_0x6904('0xea');_0x578f82[_0x6904('0xeb')]+=0x1;_0x578f82['countglobal']+=0x1;_0x4f8043=this[_0x6904('0x22')][_0x59c471[_0x6904('0xbd')]][_0x6904('0xec')];_0x1477c4=this[_0x6904('0x22')][_0x59c471[_0x6904('0xbd')]][_0x6904('0xed')];hopperUtils[_0x6904('0xd6')](_0x578f82,_0x578f82['state'],_0x3b9cc5[_0x6904('0xd7')])['then'](function(_0x5d996d){if(_0x578f82[_0x6904('0xeb')]>=_0x5f4fe9[_0x6904('0x22')][_0x59c471[_0x6904('0xbd')]][_0x6904('0xee')]){_0x5f4fe9[_0x6904('0xd9')](_0x578f82,_0x5d996d[_0x6904('0xd8')]);}else{hopperUtils[_0x6904('0xef')]({'active':![],'countabandonedretry':_0x578f82[_0x6904('0xeb')],'scheduledat':moment()[_0x6904('0xda')](_0x5f4fe9[_0x6904('0x22')][_0x59c471[_0x6904('0xbd')]][_0x6904('0xec')],_0x6904('0xdb'))[_0x6904('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3b9cc5[_0x6904('0xdc')],'ListId':_0x3b9cc5[_0x6904('0xdd')],'VoiceQueueId':_0x3b9cc5[_0x6904('0xde')]||undefined,'CampaignId':_0x3b9cc5['CampaignId']||undefined})[_0x6904('0xa5')](loggerCatch(_0x6904('0xf0')));var _0x1bc766=new History(_0x578f82);_0x1bc766[_0x6904('0x71')]=0xb;_0x1bc766['statedesc']=_0x6904('0xe8');_0x1bc766[_0x6904('0x73')]=moment()['format'](_0x6904('0xc2'));_0x1bc766[_0x6904('0xe1')]=_0x1bc766['starttime'];_0x1bc766[_0x6904('0xe2')]=_0x578f82['calleridname'];_0x1bc766[_0x6904('0xe3')]=_0x578f82['calleridnum'];hopperUtils[_0x6904('0xe4')](_0x1bc766)[_0x6904('0xa5')](loggerCatch(_0x6904('0xf1')));}})[_0x6904('0x41')](function(){if(_0x43358d)hopperUtils['swapAdditionalPhones'](_0x578f82,_0x4f8043,_0x1477c4)[_0x6904('0x41')](function(){return 0x1;});});}}}};Dialer['prototype'][_0x6904('0x3a')]=function(_0x29e492){if(this[_0x6904('0xf2')][_0x29e492['uniqueid']]){this[_0x6904('0xf2')][_0x29e492[_0x6904('0xbe')]][_0x6904('0xf3')]=_0x29e492[_0x6904('0xf3')];}if(this[_0x6904('0x28')][_0x29e492[_0x6904('0xbe')]]){this['uniqueId'][_0x29e492[_0x6904('0xbe')]][_0x6904('0xf3')]=_0x29e492[_0x6904('0xf3')];}};Dialer[_0x6904('0x1c')][_0x6904('0x3d')]=function(_0x672a2c){if(!this[_0x6904('0xf2')][_0x672a2c[_0x6904('0xf4')]]){return;}var _0x3610ff=this[_0x6904('0x22')][this['actions'][_0x672a2c[_0x6904('0xf4')]]['queue']][_0x6904('0xf5')]||'rrmemory';if(_0x3610ff===_0x6904('0xf6')){if(this[_0x6904('0xf2')][_0x672a2c[_0x6904('0xf4')]]&&_[_0x6904('0xf7')](this['actions'][_0x672a2c[_0x6904('0xf4')]][_0x6904('0xf8')])&&_0x672a2c[_0x6904('0x88')]==='1'&&_0x672a2c[_0x6904('0xf9')]==='0'){if(this[_0x6904('0x24')][_0x672a2c[_0x6904('0xfa')]]){if(!this[_0x6904('0x24')][_0x672a2c['stateinterface']][_0x6904('0xf8')]){this[_0x6904('0x24')][_0x672a2c[_0x6904('0xfa')]][_0x6904('0xf8')]=!![];this[_0x6904('0xf2')][_0x672a2c['actionid']]['locked']=!![];this[_0x6904('0xf2')][_0x672a2c['actionid']][_0x6904('0xfa')]=_0x672a2c[_0x6904('0xfa')];}}}}else if(_0x3610ff===_0x6904('0xfb')){if(this[_0x6904('0xf2')][_0x672a2c[_0x6904('0xf4')]]){if(this[_0x6904('0x24')][_0x672a2c[_0x6904('0xfa')]]){this[_0x6904('0xf2')][_0x672a2c[_0x6904('0xf4')]]['stateinterface']=_0x672a2c[_0x6904('0xfa')];if(_[_0x6904('0xf7')](this[_0x6904('0x2c')][this[_0x6904('0xf2')][_0x672a2c[_0x6904('0xf4')]][_0x6904('0xbd')]])){this[_0x6904('0x2c')][this[_0x6904('0xf2')][_0x672a2c[_0x6904('0xf4')]][_0x6904('0xbd')]]=[];}this[_0x6904('0x2c')][this[_0x6904('0xf2')][_0x672a2c['actionid']][_0x6904('0xbd')]][_0x6904('0x9d')](_[_0x6904('0xfc')](_[_0x6904('0xfd')](this[_0x6904('0xf2')][_0x672a2c[_0x6904('0xf4')]],['idHopper',_0x6904('0xfa')]),{'status':_0x672a2c[_0x6904('0x88')],'paused':_0x672a2c[_0x6904('0xf9')]}));}}}};Dialer[_0x6904('0x1c')][_0x6904('0x3f')]=function(_0x558f12){if(!this[_0x6904('0xf2')][_0x558f12['actionid']]){return;}var _0x3c6c00=this;var _0x220c75=this[_0x6904('0x22')][this[_0x6904('0xf2')][_0x558f12[_0x6904('0xf4')]]['queue']];var _0x5c7572=_0x220c75[_0x6904('0xf5')]||_0x6904('0xfb');if(_0x5c7572===_0x6904('0xf6')){if(this[_0x6904('0xf2')][_0x558f12[_0x6904('0xf4')]]&&this['actions'][_0x558f12[_0x6904('0xf4')]]['stateinterface']){this[_0x6904('0x21')][_0x6904('0xfe')](this[_0x6904('0xf2')][_0x558f12[_0x6904('0xf4')]][_0x6904('0xff')],this['actions'][_0x558f12[_0x6904('0xf4')]][_0x6904('0xfa')])['catch'](function(_0x171b4f){logger[_0x6904('0x75')](_0x6904('0x100'),util[_0x6904('0x67')](_0x171b4f,{'showHidden':![],'depth':null}));})[_0x6904('0x1f')](function(){_0x3c6c00[_0x6904('0xc0')](_0x3c6c00[_0x6904('0x22')][_0x3c6c00[_0x6904('0xf2')][_0x558f12[_0x6904('0xf4')]][_0x6904('0xbd')]]);_0x3c6c00['agents'][_0x3c6c00[_0x6904('0xf2')][_0x558f12[_0x6904('0xf4')]][_0x6904('0xfa')]]['locked']=![];delete _0x3c6c00['actions'][_0x558f12[_0x6904('0xf4')]];unlockQueueStatus(_0x220c75);});}else{this[_0x6904('0xc0')](this[_0x6904('0x22')][this['actions'][_0x558f12[_0x6904('0xf4')]][_0x6904('0xbd')]]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x558f12[_0x6904('0xf4')]][_0x6904('0xdc')],'ListId':this[_0x6904('0xf2')][_0x558f12[_0x6904('0xf4')]][_0x6904('0xdd')],'VoiceQueueId':this[_0x6904('0xf2')][_0x558f12[_0x6904('0xf4')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x6904('0xf2')][_0x558f12[_0x6904('0xf4')]][_0x6904('0xdf')]||undefined})[_0x6904('0xa5')](loggerCatch(_0x6904('0x101')));delete this[_0x6904('0xf2')][_0x558f12['actionid']];unlockQueueStatus(_0x220c75);}}else if(_0x5c7572===_0x6904('0xfb')){var _0x45cb7d;if(this['actions'][_0x558f12[_0x6904('0xf4')]]&&!_[_0x6904('0x49')](this[_0x6904('0x2c')][this[_0x6904('0xf2')][_0x558f12[_0x6904('0xf4')]][_0x6904('0xbd')]])){if(this[_0x6904('0x2d')][_0x3c6c00['actions'][_0x558f12[_0x6904('0xf4')]][_0x6904('0xbd')]]){this[_0x6904('0x2d')][_0x3c6c00[_0x6904('0xf2')][_0x558f12['actionid']][_0x6904('0xbd')]]=this[_0x6904('0x2d')][this[_0x6904('0xf2')][_0x558f12[_0x6904('0xf4')]][_0x6904('0xbd')]]?this['queueBookedRR'][this[_0x6904('0xf2')][_0x558f12[_0x6904('0xf4')]][_0x6904('0xbd')]]:this[_0x6904('0x2c')][this['actions'][_0x558f12['actionid']][_0x6904('0xbd')]]?this['queueBooked'][this['actions'][_0x558f12[_0x6904('0xf4')]][_0x6904('0xbd')]]['_rr']||0x0:0x0;}this[_0x6904('0x2c')][this[_0x6904('0xf2')][_0x558f12[_0x6904('0xf4')]][_0x6904('0xbd')]][_0x6904('0x102')]=this[_0x6904('0x2d')][this[_0x6904('0xf2')][_0x558f12[_0x6904('0xf4')]][_0x6904('0xbd')]];for(var _0x39ade7=0x0;_0x39ade7=_0x1b2cc1[_0x6904('0x125')]){_0x2a85e4['stateGlobal'](_0x3f2a0b,_0x1b8f83,_0x13ba1b,'reason19\x20machine....');}else{if(_0x3f2a0b[_0x6904('0x11f')]>=_0x1b2cc1[_0x6904('0x126')]){_0x2a85e4[_0x6904('0x127')](_0x3f2a0b,_0x1b8f83,_0x13ba1b,_0x6904('0x128'));}else{hopperUtils[_0x6904('0xef')]({'active':![],'countmachineretry':_0x3f2a0b[_0x6904('0x11f')],'scheduledat':moment()['add'](_0x1b2cc1[_0x6904('0x129')],_0x6904('0xdb'))[_0x6904('0x7e')](_0x6904('0xc2')),'ContactId':_0x3f2a0b['ContactId'],'ListId':_0x3f2a0b[_0x6904('0xdd')],'VoiceQueueId':_0x3f2a0b['VoiceQueueId']||undefined,'CampaignId':_0x3f2a0b[_0x6904('0xdf')]||undefined})[_0x6904('0xa5')](loggerCatch(_0x6904('0x12a')));_0x1b8f83({'reschedule':0x1});}}});}if(_0x385725[_0x6904('0x44')]===_0x6904('0xbf')&&this[_0x6904('0x23')][_0x385725['queue']]['dialAMDActive']&&_0x279365[_0x6904('0x112')]===_0x6904('0x113')){delete this[_0x6904('0x28')][_0x279365[_0x6904('0xbe')]];this[_0x6904('0xc0')](this[_0x6904('0x23')][_0x385725['queue']]);_0x3bc9da=new Hangup(_0x385725,_0x279365);_0x3bc9da['state']=0x12;_0x3bc9da[_0x6904('0x72')]=_0x6904('0x12b');_0x3bc9da[_0x6904('0x115')]='AMD';ami[_0x6904('0x43')](_0x6904('0x117'),ut['buildObj'](_0x3bc9da,_0x6904('0x118')));this[_0x6904('0x119')](_0x3bc9da,_0x6904('0x12c'),_0x6904('0x12d'));}if(_0x385725[_0x6904('0x44')]==='ivr'&&this['campaigns'][_0x385725[_0x6904('0xbd')]]['dialAMDActive']&&_0x279365[_0x6904('0x112')]===_0x6904('0x11d')){return new Promise(function(_0x2625b9,_0x5a61dd){delete _0x2a85e4['uniqueId'][_0x279365[_0x6904('0xbe')]];_0x2a85e4[_0x6904('0xc0')](_0x2a85e4[_0x6904('0x23')][_0x385725['queue']]);_0x2a85e4[_0x6904('0x23')][_0x385725[_0x6904('0xbd')]]['outboundAnswerCallsDay']+=0x1;_0x2a85e4['campaigns'][_0x385725['queue']]['outboundAnswerAgiCallsDay']+=0x1;var _0x39be3e=_0x2a85e4['campaigns'][_0x385725['queue']];var _0x594096=new Hangup(_0x385725,_0x279365);_0x594096['state']=0x13;_0x594096[_0x6904('0x72')]=_0x6904('0x11e');_0x594096['membername']=_0x6904('0x116');_0x594096[_0x6904('0x11f')]+=0x1;_0x594096['countglobal']+=0x1;_0x594096[_0x6904('0x118')]=!![];ami[_0x6904('0x43')]('custom:amd',ut[_0x6904('0x120')](_0x594096,_0x6904('0x118')));hopperUtils[_0x6904('0xe4')](_0x594096)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x594096['countbusyretry']+_0x594096['countcongestionretry']+_0x594096['countnoanswerretry']+_0x594096[_0x6904('0x123')]+_0x594096[_0x6904('0xd3')]+_0x594096[_0x6904('0xeb')]+_0x594096[_0x6904('0x11f')]+_0x594096[_0x6904('0x124')]>=_0x39be3e['dialGlobalMaxRetry']){_0x2a85e4[_0x6904('0x12e')](_0x594096,_0x2625b9,_0x5a61dd,'reason19\x20machine....');}else{if(_0x594096[_0x6904('0x11f')]>=_0x39be3e['dialMachineMaxRetry']){_0x2a85e4[_0x6904('0x127')](_0x594096,_0x2625b9,_0x5a61dd,_0x6904('0x128'));}else{hopperUtils[_0x6904('0xef')]({'active':![],'countmachineretry':_0x594096[_0x6904('0x11f')],'scheduledat':moment()[_0x6904('0xda')](_0x39be3e['dialMachineRetryFrequency'],'minutes')[_0x6904('0x7e')](_0x6904('0xc2')),'ContactId':_0x594096[_0x6904('0xdc')],'ListId':_0x594096[_0x6904('0xdd')],'VoiceQueueId':_0x594096[_0x6904('0xde')]||undefined,'CampaignId':_0x594096[_0x6904('0xdf')]||undefined})['catch'](loggerCatch(_0x6904('0x12a')));_0x2625b9({'reschedule':0x1});}}});}}};Dialer[_0x6904('0x1c')]['syncHangup']=function(_0x4a4d85){var _0x16ccb8=this[_0x6904('0x28')][_0x4a4d85[_0x6904('0xbe')]];var _0x18d113;if(_0x16ccb8&&_0x16ccb8['type']===_0x6904('0xbf')){delete this[_0x6904('0x28')][_0x4a4d85['uniqueid']];this['updateOriginated'](this[_0x6904('0x23')][_0x16ccb8[_0x6904('0xbd')]]);this[_0x6904('0x23')][_0x16ccb8[_0x6904('0xbd')]][_0x6904('0x12f')]+=0x1;_0x18d113=new Hangup(_0x16ccb8,_0x4a4d85);hopperUtils['createHistory'](_0x18d113)[_0x6904('0xa5')](loggerCatch(_0x6904('0x130')));hopperUtils['moveContactManagedDialer'](_0x18d113)['catch'](loggerCatch(_0x6904('0x131')));}if(_0x16ccb8&&_0x16ccb8[_0x6904('0x44')]!=='ivr'&&isNotNull(this[_0x6904('0x22')][_0x16ccb8[_0x6904('0xbd')]][_0x6904('0x132')])){delete this[_0x6904('0x28')][_0x4a4d85[_0x6904('0xbe')]];this[_0x6904('0xc0')](this[_0x6904('0x22')][_0x16ccb8[_0x6904('0xbd')]]);this[_0x6904('0x22')][_0x16ccb8['queue']][_0x6904('0xc3')]+=0x1;this[_0x6904('0x22')][_0x16ccb8[_0x6904('0xbd')]][_0x6904('0x114')]+=0x1;_0x18d113=new Hangup(_0x16ccb8,_0x4a4d85);_0x18d113[_0x6904('0x71')]=0x10;_0x18d113[_0x6904('0x72')]=_0x6904('0x133');_0x18d113[_0x6904('0x115')]=_0x6904('0x134');hopperUtils['createHistory'](_0x18d113)[_0x6904('0xa5')](loggerCatch(_0x6904('0x130')));hopperUtils['moveContactManagedDialer'](_0x18d113)[_0x6904('0xa5')](loggerCatch(_0x6904('0x131')));}if(_0x16ccb8&&_0x16ccb8[_0x6904('0x44')]!==_0x6904('0xbf')&&!isNotNull(this[_0x6904('0x22')][_0x16ccb8[_0x6904('0xbd')]]['dialQueueProject'])){if(_0x4a4d85['cause-txt']===_0x6904('0x135')){delete this[_0x6904('0x28')][_0x4a4d85[_0x6904('0xbe')]];this[_0x6904('0x22')][_0x16ccb8[_0x6904('0xbd')]]['outboundAnswerCallsDay']+=0x1;const _0x4db67d=new AgentComplete(_0x16ccb8,_0x4a4d85);_0x4db67d['CampaignId']=this[_0x6904('0x22')][_0x16ccb8['queue']]['id'];hopperUtils['createHistory'](_0x4db67d)[_0x6904('0xa5')](loggerCatch(_0x6904('0xc9')));hopperUtils[_0x6904('0xca')](_0x4db67d)[_0x6904('0xa5')](loggerCatch(_0x6904('0xcb')));}else{delete this[_0x6904('0x28')][_0x4a4d85['uniqueid']];this[_0x6904('0xc0')](this['voiceQueues'][_0x16ccb8[_0x6904('0xbd')]]);this[_0x6904('0x22')][_0x16ccb8[_0x6904('0xbd')]][_0x6904('0x136')]+=0x1;_0x18d113=new Hangup(_0x16ccb8,_0x4a4d85);_0x18d113['state']=0xc;_0x18d113[_0x6904('0x72')]=_0x4a4d85[_0x6904('0x137')];_0x18d113[_0x6904('0x115')]='Unknow';hopperUtils[_0x6904('0xe4')](_0x18d113)[_0x6904('0xa5')](loggerCatch(_0x6904('0x130')));hopperUtils[_0x6904('0xca')](_0x18d113)[_0x6904('0xa5')](loggerCatch(_0x6904('0x131')));}}};Dialer[_0x6904('0x1c')][_0x6904('0xd')]=function(_0x53c6a3){var _0x1fd2d4=this;if(!_0x1fd2d4['queuesSummary'][_0x53c6a3[_0x6904('0x62')]]){_0x1fd2d4[_0x6904('0x2e')][_0x53c6a3[_0x6904('0x62')]]={'running':![]};}else if(_0x1fd2d4[_0x6904('0x2e')][_0x53c6a3[_0x6904('0x62')]]['running']===!![]){return;}else if(_0x1fd2d4[_0x6904('0x2e')][_0x53c6a3['name']][_0x6904('0x138')]===![]){_0x1fd2d4['queuesSummary'][_0x53c6a3[_0x6904('0x62')]]['running']=!![];}var _0x3b53b4=_0x1fd2d4[_0x6904('0x22')][_0x53c6a3[_0x6904('0x62')]];var _0x26d53e=_0x3b53b4[_0x6904('0x6b')]!==utils['CAMPAIGN_STATUS'][_0x6904('0x7b')];var _0x5cf9ba=utils['isPreviewCampaign'](_0x3b53b4);_0x3b53b4[_0x6904('0x139')]=utils['getQueueCampaignStatusMessage'](_0x3b53b4,_0x1fd2d4['trunks']);Promise['resolve']()[_0x6904('0x41')](function(){if(_0x3b53b4['statusMessage']===utils[_0x6904('0x6c')][_0x6904('0x7b')]){if(_0x26d53e){clearPredictiveAttributes(_0x3b53b4);_0x53c6a3[_0x6904('0x2a')]=undefined;_0x53c6a3[_0x6904('0x61')]=undefined;}if(_0x3b53b4[_0x6904('0x139')]===utils['CAMPAIGN_STATUS'][_0x6904('0x7b')]){_0x53c6a3[_0x6904('0x13a')]=0x0;_0x53c6a3['paused']=0x0;_0x53c6a3['inUse']=0x0;_0x53c6a3[_0x6904('0x13b')]=0x0;_0x53c6a3['pTalking']=0x0;}}else if(_0x3b53b4['statusMessage']===utils[_0x6904('0x6c')][_0x6904('0x13c')]&&!_0x5cf9ba){return _0x1fd2d4['ifTime'](_0x3b53b4,!![])[_0x6904('0x41')](function(){return _0x1fd2d4['ifTime'](_0x3b53b4,![]);})[_0x6904('0x41')](function(){return _0x1fd2d4['checkDialMethod'](_0x3b53b4);})[_0x6904('0xa5')](function(_0x4fa2ce){loggerSyncQueueSummary['debug']('[syncQueueSummary]',util[_0x6904('0x67')](_0x4fa2ce,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x3b53b4);});}else{clearPredictiveAttributes(_0x3b53b4);}})[_0x6904('0x41')](function(){var _0x10a7cc=_0x53c6a3['compareToOutboundQueue'](_0x3b53b4);if(_0x10a7cc||_0x3b53b4[_0x6904('0x13d')]){_0x3b53b4[_0x6904('0x13d')]=![];_0x53c6a3['updateReportFromOutboundQueue'](_0x3b53b4);Object[_0x6904('0x13e')](_0x3b53b4,_0x53c6a3);emitOutboundVoiceQueueSummary(_0x53c6a3);}_0x1fd2d4[_0x6904('0x2e')][_0x3b53b4['name']][_0x6904('0x138')]=![];})[_0x6904('0xa5')](function(_0x3b547e){logger[_0x6904('0x75')](_0x6904('0x13f'),util[_0x6904('0x67')](_0x3b547e,{'showHidden':![],'depth':null}));_0x1fd2d4[_0x6904('0x2e')][_0x3b53b4[_0x6904('0x62')]][_0x6904('0x138')]=![];});};Dialer['prototype'][_0x6904('0x140')]=_[_0x6904('0x141')](function(){var _0x2462b1=_['filter'](this[_0x6904('0x22')],function(_0x3faed8){return _0x3faed8['dialPreviewRecallmeReminder'];});var _0x1b797b=_['filter'](this[_0x6904('0x24')],function(_0x255006){return _0x255006['online']&&_0x255006[_0x6904('0x88')]===_0x6904('0x142');});if(_0x2462b1[_0x6904('0x103')]>0x0&&_0x1b797b[_0x6904('0x103')]>0x0){return Promise[_0x6904('0x143')]()[_0x6904('0x41')](cmHopper[_0x6904('0x144')](_[_0x6904('0x145')](_0x2462b1,'id'),previewRecallmeReminderInterval,_[_0x6904('0x145')](_0x1b797b,'id')))[_0x6904('0x41')](function(_0x2ba929){for(var _0x21e3ee=0x0;_0x21e3ee<_0x2ba929[_0x6904('0x103')];_0x21e3ee++){var _0x11ce42=_0x2ba929[_0x21e3ee][_0x6904('0x146')][_0x6904('0x62')];if(_0x11ce42)io['to'](util[_0x6904('0x7e')](_0x6904('0x147'),_0x11ce42))[_0x6904('0x43')](_0x6904('0x148'),{'hopper':_0x2ba929[_0x21e3ee]});}})[_0x6904('0xa5')](function(_0x573e6e){logger['error'](_0x6904('0x149'),_0x573e6e);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x6904('0x1c')][_0x6904('0x14a')]=function(){var _0x25881e=this;setInterval(function(){_0x25881e[_0x6904('0x14b')](_0x25881e[_0x6904('0x28')],_0x6904('0x14c'));_0x25881e[_0x6904('0x14b')](_0x25881e[_0x6904('0xf2')],_0x6904('0x14d'));},0x32c8);};Dialer[_0x6904('0x1c')][_0x6904('0x14b')]=function(_0x490859,_0x1d6a48){var _0x382a50=this;for(var _0x3802f1 in _0x490859){if(typeof _0x490859[_0x3802f1]!==_0x6904('0x14e')){this[_0x6904('0x20')][_0x6904('0x1d')](function(){if(!_[_0x6904('0xf7')](_0x490859[_0x3802f1])){return ami[_0x6904('0x99')]({'action':_0x6904('0x88'),'channel':_0x490859[_0x3802f1]['channel']})[_0x6904('0xa5')](function(_0x35db85){if(_0x35db85[_0x6904('0x6b')]===_0x6904('0x14f')){setTimeout(function(){if(_0x490859[_0x3802f1]&&_0x490859[_0x3802f1][_0x6904('0x44')]!==_0x6904('0xbf')){_0x382a50[_0x6904('0xc0')](_0x382a50['voiceQueues'][_0x490859[_0x3802f1][_0x6904('0xbd')]]);logger['error'](_0x6904('0x150'),_0x1d6a48,_0x3802f1,_0x490859[_0x3802f1]['queue']);delete _0x490859[_0x3802f1];}if(_0x490859[_0x3802f1]&&_0x490859[_0x3802f1][_0x6904('0x44')]===_0x6904('0xbf')){_0x382a50[_0x6904('0xc0')](_0x382a50['campaigns'][_0x490859[_0x3802f1][_0x6904('0xbd')]]);logger[_0x6904('0x75')](_0x6904('0x151'),_0x1d6a48,_0x3802f1,_0x490859[_0x3802f1]['queue']);delete _0x490859[_0x3802f1];}},0x2328);}});}});}}};Dialer[_0x6904('0x1c')][_0x6904('0x152')]=function(_0x16904f){return Promise[_0x6904('0x143')]()[_0x6904('0x41')](voiceQueueRt[_0x6904('0x152')](_0x16904f))[_0x6904('0xa5')](loggerCatch(_0x6904('0x153')));};Dialer[_0x6904('0x1c')]['updateOriginated']=function(_0x3d5b8d){if(!_[_0x6904('0x42')](_0x3d5b8d)&&_0x3d5b8d!==null){if(typeof _0x3d5b8d[_0x6904('0x81')]!==_0x6904('0x14e')){if(_0x3d5b8d[_0x6904('0x81')]>0x0){_0x3d5b8d[_0x6904('0x81')]-=0x1;}else{logger['error'](_0x6904('0x154'));}}}else{logger[_0x6904('0x75')](_0x6904('0x155'));}};Dialer[_0x6904('0x1c')][_0x6904('0x156')]=function(_0x10061d,_0x1cdfec){var _0x5119e9=this;return function(_0x544138){_0x5119e9[_0x6904('0xc0')](_0x1cdfec);logger['error'](_0x10061d,util[_0x6904('0x67')](_0x544138,{'showHidden':![],'depth':null}));};};Dialer[_0x6904('0x1c')][_0x6904('0x157')]=function(_0x1bd8d6,_0x40a031,_0x22b197){var _0x4be499={'state':0x19,'statedesc':'notFound'};this['updateOriginated'](_0x40a031);this[_0x6904('0x119')](_[_0x6904('0xfc')](_0x4be499,_['pick'](_0x22b197,[_0x6904('0xdc'),_0x6904('0xdd'),_0x6904('0x158'),'VoiceQueueId','CampaignId'])),_0x6904('0x159'),'[emptyContact]');logger['error'](_0x1bd8d6);};Dialer[_0x6904('0x1c')][_0x6904('0x119')]=function(_0x1ad2db,_0x32abf1,_0x5b4a99){hopperUtils[_0x6904('0xe4')](_0x1ad2db)[_0x6904('0xa5')](loggerCatch(_0x32abf1));hopperUtils[_0x6904('0xca')](_0x1ad2db)[_0x6904('0xa5')](loggerCatch(_0x5b4a99));};Dialer[_0x6904('0x1c')][_0x6904('0xd9')]=function(_0x26ce97,_0x374c2e){hopperUtils['createHistory'](_0x26ce97)[_0x6904('0xa5')](loggerCatch(_0x6904('0xc9')));if(_0x374c2e==0x0){hopperUtils['moveContactManagedDialer'](_0x26ce97)[_0x6904('0xa5')](loggerCatch(_0x6904('0x15a')));}};Dialer[_0x6904('0x1c')][_0x6904('0x149')]=function(_0x2dac8d){return Promise['resolve']()['then'](cmHopper[_0x6904('0x144')](_0x2dac8d['id'],previewRecallmeReminderInterval))['then'](function(_0x5dc772){for(var _0x46144f=0x0;_0x46144f<_0x5dc772[_0x6904('0x103')];_0x46144f++){var _0x13ebaa=_0x5dc772[_0x46144f][_0x6904('0x146')]['name'];if(_0x13ebaa)io['to'](util[_0x6904('0x7e')](_0x6904('0x147'),_0x13ebaa))[_0x6904('0x43')](_0x6904('0x148'),{'hopper':_0x5dc772[_0x46144f]});}})['catch'](function(){});};Dialer[_0x6904('0x1c')][_0x6904('0xaa')]=function(_0x453f09){var _0x36a7fb=this;return function(){_0x36a7fb['handleIvr'](_0x453f09);};};Dialer['prototype'][_0x6904('0x15b')]=function(_0xee8898,_0x51d0c3){var _0x10cf73=this;var _0xfd6577=uuid['v4']();this[_0x6904('0xf2')][_0xfd6577]=new Action(_0xee8898,_0x51d0c3,_0xfd6577);return new Promise(function(_0x1efac8,_0x217ced){if(_[_0x6904('0x42')](_0xee8898)&&typeof _0xee8898!==_0x6904('0x15c')){return _0x217ced(msgResponse(_0x6904('0x15d'),_0x6904('0x92'),_0x6904('0x15e')));}if(_[_0x6904('0x42')](_0x51d0c3[_0x6904('0x15f')])||_0x51d0c3[_0x6904('0x15f')]===null){return _0x217ced(msgResponse(_0x6904('0x15d'),_0x6904('0x92'),'contact\x20is\x20undefine'));}var _0x1d5dcd={'XMD-CALLERID':_0x10cf73[_0x6904('0xf2')][_0xfd6577]['getCaller'](),'XMD-AGI':_0xee8898[_0x6904('0x132')]?util[_0x6904('0x7e')](_0x6904('0x160'),ipAgi,_0xee8898[_0x6904('0x132')]):'NONE','XMD-AGIAFTER':_0xee8898[_0x6904('0xc7')]?util[_0x6904('0x7e')](_0x6904('0x160'),ipAgi,_0xee8898['dialQueueProject2']):_0x6904('0x161'),'XMD-QUEUE':utils[_0x6904('0x162')](_0xee8898)?util['format'](_0x6904('0x163'),_0xee8898[_0x6904('0x62')],_0xee8898['dialQueueOptions']||'',_0xee8898['dialAgiAfterHangupAgent']?'c':'',_0xee8898[_0x6904('0x164')]||0x3):_0x6904('0x161'),'XMD-CONTACTID':_0x51d0c3[_0x6904('0xdc')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x10cf73[_0x6904('0xf2')][_0xfd6577][_0x6904('0x165')](),'XMD-AMD':_0xee8898[_0x6904('0x11c')]?_0x6904('0x13c'):_0x6904('0x161'),'XMD-DESTINATION':_0x6904('0x111')};if(_0xee8898['dialAMDActive']){_0x1d5dcd[_0x6904('0x166')]=_0xee8898[_0x6904('0x167')]||0x9c4;_0x1d5dcd['XMD-AMDGREETING']=_0xee8898[_0x6904('0x168')]||0x5dc;_0x1d5dcd['XMD-AMDAFTERGREETINGSILENCE']=_0xee8898['dialAMDAfterGreetingSilence']||0x320;_0x1d5dcd[_0x6904('0x169')]=_0xee8898['dialAMDTotalAnalysisTime']||0x1388;_0x1d5dcd['XMD-AMDMINWORDLENGTH']=_0xee8898['dialAMDMinWordLength']||0x64;_0x1d5dcd[_0x6904('0x16a')]=_0xee8898['dialAMDBetweenWordsSilence']||0x32;_0x1d5dcd[_0x6904('0x16b')]=_0xee8898['dialAMDMaximumNumberOfWords']||0x3;_0x1d5dcd[_0x6904('0x16c')]=_0xee8898[_0x6904('0x16d')]||0x100;_0x1d5dcd['XMD-AMDMAXIMUMWORDLENGTH']=_0xee8898[_0x6904('0x16e')]||0x1388;}if(utils['isOutboundQueue'](_0xee8898)){_0x1d5dcd[_0x6904('0x16f')]=_0x51d0c3[_0x6904('0xde')];}else{_0x1d5dcd['XMD-CAMPAIGNID']=_0x51d0c3[_0x6904('0xdf')];}var _0xf9b1bb=utils['setXMDContactVariables'](_0x51d0c3[_0x6904('0x170')]);Object[_0x6904('0x13e')](_0x1d5dcd,_0xf9b1bb);var _0x2247f8=_0x10cf73[_0x6904('0x86')](_0xee8898[_0x6904('0x8b')])?utils[_0x6904('0x171')](_0xee8898[_0x6904('0x8b')][_0x6904('0x172')],_0xee8898[_0x6904('0x173')],_0xee8898[_0x6904('0x174')]>0x0?utils[_0x6904('0x175')](_0xee8898[_0x6904('0x176')],_0xee8898[_0x6904('0x174')]):_0xee8898[_0x6904('0x176')]):utils[_0x6904('0x171')](_[_0x6904('0xf7')](_0xee8898[_0x6904('0x8c')])?_0xee8898[_0x6904('0x8b')][_0x6904('0x172')]:_0xee8898['TrunkBackup'][_0x6904('0x172')],_0xee8898[_0x6904('0x173')],_0xee8898[_0x6904('0x174')]>0x0?utils[_0x6904('0x175')](_0xee8898[_0x6904('0x176')],_0xee8898[_0x6904('0x174')]):_0xee8898[_0x6904('0x176')]);if(_0x2247f8){_0x1d5dcd['XMD-ORIGINATECALLERIDNAME']=_0x10cf73[_0x6904('0xf2')][_0xfd6577][_0x6904('0x177')]=utils[_0x6904('0x178')](_0x2247f8);_0x1d5dcd['XMD-ORIGINATECALLERIDNUM']=_0x51d0c3['phone'];}_0xee8898[_0x6904('0x179')]=_0x1d5dcd;return ami[_0x6904('0x99')]({'actionid':_0xfd6577,'action':'originate','channel':_0x10cf73[_0x6904('0x86')](_0xee8898[_0x6904('0x8b')])?util[_0x6904('0x7e')](_0x6904('0x17a'),_0xee8898[_0x6904('0x8b')][_0x6904('0x62')],isNotNull(_0xee8898['dialPrefix'])?_0xee8898[_0x6904('0x17b')][_0x6904('0x17c')]()||'':'',_0xee8898[_0x6904('0x17d')]>0x0?_0x51d0c3[_0x6904('0x15f')][_0x6904('0x17e')](_0xee8898[_0x6904('0x17d')]):_0x51d0c3[_0x6904('0x15f')]):util[_0x6904('0x7e')]('SIP/%s/%s%s',_[_0x6904('0xf7')](_0xee8898[_0x6904('0x8c')])?_0xee8898[_0x6904('0x8b')][_0x6904('0x62')]:_0xee8898[_0x6904('0x8c')][_0x6904('0x62')],isNotNull(_0xee8898[_0x6904('0x17b')])?_0xee8898[_0x6904('0x17b')][_0x6904('0x17c')]()||'':'',_0xee8898['dialCutDigit']>0x0?_0x51d0c3[_0x6904('0x15f')][_0x6904('0x17e')](_0xee8898[_0x6904('0x17d')]):_0x51d0c3['phone']),'callerid':_0x2247f8,'Exten':'xcally-motion-dialer','Context':_0x6904('0x17f'),'Priority':'1','variable':_0x1d5dcd,'timeout':(_0xee8898[_0x6904('0x180')]||0x1e)*0x3e8,'async':!![],'channelid':_0xfd6577})[_0x6904('0x41')](function(_0x30dba7){return _0x1efac8(_0x30dba7);})[_0x6904('0xa5')](function(_0x17d865){_0xee8898[_0x6904('0x181')]+=0x1;var _0x12ede9=new History(_0x10cf73['actions'][_0xfd6577]);logger[_0x6904('0x75')](util[_0x6904('0x7e')](_0x6904('0x182'),JSON['stringify'](_0x17d865)));_0x12ede9['state']=0xe;_0x12ede9[_0x6904('0x72')]=_0x6904('0x183');_0x12ede9[_0x6904('0x73')]=moment()[_0x6904('0x7e')](_0x6904('0xc2'));_0x12ede9[_0x6904('0xe1')]=_0x12ede9[_0x6904('0x73')];hopperUtils[_0x6904('0xe4')](_0x12ede9)['catch'](loggerCatch(_0x6904('0x184')));_0x10cf73['moveContactManagedDialer'](_0x12ede9)[_0x6904('0xa5')](loggerCatch('[originate][error]'))['finally'](function(){delete _0x10cf73[_0x6904('0xf2')][_0xfd6577];return _0x217ced(msgResponse(_0x6904('0x15d'),_0x6904('0x85'),_0x6904('0x185')));});});});};Dialer[_0x6904('0x1c')][_0x6904('0x186')]=function(_0x2f8bea,_0x26b922,_0x1e6744){var _0x3ecc93=new History(_0x26b922);if(_0x3ecc93[_0x6904('0x187')]+_0x3ecc93[_0x6904('0x121')]+_0x3ecc93[_0x6904('0x122')]+_0x3ecc93[_0x6904('0x123')]+_0x3ecc93['countdropretry']+_0x3ecc93[_0x6904('0xeb')]+_0x3ecc93[_0x6904('0x11f')]+_0x3ecc93[_0x6904('0x124')]>=_0x1e6744[_0x6904('0x125')]-0x1){return!![];}switch(_0x2f8bea){case 0x3:if(_0x3ecc93[_0x6904('0x122')]>=_0x1e6744[_0x6904('0x188')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x3ecc93[_0x6904('0x122')]+=0x1,'scheduledat':moment()['add'](_0x1e6744[_0x6904('0x189')],'minutes')[_0x6904('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ecc93[_0x6904('0xdc')],'ListId':_0x3ecc93[_0x6904('0xdd')],'VoiceQueueId':_0x3ecc93[_0x6904('0xde')]||undefined,'CampaignId':_0x3ecc93[_0x6904('0xdf')]||undefined})[_0x6904('0xa5')](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x3ecc93[_0x6904('0x187')]>=_0x1e6744[_0x6904('0x18a')]-0x1){return!![];}hopperUtils[_0x6904('0xef')]({'active':![],'countbusyretry':_0x3ecc93['countbusyretry']+=0x1,'scheduledat':moment()[_0x6904('0xda')](_0x1e6744['dialBusyRetryFrequency'],'minutes')[_0x6904('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ecc93['ContactId'],'ListId':_0x3ecc93[_0x6904('0xdd')],'VoiceQueueId':_0x3ecc93['VoiceQueueId']||undefined,'CampaignId':_0x3ecc93[_0x6904('0xdf')]||undefined})[_0x6904('0xa5')](loggerCatch(_0x6904('0x18b')));break;case 0x8:if(_0x3ecc93[_0x6904('0x121')]>=_0x1e6744[_0x6904('0x18c')]-0x1){return!![];}hopperUtils[_0x6904('0xef')]({'active':![],'countcongestionretry':_0x3ecc93[_0x6904('0x121')]+=0x1,'scheduledat':moment()[_0x6904('0xda')](_0x1e6744[_0x6904('0x18d')],_0x6904('0xdb'))[_0x6904('0x7e')](_0x6904('0xc2')),'ContactId':_0x3ecc93[_0x6904('0xdc')],'ListId':_0x3ecc93[_0x6904('0xdd')],'VoiceQueueId':_0x3ecc93[_0x6904('0xde')]||undefined,'CampaignId':_0x3ecc93['CampaignId']||undefined})[_0x6904('0xa5')](loggerCatch(_0x6904('0x18e')));break;case 0x0:if(_0x3ecc93[_0x6904('0x123')]>=_0x1e6744['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x3ecc93[_0x6904('0x123')]+=0x1,'scheduledat':moment()[_0x6904('0xda')](_0x1e6744[_0x6904('0x18f')],_0x6904('0xdb'))[_0x6904('0x7e')](_0x6904('0xc2')),'ContactId':_0x3ecc93[_0x6904('0xdc')],'ListId':_0x3ecc93[_0x6904('0xdd')],'VoiceQueueId':_0x3ecc93[_0x6904('0xde')]||undefined,'CampaignId':_0x3ecc93[_0x6904('0xdf')]||undefined})[_0x6904('0xa5')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x3ecc93[_0x6904('0xd3')]>=_0x1e6744[_0x6904('0x190')]-0x1){return!![];}hopperUtils[_0x6904('0xef')]({'active':![],'countdropretry':_0x3ecc93[_0x6904('0xd3')]+=0x1,'scheduledat':moment()['add'](_0x1e6744[_0x6904('0xd5')],_0x6904('0xdb'))[_0x6904('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ecc93[_0x6904('0xdc')],'ListId':_0x3ecc93['ListId'],'VoiceQueueId':_0x3ecc93[_0x6904('0xde')]||undefined,'CampaignId':_0x3ecc93[_0x6904('0xdf')]||undefined})['catch'](loggerCatch(_0x6904('0xe0')));break;case 0xb:if(_0x3ecc93[_0x6904('0xeb')]>=_0x1e6744[_0x6904('0xee')]-0x1){return!![];}hopperUtils[_0x6904('0xef')]({'active':![],'countabandonedretry':_0x3ecc93['countabandonedretry']+=0x1,'scheduledat':moment()[_0x6904('0xda')](_0x1e6744['dialAbandonedRetryFrequency'],_0x6904('0xdb'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ecc93[_0x6904('0xdc')],'ListId':_0x3ecc93[_0x6904('0xdd')],'VoiceQueueId':_0x3ecc93[_0x6904('0xde')]||undefined,'CampaignId':_0x3ecc93[_0x6904('0xdf')]||undefined})[_0x6904('0xa5')](loggerCatch(_0x6904('0xf0')));break;case 0x13:if(_0x3ecc93[_0x6904('0x11f')]>=_0x1e6744[_0x6904('0x126')]-0x1){return!![];}hopperUtils[_0x6904('0xef')]({'active':![],'countmachineretry':_0x3ecc93[_0x6904('0x11f')]+=0x1,'scheduledat':moment()['add'](_0x1e6744['dialMachineRetryFrequency'],'minutes')[_0x6904('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ecc93['ContactId'],'ListId':_0x3ecc93['ListId'],'VoiceQueueId':_0x3ecc93['VoiceQueueId']||undefined,'CampaignId':_0x3ecc93['CampaignId']||undefined})[_0x6904('0xa5')](loggerCatch(_0x6904('0x12a')));break;case 0x14:if(_0x3ecc93['countagentrejectretry']>=_0x1e6744[_0x6904('0x191')]-0x1){return!![];}hopperUtils[_0x6904('0xef')]({'active':![],'countagentrejectretry':_0x3ecc93[_0x6904('0x124')]+=0x1,'scheduledat':moment()[_0x6904('0xda')](_0x1e6744[_0x6904('0x192')],_0x6904('0xdb'))[_0x6904('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3ecc93[_0x6904('0xdc')],'ListId':_0x3ecc93[_0x6904('0xdd')],'VoiceQueueId':_0x3ecc93[_0x6904('0xde')]||undefined,'CampaignId':_0x3ecc93[_0x6904('0xdf')]||undefined})[_0x6904('0xa5')](loggerCatch(_0x6904('0x193')));break;default:return!![];}};Dialer[_0x6904('0x1c')]['callProgressDetecting']=function(_0x4a7e3a,_0x36ec77,_0x717646){var _0x4de6fd=this;var _0x2c3edb=new History(_0x4a7e3a);var _0x3b4492=![];var _0x2fdc1d;var _0x544ded;return new Promise(function(_0x57cb56,_0x31a435){if(_['isUndefined'](_0x36ec77)&&typeof _0x36ec77!==_0x6904('0x15c')){return _0x31a435(msgResponse(_0x6904('0x194'),_0x6904('0x92'),_0x6904('0x195')));}if(_[_0x6904('0x42')](_0x717646)&&typeof _0x717646!==_0x6904('0x15c')){return _0x31a435(msgResponse('[callProgressDetecting]',_0x6904('0x92'),_0x6904('0x196')));}hopperUtils[_0x6904('0xd6')](_0x2c3edb,_0x717646[_0x6904('0xc4')],_0x36ec77)[_0x6904('0x41')](function(_0x10fc28){if(_0x10fc28[_0x6904('0xd8')]==0x1)_0x3b4492=!![];switch(_0x717646[_0x6904('0xc4')]){case'0':_0x36ec77['outboundNoSuchCallsDay']+=0x1;_0x2c3edb[_0x6904('0x71')]=0x0;_0x2c3edb['statedesc']='NoSuchNumber';_0x2c3edb[_0x6904('0x123')]+=0x1;_0x2c3edb['countglobal']+=0x1;ami[_0x6904('0x43')](_0x6904('0x197'),ut[_0x6904('0x120')](_0x4a7e3a,_0x6904('0x198')));_0x2fdc1d=_0x36ec77[_0x6904('0x18f')];_0x544ded=_0x36ec77[_0x6904('0xed')];hopperUtils[_0x6904('0xe4')](_0x2c3edb)[_0x6904('0xa5')](loggerCatch(_0x6904('0x199')));if(_0x4de6fd[_0x6904('0x186')](0x0,_0x4a7e3a,_0x36ec77)&&!_0x3b4492){if(_0x2c3edb[_0x6904('0x123')]>=_0x36ec77[_0x6904('0x19a')]){_0x4de6fd[_0x6904('0x127')](_0x2c3edb,_0x57cb56,_0x31a435,_0x6904('0x19b'));}else{_0x4de6fd[_0x6904('0x12e')](_0x2c3edb,_0x57cb56,_0x31a435,_0x6904('0x19b'));}}break;case'3':_0x36ec77['outboundNoAnswerCallsDay']+=0x1;_0x2c3edb['state']=0x3;_0x2c3edb[_0x6904('0x72')]=_0x6904('0x19c');_0x2c3edb['countnoanswerretry']+=0x1;_0x2c3edb[_0x6904('0xd4')]+=0x1;var _0x3148e9=ut[_0x6904('0x19d')](_0x4a7e3a,_0x36ec77);ami['emit']('custom:agentnoanswer',_0x3148e9);_0x2fdc1d=_0x36ec77[_0x6904('0x189')];_0x544ded=_0x36ec77[_0x6904('0xed')];hopperUtils[_0x6904('0xe4')](_0x2c3edb)[_0x6904('0xa5')](loggerCatch(_0x6904('0x19e')));if(_0x4de6fd['checkRetriveMax'](0x3,_0x4a7e3a,_0x36ec77)&&!_0x3b4492){if(_0x2c3edb[_0x6904('0x122')]>=_0x36ec77['dialNoAnswerMaxRetry']){_0x4de6fd[_0x6904('0x127')](_0x2c3edb,_0x57cb56,_0x31a435,_0x6904('0x19f'));}else{_0x4de6fd[_0x6904('0x12e')](_0x2c3edb,_0x57cb56,_0x31a435,_0x6904('0x19f'));}}break;case'5':_0x36ec77[_0x6904('0x1a0')]+=0x1;_0x2c3edb[_0x6904('0x71')]=0x5;_0x2c3edb[_0x6904('0x72')]=_0x6904('0x1a1');_0x2c3edb['countbusyretry']+=0x1;_0x2c3edb['countglobal']+=0x1;ami['emit'](_0x6904('0x1a2'),ut['buildObj'](_0x4a7e3a,'busy'));_0x2fdc1d=_0x36ec77['dialBusyRetryFrequency'];_0x544ded=_0x36ec77[_0x6904('0xed')];hopperUtils[_0x6904('0xe4')](_0x2c3edb)[_0x6904('0xa5')](loggerCatch(_0x6904('0x1a3')));if(_0x4de6fd[_0x6904('0x186')](0x5,_0x4a7e3a,_0x36ec77)&&!_0x3b4492){if(_0x2c3edb[_0x6904('0x187')]>=_0x36ec77[_0x6904('0x18a')]){_0x4de6fd[_0x6904('0x127')](_0x2c3edb,_0x57cb56,_0x31a435,_0x6904('0x1a4'));}else{_0x4de6fd[_0x6904('0x12e')](_0x2c3edb,_0x57cb56,_0x31a435,_0x6904('0x1a4'));}}break;case'8':_0x36ec77[_0x6904('0x1a5')]+=0x1;_0x2c3edb[_0x6904('0x71')]=0x8;_0x2c3edb[_0x6904('0x72')]=_0x6904('0x1a6');_0x2c3edb[_0x6904('0x121')]+=0x1;_0x2c3edb[_0x6904('0xd4')]+=0x1;_0x2fdc1d=_0x36ec77['dialCongestionRetryFrequency'];_0x544ded=_0x36ec77[_0x6904('0xed')];ami[_0x6904('0x43')]('custom:agentcongestion',ut[_0x6904('0x120')](_0x4a7e3a,'congestion'));hopperUtils[_0x6904('0xe4')](_0x2c3edb)[_0x6904('0xa5')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x4de6fd[_0x6904('0x186')](0x8,_0x4a7e3a,_0x36ec77)&&!_0x3b4492){if(_0x2c3edb[_0x6904('0x121')]>=_0x36ec77[_0x6904('0x18c')]){_0x4de6fd[_0x6904('0x127')](_0x2c3edb,_0x57cb56,_0x31a435,_0x6904('0x1a7'));}else{_0x4de6fd[_0x6904('0x12e')](_0x2c3edb,_0x57cb56,_0x31a435,_0x6904('0x1a7'));}}break;case'11':_0x36ec77['outboundAbandonedCallsDay']+=0x1;_0x2c3edb['state']=0xb;_0x2c3edb[_0x6904('0x72')]=_0x6904('0xe8');_0x2c3edb[_0x6904('0xeb')]+=0x1;_0x2c3edb[_0x6904('0xd4')]+=0x1;_0x2fdc1d=_0x36ec77['dialAbandonedRetryFrequency'];_0x544ded=_0x36ec77[_0x6904('0xed')];hopperUtils[_0x6904('0xe4')](_0x2c3edb)[_0x6904('0xa5')](loggerCatch(_0x6904('0xf1')));if(_0x4de6fd['checkRetriveMax'](0xb,_0x4a7e3a,_0x36ec77)&&!_0x3b4492){if(_0x2c3edb[_0x6904('0xeb')]>=_0x36ec77[_0x6904('0xee')]){_0x4de6fd['createStateFinal'](_0x2c3edb,_0x57cb56,_0x31a435,'reason\x2011\x20abandoned');}else{_0x4de6fd['stateGlobal'](_0x2c3edb,_0x57cb56,_0x31a435,_0x6904('0x1a8'));}}break;case'20':_0x36ec77[_0x6904('0x1a9')]+=0x1;_0x2c3edb[_0x6904('0x71')]=0x14;_0x2c3edb[_0x6904('0x72')]=_0x6904('0x1aa');_0x2c3edb[_0x6904('0x124')]+=0x1;_0x2c3edb['countglobal']+=0x1;_0x2fdc1d=_0x36ec77[_0x6904('0x192')];_0x544ded=_0x36ec77[_0x6904('0xed')];ami[_0x6904('0x43')]('custom:agentreject',ut[_0x6904('0x120')](_0x4a7e3a,_0x6904('0x1ab')));hopperUtils[_0x6904('0xe4')](_0x2c3edb)[_0x6904('0xa5')](loggerCatch(_0x6904('0x1ac')));if(_0x4de6fd['checkRetriveMax'](0x14,_0x4a7e3a,_0x36ec77)&&!_0x3b4492){if(_0x2c3edb[_0x6904('0x124')]>=_0x36ec77[_0x6904('0x191')]){_0x4de6fd[_0x6904('0x127')](_0x2c3edb,_0x57cb56,_0x31a435,'reason\x2020\x20agentreject');}else{_0x4de6fd[_0x6904('0x12e')](_0x2c3edb,_0x57cb56,_0x31a435,'reason\x2020\x20agentreject');}}break;default:_0x36ec77[_0x6904('0x136')]+=0x1;_0x2c3edb['state']=0xc;_0x2c3edb[_0x6904('0x72')]=_0x717646[_0x6904('0xc4')];_0x2fdc1d=_0x36ec77['dialAgentRejectRetryFrequency'];_0x544ded=_0x36ec77['callAdditionalPhoneAfterMin'];hopperUtils[_0x6904('0xe4')](_0x2c3edb)['catch'](loggerCatch(_0x6904('0x1ad')));if(_0x4de6fd[_0x6904('0x186')](_0x717646[_0x6904('0xc4')],_0x4a7e3a,_0x36ec77)&&!_0x3b4492){if(_0x2c3edb[_0x6904('0x187')]+_0x2c3edb[_0x6904('0x121')]+_0x2c3edb[_0x6904('0x122')]+_0x2c3edb['countnosuchnumberretry']+_0x2c3edb['countdropretry']+_0x2c3edb['countabandonedretry']+_0x2c3edb[_0x6904('0x11f')]+_0x2c3edb['countagentrejectretry']>=_0x36ec77[_0x6904('0x125')]){_0x4de6fd[_0x6904('0x12e')](_0x2c3edb,_0x57cb56,_0x31a435,_0x717646['reason']);}else{_0x4de6fd[_0x6904('0x127')](_0x2c3edb,_0x57cb56,_0x31a435,_0x717646[_0x6904('0xc4')]);}}}})[_0x6904('0x41')](function(){if(_0x3b4492){hopperUtils[_0x6904('0x1ae')](_0x2c3edb,_0x2fdc1d,_0x544ded)[_0x6904('0x41')](function(){return _0x57cb56(0x1);});}});});};Dialer[_0x6904('0x1c')]['stateGlobal']=function(_0x1c2d0b,_0x497489,_0x1ea029,_0x38980f){var _0x519f1e=new Final(_0x1c2d0b);_0x519f1e[_0x6904('0x71')]=0xf;_0x519f1e[_0x6904('0x72')]=_0x6904('0x1af');this[_0x6904('0x127')](_0x519f1e,_0x497489,_0x1ea029,_0x38980f);};Dialer[_0x6904('0x1c')][_0x6904('0x127')]=function(_0x13afa1,_0xe95650,_0x1d32c0,_0x3d0361){hopperUtils['moveContactManagedDialer'](_0x13afa1)[_0x6904('0x41')](function(){return _0xe95650(msgResponse(_0x6904('0x194'),_0x6904('0x10d'),_0x3d0361));})[_0x6904('0xa5')](function(){return _0x1d32c0(msgResponse('[moveContactManagedDialer][0]','Failure',_0x6904('0x1b0')));});};Dialer[_0x6904('0x1c')]['predictive']=function(_0x4f323c){var _0x40c19e=_0x4f323c[_0x6904('0x1b1')]/0x64;var _0x93ed78=_0x4f323c[_0x6904('0xcf')]/(_0x4f323c[_0x6904('0xcf')]+_0x4f323c[_0x6904('0xc3')]);var _0x330b82=Math[_0x6904('0x1b2')](_0x4f323c[_0x6904('0x1b3')]*(_0x4f323c[_0x6904('0x1b4')]/0x64));var _0x57c94a=Math[_0x6904('0x1b2')](_0x4f323c[_0x6904('0x1b3')]*(_0x4f323c['predictiveIntervalMinThreshold']/0x64));var _0x102486=_0x4f323c[_0x6904('0x13a')]+_0x4f323c['talking'];var _0x26cad9=Math[_0x6904('0x1b5')](_0x4f323c[_0x6904('0x59')]*_0x4f323c['erlangAbandonmentRate']*_0x4f323c['predictiveIntervalHitRate']*_0x4f323c['predictiveIntervalMultiplicativeFactor']);if(_[_0x6904('0x42')](_0x4f323c['startProgressive'])){if(!_['isUndefined'](_0x4f323c[_0x6904('0x2a')])){_0x4f323c[_0x6904('0x2a')]=undefined;loggerPredictive[_0x6904('0x75')]('[startMethodPredictive][StartProgressive]',_0x6904('0x1b6'));}if(!_[_0x6904('0x42')](_0x4f323c[_0x6904('0x64')])){loggerPredictive[_0x6904('0x75')](_0x6904('0x1b7'),_0x6904('0x1b8'));clearInterval(_0x4f323c[_0x6904('0x64')]);_0x4f323c[_0x6904('0x64')]=undefined;}_0x4f323c[_0x6904('0x61')]=moment()['format'](_0x6904('0xc2'));loggerPredictive[_0x6904('0x4a')](_0x4f323c['name'],_0x6904('0x1b9'),_0x4f323c[_0x6904('0x61')]);this[_0x6904('0xaf')](_0x4f323c,0x1);}else if(ifInterval(_0x4f323c['dialPredictiveInterval'],_0x4f323c[_0x6904('0x61')])){this[_0x6904('0xaf')](_0x4f323c,0x1);loggerPredictiveCalls[_0x6904('0x4a')](_0x6904('0x1ba'),_0x4f323c[_0x6904('0x61')],_0x4f323c[_0x6904('0x62')]);_0x4f323c[_0x6904('0x59')]=0x0;_0x4f323c[_0x6904('0xd0')]=0x0;}else if(_0x40c19e<_0x93ed78&&_0x4f323c[_0x6904('0x1bb')]===_0x6904('0x1bc')){clearPredictiveAttributes(_0x4f323c);loggerPredictive[_0x6904('0x4a')](_0x6904('0x1bd'),_0x6904('0x1be'),_0x93ed78,'startProgressive',_0x4f323c['name']);}else if(_0x26cad9<_0x4f323c[_0x6904('0xd0')]&&_0x4f323c[_0x6904('0x1bb')]===_0x6904('0x1bc')){clearPredictiveAttributes(_0x4f323c);loggerPredictive['info'](_0x6904('0x1bf'),_0x6904('0x1c0'),_0x26cad9,_0x6904('0x1c1'),_0x4f323c[_0x6904('0xd0')],_0x6904('0x61'),_0x4f323c[_0x6904('0x62')]);}else if(!ifInterval(_0x4f323c[_0x6904('0x1c2')],_0x4f323c[_0x6904('0x61')])&&_[_0x6904('0x42')](_0x4f323c[_0x6904('0x2a')])&&!_[_0x6904('0x42')](_0x4f323c[_0x6904('0x61')])){_0x4f323c[_0x6904('0x2a')]=moment()[_0x6904('0x7e')](_0x6904('0xc2'));loggerPredictive[_0x6904('0x4a')](_0x4f323c['name'],'started\x20in\x20predictive\x20at',_0x4f323c['startPredictive']);hopperUtils[_0x6904('0x1c3')](_0x4f323c[_0x6904('0x1c2')])['then'](this[_0x6904('0x1c4')](_0x4f323c))[_0x6904('0x41')](mergeDataErlangB(_0x4f323c))[_0x6904('0x41')](this[_0x6904('0x1c5')](_0x4f323c))['catch'](loggerCatchPredictive(_0x6904('0x1c6'),_0x4f323c));}else if(!ifInterval(_0x4f323c[_0x6904('0x1c2')],_0x4f323c[_0x6904('0x2a')])){_0x4f323c['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x4f323c['startPredictive']=moment()[_0x6904('0x7e')](_0x6904('0xc2'));loggerPredictive[_0x6904('0x4a')](_0x4f323c['name'],_0x6904('0x1c7'),_0x4f323c[_0x6904('0x2a')]);clearInterval(_0x4f323c[_0x6904('0x64')]);_0x4f323c[_0x6904('0x64')]=undefined;hopperUtils['avgHandleTime'](_0x4f323c[_0x6904('0x1c2')])[_0x6904('0x41')](this[_0x6904('0x1c4')](_0x4f323c))[_0x6904('0x41')](mergeDataErlangB(_0x4f323c))[_0x6904('0x41')](this[_0x6904('0x1c5')](_0x4f323c))[_0x6904('0xa5')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x4f323c));}else if(_0x4f323c[_0x6904('0x1b3')]&&_0x102486<_0x4f323c[_0x6904('0x1b3')]-_0x57c94a){clearPredictiveAttributes(_0x4f323c);loggerPredictive['info'](_0x4f323c[_0x6904('0x62')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x102486,_0x6904('0x1c8'),_0x4f323c[_0x6904('0x1b3')],'-',_0x57c94a,'=',_0x4f323c['predictiveIntervalAvailable']-_0x57c94a,')');}else if(_0x4f323c[_0x6904('0x1b3')]&&_0x102486>_0x4f323c['predictiveIntervalAvailable']+_0x330b82){clearPredictiveAttributes(_0x4f323c);loggerPredictive[_0x6904('0x4a')](_0x4f323c['name'],_0x6904('0x1c9'),_0x102486,_0x6904('0x1ca'),_0x4f323c['predictiveIntervalAvailable'],'+',_0x330b82,'=',_0x4f323c[_0x6904('0x1b3')]+_0x330b82,')');}};Dialer[_0x6904('0x1c')][_0x6904('0x1c4')]=function(_0x2af440){var _0x35cac8=this;return function(_0x58505e){return new Promise(function(_0x4bfa27,_0x44d284){_['merge'](_0x2af440,_0x58505e[0x0]);if(checkGetDataPredictive(_0x58505e[0x0])){var _0x2c24f0=_0x2af440[_0x6904('0x1b3')]=_0x2af440[_0x6904('0x13b')]+_0x2af440[_0x6904('0x13a')];var _0x43d070=_0x2af440[_0x6904('0x1c2')]*0x3c;var _0x4d676b=_0x58505e[0x0][_0x6904('0x53')]+_0x58505e[0x0]['predictiveIntervalAvgHoldtime'];var _0x21d3bb=(_0x58505e[0x0][_0x6904('0x4c')]+_0x58505e[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x58505e[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x58505e[0x0][_0x6904('0x1cb')];_0x2af440[_0x6904('0x1cc')]=_0x21d3bb>0x0?_0x21d3bb:0x1;switch(_0x2af440[_0x6904('0x1bb')]){case _0x6904('0x1bc'):var _0x3534db=_0x2af440[_0x6904('0x1b1')]/0x64;return _0x35cac8[_0x6904('0x1cd')](_0x2c24f0,_0x43d070,_0x4d676b,_0x21d3bb,_0x3534db)['then'](function(_0x1c93ff){return _0x4bfa27(_0x1c93ff);});case _0x6904('0x1ce'):var _0x3e8467=_0x2af440[_0x6904('0x1b1')]/0x64;return _0x35cac8[_0x6904('0x1cf')](_0x2c24f0,_0x43d070,_0x4d676b,_0x21d3bb,_0x3e8467)[_0x6904('0x41')](function(_0x459499){return _0x4bfa27(_0x459499);});default:return _0x44d284(msgResponse(_0x6904('0x1d0'),_0x6904('0x92'),'Unknown\x20Predictive'));}}else{return _0x44d284(msgResponse(_0x6904('0x1d0'),_0x6904('0x92'),'check\x20failure'));}});};};Dialer[_0x6904('0x1c')][_0x6904('0x1d1')]=function(_0xc04f25){var _0x31e3d9=this;return function(_0x427d38){return new Promise(function(_0x28f765,_0x135617){_['merge'](_0xc04f25,_0x427d38[0x0]);if(checkGetDataPredictive(_0x427d38[0x0])){loggerPredictive['info'](JSON[_0x6904('0x76')](_0x427d38[0x0]));if(_0xc04f25['dialPredictiveOptimization']===_0x6904('0x1bc')){return _0x31e3d9[_0x6904('0x152')](_0xc04f25['id'])[_0x6904('0x41')](function(_0x47e8b2){var _0x35c016=_0xc04f25[_0x6904('0x1d2')]-_0x47e8b2[0x0]['outboundQueuePauses'];var _0x138ea9=_0xc04f25[_0x6904('0x1c2')]*0x3c;var _0x40d813=_0x427d38[0x0][_0x6904('0x53')]+_0x427d38[0x0][_0x6904('0x50')];var _0x4d4e2a=(_0x427d38[0x0][_0x6904('0x4c')]+_0x427d38[0x0][_0x6904('0xce')]+_0x427d38[0x0][_0x6904('0xe6')])/_0x427d38[0x0]['predictiveIntervalTotalCalls'];var _0x2f9bf4=_0xc04f25[_0x6904('0x1b1')]/0x64;_0xc04f25[_0x6904('0x1d3')]=_0x47e8b2[0x0][_0x6904('0x1d4')]||0x0;_0xc04f25['predictiveIntervalHitRate']=_0x4d4e2a>0x0?_0x4d4e2a:0x1;return _0x31e3d9['abandonmentRate'](_0x35c016,_0x138ea9,_0x40d813,_0x4d4e2a,_0x2f9bf4);})[_0x6904('0x41')](function(_0x3a27fa){return _0x28f765(_0x3a27fa);})[_0x6904('0xa5')](function(_0xc440cb){return _0x135617(msgResponse(_0x6904('0x1d5'),_0x6904('0x92'),JSON[_0x6904('0x76')](_0xc440cb)));});}if(_0xc04f25[_0x6904('0x1bb')]===_0x6904('0x1ce')){return _0x31e3d9['getVoiceQueueRtPauses'](_0xc04f25['id'])['then'](function(_0x3f70be){var _0x322c35=_0xc04f25[_0x6904('0x1d2')]-_0x3f70be[0x0]['outboundQueuePauses'];var _0x22d44e=_0xc04f25[_0x6904('0x1c2')]*0x3c;var _0x4e2e3f=_0x427d38[0x0][_0x6904('0x53')]+_0x427d38[0x0]['predictiveIntervalAvgHoldtime'];var _0x42923b=(_0x427d38[0x0][_0x6904('0x4c')]+_0x427d38[0x0][_0x6904('0xce')]+_0x427d38[0x0][_0x6904('0xe6')])/_0x427d38[0x0][_0x6904('0x1cb')];var _0x941474=_0xc04f25[_0x6904('0x1b1')]/0x64;_0xc04f25['predictiveIntervalPauses']=_0x3f70be[0x0][_0x6904('0x1d4')]||0x0;_0xc04f25['predictiveIntervalHitRate']=_0x42923b>0x0?_0x42923b:0x1;return _0x31e3d9[_0x6904('0x1cf')](_0x322c35,_0x22d44e,_0x4e2e3f,_0x42923b,_0x941474);})[_0x6904('0x41')](function(_0x5342c8){return _0x28f765(_0x5342c8);})[_0x6904('0xa5')](function(_0x5691ad){return _0x135617(msgResponse(_0x6904('0x1d5'),_0x6904('0x92'),JSON['stringify'](_0x5691ad)));});}}else{return _0x135617(msgResponse(_0x6904('0x1d0'),_0x6904('0x92'),_0x6904('0x1d6')));}});};};Dialer[_0x6904('0x1c')][_0x6904('0x1c5')]=function(_0x5b1cfb){var _0x4cf1c5=this;return function(){var _0x11d885=0x0;var _0x15d9d9=Math[_0x6904('0x1b5')](_0x5b1cfb[_0x6904('0x5b')]*0x3e8);if(_0x15d9d9>0x0){_0x15d9d9=_0x15d9d9<0x64?0x64:_0x15d9d9;loggerPredictive[_0x6904('0x4a')](_0x5b1cfb['name'],_0x6904('0x1d7'),_0x15d9d9,_0x6904('0x1d8'));_0x5b1cfb[_0x6904('0x64')]=setInterval(function(){_0x4cf1c5['handlePredictive'](_0x5b1cfb);loggerPredictiveCalls['info'](_0x6904('0x1d9'),_0x11d885+=0x1);},_0x15d9d9);}else{loggerPredictive[_0x6904('0x4a')](_0x5b1cfb[_0x6904('0x62')],_0x6904('0x1da'));}};};Dialer[_0x6904('0x1c')][_0x6904('0x1db')]=function(_0x1fb7d2,_0xdf450a){var _0x2e0842=this;return function(_0x13a9a8){if(_[_0x6904('0x49')](_0x13a9a8)){if(_[_0x6904('0xf7')](_0xdf450a[_0x6904('0x158')])||!_0xdf450a[_0x6904('0x1dc')]){if(_0x1fb7d2[_0x6904('0xad')]===_0x6904('0xa')){_0x1fb7d2[_0x6904('0x74')]=_[_0x6904('0x42')](_0x1fb7d2[_0x6904('0x74')])?!![]:_0x1fb7d2[_0x6904('0x74')];var _0x5be744=uuid['v4']();_0x2e0842[_0x6904('0xf2')][_0x5be744]=new Action(_0x1fb7d2,_0xdf450a,_0x5be744);loggerBooked[_0x6904('0x4a')](_0x6904('0x1dd'),_0x5be744,_0x6904('0x1de'),JSON[_0x6904('0x76')](_0x1fb7d2[_0x6904('0x74')]),_0x6904('0x1df'),_0x1fb7d2[_0x6904('0x62')]);if(_0x1fb7d2[_0x6904('0x74')]){_0x1fb7d2[_0x6904('0x74')]=![];_0x2e0842[_0x6904('0x2c')][_0x2e0842['actions'][_0x5be744][_0x6904('0xbd')]]=[];ami[_0x6904('0x99')]({'actionid':_0x5be744,'action':_0x6904('0x1e0'),'queue':_0x1fb7d2[_0x6904('0x62')]})[_0x6904('0xa5')](function(){_0x2e0842[_0x6904('0xc0')](_0x1fb7d2);hopperUtils[_0x6904('0xef')]({'active':![],'ContactId':_0x2e0842['actions'][_0x5be744][_0x6904('0xdc')],'ListId':_0x2e0842[_0x6904('0xf2')][_0x5be744]['ListId'],'VoiceQueueId':_0x2e0842[_0x6904('0xf2')][_0x5be744][_0x6904('0xde')]||undefined,'CampaignId':_0x2e0842['actions'][_0x5be744]['CampaignId']||undefined})[_0x6904('0xa5')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2e0842[_0x6904('0xf2')][_0x5be744];});}else{loggerBooked[_0x6904('0x4a')](_0x6904('0x1e1'),JSON[_0x6904('0x76')](_0x1fb7d2['queueStatusComplete']),_0x6904('0x1df'),_0x1fb7d2[_0x6904('0x62')]);_0x2e0842[_0x6904('0xc0')](_0x1fb7d2);hopperUtils[_0x6904('0xef')]({'active':![],'ContactId':_0x2e0842[_0x6904('0xf2')][_0x5be744]['ContactId'],'ListId':_0x2e0842[_0x6904('0xf2')][_0x5be744]['ListId'],'VoiceQueueId':_0x2e0842[_0x6904('0xf2')][_0x5be744][_0x6904('0xde')]||undefined,'CampaignId':_0x2e0842['actions'][_0x5be744][_0x6904('0xdf')]||undefined})[_0x6904('0xa5')](loggerCatch(_0x6904('0x1e2')));delete _0x2e0842['actions'][_0x5be744];}}else{return _0x2e0842['actionOriginate'](_0x1fb7d2,_0xdf450a);}}else{if(utils['getSeconds'](undefined,_0xdf450a[_0x6904('0x1e3')])<_0x1fb7d2[_0x6904('0x1e4')]*0x3c){if(_0xdf450a[_0x6904('0x146')]&&!_0xdf450a[_0x6904('0x146')][_0x6904('0x1e5')]){_0x2e0842[_0x6904('0x21')][_0x6904('0xfe')](_0xdf450a['id'])[_0x6904('0x1f')](function(){_0x2e0842[_0x6904('0xc0')](_0x1fb7d2);});}else{hopperUtils['unlockContact']({'active':![]},_0xdf450a['id'],0x1)['finally'](function(){_0x2e0842['updateOriginated'](_0x1fb7d2);});}}else{_0x1fb7d2[_0x6904('0x1e6')]+=0x1;_0x2e0842['updateOriginated'](_0x1fb7d2);if(_0x1fb7d2[_0x6904('0x1e7')]){hopperUtils[_0x6904('0xef')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0xdf450a[_0x6904('0xdc')],'ListId':_0xdf450a[_0x6904('0xdd')],'VoiceQueueId':_0xdf450a[_0x6904('0xde')]||undefined,'CampaignId':_0xdf450a[_0x6904('0xdf')]||undefined})[_0x6904('0xa5')](loggerCatch(_0x6904('0x1e8')));hopperUtils[_0x6904('0xe4')](createObjHistory(_0x1fb7d2,_0xdf450a,utils[_0x6904('0x6c')]['QUEUE_RECALL'],0x17,_0x6904('0x1e9')))[_0x6904('0xa5')](loggerCatch(_0x6904('0x1ea')));}else{_0x2e0842['saveInDb'](createObjHistory(_0x1fb7d2,_0xdf450a,utils[_0x6904('0x6c')][_0x6904('0x1eb')],0x16,_0x6904('0x1ec')),'[Originate][HistoryRecallClose][historyCatch]',_0x6904('0x1ed'));}}}}else{_0x1fb7d2[_0x6904('0x1ee')]+=0x1;_0x2e0842[_0x6904('0x119')](createObjHistory(_0x1fb7d2,_0xdf450a,utils[_0x6904('0x6c')][_0x6904('0x1ef')],0xd,_0x6904('0x1f0')),_0x6904('0x1f1'),_0x6904('0x1f2'));throw _0x6904('0x1f3');}};};Dialer['prototype']['handleIvr']=function(_0x3724e6){var _0x117032=this;var _0x2e31f6=_0x3724e6[_0x6904('0x1f4')]-_0x3724e6[_0x6904('0x81')];emitCampaignSummary(_0x3724e6);if(_0x2e31f6>0x0&&_0x3724e6[_0x6904('0x69')]==0x0){if(_0x2e31f6>this[_0x6904('0x26')]){_0x2e31f6=this['maxNumberOriginate'];}_0x3724e6[_0x6904('0x69')]=0x1;hopperUtils[_0x6904('0x1f5')](_0x3724e6,_0x2e31f6)[_0x6904('0x41')](function(_0x432ae6){_0x3724e6[_0x6904('0x69')]=0x0;if(_0x432ae6){if(!utils[_0x6904('0x1f6')](_0x432ae6)){_0x3724e6['message']=utils[_0x6904('0x6c')][_0x6904('0x6f')];logger['info'](_0x6904('0x1f7')+_0x3724e6['name']);}else{_0x3724e6[_0x6904('0x81')]+=_0x432ae6[_0x6904('0x103')];_0x3724e6['message']=utils['CAMPAIGN_STATUS'][_0x6904('0x1f8')];for(var _0xc76a2f=0x0;_0xc76a2f<_0x432ae6['length'];_0xc76a2f+=0x1){_0x3724e6[_0x6904('0x1f9')]+=0x1;if(_[_0x6904('0xf7')](_0x432ae6[_0xc76a2f])||_['isNil'](_0x432ae6[_0xc76a2f]['Contact'])||_[_0x6904('0xf7')](_0x432ae6[_0xc76a2f]['phone'])){_0x117032[_0x6904('0x157')](_0x6904('0x1fa'),_0x3724e6,_0x432ae6[_0xc76a2f]);}else{hopperUtils[_0x6904('0x1fb')](_['pick'](_0x432ae6[_0xc76a2f],[_0x6904('0xdf'),_0x6904('0x15f')]))['then'](_0x117032['checkContactBlack'](_0x3724e6,_0x432ae6[_0xc76a2f]))[_0x6904('0xa5')](_0x117032[_0x6904('0x156')](_0x6904('0x1fc'),_0x3724e6));}}}}})[_0x6904('0xa5')](loggerGetContactDialer('[getContactCampaign2]',_0x3724e6,_0x2e31f6));}};Dialer[_0x6904('0x1c')]['handlePower']=function(_0x494d29,_0x356593){var _0x50a439=this;var _0x514a04=[];if(_0x356593<0x1||_0x494d29[_0x6904('0xad')]===_0x6904('0xa')){_0x356593=0x1;}var _0x434418=Math['floor'](_0x494d29[_0x6904('0x13a')]*_0x356593)-_0x494d29[_0x6904('0x81')];if(_0x494d29[_0x6904('0x1fd')]>0x0){var _0x22f322=_0x494d29[_0x6904('0x1fd')]-_0x494d29[_0x6904('0x81')]-_0x494d29[_0x6904('0x13b')]-_0x494d29[_0x6904('0x1fe')];if(_0x434418>_0x22f322){_0x434418=_0x22f322;}}if(_0x434418>0x0&&_0x494d29[_0x6904('0x69')]==0x0){if(_0x494d29[_0x6904('0xad')]===_0x6904('0xa')){_0x434418=0x1;}if(_0x434418>this[_0x6904('0x26')]){_0x434418=this[_0x6904('0x26')];}for(var _0x1b0291 in this[_0x6904('0x24')]){if(typeof this[_0x6904('0x24')][_0x1b0291]!=='undefined'){if(this[_0x6904('0x24')][_0x1b0291]['state']===_0x6904('0x1ff')&&this[_0x6904('0x24')][_0x1b0291][_0x6904('0x88')]==='reachable'){_0x514a04[_0x6904('0x9d')](this[_0x6904('0x24')][_0x1b0291]['id']);}}}_0x494d29['temp']=0x1;hopperUtils[_0x6904('0x200')](_0x494d29,_0x514a04,_0x434418)[_0x6904('0x41')](function(_0x238b2d){_0x494d29['temp']=0x0;if(_0x238b2d){if(!utils[_0x6904('0x1f6')](_0x238b2d)){hopperUtils[_0x6904('0x201')](_0x494d29)[_0x6904('0x41')](sendMessageReschedule(_0x494d29))[_0x6904('0xa5')](loggerCatch(_0x6904('0x202')));}else{_0x494d29[_0x6904('0x81')]+=_0x238b2d[_0x6904('0x103')];_0x494d29[_0x6904('0x6b')]=_0x494d29[_0x6904('0xad')]==='booked'?utils['CAMPAIGN_STATUS'][_0x6904('0x13c')]:utils[_0x6904('0x6c')]['RUNNING'];for(var _0x420bb2=0x0;_0x420bb2<_0x238b2d[_0x6904('0x103')];_0x420bb2+=0x1){if(_[_0x6904('0xf7')](_0x238b2d[_0x420bb2])||_[_0x6904('0xf7')](_0x238b2d[_0x420bb2][_0x6904('0x170')])||_[_0x6904('0xf7')](_0x238b2d[_0x420bb2][_0x6904('0x15f')])){_0x50a439[_0x6904('0x157')](_0x6904('0x1fa'),_0x494d29,_0x238b2d[_0x420bb2]);}else{hopperUtils['checkIsBlackList'](_['pick'](_0x238b2d[_0x420bb2],[_0x6904('0xde'),_0x6904('0x15f')]))['then'](_0x50a439[_0x6904('0x1db')](_0x494d29,_0x238b2d[_0x420bb2]))[_0x6904('0xa5')](_0x50a439[_0x6904('0x156')](_0x6904('0x1fa'),_0x494d29));}}}}})[_0x6904('0xa5')](loggerGetContactDialer('[getContactDialer2]',_0x494d29,_0x434418));}};Dialer[_0x6904('0x1c')]['handlePredictive']=function(_0x1f5a29){if(_0x1f5a29[_0x6904('0x1fd')]>0x0){var _0x4654cb=_0x1f5a29[_0x6904('0x1fd')]-_0x1f5a29['originated']-_0x1f5a29[_0x6904('0x13b')];if(_0x4654cb>0x0&&_0x1f5a29[_0x6904('0x69')]==0x0){this[_0x6904('0x203')](_0x1f5a29);}else{loggerPredictiveCalls['info'](_0x6904('0x204'));}}else{this['tryOriginatePredictive'](_0x1f5a29);}};Dialer[_0x6904('0x1c')]['tryOriginatePredictive']=function(_0x1e730f){var _0x3fa426=this;var _0xeb1fa2=[];_0x1e730f[_0x6904('0x81')]+=0x1;for(var _0xe6e8de in this['agents']){if(typeof this[_0x6904('0x24')][_0xe6e8de]!==_0x6904('0x14e')){if(this[_0x6904('0x24')][_0xe6e8de]['state']===_0x6904('0x1ff')&&this[_0x6904('0x24')][_0xe6e8de][_0x6904('0x88')]===_0x6904('0x142')){_0xeb1fa2[_0x6904('0x9d')](this[_0x6904('0x24')][_0xe6e8de]['id']);}}}_0x1e730f['temp']=0x1;return this[_0x6904('0x200')](_0x1e730f['id'],_0xeb1fa2,0x1,_0x1e730f[_0x6904('0x205')],_0x1e730f)[_0x6904('0x41')](function(_0x180aac){_0x1e730f['temp']=0x1;if(_0x180aac){if(!utils[_0x6904('0x1f6')](_0x180aac)){utils[_0x6904('0x68')](_0x1e730f,0x1,0x0);return hopperUtils[_0x6904('0x201')](_0x1e730f)[_0x6904('0x41')](sendMessageReschedule(_0x1e730f))[_0x6904('0xa5')](loggerCatch(_0x6904('0x202')));}else{_0x1e730f['message']=utils[_0x6904('0x6c')]['RUNNING'];if(_['isNil'](_0x180aac[0x0])||_[_0x6904('0xf7')](_0x180aac[0x0][_0x6904('0x170')])||_[_0x6904('0xf7')](_0x180aac[0x0]['phone'])){_0x3fa426[_0x6904('0x157')]('[actionOriginate]\x20',_0x1e730f,_0x180aac[0x0]);}else{return hopperUtils[_0x6904('0x206')](_[_0x6904('0xfd')](_0x180aac[0x0],[_0x6904('0xde'),_0x6904('0x15f')]))[_0x6904('0x41')](_0x3fa426[_0x6904('0x1db')](_0x1e730f,_0x180aac[0x0]))[_0x6904('0xa5')](_0x3fa426[_0x6904('0x156')]('[actionOriginatePredictive]\x20',_0x1e730f));}}}})[_0x6904('0xa5')](loggerGetContactDialer(_0x6904('0x207'),_0x1e730f,0x1));};Dialer[_0x6904('0x1c')][_0x6904('0x1cd')]=function(_0x287617,_0x5c22c4,_0x302945,_0x49982e,_0x479272,_0x1e8e57){loggerPredictive[_0x6904('0x4a')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x6904('0x4a')](_0x6904('0x208'),_0x287617);loggerPredictive['info'](_0x6904('0x209'),_0x5c22c4);loggerPredictive[_0x6904('0x4a')](_0x6904('0x20a'),_0x302945);loggerPredictive[_0x6904('0x4a')]('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',_0x49982e);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x479272);loggerPredictive[_0x6904('0x4a')](_0x6904('0x52'));return new Promise(function(_0x2eb73b,_0x13f0d9){if(_0x287617<=0x0||isNaN(_0x287617)){return _0x13f0d9(msgResponse('[abandonmentRate]',_0x6904('0x85'),_0x6904('0x20b')+_0x287617));}if(_0x302945<=0x0||isNaN(_0x302945)){return _0x13f0d9(msgResponse('[abandonmentRate]','Error',_0x6904('0x20c')+_0x302945));}if(_0x49982e<=0x0||isNaN(_0x49982e)){return _0x13f0d9(msgResponse(_0x6904('0x20d'),_0x6904('0x85'),_0x6904('0x20e')+_0x49982e));}if(_0x5c22c4<=0x0||isNaN(_0x5c22c4)){return _0x13f0d9(msgResponse('[abandonmentRate]',_0x6904('0x85'),'interval\x20=\x20'+_0x5c22c4));}if(_0x479272<=0x0||isNaN(_0x479272)){return _0x13f0d9(msgResponse('[abandonmentRate]','Error',_0x6904('0x20f')+_0x479272));}_0x1e8e57=_0x1e8e57||0x0;var _0x380c38=0x1/_0x302945;var _0x3602ee=0x0;var _0x4d3184=0x0;var _0x46ab61=0x0;var _0x3b575e=0x0;for(var _0x582722=0x0;_0x46ab61<_0x479272;_0x582722+=0x1){_0x4d3184=_0x582722/_0x5c22c4;_0x3602ee=(_0x49982e*_0x4d3184+_0x1e8e57)/_0x380c38;_0x46ab61=utils['erlangb'](_0x3602ee,_0x287617);_0x3b575e=_0x3602ee/_0x287617*(0x1-utils[_0x6904('0x210')](_0x3602ee,_0x287617));}return _0x2eb73b({'erlangCalls':_0x582722,'erlangCallToSecond':_0x5c22c4/_0x582722,'erlangAbandonmentRate':_0x46ab61,'erlangBusyFactor':_0x3b575e});});};Dialer[_0x6904('0x1c')][_0x6904('0x1cf')]=function(_0xc72940,_0x1c3cad,_0x5a72d3,_0x385457,_0x199d73,_0x25880d){loggerPredictive[_0x6904('0x4a')](_0x6904('0x211'));loggerPredictive['info'](_0x6904('0x208'),_0xc72940);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1c3cad);loggerPredictive[_0x6904('0x4a')]('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5a72d3);loggerPredictive[_0x6904('0x4a')](_0x6904('0x212'),_0x385457);loggerPredictive[_0x6904('0x4a')](_0x6904('0x213'),_0x199d73);loggerPredictive['info'](_0x6904('0x52'));return new Promise(function(_0x360b8d,_0x3c59d7){if(_0xc72940<=0x0||isNaN(_0xc72940)){return _0x3c59d7(msgResponse(_0x6904('0x214'),_0x6904('0x85'),'m\x20=\x20'+_0xc72940));}if(_0x5a72d3<=0x0||isNaN(_0x5a72d3)){return _0x3c59d7(msgResponse(_0x6904('0x214'),'Error',_0x6904('0x20c')+_0x5a72d3));}if(_0x385457<=0x0||isNaN(_0x385457)){return _0x3c59d7(msgResponse(_0x6904('0x214'),_0x6904('0x85'),_0x6904('0x20e')+_0x385457));}if(_0x1c3cad<=0x0||isNaN(_0x1c3cad)){return _0x3c59d7(msgResponse(_0x6904('0x214'),_0x6904('0x85'),_0x6904('0x215')+_0x1c3cad));}if(_0x199d73<=0x0||isNaN(_0x199d73)){return _0x3c59d7(msgResponse(_0x6904('0x214'),_0x6904('0x85'),'Umin\x20=\x20'+_0x199d73));}_0x25880d=_0x25880d||0x0;var _0xe85af0=0x1/_0x5a72d3;var _0x10fcf7=0x0;var _0xdc1fa9=0x0;var _0x22537a=0x0;var _0x42f7dd=0x0;for(var _0xa51af=0x0;_0x42f7dd<_0x199d73;_0xa51af+=0x1){_0xdc1fa9=_0xa51af/_0x1c3cad;_0x10fcf7=(_0x385457*_0xdc1fa9+_0x25880d)/_0xe85af0;_0x22537a=utils['erlangb'](_0x10fcf7,_0xc72940);_0x42f7dd=_0x10fcf7/_0xc72940*(0x1-utils['erlangb'](_0x10fcf7,_0xc72940));}return _0x360b8d({'erlangCalls':_0xa51af,'erlangCallToSecond':_0x1c3cad/_0xa51af,'erlangAbandonmentRate':_0x22537a,'erlangBusyFactor':_0x42f7dd});});};module[_0x6904('0x216')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index c7e6964..2c26549 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1976=['callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','number','substring','voiceQueue','getQueue','exports','util','moment','isNil','string','uniqueid','Contact','phone','firstName','lastName','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x54daf5,_0x528643){var _0xf70158=function(_0x4902d6){while(--_0x4902d6){_0x54daf5['push'](_0x54daf5['shift']());}};_0xf70158(++_0x528643);}(_0x1976,0x148));var _0x6197=function(_0x4ed539,_0x1f6517){_0x4ed539=_0x4ed539-0x0;var _0x4ba358=_0x1976[_0x4ed539];return _0x4ba358;};'use strict';var util=require(_0x6197('0x0'));var _=require('lodash');var moment=require(_0x6197('0x1'));function checkNameSurname(_0x1a38a6,_0x19cfc6,_0x5a960e){var _0x569bd8='';if(!_[_0x6197('0x2')](_0x19cfc6)&&_0x6197('0x3')===typeof _0x19cfc6){_0x569bd8+=_0x19cfc6;}if(!_[_0x6197('0x2')](_0x5a960e)&&'string'===typeof _0x5a960e){_0x569bd8+='\x20'+_0x5a960e;}if(_0x569bd8!==''){return _0x569bd8;}return _0x1a38a6;}function Action(_0x506162,_0x33c7d1,_0x3bc251){this['voiceQueue']=_0x506162;this[_0x6197('0x4')]=_0x3bc251||undefined;this['name']=checkNameSurname(_0x33c7d1[_0x6197('0x5')][_0x6197('0x6')],_0x33c7d1[_0x6197('0x5')][_0x6197('0x7')],_0x33c7d1['Contact'][_0x6197('0x8')]);this['number']=_0x33c7d1[_0x6197('0x6')];this[_0x6197('0x9')]=_0x506162[_0x6197('0xa')];this['active']=_0x33c7d1[_0x6197('0xb')]||![];this[_0x6197('0xc')]=_0x506162[_0x6197('0xc')];this[_0x6197('0xd')]=_0x506162[_0x6197('0xd')]||0x3;this[_0x6197('0xe')]=_0x33c7d1[_0x6197('0xe')];this[_0x6197('0xf')]=_0x33c7d1[_0x6197('0xf')];this[_0x6197('0x10')]=_0x33c7d1['countcongestionretry'];this['countnoanswerretry']=_0x33c7d1[_0x6197('0x11')];this[_0x6197('0x12')]=_0x33c7d1[_0x6197('0x12')];this[_0x6197('0x13')]=_0x33c7d1[_0x6197('0x13')];this[_0x6197('0x14')]=_0x33c7d1[_0x6197('0x14')];this[_0x6197('0x15')]=_0x33c7d1[_0x6197('0x15')];this[_0x6197('0x16')]=_0x33c7d1[_0x6197('0x16')];this['ContactId']=_0x33c7d1[_0x6197('0x17')];this[_0x6197('0x18')]=_0x33c7d1['ListId'];this[_0x6197('0x19')]=_0x33c7d1[_0x6197('0x19')];this[_0x6197('0x1a')]=_0x33c7d1['VoiceQueueId'];this[_0x6197('0x1b')]=_0x33c7d1[_0x6197('0x1b')];this[_0x6197('0x1c')]=_0x33c7d1['id'];this['ContactFirstName']=_0x33c7d1[_0x6197('0x5')]['firstName']||'';this[_0x6197('0x1d')]=moment()[_0x6197('0x1e')](_0x6197('0x1f'));this[_0x6197('0x20')]=_0x33c7d1[_0x6197('0x20')];this[_0x6197('0x21')]=_0x33c7d1[_0x6197('0x21')];this[_0x6197('0x22')]=_0x33c7d1[_0x6197('0x22')];this[_0x6197('0x23')]=_0x33c7d1[_0x6197('0x23')];this[_0x6197('0x24')]='';this[_0x6197('0x25')]='';}Action[_0x6197('0x26')][_0x6197('0x27')]=function(){return util[_0x6197('0x1e')]('\x22%s\x22\x20<%s>',this['name'],this['voiceQueue']['dialCutDigit']>0x0?this[_0x6197('0x28')][_0x6197('0x29')](this[_0x6197('0x2a')]['dialCutDigit']):this[_0x6197('0x28')]);};Action[_0x6197('0x26')][_0x6197('0x2b')]=function(){return this[_0x6197('0x9')];};module[_0x6197('0x2c')]=Action; \ No newline at end of file +var _0xfe71=['name','phone','Contact','firstName','lastName','number','active','dialQueueTimeout','scheduledat','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','getCaller','dialCutDigit','prototype','getQueue','queue','exports','moment','isNil','string','voiceQueue','uniqueid'];(function(_0x1eb775,_0x2df8c9){var _0x5e0dd8=function(_0x48473e){while(--_0x48473e){_0x1eb775['push'](_0x1eb775['shift']());}};_0x5e0dd8(++_0x2df8c9);}(_0xfe71,0x163));var _0x1fe7=function(_0x2eb2da,_0x13c13f){_0x2eb2da=_0x2eb2da-0x0;var _0x3b90d3=_0xfe71[_0x2eb2da];return _0x3b90d3;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x1fe7('0x0'));function checkNameSurname(_0x4a02e2,_0x3573f4,_0x2216b3){var _0x2c41a6='';if(!_[_0x1fe7('0x1')](_0x3573f4)&&_0x1fe7('0x2')===typeof _0x3573f4){_0x2c41a6+=_0x3573f4;}if(!_[_0x1fe7('0x1')](_0x2216b3)&&_0x1fe7('0x2')===typeof _0x2216b3){_0x2c41a6+='\x20'+_0x2216b3;}if(_0x2c41a6!==''){return _0x2c41a6;}return _0x4a02e2;}function Action(_0x3ce55a,_0x160739,_0x2fe91e){this[_0x1fe7('0x3')]=_0x3ce55a;this[_0x1fe7('0x4')]=_0x2fe91e||undefined;this[_0x1fe7('0x5')]=checkNameSurname(_0x160739['Contact'][_0x1fe7('0x6')],_0x160739[_0x1fe7('0x7')][_0x1fe7('0x8')],_0x160739[_0x1fe7('0x7')][_0x1fe7('0x9')]);this[_0x1fe7('0xa')]=_0x160739['phone'];this['queue']=_0x3ce55a[_0x1fe7('0x5')];this[_0x1fe7('0xb')]=_0x160739[_0x1fe7('0xb')]||![];this['type']=_0x3ce55a['type'];this[_0x1fe7('0xc')]=_0x3ce55a[_0x1fe7('0xc')]||0x3;this[_0x1fe7('0xd')]=_0x160739[_0x1fe7('0xd')];this[_0x1fe7('0xe')]=_0x160739['countbusyretry'];this['countcongestionretry']=_0x160739['countcongestionretry'];this[_0x1fe7('0xf')]=_0x160739['countnoanswerretry'];this['countnosuchnumberretry']=_0x160739[_0x1fe7('0x10')];this[_0x1fe7('0x11')]=_0x160739['countdropretry'];this[_0x1fe7('0x12')]=_0x160739[_0x1fe7('0x12')];this[_0x1fe7('0x13')]=_0x160739[_0x1fe7('0x13')];this[_0x1fe7('0x14')]=_0x160739['countagentrejectretry'];this['ContactId']=_0x160739[_0x1fe7('0x15')];this[_0x1fe7('0x16')]=_0x160739[_0x1fe7('0x16')];this[_0x1fe7('0x17')]=_0x160739[_0x1fe7('0x17')];this[_0x1fe7('0x18')]=_0x160739[_0x1fe7('0x18')];this['CampaignId']=_0x160739[_0x1fe7('0x19')];this[_0x1fe7('0x1a')]=_0x160739['id'];this[_0x1fe7('0x1b')]=_0x160739[_0x1fe7('0x7')]['firstName']||'';this['starttime']=moment()[_0x1fe7('0x1c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x1fe7('0x1d')]=_0x160739[_0x1fe7('0x1d')];this[_0x1fe7('0x1e')]=_0x160739[_0x1fe7('0x1e')];this[_0x1fe7('0x1f')]=_0x160739[_0x1fe7('0x1f')];this[_0x1fe7('0x20')]=_0x160739[_0x1fe7('0x20')];this[_0x1fe7('0x21')]='';this['originatecalleridname']='';}Action['prototype'][_0x1fe7('0x22')]=function(){return util[_0x1fe7('0x1c')]('\x22%s\x22\x20<%s>',this[_0x1fe7('0x5')],this[_0x1fe7('0x3')][_0x1fe7('0x23')]>0x0?this[_0x1fe7('0xa')]['substring'](this[_0x1fe7('0x3')]['dialCutDigit']):this[_0x1fe7('0xa')]);};Action[_0x1fe7('0x24')][_0x1fe7('0x25')]=function(){return this[_0x1fe7('0x26')];};module[_0x1fe7('0x27')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index c74d59b..2b9dac6 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x418a=['countagentrejectretry','uniqueid','name','number','starttime','responsetime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','statedesc','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x524e33,_0x393e22){var _0x58612f=function(_0x2c7f13){while(--_0x2c7f13){_0x524e33['push'](_0x524e33['shift']());}};_0x58612f(++_0x393e22);}(_0x418a,0xc3));var _0xa418=function(_0x37c9ef,_0x8cd045){_0x37c9ef=_0x37c9ef-0x0;var _0x2b0174=_0x418a[_0x37c9ef];return _0x2b0174;};'use strict';var moment=require(_0xa418('0x0'));var utils=require(_0xa418('0x1'));function AgentComplete(_0x4d9f2c,_0x325275){this['state']=0x4;this[_0xa418('0x2')]='Answer';this['scheduledat']=_0x4d9f2c['scheduledat'];this['type']=_0x4d9f2c[_0xa418('0x3')];this[_0xa418('0x4')]=_0x4d9f2c[_0xa418('0x3')]===_0xa418('0x5')?_0xa418('0x6'):_0x4d9f2c[_0xa418('0x3')];this[_0xa418('0x7')]=_0x4d9f2c[_0xa418('0x7')];this[_0xa418('0x8')]=_0x4d9f2c[_0xa418('0x8')];this[_0xa418('0x9')]=_0x4d9f2c[_0xa418('0x9')];this[_0xa418('0xa')]=_0x4d9f2c['countbusyretry']+_0x4d9f2c['countcongestionretry']+_0x4d9f2c[_0xa418('0x9')]+_0x4d9f2c[_0xa418('0xb')]+_0x4d9f2c[_0xa418('0xc')]+_0x4d9f2c[_0xa418('0xd')]+_0x4d9f2c[_0xa418('0xe')]+_0x4d9f2c[_0xa418('0xf')];this[_0xa418('0xb')]=_0x4d9f2c[_0xa418('0xb')];this[_0xa418('0xc')]=_0x4d9f2c[_0xa418('0xc')];this[_0xa418('0xd')]=_0x4d9f2c[_0xa418('0xd')];this[_0xa418('0xe')]=_0x4d9f2c[_0xa418('0xe')];this['countagentrejectretry']=_0x4d9f2c[_0xa418('0xf')];this[_0xa418('0x10')]=_0x325275[_0xa418('0x10')];this['calleridname']=_0x4d9f2c[_0xa418('0x11')];this['calleridnum']=_0x4d9f2c[_0xa418('0x12')];this[_0xa418('0x13')]=_0x4d9f2c[_0xa418('0x13')];this[_0xa418('0x14')]=_0x4d9f2c[_0xa418('0x14')];this['answertime']=_0x4d9f2c[_0xa418('0x15')];this['endtime']=moment()[_0xa418('0x16')](_0xa418('0x17'));this[_0xa418('0x18')]=utils[_0xa418('0x19')](_0x4d9f2c['responsetime'],_0x4d9f2c[_0xa418('0x13')]);this[_0xa418('0x1a')]=utils[_0xa418('0x19')](_0x4d9f2c[_0xa418('0x15')],_0x4d9f2c['responsetime']);this['talktime']=utils['getSeconds'](this['endtime'],_0x4d9f2c[_0xa418('0x15')]);this[_0xa418('0x6')]=_0x325275[_0xa418('0x6')];this[_0xa418('0x1b')]=_0x325275[_0xa418('0x1b')];this[_0xa418('0x1c')]=_0x325275[_0xa418('0x1c')];this[_0xa418('0x1d')]=_0x4d9f2c[_0xa418('0x1d')];this['callbackuniqueid']=_0x4d9f2c[_0xa418('0x1e')];this[_0xa418('0x1f')]=_0x4d9f2c[_0xa418('0x1f')];this[_0xa418('0x20')]=_0x4d9f2c[_0xa418('0x20')];this[_0xa418('0x21')]=_0x4d9f2c[_0xa418('0x21')];this[_0xa418('0x22')]=_0x4d9f2c[_0xa418('0x22')];this[_0xa418('0x23')]=_0x4d9f2c[_0xa418('0x23')];this[_0xa418('0x24')]=_0x4d9f2c[_0xa418('0x24')];this[_0xa418('0x25')]=_0x4d9f2c[_0xa418('0x25')];this['originatecalleridnum']=_0x4d9f2c[_0xa418('0x26')]||'';this['originatecalleridname']=_0x4d9f2c[_0xa418('0x27')]||'';this['agiafterat']=_0x4d9f2c[_0xa418('0x28')];}module[_0xa418('0x29')]=AgentComplete; \ No newline at end of file +var _0xb9a3=['ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','moment','../utils','statedesc','Answer','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','answertime','format','YYYY-MM-DD\x20HH:mm:ss','getSeconds','holdtime','responsetime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0xb9a3,0xb7));var _0x3b9a=function(_0x1e93dc,_0x1457ad){_0x1e93dc=_0x1e93dc-0x0;var _0x160131=_0xb9a3[_0x1e93dc];return _0x160131;};'use strict';var moment=require(_0x3b9a('0x0'));var utils=require(_0x3b9a('0x1'));function AgentComplete(_0x2af0d3,_0x5a844e){this['state']=0x4;this[_0x3b9a('0x2')]=_0x3b9a('0x3');this[_0x3b9a('0x4')]=_0x2af0d3['scheduledat'];this[_0x3b9a('0x5')]=_0x2af0d3[_0x3b9a('0x5')];this['campaigntype']=_0x2af0d3[_0x3b9a('0x5')]==='outbound'?_0x3b9a('0x6'):_0x2af0d3[_0x3b9a('0x5')];this['countbusyretry']=_0x2af0d3[_0x3b9a('0x7')];this[_0x3b9a('0x8')]=_0x2af0d3[_0x3b9a('0x8')];this['countnoanswerretry']=_0x2af0d3[_0x3b9a('0x9')];this[_0x3b9a('0xa')]=_0x2af0d3[_0x3b9a('0x7')]+_0x2af0d3[_0x3b9a('0x8')]+_0x2af0d3[_0x3b9a('0x9')]+_0x2af0d3[_0x3b9a('0xb')]+_0x2af0d3[_0x3b9a('0xc')]+_0x2af0d3[_0x3b9a('0xd')]+_0x2af0d3[_0x3b9a('0xe')]+_0x2af0d3[_0x3b9a('0xf')];this[_0x3b9a('0xb')]=_0x2af0d3[_0x3b9a('0xb')];this[_0x3b9a('0xc')]=_0x2af0d3['countdropretry'];this[_0x3b9a('0xd')]=_0x2af0d3[_0x3b9a('0xd')];this[_0x3b9a('0xe')]=_0x2af0d3['countmachineretry'];this[_0x3b9a('0xf')]=_0x2af0d3['countagentrejectretry'];this[_0x3b9a('0x10')]=_0x5a844e[_0x3b9a('0x10')];this[_0x3b9a('0x11')]=_0x2af0d3[_0x3b9a('0x12')];this[_0x3b9a('0x13')]=_0x2af0d3[_0x3b9a('0x14')];this[_0x3b9a('0x15')]=_0x2af0d3[_0x3b9a('0x15')];this['responsetime']=_0x2af0d3['responsetime'];this[_0x3b9a('0x16')]=_0x2af0d3['answertime'];this['endtime']=moment()[_0x3b9a('0x17')](_0x3b9a('0x18'));this['ringtime']=utils[_0x3b9a('0x19')](_0x2af0d3['responsetime'],_0x2af0d3[_0x3b9a('0x15')]);this[_0x3b9a('0x1a')]=utils['getSeconds'](_0x2af0d3[_0x3b9a('0x16')],_0x2af0d3[_0x3b9a('0x1b')]);this[_0x3b9a('0x1c')]=utils[_0x3b9a('0x19')](this[_0x3b9a('0x1d')],_0x2af0d3[_0x3b9a('0x16')]);this[_0x3b9a('0x6')]=_0x5a844e['queue'];this[_0x3b9a('0x1e')]=_0x5a844e['membername'];this[_0x3b9a('0x1f')]=_0x5a844e[_0x3b9a('0x1f')];this[_0x3b9a('0x20')]=_0x2af0d3[_0x3b9a('0x20')];this[_0x3b9a('0x21')]=_0x2af0d3[_0x3b9a('0x21')];this['callbackat']=_0x2af0d3[_0x3b9a('0x22')];this[_0x3b9a('0x23')]=_0x2af0d3['recallme'];this[_0x3b9a('0x24')]=_0x2af0d3[_0x3b9a('0x24')];this[_0x3b9a('0x25')]=_0x2af0d3['ListId'];this['UserId']=_0x2af0d3['UserId'];this[_0x3b9a('0x26')]=_0x2af0d3[_0x3b9a('0x26')];this[_0x3b9a('0x27')]=_0x2af0d3[_0x3b9a('0x27')];this[_0x3b9a('0x28')]=_0x2af0d3[_0x3b9a('0x28')]||'';this[_0x3b9a('0x29')]=_0x2af0d3[_0x3b9a('0x29')]||'';this[_0x3b9a('0x2a')]=_0x2af0d3[_0x3b9a('0x2a')];}module[_0x3b9a('0x2b')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index ae5d318..b06df13 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba10=['countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry'];(function(_0xa1b74d,_0x614e6f){var _0x56bad4=function(_0x29795c){while(--_0x29795c){_0xa1b74d['push'](_0xa1b74d['shift']());}};_0x56bad4(++_0x614e6f);}(_0xba10,0xf6));var _0x0ba1=function(_0x3a5601,_0x159f90){_0x3a5601=_0x3a5601-0x0;var _0x363732=_0xba10[_0x3a5601];return _0x363732;};'use strict';function Final(_0xc54361){this[_0x0ba1('0x0')]=_0xc54361[_0x0ba1('0x0')];this[_0x0ba1('0x1')]=_0xc54361['scheduledat'];this['type']=_0xc54361['type'];this['campaigntype']=_0xc54361[_0x0ba1('0x2')]===_0x0ba1('0x3')?_0x0ba1('0x4'):_0xc54361[_0x0ba1('0x2')];this[_0x0ba1('0x5')]=_0xc54361['countbusyretry'];this[_0x0ba1('0x6')]=_0xc54361[_0x0ba1('0x6')];this[_0x0ba1('0x7')]=_0xc54361[_0x0ba1('0x7')];this['countglobal']=_0xc54361[_0x0ba1('0x5')]+_0xc54361[_0x0ba1('0x6')]+_0xc54361['countnoanswerretry']+_0xc54361[_0x0ba1('0x8')]+_0xc54361[_0x0ba1('0x9')]+_0xc54361[_0x0ba1('0xa')]+_0xc54361[_0x0ba1('0xb')]+_0xc54361[_0x0ba1('0xc')];this[_0x0ba1('0x8')]=_0xc54361[_0x0ba1('0x8')];this['countdropretry']=_0xc54361[_0x0ba1('0x9')];this[_0x0ba1('0xa')]=_0xc54361['countabandonedretry'];this[_0x0ba1('0xb')]=_0xc54361[_0x0ba1('0xb')];this[_0x0ba1('0xc')]=_0xc54361[_0x0ba1('0xc')];this[_0x0ba1('0x4')]=_0xc54361[_0x0ba1('0x4')];this[_0x0ba1('0xd')]=_0xc54361['calleridname'];this[_0x0ba1('0xe')]=_0xc54361['calleridnum'];this['starttime']=_0xc54361[_0x0ba1('0xf')];this[_0x0ba1('0x10')]=_0xc54361[_0x0ba1('0x10')];this['endtime']=_0xc54361['responsetime'];this[_0x0ba1('0x11')]=_0xc54361[_0x0ba1('0x11')]||0x0;this['holdtime']=_0xc54361[_0x0ba1('0x12')]||0x0;this[_0x0ba1('0x13')]=_0xc54361['talktime']||0x0;this['callback']=_0xc54361['callback'];this[_0x0ba1('0x14')]=_0xc54361[_0x0ba1('0x14')];this[_0x0ba1('0x15')]=_0xc54361[_0x0ba1('0x15')];this[_0x0ba1('0x16')]=_0xc54361[_0x0ba1('0x16')];this[_0x0ba1('0x17')]=_0xc54361[_0x0ba1('0x17')];this[_0x0ba1('0x18')]=_0xc54361['ListId'];this[_0x0ba1('0x19')]=_0xc54361['UserId'];this[_0x0ba1('0x1a')]=_0xc54361[_0x0ba1('0x1a')];this[_0x0ba1('0x1b')]=_0xc54361[_0x0ba1('0x1b')];this[_0x0ba1('0x1c')]=_0xc54361[_0x0ba1('0x1c')]||'';this[_0x0ba1('0x1d')]=_0xc54361[_0x0ba1('0x1d')]||'';this[_0x0ba1('0x1e')]=_0xc54361[_0x0ba1('0x1e')];this[_0x0ba1('0x1f')]=_0xc54361[_0x0ba1('0x1f')];}module['exports']=Final; \ No newline at end of file +var _0xb2d8=['starttime','responsetime','endtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','calleridname','calleridnum'];(function(_0x35a441,_0x3a2ec6){var _0x571ce3=function(_0x161827){while(--_0x161827){_0x35a441['push'](_0x35a441['shift']());}};_0x571ce3(++_0x3a2ec6);}(_0xb2d8,0x170));var _0x8b2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb2d8[_0x3dd15e];return _0x231fd0;};'use strict';function Final(_0x31363e){this[_0x8b2d('0x0')]=_0x31363e[_0x8b2d('0x0')];this[_0x8b2d('0x1')]=_0x31363e[_0x8b2d('0x1')];this[_0x8b2d('0x2')]=_0x31363e['type'];this[_0x8b2d('0x3')]=_0x31363e['type']===_0x8b2d('0x4')?_0x8b2d('0x5'):_0x31363e[_0x8b2d('0x2')];this[_0x8b2d('0x6')]=_0x31363e[_0x8b2d('0x6')];this['countcongestionretry']=_0x31363e['countcongestionretry'];this[_0x8b2d('0x7')]=_0x31363e[_0x8b2d('0x7')];this[_0x8b2d('0x8')]=_0x31363e[_0x8b2d('0x6')]+_0x31363e[_0x8b2d('0x9')]+_0x31363e['countnoanswerretry']+_0x31363e['countnosuchnumberretry']+_0x31363e[_0x8b2d('0xa')]+_0x31363e[_0x8b2d('0xb')]+_0x31363e[_0x8b2d('0xc')]+_0x31363e['countagentrejectretry'];this[_0x8b2d('0xd')]=_0x31363e[_0x8b2d('0xd')];this['countdropretry']=_0x31363e['countdropretry'];this[_0x8b2d('0xb')]=_0x31363e[_0x8b2d('0xb')];this[_0x8b2d('0xc')]=_0x31363e[_0x8b2d('0xc')];this[_0x8b2d('0xe')]=_0x31363e['countagentrejectretry'];this[_0x8b2d('0x5')]=_0x31363e[_0x8b2d('0x5')];this[_0x8b2d('0xf')]=_0x31363e[_0x8b2d('0xf')];this[_0x8b2d('0x10')]=_0x31363e['calleridnum'];this['starttime']=_0x31363e[_0x8b2d('0x11')];this[_0x8b2d('0x12')]=_0x31363e[_0x8b2d('0x12')];this[_0x8b2d('0x13')]=_0x31363e[_0x8b2d('0x12')];this['ringtime']=_0x31363e['ringtime']||0x0;this['holdtime']=_0x31363e[_0x8b2d('0x14')]||0x0;this[_0x8b2d('0x15')]=_0x31363e[_0x8b2d('0x15')]||0x0;this[_0x8b2d('0x16')]=_0x31363e['callback'];this[_0x8b2d('0x17')]=_0x31363e[_0x8b2d('0x17')];this[_0x8b2d('0x18')]=_0x31363e[_0x8b2d('0x18')];this['recallme']=_0x31363e[_0x8b2d('0x19')];this[_0x8b2d('0x1a')]=_0x31363e[_0x8b2d('0x1a')];this[_0x8b2d('0x1b')]=_0x31363e[_0x8b2d('0x1b')];this[_0x8b2d('0x1c')]=_0x31363e[_0x8b2d('0x1c')];this[_0x8b2d('0x1d')]=_0x31363e[_0x8b2d('0x1d')];this[_0x8b2d('0x1e')]=_0x31363e[_0x8b2d('0x1e')];this['originatecalleridnum']=_0x31363e['originatecalleridnum']||'';this[_0x8b2d('0x1f')]=_0x31363e['originatecalleridname']||'';this['state']=_0x31363e[_0x8b2d('0x20')];this['statedesc']=_0x31363e[_0x8b2d('0x21')];}module[_0x8b2d('0x22')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index dba336c..f6b8ea2 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e07=['amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countnosuchnumberretry','countagentrejectretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','endtime','queue','membername','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','moment','state','statedesc','Answer','scheduledat','type','campaigntype','outbound'];(function(_0x5ad584,_0x26e6f3){var _0x508bb1=function(_0x339d09){while(--_0x339d09){_0x5ad584['push'](_0x5ad584['shift']());}};_0x508bb1(++_0x26e6f3);}(_0x4e07,0x12c));var _0x74e0=function(_0xc48c21,_0x13dbe1){_0xc48c21=_0xc48c21-0x0;var _0x34cc69=_0x4e07[_0xc48c21];return _0x34cc69;};'use strict';var moment=require(_0x74e0('0x0'));var utils=require('../utils');function Hangup(_0x402793,_0x446f8a){this[_0x74e0('0x1')]=0x4;this[_0x74e0('0x2')]=_0x74e0('0x3');this[_0x74e0('0x4')]=_0x402793[_0x74e0('0x4')];this[_0x74e0('0x5')]=_0x402793[_0x74e0('0x5')];this[_0x74e0('0x6')]=_0x402793['type']===_0x74e0('0x7')?'queue':_0x402793[_0x74e0('0x5')];this['amd']=_0x402793[_0x74e0('0x8')]||![];this['countbusyretry']=_0x402793[_0x74e0('0x9')];this[_0x74e0('0xa')]=_0x402793['countcongestionretry'];this[_0x74e0('0xb')]=_0x402793[_0x74e0('0xb')];this[_0x74e0('0xc')]=_0x402793[_0x74e0('0x9')]+_0x402793[_0x74e0('0xa')]+_0x402793[_0x74e0('0xb')]+_0x402793['countnosuchnumberretry']+_0x402793[_0x74e0('0xd')]+_0x402793[_0x74e0('0xe')]+_0x402793[_0x74e0('0xf')]+_0x402793['countagentrejectretry'];this[_0x74e0('0x10')]=_0x402793[_0x74e0('0x10')];this[_0x74e0('0xd')]=_0x402793[_0x74e0('0xd')];this[_0x74e0('0xe')]=_0x402793[_0x74e0('0xe')];this[_0x74e0('0xf')]=_0x402793[_0x74e0('0xf')];this[_0x74e0('0x11')]=_0x402793['countagentrejectretry'];this[_0x74e0('0x12')]=_0x446f8a[_0x74e0('0x12')];this[_0x74e0('0x13')]=_0x402793['name'];this[_0x74e0('0x14')]=_0x402793[_0x74e0('0x15')];this[_0x74e0('0x16')]=_0x402793[_0x74e0('0x16')];this[_0x74e0('0x17')]=_0x402793[_0x74e0('0x17')];this['endtime']=moment()[_0x74e0('0x18')](_0x74e0('0x19'));this[_0x74e0('0x1a')]=utils[_0x74e0('0x1b')](_0x402793['responsetime'],_0x402793[_0x74e0('0x16')]);this[_0x74e0('0x1c')]=0x0;this[_0x74e0('0x1d')]=utils[_0x74e0('0x1b')](this[_0x74e0('0x1e')],_0x402793[_0x74e0('0x17')]);this[_0x74e0('0x1f')]=_0x402793[_0x74e0('0x1f')];this[_0x74e0('0x20')]=_0x74e0('0x21');this[_0x74e0('0x22')]=_0x446f8a['cause-txt'];this[_0x74e0('0x23')]=_0x402793[_0x74e0('0x23')];this[_0x74e0('0x24')]=_0x402793['callbackuniqueid'];this[_0x74e0('0x25')]=_0x402793[_0x74e0('0x25')];this[_0x74e0('0x26')]=_0x402793['recallme'];this[_0x74e0('0x27')]=_0x402793['ContactId'];this[_0x74e0('0x28')]=_0x402793[_0x74e0('0x28')];this[_0x74e0('0x29')]=_0x402793[_0x74e0('0x29')];this[_0x74e0('0x2a')]=_0x402793[_0x74e0('0x2a')];this[_0x74e0('0x2b')]=_0x402793[_0x74e0('0x2b')];}module['exports']=Hangup; \ No newline at end of file +var _0x58ef=['moment','../utils','statedesc','Answer','scheduledat','type','campaigntype','outbound','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','endtime','queue','callback','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','exports'];(function(_0x4b18c0,_0x7c2a1d){var _0x559cde=function(_0x17a845){while(--_0x17a845){_0x4b18c0['push'](_0x4b18c0['shift']());}};_0x559cde(++_0x7c2a1d);}(_0x58ef,0x75));var _0xf58e=function(_0xbc6b35,_0xbc5116){_0xbc6b35=_0xbc6b35-0x0;var _0x1ecb7b=_0x58ef[_0xbc6b35];return _0x1ecb7b;};'use strict';var moment=require(_0xf58e('0x0'));var utils=require(_0xf58e('0x1'));function Hangup(_0x150ec8,_0x2a11a3){this['state']=0x4;this[_0xf58e('0x2')]=_0xf58e('0x3');this[_0xf58e('0x4')]=_0x150ec8[_0xf58e('0x4')];this[_0xf58e('0x5')]=_0x150ec8[_0xf58e('0x5')];this[_0xf58e('0x6')]=_0x150ec8[_0xf58e('0x5')]===_0xf58e('0x7')?'queue':_0x150ec8['type'];this['amd']=_0x150ec8['amd']||![];this['countbusyretry']=_0x150ec8['countbusyretry'];this[_0xf58e('0x8')]=_0x150ec8[_0xf58e('0x8')];this[_0xf58e('0x9')]=_0x150ec8[_0xf58e('0x9')];this[_0xf58e('0xa')]=_0x150ec8['countbusyretry']+_0x150ec8[_0xf58e('0x8')]+_0x150ec8[_0xf58e('0x9')]+_0x150ec8[_0xf58e('0xb')]+_0x150ec8[_0xf58e('0xc')]+_0x150ec8[_0xf58e('0xd')]+_0x150ec8[_0xf58e('0xe')]+_0x150ec8[_0xf58e('0xf')];this[_0xf58e('0xb')]=_0x150ec8[_0xf58e('0xb')];this[_0xf58e('0xc')]=_0x150ec8[_0xf58e('0xc')];this['countabandonedretry']=_0x150ec8['countabandonedretry'];this[_0xf58e('0xe')]=_0x150ec8['countmachineretry'];this['countagentrejectretry']=_0x150ec8[_0xf58e('0xf')];this['uniqueid']=_0x2a11a3[_0xf58e('0x10')];this[_0xf58e('0x11')]=_0x150ec8[_0xf58e('0x12')];this[_0xf58e('0x13')]=_0x150ec8[_0xf58e('0x14')];this[_0xf58e('0x15')]=_0x150ec8[_0xf58e('0x15')];this['responsetime']=_0x150ec8[_0xf58e('0x16')];this['endtime']=moment()[_0xf58e('0x17')](_0xf58e('0x18'));this[_0xf58e('0x19')]=utils[_0xf58e('0x1a')](_0x150ec8['responsetime'],_0x150ec8['starttime']);this[_0xf58e('0x1b')]=0x0;this[_0xf58e('0x1c')]=utils[_0xf58e('0x1a')](this[_0xf58e('0x1d')],_0x150ec8['responsetime']);this[_0xf58e('0x1e')]=_0x150ec8[_0xf58e('0x1e')];this['membername']='IVR';this['reason']=_0x2a11a3['cause-txt'];this[_0xf58e('0x1f')]=_0x150ec8[_0xf58e('0x1f')];this[_0xf58e('0x20')]=_0x150ec8[_0xf58e('0x20')];this['callbackat']=_0x150ec8['callbackat'];this['recallme']=_0x150ec8[_0xf58e('0x21')];this[_0xf58e('0x22')]=_0x150ec8[_0xf58e('0x22')];this[_0xf58e('0x23')]=_0x150ec8['ListId'];this['UserId']=_0x150ec8[_0xf58e('0x24')];this[_0xf58e('0x25')]=_0x150ec8[_0xf58e('0x25')];this['CampaignId']=_0x150ec8['CampaignId'];}module[_0xf58e('0x26')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index 235f935..fabe591 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf8c7=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','../utils','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','queue','name','number','starttime','responsetime','ringtime','holdtime','callback'];(function(_0x295279,_0x4996a4){var _0x3614ea=function(_0x1a3fd9){while(--_0x1a3fd9){_0x295279['push'](_0x295279['shift']());}};_0x3614ea(++_0x4996a4);}(_0xf8c7,0x72));var _0x7f8c=function(_0x10ce64,_0x56ec21){_0x10ce64=_0x10ce64-0x0;var _0x204214=_0xf8c7[_0x10ce64];return _0x204214;};'use strict';var utils=require(_0x7f8c('0x0'));function History(_0x3e0f59){this['uniqueid']=_0x3e0f59[_0x7f8c('0x1')];this[_0x7f8c('0x2')]=_0x3e0f59['scheduledat']||undefined;this[_0x7f8c('0x3')]=_0x3e0f59[_0x7f8c('0x3')];this[_0x7f8c('0x4')]=_0x3e0f59[_0x7f8c('0x3')]===_0x7f8c('0x5')?'queue':_0x3e0f59[_0x7f8c('0x3')];this['countbusyretry']=_0x3e0f59[_0x7f8c('0x6')];this[_0x7f8c('0x7')]=_0x3e0f59['countcongestionretry'];this[_0x7f8c('0x8')]=_0x3e0f59[_0x7f8c('0x8')];this['countglobal']=_0x3e0f59[_0x7f8c('0x6')]+_0x3e0f59[_0x7f8c('0x7')]+_0x3e0f59[_0x7f8c('0x8')]+_0x3e0f59[_0x7f8c('0x9')]+_0x3e0f59['countdropretry']+_0x3e0f59['countabandonedretry']+_0x3e0f59[_0x7f8c('0xa')]+_0x3e0f59[_0x7f8c('0xb')];this[_0x7f8c('0x9')]=_0x3e0f59[_0x7f8c('0x9')];this[_0x7f8c('0xc')]=_0x3e0f59[_0x7f8c('0xc')];this[_0x7f8c('0xd')]=_0x3e0f59['countabandonedretry'];this[_0x7f8c('0xa')]=_0x3e0f59[_0x7f8c('0xa')];this[_0x7f8c('0xb')]=_0x3e0f59[_0x7f8c('0xb')];this[_0x7f8c('0xe')]=_0x3e0f59['queue'];this['calleridname']=_0x3e0f59[_0x7f8c('0xf')];this['calleridnum']=_0x3e0f59[_0x7f8c('0x10')];this[_0x7f8c('0x11')]=_0x3e0f59[_0x7f8c('0x11')];this['responsetime']=_0x3e0f59[_0x7f8c('0x12')];this['endtime']=_0x3e0f59['responsetime'];this[_0x7f8c('0x13')]=utils['getSeconds'](_0x3e0f59['responsetime'],_0x3e0f59[_0x7f8c('0x11')]);this[_0x7f8c('0x14')]=0x0;this['talktime']=0x0;this[_0x7f8c('0x15')]=_0x3e0f59[_0x7f8c('0x15')];this[_0x7f8c('0x16')]=_0x3e0f59[_0x7f8c('0x16')];this[_0x7f8c('0x17')]=_0x3e0f59['callbackat'];this[_0x7f8c('0x18')]=_0x3e0f59[_0x7f8c('0x18')];this[_0x7f8c('0x19')]=_0x3e0f59[_0x7f8c('0x19')];this[_0x7f8c('0x1a')]=_0x3e0f59[_0x7f8c('0x1a')];this[_0x7f8c('0x1b')]=_0x3e0f59[_0x7f8c('0x1b')];this[_0x7f8c('0x1c')]=_0x3e0f59[_0x7f8c('0x1c')];this[_0x7f8c('0x1d')]=_0x3e0f59['CampaignId'];this[_0x7f8c('0x1e')]=_0x3e0f59[_0x7f8c('0x1e')]||'';this['originatecalleridname']=_0x3e0f59[_0x7f8c('0x1f')]||'';this[_0x7f8c('0x20')]=_0x3e0f59[_0x7f8c('0x20')];this[_0x7f8c('0x21')]=_0x3e0f59['statedesc'];}module['exports']=History; \ No newline at end of file +var _0x330a=['callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','state','statedesc','exports','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','countmachineretry','calleridname','calleridnum','number','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','callback'];(function(_0x40278c,_0x5aaf49){var _0x186e5c=function(_0x14eae2){while(--_0x14eae2){_0x40278c['push'](_0x40278c['shift']());}};_0x186e5c(++_0x5aaf49);}(_0x330a,0x6e));var _0xa330=function(_0x5dbb3e,_0x4b494d){_0x5dbb3e=_0x5dbb3e-0x0;var _0x138d23=_0x330a[_0x5dbb3e];return _0x138d23;};'use strict';var utils=require('../utils');function History(_0x43cfa4){this['uniqueid']=_0x43cfa4['uniqueid'];this['scheduledat']=_0x43cfa4[_0xa330('0x0')]||undefined;this[_0xa330('0x1')]=_0x43cfa4[_0xa330('0x1')];this['campaigntype']=_0x43cfa4[_0xa330('0x1')]===_0xa330('0x2')?_0xa330('0x3'):_0x43cfa4[_0xa330('0x1')];this['countbusyretry']=_0x43cfa4[_0xa330('0x4')];this[_0xa330('0x5')]=_0x43cfa4[_0xa330('0x5')];this[_0xa330('0x6')]=_0x43cfa4['countnoanswerretry'];this['countglobal']=_0x43cfa4[_0xa330('0x4')]+_0x43cfa4[_0xa330('0x5')]+_0x43cfa4[_0xa330('0x6')]+_0x43cfa4[_0xa330('0x7')]+_0x43cfa4['countdropretry']+_0x43cfa4[_0xa330('0x8')]+_0x43cfa4['countmachineretry']+_0x43cfa4[_0xa330('0x9')];this[_0xa330('0x7')]=_0x43cfa4['countnosuchnumberretry'];this['countdropretry']=_0x43cfa4[_0xa330('0xa')];this['countabandonedretry']=_0x43cfa4[_0xa330('0x8')];this['countmachineretry']=_0x43cfa4[_0xa330('0xb')];this[_0xa330('0x9')]=_0x43cfa4[_0xa330('0x9')];this['queue']=_0x43cfa4['queue'];this[_0xa330('0xc')]=_0x43cfa4['name'];this[_0xa330('0xd')]=_0x43cfa4[_0xa330('0xe')];this[_0xa330('0xf')]=_0x43cfa4[_0xa330('0xf')];this[_0xa330('0x10')]=_0x43cfa4['responsetime'];this[_0xa330('0x11')]=_0x43cfa4[_0xa330('0x10')];this[_0xa330('0x12')]=utils[_0xa330('0x13')](_0x43cfa4[_0xa330('0x10')],_0x43cfa4['starttime']);this[_0xa330('0x14')]=0x0;this['talktime']=0x0;this[_0xa330('0x15')]=_0x43cfa4['callback'];this[_0xa330('0x16')]=_0x43cfa4[_0xa330('0x16')];this['callbackat']=_0x43cfa4[_0xa330('0x17')];this['recallme']=_0x43cfa4['recallme'];this[_0xa330('0x18')]=_0x43cfa4[_0xa330('0x18')];this[_0xa330('0x19')]=_0x43cfa4[_0xa330('0x19')];this['UserId']=_0x43cfa4[_0xa330('0x1a')];this['VoiceQueueId']=_0x43cfa4[_0xa330('0x1b')];this[_0xa330('0x1c')]=_0x43cfa4[_0xa330('0x1c')];this[_0xa330('0x1d')]=_0x43cfa4['originatecalleridnum']||'';this['originatecalleridname']=_0x43cfa4['originatecalleridname']||'';this[_0xa330('0x1e')]=_0x43cfa4[_0xa330('0x1e')];this['statedesc']=_0x43cfa4[_0xa330('0x1f')];}module[_0xa330('0x20')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index 44c0f1b..6585e9b 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x569c=['callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','uniqueid','calleridname','number','starttime','responsetime','droptime','dropreason','endtime','ringtime','getSeconds','holdtime','membername','connectedlinename','reason','callback'];(function(_0x3d781b,_0x433d58){var _0x36ea7f=function(_0x59bd5e){while(--_0x59bd5e){_0x3d781b['push'](_0x3d781b['shift']());}};_0x36ea7f(++_0x433d58);}(_0x569c,0x1a6));var _0xc569=function(_0x2dda86,_0x27f6f2){_0x2dda86=_0x2dda86-0x0;var _0x240b52=_0x569c[_0x2dda86];return _0x240b52;};'use strict';var utils=require(_0xc569('0x0'));function QueueCallerAbandon(_0x533846,_0x107a32){this['scheduledat']=_0x533846[_0xc569('0x1')];this[_0xc569('0x2')]=_0x533846['type'];this[_0xc569('0x3')]=_0x533846[_0xc569('0x2')]==='outbound'?_0xc569('0x4'):_0x533846[_0xc569('0x2')];this[_0xc569('0x5')]=_0x533846[_0xc569('0x5')];this[_0xc569('0x6')]=_0x533846[_0xc569('0x6')];this[_0xc569('0x7')]=_0x533846[_0xc569('0x7')];this[_0xc569('0x8')]=_0x533846[_0xc569('0x5')]+_0x533846[_0xc569('0x6')]+_0x533846['countnoanswerretry']+_0x533846['countnosuchnumberretry']+_0x533846['countdropretry']+_0x533846[_0xc569('0x9')]+_0x533846[_0xc569('0xa')]+_0x533846[_0xc569('0xb')];this[_0xc569('0xc')]=_0x533846[_0xc569('0xc')];this[_0xc569('0xd')]=_0x533846['countdropretry'];this[_0xc569('0x9')]=_0x533846[_0xc569('0x9')];this[_0xc569('0xa')]=_0x533846[_0xc569('0xa')];this['countagentrejectretry']=_0x533846[_0xc569('0xb')];this[_0xc569('0xe')]=_0x107a32[_0xc569('0xe')];this[_0xc569('0xf')]=_0x533846['name'];this['calleridnum']=_0x533846[_0xc569('0x10')];this[_0xc569('0x11')]=_0x533846[_0xc569('0x11')];this[_0xc569('0x12')]=_0x533846[_0xc569('0x12')];this['droptime']=_0x533846[_0xc569('0x13')];this[_0xc569('0x14')]=_0x533846[_0xc569('0x14')];this[_0xc569('0x15')]=this[_0xc569('0x13')];this[_0xc569('0x16')]=utils[_0xc569('0x17')](_0x533846[_0xc569('0x12')],_0x533846['starttime']);this[_0xc569('0x18')]=utils[_0xc569('0x17')](this['droptime'],_0x533846[_0xc569('0x12')]);this['talktime']=0x0;this['queue']=_0x107a32[_0xc569('0x4')];this[_0xc569('0x19')]=_0x107a32[_0xc569('0x1a')];this['reason']=_0x107a32[_0xc569('0x1b')];this[_0xc569('0x1c')]=_0x533846['callback'];this['callbackuniqueid']=_0x533846['callbackuniqueid'];this[_0xc569('0x1d')]=_0x533846['callbackat'];this[_0xc569('0x1e')]=_0x533846[_0xc569('0x1e')];this[_0xc569('0x1f')]=_0x533846['ContactId'];this['ListId']=_0x533846[_0xc569('0x20')];this['UserId']=_0x533846['UserId'];this[_0xc569('0x21')]=_0x533846['VoiceQueueId'];this[_0xc569('0x22')]=_0x533846['CampaignId'];this[_0xc569('0x23')]=_0x533846['originatecalleridnum']||'';this[_0xc569('0x24')]=_0x533846[_0xc569('0x24')]||'';this[_0xc569('0x25')]=_0x533846[_0xc569('0x25')];this[_0xc569('0x26')]=_0x533846[_0xc569('0x26')];this[_0xc569('0x27')]=_0x533846['statedesc'];}module[_0xc569('0x28')]=QueueCallerAbandon; \ No newline at end of file +var _0xc59e=['starttime','responsetime','connectedlinename','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','droptime','dropreason','endtime','ringtime','getSeconds'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xc59e,0x1b6));var _0xec59=function(_0x5a7744,_0x19fba7){_0x5a7744=_0x5a7744-0x0;var _0x6abf68=_0xc59e[_0x5a7744];return _0x6abf68;};'use strict';var utils=require(_0xec59('0x0'));function QueueCallerAbandon(_0x5c8f71,_0x53bba4){this[_0xec59('0x1')]=_0x5c8f71[_0xec59('0x1')];this[_0xec59('0x2')]=_0x5c8f71[_0xec59('0x2')];this[_0xec59('0x3')]=_0x5c8f71[_0xec59('0x2')]===_0xec59('0x4')?_0xec59('0x5'):_0x5c8f71[_0xec59('0x2')];this[_0xec59('0x6')]=_0x5c8f71[_0xec59('0x6')];this[_0xec59('0x7')]=_0x5c8f71[_0xec59('0x7')];this['countnoanswerretry']=_0x5c8f71[_0xec59('0x8')];this[_0xec59('0x9')]=_0x5c8f71[_0xec59('0x6')]+_0x5c8f71[_0xec59('0x7')]+_0x5c8f71[_0xec59('0x8')]+_0x5c8f71[_0xec59('0xa')]+_0x5c8f71[_0xec59('0xb')]+_0x5c8f71[_0xec59('0xc')]+_0x5c8f71['countmachineretry']+_0x5c8f71['countagentrejectretry'];this[_0xec59('0xa')]=_0x5c8f71[_0xec59('0xa')];this['countdropretry']=_0x5c8f71[_0xec59('0xb')];this[_0xec59('0xc')]=_0x5c8f71[_0xec59('0xc')];this[_0xec59('0xd')]=_0x5c8f71[_0xec59('0xd')];this[_0xec59('0xe')]=_0x5c8f71[_0xec59('0xe')];this[_0xec59('0xf')]=_0x53bba4[_0xec59('0xf')];this[_0xec59('0x10')]=_0x5c8f71[_0xec59('0x11')];this[_0xec59('0x12')]=_0x5c8f71['number'];this['starttime']=_0x5c8f71['starttime'];this['responsetime']=_0x5c8f71['responsetime'];this[_0xec59('0x13')]=_0x5c8f71[_0xec59('0x13')];this[_0xec59('0x14')]=_0x5c8f71['dropreason'];this[_0xec59('0x15')]=this[_0xec59('0x13')];this[_0xec59('0x16')]=utils[_0xec59('0x17')](_0x5c8f71['responsetime'],_0x5c8f71[_0xec59('0x18')]);this['holdtime']=utils[_0xec59('0x17')](this['droptime'],_0x5c8f71[_0xec59('0x19')]);this['talktime']=0x0;this[_0xec59('0x5')]=_0x53bba4[_0xec59('0x5')];this['membername']=_0x53bba4[_0xec59('0x1a')];this[_0xec59('0x1b')]=_0x53bba4['reason'];this['callback']=_0x5c8f71[_0xec59('0x1c')];this['callbackuniqueid']=_0x5c8f71['callbackuniqueid'];this['callbackat']=_0x5c8f71[_0xec59('0x1d')];this[_0xec59('0x1e')]=_0x5c8f71['recallme'];this[_0xec59('0x1f')]=_0x5c8f71[_0xec59('0x1f')];this[_0xec59('0x20')]=_0x5c8f71['ListId'];this[_0xec59('0x21')]=_0x5c8f71[_0xec59('0x21')];this['VoiceQueueId']=_0x5c8f71[_0xec59('0x22')];this[_0xec59('0x23')]=_0x5c8f71[_0xec59('0x23')];this[_0xec59('0x24')]=_0x5c8f71[_0xec59('0x24')]||'';this[_0xec59('0x25')]=_0x5c8f71['originatecalleridname']||'';this[_0xec59('0x26')]=_0x5c8f71[_0xec59('0x26')];this[_0xec59('0x27')]=_0x5c8f71['state'];this[_0xec59('0x28')]=_0x5c8f71['statedesc'];}module[_0xec59('0x29')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 5e2d797..891a0d6 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6ac=['../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','temp','error','getContactDialerIvr','countReScheduled','[countReScheduled]','catch','[rescheduleContact]','rescheduleContact','[unlockContact]','unlockContact','moveContactManagedDialer','[moveContactManagedDialer]','[checkIsBlackList]','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','createHistory','util','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone'];(function(_0x43b169,_0x553359){var _0x1a9140=function(_0x5e7e77){while(--_0x5e7e77){_0x43b169['push'](_0x43b169['shift']());}};_0x1a9140(++_0x553359);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x24f09e,_0x1c102e){_0x24f09e=_0x24f09e-0x0;var _0xece0ce=_0xc6ac[_0x24f09e];return _0xece0ce;};'use strict';var util=require(_0xcc6a('0x0'));var logger=require(_0xcc6a('0x1'))(_0xcc6a('0x2'));var cmHopper=require(_0xcc6a('0x3'));var cmHopperAdditionalPhone=require(_0xcc6a('0x4'));var cmHopperBlack=require(_0xcc6a('0x5'));var cmHopperHistory=require(_0xcc6a('0x6'));function inspectError(_0x31bbcd){return util[_0xcc6a('0x7')](_0x31bbcd,{'showHidden':![],'depth':null});}function getContactDialer(_0x22ee99,_0x2f26ab,_0x188b05){return cmHopper[_0xcc6a('0x8')](_0x22ee99['id'],_0x2f26ab,_0x188b05,_0x22ee99[_0xcc6a('0x9')])['catch'](function(_0x3dd497){_0x22ee99[_0xcc6a('0xa')]=0x0;logger[_0xcc6a('0xb')]('[getContactDialer]',inspectError(_0x3dd497));});}exports[_0xcc6a('0x8')]=getContactDialer;function getContactDialerIvr(_0x210f63,_0x7806a0){return cmHopper[_0xcc6a('0xc')](_0x210f63['id'],_0x7806a0,_0x210f63[_0xcc6a('0x9')])['catch'](function(_0x30a004){_0x210f63[_0xcc6a('0xa')]=0x0;logger[_0xcc6a('0xb')]('[getContactDialerIvr]',inspectError(_0x30a004));});}exports[_0xcc6a('0xc')]=getContactDialerIvr;function countReScheduled(_0x9e9a63){return cmHopper[_0xcc6a('0xd')](_0x9e9a63)['catch'](function(_0x59ce6d){logger[_0xcc6a('0xb')](_0xcc6a('0xe'),inspectError(_0x59ce6d));});}exports[_0xcc6a('0xd')]=countReScheduled;function rescheduleContact(_0x559a0a){return cmHopper['rescheduleContact'](_0x559a0a)[_0xcc6a('0xf')](function(_0xcb9e2e){logger[_0xcc6a('0xb')](_0xcc6a('0x10'),inspectError(_0xcb9e2e));});}exports[_0xcc6a('0x11')]=rescheduleContact;function unlockContact(_0x337ec5,_0x4133fa,_0x403b18){return cmHopper['unlockContact'](_0x337ec5,_0x4133fa,_0x403b18)['catch'](function(_0x4d021a){logger[_0xcc6a('0xb')](_0xcc6a('0x12'),inspectError(_0x4d021a));});}exports[_0xcc6a('0x13')]=unlockContact;function moveContactManagedDialer(_0x3e63d9){return cmHopper[_0xcc6a('0x14')](_0x3e63d9)[_0xcc6a('0xf')](function(_0x2d9585){logger[_0xcc6a('0xb')](_0xcc6a('0x15'),inspectError(_0x2d9585));});}exports[_0xcc6a('0x14')]=moveContactManagedDialer;function checkIsBlackList(_0x1d20a3){return cmHopperBlack['checkIsBlackList'](_0x1d20a3)[_0xcc6a('0xf')](function(_0x3e1fda){logger[_0xcc6a('0xb')](_0xcc6a('0x16'),inspectError(_0x3e1fda));});}exports[_0xcc6a('0x17')]=checkIsBlackList;function checkIsBlackListIvr(_0x30b8ed){return cmHopperBlack[_0xcc6a('0x18')](_0x30b8ed)[_0xcc6a('0xf')](function(_0x2254a8){logger[_0xcc6a('0xb')](_0xcc6a('0x19'),inspectError(_0x2254a8));});}exports[_0xcc6a('0x18')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x51be9a,_0x41c4c8,_0x3a081e){return cmHopperAdditionalPhone[_0xcc6a('0x1a')](_0x51be9a,_0x41c4c8,_0x3a081e)['catch'](function(_0x10016a){logger[_0xcc6a('0xb')](_0xcc6a('0x1b'),inspectError(_0x10016a));});}exports[_0xcc6a('0x1a')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x432c23,_0x5fc697,_0x50abc1){return cmHopperAdditionalPhone[_0xcc6a('0x1c')](_0x432c23,_0x5fc697,_0x50abc1)[_0xcc6a('0xf')](function(_0x3514f3){logger['error'](_0xcc6a('0x1d'),inspectError(_0x3514f3));});}exports[_0xcc6a('0x1c')]=swapAdditionalPhones;function avgHandleTime(_0x4da301){return cmHopperHistory[_0xcc6a('0x1e')](_0x4da301)[_0xcc6a('0xf')](function(_0x3233d1){logger[_0xcc6a('0xb')]('[avgHandleTime]',inspectError(_0x3233d1));});}exports[_0xcc6a('0x1e')]=avgHandleTime;function createHistory(_0x3cf14c){return cmHopperHistory[_0xcc6a('0x1f')](_0x3cf14c)['catch'](function(_0x2590a2){logger['error']('[createHistory]',inspectError(_0x2590a2));});}exports[_0xcc6a('0x1f')]=createHistory; \ No newline at end of file +var _0x27a0=['[avgHandleTime]','createHistory','../../../../config/logger','dialer','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','getContactDialer','dialOrderByScheduledAt','catch','error','[getContactDialer]','getContactDialerIvr','temp','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','unlockContact','moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','checkIsBlackListIvr','verifyAdditionalPhones','[swapAdditionalPhone]','swapAdditionalPhones','avgHandleTime'];(function(_0x2ad510,_0x2f2757){var _0x3d9c99=function(_0x1b0d90){while(--_0x1b0d90){_0x2ad510['push'](_0x2ad510['shift']());}};_0x3d9c99(++_0x2f2757);}(_0x27a0,0xbf));var _0x027a=function(_0x39573f,_0x2126b2){_0x39573f=_0x39573f-0x0;var _0x21f15f=_0x27a0[_0x39573f];return _0x21f15f;};'use strict';var util=require('util');var logger=require(_0x027a('0x0'))(_0x027a('0x1'));var cmHopper=require(_0x027a('0x2'));var cmHopperAdditionalPhone=require(_0x027a('0x3'));var cmHopperBlack=require(_0x027a('0x4'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x58a58b){return util['inspect'](_0x58a58b,{'showHidden':![],'depth':null});}function getContactDialer(_0x47cd65,_0x30a54d,_0x2a409a){return cmHopper[_0x027a('0x5')](_0x47cd65['id'],_0x30a54d,_0x2a409a,_0x47cd65[_0x027a('0x6')])[_0x027a('0x7')](function(_0x3c7d67){_0x47cd65['temp']=0x0;logger[_0x027a('0x8')](_0x027a('0x9'),inspectError(_0x3c7d67));});}exports[_0x027a('0x5')]=getContactDialer;function getContactDialerIvr(_0x4ccee2,_0x44c56a){return cmHopper[_0x027a('0xa')](_0x4ccee2['id'],_0x44c56a,_0x4ccee2[_0x027a('0x6')])['catch'](function(_0x6d5b04){_0x4ccee2[_0x027a('0xb')]=0x0;logger[_0x027a('0x8')](_0x027a('0xc'),inspectError(_0x6d5b04));});}exports[_0x027a('0xa')]=getContactDialerIvr;function countReScheduled(_0x267afc){return cmHopper[_0x027a('0xd')](_0x267afc)[_0x027a('0x7')](function(_0x351d7e){logger[_0x027a('0x8')](_0x027a('0xe'),inspectError(_0x351d7e));});}exports['countReScheduled']=countReScheduled;function rescheduleContact(_0xe64d3a){return cmHopper[_0x027a('0xf')](_0xe64d3a)[_0x027a('0x7')](function(_0x21da53){logger[_0x027a('0x8')]('[rescheduleContact]',inspectError(_0x21da53));});}exports['rescheduleContact']=rescheduleContact;function unlockContact(_0x1d680d,_0x5cfc6d,_0x2b3870){return cmHopper['unlockContact'](_0x1d680d,_0x5cfc6d,_0x2b3870)[_0x027a('0x7')](function(_0x5a1224){logger['error']('[unlockContact]',inspectError(_0x5a1224));});}exports[_0x027a('0x10')]=unlockContact;function moveContactManagedDialer(_0x2f04e9){return cmHopper[_0x027a('0x11')](_0x2f04e9)[_0x027a('0x7')](function(_0x52125e){logger[_0x027a('0x8')](_0x027a('0x12'),inspectError(_0x52125e));});}exports['moveContactManagedDialer']=moveContactManagedDialer;function checkIsBlackList(_0x4f8c3d){return cmHopperBlack[_0x027a('0x13')](_0x4f8c3d)['catch'](function(_0x1d4a7a){logger['error']('[checkIsBlackList]',inspectError(_0x1d4a7a));});}exports['checkIsBlackList']=checkIsBlackList;function checkIsBlackListIvr(_0x4b4f90){return cmHopperBlack[_0x027a('0x14')](_0x4b4f90)[_0x027a('0x7')](function(_0x266c9e){logger[_0x027a('0x8')]('[checkIsBlackListIvr]',inspectError(_0x266c9e));});}exports[_0x027a('0x14')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x119a5c,_0x20e2da,_0x3dee99){return cmHopperAdditionalPhone[_0x027a('0x15')](_0x119a5c,_0x20e2da,_0x3dee99)[_0x027a('0x7')](function(_0x595f0e){logger[_0x027a('0x8')]('[verifyAdditionalPhone]',inspectError(_0x595f0e));});}exports[_0x027a('0x15')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x2e97c5,_0x1b1a13,_0x83fe3e){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x2e97c5,_0x1b1a13,_0x83fe3e)['catch'](function(_0x18458f){logger[_0x027a('0x8')](_0x027a('0x16'),inspectError(_0x18458f));});}exports[_0x027a('0x17')]=swapAdditionalPhones;function avgHandleTime(_0x511c7a){return cmHopperHistory[_0x027a('0x18')](_0x511c7a)['catch'](function(_0x953887){logger['error'](_0x027a('0x19'),inspectError(_0x953887));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x578ea5){return cmHopperHistory[_0x027a('0x1a')](_0x578ea5)['catch'](function(_0x47a365){logger[_0x027a('0x8')]('[createHistory]',inspectError(_0x47a365));});}exports[_0x027a('0x1a')]=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index d3cc07e..22c5162 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0f91=['isPreviewCampaign','type','ivr','isIVRCampaign','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','seconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','inUse','originated','Trunk','name','dialTimezone','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes','status','TrunkBackup','ACTIVE','waiting','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','DISACTIVED','INACTIVE','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','replace','random','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactLowerLimitOriginate','createdAt','updatedAt','undefined','description','toUpperCase','substring','XMD-','setXMDContactVariables','lodash','moment','util','../../../../config/logger','dialer','RESCHEDULED_CONTACTS','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod'];(function(_0x1233a6,_0x447f3f){var _0x30d72b=function(_0xcf5f68){while(--_0xcf5f68){_0x1233a6['push'](_0x1233a6['shift']());}};_0x30d72b(++_0x447f3f);}(_0x0f91,0x1ae));var _0x10f9=function(_0x33f7e1,_0x48d209){_0x33f7e1=_0x33f7e1-0x0;var _0x23bab4=_0x0f91[_0x33f7e1];return _0x23bab4;};'use strict';var _=require(_0x10f9('0x0'));var moment=require(_0x10f9('0x1'));var util=require(_0x10f9('0x2'));var logger=require(_0x10f9('0x3'))(_0x10f9('0x4'));var timezones=require('../../../../config/environment/shared')['timezones'];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':'BLACKLIST','CONTACTS_RESCHEDULED':_0x10f9('0x5'),'DEACTIVATED':_0x10f9('0x6'),'DISACTIVED':_0x10f9('0x7'),'EMPTY_INTERVAL':_0x10f9('0x8'),'INACTIVE':_0x10f9('0x9'),'NO_AGENTS_LOGGED':_0x10f9('0xa'),'NO_AVAILABLE_CONTACTS':_0x10f9('0xb'),'NULL_INTERVAL':_0x10f9('0xc'),'OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':_0x10f9('0xd'),'RECALL_TIMEOUT':_0x10f9('0xe'),'RUNNING':_0x10f9('0xf'),'UNKNOWN_TIMEZONE':_0x10f9('0x10'),'UNREACHABLE_TRUNK':_0x10f9('0x11')};exports[_0x10f9('0x12')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x3c2840){return _0x3c2840[_0x10f9('0x13')]==='preview';}exports[_0x10f9('0x14')]=isPreviewCampaign;function isIVRCampaign(_0x2a87aa){return _0x2a87aa[_0x10f9('0x15')]===_0x10f9('0x16');}exports[_0x10f9('0x17')]=isIVRCampaign;function isOutboundQueue(_0x17d5fa){return _0x17d5fa[_0x10f9('0x15')]===_0x10f9('0x18');}exports[_0x10f9('0x19')]=isOutboundQueue;function isQueueCampaignActive(_0x18ee4a){return _0x18ee4a[_0x10f9('0x1a')];}exports[_0x10f9('0x1b')]=isQueueCampaignActive;function isIVRCampaignActive(_0x29c1d5){return _0x29c1d5[_0x10f9('0x1c')];}exports[_0x10f9('0x1d')]=isIVRCampaignActive;function getSeconds(_0x31c5cb,_0x234383){var _0x2f45c8=moment(_0x31c5cb)[_0x10f9('0x1e')](0x0);var _0x28d0d6=moment(_0x234383)[_0x10f9('0x1e')](0x0);return _0x2f45c8[_0x10f9('0x1f')](_0x28d0d6,_0x10f9('0x20'));}exports['getSeconds']=getSeconds;function hasQueueCampaignDataChanged(_0x5953aa,_0x22dd0c){var _0x5747c1=![];var _0xb14a59=_0x5953aa['dialMethod']!==_0x22dd0c[_0x10f9('0x13')]||_0x5953aa['dialActive']!==_0x22dd0c[_0x10f9('0x1a')]||_0x5953aa[_0x10f9('0x21')]!==_0x22dd0c[_0x10f9('0x21')];var _0x317f1a=_0x5953aa[_0x10f9('0x22')]!==_0x22dd0c[_0x10f9('0x22')]||_0x5953aa['loggedIn']!==_0x22dd0c[_0x10f9('0x23')]||_0x5953aa[_0x10f9('0x24')]!==_0x22dd0c[_0x10f9('0x24')]||_0x5953aa['paused']!==_0x22dd0c[_0x10f9('0x25')]||_0x5953aa[_0x10f9('0x26')]!==_0x22dd0c[_0x10f9('0x26')]||_0x5953aa['pTalking']!==_0x22dd0c[_0x10f9('0x27')]||_0x5953aa['waiting']!==_0x22dd0c['waiting']||_0x5953aa[_0x10f9('0x28')]!==_0x22dd0c['inUse']||_0x5953aa['originated']!==_0x22dd0c[_0x10f9('0x29')];if(_0x5953aa[_0x10f9('0x2a')]&&_0x22dd0c[_0x10f9('0x2a')]){_0x5747c1=_0x5953aa[_0x10f9('0x2a')][_0x10f9('0x2b')]!==_0x22dd0c['Trunk'][_0x10f9('0x2b')]||_0x5953aa['Trunk'][_0x10f9('0x1c')]!==_0x22dd0c['Trunk'][_0x10f9('0x1c')];}return _0xb14a59||_0x317f1a||_0x5747c1;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0xc0086d){var _0x3a35fe=null;var _0x4f9ed5=_0xc0086d[_0x10f9('0x2c')];if(_[_0x10f9('0x2d')](_0xc0086d[_0x10f9('0x2e')])||_[_0x10f9('0x2d')](_0xc0086d[_0x10f9('0x2f')])||_[_0x10f9('0x2d')](_0xc0086d[_0x10f9('0x2f')][_0x10f9('0x30')])){_0x3a35fe=CAMPAIGN_STATUS[_0x10f9('0x31')];}else if(_[_0x10f9('0x32')](_0xc0086d[_0x10f9('0x2e')])||_[_0x10f9('0x32')](_0xc0086d[_0x10f9('0x2f')][_0x10f9('0x30')])){_0x3a35fe=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0x4f9ed5&&!timezones[_0x4f9ed5]){_0x3a35fe=CAMPAIGN_STATUS[_0x10f9('0x33')];}return _0x3a35fe;}function checkAnyValidTrunk(_0x589de7,_0x3d5e94){var _0xa6f1d7=null;var _0x407634=_0x10f9('0x34');var _0x13633b=[_0x10f9('0x35'),_0x10f9('0x36')];var _0x30dfce=!![];if(_0x589de7['Trunk']&&_0x589de7[_0x10f9('0x2a')][_0x10f9('0x1c')]){_0x407634+=_0x589de7[_0x10f9('0x2a')][_0x10f9('0x2b')];_0xa6f1d7=_0x3d5e94[_0x407634];_0x30dfce=_0x13633b[_0x10f9('0x37')](_0xa6f1d7[_0x10f9('0x38')]);}else if(_0x589de7[_0x10f9('0x39')]&&_0x589de7[_0x10f9('0x39')][_0x10f9('0x1c')]){_0x407634+=_0x589de7[_0x10f9('0x39')]['name'];_0xa6f1d7=_0x3d5e94[_0x407634];_0x30dfce=_0x13633b[_0x10f9('0x37')](_0xa6f1d7[_0x10f9('0x38')]);}return _0x30dfce;}function getQueueCampaignStatusMessage(_0x2943a0,_0x379b99){var _0x460b22=CAMPAIGN_STATUS[_0x10f9('0x3a')];var _0x31e05c=isPreviewCampaign(_0x2943a0);if(!isQueueCampaignActive(_0x2943a0)){if(_0x31e05c){_0x460b22=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x2943a0[_0x10f9('0x29')]===0x0&&_0x2943a0['talking']===0x0&&_0x2943a0[_0x10f9('0x3b')]===0x0&&(_0x2943a0[_0x10f9('0x27')]||0x0)===0x0){_0x460b22=CAMPAIGN_STATUS['INACTIVE'];}else{_0x460b22=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x2943a0[_0x10f9('0x23')]===0x0){_0x460b22=CAMPAIGN_STATUS['NO_AGENTS_LOGGED'];}else if(!checkAnyValidTrunk(_0x2943a0,_0x379b99)){_0x460b22=CAMPAIGN_STATUS[_0x10f9('0x3c')];}else if(!isPreviewCampaign(_0x2943a0)){var _0x14a52e=checkAnyValidQueueCampaignInterval(_0x2943a0);if(_0x14a52e){_0x460b22=_0x14a52e;}}return _0x460b22;}exports[_0x10f9('0x3d')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0xdbc777){var _0x440910=CAMPAIGN_STATUS[_0x10f9('0x3e')];if(_0xdbc777[_0x10f9('0x29')]===0x0&&_0xdbc777[_0x10f9('0x26')]===0x0&&_0xdbc777['waiting']===0x0&&(_0xdbc777[_0x10f9('0x27')]||0x0)===0x0){_0x440910=CAMPAIGN_STATUS[_0x10f9('0x3f')];}return _0x440910;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x51ecc0){var _0x5960bc=_0x51ecc0['match'](/"(.*?)"/);return _0x5960bc?_0x5960bc[0x1]:_0x51ecc0;}exports[_0x10f9('0x40')]=extractCalleridName;function getCallerId(_0x2fee7f,_0x213457,_0x4a850b){if(!_['isUndefined'](_0x4a850b)&&typeof _0x4a850b==='string'&&!_[_0x10f9('0x32')](_0x4a850b)){if(!_[_0x10f9('0x41')](_0x213457)&&typeof _0x213457===_0x10f9('0x42')&&!_[_0x10f9('0x32')](_0x213457)){return util[_0x10f9('0x43')](_0x10f9('0x44'),_0x213457,_0x4a850b);}return util[_0x10f9('0x43')](_0x10f9('0x44'),_0x4a850b,_0x4a850b);}if(!_['isUndefined'](_0x2fee7f)&&typeof _0x2fee7f===_0x10f9('0x42')&&!_['isEmpty'](_0x2fee7f)){return _0x2fee7f;}return _0x10f9('0x45');}exports[_0x10f9('0x46')]=getCallerId;function getCallerIdRandom(_0x4bd1f4,_0x58dbc8){var _0x347391;var _0x281465;var _0x24518a;if(_0x58dbc8<=0x0){_0x58dbc8=0x1;}_0x347391=new RegExp(_0x10f9('0x47')+_0x58dbc8+'}$');_0x281465=Math[_0x10f9('0x48')](0xa,_0x58dbc8-0x1);_0x24518a=Math[_0x10f9('0x48')](0xa,_0x58dbc8)-0x1;return util[_0x10f9('0x43')]('%s',_[_0x10f9('0x49')](_0x4bd1f4,_0x347391,_[_0x10f9('0x4a')](_0x281465,_0x24518a)[_0x10f9('0x4b')]()));}exports[_0x10f9('0x4c')]=getCallerIdRandom;function decrementOriginate(_0x111e12){if(_0x111e12['originated']&&_0x111e12['originated']>0x0){_0x111e12[_0x10f9('0x29')]-=0x1;}else{logger[_0x10f9('0x4d')](_0x10f9('0x4e'));}}exports[_0x10f9('0x4f')]=decrementOriginate;function checkContactEmpty(_0x146c39){return _0x146c39&&_0x146c39[_0x10f9('0x50')]>0x0;}exports['checkContactEmpty']=checkContactEmpty;function erlangb(_0x5c4fa9,_0x5a9d6a){if(_0x5a9d6a===0x0){return 0x0;}var _0x3cfa39=0x1;for(var _0xacb341=0x1;_0xacb341<=_0x5a9d6a;_0xacb341+=0x1){_0x3cfa39=0x1+_0x3cfa39*_0xacb341/_0x5c4fa9;}return 0x1/_0x3cfa39;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x881e07,_0x34be50,_0x4eb4ed){if(_0x34be50>_0x4eb4ed){for(var _0xfc91b4=0x0;_0xfc91b4<_0x34be50-_0x4eb4ed;_0xfc91b4+=0x1){decrementOriginate(_0x881e07);}}}exports[_0x10f9('0x51')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x1f22fc){var _0x5d366d={};var _0x30b698=['id',_0x10f9('0x52'),'tags',_0x10f9('0x53')];const _0xfecc7d=0xfa;if(_0x1f22fc){for(var _0x14f458 in _0x1f22fc){if(typeof _0x1f22fc[_0x14f458]!==_0x10f9('0x54')){if(!_[_0x10f9('0x2d')](_0x1f22fc[_0x14f458])&&!_0x30b698[_0x10f9('0x37')](_0x14f458)){if(_0x14f458===_0x10f9('0x55')&&_0x1f22fc[_0x14f458][_0x10f9('0x50')]>_0xfecc7d){_0x5d366d['XMD-'+_0x14f458[_0x10f9('0x56')]()]=_0x1f22fc[_0x14f458][_0x10f9('0x4b')]()[_0x10f9('0x57')](0x0,_0xfecc7d);}else{_0x5d366d[_0x10f9('0x58')+_0x14f458[_0x10f9('0x56')]()]=_0x1f22fc[_0x14f458];}}}}}return _0x5d366d;}exports[_0x10f9('0x59')]=setXMDContactVariables; \ No newline at end of file +var _0x2e09=['status','TrunkBackup','INACTIVE','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','getCallerId','\x5cw{0,','pow','replace','random','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','checkContactLowerLimitOriginate','createdAt','tags','toUpperCase','toString','lodash','moment','util','../../../../config/logger','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','RESCHEDULED_CONTACTS','DEACTIVATED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','CAMPAIGN_STATUS','dialMethod','preview','type','ivr','isIVRCampaign','outbound','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','Interval','Intervals','NULL_INTERVAL','dialGlobalInterval','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','includes'];(function(_0x3afa16,_0x3320be){var _0x5e2a4a=function(_0x5c122f){while(--_0x5c122f){_0x3afa16['push'](_0x3afa16['shift']());}};_0x5e2a4a(++_0x3320be);}(_0x2e09,0x6f));var _0x92e0=function(_0x19980b,_0x23bf9d){_0x19980b=_0x19980b-0x0;var _0x83817d=_0x2e09[_0x19980b];return _0x83817d;};'use strict';var _=require(_0x92e0('0x0'));var moment=require(_0x92e0('0x1'));var util=require(_0x92e0('0x2'));var logger=require(_0x92e0('0x3'))('dialer');var timezones=require(_0x92e0('0x4'))[_0x92e0('0x5')];var CAMPAIGN_STATUS={'ACTIVE':_0x92e0('0x6'),'BLACKLIST':_0x92e0('0x7'),'CONTACTS_RESCHEDULED':_0x92e0('0x8'),'DEACTIVATED':_0x92e0('0x9'),'DISACTIVED':'IS_DISACTIVED','EMPTY_INTERVAL':_0x92e0('0xa'),'INACTIVE':_0x92e0('0xb'),'NO_AGENTS_LOGGED':_0x92e0('0xc'),'NO_AVAILABLE_CONTACTS':_0x92e0('0xd'),'NULL_INTERVAL':_0x92e0('0xe'),'OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':_0x92e0('0xf'),'QUEUE_RECALL':_0x92e0('0x10'),'RECALL_TIMEOUT':_0x92e0('0x11'),'RUNNING':_0x92e0('0x12'),'UNKNOWN_TIMEZONE':_0x92e0('0x13'),'UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports[_0x92e0('0x14')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x3d32c3){return _0x3d32c3[_0x92e0('0x15')]===_0x92e0('0x16');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x506aaf){return _0x506aaf[_0x92e0('0x17')]===_0x92e0('0x18');}exports[_0x92e0('0x19')]=isIVRCampaign;function isOutboundQueue(_0x72d4bf){return _0x72d4bf[_0x92e0('0x17')]===_0x92e0('0x1a');}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x542d48){return _0x542d48[_0x92e0('0x1b')];}exports[_0x92e0('0x1c')]=isQueueCampaignActive;function isIVRCampaignActive(_0x4ab0a6){return _0x4ab0a6[_0x92e0('0x1d')];}exports[_0x92e0('0x1e')]=isIVRCampaignActive;function getSeconds(_0x1c128d,_0x12c9f7){var _0x219c14=moment(_0x1c128d)[_0x92e0('0x1f')](0x0);var _0x20bead=moment(_0x12c9f7)['milliseconds'](0x0);return _0x219c14[_0x92e0('0x20')](_0x20bead,_0x92e0('0x21'));}exports[_0x92e0('0x22')]=getSeconds;function hasQueueCampaignDataChanged(_0x2fb000,_0x4ffea5){var _0x58ec89=![];var _0x3bb937=_0x2fb000[_0x92e0('0x15')]!==_0x4ffea5[_0x92e0('0x15')]||_0x2fb000[_0x92e0('0x1b')]!==_0x4ffea5[_0x92e0('0x1b')]||_0x2fb000['message']!==_0x4ffea5[_0x92e0('0x23')];var _0x47a822=_0x2fb000[_0x92e0('0x24')]!==_0x4ffea5[_0x92e0('0x24')]||_0x2fb000['loggedIn']!==_0x4ffea5[_0x92e0('0x25')]||_0x2fb000[_0x92e0('0x26')]!==_0x4ffea5[_0x92e0('0x26')]||_0x2fb000[_0x92e0('0x27')]!==_0x4ffea5['paused']||_0x2fb000[_0x92e0('0x28')]!==_0x4ffea5[_0x92e0('0x28')]||_0x2fb000[_0x92e0('0x29')]!==_0x4ffea5[_0x92e0('0x29')]||_0x2fb000[_0x92e0('0x2a')]!==_0x4ffea5['waiting']||_0x2fb000[_0x92e0('0x2b')]!==_0x4ffea5[_0x92e0('0x2b')]||_0x2fb000[_0x92e0('0x2c')]!==_0x4ffea5[_0x92e0('0x2c')];if(_0x2fb000[_0x92e0('0x2d')]&&_0x4ffea5[_0x92e0('0x2d')]){_0x58ec89=_0x2fb000['Trunk']['name']!==_0x4ffea5[_0x92e0('0x2d')][_0x92e0('0x2e')]||_0x2fb000[_0x92e0('0x2d')][_0x92e0('0x1d')]!==_0x4ffea5[_0x92e0('0x2d')][_0x92e0('0x1d')];}return _0x3bb937||_0x47a822||_0x58ec89;}exports[_0x92e0('0x2f')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0xe37ef9){var _0x262340=null;var _0x37f66c=_0xe37ef9[_0x92e0('0x30')];if(_[_0x92e0('0x31')](_0xe37ef9['dialGlobalInterval'])||_['isNil'](_0xe37ef9[_0x92e0('0x32')])||_[_0x92e0('0x31')](_0xe37ef9[_0x92e0('0x32')][_0x92e0('0x33')])){_0x262340=CAMPAIGN_STATUS[_0x92e0('0x34')];}else if(_['isEmpty'](_0xe37ef9[_0x92e0('0x35')])||_['isEmpty'](_0xe37ef9['Interval']['Intervals'])){_0x262340=CAMPAIGN_STATUS[_0x92e0('0x36')];}else if(_0x37f66c&&!timezones[_0x37f66c]){_0x262340=CAMPAIGN_STATUS[_0x92e0('0x37')];}return _0x262340;}function checkAnyValidTrunk(_0x236ca8,_0x416ec0){var _0x2a5d68=null;var _0x42390a='SIP/';var _0x58cea8=['reachable','unmonitored'];var _0x595b25=!![];if(_0x236ca8['Trunk']&&_0x236ca8[_0x92e0('0x2d')]['active']){_0x42390a+=_0x236ca8['Trunk'][_0x92e0('0x2e')];_0x2a5d68=_0x416ec0[_0x42390a];_0x595b25=_0x58cea8[_0x92e0('0x38')](_0x2a5d68[_0x92e0('0x39')]);}else if(_0x236ca8[_0x92e0('0x3a')]&&_0x236ca8[_0x92e0('0x3a')][_0x92e0('0x1d')]){_0x42390a+=_0x236ca8[_0x92e0('0x3a')][_0x92e0('0x2e')];_0x2a5d68=_0x416ec0[_0x42390a];_0x595b25=_0x58cea8[_0x92e0('0x38')](_0x2a5d68[_0x92e0('0x39')]);}return _0x595b25;}function getQueueCampaignStatusMessage(_0x3094cc,_0x4b430f){var _0x36792b=CAMPAIGN_STATUS[_0x92e0('0x6')];var _0x35ccb4=isPreviewCampaign(_0x3094cc);if(!isQueueCampaignActive(_0x3094cc)){if(_0x35ccb4){_0x36792b=CAMPAIGN_STATUS[_0x92e0('0x3b')];}else{if(_0x3094cc[_0x92e0('0x2c')]===0x0&&_0x3094cc['talking']===0x0&&_0x3094cc['waiting']===0x0&&(_0x3094cc[_0x92e0('0x29')]||0x0)===0x0){_0x36792b=CAMPAIGN_STATUS[_0x92e0('0x3b')];}else{_0x36792b=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x3094cc[_0x92e0('0x25')]===0x0){_0x36792b=CAMPAIGN_STATUS['NO_AGENTS_LOGGED'];}else if(!checkAnyValidTrunk(_0x3094cc,_0x4b430f)){_0x36792b=CAMPAIGN_STATUS[_0x92e0('0x3c')];}else if(!isPreviewCampaign(_0x3094cc)){var _0x52e684=checkAnyValidQueueCampaignInterval(_0x3094cc);if(_0x52e684){_0x36792b=_0x52e684;}}return _0x36792b;}exports[_0x92e0('0x3d')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x12b3ca){var _0x780788=CAMPAIGN_STATUS['DISACTIVED'];if(_0x12b3ca[_0x92e0('0x2c')]===0x0&&_0x12b3ca[_0x92e0('0x28')]===0x0&&_0x12b3ca[_0x92e0('0x2a')]===0x0&&(_0x12b3ca[_0x92e0('0x29')]||0x0)===0x0){_0x780788=CAMPAIGN_STATUS[_0x92e0('0x3b')];}return _0x780788;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x5877ab){var _0xcdeac4=_0x5877ab['match'](/"(.*?)"/);return _0xcdeac4?_0xcdeac4[0x1]:_0x5877ab;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0x430ca4,_0x5360a4,_0x300967){if(!_[_0x92e0('0x3e')](_0x300967)&&typeof _0x300967===_0x92e0('0x3f')&&!_[_0x92e0('0x40')](_0x300967)){if(!_[_0x92e0('0x3e')](_0x5360a4)&&typeof _0x5360a4==='string'&&!_[_0x92e0('0x40')](_0x5360a4)){return util[_0x92e0('0x41')](_0x92e0('0x42'),_0x5360a4,_0x300967);}return util[_0x92e0('0x41')](_0x92e0('0x42'),_0x300967,_0x300967);}if(!_[_0x92e0('0x3e')](_0x430ca4)&&typeof _0x430ca4==='string'&&!_[_0x92e0('0x40')](_0x430ca4)){return _0x430ca4;}return'\x22\x22\x20<>';}exports[_0x92e0('0x43')]=getCallerId;function getCallerIdRandom(_0x19d8d9,_0xc36ea0){var _0x37c0a5;var _0x18e82a;var _0x39e0b3;if(_0xc36ea0<=0x0){_0xc36ea0=0x1;}_0x37c0a5=new RegExp(_0x92e0('0x44')+_0xc36ea0+'}$');_0x18e82a=Math['pow'](0xa,_0xc36ea0-0x1);_0x39e0b3=Math[_0x92e0('0x45')](0xa,_0xc36ea0)-0x1;return util[_0x92e0('0x41')]('%s',_[_0x92e0('0x46')](_0x19d8d9,_0x37c0a5,_[_0x92e0('0x47')](_0x18e82a,_0x39e0b3)['toString']()));}exports[_0x92e0('0x48')]=getCallerIdRandom;function decrementOriginate(_0x269c0b){if(_0x269c0b[_0x92e0('0x2c')]&&_0x269c0b[_0x92e0('0x2c')]>0x0){_0x269c0b[_0x92e0('0x2c')]-=0x1;}else{logger[_0x92e0('0x49')](_0x92e0('0x4a'));}}exports[_0x92e0('0x4b')]=decrementOriginate;function checkContactEmpty(_0xaa1532){return _0xaa1532&&_0xaa1532[_0x92e0('0x4c')]>0x0;}exports[_0x92e0('0x4d')]=checkContactEmpty;function erlangb(_0x37bf7b,_0x3b4cb0){if(_0x3b4cb0===0x0){return 0x0;}var _0x1cc961=0x1;for(var _0x2941b3=0x1;_0x2941b3<=_0x3b4cb0;_0x2941b3+=0x1){_0x1cc961=0x1+_0x1cc961*_0x2941b3/_0x37bf7b;}return 0x1/_0x1cc961;}exports[_0x92e0('0x4e')]=erlangb;function checkContactLowerLimitOriginate(_0x5c3374,_0x460c89,_0x4cde51){if(_0x460c89>_0x4cde51){for(var _0x90b4b4=0x0;_0x90b4b4<_0x460c89-_0x4cde51;_0x90b4b4+=0x1){decrementOriginate(_0x5c3374);}}}exports[_0x92e0('0x4f')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x3bd43d){var _0x38d501={};var _0x349b93=['id',_0x92e0('0x50'),_0x92e0('0x51'),'updatedAt'];const _0x4e9fce=0xfa;if(_0x3bd43d){for(var _0x444122 in _0x3bd43d){if(typeof _0x3bd43d[_0x444122]!=='undefined'){if(!_['isNil'](_0x3bd43d[_0x444122])&&!_0x349b93[_0x92e0('0x38')](_0x444122)){if(_0x444122==='description'&&_0x3bd43d[_0x444122][_0x92e0('0x4c')]>_0x4e9fce){_0x38d501['XMD-'+_0x444122[_0x92e0('0x52')]()]=_0x3bd43d[_0x444122][_0x92e0('0x53')]()['substring'](0x0,_0x4e9fce);}else{_0x38d501['XMD-'+_0x444122[_0x92e0('0x52')]()]=_0x3bd43d[_0x444122];}}}}}return _0x38d501;}exports['setXMDContactVariables']=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 1a9face..c4f8e9d 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(_0x1aabd7,_0x30472c){var _0xc8617=function(_0x2f8c48){while(--_0x2f8c48){_0x1aabd7['push'](_0x1aabd7['shift']());}};_0xc8617(++_0x30472c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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(_0x25c0fd,_0x545050){var _0x4a03f9=function(_0x13e4b7){while(--_0x13e4b7){_0x25c0fd['push'](_0x25c0fd['shift']());}};_0x4a03f9(++_0x545050);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'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 1863cf5..0ebf5e0 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 _0xd977=['Trunk\x20Reachable','format','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','ext','isTrunkReachable','isNil','active','SIP/%s','trunks','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','deleteChannelAfterTimeout','exports','util','lodash','bluebird','uuid','moment','path','tiff2pdf','./util/gs','../../../config/logger','../ami','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','actions','syncNewchannel','bind','varset','newstate','syncNewState','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','info','syncVarSet','variable','value','channelstate','channelstatedesc','syncNewExten','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','application/pdf','then','notify','fax','catch','error','\x20notify\x20','stringify','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','Trunk','isValid'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xd977,0x10e));var _0x7d97=function(_0x391cea,_0x46bb62){_0x391cea=_0x391cea-0x0;var _0x169a6a=_0xd977[_0x391cea];return _0x169a6a;};'use strict';var util=require(_0x7d97('0x0'));var _=require(_0x7d97('0x1'));var BPromise=require(_0x7d97('0x2'));var uuid=require(_0x7d97('0x3'));var moment=require(_0x7d97('0x4'));var path=require(_0x7d97('0x5'));var tiff2pdf=require(_0x7d97('0x6'));var gs=require(_0x7d97('0x7'));var logger=require(_0x7d97('0x8'))('fax');var ami=require(_0x7d97('0x9'));var rpcDb=require('./rpcDb');var Channel=require(_0x7d97('0xa'));var ut=require(_0x7d97('0xb'));var Action=require(_0x7d97('0xc'));var faxAccount=require(_0x7d97('0xd'));var attachment=require(_0x7d97('0xe'));var faxMessage=require(_0x7d97('0xf'));function Fax(_0x5a4642){this[_0x7d97('0x10')]={};this[_0x7d97('0x11')]=_0x5a4642[_0x7d97('0x11')];this['trunks']=_0x5a4642['trunks'];this[_0x7d97('0x12')]={};ami['on']('newchannel',this[_0x7d97('0x13')][_0x7d97('0x14')](this));ami['on'](_0x7d97('0x15'),this['syncVarSet'][_0x7d97('0x14')](this));ami['on'](_0x7d97('0x16'),this[_0x7d97('0x17')]['bind'](this));ami['on']('newexten',this['syncNewExten'][_0x7d97('0x14')](this));ami['on'](_0x7d97('0x18'),this[_0x7d97('0x19')]['bind'](this));ami['on'](_0x7d97('0x1a'),this[_0x7d97('0x1b')][_0x7d97('0x14')](this));ami['on'](_0x7d97('0x1c'),this[_0x7d97('0x1d')][_0x7d97('0x14')](this));ami['on'](_0x7d97('0x1e'),this[_0x7d97('0x1f')][_0x7d97('0x14')](this));}Fax[_0x7d97('0x20')][_0x7d97('0x13')]=function(_0x203448){if(_0x203448[_0x7d97('0x21')]===_0x7d97('0x22')){for(var _0x41cd83 in this[_0x7d97('0x11')]){if(this[_0x7d97('0x11')][_0x7d97('0x23')](_0x41cd83)){if(_0x203448['exten']===this[_0x7d97('0x11')][_0x41cd83][_0x7d97('0x24')]){this['channels'][_0x203448[_0x7d97('0x25')]]={};this['channels'][_0x203448[_0x7d97('0x25')]][_0x7d97('0x26')]=_0x203448['channel'];this[_0x7d97('0x10')][_0x203448[_0x7d97('0x25')]]['id']=this['faxAccounts'][_0x41cd83]['id'];this[_0x7d97('0x10')][_0x203448[_0x7d97('0x25')]][_0x7d97('0x27')]=this[_0x7d97('0x11')][_0x41cd83]['name'];logger['info'](_0x203448[_0x7d97('0x25')],_0x7d97('0x28'));}}}}if(this[_0x7d97('0x12')][_0x203448[_0x7d97('0x25')]]){this[_0x7d97('0x10')][_0x203448['uniqueid']]={};this['channels'][_0x203448['uniqueid']][_0x7d97('0x26')]=_0x203448[_0x7d97('0x26')];logger[_0x7d97('0x29')](_0x203448['uniqueid'],'\x20syncNewchannel\x20');}};Fax[_0x7d97('0x20')][_0x7d97('0x2a')]=function(_0x4c926c){if(this['channels'][_0x4c926c[_0x7d97('0x25')]]){for(var _0x4ed9de in _0x4c926c[_0x7d97('0x2b')]){if(_0x4c926c[_0x7d97('0x2b')][_0x7d97('0x23')](_0x4ed9de)){this[_0x7d97('0x10')][_0x4c926c[_0x7d97('0x25')]][_0x4ed9de]=_0x4c926c[_0x7d97('0x2c')];}}}};Fax[_0x7d97('0x20')][_0x7d97('0x17')]=function(_0x180dc2){if(this[_0x7d97('0x10')][_0x180dc2[_0x7d97('0x25')]]){this[_0x7d97('0x10')][_0x180dc2['uniqueid']][_0x7d97('0x2d')]=_0x180dc2['channelstate'];this[_0x7d97('0x10')][_0x180dc2[_0x7d97('0x25')]]['channelstatedesc']=_0x180dc2[_0x7d97('0x2e')];}};Fax[_0x7d97('0x20')][_0x7d97('0x2f')]=function(_0x4d8e1f){if(this[_0x7d97('0x10')][_0x4d8e1f['uniqueid']]){for(var _0x207ee1 in _0x4d8e1f['variable']){if(_0x4d8e1f[_0x7d97('0x2b')]['hasOwnProperty'](_0x207ee1)){this['channels'][_0x4d8e1f[_0x7d97('0x25')]][_0x207ee1]=_0x4d8e1f['value'];}}}};Fax['prototype'][_0x7d97('0x19')]=function(_0x617020){if(this[_0x7d97('0x10')][_0x617020[_0x7d97('0x25')]]){this[_0x7d97('0x10')][_0x617020[_0x7d97('0x25')]][_0x7d97('0x30')]=_0x617020['operation'];this[_0x7d97('0x10')][_0x617020['uniqueid']][_0x7d97('0x31')]=_0x617020[_0x7d97('0x31')];this[_0x7d97('0x10')][_0x617020[_0x7d97('0x25')]][_0x7d97('0x24')]=_0x617020[_0x7d97('0x24')];this[_0x7d97('0x10')][_0x617020[_0x7d97('0x25')]]['filename']=_0x617020[_0x7d97('0x32')];logger[_0x7d97('0x29')](_0x617020['uniqueid'],_0x7d97('0x33'));}};Fax[_0x7d97('0x20')]['syncReceiveFax']=function(_0x4e4544){var _0x552b67=this;if(this[_0x7d97('0x10')][_0x4e4544[_0x7d97('0x25')]]){var _0x56cd6d=this[_0x7d97('0x10')][_0x4e4544[_0x7d97('0x25')]]['id'];this['channels'][_0x4e4544[_0x7d97('0x25')]][_0x7d97('0x34')]=_0x4e4544[_0x7d97('0x34')];this['channels'][_0x4e4544['uniqueid']][_0x7d97('0x35')]=_0x4e4544[_0x7d97('0x35')];this[_0x7d97('0x10')][_0x4e4544[_0x7d97('0x25')]]['localstationid']=_0x4e4544[_0x7d97('0x24')];this[_0x7d97('0x10')][_0x4e4544[_0x7d97('0x25')]][_0x7d97('0x36')]=_0x4e4544[_0x7d97('0x36')];this[_0x7d97('0x10')][_0x4e4544['uniqueid']]['transferrate']=_0x4e4544[_0x7d97('0x37')];this['channels'][_0x4e4544[_0x7d97('0x25')]][_0x7d97('0x32')]=_0x4e4544['filename'];this['channels'][_0x4e4544['uniqueid']][_0x7d97('0x38')]=_0x4e4544[_0x7d97('0x38')];if(this[_0x7d97('0x10')][_0x4e4544[_0x7d97('0x25')]][_0x7d97('0x35')]>0x0){tiff2pdf(_0x4e4544[_0x7d97('0x32')],_0x7d97('0x39'),function(_0x2b11d7){logger[_0x7d97('0x29')](_0x4e4544[_0x7d97('0x25')],'\x20result\x20conversion\x20file\x20',_0x2b11d7[_0x7d97('0x3a')]);attachment[_0x7d97('0x3b')]({'name':path[_0x7d97('0x3c')](_0x4e4544[_0x7d97('0x32')])[_0x7d97('0x27')],'basename':path[_0x7d97('0x3c')](_0x4e4544[_0x7d97('0x32')])[_0x7d97('0x27')]+_0x7d97('0x3d'),'type':_0x7d97('0x3e')})[_0x7d97('0x3f')](function(_0x12e6e5){faxAccount[_0x7d97('0x40')](_0x56cd6d,{'from':_0x4e4544['calleridnum'],'mapKey':_0x7d97('0x41'),'body':path['parse'](_0x4e4544[_0x7d97('0x32')])[_0x7d97('0x27')]+_0x7d97('0x3d'),'AttachmentId':_0x12e6e5['id']})[_0x7d97('0x42')](function(_0x18bbc2){logger[_0x7d97('0x43')](_0x4e4544[_0x7d97('0x25')],_0x7d97('0x44'),JSON[_0x7d97('0x45')](_0x18bbc2));});})[_0x7d97('0x42')](function(_0x1883ab){logger[_0x7d97('0x43')](_0x4e4544[_0x7d97('0x25')],'\x20receiveFax\x20',JSON['stringify'](_0x1883ab));});});}logger[_0x7d97('0x29')](_0x4e4544[_0x7d97('0x25')],'\x20receiveFax\x20');}};Fax['prototype'][_0x7d97('0x1f')]=function(_0x39e5fc){if(this[_0x7d97('0x12')][_0x39e5fc[_0x7d97('0x25')]]){_[_0x7d97('0x46')](this['channels'][_0x39e5fc['uniqueid']],_[_0x7d97('0x47')](_0x39e5fc,[_0x7d97('0x48'),_0x7d97('0x49')]));}};function updateStatus(_0x25bcbd){if(_0x25bcbd[_0x7d97('0x4a')]){faxMessage[_0x7d97('0x4b')](_0x25bcbd['AttachmentId'],{'failMessage':_0x7d97('0x4c')})[_0x7d97('0x3f')](function(_0x34244f){ut[_0x7d97('0x4d')]('[Fax][Message][Error][Updated]',_0x34244f);})[_0x7d97('0x42')](function(_0x4413c4){ut[_0x7d97('0x4d')](_0x7d97('0x4e'),_0x4413c4);});}else{ut['logger']('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x7d97('0x20')][_0x7d97('0x4f')]=function(_0x154f24,_0x2e09db,_0x4aeb5f){var _0x13b26c=this;var _0x3b4055={};if(_0x2e09db){_0x3b4055={'read':_0x2e09db};}else{_0x3b4055={'failMessage':_0x4aeb5f};}if(this[_0x7d97('0x12')][_0x154f24]['AttachmentId']){faxMessage[_0x7d97('0x4b')](this[_0x7d97('0x12')][_0x154f24][_0x7d97('0x4a')],_0x3b4055)['then'](function(_0x1e641a){ut['logger'](_0x7d97('0x50'),_0x1e641a);})[_0x7d97('0x42')](function(_0x114ff8){ut['logger'](_0x7d97('0x51'),_0x114ff8);})[_0x7d97('0x52')](function(){delete _0x13b26c[_0x7d97('0x10')][_0x154f24];delete _0x13b26c[_0x7d97('0x12')][_0x154f24];});}else{ut[_0x7d97('0x4d')](_0x7d97('0x53'));this['deleteChannelAfterTimeout'](_0x154f24);delete this[_0x7d97('0x12')][_0x154f24];}};Fax[_0x7d97('0x20')]['syncHangup']=function(_0x3b417a){var _0x1f529c=this;if(this['channels'][_0x3b417a[_0x7d97('0x25')]]){if(this[_0x7d97('0x12')][_0x3b417a[_0x7d97('0x25')]]){this[_0x7d97('0x10')][_0x3b417a['uniqueid']]['id']=this[_0x7d97('0x12')][_0x3b417a[_0x7d97('0x25')]]['id'];this[_0x7d97('0x10')][_0x3b417a[_0x7d97('0x25')]]['name']=this[_0x7d97('0x12')][_0x3b417a[_0x7d97('0x25')]][_0x7d97('0x27')];}logger[_0x7d97('0x29')](_0x3b417a[_0x7d97('0x25')],this[_0x7d97('0x12')][_0x3b417a[_0x7d97('0x25')]]?'\x20hangup\x20sendFile\x20':_0x7d97('0x54'),JSON['stringify'](this[_0x7d97('0x10')][_0x3b417a[_0x7d97('0x25')]]));if(this[_0x7d97('0x12')][_0x3b417a[_0x7d97('0x25')]]){if(this[_0x7d97('0x10')][_0x3b417a[_0x7d97('0x25')]][_0x7d97('0x55')]>0x0&&this['channels'][_0x3b417a[_0x7d97('0x25')]][_0x7d97('0x18')]===_0x7d97('0x56')){this[_0x7d97('0x4f')](_0x3b417a[_0x7d97('0x25')],!![]);}else{this[_0x7d97('0x4f')](_0x3b417a['uniqueid'],![],this[_0x7d97('0x10')][_0x3b417a[_0x7d97('0x25')]][_0x7d97('0x57')]?_0x7d97('0x58')+this[_0x7d97('0x10')][_0x3b417a[_0x7d97('0x25')]][_0x7d97('0x57')]:_0x7d97('0x59'));}}}};Fax[_0x7d97('0x20')][_0x7d97('0x5a')]=function(_0x28ae1b){var _0x1ac58d=this;return new BPromise(function(_0x105997,_0x3854f5){_0x1ac58d[_0x7d97('0x5b')](_0x28ae1b,_0x1ac58d['faxAccounts'][_0x28ae1b[_0x7d97('0x5c')]])['then'](function(_0x5967c6){ut[_0x7d97('0x4d')]('[Fax][execOriginate][success]',_0x5967c6);_0x105997(ut['message'](_0x7d97('0x5d')));})[_0x7d97('0x42')](function(_0x18d69e){ut['logger'](_0x7d97('0x5e'),_0x18d69e);updateStatus(_0x28ae1b);_0x3854f5(ut['message'](_0x7d97('0x5f')));});});};Fax[_0x7d97('0x20')]['checkAfterSend']=function(_0x28da57){var _0x3625e7=this;return new BPromise(function(_0x114559,_0x51259f){var _0x17c988=_0x3625e7[_0x7d97('0x60')](_0x3625e7[_0x7d97('0x11')][_0x28da57['FaxAccountId']][_0x7d97('0x61')],_0x28da57);if(_0x17c988[_0x7d97('0x62')]){_0x114559(ut[_0x7d97('0x3a')](_0x7d97('0x63')));}else{_0x51259f(ut[_0x7d97('0x3a')](_0x17c988[_0x7d97('0x3a')]));}});};function originate(_0x2c29f0,_0xfc3972,_0x177bd7){return new BPromise(function(_0x4ad69e,_0x3e7512){if(_0x177bd7){var _0x2397d8=util[_0x7d97('0x64')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path['parse'](_0x2c29f0['path'])[_0x7d97('0x27')],_0x2c29f0[_0x7d97('0x5')]);gs[_0x7d97('0x65')](_0x2397d8)[_0x7d97('0x3f')](function(){_0x2c29f0[_0x7d97('0x5')]=util[_0x7d97('0x64')](_0x7d97('0x66'),path[_0x7d97('0x3c')](_0x2c29f0[_0x7d97('0x5')])[_0x7d97('0x67')],path[_0x7d97('0x3c')](_0x2c29f0['path'])['name']);_0xfc3972[_0x7d97('0x68')]=_0x2c29f0[_0x7d97('0x5')];ut[_0x7d97('0x4d')](_0x7d97('0x69'),'');ami['Action'](ut[_0x7d97('0x6a')](_0x2c29f0,_0xfc3972))['then'](function(_0x272970){_0x4ad69e(_0x272970);})[_0x7d97('0x42')](function(_0x2d9c79){_0x3e7512(_0x2d9c79);});})[_0x7d97('0x42')](function(_0x5ea632){_0x3e7512(_0x5ea632);});}else{ami['Action'](ut[_0x7d97('0x6a')](_0x2c29f0,_0xfc3972))[_0x7d97('0x3f')](function(_0x21fce9){_0x4ad69e(_0x21fce9);})[_0x7d97('0x42')](function(_0x46ef90){_0x3e7512(_0x46ef90);});}});}Fax[_0x7d97('0x20')][_0x7d97('0x5b')]=function(_0x44aef2,_0x2a92b0){var _0x1682c4=this;return new BPromise(function(_0x2f4c6a,_0x19cedc){var _0xb9d808=uuid['v4']();var _0x1f3f51=ut['addVariables'](_0x44aef2,_0x2a92b0);_0x1682c4[_0x7d97('0x12')][_0xb9d808]=new Action(_0xb9d808,_0x2a92b0,_0x44aef2);var _0x2829fc=_0x1682c4[_0x7d97('0x12')][_0xb9d808];if(path[_0x7d97('0x3c')](_0x44aef2[_0x7d97('0x5')])[_0x7d97('0x6b')]==='.pdf'){originate(_0x2829fc,_0x1f3f51,!![])[_0x7d97('0x3f')](function(_0x1a8018){_0x2f4c6a(_0x1a8018);})[_0x7d97('0x42')](function(_0xd39925){_0x19cedc(_0xd39925);});}else{originate(_0x2829fc,_0x1f3f51,![])['then'](function(_0x334b18){_0x2f4c6a(_0x334b18);})['catch'](function(_0x1d8a69){_0x19cedc(_0x1d8a69);});}});};Fax[_0x7d97('0x20')][_0x7d97('0x6c')]=function(_0x171f0f){return!_[_0x7d97('0x6d')](_0x171f0f)&&!_['isNil'](_0x171f0f[_0x7d97('0x27')])&&!_['isNil'](_0x171f0f[_0x7d97('0x6e')])&&_0x171f0f['active']&&!_[_0x7d97('0x6d')](this['trunks'][util[_0x7d97('0x64')](_0x7d97('0x6f'),_0x171f0f[_0x7d97('0x27')])])&&!_['isNil'](this[_0x7d97('0x70')][util[_0x7d97('0x64')](_0x7d97('0x6f'),_0x171f0f[_0x7d97('0x27')])][_0x7d97('0x31')])&&(this[_0x7d97('0x70')][util['format'](_0x7d97('0x6f'),_0x171f0f[_0x7d97('0x27')])][_0x7d97('0x31')]===_0x7d97('0x71')||this['trunks'][util['format']('SIP/%s',_0x171f0f[_0x7d97('0x27')])][_0x7d97('0x31')]===_0x7d97('0x72'));};Fax[_0x7d97('0x20')]['checkTrunk']=function(_0x50581c,_0x4a0caf){if(!this[_0x7d97('0x6c')](_0x50581c)){ut[_0x7d97('0x4d')](_0x7d97('0x73'),_['isNil'](_0x50581c)?'':_0x50581c[_0x7d97('0x27')]+_0x7d97('0x74'));return{'isValid':![],'message':_0x7d97('0x75')};}if(_[_0x7d97('0x6d')](_0x4a0caf[_0x7d97('0x41')])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x7d97('0x45')](_0x4a0caf));return{'isValid':![],'message':_0x7d97('0x76')};}if(_['isNil'](_0x4a0caf[_0x7d97('0x5')])){ut[_0x7d97('0x4d')](_0x7d97('0x77'),JSON[_0x7d97('0x45')](_0x4a0caf));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x7d97('0x78')};};Fax['prototype'][_0x7d97('0x79')]=function(_0x1e8fb7,_0x27dd86=0x2710){if(this[_0x7d97('0x10')][_0x1e8fb7]){setTimeout(()=>{delete this[_0x7d97('0x10')][_0x1e8fb7];},_0x27dd86);}};module[_0x7d97('0x7a')]=Fax; \ No newline at end of file +var _0x65b9=['faxstatus','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','Trunk','Trunk\x20Reachable','format','%s/%s.tif','dir','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','bluebird','uuid','moment','path','tiff2pdf','fax','./rpcDb','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','newstate','syncNewState','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','originateresponse','syncOriginateResponse','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','syncVarSet','variable','value','prototype','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','/var/opt/motion2/server/files/attachments/','message','create','parse','.pdf','application/pdf','then','calleridnum','catch','error','stringify','\x20receiveFax\x20','merge','pick','response','reason','update','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','AttachmentId','finally','[Fax][Message][NoUpdate2]','deleteChannelAfterTimeout','syncHangup','\x20hangup\x20faxRiceive\x20','faxpages'];(function(_0x705b98,_0x1c345b){var _0x47b72f=function(_0x44f02a){while(--_0x44f02a){_0x705b98['push'](_0x705b98['shift']());}};_0x47b72f(++_0x1c345b);}(_0x65b9,0x179));var _0x965b=function(_0x1ed8d7,_0x17c89c){_0x1ed8d7=_0x1ed8d7-0x0;var _0x1c9f4e=_0x65b9[_0x1ed8d7];return _0x1c9f4e;};'use strict';var util=require(_0x965b('0x0'));var _=require('lodash');var BPromise=require(_0x965b('0x1'));var uuid=require(_0x965b('0x2'));var moment=require(_0x965b('0x3'));var path=require(_0x965b('0x4'));var tiff2pdf=require(_0x965b('0x5'));var gs=require('./util/gs');var logger=require('../../../config/logger')(_0x965b('0x6'));var ami=require('../ami');var rpcDb=require(_0x965b('0x7'));var Channel=require('./channel');var ut=require(_0x965b('0x8'));var Action=require(_0x965b('0x9'));var faxAccount=require(_0x965b('0xa'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x965b('0xb'));function Fax(_0x423d89){this[_0x965b('0xc')]={};this[_0x965b('0xd')]=_0x423d89['faxAccounts'];this[_0x965b('0xe')]=_0x423d89[_0x965b('0xe')];this[_0x965b('0xf')]={};ami['on'](_0x965b('0x10'),this[_0x965b('0x11')][_0x965b('0x12')](this));ami['on']('varset',this['syncVarSet'][_0x965b('0x12')](this));ami['on'](_0x965b('0x13'),this[_0x965b('0x14')][_0x965b('0x12')](this));ami['on']('newexten',this[_0x965b('0x15')][_0x965b('0x12')](this));ami['on']('faxstatus',this[_0x965b('0x16')][_0x965b('0x12')](this));ami['on'](_0x965b('0x17'),this[_0x965b('0x18')][_0x965b('0x12')](this));ami['on']('hangup',this['syncHangup'][_0x965b('0x12')](this));ami['on'](_0x965b('0x19'),this[_0x965b('0x1a')]['bind'](this));}Fax['prototype'][_0x965b('0x11')]=function(_0x40827f){if(_0x40827f[_0x965b('0x1b')]===_0x965b('0x1c')){for(var _0xa53cfb in this[_0x965b('0xd')]){if(this[_0x965b('0xd')][_0x965b('0x1d')](_0xa53cfb)){if(_0x40827f[_0x965b('0x1e')]===this[_0x965b('0xd')][_0xa53cfb][_0x965b('0x1f')]){this['channels'][_0x40827f[_0x965b('0x20')]]={};this[_0x965b('0xc')][_0x40827f['uniqueid']][_0x965b('0x21')]=_0x40827f[_0x965b('0x21')];this[_0x965b('0xc')][_0x40827f[_0x965b('0x20')]]['id']=this[_0x965b('0xd')][_0xa53cfb]['id'];this[_0x965b('0xc')][_0x40827f[_0x965b('0x20')]][_0x965b('0x22')]=this['faxAccounts'][_0xa53cfb][_0x965b('0x22')];logger[_0x965b('0x23')](_0x40827f['uniqueid'],_0x965b('0x24'));}}}}if(this[_0x965b('0xf')][_0x40827f[_0x965b('0x20')]]){this[_0x965b('0xc')][_0x40827f[_0x965b('0x20')]]={};this[_0x965b('0xc')][_0x40827f[_0x965b('0x20')]][_0x965b('0x21')]=_0x40827f[_0x965b('0x21')];logger[_0x965b('0x23')](_0x40827f['uniqueid'],_0x965b('0x24'));}};Fax['prototype'][_0x965b('0x25')]=function(_0x57b7bb){if(this[_0x965b('0xc')][_0x57b7bb[_0x965b('0x20')]]){for(var _0x31576a in _0x57b7bb[_0x965b('0x26')]){if(_0x57b7bb['variable'][_0x965b('0x1d')](_0x31576a)){this[_0x965b('0xc')][_0x57b7bb['uniqueid']][_0x31576a]=_0x57b7bb[_0x965b('0x27')];}}}};Fax[_0x965b('0x28')][_0x965b('0x14')]=function(_0x1d6014){if(this[_0x965b('0xc')][_0x1d6014['uniqueid']]){this[_0x965b('0xc')][_0x1d6014[_0x965b('0x20')]][_0x965b('0x29')]=_0x1d6014[_0x965b('0x29')];this['channels'][_0x1d6014[_0x965b('0x20')]]['channelstatedesc']=_0x1d6014[_0x965b('0x2a')];}};Fax[_0x965b('0x28')][_0x965b('0x15')]=function(_0x79b661){if(this[_0x965b('0xc')][_0x79b661[_0x965b('0x20')]]){for(var _0x2d2e2d in _0x79b661[_0x965b('0x26')]){if(_0x79b661[_0x965b('0x26')][_0x965b('0x1d')](_0x2d2e2d)){this[_0x965b('0xc')][_0x79b661[_0x965b('0x20')]][_0x2d2e2d]=_0x79b661[_0x965b('0x27')];}}}};Fax[_0x965b('0x28')][_0x965b('0x16')]=function(_0x9aa4e6){if(this[_0x965b('0xc')][_0x9aa4e6['uniqueid']]){this[_0x965b('0xc')][_0x9aa4e6[_0x965b('0x20')]]['operation']=_0x9aa4e6[_0x965b('0x2b')];this[_0x965b('0xc')][_0x9aa4e6[_0x965b('0x20')]][_0x965b('0x2c')]=_0x9aa4e6[_0x965b('0x2c')];this['channels'][_0x9aa4e6[_0x965b('0x20')]][_0x965b('0x1f')]=_0x9aa4e6[_0x965b('0x1f')];this[_0x965b('0xc')][_0x9aa4e6['uniqueid']]['filename']=_0x9aa4e6[_0x965b('0x2d')];logger[_0x965b('0x23')](_0x9aa4e6[_0x965b('0x20')],_0x965b('0x2e'));}};Fax[_0x965b('0x28')]['syncReceiveFax']=function(_0xb56657){var _0x38c842=this;if(this[_0x965b('0xc')][_0xb56657['uniqueid']]){var _0x1f68cd=this[_0x965b('0xc')][_0xb56657[_0x965b('0x20')]]['id'];this[_0x965b('0xc')][_0xb56657[_0x965b('0x20')]][_0x965b('0x2f')]=_0xb56657[_0x965b('0x2f')];this[_0x965b('0xc')][_0xb56657[_0x965b('0x20')]][_0x965b('0x30')]=_0xb56657[_0x965b('0x30')];this[_0x965b('0xc')][_0xb56657[_0x965b('0x20')]]['localstationid']=_0xb56657[_0x965b('0x1f')];this[_0x965b('0xc')][_0xb56657[_0x965b('0x20')]][_0x965b('0x31')]=_0xb56657[_0x965b('0x31')];this[_0x965b('0xc')][_0xb56657[_0x965b('0x20')]][_0x965b('0x32')]=_0xb56657[_0x965b('0x32')];this[_0x965b('0xc')][_0xb56657['uniqueid']][_0x965b('0x2d')]=_0xb56657[_0x965b('0x2d')];this[_0x965b('0xc')][_0xb56657[_0x965b('0x20')]]['calleridnum']=_0xb56657['calleridnum'];if(this[_0x965b('0xc')][_0xb56657['uniqueid']]['pagestransferred']>0x0){tiff2pdf(_0xb56657[_0x965b('0x2d')],_0x965b('0x33'),function(_0x20d9c6){logger[_0x965b('0x23')](_0xb56657[_0x965b('0x20')],'\x20result\x20conversion\x20file\x20',_0x20d9c6[_0x965b('0x34')]);attachment[_0x965b('0x35')]({'name':path['parse'](_0xb56657['filename'])[_0x965b('0x22')],'basename':path[_0x965b('0x36')](_0xb56657[_0x965b('0x2d')])[_0x965b('0x22')]+_0x965b('0x37'),'type':_0x965b('0x38')})[_0x965b('0x39')](function(_0x523e14){faxAccount['notify'](_0x1f68cd,{'from':_0xb56657[_0x965b('0x3a')],'mapKey':_0x965b('0x6'),'body':path[_0x965b('0x36')](_0xb56657[_0x965b('0x2d')])[_0x965b('0x22')]+_0x965b('0x37'),'AttachmentId':_0x523e14['id']})[_0x965b('0x3b')](function(_0x27683b){logger[_0x965b('0x3c')](_0xb56657[_0x965b('0x20')],'\x20notify\x20',JSON[_0x965b('0x3d')](_0x27683b));});})[_0x965b('0x3b')](function(_0x100525){logger[_0x965b('0x3c')](_0xb56657[_0x965b('0x20')],_0x965b('0x3e'),JSON[_0x965b('0x3d')](_0x100525));});});}logger[_0x965b('0x23')](_0xb56657[_0x965b('0x20')],_0x965b('0x3e'));}};Fax[_0x965b('0x28')][_0x965b('0x1a')]=function(_0x453118){if(this[_0x965b('0xf')][_0x453118[_0x965b('0x20')]]){_[_0x965b('0x3f')](this[_0x965b('0xc')][_0x453118['uniqueid']],_[_0x965b('0x40')](_0x453118,[_0x965b('0x41'),_0x965b('0x42')]));}};function updateStatus(_0x7d7a3b){if(_0x7d7a3b['AttachmentId']){faxMessage[_0x965b('0x43')](_0x7d7a3b['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})[_0x965b('0x39')](function(_0x269099){ut[_0x965b('0x44')]('[Fax][Message][Error][Updated]',_0x269099);})['catch'](function(_0xbbca50){ut['logger'](_0x965b('0x45'),_0xbbca50);});}else{ut['logger'](_0x965b('0x46'));}}Fax[_0x965b('0x28')][_0x965b('0x47')]=function(_0x208eb3,_0x5ec97c,_0x10907d){var _0x544c33=this;var _0x255605={};if(_0x5ec97c){_0x255605={'read':_0x5ec97c};}else{_0x255605={'failMessage':_0x10907d};}if(this[_0x965b('0xf')][_0x208eb3][_0x965b('0x48')]){faxMessage['update'](this[_0x965b('0xf')][_0x208eb3][_0x965b('0x48')],_0x255605)[_0x965b('0x39')](function(_0x50a681){ut[_0x965b('0x44')]('[Fax][Message][Updated]',_0x50a681);})['catch'](function(_0x397d57){ut[_0x965b('0x44')]('[Fax][Message][NoUpdate1]',_0x397d57);})[_0x965b('0x49')](function(){delete _0x544c33[_0x965b('0xc')][_0x208eb3];delete _0x544c33['actions'][_0x208eb3];});}else{ut['logger'](_0x965b('0x4a'));this[_0x965b('0x4b')](_0x208eb3);delete this[_0x965b('0xf')][_0x208eb3];}};Fax[_0x965b('0x28')][_0x965b('0x4c')]=function(_0x4f45c3){var _0x2ecd23=this;if(this['channels'][_0x4f45c3['uniqueid']]){if(this[_0x965b('0xf')][_0x4f45c3[_0x965b('0x20')]]){this[_0x965b('0xc')][_0x4f45c3[_0x965b('0x20')]]['id']=this[_0x965b('0xf')][_0x4f45c3[_0x965b('0x20')]]['id'];this['channels'][_0x4f45c3[_0x965b('0x20')]]['name']=this[_0x965b('0xf')][_0x4f45c3[_0x965b('0x20')]]['name'];}logger['info'](_0x4f45c3[_0x965b('0x20')],this[_0x965b('0xf')][_0x4f45c3[_0x965b('0x20')]]?'\x20hangup\x20sendFile\x20':_0x965b('0x4d'),JSON[_0x965b('0x3d')](this[_0x965b('0xc')][_0x4f45c3[_0x965b('0x20')]]));if(this[_0x965b('0xf')][_0x4f45c3[_0x965b('0x20')]]){if(this[_0x965b('0xc')][_0x4f45c3[_0x965b('0x20')]][_0x965b('0x4e')]>0x0&&this['channels'][_0x4f45c3[_0x965b('0x20')]][_0x965b('0x4f')]===_0x965b('0x50')){this['updateStatus'](_0x4f45c3[_0x965b('0x20')],!![]);}else{this[_0x965b('0x47')](_0x4f45c3[_0x965b('0x20')],![],this[_0x965b('0xc')][_0x4f45c3[_0x965b('0x20')]][_0x965b('0x51')]?_0x965b('0x52')+this['channels'][_0x4f45c3[_0x965b('0x20')]][_0x965b('0x51')]:_0x965b('0x53'));}}}};Fax['prototype'][_0x965b('0x54')]=function(_0x77a0b6){var _0x2ff831=this;return new BPromise(function(_0xe8ef05,_0x3183ee){_0x2ff831[_0x965b('0x55')](_0x77a0b6,_0x2ff831[_0x965b('0xd')][_0x77a0b6[_0x965b('0x56')]])[_0x965b('0x39')](function(_0x3f0167){ut[_0x965b('0x44')](_0x965b('0x57'),_0x3f0167);_0xe8ef05(ut[_0x965b('0x34')](_0x965b('0x58')));})[_0x965b('0x3b')](function(_0x23bac1){ut[_0x965b('0x44')](_0x965b('0x59'),_0x23bac1);updateStatus(_0x77a0b6);_0x3183ee(ut['message'](_0x965b('0x5a')));});});};Fax[_0x965b('0x28')]['checkAfterSend']=function(_0x50c42d){var _0x7a16da=this;return new BPromise(function(_0x5e50c9,_0x373e66){var _0x1840f6=_0x7a16da[_0x965b('0x5b')](_0x7a16da['faxAccounts'][_0x50c42d[_0x965b('0x56')]][_0x965b('0x5c')],_0x50c42d);if(_0x1840f6['isValid']){_0x5e50c9(ut[_0x965b('0x34')](_0x965b('0x5d')));}else{_0x373e66(ut[_0x965b('0x34')](_0x1840f6[_0x965b('0x34')]));}});};function originate(_0x3effa6,_0x35f1ae,_0x2bebea){return new BPromise(function(_0x22fc57,_0x310f49){if(_0x2bebea){var _0x3d5363=util[_0x965b('0x5e')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0x965b('0x36')](_0x3effa6[_0x965b('0x4')])[_0x965b('0x22')],_0x3effa6[_0x965b('0x4')]);gs['execute'](_0x3d5363)[_0x965b('0x39')](function(){_0x3effa6[_0x965b('0x4')]=util[_0x965b('0x5e')](_0x965b('0x5f'),path[_0x965b('0x36')](_0x3effa6[_0x965b('0x4')])[_0x965b('0x60')],path[_0x965b('0x36')](_0x3effa6[_0x965b('0x4')])[_0x965b('0x22')]);_0x35f1ae['XMF-PATH']=_0x3effa6[_0x965b('0x4')];ut['logger'](_0x965b('0x61'),'');ami[_0x965b('0x62')](ut[_0x965b('0x63')](_0x3effa6,_0x35f1ae))[_0x965b('0x39')](function(_0x2ab259){_0x22fc57(_0x2ab259);})[_0x965b('0x3b')](function(_0x107c9d){_0x310f49(_0x107c9d);});})['catch'](function(_0x3ea58f){_0x310f49(_0x3ea58f);});}else{ami['Action'](ut['variablesAction'](_0x3effa6,_0x35f1ae))[_0x965b('0x39')](function(_0x27455b){_0x22fc57(_0x27455b);})[_0x965b('0x3b')](function(_0x4545f2){_0x310f49(_0x4545f2);});}});}Fax[_0x965b('0x28')][_0x965b('0x55')]=function(_0x1c8f9a,_0x4e32dd){var _0x11d07b=this;return new BPromise(function(_0x5f307f,_0x436d5d){var _0x373c6b=uuid['v4']();var _0x1e4373=ut['addVariables'](_0x1c8f9a,_0x4e32dd);_0x11d07b[_0x965b('0xf')][_0x373c6b]=new Action(_0x373c6b,_0x4e32dd,_0x1c8f9a);var _0x1ea75c=_0x11d07b[_0x965b('0xf')][_0x373c6b];if(path['parse'](_0x1c8f9a[_0x965b('0x4')])[_0x965b('0x64')]===_0x965b('0x37')){originate(_0x1ea75c,_0x1e4373,!![])[_0x965b('0x39')](function(_0x3fcb92){_0x5f307f(_0x3fcb92);})['catch'](function(_0x56e917){_0x436d5d(_0x56e917);});}else{originate(_0x1ea75c,_0x1e4373,![])[_0x965b('0x39')](function(_0x3c8e71){_0x5f307f(_0x3c8e71);})[_0x965b('0x3b')](function(_0x5ba94d){_0x436d5d(_0x5ba94d);});}});};Fax[_0x965b('0x28')][_0x965b('0x65')]=function(_0x2e9925){return!_['isNil'](_0x2e9925)&&!_[_0x965b('0x66')](_0x2e9925['name'])&&!_['isNil'](_0x2e9925[_0x965b('0x67')])&&_0x2e9925[_0x965b('0x67')]&&!_[_0x965b('0x66')](this[_0x965b('0xe')][util[_0x965b('0x5e')](_0x965b('0x68'),_0x2e9925['name'])])&&!_[_0x965b('0x66')](this[_0x965b('0xe')][util[_0x965b('0x5e')]('SIP/%s',_0x2e9925[_0x965b('0x22')])]['status'])&&(this['trunks'][util[_0x965b('0x5e')](_0x965b('0x68'),_0x2e9925[_0x965b('0x22')])]['status']===_0x965b('0x69')||this[_0x965b('0xe')][util[_0x965b('0x5e')]('SIP/%s',_0x2e9925[_0x965b('0x22')])]['status']==='unmonitored');};Fax[_0x965b('0x28')][_0x965b('0x5b')]=function(_0x303dfc,_0x339146){if(!this['isTrunkReachable'](_0x303dfc)){ut[_0x965b('0x44')](_0x965b('0x6a'),_[_0x965b('0x66')](_0x303dfc)?'':_0x303dfc[_0x965b('0x22')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x965b('0x6b')};}if(_[_0x965b('0x66')](_0x339146[_0x965b('0x6')])){ut[_0x965b('0x44')](_0x965b('0x6c'),JSON['stringify'](_0x339146));return{'isValid':![],'message':_0x965b('0x6d')};}if(_['isNil'](_0x339146[_0x965b('0x4')])){ut[_0x965b('0x44')](_0x965b('0x6e'),JSON[_0x965b('0x3d')](_0x339146));return{'isValid':![],'message':_0x965b('0x6f')};}return{'isValid':!![],'message':_0x965b('0x70')};};Fax[_0x965b('0x28')]['deleteChannelAfterTimeout']=function(_0x257b7e,_0xcfeb83=0x2710){if(this[_0x965b('0xc')][_0x257b7e]){setTimeout(()=>{delete this[_0x965b('0xc')][_0x257b7e];},_0xcfeb83);}};module[_0x965b('0x71')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 26293cb..d8534d8 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 _0x5be9=['catch','[Notify]\x20','util','bluebird','../../../config/logger','preview','../rpc/faxAccount','inspect','resolve','then','notify'];(function(_0xfc34d7,_0x436fdf){var _0x15c5f7=function(_0x135410){while(--_0x135410){_0xfc34d7['push'](_0xfc34d7['shift']());}};_0x15c5f7(++_0x436fdf);}(_0x5be9,0x1a4));var _0x95be=function(_0x2c62ca,_0x3ff9f3){_0x2c62ca=_0x2c62ca-0x0;var _0x17294b=_0x5be9[_0x2c62ca];return _0x17294b;};'use strict';var util=require(_0x95be('0x0'));var BPromise=require(_0x95be('0x1'));var logger=require(_0x95be('0x2'))(_0x95be('0x3'));var _=require('lodash');var faxAccount=require(_0x95be('0x4'));function loggerCatch(_0x316155){return function(_0x3fef9e){logger['error'](_0x316155,util[_0x95be('0x5')](_0x3fef9e,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x4675bc,_0x5887bf){return BPromise[_0x95be('0x6')]()[_0x95be('0x7')](faxAccount[_0x95be('0x8')](_0x4675bc,_0x5887bf))[_0x95be('0x9')](loggerCatch(_0x95be('0xa')));}; \ No newline at end of file +var _0x4121=['util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','resolve','then','catch','[Notify]\x20'];(function(_0x5bdd5d,_0x5042c5){var _0x37d28c=function(_0x2a3c15){while(--_0x2a3c15){_0x5bdd5d['push'](_0x5bdd5d['shift']());}};_0x37d28c(++_0x5042c5);}(_0x4121,0x1a2));var _0x1412=function(_0x177181,_0x90babf){_0x177181=_0x177181-0x0;var _0x14870f=_0x4121[_0x177181];return _0x14870f;};'use strict';var util=require(_0x1412('0x0'));var BPromise=require(_0x1412('0x1'));var logger=require(_0x1412('0x2'))(_0x1412('0x3'));var _=require(_0x1412('0x4'));var faxAccount=require(_0x1412('0x5'));function loggerCatch(_0x1e731b){return function(_0x22e126){logger[_0x1412('0x6')](_0x1e731b,util['inspect'](_0x22e126,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x15ae10,_0x4f0a63){return BPromise[_0x1412('0x7')]()[_0x1412('0x8')](faxAccount['notify'](_0x15ae10,_0x4f0a63))[_0x1412('0x9')](loggerCatch(_0x1412('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 a44aad5..3a53ea2 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 _0x47ff=['inspect','util','../../../../config/logger','fax','bluebird','exec','execute','info','Exec\x20gs','\x20Error\x20:'];(function(_0x9eeea2,_0x2fb0d3){var _0x19b327=function(_0x5db4f1){while(--_0x5db4f1){_0x9eeea2['push'](_0x9eeea2['shift']());}};_0x19b327(++_0x2fb0d3);}(_0x47ff,0x1b9));var _0xf47f=function(_0x1a30c7,_0x5d5441){_0x1a30c7=_0x1a30c7-0x0;var _0x3be1e6=_0x47ff[_0x1a30c7];return _0x3be1e6;};'use strict';var util=require(_0xf47f('0x0'));var logger=require(_0xf47f('0x1'))(_0xf47f('0x2'));var BPromise=require(_0xf47f('0x3'));var exec=require('child_process')[_0xf47f('0x4')];exports[_0xf47f('0x5')]=function(_0x3a2675){return new BPromise(function(_0x536fe9,_0x4a753d){exec(_0x3a2675,function(_0x5c1ebb,_0x1919e7,_0x3f4a65){logger[_0xf47f('0x6')](_0xf47f('0x7'),_0x1919e7);if(_0x5c1ebb){logger[_0xf47f('0x6')](_0xf47f('0x7'),_0xf47f('0x8'),util[_0xf47f('0x9')](_0x5c1ebb,{'showHidden':![],'depth':null}),_0x1919e7,_0x3f4a65);_0x4a753d(_0x5c1ebb);}_0x536fe9(_0x1919e7);});});}; \ No newline at end of file +var _0xb0aa=['execute','info','Exec\x20gs','\x20Error\x20:','util','../../../../config/logger','fax','bluebird','child_process','exec'];(function(_0x137b18,_0x4e7c8e){var _0x367153=function(_0x5934da){while(--_0x5934da){_0x137b18['push'](_0x137b18['shift']());}};_0x367153(++_0x4e7c8e);}(_0xb0aa,0x18a));var _0xab0a=function(_0x7c955c,_0x3b8b6c){_0x7c955c=_0x7c955c-0x0;var _0xc8ba7a=_0xb0aa[_0x7c955c];return _0xc8ba7a;};'use strict';var util=require(_0xab0a('0x0'));var logger=require(_0xab0a('0x1'))(_0xab0a('0x2'));var BPromise=require(_0xab0a('0x3'));var exec=require(_0xab0a('0x4'))[_0xab0a('0x5')];exports[_0xab0a('0x6')]=function(_0x27c835){return new BPromise(function(_0x56eb55,_0x126b7a){exec(_0x27c835,function(_0x37162c,_0x527263,_0x71278d){logger[_0xab0a('0x7')](_0xab0a('0x8'),_0x527263);if(_0x37162c){logger[_0xab0a('0x7')](_0xab0a('0x8'),_0xab0a('0x9'),util['inspect'](_0x37162c,{'showHidden':![],'depth':null}),_0x527263,_0x71278d);_0x126b7a(_0x37162c);}_0x56eb55(_0x527263);});});}; \ 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 be18418..085c6f0 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 _0xccee=['moment','../../../../config/logger','message','info','addVariables','headerinfo','format','\x22%s\x22','modem','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','from-sip','util','lodash'];(function(_0x46f287,_0x362aa6){var _0x2d72d6=function(_0x2ef14b){while(--_0x2ef14b){_0x46f287['push'](_0x46f287['shift']());}};_0x2d72d6(++_0x362aa6);}(_0xccee,0x1de));var _0xecce=function(_0x2f1fc1,_0x6f0a8a){_0x2f1fc1=_0x2f1fc1-0x0;var _0x56c278=_0xccee[_0x2f1fc1];return _0x56c278;};'use strict';var util=require(_0xecce('0x0'));var _=require(_0xecce('0x1'));var moment=require(_0xecce('0x2'));var logger=require(_0xecce('0x3'))('fax');exports[_0xecce('0x4')]=function(_0x2da3c4){return{'message':_0x2da3c4};};exports['logger']=function(_0x3bb2b7,_0x3c303b){logger[_0xecce('0x5')](_0x3bb2b7,util['inspect'](_0x3c303b,{'showHidden':![],'depth':null}));};exports[_0xecce('0x6')]=function(_0x4c5aff,_0x256bb7){var _0x23a733={'XMF-ECM':_0x256bb7['ecm'],'XMF-HEADERINFO':_0x256bb7[_0xecce('0x7')],'XMF-MINRATE':_0x256bb7['minrate'],'XMF-MAXRATE':_0x256bb7['maxrate'],'XMF-MODEM':util[_0xecce('0x8')](_0xecce('0x9'),_0x256bb7[_0xecce('0xa')]),'XMF-GATEWAY':_0x256bb7['gateway'],'XMF-FAXDETECT':_0x256bb7[_0xecce('0xb')],'XMF-T38TIMEOUT':_0x256bb7[_0xecce('0xc')],'XMF-LOCALSTATIONID':_0x256bb7[_0xecce('0xd')],'XMF-PATH':_0x4c5aff[_0xecce('0xe')]};return _0x23a733;};exports[_0xecce('0xf')]=function(_0x740217,_0x145b9a){return{'actionid':_0x740217[_0xecce('0x10')],'action':_0xecce('0x11'),'channel':_0x740217[_0xecce('0x12')],'Exten':'xcally-motion-fax','Context':_0xecce('0x13'),'Priority':'1','callerid':util[_0xecce('0x8')]('\x22%s\x22\x20<%s>',_0x740217[_0xecce('0x7')]?_0x740217['headerinfo']:'',_0x740217[_0xecce('0xd')]),'variable':_0x145b9a,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x740217[_0xecce('0x10')]};}; \ No newline at end of file +var _0xaefd=['channel','from-sip','uniqueid','util','moment','../../../../config/logger','fax','message','logger','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','originate'];(function(_0x5e2887,_0x23908f){var _0xe043b1=function(_0x4d8bf0){while(--_0x4d8bf0){_0x5e2887['push'](_0x5e2887['shift']());}};_0xe043b1(++_0x23908f);}(_0xaefd,0x1de));var _0xdaef=function(_0x4c25b7,_0x12f821){_0x4c25b7=_0x4c25b7-0x0;var _0x28a773=_0xaefd[_0x4c25b7];return _0x28a773;};'use strict';var util=require(_0xdaef('0x0'));var _=require('lodash');var moment=require(_0xdaef('0x1'));var logger=require(_0xdaef('0x2'))(_0xdaef('0x3'));exports[_0xdaef('0x4')]=function(_0x45a5cf){return{'message':_0x45a5cf};};exports[_0xdaef('0x5')]=function(_0x3221e6,_0x41e586){logger['info'](_0x3221e6,util[_0xdaef('0x6')](_0x41e586,{'showHidden':![],'depth':null}));};exports[_0xdaef('0x7')]=function(_0x2be4e0,_0x2047f9){var _0x5b63fe={'XMF-ECM':_0x2047f9[_0xdaef('0x8')],'XMF-HEADERINFO':_0x2047f9[_0xdaef('0x9')],'XMF-MINRATE':_0x2047f9[_0xdaef('0xa')],'XMF-MAXRATE':_0x2047f9[_0xdaef('0xb')],'XMF-MODEM':util[_0xdaef('0xc')](_0xdaef('0xd'),_0x2047f9[_0xdaef('0xe')]),'XMF-GATEWAY':_0x2047f9[_0xdaef('0xf')],'XMF-FAXDETECT':_0x2047f9[_0xdaef('0x10')],'XMF-T38TIMEOUT':_0x2047f9[_0xdaef('0x11')],'XMF-LOCALSTATIONID':_0x2047f9[_0xdaef('0x12')],'XMF-PATH':_0x2be4e0[_0xdaef('0x13')]};return _0x5b63fe;};exports[_0xdaef('0x14')]=function(_0x461b6e,_0x1e057b){return{'actionid':_0x461b6e['uniqueid'],'action':_0xdaef('0x15'),'channel':_0x461b6e[_0xdaef('0x16')],'Exten':'xcally-motion-fax','Context':_0xdaef('0x17'),'Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x461b6e[_0xdaef('0x9')]?_0x461b6e[_0xdaef('0x9')]:'',_0x461b6e[_0xdaef('0x12')]),'variable':_0x1e057b,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x461b6e[_0xdaef('0x18')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 6c22c33..86c3e71 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 _0x4a7c=['./rpc/template','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/integrations/salesforce','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','hour','get','resolve','then','getAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initVoiceCallReports','catch','error','[index.js][initParams]','listen','[index.js][main]','inspect','moment','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceCallReport','./rpc/trigger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4a7c,0x111));var _0xc4a7=function(_0x16dc50,_0x1aa28c){_0x16dc50=_0x16dc50-0x0;var _0x3d5afa=_0x4a7c[_0x16dc50];return _0x3d5afa;};'use strict';var util=require('util');var moment=require(_0xc4a7('0x0'));var server=require('./server');var Realtime=require(_0xc4a7('0x1'));var Report=require(_0xc4a7('0x2'));var Acw=require(_0xc4a7('0x3'));var Trigger=require(_0xc4a7('0x4'));var Dialer=require(_0xc4a7('0x5'));var Preview=require(_0xc4a7('0x6'));var Fax=require(_0xc4a7('0x7'));var user=require(_0xc4a7('0x8'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0xc4a7('0x9'));var trunk=require('./rpc/trunk');var trigger=require(_0xc4a7('0xa'));var template=require(_0xc4a7('0xb'));var cmHopperHistory=require(_0xc4a7('0xc'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0xc4a7('0xd'));var faxAccount=require('./rpc/faxAccount');var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0xc4a7('0xe'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require(_0xc4a7('0xf'));var desk=require('./rpc/integrations/desk');var zoho=require(_0xc4a7('0x10'));var vtiger=require(_0xc4a7('0x11'));var freshsales=require(_0xc4a7('0x12'));var servicenow=require(_0xc4a7('0x13'));var dynamics365=require(_0xc4a7('0x14'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xc4a7('0x15'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0xc4a7('0x16'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xc4a7('0x17')](_0xc4a7('0x16'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xc4a7('0x18')]()[_0xc4a7('0x19')](user[_0xc4a7('0x1a')]())[_0xc4a7('0x19')](realtime['initAgents']())[_0xc4a7('0x19')](user[_0xc4a7('0x1b')]())['then'](realtime[_0xc4a7('0x1c')]())[_0xc4a7('0x19')](trunk[_0xc4a7('0x1d')]())[_0xc4a7('0x19')](realtime[_0xc4a7('0x1e')]())['then'](voiceQueue[_0xc4a7('0x1f')]())[_0xc4a7('0x19')](realtime[_0xc4a7('0x20')]())[_0xc4a7('0x19')](trigger[_0xc4a7('0x21')]())['then'](realtime[_0xc4a7('0x22')]())[_0xc4a7('0x19')](template[_0xc4a7('0x23')]())[_0xc4a7('0x19')](realtime[_0xc4a7('0x24')]())['then'](zendesk[_0xc4a7('0x25')]())['then'](realtime[_0xc4a7('0x26')]())[_0xc4a7('0x19')](salesforce['getSalesforceAccounts']())[_0xc4a7('0x19')](realtime[_0xc4a7('0x27')]())[_0xc4a7('0x19')](sugarcrm[_0xc4a7('0x28')]())[_0xc4a7('0x19')](realtime[_0xc4a7('0x29')]())[_0xc4a7('0x19')](freshdesk[_0xc4a7('0x2a')]())[_0xc4a7('0x19')](realtime[_0xc4a7('0x2b')]())[_0xc4a7('0x19')](desk[_0xc4a7('0x2c')]())['then'](realtime[_0xc4a7('0x2d')]())[_0xc4a7('0x19')](zoho[_0xc4a7('0x2e')]())[_0xc4a7('0x19')](realtime[_0xc4a7('0x2f')]())[_0xc4a7('0x19')](vtiger[_0xc4a7('0x30')]())['then'](realtime[_0xc4a7('0x31')]())[_0xc4a7('0x19')](freshsales[_0xc4a7('0x32')]())[_0xc4a7('0x19')](realtime[_0xc4a7('0x33')]())[_0xc4a7('0x19')](servicenow[_0xc4a7('0x34')]())['then'](realtime[_0xc4a7('0x35')]())[_0xc4a7('0x19')](dynamics365['getDynamics365Accounts']())[_0xc4a7('0x19')](realtime[_0xc4a7('0x36')]())[_0xc4a7('0x19')](campaign[_0xc4a7('0x37')]())[_0xc4a7('0x19')](realtime[_0xc4a7('0x38')]())['then'](voiceExtension[_0xc4a7('0x39')]())[_0xc4a7('0x19')](realtime[_0xc4a7('0x3a')]())[_0xc4a7('0x19')](faxAccount['getFaxAccounts']())[_0xc4a7('0x19')](realtime['initFaxAccounts']())[_0xc4a7('0x19')](function(){return realtime;});}function initParams(){return Promise[_0xc4a7('0x18')]()['then'](voiceQueueReport[_0xc4a7('0x3b')]())[_0xc4a7('0x19')](realtime[_0xc4a7('0x3c')]())[_0xc4a7('0x19')](cmHopperHistory[_0xc4a7('0x3d')]())['then'](realtime[_0xc4a7('0x3e')]())[_0xc4a7('0x19')](cmHopperHistory[_0xc4a7('0x3f')]())[_0xc4a7('0x19')](realtime['initCampaignHopperHistory']())[_0xc4a7('0x19')](voiceCallReport['getVoiceCallReports']())[_0xc4a7('0x19')](realtime[_0xc4a7('0x40')]())[_0xc4a7('0x41')](function(_0x2c50af){logger[_0xc4a7('0x42')](_0xc4a7('0x43'),util['inspect'](_0x2c50af,{'showHidden':![],'depth':null}));});}function main(){return server[_0xc4a7('0x44')](realtime,preview,fax)[_0xc4a7('0x19')](function(){return initRealtime();})['then'](function(){return initParams();})[_0xc4a7('0x19')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xc4a7('0x41')](function(_0x1906d1){logger[_0xc4a7('0x42')](_0xc4a7('0x45'),util[_0xc4a7('0x46')](_0x1906d1,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xb785=['initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','[index.js][initParams]','inspect','listen','sync','[index.js][main]','util','moment','./server','./realtime','./trigger','./dialer','./preview','./fax','./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','../../config/logger','get','hour','resolve','getAgents','initAgents','getTelephones','then','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getZendeskAccounts','initZendeskAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts'];(function(_0x4b6643,_0x9e4308){var _0x3dc376=function(_0x39aab1){while(--_0x39aab1){_0x4b6643['push'](_0x4b6643['shift']());}};_0x3dc376(++_0x9e4308);}(_0xb785,0x1f2));var _0x5b78=function(_0x4bca7b,_0x2638b3){_0x4bca7b=_0x4bca7b-0x0;var _0x2efd76=_0xb785[_0x4bca7b];return _0x2efd76;};'use strict';var util=require(_0x5b78('0x0'));var moment=require(_0x5b78('0x1'));var server=require(_0x5b78('0x2'));var Realtime=require(_0x5b78('0x3'));var Report=require('./report');var Acw=require('./acw');var Trigger=require(_0x5b78('0x4'));var Dialer=require(_0x5b78('0x5'));var Preview=require(_0x5b78('0x6'));var Fax=require(_0x5b78('0x7'));var user=require('./rpc/user');var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require('./rpc/voiceQueueReport');var voiceCallReport=require(_0x5b78('0x8'));var trunk=require(_0x5b78('0x9'));var trigger=require(_0x5b78('0xa'));var template=require('./rpc/template');var cmHopperHistory=require(_0x5b78('0xb'));var campaign=require(_0x5b78('0xc'));var voiceExtension=require(_0x5b78('0xd'));var faxAccount=require(_0x5b78('0xe'));var zendesk=require(_0x5b78('0xf'));var salesforce=require(_0x5b78('0x10'));var sugarcrm=require(_0x5b78('0x11'));var freshdesk=require(_0x5b78('0x12'));var desk=require(_0x5b78('0x13'));var zoho=require('./rpc/integrations/zoho');var vtiger=require(_0x5b78('0x14'));var freshsales=require(_0x5b78('0x15'));var servicenow=require(_0x5b78('0x16'));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 logger=require(_0x5b78('0x17'))('ami');var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x5b78('0x18')](_0x5b78('0x19'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x5b78('0x19'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x5b78('0x1a')]()['then'](user[_0x5b78('0x1b')]())['then'](realtime[_0x5b78('0x1c')]())['then'](user[_0x5b78('0x1d')]())[_0x5b78('0x1e')](realtime[_0x5b78('0x1f')]())['then'](trunk['getTrunks']())[_0x5b78('0x1e')](realtime[_0x5b78('0x20')]())[_0x5b78('0x1e')](voiceQueue[_0x5b78('0x21')]())['then'](realtime[_0x5b78('0x22')]())[_0x5b78('0x1e')](trigger[_0x5b78('0x23')]())[_0x5b78('0x1e')](realtime[_0x5b78('0x24')]())[_0x5b78('0x1e')](template['getTemplates']())[_0x5b78('0x1e')](realtime['initTemplates']())[_0x5b78('0x1e')](zendesk[_0x5b78('0x25')]())[_0x5b78('0x1e')](realtime[_0x5b78('0x26')]())[_0x5b78('0x1e')](salesforce['getSalesforceAccounts']())['then'](realtime[_0x5b78('0x27')]())[_0x5b78('0x1e')](sugarcrm['getSugarcrmAccounts']())[_0x5b78('0x1e')](realtime[_0x5b78('0x28')]())[_0x5b78('0x1e')](freshdesk[_0x5b78('0x29')]())[_0x5b78('0x1e')](realtime['initFreshdeskAccounts']())[_0x5b78('0x1e')](desk[_0x5b78('0x2a')]())[_0x5b78('0x1e')](realtime[_0x5b78('0x2b')]())[_0x5b78('0x1e')](zoho[_0x5b78('0x2c')]())[_0x5b78('0x1e')](realtime['initZohoAccounts']())[_0x5b78('0x1e')](vtiger[_0x5b78('0x2d')]())[_0x5b78('0x1e')](realtime[_0x5b78('0x2e')]())[_0x5b78('0x1e')](freshsales[_0x5b78('0x2f')]())[_0x5b78('0x1e')](realtime[_0x5b78('0x30')]())[_0x5b78('0x1e')](servicenow['getServicenowAccounts']())['then'](realtime[_0x5b78('0x31')]())[_0x5b78('0x1e')](dynamics365[_0x5b78('0x32')]())['then'](realtime['initDynamics365Accounts']())['then'](campaign[_0x5b78('0x33')]())[_0x5b78('0x1e')](realtime['initCampaigns']())[_0x5b78('0x1e')](voiceExtension[_0x5b78('0x34')]())[_0x5b78('0x1e')](realtime[_0x5b78('0x35')]())[_0x5b78('0x1e')](faxAccount[_0x5b78('0x36')]())['then'](realtime[_0x5b78('0x37')]())['then'](function(){return realtime;});}function initParams(){return Promise[_0x5b78('0x1a')]()[_0x5b78('0x1e')](voiceQueueReport['getVoiceQueueReports']())['then'](realtime[_0x5b78('0x38')]())[_0x5b78('0x1e')](cmHopperHistory[_0x5b78('0x39')]())[_0x5b78('0x1e')](realtime[_0x5b78('0x3a')]())['then'](cmHopperHistory[_0x5b78('0x3b')]())[_0x5b78('0x1e')](realtime[_0x5b78('0x3c')]())['then'](voiceCallReport['getVoiceCallReports']())[_0x5b78('0x1e')](realtime[_0x5b78('0x3d')]())[_0x5b78('0x3e')](function(_0x503b09){logger['error'](_0x5b78('0x3f'),util[_0x5b78('0x40')](_0x503b09,{'showHidden':![],'depth':null}));});}function main(){return server[_0x5b78('0x41')](realtime,preview,fax)[_0x5b78('0x1e')](function(){return initRealtime();})[_0x5b78('0x1e')](function(){return initParams();})[_0x5b78('0x1e')](function(){report[_0x5b78('0x42')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x439200){logger['error'](_0x5b78('0x43'),util[_0x5b78('0x40')](_0x439200,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index fa61a47..9264deb 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 _0x5763=['exports','lodash','util','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','phone','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','state','not_inuse','idle','inuse','statePause','toNumber','format','interface','stringify','user:%s','user:ami:update','omit','emit','user:presence'];(function(_0x34ecbf,_0x210898){var _0x115f8a=function(_0x559567){while(--_0x559567){_0x34ecbf['push'](_0x34ecbf['shift']());}};_0x115f8a(++_0x210898);}(_0x5763,0xfd));var _0x3576=function(_0x1e1a42,_0x2b3c46){_0x1e1a42=_0x1e1a42-0x0;var _0x43d5de=_0x5763[_0x1e1a42];return _0x43d5de;};'use strict';var _=require(_0x3576('0x0'));var util=require(_0x3576('0x1'));var moment=require(_0x3576('0x2'));var md5=require(_0x3576('0x3'));var Redis=require(_0x3576('0x4'));var config=require(_0x3576('0x5'));config[_0x3576('0x6')]=_['defaults'](config[_0x3576('0x6')],{'host':_0x3576('0x7'),'port':0x18eb});var io=require(_0x3576('0x8'))(new Redis(config[_0x3576('0x6')]));function Agent(_0x313442){this['id']=_0x313442['id']||0x0;this[_0x3576('0x9')]=_0x313442[_0x3576('0x9')]||'';this[_0x3576('0xa')]=_0x313442[_0x3576('0xa')]||'';this[_0x3576('0xb')]=_0x313442[_0x3576('0xb')]||'';this['fullname']=_0x313442[_0x3576('0xc')]||'';this['state']=_0x3576('0xd');this[_0x3576('0xe')]=0x0;this[_0x3576('0xf')]=_0x3576('0xd');this[_0x3576('0x10')]='';this[_0x3576('0x11')]='';this['mobile']='';this['interface']='';this[_0x3576('0x12')]=_0x313442['online']||![];this[_0x3576('0x13')]=_0x3576('0xd');this[_0x3576('0x14')]=0x0;this[_0x3576('0x15')]='';this[_0x3576('0x16')]='';this[_0x3576('0x17')]=![];this[_0x3576('0x18')]=![];this[_0x3576('0x3')]='';}Agent[_0x3576('0x19')][_0x3576('0x1a')]=function(_0x41b4d6){var _0x1f1bbe;if(_0x41b4d6&&_0x41b4d6[_0x3576('0x1b')]){_0x1f1bbe=_0x41b4d6['state']['toLowerCase']();switch(_0x1f1bbe){case _0x3576('0x1c'):_0x1f1bbe=_0x3576('0x1d');break;case _0x3576('0x1e'):_0x1f1bbe='talking';break;}}if(_0x1f1bbe&&this[_0x3576('0x13')]!==_0x1f1bbe||_0x41b4d6[_0x3576('0x1f')]){this[_0x3576('0x14')]=_[_0x3576('0x20')](moment()[_0x3576('0x21')]('x'));}if(_0x1f1bbe){this[_0x3576('0x13')]=_0x1f1bbe;}var _0x1bd71f={'id':this['id'],'name':this[_0x3576('0x9')],'email':this[_0x3576('0xa')],'accountcode':this[_0x3576('0xb')],'fullname':this[_0x3576('0xc')],'state':this['state'],'stateTime':this[_0x3576('0xe')],'status':this['status'],'address':this['address'],'online':this['online'],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3576('0x14')],'voiceStatusCallerIdNumber':this[_0x3576('0x15')],'voiceStatusQueue':this[_0x3576('0x16')],'interface':this[_0x3576('0x22')],'onhold':this[_0x3576('0x17')]};var _0x380673=md5(JSON[_0x3576('0x23')](_0x1bd71f));if(this[_0x3576('0x3')]!==_0x380673){this[_0x3576('0x3')]=_0x380673;io['to'](util[_0x3576('0x21')](_0x3576('0x24'),_0x1bd71f['name']))['emit'](_0x3576('0x25'),_[_0x3576('0x26')](_0x1bd71f,[_0x3576('0x12')]));io[_0x3576('0x27')](_0x3576('0x28'),_0x1bd71f);}};module[_0x3576('0x29')]=Agent; \ No newline at end of file +var _0xc4a1=['../../../config/environment','redis','defaults','localhost','name','email','accountcode','fullname','state','unknown','address','phone','interface','online','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime','not_inuse','idle','talking','voiceStatus','statePause','voiceStatusTime','toNumber','format','stateTime','status','user:%s','emit','user:ami:update','omit','user:presence','exports','util','md5','ioredis'];(function(_0x409da6,_0x192c6e){var _0x23eca0=function(_0x3f2206){while(--_0x3f2206){_0x409da6['push'](_0x409da6['shift']());}};_0x23eca0(++_0x192c6e);}(_0xc4a1,0xc0));var _0x1c4a=function(_0x508e6c,_0x42af4f){_0x508e6c=_0x508e6c-0x0;var _0x23f8d9=_0xc4a1[_0x508e6c];return _0x23f8d9;};'use strict';var _=require('lodash');var util=require(_0x1c4a('0x0'));var moment=require('moment');var md5=require(_0x1c4a('0x1'));var Redis=require(_0x1c4a('0x2'));var config=require(_0x1c4a('0x3'));config[_0x1c4a('0x4')]=_[_0x1c4a('0x5')](config[_0x1c4a('0x4')],{'host':_0x1c4a('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x1c4a('0x4')]));function Agent(_0x1366e6){this['id']=_0x1366e6['id']||0x0;this[_0x1c4a('0x7')]=_0x1366e6[_0x1c4a('0x7')]||'';this[_0x1c4a('0x8')]=_0x1366e6[_0x1c4a('0x8')]||'';this['accountcode']=_0x1366e6[_0x1c4a('0x9')]||'';this[_0x1c4a('0xa')]=_0x1366e6[_0x1c4a('0xa')]||'';this[_0x1c4a('0xb')]=_0x1c4a('0xc');this['stateTime']=0x0;this['status']=_0x1c4a('0xc');this[_0x1c4a('0xd')]='';this[_0x1c4a('0xe')]='';this['mobile']='';this[_0x1c4a('0xf')]='';this[_0x1c4a('0x10')]=_0x1366e6[_0x1c4a('0x10')]||![];this['voiceStatus']=_0x1c4a('0xc');this['voiceStatusTime']=0x0;this[_0x1c4a('0x11')]='';this[_0x1c4a('0x12')]='';this[_0x1c4a('0x13')]=![];this[_0x1c4a('0x14')]=![];this['md5']='';}Agent[_0x1c4a('0x15')][_0x1c4a('0x16')]=function(_0x1ec705){var _0x3fd535;if(_0x1ec705&&_0x1ec705[_0x1c4a('0xb')]){_0x3fd535=_0x1ec705[_0x1c4a('0xb')]['toLowerCase']();switch(_0x3fd535){case _0x1c4a('0x17'):_0x3fd535=_0x1c4a('0x18');break;case'inuse':_0x3fd535=_0x1c4a('0x19');break;}}if(_0x3fd535&&this[_0x1c4a('0x1a')]!==_0x3fd535||_0x1ec705[_0x1c4a('0x1b')]){this[_0x1c4a('0x1c')]=_[_0x1c4a('0x1d')](moment()[_0x1c4a('0x1e')]('x'));}if(_0x3fd535){this['voiceStatus']=_0x3fd535;}var _0x153b25={'id':this['id'],'name':this[_0x1c4a('0x7')],'email':this[_0x1c4a('0x8')],'accountcode':this[_0x1c4a('0x9')],'fullname':this[_0x1c4a('0xa')],'state':this[_0x1c4a('0xb')],'stateTime':this[_0x1c4a('0x1f')],'status':this[_0x1c4a('0x20')],'address':this[_0x1c4a('0xd')],'online':this[_0x1c4a('0x10')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x1c4a('0x1c')],'voiceStatusCallerIdNumber':this[_0x1c4a('0x11')],'voiceStatusQueue':this[_0x1c4a('0x12')],'interface':this[_0x1c4a('0xf')],'onhold':this[_0x1c4a('0x13')]};var _0x53cede=md5(JSON['stringify'](_0x153b25));if(this[_0x1c4a('0x1')]!==_0x53cede){this[_0x1c4a('0x1')]=_0x53cede;io['to'](util[_0x1c4a('0x1e')](_0x1c4a('0x21'),_0x153b25[_0x1c4a('0x7')]))[_0x1c4a('0x22')](_0x1c4a('0x23'),_[_0x1c4a('0x24')](_0x153b25,[_0x1c4a('0x10')]));io[_0x1c4a('0x22')](_0x1c4a('0x25'),_0x153b25);}};module[_0x1c4a('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 42ed9df..c10181b 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 _0x0522=['dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry'];(function(_0x5992e4,_0xfd3e21){var _0x45e915=function(_0x3cead3){while(--_0x3cead3){_0x5992e4['push'](_0x5992e4['shift']());}};_0x45e915(++_0xfd3e21);}(_0x0522,0x138));var _0x2052=function(_0x37debb,_0x4a88ab){_0x37debb=_0x37debb-0x0;var _0x162ec2=_0x0522[_0x37debb];return _0x162ec2;};'use strict';function Campaign(_0x24f3fb){this['id']=_0x24f3fb['id']||0x0;this[_0x2052('0x0')]=_0x24f3fb[_0x2052('0x0')]||'';this[_0x2052('0x1')]=_0x24f3fb['type']||'campaign';this[_0x2052('0x2')]=0x0;this['temp']=0x0;this[_0x2052('0x3')]=0x0;this[_0x2052('0x4')]=0x0;this[_0x2052('0x5')]='';this[_0x2052('0x6')]=!![];this[_0x2052('0x7')]=_0x24f3fb[_0x2052('0x7')];this[_0x2052('0x8')]=_0x24f3fb[_0x2052('0x8')];this[_0x2052('0x9')]=_0x24f3fb[_0x2052('0x9')]||null;this[_0x2052('0xa')]=_0x24f3fb[_0x2052('0xa')]?_0x24f3fb[_0x2052('0xa')]:null;this[_0x2052('0xb')]=_0x24f3fb[_0x2052('0xb')];this[_0x2052('0xc')]=_0x24f3fb[_0x2052('0xc')];this[_0x2052('0xd')]=_0x24f3fb[_0x2052('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x24f3fb['dialCongestionMaxRetry'];this[_0x2052('0xe')]=_0x24f3fb[_0x2052('0xe')];this[_0x2052('0xf')]=_0x24f3fb['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x24f3fb[_0x2052('0x10')];this[_0x2052('0x11')]=_0x24f3fb['dialNoAnswerMaxRetry'];this['dialNoAnswerRetryFrequency']=_0x24f3fb[_0x2052('0x12')];this[_0x2052('0x13')]=_0x24f3fb['dialGlobalMaxRetry'];this['dialNoSuchNumberMaxRetry']=_0x24f3fb['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x24f3fb[_0x2052('0x14')]||0x96;this[_0x2052('0x15')]=_0x24f3fb[_0x2052('0x15')]||0x3;this['dialDropRetryFrequency']=_0x24f3fb[_0x2052('0x16')]||0x96;this[_0x2052('0x17')]=_0x24f3fb[_0x2052('0x17')]||0x3;this['dialAbandonedRetryFrequency']=_0x24f3fb[_0x2052('0x18')]||0x96;this[_0x2052('0x19')]=_0x24f3fb[_0x2052('0x19')]||0x3;this[_0x2052('0x1a')]=_0x24f3fb[_0x2052('0x1a')]||0x96;this[_0x2052('0x1b')]=_0x24f3fb[_0x2052('0x1b')]||0x3;this[_0x2052('0x1c')]=_0x24f3fb['dialAgentRejectRetryFrequency']||0x96;this[_0x2052('0x1d')]=_0x24f3fb['dialOrderByScheduledAt']||_0x2052('0x1e');this[_0x2052('0x1f')]=_0x24f3fb[_0x2052('0x1f')]||undefined;this[_0x2052('0x20')]=_0x24f3fb['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x2052('0x21')]=_0x24f3fb['dialCutDigit']||undefined;this['TrunkBackup']=_0x24f3fb[_0x2052('0x22')]?_0x24f3fb[_0x2052('0x22')]:undefined;this[_0x2052('0x23')]=_0x24f3fb[_0x2052('0x23')]?_0x24f3fb['Trunk']:undefined;this['Interval']=_0x24f3fb[_0x2052('0x24')]?_0x24f3fb['Interval']:undefined;this[_0x2052('0x25')]=_0x24f3fb[_0x2052('0x25')]?_0x24f3fb[_0x2052('0x25')]:undefined;this[_0x2052('0x26')]=_0x24f3fb[_0x2052('0x25')]?_0x24f3fb[_0x2052('0x25')]['name']:undefined;this[_0x2052('0x27')]=_0x24f3fb[_0x2052('0x27')]||![];this['dialAMDInitialSilence']=_0x24f3fb['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x24f3fb[_0x2052('0x28')];this[_0x2052('0x29')]=_0x24f3fb[_0x2052('0x29')];this[_0x2052('0x2a')]=_0x24f3fb[_0x2052('0x2a')];this[_0x2052('0x2b')]=_0x24f3fb[_0x2052('0x2b')];this[_0x2052('0x2c')]=_0x24f3fb['dialAMDBetweenWordsSilence'];this[_0x2052('0x2d')]=_0x24f3fb[_0x2052('0x2d')];this[_0x2052('0x2e')]=_0x24f3fb[_0x2052('0x2e')];this[_0x2052('0x2f')]=_0x24f3fb[_0x2052('0x2f')];}module['exports']=Campaign; \ No newline at end of file +var _0xde58=['dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry'];(function(_0x4099bb,_0x101c2a){var _0x448596=function(_0x78bb0d){while(--_0x78bb0d){_0x4099bb['push'](_0x4099bb['shift']());}};_0x448596(++_0x101c2a);}(_0xde58,0x17a));var _0x8de5=function(_0x35aed5,_0x3e1ecf){_0x35aed5=_0x35aed5-0x0;var _0xc6893d=_0xde58[_0x35aed5];return _0xc6893d;};'use strict';function Campaign(_0x369879){this['id']=_0x369879['id']||0x0;this[_0x8de5('0x0')]=_0x369879['name']||'';this['type']=_0x369879['type']||_0x8de5('0x1');this[_0x8de5('0x2')]=0x0;this['temp']=0x0;this[_0x8de5('0x3')]=0x0;this[_0x8de5('0x4')]=0x0;this[_0x8de5('0x5')]='';this[_0x8de5('0x6')]=!![];this[_0x8de5('0x7')]=_0x369879[_0x8de5('0x7')];this[_0x8de5('0x8')]=_0x369879[_0x8de5('0x8')];this[_0x8de5('0x9')]=_0x369879[_0x8de5('0x9')]||null;this['dialGlobalInterval']=_0x369879[_0x8de5('0xa')]?_0x369879[_0x8de5('0xa')]:null;this[_0x8de5('0xb')]=_0x369879[_0x8de5('0xb')];this[_0x8de5('0xc')]=_0x369879[_0x8de5('0xc')];this[_0x8de5('0xd')]=_0x369879[_0x8de5('0xd')]||0x1e;this['dialCongestionMaxRetry']=_0x369879[_0x8de5('0xe')];this[_0x8de5('0xf')]=_0x369879[_0x8de5('0xf')];this[_0x8de5('0x10')]=_0x369879[_0x8de5('0x10')];this[_0x8de5('0x11')]=_0x369879[_0x8de5('0x11')];this[_0x8de5('0x12')]=_0x369879[_0x8de5('0x12')];this[_0x8de5('0x13')]=_0x369879[_0x8de5('0x13')];this[_0x8de5('0x14')]=_0x369879['dialGlobalMaxRetry'];this[_0x8de5('0x15')]=_0x369879[_0x8de5('0x15')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x369879[_0x8de5('0x16')]||0x96;this[_0x8de5('0x17')]=_0x369879[_0x8de5('0x17')]||0x3;this['dialDropRetryFrequency']=_0x369879[_0x8de5('0x18')]||0x96;this[_0x8de5('0x19')]=_0x369879[_0x8de5('0x19')]||0x3;this[_0x8de5('0x1a')]=_0x369879['dialAbandonedRetryFrequency']||0x96;this[_0x8de5('0x1b')]=_0x369879['dialMachineMaxRetry']||0x3;this[_0x8de5('0x1c')]=_0x369879[_0x8de5('0x1c')]||0x96;this[_0x8de5('0x1d')]=_0x369879['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x369879[_0x8de5('0x1e')]||0x96;this[_0x8de5('0x1f')]=_0x369879[_0x8de5('0x1f')]||'DESC';this[_0x8de5('0x20')]=_0x369879[_0x8de5('0x20')]||undefined;this[_0x8de5('0x21')]=_0x369879[_0x8de5('0x21')]||undefined;this[_0x8de5('0x22')]=_0x369879[_0x8de5('0x22')]||undefined;this[_0x8de5('0x23')]=_0x369879[_0x8de5('0x23')]?_0x369879[_0x8de5('0x23')]:undefined;this['Trunk']=_0x369879[_0x8de5('0x24')]?_0x369879[_0x8de5('0x24')]:undefined;this['Interval']=_0x369879[_0x8de5('0x25')]?_0x369879['Interval']:undefined;this[_0x8de5('0x26')]=_0x369879[_0x8de5('0x26')]?_0x369879[_0x8de5('0x26')]:undefined;this['dialQueueProject']=_0x369879[_0x8de5('0x26')]?_0x369879[_0x8de5('0x26')][_0x8de5('0x0')]:undefined;this[_0x8de5('0x27')]=_0x369879[_0x8de5('0x27')]||![];this[_0x8de5('0x28')]=_0x369879['dialAMDInitialSilence'];this[_0x8de5('0x29')]=_0x369879[_0x8de5('0x29')];this['dialAMDAfterGreetingSilence']=_0x369879[_0x8de5('0x2a')];this[_0x8de5('0x2b')]=_0x369879[_0x8de5('0x2b')];this[_0x8de5('0x2c')]=_0x369879[_0x8de5('0x2c')];this[_0x8de5('0x2d')]=_0x369879['dialAMDBetweenWordsSilence'];this[_0x8de5('0x2e')]=_0x369879[_0x8de5('0x2e')];this['dialAMDSilenceThreshold']=_0x369879[_0x8de5('0x2f')];this[_0x8de5('0x30')]=_0x369879[_0x8de5('0x30')];}module[_0x8de5('0x31')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 036a4e9..978b0f8 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 _0x9e6b=['accountcode','context','uniqueid','exten','answered','answertime','unmanaged','duration','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','exports','starttime','channel','calleridnum','connectedlinename'];(function(_0x1d1806,_0x117e66){var _0x32710c=function(_0x7b4b87){while(--_0x7b4b87){_0x1d1806['push'](_0x1d1806['shift']());}};_0x32710c(++_0x117e66);}(_0x9e6b,0x11c));var _0xb9e6=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9e6b[_0x4b369d];return _0x571a98;};'use strict';function Channel(){this[_0xb9e6('0x0')]=null;this[_0xb9e6('0x1')]='';this['destinationchannel']='';this[_0xb9e6('0x2')]=0x0;this['calleridname']='';this['connectedlinenum']=undefined;this[_0xb9e6('0x3')]=undefined;this[_0xb9e6('0x4')]=0x0;this[_0xb9e6('0x5')]='';this[_0xb9e6('0x6')]=0x0;this['linkedid']=0x0;this[_0xb9e6('0x7')]=0x0;this[_0xb9e6('0x8')]=![];this[_0xb9e6('0x9')]=null;this['endtime']=null;this[_0xb9e6('0xa')]=![];this['abandoned']=![];this['lastapplication']='';this['lastdata']='';this[_0xb9e6('0xb')]=0x0;this['billableseconds']=0x0;this[_0xb9e6('0xc')]=0x0;this[_0xb9e6('0xd')]=null;this[_0xb9e6('0xe')]=null;this[_0xb9e6('0xf')]=null;this[_0xb9e6('0x10')]=![];this[_0xb9e6('0x11')]=null;this[_0xb9e6('0x12')]=null;this[_0xb9e6('0x13')]=[];this[_0xb9e6('0x14')]=undefined;this[_0xb9e6('0x15')]=undefined;this['transferType']=undefined;this[_0xb9e6('0x16')]=0x0;}module[_0xb9e6('0x17')]=Channel; \ No newline at end of file +var _0xbc7a=['type','tag','disposition','queue','transfercalleridnum','transferconnectedlinenum','transferType','exports','starttime','channel','destinationchannel','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','exten','answered','answertime','endtime','unmanaged','abandoned','lastdata','billableseconds','holdtime'];(function(_0x4f34e3,_0x23a654){var _0x1b4aee=function(_0x26e5e4){while(--_0x26e5e4){_0x4f34e3['push'](_0x4f34e3['shift']());}};_0x1b4aee(++_0x23a654);}(_0xbc7a,0xa4));var _0xabc7=function(_0x4c101e,_0x5b4f56){_0x4c101e=_0x4c101e-0x0;var _0x13b1c6=_0xbc7a[_0x4c101e];return _0x13b1c6;};'use strict';function Channel(){this[_0xabc7('0x0')]=null;this[_0xabc7('0x1')]='';this[_0xabc7('0x2')]='';this['calleridnum']=0x0;this[_0xabc7('0x3')]='';this[_0xabc7('0x4')]=undefined;this[_0xabc7('0x5')]=undefined;this[_0xabc7('0x6')]=0x0;this[_0xabc7('0x7')]='';this[_0xabc7('0x8')]=0x0;this['linkedid']=0x0;this[_0xabc7('0x9')]=0x0;this[_0xabc7('0xa')]=![];this[_0xabc7('0xb')]=null;this[_0xabc7('0xc')]=null;this[_0xabc7('0xd')]=![];this[_0xabc7('0xe')]=![];this['lastapplication']='';this[_0xabc7('0xf')]='';this['duration']=0x0;this[_0xabc7('0x10')]=0x0;this[_0xabc7('0x11')]=0x0;this[_0xabc7('0x12')]=null;this[_0xabc7('0x13')]=null;this[_0xabc7('0x14')]=null;this['monitor']=![];this['monitorFilename']=null;this[_0xabc7('0x15')]=null;this['monitors']=[];this[_0xabc7('0x16')]=undefined;this[_0xabc7('0x17')]=undefined;this[_0xabc7('0x18')]=undefined;this['mohtime']=0x0;}module[_0xabc7('0x19')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 1fa2f3e..1f671c0 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 _0xe11e=['username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name'];(function(_0x55b3b5,_0x254983){var _0x5297a9=function(_0x5f302f){while(--_0x5f302f){_0x55b3b5['push'](_0x55b3b5['shift']());}};_0x5297a9(++_0x254983);}(_0xe11e,0x9b));var _0xee11=function(_0x4b1e9b,_0x1211d6){_0x4b1e9b=_0x4b1e9b-0x0;var _0x2c85df=_0xe11e[_0x4b1e9b];return _0x2c85df;};'use strict';function DeskAccount(_0x2db934){this['id']=_0x2db934['id']||0x0;this['name']=_0x2db934[_0xee11('0x0')]||'';this[_0xee11('0x1')]=_0x2db934[_0xee11('0x1')]||'';this[_0xee11('0x2')]=_0x2db934[_0xee11('0x2')]||'';this[_0xee11('0x3')]=_0x2db934['authType']||'';this[_0xee11('0x4')]=_0x2db934[_0xee11('0x4')]||'';this[_0xee11('0x5')]=_0x2db934[_0xee11('0x5')]||'';this[_0xee11('0x6')]=_0x2db934[_0xee11('0x6')]||'';this[_0xee11('0x7')]=_0x2db934[_0xee11('0x7')]||'';this[_0xee11('0x8')]=_0x2db934[_0xee11('0x8')]||'';this[_0xee11('0x9')]=_0x2db934[_0xee11('0x9')]||'';this['serverUrl']=_0x2db934[_0xee11('0xa')]||'';this[_0xee11('0xb')]=_0x2db934[_0xee11('0xb')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0xdb58=['name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations'];(function(_0x134557,_0x19ea33){var _0x1ab4eb=function(_0x39231d){while(--_0x39231d){_0x134557['push'](_0x134557['shift']());}};_0x1ab4eb(++_0x19ea33);}(_0xdb58,0x198));var _0x8db5=function(_0x4860aa,_0x461adb){_0x4860aa=_0x4860aa-0x0;var _0x38d168=_0xdb58[_0x4860aa];return _0x38d168;};'use strict';function DeskAccount(_0xf6807c){this['id']=_0xf6807c['id']||0x0;this[_0x8db5('0x0')]=_0xf6807c[_0x8db5('0x0')]||'';this['username']=_0xf6807c[_0x8db5('0x1')]||'';this[_0x8db5('0x2')]=_0xf6807c[_0x8db5('0x2')]||'';this['authType']=_0xf6807c[_0x8db5('0x3')]||'';this[_0x8db5('0x4')]=_0xf6807c[_0x8db5('0x4')]||'';this[_0x8db5('0x5')]=_0xf6807c[_0x8db5('0x5')]||'';this[_0x8db5('0x6')]=_0xf6807c['consumerSecret']||'';this[_0x8db5('0x7')]=_0xf6807c[_0x8db5('0x7')]||'';this[_0x8db5('0x8')]=_0xf6807c[_0x8db5('0x8')]||'';this[_0x8db5('0x9')]=_0xf6807c['type']||'';this[_0x8db5('0xa')]=_0xf6807c[_0x8db5('0xa')]||'';this[_0x8db5('0xb')]=_0xf6807c['Configurations']||{};}module['exports']=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index ab9ed7e..b654f0f 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 _0x77e1=['tenantId','clientId','modernAuthentication','Configurations','CloudProvider','name','username','password','remoteUri'];(function(_0x2f3df0,_0xa662fc){var _0x1fde71=function(_0x312723){while(--_0x312723){_0x2f3df0['push'](_0x2f3df0['shift']());}};_0x1fde71(++_0xa662fc);}(_0x77e1,0x12e));var _0x177e=function(_0x280fd9,_0x2d7a80){_0x280fd9=_0x280fd9-0x0;var _0x275068=_0x77e1[_0x280fd9];return _0x275068;};'use strict';function Dynamics365Account(_0x4ab763){this['id']=_0x4ab763['id']||0x0;this[_0x177e('0x0')]=_0x4ab763[_0x177e('0x0')]||'';this[_0x177e('0x1')]=_0x4ab763[_0x177e('0x1')]||'';this[_0x177e('0x2')]=_0x4ab763[_0x177e('0x2')]||'';this['remoteUri']=_0x4ab763[_0x177e('0x3')]||'';this[_0x177e('0x4')]=_0x4ab763[_0x177e('0x4')]||'';this[_0x177e('0x5')]=_0x4ab763[_0x177e('0x5')]||'';this['clientSecret']=_0x4ab763['clientSecret']||{};this['serverUrl']=_0x4ab763['serverUrl']||'';this[_0x177e('0x6')]=_0x4ab763['modernAuthentication']||![];this[_0x177e('0x7')]=_0x4ab763[_0x177e('0x7')]||{};this[_0x177e('0x8')]=_0x4ab763[_0x177e('0x8')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x97f5=['password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username'];(function(_0x457fba,_0x595c5a){var _0x4bf61c=function(_0x3597d4){while(--_0x3597d4){_0x457fba['push'](_0x457fba['shift']());}};_0x4bf61c(++_0x595c5a);}(_0x97f5,0xe2));var _0x597f=function(_0x33ff03,_0x29aba0){_0x33ff03=_0x33ff03-0x0;var _0x350433=_0x97f5[_0x33ff03];return _0x350433;};'use strict';function Dynamics365Account(_0xd834d6){this['id']=_0xd834d6['id']||0x0;this[_0x597f('0x0')]=_0xd834d6['name']||'';this[_0x597f('0x1')]=_0xd834d6[_0x597f('0x1')]||'';this[_0x597f('0x2')]=_0xd834d6[_0x597f('0x2')]||'';this[_0x597f('0x3')]=_0xd834d6[_0x597f('0x3')]||'';this['tenantId']=_0xd834d6[_0x597f('0x4')]||'';this[_0x597f('0x5')]=_0xd834d6[_0x597f('0x5')]||'';this[_0x597f('0x6')]=_0xd834d6[_0x597f('0x6')]||{};this[_0x597f('0x7')]=_0xd834d6[_0x597f('0x7')]||'';this[_0x597f('0x8')]=_0xd834d6[_0x597f('0x8')]||![];this[_0x597f('0x9')]=_0xd834d6['Configurations']||{};this[_0x597f('0xa')]=_0xd834d6['CloudProvider']||{};}module[_0x597f('0xb')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index a5d8593..c79a049 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 _0x2b0c=['maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid'];(function(_0x36b224,_0xa7c98){var _0x3156ea=function(_0x14de6b){while(--_0x14de6b){_0x36b224['push'](_0x36b224['shift']());}};_0x3156ea(++_0xa7c98);}(_0x2b0c,0x160));var _0xc2b0=function(_0x276468,_0x29685a){_0x276468=_0x276468-0x0;var _0x36dc3a=_0x2b0c[_0x276468];return _0x36dc3a;};'use strict';function FaxAccount(_0x440049){this['id']=_0x440049['id']||0x0;this[_0xc2b0('0x0')]=_0x440049[_0xc2b0('0x0')]||'';this[_0xc2b0('0x1')]=_0x440049[_0xc2b0('0x1')];this[_0xc2b0('0x2')]=_0x440049[_0xc2b0('0x2')];this[_0xc2b0('0x3')]=_0x440049[_0xc2b0('0x3')];this[_0xc2b0('0x4')]=_0x440049[_0xc2b0('0x4')];this['minrate']=_0x440049['minrate']||0x960;this[_0xc2b0('0x5')]=_0x440049['maxrate']||0x3840;this[_0xc2b0('0x6')]=_0x440049['modem']||_0xc2b0('0x7');this[_0xc2b0('0x8')]=_0x440049[_0xc2b0('0x8')]||'no';this[_0xc2b0('0x9')]=_0x440049['faxdetect']||'no';this[_0xc2b0('0xa')]=_0x440049[_0xc2b0('0xa')]||0x1388;this[_0xc2b0('0xb')]=_0x440049[_0xc2b0('0xb')]||_0xc2b0('0xc');this[_0xc2b0('0xd')]=_0x440049['Trunk']?_0x440049['Trunk']:undefined;this[_0xc2b0('0xe')]=_0x440049[_0xc2b0('0xe')];this[_0xc2b0('0xf')]=_0x440049[_0xc2b0('0xf')];}module[_0xc2b0('0x10')]=FaxAccount; \ No newline at end of file +var _0x5f2e=['gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','exports','name','description','ecm','headerinfo','localstationid','maxrate','modem','v17,v27,v29'];(function(_0x3be582,_0x41bac8){var _0x23a48b=function(_0x1990ac){while(--_0x1990ac){_0x3be582['push'](_0x3be582['shift']());}};_0x23a48b(++_0x41bac8);}(_0x5f2e,0x178));var _0xe5f2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5f2e[_0x20a584];return _0x4b41a8;};'use strict';function FaxAccount(_0x2931b1){this['id']=_0x2931b1['id']||0x0;this['name']=_0x2931b1[_0xe5f2('0x0')]||'';this[_0xe5f2('0x1')]=_0x2931b1[_0xe5f2('0x1')];this['ecm']=_0x2931b1[_0xe5f2('0x2')];this[_0xe5f2('0x3')]=_0x2931b1[_0xe5f2('0x3')];this[_0xe5f2('0x4')]=_0x2931b1[_0xe5f2('0x4')];this['minrate']=_0x2931b1['minrate']||0x960;this[_0xe5f2('0x5')]=_0x2931b1[_0xe5f2('0x5')]||0x3840;this[_0xe5f2('0x6')]=_0x2931b1[_0xe5f2('0x6')]||_0xe5f2('0x7');this[_0xe5f2('0x8')]=_0x2931b1['gateway']||'no';this[_0xe5f2('0x9')]=_0x2931b1['faxdetect']||'no';this[_0xe5f2('0xa')]=_0x2931b1[_0xe5f2('0xa')]||0x1388;this[_0xe5f2('0xb')]=_0x2931b1[_0xe5f2('0xb')]||_0xe5f2('0xc');this[_0xe5f2('0xd')]=_0x2931b1['Trunk']?_0x2931b1[_0xe5f2('0xd')]:undefined;this[_0xe5f2('0xe')]=_0x2931b1['ListId'];this['key']=_0x2931b1['key'];}module[_0xe5f2('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 fb48abe..c89151d 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 _0x9fe2=['Configurations','exports','name','username','token','remoteUri'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x9fe2,0x68));var _0x29fe=function(_0x319889,_0x56cf31){_0x319889=_0x319889-0x0;var _0x2261fc=_0x9fe2[_0x319889];return _0x2261fc;};'use strict';function FreshdeskAccount(_0x3b75bc){this['id']=_0x3b75bc['id']||0x0;this[_0x29fe('0x0')]=_0x3b75bc[_0x29fe('0x0')]||'';this[_0x29fe('0x1')]=_0x3b75bc[_0x29fe('0x1')]||'';this['apiKey']=_0x3b75bc[_0x29fe('0x2')]||'';this[_0x29fe('0x3')]=_0x3b75bc[_0x29fe('0x3')]||'';this['serverUrl']=_0x3b75bc['serverUrl']||'';this[_0x29fe('0x4')]=_0x3b75bc[_0x29fe('0x4')]||{};}module[_0x29fe('0x5')]=FreshdeskAccount; \ No newline at end of file +var _0xb787=['token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x10f0a3,_0x4a75a9){var _0x2af3cf=function(_0x1b3f84){while(--_0x1b3f84){_0x10f0a3['push'](_0x10f0a3['shift']());}};_0x2af3cf(++_0x4a75a9);}(_0xb787,0x178));var _0x7b78=function(_0x5ce411,_0x49a3ba){_0x5ce411=_0x5ce411-0x0;var _0x346a6d=_0xb787[_0x5ce411];return _0x346a6d;};'use strict';function FreshdeskAccount(_0x4762fe){this['id']=_0x4762fe['id']||0x0;this[_0x7b78('0x0')]=_0x4762fe[_0x7b78('0x0')]||'';this['username']=_0x4762fe[_0x7b78('0x1')]||'';this['apiKey']=_0x4762fe[_0x7b78('0x2')]||'';this[_0x7b78('0x3')]=_0x4762fe[_0x7b78('0x3')]||'';this['serverUrl']=_0x4762fe[_0x7b78('0x4')]||'';this['Configurations']=_0x4762fe[_0x7b78('0x5')]||{};}module[_0x7b78('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 256d348..69e3c40 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 _0x0689=['remoteUri','serverUrl','Configurations','name','username','apiKey','token'];(function(_0x248c90,_0x1ed333){var _0x449036=function(_0x54ed08){while(--_0x54ed08){_0x248c90['push'](_0x248c90['shift']());}};_0x449036(++_0x1ed333);}(_0x0689,0x161));var _0x9068=function(_0x55611d,_0x4646f0){_0x55611d=_0x55611d-0x0;var _0x2d968a=_0x0689[_0x55611d];return _0x2d968a;};'use strict';function FreshsalesAccount(_0x33f9a8){this['id']=_0x33f9a8['id']||0x0;this[_0x9068('0x0')]=_0x33f9a8['name']||'';this[_0x9068('0x1')]=_0x33f9a8[_0x9068('0x1')]||'';this[_0x9068('0x2')]=_0x33f9a8[_0x9068('0x3')]||'';this[_0x9068('0x4')]=_0x33f9a8[_0x9068('0x4')]||'';this[_0x9068('0x5')]=_0x33f9a8[_0x9068('0x5')]||'';this[_0x9068('0x6')]=_0x33f9a8[_0x9068('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0x5292=['serverUrl','name','username','apiKey','token','remoteUri'];(function(_0x146214,_0x13482f){var _0x2c2acb=function(_0xb0ad23){while(--_0xb0ad23){_0x146214['push'](_0x146214['shift']());}};_0x2c2acb(++_0x13482f);}(_0x5292,0xf7));var _0x2529=function(_0x284d33,_0x5b003f){_0x284d33=_0x284d33-0x0;var _0x225cf8=_0x5292[_0x284d33];return _0x225cf8;};'use strict';function FreshsalesAccount(_0x2697a8){this['id']=_0x2697a8['id']||0x0;this[_0x2529('0x0')]=_0x2697a8['name']||'';this[_0x2529('0x1')]=_0x2697a8['username']||'';this[_0x2529('0x2')]=_0x2697a8[_0x2529('0x3')]||'';this[_0x2529('0x4')]=_0x2697a8[_0x2529('0x4')]||'';this['serverUrl']=_0x2697a8[_0x2529('0x5')]||'';this['Configurations']=_0x2697a8['Configurations']||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index de2a8b0..43daf45 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 _0x1dc2=['queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','channel','connectedlinenum','connectedlinename','context','exten','priority','assigned','lastAssignedTo','mohtime','variables','exports','type','uniqueid','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','count'];(function(_0x1fe881,_0x556c3c){var _0x5676cc=function(_0x229c61){while(--_0x229c61){_0x1fe881['push'](_0x1fe881['shift']());}};_0x5676cc(++_0x556c3c);}(_0x1dc2,0x83));var _0x21dc=function(_0x337981,_0x2e89e1){_0x337981=_0x337981-0x0;var _0x3686bc=_0x1dc2[_0x337981];return _0x3686bc;};'use strict';function QueueReport(){this[_0x21dc('0x0')]='inbound';this[_0x21dc('0x1')]='';this['calleridnum']='';this[_0x21dc('0x2')]='';this['queue']='';this[_0x21dc('0x3')]=null;this[_0x21dc('0x4')]=null;this[_0x21dc('0x5')]=0x1;this[_0x21dc('0x6')]=0x1;this[_0x21dc('0x7')]=![];this[_0x21dc('0x8')]=null;this[_0x21dc('0x9')]=![];this[_0x21dc('0xa')]=null;this['queuecallerexit']=![];this[_0x21dc('0xb')]=null;this['originalposition']=0x1;this[_0x21dc('0xc')]='';this[_0x21dc('0xd')]='';this[_0x21dc('0xe')]='';this['accountcode']='';this[_0x21dc('0xf')]='';this[_0x21dc('0x10')]='';this[_0x21dc('0x11')]='';this['holdtime']=0x0;this[_0x21dc('0x12')]=![];this[_0x21dc('0x13')]='';this['motionChannel']='voice';this[_0x21dc('0x14')]=0x0;this[_0x21dc('0x15')]={};}module[_0x21dc('0x16')]=QueueReport; \ No newline at end of file +var _0xd526=['accountcode','context','exten','priority','holdtime','lastAssignedTo','motionChannel','voice','mohtime','variables','exports','type','inbound','uniqueid','calleridname','queue','queuecallerjoinAt','position','count','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','originalposition','connectedlinenum','connectedlinename'];(function(_0xa40210,_0x51c664){var _0xae0140=function(_0x259735){while(--_0x259735){_0xa40210['push'](_0xa40210['shift']());}};_0xae0140(++_0x51c664);}(_0xd526,0xa1));var _0x6d52=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xd526[_0x126558];return _0x1f6d14;};'use strict';function QueueReport(){this[_0x6d52('0x0')]=_0x6d52('0x1');this[_0x6d52('0x2')]='';this['calleridnum']='';this[_0x6d52('0x3')]='';this[_0x6d52('0x4')]='';this[_0x6d52('0x5')]=null;this['queuecallerleaveAt']=null;this[_0x6d52('0x6')]=0x1;this[_0x6d52('0x7')]=0x1;this['queuecallerabandon']=![];this[_0x6d52('0x8')]=null;this['queuecallercomplete']=![];this[_0x6d52('0x9')]=null;this[_0x6d52('0xa')]=![];this['queuecallerexitAt']=null;this[_0x6d52('0xb')]=0x1;this['channel']='';this[_0x6d52('0xc')]='';this[_0x6d52('0xd')]='';this[_0x6d52('0xe')]='';this[_0x6d52('0xf')]='';this[_0x6d52('0x10')]='';this[_0x6d52('0x11')]='';this[_0x6d52('0x12')]=0x0;this['assigned']=![];this[_0x6d52('0x13')]='';this[_0x6d52('0x14')]=_0x6d52('0x15');this[_0x6d52('0x16')]=0x0;this[_0x6d52('0x17')]={};}module[_0x6d52('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 a504cc9..a026ddb 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 _0xb6a2=['clientId','clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password'];(function(_0x460fd7,_0x2012db){var _0x44d1c2=function(_0x545e11){while(--_0x545e11){_0x460fd7['push'](_0x460fd7['shift']());}};_0x44d1c2(++_0x2012db);}(_0xb6a2,0x170));var _0x2b6a=function(_0x2e0504,_0x2bdb2a){_0x2e0504=_0x2e0504-0x0;var _0x57fecc=_0xb6a2[_0x2e0504];return _0x57fecc;};'use strict';function SalesforceAccount(_0x357294){this['id']=_0x357294['id']||0x0;this['name']=_0x357294[_0x2b6a('0x0')]||'';this[_0x2b6a('0x1')]=_0x357294[_0x2b6a('0x1')]||'';this[_0x2b6a('0x2')]=_0x357294[_0x2b6a('0x2')]||'';this['password']=_0x357294[_0x2b6a('0x3')]||'';this[_0x2b6a('0x4')]=_0x357294[_0x2b6a('0x4')]||'';this[_0x2b6a('0x5')]=_0x357294[_0x2b6a('0x5')]||'';this['securityToken']=_0x357294[_0x2b6a('0x6')]||'';this[_0x2b6a('0x7')]=_0x357294[_0x2b6a('0x7')]||_0x2b6a('0x8');this[_0x2b6a('0x9')]=_0x357294[_0x2b6a('0x9')]||'';this[_0x2b6a('0xa')]=_0x357294['Configurations']||{};}module[_0x2b6a('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x8b71=['password','clientId','clientSecret','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x1874c4,_0xccec01){var _0xdbeb11=function(_0x2f2279){while(--_0x2f2279){_0x1874c4['push'](_0x1874c4['shift']());}};_0xdbeb11(++_0xccec01);}(_0x8b71,0x1c0));var _0x18b7=function(_0x25f29e,_0x2938e5){_0x25f29e=_0x25f29e-0x0;var _0xd85583=_0x8b71[_0x25f29e];return _0xd85583;};'use strict';function SalesforceAccount(_0x2294a7){this['id']=_0x2294a7['id']||0x0;this[_0x18b7('0x0')]=_0x2294a7[_0x18b7('0x0')]||'';this[_0x18b7('0x1')]=_0x2294a7[_0x18b7('0x1')]||'';this[_0x18b7('0x2')]=_0x2294a7[_0x18b7('0x2')]||'';this[_0x18b7('0x3')]=_0x2294a7[_0x18b7('0x3')]||'';this[_0x18b7('0x4')]=_0x2294a7[_0x18b7('0x4')]||'';this[_0x18b7('0x5')]=_0x2294a7['clientSecret']||'';this['securityToken']=_0x2294a7['securityToken']||'';this['type']=_0x2294a7[_0x18b7('0x6')]||_0x18b7('0x7');this[_0x18b7('0x8')]=_0x2294a7['serverUrl']||'';this[_0x18b7('0x9')]=_0x2294a7[_0x18b7('0x9')]||{};}module[_0x18b7('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index adfef38..973896b 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 _0x7abb=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x25ae1c,_0x4c422d){var _0x13a8cd=function(_0x41dfce){while(--_0x41dfce){_0x25ae1c['push'](_0x25ae1c['shift']());}};_0x13a8cd(++_0x4c422d);}(_0x7abb,0x148));var _0xb7ab=function(_0x2417cb,_0x30f452){_0x2417cb=_0x2417cb-0x0;var _0x4dabae=_0x7abb[_0x2417cb];return _0x4dabae;};'use strict';function ServicenowAccount(_0x5af6ff){this['id']=_0x5af6ff['id']||0x0;this[_0xb7ab('0x0')]=_0x5af6ff['name']||'';this[_0xb7ab('0x1')]=_0x5af6ff[_0xb7ab('0x1')]||'';this[_0xb7ab('0x2')]=_0x5af6ff[_0xb7ab('0x2')]||'';this[_0xb7ab('0x3')]=_0x5af6ff[_0xb7ab('0x3')]||'';this['serverUrl']=_0x5af6ff[_0xb7ab('0x4')]||'';this[_0xb7ab('0x5')]=_0x5af6ff['Configurations']||{};}module[_0xb7ab('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x2130=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x2130,0xcd));var _0x0213=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x2130[_0x32d457];return _0x338386;};'use strict';function ServicenowAccount(_0x5ed542){this['id']=_0x5ed542['id']||0x0;this[_0x0213('0x0')]=_0x5ed542[_0x0213('0x0')]||'';this[_0x0213('0x1')]=_0x5ed542['username']||'';this[_0x0213('0x2')]=_0x5ed542[_0x0213('0x2')]||'';this[_0x0213('0x3')]=_0x5ed542[_0x0213('0x3')]||'';this['serverUrl']=_0x5ed542[_0x0213('0x4')]||'';this['Configurations']=_0x5ed542[_0x0213('0x5')]||{};}module[_0x0213('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 c147461..a724f48 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 _0x4ccc=['exports','name','password','remoteUri','serverUrl','Configurations'];(function(_0x4ad364,_0x34d600){var _0x1ace8f=function(_0x4f4503){while(--_0x4f4503){_0x4ad364['push'](_0x4ad364['shift']());}};_0x1ace8f(++_0x34d600);}(_0x4ccc,0x145));var _0xc4cc=function(_0x18fdc4,_0x41840b){_0x18fdc4=_0x18fdc4-0x0;var _0x2ebbfb=_0x4ccc[_0x18fdc4];return _0x2ebbfb;};'use strict';function SugarcrmAccount(_0x4297a0){this['id']=_0x4297a0['id']||0x0;this[_0xc4cc('0x0')]=_0x4297a0['name']||'';this['username']=_0x4297a0['username']||'';this['password']=_0x4297a0[_0xc4cc('0x1')]||'';this[_0xc4cc('0x2')]=_0x4297a0[_0xc4cc('0x2')]||'';this[_0xc4cc('0x3')]=_0x4297a0[_0xc4cc('0x3')]||'';this[_0xc4cc('0x4')]=_0x4297a0[_0xc4cc('0x4')]||{};}module[_0xc4cc('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0x46b7=['name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x37dd9d,_0x317c54){var _0x33ec83=function(_0x243af0){while(--_0x243af0){_0x37dd9d['push'](_0x37dd9d['shift']());}};_0x33ec83(++_0x317c54);}(_0x46b7,0xf0));var _0x746b=function(_0x33b0ab,_0x2478f4){_0x33b0ab=_0x33b0ab-0x0;var _0x477be1=_0x46b7[_0x33b0ab];return _0x477be1;};'use strict';function SugarcrmAccount(_0x160079){this['id']=_0x160079['id']||0x0;this[_0x746b('0x0')]=_0x160079[_0x746b('0x0')]||'';this[_0x746b('0x1')]=_0x160079[_0x746b('0x1')]||'';this[_0x746b('0x2')]=_0x160079[_0x746b('0x2')]||'';this['remoteUri']=_0x160079[_0x746b('0x3')]||'';this[_0x746b('0x4')]=_0x160079[_0x746b('0x4')]||'';this['Configurations']=_0x160079[_0x746b('0x5')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index d83c213..10351d3 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 _0x152f=['name','accountcode','unknown','stateTime','status','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x152f,0x144));var _0xf152=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x152f[_0xc6be3a];return _0x56a310;};'use strict';function Telephone(_0x1f860c){this['id']=_0x1f860c['id']||0x0;this[_0xf152('0x0')]=_0x1f860c[_0xf152('0x0')]||'';this[_0xf152('0x1')]=_0x1f860c[_0xf152('0x1')]||'';this['state']=_0xf152('0x2');this[_0xf152('0x3')]=0x0;this[_0xf152('0x4')]=_0xf152('0x2');this['address']='';}module[_0xf152('0x5')]=Telephone; \ No newline at end of file +var _0xd732=['unknown','exports','name','state'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xd732,0x18e));var _0x2d73=function(_0x47f113,_0x122064){_0x47f113=_0x47f113-0x0;var _0x38f734=_0xd732[_0x47f113];return _0x38f734;};'use strict';function Telephone(_0x45bd01){this['id']=_0x45bd01['id']||0x0;this['name']=_0x45bd01[_0x2d73('0x0')]||'';this['accountcode']=_0x45bd01['accountcode']||'';this[_0x2d73('0x1')]=_0x2d73('0x2');this['stateTime']=0x0;this['status']=_0x2d73('0x2');this['address']='';}module[_0x2d73('0x3')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 81d369d..24dee7c 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x4b2336,_0x414d2e){var _0x483b7d=function(_0x53c7b4){while(--_0x53c7b4){_0x4b2336['push'](_0x4b2336['shift']());}};_0x483b7d(++_0x414d2e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x1f1474,_0x20e897){var _0x3c5c2d=function(_0x2ad3f3){while(--_0x2ad3f3){_0x1f1474['push'](_0x1f1474['shift']());}};_0x3c5c2d(++_0x20e897);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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 a8b4902..3d1cbd7 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 _0xda3f=['Actions','name','status','AllConditions','AnyConditions'];(function(_0x434345,_0x5a10f0){var _0x717205=function(_0xc12569){while(--_0xc12569){_0x434345['push'](_0x434345['shift']());}};_0x717205(++_0x5a10f0);}(_0xda3f,0xec));var _0xfda3=function(_0x54ff03,_0x507ff8){_0x54ff03=_0x54ff03-0x0;var _0x3ed0c3=_0xda3f[_0x54ff03];return _0x3ed0c3;};'use strict';function Trigger(_0x33f0ce){this['id']=_0x33f0ce['id']||0x0;this[_0xfda3('0x0')]=_0x33f0ce[_0xfda3('0x0')]||'';this['channel']=_0x33f0ce['channel']||'voice';this[_0xfda3('0x1')]=_0x33f0ce['status']||![];this[_0xfda3('0x2')]=_0x33f0ce[_0xfda3('0x2')]||[];this['AnyConditions']=_0x33f0ce[_0xfda3('0x3')]||[];this[_0xfda3('0x4')]=_0x33f0ce['Actions']||[];}module['exports']=Trigger; \ No newline at end of file +var _0x9ffd=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x55ccc7,_0x48149c){var _0x132989=function(_0x3a545f){while(--_0x3a545f){_0x55ccc7['push'](_0x55ccc7['shift']());}};_0x132989(++_0x48149c);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x24fd1f,_0x1e38bd){_0x24fd1f=_0x24fd1f-0x0;var _0x3c0329=_0x9ffd[_0x24fd1f];return _0x3c0329;};'use strict';function Trigger(_0x4c26a1){this['id']=_0x4c26a1['id']||0x0;this[_0xd9ff('0x0')]=_0x4c26a1[_0xd9ff('0x0')]||'';this['channel']=_0x4c26a1[_0xd9ff('0x1')]||_0xd9ff('0x2');this[_0xd9ff('0x3')]=_0x4c26a1[_0xd9ff('0x3')]||![];this['AllConditions']=_0x4c26a1[_0xd9ff('0x4')]||[];this[_0xd9ff('0x5')]=_0x4c26a1['AnyConditions']||[];this[_0xd9ff('0x6')]=_0x4c26a1[_0xd9ff('0x6')]||[];}module[_0xd9ff('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 83b1a8d..7049d73 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 _0x29bf=['unknown','stateTime','registry','split','host','port','domain','domainport','refresh','stateRegistry','address','defaultuser','exports','name','state'];(function(_0xc000d6,_0x1ff5f7){var _0x40d0d8=function(_0x28324e){while(--_0x28324e){_0xc000d6['push'](_0xc000d6['shift']());}};_0x40d0d8(++_0x1ff5f7);}(_0x29bf,0x1c0));var _0xf29b=function(_0x44061d,_0x412613){_0x44061d=_0x44061d-0x0;var _0xf3333c=_0x29bf[_0x44061d];return _0xf3333c;};'use strict';function Trunk(_0x303194){this['id']=_0x303194['id']||0x0;this['active']=_0x303194['active']||![];this[_0xf29b('0x0')]=_0x303194[_0xf29b('0x0')]||'';this[_0xf29b('0x1')]=_0xf29b('0x2');this[_0xf29b('0x3')]=0x0;this['status']=_0xf29b('0x2');this['registry']=_0x303194[_0xf29b('0x4')]&&_0x303194[_0xf29b('0x4')]['indexOf'](':')?_0x303194[_0xf29b('0x4')][_0xf29b('0x5')](':')[0x0]:'';this[_0xf29b('0x6')]='';this[_0xf29b('0x7')]='';this[_0xf29b('0x8')]='';this[_0xf29b('0x9')]='';this[_0xf29b('0xa')]='';this[_0xf29b('0xb')]='unknown';this['registrationtime']='';this[_0xf29b('0xc')]='';this[_0xf29b('0xd')]=_0x303194[_0xf29b('0xd')]||'';}module[_0xf29b('0xe')]=Trunk; \ No newline at end of file +var _0xc345=['registrationtime','address','defaultuser','active','name','state','unknown','registry','indexOf','split','host','port','domain','domainport','refresh','stateRegistry'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xc345,0x73));var _0x5c34=function(_0x496ee9,_0x4dba12){_0x496ee9=_0x496ee9-0x0;var _0xb7016a=_0xc345[_0x496ee9];return _0xb7016a;};'use strict';function Trunk(_0x397943){this['id']=_0x397943['id']||0x0;this[_0x5c34('0x0')]=_0x397943['active']||![];this[_0x5c34('0x1')]=_0x397943[_0x5c34('0x1')]||'';this[_0x5c34('0x2')]=_0x5c34('0x3');this['stateTime']=0x0;this['status']=_0x5c34('0x3');this['registry']=_0x397943[_0x5c34('0x4')]&&_0x397943[_0x5c34('0x4')][_0x5c34('0x5')](':')?_0x397943[_0x5c34('0x4')][_0x5c34('0x6')](':')[0x0]:'';this[_0x5c34('0x7')]='';this[_0x5c34('0x8')]='';this[_0x5c34('0x9')]='';this[_0x5c34('0xa')]='';this[_0x5c34('0xb')]='';this[_0x5c34('0xc')]='unknown';this[_0x5c34('0xd')]='';this[_0x5c34('0xe')]='';this[_0x5c34('0xf')]=_0x397943[_0x5c34('0xf')]||'';}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 70db942..d355162 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 _0x352b=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x2f808e,_0x25ccb5){var _0x2e8476=function(_0x44f618){while(--_0x44f618){_0x2f808e['push'](_0x2f808e['shift']());}};_0x2e8476(++_0x25ccb5);}(_0x352b,0x96));var _0xb352=function(_0x189350,_0x4dd997){_0x189350=_0x189350-0x0;var _0x109f5f=_0x352b[_0x189350];return _0x109f5f;};'use strict';function voiceExtension(_0x2c343a){this['id']=_0x2c343a['id']||0x0;this[_0xb352('0x0')]=_0x2c343a['exten']||'';this['recordingFormat']=_0x2c343a[_0xb352('0x1')]||_0xb352('0x2');this[_0xb352('0x3')]=_0x2c343a[_0xb352('0x3')]||![];}module[_0xb352('0x4')]=voiceExtension; \ No newline at end of file +var _0x6dcc=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x6dcc,0x1ee));var _0xc6dc=function(_0x3c3002,_0x1b4de1){_0x3c3002=_0x3c3002-0x0;var _0x4fe4f5=_0x6dcc[_0x3c3002];return _0x4fe4f5;};'use strict';function voiceExtension(_0x2b7e1c){this['id']=_0x2b7e1c['id']||0x0;this['exten']=_0x2b7e1c[_0xc6dc('0x0')]||'';this[_0xc6dc('0x1')]=_0x2b7e1c['recordingFormat']||_0xc6dc('0x2');this['mandatoryDisposition']=_0x2b7e1c[_0xc6dc('0x3')]||![];}module[_0xc6dc('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 2b32273..b779635 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 _0x5b5a=['dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','exports','wav49','gsm','leastrecent','linear','random','ringall','roundrobin','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','inUse','loggedIn','onHold','paused','ringing','ringInUse','talking','unavailable','unknown','acwTimeout','autopause','sendMessageOneNotActive','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry'];(function(_0x5054e2,_0x1f6ff3){var _0x446031=function(_0x40e9ce){while(--_0x40e9ce){_0x5054e2['push'](_0x5054e2['shift']());}};_0x446031(++_0x1f6ff3);}(_0x5b5a,0xc3));var _0xa5b5=function(_0x3df935,_0x2f6877){_0x3df935=_0x3df935-0x0;var _0x152412=_0x5b5a[_0x3df935];return _0x152412;};'use strict';var monitorFormat={'wav':'wav','wav49':_0xa5b5('0x0'),'gsm':_0xa5b5('0x1')};var strategy={'fewestcalls':'fewestcalls','leastrecent':_0xa5b5('0x2'),'linear':_0xa5b5('0x3'),'random':_0xa5b5('0x4'),'ringall':_0xa5b5('0x5'),'rr':_0xa5b5('0x6'),'rrmemory':_0xa5b5('0x7'),'rrordered':_0xa5b5('0x8'),'wrandom':_0xa5b5('0x9')};function VoiceQueue(_0x509b78){this['id']=_0x509b78['id']||0x0;this[_0xa5b5('0xa')]=_0x509b78[_0xa5b5('0xa')]||'';this['monitor_format']=_0x509b78[_0xa5b5('0xb')]||'';this[_0xa5b5('0xc')]=_0x509b78[_0xa5b5('0xc')]||_0xa5b5('0xd');this[_0xa5b5('0xe')]=0x0;this[_0xa5b5('0xf')]=0x0;this[_0xa5b5('0x10')]=0x0;this[_0xa5b5('0x11')]=0x0;this[_0xa5b5('0x12')]=0x0;this[_0xa5b5('0x13')]=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this['available']=0x0;this['busy']=0x0;this[_0xa5b5('0x14')]=0x0;this['invalid']=0x0;this[_0xa5b5('0x15')]=0x0;this['notInUse']=0x0;this[_0xa5b5('0x16')]=0x0;this[_0xa5b5('0x17')]=0x0;this[_0xa5b5('0x18')]=0x0;this[_0xa5b5('0x19')]=0x0;this[_0xa5b5('0x1a')]=0x0;this[_0xa5b5('0x1b')]=0x0;this[_0xa5b5('0x1c')]=0x0;this['acw']=_0x509b78['acw']||![];this[_0xa5b5('0x1d')]=_0x509b78['acwTimeout']||0xa;this[_0xa5b5('0x1e')]=_0x509b78[_0xa5b5('0x1e')]||'no';this[_0xa5b5('0x1f')]=!![];this['message']='';this['statusMessage']='';this['originated']=0x0;this['temp']=0x0;this[_0xa5b5('0x20')]=_0x509b78[_0xa5b5('0x20')]||null;this[_0xa5b5('0x21')]=_0x509b78[_0xa5b5('0x21')]?_0x509b78[_0xa5b5('0x21')]:null;this[_0xa5b5('0x22')]=_0x509b78['dialActive'];this[_0xa5b5('0x23')]=_0x509b78[_0xa5b5('0x23')]||_0xa5b5('0x24');this['dialLimitChannel']=_0x509b78[_0xa5b5('0x25')]||0x0;this[_0xa5b5('0x26')]=_0x509b78[_0xa5b5('0x26')]||0x0;this[_0xa5b5('0x27')]=_0x509b78[_0xa5b5('0x27')]||0x1;this[_0xa5b5('0x28')]=_0x509b78[_0xa5b5('0x28')]||_0xa5b5('0x29');this[_0xa5b5('0x2a')]=_0x509b78[_0xa5b5('0x2a')]||0.03;this[_0xa5b5('0x2b')]=_0x509b78[_0xa5b5('0x2b')]||0x258;this[_0xa5b5('0x2c')]=_0x509b78[_0xa5b5('0x2c')]||_0xa5b5('0x2d');this[_0xa5b5('0x2e')]=_0x509b78[_0xa5b5('0x2e')]||_0xa5b5('0x2d');this[_0xa5b5('0x2f')]=_0x509b78[_0xa5b5('0x2f')]||0x1e;this[_0xa5b5('0x30')]=_0x509b78[_0xa5b5('0x30')]||_0xa5b5('0x31');this[_0xa5b5('0x32')]=_0x509b78[_0xa5b5('0x32')]||0x3;this[_0xa5b5('0x33')]=_0x509b78[_0xa5b5('0x33')]||undefined;this['dialCongestionMaxRetry']=_0x509b78[_0xa5b5('0x34')]||0x3;this[_0xa5b5('0x35')]=_0x509b78[_0xa5b5('0x35')]||0x96;this[_0xa5b5('0x36')]=_0x509b78['dialBusyMaxRetry']||0x3;this[_0xa5b5('0x37')]=_0x509b78[_0xa5b5('0x37')]||0x96;this[_0xa5b5('0x38')]=_0x509b78[_0xa5b5('0x38')]||0x3;this[_0xa5b5('0x39')]=_0x509b78['dialNoAnswerRetryFrequency']||0x96;this[_0xa5b5('0x3a')]=_0x509b78['dialNoSuchNumberMaxRetry']||0x3;this[_0xa5b5('0x3b')]=_0x509b78[_0xa5b5('0x3b')]||0x96;this[_0xa5b5('0x3c')]=_0x509b78['dialDropMaxRetry']||0x3;this[_0xa5b5('0x3d')]=_0x509b78['dialDropRetryFrequency']||0x96;this[_0xa5b5('0x3e')]=_0x509b78[_0xa5b5('0x3e')]||0x3;this[_0xa5b5('0x3f')]=_0x509b78[_0xa5b5('0x3f')]||0x96;this[_0xa5b5('0x40')]=_0x509b78[_0xa5b5('0x40')]||0x3;this['dialMachineRetryFrequency']=_0x509b78[_0xa5b5('0x41')]||0x96;this[_0xa5b5('0x42')]=_0x509b78[_0xa5b5('0x42')]||0x3;this[_0xa5b5('0x43')]=_0x509b78[_0xa5b5('0x43')]||0x96;this[_0xa5b5('0x44')]=_0x509b78['callAdditionalPhoneAfterMin']||0x3;this[_0xa5b5('0x45')]=_0x509b78[_0xa5b5('0x45')]||0x4;this[_0xa5b5('0x46')]=_0x509b78[_0xa5b5('0x46')]?_0x509b78[_0xa5b5('0x46')]:undefined;this[_0xa5b5('0x47')]=_0x509b78[_0xa5b5('0x47')]?_0x509b78[_0xa5b5('0x47')]:undefined;this[_0xa5b5('0x48')]=_0x509b78[_0xa5b5('0x48')]||undefined;this[_0xa5b5('0x49')]=_0x509b78[_0xa5b5('0x49')]?_0x509b78[_0xa5b5('0x49')]:undefined;this[_0xa5b5('0x4a')]=_0x509b78[_0xa5b5('0x4a')]||_0xa5b5('0x4b');this['dialRandomLastDigitCallerIdNumber']=_0x509b78[_0xa5b5('0x4c')]||undefined;this[_0xa5b5('0x4d')]=_0x509b78[_0xa5b5('0x4d')]||undefined;this['strategy']=strategy[_0x509b78[_0xa5b5('0x4e')]];this[_0xa5b5('0x4f')]=!![];this[_0xa5b5('0x50')]=_0x509b78[_0xa5b5('0x50')]||![];this[_0xa5b5('0x51')]=_0x509b78['dialAMDInitialSilence'];this[_0xa5b5('0x52')]=_0x509b78[_0xa5b5('0x52')];this[_0xa5b5('0x53')]=_0x509b78['dialAMDAfterGreetingSilence'];this[_0xa5b5('0x54')]=_0x509b78['dialAMDTotalAnalysisTime'];this[_0xa5b5('0x55')]=_0x509b78[_0xa5b5('0x55')];this[_0xa5b5('0x56')]=_0x509b78[_0xa5b5('0x56')];this[_0xa5b5('0x57')]=_0x509b78[_0xa5b5('0x57')];this[_0xa5b5('0x58')]=_0x509b78[_0xa5b5('0x58')];this[_0xa5b5('0x59')]=_0x509b78['dialAMDMaximumWordLength'];this[_0xa5b5('0x5a')]=0x0;this[_0xa5b5('0x5b')]=0x0;this['timeout']=_0x509b78[_0xa5b5('0x5c')];this[_0xa5b5('0x5d')]=0x0;this[_0xa5b5('0x5e')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0xa5b5('0x5f')]=0x0;this[_0xa5b5('0x60')]=0x0;this[_0xa5b5('0x61')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0xa5b5('0x62')]=0x0;this[_0xa5b5('0x63')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xa5b5('0x64')]=0x0;this[_0xa5b5('0x65')]=0x0;this[_0xa5b5('0x66')]=0x0;this[_0xa5b5('0x67')]=0x0;this[_0xa5b5('0x68')]=undefined;this[_0xa5b5('0x69')]=undefined;this['handlePredictive']=undefined;this[_0xa5b5('0x6a')]=1.05;this[_0xa5b5('0x6b')]=0x0;this[_0xa5b5('0x6c')]=0x0;this[_0xa5b5('0x6d')]=0x0;this[_0xa5b5('0x6e')]=0x0;this[_0xa5b5('0x6f')]=0x0;this[_0xa5b5('0x70')]=0x0;this[_0xa5b5('0x71')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0xa5b5('0x72')]=_0x509b78[_0xa5b5('0x73')]||0x14;this['predictiveIntervalMinThreshold']=_0x509b78['dialPredictiveIntervalMaxThreshold']||0xa;this[_0xa5b5('0x74')]=0x0;this[_0xa5b5('0x75')]=0x0;this[_0xa5b5('0x76')]=0x1;this['erlangCalls']=0x0;this[_0xa5b5('0x77')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xa5b5('0x78')]=0x0;this[_0xa5b5('0x79')]=_0x509b78[_0xa5b5('0x79')]||0x1e;this['dialRecallInQueue']=_0x509b78[_0xa5b5('0x7a')]||![];this[_0xa5b5('0x7b')]=!!_0x509b78[_0xa5b5('0x7b')]||![];this[_0xa5b5('0x7c')]=!!_0x509b78[_0xa5b5('0x7c')]||![];this['dialQueueProject2']=_0x509b78[_0xa5b5('0x7d')]||undefined;this[_0xa5b5('0x7e')]=_0x509b78[_0xa5b5('0x7e')]||![];this[_0xa5b5('0x7f')]=_0x509b78[_0xa5b5('0x7f')]||![];this[_0xa5b5('0xb')]=monitorFormat[_0x509b78[_0xa5b5('0xb')]]?monitorFormat[_0x509b78[_0xa5b5('0xb')]]:undefined;this['mandatoryDisposition']=_0x509b78[_0xa5b5('0x80')]||![];this['mandatoryDispositionPause']=_0x509b78['mandatoryDispositionPause']?_0x509b78['mandatoryDispositionPause']:undefined;this['queueSummaryCountersUpdated']=![];}module[_0xa5b5('0x81')]=VoiceQueue; \ No newline at end of file +var _0x8b8e=['dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','wav','gsm','leastrecent','ringall','roundrobin','rrmemory','rrordered','wrandom','name','monitor_format','type','waiting','sumDuration','sumHoldTime','abandoned','available','busy','inUse','invalid','loggedIn','notInUse','onHold','paused','ringing','ringInUse','talking','unavailable','unknown','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0x8b8e,0x108));var _0xe8b8=function(_0x481821,_0x4814e8){_0x481821=_0x481821-0x0;var _0x4f008d=_0x8b8e[_0x481821];return _0x4f008d;};'use strict';var monitorFormat={'wav':_0xe8b8('0x0'),'wav49':'wav49','gsm':_0xe8b8('0x1')};var strategy={'fewestcalls':'fewestcalls','leastrecent':_0xe8b8('0x2'),'linear':'linear','random':'random','ringall':_0xe8b8('0x3'),'rr':_0xe8b8('0x4'),'rrmemory':_0xe8b8('0x5'),'rrordered':_0xe8b8('0x6'),'wrandom':_0xe8b8('0x7')};function VoiceQueue(_0x3f5dd7){this['id']=_0x3f5dd7['id']||0x0;this[_0xe8b8('0x8')]=_0x3f5dd7[_0xe8b8('0x8')]||'';this[_0xe8b8('0x9')]=_0x3f5dd7[_0xe8b8('0x9')]||'';this['type']=_0x3f5dd7[_0xe8b8('0xa')]||'inbound';this[_0xe8b8('0xb')]=0x0;this['total']=0x0;this['answered']=0x0;this[_0xe8b8('0xc')]=0x0;this[_0xe8b8('0xd')]=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this[_0xe8b8('0xe')]=0x0;this[_0xe8b8('0xf')]=0x0;this[_0xe8b8('0x10')]=0x0;this[_0xe8b8('0x11')]=0x0;this[_0xe8b8('0x12')]=0x0;this[_0xe8b8('0x13')]=0x0;this[_0xe8b8('0x14')]=0x0;this[_0xe8b8('0x15')]=0x0;this[_0xe8b8('0x16')]=0x0;this[_0xe8b8('0x17')]=0x0;this[_0xe8b8('0x18')]=0x0;this[_0xe8b8('0x19')]=0x0;this[_0xe8b8('0x1a')]=0x0;this[_0xe8b8('0x1b')]=0x0;this['acw']=_0x3f5dd7[_0xe8b8('0x1c')]||![];this['acwTimeout']=_0x3f5dd7[_0xe8b8('0x1d')]||0xa;this[_0xe8b8('0x1e')]=_0x3f5dd7[_0xe8b8('0x1e')]||'no';this[_0xe8b8('0x1f')]=!![];this[_0xe8b8('0x20')]='';this[_0xe8b8('0x21')]='';this[_0xe8b8('0x22')]=0x0;this[_0xe8b8('0x23')]=0x0;this[_0xe8b8('0x24')]=_0x3f5dd7[_0xe8b8('0x24')]||null;this['dialGlobalInterval']=_0x3f5dd7[_0xe8b8('0x25')]?_0x3f5dd7[_0xe8b8('0x25')]:null;this['dialActive']=_0x3f5dd7[_0xe8b8('0x26')];this[_0xe8b8('0x27')]=_0x3f5dd7[_0xe8b8('0x27')]||_0xe8b8('0x28');this[_0xe8b8('0x29')]=_0x3f5dd7[_0xe8b8('0x29')]||0x0;this[_0xe8b8('0x2a')]=_0x3f5dd7[_0xe8b8('0x2a')]||0x0;this[_0xe8b8('0x2b')]=_0x3f5dd7[_0xe8b8('0x2b')]||0x1;this[_0xe8b8('0x2c')]=_0x3f5dd7[_0xe8b8('0x2c')]||_0xe8b8('0x2d');this[_0xe8b8('0x2e')]=_0x3f5dd7[_0xe8b8('0x2e')]||0.03;this[_0xe8b8('0x2f')]=_0x3f5dd7[_0xe8b8('0x2f')]||0x258;this['dialOriginateCallerIdName']=_0x3f5dd7['dialOriginateCallerIdName']||'anonymous';this[_0xe8b8('0x30')]=_0x3f5dd7['dialOriginateCallerIdNumber']||_0xe8b8('0x31');this['dialOriginateTimeout']=_0x3f5dd7[_0xe8b8('0x32')]||0x1e;this[_0xe8b8('0x33')]=_0x3f5dd7['dialQueueOptions']||'tTxX';this[_0xe8b8('0x34')]=_0x3f5dd7[_0xe8b8('0x34')]||0x3;this['dialQueueProject']=_0x3f5dd7[_0xe8b8('0x35')]||undefined;this[_0xe8b8('0x36')]=_0x3f5dd7[_0xe8b8('0x36')]||0x3;this[_0xe8b8('0x37')]=_0x3f5dd7[_0xe8b8('0x37')]||0x96;this['dialBusyMaxRetry']=_0x3f5dd7[_0xe8b8('0x38')]||0x3;this['dialBusyRetryFrequency']=_0x3f5dd7[_0xe8b8('0x39')]||0x96;this[_0xe8b8('0x3a')]=_0x3f5dd7[_0xe8b8('0x3a')]||0x3;this[_0xe8b8('0x3b')]=_0x3f5dd7['dialNoAnswerRetryFrequency']||0x96;this['dialNoSuchNumberMaxRetry']=_0x3f5dd7[_0xe8b8('0x3c')]||0x3;this[_0xe8b8('0x3d')]=_0x3f5dd7[_0xe8b8('0x3d')]||0x96;this[_0xe8b8('0x3e')]=_0x3f5dd7[_0xe8b8('0x3e')]||0x3;this['dialDropRetryFrequency']=_0x3f5dd7[_0xe8b8('0x3f')]||0x96;this[_0xe8b8('0x40')]=_0x3f5dd7[_0xe8b8('0x40')]||0x3;this[_0xe8b8('0x41')]=_0x3f5dd7[_0xe8b8('0x41')]||0x96;this[_0xe8b8('0x42')]=_0x3f5dd7[_0xe8b8('0x42')]||0x3;this[_0xe8b8('0x43')]=_0x3f5dd7[_0xe8b8('0x43')]||0x96;this[_0xe8b8('0x44')]=_0x3f5dd7[_0xe8b8('0x44')]||0x3;this['dialAgentRejectRetryFrequency']=_0x3f5dd7[_0xe8b8('0x45')]||0x96;this[_0xe8b8('0x46')]=_0x3f5dd7[_0xe8b8('0x46')]||0x3;this['dialGlobalMaxRetry']=_0x3f5dd7[_0xe8b8('0x47')]||0x4;this[_0xe8b8('0x48')]=_0x3f5dd7[_0xe8b8('0x48')]?_0x3f5dd7[_0xe8b8('0x48')]:undefined;this[_0xe8b8('0x49')]=_0x3f5dd7[_0xe8b8('0x49')]?_0x3f5dd7[_0xe8b8('0x49')]:undefined;this[_0xe8b8('0x4a')]=_0x3f5dd7[_0xe8b8('0x4a')]||undefined;this['Interval']=_0x3f5dd7[_0xe8b8('0x4b')]?_0x3f5dd7[_0xe8b8('0x4b')]:undefined;this['dialOrderByScheduledAt']=_0x3f5dd7[_0xe8b8('0x4c')]||_0xe8b8('0x4d');this[_0xe8b8('0x4e')]=_0x3f5dd7[_0xe8b8('0x4e')]||undefined;this[_0xe8b8('0x4f')]=_0x3f5dd7['dialCutDigit']||undefined;this[_0xe8b8('0x50')]=strategy[_0x3f5dd7[_0xe8b8('0x50')]];this[_0xe8b8('0x51')]=!![];this[_0xe8b8('0x52')]=_0x3f5dd7[_0xe8b8('0x52')]||![];this[_0xe8b8('0x53')]=_0x3f5dd7['dialAMDInitialSilence'];this[_0xe8b8('0x54')]=_0x3f5dd7['dialAMDGreeting'];this[_0xe8b8('0x55')]=_0x3f5dd7[_0xe8b8('0x55')];this['dialAMDTotalAnalysisTime']=_0x3f5dd7['dialAMDTotalAnalysisTime'];this[_0xe8b8('0x56')]=_0x3f5dd7[_0xe8b8('0x56')];this[_0xe8b8('0x57')]=_0x3f5dd7[_0xe8b8('0x57')];this['dialAMDMaximumNumberOfWords']=_0x3f5dd7[_0xe8b8('0x58')];this[_0xe8b8('0x59')]=_0x3f5dd7[_0xe8b8('0x59')];this[_0xe8b8('0x5a')]=_0x3f5dd7[_0xe8b8('0x5a')];this[_0xe8b8('0x5b')]=0x0;this[_0xe8b8('0x5c')]=0x0;this[_0xe8b8('0x5d')]=_0x3f5dd7['timeout'];this['outboundAnswerCallsDay']=0x0;this[_0xe8b8('0x5e')]=0x0;this[_0xe8b8('0x5f')]=0x0;this[_0xe8b8('0x60')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xe8b8('0x61')]=0x0;this[_0xe8b8('0x62')]=0x0;this[_0xe8b8('0x63')]=0x0;this[_0xe8b8('0x64')]=0x0;this[_0xe8b8('0x65')]=0x0;this[_0xe8b8('0x66')]=0x0;this[_0xe8b8('0x67')]=0x0;this['outboundReCallsDay']=0x0;this['outboundAbandonedDay']=0x0;this['startProgressive']=undefined;this[_0xe8b8('0x68')]=undefined;this[_0xe8b8('0x69')]=undefined;this[_0xe8b8('0x6a')]=1.05;this[_0xe8b8('0x6b')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0xe8b8('0x6c')]=0x0;this[_0xe8b8('0x6d')]=0x0;this[_0xe8b8('0x6e')]=0x0;this[_0xe8b8('0x6f')]=0x0;this['predictiveIntervalPauses']=0x0;this['predictiveIntervalAvailable']=0x0;this[_0xe8b8('0x70')]=_0x3f5dd7[_0xe8b8('0x71')]||0x14;this[_0xe8b8('0x72')]=_0x3f5dd7['dialPredictiveIntervalMaxThreshold']||0xa;this[_0xe8b8('0x73')]=0x0;this[_0xe8b8('0x74')]=0x0;this[_0xe8b8('0x75')]=0x1;this[_0xe8b8('0x76')]=0x0;this['erlangCallToSecond']=0x0;this[_0xe8b8('0x77')]=0x0;this[_0xe8b8('0x78')]=0x0;this[_0xe8b8('0x79')]=_0x3f5dd7[_0xe8b8('0x79')]||0x1e;this[_0xe8b8('0x7a')]=_0x3f5dd7[_0xe8b8('0x7a')]||![];this[_0xe8b8('0x7b')]=!!_0x3f5dd7[_0xe8b8('0x7b')]||![];this[_0xe8b8('0x7c')]=!!_0x3f5dd7[_0xe8b8('0x7c')]||![];this[_0xe8b8('0x7d')]=_0x3f5dd7[_0xe8b8('0x7d')]||undefined;this['dialAgiAfterHangupClient']=_0x3f5dd7['dialAgiAfterHangupClient']||![];this[_0xe8b8('0x7e')]=_0x3f5dd7[_0xe8b8('0x7e')]||![];this[_0xe8b8('0x9')]=monitorFormat[_0x3f5dd7[_0xe8b8('0x9')]]?monitorFormat[_0x3f5dd7[_0xe8b8('0x9')]]:undefined;this[_0xe8b8('0x7f')]=_0x3f5dd7[_0xe8b8('0x7f')]||![];this['mandatoryDispositionPause']=_0x3f5dd7['mandatoryDispositionPause']?_0x3f5dd7[_0xe8b8('0x80')]:undefined;this[_0xe8b8('0x81')]=![];}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index 4ae19e1..2aa03c8 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6b4e=['busy','invalid','onHold','paused','ringing','ringInUse','sumBillable','sumDuration','sumHoldTime','total','type','unavailable','unknown','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','createReport','notInUse','loggedin','callers','online','incall','includes','status','booked','keys','length','queue','dialer','exten','xcally-motion-preview','compareToInboundQueue','prototype','compareToOutboundQueue','some','exports','loggedIn','waiting','available','answered','inUse','loggedInDb','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','talking','name','strategy','abandoned'];(function(_0x5de1e1,_0x42d021){var _0x52ab25=function(_0x5ab2cc){while(--_0x5ab2cc){_0x5de1e1['push'](_0x5de1e1['shift']());}};_0x52ab25(++_0x42d021);}(_0x6b4e,0x1a8));var _0xe6b4=function(_0x125dec,_0x4bacb8){_0x125dec=_0x125dec-0x0;var _0x31b390=_0x6b4e[_0x125dec];return _0x31b390;};'use strict';var INBOUND_COUNTERS=['available',_0xe6b4('0x0'),'loggedInDb','paused','ringing','talking',_0xe6b4('0x1')];var OUTBOUND_COUNTERS=[_0xe6b4('0x2'),_0xe6b4('0x3'),_0xe6b4('0x4'),_0xe6b4('0x0'),_0xe6b4('0x5'),'originated',_0xe6b4('0x6'),_0xe6b4('0x7'),_0xe6b4('0x8'),_0xe6b4('0x9'),_0xe6b4('0xa'),_0xe6b4('0xb'),_0xe6b4('0xc'),_0xe6b4('0xd'),_0xe6b4('0xe'),_0xe6b4('0xf'),'paused',_0xe6b4('0x10'),_0xe6b4('0x11'),'sumBillable','sumDuration','total',_0xe6b4('0x1')];function VoiceQueueSummary(_0x1519c0){this['id']=_0x1519c0['id'];this['name']=_0x1519c0[_0xe6b4('0x12')];this[_0xe6b4('0x13')]=_0x1519c0[_0xe6b4('0x13')];this[_0xe6b4('0x14')]=_0x1519c0[_0xe6b4('0x14')]||0x0;this['answered']=_0x1519c0[_0xe6b4('0x3')]||0x0;this[_0xe6b4('0x2')]=_0x1519c0[_0xe6b4('0x2')]||0x0;this[_0xe6b4('0x15')]=_0x1519c0['busy']||0x0;this[_0xe6b4('0x4')]=_0x1519c0[_0xe6b4('0x4')]||0x0;this[_0xe6b4('0x16')]=_0x1519c0[_0xe6b4('0x16')]||0x0;this[_0xe6b4('0x0')]=_0x1519c0['loggedIn']||0x0;this[_0xe6b4('0x5')]=_0x1519c0[_0xe6b4('0x5')]||0x0;this[_0xe6b4('0x17')]=_0x1519c0['onHold']||0x0;this['notInUse']=_0x1519c0['notInUse']||0x0;this[_0xe6b4('0x18')]=_0x1519c0['paused']||0x0;this['ringing']=_0x1519c0[_0xe6b4('0x19')]||0x0;this['ringInUse']=_0x1519c0[_0xe6b4('0x1a')];this[_0xe6b4('0x1b')]=_0x1519c0[_0xe6b4('0x1b')];this[_0xe6b4('0x1c')]=_0x1519c0[_0xe6b4('0x1c')];this[_0xe6b4('0x1d')]=_0x1519c0[_0xe6b4('0x1d')]||0x0;this[_0xe6b4('0x11')]=_0x1519c0['talking']||0x0;this[_0xe6b4('0x1e')]=_0x1519c0['total']||0x0;this[_0xe6b4('0x1f')]=_0x1519c0[_0xe6b4('0x1f')];this[_0xe6b4('0x20')]=_0x1519c0[_0xe6b4('0x20')]||0x0;this[_0xe6b4('0x21')]=_0x1519c0['unknown']||0x0;this['unmanaged']=_0x1519c0['unmanaged']||0x0;this[_0xe6b4('0x1')]=_0x1519c0['waiting']||0x0;if(_0x1519c0[_0xe6b4('0x1f')]===_0xe6b4('0x22')){this[_0xe6b4('0x10')]=_0x1519c0[_0xe6b4('0x10')]||0x0;this['dialActive']=_0x1519c0[_0xe6b4('0x23')];this[_0xe6b4('0x24')]=_0x1519c0[_0xe6b4('0x24')];this['dialOriginateCallerIdName']=_0x1519c0[_0xe6b4('0x25')];this['dialOriginateCallerIdNumber']=_0x1519c0[_0xe6b4('0x26')];this[_0xe6b4('0x27')]=_0x1519c0['dialOriginateTimeout'];this[_0xe6b4('0x28')]=_0x1519c0[_0xe6b4('0x28')];this[_0xe6b4('0x29')]=_0x1519c0['temp'];this['outboundAnswerAgiCallsDay']=_0x1519c0[_0xe6b4('0x2a')];this[_0xe6b4('0x7')]=_0x1519c0[_0xe6b4('0x7')];this[_0xe6b4('0x8')]=_0x1519c0[_0xe6b4('0x8')];this[_0xe6b4('0x9')]=_0x1519c0[_0xe6b4('0x9')];this[_0xe6b4('0xa')]=_0x1519c0[_0xe6b4('0xa')];this['outboundDropCallsDayACS']=_0x1519c0['outboundDropCallsDayACS'];this[_0xe6b4('0x2b')]=_0x1519c0[_0xe6b4('0x2b')];this['outboundDropCallsDayTimeout']=_0x1519c0[_0xe6b4('0x2c')];this[_0xe6b4('0xb')]=_0x1519c0[_0xe6b4('0xb')];this['outboundNoSuchCallsDay']=_0x1519c0[_0xe6b4('0xc')];this[_0xe6b4('0x2d')]=_0x1519c0[_0xe6b4('0x2d')];this[_0xe6b4('0xd')]=_0x1519c0[_0xe6b4('0xd')];this[_0xe6b4('0xe')]=_0x1519c0[_0xe6b4('0xe')];this['outboundUnknownCallsDay']=_0x1519c0[_0xe6b4('0xf')];this[_0xe6b4('0x2e')]=_0x1519c0[_0xe6b4('0x2e')];this['predictiveIntervalAvgHoldtime']=_0x1519c0[_0xe6b4('0x2f')];this[_0xe6b4('0x30')]=_0x1519c0['predictiveIntervalAvgTalktime'];this[_0xe6b4('0x31')]=_0x1519c0[_0xe6b4('0x31')];this[_0xe6b4('0x32')]=_0x1519c0[_0xe6b4('0x32')];this['predictiveIntervalErlangCalls']=_0x1519c0[_0xe6b4('0x33')];this[_0xe6b4('0x34')]=_0x1519c0[_0xe6b4('0x34')];this['predictiveIntervalHitRate']=_0x1519c0[_0xe6b4('0x35')];this['predictiveIntervalMultiplicativeFactor']=_0x1519c0[_0xe6b4('0x36')];this['predictiveIntervalPauses']=_0x1519c0['predictiveIntervalPauses'];this[_0xe6b4('0x37')]=_0x1519c0[_0xe6b4('0x37')];this[_0xe6b4('0x38')]=_0x1519c0['predictiveIntervalTotalCalls'];this[_0xe6b4('0x39')]=_0x1519c0[_0xe6b4('0x39')];this[_0xe6b4('0x3a')]=_0x1519c0[_0xe6b4('0x3a')];this[_0xe6b4('0x3b')]=_0x1519c0[_0xe6b4('0x3b')];this[_0xe6b4('0x3c')]=_0x1519c0[_0xe6b4('0x3c')];this[_0xe6b4('0x3d')]=_0x1519c0['erlangBusyFactor'];this[_0xe6b4('0x3e')]=_0x1519c0['startPredictive'];this['startProgressive']=_0x1519c0[_0xe6b4('0x3f')];this[_0xe6b4('0x40')]=_0x1519c0[_0xe6b4('0x40')];this[_0xe6b4('0x41')]=_0x1519c0['statusMessage'];}if(_0x1519c0[_0xe6b4('0x42')]){this[_0xe6b4('0x42')]={'id':_0x1519c0[_0xe6b4('0x42')]['id'],'name':_0x1519c0['Trunk'][_0xe6b4('0x12')],'active':_0x1519c0[_0xe6b4('0x42')][_0xe6b4('0x43')],'callerid':_0x1519c0[_0xe6b4('0x42')][_0xe6b4('0x44')]};}}VoiceQueueSummary['prototype'][_0xe6b4('0x45')]=function(_0x5bdd9d,_0x1538a7,_0x3ea04f,_0x3e7189){this['loggedInDb']=0x0;this[_0xe6b4('0x11')]=0x0;this['paused']=0x0;this[_0xe6b4('0x21')]=0x0;this[_0xe6b4('0x46')]=0x0;this[_0xe6b4('0x4')]=0x0;this[_0xe6b4('0x15')]=0x0;this[_0xe6b4('0x16')]=0x0;this[_0xe6b4('0x20')]=0x0;this[_0xe6b4('0x19')]=0x0;this[_0xe6b4('0x1a')]=0x0;this['onHold']=0x0;if(_0x3ea04f){if(_0x3ea04f[_0xe6b4('0x2')]){this['available']=Number(_0x3ea04f[_0xe6b4('0x2')]);}if(_0x3ea04f[_0xe6b4('0x47')]){this[_0xe6b4('0x0')]=Number(_0x3ea04f[_0xe6b4('0x47')]);}if(_0x3ea04f[_0xe6b4('0x48')]){this[_0xe6b4('0x1')]=Number(_0x3ea04f[_0xe6b4('0x48')]);}}for(var _0x4ecb9c=0x0;_0x4ecb9c<_0x5bdd9d['length'];_0x4ecb9c++){var _0x1ee558=_0x1538a7['SIP/'+_0x5bdd9d[_0x4ecb9c][_0xe6b4('0x12')]];if(_0x1ee558&&_0x1ee558[_0xe6b4('0x49')]){this[_0xe6b4('0x5')]+=0x1;}if(_0x5bdd9d[_0x4ecb9c][_0xe6b4('0x4a')]==='1'){this[_0xe6b4('0x11')]+=0x1;}if(_0x5bdd9d[_0x4ecb9c][_0xe6b4('0x18')]==='1'&&!['2','7','8'][_0xe6b4('0x4b')](_0x5bdd9d[_0x4ecb9c][_0xe6b4('0x4c')])){this[_0xe6b4('0x18')]+=0x1;}switch(_0x5bdd9d[_0x4ecb9c][_0xe6b4('0x4c')]){case'0':this['unknown']+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this[_0xe6b4('0x4')]+=0x1;break;case'3':this[_0xe6b4('0x15')]+=0x1;break;case'4':this[_0xe6b4('0x16')]+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this[_0xe6b4('0x19')]+=0x1;break;case'7':this[_0xe6b4('0x1a')]+=0x1;break;case'8':this[_0xe6b4('0x17')]+=0x1;break;}}if(this[_0xe6b4('0x24')]===_0xe6b4('0x4d')){var _0x407734=Object[_0xe6b4('0x4e')](_0x3e7189);for(var _0x299387=0x0;_0x299387<_0x407734[_0xe6b4('0x4f')];_0x299387++){var _0x447b53=_0x407734[_0x299387];var _0x2e3813=_0x3e7189[_0x447b53];if(_0x2e3813[_0xe6b4('0x50')]===this[_0xe6b4('0x12')]&&_0x2e3813[_0xe6b4('0x1f')]===_0xe6b4('0x51')&&_0x2e3813[_0xe6b4('0x52')]===_0xe6b4('0x53')){this[_0xe6b4('0x11')]+=0x1;}}if(this[_0xe6b4('0x11')]>this[_0xe6b4('0x4')]){this['talking']=this['inUse'];}this[_0xe6b4('0x10')]=0x0;}return this;};VoiceQueueSummary['prototype'][_0xe6b4('0x54')]=function(_0x1c815a){var _0xbca01f=![];if(_0x1c815a){_0xbca01f=INBOUND_COUNTERS['some'](function(_0x15c03a){return this[_0x15c03a]!==_0x1c815a[_0x15c03a];},this);}return _0xbca01f;};VoiceQueueSummary[_0xe6b4('0x55')][_0xe6b4('0x56')]=function(_0x181401){var _0x74f7d8=![];var _0xe5773e=![];var _0x74a8dd=![];if(_0x181401){_0x74f7d8=this['dialMethod']!==_0x181401[_0xe6b4('0x24')]||this[_0xe6b4('0x23')]!==_0x181401[_0xe6b4('0x23')]||this[_0xe6b4('0x40')]!==_0x181401[_0xe6b4('0x40')]||this['statusMessage']!==_0x181401[_0xe6b4('0x41')];_0xe5773e=OUTBOUND_COUNTERS[_0xe6b4('0x57')](function(_0xc9b063){return this[_0xc9b063]!==_0x181401[_0xc9b063];},this);if(this[_0xe6b4('0x42')]&&_0x181401[_0xe6b4('0x42')]){_0x74a8dd=this[_0xe6b4('0x42')][_0xe6b4('0x12')]!==_0x181401[_0xe6b4('0x42')][_0xe6b4('0x12')]||this['Trunk']['active']!==_0x181401[_0xe6b4('0x42')]['active'];}}return _0x74f7d8||_0xe5773e||_0x74a8dd;};VoiceQueueSummary[_0xe6b4('0x55')]['updateReportFromOutboundQueue']=function(_0x4c70ea){this[_0xe6b4('0x3')]=_0x4c70ea[_0xe6b4('0x3')];this[_0xe6b4('0x40')]=_0x4c70ea[_0xe6b4('0x40')];this[_0xe6b4('0x41')]=_0x4c70ea['statusMessage'];this[_0xe6b4('0x39')]=_0x4c70ea[_0xe6b4('0x39')];this[_0xe6b4('0x6')]=_0x4c70ea[_0xe6b4('0x6')];this['outboundAnswerCallsDay']=_0x4c70ea['outboundAnswerCallsDay'];this[_0xe6b4('0x8')]=_0x4c70ea['outboundBlacklistCallsDay'];this['outboundBusyCallsDay']=_0x4c70ea[_0xe6b4('0x9')];this[_0xe6b4('0xa')]=_0x4c70ea[_0xe6b4('0xa')];this[_0xe6b4('0xb')]=_0x4c70ea[_0xe6b4('0xb')];this[_0xe6b4('0xc')]=_0x4c70ea[_0xe6b4('0xc')];this[_0xe6b4('0xd')]=_0x4c70ea[_0xe6b4('0xd')];this[_0xe6b4('0xe')]=_0x4c70ea[_0xe6b4('0xe')];this[_0xe6b4('0xf')]=_0x4c70ea[_0xe6b4('0xf')];this[_0xe6b4('0x1b')]=_0x4c70ea[_0xe6b4('0x1b')];this[_0xe6b4('0x1c')]=_0x4c70ea['sumDuration'];this[_0xe6b4('0x1e')]=_0x4c70ea[_0xe6b4('0x1e')];if(this[_0xe6b4('0x24')]==='preview'){this[_0xe6b4('0x10')]=_0x4c70ea['pTalking'];}};module[_0xe6b4('0x58')]=VoiceQueueSummary; \ No newline at end of file +var _0xa41a=['createReport','callers','length','online','incall','includes','status','booked','queue','dialer','exten','xcally-motion-preview','prototype','compareToInboundQueue','some','compareToOutboundQueue','dialActive','updateReportFromOutboundQueue','outboundNoAnswerCallsDay','preview','available','loggedIn','paused','ringing','talking','waiting','answered','inUse','originated','outboundAbandonedCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','strategy','abandoned','busy','invalid','loggedInDb','onHold','notInUse','ringInUse','sumHoldTime','total','type','unavailable','unknown','unmanaged','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','message','statusMessage','Trunk','name','active','callerid'];(function(_0x2c3a47,_0x170687){var _0x1c04de=function(_0x367deb){while(--_0x367deb){_0x2c3a47['push'](_0x2c3a47['shift']());}};_0x1c04de(++_0x170687);}(_0xa41a,0x6b));var _0xaa41=function(_0x23bb94,_0x250cb1){_0x23bb94=_0x23bb94-0x0;var _0x138821=_0xa41a[_0x23bb94];return _0x138821;};'use strict';var INBOUND_COUNTERS=[_0xaa41('0x0'),_0xaa41('0x1'),'loggedInDb',_0xaa41('0x2'),_0xaa41('0x3'),_0xaa41('0x4'),_0xaa41('0x5')];var OUTBOUND_COUNTERS=[_0xaa41('0x0'),_0xaa41('0x6'),_0xaa41('0x7'),_0xaa41('0x1'),'loggedInDb',_0xaa41('0x8'),_0xaa41('0x9'),'outboundAnswerCallsDay','outboundBlacklistCallsDay',_0xaa41('0xa'),_0xaa41('0xb'),'outboundNoAnswerCallsDay',_0xaa41('0xc'),_0xaa41('0xd'),_0xaa41('0xe'),_0xaa41('0xf'),_0xaa41('0x2'),_0xaa41('0x10'),_0xaa41('0x4'),_0xaa41('0x11'),_0xaa41('0x12'),'total',_0xaa41('0x5')];function VoiceQueueSummary(_0x10cda9){this['id']=_0x10cda9['id'];this['name']=_0x10cda9['name'];this[_0xaa41('0x13')]=_0x10cda9['strategy'];this[_0xaa41('0x14')]=_0x10cda9[_0xaa41('0x14')]||0x0;this[_0xaa41('0x6')]=_0x10cda9[_0xaa41('0x6')]||0x0;this[_0xaa41('0x0')]=_0x10cda9['available']||0x0;this[_0xaa41('0x15')]=_0x10cda9[_0xaa41('0x15')]||0x0;this[_0xaa41('0x7')]=_0x10cda9[_0xaa41('0x7')]||0x0;this[_0xaa41('0x16')]=_0x10cda9[_0xaa41('0x16')]||0x0;this[_0xaa41('0x1')]=_0x10cda9['loggedIn']||0x0;this[_0xaa41('0x17')]=_0x10cda9[_0xaa41('0x17')]||0x0;this[_0xaa41('0x18')]=_0x10cda9[_0xaa41('0x18')]||0x0;this[_0xaa41('0x19')]=_0x10cda9[_0xaa41('0x19')]||0x0;this[_0xaa41('0x2')]=_0x10cda9[_0xaa41('0x2')]||0x0;this[_0xaa41('0x3')]=_0x10cda9['ringing']||0x0;this['ringInUse']=_0x10cda9[_0xaa41('0x1a')];this[_0xaa41('0x11')]=_0x10cda9[_0xaa41('0x11')];this['sumDuration']=_0x10cda9[_0xaa41('0x12')];this[_0xaa41('0x1b')]=_0x10cda9['sumHoldTime']||0x0;this['talking']=_0x10cda9[_0xaa41('0x4')]||0x0;this['total']=_0x10cda9[_0xaa41('0x1c')]||0x0;this[_0xaa41('0x1d')]=_0x10cda9[_0xaa41('0x1d')];this[_0xaa41('0x1e')]=_0x10cda9[_0xaa41('0x1e')]||0x0;this['unknown']=_0x10cda9[_0xaa41('0x1f')]||0x0;this[_0xaa41('0x20')]=_0x10cda9[_0xaa41('0x20')]||0x0;this[_0xaa41('0x5')]=_0x10cda9[_0xaa41('0x5')]||0x0;if(_0x10cda9[_0xaa41('0x1d')]==='outbound'){this['pTalking']=_0x10cda9[_0xaa41('0x10')]||0x0;this['dialActive']=_0x10cda9['dialActive'];this[_0xaa41('0x21')]=_0x10cda9['dialMethod'];this['dialOriginateCallerIdName']=_0x10cda9[_0xaa41('0x22')];this[_0xaa41('0x23')]=_0x10cda9[_0xaa41('0x23')];this[_0xaa41('0x24')]=_0x10cda9[_0xaa41('0x24')];this[_0xaa41('0x25')]=_0x10cda9['dialPrefix'];this[_0xaa41('0x26')]=_0x10cda9[_0xaa41('0x26')];this[_0xaa41('0x27')]=_0x10cda9[_0xaa41('0x27')];this[_0xaa41('0x28')]=_0x10cda9[_0xaa41('0x28')];this[_0xaa41('0x29')]=_0x10cda9[_0xaa41('0x29')];this['outboundBusyCallsDay']=_0x10cda9[_0xaa41('0xa')];this['outboundCongestionCallsDay']=_0x10cda9['outboundCongestionCallsDay'];this[_0xaa41('0x2a')]=_0x10cda9[_0xaa41('0x2a')];this['outboundDropCallsDayCallersExit']=_0x10cda9[_0xaa41('0x2b')];this[_0xaa41('0x2c')]=_0x10cda9['outboundDropCallsDayTimeout'];this['outboundNoAnswerCallsDay']=_0x10cda9['outboundNoAnswerCallsDay'];this[_0xaa41('0xc')]=_0x10cda9[_0xaa41('0xc')];this[_0xaa41('0x2d')]=_0x10cda9[_0xaa41('0x2d')];this['outboundReCallsDay']=_0x10cda9[_0xaa41('0xd')];this[_0xaa41('0xe')]=_0x10cda9[_0xaa41('0xe')];this['outboundUnknownCallsDay']=_0x10cda9[_0xaa41('0xf')];this[_0xaa41('0x2e')]=_0x10cda9[_0xaa41('0x2e')];this['predictiveIntervalAvgHoldtime']=_0x10cda9[_0xaa41('0x2f')];this[_0xaa41('0x30')]=_0x10cda9['predictiveIntervalAvgTalktime'];this[_0xaa41('0x31')]=_0x10cda9[_0xaa41('0x31')];this[_0xaa41('0x32')]=_0x10cda9['predictiveIntervalDroppedCallsTimeout'];this[_0xaa41('0x33')]=_0x10cda9['predictiveIntervalErlangCalls'];this[_0xaa41('0x34')]=_0x10cda9[_0xaa41('0x34')];this[_0xaa41('0x35')]=_0x10cda9['predictiveIntervalHitRate'];this['predictiveIntervalMultiplicativeFactor']=_0x10cda9['predictiveIntervalMultiplicativeFactor'];this[_0xaa41('0x36')]=_0x10cda9[_0xaa41('0x36')];this[_0xaa41('0x37')]=_0x10cda9[_0xaa41('0x37')];this['predictiveIntervalTotalCalls']=_0x10cda9['predictiveIntervalTotalCalls'];this[_0xaa41('0x8')]=_0x10cda9[_0xaa41('0x8')];this[_0xaa41('0x38')]=_0x10cda9[_0xaa41('0x38')];this[_0xaa41('0x39')]=_0x10cda9[_0xaa41('0x39')];this[_0xaa41('0x3a')]=_0x10cda9['erlangAbandonmentRate'];this[_0xaa41('0x3b')]=_0x10cda9[_0xaa41('0x3b')];this[_0xaa41('0x3c')]=_0x10cda9[_0xaa41('0x3c')];this['startProgressive']=_0x10cda9['startProgressive'];this[_0xaa41('0x3d')]=_0x10cda9[_0xaa41('0x3d')];this['statusMessage']=_0x10cda9[_0xaa41('0x3e')];}if(_0x10cda9['Trunk']){this[_0xaa41('0x3f')]={'id':_0x10cda9[_0xaa41('0x3f')]['id'],'name':_0x10cda9[_0xaa41('0x3f')][_0xaa41('0x40')],'active':_0x10cda9[_0xaa41('0x3f')][_0xaa41('0x41')],'callerid':_0x10cda9[_0xaa41('0x3f')][_0xaa41('0x42')]};}}VoiceQueueSummary['prototype'][_0xaa41('0x43')]=function(_0x2abf39,_0x35c685,_0x398c35,_0xc84fb8){this[_0xaa41('0x17')]=0x0;this['talking']=0x0;this['paused']=0x0;this[_0xaa41('0x1f')]=0x0;this['notInUse']=0x0;this[_0xaa41('0x7')]=0x0;this[_0xaa41('0x15')]=0x0;this[_0xaa41('0x16')]=0x0;this[_0xaa41('0x1e')]=0x0;this[_0xaa41('0x3')]=0x0;this[_0xaa41('0x1a')]=0x0;this[_0xaa41('0x18')]=0x0;if(_0x398c35){if(_0x398c35['available']){this[_0xaa41('0x0')]=Number(_0x398c35['available']);}if(_0x398c35['loggedin']){this[_0xaa41('0x1')]=Number(_0x398c35['loggedin']);}if(_0x398c35['callers']){this['waiting']=Number(_0x398c35[_0xaa41('0x44')]);}}for(var _0x525b09=0x0;_0x525b09<_0x2abf39[_0xaa41('0x45')];_0x525b09++){var _0x198716=_0x35c685['SIP/'+_0x2abf39[_0x525b09]['name']];if(_0x198716&&_0x198716[_0xaa41('0x46')]){this[_0xaa41('0x17')]+=0x1;}if(_0x2abf39[_0x525b09][_0xaa41('0x47')]==='1'){this[_0xaa41('0x4')]+=0x1;}if(_0x2abf39[_0x525b09][_0xaa41('0x2')]==='1'&&!['2','7','8'][_0xaa41('0x48')](_0x2abf39[_0x525b09][_0xaa41('0x49')])){this[_0xaa41('0x2')]+=0x1;}switch(_0x2abf39[_0x525b09][_0xaa41('0x49')]){case'0':this['unknown']+=0x1;break;case'1':this[_0xaa41('0x19')]+=0x1;break;case'2':this[_0xaa41('0x7')]+=0x1;break;case'3':this[_0xaa41('0x15')]+=0x1;break;case'4':this[_0xaa41('0x16')]+=0x1;break;case'5':this[_0xaa41('0x1e')]+=0x1;break;case'6':this[_0xaa41('0x3')]+=0x1;break;case'7':this['ringInUse']+=0x1;break;case'8':this[_0xaa41('0x18')]+=0x1;break;}}if(this[_0xaa41('0x21')]===_0xaa41('0x4a')){var _0x2288f8=Object['keys'](_0xc84fb8);for(var _0x23bc61=0x0;_0x23bc61<_0x2288f8['length'];_0x23bc61++){var _0x49fedd=_0x2288f8[_0x23bc61];var _0x1415f5=_0xc84fb8[_0x49fedd];if(_0x1415f5[_0xaa41('0x4b')]===this[_0xaa41('0x40')]&&_0x1415f5['type']===_0xaa41('0x4c')&&_0x1415f5[_0xaa41('0x4d')]===_0xaa41('0x4e')){this['talking']+=0x1;}}if(this[_0xaa41('0x4')]>this[_0xaa41('0x7')]){this[_0xaa41('0x4')]=this[_0xaa41('0x7')];}this[_0xaa41('0x10')]=0x0;}return this;};VoiceQueueSummary[_0xaa41('0x4f')][_0xaa41('0x50')]=function(_0x16caf9){var _0x4eab60=![];if(_0x16caf9){_0x4eab60=INBOUND_COUNTERS[_0xaa41('0x51')](function(_0x5bef5f){return this[_0x5bef5f]!==_0x16caf9[_0x5bef5f];},this);}return _0x4eab60;};VoiceQueueSummary['prototype'][_0xaa41('0x52')]=function(_0x446b){var _0x3fef3e=![];var _0x11f7d9=![];var _0x14aab0=![];if(_0x446b){_0x3fef3e=this[_0xaa41('0x21')]!==_0x446b[_0xaa41('0x21')]||this[_0xaa41('0x53')]!==_0x446b['dialActive']||this[_0xaa41('0x3d')]!==_0x446b[_0xaa41('0x3d')]||this[_0xaa41('0x3e')]!==_0x446b['statusMessage'];_0x11f7d9=OUTBOUND_COUNTERS[_0xaa41('0x51')](function(_0x35f664){return this[_0x35f664]!==_0x446b[_0x35f664];},this);if(this['Trunk']&&_0x446b[_0xaa41('0x3f')]){_0x14aab0=this[_0xaa41('0x3f')][_0xaa41('0x40')]!==_0x446b['Trunk'][_0xaa41('0x40')]||this[_0xaa41('0x3f')]['active']!==_0x446b['Trunk'][_0xaa41('0x41')];}}return _0x3fef3e||_0x11f7d9||_0x14aab0;};VoiceQueueSummary[_0xaa41('0x4f')][_0xaa41('0x54')]=function(_0x4d20c6){this[_0xaa41('0x6')]=_0x4d20c6[_0xaa41('0x6')];this[_0xaa41('0x3d')]=_0x4d20c6[_0xaa41('0x3d')];this[_0xaa41('0x3e')]=_0x4d20c6['statusMessage'];this[_0xaa41('0x8')]=_0x4d20c6['originated'];this['outboundAbandonedCallsDay']=_0x4d20c6[_0xaa41('0x9')];this['outboundAnswerCallsDay']=_0x4d20c6[_0xaa41('0x28')];this[_0xaa41('0x29')]=_0x4d20c6[_0xaa41('0x29')];this['outboundBusyCallsDay']=_0x4d20c6[_0xaa41('0xa')];this[_0xaa41('0xb')]=_0x4d20c6[_0xaa41('0xb')];this[_0xaa41('0x55')]=_0x4d20c6[_0xaa41('0x55')];this[_0xaa41('0xc')]=_0x4d20c6[_0xaa41('0xc')];this[_0xaa41('0xd')]=_0x4d20c6[_0xaa41('0xd')];this['outboundRejectCallsDay']=_0x4d20c6[_0xaa41('0xe')];this[_0xaa41('0xf')]=_0x4d20c6[_0xaa41('0xf')];this['sumBillable']=_0x4d20c6[_0xaa41('0x11')];this[_0xaa41('0x12')]=_0x4d20c6[_0xaa41('0x12')];this[_0xaa41('0x1c')]=_0x4d20c6[_0xaa41('0x1c')];if(this[_0xaa41('0x21')]===_0xaa41('0x56')){this['pTalking']=_0x4d20c6['pTalking'];}};module['exports']=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index abcdce1..86f6de7 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 _0xb4d5=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x44d10f,_0x1c1f23){var _0x8453ec=function(_0xb98937){while(--_0xb98937){_0x44d10f['push'](_0x44d10f['shift']());}};_0x8453ec(++_0x1c1f23);}(_0xb4d5,0x18e));var _0x5b4d=function(_0x2a73b3,_0x5f313f){_0x2a73b3=_0x2a73b3-0x0;var _0xadd5d1=_0xb4d5[_0x2a73b3];return _0xadd5d1;};'use strict';function VtigerAccount(_0x50aa1a){this['id']=_0x50aa1a['id']||0x0;this[_0x5b4d('0x0')]=_0x50aa1a[_0x5b4d('0x0')]||'';this['username']=_0x50aa1a[_0x5b4d('0x1')]||'';this[_0x5b4d('0x2')]=_0x50aa1a[_0x5b4d('0x2')]||'';this[_0x5b4d('0x3')]=_0x50aa1a[_0x5b4d('0x3')]||'';this[_0x5b4d('0x4')]=_0x50aa1a[_0x5b4d('0x4')]||'';this[_0x5b4d('0x5')]=_0x50aa1a['Configurations']||{};}module[_0x5b4d('0x6')]=VtigerAccount; \ No newline at end of file +var _0x1bbe=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x1bbe,0xbe));var _0xe1bb=function(_0x1694f3,_0x58d6ba){_0x1694f3=_0x1694f3-0x0;var _0x27372c=_0x1bbe[_0x1694f3];return _0x27372c;};'use strict';function VtigerAccount(_0x1cf1b6){this['id']=_0x1cf1b6['id']||0x0;this[_0xe1bb('0x0')]=_0x1cf1b6[_0xe1bb('0x0')]||'';this[_0xe1bb('0x1')]=_0x1cf1b6[_0xe1bb('0x1')]||'';this[_0xe1bb('0x2')]=_0x1cf1b6[_0xe1bb('0x2')]||'';this[_0xe1bb('0x3')]=_0x1cf1b6[_0xe1bb('0x3')]||'';this[_0xe1bb('0x4')]=_0x1cf1b6['serverUrl']||'';this[_0xe1bb('0x5')]=_0x1cf1b6[_0xe1bb('0x5')]||{};}module[_0xe1bb('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 5f5823f..501716d 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 _0xfee3=['Configurations','exports','name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl'];(function(_0x19ff82,_0x4b3ca6){var _0x4979ee=function(_0x3b3d34){while(--_0x3b3d34){_0x19ff82['push'](_0x19ff82['shift']());}};_0x4979ee(++_0x4b3ca6);}(_0xfee3,0xc8));var _0x3fee=function(_0x10d34b,_0x4fef76){_0x10d34b=_0x10d34b-0x0;var _0x92b0bf=_0xfee3[_0x10d34b];return _0x92b0bf;};'use strict';function ZendeskAccount(_0x3a9c4d){this['id']=_0x3a9c4d['id']||0x0;this[_0x3fee('0x0')]=_0x3a9c4d[_0x3fee('0x0')]||'';this[_0x3fee('0x1')]=_0x3a9c4d[_0x3fee('0x1')]||'';this[_0x3fee('0x2')]=_0x3a9c4d[_0x3fee('0x2')]||'';this[_0x3fee('0x3')]=_0x3a9c4d[_0x3fee('0x3')]||'';this['remoteUri']=_0x3a9c4d[_0x3fee('0x4')]||'';this['authType']=_0x3a9c4d[_0x3fee('0x5')]||'';this[_0x3fee('0x6')]=_0x3a9c4d['type']||_0x3fee('0x7');this['serverUrl']=_0x3a9c4d[_0x3fee('0x8')]||'';this[_0x3fee('0x9')]=_0x3a9c4d[_0x3fee('0x9')]||{};}module[_0x3fee('0xa')]=ZendeskAccount; \ No newline at end of file +var _0xd6ee=['username','password','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x373096,_0x4d37aa){var _0x14a6d0=function(_0xb3b614){while(--_0xb3b614){_0x373096['push'](_0x373096['shift']());}};_0x14a6d0(++_0x4d37aa);}(_0xd6ee,0x8b));var _0xed6e=function(_0x4e06f3,_0x5c35db){_0x4e06f3=_0x4e06f3-0x0;var _0x1ed6f1=_0xd6ee[_0x4e06f3];return _0x1ed6f1;};'use strict';function ZendeskAccount(_0x39e9f8){this['id']=_0x39e9f8['id']||0x0;this[_0xed6e('0x0')]=_0x39e9f8[_0xed6e('0x0')]||'';this[_0xed6e('0x1')]=_0x39e9f8[_0xed6e('0x1')]||'';this[_0xed6e('0x2')]=_0x39e9f8['password']||'';this['token']=_0x39e9f8['token']||'';this[_0xed6e('0x3')]=_0x39e9f8[_0xed6e('0x3')]||'';this[_0xed6e('0x4')]=_0x39e9f8['authType']||'';this['type']=_0x39e9f8[_0xed6e('0x5')]||_0xed6e('0x6');this[_0xed6e('0x7')]=_0x39e9f8[_0xed6e('0x7')]||'';this['Configurations']=_0x39e9f8[_0xed6e('0x8')]||{};}module[_0xed6e('0x9')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 40cc3bc..b360aab 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 _0x68e6=['clientId','clientSecret','code','refreshToken','Configurations','name','description','host','zone'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x68e6,0x11c));var _0x668e=function(_0xab7710,_0x1bf517){_0xab7710=_0xab7710-0x0;var _0x238bad=_0x68e6[_0xab7710];return _0x238bad;};'use strict';function ZohoAccount(_0x21c175){this['id']=_0x21c175['id']||0x0;this[_0x668e('0x0')]=_0x21c175[_0x668e('0x0')]||'';this[_0x668e('0x1')]=_0x21c175[_0x668e('0x1')]||'';this[_0x668e('0x2')]=_0x21c175['host']||'';this[_0x668e('0x3')]=_0x21c175[_0x668e('0x3')]||'';this[_0x668e('0x4')]=_0x21c175[_0x668e('0x4')]||'';this['clientSecret']=_0x21c175[_0x668e('0x5')]||'';this['serverUrl']=_0x21c175['serverUrl']||'';this[_0x668e('0x6')]=_0x21c175[_0x668e('0x6')]||'';this[_0x668e('0x7')]=_0x21c175[_0x668e('0x7')]||'';this[_0x668e('0x8')]=_0x21c175[_0x668e('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0xdc82=['code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret'];(function(_0x27d958,_0x29ef87){var _0x53e63e=function(_0x4130ec){while(--_0x4130ec){_0x27d958['push'](_0x27d958['shift']());}};_0x53e63e(++_0x29ef87);}(_0xdc82,0x158));var _0x2dc8=function(_0x3407ef,_0x1fa136){_0x3407ef=_0x3407ef-0x0;var _0x560f33=_0xdc82[_0x3407ef];return _0x560f33;};'use strict';function ZohoAccount(_0x5f1511){this['id']=_0x5f1511['id']||0x0;this[_0x2dc8('0x0')]=_0x5f1511[_0x2dc8('0x0')]||'';this[_0x2dc8('0x1')]=_0x5f1511[_0x2dc8('0x1')]||'';this[_0x2dc8('0x2')]=_0x5f1511['host']||'';this[_0x2dc8('0x3')]=_0x5f1511[_0x2dc8('0x3')]||'';this[_0x2dc8('0x4')]=_0x5f1511[_0x2dc8('0x4')]||'';this[_0x2dc8('0x5')]=_0x5f1511[_0x2dc8('0x5')]||'';this['serverUrl']=_0x5f1511['serverUrl']||'';this[_0x2dc8('0x6')]=_0x5f1511[_0x2dc8('0x6')]||'';this[_0x2dc8('0x7')]=_0x5f1511[_0x2dc8('0x7')]||'';this[_0x2dc8('0x8')]=_0x5f1511[_0x2dc8('0x8')]||{};}module[_0x2dc8('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index f3cdae4..ec47176 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 _0x4b17=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','number','exports','util','moment','isNil','string','uniqueid','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','format','calleridname','Contact','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback'];(function(_0x4be492,_0x5deda5){var _0x3555f0=function(_0x2cb0ff){while(--_0x2cb0ff){_0x4be492['push'](_0x4be492['shift']());}};_0x3555f0(++_0x5deda5);}(_0x4b17,0x10f));var _0x74b1=function(_0x22dac7,_0x45d32a){_0x22dac7=_0x22dac7-0x0;var _0x3e6cfa=_0x4b17[_0x22dac7];return _0x3e6cfa;};'use strict';var util=require(_0x74b1('0x0'));var _=require('lodash');var moment=require(_0x74b1('0x1'));function checkNameSurname(_0x5483a2,_0xd14270,_0x356a31){var _0x547636='';if(!_[_0x74b1('0x2')](_0xd14270)&&'string'===typeof _0xd14270){_0x547636+=_0xd14270;}if(!_['isNil'](_0x356a31)&&_0x74b1('0x3')===typeof _0x356a31){_0x547636+='\x20'+_0x356a31;}if(_0x547636!==''){return _0x547636;}return _0x5483a2;}function Action(_0x30d910,_0x379dcc,_0x3873a6,_0x371c3b,_0x191d2b){this[_0x74b1('0x4')]=_0x3873a6||undefined;this['idContact']=_0x30d910['id'];this[_0x74b1('0x5')]=_0x379dcc[_0x74b1('0x6')];this[_0x74b1('0x7')]=_0x379dcc[_0x74b1('0x7')];this[_0x74b1('0x8')]='queue';this[_0x74b1('0x9')]=![];this[_0x74b1('0xa')]=_['isNil'](_0x30d910[_0x74b1('0xb')])?undefined:_0x30d910[_0x74b1('0xb')][_0x74b1('0x6')];this[_0x74b1('0xc')]=this['membername']?util[_0x74b1('0xd')]('SIP/%s',this['membername']):_0x371c3b||undefined;this[_0x74b1('0xe')]=checkNameSurname(_0x30d910[_0x74b1('0xf')]['phone'],_0x30d910['Contact']['firstName'],_0x30d910[_0x74b1('0xf')]['lastName']);this['active']=_0x30d910[_0x74b1('0x10')]||![];this[_0x74b1('0x11')]=_0x30d910[_0x74b1('0x12')];this[_0x74b1('0x13')]=_0x30d910[_0x74b1('0x13')];this[_0x74b1('0x14')]=_0x30d910['countbusyretry']||0x0;this[_0x74b1('0x15')]=_0x30d910[_0x74b1('0x15')]||0x0;this[_0x74b1('0x16')]=_0x30d910[_0x74b1('0x16')]||0x0;this[_0x74b1('0x17')]=(_0x30d910[_0x74b1('0x14')]||0x0)+(_0x30d910[_0x74b1('0x15')]||0x0)+(_0x30d910['countnoanswerretry']||0x0)+(_0x30d910[_0x74b1('0x18')]||0x0)+(_0x30d910[_0x74b1('0x19')]||0x0)+(_0x30d910['countabandonedretry']||0x0)+(_0x30d910[_0x74b1('0x1a')]||0x0)+(_0x30d910[_0x74b1('0x1b')]||0x0);this[_0x74b1('0x18')]=_0x30d910[_0x74b1('0x18')]||0x0;this[_0x74b1('0x19')]=_0x30d910[_0x74b1('0x19')]||0x0;this[_0x74b1('0x1c')]=_0x30d910[_0x74b1('0x1c')]||0x0;this['countmachineretry']=_0x30d910[_0x74b1('0x1a')]||0x0;this['countagentrejectretry']=_0x30d910['countagentrejectretry']||0x0;this['callback']=_0x30d910[_0x74b1('0x1d')];this[_0x74b1('0x1e')]=_0x30d910[_0x74b1('0x1e')];this[_0x74b1('0x1f')]=_0x30d910[_0x74b1('0x1f')];this['recallme']=_0x30d910[_0x74b1('0x20')];this['ContactId']=_0x30d910[_0x74b1('0x21')];this[_0x74b1('0x22')]=_0x30d910[_0x74b1('0x22')];this[_0x74b1('0x23')]=_[_0x74b1('0x2')](_0x30d910[_0x74b1('0xb')])?_0x30d910[_0x74b1('0x23')]:_0x30d910[_0x74b1('0xb')]['id'];this['VoiceQueueId']=_0x30d910[_0x74b1('0x24')];this[_0x74b1('0x25')]='';this[_0x74b1('0x26')]='';}Action['prototype'][_0x74b1('0x27')]=function(){return util[_0x74b1('0xd')](_0x74b1('0x28'),this[_0x74b1('0xe')],this[_0x74b1('0x29')]);};module[_0x74b1('0x2a')]=Action; \ No newline at end of file +var _0x896e=['Contact','phone','firstName','lastName','calleridnum','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','name','type','queue','membername','Agent','format','SIP/%s','calleridname'];(function(_0x556a83,_0x56897c){var _0x1f89bf=function(_0x5d7028){while(--_0x5d7028){_0x556a83['push'](_0x556a83['shift']());}};_0x1f89bf(++_0x56897c);}(_0x896e,0x1e9));var _0xe896=function(_0x50caf3,_0x19aee4){_0x50caf3=_0x50caf3-0x0;var _0x5bcb7d=_0x896e[_0x50caf3];return _0x5bcb7d;};'use strict';var util=require(_0xe896('0x0'));var _=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));function checkNameSurname(_0x229b59,_0x36085e,_0x26d296){var _0x2af995='';if(!_[_0xe896('0x3')](_0x36085e)&&_0xe896('0x4')===typeof _0x36085e){_0x2af995+=_0x36085e;}if(!_[_0xe896('0x3')](_0x26d296)&&_0xe896('0x4')===typeof _0x26d296){_0x2af995+='\x20'+_0x26d296;}if(_0x2af995!==''){return _0x2af995;}return _0x229b59;}function Action(_0x318a7b,_0x52ac80,_0x24c430,_0x7a0721,_0x3b902c){this[_0xe896('0x5')]=_0x24c430||undefined;this[_0xe896('0x6')]=_0x318a7b['id'];this['queue']=_0x52ac80[_0xe896('0x7')];this[_0xe896('0x8')]=_0x52ac80[_0xe896('0x8')];this['campaigntype']=_0xe896('0x9');this['dialAnswer']=![];this[_0xe896('0xa')]=_['isNil'](_0x318a7b[_0xe896('0xb')])?undefined:_0x318a7b[_0xe896('0xb')][_0xe896('0x7')];this['channelAgent']=this[_0xe896('0xa')]?util[_0xe896('0xc')](_0xe896('0xd'),this['membername']):_0x7a0721||undefined;this[_0xe896('0xe')]=checkNameSurname(_0x318a7b[_0xe896('0xf')][_0xe896('0x10')],_0x318a7b['Contact'][_0xe896('0x11')],_0x318a7b[_0xe896('0xf')][_0xe896('0x12')]);this['active']=_0x318a7b['active']||![];this[_0xe896('0x13')]=_0x318a7b[_0xe896('0x10')];this['scheduledat']=_0x318a7b['scheduledat'];this[_0xe896('0x14')]=_0x318a7b[_0xe896('0x14')]||0x0;this['countcongestionretry']=_0x318a7b[_0xe896('0x15')]||0x0;this['countnoanswerretry']=_0x318a7b[_0xe896('0x16')]||0x0;this[_0xe896('0x17')]=(_0x318a7b[_0xe896('0x14')]||0x0)+(_0x318a7b['countcongestionretry']||0x0)+(_0x318a7b[_0xe896('0x16')]||0x0)+(_0x318a7b[_0xe896('0x18')]||0x0)+(_0x318a7b[_0xe896('0x19')]||0x0)+(_0x318a7b[_0xe896('0x1a')]||0x0)+(_0x318a7b[_0xe896('0x1b')]||0x0)+(_0x318a7b[_0xe896('0x1c')]||0x0);this[_0xe896('0x18')]=_0x318a7b[_0xe896('0x18')]||0x0;this['countdropretry']=_0x318a7b[_0xe896('0x19')]||0x0;this['countabandonedretry']=_0x318a7b['countabandonedretry']||0x0;this[_0xe896('0x1b')]=_0x318a7b[_0xe896('0x1b')]||0x0;this[_0xe896('0x1c')]=_0x318a7b[_0xe896('0x1c')]||0x0;this['callback']=_0x318a7b[_0xe896('0x1d')];this['callbackuniqueid']=_0x318a7b['callbackuniqueid'];this[_0xe896('0x1e')]=_0x318a7b[_0xe896('0x1e')];this[_0xe896('0x1f')]=_0x318a7b[_0xe896('0x1f')];this[_0xe896('0x20')]=_0x318a7b[_0xe896('0x20')];this[_0xe896('0x21')]=_0x318a7b['ListId'];this[_0xe896('0x22')]=_[_0xe896('0x3')](_0x318a7b[_0xe896('0xb')])?_0x318a7b['UserId']:_0x318a7b[_0xe896('0xb')]['id'];this[_0xe896('0x23')]=_0x318a7b[_0xe896('0x23')];this[_0xe896('0x24')]='';this[_0xe896('0x25')]='';}Action[_0xe896('0x26')]['getCaller']=function(){return util[_0xe896('0xc')](_0xe896('0x27'),this[_0xe896('0xe')],this[_0xe896('0x28')]);};module[_0xe896('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index f382fc1..18e8470 100644 --- a/server/services/ami/preview/index.js +++ b/server/services/ami/preview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x2c0537,_0x1ac252){var _0x5c29e5=function(_0x32d691){while(--_0x32d691){_0x2c0537['push'](_0x2c0537['shift']());}};_0x5c29e5(++_0x1ac252);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf0bcac,_0x531755){_0xf0bcac=_0xf0bcac-0x0;var _0x4e4c65=_0xa9e0[_0xf0bcac];return _0x4e4c65;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file +var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x16f6af,_0x20a361){var _0x54a4a4=function(_0x500cba){while(--_0x500cba){_0x16f6af['push'](_0x16f6af['shift']());}};_0x54a4a4(++_0x20a361);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index d384a52..4004a54 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 _0x0572=['exten','xcally-motion-preview','assigned','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','createHistory','catch','resolve','then','[createHistory]\x20','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x0572,0x124));var _0x2057=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x0572[_0x4ff09b];return _0x3f5c2e;};'use strict';var util=require(_0x2057('0x0'));var BPromise=require(_0x2057('0x1'));var logger=require(_0x2057('0x2'))(_0x2057('0x3'));var cmHopper=require(_0x2057('0x4'));var cmHopperHistory=require(_0x2057('0x5'));var cmHopperBlack=require(_0x2057('0x6'));var agentReportPreview=require(_0x2057('0x7'));var voiceQueueReport=require(_0x2057('0x8'));function loggerCatch(_0x94c598){return function(_0x1d981e){logger[_0x2057('0x9')](_0x94c598,util[_0x2057('0xa')](_0x1d981e,{'showHidden':![],'depth':null}));};}function create(_0x1d78c4){return cmHopperHistory[_0x2057('0xb')](_0x1d78c4)[_0x2057('0xc')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x59c84f){return BPromise[_0x2057('0xd')]()[_0x2057('0xe')](agentReportPreview['createHistory'](_0x59c84f))[_0x2057('0xc')](loggerCatch(_0x2057('0xf')));}function moveContact(_0x2c8015){return cmHopper['moveContactManagedDialer'](_0x2c8015,!![])[_0x2057('0xc')](loggerCatch(_0x2057('0x10')));}exports[_0x2057('0x11')]=function(_0x149133){return cmHopperBlack[_0x2057('0x11')](_0x149133)['catch'](loggerCatch(_0x2057('0x12')));};exports['getContactPreview']=function(_0x39ad88){return BPromise[_0x2057('0xd')]()[_0x2057('0xe')](cmHopper['getContactPreview'](_0x39ad88))[_0x2057('0xc')](loggerCatch(_0x2057('0x13')));};exports['createHistory']=function(_0x9b76fc,_0x3d1404){create(_0x9b76fc)[_0x2057('0xc')](loggerCatch(_0x3d1404));moveContact(_0x9b76fc)['catch'](loggerCatch(_0x3d1404));};exports[_0x2057('0x14')]=function(_0x15d96c,_0x1a41ff){createAgent(_0x15d96c)[_0x2057('0xc')](loggerCatch(_0x1a41ff));};exports[_0x2057('0x15')]=function(_0x116497,_0x144eca){create(_0x116497)['catch'](loggerCatch(_0x144eca));};exports[_0x2057('0x16')]=function(_0x2af133,_0x265549){moveContact(_0x2af133)[_0x2057('0xc')](loggerCatch(_0x265549));};exports['rescheduleContact']=function(_0x1694b0,_0x4cddcd,_0x8567a6){if(_0x4cddcd){_0x1694b0[_0x2057('0x17')]=null;}if(_0x8567a6){_0x1694b0[_0x2057('0x18')]=![];}return cmHopper[_0x2057('0x19')](_0x1694b0)[_0x2057('0xc')](loggerCatch(_0x2057('0x1a')));};exports[_0x2057('0x1b')]=function(_0x50f4b5){return cmHopper[_0x2057('0x1b')](_0x50f4b5)[_0x2057('0xc')](loggerCatch('[countReScheduled]\x20'));};exports['unlockContact']=function(_0x34cb4f){return cmHopper[_0x2057('0x1c')]({'UserId':null},_0x34cb4f,0x1)[_0x2057('0xc')](loggerCatch(_0x2057('0x1d')));};exports['disableContact']=function(_0x1422e5){return cmHopper['unlockContact']({'active':![]},_0x1422e5,0x1)[_0x2057('0xc')](loggerCatch(_0x2057('0x1e')));};exports[_0x2057('0x1f')]=function(_0x1ed60a){var _0x54b577={};_0x54b577['type']=_0x1ed60a['type'];_0x54b577['uniqueid']=_0x1ed60a[_0x2057('0x20')];_0x54b577[_0x2057('0x21')]=_0x1ed60a[_0x2057('0x21')];_0x54b577[_0x2057('0x22')]=_0x1ed60a[_0x2057('0x22')];_0x54b577[_0x2057('0x23')]=_0x1ed60a['queue'];_0x54b577[_0x2057('0x24')]=_0x1ed60a[_0x2057('0x25')];_0x54b577[_0x2057('0x26')]=_0x1ed60a[_0x2057('0x25')];_0x54b577[_0x2057('0x27')]=0x1;_0x54b577[_0x2057('0x28')]=_0x1ed60a[_0x2057('0x29')];_0x54b577[_0x2057('0x2a')]=_0x1ed60a['membername'];_0x54b577[_0x2057('0x2b')]='from-sip';_0x54b577[_0x2057('0x2c')]=_0x2057('0x2d');_0x54b577['holdtime']=0x0;_0x54b577[_0x2057('0x2e')]=0x1;_0x54b577[_0x2057('0x2f')]=_0x1ed60a[_0x2057('0x30')];_0x54b577[_0x2057('0x31')]=_0x2057('0x32');return BPromise[_0x2057('0xd')]()[_0x2057('0xe')](voiceQueueReport[_0x2057('0x33')](_0x54b577))[_0x2057('0xc')](loggerCatch(_0x2057('0x34')));};exports[_0x2057('0x35')]=function(_0x1cae9e,_0x11198e){return BPromise[_0x2057('0xd')]()[_0x2057('0xe')](cmHopper[_0x2057('0x35')](_0x1cae9e,_0x11198e))['catch'](loggerCatch(_0x2057('0x36')));};exports[_0x2057('0x37')]=function(_0x20ffca){return cmHopper[_0x2057('0x19')](_0x20ffca,!![],!![])['catch'](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0x396e=['error','inspect','catch','resolve','then','createHistory','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt','connectedlinename','membername','context','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','util','../../../config/logger','../rpc/cmHopperBlack','../rpc/voiceQueueReport'];(function(_0x136619,_0x31c9b2){var _0x38c4a5=function(_0x10b74d){while(--_0x10b74d){_0x136619['push'](_0x136619['shift']());}};_0x38c4a5(++_0x31c9b2);}(_0x396e,0x18c));var _0xe396=function(_0x3f2b68,_0x5ab321){_0x3f2b68=_0x3f2b68-0x0;var _0x322146=_0x396e[_0x3f2b68];return _0x322146;};'use strict';var util=require(_0xe396('0x0'));var BPromise=require('bluebird');var logger=require(_0xe396('0x1'))('preview');var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xe396('0x2'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xe396('0x3'));function loggerCatch(_0x381ecb){return function(_0x3b5efd){logger[_0xe396('0x4')](_0x381ecb,util[_0xe396('0x5')](_0x3b5efd,{'showHidden':![],'depth':null}));};}function create(_0x2ff47e){return cmHopperHistory['createHistory'](_0x2ff47e)[_0xe396('0x6')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x455eee){return BPromise[_0xe396('0x7')]()[_0xe396('0x8')](agentReportPreview[_0xe396('0x9')](_0x455eee))['catch'](loggerCatch(_0xe396('0xa')));}function moveContact(_0xd0537b){return cmHopper[_0xe396('0xb')](_0xd0537b,!![])[_0xe396('0x6')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xe396('0xc')]=function(_0x460f1d){return cmHopperBlack[_0xe396('0xc')](_0x460f1d)[_0xe396('0x6')](loggerCatch(_0xe396('0xd')));};exports[_0xe396('0xe')]=function(_0x9f4b35){return BPromise[_0xe396('0x7')]()[_0xe396('0x8')](cmHopper[_0xe396('0xe')](_0x9f4b35))[_0xe396('0x6')](loggerCatch('[getContactPreview]\x20'));};exports[_0xe396('0x9')]=function(_0x43fae3,_0x3bc86b){create(_0x43fae3)['catch'](loggerCatch(_0x3bc86b));moveContact(_0x43fae3)[_0xe396('0x6')](loggerCatch(_0x3bc86b));};exports[_0xe396('0xf')]=function(_0x1751df,_0x37d458){createAgent(_0x1751df)[_0xe396('0x6')](loggerCatch(_0x37d458));};exports[_0xe396('0x10')]=function(_0xc44b84,_0x2c3b2b){create(_0xc44b84)[_0xe396('0x6')](loggerCatch(_0x2c3b2b));};exports[_0xe396('0x11')]=function(_0x35be46,_0x315871){moveContact(_0x35be46)[_0xe396('0x6')](loggerCatch(_0x315871));};exports[_0xe396('0x12')]=function(_0x42f29b,_0x125eca,_0xd8acf5){if(_0x125eca){_0x42f29b[_0xe396('0x13')]=null;}if(_0xd8acf5){_0x42f29b['active']=![];}return cmHopper[_0xe396('0x12')](_0x42f29b)[_0xe396('0x6')](loggerCatch(_0xe396('0x14')));};exports[_0xe396('0x15')]=function(_0x26c60c){return cmHopper[_0xe396('0x15')](_0x26c60c)['catch'](loggerCatch(_0xe396('0x16')));};exports[_0xe396('0x17')]=function(_0x2afea7){return cmHopper[_0xe396('0x17')]({'UserId':null},_0x2afea7,0x1)['catch'](loggerCatch(_0xe396('0x18')));};exports[_0xe396('0x19')]=function(_0x241430){return cmHopper['unlockContact']({'active':![]},_0x241430,0x1)[_0xe396('0x6')](loggerCatch(_0xe396('0x1a')));};exports[_0xe396('0x1b')]=function(_0x2b555f){var _0x38fc24={};_0x38fc24[_0xe396('0x1c')]=_0x2b555f['type'];_0x38fc24['uniqueid']=_0x2b555f['uniqueid'];_0x38fc24[_0xe396('0x1d')]=_0x2b555f[_0xe396('0x1d')];_0x38fc24[_0xe396('0x1e')]=_0x2b555f[_0xe396('0x1e')];_0x38fc24[_0xe396('0x1f')]=_0x2b555f[_0xe396('0x1f')];_0x38fc24[_0xe396('0x20')]=_0x2b555f[_0xe396('0x21')];_0x38fc24[_0xe396('0x22')]=_0x2b555f[_0xe396('0x21')];_0x38fc24['queuecallercomplete']=0x1;_0x38fc24[_0xe396('0x23')]=_0x2b555f['endtime'];_0x38fc24[_0xe396('0x24')]=_0x2b555f[_0xe396('0x25')];_0x38fc24[_0xe396('0x26')]='from-sip';_0x38fc24[_0xe396('0x27')]=_0xe396('0x28');_0x38fc24[_0xe396('0x29')]=0x0;_0x38fc24[_0xe396('0x2a')]=0x1;_0x38fc24[_0xe396('0x2b')]=_0x2b555f[_0xe396('0x25')];_0x38fc24[_0xe396('0x2c')]=_0xe396('0x2d');return BPromise[_0xe396('0x7')]()[_0xe396('0x8')](voiceQueueReport[_0xe396('0x2e')](_0x38fc24))[_0xe396('0x6')](loggerCatch(_0xe396('0x2f')));};exports[_0xe396('0x30')]=function(_0x122a5c,_0xd4cc06){return BPromise[_0xe396('0x7')]()[_0xe396('0x8')](cmHopper[_0xe396('0x30')](_0x122a5c,_0xd4cc06))[_0xe396('0x6')](loggerCatch(_0xe396('0x31')));};exports['rescheduleContactInQueue']=function(_0x4d31e3){return cmHopper['rescheduleContact'](_0x4d31e3,!![],!![])[_0xe396('0x6')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ 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 521f617..3fec149 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 _0x3f7c=['lastevent','name','queue','interface','voice','mandatoryDisposition','not_inuse','status','reachable','push','getDiff','milliseconds','diff','seconds','createBody','CampaignId','filterKey','idContact','campaigntype','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','keys','variables','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','preview','XCALLY_IP_AGI','../../dialer/utils','loggerCatch','error','inspect','logger','info','loggerError','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','isActive','isNil','addVariables','Queue','calleridname','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','NONE','\x22agi://%s/square,%s\x22','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','responsetime','logAgent','statedesc','ringtime','getSeconds','starttime','logLookAgent','membername','UserId','endtime','talktime','answertime','isFailure','Failure','BOOKED','uniqueid','originate','channelAgent','calleridnum','from-sip','countbusyretry','countnosuchnumberretry','clone','Global','active','scheduledat','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn'];(function(_0x5705d5,_0x69022f){var _0xb6ee8d=function(_0x1aa65d){while(--_0x1aa65d){_0x5705d5['push'](_0x5705d5['shift']());}};_0xb6ee8d(++_0x69022f);}(_0x3f7c,0x1e0));var _0xc3f7=function(_0x49086d,_0x2356ee){_0x49086d=_0x49086d-0x0;var _0x8d1dd6=_0x3f7c[_0x49086d];return _0x8d1dd6;};'use strict';var util=require(_0xc3f7('0x0'));var _=require(_0xc3f7('0x1'));var moment=require(_0xc3f7('0x2'));var logger=require('../../../../config/logger')(_0xc3f7('0x3'));var ipAgi=process['env'][_0xc3f7('0x4')]||'127.0.0.1';var utils=require(_0xc3f7('0x5'));exports[_0xc3f7('0x6')]=function(_0x463d86){return function(_0x446cd7){logger[_0xc3f7('0x7')](_0x463d86,util[_0xc3f7('0x8')](_0x446cd7,{'showHidden':![],'depth':null}));};};exports[_0xc3f7('0x9')]=function(_0x31b367,_0x31401d){logger[_0xc3f7('0xa')](_0x31b367,util['inspect'](_0x31401d,{'showHidden':![],'depth':null}));};exports[_0xc3f7('0xb')]=function(_0x6daa2c,_0xffb9f){logger[_0xc3f7('0x7')](_0x6daa2c,util[_0xc3f7('0x8')](_0xffb9f,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x56e3a2){return function(_0x253b99){logger[_0xc3f7('0xa')](_0x56e3a2,util[_0xc3f7('0x8')](_0x253b99,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x52f87e,_0x1ecc3a,_0xcb9dd4){return{'message':_0x52f87e,'unlock':_0x1ecc3a,'active':_0xcb9dd4};};exports[_0xc3f7('0xc')]=function(_0x536f0b,_0xf10967,_0x1dfbb1){if(!_[_0xc3f7('0xd')](_0x1dfbb1)&&_0xc3f7('0xe')===typeof _0x1dfbb1&&!_[_0xc3f7('0xf')](_0x1dfbb1)){if(!_[_0xc3f7('0xd')](_0xf10967)&&_0xc3f7('0xe')===typeof _0xf10967&&!_[_0xc3f7('0xf')](_0xf10967)){return util['format'](_0xc3f7('0x10'),_0xf10967,_0x1dfbb1);}return util[_0xc3f7('0x11')]('\x22%s\x22\x20<%s>',_0x1dfbb1,_0x1dfbb1);}if(!_[_0xc3f7('0xd')](_0x536f0b)&&_0xc3f7('0xe')===typeof _0x536f0b&&!_[_0xc3f7('0xf')](_0x536f0b)){return _0x536f0b;}return'\x22\x22\x20<>';};exports[_0xc3f7('0x12')]=function(_0x1aadac){if(_[_0xc3f7('0x13')](_0x1aadac)){return![];}return _0x1aadac;};exports[_0xc3f7('0x14')]=function(_0x3ae5f3,_0x400bef,_0x3eee90,_0x735378,_0xa3c4f2,_0x5644bd){var _0x4b9c9f={'XMD-QUEUE':_0x400bef[_0xc3f7('0x15')]?_0x400bef['Queue']['name']:'','XMD-CALLERID':_0x735378,'XMD-CALLERID-PREVIEW':_0x5644bd?util[_0xc3f7('0x11')]('\x22%s\x22\x20<%s>',_0x5644bd[_0xc3f7('0x16')],_0x5644bd['calleridnum']):_0x735378,'XMD-DIALID':_0xa3c4f2,'XMD-CONTACTID':_0x400bef[_0xc3f7('0x17')],'XMD-CDRTYPE':_0xc3f7('0x18'),'CALLERID(all)':_0x735378,'XMD-VOICEQUEUEID':_0x400bef[_0xc3f7('0x19')],'XMD-DIALCHANNEL':_0x3eee90,'XMD-DIALTIMEOUT':_0x3ae5f3[_0xc3f7('0x1a')]||0x1e,'XMD-DIALOPTIONS':util[_0xc3f7('0x11')](_0xc3f7('0x1b'),_0x3ae5f3[_0xc3f7('0x1c')]?'g':'',_[_0xc3f7('0xf')](_0x3ae5f3[_0xc3f7('0x1d')])?'':_0xc3f7('0x1e')),'XMD-DIALURL':_0x3ae5f3[_0xc3f7('0x1f')]||'','XMD-AGI':_0x3ae5f3['dialQueueProject']?util[_0xc3f7('0x11')]('\x22agi://%s/square,%s\x22',ipAgi,_0x3ae5f3['dialQueueProject']):_0xc3f7('0x20'),'XMD-AGIAFTER':_0x3ae5f3[_0xc3f7('0x1c')]?util['format'](_0xc3f7('0x21'),ipAgi,_0x3ae5f3[_0xc3f7('0x1c')]):_0xc3f7('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x5644bd?_0x5644bd['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x5644bd?_0x5644bd[_0xc3f7('0x22')]:'','XMD-DESTINATION':_0xc3f7('0x23'),'SIPADDHEADER':_0xc3f7('0x24')};if(!_[_0xc3f7('0xf')](_0x3ae5f3[_0xc3f7('0x1d')])){_0x4b9c9f[util[_0xc3f7('0x11')]('%s',_0xc3f7('0x25'))]=_0x3ae5f3[_0xc3f7('0x1d')];_0x4b9c9f[util['format']('%s',_0xc3f7('0x26'))]=_0xa3c4f2;}return _0x4b9c9f;};exports[_0xc3f7('0x27')]=function(_0x846b68){var _0x521a84={};for(var _0x522197 in _0x846b68){if(_0x846b68[_0xc3f7('0x28')](_0x522197)){_0x521a84[util['format']('%s',_['toLower'](_0x522197))]=_0x846b68[_0x522197];}}return{'variables':_0x521a84};};exports[_0xc3f7('0x29')]=function(_0xc83bc9,_0x340a6e){if(!_['isNil'](_0xc83bc9)){if(_0xc83bc9[_0xc3f7('0x28')](_0xc3f7('0x2a'))){if(_0xc83bc9[_0xc3f7('0x2a')]>0x0){_0xc83bc9[_0xc3f7('0x2a')]-=0x1;}else{logger[_0xc3f7('0x7')](_0xc3f7('0x2b'),_0x340a6e);}}}else{logger['error'](_0xc3f7('0x2c'),_0x340a6e);}};exports[_0xc3f7('0x2d')]=function(_0x5c9a38){var _0x47316d=moment()[_0xc3f7('0x11')](_0xc3f7('0x2e'));_0x5c9a38[_0xc3f7('0x2f')]=0xd;_0x5c9a38['statedesc']='Blacklist';_0x5c9a38['starttime']=_0x47316d;_0x5c9a38[_0xc3f7('0x30')]=_0x47316d;_0x5c9a38['endtime']=_0x47316d;};exports[_0xc3f7('0x31')]=function(_0x2192bb,_0x1480a6,_0x117cea){var _0x33309f=moment()[_0xc3f7('0x11')](_0xc3f7('0x2e'));_0x2192bb[_0xc3f7('0x2f')]=_0x1480a6;_0x2192bb[_0xc3f7('0x32')]=_0x117cea;_0x2192bb[_0xc3f7('0x30')]=_0x33309f;_0x2192bb[_0xc3f7('0x33')]=utils[_0xc3f7('0x34')](_0x2192bb[_0xc3f7('0x30')],_0x2192bb[_0xc3f7('0x35')]);};exports[_0xc3f7('0x36')]=function(_0x2c1750,_0x2b208e,_0x588099){_0x2c1750[_0xc3f7('0x37')]=_0x2b208e;_0x2c1750[_0xc3f7('0x38')]=_0x588099;};exports['logCustomer']=function(_0x102fe3,_0x47fad6,_0x1c9898){var _0x4be8e3=moment()[_0xc3f7('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x102fe3[_0xc3f7('0x2f')]=_0x47fad6;_0x102fe3[_0xc3f7('0x32')]=_0x1c9898;_0x102fe3[_0xc3f7('0x30')]=_0x102fe3['responsetime']?_0x102fe3[_0xc3f7('0x30')]:_0x4be8e3;_0x102fe3['endtime']=_0x102fe3[_0xc3f7('0x39')]?_0x102fe3[_0xc3f7('0x39')]:_0x4be8e3;_0x102fe3[_0xc3f7('0x33')]=utils[_0xc3f7('0x34')](_0x102fe3['responsetime']||0x0,_0x102fe3[_0xc3f7('0x35')]||0x0);_0x102fe3[_0xc3f7('0x3a')]=_0x102fe3[_0xc3f7('0x3b')]?utils[_0xc3f7('0x34')](_0x102fe3[_0xc3f7('0x39')],_0x102fe3[_0xc3f7('0x3b')]):0x0;};exports[_0xc3f7('0x3c')]=function(_0x53a1cd){return _0x53a1cd===_0xc3f7('0x3d');};exports['variablesAction']=function(_0x5981ad,_0x149489,_0x2fe83,_0x1b02db,_0x27399d){var _0x5b1395=_0x1b02db?'RECALL':_0x5981ad[_0xc3f7('0x16')];_0x5b1395=_0x27399d?_0xc3f7('0x3e'):_0x5b1395;return{'actionid':_0x5981ad[_0xc3f7('0x3f')],'action':_0xc3f7('0x40'),'channel':_0x5981ad[_0xc3f7('0x41')],'callerid':util[_0xc3f7('0x11')](_0xc3f7('0x10'),_0x5b1395,_0x5981ad[_0xc3f7('0x42')]),'Exten':_0xc3f7('0x23'),'Context':_0xc3f7('0x43'),'Priority':'1','variable':_0x2fe83,'timeout':(_0x149489['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x5981ad[_0xc3f7('0x3f')]};};exports['totalGlobal']=function(_0x48aa76){return _0x48aa76[_0xc3f7('0x44')]+_0x48aa76['countcongestionretry']+_0x48aa76['countnoanswerretry']+_0x48aa76['countagentrejectretry']+_0x48aa76[_0xc3f7('0x45')];};exports['cloneAction']=function(_0x245033){var _0x2cc520=_[_0xc3f7('0x46')](_0x245033);_0x2cc520['state']=0xf;_0x2cc520[_0xc3f7('0x32')]=_0xc3f7('0x47');return _0x2cc520;};exports['scheduledAt']=function(_0x35fff7,_0x32ff2f,_0x1cba8a){var _0x172e22={};_0x172e22[_0x32ff2f]=_0x35fff7[_0x32ff2f];_0x172e22[_0xc3f7('0x48')]=![];_0x172e22[_0xc3f7('0x49')]=moment()['add'](_0x1cba8a,_0xc3f7('0x4a'))['format'](_0xc3f7('0x2e'));_0x172e22['ContactId']=_0x35fff7[_0xc3f7('0x17')];_0x172e22[_0xc3f7('0x4b')]=_0x35fff7[_0xc3f7('0x4b')];_0x172e22[_0xc3f7('0x19')]=_0x35fff7[_0xc3f7('0x19')]||undefined;return _0x172e22;};exports[_0xc3f7('0x4c')]=function(_0x542739,_0x15daea){if(!_[_0xc3f7('0x13')](_0x542739)){if(_0x542739['pTalking']>0x0){_0x542739[_0xc3f7('0x4d')]-=0x1;}else{logger[_0xc3f7('0x7')](_0x15daea,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xc3f7('0x7')](_0x15daea,_0xc3f7('0x4e'));}};exports[_0xc3f7('0x4f')]=function(_0x5f08f0){if(_0x5f08f0<=0x0){return!![];}return![];};function buildObj(_0x34d830,_0x39cae0,_0x45db5d){_0x34d830[_0xc3f7('0x50')]=_0x39cae0;_0x34d830[_0xc3f7('0x51')]=_0x34d830[_0xc3f7('0x52')];_0x34d830[_0xc3f7('0x53')]=_0x34d830[_0xc3f7('0x41')];_0x34d830['motionChannel']=_0xc3f7('0x54');if(_0x45db5d){_0x34d830[_0xc3f7('0x55')]=_0x45db5d[_0xc3f7('0x55')];}return _0x34d830;}exports['buildObj']=buildObj;exports['agentReadyId']=function(_0x46d51c){var _0x1b52ff=[];for(var _0x46ccc2 in _0x46d51c){if(_0x46d51c[_0xc3f7('0x28')](_0x46ccc2)){if(!_[_0xc3f7('0x13')](_0x46d51c[_0x46ccc2])&&_0x46d51c[_0x46ccc2][_0xc3f7('0x2f')]===_0xc3f7('0x56')&&_0x46d51c[_0x46ccc2][_0xc3f7('0x57')]===_0xc3f7('0x58')){_0x1b52ff[_0xc3f7('0x59')](_0x46d51c[_0x46ccc2]['id']);}}}return _0x1b52ff;};exports[_0xc3f7('0x5a')]=function(_0x4ff9b4){var _0x153e67=moment()[_0xc3f7('0x5b')](0x0);var _0x408749=moment(_0x4ff9b4)[_0xc3f7('0x5b')](0x0);return _0x153e67[_0xc3f7('0x5c')](_0x408749,_0xc3f7('0x5d'));};exports[_0xc3f7('0x5e')]=function(_0x4b01db){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4b01db[_0xc3f7('0x17')],'ListId':_0x4b01db['ListId'],'VoiceQueueId':_0x4b01db[_0xc3f7('0x19')]||undefined,'CampaignId':_0x4b01db[_0xc3f7('0x5f')]||undefined};};exports[_0xc3f7('0x60')]=function(_0x3f20d9){if(_0x3f20d9===_0xc3f7('0x3f')||_0x3f20d9===_0xc3f7('0x61')||_0x3f20d9===_0xc3f7('0x52')||_0x3f20d9==='type'||_0x3f20d9===_0xc3f7('0x62')||_0x3f20d9==='dialAnswer'||_0x3f20d9==='membername'||_0x3f20d9==='channelAgent'||_0x3f20d9===_0xc3f7('0x16')||_0x3f20d9===_0xc3f7('0x48')||_0x3f20d9===_0xc3f7('0x42')||_0x3f20d9===_0xc3f7('0x49')||_0x3f20d9==='countbusyretry'||_0x3f20d9==='countcongestionretry'||_0x3f20d9===_0xc3f7('0x63')||_0x3f20d9===_0xc3f7('0x64')||_0x3f20d9===_0xc3f7('0x65')||_0x3f20d9===_0xc3f7('0x66')||_0x3f20d9===_0xc3f7('0x67')||_0x3f20d9===_0xc3f7('0x68')||_0x3f20d9==='ContactId'||_0x3f20d9===_0xc3f7('0x4b')||_0x3f20d9==='UserId'||_0x3f20d9===_0xc3f7('0x19')||_0x3f20d9===_0xc3f7('0x69')||_0x3f20d9===_0xc3f7('0x6a')||_0x3f20d9===_0xc3f7('0x6b')||_0x3f20d9===_0xc3f7('0x6c')||_0x3f20d9==='xmd-listid'||_0x3f20d9===_0xc3f7('0x6d')||_0x3f20d9===_0xc3f7('0x6e')||_0x3f20d9===_0xc3f7('0x6f')||_0x3f20d9===_0xc3f7('0x70')||_0x3f20d9===_0xc3f7('0x71')||_0x3f20d9===_0xc3f7('0x72')||_0x3f20d9==='xmd-cdrtype'||_0x3f20d9===_0xc3f7('0x73')||_0x3f20d9==='xmd-agiafter'||_0x3f20d9===_0xc3f7('0x74')||_0x3f20d9===_0xc3f7('0x75')||_0x3f20d9===_0xc3f7('0x76')||_0x3f20d9===_0xc3f7('0x77')||_0x3f20d9===_0xc3f7('0x78')||_0x3f20d9===_0xc3f7('0x79')||_0x3f20d9===_0xc3f7('0x7a')||_0x3f20d9===_0xc3f7('0x7b')||_0x3f20d9===_0xc3f7('0x7c')||_0x3f20d9===_0xc3f7('0x75')||_0x3f20d9==='rtpaudioqosbridged'||_0x3f20d9===_0xc3f7('0x77')||_0x3f20d9===_0xc3f7('0x78')||_0x3f20d9===_0xc3f7('0x79')||_0x3f20d9===_0xc3f7('0x7a')||_0x3f20d9===_0xc3f7('0x7b')||_0x3f20d9===_0xc3f7('0x7c')||_0x3f20d9===_0xc3f7('0x7d')||_0x3f20d9===_0xc3f7('0x7e')||_0x3f20d9===_0xc3f7('0x2f')||_0x3f20d9==='statedesc'){return![];}return!![];};exports[_0xc3f7('0x7f')]=function(_0x22f6d8,_0xdd99c){var _0xd771e0,_0x9aa24e,_0x5895eb;if(_0xdd99c<=0x0){_0xdd99c=0x1;}_0xd771e0=new RegExp(_0xc3f7('0x80')+_0xdd99c+'}$');_0x9aa24e=Math[_0xc3f7('0x81')](0xa,_0xdd99c-0x1);_0x5895eb=Math['pow'](0xa,_0xdd99c)-0x1;return util[_0xc3f7('0x11')]('%s',_[_0xc3f7('0x82')](_0x22f6d8,_0xd771e0,_[_0xc3f7('0x83')](_0x9aa24e,_0x5895eb)));};exports[_0xc3f7('0x84')]=function(_0x548a10){var _0x250178=_0x548a10[_0xc3f7('0x85')](/"(.*?)"/);return _0x250178?_0x250178[0x1]:_0x548a10;};exports[_0xc3f7('0x86')]=function(_0x167bcb){var _0x160fd3=_0x167bcb['match'](/<(.*?)>/);return _0x160fd3?_0x160fd3[0x1]:_0x167bcb;};function buildNoAnswerEventPayload(_0x2cdefc,_0x95d091){var _0x2939a3=buildObj(_0x2cdefc,_0xc3f7('0x87'));if(!_[_0xc3f7('0xf')](_0x95d091['variables'])){Object[_0xc3f7('0x88')](_0x95d091[_0xc3f7('0x89')])['forEach'](function(_0x1fd085){_0x2939a3[_0x1fd085[_0xc3f7('0x8a')]()]=_0x95d091['variables'][_0x1fd085];});}return _0x2939a3;}exports[_0xc3f7('0x8b')]=buildNoAnswerEventPayload; \ No newline at end of file +var _0x8f31=['U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','hasOwnProperty','toLower','isNil','originated','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','endtime','logAgent','state','responsetime','ringtime','logLookAgent','membername','UserId','logCustomer','getSeconds','talktime','answertime','isFailure','Failure','variablesAction','BOOKED','uniqueid','originate','channelAgent','xcally-motion-preview','from-sip','timeout','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','Global','scheduledAt','scheduledat','ContactId','ListId','VoiceQueueId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','lastevent','queue','interface','voice','mandatoryDisposition','buildObj','agentReadyId','status','reachable','push','milliseconds','diff','seconds','createBody','CampaignId','idContact','campaigntype','dialAnswer','active','countglobal','callback','callbackuniqueid','sipcallid','xmd-voicequeueid','xmd-queue','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','\x5cw{0,','pow','replace','random','extractCalleridName','extractCalleridNumber','match','variables','keys','forEach','toLowerCase','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','error','logger','info','inspect','logger2','message','getCallerId','isUndefined','isEmpty','format','\x22%s\x22\x20<%s>','string','isActive','addVariables','Queue','name','calleridname','calleridnum','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format'];(function(_0x477b8a,_0x2a198d){var _0x4183f9=function(_0x35df23){while(--_0x35df23){_0x477b8a['push'](_0x477b8a['shift']());}};_0x4183f9(++_0x2a198d);}(_0x8f31,0xf4));var _0x18f3=function(_0x1e3c16,_0x372caa){_0x1e3c16=_0x1e3c16-0x0;var _0x47a0c9=_0x8f31[_0x1e3c16];return _0x47a0c9;};'use strict';var util=require(_0x18f3('0x0'));var _=require(_0x18f3('0x1'));var moment=require(_0x18f3('0x2'));var logger=require(_0x18f3('0x3'))(_0x18f3('0x4'));var ipAgi=process[_0x18f3('0x5')][_0x18f3('0x6')]||_0x18f3('0x7');var utils=require(_0x18f3('0x8'));exports[_0x18f3('0x9')]=function(_0x2eff5e){return function(_0x1a17c1){logger[_0x18f3('0xa')](_0x2eff5e,util['inspect'](_0x1a17c1,{'showHidden':![],'depth':null}));};};exports[_0x18f3('0xb')]=function(_0x149725,_0x12d98d){logger[_0x18f3('0xc')](_0x149725,util['inspect'](_0x12d98d,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x58fe73,_0x5d6299){logger[_0x18f3('0xa')](_0x58fe73,util[_0x18f3('0xd')](_0x5d6299,{'showHidden':![],'depth':null}));};exports[_0x18f3('0xe')]=function(_0x1b953c){return function(_0x343368){logger['info'](_0x1b953c,util['inspect'](_0x343368,{'showHidden':![],'depth':null}));};};exports[_0x18f3('0xf')]=function(_0x4e13af,_0x505ea6,_0xd93b71){return{'message':_0x4e13af,'unlock':_0x505ea6,'active':_0xd93b71};};exports[_0x18f3('0x10')]=function(_0x31bc95,_0x356933,_0x28626d){if(!_[_0x18f3('0x11')](_0x28626d)&&'string'===typeof _0x28626d&&!_[_0x18f3('0x12')](_0x28626d)){if(!_[_0x18f3('0x11')](_0x356933)&&'string'===typeof _0x356933&&!_[_0x18f3('0x12')](_0x356933)){return util[_0x18f3('0x13')]('\x22%s\x22\x20<%s>',_0x356933,_0x28626d);}return util[_0x18f3('0x13')](_0x18f3('0x14'),_0x28626d,_0x28626d);}if(!_[_0x18f3('0x11')](_0x31bc95)&&_0x18f3('0x15')===typeof _0x31bc95&&!_['isEmpty'](_0x31bc95)){return _0x31bc95;}return'\x22\x22\x20<>';};exports[_0x18f3('0x16')]=function(_0x4534a7){if(_['isNil'](_0x4534a7)){return![];}return _0x4534a7;};exports[_0x18f3('0x17')]=function(_0x3250b9,_0x491d17,_0x290c04,_0x43b443,_0x1d4d41,_0x3c57c4){var _0x11e9d9={'XMD-QUEUE':_0x491d17['Queue']?_0x491d17[_0x18f3('0x18')][_0x18f3('0x19')]:'','XMD-CALLERID':_0x43b443,'XMD-CALLERID-PREVIEW':_0x3c57c4?util[_0x18f3('0x13')](_0x18f3('0x14'),_0x3c57c4[_0x18f3('0x1a')],_0x3c57c4[_0x18f3('0x1b')]):_0x43b443,'XMD-DIALID':_0x1d4d41,'XMD-CONTACTID':_0x491d17['ContactId'],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x43b443,'XMD-VOICEQUEUEID':_0x491d17['VoiceQueueId'],'XMD-DIALCHANNEL':_0x290c04,'XMD-DIALTIMEOUT':_0x3250b9[_0x18f3('0x1c')]||0x1e,'XMD-DIALOPTIONS':util['format'](_0x18f3('0x1d'),_0x3250b9[_0x18f3('0x1e')]?'g':'',_[_0x18f3('0x12')](_0x3250b9[_0x18f3('0x1f')])?'':_0x18f3('0x20')),'XMD-DIALURL':_0x3250b9[_0x18f3('0x21')]||'','XMD-AGI':_0x3250b9[_0x18f3('0x22')]?util[_0x18f3('0x13')](_0x18f3('0x23'),ipAgi,_0x3250b9['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x3250b9[_0x18f3('0x1e')]?util[_0x18f3('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x3250b9[_0x18f3('0x1e')]):_0x18f3('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x3c57c4?_0x3c57c4[_0x18f3('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x3c57c4?_0x3c57c4[_0x18f3('0x26')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x18f3('0x27')};if(!_['isEmpty'](_0x3250b9['monitor_format'])){_0x11e9d9[util[_0x18f3('0x13')]('%s',_0x18f3('0x28'))]=_0x3250b9[_0x18f3('0x1f')];_0x11e9d9[util[_0x18f3('0x13')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x1d4d41;}return _0x11e9d9;};exports['toLowerVariables']=function(_0x2263d8){var _0x20378f={};for(var _0xdf9ce7 in _0x2263d8){if(_0x2263d8[_0x18f3('0x29')](_0xdf9ce7)){_0x20378f[util[_0x18f3('0x13')]('%s',_[_0x18f3('0x2a')](_0xdf9ce7))]=_0x2263d8[_0xdf9ce7];}}return{'variables':_0x20378f};};exports['updateOriginated']=function(_0x251977,_0x4e946a){if(!_[_0x18f3('0x2b')](_0x251977)){if(_0x251977[_0x18f3('0x29')]('originated')){if(_0x251977[_0x18f3('0x2c')]>0x0){_0x251977[_0x18f3('0x2c')]-=0x1;}else{logger[_0x18f3('0xa')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x4e946a);}}}else{logger[_0x18f3('0xa')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x4e946a);}};exports['logBlacklist']=function(_0x46528c){var _0x539390=moment()['format'](_0x18f3('0x2d'));_0x46528c['state']=0xd;_0x46528c[_0x18f3('0x2e')]=_0x18f3('0x2f');_0x46528c[_0x18f3('0x30')]=_0x539390;_0x46528c['responsetime']=_0x539390;_0x46528c[_0x18f3('0x31')]=_0x539390;};exports[_0x18f3('0x32')]=function(_0x291db9,_0x1e38da,_0x5d786c){var _0x13aba4=moment()[_0x18f3('0x13')](_0x18f3('0x2d'));_0x291db9[_0x18f3('0x33')]=_0x1e38da;_0x291db9[_0x18f3('0x2e')]=_0x5d786c;_0x291db9[_0x18f3('0x34')]=_0x13aba4;_0x291db9[_0x18f3('0x35')]=utils['getSeconds'](_0x291db9[_0x18f3('0x34')],_0x291db9['starttime']);};exports[_0x18f3('0x36')]=function(_0x222320,_0x293093,_0x4cb34c){_0x222320[_0x18f3('0x37')]=_0x293093;_0x222320[_0x18f3('0x38')]=_0x4cb34c;};exports[_0x18f3('0x39')]=function(_0x145045,_0x8c1579,_0x3b8ba0){var _0x194739=moment()[_0x18f3('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x145045[_0x18f3('0x33')]=_0x8c1579;_0x145045[_0x18f3('0x2e')]=_0x3b8ba0;_0x145045['responsetime']=_0x145045[_0x18f3('0x34')]?_0x145045[_0x18f3('0x34')]:_0x194739;_0x145045[_0x18f3('0x31')]=_0x145045[_0x18f3('0x31')]?_0x145045[_0x18f3('0x31')]:_0x194739;_0x145045[_0x18f3('0x35')]=utils[_0x18f3('0x3a')](_0x145045[_0x18f3('0x34')]||0x0,_0x145045[_0x18f3('0x30')]||0x0);_0x145045[_0x18f3('0x3b')]=_0x145045['answertime']?utils[_0x18f3('0x3a')](_0x145045[_0x18f3('0x31')],_0x145045[_0x18f3('0x3c')]):0x0;};exports[_0x18f3('0x3d')]=function(_0x4f5288){return _0x4f5288===_0x18f3('0x3e');};exports[_0x18f3('0x3f')]=function(_0x288b12,_0x18aebc,_0x100a37,_0x1a7b94,_0x3fc5b2){var _0x57b3ab=_0x1a7b94?'RECALL':_0x288b12['calleridname'];_0x57b3ab=_0x3fc5b2?_0x18f3('0x40'):_0x57b3ab;return{'actionid':_0x288b12[_0x18f3('0x41')],'action':_0x18f3('0x42'),'channel':_0x288b12[_0x18f3('0x43')],'callerid':util['format'](_0x18f3('0x14'),_0x57b3ab,_0x288b12['calleridnum']),'Exten':_0x18f3('0x44'),'Context':_0x18f3('0x45'),'Priority':'1','variable':_0x100a37,'timeout':(_0x18aebc[_0x18f3('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0x288b12['uniqueid']};};exports['totalGlobal']=function(_0x5562bb){return _0x5562bb['countbusyretry']+_0x5562bb[_0x18f3('0x47')]+_0x5562bb[_0x18f3('0x48')]+_0x5562bb[_0x18f3('0x49')]+_0x5562bb[_0x18f3('0x4a')];};exports[_0x18f3('0x4b')]=function(_0x43b551){var _0x49e6f6=_['clone'](_0x43b551);_0x49e6f6[_0x18f3('0x33')]=0xf;_0x49e6f6[_0x18f3('0x2e')]=_0x18f3('0x4c');return _0x49e6f6;};exports[_0x18f3('0x4d')]=function(_0x430d58,_0x26f687,_0x431fdd){var _0x24f801={};_0x24f801[_0x26f687]=_0x430d58[_0x26f687];_0x24f801['active']=![];_0x24f801[_0x18f3('0x4e')]=moment()['add'](_0x431fdd,'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss');_0x24f801[_0x18f3('0x4f')]=_0x430d58[_0x18f3('0x4f')];_0x24f801[_0x18f3('0x50')]=_0x430d58[_0x18f3('0x50')];_0x24f801[_0x18f3('0x51')]=_0x430d58[_0x18f3('0x51')]||undefined;return _0x24f801;};exports['decrementTalkink']=function(_0x131c70,_0x3a972b){if(!_[_0x18f3('0x2b')](_0x131c70)){if(_0x131c70[_0x18f3('0x52')]>0x0){_0x131c70[_0x18f3('0x52')]-=0x1;}else{logger['error'](_0x3a972b,_0x18f3('0x53'));}}else{logger[_0x18f3('0xa')](_0x3a972b,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x18f3('0x54')]=function(_0x2d94a9){if(_0x2d94a9<=0x0){return!![];}return![];};function buildObj(_0x32825c,_0x13406a,_0x3047f6){_0x32825c[_0x18f3('0x55')]=_0x13406a;_0x32825c[_0x18f3('0x19')]=_0x32825c[_0x18f3('0x56')];_0x32825c[_0x18f3('0x57')]=_0x32825c[_0x18f3('0x43')];_0x32825c['motionChannel']=_0x18f3('0x58');if(_0x3047f6){_0x32825c[_0x18f3('0x59')]=_0x3047f6[_0x18f3('0x59')];}return _0x32825c;}exports[_0x18f3('0x5a')]=buildObj;exports[_0x18f3('0x5b')]=function(_0x10c06c){var _0x5cdda=[];for(var _0x3c0033 in _0x10c06c){if(_0x10c06c[_0x18f3('0x29')](_0x3c0033)){if(!_[_0x18f3('0x2b')](_0x10c06c[_0x3c0033])&&_0x10c06c[_0x3c0033][_0x18f3('0x33')]==='not_inuse'&&_0x10c06c[_0x3c0033][_0x18f3('0x5c')]===_0x18f3('0x5d')){_0x5cdda[_0x18f3('0x5e')](_0x10c06c[_0x3c0033]['id']);}}}return _0x5cdda;};exports['getDiff']=function(_0x46a27a){var _0x44965c=moment()[_0x18f3('0x5f')](0x0);var _0x27c369=moment(_0x46a27a)[_0x18f3('0x5f')](0x0);return _0x44965c[_0x18f3('0x60')](_0x27c369,_0x18f3('0x61'));};exports[_0x18f3('0x62')]=function(_0x4d89d9){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x4d89d9['ContactId'],'ListId':_0x4d89d9[_0x18f3('0x50')],'VoiceQueueId':_0x4d89d9[_0x18f3('0x51')]||undefined,'CampaignId':_0x4d89d9[_0x18f3('0x63')]||undefined};};exports['filterKey']=function(_0x11850d){if(_0x11850d==='uniqueid'||_0x11850d===_0x18f3('0x64')||_0x11850d===_0x18f3('0x56')||_0x11850d==='type'||_0x11850d===_0x18f3('0x65')||_0x11850d===_0x18f3('0x66')||_0x11850d===_0x18f3('0x37')||_0x11850d===_0x18f3('0x43')||_0x11850d===_0x18f3('0x1a')||_0x11850d===_0x18f3('0x67')||_0x11850d===_0x18f3('0x1b')||_0x11850d===_0x18f3('0x4e')||_0x11850d==='countbusyretry'||_0x11850d===_0x18f3('0x47')||_0x11850d==='countnoanswerretry'||_0x11850d===_0x18f3('0x68')||_0x11850d===_0x18f3('0x69')||_0x11850d===_0x18f3('0x6a')||_0x11850d==='callbackat'||_0x11850d==='recallme'||_0x11850d===_0x18f3('0x4f')||_0x11850d===_0x18f3('0x50')||_0x11850d===_0x18f3('0x38')||_0x11850d===_0x18f3('0x51')||_0x11850d===_0x18f3('0x6b')||_0x11850d===_0x18f3('0x6c')||_0x11850d===_0x18f3('0x6d')||_0x11850d==='xmd-phone'||_0x11850d===_0x18f3('0x6e')||_0x11850d===_0x18f3('0x6f')||_0x11850d===_0x18f3('0x70')||_0x11850d===_0x18f3('0x71')||_0x11850d==='xmd-dialid'||_0x11850d===_0x18f3('0x72')||_0x11850d==='xmd-contactid'||_0x11850d===_0x18f3('0x73')||_0x11850d===_0x18f3('0x74')||_0x11850d===_0x18f3('0x75')||_0x11850d===_0x18f3('0x76')||_0x11850d===_0x18f3('0x77')||_0x11850d==='rtpaudioqosbridged'||_0x11850d===_0x18f3('0x78')||_0x11850d===_0x18f3('0x79')||_0x11850d===_0x18f3('0x7a')||_0x11850d===_0x18f3('0x7b')||_0x11850d===_0x18f3('0x7c')||_0x11850d===_0x18f3('0x7d')||_0x11850d===_0x18f3('0x77')||_0x11850d==='rtpaudioqosbridged'||_0x11850d==='rtpaudioqosjitter'||_0x11850d===_0x18f3('0x79')||_0x11850d==='rtpaudioqosloss'||_0x11850d===_0x18f3('0x7b')||_0x11850d==='rtpaudioqosrtt'||_0x11850d==='rtpaudioqosrttbridged'||_0x11850d===_0x18f3('0x7e')||_0x11850d==='bridgepvtcallid'||_0x11850d===_0x18f3('0x33')||_0x11850d==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x4dba1e,_0x444661){var _0x47d1de,_0x226643,_0x2eb959;if(_0x444661<=0x0){_0x444661=0x1;}_0x47d1de=new RegExp(_0x18f3('0x7f')+_0x444661+'}$');_0x226643=Math[_0x18f3('0x80')](0xa,_0x444661-0x1);_0x2eb959=Math[_0x18f3('0x80')](0xa,_0x444661)-0x1;return util[_0x18f3('0x13')]('%s',_[_0x18f3('0x81')](_0x4dba1e,_0x47d1de,_[_0x18f3('0x82')](_0x226643,_0x2eb959)));};exports[_0x18f3('0x83')]=function(_0x330285){var _0x153cf0=_0x330285['match'](/"(.*?)"/);return _0x153cf0?_0x153cf0[0x1]:_0x330285;};exports[_0x18f3('0x84')]=function(_0x17ad7a){var _0x175873=_0x17ad7a[_0x18f3('0x85')](/<(.*?)>/);return _0x175873?_0x175873[0x1]:_0x17ad7a;};function buildNoAnswerEventPayload(_0x3f66fe,_0x27b87d){var _0x5b5212=buildObj(_0x3f66fe,'noanswer');if(!_[_0x18f3('0x12')](_0x27b87d[_0x18f3('0x86')])){Object[_0x18f3('0x87')](_0x27b87d['variables'])[_0x18f3('0x88')](function(_0x4f71cf){_0x5b5212[_0x4f71cf[_0x18f3('0x89')]()]=_0x27b87d[_0x18f3('0x86')][_0x4f71cf];});}return _0x5b5212;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 7b62a9e..151601a 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 _0xaf46=['voicequeuechannelredirect','queueadd','string','number','boolean','voicequeuechannel','voicequeuechannelhangup'];(function(_0x2247d7,_0x2ad652){var _0x1d3dd0=function(_0x1a1f6f){while(--_0x1a1f6f){_0x2247d7['push'](_0x2247d7['shift']());}};_0x1d3dd0(++_0x2ad652);}(_0xaf46,0x8d));var _0x6af4=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xaf46[_0x122ef9];return _0x42fba0;};'use strict';exports[_0x6af4('0x0')]={'queue':{'type':_0x6af4('0x1'),'required':!![]},'interface':{'type':_0x6af4('0x1'),'required':!![]},'membername':{'type':_0x6af4('0x1'),'required':!![]},'penalty':{'type':_0x6af4('0x2'),'required':![]},'paused':{'type':_0x6af4('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x6af4('0x1'),'required':!![]},'interface':{'type':_0x6af4('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x6af4('0x1'),'required':!![]},'paused':{'type':_0x6af4('0x3')},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':'string','required':![]}};exports[_0x6af4('0x4')]={'uniqueid':{'type':_0x6af4('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x6af4('0x1'),'required':!![]},'filename':{'type':_0x6af4('0x1')},'format':{'type':_0x6af4('0x1')},'mixmonitorid':{'type':_0x6af4('0x1')}};exports[_0x6af4('0x5')]={'uniqueid':{'type':_0x6af4('0x1'),'required':!![]}};exports[_0x6af4('0x6')]={'uniqueid':{'type':_0x6af4('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0x6af4('0x1')}}; \ No newline at end of file +var _0x9c79=['queueadd','string','number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect'];(function(_0x3e0593,_0x296acd){var _0x36dd6b=function(_0x3cd977){while(--_0x3cd977){_0x3e0593['push'](_0x3e0593['shift']());}};_0x36dd6b(++_0x296acd);}(_0x9c79,0xb4));var _0x99c7=function(_0xb093,_0x5403c4){_0xb093=_0xb093-0x0;var _0x516bac=_0x9c79[_0xb093];return _0x516bac;};'use strict';exports[_0x99c7('0x0')]={'queue':{'type':_0x99c7('0x1'),'required':!![]},'interface':{'type':_0x99c7('0x1'),'required':!![]},'membername':{'type':_0x99c7('0x1'),'required':!![]},'penalty':{'type':_0x99c7('0x2'),'required':![]},'paused':{'type':_0x99c7('0x3'),'required':![]}};exports[_0x99c7('0x4')]={'queue':{'type':_0x99c7('0x1'),'required':!![]},'interface':{'type':_0x99c7('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0x99c7('0x1'),'required':!![]},'paused':{'type':_0x99c7('0x3')},'reason':{'type':'string','required':![]}};exports[_0x99c7('0x5')]={'module':{'type':_0x99c7('0x1'),'required':![]}};exports[_0x99c7('0x6')]={'uniqueid':{'type':_0x99c7('0x1'),'required':!![]}};exports[_0x99c7('0x7')]={'uniqueid':{'type':_0x99c7('0x1'),'required':!![]},'filename':{'type':_0x99c7('0x1')},'format':{'type':_0x99c7('0x1')},'mixmonitorid':{'type':_0x99c7('0x1')}};exports[_0x99c7('0x8')]={'uniqueid':{'type':_0x99c7('0x1'),'required':!![]}};exports[_0x99c7('0x9')]={'uniqueid':{'type':_0x99c7('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 372b72b..70823c3 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 _0x5f66=['diff','seconds','disposition','ANSWERED','outbound','duration','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','initVoiceQueues','exports','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','telephones','trunks','voiceQueues','triggers','templates','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','isNil','format','interface','total','answered','sumHoldTime','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','agents','length','name','isUndefined','initTelephones','SIP/%s','initTriggers','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','queuecallerexit','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','sumDuration','queuecallercompleteAt','queuecallerexitAt'];(function(_0x58f971,_0x3a8ae4){var _0x4ce838=function(_0x455343){while(--_0x455343){_0x58f971['push'](_0x58f971['shift']());}};_0x4ce838(++_0x3a8ae4);}(_0x5f66,0x1a0));var _0x65f6=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x5f66[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var moment=require(_0x65f6('0x0'));var util=require('util');var Agent=require(_0x65f6('0x1'));var Telephone=require(_0x65f6('0x2'));var Trunk=require(_0x65f6('0x3'));var VoiceQueue=require(_0x65f6('0x4'));var Trigger=require(_0x65f6('0x5'));var Template=require('../model/template');var Campaign=require(_0x65f6('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x65f6('0x7'));var SalesforceAccount=require(_0x65f6('0x8'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x65f6('0x9'));var DeskAccount=require(_0x65f6('0xa'));var VtigerAccount=require(_0x65f6('0xb'));var ServicenowAccount=require(_0x65f6('0xc'));var Dynamics365Account=require(_0x65f6('0xd'));var FreshsalesAccount=require(_0x65f6('0xe'));var FaxAccount=require('../model/faxAccount');function Realtime(){this['agents']={};this[_0x65f6('0xf')]={};this[_0x65f6('0x10')]={};this[_0x65f6('0x11')]={};this[_0x65f6('0x12')]={};this['campaigns']={};this[_0x65f6('0x13')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x65f6('0x14')]={};this['queueChannels']={};this[_0x65f6('0x15')]={};this['timers']={};this[_0x65f6('0x16')]={};this[_0x65f6('0x17')]={};this[_0x65f6('0x18')]={};this[_0x65f6('0x19')]={};this[_0x65f6('0x1a')]={};this[_0x65f6('0x1b')]={};this[_0x65f6('0x1c')]={};this[_0x65f6('0x1d')]={};this[_0x65f6('0x1e')]={};this[_0x65f6('0x1f')]={};this['freshsalesAccounts']={};this[_0x65f6('0x20')]={};}function freeIsNotKey(_0x49a913,_0x5dd324,_0x1693e6){var _0x5c69f8=_[_0x65f6('0x21')](_0x49a913,function(_0x1c955c){return _0x1c955c[_0x1693e6];});for(var _0x1b1cbb in _0x5dd324){if(_0x5dd324[_0x65f6('0x22')](_0x1b1cbb)){if(!_0x5c69f8[_0x1b1cbb]){delete _0x5dd324[_0x1b1cbb];}}}}function freeIsNotKeySip(_0xc8660c,_0x18380e){var _0x495dd6=_['mapKeys'](_0xc8660c,function(_0x2d538c){return util['format']('SIP/%s',_0x2d538c['name']);});for(var _0x365159 in _0x18380e){if(_0x18380e[_0x65f6('0x22')](_0x365159)){if(!_0x495dd6[_0x365159]){delete _0x18380e[_0x365159];}}}}function freeIsNotKeyAgent(_0x5114a4,_0x39e19f){var _0x270893=_[_0x65f6('0x21')](_0x5114a4,function(_0x3876ed){var _0x219ab2=_[_0x65f6('0x23')](_0x3876ed['interface'])?util[_0x65f6('0x24')]('SIP/%s',_0x3876ed['name']):_0x3876ed[_0x65f6('0x25')];return _0x219ab2;});for(var _0xd173f4 in _0x39e19f){if(_0x39e19f['hasOwnProperty'](_0xd173f4)){if(!_0x270893[_0xd173f4]){delete _0x39e19f[_0xd173f4];}}}}function clearVoiceCallReports(_0x1eeaaa){_0x1eeaaa[_0x65f6('0x26')]=0x0;_0x1eeaaa[_0x65f6('0x27')]=0x0;_0x1eeaaa[_0x65f6('0x28')]=0x0;_0x1eeaaa['sumDuration']=0x0;_0x1eeaaa[_0x65f6('0x29')]=0x0;}function clearCampaigns(_0x59ea32){if(!_[_0x65f6('0x2a')](_0x59ea32)){for(var _0x5963e0 in _0x59ea32){if(_0x59ea32['hasOwnProperty'](_0x5963e0)){_0x59ea32[_0x5963e0]['ivrTotalCallsDays']=0x0;_0x59ea32[_0x5963e0][_0x65f6('0x2b')]=0x0;}}}}function clearVoiceQueues(_0x16cde8){if(!_['isEmpty'](_0x16cde8)){for(var _0x296cd9 in _0x16cde8){if(_0x16cde8[_0x65f6('0x22')](_0x296cd9)){_0x16cde8[_0x296cd9]['total']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x27')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2c')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2d')]=0x0;_0x16cde8[_0x296cd9]['sumHoldTime']=0x0;_0x16cde8[_0x296cd9]['sumDuration']=0x0;_0x16cde8[_0x296cd9]['sumBillable']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2e')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x2f')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x30')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x31')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x32')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x33')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x34')]=0x0;_0x16cde8[_0x296cd9]['outboundDropCallsDayCallersExit']=0x0;_0x16cde8[_0x296cd9]['outboundBlacklistCallsDay']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x35')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x36')]=0x0;_0x16cde8[_0x296cd9]['outboundReCallsDay']=0x0;_0x16cde8[_0x296cd9]['outboundAnswerAgiCallsDay']=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x37')]=0x0;_0x16cde8[_0x296cd9][_0x65f6('0x38')]=!![];}}}}Realtime[_0x65f6('0x39')][_0x65f6('0x3a')]=function(_0x1217fd,_0x2d32be){for(var _0x5792a0 in _0x2d32be){if(_0x1217fd[_0x65f6('0x22')](_0x5792a0)){_0x1217fd[_0x5792a0]=_0x2d32be[_0x5792a0];}}};Realtime[_0x65f6('0x39')][_0x65f6('0x3b')]=function(){var _0x4bc037=this;return function(_0x217f35){if(_0x217f35){freeIsNotKeyAgent(_0x217f35,_0x4bc037[_0x65f6('0x3c')]);for(var _0xbaed3c=0x0,_0x45510a={};_0xbaed3c<_0x217f35[_0x65f6('0x3d')];_0xbaed3c+=0x1){_0x45510a=_0x217f35[_0xbaed3c];var _0x2f054c=_['isNil'](_0x45510a[_0x65f6('0x25')])?util[_0x65f6('0x24')]('SIP/%s',_0x45510a[_0x65f6('0x3e')]):_0x45510a['interface'];if(_[_0x65f6('0x3f')](_0x4bc037['agents'][_0x2f054c])){_0x4bc037[_0x65f6('0x3c')][_0x2f054c]=new Agent(_0x45510a);}else{_0x4bc037[_0x65f6('0x3a')](_0x4bc037['agents'][_0x2f054c],_0x45510a);}}}return _0x4bc037[_0x65f6('0x3c')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x40')]=function(){var _0x515648=this;return function(_0x582c7e){if(_0x582c7e){freeIsNotKeySip(_0x582c7e,_0x515648[_0x65f6('0xf')]);for(var _0x4c0df4=0x0,_0x26de30={};_0x4c0df4<_0x582c7e['length'];_0x4c0df4+=0x1){_0x26de30=_0x582c7e[_0x4c0df4];if(_[_0x65f6('0x3f')](_0x515648[_0x65f6('0xf')][util['format'](_0x65f6('0x41'),_0x26de30['name'])])){_0x515648['telephones'][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x26de30[_0x65f6('0x3e')])]=new Telephone(_0x26de30);}else{_0x515648[_0x65f6('0x3a')](_0x515648[_0x65f6('0xf')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x26de30[_0x65f6('0x3e')])],_0x26de30);}}}return _0x515648['telephones'];};};Realtime[_0x65f6('0x39')]['initTrunks']=function(){var _0x12a589=this;return function(_0xa4394a){if(_0xa4394a){freeIsNotKeySip(_0xa4394a,_0x12a589[_0x65f6('0x10')]);for(var _0x2ea7f7=0x0,_0x5ef5c2={};_0x2ea7f7<_0xa4394a[_0x65f6('0x3d')];_0x2ea7f7+=0x1){_0x5ef5c2=_0xa4394a[_0x2ea7f7];if(_[_0x65f6('0x3f')](_0x12a589[_0x65f6('0x10')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x5ef5c2[_0x65f6('0x3e')])])){_0x12a589[_0x65f6('0x10')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x5ef5c2['name'])]=new Trunk(_0x5ef5c2);}else{_0x12a589[_0x65f6('0x3a')](_0x12a589[_0x65f6('0x10')][util[_0x65f6('0x24')](_0x65f6('0x41'),_0x5ef5c2[_0x65f6('0x3e')])],_0x5ef5c2);}}}return _0x12a589[_0x65f6('0x10')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x42')]=function(){var _0x461393=this;return function(_0x2abbed){if(_0x2abbed){freeIsNotKey(_0x2abbed,_0x461393[_0x65f6('0x12')],'id');for(var _0x2c008a=0x0,_0x6c4d94={};_0x2c008a<_0x2abbed[_0x65f6('0x3d')];_0x2c008a+=0x1){_0x6c4d94=_0x2abbed[_0x2c008a];if(_[_0x65f6('0x3f')](_0x461393[_0x65f6('0x12')][_0x6c4d94['id']])){_0x461393['triggers'][_0x6c4d94['id']]=new Trigger(_0x6c4d94);}else{_0x461393[_0x65f6('0x3a')](_0x461393[_0x65f6('0x12')][_0x6c4d94['id']],_0x6c4d94);}}}return _0x461393[_0x65f6('0x12')];};};Realtime[_0x65f6('0x39')]['initTemplates']=function(){var _0x1bf5bf=this;return function(_0x2d0dac){if(_0x2d0dac){freeIsNotKey(_0x2d0dac,_0x1bf5bf[_0x65f6('0x13')],'id');for(var _0x5e69b4=0x0,_0x2dbab3={};_0x5e69b4<_0x2d0dac[_0x65f6('0x3d')];_0x5e69b4+=0x1){_0x2dbab3=_0x2d0dac[_0x5e69b4];if(_[_0x65f6('0x3f')](_0x1bf5bf[_0x65f6('0x13')][_0x2dbab3['id']])){_0x1bf5bf['templates'][_0x2dbab3['id']]=new Template(_0x2dbab3);}else{_0x1bf5bf[_0x65f6('0x3a')](_0x1bf5bf['templates'][_0x2dbab3['id']],_0x2dbab3);}}}return _0x1bf5bf[_0x65f6('0x13')];};};Realtime[_0x65f6('0x39')]['initZendeskAccounts']=function(){var _0xf754ee=this;return function(_0x5085db){if(_0x5085db){freeIsNotKey(_0x5085db,_0xf754ee[_0x65f6('0x17')],'id');for(var _0x4d9b76=0x0,_0x2d1706={};_0x4d9b76<_0x5085db[_0x65f6('0x3d')];_0x4d9b76+=0x1){_0x2d1706=_0x5085db[_0x4d9b76];if(_[_0x65f6('0x3f')](_0xf754ee[_0x65f6('0x17')][_0x2d1706['id']])){_0xf754ee['zendeskAccounts'][_0x2d1706['id']]=new ZendeskAccount(_0x2d1706);}else{_0xf754ee['mergeFromDatabase'](_0xf754ee[_0x65f6('0x17')][_0x2d1706['id']],_0x2d1706);}}}return _0xf754ee[_0x65f6('0x17')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x43')]=function(){var _0x3b907c=this;return function(_0x2d6ab9){if(_0x2d6ab9){freeIsNotKey(_0x2d6ab9,_0x3b907c[_0x65f6('0x18')],'id');for(var _0x41690c=0x0,_0x414f49={};_0x41690c<_0x2d6ab9['length'];_0x41690c+=0x1){_0x414f49=_0x2d6ab9[_0x41690c];if(_[_0x65f6('0x3f')](_0x3b907c[_0x65f6('0x18')][_0x414f49['id']])){_0x3b907c[_0x65f6('0x18')][_0x414f49['id']]=new SalesforceAccount(_0x414f49);}else{_0x3b907c['mergeFromDatabase'](_0x3b907c[_0x65f6('0x18')][_0x414f49['id']],_0x414f49);}}}return _0x3b907c[_0x65f6('0x18')];};};Realtime['prototype'][_0x65f6('0x44')]=function(){var _0x253d52=this;return function(_0x57eb04){if(_0x57eb04){freeIsNotKey(_0x57eb04,_0x253d52[_0x65f6('0x1a')],'id');for(var _0x4f96c4=0x0,_0x247be3={};_0x4f96c4<_0x57eb04[_0x65f6('0x3d')];_0x4f96c4+=0x1){_0x247be3=_0x57eb04[_0x4f96c4];if(_[_0x65f6('0x3f')](_0x253d52['freshdeskAccounts'][_0x247be3['id']])){_0x253d52[_0x65f6('0x1a')][_0x247be3['id']]=new FreshdeskAccount(_0x247be3);}else{_0x253d52[_0x65f6('0x3a')](_0x253d52['freshdeskAccounts'][_0x247be3['id']],_0x247be3);}}}return _0x253d52[_0x65f6('0x1a')];};};Realtime[_0x65f6('0x39')]['initZohoAccounts']=function(){var _0x34d6a9=this;return function(_0x344c0e){if(_0x344c0e){freeIsNotKey(_0x344c0e,_0x34d6a9[_0x65f6('0x1b')],'id');for(var _0x25d504=0x0,_0x234fa7={};_0x25d504<_0x344c0e[_0x65f6('0x3d')];_0x25d504+=0x1){_0x234fa7=_0x344c0e[_0x25d504];if(_[_0x65f6('0x3f')](_0x34d6a9[_0x65f6('0x1b')][_0x234fa7['id']])){_0x34d6a9['zohoAccounts'][_0x234fa7['id']]=new ZohoAccount(_0x234fa7);}else{_0x34d6a9['mergeFromDatabase'](_0x34d6a9['zohoAccounts'][_0x234fa7['id']],_0x234fa7);}}}return _0x34d6a9[_0x65f6('0x1b')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x45')]=function(){var _0x20c322=this;return function(_0x545445){if(_0x545445){freeIsNotKey(_0x545445,_0x20c322[_0x65f6('0x1c')],'id');for(var _0x2032b9=0x0,_0x9ff849={};_0x2032b9<_0x545445['length'];_0x2032b9+=0x1){_0x9ff849=_0x545445[_0x2032b9];if(_[_0x65f6('0x3f')](_0x20c322[_0x65f6('0x1c')][_0x9ff849['id']])){_0x20c322[_0x65f6('0x1c')][_0x9ff849['id']]=new DeskAccount(_0x9ff849);}else{_0x20c322['mergeFromDatabase'](_0x20c322['deskAccounts'][_0x9ff849['id']],_0x9ff849);}}}return _0x20c322[_0x65f6('0x1c')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x46')]=function(){var _0x39364f=this;return function(_0x2a76b3){if(_0x2a76b3){freeIsNotKey(_0x2a76b3,_0x39364f[_0x65f6('0x19')],'id');for(var _0x35d77f=0x0,_0x138334={};_0x35d77f<_0x2a76b3[_0x65f6('0x3d')];_0x35d77f+=0x1){_0x138334=_0x2a76b3[_0x35d77f];if(_[_0x65f6('0x3f')](_0x39364f[_0x65f6('0x19')][_0x138334['id']])){_0x39364f[_0x65f6('0x19')][_0x138334['id']]=new SugarcrmAccount(_0x138334);}else{_0x39364f[_0x65f6('0x3a')](_0x39364f[_0x65f6('0x19')][_0x138334['id']],_0x138334);}}}return _0x39364f['sugarcrmAccounts'];};};Realtime[_0x65f6('0x39')][_0x65f6('0x47')]=function(){var _0x42a805=this;return function(_0x4b4efe){if(_0x4b4efe){freeIsNotKey(_0x4b4efe,_0x42a805[_0x65f6('0x1d')],'id');for(var _0x16dec0=0x0,_0x4638c9={};_0x16dec0<_0x4b4efe[_0x65f6('0x3d')];_0x16dec0+=0x1){_0x4638c9=_0x4b4efe[_0x16dec0];if(_['isUndefined'](_0x42a805[_0x65f6('0x1d')][_0x4638c9['id']])){_0x42a805[_0x65f6('0x1d')][_0x4638c9['id']]=new VtigerAccount(_0x4638c9);}else{_0x42a805[_0x65f6('0x3a')](_0x42a805[_0x65f6('0x1d')][_0x4638c9['id']],_0x4638c9);}}}return _0x42a805['vtigerAccounts'];};};Realtime[_0x65f6('0x39')][_0x65f6('0x48')]=function(){var _0x5c55e4=this;return function(_0x28682b){if(_0x28682b){freeIsNotKey(_0x28682b,_0x5c55e4[_0x65f6('0x1e')],'id');for(var _0x36c316=0x0,_0x51549d={};_0x36c316<_0x28682b[_0x65f6('0x3d')];_0x36c316+=0x1){_0x51549d=_0x28682b[_0x36c316];if(_[_0x65f6('0x3f')](_0x5c55e4[_0x65f6('0x1e')][_0x51549d['id']])){_0x5c55e4[_0x65f6('0x1e')][_0x51549d['id']]=new ServicenowAccount(_0x51549d);}else{_0x5c55e4[_0x65f6('0x3a')](_0x5c55e4[_0x65f6('0x1e')][_0x51549d['id']],_0x51549d);}}}return _0x5c55e4['servicenowAccounts'];};};Realtime['prototype']['initDynamics365Accounts']=function(){var _0x336a7d=this;return function(_0x367d95){if(_0x367d95){freeIsNotKey(_0x367d95,_0x336a7d[_0x65f6('0x1f')],'id');for(var _0x471bec=0x0,_0xab6f0={};_0x471bec<_0x367d95[_0x65f6('0x3d')];_0x471bec+=0x1){_0xab6f0=_0x367d95[_0x471bec];if(_['isUndefined'](_0x336a7d[_0x65f6('0x1f')][_0xab6f0['id']])){_0x336a7d[_0x65f6('0x1f')][_0xab6f0['id']]=new Dynamics365Account(_0xab6f0);}else{_0x336a7d['mergeFromDatabase'](_0x336a7d[_0x65f6('0x1f')][_0xab6f0['id']],_0xab6f0);}}}return _0x336a7d[_0x65f6('0x1f')];};};Realtime[_0x65f6('0x39')]['initFreshsalesAccounts']=function(){var _0x23c441=this;return function(_0x448c9a){if(_0x448c9a){freeIsNotKey(_0x448c9a,_0x23c441['freshsalesAccounts'],'id');for(var _0x271d76=0x0,_0x3edc6b={};_0x271d76<_0x448c9a[_0x65f6('0x3d')];_0x271d76+=0x1){_0x3edc6b=_0x448c9a[_0x271d76];if(_[_0x65f6('0x3f')](_0x23c441[_0x65f6('0x49')][_0x3edc6b['id']])){_0x23c441[_0x65f6('0x49')][_0x3edc6b['id']]=new FreshsalesAccount(_0x3edc6b);}else{_0x23c441[_0x65f6('0x3a')](_0x23c441['freshsalesAccounts'][_0x3edc6b['id']],_0x3edc6b);}}}return _0x23c441['freshsalesAccounts'];};};Realtime[_0x65f6('0x39')][_0x65f6('0x4a')]=function(){var _0x4a9524=this;return function(_0x417ba5){for(var _0x5f3df9=0x0;_0x5f3df9<_0x417ba5[_0x65f6('0x3d')];_0x5f3df9+=0x1){_['merge'](_0x4a9524[_0x65f6('0x11')][_0x417ba5[_0x5f3df9][_0x65f6('0x3e')]],_0x417ba5[_0x5f3df9]);}return _0x4a9524[_0x65f6('0x11')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x4b')]=function(){var _0x264e6c=this;return function(_0x1aaf75){clearVoiceQueues(_0x264e6c[_0x65f6('0x11')]);if(_0x1aaf75){_0x1aaf75=_[_0x65f6('0x4c')](_0x1aaf75,'uniqueid');for(var _0x480190 in _0x1aaf75){if(_0x1aaf75[_0x65f6('0x22')](_0x480190)){for(var _0x13ee4b=0x0;_0x13ee4b<_0x1aaf75[_0x480190][_0x65f6('0x3d')];_0x13ee4b+=0x1){var _0x51497f=_0x1aaf75[_0x480190][_0x13ee4b]['queue'];if(_0x264e6c[_0x65f6('0x11')][_0x51497f]){if(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x4d')]){_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x2c')]+=0x1;}if(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x4e')]){_0x264e6c[_0x65f6('0x11')][_0x51497f]['abandoned']+=0x1;}_0x264e6c['voiceQueues'][_0x51497f][_0x65f6('0x28')]+=moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x4f')])['diff'](moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x50')]),'seconds')||0x0;if(_0x13ee4b===_0x1aaf75[_0x480190][_0x65f6('0x3d')]-0x1){_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x51')]+=moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x52')]||_0x1aaf75[_0x480190][_0x13ee4b]['queuecallerabandonAt']||_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x53')])[_0x65f6('0x54')](moment(_0x1aaf75[_0x480190][_0x13ee4b][_0x65f6('0x50')]),'seconds')||0x0;_0x264e6c['voiceQueues'][_0x51497f][_0x65f6('0x26')]+=0x1;if(_0x1aaf75[_0x480190][_0x13ee4b]['queuecallercomplete']){_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x27')]+=0x1;_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x29')]+=moment(_0x1aaf75[_0x480190][_0x13ee4b]['queuecallercompleteAt'])['diff'](moment(_0x1aaf75[_0x480190][_0x13ee4b]['queuecallerleaveAt']),_0x65f6('0x55'))||0x0;}}else{_0x264e6c[_0x65f6('0x11')][_0x51497f][_0x65f6('0x51')]+=_0x264e6c['voiceQueues'][_0x51497f][_0x65f6('0x28')]||0x0;}}}}}}return _0x264e6c[_0x65f6('0x11')];};};Realtime[_0x65f6('0x39')]['initVoiceCallReports']=function(){var _0x40d0f7=this;return function(_0x15809e){clearVoiceCallReports(_0x40d0f7['outbound']);if(_0x15809e){for(var _0x758e80=0x0;_0x758e80<_0x15809e[_0x65f6('0x3d')];_0x758e80+=0x1){_0x40d0f7['outbound'][_0x65f6('0x26')]+=0x1;_0x40d0f7['outbound'][_0x65f6('0x51')]+=_0x15809e[_0x758e80]['duration'];if(_0x15809e[_0x758e80][_0x65f6('0x56')]===_0x65f6('0x57')){_0x40d0f7['outbound'][_0x65f6('0x27')]+=0x1;_0x40d0f7[_0x65f6('0x58')][_0x65f6('0x28')]+=_0x15809e[_0x758e80][_0x65f6('0x59')]-_0x15809e[_0x758e80][_0x65f6('0x5a')]||0x0;_0x40d0f7[_0x65f6('0x58')][_0x65f6('0x29')]+=_0x15809e[_0x758e80][_0x65f6('0x5a')];}}}return _0x40d0f7[_0x65f6('0x58')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x5b')]=function(){var _0x574d84=this;return function(_0x10a661){if(_0x10a661){freeIsNotKey(_0x10a661,_0x574d84[_0x65f6('0x5c')],_0x65f6('0x3e'));for(var _0x219e42=0x0,_0x5694f9={};_0x219e42<_0x10a661[_0x65f6('0x3d')];_0x219e42+=0x1){_0x5694f9=_0x10a661[_0x219e42];if(_[_0x65f6('0x3f')](_0x574d84['campaigns'][_0x5694f9[_0x65f6('0x3e')]])){_0x574d84['campaigns'][_0x5694f9[_0x65f6('0x3e')]]=new Campaign(_0x5694f9);}else{_0x574d84['mergeFromDatabase'](_0x574d84[_0x65f6('0x5c')][_0x5694f9[_0x65f6('0x3e')]],_0x5694f9);_0x574d84['campaigns'][_0x5694f9['name']][_0x65f6('0x5d')]=_0x5694f9[_0x65f6('0x5e')]?_0x5694f9['SquareProject'][_0x65f6('0x3e')]:undefined;}}}return _0x574d84[_0x65f6('0x5c')];};};Realtime[_0x65f6('0x39')]['initVoiceExtensions']=function(){var _0x1348ec=this;return function(_0x246510){if(_0x246510){freeIsNotKey(_0x246510,_0x1348ec['voiceExtensions'],'id');for(var _0x36b8de=0x0,_0x504b39={};_0x36b8de<_0x246510[_0x65f6('0x3d')];_0x36b8de+=0x1){_0x504b39=_0x246510[_0x36b8de];if(_['isUndefined'](_0x1348ec['voiceExtensions'][_0x504b39['id']])){_0x1348ec[_0x65f6('0x5f')][_0x504b39['id']]=new VoiceExtension(_0x504b39);}else{_0x1348ec[_0x65f6('0x3a')](_0x1348ec[_0x65f6('0x5f')][_0x504b39['id']],_0x504b39);}}}return _0x1348ec[_0x65f6('0x5f')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x60')]=function(){var _0x1ac46f=this;return function(_0x1f4e2c){clearCampaigns(_0x1ac46f['campaigns']);for(var _0x494904=0x0;_0x494904<_0x1f4e2c[_0x65f6('0x3d')];_0x494904+=0x1){_['merge'](_0x1ac46f[_0x65f6('0x5c')][_0x1f4e2c[_0x494904][_0x65f6('0x3e')]],_0x1f4e2c[_0x494904]);}return _0x1ac46f[_0x65f6('0x5c')];};};Realtime[_0x65f6('0x39')][_0x65f6('0x61')]=function(){var _0x56bd9d=this;return function(_0x398cac){if(_0x398cac){freeIsNotKey(_0x398cac,_0x56bd9d[_0x65f6('0x20')],'id');for(var _0x14c908=0x0,_0x576ecd={};_0x14c908<_0x398cac[_0x65f6('0x3d')];_0x14c908+=0x1){_0x576ecd=_0x398cac[_0x14c908];if(_[_0x65f6('0x3f')](_0x56bd9d[_0x65f6('0x20')][_0x576ecd['id']])){_0x56bd9d[_0x65f6('0x20')][_0x576ecd['id']]=new FaxAccount(_0x576ecd);}else{_0x56bd9d[_0x65f6('0x3a')](_0x56bd9d[_0x65f6('0x20')][_0x576ecd['id']],_0x576ecd);}}}return _0x56bd9d['faxAccounts'];};};Realtime['prototype'][_0x65f6('0x62')]=function(){var _0x10d744=this;return function(_0x10c916){if(_0x10c916){freeIsNotKey(_0x10c916,_0x10d744[_0x65f6('0x11')],'name');for(var _0x4bda86=0x0,_0x336076={};_0x4bda86<_0x10c916[_0x65f6('0x3d')];_0x4bda86+=0x1){_0x336076=_0x10c916[_0x4bda86];if(_[_0x65f6('0x3f')](_0x10d744[_0x65f6('0x11')][_0x336076[_0x65f6('0x3e')]])){_0x10d744[_0x65f6('0x11')][_0x336076['name']]=new VoiceQueue(_0x336076);}else{_0x10d744['mergeFromDatabase'](_0x10d744['voiceQueues'][_0x336076[_0x65f6('0x3e')]],_0x336076);}}}return _0x10d744[_0x65f6('0x11')];};};module[_0x65f6('0x63')]=Realtime; \ No newline at end of file +var _0x5f2f=['initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','voiceQueues','templates','outbound','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','interface','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','answered','unmanaged','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','queueStatusComplete','prototype','mergeFromDatabase','length','isUndefined','initTelephones','SIP/%s','trunks','initTriggers','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','salesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','voiceExtensions'];(function(_0x3711e2,_0x1468e1){var _0x18a556=function(_0x5e0923){while(--_0x5e0923){_0x3711e2['push'](_0x3711e2['shift']());}};_0x18a556(++_0x1468e1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1e731e,_0x25acd5){_0x1e731e=_0x1e731e-0x0;var _0x37ba4c=_0x5f2f[_0x1e731e];return _0x37ba4c;};'use strict';var _=require(_0xf5f2('0x0'));var moment=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var Agent=require(_0xf5f2('0x3'));var Telephone=require(_0xf5f2('0x4'));var Trunk=require(_0xf5f2('0x5'));var VoiceQueue=require(_0xf5f2('0x6'));var Trigger=require(_0xf5f2('0x7'));var Template=require('../model/template');var Campaign=require('../model/campaign');var VoiceExtension=require(_0xf5f2('0x8'));var ZendeskAccount=require(_0xf5f2('0x9'));var SalesforceAccount=require(_0xf5f2('0xa'));var FreshdeskAccount=require(_0xf5f2('0xb'));var SugarcrmAccount=require(_0xf5f2('0xc'));var ZohoAccount=require(_0xf5f2('0xd'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xf5f2('0xe'));var ServicenowAccount=require(_0xf5f2('0xf'));var Dynamics365Account=require(_0xf5f2('0x10'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require(_0xf5f2('0x11'));function Realtime(){this[_0xf5f2('0x12')]={};this[_0xf5f2('0x13')]={};this['trunks']={};this[_0xf5f2('0x14')]={};this['triggers']={};this['campaigns']={};this[_0xf5f2('0x15')]={};this[_0xf5f2('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xf5f2('0x17')]={};this[_0xf5f2('0x18')]={};this[_0xf5f2('0x19')]={};this[_0xf5f2('0x1a')]={};this[_0xf5f2('0x1b')]={};this[_0xf5f2('0x1c')]={};this['salesforceAccounts']={};this[_0xf5f2('0x1d')]={};this[_0xf5f2('0x1e')]={};this[_0xf5f2('0x1f')]={};this[_0xf5f2('0x20')]={};this[_0xf5f2('0x21')]={};this['servicenowAccounts']={};this[_0xf5f2('0x22')]={};this[_0xf5f2('0x23')]={};this[_0xf5f2('0x24')]={};}function freeIsNotKey(_0x1b6dd2,_0x23e23a,_0x3a9dbb){var _0xdb61b3=_[_0xf5f2('0x25')](_0x1b6dd2,function(_0x11f702){return _0x11f702[_0x3a9dbb];});for(var _0x228ace in _0x23e23a){if(_0x23e23a[_0xf5f2('0x26')](_0x228ace)){if(!_0xdb61b3[_0x228ace]){delete _0x23e23a[_0x228ace];}}}}function freeIsNotKeySip(_0x28e097,_0x4ff59b){var _0x3ee69=_[_0xf5f2('0x25')](_0x28e097,function(_0x626999){return util[_0xf5f2('0x27')]('SIP/%s',_0x626999[_0xf5f2('0x28')]);});for(var _0x47101e in _0x4ff59b){if(_0x4ff59b['hasOwnProperty'](_0x47101e)){if(!_0x3ee69[_0x47101e]){delete _0x4ff59b[_0x47101e];}}}}function freeIsNotKeyAgent(_0x47acfc,_0x2d2805){var _0x388e6c=_['mapKeys'](_0x47acfc,function(_0x45b74f){var _0x170042=_[_0xf5f2('0x29')](_0x45b74f[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x45b74f[_0xf5f2('0x28')]):_0x45b74f[_0xf5f2('0x2a')];return _0x170042;});for(var _0x4e8bda in _0x2d2805){if(_0x2d2805[_0xf5f2('0x26')](_0x4e8bda)){if(!_0x388e6c[_0x4e8bda]){delete _0x2d2805[_0x4e8bda];}}}}function clearVoiceCallReports(_0x287ad5){_0x287ad5['total']=0x0;_0x287ad5['answered']=0x0;_0x287ad5[_0xf5f2('0x2b')]=0x0;_0x287ad5[_0xf5f2('0x2c')]=0x0;_0x287ad5[_0xf5f2('0x2d')]=0x0;}function clearCampaigns(_0x1a5bb3){if(!_[_0xf5f2('0x2e')](_0x1a5bb3)){for(var _0x788a8d in _0x1a5bb3){if(_0x1a5bb3[_0xf5f2('0x26')](_0x788a8d)){_0x1a5bb3[_0x788a8d][_0xf5f2('0x2f')]=0x0;_0x1a5bb3[_0x788a8d][_0xf5f2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x4ab014){if(!_[_0xf5f2('0x2e')](_0x4ab014)){for(var _0x102449 in _0x4ab014){if(_0x4ab014[_0xf5f2('0x26')](_0x102449)){_0x4ab014[_0x102449][_0xf5f2('0x31')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x32')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x33')]=0x0;_0x4ab014[_0x102449]['abandoned']=0x0;_0x4ab014[_0x102449]['sumHoldTime']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2c')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x2d')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundNoAnswerCallsDay']=0x0;_0x4ab014[_0x102449]['outboundBusyCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x35')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x36')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x37')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x38')]=0x0;_0x4ab014[_0x102449][_0xf5f2('0x39')]=0x0;_0x4ab014[_0x102449]['outboundBlacklistCallsDay']=0x0;_0x4ab014[_0x102449]['outboundOriginateFailureCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3a')]=0x0;_0x4ab014[_0x102449]['outboundReCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x34')]=0x0;_0x4ab014[_0x102449]['outboundAnswerCallsDay']=0x0;_0x4ab014[_0x102449][_0xf5f2('0x3b')]=!![];}}}}Realtime[_0xf5f2('0x3c')][_0xf5f2('0x3d')]=function(_0x428770,_0x256bd9){for(var _0x277eee in _0x256bd9){if(_0x428770[_0xf5f2('0x26')](_0x277eee)){_0x428770[_0x277eee]=_0x256bd9[_0x277eee];}}};Realtime[_0xf5f2('0x3c')]['initAgents']=function(){var _0x4149e6=this;return function(_0x43e4ff){if(_0x43e4ff){freeIsNotKeyAgent(_0x43e4ff,_0x4149e6[_0xf5f2('0x12')]);for(var _0x43c77d=0x0,_0x1408b9={};_0x43c77d<_0x43e4ff[_0xf5f2('0x3e')];_0x43c77d+=0x1){_0x1408b9=_0x43e4ff[_0x43c77d];var _0x297c0c=_['isNil'](_0x1408b9[_0xf5f2('0x2a')])?util[_0xf5f2('0x27')]('SIP/%s',_0x1408b9[_0xf5f2('0x28')]):_0x1408b9['interface'];if(_[_0xf5f2('0x3f')](_0x4149e6[_0xf5f2('0x12')][_0x297c0c])){_0x4149e6[_0xf5f2('0x12')][_0x297c0c]=new Agent(_0x1408b9);}else{_0x4149e6[_0xf5f2('0x3d')](_0x4149e6['agents'][_0x297c0c],_0x1408b9);}}}return _0x4149e6['agents'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x40')]=function(){var _0x20eb74=this;return function(_0x4ec8fb){if(_0x4ec8fb){freeIsNotKeySip(_0x4ec8fb,_0x20eb74[_0xf5f2('0x13')]);for(var _0x4f7f80=0x0,_0x9da533={};_0x4f7f80<_0x4ec8fb['length'];_0x4f7f80+=0x1){_0x9da533=_0x4ec8fb[_0x4f7f80];if(_[_0xf5f2('0x3f')](_0x20eb74[_0xf5f2('0x13')][util['format'](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])])){_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')]('SIP/%s',_0x9da533['name'])]=new Telephone(_0x9da533);}else{_0x20eb74[_0xf5f2('0x3d')](_0x20eb74[_0xf5f2('0x13')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x9da533[_0xf5f2('0x28')])],_0x9da533);}}}return _0x20eb74[_0xf5f2('0x13')];};};Realtime[_0xf5f2('0x3c')]['initTrunks']=function(){var _0x110fe5=this;return function(_0x3b4ea6){if(_0x3b4ea6){freeIsNotKeySip(_0x3b4ea6,_0x110fe5['trunks']);for(var _0xc6a1ae=0x0,_0x3f3895={};_0xc6a1ae<_0x3b4ea6[_0xf5f2('0x3e')];_0xc6a1ae+=0x1){_0x3f3895=_0x3b4ea6[_0xc6a1ae];if(_[_0xf5f2('0x3f')](_0x110fe5[_0xf5f2('0x42')][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])])){_0x110fe5['trunks'][util[_0xf5f2('0x27')](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])]=new Trunk(_0x3f3895);}else{_0x110fe5['mergeFromDatabase'](_0x110fe5['trunks'][util['format'](_0xf5f2('0x41'),_0x3f3895[_0xf5f2('0x28')])],_0x3f3895);}}}return _0x110fe5['trunks'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x43')]=function(){var _0x28e33f=this;return function(_0x31f86c){if(_0x31f86c){freeIsNotKey(_0x31f86c,_0x28e33f[_0xf5f2('0x44')],'id');for(var _0x2b3b1c=0x0,_0x1a6ec1={};_0x2b3b1c<_0x31f86c[_0xf5f2('0x3e')];_0x2b3b1c+=0x1){_0x1a6ec1=_0x31f86c[_0x2b3b1c];if(_[_0xf5f2('0x3f')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']])){_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']]=new Trigger(_0x1a6ec1);}else{_0x28e33f[_0xf5f2('0x3d')](_0x28e33f[_0xf5f2('0x44')][_0x1a6ec1['id']],_0x1a6ec1);}}}return _0x28e33f[_0xf5f2('0x44')];};};Realtime['prototype'][_0xf5f2('0x45')]=function(){var _0x578c93=this;return function(_0x3d62c1){if(_0x3d62c1){freeIsNotKey(_0x3d62c1,_0x578c93[_0xf5f2('0x15')],'id');for(var _0x218def=0x0,_0x36a4b0={};_0x218def<_0x3d62c1[_0xf5f2('0x3e')];_0x218def+=0x1){_0x36a4b0=_0x3d62c1[_0x218def];if(_[_0xf5f2('0x3f')](_0x578c93['templates'][_0x36a4b0['id']])){_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']]=new Template(_0x36a4b0);}else{_0x578c93[_0xf5f2('0x3d')](_0x578c93[_0xf5f2('0x15')][_0x36a4b0['id']],_0x36a4b0);}}}return _0x578c93[_0xf5f2('0x15')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x46')]=function(){var _0xf638ff=this;return function(_0x297f07){if(_0x297f07){freeIsNotKey(_0x297f07,_0xf638ff['zendeskAccounts'],'id');for(var _0x35dece=0x0,_0x33ec29={};_0x35dece<_0x297f07[_0xf5f2('0x3e')];_0x35dece+=0x1){_0x33ec29=_0x297f07[_0x35dece];if(_['isUndefined'](_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']])){_0xf638ff[_0xf5f2('0x1c')][_0x33ec29['id']]=new ZendeskAccount(_0x33ec29);}else{_0xf638ff[_0xf5f2('0x3d')](_0xf638ff['zendeskAccounts'][_0x33ec29['id']],_0x33ec29);}}}return _0xf638ff['zendeskAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x47')]=function(){var _0x5db519=this;return function(_0x14aa81){if(_0x14aa81){freeIsNotKey(_0x14aa81,_0x5db519['salesforceAccounts'],'id');for(var _0x740321=0x0,_0x497eb8={};_0x740321<_0x14aa81[_0xf5f2('0x3e')];_0x740321+=0x1){_0x497eb8=_0x14aa81[_0x740321];if(_['isUndefined'](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']])){_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']]=new SalesforceAccount(_0x497eb8);}else{_0x5db519[_0xf5f2('0x3d')](_0x5db519[_0xf5f2('0x48')][_0x497eb8['id']],_0x497eb8);}}}return _0x5db519['salesforceAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x49')]=function(){var _0x4f6b01=this;return function(_0x58213b){if(_0x58213b){freeIsNotKey(_0x58213b,_0x4f6b01[_0xf5f2('0x1e')],'id');for(var _0x3dc0c4=0x0,_0x57782c={};_0x3dc0c4<_0x58213b[_0xf5f2('0x3e')];_0x3dc0c4+=0x1){_0x57782c=_0x58213b[_0x3dc0c4];if(_[_0xf5f2('0x3f')](_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']])){_0x4f6b01[_0xf5f2('0x1e')][_0x57782c['id']]=new FreshdeskAccount(_0x57782c);}else{_0x4f6b01['mergeFromDatabase'](_0x4f6b01['freshdeskAccounts'][_0x57782c['id']],_0x57782c);}}}return _0x4f6b01[_0xf5f2('0x1e')];};};Realtime[_0xf5f2('0x3c')]['initZohoAccounts']=function(){var _0x40eef=this;return function(_0x43fc49){if(_0x43fc49){freeIsNotKey(_0x43fc49,_0x40eef[_0xf5f2('0x1f')],'id');for(var _0x14029e=0x0,_0x2b038e={};_0x14029e<_0x43fc49[_0xf5f2('0x3e')];_0x14029e+=0x1){_0x2b038e=_0x43fc49[_0x14029e];if(_[_0xf5f2('0x3f')](_0x40eef['zohoAccounts'][_0x2b038e['id']])){_0x40eef['zohoAccounts'][_0x2b038e['id']]=new ZohoAccount(_0x2b038e);}else{_0x40eef[_0xf5f2('0x3d')](_0x40eef[_0xf5f2('0x1f')][_0x2b038e['id']],_0x2b038e);}}}return _0x40eef[_0xf5f2('0x1f')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4a')]=function(){var _0x5a861d=this;return function(_0xdb1106){if(_0xdb1106){freeIsNotKey(_0xdb1106,_0x5a861d[_0xf5f2('0x20')],'id');for(var _0x18b124=0x0,_0x519c24={};_0x18b124<_0xdb1106[_0xf5f2('0x3e')];_0x18b124+=0x1){_0x519c24=_0xdb1106[_0x18b124];if(_['isUndefined'](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']])){_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']]=new DeskAccount(_0x519c24);}else{_0x5a861d[_0xf5f2('0x3d')](_0x5a861d[_0xf5f2('0x20')][_0x519c24['id']],_0x519c24);}}}return _0x5a861d['deskAccounts'];};};Realtime['prototype'][_0xf5f2('0x4b')]=function(){var _0x4de303=this;return function(_0xa39c65){if(_0xa39c65){freeIsNotKey(_0xa39c65,_0x4de303[_0xf5f2('0x1d')],'id');for(var _0x572ec1=0x0,_0x3f0579={};_0x572ec1<_0xa39c65[_0xf5f2('0x3e')];_0x572ec1+=0x1){_0x3f0579=_0xa39c65[_0x572ec1];if(_[_0xf5f2('0x3f')](_0x4de303['sugarcrmAccounts'][_0x3f0579['id']])){_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']]=new SugarcrmAccount(_0x3f0579);}else{_0x4de303[_0xf5f2('0x3d')](_0x4de303[_0xf5f2('0x1d')][_0x3f0579['id']],_0x3f0579);}}}return _0x4de303[_0xf5f2('0x1d')];};};Realtime['prototype'][_0xf5f2('0x4c')]=function(){var _0x506fe5=this;return function(_0x2cbe1e){if(_0x2cbe1e){freeIsNotKey(_0x2cbe1e,_0x506fe5[_0xf5f2('0x21')],'id');for(var _0x2e6f5d=0x0,_0x380c08={};_0x2e6f5d<_0x2cbe1e[_0xf5f2('0x3e')];_0x2e6f5d+=0x1){_0x380c08=_0x2cbe1e[_0x2e6f5d];if(_['isUndefined'](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']])){_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']]=new VtigerAccount(_0x380c08);}else{_0x506fe5[_0xf5f2('0x3d')](_0x506fe5[_0xf5f2('0x21')][_0x380c08['id']],_0x380c08);}}}return _0x506fe5[_0xf5f2('0x21')];};};Realtime['prototype'][_0xf5f2('0x4d')]=function(){var _0x5ee6bc=this;return function(_0x4c96ee){if(_0x4c96ee){freeIsNotKey(_0x4c96ee,_0x5ee6bc[_0xf5f2('0x4e')],'id');for(var _0x4802c5=0x0,_0x10f2b8={};_0x4802c5<_0x4c96ee[_0xf5f2('0x3e')];_0x4802c5+=0x1){_0x10f2b8=_0x4c96ee[_0x4802c5];if(_[_0xf5f2('0x3f')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']])){_0x5ee6bc['servicenowAccounts'][_0x10f2b8['id']]=new ServicenowAccount(_0x10f2b8);}else{_0x5ee6bc[_0xf5f2('0x3d')](_0x5ee6bc[_0xf5f2('0x4e')][_0x10f2b8['id']],_0x10f2b8);}}}return _0x5ee6bc[_0xf5f2('0x4e')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x4f')]=function(){var _0x35d868=this;return function(_0x158768){if(_0x158768){freeIsNotKey(_0x158768,_0x35d868['dynamics365Accounts'],'id');for(var _0x1f55af=0x0,_0x2d171d={};_0x1f55af<_0x158768[_0xf5f2('0x3e')];_0x1f55af+=0x1){_0x2d171d=_0x158768[_0x1f55af];if(_[_0xf5f2('0x3f')](_0x35d868['dynamics365Accounts'][_0x2d171d['id']])){_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']]=new Dynamics365Account(_0x2d171d);}else{_0x35d868['mergeFromDatabase'](_0x35d868[_0xf5f2('0x22')][_0x2d171d['id']],_0x2d171d);}}}return _0x35d868[_0xf5f2('0x22')];};};Realtime['prototype'][_0xf5f2('0x50')]=function(){var _0x975bd8=this;return function(_0xa0c139){if(_0xa0c139){freeIsNotKey(_0xa0c139,_0x975bd8[_0xf5f2('0x23')],'id');for(var _0x146462=0x0,_0x4bd113={};_0x146462<_0xa0c139[_0xf5f2('0x3e')];_0x146462+=0x1){_0x4bd113=_0xa0c139[_0x146462];if(_[_0xf5f2('0x3f')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']])){_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']]=new FreshsalesAccount(_0x4bd113);}else{_0x975bd8[_0xf5f2('0x3d')](_0x975bd8[_0xf5f2('0x23')][_0x4bd113['id']],_0x4bd113);}}}return _0x975bd8['freshsalesAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x51')]=function(){var _0x4800fe=this;return function(_0x3f677e){for(var _0x36503c=0x0;_0x36503c<_0x3f677e[_0xf5f2('0x3e')];_0x36503c+=0x1){_['merge'](_0x4800fe['voiceQueues'][_0x3f677e[_0x36503c]['name']],_0x3f677e[_0x36503c]);}return _0x4800fe[_0xf5f2('0x14')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x52')]=function(){var _0x450691=this;return function(_0x55da4d){clearVoiceQueues(_0x450691['voiceQueues']);if(_0x55da4d){_0x55da4d=_[_0xf5f2('0x53')](_0x55da4d,_0xf5f2('0x54'));for(var _0xc10cf3 in _0x55da4d){if(_0x55da4d[_0xf5f2('0x26')](_0xc10cf3)){for(var _0x794e0c=0x0;_0x794e0c<_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')];_0x794e0c+=0x1){var _0x11c302=_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x55')];if(_0x450691[_0xf5f2('0x14')][_0x11c302]){if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x56')]){_0x450691[_0xf5f2('0x14')][_0x11c302]['unmanaged']+=0x1;}if(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandon']){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x57')]+=0x1;}_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x58')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;if(_0x794e0c===_0x55da4d[_0xc10cf3][_0xf5f2('0x3e')]-0x1){_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')]||_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerabandonAt']||_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5c')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerjoinAt']),_0xf5f2('0x5a'))||0x0;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x31')]+=0x1;if(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5d')]){_0x450691['voiceQueues'][_0x11c302][_0xf5f2('0x32')]+=0x1;_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2d')]+=moment(_0x55da4d[_0xc10cf3][_0x794e0c][_0xf5f2('0x5b')])[_0xf5f2('0x59')](moment(_0x55da4d[_0xc10cf3][_0x794e0c]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2c')]+=_0x450691[_0xf5f2('0x14')][_0x11c302][_0xf5f2('0x2b')]||0x0;}}}}}}return _0x450691['voiceQueues'];};};Realtime['prototype'][_0xf5f2('0x5e')]=function(){var _0x4f2fcc=this;return function(_0x4c4420){clearVoiceCallReports(_0x4f2fcc['outbound']);if(_0x4c4420){for(var _0x57cb18=0x0;_0x57cb18<_0x4c4420[_0xf5f2('0x3e')];_0x57cb18+=0x1){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x31')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2c')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')];if(_0x4c4420[_0x57cb18][_0xf5f2('0x60')]===_0xf5f2('0x61')){_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x32')]+=0x1;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2b')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x5f')]-_0x4c4420[_0x57cb18][_0xf5f2('0x62')]||0x0;_0x4f2fcc[_0xf5f2('0x16')][_0xf5f2('0x2d')]+=_0x4c4420[_0x57cb18][_0xf5f2('0x62')];}}}return _0x4f2fcc[_0xf5f2('0x16')];};};Realtime['prototype'][_0xf5f2('0x63')]=function(){var _0x35299d=this;return function(_0x21043b){if(_0x21043b){freeIsNotKey(_0x21043b,_0x35299d[_0xf5f2('0x64')],_0xf5f2('0x28'));for(var _0x308220=0x0,_0x16491c={};_0x308220<_0x21043b[_0xf5f2('0x3e')];_0x308220+=0x1){_0x16491c=_0x21043b[_0x308220];if(_['isUndefined'](_0x35299d[_0xf5f2('0x64')][_0x16491c['name']])){_0x35299d['campaigns'][_0x16491c['name']]=new Campaign(_0x16491c);}else{_0x35299d['mergeFromDatabase'](_0x35299d['campaigns'][_0x16491c['name']],_0x16491c);_0x35299d[_0xf5f2('0x64')][_0x16491c[_0xf5f2('0x28')]][_0xf5f2('0x65')]=_0x16491c[_0xf5f2('0x66')]?_0x16491c[_0xf5f2('0x66')][_0xf5f2('0x28')]:undefined;}}}return _0x35299d['campaigns'];};};Realtime['prototype'][_0xf5f2('0x67')]=function(){var _0x578a22=this;return function(_0x418ece){if(_0x418ece){freeIsNotKey(_0x418ece,_0x578a22[_0xf5f2('0x68')],'id');for(var _0x59161c=0x0,_0x4f3ad4={};_0x59161c<_0x418ece[_0xf5f2('0x3e')];_0x59161c+=0x1){_0x4f3ad4=_0x418ece[_0x59161c];if(_[_0xf5f2('0x3f')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']])){_0x578a22[_0xf5f2('0x68')][_0x4f3ad4['id']]=new VoiceExtension(_0x4f3ad4);}else{_0x578a22[_0xf5f2('0x3d')](_0x578a22['voiceExtensions'][_0x4f3ad4['id']],_0x4f3ad4);}}}return _0x578a22[_0xf5f2('0x68')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x69')]=function(){var _0x4c1678=this;return function(_0x33e9ad){clearCampaigns(_0x4c1678[_0xf5f2('0x64')]);for(var _0x14db86=0x0;_0x14db86<_0x33e9ad[_0xf5f2('0x3e')];_0x14db86+=0x1){_[_0xf5f2('0x6a')](_0x4c1678[_0xf5f2('0x64')][_0x33e9ad[_0x14db86][_0xf5f2('0x28')]],_0x33e9ad[_0x14db86]);}return _0x4c1678[_0xf5f2('0x64')];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6b')]=function(){var _0x191af3=this;return function(_0x2601aa){if(_0x2601aa){freeIsNotKey(_0x2601aa,_0x191af3[_0xf5f2('0x24')],'id');for(var _0x407dd8=0x0,_0xe900ea={};_0x407dd8<_0x2601aa[_0xf5f2('0x3e')];_0x407dd8+=0x1){_0xe900ea=_0x2601aa[_0x407dd8];if(_[_0xf5f2('0x3f')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']])){_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']]=new FaxAccount(_0xe900ea);}else{_0x191af3[_0xf5f2('0x3d')](_0x191af3[_0xf5f2('0x24')][_0xe900ea['id']],_0xe900ea);}}}return _0x191af3['faxAccounts'];};};Realtime[_0xf5f2('0x3c')][_0xf5f2('0x6c')]=function(){var _0x5d6c6e=this;return function(_0x2e49ce){if(_0x2e49ce){freeIsNotKey(_0x2e49ce,_0x5d6c6e[_0xf5f2('0x14')],'name');for(var _0xb56304=0x0,_0x2f54eb={};_0xb56304<_0x2e49ce[_0xf5f2('0x3e')];_0xb56304+=0x1){_0x2f54eb=_0x2e49ce[_0xb56304];if(_['isUndefined'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]])){_0x5d6c6e[_0xf5f2('0x14')][_0x2f54eb[_0xf5f2('0x28')]]=new VoiceQueue(_0x2f54eb);}else{_0x5d6c6e['mergeFromDatabase'](_0x5d6c6e['voiceQueues'][_0x2f54eb[_0xf5f2('0x28')]],_0x2f54eb);}}}return _0x5d6c6e[_0xf5f2('0x14')];};};module[_0xf5f2('0x6d')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 752a29b..af21077 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x11bb=['hasOwnProperty','mergeDBDataToRealtime'];(function(_0x176a52,_0x423983){var _0x1866a8=function(_0x1c5d3c){while(--_0x1c5d3c){_0x176a52['push'](_0x176a52['shift']());}};_0x1866a8(++_0x423983);}(_0x11bb,0x152));var _0xb11b=function(_0x1a825f,_0x1af04a){_0x1a825f=_0x1a825f-0x0;var _0x3bc689=_0x11bb[_0x1a825f];return _0x3bc689;};'use strict';function mergeDBDataToRealtime(_0x315e63,_0x3bbe10){var _0x46b85f=Object['assign']({},_0x315e63);for(var _0x3b1848 in _0x3bbe10){if(_0x46b85f[_0xb11b('0x0')](_0x3b1848)){_0x46b85f[_0x3b1848]=_0x3bbe10[_0x3b1848];}}return _0x46b85f;}exports[_0xb11b('0x1')]=mergeDBDataToRealtime; \ No newline at end of file +var _0xb4ff=['mergeDBDataToRealtime','assign'];(function(_0x19d673,_0x28e318){var _0x1c349f=function(_0x3b2819){while(--_0x3b2819){_0x19d673['push'](_0x19d673['shift']());}};_0x1c349f(++_0x28e318);}(_0xb4ff,0x1b7));var _0xfb4f=function(_0x24edf6,_0x4362fd){_0x24edf6=_0x24edf6-0x0;var _0x56e4ae=_0xb4ff[_0x24edf6];return _0x56e4ae;};'use strict';function mergeDBDataToRealtime(_0x9b4052,_0x4059ce){var _0xeaaa3b=Object[_0xfb4f('0x0')]({},_0x9b4052);for(var _0x3aea6 in _0x4059ce){if(_0xeaaa3b['hasOwnProperty'](_0x3aea6)){_0xeaaa3b[_0x3aea6]=_0x4059ce[_0x3aea6];}}return _0xeaaa3b;}exports[_0xfb4f('0x1')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 8ed97c9..8bd8a44 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 _0x8907=['blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','find','agents','name','isNil','interface','SIP/%s','voiceQueueReport','length','connectedlinenum','accountcode','assigned','lastAssignedTo','format','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','match','getAgentByInternal','keys','getCallType','channel','outbound','destination','exten','type','dialer','lastapplication','lastdata','queue','context','from-voip-provider','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','callerid','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','UserId','split','membername','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','xcally-motion-dialer','isArray','forEach','create','voiceDialReport','startsWith','Local','substring','indexOf','lastIndexOf','findAgent','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8907,0x1d3));var _0x7890=function(_0x2232d9,_0x452ce5){_0x2232d9=_0x2232d9-0x0;var _0x11afa1=_0x8907[_0x2232d9];return _0x11afa1;};'use strict';var _=require(_0x7890('0x0'));var moment=require(_0x7890('0x1'));var util=require(_0x7890('0x2'));var config=require(_0x7890('0x3'));var ami=require(_0x7890('0x4'));var RpcVoiceAgentReport=require(_0x7890('0x5'));var RpcVoiceCallReport=require(_0x7890('0x6'));var RpcVoiceDialReport=require(_0x7890('0x7'));var RpcMemberReport=require(_0x7890('0x8'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0x7890('0x9'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x7890('0xa'));var VoiceCallReport=require(_0x7890('0xb'));var VoiceAgentReport=require(_0x7890('0xc'));var VoiceDialReport=require(_0x7890('0xd'));var UserReport=require(_0x7890('0xe'));function Report(_0xc1e8d){this[_0x7890('0xf')]=_0xc1e8d;this['agents']=_0xc1e8d['agents'];this[_0x7890('0x10')]=_0xc1e8d[_0x7890('0x10')];}Report[_0x7890('0x11')][_0x7890('0x12')]=function(_0x3690cf){var _0x5d0fde=new VoiceQueueReport(this[_0x7890('0xf')]);var _0x36d3b9=new VoiceAgentReport(this[_0x7890('0xf')]);var _0x275b48=new VoiceDialReport(this[_0x7890('0xf')]);var _0x32f19c=new VoiceCallReport(this['realtime']);var _0x21590c=new UserReport(this[_0x7890('0xf')]);if(config[_0x7890('0x13')]&&config[_0x7890('0x13')][_0x7890('0x14')]){ami['on'](_0x7890('0x15'),this['voiceQueueReport'][_0x7890('0x16')](this));ami['on'](_0x7890('0x17'),this[_0x7890('0x18')][_0x7890('0x16')](this));ami['on'](_0x7890('0x19'),this[_0x7890('0x1a')][_0x7890('0x16')](this));ami['on'](_0x7890('0x1b'),this['voiceDialReport'][_0x7890('0x16')](this));ami['on'](_0x7890('0x1c'),this[_0x7890('0x1d')][_0x7890('0x16')](this));ami['on'](_0x7890('0x1e'),this[_0x7890('0x1f')][_0x7890('0x16')](this));}};Report[_0x7890('0x11')]['findAgent']=function(_0x56fee8){var _0x2bbd55;_0x2bbd55=_[_0x7890('0x20')](this[_0x7890('0x21')],function(_0x1e1512){return _0x1e1512['accountcode']==_0x56fee8||_0x1e1512[_0x7890('0x22')]==_0x56fee8;});if(_[_0x7890('0x23')](_0x2bbd55)){var _0x3b07f5=_['find'](this[_0x7890('0x10')],function(_0x2a5adf){return _0x2a5adf['accountcode']==_0x56fee8||_0x2a5adf[_0x7890('0x22')]==_0x56fee8;});if(_0x3b07f5){_0x2bbd55=_['find'](this['agents'],function(_0x12fe2c){return _0x12fe2c[_0x7890('0x24')]==util['format'](_0x7890('0x25'),_0x3b07f5[_0x7890('0x22')]);});}}return _0x2bbd55;};Report[_0x7890('0x11')][_0x7890('0x26')]=function(_0x5406b6){for(var _0x416b1b=0x0;_0x416b1b<_0x5406b6[_0x7890('0x27')];_0x416b1b+=0x1){var _0x10aaa2=this['findAgent'](_0x5406b6[_0x416b1b][_0x7890('0x28')]);if(_0x10aaa2){_0x5406b6[_0x416b1b][_0x7890('0x29')]=_0x10aaa2[_0x7890('0x29')];_0x5406b6[_0x416b1b][_0x7890('0x2a')]=!![];_0x5406b6[_0x416b1b][_0x7890('0x2b')]=_0x10aaa2[_0x7890('0x22')];_0x5406b6[_0x416b1b][_0x7890('0x24')]=_[_0x7890('0x23')](_0x10aaa2[_0x7890('0x24')])?util['format'](_0x7890('0x25'),_0x10aaa2[_0x7890('0x22')]):_0x10aaa2[_0x7890('0x24')];if(_0x5406b6[_0x416b1b]['queuecallercomplete']){_0x5406b6[_0x416b1b]['queuecallercompleteAt']=moment()[_0x7890('0x2c')](_0x7890('0x2d'));}if(_0x5406b6[_0x416b1b][_0x7890('0x2e')]){_0x5406b6[_0x416b1b]['queuecallerexitAt']=moment()['format'](_0x7890('0x2d'));}RpcMemberReport[_0x7890('0x26')](_0x5406b6[_0x416b1b]);}RpcVoiceQueueReport['create'](_0x5406b6[_0x416b1b]);}};function extractCalleridNumber(_0x343377){var _0x32f45c=_0x343377[_0x7890('0x2f')](/<(.*?)>/);return _0x32f45c?_0x32f45c[0x1]:_0x343377;}Report['prototype'][_0x7890('0x30')]=function(_0x331b94){for(var _0x2f37cb=0x0;_0x2f37cb','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','isNil','type','UserId','membername','monitor','monitorFilename','monitors','filename','createdAt','xcally-motion-preview','connectedlinename','xcally-motion-dialer','isArray','forEach','voiceDialReport','channel','startsWith','Local','indexOf','mobile','phone','lastIndexOf','findAgent','lodash','moment','util','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','sync','xdr','disabled','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','find','accountcode','name','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','getAgentByInternal','keys','getCallType','split','calleridnum','internal','destination','exten','dialer','lastapplication','queue','lastdata','context','callerid','from-sip','calleridpreview','originatecalleridnum','destinationchannel'];(function(_0x510347,_0xdf770a){var _0x5cb84f=function(_0x4c35d7){while(--_0x4c35d7){_0x510347['push'](_0x510347['shift']());}};_0x5cb84f(++_0xdf770a);}(_0x8b30,0x19b));var _0x08b3=function(_0xc67528,_0x24e2fb){_0xc67528=_0xc67528-0x0;var _0x38e26d=_0x8b30[_0xc67528];return _0x38e26d;};'use strict';var _=require(_0x08b3('0x0'));var moment=require(_0x08b3('0x1'));var util=require(_0x08b3('0x2'));var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x08b3('0x3'));var RpcVoiceDialReport=require(_0x08b3('0x4'));var RpcMemberReport=require(_0x08b3('0x5'));var RpcVoiceQueueReport=require(_0x08b3('0x6'));var RpcVoiceRecording=require(_0x08b3('0x7'));var RpcVoiceTransferReport=require(_0x08b3('0x8'));var VoiceQueueReport=require(_0x08b3('0x9'));var VoiceCallReport=require(_0x08b3('0xa'));var VoiceAgentReport=require(_0x08b3('0xb'));var VoiceDialReport=require(_0x08b3('0xc'));var UserReport=require('./userReport');function Report(_0x57f50d){this[_0x08b3('0xd')]=_0x57f50d;this['agents']=_0x57f50d[_0x08b3('0xe')];this[_0x08b3('0xf')]=_0x57f50d['telephones'];}Report[_0x08b3('0x10')][_0x08b3('0x11')]=function(_0x979054){var _0x5b38ee=new VoiceQueueReport(this[_0x08b3('0xd')]);var _0x59fd6f=new VoiceAgentReport(this[_0x08b3('0xd')]);var _0x1c8df6=new VoiceDialReport(this[_0x08b3('0xd')]);var _0x2c8364=new VoiceCallReport(this[_0x08b3('0xd')]);var _0x3ee873=new UserReport(this[_0x08b3('0xd')]);if(config[_0x08b3('0x12')]&&config[_0x08b3('0x12')][_0x08b3('0x13')]){ami['on']('custom:voiceQueueReport',this[_0x08b3('0x14')][_0x08b3('0x15')](this));ami['on'](_0x08b3('0x16'),this[_0x08b3('0x17')][_0x08b3('0x15')](this));ami['on'](_0x08b3('0x18'),this[_0x08b3('0x19')][_0x08b3('0x15')](this));ami['on'](_0x08b3('0x1a'),this['voiceDialReport'][_0x08b3('0x15')](this));ami['on'](_0x08b3('0x1b'),this[_0x08b3('0x1c')][_0x08b3('0x15')](this));ami['on'](_0x08b3('0x1d'),this[_0x08b3('0x1e')]['bind'](this));}};Report[_0x08b3('0x10')]['findAgent']=function(_0x21f2cf){var _0x5ef9ac;_0x5ef9ac=_[_0x08b3('0x1f')](this[_0x08b3('0xe')],function(_0x4be057){return _0x4be057[_0x08b3('0x20')]==_0x21f2cf||_0x4be057[_0x08b3('0x21')]==_0x21f2cf;});if(_['isNil'](_0x5ef9ac)){var _0x282bf8=_[_0x08b3('0x1f')](this[_0x08b3('0xf')],function(_0x4ecbce){return _0x4ecbce[_0x08b3('0x20')]==_0x21f2cf||_0x4ecbce[_0x08b3('0x21')]==_0x21f2cf;});if(_0x282bf8){_0x5ef9ac=_[_0x08b3('0x1f')](this[_0x08b3('0xe')],function(_0x5660f6){return _0x5660f6[_0x08b3('0x22')]==util[_0x08b3('0x23')](_0x08b3('0x24'),_0x282bf8[_0x08b3('0x21')]);});}}return _0x5ef9ac;};Report['prototype'][_0x08b3('0x14')]=function(_0x41c6ae){for(var _0x267fa0=0x0;_0x267fa0<_0x41c6ae[_0x08b3('0x25')];_0x267fa0+=0x1){var _0x1da2a9=this['findAgent'](_0x41c6ae[_0x267fa0][_0x08b3('0x26')]);if(_0x1da2a9){_0x41c6ae[_0x267fa0]['accountcode']=_0x1da2a9[_0x08b3('0x20')];_0x41c6ae[_0x267fa0][_0x08b3('0x27')]=!![];_0x41c6ae[_0x267fa0][_0x08b3('0x28')]=_0x1da2a9[_0x08b3('0x21')];_0x41c6ae[_0x267fa0][_0x08b3('0x22')]=_['isNil'](_0x1da2a9[_0x08b3('0x22')])?util[_0x08b3('0x23')](_0x08b3('0x24'),_0x1da2a9[_0x08b3('0x21')]):_0x1da2a9[_0x08b3('0x22')];if(_0x41c6ae[_0x267fa0][_0x08b3('0x29')]){_0x41c6ae[_0x267fa0][_0x08b3('0x2a')]=moment()[_0x08b3('0x23')](_0x08b3('0x2b'));}if(_0x41c6ae[_0x267fa0]['queuecallerexit']){_0x41c6ae[_0x267fa0][_0x08b3('0x2c')]=moment()[_0x08b3('0x23')](_0x08b3('0x2b'));}RpcMemberReport[_0x08b3('0x14')](_0x41c6ae[_0x267fa0]);}RpcVoiceQueueReport[_0x08b3('0x2d')](_0x41c6ae[_0x267fa0]);}};function extractCalleridNumber(_0x5add8f){var _0x1fa78c=_0x5add8f['match'](/<(.*?)>/);return _0x1fa78c?_0x1fa78c[0x1]:_0x5add8f;}Report[_0x08b3('0x10')][_0x08b3('0x2e')]=function(_0x5dfce8){for(var _0x5bda0e=0x0;_0x5bda0e{delete this['channels'][_0x402b35];},_0xb2101);}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0xd96f=['[%s][voiceAgentReport][agentcalled]','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','destchannelstatedesc','holdtime','lastevent','connect','merge','pick','destconnectedlinenum','accountcode','exten','custom:agentconnect','agentcomplete','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','[%s][voiceAgentReport][agentconnect]\x20Else\x20path\x20should\x20never\x20be\x20taken','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','name','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','user:%s','custom:agentringnoanswer','[%s][voiceAgentReport][queuecallerabandon]\x20event:','hasOwnProperty','[%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:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','complete','transfer','agent','talktime','acw','acwtime','acwTimeout','agentacw','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','destaccountcode','user:agentcomplete','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','includes','[%s][voiceAgentReport][hangup]\x20event:','agentcompleteAt','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]\x20event:','onhold','deleteChannelAfterTimeout','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','isNotNull','info','uniqueid','membername','destuniqueid','debug','inspect','isUndefined','interface','queue','format','YYYY-MM-DD\x20HH:mm:ss','mandatoryDisposition','type','inbound','assign','omit','event','privilege','emit','custom:agentcalled','calleridnum','user:called','error'];(function(_0x44120d,_0x22671b){var _0xa01cb0=function(_0x170d7e){while(--_0x170d7e){_0x44120d['push'](_0x44120d['shift']());}};_0xa01cb0(++_0x22671b);}(_0xd96f,0xfd));var _0xfd96=function(_0x34a6f0,_0x1474f6){_0x34a6f0=_0x34a6f0-0x0;var _0x13e92f=_0xd96f[_0x34a6f0];return _0x13e92f;};'use strict';var _=require('lodash');var moment=require(_0xfd96('0x0'));var util=require(_0xfd96('0x1'));var Redis=require(_0xfd96('0x2'));var config=require(_0xfd96('0x3'));var logger=require(_0xfd96('0x4'))(_0xfd96('0x5'));var ami=require(_0xfd96('0x6'));config[_0xfd96('0x7')]=_[_0xfd96('0x8')](config[_0xfd96('0x7')],{'host':_0xfd96('0x9'),'port':0x18eb});var io=require(_0xfd96('0xa'))(new Redis(config[_0xfd96('0x7')]));function VoiceAgentReport(_0x3b5d80){this[_0xfd96('0xb')]={};this[_0xfd96('0xc')]=_0x3b5d80[_0xfd96('0xb')];this[_0xfd96('0xd')]=_0x3b5d80[_0xfd96('0xd')];this[_0xfd96('0xe')]=_0x3b5d80[_0xfd96('0xe')];this[_0xfd96('0xf')]={};ami['on'](_0xfd96('0x10'),this[_0xfd96('0x11')][_0xfd96('0x12')](this));ami['on'](_0xfd96('0x13'),this[_0xfd96('0x14')][_0xfd96('0x12')](this));ami['on'](_0xfd96('0x15'),this[_0xfd96('0x16')]['bind'](this));ami['on'](_0xfd96('0x17'),this[_0xfd96('0x18')]['bind'](this));ami['on']('agentcomplete',this[_0xfd96('0x19')][_0xfd96('0x12')](this));ami['on'](_0xfd96('0x1a'),this[_0xfd96('0x1b')][_0xfd96('0x12')](this));ami['on'](_0xfd96('0x1c'),this[_0xfd96('0x1d')][_0xfd96('0x12')](this));ami['on'](_0xfd96('0x1e'),this[_0xfd96('0x1f')][_0xfd96('0x12')](this));ami['on'](_0xfd96('0x20'),this[_0xfd96('0x21')]['bind'](this));ami['on'](_0xfd96('0x22'),this[_0xfd96('0x23')]['bind'](this));ami['on'](_0xfd96('0x24'),this[_0xfd96('0x25')][_0xfd96('0x12')](this));}VoiceAgentReport[_0xfd96('0x26')]['emit']=function(_0x204337,_0x330d85,_0x415e05){io['to'](_0x204337)['emit'](_0x330d85,_0x415e05);};VoiceAgentReport[_0xfd96('0x26')][_0xfd96('0x27')]=function(_0x10c5a9){return _0x10c5a9!==null&&!_['isUndefined'](_0x10c5a9);};VoiceAgentReport[_0xfd96('0x26')][_0xfd96('0x11')]=function(_0x23a565){try{if(this['isNotNull'](_0x23a565)){logger[_0xfd96('0x28')]('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x23a565[_0xfd96('0x29')],_0x23a565[_0xfd96('0x2a')],_0x23a565[_0xfd96('0x2b')]);logger[_0xfd96('0x2c')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x23a565[_0xfd96('0x29')],util[_0xfd96('0x2d')](_0x23a565,{'showHidden':![],'depth':null}));if(_[_0xfd96('0x2e')](this[_0xfd96('0xb')][_0x23a565['uniqueid']])){this['channels'][_0x23a565[_0xfd96('0x29')]]={};}var _0x5f09c1=this[_0xfd96('0xe')][_0x23a565[_0xfd96('0x2f')]];var _0x546083=this[_0xfd96('0xb')][_0x23a565[_0xfd96('0x29')]][_0x23a565['destuniqueid']];var _0x47ba40=this['voiceQueues'][_0x23a565[_0xfd96('0x30')]];var _0x49ab3b=this['variables'][_0x23a565[_0xfd96('0x29')]];if(_[_0xfd96('0x2e')](_0x546083)){_0x546083={'agentcalledAt':moment()[_0xfd96('0x31')](_0xfd96('0x32')),'lastevent':'called','mandatoryDisposition':_0x47ba40&&_0x47ba40[_0xfd96('0x33')]?_0x47ba40[_0xfd96('0x33')]:![],'type':_0x47ba40&&_0x47ba40[_0xfd96('0x34')]?_0x47ba40[_0xfd96('0x34')]:_0xfd96('0x35'),'variables':_0x49ab3b,'motionChannel':'voice'};}Object[_0xfd96('0x36')](_0x546083,_[_0xfd96('0x37')](_0x23a565,[_0xfd96('0x38'),_0xfd96('0x39')]));this[_0xfd96('0xb')][_0x23a565[_0xfd96('0x29')]][_0x23a565[_0xfd96('0x2b')]]=_0x546083;logger[_0xfd96('0x2c')]('[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:',_0x23a565['uniqueid'],util[_0xfd96('0x2d')](_0x546083,{'showHidden':![],'depth':null}));ami[_0xfd96('0x3a')](_0xfd96('0x3b'),_0x546083);var _0x48cc96={'id':_0x5f09c1['id'],'calleridnum':_0x546083[_0xfd96('0x3c')],'queue':_0x546083[_0xfd96('0x30')],'variables':_0x546083['variables'],'uniqueid':_0x23a565[_0xfd96('0x29')]};logger['debug']('[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:',_0x23a565[_0xfd96('0x29')],util['inspect'](_0x48cc96,{'showHidden':![],'depth':null}));this['emit'](util[_0xfd96('0x31')]('user:%s',_0x23a565['membername']),_0xfd96('0x3d'),_0x48cc96);}}catch(_0x20f64d){logger[_0xfd96('0x3e')](_0xfd96('0x3f'),_0x23a565[_0xfd96('0x29')],util[_0xfd96('0x2d')](_0x20f64d,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentConnect']=function(_0x395dc7){try{if(this[_0xfd96('0x27')](_0x395dc7)){if(this[_0xfd96('0xb')][_0x395dc7['uniqueid']]){for(var _0x27da28 in this[_0xfd96('0xb')][_0x395dc7[_0xfd96('0x29')]]){if(this['channels'][_0x395dc7['uniqueid']]['hasOwnProperty'](_0x27da28)){if(_0x395dc7[_0xfd96('0x2b')]===_0x27da28){logger[_0xfd96('0x28')](_0xfd96('0x40'),_0x395dc7['uniqueid'],_0x395dc7[_0xfd96('0x2a')],_0x395dc7[_0xfd96('0x2b')]);this[_0xfd96('0xb')][_0x395dc7[_0xfd96('0x29')]][_0x27da28][_0xfd96('0x41')]=moment()[_0xfd96('0x31')](_0xfd96('0x32'));this[_0xfd96('0xb')][_0x395dc7[_0xfd96('0x29')]][_0x27da28][_0xfd96('0x42')]=_0x395dc7[_0xfd96('0x42')];this[_0xfd96('0xb')][_0x395dc7[_0xfd96('0x29')]][_0x27da28]['connectedlinenum']=_0x395dc7['connectedlinenum'];this['channels'][_0x395dc7[_0xfd96('0x29')]][_0x27da28]['destchannelstate']=_0x395dc7['destchannelstate'];this[_0xfd96('0xb')][_0x395dc7['uniqueid']][_0x27da28]['destchannelstatedesc']=_0x395dc7[_0xfd96('0x43')];this[_0xfd96('0xb')][_0x395dc7[_0xfd96('0x29')]][_0x27da28][_0xfd96('0x44')]=_0x395dc7[_0xfd96('0x44')];this[_0xfd96('0xb')][_0x395dc7[_0xfd96('0x29')]][_0x27da28][_0xfd96('0x45')]=_0xfd96('0x46');_[_0xfd96('0x47')](this[_0xfd96('0xe')][_0x395dc7['interface']],_[_0xfd96('0x48')](_0x395dc7,[_0xfd96('0x30'),_0xfd96('0x49')]));var _0x54c86d=this['agents'][_0x395dc7[_0xfd96('0x2f')]];var _0x4af913={'id':_0x54c86d['id'],'name':_0x54c86d['name'],'agentconnected':!![],'destaccountcode':_0x54c86d[_0xfd96('0x4a')],'destconnectedlinenum':this[_0xfd96('0xb')][_0x395dc7[_0xfd96('0x29')]][_0x395dc7[_0xfd96('0x2b')]][_0xfd96('0x4b')],'queue':this[_0xfd96('0xb')][_0x395dc7['uniqueid']][_0x395dc7[_0xfd96('0x2b')]][_0xfd96('0x30')],'uniqueid':this[_0xfd96('0xb')][_0x395dc7[_0xfd96('0x29')]][_0x395dc7[_0xfd96('0x2b')]]['uniqueid']};ami[_0xfd96('0x3a')](_0xfd96('0x4c'),this[_0xfd96('0xb')][_0x395dc7[_0xfd96('0x29')]][_0x395dc7['destuniqueid']]);this['emit'](util[_0xfd96('0x31')]('user:%s',_0x395dc7[_0xfd96('0x2a')]),'user:agentconnect',_0x4af913);}else if(!this[_0xfd96('0xb')][_0x395dc7[_0xfd96('0x29')]][_0x27da28][_0xfd96('0x15')]&&!this[_0xfd96('0xb')][_0x395dc7[_0xfd96('0x29')]][_0x27da28][_0xfd96('0x4d')]){logger[_0xfd96('0x28')](_0xfd96('0x4e'),_0x395dc7[_0xfd96('0x29')],this[_0xfd96('0xb')][_0x395dc7['uniqueid']][_0x27da28][_0xfd96('0x2a')],_0x27da28);this[_0xfd96('0xb')][_0x395dc7['uniqueid']][_0x27da28][_0xfd96('0x15')]=!![];this[_0xfd96('0xb')][_0x395dc7[_0xfd96('0x29')]][_0x27da28][_0xfd96('0x4f')]=moment()[_0xfd96('0x31')](_0xfd96('0x32'));this[_0xfd96('0xb')][_0x395dc7[_0xfd96('0x29')]][_0x27da28][_0xfd96('0x50')]=_0x395dc7[_0xfd96('0x2b')];this[_0xfd96('0xb')][_0x395dc7[_0xfd96('0x29')]][_0x27da28][_0xfd96('0x51')]=_0x395dc7[_0xfd96('0x2a')];this[_0xfd96('0xb')][_0x395dc7['uniqueid']][_0x27da28][_0xfd96('0x45')]=_0xfd96('0x52');this[_0xfd96('0xb')][_0x395dc7[_0xfd96('0x29')]][_0x27da28][_0xfd96('0x53')]=_0xfd96('0x52');logger['debug'](_0xfd96('0x54'),_0x395dc7[_0xfd96('0x29')],util[_0xfd96('0x2d')](this[_0xfd96('0xb')][_0x395dc7[_0xfd96('0x29')]][_0x27da28],{'showHidden':![],'depth':null}));ami[_0xfd96('0x3a')]('custom:agentansweredelsewhere',this[_0xfd96('0xb')][_0x395dc7[_0xfd96('0x29')]][_0x27da28]);}else{logger[_0xfd96('0x2c')](_0xfd96('0x55'),_0x395dc7[_0xfd96('0x29')]);}}}}}}catch(_0x54ae33){logger['error']('[%s][voiceAgentReport][agentconnect]',_0x395dc7['uniqueid'],util['inspect'](_0x54ae33,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xfd96('0x26')]['syncAgentRingNoAnswer']=function(_0x3ccbc9){try{if(this[_0xfd96('0x27')](_0x3ccbc9)){logger[_0xfd96('0x2c')](_0xfd96('0x56'),_0x3ccbc9[_0xfd96('0x29')],util[_0xfd96('0x2d')](_0x3ccbc9,{'showHidden':![],'depth':null}));if(this[_0xfd96('0xb')][_0x3ccbc9[_0xfd96('0x29')]]&&this['channels'][_0x3ccbc9[_0xfd96('0x29')]][_0x3ccbc9[_0xfd96('0x2b')]]){logger[_0xfd96('0x28')](_0xfd96('0x57'),_0x3ccbc9[_0xfd96('0x29')],_0x3ccbc9['membername'],_0x3ccbc9[_0xfd96('0x2b')]);var _0x40dcf5=this[_0xfd96('0xe')][_0x3ccbc9['interface']];var _0x14edce=this[_0xfd96('0xb')][_0x3ccbc9[_0xfd96('0x29')]][_0x3ccbc9[_0xfd96('0x2b')]];_0x14edce['agentringnoanswer']=!![];_0x14edce[_0xfd96('0x4f')]=moment()[_0xfd96('0x31')]('YYYY-MM-DD\x20HH:mm:ss');_0x14edce[_0xfd96('0x45')]=_0xfd96('0x58');_0x14edce['reason']=_0xfd96('0x58');var _0x2dc522={'id':_0x40dcf5['id'],'name':_0x40dcf5[_0xfd96('0x59')],'queue':_0x14edce['queue'],'uniqueid':_0x14edce['uniqueid']};logger['debug'](_0xfd96('0x5a'),_0x3ccbc9[_0xfd96('0x29')],util[_0xfd96('0x2d')](_0x2dc522,{'showHidden':![],'depth':null}));this[_0xfd96('0x3a')](util[_0xfd96('0x31')](_0xfd96('0x5b'),_0x40dcf5['name']),'user:agentringnoanswer',_0x2dc522);ami[_0xfd96('0x3a')](_0xfd96('0x5c'),_0x14edce);this['channels'][_0x3ccbc9[_0xfd96('0x29')]][_0x3ccbc9['destuniqueid']]=Object[_0xfd96('0x36')]({},_0x14edce);}}}catch(_0x23fbbe){logger[_0xfd96('0x3e')]('[%s][voiceAgentReport][agentringnoanswer]',_0x3ccbc9[_0xfd96('0x29')],util[_0xfd96('0x2d')](_0x23fbbe,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xfd96('0x26')][_0xfd96('0x18')]=function(_0x2fffac){try{if(this[_0xfd96('0x27')](_0x2fffac)){logger[_0xfd96('0x2c')](_0xfd96('0x5d'),_0x2fffac[_0xfd96('0x29')],util[_0xfd96('0x2d')](_0x2fffac,{'showHidden':![],'depth':null}));if(this[_0xfd96('0xb')][_0x2fffac[_0xfd96('0x29')]]){for(var _0x555b4e in this[_0xfd96('0xb')][_0x2fffac[_0xfd96('0x29')]]){if(this[_0xfd96('0xb')][_0x2fffac['uniqueid']][_0xfd96('0x5e')](_0x555b4e)&&!this[_0xfd96('0xb')][_0x2fffac[_0xfd96('0x29')]][_0x555b4e][_0xfd96('0x15')]&&!this[_0xfd96('0xb')][_0x2fffac['uniqueid']][_0x555b4e][_0xfd96('0x4d')]){logger[_0xfd96('0x28')](_0xfd96('0x5f'),_0x2fffac['uniqueid'],this[_0xfd96('0xb')][_0x2fffac[_0xfd96('0x29')]][_0x555b4e][_0xfd96('0x2a')],_0x555b4e);this[_0xfd96('0xb')][_0x2fffac[_0xfd96('0x29')]][_0x555b4e][_0xfd96('0x15')]=!![];this['channels'][_0x2fffac['uniqueid']][_0x555b4e]['agentringnoanswerAt']=moment()['format'](_0xfd96('0x32'));this['channels'][_0x2fffac[_0xfd96('0x29')]][_0x555b4e][_0xfd96('0x45')]=_0xfd96('0x60');this['channels'][_0x2fffac[_0xfd96('0x29')]][_0x555b4e]['reason']=_0xfd96('0x60');logger[_0xfd96('0x2c')](_0xfd96('0x61'),_0x2fffac[_0xfd96('0x29')],util[_0xfd96('0x2d')](this['channels'][_0x2fffac[_0xfd96('0x29')]][_0x555b4e],{'showHidden':![],'depth':null}));ami[_0xfd96('0x3a')](_0xfd96('0x62'),this[_0xfd96('0xb')][_0x2fffac[_0xfd96('0x29')]][_0x555b4e]);}}}}}catch(_0x48d301){logger['error'](_0xfd96('0x63'),_0x2fffac['uniqueid'],util[_0xfd96('0x2d')](_0x48d301,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xfd96('0x26')][_0xfd96('0x19')]=function(_0x4cec22){try{if(this[_0xfd96('0x27')](_0x4cec22)){logger[_0xfd96('0x2c')](_0xfd96('0x64'),_0x4cec22['uniqueid'],util['inspect'](_0x4cec22,{'showHidden':![],'depth':null}));if(this[_0xfd96('0xb')][_0x4cec22[_0xfd96('0x29')]]){for(var _0x10cf93 in this[_0xfd96('0xb')][_0x4cec22['uniqueid']]){if(this['channels'][_0x4cec22[_0xfd96('0x29')]][_0xfd96('0x5e')](_0x10cf93)){if(this[_0xfd96('0xb')][_0x4cec22['uniqueid']][_0x10cf93][_0xfd96('0x41')]&&!this['channels'][_0x4cec22[_0xfd96('0x29')]][_0x10cf93]['agentcomplete']){logger[_0xfd96('0x28')](_0xfd96('0x65'),_0x4cec22[_0xfd96('0x29')],this['channels'][_0x4cec22[_0xfd96('0x29')]][_0x10cf93]['membername'],_0x10cf93);this[_0xfd96('0xb')][_0x4cec22[_0xfd96('0x29')]][_0x10cf93][_0xfd96('0x4d')]=!![];this['channels'][_0x4cec22[_0xfd96('0x29')]][_0x10cf93]['agentcompleteAt']=moment()[_0xfd96('0x31')](_0xfd96('0x32'));this[_0xfd96('0xb')][_0x4cec22[_0xfd96('0x29')]][_0x10cf93][_0xfd96('0x45')]=_0xfd96('0x66');this[_0xfd96('0xb')][_0x4cec22['uniqueid']][_0x10cf93]['reason']=_0x4cec22[_0xfd96('0x53')]==_0xfd96('0x67')?_0xfd96('0x68'):_0x4cec22[_0xfd96('0x53')];this[_0xfd96('0xb')][_0x4cec22[_0xfd96('0x29')]][_0x10cf93][_0xfd96('0x69')]=_0x4cec22[_0xfd96('0x69')];if(this[_0xfd96('0xd')][_0x4cec22['queue']]&&this[_0xfd96('0xd')][_0x4cec22['queue']][_0xfd96('0x6a')]){this['channels'][_0x4cec22[_0xfd96('0x29')]][_0x10cf93][_0xfd96('0x6b')]=this['voiceQueues'][_0x4cec22[_0xfd96('0x30')]][_0xfd96('0x6c')];this[_0xfd96('0xb')][_0x4cec22[_0xfd96('0x29')]][_0x10cf93][_0xfd96('0x6d')]=!![];}this[_0xfd96('0xe')][_0x4cec22['interface']]=_[_0xfd96('0x37')](this['agents'][_0x4cec22['interface']],[_0xfd96('0x30'),_0xfd96('0x49')]);logger[_0xfd96('0x2c')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x4cec22[_0xfd96('0x29')],util[_0xfd96('0x2d')](this[_0xfd96('0xb')][_0x4cec22[_0xfd96('0x29')]][_0x10cf93],{'showHidden':![],'depth':null}));ami[_0xfd96('0x3a')]('custom:agentcomplete',this['channels'][_0x4cec22[_0xfd96('0x29')]][_0x10cf93]);logger[_0xfd96('0x2c')](_0xfd96('0x6e'),_0x4cec22[_0xfd96('0x29')],util['inspect']({'id':this[_0xfd96('0xe')][_0x4cec22[_0xfd96('0x2f')]]['id'],'destaccountcode':_0x4cec22[_0xfd96('0x6f')]},{'showHidden':![],'depth':null}));this[_0xfd96('0x3a')](util[_0xfd96('0x31')](_0xfd96('0x5b'),_0x4cec22[_0xfd96('0x2a')]),_0xfd96('0x70'),{'id':this[_0xfd96('0xe')][_0x4cec22[_0xfd96('0x2f')]]['id'],'destaccountcode':Number(_0x4cec22[_0xfd96('0x6f')])});}}}}}}catch(_0x188dee){logger[_0xfd96('0x3e')]('[%s][voiceAgentReport][agentcomplete]',_0x4cec22[_0xfd96('0x29')],util['inspect'](_0x188dee,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xfd96('0x1b')]=function(_0x529da8){try{if(this['isNotNull'](_0x529da8)){logger['debug']('[%s][voiceAgentReport][varset]\x20event:',_0x529da8[_0xfd96('0x29')],util[_0xfd96('0x2d')](_0x529da8,{'showHidden':![],'depth':null}));this['addVariable'](_0x529da8[_0xfd96('0x29')],_[_0xfd96('0x71')](_0x529da8[_0xfd96('0x72')])[0x0],_0x529da8[_0xfd96('0x73')]);if(this['channels'][_0x529da8[_0xfd96('0x29')]]){for(var _0x40a7d8 in this['channels'][_0x529da8[_0xfd96('0x29')]]){if(this[_0xfd96('0xb')][_0x529da8[_0xfd96('0x29')]][_0xfd96('0x5e')](_0x40a7d8)){logger[_0xfd96('0x28')](_0xfd96('0x74'),_0x529da8[_0xfd96('0x29')],_0x40a7d8,_['keys'](_0x529da8[_0xfd96('0x72')])[0x0],_0x529da8['value']);if(_[_0xfd96('0x2e')](this[_0xfd96('0xb')][_0x529da8[_0xfd96('0x29')]][_0x40a7d8][_0xfd96('0xf')])){this[_0xfd96('0xb')][_0x529da8['uniqueid']][_0x40a7d8][_0xfd96('0xf')]={};}this[_0xfd96('0xb')][_0x529da8[_0xfd96('0x29')]][_0x40a7d8][_0xfd96('0xf')]=this[_0xfd96('0xf')][_0x529da8['uniqueid']];}}}}}catch(_0x3f93b3){logger['error'](_0xfd96('0x75'),_0x529da8[_0xfd96('0x29')],util['inspect'](_0x3f93b3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xfd96('0x26')][_0xfd96('0x76')]=function(_0x29ee95,_0x18b729,_0x3653b4){var _0x7814c0=[_0xfd96('0x77'),_0xfd96('0x78'),_0xfd96('0x79'),_0xfd96('0x7a'),_0xfd96('0x7b'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0xfd96('0x7c'),'sipcallid',_0xfd96('0x7d'),_0xfd96('0x7e'),_0xfd96('0x7f'),_0xfd96('0x80'),_0xfd96('0x81'),_0xfd96('0x82'),'memberlastcall',_0xfd96('0x2a'),_0xfd96('0x83'),'memberrealtime'];if(!_['isNil'](_0x18b729)&&!_[_0xfd96('0x84')](_0x7814c0,_0x18b729)){if(_['isUndefined'](this['variables'][_0x29ee95])){this[_0xfd96('0xf')][_0x29ee95]={};}this[_0xfd96('0xf')][_0x29ee95][_0x18b729]=_0x3653b4;}};VoiceAgentReport[_0xfd96('0x26')][_0xfd96('0x1d')]=function(_0x554ca4){try{if(this[_0xfd96('0x27')](_0x554ca4)){logger[_0xfd96('0x2c')](_0xfd96('0x85'),_0x554ca4[_0xfd96('0x29')],util['inspect'](_0x554ca4,{'showHidden':![],'depth':null}));if(this[_0xfd96('0xb')][_0x554ca4[_0xfd96('0x29')]]){for(var _0x4b6a36 in this[_0xfd96('0xb')][_0x554ca4['uniqueid']]){if(this[_0xfd96('0xb')][_0x554ca4['uniqueid']]['hasOwnProperty'](_0x4b6a36)){if(this['channels'][_0x554ca4[_0xfd96('0x29')]][_0x4b6a36][_0xfd96('0x53')]==_0xfd96('0x67')&&this[_0xfd96('0xb')][_0x554ca4[_0xfd96('0x29')]][_0x4b6a36][_0xfd96('0x4d')]){logger[_0xfd96('0x28')]('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x554ca4[_0xfd96('0x29')],_0x4b6a36);this[_0xfd96('0xb')][_0x554ca4[_0xfd96('0x29')]][_0x4b6a36][_0xfd96('0x86')]=moment()['format'](_0xfd96('0x32'));}}}logger[_0xfd96('0x2c')](_0xfd96('0x87'),_0x554ca4[_0xfd96('0x29')],util[_0xfd96('0x2d')](_['values'](this[_0xfd96('0xb')][_0x554ca4[_0xfd96('0x29')]]),{'showHidden':![],'depth':null}));ami[_0xfd96('0x3a')](_0xfd96('0x88'),_['values'](this[_0xfd96('0xb')][_0x554ca4['uniqueid']]));this['deleteChannelAfterTimeout'](_0x554ca4[_0xfd96('0x29')]);}if(this[_0xfd96('0xf')][_0x554ca4['uniqueid']]){delete this[_0xfd96('0xf')][_0x554ca4[_0xfd96('0x29')]];}}}catch(_0xcce90a){logger[_0xfd96('0x3e')](_0xfd96('0x89'),_0x554ca4[_0xfd96('0x29')],util[_0xfd96('0x2d')](_0xcce90a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xfd96('0x26')][_0xfd96('0x23')]=function(_0x3451cb){try{if(this[_0xfd96('0x27')](_0x3451cb)){logger['debug'](_0xfd96('0x8a'),_0x3451cb[_0xfd96('0x29')],util[_0xfd96('0x2d')](_0x3451cb,{'showHidden':![],'depth':null}));if(this[_0xfd96('0xb')][_0x3451cb[_0xfd96('0x8b')]]){for(var _0x268d42 in this['channels'][_0x3451cb['transfereeuniqueid']]){if(this[_0xfd96('0xb')][_0x3451cb['transfereeuniqueid']]['hasOwnProperty'](_0x268d42)){if(_0x3451cb[_0xfd96('0x8c')]===_0x268d42){logger[_0xfd96('0x28')](_0xfd96('0x8d'),_0x3451cb[_0xfd96('0x29')],this[_0xfd96('0xb')][_0x3451cb[_0xfd96('0x8b')]][_0x268d42][_0xfd96('0x2a')],_0x268d42);var _0x4c3ce5=moment();this[_0xfd96('0xb')][_0x3451cb[_0xfd96('0x8b')]][_0x268d42][_0xfd96('0x4d')]=!![];this[_0xfd96('0xb')][_0x3451cb['transfereeuniqueid']][_0x268d42]['agentcompleteAt']=moment()['format'](_0xfd96('0x32'));this[_0xfd96('0xb')][_0x3451cb[_0xfd96('0x8b')]][_0x268d42][_0xfd96('0x45')]=_0xfd96('0x66');this['channels'][_0x3451cb[_0xfd96('0x8b')]][_0x268d42][_0xfd96('0x53')]=_0xfd96('0x67');this['channels'][_0x3451cb[_0xfd96('0x8b')]][_0x268d42]['talktime']=_0x4c3ce5['diff'](this[_0xfd96('0xb')][_0x3451cb[_0xfd96('0x8b')]][_0x268d42][_0xfd96('0x41')],_0xfd96('0x8e'));}}}}if(this['channels'][_0x3451cb[_0xfd96('0x8f')]]){var _0x5aab0d=this[_0xfd96('0xb')][_0x3451cb[_0xfd96('0x8f')]];this['channels'][_0x3451cb['secondtransfereruniqueid']]=this[_0xfd96('0xb')][_0x3451cb[_0xfd96('0x8b')]];this[_0xfd96('0xb')][_0x3451cb[_0xfd96('0x8b')]]=_0x5aab0d;}}}catch(_0x1c9924){logger['error'](_0xfd96('0x90'),_0x3451cb[_0xfd96('0x29')],util[_0xfd96('0x2d')](_0x1c9924,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncBlindTransfer']=function(_0x4e6063){try{if(this[_0xfd96('0x27')](_0x4e6063)){logger[_0xfd96('0x2c')](_0xfd96('0x91'),_0x4e6063[_0xfd96('0x29')],util['inspect'](_0x4e6063,{'showHidden':![],'depth':null}));if(this[_0xfd96('0xb')][_0x4e6063[_0xfd96('0x8b')]]){for(var _0x276927 in this[_0xfd96('0xb')][_0x4e6063[_0xfd96('0x8b')]]){if(this['channels'][_0x4e6063[_0xfd96('0x8b')]]['hasOwnProperty'](_0x276927)){if(_0x4e6063[_0xfd96('0x92')]===_0x276927){logger[_0xfd96('0x28')](_0xfd96('0x93'),_0x4e6063[_0xfd96('0x29')],this[_0xfd96('0xb')][_0x4e6063[_0xfd96('0x8b')]][_0x276927][_0xfd96('0x2a')],_0x276927);var _0x10a1e2=moment();this[_0xfd96('0xb')][_0x4e6063[_0xfd96('0x8b')]][_0x276927][_0xfd96('0x4d')]=!![];this['channels'][_0x4e6063[_0xfd96('0x8b')]][_0x276927][_0xfd96('0x86')]=_0x10a1e2;this['channels'][_0x4e6063[_0xfd96('0x8b')]][_0x276927][_0xfd96('0x45')]=_0xfd96('0x66');this['channels'][_0x4e6063[_0xfd96('0x8b')]][_0x276927]['reason']=_0xfd96('0x67');this[_0xfd96('0xb')][_0x4e6063[_0xfd96('0x8b')]][_0x276927][_0xfd96('0x69')]=_0x10a1e2[_0xfd96('0x94')](this['channels'][_0x4e6063[_0xfd96('0x8b')]][_0x276927][_0xfd96('0x41')],_0xfd96('0x8e'));}}}}}}catch(_0x46fedc){logger['error'](_0xfd96('0x95'),_0x4e6063[_0xfd96('0x29')],util[_0xfd96('0x2d')](_0x46fedc,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xfd96('0x26')][_0xfd96('0x1f')]=function(_0x1bf1b8){var _0x4ea874='';try{if(this['isNotNull'](_0x1bf1b8)){logger[_0xfd96('0x2c')](_0xfd96('0x96'),_0x1bf1b8[_0xfd96('0x29')],util[_0xfd96('0x2d')](_0x1bf1b8,{'showHidden':![],'depth':null}));if(_0x1bf1b8[_0xfd96('0x97')]){_0x4ea874=_0x1bf1b8[_0xfd96('0x97')][_0xfd96('0x98')](0x0,_0x1bf1b8[_0xfd96('0x97')][_0xfd96('0x99')]('-'));if(this[_0xfd96('0xe')][_0x4ea874]){logger[_0xfd96('0x28')](_0xfd96('0x9a'),_0x1bf1b8[_0xfd96('0x29')],_0x4ea874);this[_0xfd96('0xe')][_0x4ea874]['onhold']=!![];}}}}catch(_0x5f3b7c){logger['error']('[%s][voiceAgentReport][musiconholdstart]',_0x1bf1b8[_0xfd96('0x29')],util[_0xfd96('0x2d')](_0x5f3b7c,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xfd96('0x21')]=function(_0x13cdb0){var _0x1865dd='';try{if(this[_0xfd96('0x27')](_0x13cdb0)){logger['debug'](_0xfd96('0x9b'),_0x13cdb0['uniqueid'],util[_0xfd96('0x2d')](_0x13cdb0,{'showHidden':![],'depth':null}));if(_0x13cdb0['channel']){_0x1865dd=_0x13cdb0[_0xfd96('0x97')][_0xfd96('0x98')](0x0,_0x13cdb0[_0xfd96('0x97')][_0xfd96('0x99')]('-'));if(this[_0xfd96('0xe')][_0x1865dd]){logger['info']('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x13cdb0[_0xfd96('0x29')],_0x1865dd);this[_0xfd96('0xe')][_0x1865dd][_0xfd96('0x9c')]=![];}}}}catch(_0x843239){logger[_0xfd96('0x3e')]('[%s][voiceAgentReport][musiconholdstop]',_0x13cdb0[_0xfd96('0x29')],util[_0xfd96('0x2d')](_0x843239,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xfd96('0x9d')]=function(_0x32a1c7,_0x12bbd6=0x2710){if(this[_0xfd96('0xb')][_0x32a1c7]){setTimeout(()=>{delete this['channels'][_0x32a1c7];},_0x12bbd6);}};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 ca47c37..49020b8 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 _0x72f0=['[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','billableseconds','user:agentcomplete','transferType','resolve','then','transferToInternal','isEmpty','getSettings','stopRecordingOnTransfer','Action','catch','StopMixMonitor','webbar:stopmonitors','event','outbound','custom:voiceCallReport','[%s][voiceCallReport][hangup]','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transferconnectedlinenum','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfereruniqueid','some','origtransfererlinkedid','routeid','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','transfercalleridnum','BLIND','syncHangup','BlindTransfer','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','lodash','moment','path','ioredis','../../../config/environment','ami','../ami','../rpc/setting','set','agi','dial','playback','NO\x20ANSWER','FAILED','ANSWERED','BUSY','defaults','redis','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','syncNewState','varset','syncVarSet','hangup','newcallerid','syncNewCallerId','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','inspect','isNotNull','isUndefined','prototype','emit','info','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','pick','context','from-sip','channel','exten','destconnectedlinenum','connectedlinenum','format','user:agentconnect','accountcode','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','YYYY-MM-DD\x20HH:mm:ss','merge','undefined','debug','user:%s','name','error','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','starttime','duration','seconds','keys','includes','lastdata','startsWith','cdr(','split','type','isNil','queue','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20event:','answered','answertime','holdtime','diff','connectedlinename','destinationchannel','disposition','toNumber','channelstate','UserId','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','.wav49','replace','.WAV','monitorFilename','find','monitors','push','rec','[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%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','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','xmd-callerid-preview','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','sipcalluniqueid','parse','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','deleteChannelAfterTimeout'];(function(_0x195d9e,_0x4fc668){var _0x18fde5=function(_0x51898d){while(--_0x51898d){_0x195d9e['push'](_0x195d9e['shift']());}};_0x18fde5(++_0x4fc668);}(_0x72f0,0x1c3));var _0x072f=function(_0x592cbc,_0x5ec030){_0x592cbc=_0x592cbc-0x0;var _0x39b8d9=_0x72f0[_0x592cbc];return _0x39b8d9;};'use strict';var _=require(_0x072f('0x0'));var moment=require(_0x072f('0x1'));var util=require('util');var path=require(_0x072f('0x2'));var Redis=require(_0x072f('0x3'));var config=require(_0x072f('0x4'));var logger=require('../../../config/logger')(_0x072f('0x5'));var ami=require(_0x072f('0x6'));var Channel=require('../model/channel');var RpcSetting=require(_0x072f('0x7'));var applications=[_0x072f('0x8'),'queue',_0x072f('0x9'),_0x072f('0xa'),_0x072f('0xb'),'voicemail'];var dispositions=[_0x072f('0xc'),_0x072f('0xd'),_0x072f('0xd'),'NO\x20ANSWER','NO\x20ANSWER',_0x072f('0xc'),_0x072f('0xe'),_0x072f('0xf'),'FAILED','FAILED',_0x072f('0xd')];config['redis']=_[_0x072f('0x10')](config[_0x072f('0x11')],{'host':_0x072f('0x12'),'port':0x18eb});var io=require(_0x072f('0x13'))(new Redis(config[_0x072f('0x11')]));function VoiceCallReport(_0xedda37){this[_0x072f('0x14')]=_0xedda37['channels'];this[_0x072f('0x15')]=_0xedda37[_0x072f('0x15')];this[_0x072f('0x16')]={};ami['on'](_0x072f('0x17'),this[_0x072f('0x18')][_0x072f('0x19')](this));ami['on'](_0x072f('0x1a'),this[_0x072f('0x18')]['bind'](this));ami['on'](_0x072f('0x1b'),this[_0x072f('0x1c')][_0x072f('0x19')](this));ami['on']('newstate',this[_0x072f('0x1d')][_0x072f('0x19')](this));ami['on'](_0x072f('0x1e'),this[_0x072f('0x1f')]['bind'](this));ami['on'](_0x072f('0x20'),this['syncHangup']['bind'](this));ami['on'](_0x072f('0x21'),this[_0x072f('0x22')]['bind'](this));ami['on']('attendedtransfer',this[_0x072f('0x23')][_0x072f('0x19')](this));ami['on'](_0x072f('0x24'),this[_0x072f('0x25')]['bind'](this));ami['on'](_0x072f('0x26'),this['syncMusicOnHoldStart']['bind'](this));ami['on'](_0x072f('0x27'),this[_0x072f('0x28')][_0x072f('0x19')](this));try{logger['info'](_0x072f('0x29'));ami[_0x072f('0x2a')]();}catch(_0x3a58fe){logger['error']('[voiceCallReport][coreshowchannels]',util[_0x072f('0x2b')](_0x3a58fe,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype'][_0x072f('0x2c')]=function(_0xba034b){return _0xba034b!==null&&!_[_0x072f('0x2d')](_0xba034b);};VoiceCallReport[_0x072f('0x2e')][_0x072f('0x2f')]=function(_0x142589,_0x2b72cd,_0x417784){io['to'](_0x142589)[_0x072f('0x2f')](_0x2b72cd,_0x417784);};VoiceCallReport[_0x072f('0x2e')][_0x072f('0x22')]=function(_0x152c2f){try{if(this[_0x072f('0x2c')](_0x152c2f)){logger[_0x072f('0x30')](_0x072f('0x31'),_0x152c2f[_0x072f('0x32')],_0x152c2f[_0x072f('0x33')],_0x152c2f[_0x072f('0x34')]);logger['debug'](_0x072f('0x35'),_0x152c2f[_0x072f('0x32')],util[_0x072f('0x2b')](_0x152c2f,{'showHidden':![],'depth':null}));if(_0x152c2f[_0x072f('0x32')]===_0x152c2f[_0x072f('0x36')]){if(!_['isUndefined'](this['channels'][_0x152c2f[_0x072f('0x32')]])){_['merge'](this[_0x072f('0x14')][_0x152c2f['uniqueid']],_[_0x072f('0x37')](_0x152c2f,_['keys'](this[_0x072f('0x14')][_0x152c2f['uniqueid']])));}}if(_0x152c2f[_0x072f('0x38')]===_0x072f('0x39')){var _0x1abb99=this['agents'][_0x152c2f[_0x072f('0x3a')]['split']('-')[0x0]];if(_0x1abb99){if(_0x152c2f[_0x072f('0x3b')]=='xcally-motion-preview'){_0x1abb99[_0x072f('0x3c')]=_0x152c2f[_0x072f('0x3d')];this[_0x072f('0x2f')](util[_0x072f('0x3e')]('user:%s',_0x1abb99['name']),_0x072f('0x3f'),{'id':_0x1abb99['id'],'destaccountcode':_0x1abb99[_0x072f('0x40')],'destconnectedlinenum':_0x152c2f[_0x072f('0x3d')]});}}}}}catch(_0x594827){logger['error']('[%s][voiceCallReport][newcallerid]',_0x152c2f[_0x072f('0x32')],util[_0x072f('0x2b')](_0x594827,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewChannel']=function(_0x3d1f03){try{if(this[_0x072f('0x2c')](_0x3d1f03)){logger['debug'](_0x072f('0x41'),_0x3d1f03[_0x072f('0x32')],util[_0x072f('0x2b')](_0x3d1f03,{'showHidden':![],'depth':null}));if(this[_0x072f('0x14')][_0x3d1f03['uniqueid']]){return;}if(_0x3d1f03[_0x072f('0x3a')]===_0x072f('0x42')){return;}if(_0x3d1f03[_0x072f('0x32')]!==_0x3d1f03['linkedid']&&!this[_0x072f('0x16')][_0x3d1f03['linkedid']]){return;}logger['info'](_0x072f('0x43'),_0x3d1f03[_0x072f('0x32')],_0x3d1f03[_0x072f('0x38')],_0x3d1f03['exten']);this['channels'][_0x3d1f03[_0x072f('0x32')]]=new Channel();this[_0x072f('0x14')][_0x3d1f03['uniqueid']]['starttime']=moment()[_0x072f('0x3e')](_0x072f('0x44'));this[_0x072f('0x14')][_0x3d1f03[_0x072f('0x32')]]['disposition']=dispositions[_['toNumber'](_0x3d1f03['channelstate'])];_[_0x072f('0x45')](this[_0x072f('0x14')][_0x3d1f03[_0x072f('0x32')]],_['pick'](_0x3d1f03,_['keys'](this[_0x072f('0x14')][_0x3d1f03[_0x072f('0x32')]])));if(_0x3d1f03['context']===_0x072f('0x39')){var _0x301f04=this[_0x072f('0x15')][_0x3d1f03[_0x072f('0x3a')]['split']('-')[0x0]];if(_0x301f04&&typeof _0x301f04[_0x072f('0x3c')]===_0x072f('0x46')){_0x301f04[_0x072f('0x3c')]=_0x3d1f03[_0x072f('0x3b')];logger[_0x072f('0x47')]('[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:',_0x3d1f03[_0x072f('0x32')],util[_0x072f('0x2b')]({'id':_0x301f04['id'],'destaccountcode':_0x301f04[_0x072f('0x40')],'destconnectedlinenum':_0x3d1f03[_0x072f('0x3b')]},{'showHidden':![],'depth':null}));this[_0x072f('0x2f')](util[_0x072f('0x3e')](_0x072f('0x48'),_0x301f04[_0x072f('0x49')]),_0x072f('0x3f'),{'id':_0x301f04['id'],'destaccountcode':_0x301f04[_0x072f('0x40')],'destconnectedlinenum':_0x3d1f03['exten']});}}}}catch(_0x13e759){logger[_0x072f('0x4a')]('[%s][voiceCallReport][newchannel]',_0x3d1f03[_0x072f('0x32')],util[_0x072f('0x2b')](_0x13e759,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x072f('0x2e')][_0x072f('0x18')]=function(_0x3315d7){try{if(this[_0x072f('0x2c')](_0x3315d7)){logger['debug'](_0x072f('0x4b'),_0x3315d7[_0x072f('0x32')],util[_0x072f('0x2b')](_0x3315d7,{'showHidden':![],'depth':null}));if(_0x3315d7[_0x072f('0x3a')]===_0x072f('0x42')||_0x3315d7[_0x072f('0x3b')]==='h')return;if(_0x3315d7[_0x072f('0x32')]===_0x3315d7[_0x072f('0x36')]||this['blindTransfers'][_0x3315d7[_0x072f('0x36')]]){_0x3315d7[_0x072f('0x4c')]=_0x3315d7[_0x072f('0x4c')]?_0x3315d7[_0x072f('0x4c')][_0x072f('0x4d')]():undefined;_0x3315d7[_0x072f('0x4e')]=_0x3315d7[_0x072f('0x4f')]||_0x3315d7[_0x072f('0x4e')];if(_0x3315d7['appdata']&&_0x3315d7[_0x072f('0x4c')]!=='queue'){_0x3315d7[_0x072f('0x4e')]=_0x3315d7[_0x072f('0x4e')][_0x072f('0x4d')]();}logger['info'](_0x072f('0x50'),_0x3315d7[_0x072f('0x32')],_0x3315d7[_0x072f('0x4c')],_0x3315d7[_0x072f('0x4e')]);if(_['isUndefined'](this[_0x072f('0x14')][_0x3315d7[_0x072f('0x32')]])){this[_0x072f('0x14')][_0x3315d7['uniqueid']]=new Channel();this[_0x072f('0x14')][_0x3315d7[_0x072f('0x32')]][_0x072f('0x51')]=_0x3315d7[_0x072f('0x52')]?moment()['subtract'](moment[_0x072f('0x52')](_0x3315d7['duration'])[_0x072f('0x53')](),_0x072f('0x53'))[_0x072f('0x3e')](_0x072f('0x44')):moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x072f('0x14')][_0x3315d7[_0x072f('0x32')]]['disposition']=_0x072f('0xc');}_[_0x072f('0x45')](this[_0x072f('0x14')][_0x3315d7['uniqueid']],_['pick'](_0x3315d7,_[_0x072f('0x54')](this[_0x072f('0x14')][_0x3315d7[_0x072f('0x32')]])));if(_[_0x072f('0x55')](applications,_0x3315d7[_0x072f('0x4c')])){this[_0x072f('0x14')][_0x3315d7[_0x072f('0x32')]]['lastapplication']=_0x3315d7[_0x072f('0x4c')];this[_0x072f('0x14')][_0x3315d7[_0x072f('0x32')]][_0x072f('0x56')]=_0x3315d7[_0x072f('0x4e')];if(_0x3315d7[_0x072f('0x4c')]===_0x072f('0x8')&&_[_0x072f('0x57')](_0x3315d7['applicationdata'][_0x072f('0x4d')](),_0x072f('0x58'))){var _0x10bd9a=_0x3315d7[_0x072f('0x4e')][_0x072f('0x59')]('=');var _0xe9dad8=_0x10bd9a[0x0][_0x072f('0x4d')]()['match'](/cdr\((.*)\)/);if(_0xe9dad8){if(_0xe9dad8[0x1]===_0x072f('0x5a')&&!_[_0x072f('0x5b')](this['channels'][_0x3315d7[_0x072f('0x32')]][_0xe9dad8[0x1]]))return;this[_0x072f('0x14')][_0x3315d7[_0x072f('0x32')]][_0xe9dad8[0x1]]=_0x10bd9a[0x1];}}else if(_0x3315d7[_0x072f('0x4c')]===_0x072f('0x5c')){this[_0x072f('0x14')][_0x3315d7[_0x072f('0x32')]]['queue']=_0x3315d7['applicationdata'][_0x072f('0x59')](',')[0x0];}}}}}catch(_0x5bc907){logger[_0x072f('0x4a')](_0x072f('0x5d'),_0x3315d7['uniqueid'],util[_0x072f('0x2b')](_0x5bc907,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x072f('0x2e')][_0x072f('0x1d')]=function(_0x3892d9){try{if(this[_0x072f('0x2c')](_0x3892d9)){logger[_0x072f('0x30')]('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x3892d9[_0x072f('0x32')],_0x3892d9['linkedid'],_0x3892d9[_0x072f('0x33')],_0x3892d9[_0x072f('0x34')]);logger[_0x072f('0x47')](_0x072f('0x5e'),_0x3892d9['uniqueid'],util[_0x072f('0x2b')](_0x3892d9,{'showHidden':![],'depth':null}));if(_0x3892d9['channelstate']!=='6')return;var _0x35a7f0=this[_0x072f('0x15')][_0x3892d9[_0x072f('0x3a')][_0x072f('0x59')]('-')[0x0]];if(_0x3892d9['uniqueid']!==_0x3892d9[_0x072f('0x36')]){var _0x4da475=moment();if(this[_0x072f('0x14')][_0x3892d9[_0x072f('0x36')]]){if(!this['channels'][_0x3892d9[_0x072f('0x36')]][_0x072f('0x5f')]){this[_0x072f('0x14')][_0x3892d9['linkedid']][_0x072f('0x5f')]=!![];this[_0x072f('0x14')][_0x3892d9[_0x072f('0x36')]][_0x072f('0x60')]=_0x4da475[_0x072f('0x3e')](_0x072f('0x44'));if(this[_0x072f('0x14')][_0x3892d9[_0x072f('0x36')]][_0x072f('0x51')]){this[_0x072f('0x14')][_0x3892d9[_0x072f('0x36')]][_0x072f('0x61')]=_0x4da475[_0x072f('0x62')](this[_0x072f('0x14')][_0x3892d9['linkedid']][_0x072f('0x51')],_0x072f('0x53'));}}this[_0x072f('0x14')][_0x3892d9['linkedid']][_0x072f('0x36')]=_0x3892d9[_0x072f('0x32')];if(_0x3892d9[_0x072f('0x34')]!=='xcally-motion-preview'){this[_0x072f('0x14')][_0x3892d9['linkedid']][_0x072f('0x3d')]=_0x3892d9[_0x072f('0x34')];}this[_0x072f('0x14')][_0x3892d9[_0x072f('0x36')]][_0x072f('0x63')]=_0x3892d9['calleridname'];this[_0x072f('0x14')][_0x3892d9['linkedid']][_0x072f('0x64')]=_0x3892d9['channel'];this['channels'][_0x3892d9[_0x072f('0x36')]][_0x072f('0x65')]=dispositions[_['toNumber'](_0x3892d9['channelstate'])];if(_0x35a7f0){this[_0x072f('0x14')][_0x3892d9['linkedid']]['UserId']=_0x35a7f0['id'];this['channels'][_0x3892d9[_0x072f('0x36')]]['membername']=_0x35a7f0[_0x072f('0x49')];}}if(this[_0x072f('0x14')][_0x3892d9[_0x072f('0x32')]]){if(!this[_0x072f('0x14')][_0x3892d9[_0x072f('0x32')]][_0x072f('0x5f')]){this['channels'][_0x3892d9[_0x072f('0x32')]][_0x072f('0x5f')]=!![];this['channels'][_0x3892d9[_0x072f('0x32')]][_0x072f('0x60')]=_0x4da475[_0x072f('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0x072f('0x14')][_0x3892d9['uniqueid']][_0x072f('0x51')]){this['channels'][_0x3892d9[_0x072f('0x32')]][_0x072f('0x61')]=_0x4da475[_0x072f('0x62')](this[_0x072f('0x14')][_0x3892d9['uniqueid']][_0x072f('0x51')],_0x072f('0x53'));}}if(_0x3892d9[_0x072f('0x34')]!=='xcally-motion-preview'){this[_0x072f('0x14')][_0x3892d9[_0x072f('0x32')]][_0x072f('0x3d')]=_0x3892d9[_0x072f('0x34')];}this[_0x072f('0x14')][_0x3892d9['uniqueid']][_0x072f('0x63')]=_0x3892d9[_0x072f('0x33')];this[_0x072f('0x14')][_0x3892d9['uniqueid']]['destinationchannel']=_0x3892d9[_0x072f('0x3a')];this[_0x072f('0x14')][_0x3892d9[_0x072f('0x32')]][_0x072f('0x65')]=dispositions[_[_0x072f('0x66')](_0x3892d9[_0x072f('0x67')])];}}else{if(this[_0x072f('0x14')][_0x3892d9[_0x072f('0x32')]]){if(_0x35a7f0){this['channels'][_0x3892d9['uniqueid']][_0x072f('0x68')]=_0x35a7f0['id'];this[_0x072f('0x14')][_0x3892d9[_0x072f('0x32')]]['membername']=_0x35a7f0[_0x072f('0x49')];}}}if(_0x3892d9['context']==='from-sip'){if(_0x35a7f0){_0x35a7f0[_0x072f('0x3c')]=_0x3892d9['exten'];var _0x13f5e1;if(this['channels'][_0x3892d9[_0x072f('0x32')]]){_0x13f5e1=this[_0x072f('0x14')][_0x3892d9['uniqueid']][_0x072f('0x5c')];}else if(this['channels'][_0x3892d9[_0x072f('0x36')]]){_0x13f5e1=this['channels'][_0x3892d9[_0x072f('0x36')]]['queue'];}_0x35a7f0[_0x072f('0x5c')]=_0x13f5e1;var _0x471dc3={'id':_0x35a7f0['id'],'name':_0x35a7f0['name'],'agentconnected':!![],'destaccountcode':_0x35a7f0[_0x072f('0x40')],'destconnectedlinenum':_0x3892d9[_0x072f('0x3b')],'queue':_0x13f5e1||undefined,'uniqueid':_0x3892d9['linkedid']};logger[_0x072f('0x47')](_0x072f('0x69'),_0x3892d9[_0x072f('0x32')],util[_0x072f('0x2b')](_0x471dc3,{'showHidden':![],'depth':null}));this[_0x072f('0x2f')](util['format']('user:%s',_0x35a7f0[_0x072f('0x49')]),'user:agentconnect',_0x471dc3);}}}}catch(_0x4b3d57){logger['error'](_0x072f('0x6a'),_0x3892d9['uniqueid'],util['inspect'](_0x4b3d57,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x072f('0x2e')][_0x072f('0x6b')]=function(_0x521ad3,_0x343a6e){try{if(this[_0x072f('0x14')][_0x521ad3]){logger[_0x072f('0x30')](_0x072f('0x6c'),_0x521ad3,_0x343a6e);this['channels'][_0x521ad3][_0x072f('0x6d')]=!![];if(_['endsWith'](_0x343a6e,_0x072f('0x6e'))){_0x343a6e=_0x343a6e[_0x072f('0x6f')](_0x072f('0x6e'),_0x072f('0x70'));}this['channels'][_0x521ad3][_0x072f('0x71')]=_0x343a6e;var _0xb3fe41=_[_0x072f('0x72')](this['channels'][_0x521ad3][_0x072f('0x73')],{'filename':_0x343a6e});if(_['isNil'](_0xb3fe41)){this[_0x072f('0x14')][_0x521ad3][_0x072f('0x73')][_0x072f('0x74')]({'filename':_0x343a6e,'createdAt':moment()[_0x072f('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x072f('0x75')});}}}catch(_0x141ccb){logger[_0x072f('0x4a')](_0x072f('0x76'),_0x521ad3,util[_0x072f('0x2b')](_0x141ccb,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x072f('0x2e')][_0x072f('0x1f')]=function(_0x258e5a){try{if(this[_0x072f('0x2c')](_0x258e5a)){logger['debug'](_0x072f('0x77'),_0x258e5a['uniqueid'],util[_0x072f('0x2b')](_0x258e5a,{'showHidden':![],'depth':null}));if(this[_0x072f('0x14')][_0x258e5a[_0x072f('0x32')]]&&_0x258e5a[_0x072f('0x3a')]!=_0x072f('0x42')){if(this['isNotNull'](_0x258e5a[_0x072f('0x78')])){if(this[_0x072f('0x2c')](_0x258e5a[_0x072f('0x78')][_0x072f('0x79')])){logger[_0x072f('0x30')](_0x072f('0x7a'),_0x258e5a[_0x072f('0x32')],_0x258e5a[_0x072f('0x7b')]);this['syncMixMonitorFilename'](_0x258e5a['uniqueid'],_0x258e5a[_0x072f('0x7b')]);}else if(this[_0x072f('0x2c')](_0x258e5a[_0x072f('0x78')]['xmd-phone'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x258e5a[_0x072f('0x32')],_0x258e5a[_0x072f('0x7b')]);this[_0x072f('0x14')][_0x258e5a[_0x072f('0x32')]][_0x072f('0x34')]=_0x258e5a['value'];}else if(this['isNotNull'](_0x258e5a['variable'][_0x072f('0x7c')])){logger[_0x072f('0x30')](_0x072f('0x7d'),_0x258e5a[_0x072f('0x32')],_0x258e5a['value']);this[_0x072f('0x14')][_0x258e5a[_0x072f('0x32')]][_0x072f('0x7e')]=_0x258e5a[_0x072f('0x7b')];}else if(this[_0x072f('0x2c')](_0x258e5a[_0x072f('0x78')][_0x072f('0x7f')])){logger['info'](_0x072f('0x80'),_0x258e5a[_0x072f('0x32')],_0x258e5a[_0x072f('0x7b')]);this['channels'][_0x258e5a[_0x072f('0x32')]][_0x072f('0x5a')]=_0x258e5a[_0x072f('0x7b')];}else if(this[_0x072f('0x2c')](_0x258e5a['variable'][_0x072f('0x81')])){logger[_0x072f('0x30')](_0x072f('0x82'),_0x258e5a[_0x072f('0x32')],_0x258e5a[_0x072f('0x7b')][_0x072f('0x59')](',')[0x0]);this[_0x072f('0x14')][_0x258e5a[_0x072f('0x32')]][_0x072f('0x5c')]=_0x258e5a['value']['split'](',')[0x0];}else if(this[_0x072f('0x2c')](_0x258e5a[_0x072f('0x78')]['xmd-originatecalleridnum'])){logger[_0x072f('0x30')](_0x072f('0x83'),_0x258e5a[_0x072f('0x32')],_0x258e5a['value']);this[_0x072f('0x14')][_0x258e5a['uniqueid']]['originatecalleridnum']=_0x258e5a[_0x072f('0x7b')];}else if(this[_0x072f('0x2c')](_0x258e5a[_0x072f('0x78')][_0x072f('0x84')])){logger[_0x072f('0x30')](_0x072f('0x85'),_0x258e5a['uniqueid'],_0x258e5a[_0x072f('0x7b')]);this['channels'][_0x258e5a[_0x072f('0x32')]][_0x072f('0x86')]=_0x258e5a['value'];}else if(this['isNotNull'](_0x258e5a['variable'][_0x072f('0x87')])){logger[_0x072f('0x30')](_0x072f('0x88'),_0x258e5a[_0x072f('0x32')],_0x258e5a[_0x072f('0x7b')]);this[_0x072f('0x14')][_0x258e5a['uniqueid']][_0x072f('0x89')]=_0x258e5a[_0x072f('0x7b')];}else if(this[_0x072f('0x2c')](_0x258e5a['variable'][_0x072f('0x8a')])){logger[_0x072f('0x30')](_0x072f('0x8b'),_0x258e5a['uniqueid'],_0x258e5a[_0x072f('0x7b')]);this[_0x072f('0x14')][_0x258e5a[_0x072f('0x32')]]['queue']=_0x258e5a[_0x072f('0x7b')];}else if(this[_0x072f('0x2c')](_0x258e5a[_0x072f('0x78')][_0x072f('0x8c')])){logger[_0x072f('0x30')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x258e5a[_0x072f('0x32')],_0x258e5a[_0x072f('0x7b')]);this[_0x072f('0x14')][_0x258e5a[_0x072f('0x32')]][_0x072f('0x8d')]=_0x258e5a[_0x072f('0x7b')];}}}else if(this[_0x072f('0x2c')](_0x258e5a[_0x072f('0x78')][_0x072f('0x79')])){if(_0x258e5a[_0x072f('0x7b')]){var _0xb620a5=path[_0x072f('0x8e')](_0x258e5a[_0x072f('0x7b')])[_0x072f('0x49')];logger[_0x072f('0x30')](_0x072f('0x7a'),_0xb620a5,_0x258e5a['value']);this[_0x072f('0x6b')](_0xb620a5,_0x258e5a[_0x072f('0x7b')]);}}else if(this[_0x072f('0x14')][_0x258e5a[_0x072f('0x36')]]){if(this['isNotNull'](_0x258e5a[_0x072f('0x78')])){if(this['isNotNull'](_0x258e5a[_0x072f('0x78')][_0x072f('0x8c')])){logger[_0x072f('0x30')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x258e5a[_0x072f('0x36')],_0x258e5a['value']);this[_0x072f('0x14')][_0x258e5a[_0x072f('0x36')]]['sipcalllinkedid']=_0x258e5a[_0x072f('0x7b')];}}}}}catch(_0x5df2e){logger[_0x072f('0x4a')](_0x072f('0x8f'),_0x258e5a[_0x072f('0x32')],util[_0x072f('0x2b')](_0x5df2e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x072f('0x2e')]['syncHangup']=function(_0x935f34){try{if(this['isNotNull'](_0x935f34)){logger[_0x072f('0x47')](_0x072f('0x90'),_0x935f34[_0x072f('0x32')],util['inspect'](_0x935f34,{'showHidden':![],'depth':null}));if(this[_0x072f('0x16')][_0x935f34[_0x072f('0x36')]]){if(this[_0x072f('0x14')][this[_0x072f('0x16')][_0x935f34[_0x072f('0x36')]][_0x072f('0x36')]]){this[_0x072f('0x14')][this[_0x072f('0x16')][_0x935f34['linkedid']][_0x072f('0x36')]][_0x072f('0x32')]=_0x935f34['uniqueid'];this[_0x072f('0x14')][this[_0x072f('0x16')][_0x935f34[_0x072f('0x36')]]['linkedid']][_0x072f('0x5f')]=this[_0x072f('0x14')][_0x935f34[_0x072f('0x32')]][_0x072f('0x5f')];this[_0x072f('0x14')][this[_0x072f('0x16')][_0x935f34[_0x072f('0x36')]]['linkedid']][_0x072f('0x60')]=this['channels'][_0x935f34[_0x072f('0x32')]]['answertime'];this['channels'][this[_0x072f('0x16')][_0x935f34[_0x072f('0x36')]][_0x072f('0x36')]][_0x072f('0x64')]=this['channels'][this[_0x072f('0x16')][_0x935f34['linkedid']][_0x072f('0x36')]]['channel'];this[_0x072f('0x14')][this[_0x072f('0x16')][_0x935f34[_0x072f('0x36')]][_0x072f('0x36')]][_0x072f('0x65')]=this['channels'][_0x935f34[_0x072f('0x32')]][_0x072f('0x65')];this['channels'][_0x935f34[_0x072f('0x32')]]=this[_0x072f('0x14')][this[_0x072f('0x16')][_0x935f34[_0x072f('0x36')]]['linkedid']];this[_0x072f('0x91')](this[_0x072f('0x16')][_0x935f34[_0x072f('0x36')]][_0x072f('0x36')]);}else if(this[_0x072f('0x14')][this[_0x072f('0x16')][_0x935f34[_0x072f('0x36')]][_0x072f('0x32')]]){this[_0x072f('0x14')][this[_0x072f('0x16')][_0x935f34[_0x072f('0x36')]]['uniqueid']][_0x072f('0x32')]=[this[_0x072f('0x14')][this[_0x072f('0x16')][_0x935f34[_0x072f('0x36')]][_0x072f('0x32')]]['linkedid'],this[_0x072f('0x14')][this[_0x072f('0x16')][_0x935f34[_0x072f('0x36')]]['uniqueid']][_0x072f('0x36')]=this[_0x072f('0x14')][this[_0x072f('0x16')][_0x935f34[_0x072f('0x36')]]['uniqueid']][_0x072f('0x32')]][0x0];this[_0x072f('0x14')][this['blindTransfers'][_0x935f34[_0x072f('0x36')]][_0x072f('0x32')]][_0x072f('0x5f')]=this[_0x072f('0x14')][_0x935f34[_0x072f('0x32')]][_0x072f('0x5f')];this['channels'][this[_0x072f('0x16')][_0x935f34['linkedid']]['uniqueid']][_0x072f('0x60')]=this[_0x072f('0x14')][_0x935f34[_0x072f('0x32')]][_0x072f('0x60')];this['channels'][this[_0x072f('0x16')][_0x935f34[_0x072f('0x36')]][_0x072f('0x32')]][_0x072f('0x64')]=this[_0x072f('0x14')][this[_0x072f('0x16')][_0x935f34[_0x072f('0x36')]][_0x072f('0x32')]][_0x072f('0x3a')];this[_0x072f('0x14')][this[_0x072f('0x16')][_0x935f34[_0x072f('0x36')]]['uniqueid']][_0x072f('0x65')]=this[_0x072f('0x14')][_0x935f34['uniqueid']][_0x072f('0x65')];this[_0x072f('0x14')][_0x935f34[_0x072f('0x32')]]=this[_0x072f('0x14')][this[_0x072f('0x16')][_0x935f34[_0x072f('0x36')]][_0x072f('0x32')]];this[_0x072f('0x91')](this[_0x072f('0x16')][_0x935f34['linkedid']][_0x072f('0x32')]);}}if(this['channels'][_0x935f34[_0x072f('0x32')]]){logger[_0x072f('0x30')](_0x072f('0x92'),_0x935f34['uniqueid'],_0x935f34[_0x072f('0x93')]);var _0x1c747f=moment();this['channels'][_0x935f34[_0x072f('0x32')]]['endtime']=_0x1c747f[_0x072f('0x3e')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x072f('0x14')][_0x935f34[_0x072f('0x32')]][_0x072f('0x52')]=_0x1c747f['diff'](this[_0x072f('0x14')][_0x935f34[_0x072f('0x32')]]['starttime'],_0x072f('0x53'));if(this['channels'][_0x935f34[_0x072f('0x32')]][_0x072f('0x5f')]){this['channels'][_0x935f34[_0x072f('0x32')]][_0x072f('0x94')]=_0x1c747f['diff'](this[_0x072f('0x14')][_0x935f34[_0x072f('0x32')]][_0x072f('0x60')],_0x072f('0x53'));this[_0x072f('0x14')][_0x935f34['uniqueid']][_0x072f('0x61')]=this[_0x072f('0x14')][_0x935f34[_0x072f('0x32')]][_0x072f('0x52')]-this[_0x072f('0x14')][_0x935f34[_0x072f('0x32')]][_0x072f('0x94')];}if(_0x935f34[_0x072f('0x38')]===_0x072f('0x39')){if(this['agents'][_0x935f34[_0x072f('0x3a')][_0x072f('0x59')]('-')[0x0]]){this[_0x072f('0x15')][_0x935f34[_0x072f('0x3a')][_0x072f('0x59')]('-')[0x0]]=_['omit'](this[_0x072f('0x15')][_0x935f34[_0x072f('0x3a')][_0x072f('0x59')]('-')[0x0]],[_0x072f('0x3c')]);logger[_0x072f('0x47')]('[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:',_0x935f34[_0x072f('0x32')],util[_0x072f('0x2b')]({'id':this[_0x072f('0x15')][_0x935f34[_0x072f('0x3a')][_0x072f('0x59')]('-')[0x0]]['id'],'destaccountcode':this[_0x072f('0x15')][_0x935f34[_0x072f('0x3a')][_0x072f('0x59')]('-')[0x0]][_0x072f('0x40')]},{'showHidden':![],'depth':null}));this[_0x072f('0x2f')](util[_0x072f('0x3e')](_0x072f('0x48'),this[_0x072f('0x15')][_0x935f34[_0x072f('0x3a')][_0x072f('0x59')]('-')[0x0]][_0x072f('0x49')]),_0x072f('0x95'),{'id':this[_0x072f('0x15')][_0x935f34[_0x072f('0x3a')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x072f('0x15')][_0x935f34[_0x072f('0x3a')]['split']('-')[0x0]][_0x072f('0x40')]});for(var _0x15f5bb=0x0;_0x15f5bb{delete this[_0x072f('0x14')][_0x7c25f3];},_0x5ca3f1);}};module[_0x072f('0xc6')]=VoiceCallReport; \ No newline at end of file +var _0x8da1=['seconds','disposition','includes','lastdata','match','type','isNil','queue','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','[%s][voiceCallReport][newstate]\x20event:','channelstate','answered','answertime','holdtime','calleridnum','destinationchannel','toNumber','membername','diff','connectedlinename','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceCallReport][newstate]','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','replace','.wav49','.WAV','monitorFilename','find','monitors','push','rec','[%s][voiceCallReport][mixMonitorFilename]','syncVarSet','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','syncMixMonitorFilename','value','xmd-phone','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','destination','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','parse','sipcalllinkedid','[%s][voiceCallReport][varset]','deleteChannelAfterTimeout','[%s][voiceCallReport][hangup]\x20reason:%s','endtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','length','transferType','resolve','then','transferToInternal','isEmpty','stopRecordingOnTransfer','Action','catch','StopMixMonitor','finally','webbar:stopmonitors','BlindTransfer','outbound','[%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','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','transfertargetcalleridnum','origtransfereruniqueid','origtransfererlinkedid','some','routeid','[%s][voiceCallReport][attendedtransfer]','transfereecalleridnum','[%s][voiceCallReport][blindtransfer]\x20event:','extension','BLIND','transfereruniqueid','transfererchannel','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','syncMusicOnHoldStop','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]','exports','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../model/channel','set','dial','playback','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','localhost','socket.io-emitter','channels','agents','blindTransfers','bind','syncNewExten','newchannel','syncNewChannel','newstate','varset','hangup','syncHangup','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','info','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','pick','keys','context','from-sip','channel','split','exten','xcally-motion-preview','destconnectedlinenum','connectedlinenum','format','user:%s','name','accountcode','[%s][voiceCallReport][newchannel]\x20event:','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','undefined','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','OutgoingSpoolFailed','application','appdata','applicationdata','toLowerCase','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8da1,0x140));var _0x18da=function(_0xf5b712,_0x5487bf){_0xf5b712=_0xf5b712-0x0;var _0x410413=_0x8da1[_0xf5b712];return _0x410413;};'use strict';var _=require(_0x18da('0x0'));var moment=require(_0x18da('0x1'));var util=require(_0x18da('0x2'));var path=require(_0x18da('0x3'));var Redis=require(_0x18da('0x4'));var config=require(_0x18da('0x5'));var logger=require(_0x18da('0x6'))(_0x18da('0x7'));var ami=require('../ami');var Channel=require(_0x18da('0x8'));var RpcSetting=require('../rpc/setting');var applications=[_0x18da('0x9'),'queue','agi',_0x18da('0xa'),_0x18da('0xb'),'voicemail'];var dispositions=[_0x18da('0xc'),_0x18da('0xd'),_0x18da('0xd'),_0x18da('0xc'),_0x18da('0xc'),_0x18da('0xc'),_0x18da('0xe'),_0x18da('0xf'),_0x18da('0xd'),_0x18da('0xd'),_0x18da('0xd')];config[_0x18da('0x10')]=_['defaults'](config[_0x18da('0x10')],{'host':_0x18da('0x11'),'port':0x18eb});var io=require(_0x18da('0x12'))(new Redis(config['redis']));function VoiceCallReport(_0x5a689b){this['channels']=_0x5a689b[_0x18da('0x13')];this[_0x18da('0x14')]=_0x5a689b['agents'];this[_0x18da('0x15')]={};ami['on']('coreshowchannel',this['syncNewExten'][_0x18da('0x16')](this));ami['on']('newexten',this[_0x18da('0x17')][_0x18da('0x16')](this));ami['on'](_0x18da('0x18'),this[_0x18da('0x19')]['bind'](this));ami['on'](_0x18da('0x1a'),this['syncNewState'][_0x18da('0x16')](this));ami['on'](_0x18da('0x1b'),this['syncVarSet'][_0x18da('0x16')](this));ami['on'](_0x18da('0x1c'),this[_0x18da('0x1d')][_0x18da('0x16')](this));ami['on']('newcallerid',this['syncNewCallerId'][_0x18da('0x16')](this));ami['on'](_0x18da('0x1e'),this[_0x18da('0x1f')][_0x18da('0x16')](this));ami['on'](_0x18da('0x20'),this[_0x18da('0x21')]['bind'](this));ami['on'](_0x18da('0x22'),this[_0x18da('0x23')][_0x18da('0x16')](this));ami['on'](_0x18da('0x24'),this['syncMusicOnHoldStop']['bind'](this));try{logger[_0x18da('0x25')]('[voiceCallReport][coreshowchannels]\x20started');ami[_0x18da('0x26')]();}catch(_0x451c88){logger[_0x18da('0x27')](_0x18da('0x28'),util[_0x18da('0x29')](_0x451c88,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x18da('0x2a')][_0x18da('0x2b')]=function(_0x78c991){return _0x78c991!==null&&!_[_0x18da('0x2c')](_0x78c991);};VoiceCallReport[_0x18da('0x2a')][_0x18da('0x2d')]=function(_0x564f04,_0x3117f2,_0x33d25f){io['to'](_0x564f04)[_0x18da('0x2d')](_0x3117f2,_0x33d25f);};VoiceCallReport[_0x18da('0x2a')]['syncNewCallerId']=function(_0x5bb050){try{if(this['isNotNull'](_0x5bb050)){logger[_0x18da('0x25')](_0x18da('0x2e'),_0x5bb050[_0x18da('0x2f')],_0x5bb050[_0x18da('0x30')],_0x5bb050['calleridnum']);logger[_0x18da('0x31')](_0x18da('0x32'),_0x5bb050[_0x18da('0x2f')],util[_0x18da('0x29')](_0x5bb050,{'showHidden':![],'depth':null}));if(_0x5bb050[_0x18da('0x2f')]===_0x5bb050[_0x18da('0x33')]){if(!_[_0x18da('0x2c')](this[_0x18da('0x13')][_0x5bb050[_0x18da('0x2f')]])){_[_0x18da('0x34')](this[_0x18da('0x13')][_0x5bb050[_0x18da('0x2f')]],_[_0x18da('0x35')](_0x5bb050,_[_0x18da('0x36')](this[_0x18da('0x13')][_0x5bb050['uniqueid']])));}}if(_0x5bb050[_0x18da('0x37')]===_0x18da('0x38')){var _0x210aa1=this[_0x18da('0x14')][_0x5bb050[_0x18da('0x39')][_0x18da('0x3a')]('-')[0x0]];if(_0x210aa1){if(_0x5bb050[_0x18da('0x3b')]==_0x18da('0x3c')){_0x210aa1[_0x18da('0x3d')]=_0x5bb050[_0x18da('0x3e')];this['emit'](util[_0x18da('0x3f')](_0x18da('0x40'),_0x210aa1[_0x18da('0x41')]),'user:agentconnect',{'id':_0x210aa1['id'],'destaccountcode':_0x210aa1[_0x18da('0x42')],'destconnectedlinenum':_0x5bb050[_0x18da('0x3e')]});}}}}}catch(_0x566a4d){logger['error']('[%s][voiceCallReport][newcallerid]',_0x5bb050[_0x18da('0x2f')],util[_0x18da('0x29')](_0x566a4d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x18da('0x2a')][_0x18da('0x19')]=function(_0x530ef8){try{if(this[_0x18da('0x2b')](_0x530ef8)){logger[_0x18da('0x31')](_0x18da('0x43'),_0x530ef8[_0x18da('0x2f')],util[_0x18da('0x29')](_0x530ef8,{'showHidden':![],'depth':null}));if(this[_0x18da('0x13')][_0x530ef8['uniqueid']]){return;}if(_0x530ef8[_0x18da('0x39')]==='OutgoingSpoolFailed'){return;}if(_0x530ef8[_0x18da('0x2f')]!==_0x530ef8['linkedid']&&!this['blindTransfers'][_0x530ef8[_0x18da('0x33')]]){return;}logger[_0x18da('0x25')](_0x18da('0x44'),_0x530ef8[_0x18da('0x2f')],_0x530ef8[_0x18da('0x37')],_0x530ef8[_0x18da('0x3b')]);this['channels'][_0x530ef8['uniqueid']]=new Channel();this['channels'][_0x530ef8[_0x18da('0x2f')]][_0x18da('0x45')]=moment()[_0x18da('0x3f')](_0x18da('0x46'));this[_0x18da('0x13')][_0x530ef8[_0x18da('0x2f')]]['disposition']=dispositions[_['toNumber'](_0x530ef8['channelstate'])];_[_0x18da('0x34')](this[_0x18da('0x13')][_0x530ef8[_0x18da('0x2f')]],_['pick'](_0x530ef8,_['keys'](this['channels'][_0x530ef8[_0x18da('0x2f')]])));if(_0x530ef8[_0x18da('0x37')]===_0x18da('0x38')){var _0x40ff4d=this[_0x18da('0x14')][_0x530ef8[_0x18da('0x39')][_0x18da('0x3a')]('-')[0x0]];if(_0x40ff4d&&typeof _0x40ff4d[_0x18da('0x3d')]===_0x18da('0x47')){_0x40ff4d[_0x18da('0x3d')]=_0x530ef8[_0x18da('0x3b')];logger[_0x18da('0x31')](_0x18da('0x48'),_0x530ef8[_0x18da('0x2f')],util['inspect']({'id':_0x40ff4d['id'],'destaccountcode':_0x40ff4d[_0x18da('0x42')],'destconnectedlinenum':_0x530ef8[_0x18da('0x3b')]},{'showHidden':![],'depth':null}));this[_0x18da('0x2d')](util['format']('user:%s',_0x40ff4d[_0x18da('0x41')]),'user:agentconnect',{'id':_0x40ff4d['id'],'destaccountcode':_0x40ff4d['accountcode'],'destconnectedlinenum':_0x530ef8[_0x18da('0x3b')]});}}}}catch(_0x4c5010){logger[_0x18da('0x27')](_0x18da('0x49'),_0x530ef8[_0x18da('0x2f')],util['inspect'](_0x4c5010,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x18da('0x2a')]['syncNewExten']=function(_0x4cf9e7){try{if(this['isNotNull'](_0x4cf9e7)){logger[_0x18da('0x31')](_0x18da('0x4a'),_0x4cf9e7[_0x18da('0x2f')],util[_0x18da('0x29')](_0x4cf9e7,{'showHidden':![],'depth':null}));if(_0x4cf9e7['channel']===_0x18da('0x4b')||_0x4cf9e7[_0x18da('0x3b')]==='h')return;if(_0x4cf9e7[_0x18da('0x2f')]===_0x4cf9e7[_0x18da('0x33')]||this[_0x18da('0x15')][_0x4cf9e7[_0x18da('0x33')]]){_0x4cf9e7[_0x18da('0x4c')]=_0x4cf9e7[_0x18da('0x4c')]?_0x4cf9e7[_0x18da('0x4c')]['toLowerCase']():undefined;_0x4cf9e7['applicationdata']=_0x4cf9e7[_0x18da('0x4d')]||_0x4cf9e7[_0x18da('0x4e')];if(_0x4cf9e7['appdata']&&_0x4cf9e7[_0x18da('0x4c')]!=='queue'){_0x4cf9e7[_0x18da('0x4e')]=_0x4cf9e7[_0x18da('0x4e')][_0x18da('0x4f')]();}logger[_0x18da('0x25')](_0x18da('0x50'),_0x4cf9e7[_0x18da('0x2f')],_0x4cf9e7[_0x18da('0x4c')],_0x4cf9e7['applicationdata']);if(_['isUndefined'](this['channels'][_0x4cf9e7[_0x18da('0x2f')]])){this['channels'][_0x4cf9e7[_0x18da('0x2f')]]=new Channel();this[_0x18da('0x13')][_0x4cf9e7['uniqueid']][_0x18da('0x45')]=_0x4cf9e7[_0x18da('0x51')]?moment()['subtract'](moment[_0x18da('0x51')](_0x4cf9e7[_0x18da('0x51')])[_0x18da('0x52')](),'seconds')[_0x18da('0x3f')](_0x18da('0x46')):moment()[_0x18da('0x3f')](_0x18da('0x46'));this[_0x18da('0x13')][_0x4cf9e7[_0x18da('0x2f')]][_0x18da('0x53')]=_0x18da('0xc');}_[_0x18da('0x34')](this[_0x18da('0x13')][_0x4cf9e7[_0x18da('0x2f')]],_['pick'](_0x4cf9e7,_[_0x18da('0x36')](this[_0x18da('0x13')][_0x4cf9e7[_0x18da('0x2f')]])));if(_[_0x18da('0x54')](applications,_0x4cf9e7[_0x18da('0x4c')])){this[_0x18da('0x13')][_0x4cf9e7['uniqueid']]['lastapplication']=_0x4cf9e7[_0x18da('0x4c')];this[_0x18da('0x13')][_0x4cf9e7['uniqueid']][_0x18da('0x55')]=_0x4cf9e7[_0x18da('0x4e')];if(_0x4cf9e7['application']===_0x18da('0x9')&&_['startsWith'](_0x4cf9e7[_0x18da('0x4e')][_0x18da('0x4f')](),'cdr(')){var _0x52d8e2=_0x4cf9e7['applicationdata'][_0x18da('0x3a')]('=');var _0x4e6a4b=_0x52d8e2[0x0]['toLowerCase']()[_0x18da('0x56')](/cdr\((.*)\)/);if(_0x4e6a4b){if(_0x4e6a4b[0x1]===_0x18da('0x57')&&!_[_0x18da('0x58')](this[_0x18da('0x13')][_0x4cf9e7[_0x18da('0x2f')]][_0x4e6a4b[0x1]]))return;this['channels'][_0x4cf9e7[_0x18da('0x2f')]][_0x4e6a4b[0x1]]=_0x52d8e2[0x1];}}else if(_0x4cf9e7[_0x18da('0x4c')]===_0x18da('0x59')){this[_0x18da('0x13')][_0x4cf9e7[_0x18da('0x2f')]][_0x18da('0x59')]=_0x4cf9e7['applicationdata'][_0x18da('0x3a')](',')[0x0];}}}}}catch(_0x3230c3){logger[_0x18da('0x27')](_0x18da('0x5a'),_0x4cf9e7[_0x18da('0x2f')],util[_0x18da('0x29')](_0x3230c3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x18da('0x2a')][_0x18da('0x5b')]=function(_0x525683){try{if(this['isNotNull'](_0x525683)){logger[_0x18da('0x25')](_0x18da('0x5c'),_0x525683[_0x18da('0x2f')],_0x525683['linkedid'],_0x525683['calleridname'],_0x525683['calleridnum']);logger[_0x18da('0x31')](_0x18da('0x5d'),_0x525683[_0x18da('0x2f')],util[_0x18da('0x29')](_0x525683,{'showHidden':![],'depth':null}));if(_0x525683[_0x18da('0x5e')]!=='6')return;var _0x419c27=this[_0x18da('0x14')][_0x525683['channel'][_0x18da('0x3a')]('-')[0x0]];if(_0x525683[_0x18da('0x2f')]!==_0x525683[_0x18da('0x33')]){var _0x181698=moment();if(this[_0x18da('0x13')][_0x525683[_0x18da('0x33')]]){if(!this[_0x18da('0x13')][_0x525683[_0x18da('0x33')]][_0x18da('0x5f')]){this[_0x18da('0x13')][_0x525683[_0x18da('0x33')]][_0x18da('0x5f')]=!![];this[_0x18da('0x13')][_0x525683[_0x18da('0x33')]][_0x18da('0x60')]=_0x181698[_0x18da('0x3f')](_0x18da('0x46'));if(this[_0x18da('0x13')][_0x525683[_0x18da('0x33')]][_0x18da('0x45')]){this[_0x18da('0x13')][_0x525683[_0x18da('0x33')]][_0x18da('0x61')]=_0x181698['diff'](this[_0x18da('0x13')][_0x525683[_0x18da('0x33')]]['starttime'],_0x18da('0x52'));}}this[_0x18da('0x13')][_0x525683['linkedid']][_0x18da('0x33')]=_0x525683[_0x18da('0x2f')];if(_0x525683[_0x18da('0x62')]!==_0x18da('0x3c')){this[_0x18da('0x13')][_0x525683[_0x18da('0x33')]][_0x18da('0x3e')]=_0x525683['calleridnum'];}this[_0x18da('0x13')][_0x525683[_0x18da('0x33')]]['connectedlinename']=_0x525683[_0x18da('0x30')];this[_0x18da('0x13')][_0x525683[_0x18da('0x33')]][_0x18da('0x63')]=_0x525683[_0x18da('0x39')];this[_0x18da('0x13')][_0x525683['linkedid']]['disposition']=dispositions[_[_0x18da('0x64')](_0x525683[_0x18da('0x5e')])];if(_0x419c27){this['channels'][_0x525683[_0x18da('0x33')]]['UserId']=_0x419c27['id'];this[_0x18da('0x13')][_0x525683['linkedid']][_0x18da('0x65')]=_0x419c27[_0x18da('0x41')];}}if(this[_0x18da('0x13')][_0x525683['uniqueid']]){if(!this[_0x18da('0x13')][_0x525683[_0x18da('0x2f')]][_0x18da('0x5f')]){this[_0x18da('0x13')][_0x525683[_0x18da('0x2f')]][_0x18da('0x5f')]=!![];this[_0x18da('0x13')][_0x525683['uniqueid']][_0x18da('0x60')]=_0x181698[_0x18da('0x3f')](_0x18da('0x46'));if(this[_0x18da('0x13')][_0x525683['uniqueid']][_0x18da('0x45')]){this['channels'][_0x525683[_0x18da('0x2f')]][_0x18da('0x61')]=_0x181698[_0x18da('0x66')](this[_0x18da('0x13')][_0x525683[_0x18da('0x2f')]][_0x18da('0x45')],'seconds');}}if(_0x525683[_0x18da('0x62')]!=='xcally-motion-preview'){this[_0x18da('0x13')][_0x525683[_0x18da('0x2f')]][_0x18da('0x3e')]=_0x525683[_0x18da('0x62')];}this[_0x18da('0x13')][_0x525683[_0x18da('0x2f')]][_0x18da('0x67')]=_0x525683['calleridname'];this[_0x18da('0x13')][_0x525683[_0x18da('0x2f')]]['destinationchannel']=_0x525683[_0x18da('0x39')];this[_0x18da('0x13')][_0x525683[_0x18da('0x2f')]][_0x18da('0x53')]=dispositions[_[_0x18da('0x64')](_0x525683[_0x18da('0x5e')])];}}else{if(this['channels'][_0x525683[_0x18da('0x2f')]]){if(_0x419c27){this[_0x18da('0x13')][_0x525683[_0x18da('0x2f')]]['UserId']=_0x419c27['id'];this[_0x18da('0x13')][_0x525683['uniqueid']][_0x18da('0x65')]=_0x419c27[_0x18da('0x41')];}}}if(_0x525683['context']===_0x18da('0x38')){if(_0x419c27){_0x419c27[_0x18da('0x3d')]=_0x525683['exten'];var _0x21f47b;if(this['channels'][_0x525683[_0x18da('0x2f')]]){_0x21f47b=this[_0x18da('0x13')][_0x525683[_0x18da('0x2f')]][_0x18da('0x59')];}else if(this[_0x18da('0x13')][_0x525683[_0x18da('0x33')]]){_0x21f47b=this[_0x18da('0x13')][_0x525683['linkedid']][_0x18da('0x59')];}_0x419c27[_0x18da('0x59')]=_0x21f47b;var _0x4d8f5d={'id':_0x419c27['id'],'name':_0x419c27[_0x18da('0x41')],'agentconnected':!![],'destaccountcode':_0x419c27[_0x18da('0x42')],'destconnectedlinenum':_0x525683[_0x18da('0x3b')],'queue':_0x21f47b||undefined,'uniqueid':_0x525683[_0x18da('0x33')]};logger[_0x18da('0x31')](_0x18da('0x68'),_0x525683['uniqueid'],util[_0x18da('0x29')](_0x4d8f5d,{'showHidden':![],'depth':null}));this[_0x18da('0x2d')](util[_0x18da('0x3f')](_0x18da('0x40'),_0x419c27[_0x18da('0x41')]),_0x18da('0x69'),_0x4d8f5d);}}}}catch(_0x2a29c0){logger[_0x18da('0x27')](_0x18da('0x6a'),_0x525683[_0x18da('0x2f')],util[_0x18da('0x29')](_0x2a29c0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x18da('0x2a')]['syncMixMonitorFilename']=function(_0x3fbf6f,_0x42a75a){try{if(this['channels'][_0x3fbf6f]){logger['info'](_0x18da('0x6b'),_0x3fbf6f,_0x42a75a);this[_0x18da('0x13')][_0x3fbf6f][_0x18da('0x6c')]=!![];if(_[_0x18da('0x6d')](_0x42a75a,'.wav49')){_0x42a75a=_0x42a75a[_0x18da('0x6e')](_0x18da('0x6f'),_0x18da('0x70'));}this[_0x18da('0x13')][_0x3fbf6f][_0x18da('0x71')]=_0x42a75a;var _0x37849a=_[_0x18da('0x72')](this[_0x18da('0x13')][_0x3fbf6f][_0x18da('0x73')],{'filename':_0x42a75a});if(_[_0x18da('0x58')](_0x37849a)){this[_0x18da('0x13')][_0x3fbf6f][_0x18da('0x73')][_0x18da('0x74')]({'filename':_0x42a75a,'createdAt':moment()[_0x18da('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x18da('0x75')});}}}catch(_0x8546d3){logger[_0x18da('0x27')](_0x18da('0x76'),_0x3fbf6f,util['inspect'](_0x8546d3,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x18da('0x77')]=function(_0x205d41){try{if(this[_0x18da('0x2b')](_0x205d41)){logger[_0x18da('0x31')](_0x18da('0x78'),_0x205d41[_0x18da('0x2f')],util['inspect'](_0x205d41,{'showHidden':![],'depth':null}));if(this[_0x18da('0x13')][_0x205d41[_0x18da('0x2f')]]&&_0x205d41[_0x18da('0x39')]!=_0x18da('0x4b')){if(this[_0x18da('0x2b')](_0x205d41[_0x18da('0x79')])){if(this[_0x18da('0x2b')](_0x205d41[_0x18da('0x79')][_0x18da('0x7a')])){logger['info'](_0x18da('0x7b'),_0x205d41[_0x18da('0x2f')],_0x205d41['value']);this[_0x18da('0x7c')](_0x205d41[_0x18da('0x2f')],_0x205d41[_0x18da('0x7d')]);}else if(this[_0x18da('0x2b')](_0x205d41[_0x18da('0x79')][_0x18da('0x7e')])){logger[_0x18da('0x25')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x205d41[_0x18da('0x2f')],_0x205d41[_0x18da('0x7d')]);this[_0x18da('0x13')][_0x205d41[_0x18da('0x2f')]][_0x18da('0x62')]=_0x205d41['value'];}else if(this['isNotNull'](_0x205d41[_0x18da('0x79')][_0x18da('0x7f')])){logger[_0x18da('0x25')](_0x18da('0x80'),_0x205d41[_0x18da('0x2f')],_0x205d41['value']);this['channels'][_0x205d41[_0x18da('0x2f')]][_0x18da('0x81')]=_0x205d41[_0x18da('0x7d')];}else if(this[_0x18da('0x2b')](_0x205d41[_0x18da('0x79')]['xmd-cdrtype'])){logger['info'](_0x18da('0x82'),_0x205d41[_0x18da('0x2f')],_0x205d41[_0x18da('0x7d')]);this[_0x18da('0x13')][_0x205d41[_0x18da('0x2f')]][_0x18da('0x57')]=_0x205d41[_0x18da('0x7d')];}else if(this['isNotNull'](_0x205d41['variable'][_0x18da('0x83')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x205d41['uniqueid'],_0x205d41['value'][_0x18da('0x3a')](',')[0x0]);this[_0x18da('0x13')][_0x205d41['uniqueid']][_0x18da('0x59')]=_0x205d41['value'][_0x18da('0x3a')](',')[0x0];}else if(this[_0x18da('0x2b')](_0x205d41[_0x18da('0x79')][_0x18da('0x84')])){logger['info'](_0x18da('0x85'),_0x205d41[_0x18da('0x2f')],_0x205d41[_0x18da('0x7d')]);this[_0x18da('0x13')][_0x205d41[_0x18da('0x2f')]][_0x18da('0x86')]=_0x205d41[_0x18da('0x7d')];}else if(this[_0x18da('0x2b')](_0x205d41[_0x18da('0x79')][_0x18da('0x87')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s',_0x205d41[_0x18da('0x2f')],_0x205d41['value']);this[_0x18da('0x13')][_0x205d41['uniqueid']][_0x18da('0x88')]=_0x205d41[_0x18da('0x7d')];}else if(this[_0x18da('0x2b')](_0x205d41[_0x18da('0x79')]['xmd-callerid-preview'])){logger[_0x18da('0x25')](_0x18da('0x89'),_0x205d41['uniqueid'],_0x205d41['value']);this[_0x18da('0x13')][_0x205d41[_0x18da('0x2f')]][_0x18da('0x8a')]=_0x205d41['value'];}else if(this['isNotNull'](_0x205d41[_0x18da('0x79')][_0x18da('0x8b')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s',_0x205d41[_0x18da('0x2f')],_0x205d41[_0x18da('0x7d')]);this[_0x18da('0x13')][_0x205d41[_0x18da('0x2f')]][_0x18da('0x59')]=_0x205d41[_0x18da('0x7d')];}else if(this[_0x18da('0x2b')](_0x205d41[_0x18da('0x79')][_0x18da('0x8c')])){logger['info'](_0x18da('0x8d'),_0x205d41['uniqueid'],_0x205d41[_0x18da('0x7d')]);this[_0x18da('0x13')][_0x205d41[_0x18da('0x2f')]][_0x18da('0x8e')]=_0x205d41[_0x18da('0x7d')];}}}else if(this[_0x18da('0x2b')](_0x205d41[_0x18da('0x79')]['mixmonitor_filename'])){if(_0x205d41['value']){var _0x53b1fd=path[_0x18da('0x8f')](_0x205d41[_0x18da('0x7d')])['name'];logger[_0x18da('0x25')](_0x18da('0x7b'),_0x53b1fd,_0x205d41[_0x18da('0x7d')]);this[_0x18da('0x7c')](_0x53b1fd,_0x205d41[_0x18da('0x7d')]);}}else if(this['channels'][_0x205d41[_0x18da('0x33')]]){if(this['isNotNull'](_0x205d41['variable'])){if(this['isNotNull'](_0x205d41[_0x18da('0x79')][_0x18da('0x8c')])){logger[_0x18da('0x25')](_0x18da('0x8d'),_0x205d41[_0x18da('0x33')],_0x205d41['value']);this[_0x18da('0x13')][_0x205d41['linkedid']][_0x18da('0x90')]=_0x205d41[_0x18da('0x7d')];}}}}}catch(_0x2e31c6){logger['error'](_0x18da('0x91'),_0x205d41['uniqueid'],util[_0x18da('0x29')](_0x2e31c6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x18da('0x2a')][_0x18da('0x1d')]=function(_0x42fac8){try{if(this['isNotNull'](_0x42fac8)){logger[_0x18da('0x31')]('[%s][voiceCallReport][hangup]\x20event:',_0x42fac8[_0x18da('0x2f')],util[_0x18da('0x29')](_0x42fac8,{'showHidden':![],'depth':null}));if(this['blindTransfers'][_0x42fac8[_0x18da('0x33')]]){if(this[_0x18da('0x13')][this[_0x18da('0x15')][_0x42fac8[_0x18da('0x33')]]['linkedid']]){this[_0x18da('0x13')][this[_0x18da('0x15')][_0x42fac8[_0x18da('0x33')]][_0x18da('0x33')]][_0x18da('0x2f')]=_0x42fac8[_0x18da('0x2f')];this[_0x18da('0x13')][this[_0x18da('0x15')][_0x42fac8[_0x18da('0x33')]][_0x18da('0x33')]][_0x18da('0x5f')]=this[_0x18da('0x13')][_0x42fac8[_0x18da('0x2f')]][_0x18da('0x5f')];this[_0x18da('0x13')][this['blindTransfers'][_0x42fac8[_0x18da('0x33')]][_0x18da('0x33')]][_0x18da('0x60')]=this[_0x18da('0x13')][_0x42fac8[_0x18da('0x2f')]][_0x18da('0x60')];this[_0x18da('0x13')][this['blindTransfers'][_0x42fac8[_0x18da('0x33')]][_0x18da('0x33')]][_0x18da('0x63')]=this[_0x18da('0x13')][this[_0x18da('0x15')][_0x42fac8[_0x18da('0x33')]][_0x18da('0x33')]][_0x18da('0x39')];this[_0x18da('0x13')][this[_0x18da('0x15')][_0x42fac8[_0x18da('0x33')]][_0x18da('0x33')]]['disposition']=this['channels'][_0x42fac8[_0x18da('0x2f')]][_0x18da('0x53')];this[_0x18da('0x13')][_0x42fac8[_0x18da('0x2f')]]=this[_0x18da('0x13')][this[_0x18da('0x15')][_0x42fac8[_0x18da('0x33')]][_0x18da('0x33')]];this[_0x18da('0x92')](this['blindTransfers'][_0x42fac8[_0x18da('0x33')]][_0x18da('0x33')]);}else if(this[_0x18da('0x13')][this[_0x18da('0x15')][_0x42fac8[_0x18da('0x33')]][_0x18da('0x2f')]]){this['channels'][this[_0x18da('0x15')][_0x42fac8[_0x18da('0x33')]][_0x18da('0x2f')]][_0x18da('0x2f')]=[this[_0x18da('0x13')][this[_0x18da('0x15')][_0x42fac8[_0x18da('0x33')]][_0x18da('0x2f')]]['linkedid'],this[_0x18da('0x13')][this[_0x18da('0x15')][_0x42fac8['linkedid']][_0x18da('0x2f')]][_0x18da('0x33')]=this[_0x18da('0x13')][this[_0x18da('0x15')][_0x42fac8[_0x18da('0x33')]][_0x18da('0x2f')]][_0x18da('0x2f')]][0x0];this[_0x18da('0x13')][this[_0x18da('0x15')][_0x42fac8[_0x18da('0x33')]]['uniqueid']][_0x18da('0x5f')]=this[_0x18da('0x13')][_0x42fac8['uniqueid']][_0x18da('0x5f')];this[_0x18da('0x13')][this[_0x18da('0x15')][_0x42fac8['linkedid']][_0x18da('0x2f')]][_0x18da('0x60')]=this[_0x18da('0x13')][_0x42fac8[_0x18da('0x2f')]][_0x18da('0x60')];this['channels'][this[_0x18da('0x15')][_0x42fac8[_0x18da('0x33')]][_0x18da('0x2f')]][_0x18da('0x63')]=this[_0x18da('0x13')][this[_0x18da('0x15')][_0x42fac8['linkedid']][_0x18da('0x2f')]][_0x18da('0x39')];this[_0x18da('0x13')][this[_0x18da('0x15')][_0x42fac8[_0x18da('0x33')]][_0x18da('0x2f')]]['disposition']=this['channels'][_0x42fac8[_0x18da('0x2f')]]['disposition'];this[_0x18da('0x13')][_0x42fac8[_0x18da('0x2f')]]=this['channels'][this['blindTransfers'][_0x42fac8['linkedid']][_0x18da('0x2f')]];this['deleteChannelAfterTimeout'](this[_0x18da('0x15')][_0x42fac8[_0x18da('0x33')]][_0x18da('0x2f')]);}}if(this['channels'][_0x42fac8[_0x18da('0x2f')]]){logger[_0x18da('0x25')](_0x18da('0x93'),_0x42fac8[_0x18da('0x2f')],_0x42fac8['cause-txt']);var _0x5d40e6=moment();this[_0x18da('0x13')][_0x42fac8[_0x18da('0x2f')]][_0x18da('0x94')]=_0x5d40e6['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x18da('0x13')][_0x42fac8['uniqueid']][_0x18da('0x51')]=_0x5d40e6[_0x18da('0x66')](this['channels'][_0x42fac8[_0x18da('0x2f')]][_0x18da('0x45')],'seconds');if(this[_0x18da('0x13')][_0x42fac8['uniqueid']]['answered']){this['channels'][_0x42fac8[_0x18da('0x2f')]][_0x18da('0x95')]=_0x5d40e6['diff'](this[_0x18da('0x13')][_0x42fac8[_0x18da('0x2f')]]['answertime'],_0x18da('0x52'));this['channels'][_0x42fac8[_0x18da('0x2f')]][_0x18da('0x61')]=this[_0x18da('0x13')][_0x42fac8['uniqueid']][_0x18da('0x51')]-this[_0x18da('0x13')][_0x42fac8[_0x18da('0x2f')]][_0x18da('0x95')];}if(_0x42fac8[_0x18da('0x37')]===_0x18da('0x38')){if(this[_0x18da('0x14')][_0x42fac8[_0x18da('0x39')][_0x18da('0x3a')]('-')[0x0]]){this[_0x18da('0x14')][_0x42fac8[_0x18da('0x39')][_0x18da('0x3a')]('-')[0x0]]=_[_0x18da('0x96')](this[_0x18da('0x14')][_0x42fac8[_0x18da('0x39')]['split']('-')[0x0]],['destconnectedlinenum']);logger[_0x18da('0x31')](_0x18da('0x97'),_0x42fac8[_0x18da('0x2f')],util[_0x18da('0x29')]({'id':this['agents'][_0x42fac8['channel']['split']('-')[0x0]]['id'],'destaccountcode':this[_0x18da('0x14')][_0x42fac8[_0x18da('0x39')][_0x18da('0x3a')]('-')[0x0]]['accountcode']},{'showHidden':![],'depth':null}));this[_0x18da('0x2d')](util[_0x18da('0x3f')](_0x18da('0x40'),this[_0x18da('0x14')][_0x42fac8[_0x18da('0x39')]['split']('-')[0x0]][_0x18da('0x41')]),_0x18da('0x98'),{'id':this[_0x18da('0x14')][_0x42fac8[_0x18da('0x39')][_0x18da('0x3a')]('-')[0x0]]['id'],'destaccountcode':this[_0x18da('0x14')][_0x42fac8[_0x18da('0x39')]['split']('-')[0x0]][_0x18da('0x42')]});for(var _0x41e559=0x0;_0x41e559{delete this[_0x18da('0x13')][_0x2cf170];},_0x3f562a);}};module[_0x18da('0xc8')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index d16ca1c..5efb529 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 _0x46cb=['isUndefined','emit','isNotNull','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','format','YYYY-MM-DD\x20HH:mm:ss','channel','lastIndexOf','omit','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','merge','error','[%s][voiceDialReport][dialend]\x20event:','dialstatus','connectedlinenum','connectedlinename','answertime','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','substring','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','voice_outbound_channel:save','[%s][voiceDialReport][dialend]','addVariable','variable','value','outboundrouteid','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','keys','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','diff','seconds','complete','answered','starttime','holdtime','billableseconds','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','deleteChannelAfterTimeout','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','syncNewExten','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','appdata','startsWith','cdr(','split','match','[%s][voiceDialReport][newexten]','exports','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','variables','dialbegin','syncDialBegin','bind','varset','syncVarSet','hangup','syncHangup','prototype'];(function(_0x5bea12,_0x5484d1){var _0x2b362d=function(_0x1da89c){while(--_0x1da89c){_0x5bea12['push'](_0x5bea12['shift']());}};_0x2b362d(++_0x5484d1);}(_0x46cb,0xd6));var _0xb46c=function(_0x545bed,_0x221e96){_0x545bed=_0x545bed-0x0;var _0x16c79c=_0x46cb[_0x545bed];return _0x16c79c;};'use strict';var _=require('lodash');var moment=require('moment');var util=require('util');var Redis=require(_0xb46c('0x0'));var config=require(_0xb46c('0x1'));var logger=require(_0xb46c('0x2'))(_0xb46c('0x3'));var ami=require(_0xb46c('0x4'));config[_0xb46c('0x5')]=_[_0xb46c('0x6')](config[_0xb46c('0x5')],{'host':_0xb46c('0x7'),'port':0x18eb});var io=require(_0xb46c('0x8'))(new Redis(config[_0xb46c('0x5')]));function VoiceDialReport(_0x4603b8){this[_0xb46c('0x9')]=_0x4603b8[_0xb46c('0xa')];this['outbound']=_0x4603b8[_0xb46c('0xb')];this[_0xb46c('0xc')]={};this[_0xb46c('0xd')]={};ami['on'](_0xb46c('0xe'),this[_0xb46c('0xf')]['bind'](this));ami['on']('dialend',this['syncDialEnd'][_0xb46c('0x10')](this));ami['on'](_0xb46c('0x11'),this[_0xb46c('0x12')][_0xb46c('0x10')](this));ami['on'](_0xb46c('0x13'),this[_0xb46c('0x14')]['bind'](this));}VoiceDialReport[_0xb46c('0x15')]['isNotNull']=function(_0x464456){return _0x464456!==null&&!_[_0xb46c('0x16')](_0x464456);};VoiceDialReport['prototype'][_0xb46c('0x17')]=function(_0x59c2db,_0x24b897,_0x5246b4){io['to'](_0x59c2db)[_0xb46c('0x17')](_0x24b897,_0x5246b4);};VoiceDialReport[_0xb46c('0x15')]['syncDialBegin']=function(_0x3455d7){try{if(this[_0xb46c('0x18')](_0x3455d7)){logger[_0xb46c('0x19')](_0xb46c('0x1a'),_0x3455d7[_0xb46c('0x1b')],util[_0xb46c('0x1c')](_0x3455d7,{'showHidden':![],'depth':null}));if(this[_0xb46c('0x9')][_0x3455d7[_0xb46c('0x1b')]]){_['merge'](this[_0xb46c('0x9')][_0x3455d7[_0xb46c('0x1b')]],{'starttime':moment()[_0xb46c('0x1d')](_0xb46c('0x1e')),'lastevent':'called','interface':_0x3455d7[_0xb46c('0x1f')]['substring'](0x0,_0x3455d7[_0xb46c('0x1f')][_0xb46c('0x20')]('-')),'membername':_0x3455d7[_0xb46c('0x1f')]['substring'](_0x3455d7[_0xb46c('0x1f')][_0xb46c('0x20')]('/')+0x1,_0x3455d7['channel']['lastIndexOf']('-'))},_[_0xb46c('0x21')](_0x3455d7,['event','privilege']));logger[_0xb46c('0x22')](_0xb46c('0x23'),_0x3455d7[_0xb46c('0x1b')],this[_0xb46c('0x9')][_0x3455d7['uniqueid']]['membername'],this[_0xb46c('0x9')][_0x3455d7[_0xb46c('0x1b')]][_0xb46c('0x24')]);logger[_0xb46c('0x19')](_0xb46c('0x25'),_0x3455d7[_0xb46c('0x1b')],util[_0xb46c('0x1c')](this[_0xb46c('0x9')][_0x3455d7['uniqueid']],{'showHidden':![],'depth':null}));if(this[_0xb46c('0xc')][_0x3455d7[_0xb46c('0x1b')]])_[_0xb46c('0x26')](this[_0xb46c('0x9')][_0x3455d7[_0xb46c('0x1b')]],this[_0xb46c('0xc')][_0x3455d7[_0xb46c('0x1b')]]);this[_0xb46c('0x17')]('voice:outbound','voice_outbound_channel:save',this['channels'][_0x3455d7[_0xb46c('0x1b')]]);logger[_0xb46c('0x19')]('[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:',_0x3455d7[_0xb46c('0x1b')],util['inspect'](this['channels'][_0x3455d7[_0xb46c('0x1b')]],{'showHidden':![],'depth':null}));ami[_0xb46c('0x17')]('custom:dialbegin',this[_0xb46c('0x9')][_0x3455d7[_0xb46c('0x1b')]]);}}}catch(_0x5badf3){logger[_0xb46c('0x27')]('[%s][voiceDialReport][dialbegin]',_0x3455d7[_0xb46c('0x1b')],util[_0xb46c('0x1c')](_0x5badf3,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xb46c('0x15')]['syncDialEnd']=function(_0x5d77d9){try{if(this[_0xb46c('0x18')](_0x5d77d9)){logger[_0xb46c('0x19')](_0xb46c('0x28'),_0x5d77d9['uniqueid'],util[_0xb46c('0x1c')](_0x5d77d9,{'showHidden':![],'depth':null}));if(this[_0xb46c('0x9')][_0x5d77d9[_0xb46c('0x1b')]]){this[_0xb46c('0x9')][_0x5d77d9[_0xb46c('0x1b')]][_0xb46c('0x29')]=_0x5d77d9[_0xb46c('0x29')];if(_0x5d77d9[_0xb46c('0x29')]==='ANSWER'){this[_0xb46c('0x9')][_0x5d77d9[_0xb46c('0x1b')]][_0xb46c('0x2a')]=_0x5d77d9[_0xb46c('0x2a')];this[_0xb46c('0x9')][_0x5d77d9[_0xb46c('0x1b')]][_0xb46c('0x2b')]=_0x5d77d9['connectedlinename'];this[_0xb46c('0x9')][_0x5d77d9[_0xb46c('0x1b')]][_0xb46c('0x2c')]=moment()['format'](_0xb46c('0x1e'));this['channels'][_0x5d77d9[_0xb46c('0x1b')]][_0xb46c('0x2d')]=_0xb46c('0x2e');logger[_0xb46c('0x22')](_0xb46c('0x2f'),_0x5d77d9[_0xb46c('0x1b')],_0x5d77d9[_0xb46c('0x1f')][_0xb46c('0x30')](_0x5d77d9[_0xb46c('0x1f')][_0xb46c('0x20')]('/')+0x1,_0x5d77d9['channel'][_0xb46c('0x20')]('-')));logger[_0xb46c('0x19')](_0xb46c('0x31'),_0x5d77d9['uniqueid'],util[_0xb46c('0x1c')](this[_0xb46c('0x9')][_0x5d77d9[_0xb46c('0x1b')]],{'showHidden':![],'depth':null}));ami[_0xb46c('0x17')]('custom:dialconnect',this[_0xb46c('0x9')][_0x5d77d9['uniqueid']]);}logger[_0xb46c('0x19')](_0xb46c('0x32'),_0x5d77d9[_0xb46c('0x1b')],util[_0xb46c('0x1c')](this[_0xb46c('0x9')][_0x5d77d9[_0xb46c('0x1b')]],{'showHidden':![],'depth':null}));this[_0xb46c('0x17')]('voice:outbound',_0xb46c('0x33'),this[_0xb46c('0x9')][_0x5d77d9[_0xb46c('0x1b')]]);}}}catch(_0xa045f6){logger[_0xb46c('0x27')](_0xb46c('0x34'),_0x5d77d9[_0xb46c('0x1b')],util[_0xb46c('0x1c')](_0xa045f6,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xb46c('0x15')][_0xb46c('0x12')]=function(_0xca83d4){try{if(this[_0xb46c('0x18')](_0xca83d4)){logger['debug']('[%s][voiceDialReport][varset]\x20event:',_0xca83d4[_0xb46c('0x1b')],util[_0xb46c('0x1c')](_0xca83d4,{'showHidden':![],'depth':null}));this[_0xb46c('0x35')](_0xca83d4[_0xb46c('0x1b')],_['keys'](_0xca83d4[_0xb46c('0x36')])[0x0],_0xca83d4[_0xb46c('0x37')]);if(this[_0xb46c('0x18')](_0xca83d4[_0xb46c('0x36')])&&this[_0xb46c('0x18')](_0xca83d4['variable'][_0xb46c('0x38')])){if(_[_0xb46c('0x16')](this['channels'][_0xca83d4[_0xb46c('0x1b')]])){this[_0xb46c('0x9')][_0xca83d4[_0xb46c('0x1b')]]={'routeId':_0xca83d4[_0xb46c('0x37')],'variables':this[_0xb46c('0xd')][_0xca83d4[_0xb46c('0x1b')]],'motionChannel':_0xb46c('0x39')};logger[_0xb46c('0x22')](_0xb46c('0x3a'),_0xca83d4[_0xb46c('0x1b')],_0xca83d4[_0xb46c('0x36')][_0xb46c('0x38')],_[_0xb46c('0x3b')](_0xca83d4[_0xb46c('0x36')])[0x0],_0xca83d4[_0xb46c('0x37')]);logger[_0xb46c('0x19')](_0xb46c('0x3c'),_0xca83d4['uniqueid'],util['inspect'](this[_0xb46c('0x9')][_0xca83d4[_0xb46c('0x1b')]],{'showHidden':![],'depth':null}));this[_0xb46c('0x17')](_0xb46c('0x3d'),'voice_outbound_channel:save',this[_0xb46c('0x9')][_0xca83d4['uniqueid']]);}}}}catch(_0x3f5617){logger[_0xb46c('0x27')](_0xb46c('0x3e'),_0xca83d4[_0xb46c('0x1b')],util[_0xb46c('0x1c')](_0x3f5617,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xb46c('0x35')]=function(_0x1da11f,_0x2493a1,_0x4bdc45){var _0x38f116=[_0xb46c('0x3f'),_0xb46c('0x40'),'rtpaudioqosjitter',_0xb46c('0x41'),_0xb46c('0x42'),_0xb46c('0x43'),_0xb46c('0x44'),'rtpaudioqosrttbridged','sipcallid',_0xb46c('0x45'),_0xb46c('0x46'),'bridgepvtcallid',_0xb46c('0x47'),_0xb46c('0x48'),_0xb46c('0x49'),_0xb46c('0x4a'),_0xb46c('0x4b'),_0xb46c('0x4c'),_0xb46c('0x4d')];if(!_[_0xb46c('0x4e')](_0x2493a1)&&!_[_0xb46c('0x4f')](_0x38f116,_0x2493a1)){if(_['isUndefined'](this[_0xb46c('0xd')][_0x1da11f])){this[_0xb46c('0xd')][_0x1da11f]={};}this['variables'][_0x1da11f][_0x2493a1]=_0x4bdc45;}};VoiceDialReport[_0xb46c('0x15')][_0xb46c('0x14')]=function(_0x5ab649){try{if(this['isNotNull'](_0x5ab649)){logger[_0xb46c('0x19')]('[%s][voiceDialReport][hangup]\x20event:',_0x5ab649[_0xb46c('0x1b')],util[_0xb46c('0x1c')](_0x5ab649,{'showHidden':![],'depth':null}));if(this[_0xb46c('0x9')][_0x5ab649[_0xb46c('0x1b')]]){logger['info'](_0xb46c('0x50'),_0x5ab649['uniqueid'],_0x5ab649[_0xb46c('0x51')]);this[_0xb46c('0x9')][_0x5ab649[_0xb46c('0x1b')]][_0xb46c('0x52')]=moment()[_0xb46c('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xb46c('0x9')][_0x5ab649[_0xb46c('0x1b')]][_0xb46c('0x53')]=moment(this[_0xb46c('0x9')][_0x5ab649[_0xb46c('0x1b')]][_0xb46c('0x52')])[_0xb46c('0x54')](this[_0xb46c('0x9')][_0x5ab649[_0xb46c('0x1b')]]['starttime'],_0xb46c('0x55'));this['channels'][_0x5ab649[_0xb46c('0x1b')]][_0xb46c('0x2d')]=_0xb46c('0x56');this[_0xb46c('0xb')]['total']+=0x1;if(this[_0xb46c('0x9')][_0x5ab649[_0xb46c('0x1b')]][_0xb46c('0x2c')]){this[_0xb46c('0xb')][_0xb46c('0x57')]+=0x1;this[_0xb46c('0x9')][_0x5ab649[_0xb46c('0x1b')]]['holdtime']=moment(this[_0xb46c('0x9')][_0x5ab649[_0xb46c('0x1b')]][_0xb46c('0x2c')])['diff'](this[_0xb46c('0x9')][_0x5ab649[_0xb46c('0x1b')]][_0xb46c('0x58')],'seconds');this[_0xb46c('0x9')][_0x5ab649['uniqueid']]['billableseconds']=moment(this[_0xb46c('0x9')][_0x5ab649['uniqueid']][_0xb46c('0x52')])[_0xb46c('0x54')](this[_0xb46c('0x9')][_0x5ab649[_0xb46c('0x1b')]][_0xb46c('0x2c')],_0xb46c('0x55'));this['outbound']['sumHoldTime']+=this[_0xb46c('0x9')][_0x5ab649[_0xb46c('0x1b')]][_0xb46c('0x59')]||0x0;this[_0xb46c('0xb')]['sumBillable']+=this['channels'][_0x5ab649[_0xb46c('0x1b')]][_0xb46c('0x5a')];}this['outbound'][_0xb46c('0x5b')]+=this['channels'][_0x5ab649[_0xb46c('0x1b')]][_0xb46c('0x53')];logger[_0xb46c('0x19')](_0xb46c('0x5c'),_0x5ab649['uniqueid'],util[_0xb46c('0x1c')](this[_0xb46c('0x9')][_0x5ab649['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xb46c('0x17')](_0xb46c('0x5d'),this[_0xb46c('0x9')][_0x5ab649[_0xb46c('0x1b')]]);logger[_0xb46c('0x19')](_0xb46c('0x5e'),_0x5ab649[_0xb46c('0x1b')],util[_0xb46c('0x1c')](this['channels'][_0x5ab649[_0xb46c('0x1b')]],{'showHidden':![],'depth':null}));ami[_0xb46c('0x17')](_0xb46c('0x5f'),this['channels'][_0x5ab649[_0xb46c('0x1b')]]);logger['debug'](_0xb46c('0x60'),_0x5ab649['uniqueid'],util[_0xb46c('0x1c')](this[_0xb46c('0x9')][_0x5ab649['uniqueid']],{'showHidden':![],'depth':null}));this['emit'](_0xb46c('0x3d'),'voice_outbound:save',this[_0xb46c('0xb')]);logger[_0xb46c('0x22')](_0xb46c('0x61'),JSON[_0xb46c('0x62')](this['channels'][_0x5ab649[_0xb46c('0x1b')]]));logger['debug'](_0xb46c('0x63'),_0x5ab649[_0xb46c('0x1b')],util['inspect'](this['channels'][_0x5ab649[_0xb46c('0x1b')]],{'showHidden':![],'depth':null}));this[_0xb46c('0x17')](_0xb46c('0x3d'),_0xb46c('0x64'),this['channels'][_0x5ab649[_0xb46c('0x1b')]]);this[_0xb46c('0x65')](_0x5ab649[_0xb46c('0x1b')]);}else if(this[_0xb46c('0x9')][_0x5ab649[_0xb46c('0x66')]]){this[_0xb46c('0x9')][_0x5ab649['linkedid']]['uniqueid']=this[_0xb46c('0x9')][_0x5ab649[_0xb46c('0x66')]][_0xb46c('0x67')];}if(this[_0xb46c('0xd')][_0x5ab649[_0xb46c('0x1b')]]){delete this[_0xb46c('0xd')][_0x5ab649[_0xb46c('0x1b')]];}}}catch(_0x89d0ee){logger[_0xb46c('0x27')](_0xb46c('0x68'),_0x5ab649[_0xb46c('0x1b')],util[_0xb46c('0x1c')](_0x89d0ee,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xb46c('0x15')][_0xb46c('0x69')]=function(_0x2bc72c){try{if(this[_0xb46c('0x18')](_0x2bc72c)){logger['debug'](_0xb46c('0x6a'),_0x2bc72c[_0xb46c('0x1b')],util[_0xb46c('0x1c')](_0x2bc72c,{'showHidden':![],'depth':null}));if(_0x2bc72c[_0xb46c('0x6b')][_0xb46c('0x6c')]()===_0xb46c('0x6d')){_0x2bc72c[_0xb46c('0x6e')]=(_0x2bc72c[_0xb46c('0x6f')]||_0x2bc72c[_0xb46c('0x6e')])[_0xb46c('0x6c')]();if(_[_0xb46c('0x70')](_0x2bc72c[_0xb46c('0x6e')],_0xb46c('0x71'))){if(_[_0xb46c('0x16')](this[_0xb46c('0xc')][_0x2bc72c[_0xb46c('0x1b')]]))this[_0xb46c('0xc')][_0x2bc72c[_0xb46c('0x1b')]]={};logger['info']('[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s',_0x2bc72c['uniqueid'],_0x2bc72c[_0xb46c('0x6b')],_0x2bc72c[_0xb46c('0x6e')]);var _0x106ba7=_0x2bc72c[_0xb46c('0x6e')][_0xb46c('0x72')]('=');var _0x45c435=_0x106ba7[0x0][_0xb46c('0x73')](/cdr\((.*)\)/);if(_0x45c435)this[_0xb46c('0xc')][_0x2bc72c[_0xb46c('0x1b')]][_0x45c435[0x1]]=_0x106ba7[0x1];}}}}catch(_0x536eb0){logger['error'](_0xb46c('0x74'),_0x2bc72c[_0xb46c('0x1b')],util[_0xb46c('0x1c')](_0x536eb0,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xb46c('0x15')][_0xb46c('0x65')]=function(_0xe880e0,_0x844548=0x2710){if(this[_0xb46c('0x9')][_0xe880e0]){setTimeout(()=>{delete this['channels'][_0xe880e0];},_0x844548);}};module[_0xb46c('0x75')]=VoiceDialReport; \ No newline at end of file +var _0x2707=['debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','inspect','merge','channels','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','event','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','format','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','lastIndexOf','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][dialend]','[%s][voiceDialReport][varset]\x20event:','addVariable','keys','value','variable','isUndefined','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','outboundrouteid','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','endtime','diff','starttime','seconds','total','answered','holdtime','sumHoldTime','sumBillable','billableseconds','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:','voice_outbound_channel:remove','deleteChannelAfterTimeout','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','application','set','applicationdata','appdata','toLowerCase','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','match','exports','lodash','moment','ioredis','../../../config/logger','ami','redis','localhost','outboundChannels','outbound','applications','variables','syncDialBegin','bind','dialend','syncDialEnd','syncVarSet','hangup','syncHangup','prototype','isNotNull','emit'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2707,0x65));var _0x7270=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x2707[_0x36884e];return _0x1cc367;};'use strict';var _=require(_0x7270('0x0'));var moment=require(_0x7270('0x1'));var util=require('util');var Redis=require(_0x7270('0x2'));var config=require('../../../config/environment');var logger=require(_0x7270('0x3'))(_0x7270('0x4'));var ami=require('../ami');config[_0x7270('0x5')]=_['defaults'](config['redis'],{'host':_0x7270('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7270('0x5')]));function VoiceDialReport(_0xf4705e){this['channels']=_0xf4705e[_0x7270('0x7')];this[_0x7270('0x8')]=_0xf4705e[_0x7270('0x8')];this[_0x7270('0x9')]={};this[_0x7270('0xa')]={};ami['on']('dialbegin',this[_0x7270('0xb')][_0x7270('0xc')](this));ami['on'](_0x7270('0xd'),this[_0x7270('0xe')][_0x7270('0xc')](this));ami['on']('varset',this[_0x7270('0xf')]['bind'](this));ami['on'](_0x7270('0x10'),this[_0x7270('0x11')]['bind'](this));}VoiceDialReport[_0x7270('0x12')][_0x7270('0x13')]=function(_0x4b4742){return _0x4b4742!==null&&!_['isUndefined'](_0x4b4742);};VoiceDialReport['prototype'][_0x7270('0x14')]=function(_0x423afd,_0x1196af,_0x1a6973){io['to'](_0x423afd)[_0x7270('0x14')](_0x1196af,_0x1a6973);};VoiceDialReport[_0x7270('0x12')]['syncDialBegin']=function(_0x3f7cd7){try{if(this[_0x7270('0x13')](_0x3f7cd7)){logger[_0x7270('0x15')](_0x7270('0x16'),_0x3f7cd7[_0x7270('0x17')],util[_0x7270('0x18')](_0x3f7cd7,{'showHidden':![],'depth':null}));if(this['channels'][_0x3f7cd7[_0x7270('0x17')]]){_[_0x7270('0x19')](this[_0x7270('0x1a')][_0x3f7cd7[_0x7270('0x17')]],{'starttime':moment()['format'](_0x7270('0x1b')),'lastevent':_0x7270('0x1c'),'interface':_0x3f7cd7[_0x7270('0x1d')]['substring'](0x0,_0x3f7cd7[_0x7270('0x1d')]['lastIndexOf']('-')),'membername':_0x3f7cd7[_0x7270('0x1d')][_0x7270('0x1e')](_0x3f7cd7[_0x7270('0x1d')]['lastIndexOf']('/')+0x1,_0x3f7cd7[_0x7270('0x1d')]['lastIndexOf']('-'))},_['omit'](_0x3f7cd7,[_0x7270('0x1f'),_0x7270('0x20')]));logger[_0x7270('0x21')](_0x7270('0x22'),_0x3f7cd7['uniqueid'],this[_0x7270('0x1a')][_0x3f7cd7[_0x7270('0x17')]][_0x7270('0x23')],this[_0x7270('0x1a')][_0x3f7cd7[_0x7270('0x17')]]['interface']);logger[_0x7270('0x15')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x3f7cd7[_0x7270('0x17')],util[_0x7270('0x18')](this['channels'][_0x3f7cd7[_0x7270('0x17')]],{'showHidden':![],'depth':null}));if(this[_0x7270('0x9')][_0x3f7cd7[_0x7270('0x17')]])_['merge'](this[_0x7270('0x1a')][_0x3f7cd7[_0x7270('0x17')]],this[_0x7270('0x9')][_0x3f7cd7[_0x7270('0x17')]]);this[_0x7270('0x14')](_0x7270('0x24'),_0x7270('0x25'),this[_0x7270('0x1a')][_0x3f7cd7[_0x7270('0x17')]]);logger[_0x7270('0x15')](_0x7270('0x26'),_0x3f7cd7['uniqueid'],util[_0x7270('0x18')](this[_0x7270('0x1a')][_0x3f7cd7['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x7270('0x14')](_0x7270('0x27'),this[_0x7270('0x1a')][_0x3f7cd7[_0x7270('0x17')]]);}}}catch(_0x5e44a6){logger[_0x7270('0x28')](_0x7270('0x29'),_0x3f7cd7['uniqueid'],util[_0x7270('0x18')](_0x5e44a6,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x7270('0x12')][_0x7270('0xe')]=function(_0x45461a){try{if(this['isNotNull'](_0x45461a)){logger['debug'](_0x7270('0x2a'),_0x45461a[_0x7270('0x17')],util[_0x7270('0x18')](_0x45461a,{'showHidden':![],'depth':null}));if(this[_0x7270('0x1a')][_0x45461a['uniqueid']]){this[_0x7270('0x1a')][_0x45461a[_0x7270('0x17')]][_0x7270('0x2b')]=_0x45461a[_0x7270('0x2b')];if(_0x45461a[_0x7270('0x2b')]===_0x7270('0x2c')){this[_0x7270('0x1a')][_0x45461a[_0x7270('0x17')]][_0x7270('0x2d')]=_0x45461a[_0x7270('0x2d')];this[_0x7270('0x1a')][_0x45461a[_0x7270('0x17')]][_0x7270('0x2e')]=_0x45461a[_0x7270('0x2e')];this['channels'][_0x45461a['uniqueid']][_0x7270('0x2f')]=moment()[_0x7270('0x30')](_0x7270('0x1b'));this[_0x7270('0x1a')][_0x45461a['uniqueid']][_0x7270('0x31')]=_0x7270('0x32');logger[_0x7270('0x21')](_0x7270('0x33'),_0x45461a[_0x7270('0x17')],_0x45461a[_0x7270('0x1d')][_0x7270('0x1e')](_0x45461a[_0x7270('0x1d')]['lastIndexOf']('/')+0x1,_0x45461a[_0x7270('0x1d')][_0x7270('0x34')]('-')));logger['debug'](_0x7270('0x35'),_0x45461a[_0x7270('0x17')],util[_0x7270('0x18')](this['channels'][_0x45461a[_0x7270('0x17')]],{'showHidden':![],'depth':null}));ami[_0x7270('0x14')](_0x7270('0x36'),this[_0x7270('0x1a')][_0x45461a[_0x7270('0x17')]]);}logger['debug'](_0x7270('0x37'),_0x45461a[_0x7270('0x17')],util['inspect'](this[_0x7270('0x1a')][_0x45461a[_0x7270('0x17')]],{'showHidden':![],'depth':null}));this[_0x7270('0x14')]('voice:outbound',_0x7270('0x25'),this[_0x7270('0x1a')][_0x45461a[_0x7270('0x17')]]);}}}catch(_0x4d8b3f){logger['error'](_0x7270('0x38'),_0x45461a[_0x7270('0x17')],util[_0x7270('0x18')](_0x4d8b3f,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x7270('0x12')][_0x7270('0xf')]=function(_0x533cc6){try{if(this[_0x7270('0x13')](_0x533cc6)){logger[_0x7270('0x15')](_0x7270('0x39'),_0x533cc6['uniqueid'],util[_0x7270('0x18')](_0x533cc6,{'showHidden':![],'depth':null}));this[_0x7270('0x3a')](_0x533cc6['uniqueid'],_[_0x7270('0x3b')](_0x533cc6['variable'])[0x0],_0x533cc6[_0x7270('0x3c')]);if(this[_0x7270('0x13')](_0x533cc6[_0x7270('0x3d')])&&this[_0x7270('0x13')](_0x533cc6[_0x7270('0x3d')]['outboundrouteid'])){if(_[_0x7270('0x3e')](this[_0x7270('0x1a')][_0x533cc6[_0x7270('0x17')]])){this[_0x7270('0x1a')][_0x533cc6['uniqueid']]={'routeId':_0x533cc6[_0x7270('0x3c')],'variables':this[_0x7270('0xa')][_0x533cc6[_0x7270('0x17')]],'motionChannel':_0x7270('0x3f')};logger['info'](_0x7270('0x40'),_0x533cc6[_0x7270('0x17')],_0x533cc6[_0x7270('0x3d')][_0x7270('0x41')],_[_0x7270('0x3b')](_0x533cc6[_0x7270('0x3d')])[0x0],_0x533cc6['value']);logger[_0x7270('0x15')]('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x533cc6[_0x7270('0x17')],util[_0x7270('0x18')](this[_0x7270('0x1a')][_0x533cc6[_0x7270('0x17')]],{'showHidden':![],'depth':null}));this[_0x7270('0x14')](_0x7270('0x24'),_0x7270('0x25'),this['channels'][_0x533cc6['uniqueid']]);}}}}catch(_0x43960f){logger[_0x7270('0x28')](_0x7270('0x42'),_0x533cc6[_0x7270('0x17')],util['inspect'](_0x43960f,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x7270('0x3a')]=function(_0x14882e,_0x18dcc4,_0x2ce215){var _0x47db47=[_0x7270('0x43'),_0x7270('0x44'),_0x7270('0x45'),_0x7270('0x46'),_0x7270('0x47'),_0x7270('0x48'),_0x7270('0x49'),_0x7270('0x4a'),_0x7270('0x4b'),_0x7270('0x4c'),_0x7270('0x4d'),_0x7270('0x4e'),'membercalls','memberdynamic','memberinterface',_0x7270('0x4f'),_0x7270('0x23'),_0x7270('0x50'),_0x7270('0x51')];if(!_[_0x7270('0x52')](_0x18dcc4)&&!_[_0x7270('0x53')](_0x47db47,_0x18dcc4)){if(_[_0x7270('0x3e')](this[_0x7270('0xa')][_0x14882e])){this[_0x7270('0xa')][_0x14882e]={};}this[_0x7270('0xa')][_0x14882e][_0x18dcc4]=_0x2ce215;}};VoiceDialReport[_0x7270('0x12')][_0x7270('0x11')]=function(_0x347123){try{if(this[_0x7270('0x13')](_0x347123)){logger['debug'](_0x7270('0x54'),_0x347123[_0x7270('0x17')],util['inspect'](_0x347123,{'showHidden':![],'depth':null}));if(this['channels'][_0x347123['uniqueid']]){logger[_0x7270('0x21')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x347123[_0x7270('0x17')],_0x347123['cause-txt']);this[_0x7270('0x1a')][_0x347123[_0x7270('0x17')]][_0x7270('0x55')]=moment()[_0x7270('0x30')](_0x7270('0x1b'));this[_0x7270('0x1a')][_0x347123[_0x7270('0x17')]]['duration']=moment(this[_0x7270('0x1a')][_0x347123[_0x7270('0x17')]]['endtime'])[_0x7270('0x56')](this['channels'][_0x347123[_0x7270('0x17')]][_0x7270('0x57')],_0x7270('0x58'));this['channels'][_0x347123['uniqueid']]['lastevent']='complete';this[_0x7270('0x8')][_0x7270('0x59')]+=0x1;if(this[_0x7270('0x1a')][_0x347123[_0x7270('0x17')]][_0x7270('0x2f')]){this['outbound'][_0x7270('0x5a')]+=0x1;this[_0x7270('0x1a')][_0x347123[_0x7270('0x17')]][_0x7270('0x5b')]=moment(this[_0x7270('0x1a')][_0x347123[_0x7270('0x17')]][_0x7270('0x2f')])[_0x7270('0x56')](this[_0x7270('0x1a')][_0x347123['uniqueid']][_0x7270('0x57')],_0x7270('0x58'));this[_0x7270('0x1a')][_0x347123[_0x7270('0x17')]]['billableseconds']=moment(this['channels'][_0x347123['uniqueid']][_0x7270('0x55')])[_0x7270('0x56')](this[_0x7270('0x1a')][_0x347123[_0x7270('0x17')]][_0x7270('0x2f')],_0x7270('0x58'));this[_0x7270('0x8')][_0x7270('0x5c')]+=this[_0x7270('0x1a')][_0x347123['uniqueid']][_0x7270('0x5b')]||0x0;this[_0x7270('0x8')][_0x7270('0x5d')]+=this[_0x7270('0x1a')][_0x347123[_0x7270('0x17')]][_0x7270('0x5e')];}this[_0x7270('0x8')][_0x7270('0x5f')]+=this[_0x7270('0x1a')][_0x347123[_0x7270('0x17')]]['duration'];logger[_0x7270('0x15')](_0x7270('0x60'),_0x347123['uniqueid'],util[_0x7270('0x18')](this[_0x7270('0x1a')][_0x347123['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x7270('0x14')](_0x7270('0x61'),this[_0x7270('0x1a')][_0x347123[_0x7270('0x17')]]);logger[_0x7270('0x15')](_0x7270('0x62'),_0x347123[_0x7270('0x17')],util[_0x7270('0x18')](this['channels'][_0x347123[_0x7270('0x17')]],{'showHidden':![],'depth':null}));ami[_0x7270('0x14')](_0x7270('0x63'),this[_0x7270('0x1a')][_0x347123[_0x7270('0x17')]]);logger[_0x7270('0x15')](_0x7270('0x64'),_0x347123['uniqueid'],util[_0x7270('0x18')](this[_0x7270('0x1a')][_0x347123[_0x7270('0x17')]],{'showHidden':![],'depth':null}));this[_0x7270('0x14')](_0x7270('0x24'),_0x7270('0x65'),this[_0x7270('0x8')]);logger[_0x7270('0x21')](_0x7270('0x66'),JSON[_0x7270('0x67')](this[_0x7270('0x1a')][_0x347123['uniqueid']]));logger['debug'](_0x7270('0x68'),_0x347123['uniqueid'],util[_0x7270('0x18')](this[_0x7270('0x1a')][_0x347123[_0x7270('0x17')]],{'showHidden':![],'depth':null}));this[_0x7270('0x14')]('voice:outbound',_0x7270('0x69'),this[_0x7270('0x1a')][_0x347123[_0x7270('0x17')]]);this[_0x7270('0x6a')](_0x347123['uniqueid']);}else if(this['channels'][_0x347123['linkedid']]){this[_0x7270('0x1a')][_0x347123[_0x7270('0x6b')]][_0x7270('0x17')]=this['channels'][_0x347123[_0x7270('0x6b')]][_0x7270('0x6c')];}if(this['variables'][_0x347123['uniqueid']]){delete this['variables'][_0x347123['uniqueid']];}}}catch(_0x16d178){logger[_0x7270('0x28')](_0x7270('0x6d'),_0x347123[_0x7270('0x17')],util['inspect'](_0x16d178,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncNewExten']=function(_0x47635c){try{if(this['isNotNull'](_0x47635c)){logger[_0x7270('0x15')](_0x7270('0x6e'),_0x47635c['uniqueid'],util['inspect'](_0x47635c,{'showHidden':![],'depth':null}));if(_0x47635c[_0x7270('0x6f')]['toLowerCase']()===_0x7270('0x70')){_0x47635c[_0x7270('0x71')]=(_0x47635c[_0x7270('0x72')]||_0x47635c[_0x7270('0x71')])[_0x7270('0x73')]();if(_[_0x7270('0x74')](_0x47635c[_0x7270('0x71')],_0x7270('0x75'))){if(_[_0x7270('0x3e')](this[_0x7270('0x9')][_0x47635c[_0x7270('0x17')]]))this['applications'][_0x47635c['uniqueid']]={};logger[_0x7270('0x21')](_0x7270('0x76'),_0x47635c[_0x7270('0x17')],_0x47635c[_0x7270('0x6f')],_0x47635c['applicationdata']);var _0x5f2c1b=_0x47635c[_0x7270('0x71')][_0x7270('0x77')]('=');var _0x2da8fb=_0x5f2c1b[0x0][_0x7270('0x78')](/cdr\((.*)\)/);if(_0x2da8fb)this[_0x7270('0x9')][_0x47635c['uniqueid']][_0x2da8fb[0x1]]=_0x5f2c1b[0x1];}}}}catch(_0x4f5a59){logger[_0x7270('0x28')]('[%s][voiceDialReport][newexten]',_0x47635c[_0x7270('0x17')],util['inspect'](_0x4f5a59,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x7270('0x12')][_0x7270('0x6a')]=function(_0x393c77,_0x445725=0x2710){if(this[_0x7270('0x1a')][_0x393c77]){setTimeout(()=>{delete this[_0x7270('0x1a')][_0x393c77];},_0x445725);}};module[_0x7270('0x79')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 16b61e7..34de8ad 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 _0x333d=['moment','ioredis','../../../config/environment','ami','../model/queueReport','redis','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','realtime','agents','voiceQueues','campaigns','variables','bind','queuemember','queuestatuscomplete','syncQueueStatusComplete','queuecallerjoin','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','syncAgentConnect','varset','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','pTalking','queueStatusComplete','unlockRR','queuecallerexit','queuecallercomplete','clearZombieChannels','channels','isNil','catch','message','No\x20such\x20channel','[%s][voiceQueueReport][checkChannel]','inspect','error','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','clearQueueReport','summary','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','voice:queue:%s','queue','uniqueid','queuecallerexitreason','ATTENDEDTRANSFER','format','voice_queue_channel:remove','voice_queue_presence:remove','inbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','name','voice_queue:save','isNotNull','Action','[voiceQueueReport][queues]','isRunning','queuesummary','then','queuestatus','actionid','createQueueSummaryReport','queues','createReport','assign','emitInboundVoiceQueueSummary','type','handleInboundQueueSummaryReport','outbound','custom:queuesummary','statusRequests','syncQueueSummaryComplete','completeEvent','syncQueueMember','push','syncQueueSummary','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','isUndefined','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','ABANDONED','lastAssignedTo','info','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','syncQueueCallerLeave','[%s][voiceQueueReport][queuecallerleave]','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','queuecallerleave','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','queuecallerexitAt','transfer','reason','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','channel','toLowerCase','local/','linkedid','seconds','transfertype','FORWARD','transferexten','destexten','transferuniqueid','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','syncVarSet','[%s][voiceQueueReport][varset]','addVariable','variable','value','CONTINUE','lastevent','timeout','queuecallerleaveAt','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','EXITWITHKEY','keys','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','membername','memberrealtime','includes','handleHangup','length','sumDuration','diff','total','sumBillable','milliseconds','unmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','abandoned','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','sumHoldTime','[%s][voiceQueueReport][handleHangup]','[%s][voiceQueueReport][hangup]','cause-txt','transferid','deleteChannelAfterTimeout','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','switch','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDED','syncBlindTransfer','[%s][voiceQueueReport][blindtransfer]','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','match','[%s][voiceQueueReport][newexten]','lodash'];(function(_0x481f70,_0x5b02ca){var _0x24fcee=function(_0x49fe7c){while(--_0x49fe7c){_0x481f70['push'](_0x481f70['shift']());}};_0x24fcee(++_0x5b02ca);}(_0x333d,0xeb));var _0xd333=function(_0x487a0b,_0x33c302){_0x487a0b=_0x487a0b-0x0;var _0x4cb1ba=_0x333d[_0x487a0b];return _0x4cb1ba;};'use strict';var _=require(_0xd333('0x0'));var moment=require(_0xd333('0x1'));var util=require('util');var Redis=require(_0xd333('0x2'));var config=require(_0xd333('0x3'));var logger=require('../../../config/logger')(_0xd333('0x4'));var ami=require('../ami');var QueueReport=require(_0xd333('0x5'));var VoiceQueueSummary=require('../model/voiceQueueSummary');config[_0xd333('0x6')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xd333('0x7'))(new Redis(config[_0xd333('0x6')]));var Sequence=function(){};Sequence[_0xd333('0x8')][_0xd333('0x9')]=function(_0x5a2d98){this[_0xd333('0xa')]=this['tail']?this['tail'][_0xd333('0xb')](_0x5a2d98):_0x5a2d98();};function VoiceQueueReport(_0x46222e){this[_0xd333('0xc')]=new Sequence();this[_0xd333('0xd')]={};this[_0xd333('0xe')]=_0x46222e;this[_0xd333('0xf')]=_0x46222e[_0xd333('0xf')];this['channels']=_0x46222e['queueChannels'];this[_0xd333('0x10')]=_0x46222e['voiceQueues'];this['campaigns']=_0x46222e[_0xd333('0x11')];this['summary']=initializeSummary();this[_0xd333('0x12')]={};ami['on']('queuesummary',this['syncQueueSummary']['bind'](this));ami['on']('queuesummarycomplete',this['syncQueueSummaryComplete'][_0xd333('0x13')](this));ami['on'](_0xd333('0x14'),this['syncQueueMember'][_0xd333('0x13')](this));ami['on'](_0xd333('0x15'),this[_0xd333('0x16')]['bind'](this));ami['on'](_0xd333('0x17'),this['syncQueueCallerJoin'][_0xd333('0x13')](this));ami['on'](_0xd333('0x18'),this[_0xd333('0x19')][_0xd333('0x13')](this));ami['on']('queuecallerleave',this['syncQueueCallerLeave']['bind'](this));ami['on'](_0xd333('0x1a'),this[_0xd333('0x1b')][_0xd333('0x13')](this));ami['on']('agentconnect',this[_0xd333('0x1c')]['bind'](this));ami['on'](_0xd333('0x1d'),this['syncVarSet'][_0xd333('0x13')](this));ami['on'](_0xd333('0x1e'),this[_0xd333('0x1f')][_0xd333('0x13')](this));ami['on'](_0xd333('0x20'),this[_0xd333('0x21')][_0xd333('0x13')](this));ami['on'](_0xd333('0x22'),this[_0xd333('0x23')][_0xd333('0x13')](this));ami['on'](_0xd333('0x24'),this[_0xd333('0x25')]['bind'](this));ami['on'](_0xd333('0x26'),this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0xd333('0x13')](this));this[_0xd333('0x27')]();this[_0xd333('0x28')]();}function clearChannels(_0x42ffa0){if(!_[_0xd333('0x29')](_0x42ffa0)){for(var _0x24bb08 in _0x42ffa0){if(_0x42ffa0[_0xd333('0x2a')](_0x24bb08)){delete _0x42ffa0[_0x24bb08];}}}}function clearCampaigns(_0x2a7d9f){if(!_[_0xd333('0x29')](_0x2a7d9f)){for(var _0x158d45 in _0x2a7d9f){if(_0x2a7d9f[_0xd333('0x2a')](_0x158d45)){_0x2a7d9f[_0x158d45][_0xd333('0x2b')]=0x0;}}}}function clearVoiceQueues(_0x16b024){if(!_['isEmpty'](_0x16b024)){for(var _0x2c06b7 in _0x16b024){if(_0x16b024[_0xd333('0x2a')](_0x2c06b7)){_0x16b024[_0x2c06b7]['originated']=0x0;_0x16b024[_0x2c06b7][_0xd333('0x2c')]=0x0;_0x16b024[_0x2c06b7][_0xd333('0x2d')]=0x0;_0x16b024[_0x2c06b7]['waiting']=0x0;_0x16b024[_0x2c06b7][_0xd333('0x2e')]=!![];}}}}function clearAgentBooked(_0x2158d2){if(!_[_0xd333('0x29')](_0x2158d2)){for(var _0x2411c9 in _0x2158d2){if(_0x2158d2[_0xd333('0x2a')](_0x2411c9)){_0x2158d2[_0x2411c9][_0xd333('0x2f')]=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0x39c012){return _0x39c012[_0xd333('0x30')]||_0x39c012[_0xd333('0x18')]||_0x39c012[_0xd333('0x31')];}VoiceQueueReport[_0xd333('0x8')][_0xd333('0x32')]=function(){var _0x4dd683=this;for(var _0x46ff30 in this['channels']){if(this[_0xd333('0x33')]['hasOwnProperty'](_0x46ff30)&&!this[_0xd333('0x33')][_0x46ff30]['switch']){this[_0xd333('0xc')][_0xd333('0x9')](function(){if(!_[_0xd333('0x34')](_0x4dd683[_0xd333('0x33')][_0x46ff30])){return ami['Action']({'action':'status','channel':_0x4dd683[_0xd333('0x33')][_0x46ff30]['channel']})[_0xd333('0x35')](function(_0x4d99f4){if(_0x4d99f4[_0xd333('0x36')]===_0xd333('0x37')){setTimeout(function(){if(_0x4dd683[_0xd333('0x33')][_0x46ff30]){delete _0x4dd683[_0xd333('0x33')][_0x46ff30];logger['error'](_0xd333('0x38'),_0x46ff30,util[_0xd333('0x39')](_0x4d99f4,{'showHidden':![],'depth':null}));}if(_0x4dd683[_0xd333('0xd')][_0x46ff30]){delete _0x4dd683[_0xd333('0xd')][_0x46ff30];logger[_0xd333('0x3a')](_0xd333('0x3b'),_0x46ff30,util[_0xd333('0x39')](_0x4d99f4,{'showHidden':![],'depth':null}));}if(_0x4dd683['variables'][_0x46ff30]){delete _0x4dd683['variables'][_0x46ff30];logger[_0xd333('0x3a')](_0xd333('0x3c'),_0x46ff30,util[_0xd333('0x39')](_0x4d99f4,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xd333('0x8')]['syncFullyBooted']=function(){logger[_0xd333('0x3a')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0xd333('0x33')]);this[_0xd333('0x3d')](this[_0xd333('0xd')]);clearAgentBooked(this[_0xd333('0xf')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this['campaigns']);this[_0xd333('0x3e')]=initializeSummary();};VoiceQueueReport[_0xd333('0x8')][_0xd333('0x3d')]=function(_0xfa795f){var _0x1946a5=this;if(!_['isEmpty'](_0xfa795f)){for(var _0x463e83 in _0xfa795f){if(_0xfa795f['hasOwnProperty'](_0x463e83)){_0x1946a5[_0xd333('0x3f')](_0xfa795f[_0x463e83],_0xd333('0x40'));delete _0xfa795f[_0x463e83];}}}};VoiceQueueReport[_0xd333('0x8')][_0xd333('0x41')]=function(_0x223e92,_0x2afe99,_0x72bab4){io['to'](_0x223e92)[_0xd333('0x41')](_0x2afe99,_0x72bab4);};VoiceQueueReport[_0xd333('0x8')][_0xd333('0x42')]=function(_0x34e070,_0x2ec47b){logger[_0xd333('0x43')](_0xd333('0x44')+_0x2ec47b+_0xd333('0x45'),_0x34e070['uniqueid'],util[_0xd333('0x39')](_0x34e070,{'showHidden':![],'depth':null}));this[_0xd333('0x41')](util['format'](_0xd333('0x46'),_0x34e070[_0xd333('0x47')]),'voice_queue_channel:save',_0x34e070);io['emit']('voice_queue_presence:save',_0x34e070);};VoiceQueueReport[_0xd333('0x8')][_0xd333('0x3f')]=function(_0x560994,_0x38bb4c){logger[_0xd333('0x43')](_0xd333('0x44')+_0x38bb4c+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x560994[_0xd333('0x48')],util[_0xd333('0x39')](_0x560994,{'showHidden':![],'depth':null}));if(_0x560994[_0xd333('0x49')]===_0xd333('0x4a')){return;}this[_0xd333('0x41')](util[_0xd333('0x4b')](_0xd333('0x46'),_0x560994[_0xd333('0x47')]),_0xd333('0x4c'),_0x560994);io[_0xd333('0x41')](_0xd333('0x4d'),_0x560994);};VoiceQueueReport[_0xd333('0x8')]['emitInboundVoiceQueueSummary']=function(_0x3ef3ad){if(_0x3ef3ad['type']===_0xd333('0x4e')){logger[_0xd333('0x43')](_0xd333('0x4f'),util['inspect'](_0x3ef3ad,{'showHidden':![],'depth':null}));this[_0xd333('0x41')](util[_0xd333('0x4b')]('voice:queue:%s',_0x3ef3ad[_0xd333('0x50')]),_0xd333('0x51'),_0x3ef3ad);}};VoiceQueueReport[_0xd333('0x8')][_0xd333('0x52')]=function(_0x21c534){return _0x21c534!==null&&!_['isUndefined'](_0x21c534);};VoiceQueueReport[_0xd333('0x8')]['loopQueueShow']=function(){var _0x2cfa5a=this;setInterval(function(){_0x2cfa5a[_0xd333('0x32')]();ami[_0xd333('0x53')]({'action':'queues'})[_0xd333('0x35')](function(_0x329efc){logger['error'](_0xd333('0x54'),util[_0xd333('0x39')](_0x329efc,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xd333('0x8')][_0xd333('0x27')]=function(){var _0x2cebe0=this;setInterval(function(){if(!_0x2cebe0[_0xd333('0x3e')][_0xd333('0x55')]){return ami[_0xd333('0x53')]({'action':_0xd333('0x56')})[_0xd333('0x57')](function(_0x55b158){_0x2cebe0[_0xd333('0x3e')]['id']=_0x55b158['actionid'];_0x2cebe0[_0xd333('0x3e')][_0xd333('0x55')]=!![];_0x2cebe0['summary'][_0xd333('0x58')][_0x55b158[_0xd333('0x59')]]={};})[_0xd333('0x35')](function(_0x1e8ebd){logger['error']('[voiceQueueReport][queuesummary]',util[_0xd333('0x39')](_0x1e8ebd,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0xd333('0x8')][_0xd333('0x5a')]=function(_0x26277d,_0x226a1a){var _0x5f3d72;if(this[_0xd333('0x3e')]&&this['summary'][_0xd333('0x5b')]&&this['summary']['queues'][_0x26277d[_0xd333('0x50')]]){_0x5f3d72=this['summary']['queues'][_0x26277d[_0xd333('0x50')]]['summaryEvent'];}var _0x1a66d3=new VoiceQueueSummary(_0x26277d);return _0x1a66d3[_0xd333('0x5c')](_0x226a1a[_0xd333('0xf')],this[_0xd333('0xf')],_0x5f3d72,this['realtime'][_0xd333('0x33')]);};VoiceQueueReport[_0xd333('0x8')]['handleInboundQueueSummaryReport']=function(_0x24fb8b,_0x6bd552){var _0x21acae=this[_0xd333('0x5a')](_0x24fb8b,_0x6bd552);var _0x35f4dc=![];_0x35f4dc=_0x21acae['compareToInboundQueue'](_0x24fb8b);if(_0x35f4dc){Object[_0xd333('0x5d')](_0x24fb8b,_0x21acae);this[_0xd333('0xe')]['voiceQueues'][_0x24fb8b[_0xd333('0x50')]]=_0x24fb8b;this[_0xd333('0x5e')](_0x21acae);}};VoiceQueueReport['prototype']['syncQueueStatusComplete']=function(_0x39389c){var _0x56796a=null;var _0x320086=this[_0xd333('0x3e')]['id'];if(this[_0xd333('0x3e')][_0xd333('0x58')][_0x320086]){_0x56796a=this[_0xd333('0x3e')][_0xd333('0x58')][_0x320086][_0x39389c[_0xd333('0x59')]];}if(!_0x56796a){this[_0xd333('0x3e')]=initializeSummary();return;}var _0x175a1a=this[_0xd333('0x10')][_0x56796a[_0xd333('0x47')]];if(_0x175a1a[_0xd333('0x5f')]===_0xd333('0x4e')){this[_0xd333('0x60')](_0x175a1a,_0x56796a);}else if(_0x175a1a[_0xd333('0x5f')]===_0xd333('0x61')){var _0x440bef=this[_0xd333('0x5a')](_0x175a1a,_0x56796a);ami[_0xd333('0x41')](_0xd333('0x62'),_0x440bef);}this[_0xd333('0x3e')][_0xd333('0x63')]-=0x1;var _0xcdf0ef=this[_0xd333('0x3e')][_0xd333('0x63')]>0x0?!![]:![];if(!_0xcdf0ef){return this[_0xd333('0x64')](this['summary'][_0xd333('0x65')]);}};VoiceQueueReport[_0xd333('0x8')][_0xd333('0x66')]=function(_0x2c39cc){var _0x451e42=this[_0xd333('0x3e')]['id'];if(this[_0xd333('0x3e')]['queuestatus'][_0x451e42]&&this[_0xd333('0x3e')]['queuestatus'][_0x451e42][_0x2c39cc[_0xd333('0x59')]]){this[_0xd333('0x3e')][_0xd333('0x58')][_0x451e42][_0x2c39cc[_0xd333('0x59')]]['agents'][_0xd333('0x67')](_0x2c39cc);}};VoiceQueueReport[_0xd333('0x8')][_0xd333('0x68')]=function(_0x5347e7){var _0x3b3ba6=this;try{if(this[_0xd333('0x52')](_0x5347e7)&&this[_0xd333('0x52')](_0x5347e7['queue'])){logger['debug'](_0xd333('0x69'),util['inspect'](_0x5347e7,{'showHidden':![],'depth':null}));var _0x496e2c=this[_0xd333('0x10')][_0x5347e7[_0xd333('0x47')]];if(_0x496e2c){logger[_0xd333('0x43')](_0xd333('0x6a'),_0x496e2c[_0xd333('0x50')]);this[_0xd333('0x3e')]['queues'][_0x496e2c[_0xd333('0x50')]]={'summaryEvent':_0x5347e7};this[_0xd333('0x3e')][_0xd333('0x63')]+=0x1;return ami[_0xd333('0x53')]({'action':_0xd333('0x58'),'queue':_0x496e2c[_0xd333('0x50')]})[_0xd333('0x57')](function(_0x1e2792){if(!_0x3b3ba6['summary'][_0xd333('0x58')][_0x5347e7['actionid']]){_0x3b3ba6[_0xd333('0x3e')][_0xd333('0x58')][_0x5347e7['actionid']]={};}_0x3b3ba6[_0xd333('0x3e')][_0xd333('0x58')][_0x5347e7['actionid']][_0x1e2792['actionid']]={'queue':_0x496e2c[_0xd333('0x50')],'agents':[]};})[_0xd333('0x35')](function(_0x2e6504){throw _0x2e6504;});}}}catch(_0x1d478e){logger[_0xd333('0x3a')](_0xd333('0x6b'),util['inspect'](_0x1d478e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd333('0x8')][_0xd333('0x64')]=function(_0x28a15d){if(this[_0xd333('0x3e')][_0xd333('0x63')]>0x0){this[_0xd333('0x3e')][_0xd333('0x65')]=_0x28a15d;return;}logger[_0xd333('0x43')](_0xd333('0x6c'),util[_0xd333('0x39')](_0x28a15d,{'showHidden':![],'depth':null}));this[_0xd333('0x3e')]=initializeSummary();ami['emit'](_0xd333('0x6d'),{});};VoiceQueueReport['prototype'][_0xd333('0x6e')]=function(_0x487c2c){try{if(this[_0xd333('0x52')](_0x487c2c)){logger[_0xd333('0x43')](_0xd333('0x6f'),_0x487c2c['uniqueid'],util[_0xd333('0x39')](_0x487c2c,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0xd333('0xd')][_0x487c2c[_0xd333('0x48')]])){this['queueReports'][_0x487c2c[_0xd333('0x48')]]=[];}if(_[_0xd333('0x70')](this[_0xd333('0x33')][_0x487c2c['uniqueid']])){this[_0xd333('0x33')][_0x487c2c['uniqueid']]={};}var _0xe15812=new QueueReport();_0xe15812['queue']=_0x487c2c[_0xd333('0x47')];_0xe15812['type']=this[_0xd333('0x10')][_0xe15812[_0xd333('0x47')]]&&this[_0xd333('0x10')][_0xe15812['queue']][_0xd333('0x5f')]?this[_0xd333('0x10')][_0xe15812[_0xd333('0x47')]][_0xd333('0x5f')]||_0xd333('0x4e'):_0xd333('0x4e');_0xe15812[_0xd333('0x71')]=moment()[_0xd333('0x4b')](_0xd333('0x72'));_0xe15812[_0xd333('0x73')]=_0x487c2c[_0xd333('0x73')];_0xe15812[_0xd333('0x74')]=_0x487c2c['count'];_0xe15812[_0xd333('0x48')]=_0x487c2c[_0xd333('0x48')];logger['info'](_0xd333('0x75'),_0xe15812['queue'],_0xe15812[_0xd333('0x5f')]);Object['assign'](_0xe15812,_['pick'](_0x487c2c,_['keys'](_0xe15812)));this[_0xd333('0xd')][_0x487c2c[_0xd333('0x48')]][_0xd333('0x67')](_0xe15812);this[_0xd333('0x33')][_0x487c2c[_0xd333('0x48')]]=_0xe15812;this[_0xd333('0x42')](_0xe15812,_0xd333('0x17'));}}catch(_0x21beb0){logger[_0xd333('0x3a')]('[%s][voiceQueueReport][queuecallerjoin]',_0x487c2c[_0xd333('0x48')],util['inspect'](_0x21beb0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd333('0x8')]['syncQueueCallerAbandon']=function(_0x53e707){try{if(this[_0xd333('0x52')](_0x53e707)){logger[_0xd333('0x43')](_0xd333('0x76'),_0x53e707[_0xd333('0x48')],util[_0xd333('0x39')](_0x53e707,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x53e707['uniqueid']]){var _0x1408aa=_[_0xd333('0x77')](this[_0xd333('0xd')][_0x53e707[_0xd333('0x48')]]);_0x1408aa[_0xd333('0x31')]=![];_0x1408aa[_0xd333('0x78')]=null;_0x1408aa['holdtime']=_0x53e707[_0xd333('0x79')];_0x1408aa[_0xd333('0x7a')]=_0x53e707[_0xd333('0x7a')];_0x1408aa[_0xd333('0x18')]=!![];_0x1408aa[_0xd333('0x7b')]=moment()[_0xd333('0x4b')](_0xd333('0x72'));_0x1408aa[_0xd333('0x49')]=_0xd333('0x7c');_0x1408aa[_0xd333('0x7d')]=null;logger[_0xd333('0x7e')](_0xd333('0x7f'),_0x1408aa[_0xd333('0x47')],_0x1408aa[_0xd333('0x5f')]);this['channels'][_0x53e707[_0xd333('0x48')]]=_0x1408aa;this[_0xd333('0x3f')](_0x1408aa,_0xd333('0x18'));}}}catch(_0x3d0c3d){logger[_0xd333('0x3a')](_0xd333('0x76'),_0x53e707[_0xd333('0x48')],util[_0xd333('0x39')](_0x3d0c3d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xd333('0x80')]=function(_0x263063){try{if(this[_0xd333('0x52')](_0x263063)){logger[_0xd333('0x43')](_0xd333('0x81'),_0x263063['uniqueid'],util[_0xd333('0x39')](_0x263063,{'showHidden':![],'depth':null}));if(this[_0xd333('0xd')][_0x263063[_0xd333('0x48')]]){var _0x54c28c=_['last'](this[_0xd333('0xd')][_0x263063['uniqueid']]);_0x54c28c['queuecallerleaveAt']=moment()[_0xd333('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x54c28c[_0xd333('0x82')]=_0x263063[_0xd333('0x82')];_0x54c28c[_0xd333('0x83')]=_0x263063['connectedlinename'];logger[_0xd333('0x7e')](_0xd333('0x84'),_0x54c28c[_0xd333('0x47')],_0x54c28c[_0xd333('0x5f')],_0x263063[_0xd333('0x82')],_0x263063[_0xd333('0x83')]);this[_0xd333('0x33')][_0x263063[_0xd333('0x48')]]=_0x54c28c;this['emitVoiceQueueChannelSave'](_0x54c28c,_0xd333('0x85'));}}}catch(_0x110406){logger[_0xd333('0x3a')](_0xd333('0x81'),_0x263063['uniqueid'],util['inspect'](_0x110406,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xd333('0x1c')]=function(_0x5eb73d){try{if(this[_0xd333('0x52')](_0x5eb73d)){logger['debug'](_0xd333('0x86'),_0x5eb73d[_0xd333('0x48')],util['inspect'](_0x5eb73d,{'showHidden':![],'depth':null}));if(this[_0xd333('0xd')][_0x5eb73d[_0xd333('0x48')]]){var _0x1654a7=_[_0xd333('0x77')](this[_0xd333('0xd')][_0x5eb73d[_0xd333('0x48')]]);_0x1654a7[_0xd333('0x31')]=!![];_0x1654a7[_0xd333('0x49')]=_0xd333('0x87');logger[_0xd333('0x7e')](_0xd333('0x88'),_0x1654a7[_0xd333('0x47')],_0x1654a7[_0xd333('0x5f')]);}}}catch(_0x12d2fd){logger['error'](_0xd333('0x86'),_0x5eb73d[_0xd333('0x48')],util[_0xd333('0x39')](_0x12d2fd,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xd333('0x1b')]=function(_0xb05a8d){try{if(this[_0xd333('0x52')](_0xb05a8d)){logger[_0xd333('0x43')](_0xd333('0x89'),_0xb05a8d[_0xd333('0x48')],util[_0xd333('0x39')](_0xb05a8d,{'showHidden':![],'depth':null}));if(this[_0xd333('0xd')][_0xb05a8d['uniqueid']]){var _0x5d138c=_[_0xd333('0x77')](this['queueReports'][_0xb05a8d['uniqueid']]);_0x5d138c[_0xd333('0x18')]=![];_0x5d138c[_0xd333('0x7b')]=null;_0x5d138c['assigned']=!![];_0x5d138c[_0xd333('0x7d')]=_0xb05a8d['membername'];_0x5d138c[_0xd333('0x79')]=_0xb05a8d[_0xd333('0x79')];_0x5d138c[_0xd333('0x31')]=!![];_0x5d138c['queuecallerexit']=![];_0x5d138c[_0xd333('0x8a')]=null;if(!_0x5d138c[_0xd333('0x8b')]){if(_0xb05a8d[_0xd333('0x8c')]==_0xd333('0x8b')){_0x5d138c[_0xd333('0x49')]='COMPLETED';logger[_0xd333('0x7e')](_0xd333('0x8d'),_0x5d138c[_0xd333('0x47')],_0x5d138c[_0xd333('0x5f')]);}else{if(_[_0xd333('0x8e')](_0xb05a8d[_0xd333('0x8f')][_0xd333('0x90')](),_0xd333('0x91'))){if(this[_0xd333('0xd')][_0xb05a8d['linkedid']]){var _0x1a5e7c=_[_0xd333('0x77')](this['queueReports'][_0xb05a8d[_0xd333('0x92')]]);_0x1a5e7c[_0xd333('0x31')]=![];_0x1a5e7c['queuecallerexit']=!![];_0x1a5e7c[_0xd333('0x8a')]=moment(_0x5d138c[_0xd333('0x71')])['add'](_0xb05a8d[_0xd333('0x79')],_0xd333('0x93'))['format'](_0xd333('0x72'));_0x1a5e7c['queuecallerexitreason']='FORWARDTRANSFER';_0x1a5e7c[_0xd333('0x8b')]=!![];_0x1a5e7c[_0xd333('0x94')]=_0xd333('0x95');_0x1a5e7c[_0xd333('0x96')]=_0xb05a8d[_0xd333('0x97')];_0x1a5e7c[_0xd333('0x98')]=_0xb05a8d[_0xd333('0x48')];logger[_0xd333('0x7e')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x1a5e7c[_0xd333('0x47')],_0x1a5e7c['type']);var _0x38355e=this['queueReports'][_0xb05a8d[_0xd333('0x92')]];this[_0xd333('0xd')][_0xb05a8d[_0xd333('0x92')]]=this[_0xd333('0xd')][_0xb05a8d[_0xd333('0x48')]];this[_0xd333('0xd')][_0xb05a8d['uniqueid']]=_0x38355e;}}else{_0x5d138c['queuecallerexitreason']='COMPLETEDBY'+_0xb05a8d['reason'][_0xd333('0x99')]();logger[_0xd333('0x7e')](_0xd333('0x9a'),_0x5d138c[_0xd333('0x47')],_0x5d138c['type'],_0x5d138c[_0xd333('0x49')]);}}}this['channels'][_0xb05a8d[_0xd333('0x48')]]=_0x5d138c;}}}catch(_0x3f3878){logger[_0xd333('0x3a')](_0xd333('0x89'),_0xb05a8d[_0xd333('0x48')],util[_0xd333('0x39')](_0x3f3878,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd333('0x8')][_0xd333('0x9b')]=function(_0xa9c15d){try{if(this[_0xd333('0x52')](_0xa9c15d)){logger[_0xd333('0x43')](_0xd333('0x9c'),_0xa9c15d[_0xd333('0x48')],util['inspect'](_0xa9c15d,{'showHidden':![],'depth':null}));this[_0xd333('0x9d')](_0xa9c15d[_0xd333('0x48')],_['keys'](_0xa9c15d[_0xd333('0x9e')])[0x0],_0xa9c15d[_0xd333('0x9f')]);if(this[_0xd333('0xd')][_0xa9c15d[_0xd333('0x48')]]){var _0x34b576=_[_0xd333('0x77')](this[_0xd333('0xd')][_0xa9c15d[_0xd333('0x48')]]);if(_0x34b576){if(this[_0xd333('0x52')](_0xa9c15d['variable'])&&this[_0xd333('0x52')](_0xa9c15d[_0xd333('0x9e')][_0xd333('0x58')])){switch(_0xa9c15d[_0xd333('0x9f')]){case _0xd333('0xa0'):_0x34b576[_0xd333('0x30')]=![];_0x34b576[_0xd333('0x8a')]=null;break;case'TIMEOUT':_0x34b576[_0xd333('0xa1')]=_0xd333('0xa2');_0x34b576[_0xd333('0x30')]=!![];_0x34b576[_0xd333('0x8a')]=moment()['format'](_0xd333('0x72'));_0x34b576[_0xd333('0xa3')]=moment()[_0xd333('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0xd333('0x43')](_0xd333('0xa4'),_0xa9c15d['uniqueid'],util['inspect'](_0x34b576,{'showHidden':![],'depth':null}));ami[_0xd333('0x41')](_0xd333('0xa5'),_0x34b576);break;default:_0x34b576[_0xd333('0x30')]=!![];_0x34b576[_0xd333('0x8a')]=moment()[_0xd333('0x4b')](_0xd333('0x72'));_0x34b576[_0xd333('0xa3')]=moment()[_0xd333('0x4b')](_0xd333('0x72'));}_0x34b576['queuecallerabandon']=![];_0x34b576[_0xd333('0x7b')]=null;_0x34b576[_0xd333('0x49')]=_0xa9c15d[_0xd333('0x9f')];this[_0xd333('0x33')][_0xa9c15d[_0xd333('0x48')]]=_0x34b576;this['emitVoiceQueueChannelRemove'](_0x34b576,_0xd333('0x1d'));}else if(this[_0xd333('0x52')](_0xa9c15d[_0xd333('0x9e')])&&this['isNotNull'](_0xa9c15d[_0xd333('0x9e')][_0xd333('0xa6')])){if(!_0x34b576[_0xd333('0x18')]){_0x34b576[_0xd333('0x30')]=!![];_0x34b576[_0xd333('0x8a')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x34b576['queuecallerexitreason']=_0xd333('0xa7');_0x34b576['queuecallerleaveAt']=moment()['format'](_0xd333('0x72'));this[_0xd333('0x33')][_0xa9c15d[_0xd333('0x48')]]=_0x34b576;}}logger[_0xd333('0x7e')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0xa9c15d['uniqueid'],_0x34b576[_0xd333('0x47')],_0x34b576[_0xd333('0x5f')],_[_0xd333('0xa8')](_0xa9c15d[_0xd333('0x9e')])[0x0],_0xa9c15d[_0xd333('0x9f')]);_0x34b576[_0xd333('0x12')]=this[_0xd333('0x12')][_0xa9c15d[_0xd333('0x48')]];}}}}catch(_0x280cf2){logger[_0xd333('0x3a')](_0xd333('0x9c'),_0xa9c15d[_0xd333('0x48')],util[_0xd333('0x39')](_0x280cf2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xd333('0x8')][_0xd333('0x9d')]=function(_0x37e7d3,_0x27d2e2,_0x5a27c4){var _0x4601d5=[_0xd333('0xa9'),_0xd333('0xaa'),_0xd333('0xab'),_0xd333('0xac'),'rtpaudioqosloss',_0xd333('0xad'),_0xd333('0xae'),_0xd333('0xaf'),_0xd333('0xb0'),_0xd333('0xb1'),_0xd333('0xb2'),_0xd333('0xb3'),_0xd333('0xb4'),_0xd333('0xb5'),'memberinterface',_0xd333('0xb6'),_0xd333('0xb7'),'memberpenalty',_0xd333('0xb8')];if(!_['isNil'](_0x27d2e2)&&!_[_0xd333('0xb9')](_0x4601d5,_0x27d2e2)){if(_[_0xd333('0x70')](this[_0xd333('0x12')][_0x37e7d3])){this[_0xd333('0x12')][_0x37e7d3]={};}this['variables'][_0x37e7d3][_0x27d2e2]=_0x5a27c4;}};VoiceQueueReport[_0xd333('0x8')][_0xd333('0xba')]=function(_0x1734fb,_0x2a3609,_0x1b2243){try{var _0x24bdf4={};if(this[_0xd333('0xd')][_0x1734fb]){for(var _0x546d93=0x0;_0x546d93{delete this['channels'][_0x44be94];},_0x192809);}};module['exports']=VoiceQueueReport; \ No newline at end of file +var _0xfab8=['custom:queuesummary','statusRequests','completeEvent','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','YYYY-MM-DD\x20HH:mm:ss','position','count','pick','keys','push','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','ABANDONED','lastAssignedTo','info','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','connectedlinenum','connectedlinename','queuecallerleave','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','membername','queuecallerexitAt','transfer','COMPLETED','startsWith','toLowerCase','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','transferexten','destexten','transferuniqueid','COMPLETEDBY','reason','toUpperCase','[%s][voiceQueueReport][agentcomplete]','[%s][voiceQueueReport][varset]','addVariable','variable','value','TIMEOUT','lastevent','timeout','queuecallerleaveAt','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','EXITWITHKEY','rtpaudioqos','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrtt','sipuri','bridgepeer','bridgepvtcallid','memberinterface','memberlastcall','memberpenalty','memberrealtime','handleHangup','length','diff','ATTENDEDTRANSFER','queuecallerjoinAt','total','answered','milliseconds','unmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','abandoned','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','sumDuration','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','deleteChannelAfterTimeout','[%s][voiceQueueReport][handleHangup]','[%s][voiceQueueReport][hangup]','cause-txt','cause','[%s][voiceQueueReport][syncHangup]\x20No\x20available\x20data\x20in\x20queueReports\x20structure:\x20clear\x20action\x20in\x20variablea\x20and\x20channels\x20structures\x20needed','syncAttendedTransfer','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','ATTENDED','secondtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfereruniqueid','origtransfererexten','transferid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','mohtime','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','set','appdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','applicationdata','[%s][voiceQueueReport][newexten]','exports','lodash','moment','util','ioredis','../../../config/environment','ami','../model/queueReport','../model/voiceQueueSummary','redis','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','queueReports','realtime','agents','channels','voiceQueues','campaigns','summary','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuemember','syncQueueMember','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','originated','hasOwnProperty','talking','pTalking','queueStatusComplete','unlockRR','queuecallerexit','queuecallercomplete','clearZombieChannels','switch','isNil','Action','status','channel','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','syncFullyBooted','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','uniqueid','format','voice:queue:%s','voice_queue_presence:save','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','voice_queue_channel:remove','voice_queue_presence:remove','emitInboundVoiceQueueSummary','type','inbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','isUndefined','queues','catch','[voiceQueueReport][queues]','isRunning','then','actionid','[voiceQueueReport][queuesummary]','createQueueSummaryReport','summaryEvent','createReport','compareToInboundQueue','assign','name','syncQueueStatusComplete','queuestatus','queue','handleInboundQueueSummaryReport','outbound'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfab8,0x171));var _0x8fab=function(_0x244d81,_0x66b49c){_0x244d81=_0x244d81-0x0;var _0x5a3dc7=_0xfab8[_0x244d81];return _0x5a3dc7;};'use strict';var _=require(_0x8fab('0x0'));var moment=require(_0x8fab('0x1'));var util=require(_0x8fab('0x2'));var Redis=require(_0x8fab('0x3'));var config=require(_0x8fab('0x4'));var logger=require('../../../config/logger')(_0x8fab('0x5'));var ami=require('../ami');var QueueReport=require(_0x8fab('0x6'));var VoiceQueueSummary=require(_0x8fab('0x7'));config['redis']=_['defaults'](config[_0x8fab('0x8')],{'host':_0x8fab('0x9'),'port':0x18eb});var io=require(_0x8fab('0xa'))(new Redis(config[_0x8fab('0x8')]));var Sequence=function(){};Sequence[_0x8fab('0xb')][_0x8fab('0xc')]=function(_0x110e7f){this['tail']=this[_0x8fab('0xd')]?this['tail']['finally'](_0x110e7f):_0x110e7f();};function VoiceQueueReport(_0xb5f564){this[_0x8fab('0xe')]=new Sequence();this[_0x8fab('0xf')]={};this[_0x8fab('0x10')]=_0xb5f564;this[_0x8fab('0x11')]=_0xb5f564[_0x8fab('0x11')];this[_0x8fab('0x12')]=_0xb5f564['queueChannels'];this[_0x8fab('0x13')]=_0xb5f564[_0x8fab('0x13')];this['campaigns']=_0xb5f564[_0x8fab('0x14')];this[_0x8fab('0x15')]=initializeSummary();this[_0x8fab('0x16')]={};ami['on'](_0x8fab('0x17'),this[_0x8fab('0x18')][_0x8fab('0x19')](this));ami['on'](_0x8fab('0x1a'),this[_0x8fab('0x1b')][_0x8fab('0x19')](this));ami['on'](_0x8fab('0x1c'),this[_0x8fab('0x1d')]['bind'](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete']['bind'](this));ami['on'](_0x8fab('0x1e'),this[_0x8fab('0x1f')][_0x8fab('0x19')](this));ami['on'](_0x8fab('0x20'),this[_0x8fab('0x21')]['bind'](this));ami['on']('queuecallerleave',this[_0x8fab('0x22')][_0x8fab('0x19')](this));ami['on'](_0x8fab('0x23'),this[_0x8fab('0x24')][_0x8fab('0x19')](this));ami['on'](_0x8fab('0x25'),this[_0x8fab('0x26')][_0x8fab('0x19')](this));ami['on'](_0x8fab('0x27'),this[_0x8fab('0x28')][_0x8fab('0x19')](this));ami['on'](_0x8fab('0x29'),this[_0x8fab('0x2a')][_0x8fab('0x19')](this));ami['on'](_0x8fab('0x2b'),this['syncFullyBooted'][_0x8fab('0x19')](this));ami['on'](_0x8fab('0x2c'),this[_0x8fab('0x2d')]['bind'](this));ami['on'](_0x8fab('0x2e'),this[_0x8fab('0x2f')][_0x8fab('0x19')](this));ami['on'](_0x8fab('0x30'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x8fab('0x31'),this[_0x8fab('0x32')][_0x8fab('0x19')](this));this[_0x8fab('0x33')]();this[_0x8fab('0x34')]();}function clearChannels(_0x304b40){if(!_[_0x8fab('0x35')](_0x304b40)){for(var _0x1686d1 in _0x304b40){if(_0x304b40['hasOwnProperty'](_0x1686d1)){delete _0x304b40[_0x1686d1];}}}}function clearCampaigns(_0x35bf38){if(!_[_0x8fab('0x35')](_0x35bf38)){for(var _0x41c6e4 in _0x35bf38){if(_0x35bf38['hasOwnProperty'](_0x41c6e4)){_0x35bf38[_0x41c6e4][_0x8fab('0x36')]=0x0;}}}}function clearVoiceQueues(_0x3904ce){if(!_['isEmpty'](_0x3904ce)){for(var _0x5202e5 in _0x3904ce){if(_0x3904ce[_0x8fab('0x37')](_0x5202e5)){_0x3904ce[_0x5202e5][_0x8fab('0x36')]=0x0;_0x3904ce[_0x5202e5][_0x8fab('0x38')]=0x0;_0x3904ce[_0x5202e5][_0x8fab('0x39')]=0x0;_0x3904ce[_0x5202e5]['waiting']=0x0;_0x3904ce[_0x5202e5][_0x8fab('0x3a')]=!![];}}}}function clearAgentBooked(_0x15a5f0){if(!_[_0x8fab('0x35')](_0x15a5f0)){for(var _0x36919d in _0x15a5f0){if(_0x15a5f0[_0x8fab('0x37')](_0x36919d)){_0x15a5f0[_0x36919d][_0x8fab('0x3b')]=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0x2a0a56){return _0x2a0a56[_0x8fab('0x3c')]||_0x2a0a56[_0x8fab('0x20')]||_0x2a0a56[_0x8fab('0x3d')];}VoiceQueueReport[_0x8fab('0xb')][_0x8fab('0x3e')]=function(){var _0x3d469f=this;for(var _0x420624 in this['channels']){if(this['channels'][_0x8fab('0x37')](_0x420624)&&!this[_0x8fab('0x12')][_0x420624][_0x8fab('0x3f')]){this[_0x8fab('0xe')][_0x8fab('0xc')](function(){if(!_[_0x8fab('0x40')](_0x3d469f[_0x8fab('0x12')][_0x420624])){return ami[_0x8fab('0x41')]({'action':_0x8fab('0x42'),'channel':_0x3d469f['channels'][_0x420624][_0x8fab('0x43')]})['catch'](function(_0x26de9e){if(_0x26de9e[_0x8fab('0x44')]===_0x8fab('0x45')){setTimeout(function(){if(_0x3d469f[_0x8fab('0x12')][_0x420624]){delete _0x3d469f[_0x8fab('0x12')][_0x420624];logger[_0x8fab('0x46')](_0x8fab('0x47'),_0x420624,util[_0x8fab('0x48')](_0x26de9e,{'showHidden':![],'depth':null}));}if(_0x3d469f[_0x8fab('0xf')][_0x420624]){delete _0x3d469f[_0x8fab('0xf')][_0x420624];logger[_0x8fab('0x46')](_0x8fab('0x49'),_0x420624,util[_0x8fab('0x48')](_0x26de9e,{'showHidden':![],'depth':null}));}if(_0x3d469f[_0x8fab('0x16')][_0x420624]){delete _0x3d469f[_0x8fab('0x16')][_0x420624];logger['error'](_0x8fab('0x4a'),_0x420624,util['inspect'](_0x26de9e,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x8fab('0xb')][_0x8fab('0x4b')]=function(){logger['error'](_0x8fab('0x4c'));clearChannels(this[_0x8fab('0x12')]);this[_0x8fab('0x4d')](this[_0x8fab('0xf')]);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0x8fab('0x13')]);clearCampaigns(this[_0x8fab('0x14')]);this[_0x8fab('0x15')]=initializeSummary();};VoiceQueueReport[_0x8fab('0xb')][_0x8fab('0x4d')]=function(_0x4180ee){var _0x33cfad=this;if(!_[_0x8fab('0x35')](_0x4180ee)){for(var _0xcaed44 in _0x4180ee){if(_0x4180ee['hasOwnProperty'](_0xcaed44)){_0x33cfad[_0x8fab('0x4e')](_0x4180ee[_0xcaed44],_0x8fab('0x4f'));delete _0x4180ee[_0xcaed44];}}}};VoiceQueueReport[_0x8fab('0xb')]['emit']=function(_0x8dbab7,_0x4ea831,_0x2beeba){io['to'](_0x8dbab7)[_0x8fab('0x50')](_0x4ea831,_0x2beeba);};VoiceQueueReport['prototype'][_0x8fab('0x51')]=function(_0x8c8df5,_0x15dff0){logger[_0x8fab('0x52')]('[%s][voiceQueueReport]['+_0x15dff0+']\x20sending\x20voice_queue_channel:save\x20event:',_0x8c8df5[_0x8fab('0x53')],util[_0x8fab('0x48')](_0x8c8df5,{'showHidden':![],'depth':null}));this['emit'](util[_0x8fab('0x54')](_0x8fab('0x55'),_0x8c8df5['queue']),'voice_queue_channel:save',_0x8c8df5);io[_0x8fab('0x50')](_0x8fab('0x56'),_0x8c8df5);};VoiceQueueReport[_0x8fab('0xb')]['emitVoiceQueueChannelRemove']=function(_0x2d2f49,_0x3448cb){logger[_0x8fab('0x52')](_0x8fab('0x57')+_0x3448cb+_0x8fab('0x58'),_0x2d2f49[_0x8fab('0x53')],util[_0x8fab('0x48')](_0x2d2f49,{'showHidden':![],'depth':null}));if(_0x2d2f49[_0x8fab('0x59')]==='ATTENDEDTRANSFER'){return;}this['emit'](util[_0x8fab('0x54')]('voice:queue:%s',_0x2d2f49['queue']),_0x8fab('0x5a'),_0x2d2f49);io[_0x8fab('0x50')](_0x8fab('0x5b'),_0x2d2f49);};VoiceQueueReport[_0x8fab('0xb')][_0x8fab('0x5c')]=function(_0x52a2ea){if(_0x52a2ea[_0x8fab('0x5d')]===_0x8fab('0x5e')){logger[_0x8fab('0x52')](_0x8fab('0x5f'),util['inspect'](_0x52a2ea,{'showHidden':![],'depth':null}));this[_0x8fab('0x50')](util[_0x8fab('0x54')](_0x8fab('0x55'),_0x52a2ea['name']),_0x8fab('0x60'),_0x52a2ea);}};VoiceQueueReport[_0x8fab('0xb')][_0x8fab('0x61')]=function(_0x278fb5){return _0x278fb5!==null&&!_[_0x8fab('0x62')](_0x278fb5);};VoiceQueueReport[_0x8fab('0xb')][_0x8fab('0x34')]=function(){var _0x27087d=this;setInterval(function(){_0x27087d['clearZombieChannels']();ami[_0x8fab('0x41')]({'action':_0x8fab('0x63')})[_0x8fab('0x64')](function(_0x4856f4){logger[_0x8fab('0x46')](_0x8fab('0x65'),util[_0x8fab('0x48')](_0x4856f4,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x8fab('0xb')]['loopQueueSummary']=function(){var _0xd43d64=this;setInterval(function(){if(!_0xd43d64[_0x8fab('0x15')][_0x8fab('0x66')]){return ami[_0x8fab('0x41')]({'action':_0x8fab('0x17')})[_0x8fab('0x67')](function(_0x2613ce){_0xd43d64[_0x8fab('0x15')]['id']=_0x2613ce['actionid'];_0xd43d64[_0x8fab('0x15')][_0x8fab('0x66')]=!![];_0xd43d64[_0x8fab('0x15')]['queuestatus'][_0x2613ce[_0x8fab('0x68')]]={};})[_0x8fab('0x64')](function(_0x2a32dc){logger[_0x8fab('0x46')](_0x8fab('0x69'),util[_0x8fab('0x48')](_0x2a32dc,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x8fab('0xb')][_0x8fab('0x6a')]=function(_0x108d4c,_0x206b5b){var _0x5ed649;if(this[_0x8fab('0x15')]&&this['summary'][_0x8fab('0x63')]&&this['summary'][_0x8fab('0x63')][_0x108d4c['name']]){_0x5ed649=this['summary']['queues'][_0x108d4c['name']][_0x8fab('0x6b')];}var _0x3700a4=new VoiceQueueSummary(_0x108d4c);return _0x3700a4[_0x8fab('0x6c')](_0x206b5b[_0x8fab('0x11')],this['agents'],_0x5ed649,this['realtime'][_0x8fab('0x12')]);};VoiceQueueReport[_0x8fab('0xb')]['handleInboundQueueSummaryReport']=function(_0x5f1b04,_0x23283a){var _0x472af6=this[_0x8fab('0x6a')](_0x5f1b04,_0x23283a);var _0x3d7b91=![];_0x3d7b91=_0x472af6[_0x8fab('0x6d')](_0x5f1b04);if(_0x3d7b91){Object[_0x8fab('0x6e')](_0x5f1b04,_0x472af6);this[_0x8fab('0x10')]['voiceQueues'][_0x5f1b04[_0x8fab('0x6f')]]=_0x5f1b04;this[_0x8fab('0x5c')](_0x472af6);}};VoiceQueueReport['prototype'][_0x8fab('0x70')]=function(_0x1e4748){var _0x3597b3=null;var _0x205c73=this[_0x8fab('0x15')]['id'];if(this['summary'][_0x8fab('0x71')][_0x205c73]){_0x3597b3=this[_0x8fab('0x15')][_0x8fab('0x71')][_0x205c73][_0x1e4748[_0x8fab('0x68')]];}if(!_0x3597b3){this[_0x8fab('0x15')]=initializeSummary();return;}var _0x504a3b=this[_0x8fab('0x13')][_0x3597b3[_0x8fab('0x72')]];if(_0x504a3b['type']===_0x8fab('0x5e')){this[_0x8fab('0x73')](_0x504a3b,_0x3597b3);}else if(_0x504a3b[_0x8fab('0x5d')]===_0x8fab('0x74')){var _0x5b0ec7=this['createQueueSummaryReport'](_0x504a3b,_0x3597b3);ami['emit'](_0x8fab('0x75'),_0x5b0ec7);}this['summary'][_0x8fab('0x76')]-=0x1;var _0x35fb5e=this['summary'][_0x8fab('0x76')]>0x0?!![]:![];if(!_0x35fb5e){return this[_0x8fab('0x1b')](this[_0x8fab('0x15')][_0x8fab('0x77')]);}};VoiceQueueReport[_0x8fab('0xb')]['syncQueueMember']=function(_0xff1ff9){var _0x7d5be2=this[_0x8fab('0x15')]['id'];if(this[_0x8fab('0x15')][_0x8fab('0x71')][_0x7d5be2]&&this[_0x8fab('0x15')][_0x8fab('0x71')][_0x7d5be2][_0xff1ff9['actionid']]){this['summary']['queuestatus'][_0x7d5be2][_0xff1ff9[_0x8fab('0x68')]]['agents']['push'](_0xff1ff9);}};VoiceQueueReport[_0x8fab('0xb')]['syncQueueSummary']=function(_0x30afa3){var _0x2958ae=this;try{if(this[_0x8fab('0x61')](_0x30afa3)&&this['isNotNull'](_0x30afa3[_0x8fab('0x72')])){logger[_0x8fab('0x52')](_0x8fab('0x78'),util['inspect'](_0x30afa3,{'showHidden':![],'depth':null}));var _0x4ec1d4=this[_0x8fab('0x13')][_0x30afa3[_0x8fab('0x72')]];if(_0x4ec1d4){logger[_0x8fab('0x52')](_0x8fab('0x79'),_0x4ec1d4[_0x8fab('0x6f')]);this[_0x8fab('0x15')][_0x8fab('0x63')][_0x4ec1d4[_0x8fab('0x6f')]]={'summaryEvent':_0x30afa3};this[_0x8fab('0x15')][_0x8fab('0x76')]+=0x1;return ami[_0x8fab('0x41')]({'action':'queuestatus','queue':_0x4ec1d4[_0x8fab('0x6f')]})[_0x8fab('0x67')](function(_0x393481){if(!_0x2958ae[_0x8fab('0x15')][_0x8fab('0x71')][_0x30afa3[_0x8fab('0x68')]]){_0x2958ae['summary'][_0x8fab('0x71')][_0x30afa3[_0x8fab('0x68')]]={};}_0x2958ae[_0x8fab('0x15')]['queuestatus'][_0x30afa3[_0x8fab('0x68')]][_0x393481[_0x8fab('0x68')]]={'queue':_0x4ec1d4[_0x8fab('0x6f')],'agents':[]};})['catch'](function(_0x132d7a){throw _0x132d7a;});}}}catch(_0x519e2c){logger[_0x8fab('0x46')](_0x8fab('0x69'),util[_0x8fab('0x48')](_0x519e2c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8fab('0xb')][_0x8fab('0x1b')]=function(_0x1fa70c){if(this[_0x8fab('0x15')]['statusRequests']>0x0){this['summary'][_0x8fab('0x77')]=_0x1fa70c;return;}logger[_0x8fab('0x52')](_0x8fab('0x7a'),util[_0x8fab('0x48')](_0x1fa70c,{'showHidden':![],'depth':null}));this[_0x8fab('0x15')]=initializeSummary();ami[_0x8fab('0x50')]('custom:queuesummarycomplete',{});};VoiceQueueReport[_0x8fab('0xb')][_0x8fab('0x1f')]=function(_0x467b9d){try{if(this['isNotNull'](_0x467b9d)){logger['debug'](_0x8fab('0x7b'),_0x467b9d['uniqueid'],util['inspect'](_0x467b9d,{'showHidden':![],'depth':null}));if(_[_0x8fab('0x62')](this[_0x8fab('0xf')][_0x467b9d[_0x8fab('0x53')]])){this[_0x8fab('0xf')][_0x467b9d[_0x8fab('0x53')]]=[];}if(_[_0x8fab('0x62')](this['channels'][_0x467b9d['uniqueid']])){this[_0x8fab('0x12')][_0x467b9d[_0x8fab('0x53')]]={};}var _0x5b5a44=new QueueReport();_0x5b5a44['queue']=_0x467b9d[_0x8fab('0x72')];_0x5b5a44[_0x8fab('0x5d')]=this[_0x8fab('0x13')][_0x5b5a44[_0x8fab('0x72')]]&&this[_0x8fab('0x13')][_0x5b5a44['queue']][_0x8fab('0x5d')]?this[_0x8fab('0x13')][_0x5b5a44[_0x8fab('0x72')]]['type']||_0x8fab('0x5e'):_0x8fab('0x5e');_0x5b5a44['queuecallerjoinAt']=moment()[_0x8fab('0x54')](_0x8fab('0x7c'));_0x5b5a44[_0x8fab('0x7d')]=_0x467b9d[_0x8fab('0x7d')];_0x5b5a44['count']=_0x467b9d[_0x8fab('0x7e')];_0x5b5a44['uniqueid']=_0x467b9d[_0x8fab('0x53')];logger['info']('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x5b5a44[_0x8fab('0x72')],_0x5b5a44[_0x8fab('0x5d')]);Object[_0x8fab('0x6e')](_0x5b5a44,_[_0x8fab('0x7f')](_0x467b9d,_[_0x8fab('0x80')](_0x5b5a44)));this['queueReports'][_0x467b9d['uniqueid']][_0x8fab('0x81')](_0x5b5a44);this[_0x8fab('0x12')][_0x467b9d[_0x8fab('0x53')]]=_0x5b5a44;this[_0x8fab('0x51')](_0x5b5a44,_0x8fab('0x1e'));}}catch(_0x43966e){logger['error'](_0x8fab('0x7b'),_0x467b9d[_0x8fab('0x53')],util[_0x8fab('0x48')](_0x43966e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x8fab('0x21')]=function(_0x18a5d8){try{if(this[_0x8fab('0x61')](_0x18a5d8)){logger[_0x8fab('0x52')](_0x8fab('0x82'),_0x18a5d8[_0x8fab('0x53')],util['inspect'](_0x18a5d8,{'showHidden':![],'depth':null}));if(this[_0x8fab('0xf')][_0x18a5d8[_0x8fab('0x53')]]){var _0xe01c84=_[_0x8fab('0x83')](this[_0x8fab('0xf')][_0x18a5d8[_0x8fab('0x53')]]);_0xe01c84[_0x8fab('0x3d')]=![];_0xe01c84[_0x8fab('0x84')]=null;_0xe01c84[_0x8fab('0x85')]=_0x18a5d8['holdtime'];_0xe01c84[_0x8fab('0x86')]=_0x18a5d8[_0x8fab('0x86')];_0xe01c84[_0x8fab('0x20')]=!![];_0xe01c84[_0x8fab('0x87')]=moment()[_0x8fab('0x54')](_0x8fab('0x7c'));_0xe01c84['queuecallerexitreason']=_0x8fab('0x88');_0xe01c84[_0x8fab('0x89')]=null;logger[_0x8fab('0x8a')](_0x8fab('0x8b'),_0xe01c84[_0x8fab('0x72')],_0xe01c84['type']);this[_0x8fab('0x12')][_0x18a5d8[_0x8fab('0x53')]]=_0xe01c84;this['emitVoiceQueueChannelRemove'](_0xe01c84,_0x8fab('0x20'));}}}catch(_0x5dc5d4){logger[_0x8fab('0x46')](_0x8fab('0x82'),_0x18a5d8[_0x8fab('0x53')],util[_0x8fab('0x48')](_0x5dc5d4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8fab('0xb')][_0x8fab('0x22')]=function(_0xf28579){try{if(this[_0x8fab('0x61')](_0xf28579)){logger['debug'](_0x8fab('0x8c'),_0xf28579[_0x8fab('0x53')],util[_0x8fab('0x48')](_0xf28579,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xf28579[_0x8fab('0x53')]]){var _0x24671b=_['last'](this[_0x8fab('0xf')][_0xf28579[_0x8fab('0x53')]]);_0x24671b['queuecallerleaveAt']=moment()[_0x8fab('0x54')](_0x8fab('0x7c'));_0x24671b[_0x8fab('0x8d')]=_0xf28579[_0x8fab('0x8d')];_0x24671b[_0x8fab('0x8e')]=_0xf28579[_0x8fab('0x8e')];logger['info']('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x24671b[_0x8fab('0x72')],_0x24671b[_0x8fab('0x5d')],_0xf28579[_0x8fab('0x8d')],_0xf28579[_0x8fab('0x8e')]);this[_0x8fab('0x12')][_0xf28579[_0x8fab('0x53')]]=_0x24671b;this[_0x8fab('0x51')](_0x24671b,_0x8fab('0x8f'));}}}catch(_0x5ddfc7){logger[_0x8fab('0x46')]('[%s][voiceQueueReport][queuecallerleave]',_0xf28579[_0x8fab('0x53')],util['inspect'](_0x5ddfc7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8fab('0xb')]['syncAgentConnect']=function(_0x4ec2eb){try{if(this[_0x8fab('0x61')](_0x4ec2eb)){logger[_0x8fab('0x52')](_0x8fab('0x90'),_0x4ec2eb[_0x8fab('0x53')],util[_0x8fab('0x48')](_0x4ec2eb,{'showHidden':![],'depth':null}));if(this[_0x8fab('0xf')][_0x4ec2eb[_0x8fab('0x53')]]){var _0x256b04=_['last'](this[_0x8fab('0xf')][_0x4ec2eb[_0x8fab('0x53')]]);_0x256b04[_0x8fab('0x3d')]=!![];_0x256b04[_0x8fab('0x59')]=_0x8fab('0x91');logger['info'](_0x8fab('0x92'),_0x256b04[_0x8fab('0x72')],_0x256b04[_0x8fab('0x5d')]);}}}catch(_0x38e82d){logger[_0x8fab('0x46')](_0x8fab('0x90'),_0x4ec2eb[_0x8fab('0x53')],util[_0x8fab('0x48')](_0x38e82d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8fab('0xb')]['syncAgentComplete']=function(_0x70bb69){try{if(this[_0x8fab('0x61')](_0x70bb69)){logger[_0x8fab('0x52')]('[%s][voiceQueueReport][agentcomplete]',_0x70bb69[_0x8fab('0x53')],util[_0x8fab('0x48')](_0x70bb69,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x70bb69[_0x8fab('0x53')]]){var _0x561844=_[_0x8fab('0x83')](this['queueReports'][_0x70bb69[_0x8fab('0x53')]]);_0x561844['queuecallerabandon']=![];_0x561844[_0x8fab('0x87')]=null;_0x561844['assigned']=!![];_0x561844[_0x8fab('0x89')]=_0x70bb69[_0x8fab('0x93')];_0x561844[_0x8fab('0x85')]=_0x70bb69['holdtime'];_0x561844[_0x8fab('0x3d')]=!![];_0x561844[_0x8fab('0x3c')]=![];_0x561844[_0x8fab('0x94')]=null;if(!_0x561844[_0x8fab('0x95')]){if(_0x70bb69['reason']==_0x8fab('0x95')){_0x561844[_0x8fab('0x59')]=_0x8fab('0x96');logger[_0x8fab('0x8a')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x561844['queue'],_0x561844[_0x8fab('0x5d')]);}else{if(_[_0x8fab('0x97')](_0x70bb69['channel'][_0x8fab('0x98')](),_0x8fab('0x99'))){if(this[_0x8fab('0xf')][_0x70bb69[_0x8fab('0x9a')]]){var _0x5e6548=_['last'](this[_0x8fab('0xf')][_0x70bb69[_0x8fab('0x9a')]]);_0x5e6548[_0x8fab('0x3d')]=![];_0x5e6548[_0x8fab('0x3c')]=!![];_0x5e6548[_0x8fab('0x94')]=moment(_0x561844['queuecallerjoinAt'])[_0x8fab('0x9b')](_0x70bb69[_0x8fab('0x85')],_0x8fab('0x9c'))[_0x8fab('0x54')](_0x8fab('0x7c'));_0x5e6548[_0x8fab('0x59')]=_0x8fab('0x9d');_0x5e6548['transfer']=!![];_0x5e6548[_0x8fab('0x9e')]='FORWARD';_0x5e6548[_0x8fab('0x9f')]=_0x70bb69[_0x8fab('0xa0')];_0x5e6548[_0x8fab('0xa1')]=_0x70bb69['uniqueid'];logger[_0x8fab('0x8a')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x5e6548['queue'],_0x5e6548[_0x8fab('0x5d')]);var _0x1471b7=this[_0x8fab('0xf')][_0x70bb69['linkedid']];this[_0x8fab('0xf')][_0x70bb69[_0x8fab('0x9a')]]=this[_0x8fab('0xf')][_0x70bb69[_0x8fab('0x53')]];this[_0x8fab('0xf')][_0x70bb69[_0x8fab('0x53')]]=_0x1471b7;}}else{_0x561844[_0x8fab('0x59')]=_0x8fab('0xa2')+_0x70bb69[_0x8fab('0xa3')][_0x8fab('0xa4')]();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x561844[_0x8fab('0x72')],_0x561844[_0x8fab('0x5d')],_0x561844['queuecallerexitreason']);}}}this[_0x8fab('0x12')][_0x70bb69[_0x8fab('0x53')]]=_0x561844;}}}catch(_0x3d0d5d){logger[_0x8fab('0x46')](_0x8fab('0xa5'),_0x70bb69[_0x8fab('0x53')],util['inspect'](_0x3d0d5d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8fab('0xb')][_0x8fab('0x28')]=function(_0x4f1456){try{if(this[_0x8fab('0x61')](_0x4f1456)){logger[_0x8fab('0x52')](_0x8fab('0xa6'),_0x4f1456['uniqueid'],util[_0x8fab('0x48')](_0x4f1456,{'showHidden':![],'depth':null}));this[_0x8fab('0xa7')](_0x4f1456[_0x8fab('0x53')],_[_0x8fab('0x80')](_0x4f1456[_0x8fab('0xa8')])[0x0],_0x4f1456[_0x8fab('0xa9')]);if(this[_0x8fab('0xf')][_0x4f1456[_0x8fab('0x53')]]){var _0x2774a0=_[_0x8fab('0x83')](this[_0x8fab('0xf')][_0x4f1456['uniqueid']]);if(_0x2774a0){if(this[_0x8fab('0x61')](_0x4f1456['variable'])&&this['isNotNull'](_0x4f1456['variable'][_0x8fab('0x71')])){switch(_0x4f1456[_0x8fab('0xa9')]){case'CONTINUE':_0x2774a0[_0x8fab('0x3c')]=![];_0x2774a0[_0x8fab('0x94')]=null;break;case _0x8fab('0xaa'):_0x2774a0[_0x8fab('0xab')]=_0x8fab('0xac');_0x2774a0['queuecallerexit']=!![];_0x2774a0[_0x8fab('0x94')]=moment()['format'](_0x8fab('0x7c'));_0x2774a0[_0x8fab('0xad')]=moment()['format'](_0x8fab('0x7c'));logger['debug'](_0x8fab('0xae'),_0x4f1456['uniqueid'],util[_0x8fab('0x48')](_0x2774a0,{'showHidden':![],'depth':null}));ami[_0x8fab('0x50')](_0x8fab('0xaf'),_0x2774a0);break;default:_0x2774a0['queuecallerexit']=!![];_0x2774a0[_0x8fab('0x94')]=moment()[_0x8fab('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x2774a0['queuecallerleaveAt']=moment()[_0x8fab('0x54')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2774a0[_0x8fab('0x20')]=![];_0x2774a0[_0x8fab('0x87')]=null;_0x2774a0[_0x8fab('0x59')]=_0x4f1456[_0x8fab('0xa9')];this['channels'][_0x4f1456[_0x8fab('0x53')]]=_0x2774a0;this['emitVoiceQueueChannelRemove'](_0x2774a0,_0x8fab('0x27'));}else if(this['isNotNull'](_0x4f1456[_0x8fab('0xa8')])&&this[_0x8fab('0x61')](_0x4f1456[_0x8fab('0xa8')]['queueposition'])){if(!_0x2774a0[_0x8fab('0x20')]){_0x2774a0[_0x8fab('0x3c')]=!![];_0x2774a0[_0x8fab('0x94')]=moment()['format'](_0x8fab('0x7c'));_0x2774a0[_0x8fab('0x59')]=_0x8fab('0xb0');_0x2774a0['queuecallerleaveAt']=moment()[_0x8fab('0x54')](_0x8fab('0x7c'));this[_0x8fab('0x12')][_0x4f1456[_0x8fab('0x53')]]=_0x2774a0;}}logger['info']('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x4f1456[_0x8fab('0x53')],_0x2774a0[_0x8fab('0x72')],_0x2774a0[_0x8fab('0x5d')],_['keys'](_0x4f1456['variable'])[0x0],_0x4f1456[_0x8fab('0xa9')]);_0x2774a0[_0x8fab('0x16')]=this[_0x8fab('0x16')][_0x4f1456[_0x8fab('0x53')]];}}}}catch(_0x3e51f2){logger['error'](_0x8fab('0xa6'),_0x4f1456['uniqueid'],util[_0x8fab('0x48')](_0x3e51f2,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x8fab('0xa7')]=function(_0x267ec5,_0x592ba3,_0x464b02){var _0x39f3c8=[_0x8fab('0xb1'),'rtpaudioqosbridged',_0x8fab('0xb2'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0x8fab('0xb3'),_0x8fab('0xb4'),'rtpaudioqosrttbridged','sipcallid',_0x8fab('0xb5'),_0x8fab('0xb6'),_0x8fab('0xb7'),'membercalls','memberdynamic',_0x8fab('0xb8'),_0x8fab('0xb9'),'membername',_0x8fab('0xba'),_0x8fab('0xbb')];if(!_[_0x8fab('0x40')](_0x592ba3)&&!_['includes'](_0x39f3c8,_0x592ba3)){if(_[_0x8fab('0x62')](this[_0x8fab('0x16')][_0x267ec5])){this[_0x8fab('0x16')][_0x267ec5]={};}this[_0x8fab('0x16')][_0x267ec5][_0x592ba3]=_0x464b02;}};VoiceQueueReport[_0x8fab('0xb')][_0x8fab('0xbc')]=function(_0x2c4700,_0x23a079,_0x4ff5c4){try{var _0x3aa43f={};if(this[_0x8fab('0xf')][_0x2c4700]){for(var _0xad957d=0x0;_0xad957d{delete this[_0x8fab('0x12')][_0x146f97];},_0x3b8612);}};module[_0x8fab('0xf2')]=VoiceQueueReport; \ No newline at end of file diff --git a/server/services/ami/rpc/agentReportPreview.js b/server/services/ami/rpc/agentReportPreview.js index 185a16d..5b9174c 100644 --- a/server/services/ami/rpc/agentReportPreview.js +++ b/server/services/ami/rpc/agentReportPreview.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x163e=['campaign','queue','CreateReportAgentPreview','../client','createHistory'];(function(_0x56a217,_0xc188a4){var _0x3bbd0a=function(_0x47cbdf){while(--_0x47cbdf){_0x56a217['push'](_0x56a217['shift']());}};_0x3bbd0a(++_0xc188a4);}(_0x163e,0x11b));var _0xe163=function(_0x179314,_0x32d3a2){_0x179314=_0x179314-0x0;var _0x3556f7=_0x163e[_0x179314];return _0x3556f7;};'use strict';var client=require(_0xe163('0x0'));exports[_0xe163('0x1')]=function(_0x58b5b9){return function(){_0x58b5b9[_0xe163('0x2')]=_0x58b5b9[_0xe163('0x3')];return client['Request']('CreateReportAgentPreview',{'body':_0x58b5b9,'log':_0xe163('0x4')});};}; \ No newline at end of file +var _0xd4e7=['campaign','queue','CreateReportAgentPreview','../client','createHistory'];(function(_0x44f9ba,_0x225358){var _0x29812b=function(_0x5dca99){while(--_0x5dca99){_0x44f9ba['push'](_0x44f9ba['shift']());}};_0x29812b(++_0x225358);}(_0xd4e7,0xfd));var _0x7d4e=function(_0x5df13d,_0x3eeeab){_0x5df13d=_0x5df13d-0x0;var _0x3d4b27=_0xd4e7[_0x5df13d];return _0x3d4b27;};'use strict';var client=require(_0x7d4e('0x0'));exports[_0x7d4e('0x1')]=function(_0x502a7c){return function(){_0x502a7c[_0x7d4e('0x2')]=_0x502a7c[_0x7d4e('0x3')];return client['Request']('CreateReportAgentPreview',{'body':_0x502a7c,'log':_0x7d4e('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/attachment.js b/server/services/ami/rpc/attachment.js index 45aa9f5..668fd6f 100644 --- a/server/services/ami/rpc/attachment.js +++ b/server/services/ami/rpc/attachment.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd555=['CreateAttachment','create'];(function(_0x498035,_0x4ab1d0){var _0x260326=function(_0x1da7fd){while(--_0x1da7fd){_0x498035['push'](_0x498035['shift']());}};_0x260326(++_0x4ab1d0);}(_0xd555,0xef));var _0x5d55=function(_0x2cb1df,_0x4b439c){_0x2cb1df=_0x2cb1df-0x0;var _0x30e674=_0xd555[_0x2cb1df];return _0x30e674;};'use strict';var client=require('../client');exports[_0x5d55('0x0')]=function(_0x3a9d21){return client['Request']('CreateAttachment',{'body':_0x3a9d21,'log':_0x5d55('0x1')});}; \ No newline at end of file +var _0xd9dd=['Request','CreateAttachment'];(function(_0x184427,_0x496977){var _0x3aa4ea=function(_0x307574){while(--_0x307574){_0x184427['push'](_0x184427['shift']());}};_0x3aa4ea(++_0x496977);}(_0xd9dd,0x134));var _0xdd9d=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd9dd[_0xa464c9];return _0x3d73c4;};'use strict';var client=require('../client');exports['create']=function(_0x2c6921){return client[_0xdd9d('0x0')](_0xdd9d('0x1'),{'body':_0x2c6921,'log':'CreateAttachment'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/campaign.js b/server/services/ami/rpc/campaign.js index fbb8ce4..e0afe45 100644 --- a/server/services/ami/rpc/campaign.js +++ b/server/services/ami/rpc/campaign.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['Interval','interval','SquareProject','getCampaign','getCampaigns','Request','GetCampaign','name','type','active','limitCalls','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialGlobalInterval','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','TrunkBackup','callerid'];(function(_0xa71985,_0x1aeaba){var _0x419751=function(_0x324911){while(--_0x324911){_0xa71985['push'](_0xa71985['shift']());}};_0x419751(++_0x1aeaba);}(_0x1261,0x144));var _0x1126=function(_0x4d3187,_0x267c51){_0x4d3187=_0x4d3187-0x0;var _0x107906=_0x1261[_0x4d3187];return _0x107906;};'use strict';var client=require('../client');exports[_0x1126('0x0')]=function(){return function(){return client[_0x1126('0x1')](_0x1126('0x2'),{'options':{'raw':![],'attributes':['id',_0x1126('0x3'),_0x1126('0x4'),_0x1126('0x5'),_0x1126('0x6'),_0x1126('0x7'),_0x1126('0x8'),_0x1126('0x9'),'dialCongestionMaxRetry','dialCongestionRetryFrequency',_0x1126('0xa'),_0x1126('0xb'),'dialNoAnswerMaxRetry',_0x1126('0xc'),_0x1126('0xd'),_0x1126('0xe'),_0x1126('0xf'),_0x1126('0x10'),'dialDropRetryFrequency',_0x1126('0x11'),_0x1126('0x12'),_0x1126('0x13'),'dialMachineRetryFrequency',_0x1126('0x14'),'dialAgentRejectRetryFrequency','dialTimezone',_0x1126('0x15'),'dialAMDActive',_0x1126('0x16'),_0x1126('0x17'),_0x1126('0x18'),_0x1126('0x19'),_0x1126('0x1a'),_0x1126('0x1b'),_0x1126('0x1c'),_0x1126('0x1d'),_0x1126('0x1e'),'dialOrderByScheduledAt','dialPrefix',_0x1126('0x1f'),_0x1126('0x20')],'include':[{'model':_0x1126('0x21'),'as':'Trunk','attributes':['id',_0x1126('0x3'),'callerid',_0x1126('0x5')]},{'model':_0x1126('0x21'),'as':_0x1126('0x22'),'attributes':['id','name',_0x1126('0x23'),_0x1126('0x5')]},{'model':'Interval','as':'Interval','attributes':['id',_0x1126('0x3')],'include':[{'model':_0x1126('0x24'),'as':'Intervals','attributes':['id','name',_0x1126('0x25')]}]},{'model':'SquareProject','as':_0x1126('0x26'),'attributes':['id',_0x1126('0x3')]}]},'log':_0x1126('0x27')});};}; \ No newline at end of file +var _0x326f=['dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','dialGlobalInterval','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialPrefix','Trunk','callerid','TrunkBackup','Interval','Intervals','SquareProject','../client','GetCampaign','name','type','active','limitCalls','dialOriginateCallerIdName'];(function(_0x316667,_0x63223c){var _0xfa412c=function(_0x4e74fd){while(--_0x4e74fd){_0x316667['push'](_0x316667['shift']());}};_0xfa412c(++_0x63223c);}(_0x326f,0xd1));var _0xf326=function(_0x296042,_0xa2325e){_0x296042=_0x296042-0x0;var _0x371461=_0x326f[_0x296042];return _0x371461;};'use strict';var client=require(_0xf326('0x0'));exports['getCampaigns']=function(){return function(){return client['Request'](_0xf326('0x1'),{'options':{'raw':![],'attributes':['id',_0xf326('0x2'),_0xf326('0x3'),_0xf326('0x4'),_0xf326('0x5'),_0xf326('0x6'),_0xf326('0x7'),_0xf326('0x8'),_0xf326('0x9'),_0xf326('0xa'),'dialBusyMaxRetry',_0xf326('0xb'),_0xf326('0xc'),_0xf326('0xd'),_0xf326('0xe'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry',_0xf326('0xf'),_0xf326('0x10'),_0xf326('0x11'),_0xf326('0x12'),_0xf326('0x13'),'dialAgentRejectMaxRetry',_0xf326('0x14'),'dialTimezone',_0xf326('0x15'),'dialAMDActive',_0xf326('0x16'),'dialAMDGreeting',_0xf326('0x17'),_0xf326('0x18'),'dialAMDMinWordLength',_0xf326('0x19'),_0xf326('0x1a'),_0xf326('0x1b'),_0xf326('0x1c'),'dialOrderByScheduledAt',_0xf326('0x1d'),'dialRandomLastDigitCallerIdNumber','dialCutDigit'],'include':[{'model':_0xf326('0x1e'),'as':_0xf326('0x1e'),'attributes':['id',_0xf326('0x2'),_0xf326('0x1f'),_0xf326('0x4')]},{'model':_0xf326('0x1e'),'as':_0xf326('0x20'),'attributes':['id',_0xf326('0x2'),'callerid',_0xf326('0x4')]},{'model':_0xf326('0x21'),'as':_0xf326('0x21'),'attributes':['id',_0xf326('0x2')],'include':[{'model':_0xf326('0x21'),'as':_0xf326('0x22'),'attributes':['id','name','interval']}]},{'model':'SquareProject','as':_0xf326('0x23'),'attributes':['id',_0xf326('0x2')]}]},'log':'getCampaign'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/cmContact.js b/server/services/ami/rpc/cmContact.js index b46f56b..623c798 100644 --- a/server/services/ami/rpc/cmContact.js +++ b/server/services/ami/rpc/cmContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa94b=['CreateCmContact','getContacts','Request'];(function(_0x33990e,_0x27b1f4){var _0x366423=function(_0x488cf4){while(--_0x488cf4){_0x33990e['push'](_0x33990e['shift']());}};_0x366423(++_0x27b1f4);}(_0xa94b,0x101));var _0xba94=function(_0x47fe9a,_0x7d65d5){_0x47fe9a=_0x47fe9a-0x0;var _0x247cf3=_0xa94b[_0x47fe9a];return _0x247cf3;};'use strict';var client=require('../client');exports['createContact']=function(_0x2c956f){return function(){return client[_0xba94('0x0')](_0xba94('0x1'),{'body':_0x2c956f,'log':_0xba94('0x1')});};};exports[_0xba94('0x2')]=function(_0x1d59fe){return function(){return client[_0xba94('0x0')]('GetCmContact',{'options':_0x1d59fe,'log':'GetCmContact'});};}; \ No newline at end of file +var _0x45e8=['getContacts','GetCmContact','../client','createContact','Request','CreateCmContact'];(function(_0x2d1377,_0x3f9909){var _0x341028=function(_0x5a39e7){while(--_0x5a39e7){_0x2d1377['push'](_0x2d1377['shift']());}};_0x341028(++_0x3f9909);}(_0x45e8,0x176));var _0x845e=function(_0x5ab232,_0x570056){_0x5ab232=_0x5ab232-0x0;var _0x457b86=_0x45e8[_0x5ab232];return _0x457b86;};'use strict';var client=require(_0x845e('0x0'));exports[_0x845e('0x1')]=function(_0x4a03ec){return function(){return client[_0x845e('0x2')](_0x845e('0x3'),{'body':_0x4a03ec,'log':_0x845e('0x3')});};};exports[_0x845e('0x4')]=function(_0x151d77){return function(){return client[_0x845e('0x2')]('GetCmContact',{'options':_0x151d77,'log':_0x845e('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/cmHopper.js b/server/services/ami/rpc/cmHopper.js index a91c961..2a7bf36 100644 --- a/server/services/ami/rpc/cmHopper.js +++ b/server/services/ami/rpc/cmHopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf494=['DESC','getContactDialerIvr','scheduledat','ASC','moveContactManagedDialer','campaign','queue','MoveContactManagedDialer','countReScheduled','CountReScheduled','User','name','VoiceQueue','Queue','unlockContact','getContactRecallMe','format','Agent','voicePause','db.CmHopper.UserId','resetActiveCalls','ResetActiveCalls','handlePreviewRecallNotifications','CmHopperHandlePreviewRecallNotifications','../client','moment','getContacts','Request','GetCmHopper','CmContact','Contact','getCmHopper','updateContacts','YYYY-MM-DD\x20HH:mm:ss','UpdateCmHopper','rescheduleContact','ContactId','ListId','CampaignId','DestroyCmHopper','getContactDialer','GetContactDialer','priority'];(function(_0x2a07b5,_0xe4ca2d){var _0x57fe14=function(_0x4af366){while(--_0x4af366){_0x2a07b5['push'](_0x2a07b5['shift']());}};_0x57fe14(++_0xe4ca2d);}(_0xf494,0x1c6));var _0x4f49=function(_0x91d178,_0x4824a0){_0x91d178=_0x91d178-0x0;var _0x55f637=_0xf494[_0x91d178];return _0x55f637;};'use strict';var client=require(_0x4f49('0x0'));var moment=require(_0x4f49('0x1'));exports[_0x4f49('0x2')]=function(_0x52d22c,_0x3aeeb8){return function(){return client[_0x4f49('0x3')](_0x4f49('0x4'),{'options':{'where':{'VoiceQueueId':_0x52d22c},'include':[{'model':_0x4f49('0x5'),'as':_0x4f49('0x6')}],'limit':_0x3aeeb8,'raw':![]},'log':_0x4f49('0x7')});};};exports[_0x4f49('0x8')]=function(_0x790e8b,_0xc5e778,_0x413530){return function(){return client[_0x4f49('0x3')]('UpdateCmHopper',{'body':_0x790e8b,'options':{'where':{'VoiceQueueId':_0xc5e778,'scheduledat':{'$lte':moment()['format'](_0x4f49('0x9'))}},'limit':_0x413530},'log':_0x4f49('0xa')});};};exports[_0x4f49('0xb')]=function(_0x30ca57){return client[_0x4f49('0x3')](_0x4f49('0xa'),{'body':_0x30ca57,'options':{'where':{'ContactId':_0x30ca57[_0x4f49('0xc')],'ListId':_0x30ca57[_0x4f49('0xd')],'VoiceQueueId':_0x30ca57['VoiceQueueId'],'CampaignId':_0x30ca57[_0x4f49('0xe')]}},'log':_0x4f49('0xb')});};exports['destroyContact']=function(_0x15e7a1,_0x5bbc75,_0x496293){return function(){return client[_0x4f49('0x3')](_0x4f49('0xf'),{'options':{'where':{'VoiceQueueId':_0x15e7a1,'ListId':_0x5bbc75,'ContactId':_0x496293}},'log':'DestroyCmHopper'});};};exports[_0x4f49('0x10')]=function(_0x111a8b,_0x1b9145,_0x2efe49,_0x1a0f1e){return client[_0x4f49('0x3')](_0x4f49('0x11'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x111a8b,'active':![],'scheduledat':{'$lte':moment()['format'](_0x4f49('0x9'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x1b9145}}]},'order':[[_0x4f49('0x12'),_0x4f49('0x13')],['scheduledat',_0x1a0f1e],['id','ASC']],'raw':!![],'limit':_0x2efe49},'log':_0x4f49('0x11')});};exports[_0x4f49('0x14')]=function(_0x74886e,_0x5cb79c,_0x1dccfd){return client[_0x4f49('0x3')](_0x4f49('0x11'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x74886e,'active':![],'scheduledat':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}},'include':[{'model':'CmContact','as':'Contact'}],'order':[[_0x4f49('0x12'),_0x4f49('0x13')],[_0x4f49('0x15'),_0x1dccfd],['id',_0x4f49('0x16')]],'raw':!![],'limit':_0x5cb79c},'log':'GetContactDialerIvr'});};exports[_0x4f49('0x17')]=function(_0x2aed27,_0x197a49){_0x2aed27[_0x4f49('0x18')]=_0x2aed27[_0x4f49('0x19')];return client['Request'](_0x4f49('0x1a'),{'body':_0x2aed27,'options':{'where':{'ContactId':_0x2aed27[_0x4f49('0xc')],'ListId':_0x2aed27[_0x4f49('0xd')],'VoiceQueueId':_0x2aed27['VoiceQueueId'],'CampaignId':_0x2aed27[_0x4f49('0xe')],'active':_0x197a49?undefined:!![]}},'log':_0x4f49('0x1a')});};exports[_0x4f49('0x1b')]=function(_0x43c458){return client[_0x4f49('0x3')](_0x4f49('0x1c'),{'options':{'where':{'VoiceQueueId':_0x43c458['id']?_0x43c458['id']||null:null}},'log':'countReScheduled'});};exports['getContactPreview']=function(_0x3a947b){return function(){return client[_0x4f49('0x3')]('GetCmHopperPreview',{'options':{'where':{'id':_0x3a947b},'include':[{'model':_0x4f49('0x5'),'as':_0x4f49('0x6')},{'model':_0x4f49('0x1d'),'as':'Agent','attributes':['id',_0x4f49('0x1e')]},{'model':_0x4f49('0x1f'),'as':_0x4f49('0x20'),'attributes':['id',_0x4f49('0x1e')]}],'raw':!![]},'log':_0x4f49('0x7')});};};exports[_0x4f49('0x21')]=function(_0x4915af,_0x50c571,_0x239f44){return client[_0x4f49('0x3')](_0x4f49('0xa'),{'body':_0x4915af,'options':{'where':{'id':_0x50c571},'limit':_0x239f44},'log':'UpdateCmHopper'});};exports[_0x4f49('0x22')]=function(_0x206203,_0x43d8e3){return function(){return client['Request']('GetContactRecallMe',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x206203,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x4f49('0x23')](_0x4f49('0x9'))},'UserId':{'$in':_0x43d8e3}},'order':[[_0x4f49('0x12'),'DESC'],[_0x4f49('0x15'),_0x4f49('0x13')],['id',_0x4f49('0x16')]],'include':[{'model':_0x4f49('0x5'),'as':_0x4f49('0x6')},{'model':_0x4f49('0x1d'),'as':_0x4f49('0x24'),'attributes':['id',_0x4f49('0x1e'),_0x4f49('0x25')]}],'group':_0x4f49('0x26'),'raw':!![]},'log':_0x4f49('0x11')});};};exports[_0x4f49('0x27')]=function(_0x29ff83,_0x6625cd){return client[_0x4f49('0x3')](_0x4f49('0x28'),{'body':_0x29ff83,'options':_0x6625cd||{},'log':_0x4f49('0x28')});};exports[_0x4f49('0x29')]=function(_0x3e7a08,_0x492b16,_0x45d0d2){return function(){return client[_0x4f49('0x3')](_0x4f49('0x2a'),{'body':{'where':{'voiceQueueIds':_0x3e7a08,'interval':_0x492b16,'availableAgentsIds':_0x45d0d2}},'log':_0x4f49('0x29')});};}; \ No newline at end of file +var _0x2975=['handlePreviewRecallNotifications','CmHopperHandlePreviewRecallNotifications','moment','getContacts','Request','GetCmHopper','updateContacts','UpdateCmHopper','format','rescheduleContact','ListId','VoiceQueueId','CampaignId','destroyContact','DestroyCmHopper','GetContactDialer','priority','DESC','scheduledat','ASC','getContactDialerIvr','YYYY-MM-DD\x20HH:mm:ss','Contact','GetContactDialerIvr','moveContactManagedDialer','queue','ContactId','MoveContactManagedDialer','CountReScheduled','GetCmHopperPreview','name','VoiceQueue','Queue','unlockContact','getContactRecallMe','GetContactRecallMe','CmContact','User','voicePause','db.CmHopper.UserId','ResetActiveCalls'];(function(_0x4bde94,_0x2a3ad8){var _0x179aff=function(_0x2b783c){while(--_0x2b783c){_0x4bde94['push'](_0x4bde94['shift']());}};_0x179aff(++_0x2a3ad8);}(_0x2975,0x1c5));var _0x5297=function(_0xbee3eb,_0x3cb1e0){_0xbee3eb=_0xbee3eb-0x0;var _0x463529=_0x2975[_0xbee3eb];return _0x463529;};'use strict';var client=require('../client');var moment=require(_0x5297('0x0'));exports[_0x5297('0x1')]=function(_0x44137e,_0x1a511b){return function(){return client[_0x5297('0x2')](_0x5297('0x3'),{'options':{'where':{'VoiceQueueId':_0x44137e},'include':[{'model':'CmContact','as':'Contact'}],'limit':_0x1a511b,'raw':![]},'log':'getCmHopper'});};};exports[_0x5297('0x4')]=function(_0x15d62b,_0x11a43d,_0x3da9c6){return function(){return client[_0x5297('0x2')](_0x5297('0x5'),{'body':_0x15d62b,'options':{'where':{'VoiceQueueId':_0x11a43d,'scheduledat':{'$lte':moment()[_0x5297('0x6')]('YYYY-MM-DD\x20HH:mm:ss')}},'limit':_0x3da9c6},'log':_0x5297('0x5')});};};exports[_0x5297('0x7')]=function(_0x3f7368){return client[_0x5297('0x2')](_0x5297('0x5'),{'body':_0x3f7368,'options':{'where':{'ContactId':_0x3f7368['ContactId'],'ListId':_0x3f7368[_0x5297('0x8')],'VoiceQueueId':_0x3f7368[_0x5297('0x9')],'CampaignId':_0x3f7368[_0x5297('0xa')]}},'log':'rescheduleContact'});};exports[_0x5297('0xb')]=function(_0x30d068,_0x34c97a,_0x4a8879){return function(){return client[_0x5297('0x2')](_0x5297('0xc'),{'options':{'where':{'VoiceQueueId':_0x30d068,'ListId':_0x34c97a,'ContactId':_0x4a8879}},'log':'DestroyCmHopper'});};};exports['getContactDialer']=function(_0x185bf1,_0x43c441,_0x5cd992,_0x7e3417){return client['Request'](_0x5297('0xd'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x185bf1,'active':![],'scheduledat':{'$lte':moment()[_0x5297('0x6')]('YYYY-MM-DD\x20HH:mm:ss')},'$or':[{'UserId':null},{'UserId':{'$in':_0x43c441}}]},'order':[[_0x5297('0xe'),_0x5297('0xf')],[_0x5297('0x10'),_0x7e3417],['id',_0x5297('0x11')]],'raw':!![],'limit':_0x5cd992},'log':_0x5297('0xd')});};exports[_0x5297('0x12')]=function(_0x1fb138,_0x262a9f,_0x4ae2fe){return client[_0x5297('0x2')](_0x5297('0xd'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x1fb138,'active':![],'scheduledat':{'$lte':moment()[_0x5297('0x6')](_0x5297('0x13'))}},'include':[{'model':'CmContact','as':_0x5297('0x14')}],'order':[[_0x5297('0xe'),'DESC'],[_0x5297('0x10'),_0x4ae2fe],['id','ASC']],'raw':!![],'limit':_0x262a9f},'log':_0x5297('0x15')});};exports[_0x5297('0x16')]=function(_0x39b675,_0xc33c){_0x39b675['campaign']=_0x39b675[_0x5297('0x17')];return client[_0x5297('0x2')]('MoveContactManagedDialer',{'body':_0x39b675,'options':{'where':{'ContactId':_0x39b675[_0x5297('0x18')],'ListId':_0x39b675[_0x5297('0x8')],'VoiceQueueId':_0x39b675['VoiceQueueId'],'CampaignId':_0x39b675[_0x5297('0xa')],'active':_0xc33c?undefined:!![]}},'log':_0x5297('0x19')});};exports['countReScheduled']=function(_0x28df2d){return client[_0x5297('0x2')](_0x5297('0x1a'),{'options':{'where':{'VoiceQueueId':_0x28df2d['id']?_0x28df2d['id']||null:null}},'log':'countReScheduled'});};exports['getContactPreview']=function(_0x35fdc9){return function(){return client[_0x5297('0x2')](_0x5297('0x1b'),{'options':{'where':{'id':_0x35fdc9},'include':[{'model':'CmContact','as':_0x5297('0x14')},{'model':'User','as':'Agent','attributes':['id',_0x5297('0x1c')]},{'model':_0x5297('0x1d'),'as':_0x5297('0x1e'),'attributes':['id',_0x5297('0x1c')]}],'raw':!![]},'log':'getCmHopper'});};};exports[_0x5297('0x1f')]=function(_0x31ac79,_0x2775f4,_0xee5f9c){return client[_0x5297('0x2')](_0x5297('0x5'),{'body':_0x31ac79,'options':{'where':{'id':_0x2775f4},'limit':_0xee5f9c},'log':_0x5297('0x5')});};exports[_0x5297('0x20')]=function(_0x62d992,_0x51d0fd){return function(){return client[_0x5297('0x2')](_0x5297('0x21'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x62d992,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x5297('0x6')]('YYYY-MM-DD\x20HH:mm:ss')},'UserId':{'$in':_0x51d0fd}},'order':[[_0x5297('0xe'),_0x5297('0xf')],['scheduledat',_0x5297('0xf')],['id',_0x5297('0x11')]],'include':[{'model':_0x5297('0x22'),'as':_0x5297('0x14')},{'model':_0x5297('0x23'),'as':'Agent','attributes':['id',_0x5297('0x1c'),_0x5297('0x24')]}],'group':_0x5297('0x25'),'raw':!![]},'log':_0x5297('0xd')});};};exports['resetActiveCalls']=function(_0x48e008,_0x509114){return client[_0x5297('0x2')](_0x5297('0x26'),{'body':_0x48e008,'options':_0x509114||{},'log':'ResetActiveCalls'});};exports[_0x5297('0x27')]=function(_0x20d588,_0x4470cc,_0x339e20){return function(){return client['Request'](_0x5297('0x28'),{'body':{'where':{'voiceQueueIds':_0x20d588,'interval':_0x4470cc,'availableAgentsIds':_0x339e20}},'log':_0x5297('0x27')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/cmHopperAdditionalPhone.js b/server/services/ami/rpc/cmHopperAdditionalPhone.js index 1c906d2..4b8ff7e 100644 --- a/server/services/ami/rpc/cmHopperAdditionalPhone.js +++ b/server/services/ami/rpc/cmHopperAdditionalPhone.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf162=['SwapAdditionalPhones','incrementPreviewCounters','IncrementPreviewCounters','../client','verifyAdditionalPhones','Request','VerifyAdditionalPhones'];(function(_0x11e762,_0x3f7103){var _0x24c967=function(_0x4a3cf0){while(--_0x4a3cf0){_0x11e762['push'](_0x11e762['shift']());}};_0x24c967(++_0x3f7103);}(_0xf162,0x1b5));var _0x2f16=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xf162[_0x59ee6f];return _0x4c0979;};'use strict';var client=require(_0x2f16('0x0'));exports[_0x2f16('0x1')]=function(_0x1b6292,_0x178826,_0x59cda7){return client[_0x2f16('0x2')](_0x2f16('0x3'),{'body':_0x1b6292,'reason':_0x178826,'entity':_0x59cda7,'log':_0x2f16('0x3')});};exports['swapAdditionalPhones']=function(_0x4b9287,_0x5cab88,_0x3aa96e){return client['Request'](_0x2f16('0x4'),{'body':_0x4b9287,'duration':_0x5cab88,'waitTime':_0x3aa96e,'log':_0x2f16('0x4')});};exports[_0x2f16('0x5')]=function(_0x5c2743){return function(){return client[_0x2f16('0x2')](_0x2f16('0x6'),{'body':_0x5c2743,'log':_0x2f16('0x6')});};}; \ No newline at end of file +var _0x1c81=['Request','VerifyAdditionalPhones','swapAdditionalPhones','SwapAdditionalPhones','incrementPreviewCounters','IncrementPreviewCounters','../client','verifyAdditionalPhones'];(function(_0x41ce34,_0x22932a){var _0x580c63=function(_0x46a806){while(--_0x46a806){_0x41ce34['push'](_0x41ce34['shift']());}};_0x580c63(++_0x22932a);}(_0x1c81,0x196));var _0x11c8=function(_0x41a648,_0x19c878){_0x41a648=_0x41a648-0x0;var _0x108c52=_0x1c81[_0x41a648];return _0x108c52;};'use strict';var client=require(_0x11c8('0x0'));exports[_0x11c8('0x1')]=function(_0xdcce5a,_0x5367e1,_0xc7468b){return client[_0x11c8('0x2')](_0x11c8('0x3'),{'body':_0xdcce5a,'reason':_0x5367e1,'entity':_0xc7468b,'log':'VerifyAdditionalPhones'});};exports[_0x11c8('0x4')]=function(_0x57e089,_0x55c3f6,_0x6a87f0){return client[_0x11c8('0x2')](_0x11c8('0x5'),{'body':_0x57e089,'duration':_0x55c3f6,'waitTime':_0x6a87f0,'log':_0x11c8('0x5')});};exports[_0x11c8('0x6')]=function(_0x4ea3bb){return function(){return client[_0x11c8('0x2')](_0x11c8('0x7'),{'body':_0x4ea3bb,'log':_0x11c8('0x7')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/cmHopperBlack.js b/server/services/ami/rpc/cmHopperBlack.js index b4d12ee..eb0b4d4 100644 --- a/server/services/ami/rpc/cmHopperBlack.js +++ b/server/services/ami/rpc/cmHopperBlack.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x123a=['Request','GetCmHopperBlack','VoiceQueueId','phone','checkIsBlackListIvr','GetCmHopperBlackIvr'];(function(_0x355974,_0x335fc2){var _0xd65261=function(_0x12e148){while(--_0x12e148){_0x355974['push'](_0x355974['shift']());}};_0xd65261(++_0x335fc2);}(_0x123a,0x1d4));var _0xa123=function(_0x1b1621,_0x400c65){_0x1b1621=_0x1b1621-0x0;var _0xab8b9=_0x123a[_0x1b1621];return _0xab8b9;};'use strict';var client=require('../client');exports['checkIsBlackList']=function(_0xb2a14c){return client[_0xa123('0x0')](_0xa123('0x1'),{'options':{'where':{'VoiceQueueId':_0xb2a14c[_0xa123('0x2')],'phone':_0xb2a14c[_0xa123('0x3')]},'raw':![]},'log':_0xa123('0x1')});};exports[_0xa123('0x4')]=function(_0x703d4a){return client[_0xa123('0x0')]('GetCmHopperBlack',{'options':{'where':{'CampaignId':_0x703d4a['CampaignId'],'phone':_0x703d4a['phone']},'raw':![]},'log':_0xa123('0x5')});}; \ No newline at end of file +var _0x9adc=['checkIsBlackList','GetCmHopperBlack','VoiceQueueId','phone','checkIsBlackListIvr','Request','CampaignId','GetCmHopperBlackIvr','../client'];(function(_0x576786,_0x54d8bc){var _0xd52613=function(_0x30b3d7){while(--_0x30b3d7){_0x576786['push'](_0x576786['shift']());}};_0xd52613(++_0x54d8bc);}(_0x9adc,0x19d));var _0xc9ad=function(_0x1df9fc,_0x34d224){_0x1df9fc=_0x1df9fc-0x0;var _0x5cf40c=_0x9adc[_0x1df9fc];return _0x5cf40c;};'use strict';var client=require(_0xc9ad('0x0'));exports[_0xc9ad('0x1')]=function(_0x25e3d6){return client['Request'](_0xc9ad('0x2'),{'options':{'where':{'VoiceQueueId':_0x25e3d6[_0xc9ad('0x3')],'phone':_0x25e3d6[_0xc9ad('0x4')]},'raw':![]},'log':_0xc9ad('0x2')});};exports[_0xc9ad('0x5')]=function(_0x37f134){return client[_0xc9ad('0x6')](_0xc9ad('0x2'),{'options':{'where':{'CampaignId':_0x37f134[_0xc9ad('0x7')],'phone':_0x37f134[_0xc9ad('0x4')]},'raw':![]},'log':_0xc9ad('0x8')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/cmHopperFinal.js b/server/services/ami/rpc/cmHopperFinal.js index 0808cf8..ac4f97c 100644 --- a/server/services/ami/rpc/cmHopperFinal.js +++ b/server/services/ami/rpc/cmHopperFinal.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bd5=['../client','createContact','campaign','queue','Request','CreateCmHopperFinal'];(function(_0x21c622,_0x124272){var _0x4fed92=function(_0x2dfe00){while(--_0x2dfe00){_0x21c622['push'](_0x21c622['shift']());}};_0x4fed92(++_0x124272);}(_0x9bd5,0x15c));var _0x59bd=function(_0x4b4e87,_0x4bf51a){_0x4b4e87=_0x4b4e87-0x0;var _0x145237=_0x9bd5[_0x4b4e87];return _0x145237;};'use strict';var client=require(_0x59bd('0x0'));exports[_0x59bd('0x1')]=function(_0x5928cb){return function(){_0x5928cb[_0x59bd('0x2')]=_0x5928cb[_0x59bd('0x3')];return client[_0x59bd('0x4')](_0x59bd('0x5'),{'body':_0x5928cb,'log':_0x59bd('0x5')});};}; \ No newline at end of file +var _0x19de=['createContact','campaign','queue','Request'];(function(_0x2d453d,_0x5a0266){var _0x29649b=function(_0x19bbe6){while(--_0x19bbe6){_0x2d453d['push'](_0x2d453d['shift']());}};_0x29649b(++_0x5a0266);}(_0x19de,0xc4));var _0xe19d=function(_0x4bd70c,_0x1e2eed){_0x4bd70c=_0x4bd70c-0x0;var _0x1b1c00=_0x19de[_0x4bd70c];return _0x1b1c00;};'use strict';var client=require('../client');exports[_0xe19d('0x0')]=function(_0x2cc5a3){return function(){_0x2cc5a3[_0xe19d('0x1')]=_0x2cc5a3[_0xe19d('0x2')];return client[_0xe19d('0x3')]('CreateCmHopperFinal',{'body':_0x2cc5a3,'log':'CreateCmHopperFinal'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/cmHopperHistory.js b/server/services/ami/rpc/cmHopperHistory.js index cbb66d2..1e3caf8 100644 --- a/server/services/ami/rpc/cmHopperHistory.js +++ b/server/services/ami/rpc/cmHopperHistory.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd3e7=['moment','createHistory','campaign','queue','Request','CreateCmHopperHistory','avgHandleTime','subtract','minutes','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','startOf','endOf','day','GetCampaignHopperHistory','../client'];(function(_0x4cf136,_0x121f83){var _0x5e711d=function(_0x4e5db7){while(--_0x4e5db7){_0x4cf136['push'](_0x4cf136['shift']());}};_0x5e711d(++_0x121f83);}(_0xd3e7,0xbd));var _0x7d3e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd3e7[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0x7d3e('0x0'));var moment=require(_0x7d3e('0x1'));exports[_0x7d3e('0x2')]=function(_0x4ab240){_0x4ab240[_0x7d3e('0x3')]=_0x4ab240[_0x7d3e('0x4')];return client[_0x7d3e('0x5')](_0x7d3e('0x6'),{'body':_0x4ab240,'log':_0x7d3e('0x6')});};exports[_0x7d3e('0x7')]=function(_0x6564cb){return client['Request']('AvgHandleTime',{'options':{'where':{'endtime':{'$between':[moment()[_0x7d3e('0x8')](_0x6564cb,_0x7d3e('0x9'))[_0x7d3e('0xa')](_0x7d3e('0xb')),moment()[_0x7d3e('0xa')](_0x7d3e('0xb'))]}},'raw':![]},'log':_0x7d3e('0xc')});};exports[_0x7d3e('0xd')]=function(){return function(){return client['Request'](_0x7d3e('0xe'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x7d3e('0xf')]('day')[_0x7d3e('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x7d3e('0x10')](_0x7d3e('0x11'))['format'](_0x7d3e('0xb'))]},'campaigntype':_0x7d3e('0x4')},'raw':![]},'log':'GetVoiceQueueHopperHistory'});};};exports['getCampaignHopperHistory']=function(){return function(){return client[_0x7d3e('0x5')](_0x7d3e('0x12'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x7d3e('0xf')](_0x7d3e('0x11'))[_0x7d3e('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf'](_0x7d3e('0x11'))['format']('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':'ivr'},'raw':![]},'log':_0x7d3e('0x12')});};}; \ No newline at end of file +var _0xc97b=['getCampaignHopperHistory','GetCampaignHopperHistory','moment','campaign','queue','Request','CreateCmHopperHistory','avgHandleTime','AvgHandleTime','minutes','format','YYYY-MM-DD\x20HH:mm:ss','GetCmHopperHistory','GetVoiceQueueHopperHistory','startOf','day','endOf'];(function(_0x21c48,_0x49ac0a){var _0x1f2cea=function(_0x51a5eb){while(--_0x51a5eb){_0x21c48['push'](_0x21c48['shift']());}};_0x1f2cea(++_0x49ac0a);}(_0xc97b,0xac));var _0xbc97=function(_0xd308f,_0x3d0a33){_0xd308f=_0xd308f-0x0;var _0x24595c=_0xc97b[_0xd308f];return _0x24595c;};'use strict';var client=require('../client');var moment=require(_0xbc97('0x0'));exports['createHistory']=function(_0x3fd6d0){_0x3fd6d0[_0xbc97('0x1')]=_0x3fd6d0[_0xbc97('0x2')];return client[_0xbc97('0x3')](_0xbc97('0x4'),{'body':_0x3fd6d0,'log':_0xbc97('0x4')});};exports[_0xbc97('0x5')]=function(_0x1822c8){return client[_0xbc97('0x3')](_0xbc97('0x6'),{'options':{'where':{'endtime':{'$between':[moment()['subtract'](_0x1822c8,_0xbc97('0x7'))[_0xbc97('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xbc97('0x8')](_0xbc97('0x9'))]}},'raw':![]},'log':_0xbc97('0xa')});};exports['getVoiceQueueHopperHistory']=function(){return function(){return client[_0xbc97('0x3')](_0xbc97('0xb'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xbc97('0xc')](_0xbc97('0xd'))[_0xbc97('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xbc97('0xe')](_0xbc97('0xd'))[_0xbc97('0x8')](_0xbc97('0x9'))]},'campaigntype':_0xbc97('0x2')},'raw':![]},'log':_0xbc97('0xb')});};};exports[_0xbc97('0xf')]=function(){return function(){return client[_0xbc97('0x3')](_0xbc97('0x10'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0xbc97('0xd'))[_0xbc97('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xbc97('0xe')](_0xbc97('0xd'))[_0xbc97('0x8')](_0xbc97('0x9'))]},'campaigntype':'ivr'},'raw':![]},'log':_0xbc97('0x10')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/faxAccount.js b/server/services/ami/rpc/faxAccount.js index 63296ae..03b9bdd 100644 --- a/server/services/ami/rpc/faxAccount.js +++ b/server/services/ami/rpc/faxAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7af9=['Trunk','callerid','getFaxAccount','notify','NotifyFaxAccount','../client','Request','GetFaxAccount','description','ecm','headerinfo','localstationid','minrate','faxdetect','t38timeout','tech','TrunkId','key'];(function(_0xca74f8,_0x20f9d3){var _0x40c4f3=function(_0x1d7bad){while(--_0x1d7bad){_0xca74f8['push'](_0xca74f8['shift']());}};_0x40c4f3(++_0x20f9d3);}(_0x7af9,0x95));var _0x97af=function(_0x5461d3,_0x597ee6){_0x5461d3=_0x5461d3-0x0;var _0x18f75e=_0x7af9[_0x5461d3];return _0x18f75e;};'use strict';var client=require(_0x97af('0x0'));exports['getFaxAccounts']=function(){return function(){return client[_0x97af('0x1')](_0x97af('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x97af('0x3'),_0x97af('0x4'),_0x97af('0x5'),_0x97af('0x6'),_0x97af('0x7'),'maxrate','modem','gateway',_0x97af('0x8'),_0x97af('0x9'),_0x97af('0xa'),_0x97af('0xb'),'ListId',_0x97af('0xc')],'include':[{'model':_0x97af('0xd'),'as':_0x97af('0xd'),'attributes':['id','name',_0x97af('0xe'),'active']}]},'log':_0x97af('0xf')});};};exports[_0x97af('0x10')]=function(_0x18a9e5,_0x225451){return client[_0x97af('0x1')](_0x97af('0x11'),{'account':{'id':_0x18a9e5},'body':_0x225451,'log':_0x97af('0x11')});}; \ No newline at end of file +var _0x2bab=['../client','getFaxAccounts','Request','GetFaxAccount','description','ecm','headerinfo','minrate','maxrate','t38timeout','TrunkId','Trunk','name','callerid','getFaxAccount','notify','NotifyFaxAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2bab,0x1ba));var _0xb2ba=function(_0x1a4818,_0x477221){_0x1a4818=_0x1a4818-0x0;var _0x54ccb6=_0x2bab[_0x1a4818];return _0x54ccb6;};'use strict';var client=require(_0xb2ba('0x0'));exports[_0xb2ba('0x1')]=function(){return function(){return client[_0xb2ba('0x2')](_0xb2ba('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xb2ba('0x4'),_0xb2ba('0x5'),_0xb2ba('0x6'),'localstationid',_0xb2ba('0x7'),_0xb2ba('0x8'),'modem','gateway','faxdetect',_0xb2ba('0x9'),'tech',_0xb2ba('0xa'),'ListId','key'],'include':[{'model':_0xb2ba('0xb'),'as':_0xb2ba('0xb'),'attributes':['id',_0xb2ba('0xc'),_0xb2ba('0xd'),'active']}]},'log':_0xb2ba('0xe')});};};exports[_0xb2ba('0xf')]=function(_0x4a9bf4,_0x4edce7){return client[_0xb2ba('0x2')](_0xb2ba('0x10'),{'account':{'id':_0x4a9bf4},'body':_0x4edce7,'log':'NotifyFaxAccount'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/faxMessage.js b/server/services/ami/rpc/faxMessage.js index d944e3f..ded90d5 100644 --- a/server/services/ami/rpc/faxMessage.js +++ b/server/services/ami/rpc/faxMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc85d=['Request','../client','update'];(function(_0xda8937,_0x5847da){var _0x60a826=function(_0x345056){while(--_0x345056){_0xda8937['push'](_0xda8937['shift']());}};_0x60a826(++_0x5847da);}(_0xc85d,0x1e1));var _0xdc85=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xc85d[_0x7e2eb0];return _0xd92de4;};'use strict';var client=require(_0xdc85('0x0'));exports[_0xdc85('0x1')]=function(_0x375780,_0x2cd288){return client[_0xdc85('0x2')]('UpdateFaxMessage',{'body':_0x2cd288,'options':{'where':{'AttachmentId':_0x375780}},'log':'UpdateFaxMessage'});}; \ No newline at end of file +var _0xc4e3=['UpdateFaxMessage','../client','Request'];(function(_0x34caea,_0x52a020){var _0x11d044=function(_0x5a2df2){while(--_0x5a2df2){_0x34caea['push'](_0x34caea['shift']());}};_0x11d044(++_0x52a020);}(_0xc4e3,0x73));var _0x3c4e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4e3[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x3c4e('0x0'));exports['update']=function(_0x43a4,_0x3d26bd){return client[_0x3c4e('0x1')]('UpdateFaxMessage',{'body':_0x3d26bd,'options':{'where':{'AttachmentId':_0x43a4}},'log':_0x3c4e('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/integrations/desk.js b/server/services/ami/rpc/integrations/desk.js index 51a9750..c16a70d 100644 --- a/server/services/ami/rpc/integrations/desk.js +++ b/server/services/ami/rpc/integrations/desk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x82ed=['name','description','password','remoteUri','authType','DeskConfiguration','Configurations','Subjects','type','content','variableName','Variable','DeskField','Descriptions','key','keyType','idField','Tags','GetDeskAccount','../../client','getDeskAccounts','Request'];(function(_0xa07924,_0x57d0d1){var _0x3b2950=function(_0x38dd72){while(--_0x38dd72){_0xa07924['push'](_0xa07924['shift']());}};_0x3b2950(++_0x57d0d1);}(_0x82ed,0x189));var _0xd82e=function(_0x486be5,_0x443cb9){_0x486be5=_0x486be5-0x0;var _0x5ebcbe=_0x82ed[_0x486be5];return _0x5ebcbe;};'use strict';var client=require(_0xd82e('0x0'));exports[_0xd82e('0x1')]=function(){return function(_0xb8d897){return client[_0xd82e('0x2')]('GetDeskAccount',{'options':{'raw':![],'attributes':['id',_0xd82e('0x3'),_0xd82e('0x4'),'username',_0xd82e('0x5'),_0xd82e('0x6'),_0xd82e('0x7'),'type','serverUrl'],'include':[{'model':_0xd82e('0x8'),'as':_0xd82e('0x9'),'attributes':['id','name'],'include':[{'model':'DeskField','as':_0xd82e('0xa'),'attributes':['id',_0xd82e('0xb'),_0xd82e('0xc'),_0xd82e('0xd')],'include':[{'model':_0xd82e('0xe'),'as':'Variable','attributes':['id',_0xd82e('0x3')]}]},{'model':_0xd82e('0xf'),'as':_0xd82e('0x10'),'attributes':['id',_0xd82e('0xb'),'content',_0xd82e('0x11'),_0xd82e('0x12'),'keyContent',_0xd82e('0xd')],'include':[{'model':_0xd82e('0xe'),'as':_0xd82e('0xe'),'attributes':['id',_0xd82e('0x3')]}]},{'model':_0xd82e('0xf'),'as':'Fields','attributes':['id',_0xd82e('0xb'),_0xd82e('0xc'),_0xd82e('0x13'),'nameField','customField',_0xd82e('0xd')],'include':[{'model':_0xd82e('0xe'),'as':_0xd82e('0xe'),'attributes':['id',_0xd82e('0x3')]}]},{'model':'Tag','as':_0xd82e('0x14'),'attributes':['id',_0xd82e('0x3')]}]}]},'log':_0xd82e('0x15')});};}; \ No newline at end of file +var _0x183f=['Variable','Descriptions','keyType','keyContent','Fields','nameField','Tag','Tags','getDeskAccounts','Request','GetDeskAccount','name','description','username','password','remoteUri','authType','type','serverUrl','DeskConfiguration','Configurations','DeskField','content','variableName'];(function(_0x27bee8,_0x452b2f){var _0xfa823f=function(_0x3fc8a1){while(--_0x3fc8a1){_0x27bee8['push'](_0x27bee8['shift']());}};_0xfa823f(++_0x452b2f);}(_0x183f,0xe0));var _0xf183=function(_0x46489b,_0x102a92){_0x46489b=_0x46489b-0x0;var _0xcef4e=_0x183f[_0x46489b];return _0xcef4e;};'use strict';var client=require('../../client');exports[_0xf183('0x0')]=function(){return function(_0x49de60){return client[_0xf183('0x1')](_0xf183('0x2'),{'options':{'raw':![],'attributes':['id',_0xf183('0x3'),_0xf183('0x4'),_0xf183('0x5'),_0xf183('0x6'),_0xf183('0x7'),_0xf183('0x8'),_0xf183('0x9'),_0xf183('0xa')],'include':[{'model':_0xf183('0xb'),'as':_0xf183('0xc'),'attributes':['id',_0xf183('0x3')],'include':[{'model':_0xf183('0xd'),'as':'Subjects','attributes':['id',_0xf183('0x9'),_0xf183('0xe'),_0xf183('0xf')],'include':[{'model':'Variable','as':_0xf183('0x10'),'attributes':['id',_0xf183('0x3')]}]},{'model':_0xf183('0xd'),'as':_0xf183('0x11'),'attributes':['id','type',_0xf183('0xe'),'key',_0xf183('0x12'),_0xf183('0x13'),_0xf183('0xf')],'include':[{'model':_0xf183('0x10'),'as':_0xf183('0x10'),'attributes':['id',_0xf183('0x3')]}]},{'model':_0xf183('0xd'),'as':_0xf183('0x14'),'attributes':['id',_0xf183('0x9'),_0xf183('0xe'),'idField',_0xf183('0x15'),'customField',_0xf183('0xf')],'include':[{'model':_0xf183('0x10'),'as':_0xf183('0x10'),'attributes':['id',_0xf183('0x3')]}]},{'model':_0xf183('0x16'),'as':_0xf183('0x17'),'attributes':['id',_0xf183('0x3')]}]}]},'log':_0xf183('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/integrations/dynamics365.js b/server/services/ami/rpc/integrations/dynamics365.js index daf3b5d..db65234 100644 --- a/server/services/ami/rpc/integrations/dynamics365.js +++ b/server/services/ami/rpc/integrations/dynamics365.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x97e6=['customField','CloudProvider','data5','data7','../../client','Request','GetDynamics365Account','username','password','tenantId','clientSecret','serverUrl','description','modernAuthentication','Dynamics365Configuration','Configurations','moduleCreate','additionalSearchContact','openNewTab','Subjects','type','content','variableName','Variable','name','key','keyContent','Dynamics365Field','Fields','idField','nameField'];(function(_0x886fa2,_0x472551){var _0x476008=function(_0x45481f){while(--_0x45481f){_0x886fa2['push'](_0x886fa2['shift']());}};_0x476008(++_0x472551);}(_0x97e6,0x159));var _0x697e=function(_0x20463f,_0x4cc37a){_0x20463f=_0x20463f-0x0;var _0x143ee4=_0x97e6[_0x20463f];return _0x143ee4;};'use strict';var client=require(_0x697e('0x0'));exports['getDynamics365Accounts']=function(){return function(_0x5555c4){return client[_0x697e('0x1')](_0x697e('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x697e('0x3'),_0x697e('0x4'),'remoteUri',_0x697e('0x5'),'clientId',_0x697e('0x6'),_0x697e('0x7'),_0x697e('0x8'),_0x697e('0x9')],'include':[{'model':_0x697e('0xa'),'as':_0x697e('0xb'),'attributes':['id','name','ticketType',_0x697e('0xc'),_0x697e('0xd'),_0x697e('0xe')],'include':[{'model':'Dynamics365Field','as':_0x697e('0xf'),'attributes':['id',_0x697e('0x10'),_0x697e('0x11'),_0x697e('0x12')],'include':[{'model':_0x697e('0x13'),'as':'Variable','attributes':['id',_0x697e('0x14')]}]},{'model':'Dynamics365Field','as':'Descriptions','attributes':['id',_0x697e('0x10'),_0x697e('0x11'),_0x697e('0x15'),'keyType',_0x697e('0x16'),_0x697e('0x12')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x697e('0x14')]}]},{'model':_0x697e('0x17'),'as':_0x697e('0x18'),'attributes':['id',_0x697e('0x10'),_0x697e('0x11'),_0x697e('0x19'),_0x697e('0x1a'),_0x697e('0x1b'),_0x697e('0x12')],'include':[{'model':'Variable','as':_0x697e('0x13'),'attributes':['id',_0x697e('0x14')]}]}]},{'model':'CloudProvider','as':_0x697e('0x1c'),'attributes':['id','data2',_0x697e('0x1d'),_0x697e('0x1e')]}]},'log':'GetDynamics365Account'});};}; \ No newline at end of file +var _0xb03e=['data7','getDynamics365Accounts','Request','GetDynamics365Account','name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Dynamics365Configuration','Configurations','ticketType','moduleCreate','openNewTab','Dynamics365Field','Subjects','content','Variable','Descriptions','type','key','keyType','keyContent','variableName','Fields','idField','nameField','customField','CloudProvider','data2','data5'];(function(_0x479f47,_0x3d619a){var _0xc3fac2=function(_0x351634){while(--_0x351634){_0x479f47['push'](_0x479f47['shift']());}};_0xc3fac2(++_0x3d619a);}(_0xb03e,0x1eb));var _0xeb03=function(_0x105052,_0x58b430){_0x105052=_0x105052-0x0;var _0x36c4a0=_0xb03e[_0x105052];return _0x36c4a0;};'use strict';var client=require('../../client');exports[_0xeb03('0x0')]=function(){return function(_0x399504){return client[_0xeb03('0x1')](_0xeb03('0x2'),{'options':{'raw':![],'attributes':['id',_0xeb03('0x3'),_0xeb03('0x4'),_0xeb03('0x5'),_0xeb03('0x6'),_0xeb03('0x7'),_0xeb03('0x8'),_0xeb03('0x9'),_0xeb03('0xa'),'description',_0xeb03('0xb')],'include':[{'model':_0xeb03('0xc'),'as':_0xeb03('0xd'),'attributes':['id',_0xeb03('0x3'),_0xeb03('0xe'),_0xeb03('0xf'),'additionalSearchContact',_0xeb03('0x10')],'include':[{'model':_0xeb03('0x11'),'as':_0xeb03('0x12'),'attributes':['id','type',_0xeb03('0x13'),'variableName'],'include':[{'model':_0xeb03('0x14'),'as':_0xeb03('0x14'),'attributes':['id',_0xeb03('0x3')]}]},{'model':_0xeb03('0x11'),'as':_0xeb03('0x15'),'attributes':['id',_0xeb03('0x16'),_0xeb03('0x13'),_0xeb03('0x17'),_0xeb03('0x18'),_0xeb03('0x19'),_0xeb03('0x1a')],'include':[{'model':_0xeb03('0x14'),'as':'Variable','attributes':['id',_0xeb03('0x3')]}]},{'model':_0xeb03('0x11'),'as':_0xeb03('0x1b'),'attributes':['id',_0xeb03('0x16'),'content',_0xeb03('0x1c'),_0xeb03('0x1d'),_0xeb03('0x1e'),'variableName'],'include':[{'model':_0xeb03('0x14'),'as':_0xeb03('0x14'),'attributes':['id',_0xeb03('0x3')]}]}]},{'model':_0xeb03('0x1f'),'as':_0xeb03('0x1f'),'attributes':['id',_0xeb03('0x20'),_0xeb03('0x21'),_0xeb03('0x22')]}]},'log':_0xeb03('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/integrations/freshdesk.js b/server/services/ami/rpc/integrations/freshdesk.js index bd354d7..cbcc6ed 100644 --- a/server/services/ami/rpc/integrations/freshdesk.js +++ b/server/services/ami/rpc/integrations/freshdesk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb688=['name','username','remoteUri','serverUrl','FreshdeskConfiguration','Configurations','Tag','FreshdeskField','Subjects','type','content','variableName','Variable','Descriptions','key','keyContent','Fields','nameField','getFreshdeskAccounts','Request','GetFreshdeskAccount'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xb688,0xcf));var _0x8b68=function(_0x45980b,_0x4b06af){_0x45980b=_0x45980b-0x0;var _0x506c05=_0xb688[_0x45980b];return _0x506c05;};'use strict';var client=require('../../client');exports[_0x8b68('0x0')]=function(){return function(_0x196cec){return client[_0x8b68('0x1')](_0x8b68('0x2'),{'options':{'raw':![],'attributes':['id',_0x8b68('0x3'),_0x8b68('0x4'),'apiKey',_0x8b68('0x5'),_0x8b68('0x6')],'include':[{'model':_0x8b68('0x7'),'as':_0x8b68('0x8'),'attributes':['id','name'],'include':[{'model':_0x8b68('0x9'),'attributes':['id','name']},{'model':_0x8b68('0xa'),'as':_0x8b68('0xb'),'attributes':['id',_0x8b68('0xc'),_0x8b68('0xd'),_0x8b68('0xe')],'include':[{'model':_0x8b68('0xf'),'as':_0x8b68('0xf'),'attributes':['id',_0x8b68('0x3')]}]},{'model':_0x8b68('0xa'),'as':_0x8b68('0x10'),'attributes':['id',_0x8b68('0xc'),_0x8b68('0xd'),_0x8b68('0x11'),'keyType',_0x8b68('0x12'),_0x8b68('0xe')],'include':[{'model':_0x8b68('0xf'),'as':_0x8b68('0xf'),'attributes':['id',_0x8b68('0x3')]}]},{'model':_0x8b68('0xa'),'as':_0x8b68('0x13'),'attributes':['id',_0x8b68('0xc'),_0x8b68('0xd'),'idField',_0x8b68('0x14'),'customField','variableName'],'include':[{'model':_0x8b68('0xf'),'as':_0x8b68('0xf'),'attributes':['id',_0x8b68('0x3')]}]}]}]},'log':'GetFreshdeskAccount'});};}; \ No newline at end of file +var _0x4345=['Variable','FreshdeskField','Descriptions','key','keyType','keyContent','Fields','idField','nameField','../../client','getFreshdeskAccounts','Request','GetFreshdeskAccount','name','username','remoteUri','FreshdeskConfiguration','Configurations','Subjects','type','content','variableName'];(function(_0xf03f9e,_0x2f85e8){var _0x2326a7=function(_0x44702b){while(--_0x44702b){_0xf03f9e['push'](_0xf03f9e['shift']());}};_0x2326a7(++_0x2f85e8);}(_0x4345,0x77));var _0x5434=function(_0x1d2971,_0x2c6753){_0x1d2971=_0x1d2971-0x0;var _0x264286=_0x4345[_0x1d2971];return _0x264286;};'use strict';var client=require(_0x5434('0x0'));exports[_0x5434('0x1')]=function(){return function(_0x590a0e){return client[_0x5434('0x2')](_0x5434('0x3'),{'options':{'raw':![],'attributes':['id',_0x5434('0x4'),_0x5434('0x5'),'apiKey',_0x5434('0x6'),'serverUrl'],'include':[{'model':_0x5434('0x7'),'as':_0x5434('0x8'),'attributes':['id',_0x5434('0x4')],'include':[{'model':'Tag','attributes':['id',_0x5434('0x4')]},{'model':'FreshdeskField','as':_0x5434('0x9'),'attributes':['id',_0x5434('0xa'),_0x5434('0xb'),_0x5434('0xc')],'include':[{'model':_0x5434('0xd'),'as':_0x5434('0xd'),'attributes':['id',_0x5434('0x4')]}]},{'model':_0x5434('0xe'),'as':_0x5434('0xf'),'attributes':['id',_0x5434('0xa'),_0x5434('0xb'),_0x5434('0x10'),_0x5434('0x11'),_0x5434('0x12'),'variableName'],'include':[{'model':_0x5434('0xd'),'as':'Variable','attributes':['id',_0x5434('0x4')]}]},{'model':_0x5434('0xe'),'as':_0x5434('0x13'),'attributes':['id',_0x5434('0xa'),'content',_0x5434('0x14'),_0x5434('0x15'),'customField',_0x5434('0xc')],'include':[{'model':_0x5434('0xd'),'as':_0x5434('0xd'),'attributes':['id',_0x5434('0x4')]}]}]}]},'log':'GetFreshdeskAccount'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/integrations/freshsales.js b/server/services/ami/rpc/integrations/freshsales.js index 8454bf3..29c6513 100644 --- a/server/services/ami/rpc/integrations/freshsales.js +++ b/server/services/ami/rpc/integrations/freshsales.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ee1=['Subjects','content','Variable','keyType','keyContent','variableName','../../client','GetFreshsalesAccount','name','username','remoteUri','serverUrl','FreshsalesConfiguration','Configurations','FreshsalesField'];(function(_0x59f066,_0x3d8a42){var _0x21187c=function(_0x17a6ee){while(--_0x17a6ee){_0x59f066['push'](_0x59f066['shift']());}};_0x21187c(++_0x3d8a42);}(_0x7ee1,0x8d));var _0x17ee=function(_0x3c6096,_0x81b39d){_0x3c6096=_0x3c6096-0x0;var _0x37bd40=_0x7ee1[_0x3c6096];return _0x37bd40;};'use strict';var client=require(_0x17ee('0x0'));exports['getFreshsalesAccounts']=function(){return function(_0x534bb6){return client['Request'](_0x17ee('0x1'),{'options':{'raw':![],'attributes':['id',_0x17ee('0x2'),_0x17ee('0x3'),'apiKey',_0x17ee('0x4'),_0x17ee('0x5')],'include':[{'model':_0x17ee('0x6'),'as':_0x17ee('0x7'),'attributes':['id','name'],'include':[{'model':_0x17ee('0x8'),'as':_0x17ee('0x9'),'attributes':['id','type',_0x17ee('0xa'),'variableName'],'include':[{'model':_0x17ee('0xb'),'as':_0x17ee('0xb'),'attributes':['id',_0x17ee('0x2')]}]},{'model':'FreshsalesField','as':'Descriptions','attributes':['id','type',_0x17ee('0xa'),'key',_0x17ee('0xc'),_0x17ee('0xd'),_0x17ee('0xe')],'include':[{'model':_0x17ee('0xb'),'as':'Variable','attributes':['id',_0x17ee('0x2')]}]}]}]},'log':'GetFreshsalesccount'});};}; \ No newline at end of file +var _0x1b65=['getFreshsalesAccounts','Request','name','username','apiKey','remoteUri','serverUrl','FreshsalesConfiguration','Configurations','FreshsalesField','Subjects','type','content','Variable','key','keyType','keyContent','variableName','../../client'];(function(_0x794330,_0x14bab4){var _0x41feda=function(_0x2daac7){while(--_0x2daac7){_0x794330['push'](_0x794330['shift']());}};_0x41feda(++_0x14bab4);}(_0x1b65,0x1b4));var _0x51b6=function(_0xeb901,_0x3e292e){_0xeb901=_0xeb901-0x0;var _0x645bad=_0x1b65[_0xeb901];return _0x645bad;};'use strict';var client=require(_0x51b6('0x0'));exports[_0x51b6('0x1')]=function(){return function(_0x3e4953){return client[_0x51b6('0x2')]('GetFreshsalesAccount',{'options':{'raw':![],'attributes':['id',_0x51b6('0x3'),_0x51b6('0x4'),_0x51b6('0x5'),_0x51b6('0x6'),_0x51b6('0x7')],'include':[{'model':_0x51b6('0x8'),'as':_0x51b6('0x9'),'attributes':['id','name'],'include':[{'model':_0x51b6('0xa'),'as':_0x51b6('0xb'),'attributes':['id',_0x51b6('0xc'),_0x51b6('0xd'),'variableName'],'include':[{'model':_0x51b6('0xe'),'as':_0x51b6('0xe'),'attributes':['id','name']}]},{'model':_0x51b6('0xa'),'as':'Descriptions','attributes':['id','type',_0x51b6('0xd'),_0x51b6('0xf'),_0x51b6('0x10'),_0x51b6('0x11'),_0x51b6('0x12')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x51b6('0x3')]}]}]}]},'log':'GetFreshsalesccount'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/integrations/salesforce.js b/server/services/ami/rpc/integrations/salesforce.js index 550b5ad..086929d 100644 --- a/server/services/ami/rpc/integrations/salesforce.js +++ b/server/services/ami/rpc/integrations/salesforce.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f1a=['additionalSearchAccount','additionalSearchContact','SalesforceField','Subjects','Variable','Descriptions','Fields','../../client','getSalesforceAccounts','Request','GetSalesforceAccount','name','username','password','clientSecret','serverUrl','type','Configurations','moduleSearch','moduleCreate','ticketType','leadId'];(function(_0x3b2fda,_0x164d52){var _0x5ad579=function(_0x488767){while(--_0x488767){_0x3b2fda['push'](_0x3b2fda['shift']());}};_0x5ad579(++_0x164d52);}(_0x8f1a,0xcd));var _0xa8f1=function(_0x451d2e,_0xec68e2){_0x451d2e=_0x451d2e-0x0;var _0x4aec0b=_0x8f1a[_0x451d2e];return _0x4aec0b;};'use strict';var client=require(_0xa8f1('0x0'));exports[_0xa8f1('0x1')]=function(){return function(_0x17cbdb){return client[_0xa8f1('0x2')](_0xa8f1('0x3'),{'options':{'raw':![],'attributes':['id',_0xa8f1('0x4'),_0xa8f1('0x5'),_0xa8f1('0x6'),'remoteUri','clientId',_0xa8f1('0x7'),'securityToken',_0xa8f1('0x8'),_0xa8f1('0x9')],'include':[{'model':'SalesforceConfiguration','as':_0xa8f1('0xa'),'attributes':['id',_0xa8f1('0x4'),_0xa8f1('0xb'),_0xa8f1('0xc'),_0xa8f1('0xd'),_0xa8f1('0xe'),_0xa8f1('0xf'),_0xa8f1('0x10'),'additionalSearchLead'],'include':[{'model':_0xa8f1('0x11'),'as':_0xa8f1('0x12'),'include':[{'model':'Variable','as':_0xa8f1('0x13'),'attributes':['id','name']}]},{'model':_0xa8f1('0x11'),'as':_0xa8f1('0x14'),'include':[{'model':_0xa8f1('0x13'),'as':'Variable','attributes':['id',_0xa8f1('0x4')]}]},{'model':_0xa8f1('0x11'),'as':_0xa8f1('0x15'),'include':[{'model':_0xa8f1('0x13'),'as':_0xa8f1('0x13'),'attributes':['id','name']}]}]}]},'log':_0xa8f1('0x3')});};}; \ No newline at end of file +var _0x505d=['SalesforceField','Variable','Fields','Request','GetSalesforceAccount','name','username','remoteUri','clientId','clientSecret','securityToken','type','Configurations','moduleCreate','ticketType','additionalSearchContact'];(function(_0x11e172,_0x527865){var _0x1828e0=function(_0x5d96cb){while(--_0x5d96cb){_0x11e172['push'](_0x11e172['shift']());}};_0x1828e0(++_0x527865);}(_0x505d,0x93));var _0xd505=function(_0xfcbcb8,_0x35bf6b){_0xfcbcb8=_0xfcbcb8-0x0;var _0x1b1f97=_0x505d[_0xfcbcb8];return _0x1b1f97;};'use strict';var client=require('../../client');exports['getSalesforceAccounts']=function(){return function(_0x441c2b){return client[_0xd505('0x0')](_0xd505('0x1'),{'options':{'raw':![],'attributes':['id',_0xd505('0x2'),_0xd505('0x3'),'password',_0xd505('0x4'),_0xd505('0x5'),_0xd505('0x6'),_0xd505('0x7'),'serverUrl',_0xd505('0x8')],'include':[{'model':'SalesforceConfiguration','as':_0xd505('0x9'),'attributes':['id',_0xd505('0x2'),'moduleSearch',_0xd505('0xa'),_0xd505('0xb'),'leadId','additionalSearchAccount',_0xd505('0xc'),'additionalSearchLead'],'include':[{'model':_0xd505('0xd'),'as':'Subjects','include':[{'model':_0xd505('0xe'),'as':'Variable','attributes':['id',_0xd505('0x2')]}]},{'model':'SalesforceField','as':'Descriptions','include':[{'model':'Variable','as':_0xd505('0xe'),'attributes':['id','name']}]},{'model':_0xd505('0xd'),'as':_0xd505('0xf'),'include':[{'model':'Variable','as':'Variable','attributes':['id',_0xd505('0x2')]}]}]}]},'log':_0xd505('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/integrations/servicenow.js b/server/services/ami/rpc/integrations/servicenow.js index 74f0f0e..e35c52d 100644 --- a/server/services/ami/rpc/integrations/servicenow.js +++ b/server/services/ami/rpc/integrations/servicenow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc6ac=['GetServicenowAccount','name','description','username','password','email','remoteUri','serverUrl','ServicenowConfiguration','Configurations','ServicenowField','Subjects','type','variableName','Variable','content','key','keyContent','Fields','nameField','customField','GetServicenowkAccount','../../client','getServicenowAccounts','Request'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x48ba27,_0x26c8f6){_0x48ba27=_0x48ba27-0x0;var _0x42c5f8=_0xc6ac[_0x48ba27];return _0x42c5f8;};'use strict';var client=require(_0xcc6a('0x0'));exports[_0xcc6a('0x1')]=function(){return function(_0x1b6e92){return client[_0xcc6a('0x2')](_0xcc6a('0x3'),{'options':{'raw':![],'attributes':['id',_0xcc6a('0x4'),_0xcc6a('0x5'),_0xcc6a('0x6'),_0xcc6a('0x7'),_0xcc6a('0x8'),_0xcc6a('0x9'),_0xcc6a('0xa')],'include':[{'model':_0xcc6a('0xb'),'as':_0xcc6a('0xc'),'attributes':['id','name'],'include':[{'model':_0xcc6a('0xd'),'as':_0xcc6a('0xe'),'attributes':['id',_0xcc6a('0xf'),'content',_0xcc6a('0x10')],'include':[{'model':_0xcc6a('0x11'),'as':_0xcc6a('0x11'),'attributes':['id',_0xcc6a('0x4')]}]},{'model':_0xcc6a('0xd'),'as':'Descriptions','attributes':['id',_0xcc6a('0xf'),_0xcc6a('0x12'),_0xcc6a('0x13'),'keyType',_0xcc6a('0x14'),_0xcc6a('0x10')],'include':[{'model':_0xcc6a('0x11'),'as':'Variable','attributes':['id','name']}]},{'model':_0xcc6a('0xd'),'as':_0xcc6a('0x15'),'attributes':['id',_0xcc6a('0xf'),'content','idField',_0xcc6a('0x16'),_0xcc6a('0x17'),_0xcc6a('0x10')],'include':[{'model':_0xcc6a('0x11'),'as':_0xcc6a('0x11'),'attributes':['id',_0xcc6a('0x4')]}]}]}]},'log':_0xcc6a('0x18')});};}; \ No newline at end of file +var _0x524e=['name','description','username','password','email','remoteUri','serverUrl','Configurations','ServicenowField','type','content','variableName','Variable','Descriptions','key','keyType','keyContent','Fields','idField','nameField','Request','GetServicenowAccount'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x524e,0x15e));var _0xe524=function(_0x2d9ac4,_0x194d56){_0x2d9ac4=_0x2d9ac4-0x0;var _0xf51bfe=_0x524e[_0x2d9ac4];return _0xf51bfe;};'use strict';var client=require('../../client');exports['getServicenowAccounts']=function(){return function(_0x353d8a){return client[_0xe524('0x0')](_0xe524('0x1'),{'options':{'raw':![],'attributes':['id',_0xe524('0x2'),_0xe524('0x3'),_0xe524('0x4'),_0xe524('0x5'),_0xe524('0x6'),_0xe524('0x7'),_0xe524('0x8')],'include':[{'model':'ServicenowConfiguration','as':_0xe524('0x9'),'attributes':['id',_0xe524('0x2')],'include':[{'model':_0xe524('0xa'),'as':'Subjects','attributes':['id',_0xe524('0xb'),_0xe524('0xc'),_0xe524('0xd')],'include':[{'model':_0xe524('0xe'),'as':_0xe524('0xe'),'attributes':['id',_0xe524('0x2')]}]},{'model':_0xe524('0xa'),'as':_0xe524('0xf'),'attributes':['id',_0xe524('0xb'),_0xe524('0xc'),_0xe524('0x10'),_0xe524('0x11'),_0xe524('0x12'),_0xe524('0xd')],'include':[{'model':_0xe524('0xe'),'as':_0xe524('0xe'),'attributes':['id','name']}]},{'model':'ServicenowField','as':_0xe524('0x13'),'attributes':['id',_0xe524('0xb'),_0xe524('0xc'),_0xe524('0x14'),_0xe524('0x15'),'customField',_0xe524('0xd')],'include':[{'model':'Variable','as':_0xe524('0xe'),'attributes':['id',_0xe524('0x2')]}]}]}]},'log':'GetServicenowkAccount'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/integrations/sugarcrm.js b/server/services/ami/rpc/integrations/sugarcrm.js index 423405d..fed557f 100644 --- a/server/services/ami/rpc/integrations/sugarcrm.js +++ b/server/services/ami/rpc/integrations/sugarcrm.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda2d=['Subjects','type','content','variableName','Variable','key','keyType','keyContent','idField','nameField','customField','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','serverUrl','SugarcrmConfiguration','Configurations','SugarcrmField'];(function(_0x6ca7f4,_0x51a5df){var _0x494fa6=function(_0x359532){while(--_0x359532){_0x6ca7f4['push'](_0x6ca7f4['shift']());}};_0x494fa6(++_0x51a5df);}(_0xda2d,0x102));var _0xdda2=function(_0x58dae5,_0x6df2d9){_0x58dae5=_0x58dae5-0x0;var _0x52ee2b=_0xda2d[_0x58dae5];return _0x52ee2b;};'use strict';var client=require('../../client');exports[_0xdda2('0x0')]=function(){return function(_0x35f029){return client[_0xdda2('0x1')](_0xdda2('0x2'),{'options':{'raw':![],'attributes':['id',_0xdda2('0x3'),'username','password','remoteUri',_0xdda2('0x4')],'include':[{'model':_0xdda2('0x5'),'as':_0xdda2('0x6'),'attributes':['id',_0xdda2('0x3')],'include':[{'model':_0xdda2('0x7'),'as':_0xdda2('0x8'),'attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':'Variable','attributes':['id',_0xdda2('0x3')]}]},{'model':_0xdda2('0x7'),'as':'Descriptions','attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xd'),_0xdda2('0xe'),_0xdda2('0xf'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':_0xdda2('0xc'),'attributes':['id','name']}]},{'model':'SugarcrmField','as':'Fields','attributes':['id',_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0x10'),_0xdda2('0x11'),_0xdda2('0x12'),_0xdda2('0xb')],'include':[{'model':_0xdda2('0xc'),'as':'Variable','attributes':['id',_0xdda2('0x3')]}]}]}]},'log':'GetSugarcrmAccount'});};}; \ No newline at end of file +var _0x0295=['remoteUri','serverUrl','SugarcrmConfiguration','Configurations','name','SugarcrmField','Subjects','Variable','Descriptions','content','key','keyType','variableName','Fields','customField','GetSugarcrmAccount','../../client','Request','username','password'];(function(_0x235faa,_0x3e4c02){var _0x13de02=function(_0x49f7a9){while(--_0x49f7a9){_0x235faa['push'](_0x235faa['shift']());}};_0x13de02(++_0x3e4c02);}(_0x0295,0x1f0));var _0x5029=function(_0x58cbde,_0x4b0f62){_0x58cbde=_0x58cbde-0x0;var _0x5799f3=_0x0295[_0x58cbde];return _0x5799f3;};'use strict';var client=require(_0x5029('0x0'));exports['getSugarcrmAccounts']=function(){return function(_0x5e71d0){return client[_0x5029('0x1')]('GetSugarcrmAccount',{'options':{'raw':![],'attributes':['id','name',_0x5029('0x2'),_0x5029('0x3'),_0x5029('0x4'),_0x5029('0x5')],'include':[{'model':_0x5029('0x6'),'as':_0x5029('0x7'),'attributes':['id',_0x5029('0x8')],'include':[{'model':_0x5029('0x9'),'as':_0x5029('0xa'),'attributes':['id','type','content','variableName'],'include':[{'model':_0x5029('0xb'),'as':'Variable','attributes':['id',_0x5029('0x8')]}]},{'model':'SugarcrmField','as':_0x5029('0xc'),'attributes':['id','type',_0x5029('0xd'),_0x5029('0xe'),_0x5029('0xf'),'keyContent',_0x5029('0x10')],'include':[{'model':_0x5029('0xb'),'as':_0x5029('0xb'),'attributes':['id','name']}]},{'model':_0x5029('0x9'),'as':_0x5029('0x11'),'attributes':['id','type','content','idField','nameField',_0x5029('0x12'),_0x5029('0x10')],'include':[{'model':_0x5029('0xb'),'as':_0x5029('0xb'),'attributes':['id',_0x5029('0x8')]}]}]}]},'log':_0x5029('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/integrations/vtiger.js b/server/services/ami/rpc/integrations/vtiger.js index 9504f87..a10567b 100644 --- a/server/services/ami/rpc/integrations/vtiger.js +++ b/server/services/ami/rpc/integrations/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6ec3=['variableName','Variable','Descriptions','key','keyType','Fields','nameField','GetVtigerAccount','../../client','getVtigerAccounts','Request','name','description','remoteUri','VtigerConfiguration','Configurations','VtigerField','Subjects','type','content'];(function(_0x457f9b,_0x240086){var _0x2113e0=function(_0x393511){while(--_0x393511){_0x457f9b['push'](_0x457f9b['shift']());}};_0x2113e0(++_0x240086);}(_0x6ec3,0xa8));var _0x36ec=function(_0x1f9ada,_0xf00a10){_0x1f9ada=_0x1f9ada-0x0;var _0x55f24e=_0x6ec3[_0x1f9ada];return _0x55f24e;};'use strict';var client=require(_0x36ec('0x0'));exports[_0x36ec('0x1')]=function(){return function(_0x3e1c1d){return client[_0x36ec('0x2')]('GetVtigerAccount',{'options':{'raw':![],'attributes':['id',_0x36ec('0x3'),_0x36ec('0x4'),'username','accessKey',_0x36ec('0x5'),'serverUrl'],'include':[{'model':_0x36ec('0x6'),'as':_0x36ec('0x7'),'attributes':['id',_0x36ec('0x3')],'include':[{'model':_0x36ec('0x8'),'as':_0x36ec('0x9'),'attributes':['id',_0x36ec('0xa'),_0x36ec('0xb'),_0x36ec('0xc')],'include':[{'model':_0x36ec('0xd'),'as':_0x36ec('0xd'),'attributes':['id',_0x36ec('0x3')]}]},{'model':_0x36ec('0x8'),'as':_0x36ec('0xe'),'attributes':['id','type',_0x36ec('0xb'),_0x36ec('0xf'),_0x36ec('0x10'),'keyContent',_0x36ec('0xc')],'include':[{'model':_0x36ec('0xd'),'as':_0x36ec('0xd'),'attributes':['id',_0x36ec('0x3')]}]},{'model':_0x36ec('0x8'),'as':_0x36ec('0x11'),'attributes':['id',_0x36ec('0xa'),'content','idField',_0x36ec('0x12'),'customField',_0x36ec('0xc')],'include':[{'model':'Variable','as':_0x36ec('0xd'),'attributes':['id',_0x36ec('0x3')]}]}]}]},'log':_0x36ec('0x13')});};}; \ No newline at end of file +var _0xe70e=['keyContent','variableName','Fields','Request','GetVtigerAccount','name','description','username','accessKey','remoteUri','serverUrl','VtigerConfiguration','Configurations','VtigerField','Subjects','type','content','Variable','Descriptions','key','keyType'];(function(_0x418b39,_0x5a78f8){var _0x2d2618=function(_0x5b8410){while(--_0x5b8410){_0x418b39['push'](_0x418b39['shift']());}};_0x2d2618(++_0x5a78f8);}(_0xe70e,0xab));var _0xee70=function(_0x53ae66,_0x4d00fc){_0x53ae66=_0x53ae66-0x0;var _0x446592=_0xe70e[_0x53ae66];return _0x446592;};'use strict';var client=require('../../client');exports['getVtigerAccounts']=function(){return function(_0x28c4c6){return client[_0xee70('0x0')](_0xee70('0x1'),{'options':{'raw':![],'attributes':['id',_0xee70('0x2'),_0xee70('0x3'),_0xee70('0x4'),_0xee70('0x5'),_0xee70('0x6'),_0xee70('0x7')],'include':[{'model':_0xee70('0x8'),'as':_0xee70('0x9'),'attributes':['id',_0xee70('0x2')],'include':[{'model':_0xee70('0xa'),'as':_0xee70('0xb'),'attributes':['id',_0xee70('0xc'),_0xee70('0xd'),'variableName'],'include':[{'model':'Variable','as':_0xee70('0xe'),'attributes':['id',_0xee70('0x2')]}]},{'model':'VtigerField','as':_0xee70('0xf'),'attributes':['id',_0xee70('0xc'),_0xee70('0xd'),_0xee70('0x10'),_0xee70('0x11'),_0xee70('0x12'),_0xee70('0x13')],'include':[{'model':_0xee70('0xe'),'as':_0xee70('0xe'),'attributes':['id','name']}]},{'model':_0xee70('0xa'),'as':_0xee70('0x14'),'attributes':['id',_0xee70('0xc'),_0xee70('0xd'),'idField','nameField','customField',_0xee70('0x13')],'include':[{'model':'Variable','as':_0xee70('0xe'),'attributes':['id',_0xee70('0x2')]}]}]}]},'log':_0xee70('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/integrations/zendesk.js b/server/services/ami/rpc/integrations/zendesk.js index 4b5b666..874964b 100644 --- a/server/services/ami/rpc/integrations/zendesk.js +++ b/server/services/ami/rpc/integrations/zendesk.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe654=['remoteUri','authType','serverUrl','type','ZendeskConfiguration','Configurations','Subjects','content','Variable','ZendeskField','keyType','Fields','idField','nameField','../../client','Request','GetZendeskAccount','name','username','password','token'];(function(_0x381fac,_0x2c7e36){var _0xdb89c4=function(_0x413f48){while(--_0x413f48){_0x381fac['push'](_0x381fac['shift']());}};_0xdb89c4(++_0x2c7e36);}(_0xe654,0x10a));var _0x4e65=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe654[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x4e65('0x0'));exports['getZendeskAccounts']=function(){return function(_0x3b313c){return client[_0x4e65('0x1')](_0x4e65('0x2'),{'options':{'raw':![],'attributes':['id',_0x4e65('0x3'),_0x4e65('0x4'),_0x4e65('0x5'),_0x4e65('0x6'),_0x4e65('0x7'),_0x4e65('0x8'),_0x4e65('0x9'),_0x4e65('0xa')],'include':[{'model':_0x4e65('0xb'),'as':_0x4e65('0xc'),'attributes':['id','name'],'include':[{'model':'Tag','attributes':['id','name']},{'model':'ZendeskField','as':_0x4e65('0xd'),'attributes':['id',_0x4e65('0xa'),_0x4e65('0xe'),'variableName'],'include':[{'model':_0x4e65('0xf'),'as':_0x4e65('0xf'),'attributes':['id',_0x4e65('0x3')]}]},{'model':_0x4e65('0x10'),'as':'Descriptions','attributes':['id',_0x4e65('0xa'),_0x4e65('0xe'),'key',_0x4e65('0x11'),'keyContent','variableName'],'include':[{'model':_0x4e65('0xf'),'as':_0x4e65('0xf'),'attributes':['id',_0x4e65('0x3')]}]},{'model':_0x4e65('0x10'),'as':_0x4e65('0x12'),'attributes':['id',_0x4e65('0xa'),_0x4e65('0xe'),_0x4e65('0x13'),_0x4e65('0x14'),'customField','variableName'],'include':[{'model':_0x4e65('0xf'),'as':_0x4e65('0xf'),'attributes':['id',_0x4e65('0x3')]}]}]}]},'log':_0x4e65('0x2')});};}; \ No newline at end of file +var _0x1a26=['nameField','customField','../../client','Request','GetZendeskAccount','name','password','token','remoteUri','authType','type','ZendeskConfiguration','Configurations','Subjects','content','variableName','Variable','Descriptions','keyContent','ZendeskField','Fields','idField'];(function(_0x560924,_0x258a47){var _0x5c694d=function(_0x599a81){while(--_0x599a81){_0x560924['push'](_0x560924['shift']());}};_0x5c694d(++_0x258a47);}(_0x1a26,0x18e));var _0x61a2=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x1a26[_0x1beef3];return _0x5af964;};'use strict';var client=require(_0x61a2('0x0'));exports['getZendeskAccounts']=function(){return function(_0xe21188){return client[_0x61a2('0x1')](_0x61a2('0x2'),{'options':{'raw':![],'attributes':['id',_0x61a2('0x3'),'username',_0x61a2('0x4'),_0x61a2('0x5'),_0x61a2('0x6'),_0x61a2('0x7'),'serverUrl',_0x61a2('0x8')],'include':[{'model':_0x61a2('0x9'),'as':_0x61a2('0xa'),'attributes':['id',_0x61a2('0x3')],'include':[{'model':'Tag','attributes':['id','name']},{'model':'ZendeskField','as':_0x61a2('0xb'),'attributes':['id',_0x61a2('0x8'),_0x61a2('0xc'),_0x61a2('0xd')],'include':[{'model':_0x61a2('0xe'),'as':_0x61a2('0xe'),'attributes':['id','name']}]},{'model':'ZendeskField','as':_0x61a2('0xf'),'attributes':['id','type','content','key','keyType',_0x61a2('0x10'),_0x61a2('0xd')],'include':[{'model':_0x61a2('0xe'),'as':_0x61a2('0xe'),'attributes':['id',_0x61a2('0x3')]}]},{'model':_0x61a2('0x11'),'as':_0x61a2('0x12'),'attributes':['id',_0x61a2('0x8'),_0x61a2('0xc'),_0x61a2('0x13'),_0x61a2('0x14'),_0x61a2('0x15'),_0x61a2('0xd')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x61a2('0x3')]}]}]}]},'log':'GetZendeskAccount'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/integrations/zoho.js b/server/services/ami/rpc/integrations/zoho.js index 678fb5e..2153b07 100644 --- a/server/services/ami/rpc/integrations/zoho.js +++ b/server/services/ami/rpc/integrations/zoho.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x59f4=['clientId','serverUrl','code','refreshToken','ZohoConfiguration','Configurations','moduleCreate','moduleSearch','ZohoField','Subjects','type','content','variableName','Descriptions','keyContent','idField','nameField','customField','Variable','../../client','GetZohoAccount','name','description','host'];(function(_0x36b118,_0x298b28){var _0x2711db=function(_0x25c67c){while(--_0x25c67c){_0x36b118['push'](_0x36b118['shift']());}};_0x2711db(++_0x298b28);}(_0x59f4,0x163));var _0x459f=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x59f4[_0x6c993a];return _0x27f547;};'use strict';var client=require(_0x459f('0x0'));exports['getZohoAccounts']=function(){return function(_0xd47d5){return client['Request'](_0x459f('0x1'),{'options':{'raw':![],'attributes':['id',_0x459f('0x2'),_0x459f('0x3'),_0x459f('0x4'),'zone',_0x459f('0x5'),'clientSecret',_0x459f('0x6'),_0x459f('0x7'),_0x459f('0x8')],'include':[{'model':_0x459f('0x9'),'as':_0x459f('0xa'),'attributes':['id',_0x459f('0x2'),_0x459f('0xb'),_0x459f('0xc'),_0x459f('0x3')],'include':[{'model':_0x459f('0xd'),'as':_0x459f('0xe'),'attributes':['id',_0x459f('0xf'),_0x459f('0x10'),_0x459f('0x11')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x459f('0x2')]}]},{'model':_0x459f('0xd'),'as':_0x459f('0x12'),'attributes':['id',_0x459f('0xf'),_0x459f('0x10'),'key','keyType',_0x459f('0x13'),_0x459f('0x11')],'include':[{'model':'Variable','as':'Variable','attributes':['id',_0x459f('0x2')]}]},{'model':'ZohoField','as':'Fields','attributes':['id',_0x459f('0xf'),'content',_0x459f('0x14'),_0x459f('0x15'),_0x459f('0x16'),_0x459f('0x11')],'include':[{'model':_0x459f('0x17'),'as':_0x459f('0x17'),'attributes':['id',_0x459f('0x2')]}]}]}]},'log':_0x459f('0x1')});};}; \ No newline at end of file +var _0xe49c=['Subjects','type','content','variableName','Variable','ZohoField','key','keyType','keyContent','nameField','customField','../../client','Request','name','description','clientId','serverUrl','refreshToken','ZohoConfiguration','Configurations','moduleCreate','moduleSearch'];(function(_0x3634d8,_0xbfa70b){var _0x2c1369=function(_0x27b79a){while(--_0x27b79a){_0x3634d8['push'](_0x3634d8['shift']());}};_0x2c1369(++_0xbfa70b);}(_0xe49c,0x181));var _0xce49=function(_0x8f6a2c,_0x435996){_0x8f6a2c=_0x8f6a2c-0x0;var _0x42a718=_0xe49c[_0x8f6a2c];return _0x42a718;};'use strict';var client=require(_0xce49('0x0'));exports['getZohoAccounts']=function(){return function(_0x52a5e8){return client[_0xce49('0x1')]('GetZohoAccount',{'options':{'raw':![],'attributes':['id',_0xce49('0x2'),_0xce49('0x3'),'host','zone',_0xce49('0x4'),'clientSecret',_0xce49('0x5'),'code',_0xce49('0x6')],'include':[{'model':_0xce49('0x7'),'as':_0xce49('0x8'),'attributes':['id',_0xce49('0x2'),_0xce49('0x9'),_0xce49('0xa'),'description'],'include':[{'model':'ZohoField','as':_0xce49('0xb'),'attributes':['id',_0xce49('0xc'),_0xce49('0xd'),_0xce49('0xe')],'include':[{'model':_0xce49('0xf'),'as':_0xce49('0xf'),'attributes':['id','name']}]},{'model':_0xce49('0x10'),'as':'Descriptions','attributes':['id',_0xce49('0xc'),'content',_0xce49('0x11'),_0xce49('0x12'),_0xce49('0x13'),_0xce49('0xe')],'include':[{'model':_0xce49('0xf'),'as':_0xce49('0xf'),'attributes':['id','name']}]},{'model':'ZohoField','as':'Fields','attributes':['id','type',_0xce49('0xd'),'idField',_0xce49('0x14'),_0xce49('0x15'),_0xce49('0xe')],'include':[{'model':'Variable','as':'Variable','attributes':['id','name']}]}]}]},'log':'GetZohoAccount'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/interval.js b/server/services/ami/rpc/interval.js index f20cd0a..d814f98 100644 --- a/server/services/ami/rpc/interval.js +++ b/server/services/ami/rpc/interval.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6199=['concat','Request','IntervalIftime','intervalIftime','../../../config/logger','dialer','replace','trim','silly','intervalIftime\x20called\x20with','isArray','resolve','map','length','interval'];(function(_0x17f502,_0x5a31a2){var _0x5f1554=function(_0x3e3c28){while(--_0x3e3c28){_0x17f502['push'](_0x17f502['shift']());}};_0x5f1554(++_0x5a31a2);}(_0x6199,0x112));var _0x9619=function(_0x16ac08,_0x545d75){_0x16ac08=_0x16ac08-0x0;var _0x3e9017=_0x6199[_0x16ac08];return _0x3e9017;};var logger=require(_0x9619('0x0'))(_0x9619('0x1'));var client=require('../client');function intervalIftime(_0x24a654,_0x4fb619){const _0x4282b0=new Error()['stack'][_0x9619('0x2')](/^Error/,'')[_0x9619('0x3')]();logger[_0x9619('0x4')](_0x9619('0x5'),_0x24a654,_0x4fb619,_0x4282b0);const _0x7b4802=Array[_0x9619('0x6')](_0x24a654);if(!_0x24a654||_0x7b4802&&_0x24a654['length']===0x0){return Promise[_0x9619('0x7')](![]);}else{var _0x55dc7c=[];var _0xea19ac=[];var _0x326e34=_0x7b4802?_0x24a654:[_0x24a654];var _0x436a04=_0x326e34['every'](function(_0x23a513){return typeof _0x23a513==='number';});var _0x4a9738=_0x326e34['every'](function(_0x5b6391){return typeof _0x5b6391==='string';});if(!_0x436a04&&!_0x4a9738){_0x55dc7c=_0x326e34[_0x9619('0x8')](function(_0x118a5c){return _0x118a5c['id'];});if(_0x55dc7c[_0x9619('0x9')]===0x0){_0xea19ac=_0x326e34[_0x9619('0x8')](function(_0x220d5b){return _0x220d5b[_0x9619('0xa')];});}}else{if(_0x436a04){_0x55dc7c=_0x55dc7c[_0x9619('0xb')](_0x326e34);}if(_0x4a9738){_0xea19ac=_0xea19ac[_0x9619('0xb')](_0x326e34);}}return client[_0x9619('0xc')](_0x9619('0xd'),{'intervalIds':_0x55dc7c,'intervals':_0xea19ac,'timezone':_0x4fb619,'log':_0x9619('0xd')});}}exports[_0x9619('0xe')]=intervalIftime; \ No newline at end of file +var _0x780e=['intervalIftime\x20called\x20with','isArray','length','resolve','every','string','map','concat','IntervalIftime','intervalIftime','../../../config/logger','dialer','stack','replace','trim','silly'];(function(_0xd732d2,_0x5bbb3a){var _0xb4cea3=function(_0x1a8864){while(--_0x1a8864){_0xd732d2['push'](_0xd732d2['shift']());}};_0xb4cea3(++_0x5bbb3a);}(_0x780e,0x17a));var _0xe780=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x780e[_0x3dd15e];return _0x231fd0;};var logger=require(_0xe780('0x0'))(_0xe780('0x1'));var client=require('../client');function intervalIftime(_0x1a2092,_0x2a5382){const _0x2133ad=new Error()[_0xe780('0x2')][_0xe780('0x3')](/^Error/,'')[_0xe780('0x4')]();logger[_0xe780('0x5')](_0xe780('0x6'),_0x1a2092,_0x2a5382,_0x2133ad);const _0x1ff5fa=Array[_0xe780('0x7')](_0x1a2092);if(!_0x1a2092||_0x1ff5fa&&_0x1a2092[_0xe780('0x8')]===0x0){return Promise[_0xe780('0x9')](![]);}else{var _0x405965=[];var _0x4d5f5f=[];var _0x3bae56=_0x1ff5fa?_0x1a2092:[_0x1a2092];var _0x4e28b5=_0x3bae56[_0xe780('0xa')](function(_0x3dc97e){return typeof _0x3dc97e==='number';});var _0x580670=_0x3bae56['every'](function(_0x3c4d6f){return typeof _0x3c4d6f===_0xe780('0xb');});if(!_0x4e28b5&&!_0x580670){_0x405965=_0x3bae56[_0xe780('0xc')](function(_0x129a84){return _0x129a84['id'];});if(_0x405965[_0xe780('0x8')]===0x0){_0x4d5f5f=_0x3bae56[_0xe780('0xc')](function(_0x53b858){return _0x53b858['interval'];});}}else{if(_0x4e28b5){_0x405965=_0x405965[_0xe780('0xd')](_0x3bae56);}if(_0x580670){_0x4d5f5f=_0x4d5f5f[_0xe780('0xd')](_0x3bae56);}}return client['Request'](_0xe780('0xe'),{'intervalIds':_0x405965,'intervals':_0x4d5f5f,'timezone':_0x2a5382,'log':_0xe780('0xe')});}}exports[_0xe780('0xf')]=intervalIftime; \ No newline at end of file diff --git a/server/services/ami/rpc/memberReport.js b/server/services/ami/rpc/memberReport.js index 8e26d27..599398b 100644 --- a/server/services/ami/rpc/memberReport.js +++ b/server/services/ami/rpc/memberReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xee4e=['lastAssignedTo','interface','diff','queuecallerleaveAt','seconds','inbound','calleridnum','exten','agent','accountcode','toNumber','uniqueid','Request','voice','membername','TALKING','starttime','endtime','outbound','dialstring','moment','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','CreateMemberReport','format','SIP/%s'];(function(_0x2f1ac2,_0x69699a){var _0xbbb440=function(_0x2908dc){while(--_0x2908dc){_0x2f1ac2['push'](_0x2f1ac2['shift']());}};_0xbbb440(++_0x69699a);}(_0xee4e,0x8c));var _0xeee4=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xee4e[_0x13b8f3];return _0x1a6d06;};'use strict';var moment=require(_0xeee4('0x0'));var _=require(_0xeee4('0x1'));var util=require(_0xeee4('0x2'));var client=require(_0xeee4('0x3'));exports[_0xeee4('0x4')]=function(_0x12b3e8){var _0x2c5204=_0x12b3e8[_0xeee4('0x5')]||_0x12b3e8[_0xeee4('0x6')];return client['Request'](_0xeee4('0x7'),{'body':{'channel':'voice','membername':_0x12b3e8['lastAssignedTo'],'interface':_['isNil'](_0x12b3e8['interface'])?util[_0xeee4('0x8')](_0xeee4('0x9'),_0x12b3e8[_0xeee4('0xa')]):_0x12b3e8[_0xeee4('0xb')],'type':'TALKING','enterAt':_0x12b3e8['queuecallerleaveAt'],'exitAt':_0x2c5204,'duration':moment(_0x2c5204)[_0xeee4('0xc')](_0x12b3e8[_0xeee4('0xd')],_0xeee4('0xe')),'data1':_0xeee4('0xf'),'data2':_0x12b3e8[_0xeee4('0x10')],'data3':_0x12b3e8[_0xeee4('0x11')],'data4':null,'data5':_0x12b3e8['queue'],'role':_0xeee4('0x12'),'internal':_0x12b3e8[_0xeee4('0x13')]?_[_0xeee4('0x14')](_0x12b3e8[_0xeee4('0x13')]):undefined,'uniqueid':_0x12b3e8[_0xeee4('0x15')]},'log':_0xeee4('0x7')});};exports['voiceDialReport']=function(_0x540bbf){return client[_0xeee4('0x16')]('CreateMemberReport',{'body':{'channel':_0xeee4('0x17'),'membername':_0x540bbf[_0xeee4('0x18')],'interface':_0x540bbf[_0xeee4('0xb')],'type':_0xeee4('0x19'),'enterAt':_0x540bbf[_0xeee4('0x1a')],'exitAt':_0x540bbf[_0xeee4('0x1b')],'duration':moment(_0x540bbf[_0xeee4('0x1b')])[_0xeee4('0xc')](_0x540bbf[_0xeee4('0x1a')],_0xeee4('0xe'))>=0x0?moment(_0x540bbf[_0xeee4('0x1b')])[_0xeee4('0xc')](_0x540bbf[_0xeee4('0x1a')],_0xeee4('0xe')):null,'data1':_0xeee4('0x1c'),'data2':_0x540bbf[_0xeee4('0x13')],'data3':_0x540bbf['exten'],'data4':_0x540bbf[_0xeee4('0x1d')]||null,'role':_0xeee4('0x12'),'internal':_0x540bbf[_0xeee4('0x13')]?_['toNumber'](_0x540bbf[_0xeee4('0x13')]):undefined,'uniqueid':_0x540bbf[_0xeee4('0x15')]},'log':_0xeee4('0x7')});}; \ No newline at end of file +var _0xf46e=['voiceDialReport','Request','voice','starttime','endtime','outbound','exten','agent','lodash','util','../client','voiceQueueReport','queuecallercompleteAt','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','diff','queuecallerleaveAt','seconds','calleridnum','queue','toNumber','accountcode','uniqueid','CreateMemberReport'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xf46e,0xe8));var _0xef46=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf46e[_0x14add3];return _0x4a174f;};'use strict';var moment=require('moment');var _=require(_0xef46('0x0'));var util=require(_0xef46('0x1'));var client=require(_0xef46('0x2'));exports[_0xef46('0x3')]=function(_0xdc5f4e){var _0x7a18ee=_0xdc5f4e[_0xef46('0x4')]||_0xdc5f4e['queuecallerexitAt'];return client['Request']('CreateMemberReport',{'body':{'channel':'voice','membername':_0xdc5f4e[_0xef46('0x5')],'interface':_[_0xef46('0x6')](_0xdc5f4e[_0xef46('0x7')])?util[_0xef46('0x8')](_0xef46('0x9'),_0xdc5f4e[_0xef46('0x5')]):_0xdc5f4e[_0xef46('0x7')],'type':_0xef46('0xa'),'enterAt':_0xdc5f4e['queuecallerleaveAt'],'exitAt':_0x7a18ee,'duration':moment(_0x7a18ee)[_0xef46('0xb')](_0xdc5f4e[_0xef46('0xc')],_0xef46('0xd')),'data1':'inbound','data2':_0xdc5f4e[_0xef46('0xe')],'data3':_0xdc5f4e['exten'],'data4':null,'data5':_0xdc5f4e[_0xef46('0xf')],'role':'agent','internal':_0xdc5f4e['accountcode']?_[_0xef46('0x10')](_0xdc5f4e[_0xef46('0x11')]):undefined,'uniqueid':_0xdc5f4e[_0xef46('0x12')]},'log':_0xef46('0x13')});};exports[_0xef46('0x14')]=function(_0x366b14){return client[_0xef46('0x15')](_0xef46('0x13'),{'body':{'channel':_0xef46('0x16'),'membername':_0x366b14['membername'],'interface':_0x366b14['interface'],'type':'TALKING','enterAt':_0x366b14[_0xef46('0x17')],'exitAt':_0x366b14[_0xef46('0x18')],'duration':moment(_0x366b14['endtime'])[_0xef46('0xb')](_0x366b14[_0xef46('0x17')],_0xef46('0xd'))>=0x0?moment(_0x366b14[_0xef46('0x18')])[_0xef46('0xb')](_0x366b14[_0xef46('0x17')],'seconds'):null,'data1':_0xef46('0x19'),'data2':_0x366b14[_0xef46('0x11')],'data3':_0x366b14[_0xef46('0x1a')],'data4':_0x366b14['dialstring']||null,'role':_0xef46('0x1b'),'internal':_0x366b14[_0xef46('0x11')]?_['toNumber'](_0x366b14[_0xef46('0x11')]):undefined,'uniqueid':_0x366b14[_0xef46('0x12')]},'log':_0xef46('0x13')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index c2e4ee4..bb4adf6 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 _0x8c51=['previewRecallmeReminderInterval','getSettings','Request','ShowSetting','stopRecordingOnTransfer'];(function(_0x2b18d8,_0x21778e){var _0x2bcce2=function(_0xc14e4b){while(--_0xc14e4b){_0x2b18d8['push'](_0x2b18d8['shift']());}};_0x2bcce2(++_0x21778e);}(_0x8c51,0x100));var _0x18c5=function(_0xbddc74,_0x3df5be){_0xbddc74=_0xbddc74-0x0;var _0x3e1329=_0x8c51[_0xbddc74];return _0x3e1329;};'use strict';var client=require('../client');exports[_0x18c5('0x0')]=function(){return client[_0x18c5('0x1')](_0x18c5('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x18c5('0x3'),_0x18c5('0x4')]},'log':'GetSettings'});}; \ No newline at end of file +var _0x174b=['stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','../client','ShowSetting'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x174b,0x19d));var _0xb174=function(_0x5931d7,_0x2a83b9){_0x5931d7=_0x5931d7-0x0;var _0x2b49cc=_0x174b[_0x5931d7];return _0x2b49cc;};'use strict';var client=require(_0xb174('0x0'));exports['getSettings']=function(){return client['Request'](_0xb174('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xb174('0x2'),_0xb174('0x3')]},'log':_0xb174('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 5a23440..df219f0 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 _0xe78b=['../client','getTemplates','Request','GetTemplate','name','html'];(function(_0x1c759e,_0x464ccc){var _0x284153=function(_0x392942){while(--_0x392942){_0x1c759e['push'](_0x1c759e['shift']());}};_0x284153(++_0x464ccc);}(_0xe78b,0x1c2));var _0xbe78=function(_0x1f0c26,_0x365f93){_0x1f0c26=_0x1f0c26-0x0;var _0x2ebbc6=_0xe78b[_0x1f0c26];return _0x2ebbc6;};'use strict';var client=require(_0xbe78('0x0'));exports[_0xbe78('0x1')]=function(_0x52c04e){return function(_0x7ba089){return client[_0xbe78('0x2')](_0xbe78('0x3'),{'options':{'raw':!![],'attributes':['id',_0xbe78('0x4'),_0xbe78('0x5')]},'log':_0xbe78('0x3')});};}; \ No newline at end of file +var _0x3b43=['GetTemplate','../client','Request','name'];(function(_0x2067ef,_0x4e80b1){var _0x2c0666=function(_0x59b4d1){while(--_0x59b4d1){_0x2067ef['push'](_0x2067ef['shift']());}};_0x2c0666(++_0x4e80b1);}(_0x3b43,0x115));var _0x33b4=function(_0x436540,_0x463614){_0x436540=_0x436540-0x0;var _0x141149=_0x3b43[_0x436540];return _0x141149;};'use strict';var client=require(_0x33b4('0x0'));exports['getTemplates']=function(_0x556b4e){return function(_0xb43997){return client[_0x33b4('0x1')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x33b4('0x2'),'html']},'log':_0x33b4('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 61a40f0..ddd642c 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 _0xf067=['GetTrigger','name','channel','Condition','field','AnyConditions','operator','Action','Actions','action','data1','data2','data3','data5','data6','data7','getTriggers','Request'];(function(_0x314a8c,_0x1c2e8d){var _0x1d4607=function(_0x3df20c){while(--_0x3df20c){_0x314a8c['push'](_0x314a8c['shift']());}};_0x1d4607(++_0x1c2e8d);}(_0xf067,0xb2));var _0x7f06=function(_0x2474e9,_0x380525){_0x2474e9=_0x2474e9-0x0;var _0x4d09a6=_0xf067[_0x2474e9];return _0x4d09a6;};'use strict';var client=require('../client');exports[_0x7f06('0x0')]=function(_0x3d065d){return function(_0x35c912){return client[_0x7f06('0x1')](_0x7f06('0x2'),{'options':{'raw':![],'attributes':['id',_0x7f06('0x3'),_0x7f06('0x4'),'status'],'include':[{'model':_0x7f06('0x5'),'as':'AllConditions','attributes':['id',_0x7f06('0x6'),'operator','value']},{'model':'Condition','as':_0x7f06('0x7'),'attributes':['id',_0x7f06('0x6'),_0x7f06('0x8'),'value']},{'model':_0x7f06('0x9'),'as':_0x7f06('0xa'),'attributes':['id',_0x7f06('0xb'),_0x7f06('0xc'),_0x7f06('0xd'),_0x7f06('0xe'),'data4',_0x7f06('0xf'),_0x7f06('0x10'),_0x7f06('0x11')]}]},'log':_0x7f06('0x2')});};}; \ No newline at end of file +var _0x318c=['data7','../client','Request','GetTrigger','name','status','Condition','AllConditions','field','operator','AnyConditions','value','Action','Actions','data1','data4','data5'];(function(_0x1c3f7f,_0x38ad61){var _0x367e83=function(_0x1625ce){while(--_0x1625ce){_0x1c3f7f['push'](_0x1c3f7f['shift']());}};_0x367e83(++_0x38ad61);}(_0x318c,0x199));var _0xc318=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x318c[_0x1facfa];return _0x9ec701;};'use strict';var client=require(_0xc318('0x0'));exports['getTriggers']=function(_0x12752c){return function(_0x13645e){return client[_0xc318('0x1')](_0xc318('0x2'),{'options':{'raw':![],'attributes':['id',_0xc318('0x3'),'channel',_0xc318('0x4')],'include':[{'model':_0xc318('0x5'),'as':_0xc318('0x6'),'attributes':['id',_0xc318('0x7'),_0xc318('0x8'),'value']},{'model':_0xc318('0x5'),'as':_0xc318('0x9'),'attributes':['id','field',_0xc318('0x8'),_0xc318('0xa')]},{'model':_0xc318('0xb'),'as':_0xc318('0xc'),'attributes':['id','action',_0xc318('0xd'),'data2','data3',_0xc318('0xe'),_0xc318('0xf'),'data6',_0xc318('0x10')]}]},'log':_0xc318('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 871ac34..f3aa76d 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 _0x3b18=['Request','GetTrunk','registry','defaultuser'];(function(_0x2178e9,_0x30db4c){var _0x51113b=function(_0xf469aa){while(--_0xf469aa){_0x2178e9['push'](_0x2178e9['shift']());}};_0x51113b(++_0x30db4c);}(_0x3b18,0x1d4));var _0x83b1=function(_0x16387c,_0x2a5def){_0x16387c=_0x16387c-0x0;var _0x80b509=_0x3b18[_0x16387c];return _0x80b509;};'use strict';var client=require('../client');exports['getTrunks']=function(_0x51c3f9){return function(_0x3129f4){return client[_0x83b1('0x0')](_0x83b1('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x83b1('0x2'),_0x83b1('0x3')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x1acc=['defaultuser','getTrunks','Request','name','registry'];(function(_0x1b90e0,_0x128583){var _0x2a26c4=function(_0x2a6e35){while(--_0x2a6e35){_0x1b90e0['push'](_0x1b90e0['shift']());}};_0x2a26c4(++_0x128583);}(_0x1acc,0x15f));var _0xc1ac=function(_0x28e3e7,_0x9a1649){_0x28e3e7=_0x28e3e7-0x0;var _0x44d59d=_0x1acc[_0x28e3e7];return _0x44d59d;};'use strict';var client=require('../client');exports[_0xc1ac('0x0')]=function(_0x5332ea){return function(_0x33007a){return client[_0xc1ac('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xc1ac('0x2'),_0xc1ac('0x3'),_0xc1ac('0x4')]},'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 7cdafce..5839161 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['../client','getAgents','Request','GetUser','name','email','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','mobile','interface','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','lastPauseAt'];(function(_0x4e03e3,_0x121899){var _0x43459c=function(_0x414ee6){while(--_0x414ee6){_0x4e03e3['push'](_0x4e03e3['shift']());}};_0x43459c(++_0x121899);}(_0x34e8,0x12c));var _0x834e=function(_0x4eb31d,_0xfd999e){_0x4eb31d=_0x4eb31d-0x0;var _0x1d7086=_0x34e8[_0x4eb31d];return _0x1d7086;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6'),_0x834e('0x7'),_0x834e('0x8'),_0x834e('0x9'),_0x834e('0xa'),'lastPauseAt',_0x834e('0xb'),'phone',_0x834e('0xc'),_0x834e('0xd')]},'log':_0x834e('0x1')});};};exports[_0x834e('0xe')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':!![],'where':{'role':_0x834e('0xf')},'attributes':['id',_0x834e('0x4'),_0x834e('0x6'),_0x834e('0x10')]},'log':_0x834e('0xe')});};};exports[_0x834e('0x11')]=function(_0x14038b,_0x2e1a37,_0x293514){return client[_0x834e('0x2')](_0x834e('0x12'),{'body':{'type':_0x2e1a37,'uniqueid':_0x293514},'options':{'where':{'id':_0x14038b['id']}},'log':'savePause'});};exports[_0x834e('0x13')]=function(_0x6cd9b9){return client['Request'](_0x834e('0x14'),{'body':{},'options':{'where':{'id':_0x6cd9b9['id']}},'log':_0x834e('0x11')});};exports[_0x834e('0x15')]=function(_0x21cc0a){return client['Request'](_0x834e('0x16'),{'options':{'raw':![],'where':{'role':_0x834e('0x17'),'id':_0x21cc0a},'attributes':['id','name',_0x834e('0x5'),'accountcode',_0x834e('0x7'),_0x834e('0x8'),'lastLoginAt',_0x834e('0xa'),_0x834e('0x18'),_0x834e('0xb'),'interface']},'log':_0x834e('0x15')});}; \ No newline at end of file +var _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x53d980,_0x208064){var _0x5fa7d0=function(_0x202d32){while(--_0x202d32){_0x53d980['push'](_0x53d980['shift']());}};_0x5fa7d0(++_0x208064);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x424357,_0x9ebe3e){_0x424357=_0x424357-0x0;var _0x29c68e=_0xcb91[_0x424357];return _0x29c68e;};'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 341ee81..cd9d5df 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 _0x9bb2=['CreateVoiceAgentReport','UpdateVoiceAgentReport','../client','create','Request'];(function(_0x578ad9,_0x441df9){var _0x4de9db=function(_0x471abe){while(--_0x471abe){_0x578ad9['push'](_0x578ad9['shift']());}};_0x4de9db(++_0x441df9);}(_0x9bb2,0x1ba));var _0x29bb=function(_0x306324,_0x2acd6d){_0x306324=_0x306324-0x0;var _0x24785f=_0x9bb2[_0x306324];return _0x24785f;};'use strict';var client=require(_0x29bb('0x0'));exports[_0x29bb('0x1')]=function(_0x21aa56){return client[_0x29bb('0x2')]('CreateVoiceAgentReport',{'body':_0x21aa56,'log':_0x29bb('0x3')});};exports['update']=function(_0x4099d1,_0x3b0660,_0x2b841f){return client[_0x29bb('0x2')](_0x29bb('0x4'),{'body':_0x4099d1,'options':{'where':{'uniqueid':_0x3b0660,'interface':_0x2b841f,'agentcomplete':!![]}},'log':_0x29bb('0x4')});}; \ No newline at end of file +var _0x152a=['../client','create','Request','CreateVoiceAgentReport','update'];(function(_0x523a4c,_0x469596){var _0x19450d=function(_0x5de33c){while(--_0x5de33c){_0x523a4c['push'](_0x523a4c['shift']());}};_0x19450d(++_0x469596);}(_0x152a,0x9b));var _0xa152=function(_0x4bdf64,_0x3022b2){_0x4bdf64=_0x4bdf64-0x0;var _0x9a1a19=_0x152a[_0x4bdf64];return _0x9a1a19;};'use strict';var client=require(_0xa152('0x0'));exports[_0xa152('0x1')]=function(_0x29e2af){return client[_0xa152('0x2')](_0xa152('0x3'),{'body':_0x29e2af,'log':'CreateVoiceAgentReport'});};exports[_0xa152('0x4')]=function(_0x2afabe,_0x299cfb,_0x4d9adf){return client['Request']('UpdateVoiceAgentReport',{'body':_0x2afabe,'options':{'where':{'uniqueid':_0x299cfb,'interface':_0x4d9adf,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index be23347..c1cade1 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 _0xbd3a=['day','format','endOf','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','GetVoiceCallReports','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','callerid','DOCUMENTATION','GetVoiceCallReport','outbound','startOf'];(function(_0x2e1b8d,_0x4f4bb8){var _0x2711ad=function(_0x5ba1bc){while(--_0x5ba1bc){_0x2e1b8d['push'](_0x2e1b8d['shift']());}};_0x2711ad(++_0x4f4bb8);}(_0xbd3a,0xe4));var _0xabd3=function(_0x2e82f6,_0x184558){_0x2e82f6=_0x2e82f6-0x0;var _0x52cddf=_0xbd3a[_0x2e82f6];return _0x52cddf;};'use strict';var moment=require(_0xabd3('0x0'));var util=require(_0xabd3('0x1'));var _=require(_0xabd3('0x2'));var client=require(_0xabd3('0x3'));exports[_0xabd3('0x4')]=function(_0xa4d31b){return client[_0xabd3('0x5')](_0xabd3('0x6'),{'body':_[_0xabd3('0x7')](_0xa4d31b,{'source':_0xa4d31b[_0xabd3('0x8')],'destinationcontext':_0xa4d31b['context'],'callerid':_0xa4d31b[_0xabd3('0x9')],'amaflags':_0xabd3('0xa')}),'log':_0xabd3('0x6')});};exports['getVoiceCallReports']=function(){return function(){return client['Request'](_0xabd3('0xb'),{'options':{'where':{'type':[_0xabd3('0xc')],'createdAt':{'$between':[moment()[_0xabd3('0xd')](_0xabd3('0xe'))[_0xabd3('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xabd3('0x10')](_0xabd3('0xe'))[_0xabd3('0xf')](_0xabd3('0x11'))]}},'attributes':[_0xabd3('0x12'),_0xabd3('0x13'),_0xabd3('0x14'),'billableseconds']},'log':_0xabd3('0x15')});};}; \ No newline at end of file +var _0x9e1c=['disposition','duration','moment','util','lodash','../client','create','merge','calleridnum','context','callerid','DOCUMENTATION','CreateVoiceCallReport','Request','GetVoiceCallReport','outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x9e1c,0xc0));var _0xc9e1=function(_0x5eddc0,_0xa3c1f0){_0x5eddc0=_0x5eddc0-0x0;var _0x3812cf=_0x9e1c[_0x5eddc0];return _0x3812cf;};'use strict';var moment=require(_0xc9e1('0x0'));var util=require(_0xc9e1('0x1'));var _=require(_0xc9e1('0x2'));var client=require(_0xc9e1('0x3'));exports[_0xc9e1('0x4')]=function(_0x2816c0){return client['Request']('CreateVoiceCallReport',{'body':_[_0xc9e1('0x5')](_0x2816c0,{'source':_0x2816c0[_0xc9e1('0x6')],'destinationcontext':_0x2816c0[_0xc9e1('0x7')],'callerid':_0x2816c0[_0xc9e1('0x8')],'amaflags':_0xc9e1('0x9')}),'log':_0xc9e1('0xa')});};exports['getVoiceCallReports']=function(){return function(){return client[_0xc9e1('0xb')](_0xc9e1('0xc'),{'options':{'where':{'type':[_0xc9e1('0xd')],'createdAt':{'$between':[moment()[_0xc9e1('0xe')]('day')[_0xc9e1('0xf')](_0xc9e1('0x10')),moment()['endOf']('day')['format'](_0xc9e1('0x10'))]}},'attributes':['type',_0xc9e1('0x11'),_0xc9e1('0x12'),'billableseconds']},'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 b6f20c2..a2a8cfd 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 _0x51c9=['../client','create','Request'];(function(_0x502812,_0x2834e3){var _0x9fe255=function(_0x216d14){while(--_0x216d14){_0x502812['push'](_0x502812['shift']());}};_0x9fe255(++_0x2834e3);}(_0x51c9,0x1c8));var _0x951c=function(_0xe1c56d,_0x58efc8){_0xe1c56d=_0xe1c56d-0x0;var _0xeda395=_0x51c9[_0xe1c56d];return _0xeda395;};'use strict';var client=require(_0x951c('0x0'));exports[_0x951c('0x1')]=function(_0x2ac713){return client[_0x951c('0x2')]('CreateVoiceDialReport',{'body':_0x2ac713,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +var _0x9e27=['create','Request','CreateVoiceDialReport'];(function(_0x471515,_0x12a35c){var _0x4b0b3f=function(_0x4b9bf3){while(--_0x4b9bf3){_0x471515['push'](_0x471515['shift']());}};_0x4b0b3f(++_0x12a35c);}(_0x9e27,0x15f));var _0x79e2=function(_0x50e05c,_0x16834d){_0x50e05c=_0x50e05c-0x0;var _0x17b8fe=_0x9e27[_0x50e05c];return _0x17b8fe;};'use strict';var client=require('../client');exports[_0x79e2('0x0')]=function(_0x23d561){return client[_0x79e2('0x1')](_0x79e2('0x2'),{'body':_0x23d561,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 3c2f7f0..388a409 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 _0x6e16=['exten','getVoiceExtensions','Request'];(function(_0x399aac,_0x162856){var _0x2b902e=function(_0x5a7115){while(--_0x5a7115){_0x399aac['push'](_0x399aac['shift']());}};_0x2b902e(++_0x162856);}(_0x6e16,0x1d3));var _0x66e1=function(_0x1d5424,_0xfa6434){_0x1d5424=_0x1d5424-0x0;var _0x3e78c6=_0x6e16[_0x1d5424];return _0x3e78c6;};'use strict';var client=require('../client');exports['getVoiceExtensions']=function(){return function(){return client[_0x66e1('0x0')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0x66e1('0x1'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x66e1('0x2')});};}; \ No newline at end of file +var _0x6ea9=['GetVoiceExtension','exten','../client','getVoiceExtensions','Request'];(function(_0x3461f2,_0x1e93f9){var _0x59f44a=function(_0x509c86){while(--_0x509c86){_0x3461f2['push'](_0x3461f2['shift']());}};_0x59f44a(++_0x1e93f9);}(_0x6ea9,0x89));var _0x96ea=function(_0x38861e,_0x54cde9){_0x38861e=_0x38861e-0x0;var _0x47cb11=_0x6ea9[_0x38861e];return _0x47cb11;};'use strict';var client=require(_0x96ea('0x0'));exports[_0x96ea('0x1')]=function(){return function(){return client[_0x96ea('0x2')](_0x96ea('0x3'),{'options':{'raw':!![],'attributes':['id',_0x96ea('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x96ea('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index b872ddb..cfc82c3 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 _0x6c13=['dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewRecallmeReminder','Trunk','callerid','active','mandatoryDispositionPause','Interval','Intervals','interval','../client','getVoiceQueues','Request','name','autopause','monitor_format','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialOriginateCallerIdNumber','dialQueueOptions','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialTimezone','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDMinWordLength','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry'];(function(_0x4cd14a,_0x3c08b4){var _0x59ac6a=function(_0x5d95ec){while(--_0x5d95ec){_0x4cd14a['push'](_0x4cd14a['shift']());}};_0x59ac6a(++_0x3c08b4);}(_0x6c13,0xa2));var _0x36c1=function(_0x24984a,_0x10fb2d){_0x24984a=_0x24984a-0x0;var _0x405c82=_0x6c13[_0x24984a];return _0x405c82;};'use strict';var client=require(_0x36c1('0x0'));exports[_0x36c1('0x1')]=function(){return function(){return client[_0x36c1('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x36c1('0x3'),'acw','acwTimeout',_0x36c1('0x4'),_0x36c1('0x5'),'type',_0x36c1('0x6'),_0x36c1('0x7'),_0x36c1('0x8'),_0x36c1('0x9'),'dialPowerLevel',_0x36c1('0xa'),'dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName',_0x36c1('0xb'),'dialOriginateTimeout',_0x36c1('0xc'),'dialQueueTimeout','dialQueueProject',_0x36c1('0xd'),_0x36c1('0xe'),_0x36c1('0xf'),_0x36c1('0x10'),_0x36c1('0x11'),'dialNoAnswerRetryFrequency','dialGlobalMaxRetry',_0x36c1('0x12'),'dialGlobalInterval',_0x36c1('0x13'),_0x36c1('0x14'),_0x36c1('0x15'),_0x36c1('0x16'),_0x36c1('0x17'),'dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime',_0x36c1('0x18'),'dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold',_0x36c1('0x19'),'timeout',_0x36c1('0x1a'),_0x36c1('0x1b'),_0x36c1('0x1c'),_0x36c1('0x1d'),'dialAgiAfterHangupClient',_0x36c1('0x1e'),_0x36c1('0x5'),'strategy',_0x36c1('0x1f'),_0x36c1('0x20'),_0x36c1('0x21'),'dialNoSuchNumberRetryFrequency',_0x36c1('0x22'),'dialDropRetryFrequency',_0x36c1('0x23'),_0x36c1('0x24'),_0x36c1('0x25'),_0x36c1('0x26'),_0x36c1('0x27'),'dialAgentRejectRetryFrequency','mandatoryDisposition',_0x36c1('0x28'),_0x36c1('0x29'),'dialPreviewAutoRecallMe',_0x36c1('0x2a')],'include':[{'model':'Trunk','as':_0x36c1('0x2b'),'attributes':['id','name',_0x36c1('0x2c'),_0x36c1('0x2d')]},{'model':'Pause','as':_0x36c1('0x2e'),'attributes':['id','name']},{'model':'Trunk','as':'TrunkBackup','attributes':['id',_0x36c1('0x3'),'callerid',_0x36c1('0x2d')]},{'model':_0x36c1('0x2f'),'as':_0x36c1('0x2f'),'attributes':['id',_0x36c1('0x3')],'include':[{'model':'Interval','as':_0x36c1('0x30'),'attributes':['id',_0x36c1('0x3'),_0x36c1('0x31')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0xbd08=['dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','name','Pause','mandatoryDispositionPause','TrunkBackup','callerid','active','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','acw','autopause','monitor_format','type','dialActive','dialMethod','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber'];(function(_0x40562a,_0x20b06b){var _0x155787=function(_0x2d32cd){while(--_0x2d32cd){_0x40562a['push'](_0x40562a['shift']());}};_0x155787(++_0x20b06b);}(_0xbd08,0x146));var _0x8bd0=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0xbd08[_0x344a3f];return _0x264712;};'use strict';var client=require(_0x8bd0('0x0'));exports[_0x8bd0('0x1')]=function(){return function(){return client[_0x8bd0('0x2')](_0x8bd0('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x8bd0('0x4'),'acwTimeout',_0x8bd0('0x5'),_0x8bd0('0x6'),_0x8bd0('0x7'),_0x8bd0('0x8'),_0x8bd0('0x9'),'dialLimitChannel',_0x8bd0('0xa'),_0x8bd0('0xb'),_0x8bd0('0xc'),_0x8bd0('0xd'),_0x8bd0('0xe'),_0x8bd0('0xf'),_0x8bd0('0x10'),'dialOriginateTimeout','dialQueueOptions',_0x8bd0('0x11'),'dialQueueProject',_0x8bd0('0x12'),_0x8bd0('0x13'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0x8bd0('0x14'),'dialNoAnswerRetryFrequency','dialGlobalMaxRetry',_0x8bd0('0x15'),_0x8bd0('0x16'),_0x8bd0('0x17'),_0x8bd0('0x18'),_0x8bd0('0x19'),'dialAMDInitialSilence','dialAMDGreeting',_0x8bd0('0x1a'),'dialAMDTotalAnalysisTime',_0x8bd0('0x1b'),_0x8bd0('0x1c'),_0x8bd0('0x1d'),_0x8bd0('0x1e'),'dialAMDMaximumWordLength',_0x8bd0('0x1f'),_0x8bd0('0x20'),_0x8bd0('0x21'),_0x8bd0('0x22'),_0x8bd0('0x23'),_0x8bd0('0x24'),_0x8bd0('0x25'),_0x8bd0('0x6'),_0x8bd0('0x26'),_0x8bd0('0x27'),_0x8bd0('0x28'),_0x8bd0('0x29'),'dialNoSuchNumberRetryFrequency',_0x8bd0('0x2a'),_0x8bd0('0x2b'),'dialAbandonedMaxRetry',_0x8bd0('0x2c'),_0x8bd0('0x2d'),'dialMachineRetryFrequency',_0x8bd0('0x2e'),'dialAgentRejectRetryFrequency',_0x8bd0('0x2f'),_0x8bd0('0x30'),_0x8bd0('0x31'),_0x8bd0('0x32'),'dialPreviewRecallmeReminder'],'include':[{'model':'Trunk','as':_0x8bd0('0x33'),'attributes':['id',_0x8bd0('0x34'),'callerid','active']},{'model':_0x8bd0('0x35'),'as':_0x8bd0('0x36'),'attributes':['id',_0x8bd0('0x34')]},{'model':_0x8bd0('0x33'),'as':_0x8bd0('0x37'),'attributes':['id',_0x8bd0('0x34'),_0x8bd0('0x38'),_0x8bd0('0x39')]},{'model':_0x8bd0('0x3a'),'as':'Interval','attributes':['id',_0x8bd0('0x34')],'include':[{'model':_0x8bd0('0x3a'),'as':_0x8bd0('0x3b'),'attributes':['id',_0x8bd0('0x34'),_0x8bd0('0x3c')]}]}]},'log':_0x8bd0('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 0353e7f..e7ce56c 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(_0x166372,_0x135912){var _0x2d147e=function(_0x1bbb00){while(--_0x1bbb00){_0x166372['push'](_0x166372['shift']());}};_0x2d147e(++_0x135912);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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(_0x3f043b,_0x24af81){var _0x47f4f9=function(_0x7f25b7){while(--_0x7f25b7){_0x3f043b['push'](_0x3f043b['shift']());}};_0x47f4f9(++_0x24af81);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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 e2fa557..cd8a2ff 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 _0x1a6b=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x1c8937,_0x476ee1){var _0x463aa6=function(_0x152bf0){while(--_0x152bf0){_0x1c8937['push'](_0x1c8937['shift']());}};_0x463aa6(++_0x476ee1);}(_0x1a6b,0x188));var _0xb1a6=function(_0x10db52,_0x4497bf){_0x10db52=_0x10db52-0x0;var _0x30d887=_0x1a6b[_0x10db52];return _0x30d887;};'use strict';var client=require(_0xb1a6('0x0'));exports[_0xb1a6('0x1')]=function(_0x5cb239){return function(){return client[_0xb1a6('0x2')](_0xb1a6('0x3'),{'options':{'where':{'VoiceQueueId':_0x5cb239,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0xa7f7=['GetVoiceQueueRtPauses','../client','Request'];(function(_0x53d172,_0x46611b){var _0x1bd0a2=function(_0x19fb52){while(--_0x19fb52){_0x53d172['push'](_0x53d172['shift']());}};_0x1bd0a2(++_0x46611b);}(_0xa7f7,0x9d));var _0x7a7f=function(_0x374ada,_0x27b3a5){_0x374ada=_0x374ada-0x0;var _0x449ed8=_0xa7f7[_0x374ada];return _0x449ed8;};'use strict';var client=require(_0x7a7f('0x0'));exports['getVoiceQueueRtPauses']=function(_0x5b68cd){return function(){return client[_0x7a7f('0x1')](_0x7a7f('0x2'),{'options':{'where':{'VoiceQueueId':_0x5b68cd,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 912d101..f0d7174 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x1e5816,_0xbc1c3f){var _0x3faf63=function(_0x403d66){while(--_0x403d66){_0x1e5816['push'](_0x1e5816['shift']());}};_0x3faf63(++_0xbc1c3f);}(_0x7a54,0x106));var _0x47a5=function(_0x196897,_0x49df81){_0x196897=_0x196897-0x0;var _0xc69f9=_0x7a54[_0x196897];return _0xc69f9;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x18aa63,_0x3b9b7d){var _0x5be4a0=function(_0x4d7e70){while(--_0x4d7e70){_0x18aa63['push'](_0x18aa63['shift']());}};_0x5be4a0(++_0x3b9b7d);}(_0x7a54,0x106));var _0x47a5=function(_0x4e8d00,_0x49b62e){_0x4e8d00=_0x4e8d00-0x0;var _0x3c8447=_0x7a54[_0x4e8d00];return _0x3c8447;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index e556654..8f7cd44 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 _0x95c7=['origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','origtransferercontext','origtransfererexten','transfers','blindTransfer','Request','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','context','extension','CreateVoiceTransferReport','origtransferercalleridnum'];(function(_0x4102e0,_0x3217bd){var _0x112b0e=function(_0x350e3d){while(--_0x350e3d){_0x4102e0['push'](_0x4102e0['shift']());}};_0x112b0e(++_0x3217bd);}(_0x95c7,0x115));var _0x795c=function(_0x37cd44,_0x547741){_0x37cd44=_0x37cd44-0x0;var _0x5b774c=_0x95c7[_0x37cd44];return _0x5b774c;};'use strict';var client=require('../client');exports[_0x795c('0x0')]={};exports[_0x795c('0x1')]=function(_0x508e75){return client[_0x795c('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x508e75['result'],'transfererchannel':_0x508e75['transfererchannel'],'transferercalleridnum':_0x508e75[_0x795c('0x3')],'transferercalleridname':_0x508e75[_0x795c('0x4')],'transfererconnectedlinenum':_0x508e75['transfererconnectedlinenum'],'transfererconnectedlinename':_0x508e75[_0x795c('0x5')],'transfereraccountcode':_0x508e75[_0x795c('0x6')],'transferercontext':_0x508e75[_0x795c('0x7')],'transfererexten':_0x508e75['transfererexten'],'transfererlinkedid':_0x508e75['transfererlinkedid'],'transfereechannel':_0x508e75[_0x795c('0x8')],'transfereecalleridnum':_0x508e75[_0x795c('0x9')],'transfereecalleridname':_0x508e75['transfereecalleridname'],'transfereeconnectedlinenum':_0x508e75[_0x795c('0xa')],'transfereeconnectedlinename':_0x508e75[_0x795c('0xb')],'transfereeaccountcode':_0x508e75[_0x795c('0xc')],'transfereecontext':_0x508e75[_0x795c('0xd')],'transfereeexten':_0x508e75[_0x795c('0xe')],'transfereelinkedid':_0x508e75['transfereelinkedid'],'isexternal':_0x508e75[_0x795c('0xf')],'context':_0x508e75[_0x795c('0x10')],'extension':_0x508e75[_0x795c('0x11')],'type':'blind'},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x5b3a08){return client['Request'](_0x795c('0x12'),{'body':{'result':_0x5b3a08['result'],'transfererchannel':_0x5b3a08['origtransfererchannel'],'transferercalleridnum':_0x5b3a08[_0x795c('0x13')],'transferercalleridname':_0x5b3a08[_0x795c('0x14')],'transfererconnectedlinenum':_0x5b3a08['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x5b3a08[_0x795c('0x15')],'transfereraccountcode':_0x5b3a08[_0x795c('0x16')],'transferercontext':_0x5b3a08['secondtransferercontext'],'transfererexten':_0x5b3a08[_0x795c('0x17')],'transfererlinkedid':_0x5b3a08['origtransfererlinkedid'],'transfereechannel':_0x5b3a08[_0x795c('0x18')],'transfereecalleridnum':_0x5b3a08[_0x795c('0x19')],'transfereecalleridname':_0x5b3a08[_0x795c('0x1a')],'transfereeconnectedlinenum':_0x5b3a08[_0x795c('0x1b')],'transfereeconnectedlinename':_0x5b3a08[_0x795c('0x1c')],'transfereeaccountcode':_0x5b3a08['transfertargetaccountcode'],'transfereecontext':_0x5b3a08[_0x795c('0x1d')],'transfereeexten':_0x5b3a08[_0x795c('0x1e')],'transfereelinkedid':_0x5b3a08['transfertargetlinkedid'],'isexternal':_0x5b3a08[_0x795c('0xf')],'context':_0x5b3a08[_0x795c('0x1f')],'extension':_0x5b3a08[_0x795c('0x20')],'type':'attended'},'log':_0x795c('0x12')});}; \ No newline at end of file +var _0x1106=['origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','transfers','blindTransfer','Request','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','context','extension','CreateVoiceTransferReport','attendedTransfer'];(function(_0x3b81e4,_0x287ad3){var _0x48acfd=function(_0xaf6fe5){while(--_0xaf6fe5){_0x3b81e4['push'](_0x3b81e4['shift']());}};_0x48acfd(++_0x287ad3);}(_0x1106,0x100));var _0x6110=function(_0xf4a77d,_0x1ce190){_0xf4a77d=_0xf4a77d-0x0;var _0x45df14=_0x1106[_0xf4a77d];return _0x45df14;};'use strict';var client=require(_0x6110('0x0'));exports[_0x6110('0x1')]={};exports[_0x6110('0x2')]=function(_0x266aea){return client[_0x6110('0x3')]('CreateVoiceTransferReport',{'body':{'result':_0x266aea[_0x6110('0x4')],'transfererchannel':_0x266aea[_0x6110('0x5')],'transferercalleridnum':_0x266aea[_0x6110('0x6')],'transferercalleridname':_0x266aea[_0x6110('0x7')],'transfererconnectedlinenum':_0x266aea['transfererconnectedlinenum'],'transfererconnectedlinename':_0x266aea[_0x6110('0x8')],'transfereraccountcode':_0x266aea['transfereraccountcode'],'transferercontext':_0x266aea[_0x6110('0x9')],'transfererexten':_0x266aea[_0x6110('0xa')],'transfererlinkedid':_0x266aea[_0x6110('0xb')],'transfereechannel':_0x266aea[_0x6110('0xc')],'transfereecalleridnum':_0x266aea[_0x6110('0xd')],'transfereecalleridname':_0x266aea[_0x6110('0xe')],'transfereeconnectedlinenum':_0x266aea['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x266aea[_0x6110('0xf')],'transfereeaccountcode':_0x266aea[_0x6110('0x10')],'transfereecontext':_0x266aea['transfereecontext'],'transfereeexten':_0x266aea[_0x6110('0x11')],'transfereelinkedid':_0x266aea[_0x6110('0x12')],'isexternal':_0x266aea[_0x6110('0x13')],'context':_0x266aea[_0x6110('0x14')],'extension':_0x266aea[_0x6110('0x15')],'type':'blind'},'log':_0x6110('0x16')});};exports[_0x6110('0x17')]=function(_0x2dc521){return client['Request'](_0x6110('0x16'),{'body':{'result':_0x2dc521[_0x6110('0x4')],'transfererchannel':_0x2dc521['origtransfererchannel'],'transferercalleridnum':_0x2dc521['origtransferercalleridnum'],'transferercalleridname':_0x2dc521[_0x6110('0x18')],'transfererconnectedlinenum':_0x2dc521['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x2dc521[_0x6110('0x19')],'transfereraccountcode':_0x2dc521[_0x6110('0x1a')],'transferercontext':_0x2dc521[_0x6110('0x1b')],'transfererexten':_0x2dc521[_0x6110('0x1c')],'transfererlinkedid':_0x2dc521[_0x6110('0x1d')],'transfereechannel':_0x2dc521[_0x6110('0x1e')],'transfereecalleridnum':_0x2dc521['transfertargetcalleridnum'],'transfereecalleridname':_0x2dc521[_0x6110('0x1f')],'transfereeconnectedlinenum':_0x2dc521[_0x6110('0x20')],'transfereeconnectedlinename':_0x2dc521[_0x6110('0x21')],'transfereeaccountcode':_0x2dc521['transfertargetaccountcode'],'transfereecontext':_0x2dc521[_0x6110('0x22')],'transfereeexten':_0x2dc521[_0x6110('0x23')],'transfereelinkedid':_0x2dc521[_0x6110('0x24')],'isexternal':_0x2dc521[_0x6110('0x13')],'context':_0x2dc521[_0x6110('0x25')],'extension':_0x2dc521[_0x6110('0x26')],'type':_0x6110('0x27')},'log':_0x6110('0x16')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index a726450..8b8328d 100644 --- a/server/services/ami/server/index.js +++ b/server/services/ami/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','name','timers','updateAcw','agents','updateStatusRealtime','voiceStatus','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','reload','Reload','message','catch','username','command','action','Command','then','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','stop','filename','queueChannels','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','custom:','event','faxAccounts','send'];(function(_0x4e89db,_0x200e43){var _0x25279c=function(_0x3e73c2){while(--_0x3e73c2){_0x4e89db['push'](_0x4e89db['shift']());}};_0x25279c(++_0x200e43);}(_0x7a54,0x106));var _0x47a5=function(_0x26eec0,_0x25356e){_0x26eec0=_0x26eec0-0x0;var _0x4f4297=_0x7a54[_0x26eec0];return _0x4f4297;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var schema=require('validate');var moment=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var properties=require('../properties');var ami=require(_0x47a5('0x5'));var VoiceQueueSummary=require(_0x47a5('0x6'));exports[_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){return new Promise(function(_0x3d5629,_0x59199c){var _0x343372={'QueuePause':function(_0x30e405){return new Promise(function(_0x506eda){var _0x194fb0=util['format']('%s/%s','SIP',_0x30e405[_0x47a5('0x8')]);if(_0x3717e1[_0x47a5('0x9')]&&_0x3717e1['timers'][_0x194fb0]&&_0x3717e1[_0x47a5('0x9')][_0x194fb0]['timer']){_0x3717e1['timers'][_0x194fb0][_0x47a5('0xa')]();}if(_0x3717e1[_0x47a5('0xb')][_0x194fb0]){_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xc')]({'state':_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xd')],'statePause':_0x30e405[_0x47a5('0xe')]?!![]:![]});}_0x506eda({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x44bd3e){var _0x221b54=this;return new Promise(function(_0x1cf309,_0x711793){if(ami[_0x47a5('0xf')]()==![]){return _0x711793(_0x221b54[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}_0x44bd3e=_[_0x47a5('0x14')](_0x44bd3e,_[_0x47a5('0x15')](properties[_0x47a5('0x16')]['module']));_0x44bd3e['action']=_0x47a5('0x17');return ami['Action'](_0x44bd3e)['then'](function(_0x423a81){_0x1cf309({'code':0xc8,'message':_0x423a81[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x1ef371){_0x711793(_0x221b54[_0x47a5('0x10')](0x1f5,_0x1ef371[_0x47a5('0x18')]));});});},'Command':function(_0x2763d6){var _0xe3c618=this;return new Promise(function(_0x3aed38,_0x4a9fcb){if(ami[_0x47a5('0xf')]()==![]){return _0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')]['join']('\x20')));}_0x2763d6=_[_0x47a5('0x14')](_0x2763d6,_0x47a5('0x1b'));_0x2763d6[_0x47a5('0x1c')]=_0x47a5('0x1d');return ami['Action'](_0x2763d6)[_0x47a5('0x1e')](function(_0x385687){_0x3aed38({'code':0xc8,'message':_0x385687['content']});})[_0x47a5('0x19')](function(_0xc4cd63){_0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f5,_0xc4cd63[_0x47a5('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3abd6a){var _0x50bf17=[];for(var _0x53078a in _0x3717e1[_0x47a5('0x1f')]){if(_0x3717e1['voiceQueues'][_0x47a5('0x20')](_0x53078a)){var _0x5b6c4e=_0x3717e1[_0x47a5('0x1f')][_0x53078a];var _0x378208=new VoiceQueueSummary(_0x5b6c4e);_0x50bf17[_0x47a5('0x21')](_0x378208);}}_0x3abd6a({'count':_0x50bf17[_0x47a5('0x22')],'rows':_0x50bf17});});},'UpdateVoiceQueue':function(_0x21f296){return new Promise(function(_0x3ba0b7,_0x24b162){var _0x136b14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x1f')],{'id':parseInt(_0x21f296['id'])});var _0x1127f8=_[_0x47a5('0x24')](_0x21f296,['id']);if(_0x136b14){for(var _0x3ad507 in _0x1127f8){if(typeof _0x1127f8[_0x3ad507]!=='undefined'&&typeof _0x136b14[_0x3ad507]!==_0x47a5('0x25')){_0x136b14[_0x3ad507]=_0x1127f8[_0x3ad507];}}_0x3ba0b7(_0x136b14);}else{_0x24b162();}});},'VoiceChannels':function(){return new Promise(function(_0x51833b){var _0x2ef875=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x27')]);_0x51833b({'count':_0x2ef875['length'],'rows':_0x2ef875});});},'VoiceChannelMixMonitor':function(_0x256650){var _0x625952=this;return new Promise(function(_0x39b50b,_0x1f1c68){if(ami['isConnected']()==![]){return _0x1f1c68(_0x625952['error'](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],'ami\x20disconnected'][_0x47a5('0x13')]('\x20')));}var _0x51544e=schema(properties['voicechannel'])[_0x47a5('0x28')](_0x256650);if(_0x51544e['length']>0x0){return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x51544e,'message')['join'](',\x20')));}var _0x274e34=_['find'](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x256650[_0x47a5('0x2a')]});if(_0x274e34&&_0x274e34[_0x47a5('0x2b')]){var _0x52749b=util[_0x47a5('0x2c')]('%s.%s',_0x256650['filename']||_0x256650[_0x47a5('0x2a')],_0x256650['format']||_0x47a5('0x2d'));return ami['Action']({'action':_0x47a5('0x2e'),'channel':_0x274e34[_0x47a5('0x2b')],'file':_0x52749b,'options':_0x47a5('0x2f')})[_0x47a5('0x1e')](function(_0x36add5){var _0xed6320=_[_0x47a5('0x23')](_0x274e34[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52749b['toLowerCase']()});if(_[_0x47a5('0x32')](_0xed6320)){_0x274e34[_0x47a5('0x30')]['push']({'filename':_0x47a5('0x31')+_0x52749b[_0x47a5('0x33')](),'createdAt':moment()[_0x47a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x36add5[_0x47a5('0x34')],'status':_0x47a5('0x35')});}else{_0xed6320['mixmonitorid']=_0x36add5[_0x47a5('0x34')];_0xed6320[_0x47a5('0x36')]='rec';}_0x39b50b({'code':0xc8,'message':[_0x256650['uniqueid'],'MixMonitor\x20Success',_0x36add5[_0x47a5('0x34')]]['join']('\x20'),'mixmonitorid':_0x36add5[_0x47a5('0x34')]});})[_0x47a5('0x19')](function(_0x301a85){_0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,[_0x256650[_0x47a5('0x2a')],_0x301a85[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,_0x47a5('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x280500){var _0x1658e8=this;return new Promise(function(_0x23d6d8,_0x56dbbd){if(ami[_0x47a5('0xf')]()==![]){return _0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')]['join']('\x20')));}var _0x47c7a2=schema(properties['voicechannel'])['validate'](_0x280500);if(_0x47c7a2[_0x47a5('0x22')]>0x0){return _0x56dbbd(_0x1658e8['error'](0x1f4,_[_0x47a5('0x29')](_0x47c7a2,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x494526=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x280500['uniqueid']});if(_0x494526){return Promise['resolve']()[_0x47a5('0x1e')](function(){if(_0x494526['channel']){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x2b')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){if(_0x494526[_0x47a5('0x3a')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x3a')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){var _0x3574d4=_[_0x47a5('0x23')](_0x494526[_0x47a5('0x30')],{'mixmonitorid':_0x280500['mixmonitorid']});if(_0x3574d4){_0x3574d4[_0x47a5('0x36')]=_0x47a5('0x3b');}})['then'](function(){var _0x52b3a8=util[_0x47a5('0x2c')]('%s.%s',_0x280500[_0x47a5('0x3c')]||_0x280500[_0x47a5('0x2a')],_0x280500['format']||'wav');var _0x3d85cc=_['find'](_0x494526[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52b3a8[_0x47a5('0x33')]()});if(_0x3d85cc){_0x3d85cc[_0x47a5('0x36')]=_0x47a5('0x3b');}})[_0x47a5('0x1e')](function(){_0x23d6d8({'code':0xc8,'message':[_0x280500[_0x47a5('0x2a')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x47a5('0x19')](function(_0x411230){_0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f5,[_0x280500[_0x47a5('0x2a')],_0x411230[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x56dbbd(_0x1658e8['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannels':function(_0x1c9a62){var _0x5f6a=this;return new Promise(function(_0x5c3c75){var _0x12ca40=_['values'](_0x3717e1[_0x47a5('0x3d')]);var _0xe31817={'count':_0x12ca40[_0x47a5('0x22')],'rows':_0x12ca40};if(_0x1c9a62&&_0x1c9a62[_0x47a5('0x3e')]){if(!['inbound',_0x47a5('0x3f')][_0x47a5('0x40')](_0x1c9a62[_0x47a5('0x3e')])){return _0x59199c(_0x5f6a[_0x47a5('0x10')](0x190,_0x47a5('0x41')));}var _0x6a53b3=_[_0x47a5('0x42')](_0x12ca40,function(_0x481089){return _0x481089[_0x47a5('0x3e')]===_0x1c9a62[_0x47a5('0x3e')];});_0xe31817[_0x47a5('0x43')]=_0x6a53b3[_0x47a5('0x22')];_0xe31817[_0x47a5('0x44')]=_0x6a53b3;}_0x5c3c75(_0xe31817);});},'VoiceQueuesChannel':function(_0x1ab0bf){var _0x572233=this;return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581=schema(properties['voicequeuechannel'])[_0x47a5('0x28')](_0x1ab0bf);if(_0x1aa581[_0x47a5('0x22')]>0x0){return _0x245a15(_0x572233[_0x47a5('0x10')](0x1f4,_['map'](_0x1aa581,'message')[_0x47a5('0x13')](',\x20')));}var _0x376e1d=_['find'](_0x3717e1['queueChannels'],{'uniqueid':_0x1ab0bf[_0x47a5('0x2a')]});if(_0x376e1d){_0x1ad6a9(_0x376e1d);}else{return _0x245a15(_0x572233['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannelHangup':function(_0x5d383d){var _0x482de6=this;return new Promise(function(_0x389ed9,_0x46d2d3){if(ami['isConnected']()==![]){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config['asterisk']['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x867da0=schema(properties[_0x47a5('0x45')])['validate'](_0x5d383d);if(_0x867da0[_0x47a5('0x22')]>0x0){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x867da0,'message')[_0x47a5('0x13')](',\x20')));}var _0x4db625=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x5d383d[_0x47a5('0x2a')]});if(_0x4db625&&_0x4db625[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':'Hangup','channel':_0x4db625[_0x47a5('0x2b')]})['then'](function(_0x5cbe97){_0x389ed9({'code':0xc8,'message':[_0x5d383d['uniqueid'],_0x5cbe97['message'][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')});})[_0x47a5('0x19')](function(_0x52e3ee){_0x46d2d3(_0x482de6['error'](0x1f5,[_0x5d383d[_0x47a5('0x2a')],_0x52e3ee[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3474b7){var _0x519e9e=this;return new Promise(function(_0x22c886,_0x274d31){if(ami['isConnected']()==![]){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x35cca8=schema(properties[_0x47a5('0x46')])['validate'](_0x3474b7);if(_0x35cca8[_0x47a5('0x22')]>0x0){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x35cca8,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x4bbe14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x3474b7[_0x47a5('0x2a')]});if(_0x4bbe14&&_0x4bbe14[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x47'),'channel':_0x4bbe14[_0x47a5('0x2b')],'exten':_0x3474b7[_0x47a5('0x48')],'context':_0x3474b7[_0x47a5('0x49')]||_0x4bbe14[_0x47a5('0x49')],'priority':0x1})[_0x47a5('0x1e')](function(_0x44fda9){_0x22c886({'code':0xc8,'message':[_0x3474b7[_0x47a5('0x2a')],_0x44fda9[_0x47a5('0x18')][_0x47a5('0x33')]()]['join']('\x20')});})[_0x47a5('0x19')](function(_0x284fb8){_0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,[_0x3474b7['uniqueid'],_0x284fb8[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ac402){return new Promise(function(_0x522ccf){var _0x2d5ee6=_['values'](_0x3717e1[_0x47a5('0xb')]);if(_0x3ac402&&_0x3ac402['id']){var _0x4cf7c5=_[_0x47a5('0x23')](_0x2d5ee6,function(_0x2f27c3){return _0x2f27c3['id']===_0x3ac402['id'];});_0x522ccf(_0x4cf7c5);}else{_0x522ccf({'count':_0x2d5ee6[_0x47a5('0x22')],'rows':_0x2d5ee6});}});},'Telephones':function(){return new Promise(function(_0x58473b){var _0x4af557=_['values'](_0x3717e1[_0x47a5('0x4a')]);_0x58473b({'count':_0x4af557[_0x47a5('0x22')],'rows':_0x4af557});});},'Trunks':function(){return new Promise(function(_0xe3c0a7){var _0x117510=_['values'](_0x3717e1[_0x47a5('0x4b')]);_0xe3c0a7({'count':_0x117510[_0x47a5('0x22')],'rows':_0x117510});});},'OutboundChannels':function(){return new Promise(function(_0x390bc0){var _0xd5b23f=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x4c')]);_0x390bc0({'count':_0xd5b23f[_0x47a5('0x22')],'rows':_0xd5b23f});});},'Outbound':function(){return new Promise(function(_0x39939a){_0x39939a(_0x3717e1[_0x47a5('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0xc69a68){var _0x2e6fcc=_[_0x47a5('0x26')](_0x3717e1['campaigns']);_0xc69a68({'count':_0x2e6fcc[_0x47a5('0x22')],'rows':_0x2e6fcc});});},'VoiceQueuesPreview':function(_0x4833be){var _0x2ad00a=this;return new Promise(function(_0x2ac30f,_0x281e5f){_0xfdf934[_0x47a5('0x4d')](_0x4833be['id'])[_0x47a5('0x1e')](function(_0xa9c853){_0x2ac30f({'code':0xc8,'message':_0xa9c853[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x11c1db){_0x281e5f(_0x2ad00a[_0x47a5('0x10')](0x1f4,_0x11c1db[_0x47a5('0x18')]));});});},'EventManager':function(_0x1f07ac){var _0x8f0035=this;return new Promise(function(_0x2d434c,_0x441d64){if(!_0x1f07ac['event']){return _0x441d64(_0x8f0035['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x47a5('0x4e')+_0x1f07ac[_0x47a5('0x4f')],_0x1f07ac['message']);_0x2d434c({'code':0xc8,'message':_0x1f07ac});});},'FaxAccounts':function(){return new Promise(function(_0x732e00){var _0x44dda2=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x50')]);_0x732e00({'count':_0x44dda2[_0x47a5('0x22')],'rows':_0x44dda2});});},'SendFax':function(_0x930d25){var _0x218dfa=this;return new Promise(function(_0x1c7302,_0x2e9a96){_0x545a97[_0x47a5('0x51')](_0x930d25)[_0x47a5('0x1e')](function(_0x5e5f16){_0x1c7302({'code':0xc8,'message':_0x5e5f16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x420671){_0x2e9a96(_0x218dfa['error'](0x1f4,_0x420671[_0x47a5('0x18')]));});});},'CheckAfterSend':function(_0x32f393){var _0x17b61d=this;return new Promise(function(_0x5d41d8,_0x19dc8c){_0x545a97['checkAfterSend'](_0x32f393)['then'](function(_0x356e16){_0x5d41d8({'code':0xc8,'message':_0x356e16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x27333e){_0x19dc8c(_0x17b61d[_0x47a5('0x10')](0x1f4,_0x27333e[_0x47a5('0x18')]));});});}};var _0x479a82=jayson['server'](_0x343372)[_0x47a5('0x52')]();_0x479a82['on']('error',function(_0x24dbee){return _0x59199c(_0x24dbee);});_0x479a82[_0x47a5('0x7')](0x232a,_0x47a5('0x53'),function(){console[_0x47a5('0x54')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d5629(_0x47a5('0x55')+0x232a);});});}; \ No newline at end of file +var _0x7a54=['http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','moment','../../../config/environment','../ami','../model/voiceQueueSummary','listen','name','timers','updateAcw','agents','updateStatusRealtime','voiceStatus','pause','isConnected','error','asterisk','ami\x20disconnected','join','pick','keys','reload','Reload','message','catch','username','command','action','Command','then','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','channels','validate','map','uniqueid','channel','format','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','isNil','toLowerCase','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','Action','StopMixMonitor','destinationchannel','stop','filename','queueChannels','type','outbound','includes','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','run','custom:','event','faxAccounts','send'];(function(_0x3ef88e,_0x54e4a6){var _0xcb5dd4=function(_0x278b20){while(--_0x278b20){_0x3ef88e['push'](_0x3ef88e['shift']());}};_0xcb5dd4(++_0x54e4a6);}(_0x7a54,0x106));var _0x47a5=function(_0x1a7ce8,_0xd46fdb){_0x1a7ce8=_0x1a7ce8-0x0;var _0x85ca91=_0x7a54[_0x1a7ce8];return _0x85ca91;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var jayson=require(_0x47a5('0x2'));var schema=require('validate');var moment=require(_0x47a5('0x3'));var config=require(_0x47a5('0x4'));var properties=require('../properties');var ami=require(_0x47a5('0x5'));var VoiceQueueSummary=require(_0x47a5('0x6'));exports[_0x47a5('0x7')]=function(_0x3717e1,_0xfdf934,_0x545a97){return new Promise(function(_0x3d5629,_0x59199c){var _0x343372={'QueuePause':function(_0x30e405){return new Promise(function(_0x506eda){var _0x194fb0=util['format']('%s/%s','SIP',_0x30e405[_0x47a5('0x8')]);if(_0x3717e1[_0x47a5('0x9')]&&_0x3717e1['timers'][_0x194fb0]&&_0x3717e1[_0x47a5('0x9')][_0x194fb0]['timer']){_0x3717e1['timers'][_0x194fb0][_0x47a5('0xa')]();}if(_0x3717e1[_0x47a5('0xb')][_0x194fb0]){_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xc')]({'state':_0x3717e1[_0x47a5('0xb')][_0x194fb0][_0x47a5('0xd')],'statePause':_0x30e405[_0x47a5('0xe')]?!![]:![]});}_0x506eda({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x44bd3e){var _0x221b54=this;return new Promise(function(_0x1cf309,_0x711793){if(ami[_0x47a5('0xf')]()==![]){return _0x711793(_0x221b54[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}_0x44bd3e=_[_0x47a5('0x14')](_0x44bd3e,_[_0x47a5('0x15')](properties[_0x47a5('0x16')]['module']));_0x44bd3e['action']=_0x47a5('0x17');return ami['Action'](_0x44bd3e)['then'](function(_0x423a81){_0x1cf309({'code':0xc8,'message':_0x423a81[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x1ef371){_0x711793(_0x221b54[_0x47a5('0x10')](0x1f5,_0x1ef371[_0x47a5('0x18')]));});});},'Command':function(_0x2763d6){var _0xe3c618=this;return new Promise(function(_0x3aed38,_0x4a9fcb){if(ami[_0x47a5('0xf')]()==![]){return _0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')]['join']('\x20')));}_0x2763d6=_[_0x47a5('0x14')](_0x2763d6,_0x47a5('0x1b'));_0x2763d6[_0x47a5('0x1c')]=_0x47a5('0x1d');return ami['Action'](_0x2763d6)[_0x47a5('0x1e')](function(_0x385687){_0x3aed38({'code':0xc8,'message':_0x385687['content']});})[_0x47a5('0x19')](function(_0xc4cd63){_0x4a9fcb(_0xe3c618[_0x47a5('0x10')](0x1f5,_0xc4cd63[_0x47a5('0x18')]));});});},'VoiceQueues':function(){return new Promise(function(_0x3abd6a){var _0x50bf17=[];for(var _0x53078a in _0x3717e1[_0x47a5('0x1f')]){if(_0x3717e1['voiceQueues'][_0x47a5('0x20')](_0x53078a)){var _0x5b6c4e=_0x3717e1[_0x47a5('0x1f')][_0x53078a];var _0x378208=new VoiceQueueSummary(_0x5b6c4e);_0x50bf17[_0x47a5('0x21')](_0x378208);}}_0x3abd6a({'count':_0x50bf17[_0x47a5('0x22')],'rows':_0x50bf17});});},'UpdateVoiceQueue':function(_0x21f296){return new Promise(function(_0x3ba0b7,_0x24b162){var _0x136b14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x1f')],{'id':parseInt(_0x21f296['id'])});var _0x1127f8=_[_0x47a5('0x24')](_0x21f296,['id']);if(_0x136b14){for(var _0x3ad507 in _0x1127f8){if(typeof _0x1127f8[_0x3ad507]!=='undefined'&&typeof _0x136b14[_0x3ad507]!==_0x47a5('0x25')){_0x136b14[_0x3ad507]=_0x1127f8[_0x3ad507];}}_0x3ba0b7(_0x136b14);}else{_0x24b162();}});},'VoiceChannels':function(){return new Promise(function(_0x51833b){var _0x2ef875=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x27')]);_0x51833b({'count':_0x2ef875['length'],'rows':_0x2ef875});});},'VoiceChannelMixMonitor':function(_0x256650){var _0x625952=this;return new Promise(function(_0x39b50b,_0x1f1c68){if(ami['isConnected']()==![]){return _0x1f1c68(_0x625952['error'](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],'ami\x20disconnected'][_0x47a5('0x13')]('\x20')));}var _0x51544e=schema(properties['voicechannel'])[_0x47a5('0x28')](_0x256650);if(_0x51544e['length']>0x0){return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x51544e,'message')['join'](',\x20')));}var _0x274e34=_['find'](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x256650[_0x47a5('0x2a')]});if(_0x274e34&&_0x274e34[_0x47a5('0x2b')]){var _0x52749b=util[_0x47a5('0x2c')]('%s.%s',_0x256650['filename']||_0x256650[_0x47a5('0x2a')],_0x256650['format']||_0x47a5('0x2d'));return ami['Action']({'action':_0x47a5('0x2e'),'channel':_0x274e34[_0x47a5('0x2b')],'file':_0x52749b,'options':_0x47a5('0x2f')})[_0x47a5('0x1e')](function(_0x36add5){var _0xed6320=_[_0x47a5('0x23')](_0x274e34[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52749b['toLowerCase']()});if(_[_0x47a5('0x32')](_0xed6320)){_0x274e34[_0x47a5('0x30')]['push']({'filename':_0x47a5('0x31')+_0x52749b[_0x47a5('0x33')](),'createdAt':moment()[_0x47a5('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x36add5[_0x47a5('0x34')],'status':_0x47a5('0x35')});}else{_0xed6320['mixmonitorid']=_0x36add5[_0x47a5('0x34')];_0xed6320[_0x47a5('0x36')]='rec';}_0x39b50b({'code':0xc8,'message':[_0x256650['uniqueid'],'MixMonitor\x20Success',_0x36add5[_0x47a5('0x34')]]['join']('\x20'),'mixmonitorid':_0x36add5[_0x47a5('0x34')]});})[_0x47a5('0x19')](function(_0x301a85){_0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,[_0x256650[_0x47a5('0x2a')],_0x301a85[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x1f1c68(_0x625952[_0x47a5('0x10')](0x1f5,_0x47a5('0x37')));}});},'VoiceChannelStopMixMonitor':function(_0x280500){var _0x1658e8=this;return new Promise(function(_0x23d6d8,_0x56dbbd){if(ami[_0x47a5('0xf')]()==![]){return _0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')]['username'],_0x47a5('0x12')]['join']('\x20')));}var _0x47c7a2=schema(properties['voicechannel'])['validate'](_0x280500);if(_0x47c7a2[_0x47a5('0x22')]>0x0){return _0x56dbbd(_0x1658e8['error'](0x1f4,_[_0x47a5('0x29')](_0x47c7a2,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x494526=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x27')],{'uniqueid':_0x280500['uniqueid']});if(_0x494526){return Promise['resolve']()[_0x47a5('0x1e')](function(){if(_0x494526['channel']){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x2b')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){if(_0x494526[_0x47a5('0x3a')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x39'),'channel':_0x494526[_0x47a5('0x3a')],'mixmonitorid':_0x280500[_0x47a5('0x34')]})[_0x47a5('0x19')](function(){});}})[_0x47a5('0x1e')](function(){var _0x3574d4=_[_0x47a5('0x23')](_0x494526[_0x47a5('0x30')],{'mixmonitorid':_0x280500['mixmonitorid']});if(_0x3574d4){_0x3574d4[_0x47a5('0x36')]=_0x47a5('0x3b');}})['then'](function(){var _0x52b3a8=util[_0x47a5('0x2c')]('%s.%s',_0x280500[_0x47a5('0x3c')]||_0x280500[_0x47a5('0x2a')],_0x280500['format']||'wav');var _0x3d85cc=_['find'](_0x494526[_0x47a5('0x30')],{'filename':_0x47a5('0x31')+_0x52b3a8[_0x47a5('0x33')]()});if(_0x3d85cc){_0x3d85cc[_0x47a5('0x36')]=_0x47a5('0x3b');}})[_0x47a5('0x1e')](function(){_0x23d6d8({'code':0xc8,'message':[_0x280500[_0x47a5('0x2a')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0x47a5('0x19')](function(_0x411230){_0x56dbbd(_0x1658e8[_0x47a5('0x10')](0x1f5,[_0x280500[_0x47a5('0x2a')],_0x411230[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x56dbbd(_0x1658e8['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannels':function(_0x1c9a62){var _0x5f6a=this;return new Promise(function(_0x5c3c75){var _0x12ca40=_['values'](_0x3717e1[_0x47a5('0x3d')]);var _0xe31817={'count':_0x12ca40[_0x47a5('0x22')],'rows':_0x12ca40};if(_0x1c9a62&&_0x1c9a62[_0x47a5('0x3e')]){if(!['inbound',_0x47a5('0x3f')][_0x47a5('0x40')](_0x1c9a62[_0x47a5('0x3e')])){return _0x59199c(_0x5f6a[_0x47a5('0x10')](0x190,_0x47a5('0x41')));}var _0x6a53b3=_[_0x47a5('0x42')](_0x12ca40,function(_0x481089){return _0x481089[_0x47a5('0x3e')]===_0x1c9a62[_0x47a5('0x3e')];});_0xe31817[_0x47a5('0x43')]=_0x6a53b3[_0x47a5('0x22')];_0xe31817[_0x47a5('0x44')]=_0x6a53b3;}_0x5c3c75(_0xe31817);});},'VoiceQueuesChannel':function(_0x1ab0bf){var _0x572233=this;return new Promise(function(_0x1ad6a9,_0x245a15){var _0x1aa581=schema(properties['voicequeuechannel'])[_0x47a5('0x28')](_0x1ab0bf);if(_0x1aa581[_0x47a5('0x22')]>0x0){return _0x245a15(_0x572233[_0x47a5('0x10')](0x1f4,_['map'](_0x1aa581,'message')[_0x47a5('0x13')](',\x20')));}var _0x376e1d=_['find'](_0x3717e1['queueChannels'],{'uniqueid':_0x1ab0bf[_0x47a5('0x2a')]});if(_0x376e1d){_0x1ad6a9(_0x376e1d);}else{return _0x245a15(_0x572233['error'](0x1f5,_0x47a5('0x37')));}});},'VoiceQueuesChannelHangup':function(_0x5d383d){var _0x482de6=this;return new Promise(function(_0x389ed9,_0x46d2d3){if(ami['isConnected']()==![]){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config['asterisk']['username'],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x867da0=schema(properties[_0x47a5('0x45')])['validate'](_0x5d383d);if(_0x867da0[_0x47a5('0x22')]>0x0){return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x867da0,'message')[_0x47a5('0x13')](',\x20')));}var _0x4db625=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x5d383d[_0x47a5('0x2a')]});if(_0x4db625&&_0x4db625[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':'Hangup','channel':_0x4db625[_0x47a5('0x2b')]})['then'](function(_0x5cbe97){_0x389ed9({'code':0xc8,'message':[_0x5d383d['uniqueid'],_0x5cbe97['message'][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')});})[_0x47a5('0x19')](function(_0x52e3ee){_0x46d2d3(_0x482de6['error'](0x1f5,[_0x5d383d[_0x47a5('0x2a')],_0x52e3ee[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x46d2d3(_0x482de6[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3474b7){var _0x519e9e=this;return new Promise(function(_0x22c886,_0x274d31){if(ami['isConnected']()==![]){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,[config[_0x47a5('0x11')]['ip'],config[_0x47a5('0x11')][_0x47a5('0x1a')],_0x47a5('0x12')][_0x47a5('0x13')]('\x20')));}var _0x35cca8=schema(properties[_0x47a5('0x46')])['validate'](_0x3474b7);if(_0x35cca8[_0x47a5('0x22')]>0x0){return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f4,_[_0x47a5('0x29')](_0x35cca8,_0x47a5('0x18'))[_0x47a5('0x13')](',\x20')));}var _0x4bbe14=_[_0x47a5('0x23')](_0x3717e1[_0x47a5('0x3d')],{'uniqueid':_0x3474b7[_0x47a5('0x2a')]});if(_0x4bbe14&&_0x4bbe14[_0x47a5('0x2b')]){return ami[_0x47a5('0x38')]({'action':_0x47a5('0x47'),'channel':_0x4bbe14[_0x47a5('0x2b')],'exten':_0x3474b7[_0x47a5('0x48')],'context':_0x3474b7[_0x47a5('0x49')]||_0x4bbe14[_0x47a5('0x49')],'priority':0x1})[_0x47a5('0x1e')](function(_0x44fda9){_0x22c886({'code':0xc8,'message':[_0x3474b7[_0x47a5('0x2a')],_0x44fda9[_0x47a5('0x18')][_0x47a5('0x33')]()]['join']('\x20')});})[_0x47a5('0x19')](function(_0x284fb8){_0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,[_0x3474b7['uniqueid'],_0x284fb8[_0x47a5('0x18')][_0x47a5('0x33')]()][_0x47a5('0x13')]('\x20')));});}else{return _0x274d31(_0x519e9e[_0x47a5('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x3ac402){return new Promise(function(_0x522ccf){var _0x2d5ee6=_['values'](_0x3717e1[_0x47a5('0xb')]);if(_0x3ac402&&_0x3ac402['id']){var _0x4cf7c5=_[_0x47a5('0x23')](_0x2d5ee6,function(_0x2f27c3){return _0x2f27c3['id']===_0x3ac402['id'];});_0x522ccf(_0x4cf7c5);}else{_0x522ccf({'count':_0x2d5ee6[_0x47a5('0x22')],'rows':_0x2d5ee6});}});},'Telephones':function(){return new Promise(function(_0x58473b){var _0x4af557=_['values'](_0x3717e1[_0x47a5('0x4a')]);_0x58473b({'count':_0x4af557[_0x47a5('0x22')],'rows':_0x4af557});});},'Trunks':function(){return new Promise(function(_0xe3c0a7){var _0x117510=_['values'](_0x3717e1[_0x47a5('0x4b')]);_0xe3c0a7({'count':_0x117510[_0x47a5('0x22')],'rows':_0x117510});});},'OutboundChannels':function(){return new Promise(function(_0x390bc0){var _0xd5b23f=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x4c')]);_0x390bc0({'count':_0xd5b23f[_0x47a5('0x22')],'rows':_0xd5b23f});});},'Outbound':function(){return new Promise(function(_0x39939a){_0x39939a(_0x3717e1[_0x47a5('0x3f')]);});},'Campaigns':function(){return new Promise(function(_0xc69a68){var _0x2e6fcc=_[_0x47a5('0x26')](_0x3717e1['campaigns']);_0xc69a68({'count':_0x2e6fcc[_0x47a5('0x22')],'rows':_0x2e6fcc});});},'VoiceQueuesPreview':function(_0x4833be){var _0x2ad00a=this;return new Promise(function(_0x2ac30f,_0x281e5f){_0xfdf934[_0x47a5('0x4d')](_0x4833be['id'])[_0x47a5('0x1e')](function(_0xa9c853){_0x2ac30f({'code':0xc8,'message':_0xa9c853[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x11c1db){_0x281e5f(_0x2ad00a[_0x47a5('0x10')](0x1f4,_0x11c1db[_0x47a5('0x18')]));});});},'EventManager':function(_0x1f07ac){var _0x8f0035=this;return new Promise(function(_0x2d434c,_0x441d64){if(!_0x1f07ac['event']){return _0x441d64(_0x8f0035['error'](0x1f4,'Event\x20name\x20mandatory'));}ami['emit'](_0x47a5('0x4e')+_0x1f07ac[_0x47a5('0x4f')],_0x1f07ac['message']);_0x2d434c({'code':0xc8,'message':_0x1f07ac});});},'FaxAccounts':function(){return new Promise(function(_0x732e00){var _0x44dda2=_[_0x47a5('0x26')](_0x3717e1[_0x47a5('0x50')]);_0x732e00({'count':_0x44dda2[_0x47a5('0x22')],'rows':_0x44dda2});});},'SendFax':function(_0x930d25){var _0x218dfa=this;return new Promise(function(_0x1c7302,_0x2e9a96){_0x545a97[_0x47a5('0x51')](_0x930d25)[_0x47a5('0x1e')](function(_0x5e5f16){_0x1c7302({'code':0xc8,'message':_0x5e5f16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x420671){_0x2e9a96(_0x218dfa['error'](0x1f4,_0x420671[_0x47a5('0x18')]));});});},'CheckAfterSend':function(_0x32f393){var _0x17b61d=this;return new Promise(function(_0x5d41d8,_0x19dc8c){_0x545a97['checkAfterSend'](_0x32f393)['then'](function(_0x356e16){_0x5d41d8({'code':0xc8,'message':_0x356e16[_0x47a5('0x18')]});})[_0x47a5('0x19')](function(_0x27333e){_0x19dc8c(_0x17b61d[_0x47a5('0x10')](0x1f4,_0x27333e[_0x47a5('0x18')]));});});}};var _0x479a82=jayson['server'](_0x343372)[_0x47a5('0x52')]();_0x479a82['on']('error',function(_0x24dbee){return _0x59199c(_0x24dbee);});_0x479a82[_0x47a5('0x7')](0x232a,_0x47a5('0x53'),function(){console[_0x47a5('0x54')]('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x3d5629(_0x47a5('0x55')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index e2f6d71..a832063 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 _0x5ff0=['[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','destcalleridname','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','Unknown','format','user:%s','name','trigger:%s','lodash','bluebird','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','stringify','emit','data1','data2','isNil','data5','xmd-contactid','ListId','data3','routeId','destcalleridnum','calleridnum','firstName','phone','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','length','uniqueid','join'];(function(_0x16a946,_0x5bdc4e){var _0x46418a=function(_0x5154fc){while(--_0x5154fc){_0x16a946['push'](_0x16a946['shift']());}};_0x46418a(++_0x5bdc4e);}(_0x5ff0,0xad));var _0x05ff=function(_0x2c3b81,_0x4090f6){_0x2c3b81=_0x2c3b81-0x0;var _0x265d1a=_0x5ff0[_0x2c3b81];return _0x265d1a;};'use strict';var _=require(_0x05ff('0x0'));var BPromise=require(_0x05ff('0x1'));var Redis=require(_0x05ff('0x2'));var util=require(_0x05ff('0x3'));var config=require(_0x05ff('0x4'));var logger=require('../../../../config/logger')(_0x05ff('0x5'));var cmContactRpc=require(_0x05ff('0x6'));config[_0x05ff('0x7')]=_[_0x05ff('0x8')](config[_0x05ff('0x7')],{'host':_0x05ff('0x9'),'port':0x18eb});var io=require(_0x05ff('0xa'))(new Redis(config[_0x05ff('0x7')]));function emit(_0x2b7fd8,_0x565dd5,_0x46eab9,_0x783754,_0x5f3e1a){logger[_0x05ff('0xb')]('[CM][%s][%s]',_0x2b7fd8,_0x565dd5['id'],_0x46eab9,_0x783754,JSON[_0x05ff('0xc')](_0x5f3e1a));io['to'](_0x46eab9)[_0x05ff('0xd')](_0x783754,_0x5f3e1a);}exports['exec']=function(_0xa68313,_0x5de34f,_0x3a9239,_0x450531){var _0x53f528,_0x1919f3;var _0x4ad35f={};var _0x48c409;var _0x5b8b1a=Number(_0x3a9239[_0x05ff('0xe')]);var _0x5f1066=_0x3a9239[_0x05ff('0xf')]?Boolean(Number(_0x3a9239[_0x05ff('0xf')])):![];var _0xf08782;var _0x449ac3=![];if(!_[_0x05ff('0x10')](_0x3a9239[_0x05ff('0x11')])){if(_0x3a9239[_0x05ff('0x11')]=='1')_0x449ac3=!![];}if(!_0x449ac3){if(_0x450531['xmd-contactid']){_0x4ad35f['id']=_0x450531[_0x05ff('0x12')];}}if(!_0x4ad35f['id']){_0x4ad35f[_0x05ff('0x13')]=_0x5b8b1a;_0xf08782=_0x3a9239[_0x05ff('0x14')]&&_0x3a9239['data3']!=='0'?_0x3a9239[_0x05ff('0x14')]['split'](','):['phone'];_0x4ad35f['$or']=_['map'](_0xf08782,function(_0x3a4d1b){var _0x5a8a7d={};_0x5a8a7d[_0x3a4d1b]=_0x450531[_0x05ff('0x15')]?_0x450531[_0x05ff('0x16')]:_0x450531[_0x05ff('0x17')];return _0x5a8a7d;});_0x48c409=_0x450531['routeId']?_0x450531['destcalleridnum']:_0x450531['calleridnum'];}var _0xbe482e=['id',_0x05ff('0x18'),'lastName',_0x05ff('0x19'),_0x05ff('0x1a'),_0x05ff('0x1b'),_0x05ff('0x13'),_0x05ff('0x1c'),_0x05ff('0x1d'),_0x05ff('0x1e')];var _0xa018fb=_[_0x05ff('0x1f')](_0xbe482e,_0xf08782);BPromise[_0x05ff('0x20')]()[_0x05ff('0x21')](cmContactRpc[_0x05ff('0x22')]({'attributes':_0xa018fb,'where':_0x4ad35f,'phone':_0x48c409}))[_0x05ff('0x21')](function(_0x538b80){_0x1919f3=_0x538b80;if(!_[_0x05ff('0x23')](_0x1919f3)){if(_0x1919f3[_0x05ff('0x24')]===0x1){_0x53f528=_0x1919f3[0x0];logger[_0x05ff('0xb')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x450531[_0x05ff('0x25')],_0x5de34f['id'],_0x53f528['id']);}else{logger[_0x05ff('0xb')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x450531[_0x05ff('0x25')],_0x5de34f['id'],_['map'](_0x1919f3,'id')[_0x05ff('0x26')](','));}return;}else{logger[_0x05ff('0xb')](_0x05ff('0x27'),_0x450531['uniqueid'],_0x5de34f['id']);var _0x473e30={'ListId':_0x5b8b1a};var _0x4f10c1=_0x3a9239[_0x05ff('0x28')]&&_0x3a9239[_0x05ff('0x28')]!=='0'?_0x3a9239['data4']:_0x05ff('0x19');if(_0x5f1066){logger[_0x05ff('0xb')](_0x05ff('0x29'),_0x450531[_0x05ff('0x25')],_0x5de34f['id']);_0x473e30[_0x4f10c1]=_[_0x05ff('0x10')](_0x450531['routeId'])?_0x450531[_0x05ff('0x17')]:_0x450531[_0x05ff('0x16')];if(_['isNil'](_0x450531[_0x05ff('0x15')])){_0x473e30[_0x05ff('0x18')]=_0x450531[_0x05ff('0x2a')]&&_0x450531['calleridname']!==_0x05ff('0x2b')?_0x450531[_0x05ff('0x2a')]:'Unknown';}else{_0x473e30['firstName']=_0x450531[_0x05ff('0x2c')]&&_0x450531[_0x05ff('0x2c')]!==_0x05ff('0x2b')?_0x450531['destcalleridname']:'Unknown';}return BPromise[_0x05ff('0x20')]()[_0x05ff('0x21')](cmContactRpc[_0x05ff('0x2d')](_0x473e30))[_0x05ff('0x21')](function(_0x1c0765){_0x53f528=_0x1c0765;_0x1919f3[_0x05ff('0x2e')](_0x1c0765);if(_0x53f528){logger[_0x05ff('0xb')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x450531[_0x05ff('0x25')],_0x5de34f['id'],_0x53f528['id']);}return;});}else{logger[_0x05ff('0xb')](_0x05ff('0x2f'),_0x450531[_0x05ff('0x25')],_0x5de34f['id']);_0x473e30[_0x4f10c1]=_[_0x05ff('0x10')](_0x450531['routeId'])?_0x450531[_0x05ff('0x17')]:_0x450531['destcalleridnum'];if(_[_0x05ff('0x10')](_0x450531[_0x05ff('0x15')])){_0x473e30[_0x05ff('0x18')]=_0x450531[_0x05ff('0x2a')]&&_0x450531['calleridname']!==_0x05ff('0x2b')?_0x450531[_0x05ff('0x2a')]:_0x05ff('0x30');}else{_0x473e30[_0x05ff('0x18')]=_0x450531[_0x05ff('0x2c')]&&_0x450531[_0x05ff('0x2c')]!==_0x05ff('0x2b')?_0x450531['destcalleridname']:_0x05ff('0x30');}_0x53f528=_0x473e30;_0x1919f3[_0x05ff('0x2e')](_0x473e30);return;}}})[_0x05ff('0x21')](function(){if(_0xa68313){emit(_0x450531['uniqueid'],_0x5de34f,util[_0x05ff('0x31')](_0x05ff('0x32'),_0xa68313[_0x05ff('0x33')]),util[_0x05ff('0x31')](_0x05ff('0x34'),_0x3a9239['action']['toLowerCase']()),{'evt':_['merge'](_0x450531,{'autoCreate':_0x5f1066}),'contact':_0x53f528===undefined?{}:_0x53f528,'contacts':_0x1919f3[_0x05ff('0x24')]===0x0?undefined:_0x1919f3});}});}; \ No newline at end of file +var _0xb44a=['phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','mobile','scheduledAt','updatedAt','union','then','getContacts','isEmpty','length','uniqueid','join','data4','isNil','calleridname','Unknown','destcalleridname','','resolve','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','user:%s','name','format','trigger:%s','toLowerCase','merge','ioredis','../../../../config/environment','../../rpc/cmContact','defaults','redis','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','exec','data1','data2','data5','xmd-contactid','ListId','data3','split'];(function(_0x3d59fb,_0x4ead73){var _0xd93df1=function(_0x42c2fa){while(--_0x42c2fa){_0x3d59fb['push'](_0x3d59fb['shift']());}};_0xd93df1(++_0x4ead73);}(_0xb44a,0x1c2));var _0xab44=function(_0x2e7c1b,_0x232f79){_0x2e7c1b=_0x2e7c1b-0x0;var _0x42f565=_0xb44a[_0x2e7c1b];return _0x42f565;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require(_0xab44('0x0'));var util=require('util');var config=require(_0xab44('0x1'));var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require(_0xab44('0x2'));config['redis']=_[_0xab44('0x3')](config[_0xab44('0x4')],{'host':_0xab44('0x5'),'port':0x18eb});var io=require(_0xab44('0x6'))(new Redis(config[_0xab44('0x4')]));function emit(_0x3303b1,_0x3ead8d,_0x495825,_0x137a8c,_0x133a6d){logger[_0xab44('0x7')](_0xab44('0x8'),_0x3303b1,_0x3ead8d['id'],_0x495825,_0x137a8c,JSON[_0xab44('0x9')](_0x133a6d));io['to'](_0x495825)['emit'](_0x137a8c,_0x133a6d);}exports[_0xab44('0xa')]=function(_0x500a9f,_0x15e64e,_0x5168fa,_0x4a4e69){var _0x39b2d1,_0x6746cc;var _0x599fc9={};var _0x34ca94;var _0x2208fb=Number(_0x5168fa[_0xab44('0xb')]);var _0x52d282=_0x5168fa['data2']?Boolean(Number(_0x5168fa[_0xab44('0xc')])):![];var _0x478b7e;var _0x15db10=![];if(!_['isNil'](_0x5168fa[_0xab44('0xd')])){if(_0x5168fa[_0xab44('0xd')]=='1')_0x15db10=!![];}if(!_0x15db10){if(_0x4a4e69[_0xab44('0xe')]){_0x599fc9['id']=_0x4a4e69[_0xab44('0xe')];}}if(!_0x599fc9['id']){_0x599fc9[_0xab44('0xf')]=_0x2208fb;_0x478b7e=_0x5168fa[_0xab44('0x10')]&&_0x5168fa['data3']!=='0'?_0x5168fa['data3'][_0xab44('0x11')](','):[_0xab44('0x12')];_0x599fc9[_0xab44('0x13')]=_[_0xab44('0x14')](_0x478b7e,function(_0xffdfbc){var _0x5fd6a1={};_0x5fd6a1[_0xffdfbc]=_0x4a4e69[_0xab44('0x15')]?_0x4a4e69[_0xab44('0x16')]:_0x4a4e69[_0xab44('0x17')];return _0x5fd6a1;});_0x34ca94=_0x4a4e69[_0xab44('0x15')]?_0x4a4e69[_0xab44('0x16')]:_0x4a4e69['calleridnum'];}var _0xb779bb=['id',_0xab44('0x18'),_0xab44('0x19'),_0xab44('0x12'),_0xab44('0x1a'),'fax',_0xab44('0xf'),'createdAt',_0xab44('0x1b'),_0xab44('0x1c')];var _0x193b66=_[_0xab44('0x1d')](_0xb779bb,_0x478b7e);BPromise['resolve']()[_0xab44('0x1e')](cmContactRpc[_0xab44('0x1f')]({'attributes':_0x193b66,'where':_0x599fc9,'phone':_0x34ca94}))[_0xab44('0x1e')](function(_0x3b17d5){_0x6746cc=_0x3b17d5;if(!_[_0xab44('0x20')](_0x6746cc)){if(_0x6746cc[_0xab44('0x21')]===0x1){_0x39b2d1=_0x6746cc[0x0];logger[_0xab44('0x7')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x4a4e69['uniqueid'],_0x15e64e['id'],_0x39b2d1['id']);}else{logger[_0xab44('0x7')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x4a4e69[_0xab44('0x22')],_0x15e64e['id'],_['map'](_0x6746cc,'id')[_0xab44('0x23')](','));}return;}else{logger['info']('[CM][%s][%s]\x20Contact\x20not\x20found',_0x4a4e69[_0xab44('0x22')],_0x15e64e['id']);var _0x25287b={'ListId':_0x2208fb};var _0x259192=_0x5168fa[_0xab44('0x24')]&&_0x5168fa[_0xab44('0x24')]!=='0'?_0x5168fa['data4']:_0xab44('0x12');if(_0x52d282){logger[_0xab44('0x7')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0x4a4e69[_0xab44('0x22')],_0x15e64e['id']);_0x25287b[_0x259192]=_[_0xab44('0x25')](_0x4a4e69[_0xab44('0x15')])?_0x4a4e69[_0xab44('0x17')]:_0x4a4e69[_0xab44('0x16')];if(_[_0xab44('0x25')](_0x4a4e69['routeId'])){_0x25287b[_0xab44('0x18')]=_0x4a4e69[_0xab44('0x26')]&&_0x4a4e69[_0xab44('0x26')]!==''?_0x4a4e69['calleridname']:_0xab44('0x27');}else{_0x25287b['firstName']=_0x4a4e69['destcalleridname']&&_0x4a4e69[_0xab44('0x28')]!==_0xab44('0x29')?_0x4a4e69[_0xab44('0x28')]:_0xab44('0x27');}return BPromise[_0xab44('0x2a')]()[_0xab44('0x1e')](cmContactRpc[_0xab44('0x2b')](_0x25287b))[_0xab44('0x1e')](function(_0x9d1950){_0x39b2d1=_0x9d1950;_0x6746cc[_0xab44('0x2c')](_0x9d1950);if(_0x39b2d1){logger[_0xab44('0x7')](_0xab44('0x2d'),_0x4a4e69[_0xab44('0x22')],_0x15e64e['id'],_0x39b2d1['id']);}return;});}else{logger[_0xab44('0x7')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x4a4e69['uniqueid'],_0x15e64e['id']);_0x25287b[_0x259192]=_[_0xab44('0x25')](_0x4a4e69[_0xab44('0x15')])?_0x4a4e69['calleridnum']:_0x4a4e69[_0xab44('0x16')];if(_[_0xab44('0x25')](_0x4a4e69[_0xab44('0x15')])){_0x25287b[_0xab44('0x18')]=_0x4a4e69[_0xab44('0x26')]&&_0x4a4e69[_0xab44('0x26')]!==_0xab44('0x29')?_0x4a4e69[_0xab44('0x26')]:_0xab44('0x27');}else{_0x25287b[_0xab44('0x18')]=_0x4a4e69[_0xab44('0x28')]&&_0x4a4e69[_0xab44('0x28')]!==_0xab44('0x29')?_0x4a4e69[_0xab44('0x28')]:_0xab44('0x27');}_0x39b2d1=_0x25287b;_0x6746cc[_0xab44('0x2c')](_0x25287b);return;}}})[_0xab44('0x1e')](function(){if(_0x500a9f){emit(_0x4a4e69[_0xab44('0x22')],_0x15e64e,util['format'](_0xab44('0x2e'),_0x500a9f[_0xab44('0x2f')]),util[_0xab44('0x30')](_0xab44('0x31'),_0x5168fa['action'][_0xab44('0x32')]()),{'evt':_[_0xab44('0x33')](_0x4a4e69,{'autoCreate':_0x52d282}),'contact':_0x39b2d1===undefined?{}:_0x39b2d1,'contacts':_0x6746cc[_0xab44('0x21')]===0x0?undefined:_0x6746cc});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 966f486..8f16e30 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 _0x0e4f=['data1','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data3','data4','windowWidth','data5','800','windowHeight','data6','600','winApplication','format','name','trigger:%s:%s','jscripty','trigger:%s','user:%s','integration','exec','queue','routeId','script','query','replace','channel','AllConditions','checkConditions','some','AnyConditions','checkTrigger:\x20trigger','evt','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','membername','lastevent','mailSubstatus','null','substatus','offlineMessage','created','exports','util','lodash','mustache','ioredis','./urlforward','./script','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','url','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','vtigerAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:offlineMessage','prototype','emit','info','clone','undefined','motionChannel','voice','debug','inspect','interface','checkTriggers','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','action','toLowerCase','contactmanager','motionbar','browser'];(function(_0x23f769,_0x462b22){var _0x14bfac=function(_0x1089a0){while(--_0x1089a0){_0x23f769['push'](_0x23f769['shift']());}};_0x14bfac(++_0x462b22);}(_0x0e4f,0x1ce));var _0xf0e4=function(_0x1870ef,_0x2fb0bb){_0x1870ef=_0x1870ef-0x0;var _0x534fe9=_0x0e4f[_0x1870ef];return _0x534fe9;};'use strict';var util=require(_0xf0e4('0x0'));var _=require(_0xf0e4('0x1'));var url=require('url');var Mustache=require(_0xf0e4('0x2'));var Redis=require(_0xf0e4('0x3'));var urlforward=require(_0xf0e4('0x4'));var integration=require('./integration');var cmContact=require('./cmContact');var script=require(_0xf0e4('0x5'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xf0e4('0x6'));var ami=require(_0xf0e4('0x7'));config[_0xf0e4('0x8')]=_[_0xf0e4('0x9')](config[_0xf0e4('0x8')],{'host':_0xf0e4('0xa'),'port':0x18eb});var io=require(_0xf0e4('0xb'))(new Redis(config['redis']));var operators={'equals':function(_0x4fef4d,_0x2e1fe9){return _0x4fef4d==_0x2e1fe9;},'not_equals':function(_0x14bc6b,_0x28407c){return _0x14bc6b!=_0x28407c;}};var barAndWebActions=[_0xf0e4('0xc'),_0xf0e4('0xd'),_0xf0e4('0xe')];function Trigger(_0x4e2a7a){this[_0xf0e4('0xf')]=_0x4e2a7a['triggers'];this[_0xf0e4('0x10')]=_0x4e2a7a[_0xf0e4('0x10')];this[_0xf0e4('0x11')]=_0x4e2a7a[_0xf0e4('0x11')];this[_0xf0e4('0x12')]=_0x4e2a7a['templates'];this[_0xf0e4('0x13')]=_0x4e2a7a[_0xf0e4('0x13')];this[_0xf0e4('0x14')]=_0x4e2a7a[_0xf0e4('0x14')];this[_0xf0e4('0x15')]=_0x4e2a7a[_0xf0e4('0x15')];this[_0xf0e4('0x16')]=_0x4e2a7a['salesforceAccounts'];this[_0xf0e4('0x17')]=_0x4e2a7a[_0xf0e4('0x17')];this[_0xf0e4('0x18')]=_0x4e2a7a[_0xf0e4('0x18')];this[_0xf0e4('0x19')]=_0x4e2a7a['deskAccounts'];this['vtigerAccounts']=_0x4e2a7a['vtigerAccounts'];this['servicenowAccounts']=_0x4e2a7a[_0xf0e4('0x1a')];this[_0xf0e4('0x1b')]=_0x4e2a7a[_0xf0e4('0x1b')];this[_0xf0e4('0x1c')]=_0x4e2a7a[_0xf0e4('0x1c')];this[_0xf0e4('0x1d')]={'zendesk':this[_0xf0e4('0x14')],'salesforce':this[_0xf0e4('0x16')],'freshdesk':this[_0xf0e4('0x15')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0xf0e4('0x18')],'desk':this[_0xf0e4('0x19')],'vtiger':this[_0xf0e4('0x1e')],'dynamics365':this[_0xf0e4('0x1b')],'freshsales':this[_0xf0e4('0x1c')],'servicenow':this['servicenowAccounts']};ami['on'](_0xf0e4('0x1f'),this[_0xf0e4('0x20')][_0xf0e4('0x21')](this));ami['on'](_0xf0e4('0x22'),this[_0xf0e4('0x20')]['bind'](this));ami['on'](_0xf0e4('0x23'),this['syncCustomEvent'][_0xf0e4('0x21')](this));ami['on'](_0xf0e4('0x24'),this[_0xf0e4('0x20')][_0xf0e4('0x21')](this));ami['on'](_0xf0e4('0x25'),this[_0xf0e4('0x20')][_0xf0e4('0x21')](this));ami['on']('custom:agentnoanswer',this[_0xf0e4('0x20')][_0xf0e4('0x21')](this));ami['on'](_0xf0e4('0x26'),this[_0xf0e4('0x20')][_0xf0e4('0x21')](this));ami['on'](_0xf0e4('0x27'),this['syncCustomEvent'][_0xf0e4('0x21')](this));ami['on'](_0xf0e4('0x28'),this['syncCustomEvent'][_0xf0e4('0x21')](this));ami['on'](_0xf0e4('0x29'),this['syncCustomEvent'][_0xf0e4('0x21')](this));ami['on'](_0xf0e4('0x2a'),this[_0xf0e4('0x20')][_0xf0e4('0x21')](this));ami['on'](_0xf0e4('0x2b'),this[_0xf0e4('0x20')][_0xf0e4('0x21')](this));ami['on'](_0xf0e4('0x2c'),this['syncAgentDial'][_0xf0e4('0x21')](this));ami['on'](_0xf0e4('0x2d'),this[_0xf0e4('0x2e')]['bind'](this));ami['on'](_0xf0e4('0x2f'),this[_0xf0e4('0x2e')]['bind'](this));ami['on'](_0xf0e4('0x30'),this[_0xf0e4('0x20')][_0xf0e4('0x21')](this));ami['on'](_0xf0e4('0x31'),this['syncCustomEvent']['bind'](this));ami['on'](_0xf0e4('0x32'),this[_0xf0e4('0x20')][_0xf0e4('0x21')](this));ami['on'](_0xf0e4('0x33'),this['syncCustomEvent'][_0xf0e4('0x21')](this));ami['on'](_0xf0e4('0x34'),this['syncCustomEvent']['bind'](this));ami['on'](_0xf0e4('0x35'),this[_0xf0e4('0x20')][_0xf0e4('0x21')](this));ami['on']('custom:rejectmessage',this[_0xf0e4('0x20')][_0xf0e4('0x21')](this));ami['on'](_0xf0e4('0x36'),this[_0xf0e4('0x20')][_0xf0e4('0x21')](this));}Trigger[_0xf0e4('0x37')][_0xf0e4('0x38')]=function(_0x463f49,_0x3e5dd7,_0x5e1cb7){logger[_0xf0e4('0x39')](_0x463f49,_0x3e5dd7,JSON['stringify'](_0x5e1cb7));io['to'](_0x463f49)['emit'](_0x3e5dd7,_0x5e1cb7);};Trigger['prototype'][_0xf0e4('0x20')]=function(_0x4929fa){var _0x13e27f=_[_0xf0e4('0x3a')](_0x4929fa);if(typeof _0x13e27f['motionChannel']===_0xf0e4('0x3b')){_0x13e27f[_0xf0e4('0x3c')]=_0xf0e4('0x3d');}logger[_0xf0e4('0x3e')]('syncCustomEvent',util[_0xf0e4('0x3f')](_0x13e27f,{'showHidden':!![],'depth':null}));this['checkTriggers'](_0x13e27f);};Trigger['prototype'][_0xf0e4('0x2e')]=function(_0x5248dc){if(this[_0xf0e4('0x10')][_0x5248dc[_0xf0e4('0x40')]]){this['syncCustomEvent'](_0x5248dc);}};Trigger['prototype'][_0xf0e4('0x41')]=function(_0x2fdbe2){var _0x25fb8f;for(var _0x24f616 in this[_0xf0e4('0xf')]){if(this['triggers'][_0xf0e4('0x42')](_0x24f616)){if(this['triggers'][_0x24f616][_0xf0e4('0x43')]){_0x25fb8f=this[_0xf0e4('0x44')](this['triggers'][_0x24f616],_0x2fdbe2);if(_0x25fb8f){_[_0xf0e4('0x45')](_0x2fdbe2,_0x2fdbe2[_0xf0e4('0x46')]);for(var _0x5da8c8=0x0,_0x40381e,_0x44f24f,_0x4b2b74;_0x5da8c80x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});}; \ No newline at end of file +var _0x814b=['calleridname','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','desk','redis','defaults','localhost','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','then','total_entries','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','%s:%s','authType','token','username','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','length','string','nameField','toLowerCase','content','picklist','idField','customField','custom_fields','type','variableName','customVariable','Variable','name','priority','merge','getString','Subjects','xCALLY','CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','catch','error','stringify','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','unmanaged','lastevent'];(function(_0x21e9d0,_0x48ba65){var _0x24cfb1=function(_0x5cd18a){while(--_0x5cd18a){_0x21e9d0['push'](_0x21e9d0['shift']());}};_0x24cfb1(++_0x48ba65);}(_0x814b,0x1a2));var _0xb814=function(_0x39cbe4,_0x4a7958){_0x39cbe4=_0x39cbe4-0x0;var _0xe76ba7=_0x814b[_0x39cbe4];return _0xe76ba7;};'use strict';var _=require(_0xb814('0x0'));var rp=require(_0xb814('0x1'));var md5=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var Redis=require(_0xb814('0x4'));var intUtil=require(_0xb814('0x5'));var config=require('../../../../config/environment');var logger=require(_0xb814('0x6'))(_0xb814('0x7'));config[_0xb814('0x8')]=_[_0xb814('0x9')](config[_0xb814('0x8')],{'host':_0xb814('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb814('0x8')]));function emit(_0x2e6272,_0x5c8539,_0x271af9){io['to'](_0x2e6272)[_0xb814('0xb')](_0x5c8539,_0x271af9);}var headers={'Content-Type':_0xb814('0xc'),'Accept':_0xb814('0xc')};function getUser(_0x1fea33,_0x21d4a5){if(intUtil[_0xb814('0xd')](_0x21d4a5)===!![]){logger[_0xb814('0xe')](_0xb814('0xf'),_0x21d4a5);return request({'uri':util[_0xb814('0x10')](_0xb814('0x11'),_0x1fea33['remoteUri'])})[_0xb814('0x12')](function(_0x56278f){if(_0x56278f[_0xb814('0x13')]){return _[_0xb814('0x14')](_0x56278f[_0xb814('0x15')][_0xb814('0x16')],{'email':_0x21d4a5});}})[_0xb814('0x12')](function(_0x3bde14){if(_0x3bde14){logger[_0xb814('0xe')](_0xb814('0x17'));return _0x3bde14;}else{logger[_0xb814('0xe')](_0xb814('0x18'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}});}else{logger[_0xb814('0xe')](_0xb814('0x1b'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}}function request(_0x125ce2){logger[_0xb814('0x1c')](_0xb814('0x1d'),JSON['stringify'](_0x125ce2));return rp(_[_0xb814('0x9')](_0x125ce2,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x270598){var _0xfac75b;if(_0x270598['authType']==='basic'){_0xfac75b=util['format'](_0xb814('0x1e'),_0x270598['username'],_0x270598['password']);}else if(_0x270598[_0xb814('0x1f')]===_0xb814('0x20')){_0xfac75b=util[_0xb814('0x10')]('%s/token:%s',_0x270598[_0xb814('0x21')],_0x270598['token']);}return util[_0xb814('0x10')](_0xb814('0x22'),new Buffer(_0xfac75b)[_0xb814('0x23')](_0xb814('0x24')));}function getEndUser(_0x27352e,_0x2bd039,_0x1f5d40){logger['info'](_0xb814('0x25'),_0x1f5d40);return request({'uri':util['format'](_0xb814('0x26'),_0x27352e[_0xb814('0x1a')]),'qs':{'phone':_0x1f5d40}})[_0xb814('0x12')](function(_0x208927){if(_0x208927[_0xb814('0x13')]){logger[_0xb814('0xe')](_0xb814('0x27'));return _0x208927['_embedded'][_0xb814('0x16')][0x0];}else{logger[_0xb814('0xe')](_0xb814('0x28'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x29'),_0x27352e[_0xb814('0x1a')]),'method':_0xb814('0x2a'),'body':{'first_name':_0x2bd039,'title':_0x2bd039,'phone_numbers':[{'type':_0xb814('0x2b'),'value':_0x1f5d40}]}});}});}function getTags(_0x5a6291,_0x271aa8){var _0x328a08=[];if(_0x5a6291&&_0x5a6291['length']>0x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ 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 aac8914..1c66675 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 _0xc56b=['indexOf','content','ticketType','incident','incidents','getString','Subjects','/contacts(','/systemusers(','Fields','phonecall','callDirection','queue','Descriptions','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash','data7','serverUrl','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL',']\x20The\x20User\x20ID\x20is:','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','md5','../../../../config/logger','dynamics365','../../../../config/environment','defaults','localhost','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','tenantId','resolve','data5','POST','clientId','username','password','clientSecret','then','access_token','catch','error','toUpperCase','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','length','internalemailaddress','email','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','toLowerCase','calleridnum','body','headers','odata-entityid','substring','lastIndexOf','destcalleridnum','contacts?$select=','&$filter=','\x20eq\x20\x27','%2b','enduserId','contactid',']\x20Enduser\x20created!','string','picklist','type','customField'];(function(_0x51efeb,_0x74aec1){var _0x5f3fc5=function(_0x68a662){while(--_0x68a662){_0x51efeb['push'](_0x51efeb['shift']());}};_0x5f3fc5(++_0x74aec1);}(_0xc56b,0x8b));var _0xbc56=function(_0x3a3465,_0x3b466e){_0x3a3465=_0x3a3465-0x0;var _0xd92ae8=_0xc56b[_0x3a3465];return _0xd92ae8;};'use strict';var _=require(_0xbc56('0x0'));var rp=require(_0xbc56('0x1'));var util=require(_0xbc56('0x2'));var intUtil=require('./util');var md5=require(_0xbc56('0x3'));var Redis=require('ioredis');var logger=require(_0xbc56('0x4'))(_0xbc56('0x5'));var config=require(_0xbc56('0x6'));config['redis']=_[_0xbc56('0x7')](config['redis'],{'host':_0xbc56('0x8'),'port':0x18eb});var io=require(_0xbc56('0x9'))(new Redis(config['redis']));function getAuthToken(_0x5244a3,_0x23f2d2,_0x10c184){if(_0x5244a3[_0xbc56('0xa')]){_0x5244a3[_0xbc56('0xb')]=_0x5244a3[_0xbc56('0xc')]['data7'];_0x5244a3[_0xbc56('0xd')]=_0x5244a3[_0xbc56('0xc')]['data2'];return Promise[_0xbc56('0xe')](_0x5244a3[_0xbc56('0xc')][_0xbc56('0xf')]);}var _0x204352={'method':_0xbc56('0x10'),'uri':_0x23f2d2,'form':{'client_id':_0x5244a3[_0xbc56('0x11')],'resource':_0x5244a3[_0xbc56('0xb')],'username':_0x5244a3[_0xbc56('0x12')],'password':_0x5244a3[_0xbc56('0x13')],'grant_type':_0xbc56('0x13'),'client_secret':_0x5244a3[_0xbc56('0x14')]},'json':!![]};return rp(_0x204352)[_0xbc56('0x15')](function(_0x451e18){return _0x451e18[_0xbc56('0x16')];})[_0xbc56('0x17')](function(_0x228a47){logger[_0xbc56('0x18')]('['+[_0x10c184[_0xbc56('0x19')]()]+']\x20Wrong\x20credentials!');return _0x228a47[_0xbc56('0x1a')];});}function getUser(_0x51af9c,_0x387a00,_0x467374,_0x96740b,_0x4f44ab,_0x3c9ac7){return new Promise(function(_0x1e0d7d,_0x5a7202){return getAuthToken(_0x387a00,_0x96740b,_0x3c9ac7)[_0xbc56('0x15')](function(_0x42be81){var _0x4884e6={'method':_0xbc56('0x1b'),'uri':_0x4f44ab+_0xbc56('0x1c'),'headers':{'Authorization':_0xbc56('0x1d')+_0x42be81,'OData-Version':_0xbc56('0x1e')},'json':!![]};return rp(_0x4884e6);})[_0xbc56('0x15')](function(_0x48608e){var _0x467067=_0x48608e[_0xbc56('0x1f')];var _0x13de12=![];var _0x19c42a=null;if(!_[_0xbc56('0x20')](_0x467374)){if(intUtil[_0xbc56('0x21')](_0x467374['email'])){_0x51af9c['userEmail']=_0x467374['email'];for(_0x19c42a=0x0;_0x19c42a<_0x467067[_0xbc56('0x22')];_0x19c42a++){if(_0x467067[_0x19c42a][_0xbc56('0x23')]===_0x467374[_0xbc56('0x24')]&&!_0x467067[_0x19c42a][_0xbc56('0x25')]){_0x13de12=!![];logger[_0xbc56('0x26')]('['+[_0x3c9ac7[_0xbc56('0x19')]()]+_0xbc56('0x27')+_0x467067[_0x19c42a][_0xbc56('0x28')]+'!');_0x51af9c[_0xbc56('0x29')]=_0x467067[_0x19c42a]['systemuserid'];}}}}if(!_0x13de12){logger[_0xbc56('0x26')]('['+[_0x3c9ac7[_0xbc56('0x19')]()]+_0xbc56('0x2a'));_0x51af9c[_0xbc56('0x2b')]=_0x387a00[_0xbc56('0x12')];for(_0x19c42a=0x0;_0x19c42a<_0x467067[_0xbc56('0x22')];_0x19c42a++){if(_0x467067[_0x19c42a][_0xbc56('0x23')]===_0x387a00['username']){_0x51af9c['userId']=_0x467067[_0x19c42a][_0xbc56('0x28')];}}}_0x1e0d7d(_0x51af9c);})[_0xbc56('0x17')](function(_0x3db493){_0x5a7202(_0x3db493[_0xbc56('0x1a')]);});});}function createEndUser(_0x185039,_0x10ee69,_0x182f4d,_0x9db0e6,_0x5a3b73,_0x1bfa5d,_0x4b9ec8){return new Promise(function(_0x1a23b3,_0x2ba8f5){return getAuthToken(_0x10ee69,_0x182f4d,_0x1bfa5d)[_0xbc56('0x15')](function(_0x2f6a94){var _0x47b4ee=_0x1bfa5d[_0xbc56('0x2c')]()==='outbound'?_0x5a3b73['destcalleridnum']:_0x5a3b73[_0xbc56('0x2d')];var _0xd44c3c={'method':_0xbc56('0x10'),'uri':_0x9db0e6+'contacts','body':{'fullname':_0x47b4ee,'firstname':_0x47b4ee,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x185039['userId']+')'},'headers':{'Authorization':_0xbc56('0x1d')+_0x2f6a94,'OData-Version':_0xbc56('0x1e')},'json':!![],'resolveWithFullResponse':!![]};_0xd44c3c[_0xbc56('0x2e')][_0x4b9ec8]=_0x47b4ee;return rp(_0xd44c3c);})[_0xbc56('0x15')](function(_0x3d42a3){var _0x6cdb17=_0x3d42a3[_0xbc56('0x2f')][_0xbc56('0x30')];var _0xfdcd09=_0x6cdb17[_0xbc56('0x31')](_0x6cdb17[_0xbc56('0x32')]('(')+0x1,_0x6cdb17['lastIndexOf'](')'));_0x185039['enduserId']=_0xfdcd09;_0x1a23b3(_0x185039);})['catch'](function(_0x3f19a9){_0x2ba8f5(_0x3f19a9[_0xbc56('0x1a')]);});});}function getEndUser(_0x26c35f,_0x36b873,_0x2a43c7,_0x196864,_0x5e1a77,_0x202e7d,_0x2bc9f2,_0x55b502){var _0x3ced12=_0x202e7d[_0xbc56('0x2c')]()==='outbound'?_0x5e1a77[_0xbc56('0x33')]:_0x5e1a77[_0xbc56('0x2d')];return getAuthToken(_0x36b873,_0x2a43c7,_0x202e7d)[_0xbc56('0x15')](function(_0x5073d6){_0x55b502=_0x55b502?_0x55b502:'telephone1';var _0x1bca8e={'method':_0xbc56('0x1b'),'uri':_0x196864+_0xbc56('0x34')+_0x55b502+_0xbc56('0x35')+_0x55b502+_0xbc56('0x36')+_0x3ced12['replace']('+',_0xbc56('0x37'))+'\x27','headers':{'Authorization':_0xbc56('0x1d')+_0x5073d6,'If-None-Match':null,'OData-Version':_0xbc56('0x1e')},'json':!![]};return rp(_0x1bca8e);})['then'](function(_0xc78b8e){var _0x3c6280=![];if(!_0xc78b8e)return _0x3c6280;var _0x42caff=_0xc78b8e[_0xbc56('0x1f')];for(var _0x3109e5=0x0;_0x3109e5<_0x42caff[_0xbc56('0x22')];_0x3109e5++){if(_0x42caff[_0x3109e5][_0x55b502]===_0x3ced12){_0x3c6280=!![];_0x26c35f[_0xbc56('0x38')]=_0x42caff[_0x3109e5][_0xbc56('0x39')];}}return _0x3c6280;})['then'](function(_0x2bdff8){if(_0x2bdff8)return _0x26c35f;if(_0x2bc9f2==='nothing'){logger['info']('['+[_0x202e7d[_0xbc56('0x19')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x26c35f;}return createEndUser(_0x26c35f,_0x36b873,_0x2a43c7,_0x196864,_0x5e1a77,_0x202e7d,_0x55b502)['then'](function(_0x24be2a){logger[_0xbc56('0x26')]('['+[_0x202e7d[_0xbc56('0x19')]()]+_0xbc56('0x3a'),_0x24be2a[_0xbc56('0x38')]);return _0x24be2a;});});}function getCustomFields(_0x229acd,_0x59ee3f,_0x3eb0ef){var _0x3c1590={};if(_0x229acd[_0xbc56('0x22')]>0x0){_['forEach'](_0x229acd,function(_0x453121){if(_['includes']([_0xbc56('0x3b'),_0xbc56('0x3c')],_0x453121[_0xbc56('0x3d')])&&_0x453121['nameField']&&!_0x453121[_0xbc56('0x3e')]){var _0x5d6ff0=_0x453121['idField'][_0xbc56('0x2c')]();var _0x6c7711=_0x5d6ff0[_0xbc56('0x31')](0x0,_0x5d6ff0[_0xbc56('0x3f')]('_'));var _0x19b2b8=_0x5d6ff0['substring'](_0x5d6ff0[_0xbc56('0x3f')]('_')+0x1);if(_0x6c7711===_0x3eb0ef){_0x3c1590[_0x19b2b8]=_0x453121[_0xbc56('0x40')];}}});}return _0x3c1590;}function getTicket(_0xc6b3d7,_0x9009c4,_0x13144d,_0x2cadd9,_0x4547d7,_0x3e8642,_0x547700){return new Promise(function(_0x1d0879,_0x48af42){var _0x5ac95e;return getAuthToken(_0x9009c4,_0x13144d,_0x547700)[_0xbc56('0x15')](function(_0x37b15f){if(_0x3e8642[_0xbc56('0x41')]===_0xbc56('0x42')){_0x5ac95e={'method':_0xbc56('0x10'),'uri':_0x2cadd9+_0xbc56('0x43'),'body':Object['assign']({},{'title':intUtil[_0xbc56('0x44')](_0x3e8642[_0xbc56('0x45')],_0x4547d7,'\x20'),'description':intUtil[_0xbc56('0x44')](_0x3e8642['Descriptions'],_0x4547d7,'\x0a'),'customerid_contact@odata.bind':_0xc6b3d7[_0xbc56('0x38')]?_0xbc56('0x46')+_0xc6b3d7[_0xbc56('0x38')]+')':undefined,'ownerid@odata.bind':_0xbc56('0x47')+_0xc6b3d7['userId']+')','caseorigincode':'1'},getCustomFields(_0x3e8642[_0xbc56('0x48')],_0x4547d7,_0x3e8642[_0xbc56('0x41')])),'headers':{'Authorization':_0xbc56('0x1d')+_0x37b15f,'OData-Version':_0xbc56('0x1e')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x3e8642[_0xbc56('0x41')]===_0xbc56('0x49')){var _0x466e57=_0xc6b3d7[_0xbc56('0x38')]?[{'partyid_systemuser@odata.bind':_0xbc56('0x47')+_0xc6b3d7[_0xbc56('0x29')]+')','participationtypemask':_0xc6b3d7[_0xbc56('0x4a')]===_0xbc56('0x4b')?0x2:0x1},{'partyid_contact@odata.bind':_0xbc56('0x46')+_0xc6b3d7[_0xbc56('0x38')]+')','participationtypemask':_0xc6b3d7[_0xbc56('0x4a')]===_0xbc56('0x4b')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xbc56('0x47')+_0xc6b3d7['userId']+')','participationtypemask':_0xc6b3d7[_0xbc56('0x4a')]===_0xbc56('0x4b')?0x2:0x1}];_0x5ac95e={'method':_0xbc56('0x10'),'uri':_0x2cadd9+'phonecalls','body':Object['assign']({},{'subject':intUtil[_0xbc56('0x44')](_0x3e8642[_0xbc56('0x45')],_0x4547d7,'\x20'),'phonenumber':String(_0x4547d7['calleridnum']),'description':intUtil[_0xbc56('0x44')](_0x3e8642[_0xbc56('0x4c')],_0x4547d7,'\x0a'),'regardingobjectid_contact@odata.bind':_0xc6b3d7[_0xbc56('0x38')]?_0xbc56('0x46')+_0xc6b3d7['enduserId']+')':undefined,'ownerid@odata.bind':_0xbc56('0x47')+_0xc6b3d7['userId']+')','directioncode':_0xc6b3d7[_0xbc56('0x4a')]===_0xbc56('0x4b')?![]:!![],'phonecall_activity_parties':_0x466e57},getCustomFields(_0x3e8642['Fields'],_0x4547d7,_0x3e8642[_0xbc56('0x41')])),'headers':{'Authorization':_0xbc56('0x1d')+_0x37b15f,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5ac95e);})['then'](function(_0x291a6e){var _0x2b41f9=_0x291a6e[_0xbc56('0x2f')][_0xbc56('0x30')];var _0x322410=_0x2b41f9[_0xbc56('0x31')](_0x2b41f9[_0xbc56('0x32')]('(')+0x1,_0x2b41f9['lastIndexOf'](')'));_0xc6b3d7[_0xbc56('0x4d')]=_0x322410;_0x1d0879(_0xc6b3d7);})['catch'](function(_0x2d7902){_0x48af42(_0x2d7902[_0xbc56('0x1a')]);});});}function emit(_0xdd93d4,_0x3accc8,_0x37f216,_0x545c43){var _0x51ea2a={'uri':util[_0xbc56('0x4e')](_0xbc56('0x4f'),_0xdd93d4,_0x37f216,_0x545c43)};io['to'](util[_0xbc56('0x4e')]('user:%s',_0x3accc8))[_0xbc56('0x50')](_0xbc56('0x51'),_0x51ea2a);}exports['cs']=function(_0x4f9d8b,_0x165971,_0x5b418a,_0x5218ae,_0x42f157,_0x5dd743,_0x123da7,_0xafb159){var _0x34a79b={};_0x5dd743['remoteUri']=_0x5dd743['modernAuthentication']?intUtil[_0xbc56('0x52')](_0x5dd743[_0xbc56('0xc')][_0xbc56('0x53')]):intUtil[_0xbc56('0x52')](_0x5dd743[_0xbc56('0xb')]);_0x5dd743[_0xbc56('0x54')]=intUtil[_0xbc56('0x52')](_0x5dd743['serverUrl']);_0x34a79b[_0xbc56('0x4a')]=_0xafb159===_0xbc56('0x4b')||_0xafb159===_0xbc56('0x55')?_0xbc56('0x4b'):_0xbc56('0x56');var _0x2978bc=_0x5dd743[_0xbc56('0xa')]?util[_0xbc56('0x4e')]('%s/api/data/v9.0/',_0x5dd743['CloudProvider']['data7']):util[_0xbc56('0x4e')]('%s/api/data/v9.0/',_0x5dd743[_0xbc56('0xb')]);var _0x185488=util[_0xbc56('0x4e')]('https://login.microsoftonline.com/%s/oauth2/token',_0x5dd743['tenantId']);var _0xc8a0d1=util[_0xbc56('0x4e')](_0xbc56('0x57'),_0x5dd743[_0xbc56('0x54')],_0x165971[_0xbc56('0x58')],md5(_0x165971[_0xbc56('0x58')]));if(_0x42f157&&_0x42f157[_0xbc56('0x59')]){logger[_0xbc56('0x26')]('[QUEUE]',_0xbc56('0x5a'));_0x165971['recordingURL']=_0xc8a0d1;}else if(_0x123da7&&_0x123da7[_0xbc56('0x5b')]&&_0x123da7[_0xbc56('0x5b')]!==_0xbc56('0x5c')){logger[_0xbc56('0x26')]('[OUTBOUND]',_0xbc56('0x5a'));_0x165971[_0xbc56('0x5d')]=_0xc8a0d1;}else{_0x165971['recordingURL']='';}return getUser(_0x34a79b,_0x5dd743,_0x5218ae,_0x185488,_0x2978bc,_0xafb159)['then'](function(_0x4d2ad1){logger['info']('['+_0xafb159[_0xbc56('0x19')]()+_0xbc56('0x5e'),_0x4d2ad1[_0xbc56('0x29')]);logger[_0xbc56('0x26')]('['+_0xafb159[_0xbc56('0x19')]()+']\x20The\x20User\x20email\x20is:',_0x4d2ad1[_0xbc56('0x2b')]);return getEndUser(_0x4d2ad1,_0x5dd743,_0x185488,_0x2978bc,_0x165971,_0xafb159,_0x5b418a['moduleCreate'],_0x5b418a[_0xbc56('0x5f')]);})[_0xbc56('0x15')](function(_0x744cd1){logger['info']('['+_0xafb159[_0xbc56('0x19')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x744cd1[_0xbc56('0x38')]);logger[_0xbc56('0x26')]('['+_0xafb159[_0xbc56('0x19')]()+_0xbc56('0x60'),_0x165971[_0xbc56('0x2d')]);return getTicket(_0x744cd1,_0x5dd743,_0x185488,_0x2978bc,_0x165971,_0x5b418a,_0xafb159);})[_0xbc56('0x15')](function(_0x169218){logger['info'](util[_0xbc56('0x4e')]('['+_0xafb159[_0xbc56('0x19')]()+_0xbc56('0x61'),_0x5b418a[_0xbc56('0x41')],_0x169218[_0xbc56('0x4d')]));logger[_0xbc56('0x26')](util[_0xbc56('0x4e')]('['+_0xafb159[_0xbc56('0x19')]()+_0xbc56('0x62'),_0xafb159));if(_0xafb159!=='unmanaged'&&_0x5b418a[_0xbc56('0x63')]){logger[_0xbc56('0x26')]('['+_0xafb159[_0xbc56('0x19')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x5dd743['remoteUri'],_0x5218ae['name'],_0x5b418a[_0xbc56('0x41')],_0x169218[_0xbc56('0x4d')]);}})[_0xbc56('0x17')](function(_0x18d75f){logger['error']('['+_0xafb159[_0xbc56('0x19')]()+_0xbc56('0x64'),_0x18d75f[_0xbc56('0x1a')]);console[_0xbc56('0x18')]('Error\x20running\x20Dynamics365\x20integration',_0x18d75f);});}; \ No newline at end of file +var _0x4bdd=['%2b','enduserId','contactid',']\x20Enduser\x20created!','string','picklist','type','nameField','customField','idField','indexOf','content','ticketType','incident','assign','Subjects','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','getString','lastIndexOf','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','trigger:browser:url','stripTrailingSlash','data7','serverUrl','unmanaged','%s/api/data/v9.0/','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','openNewTab','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','request-promise','util','md5','ioredis','dynamics365','../../../../config/environment','redis','localhost','modernAuthentication','remoteUri','tenantId','data2','resolve','CloudProvider','data5','POST','clientId','username','password','clientSecret','then','access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','message','Bearer\x20','value','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','systemuserid','info','userId','destcalleridnum','contacts','/systemusers(','4.0','body','headers','odata-entityid','substring','toLowerCase','outbound','calleridnum','GET','contacts?$select=','&$filter=','\x20eq\x20\x27','replace'];(function(_0x4ed1ac,_0x20fa95){var _0x346a43=function(_0x5c037e){while(--_0x5c037e){_0x4ed1ac['push'](_0x4ed1ac['shift']());}};_0x346a43(++_0x20fa95);}(_0x4bdd,0x10d));var _0xd4bd=function(_0x619347,_0x1d8a56){_0x619347=_0x619347-0x0;var _0x1eae94=_0x4bdd[_0x619347];return _0x1eae94;};'use strict';var _=require('lodash');var rp=require(_0xd4bd('0x0'));var util=require(_0xd4bd('0x1'));var intUtil=require('./util');var md5=require(_0xd4bd('0x2'));var Redis=require(_0xd4bd('0x3'));var logger=require('../../../../config/logger')(_0xd4bd('0x4'));var config=require(_0xd4bd('0x5'));config[_0xd4bd('0x6')]=_['defaults'](config[_0xd4bd('0x6')],{'host':_0xd4bd('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAuthToken(_0x5c6d7e,_0x4b8de8,_0x31ff87){if(_0x5c6d7e[_0xd4bd('0x8')]){_0x5c6d7e[_0xd4bd('0x9')]=_0x5c6d7e['CloudProvider']['data7'];_0x5c6d7e[_0xd4bd('0xa')]=_0x5c6d7e['CloudProvider'][_0xd4bd('0xb')];return Promise[_0xd4bd('0xc')](_0x5c6d7e[_0xd4bd('0xd')][_0xd4bd('0xe')]);}var _0x3950ad={'method':_0xd4bd('0xf'),'uri':_0x4b8de8,'form':{'client_id':_0x5c6d7e[_0xd4bd('0x10')],'resource':_0x5c6d7e['remoteUri'],'username':_0x5c6d7e[_0xd4bd('0x11')],'password':_0x5c6d7e[_0xd4bd('0x12')],'grant_type':_0xd4bd('0x12'),'client_secret':_0x5c6d7e[_0xd4bd('0x13')]},'json':!![]};return rp(_0x3950ad)[_0xd4bd('0x14')](function(_0x2abe4e){return _0x2abe4e[_0xd4bd('0x15')];})[_0xd4bd('0x16')](function(_0x266e9a){logger['error']('['+[_0x31ff87[_0xd4bd('0x17')]()]+_0xd4bd('0x18'));return _0x266e9a[_0xd4bd('0x19')];});}function getUser(_0x19ba5c,_0x3306b8,_0x542bc8,_0x41e6aa,_0x3ace71,_0x398ae8){return new Promise(function(_0x251a08,_0x403809){return getAuthToken(_0x3306b8,_0x41e6aa,_0x398ae8)[_0xd4bd('0x14')](function(_0x2e6ba2){var _0x180d2a={'method':'GET','uri':_0x3ace71+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0xd4bd('0x1a')+_0x2e6ba2,'OData-Version':'4.0'},'json':!![]};return rp(_0x180d2a);})[_0xd4bd('0x14')](function(_0x40aa26){var _0x1f1000=_0x40aa26[_0xd4bd('0x1b')];var _0x1269c4=![];var _0x517a2e=null;if(!_[_0xd4bd('0x1c')](_0x542bc8)){if(intUtil[_0xd4bd('0x1d')](_0x542bc8[_0xd4bd('0x1e')])){_0x19ba5c[_0xd4bd('0x1f')]=_0x542bc8['email'];for(_0x517a2e=0x0;_0x517a2e<_0x1f1000[_0xd4bd('0x20')];_0x517a2e++){if(_0x1f1000[_0x517a2e][_0xd4bd('0x21')]===_0x542bc8['email']&&!_0x1f1000[_0x517a2e][_0xd4bd('0x22')]){_0x1269c4=!![];logger['info']('['+[_0x398ae8['toUpperCase']()]+_0xd4bd('0x23')+_0x1f1000[_0x517a2e][_0xd4bd('0x24')]+'!');_0x19ba5c['userId']=_0x1f1000[_0x517a2e]['systemuserid'];}}}}if(!_0x1269c4){logger[_0xd4bd('0x25')]('['+[_0x398ae8[_0xd4bd('0x17')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x19ba5c[_0xd4bd('0x1f')]=_0x3306b8[_0xd4bd('0x11')];for(_0x517a2e=0x0;_0x517a2e<_0x1f1000[_0xd4bd('0x20')];_0x517a2e++){if(_0x1f1000[_0x517a2e]['internalemailaddress']===_0x3306b8[_0xd4bd('0x11')]){_0x19ba5c[_0xd4bd('0x26')]=_0x1f1000[_0x517a2e][_0xd4bd('0x24')];}}}_0x251a08(_0x19ba5c);})['catch'](function(_0x105651){_0x403809(_0x105651[_0xd4bd('0x19')]);});});}function createEndUser(_0xba3554,_0x4f8e85,_0x3ad14b,_0x44e6d1,_0x1013ae,_0x4a265c,_0x5cbee3){return new Promise(function(_0x47a660,_0x2331eb){return getAuthToken(_0x4f8e85,_0x3ad14b,_0x4a265c)[_0xd4bd('0x14')](function(_0x5e8c33){var _0x2cc15c=_0x4a265c['toLowerCase']()==='outbound'?_0x1013ae[_0xd4bd('0x27')]:_0x1013ae['calleridnum'];var _0x523abb={'method':_0xd4bd('0xf'),'uri':_0x44e6d1+_0xd4bd('0x28'),'body':{'fullname':_0x2cc15c,'firstname':_0x2cc15c,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0xd4bd('0x29')+_0xba3554[_0xd4bd('0x26')]+')'},'headers':{'Authorization':_0xd4bd('0x1a')+_0x5e8c33,'OData-Version':_0xd4bd('0x2a')},'json':!![],'resolveWithFullResponse':!![]};_0x523abb[_0xd4bd('0x2b')][_0x5cbee3]=_0x2cc15c;return rp(_0x523abb);})[_0xd4bd('0x14')](function(_0x22153b){var _0x2507e2=_0x22153b[_0xd4bd('0x2c')][_0xd4bd('0x2d')];var _0x5b45cb=_0x2507e2[_0xd4bd('0x2e')](_0x2507e2['lastIndexOf']('(')+0x1,_0x2507e2['lastIndexOf'](')'));_0xba3554['enduserId']=_0x5b45cb;_0x47a660(_0xba3554);})['catch'](function(_0x1de473){_0x2331eb(_0x1de473[_0xd4bd('0x19')]);});});}function getEndUser(_0x1a4dbd,_0x31241b,_0x4036b2,_0x3546de,_0x5be174,_0x4adc4b,_0x5dbba9,_0x5b467e){var _0x5cb2b4=_0x4adc4b[_0xd4bd('0x2f')]()===_0xd4bd('0x30')?_0x5be174['destcalleridnum']:_0x5be174[_0xd4bd('0x31')];return getAuthToken(_0x31241b,_0x4036b2,_0x4adc4b)[_0xd4bd('0x14')](function(_0x5e9c23){_0x5b467e=_0x5b467e?_0x5b467e:'telephone1';var _0x3e434c={'method':_0xd4bd('0x32'),'uri':_0x3546de+_0xd4bd('0x33')+_0x5b467e+_0xd4bd('0x34')+_0x5b467e+_0xd4bd('0x35')+_0x5cb2b4[_0xd4bd('0x36')]('+',_0xd4bd('0x37'))+'\x27','headers':{'Authorization':_0xd4bd('0x1a')+_0x5e9c23,'If-None-Match':null,'OData-Version':_0xd4bd('0x2a')},'json':!![]};return rp(_0x3e434c);})['then'](function(_0x58bfd1){var _0x235345=![];if(!_0x58bfd1)return _0x235345;var _0x119876=_0x58bfd1[_0xd4bd('0x1b')];for(var _0x55f975=0x0;_0x55f975<_0x119876[_0xd4bd('0x20')];_0x55f975++){if(_0x119876[_0x55f975][_0x5b467e]===_0x5cb2b4){_0x235345=!![];_0x1a4dbd[_0xd4bd('0x38')]=_0x119876[_0x55f975][_0xd4bd('0x39')];}}return _0x235345;})[_0xd4bd('0x14')](function(_0x409855){if(_0x409855)return _0x1a4dbd;if(_0x5dbba9==='nothing'){logger['info']('['+[_0x4adc4b[_0xd4bd('0x17')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x1a4dbd;}return createEndUser(_0x1a4dbd,_0x31241b,_0x4036b2,_0x3546de,_0x5be174,_0x4adc4b,_0x5b467e)['then'](function(_0x569c2f){logger[_0xd4bd('0x25')]('['+[_0x4adc4b[_0xd4bd('0x17')]()]+_0xd4bd('0x3a'),_0x569c2f[_0xd4bd('0x38')]);return _0x569c2f;});});}function getCustomFields(_0x12b138,_0x22a250,_0xbe3865){var _0x54e8c2={};if(_0x12b138['length']>0x0){_['forEach'](_0x12b138,function(_0x3ae39a){if(_['includes']([_0xd4bd('0x3b'),_0xd4bd('0x3c')],_0x3ae39a[_0xd4bd('0x3d')])&&_0x3ae39a[_0xd4bd('0x3e')]&&!_0x3ae39a[_0xd4bd('0x3f')]){var _0x21ff64=_0x3ae39a[_0xd4bd('0x40')][_0xd4bd('0x2f')]();var _0x4435a0=_0x21ff64[_0xd4bd('0x2e')](0x0,_0x21ff64[_0xd4bd('0x41')]('_'));var _0x3dc15b=_0x21ff64[_0xd4bd('0x2e')](_0x21ff64['indexOf']('_')+0x1);if(_0x4435a0===_0xbe3865){_0x54e8c2[_0x3dc15b]=_0x3ae39a[_0xd4bd('0x42')];}}});}return _0x54e8c2;}function getTicket(_0x394b2a,_0x3ae8b9,_0x36e54d,_0x2f3caf,_0x26504d,_0x2bf57d,_0x2d29d4){return new Promise(function(_0x56da19,_0xfadd96){var _0x5a0312;return getAuthToken(_0x3ae8b9,_0x36e54d,_0x2d29d4)[_0xd4bd('0x14')](function(_0x2200bf){if(_0x2bf57d[_0xd4bd('0x43')]===_0xd4bd('0x44')){_0x5a0312={'method':_0xd4bd('0xf'),'uri':_0x2f3caf+'incidents','body':Object[_0xd4bd('0x45')]({},{'title':intUtil['getString'](_0x2bf57d[_0xd4bd('0x46')],_0x26504d,'\x20'),'description':intUtil['getString'](_0x2bf57d[_0xd4bd('0x47')],_0x26504d,'\x0a'),'customerid_contact@odata.bind':_0x394b2a[_0xd4bd('0x38')]?_0xd4bd('0x48')+_0x394b2a[_0xd4bd('0x38')]+')':undefined,'ownerid@odata.bind':_0xd4bd('0x29')+_0x394b2a[_0xd4bd('0x26')]+')','caseorigincode':'1'},getCustomFields(_0x2bf57d[_0xd4bd('0x49')],_0x26504d,_0x2bf57d[_0xd4bd('0x43')])),'headers':{'Authorization':'Bearer\x20'+_0x2200bf,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x2bf57d[_0xd4bd('0x43')]===_0xd4bd('0x4a')){var _0x231533=_0x394b2a['enduserId']?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x394b2a[_0xd4bd('0x26')]+')','participationtypemask':_0x394b2a[_0xd4bd('0x4b')]===_0xd4bd('0x4c')?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x394b2a['enduserId']+')','participationtypemask':_0x394b2a[_0xd4bd('0x4b')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0xd4bd('0x29')+_0x394b2a[_0xd4bd('0x26')]+')','participationtypemask':_0x394b2a[_0xd4bd('0x4b')]==='queue'?0x2:0x1}];_0x5a0312={'method':_0xd4bd('0xf'),'uri':_0x2f3caf+_0xd4bd('0x4d'),'body':Object['assign']({},{'subject':intUtil[_0xd4bd('0x4e')](_0x2bf57d['Subjects'],_0x26504d,'\x20'),'phonenumber':String(_0x26504d[_0xd4bd('0x31')]),'description':intUtil[_0xd4bd('0x4e')](_0x2bf57d[_0xd4bd('0x47')],_0x26504d,'\x0a'),'regardingobjectid_contact@odata.bind':_0x394b2a['enduserId']?_0xd4bd('0x48')+_0x394b2a['enduserId']+')':undefined,'ownerid@odata.bind':_0xd4bd('0x29')+_0x394b2a[_0xd4bd('0x26')]+')','directioncode':_0x394b2a['callDirection']===_0xd4bd('0x4c')?![]:!![],'phonecall_activity_parties':_0x231533},getCustomFields(_0x2bf57d[_0xd4bd('0x49')],_0x26504d,_0x2bf57d['ticketType'])),'headers':{'Authorization':_0xd4bd('0x1a')+_0x2200bf,'OData-Version':_0xd4bd('0x2a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5a0312);})[_0xd4bd('0x14')](function(_0x1080ac){var _0x3a27d1=_0x1080ac[_0xd4bd('0x2c')][_0xd4bd('0x2d')];var _0x3a4aac=_0x3a27d1[_0xd4bd('0x2e')](_0x3a27d1[_0xd4bd('0x4f')]('(')+0x1,_0x3a27d1[_0xd4bd('0x4f')](')'));_0x394b2a[_0xd4bd('0x50')]=_0x3a4aac;_0x56da19(_0x394b2a);})['catch'](function(_0x29111c){_0xfadd96(_0x29111c[_0xd4bd('0x19')]);});});}function emit(_0x1bed31,_0x5c267e,_0x35ce87,_0x351d58){var _0x5bb015={'uri':util[_0xd4bd('0x51')](_0xd4bd('0x52'),_0x1bed31,_0x35ce87,_0x351d58)};io['to'](util['format']('user:%s',_0x5c267e))['emit'](_0xd4bd('0x53'),_0x5bb015);}exports['cs']=function(_0x4dcf0e,_0x3322f,_0x9af33e,_0x7c0456,_0x2184dd,_0x472eed,_0x1653dd,_0x3b5ff7){var _0x3ddb6a={};_0x472eed[_0xd4bd('0x9')]=_0x472eed[_0xd4bd('0x8')]?intUtil[_0xd4bd('0x54')](_0x472eed[_0xd4bd('0xd')][_0xd4bd('0x55')]):intUtil[_0xd4bd('0x54')](_0x472eed[_0xd4bd('0x9')]);_0x472eed[_0xd4bd('0x56')]=intUtil[_0xd4bd('0x54')](_0x472eed['serverUrl']);_0x3ddb6a[_0xd4bd('0x4b')]=_0x3b5ff7===_0xd4bd('0x4c')||_0x3b5ff7===_0xd4bd('0x57')?_0xd4bd('0x4c'):'outbound';var _0x3a0e08=_0x472eed[_0xd4bd('0x8')]?util[_0xd4bd('0x51')](_0xd4bd('0x58'),_0x472eed[_0xd4bd('0xd')]['data7']):util[_0xd4bd('0x51')]('%s/api/data/v9.0/',_0x472eed['remoteUri']);var _0x5a8362=util[_0xd4bd('0x51')]('https://login.microsoftonline.com/%s/oauth2/token',_0x472eed[_0xd4bd('0xa')]);var _0x137d9c=util[_0xd4bd('0x51')](_0xd4bd('0x59'),_0x472eed['serverUrl'],_0x3322f['uniqueid'],md5(_0x3322f[_0xd4bd('0x5a')]));if(_0x2184dd&&_0x2184dd[_0xd4bd('0x5b')]){logger[_0xd4bd('0x25')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3322f[_0xd4bd('0x5c')]=_0x137d9c;}else if(_0x1653dd&&_0x1653dd[_0xd4bd('0x5d')]&&_0x1653dd[_0xd4bd('0x5d')]!==_0xd4bd('0x5e')){logger[_0xd4bd('0x25')](_0xd4bd('0x5f'),_0xd4bd('0x60'));_0x3322f[_0xd4bd('0x5c')]=_0x137d9c;}else{_0x3322f[_0xd4bd('0x5c')]='';}return getUser(_0x3ddb6a,_0x472eed,_0x7c0456,_0x5a8362,_0x3a0e08,_0x3b5ff7)[_0xd4bd('0x14')](function(_0x4ae180){logger[_0xd4bd('0x25')]('['+_0x3b5ff7[_0xd4bd('0x17')]()+']\x20The\x20User\x20ID\x20is:',_0x4ae180['userId']);logger[_0xd4bd('0x25')]('['+_0x3b5ff7[_0xd4bd('0x17')]()+_0xd4bd('0x61'),_0x4ae180[_0xd4bd('0x1f')]);return getEndUser(_0x4ae180,_0x472eed,_0x5a8362,_0x3a0e08,_0x3322f,_0x3b5ff7,_0x9af33e[_0xd4bd('0x62')],_0x9af33e[_0xd4bd('0x63')]);})[_0xd4bd('0x14')](function(_0x10fefa){logger[_0xd4bd('0x25')]('['+_0x3b5ff7[_0xd4bd('0x17')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x10fefa['enduserId']);logger[_0xd4bd('0x25')]('['+_0x3b5ff7[_0xd4bd('0x17')]()+_0xd4bd('0x64'),_0x3322f[_0xd4bd('0x31')]);return getTicket(_0x10fefa,_0x472eed,_0x5a8362,_0x3a0e08,_0x3322f,_0x9af33e,_0x3b5ff7);})[_0xd4bd('0x14')](function(_0x172f03){logger['info'](util[_0xd4bd('0x51')]('['+_0x3b5ff7['toUpperCase']()+_0xd4bd('0x65'),_0x9af33e[_0xd4bd('0x43')],_0x172f03[_0xd4bd('0x50')]));logger[_0xd4bd('0x25')](util[_0xd4bd('0x51')]('['+_0x3b5ff7[_0xd4bd('0x17')]()+_0xd4bd('0x66'),_0x3b5ff7));if(_0x3b5ff7!=='unmanaged'&&_0x9af33e[_0xd4bd('0x67')]){logger[_0xd4bd('0x25')]('['+_0x3b5ff7[_0xd4bd('0x17')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x472eed['remoteUri'],_0x7c0456[_0xd4bd('0x68')],_0x9af33e['ticketType'],_0x172f03[_0xd4bd('0x50')]);}})[_0xd4bd('0x16')](function(_0x39050e){logger[_0xd4bd('0x69')]('['+_0x3b5ff7[_0xd4bd('0x17')]()+_0xd4bd('0x6a'),_0x39050e[_0xd4bd('0x19')]);console[_0xd4bd('0x69')](_0xd4bd('0x6b'),_0x39050e);});}; \ 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 6dc988a..ba11327 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 _0xe3c4=['[QUEUE]','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/helpdesk/tickets/%d','error','outbound','stripTrailingSlash','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','trigger:browser:url','catch','lastevent','toUpperCase','lodash','request-promise','util','ioredis','./util','../../../../config/logger','freshdesk','redis','defaults','localhost','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','remoteUri','Ticket\x20created!','validateEmail','then','length','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','POST','Enduser\x20created.','apiKey','base64','debug','[HTTP]','stringify','GET','map','includes','string','picklist','customField','nameField','toLowerCase','content','toString','type','push','idField','variableName','customVariable','Variable','queue','serverUrl','monitor_format'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe3c4,0x1d8));var _0x4e3c=function(_0x1ff52f,_0x41a2b2){_0x1ff52f=_0x1ff52f-0x0;var _0x3f06c4=_0xe3c4[_0x1ff52f];return _0x3f06c4;};'use strict';var _=require(_0x4e3c('0x0'));var rp=require(_0x4e3c('0x1'));var md5=require('md5');var util=require(_0x4e3c('0x2'));var Redis=require(_0x4e3c('0x3'));var intUtil=require(_0x4e3c('0x4'));var config=require('../../../../config/environment');var logger=require(_0x4e3c('0x5'))(_0x4e3c('0x6'));config[_0x4e3c('0x7')]=_[_0x4e3c('0x8')](config['redis'],{'host':_0x4e3c('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0x4e3c('0xa'),'Accept':'application/json'};function emit(_0x2412e2,_0x2e8983,_0x36de9b){io['to'](_0x2412e2)[_0x4e3c('0xb')](_0x2e8983,_0x36de9b);}function getTicket(_0x38ceeb,_0x5c7526,_0x34dae3,_0x6cc984,_0x4cedf7){logger[_0x4e3c('0xc')](_0x4e3c('0xd'));var _0x3785d1=_[_0x4e3c('0xe')]({'responder_id':_0x5c7526['id'],'requester_id':_0x34dae3['id'],'name':util[_0x4e3c('0xf')]('Caller\x20-\x20%s',_0x4cedf7[_0x4e3c('0x10')]),'phone':_0x4cedf7[_0x4e3c('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x4e3c('0x12')](_0x6cc984[_0x4e3c('0x13')],_0x4cedf7,'\x20'),'description':intUtil[_0x4e3c('0x12')](_0x6cc984[_0x4e3c('0x14')],_0x4cedf7,_0x4e3c('0x15')),'tags':getTags(_0x6cc984[_0x4e3c('0x16')],_0x4e3c('0x17'))},getCustomFields(_0x6cc984[_0x4e3c('0x18')],_0x4cedf7));_0x3785d1[_0x4e3c('0x19')]=_[_0x4e3c('0x1a')](_[_0x4e3c('0x1b')](_0x3785d1[_0x4e3c('0x19')],'id'),_0x4e3c('0x1c'));return request({'uri':util[_0x4e3c('0xf')]('%s/api/v2/tickets',_0x38ceeb[_0x4e3c('0x1d')]),'method':'POST','body':_0x3785d1})['then'](function(_0x4b5cfd){logger['info'](_0x4e3c('0x1e'));return _0x4b5cfd;});}function getUser(_0x3fa3cb,_0x1b6875){if(intUtil[_0x4e3c('0x1f')](_0x1b6875)){return request({'uri':util[_0x4e3c('0xf')]('%s/api/v2/agents',_0x3fa3cb[_0x4e3c('0x1d')]),'qs':{'email':_0x1b6875}})[_0x4e3c('0x20')](function(_0x4e09ef){if(_0x4e09ef[_0x4e3c('0x21')]){logger[_0x4e3c('0xc')]('Agent\x20found!');return _[_0x4e3c('0x22')](_0x4e09ef,function(_0x432ba8){return _0x432ba8['contact'][_0x4e3c('0x23')]===_0x1b6875;});}else{logger[_0x4e3c('0xc')](_0x4e3c('0x24'));return request({'uri':util[_0x4e3c('0xf')](_0x4e3c('0x25'),_0x3fa3cb['remoteUri'])})[_0x4e3c('0x20')](function(_0x51b9fb){logger['info'](_0x4e3c('0x26'));return _0x51b9fb;});}});}else{logger[_0x4e3c('0xc')](_0x4e3c('0x27'));return request({'uri':util[_0x4e3c('0xf')](_0x4e3c('0x25'),_0x3fa3cb[_0x4e3c('0x1d')])})['then'](function(_0x3b5f30){logger[_0x4e3c('0xc')](_0x4e3c('0x26'));return _0x3b5f30;});}}function getEndUser(_0x108f18,_0x5c2075,_0x487cea){logger[_0x4e3c('0xc')]('Searching\x20enduser\x20with\x20phone',_0x487cea);return request({'uri':util['format']('%s/api/v2/contacts',_0x108f18[_0x4e3c('0x1d')]),'qs':{'phone':_0x487cea}})[_0x4e3c('0x20')](function(_0x92fdd5){if(_0x92fdd5[_0x4e3c('0x21')]){logger[_0x4e3c('0xc')]('Enduser\x20found!');return _[_0x4e3c('0x22')](_0x92fdd5,{'phone':_0x487cea});}else{logger['info'](_0x4e3c('0x28'));return request({'uri':util[_0x4e3c('0xf')](_0x4e3c('0x29'),_0x108f18[_0x4e3c('0x1d')]),'method':_0x4e3c('0x2a'),'body':{'name':_0x5c2075,'phone':_0x487cea}})['then'](function(_0x2a8461){logger[_0x4e3c('0xc')](_0x4e3c('0x2b'));return _0x2a8461;});}});}function getAuth(_0x1272c3){return util[_0x4e3c('0xf')]('Basic\x20%s',new Buffer(_0x1272c3[_0x4e3c('0x2c')]+':X')['toString'](_0x4e3c('0x2d')));}function request(_0x326312){logger[_0x4e3c('0x2e')](_0x4e3c('0x2f'),JSON[_0x4e3c('0x30')](_0x326312));return rp(_[_0x4e3c('0x8')](_0x326312,{'method':_0x4e3c('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x1046af,_0x2a8a97){var _0x117f8a=[];if(_0x1046af&&_0x1046af['length']>0x0){_0x117f8a=_[_0x4e3c('0x32')](_0x1046af,_0x2a8a97);}return _0x117f8a;}function getCustomFields(_0x5028c4,_0xb42386){var _0x1ad371=[];var _0x21794a={'custom_fields':[]};if(_0x5028c4[_0x4e3c('0x21')]>0x0){_['forEach'](_0x5028c4,function(_0x59b1c8){if(_[_0x4e3c('0x33')]([_0x4e3c('0x34'),_0x4e3c('0x35')],_0x59b1c8['type'])&&_0x59b1c8['nameField']&&!_0x59b1c8[_0x4e3c('0x36')]){_0x21794a[_0x59b1c8[_0x4e3c('0x37')][_0x4e3c('0x38')]()]=_0x59b1c8[_0x4e3c('0x39')][_0x4e3c('0x3a')]();}else if(_['includes'](['string',_0x4e3c('0x35')],_0x59b1c8[_0x4e3c('0x3b')])&&_0x59b1c8['idField']&&_0x59b1c8[_0x4e3c('0x36')]){_0x21794a[_0x4e3c('0x19')][_0x4e3c('0x3c')]({'id':_0x59b1c8[_0x4e3c('0x3d')],'value':_0x59b1c8['content'][_0x4e3c('0x3a')]()});}else if(_0x59b1c8[_0x4e3c('0x3b')]==='variable'&&_0x59b1c8[_0x4e3c('0x3e')]&&_0x59b1c8[_0x4e3c('0x3d')]&&_0x59b1c8[_0x4e3c('0x36')]){_0xb42386[_0x59b1c8['variableName']]&&_0x21794a[_0x4e3c('0x19')][_0x4e3c('0x3c')]({'id':_0x59b1c8[_0x4e3c('0x3d')],'value':_0xb42386[_0x59b1c8[_0x4e3c('0x3e')]][_0x4e3c('0x3a')]()});}else if(_0x59b1c8['type']===_0x4e3c('0x3f')&&_0x59b1c8[_0x4e3c('0x40')]&&_0x59b1c8[_0x4e3c('0x40')][_0x4e3c('0x17')]&&_0x59b1c8[_0x4e3c('0x3d')]&&_0x59b1c8['customField']){_0xb42386[_0x59b1c8[_0x4e3c('0x40')]['name'][_0x4e3c('0x38')]()]&&_0x21794a[_0x4e3c('0x19')][_0x4e3c('0x3c')]({'id':_0x59b1c8[_0x4e3c('0x3d')],'value':_0xb42386[_0x59b1c8[_0x4e3c('0x40')][_0x4e3c('0x17')]['toLowerCase']()][_0x4e3c('0x3a')]()});}});}return _0x21794a;}exports[_0x4e3c('0x41')]=function(_0xbb1ae2,_0x3727d7,_0x59ae6f,_0x49ed81,_0x3fadbe,_0x58dfcd){var _0x9f941b,_0x12274b;_0x58dfcd[_0x4e3c('0x1d')]=intUtil['stripTrailingSlash'](_0x58dfcd[_0x4e3c('0x1d')]);_0x58dfcd['serverUrl']=intUtil['stripTrailingSlash'](_0x58dfcd[_0x4e3c('0x42')]);if(_0x3fadbe&&_0x3fadbe[_0x4e3c('0x43')]){logger[_0x4e3c('0xc')](_0x4e3c('0x44'),'Recording\x20is\x20enabled!');_0x3727d7[_0x4e3c('0x45')]=util[_0x4e3c('0xf')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x58dfcd['serverUrl'],_0x3727d7[_0x4e3c('0x46')],md5(_0x3727d7[_0x4e3c('0x46')]));}else{_0x3727d7[_0x4e3c('0x45')]='';}headers[_0x4e3c('0x47')]=getAuth(_0x58dfcd);return getUser(_0x58dfcd,_0x49ed81[_0x4e3c('0x23')])['then'](function(_0x298568){_0x9f941b=_0x298568;logger[_0x4e3c('0xc')](_0x4e3c('0x48'),_0x9f941b['id']);return getEndUser(_0x58dfcd,_0x3727d7[_0x4e3c('0x10')],_0x3727d7[_0x4e3c('0x11')]);})[_0x4e3c('0x20')](function(_0x23e4ab){_0x12274b=_0x23e4ab;logger[_0x4e3c('0xc')]('The\x20Enduser\x20ID\x20is:',_0x12274b['id']);return getTicket(_0x58dfcd,_0x9f941b,_0x12274b,_0x59ae6f,_0x3727d7);})[_0x4e3c('0x20')](function(_0x3c9c2b){if(_0x3c9c2b&&_0x3c9c2b['id']){logger[_0x4e3c('0xc')]('Ticket\x20created!');logger['info'](_0x4e3c('0x49'),_0x3c9c2b['id']);logger['info'](_0x4e3c('0x44'),_0x4e3c('0x4a'));emit(util['format']('user:%s',_0x49ed81[_0x4e3c('0x17')]),'trigger:browser:url',{'uri':util['format'](_0x4e3c('0x4b'),_0x58dfcd[_0x4e3c('0x1d')],_0x3c9c2b['id'])});}})['catch'](function(_0x4735f7){logger[_0x4e3c('0x4c')](_0x4e3c('0x44'),JSON['stringify'](_0x4735f7));});};exports[_0x4e3c('0x4d')]=function(_0x31b630,_0x1ddd8a,_0x53621d,_0x416a3b,_0x454970,_0x19f47e,_0x170e5c){var _0x1dae7b,_0x7de13e;_0x19f47e['remoteUri']=intUtil[_0x4e3c('0x4e')](_0x19f47e[_0x4e3c('0x1d')]);_0x19f47e['serverUrl']=intUtil[_0x4e3c('0x4e')](_0x19f47e[_0x4e3c('0x42')]);if(_0x170e5c&&_0x170e5c[_0x4e3c('0x4f')]&&_0x170e5c['recordingFormat']!=='none'){logger[_0x4e3c('0xc')](_0x4e3c('0x50'),_0x4e3c('0x51'));_0x1ddd8a[_0x4e3c('0x45')]=util['format'](_0x4e3c('0x52'),_0x19f47e[_0x4e3c('0x42')],_0x1ddd8a[_0x4e3c('0x46')],md5(_0x1ddd8a[_0x4e3c('0x46')]));}headers[_0x4e3c('0x47')]=getAuth(_0x19f47e);return getUser(_0x19f47e,_0x416a3b[_0x4e3c('0x23')])[_0x4e3c('0x20')](function(_0x2da629){_0x1dae7b=_0x2da629;logger['info']('The\x20User\x20ID\x20is:',_0x1dae7b['id']);return getEndUser(_0x19f47e,_0x1ddd8a[_0x4e3c('0x53')],_0x1ddd8a[_0x4e3c('0x54')]);})[_0x4e3c('0x20')](function(_0x18cf17){_0x7de13e=_0x18cf17;logger[_0x4e3c('0xc')](_0x4e3c('0x55'),_0x7de13e['id']);return getTicket(_0x19f47e,_0x1dae7b,_0x7de13e,_0x53621d,_0x1ddd8a);})[_0x4e3c('0x20')](function(_0x2154e9){if(_0x2154e9&&_0x2154e9['id']){logger[_0x4e3c('0xc')](_0x4e3c('0x1e'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x2154e9['id']);logger[_0x4e3c('0xc')]('[OUTBOUND]',_0x4e3c('0x4a'));emit(util[_0x4e3c('0xf')]('user:%s',_0x416a3b[_0x4e3c('0x17')]),_0x4e3c('0x56'),{'uri':util['format'](_0x4e3c('0x4b'),_0x19f47e[_0x4e3c('0x1d')],_0x2154e9['id'])});}})[_0x4e3c('0x57')](function(_0x279309){logger['error']('[OUTBOUND]',JSON[_0x4e3c('0x30')](_0x279309));});};exports['unmanaged']=function(_0x34f2f4,_0xf67048,_0x16ce83,_0x6811ab,_0x467362,_0x5bf282){var _0x4a94f3,_0x3fc72f;_0x5bf282[_0x4e3c('0x1d')]=intUtil[_0x4e3c('0x4e')](_0x5bf282[_0x4e3c('0x1d')]);_0x5bf282[_0x4e3c('0x42')]=intUtil[_0x4e3c('0x4e')](_0x5bf282[_0x4e3c('0x42')]);if(_0x467362&&_0x467362['monitor_format']){logger[_0x4e3c('0xc')]('['+_0xf67048[_0x4e3c('0x58')]['toUpperCase']()+']',_0x4e3c('0x51'));_0xf67048[_0x4e3c('0x45')]=util[_0x4e3c('0xf')](_0x4e3c('0x52'),_0x5bf282['serverUrl'],_0xf67048[_0x4e3c('0x46')],md5(_0xf67048[_0x4e3c('0x46')]));}else{_0xf67048[_0x4e3c('0x45')]='';}headers[_0x4e3c('0x47')]=getAuth(_0x5bf282);return getUser(_0x5bf282,'')[_0x4e3c('0x20')](function(_0x5d2446){_0x4a94f3=_0x5d2446;logger[_0x4e3c('0xc')](_0x4e3c('0x48'),_0x4a94f3['id']);return getEndUser(_0x5bf282,_0xf67048[_0x4e3c('0x10')],_0xf67048[_0x4e3c('0x11')]);})[_0x4e3c('0x20')](function(_0x5b0e25){_0x3fc72f=_0x5b0e25;logger[_0x4e3c('0xc')]('The\x20Enduser\x20ID\x20is:',_0x3fc72f['id']);return getTicket(_0x5bf282,_0x4a94f3,_0x3fc72f,_0x16ce83,_0xf67048);})[_0x4e3c('0x20')](function(_0x52f80c){if(_0x52f80c){logger['info'](_0x4e3c('0x1e'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x52f80c['id']);}})[_0x4e3c('0x57')](function(_0x6cd82f){logger['error']('['+_0xf67048['lastevent'][_0x4e3c('0x59')]()+']',JSON[_0x4e3c('0x30')](_0x6cd82f));});}; \ No newline at end of file +var _0x7006=['idField','push','type','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','[QUEUE]','outbound','serverUrl','recordingFormat','none','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','catch','error','[OUTBOUND]','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','%s/api/v2/tickets','remoteUri','then','Ticket\x20created!','validateEmail','length','Agent\x20found!','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','apiKey','toString','base64','debug','[HTTP]','stringify','map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content'];(function(_0x5dca06,_0x507d61){var _0x35443b=function(_0x38d37d){while(--_0x38d37d){_0x5dca06['push'](_0x5dca06['shift']());}};_0x35443b(++_0x507d61);}(_0x7006,0xe9));var _0x6700=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x7006[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x6700('0x0'));var rp=require(_0x6700('0x1'));var md5=require(_0x6700('0x2'));var util=require(_0x6700('0x3'));var Redis=require(_0x6700('0x4'));var intUtil=require(_0x6700('0x5'));var config=require('../../../../config/environment');var logger=require(_0x6700('0x6'))(_0x6700('0x7'));config[_0x6700('0x8')]=_[_0x6700('0x9')](config[_0x6700('0x8')],{'host':_0x6700('0xa'),'port':0x18eb});var io=require(_0x6700('0xb'))(new Redis(config[_0x6700('0x8')]));var headers={'Content-Type':_0x6700('0xc'),'Accept':_0x6700('0xc')};function emit(_0x2396fc,_0x17a439,_0x25f9d7){io['to'](_0x2396fc)[_0x6700('0xd')](_0x17a439,_0x25f9d7);}function getTicket(_0x4509de,_0x10e49f,_0x23aac6,_0x56805a,_0x3a4e93){logger[_0x6700('0xe')](_0x6700('0xf'));var _0x4aae03=_[_0x6700('0x10')]({'responder_id':_0x10e49f['id'],'requester_id':_0x23aac6['id'],'name':util[_0x6700('0x11')](_0x6700('0x12'),_0x3a4e93[_0x6700('0x13')]),'phone':_0x3a4e93['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x6700('0x14')](_0x56805a[_0x6700('0x15')],_0x3a4e93,'\x20'),'description':intUtil[_0x6700('0x14')](_0x56805a[_0x6700('0x16')],_0x3a4e93,_0x6700('0x17')),'tags':getTags(_0x56805a[_0x6700('0x18')],_0x6700('0x19'))},getCustomFields(_0x56805a[_0x6700('0x1a')],_0x3a4e93));_0x4aae03[_0x6700('0x1b')]=_[_0x6700('0x1c')](_[_0x6700('0x1d')](_0x4aae03['custom_fields'],'id'),_0x6700('0x1e'));return request({'uri':util['format'](_0x6700('0x1f'),_0x4509de[_0x6700('0x20')]),'method':'POST','body':_0x4aae03})[_0x6700('0x21')](function(_0x1a2a1d){logger[_0x6700('0xe')](_0x6700('0x22'));return _0x1a2a1d;});}function getUser(_0x20e6ce,_0x42077a){if(intUtil[_0x6700('0x23')](_0x42077a)){return request({'uri':util[_0x6700('0x11')]('%s/api/v2/agents',_0x20e6ce[_0x6700('0x20')]),'qs':{'email':_0x42077a}})[_0x6700('0x21')](function(_0x40d3c7){if(_0x40d3c7[_0x6700('0x24')]){logger[_0x6700('0xe')](_0x6700('0x25'));return _[_0x6700('0x26')](_0x40d3c7,function(_0x4d45af){return _0x4d45af['contact'][_0x6700('0x27')]===_0x42077a;});}else{logger['info'](_0x6700('0x28'));return request({'uri':util[_0x6700('0x11')]('%s/api/v2/agents/me',_0x20e6ce[_0x6700('0x20')])})[_0x6700('0x21')](function(_0x170b55){logger['info'](_0x6700('0x29'));return _0x170b55;});}});}else{logger[_0x6700('0xe')](_0x6700('0x2a'));return request({'uri':util['format'](_0x6700('0x2b'),_0x20e6ce[_0x6700('0x20')])})[_0x6700('0x21')](function(_0x2490e2){logger['info'](_0x6700('0x29'));return _0x2490e2;});}}function getEndUser(_0x53183f,_0x5ca46c,_0x16e343){logger[_0x6700('0xe')](_0x6700('0x2c'),_0x16e343);return request({'uri':util['format']('%s/api/v2/contacts',_0x53183f[_0x6700('0x20')]),'qs':{'phone':_0x16e343}})['then'](function(_0x15e4a4){if(_0x15e4a4[_0x6700('0x24')]){logger['info'](_0x6700('0x2d'));return _[_0x6700('0x26')](_0x15e4a4,{'phone':_0x16e343});}else{logger['info'](_0x6700('0x2e'));return request({'uri':util[_0x6700('0x11')](_0x6700('0x2f'),_0x53183f[_0x6700('0x20')]),'method':'POST','body':{'name':_0x5ca46c,'phone':_0x16e343}})[_0x6700('0x21')](function(_0x399ed5){logger[_0x6700('0xe')](_0x6700('0x30'));return _0x399ed5;});}});}function getAuth(_0x2adbad){return util['format']('Basic\x20%s',new Buffer(_0x2adbad[_0x6700('0x31')]+':X')[_0x6700('0x32')](_0x6700('0x33')));}function request(_0x2defbb){logger[_0x6700('0x34')](_0x6700('0x35'),JSON[_0x6700('0x36')](_0x2defbb));return rp(_[_0x6700('0x9')](_0x2defbb,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x320c3c,_0x46ff46){var _0x415867=[];if(_0x320c3c&&_0x320c3c[_0x6700('0x24')]>0x0){_0x415867=_[_0x6700('0x37')](_0x320c3c,_0x46ff46);}return _0x415867;}function getCustomFields(_0x49122e,_0xb35a7){var _0x112729=[];var _0x4b510b={'custom_fields':[]};if(_0x49122e[_0x6700('0x24')]>0x0){_[_0x6700('0x38')](_0x49122e,function(_0x167e1a){if(_[_0x6700('0x39')]([_0x6700('0x3a'),_0x6700('0x3b')],_0x167e1a['type'])&&_0x167e1a[_0x6700('0x3c')]&&!_0x167e1a[_0x6700('0x3d')]){_0x4b510b[_0x167e1a['nameField'][_0x6700('0x3e')]()]=_0x167e1a[_0x6700('0x3f')]['toString']();}else if(_[_0x6700('0x39')]([_0x6700('0x3a'),_0x6700('0x3b')],_0x167e1a['type'])&&_0x167e1a[_0x6700('0x40')]&&_0x167e1a[_0x6700('0x3d')]){_0x4b510b[_0x6700('0x1b')][_0x6700('0x41')]({'id':_0x167e1a[_0x6700('0x40')],'value':_0x167e1a[_0x6700('0x3f')]['toString']()});}else if(_0x167e1a[_0x6700('0x42')]===_0x6700('0x43')&&_0x167e1a[_0x6700('0x44')]&&_0x167e1a[_0x6700('0x40')]&&_0x167e1a[_0x6700('0x3d')]){_0xb35a7[_0x167e1a[_0x6700('0x44')]]&&_0x4b510b['custom_fields'][_0x6700('0x41')]({'id':_0x167e1a['idField'],'value':_0xb35a7[_0x167e1a['variableName']][_0x6700('0x32')]()});}else if(_0x167e1a[_0x6700('0x42')]===_0x6700('0x45')&&_0x167e1a[_0x6700('0x46')]&&_0x167e1a['Variable'][_0x6700('0x19')]&&_0x167e1a[_0x6700('0x40')]&&_0x167e1a[_0x6700('0x3d')]){_0xb35a7[_0x167e1a[_0x6700('0x46')][_0x6700('0x19')][_0x6700('0x3e')]()]&&_0x4b510b[_0x6700('0x1b')][_0x6700('0x41')]({'id':_0x167e1a[_0x6700('0x40')],'value':_0xb35a7[_0x167e1a['Variable']['name'][_0x6700('0x3e')]()][_0x6700('0x32')]()});}});}return _0x4b510b;}exports[_0x6700('0x47')]=function(_0x3b787a,_0x2dfdd5,_0x110dc7,_0x2c4f06,_0x433191,_0x11c520){var _0x182e06,_0x172ce8;_0x11c520[_0x6700('0x20')]=intUtil['stripTrailingSlash'](_0x11c520['remoteUri']);_0x11c520['serverUrl']=intUtil[_0x6700('0x48')](_0x11c520['serverUrl']);if(_0x433191&&_0x433191[_0x6700('0x49')]){logger[_0x6700('0xe')]('[QUEUE]','Recording\x20is\x20enabled!');_0x2dfdd5[_0x6700('0x4a')]=util[_0x6700('0x11')](_0x6700('0x4b'),_0x11c520['serverUrl'],_0x2dfdd5['uniqueid'],md5(_0x2dfdd5[_0x6700('0x4c')]));}else{_0x2dfdd5['recordingURL']='';}headers[_0x6700('0x4d')]=getAuth(_0x11c520);return getUser(_0x11c520,_0x2c4f06[_0x6700('0x27')])[_0x6700('0x21')](function(_0x4f408d){_0x182e06=_0x4f408d;logger[_0x6700('0xe')]('The\x20User\x20ID\x20is:',_0x182e06['id']);return getEndUser(_0x11c520,_0x2dfdd5['calleridname'],_0x2dfdd5[_0x6700('0x4e')]);})[_0x6700('0x21')](function(_0xd7ff73){_0x172ce8=_0xd7ff73;logger[_0x6700('0xe')](_0x6700('0x4f'),_0x172ce8['id']);return getTicket(_0x11c520,_0x182e06,_0x172ce8,_0x110dc7,_0x2dfdd5);})[_0x6700('0x21')](function(_0x350c21){if(_0x350c21&&_0x350c21['id']){logger[_0x6700('0xe')](_0x6700('0x22'));logger[_0x6700('0xe')](_0x6700('0x50'),_0x350c21['id']);logger[_0x6700('0xe')]('[QUEUE]',_0x6700('0x51'));emit(util[_0x6700('0x11')](_0x6700('0x52'),_0x2c4f06[_0x6700('0x19')]),_0x6700('0x53'),{'uri':util['format'](_0x6700('0x54'),_0x11c520[_0x6700('0x20')],_0x350c21['id'])});}})['catch'](function(_0x18d7b8){logger['error'](_0x6700('0x55'),JSON[_0x6700('0x36')](_0x18d7b8));});};exports[_0x6700('0x56')]=function(_0x2151a2,_0x44dc0a,_0x390121,_0x25b1cf,_0x1460ce,_0x15aa1a,_0x18e51a){var _0x12cd4e,_0xb2608c;_0x15aa1a[_0x6700('0x20')]=intUtil[_0x6700('0x48')](_0x15aa1a[_0x6700('0x20')]);_0x15aa1a[_0x6700('0x57')]=intUtil['stripTrailingSlash'](_0x15aa1a['serverUrl']);if(_0x18e51a&&_0x18e51a[_0x6700('0x58')]&&_0x18e51a['recordingFormat']!==_0x6700('0x59')){logger[_0x6700('0xe')]('[OUTBOUND]',_0x6700('0x5a'));_0x44dc0a[_0x6700('0x4a')]=util[_0x6700('0x11')](_0x6700('0x4b'),_0x15aa1a[_0x6700('0x57')],_0x44dc0a[_0x6700('0x4c')],md5(_0x44dc0a[_0x6700('0x4c')]));}headers[_0x6700('0x4d')]=getAuth(_0x15aa1a);return getUser(_0x15aa1a,_0x25b1cf[_0x6700('0x27')])[_0x6700('0x21')](function(_0x2f8e2b){_0x12cd4e=_0x2f8e2b;logger[_0x6700('0xe')](_0x6700('0x5b'),_0x12cd4e['id']);return getEndUser(_0x15aa1a,_0x44dc0a[_0x6700('0x5c')],_0x44dc0a['destcalleridnum']);})[_0x6700('0x21')](function(_0x21a8fc){_0xb2608c=_0x21a8fc;logger[_0x6700('0xe')](_0x6700('0x4f'),_0xb2608c['id']);return getTicket(_0x15aa1a,_0x12cd4e,_0xb2608c,_0x390121,_0x44dc0a);})[_0x6700('0x21')](function(_0x4b5130){if(_0x4b5130&&_0x4b5130['id']){logger['info'](_0x6700('0x22'));logger['info'](_0x6700('0x50'),_0x4b5130['id']);logger[_0x6700('0xe')]('[OUTBOUND]',_0x6700('0x51'));emit(util[_0x6700('0x11')](_0x6700('0x52'),_0x25b1cf[_0x6700('0x19')]),'trigger:browser:url',{'uri':util[_0x6700('0x11')](_0x6700('0x54'),_0x15aa1a[_0x6700('0x20')],_0x4b5130['id'])});}})[_0x6700('0x5d')](function(_0x4304c4){logger[_0x6700('0x5e')](_0x6700('0x5f'),JSON[_0x6700('0x36')](_0x4304c4));});};exports[_0x6700('0x60')]=function(_0x547c26,_0x2f4b51,_0x4d1499,_0x49fe25,_0x4231f9,_0x4e61c0){var _0x58af82,_0x3dbeac;_0x4e61c0[_0x6700('0x20')]=intUtil[_0x6700('0x48')](_0x4e61c0[_0x6700('0x20')]);_0x4e61c0['serverUrl']=intUtil[_0x6700('0x48')](_0x4e61c0[_0x6700('0x57')]);if(_0x4231f9&&_0x4231f9['monitor_format']){logger[_0x6700('0xe')]('['+_0x2f4b51[_0x6700('0x61')][_0x6700('0x62')]()+']',_0x6700('0x5a'));_0x2f4b51[_0x6700('0x4a')]=util['format'](_0x6700('0x4b'),_0x4e61c0[_0x6700('0x57')],_0x2f4b51[_0x6700('0x4c')],md5(_0x2f4b51[_0x6700('0x4c')]));}else{_0x2f4b51[_0x6700('0x4a')]='';}headers[_0x6700('0x4d')]=getAuth(_0x4e61c0);return getUser(_0x4e61c0,'')[_0x6700('0x21')](function(_0x56044){_0x58af82=_0x56044;logger[_0x6700('0xe')](_0x6700('0x5b'),_0x58af82['id']);return getEndUser(_0x4e61c0,_0x2f4b51['calleridname'],_0x2f4b51[_0x6700('0x4e')]);})[_0x6700('0x21')](function(_0x59c720){_0x3dbeac=_0x59c720;logger[_0x6700('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3dbeac['id']);return getTicket(_0x4e61c0,_0x58af82,_0x3dbeac,_0x4d1499,_0x2f4b51);})[_0x6700('0x21')](function(_0x573a3d){if(_0x573a3d){logger['info'](_0x6700('0x22'));logger[_0x6700('0xe')](_0x6700('0x50'),_0x573a3d['id']);}})[_0x6700('0x5d')](function(_0x1365af){logger[_0x6700('0x5e')]('['+_0x2f4b51[_0x6700('0x61')][_0x6700('0x62')]()+']',JSON[_0x6700('0x36')](_0x1365af));});}; \ 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 9963084..ddc0716 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 _0x051e=['The\x20ticket\x20ID\x20is:\x20%s','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','GET','headers','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','error','/api/selector/owners','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','message','/api/lookup?q=','&f=','&entities=contact','contacts','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','POST','format','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','toUpperCase','/api/tasks','getString','Subjects','Descriptions','YYYY-MM-DDTHH:mm:ss','add','task','Task\x20created:','ticketId','user:%s','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','destcalleridnum','calleridnum','callDirection','queue','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x051e,0x1ea));var _0xe051=function(_0x410800,_0x3ea17a){_0x410800=_0x410800-0x0;var _0xbd45a2=_0x051e[_0x410800];return _0xbd45a2;};'use strict';var _=require(_0xe051('0x0'));var rp=require(_0xe051('0x1'));var md5=require('md5');var util=require(_0xe051('0x2'));var moment=require('moment');var Promise=require('bluebird');var Redis=require(_0xe051('0x3'));var intUtil=require(_0xe051('0x4'));var config=require(_0xe051('0x5'));var logger=require(_0xe051('0x6'))('freshsales');config[_0xe051('0x7')]=_[_0xe051('0x8')](config[_0xe051('0x7')],{'host':_0xe051('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x4b647,_0x406f5e,_0xed2076,_0x26165e){return new Promise(function(_0xf3ffc6,_0x3d9810){var _0x2ed93e=![];var _0x2a0c8f={'method':_0xe051('0xa'),'uri':_0x26165e+'/api/selector/owners','json':!![]};_0x2a0c8f[_0xe051('0xb')]=_0xed2076;logger[_0xe051('0xc')](_0xe051('0xd'));return rp(_0x2a0c8f)[_0xe051('0xe')](function(_0x3903dc){if(_0x3903dc){var _0x5dbd8d=_0x3903dc[_0xe051('0xf')];var _0x14210a=null;for(_0x14210a=0x0;_0x14210a<_0x5dbd8d[_0xe051('0x10')];_0x14210a++){if(_0x5dbd8d[_0x14210a][_0xe051('0x11')]===_0x4b647[_0xe051('0x12')]){_0x4b647['adminId']=_0x5dbd8d[_0x14210a]['id'];_0x2ed93e=!![];}}if(_0x2ed93e){logger[_0xe051('0xc')](_0xe051('0x13'),_0x4b647[_0xe051('0x14')]);_0xf3ffc6(_0x4b647);}else{_0x3d9810({'statusCode':0x194,'message':_0xe051('0x15')});}}else{_0x3d9810({'statusCode':0x194,'message':_0xe051('0x15')});}})[_0xe051('0x16')](function(_0x3f3bf9){logger[_0xe051('0x17')]('['+[_0x406f5e['toUpperCase']()]+']',_0x3f3bf9['message']);_0x3d9810(_0x3f3bf9);});});}function getUser(_0x177438,_0x46c62e,_0x5803a7){return function(_0x54086b){return new Promise(function(_0x23646c,_0x45e1f0){var _0x1fd463={'method':_0xe051('0xa'),'uri':_0x5803a7+_0xe051('0x18'),'json':!![]};_0x1fd463[_0xe051('0xb')]=_0x46c62e;logger['info'](_0xe051('0x19'));return rp(_0x1fd463)['then'](function(_0x28b47a){if(_0x28b47a){var _0x19b9f6=_0x28b47a['users'];var _0xf4882f=![];var _0xff4f8a=null;if(_0x54086b[_0xe051('0x1a')]!==null){logger[_0xe051('0xc')](_0xe051('0x1b'),_0x54086b[_0xe051('0x1a')]);_0x54086b[_0xe051('0x1c')]=_0x54086b[_0xe051('0x1a')];for(_0xff4f8a=0x0;_0xff4f8a<_0x19b9f6['length'];_0xff4f8a++){if(_0x19b9f6[_0xff4f8a]['email']===_0x54086b[_0xe051('0x1a')]){_0xf4882f=!![];_0x54086b[_0xe051('0x1d')]=_0x19b9f6[_0xff4f8a]['id'];logger[_0xe051('0xc')](_0xe051('0x1e'),_0x54086b[_0xe051('0x1d')]);}}}if(!_0xf4882f){logger[_0xe051('0xc')](_0xe051('0x1f'));_0x54086b[_0xe051('0x1c')]=_0x54086b['adminEmail'];_0x54086b['userId']=_0x54086b[_0xe051('0x14')];_0xf4882f=!![];}if(_0xf4882f){_0x23646c(_0x54086b);}else{_0x45e1f0({'statusCode':0x194,'message':_0xe051('0x15')});}}else{_0x45e1f0({'statusCode':0x194,'message':_0xe051('0x15')});}})[_0xe051('0x16')](function(_0x392b48){logger['error']('['+[_0x177438['toUpperCase']()]+']',_0x392b48[_0xe051('0x20')]);_0x45e1f0(_0x392b48);});});};}function searchContact(_0x43dddf,_0x1cade1,_0x23eeb2,_0x1c1dce){return new Promise(function(_0x44e2a4,_0x3766c8){var _0x384f45={'method':_0xe051('0xa'),'headers':_0x1cade1,'uri':_0x43dddf+_0xe051('0x21')+_0x1c1dce+_0xe051('0x22')+_0x23eeb2+_0xe051('0x23'),'json':!![]};rp(_0x384f45)['then'](function(_0x2f66e4){var _0x15af5c=_['find'](_0x2f66e4[_0xe051('0x24')]['contacts'],[_0x23eeb2,_0x1c1dce]);_0x44e2a4(_0x15af5c);})['catch'](function(_0x25b13c){_0x3766c8(_0x25b13c);});});}function getEndUser(_0x25a39b,_0x3e1fca,_0x3b45e2){return function(_0x58d48a){return new Promise(function(_0x9dbb63,_0x1dd761){logger['info'](util['format'](_0xe051('0x25'),_0x58d48a[_0xe051('0x26')]));searchContact(_0x3b45e2,_0x3e1fca,_0xe051('0x27'),_0x58d48a[_0xe051('0x26')])[_0xe051('0xe')](function(_0x1ba124){if(_0x1ba124){_0x58d48a[_0xe051('0x28')]=_0x1ba124['id'];logger[_0xe051('0xc')](_0xe051('0x29'),_0x58d48a[_0xe051('0x28')]);return _0x9dbb63(_0x58d48a);}searchContact(_0x3b45e2,_0x3e1fca,_0xe051('0x2a'),_0x58d48a[_0xe051('0x26')])[_0xe051('0xe')](function(_0x3e45d2){if(_0x3e45d2){_0x58d48a[_0xe051('0x28')]=_0x3e45d2['id'];logger[_0xe051('0xc')](_0xe051('0x2b'),_0x58d48a[_0xe051('0x28')]);return _0x9dbb63(_0x58d48a);}createEndUser(_0x58d48a,_0x25a39b,_0x3e1fca,_0x3b45e2)[_0xe051('0xe')](function(_0x41ecef){logger[_0xe051('0xc')]('Contact\x20created:',_0x41ecef['endUserId']);return _0x9dbb63(_0x41ecef);});});})[_0xe051('0x16')](function(_0x16bbc0){_0x1dd761(_0x16bbc0);});});};}function createEndUser(_0x326a94,_0x1c143b,_0x47a5e3,_0x1332ac){return new Promise(function(_0x4d14b4,_0x426544){var _0xccb822=moment();var _0xabfa94={'method':_0xe051('0x2c'),'uri':_0x1332ac+'/api/contacts','body':{'contact':{'last_name':_0x326a94[_0xe051('0x26')],'work_number':_0x326a94[_0xe051('0x26')],'mobile_number':_0x326a94[_0xe051('0x26')],'owner_id':_0x326a94[_0xe051('0x1d')],'created_at':_0xccb822[_0xe051('0x2d')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0xabfa94[_0xe051('0xb')]=_0x47a5e3;logger[_0xe051('0xc')](_0xe051('0x2e'));return rp(_0xabfa94)['then'](function(_0x3f6bff){_0x326a94[_0xe051('0x28')]=_0x3f6bff[_0xe051('0x2f')]['id'];_0x4d14b4(_0x326a94);})[_0xe051('0x16')](function(_0x116011){logger[_0xe051('0x17')]('['+[_0x1c143b[_0xe051('0x30')]()]+']',_0x116011[_0xe051('0x20')]);_0x426544(_0x116011[_0xe051('0x20')]);});});}function getTicket(_0x19bfe6,_0x68b3ae,_0x192176,_0x386f0d,_0x19ab0d){return function(_0x273042){logger['info']('Creating\x20new\x20task');return new Promise(function(_0x364efe,_0x594f77){var _0x3d179e=moment();var _0x39bbf0={'method':_0xe051('0x2c'),'uri':_0x192176+_0xe051('0x31'),'body':{'title':intUtil[_0xe051('0x32')](_0x386f0d[_0xe051('0x33')],_0x19ab0d,'\x20'),'description':intUtil[_0xe051('0x32')](_0x386f0d[_0xe051('0x34')],_0x19ab0d,'\x0a'),'owner_id':_0x273042[_0xe051('0x1d')],'creater_id':_0x273042[_0xe051('0x14')],'targetable_id':_0x273042[_0xe051('0x28')],'targetable_type':'Contact','created_at':_0x3d179e[_0xe051('0x2d')](_0xe051('0x35')),'due_date':_0x3d179e[_0xe051('0x36')](0x1e,'m')['format'](_0xe051('0x35'))},'json':!![]};_0x39bbf0[_0xe051('0xb')]=_0x68b3ae;return rp(_0x39bbf0)[_0xe051('0xe')](function(_0x2a1f42){_0x273042['ticketId']=_0x2a1f42[_0xe051('0x37')]['id'];logger[_0xe051('0xc')](_0xe051('0x38'),_0x273042[_0xe051('0x39')]);_0x364efe(_0x273042);})[_0xe051('0x16')](function(_0x3c0581){logger[_0xe051('0x17')]('['+[_0x19bfe6['toUpperCase']()]+']',_0x3c0581[_0xe051('0x20')]);_0x594f77(_0x3c0581[_0xe051('0x20')]);});});};}function emit(_0x10f932,_0x5775f4,_0xe9e09){var _0x33eb4f={'uri':_0x10f932+'/contacts/'+_0xe9e09};io['to'](util['format'](_0xe051('0x3a'),_0x5775f4))['emit'](_0xe051('0x3b'),_0x33eb4f);}exports['cs']=function(_0x2f2e59,_0x56a79f,_0x2973e4,_0x3363d9,_0x2789af,_0x5e2f09,_0x5cb561,_0x4accdf){var _0x1160e6={};var _0x37d23e={'Authorization':_0xe051('0x3c')+_0x5e2f09['apiKey']};_0x5e2f09[_0xe051('0x3d')]=intUtil[_0xe051('0x3e')](_0x5e2f09[_0xe051('0x3d')]);_0x5e2f09['serverUrl']=intUtil[_0xe051('0x3e')](_0x5e2f09[_0xe051('0x3f')]);var _0x16aa39=_0x5e2f09[_0xe051('0x3d')];_0x1160e6[_0xe051('0x12')]=_0x5e2f09['username'];_0x1160e6[_0xe051('0x26')]=_0x4accdf['toLowerCase']()==='outbound'?_0x56a79f[_0xe051('0x40')]:_0x56a79f[_0xe051('0x41')];_0x1160e6[_0xe051('0x42')]=_0x4accdf===_0xe051('0x43')||_0x4accdf==='unmanaged'?_0xe051('0x43'):_0xe051('0x44');if(_0x3363d9){_0x1160e6['agentEmail']=_0x3363d9[_0xe051('0x11')];}var _0x1a6ff0=util[_0xe051('0x2d')](_0xe051('0x45'),_0x5e2f09[_0xe051('0x3f')],_0x56a79f[_0xe051('0x46')],md5(_0x56a79f[_0xe051('0x46')]));if(_0x2789af&&_0x2789af[_0xe051('0x47')]){logger[_0xe051('0xc')]('[QUEUE]',_0xe051('0x48'));_0x56a79f['recordingURL']=_0x1a6ff0;}else if(_0x5cb561&&_0x5cb561[_0xe051('0x49')]&&_0x5cb561[_0xe051('0x49')]!==_0xe051('0x4a')){logger[_0xe051('0xc')](_0xe051('0x4b'),_0xe051('0x48'));_0x56a79f[_0xe051('0x4c')]=_0x1a6ff0;}else{_0x56a79f[_0xe051('0x4c')]='';}return getAdminId(_0x1160e6,_0x4accdf,_0x37d23e,_0x16aa39)[_0xe051('0xe')](getUser(_0x4accdf,_0x37d23e,_0x16aa39))[_0xe051('0xe')](getEndUser(_0x4accdf,_0x37d23e,_0x16aa39))['then'](getTicket(_0x4accdf,_0x37d23e,_0x16aa39,_0x2973e4,_0x56a79f))[_0xe051('0xe')](function(_0x343be7){logger[_0xe051('0xc')](util[_0xe051('0x2d')](_0xe051('0x4d'),_0x343be7[_0xe051('0x39')]));if(_0x4accdf!=='unmanaged'){logger[_0xe051('0xc')]('['+[_0x4accdf[_0xe051('0x30')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x16aa39,_0x3363d9[_0xe051('0x4e')],_0x343be7['endUserId']);}})[_0xe051('0x16')](function(_0x38ba4a){logger[_0xe051('0x17')]('['+[_0x4accdf['toUpperCase']()]+_0xe051('0x4f'),util[_0xe051('0x50')](_0x38ba4a,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x5497=['headers','users','agentEmail','userEmail','User\x20found:','userId','Admin\x20selected','adminEmail','&f=','&entities=contact','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','contact','Creating\x20new\x20task','/api/tasks','Subjects','getString','Descriptions','Contact','add','ticketId','task','/contacts/','user:%s','Token\x20token=','apiKey','stripTrailingSlash','serverUrl','remoteUri','username','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','GET','info','Getting\x20admin\x20information','then','length','email','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','/api/selector/owners'];(function(_0x24806b,_0x4c86b5){var _0xdf4e11=function(_0xe7e9ba){while(--_0xe7e9ba){_0x24806b['push'](_0x24806b['shift']());}};_0xdf4e11(++_0x4c86b5);}(_0x5497,0xdf));var _0x7549=function(_0x419912,_0x988212){_0x419912=_0x419912-0x0;var _0x5c0ff3=_0x5497[_0x419912];return _0x5c0ff3;};'use strict';var _=require('lodash');var rp=require(_0x7549('0x0'));var md5=require(_0x7549('0x1'));var util=require(_0x7549('0x2'));var moment=require(_0x7549('0x3'));var Promise=require(_0x7549('0x4'));var Redis=require(_0x7549('0x5'));var intUtil=require(_0x7549('0x6'));var config=require(_0x7549('0x7'));var logger=require(_0x7549('0x8'))('freshsales');config[_0x7549('0x9')]=_[_0x7549('0xa')](config[_0x7549('0x9')],{'host':_0x7549('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7549('0x9')]));function getAdminId(_0x561f60,_0x3917c0,_0x93f5f9,_0x5e044d){return new Promise(function(_0x556c05,_0x2d7a42){var _0x58c0d2=![];var _0x2d4544={'method':_0x7549('0xc'),'uri':_0x5e044d+'/api/selector/owners','json':!![]};_0x2d4544['headers']=_0x93f5f9;logger[_0x7549('0xd')](_0x7549('0xe'));return rp(_0x2d4544)[_0x7549('0xf')](function(_0x3a64e8){if(_0x3a64e8){var _0x215f59=_0x3a64e8['users'];var _0x3335c2=null;for(_0x3335c2=0x0;_0x3335c2<_0x215f59[_0x7549('0x10')];_0x3335c2++){if(_0x215f59[_0x3335c2][_0x7549('0x11')]===_0x561f60['adminEmail']){_0x561f60[_0x7549('0x12')]=_0x215f59[_0x3335c2]['id'];_0x58c0d2=!![];}}if(_0x58c0d2){logger[_0x7549('0xd')](_0x7549('0x13'),_0x561f60['adminId']);_0x556c05(_0x561f60);}else{_0x2d7a42({'statusCode':0x194,'message':_0x7549('0x14')});}}else{_0x2d7a42({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x7549('0x15')](function(_0x5bdb60){logger[_0x7549('0x16')]('['+[_0x3917c0[_0x7549('0x17')]()]+']',_0x5bdb60[_0x7549('0x18')]);_0x2d7a42(_0x5bdb60);});});}function getUser(_0x2ad3e9,_0x47db5,_0x44eec3){return function(_0x149bf1){return new Promise(function(_0x1bd1c5,_0x48bd3e){var _0x342240={'method':_0x7549('0xc'),'uri':_0x44eec3+_0x7549('0x19'),'json':!![]};_0x342240[_0x7549('0x1a')]=_0x47db5;logger['info']('Getting\x20user\x20list');return rp(_0x342240)[_0x7549('0xf')](function(_0x3433f1){if(_0x3433f1){var _0x3b414f=_0x3433f1[_0x7549('0x1b')];var _0x5a4d50=![];var _0x5152db=null;if(_0x149bf1[_0x7549('0x1c')]!==null){logger[_0x7549('0xd')]('Getting\x20user\x20with\x20email',_0x149bf1['agentEmail']);_0x149bf1[_0x7549('0x1d')]=_0x149bf1[_0x7549('0x1c')];for(_0x5152db=0x0;_0x5152db<_0x3b414f[_0x7549('0x10')];_0x5152db++){if(_0x3b414f[_0x5152db]['email']===_0x149bf1['agentEmail']){_0x5a4d50=!![];_0x149bf1['userId']=_0x3b414f[_0x5152db]['id'];logger['info'](_0x7549('0x1e'),_0x149bf1[_0x7549('0x1f')]);}}}if(!_0x5a4d50){logger[_0x7549('0xd')](_0x7549('0x20'));_0x149bf1[_0x7549('0x1d')]=_0x149bf1[_0x7549('0x21')];_0x149bf1[_0x7549('0x1f')]=_0x149bf1[_0x7549('0x12')];_0x5a4d50=!![];}if(_0x5a4d50){_0x1bd1c5(_0x149bf1);}else{_0x48bd3e({'statusCode':0x194,'message':_0x7549('0x14')});}}else{_0x48bd3e({'statusCode':0x194,'message':_0x7549('0x14')});}})[_0x7549('0x15')](function(_0x4497fc){logger[_0x7549('0x16')]('['+[_0x2ad3e9[_0x7549('0x17')]()]+']',_0x4497fc[_0x7549('0x18')]);_0x48bd3e(_0x4497fc);});});};}function searchContact(_0x4284a5,_0x5c560a,_0x2de75d,_0xcfd9fc){return new Promise(function(_0x550e66,_0x100337){var _0x54f681={'method':_0x7549('0xc'),'headers':_0x5c560a,'uri':_0x4284a5+'/api/lookup?q='+_0xcfd9fc+_0x7549('0x22')+_0x2de75d+_0x7549('0x23'),'json':!![]};rp(_0x54f681)['then'](function(_0x22bb8d){var _0x4aeb8b=_['find'](_0x22bb8d[_0x7549('0x24')]['contacts'],[_0x2de75d,_0xcfd9fc]);_0x550e66(_0x4aeb8b);})[_0x7549('0x15')](function(_0x434d43){_0x100337(_0x434d43);});});}function getEndUser(_0x67c38,_0x3c44e6,_0x266f54){return function(_0x6ffee){return new Promise(function(_0x5706ec,_0x2b036d){logger['info'](util[_0x7549('0x25')](_0x7549('0x26'),_0x6ffee[_0x7549('0x27')]));searchContact(_0x266f54,_0x3c44e6,_0x7549('0x28'),_0x6ffee['contactNumber'])['then'](function(_0x4b5cf7){if(_0x4b5cf7){_0x6ffee[_0x7549('0x29')]=_0x4b5cf7['id'];logger[_0x7549('0xd')](_0x7549('0x2a'),_0x6ffee[_0x7549('0x29')]);return _0x5706ec(_0x6ffee);}searchContact(_0x266f54,_0x3c44e6,_0x7549('0x2b'),_0x6ffee[_0x7549('0x27')])[_0x7549('0xf')](function(_0x506314){if(_0x506314){_0x6ffee['endUserId']=_0x506314['id'];logger[_0x7549('0xd')]('Contact\x20found\x20work_number:',_0x6ffee['endUserId']);return _0x5706ec(_0x6ffee);}createEndUser(_0x6ffee,_0x67c38,_0x3c44e6,_0x266f54)[_0x7549('0xf')](function(_0x2f665a){logger[_0x7549('0xd')](_0x7549('0x2c'),_0x2f665a[_0x7549('0x29')]);return _0x5706ec(_0x2f665a);});});})['catch'](function(_0xa8268a){_0x2b036d(_0xa8268a);});});};}function createEndUser(_0xb6b82c,_0x1be2ec,_0x4608cf,_0x1db8e2){return new Promise(function(_0x2f6a6c,_0x145836){var _0x3c3cd0=moment();var _0x52a023={'method':_0x7549('0x2d'),'uri':_0x1db8e2+_0x7549('0x2e'),'body':{'contact':{'last_name':_0xb6b82c[_0x7549('0x27')],'work_number':_0xb6b82c[_0x7549('0x27')],'mobile_number':_0xb6b82c[_0x7549('0x27')],'owner_id':_0xb6b82c[_0x7549('0x1f')],'created_at':_0x3c3cd0['format'](_0x7549('0x2f'))}},'json':!![]};_0x52a023['headers']=_0x4608cf;logger[_0x7549('0xd')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x52a023)[_0x7549('0xf')](function(_0x158611){_0xb6b82c['endUserId']=_0x158611[_0x7549('0x30')]['id'];_0x2f6a6c(_0xb6b82c);})['catch'](function(_0x1777f3){logger[_0x7549('0x16')]('['+[_0x1be2ec[_0x7549('0x17')]()]+']',_0x1777f3[_0x7549('0x18')]);_0x145836(_0x1777f3['message']);});});}function getTicket(_0x312a23,_0x3a515e,_0x36aa27,_0x1de8ff,_0x19a032){return function(_0x3228e0){logger[_0x7549('0xd')](_0x7549('0x31'));return new Promise(function(_0x16a4c1,_0x3959f3){var _0x1087db=moment();var _0x19a194={'method':_0x7549('0x2d'),'uri':_0x36aa27+_0x7549('0x32'),'body':{'title':intUtil['getString'](_0x1de8ff[_0x7549('0x33')],_0x19a032,'\x20'),'description':intUtil[_0x7549('0x34')](_0x1de8ff[_0x7549('0x35')],_0x19a032,'\x0a'),'owner_id':_0x3228e0['userId'],'creater_id':_0x3228e0['adminId'],'targetable_id':_0x3228e0[_0x7549('0x29')],'targetable_type':_0x7549('0x36'),'created_at':_0x1087db[_0x7549('0x25')](_0x7549('0x2f')),'due_date':_0x1087db[_0x7549('0x37')](0x1e,'m')[_0x7549('0x25')](_0x7549('0x2f'))},'json':!![]};_0x19a194[_0x7549('0x1a')]=_0x3a515e;return rp(_0x19a194)['then'](function(_0x58c21e){_0x3228e0[_0x7549('0x38')]=_0x58c21e[_0x7549('0x39')]['id'];logger['info']('Task\x20created:',_0x3228e0[_0x7549('0x38')]);_0x16a4c1(_0x3228e0);})[_0x7549('0x15')](function(_0x4f941e){logger[_0x7549('0x16')]('['+[_0x312a23[_0x7549('0x17')]()]+']',_0x4f941e['message']);_0x3959f3(_0x4f941e['message']);});});};}function emit(_0x54da87,_0x1b802f,_0x3c0d81){var _0x5d06a1={'uri':_0x54da87+_0x7549('0x3a')+_0x3c0d81};io['to'](util[_0x7549('0x25')](_0x7549('0x3b'),_0x1b802f))['emit']('trigger:browser:url',_0x5d06a1);}exports['cs']=function(_0x269b67,_0x1c309a,_0x54cbcb,_0x2addbf,_0x5f3504,_0x297777,_0x202b07,_0x28ca5a){var _0x322646={};var _0x62ce82={'Authorization':_0x7549('0x3c')+_0x297777[_0x7549('0x3d')]};_0x297777['remoteUri']=intUtil[_0x7549('0x3e')](_0x297777['remoteUri']);_0x297777[_0x7549('0x3f')]=intUtil[_0x7549('0x3e')](_0x297777[_0x7549('0x3f')]);var _0x18cc6b=_0x297777[_0x7549('0x40')];_0x322646['adminEmail']=_0x297777[_0x7549('0x41')];_0x322646['contactNumber']=_0x28ca5a['toLowerCase']()===_0x7549('0x42')?_0x1c309a[_0x7549('0x43')]:_0x1c309a[_0x7549('0x44')];_0x322646[_0x7549('0x45')]=_0x28ca5a===_0x7549('0x46')||_0x28ca5a===_0x7549('0x47')?_0x7549('0x46'):_0x7549('0x42');if(_0x2addbf){_0x322646[_0x7549('0x1c')]=_0x2addbf['email'];}var _0x174b3a=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x297777[_0x7549('0x3f')],_0x1c309a['uniqueid'],md5(_0x1c309a[_0x7549('0x48')]));if(_0x5f3504&&_0x5f3504[_0x7549('0x49')]){logger[_0x7549('0xd')](_0x7549('0x4a'),_0x7549('0x4b'));_0x1c309a[_0x7549('0x4c')]=_0x174b3a;}else if(_0x202b07&&_0x202b07[_0x7549('0x4d')]&&_0x202b07[_0x7549('0x4d')]!=='none'){logger['info']('[OUTBOUND]',_0x7549('0x4b'));_0x1c309a[_0x7549('0x4c')]=_0x174b3a;}else{_0x1c309a['recordingURL']='';}return getAdminId(_0x322646,_0x28ca5a,_0x62ce82,_0x18cc6b)[_0x7549('0xf')](getUser(_0x28ca5a,_0x62ce82,_0x18cc6b))[_0x7549('0xf')](getEndUser(_0x28ca5a,_0x62ce82,_0x18cc6b))[_0x7549('0xf')](getTicket(_0x28ca5a,_0x62ce82,_0x18cc6b,_0x54cbcb,_0x1c309a))[_0x7549('0xf')](function(_0xc2641c){logger[_0x7549('0xd')](util['format'](_0x7549('0x4e'),_0xc2641c[_0x7549('0x38')]));if(_0x28ca5a!==_0x7549('0x47')){logger[_0x7549('0xd')]('['+[_0x28ca5a[_0x7549('0x17')]()]+']',_0x7549('0x4f'));emit(_0x18cc6b,_0x2addbf[_0x7549('0x50')],_0xc2641c[_0x7549('0x29')]);}})[_0x7549('0x15')](function(_0x1eb802){logger[_0x7549('0x16')]('['+[_0x28ca5a['toUpperCase']()]+_0x7549('0x51'),util[_0x7549('0x52')](_0x1eb802,{'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 2bd7dcc..4430af3 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 _0x9a23=['lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','EVENT\x20UNKNOWN','unmanaged','zendesk','log','unknown\x20integration','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','error','%s\x20account\x20#%s\x20not\x20found'];(function(_0x204ad4,_0x502841){var _0x50675f=function(_0x30ad49){while(--_0x30ad49){_0x204ad4['push'](_0x204ad4['shift']());}};_0x50675f(++_0x502841);}(_0x9a23,0x81));var _0x39a2=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x9a23[_0x11c573];return _0x6b72de;};'use strict';var _=require(_0x39a2('0x0'));var util=require(_0x39a2('0x1'));var zendesk=require(_0x39a2('0x2'));var salesforce=require(_0x39a2('0x3'));var sugarcrm=require(_0x39a2('0x4'));var freshdesk=require(_0x39a2('0x5'));var zoho=require(_0x39a2('0x6'));var desk=require(_0x39a2('0x7'));var vtiger=require(_0x39a2('0x8'));var servicenow=require(_0x39a2('0x9'));var dynamics365=require(_0x39a2('0xa'));var freshsales=require(_0x39a2('0xb'));var integrations=['zendesk',_0x39a2('0xc'),_0x39a2('0xd'),_0x39a2('0xe'),_0x39a2('0xf'),_0x39a2('0x10'),_0x39a2('0x11'),_0x39a2('0x12'),_0x39a2('0x13'),_0x39a2('0x14')];exports[_0x39a2('0x15')]=function(_0x3e76c8,_0x21d4e0,_0x15017f,_0x7bd0c9,_0x2cda00,_0x5e249f){if(_0x15017f){if(_[_0x39a2('0x16')](integrations,_0x3e76c8[_0x39a2('0x17')][_0x39a2('0x18')]())){try{var _0x2c1523=null;var _0x3472c0='';var _0x54fcb1=_0x15017f[_0x3e76c8['data1']['toLowerCase']()];if(_0x54fcb1){var _0x27496f=_0x54fcb1[_0x3e76c8[_0x39a2('0x19')]];if(_0x27496f){var _0x31dd0a=_[_0x39a2('0x1a')](_0x27496f[_0x39a2('0x1b')],{'id':parseInt(_0x3e76c8[_0x39a2('0x1c')],0xa)});if(_0x31dd0a){if(_0x7bd0c9){if(_0x2cda00&&_0x21d4e0[_0x39a2('0x1d')]){_0x3472c0=_0x39a2('0x1d');}else if(_0x21d4e0[_0x39a2('0x1e')]){_0x3472c0=_0x39a2('0x1f');}else{console['log'](_0x39a2('0x20'),_0x21d4e0);}}else{_0x3472c0=_0x39a2('0x21');}switch(_0x3e76c8['data1']['toLowerCase']()){case _0x39a2('0x22'):zendesk[_0x3472c0](_0x3e76c8,_0x21d4e0,_0x31dd0a,_0x7bd0c9,_0x2cda00,_0x27496f,_0x5e249f);break;case _0x39a2('0xc'):salesforce[_0x3472c0](_0x3e76c8,_0x21d4e0,_0x31dd0a,_0x7bd0c9,_0x2cda00,_0x27496f,_0x5e249f);break;case'sugarcrm':sugarcrm[_0x3472c0](_0x3e76c8,_0x21d4e0,_0x31dd0a,_0x7bd0c9,_0x2cda00,_0x27496f,_0x5e249f);break;case _0x39a2('0xe'):freshdesk[_0x3472c0](_0x3e76c8,_0x21d4e0,_0x31dd0a,_0x7bd0c9,_0x2cda00,_0x27496f,_0x5e249f);break;case _0x39a2('0xf'):zoho[_0x3472c0](_0x3e76c8,_0x21d4e0,_0x31dd0a,_0x7bd0c9,_0x2cda00,_0x27496f,_0x5e249f);break;case _0x39a2('0x10'):desk[_0x3472c0](_0x3e76c8,_0x21d4e0,_0x31dd0a,_0x7bd0c9,_0x2cda00,_0x27496f,_0x5e249f);break;case _0x39a2('0x11'):vtiger[_0x3472c0](_0x3e76c8,_0x21d4e0,_0x31dd0a,_0x7bd0c9,_0x2cda00,_0x27496f,_0x5e249f);break;case _0x39a2('0x13'):freshsales['cs'](_0x3e76c8,_0x21d4e0,_0x31dd0a,_0x7bd0c9,_0x2cda00,_0x27496f,_0x5e249f,_0x3472c0);break;case _0x39a2('0x14'):servicenow['cs'](_0x3e76c8,_0x21d4e0,_0x31dd0a,_0x7bd0c9,_0x2cda00,_0x27496f,_0x5e249f,_0x3472c0);break;case'dynamics365':dynamics365['cs'](_0x3e76c8,_0x21d4e0,_0x31dd0a,_0x7bd0c9,_0x2cda00,_0x27496f,_0x5e249f,_0x3472c0);break;default:console[_0x39a2('0x23')](_0x39a2('0x24'));}}else{_0x2c1523=require(_0x39a2('0x25'))(_0x3e76c8['data1'][_0x39a2('0x18')]());_0x2c1523['error'](_0x39a2('0x26'),util[_0x39a2('0x27')](_0x39a2('0x28'),_0x3e76c8[_0x39a2('0x17')][_0x39a2('0x18')](),_0x3e76c8[_0x39a2('0x1c')]));}}else{_0x2c1523=require(_0x39a2('0x25'))(_0x3e76c8['data1'][_0x39a2('0x18')]());_0x2c1523[_0x39a2('0x29')](_0x39a2('0x26'),util['format'](_0x39a2('0x2a'),_0x3e76c8[_0x39a2('0x17')][_0x39a2('0x18')](),_0x3e76c8[_0x39a2('0x19')]));}}else{}}catch(_0x1e54a2){console[_0x39a2('0x29')](_0x1e54a2);}}}}; \ No newline at end of file +var _0xd3df=['data2','lodash','util','./zendesk','./salesforce','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','includes','toLowerCase','find','Configurations','routeId','outbound','log','unmanaged','sugarcrm','unknown\x20integration','../../../../config/logger','data1','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','data3','%s\x20account\x20#%s\x20not\x20found'];(function(_0x1b999f,_0xada878){var _0x51d27a=function(_0x1ba354){while(--_0x1ba354){_0x1b999f['push'](_0x1b999f['shift']());}};_0x51d27a(++_0xada878);}(_0xd3df,0xab));var _0xfd3d=function(_0x42c809,_0x5860eb){_0x42c809=_0x42c809-0x0;var _0x37f369=_0xd3df[_0x42c809];return _0x37f369;};'use strict';var _=require(_0xfd3d('0x0'));var util=require(_0xfd3d('0x1'));var zendesk=require(_0xfd3d('0x2'));var salesforce=require(_0xfd3d('0x3'));var sugarcrm=require('./sugarcrm');var freshdesk=require('./freshdesk');var zoho=require('./zoho');var desk=require('./desk');var vtiger=require(_0xfd3d('0x4'));var servicenow=require(_0xfd3d('0x5'));var dynamics365=require(_0xfd3d('0x6'));var freshsales=require('./freshsales');var integrations=[_0xfd3d('0x7'),_0xfd3d('0x8'),'sugarcrm',_0xfd3d('0x9'),_0xfd3d('0xa'),_0xfd3d('0xb'),_0xfd3d('0xc'),_0xfd3d('0xd'),_0xfd3d('0xe'),_0xfd3d('0xf')];exports['exec']=function(_0x587fe4,_0x50941c,_0x40d12f,_0x4cde36,_0x2f0e88,_0x3639fc){if(_0x40d12f){if(_[_0xfd3d('0x10')](integrations,_0x587fe4['data1'][_0xfd3d('0x11')]())){try{var _0x7ccb1d=null;var _0x30926d='';var _0x3a1e18=_0x40d12f[_0x587fe4['data1'][_0xfd3d('0x11')]()];if(_0x3a1e18){var _0x4b1b6c=_0x3a1e18[_0x587fe4['data2']];if(_0x4b1b6c){var _0x19d1d3=_[_0xfd3d('0x12')](_0x4b1b6c[_0xfd3d('0x13')],{'id':parseInt(_0x587fe4['data3'],0xa)});if(_0x19d1d3){if(_0x4cde36){if(_0x2f0e88&&_0x50941c['queue']){_0x30926d='queue';}else if(_0x50941c[_0xfd3d('0x14')]){_0x30926d=_0xfd3d('0x15');}else{console[_0xfd3d('0x16')]('EVENT\x20UNKNOWN',_0x50941c);}}else{_0x30926d=_0xfd3d('0x17');}switch(_0x587fe4['data1'][_0xfd3d('0x11')]()){case _0xfd3d('0x7'):zendesk[_0x30926d](_0x587fe4,_0x50941c,_0x19d1d3,_0x4cde36,_0x2f0e88,_0x4b1b6c,_0x3639fc);break;case _0xfd3d('0x8'):salesforce[_0x30926d](_0x587fe4,_0x50941c,_0x19d1d3,_0x4cde36,_0x2f0e88,_0x4b1b6c,_0x3639fc);break;case _0xfd3d('0x18'):sugarcrm[_0x30926d](_0x587fe4,_0x50941c,_0x19d1d3,_0x4cde36,_0x2f0e88,_0x4b1b6c,_0x3639fc);break;case _0xfd3d('0x9'):freshdesk[_0x30926d](_0x587fe4,_0x50941c,_0x19d1d3,_0x4cde36,_0x2f0e88,_0x4b1b6c,_0x3639fc);break;case _0xfd3d('0xa'):zoho[_0x30926d](_0x587fe4,_0x50941c,_0x19d1d3,_0x4cde36,_0x2f0e88,_0x4b1b6c,_0x3639fc);break;case _0xfd3d('0xb'):desk[_0x30926d](_0x587fe4,_0x50941c,_0x19d1d3,_0x4cde36,_0x2f0e88,_0x4b1b6c,_0x3639fc);break;case _0xfd3d('0xc'):vtiger[_0x30926d](_0x587fe4,_0x50941c,_0x19d1d3,_0x4cde36,_0x2f0e88,_0x4b1b6c,_0x3639fc);break;case _0xfd3d('0xe'):freshsales['cs'](_0x587fe4,_0x50941c,_0x19d1d3,_0x4cde36,_0x2f0e88,_0x4b1b6c,_0x3639fc,_0x30926d);break;case'servicenow':servicenow['cs'](_0x587fe4,_0x50941c,_0x19d1d3,_0x4cde36,_0x2f0e88,_0x4b1b6c,_0x3639fc,_0x30926d);break;case _0xfd3d('0xd'):dynamics365['cs'](_0x587fe4,_0x50941c,_0x19d1d3,_0x4cde36,_0x2f0e88,_0x4b1b6c,_0x3639fc,_0x30926d);break;default:console[_0xfd3d('0x16')](_0xfd3d('0x19'));}}else{_0x7ccb1d=require(_0xfd3d('0x1a'))(_0x587fe4[_0xfd3d('0x1b')][_0xfd3d('0x11')]());_0x7ccb1d[_0xfd3d('0x1c')](_0xfd3d('0x1d'),util['format'](_0xfd3d('0x1e'),_0x587fe4['data1'][_0xfd3d('0x11')](),_0x587fe4[_0xfd3d('0x1f')]));}}else{_0x7ccb1d=require(_0xfd3d('0x1a'))(_0x587fe4[_0xfd3d('0x1b')][_0xfd3d('0x11')]());_0x7ccb1d[_0xfd3d('0x1c')](_0xfd3d('0x1d'),util['format'](_0xfd3d('0x20'),_0x587fe4[_0xfd3d('0x1b')][_0xfd3d('0x11')](),_0x587fe4[_0xfd3d('0x21')]));}}else{}}catch(_0x2ae625){console[_0xfd3d('0x1c')](_0x2ae625);}}}}; \ 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 dd037db..3e68b76 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 _0x8ff0=['[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','toUpperCase','calleridnum','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','moment','bluebird','md5','jsforce','util','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Descriptions','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','account','WhatId','ticketType','Case','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','validateEmail','User','find','then','length','Email','resolve','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','execute','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','first','Phone','type','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','Caller\x20-\x20%s','Company','upperFirst','includes','toString','variable','variableName','idField','customVariable','Variable','name','toLowerCase','concat','securityToken','remoteUri','https://login.salesforce.com','clientSecret','login','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','Fields','queue','[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','format','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum'];(function(_0x139f50,_0x18b9cf){var _0xb5efa9=function(_0x5e097e){while(--_0x5e097e){_0x139f50['push'](_0x139f50['shift']());}};_0xb5efa9(++_0x18b9cf);}(_0x8ff0,0x16c));var _0x08ff=function(_0x5a709c,_0x1e6cfe){_0x5a709c=_0x5a709c-0x0;var _0x719025=_0x8ff0[_0x5a709c];return _0x719025;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require(_0x08ff('0x0'));var BPromise=require(_0x08ff('0x1'));var md5=require(_0x08ff('0x2'));var jsforce=require(_0x08ff('0x3'));var util=require(_0x08ff('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x08ff('0x5'));config[_0x08ff('0x6')]=_[_0x08ff('0x7')](config[_0x08ff('0x6')],{'host':_0x08ff('0x8'),'port':0x18eb});var io=require(_0x08ff('0x9'))(new Redis(config[_0x08ff('0x6')]));function emit(_0x2fee47,_0xc4226d,_0x2fb4e7){io['to'](_0x2fee47)[_0x08ff('0xa')](_0xc4226d,_0x2fb4e7);}function getTicket(_0x186903,_0x2f40be,_0x3e1ebf,_0x35a44a,_0x119691,_0x518a81,_0x35a7c0,_0x3d5700){var _0x5f5dc7=Object[_0x08ff('0xb')]({},{'OwnerId':_0x2f40be['id'],'Subject':intUtil[_0x08ff('0xc')](_0x35a44a['Subjects'],_0x119691,'\x20'),'Description':intUtil['getString'](_0x35a44a[_0x08ff('0xd')],_0x119691,'\x0a')},getCustomFields(_0x518a81,_0x119691));if(_0x3e1ebf){if(_0x35a44a['ticketType']===_0x08ff('0xe')){_0x5f5dc7[_0x08ff('0xf')]=moment[_0x08ff('0x10')]();_0x5f5dc7[_0x08ff('0x11')]=![];_0x5f5dc7[_0x08ff('0x12')]=![];if(_0x3e1ebf[_0x08ff('0x13')]===_0x08ff('0x14')||_0x3e1ebf[_0x08ff('0x13')]===_0x08ff('0x15')){_0x5f5dc7['WhoId']=_0x3e1ebf['id'];}else if(_0x3e1ebf[_0x08ff('0x13')]===_0x08ff('0x16')){_0x5f5dc7[_0x08ff('0x17')]=_0x3e1ebf['id'];}}else if(_0x35a44a[_0x08ff('0x18')]===_0x08ff('0x19')){if(_0x3e1ebf[_0x08ff('0x13')]===_0x08ff('0x14')){_0x5f5dc7['ContactId']=_0x3e1ebf['id'];}else if(_0x3e1ebf['endUserType']===_0x08ff('0x16')){_0x5f5dc7[_0x08ff('0x1a')]=_0x3e1ebf['id'];}else if(_0x3e1ebf[_0x08ff('0x13')]===_0x08ff('0x15')&&_0x35a44a[_0x08ff('0x1b')]){_0x5f5dc7[_0x35a44a[_0x08ff('0x1b')]]=_0x3e1ebf['id'];}else{logger[_0x08ff('0x1c')](_0x08ff('0x1d'));}}}return _0x35a7c0[_0x08ff('0x1e')](_0x35a44a['ticketType'])[_0x08ff('0x1f')](_0x5f5dc7);}function getUser(_0x63182f,_0x40b754,_0xef1033){if(!_['isNil'](_0x40b754)&&intUtil[_0x08ff('0x20')](_0x40b754)){var _0x4c74b0={'Email':_0x40b754};var _0x4a7e4b={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xef1033[_0x08ff('0x1e')](_0x08ff('0x21'))[_0x08ff('0x22')](_0x4c74b0,_0x4a7e4b)['execute']()[_0x08ff('0x23')](function(_0x5d4632){if(_0x5d4632[_0x08ff('0x24')]){var _0x26f01f=_['find'](_0x5d4632,function(_0x19c2de){return _0x19c2de[_0x08ff('0x25')]===_0x40b754;});if(_0x26f01f){logger[_0x08ff('0x1c')]('Agent\x20%s\x20found.',_0x40b754);return BPromise[_0x08ff('0x26')]({'id':_0x26f01f['Id'],'name':_0x26f01f[_0x08ff('0x27')]});}}else{logger['info'](_0x08ff('0x28'),_0x40b754);return _0xef1033[_0x08ff('0x29')]()[_0x08ff('0x23')](function(_0x590239){return BPromise[_0x08ff('0x26')]({'id':_0x590239[_0x08ff('0x2a')],'name':_0x590239['display_name']});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x40b754);return _0xef1033[_0x08ff('0x29')]()[_0x08ff('0x23')](function(_0x13ab85){return BPromise[_0x08ff('0x26')]({'id':_0x13ab85[_0x08ff('0x2a')],'name':_0x13ab85[_0x08ff('0x2b')]});});}}function getEndUser(_0x2f4253,_0xc597da,_0x3e376d,_0x29c113,_0x4c480b){var _0x7e6aac={'$or':{'Phone':_0x29c113}};var _0x5f2061={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x08ff('0x26')]()[_0x08ff('0x23')](function(){logger[_0x08ff('0x1c')](_0x08ff('0x2c'),_0x29c113,_0xc597da['moduleSearch']);switch(_0xc597da[_0x08ff('0x2d')]){case _0x08ff('0x2e'):var _0x51538e=_[_0x08ff('0x2f')](_0x7e6aac);if(_0xc597da[_0x08ff('0x30')]){var _0x543e34={};_0x543e34[_0xc597da['additionalSearchContact']]=_0x29c113;_[_0x08ff('0x31')](_0x51538e[_0x08ff('0x32')],_0x543e34);}return _0x4c480b[_0x08ff('0x1e')](_0x08ff('0x33'))[_0x08ff('0x22')](_0x51538e,_0x5f2061)[_0x08ff('0x34')]()[_0x08ff('0x23')](function(_0x2e50ef){if(_0x2e50ef&&_0x2e50ef[_0x08ff('0x24')]){return _0x2e50ef;}else{var _0x314c84=_[_0x08ff('0x2f')](_0x7e6aac);if(_0xc597da[_0x08ff('0x35')]){var _0x49e2a2={};_0x49e2a2[_0xc597da[_0x08ff('0x35')]]=_0x29c113;_[_0x08ff('0x31')](_0x314c84['$or'],_0x49e2a2);}return _0x4c480b[_0x08ff('0x1e')](_0x08ff('0x36'))[_0x08ff('0x22')](_0x314c84,_0x5f2061);}});case _0x08ff('0x37'):var _0x1fedc9=_['cloneDeep'](_0x7e6aac);if(_0xc597da[_0x08ff('0x38')]){var _0x543e34={};_0x543e34[_0xc597da['additionalSearchAccount']]=_0x29c113;_[_0x08ff('0x31')](_0x1fedc9[_0x08ff('0x32')],_0x543e34);}return _0x4c480b[_0x08ff('0x1e')](_0x08ff('0x39'))[_0x08ff('0x22')](_0x1fedc9,_0x5f2061)[_0x08ff('0x34')]()[_0x08ff('0x23')](function(_0xc2744d){if(_0xc2744d&&_0xc2744d[_0x08ff('0x24')]){return _0xc2744d;}else{var _0x530e78=_[_0x08ff('0x2f')](_0x7e6aac);if(_0xc597da[_0x08ff('0x30')]){var _0x472222={};_0x472222[_0xc597da[_0x08ff('0x30')]]=_0x29c113;_[_0x08ff('0x31')](_0x530e78[_0x08ff('0x32')],_0x472222);}return _0x4c480b[_0x08ff('0x1e')](_0x08ff('0x33'))['find'](_0x530e78,_0x5f2061)[_0x08ff('0x23')](function(_0x503709){if(_0x503709&&_0x503709['length']){return _0x503709;}else{var _0x48e75b=_[_0x08ff('0x2f')](_0x7e6aac);if(_0xc597da['additionalSearchLead']){var _0x53210f={};_0x53210f[_0xc597da['additionalSearchLead']]=_0x29c113;_['merge'](_0x48e75b[_0x08ff('0x32')],_0x53210f);}return _0x4c480b[_0x08ff('0x1e')]('Lead')[_0x08ff('0x22')](_0x48e75b,_0x5f2061);}});}});case _0x08ff('0x14'):var _0x51538e=_[_0x08ff('0x2f')](_0x7e6aac);if(_0xc597da[_0x08ff('0x30')]){var _0x543e34={};_0x543e34[_0xc597da[_0x08ff('0x30')]]=_0x29c113;_[_0x08ff('0x31')](_0x51538e[_0x08ff('0x32')],_0x543e34);}return _0x4c480b[_0x08ff('0x1e')]('Contact')[_0x08ff('0x22')](_0x51538e,_0x5f2061)[_0x08ff('0x34')]();case _0x08ff('0x15'):var _0x2eae12=_[_0x08ff('0x2f')](_0x7e6aac);if(_0xc597da[_0x08ff('0x35')]){var _0x543e34={};_0x543e34[_0xc597da['additionalSearchLead']]=_0x29c113;_[_0x08ff('0x31')](_0x2eae12[_0x08ff('0x32')],_0x543e34);}return _0x4c480b['sobject'](_0x08ff('0x36'))[_0x08ff('0x22')](_0x2eae12,_0x5f2061);case _0x08ff('0x16'):var _0x1fedc9=_[_0x08ff('0x2f')](_0x7e6aac);if(_0xc597da[_0x08ff('0x38')]){var _0x543e34={};_0x543e34[_0xc597da['additionalSearchAccount']]=_0x29c113;_['merge'](_0x1fedc9['$or'],_0x543e34);}return _0x4c480b[_0x08ff('0x1e')](_0x08ff('0x39'))[_0x08ff('0x22')](_0x1fedc9,_0x5f2061);default:return null;}})[_0x08ff('0x23')](function(_0x1b99ff){if(_0x1b99ff&&_0x1b99ff[_0x08ff('0x24')]){var _0x28234a=_[_0x08ff('0x3a')](_0x1b99ff);if(_0x28234a){return BPromise[_0x08ff('0x26')]({'id':_0x28234a['Id'],'name':_0x28234a[_0x08ff('0x27')],'phone':_0x28234a[_0x08ff('0x3b')],'endUserType':_0x28234a['attributes'][_0x08ff('0x3c')]['toLowerCase']()});}}})[_0x08ff('0x23')](function(_0x4413c2){if(_0x4413c2){logger[_0x08ff('0x1c')](_0x08ff('0x3d'),_0x4413c2[_0x08ff('0x13')],_0x29c113);return BPromise[_0x08ff('0x26')](_0x4413c2);}else{logger[_0x08ff('0x1c')]('Enduser\x20with\x20phone\x20%s\x20not\x20found',_0x29c113);var _0x4b6d01={'Phone':_0x29c113};if(_0xc597da['moduleCreate']){if(_0xc597da[_0x08ff('0x3e')]===_0x08ff('0x14')){logger['info'](_0x08ff('0x3f'),_0x29c113,_0xc597da[_0x08ff('0x3e')]);_0x4b6d01[_0x08ff('0x40')]=_0x3e376d!==_0x08ff('0x41')?_0x3e376d:util['format'](_0x08ff('0x42'),_0x29c113);}else if(_0xc597da[_0x08ff('0x3e')]===_0x08ff('0x15')){logger[_0x08ff('0x1c')](_0x08ff('0x3f'),_0x29c113,_0xc597da[_0x08ff('0x3e')]);_0x4b6d01[_0x08ff('0x40')]=_0x3e376d!==_0x08ff('0x41')?_0x3e376d:util['format']('Caller\x20-\x20%s',_0x29c113);_0x4b6d01[_0x08ff('0x43')]='No\x20Company';}else if(_0xc597da[_0x08ff('0x3e')]===_0x08ff('0x16')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x29c113,_0xc597da[_0x08ff('0x3e')]);_0x4b6d01[_0x08ff('0x27')]=_0x3e376d!==_0x08ff('0x41')?_0x3e376d:util['format'](_0x08ff('0x42'),_0x29c113);}else{return null;}}return _0x4c480b[_0x08ff('0x1e')](_[_0x08ff('0x44')](_0xc597da['moduleCreate']))[_0x08ff('0x1f')](_0x4b6d01)[_0x08ff('0x23')](function(_0x350f1c){return BPromise[_0x08ff('0x26')]({'id':_0x350f1c['id'],'endUserType':_0xc597da[_0x08ff('0x3e')]});});}});}function getCustomFields(_0x31c1fd,_0x57fb32){var _0x14f0eb={};if(_0x31c1fd[_0x08ff('0x24')]>0x0){_['forEach'](_0x31c1fd,function(_0xb009b8){if(_[_0x08ff('0x45')](['string','picklist'],_0xb009b8[_0x08ff('0x3c')])&&_0xb009b8['idField']){_0x14f0eb[_0xb009b8['idField']]=_0xb009b8['content'][_0x08ff('0x46')]();}else if(_0xb009b8[_0x08ff('0x3c')]===_0x08ff('0x47')&&_0xb009b8[_0x08ff('0x48')]&&_0xb009b8[_0x08ff('0x49')]){_0x57fb32[_0xb009b8[_0x08ff('0x48')]]&&(_0x14f0eb[_0xb009b8[_0x08ff('0x49')]]=_0x57fb32[_0xb009b8[_0x08ff('0x48')]][_0x08ff('0x46')]());}else if(_0xb009b8[_0x08ff('0x3c')]===_0x08ff('0x4a')&&_0xb009b8['Variable']&&_0xb009b8[_0x08ff('0x4b')][_0x08ff('0x4c')]&&_0xb009b8[_0x08ff('0x49')]){_0x57fb32[_0xb009b8[_0x08ff('0x4b')][_0x08ff('0x4c')][_0x08ff('0x4d')]()]&&(_0x14f0eb[_0xb009b8[_0x08ff('0x49')]]=_0x57fb32[_0xb009b8[_0x08ff('0x4b')][_0x08ff('0x4c')][_0x08ff('0x4d')]()][_0x08ff('0x46')]());}});}return _0x14f0eb;}function getConnection(_0x39472f){var _0x444e6e=_0x39472f['password'][_0x08ff('0x4e')](_0x39472f[_0x08ff('0x4f')]);var _0x597e21=new jsforce['Connection']({'oauth2':{'loginUrl':_0x39472f[_0x08ff('0x50')]||_0x08ff('0x51'),'clientId':_0x39472f['clientId'],'clientSecret':_0x39472f[_0x08ff('0x52')]}});return _0x597e21[_0x08ff('0x53')](_0x39472f['username'],_0x444e6e)[_0x08ff('0x23')](function(){logger[_0x08ff('0x1c')]('Connection\x20established.');return _0x597e21;});}exports['queue']=function(_0x5c41d7,_0x4af8aa,_0x216d43,_0x4106c0,_0xb89192,_0x5755ee){var _0x4f6c61,_0x40135c,_0x79d0e6,_0x266e28;_0x5755ee['serverUrl']=intUtil[_0x08ff('0x54')](_0x5755ee[_0x08ff('0x55')]);_0x5755ee['remoteUri']=intUtil[_0x08ff('0x54')](_0x5755ee['remoteUri']);if(_0xb89192&&_0xb89192[_0x08ff('0x56')]){logger['info'](_0x08ff('0x57'),'Recording\x20is\x20enabled!');_0x4af8aa[_0x08ff('0x58')]=util['format'](_0x08ff('0x59'),_0x5755ee[_0x08ff('0x55')],_0x4af8aa[_0x08ff('0x5a')],md5(_0x4af8aa['uniqueid']));}else{_0x4af8aa[_0x08ff('0x58')]='';}return getConnection(_0x5755ee)['then'](function(_0x53c5f8){_0x266e28=_0x53c5f8;return getUser(_0x5755ee,_0x4106c0[_0x08ff('0x5b')],_0x266e28);})[_0x08ff('0x23')](function(_0x258804){_0x4f6c61=_0x258804;return getEndUser(_0x5755ee,_0x216d43,_0x4af8aa[_0x08ff('0x5c')],_0x4af8aa['calleridnum'],_0x266e28);})[_0x08ff('0x23')](function(_0x4cb3b1){_0x40135c=_0x4cb3b1;return getTicket(_0x5755ee,_0x4f6c61,_0x40135c,_0x216d43,_0x4af8aa,_0x216d43[_0x08ff('0x5d')],_0x266e28,_0x08ff('0x5e'));})[_0x08ff('0x23')](function(_0x1d065e){_0x79d0e6=_0x1d065e;logger['info'](_0x08ff('0x5f'),_0x79d0e6['id']);logger[_0x08ff('0x1c')](_0x08ff('0x60'),_0x79d0e6['id'],_0x4106c0[_0x08ff('0x4c')],_0x5755ee[_0x08ff('0x3c')]);switch(_0x5755ee[_0x08ff('0x3c')]){case _0x08ff('0x61'):emit(util['format'](_0x08ff('0x62'),_0x4106c0['name']),'trigger:salesforce:display',{'recordId':_0x79d0e6['id']});break;case _0x08ff('0x63'):emit(util['format'](_0x08ff('0x62'),_0x4106c0[_0x08ff('0x4c')]),_0x08ff('0x64'),{'uri':util[_0x08ff('0x65')]('%s/%s/e',_0x266e28[_0x08ff('0x66')],_0x79d0e6['id'])});break;default:logger[_0x08ff('0x67')](_0x08ff('0x68'));}})[_0x08ff('0x69')](function(_0x42e87a){logger['error'](_0x08ff('0x57'),_0x42e87a);});};exports[_0x08ff('0x6a')]=function(_0x53ed99,_0x165ebb,_0x4931cf,_0xc941a3,_0x5bf04d,_0x2dad76,_0x52fed7){var _0x29149e,_0x2fce59,_0x8c56a8,_0x290356;_0x2dad76['serverUrl']=intUtil[_0x08ff('0x54')](_0x2dad76[_0x08ff('0x55')]);_0x2dad76['remoteUri']=intUtil[_0x08ff('0x54')](_0x2dad76[_0x08ff('0x50')]);if(_0x52fed7&&_0x52fed7[_0x08ff('0x6b')]&&_0x52fed7['recordingFormat']!==_0x08ff('0x6c')){logger['info'](_0x08ff('0x6d'),_0x08ff('0x6e'));_0x165ebb[_0x08ff('0x58')]=util['format'](_0x08ff('0x59'),_0x2dad76[_0x08ff('0x55')],_0x165ebb[_0x08ff('0x5a')],md5(_0x165ebb[_0x08ff('0x5a')]));}return getConnection(_0x2dad76)[_0x08ff('0x23')](function(_0x5b48e8){_0x290356=_0x5b48e8;return getUser(_0x2dad76,_0xc941a3[_0x08ff('0x5b')],_0x290356);})[_0x08ff('0x23')](function(_0x52f240){_0x29149e=_0x52f240;return getEndUser(_0x2dad76,_0x4931cf,_0x165ebb['destcalleridname'],_0x165ebb[_0x08ff('0x6f')],_0x290356);})[_0x08ff('0x23')](function(_0x57fa2d){_0x2fce59=_0x57fa2d;return getTicket(_0x2dad76,_0x29149e,_0x2fce59,_0x4931cf,_0x165ebb,_0x4931cf[_0x08ff('0x5d')],_0x290356,'outbound');})[_0x08ff('0x23')](function(_0x8630db){_0x8c56a8=_0x8630db;logger[_0x08ff('0x1c')](_0x08ff('0x70'),_0x8c56a8['id']);logger[_0x08ff('0x1c')](_0x08ff('0x71'),_0x8c56a8['id'],_0xc941a3[_0x08ff('0x4c')],_0x2dad76[_0x08ff('0x3c')]);switch(_0x2dad76['type']){case _0x08ff('0x61'):emit(util[_0x08ff('0x65')](_0x08ff('0x62'),_0xc941a3[_0x08ff('0x4c')]),'trigger:salesforce:display',{'recordId':_0x8c56a8['id']});break;case'newTab':emit(util[_0x08ff('0x65')](_0x08ff('0x62'),_0xc941a3[_0x08ff('0x4c')]),'trigger:browser:url',{'uri':util[_0x08ff('0x65')]('%s/%s/e',_0x290356[_0x08ff('0x66')],_0x8c56a8['id'])});break;default:logger[_0x08ff('0x67')](_0x08ff('0x6d'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0x08ff('0x69')](function(_0x2c7c95){logger[_0x08ff('0x67')](_0x08ff('0x6d'),_0x2c7c95);});};exports['unmanaged']=function(_0x7cc13b,_0x13ed5e,_0x22d07f,_0x253145,_0x53672a,_0x3dff61){var _0x350272,_0x129b6c,_0x3a1c7d,_0x589ee8;_0x3dff61[_0x08ff('0x55')]=intUtil[_0x08ff('0x54')](_0x3dff61[_0x08ff('0x55')]);_0x3dff61[_0x08ff('0x50')]=intUtil[_0x08ff('0x54')](_0x3dff61[_0x08ff('0x50')]);if(_0x53672a&&_0x53672a['monitor_format']){logger[_0x08ff('0x1c')]('['+_0x13ed5e['lastevent'][_0x08ff('0x72')]()+']',_0x08ff('0x6e'));_0x13ed5e['recordingURL']=util[_0x08ff('0x65')](_0x08ff('0x59'),_0x3dff61[_0x08ff('0x55')],_0x13ed5e['uniqueid'],md5(_0x13ed5e['uniqueid']));}else{_0x13ed5e[_0x08ff('0x58')]='';}return getConnection(_0x3dff61)[_0x08ff('0x23')](function(_0x5d2526){_0x589ee8=_0x5d2526;if(!_['isNil'](_0x253145)){return getUser(_0x3dff61,_0x253145['name'],_0x589ee8);}else{return getUser(_0x3dff61,null,_0x589ee8);}})[_0x08ff('0x23')](function(_0x53f0e8){_0x350272=_0x53f0e8;return getEndUser(_0x3dff61,_0x22d07f,_0x13ed5e[_0x08ff('0x5c')],_0x13ed5e[_0x08ff('0x73')],_0x589ee8);})[_0x08ff('0x23')](function(_0x38c648){_0x129b6c=_0x38c648;return getTicket(_0x3dff61,_0x350272,_0x129b6c,_0x22d07f,_0x13ed5e,_0x22d07f['Fields'],_0x589ee8);})[_0x08ff('0x23')](function(_0x38bd88){_0x3a1c7d=_0x38bd88;logger['info']('['+_0x13ed5e[_0x08ff('0x74')]['toUpperCase']()+_0x08ff('0x75'),_0x3a1c7d['id']);logger[_0x08ff('0x1c')]('['+_0x13ed5e[_0x08ff('0x74')][_0x08ff('0x72')]()+_0x08ff('0x76'),_0x3dff61[_0x08ff('0x3c')]);})[_0x08ff('0x69')](function(_0x41ba95){logger[_0x08ff('0x67')]('['+_0x13ed5e[_0x08ff('0x74')][_0x08ff('0x72')]()+']',_0x41ba95);});}; \ No newline at end of file +var _0xa107=['../../../../config/environment','salesforce','redis','defaults','localhost','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','IsReminderSet','IsRecurrence','endUserType','lead','WhoId','account','WhatId','contact','ContactId','AccountId','leadId','sobject','create','isNil','User','execute','then','find','Email','Name','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','cloneDeep','additionalSearchAccount','length','Account','first','attributes','type','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','upperFirst','string','idField','variable','variableName','toString','customVariable','Variable','name','toLowerCase','password','securityToken','Connection','remoteUri','https://login.salesforce.com','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','[QUEUE]','[OUTBOUND]','destcalleridname','destcalleridnum','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','%s/%s/e','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','catch','lastevent','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','calleridname',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis'];(function(_0x5cd6d3,_0x4a1789){var _0x48c8cd=function(_0x498636){while(--_0x498636){_0x5cd6d3['push'](_0x5cd6d3['shift']());}};_0x48c8cd(++_0x4a1789);}(_0xa107,0x163));var _0x7a10=function(_0x101de4,_0x35d413){_0x101de4=_0x101de4-0x0;var _0x4e5c1a=_0xa107[_0x101de4];return _0x4e5c1a;};'use strict';var _=require(_0x7a10('0x0'));var rp=require(_0x7a10('0x1'));var moment=require(_0x7a10('0x2'));var BPromise=require(_0x7a10('0x3'));var md5=require(_0x7a10('0x4'));var jsforce=require(_0x7a10('0x5'));var util=require(_0x7a10('0x6'));var Redis=require(_0x7a10('0x7'));var intUtil=require('./util');var config=require(_0x7a10('0x8'));var logger=require('../../../../config/logger')(_0x7a10('0x9'));config[_0x7a10('0xa')]=_[_0x7a10('0xb')](config[_0x7a10('0xa')],{'host':_0x7a10('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7a10('0xa')]));function emit(_0x54dc02,_0x5127fe,_0x4e29d0){io['to'](_0x54dc02)['emit'](_0x5127fe,_0x4e29d0);}function getTicket(_0x3627dd,_0x5337e7,_0x49b669,_0x229b49,_0x4990ff,_0x3d43e8,_0x3573da,_0x4a2305){var _0x59626c=Object['assign']({},{'OwnerId':_0x5337e7['id'],'Subject':intUtil[_0x7a10('0xd')](_0x229b49[_0x7a10('0xe')],_0x4990ff,'\x20'),'Description':intUtil[_0x7a10('0xd')](_0x229b49[_0x7a10('0xf')],_0x4990ff,'\x0a')},getCustomFields(_0x3d43e8,_0x4990ff));if(_0x49b669){if(_0x229b49[_0x7a10('0x10')]===_0x7a10('0x11')){_0x59626c[_0x7a10('0x12')]=moment['utc']();_0x59626c[_0x7a10('0x13')]=![];_0x59626c[_0x7a10('0x14')]=![];if(_0x49b669['endUserType']==='contact'||_0x49b669[_0x7a10('0x15')]===_0x7a10('0x16')){_0x59626c[_0x7a10('0x17')]=_0x49b669['id'];}else if(_0x49b669['endUserType']===_0x7a10('0x18')){_0x59626c[_0x7a10('0x19')]=_0x49b669['id'];}}else if(_0x229b49[_0x7a10('0x10')]==='Case'){if(_0x49b669[_0x7a10('0x15')]===_0x7a10('0x1a')){_0x59626c[_0x7a10('0x1b')]=_0x49b669['id'];}else if(_0x49b669[_0x7a10('0x15')]===_0x7a10('0x18')){_0x59626c[_0x7a10('0x1c')]=_0x49b669['id'];}else if(_0x49b669[_0x7a10('0x15')]===_0x7a10('0x16')&&_0x229b49[_0x7a10('0x1d')]){_0x59626c[_0x229b49[_0x7a10('0x1d')]]=_0x49b669['id'];}else{logger['info']('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x3573da[_0x7a10('0x1e')](_0x229b49['ticketType'])[_0x7a10('0x1f')](_0x59626c);}function getUser(_0x4f22b9,_0x2bad10,_0x521af4){if(!_[_0x7a10('0x20')](_0x2bad10)&&intUtil['validateEmail'](_0x2bad10)){var _0x25c910={'Email':_0x2bad10};var _0x2bb6fc={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x521af4[_0x7a10('0x1e')](_0x7a10('0x21'))['find'](_0x25c910,_0x2bb6fc)[_0x7a10('0x22')]()[_0x7a10('0x23')](function(_0x144ae6){if(_0x144ae6['length']){var _0x7bfd87=_[_0x7a10('0x24')](_0x144ae6,function(_0x56d988){return _0x56d988[_0x7a10('0x25')]===_0x2bad10;});if(_0x7bfd87){logger['info']('Agent\x20%s\x20found.',_0x2bad10);return BPromise['resolve']({'id':_0x7bfd87['Id'],'name':_0x7bfd87[_0x7a10('0x26')]});}}else{logger[_0x7a10('0x27')](_0x7a10('0x28'),_0x2bad10);return _0x521af4[_0x7a10('0x29')]()[_0x7a10('0x23')](function(_0x1adb3f){return BPromise[_0x7a10('0x2a')]({'id':_0x1adb3f[_0x7a10('0x2b')],'name':_0x1adb3f['display_name']});});}});}else{logger[_0x7a10('0x27')](_0x7a10('0x28'),_0x2bad10);return _0x521af4[_0x7a10('0x29')]()['then'](function(_0x52c541){return BPromise[_0x7a10('0x2a')]({'id':_0x52c541['user_id'],'name':_0x52c541[_0x7a10('0x2c')]});});}}function getEndUser(_0x4daf04,_0x5c14c3,_0x4ac43b,_0x27042d,_0x565006){var _0x5ecbc1={'$or':{'Phone':_0x27042d}};var _0x21f676={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x7a10('0x2a')]()[_0x7a10('0x23')](function(){logger[_0x7a10('0x27')](_0x7a10('0x2d'),_0x27042d,_0x5c14c3['moduleSearch']);switch(_0x5c14c3[_0x7a10('0x2e')]){case _0x7a10('0x2f'):var _0x2255bf=_['cloneDeep'](_0x5ecbc1);if(_0x5c14c3['additionalSearchContact']){var _0x1a41d4={};_0x1a41d4[_0x5c14c3[_0x7a10('0x30')]]=_0x27042d;_[_0x7a10('0x31')](_0x2255bf[_0x7a10('0x32')],_0x1a41d4);}return _0x565006[_0x7a10('0x1e')](_0x7a10('0x33'))['find'](_0x2255bf,_0x21f676)[_0x7a10('0x22')]()['then'](function(_0x3103d8){if(_0x3103d8&&_0x3103d8['length']){return _0x3103d8;}else{var _0x2787a7=_['cloneDeep'](_0x5ecbc1);if(_0x5c14c3[_0x7a10('0x34')]){var _0x4f9160={};_0x4f9160[_0x5c14c3[_0x7a10('0x34')]]=_0x27042d;_['merge'](_0x2787a7[_0x7a10('0x32')],_0x4f9160);}return _0x565006[_0x7a10('0x1e')](_0x7a10('0x35'))['find'](_0x2787a7,_0x21f676);}});case _0x7a10('0x36'):var _0x82c27e=_[_0x7a10('0x37')](_0x5ecbc1);if(_0x5c14c3[_0x7a10('0x38')]){var _0x1a41d4={};_0x1a41d4[_0x5c14c3[_0x7a10('0x38')]]=_0x27042d;_['merge'](_0x82c27e['$or'],_0x1a41d4);}return _0x565006[_0x7a10('0x1e')]('Account')[_0x7a10('0x24')](_0x82c27e,_0x21f676)[_0x7a10('0x22')]()[_0x7a10('0x23')](function(_0x23caed){if(_0x23caed&&_0x23caed[_0x7a10('0x39')]){return _0x23caed;}else{var _0x188368=_[_0x7a10('0x37')](_0x5ecbc1);if(_0x5c14c3['additionalSearchContact']){var _0x55227f={};_0x55227f[_0x5c14c3[_0x7a10('0x30')]]=_0x27042d;_[_0x7a10('0x31')](_0x188368[_0x7a10('0x32')],_0x55227f);}return _0x565006[_0x7a10('0x1e')](_0x7a10('0x33'))[_0x7a10('0x24')](_0x188368,_0x21f676)['then'](function(_0x45d8a3){if(_0x45d8a3&&_0x45d8a3[_0x7a10('0x39')]){return _0x45d8a3;}else{var _0x50a477=_[_0x7a10('0x37')](_0x5ecbc1);if(_0x5c14c3['additionalSearchLead']){var _0x1ddbd7={};_0x1ddbd7[_0x5c14c3[_0x7a10('0x34')]]=_0x27042d;_[_0x7a10('0x31')](_0x50a477['$or'],_0x1ddbd7);}return _0x565006[_0x7a10('0x1e')](_0x7a10('0x35'))[_0x7a10('0x24')](_0x50a477,_0x21f676);}});}});case _0x7a10('0x1a'):var _0x2255bf=_[_0x7a10('0x37')](_0x5ecbc1);if(_0x5c14c3[_0x7a10('0x30')]){var _0x1a41d4={};_0x1a41d4[_0x5c14c3['additionalSearchContact']]=_0x27042d;_['merge'](_0x2255bf[_0x7a10('0x32')],_0x1a41d4);}return _0x565006[_0x7a10('0x1e')](_0x7a10('0x33'))['find'](_0x2255bf,_0x21f676)[_0x7a10('0x22')]();case'lead':var _0x150e7a=_[_0x7a10('0x37')](_0x5ecbc1);if(_0x5c14c3[_0x7a10('0x34')]){var _0x1a41d4={};_0x1a41d4[_0x5c14c3[_0x7a10('0x34')]]=_0x27042d;_['merge'](_0x150e7a[_0x7a10('0x32')],_0x1a41d4);}return _0x565006['sobject'](_0x7a10('0x35'))[_0x7a10('0x24')](_0x150e7a,_0x21f676);case _0x7a10('0x18'):var _0x82c27e=_[_0x7a10('0x37')](_0x5ecbc1);if(_0x5c14c3['additionalSearchAccount']){var _0x1a41d4={};_0x1a41d4[_0x5c14c3[_0x7a10('0x38')]]=_0x27042d;_[_0x7a10('0x31')](_0x82c27e[_0x7a10('0x32')],_0x1a41d4);}return _0x565006[_0x7a10('0x1e')](_0x7a10('0x3a'))['find'](_0x82c27e,_0x21f676);default:return null;}})[_0x7a10('0x23')](function(_0x2963f4){if(_0x2963f4&&_0x2963f4[_0x7a10('0x39')]){var _0x18ede8=_[_0x7a10('0x3b')](_0x2963f4);if(_0x18ede8){return BPromise[_0x7a10('0x2a')]({'id':_0x18ede8['Id'],'name':_0x18ede8[_0x7a10('0x26')],'phone':_0x18ede8['Phone'],'endUserType':_0x18ede8[_0x7a10('0x3c')][_0x7a10('0x3d')]['toLowerCase']()});}}})[_0x7a10('0x23')](function(_0x4d64b3){if(_0x4d64b3){logger[_0x7a10('0x27')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x4d64b3[_0x7a10('0x15')],_0x27042d);return BPromise['resolve'](_0x4d64b3);}else{logger['info'](_0x7a10('0x3e'),_0x27042d);var _0x40b35c={'Phone':_0x27042d};if(_0x5c14c3[_0x7a10('0x3f')]){if(_0x5c14c3[_0x7a10('0x3f')]===_0x7a10('0x1a')){logger[_0x7a10('0x27')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x27042d,_0x5c14c3['moduleCreate']);_0x40b35c[_0x7a10('0x40')]=_0x4ac43b!==_0x7a10('0x41')?_0x4ac43b:util[_0x7a10('0x42')](_0x7a10('0x43'),_0x27042d);}else if(_0x5c14c3[_0x7a10('0x3f')]===_0x7a10('0x16')){logger[_0x7a10('0x27')](_0x7a10('0x44'),_0x27042d,_0x5c14c3[_0x7a10('0x3f')]);_0x40b35c[_0x7a10('0x40')]=_0x4ac43b!==_0x7a10('0x41')?_0x4ac43b:util[_0x7a10('0x42')]('Caller\x20-\x20%s',_0x27042d);_0x40b35c[_0x7a10('0x45')]='No\x20Company';}else if(_0x5c14c3['moduleCreate']==='account'){logger[_0x7a10('0x27')](_0x7a10('0x44'),_0x27042d,_0x5c14c3[_0x7a10('0x3f')]);_0x40b35c[_0x7a10('0x26')]=_0x4ac43b!==''?_0x4ac43b:util[_0x7a10('0x42')]('Caller\x20-\x20%s',_0x27042d);}else{return null;}}return _0x565006['sobject'](_[_0x7a10('0x46')](_0x5c14c3[_0x7a10('0x3f')]))['create'](_0x40b35c)[_0x7a10('0x23')](function(_0x265ef4){return BPromise[_0x7a10('0x2a')]({'id':_0x265ef4['id'],'endUserType':_0x5c14c3[_0x7a10('0x3f')]});});}});}function getCustomFields(_0x241b11,_0x24c04e){var _0x171ef1={};if(_0x241b11['length']>0x0){_['forEach'](_0x241b11,function(_0x3ed572){if(_['includes']([_0x7a10('0x47'),'picklist'],_0x3ed572[_0x7a10('0x3d')])&&_0x3ed572[_0x7a10('0x48')]){_0x171ef1[_0x3ed572[_0x7a10('0x48')]]=_0x3ed572['content']['toString']();}else if(_0x3ed572[_0x7a10('0x3d')]===_0x7a10('0x49')&&_0x3ed572['variableName']&&_0x3ed572['idField']){_0x24c04e[_0x3ed572[_0x7a10('0x4a')]]&&(_0x171ef1[_0x3ed572[_0x7a10('0x48')]]=_0x24c04e[_0x3ed572['variableName']][_0x7a10('0x4b')]());}else if(_0x3ed572[_0x7a10('0x3d')]===_0x7a10('0x4c')&&_0x3ed572[_0x7a10('0x4d')]&&_0x3ed572['Variable'][_0x7a10('0x4e')]&&_0x3ed572[_0x7a10('0x48')]){_0x24c04e[_0x3ed572[_0x7a10('0x4d')]['name'][_0x7a10('0x4f')]()]&&(_0x171ef1[_0x3ed572[_0x7a10('0x48')]]=_0x24c04e[_0x3ed572['Variable'][_0x7a10('0x4e')][_0x7a10('0x4f')]()]['toString']());}});}return _0x171ef1;}function getConnection(_0x2854bd){var _0x465cf2=_0x2854bd[_0x7a10('0x50')]['concat'](_0x2854bd[_0x7a10('0x51')]);var _0x557310=new jsforce[(_0x7a10('0x52'))]({'oauth2':{'loginUrl':_0x2854bd[_0x7a10('0x53')]||_0x7a10('0x54'),'clientId':_0x2854bd['clientId'],'clientSecret':_0x2854bd['clientSecret']}});return _0x557310[_0x7a10('0x55')](_0x2854bd[_0x7a10('0x56')],_0x465cf2)[_0x7a10('0x23')](function(){logger['info'](_0x7a10('0x57'));return _0x557310;});}exports[_0x7a10('0x58')]=function(_0xfbccc7,_0x5aa527,_0x2c9c06,_0x5109c3,_0x3acc1d,_0x4913fb){var _0x36ce42,_0x120585,_0x6149df,_0x23ad00;_0x4913fb['serverUrl']=intUtil['stripTrailingSlash'](_0x4913fb[_0x7a10('0x59')]);_0x4913fb[_0x7a10('0x53')]=intUtil[_0x7a10('0x5a')](_0x4913fb[_0x7a10('0x53')]);if(_0x3acc1d&&_0x3acc1d[_0x7a10('0x5b')]){logger[_0x7a10('0x27')]('[QUEUE]',_0x7a10('0x5c'));_0x5aa527[_0x7a10('0x5d')]=util[_0x7a10('0x42')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4913fb[_0x7a10('0x59')],_0x5aa527[_0x7a10('0x5e')],md5(_0x5aa527['uniqueid']));}else{_0x5aa527[_0x7a10('0x5d')]='';}return getConnection(_0x4913fb)[_0x7a10('0x23')](function(_0x45d23d){_0x23ad00=_0x45d23d;return getUser(_0x4913fb,_0x5109c3['email'],_0x23ad00);})[_0x7a10('0x23')](function(_0xbddb4d){_0x36ce42=_0xbddb4d;return getEndUser(_0x4913fb,_0x2c9c06,_0x5aa527['calleridname'],_0x5aa527[_0x7a10('0x5f')],_0x23ad00);})[_0x7a10('0x23')](function(_0x5ec553){_0x120585=_0x5ec553;return getTicket(_0x4913fb,_0x36ce42,_0x120585,_0x2c9c06,_0x5aa527,_0x2c9c06[_0x7a10('0x60')],_0x23ad00,'queue');})[_0x7a10('0x23')](function(_0x236c52){_0x6149df=_0x236c52;logger[_0x7a10('0x27')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x6149df['id']);logger[_0x7a10('0x27')](_0x7a10('0x61'),_0x6149df['id'],_0x5109c3[_0x7a10('0x4e')],_0x4913fb[_0x7a10('0x3d')]);switch(_0x4913fb[_0x7a10('0x3d')]){case _0x7a10('0x62'):emit(util[_0x7a10('0x42')](_0x7a10('0x63'),_0x5109c3[_0x7a10('0x4e')]),_0x7a10('0x64'),{'recordId':_0x6149df['id']});break;case _0x7a10('0x65'):emit(util[_0x7a10('0x42')](_0x7a10('0x63'),_0x5109c3[_0x7a10('0x4e')]),_0x7a10('0x66'),{'uri':util['format']('%s/%s/e',_0x23ad00['instanceUrl'],_0x6149df['id'])});break;default:logger[_0x7a10('0x67')](_0x7a10('0x68'));}})['catch'](function(_0x1127e0){logger[_0x7a10('0x67')](_0x7a10('0x69'),_0x1127e0);});};exports['outbound']=function(_0x243efd,_0x3eb6a5,_0x4d1dea,_0x5ed005,_0x5916bb,_0x26eac5,_0x3ad95d){var _0x124ba0,_0x49cc09,_0x2802f6,_0x5b57c2;_0x26eac5['serverUrl']=intUtil[_0x7a10('0x5a')](_0x26eac5[_0x7a10('0x59')]);_0x26eac5['remoteUri']=intUtil[_0x7a10('0x5a')](_0x26eac5[_0x7a10('0x53')]);if(_0x3ad95d&&_0x3ad95d['recordingFormat']&&_0x3ad95d['recordingFormat']!=='none'){logger[_0x7a10('0x27')](_0x7a10('0x6a'),_0x7a10('0x5c'));_0x3eb6a5[_0x7a10('0x5d')]=util[_0x7a10('0x42')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x26eac5['serverUrl'],_0x3eb6a5['uniqueid'],md5(_0x3eb6a5[_0x7a10('0x5e')]));}return getConnection(_0x26eac5)[_0x7a10('0x23')](function(_0x198530){_0x5b57c2=_0x198530;return getUser(_0x26eac5,_0x5ed005['email'],_0x5b57c2);})[_0x7a10('0x23')](function(_0xaee6b){_0x124ba0=_0xaee6b;return getEndUser(_0x26eac5,_0x4d1dea,_0x3eb6a5[_0x7a10('0x6b')],_0x3eb6a5[_0x7a10('0x6c')],_0x5b57c2);})[_0x7a10('0x23')](function(_0x799d55){_0x49cc09=_0x799d55;return getTicket(_0x26eac5,_0x124ba0,_0x49cc09,_0x4d1dea,_0x3eb6a5,_0x4d1dea[_0x7a10('0x60')],_0x5b57c2,_0x7a10('0x6d'));})[_0x7a10('0x23')](function(_0x3318cf){_0x2802f6=_0x3318cf;logger['info'](_0x7a10('0x6e'),_0x2802f6['id']);logger[_0x7a10('0x27')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x2802f6['id'],_0x5ed005[_0x7a10('0x4e')],_0x26eac5[_0x7a10('0x3d')]);switch(_0x26eac5[_0x7a10('0x3d')]){case _0x7a10('0x62'):emit(util[_0x7a10('0x42')]('user:%s',_0x5ed005[_0x7a10('0x4e')]),_0x7a10('0x64'),{'recordId':_0x2802f6['id']});break;case'newTab':emit(util[_0x7a10('0x42')](_0x7a10('0x63'),_0x5ed005[_0x7a10('0x4e')]),'trigger:browser:url',{'uri':util[_0x7a10('0x42')](_0x7a10('0x6f'),_0x5b57c2[_0x7a10('0x70')],_0x2802f6['id'])});break;default:logger['error'](_0x7a10('0x6a'),_0x7a10('0x71'));}})[_0x7a10('0x72')](function(_0x1748a7){logger[_0x7a10('0x67')]('[OUTBOUND]',_0x1748a7);});};exports['unmanaged']=function(_0x30b44d,_0x370dc4,_0x599b27,_0x1a9938,_0x489eae,_0x4ff231){var _0x435b2e,_0x10e355,_0x30a71e,_0x58a7ea;_0x4ff231['serverUrl']=intUtil['stripTrailingSlash'](_0x4ff231[_0x7a10('0x59')]);_0x4ff231['remoteUri']=intUtil[_0x7a10('0x5a')](_0x4ff231[_0x7a10('0x53')]);if(_0x489eae&&_0x489eae['monitor_format']){logger[_0x7a10('0x27')]('['+_0x370dc4[_0x7a10('0x73')][_0x7a10('0x74')]()+']',_0x7a10('0x5c'));_0x370dc4[_0x7a10('0x5d')]=util[_0x7a10('0x42')](_0x7a10('0x75'),_0x4ff231[_0x7a10('0x59')],_0x370dc4[_0x7a10('0x5e')],md5(_0x370dc4[_0x7a10('0x5e')]));}else{_0x370dc4['recordingURL']='';}return getConnection(_0x4ff231)[_0x7a10('0x23')](function(_0xd851e8){_0x58a7ea=_0xd851e8;if(!_[_0x7a10('0x20')](_0x1a9938)){return getUser(_0x4ff231,_0x1a9938[_0x7a10('0x4e')],_0x58a7ea);}else{return getUser(_0x4ff231,null,_0x58a7ea);}})[_0x7a10('0x23')](function(_0x9e4ba){_0x435b2e=_0x9e4ba;return getEndUser(_0x4ff231,_0x599b27,_0x370dc4[_0x7a10('0x76')],_0x370dc4[_0x7a10('0x5f')],_0x58a7ea);})[_0x7a10('0x23')](function(_0x5bd8e3){_0x10e355=_0x5bd8e3;return getTicket(_0x4ff231,_0x435b2e,_0x10e355,_0x599b27,_0x370dc4,_0x599b27[_0x7a10('0x60')],_0x58a7ea);})[_0x7a10('0x23')](function(_0x14629c){_0x30a71e=_0x14629c;logger[_0x7a10('0x27')]('['+_0x370dc4[_0x7a10('0x73')][_0x7a10('0x74')]()+_0x7a10('0x77'),_0x30a71e['id']);logger[_0x7a10('0x27')]('['+_0x370dc4[_0x7a10('0x73')][_0x7a10('0x74')]()+_0x7a10('0x78'),_0x4ff231['type']);})[_0x7a10('0x72')](function(_0x443734){logger[_0x7a10('0x67')]('['+_0x370dc4[_0x7a10('0x73')][_0x7a10('0x74')]()+']',_0x443734);});}; \ 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 7297134..54bdfe6 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 _0x65a0=['picklist','customField','nameField','toLowerCase','content','toString','type','idField','variableName','customVariable','Variable','name','endUserId','POST','incident','assign','Subjects','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number','label','Incident','ticketNumber',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','outbound','destcalleridnum','callDirection','queue','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','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','bluebird','request-promise','util','ioredis','./util','redis','defaults','localhost','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','message','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','],\x20getUser\x20entity','active','true','userId','],\x20getUser\x20crm','error',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','sys_user?','user','System','endUserNumber','],\x20EndUser\x20schema','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','string'];(function(_0x594c57,_0x1cc97b){var _0x34bac9=function(_0x5e5833){while(--_0x5e5833){_0x594c57['push'](_0x594c57['shift']());}};_0x34bac9(++_0x1cc97b);}(_0x65a0,0x1e6));var _0x065a=function(_0x2a2fc3,_0x14c843){_0x2a2fc3=_0x2a2fc3-0x0;var _0x59c952=_0x65a0[_0x2a2fc3];return _0x59c952;};'use strict';var _=require('lodash');var Promise=require(_0x065a('0x0'));var rp=require(_0x065a('0x1'));var util=require(_0x065a('0x2'));var md5=require('md5');var Redis=require(_0x065a('0x3'));var intUtil=require(_0x065a('0x4'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('servicenow');config[_0x065a('0x5')]=_[_0x065a('0x6')](config[_0x065a('0x5')],{'host':_0x065a('0x7'),'port':0x18eb});var io=require(_0x065a('0x8'))(new Redis(config[_0x065a('0x5')]));function getAdminUser(_0x489f49,_0x5769f9,_0x3a8b08,_0x4920b8,_0x336ec7,_0xd75cb4){return new Promise(function(_0x572afc,_0x39b701){var _0x1b562b={'method':'GET','uri':_0x4920b8+_0x065a('0x9')+'&'+_0x336ec7+'&'+_0xd75cb4,'auth':_0x5769f9,'json':!![]};return rp(_0x1b562b)[_0x065a('0xa')](function(_0x2c7a7a){if(_0x2c7a7a[_0x065a('0xb')][_0x065a('0xc')]>0x0){_0x3a8b08[_0x065a('0xd')]=_0x2c7a7a[_0x065a('0xb')][0x0][_0x065a('0xe')];}logger[_0x065a('0xf')]('['+[_0x489f49[_0x065a('0x10')]()]+_0x065a('0x11'),_0x3a8b08);_0x572afc(_0x3a8b08);})[_0x065a('0x12')](function(_0x42cbe8){logger['error']('['+[_0x489f49['toUpperCase']()]+']',_0x42cbe8[_0x065a('0x13')]);_0x39b701(_0x42cbe8[_0x065a('0x13')]);});});}function getUser(_0x41f815,_0x2dd500,_0x7a3b8,_0x65377d,_0x4b21db){return function(_0x33d570){logger[_0x065a('0xf')]('['+[_0x41f815[_0x065a('0x10')]()]+'],\x20getUser\x20input\x20crm',_0x33d570);return new Promise(function(_0x1b094a,_0x238894){if(intUtil[_0x065a('0x14')](_0x33d570[_0x065a('0x15')])){var _0x38d66b={'method':_0x065a('0x16'),'uri':_0x7a3b8+_0x065a('0x17')+_0x33d570[_0x065a('0x15')]+'&'+_0x65377d+'&'+_0x4b21db,'auth':_0x2dd500,'json':!![]};logger[_0x065a('0xf')]('['+[_0x41f815[_0x065a('0x10')]()]+'],\x20getUser\x20rp\x20obj',_0x38d66b);return rp(_0x38d66b)[_0x065a('0xa')](function(_0x196ede){logger['info']('['+[_0x41f815[_0x065a('0x10')]()]+_0x065a('0x18'),_0x196ede);if(_0x196ede[_0x065a('0xb')][_0x065a('0xc')]>0x0&&String(_0x196ede[_0x065a('0xb')][0x0][_0x065a('0x19')])===_0x065a('0x1a')){_0x33d570['userId']=_0x196ede[_0x065a('0xb')][0x0][_0x065a('0xe')];}else{_0x33d570[_0x065a('0x1b')]=_0x33d570['adminId'];_0x33d570[_0x065a('0x15')]=_0x33d570['adminEmail'];}logger[_0x065a('0xf')]('['+[_0x41f815['toUpperCase']()]+_0x065a('0x1c'),_0x33d570);_0x1b094a(_0x33d570);})[_0x065a('0x12')](function(_0x1cbacf){logger[_0x065a('0x1d')]('['+[_0x41f815[_0x065a('0x10')]()]+']',_0x1cbacf[_0x065a('0x13')]);_0x238894(_0x1cbacf[_0x065a('0x13')]);});}else{logger[_0x065a('0xf')]('['+[_0x41f815[_0x065a('0x10')]()]+_0x065a('0x1e'));_0x33d570[_0x065a('0x1b')]=_0x33d570[_0x065a('0xd')];_0x33d570['userEmail']=_0x33d570[_0x065a('0x1f')];_0x1b094a(_0x33d570);}});};}function createEndUser(_0x3db2d1,_0xb0af,_0xab64cd,_0x30dd16,_0x2ffabf){logger[_0x065a('0xf')]('['+[_0x3db2d1[_0x065a('0x10')]()]+_0x065a('0x20'),_0xab64cd);return new Promise(function(_0x5ec1d5,_0x302d25){var _0x4b485b={'method':'POST','uri':_0x30dd16+_0x065a('0x21')+_0x2ffabf,'body':{'user_name':_0xab64cd['endUserNumber'],'roles':_0x065a('0x22'),'first_name':_0xab64cd['endUserNumber'],'active':_0x065a('0x1a'),'date_format':_0x065a('0x23'),'phone':_0xab64cd[_0x065a('0x24')]},'auth':_0xb0af,'json':!![]};return rp(_0x4b485b)['then'](function(_0x26f862){logger['info']('['+[_0x3db2d1[_0x065a('0x10')]()]+_0x065a('0x25'),_0x26f862[_0x065a('0xb')]);_0xab64cd['endUserId']=_0x26f862[_0x065a('0xb')][_0x065a('0xe')];_0x5ec1d5(_0xab64cd);})[_0x065a('0x12')](function(_0x265706){logger[_0x065a('0x1d')]('['+[_0x3db2d1[_0x065a('0x10')]()]+']',_0x265706[_0x065a('0x13')]);_0x302d25(_0x265706[_0x065a('0x13')]);});});}function getEndUser(_0x152515,_0x24708c,_0x19512b,_0xf6f906,_0x160537){return function(_0x5a0e93){logger[_0x065a('0xf')]('['+[_0x152515[_0x065a('0x10')]()]+'],\x20getEndUser\x20input\x20crm',_0x5a0e93);return new Promise(function(_0x1a613a,_0x2b059e){var _0x2830d2={'method':'GET','uri':_0x19512b+_0x065a('0x26')+_0x5a0e93[_0x065a('0x24')]+'&'+_0xf6f906+'&'+_0x160537,'auth':_0x24708c,'json':!![]};return rp(_0x2830d2)[_0x065a('0xa')](function(_0x28b913){if(_0x28b913[_0x065a('0xb')][_0x065a('0xc')]>0x0){_0x5a0e93['endUserId']=_0x28b913[_0x065a('0xb')][0x0][_0x065a('0xe')];logger[_0x065a('0xf')]('['+[_0x152515[_0x065a('0x10')]()]+_0x065a('0x27'),_0x5a0e93);_0x1a613a(_0x5a0e93);}else{return createEndUser(_0x152515,_0x24708c,_0x5a0e93,_0x19512b,_0xf6f906)[_0x065a('0xa')](function(_0x221e9a){logger[_0x065a('0xf')]('['+[_0x152515[_0x065a('0x10')]()]+_0x065a('0x28'),_0x221e9a);_0x1a613a(_0x221e9a);});}})[_0x065a('0x12')](function(_0x13ff56){logger[_0x065a('0x1d')]('['+[_0x152515[_0x065a('0x10')]()]+']',_0x13ff56['message']);_0x2b059e(_0x13ff56['message']);});});};}function getCustomFields(_0x126c27,_0x38e483){var _0x2eaffc={};if(_0x126c27[_0x065a('0xc')]>0x0){_[_0x065a('0x29')](_0x126c27,function(_0x153774){if(_[_0x065a('0x2a')]([_0x065a('0x2b'),_0x065a('0x2c')],_0x153774['type'])&&_0x153774['nameField']&&!_0x153774[_0x065a('0x2d')]){_0x2eaffc[_0x153774[_0x065a('0x2e')][_0x065a('0x2f')]()]=_0x153774[_0x065a('0x30')][_0x065a('0x31')]();}else if(_[_0x065a('0x2a')]([_0x065a('0x2b'),_0x065a('0x2c')],_0x153774[_0x065a('0x32')])&&_0x153774[_0x065a('0x33')]&&_0x153774[_0x065a('0x2d')]){_0x2eaffc[_0x153774['idField']['toLowerCase']()]=_0x153774[_0x065a('0x30')]['toString']();}else if(_0x153774[_0x065a('0x32')]==='variable'&&_0x153774['variableName']&&_0x153774[_0x065a('0x33')]&&_0x153774['customField']){_0x2eaffc[_0x153774['idField'][_0x065a('0x2f')]()]=_0x38e483[_0x153774[_0x065a('0x34')]][_0x065a('0x31')]();}else if(_0x153774[_0x065a('0x32')]===_0x065a('0x35')&&_0x153774[_0x065a('0x36')]&&_0x153774[_0x065a('0x36')][_0x065a('0x37')]&&_0x153774['idField']&&_0x153774[_0x065a('0x2d')]){_0x2eaffc[_0x153774[_0x065a('0x33')][_0x065a('0x2f')]()]=_0x38e483[_0x153774[_0x065a('0x36')]['name']['toLowerCase']()]['toString']();}});}return _0x2eaffc;}function getTicket(_0x26a3b,_0x1c1374,_0x6fb1d,_0x460f4c,_0x1ca77b,_0x160678){return function(_0x50b4b6){logger[_0x065a('0xf')]('['+[_0x26a3b[_0x065a('0x10')]()]+']\x20getTicket\x20input\x20crm',_0x50b4b6);return new Promise(function(_0x527888,_0x5e1810){var _0xe1d298=_0x26a3b[_0x065a('0x2f')]()==='outbound'?_0x50b4b6[_0x065a('0x1b')]:_0x50b4b6[_0x065a('0x38')];var _0x21ce52={'method':_0x065a('0x39'),'uri':_0x6fb1d+_0x065a('0x3a')+'?'+_0x160678,'body':Object[_0x065a('0x3b')]({},{'active':_0x065a('0x1a'),'caller_id':_0xe1d298,'assigned_to':_0x50b4b6[_0x065a('0x1b')],'short_description':intUtil['getString'](_0x460f4c[_0x065a('0x3c')],_0x1ca77b,'\x20'),'description':intUtil[_0x065a('0x3d')](_0x460f4c[_0x065a('0x3e')],_0x1ca77b,'\x0a')},getCustomFields(_0x460f4c[_0x065a('0x3f')],_0x1ca77b)),'auth':_0x1c1374,'json':!![]};return rp(_0x21ce52)['then'](function(_0x2348b7){logger[_0x065a('0xf')]('['+[_0x26a3b[_0x065a('0x10')]()]+_0x065a('0x40'),_0x2348b7[_0x065a('0xb')]);_0x50b4b6[_0x065a('0x41')]=_0x2348b7[_0x065a('0xb')][_0x065a('0xe')];_0x50b4b6['ticketNumber']=_0x2348b7[_0x065a('0xb')][_0x065a('0x42')];logger[_0x065a('0xf')]('['+[_0x26a3b[_0x065a('0x10')]()]+']\x20getTicket\x20crm',_0x50b4b6);_0x527888(_0x50b4b6);})[_0x065a('0x12')](function(_0x2697d7){logger[_0x065a('0x1d')]('['+[_0x26a3b[_0x065a('0x10')]()]+']',_0x2697d7[_0x065a('0x13')]);_0x5e1810(_0x2697d7[_0x065a('0x13')]);});});};}function createRemoteTag(_0x193668,_0x37b5d5,_0xa5f485,_0x47c006){return new Promise(function(_0x580766,_0x8b4eaf){var _0x3379f7={'method':'POST','uri':_0xa5f485+'label'+'?'+_0x47c006,'body':{'short_description':_0x193668,'global':!![],'active':!![],'name':_0x193668},'auth':_0x37b5d5,'json':!![]};return rp(_0x3379f7)[_0x065a('0xa')](function(_0x38962d){var _0x366e7b=_0x38962d[_0x065a('0xb')][_0x065a('0xe')];_0x580766(_0x366e7b);});});}function getRemoteTag(_0x2f2e81,_0x4eb7cb,_0xb8e135,_0x51b8a4,_0x5e8ab6){return new Promise(function(_0x2e660a,_0x3509b2){var _0x6e5abd={'method':'GET','uri':_0xb8e135+_0x065a('0x43')+'?sysparm_query=name%3D'+_0x2f2e81+'&'+_0x51b8a4,'auth':_0x4eb7cb,'json':!![]};return rp(_0x6e5abd)[_0x065a('0xa')](function(_0x4e0e4d){if(_0x4e0e4d['result']['length']>0x0){var _0x24f481=_0x4e0e4d[_0x065a('0xb')][0x0][_0x065a('0xe')];_0x2e660a(_0x24f481);}else{return createRemoteTag(_0x2f2e81,_0x4eb7cb,_0xb8e135,_0x51b8a4)['then'](function(_0x1291c6){_0x2e660a(_0x1291c6);});}});});}function assignTagToIncident(_0x2bbf98,_0x4e482a,_0x52eb78,_0x29d5da,_0x222a26){return new Promise(function(_0x3b35b5,_0x35971f){var _0x25ef69={'method':_0x065a('0x39'),'uri':_0x52eb78+'label_entry'+'?'+_0x222a26,'body':{'label':_0x2bbf98,'table':_0x065a('0x3a'),'id_type':_0x065a('0x44'),'table_key':_0x29d5da[_0x065a('0x41')],'title':'Incident\x20-\x20'+_0x29d5da[_0x065a('0x45')],'id_display':_0x29d5da['ticketNumber']},'auth':_0x4e482a,'json':!![]};return rp(_0x25ef69)[_0x065a('0xa')](function(_0x5195f9){_0x3b35b5();})[_0x065a('0x12')](function(){_0x3b35b5();});});}function manageTags(_0x2bdaf7,_0x40e250,_0x32b6d4,_0x374121,_0x257dcd,_0x2a03f4,_0x406aee){return new Promise(function(_0x4b9109,_0x1972d7){var _0x107a30=[];_0x40e250[_0x065a('0x29')](function(_0x32bc59){_0x107a30['push'](getRemoteTag(_0x32bc59,_0x32b6d4,_0x374121,_0x2a03f4,_0x406aee));});return Promise['all'](_0x107a30)[_0x065a('0xa')](function(_0x30cbf7){if(_0x30cbf7[_0x065a('0xc')]){logger[_0x065a('0xf')]('['+[_0x2bdaf7['toUpperCase']()]+_0x065a('0x46'),_0x30cbf7);var _0x13927c=[];_0x30cbf7[_0x065a('0x29')](function(_0x1e9495){_0x13927c['push'](assignTagToIncident(_0x1e9495,_0x32b6d4,_0x374121,_0x257dcd,_0x2a03f4));});return Promise['all'](_0x13927c)[_0x065a('0xa')](function(){_0x4b9109();})[_0x065a('0x12')](function(){_0x4b9109();});}else{_0x4b9109();}});});}function getTags(_0x45a68f,_0x5b5a31,_0xd302eb,_0x77dcf4,_0x5b3fef,_0x502d4b){return function(_0x15c15b){return new Promise(function(_0x392938,_0x442684){var _0x30212a=[];var _0x26b0fa=_0x77dcf4[_0x065a('0x47')];if(_0x26b0fa&&_0x26b0fa['length']>0x0){_0x30212a=_[_0x065a('0x48')](_0x26b0fa,_0x065a('0x37'));}if(_0x30212a['length']>0x0){return manageTags(_0x45a68f,_0x30212a,_0x5b5a31,_0xd302eb,_0x15c15b,_0x5b3fef,_0x502d4b)[_0x065a('0xa')](function(){_0x392938(_0x15c15b);});}else{_0x392938(_0x15c15b);}});};}function emit(_0xe5a8f5,_0x1d2f83,_0x445acf){var _0xf1e545=_0x065a('0x49')+_0x065a('0x4a')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x065a('0x4b');var _0x2854ee={'uri':_0xe5a8f5+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x445acf+_0xf1e545};io['to'](util[_0x065a('0x4c')](_0x065a('0x4d'),_0x1d2f83))[_0x065a('0x4e')](_0x065a('0x4f'),_0x2854ee);}exports['cs']=function(_0x1c97ff,_0x58ff60,_0x5ba396,_0x557a62,_0x56f096,_0x3abe64,_0x25017e,_0x178e93){var _0x509612={};var _0x194694={'user':_0x3abe64['username'],'pass':_0x3abe64[_0x065a('0x50')]};var _0x78a30d=_0x065a('0x51');var _0x38a7a2='sysparm_display_value=true';_0x3abe64[_0x065a('0x52')]=intUtil[_0x065a('0x53')](_0x3abe64[_0x065a('0x52')]);_0x3abe64[_0x065a('0x54')]=intUtil['stripTrailingSlash'](_0x3abe64['serverUrl']);var _0x378147=util[_0x065a('0x4c')](_0x065a('0x55'),_0x3abe64[_0x065a('0x52')]);_0x509612[_0x065a('0x15')]=!_['isNil'](_0x557a62)?_0x557a62[_0x065a('0x56')]:null;_0x509612[_0x065a('0x1f')]=_0x3abe64[_0x065a('0x56')];_0x509612[_0x065a('0x24')]=_0x178e93[_0x065a('0x2f')]()===_0x065a('0x57')?_0x58ff60[_0x065a('0x58')]:_0x58ff60['calleridnum'];_0x509612[_0x065a('0x59')]=_0x178e93===_0x065a('0x5a')||_0x178e93===_0x065a('0x5b')?_0x065a('0x5a'):_0x065a('0x57');var _0x2cb7fc=util[_0x065a('0x4c')](_0x065a('0x5c'),_0x3abe64[_0x065a('0x54')],_0x58ff60[_0x065a('0x5d')],md5(_0x58ff60[_0x065a('0x5d')]));if(_0x56f096&&_0x56f096[_0x065a('0x5e')]){logger[_0x065a('0xf')](_0x065a('0x5f'),_0x065a('0x60'));_0x58ff60[_0x065a('0x61')]=_0x2cb7fc;}else if(_0x25017e&&_0x25017e[_0x065a('0x62')]&&_0x25017e['recordingFormat']!==_0x065a('0x63')){logger[_0x065a('0xf')](_0x065a('0x64'),_0x065a('0x60'));_0x58ff60['recordingURL']=_0x2cb7fc;}else{_0x58ff60[_0x065a('0x61')]='';}return getAdminUser(_0x178e93,_0x194694,_0x509612,_0x378147,_0x38a7a2,_0x78a30d)[_0x065a('0xa')](getUser(_0x178e93,_0x194694,_0x378147,_0x38a7a2,_0x78a30d))['then'](getEndUser(_0x178e93,_0x194694,_0x378147,_0x38a7a2,_0x78a30d))[_0x065a('0xa')](getTicket(_0x178e93,_0x194694,_0x378147,_0x5ba396,_0x58ff60,_0x38a7a2))[_0x065a('0xa')](function(_0x2b266a){logger['info'](util[_0x065a('0x4c')](_0x065a('0x65'),_0x2b266a['ticketId']));logger[_0x065a('0xf')](util[_0x065a('0x4c')](_0x065a('0x66'),_0x178e93));if(_0x178e93!==_0x065a('0x5b')){logger[_0x065a('0xf')]('['+[_0x178e93['toUpperCase']()]+']',_0x065a('0x67'));emit(_0x3abe64[_0x065a('0x52')],_0x557a62[_0x065a('0x37')],_0x2b266a[_0x065a('0x41')]);}})['catch'](function(_0x5398ad){logger[_0x065a('0x1d')]('['+[_0x178e93['toUpperCase']()]+_0x065a('0x68'),util[_0x065a('0x69')](_0x5398ad,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc85b=['type','nameField','customField','toLowerCase','content','toString','string','idField','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','endUserId','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','POST','label','label_entry','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','util','md5','ioredis','../../../../config/logger','servicenow','redis','defaults','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','adminId','sys_id','],\x20getAdminUser\x20crm','catch','toUpperCase','message','info','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','true','userId','adminEmail','],\x20getUser\x20crm','error',']\x20using\x20admin\x20profile','sys_user?','user','endUserNumber','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','forEach','includes','picklist'];(function(_0x40b070,_0x20cfac){var _0x10c8b7=function(_0xbee9a2){while(--_0xbee9a2){_0x40b070['push'](_0x40b070['shift']());}};_0x10c8b7(++_0x20cfac);}(_0xc85b,0x189));var _0xbc85=function(_0x4bb567,_0x549dc1){_0x4bb567=_0x4bb567-0x0;var _0x567d2b=_0xc85b[_0x4bb567];return _0x567d2b;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require('request-promise');var util=require(_0xbc85('0x0'));var md5=require(_0xbc85('0x1'));var Redis=require(_0xbc85('0x2'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xbc85('0x3'))(_0xbc85('0x4'));config[_0xbc85('0x5')]=_[_0xbc85('0x6')](config[_0xbc85('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0xbc85('0x7'))(new Redis(config[_0xbc85('0x5')]));function getAdminUser(_0x2d2d42,_0x10a21b,_0x41cd7c,_0x19f5c8,_0x4096d8,_0x4f8597){return new Promise(function(_0x2138e2,_0x35e9e5){var _0x3481d4={'method':_0xbc85('0x8'),'uri':_0x19f5c8+_0xbc85('0x9')+'&'+_0x4096d8+'&'+_0x4f8597,'auth':_0x10a21b,'json':!![]};return rp(_0x3481d4)[_0xbc85('0xa')](function(_0x46679f){if(_0x46679f[_0xbc85('0xb')][_0xbc85('0xc')]>0x0){_0x41cd7c[_0xbc85('0xd')]=_0x46679f[_0xbc85('0xb')][0x0][_0xbc85('0xe')];}logger['info']('['+[_0x2d2d42['toUpperCase']()]+_0xbc85('0xf'),_0x41cd7c);_0x2138e2(_0x41cd7c);})[_0xbc85('0x10')](function(_0xee00ff){logger['error']('['+[_0x2d2d42[_0xbc85('0x11')]()]+']',_0xee00ff[_0xbc85('0x12')]);_0x35e9e5(_0xee00ff[_0xbc85('0x12')]);});});}function getUser(_0x4740b5,_0x4cd6dd,_0x17d36d,_0x781a7,_0x42b721){return function(_0x257d53){logger[_0xbc85('0x13')]('['+[_0x4740b5[_0xbc85('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x257d53);return new Promise(function(_0x1b0e66,_0x540343){if(intUtil[_0xbc85('0x14')](_0x257d53[_0xbc85('0x15')])){var _0x4739c6={'method':'GET','uri':_0x17d36d+_0xbc85('0x16')+_0x257d53[_0xbc85('0x15')]+'&'+_0x781a7+'&'+_0x42b721,'auth':_0x4cd6dd,'json':!![]};logger[_0xbc85('0x13')]('['+[_0x4740b5[_0xbc85('0x11')]()]+_0xbc85('0x17'),_0x4739c6);return rp(_0x4739c6)['then'](function(_0x52b969){logger['info']('['+[_0x4740b5[_0xbc85('0x11')]()]+_0xbc85('0x18'),_0x52b969);if(_0x52b969[_0xbc85('0xb')][_0xbc85('0xc')]>0x0&&String(_0x52b969['result'][0x0]['active'])===_0xbc85('0x19')){_0x257d53['userId']=_0x52b969['result'][0x0][_0xbc85('0xe')];}else{_0x257d53[_0xbc85('0x1a')]=_0x257d53[_0xbc85('0xd')];_0x257d53['userEmail']=_0x257d53[_0xbc85('0x1b')];}logger['info']('['+[_0x4740b5[_0xbc85('0x11')]()]+_0xbc85('0x1c'),_0x257d53);_0x1b0e66(_0x257d53);})['catch'](function(_0x5c9d1c){logger[_0xbc85('0x1d')]('['+[_0x4740b5[_0xbc85('0x11')]()]+']',_0x5c9d1c[_0xbc85('0x12')]);_0x540343(_0x5c9d1c[_0xbc85('0x12')]);});}else{logger[_0xbc85('0x13')]('['+[_0x4740b5[_0xbc85('0x11')]()]+_0xbc85('0x1e'));_0x257d53['userId']=_0x257d53['adminId'];_0x257d53[_0xbc85('0x15')]=_0x257d53[_0xbc85('0x1b')];_0x1b0e66(_0x257d53);}});};}function createEndUser(_0x2636b3,_0x536945,_0x5be72f,_0x3679a0,_0x81ad0f){logger[_0xbc85('0x13')]('['+[_0x2636b3[_0xbc85('0x11')]()]+'],\x20createEndUser\x20input\x20crm',_0x5be72f);return new Promise(function(_0x3444b3,_0x3bbfb2){var _0x229839={'method':'POST','uri':_0x3679a0+_0xbc85('0x1f')+_0x81ad0f,'body':{'user_name':_0x5be72f['endUserNumber'],'roles':_0xbc85('0x20'),'first_name':_0x5be72f[_0xbc85('0x21')],'active':'true','date_format':_0xbc85('0x22'),'phone':_0x5be72f['endUserNumber']},'auth':_0x536945,'json':!![]};return rp(_0x229839)[_0xbc85('0xa')](function(_0x1b7278){logger[_0xbc85('0x13')]('['+[_0x2636b3['toUpperCase']()]+_0xbc85('0x23'),_0x1b7278[_0xbc85('0xb')]);_0x5be72f['endUserId']=_0x1b7278[_0xbc85('0xb')][_0xbc85('0xe')];_0x3444b3(_0x5be72f);})[_0xbc85('0x10')](function(_0x12ff51){logger[_0xbc85('0x1d')]('['+[_0x2636b3['toUpperCase']()]+']',_0x12ff51['message']);_0x3bbfb2(_0x12ff51[_0xbc85('0x12')]);});});}function getEndUser(_0x1f41a4,_0x447a50,_0x175944,_0x1a8e06,_0x1db94d){return function(_0x4319cc){logger[_0xbc85('0x13')]('['+[_0x1f41a4['toUpperCase']()]+_0xbc85('0x24'),_0x4319cc);return new Promise(function(_0x190486,_0x2da6a9){var _0x5459dd={'method':_0xbc85('0x8'),'uri':_0x175944+_0xbc85('0x25')+_0x4319cc[_0xbc85('0x21')]+'&'+_0x1a8e06+'&'+_0x1db94d,'auth':_0x447a50,'json':!![]};return rp(_0x5459dd)[_0xbc85('0xa')](function(_0x43ae2e){if(_0x43ae2e[_0xbc85('0xb')][_0xbc85('0xc')]>0x0){_0x4319cc['endUserId']=_0x43ae2e[_0xbc85('0xb')][0x0][_0xbc85('0xe')];logger['info']('['+[_0x1f41a4[_0xbc85('0x11')]()]+_0xbc85('0x26'),_0x4319cc);_0x190486(_0x4319cc);}else{return createEndUser(_0x1f41a4,_0x447a50,_0x4319cc,_0x175944,_0x1a8e06)['then'](function(_0x4b2239){logger['info']('['+[_0x1f41a4[_0xbc85('0x11')]()]+_0xbc85('0x27'),_0x4b2239);_0x190486(_0x4b2239);});}})[_0xbc85('0x10')](function(_0x5ec445){logger[_0xbc85('0x1d')]('['+[_0x1f41a4['toUpperCase']()]+']',_0x5ec445[_0xbc85('0x12')]);_0x2da6a9(_0x5ec445[_0xbc85('0x12')]);});});};}function getCustomFields(_0x5d9f1d,_0x2bb46e){var _0x59b8ad={};if(_0x5d9f1d[_0xbc85('0xc')]>0x0){_[_0xbc85('0x28')](_0x5d9f1d,function(_0x15d01e){if(_[_0xbc85('0x29')](['string',_0xbc85('0x2a')],_0x15d01e[_0xbc85('0x2b')])&&_0x15d01e[_0xbc85('0x2c')]&&!_0x15d01e[_0xbc85('0x2d')]){_0x59b8ad[_0x15d01e[_0xbc85('0x2c')][_0xbc85('0x2e')]()]=_0x15d01e[_0xbc85('0x2f')][_0xbc85('0x30')]();}else if(_[_0xbc85('0x29')]([_0xbc85('0x31'),'picklist'],_0x15d01e[_0xbc85('0x2b')])&&_0x15d01e[_0xbc85('0x32')]&&_0x15d01e[_0xbc85('0x2d')]){_0x59b8ad[_0x15d01e[_0xbc85('0x32')][_0xbc85('0x2e')]()]=_0x15d01e[_0xbc85('0x2f')][_0xbc85('0x30')]();}else if(_0x15d01e[_0xbc85('0x2b')]===_0xbc85('0x33')&&_0x15d01e['variableName']&&_0x15d01e[_0xbc85('0x32')]&&_0x15d01e[_0xbc85('0x2d')]){_0x59b8ad[_0x15d01e[_0xbc85('0x32')]['toLowerCase']()]=_0x2bb46e[_0x15d01e[_0xbc85('0x34')]][_0xbc85('0x30')]();}else if(_0x15d01e[_0xbc85('0x2b')]==='customVariable'&&_0x15d01e['Variable']&&_0x15d01e[_0xbc85('0x35')][_0xbc85('0x36')]&&_0x15d01e[_0xbc85('0x32')]&&_0x15d01e[_0xbc85('0x2d')]){_0x59b8ad[_0x15d01e[_0xbc85('0x32')][_0xbc85('0x2e')]()]=_0x2bb46e[_0x15d01e[_0xbc85('0x35')][_0xbc85('0x36')]['toLowerCase']()][_0xbc85('0x30')]();}});}return _0x59b8ad;}function getTicket(_0x4d282d,_0x74c5ea,_0x31e9e6,_0x49e66a,_0x587d52,_0x15b23f){return function(_0xeaf644){logger['info']('['+[_0x4d282d[_0xbc85('0x11')]()]+_0xbc85('0x37'),_0xeaf644);return new Promise(function(_0x4316b6,_0x2284e9){var _0x2a6ea9=_0x4d282d['toLowerCase']()===_0xbc85('0x38')?_0xeaf644[_0xbc85('0x1a')]:_0xeaf644[_0xbc85('0x39')];var _0x5f156b={'method':'POST','uri':_0x31e9e6+_0xbc85('0x3a')+'?'+_0x15b23f,'body':Object[_0xbc85('0x3b')]({},{'active':_0xbc85('0x19'),'caller_id':_0x2a6ea9,'assigned_to':_0xeaf644[_0xbc85('0x1a')],'short_description':intUtil[_0xbc85('0x3c')](_0x49e66a['Subjects'],_0x587d52,'\x20'),'description':intUtil['getString'](_0x49e66a[_0xbc85('0x3d')],_0x587d52,'\x0a')},getCustomFields(_0x49e66a[_0xbc85('0x3e')],_0x587d52)),'auth':_0x74c5ea,'json':!![]};return rp(_0x5f156b)['then'](function(_0x361c2d){logger[_0xbc85('0x13')]('['+[_0x4d282d[_0xbc85('0x11')]()]+_0xbc85('0x3f'),_0x361c2d[_0xbc85('0xb')]);_0xeaf644[_0xbc85('0x40')]=_0x361c2d['result'][_0xbc85('0xe')];_0xeaf644[_0xbc85('0x41')]=_0x361c2d[_0xbc85('0xb')][_0xbc85('0x42')];logger[_0xbc85('0x13')]('['+[_0x4d282d[_0xbc85('0x11')]()]+_0xbc85('0x43'),_0xeaf644);_0x4316b6(_0xeaf644);})['catch'](function(_0x2efe9f){logger[_0xbc85('0x1d')]('['+[_0x4d282d[_0xbc85('0x11')]()]+']',_0x2efe9f['message']);_0x2284e9(_0x2efe9f[_0xbc85('0x12')]);});});};}function createRemoteTag(_0x506c45,_0x342013,_0x1478b0,_0x49cdc4){return new Promise(function(_0xefedf5,_0x24d737){var _0x5d6228={'method':_0xbc85('0x44'),'uri':_0x1478b0+_0xbc85('0x45')+'?'+_0x49cdc4,'body':{'short_description':_0x506c45,'global':!![],'active':!![],'name':_0x506c45},'auth':_0x342013,'json':!![]};return rp(_0x5d6228)[_0xbc85('0xa')](function(_0x2bca6b){var _0x5e7c85=_0x2bca6b[_0xbc85('0xb')]['sys_id'];_0xefedf5(_0x5e7c85);});});}function getRemoteTag(_0x492c74,_0x1d3053,_0x2f0a36,_0x4fd8a9,_0x134135){return new Promise(function(_0x555584,_0x3b3897){var _0x368581={'method':_0xbc85('0x8'),'uri':_0x2f0a36+'label'+'?sysparm_query=name%3D'+_0x492c74+'&'+_0x4fd8a9,'auth':_0x1d3053,'json':!![]};return rp(_0x368581)[_0xbc85('0xa')](function(_0x5c1026){if(_0x5c1026[_0xbc85('0xb')]['length']>0x0){var _0x5baad3=_0x5c1026[_0xbc85('0xb')][0x0][_0xbc85('0xe')];_0x555584(_0x5baad3);}else{return createRemoteTag(_0x492c74,_0x1d3053,_0x2f0a36,_0x4fd8a9)[_0xbc85('0xa')](function(_0x7fc9b6){_0x555584(_0x7fc9b6);});}});});}function assignTagToIncident(_0x361e18,_0x333950,_0x20b6e3,_0x22113d,_0x3c55d3){return new Promise(function(_0x28c149,_0x296bb2){var _0x23758a={'method':'POST','uri':_0x20b6e3+_0xbc85('0x46')+'?'+_0x3c55d3,'body':{'label':_0x361e18,'table':'incident','id_type':'Incident','table_key':_0x22113d['ticketId'],'title':'Incident\x20-\x20'+_0x22113d['ticketNumber'],'id_display':_0x22113d[_0xbc85('0x41')]},'auth':_0x333950,'json':!![]};return rp(_0x23758a)[_0xbc85('0xa')](function(_0x15e71a){_0x28c149();})[_0xbc85('0x10')](function(){_0x28c149();});});}function manageTags(_0x5a6a55,_0x57e1ee,_0x468111,_0x338d79,_0x4136f5,_0x4310fe,_0x5c0a74){return new Promise(function(_0x4c440b,_0x47c232){var _0x2b9731=[];_0x57e1ee['forEach'](function(_0x571c64){_0x2b9731[_0xbc85('0x47')](getRemoteTag(_0x571c64,_0x468111,_0x338d79,_0x4310fe,_0x5c0a74));});return Promise[_0xbc85('0x48')](_0x2b9731)['then'](function(_0x409753){if(_0x409753[_0xbc85('0xc')]){logger['info']('['+[_0x5a6a55[_0xbc85('0x11')]()]+_0xbc85('0x49'),_0x409753);var _0x2d6095=[];_0x409753[_0xbc85('0x28')](function(_0x1b8b81){_0x2d6095['push'](assignTagToIncident(_0x1b8b81,_0x468111,_0x338d79,_0x4136f5,_0x4310fe));});return Promise[_0xbc85('0x48')](_0x2d6095)['then'](function(){_0x4c440b();})[_0xbc85('0x10')](function(){_0x4c440b();});}else{_0x4c440b();}});});}function getTags(_0x5b8bde,_0x52fd86,_0x23b3f8,_0x5a73a2,_0x458360,_0x3cdbe5){return function(_0x2b8c81){return new Promise(function(_0x12c3ec,_0x423ef5){var _0x510803=[];var _0x161618=_0x5a73a2[_0xbc85('0x4a')];if(_0x161618&&_0x161618[_0xbc85('0xc')]>0x0){_0x510803=_['map'](_0x161618,_0xbc85('0x36'));}if(_0x510803[_0xbc85('0xc')]>0x0){return manageTags(_0x5b8bde,_0x510803,_0x52fd86,_0x23b3f8,_0x2b8c81,_0x458360,_0x3cdbe5)[_0xbc85('0xa')](function(){_0x12c3ec(_0x2b8c81);});}else{_0x12c3ec(_0x2b8c81);}});};}function emit(_0x229a0b,_0x11b0c7,_0x2fef33){var _0x7b1569='%26sysparm_record_target%3Dincident'+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0xbc85('0x4b')+_0xbc85('0x4c');var _0x502368={'uri':_0x229a0b+_0xbc85('0x4d')+_0x2fef33+_0x7b1569};io['to'](util[_0xbc85('0x4e')](_0xbc85('0x4f'),_0x11b0c7))[_0xbc85('0x50')](_0xbc85('0x51'),_0x502368);}exports['cs']=function(_0x4a271c,_0x49ac9a,_0x4369e6,_0x3f2a33,_0x534335,_0x2786bf,_0x4d8652,_0x2513cb){var _0x393604={};var _0x365fd2={'user':_0x2786bf[_0xbc85('0x52')],'pass':_0x2786bf[_0xbc85('0x53')]};var _0x159bb8=_0xbc85('0x54');var _0x55c9f2=_0xbc85('0x55');_0x2786bf[_0xbc85('0x56')]=intUtil[_0xbc85('0x57')](_0x2786bf[_0xbc85('0x56')]);_0x2786bf[_0xbc85('0x58')]=intUtil['stripTrailingSlash'](_0x2786bf[_0xbc85('0x58')]);var _0x19c114=util[_0xbc85('0x4e')](_0xbc85('0x59'),_0x2786bf[_0xbc85('0x56')]);_0x393604[_0xbc85('0x15')]=!_[_0xbc85('0x5a')](_0x3f2a33)?_0x3f2a33[_0xbc85('0x5b')]:null;_0x393604['adminEmail']=_0x2786bf[_0xbc85('0x5b')];_0x393604[_0xbc85('0x21')]=_0x2513cb['toLowerCase']()===_0xbc85('0x38')?_0x49ac9a[_0xbc85('0x5c')]:_0x49ac9a[_0xbc85('0x5d')];_0x393604[_0xbc85('0x5e')]=_0x2513cb===_0xbc85('0x5f')||_0x2513cb===_0xbc85('0x60')?_0xbc85('0x5f'):_0xbc85('0x38');var _0x4763f6=util[_0xbc85('0x4e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2786bf[_0xbc85('0x58')],_0x49ac9a['uniqueid'],md5(_0x49ac9a[_0xbc85('0x61')]));if(_0x534335&&_0x534335[_0xbc85('0x62')]){logger['info'](_0xbc85('0x63'),_0xbc85('0x64'));_0x49ac9a['recordingURL']=_0x4763f6;}else if(_0x4d8652&&_0x4d8652[_0xbc85('0x65')]&&_0x4d8652[_0xbc85('0x65')]!==_0xbc85('0x66')){logger['info'](_0xbc85('0x67'),'Recording\x20is\x20enabled!');_0x49ac9a[_0xbc85('0x68')]=_0x4763f6;}else{_0x49ac9a['recordingURL']='';}return getAdminUser(_0x2513cb,_0x365fd2,_0x393604,_0x19c114,_0x55c9f2,_0x159bb8)[_0xbc85('0xa')](getUser(_0x2513cb,_0x365fd2,_0x19c114,_0x55c9f2,_0x159bb8))[_0xbc85('0xa')](getEndUser(_0x2513cb,_0x365fd2,_0x19c114,_0x55c9f2,_0x159bb8))[_0xbc85('0xa')](getTicket(_0x2513cb,_0x365fd2,_0x19c114,_0x4369e6,_0x49ac9a,_0x55c9f2))[_0xbc85('0xa')](function(_0x40fc8f){logger[_0xbc85('0x13')](util[_0xbc85('0x4e')](_0xbc85('0x69'),_0x40fc8f['ticketId']));logger[_0xbc85('0x13')](util[_0xbc85('0x4e')](_0xbc85('0x6a'),_0x2513cb));if(_0x2513cb!==_0xbc85('0x60')){logger[_0xbc85('0x13')]('['+[_0x2513cb['toUpperCase']()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x2786bf[_0xbc85('0x56')],_0x3f2a33[_0xbc85('0x36')],_0x40fc8f[_0xbc85('0x40')]);}})[_0xbc85('0x10')](function(_0x394e69){logger[_0xbc85('0x1d')]('['+[_0x2513cb[_0xbc85('0x11')]()]+_0xbc85('0x6b'),util[_0xbc85('0x6c')](_0x394e69,{'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 842e185..87d79f3 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 _0xf9ab=['Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','','Caller\x20-\x20%s','debug','[HTTP]','merge','map','type','string','nameField','customField','custom_fields','content','customVariable','Variable','toLowerCase','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','Account\x20%d\x20is\x20not\x20valid','queue','stripTrailingSlash','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','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','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','error','none','[OUTBOUND]','destcalleridname','destcalleridnum','Outbound','contacts','user:%s','trigger:browser:url','monitor_format','lastevent','toUpperCase','The\x20Enduser\x20ID\x20is:','Inbound','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','sugarcrm','redis','defaults','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','Subjects','assigned_user_id','description','getString','date_start','toISOString','slice','replace','duration_minutes','parent_id','Contacts','parent_name','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','user_name','then','find','entry_list','name_value_list','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','Enduser\x20found!'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xf9ab,0x12c));var _0xbf9a=function(_0x589e86,_0x59f058){_0x589e86=_0x589e86-0x0;var _0x10b364=_0xf9ab[_0x589e86];return _0x10b364;};'use strict';var _=require(_0xbf9a('0x0'));var rp=require(_0xbf9a('0x1'));var BPromise=require(_0xbf9a('0x2'));var md5=require(_0xbf9a('0x3'));var util=require('util');var Redis=require(_0xbf9a('0x4'));var intUtil=require(_0xbf9a('0x5'));var config=require(_0xbf9a('0x6'));var logger=require('../../../../config/logger')(_0xbf9a('0x7'));config[_0xbf9a('0x8')]=_[_0xbf9a('0x9')](config[_0xbf9a('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xbf9a('0xa'))(new Redis(config[_0xbf9a('0x8')]));var def={'method':_0xbf9a('0xb'),'json':!![]};function emit(_0xd0d9df,_0x5b8dd0,_0x2cdc66){io['to'](_0xd0d9df)[_0xbf9a('0xc')](_0x5b8dd0,_0x2cdc66);}function getTicket(_0x540695,_0x288506,_0x4a062f,_0x261b5f,_0x34d6db,_0x2a5c81,_0x238427,_0x3dc856){logger[_0xbf9a('0xd')](_0xbf9a('0xe'));var _0x20df9d=new Date();var _0x3df902=[{'name':_0xbf9a('0xf'),'value':intUtil['getString'](_0x261b5f[_0xbf9a('0x10')],_0x34d6db,'\x20')},{'name':_0xbf9a('0x11'),'value':_0x288506['id']},{'name':'created_by','value':_0x288506['id']},{'name':_0xbf9a('0x12'),'value':intUtil[_0xbf9a('0x13')](_0x261b5f['Descriptions'],_0x34d6db,'\x0a')},{'name':_0xbf9a('0x14'),'value':_0x20df9d[_0xbf9a('0x15')]()[_0xbf9a('0x16')](0x0,0x13)[_0xbf9a('0x17')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0xbf9a('0x18'),'value':'15'},{'name':_0xbf9a('0x19'),'value':_0x4a062f['id']},{'name':'parent_type','value':_0xbf9a('0x1a')},{'name':_0xbf9a('0x1b'),'value':_0x4a062f[_0xbf9a('0xf')]},{'name':'direction','value':_0x3dc856}];if(_0x2a5c81[_0xbf9a('0x1c')]){_[_0xbf9a('0x1d')](_0x2a5c81,function(_0x27f024){if(_0x34d6db[_0x27f024[_0xbf9a('0x1e')]]){_0x3df902[_0xbf9a('0x1f')]({'name':_0x27f024[_0xbf9a('0x20')],'value':_0x34d6db[_0x27f024[_0xbf9a('0x1e')]]});}});}return request({'form':{'method':_0xbf9a('0x21'),'input_type':_0xbf9a('0x22'),'response_type':'JSON','rest_data':JSON[_0xbf9a('0x23')]({'session':_0x238427['id'],'module_name':_0xbf9a('0x24'),'name_value_list':_0x3df902})}});}function getAuth(_0x44dbc7){return util[_0xbf9a('0x25')](_0xbf9a('0x26'),new Buffer(_0x44dbc7[_0xbf9a('0x27')]+':X')[_0xbf9a('0x28')](_0xbf9a('0x29')));}function getServerInfo(_0x4bcb59){return request({'form':{'method':_0xbf9a('0x2a'),'input_type':_0xbf9a('0x22'),'response_type':_0xbf9a('0x22'),'rest_data':JSON['stringify']({'session':_0x4bcb59['id']})}});}function getUser(_0x27af73,_0x2d3a1d,_0x16622e){if(!_[_0xbf9a('0x2b')](_0x2d3a1d)){logger[_0xbf9a('0xd')](_0xbf9a('0x2c'),_0x2d3a1d);return request({'form':{'method':_0xbf9a('0x2d'),'input_type':_0xbf9a('0x22'),'response_type':'JSON','rest_data':JSON[_0xbf9a('0x23')]({'session':_0x16622e['id'],'module_name':_0xbf9a('0x2e'),'query':util[_0xbf9a('0x25')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x2d3a1d),'order_by':'','offset':'0','select_fields':['id',_0xbf9a('0xf'),_0xbf9a('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xbf9a('0x30')](function(_0x4e0a89){if(_0x4e0a89['entry_list'][_0xbf9a('0x1c')]){var _0x2a24f6=_[_0xbf9a('0x31')](_0x4e0a89[_0xbf9a('0x32')],function(_0x572533){return _0x572533[_0xbf9a('0x33')]['user_name'][_0xbf9a('0x34')]===_0x2d3a1d;});if(_0x2a24f6){logger[_0xbf9a('0xd')]('Agent\x20found!');return BPromise[_0xbf9a('0x35')]({'id':_0x2a24f6[_0xbf9a('0x33')]['id'][_0xbf9a('0x34')],'name':_0x2a24f6[_0xbf9a('0x33')][_0xbf9a('0xf')][_0xbf9a('0x34')]});}}logger[_0xbf9a('0xd')](_0xbf9a('0x36'));return BPromise[_0xbf9a('0x35')]({'id':_0x16622e['name_value_list'][_0xbf9a('0x37')][_0xbf9a('0x34')],'name':_0x16622e[_0xbf9a('0x33')][_0xbf9a('0x2f')][_0xbf9a('0x34')]});});}else{logger['info'](_0xbf9a('0x38'));return BPromise[_0xbf9a('0x35')]({'id':_0x16622e['name_value_list'][_0xbf9a('0x37')][_0xbf9a('0x34')],'name':_0x16622e['name_value_list'][_0xbf9a('0x2f')][_0xbf9a('0x34')]});}}function getEndUser(_0x12731d,_0x5ec788,_0x3b951e,_0x120ae8){logger[_0xbf9a('0xd')]('Searching\x20enduser\x20with\x20phone',_0x3b951e);return request({'form':{'method':'get_entry_list','input_type':_0xbf9a('0x22'),'response_type':'JSON','rest_data':JSON[_0xbf9a('0x23')]({'session':_0x120ae8['id'],'module_name':_0xbf9a('0x1a'),'query':util[_0xbf9a('0x25')](_0xbf9a('0x39'),_0x3b951e),'order_by':'','offset':'0','select_fields':['id',_0xbf9a('0xf'),_0xbf9a('0x3a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xbf9a('0x30')](function(_0x8a10d5){if(_0x8a10d5['entry_list'][_0xbf9a('0x1c')]){var _0x2009f9=_['find'](_0x8a10d5[_0xbf9a('0x32')],function(_0x52c04e){return _0x52c04e[_0xbf9a('0x33')]['phone_home'][_0xbf9a('0x34')]===_0x3b951e;});if(_0x2009f9){logger[_0xbf9a('0xd')](_0xbf9a('0x3b'));return BPromise[_0xbf9a('0x35')]({'id':_0x2009f9['name_value_list']['id'][_0xbf9a('0x34')],'name':_0x2009f9[_0xbf9a('0x33')][_0xbf9a('0xf')]['value'],'phone':_0x2009f9[_0xbf9a('0x33')][_0xbf9a('0x3a')][_0xbf9a('0x34')]});}}else{logger[_0xbf9a('0xd')](_0xbf9a('0x3c'));return request({'form':{'method':'set_entry','input_type':_0xbf9a('0x22'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x120ae8['id'],'module_name':_0xbf9a('0x1a'),'name_value_list':[{'name':'first_name','value':_0x5ec788!==_0xbf9a('0x3d')?_0x5ec788:util['format'](_0xbf9a('0x3e'),_0x3b951e)},{'name':_0xbf9a('0x3a'),'value':_0x3b951e}]})}})[_0xbf9a('0x30')](function(_0x5f1ef3){logger[_0xbf9a('0xd')]('Enduser\x20created.');return BPromise[_0xbf9a('0x35')]({'id':_0x5f1ef3['id'],'name':_0x5f1ef3['entry_list']['first_name'][_0xbf9a('0x34')],'phone':_0x5f1ef3[_0xbf9a('0x32')]['phone_home']['value']});});}});}function request(_0x2fe60e){logger[_0xbf9a('0x3f')](_0xbf9a('0x40'),JSON[_0xbf9a('0x23')](_0x2fe60e));return rp(_[_0xbf9a('0x41')](def,_0x2fe60e));}function getTags(_0x3b5556,_0x3cce98){var _0x200676=[];if(_0x3b5556&&_0x3b5556[_0xbf9a('0x1c')]>0x0){_0x200676=_[_0xbf9a('0x42')](_0x3b5556,_0x3cce98);}return _0x200676;}function getCustomFields(_0x32aeb3,_0x5e9982){var _0x5eb861=[];var _0x127f8b={'custom_fields':[]};if(_0x32aeb3['length']>0x0){_[_0xbf9a('0x1d')](_0x32aeb3,function(_0x329202){if(_0x329202[_0xbf9a('0x43')]===_0xbf9a('0x44')&&_0x329202[_0xbf9a('0x45')]&&!_0x329202[_0xbf9a('0x46')]){_0x127f8b[_0x329202[_0xbf9a('0x45')]['toLowerCase']()]=_0x329202['content'][_0xbf9a('0x28')]();}else if(_0x329202[_0xbf9a('0x43')]===_0xbf9a('0x44')&&_0x329202[_0xbf9a('0x20')]&&_0x329202[_0xbf9a('0x46')]){_0x127f8b[_0xbf9a('0x47')][_0xbf9a('0x1f')]({'id':_0x329202[_0xbf9a('0x20')],'value':_0x329202[_0xbf9a('0x48')][_0xbf9a('0x28')]()});}else if(_0x329202[_0xbf9a('0x43')]==='variable'&&_0x329202[_0xbf9a('0x1e')]&&_0x329202[_0xbf9a('0x20')]&&_0x329202['customField']){_0x5e9982[_0x329202['variableName']]&&_0x127f8b[_0xbf9a('0x47')]['push']({'id':_0x329202['idField'],'value':_0x5e9982[_0x329202['variableName']][_0xbf9a('0x28')]()});}else if(_0x329202[_0xbf9a('0x43')]===_0xbf9a('0x49')&&_0x329202[_0xbf9a('0x4a')]&&_0x329202[_0xbf9a('0x4a')][_0xbf9a('0xf')]&&_0x329202[_0xbf9a('0x20')]&&_0x329202['customField']){_0x5e9982[_0x329202[_0xbf9a('0x4a')]['name'][_0xbf9a('0x4b')]()]&&_0x127f8b[_0xbf9a('0x47')][_0xbf9a('0x1f')]({'id':_0x329202['idField'],'value':_0x5e9982[_0x329202[_0xbf9a('0x4a')][_0xbf9a('0xf')][_0xbf9a('0x4b')]()][_0xbf9a('0x28')]()});}});}return _0x127f8b;}function getConnection(_0x223a6b){return request({'method':_0xbf9a('0xb'),'form':{'method':_0xbf9a('0x4c'),'input_type':_0xbf9a('0x22'),'response_type':_0xbf9a('0x22'),'rest_data':JSON[_0xbf9a('0x23')]({'user_auth':{'user_name':_0x223a6b[_0xbf9a('0x4d')],'password':_0x223a6b[_0xbf9a('0x4e')],'encryption':_0xbf9a('0x4f')},'application':_0xbf9a('0x50')})}})[_0xbf9a('0x30')](function(_0x2d9751){var _0x4156aa=_0x2d9751;if(_0x4156aa['id']){def['sessionID']=_0x4156aa['id'];return BPromise[_0xbf9a('0x35')](_0x4156aa);}else{throw new Error(util['format'](_0xbf9a('0x51'),_0x223a6b['id']));}});}function setRelationship(_0x42ccba,_0x51a6f8,_0x5857be,_0x52e38f){return request({'form':{'method':'set_relationship','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xbf9a('0x23')]({'session':_0x42ccba['id'],'module_name':_0xbf9a('0x24'),'module_id':_0x5857be['id'],'link_field_name':_0x52e38f,'related_ids':[_0x51a6f8['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xbf9a('0x52')]=function(_0x51e174,_0x412d7c,_0x78af9a,_0x48effc,_0x5105d5,_0x5e66f5){var _0x4ef55f,_0x2db825,_0x885aee,_0x2884b9;_0x5e66f5['remoteUri']=intUtil[_0xbf9a('0x53')](_0x5e66f5[_0xbf9a('0x54')]);_0x5e66f5[_0xbf9a('0x55')]=intUtil[_0xbf9a('0x53')](_0x5e66f5[_0xbf9a('0x55')]);def[_0xbf9a('0x56')]=util[_0xbf9a('0x25')](_0xbf9a('0x57'),_0x5e66f5[_0xbf9a('0x54')]);if(_0x5105d5&&_0x5105d5['monitor_format']){logger[_0xbf9a('0xd')](_0xbf9a('0x58'),_0xbf9a('0x59'));_0x412d7c[_0xbf9a('0x5a')]=util['format'](_0xbf9a('0x5b'),_0x5e66f5[_0xbf9a('0x55')],_0x412d7c[_0xbf9a('0x5c')],md5(_0x412d7c[_0xbf9a('0x5c')]));}else{_0x412d7c[_0xbf9a('0x5a')]='';}return getConnection(_0x5e66f5)['then'](function(_0x3b461d){_0x2884b9=_0x3b461d;return getUser(_0x5e66f5,_0x48effc['name'],_0x2884b9);})[_0xbf9a('0x30')](function(_0x4823c7){_0x4ef55f=_0x4823c7;logger[_0xbf9a('0xd')](_0xbf9a('0x5d'),_0x4ef55f['id']);return getEndUser(_0x5e66f5,_0x412d7c[_0xbf9a('0x5e')],_0x412d7c[_0xbf9a('0x5f')],_0x2884b9);})['then'](function(_0x45ff95){_0x2db825=_0x45ff95;logger[_0xbf9a('0xd')]('The\x20Enduser\x20ID\x20is:',_0x2db825['id']);return getTicket(_0x5e66f5,_0x4ef55f,_0x2db825,_0x78af9a,_0x412d7c,_0x78af9a[_0xbf9a('0x60')],_0x2884b9,'Inbound');})['then'](function(_0x148773){_0x885aee=_0x148773;logger[_0xbf9a('0xd')](_0xbf9a('0x61'));logger['info'](_0xbf9a('0x62'),_0x885aee['id']);return setRelationship(_0x2884b9,_0x4ef55f,_0x885aee,_0xbf9a('0x63'));})[_0xbf9a('0x30')](function(){return setRelationship(_0x2884b9,_0x2db825,_0x885aee,'contacts');})[_0xbf9a('0x30')](function(){return getServerInfo(_0x2884b9);})[_0xbf9a('0x30')](function(_0x5771cb){var _0x372d7a=parseInt(_0x5771cb[_0xbf9a('0x64')][_0xbf9a('0x65')](0x0));var _0x1d0d48=util[_0xbf9a('0x25')](_0xbf9a('0x66'),_0x5e66f5[_0xbf9a('0x54')],_0x885aee['id']);if(_0x372d7a>0x6){_0x1d0d48=util[_0xbf9a('0x25')](_0xbf9a('0x67'),_0x5e66f5['remoteUri'],_0x885aee['id']);}logger[_0xbf9a('0xd')](_0xbf9a('0x58'),_0xbf9a('0x68'));emit(util[_0xbf9a('0x25')]('user:%s',_0x48effc[_0xbf9a('0xf')]),'trigger:browser:url',{'uri':_0x1d0d48});})[_0xbf9a('0x69')](function(_0x49d8e8){logger[_0xbf9a('0x6a')]('[QUEUE]',JSON[_0xbf9a('0x23')](_0x49d8e8));});};exports['outbound']=function(_0x17003e,_0x79fa77,_0x487fc0,_0x5aca70,_0x49e26b,_0x2ea315,_0xd82029){var _0x85719f,_0x287d21,_0x47a10e,_0x2dfc3e;_0x2ea315[_0xbf9a('0x54')]=intUtil[_0xbf9a('0x53')](_0x2ea315[_0xbf9a('0x54')]);_0x2ea315[_0xbf9a('0x55')]=intUtil[_0xbf9a('0x53')](_0x2ea315[_0xbf9a('0x55')]);def['uri']=util['format'](_0xbf9a('0x57'),_0x2ea315[_0xbf9a('0x54')]);if(_0xd82029&&_0xd82029['recordingFormat']&&_0xd82029['recordingFormat']!==_0xbf9a('0x6b')){logger['info'](_0xbf9a('0x6c'),_0xbf9a('0x59'));_0x79fa77['recordingURL']=util['format'](_0xbf9a('0x5b'),_0x2ea315[_0xbf9a('0x55')],_0x79fa77[_0xbf9a('0x5c')],md5(_0x79fa77[_0xbf9a('0x5c')]));}return getConnection(_0x2ea315)[_0xbf9a('0x30')](function(_0x336798){_0x2dfc3e=_0x336798;return getUser(_0x2ea315,_0x5aca70[_0xbf9a('0xf')],_0x2dfc3e);})['then'](function(_0x240204){_0x85719f=_0x240204;logger[_0xbf9a('0xd')](_0xbf9a('0x5d'),_0x85719f['id']);return getEndUser(_0x2ea315,_0x79fa77[_0xbf9a('0x6d')],_0x79fa77[_0xbf9a('0x6e')],_0x2dfc3e);})[_0xbf9a('0x30')](function(_0x4490e2){_0x287d21=_0x4490e2;logger['info']('The\x20Enduser\x20ID\x20is:',_0x287d21['id']);return getTicket(_0x2ea315,_0x85719f,_0x287d21,_0x487fc0,_0x79fa77,_0x487fc0[_0xbf9a('0x60')],_0x2dfc3e,_0xbf9a('0x6f'));})[_0xbf9a('0x30')](function(_0x2a7976){_0x47a10e=_0x2a7976;logger[_0xbf9a('0xd')](_0xbf9a('0x61'));logger['info'](_0xbf9a('0x62'),_0x47a10e['id']);return setRelationship(_0x2dfc3e,_0x85719f,_0x47a10e,_0xbf9a('0x63'));})['then'](function(){return setRelationship(_0x2dfc3e,_0x287d21,_0x47a10e,_0xbf9a('0x70'));})[_0xbf9a('0x30')](function(){return getServerInfo(_0x2dfc3e);})[_0xbf9a('0x30')](function(_0x329582){var _0x176d82=parseInt(_0x329582['version'][_0xbf9a('0x65')](0x0));var _0x1e6e38=util[_0xbf9a('0x25')](_0xbf9a('0x66'),_0x2ea315['remoteUri'],_0x47a10e['id']);if(_0x176d82>0x6){_0x1e6e38=util[_0xbf9a('0x25')](_0xbf9a('0x67'),_0x2ea315[_0xbf9a('0x54')],_0x47a10e['id']);}logger[_0xbf9a('0xd')](_0xbf9a('0x6c'),_0xbf9a('0x68'));emit(util[_0xbf9a('0x25')](_0xbf9a('0x71'),_0x5aca70['name']),_0xbf9a('0x72'),{'uri':_0x1e6e38});})[_0xbf9a('0x69')](function(_0x5e63bb){logger[_0xbf9a('0x6a')](_0xbf9a('0x6c'),JSON['stringify'](_0x5e63bb));});};exports['unmanaged']=function(_0x33f3c1,_0x539572,_0x2b31f5,_0x2570d7,_0x17705b,_0x548542){var _0x8b2c4,_0x25ff08,_0x4caaa3,_0x4aabc3;_0x548542[_0xbf9a('0x54')]=intUtil[_0xbf9a('0x53')](_0x548542[_0xbf9a('0x54')]);_0x548542['serverUrl']=intUtil[_0xbf9a('0x53')](_0x548542[_0xbf9a('0x55')]);def[_0xbf9a('0x56')]=util[_0xbf9a('0x25')](_0xbf9a('0x57'),_0x548542['remoteUri']);if(_0x17705b&&_0x17705b[_0xbf9a('0x73')]){logger['info']('['+_0x539572[_0xbf9a('0x74')][_0xbf9a('0x75')]()+']',_0xbf9a('0x59'));_0x539572[_0xbf9a('0x5a')]=util[_0xbf9a('0x25')](_0xbf9a('0x5b'),_0x548542[_0xbf9a('0x55')],_0x539572[_0xbf9a('0x5c')],md5(_0x539572[_0xbf9a('0x5c')]));}else{_0x539572['recordingURL']='';}return getConnection(_0x548542)['then'](function(_0x39d0de){_0x4aabc3=_0x39d0de;if(!_[_0xbf9a('0x2b')](_0x2570d7)){return getUser(_0x548542,_0x2570d7[_0xbf9a('0xf')],_0x4aabc3);}else{return getUser(_0x548542,null,_0x4aabc3);}})[_0xbf9a('0x30')](function(_0x28103f){_0x8b2c4=_0x28103f;logger['info'](_0xbf9a('0x5d'),_0x8b2c4['id']);return getEndUser(_0x548542,_0x539572[_0xbf9a('0x5e')],_0x539572[_0xbf9a('0x5f')],_0x4aabc3);})['then'](function(_0x98db3e){_0x25ff08=_0x98db3e;logger[_0xbf9a('0xd')](_0xbf9a('0x76'),_0x25ff08['id']);return getTicket(_0x548542,_0x8b2c4,_0x25ff08,_0x2b31f5,_0x539572,_0x2b31f5[_0xbf9a('0x60')],_0x4aabc3,_0xbf9a('0x77'));})[_0xbf9a('0x30')](function(_0x4eef84){_0x4caaa3=_0x4eef84;logger[_0xbf9a('0xd')](_0xbf9a('0x61'));logger[_0xbf9a('0xd')](_0xbf9a('0x62'),_0x4caaa3['id']);return setRelationship(_0x4aabc3,_0x8b2c4,_0x4caaa3,_0xbf9a('0x63'));})[_0xbf9a('0x30')](function(){return setRelationship(_0x4aabc3,_0x25ff08,_0x4caaa3,_0xbf9a('0x70'));})[_0xbf9a('0x30')](function(){return getServerInfo(_0x4aabc3);})[_0xbf9a('0x69')](function(_0x2344d3){logger['error']('['+_0x539572[_0xbf9a('0x74')][_0xbf9a('0x75')]()+']',JSON['stringify'](_0x2344d3));});}; \ No newline at end of file +var _0xe2b9=['value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','merge','map','type','string','nameField','toLowerCase','customField','custom_fields','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','Calls','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','Inbound','Ticket\x20created!','contacts','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','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','outbound','uri','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Enduser\x20ID\x20is:','Fields','users','monitor_format','lastevent','toUpperCase','calleridnum','The\x20Ticket\x20ID\x20is:','error','lodash','request-promise','md5','util','./util','../../../../config/environment','sugarcrm','redis','localhost','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','format','Basic\x20%s','apiKey','toString','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','user_name','then','entry_list'];(function(_0x4eda22,_0x3d2db4){var _0x4a5706=function(_0x4345e3){while(--_0x4345e3){_0x4eda22['push'](_0x4eda22['shift']());}};_0x4a5706(++_0x3d2db4);}(_0xe2b9,0x1b1));var _0x9e2b=function(_0x12aaee,_0x5bf50c){_0x12aaee=_0x12aaee-0x0;var _0x37c350=_0xe2b9[_0x12aaee];return _0x37c350;};'use strict';var _=require(_0x9e2b('0x0'));var rp=require(_0x9e2b('0x1'));var BPromise=require('bluebird');var md5=require(_0x9e2b('0x2'));var util=require(_0x9e2b('0x3'));var Redis=require('ioredis');var intUtil=require(_0x9e2b('0x4'));var config=require(_0x9e2b('0x5'));var logger=require('../../../../config/logger')(_0x9e2b('0x6'));config['redis']=_['defaults'](config[_0x9e2b('0x7')],{'host':_0x9e2b('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9e2b('0x7')]));var def={'method':_0x9e2b('0x9'),'json':!![]};function emit(_0x569958,_0x35c036,_0x422b67){io['to'](_0x569958)[_0x9e2b('0xa')](_0x35c036,_0x422b67);}function getTicket(_0x27788e,_0x44f0d7,_0xe783fa,_0xf4f1b6,_0x4f4591,_0x48ec69,_0x48c61d,_0x13ec85){logger[_0x9e2b('0xb')](_0x9e2b('0xc'));var _0x20c5e8=new Date();var _0xb0c1=[{'name':_0x9e2b('0xd'),'value':intUtil[_0x9e2b('0xe')](_0xf4f1b6[_0x9e2b('0xf')],_0x4f4591,'\x20')},{'name':_0x9e2b('0x10'),'value':_0x44f0d7['id']},{'name':_0x9e2b('0x11'),'value':_0x44f0d7['id']},{'name':_0x9e2b('0x12'),'value':intUtil['getString'](_0xf4f1b6[_0x9e2b('0x13')],_0x4f4591,'\x0a')},{'name':_0x9e2b('0x14'),'value':_0x20c5e8[_0x9e2b('0x15')]()[_0x9e2b('0x16')](0x0,0x13)[_0x9e2b('0x17')]('T','\x20')},{'name':_0x9e2b('0x18'),'value':'0'},{'name':_0x9e2b('0x19'),'value':'15'},{'name':_0x9e2b('0x1a'),'value':_0xe783fa['id']},{'name':'parent_type','value':'Contacts'},{'name':'parent_name','value':_0xe783fa[_0x9e2b('0xd')]},{'name':_0x9e2b('0x1b'),'value':_0x13ec85}];if(_0x48ec69[_0x9e2b('0x1c')]){_[_0x9e2b('0x1d')](_0x48ec69,function(_0x33963b){if(_0x4f4591[_0x33963b[_0x9e2b('0x1e')]]){_0xb0c1[_0x9e2b('0x1f')]({'name':_0x33963b[_0x9e2b('0x20')],'value':_0x4f4591[_0x33963b[_0x9e2b('0x1e')]]});}});}return request({'form':{'method':_0x9e2b('0x21'),'input_type':_0x9e2b('0x22'),'response_type':_0x9e2b('0x22'),'rest_data':JSON[_0x9e2b('0x23')]({'session':_0x48c61d['id'],'module_name':'Calls','name_value_list':_0xb0c1})}});}function getAuth(_0x96cfd1){return util[_0x9e2b('0x24')](_0x9e2b('0x25'),new Buffer(_0x96cfd1[_0x9e2b('0x26')]+':X')[_0x9e2b('0x27')]('base64'));}function getServerInfo(_0x2eafa2){return request({'form':{'method':_0x9e2b('0x28'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x9e2b('0x23')]({'session':_0x2eafa2['id']})}});}function getUser(_0x56fd74,_0x371151,_0x1b9277){if(!_[_0x9e2b('0x29')](_0x371151)){logger[_0x9e2b('0xb')](_0x9e2b('0x2a'),_0x371151);return request({'form':{'method':_0x9e2b('0x2b'),'input_type':'JSON','response_type':_0x9e2b('0x22'),'rest_data':JSON[_0x9e2b('0x23')]({'session':_0x1b9277['id'],'module_name':'Employees','query':util[_0x9e2b('0x24')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x371151),'order_by':'','offset':'0','select_fields':['id',_0x9e2b('0xd'),_0x9e2b('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x9e2b('0x2d')](function(_0x10ad13){if(_0x10ad13[_0x9e2b('0x2e')][_0x9e2b('0x1c')]){var _0x47be5a=_['find'](_0x10ad13[_0x9e2b('0x2e')],function(_0x2d1432){return _0x2d1432['name_value_list'][_0x9e2b('0x2c')][_0x9e2b('0x2f')]===_0x371151;});if(_0x47be5a){logger[_0x9e2b('0xb')](_0x9e2b('0x30'));return BPromise[_0x9e2b('0x31')]({'id':_0x47be5a['name_value_list']['id'][_0x9e2b('0x2f')],'name':_0x47be5a[_0x9e2b('0x32')][_0x9e2b('0xd')]['value']});}}logger[_0x9e2b('0xb')](_0x9e2b('0x33'));return BPromise['resolve']({'id':_0x1b9277[_0x9e2b('0x32')][_0x9e2b('0x34')][_0x9e2b('0x2f')],'name':_0x1b9277[_0x9e2b('0x32')][_0x9e2b('0x2c')][_0x9e2b('0x2f')]});});}else{logger['info'](_0x9e2b('0x35'));return BPromise[_0x9e2b('0x31')]({'id':_0x1b9277[_0x9e2b('0x32')][_0x9e2b('0x34')][_0x9e2b('0x2f')],'name':_0x1b9277[_0x9e2b('0x32')]['user_name'][_0x9e2b('0x2f')]});}}function getEndUser(_0x2d67e0,_0x44e34e,_0x2c186a,_0x15eb5c){logger[_0x9e2b('0xb')](_0x9e2b('0x36'),_0x2c186a);return request({'form':{'method':'get_entry_list','input_type':_0x9e2b('0x22'),'response_type':_0x9e2b('0x22'),'rest_data':JSON[_0x9e2b('0x23')]({'session':_0x15eb5c['id'],'module_name':_0x9e2b('0x37'),'query':util['format'](_0x9e2b('0x38'),_0x2c186a),'order_by':'','offset':'0','select_fields':['id',_0x9e2b('0xd'),_0x9e2b('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x9e2b('0x2d')](function(_0xa0150d){if(_0xa0150d[_0x9e2b('0x2e')][_0x9e2b('0x1c')]){var _0x56b1dc=_[_0x9e2b('0x3a')](_0xa0150d[_0x9e2b('0x2e')],function(_0x5ac475){return _0x5ac475[_0x9e2b('0x32')][_0x9e2b('0x39')][_0x9e2b('0x2f')]===_0x2c186a;});if(_0x56b1dc){logger[_0x9e2b('0xb')]('Enduser\x20found!');return BPromise['resolve']({'id':_0x56b1dc[_0x9e2b('0x32')]['id'][_0x9e2b('0x2f')],'name':_0x56b1dc[_0x9e2b('0x32')][_0x9e2b('0xd')][_0x9e2b('0x2f')],'phone':_0x56b1dc['name_value_list']['phone_home'][_0x9e2b('0x2f')]});}}else{logger[_0x9e2b('0xb')](_0x9e2b('0x3b'));return request({'form':{'method':_0x9e2b('0x21'),'input_type':_0x9e2b('0x22'),'response_type':_0x9e2b('0x22'),'rest_data':JSON[_0x9e2b('0x23')]({'session':_0x15eb5c['id'],'module_name':'Contacts','name_value_list':[{'name':_0x9e2b('0x3c'),'value':_0x44e34e!==_0x9e2b('0x3d')?_0x44e34e:util[_0x9e2b('0x24')](_0x9e2b('0x3e'),_0x2c186a)},{'name':_0x9e2b('0x39'),'value':_0x2c186a}]})}})[_0x9e2b('0x2d')](function(_0x55ab34){logger['info'](_0x9e2b('0x3f'));return BPromise[_0x9e2b('0x31')]({'id':_0x55ab34['id'],'name':_0x55ab34['entry_list']['first_name']['value'],'phone':_0x55ab34[_0x9e2b('0x2e')][_0x9e2b('0x39')][_0x9e2b('0x2f')]});});}});}function request(_0x430870){logger['debug']('[HTTP]',JSON['stringify'](_0x430870));return rp(_[_0x9e2b('0x40')](def,_0x430870));}function getTags(_0x5a0ed1,_0x2aa4f6){var _0xab60db=[];if(_0x5a0ed1&&_0x5a0ed1[_0x9e2b('0x1c')]>0x0){_0xab60db=_[_0x9e2b('0x41')](_0x5a0ed1,_0x2aa4f6);}return _0xab60db;}function getCustomFields(_0x13ccd3,_0x1f839e){var _0x2dfe90=[];var _0x1fddc9={'custom_fields':[]};if(_0x13ccd3['length']>0x0){_[_0x9e2b('0x1d')](_0x13ccd3,function(_0x535ef1){if(_0x535ef1[_0x9e2b('0x42')]===_0x9e2b('0x43')&&_0x535ef1[_0x9e2b('0x44')]&&!_0x535ef1['customField']){_0x1fddc9[_0x535ef1[_0x9e2b('0x44')][_0x9e2b('0x45')]()]=_0x535ef1['content']['toString']();}else if(_0x535ef1[_0x9e2b('0x42')]===_0x9e2b('0x43')&&_0x535ef1[_0x9e2b('0x20')]&&_0x535ef1[_0x9e2b('0x46')]){_0x1fddc9[_0x9e2b('0x47')][_0x9e2b('0x1f')]({'id':_0x535ef1['idField'],'value':_0x535ef1['content'][_0x9e2b('0x27')]()});}else if(_0x535ef1[_0x9e2b('0x42')]==='variable'&&_0x535ef1[_0x9e2b('0x1e')]&&_0x535ef1[_0x9e2b('0x20')]&&_0x535ef1[_0x9e2b('0x46')]){_0x1f839e[_0x535ef1[_0x9e2b('0x1e')]]&&_0x1fddc9[_0x9e2b('0x47')][_0x9e2b('0x1f')]({'id':_0x535ef1[_0x9e2b('0x20')],'value':_0x1f839e[_0x535ef1['variableName']]['toString']()});}else if(_0x535ef1[_0x9e2b('0x42')]===_0x9e2b('0x48')&&_0x535ef1[_0x9e2b('0x49')]&&_0x535ef1[_0x9e2b('0x49')]['name']&&_0x535ef1[_0x9e2b('0x20')]&&_0x535ef1[_0x9e2b('0x46')]){_0x1f839e[_0x535ef1[_0x9e2b('0x49')][_0x9e2b('0xd')][_0x9e2b('0x45')]()]&&_0x1fddc9[_0x9e2b('0x47')][_0x9e2b('0x1f')]({'id':_0x535ef1['idField'],'value':_0x1f839e[_0x535ef1[_0x9e2b('0x49')][_0x9e2b('0xd')][_0x9e2b('0x45')]()][_0x9e2b('0x27')]()});}});}return _0x1fddc9;}function getConnection(_0x30fcd4){return request({'method':_0x9e2b('0x9'),'form':{'method':_0x9e2b('0x4a'),'input_type':_0x9e2b('0x22'),'response_type':_0x9e2b('0x22'),'rest_data':JSON[_0x9e2b('0x23')]({'user_auth':{'user_name':_0x30fcd4[_0x9e2b('0x4b')],'password':_0x30fcd4[_0x9e2b('0x4c')],'encryption':_0x9e2b('0x4d')},'application':_0x9e2b('0x4e')})}})['then'](function(_0x2ca908){var _0x1f1288=_0x2ca908;if(_0x1f1288['id']){def[_0x9e2b('0x4f')]=_0x1f1288['id'];return BPromise[_0x9e2b('0x31')](_0x1f1288);}else{throw new Error(util[_0x9e2b('0x24')](_0x9e2b('0x50'),_0x30fcd4['id']));}});}function setRelationship(_0x1d682d,_0x44749b,_0x4c1357,_0x57ee27){return request({'form':{'method':_0x9e2b('0x51'),'input_type':_0x9e2b('0x22'),'response_type':_0x9e2b('0x22'),'rest_data':JSON[_0x9e2b('0x23')]({'session':_0x1d682d['id'],'module_name':_0x9e2b('0x52'),'module_id':_0x4c1357['id'],'link_field_name':_0x57ee27,'related_ids':[_0x44749b['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x9e2b('0x53')]=function(_0x275e9f,_0x2234dd,_0x52f95f,_0x107652,_0x98914a,_0x4efe21){var _0x14d37d,_0xbfc90d,_0x454aec,_0x4555cf;_0x4efe21[_0x9e2b('0x54')]=intUtil[_0x9e2b('0x55')](_0x4efe21[_0x9e2b('0x54')]);_0x4efe21[_0x9e2b('0x56')]=intUtil[_0x9e2b('0x55')](_0x4efe21[_0x9e2b('0x56')]);def['uri']=util[_0x9e2b('0x24')](_0x9e2b('0x57'),_0x4efe21[_0x9e2b('0x54')]);if(_0x98914a&&_0x98914a['monitor_format']){logger[_0x9e2b('0xb')](_0x9e2b('0x58'),'Recording\x20is\x20enabled!');_0x2234dd[_0x9e2b('0x59')]=util[_0x9e2b('0x24')](_0x9e2b('0x5a'),_0x4efe21[_0x9e2b('0x56')],_0x2234dd['uniqueid'],md5(_0x2234dd[_0x9e2b('0x5b')]));}else{_0x2234dd[_0x9e2b('0x59')]='';}return getConnection(_0x4efe21)[_0x9e2b('0x2d')](function(_0x2e048c){_0x4555cf=_0x2e048c;return getUser(_0x4efe21,_0x107652[_0x9e2b('0xd')],_0x4555cf);})[_0x9e2b('0x2d')](function(_0x104b96){_0x14d37d=_0x104b96;logger[_0x9e2b('0xb')](_0x9e2b('0x5c'),_0x14d37d['id']);return getEndUser(_0x4efe21,_0x2234dd[_0x9e2b('0x5d')],_0x2234dd['calleridnum'],_0x4555cf);})[_0x9e2b('0x2d')](function(_0x16df55){_0xbfc90d=_0x16df55;logger[_0x9e2b('0xb')]('The\x20Enduser\x20ID\x20is:',_0xbfc90d['id']);return getTicket(_0x4efe21,_0x14d37d,_0xbfc90d,_0x52f95f,_0x2234dd,_0x52f95f['Fields'],_0x4555cf,_0x9e2b('0x5e'));})[_0x9e2b('0x2d')](function(_0x3ea738){_0x454aec=_0x3ea738;logger[_0x9e2b('0xb')](_0x9e2b('0x5f'));logger[_0x9e2b('0xb')]('The\x20Ticket\x20ID\x20is:',_0x454aec['id']);return setRelationship(_0x4555cf,_0x14d37d,_0x454aec,'users');})['then'](function(){return setRelationship(_0x4555cf,_0xbfc90d,_0x454aec,_0x9e2b('0x60'));})[_0x9e2b('0x2d')](function(){return getServerInfo(_0x4555cf);})['then'](function(_0x675158){var _0x3bd04f=parseInt(_0x675158[_0x9e2b('0x61')][_0x9e2b('0x62')](0x0));var _0x331470=util[_0x9e2b('0x24')](_0x9e2b('0x63'),_0x4efe21[_0x9e2b('0x54')],_0x454aec['id']);if(_0x3bd04f>0x6){_0x331470=util[_0x9e2b('0x24')](_0x9e2b('0x64'),_0x4efe21['remoteUri'],_0x454aec['id']);}logger[_0x9e2b('0xb')]('[QUEUE]',_0x9e2b('0x65'));emit(util['format']('user:%s',_0x107652['name']),_0x9e2b('0x66'),{'uri':_0x331470});})[_0x9e2b('0x67')](function(_0xc665bc){logger['error'](_0x9e2b('0x58'),JSON['stringify'](_0xc665bc));});};exports[_0x9e2b('0x68')]=function(_0x735280,_0x36d8ca,_0x2c1cbc,_0x42c909,_0x24f70e,_0x339451,_0x40bd0d){var _0x55a88e,_0x534e80,_0x23a801,_0x42c8ea;_0x339451['remoteUri']=intUtil[_0x9e2b('0x55')](_0x339451[_0x9e2b('0x54')]);_0x339451[_0x9e2b('0x56')]=intUtil[_0x9e2b('0x55')](_0x339451['serverUrl']);def[_0x9e2b('0x69')]=util['format'](_0x9e2b('0x57'),_0x339451[_0x9e2b('0x54')]);if(_0x40bd0d&&_0x40bd0d[_0x9e2b('0x6a')]&&_0x40bd0d[_0x9e2b('0x6a')]!==_0x9e2b('0x6b')){logger[_0x9e2b('0xb')](_0x9e2b('0x6c'),_0x9e2b('0x6d'));_0x36d8ca[_0x9e2b('0x59')]=util['format'](_0x9e2b('0x5a'),_0x339451[_0x9e2b('0x56')],_0x36d8ca[_0x9e2b('0x5b')],md5(_0x36d8ca[_0x9e2b('0x5b')]));}return getConnection(_0x339451)[_0x9e2b('0x2d')](function(_0x21921f){_0x42c8ea=_0x21921f;return getUser(_0x339451,_0x42c909[_0x9e2b('0xd')],_0x42c8ea);})['then'](function(_0x350df4){_0x55a88e=_0x350df4;logger[_0x9e2b('0xb')](_0x9e2b('0x5c'),_0x55a88e['id']);return getEndUser(_0x339451,_0x36d8ca['destcalleridname'],_0x36d8ca[_0x9e2b('0x6e')],_0x42c8ea);})[_0x9e2b('0x2d')](function(_0x27b968){_0x534e80=_0x27b968;logger[_0x9e2b('0xb')](_0x9e2b('0x6f'),_0x534e80['id']);return getTicket(_0x339451,_0x55a88e,_0x534e80,_0x2c1cbc,_0x36d8ca,_0x2c1cbc[_0x9e2b('0x70')],_0x42c8ea,'Outbound');})[_0x9e2b('0x2d')](function(_0x2783f2){_0x23a801=_0x2783f2;logger['info'](_0x9e2b('0x5f'));logger[_0x9e2b('0xb')]('The\x20Ticket\x20ID\x20is:',_0x23a801['id']);return setRelationship(_0x42c8ea,_0x55a88e,_0x23a801,_0x9e2b('0x71'));})[_0x9e2b('0x2d')](function(){return setRelationship(_0x42c8ea,_0x534e80,_0x23a801,_0x9e2b('0x60'));})[_0x9e2b('0x2d')](function(){return getServerInfo(_0x42c8ea);})['then'](function(_0xff04ad){var _0x20fa0e=parseInt(_0xff04ad[_0x9e2b('0x61')][_0x9e2b('0x62')](0x0));var _0x55ac19=util[_0x9e2b('0x24')](_0x9e2b('0x63'),_0x339451[_0x9e2b('0x54')],_0x23a801['id']);if(_0x20fa0e>0x6){_0x55ac19=util[_0x9e2b('0x24')](_0x9e2b('0x64'),_0x339451[_0x9e2b('0x54')],_0x23a801['id']);}logger[_0x9e2b('0xb')]('[OUTBOUND]',_0x9e2b('0x65'));emit(util['format']('user:%s',_0x42c909[_0x9e2b('0xd')]),'trigger:browser:url',{'uri':_0x55ac19});})[_0x9e2b('0x67')](function(_0x7937b7){logger['error'](_0x9e2b('0x6c'),JSON['stringify'](_0x7937b7));});};exports['unmanaged']=function(_0x4bc083,_0x3e8cc2,_0x5309f6,_0x19a5c3,_0x14cd22,_0x319cd8){var _0xc8c60c,_0x15dd98,_0x3d3ef5,_0x1131cf;_0x319cd8['remoteUri']=intUtil['stripTrailingSlash'](_0x319cd8[_0x9e2b('0x54')]);_0x319cd8[_0x9e2b('0x56')]=intUtil[_0x9e2b('0x55')](_0x319cd8['serverUrl']);def[_0x9e2b('0x69')]=util[_0x9e2b('0x24')](_0x9e2b('0x57'),_0x319cd8[_0x9e2b('0x54')]);if(_0x14cd22&&_0x14cd22[_0x9e2b('0x72')]){logger['info']('['+_0x3e8cc2[_0x9e2b('0x73')][_0x9e2b('0x74')]()+']','Recording\x20is\x20enabled!');_0x3e8cc2[_0x9e2b('0x59')]=util[_0x9e2b('0x24')](_0x9e2b('0x5a'),_0x319cd8[_0x9e2b('0x56')],_0x3e8cc2[_0x9e2b('0x5b')],md5(_0x3e8cc2['uniqueid']));}else{_0x3e8cc2[_0x9e2b('0x59')]='';}return getConnection(_0x319cd8)[_0x9e2b('0x2d')](function(_0x5bbe2e){_0x1131cf=_0x5bbe2e;if(!_[_0x9e2b('0x29')](_0x19a5c3)){return getUser(_0x319cd8,_0x19a5c3[_0x9e2b('0xd')],_0x1131cf);}else{return getUser(_0x319cd8,null,_0x1131cf);}})[_0x9e2b('0x2d')](function(_0x7fca32){_0xc8c60c=_0x7fca32;logger[_0x9e2b('0xb')](_0x9e2b('0x5c'),_0xc8c60c['id']);return getEndUser(_0x319cd8,_0x3e8cc2[_0x9e2b('0x5d')],_0x3e8cc2[_0x9e2b('0x75')],_0x1131cf);})['then'](function(_0x1c5963){_0x15dd98=_0x1c5963;logger[_0x9e2b('0xb')](_0x9e2b('0x6f'),_0x15dd98['id']);return getTicket(_0x319cd8,_0xc8c60c,_0x15dd98,_0x5309f6,_0x3e8cc2,_0x5309f6[_0x9e2b('0x70')],_0x1131cf,_0x9e2b('0x5e'));})[_0x9e2b('0x2d')](function(_0x588b1b){_0x3d3ef5=_0x588b1b;logger['info'](_0x9e2b('0x5f'));logger[_0x9e2b('0xb')](_0x9e2b('0x76'),_0x3d3ef5['id']);return setRelationship(_0x1131cf,_0xc8c60c,_0x3d3ef5,'users');})[_0x9e2b('0x2d')](function(){return setRelationship(_0x1131cf,_0x15dd98,_0x3d3ef5,_0x9e2b('0x60'));})[_0x9e2b('0x2d')](function(){return getServerInfo(_0x1131cf);})[_0x9e2b('0x67')](function(_0x5a92aa){logger[_0x9e2b('0x77')]('['+_0x3e8cc2[_0x9e2b('0x73')][_0x9e2b('0x74')]()+']',JSON[_0x9e2b('0x23')](_0x5a92aa));});}; \ 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 74a19c6..321012d 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 _0x26f5=['length','string','content','variable','variableName','push','customVariable','Variable','name','toLowerCase','toString','keyType','key','format','%s:\x20%s','keyContent','join','stripTrailingSlash','slice','substring','lodash','getString'];(function(_0x454018,_0x46e33a){var _0x24697d=function(_0x3ec647){while(--_0x3ec647){_0x454018['push'](_0x454018['shift']());}};_0x24697d(++_0x46e33a);}(_0x26f5,0x1a0));var _0x526f=function(_0xb77207,_0x377c84){_0xb77207=_0xb77207-0x0;var _0x4b80ad=_0x26f5[_0xb77207];return _0x4b80ad;};'use strict';var _=require(_0x526f('0x0'));var util=require('util');exports[_0x526f('0x1')]=function(_0x5260b8,_0x47d307,_0x44ad5d){var _0x7967b5=[];if(_0x5260b8[_0x526f('0x2')]>0x0){var _0x134421=_['sortBy'](_0x5260b8,['id']);for(var _0x3aa4d2=0x0;_0x3aa4d2<_0x134421[_0x526f('0x2')];_0x3aa4d2++){var _0x429d31=_0x134421[_0x3aa4d2];if(_0x429d31['type']===_0x526f('0x3')){_0x7967b5['push'](_0x429d31[_0x526f('0x4')]);}else if(_0x429d31['type']===_0x526f('0x5')&&_0x429d31[_0x526f('0x6')]){_0x47d307[_0x429d31[_0x526f('0x6')]]&&_0x7967b5[_0x526f('0x7')](_0x47d307[_0x429d31[_0x526f('0x6')]]['toString']());}else if(_0x429d31['type']===_0x526f('0x8')&&_0x429d31[_0x526f('0x9')]&&_0x429d31[_0x526f('0x9')][_0x526f('0xa')]){_0x47d307[_0x429d31['Variable'][_0x526f('0xa')][_0x526f('0xb')]()]&&_0x7967b5['push'](_0x47d307[_0x429d31[_0x526f('0x9')][_0x526f('0xa')][_0x526f('0xb')]()][_0x526f('0xc')]());}else if(_0x429d31['type']==='keyValue'){if(_0x429d31[_0x526f('0xd')]===_0x526f('0x3')&&_0x429d31[_0x526f('0xe')]){_0x7967b5[_0x526f('0x7')](util[_0x526f('0xf')](_0x526f('0x10'),_0x429d31['key'],_0x429d31[_0x526f('0x11')]));}else if(_0x429d31[_0x526f('0xd')]===_0x526f('0x5')&&_0x429d31[_0x526f('0x6')]&&_0x429d31[_0x526f('0xe')]){_0x47d307[_0x429d31['variableName']]&&_0x7967b5[_0x526f('0x7')](util[_0x526f('0xf')](_0x526f('0x10'),_0x429d31[_0x526f('0xe')],_0x47d307[_0x429d31['variableName']]));}else if(_0x429d31[_0x526f('0xd')]==='customVariable'&&_0x429d31['Variable']&&_0x429d31['Variable']['name']&&_0x429d31[_0x526f('0xe')]){_0x47d307[_0x429d31[_0x526f('0x9')][_0x526f('0xa')][_0x526f('0xb')]()]&&_0x7967b5[_0x526f('0x7')](util[_0x526f('0xf')](_0x526f('0x10'),_0x429d31['key'],_0x47d307[_0x429d31['Variable'][_0x526f('0xa')][_0x526f('0xb')]()]));}}}}return _0x7967b5[_0x526f('0x12')](_0x44ad5d);};exports[_0x526f('0x13')]=function(_0x1cd48d){var _0x36a9f8=_0x1cd48d[_0x526f('0x14')](-0x1);if(_0x36a9f8==='/'){_0x1cd48d=_0x1cd48d[_0x526f('0x15')](0x0,_0x1cd48d['lastIndexOf'](_0x36a9f8));}return _0x1cd48d;};exports['validateEmail']=function(_0x551a39){if(!_['isNil'](_0x551a39)&&_0x551a39!==''){var _0x351e28=/^(([^<>()\[\]\\.,;:\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 _0x351e28['test'](String(_0x551a39)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0xd6e6=['Variable','name','toLowerCase','keyValue','keyType','format','%s:\x20%s','keyContent','customVariable','key','join','substring','lastIndexOf','validateEmail','isNil','lodash','util','getString','length','sortBy','type','string','push','variable','variableName','toString'];(function(_0xab4be,_0x4ad3b6){var _0x5552d6=function(_0x29f8b7){while(--_0x29f8b7){_0xab4be['push'](_0xab4be['shift']());}};_0x5552d6(++_0x4ad3b6);}(_0xd6e6,0x113));var _0x6d6e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd6e6[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6d6e('0x0'));var util=require(_0x6d6e('0x1'));exports[_0x6d6e('0x2')]=function(_0x395e2b,_0x534d72,_0x1dbbfb){var _0x4dda98=[];if(_0x395e2b[_0x6d6e('0x3')]>0x0){var _0x4cbb7d=_[_0x6d6e('0x4')](_0x395e2b,['id']);for(var _0xad5f10=0x0;_0xad5f10<_0x4cbb7d[_0x6d6e('0x3')];_0xad5f10++){var _0x489fcb=_0x4cbb7d[_0xad5f10];if(_0x489fcb[_0x6d6e('0x5')]===_0x6d6e('0x6')){_0x4dda98[_0x6d6e('0x7')](_0x489fcb['content']);}else if(_0x489fcb[_0x6d6e('0x5')]===_0x6d6e('0x8')&&_0x489fcb[_0x6d6e('0x9')]){_0x534d72[_0x489fcb['variableName']]&&_0x4dda98[_0x6d6e('0x7')](_0x534d72[_0x489fcb['variableName']][_0x6d6e('0xa')]());}else if(_0x489fcb[_0x6d6e('0x5')]==='customVariable'&&_0x489fcb[_0x6d6e('0xb')]&&_0x489fcb['Variable']['name']){_0x534d72[_0x489fcb[_0x6d6e('0xb')][_0x6d6e('0xc')][_0x6d6e('0xd')]()]&&_0x4dda98['push'](_0x534d72[_0x489fcb[_0x6d6e('0xb')][_0x6d6e('0xc')]['toLowerCase']()][_0x6d6e('0xa')]());}else if(_0x489fcb[_0x6d6e('0x5')]===_0x6d6e('0xe')){if(_0x489fcb[_0x6d6e('0xf')]===_0x6d6e('0x6')&&_0x489fcb['key']){_0x4dda98[_0x6d6e('0x7')](util[_0x6d6e('0x10')](_0x6d6e('0x11'),_0x489fcb['key'],_0x489fcb[_0x6d6e('0x12')]));}else if(_0x489fcb[_0x6d6e('0xf')]===_0x6d6e('0x8')&&_0x489fcb[_0x6d6e('0x9')]&&_0x489fcb['key']){_0x534d72[_0x489fcb['variableName']]&&_0x4dda98['push'](util[_0x6d6e('0x10')]('%s:\x20%s',_0x489fcb['key'],_0x534d72[_0x489fcb['variableName']]));}else if(_0x489fcb[_0x6d6e('0xf')]===_0x6d6e('0x13')&&_0x489fcb[_0x6d6e('0xb')]&&_0x489fcb[_0x6d6e('0xb')][_0x6d6e('0xc')]&&_0x489fcb[_0x6d6e('0x14')]){_0x534d72[_0x489fcb[_0x6d6e('0xb')][_0x6d6e('0xc')][_0x6d6e('0xd')]()]&&_0x4dda98[_0x6d6e('0x7')](util[_0x6d6e('0x10')]('%s:\x20%s',_0x489fcb['key'],_0x534d72[_0x489fcb['Variable'][_0x6d6e('0xc')]['toLowerCase']()]));}}}}return _0x4dda98[_0x6d6e('0x15')](_0x1dbbfb);};exports['stripTrailingSlash']=function(_0x591efd){var _0x4c97da=_0x591efd['slice'](-0x1);if(_0x4c97da==='/'){_0x591efd=_0x591efd[_0x6d6e('0x16')](0x0,_0x591efd[_0x6d6e('0x17')](_0x4c97da));}return _0x591efd;};exports[_0x6d6e('0x18')]=function(_0x4542dc){if(!_[_0x6d6e('0x19')](_0x4542dc)&&_0x4542dc!==''){var _0x8b12ca=/^(([^<>()\[\]\\.,;:\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 _0x8b12ca['test'](String(_0x4542dc)[_0x6d6e('0xd')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 23e221e..586d6ab 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file +var _0x34e8=['redis','defaults','localhost','emit','length','forEach','includes','string','picklist','type','idField','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','POST','format','remoteUri','create','sessionName','HelpDesk','stringify','success','error','catch','statusCode','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','query','username','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','result','Agent\x20found!','resolve','email1','first_name','last_name','userId','[vTiger],\x20%s,\x20%s,\x20%s','getUser','admin','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!','phone','getEndUser','accessKey','getchallenge','then','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','recordingURL','email','The\x20User\x20ID\x20is:','calleridnum','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','split','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger'];(function(_0x181a59,_0x48ad57){var _0x4d374b=function(_0x566da0){while(--_0x566da0){_0x181a59['push'](_0x181a59['shift']());}};_0x4d374b(++_0x48ad57);}(_0x34e8,0x12c));var _0x834e=function(_0x362f22,_0x1424f1){_0x362f22=_0x362f22-0x0;var _0x10af1b=_0x34e8[_0x362f22];return _0x10af1b;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_[_0x834e('0xf')]([_0x834e('0x10'),_0x834e('0x11')],_0x1e41fe[_0x834e('0x12')])&&_0x1e41fe[_0x834e('0x13')]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x1e41fe['content'][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='variable'&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['variableName']][_0x834e('0x14')]();}else if(_0x1e41fe[_0x834e('0x12')]==='customVariable'&&_0x1e41fe[_0x834e('0x16')]&&_0x1e41fe['Variable'][_0x834e('0x17')]&&_0x1e41fe[_0x834e('0x13')]&&_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()]){_0x1af45a[_0x1e41fe[_0x834e('0x13')]]=_0x363786[_0x1e41fe['Variable'][_0x834e('0x17')][_0x834e('0x18')]()][_0x834e('0x14')]();}});}return _0x1af45a;}function createTicket(_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515,_0x2545b4,_0x1fd2c6){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x4ab05d=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x237947['id'],'ticketpriorities':_0x834e('0x1c'),'ticketstatus':'Open','ticket_title':intUtil[_0x834e('0x1d')](_0x1dd214[_0x834e('0x1e')],_0x595515,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x1dd214['Descriptions'],_0x595515,'\x0a'),'contact_id':_0x254677['id']},getCustomFields(_0x2545b4,_0x595515));var _0x4e3f48={'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0xb993a1[_0x834e('0x21')]),'form':{'operation':_0x834e('0x22'),'username':_0xb993a1['username'],'sessionName':_0x1fd2c6[_0x834e('0x23')],'elementType':_0x834e('0x24'),'element':JSON[_0x834e('0x25')](_0x4ab05d)},'json':!![]};return request(_0x4e3f48)['then'](function(_0x24fcf7){if(_0x24fcf7[_0x834e('0x26')]){return BPromise['resolve']({'id':_0x24fcf7['result']['id']});}else{throw new Error(util[_0x834e('0x20')]('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x25')](_0x24fcf7[_0x834e('0x27')])));}})[_0x834e('0x28')](function(_0x2cc2eb){var _0x3cd928=_0x2cc2eb[_0x834e('0x29')]||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s','createTicket',_0x3cd928,JSON['stringify'](_0x2cc2eb));});}function getUser(_0x2c7a8d,_0x567cea,_0x106d6a){if(intUtil['validateEmail'](_0x567cea)){logger[_0x834e('0x19')](_0x834e('0x2a'),_0x567cea);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x2c7a8d[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x2c7a8d[_0x834e('0x2e')],'sessionName':_0x106d6a[_0x834e('0x23')],'query':util['format'](_0x834e('0x2f'),_0x567cea)},'json':!![]})['then'](function(_0x2c75c2){if(_0x2c75c2[_0x834e('0x26')]&&_0x2c75c2[_0x834e('0x30')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x31'));return BPromise[_0x834e('0x32')]({'id':_0x2c75c2[_0x834e('0x30')][0x0]['id'],'email':_0x2c75c2[_0x834e('0x30')][0x0][_0x834e('0x33')],'name':_0x2c75c2['result'][0x0][_0x834e('0x34')]+'\x20'+_0x2c75c2[_0x834e('0x30')][_0x834e('0x35')]});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':'admin'});}})['catch'](function(_0x3e58fa){var _0x41bf4d=_0x3e58fa[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x41bf4d,JSON['stringify'](_0x3e58fa));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x32')]({'id':_0x106d6a[_0x834e('0x36')],'email':_0x2c7a8d['username'],'name':_0x834e('0x39')})[_0x834e('0x28')](function(_0x491c28){var _0x481f70=_0x491c28[_0x834e('0x29')]||0x1f4;logger[_0x834e('0x27')](_0x834e('0x37'),_0x834e('0x38'),_0x481f70,JSON[_0x834e('0x25')](_0x491c28));});}}function getEndUser(_0x4ca43c,_0x1c5ed6,_0x548d1d,_0x50c243){logger[_0x834e('0x19')]('Searching\x20end\x20user\x20with\x20phone',_0x548d1d);return request({'method':_0x834e('0x2b'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x4ca43c[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x2d'),'username':_0x4ca43c['username'],'sessionName':_0x50c243[_0x834e('0x23')],'query':util[_0x834e('0x20')](_0x834e('0x3a'),_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d,_0x548d1d)},'json':!![]})['then'](function(_0x35380e){if(_0x35380e[_0x834e('0x26')]&&_0x35380e['result'][_0x834e('0xd')]){logger['info'](_0x834e('0x3b'));return BPromise[_0x834e('0x32')]({'id':_0x35380e['result'][0x0]['id'],'name':_0x35380e['result'][0x0][_0x834e('0x3c')]+'\x20'+_0x35380e[_0x834e('0x30')][0x0][_0x834e('0x3d')],'phone':_0x548d1d});}else{logger[_0x834e('0x19')](_0x834e('0x3e'));return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')]('%s/webservice.php',_0x4ca43c[_0x834e('0x21')]),'form':{'operation':'create','sessionName':_0x50c243[_0x834e('0x23')],'elementType':'Contacts','element':JSON[_0x834e('0x25')]({'lastname':_0x1c5ed6,'phone':_0x548d1d,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x361f60){logger[_0x834e('0x19')]('Enduser\x20created.');return BPromise[_0x834e('0x32')]({'id':_0x361f60[_0x834e('0x30')]['id'],'name':_0x361f60[_0x834e('0x30')][_0x834e('0x3d')],'phone':_0x361f60[_0x834e('0x30')][_0x834e('0x3f')]});})[_0x834e('0x28')](function(_0x3ccd8e){var _0x5dc63b=_0x3ccd8e[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x40'),_0x5dc63b,JSON['stringify'](_0x3ccd8e));});}});}function getConnection(_0x112306){var _0x42fd90=_0x112306[_0x834e('0x2e')];var _0x2112d5=_0x112306[_0x834e('0x41')];return request({'method':_0x834e('0x2b'),'uri':util['format']('%s/webservice.php',_0x112306[_0x834e('0x21')]),'qs':{'operation':_0x834e('0x42'),'username':_0x42fd90},'json':!![]})[_0x834e('0x43')](function(_0x40ff5a){if(_0x40ff5a[_0x834e('0x26')]){return request({'method':_0x834e('0x1f'),'uri':util[_0x834e('0x20')](_0x834e('0x2c'),_0x112306[_0x834e('0x21')]),'form':{'operation':_0x834e('0x44'),'username':_0x42fd90,'accessKey':md5(_0x40ff5a[_0x834e('0x30')][_0x834e('0x45')]+_0x2112d5)},'json':!![]});}})[_0x834e('0x43')](function(_0x1a3237){if(_0x1a3237[_0x834e('0x26')]){return BPromise[_0x834e('0x32')](_0x1a3237[_0x834e('0x30')]);}else{throw new Error(util[_0x834e('0x20')](_0x834e('0x46'),_0x112306['id']));}})[_0x834e('0x28')](function(_0x4cfacd){var _0x1cc0b8=_0x4cfacd[_0x834e('0x29')]||0x1f4;logger['error'](_0x834e('0x37'),_0x834e('0x47'),_0x1cc0b8,JSON['stringify'](_0x4cfacd));});}function request(_0x3dcca3){logger[_0x834e('0x19')](_0x834e('0x48'),JSON[_0x834e('0x25')](_0x3dcca3));return rp(_0x3dcca3);}exports[_0x834e('0x49')]=function(_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe,_0x8bc6c6,_0x3e0550){var _0x363675,_0x86ad2b,_0x396bbe,_0x344b51;_0x3e0550[_0x834e('0x21')]=intUtil['stripTrailingSlash'](_0x3e0550[_0x834e('0x21')]);if(_0x8bc6c6&&_0x8bc6c6['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4a'));_0x4549ba['recordingURL']=util['format'](_0x834e('0x4b'),_0x3e0550[_0x834e('0x4c')],_0x4549ba['uniqueid'],md5(_0x4549ba['uniqueid']));}else{_0x4549ba[_0x834e('0x4d')]='';}return getConnection(_0x3e0550)[_0x834e('0x43')](function(_0x138ed2){_0x344b51=_0x138ed2;return getUser(_0x3e0550,_0x1ad7fe[_0x834e('0x4e')],_0x344b51);})[_0x834e('0x43')](function(_0x315858){_0x363675=_0x315858;logger[_0x834e('0x19')](_0x834e('0x4f'),_0x363675['id']);return getEndUser(_0x3e0550,_0x4549ba['calleridname'],_0x4549ba[_0x834e('0x50')],_0x344b51);})[_0x834e('0x43')](function(_0x5d5ac2){_0x86ad2b=_0x5d5ac2;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x86ad2b['id']);return createTicket(_0x3e0550,_0x363675,_0x86ad2b,_0x4a8b32,_0x4549ba,_0x4a8b32[_0x834e('0x51')],_0x344b51);})[_0x834e('0x43')](function(_0x5160c4){_0x396bbe=_0x5160c4;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x396bbe['id']);var _0x5a2924=util[_0x834e('0x20')](_0x834e('0x54'),_0x3e0550[_0x834e('0x21')],_['split'](_0x396bbe['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x55'),_0x834e('0x56'));emit(util[_0x834e('0x20')](_0x834e('0x57'),_0x1ad7fe[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5a2924});})[_0x834e('0x28')](function(_0x208c21){logger[_0x834e('0x27')](_0x834e('0x55'),JSON[_0x834e('0x25')](_0x208c21));});};exports[_0x834e('0x59')]=function(_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83,_0x193a15,_0x3e3467){var _0xed4081,_0x2cb233,_0x5c83eb,_0x2145cf;_0x193a15[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x193a15[_0x834e('0x21')]);_0x193a15['serverUrl']=intUtil[_0x834e('0x5a')](_0x193a15['serverUrl']);if(_0x3e3467&&_0x3e3467['recordingFormat']&&_0x3e3467[_0x834e('0x5b')]!==_0x834e('0x5c')){logger[_0x834e('0x19')](_0x834e('0x5d'),_0x834e('0x4a'));_0x460a7a[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x193a15['serverUrl'],_0x460a7a[_0x834e('0x5e')],md5(_0x460a7a['uniqueid']));}return getConnection(_0x193a15)[_0x834e('0x43')](function(_0xd35dda){_0x2145cf=_0xd35dda;return getUser(_0x193a15,_0x297cce['email'],_0x2145cf);})['then'](function(_0x4a4def){_0xed4081=_0x4a4def;logger[_0x834e('0x19')](_0x834e('0x4f'),_0xed4081['id']);return getEndUser(_0x193a15,_0x460a7a[_0x834e('0x5f')],_0x460a7a[_0x834e('0x60')],_0x2145cf);})['then'](function(_0x2b0d93){_0x2cb233=_0x2b0d93;logger[_0x834e('0x19')](_0x834e('0x61'),_0x2cb233['id']);return createTicket(_0x193a15,_0xed4081,_0x2cb233,_0x17b8e3,_0x460a7a,_0x17b8e3[_0x834e('0x51')],_0x2145cf);})[_0x834e('0x43')](function(_0x28b5c9){_0x5c83eb=_0x28b5c9;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')](_0x834e('0x53'),_0x5c83eb['id']);var _0x5b2bf6=util[_0x834e('0x20')](_0x834e('0x54'),_0x193a15[_0x834e('0x21')],_[_0x834e('0x62')](_0x5c83eb['id'],'x')[0x1]);logger['info'](_0x834e('0x5d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x297cce[_0x834e('0x17')]),_0x834e('0x58'),{'uri':_0x5b2bf6});})['catch'](function(_0x2645df){logger[_0x834e('0x27')]('[OUTBOUND]',JSON[_0x834e('0x25')](_0x2645df));});};exports[_0x834e('0x63')]=function(_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3,_0x8bc7d9,_0x44c909){var _0x1d8e7,_0x493239,_0x264a6f,_0x520367;_0x44c909[_0x834e('0x21')]=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x21')]);_0x44c909['serverUrl']=intUtil[_0x834e('0x5a')](_0x44c909[_0x834e('0x4c')]);if(_0x8bc7d9&&_0x8bc7d9['monitor_format']){logger[_0x834e('0x19')]('['+_0x5df169[_0x834e('0x64')][_0x834e('0x65')]()+']','Recording\x20is\x20enabled!');_0x5df169[_0x834e('0x4d')]=util[_0x834e('0x20')](_0x834e('0x4b'),_0x44c909[_0x834e('0x4c')],_0x5df169[_0x834e('0x5e')],md5(_0x5df169[_0x834e('0x5e')]));}else{_0x5df169[_0x834e('0x4d')]='';}return getConnection(_0x44c909)[_0x834e('0x43')](function(_0xd49002){_0x520367=_0xd49002;return getUser(_0x44c909,'',_0x520367);})[_0x834e('0x43')](function(_0x57d898){_0x1d8e7=_0x57d898;logger['info']('The\x20User\x20ID\x20is:',_0x1d8e7['id']);return getEndUser(_0x44c909,_0x5df169[_0x834e('0x66')],_0x5df169[_0x834e('0x50')],_0x520367);})[_0x834e('0x43')](function(_0x37fa2c){_0x493239=_0x37fa2c;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x493239['id']);return createTicket(_0x44c909,_0x1d8e7,_0x493239,_0x346be5,_0x5df169,_0x346be5['Fields'],_0x520367);})[_0x834e('0x43')](function(_0x1ad428){_0x264a6f=_0x1ad428;logger[_0x834e('0x19')](_0x834e('0x52'));logger[_0x834e('0x19')]('The\x20Ticket\x20ID\x20is:',_0x264a6f['id']);})[_0x834e('0x28')](function(_0x2b162a){logger[_0x834e('0x27')]('['+_0x5df169['lastevent'][_0x834e('0x65')]()+']',JSON[_0x834e('0x25')](_0x2b162a));});}; \ 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 d9e98bf..e208461 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 _0xb3df=['customField','custom_fields','push','content','variableName','idField','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','email','destcalleridname','destcalleridnum','integrationTab','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','toUpperCase','lastevent','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','format','%s/tickets.json','POST','Tags','name','getString','Subjects','Descriptions','then','Ticket\x20created!','ticket','validateEmail','info','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','results','agent','%s/users/me.json','remoteUri','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','[HTTP]','map','forEach','includes','string','picklist','type'];(function(_0x45c62a,_0x3a9be8){var _0x2f11cd=function(_0x14b14b){while(--_0x14b14b){_0x45c62a['push'](_0x45c62a['shift']());}};_0x2f11cd(++_0x3a9be8);}(_0xb3df,0x18c));var _0xfb3d=function(_0x18e540,_0x34c916){_0x18e540=_0x18e540-0x0;var _0x205baa=_0xb3df[_0x18e540];return _0x205baa;};'use strict';var _=require(_0xfb3d('0x0'));var rp=require(_0xfb3d('0x1'));var md5=require('md5');var util=require(_0xfb3d('0x2'));var Redis=require(_0xfb3d('0x3'));var intUtil=require(_0xfb3d('0x4'));var config=require(_0xfb3d('0x5'));var logger=require(_0xfb3d('0x6'))(_0xfb3d('0x7'));config[_0xfb3d('0x8')]=_[_0xfb3d('0x9')](config['redis'],{'host':_0xfb3d('0xa'),'port':0x18eb});var io=require(_0xfb3d('0xb'))(new Redis(config[_0xfb3d('0x8')]));function emit(_0xb1721d,_0x457814,_0xa5524c){io['to'](_0xb1721d)[_0xfb3d('0xc')](_0x457814,_0xa5524c);}var headers={'Content-Type':_0xfb3d('0xd'),'Accept':_0xfb3d('0xd')};function getTicket(_0x3c6e86,_0x4d190e,_0x3725bd,_0x2ddd58,_0x524576){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util[_0xfb3d('0xe')](_0xfb3d('0xf'),_0x3c6e86['remoteUri']),'method':_0xfb3d('0x10'),'body':{'ticket':_['merge']({'requester_id':_0x3725bd['id'],'submitter_id':_0x4d190e?_0x4d190e['id']:undefined,'assignee_id':_0x4d190e?_0x4d190e['id']:undefined,'tags':getTags(_0x2ddd58[_0xfb3d('0x11')],_0xfb3d('0x12')),'subject':intUtil[_0xfb3d('0x13')](_0x2ddd58[_0xfb3d('0x14')],_0x524576,'\x20'),'description':intUtil[_0xfb3d('0x13')](_0x2ddd58['Descriptions'],_0x524576,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x2ddd58[_0xfb3d('0x15')],_0x524576,'\x0a')}},getCustomFields(_0x2ddd58['Fields'],_0x524576))}})[_0xfb3d('0x16')](function(_0x11364d){logger['info'](_0xfb3d('0x17'));return _0x11364d[_0xfb3d('0x18')];});}function getUser(_0x5c24f0,_0x4fabb4){if(intUtil[_0xfb3d('0x19')](_0x4fabb4)){logger[_0xfb3d('0x1a')](_0xfb3d('0x1b'),_0x4fabb4);return request({'uri':util[_0xfb3d('0xe')](_0xfb3d('0x1c'),_0x5c24f0['remoteUri']),'qs':{'query':util[_0xfb3d('0xe')](_0xfb3d('0x1d'),_0x4fabb4)}})[_0xfb3d('0x16')](function(_0x3c649c){if(_0x3c649c[_0xfb3d('0x1e')]){logger[_0xfb3d('0x1a')]('Agent\x20found!');return _['find'](_0x3c649c[_0xfb3d('0x1f')],{'email':_0x4fabb4,'role':_0xfb3d('0x20')});}else{logger[_0xfb3d('0x1a')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xfb3d('0xe')](_0xfb3d('0x21'),_0x5c24f0[_0xfb3d('0x22')])})[_0xfb3d('0x16')](function(_0x362968){logger[_0xfb3d('0x1a')](_0xfb3d('0x23'));return _0x362968[_0xfb3d('0x24')];});}});}else{logger[_0xfb3d('0x1a')](_0xfb3d('0x25'));return request({'uri':util[_0xfb3d('0xe')](_0xfb3d('0x21'),_0x5c24f0[_0xfb3d('0x22')])})[_0xfb3d('0x16')](function(_0x167abf){logger[_0xfb3d('0x1a')](_0xfb3d('0x23'));return _0x167abf[_0xfb3d('0x24')];});}}function getEndUser(_0x2a2388,_0xd4c442,_0x2deaec){logger[_0xfb3d('0x1a')]('Searching\x20enduser\x20with\x20phone',_0x2deaec);return request({'uri':util['format'](_0xfb3d('0x1c'),_0x2a2388[_0xfb3d('0x22')]),'qs':{'query':util['format'](_0xfb3d('0x26'),_0x2deaec)}})[_0xfb3d('0x16')](function(_0x3becfc){var _0x23646d;if(_0x3becfc['results'][_0xfb3d('0x27')]){_0x3becfc[_0xfb3d('0x1f')]=_[_0xfb3d('0x28')](_0x3becfc[_0xfb3d('0x1f')],{'suspended':![],'role':_0xfb3d('0x29')});if(_0x3becfc['results'][_0xfb3d('0x27')]){_0x23646d=_[_0xfb3d('0x2a')](_0x3becfc[_0xfb3d('0x1f')]);}}if(_0x23646d){logger[_0xfb3d('0x1a')](_0xfb3d('0x2b'));return _0x23646d;}else{logger[_0xfb3d('0x1a')](_0xfb3d('0x2c'));return request({'uri':util[_0xfb3d('0xe')](_0xfb3d('0x2d'),_0x2a2388['remoteUri']),'method':_0xfb3d('0x10'),'body':{'user':{'role':_0xfb3d('0x29'),'name':util['format'](_0xfb3d('0x2e'),_0xd4c442||_0x2deaec),'phone':_0x2deaec}}})[_0xfb3d('0x16')](function(_0x17ea2c){logger[_0xfb3d('0x1a')](_0xfb3d('0x2f'));return _0x17ea2c[_0xfb3d('0x24')];});}});}function getAuth(_0x41cd16){var _0xe2f291;if(_0x41cd16[_0xfb3d('0x30')]===_0xfb3d('0x31')){_0xe2f291=util[_0xfb3d('0xe')](_0xfb3d('0x32'),_0x41cd16[_0xfb3d('0x33')],_0x41cd16[_0xfb3d('0x31')]);}else if(_0x41cd16[_0xfb3d('0x30')]===_0xfb3d('0x34')){_0xe2f291=util[_0xfb3d('0xe')](_0xfb3d('0x35'),_0x41cd16[_0xfb3d('0x33')],_0x41cd16[_0xfb3d('0x34')]);}return util[_0xfb3d('0xe')](_0xfb3d('0x36'),new Buffer(_0xe2f291)[_0xfb3d('0x37')](_0xfb3d('0x38')));}function request(_0x809922){logger['debug'](_0xfb3d('0x39'),JSON['stringify'](_0x809922));return rp(_['defaults'](_0x809922,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x23f910,_0x499b3b){var _0x5452b7=[];if(_0x23f910&&_0x23f910[_0xfb3d('0x27')]>0x0){_0x5452b7=_[_0xfb3d('0x3a')](_0x23f910,_0x499b3b);}return _0x5452b7;}function getCustomFields(_0x3cb758,_0x4e99c3){var _0x2a6119=[];var _0x388277={'custom_fields':[]};if(_0x3cb758[_0xfb3d('0x27')]>0x0){_[_0xfb3d('0x3b')](_0x3cb758,function(_0x59f054){if(_[_0xfb3d('0x3c')]([_0xfb3d('0x3d'),_0xfb3d('0x3e')],_0x59f054[_0xfb3d('0x3f')])&&_0x59f054['nameField']&&!_0x59f054[_0xfb3d('0x40')]){_0x388277[_0x59f054['nameField']['toLowerCase']()]=_0x59f054['content'][_0xfb3d('0x37')]();}else if(_[_0xfb3d('0x3c')]([_0xfb3d('0x3d'),_0xfb3d('0x3e')],_0x59f054[_0xfb3d('0x3f')])&&_0x59f054['idField']&&_0x59f054['customField']){_0x388277[_0xfb3d('0x41')][_0xfb3d('0x42')]({'id':_0x59f054['idField'],'value':_0x59f054[_0xfb3d('0x43')][_0xfb3d('0x37')]()});}else if(_0x59f054[_0xfb3d('0x3f')]==='variable'&&_0x59f054[_0xfb3d('0x44')]&&_0x59f054[_0xfb3d('0x45')]&&_0x59f054[_0xfb3d('0x40')]){_0x4e99c3[_0x59f054['variableName']]&&_0x388277[_0xfb3d('0x41')]['push']({'id':_0x59f054[_0xfb3d('0x45')],'value':_0x4e99c3[_0x59f054['variableName']]['toString']()});}else if(_0x59f054['type']===_0xfb3d('0x46')&&_0x59f054[_0xfb3d('0x47')]&&_0x59f054[_0xfb3d('0x47')]['name']&&_0x59f054[_0xfb3d('0x45')]&&_0x59f054['customField']){_0x4e99c3[_0x59f054['Variable'][_0xfb3d('0x12')]['toLowerCase']()]&&_0x388277['custom_fields'][_0xfb3d('0x42')]({'id':_0x59f054['idField'],'value':_0x4e99c3[_0x59f054[_0xfb3d('0x47')]['name'][_0xfb3d('0x48')]()][_0xfb3d('0x37')]()});}});}return _0x388277;}exports[_0xfb3d('0x49')]=function(_0x2c434f,_0x8ff9d6,_0x2d0360,_0x40036a,_0x167975,_0x1f0766){var _0x2f4f5d,_0x4887ff;_0x1f0766['remoteUri']=intUtil[_0xfb3d('0x4a')](_0x1f0766[_0xfb3d('0x22')]);_0x1f0766[_0xfb3d('0x4b')]=intUtil['stripTrailingSlash'](_0x1f0766['serverUrl']);if(_0x167975&&_0x167975[_0xfb3d('0x4c')]){logger['info'](_0xfb3d('0x4d'),'Recording\x20is\x20enabled!');_0x8ff9d6[_0xfb3d('0x4e')]=util[_0xfb3d('0xe')](_0xfb3d('0x4f'),_0x1f0766['serverUrl'],_0x8ff9d6[_0xfb3d('0x50')],md5(_0x8ff9d6[_0xfb3d('0x50')]));}else{_0x8ff9d6[_0xfb3d('0x4e')]='';}headers[_0xfb3d('0x51')]=getAuth(_0x1f0766);return getUser(_0x1f0766,_0x40036a['email'])['then'](function(_0x35c717){_0x2f4f5d=_0x35c717;logger['info'](_0xfb3d('0x52'),_0x2f4f5d['id']);return getEndUser(_0x1f0766,_0x8ff9d6[_0xfb3d('0x53')],_0x8ff9d6[_0xfb3d('0x54')]);})['then'](function(_0x4bc69d){_0x4887ff=_0x4bc69d;logger['info'](_0xfb3d('0x55'),_0x4887ff['id']);return getTicket(_0x1f0766,_0x2f4f5d,_0x4887ff,_0x2d0360,_0x8ff9d6);})[_0xfb3d('0x16')](function(_0x2b6cb3){if(_0x2b6cb3){logger[_0xfb3d('0x1a')](_0xfb3d('0x56'),_0x2b6cb3['id']);switch(_0x1f0766[_0xfb3d('0x3f')]){case'integrationTab':logger[_0xfb3d('0x1a')](_0xfb3d('0x4d'),_0xfb3d('0x57'));return request({'uri':util[_0xfb3d('0xe')](_0xfb3d('0x58'),_0x1f0766[_0xfb3d('0x22')],_0x2f4f5d['id'],_0x2b6cb3['id']),'method':_0xfb3d('0x10')});case _0xfb3d('0x59'):logger[_0xfb3d('0x1a')]('[QUEUE]',_0xfb3d('0x5a'));emit(util[_0xfb3d('0xe')](_0xfb3d('0x5b'),_0x40036a[_0xfb3d('0x12')]),_0xfb3d('0x5c'),{'uri':util['format'](_0xfb3d('0x5d'),_0x1f0766[_0xfb3d('0x22')][_0xfb3d('0x5e')](_0xfb3d('0x5f'),''),_0x2b6cb3['id'])});break;default:logger[_0xfb3d('0x60')](_0xfb3d('0x4d'),_0xfb3d('0x61'));}}})[_0xfb3d('0x62')](function(_0x26ae75){logger['error'](_0xfb3d('0x63'),util['inspect'](_0x26ae75,{'showHidden':!![],'depth':null}));});};exports[_0xfb3d('0x64')]=function(_0x3ad19d,_0x2d59dc,_0x40d2f4,_0x29a664,_0x1d06c7,_0x1eae67,_0x37be39){var _0x1b09f3,_0x544fda;_0x1eae67[_0xfb3d('0x22')]=intUtil[_0xfb3d('0x4a')](_0x1eae67[_0xfb3d('0x22')]);_0x1eae67[_0xfb3d('0x4b')]=intUtil[_0xfb3d('0x4a')](_0x1eae67['serverUrl']);if(_0x37be39&&_0x37be39[_0xfb3d('0x65')]&&_0x37be39['recordingFormat']!==_0xfb3d('0x66')){logger[_0xfb3d('0x1a')](_0xfb3d('0x67'),_0xfb3d('0x68'));_0x2d59dc[_0xfb3d('0x4e')]=util[_0xfb3d('0xe')](_0xfb3d('0x4f'),_0x1eae67[_0xfb3d('0x4b')],_0x2d59dc[_0xfb3d('0x50')],md5(_0x2d59dc[_0xfb3d('0x50')]));}headers['Authorization']=getAuth(_0x1eae67);return getUser(_0x1eae67,_0x29a664[_0xfb3d('0x69')])[_0xfb3d('0x16')](function(_0x570d73){_0x1b09f3=_0x570d73;logger['info']('The\x20User\x20ID\x20is:',_0x1b09f3['id']);return getEndUser(_0x1eae67,_0x2d59dc[_0xfb3d('0x6a')],_0x2d59dc[_0xfb3d('0x6b')]);})['then'](function(_0x480884){_0x544fda=_0x480884;logger[_0xfb3d('0x1a')]('The\x20Enduser\x20ID\x20is:',_0x544fda['id']);return getTicket(_0x1eae67,_0x1b09f3,_0x544fda,_0x40d2f4,_0x2d59dc);})[_0xfb3d('0x16')](function(_0x2febe6){if(_0x2febe6){logger[_0xfb3d('0x1a')](_0xfb3d('0x56'),_0x2febe6['id']);switch(_0x1eae67['type']){case _0xfb3d('0x6c'):logger[_0xfb3d('0x1a')](_0xfb3d('0x67'),_0xfb3d('0x57'));return request({'uri':util[_0xfb3d('0xe')](_0xfb3d('0x58'),_0x1eae67[_0xfb3d('0x22')],_0x1b09f3['id'],_0x2febe6['id']),'method':_0xfb3d('0x10')});case _0xfb3d('0x59'):logger['info'](_0xfb3d('0x67'),_0xfb3d('0x5a'));emit(util[_0xfb3d('0xe')](_0xfb3d('0x5b'),_0x29a664[_0xfb3d('0x12')]),_0xfb3d('0x5c'),{'uri':util[_0xfb3d('0xe')]('%s/agent/tickets/%s',_0x1eae67[_0xfb3d('0x22')][_0xfb3d('0x5e')](_0xfb3d('0x5f'),''),_0x2febe6['id'])});break;default:logger[_0xfb3d('0x60')]('[OUTBOUND]',_0xfb3d('0x61'));}}})[_0xfb3d('0x62')](function(_0x42713d){logger[_0xfb3d('0x60')](_0xfb3d('0x6d'),util[_0xfb3d('0x6e')](_0x42713d,{'showHidden':!![],'depth':null}));});};exports[_0xfb3d('0x6f')]=function(_0x2821d5,_0x1866ef,_0x56fc07,_0x1d912b,_0x24440b,_0x1950e8){var _0x14504f,_0x1f7947;_0x1950e8[_0xfb3d('0x22')]=intUtil[_0xfb3d('0x4a')](_0x1950e8['remoteUri']);_0x1950e8['serverUrl']=intUtil[_0xfb3d('0x4a')](_0x1950e8['serverUrl']);if(_0x24440b&&_0x24440b[_0xfb3d('0x4c')]){logger[_0xfb3d('0x1a')]('['+_0x1866ef['lastevent'][_0xfb3d('0x70')]()+']',_0xfb3d('0x68'));_0x1866ef[_0xfb3d('0x4e')]=util[_0xfb3d('0xe')](_0xfb3d('0x4f'),_0x1950e8[_0xfb3d('0x4b')],_0x1866ef[_0xfb3d('0x50')],md5(_0x1866ef[_0xfb3d('0x50')]));}else{_0x1866ef[_0xfb3d('0x4e')]='';}headers[_0xfb3d('0x51')]=getAuth(_0x1950e8);return getUser(_0x1950e8)['then'](function(_0x52768c){_0x14504f=_0x52768c;logger[_0xfb3d('0x1a')](_0xfb3d('0x52'),_0x14504f['id']);return getEndUser(_0x1950e8,_0x1866ef[_0xfb3d('0x53')],_0x1866ef['calleridnum']);})[_0xfb3d('0x16')](function(_0x3c62b3){_0x1f7947=_0x3c62b3;logger[_0xfb3d('0x1a')]('The\x20Enduser\x20ID\x20is:',_0x1f7947['id']);return getTicket(_0x1950e8,_0x14504f,_0x1f7947,_0x56fc07,_0x1866ef);})['then'](function(_0x4e465d){if(_0x4e465d){logger[_0xfb3d('0x1a')](_0xfb3d('0x56'),_0x4e465d['id']);}})[_0xfb3d('0x62')](function(_0x45aa0a){logger['error']('['+_0x1866ef[_0xfb3d('0x71')][_0xfb3d('0x70')]()+']'+_0xfb3d('0x72'),util[_0xfb3d('0x6e')](_0x45aa0a,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x203b=['nameField','toLowerCase','content','toString','string','idField','customField','push','variable','variableName','custom_fields','Variable','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','destcalleridname','destcalleridnum','[OUTBOUND]','user:%s','trigger:browser:url','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','toUpperCase','lastevent','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','./util','../../../../config/logger','zendesk','redis','defaults','localhost','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Fields','Ticket\x20created!','ticket','validateEmail','%s/search.json','type:user\x20role:agent\x20email:%s','then','count','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','results','length','filter','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','authType','password','%s:%s','username','%s/token:%s','token','Basic\x20%s','base64','debug','[HTTP]','GET','map','forEach','includes','picklist','type'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x203b,0xa5));var _0xb203=function(_0x3fbd72,_0x4efc9a){_0x3fbd72=_0x3fbd72-0x0;var _0x2fcdc5=_0x203b[_0x3fbd72];return _0x2fcdc5;};'use strict';var _=require(_0xb203('0x0'));var rp=require(_0xb203('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xb203('0x2'));var config=require('../../../../config/environment');var logger=require(_0xb203('0x3'))(_0xb203('0x4'));config[_0xb203('0x5')]=_[_0xb203('0x6')](config['redis'],{'host':_0xb203('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x4bf360,_0x5d7864,_0x3695e1){io['to'](_0x4bf360)[_0xb203('0x8')](_0x5d7864,_0x3695e1);}var headers={'Content-Type':'application/json','Accept':_0xb203('0x9')};function getTicket(_0xa676f7,_0x52c4de,_0x4b738a,_0x5229f3,_0x23e554){logger[_0xb203('0xa')](_0xb203('0xb'));return request({'uri':util[_0xb203('0xc')](_0xb203('0xd'),_0xa676f7[_0xb203('0xe')]),'method':_0xb203('0xf'),'body':{'ticket':_[_0xb203('0x10')]({'requester_id':_0x4b738a['id'],'submitter_id':_0x52c4de?_0x52c4de['id']:undefined,'assignee_id':_0x52c4de?_0x52c4de['id']:undefined,'tags':getTags(_0x5229f3[_0xb203('0x11')],_0xb203('0x12')),'subject':intUtil[_0xb203('0x13')](_0x5229f3[_0xb203('0x14')],_0x23e554,'\x20'),'description':intUtil['getString'](_0x5229f3['Descriptions'],_0x23e554,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x5229f3['Descriptions'],_0x23e554,'\x0a')}},getCustomFields(_0x5229f3[_0xb203('0x15')],_0x23e554))}})['then'](function(_0x25ef57){logger['info'](_0xb203('0x16'));return _0x25ef57[_0xb203('0x17')];});}function getUser(_0x5ad9dd,_0x234d9c){if(intUtil[_0xb203('0x18')](_0x234d9c)){logger['info']('Getting\x20agent\x20with\x20email',_0x234d9c);return request({'uri':util['format'](_0xb203('0x19'),_0x5ad9dd[_0xb203('0xe')]),'qs':{'query':util[_0xb203('0xc')](_0xb203('0x1a'),_0x234d9c)}})[_0xb203('0x1b')](function(_0x99a7ac){if(_0x99a7ac[_0xb203('0x1c')]){logger[_0xb203('0xa')]('Agent\x20found!');return _[_0xb203('0x1d')](_0x99a7ac['results'],{'email':_0x234d9c,'role':'agent'});}else{logger['info'](_0xb203('0x1e'));return request({'uri':util['format'](_0xb203('0x1f'),_0x5ad9dd[_0xb203('0xe')])})[_0xb203('0x1b')](function(_0x575795){logger['info'](_0xb203('0x20'));return _0x575795[_0xb203('0x21')];});}});}else{logger[_0xb203('0xa')](_0xb203('0x1e'));return request({'uri':util[_0xb203('0xc')](_0xb203('0x1f'),_0x5ad9dd[_0xb203('0xe')])})['then'](function(_0x102acb){logger[_0xb203('0xa')](_0xb203('0x20'));return _0x102acb[_0xb203('0x21')];});}}function getEndUser(_0x5a6f60,_0x274827,_0x2df22f){logger[_0xb203('0xa')](_0xb203('0x22'),_0x2df22f);return request({'uri':util[_0xb203('0xc')]('%s/search.json',_0x5a6f60[_0xb203('0xe')]),'qs':{'query':util[_0xb203('0xc')]('type:user\x20role:end-user\x20phone:%s',_0x2df22f)}})[_0xb203('0x1b')](function(_0x3b4919){var _0x5aac1f;if(_0x3b4919[_0xb203('0x23')][_0xb203('0x24')]){_0x3b4919[_0xb203('0x23')]=_[_0xb203('0x25')](_0x3b4919['results'],{'suspended':![],'role':_0xb203('0x26')});if(_0x3b4919[_0xb203('0x23')]['length']){_0x5aac1f=_['first'](_0x3b4919[_0xb203('0x23')]);}}if(_0x5aac1f){logger['info'](_0xb203('0x27'));return _0x5aac1f;}else{logger[_0xb203('0xa')](_0xb203('0x28'));return request({'uri':util[_0xb203('0xc')](_0xb203('0x29'),_0x5a6f60[_0xb203('0xe')]),'method':'POST','body':{'user':{'role':_0xb203('0x26'),'name':util['format'](_0xb203('0x2a'),_0x274827||_0x2df22f),'phone':_0x2df22f}}})[_0xb203('0x1b')](function(_0x2b6767){logger[_0xb203('0xa')]('Enduser\x20created.');return _0x2b6767[_0xb203('0x21')];});}});}function getAuth(_0x24c714){var _0x47cf9e;if(_0x24c714[_0xb203('0x2b')]===_0xb203('0x2c')){_0x47cf9e=util[_0xb203('0xc')](_0xb203('0x2d'),_0x24c714[_0xb203('0x2e')],_0x24c714[_0xb203('0x2c')]);}else if(_0x24c714[_0xb203('0x2b')]==='token'){_0x47cf9e=util[_0xb203('0xc')](_0xb203('0x2f'),_0x24c714[_0xb203('0x2e')],_0x24c714[_0xb203('0x30')]);}return util[_0xb203('0xc')](_0xb203('0x31'),new Buffer(_0x47cf9e)['toString'](_0xb203('0x32')));}function request(_0x61449e){logger[_0xb203('0x33')](_0xb203('0x34'),JSON['stringify'](_0x61449e));return rp(_[_0xb203('0x6')](_0x61449e,{'method':_0xb203('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x4247fb,_0x2c2efe){var _0x250c9d=[];if(_0x4247fb&&_0x4247fb[_0xb203('0x24')]>0x0){_0x250c9d=_[_0xb203('0x36')](_0x4247fb,_0x2c2efe);}return _0x250c9d;}function getCustomFields(_0x587dab,_0x4bd088){var _0x42a654=[];var _0x113444={'custom_fields':[]};if(_0x587dab[_0xb203('0x24')]>0x0){_[_0xb203('0x37')](_0x587dab,function(_0x2518df){if(_[_0xb203('0x38')](['string',_0xb203('0x39')],_0x2518df[_0xb203('0x3a')])&&_0x2518df[_0xb203('0x3b')]&&!_0x2518df['customField']){_0x113444[_0x2518df[_0xb203('0x3b')][_0xb203('0x3c')]()]=_0x2518df[_0xb203('0x3d')][_0xb203('0x3e')]();}else if(_[_0xb203('0x38')]([_0xb203('0x3f'),_0xb203('0x39')],_0x2518df['type'])&&_0x2518df[_0xb203('0x40')]&&_0x2518df[_0xb203('0x41')]){_0x113444['custom_fields'][_0xb203('0x42')]({'id':_0x2518df[_0xb203('0x40')],'value':_0x2518df[_0xb203('0x3d')][_0xb203('0x3e')]()});}else if(_0x2518df[_0xb203('0x3a')]===_0xb203('0x43')&&_0x2518df[_0xb203('0x44')]&&_0x2518df[_0xb203('0x40')]&&_0x2518df[_0xb203('0x41')]){_0x4bd088[_0x2518df['variableName']]&&_0x113444[_0xb203('0x45')][_0xb203('0x42')]({'id':_0x2518df[_0xb203('0x40')],'value':_0x4bd088[_0x2518df['variableName']][_0xb203('0x3e')]()});}else if(_0x2518df[_0xb203('0x3a')]==='customVariable'&&_0x2518df[_0xb203('0x46')]&&_0x2518df['Variable'][_0xb203('0x12')]&&_0x2518df[_0xb203('0x40')]&&_0x2518df[_0xb203('0x41')]){_0x4bd088[_0x2518df[_0xb203('0x46')]['name']['toLowerCase']()]&&_0x113444[_0xb203('0x45')][_0xb203('0x42')]({'id':_0x2518df[_0xb203('0x40')],'value':_0x4bd088[_0x2518df['Variable']['name'][_0xb203('0x3c')]()][_0xb203('0x3e')]()});}});}return _0x113444;}exports[_0xb203('0x47')]=function(_0x380167,_0x25c932,_0x502086,_0x5e5ed4,_0x460887,_0x395fe2){var _0x4cd127,_0x1b225b;_0x395fe2[_0xb203('0xe')]=intUtil[_0xb203('0x48')](_0x395fe2[_0xb203('0xe')]);_0x395fe2['serverUrl']=intUtil[_0xb203('0x48')](_0x395fe2['serverUrl']);if(_0x460887&&_0x460887[_0xb203('0x49')]){logger[_0xb203('0xa')](_0xb203('0x4a'),_0xb203('0x4b'));_0x25c932[_0xb203('0x4c')]=util[_0xb203('0xc')](_0xb203('0x4d'),_0x395fe2[_0xb203('0x4e')],_0x25c932[_0xb203('0x4f')],md5(_0x25c932[_0xb203('0x4f')]));}else{_0x25c932[_0xb203('0x4c')]='';}headers[_0xb203('0x50')]=getAuth(_0x395fe2);return getUser(_0x395fe2,_0x5e5ed4[_0xb203('0x51')])[_0xb203('0x1b')](function(_0x4c4dba){_0x4cd127=_0x4c4dba;logger[_0xb203('0xa')](_0xb203('0x52'),_0x4cd127['id']);return getEndUser(_0x395fe2,_0x25c932[_0xb203('0x53')],_0x25c932[_0xb203('0x54')]);})[_0xb203('0x1b')](function(_0x3f1fbb){_0x1b225b=_0x3f1fbb;logger[_0xb203('0xa')](_0xb203('0x55'),_0x1b225b['id']);return getTicket(_0x395fe2,_0x4cd127,_0x1b225b,_0x502086,_0x25c932);})['then'](function(_0x1b4908){if(_0x1b4908){logger[_0xb203('0xa')](_0xb203('0x56'),_0x1b4908['id']);switch(_0x395fe2[_0xb203('0x3a')]){case _0xb203('0x57'):logger[_0xb203('0xa')]('[QUEUE]',_0xb203('0x58'));return request({'uri':util['format'](_0xb203('0x59'),_0x395fe2['remoteUri'],_0x4cd127['id'],_0x1b4908['id']),'method':'POST'});case _0xb203('0x5a'):logger[_0xb203('0xa')]('[QUEUE]',_0xb203('0x5b'));emit(util[_0xb203('0xc')]('user:%s',_0x5e5ed4[_0xb203('0x12')]),'trigger:browser:url',{'uri':util[_0xb203('0xc')](_0xb203('0x5c'),_0x395fe2['remoteUri'][_0xb203('0x5d')]('/api/v2',''),_0x1b4908['id'])});break;default:logger[_0xb203('0x5e')]('[QUEUE]',_0xb203('0x5f'));}}})[_0xb203('0x60')](function(_0x140c01){logger[_0xb203('0x5e')](_0xb203('0x61'),util[_0xb203('0x62')](_0x140c01,{'showHidden':!![],'depth':null}));});};exports[_0xb203('0x63')]=function(_0x50509f,_0x8abee4,_0x25868c,_0x3c012e,_0x449144,_0x56f468,_0x582eed){var _0x4ea14d,_0x464c50;_0x56f468['remoteUri']=intUtil[_0xb203('0x48')](_0x56f468[_0xb203('0xe')]);_0x56f468[_0xb203('0x4e')]=intUtil[_0xb203('0x48')](_0x56f468[_0xb203('0x4e')]);if(_0x582eed&&_0x582eed[_0xb203('0x64')]&&_0x582eed['recordingFormat']!==_0xb203('0x65')){logger[_0xb203('0xa')]('[OUTBOUND]',_0xb203('0x4b'));_0x8abee4[_0xb203('0x4c')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x56f468[_0xb203('0x4e')],_0x8abee4[_0xb203('0x4f')],md5(_0x8abee4[_0xb203('0x4f')]));}headers['Authorization']=getAuth(_0x56f468);return getUser(_0x56f468,_0x3c012e[_0xb203('0x51')])[_0xb203('0x1b')](function(_0x355b74){_0x4ea14d=_0x355b74;logger['info'](_0xb203('0x52'),_0x4ea14d['id']);return getEndUser(_0x56f468,_0x8abee4[_0xb203('0x66')],_0x8abee4[_0xb203('0x67')]);})['then'](function(_0x53a4ff){_0x464c50=_0x53a4ff;logger['info'](_0xb203('0x55'),_0x464c50['id']);return getTicket(_0x56f468,_0x4ea14d,_0x464c50,_0x25868c,_0x8abee4);})['then'](function(_0x2b0af7){if(_0x2b0af7){logger[_0xb203('0xa')](_0xb203('0x56'),_0x2b0af7['id']);switch(_0x56f468[_0xb203('0x3a')]){case'integrationTab':logger[_0xb203('0xa')](_0xb203('0x68'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xb203('0xc')](_0xb203('0x59'),_0x56f468[_0xb203('0xe')],_0x4ea14d['id'],_0x2b0af7['id']),'method':_0xb203('0xf')});case _0xb203('0x5a'):logger['info'](_0xb203('0x68'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xb203('0xc')](_0xb203('0x69'),_0x3c012e[_0xb203('0x12')]),_0xb203('0x6a'),{'uri':util['format']('%s/agent/tickets/%s',_0x56f468['remoteUri'][_0xb203('0x5d')]('/api/v2',''),_0x2b0af7['id'])});break;default:logger[_0xb203('0x5e')](_0xb203('0x68'),_0xb203('0x5f'));}}})[_0xb203('0x60')](function(_0x5b31e0){logger['error'](_0xb203('0x6b'),util[_0xb203('0x62')](_0x5b31e0,{'showHidden':!![],'depth':null}));});};exports[_0xb203('0x6c')]=function(_0x3a2add,_0x42f4f0,_0x37e07f,_0xc2403d,_0x5a3300,_0x2bf06b){var _0xe0dd97,_0x2d228f;_0x2bf06b[_0xb203('0xe')]=intUtil[_0xb203('0x48')](_0x2bf06b[_0xb203('0xe')]);_0x2bf06b[_0xb203('0x4e')]=intUtil[_0xb203('0x48')](_0x2bf06b[_0xb203('0x4e')]);if(_0x5a3300&&_0x5a3300[_0xb203('0x49')]){logger['info']('['+_0x42f4f0['lastevent'][_0xb203('0x6d')]()+']',_0xb203('0x4b'));_0x42f4f0[_0xb203('0x4c')]=util[_0xb203('0xc')](_0xb203('0x4d'),_0x2bf06b[_0xb203('0x4e')],_0x42f4f0[_0xb203('0x4f')],md5(_0x42f4f0[_0xb203('0x4f')]));}else{_0x42f4f0[_0xb203('0x4c')]='';}headers[_0xb203('0x50')]=getAuth(_0x2bf06b);return getUser(_0x2bf06b)[_0xb203('0x1b')](function(_0x16fb9b){_0xe0dd97=_0x16fb9b;logger[_0xb203('0xa')](_0xb203('0x52'),_0xe0dd97['id']);return getEndUser(_0x2bf06b,_0x42f4f0[_0xb203('0x53')],_0x42f4f0[_0xb203('0x54')]);})[_0xb203('0x1b')](function(_0x24ac03){_0x2d228f=_0x24ac03;logger[_0xb203('0xa')](_0xb203('0x55'),_0x2d228f['id']);return getTicket(_0x2bf06b,_0xe0dd97,_0x2d228f,_0x37e07f,_0x42f4f0);})[_0xb203('0x1b')](function(_0x4894e6){if(_0x4894e6){logger[_0xb203('0xa')](_0xb203('0x56'),_0x4894e6['id']);}})['catch'](function(_0x286dc6){logger[_0xb203('0x5e')]('['+_0x42f4f0[_0xb203('0x6e')][_0xb203('0x6d')]()+']'+_0xb203('0x6f'),util['inspect'](_0x286dc6,{'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 19d78d4..e6931d4 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 _0xbf97=['The\x20User\x20ID\x20is:','calleridname','calleridnum','Inbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','/downloads?type=uniqueid&token=','destcalleridname','destcalleridnum','https://crm.','lastevent','The\x20Call\x20ID\x20is:','toUpperCase','request-promise','md5','util','./util','ioredis','bluebird','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','isNil','access_token','zone','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','add','expires_in','catch','error','info','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','findIndex','Agent\x20found!','Administrator','Using\x20the\x20admin\x20account!','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','details','CREATE\x20ERROR','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Contacts','lead','Creating\x20new\x20call...','Owner','profile','Subject','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','utc','format','answertime','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','called','Call_Result','Called','complete','Answered','rejected','abandoned','timeout','Timeout','Call_Start_Time','outbound','Call_Type','Fields','SUCCESS','Call\x20created!','stack','log','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','com','email'];(function(_0xa0e632,_0x178d36){var _0x420bc2=function(_0x1fdfce){while(--_0x1fdfce){_0xa0e632['push'](_0xa0e632['shift']());}};_0x420bc2(++_0x178d36);}(_0xbf97,0xa6));var _0x7bf9=function(_0x29eae2,_0xf2cc03){_0x29eae2=_0x29eae2-0x0;var _0x11d693=_0xbf97[_0x29eae2];return _0x11d693;};'use strict';var _=require('lodash');var rp=require(_0x7bf9('0x0'));var md5=require(_0x7bf9('0x1'));var util=require(_0x7bf9('0x2'));var intUtil=require(_0x7bf9('0x3'));var moment=require('moment');var Redis=require(_0x7bf9('0x4'));var BPromise=require(_0x7bf9('0x5'));var config=require(_0x7bf9('0x6'));var logger=require(_0x7bf9('0x7'))('zoho');config[_0x7bf9('0x8')]=_[_0x7bf9('0x9')](config[_0x7bf9('0x8')],{'host':_0x7bf9('0xa'),'port':0x18eb});var io=require(_0x7bf9('0xb'))(new Redis(config[_0x7bf9('0x8')]));function emit(_0x3f3a2e,_0x53993c,_0x2149bc){io['to'](_0x3f3a2e)[_0x7bf9('0xc')](_0x53993c,_0x2149bc);}function request(_0x15530b){logger[_0x7bf9('0xd')](_0x7bf9('0xe'),JSON[_0x7bf9('0xf')](_0x15530b));return rp(_0x15530b);}function getCustomFields(_0xaf0400,_0x425788){var _0x5913c1={};if(_0xaf0400[_0x7bf9('0x10')]>0x0){_[_0x7bf9('0x11')](_0xaf0400,function(_0x558ad7){if(_['includes'](['string','picklist'],_0x558ad7['type'])&&_0x558ad7[_0x7bf9('0x12')]){_0x5913c1[_0x558ad7[_0x7bf9('0x12')]]=_0x558ad7[_0x7bf9('0x13')][_0x7bf9('0x14')]();}else if(_0x558ad7['type']==='variable'&&_0x558ad7['variableName']&&_0x558ad7['idField']&&_0x425788[_0x558ad7[_0x7bf9('0x15')]]){_0x5913c1[_0x558ad7[_0x7bf9('0x12')]]=_0x425788[_0x558ad7[_0x7bf9('0x15')]][_0x7bf9('0x14')]();}else if(_0x558ad7['type']===_0x7bf9('0x16')&&_0x558ad7[_0x7bf9('0x17')]&&_0x558ad7[_0x7bf9('0x17')]['name']&&_0x558ad7[_0x7bf9('0x12')]&&_0x425788[_0x558ad7[_0x7bf9('0x17')][_0x7bf9('0x18')][_0x7bf9('0x19')]()]){_0x5913c1[_0x558ad7['idField']]=_0x425788[_0x558ad7[_0x7bf9('0x17')][_0x7bf9('0x18')][_0x7bf9('0x19')]()][_0x7bf9('0x14')]();}});}return _0x5913c1;}function getName(_0x43031f){if(_0x43031f['indexOf']('\x20')>0x0){var _0x12de91=_0x43031f['split'](/ (.+)/);if(_0x12de91[0x1]){return _0x12de91;}}return[_0x43031f,_0x43031f];}var accountsTokens={};function getAccessToken(_0x44dfc5){return new Promise(function(_0x447f6a,_0x362a9c){if(!_[_0x7bf9('0x1a')](accountsTokens[_0x44dfc5['id']])&&!_[_0x7bf9('0x1a')](accountsTokens[_0x44dfc5['id']][_0x7bf9('0x1b')])){if(moment()['isBefore'](accountsTokens[_0x44dfc5['id']]['expires_in'])){_0x447f6a(accountsTokens[_0x44dfc5['id']][_0x7bf9('0x1b')]);}}var _0xd8b520;switch(_0x44dfc5[_0x7bf9('0x1c')]){case'US':_0xd8b520='https://accounts.zoho.com';break;case'AU':_0xd8b520='https://accounts.zoho.com.au';break;case'EU':_0xd8b520='https://accounts.zoho.eu';break;case'IN':_0xd8b520=_0x7bf9('0x1d');break;case'CN':_0xd8b520=_0x7bf9('0x1e');break;default:_0xd8b520=_0x7bf9('0x1f');break;}var _0x40440b={'method':_0x7bf9('0x20'),'uri':_0xd8b520+_0x7bf9('0x21'),'qs':{'refresh_token':_0x44dfc5[_0x7bf9('0x22')],'client_id':_0x44dfc5[_0x7bf9('0x23')],'client_secret':_0x44dfc5[_0x7bf9('0x24')],'grant_type':_0x7bf9('0x25')},'json':!![]};return rp(_0x40440b)['then'](function(_0x39e2b8){accountsTokens[_0x44dfc5['id']]={'access_token':_0x39e2b8[_0x7bf9('0x1b')],'expires_in':moment()[_0x7bf9('0x26')](_0x39e2b8[_0x7bf9('0x27')],'seconds')};_0x447f6a(_0x39e2b8[_0x7bf9('0x1b')]);})[_0x7bf9('0x28')](function(_0x342229){logger[_0x7bf9('0x29')]('Failing\x20creating\x20the\x20access_token',_0x342229['stack']);_0x362a9c(_0x342229);});});}function getUser(_0x13b96a,_0x948d8d,_0x198676,_0xb3de2b){logger[_0x7bf9('0x2a')]('Search\x20user');return request({'method':_0x7bf9('0x2b'),'uri':util['format'](_0x7bf9('0x2c'),_0x948d8d),'qs':{'type':_0x7bf9('0x2d')},'headers':{'Authorization':_0x7bf9('0x2e')+_0x13b96a},'json':!![]})[_0x7bf9('0x2f')](function(_0x4689dc){if(_0x4689dc[_0x7bf9('0x30')]){var _0x20aee4=-0x1;if(_[_0x7bf9('0x31')](_0x4689dc['users'])){if(!_['isNil'](_0xb3de2b)){_0x20aee4=_[_0x7bf9('0x32')](_0x4689dc[_0x7bf9('0x30')],function(_0x1a705b){return _0x1a705b['email']===_0xb3de2b;});}if(_0x20aee4>=0x0){logger[_0x7bf9('0x2a')](_0x7bf9('0x33'));}else{logger['info']('Using\x20the\x20admin\x20account!');_0x20aee4=_[_0x7bf9('0x32')](_0x4689dc[_0x7bf9('0x30')],function(_0x505c8a){return _0x505c8a['profile'][_0x7bf9('0x18')]===_0x7bf9('0x34');});}return _0x4689dc['users'][_0x20aee4];}else{if(_0x4689dc['user']['profile'][_0x7bf9('0x18')]===_0x7bf9('0x34')){logger['info'](_0x7bf9('0x35'));user=_0x4689dc[_0x7bf9('0x36')];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON['stringify'](_0x4689dc));throw new Error(_0x7bf9('0x37')+JSON[_0x7bf9('0xf')](_0x4689dc));}}}else{logger[_0x7bf9('0x29')](_0x7bf9('0x38'),JSON[_0x7bf9('0xf')](_0x4689dc));throw new Error(_0x7bf9('0x37')+JSON['stringify'](_0x4689dc));}})[_0x7bf9('0x28')](function(_0x1cebf6){console[_0x7bf9('0x29')](_0x1cebf6);});}function getZohoUser(_0x287e05,_0x177644){return new BPromise(function(_0x1f309a,_0x211c4c){request(_0x287e05)[_0x7bf9('0x2f')](function(_0x194181){var _0x3a8398=null;if(_0x194181){_0x3a8398=_0x194181[_0x7bf9('0x39')][0x0];_0x3a8398[_0x7bf9('0x3a')]=_0x177644;}_0x1f309a(_0x3a8398);})[_0x7bf9('0x28')](function(_0x5d4fde){_0x211c4c(_0x5d4fde);});});}function createEndUser(_0x58c9f2,_0x3030cf,_0x14fdab,_0x4b30ee,_0x3a9702,_0x4b58d5){var _0x14fdab=getName(_0x14fdab);return request({'method':'POST','uri':_0x7bf9('0x3b')+_0x3030cf+_0x7bf9('0x3c')+_[_0x7bf9('0x3d')](_0x4b58d5[_0x7bf9('0x3e')])+'s','body':{'data':[{'Last_Name':_0x14fdab[0x1],'First_Name':_0x14fdab[0x0],'Phone':_0x4b30ee,'Owner':{'name':!_['isNil'](_0x3a9702[_0x7bf9('0x3f')]['name'])?_0x3a9702['role']['name']:!_[_0x7bf9('0x1a')](_0x3a9702[_0x7bf9('0x40')])?_0x3a9702[_0x7bf9('0x40')]+'\x20'+_0x3a9702[_0x7bf9('0x41')]:_0x3a9702[_0x7bf9('0x41')],'id':_0x3a9702['id']}}]},'headers':{'Authorization':_0x7bf9('0x2e')+_0x58c9f2},'json':!![]})['then'](function(_0x52126f){if(_0x52126f&&_0x52126f['data'][0x0][_0x7bf9('0x42')]==='SUCCESS'){var _0x3d030f=_0x52126f[_0x7bf9('0x39')][0x0][_0x7bf9('0x43')];_0x3d030f[_0x7bf9('0x3a')]=_[_0x7bf9('0x3d')](_0x4b58d5[_0x7bf9('0x3e')])+'s';return _0x3d030f;}logger[_0x7bf9('0x29')](_0x7bf9('0x38'),JSON[_0x7bf9('0xf')](data));throw new Error('Error:\x20'+JSON['stringify'](data));})['catch'](function(_0x7a829){console['log'](_0x7bf9('0x44'),_0x7a829);});}function getEndUser(_0x46c385,_0xb49b8e,_0x377ccf,_0x41592f,_0x3c0c34,_0x2c445f,_0x93d2c0){var _0x1ad3f4={'method':_0x7bf9('0x2b'),'uri':'','headers':{'Authorization':_0x7bf9('0x2e')+_0x46c385},'json':!![]};switch(_0x93d2c0['moduleSearch']){case _0x7bf9('0x45'):_0x1ad3f4[_0x7bf9('0x46')]=_0x7bf9('0x3b')+_0xb49b8e+_0x7bf9('0x47')+_0x3c0c34+'))';return getZohoUser(_0x1ad3f4,'Contacts')[_0x7bf9('0x2f')](function(_0x5dd72e){if(_0x5dd72e)return _0x5dd72e;_0x1ad3f4[_0x7bf9('0x46')]=_0x7bf9('0x3b')+_0xb49b8e+_0x7bf9('0x48')+_0x3c0c34+'))';return getZohoUser(_0x1ad3f4,_0x7bf9('0x49'))[_0x7bf9('0x2f')](function(_0x344bb8){if(_0x344bb8)return _0x344bb8;if(_0x93d2c0[_0x7bf9('0x3e')]!=_0x7bf9('0x4a')){return createEndUser(_0x46c385,_0xb49b8e,_0x41592f,_0x3c0c34,_0x2c445f,_0x93d2c0);}else{return{};}});});break;case _0x7bf9('0x4b'):_0x1ad3f4[_0x7bf9('0x46')]=_0x7bf9('0x3b')+_0xb49b8e+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x3c0c34+'))';return getZohoUser(_0x1ad3f4,_0x7bf9('0x4c'))['then'](function(_0x60ee58){if(_0x60ee58)return _0x60ee58;if(_0x93d2c0[_0x7bf9('0x3e')]!=_0x7bf9('0x4a')){return createEndUser(_0x46c385,_0xb49b8e,_0x41592f,_0x3c0c34,_0x2c445f,_0x93d2c0);}else{return{};}});break;case _0x7bf9('0x4d'):_0x1ad3f4[_0x7bf9('0x46')]=_0x7bf9('0x3b')+_0xb49b8e+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x3c0c34+'))';return getZohoUser(_0x1ad3f4,_0x7bf9('0x49'))['then'](function(_0x323431){if(_0x323431)return _0x323431;if(_0x93d2c0[_0x7bf9('0x3e')]!='nothing'){return createEndUser(_0x46c385,_0xb49b8e,_0x41592f,_0x3c0c34,_0x2c445f,_0x93d2c0);}else{return{};}});break;}}function getCall(_0x574a8c,_0x33688d,_0x16f7d7,_0x4a5f26,_0x2326b4,_0x213250,_0x4eab59,_0x3bdb57){logger[_0x7bf9('0x2a')](_0x7bf9('0x4e'));var _0x4fc99e={};_0x4fc99e[_0x7bf9('0x4f')]={'name':!_['isNil'](_0x4a5f26[_0x7bf9('0x3f')][_0x7bf9('0x18')])&&!_['isNil'](_0x4a5f26[_0x7bf9('0x50')][_0x7bf9('0x18')])&&_0x4a5f26['profile'][_0x7bf9('0x18')]==='administrator'?_0x4a5f26[_0x7bf9('0x3f')][_0x7bf9('0x18')]:!_['isNil'](_0x4a5f26[_0x7bf9('0x40')])?_0x4a5f26[_0x7bf9('0x40')]+'\x20'+_0x4a5f26[_0x7bf9('0x41')]:_0x4a5f26['last_name'],'id':_0x4a5f26['id']};_0x4fc99e[_0x7bf9('0x51')]=intUtil['getString'](_0x213250[_0x7bf9('0x52')],_0x4eab59,'\x20');_0x4fc99e[_0x7bf9('0x53')]=intUtil['getString'](_0x213250[_0x7bf9('0x54')],_0x4eab59,'\x0a');if(_0x2326b4[_0x7bf9('0x3a')]===_0x7bf9('0x4c')){_0x4fc99e[_0x7bf9('0x55')]={'name':!_[_0x7bf9('0x1a')](_0x2326b4[_0x7bf9('0x56')])?_0x2326b4[_0x7bf9('0x56')]:!_[_0x7bf9('0x1a')](_0x2326b4[_0x7bf9('0x57')])?_0x2326b4['First_Name']+'\x20'+_0x2326b4['Last_Name']:_0x2326b4[_0x7bf9('0x58')],'id':_0x2326b4['id']};}if(_0x2326b4[_0x7bf9('0x3a')]===_0x7bf9('0x49')){_0x4fc99e[_0x7bf9('0x59')]={'name':!_[_0x7bf9('0x1a')](_0x2326b4[_0x7bf9('0x56')])?_0x2326b4[_0x7bf9('0x56')]:!_[_0x7bf9('0x1a')](_0x2326b4[_0x7bf9('0x57')])?_0x2326b4['First_Name']+'\x20'+_0x2326b4[_0x7bf9('0x58')]:_0x2326b4[_0x7bf9('0x58')],'id':_0x2326b4['id']};_0x4fc99e[_0x7bf9('0x5a')]=_[_0x7bf9('0x3d')](_0x2326b4['enduserType']);}if(_0x4eab59[_0x7bf9('0x5b')]){_0x4fc99e['Call_Duration']=moment[_0x7bf9('0x5c')](parseInt(_0x4eab59[_0x7bf9('0x5b')])*0x3e8)[_0x7bf9('0x5d')]('mm:ss');}else if(_0x4eab59[_0x7bf9('0x5e')]&&_0x4eab59[_0x7bf9('0x5f')]){_0x4fc99e[_0x7bf9('0x60')]=moment[_0x7bf9('0x5c')](moment(_0x4eab59[_0x7bf9('0x5f')],_0x7bf9('0x61'))[_0x7bf9('0x62')](moment(_0x4eab59[_0x7bf9('0x63')],_0x7bf9('0x61'))))[_0x7bf9('0x5d')](_0x7bf9('0x64'));}switch(_0x4eab59['lastevent']){case _0x7bf9('0x65'):_0x4fc99e[_0x7bf9('0x66')]=_0x7bf9('0x67');break;case _0x7bf9('0x68'):case'connect':_0x4fc99e['Call_Result']=_0x7bf9('0x69');break;case _0x7bf9('0x6a'):_0x4fc99e[_0x7bf9('0x66')]='Rejected';break;case _0x7bf9('0x6b'):_0x4fc99e[_0x7bf9('0x66')]='Abandoned';break;case _0x7bf9('0x6c'):_0x4fc99e[_0x7bf9('0x66')]=_0x7bf9('0x6d');default:}_0x4fc99e[_0x7bf9('0x6e')]=(_0x3bdb57===_0x7bf9('0x6f')?moment(_0x4eab59[_0x7bf9('0x63')])[_0x7bf9('0x5d')](_0x7bf9('0x61')):moment(_0x4eab59['agentcalledAt'])['format'](_0x7bf9('0x61')))||moment()['format'](_0x7bf9('0x61'));_0x4fc99e[_0x7bf9('0x70')]=_0x3bdb57||'Inbound';_0x4fc99e=_['merge'](_0x4fc99e,getCustomFields(_0x213250[_0x7bf9('0x71')],_0x4eab59));return request({'method':_0x7bf9('0x20'),'uri':_0x7bf9('0x3b')+_0x33688d+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x574a8c},'body':{'data':[_0x4fc99e]},'json':!![]})[_0x7bf9('0x2f')](function(_0x4d6517){if(_0x4d6517&&_0x4d6517[_0x7bf9('0x39')][0x0][_0x7bf9('0x42')]===_0x7bf9('0x72')){logger[_0x7bf9('0x2a')](_0x7bf9('0x73'));return{'id':_0x4d6517[_0x7bf9('0x39')][0x0][_0x7bf9('0x43')]['id']};}})['catch'](function(_0x5dfacc){logger[_0x7bf9('0x2a')]('err',_0x5dfacc[_0x7bf9('0x74')]);console[_0x7bf9('0x75')](_0x7bf9('0x76'),_0x5dfacc);});}exports[_0x7bf9('0x77')]=function(_0x331731,_0x4de562,_0x1d38f4,_0xcda455,_0x136182,_0x39cc98){var _0x1f77ab,_0x4dc862,_0x27a87a;_0x39cc98[_0x7bf9('0x78')]=intUtil[_0x7bf9('0x79')](_0x39cc98['host']);_0x39cc98[_0x7bf9('0x7a')]=intUtil[_0x7bf9('0x79')](_0x39cc98[_0x7bf9('0x7a')]);if(_0x136182&&_0x136182[_0x7bf9('0x7b')]){logger[_0x7bf9('0x2a')](_0x7bf9('0x7c'),_0x7bf9('0x7d'));_0x4de562[_0x7bf9('0x7e')]=_0x39cc98[_0x7bf9('0x7a')]+_0x7bf9('0x7f')+_0x4de562[_0x7bf9('0x80')]+'/downloads?type=uniqueid&token='+md5(_0x4de562[_0x7bf9('0x80')]);}else{_0x4de562['recordingURL']='';}var _0x5065fc=_0x39cc98[_0x7bf9('0x78')]===_0x7bf9('0x81')?'eu':_0x7bf9('0x82');return getAccessToken(_0x39cc98)[_0x7bf9('0x2f')](function(_0x459f73){_0x27a87a=_0x459f73;return getUser(_0x27a87a,_0x5065fc,_0x39cc98,_0xcda455[_0x7bf9('0x83')]);})[_0x7bf9('0x2f')](function(_0xd60cdc){_0x1f77ab=_0xd60cdc;logger[_0x7bf9('0x2a')](_0x7bf9('0x84'),_0x1f77ab['id']);return getEndUser(_0x27a87a,_0x5065fc,_0x39cc98,_0x4de562[_0x7bf9('0x85')],_0x4de562[_0x7bf9('0x86')],_0x1f77ab,_0x1d38f4);})[_0x7bf9('0x2f')](function(_0x43475d){_0x4dc862=_0x43475d;return getCall(_0x27a87a,_0x5065fc,_0x39cc98,_0x1f77ab,_0x4dc862,_0x1d38f4,_0x4de562,_0x7bf9('0x87'));})[_0x7bf9('0x2f')](function(_0x3b4d6b){if(_0x3b4d6b){logger['info']('The\x20Call\x20ID\x20is:',_0x3b4d6b['id']);logger[_0x7bf9('0x2a')](_0x7bf9('0x7c'),_0x7bf9('0x88'));emit(util[_0x7bf9('0x5d')](_0x7bf9('0x89'),_0xcda455[_0x7bf9('0x18')]),_0x7bf9('0x8a'),{'uri':'https://crm.'+_0x39cc98[_0x7bf9('0x78')]+_0x7bf9('0x8b')+_0x3b4d6b['id']});}})[_0x7bf9('0x28')](function(_0x16a252){logger['error']('[QUEUE]',JSON['stringify'](_0x16a252));});};exports[_0x7bf9('0x6f')]=function(_0x3bcef2,_0x2436da,_0x23b5d2,_0x3b3dff,_0x4756f0,_0x3f6046,_0x41f2dc){var _0x291052,_0x49a368,_0x2cf68a;_0x3f6046[_0x7bf9('0x78')]=intUtil[_0x7bf9('0x79')](_0x3f6046[_0x7bf9('0x78')]);_0x3f6046[_0x7bf9('0x7a')]=intUtil[_0x7bf9('0x79')](_0x3f6046['serverUrl']);if(_0x41f2dc&&_0x41f2dc['recordingFormat']&&_0x41f2dc[_0x7bf9('0x8c')]!=='none'){logger[_0x7bf9('0x2a')](_0x7bf9('0x8d'),_0x7bf9('0x7d'));_0x2436da[_0x7bf9('0x7e')]=_0x3f6046[_0x7bf9('0x7a')]+_0x7bf9('0x7f')+_0x2436da['uniqueid']+_0x7bf9('0x8e')+md5(_0x2436da[_0x7bf9('0x80')]);}var _0x41dce6=_0x3f6046['host']===_0x7bf9('0x81')?'eu':_0x7bf9('0x82');return getAccessToken(_0x3f6046)[_0x7bf9('0x2f')](function(_0x5a7059){_0x2cf68a=_0x5a7059;return getUser(_0x2cf68a,_0x41dce6,_0x3f6046,_0x3b3dff[_0x7bf9('0x83')]);})[_0x7bf9('0x2f')](function(_0x562924){_0x291052=_0x562924;logger['info'](_0x7bf9('0x84'),_0x291052['id']);return getEndUser(_0x2cf68a,_0x41dce6,_0x3f6046,_0x2436da[_0x7bf9('0x8f')],_0x2436da[_0x7bf9('0x90')],_0x291052,_0x23b5d2);})[_0x7bf9('0x2f')](function(_0x34bffd){_0x49a368=_0x34bffd;return getCall(_0x2cf68a,_0x41dce6,_0x3f6046,_0x291052,_0x49a368,_0x23b5d2,_0x2436da,'Outbound');})[_0x7bf9('0x2f')](function(_0x4ac7b0){if(_0x4ac7b0){logger[_0x7bf9('0x2a')]('The\x20Call\x20ID\x20is:',_0x4ac7b0['id']);logger[_0x7bf9('0x2a')](_0x7bf9('0x8d'),_0x7bf9('0x88'));emit(util['format'](_0x7bf9('0x89'),_0x3b3dff['name']),_0x7bf9('0x8a'),{'uri':_0x7bf9('0x91')+_0x3f6046['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x4ac7b0['id']});}})['catch'](function(_0x45cfb3){logger['error']('[OUTBOUND]',JSON[_0x7bf9('0xf')](_0x45cfb3));});};exports['unmanaged']=function(_0x5dc5e9,_0x5762e9,_0xd625ad,_0x2a1c7b,_0x511469,_0x506255){var _0x3d9986,_0x2c1fcb,_0x36cc28;_0x506255[_0x7bf9('0x78')]=intUtil[_0x7bf9('0x79')](_0x506255['host']);_0x506255[_0x7bf9('0x7a')]=intUtil[_0x7bf9('0x79')](_0x506255[_0x7bf9('0x7a')]);if(_0x511469&&_0x511469['monitor_format']){logger['info']('['+_0x5762e9[_0x7bf9('0x92')]['toUpperCase']()+']',_0x7bf9('0x7d'));_0x5762e9[_0x7bf9('0x7e')]=_0x506255['serverUrl']+'/api/voice/recordings/'+_0x5762e9[_0x7bf9('0x80')]+'/downloads?type=uniqueid&token='+md5(_0x5762e9[_0x7bf9('0x80')]);}else{_0x5762e9['recordingURL']='';}var _0x46c09a=_0x506255['host']===_0x7bf9('0x81')?'eu':'com';return getAccessToken(_0x506255)[_0x7bf9('0x2f')](function(_0x547c9b){_0x36cc28=_0x547c9b;return getUser(_0x36cc28,_0x46c09a,_0x506255);})[_0x7bf9('0x2f')](function(_0x712ee5){_0x3d9986=_0x712ee5;logger[_0x7bf9('0x2a')](_0x7bf9('0x84'),_0x3d9986['id']);return getEndUser(_0x36cc28,_0x46c09a,_0x506255,_0x5762e9[_0x7bf9('0x85')],_0x5762e9[_0x7bf9('0x86')],_0x3d9986,_0xd625ad);})[_0x7bf9('0x2f')](function(_0x316d57){_0x2c1fcb=_0x316d57;return getCall(_0x36cc28,_0x46c09a,_0x506255,_0x3d9986,_0x2c1fcb,_0xd625ad,_0x5762e9,'Inbound');})[_0x7bf9('0x2f')](function(_0x4f8e6c){if(_0x4f8e6c){logger[_0x7bf9('0x2a')](_0x7bf9('0x93'),_0x4f8e6c['id']);}})[_0x7bf9('0x28')](function(_0x4c2e4b){logger[_0x7bf9('0x29')]('['+_0x5762e9[_0x7bf9('0x92')][_0x7bf9('0x94')]()+']',JSON['stringify'](_0x4c2e4b));});}; \ No newline at end of file +var _0xa863=['none','[OUTBOUND]','/downloads?type=uniqueid&token=','destcalleridname','Outbound','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','unmanaged','toUpperCase','request-promise','util','./util','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','stringify','length','forEach','includes','string','picklist','type','idField','toString','Variable','name','toLowerCase','split','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientSecret','refresh_token','then','access_token','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','isArrayLikeObject','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','profile','Administrator','user','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','isNil','role','first_name','last_name','code','details','Error:\x20','log','CREATE\x20ERROR','moduleSearch','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','lead','Owner','administrator','getString','Subjects','Descriptions','enduserType','Who_Id','Full_Name','Last_Name','What_Id','First_Name','$se_module','talktime','Call_Duration','utc','format','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','lastevent','called','Call_Result','Called','complete','connect','rejected','Rejected','Abandoned','timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','SUCCESS','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','user:%s','/crm/EntityInfo.do?module=Calls&id=','recordingFormat'];(function(_0x45dedf,_0x382360){var _0x1e4758=function(_0x525dce){while(--_0x525dce){_0x45dedf['push'](_0x45dedf['shift']());}};_0x1e4758(++_0x382360);}(_0xa863,0x1d0));var _0x3a86=function(_0x4fd608,_0xa6b0bc){_0x4fd608=_0x4fd608-0x0;var _0x420c72=_0xa863[_0x4fd608];return _0x420c72;};'use strict';var _=require('lodash');var rp=require(_0x3a86('0x0'));var md5=require('md5');var util=require(_0x3a86('0x1'));var intUtil=require(_0x3a86('0x2'));var moment=require('moment');var Redis=require('ioredis');var BPromise=require(_0x3a86('0x3'));var config=require(_0x3a86('0x4'));var logger=require(_0x3a86('0x5'))(_0x3a86('0x6'));config[_0x3a86('0x7')]=_[_0x3a86('0x8')](config[_0x3a86('0x7')],{'host':_0x3a86('0x9'),'port':0x18eb});var io=require(_0x3a86('0xa'))(new Redis(config[_0x3a86('0x7')]));function emit(_0x4bbc1c,_0x4e090c,_0x1ac042){io['to'](_0x4bbc1c)[_0x3a86('0xb')](_0x4e090c,_0x1ac042);}function request(_0x29d1da){logger['debug']('[HTTP]',JSON[_0x3a86('0xc')](_0x29d1da));return rp(_0x29d1da);}function getCustomFields(_0x5dff85,_0x35a717){var _0x42ad3a={};if(_0x5dff85[_0x3a86('0xd')]>0x0){_[_0x3a86('0xe')](_0x5dff85,function(_0x4107bb){if(_[_0x3a86('0xf')]([_0x3a86('0x10'),_0x3a86('0x11')],_0x4107bb[_0x3a86('0x12')])&&_0x4107bb[_0x3a86('0x13')]){_0x42ad3a[_0x4107bb[_0x3a86('0x13')]]=_0x4107bb['content'][_0x3a86('0x14')]();}else if(_0x4107bb['type']==='variable'&&_0x4107bb['variableName']&&_0x4107bb['idField']&&_0x35a717[_0x4107bb['variableName']]){_0x42ad3a[_0x4107bb[_0x3a86('0x13')]]=_0x35a717[_0x4107bb['variableName']][_0x3a86('0x14')]();}else if(_0x4107bb[_0x3a86('0x12')]==='customVariable'&&_0x4107bb['Variable']&&_0x4107bb[_0x3a86('0x15')][_0x3a86('0x16')]&&_0x4107bb['idField']&&_0x35a717[_0x4107bb['Variable'][_0x3a86('0x16')][_0x3a86('0x17')]()]){_0x42ad3a[_0x4107bb[_0x3a86('0x13')]]=_0x35a717[_0x4107bb['Variable'][_0x3a86('0x16')][_0x3a86('0x17')]()][_0x3a86('0x14')]();}});}return _0x42ad3a;}function getName(_0x2fc287){if(_0x2fc287['indexOf']('\x20')>0x0){var _0x2039d2=_0x2fc287[_0x3a86('0x18')](/ (.+)/);if(_0x2039d2[0x1]){return _0x2039d2;}}return[_0x2fc287,_0x2fc287];}var accountsTokens={};function getAccessToken(_0x4fb5b8){return new Promise(function(_0xa290b9,_0x458dbd){if(!_['isNil'](accountsTokens[_0x4fb5b8['id']])&&!_['isNil'](accountsTokens[_0x4fb5b8['id']]['access_token'])){if(moment()[_0x3a86('0x19')](accountsTokens[_0x4fb5b8['id']][_0x3a86('0x1a')])){_0xa290b9(accountsTokens[_0x4fb5b8['id']]['access_token']);}}var _0x36e796;switch(_0x4fb5b8['zone']){case'US':_0x36e796=_0x3a86('0x1b');break;case'AU':_0x36e796=_0x3a86('0x1c');break;case'EU':_0x36e796=_0x3a86('0x1d');break;case'IN':_0x36e796='https://accounts.zoho.in';break;case'CN':_0x36e796=_0x3a86('0x1e');break;default:_0x36e796=_0x3a86('0x1d');break;}var _0x1bb6a4={'method':_0x3a86('0x1f'),'uri':_0x36e796+_0x3a86('0x20'),'qs':{'refresh_token':_0x4fb5b8['refreshToken'],'client_id':_0x4fb5b8['clientId'],'client_secret':_0x4fb5b8[_0x3a86('0x21')],'grant_type':_0x3a86('0x22')},'json':!![]};return rp(_0x1bb6a4)[_0x3a86('0x23')](function(_0x3017e7){accountsTokens[_0x4fb5b8['id']]={'access_token':_0x3017e7[_0x3a86('0x24')],'expires_in':moment()['add'](_0x3017e7[_0x3a86('0x1a')],_0x3a86('0x25'))};_0xa290b9(_0x3017e7[_0x3a86('0x24')]);})[_0x3a86('0x26')](function(_0x1d4838){logger['error'](_0x3a86('0x27'),_0x1d4838[_0x3a86('0x28')]);_0x458dbd(_0x1d4838);});});}function getUser(_0x3c150c,_0x5460e5,_0x77612f,_0x38b54e){logger[_0x3a86('0x29')](_0x3a86('0x2a'));return request({'method':_0x3a86('0x2b'),'uri':util['format'](_0x3a86('0x2c'),_0x5460e5),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x3a86('0x2d')+_0x3c150c},'json':!![]})['then'](function(_0x16c06e){if(_0x16c06e[_0x3a86('0x2e')]){var _0x5c6ae8=-0x1;if(_[_0x3a86('0x2f')](_0x16c06e[_0x3a86('0x2e')])){if(!_['isNil'](_0x38b54e)){_0x5c6ae8=_['findIndex'](_0x16c06e[_0x3a86('0x2e')],function(_0x57f6fe){return _0x57f6fe['email']===_0x38b54e;});}if(_0x5c6ae8>=0x0){logger['info'](_0x3a86('0x30'));}else{logger[_0x3a86('0x29')](_0x3a86('0x31'));_0x5c6ae8=_[_0x3a86('0x32')](_0x16c06e[_0x3a86('0x2e')],function(_0x23c9ce){return _0x23c9ce[_0x3a86('0x33')][_0x3a86('0x16')]===_0x3a86('0x34');});}return _0x16c06e[_0x3a86('0x2e')][_0x5c6ae8];}else{if(_0x16c06e['user'][_0x3a86('0x33')][_0x3a86('0x16')]===_0x3a86('0x34')){logger[_0x3a86('0x29')](_0x3a86('0x31'));user=_0x16c06e[_0x3a86('0x35')];return user;}else{logger[_0x3a86('0x36')](_0x3a86('0x37'),JSON[_0x3a86('0xc')](_0x16c06e));throw new Error(_0x3a86('0x38')+JSON[_0x3a86('0xc')](_0x16c06e));}}}else{logger[_0x3a86('0x36')](_0x3a86('0x37'),JSON[_0x3a86('0xc')](_0x16c06e));throw new Error(_0x3a86('0x38')+JSON['stringify'](_0x16c06e));}})[_0x3a86('0x26')](function(_0x48839d){console[_0x3a86('0x36')](_0x48839d);});}function getZohoUser(_0x389df4,_0x4a64bb){return new BPromise(function(_0x4fe4db,_0x4efe67){request(_0x389df4)[_0x3a86('0x23')](function(_0x48973f){var _0x664aa=null;if(_0x48973f){_0x664aa=_0x48973f[_0x3a86('0x39')][0x0];_0x664aa['enduserType']=_0x4a64bb;}_0x4fe4db(_0x664aa);})[_0x3a86('0x26')](function(_0x364bb2){_0x4efe67(_0x364bb2);});});}function createEndUser(_0x3907ae,_0x2b7ea9,_0x31efbe,_0x5b6352,_0x1421e2,_0x269fd6){var _0x31efbe=getName(_0x31efbe);return request({'method':'POST','uri':_0x3a86('0x3a')+_0x2b7ea9+_0x3a86('0x3b')+_[_0x3a86('0x3c')](_0x269fd6[_0x3a86('0x3d')])+'s','body':{'data':[{'Last_Name':_0x31efbe[0x1],'First_Name':_0x31efbe[0x0],'Phone':_0x5b6352,'Owner':{'name':!_[_0x3a86('0x3e')](_0x1421e2[_0x3a86('0x3f')]['name'])?_0x1421e2[_0x3a86('0x3f')][_0x3a86('0x16')]:!_[_0x3a86('0x3e')](_0x1421e2[_0x3a86('0x40')])?_0x1421e2[_0x3a86('0x40')]+'\x20'+_0x1421e2[_0x3a86('0x41')]:_0x1421e2['last_name'],'id':_0x1421e2['id']}}]},'headers':{'Authorization':_0x3a86('0x2d')+_0x3907ae},'json':!![]})['then'](function(_0x19e4f9){if(_0x19e4f9&&_0x19e4f9[_0x3a86('0x39')][0x0][_0x3a86('0x42')]==='SUCCESS'){var _0x10e3f9=_0x19e4f9[_0x3a86('0x39')][0x0][_0x3a86('0x43')];_0x10e3f9['enduserType']=_['startCase'](_0x269fd6[_0x3a86('0x3d')])+'s';return _0x10e3f9;}logger['error']('The\x20failing\x20result\x20is',JSON[_0x3a86('0xc')](data));throw new Error(_0x3a86('0x44')+JSON[_0x3a86('0xc')](data));})[_0x3a86('0x26')](function(_0x4995b6){console[_0x3a86('0x45')](_0x3a86('0x46'),_0x4995b6);});}function getEndUser(_0x47c155,_0xe46f67,_0x439ac1,_0x5eea4b,_0x2e356b,_0x42e0a9,_0x2079fc){var _0x48557b={'method':_0x3a86('0x2b'),'uri':'','headers':{'Authorization':_0x3a86('0x2d')+_0x47c155},'json':!![]};switch(_0x2079fc[_0x3a86('0x47')]){case _0x3a86('0x48'):_0x48557b[_0x3a86('0x49')]=_0x3a86('0x3a')+_0xe46f67+_0x3a86('0x4a')+_0x2e356b+'))';return getZohoUser(_0x48557b,_0x3a86('0x4b'))['then'](function(_0x5caada){if(_0x5caada)return _0x5caada;_0x48557b[_0x3a86('0x49')]='https://www.zohoapis.'+_0xe46f67+_0x3a86('0x4c')+_0x2e356b+'))';return getZohoUser(_0x48557b,_0x3a86('0x4d'))[_0x3a86('0x23')](function(_0x4f4857){if(_0x4f4857)return _0x4f4857;if(_0x2079fc['moduleCreate']!=_0x3a86('0x4e')){return createEndUser(_0x47c155,_0xe46f67,_0x5eea4b,_0x2e356b,_0x42e0a9,_0x2079fc);}else{return{};}});});break;case'contact':_0x48557b[_0x3a86('0x49')]=_0x3a86('0x3a')+_0xe46f67+_0x3a86('0x4a')+_0x2e356b+'))';return getZohoUser(_0x48557b,_0x3a86('0x4b'))[_0x3a86('0x23')](function(_0x166a2e){if(_0x166a2e)return _0x166a2e;if(_0x2079fc['moduleCreate']!=_0x3a86('0x4e')){return createEndUser(_0x47c155,_0xe46f67,_0x5eea4b,_0x2e356b,_0x42e0a9,_0x2079fc);}else{return{};}});break;case _0x3a86('0x4f'):_0x48557b[_0x3a86('0x49')]='https://www.zohoapis.'+_0xe46f67+_0x3a86('0x4c')+_0x2e356b+'))';return getZohoUser(_0x48557b,'Leads')[_0x3a86('0x23')](function(_0x195888){if(_0x195888)return _0x195888;if(_0x2079fc[_0x3a86('0x3d')]!='nothing'){return createEndUser(_0x47c155,_0xe46f67,_0x5eea4b,_0x2e356b,_0x42e0a9,_0x2079fc);}else{return{};}});break;}}function getCall(_0x21fece,_0xca20b1,_0x4906b0,_0x4b4ddf,_0x11448f,_0x2f8c66,_0x11dade,_0x14659d){logger[_0x3a86('0x29')]('Creating\x20new\x20call...');var _0x3b5982={};_0x3b5982[_0x3a86('0x50')]={'name':!_[_0x3a86('0x3e')](_0x4b4ddf[_0x3a86('0x3f')][_0x3a86('0x16')])&&!_['isNil'](_0x4b4ddf[_0x3a86('0x33')][_0x3a86('0x16')])&&_0x4b4ddf[_0x3a86('0x33')][_0x3a86('0x16')]===_0x3a86('0x51')?_0x4b4ddf[_0x3a86('0x3f')]['name']:!_['isNil'](_0x4b4ddf[_0x3a86('0x40')])?_0x4b4ddf[_0x3a86('0x40')]+'\x20'+_0x4b4ddf[_0x3a86('0x41')]:_0x4b4ddf[_0x3a86('0x41')],'id':_0x4b4ddf['id']};_0x3b5982['Subject']=intUtil[_0x3a86('0x52')](_0x2f8c66[_0x3a86('0x53')],_0x11dade,'\x20');_0x3b5982['Description']=intUtil[_0x3a86('0x52')](_0x2f8c66[_0x3a86('0x54')],_0x11dade,'\x0a');if(_0x11448f[_0x3a86('0x55')]==='Contacts'){_0x3b5982[_0x3a86('0x56')]={'name':!_['isNil'](_0x11448f[_0x3a86('0x57')])?_0x11448f['Full_Name']:!_['isNil'](_0x11448f['First_Name'])?_0x11448f['First_Name']+'\x20'+_0x11448f[_0x3a86('0x58')]:_0x11448f[_0x3a86('0x58')],'id':_0x11448f['id']};}if(_0x11448f[_0x3a86('0x55')]===_0x3a86('0x4d')){_0x3b5982[_0x3a86('0x59')]={'name':!_[_0x3a86('0x3e')](_0x11448f['Full_Name'])?_0x11448f[_0x3a86('0x57')]:!_[_0x3a86('0x3e')](_0x11448f[_0x3a86('0x5a')])?_0x11448f[_0x3a86('0x5a')]+'\x20'+_0x11448f[_0x3a86('0x58')]:_0x11448f[_0x3a86('0x58')],'id':_0x11448f['id']};_0x3b5982[_0x3a86('0x5b')]=_[_0x3a86('0x3c')](_0x11448f[_0x3a86('0x55')]);}if(_0x11dade[_0x3a86('0x5c')]){_0x3b5982[_0x3a86('0x5d')]=moment[_0x3a86('0x5e')](parseInt(_0x11dade[_0x3a86('0x5c')])*0x3e8)[_0x3a86('0x5f')]('mm:ss');}else if(_0x11dade['answertime']&&_0x11dade['endtime']){_0x3b5982[_0x3a86('0x5d')]=moment[_0x3a86('0x5e')](moment(_0x11dade[_0x3a86('0x60')],_0x3a86('0x61'))[_0x3a86('0x62')](moment(_0x11dade[_0x3a86('0x63')],'YYYY-MM-DDTHH:mm:ss')))[_0x3a86('0x5f')](_0x3a86('0x64'));}switch(_0x11dade[_0x3a86('0x65')]){case _0x3a86('0x66'):_0x3b5982[_0x3a86('0x67')]=_0x3a86('0x68');break;case _0x3a86('0x69'):case _0x3a86('0x6a'):_0x3b5982[_0x3a86('0x67')]='Answered';break;case _0x3a86('0x6b'):_0x3b5982[_0x3a86('0x67')]=_0x3a86('0x6c');break;case'abandoned':_0x3b5982[_0x3a86('0x67')]=_0x3a86('0x6d');break;case _0x3a86('0x6e'):_0x3b5982['Call_Result']='Timeout';default:}_0x3b5982[_0x3a86('0x6f')]=(_0x14659d===_0x3a86('0x70')?moment(_0x11dade[_0x3a86('0x63')])[_0x3a86('0x5f')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x11dade[_0x3a86('0x71')])['format']('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x3a86('0x5f')](_0x3a86('0x61'));_0x3b5982[_0x3a86('0x72')]=_0x14659d||_0x3a86('0x73');_0x3b5982=_[_0x3a86('0x74')](_0x3b5982,getCustomFields(_0x2f8c66[_0x3a86('0x75')],_0x11dade));return request({'method':_0x3a86('0x1f'),'uri':_0x3a86('0x3a')+_0xca20b1+'/crm/v2/Calls','headers':{'Authorization':_0x3a86('0x2d')+_0x21fece},'body':{'data':[_0x3b5982]},'json':!![]})[_0x3a86('0x23')](function(_0x3accfb){if(_0x3accfb&&_0x3accfb[_0x3a86('0x39')][0x0][_0x3a86('0x42')]===_0x3a86('0x76')){logger[_0x3a86('0x29')](_0x3a86('0x77'));return{'id':_0x3accfb['data'][0x0][_0x3a86('0x43')]['id']};}})[_0x3a86('0x26')](function(_0x4a4591){logger[_0x3a86('0x29')](_0x3a86('0x78'),_0x4a4591[_0x3a86('0x28')]);console[_0x3a86('0x45')](_0x3a86('0x78'),_0x4a4591);});}exports[_0x3a86('0x79')]=function(_0x3151ca,_0x28f166,_0x45cb69,_0x566322,_0xefa9e1,_0x40ff26){var _0x1e6bbf,_0x51a645,_0x518cc7;_0x40ff26[_0x3a86('0x7a')]=intUtil[_0x3a86('0x7b')](_0x40ff26[_0x3a86('0x7a')]);_0x40ff26[_0x3a86('0x7c')]=intUtil[_0x3a86('0x7b')](_0x40ff26[_0x3a86('0x7c')]);if(_0xefa9e1&&_0xefa9e1[_0x3a86('0x7d')]){logger[_0x3a86('0x29')](_0x3a86('0x7e'),_0x3a86('0x7f'));_0x28f166[_0x3a86('0x80')]=_0x40ff26[_0x3a86('0x7c')]+_0x3a86('0x81')+_0x28f166[_0x3a86('0x82')]+'/downloads?type=uniqueid&token='+md5(_0x28f166[_0x3a86('0x82')]);}else{_0x28f166[_0x3a86('0x80')]='';}var _0x26a437=_0x40ff26['host']===_0x3a86('0x83')?'eu':_0x3a86('0x84');return getAccessToken(_0x40ff26)[_0x3a86('0x23')](function(_0x3f0a99){_0x518cc7=_0x3f0a99;return getUser(_0x518cc7,_0x26a437,_0x40ff26,_0x566322[_0x3a86('0x85')]);})[_0x3a86('0x23')](function(_0x431ff9){_0x1e6bbf=_0x431ff9;logger[_0x3a86('0x29')](_0x3a86('0x86'),_0x1e6bbf['id']);return getEndUser(_0x518cc7,_0x26a437,_0x40ff26,_0x28f166[_0x3a86('0x87')],_0x28f166[_0x3a86('0x88')],_0x1e6bbf,_0x45cb69);})['then'](function(_0x4409ad){_0x51a645=_0x4409ad;return getCall(_0x518cc7,_0x26a437,_0x40ff26,_0x1e6bbf,_0x51a645,_0x45cb69,_0x28f166,'Inbound');})['then'](function(_0x2d5142){if(_0x2d5142){logger[_0x3a86('0x29')]('The\x20Call\x20ID\x20is:',_0x2d5142['id']);logger[_0x3a86('0x29')](_0x3a86('0x7e'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3a86('0x5f')](_0x3a86('0x89'),_0x566322[_0x3a86('0x16')]),'trigger:browser:url',{'uri':'https://crm.'+_0x40ff26['host']+_0x3a86('0x8a')+_0x2d5142['id']});}})['catch'](function(_0x5cb14c){logger[_0x3a86('0x36')](_0x3a86('0x7e'),JSON[_0x3a86('0xc')](_0x5cb14c));});};exports[_0x3a86('0x70')]=function(_0x20f875,_0x4ef855,_0x9014ca,_0x2a1970,_0x32c304,_0x254457,_0x4589ad){var _0x531820,_0x5dcc2c,_0x3f2ea9;_0x254457[_0x3a86('0x7a')]=intUtil['stripTrailingSlash'](_0x254457[_0x3a86('0x7a')]);_0x254457[_0x3a86('0x7c')]=intUtil['stripTrailingSlash'](_0x254457['serverUrl']);if(_0x4589ad&&_0x4589ad['recordingFormat']&&_0x4589ad[_0x3a86('0x8b')]!==_0x3a86('0x8c')){logger['info'](_0x3a86('0x8d'),'Recording\x20is\x20enabled!');_0x4ef855[_0x3a86('0x80')]=_0x254457[_0x3a86('0x7c')]+_0x3a86('0x81')+_0x4ef855[_0x3a86('0x82')]+_0x3a86('0x8e')+md5(_0x4ef855[_0x3a86('0x82')]);}var _0x4d4b5e=_0x254457['host']===_0x3a86('0x83')?'eu':'com';return getAccessToken(_0x254457)[_0x3a86('0x23')](function(_0x3dbd76){_0x3f2ea9=_0x3dbd76;return getUser(_0x3f2ea9,_0x4d4b5e,_0x254457,_0x2a1970[_0x3a86('0x85')]);})['then'](function(_0x5313fb){_0x531820=_0x5313fb;logger[_0x3a86('0x29')](_0x3a86('0x86'),_0x531820['id']);return getEndUser(_0x3f2ea9,_0x4d4b5e,_0x254457,_0x4ef855[_0x3a86('0x8f')],_0x4ef855['destcalleridnum'],_0x531820,_0x9014ca);})[_0x3a86('0x23')](function(_0x40e486){_0x5dcc2c=_0x40e486;return getCall(_0x3f2ea9,_0x4d4b5e,_0x254457,_0x531820,_0x5dcc2c,_0x9014ca,_0x4ef855,_0x3a86('0x90'));})['then'](function(_0x30e6ba){if(_0x30e6ba){logger[_0x3a86('0x29')](_0x3a86('0x91'),_0x30e6ba['id']);logger[_0x3a86('0x29')](_0x3a86('0x8d'),_0x3a86('0x92'));emit(util[_0x3a86('0x5f')](_0x3a86('0x89'),_0x2a1970[_0x3a86('0x16')]),_0x3a86('0x93'),{'uri':_0x3a86('0x94')+_0x254457[_0x3a86('0x7a')]+_0x3a86('0x8a')+_0x30e6ba['id']});}})[_0x3a86('0x26')](function(_0x3772ba){logger[_0x3a86('0x36')](_0x3a86('0x8d'),JSON['stringify'](_0x3772ba));});};exports[_0x3a86('0x95')]=function(_0x2439d5,_0x574f31,_0x5e1caa,_0x940186,_0x568940,_0x2a5d5a){var _0x2a39b9,_0x4cdabb,_0x402e21;_0x2a5d5a['host']=intUtil[_0x3a86('0x7b')](_0x2a5d5a[_0x3a86('0x7a')]);_0x2a5d5a['serverUrl']=intUtil['stripTrailingSlash'](_0x2a5d5a[_0x3a86('0x7c')]);if(_0x568940&&_0x568940[_0x3a86('0x7d')]){logger[_0x3a86('0x29')]('['+_0x574f31['lastevent'][_0x3a86('0x96')]()+']',_0x3a86('0x7f'));_0x574f31['recordingURL']=_0x2a5d5a[_0x3a86('0x7c')]+_0x3a86('0x81')+_0x574f31['uniqueid']+_0x3a86('0x8e')+md5(_0x574f31[_0x3a86('0x82')]);}else{_0x574f31[_0x3a86('0x80')]='';}var _0x22cb4b=_0x2a5d5a['host']===_0x3a86('0x83')?'eu':_0x3a86('0x84');return getAccessToken(_0x2a5d5a)[_0x3a86('0x23')](function(_0x3317c1){_0x402e21=_0x3317c1;return getUser(_0x402e21,_0x22cb4b,_0x2a5d5a);})[_0x3a86('0x23')](function(_0x182ab5){_0x2a39b9=_0x182ab5;logger['info'](_0x3a86('0x86'),_0x2a39b9['id']);return getEndUser(_0x402e21,_0x22cb4b,_0x2a5d5a,_0x574f31[_0x3a86('0x87')],_0x574f31[_0x3a86('0x88')],_0x2a39b9,_0x5e1caa);})[_0x3a86('0x23')](function(_0x38001a){_0x4cdabb=_0x38001a;return getCall(_0x402e21,_0x22cb4b,_0x2a5d5a,_0x2a39b9,_0x4cdabb,_0x5e1caa,_0x574f31,_0x3a86('0x73'));})['then'](function(_0x1da064){if(_0x1da064){logger['info'](_0x3a86('0x91'),_0x1da064['id']);}})[_0x3a86('0x26')](function(_0x39c893){logger[_0x3a86('0x36')]('['+_0x574f31[_0x3a86('0x65')][_0x3a86('0x96')]()+']',JSON['stringify'](_0x39c893));});}; \ 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 a83e9e0..2109340 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 _0xcb3f=['exec','error','format','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','../../../../config/logger','trigger','data2','data3'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xcb3f,0x118));var _0xfcb3=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xcb3f[_0x8c43de];return _0xa6591b;};'use strict';var util=require(_0xfcb3('0x0'));var sh=require(_0xfcb3('0x1'));var Mustache=require('mustache');var logger=require(_0xfcb3('0x2'))(_0xfcb3('0x3'));exports['exec']=function(_0x51f818,_0x47edf8){var _0x1d9bf3=_0x51f818[_0xfcb3('0x4')]?_0x51f818['data2']:'Script';var _0x3d1678=_0x51f818[_0xfcb3('0x5')]?Mustache['render'](_0x51f818['data3'],_0x47edf8):_0x47edf8;sh[_0xfcb3('0x6')](_0x3d1678,function(_0x3b448f,_0x2347c7,_0x5b05c2){if(_0x3b448f!==0x0){logger[_0xfcb3('0x7')](util[_0xfcb3('0x8')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x1d9bf3,_0x3d1678,_0x3b448f,_0x5b05c2));}else{logger[_0xfcb3('0x9')](util[_0xfcb3('0x8')](_0xfcb3('0xa'),_0x1d9bf3,_0x3d1678,_0x2347c7));}});}; \ No newline at end of file +var _0x5927=['%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger','exec','data2','render','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info'];(function(_0x36576b,_0x46285f){var _0x3ec36f=function(_0x20971f){while(--_0x20971f){_0x36576b['push'](_0x36576b['shift']());}};_0x3ec36f(++_0x46285f);}(_0x5927,0xef));var _0x7592=function(_0x17fea7,_0x102927){_0x17fea7=_0x17fea7-0x0;var _0x3150c3=_0x5927[_0x17fea7];return _0x3150c3;};'use strict';var util=require(_0x7592('0x0'));var sh=require(_0x7592('0x1'));var Mustache=require(_0x7592('0x2'));var logger=require(_0x7592('0x3'))(_0x7592('0x4'));exports[_0x7592('0x5')]=function(_0x444bb3,_0x97f91f){var _0x45003c=_0x444bb3[_0x7592('0x6')]?_0x444bb3['data2']:'Script';var _0x1c084e=_0x444bb3['data3']?Mustache[_0x7592('0x7')](_0x444bb3[_0x7592('0x8')],_0x97f91f):_0x97f91f;sh[_0x7592('0x5')](_0x1c084e,function(_0x23d92c,_0x21341f,_0x2119fd){if(_0x23d92c!==0x0){logger[_0x7592('0x9')](util[_0x7592('0xa')](_0x7592('0xb'),_0x45003c,_0x1c084e,_0x23d92c,_0x2119fd));}else{logger[_0x7592('0xc')](util[_0x7592('0xa')](_0x7592('0xd'),_0x45003c,_0x1c084e,_0x21341f));}});}; \ 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 1f927ea..942f283 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 _0xe6ce=['body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','stringify','then','isNil','body','object','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','message','util','lodash','exec','data1','toUpperCase','render','data2','data5','number','headers','data6','parse','error','stack','data7'];(function(_0xd008d9,_0x48c48c){var _0x470680=function(_0x380629){while(--_0x380629){_0xd008d9['push'](_0xd008d9['shift']());}};_0x470680(++_0x48c48c);}(_0xe6ce,0x1e9));var _0xee6c=function(_0x48cc02,_0x510c55){_0x48cc02=_0x48cc02-0x0;var _0x6b2545=_0xe6ce[_0x48cc02];return _0x6b2545;};'use strict';var rp=require('request-promise');var util=require(_0xee6c('0x0'));var _=require(_0xee6c('0x1'));var Mustache=require('mustache');var logger=require('../../../../config/logger')('trigger');exports[_0xee6c('0x2')]=function(_0x493824,_0x327585){var _0x4f8f45,_0x329da9;var _0x1bcc09={'method':_0x493824[_0xee6c('0x3')][_0xee6c('0x4')](),'uri':Mustache[_0xee6c('0x5')](_0x493824[_0xee6c('0x6')],_0x327585),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x493824[_0xee6c('0x7')])===_0xee6c('0x8')&&parseInt(_0x493824['data5'])>=0x1&&parseInt(_0x493824[_0xee6c('0x7')])<=0xa?parseInt(_0x493824[_0xee6c('0x7')])*0x3e8:0x5*0x3e8};try{_0x1bcc09[_0xee6c('0x9')]=_0x493824[_0xee6c('0xa')]?JSON[_0xee6c('0xb')](Mustache['render'](_0x493824[_0xee6c('0xa')],_0x327585)):{};}catch(_0x3c2c4c){logger[_0xee6c('0xc')](_0x3c2c4c[_0xee6c('0xd')]);}switch(_0x493824[_0xee6c('0x3')][_0xee6c('0x4')]()){case'GET':case'DELETE':_0x4f8f45=null;_0x1bcc09['qs']=_0x327585;break;case'POST':case'PUT':if(_0x493824[_0xee6c('0xe')]){try{_0x4f8f45=JSON[_0xee6c('0xb')](Mustache[_0xee6c('0x5')](_0x493824[_0xee6c('0xe')],_0x327585));_0x1bcc09['body']=_0x4f8f45;}catch(_0x4967b8){logger[_0xee6c('0xc')](_0x4967b8['stack']);logger[_0xee6c('0xc')](_0xee6c('0xf'));}}else{_0x4f8f45=_0x327585;_0x1bcc09['body']=_0x4f8f45;}break;}logger[_0xee6c('0x10')](util[_0xee6c('0x11')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x493824[_0xee6c('0x3')],_0x493824[_0xee6c('0x6')],JSON[_0xee6c('0x12')](_0x1bcc09)));rp(_0x1bcc09)[_0xee6c('0x13')](function(_0x4c2c08){_0x4f8f45=!_[_0xee6c('0x14')](_0x4f8f45)?',\x20request\x20body:\x20'+_0x4f8f45:'';_0x329da9=typeof _0x4c2c08[_0xee6c('0x15')]===_0xee6c('0x16')?JSON[_0xee6c('0x12')](_0x4c2c08[_0xee6c('0x15')]):_0x4c2c08['body'];logger[_0xee6c('0x10')](util[_0xee6c('0x11')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x493824['data1'],_0x493824[_0xee6c('0x6')],_0x4c2c08['statusCode'],_0x329da9));})[_0xee6c('0x17')](function(_0x7db75a){logger[_0xee6c('0xc')](util[_0xee6c('0x11')](_0xee6c('0x18'),_0x493824[_0xee6c('0x3')],_0x493824[_0xee6c('0x6')],_0x7db75a[_0xee6c('0x19')],_0x7db75a[_0xee6c('0x1a')],_0x7db75a[_0xee6c('0x1b')]));});}; \ No newline at end of file +var _0x8279=['format','%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','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','util','lodash','mustache','../../../../config/logger','trigger','data1','toUpperCase','render','data2','data5','headers','data6','parse','error','GET','POST','PUT','data7','stack','body','info'];(function(_0x3a6b11,_0x274c1e){var _0x149496=function(_0x19bba5){while(--_0x19bba5){_0x3a6b11['push'](_0x3a6b11['shift']());}};_0x149496(++_0x274c1e);}(_0x8279,0xab));var _0x9827=function(_0x2bf00b,_0xc27791){_0x2bf00b=_0x2bf00b-0x0;var _0x1bc255=_0x8279[_0x2bf00b];return _0x1bc255;};'use strict';var rp=require('request-promise');var util=require(_0x9827('0x0'));var _=require(_0x9827('0x1'));var Mustache=require(_0x9827('0x2'));var logger=require(_0x9827('0x3'))(_0x9827('0x4'));exports['exec']=function(_0xa61f80,_0x2c6281){var _0x4d5d97,_0x1e6e56;var _0x4bcb6f={'method':_0xa61f80[_0x9827('0x5')][_0x9827('0x6')](),'uri':Mustache[_0x9827('0x7')](_0xa61f80[_0x9827('0x8')],_0x2c6281),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0xa61f80[_0x9827('0x9')])==='number'&&parseInt(_0xa61f80[_0x9827('0x9')])>=0x1&&parseInt(_0xa61f80['data5'])<=0xa?parseInt(_0xa61f80[_0x9827('0x9')])*0x3e8:0x5*0x3e8};try{_0x4bcb6f[_0x9827('0xa')]=_0xa61f80[_0x9827('0xb')]?JSON[_0x9827('0xc')](Mustache['render'](_0xa61f80[_0x9827('0xb')],_0x2c6281)):{};}catch(_0x3bceb8){logger[_0x9827('0xd')](_0x3bceb8['stack']);}switch(_0xa61f80[_0x9827('0x5')]['toUpperCase']()){case _0x9827('0xe'):case'DELETE':_0x4d5d97=null;_0x4bcb6f['qs']=_0x2c6281;break;case _0x9827('0xf'):case _0x9827('0x10'):if(_0xa61f80[_0x9827('0x11')]){try{_0x4d5d97=JSON[_0x9827('0xc')](Mustache[_0x9827('0x7')](_0xa61f80['data7'],_0x2c6281));_0x4bcb6f['body']=_0x4d5d97;}catch(_0x166d66){logger[_0x9827('0xd')](_0x166d66[_0x9827('0x12')]);logger[_0x9827('0xd')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x4d5d97=_0x2c6281;_0x4bcb6f[_0x9827('0x13')]=_0x4d5d97;}break;}logger[_0x9827('0x14')](util[_0x9827('0x15')](_0x9827('0x16'),_0xa61f80['data1'],_0xa61f80[_0x9827('0x8')],JSON[_0x9827('0x17')](_0x4bcb6f)));rp(_0x4bcb6f)[_0x9827('0x18')](function(_0x1feba5){_0x4d5d97=!_[_0x9827('0x19')](_0x4d5d97)?_0x9827('0x1a')+_0x4d5d97:'';_0x1e6e56=typeof _0x1feba5[_0x9827('0x13')]===_0x9827('0x1b')?JSON[_0x9827('0x17')](_0x1feba5[_0x9827('0x13')]):_0x1feba5[_0x9827('0x13')];logger[_0x9827('0x14')](util[_0x9827('0x15')](_0x9827('0x1c'),_0xa61f80[_0x9827('0x5')],_0xa61f80[_0x9827('0x8')],_0x1feba5['statusCode'],_0x1e6e56));})[_0x9827('0x1d')](function(_0x4f976d){logger[_0x9827('0xd')](util[_0x9827('0x15')](_0x9827('0x1e'),_0xa61f80[_0x9827('0x5')],_0xa61f80['data2'],_0x4f976d[_0x9827('0x1f')],_0x4f976d['name'],_0x4f976d['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 4bc7523..f52157f 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 _0x6482=['message','result','catch','jayson/promise','bluebird','routing','http','Request','request','then','debug','rpc','error'];(function(_0x464059,_0x143e2b){var _0x2ee156=function(_0x39a773){while(--_0x39a773){_0x464059['push'](_0x464059['shift']());}};_0x2ee156(++_0x143e2b);}(_0x6482,0x1ca));var _0x2648=function(_0x5aeb6c,_0x428f4f){_0x5aeb6c=_0x5aeb6c-0x0;var _0x5676b3=_0x6482[_0x5aeb6c];return _0x5676b3;};'use strict';var jayson=require(_0x2648('0x0'));var BPromise=require(_0x2648('0x1'));var logger=require('../../config/logger')(_0x2648('0x2'));var client=jayson['client'][_0x2648('0x3')]({'port':0x2329});client[_0x2648('0x4')]=function(_0x29025d,_0x3db546){return new BPromise(function(_0x5ef978,_0x538302){return client[_0x2648('0x5')](_0x29025d,_0x3db546)[_0x2648('0x6')](function(_0x4e389a){logger[_0x2648('0x7')](_0x2648('0x8'),_0x2648('0x2'),_0x29025d,_0x3db546,_0x4e389a);if(_0x4e389a[_0x2648('0x9')]){logger[_0x2648('0x9')](_0x2648('0x8'),_0x2648('0x2'),_0x29025d,_0x4e389a[_0x2648('0x9')][_0x2648('0xa')],_0x3db546);return _0x538302(_0x4e389a['error'][_0x2648('0xa')]);}else{return _0x5ef978(_0x4e389a[_0x2648('0xb')]);}})[_0x2648('0xc')](function(_0x2f2a2c){logger[_0x2648('0x9')](_0x2648('0x8'),'routing',_0x29025d,_0x2f2a2c,_0x3db546);return _0x538302(_0x2f2a2c);});});};module['exports']=client; \ No newline at end of file +var _0xe452=['request','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','routing','client','http','Request'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xe452,0xcc));var _0x2e45=function(_0x58e124,_0x1fcd8c){_0x58e124=_0x58e124-0x0;var _0x5f3b5d=_0xe452[_0x58e124];return _0x5f3b5d;};'use strict';var jayson=require(_0x2e45('0x0'));var BPromise=require(_0x2e45('0x1'));var logger=require('../../config/logger')(_0x2e45('0x2'));var client=jayson[_0x2e45('0x3')][_0x2e45('0x4')]({'port':0x2329});client[_0x2e45('0x5')]=function(_0x49a077,_0x17ccd3){return new BPromise(function(_0x214b70,_0x56c1f7){return client[_0x2e45('0x6')](_0x49a077,_0x17ccd3)['then'](function(_0x211fb1){logger[_0x2e45('0x7')](_0x2e45('0x8'),_0x2e45('0x2'),_0x49a077,_0x17ccd3,_0x211fb1);if(_0x211fb1['error']){logger[_0x2e45('0x9')]('rpc',_0x2e45('0x2'),_0x49a077,_0x211fb1[_0x2e45('0x9')]['message'],_0x17ccd3);return _0x56c1f7(_0x211fb1[_0x2e45('0x9')][_0x2e45('0xa')]);}else{return _0x214b70(_0x211fb1[_0x2e45('0xb')]);}})[_0x2e45('0xc')](function(_0x399813){logger[_0x2e45('0x9')](_0x2e45('0x8'),'routing',_0x49a077,_0x399813,_0x17ccd3);return _0x56c1f7(_0x399813);});});};module[_0x2e45('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 5b2b9c1..1bc8add 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 _0xc5a1=['Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','loginMailFrequency','catch','error'];(function(_0x2fc530,_0x28412b){var _0x349913=function(_0x5427f6){while(--_0x5427f6){_0x2fc530['push'](_0x2fc530['shift']());}};_0x349913(++_0x28412b);}(_0xc5a1,0x1dd));var _0x1c5a=function(_0x33d4a2,_0x2baaf4){_0x33d4a2=_0x33d4a2-0x0;var _0x2c793f=_0xc5a1[_0x33d4a2];return _0x2c793f;};'use strict';var server=require(_0x1c5a('0x0'));var Realtime=require(_0x1c5a('0x1'));var EmailChannel=require(_0x1c5a('0x2'));var mailAccount=require(_0x1c5a('0x3'));var setting=require(_0x1c5a('0x4'));var logger=require(_0x1c5a('0x5'))(_0x1c5a('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise['resolve']()[_0x1c5a('0x7')](mailAccount[_0x1c5a('0x8')]())[_0x1c5a('0x7')](realtime[_0x1c5a('0x9')]())[_0x1c5a('0x7')](function(){email[_0x1c5a('0xa')](realtime[_0x1c5a('0xb')]);return realtime;});}function main(){return server[_0x1c5a('0xc')](realtime,email)[_0x1c5a('0x7')](function(){return initRealtime();})['then'](function(){return setting['getSettings']();})[_0x1c5a('0x7')](function(_0x3d1db0){return setInterval(initRealtime,_0x3d1db0[_0x1c5a('0xd')]*0x3e8);})[_0x1c5a('0xe')](function(_0x22a3cb){logger[_0x1c5a('0xf')](_0x1c5a('0x10'),_0x22a3cb);});}main(); \ No newline at end of file +var _0x419e=['error','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/setting','../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency'];(function(_0x47b15f,_0x103e93){var _0x55bf25=function(_0x51fe7f){while(--_0x51fe7f){_0x47b15f['push'](_0x47b15f['shift']());}};_0x55bf25(++_0x103e93);}(_0x419e,0x156));var _0xe419=function(_0xd25b59,_0x217f8a){_0xd25b59=_0xd25b59-0x0;var _0x4cab47=_0x419e[_0xd25b59];return _0x4cab47;};'use strict';var server=require(_0xe419('0x0'));var Realtime=require(_0xe419('0x1'));var EmailChannel=require(_0xe419('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0xe419('0x3'));var logger=require(_0xe419('0x4'))(_0xe419('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xe419('0x6')]()[_0xe419('0x7')](mailAccount[_0xe419('0x8')]())[_0xe419('0x7')](realtime[_0xe419('0x9')]())[_0xe419('0x7')](function(){email[_0xe419('0xa')](realtime[_0xe419('0xb')]);return realtime;});}function main(){return server[_0xe419('0xc')](realtime,email)[_0xe419('0x7')](function(){return initRealtime();})['then'](function(){return setting[_0xe419('0xd')]();})['then'](function(_0x217108){return setInterval(initRealtime,_0x217108[_0xe419('0xe')]*0x3e8);})['catch'](function(_0x52d895){logger[_0xe419('0xf')](_0xe419('0x10'),_0x52d895);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 089c918..8421c3a 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 _0x9f28=['status','messageStatus','isNil','refresh','hasOwnProperty','provider','service','email','box','handleImapBox','bind','handleImapEmail','error','handleImapError','disabled','connected','messages','total','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','handleImapEnd','sendMail','send','Smtp','lastSync','verify','verified','catch','exports','lodash','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','defaults','redis','localhost','socket.io-emitter','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap'];(function(_0x169292,_0x8ab021){var _0x1b3e11=function(_0x14a374){while(--_0x14a374){_0x169292['push'](_0x169292['shift']());}};_0x1b3e11(++_0x8ab021);}(_0x9f28,0x1f3));var _0x89f2=function(_0x1f3168,_0x114c5b){_0x1f3168=_0x1f3168-0x0;var _0x29c789=_0x9f28[_0x1f3168];return _0x29c789;};'use strict';var _=require(_0x89f2('0x0'));var moment=require('moment');var BPromise=require(_0x89f2('0x1'));var md5=require(_0x89f2('0x2'));var Redis=require(_0x89f2('0x3'));var config=require(_0x89f2('0x4'));var logger=require(_0x89f2('0x5'))('email');config['redis']=_[_0x89f2('0x6')](config[_0x89f2('0x7')],{'host':_0x89f2('0x8'),'port':0x18eb});var io=require(_0x89f2('0x9'))(new Redis(config[_0x89f2('0x7')]));var EmailImap=require('./imap');var EmailSmtp=require(_0x89f2('0xa'));var mailAccount=require(_0x89f2('0xb'));var md5Accounts={};function EmailChannel(_0x587c4b){logger[_0x89f2('0xc')](_0x89f2('0xd'));this[_0x89f2('0xe')]=_0x587c4b[_0x89f2('0xe')];this[_0x89f2('0xf')]={};this[_0x89f2('0x10')]=new EmailSmtp();}EmailChannel[_0x89f2('0x11')][_0x89f2('0x12')]=function(_0x5e191a){var _0x47e88e=this[_0x89f2('0xe')][_0x5e191a];var _0x592b49={'id':_0x47e88e['id'],'name':_0x47e88e[_0x89f2('0x13')],'key':_0x47e88e[_0x89f2('0x14')],'active':_0x47e88e[_0x89f2('0x15')],'Imap':{'status':_0x47e88e[_0x89f2('0x16')][_0x89f2('0x17')],'messageStatus':_0x47e88e['Imap'][_0x89f2('0x18')],'total':_0x47e88e['Imap']['total']}};if(_[_0x89f2('0x19')](md5Accounts[_0x5e191a])){md5Accounts[_0x5e191a]={};}var _0x723854=md5(JSON['stringify'](_0x592b49));if(md5Accounts[_0x5e191a][_0x89f2('0x2')]!==_0x723854){md5Accounts[_0x5e191a][_0x89f2('0x2')]=_0x723854;io[_0x89f2('0x12')]('mailAccount:update',_0x592b49);}};EmailChannel[_0x89f2('0x11')][_0x89f2('0x1a')]=function(_0x5bfb46){for(var _0x42c89c in _0x5bfb46){if(_0x5bfb46[_0x89f2('0x1b')](_0x42c89c)){if(_0x5bfb46[_0x42c89c][_0x89f2('0x16')]&&_0x5bfb46[_0x42c89c][_0x89f2('0x15')]){var _0x2c292f=_0x5bfb46[_0x42c89c]['Imap'];if(!_0x2c292f['service']&&_0x5bfb46[_0x42c89c][_0x89f2('0x1c')]!=='custom')_0x2c292f[_0x89f2('0x1d')]=_0x5bfb46[_0x42c89c][_0x89f2('0x1c')];if(!this['imapAccounts'][_0x89f2('0x1b')](_0x2c292f['id'])){this['imapAccounts'][_0x2c292f['id']]=new EmailImap(_0x2c292f,_0x5bfb46[_0x42c89c][_0x89f2('0x1e')]);this['imapAccounts'][_0x2c292f['id']]['on'](_0x89f2('0x1f'),this[_0x89f2('0x20')][_0x89f2('0x21')](this,_0x42c89c));this[_0x89f2('0xf')][_0x2c292f['id']]['on'](_0x89f2('0x1e'),this[_0x89f2('0x22')][_0x89f2('0x21')](this,_0x42c89c));this[_0x89f2('0xf')][_0x2c292f['id']]['on']('end',this['handleImapEnd'][_0x89f2('0x21')](this,_0x42c89c));this['imapAccounts'][_0x2c292f['id']]['on'](_0x89f2('0x23'),this[_0x89f2('0x24')][_0x89f2('0x21')](this,_0x42c89c));}}else{if(_[_0x89f2('0x19')](this[_0x89f2('0xe')][_0x42c89c][_0x89f2('0x16')])){this['mailAccounts'][_0x42c89c][_0x89f2('0x16')]={};}this[_0x89f2('0xe')][_0x42c89c][_0x89f2('0x16')][_0x89f2('0x17')]=_0x89f2('0x25');this[_0x89f2('0xe')][_0x42c89c]['Imap'][_0x89f2('0x18')]='';this[_0x89f2('0x12')](_0x42c89c);}}}};EmailChannel[_0x89f2('0x11')][_0x89f2('0x20')]=function(_0x4db248,_0x3cb13c){if(this[_0x89f2('0xe')][_0x4db248]){this[_0x89f2('0xe')][_0x4db248][_0x89f2('0x16')]['status']=_0x89f2('0x26');this[_0x89f2('0xe')][_0x4db248][_0x89f2('0x16')]['messageStatus']=_0x3cb13c[_0x89f2('0x13')];if(_0x3cb13c[_0x89f2('0x27')]){this[_0x89f2('0xe')][_0x4db248]['Imap'][_0x89f2('0x28')]=_0x3cb13c[_0x89f2('0x27')]['total'];}return this[_0x89f2('0x12')](_0x4db248);}};EmailChannel[_0x89f2('0x11')][_0x89f2('0x22')]=function(_0x5694b7,_0x10d1d3){logger[_0x89f2('0xc')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x10d1d3[_0x89f2('0x29')],_0x10d1d3[_0x89f2('0x2a')],_0x10d1d3[_0x89f2('0x2b')],_0x5694b7);if(this[_0x89f2('0xe')][_0x5694b7]){return mailAccount[_0x89f2('0x2c')](_0x5694b7,_0x10d1d3)[_0x89f2('0x2d')](function(_0x14ff3e){if(_0x14ff3e){logger[_0x89f2('0xc')](_0x89f2('0x2e'));}})['catch'](function(_0x3a0867){logger['error'](_0x89f2('0x2f'),JSON[_0x89f2('0x30')](_0x3a0867));});}};EmailChannel[_0x89f2('0x11')][_0x89f2('0x31')]=function(_0x4681a8){if(this[_0x89f2('0xe')][_0x4681a8]&&this['mailAccounts'][_0x4681a8][_0x89f2('0x16')]){if(this[_0x89f2('0xf')][this['mailAccounts'][_0x4681a8]['Imap']['id']]){delete this[_0x89f2('0xf')][this[_0x89f2('0xe')][_0x4681a8][_0x89f2('0x16')]['id']];}this['mailAccounts'][_0x4681a8]['Imap']['lastSync']=moment();this[_0x89f2('0x12')](_0x4681a8);}};EmailChannel['prototype'][_0x89f2('0x24')]=function(_0x49dc93,_0x3950bf){if(this[_0x89f2('0xe')][_0x49dc93]){this[_0x89f2('0xe')][_0x49dc93][_0x89f2('0x16')][_0x89f2('0x17')]='error';this[_0x89f2('0xe')][_0x49dc93][_0x89f2('0x16')][_0x89f2('0x18')]=_0x3950bf;return this[_0x89f2('0x12')](_0x49dc93);}};EmailChannel[_0x89f2('0x11')][_0x89f2('0x32')]=function(_0x47c61f,_0x2a9d1d){return this[_0x89f2('0x10')][_0x89f2('0x33')](_0x47c61f,_0x2a9d1d);};EmailChannel[_0x89f2('0x11')]['verifySmtp']=function(_0x46d4e1){var _0x47c41d=this;if(this['mailAccounts'][_0x46d4e1['id']]){if(_[_0x89f2('0x19')](this[_0x89f2('0xe')][_0x46d4e1['id']][_0x89f2('0x34')])){this[_0x89f2('0xe')][_0x46d4e1['id']][_0x89f2('0x34')]={};}this['mailAccounts'][_0x46d4e1['id']][_0x89f2('0x34')][_0x89f2('0x35')]=moment();return new BPromise(function(_0x240dea,_0x4d33c1){return _0x47c41d[_0x89f2('0x10')][_0x89f2('0x36')](_0x46d4e1)['then'](function(_0x13c560){_0x47c41d[_0x89f2('0xe')][_0x46d4e1['id']][_0x89f2('0x34')][_0x89f2('0x17')]=_0x89f2('0x37');_0x47c41d[_0x89f2('0xe')][_0x46d4e1['id']]['Smtp'][_0x89f2('0x18')]='';_0x47c41d['emit'](_0x46d4e1['id']);_0x240dea(_0x13c560);})[_0x89f2('0x38')](function(_0x4e0ec9){_0x47c41d[_0x89f2('0xe')][_0x46d4e1['id']]['Smtp'][_0x89f2('0x17')]='error';_0x47c41d[_0x89f2('0xe')][_0x46d4e1['id']][_0x89f2('0x34')][_0x89f2('0x18')]=_0x4e0ec9;_0x47c41d[_0x89f2('0x12')](_0x46d4e1['id']);_0x4d33c1(_0x4e0ec9);});});}return this[_0x89f2('0x10')][_0x89f2('0x36')](_0x46d4e1);};module[_0x89f2('0x39')]=EmailChannel; \ No newline at end of file +var _0x2c37=['isNil','disabled','messageStatus','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','from','notify','then','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','smtp','send','verifySmtp','Smtp','verified','verify','exports','lodash','bluebird','md5','ioredis','../../../config/logger','redis','defaults','socket.io-emitter','./imap','./smtp','info','mailAccounts','prototype','emit','name','key','active','Imap','status','total','stringify','mailAccount:update','refresh','hasOwnProperty','service','provider','custom','imapAccounts','email','box','handleImapBox','bind','handleImapEmail','end','error'];(function(_0xe6b826,_0x1c2e60){var _0x41d1e4=function(_0x38a449){while(--_0x38a449){_0xe6b826['push'](_0xe6b826['shift']());}};_0x41d1e4(++_0x1c2e60);}(_0x2c37,0xb9));var _0x72c3=function(_0x440d40,_0x14b603){_0x440d40=_0x440d40-0x0;var _0x24abce=_0x2c37[_0x440d40];return _0x24abce;};'use strict';var _=require(_0x72c3('0x0'));var moment=require('moment');var BPromise=require(_0x72c3('0x1'));var md5=require(_0x72c3('0x2'));var Redis=require(_0x72c3('0x3'));var config=require('../../../config/environment');var logger=require(_0x72c3('0x4'))('email');config[_0x72c3('0x5')]=_[_0x72c3('0x6')](config[_0x72c3('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x72c3('0x7'))(new Redis(config[_0x72c3('0x5')]));var EmailImap=require(_0x72c3('0x8'));var EmailSmtp=require(_0x72c3('0x9'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x547acb){logger[_0x72c3('0xa')]('start\x20email\x20channel');this[_0x72c3('0xb')]=_0x547acb[_0x72c3('0xb')];this['imapAccounts']={};this['smtp']=new EmailSmtp();}EmailChannel[_0x72c3('0xc')][_0x72c3('0xd')]=function(_0x3cbac5){var _0x5f11fa=this['mailAccounts'][_0x3cbac5];var _0x25352c={'id':_0x5f11fa['id'],'name':_0x5f11fa[_0x72c3('0xe')],'key':_0x5f11fa[_0x72c3('0xf')],'active':_0x5f11fa[_0x72c3('0x10')],'Imap':{'status':_0x5f11fa[_0x72c3('0x11')][_0x72c3('0x12')],'messageStatus':_0x5f11fa[_0x72c3('0x11')]['messageStatus'],'total':_0x5f11fa[_0x72c3('0x11')][_0x72c3('0x13')]}};if(_['isNil'](md5Accounts[_0x3cbac5])){md5Accounts[_0x3cbac5]={};}var _0x19af9d=md5(JSON[_0x72c3('0x14')](_0x25352c));if(md5Accounts[_0x3cbac5][_0x72c3('0x2')]!==_0x19af9d){md5Accounts[_0x3cbac5][_0x72c3('0x2')]=_0x19af9d;io['emit'](_0x72c3('0x15'),_0x25352c);}};EmailChannel[_0x72c3('0xc')][_0x72c3('0x16')]=function(_0x4e2bcf){for(var _0x3e46ab in _0x4e2bcf){if(_0x4e2bcf[_0x72c3('0x17')](_0x3e46ab)){if(_0x4e2bcf[_0x3e46ab][_0x72c3('0x11')]&&_0x4e2bcf[_0x3e46ab][_0x72c3('0x10')]){var _0x11121c=_0x4e2bcf[_0x3e46ab][_0x72c3('0x11')];if(!_0x11121c[_0x72c3('0x18')]&&_0x4e2bcf[_0x3e46ab][_0x72c3('0x19')]!==_0x72c3('0x1a'))_0x11121c['service']=_0x4e2bcf[_0x3e46ab][_0x72c3('0x19')];if(!this[_0x72c3('0x1b')]['hasOwnProperty'](_0x11121c['id'])){this[_0x72c3('0x1b')][_0x11121c['id']]=new EmailImap(_0x11121c,_0x4e2bcf[_0x3e46ab][_0x72c3('0x1c')]);this[_0x72c3('0x1b')][_0x11121c['id']]['on'](_0x72c3('0x1d'),this[_0x72c3('0x1e')][_0x72c3('0x1f')](this,_0x3e46ab));this['imapAccounts'][_0x11121c['id']]['on']('email',this[_0x72c3('0x20')][_0x72c3('0x1f')](this,_0x3e46ab));this['imapAccounts'][_0x11121c['id']]['on'](_0x72c3('0x21'),this['handleImapEnd'][_0x72c3('0x1f')](this,_0x3e46ab));this[_0x72c3('0x1b')][_0x11121c['id']]['on'](_0x72c3('0x22'),this['handleImapError'][_0x72c3('0x1f')](this,_0x3e46ab));}}else{if(_[_0x72c3('0x23')](this[_0x72c3('0xb')][_0x3e46ab]['Imap'])){this[_0x72c3('0xb')][_0x3e46ab][_0x72c3('0x11')]={};}this['mailAccounts'][_0x3e46ab][_0x72c3('0x11')][_0x72c3('0x12')]=_0x72c3('0x24');this['mailAccounts'][_0x3e46ab][_0x72c3('0x11')][_0x72c3('0x25')]='';this[_0x72c3('0xd')](_0x3e46ab);}}}};EmailChannel['prototype'][_0x72c3('0x1e')]=function(_0x5aa3a6,_0x1e9c14){if(this[_0x72c3('0xb')][_0x5aa3a6]){this['mailAccounts'][_0x5aa3a6]['Imap'][_0x72c3('0x12')]=_0x72c3('0x26');this[_0x72c3('0xb')][_0x5aa3a6][_0x72c3('0x11')][_0x72c3('0x25')]=_0x1e9c14[_0x72c3('0xe')];if(_0x1e9c14[_0x72c3('0x27')]){this[_0x72c3('0xb')][_0x5aa3a6][_0x72c3('0x11')]['total']=_0x1e9c14[_0x72c3('0x27')][_0x72c3('0x13')];}return this[_0x72c3('0xd')](_0x5aa3a6);}};EmailChannel[_0x72c3('0xc')][_0x72c3('0x20')]=function(_0x4922ad,_0x5a796f){logger[_0x72c3('0xa')](_0x72c3('0x28'),_0x5a796f[_0x72c3('0x29')],_0x5a796f['lastName'],_0x5a796f[_0x72c3('0x2a')],_0x4922ad);if(this['mailAccounts'][_0x4922ad]){return mailAccount[_0x72c3('0x2b')](_0x4922ad,_0x5a796f)[_0x72c3('0x2c')](function(_0x3e7fa2){if(_0x3e7fa2){logger[_0x72c3('0xa')]('Mail\x20accepted\x20from\x20routing');}})[_0x72c3('0x2d')](function(_0x228f88){logger[_0x72c3('0x22')](_0x72c3('0x2e'),JSON[_0x72c3('0x14')](_0x228f88));});}};EmailChannel[_0x72c3('0xc')]['handleImapEnd']=function(_0x328756){if(this[_0x72c3('0xb')][_0x328756]&&this[_0x72c3('0xb')][_0x328756]['Imap']){if(this[_0x72c3('0x1b')][this[_0x72c3('0xb')][_0x328756][_0x72c3('0x11')]['id']]){delete this['imapAccounts'][this[_0x72c3('0xb')][_0x328756][_0x72c3('0x11')]['id']];}this['mailAccounts'][_0x328756][_0x72c3('0x11')][_0x72c3('0x2f')]=moment();this[_0x72c3('0xd')](_0x328756);}};EmailChannel['prototype']['handleImapError']=function(_0x1791d7,_0x3a745d){if(this[_0x72c3('0xb')][_0x1791d7]){this[_0x72c3('0xb')][_0x1791d7][_0x72c3('0x11')][_0x72c3('0x12')]=_0x72c3('0x22');this[_0x72c3('0xb')][_0x1791d7][_0x72c3('0x11')][_0x72c3('0x25')]=_0x3a745d;return this[_0x72c3('0xd')](_0x1791d7);}};EmailChannel['prototype']['sendMail']=function(_0x2ec40c,_0x4557df){return this[_0x72c3('0x30')][_0x72c3('0x31')](_0x2ec40c,_0x4557df);};EmailChannel[_0x72c3('0xc')][_0x72c3('0x32')]=function(_0x5befb7){var _0x239a1a=this;if(this[_0x72c3('0xb')][_0x5befb7['id']]){if(_['isNil'](this[_0x72c3('0xb')][_0x5befb7['id']][_0x72c3('0x33')])){this[_0x72c3('0xb')][_0x5befb7['id']]['Smtp']={};}this['mailAccounts'][_0x5befb7['id']][_0x72c3('0x33')][_0x72c3('0x2f')]=moment();return new BPromise(function(_0x540756,_0x1dfccf){return _0x239a1a[_0x72c3('0x30')]['verify'](_0x5befb7)['then'](function(_0x3b939c){_0x239a1a['mailAccounts'][_0x5befb7['id']]['Smtp'][_0x72c3('0x12')]=_0x72c3('0x34');_0x239a1a[_0x72c3('0xb')][_0x5befb7['id']][_0x72c3('0x33')][_0x72c3('0x25')]='';_0x239a1a['emit'](_0x5befb7['id']);_0x540756(_0x3b939c);})[_0x72c3('0x2d')](function(_0x5ab1b9){_0x239a1a[_0x72c3('0xb')][_0x5befb7['id']]['Smtp'][_0x72c3('0x12')]='error';_0x239a1a['mailAccounts'][_0x5befb7['id']][_0x72c3('0x33')][_0x72c3('0x25')]=_0x5ab1b9;_0x239a1a[_0x72c3('0xd')](_0x5befb7['id']);_0x1dfccf(_0x5ab1b9);});});}return this[_0x72c3('0x30')][_0x72c3('0x35')](_0x5befb7);};module[_0x72c3('0x36')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 018761c..bca6177 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 _0x76b4=['stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','mailparser','simpleParser','iconv','events','EventEmitter','../../../config/logger','mailbox','account','getAccount','once','ready','end','handleEnd','bind','error','inherits','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','email','host','port','tls','autotls','prototype','handleReady','openBox','handleOpenBox','handleError','emit','box','handleCloseBox','search','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser'];(function(_0x690b77,_0x2d71ba){var _0x5eabce=function(_0x5a074e){while(--_0x5a074e){_0x690b77['push'](_0x690b77['shift']());}};_0x5eabce(++_0x2d71ba);}(_0x76b4,0xbc));var _0x476b=function(_0x369c53,_0x3f9eb2){_0x369c53=_0x369c53-0x0;var _0x2c00e2=_0x76b4[_0x369c53];return _0x2c00e2;};'use strict';var _=require(_0x476b('0x0'));var util=require(_0x476b('0x1'));var Imap=require(_0x476b('0x2'));var simpleParser=require(_0x476b('0x3'))[_0x476b('0x4')];var Iconv=require(_0x476b('0x5'))['Iconv'];var EventEmitter=require(_0x476b('0x6'))[_0x476b('0x7')];var utils=require('./utils');var logger=require(_0x476b('0x8'))('email');function EmailImap(_0x4a1773,_0x4e303d){this['mailbox']=_0x4a1773[_0x476b('0x9')];this[_0x476b('0xa')]=this[_0x476b('0xb')](_0x4a1773,_0x4e303d);this[_0x476b('0x2')]=new Imap(this[_0x476b('0xa')]);this[_0x476b('0x2')][_0x476b('0xc')](_0x476b('0xd'),this['handleReady']['bind'](this));this['imap']['once'](_0x476b('0xe'),this[_0x476b('0xf')][_0x476b('0x10')](this));this[_0x476b('0x2')]['on'](_0x476b('0x11'),this['handleError'][_0x476b('0x10')](this));this[_0x476b('0x2')]['connect']();}util[_0x476b('0x12')](EmailImap,EventEmitter);EmailImap['prototype'][_0x476b('0xb')]=function(_0x51e35d,_0xd09f1d){var _0x471c90={'connTimeout':_0x51e35d[_0x476b('0x13')]?_0x51e35d['connTimeout']*0x3e8:0x2710,'authTimeout':_0x51e35d[_0x476b('0x14')]?_0x51e35d[_0x476b('0x14')]*0x3e8:0x1388};if(_0x51e35d[_0x476b('0x15')]){_0x471c90[_0x476b('0x16')]=_0x51e35d[_0x476b('0x16')];if(_0x51e35d[_0x476b('0x17')]){_0x471c90[_0x476b('0x18')]=utils[_0x476b('0x19')](_0x51e35d[_0x476b('0x1a')][_0x476b('0x1b')],_0x51e35d[_0x476b('0x16')]);}else{_0x471c90['password']=_0x51e35d[_0x476b('0x1c')];}}else{if(_0x51e35d['authentication']){_0x471c90[_0x476b('0x16')]=_0x51e35d['user'];_0x471c90['password']=_0x51e35d[_0x476b('0x1c')];}}_0x471c90[_0x476b('0x1d')]=_0xd09f1d||_0x51e35d['user']||'anonymous@xcally.com';_0x471c90[_0x476b('0x1e')]=_0x51e35d[_0x476b('0x1e')];_0x471c90['port']=_0x51e35d[_0x476b('0x1f')]||0x3e1;if(_0x51e35d[_0x476b('0x20')]){_0x471c90[_0x476b('0x20')]=!![];}else{_0x471c90[_0x476b('0x20')]=![];_0x471c90[_0x476b('0x21')]='required';}return _0x471c90;};EmailImap[_0x476b('0x22')][_0x476b('0x23')]=function(){this['imap'][_0x476b('0x24')](this[_0x476b('0x9')],![],this[_0x476b('0x25')][_0x476b('0x10')](this));};EmailImap[_0x476b('0x22')][_0x476b('0x25')]=function(_0x54d336,_0x1e1fd9){if(_0x54d336){this[_0x476b('0x26')](_0x54d336,!![]);}else{this[_0x476b('0x27')](_0x476b('0x28'),_0x1e1fd9);this['readUnseen']();}};EmailImap[_0x476b('0x22')][_0x476b('0x29')]=function(_0x31ca9c){if(_0x31ca9c){this[_0x476b('0x26')](_0x31ca9c,!![]);}else{this['imap'][_0x476b('0xe')]();}};EmailImap[_0x476b('0x22')]['readUnseen']=function(){this['imap'][_0x476b('0x2a')](['UNSEEN'],this[_0x476b('0x2b')]['bind'](this));};EmailImap['prototype']['handleReadUnseen']=function(_0x4ac002,_0xcea74c){if(_0x4ac002){this[_0x476b('0x26')](_0x4ac002,!![]);}else{if(_0xcea74c[_0x476b('0x2c')]){try{var _0x4776e3=this[_0x476b('0x2')][_0x476b('0x2d')](_0xcea74c,{'bodies':'','markSeen':!![]});_0x4776e3['on'](_0x476b('0x2e'),this[_0x476b('0x2f')]['bind'](this));_0x4776e3[_0x476b('0xc')](_0x476b('0x11'),this[_0x476b('0x30')][_0x476b('0x10')](this));_0x4776e3[_0x476b('0xc')](_0x476b('0xe'),this[_0x476b('0x31')][_0x476b('0x10')](this));}catch(_0x593a5c){logger[_0x476b('0x11')](_0x593a5c);}}else{this[_0x476b('0x2')][_0x476b('0x32')](!![],this[_0x476b('0x29')][_0x476b('0x10')](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x46dc41){_0x46dc41['on']('body',this[_0x476b('0x33')][_0x476b('0x10')](this));_0x46dc41[_0x476b('0xc')](_0x476b('0x34'),this[_0x476b('0x35')]['bind'](this));_0x46dc41['once'](_0x476b('0xe'),this['handleMessageEnd'][_0x476b('0x10')](this));};EmailImap['prototype'][_0x476b('0x33')]=function(_0x5d4fa7){simpleParser(_0x5d4fa7,{'Iconv':Iconv},this['handleSimpleParser']['bind'](this));};EmailImap[_0x476b('0x22')][_0x476b('0x35')]=function(){};EmailImap[_0x476b('0x22')][_0x476b('0x36')]=function(){};EmailImap[_0x476b('0x22')][_0x476b('0x37')]=function(_0x54da20,_0x55099e){if(_0x54da20){logger['error'](_0x54da20);}else{var _0x33ab00=this;utils['parser'](this[_0x476b('0xa')],_0x55099e,function(_0x1039c3){_0x33ab00[_0x476b('0x27')](_0x476b('0x1d'),_0x1039c3);});}};EmailImap[_0x476b('0x22')][_0x476b('0x31')]=function(){this[_0x476b('0x2')][_0x476b('0x32')](!![],this[_0x476b('0x29')][_0x476b('0x10')](this));};EmailImap[_0x476b('0x22')][_0x476b('0x30')]=function(_0x13a995){this[_0x476b('0x26')](_0x13a995);this['imap'][_0x476b('0x32')](!![],this[_0x476b('0x29')][_0x476b('0x10')](this));};EmailImap[_0x476b('0x22')][_0x476b('0xf')]=function(){this['emit']('end');};EmailImap[_0x476b('0x22')][_0x476b('0x26')]=function(_0xc43e7f,_0x1e32be){logger[_0x476b('0x11')](_0x476b('0x26'),this[_0x476b('0xa')]['email'],JSON[_0x476b('0x38')](_0xc43e7f));var _0x23e349='';if(_0xc43e7f){if(_0xc43e7f['textCode']){_0x23e349=_0xc43e7f[_0x476b('0x39')];}else{for(var _0x1ac351 in _0xc43e7f){if(_0xc43e7f[_0x476b('0x3a')](_0x1ac351)){_0x23e349+=_[_0x476b('0x3b')](_0x1ac351)+':\x20'+_0xc43e7f[_0x1ac351]+'\x0a';}}}}if(_0x1e32be){this[_0x476b('0x2')][_0x476b('0xe')]();}else{this['emit'](_0x476b('0x11'),_0x23e349);this[_0x476b('0x27')](_0x476b('0xe'));}};module[_0x476b('0x3c')]=EmailImap; \ No newline at end of file +var _0xe62b=['password','authentication','anonymous@xcally.com','host','port','tls','autotls','required','openBox','handleOpenBox','emit','box','readUnseen','search','UNSEEN','handleReadUnseen','fetch','handleFetchMessage','handleFetchEnd','closeBox','handleCloseBox','body','attributes','handleMessageBody','handleSimpleParser','parser','stringify','textCode','upperFirst','exports','lodash','imap','mailparser','simpleParser','iconv','events','EventEmitter','./utils','email','mailbox','account','once','bind','end','handleEnd','error','handleError','connect','inherits','prototype','getAccount','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','data5'];(function(_0x2c15fa,_0x3b91b4){var _0x3727cd=function(_0x1b04e2){while(--_0x1b04e2){_0x2c15fa['push'](_0x2c15fa['shift']());}};_0x3727cd(++_0x3b91b4);}(_0xe62b,0x180));var _0xbe62=function(_0x517ad3,_0x6181f5){_0x517ad3=_0x517ad3-0x0;var _0x4dbff4=_0xe62b[_0x517ad3];return _0x4dbff4;};'use strict';var _=require(_0xbe62('0x0'));var util=require('util');var Imap=require(_0xbe62('0x1'));var simpleParser=require(_0xbe62('0x2'))[_0xbe62('0x3')];var Iconv=require(_0xbe62('0x4'))['Iconv'];var EventEmitter=require(_0xbe62('0x5'))[_0xbe62('0x6')];var utils=require(_0xbe62('0x7'));var logger=require('../../../config/logger')(_0xbe62('0x8'));function EmailImap(_0x163b9c,_0x4afc7a){this[_0xbe62('0x9')]=_0x163b9c['mailbox'];this[_0xbe62('0xa')]=this['getAccount'](_0x163b9c,_0x4afc7a);this[_0xbe62('0x1')]=new Imap(this['account']);this[_0xbe62('0x1')][_0xbe62('0xb')]('ready',this['handleReady'][_0xbe62('0xc')](this));this[_0xbe62('0x1')]['once'](_0xbe62('0xd'),this[_0xbe62('0xe')][_0xbe62('0xc')](this));this[_0xbe62('0x1')]['on'](_0xbe62('0xf'),this[_0xbe62('0x10')][_0xbe62('0xc')](this));this[_0xbe62('0x1')][_0xbe62('0x11')]();}util[_0xbe62('0x12')](EmailImap,EventEmitter);EmailImap[_0xbe62('0x13')][_0xbe62('0x14')]=function(_0xfbd8ce,_0x2d7f68){var _0x4a7af7={'connTimeout':_0xfbd8ce[_0xbe62('0x15')]?_0xfbd8ce[_0xbe62('0x15')]*0x3e8:0x2710,'authTimeout':_0xfbd8ce[_0xbe62('0x16')]?_0xfbd8ce['authTimeout']*0x3e8:0x1388};if(_0xfbd8ce[_0xbe62('0x17')]){_0x4a7af7[_0xbe62('0x18')]=_0xfbd8ce[_0xbe62('0x18')];if(_0xfbd8ce[_0xbe62('0x19')]){_0x4a7af7[_0xbe62('0x1a')]=utils[_0xbe62('0x1b')](_0xfbd8ce['CloudProvider'][_0xbe62('0x1c')],_0xfbd8ce[_0xbe62('0x18')]);}else{_0x4a7af7[_0xbe62('0x1d')]=_0xfbd8ce['password'];}}else{if(_0xfbd8ce[_0xbe62('0x1e')]){_0x4a7af7[_0xbe62('0x18')]=_0xfbd8ce[_0xbe62('0x18')];_0x4a7af7[_0xbe62('0x1d')]=_0xfbd8ce['password'];}}_0x4a7af7['email']=_0x2d7f68||_0xfbd8ce[_0xbe62('0x18')]||_0xbe62('0x1f');_0x4a7af7['host']=_0xfbd8ce[_0xbe62('0x20')];_0x4a7af7[_0xbe62('0x21')]=_0xfbd8ce[_0xbe62('0x21')]||0x3e1;if(_0xfbd8ce[_0xbe62('0x22')]){_0x4a7af7['tls']=!![];}else{_0x4a7af7[_0xbe62('0x22')]=![];_0x4a7af7[_0xbe62('0x23')]=_0xbe62('0x24');}return _0x4a7af7;};EmailImap[_0xbe62('0x13')]['handleReady']=function(){this[_0xbe62('0x1')][_0xbe62('0x25')](this[_0xbe62('0x9')],![],this['handleOpenBox'][_0xbe62('0xc')](this));};EmailImap['prototype'][_0xbe62('0x26')]=function(_0x283dcd,_0x109f3b){if(_0x283dcd){this[_0xbe62('0x10')](_0x283dcd,!![]);}else{this[_0xbe62('0x27')](_0xbe62('0x28'),_0x109f3b);this[_0xbe62('0x29')]();}};EmailImap['prototype']['handleCloseBox']=function(_0x199e30){if(_0x199e30){this['handleError'](_0x199e30,!![]);}else{this['imap'][_0xbe62('0xd')]();}};EmailImap['prototype'][_0xbe62('0x29')]=function(){this['imap'][_0xbe62('0x2a')]([_0xbe62('0x2b')],this[_0xbe62('0x2c')][_0xbe62('0xc')](this));};EmailImap[_0xbe62('0x13')]['handleReadUnseen']=function(_0x1b9e7d,_0x61cb76){if(_0x1b9e7d){this[_0xbe62('0x10')](_0x1b9e7d,!![]);}else{if(_0x61cb76['length']){try{var _0x251d4c=this[_0xbe62('0x1')][_0xbe62('0x2d')](_0x61cb76,{'bodies':'','markSeen':!![]});_0x251d4c['on']('message',this[_0xbe62('0x2e')]['bind'](this));_0x251d4c[_0xbe62('0xb')](_0xbe62('0xf'),this['handleFetchError'][_0xbe62('0xc')](this));_0x251d4c[_0xbe62('0xb')](_0xbe62('0xd'),this[_0xbe62('0x2f')][_0xbe62('0xc')](this));}catch(_0x30c5d3){logger[_0xbe62('0xf')](_0x30c5d3);}}else{this[_0xbe62('0x1')][_0xbe62('0x30')](!![],this[_0xbe62('0x31')]['bind'](this));}}};EmailImap[_0xbe62('0x13')][_0xbe62('0x2e')]=function(_0x4fb8d7){_0x4fb8d7['on'](_0xbe62('0x32'),this['handleMessageBody'][_0xbe62('0xc')](this));_0x4fb8d7['once'](_0xbe62('0x33'),this['handleMessageAttributes'][_0xbe62('0xc')](this));_0x4fb8d7[_0xbe62('0xb')]('end',this['handleMessageEnd']['bind'](this));};EmailImap[_0xbe62('0x13')][_0xbe62('0x34')]=function(_0x553988){simpleParser(_0x553988,{'Iconv':Iconv},this[_0xbe62('0x35')]['bind'](this));};EmailImap[_0xbe62('0x13')]['handleMessageAttributes']=function(){};EmailImap['prototype']['handleMessageEnd']=function(){};EmailImap[_0xbe62('0x13')][_0xbe62('0x35')]=function(_0x58d589,_0x4d7ac9){if(_0x58d589){logger[_0xbe62('0xf')](_0x58d589);}else{var _0x48780c=this;utils[_0xbe62('0x36')](this['account'],_0x4d7ac9,function(_0x5b5be1){_0x48780c['emit']('email',_0x5b5be1);});}};EmailImap[_0xbe62('0x13')][_0xbe62('0x2f')]=function(){this[_0xbe62('0x1')][_0xbe62('0x30')](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0xbe62('0x13')]['handleFetchError']=function(_0x5892cf){this[_0xbe62('0x10')](_0x5892cf);this[_0xbe62('0x1')][_0xbe62('0x30')](!![],this[_0xbe62('0x31')]['bind'](this));};EmailImap[_0xbe62('0x13')]['handleEnd']=function(){this[_0xbe62('0x27')]('end');};EmailImap[_0xbe62('0x13')][_0xbe62('0x10')]=function(_0x4388f1,_0x26b8de){logger['error'](_0xbe62('0x10'),this['account']['email'],JSON[_0xbe62('0x37')](_0x4388f1));var _0x26e425='';if(_0x4388f1){if(_0x4388f1[_0xbe62('0x38')]){_0x26e425=_0x4388f1[_0xbe62('0x38')];}else{for(var _0xc8c331 in _0x4388f1){if(_0x4388f1['hasOwnProperty'](_0xc8c331)){_0x26e425+=_[_0xbe62('0x39')](_0xc8c331)+':\x20'+_0x4388f1[_0xc8c331]+'\x0a';}}}}if(_0x26b8de){this[_0xbe62('0x1')][_0xbe62('0xd')]();}else{this[_0xbe62('0x27')]('error',_0x26e425);this[_0xbe62('0x27')](_0xbe62('0xd'));}};module[_0xbe62('0x3a')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 201b291..8234d5d 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 _0xaea3=['createTransport','use','sendMail','toString','prototype','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64'];(function(_0x3f9138,_0x57aa27){var _0x224d79=function(_0x1aff24){while(--_0x1aff24){_0x3f9138['push'](_0x3f9138['shift']());}};_0x224d79(++_0x57aa27);}(_0xaea3,0x9e));var _0x3aea=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xaea3[_0x14add3];return _0x4a174f;};'use strict';var nodemailer=require(_0x3aea('0x0'));var inlineBase64=require(_0x3aea('0x1'));function EmailSmtp(){}EmailSmtp['prototype']['send']=function(_0x34f6bb,_0x2816ea){return new Promise(function(_0x423445,_0x45e8cf){var _0x41cc11=nodemailer[_0x3aea('0x2')](_0x34f6bb);_0x41cc11[_0x3aea('0x3')]('compile',inlineBase64());_0x41cc11[_0x3aea('0x4')](_0x2816ea,function(_0x5dd325,_0x51062f){if(_0x5dd325){_0x45e8cf(_0x5dd325[_0x3aea('0x5')]());}else{_0x423445(_0x51062f);}});});};EmailSmtp[_0x3aea('0x6')][_0x3aea('0x7')]=function(_0x220c04){return new Promise(function(_0x269763,_0x9927df){var _0xffdc50=nodemailer[_0x3aea('0x2')](_0x220c04);_0xffdc50['verify'](function(_0x36f37b,_0x210ed9){if(_0x36f37b){_0x9927df(_0x36f37b[_0x3aea('0x5')]());}else{if(_0x210ed9){_0x269763(_0x210ed9);}else{_0x9927df(_0x3aea('0x8'));}}});});};module[_0x3aea('0x9')]=EmailSmtp; \ No newline at end of file +var _0x4c37=['toString','prototype','verify','nodemailer','nodemailer-plugin-inline-base64','send','createTransport','use','compile','sendMail'];(function(_0x5447aa,_0x3afc00){var _0xb21e53=function(_0x2d05f6){while(--_0x2d05f6){_0x5447aa['push'](_0x5447aa['shift']());}};_0xb21e53(++_0x3afc00);}(_0x4c37,0x67));var _0x74c3=function(_0x43eace,_0x3a3132){_0x43eace=_0x43eace-0x0;var _0x504ce8=_0x4c37[_0x43eace];return _0x504ce8;};'use strict';var nodemailer=require(_0x74c3('0x0'));var inlineBase64=require(_0x74c3('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0x74c3('0x2')]=function(_0x1eba76,_0x1fbb32){return new Promise(function(_0x67e5bd,_0x34925a){var _0x1df83e=nodemailer[_0x74c3('0x3')](_0x1eba76);_0x1df83e[_0x74c3('0x4')](_0x74c3('0x5'),inlineBase64());_0x1df83e[_0x74c3('0x6')](_0x1fbb32,function(_0x512508,_0x45b04a){if(_0x512508){_0x34925a(_0x512508[_0x74c3('0x7')]());}else{_0x67e5bd(_0x45b04a);}});});};EmailSmtp[_0x74c3('0x8')][_0x74c3('0x9')]=function(_0x4aebf8){return new Promise(function(_0x36ba97,_0x475452){var _0x3ccaac=nodemailer[_0x74c3('0x3')](_0x4aebf8);_0x3ccaac[_0x74c3('0x9')](function(_0x1860a1,_0x401e53){if(_0x1860a1){_0x475452(_0x1860a1['toString']());}else{if(_0x401e53){_0x36ba97(_0x401e53);}else{_0x475452('Not\x20verifired');}}});});};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 dedd1fa..83e3c22 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 _0x2537=['address','anonymous','generate','@xcally.com','name','substring','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','html','replace','\x20[Attachment:\x20','body','Empty\x20message

','Attachments','Title','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','path','util','email','../../../config/environment','head','value'];(function(_0x16b8b5,_0x3729bc){var _0x518ea7=function(_0x4eab01){while(--_0x4eab01){_0x16b8b5['push'](_0x16b8b5['shift']());}};_0x518ea7(++_0x3729bc);}(_0x2537,0xd6));var _0x7253=function(_0x23f720,_0x5dba43){_0x23f720=_0x23f720-0x0;var _0x190f8f=_0x2537[_0x23f720];return _0x190f8f;};'use strict';var _=require(_0x7253('0x0'));var moment=require(_0x7253('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x7253('0x2'));var util=require(_0x7253('0x3'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0x7253('0x4'));var config=require(_0x7253('0x5'));function getAddress(_0x16f514){var _0x4d8b4f=_[_0x7253('0x6')](_0x16f514[_0x7253('0x7')]);return _0x4d8b4f&&_0x4d8b4f[_0x7253('0x8')]?_0x4d8b4f[_0x7253('0x8')]:_0x7253('0x9')+random[_0x7253('0xa')](0x6)+_0x7253('0xb');}function getFirstName(_0x3495fd){var _0x3f7c9b=_['head'](_0x3495fd['value']);if(_0x3f7c9b&&_0x3f7c9b[_0x7253('0xc')]){if(_0x3f7c9b[_0x7253('0xc')]==_0x3f7c9b[_0x7253('0x8')]){return _0x3f7c9b[_0x7253('0xc')][_0x7253('0xd')](0x0,_0x3f7c9b['name'][_0x7253('0xe')]('@'));}var _0x28fd00=_0x3f7c9b[_0x7253('0xc')][_0x7253('0xf')](/\s+/);return _0x28fd00[_0x7253('0x10')]>0x1?_0x28fd00[_0x7253('0x11')](0x0,-0x1)[_0x7253('0x12')]('\x20'):_0x3f7c9b[_0x7253('0xc')];}return _0x7253('0x13');}function getLastName(_0x35fa83){var _0x29fc81=_[_0x7253('0x6')](_0x35fa83[_0x7253('0x7')]);if(_0x29fc81&&_0x29fc81[_0x7253('0xc')]){var _0x4c8e74=_0x29fc81[_0x7253('0xc')][_0x7253('0xf')](/\s+/);return _0x4c8e74['length']>0x1?_0x4c8e74[_0x7253('0x14')]():'';}return'';}function getMails(_0xfbd258,_0x5a321e){var _0x37dc9c='';for(var _0xa46013=0x0;_0xa46013<_0x5a321e[_0x7253('0x7')][_0x7253('0x10')];_0xa46013+=0x1){if(_0x5a321e[_0x7253('0x7')][_0xa46013][_0x7253('0x8')]!==_0xfbd258){if(!_[_0x7253('0x15')](_0x37dc9c)){_0x37dc9c+=',';}_0x37dc9c+=_0x5a321e[_0x7253('0x7')][_0xa46013][_0x7253('0xc')]||_0x5a321e[_0x7253('0x7')][_0xa46013]['address']||'';_0x37dc9c+='\x20<';_0x37dc9c+=_0x5a321e['value'][_0xa46013][_0x7253('0x8')]?_0x5a321e['value'][_0xa46013][_0x7253('0x8')]:_0x7253('0x9')+random['generate'](0x6)+_0x7253('0xb');_0x37dc9c+='>';}}return _0x37dc9c;}function parseEmail(_0x14a35c,_0x55e683,_0x3d8cf4){if(_0x55e683[_0x7253('0x16')]){var _0x307988=/)<[^<]*)*<\/script>/gi;while(_0x307988['test'](_0x55e683['html'])){_0x55e683[_0x7253('0x16')]=_0x55e683[_0x7253('0x16')][_0x7253('0x17')](_0x307988,'');}if(_0x55e683[_0x7253('0x16')]['includes'](_0x7253('0x18'))){var _0x11bcf6=[];_0x55e683[_0x7253('0x19')][_0x7253('0x1a')](_0x476284=>{_0x11bcf6[_0x7253('0x1b')](_0x476284[_0x7253('0x1c')]);});var _0x5c4f4=/]+>/g;var _0x599c57=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x9ab152=_0x55e683[_0x7253('0x16')][_0x7253('0x17')](_0x599c57,'_SRC');var _0x28f5e1=_0x9ab152['replace'](_0x5c4f4,_0x7253('0x1d'));for(let _0x496a60=0x0;_0x496a60<_0x11bcf6[_0x7253('0x10')];_0x496a60++){var _0x4a91bc=_0x28f5e1[_0x7253('0x17')]('_IMG',_0x7253('0x1e')+_0x11bcf6[_0x496a60]+'\x20]');_0x28f5e1=_0x4a91bc;}_0x55e683[_0x7253('0x16')]=_0x28f5e1;}_0x3d8cf4[_0x7253('0x1f')]=_0x55e683[_0x7253('0x16')];}else{_0x3d8cf4[_0x7253('0x1f')]=_0x55e683['textAsHtml'];}if(_0x3d8cf4[_0x7253('0x1f')]){_0x3d8cf4[_0x7253('0x1f')]=_0x3d8cf4[_0x7253('0x1f')]['replace'](/0x0){var _0x1f0984=[_0x7253('0x31'),_0x7253('0x32'),_0x7253('0x33')];for(var _0x3566fe=0x0;_0x3566fe<_0x55e683[_0x7253('0x34')]['length'];_0x3566fe++){var _0x400bf8=_[_0x7253('0xe')](_0x1f0984,_0x55e683[_0x7253('0x34')][_0x3566fe][_0x7253('0x35')]);if(_0x400bf8>=0x0){_0x3d8cf4[_0x7253('0x36')]=!![];}}}return _0x3d8cf4;}exports[_0x7253('0x37')]=function(_0x4b8990,_0x275bdb,_0x190bd9){var _0x34f9b4={'from':getAddress(_0x275bdb[_0x7253('0x38')]),'firstName':getFirstName(_0x275bdb[_0x7253('0x38')]),'lastName':getLastName(_0x275bdb['from']),'mapKey':_0x7253('0x4'),'message':{'from':getMails(_0x4b8990[_0x7253('0x4')],_0x275bdb[_0x7253('0x38')]),'to':_0x4b8990[_0x7253('0x4')],'cc':'','subject':_0x275bdb['subject']||'','messageId':_0x275bdb[_0x7253('0x39')],'inReplyTo':_0x275bdb[_0x7253('0x3a')],'sentAt':moment(_0x275bdb[_0x7253('0x3b')])[_0x7253('0x2a')](_0x7253('0x3c')),'attach':![],'attachments':[]}};if(!_0x275bdb[_0x7253('0x16')]&&!_0x275bdb[_0x7253('0x3d')]){var _0x3993a1=_[_0x7253('0x3e')](_0x275bdb[_0x7253('0x19')],{'contentType':_0x7253('0x3f')});if(_0x3993a1[_0x7253('0x10')]){logger[_0x7253('0x40')](util[_0x7253('0x2a')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x275bdb[_0x7253('0x39')]));tnef[_0x7253('0x41')](_[_0x7253('0x42')](_0x3993a1)[_0x7253('0x2f')],function(_0xfaf89b,_0x10e984){if(_0x10e984){_0x275bdb[_0x7253('0x16')]=_0x10e984['BodyHTML']||_0x7253('0x43');if(_0x10e984[_0x7253('0x44')]){for(var _0x5b70e6=0x0;_0x5b70e6<_0x10e984[_0x7253('0x44')][_0x7253('0x10')];_0x5b70e6++){var _0x2d1cc3=_0x10e984['Attachments'][_0x5b70e6];_0x34f9b4[_0x7253('0x21')][_0x7253('0x19')][_0x7253('0x1b')]({'filename':_0x2d1cc3[_0x7253('0x45')],'content':Buffer[_0x7253('0x38')](_0x2d1cc3['Data'])});}}}_0x190bd9(parseEmail(_0x4b8990,_0x275bdb,_0x34f9b4));});}else{_0x275bdb['html']=_0x7253('0x43');_0x190bd9(parseEmail(_0x4b8990,_0x275bdb,_0x34f9b4));}}else{_0x190bd9(parseEmail(_0x4b8990,_0x275bdb,_0x34f9b4));}};exports['generateXOAuth2Token']=function(_0x3a7868,_0x2c0b8c){var _0x220d31=['user='+(_0x2c0b8c||''),_0x7253('0x46')+_0x3a7868,'',''];return Buffer[_0x7253('0x38')](_0x220d31[_0x7253('0x12')](''),_0x7253('0x47'))[_0x7253('0x48')](_0x7253('0x49'));}; \ No newline at end of file +var _0x1aa0=['format','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','

Empty\x20message

','Attachments','push','Title','Data','user=','auth=Bearer\x20','utf-8','toString','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','../../../config/environment','head','value','address','anonymous','@xcally.com','name','substring','indexOf','split','length','slice','Anonymous','pop','isEmpty','html','test','includes','\x20[Attachment:\x20','\x20]','body','textAsHtml','originTo','message','originCc','email','bcc','attach','type','attachment-','%s-%s','now','join','root','writeFileSync','content','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject','messageId','date'];(function(_0x1a7846,_0x59723e){var _0x48049=function(_0x203ff6){while(--_0x203ff6){_0x1a7846['push'](_0x1a7846['shift']());}};_0x48049(++_0x59723e);}(_0x1aa0,0xff));var _0x01aa=function(_0x1551af,_0x5223c3){_0x1551af=_0x1551af-0x0;var _0xd8eb82=_0x1aa0[_0x1551af];return _0xd8eb82;};'use strict';var _=require(_0x01aa('0x0'));var moment=require(_0x01aa('0x1'));var random=require(_0x01aa('0x2'));var fs=require('fs');var path=require(_0x01aa('0x3'));var util=require(_0x01aa('0x4'));var tnef=require(_0x01aa('0x5'));var logger=require(_0x01aa('0x6'))('email');var config=require(_0x01aa('0x7'));function getAddress(_0x29873c){var _0x473024=_[_0x01aa('0x8')](_0x29873c[_0x01aa('0x9')]);return _0x473024&&_0x473024[_0x01aa('0xa')]?_0x473024[_0x01aa('0xa')]:_0x01aa('0xb')+random['generate'](0x6)+_0x01aa('0xc');}function getFirstName(_0x275cda){var _0x5ec8ed=_[_0x01aa('0x8')](_0x275cda['value']);if(_0x5ec8ed&&_0x5ec8ed[_0x01aa('0xd')]){if(_0x5ec8ed[_0x01aa('0xd')]==_0x5ec8ed[_0x01aa('0xa')]){return _0x5ec8ed[_0x01aa('0xd')][_0x01aa('0xe')](0x0,_0x5ec8ed['name'][_0x01aa('0xf')]('@'));}var _0x56ed32=_0x5ec8ed[_0x01aa('0xd')][_0x01aa('0x10')](/\s+/);return _0x56ed32[_0x01aa('0x11')]>0x1?_0x56ed32[_0x01aa('0x12')](0x0,-0x1)['join']('\x20'):_0x5ec8ed[_0x01aa('0xd')];}return _0x01aa('0x13');}function getLastName(_0x3d7085){var _0x2f1f62=_[_0x01aa('0x8')](_0x3d7085[_0x01aa('0x9')]);if(_0x2f1f62&&_0x2f1f62[_0x01aa('0xd')]){var _0x2c6c65=_0x2f1f62[_0x01aa('0xd')]['split'](/\s+/);return _0x2c6c65[_0x01aa('0x11')]>0x1?_0x2c6c65[_0x01aa('0x14')]():'';}return'';}function getMails(_0x20ad9e,_0x2babe9){var _0x21785f='';for(var _0x579b1a=0x0;_0x579b1a<_0x2babe9['value']['length'];_0x579b1a+=0x1){if(_0x2babe9[_0x01aa('0x9')][_0x579b1a][_0x01aa('0xa')]!==_0x20ad9e){if(!_[_0x01aa('0x15')](_0x21785f)){_0x21785f+=',';}_0x21785f+=_0x2babe9['value'][_0x579b1a][_0x01aa('0xd')]||_0x2babe9[_0x01aa('0x9')][_0x579b1a][_0x01aa('0xa')]||'';_0x21785f+='\x20<';_0x21785f+=_0x2babe9[_0x01aa('0x9')][_0x579b1a]['address']?_0x2babe9[_0x01aa('0x9')][_0x579b1a][_0x01aa('0xa')]:_0x01aa('0xb')+random['generate'](0x6)+_0x01aa('0xc');_0x21785f+='>';}}return _0x21785f;}function parseEmail(_0x5e237a,_0x153b41,_0x28a85c){if(_0x153b41[_0x01aa('0x16')]){var _0x174346=/)<[^<]*)*<\/script>/gi;while(_0x174346[_0x01aa('0x17')](_0x153b41[_0x01aa('0x16')])){_0x153b41[_0x01aa('0x16')]=_0x153b41['html']['replace'](_0x174346,'');}if(_0x153b41[_0x01aa('0x16')][_0x01aa('0x18')](_0x01aa('0x19'))){var _0xee7b8e=[];_0x153b41[_0x01aa('0x1a')][_0x01aa('0x1b')](_0x489608=>{_0xee7b8e['push'](_0x489608[_0x01aa('0x1c')]);});var _0x26ca28=/]+>/g;var _0x8f10fd=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x19e65f=_0x153b41[_0x01aa('0x16')]['replace'](_0x8f10fd,_0x01aa('0x1d'));var _0x487de6=_0x19e65f[_0x01aa('0x1e')](_0x26ca28,_0x01aa('0x1f'));for(let _0x32008f=0x0;_0x32008f<_0xee7b8e[_0x01aa('0x11')];_0x32008f++){var _0x1eeba1=_0x487de6['replace'](_0x01aa('0x1f'),_0x01aa('0x20')+_0xee7b8e[_0x32008f]+_0x01aa('0x21'));_0x487de6=_0x1eeba1;}_0x153b41[_0x01aa('0x16')]=_0x487de6;}_0x28a85c[_0x01aa('0x22')]=_0x153b41['html'];}else{_0x28a85c[_0x01aa('0x22')]=_0x153b41[_0x01aa('0x23')];}if(_0x28a85c[_0x01aa('0x22')]){_0x28a85c[_0x01aa('0x22')]=_0x28a85c[_0x01aa('0x22')][_0x01aa('0x1e')](/0x0){var _0x50e4a9=[_0x01aa('0x33'),_0x01aa('0x34'),_0x01aa('0x35')];for(var _0x5acc63=0x0;_0x5acc63<_0x153b41['headerLines']['length'];_0x5acc63++){var _0x2126d7=_['indexOf'](_0x50e4a9,_0x153b41[_0x01aa('0x32')][_0x5acc63][_0x01aa('0x36')]);if(_0x2126d7>=0x0){_0x28a85c[_0x01aa('0x37')]=!![];}}}return _0x28a85c;}exports[_0x01aa('0x38')]=function(_0xb7c26c,_0x5c7ccc,_0x3e3e1b){var _0x25a85a={'from':getAddress(_0x5c7ccc[_0x01aa('0x39')]),'firstName':getFirstName(_0x5c7ccc['from']),'lastName':getLastName(_0x5c7ccc[_0x01aa('0x39')]),'mapKey':_0x01aa('0x27'),'message':{'from':getMails(_0xb7c26c[_0x01aa('0x27')],_0x5c7ccc[_0x01aa('0x39')]),'to':_0xb7c26c[_0x01aa('0x27')],'cc':'','subject':_0x5c7ccc[_0x01aa('0x3a')]||'','messageId':_0x5c7ccc[_0x01aa('0x3b')],'inReplyTo':_0x5c7ccc['inReplyTo'],'sentAt':moment(_0x5c7ccc[_0x01aa('0x3c')])[_0x01aa('0x3d')](_0x01aa('0x3e')),'attach':![],'attachments':[]}};if(!_0x5c7ccc[_0x01aa('0x16')]&&!_0x5c7ccc[_0x01aa('0x23')]){var _0x4bd9c5=_[_0x01aa('0x3f')](_0x5c7ccc[_0x01aa('0x1a')],{'contentType':_0x01aa('0x40')});if(_0x4bd9c5[_0x01aa('0x11')]){logger[_0x01aa('0x41')](util['format'](_0x01aa('0x42'),_0x5c7ccc[_0x01aa('0x3b')]));tnef[_0x01aa('0x43')](_[_0x01aa('0x44')](_0x4bd9c5)[_0x01aa('0x31')],function(_0x5f5571,_0x287348){if(_0x287348){_0x5c7ccc[_0x01aa('0x16')]=_0x287348['BodyHTML']||_0x01aa('0x45');if(_0x287348[_0x01aa('0x46')]){for(var _0x263ca5=0x0;_0x263ca5<_0x287348[_0x01aa('0x46')]['length'];_0x263ca5++){var _0x34f0ec=_0x287348[_0x01aa('0x46')][_0x263ca5];_0x25a85a[_0x01aa('0x25')][_0x01aa('0x1a')][_0x01aa('0x47')]({'filename':_0x34f0ec[_0x01aa('0x48')],'content':Buffer['from'](_0x34f0ec[_0x01aa('0x49')])});}}}_0x3e3e1b(parseEmail(_0xb7c26c,_0x5c7ccc,_0x25a85a));});}else{_0x5c7ccc[_0x01aa('0x16')]=_0x01aa('0x45');_0x3e3e1b(parseEmail(_0xb7c26c,_0x5c7ccc,_0x25a85a));}}else{_0x3e3e1b(parseEmail(_0xb7c26c,_0x5c7ccc,_0x25a85a));}};exports['generateXOAuth2Token']=function(_0x3e7878,_0x21f946){var _0x74b068=[_0x01aa('0x4a')+(_0x21f946||''),_0x01aa('0x4b')+_0x3e7878,'',''];return Buffer['from'](_0x74b068['join'](''),_0x01aa('0x4c'))[_0x01aa('0x4d')](_0x01aa('0x4e'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index c3e8b51..6b36aef 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 _0x5496=['SERV','active','Imap','Smtp','exports','name','Service','key'];(function(_0x428045,_0x57b6b6){var _0x5523a0=function(_0x4d4b96){while(--_0x4d4b96){_0x428045['push'](_0x428045['shift']());}};_0x5523a0(++_0x57b6b6);}(_0x5496,0x1bd));var _0x6549=function(_0xf30e20,_0xc30d5e){_0xf30e20=_0xf30e20-0x0;var _0xafd38c=_0x5496[_0xf30e20];return _0xafd38c;};'use strict';var _=require('lodash');function MailAccount(_0xc28781){this['id']=_0xc28781['id']||0x0;this[_0x6549('0x0')]=_0xc28781[_0x6549('0x0')]||_0x6549('0x1');this[_0x6549('0x2')]=_0xc28781[_0x6549('0x2')]||_0x6549('0x3');this['active']=_0xc28781[_0x6549('0x4')]||![];this[_0x6549('0x5')]=_0xc28781[_0x6549('0x5')]||[];this[_0x6549('0x6')]=_0xc28781[_0x6549('0x6')]||[];}module[_0x6549('0x7')]=MailAccount; \ No newline at end of file +var _0x0a7d=['name','Service','key','SERV','active','Imap','Smtp','lodash'];(function(_0x5c25ed,_0x270687){var _0x350217=function(_0x9e7dcc){while(--_0x9e7dcc){_0x5c25ed['push'](_0x5c25ed['shift']());}};_0x350217(++_0x270687);}(_0x0a7d,0x107));var _0xd0a7=function(_0xd1b4d7,_0x28b2c1){_0xd1b4d7=_0xd1b4d7-0x0;var _0x3002ec=_0x0a7d[_0xd1b4d7];return _0x3002ec;};'use strict';var _=require(_0xd0a7('0x0'));function MailAccount(_0x3f44ca){this['id']=_0x3f44ca['id']||0x0;this[_0xd0a7('0x1')]=_0x3f44ca['name']||_0xd0a7('0x2');this[_0xd0a7('0x3')]=_0x3f44ca[_0xd0a7('0x3')]||_0xd0a7('0x4');this[_0xd0a7('0x5')]=_0x3f44ca['active']||![];this['Imap']=_0x3f44ca[_0xd0a7('0x6')]||[];this[_0xd0a7('0x7')]=_0x3f44ca[_0xd0a7('0x7')]||[];}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 dba472b..5e4c0d3 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 _0x4d41=['hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','mailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount','mapKeys'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x4d41,0x8d));var _0x14d4=function(_0x2deb15,_0x102a17){_0x2deb15=_0x2deb15-0x0;var _0x1abb33=_0x4d41[_0x2deb15];return _0x1abb33;};'use strict';var _=require(_0x14d4('0x0'));var MailAccount=require(_0x14d4('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x7b925e,_0x158806,_0xe229ce){var _0x9e8bc9=_[_0x14d4('0x2')](_0x7b925e,function(_0x2ee01b,_0x1a1738){return _0x2ee01b[_0xe229ce];});for(var _0x3595c7 in _0x158806){if(_0x158806[_0x14d4('0x3')](_0x3595c7)){if(!_0x9e8bc9[_0x3595c7]){delete _0x158806[_0x3595c7];}}}}Realtime[_0x14d4('0x4')][_0x14d4('0x5')]=function(_0x40addc,_0x58bd1b){for(var _0xcc8130 in _0x58bd1b){if(_0x40addc['hasOwnProperty'](_0xcc8130)){_0x40addc[_0xcc8130]=_0x58bd1b[_0xcc8130];}}};Realtime[_0x14d4('0x4')][_0x14d4('0x6')]=function(){var _0x458a9e=this;return function(_0x465f9d){if(_0x465f9d){freeIsNotKey(_0x465f9d,_0x458a9e[_0x14d4('0x7')],'id');for(var _0x4d352d=0x0,_0x36a88d={},_0x151e0f={};_0x4d352d<_0x465f9d[_0x14d4('0x8')];_0x4d352d+=0x1){_0x36a88d=_0x465f9d[_0x4d352d];if(_[_0x14d4('0x9')](_0x458a9e[_0x14d4('0x7')][_0x36a88d['id']])){_0x458a9e['mailAccounts'][_0x36a88d['id']]=new MailAccount(_0x36a88d);}else{_[_0x14d4('0xa')](_0x458a9e['mailAccounts'][_0x36a88d['id']],_0x36a88d);}}}return _0x458a9e[_0x14d4('0x7')];};};module[_0x14d4('0xb')]=Realtime; \ No newline at end of file +var _0xceab=['hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','../model/mailAccount','mailAccounts','mapKeys'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xceab,0x19b));var _0xbcea=function(_0x4e0425,_0x543b2f){_0x4e0425=_0x4e0425-0x0;var _0x1cc28f=_0xceab[_0x4e0425];return _0x1cc28f;};'use strict';var _=require('lodash');var MailAccount=require(_0xbcea('0x0'));var Realtime=function(){this[_0xbcea('0x1')]={};};function freeIsNotKey(_0xf5bb1c,_0xa71e28,_0x49dcb3){var _0x2cb304=_[_0xbcea('0x2')](_0xf5bb1c,function(_0x4a409d,_0x1cf26d){return _0x4a409d[_0x49dcb3];});for(var _0x14411e in _0xa71e28){if(_0xa71e28[_0xbcea('0x3')](_0x14411e)){if(!_0x2cb304[_0x14411e]){delete _0xa71e28[_0x14411e];}}}}Realtime[_0xbcea('0x4')][_0xbcea('0x5')]=function(_0x55af33,_0x246115){for(var _0x5e7729 in _0x246115){if(_0x55af33['hasOwnProperty'](_0x5e7729)){_0x55af33[_0x5e7729]=_0x246115[_0x5e7729];}}};Realtime[_0xbcea('0x4')][_0xbcea('0x6')]=function(){var _0x8e2387=this;return function(_0x611137){if(_0x611137){freeIsNotKey(_0x611137,_0x8e2387['mailAccounts'],'id');for(var _0xb7abb=0x0,_0x2b14f5={},_0x1c4018={};_0xb7abb<_0x611137[_0xbcea('0x7')];_0xb7abb+=0x1){_0x2b14f5=_0x611137[_0xb7abb];if(_[_0xbcea('0x8')](_0x8e2387[_0xbcea('0x1')][_0x2b14f5['id']])){_0x8e2387['mailAccounts'][_0x2b14f5['id']]=new MailAccount(_0x2b14f5);}else{_['merge'](_0x8e2387['mailAccounts'][_0x2b14f5['id']],_0x2b14f5);}}}return _0x8e2387[_0xbcea('0x1')];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 2f1ccbe..535b7d5 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 _0x1fcc=['Imap','data5','CloudProvider','Smtp','getMailAccount','notify','Request','NotifyMailAccount','../client','getMailAccounts','GetMailAccount','name','provider','service','email','active','key','TemplateId','MailServerIn'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1fcc,0x125));var _0xc1fc=function(_0x15e6fe,_0x1a5c39){_0x15e6fe=_0x15e6fe-0x0;var _0x34894d=_0x1fcc[_0x15e6fe];return _0x34894d;};'use strict';var client=require(_0xc1fc('0x0'));exports[_0xc1fc('0x1')]=function(){return function(){return client['Request'](_0xc1fc('0x2'),{'options':{'attributes':['id',_0xc1fc('0x3'),_0xc1fc('0x4'),_0xc1fc('0x5'),_0xc1fc('0x6'),_0xc1fc('0x7'),_0xc1fc('0x8'),'ListId',_0xc1fc('0x9')],'raw':![],'include':[{'model':_0xc1fc('0xa'),'as':_0xc1fc('0xb'),'include':[{'model':'CloudProvider','attributes':['id',_0xc1fc('0x3'),_0xc1fc('0x5'),'type',_0xc1fc('0xc')],'as':_0xc1fc('0xd')}]},{'model':'MailServerOut','as':_0xc1fc('0xe'),'include':[{'model':'CloudProvider','attributes':['id',_0xc1fc('0x3'),_0xc1fc('0x5'),'type',_0xc1fc('0xc')],'as':_0xc1fc('0xd')}]}]},'log':_0xc1fc('0xf')});};};exports[_0xc1fc('0x10')]=function(_0x62369d,_0x5b7fb2){return client[_0xc1fc('0x11')](_0xc1fc('0x12'),{'account':{'id':_0x62369d},'body':_0x5b7fb2,'log':_0xc1fc('0x12')});}; \ No newline at end of file +var _0x46cb=['getMailAccounts','Request','GetMailAccount','provider','service','email','active','ListId','TemplateId','MailServerIn','CloudProvider','type','MailServerOut','Smtp','name','getMailAccount','notify','NotifyMailAccount','../client'];(function(_0x221a11,_0x6eddb3){var _0x5b4779=function(_0x34ab09){while(--_0x34ab09){_0x221a11['push'](_0x221a11['shift']());}};_0x5b4779(++_0x6eddb3);}(_0x46cb,0x84));var _0xb46c=function(_0x1c413e,_0x51788b){_0x1c413e=_0x1c413e-0x0;var _0x1d8309=_0x46cb[_0x1c413e];return _0x1d8309;};'use strict';var client=require(_0xb46c('0x0'));exports[_0xb46c('0x1')]=function(){return function(){return client[_0xb46c('0x2')](_0xb46c('0x3'),{'options':{'attributes':['id','name',_0xb46c('0x4'),_0xb46c('0x5'),_0xb46c('0x6'),_0xb46c('0x7'),'key',_0xb46c('0x8'),_0xb46c('0x9')],'raw':![],'include':[{'model':_0xb46c('0xa'),'as':'Imap','include':[{'model':_0xb46c('0xb'),'attributes':['id','name',_0xb46c('0x5'),_0xb46c('0xc'),'data5'],'as':'CloudProvider'}]},{'model':_0xb46c('0xd'),'as':_0xb46c('0xe'),'include':[{'model':_0xb46c('0xb'),'attributes':['id',_0xb46c('0xf'),_0xb46c('0x5'),_0xb46c('0xc'),'data5'],'as':_0xb46c('0xb')}]}]},'log':_0xb46c('0x10')});};};exports[_0xb46c('0x11')]=function(_0x2c288d,_0x5b69e2){return client[_0xb46c('0x2')](_0xb46c('0x12'),{'account':{'id':_0x2c288d},'body':_0x5b69e2,'log':_0xb46c('0x12')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 5e94bdc..98177aa 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 _0xed04=['../client','getSettings','Request','ShowSetting','loginMailFrequency','GetSettings'];(function(_0x2f0006,_0x4611e4){var _0x409bb5=function(_0x3cc71d){while(--_0x3cc71d){_0x2f0006['push'](_0x2f0006['shift']());}};_0x409bb5(++_0x4611e4);}(_0xed04,0x1da));var _0x4ed0=function(_0x13c31b,_0x1b8e10){_0x13c31b=_0x13c31b-0x0;var _0x167375=_0xed04[_0x13c31b];return _0x167375;};'use strict';var client=require(_0x4ed0('0x0'));exports[_0x4ed0('0x1')]=function(){return client[_0x4ed0('0x2')](_0x4ed0('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x4ed0('0x4')]},'log':_0x4ed0('0x5')});}; \ No newline at end of file +var _0x209f=['Request','loginMailFrequency','GetSettings','../client','getSettings'];(function(_0x31061a,_0x5ab647){var _0x48d92a=function(_0x421130){while(--_0x421130){_0x31061a['push'](_0x31061a['shift']());}};_0x48d92a(++_0x5ab647);}(_0x209f,0xfd));var _0xf209=function(_0x3f074b,_0x4219c9){_0x3f074b=_0x3f074b-0x0;var _0x200812=_0x209f[_0x3f074b];return _0x200812;};'use strict';var client=require(_0xf209('0x0'));exports[_0xf209('0x1')]=function(){return client[_0xf209('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xf209('0x3')]},'log':_0xf209('0x4')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 7046792..55c69d1 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(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 1fa8c4f..da1c3a2 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 _0xcb0a=['lodash','http','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','defaults','redis','localhost','adapter','socket.io-redis','../../config/triggers','../../config/socketio','default','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!'];(function(_0x41f429,_0x5e8560){var _0x122a59=function(_0x453a89){while(--_0x453a89){_0x41f429['push'](_0x41f429['shift']());}};_0x122a59(++_0x5e8560);}(_0xcb0a,0x1a9));var _0xacb0=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xcb0a[_0x465028];return _0xb783d4;};'use strict';var _=require(_0xacb0('0x0'));var http=require(_0xacb0('0x1'));var express=require('express');var sticky=require(_0xacb0('0x2'));var Redis=require(_0xacb0('0x3'));var config=require(_0xacb0('0x4'));var app=express();var server=http[_0xacb0('0x5')](app);server[_0xacb0('0x6')]=0xdbba0;if(sticky[_0xacb0('0x7')](server,config[_0xacb0('0x8')])){var socketio=require(_0xacb0('0x9'))(server,{'transports':[_0xacb0('0xa'),'polling']});config['redis']=_[_0xacb0('0xb')](config[_0xacb0('0xc')],{'host':_0xacb0('0xd'),'port':0x18eb});socketio[_0xacb0('0xe')](require(_0xacb0('0xf'))({'pubClient':new Redis(config[_0xacb0('0xc')]),'subClient':new Redis(config[_0xacb0('0xc')])}));require(_0xacb0('0x10'))['default']();require(_0xacb0('0x11'))[_0xacb0('0x12')](socketio);require(_0xacb0('0x13'))[_0xacb0('0x12')](app);require(_0xacb0('0x14'))['default'](app);}else{server[_0xacb0('0x15')](_0xacb0('0x16'),function(){console[_0xacb0('0x17')](_0xacb0('0x18'),config[_0xacb0('0x8')]);});}exports=module['exports']=app; \ No newline at end of file +var _0xee6c=['listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','http','sticky-session','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','polling','redis','localhost','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once'];(function(_0x38469e,_0x146613){var _0x59219c=function(_0x160411){while(--_0x160411){_0x38469e['push'](_0x38469e['shift']());}};_0x59219c(++_0x146613);}(_0xee6c,0x71));var _0xcee6=function(_0x2efa62,_0x52e12b){_0x2efa62=_0x2efa62-0x0;var _0x12e9c0=_0xee6c[_0x2efa62];return _0x12e9c0;};'use strict';var _=require('lodash');var http=require(_0xcee6('0x0'));var express=require('express');var sticky=require(_0xcee6('0x1'));var Redis=require('ioredis');var config=require(_0xcee6('0x2'));var app=express();var server=http[_0xcee6('0x3')](app);server[_0xcee6('0x4')]=0xdbba0;if(sticky[_0xcee6('0x5')](server,config[_0xcee6('0x6')])){var socketio=require(_0xcee6('0x7'))(server,{'transports':[_0xcee6('0x8'),_0xcee6('0x9')]});config[_0xcee6('0xa')]=_['defaults'](config['redis'],{'host':_0xcee6('0xb'),'port':0x18eb});socketio['adapter'](require(_0xcee6('0xc'))({'pubClient':new Redis(config[_0xcee6('0xa')]),'subClient':new Redis(config[_0xcee6('0xa')])}));require(_0xcee6('0xd'))[_0xcee6('0xe')]();require(_0xcee6('0xf'))['default'](socketio);require(_0xcee6('0x10'))[_0xcee6('0xe')](app);require(_0xcee6('0x11'))[_0xcee6('0xe')](app);}else{server[_0xcee6('0x12')](_0xcee6('0x13'),function(){console[_0xcee6('0x14')](_0xcee6('0x15'),config[_0xcee6('0x6')]);});}exports=module['exports']=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 030e28c..c7a4be5 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 _0xeb08=['debug','error','rpc','message','exports','bluebird','../../config/logger','routing','Request','request','then'];(function(_0x2a4288,_0x22c9d2){var _0x1f0a2a=function(_0x388b94){while(--_0x388b94){_0x2a4288['push'](_0x2a4288['shift']());}};_0x1f0a2a(++_0x22c9d2);}(_0xeb08,0xe1));var _0x8eb0=function(_0xbebf50,_0x44ec09){_0xbebf50=_0xbebf50-0x0;var _0xce1496=_0xeb08[_0xbebf50];return _0xce1496;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x8eb0('0x0'));var logger=require(_0x8eb0('0x1'))(_0x8eb0('0x2'));var client=jayson['client']['http']({'port':0x2329});client[_0x8eb0('0x3')]=function(_0x12d60a,_0x5e9d15){return new BPromise(function(_0x2039a6,_0x2564df){return client[_0x8eb0('0x4')](_0x12d60a,_0x5e9d15)[_0x8eb0('0x5')](function(_0x37a08c){logger[_0x8eb0('0x6')]('rpc',_0x8eb0('0x2'),_0x12d60a,_0x5e9d15,_0x37a08c);if(_0x37a08c[_0x8eb0('0x7')]){logger[_0x8eb0('0x7')](_0x8eb0('0x8'),_0x8eb0('0x2'),_0x12d60a,_0x37a08c['error'][_0x8eb0('0x9')],_0x5e9d15);return _0x2564df(_0x37a08c[_0x8eb0('0x7')]['message']);}else{return _0x2039a6(_0x37a08c['result']);}})['catch'](function(_0x21f805){logger[_0x8eb0('0x7')](_0x8eb0('0x8'),_0x8eb0('0x2'),_0x12d60a,_0x21f805,_0x5e9d15);return _0x2564df(_0x21f805);});});};module[_0x8eb0('0xa')]=client; \ No newline at end of file +var _0xc058=['../../config/logger','routing','client','http','Request','request','then','rpc','error','result','jayson/promise','bluebird'];(function(_0x5b55b7,_0x393df8){var _0x5da27c=function(_0x582ee0){while(--_0x582ee0){_0x5b55b7['push'](_0x5b55b7['shift']());}};_0x5da27c(++_0x393df8);}(_0xc058,0x12a));var _0x8c05=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xc058[_0x13d07a];return _0x5ee0ee;};'use strict';var jayson=require(_0x8c05('0x0'));var BPromise=require(_0x8c05('0x1'));var logger=require(_0x8c05('0x2'))(_0x8c05('0x3'));var client=jayson[_0x8c05('0x4')][_0x8c05('0x5')]({'port':0x2329});client[_0x8c05('0x6')]=function(_0x542fdc,_0x26b48e){return new BPromise(function(_0x18ab2a,_0x4db64a){return client[_0x8c05('0x7')](_0x542fdc,_0x26b48e)[_0x8c05('0x8')](function(_0xe681bb){logger['debug'](_0x8c05('0x9'),'routing',_0x542fdc,_0x26b48e,_0xe681bb);if(_0xe681bb[_0x8c05('0xa')]){logger['error']('rpc',_0x8c05('0x3'),_0x542fdc,_0xe681bb[_0x8c05('0xa')]['message'],_0x26b48e);return _0x4db64a(_0xe681bb[_0x8c05('0xa')]['message']);}else{return _0x18ab2a(_0xe681bb[_0x8c05('0xb')]);}})['catch'](function(_0x453fcc){logger[_0x8c05('0xa')](_0x8c05('0x9'),'routing',_0x542fdc,_0x453fcc,_0x26b48e);return _0x4db64a(_0x453fcc);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 8cdb6a7..ef41a83 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 _0xbc03=['./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','getIntervals','initChatQueues','getSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','log','./server','./realtime','./rpc/user'];(function(_0x5a8c48,_0x584ed9){var _0x220ae4=function(_0x5145d7){while(--_0x5145d7){_0x5a8c48['push'](_0x5a8c48['shift']());}};_0x220ae4(++_0x584ed9);}(_0xbc03,0x13f));var _0x3bc0=function(_0x577f3d,_0x43ab79){_0x577f3d=_0x577f3d-0x0;var _0x3b11f6=_0xbc03[_0x577f3d];return _0x3b11f6;};'use strict';var BPromise=require('bluebird');var server=require(_0x3bc0('0x0'));var Realtime=require(_0x3bc0('0x1'));var user=require(_0x3bc0('0x2'));var interval=require(_0x3bc0('0x3'));var openchannelQueue=require(_0x3bc0('0x4'));var chatQueue=require(_0x3bc0('0x5'));var smsQueue=require(_0x3bc0('0x6'));var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x3bc0('0x7'));var whatsappQueue=require(_0x3bc0('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x3bc0('0x9')]()[_0x3bc0('0xa')](user[_0x3bc0('0xb')]())[_0x3bc0('0xa')](realtime['initAgents']())['then'](interval[_0x3bc0('0xc')]())[_0x3bc0('0xa')](realtime['initIntervals']())[_0x3bc0('0xa')](openchannelQueue['getOpenchannelQueues']())[_0x3bc0('0xa')](realtime['initOpenchannelQueues']())['then'](chatQueue['getChatQueues']())[_0x3bc0('0xa')](realtime[_0x3bc0('0xd')]())['then'](smsQueue[_0x3bc0('0xe')]())['then'](realtime['initSmsQueues']())[_0x3bc0('0xa')](mailQueue[_0x3bc0('0xf')]())[_0x3bc0('0xa')](realtime[_0x3bc0('0x10')]())[_0x3bc0('0xa')](faxQueue[_0x3bc0('0x11')]())[_0x3bc0('0xa')](realtime[_0x3bc0('0x12')]())['then'](whatsappQueue[_0x3bc0('0x13')]())[_0x3bc0('0xa')](realtime[_0x3bc0('0x14')]())[_0x3bc0('0xa')](function(){return realtime;});}function main(){return server[_0x3bc0('0x15')](realtime)[_0x3bc0('0xa')](function(_0x12ee35){return initRealtime();})[_0x3bc0('0xa')](function(_0x1031c9){return setInterval(initRealtime,0x1388);})['catch'](function(_0xcfc4c2){console[_0x3bc0('0x16')](_0xcfc4c2);});}main(); \ No newline at end of file +var _0xbd38=['log','bluebird','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','then','initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0xbd38,0xe9));var _0x8bd3=function(_0xffd9e8,_0x165d2a){_0xffd9e8=_0xffd9e8-0x0;var _0x5d6c6e=_0xbd38[_0xffd9e8];return _0x5d6c6e;};'use strict';var BPromise=require(_0x8bd3('0x0'));var server=require('./server');var Realtime=require(_0x8bd3('0x1'));var user=require(_0x8bd3('0x2'));var interval=require(_0x8bd3('0x3'));var openchannelQueue=require(_0x8bd3('0x4'));var chatQueue=require(_0x8bd3('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x8bd3('0x6'));var faxQueue=require(_0x8bd3('0x7'));var whatsappQueue=require(_0x8bd3('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x8bd3('0x9')]()['then'](user[_0x8bd3('0xa')]())[_0x8bd3('0xb')](realtime[_0x8bd3('0xc')]())[_0x8bd3('0xb')](interval[_0x8bd3('0xd')]())['then'](realtime['initIntervals']())[_0x8bd3('0xb')](openchannelQueue[_0x8bd3('0xe')]())[_0x8bd3('0xb')](realtime[_0x8bd3('0xf')]())[_0x8bd3('0xb')](chatQueue[_0x8bd3('0x10')]())[_0x8bd3('0xb')](realtime[_0x8bd3('0x11')]())[_0x8bd3('0xb')](smsQueue[_0x8bd3('0x12')]())[_0x8bd3('0xb')](realtime[_0x8bd3('0x13')]())['then'](mailQueue[_0x8bd3('0x14')]())[_0x8bd3('0xb')](realtime[_0x8bd3('0x15')]())[_0x8bd3('0xb')](faxQueue[_0x8bd3('0x16')]())['then'](realtime[_0x8bd3('0x17')]())[_0x8bd3('0xb')](whatsappQueue[_0x8bd3('0x18')]())[_0x8bd3('0xb')](realtime[_0x8bd3('0x19')]())['then'](function(){return realtime;});}function main(){return server[_0x8bd3('0x1a')](realtime)[_0x8bd3('0xb')](function(_0x14b1fc){return initRealtime();})[_0x8bd3('0xb')](function(_0x51bb66){return setInterval(initRealtime,0x1388);})[_0x8bd3('0x1b')](function(_0x2d7ce5){console[_0x8bd3('0x1c')](_0x2d7ce5);});}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 faf4751..bd9af11 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x21cd58,_0x4604d6){var _0x3fba55=function(_0x51922e){while(--_0x51922e){_0x21cd58['push'](_0x21cd58['shift']());}};_0x3fba55(++_0x4604d6);}(_0x326f,0xd1));var _0xf326=function(_0x1b0558,_0x201df0){_0x1b0558=_0x1b0558-0x0;var _0x171853=_0x326f[_0x1b0558];return _0x171853;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file +var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x396952,_0x56b463){var _0x53d27c=function(_0xe5d83f){while(--_0xe5d83f){_0x396952['push'](_0x396952['shift']());}};_0x53d27c(++_0x56b463);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3fe042,_0x1106f7){_0x3fe042=_0x3fe042-0x0;var _0x7d4a1f=_0x5fc3[_0x3fe042];return _0x7d4a1f;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 6904bfa..3f5fdf3 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 _0x1914=['sendMailMessage','SendMail','bluebird','jayson/promise','client','request','error'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1914,0x1f3));var _0x4191=function(_0x359b7c,_0x48b0ad){_0x359b7c=_0x359b7c-0x0;var _0x32d24d=_0x1914[_0x359b7c];return _0x32d24d;};'use strict';var BPromise=require(_0x4191('0x0'));var jayson=require(_0x4191('0x1'));var client=jayson[_0x4191('0x2')]['http']({'port':0x232b});function request(_0xc6e686,_0x1d4fb5){return new BPromise(function(_0x214aae,_0x3758a0){return client[_0x4191('0x3')](_0xc6e686,_0x1d4fb5)['then'](function(_0x2269a3){if(_0x2269a3['error']){return _0x3758a0(_0x2269a3[_0x4191('0x4')]['message']);}else{return _0x214aae(_0x2269a3['result']);}})['catch'](function(_0x3ff782){return _0x3758a0(_0x3ff782);});});}exports[_0x4191('0x5')]=function(_0x5e918f,_0x5c1cd6){return request(_0x4191('0x6'),{'account':_0x5e918f,'message':_0x5c1cd6});}; \ No newline at end of file +var _0x7a96=['http','request','then','error','message','result','catch','sendMailMessage','SendMail','bluebird','client'];(function(_0x261962,_0x2c99e5){var _0x42d00e=function(_0x5b9a62){while(--_0x5b9a62){_0x261962['push'](_0x261962['shift']());}};_0x42d00e(++_0x2c99e5);}(_0x7a96,0x8d));var _0x67a9=function(_0x59659d,_0xb17019){_0x59659d=_0x59659d-0x0;var _0x2adbb5=_0x7a96[_0x59659d];return _0x2adbb5;};'use strict';var BPromise=require(_0x67a9('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x67a9('0x1')][_0x67a9('0x2')]({'port':0x232b});function request(_0x3d83b7,_0x3bb978){return new BPromise(function(_0x5623a8,_0x4d120f){return client[_0x67a9('0x3')](_0x3d83b7,_0x3bb978)[_0x67a9('0x4')](function(_0x29b3e3){if(_0x29b3e3[_0x67a9('0x5')]){return _0x4d120f(_0x29b3e3['error'][_0x67a9('0x6')]);}else{return _0x5623a8(_0x29b3e3[_0x67a9('0x7')]);}})[_0x67a9('0x8')](function(_0x2cc050){return _0x4d120f(_0x2cc050);});});}exports[_0x67a9('0x9')]=function(_0x206b83,_0x5e8b8d){return request(_0x67a9('0xa'),{'account':_0x206b83,'message':_0x5e8b8d});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 0dbf2b0..07e1d38 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 _0x323f=['chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','working','idle','mail','openchannel','sms','whatsapp','length','Status','StatusTime','format','faxStatusTime','stringify','emit','exports','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause'];(function(_0x47408e,_0x481428){var _0x1636bc=function(_0x2fe7a6){while(--_0x2fe7a6){_0x47408e['push'](_0x47408e['shift']());}};_0x1636bc(++_0x481428);}(_0x323f,0x1ee));var _0xf323=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x323f[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require('lodash');var md5=require(_0xf323('0x0'));var moment=require('moment');var Redis=require(_0xf323('0x1'));var config=require(_0xf323('0x2'));config[_0xf323('0x3')]=_[_0xf323('0x4')](config[_0xf323('0x3')],{'host':_0xf323('0x5'),'port':0x18eb});var io=require(_0xf323('0x6'))(new Redis(config[_0xf323('0x3')]));function Agent(_0x3cfee3){this['id']=_0x3cfee3['id']||0x0;this[_0xf323('0x7')]=_0x3cfee3['name']||'';this[_0xf323('0x8')]=_0x3cfee3[_0xf323('0x8')]||!![];this[_0xf323('0x9')]=_0x3cfee3[_0xf323('0x9')]||![];this[_0xf323('0xa')]=_0x3cfee3[_0xf323('0xa')]||![];this[_0xf323('0xb')]=_0x3cfee3[_0xf323('0xb')]||![];this[_0xf323('0xc')]=_0x3cfee3[_0xf323('0xc')]||![];this[_0xf323('0xd')]=_0x3cfee3[_0xf323('0xd')]||![];this[_0xf323('0xe')]=_0x3cfee3[_0xf323('0xe')]||![];this[_0xf323('0xf')]=_0xf323('0x10');this[_0xf323('0x11')]=0x0;this['chatCapacity']=_0x3cfee3[_0xf323('0x12')]||0x0;this[_0xf323('0x13')]=0x0;this[_0xf323('0x14')]='unknown';this[_0xf323('0x15')]=0x0;this[_0xf323('0x16')]=_0x3cfee3[_0xf323('0x16')]||0x0;this[_0xf323('0x17')]=0x0;this[_0xf323('0x18')]=_0xf323('0x10');this['faxStatusTime']=0x0;this['faxCapacity']=_0x3cfee3[_0xf323('0x19')]||0x0;this[_0xf323('0x1a')]=0x0;this[_0xf323('0x1b')]=_0xf323('0x10');this[_0xf323('0x1c')]=0x0;this['smsCapacity']=_0x3cfee3[_0xf323('0x1d')]||0x0;this[_0xf323('0x1e')]=0x0;this[_0xf323('0x1f')]=_0xf323('0x10');this['whatsappStatusTime']=0x0;this[_0xf323('0x20')]=_0x3cfee3[_0xf323('0x20')]||0x0;this[_0xf323('0x21')]=0x0;this[_0xf323('0x22')]='unknown';this[_0xf323('0x23')]=0x0;this[_0xf323('0x24')]=_0x3cfee3['openchannelCapacity']||0x0;this[_0xf323('0x25')]=0x0;this[_0xf323('0x26')]=![];this[_0xf323('0x27')]=undefined;this[_0xf323('0x0')]='';this['chatWaitingInteractions']={};this[_0xf323('0x28')]={};this[_0xf323('0x29')]={};this[_0xf323('0x2a')]={};this['smsWaitingInteractions']={};this[_0xf323('0x2b')]={};this[_0xf323('0x2c')]();}Agent[_0xf323('0x2d')][_0xf323('0x2e')]=function(_0x13ec1f){if(this[_0x13ec1f+_0xf323('0x2f')]>0x0){if(this[_0x13ec1f+_0xf323('0x30')]>0x0&&this[_0x13ec1f+_0xf323('0x2f')]>=this[_0x13ec1f+_0xf323('0x30')]){return'maxcapacity';}else{return _0xf323('0x31');}}else{return _0xf323('0x32');}};Agent[_0xf323('0x2d')][_0xf323('0x2c')]=function(){var _0x87ec45=[_0xf323('0x33'),'chat',_0xf323('0x34'),'fax',_0xf323('0x35'),_0xf323('0x36')];for(var _0x56be0c=0x0;_0x56be0c<_0x87ec45[_0xf323('0x37')];_0x56be0c+=0x1){var _0x3c95ce=this[_0xf323('0x2e')](_0x87ec45[_0x56be0c]);if(this[_0x87ec45[_0x56be0c]+_0xf323('0x38')]!==_0x3c95ce){this[_0x87ec45[_0x56be0c]+_0xf323('0x39')]=_['toNumber'](moment()[_0xf323('0x3a')]('x'));}this[_0x87ec45[_0x56be0c]+_0xf323('0x38')]=_0x3c95ce;}var _0x12c7d5={'id':this['id'],'name':this[_0xf323('0x7')],'online':this[_0xf323('0x8')],'voicePause':this[_0xf323('0x9')],'chatPause':this[_0xf323('0xa')],'mailPause':this[_0xf323('0xb')],'smsPause':this[_0xf323('0xd')],'faxPause':this['faxPause'],'openchannelPause':this[_0xf323('0xe')],'chatStatus':this[_0xf323('0xf')],'chatStatusTime':this[_0xf323('0x11')],'chatCapacity':this[_0xf323('0x12')],'chatCurrentCapacity':this[_0xf323('0x13')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xf323('0x15')],'mailCapacity':this[_0xf323('0x16')],'mailCurrentCapacity':this[_0xf323('0x17')],'faxStatus':this[_0xf323('0x18')],'faxStatusTime':this[_0xf323('0x3b')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xf323('0x1a')],'smsStatus':this[_0xf323('0x1b')],'smsStatusTime':this[_0xf323('0x1c')],'smsCapacity':this[_0xf323('0x1d')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0xf323('0x1f')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0xf323('0x20')],'whatsappCurrentCapacity':this[_0xf323('0x21')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xf323('0x23')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xf323('0x25')],'busy':this['busy'],'busyQueue':this[_0xf323('0x27')],'chatWaitingInteractions':this['chatWaitingInteractions'],'faxWaitingInteractions':this[_0xf323('0x28')],'mailWaitingInteractions':this[_0xf323('0x29')],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this['smsWaitingInteractions'],'whatsappWaitingInteractions':this['whatsappWaitingInteractions']};var _0x8b24f2=md5(JSON[_0xf323('0x3c')](_0x12c7d5));if(this[_0xf323('0x0')]!==_0x8b24f2){this[_0xf323('0x0')]=_0x8b24f2;io[_0xf323('0x3d')]('user:routing:update',_['omit'](_0x12c7d5,['online']));}};module[_0xf323('0x3e')]=Agent; \ No newline at end of file +var _0x3d04=['chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','working','mail','chat','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','online','faxPause','mailStatus','faxStatusTime','smsStatusTime','stringify','emit','omit','exports','lodash','md5','moment','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','voicePause','chatPause','mailPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime'];(function(_0x429878,_0x5c3d35){var _0x15041d=function(_0x441ca0){while(--_0x441ca0){_0x429878['push'](_0x429878['shift']());}};_0x15041d(++_0x5c3d35);}(_0x3d04,0xbe));var _0x43d0=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x3d04[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x43d0('0x0'));var md5=require(_0x43d0('0x1'));var moment=require(_0x43d0('0x2'));var Redis=require(_0x43d0('0x3'));var config=require(_0x43d0('0x4'));config[_0x43d0('0x5')]=_[_0x43d0('0x6')](config[_0x43d0('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x43d0('0x7'))(new Redis(config[_0x43d0('0x5')]));function Agent(_0x746f5e){this['id']=_0x746f5e['id']||0x0;this[_0x43d0('0x8')]=_0x746f5e['name']||'';this['online']=_0x746f5e['online']||!![];this['voicePause']=_0x746f5e[_0x43d0('0x9')]||![];this[_0x43d0('0xa')]=_0x746f5e[_0x43d0('0xa')]||![];this[_0x43d0('0xb')]=_0x746f5e[_0x43d0('0xb')]||![];this['faxPause']=_0x746f5e['faxPause']||![];this[_0x43d0('0xc')]=_0x746f5e['smsPause']||![];this['openchannelPause']=_0x746f5e[_0x43d0('0xd')]||![];this[_0x43d0('0xe')]=_0x43d0('0xf');this[_0x43d0('0x10')]=0x0;this['chatCapacity']=_0x746f5e[_0x43d0('0x11')]||0x0;this[_0x43d0('0x12')]=0x0;this['mailStatus']=_0x43d0('0xf');this[_0x43d0('0x13')]=0x0;this[_0x43d0('0x14')]=_0x746f5e['mailCapacity']||0x0;this[_0x43d0('0x15')]=0x0;this[_0x43d0('0x16')]=_0x43d0('0xf');this['faxStatusTime']=0x0;this[_0x43d0('0x17')]=_0x746f5e[_0x43d0('0x17')]||0x0;this[_0x43d0('0x18')]=0x0;this[_0x43d0('0x19')]=_0x43d0('0xf');this['smsStatusTime']=0x0;this['smsCapacity']=_0x746f5e[_0x43d0('0x1a')]||0x0;this[_0x43d0('0x1b')]=0x0;this[_0x43d0('0x1c')]='unknown';this[_0x43d0('0x1d')]=0x0;this['whatsappCapacity']=_0x746f5e[_0x43d0('0x1e')]||0x0;this[_0x43d0('0x1f')]=0x0;this[_0x43d0('0x20')]='unknown';this[_0x43d0('0x21')]=0x0;this[_0x43d0('0x22')]=_0x746f5e['openchannelCapacity']||0x0;this[_0x43d0('0x23')]=0x0;this[_0x43d0('0x24')]=![];this[_0x43d0('0x25')]=undefined;this[_0x43d0('0x1')]='';this[_0x43d0('0x26')]={};this[_0x43d0('0x27')]={};this[_0x43d0('0x28')]={};this[_0x43d0('0x29')]={};this[_0x43d0('0x2a')]={};this[_0x43d0('0x2b')]={};this[_0x43d0('0x2c')]();}Agent[_0x43d0('0x2d')][_0x43d0('0x2e')]=function(_0xbc72e6){if(this[_0xbc72e6+_0x43d0('0x2f')]>0x0){if(this[_0xbc72e6+'Capacity']>0x0&&this[_0xbc72e6+_0x43d0('0x2f')]>=this[_0xbc72e6+_0x43d0('0x30')]){return'maxcapacity';}else{return _0x43d0('0x31');}}else{return'idle';}};Agent[_0x43d0('0x2d')][_0x43d0('0x2c')]=function(){var _0x5dd310=[_0x43d0('0x32'),_0x43d0('0x33'),'openchannel',_0x43d0('0x34'),_0x43d0('0x35'),_0x43d0('0x36')];for(var _0x5f16ac=0x0;_0x5f16ac<_0x5dd310[_0x43d0('0x37')];_0x5f16ac+=0x1){var _0x38e89e=this[_0x43d0('0x2e')](_0x5dd310[_0x5f16ac]);if(this[_0x5dd310[_0x5f16ac]+_0x43d0('0x38')]!==_0x38e89e){this[_0x5dd310[_0x5f16ac]+_0x43d0('0x39')]=_[_0x43d0('0x3a')](moment()[_0x43d0('0x3b')]('x'));}this[_0x5dd310[_0x5f16ac]+'Status']=_0x38e89e;}var _0x2b0784={'id':this['id'],'name':this[_0x43d0('0x8')],'online':this[_0x43d0('0x3c')],'voicePause':this['voicePause'],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this[_0x43d0('0xc')],'faxPause':this[_0x43d0('0x3d')],'openchannelPause':this[_0x43d0('0xd')],'chatStatus':this[_0x43d0('0xe')],'chatStatusTime':this[_0x43d0('0x10')],'chatCapacity':this[_0x43d0('0x11')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x43d0('0x3e')],'mailStatusTime':this[_0x43d0('0x13')],'mailCapacity':this[_0x43d0('0x14')],'mailCurrentCapacity':this[_0x43d0('0x15')],'faxStatus':this[_0x43d0('0x16')],'faxStatusTime':this[_0x43d0('0x3f')],'faxCapacity':this[_0x43d0('0x17')],'faxCurrentCapacity':this[_0x43d0('0x18')],'smsStatus':this[_0x43d0('0x19')],'smsStatusTime':this[_0x43d0('0x40')],'smsCapacity':this[_0x43d0('0x1a')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x43d0('0x1c')],'whatsappStatusTime':this[_0x43d0('0x1d')],'whatsappCapacity':this[_0x43d0('0x1e')],'whatsappCurrentCapacity':this[_0x43d0('0x1f')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x43d0('0x21')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x43d0('0x23')],'busy':this[_0x43d0('0x24')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0x43d0('0x26')],'faxWaitingInteractions':this[_0x43d0('0x27')],'mailWaitingInteractions':this[_0x43d0('0x28')],'openchannelWaitingInteractions':this[_0x43d0('0x29')],'smsWaitingInteractions':this[_0x43d0('0x2a')],'whatsappWaitingInteractions':this[_0x43d0('0x2b')]};var _0x35a375=md5(JSON[_0x43d0('0x41')](_0x2b0784));if(this[_0x43d0('0x1')]!==_0x35a375){this[_0x43d0('0x1')]=_0x35a375;io[_0x43d0('0x42')]('user:routing:update',_[_0x43d0('0x43')](_0x2b0784,[_0x43d0('0x3c')]));}};module[_0x43d0('0x44')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index d68277e..1937cfb 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 _0x84df=['loggedIn','paused','available','stringify','format','chat:queue:%s','lodash','md5','ioredis','../../../config/environment','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','map','_rr','prototype','updateRealtime'];(function(_0x515744,_0x5584fc){var _0x10c9e7=function(_0x43589c){while(--_0x43589c){_0x515744['push'](_0x515744['shift']());}};_0x10c9e7(++_0x5584fc);}(_0x84df,0x1d2));var _0xf84d=function(_0x1f78cb,_0x58e9f3){_0x1f78cb=_0x1f78cb-0x0;var _0x2cf6b8=_0x84df[_0x1f78cb];return _0x2cf6b8;};'use strict';var _=require(_0xf84d('0x0'));var md5=require(_0xf84d('0x1'));var util=require('util');var Redis=require(_0xf84d('0x2'));var config=require(_0xf84d('0x3'));config['redis']=_[_0xf84d('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xf84d('0x5'))(new Redis(config['redis']));function ChatQueue(_0x1df2e2){this['id']=_0x1df2e2['id']||0x0;this[_0xf84d('0x6')]=_0x1df2e2[_0xf84d('0x6')]||'';this[_0xf84d('0x7')]=_0x1df2e2['timeout']||0xa;this[_0xf84d('0x8')]=_0x1df2e2[_0xf84d('0x8')]||_0xf84d('0x9');this[_0xf84d('0xa')]=_0x1df2e2[_0xf84d('0xa')];this[_0xf84d('0xb')]={};this[_0xf84d('0xc')]=0x0;this[_0xf84d('0x1')]='';this['updateRouting']();this['updateRealtime']();}ChatQueue['prototype']['updateRouting']=function(){var _0x3187ef=this[_0xf84d('0xb')]['_rr'];this['mapAgentsId']=_[_0xf84d('0xd')](this[_0xf84d('0xa')],'id');this[_0xf84d('0xb')][_0xf84d('0xe')]=_0x3187ef;};ChatQueue[_0xf84d('0xf')][_0xf84d('0x10')]=function(){this[_0xf84d('0x11')]=0x0;this[_0xf84d('0x12')]=0x0;for(var _0x31e90f=0x0;_0x31e90f=0x0?this[_0xf84d('0x13')]:0x0;var _0x4aec0d={'id':this['id'],'available':this[_0xf84d('0x13')],'loggedIn':this['loggedIn'],'name':this[_0xf84d('0x6')],'paused':this[_0xf84d('0x12')],'waiting':this[_0xf84d('0xc')]};var _0x530894=md5(JSON[_0xf84d('0x14')](_0x4aec0d));if(this[_0xf84d('0x1')]!==_0x530894){this['md5']=_0x530894;io['to'](util[_0xf84d('0x15')](_0xf84d('0x16'),_0x4aec0d[_0xf84d('0x6')]))['emit']('chat_queue:save',_0x4aec0d);}};module['exports']=ChatQueue; \ No newline at end of file +var _0x4cd8=['timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','chatPause','available','format','chat:queue:%s','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','localhost','redis','name'];(function(_0x2d53d1,_0x5a7a2f){var _0x32eff2=function(_0x347116){while(--_0x347116){_0x2d53d1['push'](_0x2d53d1['shift']());}};_0x32eff2(++_0x5a7a2f);}(_0x4cd8,0x19b));var _0x84cd=function(_0x58e8eb,_0x2ac0c7){_0x58e8eb=_0x58e8eb-0x0;var _0x168540=_0x4cd8[_0x58e8eb];return _0x168540;};'use strict';var _=require(_0x84cd('0x0'));var md5=require(_0x84cd('0x1'));var util=require(_0x84cd('0x2'));var Redis=require(_0x84cd('0x3'));var config=require(_0x84cd('0x4'));config['redis']=_[_0x84cd('0x5')](config['redis'],{'host':_0x84cd('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x84cd('0x7')]));function ChatQueue(_0x66cb78){this['id']=_0x66cb78['id']||0x0;this[_0x84cd('0x8')]=_0x66cb78[_0x84cd('0x8')]||'';this['timeout']=_0x66cb78[_0x84cd('0x9')]||0xa;this[_0x84cd('0xa')]=_0x66cb78[_0x84cd('0xa')]||_0x84cd('0xb');this[_0x84cd('0xc')]=_0x66cb78[_0x84cd('0xc')];this['mapAgentsId']={};this[_0x84cd('0xd')]=0x0;this[_0x84cd('0x1')]='';this[_0x84cd('0xe')]();this[_0x84cd('0xf')]();}ChatQueue[_0x84cd('0x10')]['updateRouting']=function(){var _0x13aa30=this[_0x84cd('0x11')][_0x84cd('0x12')];this[_0x84cd('0x11')]=_[_0x84cd('0x13')](this[_0x84cd('0xc')],'id');this[_0x84cd('0x11')]['_rr']=_0x13aa30;};ChatQueue[_0x84cd('0x10')][_0x84cd('0xf')]=function(){this[_0x84cd('0x14')]=0x0;this[_0x84cd('0x15')]=0x0;for(var _0x3cdeef=0x0;_0x3cdeef=0x0?this[_0x84cd('0x18')]:0x0;var _0x5a31bc={'id':this['id'],'available':this[_0x84cd('0x18')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x84cd('0x15')],'waiting':this[_0x84cd('0xd')]};var _0x4280bf=md5(JSON['stringify'](_0x5a31bc));if(this[_0x84cd('0x1')]!==_0x4280bf){this['md5']=_0x4280bf;io['to'](util[_0x84cd('0x19')](_0x84cd('0x1a'),_0x5a31bc['name']))['emit']('chat_queue:save',_0x5a31bc);}};module[_0x84cd('0x1b')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 027979b..89cfe03 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 _0x9148=['paused','length','online','faxPause','available','stringify','emit','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRouting','prototype','_rr','updateRealtime','loggedIn'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x9148,0xb0));var _0x8914=function(_0x333af1,_0x2809d2){_0x333af1=_0x333af1-0x0;var _0x4a7df5=_0x9148[_0x333af1];return _0x4a7df5;};'use strict';var _=require(_0x8914('0x0'));var md5=require('md5');var util=require(_0x8914('0x1'));var Redis=require(_0x8914('0x2'));var config=require(_0x8914('0x3'));config[_0x8914('0x4')]=_[_0x8914('0x5')](config[_0x8914('0x4')],{'host':_0x8914('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8914('0x4')]));function FaxQueue(_0x198614){this['id']=_0x198614['id']||0x0;this[_0x8914('0x7')]=_0x198614['name']||'';this[_0x8914('0x8')]=_0x198614['timeout']||0xa;this[_0x8914('0x9')]=_0x198614[_0x8914('0x9')]||_0x8914('0xa');this[_0x8914('0xb')]=_0x198614[_0x8914('0xb')];this[_0x8914('0xc')]={};this[_0x8914('0xd')]=0x0;this[_0x8914('0xe')]='';this[_0x8914('0xf')]();this['updateRealtime']();}FaxQueue[_0x8914('0x10')][_0x8914('0xf')]=function(){var _0x11c4eb=this[_0x8914('0xc')][_0x8914('0x11')];this[_0x8914('0xc')]=_['map'](this[_0x8914('0xb')],'id');this['mapAgentsId'][_0x8914('0x11')]=_0x11c4eb;};FaxQueue[_0x8914('0x10')][_0x8914('0x12')]=function(){this[_0x8914('0x13')]=0x0;this[_0x8914('0x14')]=0x0;for(var _0x18931f=0x0;_0x18931f=0x0?this['available']:0x0;var _0x1c2a26={'id':this['id'],'available':this[_0x8914('0x18')],'loggedIn':this[_0x8914('0x13')],'name':this['name'],'paused':this[_0x8914('0x14')],'waiting':this[_0x8914('0xd')]};var _0x2cb4c6=md5(JSON[_0x8914('0x19')](_0x1c2a26));if(this['md5']!==_0x2cb4c6){this[_0x8914('0xe')]=_0x2cb4c6;io['to'](util['format']('fax:queue:%s',_0x1c2a26['name']))[_0x8914('0x1a')]('fax_queue:save',_0x1c2a26);}};module[_0x8914('0x1b')]=FaxQueue; \ No newline at end of file +var _0x0212=['exports','lodash','md5','util','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','length','faxPause','available','paused','format','fax:queue:%s','fax_queue:save'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x0212,0xfd));var _0x2021=function(_0x53a7f3,_0x102923){_0x53a7f3=_0x53a7f3-0x0;var _0x5e8e66=_0x0212[_0x53a7f3];return _0x5e8e66;};'use strict';var _=require(_0x2021('0x0'));var md5=require(_0x2021('0x1'));var util=require(_0x2021('0x2'));var Redis=require('ioredis');var config=require(_0x2021('0x3'));config[_0x2021('0x4')]=_[_0x2021('0x5')](config[_0x2021('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x2021('0x6'))(new Redis(config[_0x2021('0x4')]));function FaxQueue(_0x3004db){this['id']=_0x3004db['id']||0x0;this['name']=_0x3004db[_0x2021('0x7')]||'';this[_0x2021('0x8')]=_0x3004db[_0x2021('0x8')]||0xa;this['strategy']=_0x3004db[_0x2021('0x9')]||_0x2021('0xa');this['Agents']=_0x3004db[_0x2021('0xb')];this[_0x2021('0xc')]={};this[_0x2021('0xd')]=0x0;this[_0x2021('0x1')]='';this[_0x2021('0xe')]();this[_0x2021('0xf')]();}FaxQueue['prototype'][_0x2021('0xe')]=function(){var _0x46c848=this[_0x2021('0xc')][_0x2021('0x10')];this[_0x2021('0xc')]=_[_0x2021('0x11')](this[_0x2021('0xb')],'id');this['mapAgentsId']['_rr']=_0x46c848;};FaxQueue[_0x2021('0x12')]['updateRealtime']=function(){this[_0x2021('0x13')]=0x0;this['paused']=0x0;for(var _0x5dd753=0x0;_0x5dd753=0x0?this[_0x2021('0x16')]:0x0;var _0x4def85={'id':this['id'],'available':this[_0x2021('0x16')],'loggedIn':this[_0x2021('0x13')],'name':this[_0x2021('0x7')],'paused':this[_0x2021('0x17')],'waiting':this[_0x2021('0xd')]};var _0x2bbf41=md5(JSON['stringify'](_0x4def85));if(this['md5']!==_0x2bbf41){this[_0x2021('0x1')]=_0x2bbf41;io['to'](util[_0x2021('0x18')](_0x2021('0x19'),_0x4def85[_0x2021('0x7')]))['emit'](_0x2021('0x1a'),_0x4def85);}};module[_0x2021('0x1b')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index d71f081..2f308fd 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 _0x159c=['exports','name','Intervals'];(function(_0x29d7ce,_0x463795){var _0x322541=function(_0xb79620){while(--_0xb79620){_0x29d7ce['push'](_0x29d7ce['shift']());}};_0x322541(++_0x463795);}(_0x159c,0xe5));var _0xc159=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x159c[_0x20a584];return _0x4b41a8;};'use strict';function Interval(_0x2d9da3){this['id']=_0x2d9da3['id']||0x0;this[_0xc159('0x0')]=_0x2d9da3[_0xc159('0x0')]||'';this['Intervals']=_0x2d9da3[_0xc159('0x1')]||{};}module[_0xc159('0x2')]=Interval; \ No newline at end of file +var _0xf7a9=['exports','Intervals'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0xf7a9,0xe5));var _0x9f7a=function(_0x34b795,_0x45458c){_0x34b795=_0x34b795-0x0;var _0x37968b=_0xf7a9[_0x34b795];return _0x37968b;};'use strict';function Interval(_0x1eca85){this['id']=_0x1eca85['id']||0x0;this['name']=_0x1eca85['name']||'';this[_0x9f7a('0x0')]=_0x1eca85[_0x9f7a('0x0')]||{};}module[_0x9f7a('0x1')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index abb1694..32ed210 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 _0xd302=['md5','updateRouting','updateRealtime','prototype','mapAgentsId','map','_rr','loggedIn','paused','length','online','mailPause','available','stringify','mail_queue:save','exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting'];(function(_0x55e5c6,_0x590bee){var _0x2b1392=function(_0x192875){while(--_0x192875){_0x55e5c6['push'](_0x55e5c6['shift']());}};_0x2b1392(++_0x590bee);}(_0xd302,0x160));var _0x2d30=function(_0x4f0973,_0xd18bbf){_0x4f0973=_0x4f0973-0x0;var _0x401d66=_0xd302[_0x4f0973];return _0x401d66;};'use strict';var _=require(_0x2d30('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x2d30('0x1'));var config=require(_0x2d30('0x2'));config[_0x2d30('0x3')]=_[_0x2d30('0x4')](config[_0x2d30('0x3')],{'host':_0x2d30('0x5'),'port':0x18eb});var io=require(_0x2d30('0x6'))(new Redis(config[_0x2d30('0x3')]));function MailQueue(_0x896f77){this['id']=_0x896f77['id']||0x0;this[_0x2d30('0x7')]=_0x896f77[_0x2d30('0x7')]||'';this['timeout']=_0x896f77[_0x2d30('0x8')]||0xa;this[_0x2d30('0x9')]=_0x896f77[_0x2d30('0x9')]||'beepall';this['Agents']=_0x896f77[_0x2d30('0xa')];this['mapAgentsId']={};this[_0x2d30('0xb')]=0x0;this[_0x2d30('0xc')]='';this[_0x2d30('0xd')]();this[_0x2d30('0xe')]();}MailQueue[_0x2d30('0xf')][_0x2d30('0xd')]=function(){var _0x3c5d9b=this[_0x2d30('0x10')]['_rr'];this[_0x2d30('0x10')]=_[_0x2d30('0x11')](this[_0x2d30('0xa')],'id');this[_0x2d30('0x10')][_0x2d30('0x12')]=_0x3c5d9b;};MailQueue[_0x2d30('0xf')]['updateRealtime']=function(){this[_0x2d30('0x13')]=0x0;this[_0x2d30('0x14')]=0x0;for(var _0x7f2465=0x0;_0x7f2465=0x0?this['available']:0x0;var _0xa2c198={'id':this['id'],'available':this[_0x2d30('0x18')],'loggedIn':this[_0x2d30('0x13')],'name':this[_0x2d30('0x7')],'paused':this[_0x2d30('0x14')],'waiting':this[_0x2d30('0xb')]};var _0x2bfd15=md5(JSON[_0x2d30('0x19')](_0xa2c198));if(this[_0x2d30('0xc')]!==_0x2bfd15){this[_0x2d30('0xc')]=_0x2bfd15;io['to'](util['format']('mail:queue:%s',_0xa2c198[_0x2d30('0x7')]))['emit'](_0x2d30('0x1a'),_0xa2c198);}};module[_0x2d30('0x1b')]=MailQueue; \ No newline at end of file +var _0xe320=['Agents','mapAgentsId','waiting','md5','updateRouting','prototype','map','_rr','updateRealtime','paused','online','loggedIn','mailPause','available','format','mail:queue:%s','exports','lodash','util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x49279c,_0x56da65){var _0x472c04=function(_0x6b5a3d){while(--_0x6b5a3d){_0x49279c['push'](_0x49279c['shift']());}};_0x472c04(++_0x56da65);}(_0xe320,0x17d));var _0x0e32=function(_0x2ce274,_0x5e853e){_0x2ce274=_0x2ce274-0x0;var _0x173f95=_0xe320[_0x2ce274];return _0x173f95;};'use strict';var _=require(_0x0e32('0x0'));var md5=require('md5');var util=require(_0x0e32('0x1'));var Redis=require(_0x0e32('0x2'));var config=require('../../../config/environment');config[_0x0e32('0x3')]=_[_0x0e32('0x4')](config[_0x0e32('0x3')],{'host':_0x0e32('0x5'),'port':0x18eb});var io=require(_0x0e32('0x6'))(new Redis(config['redis']));function MailQueue(_0x516d92){this['id']=_0x516d92['id']||0x0;this[_0x0e32('0x7')]=_0x516d92[_0x0e32('0x7')]||'';this[_0x0e32('0x8')]=_0x516d92['timeout']||0xa;this['strategy']=_0x516d92[_0x0e32('0x9')]||_0x0e32('0xa');this[_0x0e32('0xb')]=_0x516d92['Agents'];this[_0x0e32('0xc')]={};this[_0x0e32('0xd')]=0x0;this[_0x0e32('0xe')]='';this[_0x0e32('0xf')]();this['updateRealtime']();}MailQueue[_0x0e32('0x10')][_0x0e32('0xf')]=function(){var _0x257813=this[_0x0e32('0xc')]['_rr'];this['mapAgentsId']=_[_0x0e32('0x11')](this[_0x0e32('0xb')],'id');this[_0x0e32('0xc')][_0x0e32('0x12')]=_0x257813;};MailQueue[_0x0e32('0x10')][_0x0e32('0x13')]=function(){this['loggedIn']=0x0;this[_0x0e32('0x14')]=0x0;for(var _0x37aab1=0x0;_0x37aab1=0x0?this['available']:0x0;var _0xafb478={'id':this['id'],'available':this[_0x0e32('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x0e32('0x7')],'paused':this['paused'],'waiting':this[_0x0e32('0xd')]};var _0x432ec4=md5(JSON['stringify'](_0xafb478));if(this[_0x0e32('0xe')]!==_0x432ec4){this[_0x0e32('0xe')]=_0x432ec4;io['to'](util[_0x0e32('0x19')](_0x0e32('0x1a'),_0xafb478['name']))['emit']('mail_queue:save',_0xafb478);}};module[_0x0e32('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 4d786d0..9741621 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 _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0x59efbb,_0x1b77e1){var _0x1e143c=function(_0x411003){while(--_0x411003){_0x59efbb['push'](_0x59efbb['shift']());}};_0x1e143c(++_0x1b77e1);}(_0xadb5,0xad));var _0x5adb=function(_0x5a72a1,_0xdc4c7){_0x5a72a1=_0x5a72a1-0x0;var _0x32b5aa=_0xadb5[_0x5a72a1];return _0x32b5aa;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue; \ No newline at end of file +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(_0x22ee1e,_0x3eff80){var _0x49a5c9=function(_0x373480){while(--_0x373480){_0x22ee1e['push'](_0x22ee1e['shift']());}};_0x49a5c9(++_0x3eff80);}(_0x1261,0x144));var _0x1126=function(_0x11503f,_0x30de86){_0x11503f=_0x11503f-0x0;var _0x34caab=_0x1261[_0x11503f];return _0x34caab;};'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 e147fd8..fde68cb 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 _0x544a=['lodash','md5','util','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','map','_rr','updateRealtime','loggedIn','paused','length','online','smsPause','available','stringify','sms:queue:%s','sms_queue:save','exports'];(function(_0x430f44,_0x4ae21b){var _0x1f6b0f=function(_0x35968f){while(--_0x35968f){_0x430f44['push'](_0x430f44['shift']());}};_0x1f6b0f(++_0x4ae21b);}(_0x544a,0xbd));var _0xa544=function(_0x1e8e69,_0x508379){_0x1e8e69=_0x1e8e69-0x0;var _0x291b1a=_0x544a[_0x1e8e69];return _0x291b1a;};'use strict';var _=require(_0xa544('0x0'));var md5=require(_0xa544('0x1'));var util=require(_0xa544('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0xa544('0x3')]=_['defaults'](config[_0xa544('0x3')],{'host':_0xa544('0x4'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa544('0x3')]));function SmsQueue(_0x3dd8a3){this['id']=_0x3dd8a3['id']||0x0;this[_0xa544('0x5')]=_0x3dd8a3[_0xa544('0x5')]||'';this[_0xa544('0x6')]=_0x3dd8a3['timeout']||0xa;this[_0xa544('0x7')]=_0x3dd8a3['strategy']||_0xa544('0x8');this[_0xa544('0x9')]=_0x3dd8a3['Agents'];this[_0xa544('0xa')]={};this[_0xa544('0xb')]=0x0;this[_0xa544('0x1')]='';this[_0xa544('0xc')]();this['updateRealtime']();}SmsQueue[_0xa544('0xd')][_0xa544('0xc')]=function(){var _0x555c4d=this[_0xa544('0xa')]['_rr'];this[_0xa544('0xa')]=_[_0xa544('0xe')](this['Agents'],'id');this[_0xa544('0xa')][_0xa544('0xf')]=_0x555c4d;};SmsQueue[_0xa544('0xd')][_0xa544('0x10')]=function(){this[_0xa544('0x11')]=0x0;this[_0xa544('0x12')]=0x0;for(var _0x1ffda8=0x0;_0x1ffda8=0x0?this[_0xa544('0x16')]:0x0;var _0x297298={'id':this['id'],'available':this[_0xa544('0x16')],'loggedIn':this[_0xa544('0x11')],'name':this[_0xa544('0x5')],'paused':this[_0xa544('0x12')],'waiting':this['waiting']};var _0x5d0070=md5(JSON[_0xa544('0x17')](_0x297298));if(this[_0xa544('0x1')]!==_0x5d0070){this[_0xa544('0x1')]=_0x5d0070;io['to'](util['format'](_0xa544('0x18'),_0x297298[_0xa544('0x5')]))['emit'](_0xa544('0x19'),_0x297298);}};module[_0xa544('0x1a')]=SmsQueue; \ No newline at end of file +var _0xd845=['exports','lodash','md5','util','ioredis','redis','defaults','localhost','name','timeout','strategy','Agents','waiting','prototype','updateRouting','mapAgentsId','_rr','map','updateRealtime','paused','length','loggedIn','smsPause','available','format','sms:queue:%s','emit','sms_queue:save'];(function(_0x3b76e9,_0x39efb2){var _0x43489c=function(_0x1040a9){while(--_0x1040a9){_0x3b76e9['push'](_0x3b76e9['shift']());}};_0x43489c(++_0x39efb2);}(_0xd845,0x135));var _0x5d84=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0xd845[_0x75f869];return _0x10af8b;};'use strict';var _=require(_0x5d84('0x0'));var md5=require(_0x5d84('0x1'));var util=require(_0x5d84('0x2'));var Redis=require(_0x5d84('0x3'));var config=require('../../../config/environment');config[_0x5d84('0x4')]=_[_0x5d84('0x5')](config[_0x5d84('0x4')],{'host':_0x5d84('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5d84('0x4')]));function SmsQueue(_0x134828){this['id']=_0x134828['id']||0x0;this[_0x5d84('0x7')]=_0x134828[_0x5d84('0x7')]||'';this[_0x5d84('0x8')]=_0x134828[_0x5d84('0x8')]||0xa;this['strategy']=_0x134828[_0x5d84('0x9')]||'beepall';this[_0x5d84('0xa')]=_0x134828[_0x5d84('0xa')];this['mapAgentsId']={};this[_0x5d84('0xb')]=0x0;this[_0x5d84('0x1')]='';this['updateRouting']();this['updateRealtime']();}SmsQueue[_0x5d84('0xc')][_0x5d84('0xd')]=function(){var _0x227990=this[_0x5d84('0xe')][_0x5d84('0xf')];this['mapAgentsId']=_[_0x5d84('0x10')](this[_0x5d84('0xa')],'id');this[_0x5d84('0xe')][_0x5d84('0xf')]=_0x227990;};SmsQueue[_0x5d84('0xc')][_0x5d84('0x11')]=function(){this['loggedIn']=0x0;this[_0x5d84('0x12')]=0x0;for(var _0x56aa9c=0x0;_0x56aa9c=0x0?this['available']:0x0;var _0x3b3f63={'id':this['id'],'available':this[_0x5d84('0x16')],'loggedIn':this[_0x5d84('0x14')],'name':this[_0x5d84('0x7')],'paused':this[_0x5d84('0x12')],'waiting':this[_0x5d84('0xb')]};var _0x4a6b43=md5(JSON['stringify'](_0x3b3f63));if(this['md5']!==_0x4a6b43){this['md5']=_0x4a6b43;io['to'](util[_0x5d84('0x17')](_0x5d84('0x18'),_0x3b3f63[_0x5d84('0x7')]))[_0x5d84('0x19')](_0x5d84('0x1a'),_0x3b3f63);}};module[_0x5d84('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 592025a..1dc5a73 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 _0x0dcd=['util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','loggedIn','paused','whatsappPause','available','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','md5'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x0dcd,0x143));var _0xd0dc=function(_0x3505ab,_0xca44bf){_0x3505ab=_0x3505ab-0x0;var _0x1bfadf=_0x0dcd[_0x3505ab];return _0x1bfadf;};'use strict';var _=require('lodash');var md5=require(_0xd0dc('0x0'));var util=require(_0xd0dc('0x1'));var Redis=require(_0xd0dc('0x2'));var config=require(_0xd0dc('0x3'));config[_0xd0dc('0x4')]=_[_0xd0dc('0x5')](config[_0xd0dc('0x4')],{'host':_0xd0dc('0x6'),'port':0x18eb});var io=require(_0xd0dc('0x7'))(new Redis(config[_0xd0dc('0x4')]));function WhatsappQueue(_0x51eb40){this['id']=_0x51eb40['id']||0x0;this['name']=_0x51eb40[_0xd0dc('0x8')]||'';this['timeout']=_0x51eb40['timeout']||0xa;this[_0xd0dc('0x9')]=_0x51eb40[_0xd0dc('0x9')]||_0xd0dc('0xa');this[_0xd0dc('0xb')]=_0x51eb40[_0xd0dc('0xb')];this[_0xd0dc('0xc')]={};this[_0xd0dc('0xd')]=0x0;this['md5']='';this[_0xd0dc('0xe')]();this[_0xd0dc('0xf')]();}WhatsappQueue['prototype'][_0xd0dc('0xe')]=function(){var _0x2ce3b4=this['mapAgentsId'][_0xd0dc('0x10')];this[_0xd0dc('0xc')]=_[_0xd0dc('0x11')](this['Agents'],'id');this[_0xd0dc('0xc')][_0xd0dc('0x10')]=_0x2ce3b4;};WhatsappQueue['prototype'][_0xd0dc('0xf')]=function(){this[_0xd0dc('0x12')]=0x0;this[_0xd0dc('0x13')]=0x0;for(var _0x3105bb=0x0;_0x3105bb=0x0?this[_0xd0dc('0x15')]:0x0;var _0x3b44a1={'id':this['id'],'available':this['available'],'loggedIn':this[_0xd0dc('0x12')],'name':this[_0xd0dc('0x8')],'paused':this[_0xd0dc('0x13')],'waiting':this['waiting']};var _0x2f0092=md5(JSON['stringify'](_0x3b44a1));if(this[_0xd0dc('0x0')]!==_0x2f0092){this['md5']=_0x2f0092;io['to'](util[_0xd0dc('0x16')](_0xd0dc('0x17'),_0x3b44a1[_0xd0dc('0x8')]))[_0xd0dc('0x18')](_0xd0dc('0x19'),_0x3b44a1);}};module[_0xd0dc('0x1a')]=WhatsappQueue; \ No newline at end of file +var _0x197d=['ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','_rr','prototype','paused','length','online','loggedIn','whatsappPause','available','waiting','stringify','whatsapp_queue:save','lodash','md5','util'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x197d,0x10b));var _0xd197=function(_0xff2171,_0x5b175a){_0xff2171=_0xff2171-0x0;var _0x542c67=_0x197d[_0xff2171];return _0x542c67;};'use strict';var _=require(_0xd197('0x0'));var md5=require(_0xd197('0x1'));var util=require(_0xd197('0x2'));var Redis=require(_0xd197('0x3'));var config=require(_0xd197('0x4'));config['redis']=_[_0xd197('0x5')](config[_0xd197('0x6')],{'host':_0xd197('0x7'),'port':0x18eb});var io=require(_0xd197('0x8'))(new Redis(config['redis']));function WhatsappQueue(_0x14400d){this['id']=_0x14400d['id']||0x0;this[_0xd197('0x9')]=_0x14400d[_0xd197('0x9')]||'';this['timeout']=_0x14400d[_0xd197('0xa')]||0xa;this[_0xd197('0xb')]=_0x14400d[_0xd197('0xb')]||_0xd197('0xc');this[_0xd197('0xd')]=_0x14400d[_0xd197('0xd')];this[_0xd197('0xe')]={};this['waiting']=0x0;this['md5']='';this[_0xd197('0xf')]();this['updateRealtime']();}WhatsappQueue['prototype']['updateRouting']=function(){var _0x4bd5db=this['mapAgentsId'][_0xd197('0x10')];this['mapAgentsId']=_['map'](this[_0xd197('0xd')],'id');this[_0xd197('0xe')]['_rr']=_0x4bd5db;};WhatsappQueue[_0xd197('0x11')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0xd197('0x12')]=0x0;for(var _0x109d0a=0x0;_0x109d0a=0x0?this['available']:0x0;var _0x510705={'id':this['id'],'available':this[_0xd197('0x17')],'loggedIn':this[_0xd197('0x15')],'name':this[_0xd197('0x9')],'paused':this[_0xd197('0x12')],'waiting':this[_0xd197('0x18')]};var _0x2524c3=md5(JSON[_0xd197('0x19')](_0x510705));if(this[_0xd197('0x1')]!==_0x2524c3){this[_0xd197('0x1')]=_0x2524c3;io['to'](util['format']('whatsapp:queue:%s',_0x510705[_0xd197('0x9')]))['emit'](_0xd197('0x1a'),_0x510705);}};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 d16c7de..98c66d7 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_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 +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(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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 9ed2eeb..ef4102d 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 _0x65b3=['Request','UpdateChatInteraction','addTags','addTagsToChatInteraction','../client','update'];(function(_0x59c5e8,_0x482de4){var _0x220a95=function(_0x52c439){while(--_0x52c439){_0x59c5e8['push'](_0x59c5e8['shift']());}};_0x220a95(++_0x482de4);}(_0x65b3,0x1e4));var _0x365b=function(_0x2a276d,_0x482b0c){_0x2a276d=_0x2a276d-0x0;var _0x2914cd=_0x65b3[_0x2a276d];return _0x2914cd;};'use strict';var client=require(_0x365b('0x0'));exports[_0x365b('0x1')]=function(_0x30f902,_0xa427af){return client[_0x365b('0x2')](_0x365b('0x3'),{'body':_0xa427af,'options':{'where':{'id':_0x30f902}},'log':'updateChatInteraction'});};exports[_0x365b('0x4')]=function(_0x247db6,_0x44ae14){return client[_0x365b('0x2')]('AddTagsToChatInteraction',{'body':_0x44ae14,'options':{'where':{'id':_0x247db6}},'log':_0x365b('0x5')});}; \ No newline at end of file +var _0x08c7=['AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request','UpdateChatInteraction','updateChatInteraction'];(function(_0xa86296,_0x5d47b5){var _0x2a9c33=function(_0x1d3a54){while(--_0x1d3a54){_0xa86296['push'](_0xa86296['shift']());}};_0x2a9c33(++_0x5d47b5);}(_0x08c7,0x19f));var _0x708c=function(_0x105864,_0x48552a){_0x105864=_0x105864-0x0;var _0x1d1371=_0x08c7[_0x105864];return _0x1d1371;};'use strict';var client=require(_0x708c('0x0'));exports[_0x708c('0x1')]=function(_0x110d93,_0x42887f){return client[_0x708c('0x2')](_0x708c('0x3'),{'body':_0x42887f,'options':{'where':{'id':_0x110d93}},'log':_0x708c('0x4')});};exports['addTags']=function(_0x446d1c,_0x421b99){return client[_0x708c('0x2')](_0x708c('0x5'),{'body':_0x421b99,'options':{'where':{'id':_0x446d1c}},'log':_0x708c('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 655a841..2db2cf2 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 _0x9eac=['../client','create','Request','createChatMessage'];(function(_0x254bc4,_0x95004f){var _0x2f89d6=function(_0x33100a){while(--_0x33100a){_0x254bc4['push'](_0x254bc4['shift']());}};_0x2f89d6(++_0x95004f);}(_0x9eac,0x188));var _0xc9ea=function(_0x2272b5,_0x362458){_0x2272b5=_0x2272b5-0x0;var _0x110156=_0x9eac[_0x2272b5];return _0x110156;};'use strict';var client=require(_0xc9ea('0x0'));exports[_0xc9ea('0x1')]=function(_0x463f33){return client[_0xc9ea('0x2')]('CreateChatMessage',{'body':_0x463f33,'log':_0xc9ea('0x3')});}; \ No newline at end of file +var _0x362f=['createChatMessage','../client','create','Request','CreateChatMessage'];(function(_0x81eff,_0x2ffe39){var _0x4826aa=function(_0x1d0f82){while(--_0x1d0f82){_0x81eff['push'](_0x81eff['shift']());}};_0x4826aa(++_0x2ffe39);}(_0x362f,0x79));var _0xf362=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x362f[_0x110c3d];return _0x226d67;};'use strict';var client=require(_0xf362('0x0'));exports[_0xf362('0x1')]=function(_0x3dd6be){return client[_0xf362('0x2')](_0xf362('0x3'),{'body':_0x3dd6be,'log':_0xf362('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 0a3fd7e..68a87b5 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 _0x615a=['getChatQueues','../client','Request','name','timeout','strategy','User','online'];(function(_0x4dedf7,_0x38fec4){var _0x25c222=function(_0x5195c8){while(--_0x5195c8){_0x4dedf7['push'](_0x4dedf7['shift']());}};_0x25c222(++_0x38fec4);}(_0x615a,0x119));var _0xa615=function(_0x5a1cc9,_0x28f54d){_0x5a1cc9=_0x5a1cc9-0x0;var _0x471761=_0x615a[_0x5a1cc9];return _0x471761;};'use strict';var client=require(_0xa615('0x0'));exports['getChatQueues']=function(){return function(){return client[_0xa615('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xa615('0x2'),_0xa615('0x3'),_0xa615('0x4')],'include':[{'model':_0xa615('0x5'),'as':'Agents','attributes':['id',_0xa615('0x2'),_0xa615('0x6'),'chatPause']}]},'log':_0xa615('0x7')});};}; \ No newline at end of file +var _0x943c=['../client','getChatQueues','Request','GetChatQueue','strategy','User','Agents','online','chatPause'];(function(_0x4be0dd,_0x25d777){var _0x1e6225=function(_0x2cb775){while(--_0x2cb775){_0x4be0dd['push'](_0x4be0dd['shift']());}};_0x1e6225(++_0x25d777);}(_0x943c,0xd8));var _0xc943=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x943c[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xc943('0x0'));exports[_0xc943('0x1')]=function(){return function(){return client[_0xc943('0x2')](_0xc943('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xc943('0x4')],'include':[{'model':_0xc943('0x5'),'as':_0xc943('0x6'),'attributes':['id','name',_0xc943('0x7'),_0xc943('0x8')]}]},'log':_0xc943('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 5922d16..2b3d711 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 _0x25ad=['DESC','../client','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x25ad,0x1b1));var _0xd25a=function(_0x1f0bba,_0x430c51){_0x1f0bba=_0x1f0bba-0x0;var _0x258c06=_0x25ad[_0x1f0bba];return _0x258c06;};'use strict';var client=require(_0xd25a('0x0'));exports['create']=function(_0xa9ddeb){return client[_0xd25a('0x1')](_0xd25a('0x2'),{'body':_0xa9ddeb,'log':'CreateChatQueueReport'});};exports[_0xd25a('0x3')]=function(_0x3a67e3,_0x1532c5){return client[_0xd25a('0x1')](_0xd25a('0x4'),{'body':_0x1532c5,'options':{'where':{'uniqueid':_0x3a67e3},'order':[['id',_0xd25a('0x5')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +var _0xdab2=['update','UpdateChatQueueReport','DESC','../client','create','Request','CreateChatQueueReport'];(function(_0x4a8f7c,_0x1ce89d){var _0x3811d6=function(_0x2a1fd7){while(--_0x2a1fd7){_0x4a8f7c['push'](_0x4a8f7c['shift']());}};_0x3811d6(++_0x1ce89d);}(_0xdab2,0x130));var _0x2dab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdab2[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x2dab('0x0'));exports[_0x2dab('0x1')]=function(_0x50addb){return client[_0x2dab('0x2')](_0x2dab('0x3'),{'body':_0x50addb,'log':_0x2dab('0x3')});};exports[_0x2dab('0x4')]=function(_0x56a9cc,_0x2078be){return client[_0x2dab('0x2')](_0x2dab('0x5'),{'body':_0x2078be,'options':{'where':{'uniqueid':_0x56a9cc},'order':[['id',_0x2dab('0x6')]],'limit':0x1},'log':_0x2dab('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index d1045ed..db2b4e9 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(_0x444443,_0x244b77){var _0x3dcad2=function(_0x410f9a){while(--_0x410f9a){_0x444443['push'](_0x444443['shift']());}};_0x3dcad2(++_0x244b77);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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(_0xbc107a,_0x2cf678){var _0x102943=function(_0x3432af){while(--_0x3432af){_0xbc107a['push'](_0xbc107a['shift']());}};_0x102943(++_0x2cf678);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index bda61e2..7e9b5d1 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 _0xdbf8=['Request','createFaxMessage','../client'];(function(_0x1f4496,_0x478a0d){var _0x3ea776=function(_0x74fbb1){while(--_0x74fbb1){_0x1f4496['push'](_0x1f4496['shift']());}};_0x3ea776(++_0x478a0d);}(_0xdbf8,0x128));var _0x8dbf=function(_0x74562b,_0x4bbcc5){_0x74562b=_0x74562b-0x0;var _0x12d3f6=_0xdbf8[_0x74562b];return _0x12d3f6;};'use strict';var client=require(_0x8dbf('0x0'));exports['create']=function(_0x54a8d4){return client[_0x8dbf('0x1')]('CreateFaxMessage',{'body':_0x54a8d4,'log':_0x8dbf('0x2')});}; \ No newline at end of file +var _0x2411=['Request','CreateFaxMessage','createFaxMessage','../client'];(function(_0x176637,_0x5810f8){var _0x447a7c=function(_0x739398){while(--_0x739398){_0x176637['push'](_0x176637['shift']());}};_0x447a7c(++_0x5810f8);}(_0x2411,0xfb));var _0x1241=function(_0x5c9307,_0x5b97e4){_0x5c9307=_0x5c9307-0x0;var _0x373e29=_0x2411[_0x5c9307];return _0x373e29;};'use strict';var client=require(_0x1241('0x0'));exports['create']=function(_0x3a376b){return client[_0x1241('0x1')](_0x1241('0x2'),{'body':_0x3a376b,'log':_0x1241('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 2139fe8..1112d6c 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 _0x7317=['Agents','faxPause','../client','getFaxQueues','Request','GetFaxQueue'];(function(_0x2dc399,_0x52d662){var _0x44ab8d=function(_0x461664){while(--_0x461664){_0x2dc399['push'](_0x2dc399['shift']());}};_0x44ab8d(++_0x52d662);}(_0x7317,0x1d0));var _0x7731=function(_0x541605,_0x17344b){_0x541605=_0x541605-0x0;var _0x5d66cd=_0x7317[_0x541605];return _0x5d66cd;};'use strict';var client=require(_0x7731('0x0'));exports[_0x7731('0x1')]=function(){return function(){return client[_0x7731('0x2')](_0x7731('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout','strategy'],'include':[{'model':'User','as':_0x7731('0x4'),'attributes':['id','name','online',_0x7731('0x5')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x6ffe=['getFaxQueues','../client','Request','GetFaxQueue','name','strategy','User','Agents','online','faxPause'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x6ffe,0xfb));var _0xe6ff=function(_0x22d7bb,_0x4c158e){_0x22d7bb=_0x22d7bb-0x0;var _0x40a737=_0x6ffe[_0x22d7bb];return _0x40a737;};'use strict';var client=require(_0xe6ff('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0xe6ff('0x1')](_0xe6ff('0x2'),{'options':{'raw':![],'attributes':['id',_0xe6ff('0x3'),'timeout',_0xe6ff('0x4')],'include':[{'model':_0xe6ff('0x5'),'as':_0xe6ff('0x6'),'attributes':['id',_0xe6ff('0x3'),_0xe6ff('0x7'),_0xe6ff('0x8')]}]},'log':_0xe6ff('0x9')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 5b90bee..fc1f1f8 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 _0x3805=['CreateFaxQueueReport','update','UpdateFaxQueueReport','../client','create'];(function(_0x119681,_0x26d5d9){var _0x2102e1=function(_0x1a276f){while(--_0x1a276f){_0x119681['push'](_0x119681['shift']());}};_0x2102e1(++_0x26d5d9);}(_0x3805,0x1f2));var _0x5380=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x3805[_0x5ddb1c];return _0x354adc;};'use strict';var client=require(_0x5380('0x0'));exports[_0x5380('0x1')]=function(_0xf1498){return client['Request'](_0x5380('0x2'),{'body':_0xf1498,'log':_0x5380('0x2')});};exports[_0x5380('0x3')]=function(_0x586640,_0x42a887){return client['Request']('UpdateFaxQueueReport',{'body':_0x42a887,'options':{'where':{'uniqueid':_0x586640},'order':[['id','DESC']],'limit':0x1},'log':_0x5380('0x4')});}; \ No newline at end of file +var _0xaf40=['update','UpdateFaxQueueReport','DESC','create','Request','CreateFaxQueueReport'];(function(_0x44dee8,_0x55f584){var _0x12419b=function(_0x178595){while(--_0x178595){_0x44dee8['push'](_0x44dee8['shift']());}};_0x12419b(++_0x55f584);}(_0xaf40,0x75));var _0x0af4=function(_0x478597,_0x273a3d){_0x478597=_0x478597-0x0;var _0x13e66b=_0xaf40[_0x478597];return _0x13e66b;};'use strict';var client=require('../client');exports[_0x0af4('0x0')]=function(_0x1e1a16){return client[_0x0af4('0x1')](_0x0af4('0x2'),{'body':_0x1e1a16,'log':_0x0af4('0x2')});};exports[_0x0af4('0x3')]=function(_0x2e367a,_0x35be09){return client[_0x0af4('0x1')](_0x0af4('0x4'),{'body':_0x35be09,'options':{'where':{'uniqueid':_0x2e367a},'order':[['id',_0x0af4('0x5')]],'limit':0x1},'log':_0x0af4('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 285bcbc..67a69c7 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 _0x9fd9=['Intervals','interval','../client','getIntervals','Request','GetInterval'];(function(_0x266b6e,_0x184c0d){var _0x3edd74=function(_0x3f3c9a){while(--_0x3f3c9a){_0x266b6e['push'](_0x266b6e['shift']());}};_0x3edd74(++_0x184c0d);}(_0x9fd9,0xf2));var _0x99fd=function(_0x295a3b,_0x2e4807){_0x295a3b=_0x295a3b-0x0;var _0x326794=_0x9fd9[_0x295a3b];return _0x326794;};'use strict';var client=require(_0x99fd('0x0'));exports[_0x99fd('0x1')]=function(){return function(){return client[_0x99fd('0x2')](_0x99fd('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':'Interval','as':_0x99fd('0x4'),'attributes':['id','name',_0x99fd('0x5')]}]},'log':_0x99fd('0x1')});};}; \ No newline at end of file +var _0x8ced=['GetInterval','name','Interval','Intervals','getIntervals','Request'];(function(_0x3d6b2c,_0x1f864b){var _0x525fc0=function(_0x3b0ec5){while(--_0x3b0ec5){_0x3d6b2c['push'](_0x3d6b2c['shift']());}};_0x525fc0(++_0x1f864b);}(_0x8ced,0x119));var _0xd8ce=function(_0x154f66,_0x116f85){_0x154f66=_0x154f66-0x0;var _0x3f947a=_0x8ced[_0x154f66];return _0x3f947a;};'use strict';var client=require('../client');exports['getIntervals']=function(){return function(){return client[_0xd8ce('0x0')](_0xd8ce('0x1'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xd8ce('0x2')],'include':[{'model':_0xd8ce('0x3'),'as':_0xd8ce('0x4'),'attributes':['id','name','interval']}]},'log':_0xd8ce('0x5')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index c04146a..6199406 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 _0x5204=['update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x561771,_0x554760){var _0x54d16e=function(_0x381c1f){while(--_0x381c1f){_0x561771['push'](_0x561771['shift']());}};_0x54d16e(++_0x554760);}(_0x5204,0xdf));var _0x4520=function(_0x15d18f,_0x126b0e){_0x15d18f=_0x15d18f-0x0;var _0xd12bf7=_0x5204[_0x15d18f];return _0xd12bf7;};'use strict';var client=require(_0x4520('0x0'));exports[_0x4520('0x1')]=function(_0x53b1ab,_0x12a3a1){return client[_0x4520('0x2')](_0x4520('0x3'),{'body':_0x12a3a1,'options':{'where':{'id':_0x53b1ab}},'log':_0x4520('0x4')});};exports[_0x4520('0x5')]=function(_0x592fe0,_0x41d89c){return client['Request'](_0x4520('0x6'),{'body':_0x41d89c,'options':{'where':{'id':_0x592fe0}},'log':_0x4520('0x7')});}; \ No newline at end of file +var _0xf61e=['addTags','AddTagsToMailInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x5d7227,_0x12aebe){var _0x15ac55=function(_0x58d13e){while(--_0x58d13e){_0x5d7227['push'](_0x5d7227['shift']());}};_0x15ac55(++_0x12aebe);}(_0xf61e,0x191));var _0xef61=function(_0x1dfe33,_0x52da21){_0x1dfe33=_0x1dfe33-0x0;var _0x26971b=_0xf61e[_0x1dfe33];return _0x26971b;};'use strict';var client=require(_0xef61('0x0'));exports[_0xef61('0x1')]=function(_0xe535c3,_0xcf15bd){return client[_0xef61('0x2')](_0xef61('0x3'),{'body':_0xcf15bd,'options':{'where':{'id':_0xe535c3}},'log':_0xef61('0x4')});};exports[_0xef61('0x5')]=function(_0x2bd1d0,_0x14122a){return client[_0xef61('0x2')](_0xef61('0x6'),{'body':_0x14122a,'options':{'where':{'id':_0x2bd1d0}},'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 5609d20..3a6bd65 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 _0xf5c6=['createMailMessage','Request','CreateMailMessage'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xf5c6,0x1ea));var _0x6f5c=function(_0x4ba0f,_0x2e980f){_0x4ba0f=_0x4ba0f-0x0;var _0x2dfca1=_0xf5c6[_0x4ba0f];return _0x2dfca1;};'use strict';var client=require('../client');exports['create']=function(_0x107dcd){return client[_0x6f5c('0x0')](_0x6f5c('0x1'),{'body':_0x107dcd,'log':_0x6f5c('0x2')});}; \ No newline at end of file +var _0x8627=['createMailMessage','../client','create','Request'];(function(_0x588db5,_0x14b05d){var _0x355c5d=function(_0x1f5e14){while(--_0x1f5e14){_0x588db5['push'](_0x588db5['shift']());}};_0x355c5d(++_0x14b05d);}(_0x8627,0xed));var _0x7862=function(_0x74c39e,_0x10e068){_0x74c39e=_0x74c39e-0x0;var _0x5a81a5=_0x8627[_0x74c39e];return _0x5a81a5;};'use strict';var client=require(_0x7862('0x0'));exports[_0x7862('0x1')]=function(_0x12bfea){return client[_0x7862('0x2')]('CreateMailMessage',{'body':_0x12bfea,'log':_0x7862('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 19e0444..17af30d 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 _0x1980=['online','mailPause','../client','getMailQueues','Request','GetMailQueue','name','timeout','strategy','Agents'];(function(_0x25f9d4,_0x2f3ccb){var _0x1460e6=function(_0x32f966){while(--_0x32f966){_0x25f9d4['push'](_0x25f9d4['shift']());}};_0x1460e6(++_0x2f3ccb);}(_0x1980,0x1ec));var _0x0198=function(_0x4e350c,_0x3b736b){_0x4e350c=_0x4e350c-0x0;var _0x17c622=_0x1980[_0x4e350c];return _0x17c622;};'use strict';var client=require(_0x0198('0x0'));exports[_0x0198('0x1')]=function(){return function(){return client[_0x0198('0x2')](_0x0198('0x3'),{'options':{'raw':![],'attributes':['id',_0x0198('0x4'),_0x0198('0x5'),_0x0198('0x6')],'include':[{'model':'User','as':_0x0198('0x7'),'attributes':['id',_0x0198('0x4'),_0x0198('0x8'),_0x0198('0x9')]}]},'log':_0x0198('0x1')});};}; \ No newline at end of file +var _0xa402=['GetMailQueue','name','strategy','User','Agents','online','getMailQueues','Request'];(function(_0x3ba12b,_0x12ef40){var _0x3b796c=function(_0x3c91af){while(--_0x3c91af){_0x3ba12b['push'](_0x3ba12b['shift']());}};_0x3b796c(++_0x12ef40);}(_0xa402,0x76));var _0x2a40=function(_0x27064e,_0x34e92b){_0x27064e=_0x27064e-0x0;var _0x270d37=_0xa402[_0x27064e];return _0x270d37;};'use strict';var client=require('../client');exports[_0x2a40('0x0')]=function(){return function(){return client[_0x2a40('0x1')](_0x2a40('0x2'),{'options':{'raw':![],'attributes':['id',_0x2a40('0x3'),'timeout',_0x2a40('0x4')],'include':[{'model':_0x2a40('0x5'),'as':_0x2a40('0x6'),'attributes':['id','name',_0x2a40('0x7'),'mailPause']}]},'log':_0x2a40('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 1a04472..eb236c7 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 _0x253c=['Request','update','UpdateMailQueueReport','DESC','../client'];(function(_0x132693,_0xcf878d){var _0x3933a6=function(_0x4a1e3){while(--_0x4a1e3){_0x132693['push'](_0x132693['shift']());}};_0x3933a6(++_0xcf878d);}(_0x253c,0x12b));var _0xc253=function(_0x317257,_0x1677dc){_0x317257=_0x317257-0x0;var _0x1f235d=_0x253c[_0x317257];return _0x1f235d;};'use strict';var client=require(_0xc253('0x0'));exports['create']=function(_0x2d8aca){return client[_0xc253('0x1')]('CreateMailQueueReport',{'body':_0x2d8aca,'log':'CreateMailQueueReport'});};exports[_0xc253('0x2')]=function(_0x2c9435,_0x53058e){return client['Request'](_0xc253('0x3'),{'body':_0x53058e,'options':{'where':{'uniqueid':_0x2c9435},'order':[['id',_0xc253('0x4')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0xeff4=['DESC','UpdateMailQueueReport','create','CreateMailQueueReport','update'];(function(_0x49ac90,_0x4ad5d6){var _0x31282f=function(_0x23d334){while(--_0x23d334){_0x49ac90['push'](_0x49ac90['shift']());}};_0x31282f(++_0x4ad5d6);}(_0xeff4,0xd9));var _0x4eff=function(_0x4a209a,_0x575ff9){_0x4a209a=_0x4a209a-0x0;var _0x4b3c20=_0xeff4[_0x4a209a];return _0x4b3c20;};'use strict';var client=require('../client');exports[_0x4eff('0x0')]=function(_0x4dda97){return client['Request']('CreateMailQueueReport',{'body':_0x4dda97,'log':_0x4eff('0x1')});};exports[_0x4eff('0x2')]=function(_0x590fc2,_0x376b51){return client['Request']('UpdateMailQueueReport',{'body':_0x376b51,'options':{'where':{'uniqueid':_0x590fc2},'order':[['id',_0x4eff('0x3')]],'limit':0x1},'log':_0x4eff('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 4ab781d..c7f4f26 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 _0x73a6=['../client','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','addTagsToChatInteraction'];(function(_0x45975f,_0x475637){var _0x5c3424=function(_0x24b7e4){while(--_0x24b7e4){_0x45975f['push'](_0x45975f['shift']());}};_0x5c3424(++_0x475637);}(_0x73a6,0x1c2));var _0x673a=function(_0x5e5203,_0x4335bf){_0x5e5203=_0x5e5203-0x0;var _0x2bcc8e=_0x73a6[_0x5e5203];return _0x2bcc8e;};'use strict';var client=require(_0x673a('0x0'));exports['update']=function(_0x1a4088,_0x376af3){return client[_0x673a('0x1')](_0x673a('0x2'),{'body':_0x376af3,'options':{'where':{'id':_0x1a4088}},'log':_0x673a('0x3')});};exports[_0x673a('0x4')]=function(_0x224f2e,_0xec25a4){return client['Request']('AddTagsToOpenchannelInteraction',{'body':_0xec25a4,'options':{'where':{'id':_0x224f2e}},'log':_0x673a('0x5')});}; \ No newline at end of file +var _0x70b0=['updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','../client','update','Request'];(function(_0x420bc5,_0x12cb6d){var _0x5ac5fb=function(_0x1f064f){while(--_0x1f064f){_0x420bc5['push'](_0x420bc5['shift']());}};_0x5ac5fb(++_0x12cb6d);}(_0x70b0,0xe1));var _0x070b=function(_0x51f4fc,_0x1fe3ef){_0x51f4fc=_0x51f4fc-0x0;var _0x4d96fc=_0x70b0[_0x51f4fc];return _0x4d96fc;};'use strict';var client=require(_0x070b('0x0'));exports[_0x070b('0x1')]=function(_0x27c9ab,_0x571034){return client[_0x070b('0x2')]('UpdateOpenchannelInteraction',{'body':_0x571034,'options':{'where':{'id':_0x27c9ab}},'log':_0x070b('0x3')});};exports[_0x070b('0x4')]=function(_0x19bf85,_0x4eeb69){return client[_0x070b('0x2')](_0x070b('0x5'),{'body':_0x4eeb69,'options':{'where':{'id':_0x19bf85}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 51fce58..c54381c 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 _0x9d75=['../client','create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x9d75,0x16d));var _0x59d7=function(_0x81fca3,_0x2fe4b6){_0x81fca3=_0x81fca3-0x0;var _0x1914f3=_0x9d75[_0x81fca3];return _0x1914f3;};'use strict';var client=require(_0x59d7('0x0'));exports[_0x59d7('0x1')]=function(_0x353a31){return client[_0x59d7('0x2')](_0x59d7('0x3'),{'body':_0x353a31,'log':_0x59d7('0x4')});}; \ No newline at end of file +var _0xd8e1=['Request','CreateOpenchannelMessage','createOpenchannelMessage','create'];(function(_0x323708,_0x4bebf2){var _0x3da3d7=function(_0x5aa71c){while(--_0x5aa71c){_0x323708['push'](_0x323708['shift']());}};_0x3da3d7(++_0x4bebf2);}(_0xd8e1,0x143));var _0x1d8e=function(_0x414297,_0x18578e){_0x414297=_0x414297-0x0;var _0x51ea47=_0xd8e1[_0x414297];return _0x51ea47;};'use strict';var client=require('../client');exports[_0x1d8e('0x0')]=function(_0x5d38cd){return client[_0x1d8e('0x1')](_0x1d8e('0x2'),{'body':_0x5d38cd,'log':_0x1d8e('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index ccc1b50..3e0fbab 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 _0xb969=['timeout','strategy','Agents','online','openchannelPause','Request','GetOpenchannelQueue','name'];(function(_0x382b59,_0xac83a){var _0x1c8b18=function(_0x5bc4f6){while(--_0x5bc4f6){_0x382b59['push'](_0x382b59['shift']());}};_0x1c8b18(++_0xac83a);}(_0xb969,0x9d));var _0x9b96=function(_0x3a8e33,_0x5e6dc7){_0x3a8e33=_0x3a8e33-0x0;var _0x5c6a44=_0xb969[_0x3a8e33];return _0x5c6a44;};'use strict';var client=require('../client');exports['getOpenchannelQueues']=function(){return function(){return client[_0x9b96('0x0')](_0x9b96('0x1'),{'options':{'raw':![],'attributes':['id',_0x9b96('0x2'),_0x9b96('0x3'),_0x9b96('0x4')],'include':[{'model':'User','as':_0x9b96('0x5'),'attributes':['id','name',_0x9b96('0x6'),_0x9b96('0x7')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0xc9d9=['online','../client','getOpenchannelQueues','Request','name','timeout','strategy','Agents'];(function(_0x3e6d5d,_0x264c7a){var _0x238923=function(_0x201b19){while(--_0x201b19){_0x3e6d5d['push'](_0x3e6d5d['shift']());}};_0x238923(++_0x264c7a);}(_0xc9d9,0x141));var _0x9c9d=function(_0x50f8d1,_0x20029d){_0x50f8d1=_0x50f8d1-0x0;var _0x631016=_0xc9d9[_0x50f8d1];return _0x631016;};'use strict';var client=require(_0x9c9d('0x0'));exports[_0x9c9d('0x1')]=function(){return function(){return client[_0x9c9d('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x9c9d('0x3'),_0x9c9d('0x4'),_0x9c9d('0x5')],'include':[{'model':'User','as':_0x9c9d('0x6'),'attributes':['id',_0x9c9d('0x3'),_0x9c9d('0x7'),'openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 36ce37c..e3ba140 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 _0xed55=['Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','create'];(function(_0x5d30f9,_0x16447b){var _0x4c9f07=function(_0x300347){while(--_0x300347){_0x5d30f9['push'](_0x5d30f9['shift']());}};_0x4c9f07(++_0x16447b);}(_0xed55,0xcb));var _0x5ed5=function(_0x47a12a,_0x70f591){_0x47a12a=_0x47a12a-0x0;var _0x30cd40=_0xed55[_0x47a12a];return _0x30cd40;};'use strict';var client=require('../client');exports[_0x5ed5('0x0')]=function(_0x2b889a){return client[_0x5ed5('0x1')](_0x5ed5('0x2'),{'body':_0x2b889a,'log':_0x5ed5('0x2')});};exports['update']=function(_0x1e4b61,_0x1dc0bb){return client['Request'](_0x5ed5('0x3'),{'body':_0x1dc0bb,'options':{'where':{'uniqueid':_0x1e4b61},'order':[['id','DESC']],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0xa0f2=['CreateOpenchannelQueueReport','update','DESC','UpdateOpenchannelQueueReport','../client','create','Request'];(function(_0x10e1d5,_0x38f4ac){var _0x472678=function(_0x213ec4){while(--_0x213ec4){_0x10e1d5['push'](_0x10e1d5['shift']());}};_0x472678(++_0x38f4ac);}(_0xa0f2,0x19a));var _0x2a0f=function(_0x574c51,_0x17628b){_0x574c51=_0x574c51-0x0;var _0x233481=_0xa0f2[_0x574c51];return _0x233481;};'use strict';var client=require(_0x2a0f('0x0'));exports[_0x2a0f('0x1')]=function(_0x28558d){return client[_0x2a0f('0x2')](_0x2a0f('0x3'),{'body':_0x28558d,'log':_0x2a0f('0x3')});};exports[_0x2a0f('0x4')]=function(_0x263674,_0xe8e7e5){return client[_0x2a0f('0x2')]('UpdateOpenchannelQueueReport',{'body':_0xe8e7e5,'options':{'where':{'uniqueid':_0x263674},'order':[['id',_0x2a0f('0x5')]],'limit':0x1},'log':_0x2a0f('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 7bdeb95..fcaef38 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 _0x6c32=['Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update'];(function(_0x5a1585,_0x3a8636){var _0x53129e=function(_0x1cab36){while(--_0x1cab36){_0x5a1585['push'](_0x5a1585['shift']());}};_0x53129e(++_0x3a8636);}(_0x6c32,0x6e));var _0x26c3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6c32[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x26c3('0x0'));exports[_0x26c3('0x1')]=function(_0x3049a5,_0x416a62){return client[_0x26c3('0x2')](_0x26c3('0x3'),{'body':_0x416a62,'options':{'where':{'id':_0x3049a5}},'log':_0x26c3('0x4')});};exports[_0x26c3('0x5')]=function(_0x36528a,_0x49d4a1){return client[_0x26c3('0x2')](_0x26c3('0x6'),{'body':_0x49d4a1,'options':{'where':{'id':_0x36528a}},'log':_0x26c3('0x7')});}; \ No newline at end of file +var _0x269f=['Request','updateSmsInteraction','addTags','addTagsToSmsInteraction','../client','update'];(function(_0x4a8832,_0x54ed9a){var _0x4084e6=function(_0x3830cb){while(--_0x3830cb){_0x4a8832['push'](_0x4a8832['shift']());}};_0x4084e6(++_0x54ed9a);}(_0x269f,0xee));var _0xf269=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x269f[_0x59ee6f];return _0x4c0979;};'use strict';var client=require(_0xf269('0x0'));exports[_0xf269('0x1')]=function(_0x31447d,_0x501fb4){return client[_0xf269('0x2')]('UpdateSmsInteraction',{'body':_0x501fb4,'options':{'where':{'id':_0x31447d}},'log':_0xf269('0x3')});};exports[_0xf269('0x4')]=function(_0x230d12,_0x22032a){return client[_0xf269('0x2')]('AddTagsToSmsInteraction',{'body':_0x22032a,'options':{'where':{'id':_0x230d12}},'log':_0xf269('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 91540f4..7fce165 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 _0xb0a2=['CreateSmsMessage','createSmsMessage','Request'];(function(_0x4abc87,_0x1bc7da){var _0x5fc4df=function(_0x3d2eef){while(--_0x3d2eef){_0x4abc87['push'](_0x4abc87['shift']());}};_0x5fc4df(++_0x1bc7da);}(_0xb0a2,0x9e));var _0x2b0a=function(_0xde95e2,_0x2dd4e1){_0xde95e2=_0xde95e2-0x0;var _0x3997cf=_0xb0a2[_0xde95e2];return _0x3997cf;};'use strict';var client=require('../client');exports['create']=function(_0x4c1ac6){return client[_0x2b0a('0x0')](_0x2b0a('0x1'),{'body':_0x4c1ac6,'log':_0x2b0a('0x2')});}; \ No newline at end of file +var _0x6deb=['../client','create','Request','CreateSmsMessage'];(function(_0x116378,_0x484a53){var _0x3161c1=function(_0xcd5de5){while(--_0xcd5de5){_0x116378['push'](_0x116378['shift']());}};_0x3161c1(++_0x484a53);}(_0x6deb,0xe8));var _0xb6de=function(_0x4629ff,_0x2e12ac){_0x4629ff=_0x4629ff-0x0;var _0x52dff1=_0x6deb[_0x4629ff];return _0x52dff1;};'use strict';var client=require(_0xb6de('0x0'));exports[_0xb6de('0x1')]=function(_0x4dde27){return client[_0xb6de('0x2')](_0xb6de('0x3'),{'body':_0x4dde27,'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 4449b97..e7b0a14 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x5309f9,_0x148e41){var _0x3d0201=function(_0x41d866){while(--_0x41d866){_0x5309f9['push'](_0x5309f9['shift']());}};_0x3d0201(++_0x148e41);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file +var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x4c403d,_0x5ef49f){var _0x5a0c35=function(_0x40ba5a){while(--_0x40ba5a){_0x4c403d['push'](_0x4c403d['shift']());}};_0x5a0c35(++_0x5ef49f);}(_0x70e0,0x17b));var _0x070e=function(_0x276152,_0x25b911){_0x276152=_0x276152-0x0;var _0x5b7b74=_0x70e0[_0x276152];return _0x5b7b74;};'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 35aa439..1a3b82b 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 _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x58ceb9,_0x5601df){var _0x3d0ff5=function(_0x3a79d0){while(--_0x3a79d0){_0x58ceb9['push'](_0x58ceb9['shift']());}};_0x3d0ff5(++_0x5601df);}(_0xedd9,0xfc));var _0x9edd=function(_0x2d5f02,_0x5529cb){_0x2d5f02=_0x2d5f02-0x0;var _0x51b507=_0xedd9[_0x2d5f02];return _0x51b507;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x2')});};exports[_0x9edd('0x3')]=function(_0x3e6d3a,_0x36b53f){return client['Request'](_0x9edd('0x4'),{'body':_0x36b53f,'options':{'where':{'uniqueid':_0x3e6d3a},'order':[['id',_0x9edd('0x5')]],'limit':0x1},'log':_0x9edd('0x4')});}; \ No newline at end of file +var _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x467488,_0x38c7ae){var _0x56107f=function(_0x4992b3){while(--_0x4992b3){_0x467488['push'](_0x467488['shift']());}};_0x56107f(++_0x38c7ae);}(_0xedd9,0xfc));var _0x9edd=function(_0x270659,_0x411894){_0x270659=_0x270659-0x0;var _0x4b9caa=_0xedd9[_0x270659];return _0x4b9caa;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x2')});};exports[_0x9edd('0x3')]=function(_0x3e6d3a,_0x36b53f){return client['Request'](_0x9edd('0x4'),{'body':_0x36b53f,'options':{'where':{'uniqueid':_0x3e6d3a},'order':[['id',_0x9edd('0x5')]],'limit':0x1},'log':_0x9edd('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index a3a65df..a4563ca 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(_0x19d801,_0x36bc6c){var _0x5f5838=function(_0x460763){while(--_0x460763){_0x19d801['push'](_0x19d801['shift']());}};_0x5f5838(++_0x36bc6c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x225881,_0x29bc58){var _0x15a70e=function(_0x19ede4){while(--_0x19ede4){_0x225881['push'](_0x225881['shift']());}};_0x15a70e(++_0x29bc58);}(_0xa9e0,0x123));var _0x0a9e=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xa9e0[_0x28947d];return _0x12d2ee;};'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 46566ef..5fe5a90 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 _0x41fe=['addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0xbd37c2,_0x343d47){var _0x4b2c54=function(_0x40a76e){while(--_0x40a76e){_0xbd37c2['push'](_0xbd37c2['shift']());}};_0x4b2c54(++_0x343d47);}(_0x41fe,0xd1));var _0xe41f=function(_0x8ba19a,_0x1d2b2b){_0x8ba19a=_0x8ba19a-0x0;var _0x2bd8b4=_0x41fe[_0x8ba19a];return _0x2bd8b4;};'use strict';var client=require(_0xe41f('0x0'));exports[_0xe41f('0x1')]=function(_0x38cf9f,_0x2c527f){return client[_0xe41f('0x2')](_0xe41f('0x3'),{'body':_0x2c527f,'options':{'where':{'id':_0x38cf9f}},'log':_0xe41f('0x4')});};exports[_0xe41f('0x5')]=function(_0x2e580b,_0x1c9625){return client[_0xe41f('0x2')](_0xe41f('0x6'),{'body':_0x1c9625,'options':{'where':{'id':_0x2e580b}},'log':_0xe41f('0x7')});}; \ No newline at end of file +var _0x398a=['../client','update','Request','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x55ef8b,_0x5deb5e){var _0x359c84=function(_0x437673){while(--_0x437673){_0x55ef8b['push'](_0x55ef8b['shift']());}};_0x359c84(++_0x5deb5e);}(_0x398a,0x11a));var _0xa398=function(_0x29a9ac,_0x48964d){_0x29a9ac=_0x29a9ac-0x0;var _0x1fdc95=_0x398a[_0x29a9ac];return _0x1fdc95;};'use strict';var client=require(_0xa398('0x0'));exports[_0xa398('0x1')]=function(_0x279618,_0x1930a3){return client[_0xa398('0x2')](_0xa398('0x3'),{'body':_0x1930a3,'options':{'where':{'id':_0x279618}},'log':'updateWhatsappInteraction'});};exports['addTags']=function(_0x51a35c,_0x29c575){return client[_0xa398('0x2')](_0xa398('0x4'),{'body':_0x29c575,'options':{'where':{'id':_0x51a35c}},'log':_0xa398('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 09b520b..cb6b3df 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 _0xf12e=['../client','Request','createWhatsappMessage'];(function(_0x437156,_0xf15292){var _0xda882a=function(_0x480d77){while(--_0x480d77){_0x437156['push'](_0x437156['shift']());}};_0xda882a(++_0xf15292);}(_0xf12e,0x96));var _0xef12=function(_0x585276,_0x553f5a){_0x585276=_0x585276-0x0;var _0x4a7181=_0xf12e[_0x585276];return _0x4a7181;};'use strict';var client=require(_0xef12('0x0'));exports['create']=function(_0x182eaf){return client[_0xef12('0x1')]('CreateWhatsappMessage',{'body':_0x182eaf,'log':_0xef12('0x2')});}; \ No newline at end of file +var _0x7765=['create','Request','createWhatsappMessage','../client'];(function(_0x1f9e6e,_0xfb021){var _0x5308ff=function(_0x22e596){while(--_0x22e596){_0x1f9e6e['push'](_0x1f9e6e['shift']());}};_0x5308ff(++_0xfb021);}(_0x7765,0xfb));var _0x5776=function(_0x239496,_0xcf4b0c){_0x239496=_0x239496-0x0;var _0xefea8f=_0x7765[_0x239496];return _0xefea8f;};'use strict';var client=require(_0x5776('0x0'));exports[_0x5776('0x1')]=function(_0x4ec1f7){return client[_0x5776('0x2')]('CreateWhatsappMessage',{'body':_0x4ec1f7,'log':_0x5776('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index f73ce11..89d6941 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 _0xc3a1=['name','strategy','User','Agents','online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue'];(function(_0x13e709,_0x1e1ee4){var _0x254774=function(_0x58b877){while(--_0x58b877){_0x13e709['push'](_0x13e709['shift']());}};_0x254774(++_0x1e1ee4);}(_0xc3a1,0x182));var _0x1c3a=function(_0x193f6d,_0x212288){_0x193f6d=_0x193f6d-0x0;var _0xd62d52=_0xc3a1[_0x193f6d];return _0xd62d52;};'use strict';var client=require(_0x1c3a('0x0'));exports[_0x1c3a('0x1')]=function(){return function(){return client[_0x1c3a('0x2')](_0x1c3a('0x3'),{'options':{'raw':![],'attributes':['id',_0x1c3a('0x4'),'timeout',_0x1c3a('0x5')],'include':[{'model':_0x1c3a('0x6'),'as':_0x1c3a('0x7'),'attributes':['id',_0x1c3a('0x4'),_0x1c3a('0x8'),_0x1c3a('0x9')]}]},'log':_0x1c3a('0x1')});};}; \ No newline at end of file +var _0xcf10=['online','whatsappPause','getWhatsappQueues','Request','GetWhatsappQueue','timeout','User','Agents','name'];(function(_0x28c047,_0x5e77fa){var _0x442057=function(_0x5ec790){while(--_0x5ec790){_0x28c047['push'](_0x28c047['shift']());}};_0x442057(++_0x5e77fa);}(_0xcf10,0x1d6));var _0x0cf1=function(_0x3cae30,_0x5d8b99){_0x3cae30=_0x3cae30-0x0;var _0x263f77=_0xcf10[_0x3cae30];return _0x263f77;};'use strict';var client=require('../client');exports[_0x0cf1('0x0')]=function(){return function(){return client[_0x0cf1('0x1')](_0x0cf1('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x0cf1('0x3'),'strategy'],'include':[{'model':_0x0cf1('0x4'),'as':_0x0cf1('0x5'),'attributes':['id',_0x0cf1('0x6'),_0x0cf1('0x7'),_0x0cf1('0x8')]}]},'log':_0x0cf1('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 61109b1..e3b3ef7 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 _0x7f9e=['UpdateWhatsappQueueReport','DESC','create','Request','CreateWhatsappQueueReport','update'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x7f9e,0xec));var _0xe7f9=function(_0x1344d6,_0x2181e6){_0x1344d6=_0x1344d6-0x0;var _0xf45b24=_0x7f9e[_0x1344d6];return _0xf45b24;};'use strict';var client=require('../client');exports[_0xe7f9('0x0')]=function(_0x30fb73){return client[_0xe7f9('0x1')](_0xe7f9('0x2'),{'body':_0x30fb73,'log':_0xe7f9('0x2')});};exports[_0xe7f9('0x3')]=function(_0x58d9fa,_0xbbe7e6){return client[_0xe7f9('0x1')](_0xe7f9('0x4'),{'body':_0xbbe7e6,'options':{'where':{'uniqueid':_0x58d9fa},'order':[['id',_0xe7f9('0x5')]],'limit':0x1},'log':_0xe7f9('0x4')});}; \ No newline at end of file +var _0x9f01=['create','Request','CreateWhatsappQueueReport','UpdateWhatsappQueueReport','DESC','../client'];(function(_0x5a32b9,_0x154d11){var _0x23c709=function(_0x457328){while(--_0x457328){_0x5a32b9['push'](_0x5a32b9['shift']());}};_0x23c709(++_0x154d11);}(_0x9f01,0x1c1));var _0x19f0=function(_0x50d9cc,_0xa18a88){_0x50d9cc=_0x50d9cc-0x0;var _0x142e45=_0x9f01[_0x50d9cc];return _0x142e45;};'use strict';var client=require(_0x19f0('0x0'));exports[_0x19f0('0x1')]=function(_0x10f92a){return client[_0x19f0('0x2')](_0x19f0('0x3'),{'body':_0x10f92a,'log':_0x19f0('0x3')});};exports['update']=function(_0x10d688,_0xd81d23){return client['Request'](_0x19f0('0x4'),{'body':_0xd81d23,'options':{'where':{'uniqueid':_0x10d688},'order':[['id',_0x19f0('0x5')]],'limit':0x1},'log':_0x19f0('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 818a25a..fb6a35e 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 _0x3f26=['stop','find','agents','atimeout','channel','START:%s','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','next','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','../../../../config/logger','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','format','name','toLowerCase','consequence','map','join'];(function(_0x25ff7e,_0x492eb8){var _0x1e8dcc=function(_0x1b1120){while(--_0x1b1120){_0x25ff7e['push'](_0x25ff7e['shift']());}};_0x1e8dcc(++_0x492eb8);}(_0x3f26,0x148));var _0x63f2=function(_0x5db5fc,_0x61dacf){_0x5db5fc=_0x5db5fc-0x0;var _0x214470=_0x3f26[_0x5db5fc];return _0x214470;};'use strict';var schema=require('validate');var _=require(_0x63f2('0x0'));var util=require(_0x63f2('0x1'));var seqqueue=require(_0x63f2('0x2'));var logger=require(_0x63f2('0x3'))('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':'string','required':!![],'message':_0x63f2('0x4')},'timeout':{'type':_0x63f2('0x5'),'message':_0x63f2('0x6')}});function writeLog(_0x5ef2a0,_0x39554a,_0x12723d){return logger['info'](util[_0x63f2('0x7')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x5ef2a0,_0x39554a[_0x63f2('0x8')],_0x12723d));}function handleFindAgent(_0x5d7dc8){return function(_0x1ec53f){return _0x1ec53f[_0x63f2('0x8')][_0x63f2('0x9')]()===_0x5d7dc8[_0x63f2('0x9')]();};}exports[_0x63f2('0xa')]=function(_0x282eb6,_0x1794d4,_0x25ac5e,_0x4009f2){return function(_0x52031c){try{var _0x32ce9b={'name':_0x1794d4[0x0],'timeout':_0x1794d4[0x1]};var _0x472ccf=queue['validate'](_0x32ce9b,{'typecast':!![]});if(_0x472ccf['length']){logger['error']('[%s][AGENT]\x20%s',_0x282eb6,_[_0x63f2('0xb')](_0x472ccf,'message')[_0x63f2('0xc')](',\x20'));_0x52031c[_0x63f2('0xd')]();}else{var _0x29b8cb=_[_0x63f2('0xe')](_0x25ac5e[_0x63f2('0xf')],handleFindAgent(_0x32ce9b['name']));if(_0x29b8cb){var _0x50b514=(_0x32ce9b['timeout']||0xa)*0x3e8;var _0x3627c5,_0x51eac4;var _0x35d795=seqqueue['createQueue'](_0x50b514);_0x35d795['id']=_0x282eb6;_0x35d795[_0x63f2('0x10')]=_0x50b514;_0x35d795['channel']=_0x4009f2[_0x63f2('0x11')];writeLog(_0x282eb6,_0x29b8cb,util['format'](_0x63f2('0x12'),_0x50b514));_0x25ac5e[_0x63f2('0x13')][_0x282eb6]['on'](_0x63f2('0x14'),function(){logger[_0x63f2('0x15')](_0x63f2('0x16'),_0x282eb6);clearTimeout(_0x51eac4);_0x51eac4=undefined;_0x35d795[_0x63f2('0x17')]();if(_0x25ac5e['rules'][_0x282eb6]){delete _0x25ac5e['rules'][_0x282eb6];}_0x52031c[_0x63f2('0xd')]();});_0x25ac5e[_0x63f2('0x13')][_0x282eb6]['on'](_0x63f2('0x18'),function(){if(_0x25ac5e[_0x63f2('0x13')][_0x282eb6]){delete _0x25ac5e[_0x63f2('0x13')][_0x282eb6];}});_0x51eac4=setTimeout(function(){logger[_0x63f2('0x15')]('[%s][AGENT]\x20ROUTING\x20END',_0x282eb6);clearTimeout(_0x51eac4);_0x35d795['close']();_0x52031c[_0x63f2('0x19')]();},_0x50b514);strategy['agent'](_0x35d795,_0x29b8cb,_0x25ac5e,_0x4009f2);}else{logger[_0x63f2('0x1a')](_0x63f2('0x1b'),_0x282eb6,_0x32ce9b['name']);_0x52031c['stop']();}}}catch(_0x3a9288){console[_0x63f2('0x1c')](_0x3a9288);logger[_0x63f2('0x1a')](_0x63f2('0x1d'),_0x282eb6,_0x3a9288[_0x63f2('0x1e')]);_0x52031c[_0x63f2('0xd')]();}};}; \ No newline at end of file +var _0xdfb2=['rules','stop','complete','[%s][AGENT]\x20ROUTING\x20END','agent','log','[%s][QUEUE]\x20%s','stack','validate','util','../../../../config/logger','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','[%s][AGENT]\x20%s','map','message','find','agents','timeout','createQueue','atimeout','channel','format','end','close'];(function(_0x37e6b0,_0x3bd7ab){var _0x4f381f=function(_0x481a28){while(--_0x481a28){_0x37e6b0['push'](_0x37e6b0['shift']());}};_0x4f381f(++_0x3bd7ab);}(_0xdfb2,0xe8));var _0x2dfb=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xdfb2[_0x13ea00];return _0x1f7347;};'use strict';var schema=require(_0x2dfb('0x0'));var _=require('lodash');var util=require(_0x2dfb('0x1'));var seqqueue=require('seq-queue');var logger=require(_0x2dfb('0x2'))(_0x2dfb('0x3'));var strategy=require(_0x2dfb('0x4'));var queue=schema({'name':{'type':'string','required':!![],'message':_0x2dfb('0x5')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x34dc77,_0x306c6c,_0x54254b){return logger[_0x2dfb('0x6')](util['format'](_0x2dfb('0x7'),_0x34dc77,_0x306c6c[_0x2dfb('0x8')],_0x54254b));}function handleFindAgent(_0x897fe5){return function(_0x2ccf87){return _0x2ccf87['name'][_0x2dfb('0x9')]()===_0x897fe5[_0x2dfb('0x9')]();};}exports[_0x2dfb('0xa')]=function(_0x489e92,_0x40eb9a,_0x9b073a,_0x1467c5){return function(_0x15b0be){try{var _0x3e1d3c={'name':_0x40eb9a[0x0],'timeout':_0x40eb9a[0x1]};var _0x13a174=queue[_0x2dfb('0x0')](_0x3e1d3c,{'typecast':!![]});if(_0x13a174[_0x2dfb('0xb')]){logger['error'](_0x2dfb('0xc'),_0x489e92,_[_0x2dfb('0xd')](_0x13a174,_0x2dfb('0xe'))['join'](',\x20'));_0x15b0be['stop']();}else{var _0x4166e3=_[_0x2dfb('0xf')](_0x9b073a[_0x2dfb('0x10')],handleFindAgent(_0x3e1d3c['name']));if(_0x4166e3){var _0x32e743=(_0x3e1d3c[_0x2dfb('0x11')]||0xa)*0x3e8;var _0x11ed58,_0x1797f4;var _0x128876=seqqueue[_0x2dfb('0x12')](_0x32e743);_0x128876['id']=_0x489e92;_0x128876[_0x2dfb('0x13')]=_0x32e743;_0x128876['channel']=_0x1467c5[_0x2dfb('0x14')];writeLog(_0x489e92,_0x4166e3,util[_0x2dfb('0x15')]('START:%s',_0x32e743));_0x9b073a['rules'][_0x489e92]['on'](_0x2dfb('0x16'),function(){logger['info']('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x489e92);clearTimeout(_0x1797f4);_0x1797f4=undefined;_0x128876[_0x2dfb('0x17')]();if(_0x9b073a[_0x2dfb('0x18')][_0x489e92]){delete _0x9b073a['rules'][_0x489e92];}_0x15b0be[_0x2dfb('0x19')]();});_0x9b073a[_0x2dfb('0x18')][_0x489e92]['on'](_0x2dfb('0x1a'),function(){if(_0x9b073a[_0x2dfb('0x18')][_0x489e92]){delete _0x9b073a[_0x2dfb('0x18')][_0x489e92];}});_0x1797f4=setTimeout(function(){logger[_0x2dfb('0x6')](_0x2dfb('0x1b'),_0x489e92);clearTimeout(_0x1797f4);_0x128876[_0x2dfb('0x17')]();_0x15b0be['next']();},_0x32e743);strategy[_0x2dfb('0x1c')](_0x128876,_0x4166e3,_0x9b073a,_0x1467c5);}else{logger['error']('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x489e92,_0x3e1d3c[_0x2dfb('0x8')]);_0x15b0be[_0x2dfb('0x19')]();}}}catch(_0x461c6e){console[_0x2dfb('0x1d')](_0x461c6e);logger['error'](_0x2dfb('0x1e'),_0x489e92,_0x461c6e[_0x2dfb('0x1f')]);_0x15b0be[_0x2dfb('0x19')]();}};}; \ 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 291bc73..fa432ac 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 _0x80ee=['chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','getMustacheRender','Message','then','body','catch','error','stringify','finally','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','toString','postText','message','amazonlex','providerName','create','Failed','lodash','moment','aws-sdk','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','interaction','info','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone'];(function(_0x56138f,_0x1e9ebb){var _0x1acaf7=function(_0x48690d){while(--_0x48690d){_0x56138f['push'](_0x56138f['shift']());}};_0x1acaf7(++_0x1e9ebb);}(_0x80ee,0x199));var _0xe80e=function(_0x13eea8,_0x5ed8b2){_0x13eea8=_0x13eea8-0x0;var _0x255a29=_0x80ee[_0x13eea8];return _0x255a29;};'use strict';var _=require(_0xe80e('0x0'));var moment=require(_0xe80e('0x1'));var AWS=require(_0xe80e('0x2'));var utils=require(_0xe80e('0x3'));var logger=require('../../../../config/logger')(_0xe80e('0x4'));var rpc={'chatMessage':require(_0xe80e('0x5')),'openchannelMessage':require(_0xe80e('0x6')),'mailMessage':require(_0xe80e('0x7')),'smsMessage':require(_0xe80e('0x8')),'faxMessage':require(_0xe80e('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xe80e('0xa')]=function(_0x326357,_0x56c9d4){return function(_0x3f347b){try{if(!_['isNil'](this[_0xe80e('0xb')]['UserId'])){logger[_0xe80e('0xc')](_0xe80e('0xd'),_0x326357,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x3f347b[_0xe80e('0xe')]();}var _0x4892f2={'ContactId':this[_0xe80e('0xf')]['id'],'sentAt':moment()[_0xe80e('0x10')](_0xe80e('0x11')),'direction':_0xe80e('0x12')};if(this[_0xe80e('0x13')]===_0xe80e('0x14')||this['channel']===_0xe80e('0x15')){_0x4892f2[_0xe80e('0x16')]=this['interaction'][_0xe80e('0x16')];}var _0x43e0ca=this[_0xe80e('0x13')];if(_0x43e0ca===_0xe80e('0x17')){_0x4892f2[_0xe80e('0x18')]=this[_0xe80e('0x19')]['id'];}else{_0x4892f2[_[_0xe80e('0x1a')](_0x43e0ca)+_0xe80e('0x1b')]=this[_0xe80e('0x19')]['id'];}_0x4892f2[_[_0xe80e('0x1a')](_0x43e0ca)+_0xe80e('0x1c')]=this['interaction']['id'];if(this[_0xe80e('0xb')][_0xe80e('0x1d')]){var _0x512cc4=_0x56c9d4[0x4];if(!_['isEmpty'](_0x512cc4)){_0x4892f2['body']=utils[_0xe80e('0x1e')](_0x512cc4,this);return rpc[_0x43e0ca+_0xe80e('0x1f')]['create'](_0x4892f2)[_0xe80e('0x20')](function(_0xc9f2e1){logger[_0xe80e('0xc')](_0xe80e('0xd'),_0x326357,_0x4892f2[_0xe80e('0x21')]);})[_0xe80e('0x22')](function(_0x2a287b){logger[_0xe80e('0x23')]('[%s][AMAZONLEX]\x20%s',_0x326357,JSON[_0xe80e('0x24')](_0x2a287b));})[_0xe80e('0x25')](function(){logger[_0xe80e('0xc')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x326357);_0x3f347b[_0xe80e('0x26')]();});}else{logger[_0xe80e('0xc')](_0xe80e('0x27'),_0x326357);_0x3f347b[_0xe80e('0x26')]();}}else{var _0x3789bb=this;var _0x102dcd=new AWS[(_0xe80e('0x28'))]({'accessKeyId':_0x56c9d4[0x0],'secretAccessKey':_0x56c9d4[0x1],'region':_0x56c9d4[0x2]});var _0x29e756={'botAlias':'$LATEST','botName':_0x56c9d4[0x3],'inputText':this['message'][_0xe80e('0x21')],'userId':this[_0xe80e('0x13')]+':'+this[_0xe80e('0xb')]['id'][_0xe80e('0x29')]()};_0x102dcd[_0xe80e('0x2a')](_0x29e756,function(_0x21f307,_0x3237f0){if(_0x21f307){logger[_0xe80e('0x23')]('[%s][AMAZONLEX]\x20%s',_0x326357,_0x21f307['message']);_0x3f347b['next']();}else if(_0x3237f0&&_0x3237f0[_0xe80e('0x2b')]){_0x3789bb[_0xe80e('0x21')][_0xe80e('0x2c')]=_0x3237f0;_0x4892f2[_0xe80e('0x21')]=_0x3237f0[_0xe80e('0x2b')];_0x4892f2[_0xe80e('0x2d')]=_0xe80e('0x2c');_0x4892f2['providerResponse']=JSON[_0xe80e('0x24')](_0x3237f0);return rpc[_0x43e0ca+_0xe80e('0x1f')][_0xe80e('0x2e')](_0x4892f2)[_0xe80e('0x20')](function(_0x22a9a1){logger[_0xe80e('0xc')](_0xe80e('0xd'),_0x326357,_0x4892f2[_0xe80e('0x21')]);if(_0x3237f0['dialogState']==_0xe80e('0x2f')){_0x3f347b[_0xe80e('0xe')]();}else{_0x3f347b[_0xe80e('0x26')]();}})['catch'](function(_0x53bc75){logger['error'](_0xe80e('0xd'),_0x326357,JSON[_0xe80e('0x24')](_0x53bc75));_0x3f347b[_0xe80e('0xe')]();});}else{_0x3f347b[_0xe80e('0xe')]();}});}}catch(_0x4a6466){logger[_0xe80e('0x23')]('[%s][AMAZONLEX]\x20%s',_0x326357,JSON['stringify'](_0x4a6466));_0x3f347b[_0xe80e('0x26')]();}};}; \ No newline at end of file +var _0x1c65=['catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','toString','message','amazonlex','providerName','providerResponse','Message','dialogState','Failed','stop','lodash','moment','aws-sdk','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','create','then','info'];(function(_0x5aaf93,_0x5c0001){var _0x17d307=function(_0x21d77a){while(--_0x21d77a){_0x5aaf93['push'](_0x5aaf93['shift']());}};_0x17d307(++_0x5c0001);}(_0x1c65,0x1b9));var _0x51c6=function(_0x55d089,_0xb24c07){_0x55d089=_0x55d089-0x0;var _0x4ff4e2=_0x1c65[_0x55d089];return _0x4ff4e2;};'use strict';var _=require(_0x51c6('0x0'));var moment=require(_0x51c6('0x1'));var AWS=require(_0x51c6('0x2'));var utils=require(_0x51c6('0x3'));var logger=require(_0x51c6('0x4'))('routing');var rpc={'chatMessage':require(_0x51c6('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x51c6('0x6')),'smsMessage':require(_0x51c6('0x7')),'faxMessage':require(_0x51c6('0x8')),'whatsappMessage':require(_0x51c6('0x9'))};exports[_0x51c6('0xa')]=function(_0x41469f,_0x2fb0b2){return function(_0x14d58a){try{if(!_[_0x51c6('0xb')](this[_0x51c6('0xc')][_0x51c6('0xd')])){logger['info'](_0x51c6('0xe'),_0x41469f,_0x51c6('0xf'));return _0x14d58a[_0x51c6('0x10')]();}var _0x547297={'ContactId':this[_0x51c6('0x11')]['id'],'sentAt':moment()[_0x51c6('0x12')](_0x51c6('0x13')),'direction':_0x51c6('0x14')};if(this[_0x51c6('0x15')]===_0x51c6('0x16')||this[_0x51c6('0x15')]==='whatsapp'){_0x547297[_0x51c6('0x17')]=this[_0x51c6('0xc')][_0x51c6('0x17')];}var _0x5741e4=this[_0x51c6('0x15')];if(_0x5741e4===_0x51c6('0x18')){_0x547297[_0x51c6('0x19')]=this[_0x51c6('0x1a')]['id'];}else{_0x547297[_[_0x51c6('0x1b')](_0x5741e4)+'AccountId']=this[_0x51c6('0x1a')]['id'];}_0x547297[_[_0x51c6('0x1b')](_0x5741e4)+_0x51c6('0x1c')]=this[_0x51c6('0xc')]['id'];if(this[_0x51c6('0xc')][_0x51c6('0x1d')]){var _0x3a355c=_0x2fb0b2[0x4];if(!_[_0x51c6('0x1e')](_0x3a355c)){_0x547297[_0x51c6('0x1f')]=utils[_0x51c6('0x20')](_0x3a355c,this);return rpc[_0x5741e4+'Message'][_0x51c6('0x21')](_0x547297)[_0x51c6('0x22')](function(_0x197fc3){logger[_0x51c6('0x23')](_0x51c6('0xe'),_0x41469f,_0x547297[_0x51c6('0x1f')]);})[_0x51c6('0x24')](function(_0x54d9b4){logger[_0x51c6('0x25')]('[%s][AMAZONLEX]\x20%s',_0x41469f,JSON[_0x51c6('0x26')](_0x54d9b4));})[_0x51c6('0x27')](function(){logger[_0x51c6('0x23')](_0x51c6('0x28'),_0x41469f);_0x14d58a['stop']();});}else{logger[_0x51c6('0x23')](_0x51c6('0x29'),_0x41469f);_0x14d58a['stop']();}}else{var _0x55cb22=this;var _0x2e518d=new AWS[(_0x51c6('0x2a'))]({'accessKeyId':_0x2fb0b2[0x0],'secretAccessKey':_0x2fb0b2[0x1],'region':_0x2fb0b2[0x2]});var _0x3cc225={'botAlias':_0x51c6('0x2b'),'botName':_0x2fb0b2[0x3],'inputText':this['message'][_0x51c6('0x1f')],'userId':this['channel']+':'+this[_0x51c6('0xc')]['id'][_0x51c6('0x2c')]()};_0x2e518d['postText'](_0x3cc225,function(_0xfda46d,_0x405bf7){if(_0xfda46d){logger[_0x51c6('0x25')](_0x51c6('0xe'),_0x41469f,_0xfda46d[_0x51c6('0x2d')]);_0x14d58a[_0x51c6('0x10')]();}else if(_0x405bf7&&_0x405bf7[_0x51c6('0x2d')]){_0x55cb22[_0x51c6('0x1f')][_0x51c6('0x2e')]=_0x405bf7;_0x547297[_0x51c6('0x1f')]=_0x405bf7[_0x51c6('0x2d')];_0x547297[_0x51c6('0x2f')]=_0x51c6('0x2e');_0x547297[_0x51c6('0x30')]=JSON['stringify'](_0x405bf7);return rpc[_0x5741e4+_0x51c6('0x31')][_0x51c6('0x21')](_0x547297)[_0x51c6('0x22')](function(_0x41a6e1){logger[_0x51c6('0x23')](_0x51c6('0xe'),_0x41469f,_0x547297[_0x51c6('0x1f')]);if(_0x405bf7[_0x51c6('0x32')]==_0x51c6('0x33')){_0x14d58a[_0x51c6('0x10')]();}else{_0x14d58a[_0x51c6('0x34')]();}})[_0x51c6('0x24')](function(_0x201008){logger[_0x51c6('0x25')](_0x51c6('0xe'),_0x41469f,JSON[_0x51c6('0x26')](_0x201008));_0x14d58a['next']();});}else{_0x14d58a[_0x51c6('0x10')]();}});}}catch(_0x334563){logger['error'](_0x51c6('0xe'),_0x41469f,JSON['stringify'](_0x334563));_0x14d58a['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 3005a07..295d9a6 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 _0x0228=['Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','created','interaction','autoreplyExecuted','info','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','mail','getMustacheRender','from','message','phone','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','upperFirst','AccountId','InteractionId','inReplyTo','html','replace','','headers','auto-replied','All','auto_reply','sendMailMessage','account','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','Message','create','[%s][AUTOREPLY]\x20%s','stringify','catch','finally','resolve','Interaction','update','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','body'];(function(_0x5d3a5b,_0x33c07e){var _0x4238c0=function(_0x540e83){while(--_0x540e83){_0x5d3a5b['push'](_0x5d3a5b['shift']());}};_0x4238c0(++_0x33c07e);}(_0x0228,0x1c5));var _0x8022=function(_0x312931,_0x22e92b){_0x312931=_0x312931-0x0;var _0xdf26e5=_0x0228[_0x312931];return _0xdf26e5;};'use strict';var _=require(_0x8022('0x0'));var moment=require('moment');var utils=require(_0x8022('0x1'));var logger=require(_0x8022('0x2'))('routing');var rpc={'chatMessage':require(_0x8022('0x3')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x8022('0x4')),'smsMessage':require(_0x8022('0x5')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x8022('0x6')),'openchannelInteraction':require(_0x8022('0x7')),'mailInteraction':require(_0x8022('0x8')),'smsInteraction':require(_0x8022('0x9')),'faxInteraction':require(_0x8022('0xa')),'whatsappInteraction':require(_0x8022('0xb'))};var mailRpc=require(_0x8022('0xc'));exports[_0x8022('0xd')]=function(_0x152ebf,_0x599c91,_0x35a466,_0x590de4){return function(_0x5b6c1b){try{var _0x5a810b=this[_0x8022('0xe')];if(_0x5a810b==='mail'&&_0x590de4[_0x8022('0xf')]['isAutoreply']){logger['info']('[%s][AUTOREPLY]\x20%s',_0x152ebf,_0x8022('0x10'));return _0x5b6c1b[_0x8022('0x11')]();}if(_0x599c91[0x0]==='1'&&(_[_0x8022('0x12')](this['interaction'][_0x8022('0x13')])||!this['interaction']['created'])){logger['info']('[%s][AUTOREPLY]\x20%s',_0x152ebf,'Autoreply\x20already\x20sent');return _0x5b6c1b[_0x8022('0x11')]();}if(_0x599c91[0x0]==='2'&&this[_0x8022('0x14')][_0x8022('0x15')]){logger[_0x8022('0x16')](_0x8022('0x17'),_0x152ebf,'One\x20Time\x20already\x20sent');return _0x5b6c1b[_0x8022('0x11')]();}var _0xdda30f={'ContactId':this[_0x8022('0x18')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this[_0x8022('0xe')]===_0x8022('0x19')){_0xdda30f[_0x8022('0xf')]=utils[_0x8022('0x1a')](_0x599c91[0x2],this);}else{_0xdda30f[_0x8022('0xf')]=utils['getMustacheRender'](_0x599c91[0x1],this);}if(this['message']){_0xdda30f['to']=this['message'][_0x8022('0x1b')]||'';if(this[_0x8022('0xe')]===_0x8022('0x19')&&_0x599c91[0x1]==='1'){_0xdda30f['cc']=this[_0x8022('0x1c')]['cc']||'';}_0xdda30f[_0x8022('0x1b')]=this[_0x8022('0x1c')]['to']||'';_0xdda30f[_0x8022('0x1d')]=this['message'][_0x8022('0x1d')]||'';_0xdda30f[_0x8022('0x1e')]=!![];if(this['message'][_0x8022('0x1f')]){_0xdda30f[_0x8022('0x1f')]='';_0xdda30f[_0x8022('0x1f')]+=_[_0x8022('0x20')](this[_0x8022('0x1c')][_0x8022('0x1f')],_0x8022('0x21'))?'':_0x8022('0x22');_0xdda30f[_0x8022('0x1f')]+=this['message'][_0x8022('0x1f')];}}if(this[_0x8022('0xe')]===_0x8022('0x23')){_0xdda30f[_0x8022('0x24')]=this['account']['id'];}else{_0xdda30f[_[_0x8022('0x25')](this[_0x8022('0xe')])+_0x8022('0x26')]=this['account']['id'];}_0xdda30f[_[_0x8022('0x25')](this[_0x8022('0xe')])+_0x8022('0x27')]=this[_0x8022('0x14')]['id'];var _0x5814c5=this[_0x8022('0x14')];if(rpc[this['channel']+'Message']){if(this['channel']===_0x8022('0x19')){_0xdda30f[_0x8022('0x28')]=this[_0x8022('0x1c')]['messageId'];_0xdda30f[_0x8022('0x29')]=''+_[_0x8022('0x2a')](_0xdda30f[_0x8022('0xf')],_0x8022('0x2b'),_0x8022('0x2c'))+_0x8022('0x2d');_0xdda30f[_0x8022('0x2e')]={'Auto-Submitted':_0x8022('0x2f'),'X-Auto-Response-Suppress':_0x8022('0x30'),'Precedence':_0x8022('0x31')};return mailRpc[_0x8022('0x32')](this[_0x8022('0x33')]['smtpOptions'],_0xdda30f)[_0x8022('0x34')](function(_0x313420){logger[_0x8022('0x16')](_0x8022('0x35'),_0x152ebf);_0xdda30f['messageId']=_0x313420[_0x8022('0x1c')][_0x8022('0x36')];return rpc[_0x5a810b+_0x8022('0x37')][_0x8022('0x38')](_0xdda30f);})[_0x8022('0x34')](function(_0x4bce0f){logger[_0x8022('0x16')](_0x8022('0x39'),_0x152ebf,JSON[_0x8022('0x3a')](_0x4bce0f));})[_0x8022('0x3b')](function(_0x4e0ae9){logger['error']('[RPC][%s][AUTOREPLY]\x20%s',_0x152ebf,JSON[_0x8022('0x3a')](_0x4e0ae9));})[_0x8022('0x3c')](function(){Promise[_0x8022('0x3d')]()[_0x8022('0x34')](function(){if(_0x599c91[0x0]!=='2'||_0x5814c5[_0x8022('0x15')])return;return rpc[_0x5a810b+_0x8022('0x3e')][_0x8022('0x3f')](_0x5814c5['id'],{'autoreplyExecuted':!![]})['then'](function(_0x4810df){logger[_0x8022('0x16')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x152ebf,JSON[_0x8022('0x3a')](_0x4810df));})[_0x8022('0x3b')](function(_0x2f3306){logger[_0x8022('0x40')](_0x8022('0x41'),_0x152ebf,JSON[_0x8022('0x3a')](_0x2f3306));});})['then'](function(){_0x5b6c1b[_0x8022('0x11')]();});});}else{return rpc[this[_0x8022('0xe')]+_0x8022('0x37')][_0x8022('0x38')](_0xdda30f)[_0x8022('0x34')](function(){logger[_0x8022('0x16')](_0x8022('0x39'),_0x152ebf,_0xdda30f[_0x8022('0xf')]);})[_0x8022('0x3b')](function(_0x112f51){logger['error'](_0x8022('0x39'),_0x152ebf,JSON[_0x8022('0x3a')](_0x112f51));})[_0x8022('0x3c')](function(){Promise['resolve']()[_0x8022('0x34')](function(){if(_0x599c91[0x0]!=='2'||_0x5814c5[_0x8022('0x15')])return;return rpc[_0x5a810b+'Interaction'][_0x8022('0x3f')](_0x5814c5['id'],{'autoreplyExecuted':!![]})[_0x8022('0x34')](function(_0x462405){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x152ebf,JSON[_0x8022('0x3a')](_0x462405));})[_0x8022('0x3b')](function(_0x86445f){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x152ebf,JSON[_0x8022('0x3a')](_0x86445f));});})[_0x8022('0x34')](function(){_0x5b6c1b[_0x8022('0x11')]();});});}}}catch(_0x478a5f){logger['error'](_0x8022('0x39'),_0x152ebf,JSON[_0x8022('0x3a')](_0x478a5f));_0x5b6c1b[_0x8022('0x42')]();}};}; \ No newline at end of file +var _0xf56d=['Re:','Re:\x20','account','upperFirst','AccountId','InteractionId','inReplyTo','messageId','html','','replace','','auto-replied','All','auto_reply','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','Message','create','stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','Interaction','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','created','interaction','Autoreply\x20already\x20sent','next','autoreplyExecuted','One\x20Time\x20already\x20sent','YYYY-MM-DD\x20HH:mm:ss','out','body','message','from','phone','read','subject'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xf56d,0x176));var _0xdf56=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf56d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdf56('0x0'));var moment=require(_0xdf56('0x1'));var utils=require(_0xdf56('0x2'));var logger=require(_0xdf56('0x3'))(_0xdf56('0x4'));var rpc={'chatMessage':require(_0xdf56('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xdf56('0x6')),'mailInteraction':require(_0xdf56('0x7')),'smsInteraction':require(_0xdf56('0x8')),'faxInteraction':require(_0xdf56('0x9')),'whatsappInteraction':require(_0xdf56('0xa'))};var mailRpc=require(_0xdf56('0xb'));exports[_0xdf56('0xc')]=function(_0x27fe8f,_0x13a288,_0x42d953,_0x15dff5){return function(_0x1c4ee0){try{var _0x1820fe=this[_0xdf56('0xd')];if(_0x1820fe===_0xdf56('0xe')&&_0x15dff5['body'][_0xdf56('0xf')]){logger[_0xdf56('0x10')](_0xdf56('0x11'),_0x27fe8f,_0xdf56('0x12'));return _0x1c4ee0['next']();}if(_0x13a288[0x0]==='1'&&(_[_0xdf56('0x13')](this['interaction'][_0xdf56('0x14')])||!this[_0xdf56('0x15')][_0xdf56('0x14')])){logger[_0xdf56('0x10')](_0xdf56('0x11'),_0x27fe8f,_0xdf56('0x16'));return _0x1c4ee0[_0xdf56('0x17')]();}if(_0x13a288[0x0]==='2'&&this[_0xdf56('0x15')][_0xdf56('0x18')]){logger[_0xdf56('0x10')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x27fe8f,_0xdf56('0x19'));return _0x1c4ee0[_0xdf56('0x17')]();}var _0x57583f={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0xdf56('0x1a')),'direction':_0xdf56('0x1b')};if(this['channel']===_0xdf56('0xe')){_0x57583f[_0xdf56('0x1c')]=utils['getMustacheRender'](_0x13a288[0x2],this);}else{_0x57583f['body']=utils['getMustacheRender'](_0x13a288[0x1],this);}if(this[_0xdf56('0x1d')]){_0x57583f['to']=this['message'][_0xdf56('0x1e')]||'';if(this['channel']===_0xdf56('0xe')&&_0x13a288[0x1]==='1'){_0x57583f['cc']=this[_0xdf56('0x1d')]['cc']||'';}_0x57583f[_0xdf56('0x1e')]=this[_0xdf56('0x1d')]['to']||'';_0x57583f[_0xdf56('0x1f')]=this['message'][_0xdf56('0x1f')]||'';_0x57583f[_0xdf56('0x20')]=!![];if(this['message'][_0xdf56('0x21')]){_0x57583f['subject']='';_0x57583f[_0xdf56('0x21')]+=_['startsWith'](this[_0xdf56('0x1d')][_0xdf56('0x21')],_0xdf56('0x22'))?'':_0xdf56('0x23');_0x57583f['subject']+=this['message']['subject'];}}if(this[_0xdf56('0xd')]==='chat'){_0x57583f['ChatWebsiteId']=this[_0xdf56('0x24')]['id'];}else{_0x57583f[_[_0xdf56('0x25')](this['channel'])+_0xdf56('0x26')]=this[_0xdf56('0x24')]['id'];}_0x57583f[_['upperFirst'](this[_0xdf56('0xd')])+_0xdf56('0x27')]=this[_0xdf56('0x15')]['id'];var _0x3c55db=this[_0xdf56('0x15')];if(rpc[this[_0xdf56('0xd')]+'Message']){if(this['channel']===_0xdf56('0xe')){_0x57583f[_0xdf56('0x28')]=this['message'][_0xdf56('0x29')];_0x57583f[_0xdf56('0x2a')]=_0xdf56('0x2b')+_[_0xdf56('0x2c')](_0x57583f[_0xdf56('0x1c')],_0xdf56('0x2d'),_0xdf56('0x2e'))+_0xdf56('0x2f');_0x57583f['headers']={'Auto-Submitted':_0xdf56('0x30'),'X-Auto-Response-Suppress':_0xdf56('0x31'),'Precedence':_0xdf56('0x32')};return mailRpc[_0xdf56('0x33')](this[_0xdf56('0x24')][_0xdf56('0x34')],_0x57583f)[_0xdf56('0x35')](function(_0x1188e3){logger['info'](_0xdf56('0x36'),_0x27fe8f);_0x57583f[_0xdf56('0x29')]=_0x1188e3[_0xdf56('0x1d')][_0xdf56('0x29')];return rpc[_0x1820fe+_0xdf56('0x37')][_0xdf56('0x38')](_0x57583f);})[_0xdf56('0x35')](function(_0x451cc0){logger[_0xdf56('0x10')](_0xdf56('0x11'),_0x27fe8f,JSON[_0xdf56('0x39')](_0x451cc0));})[_0xdf56('0x3a')](function(_0x341a64){logger['error'](_0xdf56('0x3b'),_0x27fe8f,JSON[_0xdf56('0x39')](_0x341a64));})[_0xdf56('0x3c')](function(){Promise[_0xdf56('0x3d')]()[_0xdf56('0x35')](function(){if(_0x13a288[0x0]!=='2'||_0x3c55db[_0xdf56('0x18')])return;return rpc[_0x1820fe+'Interaction'][_0xdf56('0x3e')](_0x3c55db['id'],{'autoreplyExecuted':!![]})[_0xdf56('0x35')](function(_0x339f7a){logger[_0xdf56('0x10')](_0xdf56('0x3f'),_0x27fe8f,JSON['stringify'](_0x339f7a));})[_0xdf56('0x3a')](function(_0x2c51c1){logger[_0xdf56('0x40')](_0xdf56('0x41'),_0x27fe8f,JSON[_0xdf56('0x39')](_0x2c51c1));});})[_0xdf56('0x35')](function(){_0x1c4ee0[_0xdf56('0x17')]();});});}else{return rpc[this[_0xdf56('0xd')]+'Message'][_0xdf56('0x38')](_0x57583f)[_0xdf56('0x35')](function(){logger[_0xdf56('0x10')](_0xdf56('0x11'),_0x27fe8f,_0x57583f['body']);})['catch'](function(_0x1529da){logger[_0xdf56('0x40')](_0xdf56('0x11'),_0x27fe8f,JSON[_0xdf56('0x39')](_0x1529da));})[_0xdf56('0x3c')](function(){Promise['resolve']()['then'](function(){if(_0x13a288[0x0]!=='2'||_0x3c55db[_0xdf56('0x18')])return;return rpc[_0x1820fe+_0xdf56('0x42')][_0xdf56('0x3e')](_0x3c55db['id'],{'autoreplyExecuted':!![]})[_0xdf56('0x35')](function(_0x6cf7e9){logger[_0xdf56('0x10')](_0xdf56('0x3f'),_0x27fe8f,JSON[_0xdf56('0x39')](_0x6cf7e9));})['catch'](function(_0x57939c){logger[_0xdf56('0x40')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x27fe8f,JSON[_0xdf56('0x39')](_0x57939c));});})['then'](function(){_0x1c4ee0[_0xdf56('0x17')]();});});}}}catch(_0x577ecc){logger['error']('[%s][AUTOREPLY]\x20%s',_0x27fe8f,JSON[_0xdf56('0x39')](_0x577ecc));_0x1c4ee0[_0xdf56('0x43')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 5ca42b1..4cbcc8a 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 _0x6c20=['../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','format','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','interaction','then','catch','[%s][CLOSE]\x20%s','stringify','stop','error','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction'];(function(_0x5dc810,_0x476912){var _0x2ac9d2=function(_0x59b593){while(--_0x59b593){_0x5dc810['push'](_0x5dc810['shift']());}};_0x2ac9d2(++_0x476912);}(_0x6c20,0x170));var _0x06c2=function(_0x1e54a7,_0x4e7ea3){_0x1e54a7=_0x1e54a7-0x0;var _0x41d78e=_0x6c20[_0x1e54a7];return _0x41d78e;};'use strict';var moment=require(_0x06c2('0x0'));var logger=require(_0x06c2('0x1'))(_0x06c2('0x2'));var rpc={'chatInteraction':require(_0x06c2('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x06c2('0x4')),'mailInteraction':require(_0x06c2('0x5')),'faxInteraction':require(_0x06c2('0x6')),'whatsappInteraction':require(_0x06c2('0x7'))};exports[_0x06c2('0x8')]=function(_0x4a1c85,_0x372e9e,_0x49fbfa,_0x41bf5c){return function(_0x22c27){try{logger[_0x06c2('0x9')]('[%s][CLOSE]\x20reason\x20%s',_0x4a1c85,_0x372e9e[0x0]);var _0x5164ef={'closed':0x1,'closedAt':moment()[_0x06c2('0xa')](_0x06c2('0xb')),'closeReason':'system','disposition':_0x372e9e[0x0]};if(rpc[_0x41bf5c[_0x06c2('0xc')]+'Interaction']){rpc[_0x41bf5c['channel']+_0x06c2('0xd')][_0x06c2('0xe')](_0x41bf5c[_0x06c2('0xf')]['id'],_0x5164ef)[_0x06c2('0x10')](function(_0x25a12e){logger[_0x06c2('0x9')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x4a1c85,_0x41bf5c[_0x06c2('0xf')]['id']);})[_0x06c2('0x11')](function(_0x267a20){logger['error'](_0x06c2('0x12'),_0x4a1c85,JSON[_0x06c2('0x13')](_0x267a20));})['finally'](function(){_0x22c27[_0x06c2('0x14')]();});}}catch(_0x117ede){logger[_0x06c2('0x15')]('[%s][CLOSE]\x20%s',_0x4a1c85,JSON[_0x06c2('0x13')](_0x117ede));_0x22c27[_0x06c2('0x14')]();}};}; \ No newline at end of file +var _0x329b=['interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','[%s][CLOSE]\x20%s','stringify','finally','stop','error','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','format','system','Interaction','channel','update'];(function(_0x37ed0e,_0x193c4c){var _0x3bd6b7=function(_0xb1dacb){while(--_0xb1dacb){_0x37ed0e['push'](_0x37ed0e['shift']());}};_0x3bd6b7(++_0x193c4c);}(_0x329b,0x1d1));var _0xb329=function(_0x1f1305,_0x2435f5){_0x1f1305=_0x1f1305-0x0;var _0x571a9d=_0x329b[_0x1f1305];return _0x571a9d;};'use strict';var moment=require(_0xb329('0x0'));var logger=require(_0xb329('0x1'))(_0xb329('0x2'));var rpc={'chatInteraction':require(_0xb329('0x3')),'openchannelInteraction':require(_0xb329('0x4')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xb329('0x5')),'faxInteraction':require(_0xb329('0x6')),'whatsappInteraction':require(_0xb329('0x7'))};exports[_0xb329('0x8')]=function(_0x23806c,_0x17f0a0,_0x51c9fd,_0x5a5243){return function(_0x14fb9b){try{logger['info'](_0xb329('0x9'),_0x23806c,_0x17f0a0[0x0]);var _0x2bb487={'closed':0x1,'closedAt':moment()[_0xb329('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0xb329('0xb'),'disposition':_0x17f0a0[0x0]};if(rpc[_0x5a5243['channel']+_0xb329('0xc')]){rpc[_0x5a5243[_0xb329('0xd')]+_0xb329('0xc')][_0xb329('0xe')](_0x5a5243[_0xb329('0xf')]['id'],_0x2bb487)[_0xb329('0x10')](function(_0x506c98){logger['info'](_0xb329('0x11'),_0x23806c,_0x5a5243[_0xb329('0xf')]['id']);})[_0xb329('0x12')](function(_0x136df8){logger['error'](_0xb329('0x13'),_0x23806c,JSON[_0xb329('0x14')](_0x136df8));})[_0xb329('0x15')](function(){_0x14fb9b[_0xb329('0x16')]();});}}catch(_0x56dc48){logger[_0xb329('0x17')](_0xb329('0x13'),_0x23806c,JSON[_0xb329('0x14')](_0x56dc48));_0x14fb9b[_0xb329('0x16')]();}};}; \ 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 45827a8..2d29d90 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 _0xc963=['catch','error','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','result','fulfillment','speech','providerName','providerResponse','stringify','create','metadata','endConversation','next','lodash','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message'];(function(_0x3d7c3a,_0x2403b2){var _0x5baa61=function(_0x2293ba){while(--_0x2293ba){_0x3d7c3a['push'](_0x3d7c3a['shift']());}};_0x5baa61(++_0x2403b2);}(_0xc963,0x17f));var _0x3c96=function(_0x1c6ef2,_0x8d926a){_0x1c6ef2=_0x1c6ef2-0x0;var _0x404b8c=_0xc963[_0x1c6ef2];return _0x404b8c;};'use strict';var _=require(_0x3c96('0x0'));var moment=require('moment');var apiai=require('apiai-promise');var md5=require(_0x3c96('0x1'));var utils=require(_0x3c96('0x2'));var logger=require(_0x3c96('0x3'))(_0x3c96('0x4'));var rpc={'chatMessage':require(_0x3c96('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x3c96('0x6')),'smsMessage':require(_0x3c96('0x7')),'faxMessage':require(_0x3c96('0x8')),'whatsappMessage':require(_0x3c96('0x9'))};exports[_0x3c96('0xa')]=function(_0x493953,_0x1f3bb4){return function(_0x247c14){try{if(!_[_0x3c96('0xb')](this[_0x3c96('0xc')][_0x3c96('0xd')])){logger[_0x3c96('0xe')](_0x3c96('0xf'),_0x493953,_0x3c96('0x10'));return _0x247c14['next']();}var _0x389618={'ContactId':this['contact']['id'],'sentAt':moment()[_0x3c96('0x11')](_0x3c96('0x12')),'direction':'out'};if(this[_0x3c96('0x13')]==='sms'||this['channel']===_0x3c96('0x14')){_0x389618[_0x3c96('0x15')]=this[_0x3c96('0xc')][_0x3c96('0x15')];}var _0x2d0665=this[_0x3c96('0x13')];if(_0x2d0665===_0x3c96('0x16')){_0x389618[_0x3c96('0x17')]=this[_0x3c96('0x18')]['id'];}else{_0x389618[_[_0x3c96('0x19')](_0x2d0665)+_0x3c96('0x1a')]=this[_0x3c96('0x18')]['id'];}_0x389618[_[_0x3c96('0x19')](_0x2d0665)+_0x3c96('0x1b')]=this['interaction']['id'];if(this[_0x3c96('0xc')][_0x3c96('0x1c')]){var _0x5bfb66=_0x1f3bb4[0x2];if(!_[_0x3c96('0x1d')](_0x5bfb66)){_0x389618[_0x3c96('0x1e')]=utils[_0x3c96('0x1f')](_0x5bfb66,this);return rpc[_0x2d0665+_0x3c96('0x20')]['create'](_0x389618)['then'](function(_0x147878){logger[_0x3c96('0xe')](_0x3c96('0xf'),_0x493953,_0x389618[_0x3c96('0x1e')]);})[_0x3c96('0x21')](function(_0xe7c797){logger[_0x3c96('0x22')](_0x3c96('0xf'),_0x493953,JSON['stringify'](_0xe7c797));})[_0x3c96('0x23')](function(){logger[_0x3c96('0xe')](_0x3c96('0x24'),_0x493953);_0x247c14[_0x3c96('0x25')]();});}else{logger[_0x3c96('0xe')](_0x3c96('0x26'),_0x493953);_0x247c14['stop']();}}else{var _0x2f2952=this;var _0x2bc43d=apiai(_0x1f3bb4[0x0],{'language':_0x1f3bb4[0x1]||'en'});return _0x2bc43d['textRequest'](this[_0x3c96('0x27')][_0x3c96('0x1e')],{'sessionId':md5(this[_0x3c96('0xc')]['id'])})[_0x3c96('0x28')](function(_0x24c88d){_0x2f2952['body'][_0x3c96('0x29')]=_0x24c88d;_0x389618[_0x3c96('0x1e')]=_0x24c88d[_0x3c96('0x2a')][_0x3c96('0x2b')][_0x3c96('0x2c')];_0x389618[_0x3c96('0x2d')]=_0x3c96('0x29');_0x389618[_0x3c96('0x2e')]=JSON[_0x3c96('0x2f')](_0x24c88d);return rpc[_0x2d0665+'Message'][_0x3c96('0x30')](_0x389618)['then'](function(_0x30180b){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x493953,_0x389618[_0x3c96('0x1e')]);if(_0x24c88d[_0x3c96('0x2a')][_0x3c96('0x31')][_0x3c96('0x32')]){_0x247c14[_0x3c96('0x33')]();}else{_0x247c14[_0x3c96('0x25')]();}})[_0x3c96('0x21')](function(_0x18d872){logger[_0x3c96('0x22')](_0x3c96('0xf'),_0x493953,JSON[_0x3c96('0x2f')](_0x18d872));_0x247c14[_0x3c96('0x33')]();});})[_0x3c96('0x21')](function(_0x369170){logger['error'](_0x3c96('0xf'),_0x493953,_0x369170[_0x3c96('0x27')]);_0x247c14[_0x3c96('0x33')]();});}}catch(_0x4ce143){logger[_0x3c96('0x22')](_0x3c96('0xf'),_0x493953,JSON['stringify'](_0x4ce143));_0x247c14[_0x3c96('0x25')]();}};}; \ No newline at end of file +var _0xba18=['sms','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','info','catch','error','stringify','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','then','dialogflow','result','providerName','create','metadata','endConversation','next','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out'];(function(_0x23cd34,_0xe7e8f7){var _0x1e1e48=function(_0x820992){while(--_0x820992){_0x23cd34['push'](_0x23cd34['shift']());}};_0x1e1e48(++_0xe7e8f7);}(_0xba18,0x1ea));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8ba1('0x0'));var moment=require(_0x8ba1('0x1'));var apiai=require(_0x8ba1('0x2'));var md5=require(_0x8ba1('0x3'));var utils=require(_0x8ba1('0x4'));var logger=require(_0x8ba1('0x5'))(_0x8ba1('0x6'));var rpc={'chatMessage':require(_0x8ba1('0x7')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x8ba1('0x8')),'smsMessage':require(_0x8ba1('0x9')),'faxMessage':require(_0x8ba1('0xa')),'whatsappMessage':require(_0x8ba1('0xb'))};exports[_0x8ba1('0xc')]=function(_0x2ffa15,_0x51a988){return function(_0x3a87eb){try{if(!_[_0x8ba1('0xd')](this['interaction']['UserId'])){logger['info'](_0x8ba1('0xe'),_0x2ffa15,_0x8ba1('0xf'));return _0x3a87eb['next']();}var _0x457158={'ContactId':this[_0x8ba1('0x10')]['id'],'sentAt':moment()[_0x8ba1('0x11')](_0x8ba1('0x12')),'direction':_0x8ba1('0x13')};if(this['channel']===_0x8ba1('0x14')||this[_0x8ba1('0x15')]===_0x8ba1('0x16')){_0x457158[_0x8ba1('0x17')]=this[_0x8ba1('0x18')][_0x8ba1('0x17')];}var _0x58e32b=this[_0x8ba1('0x15')];if(_0x58e32b===_0x8ba1('0x19')){_0x457158[_0x8ba1('0x1a')]=this[_0x8ba1('0x1b')]['id'];}else{_0x457158[_['upperFirst'](_0x58e32b)+'AccountId']=this['account']['id'];}_0x457158[_[_0x8ba1('0x1c')](_0x58e32b)+_0x8ba1('0x1d')]=this[_0x8ba1('0x18')]['id'];if(this[_0x8ba1('0x18')][_0x8ba1('0x1e')]){var _0x3880aa=_0x51a988[0x2];if(!_[_0x8ba1('0x1f')](_0x3880aa)){_0x457158[_0x8ba1('0x20')]=utils[_0x8ba1('0x21')](_0x3880aa,this);return rpc[_0x58e32b+_0x8ba1('0x22')]['create'](_0x457158)['then'](function(_0x1a48fa){logger[_0x8ba1('0x23')]('[%s][DIALOGFLOW]\x20%s',_0x2ffa15,_0x457158[_0x8ba1('0x20')]);})[_0x8ba1('0x24')](function(_0x3fadfc){logger[_0x8ba1('0x25')](_0x8ba1('0xe'),_0x2ffa15,JSON[_0x8ba1('0x26')](_0x3fadfc));})['finally'](function(){logger[_0x8ba1('0x23')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x2ffa15);_0x3a87eb[_0x8ba1('0x27')]();});}else{logger[_0x8ba1('0x23')](_0x8ba1('0x28'),_0x2ffa15);_0x3a87eb[_0x8ba1('0x27')]();}}else{var _0x4e66e1=this;var _0x1d619c=apiai(_0x51a988[0x0],{'language':_0x51a988[0x1]||'en'});return _0x1d619c[_0x8ba1('0x29')](this[_0x8ba1('0x2a')][_0x8ba1('0x20')],{'sessionId':md5(this[_0x8ba1('0x18')]['id'])})[_0x8ba1('0x2b')](function(_0x845108){_0x4e66e1[_0x8ba1('0x20')][_0x8ba1('0x2c')]=_0x845108;_0x457158[_0x8ba1('0x20')]=_0x845108[_0x8ba1('0x2d')]['fulfillment']['speech'];_0x457158[_0x8ba1('0x2e')]=_0x8ba1('0x2c');_0x457158['providerResponse']=JSON[_0x8ba1('0x26')](_0x845108);return rpc[_0x58e32b+_0x8ba1('0x22')][_0x8ba1('0x2f')](_0x457158)[_0x8ba1('0x2b')](function(_0x15e419){logger[_0x8ba1('0x23')](_0x8ba1('0xe'),_0x2ffa15,_0x457158[_0x8ba1('0x20')]);if(_0x845108[_0x8ba1('0x2d')][_0x8ba1('0x30')][_0x8ba1('0x31')]){_0x3a87eb[_0x8ba1('0x32')]();}else{_0x3a87eb[_0x8ba1('0x27')]();}})[_0x8ba1('0x24')](function(_0x5e28b7){logger[_0x8ba1('0x25')](_0x8ba1('0xe'),_0x2ffa15,JSON[_0x8ba1('0x26')](_0x5e28b7));_0x3a87eb[_0x8ba1('0x32')]();});})[_0x8ba1('0x24')](function(_0x24bf95){logger['error'](_0x8ba1('0xe'),_0x2ffa15,_0x24bf95[_0x8ba1('0x2a')]);_0x3a87eb['next']();});}}catch(_0x1015c8){logger['error'](_0x8ba1('0xe'),_0x2ffa15,JSON[_0x8ba1('0x26')](_0x1015c8));_0x3a87eb['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 28fa243..054cb9c 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 _0x354a=['message','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','languageCode','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','all','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','clone','create','then','info','catch','[%s][DIALOGFLOWV2]\x20%s','stringify','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out','channel','whatsapp','ChatWebsiteId','upperFirst','account','InteractionId','created','isEmpty','body','getMustacheRender','Message','error','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','sessionPath'];(function(_0x3a81c2,_0x7d08dd){var _0x2d7eea=function(_0x10b42f){while(--_0x10b42f){_0x3a81c2['push'](_0x3a81c2['shift']());}};_0x2d7eea(++_0x7d08dd);}(_0x354a,0x9e));var _0xa354=function(_0x1e9992,_0x24a7db){_0x1e9992=_0x1e9992-0x0;var _0x4204e2=_0x354a[_0x1e9992];return _0x4204e2;};'use strict';var _=require('lodash');var dialogflow=require(_0xa354('0x0'));var md5=require(_0xa354('0x1'));var moment=require(_0xa354('0x2'));var Promise=require(_0xa354('0x3'));var logger=require(_0xa354('0x4'))(_0xa354('0x5'));var utils=require(_0xa354('0x6'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xa354('0x7')),'smsMessage':require(_0xa354('0x8')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xa354('0x9'))};function createMessage(_0x296c01,_0x129725,_0x2b62e3,_0x10c429){return new Promise(function(_0x444533,_0x4f3ea6){var _0x32c77e=_[_0xa354('0xa')](_0x2b62e3);_0x32c77e['body']=_0x10c429;return rpc[_0x129725+'Message'][_0xa354('0xb')](_0x32c77e)[_0xa354('0xc')](function(){logger[_0xa354('0xd')]('[%s][DIALOGFLOWV2]\x20%s',_0x296c01,_0x32c77e['body']);_0x444533();})[_0xa354('0xe')](function(_0x5a36bf){logger['error'](_0xa354('0xf'),_0x296c01,JSON[_0xa354('0x10')](_0x5a36bf));_0x4f3ea6(_0x5a36bf);});});}exports['consequence']=function(_0x1953ff,_0x2a8f1b){return function(_0x50cbbe){try{if(!_[_0xa354('0x11')](this[_0xa354('0x12')][_0xa354('0x13')])){logger[_0xa354('0xd')]('[%s][DIALOGFLOWV2]\x20%s',_0x1953ff,_0xa354('0x14'));return _0x50cbbe[_0xa354('0x15')]();}var _0x27e5b0={'ContactId':this[_0xa354('0x16')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xa354('0x17')};if(this[_0xa354('0x18')]==='sms'||this[_0xa354('0x18')]===_0xa354('0x19')){_0x27e5b0['phone']=this['interaction']['phone'];}var _0x22d76=this[_0xa354('0x18')];if(_0x22d76==='chat'){_0x27e5b0[_0xa354('0x1a')]=this['account']['id'];}else{_0x27e5b0[_[_0xa354('0x1b')](_0x22d76)+'AccountId']=this[_0xa354('0x1c')]['id'];}_0x27e5b0[_['upperFirst'](_0x22d76)+_0xa354('0x1d')]=this[_0xa354('0x12')]['id'];if(this[_0xa354('0x12')][_0xa354('0x1e')]){var _0x143cf0=_0x2a8f1b[0x4];if(!_[_0xa354('0x1f')](_0x143cf0)){_0x27e5b0[_0xa354('0x20')]=utils[_0xa354('0x21')](_0x143cf0,this);return rpc[_0x22d76+_0xa354('0x22')][_0xa354('0xb')](_0x27e5b0)[_0xa354('0xc')](function(_0x1c8865){logger[_0xa354('0xd')]('[%s][DIALOGFLOWV2]\x20%s',_0x1953ff,_0x27e5b0['body']);})[_0xa354('0xe')](function(_0x36be48){logger[_0xa354('0x23')](_0xa354('0xf'),_0x1953ff,JSON[_0xa354('0x10')](_0x36be48));})[_0xa354('0x24')](function(){logger['info'](_0xa354('0x25'),_0x1953ff);_0x50cbbe[_0xa354('0x26')]();});}else{logger[_0xa354('0xd')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x1953ff);_0x50cbbe[_0xa354('0x26')]();}}else{var _0x5ccc55=this;var _0x32518e=_0x2a8f1b[0x2]['replace'](/\\n/g,'\x0a');var _0x3d30de={'credentials':{'private_key':_0x32518e,'client_email':_0x2a8f1b[0x1]}};var _0x30adef=new dialogflow['SessionsClient'](_0x3d30de);var _0x3e6e3a=_0x30adef[_0xa354('0x27')](_0x2a8f1b[0x0],md5(_0x5ccc55[_0xa354('0x12')]['id']));var _0x1938ff={'session':_0x3e6e3a,'queryInput':{'text':{'text':_0x5ccc55[_0xa354('0x28')][_0xa354('0x20')],'languageCode':_0x2a8f1b[0x3]||'en'}}};return _0x30adef['detectIntent'](_0x1938ff)['then'](function(_0x5ead85){if(_0x5ead85&&_0x5ead85[_0xa354('0x29')]){_0x5ccc55[_0xa354('0x20')][_0xa354('0x2a')]=_0x5ead85;var _0x15d1ed=_0x5ead85[0x0];var _0x7253e1=_0x15d1ed[_0xa354('0x2b')]['diagnosticInfo']&&_0x15d1ed[_0xa354('0x2b')][_0xa354('0x2c')][_0xa354('0x2d')]?_0x15d1ed[_0xa354('0x2b')][_0xa354('0x2c')][_0xa354('0x2d')][_0xa354('0x2e')]['boolValue']:![];_0x5ccc55['body'][_0xa354('0x2f')]=_0x15d1ed[_0xa354('0x2b')][_0xa354('0x30')];_0x5ccc55['body'][_0xa354('0x31')]=_0x15d1ed['queryResult'][_0xa354('0x32')];_0x5ccc55[_0xa354('0x20')][_0xa354('0x33')]=_0x15d1ed[_0xa354('0x2b')][_0xa354('0x2c')]&&_0x15d1ed['queryResult'][_0xa354('0x2c')]['fields']?_0x15d1ed[_0xa354('0x2b')][_0xa354('0x2c')][_0xa354('0x2d')][_0xa354('0x2e')]['boolValue']:![];_0x5ccc55[_0xa354('0x20')]['DIALOGFLOWV2_INTENTNAME']=_0x15d1ed[_0xa354('0x2b')]['intent']['name'];_0x5ccc55[_0xa354('0x20')][_0xa354('0x34')]=_0x15d1ed[_0xa354('0x2b')][_0xa354('0x35')][_0xa354('0x36')];_0x5ccc55['body'][_0xa354('0x37')]=_0x15d1ed[_0xa354('0x2b')]['intent'][_0xa354('0x38')];_0x5ccc55[_0xa354('0x20')]['DIALOGFLOWV2_LANGUAGECODE']=_0x15d1ed[_0xa354('0x2b')][_0xa354('0x39')];_0x5ccc55['body'][_0xa354('0x3a')]=_0x15d1ed[_0xa354('0x2b')][_0xa354('0x3b')];_0x5ccc55['body'][_0xa354('0x3c')]=_0x15d1ed[_0xa354('0x2b')][_0xa354('0x3d')];_0x27e5b0[_0xa354('0x3e')]=_0xa354('0x2a');_0x27e5b0[_0xa354('0x3f')]=JSON[_0xa354('0x10')](_0x5ead85);var _0x232b5f=[];for(var _0x5d2f90=0x0;_0x5d2f90<_0x5ead85['length'];_0x5d2f90++){var _0xd3e78=_0x5ead85[_0x5d2f90];if(_0xd3e78&&_0xd3e78['queryResult']&&_0xd3e78[_0xa354('0x2b')][_0xa354('0x40')]){_0x232b5f['push'](createMessage(_0x1953ff,_0x22d76,_0x27e5b0,_0xd3e78[_0xa354('0x2b')][_0xa354('0x40')]));}}return Promise[_0xa354('0x41')](_0x232b5f)[_0xa354('0xc')](function(){if(_0x7253e1){_0x50cbbe[_0xa354('0x15')]();}else{_0x50cbbe[_0xa354('0x26')]();}})[_0xa354('0xe')](function(_0x591fa5){logger['error'](_0xa354('0xf'),_0x1953ff,JSON[_0xa354('0x10')](_0x591fa5));_0x50cbbe[_0xa354('0x15')]();});}})[_0xa354('0xe')](function(_0x2162dd){logger[_0xa354('0x23')](_0xa354('0xf'),_0x1953ff,_0x2162dd[_0xa354('0x28')],_0x2162dd['stack']);_0x50cbbe[_0xa354('0x15')]();});}}catch(_0x25fc2b){logger[_0xa354('0x23')](_0xa354('0xf'),_0x1953ff,JSON[_0xa354('0x10')](_0x25fc2b));_0x50cbbe[_0xa354('0x26')]();}};}; \ No newline at end of file +var _0x3779=['SessionsClient','sessionPath','message','detectIntent','length','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_INTENTNAME','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','dialogflowV2','providerResponse','fulfillmentText','all','lodash','dialogflow','md5','moment','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','error','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','getMustacheRender','catch','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x3779,0x190));var _0x9377=function(_0x381a28,_0x4eb359){_0x381a28=_0x381a28-0x0;var _0x5e572d=_0x3779[_0x381a28];return _0x5e572d;};'use strict';var _=require(_0x9377('0x0'));var dialogflow=require(_0x9377('0x1'));var md5=require(_0x9377('0x2'));var moment=require(_0x9377('0x3'));var Promise=require('bluebird');var logger=require(_0x9377('0x4'))(_0x9377('0x5'));var utils=require(_0x9377('0x6'));var rpc={'chatMessage':require(_0x9377('0x7')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x9377('0x8')),'smsMessage':require(_0x9377('0x9')),'faxMessage':require(_0x9377('0xa')),'whatsappMessage':require(_0x9377('0xb'))};function createMessage(_0x3ef913,_0x6444c2,_0x4925a8,_0x2447b8){return new Promise(function(_0x22b118,_0x198625){var _0x3e4ae9=_['clone'](_0x4925a8);_0x3e4ae9[_0x9377('0xc')]=_0x2447b8;return rpc[_0x6444c2+_0x9377('0xd')][_0x9377('0xe')](_0x3e4ae9)[_0x9377('0xf')](function(){logger[_0x9377('0x10')](_0x9377('0x11'),_0x3ef913,_0x3e4ae9[_0x9377('0xc')]);_0x22b118();})['catch'](function(_0x49f54d){logger[_0x9377('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0x3ef913,JSON[_0x9377('0x13')](_0x49f54d));_0x198625(_0x49f54d);});});}exports[_0x9377('0x14')]=function(_0x97d5d8,_0x95ad4d){return function(_0x1833a5){try{if(!_[_0x9377('0x15')](this[_0x9377('0x16')][_0x9377('0x17')])){logger['info'](_0x9377('0x11'),_0x97d5d8,_0x9377('0x18'));return _0x1833a5[_0x9377('0x19')]();}var _0x162346={'ContactId':this[_0x9377('0x1a')]['id'],'sentAt':moment()[_0x9377('0x1b')](_0x9377('0x1c')),'direction':_0x9377('0x1d')};if(this[_0x9377('0x1e')]===_0x9377('0x1f')||this[_0x9377('0x1e')]==='whatsapp'){_0x162346['phone']=this[_0x9377('0x16')]['phone'];}var _0xa799e8=this[_0x9377('0x1e')];if(_0xa799e8===_0x9377('0x20')){_0x162346[_0x9377('0x21')]=this[_0x9377('0x22')]['id'];}else{_0x162346[_[_0x9377('0x23')](_0xa799e8)+'AccountId']=this[_0x9377('0x22')]['id'];}_0x162346[_[_0x9377('0x23')](_0xa799e8)+_0x9377('0x24')]=this[_0x9377('0x16')]['id'];if(this[_0x9377('0x16')][_0x9377('0x25')]){var _0x31603d=_0x95ad4d[0x4];if(!_['isEmpty'](_0x31603d)){_0x162346[_0x9377('0xc')]=utils[_0x9377('0x26')](_0x31603d,this);return rpc[_0xa799e8+_0x9377('0xd')][_0x9377('0xe')](_0x162346)['then'](function(_0x2ee5c3){logger[_0x9377('0x10')](_0x9377('0x11'),_0x97d5d8,_0x162346['body']);})[_0x9377('0x27')](function(_0x4d4e23){logger['error'](_0x9377('0x11'),_0x97d5d8,JSON[_0x9377('0x13')](_0x4d4e23));})[_0x9377('0x28')](function(){logger[_0x9377('0x10')](_0x9377('0x29'),_0x97d5d8);_0x1833a5[_0x9377('0x2a')]();});}else{logger[_0x9377('0x10')](_0x9377('0x2b'),_0x97d5d8);_0x1833a5[_0x9377('0x2a')]();}}else{var _0x1c9f2e=this;var _0x34eaf7=_0x95ad4d[0x2]['replace'](/\\n/g,'\x0a');var _0x25bf67={'credentials':{'private_key':_0x34eaf7,'client_email':_0x95ad4d[0x1]}};var _0x230e77=new dialogflow[(_0x9377('0x2c'))](_0x25bf67);var _0x31fdaf=_0x230e77[_0x9377('0x2d')](_0x95ad4d[0x0],md5(_0x1c9f2e[_0x9377('0x16')]['id']));var _0x4f6fc7={'session':_0x31fdaf,'queryInput':{'text':{'text':_0x1c9f2e[_0x9377('0x2e')][_0x9377('0xc')],'languageCode':_0x95ad4d[0x3]||'en'}}};return _0x230e77[_0x9377('0x2f')](_0x4f6fc7)[_0x9377('0xf')](function(_0x188284){if(_0x188284&&_0x188284[_0x9377('0x30')]){_0x1c9f2e[_0x9377('0xc')]['dialogflowV2']=_0x188284;var _0x18c308=_0x188284[0x0];var _0x4473de=_0x18c308[_0x9377('0x31')]['diagnosticInfo']&&_0x18c308[_0x9377('0x31')][_0x9377('0x32')][_0x9377('0x33')]?_0x18c308[_0x9377('0x31')][_0x9377('0x32')][_0x9377('0x33')][_0x9377('0x34')][_0x9377('0x35')]:![];_0x1c9f2e[_0x9377('0xc')][_0x9377('0x36')]=_0x18c308[_0x9377('0x31')][_0x9377('0x37')];_0x1c9f2e[_0x9377('0xc')][_0x9377('0x38')]=_0x18c308[_0x9377('0x31')][_0x9377('0x39')];_0x1c9f2e[_0x9377('0xc')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x18c308['queryResult'][_0x9377('0x32')]&&_0x18c308[_0x9377('0x31')][_0x9377('0x32')]['fields']?_0x18c308[_0x9377('0x31')][_0x9377('0x32')][_0x9377('0x33')]['end_conversation']['boolValue']:![];_0x1c9f2e['body'][_0x9377('0x3a')]=_0x18c308[_0x9377('0x31')][_0x9377('0x3b')]['name'];_0x1c9f2e['body'][_0x9377('0x3c')]=_0x18c308[_0x9377('0x31')]['intent'][_0x9377('0x3d')];_0x1c9f2e[_0x9377('0xc')][_0x9377('0x3e')]=_0x18c308[_0x9377('0x31')][_0x9377('0x3b')][_0x9377('0x3f')];_0x1c9f2e[_0x9377('0xc')][_0x9377('0x40')]=_0x18c308[_0x9377('0x31')][_0x9377('0x41')];_0x1c9f2e[_0x9377('0xc')][_0x9377('0x42')]=_0x18c308[_0x9377('0x31')]['queryText'];_0x1c9f2e[_0x9377('0xc')][_0x9377('0x43')]=_0x18c308[_0x9377('0x31')][_0x9377('0x44')];_0x162346[_0x9377('0x45')]=_0x9377('0x46');_0x162346[_0x9377('0x47')]=JSON[_0x9377('0x13')](_0x188284);var _0x119694=[];for(var _0x7c5336=0x0;_0x7c5336<_0x188284['length'];_0x7c5336++){var _0x39c7a3=_0x188284[_0x7c5336];if(_0x39c7a3&&_0x39c7a3[_0x9377('0x31')]&&_0x39c7a3['queryResult'][_0x9377('0x48')]){_0x119694['push'](createMessage(_0x97d5d8,_0xa799e8,_0x162346,_0x39c7a3[_0x9377('0x31')][_0x9377('0x48')]));}}return Promise[_0x9377('0x49')](_0x119694)[_0x9377('0xf')](function(){if(_0x4473de){_0x1833a5[_0x9377('0x19')]();}else{_0x1833a5[_0x9377('0x2a')]();}})['catch'](function(_0x337b8b){logger['error'](_0x9377('0x11'),_0x97d5d8,JSON[_0x9377('0x13')](_0x337b8b));_0x1833a5[_0x9377('0x19')]();});}})[_0x9377('0x27')](function(_0x3a5dd1){logger[_0x9377('0x12')](_0x9377('0x11'),_0x97d5d8,_0x3a5dd1[_0x9377('0x2e')],_0x3a5dd1['stack']);_0x1833a5[_0x9377('0x19')]();});}}catch(_0x2a5fe3){logger[_0x9377('0x12')](_0x9377('0x11'),_0x97d5d8,JSON[_0x9377('0x13')](_0x2a5fe3));_0x1833a5[_0x9377('0x2a')]();}};}; \ 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 1840c46..86ed259 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 _0x5234=['../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','findIndex','info','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5234,0x168));var _0x4523=function(_0x49bb4f,_0x3ce64a){_0x49bb4f=_0x49bb4f-0x0;var _0x35ff49=_0x5234[_0x49bb4f];return _0x35ff49;};'use strict';var schema=require(_0x4523('0x0'));var _=require(_0x4523('0x1'));var htmlToText=require(_0x4523('0x2'));var utils=require(_0x4523('0x3'));var logger=require(_0x4523('0x4'))(_0x4523('0x5'));var gotoif=schema({'condition':{'type':_0x4523('0x6'),'required':!![],'message':_0x4523('0x7')},'priorityTrue':{'type':_0x4523('0x8'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x4523('0x8'),'message':_0x4523('0x9')}});exports[_0x4523('0xa')]=function(_0x1f6cbc,_0x4b669a){return function(_0x49a878){try{var _0x23c2f7={'condition':htmlToText[_0x4523('0xb')](utils['getMustacheRender'](_0x4b669a[0x0],this),{'wordwrap':![]})[_0x4523('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x4b669a[0x1],'priorityFalse':_0x4b669a[0x2]};var _0xa8c38d=gotoif[_0x4523('0x0')](_0x23c2f7,{'typecast':!![]});if(_0xa8c38d[_0x4523('0xd')]){logger[_0x4523('0xe')](_0x4523('0xf'),_0x1f6cbc,_[_0x4523('0x10')](_0xa8c38d,_0x4523('0x11'))[_0x4523('0x12')](',\x20'));_0x49a878[_0x4523('0x13')]();}else{try{var _0x3ac50d=eval('('+_0x23c2f7[_0x4523('0x14')]+')');var _0x2036f8=_0x3ac50d?_0x23c2f7[_0x4523('0x15')]:_0x23c2f7['priorityFalse'];logger['info']('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x1f6cbc,_0x23c2f7['condition'],_0x3ac50d,_0x2036f8||'next');if(_0x2036f8){var _0x1e55cc=_[_0x4523('0x16')](_0x49a878['rules'](),{'p':_0x2036f8});if(_0x1e55cc>=0x0){logger[_0x4523('0x17')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x1f6cbc,_0x2036f8||_0x4523('0x18'),_0x1e55cc);_0x49a878[_0x4523('0x18')](_0x1e55cc);}else{logger[_0x4523('0x17')](_0x4523('0x19'),_0x1f6cbc,_0x2036f8||_0x4523('0x18'));_0x49a878[_0x4523('0x13')]();}}else{_0x49a878[_0x4523('0x18')]();}}catch(_0x22973d){logger[_0x4523('0xe')](_0x4523('0x1a'),_0x1f6cbc,_0x22973d[_0x4523('0x11')]);_0x49a878['stop']();}}}catch(_0x9e4454){logger[_0x4523('0xe')](_0x4523('0xf'),_0x1f6cbc,JSON[_0x4523('0x1b')](_0x9e4454));_0x49a878['stop']();}};}; \ No newline at end of file +var _0x98c7=['rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate','lodash','html-to-text','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','replace','length','[%s][GOTOIF]\x20%s','map','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex'];(function(_0x58efa6,_0x2c00bd){var _0x5d643c=function(_0x1d1ef2){while(--_0x1d1ef2){_0x58efa6['push'](_0x58efa6['shift']());}};_0x5d643c(++_0x2c00bd);}(_0x98c7,0xc7));var _0x798c=function(_0x243bba,_0x1ea69f){_0x243bba=_0x243bba-0x0;var _0x12e696=_0x98c7[_0x243bba];return _0x12e696;};'use strict';var schema=require(_0x798c('0x0'));var _=require(_0x798c('0x1'));var htmlToText=require(_0x798c('0x2'));var utils=require('./utils');var logger=require(_0x798c('0x3'))(_0x798c('0x4'));var gotoif=schema({'condition':{'type':_0x798c('0x5'),'required':!![],'message':_0x798c('0x6')},'priorityTrue':{'type':_0x798c('0x7'),'message':_0x798c('0x8')},'priorityFalse':{'type':_0x798c('0x7'),'message':_0x798c('0x9')}});exports['consequence']=function(_0x271f5b,_0x3fc91e){return function(_0x3b356e){try{var _0x5bfa6e={'condition':htmlToText[_0x798c('0xa')](utils[_0x798c('0xb')](_0x3fc91e[0x0],this),{'wordwrap':![]})[_0x798c('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3fc91e[0x1],'priorityFalse':_0x3fc91e[0x2]};var _0x2f0276=gotoif[_0x798c('0x0')](_0x5bfa6e,{'typecast':!![]});if(_0x2f0276[_0x798c('0xd')]){logger['error'](_0x798c('0xe'),_0x271f5b,_[_0x798c('0xf')](_0x2f0276,'message')[_0x798c('0x10')](',\x20'));_0x3b356e[_0x798c('0x11')]();}else{try{var _0x9653a7=eval('('+_0x5bfa6e[_0x798c('0x12')]+')');var _0x305ee7=_0x9653a7?_0x5bfa6e[_0x798c('0x13')]:_0x5bfa6e[_0x798c('0x14')];logger[_0x798c('0x15')](_0x798c('0x16'),_0x271f5b,_0x5bfa6e[_0x798c('0x12')],_0x9653a7,_0x305ee7||_0x798c('0x17'));if(_0x305ee7){var _0x55d533=_[_0x798c('0x18')](_0x3b356e[_0x798c('0x19')](),{'p':_0x305ee7});if(_0x55d533>=0x0){logger[_0x798c('0x15')](_0x798c('0x1a'),_0x271f5b,_0x305ee7||'next',_0x55d533);_0x3b356e['next'](_0x55d533);}else{logger[_0x798c('0x15')](_0x798c('0x1b'),_0x271f5b,_0x305ee7||_0x798c('0x17'));_0x3b356e[_0x798c('0x11')]();}}else{_0x3b356e[_0x798c('0x17')]();}}catch(_0x7582e1){logger[_0x798c('0x1c')](_0x798c('0x1d'),_0x271f5b,_0x7582e1[_0x798c('0x1e')]);_0x3b356e['stop']();}}}catch(_0x1f317e){logger[_0x798c('0x1c')]('[%s][GOTOIF]\x20%s',_0x271f5b,JSON[_0x798c('0x1f')](_0x1f317e));_0x3b356e[_0x798c('0x11')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 97cc53b..2c3d62f 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 _0x9f25=['priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','map','message','join','stop','info','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20%s','stringify','validate','../../../../config/logger','routing','number'];(function(_0x1c949a,_0x3def30){var _0xa25ff7=function(_0x490e30){while(--_0x490e30){_0x1c949a['push'](_0x1c949a['shift']());}};_0xa25ff7(++_0x3def30);}(_0x9f25,0xb7));var _0x59f2=function(_0x508c10,_0x5a15f0){_0x508c10=_0x508c10-0x0;var _0x3108b5=_0x9f25[_0x508c10];return _0x3108b5;};'use strict';var schema=require(_0x59f2('0x0'));var _=require('lodash');var logger=require(_0x59f2('0x1'))(_0x59f2('0x2'));var gotop=schema({'priority':{'type':_0x59f2('0x3'),'required':!![],'message':_0x59f2('0x4')}});exports[_0x59f2('0x5')]=function(_0x3a7fbc,_0x2969fd){return function(_0x40cf20){try{var _0x5dcc32={'priority':_0x2969fd[0x0]};var _0x49942a=gotop['validate'](_0x5dcc32,{'typecast':!![]});if(_0x49942a['length']){logger['error']('[%s][GOTOP]\x20%s',_0x3a7fbc,_[_0x59f2('0x6')](_0x49942a,_0x59f2('0x7'))[_0x59f2('0x8')](',\x20'));_0x40cf20[_0x59f2('0x9')]();}else{logger[_0x59f2('0xa')]('[%s][GOTOP]\x20priority\x20%s',_0x3a7fbc,_0x5dcc32[_0x59f2('0xb')]);if(_0x5dcc32['priority']){var _0x33c646=_[_0x59f2('0xc')](_0x40cf20['rules'](),{'p':_0x5dcc32[_0x59f2('0xb')]});if(_0x33c646>=0x0){logger['info'](_0x59f2('0xd'),_0x3a7fbc,_0x5dcc32[_0x59f2('0xb')]||_0x59f2('0xe'),_0x33c646);_0x40cf20['next'](_0x33c646);}else{logger['info']('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x3a7fbc,_0x5dcc32['priority']||_0x59f2('0xe'));_0x40cf20[_0x59f2('0x9')]();}}else{_0x40cf20[_0x59f2('0xe')]();}}}catch(_0x17a880){logger['error'](_0x59f2('0xf'),_0x3a7fbc,JSON[_0x59f2('0x10')](_0x17a880));_0x40cf20['stop']();}};}; \ No newline at end of file +var _0xec87=['join','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','validate','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','[%s][GOTOP]\x20%s','message'];(function(_0x1c1aac,_0x4f424e){var _0x3d88e5=function(_0x39d261){while(--_0x39d261){_0x1c1aac['push'](_0x1c1aac['shift']());}};_0x3d88e5(++_0x4f424e);}(_0xec87,0x125));var _0x7ec8=function(_0x2d91c6,_0x10ae0e){_0x2d91c6=_0x2d91c6-0x0;var _0x3a8d19=_0xec87[_0x2d91c6];return _0x3a8d19;};'use strict';var schema=require(_0x7ec8('0x0'));var _=require('lodash');var logger=require('../../../../config/logger')('routing');var gotop=schema({'priority':{'type':_0x7ec8('0x1'),'required':!![],'message':_0x7ec8('0x2')}});exports['consequence']=function(_0x243dfd,_0x1783b5){return function(_0x448387){try{var _0x58ed44={'priority':_0x1783b5[0x0]};var _0x4d7422=gotop['validate'](_0x58ed44,{'typecast':!![]});if(_0x4d7422[_0x7ec8('0x3')]){logger[_0x7ec8('0x4')](_0x7ec8('0x5'),_0x243dfd,_['map'](_0x4d7422,_0x7ec8('0x6'))[_0x7ec8('0x7')](',\x20'));_0x448387['stop']();}else{logger[_0x7ec8('0x8')](_0x7ec8('0x9'),_0x243dfd,_0x58ed44['priority']);if(_0x58ed44[_0x7ec8('0xa')]){var _0x4dfeb3=_[_0x7ec8('0xb')](_0x448387['rules'](),{'p':_0x58ed44['priority']});if(_0x4dfeb3>=0x0){logger[_0x7ec8('0x8')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x243dfd,_0x58ed44['priority']||_0x7ec8('0xc'),_0x4dfeb3);_0x448387[_0x7ec8('0xc')](_0x4dfeb3);}else{logger[_0x7ec8('0x8')](_0x7ec8('0xd'),_0x243dfd,_0x58ed44['priority']||_0x7ec8('0xc'));_0x448387[_0x7ec8('0xe')]();}}else{_0x448387[_0x7ec8('0xc')]();}}}catch(_0x59a432){logger[_0x7ec8('0x4')](_0x7ec8('0x5'),_0x243dfd,JSON['stringify'](_0x59a432));_0x448387['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 70f8c06..b854fdb 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 _0xbefc=['[%s][MESSAGE]\x20%s','body','next','catch','error','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','channel','chat','ChatWebsiteId','account','upperFirst','Message','create','then'];(function(_0x12af17,_0x3a44df){var _0x21b342=function(_0x35b2f4){while(--_0x35b2f4){_0x12af17['push'](_0x12af17['shift']());}};_0x21b342(++_0x3a44df);}(_0xbefc,0x195));var _0xcbef=function(_0x2464c5,_0x44ff5f){_0x2464c5=_0x2464c5-0x0;var _0x206b68=_0xbefc[_0x2464c5];return _0x206b68;};'use strict';var _=require('lodash');var utils=require(_0xcbef('0x0'));var logger=require(_0xcbef('0x1'))(_0xcbef('0x2'));var rpc={'chatMessage':require(_0xcbef('0x3')),'openchannelMessage':require(_0xcbef('0x4')),'mailMessage':require(_0xcbef('0x5')),'smsMessage':require(_0xcbef('0x6')),'faxMessage':require(_0xcbef('0x7')),'whatsappMessage':require(_0xcbef('0x8'))};exports[_0xcbef('0x9')]=function(_0x1645e3,_0x3fe826){return function(_0x4753d1){try{var _0x17bf41={'body':utils[_0xcbef('0xa')](_0x3fe826[0x0],this),'ContactId':this[_0xcbef('0xb')]['id']};if(this[_0xcbef('0xc')]===_0xcbef('0xd')){_0x17bf41[_0xcbef('0xe')]=this[_0xcbef('0xf')]['id'];}else{_0x17bf41[_[_0xcbef('0x10')](this[_0xcbef('0xc')])+'AccountId']=this[_0xcbef('0xf')]['id'];}_0x17bf41[_[_0xcbef('0x10')](this[_0xcbef('0xc')])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0xcbef('0xc')]+_0xcbef('0x11')]){return rpc[this[_0xcbef('0xc')]+_0xcbef('0x11')][_0xcbef('0x12')](_0x17bf41)[_0xcbef('0x13')](function(_0x2ae1a2){logger['info'](_0xcbef('0x14'),_0x1645e3,_0x17bf41[_0xcbef('0x15')]);_0x4753d1[_0xcbef('0x16')]();})[_0xcbef('0x17')](function(_0x3c6e80){logger[_0xcbef('0x18')](_0xcbef('0x14'),_0x1645e3,JSON['stringify'](_0x3c6e80));_0x4753d1['stop']();});}}catch(_0x13e6e6){logger[_0xcbef('0x18')](_0xcbef('0x14'),_0x1645e3,JSON['stringify'](_0x13e6e6));_0x4753d1['stop']();}};}; \ No newline at end of file +var _0x20a1=['catch','error','stringify','stop','lodash','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','Message','create','then','[%s][MESSAGE]\x20%s','body','next'];(function(_0x8ed228,_0x136e9f){var _0x1ed1cf=function(_0xbc4ae1){while(--_0xbc4ae1){_0x8ed228['push'](_0x8ed228['shift']());}};_0x1ed1cf(++_0x136e9f);}(_0x20a1,0x101));var _0x120a=function(_0x4b1408,_0x454aff){_0x4b1408=_0x4b1408-0x0;var _0x412ae2=_0x20a1[_0x4b1408];return _0x412ae2;};'use strict';var _=require(_0x120a('0x0'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x120a('0x1')),'mailMessage':require(_0x120a('0x2')),'smsMessage':require(_0x120a('0x3')),'faxMessage':require(_0x120a('0x4')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x120a('0x5')]=function(_0x465e2f,_0x205722){return function(_0x11cab3){try{var _0x164def={'body':utils['getMustacheRender'](_0x205722[0x0],this),'ContactId':this['contact']['id']};if(this[_0x120a('0x6')]===_0x120a('0x7')){_0x164def[_0x120a('0x8')]=this[_0x120a('0x9')]['id'];}else{_0x164def[_[_0x120a('0xa')](this[_0x120a('0x6')])+'AccountId']=this[_0x120a('0x9')]['id'];}_0x164def[_[_0x120a('0xa')](this[_0x120a('0x6')])+_0x120a('0xb')]=this[_0x120a('0xc')]['id'];if(rpc[this[_0x120a('0x6')]+'Message']){return rpc[this[_0x120a('0x6')]+_0x120a('0xd')][_0x120a('0xe')](_0x164def)[_0x120a('0xf')](function(_0x152082){logger['info'](_0x120a('0x10'),_0x465e2f,_0x164def[_0x120a('0x11')]);_0x11cab3[_0x120a('0x12')]();})[_0x120a('0x13')](function(_0x2dad0f){logger[_0x120a('0x14')](_0x120a('0x10'),_0x465e2f,JSON[_0x120a('0x15')](_0x2dad0f));_0x11cab3['stop']();});}}catch(_0xd32ae7){logger[_0x120a('0x14')](_0x120a('0x10'),_0x465e2f,JSON[_0x120a('0x15')](_0xd32ae7));_0x11cab3[_0x120a('0x16')]();}};}; \ 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 d91072d..a487dff 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 _0x3865=['error','stringify','./utils','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender'];(function(_0x152fb0,_0x2a7216){var _0x5044d6=function(_0x3861d5){while(--_0x3861d5){_0x152fb0['push'](_0x152fb0['shift']());}};_0x5044d6(++_0x2a7216);}(_0x3865,0x142));var _0x5386=function(_0x482016,_0x1a2d53){_0x482016=_0x482016-0x0;var _0x1f2d6b=_0x3865[_0x482016];return _0x1f2d6b;};'use strict';var utils=require(_0x5386('0x0'));var logger=require('../../../../config/logger')(_0x5386('0x1'));exports[_0x5386('0x2')]=function(_0x4ebf48,_0x7e3195){return function(_0x8ad2ca){try{logger[_0x5386('0x3')](_0x5386('0x4'),_0x4ebf48,utils[_0x5386('0x5')](_0x7e3195[0x0],this));_0x8ad2ca['next']();}catch(_0x2518a4){logger[_0x5386('0x6')](_0x5386('0x4'),_0x4ebf48,JSON[_0x5386('0x7')](_0x2518a4));_0x8ad2ca['stop']();}};}; \ No newline at end of file +var _0xab50=['next','[%s][NOOP]\x20%s','stringify','./utils','routing','consequence','info'];(function(_0x200177,_0x45fbbc){var _0x297415=function(_0x3c37ea){while(--_0x3c37ea){_0x200177['push'](_0x200177['shift']());}};_0x297415(++_0x45fbbc);}(_0xab50,0x65));var _0x0ab5=function(_0x277284,_0x35280f){_0x277284=_0x277284-0x0;var _0xc177a3=_0xab50[_0x277284];return _0xc177a3;};'use strict';var utils=require(_0x0ab5('0x0'));var logger=require('../../../../config/logger')(_0x0ab5('0x1'));exports[_0x0ab5('0x2')]=function(_0x52e8c9,_0x419def){return function(_0x47e7e8){try{logger[_0x0ab5('0x3')]('[%s][NOOP]\x20%s',_0x52e8c9,utils['getMustacheRender'](_0x419def[0x0],this));_0x47e7e8[_0x0ab5('0x4')]();}catch(_0x385639){logger['error'](_0x0ab5('0x5'),_0x52e8c9,JSON[_0x0ab5('0x6')](_0x385639));_0x47e7e8['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index e2f770a..e21e19e 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 _0x15a0=['create\x20queue\x20report','waiting','accepted','[%s][STOP:QUEUE][NAME:%s]','update','then','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','join','stop','find','createQueue','atimeout','qtimeout','[%s][QUEUE]\x20ROUTING\x20STOPPED','rules','complete','close','next','strategy','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate','util','moment','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','queue','emit','account','capitalize','InteractionId','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x15a0,0xc4));var _0x015a=function(_0x5d7227,_0x12aebe){_0x5d7227=_0x5d7227-0x0;var _0x15ac55=_0x15a0[_0x5d7227];return _0x15ac55;};'use strict';var schema=require(_0x015a('0x0'));var _=require('lodash');var util=require(_0x015a('0x1'));var seqqueue=require('seq-queue');var moment=require(_0x015a('0x2'));var Redis=require('ioredis');var config=require(_0x015a('0x3'));var logger=require(_0x015a('0x4'))(_0x015a('0x5'));var strategy=require(_0x015a('0x6'));config[_0x015a('0x7')]=_[_0x015a('0x8')](config[_0x015a('0x7')],{'host':_0x015a('0x9'),'port':0x18eb});var io=require(_0x015a('0xa'))(new Redis(config[_0x015a('0x7')]));var attributes=['id',_0x015a('0xb'),'account',_0x015a('0xc'),'from','joinAt'];function emit(_0x5c1417,_0x2a605b,_0x2d1c0c){io['to'](_0x5c1417)[_0x015a('0xd')](_0x2a605b,_0x2d1c0c);}function emitChannelQueueInteraction(_0x3413dd,_0x5256fc,_0x3532c6,_0x319016,_0x4f7b50,_0x5063eb,_0x3b7974,_0x312930){var _0x413a8d=_['clone'](_0x3532c6);_0x413a8d[_0x015a('0xb')]=_0x312930;_0x413a8d['queue']=_0x5256fc;_0x413a8d[_0x015a('0xe')]=_0x319016;_0x413a8d['id']=_0x4f7b50;if(_0x5063eb){attributes['push'](_[_0x015a('0xf')](_0x3413dd)+_0x015a('0x10'));_0x3b7974[util['format'](_0x015a('0x11'),_0x3413dd)][_0x4f7b50]=_[_0x015a('0x12')](_0x413a8d,attributes);}else{delete _0x3b7974[util[_0x015a('0x13')](_0x015a('0x11'),_0x3413dd)][_0x4f7b50];}emit(util['format'](_0x015a('0x14'),_0x3413dd,_0x5256fc),util[_0x015a('0x13')](_0x015a('0x15'),_0x3413dd,_0x5063eb?_0x015a('0x16'):_0x015a('0x17')),_[_0x015a('0x12')](_0x413a8d,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x015a('0x18')),'chatQueueReport':require(_0x015a('0x19')),'smsQueueReport':require(_0x015a('0x1a')),'faxQueueReport':require(_0x015a('0x1b')),'whatsappQueueReport':require(_0x015a('0x1c')),'chatInteraction':require(_0x015a('0x1d')),'faxInteraction':require(_0x015a('0x1e')),'mailInteraction':require(_0x015a('0x1f')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x015a('0x20')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var queue=schema({'name':{'type':'string','required':!![],'message':_0x015a('0x21')},'timeout':{'type':_0x015a('0x22'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0xd2ccbb,_0x5dd9f8,_0x2cad15,_0x281f0b){if(_0xd2ccbb&&_0x5dd9f8&&_0x2cad15){_0x5dd9f8['waiting']+=0x1;var _0x2b13f2={'uniqueid':_0xd2ccbb,'from':_0x2cad15['body']?_0x2cad15[_0x015a('0x23')][_0x015a('0x24')]:'','joinAt':moment()[_0x015a('0x13')](_0x015a('0x25')),'ContactId':_0x2cad15[_0x015a('0x26')]?_0x2cad15[_0x015a('0x26')]['id']:null,'ListId':_0x2cad15['list']?_0x2cad15[_0x015a('0x27')]['id']:null};_0x2b13f2[_[_0x015a('0x28')](_0x2cad15[_0x015a('0x29')])+_0x015a('0x2a')]=_0x5dd9f8['id']||null;_0x2b13f2[_[_0x015a('0x28')](_0x2cad15[_0x015a('0x29')])+_0x015a('0x10')]=_0x2cad15[_0x015a('0x2b')]?_0x2cad15[_0x015a('0x2b')]['id']:null;_0x2b13f2[_[_0x015a('0x28')](_0x2cad15[_0x015a('0x29')])+_0x015a('0x2c')]=_0x2cad15[_0x015a('0x2d')]?_0x2cad15[_0x015a('0x2d')]['id']:null;_0x2b13f2[_[_0x015a('0x28')](_0x2cad15[_0x015a('0x29')])+(_0x2cad15[_0x015a('0x29')]!==_0x015a('0x2e')?_0x015a('0x2f'):_0x015a('0x30'))]=_0x2cad15[_0x015a('0xe')]?_0x2cad15[_0x015a('0xe')]['id']:null;logger[_0x015a('0x31')](util[_0x015a('0x13')](_0x015a('0x32'),_0xd2ccbb,_0x5dd9f8[_0x015a('0x33')]));emitChannelQueueInteraction(_0x2cad15[_0x015a('0x29')],_0x5dd9f8[_0x015a('0x33')],_0x2b13f2,_0x2cad15['account']['name'],_0x2cad15[_0x015a('0x2d')]['id'],!![],_0x281f0b,_0x5dd9f8['id']);if(rpc[_0x2cad15['channel']+_0x015a('0x34')]){return rpc[_0x2cad15['channel']+_0x015a('0x34')][_0x015a('0x35')](_0x2b13f2)[_0x015a('0x36')](function(_0x564377){logger[_0x015a('0x37')](_0x015a('0x38'),_0x564377);});}}}function stopRouting(_0x3227dd,_0x43b93d,_0x9f6c52,_0x23b151){if(_0x3227dd&&_0x43b93d){_0x43b93d[_0x015a('0x39')]-=0x1;var _0x5a5e24={'leaveAt':moment()[_0x015a('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x015a('0x13')](_0x015a('0x25')),'reason':_0x015a('0x3a')};logger[_0x015a('0x31')](util['format'](_0x015a('0x3b'),_0x3227dd,_0x43b93d[_0x015a('0x33')]));emitChannelQueueInteraction(_0x9f6c52[_0x015a('0x29')],_0x43b93d[_0x015a('0x33')],_0x9f6c52[_0x015a('0x23')],_0x9f6c52[_0x015a('0xe')][_0x015a('0x33')],_0x9f6c52['message']['id'],![],_0x23b151,_0x43b93d['id']);return rpc[_0x9f6c52[_0x015a('0x29')]+'Interaction'][_0x015a('0x3c')](_0x9f6c52[_0x015a('0x2b')]['id'],{'queueId':_0x43b93d['id']})[_0x015a('0x3d')](function(){if(rpc[_0x9f6c52[_0x015a('0x29')]+_0x015a('0x34')]){return rpc[_0x9f6c52[_0x015a('0x29')]+_0x015a('0x34')][_0x015a('0x3c')](_0x3227dd,_0x5a5e24)[_0x015a('0x36')](function(_0x1df6b9){logger[_0x015a('0x37')](_0x015a('0x3e'),_0x1df6b9);});}});}}function endRouting(_0x2c7e5c,_0x5d76af,_0x19f33c,_0x3de96b){if(_0x2c7e5c&&_0x5d76af){_0x5d76af[_0x015a('0x39')]-=0x1;var _0x4ea6f4={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()['format'](_0x015a('0x25')),'reason':_0x015a('0x3f')};logger[_0x015a('0x31')](util['format'](_0x015a('0x40'),_0x2c7e5c,_0x5d76af[_0x015a('0x33')]));emitChannelQueueInteraction(_0x19f33c[_0x015a('0x29')],_0x5d76af[_0x015a('0x33')],_0x19f33c[_0x015a('0x23')],_0x19f33c[_0x015a('0xe')][_0x015a('0x33')],_0x19f33c[_0x015a('0x2d')]['id'],![],_0x3de96b);if(rpc[_0x19f33c[_0x015a('0x29')]+_0x015a('0x34')]){return rpc[_0x19f33c[_0x015a('0x29')]+_0x015a('0x34')][_0x015a('0x3c')](_0x2c7e5c,_0x4ea6f4)[_0x015a('0x36')](function(_0x45b6da){logger[_0x015a('0x37')](_0x015a('0x3e'),_0x45b6da);});}}}function handleFindQueue(_0x17d4dd){return function(_0x50df8f){return _0x50df8f[_0x015a('0x33')][_0x015a('0x41')]()===_0x17d4dd[_0x015a('0x41')]();};}exports[_0x015a('0x42')]=function(_0x5282b0,_0x5acf68,_0x2a57d3,_0x2ab17d){return function(_0x33777b){try{var _0x30b184={'name':_0x5acf68[0x0],'timeout':_0x5acf68[0x1]};var _0x20f323=queue[_0x015a('0x0')](_0x30b184,{'typecast':!![]});if(_0x20f323[_0x015a('0x43')]){logger[_0x015a('0x37')]('[%s][QUEUE]\x20%s',_0x5282b0,_['map'](_0x20f323,_0x015a('0x2d'))[_0x015a('0x44')](',\x20'));_0x33777b[_0x015a('0x45')]();}else{var _0x46879b=_[_0x015a('0x46')](_0x2a57d3[_0x2ab17d[_0x015a('0x29')]+'Queues'],handleFindQueue(_0x30b184['name']));if(_0x46879b){startRouting(_0x5282b0,_0x46879b,_0x2ab17d,_0x2a57d3);var _0x294eeb=(_0x46879b[_0x015a('0x3f')]||0xa)*0x3e8;var _0x2aa4fe=(_0x30b184['timeout']||0x14)*0x3e8;var _0x1bb5ef;if(_0x294eeb>_0x2aa4fe){_0x2aa4fe=_0x294eeb;}var _0x567b8e=seqqueue[_0x015a('0x47')](_0x294eeb);_0x567b8e['id']=_0x5282b0;_0x567b8e[_0x015a('0x48')]=_0x294eeb;_0x567b8e[_0x015a('0x49')]=_0x2aa4fe;_0x567b8e['channel']=_0x2ab17d['channel'];_0x2a57d3['rules'][_0x5282b0]['on']('end',function(){logger[_0x015a('0x31')](_0x015a('0x4a'),_0x5282b0);stopRouting(_0x5282b0,_0x46879b,_0x2ab17d,_0x2a57d3);clearTimeout(_0x1bb5ef);_0x1bb5ef=undefined;_0x567b8e['close'](!![]);if(_0x2a57d3[_0x015a('0x4b')][_0x5282b0]){delete _0x2a57d3['rules'][_0x5282b0];}_0x33777b['stop']();});_0x2a57d3[_0x015a('0x4b')][_0x5282b0]['on'](_0x015a('0x4c'),function(){if(_0x2a57d3[_0x015a('0x4b')][_0x5282b0]){delete _0x2a57d3[_0x015a('0x4b')][_0x5282b0];}});_0x1bb5ef=setTimeout(function(){logger[_0x015a('0x31')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x5282b0);endRouting(_0x5282b0,_0x46879b,_0x2ab17d,_0x2a57d3);clearTimeout(_0x1bb5ef);_0x567b8e[_0x015a('0x4d')](!![]);_0x33777b[_0x015a('0x4e')]();},_0x2aa4fe);switch(_0x46879b[_0x015a('0x4f')]){case'rrmemory':strategy['rrmemory'](_0x567b8e,_0x46879b,_0x2a57d3,_0x2ab17d);break;default:strategy[_0x015a('0x50')](_0x567b8e,_0x46879b,_0x2a57d3,_0x2ab17d);}}else{logger['error'](_0x015a('0x51'),_0x5282b0,_0x30b184[_0x015a('0x33')]);_0x33777b[_0x015a('0x45')]();}}}catch(_0x321edf){logger[_0x015a('0x37')](_0x015a('0x52'),_0x5282b0,_0x321edf[_0x015a('0x53')]);_0x33777b[_0x015a('0x45')]();}};}; \ No newline at end of file +var _0xfb1f=['push','capitalize','InteractionId','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','save','remove','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','interaction','MessageId','message','chat','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','accepted','[%s][STOP:QUEUE][NAME:%s]','update','error','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','length','[%s][QUEUE]\x20%s','map','join','stop','timeout','createQueue','atimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','strategy','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','socket.io-emitter','account','queue','from','joinAt','clone','queue_id'];(function(_0x5108aa,_0x60c97f){var _0x3069b1=function(_0x1dcc0c){while(--_0x1dcc0c){_0x5108aa['push'](_0x5108aa['shift']());}};_0x3069b1(++_0x60c97f);}(_0xfb1f,0x17e));var _0xffb1=function(_0xa5356d,_0x43851e){_0xa5356d=_0xa5356d-0x0;var _0x7fd0b0=_0xfb1f[_0xa5356d];return _0x7fd0b0;};'use strict';var schema=require('validate');var _=require(_0xffb1('0x0'));var util=require(_0xffb1('0x1'));var seqqueue=require(_0xffb1('0x2'));var moment=require(_0xffb1('0x3'));var Redis=require(_0xffb1('0x4'));var config=require(_0xffb1('0x5'));var logger=require(_0xffb1('0x6'))(_0xffb1('0x7'));var strategy=require(_0xffb1('0x8'));config[_0xffb1('0x9')]=_[_0xffb1('0xa')](config[_0xffb1('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xffb1('0xb'))(new Redis(config[_0xffb1('0x9')]));var attributes=['id','queue_id',_0xffb1('0xc'),_0xffb1('0xd'),_0xffb1('0xe'),_0xffb1('0xf')];function emit(_0x388dfa,_0x2b3e81,_0x1521ce){io['to'](_0x388dfa)['emit'](_0x2b3e81,_0x1521ce);}function emitChannelQueueInteraction(_0x2c0410,_0x175b20,_0x3da386,_0x1079b8,_0xfa3cd0,_0x85a502,_0xb098df,_0x5c43d5){var _0x4a62cb=_[_0xffb1('0x10')](_0x3da386);_0x4a62cb[_0xffb1('0x11')]=_0x5c43d5;_0x4a62cb[_0xffb1('0xd')]=_0x175b20;_0x4a62cb[_0xffb1('0xc')]=_0x1079b8;_0x4a62cb['id']=_0xfa3cd0;if(_0x85a502){attributes[_0xffb1('0x12')](_[_0xffb1('0x13')](_0x2c0410)+_0xffb1('0x14'));_0xb098df[util[_0xffb1('0x15')](_0xffb1('0x16'),_0x2c0410)][_0xfa3cd0]=_[_0xffb1('0x17')](_0x4a62cb,attributes);}else{delete _0xb098df[util[_0xffb1('0x15')](_0xffb1('0x16'),_0x2c0410)][_0xfa3cd0];}emit(util[_0xffb1('0x15')](_0xffb1('0x18'),_0x2c0410,_0x175b20),util[_0xffb1('0x15')]('%s_queue_waiting_interaction:%s',_0x2c0410,_0x85a502?_0xffb1('0x19'):_0xffb1('0x1a')),_[_0xffb1('0x17')](_0x4a62cb,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xffb1('0x1b')),'chatQueueReport':require(_0xffb1('0x1c')),'smsQueueReport':require(_0xffb1('0x1d')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0xffb1('0x1e')),'chatInteraction':require(_0xffb1('0x1f')),'faxInteraction':require(_0xffb1('0x20')),'mailInteraction':require('../../rpc/mailInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xffb1('0x21')),'whatsappInteraction':require(_0xffb1('0x22'))};var queue=schema({'name':{'type':_0xffb1('0x23'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0xffb1('0x24')}});function startRouting(_0x48cea8,_0x1216cf,_0x572fc6,_0x236d9a){if(_0x48cea8&&_0x1216cf&&_0x572fc6){_0x1216cf[_0xffb1('0x25')]+=0x1;var _0x33c46c={'uniqueid':_0x48cea8,'from':_0x572fc6[_0xffb1('0x26')]?_0x572fc6[_0xffb1('0x26')][_0xffb1('0xe')]:'','joinAt':moment()['format'](_0xffb1('0x27')),'ContactId':_0x572fc6[_0xffb1('0x28')]?_0x572fc6[_0xffb1('0x28')]['id']:null,'ListId':_0x572fc6[_0xffb1('0x29')]?_0x572fc6[_0xffb1('0x29')]['id']:null};_0x33c46c[_['upperFirst'](_0x572fc6[_0xffb1('0x2a')])+_0xffb1('0x2b')]=_0x1216cf['id']||null;_0x33c46c[_[_0xffb1('0x2c')](_0x572fc6[_0xffb1('0x2a')])+_0xffb1('0x14')]=_0x572fc6['interaction']?_0x572fc6[_0xffb1('0x2d')]['id']:null;_0x33c46c[_['upperFirst'](_0x572fc6['channel'])+_0xffb1('0x2e')]=_0x572fc6['message']?_0x572fc6[_0xffb1('0x2f')]['id']:null;_0x33c46c[_['upperFirst'](_0x572fc6[_0xffb1('0x2a')])+(_0x572fc6[_0xffb1('0x2a')]!==_0xffb1('0x30')?'AccountId':_0xffb1('0x31'))]=_0x572fc6['account']?_0x572fc6[_0xffb1('0xc')]['id']:null;logger[_0xffb1('0x32')](util[_0xffb1('0x15')](_0xffb1('0x33'),_0x48cea8,_0x1216cf[_0xffb1('0x34')]));emitChannelQueueInteraction(_0x572fc6['channel'],_0x1216cf[_0xffb1('0x34')],_0x33c46c,_0x572fc6[_0xffb1('0xc')][_0xffb1('0x34')],_0x572fc6[_0xffb1('0x2f')]['id'],!![],_0x236d9a,_0x1216cf['id']);if(rpc[_0x572fc6['channel']+_0xffb1('0x35')]){return rpc[_0x572fc6[_0xffb1('0x2a')]+'QueueReport'][_0xffb1('0x36')](_0x33c46c)[_0xffb1('0x37')](function(_0x407739){logger['error']('create\x20queue\x20report',_0x407739);});}}}function stopRouting(_0x4e066e,_0x3e6843,_0x32d424,_0x255c00){if(_0x4e066e&&_0x3e6843){_0x3e6843[_0xffb1('0x25')]-=0x1;var _0xe9659f={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xffb1('0x15')](_0xffb1('0x27')),'reason':_0xffb1('0x38')};logger[_0xffb1('0x32')](util[_0xffb1('0x15')](_0xffb1('0x39'),_0x4e066e,_0x3e6843[_0xffb1('0x34')]));emitChannelQueueInteraction(_0x32d424['channel'],_0x3e6843['name'],_0x32d424['body'],_0x32d424['account'][_0xffb1('0x34')],_0x32d424[_0xffb1('0x2f')]['id'],![],_0x255c00,_0x3e6843['id']);return rpc[_0x32d424[_0xffb1('0x2a')]+'Interaction'][_0xffb1('0x3a')](_0x32d424[_0xffb1('0x2d')]['id'],{'queueId':_0x3e6843['id']})['then'](function(){if(rpc[_0x32d424[_0xffb1('0x2a')]+'QueueReport']){return rpc[_0x32d424['channel']+_0xffb1('0x35')][_0xffb1('0x3a')](_0x4e066e,_0xe9659f)['catch'](function(_0x1e9a39){logger[_0xffb1('0x3b')](_0xffb1('0x3c'),_0x1e9a39);});}});}}function endRouting(_0x29b2fd,_0x4b7dcb,_0x52279d,_0x301a2a){if(_0x29b2fd&&_0x4b7dcb){_0x4b7dcb[_0xffb1('0x25')]-=0x1;var _0x285778={'leaveAt':moment()['format'](_0xffb1('0x27')),'exitAt':moment()[_0xffb1('0x15')](_0xffb1('0x27')),'reason':'timeout'};logger[_0xffb1('0x32')](util[_0xffb1('0x15')](_0xffb1('0x3d'),_0x29b2fd,_0x4b7dcb[_0xffb1('0x34')]));emitChannelQueueInteraction(_0x52279d[_0xffb1('0x2a')],_0x4b7dcb[_0xffb1('0x34')],_0x52279d['body'],_0x52279d[_0xffb1('0xc')][_0xffb1('0x34')],_0x52279d[_0xffb1('0x2f')]['id'],![],_0x301a2a);if(rpc[_0x52279d[_0xffb1('0x2a')]+_0xffb1('0x35')]){return rpc[_0x52279d[_0xffb1('0x2a')]+_0xffb1('0x35')]['update'](_0x29b2fd,_0x285778)[_0xffb1('0x37')](function(_0x543d84){logger['error']('update\x20queue\x20report',_0x543d84);});}}}function handleFindQueue(_0x2837c7){return function(_0x2f7bcc){return _0x2f7bcc[_0xffb1('0x34')][_0xffb1('0x3e')]()===_0x2837c7[_0xffb1('0x3e')]();};}exports['consequence']=function(_0x21748b,_0x2b35fa,_0x3a2435,_0x4dac60){return function(_0x3d50d5){try{var _0x293d8a={'name':_0x2b35fa[0x0],'timeout':_0x2b35fa[0x1]};var _0x454500=queue['validate'](_0x293d8a,{'typecast':!![]});if(_0x454500[_0xffb1('0x3f')]){logger[_0xffb1('0x3b')](_0xffb1('0x40'),_0x21748b,_[_0xffb1('0x41')](_0x454500,_0xffb1('0x2f'))[_0xffb1('0x42')](',\x20'));_0x3d50d5[_0xffb1('0x43')]();}else{var _0x5b4fdc=_['find'](_0x3a2435[_0x4dac60[_0xffb1('0x2a')]+'Queues'],handleFindQueue(_0x293d8a[_0xffb1('0x34')]));if(_0x5b4fdc){startRouting(_0x21748b,_0x5b4fdc,_0x4dac60,_0x3a2435);var _0x44ab8a=(_0x5b4fdc[_0xffb1('0x44')]||0xa)*0x3e8;var _0x6e030d=(_0x293d8a[_0xffb1('0x44')]||0x14)*0x3e8;var _0x425093;if(_0x44ab8a>_0x6e030d){_0x6e030d=_0x44ab8a;}var _0x285068=seqqueue[_0xffb1('0x45')](_0x44ab8a);_0x285068['id']=_0x21748b;_0x285068[_0xffb1('0x46')]=_0x44ab8a;_0x285068['qtimeout']=_0x6e030d;_0x285068[_0xffb1('0x2a')]=_0x4dac60[_0xffb1('0x2a')];_0x3a2435[_0xffb1('0x47')][_0x21748b]['on'](_0xffb1('0x48'),function(){logger[_0xffb1('0x32')](_0xffb1('0x49'),_0x21748b);stopRouting(_0x21748b,_0x5b4fdc,_0x4dac60,_0x3a2435);clearTimeout(_0x425093);_0x425093=undefined;_0x285068[_0xffb1('0x4a')](!![]);if(_0x3a2435[_0xffb1('0x47')][_0x21748b]){delete _0x3a2435[_0xffb1('0x47')][_0x21748b];}_0x3d50d5[_0xffb1('0x43')]();});_0x3a2435[_0xffb1('0x47')][_0x21748b]['on'](_0xffb1('0x4b'),function(){if(_0x3a2435[_0xffb1('0x47')][_0x21748b]){delete _0x3a2435[_0xffb1('0x47')][_0x21748b];}});_0x425093=setTimeout(function(){logger[_0xffb1('0x32')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x21748b);endRouting(_0x21748b,_0x5b4fdc,_0x4dac60,_0x3a2435);clearTimeout(_0x425093);_0x285068[_0xffb1('0x4a')](!![]);_0x3d50d5['next']();},_0x6e030d);switch(_0x5b4fdc[_0xffb1('0x4c')]){case'rrmemory':strategy['rrmemory'](_0x285068,_0x5b4fdc,_0x3a2435,_0x4dac60);break;default:strategy[_0xffb1('0x4d')](_0x285068,_0x5b4fdc,_0x3a2435,_0x4dac60);}}else{logger[_0xffb1('0x3b')](_0xffb1('0x4e'),_0x21748b,_0x293d8a[_0xffb1('0x34')]);_0x3d50d5['stop']();}}}catch(_0x50dd06){logger[_0xffb1('0x3b')]('[%s][QUEUE]\x20%s',_0x21748b,_0x50dd06[_0xffb1('0x4f')]);_0x3d50d5['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index 80f5826..d1c171a 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 _0x98a8=['prototype','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','push','isAgentAvailable','busy','saveWaitingNotification','channel','RINGING','forcedOwnership',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','removeWaitingNotification','TIMEOUT','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','handleRun','handleTimeout','bind','timeout','drained','handleDrained'];(function(_0x54a0bc,_0x26159b){var _0x2110dc=function(_0x3b2b26){while(--_0x3b2b26){_0x54a0bc['push'](_0x54a0bc['shift']());}};_0x2110dc(++_0x26159b);}(_0x98a8,0x12c));var _0x898a=function(_0x7f50e3,_0x23e793){_0x7f50e3=_0x7f50e3-0x0;var _0x166101=_0x98a8[_0x7f50e3];return _0x166101;};'use strict';var _=require(_0x898a('0x0'));var uuid=require(_0x898a('0x1'));var util=require(_0x898a('0x2'));var logger=require(_0x898a('0x3'))(_0x898a('0x4'));var Agent=function(_0x226db7,_0x69c61f,_0x4a0836,_0x2bb3e2){this[_0x898a('0x5')]=uuid['v4']();this[_0x898a('0x6')]=_0x226db7;this[_0x898a('0x7')]=_0x69c61f;this[_0x898a('0x8')]=_0x4a0836;this['routing']=_0x2bb3e2;this[_0x898a('0x6')]['push'](this[_0x898a('0x9')]['bind'](this),this[_0x898a('0xa')][_0x898a('0xb')](this));this[_0x898a('0x6')]['on'](_0x898a('0xc'),this[_0x898a('0xa')][_0x898a('0xb')](this));this[_0x898a('0x6')]['on'](_0x898a('0xd'),this[_0x898a('0xe')]['bind'](this));};Agent[_0x898a('0xf')]['push']=function(){this[_0x898a('0x6')]['push'](this[_0x898a('0x9')][_0x898a('0xb')](this),this[_0x898a('0xa')]['bind'](this));};Agent['prototype']['handleDrained']=function(){this[_0x898a('0xa')](!![]);};Agent[_0x898a('0xf')][_0x898a('0x9')]=function(){logger[_0x898a('0x10')](_0x898a('0x11'),this[_0x898a('0x6')]['id'],this['agent']['id']);if(_[_0x898a('0x12')](this['realtime'][_0x898a('0x13')][this['agent']['id']])){logger[_0x898a('0x10')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x898a('0x6')]['id'],this['agent']['id']);setTimeout(this[_0x898a('0x14')][_0x898a('0xb')](this),0x3e8);}else{if(this[_0x898a('0x4')]['forcedOwnership']||util[_0x898a('0x15')](this['squeue']['id'],this['realtime'][_0x898a('0x13')][this[_0x898a('0x7')]['id']],this['squeue']['channel'],![])){this[_0x898a('0x8')][_0x898a('0x13')][this[_0x898a('0x7')]['id']][_0x898a('0x16')]=!![];this[_0x898a('0x8')][_0x898a('0x13')][this[_0x898a('0x7')]['id']]['busyQueue']=undefined;util[_0x898a('0x17')](this[_0x898a('0x8')],this[_0x898a('0x4')],this[_0x898a('0x7')],this[_0x898a('0x6')][_0x898a('0x18')]);util['showNotification'](this[_0x898a('0x5')],this[_0x898a('0x6')]['id'],this[_0x898a('0x8')][_0x898a('0x13')][this[_0x898a('0x7')]['id']],null,this[_0x898a('0x4')]);util['writeLog'](this[_0x898a('0x6')]['id'],this['realtime']['agents'][this['agent']['id']],_0x898a('0x19')+(this[_0x898a('0x4')][_0x898a('0x1a')]?_0x898a('0x1b'):''));}else{logger[_0x898a('0x10')](_0x898a('0x1c'),this[_0x898a('0x6')]['id'],this[_0x898a('0x7')]['id']);setTimeout(this[_0x898a('0x14')]['bind'](this),0x3e8);}}};Agent['prototype']['handleTimeout']=function(_0xe9c33d){if(_[_0x898a('0x12')](this[_0x898a('0x8')][_0x898a('0x13')][this[_0x898a('0x7')]['id']])){return logger[_0x898a('0x10')](_0x898a('0x1d'),this[_0x898a('0x6')]['id'],this[_0x898a('0x7')]['id']);}else{logger[_0x898a('0x10')](_0x898a('0x1e'),this[_0x898a('0x6')]['id'],this['agent']['id']);util[_0x898a('0x1f')](this[_0x898a('0x5')],this[_0x898a('0x6')]['id'],this[_0x898a('0x8')][_0x898a('0x13')][this['agent']['id']],null,this['routing']);this[_0x898a('0x8')][_0x898a('0x13')][this[_0x898a('0x7')]['id']]['busy']=![];this[_0x898a('0x8')][_0x898a('0x13')][this[_0x898a('0x7')]['id']][_0x898a('0x20')]=undefined;util[_0x898a('0x21')](this[_0x898a('0x8')],this[_0x898a('0x4')],this[_0x898a('0x7')],this['squeue'][_0x898a('0x18')]);util['writeLog'](this['squeue']['id'],this[_0x898a('0x8')]['agents'][this[_0x898a('0x7')]['id']],_0xe9c33d?'STOP':_0x898a('0x22'));}if(!_0xe9c33d){setTimeout(this['push'][_0x898a('0xb')](this),0x3e8);}};function agent(_0x354703,_0x101182,_0x50c0e4,_0x554897){return new Agent(_0x354703,_0x101182,_0x50c0e4,_0x554897);}module['exports']=agent; \ No newline at end of file +var _0xf2ca=['channel','busy','busyQueue','saveWaitingNotification','showNotification','writeLog','RINGING','STOP','TIMEOUT','exports','lodash','uuid','./util','routing','notificationId','agent','realtime','squeue','handleRun','bind','timeout','drained','handleDrained','push','prototype','handleTimeout','debug','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership'];(function(_0x47e5ad,_0x4a1a3e){var _0x34203f=function(_0x24506d){while(--_0x24506d){_0x47e5ad['push'](_0x47e5ad['shift']());}};_0x34203f(++_0x4a1a3e);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x4cd690,_0x4797cc){_0x4cd690=_0x4cd690-0x0;var _0x4a74a9=_0xf2ca[_0x4cd690];return _0x4a74a9;};'use strict';var _=require(_0xaf2c('0x0'));var uuid=require(_0xaf2c('0x1'));var util=require(_0xaf2c('0x2'));var logger=require('../../../../../config/logger')(_0xaf2c('0x3'));var Agent=function(_0x2102e2,_0x1271a9,_0x219511,_0x3a724c){this[_0xaf2c('0x4')]=uuid['v4']();this['squeue']=_0x2102e2;this[_0xaf2c('0x5')]=_0x1271a9;this[_0xaf2c('0x6')]=_0x219511;this[_0xaf2c('0x3')]=_0x3a724c;this[_0xaf2c('0x7')]['push'](this[_0xaf2c('0x8')][_0xaf2c('0x9')](this),this['handleTimeout'][_0xaf2c('0x9')](this));this['squeue']['on'](_0xaf2c('0xa'),this['handleTimeout'][_0xaf2c('0x9')](this));this[_0xaf2c('0x7')]['on'](_0xaf2c('0xb'),this[_0xaf2c('0xc')]['bind'](this));};Agent['prototype'][_0xaf2c('0xd')]=function(){this[_0xaf2c('0x7')][_0xaf2c('0xd')](this[_0xaf2c('0x8')][_0xaf2c('0x9')](this),this['handleTimeout']['bind'](this));};Agent[_0xaf2c('0xe')][_0xaf2c('0xc')]=function(){this[_0xaf2c('0xf')](!![]);};Agent[_0xaf2c('0xe')][_0xaf2c('0x8')]=function(){logger[_0xaf2c('0x10')](_0xaf2c('0x11'),this[_0xaf2c('0x7')]['id'],this[_0xaf2c('0x5')]['id']);if(_[_0xaf2c('0x12')](this[_0xaf2c('0x6')][_0xaf2c('0x13')][this[_0xaf2c('0x5')]['id']])){logger[_0xaf2c('0x10')](_0xaf2c('0x14'),this['squeue']['id'],this[_0xaf2c('0x5')]['id']);setTimeout(this['push'][_0xaf2c('0x9')](this),0x3e8);}else{if(this[_0xaf2c('0x3')][_0xaf2c('0x15')]||util['isAgentAvailable'](this[_0xaf2c('0x7')]['id'],this[_0xaf2c('0x6')][_0xaf2c('0x13')][this[_0xaf2c('0x5')]['id']],this[_0xaf2c('0x7')][_0xaf2c('0x16')],![])){this['realtime'][_0xaf2c('0x13')][this[_0xaf2c('0x5')]['id']][_0xaf2c('0x17')]=!![];this[_0xaf2c('0x6')][_0xaf2c('0x13')][this['agent']['id']][_0xaf2c('0x18')]=undefined;util[_0xaf2c('0x19')](this[_0xaf2c('0x6')],this['routing'],this['agent'],this[_0xaf2c('0x7')][_0xaf2c('0x16')]);util[_0xaf2c('0x1a')](this[_0xaf2c('0x4')],this['squeue']['id'],this[_0xaf2c('0x6')][_0xaf2c('0x13')][this[_0xaf2c('0x5')]['id']],null,this[_0xaf2c('0x3')]);util[_0xaf2c('0x1b')](this[_0xaf2c('0x7')]['id'],this[_0xaf2c('0x6')]['agents'][this[_0xaf2c('0x5')]['id']],_0xaf2c('0x1c')+(this[_0xaf2c('0x3')][_0xaf2c('0x15')]?':FORCED':''));}else{logger[_0xaf2c('0x10')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0xaf2c('0x7')]['id'],this[_0xaf2c('0x5')]['id']);setTimeout(this[_0xaf2c('0xd')]['bind'](this),0x3e8);}}};Agent[_0xaf2c('0xe')][_0xaf2c('0xf')]=function(_0x3baee2){if(_['isNil'](this[_0xaf2c('0x6')][_0xaf2c('0x13')][this[_0xaf2c('0x5')]['id']])){return logger[_0xaf2c('0x10')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0xaf2c('0x7')]['id'],this[_0xaf2c('0x5')]['id']);}else{logger[_0xaf2c('0x10')]('[%s][AGENT]\x20timeout\x20with\x20%s',this['squeue']['id'],this[_0xaf2c('0x5')]['id']);util['hideNotification'](this[_0xaf2c('0x4')],this['squeue']['id'],this[_0xaf2c('0x6')][_0xaf2c('0x13')][this['agent']['id']],null,this[_0xaf2c('0x3')]);this[_0xaf2c('0x6')]['agents'][this[_0xaf2c('0x5')]['id']][_0xaf2c('0x17')]=![];this[_0xaf2c('0x6')][_0xaf2c('0x13')][this[_0xaf2c('0x5')]['id']][_0xaf2c('0x18')]=undefined;util['removeWaitingNotification'](this[_0xaf2c('0x6')],this['routing'],this[_0xaf2c('0x5')],this['squeue'][_0xaf2c('0x16')]);util['writeLog'](this[_0xaf2c('0x7')]['id'],this['realtime'][_0xaf2c('0x13')][this['agent']['id']],_0x3baee2?_0xaf2c('0x1d'):_0xaf2c('0x1e'));}if(!_0x3baee2){setTimeout(this[_0xaf2c('0xd')][_0xaf2c('0x9')](this),0x3e8);}};function agent(_0x470aff,_0x598adb,_0x4cba13,_0x6f428d){return new Agent(_0x470aff,_0x598adb,_0x4cba13,_0x6f428d);}module[_0xaf2c('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 567989a..b83870c 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 _0x054a=['RINGING','busy','busyQueue','saveWaitingNotification','debug','[%s][QUEUE]\x20EMPTY','hideNotification','writeLog','STOP','TIMEOUT','removeWaitingNotification','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','isNil','Agents','length','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','realtime','agents','channel'];(function(_0x104bec,_0xecc0c0){var _0x4411b2=function(_0x5f1e06){while(--_0x5f1e06){_0x104bec['push'](_0x104bec['shift']());}};_0x4411b2(++_0xecc0c0);}(_0x054a,0x146));var _0xa054=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x054a[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa054('0x0'));var uuid=require(_0xa054('0x1'));var util=require(_0xa054('0x2'));var logger=require(_0xa054('0x3'))(_0xa054('0x4'));var Beepall=function(_0xebeff7,_0x53ab56,_0x1c39d2,_0x26a538){this[_0xa054('0x5')]=uuid['v4']();this[_0xa054('0x6')]=_0xebeff7;this[_0xa054('0x7')]=_0x53ab56;this['realtime']=_0x1c39d2;this['routing']=_0x26a538;this[_0xa054('0x6')][_0xa054('0x8')](this[_0xa054('0x9')][_0xa054('0xa')](this),this[_0xa054('0xb')][_0xa054('0xa')](this));this[_0xa054('0x6')]['on'](_0xa054('0xc'),this[_0xa054('0xb')][_0xa054('0xa')](this));this[_0xa054('0x6')]['on'](_0xa054('0xd'),this[_0xa054('0xe')][_0xa054('0xa')](this));};Beepall[_0xa054('0xf')][_0xa054('0x8')]=function(){this['squeue']['push'](this[_0xa054('0x9')]['bind'](this),this[_0xa054('0xb')]['bind'](this));};Beepall[_0xa054('0xf')][_0xa054('0xe')]=function(){this['handleTimeout'](!![]);};Beepall[_0xa054('0xf')][_0xa054('0x9')]=function(){var _0x426542=!![];if(!_[_0xa054('0x10')](this[_0xa054('0x7')])&&!_['isNil'](this[_0xa054('0x7')][_0xa054('0x11')])&&this[_0xa054('0x7')][_0xa054('0x11')][_0xa054('0x12')]>0x0){for(var _0x43d3cf=0x0,_0x450855;_0x43d3cf0x0){for(var _0x1a3a13=0x0,_0x2cb009;_0x1a3a130x0&&_0x1ddfcb[_0x56cb73+_0x8a84('0x26')]>=_0x1ddfcb[_0x56cb73+_0x8a84('0x25')]){writeLog(_0x3f4880,_0x1ddfcb,_0x56cb73[_0x8a84('0x27')]()+_0x8a84('0x28'));return![];}}return!![];};exports['showNotification']=function(_0x34b0dd,_0x244126,_0x260f6d,_0x34e448,_0x4a9f05){return sendNotification(!![],_0x34b0dd,_0x244126,_0x260f6d,_0x34e448,_0x4a9f05);};exports['hideNotification']=function(_0x52db42,_0x272252,_0x44632e,_0x5520bf,_0x3f6337){return sendNotification(![],_0x52db42,_0x272252,_0x44632e,_0x5520bf,_0x3f6337);};exports['checkWaitingNotifications']=function(_0x508720,_0x47b658,_0x4940af){var _0x482067=_0x47b658[_0x8a84('0x29')][_0x8a84('0x2a')];if(!_0x482067&&_0x4940af){_0x482067=_0x4940af['id'];}var _0x396c46=_[_0x8a84('0x2b')](_0x508720[_0x47b658[_0x8a84('0x2c')]+'QueuesWaitingInteractions'],function(_0x2df556){var _0x29fe41=_['capitalize'](_0x47b658[_0x8a84('0x2c')])+'InteractionId';return _0x2df556[_0x29fe41]===_0x47b658['interaction']['id'];});if(!_0x396c46&&_0x482067&&_0x508720[_0x8a84('0x2d')][_0x482067]){_0x396c46=_[_0x8a84('0x2b')](_0x508720[_0x8a84('0x2d')][_0x482067][_0x47b658[_0x8a84('0x2c')]+_0x8a84('0x2e')],function(_0x16707a){return _0x16707a['id']===_0x47b658[_0x8a84('0x29')]['id'];});}return _0x396c46;};exports['saveWaitingNotification']=function(_0x4cd479,_0x29243e,_0x4b2ab3,_0x2479a8){if(_0x4b2ab3&&_0x4b2ab3['id']&&_0x4cd479[_0x8a84('0x2d')]&&_0x4cd479[_0x8a84('0x2d')][_0x4b2ab3['id']]){_0x4cd479[_0x8a84('0x2d')][_0x4b2ab3['id']][_0x2479a8+'WaitingInteractions'][_0x29243e[_0x8a84('0x17')]['id']]={'id':_0x29243e[_0x8a84('0x29')]['id']};}};exports[_0x8a84('0x2f')]=function(_0x4aa3bb,_0x227eb6,_0xdc899,_0x1fcbb8){if(_0xdc899&&_0xdc899['id']&&_0x4aa3bb['agents']&&_0x4aa3bb[_0x8a84('0x2d')][_0xdc899['id']]){delete _0x4aa3bb[_0x8a84('0x2d')][_0xdc899['id']][_0x1fcbb8+_0x8a84('0x2e')][_0x227eb6[_0x8a84('0x17')]['id']];}};exports[_0x8a84('0x30')]=writeLog; \ No newline at end of file +var _0x5732=['remove','debug','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','OFFLINE','Pause','PAUSE','hasOwnProperty','CurrentCapacity','Capacity','\x20MAXCAPACITY','showNotification','hideNotification','interaction','UserId','channel','QueuesWaitingInteractions','capitalize','InteractionId','agents','some','WaitingInteractions','saveWaitingNotification','writeLog','util','../utils','ioredis','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','\x20interaction','name','account','notificationSound','notificationShake','body','queue','getMustacheRender','msg','I\x20can\x27t\x20render\x20your\x20template','error','message','user:%s','format','notification:%s','save'];(function(_0x790f00,_0x403383){var _0x1b1013=function(_0x154fdb){while(--_0x154fdb){_0x790f00['push'](_0x790f00['shift']());}};_0x1b1013(++_0x403383);}(_0x5732,0xdc));var _0x2573=function(_0x5b8b6d,_0x112263){_0x5b8b6d=_0x5b8b6d-0x0;var _0x4c7769=_0x5732[_0x5b8b6d];return _0x4c7769;};'use strict';var _=require('lodash');var util=require(_0x2573('0x0'));var utils=require(_0x2573('0x1'));var Redis=require(_0x2573('0x2'));var config=require('../../../../../config/environment');var logger=require(_0x2573('0x3'))(_0x2573('0x4'));config[_0x2573('0x5')]=_[_0x2573('0x6')](config[_0x2573('0x5')],{'host':_0x2573('0x7'),'port':0x18eb});var io=require(_0x2573('0x8'))(new Redis(config['redis']));function sendNotification(_0x526373,_0x5bc174,_0x256295,_0x1a6107,_0x244ddf,_0x49e556){var _0x51d00c=_0x49e556||{};var _0x1d1728=_0x256295['split']('.');var _0x335716={'uniqueid':_0x5bc174,'channel':_0x1d1728[0x0],'id':_0x1d1728[0x1],'title':_0x1d1728[0x0]+_0x2573('0x9'),'interactionId':_0x1d1728[0x2],'queue':_0x244ddf?_0x244ddf[_0x2573('0xa')]:null,'sound':_0x51d00c[_0x2573('0xb')][_0x2573('0xc')],'shake':_0x51d00c[_0x2573('0xb')][_0x2573('0xd')]};try{if(!_0x51d00c[_0x2573('0xe')]){_0x51d00c[_0x2573('0xe')]={};}if(_0x244ddf){_0x51d00c[_0x2573('0xe')]['queue']=_0x244ddf;}else if(_0x51d00c[_0x2573('0xe')]['queue']){delete _0x51d00c[_0x2573('0xe')][_0x2573('0xf')];}_0x335716['msg']=utils[_0x2573('0x10')](_0x51d00c[_0x2573('0xb')]['notificationTemplate'],_0x51d00c);}catch(_0x734b07){_0x335716[_0x2573('0x11')]=_0x2573('0x12');logger[_0x2573('0x13')](util['format']('[%s][QUEUE]\x20%s',_0x5bc174,_0x734b07[_0x2573('0x14')]));}io['to'](util['format'](_0x2573('0x15'),_0x1a6107[_0x2573('0xa')]))['emit'](util[_0x2573('0x16')](_0x2573('0x17'),_0x526373?_0x2573('0x18'):_0x2573('0x19')),_0x335716);}function writeLog(_0x4838da,_0x9870d0,_0x21bfac){return logger[_0x2573('0x1a')](util[_0x2573('0x16')](_0x2573('0x1b'),_0x4838da,_0x9870d0[_0x2573('0xa')],_0x21bfac));}exports[_0x2573('0x1c')]=function(_0x4c44f2,_0x46bde2,_0x408db6,_0x283992){if(_0x46bde2['busy']){writeLog(_0x4c44f2,_0x46bde2,'BUSY');return![];}if(!_0x46bde2['online']){writeLog(_0x4c44f2,_0x46bde2,_0x2573('0x1d'));return![];}if(_0x46bde2[_0x408db6+_0x2573('0x1e')]){writeLog(_0x4c44f2,_0x46bde2,_0x2573('0x1f'));return![];}if(_0x283992&&_0x46bde2[_0x2573('0x20')](_0x408db6+'Capacity')&&_0x46bde2[_0x2573('0x20')](_0x408db6+_0x2573('0x21'))){if(_0x46bde2[_0x408db6+_0x2573('0x22')]>0x0&&_0x46bde2[_0x408db6+_0x2573('0x21')]>=_0x46bde2[_0x408db6+_0x2573('0x22')]){writeLog(_0x4c44f2,_0x46bde2,_0x408db6['toUpperCase']()+_0x2573('0x23'));return![];}}return!![];};exports[_0x2573('0x24')]=function(_0x30dda3,_0x51195c,_0x26f8a6,_0x2dd6ee,_0x3434d7){return sendNotification(!![],_0x30dda3,_0x51195c,_0x26f8a6,_0x2dd6ee,_0x3434d7);};exports[_0x2573('0x25')]=function(_0x19c055,_0x818cd7,_0x2a9a2b,_0x4512e2,_0x31e57e){return sendNotification(![],_0x19c055,_0x818cd7,_0x2a9a2b,_0x4512e2,_0x31e57e);};exports['checkWaitingNotifications']=function(_0x7e68a3,_0x2d03f9,_0x437c32){var _0x1f8620=_0x2d03f9[_0x2573('0x26')][_0x2573('0x27')];if(!_0x1f8620&&_0x437c32){_0x1f8620=_0x437c32['id'];}var _0x183a89=_['some'](_0x7e68a3[_0x2d03f9[_0x2573('0x28')]+_0x2573('0x29')],function(_0x249902){var _0x1182af=_[_0x2573('0x2a')](_0x2d03f9['channel'])+_0x2573('0x2b');return _0x249902[_0x1182af]===_0x2d03f9[_0x2573('0x26')]['id'];});if(!_0x183a89&&_0x1f8620&&_0x7e68a3[_0x2573('0x2c')][_0x1f8620]){_0x183a89=_[_0x2573('0x2d')](_0x7e68a3[_0x2573('0x2c')][_0x1f8620][_0x2d03f9[_0x2573('0x28')]+_0x2573('0x2e')],function(_0x5872d5){return _0x5872d5['id']===_0x2d03f9['interaction']['id'];});}return _0x183a89;};exports[_0x2573('0x2f')]=function(_0x3f9699,_0x314aab,_0x5ce45c,_0x13d6a0){if(_0x5ce45c&&_0x5ce45c['id']&&_0x3f9699[_0x2573('0x2c')]&&_0x3f9699[_0x2573('0x2c')][_0x5ce45c['id']]){_0x3f9699[_0x2573('0x2c')][_0x5ce45c['id']][_0x13d6a0+_0x2573('0x2e')][_0x314aab[_0x2573('0x14')]['id']]={'id':_0x314aab[_0x2573('0x26')]['id']};}};exports['removeWaitingNotification']=function(_0x3cd1b6,_0x9ce98a,_0x5cdd4c,_0x19098b){if(_0x5cdd4c&&_0x5cdd4c['id']&&_0x3cd1b6[_0x2573('0x2c')]&&_0x3cd1b6[_0x2573('0x2c')][_0x5cdd4c['id']]){delete _0x3cd1b6[_0x2573('0x2c')][_0x5cdd4c['id']][_0x19098b+_0x2573('0x2e')][_0x9ce98a[_0x2573('0x14')]['id']];}};exports[_0x2573('0x30')]=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 b673c8d..b623ad8 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 _0x644d=['../../../../config/logger','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','error','[%s][SYSTEM]\x20%s','map','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','isObject','validate','shelljs','lodash','./utils'];(function(_0x311af0,_0x3d7beb){var _0x150bc6=function(_0x3cb85e){while(--_0x3cb85e){_0x311af0['push'](_0x311af0['shift']());}};_0x150bc6(++_0x3d7beb);}(_0x644d,0xf6));var _0xd644=function(_0x12c280,_0x51dd07){_0x12c280=_0x12c280-0x0;var _0x3638d3=_0x644d[_0x12c280];return _0x3638d3;};'use strict';var schema=require(_0xd644('0x0'));var sh=require(_0xd644('0x1'));var _=require(_0xd644('0x2'));var utils=require(_0xd644('0x3'));var logger=require(_0xd644('0x4'))('routing');var system=schema({'command':{'type':'string','required':!![],'message':_0xd644('0x5')}});exports[_0xd644('0x6')]=function(_0x1426de,_0x5bf298){return function(_0x1c88fe){try{var _0x59f27e={'command':_0x5bf298[0x0]};var _0x15089a=system[_0xd644('0x0')](_0x59f27e,{'typecast':!![]});if(_0x15089a['length']){logger[_0xd644('0x7')](_0xd644('0x8'),_0x1426de,_[_0xd644('0x9')](_0x15089a,_0xd644('0xa'))[_0xd644('0xb')](',\x20'));logger['info'](_0xd644('0xc'),_0x1426de);_0x1c88fe['next']();}else{var _0x3a90ec=this;var _0x30c13c=utils['getMustacheRender'](_0x5bf298[0x0],this);logger[_0xd644('0xd')](_0xd644('0xe'),_0x1426de,_0x30c13c);sh[_0xd644('0xf')](_[_0xd644('0x10')](_0x30c13c),function(_0x2a9f8f,_0x3a1b35){logger[_0xd644('0xd')](_0xd644('0x11'),_0x1426de,_0x2a9f8f);if(_0x2a9f8f==0x0){var _0x558725=_0x3a1b35[_0xd644('0x12')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x5bf298[0x1])||_[_0xd644('0x13')](_0x5bf298[0x1])){logger[_0xd644('0xd')](_0xd644('0x14'),_0x1426de);_0x3a90ec[_0xd644('0x15')][_0x5bf298[0x1]]=_0x558725;}else{logger['info'](_0xd644('0x16'),_0x1426de,_0x5bf298[0x1],_0x558725);_0x3a90ec[_0xd644('0x15')][_0x5bf298[0x1]]=_0x558725;}}_0x1c88fe[_0xd644('0x17')]();});}}catch(_0x471ecf){logger[_0xd644('0x7')]('[%s][SYSTEM]\x20%s',_0x1426de,_[_0xd644('0x18')](_0x471ecf)?JSON['stringify'](_0x471ecf):_0x471ecf);logger[_0xd644('0xd')](_0xd644('0xc'),_0x1426de);_0x1c88fe[_0xd644('0x17')]();}};}; \ No newline at end of file +var _0xfa8d=['stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','map','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','isObject'];(function(_0x44d1b8,_0x3a2cf3){var _0x2b811f=function(_0x1a24f2){while(--_0x1a24f2){_0x44d1b8['push'](_0x44d1b8['shift']());}};_0x2b811f(++_0x3a2cf3);}(_0xfa8d,0x9d));var _0xdfa8=function(_0x508acd,_0x441448){_0x508acd=_0x508acd-0x0;var _0x364271=_0xfa8d[_0x508acd];return _0x364271;};'use strict';var schema=require(_0xdfa8('0x0'));var sh=require(_0xdfa8('0x1'));var _=require(_0xdfa8('0x2'));var utils=require(_0xdfa8('0x3'));var logger=require(_0xdfa8('0x4'))(_0xdfa8('0x5'));var system=schema({'command':{'type':_0xdfa8('0x6'),'required':!![],'message':_0xdfa8('0x7')}});exports[_0xdfa8('0x8')]=function(_0x1e0bd1,_0x3e9b08){return function(_0x124e63){try{var _0x39088d={'command':_0x3e9b08[0x0]};var _0x4add37=system[_0xdfa8('0x0')](_0x39088d,{'typecast':!![]});if(_0x4add37[_0xdfa8('0x9')]){logger[_0xdfa8('0xa')]('[%s][SYSTEM]\x20%s',_0x1e0bd1,_[_0xdfa8('0xb')](_0x4add37,'message')['join'](',\x20'));logger[_0xdfa8('0xc')](_0xdfa8('0xd'),_0x1e0bd1);_0x124e63[_0xdfa8('0xe')]();}else{var _0x27cd6b=this;var _0x4c8c5e=utils[_0xdfa8('0xf')](_0x3e9b08[0x0],this);logger[_0xdfa8('0xc')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x1e0bd1,_0x4c8c5e);sh['exec'](_[_0xdfa8('0x10')](_0x4c8c5e),function(_0x502223,_0x42bf8e){logger['info'](_0xdfa8('0x11'),_0x1e0bd1,_0x502223);if(_0x502223==0x0){var _0x308905=_0x42bf8e[_0xdfa8('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0xdfa8('0x13')](_0x3e9b08[0x1])||_[_0xdfa8('0x14')](_0x3e9b08[0x1])){logger['info'](_0xdfa8('0x15'),_0x1e0bd1);_0x27cd6b['body'][_0x3e9b08[0x1]]=_0x308905;}else{logger[_0xdfa8('0xc')](_0xdfa8('0x16'),_0x1e0bd1,_0x3e9b08[0x1],_0x308905);_0x27cd6b[_0xdfa8('0x17')][_0x3e9b08[0x1]]=_0x308905;}}_0x124e63[_0xdfa8('0xe')]();});}}catch(_0x59399f){logger[_0xdfa8('0xa')]('[%s][SYSTEM]\x20%s',_0x1e0bd1,_[_0xdfa8('0x18')](_0x59399f)?JSON[_0xdfa8('0x19')](_0x59399f):_0x59399f);logger[_0xdfa8('0xc')](_0xdfa8('0xd'),_0x1e0bd1);_0x124e63['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index 5877fbc..c169bd7 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 _0x219a=['../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][TAG]\x20%s','map','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','addTags','interaction','then','error','stringify','finally','next','validate','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction'];(function(_0x3a3818,_0x409bfc){var _0x51fb39=function(_0x30f345){while(--_0x30f345){_0x3a3818['push'](_0x3a3818['shift']());}};_0x51fb39(++_0x409bfc);}(_0x219a,0xb7));var _0xa219=function(_0x565154,_0x189d5e){_0x565154=_0x565154-0x0;var _0x593821=_0x219a[_0x565154];return _0x593821;};'use strict';var schema=require(_0xa219('0x0'));var _=require(_0xa219('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xa219('0x2')),'smsInteraction':require(_0xa219('0x3')),'mailInteraction':require(_0xa219('0x4')),'faxInteraction':require(_0xa219('0x5')),'whatsappInteraction':require(_0xa219('0x6'))};var logger=require(_0xa219('0x7'))(_0xa219('0x8'));var tag=schema({'tag':{'type':_0xa219('0x9'),'required':!![],'message':_0xa219('0xa')}});exports[_0xa219('0xb')]=function(_0x16f781,_0x2eb76f,_0x52ed9a,_0x1d70d7){return function(_0x23db2f){try{var _0x4fe470={'tag':_0x2eb76f[0x0]};var _0x5593eb=tag['validate'](_0x4fe470,{'typecast':!![]});if(_0x5593eb[_0xa219('0xc')]){logger['error'](_0xa219('0xd'),_0x16f781,_[_0xa219('0xe')](_0x5593eb,'message')[_0xa219('0xf')](',\x20'));logger[_0xa219('0x10')](_0xa219('0x11'),_0x16f781);_0x23db2f['next']();}else{var _0x3c082f={'ids':[_0x2eb76f[0x0]]};if(rpc[_0x1d70d7[_0xa219('0x12')]+_0xa219('0x13')]){rpc[_0x1d70d7[_0xa219('0x12')]+_0xa219('0x13')][_0xa219('0x14')](_0x1d70d7[_0xa219('0x15')]['id'],_0x3c082f)[_0xa219('0x16')](function(_0x46dec7){logger[_0xa219('0x10')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x16f781,_0x2eb76f[0x1],_0x1d70d7[_0xa219('0x12')],_0x1d70d7[_0xa219('0x15')]['id']);})['catch'](function(_0x3d23cd){logger[_0xa219('0x17')](_0xa219('0xd'),_0x16f781,JSON[_0xa219('0x18')](_0x3d23cd));logger[_0xa219('0x10')](_0xa219('0x11'),_0x16f781);})[_0xa219('0x19')](function(){_0x23db2f[_0xa219('0x1a')]();});}}}catch(_0x265ad9){logger[_0xa219('0x17')](_0xa219('0xd'),_0x16f781,_['isObject'](_0x265ad9)?JSON[_0xa219('0x18')](_0x265ad9):_0x265ad9);logger[_0xa219('0x10')](_0xa219('0x11'),_0x16f781);_0x23db2f[_0xa219('0x1a')]();}};}; \ No newline at end of file +var _0x1511=['[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','Interaction','channel','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','finally','isObject','next','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','error'];(function(_0x579bc0,_0x34c0cc){var _0x379218=function(_0x1afd20){while(--_0x1afd20){_0x579bc0['push'](_0x579bc0['shift']());}};_0x379218(++_0x34c0cc);}(_0x1511,0x144));var _0x1151=function(_0x27324a,_0x3f87a5){_0x27324a=_0x27324a-0x0;var _0xb26b19=_0x1511[_0x27324a];return _0xb26b19;};'use strict';var schema=require('validate');var _=require(_0x1151('0x0'));var rpc={'chatInteraction':require(_0x1151('0x1')),'openchannelInteraction':require(_0x1151('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x1151('0x3')),'faxInteraction':require(_0x1151('0x4')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x1151('0x5'))(_0x1151('0x6'));var tag=schema({'tag':{'type':_0x1151('0x7'),'required':!![],'message':_0x1151('0x8')}});exports[_0x1151('0x9')]=function(_0x2252fa,_0x183197,_0x2e81fa,_0x4d7126){return function(_0x2eb2ff){try{var _0x1be995={'tag':_0x183197[0x0]};var _0x4e21c3=tag[_0x1151('0xa')](_0x1be995,{'typecast':!![]});if(_0x4e21c3['length']){logger[_0x1151('0xb')](_0x1151('0xc'),_0x2252fa,_[_0x1151('0xd')](_0x4e21c3,_0x1151('0xe'))[_0x1151('0xf')](',\x20'));logger[_0x1151('0x10')](_0x1151('0x11'),_0x2252fa);_0x2eb2ff['next']();}else{var _0x1421e3={'ids':[_0x183197[0x0]]};if(rpc[_0x4d7126['channel']+_0x1151('0x12')]){rpc[_0x4d7126[_0x1151('0x13')]+_0x1151('0x12')][_0x1151('0x14')](_0x4d7126[_0x1151('0x15')]['id'],_0x1421e3)[_0x1151('0x16')](function(_0x49d21c){logger['info'](_0x1151('0x17'),_0x2252fa,_0x183197[0x1],_0x4d7126['channel'],_0x4d7126['interaction']['id']);})['catch'](function(_0xe05106){logger[_0x1151('0xb')](_0x1151('0xc'),_0x2252fa,JSON[_0x1151('0x18')](_0xe05106));logger[_0x1151('0x10')](_0x1151('0x11'),_0x2252fa);})[_0x1151('0x19')](function(){_0x2eb2ff['next']();});}}}catch(_0x495aee){logger[_0x1151('0xb')](_0x1151('0xc'),_0x2252fa,_[_0x1151('0x1a')](_0x495aee)?JSON[_0x1151('0x18')](_0x495aee):_0x495aee);logger[_0x1151('0x10')](_0x1151('0x11'),_0x2252fa);_0x2eb2ff[_0x1151('0x1b')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index 5be4dce..f925566 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5df1=['replace','\x20-\x20','includes','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','login','params','utf8','POST','application/json-rpc','then','parse','result','logged','channelId=','&serviceId=','stringify','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','isObject','next','routing','lodash','consequence'];(function(_0x4fe71a,_0xaf0c26){var _0x17d5fa=function(_0xeacb4d){while(--_0xeacb4d){_0x4fe71a['push'](_0x4fe71a['shift']());}};_0x17d5fa(++_0xaf0c26);}(_0x5df1,0xa2));var _0x15df=function(_0x53e98c,_0x56a15a){_0x53e98c=_0x53e98c-0x0;var _0x2cd1f0=_0x5df1[_0x53e98c];return _0x2cd1f0;};'use strict';var rp=require('request-promise');var logger=require('../../../../config/logger')(_0x15df('0x0'));var _=require(_0x15df('0x1'));var arr=[];exports[_0x15df('0x2')]=function(_0x4c5ab0,_0x581ae8){return function(_0xa9d431){var _0x2076b2=_0x581ae8[0xa];var _0x53bbca=_0x581ae8[0xb];var _0x2d59c7=_0x581ae8[0xc];var _0x22ab27=_0x581ae8[0xd];var _0x31ee5e=_0x581ae8[0xe];var _0x139b86=_0x581ae8[0xf][_0x15df('0x3')](/\n/g,_0x15df('0x4'));var _0x3dac98=_0x581ae8[0x10][_0x15df('0x3')](/\n/g,'\x20');if(!arr[_0x15df('0x5')](_0x53bbca)){arr[_0x15df('0x6')](_0x53bbca);var _0x389942=_0x581ae8[0x3];var _0x57b158=_0x581ae8[0x4];var _0x38e034=_0x581ae8[0x1];var _0x5ec10f=_0x581ae8[0x0];var _0x35c04d={};_0x35c04d[_0x15df('0x7')]=_0x581ae8[0x8]+_0x15df('0x8')+_0x2d59c7+'|'+_0x2076b2+'|'+_0x22ab27+'|'+_0x53bbca+'|'+_0x31ee5e;_0x35c04d[_0x15df('0x9')]=_0x581ae8[0x7]+_0x15df('0x8')+_0x2d59c7+'|'+_0x2076b2+'|'+_0x22ab27+'|'+_0x53bbca+'|'+_0x31ee5e+'|'+_0x139b86+'|'+_0x3dac98;_0x35c04d[_0x15df('0xa')]=_0x581ae8[0x9];var _0x705705={};_0x705705[_0x15df('0xb')]=_0x15df('0xc');_0x705705['method']=_0x15df('0xd');var _0x507d80=[];_0x507d80[_0x15df('0x6')](_0x581ae8[0x2]);_0x507d80['push'](_0x581ae8[0x5]);_0x507d80[_0x15df('0x6')](_0x581ae8[0x6]);_0x705705[_0x15df('0xe')]=_0x507d80;_0x705705['id']=0x1;var _0x4f9b39=JSON['stringify'](_0x705705);var _0xcd7eba={'encoding':_0x15df('0xf'),'method':_0x15df('0x10'),'timeout':0x2710,'url':_0x389942,'headers':{'Content-Type':_0x15df('0x11')},'body':_0x4f9b39};return rp(_0xcd7eba)[_0x15df('0x12')](function(_0x25b619){const _0x288f69=JSON[_0x15df('0x13')](_0x25b619);if(!_0x288f69[_0x15df('0x14')][_0x15df('0x15')]){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0xcbd73f=_0x53bbca;var _0x40e1c8=_0x15df('0x16')+_0x38e034+_0x15df('0x17')+_0x5ec10f+'&sessionId='+_0xcbd73f+'&data='+JSON[_0x15df('0x18')](_0x35c04d);var _0x5becaf=_0x57b158+'?'+_0x40e1c8;return rp(_0x5becaf);})[_0x15df('0x12')](function(_0x46c6dc){logger[_0x15df('0x19')](_0x15df('0x1a'),_0x4c5ab0,_0x46c6dc);_0xa9d431[_0x15df('0x1b')]();})[_0x15df('0x1c')](function(_0x4069e3){logger[_0x15df('0x1d')](_0x15df('0x1e'),_0x4c5ab0,_[_0x15df('0x1f')](_0x4069e3)?JSON['stringify'](_0x4069e3):_0x4069e3);_0xa9d431['stop']();});}else{logger[_0x15df('0x19')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x4c5ab0);_0xa9d431[_0x15df('0x20')]();}};}; \ No newline at end of file +var _0x0723=['../../../../config/logger','routing','lodash','consequence','\x20-\x20','replace','includes','push','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','method','login','stringify','POST','application/json-rpc','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','error','[%s][TVOX]\x20%s','isObject','stop','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next'];(function(_0x115eb3,_0x507044){var _0x329f10=function(_0x1c2d8c){while(--_0x1c2d8c){_0x115eb3['push'](_0x115eb3['shift']());}};_0x329f10(++_0x507044);}(_0x0723,0x1dc));var _0x3072=function(_0x3668f8,_0x15ec30){_0x3668f8=_0x3668f8-0x0;var _0x3569e0=_0x0723[_0x3668f8];return _0x3569e0;};'use strict';var rp=require('request-promise');var logger=require(_0x3072('0x0'))(_0x3072('0x1'));var _=require(_0x3072('0x2'));var arr=[];exports[_0x3072('0x3')]=function(_0x5bb3ef,_0x5f359a){return function(_0x3c36bf){var _0x440754=_0x5f359a[0xa];var _0x488afb=_0x5f359a[0xb];var _0x27febb=_0x5f359a[0xc];var _0x109526=_0x5f359a[0xd];var _0x261ac0=_0x5f359a[0xe];var _0x31d3cf=_0x5f359a[0xf]['replace'](/\n/g,_0x3072('0x4'));var _0x205b77=_0x5f359a[0x10][_0x3072('0x5')](/\n/g,'\x20');if(!arr[_0x3072('0x6')](_0x488afb)){arr[_0x3072('0x7')](_0x488afb);var _0x25e85b=_0x5f359a[0x3];var _0xa51f6f=_0x5f359a[0x4];var _0x47703b=_0x5f359a[0x1];var _0x3bc9dc=_0x5f359a[0x0];var _0x5d2bb8={};_0x5d2bb8[_0x3072('0x8')]=_0x5f359a[0x8]+_0x3072('0x9')+_0x27febb+'|'+_0x440754+'|'+_0x109526+'|'+_0x488afb+'|'+_0x261ac0;_0x5d2bb8[_0x3072('0xa')]=_0x5f359a[0x7]+'?params='+_0x27febb+'|'+_0x440754+'|'+_0x109526+'|'+_0x488afb+'|'+_0x261ac0+'|'+_0x31d3cf+'|'+_0x205b77;_0x5d2bb8[_0x3072('0xb')]=_0x5f359a[0x9];var _0x30834c={};_0x30834c[_0x3072('0xc')]=_0x3072('0xd');_0x30834c[_0x3072('0xe')]=_0x3072('0xf');var _0xe2f5fd=[];_0xe2f5fd[_0x3072('0x7')](_0x5f359a[0x2]);_0xe2f5fd[_0x3072('0x7')](_0x5f359a[0x5]);_0xe2f5fd[_0x3072('0x7')](_0x5f359a[0x6]);_0x30834c['params']=_0xe2f5fd;_0x30834c['id']=0x1;var _0x1f8972=JSON[_0x3072('0x10')](_0x30834c);var _0x1e9346={'encoding':'utf8','method':_0x3072('0x11'),'timeout':0x2710,'url':_0x25e85b,'headers':{'Content-Type':_0x3072('0x12')},'body':_0x1f8972};return rp(_0x1e9346)['then'](function(_0xad74f9){const _0x3a8f43=JSON[_0x3072('0x13')](_0xad74f9);if(!_0x3a8f43[_0x3072('0x14')]['logged']){throw new Error(_0x3072('0x15'));}var _0xeaab4f=_0x488afb;var _0x33e5cb=_0x3072('0x16')+_0x47703b+_0x3072('0x17')+_0x3bc9dc+_0x3072('0x18')+_0xeaab4f+_0x3072('0x19')+JSON[_0x3072('0x10')](_0x5d2bb8);var _0x28f394=_0xa51f6f+'?'+_0x33e5cb;return rp(_0x28f394);})['then'](function(_0x233fbe){logger[_0x3072('0x1a')](_0x3072('0x1b'),_0x5bb3ef,_0x233fbe);_0x3c36bf['stop']();})['catch'](function(_0x35e958){logger[_0x3072('0x1c')](_0x3072('0x1d'),_0x5bb3ef,_[_0x3072('0x1e')](_0x35e958)?JSON['stringify'](_0x35e958):_0x35e958);_0x3c36bf[_0x3072('0x1f')]();});}else{logger['info'](_0x3072('0x20'),_0x5bb3ef);_0x3c36bf[_0x3072('0x21')]();}};}; \ 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 bb7f8ff..c4a2639 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['merge','body','account','list','exports','render'];(function(_0x529e4b,_0x24403b){var _0x3a2d30=function(_0x18599d){while(--_0x18599d){_0x529e4b['push'](_0x529e4b['shift']());}};_0x3a2d30(++_0x24403b);}(_0x9c44,0x178));var _0x49c4=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x9c44[_0x24061a];return _0x82054e;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x641af0,_0x11b2be){var _0x319d81=function(_0x1306a2){while(--_0x1306a2){_0x641af0['push'](_0x641af0['shift']());}};_0x319d81(++_0x11b2be);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index cf1a573..d3a3dd5 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 _0xc429=['./applications/','priority','info','Push\x20new\x20rule','on\x20interval','intervals','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','Applications\x20executed','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','stack','agent','agents','busy','busyQueue','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','end','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','listen','log','RPC\x20listening\x20on\x20port:','lodash','path','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','channel','message','interaction','transfer','applications','join','app','autoreply','appdata','split','mail','push','slice','length','dialogflowv2','amazonlex','tag','TagId','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','condition'];(function(_0x58d580,_0x4c8f86){var _0x3c096c=function(_0x1385cf){while(--_0x1385cf){_0x58d580['push'](_0x58d580['shift']());}};_0x3c096c(++_0x4c8f86);}(_0xc429,0x1ba));var _0x9c42=function(_0x44bcb0,_0x235aa9){_0x44bcb0=_0x44bcb0-0x0;var _0xfaf881=_0xc429[_0x44bcb0];return _0xfaf881;};'use strict';var _=require(_0x9c42('0x0'));var util=require('util');var path=require(_0x9c42('0x1'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require('bluebird');var utils=require(_0x9c42('0x2'));var sUtils=require(_0x9c42('0x3'));var logger=require(_0x9c42('0x4'))(_0x9c42('0x5'));var rpc={'openchannelQueueReport':require(_0x9c42('0x6')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x9c42('0x7')),'faxQueueReport':require(_0x9c42('0x8')),'whatsappQueueReport':require(_0x9c42('0x9'))};var RuleEngine=require(_0x9c42('0xa'));function getId(_0xcf40c2,_0x28d46e,_0x61614){return util[_0x9c42('0xb')](_0x9c42('0xc'),_0xcf40c2,_0x28d46e||0x0,_0x61614||0x0);}function getIntervals(_0x2541a2,_0xfe2de6){var _0x4fef1e=[];if(!_[_0x9c42('0xd')](_0xfe2de6['IntervalId'])&&!_[_0x9c42('0xd')](_0x2541a2[_0xfe2de6['IntervalId']])&&!_[_0x9c42('0xd')](_0x2541a2[_0xfe2de6[_0x9c42('0xe')]]['Intervals'])){_0x4fef1e=_[_0x9c42('0xf')](_0x2541a2[_0xfe2de6[_0x9c42('0xe')]][_0x9c42('0x10')],'interval');}else if(!_[_0x9c42('0xd')](_0xfe2de6[_0x9c42('0x11')])){_0x4fef1e=[_0xfe2de6[_0x9c42('0x11')]];}return _0x4fef1e;}exports['listen']=function(_0x3af9ae){_0x3af9ae['rules']={};return new BPromise(function(_0x50cd2e,_0x44e8ff){var _0x1d4208={'Start':function(_0x5ec8b1){var _0x1f484b=this;return new Promise(function(_0xc6a1f3,_0x33f8ca){if(_0x5ec8b1){try{var _0x1a2fba=[];var _0x43507e=getId(_0x5ec8b1[_0x9c42('0x12')],_0x5ec8b1[_0x9c42('0x13')]?_0x5ec8b1['message']['id']:0x0,_0x5ec8b1[_0x9c42('0x14')]?_0x5ec8b1['interaction']['id']:0x0);var _0x47f2fc=sUtils['checkWaitingNotifications'](_0x3af9ae,_0x5ec8b1);if(_0x5ec8b1[_0x9c42('0x15')]||!_0x47f2fc&&_0x5ec8b1[_0x9c42('0x16')]&&_['isArray'](_0x5ec8b1[_0x9c42('0x16')])&&_0x5ec8b1[_0x9c42('0x16')]['length']){for(var _0xc9b5c7=0x0;_0xc9b5c7<_0x5ec8b1[_0x9c42('0x16')]['length'];_0xc9b5c7+=0x1){var _0x4f686f=_0x5ec8b1[_0x9c42('0x16')][_0xc9b5c7];if(fs['existsSync'](path[_0x9c42('0x17')](__dirname,_0x9c42('0x16'),_0x4f686f[_0x9c42('0x18')]+'.js'))){var _0x467ec3=[];switch(_0x4f686f[_0x9c42('0x18')]['toLowerCase']()){case _0x9c42('0x19'):var _0x544d2d=_0x4f686f[_0x9c42('0x1a')][_0x9c42('0x1b')](',');if(_0x5ec8b1[_0x9c42('0x12')]===_0x9c42('0x1c')){_0x467ec3[_0x9c42('0x1d')](_0x544d2d[0x0]);_0x467ec3[_0x9c42('0x1d')](_0x544d2d[0x1]);_0x467ec3[_0x9c42('0x1d')](_0x544d2d[_0x9c42('0x1e')](0x2,_0x544d2d['length'])['join'](','));}else{_0x467ec3[_0x9c42('0x1d')](_0x544d2d[0x0]);_0x467ec3[_0x9c42('0x1d')](_0x544d2d[_0x9c42('0x1e')](0x1,_0x544d2d[_0x9c42('0x1f')])[_0x9c42('0x17')](','));}break;case'dialogflow':var _0x17f3f7=_0x4f686f['appdata'][_0x9c42('0x1b')](',');_0x467ec3[_0x9c42('0x1d')](_0x17f3f7[0x0]);_0x467ec3[_0x9c42('0x1d')](_0x17f3f7[0x1]);_0x467ec3[_0x9c42('0x1d')](_0x17f3f7['slice'](0x2,_0x17f3f7[_0x9c42('0x1f')])[_0x9c42('0x17')](','));break;case _0x9c42('0x20'):var _0x19abff=_0x4f686f[_0x9c42('0x1a')][_0x9c42('0x1b')](',');_0x467ec3[_0x9c42('0x1d')](_0x19abff[0x0]);_0x467ec3[_0x9c42('0x1d')](_0x19abff[0x1]);_0x467ec3[_0x9c42('0x1d')](_0x19abff[0x2]);_0x467ec3['push'](_0x19abff[0x3]);_0x467ec3['push'](_0x19abff[_0x9c42('0x1e')](0x4,_0x19abff[_0x9c42('0x1f')])[_0x9c42('0x17')](','));break;case _0x9c42('0x21'):var _0x153d5c=_0x4f686f['appdata'][_0x9c42('0x1b')](',');_0x467ec3[_0x9c42('0x1d')](_0x153d5c[0x0]);_0x467ec3[_0x9c42('0x1d')](_0x153d5c[0x1]);_0x467ec3[_0x9c42('0x1d')](_0x153d5c[0x2]);_0x467ec3[_0x9c42('0x1d')](_0x153d5c[0x3]);_0x467ec3[_0x9c42('0x1d')](_0x153d5c[_0x9c42('0x1e')](0x4,_0x153d5c[_0x9c42('0x1f')])[_0x9c42('0x17')](','));break;case _0x9c42('0x13'):_0x467ec3[_0x9c42('0x1d')](_0x4f686f[_0x9c42('0x1a')]);break;case _0x9c42('0x22'):_0x467ec3[_0x9c42('0x1d')](_0x4f686f[_0x9c42('0x23')]);_0x467ec3[_0x9c42('0x1d')](_0x4f686f[_0x9c42('0x1a')]);break;case'tvox':var _0x206ba2=utils[_0x9c42('0x24')](_0x5ec8b1[_0x9c42('0x25')][_0x9c42('0x26')],_0x5ec8b1);var _0x1373b8=_0x4f686f['appdata'][_0x9c42('0x1b')](',');_0x467ec3[_0x9c42('0x1d')](_0x1373b8[0x0]);_0x467ec3['push'](_0x1373b8[0x1]);_0x467ec3[_0x9c42('0x1d')](_0x1373b8[0x2]);_0x467ec3[_0x9c42('0x1d')](_0x1373b8[0x3]);_0x467ec3['push'](_0x1373b8[0x4]);_0x467ec3[_0x9c42('0x1d')](_0x1373b8[0x5]);_0x467ec3[_0x9c42('0x1d')](_0x1373b8[0x6]);_0x467ec3[_0x9c42('0x1d')](_0x1373b8[0x7]);_0x467ec3['push'](_0x1373b8[0x8]);_0x467ec3['push'](_0x1373b8[0x9]);_0x467ec3[_0x9c42('0x1d')](_0x1373b8[0xa]);_0x467ec3['push'](_0x5ec8b1[_0x9c42('0x14')]['id']);_0x467ec3[_0x9c42('0x1d')](_0x5ec8b1[_0x9c42('0x13')]['id']);_0x467ec3[_0x9c42('0x1d')](_0x4f686f[_0x9c42('0x27')]);_0x467ec3[_0x9c42('0x1d')](_0x5ec8b1[_0x9c42('0x14')][_0x9c42('0x28')]);_0x467ec3[_0x9c42('0x1d')](_0x5ec8b1[_0x9c42('0x29')][_0x9c42('0x29')]);_0x467ec3['push'](_0x206ba2);break;default:_0x467ec3=_[_0x9c42('0xd')](_0x4f686f[_0x9c42('0x1a')])?[]:_0x4f686f[_0x9c42('0x1a')][_0x9c42('0x1b')](',');}var _0x55c322={'id':util[_0x9c42('0xb')]('%s:%s:%s',_0x43507e,_0x4f686f['id'],_0x4f686f[_0x9c42('0x18')]),'condition':require('./interval')[_0x9c42('0x2a')](_0x43507e,getIntervals(_0x3af9ae['intervals'],_0x4f686f),_0x3af9ae),'consequence':require(_0x9c42('0x2b')+_0x4f686f['app'])['consequence'](_0x43507e,_0x467ec3,_0x3af9ae,_0x5ec8b1),'p':_0x4f686f[_0x9c42('0x2c')]||0x0};logger[_0x9c42('0x2d')](_0x9c42('0x2e'),_0x55c322['id'],_0x9c42('0x2f'),getIntervals(_0x3af9ae[_0x9c42('0x30')],_0x4f686f)[_0x9c42('0x17')]('\x20|\x20'));_0x1a2fba[_0x9c42('0x1d')](_0x55c322);}else{logger[_0x9c42('0x31')](_0x9c42('0x32'),path[_0x9c42('0x17')](__dirname,_0x9c42('0x16'),_0x4f686f[_0x9c42('0x18')]+'.js'));}}_0x3af9ae[_0x9c42('0x33')][_0x43507e]=new RuleEngine(_0x1a2fba);_0x3af9ae[_0x9c42('0x33')][_0x43507e][_0x9c42('0x34')](_0x5ec8b1,function(_0xa918e6){logger['info'](_0x9c42('0x35'),JSON[_0x9c42('0x36')](_0xa918e6[_0x9c42('0x37')]));if(_0x3af9ae['rules'][_0x43507e]){_0x3af9ae[_0x9c42('0x33')][_0x43507e][_0x9c42('0x38')](_0x9c42('0x39'));}});return _0xc6a1f3({'code':0xc8,'message':_0x5ec8b1});}else{if(_0x47f2fc){logger[_0x9c42('0x2d')](util[_0x9c42('0xb')](_0x9c42('0x3a'),_0x43507e));}else{logger[_0x9c42('0x2d')]('No\x20applications\x20to\x20execute');}return _0xc6a1f3({'code':0xc8,'message':_0x5ec8b1});}}catch(_0x32415d){logger[_0x9c42('0x31')](_0x32415d[_0x9c42('0x3b')]);return _0x33f8ca(_0x1f484b[_0x9c42('0x31')](0x1f4,_0x32415d));}}return _0x33f8ca('routing\x20is\x20empty');});},'AcceptMessage':function(_0x1b46f4){var _0x49c18e=this;return new Promise(function(_0x55bdb3,_0x4ec82a){if(_0x1b46f4[_0x9c42('0x3c')]&&_0x1b46f4['agent']['id']){if(_0x3af9ae[_0x9c42('0x3d')][_0x1b46f4[_0x9c42('0x3c')]['id']]){_0x3af9ae[_0x9c42('0x3d')][_0x1b46f4['agent']['id']][_0x9c42('0x3e')]=![];_0x3af9ae[_0x9c42('0x3d')][_0x1b46f4[_0x9c42('0x3c')]['id']][_0x9c42('0x3f')]=undefined;}}if(_0x1b46f4['message']&&_0x1b46f4[_0x9c42('0x13')]['id']){try{var _0x586b62=getId(_0x1b46f4['channel'],_0x1b46f4[_0x9c42('0x13')]?_0x1b46f4[_0x9c42('0x13')]['id']:0x0,_0x1b46f4[_0x9c42('0x14')]?_0x1b46f4[_0x9c42('0x14')]['id']:0x0);if(_0x3af9ae[_0x9c42('0x33')][_0x586b62]){_0x3af9ae[_0x9c42('0x33')][_0x586b62][_0x9c42('0x38')]('end');if(rpc[_0x1b46f4['channel']+_0x9c42('0x40')]){rpc[_0x1b46f4[_0x9c42('0x12')]+_0x9c42('0x40')][_0x9c42('0x41')](_0x586b62,{'UserId':_0x1b46f4[_0x9c42('0x13')][_0x9c42('0x42')]})[_0x9c42('0x43')](function(){logger[_0x9c42('0x31')](_0x9c42('0x44'));});}}return _0x55bdb3({'code':0xc8,'message':_0x1b46f4});}catch(_0x523753){logger[_0x9c42('0x31')](_0x523753[_0x9c42('0x3b')]);return _0x4ec82a(_0x49c18e[_0x9c42('0x31')](0x1f4,_0x523753));}}logger[_0x9c42('0x31')](_0x9c42('0x45'));return _0x4ec82a(_0x49c18e[_0x9c42('0x31')](0x1f4,_0x9c42('0x45')));});},'RejectMessage':function(_0x48722c){var _0x5d35e2=this;return new Promise(function(_0x1536b1,_0x45c937){if(_0x48722c['agent']&&_0x48722c[_0x9c42('0x3c')]['id']){try{if(_0x3af9ae[_0x9c42('0x3d')][_0x48722c[_0x9c42('0x3c')]['id']]){_0x3af9ae[_0x9c42('0x3d')][_0x48722c[_0x9c42('0x3c')]['id']][_0x9c42('0x3e')]=![];_0x3af9ae[_0x9c42('0x3d')][_0x48722c[_0x9c42('0x3c')]['id']][_0x9c42('0x3f')]=undefined;}return _0x1536b1({'code':0xc8,'message':_0x48722c});}catch(_0x2dae72){logger['error'](_0x2dae72['stack']);return _0x45c937(_0x5d35e2['error'](0x1f4,_0x2dae72));}}logger['error'](_0x9c42('0x45'));return _0x45c937(_0x5d35e2['error'](0x1f4,_0x9c42('0x45')));});},'AbandonInteraction':function(_0x251eac){var _0x1dda93=this;return new Promise(function(_0x27260a,_0x5e7e27){if(_0x251eac[_0x9c42('0x12')]&&_0x251eac['interaction']&&_0x251eac[_0x9c42('0x14')]['id']){try{var _0xce636e=getId(_0x251eac[_0x9c42('0x12')],_0x251eac[_0x9c42('0x13')]?_0x251eac[_0x9c42('0x13')]['id']:0x0,_0x251eac[_0x9c42('0x14')]?_0x251eac['interaction']['id']:0x0);if(_0x3af9ae['rules'][_0xce636e]){_0x3af9ae[_0x9c42('0x33')][_0xce636e][_0x9c42('0x38')](_0x9c42('0x46'));}return _0x27260a({'code':0xc8,'message':_0x251eac});}catch(_0x3b458c){logger['error'](_0x3b458c[_0x9c42('0x3b')]);return _0x5e7e27(_0x1dda93[_0x9c42('0x31')](0x1f4,_0x3b458c));}}logger['error'](_0x9c42('0x45'));return _0x5e7e27(_0x1dda93['error'](0x1f4,_0x9c42('0x45')));});},'AgentCapacity':function(_0x54754f){var _0x5c25b4=this;return new Promise(function(_0x80367,_0x4890b1){if(_0x3af9ae[_0x9c42('0x3d')]['hasOwnProperty'](_0x54754f['id'])){for(var _0x5e3130 in _0x54754f[_0x9c42('0x47')]){if(_0x54754f[_0x9c42('0x47')][_0x9c42('0x48')](_0x5e3130)){if(_0x3af9ae['agents'][_0x54754f['id']][_0x9c42('0x48')](_0x5e3130+_0x9c42('0x49'))){_0x3af9ae['agents'][_0x54754f['id']][_0x5e3130+_0x9c42('0x49')]=parseInt(_0x54754f[_0x9c42('0x47')][_0x5e3130],0xa);}}}_0x3af9ae[_0x9c42('0x3d')][_0x54754f['id']][_0x9c42('0x4a')]();return _0x80367({'code':0xc8,'message':_0x3af9ae[_0x9c42('0x3d')][_0x54754f['id']]});}else{return _0x4890b1(_0x5c25b4['error'](0x1f4,_0x9c42('0x4b')));}});},'Agents':function(_0x4c9ae5){return new Promise(function(_0x53de3e){var _0x274b0d=_[_0x9c42('0x4c')](_0x3af9ae['agents']);if(_0x4c9ae5&&_0x4c9ae5['id']){var _0x5eb39a=_['find'](_0x274b0d,function(_0x42bf32){return _0x42bf32['id']===_0x4c9ae5['id'];});_0x53de3e(_0x5eb39a);}else{_0x53de3e({'count':_0x274b0d[_0x9c42('0x1f')],'rows':_0x274b0d});}});},'ChatQueues':function(){return new Promise(function(_0x5cb9c2){var _0x141c8e=[];for(var _0x457ac7 in _0x3af9ae[_0x9c42('0x4d')]){if(_0x3af9ae[_0x9c42('0x4d')]['hasOwnProperty'](_0x457ac7)){var _0x4a798a=_0x3af9ae[_0x9c42('0x4d')][_0x457ac7];var _0x32464a={'id':_0x4a798a['id'],'available':_0x4a798a[_0x9c42('0x4e')],'loggedIn':_0x4a798a[_0x9c42('0x4f')],'name':_0x4a798a[_0x9c42('0x50')],'paused':_0x4a798a[_0x9c42('0x51')],'waiting':_0x4a798a[_0x9c42('0x52')]};_0x141c8e[_0x9c42('0x1d')](_0x32464a);}}_0x5cb9c2({'count':_0x141c8e[_0x9c42('0x1f')],'rows':_0x141c8e});});},'MailQueues':function(){return new Promise(function(_0x4a7c97){var _0x204b5a=[];for(var _0xa939fb in _0x3af9ae['mailQueues']){if(_0x3af9ae['mailQueues'][_0x9c42('0x48')](_0xa939fb)){var _0x31b595=_0x3af9ae[_0x9c42('0x53')][_0xa939fb];var _0x11e0bd={'id':_0x31b595['id'],'available':_0x31b595[_0x9c42('0x4e')],'loggedIn':_0x31b595['loggedIn'],'name':_0x31b595[_0x9c42('0x50')],'paused':_0x31b595[_0x9c42('0x51')],'waiting':_0x31b595[_0x9c42('0x52')]};_0x204b5a[_0x9c42('0x1d')](_0x11e0bd);}}_0x4a7c97({'count':_0x204b5a[_0x9c42('0x1f')],'rows':_0x204b5a});});},'OpenchannelQueues':function(){return new Promise(function(_0x52c499){var _0x5f3e19=[];for(var _0x14326e in _0x3af9ae[_0x9c42('0x54')]){if(_0x3af9ae[_0x9c42('0x54')][_0x9c42('0x48')](_0x14326e)){var _0x543dbe=_0x3af9ae['openchannelQueues'][_0x14326e];var _0x520ead={'id':_0x543dbe['id'],'available':_0x543dbe[_0x9c42('0x4e')],'loggedIn':_0x543dbe[_0x9c42('0x4f')],'name':_0x543dbe['name'],'paused':_0x543dbe[_0x9c42('0x51')],'waiting':_0x543dbe['waiting']};_0x5f3e19[_0x9c42('0x1d')](_0x520ead);}}_0x52c499({'count':_0x5f3e19[_0x9c42('0x1f')],'rows':_0x5f3e19});});},'SmsQueues':function(){return new Promise(function(_0x520967){var _0x1ad694=[];for(var _0x442d96 in _0x3af9ae[_0x9c42('0x55')]){if(_0x3af9ae[_0x9c42('0x55')][_0x9c42('0x48')](_0x442d96)){var _0x5bc947=_0x3af9ae[_0x9c42('0x55')][_0x442d96];var _0x31fb35={'id':_0x5bc947['id'],'available':_0x5bc947[_0x9c42('0x4e')],'loggedIn':_0x5bc947[_0x9c42('0x4f')],'name':_0x5bc947['name'],'paused':_0x5bc947[_0x9c42('0x51')],'waiting':_0x5bc947[_0x9c42('0x52')]};_0x1ad694['push'](_0x31fb35);}}_0x520967({'count':_0x1ad694[_0x9c42('0x1f')],'rows':_0x1ad694});});},'FaxQueues':function(){return new Promise(function(_0xd231b8){var _0x4dc6d6=[];for(var _0x3de1e8 in _0x3af9ae[_0x9c42('0x56')]){if(_0x3af9ae['faxQueues'][_0x9c42('0x48')](_0x3de1e8)){var _0x5c890e=_0x3af9ae[_0x9c42('0x56')][_0x3de1e8];var _0x2c8543={'id':_0x5c890e['id'],'available':_0x5c890e[_0x9c42('0x4e')],'loggedIn':_0x5c890e[_0x9c42('0x4f')],'name':_0x5c890e[_0x9c42('0x50')],'paused':_0x5c890e[_0x9c42('0x51')],'waiting':_0x5c890e[_0x9c42('0x52')]};_0x4dc6d6['push'](_0x2c8543);}}_0xd231b8({'count':_0x4dc6d6[_0x9c42('0x1f')],'rows':_0x4dc6d6});});},'WhatsappQueues':function(){return new Promise(function(_0x41b03b){var _0x23e368=[];for(var _0x2a38d5 in _0x3af9ae[_0x9c42('0x57')]){if(_0x3af9ae[_0x9c42('0x57')][_0x9c42('0x48')](_0x2a38d5)){var _0x3c1fbd=_0x3af9ae[_0x9c42('0x57')][_0x2a38d5];var _0xcbe7e0={'id':_0x3c1fbd['id'],'available':_0x3c1fbd[_0x9c42('0x4e')],'loggedIn':_0x3c1fbd[_0x9c42('0x4f')],'name':_0x3c1fbd[_0x9c42('0x50')],'paused':_0x3c1fbd[_0x9c42('0x51')],'waiting':_0x3c1fbd[_0x9c42('0x52')]};_0x23e368[_0x9c42('0x1d')](_0xcbe7e0);}}_0x41b03b({'count':_0x23e368[_0x9c42('0x1f')],'rows':_0x23e368});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x2c90d6){var _0x2f9b21=_['values'](_0x3af9ae[_0x9c42('0x58')]);_0x2c90d6({'count':_0x2f9b21[_0x9c42('0x1f')],'rows':_0x2f9b21});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x4c4271){var _0x200bfd=_[_0x9c42('0x4c')](_0x3af9ae[_0x9c42('0x59')]);_0x4c4271({'count':_0x200bfd[_0x9c42('0x1f')],'rows':_0x200bfd});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x1e8a9a){var _0x5b07f7=_[_0x9c42('0x4c')](_0x3af9ae[_0x9c42('0x5a')]);_0x1e8a9a({'count':_0x5b07f7[_0x9c42('0x1f')],'rows':_0x5b07f7});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x1f82de){var _0x129248=_[_0x9c42('0x4c')](_0x3af9ae['smsQueuesWaitingInteractions']);_0x1f82de({'count':_0x129248[_0x9c42('0x1f')],'rows':_0x129248});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x4dbd3c){var _0x37605d=_[_0x9c42('0x4c')](_0x3af9ae['faxQueuesWaitingInteractions']);_0x4dbd3c({'count':_0x37605d['length'],'rows':_0x37605d});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x5ef470){var _0x56b071=_['values'](_0x3af9ae[_0x9c42('0x5b')]);_0x5ef470({'count':_0x56b071['length'],'rows':_0x56b071});});}};var _0x419a10=jayson[_0x9c42('0x5c')](_0x1d4208)[_0x9c42('0x5d')]();_0x419a10['on'](_0x9c42('0x31'),function(_0x4d5477){logger[_0x9c42('0x31')](JSON[_0x9c42('0x36')](_0x4d5477));return _0x44e8ff(_0x4d5477);});_0x419a10[_0x9c42('0x5e')](0x232c,'127.0.0.1',function(){console[_0x9c42('0x5f')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x50cd2e(_0x9c42('0x60')+0x232c);});});}; \ No newline at end of file +var _0x090a=['openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','map','Intervals','interval','listen','rules','channel','message','interaction','checkWaitingNotifications','transfer','applications','length','app','.js','toLowerCase','autoreply','appdata','split','mail','push','slice','join','dialogflow','dialogflowv2','amazonlex','tag','TagId','getMustacheRender','account','notificationTemplate','ChatWebsiteId','body','%s:%s:%s','condition','intervals','consequence','priority','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','catch','message\x20is\x20empty','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','mailQueuesWaitingInteractions'];(function(_0xfd0d70,_0x4e32d3){var _0x3304eb=function(_0x30c3d4){while(--_0x30c3d4){_0xfd0d70['push'](_0xfd0d70['shift']());}};_0x3304eb(++_0x4e32d3);}(_0x090a,0x133));var _0xa090=function(_0xf1f874,_0x303911){_0xf1f874=_0xf1f874-0x0;var _0x208fc2=_0x090a[_0xf1f874];return _0x208fc2;};'use strict';var _=require(_0xa090('0x0'));var util=require(_0xa090('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0xa090('0x2'));var BPromise=require(_0xa090('0x3'));var utils=require('./applications/utils');var sUtils=require('./applications/strategy/util');var logger=require(_0xa090('0x4'))('routing');var rpc={'openchannelQueueReport':require(_0xa090('0x5')),'mailQueueReport':require(_0xa090('0x6')),'chatQueueReport':require(_0xa090('0x7')),'smsQueueReport':require(_0xa090('0x8')),'faxQueueReport':require(_0xa090('0x9')),'whatsappQueueReport':require(_0xa090('0xa'))};var RuleEngine=require(_0xa090('0xb'));function getId(_0x1bc038,_0x39f0db,_0x9566e1){return util[_0xa090('0xc')](_0xa090('0xd'),_0x1bc038,_0x39f0db||0x0,_0x9566e1||0x0);}function getIntervals(_0x134f90,_0xf64ab9){var _0x4359a9=[];if(!_[_0xa090('0xe')](_0xf64ab9['IntervalId'])&&!_[_0xa090('0xe')](_0x134f90[_0xf64ab9['IntervalId']])&&!_[_0xa090('0xe')](_0x134f90[_0xf64ab9[_0xa090('0xf')]]['Intervals'])){_0x4359a9=_[_0xa090('0x10')](_0x134f90[_0xf64ab9[_0xa090('0xf')]][_0xa090('0x11')],_0xa090('0x12'));}else if(!_[_0xa090('0xe')](_0xf64ab9[_0xa090('0x12')])){_0x4359a9=[_0xf64ab9['interval']];}return _0x4359a9;}exports[_0xa090('0x13')]=function(_0x26d9c7){_0x26d9c7[_0xa090('0x14')]={};return new BPromise(function(_0x25601e,_0x41f33e){var _0x373680={'Start':function(_0xe1f5c9){var _0x297e21=this;return new Promise(function(_0x1a7314,_0x48c5b2){if(_0xe1f5c9){try{var _0x4da1f3=[];var _0x40b53f=getId(_0xe1f5c9[_0xa090('0x15')],_0xe1f5c9[_0xa090('0x16')]?_0xe1f5c9[_0xa090('0x16')]['id']:0x0,_0xe1f5c9['interaction']?_0xe1f5c9[_0xa090('0x17')]['id']:0x0);var _0x133842=sUtils[_0xa090('0x18')](_0x26d9c7,_0xe1f5c9);if(_0xe1f5c9[_0xa090('0x19')]||!_0x133842&&_0xe1f5c9['applications']&&_['isArray'](_0xe1f5c9[_0xa090('0x1a')])&&_0xe1f5c9[_0xa090('0x1a')][_0xa090('0x1b')]){for(var _0xea9234=0x0;_0xea9234<_0xe1f5c9[_0xa090('0x1a')]['length'];_0xea9234+=0x1){var _0x479a66=_0xe1f5c9[_0xa090('0x1a')][_0xea9234];if(fs['existsSync'](path['join'](__dirname,_0xa090('0x1a'),_0x479a66[_0xa090('0x1c')]+_0xa090('0x1d')))){var _0x17693f=[];switch(_0x479a66[_0xa090('0x1c')][_0xa090('0x1e')]()){case _0xa090('0x1f'):var _0xc60bfd=_0x479a66[_0xa090('0x20')][_0xa090('0x21')](',');if(_0xe1f5c9[_0xa090('0x15')]===_0xa090('0x22')){_0x17693f[_0xa090('0x23')](_0xc60bfd[0x0]);_0x17693f['push'](_0xc60bfd[0x1]);_0x17693f['push'](_0xc60bfd[_0xa090('0x24')](0x2,_0xc60bfd[_0xa090('0x1b')])[_0xa090('0x25')](','));}else{_0x17693f[_0xa090('0x23')](_0xc60bfd[0x0]);_0x17693f[_0xa090('0x23')](_0xc60bfd[_0xa090('0x24')](0x1,_0xc60bfd[_0xa090('0x1b')])[_0xa090('0x25')](','));}break;case _0xa090('0x26'):var _0x91d866=_0x479a66[_0xa090('0x20')][_0xa090('0x21')](',');_0x17693f[_0xa090('0x23')](_0x91d866[0x0]);_0x17693f[_0xa090('0x23')](_0x91d866[0x1]);_0x17693f['push'](_0x91d866[_0xa090('0x24')](0x2,_0x91d866[_0xa090('0x1b')])[_0xa090('0x25')](','));break;case _0xa090('0x27'):var _0x39a0c0=_0x479a66[_0xa090('0x20')][_0xa090('0x21')](',');_0x17693f[_0xa090('0x23')](_0x39a0c0[0x0]);_0x17693f[_0xa090('0x23')](_0x39a0c0[0x1]);_0x17693f[_0xa090('0x23')](_0x39a0c0[0x2]);_0x17693f['push'](_0x39a0c0[0x3]);_0x17693f['push'](_0x39a0c0[_0xa090('0x24')](0x4,_0x39a0c0[_0xa090('0x1b')])[_0xa090('0x25')](','));break;case _0xa090('0x28'):var _0x32768=_0x479a66[_0xa090('0x20')][_0xa090('0x21')](',');_0x17693f[_0xa090('0x23')](_0x32768[0x0]);_0x17693f[_0xa090('0x23')](_0x32768[0x1]);_0x17693f[_0xa090('0x23')](_0x32768[0x2]);_0x17693f[_0xa090('0x23')](_0x32768[0x3]);_0x17693f[_0xa090('0x23')](_0x32768[_0xa090('0x24')](0x4,_0x32768['length'])[_0xa090('0x25')](','));break;case'message':_0x17693f[_0xa090('0x23')](_0x479a66[_0xa090('0x20')]);break;case _0xa090('0x29'):_0x17693f['push'](_0x479a66[_0xa090('0x2a')]);_0x17693f['push'](_0x479a66[_0xa090('0x20')]);break;case'tvox':var _0x50491f=utils[_0xa090('0x2b')](_0xe1f5c9[_0xa090('0x2c')][_0xa090('0x2d')],_0xe1f5c9);var _0x5ad490=_0x479a66[_0xa090('0x20')]['split'](',');_0x17693f[_0xa090('0x23')](_0x5ad490[0x0]);_0x17693f[_0xa090('0x23')](_0x5ad490[0x1]);_0x17693f[_0xa090('0x23')](_0x5ad490[0x2]);_0x17693f[_0xa090('0x23')](_0x5ad490[0x3]);_0x17693f[_0xa090('0x23')](_0x5ad490[0x4]);_0x17693f[_0xa090('0x23')](_0x5ad490[0x5]);_0x17693f[_0xa090('0x23')](_0x5ad490[0x6]);_0x17693f[_0xa090('0x23')](_0x5ad490[0x7]);_0x17693f[_0xa090('0x23')](_0x5ad490[0x8]);_0x17693f[_0xa090('0x23')](_0x5ad490[0x9]);_0x17693f[_0xa090('0x23')](_0x5ad490[0xa]);_0x17693f[_0xa090('0x23')](_0xe1f5c9[_0xa090('0x17')]['id']);_0x17693f['push'](_0xe1f5c9[_0xa090('0x16')]['id']);_0x17693f[_0xa090('0x23')](_0x479a66[_0xa090('0x2e')]);_0x17693f[_0xa090('0x23')](_0xe1f5c9['interaction']['ContactId']);_0x17693f[_0xa090('0x23')](_0xe1f5c9[_0xa090('0x2f')]['body']);_0x17693f[_0xa090('0x23')](_0x50491f);break;default:_0x17693f=_[_0xa090('0xe')](_0x479a66[_0xa090('0x20')])?[]:_0x479a66['appdata']['split'](',');}var _0x24ad93={'id':util[_0xa090('0xc')](_0xa090('0x30'),_0x40b53f,_0x479a66['id'],_0x479a66[_0xa090('0x1c')]),'condition':require('./interval')[_0xa090('0x31')](_0x40b53f,getIntervals(_0x26d9c7[_0xa090('0x32')],_0x479a66),_0x26d9c7),'consequence':require('./applications/'+_0x479a66[_0xa090('0x1c')])[_0xa090('0x33')](_0x40b53f,_0x17693f,_0x26d9c7,_0xe1f5c9),'p':_0x479a66[_0xa090('0x34')]||0x0};logger['info'](_0xa090('0x35'),_0x24ad93['id'],_0xa090('0x36'),getIntervals(_0x26d9c7['intervals'],_0x479a66)[_0xa090('0x25')](_0xa090('0x37')));_0x4da1f3[_0xa090('0x23')](_0x24ad93);}else{logger[_0xa090('0x38')](_0xa090('0x39'),path[_0xa090('0x25')](__dirname,_0xa090('0x1a'),_0x479a66['app']+'.js'));}}_0x26d9c7[_0xa090('0x14')][_0x40b53f]=new RuleEngine(_0x4da1f3);_0x26d9c7[_0xa090('0x14')][_0x40b53f][_0xa090('0x3a')](_0xe1f5c9,function(_0x6c7b84){logger[_0xa090('0x3b')]('Applications\x20executed',JSON[_0xa090('0x3c')](_0x6c7b84[_0xa090('0x3d')]));if(_0x26d9c7[_0xa090('0x14')][_0x40b53f]){_0x26d9c7['rules'][_0x40b53f][_0xa090('0x3e')](_0xa090('0x3f'));}});return _0x1a7314({'code':0xc8,'message':_0xe1f5c9});}else{if(_0x133842){logger[_0xa090('0x3b')](util[_0xa090('0xc')](_0xa090('0x40'),_0x40b53f));}else{logger['info'](_0xa090('0x41'));}return _0x1a7314({'code':0xc8,'message':_0xe1f5c9});}}catch(_0x18c0e1){logger[_0xa090('0x38')](_0x18c0e1[_0xa090('0x42')]);return _0x48c5b2(_0x297e21[_0xa090('0x38')](0x1f4,_0x18c0e1));}}return _0x48c5b2(_0xa090('0x43'));});},'AcceptMessage':function(_0x10059a){var _0xa2928e=this;return new Promise(function(_0x2bfcf1,_0x51a660){if(_0x10059a[_0xa090('0x44')]&&_0x10059a['agent']['id']){if(_0x26d9c7[_0xa090('0x45')][_0x10059a[_0xa090('0x44')]['id']]){_0x26d9c7[_0xa090('0x45')][_0x10059a['agent']['id']][_0xa090('0x46')]=![];_0x26d9c7[_0xa090('0x45')][_0x10059a[_0xa090('0x44')]['id']][_0xa090('0x47')]=undefined;}}if(_0x10059a['message']&&_0x10059a[_0xa090('0x16')]['id']){try{var _0x2377bc=getId(_0x10059a[_0xa090('0x15')],_0x10059a[_0xa090('0x16')]?_0x10059a['message']['id']:0x0,_0x10059a[_0xa090('0x17')]?_0x10059a[_0xa090('0x17')]['id']:0x0);if(_0x26d9c7[_0xa090('0x14')][_0x2377bc]){_0x26d9c7['rules'][_0x2377bc][_0xa090('0x3e')](_0xa090('0x48'));if(rpc[_0x10059a[_0xa090('0x15')]+_0xa090('0x49')]){rpc[_0x10059a[_0xa090('0x15')]+_0xa090('0x49')]['update'](_0x2377bc,{'UserId':_0x10059a[_0xa090('0x16')]['UserId']})[_0xa090('0x4a')](function(){logger['error']('error\x20update\x20queue\x20report');});}}return _0x2bfcf1({'code':0xc8,'message':_0x10059a});}catch(_0x4625b3){logger[_0xa090('0x38')](_0x4625b3[_0xa090('0x42')]);return _0x51a660(_0xa2928e[_0xa090('0x38')](0x1f4,_0x4625b3));}}logger[_0xa090('0x38')](_0xa090('0x4b'));return _0x51a660(_0xa2928e[_0xa090('0x38')](0x1f4,_0xa090('0x4b')));});},'RejectMessage':function(_0x368deb){var _0x42dec5=this;return new Promise(function(_0x28b032,_0x458abd){if(_0x368deb[_0xa090('0x44')]&&_0x368deb[_0xa090('0x44')]['id']){try{if(_0x26d9c7[_0xa090('0x45')][_0x368deb[_0xa090('0x44')]['id']]){_0x26d9c7[_0xa090('0x45')][_0x368deb['agent']['id']]['busy']=![];_0x26d9c7[_0xa090('0x45')][_0x368deb[_0xa090('0x44')]['id']]['busyQueue']=undefined;}return _0x28b032({'code':0xc8,'message':_0x368deb});}catch(_0x10047e){logger['error'](_0x10047e[_0xa090('0x42')]);return _0x458abd(_0x42dec5[_0xa090('0x38')](0x1f4,_0x10047e));}}logger[_0xa090('0x38')](_0xa090('0x4b'));return _0x458abd(_0x42dec5['error'](0x1f4,_0xa090('0x4b')));});},'AbandonInteraction':function(_0x16e48b){var _0x8404d0=this;return new Promise(function(_0x50431e,_0x135614){if(_0x16e48b[_0xa090('0x15')]&&_0x16e48b['interaction']&&_0x16e48b[_0xa090('0x17')]['id']){try{var _0x3d6e54=getId(_0x16e48b[_0xa090('0x15')],_0x16e48b['message']?_0x16e48b[_0xa090('0x16')]['id']:0x0,_0x16e48b['interaction']?_0x16e48b[_0xa090('0x17')]['id']:0x0);if(_0x26d9c7[_0xa090('0x14')][_0x3d6e54]){_0x26d9c7[_0xa090('0x14')][_0x3d6e54][_0xa090('0x3e')]('end');}return _0x50431e({'code':0xc8,'message':_0x16e48b});}catch(_0x3a42e3){logger['error'](_0x3a42e3['stack']);return _0x135614(_0x8404d0[_0xa090('0x38')](0x1f4,_0x3a42e3));}}logger[_0xa090('0x38')](_0xa090('0x4b'));return _0x135614(_0x8404d0[_0xa090('0x38')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x467676){var _0x5e99b0=this;return new Promise(function(_0x4753bf,_0x33071e){if(_0x26d9c7[_0xa090('0x45')]['hasOwnProperty'](_0x467676['id'])){for(var _0x356d82 in _0x467676[_0xa090('0x4c')]){if(_0x467676[_0xa090('0x4c')]['hasOwnProperty'](_0x356d82)){if(_0x26d9c7[_0xa090('0x45')][_0x467676['id']][_0xa090('0x4d')](_0x356d82+'CurrentCapacity')){_0x26d9c7['agents'][_0x467676['id']][_0x356d82+_0xa090('0x4e')]=parseInt(_0x467676[_0xa090('0x4c')][_0x356d82],0xa);}}}_0x26d9c7['agents'][_0x467676['id']][_0xa090('0x4f')]();return _0x4753bf({'code':0xc8,'message':_0x26d9c7[_0xa090('0x45')][_0x467676['id']]});}else{return _0x33071e(_0x5e99b0['error'](0x1f4,_0xa090('0x50')));}});},'Agents':function(_0x5dbd37){return new Promise(function(_0x82e3be){var _0x84aeb9=_[_0xa090('0x51')](_0x26d9c7['agents']);if(_0x5dbd37&&_0x5dbd37['id']){var _0x120ea8=_['find'](_0x84aeb9,function(_0x330b42){return _0x330b42['id']===_0x5dbd37['id'];});_0x82e3be(_0x120ea8);}else{_0x82e3be({'count':_0x84aeb9[_0xa090('0x1b')],'rows':_0x84aeb9});}});},'ChatQueues':function(){return new Promise(function(_0x32c19f){var _0x445b49=[];for(var _0x9c462e in _0x26d9c7['chatQueues']){if(_0x26d9c7[_0xa090('0x52')][_0xa090('0x4d')](_0x9c462e)){var _0x348c8c=_0x26d9c7[_0xa090('0x52')][_0x9c462e];var _0x163576={'id':_0x348c8c['id'],'available':_0x348c8c[_0xa090('0x53')],'loggedIn':_0x348c8c[_0xa090('0x54')],'name':_0x348c8c[_0xa090('0x55')],'paused':_0x348c8c[_0xa090('0x56')],'waiting':_0x348c8c[_0xa090('0x57')]};_0x445b49[_0xa090('0x23')](_0x163576);}}_0x32c19f({'count':_0x445b49['length'],'rows':_0x445b49});});},'MailQueues':function(){return new Promise(function(_0x54a0cb){var _0x266d27=[];for(var _0x4b987f in _0x26d9c7[_0xa090('0x58')]){if(_0x26d9c7[_0xa090('0x58')][_0xa090('0x4d')](_0x4b987f)){var _0x30d3bd=_0x26d9c7[_0xa090('0x58')][_0x4b987f];var _0x283d00={'id':_0x30d3bd['id'],'available':_0x30d3bd[_0xa090('0x53')],'loggedIn':_0x30d3bd[_0xa090('0x54')],'name':_0x30d3bd[_0xa090('0x55')],'paused':_0x30d3bd['paused'],'waiting':_0x30d3bd[_0xa090('0x57')]};_0x266d27[_0xa090('0x23')](_0x283d00);}}_0x54a0cb({'count':_0x266d27['length'],'rows':_0x266d27});});},'OpenchannelQueues':function(){return new Promise(function(_0x2dd80e){var _0x48f35a=[];for(var _0xf33693 in _0x26d9c7[_0xa090('0x59')]){if(_0x26d9c7[_0xa090('0x59')][_0xa090('0x4d')](_0xf33693)){var _0x425cb8=_0x26d9c7['openchannelQueues'][_0xf33693];var _0x331e4e={'id':_0x425cb8['id'],'available':_0x425cb8[_0xa090('0x53')],'loggedIn':_0x425cb8[_0xa090('0x54')],'name':_0x425cb8[_0xa090('0x55')],'paused':_0x425cb8[_0xa090('0x56')],'waiting':_0x425cb8[_0xa090('0x57')]};_0x48f35a[_0xa090('0x23')](_0x331e4e);}}_0x2dd80e({'count':_0x48f35a['length'],'rows':_0x48f35a});});},'SmsQueues':function(){return new Promise(function(_0x9bd6a6){var _0x33114f=[];for(var _0x560eda in _0x26d9c7['smsQueues']){if(_0x26d9c7[_0xa090('0x5a')]['hasOwnProperty'](_0x560eda)){var _0x1442d1=_0x26d9c7[_0xa090('0x5a')][_0x560eda];var _0x4b846e={'id':_0x1442d1['id'],'available':_0x1442d1['available'],'loggedIn':_0x1442d1['loggedIn'],'name':_0x1442d1[_0xa090('0x55')],'paused':_0x1442d1[_0xa090('0x56')],'waiting':_0x1442d1[_0xa090('0x57')]};_0x33114f[_0xa090('0x23')](_0x4b846e);}}_0x9bd6a6({'count':_0x33114f[_0xa090('0x1b')],'rows':_0x33114f});});},'FaxQueues':function(){return new Promise(function(_0x4b4154){var _0x1f81fb=[];for(var _0x211c20 in _0x26d9c7[_0xa090('0x5b')]){if(_0x26d9c7['faxQueues']['hasOwnProperty'](_0x211c20)){var _0x16c56b=_0x26d9c7['faxQueues'][_0x211c20];var _0x1ab7af={'id':_0x16c56b['id'],'available':_0x16c56b[_0xa090('0x53')],'loggedIn':_0x16c56b['loggedIn'],'name':_0x16c56b['name'],'paused':_0x16c56b[_0xa090('0x56')],'waiting':_0x16c56b[_0xa090('0x57')]};_0x1f81fb['push'](_0x1ab7af);}}_0x4b4154({'count':_0x1f81fb[_0xa090('0x1b')],'rows':_0x1f81fb});});},'WhatsappQueues':function(){return new Promise(function(_0x48039c){var _0x542955=[];for(var _0x415023 in _0x26d9c7['whatsappQueues']){if(_0x26d9c7['whatsappQueues'][_0xa090('0x4d')](_0x415023)){var _0x26f5d1=_0x26d9c7['whatsappQueues'][_0x415023];var _0x504cb3={'id':_0x26f5d1['id'],'available':_0x26f5d1[_0xa090('0x53')],'loggedIn':_0x26f5d1[_0xa090('0x54')],'name':_0x26f5d1[_0xa090('0x55')],'paused':_0x26f5d1[_0xa090('0x56')],'waiting':_0x26f5d1[_0xa090('0x57')]};_0x542955[_0xa090('0x23')](_0x504cb3);}}_0x48039c({'count':_0x542955[_0xa090('0x1b')],'rows':_0x542955});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0xbd5419){var _0x177075=_[_0xa090('0x51')](_0x26d9c7['chatQueuesWaitingInteractions']);_0xbd5419({'count':_0x177075[_0xa090('0x1b')],'rows':_0x177075});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x1b9ef0){var _0x12a046=_[_0xa090('0x51')](_0x26d9c7[_0xa090('0x5c')]);_0x1b9ef0({'count':_0x12a046[_0xa090('0x1b')],'rows':_0x12a046});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x30ffec){var _0x23c801=_[_0xa090('0x51')](_0x26d9c7[_0xa090('0x5d')]);_0x30ffec({'count':_0x23c801['length'],'rows':_0x23c801});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0xab440){var _0x51f912=_[_0xa090('0x51')](_0x26d9c7['smsQueuesWaitingInteractions']);_0xab440({'count':_0x51f912['length'],'rows':_0x51f912});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x5c6c3d){var _0x274199=_[_0xa090('0x51')](_0x26d9c7[_0xa090('0x5e')]);_0x5c6c3d({'count':_0x274199[_0xa090('0x1b')],'rows':_0x274199});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x68f8e5){var _0x68d701=_[_0xa090('0x51')](_0x26d9c7['whatsappQueuesWaitingInteractions']);_0x68f8e5({'count':_0x68d701['length'],'rows':_0x68d701});});}};var _0x313106=jayson[_0xa090('0x5f')](_0x373680)[_0xa090('0x60')]();_0x313106['on'](_0xa090('0x38'),function(_0xac0904){logger[_0xa090('0x38')](JSON['stringify'](_0xac0904));return _0x41f33e(_0xac0904);});_0x313106[_0xa090('0x13')](0x232c,_0xa090('0x61'),function(){console['log'](_0xa090('0x62'),0x232c);return _0x25601e(_0xa090('0x63')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index a2162c7..37f33a7 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 _0xdfb5=['rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','format','iftime\x20%s','indexOf','[%s][INTERVAL]\x20%s','all','join','\x20|\x20','when','[%s][INTERVAL]\x20%s\x20%s','stack','bluebird','lodash','../../../config/logger','client','http','then','error','message','result','catch','condition'];(function(_0x1b3837,_0x103941){var _0x2c90fd=function(_0x462d96){while(--_0x462d96){_0x1b3837['push'](_0x1b3837['shift']());}};_0x2c90fd(++_0x103941);}(_0xdfb5,0x1db));var _0x5dfb=function(_0x11f763,_0x3464bd){_0x11f763=_0x11f763-0x0;var _0x25eb10=_0xdfb5[_0x11f763];return _0x25eb10;};'use strict';var util=require('util');var BPromise=require(_0x5dfb('0x0'));var jayson=require('jayson/promise');var _=require(_0x5dfb('0x1'));var logger=require(_0x5dfb('0x2'))('routing');var client=jayson[_0x5dfb('0x3')][_0x5dfb('0x4')]({'port':0x232a});function request(_0x267fbc,_0x52114a){return new BPromise(function(_0x1bb43f,_0x4c9420){return client['request'](_0x267fbc,_0x52114a)[_0x5dfb('0x5')](function(_0x9bdf37){if(_0x9bdf37[_0x5dfb('0x6')]){return _0x4c9420(_0x9bdf37[_0x5dfb('0x6')][_0x5dfb('0x7')]);}else{return _0x1bb43f(_0x9bdf37[_0x5dfb('0x8')]);}})[_0x5dfb('0x9')](function(_0x5b52e1){return _0x4c9420(_0x5b52e1);});});}exports[_0x5dfb('0xa')]=function(_0x1a1303,_0x7b9204,_0x17448b){return function(_0x44ed0d){if(_0x17448b[_0x5dfb('0xb')]&&!_0x17448b[_0x5dfb('0xb')][_0x1a1303]){logger[_0x5dfb('0xc')](_0x5dfb('0xd'),_0x1a1303);return _0x44ed0d[_0x5dfb('0xe')]();}var _0xb419f8=[];for(var _0x39c5a3=0x0;_0x39c5a3<_0x7b9204[_0x5dfb('0xf')];_0x39c5a3+=0x1){_0xb419f8[_0x5dfb('0x10')](request('Command',{'command':util[_0x5dfb('0x11')](_0x5dfb('0x12'),_0x7b9204[_0x39c5a3])})[_0x5dfb('0x5')](function(_0x38cda3){return _0x38cda3&&_0x38cda3['message']&&_0x38cda3[_0x5dfb('0x7')][_0x5dfb('0x13')]('true')>=0x0?!![]:![];})[_0x5dfb('0x9')](function(){logger[_0x5dfb('0x6')](_0x5dfb('0x14'),_0x1a1303,_0x7b9204[_0x39c5a3]);}));}BPromise[_0x5dfb('0x15')](_0xb419f8)['then'](function(_0x151ddb){var _0x349ff8=_['some'](_0x151ddb);logger[_0x5dfb('0xc')]('[%s][INTERVAL]\x20%s\x20%s',_0x1a1303,_0x7b9204[_0x5dfb('0x16')](_0x5dfb('0x17')),_0x349ff8);_0x44ed0d[_0x5dfb('0x18')](_0x349ff8);})[_0x5dfb('0x9')](function(_0xf69478){logger[_0x5dfb('0x6')](_0x5dfb('0x19'),_0x1a1303,_0x7b9204[_0x5dfb('0x16')](_0x5dfb('0x17')),_0xf69478[_0x5dfb('0x1a')]);_0x44ed0d['stop']();});};}; \ No newline at end of file +var _0xa39a=['[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','stack','util','jayson/promise','../../../config/logger','routing','client','request','then','error','message','result','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','format','iftime\x20%s','indexOf','true'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa39a,0x1c8));var _0xaa39=function(_0x51b77f,_0x4a28dd){_0x51b77f=_0x51b77f-0x0;var _0x1ee7b6=_0xa39a[_0x51b77f];return _0x1ee7b6;};'use strict';var util=require(_0xaa39('0x0'));var BPromise=require('bluebird');var jayson=require(_0xaa39('0x1'));var _=require('lodash');var logger=require(_0xaa39('0x2'))(_0xaa39('0x3'));var client=jayson[_0xaa39('0x4')]['http']({'port':0x232a});function request(_0x1ec976,_0x333822){return new BPromise(function(_0x3f8e76,_0x560560){return client[_0xaa39('0x5')](_0x1ec976,_0x333822)[_0xaa39('0x6')](function(_0x40ce06){if(_0x40ce06[_0xaa39('0x7')]){return _0x560560(_0x40ce06[_0xaa39('0x7')][_0xaa39('0x8')]);}else{return _0x3f8e76(_0x40ce06[_0xaa39('0x9')]);}})[_0xaa39('0xa')](function(_0xbfb616){return _0x560560(_0xbfb616);});});}exports[_0xaa39('0xb')]=function(_0x5685f6,_0x499f56,_0x1130f9){return function(_0x3ef505){if(_0x1130f9[_0xaa39('0xc')]&&!_0x1130f9[_0xaa39('0xc')][_0x5685f6]){logger['info'](_0xaa39('0xd'),_0x5685f6);return _0x3ef505[_0xaa39('0xe')]();}var _0x1748bf=[];for(var _0x25dc9e=0x0;_0x25dc9e<_0x499f56['length'];_0x25dc9e+=0x1){_0x1748bf['push'](request('Command',{'command':util[_0xaa39('0xf')](_0xaa39('0x10'),_0x499f56[_0x25dc9e])})[_0xaa39('0x6')](function(_0x5b3c6f){return _0x5b3c6f&&_0x5b3c6f[_0xaa39('0x8')]&&_0x5b3c6f[_0xaa39('0x8')][_0xaa39('0x11')](_0xaa39('0x12'))>=0x0?!![]:![];})[_0xaa39('0xa')](function(){logger[_0xaa39('0x7')](_0xaa39('0x13'),_0x5685f6,_0x499f56[_0x25dc9e]);}));}BPromise['all'](_0x1748bf)[_0xaa39('0x6')](function(_0x23daa0){var _0x11f56=_[_0xaa39('0x14')](_0x23daa0);logger['info'](_0xaa39('0x15'),_0x5685f6,_0x499f56[_0xaa39('0x16')]('\x20|\x20'),_0x11f56);_0x3ef505['when'](_0x11f56);})[_0xaa39('0xa')](function(_0x4b05c1){logger[_0xaa39('0x7')](_0xaa39('0x15'),_0x5685f6,_0x499f56['join'](_0xaa39('0x17')),_0x4b05c1[_0xaa39('0x18')]);_0x3ef505[_0xaa39('0xe')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 5a979f3..4d604b1 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 _0xd8b0=['indexOf','splice','agent','lodash','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','interface','calleridnum','connectedlinenum','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','CreateVoiceAgentReport','request','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','lastevent','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','holdtime','talktime','queuecallerabandon','forIn','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','now','reason','abandoned','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','ringtime','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','[%s][agents][agentconnect]','diffTime','agentcompleteAt','agentconnectAt','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','transferuniqueid','attendedtransfer','origtransfereruniqueid','secondtransfereruniqueid','transferexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','secondtransfererexten','transfertargetuniqueid','[%s][agents][attendedtransfer]','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s'];(function(_0x1eb368,_0x25839d){var _0x46db89=function(_0x27266b){while(--_0x27266b){_0x1eb368['push'](_0x1eb368['shift']());}};_0x46db89(++_0x25839d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x585166,_0x4b72b0){utils[_0x0d8b('0x2')](util[_0x0d8b('0x3')](_0x0d8b('0x4'),_0x585166[_0x0d8b('0x5')],_0x585166[_0x0d8b('0x6')],_0x585166['queue'],_0x585166['membername'],_0x585166[_0x0d8b('0x7')],_0x585166[_0x0d8b('0x8')],_0x585166[_0x0d8b('0x9')],_0x585166['lastevent']));if(_0x585166[_0x0d8b('0xa')]){utils[_0x0d8b('0xb')](_0x585166['queue'])[_0x0d8b('0xc')](function(_0x348e65){if(_0x348e65){_0x585166[_0x0d8b('0xd')]=_0x348e65[_0x0d8b('0xd')];_0x585166[_0x0d8b('0xe')]=_0x585166[_0x0d8b('0xf')]?_0x348e65[_0x0d8b('0x10')]:![];_0x585166[_0x0d8b('0x11')]=_0x585166['agentacw']?_0x348e65[_0x0d8b('0x12')]:0x0;}utils['request'](_0x0d8b('0x13'),_0x585166);});}else{utils[_0x0d8b('0x14')](_0x0d8b('0x13'),_0x585166);}if(_0x4b72b0){delete transfers[_0x585166[_0x0d8b('0x5')]];}else{delete agents[_0x585166[_0x0d8b('0x15')]];}}exports[_0x0d8b('0x16')]=function(_0x15dd0f){try{utils[_0x0d8b('0x17')](util[_0x0d8b('0x3')](_0x0d8b('0x18'),_0x15dd0f[_0x0d8b('0x5')]),_0x15dd0f);agents[_0x15dd0f[_0x0d8b('0x15')]]=_0x15dd0f;agents[_0x15dd0f[_0x0d8b('0x15')]][_0x0d8b('0x19')]=utils['now']();agents[_0x15dd0f[_0x0d8b('0x15')]][_0x0d8b('0x1a')]=_0x0d8b('0x1b');agents[_0x15dd0f[_0x0d8b('0x15')]][_0x0d8b('0x9')]=null;agents[_0x15dd0f['destuniqueid']][_0x0d8b('0x1c')]=null;utils[_0x0d8b('0x2')](util[_0x0d8b('0x3')](_0x0d8b('0x1d'),_0x15dd0f[_0x0d8b('0x5')],agents[_0x15dd0f[_0x0d8b('0x15')]][_0x0d8b('0x1e')],_0x15dd0f[_0x0d8b('0x15')]));}catch(_0x4a15bf){utils[_0x0d8b('0x1f')](util[_0x0d8b('0x3')](_0x0d8b('0x18'),_0x15dd0f[_0x0d8b('0x5')]),_0x4a15bf);}};exports[_0x0d8b('0x20')]=function(_0x5b709c){try{if(!_[_0x0d8b('0x21')](agents[_0x5b709c[_0x0d8b('0x15')]])){utils['debug'](util['format'](_0x0d8b('0x22'),_0x5b709c['uniqueid']),_0x5b709c);utils['info'](util['format'](_0x0d8b('0x23'),_0x5b709c[_0x0d8b('0x5')],agents[_0x5b709c[_0x0d8b('0x15')]][_0x0d8b('0x1e')],_0x5b709c[_0x0d8b('0x15')]));agents[_0x5b709c[_0x0d8b('0x15')]][_0x0d8b('0x20')]=!![];agents[_0x5b709c[_0x0d8b('0x15')]][_0x0d8b('0x24')]=utils['now']();agents[_0x5b709c[_0x0d8b('0x15')]][_0x0d8b('0x1a')]='timeout';agents[_0x5b709c[_0x0d8b('0x15')]]['reason']=_0x0d8b('0x25');agents[_0x5b709c[_0x0d8b('0x15')]][_0x0d8b('0x26')]=_0x5b709c['ringtime']?parseInt(_0x5b709c['ringtime'])/0x3e8:0x0;agents[_0x5b709c[_0x0d8b('0x15')]][_0x0d8b('0x27')]=0x0;unanswered['push'](_0x5b709c[_0x0d8b('0x15')]);}}catch(_0x59aa83){utils[_0x0d8b('0x1f')](util['format'](_0x0d8b('0x22'),_0x5b709c['uniqueid']),_0x59aa83);}};exports[_0x0d8b('0x28')]=function(_0x546bf6){try{_[_0x0d8b('0x29')](agents,function(_0x544735,_0x3c8887){if(_0x544735[_0x0d8b('0x5')]==_0x546bf6[_0x0d8b('0x5')]&&!_['includes'](unanswered,_0x544735['destuniqueid'])){utils['debug'](util[_0x0d8b('0x3')]('[%s][agents][queuecallerabandon]',_0x546bf6[_0x0d8b('0x5')]),_0x546bf6);utils['info'](util['format'](_0x0d8b('0x2a'),_0x546bf6[_0x0d8b('0x5')],_0x544735[_0x0d8b('0x1e')],_0x544735[_0x0d8b('0x15')]));_0x544735[_0x0d8b('0x20')]=!![];_0x544735[_0x0d8b('0x24')]=utils[_0x0d8b('0x2b')]();_0x544735[_0x0d8b('0x1a')]='abandoned';_0x544735[_0x0d8b('0x2c')]=_0x0d8b('0x2d');_0x544735['holdtime']=_0x546bf6[_0x0d8b('0x26')];_0x544735[_0x0d8b('0x27')]=0x0;writeDB(_0x544735);}});}catch(_0x18a905){utils['error'](util[_0x0d8b('0x3')](_0x0d8b('0x2e'),_0x546bf6[_0x0d8b('0x5')]),_0x18a905);}};exports[_0x0d8b('0x2f')]=function(_0x933e01){try{if(agents[_0x933e01['destuniqueid']]){utils[_0x0d8b('0x17')](util[_0x0d8b('0x3')]('[%s][agents][agentconnect]',_0x933e01[_0x0d8b('0x5')]),_0x933e01);utils[_0x0d8b('0x2')](util[_0x0d8b('0x3')](_0x0d8b('0x30'),_0x933e01[_0x0d8b('0x5')],agents[_0x933e01['destuniqueid']]['membername'],_0x933e01[_0x0d8b('0x15')]));agents[_0x933e01['destuniqueid']]['agentconnectAt']=utils[_0x0d8b('0x2b')]();agents[_0x933e01[_0x0d8b('0x15')]][_0x0d8b('0x9')]=_0x933e01[_0x0d8b('0x9')];agents[_0x933e01[_0x0d8b('0x15')]][_0x0d8b('0x1c')]=_0x933e01['connectedlinename'];agents[_0x933e01[_0x0d8b('0x15')]][_0x0d8b('0x26')]=_0x933e01[_0x0d8b('0x31')];agents[_0x933e01[_0x0d8b('0x15')]][_0x0d8b('0x1a')]=_0x0d8b('0x32');_[_0x0d8b('0x29')](agents,function(_0x5c980b,_0x1d06b6){if(_0x5c980b[_0x0d8b('0x15')]!=_0x933e01[_0x0d8b('0x15')]&&_0x5c980b[_0x0d8b('0x5')]==_0x933e01['uniqueid']){_0x5c980b[_0x0d8b('0x27')]=0x0;_0x5c980b['holdtime']=_0x933e01[_0x0d8b('0x31')];_0x5c980b[_0x0d8b('0x20')]=!![];_0x5c980b[_0x0d8b('0x24')]=utils[_0x0d8b('0x2b')]();_0x5c980b[_0x0d8b('0x1a')]=_0x0d8b('0x33');_0x5c980b[_0x0d8b('0x2c')]=_0x0d8b('0x33');_0x5c980b[_0x0d8b('0x34')]=_0x933e01[_0x0d8b('0x15')];_0x5c980b['answeredelsewheremembername']=_0x933e01['membername'];writeDB(_0x5c980b);}});}}catch(_0x576050){utils['error'](util['format'](_0x0d8b('0x35'),_0x933e01[_0x0d8b('0x5')]),_0x576050);}};exports[_0x0d8b('0xf')]=function(_0x5100cf){try{if(!_['isNil'](agents[_0x5100cf[_0x0d8b('0x15')]])){utils[_0x0d8b('0x17')](util[_0x0d8b('0x3')]('[%s][agents][agentcomplete]',_0x5100cf[_0x0d8b('0x5')]),_0x5100cf);utils[_0x0d8b('0x2')](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x5100cf[_0x0d8b('0x5')],agents[_0x5100cf['destuniqueid']][_0x0d8b('0x1e')],_0x5100cf['destuniqueid']));agents[_0x5100cf['destuniqueid']][_0x0d8b('0xf')]=!![];agents[_0x5100cf[_0x0d8b('0x15')]]['agentcompleteAt']=utils['now']();agents[_0x5100cf['destuniqueid']]['talktime']=utils[_0x0d8b('0x36')](agents[_0x5100cf[_0x0d8b('0x15')]][_0x0d8b('0x37')],agents[_0x5100cf['destuniqueid']][_0x0d8b('0x38')]);agents[_0x5100cf[_0x0d8b('0x15')]][_0x0d8b('0x2c')]=_0x5100cf[_0x0d8b('0x2c')];agents[_0x5100cf[_0x0d8b('0x15')]][_0x0d8b('0x1a')]=_0x0d8b('0x39');writeDB(agents[_0x5100cf[_0x0d8b('0x15')]]);}}catch(_0x384a5e){utils[_0x0d8b('0x1f')](util[_0x0d8b('0x3')](_0x0d8b('0x3a'),_0x5100cf[_0x0d8b('0x5')]),_0x384a5e);}};exports[_0x0d8b('0x3b')]=function(_0x570af8){try{if(!_[_0x0d8b('0x21')](agents[_0x570af8[_0x0d8b('0x3c')]])){utils[_0x0d8b('0x17')](util[_0x0d8b('0x3')]('[%s][agents][blindtransfer]',_0x570af8[_0x0d8b('0x5')]),_0x570af8);utils['info'](util['format'](_0x0d8b('0x3d'),_0x570af8[_0x0d8b('0x5')],agents[_0x570af8[_0x0d8b('0x3c')]][_0x0d8b('0x1e')],agents[_0x570af8['transfereruniqueid']][_0x0d8b('0x5')]));agents[_0x570af8[_0x0d8b('0x3c')]][_0x0d8b('0x3e')]=!![];agents[_0x570af8[_0x0d8b('0x3c')]][_0x0d8b('0x3f')]='blind';agents[_0x570af8['transfereruniqueid']]['transferexten']=_0x570af8['extension'];agents[_0x570af8[_0x0d8b('0x3c')]][_0x0d8b('0x40')]=agents[_0x570af8['transfereruniqueid']]['uniqueid'];}}catch(_0x44c5c1){utils[_0x0d8b('0x1f')](util['format']('[%s][agents][blindtransfer]',_0x570af8[_0x0d8b('0x5')]),_0x44c5c1);}};exports[_0x0d8b('0x41')]=function(_0x3cd00a){try{utils[_0x0d8b('0x17')](util[_0x0d8b('0x3')]('[%s][agents][attendedtransfer]',_0x3cd00a[_0x0d8b('0x42')]),_0x3cd00a);if(_0x3cd00a[_0x0d8b('0x42')]==_0x3cd00a['origtransfererlinkedid']){if(!_['isNil'](agents[_0x3cd00a[_0x0d8b('0x43')]])){utils[_0x0d8b('0x2')](util['format']('[%s][agents][attendedtransfer]\x20agent:%s',_0x3cd00a[_0x0d8b('0x42')],agents[_0x3cd00a[_0x0d8b('0x43')]][_0x0d8b('0x1e')]));agents[_0x3cd00a[_0x0d8b('0x43')]]['transfer']=!![];agents[_0x3cd00a[_0x0d8b('0x43')]]['transfertype']='ATTENDED';agents[_0x3cd00a[_0x0d8b('0x43')]][_0x0d8b('0x44')]=_0x3cd00a['origtransfererexten'];agents[_0x3cd00a['secondtransfereruniqueid']][_0x0d8b('0x40')]=_0x3cd00a[_0x0d8b('0x42')];}if(_0x3cd00a[_0x0d8b('0x45')]&&agents[_0x3cd00a[_0x0d8b('0x45')]]){agents[_0x3cd00a[_0x0d8b('0x45')]][_0x0d8b('0x46')]=0x1;transfers[_0x3cd00a[_0x0d8b('0x45')]]=_[_0x0d8b('0x47')](agents[_0x3cd00a['transfereeuniqueid']]);transfers[_0x3cd00a[_0x0d8b('0x45')]][_0x0d8b('0x8')]=agents[_0x3cd00a[_0x0d8b('0x43')]][_0x0d8b('0x8')];transfers[_0x3cd00a[_0x0d8b('0x45')]][_0x0d8b('0x48')]=agents[_0x3cd00a[_0x0d8b('0x43')]][_0x0d8b('0x48')];transfers[_0x3cd00a[_0x0d8b('0x45')]]['agentcalledAt']=utils[_0x0d8b('0x2b')]();transfers[_0x3cd00a[_0x0d8b('0x45')]][_0x0d8b('0x38')]=utils[_0x0d8b('0x2b')]();transfers[_0x3cd00a[_0x0d8b('0x45')]]['holdtime']=0x0;transfers[_0x3cd00a[_0x0d8b('0x45')]][_0x0d8b('0x46')]=0x2;}}else if(_0x3cd00a[_0x0d8b('0x43')]==_0x3cd00a[_0x0d8b('0x49')]){if(!_[_0x0d8b('0x21')](agents[_0x3cd00a['origtransfereruniqueid']])){utils['info'](util[_0x0d8b('0x3')](_0x0d8b('0x4a'),_0x3cd00a[_0x0d8b('0x42')],agents[_0x3cd00a[_0x0d8b('0x42')]]['membername']));agents[_0x3cd00a[_0x0d8b('0x42')]][_0x0d8b('0x3e')]=!![];agents[_0x3cd00a[_0x0d8b('0x42')]]['transfertype']=_0x0d8b('0x4b');agents[_0x3cd00a['origtransfereruniqueid']][_0x0d8b('0x44')]=_0x3cd00a[_0x0d8b('0x4c')];agents[_0x3cd00a[_0x0d8b('0x42')]][_0x0d8b('0x40')]=_0x3cd00a[_0x0d8b('0x43')];}if(_0x3cd00a[_0x0d8b('0x4d')]&&agents[_0x3cd00a['transfertargetuniqueid']]){agents[_0x3cd00a[_0x0d8b('0x4d')]]['agententerreason']=0x1;transfers[_0x3cd00a[_0x0d8b('0x4d')]]=_[_0x0d8b('0x47')](agents[_0x3cd00a[_0x0d8b('0x4d')]]);transfers[_0x3cd00a[_0x0d8b('0x4d')]]['calleridnum']=agents[_0x3cd00a[_0x0d8b('0x42')]][_0x0d8b('0x8')];transfers[_0x3cd00a[_0x0d8b('0x4d')]][_0x0d8b('0x48')]=agents[_0x3cd00a[_0x0d8b('0x42')]][_0x0d8b('0x48')];transfers[_0x3cd00a[_0x0d8b('0x4d')]][_0x0d8b('0x19')]=utils[_0x0d8b('0x2b')]();transfers[_0x3cd00a[_0x0d8b('0x4d')]]['agentconnectAt']=utils['now']();transfers[_0x3cd00a[_0x0d8b('0x4d')]][_0x0d8b('0x26')]=0x0;transfers[_0x3cd00a['transfertargetuniqueid']][_0x0d8b('0x46')]=0x2;}}}catch(_0x5ab1f7){utils['error'](util[_0x0d8b('0x3')](_0x0d8b('0x4e'),_0x3cd00a['origtransfereruniqueid']),_0x5ab1f7);}};exports['hangup']=function(_0x1900e3){try{utils[_0x0d8b('0x17')](util[_0x0d8b('0x3')](_0x0d8b('0x4f'),_0x1900e3[_0x0d8b('0x5')]),_0x1900e3);if(agents[_0x1900e3[_0x0d8b('0x5')]]&&agents[_0x1900e3[_0x0d8b('0x5')]]['reason']===_0x0d8b('0x25')){if(_0x1900e3['cause']==='21'){agents[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x2c')]=_0x0d8b('0x50');agents[_0x1900e3[_0x0d8b('0x5')]]['lastevent']=_0x0d8b('0x50');}utils['info'](util[_0x0d8b('0x3')](_0x0d8b('0x51'),_0x1900e3[_0x0d8b('0x5')],agents[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x1e')],agents[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x2c')],agents[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x1a')]));writeDB(agents[_0x1900e3[_0x0d8b('0x5')]]);var _0x4eb07e=unanswered[_0x0d8b('0x52')](_0x1900e3['uniqueid']);if(_0x4eb07e>-0x1){unanswered[_0x0d8b('0x53')](_0x4eb07e,0x1);}}if(transfers[_0x1900e3[_0x0d8b('0x5')]]){transfers[_0x1900e3['uniqueid']][_0x0d8b('0xf')]=!![];transfers[_0x1900e3['uniqueid']][_0x0d8b('0x37')]=utils[_0x0d8b('0x2b')]();transfers[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x27')]=utils[_0x0d8b('0x36')](transfers[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x37')],transfers[_0x1900e3[_0x0d8b('0x5')]]['agentconnectAt']);transfers[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x2c')]='agent';transfers[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x1a')]=_0x0d8b('0x39');utils[_0x0d8b('0x2')](util[_0x0d8b('0x3')](_0x0d8b('0x51'),_0x1900e3[_0x0d8b('0x5')],transfers[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x1e')],transfers[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x2c')],transfers[_0x1900e3[_0x0d8b('0x5')]]['lastevent']));writeDB(transfers[_0x1900e3[_0x0d8b('0x5')]],!![]);}if(agents[_0x1900e3[_0x0d8b('0x5')]]&&agents[_0x1900e3[_0x0d8b('0x5')]]['agentconnectAt']){agents[_0x1900e3['uniqueid']][_0x0d8b('0xf')]=!![];agents[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x37')]=utils['now']();agents[_0x1900e3['uniqueid']][_0x0d8b('0x27')]=utils[_0x0d8b('0x36')](agents[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x37')],agents[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x38')]);agents[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x2c')]=agents[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x3e')]?_0x0d8b('0x3e'):_0x0d8b('0x54');agents[_0x1900e3[_0x0d8b('0x5')]]['lastevent']=_0x0d8b('0x39');utils[_0x0d8b('0x2')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1900e3[_0x0d8b('0x5')],agents[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x1e')],agents[_0x1900e3[_0x0d8b('0x5')]][_0x0d8b('0x2c')],agents[_0x1900e3[_0x0d8b('0x5')]]['lastevent']));writeDB(agents[_0x1900e3['uniqueid']]);}}catch(_0x581d8e){utils[_0x0d8b('0x1f')](util[_0x0d8b('0x3')](_0x0d8b('0x4f'),_0x1900e3[_0x0d8b('0x5')]),_0x581d8e);}}; \ No newline at end of file +var _0x1be1=['destuniqueid','agentcalled','debug','called','error','[%s][agents][agentcalled]','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','now','lastevent','timeout','ringtime','talktime','push','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswer','abandoned','reason','holdtime','[%s][agents][agentconnect]','agentconnectAt','connectedlinename','connect','answered_elsewhere','answeredelsewheremembername','agentcomplete','diffTime','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','transferuniqueid','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','agentcalledAt','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agentcompleteAt','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','queue','membername','interface','connectedlinenum','getVoiceQueueByName','then','type','agentacw','acw','acwtime','acwTimeout','CreateVoiceAgentReport','request'];(function(_0x407071,_0x491886){var _0x53fcd7=function(_0x146279){while(--_0x146279){_0x407071['push'](_0x407071['shift']());}};_0x53fcd7(++_0x491886);}(_0x1be1,0x192));var _0x11be=function(_0x3e0353,_0x3219ff){_0x3e0353=_0x3e0353-0x0;var _0x3f989a=_0x1be1[_0x3e0353];return _0x3f989a;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x11be('0x0'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x33a55d,_0x5527b3){utils[_0x11be('0x1')](util[_0x11be('0x2')](_0x11be('0x3'),_0x33a55d[_0x11be('0x4')],_0x33a55d['channel'],_0x33a55d[_0x11be('0x5')],_0x33a55d[_0x11be('0x6')],_0x33a55d[_0x11be('0x7')],_0x33a55d['calleridnum'],_0x33a55d[_0x11be('0x8')],_0x33a55d['lastevent']));if(_0x33a55d[_0x11be('0x5')]){utils[_0x11be('0x9')](_0x33a55d[_0x11be('0x5')])[_0x11be('0xa')](function(_0x162eaa){if(_0x162eaa){_0x33a55d['type']=_0x162eaa[_0x11be('0xb')];_0x33a55d[_0x11be('0xc')]=_0x33a55d['agentcomplete']?_0x162eaa[_0x11be('0xd')]:![];_0x33a55d[_0x11be('0xe')]=_0x33a55d[_0x11be('0xc')]?_0x162eaa[_0x11be('0xf')]:0x0;}utils['request'](_0x11be('0x10'),_0x33a55d);});}else{utils[_0x11be('0x11')](_0x11be('0x10'),_0x33a55d);}if(_0x5527b3){delete transfers[_0x33a55d['uniqueid']];}else{delete agents[_0x33a55d[_0x11be('0x12')]];}}exports[_0x11be('0x13')]=function(_0x4ce3ae){try{utils[_0x11be('0x14')](util['format']('[%s][agents][agentcalled]',_0x4ce3ae['uniqueid']),_0x4ce3ae);agents[_0x4ce3ae['destuniqueid']]=_0x4ce3ae;agents[_0x4ce3ae['destuniqueid']]['agentcalledAt']=utils['now']();agents[_0x4ce3ae[_0x11be('0x12')]]['lastevent']=_0x11be('0x15');agents[_0x4ce3ae[_0x11be('0x12')]][_0x11be('0x8')]=null;agents[_0x4ce3ae[_0x11be('0x12')]]['connectedlinename']=null;utils[_0x11be('0x1')](util[_0x11be('0x2')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x4ce3ae[_0x11be('0x4')],agents[_0x4ce3ae[_0x11be('0x12')]][_0x11be('0x6')],_0x4ce3ae['destuniqueid']));}catch(_0x51ba82){utils[_0x11be('0x16')](util[_0x11be('0x2')](_0x11be('0x17'),_0x4ce3ae[_0x11be('0x4')]),_0x51ba82);}};exports['agentringnoanswer']=function(_0x12a5bd){try{if(!_[_0x11be('0x18')](agents[_0x12a5bd[_0x11be('0x12')]])){utils[_0x11be('0x14')](util[_0x11be('0x2')](_0x11be('0x19'),_0x12a5bd[_0x11be('0x4')]),_0x12a5bd);utils[_0x11be('0x1')](util[_0x11be('0x2')](_0x11be('0x1a'),_0x12a5bd['uniqueid'],agents[_0x12a5bd[_0x11be('0x12')]][_0x11be('0x6')],_0x12a5bd[_0x11be('0x12')]));agents[_0x12a5bd['destuniqueid']]['agentringnoanswer']=!![];agents[_0x12a5bd[_0x11be('0x12')]][_0x11be('0x1b')]=utils[_0x11be('0x1c')]();agents[_0x12a5bd['destuniqueid']][_0x11be('0x1d')]='timeout';agents[_0x12a5bd[_0x11be('0x12')]]['reason']=_0x11be('0x1e');agents[_0x12a5bd[_0x11be('0x12')]]['holdtime']=_0x12a5bd[_0x11be('0x1f')]?parseInt(_0x12a5bd[_0x11be('0x1f')])/0x3e8:0x0;agents[_0x12a5bd[_0x11be('0x12')]][_0x11be('0x20')]=0x0;unanswered[_0x11be('0x21')](_0x12a5bd[_0x11be('0x12')]);}}catch(_0xf5a6ac){utils[_0x11be('0x16')](util[_0x11be('0x2')]('[%s][agents][agentringnoanswer]',_0x12a5bd[_0x11be('0x4')]),_0xf5a6ac);}};exports['queuecallerabandon']=function(_0x182f6b){try{_[_0x11be('0x22')](agents,function(_0x510476,_0x584d4c){if(_0x510476[_0x11be('0x4')]==_0x182f6b[_0x11be('0x4')]&&!_[_0x11be('0x23')](unanswered,_0x510476[_0x11be('0x12')])){utils[_0x11be('0x14')](util[_0x11be('0x2')](_0x11be('0x24'),_0x182f6b[_0x11be('0x4')]),_0x182f6b);utils[_0x11be('0x1')](util['format'](_0x11be('0x25'),_0x182f6b[_0x11be('0x4')],_0x510476[_0x11be('0x6')],_0x510476[_0x11be('0x12')]));_0x510476[_0x11be('0x26')]=!![];_0x510476[_0x11be('0x1b')]=utils['now']();_0x510476[_0x11be('0x1d')]=_0x11be('0x27');_0x510476[_0x11be('0x28')]=_0x11be('0x27');_0x510476[_0x11be('0x29')]=_0x182f6b['holdtime'];_0x510476[_0x11be('0x20')]=0x0;writeDB(_0x510476);}});}catch(_0x254be5){utils[_0x11be('0x16')](util['format'](_0x11be('0x24'),_0x182f6b['uniqueid']),_0x254be5);}};exports['agentconnect']=function(_0x4c1f4d){try{if(agents[_0x4c1f4d['destuniqueid']]){utils[_0x11be('0x14')](util[_0x11be('0x2')](_0x11be('0x2a'),_0x4c1f4d['uniqueid']),_0x4c1f4d);utils[_0x11be('0x1')](util[_0x11be('0x2')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x4c1f4d[_0x11be('0x4')],agents[_0x4c1f4d['destuniqueid']][_0x11be('0x6')],_0x4c1f4d['destuniqueid']));agents[_0x4c1f4d[_0x11be('0x12')]][_0x11be('0x2b')]=utils[_0x11be('0x1c')]();agents[_0x4c1f4d[_0x11be('0x12')]]['connectedlinenum']=_0x4c1f4d[_0x11be('0x8')];agents[_0x4c1f4d[_0x11be('0x12')]][_0x11be('0x2c')]=_0x4c1f4d[_0x11be('0x2c')];agents[_0x4c1f4d['destuniqueid']][_0x11be('0x29')]=_0x4c1f4d[_0x11be('0x1f')];agents[_0x4c1f4d[_0x11be('0x12')]][_0x11be('0x1d')]=_0x11be('0x2d');_[_0x11be('0x22')](agents,function(_0x5742d1,_0x5ee47c){if(_0x5742d1[_0x11be('0x12')]!=_0x4c1f4d[_0x11be('0x12')]&&_0x5742d1['uniqueid']==_0x4c1f4d[_0x11be('0x4')]){_0x5742d1[_0x11be('0x20')]=0x0;_0x5742d1['holdtime']=_0x4c1f4d[_0x11be('0x1f')];_0x5742d1['agentringnoanswer']=!![];_0x5742d1[_0x11be('0x1b')]=utils['now']();_0x5742d1[_0x11be('0x1d')]=_0x11be('0x2e');_0x5742d1['reason']=_0x11be('0x2e');_0x5742d1['answeredelsewheredestinationuniqueid']=_0x4c1f4d[_0x11be('0x12')];_0x5742d1[_0x11be('0x2f')]=_0x4c1f4d[_0x11be('0x6')];writeDB(_0x5742d1);}});}}catch(_0x383604){utils[_0x11be('0x16')](util[_0x11be('0x2')](_0x11be('0x2a'),_0x4c1f4d['uniqueid']),_0x383604);}};exports[_0x11be('0x30')]=function(_0x18cddf){try{if(!_[_0x11be('0x18')](agents[_0x18cddf[_0x11be('0x12')]])){utils['debug'](util['format']('[%s][agents][agentcomplete]',_0x18cddf[_0x11be('0x4')]),_0x18cddf);utils['info'](util[_0x11be('0x2')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x18cddf[_0x11be('0x4')],agents[_0x18cddf[_0x11be('0x12')]][_0x11be('0x6')],_0x18cddf[_0x11be('0x12')]));agents[_0x18cddf[_0x11be('0x12')]][_0x11be('0x30')]=!![];agents[_0x18cddf[_0x11be('0x12')]]['agentcompleteAt']=utils[_0x11be('0x1c')]();agents[_0x18cddf['destuniqueid']][_0x11be('0x20')]=utils[_0x11be('0x31')](agents[_0x18cddf[_0x11be('0x12')]]['agentcompleteAt'],agents[_0x18cddf['destuniqueid']]['agentconnectAt']);agents[_0x18cddf[_0x11be('0x12')]][_0x11be('0x28')]=_0x18cddf['reason'];agents[_0x18cddf['destuniqueid']]['lastevent']=_0x11be('0x32');writeDB(agents[_0x18cddf[_0x11be('0x12')]]);}}catch(_0x2cdf2a){utils[_0x11be('0x16')](util[_0x11be('0x2')](_0x11be('0x33'),_0x18cddf[_0x11be('0x4')]),_0x2cdf2a);}};exports[_0x11be('0x34')]=function(_0x2ce110){try{if(!_[_0x11be('0x18')](agents[_0x2ce110[_0x11be('0x35')]])){utils['debug'](util[_0x11be('0x2')](_0x11be('0x36'),_0x2ce110['uniqueid']),_0x2ce110);utils['info'](util['format'](_0x11be('0x37'),_0x2ce110['uniqueid'],agents[_0x2ce110[_0x11be('0x35')]][_0x11be('0x6')],agents[_0x2ce110[_0x11be('0x35')]][_0x11be('0x4')]));agents[_0x2ce110[_0x11be('0x35')]][_0x11be('0x38')]=!![];agents[_0x2ce110[_0x11be('0x35')]][_0x11be('0x39')]=_0x11be('0x3a');agents[_0x2ce110['transfereruniqueid']][_0x11be('0x3b')]=_0x2ce110['extension'];agents[_0x2ce110[_0x11be('0x35')]][_0x11be('0x3c')]=agents[_0x2ce110['transfereruniqueid']][_0x11be('0x4')];}}catch(_0x1164a4){utils[_0x11be('0x16')](util[_0x11be('0x2')](_0x11be('0x36'),_0x2ce110['uniqueid']),_0x1164a4);}};exports['attendedtransfer']=function(_0x46764d){try{utils[_0x11be('0x14')](util['format']('[%s][agents][attendedtransfer]',_0x46764d[_0x11be('0x3d')]),_0x46764d);if(_0x46764d[_0x11be('0x3d')]==_0x46764d[_0x11be('0x3e')]){if(!_['isNil'](agents[_0x46764d['secondtransfereruniqueid']])){utils['info'](util[_0x11be('0x2')](_0x11be('0x3f'),_0x46764d[_0x11be('0x3d')],agents[_0x46764d['secondtransfereruniqueid']]['membername']));agents[_0x46764d[_0x11be('0x40')]][_0x11be('0x38')]=!![];agents[_0x46764d[_0x11be('0x40')]][_0x11be('0x39')]='ATTENDED';agents[_0x46764d[_0x11be('0x40')]]['transferexten']=_0x46764d['origtransfererexten'];agents[_0x46764d['secondtransfereruniqueid']]['transferuniqueid']=_0x46764d[_0x11be('0x3d')];}if(_0x46764d[_0x11be('0x41')]&&agents[_0x46764d[_0x11be('0x41')]]){agents[_0x46764d[_0x11be('0x41')]][_0x11be('0x42')]=0x1;transfers[_0x46764d[_0x11be('0x41')]]=_[_0x11be('0x43')](agents[_0x46764d['transfereeuniqueid']]);transfers[_0x46764d['transfereeuniqueid']][_0x11be('0x44')]=agents[_0x46764d[_0x11be('0x40')]][_0x11be('0x44')];transfers[_0x46764d[_0x11be('0x41')]][_0x11be('0x45')]=agents[_0x46764d[_0x11be('0x40')]][_0x11be('0x45')];transfers[_0x46764d[_0x11be('0x41')]][_0x11be('0x46')]=utils['now']();transfers[_0x46764d[_0x11be('0x41')]][_0x11be('0x2b')]=utils[_0x11be('0x1c')]();transfers[_0x46764d['transfereeuniqueid']][_0x11be('0x29')]=0x0;transfers[_0x46764d[_0x11be('0x41')]]['agententerreason']=0x2;}}else if(_0x46764d['secondtransfereruniqueid']==_0x46764d[_0x11be('0x47')]){if(!_[_0x11be('0x18')](agents[_0x46764d[_0x11be('0x3d')]])){utils[_0x11be('0x1')](util['format'](_0x11be('0x3f'),_0x46764d[_0x11be('0x3d')],agents[_0x46764d[_0x11be('0x3d')]][_0x11be('0x6')]));agents[_0x46764d[_0x11be('0x3d')]][_0x11be('0x38')]=!![];agents[_0x46764d[_0x11be('0x3d')]][_0x11be('0x39')]=_0x11be('0x48');agents[_0x46764d['origtransfereruniqueid']]['transferexten']=_0x46764d[_0x11be('0x49')];agents[_0x46764d[_0x11be('0x3d')]]['transferuniqueid']=_0x46764d[_0x11be('0x40')];}if(_0x46764d[_0x11be('0x4a')]&&agents[_0x46764d[_0x11be('0x4a')]]){agents[_0x46764d[_0x11be('0x4a')]][_0x11be('0x42')]=0x1;transfers[_0x46764d[_0x11be('0x4a')]]=_[_0x11be('0x43')](agents[_0x46764d['transfertargetuniqueid']]);transfers[_0x46764d['transfertargetuniqueid']][_0x11be('0x44')]=agents[_0x46764d[_0x11be('0x3d')]][_0x11be('0x44')];transfers[_0x46764d['transfertargetuniqueid']][_0x11be('0x45')]=agents[_0x46764d[_0x11be('0x3d')]][_0x11be('0x45')];transfers[_0x46764d[_0x11be('0x4a')]][_0x11be('0x46')]=utils[_0x11be('0x1c')]();transfers[_0x46764d[_0x11be('0x4a')]][_0x11be('0x2b')]=utils[_0x11be('0x1c')]();transfers[_0x46764d[_0x11be('0x4a')]][_0x11be('0x29')]=0x0;transfers[_0x46764d[_0x11be('0x4a')]][_0x11be('0x42')]=0x2;}}}catch(_0x464459){utils[_0x11be('0x16')](util[_0x11be('0x2')]('[%s][agents][attendedtransfer]',_0x46764d['origtransfereruniqueid']),_0x464459);}};exports[_0x11be('0x4b')]=function(_0x554aba){try{utils[_0x11be('0x14')](util[_0x11be('0x2')](_0x11be('0x4c'),_0x554aba[_0x11be('0x4')]),_0x554aba);if(agents[_0x554aba[_0x11be('0x4')]]&&agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x28')]===_0x11be('0x1e')){if(_0x554aba[_0x11be('0x4d')]==='21'){agents[_0x554aba['uniqueid']][_0x11be('0x28')]=_0x11be('0x4e');agents[_0x554aba[_0x11be('0x4')]]['lastevent']=_0x11be('0x4e');}utils[_0x11be('0x1')](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x554aba['uniqueid'],agents[_0x554aba['uniqueid']][_0x11be('0x6')],agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x28')],agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x1d')]));writeDB(agents[_0x554aba['uniqueid']]);var _0x2c80b7=unanswered[_0x11be('0x4f')](_0x554aba[_0x11be('0x4')]);if(_0x2c80b7>-0x1){unanswered[_0x11be('0x50')](_0x2c80b7,0x1);}}if(transfers[_0x554aba[_0x11be('0x4')]]){transfers[_0x554aba['uniqueid']][_0x11be('0x30')]=!![];transfers[_0x554aba[_0x11be('0x4')]][_0x11be('0x51')]=utils[_0x11be('0x1c')]();transfers[_0x554aba['uniqueid']][_0x11be('0x20')]=utils[_0x11be('0x31')](transfers[_0x554aba[_0x11be('0x4')]][_0x11be('0x51')],transfers[_0x554aba[_0x11be('0x4')]][_0x11be('0x2b')]);transfers[_0x554aba['uniqueid']][_0x11be('0x28')]=_0x11be('0x52');transfers[_0x554aba[_0x11be('0x4')]][_0x11be('0x1d')]='complete';utils[_0x11be('0x1')](util['format'](_0x11be('0x53'),_0x554aba[_0x11be('0x4')],transfers[_0x554aba[_0x11be('0x4')]][_0x11be('0x6')],transfers[_0x554aba['uniqueid']][_0x11be('0x28')],transfers[_0x554aba[_0x11be('0x4')]]['lastevent']));writeDB(transfers[_0x554aba[_0x11be('0x4')]],!![]);}if(agents[_0x554aba[_0x11be('0x4')]]&&agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x2b')]){agents[_0x554aba['uniqueid']][_0x11be('0x30')]=!![];agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x51')]=utils[_0x11be('0x1c')]();agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x20')]=utils[_0x11be('0x31')](agents[_0x554aba[_0x11be('0x4')]]['agentcompleteAt'],agents[_0x554aba[_0x11be('0x4')]]['agentconnectAt']);agents[_0x554aba['uniqueid']][_0x11be('0x28')]=agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x38')]?_0x11be('0x38'):_0x11be('0x52');agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x1d')]='complete';utils['info'](util[_0x11be('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x554aba['uniqueid'],agents[_0x554aba[_0x11be('0x4')]]['membername'],agents[_0x554aba[_0x11be('0x4')]][_0x11be('0x28')],agents[_0x554aba['uniqueid']][_0x11be('0x1d')]));writeDB(agents[_0x554aba[_0x11be('0x4')]]);}}catch(_0x56d8d7){utils[_0x11be('0x16')](util[_0x11be('0x2')]('[%s][agents][hangup]',_0x554aba[_0x11be('0x4')]),_0x56d8d7);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 0525105..251def1 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 _0xafa4=['hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','starttime','billableseconds','diffTime','attendedtransfer','[%s][calls][attendedtransfer]','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid-preview','xmd-queue','xmcs-queue','lastapplication','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','substring','lastIndexOf','includes','noop','execif','set','lastdata','lodash','util','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','request','uniqueid','newchannel','debug','[%s][calls][newchannel]','context','exten','now','DOCUMENTATION','newstate','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','error','[%s][calls][newstate]'];(function(_0x3a4d0f,_0x43abb8){var _0x4b3eb0=function(_0x1438ba){while(--_0x1438ba){_0x3a4d0f['push'](_0x3a4d0f['shift']());}};_0x4b3eb0(++_0x43abb8);}(_0xafa4,0x11d));var _0x4afa=function(_0x300c89,_0x25fcad){_0x300c89=_0x300c89-0x0;var _0x41762e=_0xafa4[_0x300c89];return _0x41762e;};'use strict';var _=require(_0x4afa('0x0'));var util=require(_0x4afa('0x1'));var utils=require('./utils');var dispositions=[_0x4afa('0x2'),_0x4afa('0x3'),_0x4afa('0x3'),_0x4afa('0x2'),_0x4afa('0x2'),_0x4afa('0x2'),_0x4afa('0x4'),_0x4afa('0x5'),'FAILED',_0x4afa('0x3'),_0x4afa('0x3')];var channels={};function writeDB(_0x483640){utils[_0x4afa('0x6')](util[_0x4afa('0x7')](_0x4afa('0x8'),_0x483640['uniqueid'],_0x483640[_0x4afa('0x9')],_0x483640[_0x4afa('0xa')],_0x483640[_0x4afa('0xb')],_0x483640[_0x4afa('0xc')],_0x483640[_0x4afa('0xd')],_0x483640[_0x4afa('0xe')],_0x483640[_0x4afa('0xf')]));if(_0x483640[_0x4afa('0x10')]){utils[_0x4afa('0x11')](_0x483640[_0x4afa('0x10')])[_0x4afa('0x12')](function(_0x521f3a){if(_0x521f3a){_0x483640['UserId']=_0x521f3a['id'];}utils[_0x4afa('0x13')]('CreateVoiceCallReport',_0x483640);});}else{utils[_0x4afa('0x13')]('CreateVoiceCallReport',_0x483640);}if(channels[_0x483640[_0x4afa('0x14')]]){delete channels[_0x483640[_0x4afa('0x14')]];}}exports[_0x4afa('0x15')]=function(_0x388958){try{utils[_0x4afa('0x16')](util[_0x4afa('0x7')](_0x4afa('0x17'),_0x388958[_0x4afa('0x14')]),_0x388958);if(_0x388958[_0x4afa('0x14')]==_0x388958['linkedid']&&_0x388958[_0x4afa('0x9')]!='OutgoingSpoolFailed'){utils[_0x4afa('0x6')](util['format']('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x388958[_0x4afa('0x14')],_0x388958[_0x4afa('0x18')],_0x388958['exten']));channels[_0x388958[_0x4afa('0x14')]]={'uniqueid':_0x388958[_0x4afa('0x14')],'accountcode':_0x388958[_0x4afa('0x10')],'source':_0x388958['calleridnum'],'destination':_0x388958[_0x4afa('0x19')],'destinationcontext':_0x388958[_0x4afa('0x18')],'channel':_0x388958[_0x4afa('0x9')],'starttime':utils[_0x4afa('0x1a')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x4afa('0x1b')};}}catch(_0xaefc2c){utils['error'](util[_0x4afa('0x7')](_0x4afa('0x17'),_0x388958[_0x4afa('0x14')]),_0xaefc2c);}};exports[_0x4afa('0x1c')]=function(_0x56e41b){try{utils[_0x4afa('0x16')](util[_0x4afa('0x7')]('[%s][calls][newstate]',_0x56e41b[_0x4afa('0x14')]),_0x56e41b);if(!_[_0x4afa('0x1d')](channels[_0x56e41b[_0x4afa('0x14')]])&&_0x56e41b[_0x4afa('0x1e')]==0x6){utils['info'](util['format'](_0x4afa('0x1f'),_0x56e41b[_0x4afa('0x14')],_0x56e41b['context'],_0x56e41b[_0x4afa('0x9')]));if(_[_0x4afa('0x1d')](channels[_0x56e41b['uniqueid']][_0x4afa('0x20')])){channels[_0x56e41b[_0x4afa('0x14')]][_0x4afa('0x20')]=utils['now']();}}else if(!_[_0x4afa('0x1d')](channels[_0x56e41b[_0x4afa('0x21')]])&&_0x56e41b[_0x4afa('0x1e')]==0x6&&_0x56e41b['context']!=_0x4afa('0x22')){utils[_0x4afa('0x6')](util[_0x4afa('0x7')](_0x4afa('0x23'),_0x56e41b[_0x4afa('0x14')],_0x56e41b[_0x4afa('0x21')],_0x56e41b[_0x4afa('0x18')],_0x56e41b['channel']));channels[_0x56e41b[_0x4afa('0x21')]][_0x4afa('0x10')]=_0x56e41b[_0x4afa('0x10')];channels[_0x56e41b[_0x4afa('0x21')]][_0x4afa('0x24')]=_0x56e41b[_0x4afa('0x9')];if(_[_0x4afa('0x1d')](channels[_0x56e41b['linkedid']][_0x4afa('0x25')])){channels[_0x56e41b['linkedid']][_0x4afa('0x25')]=utils['now']();}channels[_0x56e41b[_0x4afa('0x21')]][_0x4afa('0x26')]=dispositions[_[_0x4afa('0x27')](_0x56e41b[_0x4afa('0x1e')])]||_0x4afa('0x4');}}catch(_0x3aad7a){utils[_0x4afa('0x28')](util[_0x4afa('0x7')](_0x4afa('0x29'),_0x56e41b[_0x4afa('0x14')]),_0x3aad7a);}};exports[_0x4afa('0x2a')]=function(_0x2fe9f1){try{if(!_['isNil'](channels[_0x2fe9f1['uniqueid']])){utils[_0x4afa('0x16')](util[_0x4afa('0x7')](_0x4afa('0x2b'),_0x2fe9f1[_0x4afa('0x14')]),_0x2fe9f1);if(_[_0x4afa('0x1d')](channels[_0x2fe9f1[_0x4afa('0x14')]][_0x4afa('0x2c')])){channels[_0x2fe9f1[_0x4afa('0x14')]][_0x4afa('0x2c')]=_0x2fe9f1['calleridname']+'\x20<'+_0x2fe9f1[_0x4afa('0xd')]+'>';}utils[_0x4afa('0x6')](util[_0x4afa('0x7')](_0x4afa('0x2d'),_0x2fe9f1['uniqueid'],channels[_0x2fe9f1[_0x4afa('0x14')]][_0x4afa('0x2c')],_0x2fe9f1[_0x4afa('0x2e')]));channels[_0x2fe9f1[_0x4afa('0x14')]][_0x4afa('0x2f')]=utils[_0x4afa('0x1a')]();channels[_0x2fe9f1[_0x4afa('0x14')]][_0x4afa('0x30')]=utils['diffTime'](channels[_0x2fe9f1[_0x4afa('0x14')]]['endtime'],channels[_0x2fe9f1['uniqueid']][_0x4afa('0x31')]);channels[_0x2fe9f1['uniqueid']][_0x4afa('0x32')]=channels[_0x2fe9f1['uniqueid']][_0x4afa('0x25')]?utils[_0x4afa('0x33')](channels[_0x2fe9f1[_0x4afa('0x14')]][_0x4afa('0x2f')],channels[_0x2fe9f1[_0x4afa('0x14')]][_0x4afa('0x25')]):0x0;writeDB(channels[_0x2fe9f1[_0x4afa('0x14')]]);}}catch(_0x4f0ef2){utils[_0x4afa('0x28')](util[_0x4afa('0x7')](_0x4afa('0x2b'),_0x2fe9f1[_0x4afa('0x14')]),_0x4f0ef2);}};exports[_0x4afa('0x34')]=function(_0x2360f8){try{if(!_[_0x4afa('0x1d')](channels[_0x2360f8['localtwolinkedid']])){utils['debug'](util[_0x4afa('0x7')](_0x4afa('0x35'),_0x2360f8['origtransfereruniqueid']),_0x2360f8);if(channels[_0x2360f8[_0x4afa('0x36')]][_0x4afa('0x9')]==_0x2360f8[_0x4afa('0x37')]){utils[_0x4afa('0x6')](util[_0x4afa('0x7')](_0x4afa('0x38'),_0x2360f8[_0x4afa('0x39')],_0x2360f8['localtwolinkedid'],_0x2360f8[_0x4afa('0x3a')]));channels[_0x2360f8[_0x4afa('0x36')]][_0x4afa('0x24')]=_0x2360f8[_0x4afa('0x3a')];channels[_0x2360f8['localtwolinkedid']][_0x4afa('0x3b')]='_attended';}else if(channels[_0x2360f8[_0x4afa('0x36')]]['channel']=_0x2360f8[_0x4afa('0x3c')]){utils['info'](util[_0x4afa('0x7')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x2360f8[_0x4afa('0x39')],_0x2360f8[_0x4afa('0x36')],_0x2360f8[_0x4afa('0x3d')]));channels[_0x2360f8[_0x4afa('0x36')]][_0x4afa('0x24')]=_0x2360f8['origtransfererchannel'];channels[_0x2360f8[_0x4afa('0x36')]][_0x4afa('0x3b')]=_0x4afa('0x3e');}}}catch(_0x1478c2){utils['error'](util[_0x4afa('0x7')](_0x4afa('0x35'),_0x2360f8[_0x4afa('0x39')]),_0x1478c2);}};exports[_0x4afa('0x3f')]=function(_0x592dc9){try{if(!_[_0x4afa('0x1d')](channels[_0x592dc9[_0x4afa('0x14')]])){utils[_0x4afa('0x16')](util[_0x4afa('0x7')](_0x4afa('0x40'),_0x592dc9['uniqueid']),_0x592dc9);channels[_0x592dc9[_0x4afa('0x14')]][_0x4afa('0x41')]=utils[_0x4afa('0x1a')]();utils[_0x4afa('0x6')](util[_0x4afa('0x7')](_0x4afa('0x42'),_0x592dc9[_0x4afa('0x14')],channels[_0x592dc9[_0x4afa('0x14')]][_0x4afa('0x41')]));}}catch(_0x3e4b35){utils[_0x4afa('0x28')](util['format'](_0x4afa('0x40'),_0x592dc9[_0x4afa('0x14')]),_0x3e4b35);}};exports[_0x4afa('0x43')]=function(_0x4642bd){try{if(!_[_0x4afa('0x1d')](channels[_0x4642bd['uniqueid']])){utils[_0x4afa('0x16')](util[_0x4afa('0x7')](_0x4afa('0x44'),_0x4642bd[_0x4afa('0x14')]),_0x4642bd);if(!_[_0x4afa('0x1d')](channels[_0x4642bd[_0x4afa('0x14')]][_0x4afa('0x41')])){channels[_0x4642bd[_0x4afa('0x14')]]['mohtime']+=utils[_0x4afa('0x33')](utils[_0x4afa('0x1a')](),channels[_0x4642bd['uniqueid']][_0x4afa('0x41')]);utils[_0x4afa('0x6')](util[_0x4afa('0x7')](_0x4afa('0x45'),_0x4642bd[_0x4afa('0x14')],channels[_0x4642bd[_0x4afa('0x14')]][_0x4afa('0x46')]));delete channels[_0x4642bd['uniqueid']][_0x4afa('0x41')];}}}catch(_0x19abae){utils['error'](util[_0x4afa('0x7')](_0x4afa('0x44'),_0x4642bd[_0x4afa('0x14')]),_0x19abae);}};exports[_0x4afa('0x47')]=function(_0x247ca2){try{if(!_[_0x4afa('0x1d')](channels[_0x247ca2[_0x4afa('0x14')]])){utils[_0x4afa('0x16')](util[_0x4afa('0x7')](_0x4afa('0x48'),_0x247ca2['uniqueid']),_0x247ca2);if(!_['isNil'](_0x247ca2[_0x4afa('0x49')][_0x4afa('0x4a')])){utils[_0x4afa('0x6')](util[_0x4afa('0x7')](_0x4afa('0x4b'),_0x247ca2[_0x4afa('0x14')],_0x247ca2[_0x4afa('0x4c')]));channels[_0x247ca2['uniqueid']]['source']=_0x247ca2['value'];}if(!_['isNil'](_0x247ca2['variable'][_0x4afa('0x4d')])){utils['info'](util[_0x4afa('0x7')](_0x4afa('0x4e'),_0x247ca2['uniqueid'],_0x247ca2[_0x4afa('0x4c')]));channels[_0x247ca2[_0x4afa('0x14')]]['destination']=_0x247ca2[_0x4afa('0x4c')];channels[_0x247ca2['uniqueid']][_0x4afa('0x2c')]='\x22'+_0x247ca2[_0x4afa('0x4c')]+'\x22\x20<'+_0x247ca2[_0x4afa('0x4c')]+'>';}if(!_[_0x4afa('0x1d')](_0x247ca2['variable']['xmd-callerid-preview'])||!_['isNil'](_0x247ca2['variable'][_0x4afa('0x4f')])){utils[_0x4afa('0x6')](util[_0x4afa('0x7')](_0x4afa('0x50'),_0x247ca2[_0x4afa('0x14')],!_[_0x4afa('0x1d')](_0x247ca2[_0x4afa('0x49')][_0x4afa('0x51')])?_0x4afa('0x51'):'xmd-callerid',_0x247ca2[_0x4afa('0x4c')]));channels[_0x247ca2[_0x4afa('0x14')]][_0x4afa('0x2c')]=_0x247ca2['value'];}if(!_[_0x4afa('0x1d')](_0x247ca2['variable'][_0x4afa('0x52')])||!_['isNil'](_0x247ca2[_0x4afa('0x49')][_0x4afa('0x53')])){utils[_0x4afa('0x6')](util[_0x4afa('0x7')](_0x4afa('0x50'),_0x247ca2[_0x4afa('0x14')],!_[_0x4afa('0x1d')](_0x247ca2[_0x4afa('0x49')][_0x4afa('0x52')])?_0x4afa('0x52'):_0x4afa('0x53'),_0x247ca2[_0x4afa('0x4c')]));channels[_0x247ca2[_0x4afa('0x14')]][_0x4afa('0x54')]='Queue';channels[_0x247ca2['uniqueid']]['lastdata']=_0x247ca2[_0x4afa('0x4c')];channels[_0x247ca2['uniqueid']][_0x4afa('0xa')]=!![];}if(!_[_0x4afa('0x1d')](_0x247ca2[_0x4afa('0x49')]['xmd-contactid'])){utils[_0x4afa('0x6')](util[_0x4afa('0x7')](_0x4afa('0x55'),_0x247ca2[_0x4afa('0x14')],_0x247ca2[_0x4afa('0x4c')]));channels[_0x247ca2[_0x4afa('0x14')]][_0x4afa('0x56')]=_0x247ca2[_0x4afa('0x4c')];}if(!_[_0x4afa('0x1d')](_0x247ca2[_0x4afa('0x49')][_0x4afa('0x57')])){utils[_0x4afa('0x6')](util['format'](_0x4afa('0x58'),_0x247ca2[_0x4afa('0x14')],_0x247ca2[_0x4afa('0x4c')]));channels[_0x247ca2[_0x4afa('0x14')]]['type']=_0x247ca2['value'];}if(!_[_0x4afa('0x1d')](_0x247ca2[_0x4afa('0x49')][_0x4afa('0x59')])){utils[_0x4afa('0x6')](util[_0x4afa('0x7')](_0x4afa('0x5a'),_0x247ca2[_0x4afa('0x14')],_0x247ca2[_0x4afa('0x4c')]));channels[_0x247ca2[_0x4afa('0x14')]][_0x4afa('0x5b')]=_0x247ca2[_0x4afa('0x4c')];}if(!_[_0x4afa('0x1d')](_0x247ca2['variable'][_0x4afa('0x5c')])){utils['info'](util[_0x4afa('0x7')](_0x4afa('0x5d'),_0x247ca2['uniqueid'],_0x247ca2['value']));channels[_0x247ca2[_0x4afa('0x14')]][_0x4afa('0x5c')]=_0x247ca2['value'];}}}catch(_0x589ad4){utils[_0x4afa('0x28')](util['format'](_0x4afa('0x48'),_0x247ca2[_0x4afa('0x14')]),_0x589ad4);}};exports[_0x4afa('0x5e')]=function(_0x284ab8){try{if(!_[_0x4afa('0x1d')](channels[_0x284ab8[_0x4afa('0x14')]])){utils[_0x4afa('0x16')](util[_0x4afa('0x7')](_0x4afa('0x5f'),_0x284ab8[_0x4afa('0x14')]),_0x284ab8);utils[_0x4afa('0x6')](util['format'](_0x4afa('0x60'),_0x284ab8[_0x4afa('0x14')],_0x284ab8[_0x4afa('0x61')],_0x284ab8[_0x4afa('0x62')]));if(_0x284ab8[_0x4afa('0x61')][_0x4afa('0x63')]()=='set'&&_[_0x4afa('0x64')](_0x284ab8['appdata'][_0x4afa('0x63')](),_0x4afa('0x65'))){var _0x1c8ff5=_0x284ab8[_0x4afa('0x62')]['split']('=');var _0x26bfae=_0x1c8ff5[0x0][_0x4afa('0x66')](_0x1c8ff5[0x0][_0x4afa('0x67')]('(')+0x1,_0x1c8ff5[0x0][_0x4afa('0x67')](')'));var _0x2eff08=_0x1c8ff5[0x1];channels[_0x284ab8[_0x4afa('0x14')]][_0x26bfae]=_0x2eff08;}if(!_[_0x4afa('0x68')]([_0x4afa('0x2a'),_0x4afa('0x69'),_0x4afa('0x6a'),_0x4afa('0x6b'),'gotoif'],_0x284ab8[_0x4afa('0x61')]['toLowerCase']())){channels[_0x284ab8[_0x4afa('0x14')]]['lastapplication']=_0x284ab8[_0x4afa('0x61')];channels[_0x284ab8[_0x4afa('0x14')]][_0x4afa('0x6c')]=_0x284ab8[_0x4afa('0x62')];}}}catch(_0x14afd4){utils[_0x4afa('0x28')](util['format'](_0x4afa('0x5f'),_0x284ab8[_0x4afa('0x14')]),_0x14afd4);}}; \ No newline at end of file +var _0xd2c1=['format','channel','queue','membername','interface','calleridnum','lastevent','accountcode','getUserByInternal','UserId','request','CreateVoiceCallReport','uniqueid','linkedid','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','[%s][calls][newchannel]','newstate','debug','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','error','[%s][calls][newstate]','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','diffTime','attendedtransfer','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','cdr','split','substring','lastIndexOf','noop','gotoif','[%s][calls][newexten]','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info'];(function(_0x5d06ca,_0x14f1f7){var _0x38aec7=function(_0x607c97){while(--_0x607c97){_0x5d06ca['push'](_0x5d06ca['shift']());}};_0x38aec7(++_0x14f1f7);}(_0xd2c1,0xc3));var _0x1d2c=function(_0x523adf,_0x3e1620){_0x523adf=_0x523adf-0x0;var _0x283870=_0xd2c1[_0x523adf];return _0x283870;};'use strict';var _=require('lodash');var util=require(_0x1d2c('0x0'));var utils=require(_0x1d2c('0x1'));var dispositions=[_0x1d2c('0x2'),'FAILED',_0x1d2c('0x3'),_0x1d2c('0x2'),'NO\x20ANSWER','NO\x20ANSWER',_0x1d2c('0x4'),_0x1d2c('0x5'),'FAILED','FAILED','FAILED'];var channels={};function writeDB(_0x16a752){utils[_0x1d2c('0x6')](util[_0x1d2c('0x7')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x16a752['uniqueid'],_0x16a752[_0x1d2c('0x8')],_0x16a752[_0x1d2c('0x9')],_0x16a752[_0x1d2c('0xa')],_0x16a752[_0x1d2c('0xb')],_0x16a752[_0x1d2c('0xc')],_0x16a752['connectedlinenum'],_0x16a752[_0x1d2c('0xd')]));if(_0x16a752[_0x1d2c('0xe')]){utils[_0x1d2c('0xf')](_0x16a752[_0x1d2c('0xe')])['then'](function(_0x2b0ce8){if(_0x2b0ce8){_0x16a752[_0x1d2c('0x10')]=_0x2b0ce8['id'];}utils[_0x1d2c('0x11')](_0x1d2c('0x12'),_0x16a752);});}else{utils[_0x1d2c('0x11')](_0x1d2c('0x12'),_0x16a752);}if(channels[_0x16a752[_0x1d2c('0x13')]]){delete channels[_0x16a752[_0x1d2c('0x13')]];}}exports['newchannel']=function(_0x55adde){try{utils['debug'](util[_0x1d2c('0x7')]('[%s][calls][newchannel]',_0x55adde['uniqueid']),_0x55adde);if(_0x55adde[_0x1d2c('0x13')]==_0x55adde[_0x1d2c('0x14')]&&_0x55adde[_0x1d2c('0x8')]!='OutgoingSpoolFailed'){utils[_0x1d2c('0x6')](util[_0x1d2c('0x7')](_0x1d2c('0x15'),_0x55adde[_0x1d2c('0x13')],_0x55adde[_0x1d2c('0x16')],_0x55adde[_0x1d2c('0x17')]));channels[_0x55adde[_0x1d2c('0x13')]]={'uniqueid':_0x55adde[_0x1d2c('0x13')],'accountcode':_0x55adde[_0x1d2c('0xe')],'source':_0x55adde['calleridnum'],'destination':_0x55adde['exten'],'destinationcontext':_0x55adde[_0x1d2c('0x16')],'channel':_0x55adde[_0x1d2c('0x8')],'starttime':utils[_0x1d2c('0x18')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x1d2c('0x2'),'amaflags':_0x1d2c('0x19')};}}catch(_0x1d15e4){utils['error'](util[_0x1d2c('0x7')](_0x1d2c('0x1a'),_0x55adde[_0x1d2c('0x13')]),_0x1d15e4);}};exports[_0x1d2c('0x1b')]=function(_0x54234b){try{utils[_0x1d2c('0x1c')](util[_0x1d2c('0x7')]('[%s][calls][newstate]',_0x54234b[_0x1d2c('0x13')]),_0x54234b);if(!_[_0x1d2c('0x1d')](channels[_0x54234b['uniqueid']])&&_0x54234b[_0x1d2c('0x1e')]==0x6){utils[_0x1d2c('0x6')](util['format'](_0x1d2c('0x1f'),_0x54234b[_0x1d2c('0x13')],_0x54234b['context'],_0x54234b['channel']));if(_[_0x1d2c('0x1d')](channels[_0x54234b['uniqueid']][_0x1d2c('0x20')])){channels[_0x54234b['uniqueid']][_0x1d2c('0x20')]=utils[_0x1d2c('0x18')]();}}else if(!_[_0x1d2c('0x1d')](channels[_0x54234b[_0x1d2c('0x14')]])&&_0x54234b['channelstate']==0x6&&_0x54234b[_0x1d2c('0x16')]!=_0x1d2c('0x21')){utils['info'](util[_0x1d2c('0x7')](_0x1d2c('0x22'),_0x54234b[_0x1d2c('0x13')],_0x54234b['linkedid'],_0x54234b['context'],_0x54234b[_0x1d2c('0x8')]));channels[_0x54234b[_0x1d2c('0x14')]][_0x1d2c('0xe')]=_0x54234b[_0x1d2c('0xe')];channels[_0x54234b[_0x1d2c('0x14')]][_0x1d2c('0x23')]=_0x54234b[_0x1d2c('0x8')];if(_[_0x1d2c('0x1d')](channels[_0x54234b[_0x1d2c('0x14')]][_0x1d2c('0x24')])){channels[_0x54234b[_0x1d2c('0x14')]]['answertime']=utils['now']();}channels[_0x54234b['linkedid']][_0x1d2c('0x25')]=dispositions[_[_0x1d2c('0x26')](_0x54234b[_0x1d2c('0x1e')])]||_0x1d2c('0x4');}}catch(_0x11a081){utils[_0x1d2c('0x27')](util[_0x1d2c('0x7')](_0x1d2c('0x28'),_0x54234b['uniqueid']),_0x11a081);}};exports[_0x1d2c('0x29')]=function(_0x2acb5d){try{if(!_[_0x1d2c('0x1d')](channels[_0x2acb5d['uniqueid']])){utils[_0x1d2c('0x1c')](util[_0x1d2c('0x7')](_0x1d2c('0x2a'),_0x2acb5d['uniqueid']),_0x2acb5d);if(_[_0x1d2c('0x1d')](channels[_0x2acb5d[_0x1d2c('0x13')]]['callerid'])){channels[_0x2acb5d['uniqueid']][_0x1d2c('0x2b')]=_0x2acb5d['calleridname']+'\x20<'+_0x2acb5d[_0x1d2c('0xc')]+'>';}utils[_0x1d2c('0x6')](util['format'](_0x1d2c('0x2c'),_0x2acb5d[_0x1d2c('0x13')],channels[_0x2acb5d[_0x1d2c('0x13')]][_0x1d2c('0x2b')],_0x2acb5d['cause-txt']));channels[_0x2acb5d['uniqueid']][_0x1d2c('0x2d')]=utils['now']();channels[_0x2acb5d['uniqueid']][_0x1d2c('0x2e')]=utils[_0x1d2c('0x2f')](channels[_0x2acb5d[_0x1d2c('0x13')]][_0x1d2c('0x2d')],channels[_0x2acb5d[_0x1d2c('0x13')]]['starttime']);channels[_0x2acb5d[_0x1d2c('0x13')]]['billableseconds']=channels[_0x2acb5d['uniqueid']]['answertime']?utils[_0x1d2c('0x2f')](channels[_0x2acb5d[_0x1d2c('0x13')]]['endtime'],channels[_0x2acb5d[_0x1d2c('0x13')]][_0x1d2c('0x24')]):0x0;writeDB(channels[_0x2acb5d[_0x1d2c('0x13')]]);}}catch(_0x182b9c){utils[_0x1d2c('0x27')](util['format'](_0x1d2c('0x2a'),_0x2acb5d[_0x1d2c('0x13')]),_0x182b9c);}};exports[_0x1d2c('0x30')]=function(_0x46dc18){try{if(!_[_0x1d2c('0x1d')](channels[_0x46dc18[_0x1d2c('0x31')]])){utils[_0x1d2c('0x1c')](util[_0x1d2c('0x7')]('[%s][calls][attendedtransfer]',_0x46dc18['origtransfereruniqueid']),_0x46dc18);if(channels[_0x46dc18['localtwolinkedid']][_0x1d2c('0x8')]==_0x46dc18[_0x1d2c('0x32')]){utils['info'](util['format'](_0x1d2c('0x33'),_0x46dc18[_0x1d2c('0x34')],_0x46dc18[_0x1d2c('0x31')],_0x46dc18[_0x1d2c('0x35')]));channels[_0x46dc18['localtwolinkedid']]['destinationchannel']=_0x46dc18['secondtransfererchannel'];channels[_0x46dc18[_0x1d2c('0x31')]][_0x1d2c('0x36')]=_0x1d2c('0x37');}else if(channels[_0x46dc18[_0x1d2c('0x31')]][_0x1d2c('0x8')]=_0x46dc18['transfertargetchannel']){utils['info'](util['format']('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x46dc18[_0x1d2c('0x34')],_0x46dc18[_0x1d2c('0x31')],_0x46dc18[_0x1d2c('0x38')]));channels[_0x46dc18['localtwolinkedid']]['destinationchannel']=_0x46dc18[_0x1d2c('0x38')];channels[_0x46dc18[_0x1d2c('0x31')]][_0x1d2c('0x36')]=_0x1d2c('0x37');}}}catch(_0x59bed6){utils['error'](util[_0x1d2c('0x7')]('[%s][calls][attendedtransfer]',_0x46dc18[_0x1d2c('0x34')]),_0x59bed6);}};exports[_0x1d2c('0x39')]=function(_0x3eca87){try{if(!_[_0x1d2c('0x1d')](channels[_0x3eca87['uniqueid']])){utils['debug'](util[_0x1d2c('0x7')](_0x1d2c('0x3a'),_0x3eca87[_0x1d2c('0x13')]),_0x3eca87);channels[_0x3eca87['uniqueid']][_0x1d2c('0x3b')]=utils['now']();utils['info'](util[_0x1d2c('0x7')](_0x1d2c('0x3c'),_0x3eca87['uniqueid'],channels[_0x3eca87[_0x1d2c('0x13')]][_0x1d2c('0x3b')]));}}catch(_0x343da2){utils[_0x1d2c('0x27')](util[_0x1d2c('0x7')](_0x1d2c('0x3a'),_0x3eca87[_0x1d2c('0x13')]),_0x343da2);}};exports['musiconholdstop']=function(_0x1a6c84){try{if(!_[_0x1d2c('0x1d')](channels[_0x1a6c84[_0x1d2c('0x13')]])){utils['debug'](util[_0x1d2c('0x7')](_0x1d2c('0x3d'),_0x1a6c84[_0x1d2c('0x13')]),_0x1a6c84);if(!_[_0x1d2c('0x1d')](channels[_0x1a6c84[_0x1d2c('0x13')]]['musiconholdstartAt'])){channels[_0x1a6c84[_0x1d2c('0x13')]][_0x1d2c('0x3e')]+=utils[_0x1d2c('0x2f')](utils[_0x1d2c('0x18')](),channels[_0x1a6c84[_0x1d2c('0x13')]][_0x1d2c('0x3b')]);utils[_0x1d2c('0x6')](util['format'](_0x1d2c('0x3f'),_0x1a6c84[_0x1d2c('0x13')],channels[_0x1a6c84[_0x1d2c('0x13')]][_0x1d2c('0x3e')]));delete channels[_0x1a6c84[_0x1d2c('0x13')]][_0x1d2c('0x3b')];}}}catch(_0x395336){utils['error'](util[_0x1d2c('0x7')](_0x1d2c('0x3d'),_0x1a6c84[_0x1d2c('0x13')]),_0x395336);}};exports[_0x1d2c('0x40')]=function(_0x1494d8){try{if(!_['isNil'](channels[_0x1494d8[_0x1d2c('0x13')]])){utils[_0x1d2c('0x1c')](util[_0x1d2c('0x7')]('[%s][calls][varset]',_0x1494d8[_0x1d2c('0x13')]),_0x1494d8);if(!_['isNil'](_0x1494d8[_0x1d2c('0x41')][_0x1d2c('0x42')])){utils[_0x1d2c('0x6')](util[_0x1d2c('0x7')](_0x1d2c('0x43'),_0x1494d8['uniqueid'],_0x1494d8[_0x1d2c('0x44')]));channels[_0x1494d8[_0x1d2c('0x13')]][_0x1d2c('0x45')]=_0x1494d8[_0x1d2c('0x44')];}if(!_[_0x1d2c('0x1d')](_0x1494d8[_0x1d2c('0x41')][_0x1d2c('0x46')])){utils[_0x1d2c('0x6')](util[_0x1d2c('0x7')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x1494d8['uniqueid'],_0x1494d8[_0x1d2c('0x44')]));channels[_0x1494d8[_0x1d2c('0x13')]]['destination']=_0x1494d8[_0x1d2c('0x44')];channels[_0x1494d8[_0x1d2c('0x13')]][_0x1d2c('0x2b')]='\x22'+_0x1494d8[_0x1d2c('0x44')]+_0x1d2c('0x47')+_0x1494d8[_0x1d2c('0x44')]+'>';}if(!_['isNil'](_0x1494d8[_0x1d2c('0x41')][_0x1d2c('0x48')])||!_[_0x1d2c('0x1d')](_0x1494d8[_0x1d2c('0x41')][_0x1d2c('0x49')])){utils[_0x1d2c('0x6')](util['format'](_0x1d2c('0x4a'),_0x1494d8[_0x1d2c('0x13')],!_[_0x1d2c('0x1d')](_0x1494d8[_0x1d2c('0x41')][_0x1d2c('0x48')])?_0x1d2c('0x48'):'xmd-callerid',_0x1494d8['value']));channels[_0x1494d8[_0x1d2c('0x13')]][_0x1d2c('0x2b')]=_0x1494d8[_0x1d2c('0x44')];}if(!_[_0x1d2c('0x1d')](_0x1494d8[_0x1d2c('0x41')][_0x1d2c('0x4b')])||!_['isNil'](_0x1494d8[_0x1d2c('0x41')][_0x1d2c('0x4c')])){utils[_0x1d2c('0x6')](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x1494d8[_0x1d2c('0x13')],!_[_0x1d2c('0x1d')](_0x1494d8[_0x1d2c('0x41')][_0x1d2c('0x4b')])?'xmd-queue':_0x1d2c('0x4c'),_0x1494d8[_0x1d2c('0x44')]));channels[_0x1494d8[_0x1d2c('0x13')]][_0x1d2c('0x4d')]=_0x1d2c('0x4e');channels[_0x1494d8[_0x1d2c('0x13')]][_0x1d2c('0x4f')]=_0x1494d8[_0x1d2c('0x44')];channels[_0x1494d8[_0x1d2c('0x13')]][_0x1d2c('0x9')]=!![];}if(!_[_0x1d2c('0x1d')](_0x1494d8[_0x1d2c('0x41')][_0x1d2c('0x50')])){utils['info'](util[_0x1d2c('0x7')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x1494d8['uniqueid'],_0x1494d8[_0x1d2c('0x44')]));channels[_0x1494d8[_0x1d2c('0x13')]]['ContactId']=_0x1494d8[_0x1d2c('0x44')];}if(!_[_0x1d2c('0x1d')](_0x1494d8[_0x1d2c('0x41')][_0x1d2c('0x51')])){utils[_0x1d2c('0x6')](util['format'](_0x1d2c('0x52'),_0x1494d8[_0x1d2c('0x13')],_0x1494d8[_0x1d2c('0x44')]));channels[_0x1494d8[_0x1d2c('0x13')]][_0x1d2c('0x53')]=_0x1494d8['value'];}if(!_[_0x1d2c('0x1d')](_0x1494d8['variable']['outboundrouteid'])){utils[_0x1d2c('0x6')](util[_0x1d2c('0x7')](_0x1d2c('0x54'),_0x1494d8[_0x1d2c('0x13')],_0x1494d8['value']));channels[_0x1494d8['uniqueid']][_0x1d2c('0x55')]=_0x1494d8[_0x1d2c('0x44')];}if(!_[_0x1d2c('0x1d')](_0x1494d8[_0x1d2c('0x41')][_0x1d2c('0x56')])){utils['info'](util[_0x1d2c('0x7')](_0x1d2c('0x57'),_0x1494d8[_0x1d2c('0x13')],_0x1494d8['value']));channels[_0x1494d8[_0x1d2c('0x13')]][_0x1d2c('0x56')]=_0x1494d8['value'];}}}catch(_0x1a255a){utils[_0x1d2c('0x27')](util[_0x1d2c('0x7')](_0x1d2c('0x58'),_0x1494d8[_0x1d2c('0x13')]),_0x1a255a);}};exports['newexten']=function(_0x128ac1){try{if(!_[_0x1d2c('0x1d')](channels[_0x128ac1[_0x1d2c('0x13')]])){utils[_0x1d2c('0x1c')](util[_0x1d2c('0x7')]('[%s][calls][newexten]',_0x128ac1[_0x1d2c('0x13')]),_0x128ac1);utils[_0x1d2c('0x6')](util[_0x1d2c('0x7')](_0x1d2c('0x59'),_0x128ac1['uniqueid'],_0x128ac1[_0x1d2c('0x5a')],_0x128ac1[_0x1d2c('0x5b')]));if(_0x128ac1[_0x1d2c('0x5a')][_0x1d2c('0x5c')]()==_0x1d2c('0x5d')&&_['startsWith'](_0x128ac1[_0x1d2c('0x5b')][_0x1d2c('0x5c')](),_0x1d2c('0x5e'))){var _0x343998=_0x128ac1[_0x1d2c('0x5b')][_0x1d2c('0x5f')]('=');var _0x28dcce=_0x343998[0x0][_0x1d2c('0x60')](_0x343998[0x0]['lastIndexOf']('(')+0x1,_0x343998[0x0][_0x1d2c('0x61')](')'));var _0x13b99b=_0x343998[0x1];channels[_0x128ac1[_0x1d2c('0x13')]][_0x28dcce]=_0x13b99b;}if(!_['includes']([_0x1d2c('0x29'),_0x1d2c('0x62'),'execif',_0x1d2c('0x5d'),_0x1d2c('0x63')],_0x128ac1[_0x1d2c('0x5a')]['toLowerCase']())){channels[_0x128ac1['uniqueid']][_0x1d2c('0x4d')]=_0x128ac1[_0x1d2c('0x5a')];channels[_0x128ac1['uniqueid']][_0x1d2c('0x4f')]=_0x128ac1[_0x1d2c('0x5b')];}}}catch(_0x4c8025){utils[_0x1d2c('0x27')](util[_0x1d2c('0x7')](_0x1d2c('0x64'),_0x128ac1['uniqueid']),_0x4c8025);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 585b560..b7c98a1 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 _0x5c0d=['[core]\x20fullybooted','error','[core]\x20close','managerevent','./utils','connect','info','shutdown','[core]\x20shutdown','fullybooted'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5c0d,0x9a));var _0xd5c0=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x5c0d[_0x1c546c];return _0x2cc384;};'use strict';var utils=require(_0xd5c0('0x0'));exports[_0xd5c0('0x1')]=function(){utils[_0xd5c0('0x2')]('[core]\x20connected');};exports[_0xd5c0('0x3')]=function(){utils[_0xd5c0('0x2')](_0xd5c0('0x4'));};exports[_0xd5c0('0x5')]=function(){utils[_0xd5c0('0x2')](_0xd5c0('0x6'));};exports[_0xd5c0('0x7')]=function(_0x4019bd){utils[_0xd5c0('0x7')]('[core]\x20error',_0x4019bd);};exports['close']=function(){utils[_0xd5c0('0x2')](_0xd5c0('0x8'));};exports[_0xd5c0('0x9')]=function(_0x29547e){}; \ No newline at end of file +var _0x5e2f=['managerevent','./utils','info','[core]\x20connected','shutdown','[core]\x20shutdown','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close'];(function(_0x4b1a42,_0xe56669){var _0x2f92b7=function(_0x4b2dcd){while(--_0x4b2dcd){_0x4b1a42['push'](_0x4b1a42['shift']());}};_0x2f92b7(++_0xe56669);}(_0x5e2f,0x14b));var _0xf5e2=function(_0x1b3e44,_0x3bb9e3){_0x1b3e44=_0x1b3e44-0x0;var _0x21ca9f=_0x5e2f[_0x1b3e44];return _0x21ca9f;};'use strict';var utils=require(_0xf5e2('0x0'));exports['connect']=function(){utils[_0xf5e2('0x1')](_0xf5e2('0x2'));};exports[_0xf5e2('0x3')]=function(){utils['info'](_0xf5e2('0x4'));};exports['fullybooted']=function(){utils['info'](_0xf5e2('0x5'));};exports[_0xf5e2('0x6')]=function(_0x101de3){utils['error'](_0xf5e2('0x7'),_0x101de3);};exports[_0xf5e2('0x8')]=function(){utils['info'](_0xf5e2('0x9'));};exports[_0xf5e2('0xa')]=function(_0x2138ee){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 9cecac1..2f3a88c 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 _0xca69=['[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','duration','holdtime','diffTime','endtime','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','format','[%s][dials][newexten]','application','toLowerCase','set','appdata','split','varset','debug','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','[%s][dials][varset]','dialbegin','assign','starttime','now','lastevent','called','[%s][dials][dialbegin]','dialend','[%s][dials][dialend]','ANSWER','answertime','connect'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xca69,0x12b));var _0x9ca6=function(_0x1240db,_0x534893){_0x1240db=_0x1240db-0x0;var _0x37ec62=_0xca69[_0x1240db];return _0x37ec62;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x9ca6('0x0'));var dials={};function writeDB(_0x1550d9){utils[_0x9ca6('0x1')](util['format'](_0x9ca6('0x2'),_0x1550d9[_0x9ca6('0x3')],_0x1550d9[_0x9ca6('0x4')],_0x1550d9[_0x9ca6('0x5')],_0x1550d9[_0x9ca6('0x6')],_0x1550d9[_0x9ca6('0x7')],_0x1550d9[_0x9ca6('0x8')]));utils['request'](_0x9ca6('0x9'),_0x1550d9);delete dials[_0x1550d9[_0x9ca6('0x3')]];}exports['newexten']=function(_0x21aa01){try{utils['debug'](util[_0x9ca6('0xa')](_0x9ca6('0xb'),_0x21aa01['uniqueid']),_0x21aa01);utils[_0x9ca6('0x1')](util[_0x9ca6('0xa')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x21aa01[_0x9ca6('0x3')],_0x21aa01[_0x9ca6('0xc')],_0x21aa01['appdata']));if(_0x21aa01['application'][_0x9ca6('0xd')]()==_0x9ca6('0xe')&&_['startsWith'](_0x21aa01[_0x9ca6('0xf')][_0x9ca6('0xd')](),'cdr(routeid)')){var _0x9a8b32=_0x21aa01[_0x9ca6('0xf')][_0x9ca6('0x10')]('=');dials[_0x21aa01['uniqueid']]={'routeId':_0x9a8b32[0x1]};}}catch(_0x3f9366){utils['error'](util[_0x9ca6('0xa')]('[%s][dials][newexten]',_0x21aa01[_0x9ca6('0x3')]),_0x3f9366);}};exports[_0x9ca6('0x11')]=function(_0x3c877d){try{utils[_0x9ca6('0x12')](util[_0x9ca6('0xa')]('[%s][dials][varset]',_0x3c877d[_0x9ca6('0x3')]),_0x3c877d);if(!_[_0x9ca6('0x13')](_0x3c877d['variable'][_0x9ca6('0x14')])){utils[_0x9ca6('0x1')](util[_0x9ca6('0xa')](_0x9ca6('0x15'),_0x3c877d[_0x9ca6('0x3')],_0x3c877d[_0x9ca6('0x16')]));dials[_0x3c877d[_0x9ca6('0x3')]]={'routeId':_0x3c877d['value']};}}catch(_0x162979){utils[_0x9ca6('0x17')](util[_0x9ca6('0xa')](_0x9ca6('0x18'),_0x3c877d[_0x9ca6('0x3')]),_0x162979);}};exports[_0x9ca6('0x19')]=function(_0x58094f){try{if(!_[_0x9ca6('0x13')](dials[_0x58094f[_0x9ca6('0x3')]])){utils[_0x9ca6('0x12')](util[_0x9ca6('0xa')]('[%s][dials][dialbegin]',_0x58094f['uniqueid']),_0x58094f);dials[_0x58094f[_0x9ca6('0x3')]]=_[_0x9ca6('0x1a')](dials[_0x58094f['uniqueid']],_0x58094f);dials[_0x58094f[_0x9ca6('0x3')]][_0x9ca6('0x1b')]=utils[_0x9ca6('0x1c')]();dials[_0x58094f[_0x9ca6('0x3')]][_0x9ca6('0x1d')]=_0x9ca6('0x1e');utils[_0x9ca6('0x1')](util[_0x9ca6('0xa')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x58094f[_0x9ca6('0x3')],dials[_0x58094f[_0x9ca6('0x3')]][_0x9ca6('0x1b')]));}}catch(_0x359bfe){utils[_0x9ca6('0x17')](util[_0x9ca6('0xa')](_0x9ca6('0x1f'),_0x58094f[_0x9ca6('0x3')]),_0x359bfe);}};exports[_0x9ca6('0x20')]=function(_0x1ab7e2){try{if(!_['isNil'](dials[_0x1ab7e2[_0x9ca6('0x3')]])){utils[_0x9ca6('0x12')](util[_0x9ca6('0xa')](_0x9ca6('0x21'),_0x1ab7e2['uniqueid']),_0x1ab7e2);dials[_0x1ab7e2[_0x9ca6('0x3')]][_0x9ca6('0x8')]=_0x1ab7e2[_0x9ca6('0x8')];if(_0x1ab7e2[_0x9ca6('0x8')]==_0x9ca6('0x22')){dials[_0x1ab7e2[_0x9ca6('0x3')]]=_[_0x9ca6('0x1a')](dials[_0x1ab7e2[_0x9ca6('0x3')]],_0x1ab7e2);dials[_0x1ab7e2[_0x9ca6('0x3')]][_0x9ca6('0x23')]=utils['now']();dials[_0x1ab7e2['uniqueid']]['lastevent']=_0x9ca6('0x24');utils[_0x9ca6('0x1')](util['format'](_0x9ca6('0x25'),_0x1ab7e2[_0x9ca6('0x3')],_0x1ab7e2[_0x9ca6('0x8')],dials[_0x1ab7e2['uniqueid']][_0x9ca6('0x23')]));}else{utils['info'](util['format'](_0x9ca6('0x26'),_0x1ab7e2[_0x9ca6('0x3')],_0x1ab7e2[_0x9ca6('0x8')]));}}}catch(_0x6a0181){utils[_0x9ca6('0x17')](util[_0x9ca6('0xa')](_0x9ca6('0x21'),_0x1ab7e2[_0x9ca6('0x3')]),_0x6a0181);}};exports[_0x9ca6('0x27')]=function(_0x593743){try{if(!_[_0x9ca6('0x13')](dials[_0x593743[_0x9ca6('0x3')]])){utils[_0x9ca6('0x12')](util[_0x9ca6('0xa')](_0x9ca6('0x28'),_0x593743[_0x9ca6('0x3')]),_0x593743);utils[_0x9ca6('0x1')](util[_0x9ca6('0xa')](_0x9ca6('0x29'),_0x593743['uniqueid'],_0x593743['calleridnum'],_0x593743['calleridname'],_0x593743[_0x9ca6('0x2a')]));dials[_0x593743['uniqueid']]=_[_0x9ca6('0x1a')](dials[_0x593743[_0x9ca6('0x3')]],{'endtime':utils['now'](),'lastevent':_0x9ca6('0x2b')});dials[_0x593743[_0x9ca6('0x3')]][_0x9ca6('0x2c')]=utils['diffTime'](dials[_0x593743['uniqueid']]['endtime'],dials[_0x593743[_0x9ca6('0x3')]]['starttime']);dials[_0x593743[_0x9ca6('0x3')]][_0x9ca6('0x2d')]=utils[_0x9ca6('0x2e')](dials[_0x593743[_0x9ca6('0x3')]]['answertime']||dials[_0x593743['uniqueid']][_0x9ca6('0x2f')],dials[_0x593743[_0x9ca6('0x3')]]['starttime']);dials[_0x593743['uniqueid']]['billableseconds']=dials[_0x593743[_0x9ca6('0x3')]][_0x9ca6('0x23')]?utils[_0x9ca6('0x2e')](dials[_0x593743['uniqueid']]['endtime'],dials[_0x593743[_0x9ca6('0x3')]]['answertime']):0x0;writeDB(dials[_0x593743[_0x9ca6('0x3')]]);}}catch(_0x34a925){utils['error'](util[_0x9ca6('0xa')](_0x9ca6('0x28'),_0x593743[_0x9ca6('0x3')]),_0x34a925);}}; \ No newline at end of file +var _0xa0ef=['variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][varset]','dialbegin','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','dialend','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','calleridnum','calleridname','cause-txt','assign','diffTime','holdtime','endtime','billableseconds','[%s][dials][hangup]','lodash','./utils','info','format','uniqueid','channel','dialstring','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset','isNil'];(function(_0x53a0b5,_0x2f10d6){var _0x3774fb=function(_0x54dd87){while(--_0x54dd87){_0x53a0b5['push'](_0x53a0b5['shift']());}};_0x3774fb(++_0x2f10d6);}(_0xa0ef,0xb0));var _0xfa0e=function(_0x52fa77,_0x2b381b){_0x52fa77=_0x52fa77-0x0;var _0x477535=_0xa0ef[_0x52fa77];return _0x477535;};'use strict';var _=require(_0xfa0e('0x0'));var util=require('util');var utils=require(_0xfa0e('0x1'));var dials={};function writeDB(_0x4876d5){utils[_0xfa0e('0x2')](util[_0xfa0e('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x4876d5[_0xfa0e('0x4')],_0x4876d5[_0xfa0e('0x5')],_0x4876d5[_0xfa0e('0x6')],_0x4876d5['calleridnum'],_0x4876d5['connectedlinenum'],_0x4876d5[_0xfa0e('0x7')]));utils[_0xfa0e('0x8')](_0xfa0e('0x9'),_0x4876d5);delete dials[_0x4876d5[_0xfa0e('0x4')]];}exports[_0xfa0e('0xa')]=function(_0xdaa030){try{utils[_0xfa0e('0xb')](util['format'](_0xfa0e('0xc'),_0xdaa030[_0xfa0e('0x4')]),_0xdaa030);utils[_0xfa0e('0x2')](util[_0xfa0e('0x3')](_0xfa0e('0xd'),_0xdaa030[_0xfa0e('0x4')],_0xdaa030[_0xfa0e('0xe')],_0xdaa030[_0xfa0e('0xf')]));if(_0xdaa030[_0xfa0e('0xe')][_0xfa0e('0x10')]()==_0xfa0e('0x11')&&_[_0xfa0e('0x12')](_0xdaa030[_0xfa0e('0xf')][_0xfa0e('0x10')](),_0xfa0e('0x13'))){var _0x239f2c=_0xdaa030[_0xfa0e('0xf')][_0xfa0e('0x14')]('=');dials[_0xdaa030['uniqueid']]={'routeId':_0x239f2c[0x1]};}}catch(_0x3b5f76){utils[_0xfa0e('0x15')](util['format'](_0xfa0e('0xc'),_0xdaa030[_0xfa0e('0x4')]),_0x3b5f76);}};exports[_0xfa0e('0x16')]=function(_0x2e9e8b){try{utils['debug'](util['format']('[%s][dials][varset]',_0x2e9e8b[_0xfa0e('0x4')]),_0x2e9e8b);if(!_[_0xfa0e('0x17')](_0x2e9e8b[_0xfa0e('0x18')]['outboundrouteid'])){utils['info'](util[_0xfa0e('0x3')](_0xfa0e('0x19'),_0x2e9e8b[_0xfa0e('0x4')],_0x2e9e8b[_0xfa0e('0x1a')]));dials[_0x2e9e8b['uniqueid']]={'routeId':_0x2e9e8b[_0xfa0e('0x1a')]};}}catch(_0x5a613c){utils['error'](util['format'](_0xfa0e('0x1b'),_0x2e9e8b[_0xfa0e('0x4')]),_0x5a613c);}};exports[_0xfa0e('0x1c')]=function(_0x3c8e7e){try{if(!_[_0xfa0e('0x17')](dials[_0x3c8e7e[_0xfa0e('0x4')]])){utils['debug'](util[_0xfa0e('0x3')]('[%s][dials][dialbegin]',_0x3c8e7e['uniqueid']),_0x3c8e7e);dials[_0x3c8e7e['uniqueid']]=_['assign'](dials[_0x3c8e7e['uniqueid']],_0x3c8e7e);dials[_0x3c8e7e[_0xfa0e('0x4')]][_0xfa0e('0x1d')]=utils[_0xfa0e('0x1e')]();dials[_0x3c8e7e[_0xfa0e('0x4')]][_0xfa0e('0x1f')]=_0xfa0e('0x20');utils[_0xfa0e('0x2')](util['format'](_0xfa0e('0x21'),_0x3c8e7e['uniqueid'],dials[_0x3c8e7e[_0xfa0e('0x4')]][_0xfa0e('0x1d')]));}}catch(_0x5e7e9a){utils[_0xfa0e('0x15')](util[_0xfa0e('0x3')](_0xfa0e('0x22'),_0x3c8e7e[_0xfa0e('0x4')]),_0x5e7e9a);}};exports[_0xfa0e('0x23')]=function(_0x10b7f6){try{if(!_[_0xfa0e('0x17')](dials[_0x10b7f6[_0xfa0e('0x4')]])){utils[_0xfa0e('0xb')](util['format']('[%s][dials][dialend]',_0x10b7f6['uniqueid']),_0x10b7f6);dials[_0x10b7f6[_0xfa0e('0x4')]][_0xfa0e('0x7')]=_0x10b7f6[_0xfa0e('0x7')];if(_0x10b7f6['dialstatus']==_0xfa0e('0x24')){dials[_0x10b7f6['uniqueid']]=_['assign'](dials[_0x10b7f6[_0xfa0e('0x4')]],_0x10b7f6);dials[_0x10b7f6[_0xfa0e('0x4')]][_0xfa0e('0x25')]=utils[_0xfa0e('0x1e')]();dials[_0x10b7f6[_0xfa0e('0x4')]]['lastevent']=_0xfa0e('0x26');utils[_0xfa0e('0x2')](util['format'](_0xfa0e('0x27'),_0x10b7f6['uniqueid'],_0x10b7f6[_0xfa0e('0x7')],dials[_0x10b7f6[_0xfa0e('0x4')]][_0xfa0e('0x25')]));}else{utils[_0xfa0e('0x2')](util[_0xfa0e('0x3')](_0xfa0e('0x28'),_0x10b7f6['uniqueid'],_0x10b7f6[_0xfa0e('0x7')]));}}}catch(_0x3cf656){utils[_0xfa0e('0x15')](util[_0xfa0e('0x3')]('[%s][dials][dialend]',_0x10b7f6[_0xfa0e('0x4')]),_0x3cf656);}};exports['hangup']=function(_0x4d2b63){try{if(!_[_0xfa0e('0x17')](dials[_0x4d2b63['uniqueid']])){utils['debug'](util[_0xfa0e('0x3')]('[%s][dials][hangup]',_0x4d2b63[_0xfa0e('0x4')]),_0x4d2b63);utils[_0xfa0e('0x2')](util[_0xfa0e('0x3')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x4d2b63[_0xfa0e('0x4')],_0x4d2b63[_0xfa0e('0x29')],_0x4d2b63[_0xfa0e('0x2a')],_0x4d2b63[_0xfa0e('0x2b')]));dials[_0x4d2b63[_0xfa0e('0x4')]]=_[_0xfa0e('0x2c')](dials[_0x4d2b63[_0xfa0e('0x4')]],{'endtime':utils['now'](),'lastevent':'complete'});dials[_0x4d2b63[_0xfa0e('0x4')]]['duration']=utils[_0xfa0e('0x2d')](dials[_0x4d2b63[_0xfa0e('0x4')]]['endtime'],dials[_0x4d2b63[_0xfa0e('0x4')]][_0xfa0e('0x1d')]);dials[_0x4d2b63['uniqueid']][_0xfa0e('0x2e')]=utils[_0xfa0e('0x2d')](dials[_0x4d2b63['uniqueid']][_0xfa0e('0x25')]||dials[_0x4d2b63[_0xfa0e('0x4')]][_0xfa0e('0x2f')],dials[_0x4d2b63[_0xfa0e('0x4')]][_0xfa0e('0x1d')]);dials[_0x4d2b63[_0xfa0e('0x4')]][_0xfa0e('0x30')]=dials[_0x4d2b63[_0xfa0e('0x4')]][_0xfa0e('0x25')]?utils[_0xfa0e('0x2d')](dials[_0x4d2b63[_0xfa0e('0x4')]]['endtime'],dials[_0x4d2b63[_0xfa0e('0x4')]][_0xfa0e('0x25')]):0x0;writeDB(dials[_0x4d2b63[_0xfa0e('0x4')]]);}}catch(_0xfda822){utils[_0xfa0e('0x15')](util['format'](_0xfa0e('0x31'),_0x4d2b63['uniqueid']),_0xfda822);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 3e4589e..83044a0 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 _0x130d=['./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','[%s][index][devicestatechange]','device','format','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','debug','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','[%s][index][dialbegin]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','xdr','disabled','env','production','local','asterisk','username','password','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller'];(function(_0xa94f0a,_0x5db0c3){var _0x814568=function(_0x2df99e){while(--_0x2df99e){_0xa94f0a['push'](_0xa94f0a['shift']());}};_0x814568(++_0x5db0c3);}(_0x130d,0x1ac));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};var AsteriskManager=require(_0xd130('0x0'));var config=require(_0xd130('0x1'));var utils=require(_0xd130('0x2'));var util=require(_0xd130('0x3'));var isXDREnabled=config[_0xd130('0x4')]&&config[_0xd130('0x4')][_0xd130('0x5')]?!config[_0xd130('0x4')][_0xd130('0x5')]:!![];var isProduction=config[_0xd130('0x6')]===_0xd130('0x7')||![];var isLocalAsterisk=config[_0xd130('0x4')]&&config[_0xd130('0x4')][_0xd130('0x8')]===!![]||![];var ami=new AsteriskManager(config[_0xd130('0x9')]['port'],config[_0xd130('0x9')]['ip'],config[_0xd130('0x9')][_0xd130('0xa')],config['asterisk'][_0xd130('0xb')],!![]);ami[_0xd130('0xc')]();if(!isXDREnabled){utils['info']('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0xd130('0xd')](_0xd130('0xe'));}else{var agents=require(_0xd130('0xf'));var calls=require(_0xd130('0x10'));var queues=require(_0xd130('0x11'));var recordings=require(_0xd130('0x12'));var members=require(_0xd130('0x13'));var dials=require(_0xd130('0x14'));var transfers=require(_0xd130('0x15'));var core=require(_0xd130('0x16'));ami['on'](_0xd130('0x17'),core[_0xd130('0x17')]);ami['on'](_0xd130('0x18'),core['shutdown']);ami['on'](_0xd130('0x19'),core[_0xd130('0x19')]);ami['on'](_0xd130('0x1a'),core[_0xd130('0x1a')]);ami['on'](_0xd130('0x1b'),core[_0xd130('0x1b')]);ami['on'](_0xd130('0x1c'),core[_0xd130('0x1c')]);ami['on'](_0xd130('0x1d'),function(_0x46a01c){try{utils['debug'](util['format'](_0xd130('0x1e'),_0x46a01c[_0xd130('0x1f')]),_0x46a01c);members[_0xd130('0x1d')](_0x46a01c);}catch(_0x1620e1){utils['error'](util[_0xd130('0x20')](_0xd130('0x1e'),_0x46a01c[_0xd130('0x1f')]),_0x1620e1);}});ami['on'](_0xd130('0x21'),function(_0x2e8ac2){try{utils['debug'](util[_0xd130('0x20')](_0xd130('0x22'),_0x2e8ac2[_0xd130('0x23')]),_0x2e8ac2);agents['agentcalled'](_0x2e8ac2);}catch(_0x4a14cc){utils[_0xd130('0x1a')](util[_0xd130('0x20')](_0xd130('0x22'),_0x2e8ac2[_0xd130('0x23')]),_0x4a14cc);}});ami['on'](_0xd130('0x24'),function(_0x424d20){try{utils['debug'](util[_0xd130('0x20')](_0xd130('0x25'),_0x424d20[_0xd130('0x23')]),_0x424d20);agents[_0xd130('0x24')](_0x424d20);}catch(_0x1fbf7c){utils[_0xd130('0x1a')](util['format']('[%s][index][agentringnoanswer]',_0x424d20[_0xd130('0x23')]),_0x1fbf7c);}});ami['on'](_0xd130('0x26'),function(_0x4a7af0){try{utils['debug'](util['format'](_0xd130('0x27'),_0x4a7af0[_0xd130('0x23')]),_0x4a7af0);agents[_0xd130('0x26')](_0x4a7af0);queues[_0xd130('0x26')](_0x4a7af0);}catch(_0x39e2fb){utils[_0xd130('0x1a')](util[_0xd130('0x20')](_0xd130('0x27'),_0x4a7af0[_0xd130('0x23')]),_0x39e2fb);}});ami['on'](_0xd130('0x28'),function(_0x62137d){try{utils[_0xd130('0x29')](util['format'](_0xd130('0x2a'),_0x62137d[_0xd130('0x23')]),_0x62137d);agents[_0xd130('0x28')](_0x62137d);queues['agentcomplete'](_0x62137d);members[_0xd130('0x28')](_0x62137d);}catch(_0x4284ea){utils[_0xd130('0x1a')](util[_0xd130('0x20')](_0xd130('0x2a'),_0x62137d[_0xd130('0x23')]),_0x4284ea);}});ami['on'](_0xd130('0x2b'),function(_0x2518d7){try{utils[_0xd130('0x29')](util[_0xd130('0x20')]('[%s][index][queuecallerabandon]',_0x2518d7[_0xd130('0x23')]),_0x2518d7);agents[_0xd130('0x2b')](_0x2518d7);queues[_0xd130('0x2b')](_0x2518d7);}catch(_0x4ef2a9){utils[_0xd130('0x1a')](util['format'](_0xd130('0x2c'),_0x2518d7[_0xd130('0x23')]),_0x4ef2a9);}});ami['on']('queuecallerjoin',function(_0x1c46df){try{utils[_0xd130('0x29')](util[_0xd130('0x20')](_0xd130('0x2d'),_0x1c46df[_0xd130('0x23')]),_0x1c46df);queues[_0xd130('0x2e')](_0x1c46df);recordings[_0xd130('0x2e')](_0x1c46df);}catch(_0x36a6f1){utils['error'](util[_0xd130('0x20')](_0xd130('0x2d'),_0x1c46df[_0xd130('0x23')]),_0x36a6f1);}});ami['on']('queuecallerleave',function(_0x3dbf55){try{utils['debug'](util[_0xd130('0x20')]('[%s][index][queuecallerleave]',_0x3dbf55[_0xd130('0x23')]),_0x3dbf55);queues[_0xd130('0x2f')](_0x3dbf55);}catch(_0x4f60b6){utils[_0xd130('0x1a')](util['format'](_0xd130('0x30'),_0x3dbf55[_0xd130('0x23')]),_0x4f60b6);}});ami['on'](_0xd130('0x31'),function(_0x14ef31){try{utils[_0xd130('0x29')](util[_0xd130('0x20')](_0xd130('0x32'),_0x14ef31[_0xd130('0x23')]),_0x14ef31);queues[_0xd130('0x31')](_0x14ef31);calls[_0xd130('0x31')](_0x14ef31);}catch(_0x19af1c){utils[_0xd130('0x1a')](util[_0xd130('0x20')](_0xd130('0x32'),_0x14ef31[_0xd130('0x23')]),_0x19af1c);}});ami['on'](_0xd130('0x33'),function(_0x1a03da){try{utils[_0xd130('0x29')](util[_0xd130('0x20')]('[%s][index][musiconholdstop]',_0x1a03da['uniqueid']),_0x1a03da);queues['musiconholdstop'](_0x1a03da);calls['musiconholdstop'](_0x1a03da);}catch(_0x1405e4){utils['error'](util[_0xd130('0x20')](_0xd130('0x34'),_0x1a03da['uniqueid']),_0x1405e4);}});ami['on']('newstate',function(_0x3bbe2c){try{utils['debug'](util[_0xd130('0x20')](_0xd130('0x35'),_0x3bbe2c[_0xd130('0x23')]),_0x3bbe2c);calls[_0xd130('0x36')](_0x3bbe2c);recordings['newstate'](_0x3bbe2c);}catch(_0x3cef4f){utils[_0xd130('0x1a')](util[_0xd130('0x20')](_0xd130('0x35'),_0x3bbe2c['uniqueid']),_0x3cef4f);}});ami['on']('hangup',function(_0x2a25b5){try{utils[_0xd130('0x29')](util['format'](_0xd130('0x37'),_0x2a25b5[_0xd130('0x23')]),_0x2a25b5);calls[_0xd130('0x38')](_0x2a25b5);recordings['hangup'](_0x2a25b5);dials['hangup'](_0x2a25b5);agents[_0xd130('0x38')](_0x2a25b5);queues[_0xd130('0x38')](_0x2a25b5);}catch(_0x268292){utils[_0xd130('0x1a')](util[_0xd130('0x20')](_0xd130('0x37'),_0x2a25b5['uniqueid']),_0x268292);}});ami['on'](_0xd130('0x39'),function(_0x399a16){try{utils[_0xd130('0x29')](util['format'](_0xd130('0x3a'),_0x399a16[_0xd130('0x23')]),_0x399a16);members[_0xd130('0x39')](_0x399a16);}catch(_0xd8b8e3){utils[_0xd130('0x1a')](util['format'](_0xd130('0x3a'),_0x399a16[_0xd130('0x23')]),_0xd8b8e3);}});ami['on'](_0xd130('0x3b'),function(_0x2d0fe8){try{utils[_0xd130('0x29')](util[_0xd130('0x20')]('[%s][index][blindtransfer]',_0x2d0fe8['uniqueid']),_0x2d0fe8);queues['blindtransfer'](_0x2d0fe8);agents[_0xd130('0x3b')](_0x2d0fe8);transfers[_0xd130('0x3b')](_0x2d0fe8);}catch(_0x2cab66){utils['error'](util['format'](_0xd130('0x3c'),_0x2d0fe8['uniqueid']),_0x2cab66);}});ami['on']('attendedtransfer',function(_0x57d6ef){try{utils['debug'](util[_0xd130('0x20')]('[%s][index][attendedtransfer]',_0x57d6ef['origtransfereruniqueid']),_0x57d6ef);queues[_0xd130('0x3d')](_0x57d6ef);transfers[_0xd130('0x3d')](_0x57d6ef);agents[_0xd130('0x3d')](_0x57d6ef);calls['attendedtransfer'](_0x57d6ef);}catch(_0x356aab){utils[_0xd130('0x1a')](util[_0xd130('0x20')](_0xd130('0x3e'),_0x57d6ef['origtransfereruniqueid']),_0x356aab);}});ami['on'](_0xd130('0x3f'),function(_0x6fa8d){try{utils[_0xd130('0x29')](util[_0xd130('0x20')](_0xd130('0x40'),_0x6fa8d[_0xd130('0x23')]),_0x6fa8d);queues['varset'](_0x6fa8d);recordings[_0xd130('0x3f')](_0x6fa8d);calls[_0xd130('0x3f')](_0x6fa8d);dials['varset'](_0x6fa8d);}catch(_0x47690f){utils[_0xd130('0x1a')](util[_0xd130('0x20')](_0xd130('0x40'),_0x6fa8d[_0xd130('0x23')]),_0x47690f);}});ami['on'](_0xd130('0x41'),function(_0x56edd5){try{utils['debug'](util[_0xd130('0x20')](_0xd130('0x42'),_0x56edd5[_0xd130('0x23')]),_0x56edd5);calls[_0xd130('0x41')](_0x56edd5);recordings['newexten'](_0x56edd5);dials['newexten'](_0x56edd5);}catch(_0x3693e8){utils[_0xd130('0x1a')](util[_0xd130('0x20')](_0xd130('0x42'),_0x56edd5[_0xd130('0x23')]),_0x3693e8);}});ami['on'](_0xd130('0x43'),function(_0x5b9719){try{utils[_0xd130('0x29')](util[_0xd130('0x20')](_0xd130('0x44'),_0x5b9719[_0xd130('0x23')]),_0x5b9719);calls[_0xd130('0x43')](_0x5b9719);recordings[_0xd130('0x43')](_0x5b9719);}catch(_0x3f8a17){utils[_0xd130('0x1a')](util[_0xd130('0x20')](_0xd130('0x44'),_0x5b9719[_0xd130('0x23')]),_0x3f8a17);}});ami['on']('dialbegin',function(_0x5cd416){try{utils[_0xd130('0x29')](util[_0xd130('0x20')](_0xd130('0x45'),_0x5cd416['uniqueid']),_0x5cd416);dials[_0xd130('0x46')](_0x5cd416);}catch(_0x52485f){utils[_0xd130('0x1a')](util['format'](_0xd130('0x47'),_0x5cd416[_0xd130('0x23')]),_0x52485f);}});ami['on'](_0xd130('0x48'),function(_0x48762c){try{utils[_0xd130('0x29')](util['format']('[%s][index][dialend]',_0x48762c[_0xd130('0x23')]),_0x48762c);dials['dialend'](_0x48762c);}catch(_0x511792){utils['error'](util[_0xd130('0x20')](_0xd130('0x49'),_0x48762c['uniqueid']),_0x511792);}});} \ No newline at end of file +var _0x587c=['hangup','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','attendedtransfer','origtransfereruniqueid','[%s][index][attendedtransfer]','varset','[%s][index][varset]','[%s][index][newexten]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','[%s][index][dialend]','dialend','./utils','util','disabled','xdr','env','production','local','asterisk','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./queues.controller','./members.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','format','device','devicestatechange','[%s][index][devicestatechange]','agentcalled','debug','uniqueid','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','[%s][index][agentconnect]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]'];(function(_0x38b9fd,_0x263607){var _0xbb6a98=function(_0x388bd7){while(--_0x388bd7){_0x38b9fd['push'](_0x38b9fd['shift']());}};_0xbb6a98(++_0x263607);}(_0x587c,0x1e7));var _0xc587=function(_0xa76208,_0xd46fa0){_0xa76208=_0xa76208-0x0;var _0x17ff8c=_0x587c[_0xa76208];return _0x17ff8c;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require(_0xc587('0x0'));var util=require(_0xc587('0x1'));var isXDREnabled=config['xdr']&&config['xdr'][_0xc587('0x2')]?!config[_0xc587('0x3')][_0xc587('0x2')]:!![];var isProduction=config[_0xc587('0x4')]===_0xc587('0x5')||![];var isLocalAsterisk=config[_0xc587('0x3')]&&config[_0xc587('0x3')][_0xc587('0x6')]===!![]||![];var ami=new AsteriskManager(config['asterisk']['port'],config[_0xc587('0x7')]['ip'],config['asterisk']['username'],config[_0xc587('0x7')]['password'],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0xc587('0x8')](_0xc587('0x9'));}else if(!isProduction&&!isLocalAsterisk){utils[_0xc587('0x8')](_0xc587('0xa'));}else{var agents=require('./agents.controller');var calls=require(_0xc587('0xb'));var queues=require(_0xc587('0xc'));var recordings=require('./recordings.controller');var members=require(_0xc587('0xd'));var dials=require('./dials.controller');var transfers=require(_0xc587('0xe'));var core=require(_0xc587('0xf'));ami['on'](_0xc587('0x10'),core['connect']);ami['on'](_0xc587('0x11'),core[_0xc587('0x11')]);ami['on'](_0xc587('0x12'),core[_0xc587('0x12')]);ami['on'](_0xc587('0x13'),core[_0xc587('0x13')]);ami['on'](_0xc587('0x14'),core[_0xc587('0x14')]);ami['on'](_0xc587('0x15'),core['managerevent']);ami['on']('devicestatechange',function(_0x2e1b69){try{utils['debug'](util[_0xc587('0x16')]('[%s][index][devicestatechange]',_0x2e1b69[_0xc587('0x17')]),_0x2e1b69);members[_0xc587('0x18')](_0x2e1b69);}catch(_0x5058cf){utils['error'](util['format'](_0xc587('0x19'),_0x2e1b69[_0xc587('0x17')]),_0x5058cf);}});ami['on'](_0xc587('0x1a'),function(_0x580ada){try{utils[_0xc587('0x1b')](util['format']('[%s][index][agentcalled]',_0x580ada[_0xc587('0x1c')]),_0x580ada);agents[_0xc587('0x1a')](_0x580ada);}catch(_0x19427f){utils[_0xc587('0x13')](util[_0xc587('0x16')](_0xc587('0x1d'),_0x580ada[_0xc587('0x1c')]),_0x19427f);}});ami['on'](_0xc587('0x1e'),function(_0x406dad){try{utils[_0xc587('0x1b')](util[_0xc587('0x16')]('[%s][index][agentringnoanswer]',_0x406dad[_0xc587('0x1c')]),_0x406dad);agents[_0xc587('0x1e')](_0x406dad);}catch(_0x10d46d){utils[_0xc587('0x13')](util[_0xc587('0x16')](_0xc587('0x1f'),_0x406dad[_0xc587('0x1c')]),_0x10d46d);}});ami['on']('agentconnect',function(_0x44afe0){try{utils[_0xc587('0x1b')](util[_0xc587('0x16')](_0xc587('0x20'),_0x44afe0['uniqueid']),_0x44afe0);agents[_0xc587('0x21')](_0x44afe0);queues['agentconnect'](_0x44afe0);}catch(_0x2fbb8d){utils[_0xc587('0x13')](util['format'](_0xc587('0x20'),_0x44afe0[_0xc587('0x1c')]),_0x2fbb8d);}});ami['on'](_0xc587('0x22'),function(_0x4e56eb){try{utils['debug'](util[_0xc587('0x16')](_0xc587('0x23'),_0x4e56eb[_0xc587('0x1c')]),_0x4e56eb);agents[_0xc587('0x22')](_0x4e56eb);queues[_0xc587('0x22')](_0x4e56eb);members['agentcomplete'](_0x4e56eb);}catch(_0x2cb508){utils[_0xc587('0x13')](util[_0xc587('0x16')](_0xc587('0x23'),_0x4e56eb['uniqueid']),_0x2cb508);}});ami['on'](_0xc587('0x24'),function(_0x370cf9){try{utils['debug'](util[_0xc587('0x16')](_0xc587('0x25'),_0x370cf9['uniqueid']),_0x370cf9);agents['queuecallerabandon'](_0x370cf9);queues[_0xc587('0x24')](_0x370cf9);}catch(_0x535498){utils[_0xc587('0x13')](util[_0xc587('0x16')]('[%s][index][queuecallerabandon]',_0x370cf9[_0xc587('0x1c')]),_0x535498);}});ami['on'](_0xc587('0x26'),function(_0x25e0cb){try{utils['debug'](util[_0xc587('0x16')](_0xc587('0x27'),_0x25e0cb[_0xc587('0x1c')]),_0x25e0cb);queues[_0xc587('0x26')](_0x25e0cb);recordings['queuecallerjoin'](_0x25e0cb);}catch(_0x19d74d){utils[_0xc587('0x13')](util[_0xc587('0x16')](_0xc587('0x27'),_0x25e0cb['uniqueid']),_0x19d74d);}});ami['on'](_0xc587('0x28'),function(_0xb18201){try{utils[_0xc587('0x1b')](util[_0xc587('0x16')](_0xc587('0x29'),_0xb18201[_0xc587('0x1c')]),_0xb18201);queues[_0xc587('0x28')](_0xb18201);}catch(_0x183cae){utils[_0xc587('0x13')](util[_0xc587('0x16')]('[%s][index][queuecallerleave]',_0xb18201['uniqueid']),_0x183cae);}});ami['on'](_0xc587('0x2a'),function(_0x13eb9c){try{utils[_0xc587('0x1b')](util[_0xc587('0x16')]('[%s][index][musiconholdstart]',_0x13eb9c['uniqueid']),_0x13eb9c);queues[_0xc587('0x2a')](_0x13eb9c);calls[_0xc587('0x2a')](_0x13eb9c);}catch(_0x228d45){utils[_0xc587('0x13')](util['format'](_0xc587('0x2b'),_0x13eb9c['uniqueid']),_0x228d45);}});ami['on'](_0xc587('0x2c'),function(_0x19bd8a){try{utils[_0xc587('0x1b')](util[_0xc587('0x16')](_0xc587('0x2d'),_0x19bd8a[_0xc587('0x1c')]),_0x19bd8a);queues['musiconholdstop'](_0x19bd8a);calls[_0xc587('0x2c')](_0x19bd8a);}catch(_0x3bbe39){utils[_0xc587('0x13')](util[_0xc587('0x16')](_0xc587('0x2d'),_0x19bd8a['uniqueid']),_0x3bbe39);}});ami['on'](_0xc587('0x2e'),function(_0x37f77e){try{utils['debug'](util[_0xc587('0x16')](_0xc587('0x2f'),_0x37f77e[_0xc587('0x1c')]),_0x37f77e);calls[_0xc587('0x2e')](_0x37f77e);recordings['newstate'](_0x37f77e);}catch(_0x1251bd){utils['error'](util[_0xc587('0x16')](_0xc587('0x2f'),_0x37f77e[_0xc587('0x1c')]),_0x1251bd);}});ami['on']('hangup',function(_0x34c829){try{utils[_0xc587('0x1b')](util[_0xc587('0x16')](_0xc587('0x30'),_0x34c829[_0xc587('0x1c')]),_0x34c829);calls['hangup'](_0x34c829);recordings['hangup'](_0x34c829);dials[_0xc587('0x31')](_0x34c829);agents['hangup'](_0x34c829);queues[_0xc587('0x31')](_0x34c829);}catch(_0x33e657){utils['error'](util[_0xc587('0x16')]('[%s][index][hangup]',_0x34c829[_0xc587('0x1c')]),_0x33e657);}});ami['on'](_0xc587('0x32'),function(_0x5d3ff2){try{utils[_0xc587('0x1b')](util[_0xc587('0x16')](_0xc587('0x33'),_0x5d3ff2[_0xc587('0x1c')]),_0x5d3ff2);members[_0xc587('0x32')](_0x5d3ff2);}catch(_0x27922b){utils[_0xc587('0x13')](util[_0xc587('0x16')](_0xc587('0x33'),_0x5d3ff2[_0xc587('0x1c')]),_0x27922b);}});ami['on']('blindtransfer',function(_0x243222){try{utils[_0xc587('0x1b')](util[_0xc587('0x16')](_0xc587('0x34'),_0x243222[_0xc587('0x1c')]),_0x243222);queues[_0xc587('0x35')](_0x243222);agents[_0xc587('0x35')](_0x243222);transfers['blindtransfer'](_0x243222);}catch(_0x308426){utils[_0xc587('0x13')](util[_0xc587('0x16')](_0xc587('0x34'),_0x243222[_0xc587('0x1c')]),_0x308426);}});ami['on'](_0xc587('0x36'),function(_0x229479){try{utils[_0xc587('0x1b')](util[_0xc587('0x16')]('[%s][index][attendedtransfer]',_0x229479[_0xc587('0x37')]),_0x229479);queues[_0xc587('0x36')](_0x229479);transfers['attendedtransfer'](_0x229479);agents[_0xc587('0x36')](_0x229479);calls[_0xc587('0x36')](_0x229479);}catch(_0x5ef9cf){utils['error'](util[_0xc587('0x16')](_0xc587('0x38'),_0x229479[_0xc587('0x37')]),_0x5ef9cf);}});ami['on']('varset',function(_0x1d08f6){try{utils['debug'](util[_0xc587('0x16')]('[%s][index][varset]',_0x1d08f6[_0xc587('0x1c')]),_0x1d08f6);queues[_0xc587('0x39')](_0x1d08f6);recordings['varset'](_0x1d08f6);calls[_0xc587('0x39')](_0x1d08f6);dials['varset'](_0x1d08f6);}catch(_0x3c4aaf){utils[_0xc587('0x13')](util[_0xc587('0x16')](_0xc587('0x3a'),_0x1d08f6['uniqueid']),_0x3c4aaf);}});ami['on']('newexten',function(_0x402d80){try{utils[_0xc587('0x1b')](util[_0xc587('0x16')](_0xc587('0x3b'),_0x402d80[_0xc587('0x1c')]),_0x402d80);calls[_0xc587('0x3c')](_0x402d80);recordings['newexten'](_0x402d80);dials['newexten'](_0x402d80);}catch(_0x4a9521){utils['error'](util['format']('[%s][index][newexten]',_0x402d80[_0xc587('0x1c')]),_0x4a9521);}});ami['on']('newchannel',function(_0x2e9549){try{utils[_0xc587('0x1b')](util['format']('[%s][index][newchannel]',_0x2e9549[_0xc587('0x1c')]),_0x2e9549);calls[_0xc587('0x3d')](_0x2e9549);recordings[_0xc587('0x3d')](_0x2e9549);}catch(_0x8393b2){utils[_0xc587('0x13')](util[_0xc587('0x16')](_0xc587('0x3e'),_0x2e9549[_0xc587('0x1c')]),_0x8393b2);}});ami['on'](_0xc587('0x3f'),function(_0x59001a){try{utils[_0xc587('0x1b')](util['format']('[%s][index][dialbegin]',_0x59001a['uniqueid']),_0x59001a);dials[_0xc587('0x3f')](_0x59001a);}catch(_0x1ecca5){utils[_0xc587('0x13')](util['format'](_0xc587('0x40'),_0x59001a[_0xc587('0x1c')]),_0x1ecca5);}});ami['on']('dialend',function(_0x2797df){try{utils[_0xc587('0x1b')](util['format'](_0xc587('0x41'),_0x2797df['uniqueid']),_0x2797df);dials[_0xc587('0x42')](_0x2797df);}catch(_0xb79619){utils[_0xc587('0x13')](util['format'](_0xc587('0x41'),_0x2797df['uniqueid']),_0xb79619);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 0224cf5..7ae2af6 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 _0x7c35=['internal','request','then','CreateMemberReport','error','[%s][members][writeDB]','some','devicestatechange','debug','device','state','BUSY','TALKING','now','isNil','exitAt','duration','diffTime','enterAt','[%s][members][devicestatechange]','[%s][members][agentcomplete]','queue','assign','cdr','[%s][members][cdr]','split','data1','data2','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','util','./utils','Local/_attended@transfer','Queue:','info','format','uniqueid','channel','type','interface','getUserByInterface','membername','name'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7c35,0x135));var _0x57c3=function(_0x5c57b6,_0x48fcfc){_0x5c57b6=_0x5c57b6-0x0;var _0x5423cc=_0x7c35[_0x5c57b6];return _0x5423cc;};'use strict';var _=require('lodash');var util=require(_0x57c3('0x0'));var utils=require(_0x57c3('0x1'));var members={};var exclude=[_0x57c3('0x2'),_0x57c3('0x3')];function writeDB(_0x23e38f){utils[_0x57c3('0x4')](util[_0x57c3('0x5')]('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0x23e38f[_0x57c3('0x6')],_0x23e38f['interface'],_0x23e38f[_0x57c3('0x7')],_0x23e38f['data2'],_0x23e38f['membername'],_0x23e38f[_0x57c3('0x8')]));if(_0x23e38f[_0x57c3('0x9')]){utils[_0x57c3('0xa')](_0x23e38f[_0x57c3('0x9')])['then'](function(_0x3b36e1){if(_0x3b36e1){_0x23e38f[_0x57c3('0xb')]=_0x3b36e1[_0x57c3('0xc')];_0x23e38f[_0x57c3('0xd')]=_0x3b36e1[_0x57c3('0xd')];utils[_0x57c3('0xe')]('CreateMemberReport',_0x23e38f);}else{utils['getUserByName'](_0x23e38f[_0x57c3('0x9')]['split']('/')[0x1])[_0x57c3('0xf')](function(_0x38a230){if(_0x38a230){_0x23e38f[_0x57c3('0xb')]=_0x38a230[_0x57c3('0xc')];_0x23e38f['internal']=_0x38a230[_0x57c3('0xd')];utils[_0x57c3('0xe')](_0x57c3('0x10'),_0x23e38f);}});}})['catch'](function(_0x3b0998){utils[_0x57c3('0x11')](util[_0x57c3('0x5')](_0x57c3('0x12'),_0x23e38f[_0x57c3('0x6')]),_0x3b0998);});}delete members[_0x23e38f[_0x57c3('0x9')]];}function startsWith(_0x836046,_0x444681){return _[_0x57c3('0x13')](_0x836046,function(_0x5e4306){return _['startsWith'](_0x444681,_0x5e4306);});}exports[_0x57c3('0x14')]=function(_0x1057a7){try{utils[_0x57c3('0x15')](util['format']('[%s][members][devicestatechange]',members[_0x1057a7[_0x57c3('0x16')]]?members[_0x1057a7[_0x57c3('0x16')]][_0x57c3('0x6')]:_0x1057a7['device']),_0x1057a7);utils[_0x57c3('0x4')](util[_0x57c3('0x5')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x1057a7[_0x57c3('0x16')]]?members[_0x1057a7[_0x57c3('0x16')]]['uniqueid']:_0x1057a7[_0x57c3('0x16')],_0x1057a7['state'],_0x1057a7[_0x57c3('0x16')]));switch(_0x1057a7[_0x57c3('0x17')]){case'INUSE':case _0x57c3('0x18'):if(!startsWith(exclude,_0x1057a7[_0x57c3('0x16')])){members[_0x1057a7[_0x57c3('0x16')]]={'channel':'voice','interface':_0x1057a7[_0x57c3('0x16')],'type':_0x57c3('0x19'),'enterAt':utils[_0x57c3('0x1a')](),'role':'agent'};}break;case'NOT_INUSE':if(!_[_0x57c3('0x1b')](members[_0x1057a7[_0x57c3('0x16')]])){members[_0x1057a7[_0x57c3('0x16')]][_0x57c3('0x1c')]=utils[_0x57c3('0x1a')]();members[_0x1057a7[_0x57c3('0x16')]][_0x57c3('0x1d')]=utils[_0x57c3('0x1e')](members[_0x1057a7[_0x57c3('0x16')]][_0x57c3('0x1c')],members[_0x1057a7[_0x57c3('0x16')]][_0x57c3('0x1f')]);if(members[_0x1057a7[_0x57c3('0x16')]][_0x57c3('0x6')]){writeDB(members[_0x1057a7[_0x57c3('0x16')]]);}}break;default:break;}}catch(_0x1d50de){utils[_0x57c3('0x11')](util[_0x57c3('0x5')](_0x57c3('0x20'),members[_0x1057a7['device']]?members[_0x1057a7[_0x57c3('0x16')]][_0x57c3('0x6')]:_0x1057a7[_0x57c3('0x16')]),_0x1d50de);}};exports['agentcomplete']=function(_0x5df784){try{if(!_[_0x57c3('0x1b')](members[_0x5df784[_0x57c3('0x9')]])){utils[_0x57c3('0x15')](util[_0x57c3('0x5')](_0x57c3('0x21'),_0x5df784[_0x57c3('0x6')]),_0x5df784);utils[_0x57c3('0x4')](util[_0x57c3('0x5')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x5df784[_0x57c3('0x6')],_0x5df784[_0x57c3('0x9')],_0x5df784[_0x57c3('0x22')]));members[_0x5df784[_0x57c3('0x9')]]=_[_0x57c3('0x23')](members[_0x5df784[_0x57c3('0x9')]],{'data4':_0x5df784[_0x57c3('0x22')],'uniqueid':_0x5df784[_0x57c3('0x6')]});}}catch(_0x19ab73){utils[_0x57c3('0x11')](util['format'](_0x57c3('0x21'),_0x5df784[_0x57c3('0x6')]),_0x19ab73);}};exports[_0x57c3('0x24')]=function(_0x395911){try{utils[_0x57c3('0x15')](util[_0x57c3('0x5')](_0x57c3('0x25'),_0x395911[_0x57c3('0x6')]),_0x395911);if(_0x395911[_0x57c3('0x7')]){var _0xada905=_0x395911[_0x57c3('0x7')][_0x57c3('0x26')]('-')[0x0];if(!_['isNil'](members[_0xada905])){members[_0xada905]=_['assign'](members[_0xada905],{'data1':members[_0xada905][_0x57c3('0x27')]||_0x395911['type'],'data2':members[_0xada905][_0x57c3('0x28')]||_0x395911[_0x57c3('0x29')],'data3':members[_0xada905][_0x57c3('0x2a')]||_0x395911[_0x57c3('0x2b')],'uniqueid':members[_0xada905]['uniqueid']||_0x395911[_0x57c3('0x6')]});utils[_0x57c3('0x4')](util[_0x57c3('0x5')](_0x57c3('0x2c'),_0x395911[_0x57c3('0x6')],members[_0xada905][_0x57c3('0x27')],members[_0xada905][_0x57c3('0x28')],members[_0xada905][_0x57c3('0x2a')]));if(members[_0xada905]['exitAt']){writeDB(members[_0xada905]);}}}if(_0x395911[_0x57c3('0x2d')]){var _0x8dc1fc=_0x395911[_0x57c3('0x2d')]['split']('-')[0x0];if(!_['isNil'](members[_0x8dc1fc])){members[_0x8dc1fc]=_['assign'](members[_0x8dc1fc],{'data1':members[_0x8dc1fc][_0x57c3('0x27')]||_0x395911[_0x57c3('0x8')],'data2':members[_0x8dc1fc][_0x57c3('0x28')]||_0x395911[_0x57c3('0x29')],'data3':members[_0x8dc1fc][_0x57c3('0x2a')]||_0x395911['destination'],'uniqueid':members[_0x8dc1fc]['uniqueid']||_0x395911['uniqueid']});utils[_0x57c3('0x4')](util[_0x57c3('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x395911[_0x57c3('0x6')],members[_0x8dc1fc][_0x57c3('0x27')],members[_0x8dc1fc][_0x57c3('0x28')],members[_0x8dc1fc][_0x57c3('0x2a')]));if(members[_0x8dc1fc][_0x57c3('0x1c')]){writeDB(members[_0x8dc1fc]);}}}}catch(_0x420864){utils[_0x57c3('0x11')](util['format'](_0x57c3('0x25'),_0x395911[_0x57c3('0x6')]),_0x420864);}}; \ No newline at end of file +var _0x0879=['some','startsWith','[%s][members][devicestatechange]','device','info','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','diffTime','enterAt','agentcomplete','debug','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','[%s][members][cdr]','channel','assign','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','Local/_attended@transfer','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','data2','membername','type','getUserByInterface','then','internal','CreateMemberReport','getUserByName','split','request','catch','error','[%s][members][writeDB]'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0879,0x1e9));var _0x9087=function(_0x547b5e,_0x1f8cfb){_0x547b5e=_0x547b5e-0x0;var _0x19a52f=_0x0879[_0x547b5e];return _0x19a52f;};'use strict';var _=require(_0x9087('0x0'));var util=require(_0x9087('0x1'));var utils=require('./utils');var members={};var exclude=[_0x9087('0x2'),_0x9087('0x3')];function writeDB(_0xcb07f0){utils['info'](util[_0x9087('0x4')](_0x9087('0x5'),_0xcb07f0[_0x9087('0x6')],_0xcb07f0[_0x9087('0x7')],_0xcb07f0['channel'],_0xcb07f0[_0x9087('0x8')],_0xcb07f0[_0x9087('0x9')],_0xcb07f0[_0x9087('0xa')]));if(_0xcb07f0[_0x9087('0x7')]){utils[_0x9087('0xb')](_0xcb07f0[_0x9087('0x7')])[_0x9087('0xc')](function(_0x5773ac){if(_0x5773ac){_0xcb07f0[_0x9087('0x9')]=_0x5773ac['name'];_0xcb07f0[_0x9087('0xd')]=_0x5773ac['internal'];utils['request'](_0x9087('0xe'),_0xcb07f0);}else{utils[_0x9087('0xf')](_0xcb07f0['interface'][_0x9087('0x10')]('/')[0x1])[_0x9087('0xc')](function(_0x922232){if(_0x922232){_0xcb07f0[_0x9087('0x9')]=_0x922232['name'];_0xcb07f0[_0x9087('0xd')]=_0x922232[_0x9087('0xd')];utils[_0x9087('0x11')]('CreateMemberReport',_0xcb07f0);}});}})[_0x9087('0x12')](function(_0x2a4b52){utils[_0x9087('0x13')](util['format'](_0x9087('0x14'),_0xcb07f0[_0x9087('0x6')]),_0x2a4b52);});}delete members[_0xcb07f0[_0x9087('0x7')]];}function startsWith(_0x1e52c7,_0x48192d){return _[_0x9087('0x15')](_0x1e52c7,function(_0x144521){return _[_0x9087('0x16')](_0x48192d,_0x144521);});}exports['devicestatechange']=function(_0x364d17){try{utils['debug'](util['format'](_0x9087('0x17'),members[_0x364d17['device']]?members[_0x364d17[_0x9087('0x18')]][_0x9087('0x6')]:_0x364d17[_0x9087('0x18')]),_0x364d17);utils[_0x9087('0x19')](util[_0x9087('0x4')](_0x9087('0x1a'),members[_0x364d17[_0x9087('0x18')]]?members[_0x364d17[_0x9087('0x18')]]['uniqueid']:_0x364d17['device'],_0x364d17[_0x9087('0x1b')],_0x364d17[_0x9087('0x18')]));switch(_0x364d17[_0x9087('0x1b')]){case _0x9087('0x1c'):case _0x9087('0x1d'):if(!startsWith(exclude,_0x364d17[_0x9087('0x18')])){members[_0x364d17['device']]={'channel':_0x9087('0x1e'),'interface':_0x364d17['device'],'type':_0x9087('0x1f'),'enterAt':utils[_0x9087('0x20')](),'role':_0x9087('0x21')};}break;case _0x9087('0x22'):if(!_[_0x9087('0x23')](members[_0x364d17['device']])){members[_0x364d17[_0x9087('0x18')]][_0x9087('0x24')]=utils[_0x9087('0x20')]();members[_0x364d17[_0x9087('0x18')]]['duration']=utils[_0x9087('0x25')](members[_0x364d17['device']][_0x9087('0x24')],members[_0x364d17[_0x9087('0x18')]][_0x9087('0x26')]);if(members[_0x364d17[_0x9087('0x18')]][_0x9087('0x6')]){writeDB(members[_0x364d17['device']]);}}break;default:break;}}catch(_0xd5cc4f){utils[_0x9087('0x13')](util['format'](_0x9087('0x17'),members[_0x364d17[_0x9087('0x18')]]?members[_0x364d17[_0x9087('0x18')]][_0x9087('0x6')]:_0x364d17[_0x9087('0x18')]),_0xd5cc4f);}};exports[_0x9087('0x27')]=function(_0x306386){try{if(!_[_0x9087('0x23')](members[_0x306386['interface']])){utils[_0x9087('0x28')](util[_0x9087('0x4')]('[%s][members][agentcomplete]',_0x306386[_0x9087('0x6')]),_0x306386);utils[_0x9087('0x19')](util['format'](_0x9087('0x29'),_0x306386['uniqueid'],_0x306386[_0x9087('0x7')],_0x306386['queue']));members[_0x306386[_0x9087('0x7')]]=_['assign'](members[_0x306386[_0x9087('0x7')]],{'data4':_0x306386['queue'],'uniqueid':_0x306386[_0x9087('0x6')]});}}catch(_0x4aa9b2){utils['error'](util[_0x9087('0x4')]('[%s][members][agentcomplete]',_0x306386[_0x9087('0x6')]),_0x4aa9b2);}};exports['cdr']=function(_0x44607d){try{utils['debug'](util['format'](_0x9087('0x2a'),_0x44607d[_0x9087('0x6')]),_0x44607d);if(_0x44607d[_0x9087('0x2b')]){var _0x293e4c=_0x44607d[_0x9087('0x2b')]['split']('-')[0x0];if(!_['isNil'](members[_0x293e4c])){members[_0x293e4c]=_[_0x9087('0x2c')](members[_0x293e4c],{'data1':members[_0x293e4c][_0x9087('0x2d')]||_0x44607d[_0x9087('0xa')],'data2':members[_0x293e4c][_0x9087('0x8')]||_0x44607d[_0x9087('0x2e')],'data3':members[_0x293e4c][_0x9087('0x2f')]||_0x44607d[_0x9087('0x30')],'uniqueid':members[_0x293e4c][_0x9087('0x6')]||_0x44607d['uniqueid']});utils[_0x9087('0x19')](util['format'](_0x9087('0x31'),_0x44607d[_0x9087('0x6')],members[_0x293e4c]['data1'],members[_0x293e4c][_0x9087('0x8')],members[_0x293e4c][_0x9087('0x2f')]));if(members[_0x293e4c][_0x9087('0x24')]){writeDB(members[_0x293e4c]);}}}if(_0x44607d[_0x9087('0x32')]){var _0x54fdf3=_0x44607d[_0x9087('0x32')]['split']('-')[0x0];if(!_[_0x9087('0x23')](members[_0x54fdf3])){members[_0x54fdf3]=_[_0x9087('0x2c')](members[_0x54fdf3],{'data1':members[_0x54fdf3][_0x9087('0x2d')]||_0x44607d[_0x9087('0xa')],'data2':members[_0x54fdf3][_0x9087('0x8')]||_0x44607d['source'],'data3':members[_0x54fdf3][_0x9087('0x2f')]||_0x44607d['destination'],'uniqueid':members[_0x54fdf3]['uniqueid']||_0x44607d['uniqueid']});utils[_0x9087('0x19')](util[_0x9087('0x4')](_0x9087('0x31'),_0x44607d[_0x9087('0x6')],members[_0x54fdf3][_0x9087('0x2d')],members[_0x54fdf3][_0x9087('0x8')],members[_0x54fdf3][_0x9087('0x2f')]));if(members[_0x54fdf3]['exitAt']){writeDB(members[_0x54fdf3]);}}}}catch(_0x5af51b){utils[_0x9087('0x13')](util[_0x9087('0x4')](_0x9087('0x2a'),_0x44607d[_0x9087('0x6')]),_0x5af51b);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index a967ced..2535457 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 _0x7055=['clone','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','secondtransfereruniqueid','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]','lodash','util','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','queue','getVoiceQueueByName','then','type','CreateVoiceQueueReport','request','transfereduniqueid','uniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','connectedlinenum','connectedlinename','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','queuecallerenterreason'];(function(_0x4eebac,_0xeb7c9f){var _0x37f719=function(_0x549c70){while(--_0x549c70){_0x4eebac['push'](_0x4eebac['shift']());}};_0x37f719(++_0xeb7c9f);}(_0x7055,0x1af));var _0x5705=function(_0x3902c1,_0x1c9eb2){_0x3902c1=_0x3902c1-0x0;var _0x1266cc=_0x7055[_0x3902c1];return _0x1266cc;};'use strict';var _=require(_0x5705('0x0'));var util=require(_0x5705('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x3f3412){utils[_0x5705('0x2')](util[_0x5705('0x3')](_0x5705('0x4'),_0x3f3412['uniqueid'],_0x3f3412[_0x5705('0x5')],_0x3f3412['queue'],_0x3f3412[_0x5705('0x6')],_0x3f3412[_0x5705('0x7')],_0x3f3412[_0x5705('0x8')],_0x3f3412[_0x5705('0x9')]));if(_0x3f3412[_0x5705('0xa')]){utils[_0x5705('0xb')](_0x3f3412['queue'])[_0x5705('0xc')](function(_0x16d3c8){if(_0x16d3c8){_0x3f3412[_0x5705('0xd')]=_0x16d3c8[_0x5705('0xd')];}utils['request'](_0x5705('0xe'),_0x3f3412);});}else{utils[_0x5705('0xf')](_0x5705('0xe'),_0x3f3412);}if(_0x3f3412['transfereduniqueid']){delete queues[_0x3f3412[_0x5705('0x10')]];}else{delete queues[_0x3f3412[_0x5705('0x11')]];}}exports[_0x5705('0x12')]=function(_0x1a2e6e){try{utils[_0x5705('0x13')](util[_0x5705('0x3')](_0x5705('0x14'),_0x1a2e6e[_0x5705('0x11')]),_0x1a2e6e);utils[_0x5705('0x2')](util[_0x5705('0x3')](_0x5705('0x15'),_0x1a2e6e[_0x5705('0x11')],_0x1a2e6e['queue'],_0x1a2e6e[_0x5705('0x16')]));queues[_0x1a2e6e[_0x5705('0x11')]]=_[_0x5705('0x17')](_0x1a2e6e,{'originalposition':_0x1a2e6e[_0x5705('0x16')],'queuecallerjoinAt':utils[_0x5705('0x18')](),'mohtime':0x0});}catch(_0x442cd2){utils[_0x5705('0x19')](util['format'](_0x5705('0x14'),_0x1a2e6e['uniqueid']),_0x442cd2);}};exports[_0x5705('0x1a')]=function(_0x461502){try{if(!_[_0x5705('0x1b')](queues[_0x461502[_0x5705('0x11')]])){utils['debug'](util[_0x5705('0x3')](_0x5705('0x1c'),_0x461502[_0x5705('0x11')]),_0x461502);if(queues[_0x461502[_0x5705('0x11')]][_0x5705('0x1d')]){if(!queues[_0x461502['uniqueid']][_0x5705('0x1e')]&&!queues[_0x461502[_0x5705('0x11')]]['queuecallerexit']){queues[_0x461502[_0x5705('0x11')]][_0x5705('0x1f')]=!![];queues[_0x461502['uniqueid']][_0x5705('0x20')]=utils[_0x5705('0x18')]();queues[_0x461502[_0x5705('0x11')]]['queuecallerexitreason']=_0x5705('0x21');}utils[_0x5705('0x2')](util['format'](_0x5705('0x22'),_0x461502[_0x5705('0x11')],queues[_0x461502[_0x5705('0x11')]][_0x5705('0x23')],queues[_0x461502[_0x5705('0x11')]][_0x5705('0x9')]));writeDB(queues[_0x461502[_0x5705('0x11')]]);}else if(queues[_0x461502[_0x5705('0x11')]][_0x5705('0x10')]){utils[_0x5705('0x2')](util[_0x5705('0x3')](_0x5705('0x24'),_0x461502[_0x5705('0x11')],queues[_0x461502['uniqueid']][_0x5705('0x23')],queues[_0x461502[_0x5705('0x11')]][_0x5705('0x10')]));queues[queues[_0x461502['uniqueid']][_0x5705('0x10')]]=queues[_0x461502[_0x5705('0x11')]];queues[queues[_0x461502[_0x5705('0x11')]][_0x5705('0x10')]]['queuecallerenterreason']=0x2;delete queues[_0x461502[_0x5705('0x11')]];}}}catch(_0x424b82){utils[_0x5705('0x19')](util[_0x5705('0x3')](_0x5705('0x1c'),_0x461502[_0x5705('0x11')]),_0x424b82);}};exports['varset']=function(_0x1d81c2){try{utils[_0x5705('0x13')](util[_0x5705('0x3')](_0x5705('0x25'),_0x1d81c2[_0x5705('0x11')]),_0x1d81c2);if(!_[_0x5705('0x1b')](_0x1d81c2[_0x5705('0x26')][_0x5705('0x27')])&&_0x1d81c2[_0x5705('0x28')][_0x5705('0x29')]()!==_0x5705('0x2a')){if(!_['isNil'](queues[_0x1d81c2[_0x5705('0x11')]])){queues[_0x1d81c2[_0x5705('0x11')]][_0x5705('0x1e')]=![];queues[_0x1d81c2[_0x5705('0x11')]][_0x5705('0x2b')]=null;queues[_0x1d81c2[_0x5705('0x11')]][_0x5705('0x2c')]=!![];queues[_0x1d81c2[_0x5705('0x11')]]['queuecallerexitAt']=utils['now']();queues[_0x1d81c2[_0x5705('0x11')]][_0x5705('0x9')]=_0x1d81c2['value'][_0x5705('0x29')]();utils['info'](util['format'](_0x5705('0x2d'),_0x1d81c2[_0x5705('0x11')],queues[_0x1d81c2[_0x5705('0x11')]][_0x5705('0x23')],_0x1d81c2[_0x5705('0x28')],queues[_0x1d81c2['uniqueid']][_0x5705('0x9')]));writeDB(queues[_0x1d81c2[_0x5705('0x11')]]);}}else if(!_['isNil'](_0x1d81c2['variable'][_0x5705('0x2e')])){if(!_[_0x5705('0x1b')](queues[_0x1d81c2[_0x5705('0x11')]])&&!queues[_0x1d81c2[_0x5705('0x11')]][_0x5705('0x1e')]){queues[_0x1d81c2[_0x5705('0x11')]][_0x5705('0x1e')]=![];queues[_0x1d81c2['uniqueid']][_0x5705('0x2b')]=null;queues[_0x1d81c2[_0x5705('0x11')]]['queuecallerexit']=!![];queues[_0x1d81c2['uniqueid']][_0x5705('0x2f')]=utils[_0x5705('0x18')]();queues[_0x1d81c2[_0x5705('0x11')]][_0x5705('0x9')]=_0x5705('0x30');utils['info'](util[_0x5705('0x3')](_0x5705('0x31'),_0x1d81c2[_0x5705('0x11')],queues[_0x1d81c2[_0x5705('0x11')]][_0x5705('0x23')],_0x1d81c2['value'],queues[_0x1d81c2[_0x5705('0x11')]]['queuecallerexitreason']));}}}catch(_0x250cd0){utils['error'](util[_0x5705('0x3')](_0x5705('0x25'),_0x1d81c2['uniqueid']),_0x250cd0);}};exports[_0x5705('0x1e')]=function(_0x63e603){try{if(!_[_0x5705('0x1b')](queues[_0x63e603[_0x5705('0x11')]])){utils[_0x5705('0x13')](util[_0x5705('0x3')](_0x5705('0x32'),_0x63e603[_0x5705('0x11')]),_0x63e603);queues[_0x63e603[_0x5705('0x11')]][_0x5705('0x2c')]=![];queues[_0x63e603[_0x5705('0x11')]][_0x5705('0x2f')]=null;queues[_0x63e603[_0x5705('0x11')]][_0x5705('0x1e')]=!![];queues[_0x63e603[_0x5705('0x11')]][_0x5705('0x2b')]=utils[_0x5705('0x18')]();queues[_0x63e603['uniqueid']][_0x5705('0x9')]='ABANDONED';utils[_0x5705('0x2')](util[_0x5705('0x3')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x63e603[_0x5705('0x11')],queues[_0x63e603[_0x5705('0x11')]][_0x5705('0x23')],queues[_0x63e603[_0x5705('0x11')]]['queuecallerexitreason']));}}catch(_0x7a910f){utils[_0x5705('0x19')](util[_0x5705('0x3')](_0x5705('0x32'),_0x63e603['uniqueid']),_0x7a910f);}};exports[_0x5705('0x33')]=function(_0x2d0b7b){try{if(!_[_0x5705('0x1b')](queues[_0x2d0b7b[_0x5705('0x11')]])){utils['debug'](util[_0x5705('0x3')](_0x5705('0x34'),_0x2d0b7b[_0x5705('0x11')]),_0x2d0b7b);utils[_0x5705('0x2')](util['format']('[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x2d0b7b[_0x5705('0x11')],queues[_0x2d0b7b[_0x5705('0x11')]][_0x5705('0x23')],_0x2d0b7b[_0x5705('0x35')],_0x2d0b7b[_0x5705('0x36')]));queues[_0x2d0b7b['uniqueid']]['queuecallerleave']=!![];queues[_0x2d0b7b[_0x5705('0x11')]][_0x5705('0x1d')]=utils[_0x5705('0x18')]();queues[_0x2d0b7b['uniqueid']]['holdtime']=utils[_0x5705('0x37')](queues[_0x2d0b7b['uniqueid']][_0x5705('0x1d')],queues[_0x2d0b7b[_0x5705('0x11')]][_0x5705('0x38')]);queues[_0x2d0b7b[_0x5705('0x11')]]['position']=_0x2d0b7b[_0x5705('0x16')];queues[_0x2d0b7b[_0x5705('0x11')]]['count']=_0x2d0b7b[_0x5705('0x39')];queues[_0x2d0b7b[_0x5705('0x11')]]['connectedlinenum']=_0x2d0b7b[_0x5705('0x35')];queues[_0x2d0b7b[_0x5705('0x11')]][_0x5705('0x36')]=_0x2d0b7b[_0x5705('0x36')];}}catch(_0x480e25){utils['error'](util[_0x5705('0x3')](_0x5705('0x34'),_0x2d0b7b[_0x5705('0x11')]),_0x480e25);}};exports[_0x5705('0x3a')]=function(_0x503b36){try{if(!_[_0x5705('0x1b')](queues[_0x503b36[_0x5705('0x11')]])){utils[_0x5705('0x13')](util[_0x5705('0x3')](_0x5705('0x3b'),_0x503b36[_0x5705('0x11')]),_0x503b36);utils['info'](util[_0x5705('0x3')](_0x5705('0x3c'),_0x503b36[_0x5705('0x11')],queues[_0x503b36['uniqueid']][_0x5705('0x23')],_0x503b36[_0x5705('0x3d')],_0x503b36[_0x5705('0x3e')]));queues[_0x503b36[_0x5705('0x11')]][_0x5705('0x1e')]=![];queues[_0x503b36[_0x5705('0x11')]][_0x5705('0x1e')]=![];queues[_0x503b36['uniqueid']][_0x5705('0x2b')]=null;queues[_0x503b36[_0x5705('0x11')]][_0x5705('0x2c')]=![];queues[_0x503b36[_0x5705('0x11')]][_0x5705('0x9')]=null;queues[_0x503b36[_0x5705('0x11')]]['queuecallerexitAt']=null;queues[_0x503b36[_0x5705('0x11')]]['assigned']=!![];queues[_0x503b36['uniqueid']][_0x5705('0x8')]=_0x503b36[_0x5705('0x3e')];queues[_0x503b36[_0x5705('0x11')]][_0x5705('0x6')]=_0x503b36[_0x5705('0x3d')];}}catch(_0x36ed83){utils[_0x5705('0x19')](util['format'](_0x5705('0x3b'),_0x503b36[_0x5705('0x11')]),_0x36ed83);}};exports[_0x5705('0x3f')]=function(_0x2d11fe){try{if(!_[_0x5705('0x1b')](queues[_0x2d11fe['uniqueid']])){if(queues[_0x2d11fe[_0x5705('0x11')]][_0x5705('0x1d')]){utils[_0x5705('0x13')](util[_0x5705('0x3')](_0x5705('0x40'),_0x2d11fe[_0x5705('0x11')]),_0x2d11fe);queues[_0x2d11fe[_0x5705('0x11')]][_0x5705('0x1e')]=![];queues[_0x2d11fe[_0x5705('0x11')]][_0x5705('0x1e')]=![];queues[_0x2d11fe[_0x5705('0x11')]][_0x5705('0x2b')]=null;queues[_0x2d11fe[_0x5705('0x11')]][_0x5705('0x2c')]=![];queues[_0x2d11fe[_0x5705('0x11')]]['queuecallerexitAt']=null;queues[_0x2d11fe[_0x5705('0x11')]]['assigned']=!![];queues[_0x2d11fe['uniqueid']][_0x5705('0x6')]=_0x2d11fe[_0x5705('0x3d')];queues[_0x2d11fe[_0x5705('0x11')]]['queuecallercomplete']=!![];queues[_0x2d11fe[_0x5705('0x11')]][_0x5705('0x20')]=utils['now']();if(_0x2d11fe[_0x5705('0x41')]==_0x5705('0x42')){if(!queues[_0x2d11fe[_0x5705('0x11')]][_0x5705('0x42')]){queues[_0x2d11fe[_0x5705('0x11')]][_0x5705('0x9')]=_0x5705('0x43');}}else{queues[_0x2d11fe[_0x5705('0x11')]][_0x5705('0x9')]='COMPLETEDBY'+_0x2d11fe[_0x5705('0x41')][_0x5705('0x29')]();}utils[_0x5705('0x2')](util[_0x5705('0x3')](_0x5705('0x44'),_0x2d11fe['uniqueid'],queues[_0x2d11fe['uniqueid']]['name'],_0x2d11fe[_0x5705('0x3d')],queues[_0x2d11fe[_0x5705('0x11')]][_0x5705('0x9')]));writeDB(queues[_0x2d11fe[_0x5705('0x11')]]);}}}catch(_0x186c26){utils[_0x5705('0x19')](util[_0x5705('0x3')](_0x5705('0x40'),_0x2d11fe[_0x5705('0x11')]),_0x186c26);}};exports[_0x5705('0x45')]=function(_0x46676d){try{if(!_['isNil'](queues[_0x46676d['transfereeuniqueid']])){utils[_0x5705('0x13')](util['format']('[%s][queues][blindtransfer]',_0x46676d[_0x5705('0x11')]),_0x46676d);queues[_0x46676d[_0x5705('0x46')]][_0x5705('0x42')]=!![];queues[_0x46676d[_0x5705('0x46')]][_0x5705('0x47')]=_0x5705('0x48');queues[_0x46676d[_0x5705('0x46')]][_0x5705('0x49')]=_0x46676d[_0x5705('0x4a')];queues[_0x46676d[_0x5705('0x46')]][_0x5705('0x4b')]=_0x46676d[_0x5705('0x46')];queues[_0x46676d[_0x5705('0x46')]][_0x5705('0x9')]=_0x5705('0x4c');utils[_0x5705('0x2')](util[_0x5705('0x3')](_0x5705('0x4d'),_0x46676d[_0x5705('0x11')],queues[_0x46676d[_0x5705('0x46')]][_0x5705('0x23')],_0x46676d['transfereeuniqueid'],_0x46676d['extension']));}}catch(_0x3b38a1){utils[_0x5705('0x19')](util[_0x5705('0x3')](_0x5705('0x4e'),_0x46676d[_0x5705('0x11')]),_0x3b38a1);}};exports[_0x5705('0x4f')]=function(_0x4f8c95){try{utils['debug'](util['format']('[%s][queues][attendedtransfer]',_0x4f8c95[_0x5705('0x50')]),_0x4f8c95);if(_0x4f8c95[_0x5705('0x50')]==_0x4f8c95['origtransfererlinkedid']){if(!_['isNil'](queues[_0x4f8c95[_0x5705('0x51')]])){utils[_0x5705('0x2')](util[_0x5705('0x3')](_0x5705('0x52'),_0x4f8c95[_0x5705('0x50')],queues[_0x4f8c95['secondtransfererlinkedid']][_0x5705('0x23')],_0x4f8c95[_0x5705('0x53')]));queues[_0x4f8c95['secondtransfererlinkedid']][_0x5705('0x42')]=!![];queues[_0x4f8c95[_0x5705('0x51')]][_0x5705('0x47')]=_0x5705('0x54');queues[_0x4f8c95[_0x5705('0x51')]][_0x5705('0x49')]=_0x4f8c95[_0x5705('0x53')];queues[_0x4f8c95[_0x5705('0x51')]][_0x5705('0x4b')]=_0x4f8c95[_0x5705('0x50')];queues[_0x4f8c95[_0x5705('0x51')]][_0x5705('0x9')]=_0x5705('0x55');}if(!_[_0x5705('0x1b')](queues[_0x4f8c95[_0x5705('0x56')]])){if(_0x4f8c95[_0x5705('0x57')]&&queues[_0x4f8c95['transfereelinkedid']]){queues[_0x4f8c95[_0x5705('0x57')]][_0x5705('0x58')]=0x1;queues[_0x4f8c95[_0x5705('0x46')]]=_[_0x5705('0x59')](queues[_0x4f8c95[_0x5705('0x57')]]);queues[_0x4f8c95[_0x5705('0x46')]]['transfereduniqueid']=_0x4f8c95['transfertargetuniqueid'];queues[_0x4f8c95['transfereeuniqueid']][_0x5705('0x58')]=0x2;queues[_0x4f8c95[_0x5705('0x46')]][_0x5705('0x7')]=queues[_0x4f8c95[_0x5705('0x51')]][_0x5705('0x7')];queues[_0x4f8c95[_0x5705('0x46')]][_0x5705('0x5a')]=queues[_0x4f8c95[_0x5705('0x51')]][_0x5705('0x5a')];queues[_0x4f8c95[_0x5705('0x46')]]['queuecallerjoinAt']=utils['now']();queues[_0x4f8c95['transfereeuniqueid']][_0x5705('0x1d')]=utils[_0x5705('0x18')]();queues[_0x4f8c95[_0x5705('0x46')]]['holdtime']=0x0;queues[_0x4f8c95['transfereeuniqueid']][_0x5705('0x5b')]=0x0;utils[_0x5705('0x2')](util[_0x5705('0x3')](_0x5705('0x5c'),_0x4f8c95['origtransfereruniqueid'],queues[_0x4f8c95['transfereeuniqueid']][_0x5705('0x23')],queues[_0x4f8c95[_0x5705('0x46')]][_0x5705('0x7')],queues[_0x4f8c95[_0x5705('0x46')]][_0x5705('0x5a')]));}else{utils[_0x5705('0x2')](util[_0x5705('0x3')](_0x5705('0x5d'),_0x4f8c95[_0x5705('0x50')],queues[_0x4f8c95[_0x5705('0x56')]][_0x5705('0x23')],_0x4f8c95[_0x5705('0x51')]));queues[_0x4f8c95[_0x5705('0x56')]]['transfereduniqueid']=_0x4f8c95['secondtransfererlinkedid'];}}}else if(_0x4f8c95['secondtransfereruniqueid']==_0x4f8c95['secondtransfererlinkedid']){if(!_['isNil'](queues[_0x4f8c95[_0x5705('0x56')]])){utils[_0x5705('0x2')](util[_0x5705('0x3')](_0x5705('0x5e'),_0x4f8c95[_0x5705('0x50')],queues[_0x4f8c95[_0x5705('0x56')]][_0x5705('0x23')],_0x4f8c95['secondtransfereruniqueid'],_0x4f8c95[_0x5705('0x5f')]));queues[_0x4f8c95[_0x5705('0x56')]][_0x5705('0x42')]=!![];queues[_0x4f8c95['origtransfererlinkedid']][_0x5705('0x47')]='ATTENDED';queues[_0x4f8c95['origtransfererlinkedid']][_0x5705('0x49')]=_0x4f8c95[_0x5705('0x5f')];queues[_0x4f8c95[_0x5705('0x56')]]['transferuniqueid']=_0x4f8c95[_0x5705('0x60')];queues[_0x4f8c95[_0x5705('0x56')]][_0x5705('0x9')]=_0x5705('0x55');}if(!_[_0x5705('0x1b')](queues[_0x4f8c95[_0x5705('0x51')]])){if(_0x4f8c95['transfertargetlinkedid']&&queues[_0x4f8c95[_0x5705('0x61')]]){queues[_0x4f8c95['transfertargetlinkedid']][_0x5705('0x58')]=0x1;queues[_0x4f8c95[_0x5705('0x62')]]=_[_0x5705('0x59')](queues[_0x4f8c95['transfertargetlinkedid']]);queues[_0x4f8c95[_0x5705('0x62')]][_0x5705('0x10')]=_0x4f8c95['transfertargetuniqueid'];queues[_0x4f8c95[_0x5705('0x62')]][_0x5705('0x58')]=0x2;queues[_0x4f8c95[_0x5705('0x62')]][_0x5705('0x7')]=queues[_0x4f8c95['origtransfererlinkedid']][_0x5705('0x7')];queues[_0x4f8c95[_0x5705('0x62')]][_0x5705('0x5a')]=queues[_0x4f8c95[_0x5705('0x56')]][_0x5705('0x5a')];queues[_0x4f8c95['transfertargetuniqueid']][_0x5705('0x38')]=utils['now']();queues[_0x4f8c95[_0x5705('0x62')]]['queuecallerleaveAt']=utils[_0x5705('0x18')]();queues[_0x4f8c95[_0x5705('0x62')]]['holdtime']=0x0;queues[_0x4f8c95[_0x5705('0x62')]][_0x5705('0x5b')]=0x0;utils[_0x5705('0x2')](util[_0x5705('0x3')](_0x5705('0x63'),_0x4f8c95[_0x5705('0x50')],queues[_0x4f8c95['transfertargetuniqueid']][_0x5705('0x23')],queues[_0x4f8c95[_0x5705('0x62')]][_0x5705('0x10')],queues[_0x4f8c95[_0x5705('0x62')]][_0x5705('0x7')],queues[_0x4f8c95[_0x5705('0x62')]]['calleridname']));}else{utils[_0x5705('0x2')](util[_0x5705('0x3')](_0x5705('0x5d'),_0x4f8c95[_0x5705('0x50')],queues[_0x4f8c95[_0x5705('0x51')]][_0x5705('0x23')],_0x4f8c95['origtransfererlinkedid']));queues[_0x4f8c95[_0x5705('0x51')]]['transfereduniqueid']=_0x4f8c95[_0x5705('0x56')];}}}}catch(_0x2605e7){utils[_0x5705('0x19')](util[_0x5705('0x3')](_0x5705('0x64'),_0x4f8c95[_0x5705('0x50')]),_0x2605e7);}};exports['musiconholdstart']=function(_0x15c484){try{if(!_[_0x5705('0x1b')](queues[_0x15c484['uniqueid']])){utils['debug'](util['format'](_0x5705('0x65'),_0x15c484[_0x5705('0x11')]),_0x15c484);queues[_0x15c484[_0x5705('0x11')]]['musiconholdstartAt']=utils['now']();utils['info'](util[_0x5705('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0x15c484['uniqueid'],queues[_0x15c484[_0x5705('0x11')]][_0x5705('0x23')],queues[_0x15c484['uniqueid']][_0x5705('0x66')]));}}catch(_0x799df6){utils[_0x5705('0x19')](util['format'](_0x5705('0x65'),_0x15c484[_0x5705('0x11')]),_0x799df6);}};exports['musiconholdstop']=function(_0x6ce1b6){try{if(!_['isNil'](queues[_0x6ce1b6[_0x5705('0x11')]])){if(!_[_0x5705('0x1b')](queues[_0x6ce1b6[_0x5705('0x11')]][_0x5705('0x66')])){utils[_0x5705('0x13')](util[_0x5705('0x3')]('[%s][queues][musiconholdstop]',_0x6ce1b6[_0x5705('0x11')]),_0x6ce1b6);queues[_0x6ce1b6[_0x5705('0x11')]][_0x5705('0x5b')]+=utils[_0x5705('0x37')](utils['now'](),queues[_0x6ce1b6[_0x5705('0x11')]][_0x5705('0x66')]);utils['info'](util[_0x5705('0x3')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x6ce1b6[_0x5705('0x11')],queues[_0x6ce1b6[_0x5705('0x11')]][_0x5705('0x23')],queues[_0x6ce1b6['uniqueid']]['mohtime']));delete queues[_0x6ce1b6['uniqueid']]['musiconholdstartAt'];}}}catch(_0x8f22ed){utils[_0x5705('0x19')](util[_0x5705('0x3')](_0x5705('0x67'),_0x6ce1b6[_0x5705('0x11')]),_0x8f22ed);}}; \ No newline at end of file +var _0xd6a2=['info','uniqueid','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','queue','then','type','request','CreateVoiceQueueReport','queuecallerjoin','format','[%s][queues][queuecallerjoin]','assign','position','now','error','hangup','isNil','debug','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','transfereduniqueid','name','queuecallerenterreason','[%s][queues][hangup]','[%s][queues][varset]','variable','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][queuecallerabandon]','ABANDONED','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','destaccountcode','membername','agentcomplete','[%s][queues][agentcomplete]','assigned','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','BLIND','extension','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','origtransfererexten','transfertype','transferexten','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util'];(function(_0x4873d5,_0xfde78b){var _0x208bb4=function(_0x4e3c9c){while(--_0x4e3c9c){_0x4873d5['push'](_0x4873d5['shift']());}};_0x208bb4(++_0xfde78b);}(_0xd6a2,0xcc));var _0x2d6a=function(_0x5b9c3c,_0x3a6d8f){_0x5b9c3c=_0x5b9c3c-0x0;var _0x45a450=_0xd6a2[_0x5b9c3c];return _0x45a450;};'use strict';var _=require(_0x2d6a('0x0'));var util=require(_0x2d6a('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x10bf37){utils[_0x2d6a('0x2')](util['format']('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x10bf37[_0x2d6a('0x3')],_0x10bf37['channel'],_0x10bf37['queue'],_0x10bf37[_0x2d6a('0x4')],_0x10bf37[_0x2d6a('0x5')],_0x10bf37[_0x2d6a('0x6')],_0x10bf37[_0x2d6a('0x7')]));if(_0x10bf37['queue']){utils[_0x2d6a('0x8')](_0x10bf37[_0x2d6a('0x9')])[_0x2d6a('0xa')](function(_0x21e43f){if(_0x21e43f){_0x10bf37[_0x2d6a('0xb')]=_0x21e43f[_0x2d6a('0xb')];}utils[_0x2d6a('0xc')](_0x2d6a('0xd'),_0x10bf37);});}else{utils['request']('CreateVoiceQueueReport',_0x10bf37);}if(_0x10bf37['transfereduniqueid']){delete queues[_0x10bf37['transfereduniqueid']];}else{delete queues[_0x10bf37[_0x2d6a('0x3')]];}}exports[_0x2d6a('0xe')]=function(_0x45c142){try{utils['debug'](util[_0x2d6a('0xf')](_0x2d6a('0x10'),_0x45c142[_0x2d6a('0x3')]),_0x45c142);utils[_0x2d6a('0x2')](util[_0x2d6a('0xf')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x45c142[_0x2d6a('0x3')],_0x45c142[_0x2d6a('0x9')],_0x45c142['position']));queues[_0x45c142[_0x2d6a('0x3')]]=_[_0x2d6a('0x11')](_0x45c142,{'originalposition':_0x45c142[_0x2d6a('0x12')],'queuecallerjoinAt':utils[_0x2d6a('0x13')](),'mohtime':0x0});}catch(_0x44e321){utils[_0x2d6a('0x14')](util[_0x2d6a('0xf')](_0x2d6a('0x10'),_0x45c142[_0x2d6a('0x3')]),_0x44e321);}};exports[_0x2d6a('0x15')]=function(_0x8e6762){try{if(!_[_0x2d6a('0x16')](queues[_0x8e6762[_0x2d6a('0x3')]])){utils[_0x2d6a('0x17')](util[_0x2d6a('0xf')]('[%s][queues][hangup]',_0x8e6762[_0x2d6a('0x3')]),_0x8e6762);if(queues[_0x8e6762[_0x2d6a('0x3')]][_0x2d6a('0x18')]){if(!queues[_0x8e6762[_0x2d6a('0x3')]][_0x2d6a('0x19')]&&!queues[_0x8e6762['uniqueid']]['queuecallerexit']){queues[_0x8e6762['uniqueid']][_0x2d6a('0x1a')]=!![];queues[_0x8e6762[_0x2d6a('0x3')]]['queuecallercompleteAt']=utils[_0x2d6a('0x13')]();queues[_0x8e6762[_0x2d6a('0x3')]]['queuecallerexitreason']='COMPLETEDBYAGENT';}utils[_0x2d6a('0x2')](util['format'](_0x2d6a('0x1b'),_0x8e6762[_0x2d6a('0x3')],queues[_0x8e6762['uniqueid']]['name'],queues[_0x8e6762['uniqueid']][_0x2d6a('0x7')]));writeDB(queues[_0x8e6762[_0x2d6a('0x3')]]);}else if(queues[_0x8e6762[_0x2d6a('0x3')]][_0x2d6a('0x1c')]){utils[_0x2d6a('0x2')](util[_0x2d6a('0xf')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x8e6762['uniqueid'],queues[_0x8e6762[_0x2d6a('0x3')]][_0x2d6a('0x1d')],queues[_0x8e6762[_0x2d6a('0x3')]][_0x2d6a('0x1c')]));queues[queues[_0x8e6762['uniqueid']][_0x2d6a('0x1c')]]=queues[_0x8e6762[_0x2d6a('0x3')]];queues[queues[_0x8e6762[_0x2d6a('0x3')]][_0x2d6a('0x1c')]][_0x2d6a('0x1e')]=0x2;delete queues[_0x8e6762[_0x2d6a('0x3')]];}}}catch(_0x42b0c1){utils[_0x2d6a('0x14')](util['format'](_0x2d6a('0x1f'),_0x8e6762[_0x2d6a('0x3')]),_0x42b0c1);}};exports['varset']=function(_0x4cd7a3){try{utils[_0x2d6a('0x17')](util['format'](_0x2d6a('0x20'),_0x4cd7a3[_0x2d6a('0x3')]),_0x4cd7a3);if(!_[_0x2d6a('0x16')](_0x4cd7a3[_0x2d6a('0x21')]['queuestatus'])&&_0x4cd7a3[_0x2d6a('0x22')][_0x2d6a('0x23')]()!==_0x2d6a('0x24')){if(!_['isNil'](queues[_0x4cd7a3['uniqueid']])){queues[_0x4cd7a3[_0x2d6a('0x3')]]['queuecallerabandon']=![];queues[_0x4cd7a3['uniqueid']][_0x2d6a('0x25')]=null;queues[_0x4cd7a3[_0x2d6a('0x3')]][_0x2d6a('0x26')]=!![];queues[_0x4cd7a3[_0x2d6a('0x3')]][_0x2d6a('0x27')]=utils[_0x2d6a('0x13')]();queues[_0x4cd7a3[_0x2d6a('0x3')]][_0x2d6a('0x7')]=_0x4cd7a3[_0x2d6a('0x22')]['toUpperCase']();utils[_0x2d6a('0x2')](util[_0x2d6a('0xf')](_0x2d6a('0x28'),_0x4cd7a3[_0x2d6a('0x3')],queues[_0x4cd7a3[_0x2d6a('0x3')]]['name'],_0x4cd7a3[_0x2d6a('0x22')],queues[_0x4cd7a3[_0x2d6a('0x3')]][_0x2d6a('0x7')]));writeDB(queues[_0x4cd7a3['uniqueid']]);}}else if(!_[_0x2d6a('0x16')](_0x4cd7a3[_0x2d6a('0x21')][_0x2d6a('0x29')])){if(!_[_0x2d6a('0x16')](queues[_0x4cd7a3[_0x2d6a('0x3')]])&&!queues[_0x4cd7a3['uniqueid']]['queuecallerabandon']){queues[_0x4cd7a3[_0x2d6a('0x3')]][_0x2d6a('0x19')]=![];queues[_0x4cd7a3[_0x2d6a('0x3')]][_0x2d6a('0x25')]=null;queues[_0x4cd7a3['uniqueid']][_0x2d6a('0x26')]=!![];queues[_0x4cd7a3[_0x2d6a('0x3')]][_0x2d6a('0x27')]=utils[_0x2d6a('0x13')]();queues[_0x4cd7a3['uniqueid']][_0x2d6a('0x7')]=_0x2d6a('0x2a');utils[_0x2d6a('0x2')](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x4cd7a3['uniqueid'],queues[_0x4cd7a3[_0x2d6a('0x3')]][_0x2d6a('0x1d')],_0x4cd7a3['value'],queues[_0x4cd7a3['uniqueid']][_0x2d6a('0x7')]));}}}catch(_0x3db817){utils[_0x2d6a('0x14')](util[_0x2d6a('0xf')]('[%s][queues][varset]',_0x4cd7a3[_0x2d6a('0x3')]),_0x3db817);}};exports[_0x2d6a('0x19')]=function(_0x2bf3f8){try{if(!_[_0x2d6a('0x16')](queues[_0x2bf3f8[_0x2d6a('0x3')]])){utils['debug'](util[_0x2d6a('0xf')](_0x2d6a('0x2b'),_0x2bf3f8[_0x2d6a('0x3')]),_0x2bf3f8);queues[_0x2bf3f8[_0x2d6a('0x3')]][_0x2d6a('0x26')]=![];queues[_0x2bf3f8['uniqueid']][_0x2d6a('0x27')]=null;queues[_0x2bf3f8[_0x2d6a('0x3')]][_0x2d6a('0x19')]=!![];queues[_0x2bf3f8[_0x2d6a('0x3')]][_0x2d6a('0x25')]=utils[_0x2d6a('0x13')]();queues[_0x2bf3f8[_0x2d6a('0x3')]][_0x2d6a('0x7')]=_0x2d6a('0x2c');utils[_0x2d6a('0x2')](util[_0x2d6a('0xf')]('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x2bf3f8['uniqueid'],queues[_0x2bf3f8['uniqueid']][_0x2d6a('0x1d')],queues[_0x2bf3f8[_0x2d6a('0x3')]][_0x2d6a('0x7')]));}}catch(_0x3b7dcd){utils['error'](util['format'](_0x2d6a('0x2b'),_0x2bf3f8[_0x2d6a('0x3')]),_0x3b7dcd);}};exports[_0x2d6a('0x2d')]=function(_0x32c4ee){try{if(!_['isNil'](queues[_0x32c4ee[_0x2d6a('0x3')]])){utils['debug'](util['format'](_0x2d6a('0x2e'),_0x32c4ee[_0x2d6a('0x3')]),_0x32c4ee);utils[_0x2d6a('0x2')](util['format'](_0x2d6a('0x2f'),_0x32c4ee[_0x2d6a('0x3')],queues[_0x32c4ee['uniqueid']][_0x2d6a('0x1d')],_0x32c4ee[_0x2d6a('0x30')],_0x32c4ee['connectedlinename']));queues[_0x32c4ee[_0x2d6a('0x3')]][_0x2d6a('0x2d')]=!![];queues[_0x32c4ee[_0x2d6a('0x3')]]['queuecallerleaveAt']=utils[_0x2d6a('0x13')]();queues[_0x32c4ee[_0x2d6a('0x3')]][_0x2d6a('0x31')]=utils[_0x2d6a('0x32')](queues[_0x32c4ee[_0x2d6a('0x3')]][_0x2d6a('0x18')],queues[_0x32c4ee[_0x2d6a('0x3')]][_0x2d6a('0x33')]);queues[_0x32c4ee[_0x2d6a('0x3')]][_0x2d6a('0x12')]=_0x32c4ee[_0x2d6a('0x12')];queues[_0x32c4ee[_0x2d6a('0x3')]][_0x2d6a('0x34')]=_0x32c4ee[_0x2d6a('0x34')];queues[_0x32c4ee[_0x2d6a('0x3')]][_0x2d6a('0x30')]=_0x32c4ee[_0x2d6a('0x30')];queues[_0x32c4ee['uniqueid']][_0x2d6a('0x35')]=_0x32c4ee[_0x2d6a('0x35')];}}catch(_0x60989b){utils[_0x2d6a('0x14')](util[_0x2d6a('0xf')](_0x2d6a('0x2e'),_0x32c4ee[_0x2d6a('0x3')]),_0x60989b);}};exports['agentconnect']=function(_0x4a7570){try{if(!_[_0x2d6a('0x16')](queues[_0x4a7570[_0x2d6a('0x3')]])){utils[_0x2d6a('0x17')](util[_0x2d6a('0xf')](_0x2d6a('0x36'),_0x4a7570[_0x2d6a('0x3')]),_0x4a7570);utils[_0x2d6a('0x2')](util[_0x2d6a('0xf')](_0x2d6a('0x37'),_0x4a7570[_0x2d6a('0x3')],queues[_0x4a7570[_0x2d6a('0x3')]][_0x2d6a('0x1d')],_0x4a7570['membername'],_0x4a7570[_0x2d6a('0x38')]));queues[_0x4a7570[_0x2d6a('0x3')]][_0x2d6a('0x19')]=![];queues[_0x4a7570['uniqueid']][_0x2d6a('0x19')]=![];queues[_0x4a7570['uniqueid']][_0x2d6a('0x25')]=null;queues[_0x4a7570[_0x2d6a('0x3')]][_0x2d6a('0x26')]=![];queues[_0x4a7570[_0x2d6a('0x3')]]['queuecallerexitreason']=null;queues[_0x4a7570[_0x2d6a('0x3')]]['queuecallerexitAt']=null;queues[_0x4a7570['uniqueid']]['assigned']=!![];queues[_0x4a7570[_0x2d6a('0x3')]][_0x2d6a('0x6')]=_0x4a7570['destaccountcode'];queues[_0x4a7570['uniqueid']][_0x2d6a('0x4')]=_0x4a7570[_0x2d6a('0x39')];}}catch(_0x3f6d46){utils[_0x2d6a('0x14')](util['format'](_0x2d6a('0x36'),_0x4a7570[_0x2d6a('0x3')]),_0x3f6d46);}};exports[_0x2d6a('0x3a')]=function(_0x19fad6){try{if(!_[_0x2d6a('0x16')](queues[_0x19fad6[_0x2d6a('0x3')]])){if(queues[_0x19fad6[_0x2d6a('0x3')]][_0x2d6a('0x18')]){utils[_0x2d6a('0x17')](util[_0x2d6a('0xf')](_0x2d6a('0x3b'),_0x19fad6[_0x2d6a('0x3')]),_0x19fad6);queues[_0x19fad6[_0x2d6a('0x3')]][_0x2d6a('0x19')]=![];queues[_0x19fad6[_0x2d6a('0x3')]][_0x2d6a('0x19')]=![];queues[_0x19fad6[_0x2d6a('0x3')]][_0x2d6a('0x25')]=null;queues[_0x19fad6[_0x2d6a('0x3')]]['queuecallerexit']=![];queues[_0x19fad6[_0x2d6a('0x3')]][_0x2d6a('0x27')]=null;queues[_0x19fad6[_0x2d6a('0x3')]][_0x2d6a('0x3c')]=!![];queues[_0x19fad6['uniqueid']][_0x2d6a('0x4')]=_0x19fad6['membername'];queues[_0x19fad6[_0x2d6a('0x3')]][_0x2d6a('0x1a')]=!![];queues[_0x19fad6[_0x2d6a('0x3')]][_0x2d6a('0x3d')]=utils[_0x2d6a('0x13')]();if(_0x19fad6[_0x2d6a('0x3e')]==_0x2d6a('0x3f')){if(!queues[_0x19fad6[_0x2d6a('0x3')]][_0x2d6a('0x3f')]){queues[_0x19fad6['uniqueid']][_0x2d6a('0x7')]=_0x2d6a('0x40');}}else{queues[_0x19fad6[_0x2d6a('0x3')]][_0x2d6a('0x7')]=_0x2d6a('0x41')+_0x19fad6[_0x2d6a('0x3e')][_0x2d6a('0x23')]();}utils[_0x2d6a('0x2')](util[_0x2d6a('0xf')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x19fad6['uniqueid'],queues[_0x19fad6[_0x2d6a('0x3')]][_0x2d6a('0x1d')],_0x19fad6[_0x2d6a('0x39')],queues[_0x19fad6['uniqueid']][_0x2d6a('0x7')]));writeDB(queues[_0x19fad6[_0x2d6a('0x3')]]);}}}catch(_0x5e5232){utils[_0x2d6a('0x14')](util[_0x2d6a('0xf')]('[%s][queues][agentcomplete]',_0x19fad6[_0x2d6a('0x3')]),_0x5e5232);}};exports[_0x2d6a('0x42')]=function(_0x37f45b){try{if(!_[_0x2d6a('0x16')](queues[_0x37f45b['transfereeuniqueid']])){utils[_0x2d6a('0x17')](util[_0x2d6a('0xf')](_0x2d6a('0x43'),_0x37f45b['uniqueid']),_0x37f45b);queues[_0x37f45b[_0x2d6a('0x44')]][_0x2d6a('0x3f')]=!![];queues[_0x37f45b[_0x2d6a('0x44')]]['transfertype']=_0x2d6a('0x45');queues[_0x37f45b['transfereeuniqueid']]['transferexten']=_0x37f45b[_0x2d6a('0x46')];queues[_0x37f45b[_0x2d6a('0x44')]]['transferuniqueid']=_0x37f45b['transfereeuniqueid'];queues[_0x37f45b['transfereeuniqueid']][_0x2d6a('0x7')]=_0x2d6a('0x47');utils[_0x2d6a('0x2')](util[_0x2d6a('0xf')](_0x2d6a('0x48'),_0x37f45b[_0x2d6a('0x3')],queues[_0x37f45b[_0x2d6a('0x44')]][_0x2d6a('0x1d')],_0x37f45b[_0x2d6a('0x44')],_0x37f45b[_0x2d6a('0x46')]));}}catch(_0x4e8b53){utils[_0x2d6a('0x14')](util[_0x2d6a('0xf')](_0x2d6a('0x43'),_0x37f45b[_0x2d6a('0x3')]),_0x4e8b53);}};exports[_0x2d6a('0x49')]=function(_0x5e49c8){try{utils[_0x2d6a('0x17')](util[_0x2d6a('0xf')](_0x2d6a('0x4a'),_0x5e49c8['origtransfereruniqueid']),_0x5e49c8);if(_0x5e49c8[_0x2d6a('0x4b')]==_0x5e49c8[_0x2d6a('0x4c')]){if(!_[_0x2d6a('0x16')](queues[_0x5e49c8['secondtransfererlinkedid']])){utils[_0x2d6a('0x2')](util[_0x2d6a('0xf')](_0x2d6a('0x4d'),_0x5e49c8[_0x2d6a('0x4b')],queues[_0x5e49c8[_0x2d6a('0x4e')]]['name'],_0x5e49c8[_0x2d6a('0x4f')]));queues[_0x5e49c8['secondtransfererlinkedid']][_0x2d6a('0x3f')]=!![];queues[_0x5e49c8['secondtransfererlinkedid']][_0x2d6a('0x50')]='ATTENDED';queues[_0x5e49c8['secondtransfererlinkedid']][_0x2d6a('0x51')]=_0x5e49c8[_0x2d6a('0x4f')];queues[_0x5e49c8[_0x2d6a('0x4e')]][_0x2d6a('0x52')]=_0x5e49c8[_0x2d6a('0x4b')];queues[_0x5e49c8['secondtransfererlinkedid']][_0x2d6a('0x7')]=_0x2d6a('0x53');}if(!_[_0x2d6a('0x16')](queues[_0x5e49c8[_0x2d6a('0x4c')]])){if(_0x5e49c8[_0x2d6a('0x54')]&&queues[_0x5e49c8[_0x2d6a('0x54')]]){queues[_0x5e49c8[_0x2d6a('0x54')]][_0x2d6a('0x1e')]=0x1;queues[_0x5e49c8[_0x2d6a('0x44')]]=_[_0x2d6a('0x55')](queues[_0x5e49c8[_0x2d6a('0x54')]]);queues[_0x5e49c8[_0x2d6a('0x44')]][_0x2d6a('0x1c')]=_0x5e49c8[_0x2d6a('0x56')];queues[_0x5e49c8[_0x2d6a('0x44')]][_0x2d6a('0x1e')]=0x2;queues[_0x5e49c8[_0x2d6a('0x44')]][_0x2d6a('0x5')]=queues[_0x5e49c8['secondtransfererlinkedid']][_0x2d6a('0x5')];queues[_0x5e49c8[_0x2d6a('0x44')]][_0x2d6a('0x57')]=queues[_0x5e49c8[_0x2d6a('0x4e')]][_0x2d6a('0x57')];queues[_0x5e49c8[_0x2d6a('0x44')]]['queuecallerjoinAt']=utils[_0x2d6a('0x13')]();queues[_0x5e49c8[_0x2d6a('0x44')]][_0x2d6a('0x18')]=utils[_0x2d6a('0x13')]();queues[_0x5e49c8[_0x2d6a('0x44')]][_0x2d6a('0x31')]=0x0;queues[_0x5e49c8['transfereeuniqueid']][_0x2d6a('0x58')]=0x0;utils[_0x2d6a('0x2')](util[_0x2d6a('0xf')](_0x2d6a('0x59'),_0x5e49c8['origtransfereruniqueid'],queues[_0x5e49c8[_0x2d6a('0x44')]][_0x2d6a('0x1d')],queues[_0x5e49c8[_0x2d6a('0x44')]][_0x2d6a('0x5')],queues[_0x5e49c8[_0x2d6a('0x44')]][_0x2d6a('0x57')]));}else{utils[_0x2d6a('0x2')](util[_0x2d6a('0xf')](_0x2d6a('0x5a'),_0x5e49c8[_0x2d6a('0x4b')],queues[_0x5e49c8['origtransfererlinkedid']][_0x2d6a('0x1d')],_0x5e49c8[_0x2d6a('0x4e')]));queues[_0x5e49c8[_0x2d6a('0x4c')]][_0x2d6a('0x1c')]=_0x5e49c8[_0x2d6a('0x4e')];}}}else if(_0x5e49c8[_0x2d6a('0x5b')]==_0x5e49c8[_0x2d6a('0x4e')]){if(!_[_0x2d6a('0x16')](queues[_0x5e49c8[_0x2d6a('0x4c')]])){utils['info'](util[_0x2d6a('0xf')](_0x2d6a('0x5c'),_0x5e49c8[_0x2d6a('0x4b')],queues[_0x5e49c8[_0x2d6a('0x4c')]][_0x2d6a('0x1d')],_0x5e49c8[_0x2d6a('0x5b')],_0x5e49c8['secondtransfererexten']));queues[_0x5e49c8[_0x2d6a('0x4c')]][_0x2d6a('0x3f')]=!![];queues[_0x5e49c8['origtransfererlinkedid']][_0x2d6a('0x50')]='ATTENDED';queues[_0x5e49c8[_0x2d6a('0x4c')]][_0x2d6a('0x51')]=_0x5e49c8[_0x2d6a('0x5d')];queues[_0x5e49c8['origtransfererlinkedid']][_0x2d6a('0x52')]=_0x5e49c8[_0x2d6a('0x5b')];queues[_0x5e49c8[_0x2d6a('0x4c')]][_0x2d6a('0x7')]=_0x2d6a('0x53');}if(!_[_0x2d6a('0x16')](queues[_0x5e49c8['secondtransfererlinkedid']])){if(_0x5e49c8[_0x2d6a('0x5e')]&&queues[_0x5e49c8['transfertargetlinkedid']]){queues[_0x5e49c8['transfertargetlinkedid']][_0x2d6a('0x1e')]=0x1;queues[_0x5e49c8[_0x2d6a('0x56')]]=_['clone'](queues[_0x5e49c8[_0x2d6a('0x5e')]]);queues[_0x5e49c8['transfertargetuniqueid']][_0x2d6a('0x1c')]=_0x5e49c8[_0x2d6a('0x56')];queues[_0x5e49c8[_0x2d6a('0x56')]][_0x2d6a('0x1e')]=0x2;queues[_0x5e49c8[_0x2d6a('0x56')]][_0x2d6a('0x5')]=queues[_0x5e49c8[_0x2d6a('0x4c')]][_0x2d6a('0x5')];queues[_0x5e49c8[_0x2d6a('0x56')]][_0x2d6a('0x57')]=queues[_0x5e49c8[_0x2d6a('0x4c')]][_0x2d6a('0x57')];queues[_0x5e49c8[_0x2d6a('0x56')]][_0x2d6a('0x33')]=utils[_0x2d6a('0x13')]();queues[_0x5e49c8['transfertargetuniqueid']][_0x2d6a('0x18')]=utils[_0x2d6a('0x13')]();queues[_0x5e49c8['transfertargetuniqueid']][_0x2d6a('0x31')]=0x0;queues[_0x5e49c8[_0x2d6a('0x56')]]['mohtime']=0x0;utils[_0x2d6a('0x2')](util[_0x2d6a('0xf')](_0x2d6a('0x5f'),_0x5e49c8[_0x2d6a('0x4b')],queues[_0x5e49c8[_0x2d6a('0x56')]]['name'],queues[_0x5e49c8['transfertargetuniqueid']][_0x2d6a('0x1c')],queues[_0x5e49c8[_0x2d6a('0x56')]][_0x2d6a('0x5')],queues[_0x5e49c8[_0x2d6a('0x56')]][_0x2d6a('0x57')]));}else{utils[_0x2d6a('0x2')](util[_0x2d6a('0xf')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x5e49c8[_0x2d6a('0x4b')],queues[_0x5e49c8['secondtransfererlinkedid']][_0x2d6a('0x1d')],_0x5e49c8[_0x2d6a('0x4c')]));queues[_0x5e49c8[_0x2d6a('0x4e')]][_0x2d6a('0x1c')]=_0x5e49c8[_0x2d6a('0x4c')];}}}}catch(_0x3b1e86){utils[_0x2d6a('0x14')](util[_0x2d6a('0xf')](_0x2d6a('0x4a'),_0x5e49c8[_0x2d6a('0x4b')]),_0x3b1e86);}};exports[_0x2d6a('0x60')]=function(_0xaab2b6){try{if(!_[_0x2d6a('0x16')](queues[_0xaab2b6[_0x2d6a('0x3')]])){utils[_0x2d6a('0x17')](util[_0x2d6a('0xf')](_0x2d6a('0x61'),_0xaab2b6[_0x2d6a('0x3')]),_0xaab2b6);queues[_0xaab2b6['uniqueid']][_0x2d6a('0x62')]=utils[_0x2d6a('0x13')]();utils[_0x2d6a('0x2')](util['format'](_0x2d6a('0x63'),_0xaab2b6[_0x2d6a('0x3')],queues[_0xaab2b6[_0x2d6a('0x3')]][_0x2d6a('0x1d')],queues[_0xaab2b6[_0x2d6a('0x3')]][_0x2d6a('0x62')]));}}catch(_0x22607a){utils['error'](util['format'](_0x2d6a('0x61'),_0xaab2b6['uniqueid']),_0x22607a);}};exports[_0x2d6a('0x64')]=function(_0x329112){try{if(!_[_0x2d6a('0x16')](queues[_0x329112[_0x2d6a('0x3')]])){if(!_[_0x2d6a('0x16')](queues[_0x329112[_0x2d6a('0x3')]][_0x2d6a('0x62')])){utils['debug'](util[_0x2d6a('0xf')](_0x2d6a('0x65'),_0x329112['uniqueid']),_0x329112);queues[_0x329112[_0x2d6a('0x3')]]['mohtime']+=utils[_0x2d6a('0x32')](utils['now'](),queues[_0x329112['uniqueid']][_0x2d6a('0x62')]);utils[_0x2d6a('0x2')](util['format'](_0x2d6a('0x66'),_0x329112['uniqueid'],queues[_0x329112[_0x2d6a('0x3')]]['name'],queues[_0x329112[_0x2d6a('0x3')]]['mohtime']));delete queues[_0x329112[_0x2d6a('0x3')]][_0x2d6a('0x62')];}}}catch(_0x5135a5){utils[_0x2d6a('0x14')](util[_0x2d6a('0xf')]('[%s][queues][musiconholdstop]',_0x329112[_0x2d6a('0x3')]),_0x5135a5);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index d530145..c2156de 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 _0x6031=['.wav49','.WAV','find','monitors','push','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','set','toLowerCase','cdr','split','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','lodash','util','./utils','info','format','uniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','error','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','mixmonitor_filename','[%s][recordings][varset]','value','endsWith'];(function(_0x382e89,_0x4768c0){var _0x3a1318=function(_0x79e1ce){while(--_0x79e1ce){_0x382e89['push'](_0x382e89['shift']());}};_0x3a1318(++_0x4768c0);}(_0x6031,0x197));var _0x1603=function(_0xc21f24,_0x49e927){_0xc21f24=_0xc21f24-0x0;var _0x16dcc7=_0x6031[_0xc21f24];return _0x16dcc7;};'use strict';var _=require(_0x1603('0x0'));var util=require(_0x1603('0x1'));var utils=require(_0x1603('0x2'));var recordings={};function writeDB(_0x18678b){utils[_0x1603('0x3')](util[_0x1603('0x4')]('[%s][recordings][writeDB]',_0x18678b[_0x1603('0x5')]));if(_0x18678b[_0x1603('0x6')]){utils[_0x1603('0x7')](_0x18678b[_0x1603('0x6')])[_0x1603('0x8')](function(_0x20dfcb){if(_0x20dfcb){_0x18678b[_0x1603('0x9')]=_0x20dfcb[_0x1603('0xa')];_0x18678b[_0x1603('0xb')]=_0x20dfcb['id'];}utils[_0x1603('0xc')](_0x1603('0xd'),_0x18678b);});}else{utils[_0x1603('0xc')]('CreateVoiceRecording',_0x18678b);}}exports[_0x1603('0xe')]=function(_0x3c8a19){try{utils[_0x1603('0xf')](util['format'](_0x1603('0x10'),_0x3c8a19[_0x1603('0x5')]),_0x3c8a19);if(_0x3c8a19['uniqueid']==_0x3c8a19[_0x1603('0x11')]){utils[_0x1603('0x3')](util['format'](_0x1603('0x12'),_0x3c8a19['uniqueid'],_0x3c8a19['context'],_0x3c8a19[_0x1603('0x13')]));recordings[_0x3c8a19[_0x1603('0x5')]]={'uniqueid':_0x3c8a19[_0x1603('0x5')],'accountcode':_0x3c8a19[_0x1603('0x6')],'exten':_0x3c8a19[_0x1603('0x13')],'context':_0x3c8a19[_0x1603('0x14')],'channel':_0x3c8a19[_0x1603('0x15')],'monitors':[]};}}catch(_0x388703){utils[_0x1603('0x16')](util[_0x1603('0x4')]('[%s][recordings][newchannel]',_0x3c8a19[_0x1603('0x5')]),_0x388703);}};exports['newstate']=function(_0x2f8c5d){try{utils[_0x1603('0xf')](util[_0x1603('0x4')](_0x1603('0x17'),_0x2f8c5d[_0x1603('0x5')]),_0x2f8c5d);if(!_[_0x1603('0x18')](recordings[_0x2f8c5d[_0x1603('0x5')]])&&_0x2f8c5d[_0x1603('0x19')]==0x6){utils[_0x1603('0x3')](util[_0x1603('0x4')](_0x1603('0x1a'),_0x2f8c5d[_0x1603('0x5')],_0x2f8c5d[_0x1603('0x14')],_0x2f8c5d[_0x1603('0x15')]));}else if(!_[_0x1603('0x18')](recordings[_0x2f8c5d['linkedid']])&&_0x2f8c5d[_0x1603('0x19')]==0x6&&_0x2f8c5d['context']!=_0x1603('0x1b')){utils[_0x1603('0x3')](util['format'](_0x1603('0x1c'),_0x2f8c5d['uniqueid'],_0x2f8c5d[_0x1603('0x11')],_0x2f8c5d[_0x1603('0x14')],_0x2f8c5d['channel']));recordings[_0x2f8c5d[_0x1603('0x11')]][_0x1603('0x6')]=_0x2f8c5d['accountcode'];}}catch(_0x280621){utils[_0x1603('0x16')](util[_0x1603('0x4')]('[%s][recordings][newstate]',_0x2f8c5d[_0x1603('0x5')]),_0x280621);}};exports['varset']=function(_0x1cba9c){try{if(!_[_0x1603('0x18')](_0x1cba9c[_0x1603('0x1d')])&&!_['isNil'](_0x1cba9c[_0x1603('0x1d')][_0x1603('0x1e')])){utils[_0x1603('0xf')](util['format'](_0x1603('0x1f'),_0x1cba9c[_0x1603('0x5')]),_0x1cba9c);utils[_0x1603('0x3')](util[_0x1603('0x4')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x1cba9c[_0x1603('0x5')],_0x1cba9c['variable'],_0x1cba9c[_0x1603('0x20')]));if(_[_0x1603('0x21')](_0x1cba9c['value'],'.wav49')){_0x1cba9c['value']=_0x1cba9c[_0x1603('0x20')]['replace'](_0x1603('0x22'),_0x1603('0x23'));}if(recordings[_0x1cba9c[_0x1603('0x11')]]){var _0x3c4f2e=_[_0x1603('0x24')](recordings[_0x1cba9c[_0x1603('0x11')]]['monitors'],{'value':_0x1cba9c[_0x1603('0x20')]});if(_['isNil'](_0x3c4f2e)){recordings[_0x1cba9c[_0x1603('0x11')]][_0x1603('0x25')][_0x1603('0x26')]({'value':_0x1cba9c['value']});}}}}catch(_0x16ba72){utils['error'](util[_0x1603('0x4')](_0x1603('0x1f'),_0x1cba9c[_0x1603('0x5')]),_0x16ba72);}};exports['hangup']=function(_0x15f6c1){try{if(!_['isNil'](recordings[_0x15f6c1['uniqueid']])){utils[_0x1603('0xf')](util[_0x1603('0x4')](_0x1603('0x27'),_0x15f6c1[_0x1603('0x5')]),_0x15f6c1);utils['info'](util[_0x1603('0x4')](_0x1603('0x28'),_0x15f6c1[_0x1603('0x5')],_0x15f6c1['calleridnum'],_0x15f6c1[_0x1603('0x29')],_0x15f6c1[_0x1603('0x2a')]));recordings[_0x15f6c1[_0x1603('0x5')]]['calleridnum']=_0x15f6c1[_0x1603('0x2b')];recordings[_0x15f6c1[_0x1603('0x5')]][_0x1603('0x29')]=_0x15f6c1[_0x1603('0x29')];recordings[_0x15f6c1[_0x1603('0x5')]][_0x1603('0x2c')]=_0x15f6c1[_0x1603('0x2c')];recordings[_0x15f6c1[_0x1603('0x5')]][_0x1603('0x2d')]=_0x15f6c1[_0x1603('0x2d')];if(recordings[_0x15f6c1['uniqueid']][_0x1603('0x2e')]==_0x1603('0x2f')&&recordings[_0x15f6c1[_0x1603('0x5')]][_0x1603('0x6')]){recordings[_0x15f6c1[_0x1603('0x5')]][_0x1603('0x2c')]=recordings[_0x15f6c1[_0x1603('0x5')]][_0x1603('0x6')];recordings[_0x15f6c1[_0x1603('0x5')]][_0x1603('0x2d')]='';}recordings[_0x15f6c1[_0x1603('0x5')]][_0x1603('0x25')][_0x1603('0x30')](function(_0x29bf71){var _0x453dfd=_[_0x1603('0x31')](recordings[_0x15f6c1[_0x1603('0x5')]]);_0x453dfd[_0x1603('0x20')]=_0x29bf71['value'];writeDB(_0x453dfd);});delete recordings[_0x15f6c1[_0x1603('0x5')]];}}catch(_0x2e1cbc){utils['error'](util[_0x1603('0x4')](_0x1603('0x27'),_0x15f6c1[_0x1603('0x5')]),_0x2e1cbc);}};exports[_0x1603('0x32')]=function(_0x2a9451){try{if(!_['isNil'](recordings[_0x2a9451['uniqueid']])){utils[_0x1603('0xf')](util[_0x1603('0x4')](_0x1603('0x33'),_0x2a9451[_0x1603('0x5')]),_0x2a9451);utils[_0x1603('0x3')](util[_0x1603('0x4')](_0x1603('0x34'),_0x2a9451[_0x1603('0x5')],_0x2a9451['application'],_0x2a9451[_0x1603('0x35')]));if(_0x2a9451[_0x1603('0x36')]['toLowerCase']()==_0x1603('0x37')&&_['startsWith'](_0x2a9451[_0x1603('0x35')][_0x1603('0x38')](),_0x1603('0x39'))){var _0x2711ae=_0x2a9451[_0x1603('0x35')][_0x1603('0x3a')]('=');var _0x8b222e=_0x2711ae[0x0]['substring'](_0x2711ae[0x0][_0x1603('0x3b')]('(')+0x1,_0x2711ae[0x0][_0x1603('0x3b')](')'));var _0x2c3a25=_0x2711ae[0x1];recordings[_0x2a9451['uniqueid']][_0x8b222e]=_0x2c3a25;}}}catch(_0x809f9c){utils[_0x1603('0x16')](util[_0x1603('0x4')](_0x1603('0x33'),_0x2a9451[_0x1603('0x5')]),_0x809f9c);}};exports[_0x1603('0x3c')]=function(_0xc96ae5){try{if(!_[_0x1603('0x18')](recordings[_0xc96ae5[_0x1603('0x5')]])){utils[_0x1603('0xf')](util[_0x1603('0x4')](_0x1603('0x3d'),_0xc96ae5[_0x1603('0x5')]),_0xc96ae5);utils['info'](util['format']('[%s][recordings][queuecallerjoin]\x20queue:%s',_0xc96ae5[_0x1603('0x5')],_0xc96ae5[_0x1603('0x3e')]));recordings[_0xc96ae5[_0x1603('0x5')]][_0x1603('0x3e')]=_0xc96ae5[_0x1603('0x3e')];}}catch(_0x10fc4b){utils[_0x1603('0x16')](util[_0x1603('0x4')]('[%s][recordings][queuecallerjoin]',_0xc96ae5[_0x1603('0x5')]),_0x10fc4b);}}; \ No newline at end of file +var _0xaef5=['monitors','push','hangup','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','[%s][recordings][hangup]','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','then','membername','name','UserId','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','debug','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','.WAV','find'];(function(_0x22f58b,_0x5dd4f8){var _0x4bfc9f=function(_0x38b90e){while(--_0x38b90e){_0x22f58b['push'](_0x22f58b['shift']());}};_0x4bfc9f(++_0x5dd4f8);}(_0xaef5,0xe2));var _0x5aef=function(_0x1462ee,_0x5dccc1){_0x1462ee=_0x1462ee-0x0;var _0x34cf46=_0xaef5[_0x1462ee];return _0x34cf46;};'use strict';var _=require(_0x5aef('0x0'));var util=require(_0x5aef('0x1'));var utils=require(_0x5aef('0x2'));var recordings={};function writeDB(_0xed692){utils[_0x5aef('0x3')](util[_0x5aef('0x4')](_0x5aef('0x5'),_0xed692[_0x5aef('0x6')]));if(_0xed692[_0x5aef('0x7')]){utils[_0x5aef('0x8')](_0xed692[_0x5aef('0x7')])[_0x5aef('0x9')](function(_0x437ac2){if(_0x437ac2){_0xed692[_0x5aef('0xa')]=_0x437ac2[_0x5aef('0xb')];_0xed692[_0x5aef('0xc')]=_0x437ac2['id'];}utils['request'](_0x5aef('0xd'),_0xed692);});}else{utils['request'](_0x5aef('0xd'),_0xed692);}}exports[_0x5aef('0xe')]=function(_0xf21470){try{utils['debug'](util[_0x5aef('0x4')](_0x5aef('0xf'),_0xf21470[_0x5aef('0x6')]),_0xf21470);if(_0xf21470[_0x5aef('0x6')]==_0xf21470[_0x5aef('0x10')]){utils['info'](util[_0x5aef('0x4')](_0x5aef('0x11'),_0xf21470[_0x5aef('0x6')],_0xf21470[_0x5aef('0x12')],_0xf21470[_0x5aef('0x13')]));recordings[_0xf21470[_0x5aef('0x6')]]={'uniqueid':_0xf21470['uniqueid'],'accountcode':_0xf21470[_0x5aef('0x7')],'exten':_0xf21470[_0x5aef('0x13')],'context':_0xf21470['context'],'channel':_0xf21470[_0x5aef('0x14')],'monitors':[]};}}catch(_0x1b79bd){utils[_0x5aef('0x15')](util[_0x5aef('0x4')](_0x5aef('0xf'),_0xf21470[_0x5aef('0x6')]),_0x1b79bd);}};exports['newstate']=function(_0x47afc6){try{utils[_0x5aef('0x16')](util[_0x5aef('0x4')](_0x5aef('0x17'),_0x47afc6[_0x5aef('0x6')]),_0x47afc6);if(!_[_0x5aef('0x18')](recordings[_0x47afc6[_0x5aef('0x6')]])&&_0x47afc6[_0x5aef('0x19')]==0x6){utils['info'](util[_0x5aef('0x4')](_0x5aef('0x1a'),_0x47afc6[_0x5aef('0x6')],_0x47afc6['context'],_0x47afc6[_0x5aef('0x14')]));}else if(!_[_0x5aef('0x18')](recordings[_0x47afc6['linkedid']])&&_0x47afc6[_0x5aef('0x19')]==0x6&&_0x47afc6[_0x5aef('0x12')]!=_0x5aef('0x1b')){utils['info'](util['format'](_0x5aef('0x1c'),_0x47afc6['uniqueid'],_0x47afc6['linkedid'],_0x47afc6[_0x5aef('0x12')],_0x47afc6[_0x5aef('0x14')]));recordings[_0x47afc6['linkedid']][_0x5aef('0x7')]=_0x47afc6[_0x5aef('0x7')];}}catch(_0x24941c){utils[_0x5aef('0x15')](util['format'](_0x5aef('0x17'),_0x47afc6['uniqueid']),_0x24941c);}};exports[_0x5aef('0x1d')]=function(_0x442d1e){try{if(!_[_0x5aef('0x18')](_0x442d1e[_0x5aef('0x1e')])&&!_[_0x5aef('0x18')](_0x442d1e['variable'][_0x5aef('0x1f')])){utils['debug'](util[_0x5aef('0x4')]('[%s][recordings][varset]',_0x442d1e[_0x5aef('0x6')]),_0x442d1e);utils['info'](util[_0x5aef('0x4')](_0x5aef('0x20'),_0x442d1e[_0x5aef('0x6')],_0x442d1e[_0x5aef('0x1e')],_0x442d1e[_0x5aef('0x21')]));if(_[_0x5aef('0x22')](_0x442d1e[_0x5aef('0x21')],_0x5aef('0x23'))){_0x442d1e[_0x5aef('0x21')]=_0x442d1e[_0x5aef('0x21')]['replace'](_0x5aef('0x23'),_0x5aef('0x24'));}if(recordings[_0x442d1e['linkedid']]){var _0xa93105=_[_0x5aef('0x25')](recordings[_0x442d1e[_0x5aef('0x10')]][_0x5aef('0x26')],{'value':_0x442d1e[_0x5aef('0x21')]});if(_[_0x5aef('0x18')](_0xa93105)){recordings[_0x442d1e[_0x5aef('0x10')]][_0x5aef('0x26')][_0x5aef('0x27')]({'value':_0x442d1e[_0x5aef('0x21')]});}}}}catch(_0x276331){utils[_0x5aef('0x15')](util['format']('[%s][recordings][varset]',_0x442d1e[_0x5aef('0x6')]),_0x276331);}};exports[_0x5aef('0x28')]=function(_0x49273f){try{if(!_['isNil'](recordings[_0x49273f[_0x5aef('0x6')]])){utils[_0x5aef('0x16')](util[_0x5aef('0x4')]('[%s][recordings][hangup]',_0x49273f[_0x5aef('0x6')]),_0x49273f);utils[_0x5aef('0x3')](util[_0x5aef('0x4')](_0x5aef('0x29'),_0x49273f[_0x5aef('0x6')],_0x49273f[_0x5aef('0x2a')],_0x49273f[_0x5aef('0x2b')],_0x49273f[_0x5aef('0x2c')]));recordings[_0x49273f[_0x5aef('0x6')]]['calleridnum']=_0x49273f['calleridnum'];recordings[_0x49273f[_0x5aef('0x6')]]['calleridname']=_0x49273f[_0x5aef('0x2b')];recordings[_0x49273f[_0x5aef('0x6')]][_0x5aef('0x2d')]=_0x49273f[_0x5aef('0x2d')];recordings[_0x49273f[_0x5aef('0x6')]]['connectedlinename']=_0x49273f[_0x5aef('0x2e')];if(recordings[_0x49273f[_0x5aef('0x6')]][_0x5aef('0x2f')]==_0x5aef('0x30')&&recordings[_0x49273f[_0x5aef('0x6')]][_0x5aef('0x7')]){recordings[_0x49273f[_0x5aef('0x6')]][_0x5aef('0x2d')]=recordings[_0x49273f['uniqueid']][_0x5aef('0x7')];recordings[_0x49273f[_0x5aef('0x6')]]['connectedlinename']='';}recordings[_0x49273f['uniqueid']]['monitors'][_0x5aef('0x31')](function(_0x3315c3){var _0x528cc5=_['clone'](recordings[_0x49273f[_0x5aef('0x6')]]);_0x528cc5[_0x5aef('0x21')]=_0x3315c3[_0x5aef('0x21')];writeDB(_0x528cc5);});delete recordings[_0x49273f['uniqueid']];}}catch(_0x169a33){utils[_0x5aef('0x15')](util[_0x5aef('0x4')](_0x5aef('0x32'),_0x49273f[_0x5aef('0x6')]),_0x169a33);}};exports['newexten']=function(_0x1066dd){try{if(!_['isNil'](recordings[_0x1066dd[_0x5aef('0x6')]])){utils[_0x5aef('0x16')](util['format'](_0x5aef('0x33'),_0x1066dd[_0x5aef('0x6')]),_0x1066dd);utils['info'](util['format'](_0x5aef('0x34'),_0x1066dd[_0x5aef('0x6')],_0x1066dd['application'],_0x1066dd['appdata']));if(_0x1066dd[_0x5aef('0x35')][_0x5aef('0x36')]()==_0x5aef('0x37')&&_[_0x5aef('0x38')](_0x1066dd[_0x5aef('0x39')][_0x5aef('0x36')](),_0x5aef('0x3a'))){var _0x2c1ad2=_0x1066dd[_0x5aef('0x39')][_0x5aef('0x3b')]('=');var _0x427da7=_0x2c1ad2[0x0][_0x5aef('0x3c')](_0x2c1ad2[0x0]['lastIndexOf']('(')+0x1,_0x2c1ad2[0x0][_0x5aef('0x3d')](')'));var _0x1d6e33=_0x2c1ad2[0x1];recordings[_0x1066dd[_0x5aef('0x6')]][_0x427da7]=_0x1d6e33;}}}catch(_0x437e0a){utils[_0x5aef('0x15')](util[_0x5aef('0x4')](_0x5aef('0x33'),_0x1066dd[_0x5aef('0x6')]),_0x437e0a);}};exports[_0x5aef('0x3e')]=function(_0x816321){try{if(!_[_0x5aef('0x18')](recordings[_0x816321['uniqueid']])){utils[_0x5aef('0x16')](util[_0x5aef('0x4')](_0x5aef('0x3f'),_0x816321['uniqueid']),_0x816321);utils['info'](util[_0x5aef('0x4')](_0x5aef('0x40'),_0x816321['uniqueid'],_0x816321[_0x5aef('0x41')]));recordings[_0x816321['uniqueid']]['queue']=_0x816321[_0x5aef('0x41')];}}catch(_0x50cd73){utils[_0x5aef('0x15')](util[_0x5aef('0x4')](_0x5aef('0x3f'),_0x816321[_0x5aef('0x6')]),_0x50cd73);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index caed578..72b3b90 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 _0xf7b2=['assign','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','[%s][transfers][attendedtransfer]','util','./utils','info','format','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridname','error','[%s][transfers][blindtransfer]','attendedtransfer','origtransferercalleridnum','transfertargetcalleridnum'];(function(_0x460211,_0x23143f){var _0x60d77e=function(_0x40b451){while(--_0x40b451){_0x460211['push'](_0x460211['shift']());}};_0x60d77e(++_0x23143f);}(_0xf7b2,0x83));var _0x2f7b=function(_0x4c1942,_0x337ba5){_0x4c1942=_0x4c1942-0x0;var _0x22b741=_0xf7b2[_0x4c1942];return _0x22b741;};'use strict';var _=require('lodash');var util=require(_0x2f7b('0x0'));var utils=require(_0x2f7b('0x1'));function writeDB(_0x5b5d6e){utils[_0x2f7b('0x2')](util[_0x2f7b('0x3')]('[%s][transfers][writeDB]\x20type:%s',_0x5b5d6e[_0x2f7b('0x4')]===_0x2f7b('0x5')?_0x5b5d6e[_0x2f7b('0x6')]:_0x5b5d6e[_0x2f7b('0x7')],_0x5b5d6e[_0x2f7b('0x4')]));utils[_0x2f7b('0x8')](_0x2f7b('0x9'),_0x5b5d6e);}exports[_0x2f7b('0xa')]=function(_0x5767fa){try{utils[_0x2f7b('0xb')](util['format']('[%s][transfers][blindtransfer]',_0x5767fa['uniqueid']),_0x5767fa);utils['info'](util['format'](_0x2f7b('0xc'),_0x5767fa['uniqueid'],_0x5767fa[_0x2f7b('0xd')],_0x5767fa[_0x2f7b('0xe')],_0x5767fa['transfereecalleridnum'],_0x5767fa[_0x2f7b('0xf')]));_0x5767fa[_0x2f7b('0x4')]='blind';writeDB(_0x5767fa);}catch(_0x827be2){utils[_0x2f7b('0x10')](util[_0x2f7b('0x3')](_0x2f7b('0x11'),_0x5767fa[_0x2f7b('0x7')]),_0x827be2);}};exports[_0x2f7b('0x12')]=function(_0x400059){try{utils[_0x2f7b('0xb')](util[_0x2f7b('0x3')]('[%s][transfers][attendedtransfer]',_0x400059[_0x2f7b('0x6')]),_0x400059);utils[_0x2f7b('0x2')](util[_0x2f7b('0x3')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x400059[_0x2f7b('0x6')],_0x400059[_0x2f7b('0x13')],_0x400059['origtransferercalleridname'],_0x400059[_0x2f7b('0x14')],_0x400059['transfertargetcalleridname']));_0x400059=_[_0x2f7b('0x15')](_0x400059,{'transfererchannel':_0x400059[_0x2f7b('0x16')],'transferercalleridnum':_0x400059[_0x2f7b('0x13')],'transferercalleridname':_0x400059[_0x2f7b('0x17')],'transfererconnectedlinenum':_0x400059[_0x2f7b('0x18')],'transfererconnectedlinename':_0x400059['secondtransfererconnectedlinename'],'transfereraccountcode':_0x400059[_0x2f7b('0x19')],'transferercontext':_0x400059[_0x2f7b('0x1a')],'transfererexten':_0x400059[_0x2f7b('0x1b')],'transfererlinkedid':_0x400059[_0x2f7b('0x1c')],'context':_0x400059[_0x2f7b('0x1d')],'extension':_0x400059['origtransfererexten'],'type':_0x2f7b('0x5')});if(_['isNil'](_0x400059[_0x2f7b('0x1e')])){_0x400059=_[_0x2f7b('0x15')](_0x400059,{'transfereechannel':_0x400059[_0x2f7b('0x1f')],'transfereecalleridnum':_0x400059[_0x2f7b('0x14')],'transfereecalleridname':_0x400059[_0x2f7b('0x20')],'transfereeconnectedlinenum':_0x400059[_0x2f7b('0x21')],'transfereeconnectedlinename':_0x400059[_0x2f7b('0x22')],'transfereeaccountcode':_0x400059[_0x2f7b('0x23')],'transfereecontext':_0x400059['transfertargetcontext'],'transfereeexten':_0x400059[_0x2f7b('0x24')],'transfereelinkedid':_0x400059['transfertargetlinkedid']});}writeDB(_0x400059);}catch(_0x5d8312){utils[_0x2f7b('0x10')](util[_0x2f7b('0x3')](_0x2f7b('0x25'),_0x400059[_0x2f7b('0x6')]),_0x5d8312);}}; \ No newline at end of file +var _0x4b55=['origtransfereruniqueid','uniqueid','request','blindtransfer','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','error','attendedtransfer','debug','[%s][transfers][attendedtransfer]','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended'];(function(_0x33a326,_0x2735b7){var _0x2774bf=function(_0x23ca54){while(--_0x23ca54){_0x33a326['push'](_0x33a326['shift']());}};_0x2774bf(++_0x2735b7);}(_0x4b55,0xcc));var _0x54b5=function(_0x529f39,_0x6e10f5){_0x529f39=_0x529f39-0x0;var _0x3d84c3=_0x4b55[_0x529f39];return _0x3d84c3;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x54b5('0x0'));function writeDB(_0x1aad42){utils[_0x54b5('0x1')](util[_0x54b5('0x2')](_0x54b5('0x3'),_0x1aad42[_0x54b5('0x4')]===_0x54b5('0x5')?_0x1aad42[_0x54b5('0x6')]:_0x1aad42[_0x54b5('0x7')],_0x1aad42[_0x54b5('0x4')]));utils[_0x54b5('0x8')]('CreateVoiceTransferReport',_0x1aad42);}exports[_0x54b5('0x9')]=function(_0x98bc8e){try{utils['debug'](util[_0x54b5('0x2')](_0x54b5('0xa'),_0x98bc8e[_0x54b5('0x7')]),_0x98bc8e);utils[_0x54b5('0x1')](util[_0x54b5('0x2')](_0x54b5('0xb'),_0x98bc8e[_0x54b5('0x7')],_0x98bc8e[_0x54b5('0xc')],_0x98bc8e[_0x54b5('0xd')],_0x98bc8e[_0x54b5('0xe')],_0x98bc8e[_0x54b5('0xf')]));_0x98bc8e[_0x54b5('0x4')]=_0x54b5('0x10');writeDB(_0x98bc8e);}catch(_0x3625f3){utils[_0x54b5('0x11')](util[_0x54b5('0x2')](_0x54b5('0xa'),_0x98bc8e[_0x54b5('0x7')]),_0x3625f3);}};exports[_0x54b5('0x12')]=function(_0x4e0682){try{utils[_0x54b5('0x13')](util[_0x54b5('0x2')](_0x54b5('0x14'),_0x4e0682[_0x54b5('0x6')]),_0x4e0682);utils['info'](util[_0x54b5('0x2')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x4e0682['origtransfereruniqueid'],_0x4e0682[_0x54b5('0x15')],_0x4e0682[_0x54b5('0x16')],_0x4e0682[_0x54b5('0x17')],_0x4e0682[_0x54b5('0x18')]));_0x4e0682=_[_0x54b5('0x19')](_0x4e0682,{'transfererchannel':_0x4e0682[_0x54b5('0x1a')],'transferercalleridnum':_0x4e0682['origtransferercalleridnum'],'transferercalleridname':_0x4e0682['origtransferercalleridname'],'transfererconnectedlinenum':_0x4e0682[_0x54b5('0x1b')],'transfererconnectedlinename':_0x4e0682['secondtransfererconnectedlinename'],'transfereraccountcode':_0x4e0682[_0x54b5('0x1c')],'transferercontext':_0x4e0682['secondtransferercontext'],'transfererexten':_0x4e0682[_0x54b5('0x1d')],'transfererlinkedid':_0x4e0682[_0x54b5('0x1e')],'context':_0x4e0682[_0x54b5('0x1f')],'extension':_0x4e0682[_0x54b5('0x20')],'type':_0x54b5('0x5')});if(_[_0x54b5('0x21')](_0x4e0682[_0x54b5('0x22')])){_0x4e0682=_[_0x54b5('0x19')](_0x4e0682,{'transfereechannel':_0x4e0682[_0x54b5('0x23')],'transfereecalleridnum':_0x4e0682[_0x54b5('0x17')],'transfereecalleridname':_0x4e0682[_0x54b5('0x18')],'transfereeconnectedlinenum':_0x4e0682[_0x54b5('0x24')],'transfereeconnectedlinename':_0x4e0682[_0x54b5('0x25')],'transfereeaccountcode':_0x4e0682[_0x54b5('0x26')],'transfereecontext':_0x4e0682[_0x54b5('0x27')],'transfereeexten':_0x4e0682[_0x54b5('0x28')],'transfereelinkedid':_0x4e0682[_0x54b5('0x29')]});}writeDB(_0x4e0682);}catch(_0x591fb9){utils[_0x54b5('0x11')](util[_0x54b5('0x2')]('[%s][transfers][attendedtransfer]',_0x4e0682[_0x54b5('0x6')]),_0x591fb9);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index e6c91dd..b82b2b9 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 _0xeeda=['notfound','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','debug','inspect','error','request','then','catch','internal','name','stringify','result','length','found','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0xeeda,0x1be));var _0xaeed=function(_0x415443,_0x415640){_0x415443=_0x415443-0x0;var _0x576828=_0xeeda[_0x415443];return _0x576828;};'use strict';var BPromise=require(_0xaeed('0x0'));var jayson=require(_0xaeed('0x1'));var moment=require(_0xaeed('0x2'));var util=require(_0xaeed('0x3'));var client=jayson[_0xaeed('0x4')][_0xaeed('0x5')]({'port':0x2329});var logger=require(_0xaeed('0x6'))(_0xaeed('0x7'));exports[_0xaeed('0x8')]=function(_0x423827,_0x2300ee){logger['info'](_0x423827,_0x2300ee?util['inspect'](_0x2300ee,{'showHidden':![],'depth':null}):'');};exports[_0xaeed('0x9')]=function(_0x3841d9,_0xbbabf5){logger[_0xaeed('0x9')](_0x3841d9,_0xbbabf5?util[_0xaeed('0xa')](_0xbbabf5,{'showHidden':![],'depth':null}):'');};exports[_0xaeed('0xb')]=function(_0x458272,_0x166255){logger[_0xaeed('0xb')](_0x458272,_0x166255?util[_0xaeed('0xa')](_0x166255,{'showHidden':![],'depth':null}):'');};exports[_0xaeed('0xc')]=function(_0x2df290,_0x7dda4f){return client[_0xaeed('0xc')](_0x2df290,{'body':_0x7dda4f})[_0xaeed('0xd')](function(_0x16d0a2){logger[_0xaeed('0x9')]('[utils][request]\x20name:%s',_0x2df290,_0x16d0a2?util[_0xaeed('0xa')](_0x16d0a2,{'showHidden':![],'depth':null}):'');})[_0xaeed('0xe')](function(_0x5716a2){logger['error']('[utils][request]\x20name:%s',_0x2df290,_0x5716a2?util[_0xaeed('0xa')](_0x5716a2,{'showHidden':![],'depth':null}):'');});};function getUser(_0x255dbb){return client[_0xaeed('0xc')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0xaeed('0xf'),_0xaeed('0x10'),'interface'],'where':_0x255dbb,'limit':0x1}})[_0xaeed('0xd')](function(_0x178831){logger[_0xaeed('0x9')]('[utils][getUser]\x20where:%s',JSON[_0xaeed('0x11')](_0x255dbb),_0x178831?util['inspect'](_0x178831,{'showHidden':![],'depth':null}):'');return _0x178831[_0xaeed('0x12')][_0xaeed('0x13')]?_0x178831[_0xaeed('0x12')][0x0]:null;});}exports['getUserByInternal']=function(_0x2b6363){return new BPromise(function(_0x54380,_0x52c5c5){if(_0x2b6363){return getUser({'internal':_0x2b6363})[_0xaeed('0xd')](function(_0x344c0e){logger[_0xaeed('0x8')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x2b6363,_0x344c0e?_0xaeed('0x14'):'notfound');return _0x54380(_0x344c0e);})['catch'](function(_0x54d35f){logger[_0xaeed('0xb')](_0xaeed('0x15'),_0x54d35f?util['inspect'](_0x54d35f,{'showHidden':![],'depth':null}):'');return _0x54380(null);});}return _0x54380(null);});};exports[_0xaeed('0x16')]=function(_0x511475){return new BPromise(function(_0x34a16b,_0x16f747){if(_0x511475){return getUser({'interface':_0x511475})[_0xaeed('0xd')](function(_0x1a5481){logger[_0xaeed('0x8')](_0xaeed('0x17'),_0x511475,_0x1a5481?_0xaeed('0x14'):_0xaeed('0x18'));return _0x34a16b(_0x1a5481);})['catch'](function(_0x368ce5){logger[_0xaeed('0xb')](_0xaeed('0x19'),_0x368ce5?util[_0xaeed('0xa')](_0x368ce5,{'showHidden':![],'depth':null}):'');return _0x34a16b(null);});}return _0x34a16b(null);});};exports[_0xaeed('0x1a')]=function(_0xac908){return new BPromise(function(_0x13bf50,_0x10ce48){if(_0xac908){return getUser({'name':_0xac908})[_0xaeed('0xd')](function(_0x4ce31e){logger[_0xaeed('0x8')]('[utils][getUserByName]\x20name:%s\x20%s',_0xac908,_0x4ce31e?_0xaeed('0x14'):_0xaeed('0x18'));return _0x13bf50(_0x4ce31e);})['catch'](function(_0x3c8d46){logger[_0xaeed('0xb')](_0xaeed('0x1b'),_0x3c8d46?util[_0xaeed('0xa')](_0x3c8d46,{'showHidden':![],'depth':null}):'');return _0x13bf50(null);});}return _0x13bf50(null);});};exports[_0xaeed('0x1c')]=function(_0x45455f){return new BPromise(function(_0x4124e9,_0x181f41){if(_0x45455f){return client['request'](_0xaeed('0x1d'),{'options':{'raw':!![],'attributes':['id',_0xaeed('0x10'),_0xaeed('0x1e'),_0xaeed('0x1f'),_0xaeed('0x20')],'where':{'name':_0x45455f},'limit':0x1}})['then'](function(_0x1801ef){logger['debug'](_0xaeed('0x21'),_0x45455f,_0x1801ef?util[_0xaeed('0xa')](_0x1801ef,{'showHidden':![],'depth':null}):'');logger[_0xaeed('0x8')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x45455f,_0x1801ef?'found':'notfound');return _0x4124e9(_0x1801ef['result'][_0xaeed('0x13')]?_0x1801ef[_0xaeed('0x12')][0x0]:null);})[_0xaeed('0xe')](function(_0x418709){logger[_0xaeed('0xb')](_0xaeed('0x22'),_0x418709?util[_0xaeed('0xa')](_0x418709,{'showHidden':![],'depth':null}):'');return _0x4124e9(null);});}return _0x4124e9(null);});};exports[_0xaeed('0x23')]=function(_0x5c1324,_0x333a28){return moment(_0x5c1324)[_0xaeed('0x24')](_0x333a28,_0xaeed('0x25'))[_0xaeed('0x26')](_0xaeed('0x27'));};exports[_0xaeed('0x28')]=function(_0x12609b,_0x528675){return moment(_0x12609b)[_0xaeed('0x29')](_0x528675,'seconds')['format'](_0xaeed('0x27'));};exports[_0xaeed('0x2a')]=function(_0x2b13ab,_0x5b99b2){return moment(_0x2b13ab)[_0xaeed('0x2b')](moment(_0x5b99b2),_0xaeed('0x25'));};exports[_0xaeed('0x2c')]=function(_0x20c5fd,_0x352a5f){return parseInt(_0x20c5fd,0xa)+parseInt(_0x352a5f,0xa);};exports['now']=function(){return moment()[_0xaeed('0x26')](_0xaeed('0x27'));};exports[_0xaeed('0x2d')]=function(_0x2d021d,_0xdc9f0c){if(_0xdc9f0c){return moment(_0x2d021d)[_0xaeed('0x2d')](_0xdc9f0c);}return!![];};exports['isBefore']=function(_0x41afad,_0x4ea4a8){if(_0x4ea4a8){return moment(_0x41afad)[_0xaeed('0x2e')](_0x4ea4a8);}else if(_0x41afad){return!![];}return![];}; \ No newline at end of file +var _0x89ab=['stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','name','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','add','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','format','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','info','inspect','debug','error','request','then','catch','GetUser','internal','[utils][getUser]\x20where:%s'];(function(_0x329dd0,_0x47e04f){var _0x4f5b90=function(_0x7d2728){while(--_0x7d2728){_0x329dd0['push'](_0x329dd0['shift']());}};_0x4f5b90(++_0x47e04f);}(_0x89ab,0x16f));var _0xb89a=function(_0x1b10ce,_0x12c2ea){_0x1b10ce=_0x1b10ce-0x0;var _0x3ae82d=_0x89ab[_0x1b10ce];return _0x3ae82d;};'use strict';var BPromise=require(_0xb89a('0x0'));var jayson=require(_0xb89a('0x1'));var moment=require(_0xb89a('0x2'));var util=require(_0xb89a('0x3'));var client=jayson[_0xb89a('0x4')][_0xb89a('0x5')]({'port':0x2329});var logger=require(_0xb89a('0x6'))('xdr');exports[_0xb89a('0x7')]=function(_0x5665db,_0x573e58){logger[_0xb89a('0x7')](_0x5665db,_0x573e58?util[_0xb89a('0x8')](_0x573e58,{'showHidden':![],'depth':null}):'');};exports[_0xb89a('0x9')]=function(_0x19fd43,_0x57a1bd){logger['debug'](_0x19fd43,_0x57a1bd?util[_0xb89a('0x8')](_0x57a1bd,{'showHidden':![],'depth':null}):'');};exports[_0xb89a('0xa')]=function(_0xa2be76,_0x5aef1e){logger['error'](_0xa2be76,_0x5aef1e?util[_0xb89a('0x8')](_0x5aef1e,{'showHidden':![],'depth':null}):'');};exports[_0xb89a('0xb')]=function(_0xdfcff1,_0x14d3cd){return client[_0xb89a('0xb')](_0xdfcff1,{'body':_0x14d3cd})[_0xb89a('0xc')](function(_0x4060fb){logger[_0xb89a('0x9')]('[utils][request]\x20name:%s',_0xdfcff1,_0x4060fb?util['inspect'](_0x4060fb,{'showHidden':![],'depth':null}):'');})[_0xb89a('0xd')](function(_0x550d45){logger[_0xb89a('0xa')]('[utils][request]\x20name:%s',_0xdfcff1,_0x550d45?util['inspect'](_0x550d45,{'showHidden':![],'depth':null}):'');});};function getUser(_0x2e21f4){return client[_0xb89a('0xb')](_0xb89a('0xe'),{'options':{'raw':!![],'attributes':['id',_0xb89a('0xf'),'name','interface'],'where':_0x2e21f4,'limit':0x1}})[_0xb89a('0xc')](function(_0x16d8b7){logger[_0xb89a('0x9')](_0xb89a('0x10'),JSON[_0xb89a('0x11')](_0x2e21f4),_0x16d8b7?util['inspect'](_0x16d8b7,{'showHidden':![],'depth':null}):'');return _0x16d8b7[_0xb89a('0x12')][_0xb89a('0x13')]?_0x16d8b7[_0xb89a('0x12')][0x0]:null;});}exports[_0xb89a('0x14')]=function(_0x5e9fd5){return new BPromise(function(_0x45615f,_0x24829b){if(_0x5e9fd5){return getUser({'internal':_0x5e9fd5})[_0xb89a('0xc')](function(_0x95602b){logger[_0xb89a('0x7')](_0xb89a('0x15'),_0x5e9fd5,_0x95602b?_0xb89a('0x16'):_0xb89a('0x17'));return _0x45615f(_0x95602b);})[_0xb89a('0xd')](function(_0x1b77dd){logger[_0xb89a('0xa')](_0xb89a('0x18'),_0x1b77dd?util[_0xb89a('0x8')](_0x1b77dd,{'showHidden':![],'depth':null}):'');return _0x45615f(null);});}return _0x45615f(null);});};exports['getUserByInterface']=function(_0x326886){return new BPromise(function(_0x46364d,_0x30627d){if(_0x326886){return getUser({'interface':_0x326886})['then'](function(_0x7721e2){logger[_0xb89a('0x7')](_0xb89a('0x19'),_0x326886,_0x7721e2?'found':_0xb89a('0x17'));return _0x46364d(_0x7721e2);})[_0xb89a('0xd')](function(_0x2ba760){logger[_0xb89a('0xa')](_0xb89a('0x1a'),_0x2ba760?util['inspect'](_0x2ba760,{'showHidden':![],'depth':null}):'');return _0x46364d(null);});}return _0x46364d(null);});};exports[_0xb89a('0x1b')]=function(_0x15334a){return new BPromise(function(_0x10222b,_0x560e13){if(_0x15334a){return getUser({'name':_0x15334a})[_0xb89a('0xc')](function(_0x44b073){logger[_0xb89a('0x7')](_0xb89a('0x1c'),_0x15334a,_0x44b073?_0xb89a('0x16'):_0xb89a('0x17'));return _0x10222b(_0x44b073);})[_0xb89a('0xd')](function(_0x320254){logger[_0xb89a('0xa')]('[utils][getUserByName]',_0x320254?util['inspect'](_0x320254,{'showHidden':![],'depth':null}):'');return _0x10222b(null);});}return _0x10222b(null);});};exports[_0xb89a('0x1d')]=function(_0x1b17f1){return new BPromise(function(_0x171d54,_0x311c84){if(_0x1b17f1){return client[_0xb89a('0xb')](_0xb89a('0x1e'),{'options':{'raw':!![],'attributes':['id',_0xb89a('0x1f'),'type',_0xb89a('0x20'),_0xb89a('0x21')],'where':{'name':_0x1b17f1},'limit':0x1}})[_0xb89a('0xc')](function(_0x55d642){logger[_0xb89a('0x9')](_0xb89a('0x22'),_0x1b17f1,_0x55d642?util['inspect'](_0x55d642,{'showHidden':![],'depth':null}):'');logger[_0xb89a('0x7')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x1b17f1,_0x55d642?_0xb89a('0x16'):_0xb89a('0x17'));return _0x171d54(_0x55d642[_0xb89a('0x12')][_0xb89a('0x13')]?_0x55d642[_0xb89a('0x12')][0x0]:null);})['catch'](function(_0x1d40c1){logger[_0xb89a('0xa')](_0xb89a('0x23'),_0x1d40c1?util[_0xb89a('0x8')](_0x1d40c1,{'showHidden':![],'depth':null}):'');return _0x171d54(null);});}return _0x171d54(null);});};exports[_0xb89a('0x24')]=function(_0x1ec953,_0x14e03d){return moment(_0x1ec953)[_0xb89a('0x25')](_0x14e03d,_0xb89a('0x26'))['format'](_0xb89a('0x27'));};exports[_0xb89a('0x28')]=function(_0x381f1f,_0x2ed91b){return moment(_0x381f1f)['subtract'](_0x2ed91b,_0xb89a('0x26'))[_0xb89a('0x29')](_0xb89a('0x27'));};exports[_0xb89a('0x2a')]=function(_0x222dcc,_0x12f3f3){return moment(_0x222dcc)[_0xb89a('0x2b')](moment(_0x12f3f3),_0xb89a('0x26'));};exports[_0xb89a('0x2c')]=function(_0xc4bf6,_0x480cdb){return parseInt(_0xc4bf6,0xa)+parseInt(_0x480cdb,0xa);};exports[_0xb89a('0x2d')]=function(){return moment()[_0xb89a('0x29')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xb89a('0x2e')]=function(_0x14b686,_0x15059e){if(_0x15059e){return moment(_0x14b686)[_0xb89a('0x2e')](_0x15059e);}return!![];};exports[_0xb89a('0x2f')]=function(_0x2097c2,_0x20d14c){if(_0x20d14c){return moment(_0x2097c2)['isBefore'](_0x20d14c);}else if(_0x2097c2){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index bd8aa74..20b2af9 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x20f7=['client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','method','x-forwarded-for','headers','connection','remoteAddress','responseTime','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','statusCode','agent_name','test','url','setupLoggers','fs-extra','lodash','express-winston','util','./loggers','./safe-template','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','role','name','ensureDir','then','catch','user','no-user','data','timestamp','auth','set'];(function(_0x3df706,_0x2afce6){var _0x4cb963=function(_0x284a46){while(--_0x284a46){_0x3df706['push'](_0x3df706['shift']());}};_0x4cb963(++_0x2afce6);}(_0x20f7,0x160));var _0x720f=function(_0x1366e4,_0x2893d0){_0x1366e4=_0x1366e4-0x0;var _0x44d1c9=_0x20f7[_0x1366e4];return _0x44d1c9;};var fs=require(_0x720f('0x0'));var _=require(_0x720f('0x1'));var ewinston=require(_0x720f('0x2'));var path=require('path');var util=require(_0x720f('0x3'));var fileLogger=require(_0x720f('0x4'))['fileLogger'];var safeTemplate=require(_0x720f('0x5'))['safeTemplate'];var maskSensitiveData=require(_0x720f('0x6'))[_0x720f('0x7')];function ClientSideLogger(){function _0x19e3e1(_0x5b81ab){var _0x55b127=path[_0x720f('0x8')](_0x720f('0x9'),_0x720f('0xa'),_0x720f('0xb'));var _0x141e27=path[_0x720f('0x8')](_0x720f('0xc'),_0x5b81ab[_0x720f('0xd')]+'-'+_0x5b81ab[_0x720f('0xe')]);return fs[_0x720f('0xf')](path[_0x720f('0x8')](_0x55b127,_0x141e27))[_0x720f('0x10')](function(){var _0x4e0c0c=fileLogger(_0x720f('0xc'),path[_0x720f('0x8')](_0x55b127,_0x141e27));return _0x4e0c0c;})[_0x720f('0x11')](function(_0x5ab846){throw _0x5ab846;});}this[_0x720f('0xa')]=function(_0x44828a,_0x3755b1,_0x2ba574,_0x1f4ca8){return _0x19e3e1(_0x44828a[_0x720f('0x12')])[_0x720f('0x10')](function(_0x13b6b6){var _0x33ca98=_0x13b6b6[_0x3755b1];return _0x33ca98;})[_0x720f('0x10')](function(_0x1284cf){var _0xe54bb7=_0x44828a[_0x720f('0x12')]?_0x44828a['user']['id']:_0x720f('0x13');var _0x5bc991=_0x1f4ca8[_0x720f('0x14')];var _0x7c0d47=_0x1f4ca8[_0x720f('0x15')];var _0x95f36e=new Date(Number(_0x7c0d47));return _0x1284cf(_0xe54bb7,_0x95f36e,_0x2ba574,_0x5bc991);})['catch'](function(_0x173f67){fileLogger(_0x720f('0xc'))['error'](_0x173f67);});};}function setupLoggers(_0x160f68){return new Promise(function(_0x5c56fe){var _0x1b8559=new ClientSideLogger();var _0xbf05c9=fileLogger('api');var _0x269a1a=fileLogger(_0x720f('0x16'));_0x160f68[_0x720f('0x17')](_0x720f('0x18'),_0x1b8559);_0x160f68[_0x720f('0x19')](ewinston[_0x720f('0x1a')]({'winstonInstance':_0xbf05c9,'meta':![],'statusLevels':!![],'msg':function(_0x2ee66b,_0xd8fb8){var _0x5bd2b3=_0x720f('0x1b');if(!_[_0x720f('0x1c')](_0x2ee66b[_0x720f('0x1d')])){_0x5bd2b3+='\x20body=%s';var _0x52263b=_0x2ee66b['body'];maskSensitiveData(_0x52263b);}return safeTemplate(util['format'](_0x5bd2b3,_0x2ee66b[_0x720f('0x1e')],_0x2ee66b['headers'][_0x720f('0x1f')]?_0x2ee66b[_0x720f('0x20')]['x-forwarded-for']:_0x2ee66b[_0x720f('0x21')][_0x720f('0x22')]||_0x2ee66b['ip'],_0x2ee66b['url'],_0xd8fb8['statusCode'],_0xd8fb8[_0x720f('0x23')],_0x2ee66b[_0x720f('0x12')]?_0x2ee66b['user']['id']:null,_0x2ee66b[_0x720f('0x12')]?_0x2ee66b[_0x720f('0x12')]['name']:null,_0x2ee66b[_0x720f('0x12')]?_0x2ee66b['user'][_0x720f('0xd')]:null,_0x52263b?util[_0x720f('0x24')](_0x52263b,![],null):''));}}));_0x160f68[_0x720f('0x19')](ewinston[_0x720f('0x1a')]({'winstonInstance':_0x269a1a,'meta':![],'statusLevels':!![],'msg':function(_0x7d6646,_0x2bb938){var _0x24ae3b=_0x720f('0x25');if(_0x7d6646[_0x720f('0x1d')]&&_0x7d6646['body'][_0x720f('0x26')]&&_0x7d6646[_0x720f('0x1d')][_0x720f('0x27')]){_0x24ae3b=_0x720f('0x28');}return util[_0x720f('0x29')](_0x24ae3b,_0x7d6646[_0x720f('0x1e')],_0x7d6646[_0x720f('0x20')][_0x720f('0x1f')]?_0x7d6646['headers']['x-forwarded-for']:_0x7d6646[_0x720f('0x21')][_0x720f('0x22')]||_0x7d6646['ip'],_0x7d6646['url'],_0x2bb938[_0x720f('0x2a')],_0x2bb938[_0x720f('0x23')],_0x7d6646[_0x720f('0x12')]?_0x7d6646[_0x720f('0x12')]['id']:null,_0x7d6646[_0x720f('0x12')]?_0x7d6646[_0x720f('0x12')]['name']:null,_0x7d6646[_0x720f('0x12')]?_0x7d6646[_0x720f('0x12')]['role']:null,_0x7d6646['body']&&_0x7d6646['body'][_0x720f('0x26')]?_0x7d6646['body']['device']:'other',_0x7d6646[_0x720f('0x1d')]&&_0x7d6646[_0x720f('0x1d')][_0x720f('0x27')]?_0x7d6646[_0x720f('0x1d')][_0x720f('0x27')]:'',_0x7d6646[_0x720f('0x1d')]&&_0x7d6646[_0x720f('0x1d')][_0x720f('0x2b')]?_0x7d6646[_0x720f('0x1d')][_0x720f('0x2b')]:'');},'ignoreRoute':function(_0x4c9297){var _0x3be563=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x3be563[_0x720f('0x2c')](_0x4c9297[_0x720f('0x2d')]);}}));return _0x5c56fe();});}exports[_0x720f('0x2e')]=setupLoggers; \ No newline at end of file +var _0xefc7=['logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','inspect','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','agent_name','test','setupLoggers','lodash','util','./loggers','fileLogger','./safe-template','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','role','name','user','then','no-user','data','timestamp','catch','error','auth','set','client-side-logger','use'];(function(_0x583c66,_0x19d269){var _0x144ca9=function(_0x9ac69){while(--_0x9ac69){_0x583c66['push'](_0x583c66['shift']());}};_0x144ca9(++_0x19d269);}(_0xefc7,0x157));var _0x7efc=function(_0x4f97f6,_0x3124b6){_0x4f97f6=_0x4f97f6-0x0;var _0x5c7177=_0xefc7[_0x4f97f6];return _0x5c7177;};var fs=require('fs-extra');var _=require(_0x7efc('0x0'));var ewinston=require('express-winston');var path=require('path');var util=require(_0x7efc('0x1'));var fileLogger=require(_0x7efc('0x2'))[_0x7efc('0x3')];var safeTemplate=require(_0x7efc('0x4'))['safeTemplate'];var maskSensitiveData=require(_0x7efc('0x5'))[_0x7efc('0x6')];function ClientSideLogger(){function _0x136f2d(_0x50beba){var _0x5ca73d=path[_0x7efc('0x7')](_0x7efc('0x8'),_0x7efc('0x9'),_0x7efc('0xa'));var _0x503c25=path[_0x7efc('0x7')](_0x7efc('0xb'),_0x50beba[_0x7efc('0xc')]+'-'+_0x50beba[_0x7efc('0xd')]);return fs['ensureDir'](path[_0x7efc('0x7')](_0x5ca73d,_0x503c25))['then'](function(){var _0x1ca732=fileLogger(_0x7efc('0xb'),path['join'](_0x5ca73d,_0x503c25));return _0x1ca732;})['catch'](function(_0x2578e7){throw _0x2578e7;});}this[_0x7efc('0x9')]=function(_0x3edd4c,_0x30dbf7,_0x5e867e,_0x13a4c8){return _0x136f2d(_0x3edd4c[_0x7efc('0xe')])[_0x7efc('0xf')](function(_0x38d2ba){var _0xb7baa6=_0x38d2ba[_0x30dbf7];return _0xb7baa6;})[_0x7efc('0xf')](function(_0x2c012b){var _0x5387ea=_0x3edd4c['user']?_0x3edd4c[_0x7efc('0xe')]['id']:_0x7efc('0x10');var _0x56d89f=_0x13a4c8[_0x7efc('0x11')];var _0x473d19=_0x13a4c8[_0x7efc('0x12')];var _0x3e4ed1=new Date(Number(_0x473d19));return _0x2c012b(_0x5387ea,_0x3e4ed1,_0x5e867e,_0x56d89f);})[_0x7efc('0x13')](function(_0x2268c6){fileLogger('client')[_0x7efc('0x14')](_0x2268c6);});};}function setupLoggers(_0x250f1f){return new Promise(function(_0x1c83d5){var _0x2a7e0f=new ClientSideLogger();var _0x5719a7=fileLogger('api');var _0x5daaeb=fileLogger(_0x7efc('0x15'));_0x250f1f[_0x7efc('0x16')](_0x7efc('0x17'),_0x2a7e0f);_0x250f1f[_0x7efc('0x18')](ewinston[_0x7efc('0x19')]({'winstonInstance':_0x5719a7,'meta':![],'statusLevels':!![],'msg':function(_0x112812,_0x57e796){var _0x4fa98f=_0x7efc('0x1a');if(!_[_0x7efc('0x1b')](_0x112812[_0x7efc('0x1c')])){_0x4fa98f+=_0x7efc('0x1d');var _0x58062c=_0x112812[_0x7efc('0x1c')];maskSensitiveData(_0x58062c);}return safeTemplate(util[_0x7efc('0x1e')](_0x4fa98f,_0x112812[_0x7efc('0x1f')],_0x112812[_0x7efc('0x20')]['x-forwarded-for']?_0x112812[_0x7efc('0x20')][_0x7efc('0x21')]:_0x112812[_0x7efc('0x22')][_0x7efc('0x23')]||_0x112812['ip'],_0x112812[_0x7efc('0x24')],_0x57e796[_0x7efc('0x25')],_0x57e796[_0x7efc('0x26')],_0x112812[_0x7efc('0xe')]?_0x112812[_0x7efc('0xe')]['id']:null,_0x112812['user']?_0x112812[_0x7efc('0xe')][_0x7efc('0xd')]:null,_0x112812['user']?_0x112812[_0x7efc('0xe')][_0x7efc('0xc')]:null,_0x58062c?util[_0x7efc('0x27')](_0x58062c,![],null):''));}}));_0x250f1f[_0x7efc('0x18')](ewinston[_0x7efc('0x19')]({'winstonInstance':_0x5daaeb,'meta':![],'statusLevels':!![],'msg':function(_0x1dea93,_0x45f740){var _0x2669b5='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x1dea93[_0x7efc('0x1c')]&&_0x1dea93[_0x7efc('0x1c')][_0x7efc('0x28')]&&_0x1dea93[_0x7efc('0x1c')][_0x7efc('0x29')]){_0x2669b5=_0x7efc('0x2a');}return util['format'](_0x2669b5,_0x1dea93[_0x7efc('0x1f')],_0x1dea93['headers'][_0x7efc('0x21')]?_0x1dea93[_0x7efc('0x20')][_0x7efc('0x21')]:_0x1dea93['connection'][_0x7efc('0x23')]||_0x1dea93['ip'],_0x1dea93['url'],_0x45f740[_0x7efc('0x25')],_0x45f740['responseTime'],_0x1dea93['user']?_0x1dea93['user']['id']:null,_0x1dea93['user']?_0x1dea93[_0x7efc('0xe')][_0x7efc('0xd')]:null,_0x1dea93[_0x7efc('0xe')]?_0x1dea93[_0x7efc('0xe')]['role']:null,_0x1dea93[_0x7efc('0x1c')]&&_0x1dea93['body'][_0x7efc('0x28')]?_0x1dea93[_0x7efc('0x1c')][_0x7efc('0x28')]:'other',_0x1dea93[_0x7efc('0x1c')]&&_0x1dea93[_0x7efc('0x1c')]['agent_id']?_0x1dea93['body'][_0x7efc('0x29')]:'',_0x1dea93[_0x7efc('0x1c')]&&_0x1dea93[_0x7efc('0x1c')][_0x7efc('0x2b')]?_0x1dea93[_0x7efc('0x1c')][_0x7efc('0x2b')]:'');},'ignoreRoute':function(_0x566bde){var _0x383179=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x383179[_0x7efc('0x2c')](_0x566bde[_0x7efc('0x24')]);}}));return _0x1c83d5();});}exports[_0x7efc('0x2d')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index efbf2b1..6ebcce8 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x88eb=['endOf','isBetween','timeCompare','format','ddd','includes','dowCompare','date','daysInMonth','max','min','domCompare','MMM','monthCompare','test','split','padStart','length','iftime','moment-timezone','map','source','join','Interval\x20string\x20not\x20valid','locale','weekdaysShort','toLowerCase','slice','concat','exports','circularDoWInterval','monthsShort','indexOf','circularMonthInterval','clone','hours','minutes','isBefore','day'];(function(_0x17406e,_0x1049fd){var _0x2bfc5a=function(_0x2aae05){while(--_0x2aae05){_0x17406e['push'](_0x17406e['shift']());}};_0x2bfc5a(++_0x1049fd);}(_0x88eb,0x124));var _0xb88e=function(_0x1a7e5a,_0x19d7df){_0x1a7e5a=_0x1a7e5a-0x0;var _0x3ecc68=_0x88eb[_0x1a7e5a];return _0x3ecc68;};var _=require('lodash');var moment=require(_0xb88e('0x0'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0xb88e('0x1')](function(_0x1f703f){return _0x1f703f[_0xb88e('0x2')];})[_0xb88e('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xb88e('0x4');var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0x397ece){if(!_0x397ece['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x35232a){var _0x432e53=_0x35232a['split'](':')['map'](function(_0x108982){return parseInt(_0x108982,0xa);});var _0x430ef5=_0x432e53[0x0];var _0xc7832c=_0x432e53[0x1];if(_0x430ef5<0x0||_0x430ef5>0x17||_0xc7832c<0x0||_0xc7832c>0x3b){throw new Error(EINVALID_DATE);}return[_0x430ef5,_0xc7832c];}function circularDoWInterval(_0x19bccf,_0x2b318c){if(_0x19bccf===_0x2b318c){return[_0x19bccf];}else{var _0x2a385e=moment[_0xb88e('0x5')]();moment['locale']('en');var _0x225a63=moment[_0xb88e('0x6')]()[_0xb88e('0x1')](function(_0x5eabf5){return _0x5eabf5[_0xb88e('0x7')]();});moment[_0xb88e('0x5')](_0x2a385e);var _0x27ee30=_0x225a63['indexOf'](_0x19bccf);var _0x3ab300=_0x225a63['indexOf'](_0x2b318c);if(_0x3ab300>_0x27ee30){return _0x225a63[_0xb88e('0x8')](_0x27ee30,_0x3ab300+0x1);}else{var _0xa5b5f4=_0x225a63[_0xb88e('0x8')](0x0,_0x3ab300+0x1);var _0x45e0f4=_0x225a63[_0xb88e('0x8')](_0x27ee30);return _0x45e0f4[_0xb88e('0x9')](_0xa5b5f4);}}}module[_0xb88e('0xa')][_0xb88e('0xb')]=circularDoWInterval;function circularMonthInterval(_0x5bdb86,_0x10a927){if(_0x5bdb86===_0x10a927){return[_0x5bdb86];}else{var _0xe5a68=moment['locale']();moment[_0xb88e('0x5')]('en');var _0x4be7a7=moment[_0xb88e('0xc')]()[_0xb88e('0x1')](function(_0xdba443){return _0xdba443[_0xb88e('0x7')]();});moment[_0xb88e('0x5')](_0xe5a68);var _0x53c556=_0x4be7a7[_0xb88e('0xd')](_0x5bdb86);var _0x59d776=_0x4be7a7[_0xb88e('0xd')](_0x10a927);if(_0x59d776>_0x53c556){return _0x4be7a7[_0xb88e('0x8')](_0x53c556,_0x59d776+0x1);}else{var _0x5cf2d8=_0x4be7a7[_0xb88e('0x8')](0x0,_0x59d776+0x1);var _0x4e80e1=_0x4be7a7['slice'](_0x53c556);return _0x4e80e1[_0xb88e('0x9')](_0x5cf2d8);}}}module[_0xb88e('0xa')][_0xb88e('0xe')]=circularMonthInterval;function parseDom(_0x54e363){var _0x2e3c01=parseInt(_0x54e363,0xa);if(_0x2e3c01<0x1||_0x2e3c01>0x1f){throw new Error(EINVALID_DATE);}return _0x2e3c01;}function timeCompare(_0x2a3db6,_0x1632c1,_0x128022){var _0x2d5a98=_0x2a3db6[_0xb88e('0xf')]();var _0x4efb08=extractTime(_0x1632c1);var _0x2cd3f6=_0x4efb08[0x0];var _0x6eb936=_0x4efb08[0x1];var _0x487f1d=_0x2a3db6['clone']()[_0xb88e('0x10')](_0x2cd3f6)[_0xb88e('0x11')](_0x6eb936);throwIfDateNotValid(_0x487f1d);var _0x20a52a=extractTime(_0x128022);var _0x3bbdfa=_0x20a52a[0x0];var _0x10be50=_0x20a52a[0x1];var _0x27762d=_0x2a3db6['clone']()[_0xb88e('0x10')](_0x3bbdfa)[_0xb88e('0x11')](_0x10be50);throwIfDateNotValid(_0x27762d);if(_0x27762d[_0xb88e('0x12')](_0x487f1d)){var _0x1dd9c2=_0x2d5a98[_0xb88e('0xf')]()['startOf'](_0xb88e('0x13'));var _0x1772ee=_0x2d5a98[_0xb88e('0xf')]()[_0xb88e('0x14')](_0xb88e('0x13'));return _0x2d5a98[_0xb88e('0x15')](_0x487f1d,_0x1772ee,undefined,'[]')||_0x2d5a98[_0xb88e('0x15')](_0x1dd9c2,_0x27762d,undefined,'[]');}else{return _0x2d5a98[_0xb88e('0x15')](_0x487f1d,_0x27762d,undefined,'[]');}}module[_0xb88e('0xa')][_0xb88e('0x16')]=timeCompare;function dowCompare(_0x307c7a,_0x4b7976,_0x3c6867){var _0x3b643f=_0x307c7a[_0xb88e('0x5')]('en')[_0xb88e('0x17')](_0xb88e('0x18'))[_0xb88e('0x7')]();return circularDoWInterval(_0x4b7976,_0x3c6867)[_0xb88e('0x19')](_0x3b643f);}module[_0xb88e('0xa')][_0xb88e('0x1a')]=dowCompare;function domCompare(_0x3f62de,_0x6f7f45,_0x1d0ca3){var _0x5b4083=_0x3f62de[_0xb88e('0x1b')]();if(_0x6f7f45===_0x1d0ca3){return _0x5b4083===_0x6f7f45;}else{var _0x4357cb=_0x3f62de[_0xb88e('0x1c')]();var _0x3cc10d=_0x6f7f45<_0x1d0ca3;let _0x1b3f79=![];var _0x3b2617=0x0;var _0x2e3848=0x0;if(_0x3cc10d){_0x3b2617=Math[_0xb88e('0x1d')](0x1,_0x6f7f45);_0x2e3848=Math[_0xb88e('0x1e')](_0x1d0ca3,_0x4357cb);_0x1b3f79=_0x5b4083>=_0x3b2617&&_0x5b4083<=_0x2e3848;}else{_0x3b2617=Math[_0xb88e('0x1e')](_0x6f7f45,_0x4357cb);_0x2e3848=Math[_0xb88e('0x1d')](0x1,_0x1d0ca3);_0x1b3f79=_0x5b4083>=_0x3b2617||_0x5b4083<=_0x2e3848;}return _0x1b3f79;}}module[_0xb88e('0xa')][_0xb88e('0x1f')]=domCompare;function monthCompare(_0xfb2b77,_0x294f12,_0x57ba5d){var _0x373216=_0xfb2b77[_0xb88e('0x5')]('en')[_0xb88e('0x17')](_0xb88e('0x20'))['toLowerCase']();return circularMonthInterval(_0x294f12,_0x57ba5d)[_0xb88e('0x19')](_0x373216);}module[_0xb88e('0xa')][_0xb88e('0x21')]=monthCompare;function iftime(_0xd74be2,_0x17b202=moment['tz']['guess'](),_0x5daa92=moment()){if(!validateRx[_0xb88e('0x22')](_0xd74be2)){throw new Error(EINVALID_STRING);}else{var _0x4ce94e=(moment['isMoment'](_0x5daa92)?_0x5daa92['clone']():moment(_0x5daa92))['tz'](_0x17b202)[_0xb88e('0x5')]('en');throwIfDateNotValid(_0x4ce94e);var _0x4bedd1=_0xd74be2[_0xb88e('0x23')](',');var _0x5ddc45=_0x4bedd1[0x0];var _0x470248=_0x4bedd1[0x1];var _0x72ecc4=_0x4bedd1[0x2];var _0x4b37a8=_0x4bedd1[0x3];let _0x1ec83b=!![];if(_0x5ddc45!=='*'){var _0x264fec=_0x5ddc45[_0xb88e('0x23')]('-');var _0x5934c1=_[_0xb88e('0x24')](_0x264fec[0x0],0x5,'0');var _0x51edd5=_0x264fec[_0xb88e('0x25')]===0x2?_['padStart'](_0x264fec[0x1],0x5,'0'):_0x5934c1;_0x1ec83b=timeCompare(_0x4ce94e,_0x5934c1,_0x51edd5);}let _0x1b9f55=!![];if(_0x470248!=='*'){var _0x27d20c=_0x470248['split']('-');var _0x4c30b1=_0x27d20c[0x0];var _0x160448=_0x27d20c[_0xb88e('0x25')]===0x2?_0x27d20c[0x1]:_0x4c30b1;_0x1b9f55=dowCompare(_0x4ce94e,_0x4c30b1,_0x160448);}let _0x12772c=!![];if(_0x72ecc4!=='*'){var _0x2dfb17=_0x72ecc4[_0xb88e('0x23')]('-');var _0x3dd31c=parseDom(_0x2dfb17[0x0]);var _0x5919a5=_0x2dfb17[_0xb88e('0x25')]===0x2?parseDom(_0x2dfb17[0x1]):_0x3dd31c;_0x12772c=domCompare(_0x4ce94e,_0x3dd31c,_0x5919a5);}let _0x3bca49=!![];if(_0x4b37a8!=='*'){var _0x10192c=_0x4b37a8['split']('-');var _0x25a2bc=_0x10192c[0x0];var _0x359c7d=_0x10192c['length']===0x2?_0x10192c[0x1]:_0x10192c[0x0];_0x3bca49=monthCompare(_0x4ce94e,_0x25a2bc,_0x359c7d);}return _0x1ec83b&&_0x1b9f55&&_0x12772c&&_0x3bca49;}}module[_0xb88e('0xa')][_0xb88e('0x26')]=iftime; \ No newline at end of file +var _0xb1ed=['lodash','map','source','Interval\x20string\x20not\x20valid','isValid','split','locale','weekdaysShort','indexOf','slice','concat','circularDoWInterval','monthsShort','toLowerCase','circularMonthInterval','clone','hours','minutes','startOf','day','endOf','isBetween','exports','timeCompare','format','includes','dowCompare','date','daysInMonth','max','min','guess','test','isMoment','padStart','length','iftime'];(function(_0x53c7c2,_0x301e27){var _0x77532=function(_0x1db1d1){while(--_0x1db1d1){_0x53c7c2['push'](_0x53c7c2['shift']());}};_0x77532(++_0x301e27);}(_0xb1ed,0x197));var _0xdb1e=function(_0x598fa0,_0x183280){_0x598fa0=_0x598fa0-0x0;var _0x29a6ab=_0xb1ed[_0x598fa0];return _0x29a6ab;};var _=require(_0xdb1e('0x0'));var moment=require('moment-timezone');var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0xdb1e('0x1')](function(_0x4c2b83){return _0x4c2b83[_0xdb1e('0x2')];})['join'](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0xdb1e('0x3');var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0x7233f4){if(!_0x7233f4[_0xdb1e('0x4')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x4cd601){var _0x424582=_0x4cd601[_0xdb1e('0x5')](':')['map'](function(_0x1b95a1){return parseInt(_0x1b95a1,0xa);});var _0x404c95=_0x424582[0x0];var _0x41317d=_0x424582[0x1];if(_0x404c95<0x0||_0x404c95>0x17||_0x41317d<0x0||_0x41317d>0x3b){throw new Error(EINVALID_DATE);}return[_0x404c95,_0x41317d];}function circularDoWInterval(_0x3225cf,_0x1f3bad){if(_0x3225cf===_0x1f3bad){return[_0x3225cf];}else{var _0x44fd25=moment[_0xdb1e('0x6')]();moment['locale']('en');var _0x23390a=moment[_0xdb1e('0x7')]()[_0xdb1e('0x1')](function(_0x5e8bcb){return _0x5e8bcb['toLowerCase']();});moment[_0xdb1e('0x6')](_0x44fd25);var _0x1fdfb2=_0x23390a[_0xdb1e('0x8')](_0x3225cf);var _0x80d97c=_0x23390a[_0xdb1e('0x8')](_0x1f3bad);if(_0x80d97c>_0x1fdfb2){return _0x23390a[_0xdb1e('0x9')](_0x1fdfb2,_0x80d97c+0x1);}else{var _0x515d7a=_0x23390a[_0xdb1e('0x9')](0x0,_0x80d97c+0x1);var _0x5eaf59=_0x23390a['slice'](_0x1fdfb2);return _0x5eaf59[_0xdb1e('0xa')](_0x515d7a);}}}module['exports'][_0xdb1e('0xb')]=circularDoWInterval;function circularMonthInterval(_0x538068,_0x450780){if(_0x538068===_0x450780){return[_0x538068];}else{var _0x5264b3=moment['locale']();moment[_0xdb1e('0x6')]('en');var _0x10cff6=moment[_0xdb1e('0xc')]()[_0xdb1e('0x1')](function(_0x357ec3){return _0x357ec3[_0xdb1e('0xd')]();});moment[_0xdb1e('0x6')](_0x5264b3);var _0x70f165=_0x10cff6[_0xdb1e('0x8')](_0x538068);var _0x40a0a7=_0x10cff6[_0xdb1e('0x8')](_0x450780);if(_0x40a0a7>_0x70f165){return _0x10cff6['slice'](_0x70f165,_0x40a0a7+0x1);}else{var _0x236d23=_0x10cff6[_0xdb1e('0x9')](0x0,_0x40a0a7+0x1);var _0x4e561b=_0x10cff6[_0xdb1e('0x9')](_0x70f165);return _0x4e561b[_0xdb1e('0xa')](_0x236d23);}}}module['exports'][_0xdb1e('0xe')]=circularMonthInterval;function parseDom(_0x2071fc){var _0xb40943=parseInt(_0x2071fc,0xa);if(_0xb40943<0x1||_0xb40943>0x1f){throw new Error(EINVALID_DATE);}return _0xb40943;}function timeCompare(_0x42a15f,_0x38e33d,_0x1ad376){var _0x38455f=_0x42a15f[_0xdb1e('0xf')]();var _0x3eebf1=extractTime(_0x38e33d);var _0x3493a9=_0x3eebf1[0x0];var _0x457068=_0x3eebf1[0x1];var _0x360df5=_0x42a15f[_0xdb1e('0xf')]()[_0xdb1e('0x10')](_0x3493a9)['minutes'](_0x457068);throwIfDateNotValid(_0x360df5);var _0x239d79=extractTime(_0x1ad376);var _0x136d7e=_0x239d79[0x0];var _0x173041=_0x239d79[0x1];var _0x2d3beb=_0x42a15f[_0xdb1e('0xf')]()[_0xdb1e('0x10')](_0x136d7e)[_0xdb1e('0x11')](_0x173041);throwIfDateNotValid(_0x2d3beb);if(_0x2d3beb['isBefore'](_0x360df5)){var _0x21f661=_0x38455f[_0xdb1e('0xf')]()[_0xdb1e('0x12')](_0xdb1e('0x13'));var _0xc2476=_0x38455f[_0xdb1e('0xf')]()[_0xdb1e('0x14')](_0xdb1e('0x13'));return _0x38455f[_0xdb1e('0x15')](_0x360df5,_0xc2476,undefined,'[]')||_0x38455f[_0xdb1e('0x15')](_0x21f661,_0x2d3beb,undefined,'[]');}else{return _0x38455f[_0xdb1e('0x15')](_0x360df5,_0x2d3beb,undefined,'[]');}}module[_0xdb1e('0x16')][_0xdb1e('0x17')]=timeCompare;function dowCompare(_0x38d979,_0xfd346,_0x1b3b9e){var _0xa6529b=_0x38d979[_0xdb1e('0x6')]('en')[_0xdb1e('0x18')]('ddd')[_0xdb1e('0xd')]();return circularDoWInterval(_0xfd346,_0x1b3b9e)[_0xdb1e('0x19')](_0xa6529b);}module[_0xdb1e('0x16')][_0xdb1e('0x1a')]=dowCompare;function domCompare(_0x6da0d9,_0x39cce0,_0x490af2){var _0x9a7c3f=_0x6da0d9[_0xdb1e('0x1b')]();if(_0x39cce0===_0x490af2){return _0x9a7c3f===_0x39cce0;}else{var _0x14162b=_0x6da0d9[_0xdb1e('0x1c')]();var _0x54d0ef=_0x39cce0<_0x490af2;let _0x7ed37c=![];var _0x102aa5=0x0;var _0x8d433d=0x0;if(_0x54d0ef){_0x102aa5=Math[_0xdb1e('0x1d')](0x1,_0x39cce0);_0x8d433d=Math[_0xdb1e('0x1e')](_0x490af2,_0x14162b);_0x7ed37c=_0x9a7c3f>=_0x102aa5&&_0x9a7c3f<=_0x8d433d;}else{_0x102aa5=Math[_0xdb1e('0x1e')](_0x39cce0,_0x14162b);_0x8d433d=Math['max'](0x1,_0x490af2);_0x7ed37c=_0x9a7c3f>=_0x102aa5||_0x9a7c3f<=_0x8d433d;}return _0x7ed37c;}}module[_0xdb1e('0x16')]['domCompare']=domCompare;function monthCompare(_0x206f87,_0x54c197,_0x26014c){var _0x2e8684=_0x206f87['locale']('en')[_0xdb1e('0x18')]('MMM')[_0xdb1e('0xd')]();return circularMonthInterval(_0x54c197,_0x26014c)[_0xdb1e('0x19')](_0x2e8684);}module[_0xdb1e('0x16')]['monthCompare']=monthCompare;function iftime(_0x38dba0,_0x1a4784=moment['tz'][_0xdb1e('0x1f')](),_0x2cb8e1=moment()){if(!validateRx[_0xdb1e('0x20')](_0x38dba0)){throw new Error(EINVALID_STRING);}else{var _0x5d9e39=(moment[_0xdb1e('0x21')](_0x2cb8e1)?_0x2cb8e1[_0xdb1e('0xf')]():moment(_0x2cb8e1))['tz'](_0x1a4784)[_0xdb1e('0x6')]('en');throwIfDateNotValid(_0x5d9e39);var _0x32e605=_0x38dba0[_0xdb1e('0x5')](',');var _0x3fc802=_0x32e605[0x0];var _0x31891c=_0x32e605[0x1];var _0x544ae0=_0x32e605[0x2];var _0x43fe9c=_0x32e605[0x3];let _0x133133=!![];if(_0x3fc802!=='*'){var _0x4c5578=_0x3fc802[_0xdb1e('0x5')]('-');var _0x3fffa7=_[_0xdb1e('0x22')](_0x4c5578[0x0],0x5,'0');var _0x368c1b=_0x4c5578['length']===0x2?_[_0xdb1e('0x22')](_0x4c5578[0x1],0x5,'0'):_0x3fffa7;_0x133133=timeCompare(_0x5d9e39,_0x3fffa7,_0x368c1b);}let _0x30a343=!![];if(_0x31891c!=='*'){var _0x23ded7=_0x31891c[_0xdb1e('0x5')]('-');var _0x2d1a94=_0x23ded7[0x0];var _0x18ed48=_0x23ded7['length']===0x2?_0x23ded7[0x1]:_0x2d1a94;_0x30a343=dowCompare(_0x5d9e39,_0x2d1a94,_0x18ed48);}let _0x57af56=!![];if(_0x544ae0!=='*'){var _0x1359ff=_0x544ae0[_0xdb1e('0x5')]('-');var _0x4a1ec5=parseDom(_0x1359ff[0x0]);var _0x52c63b=_0x1359ff[_0xdb1e('0x23')]===0x2?parseDom(_0x1359ff[0x1]):_0x4a1ec5;_0x57af56=domCompare(_0x5d9e39,_0x4a1ec5,_0x52c63b);}let _0xcb623d=!![];if(_0x43fe9c!=='*'){var _0x24d61f=_0x43fe9c['split']('-');var _0x58ae5e=_0x24d61f[0x0];var _0x4f74f9=_0x24d61f[_0xdb1e('0x23')]===0x2?_0x24d61f[0x1]:_0x24d61f[0x0];_0xcb623d=monthCompare(_0x5d9e39,_0x58ae5e,_0x4f74f9);}return _0x133133&&_0x30a343&&_0x57af56&&_0xcb623d;}}module[_0xdb1e('0x16')][_0xdb1e('0x24')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 52cf25e..8a1a49d 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9776=['bold\x20white','gray','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','%s-%s.log','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','length','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','transports','Console','warn','Logger','%s-%s','error','File','fileLogger','path','util','moment','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','white'];(function(_0x4124b0,_0xf6f74c){var _0x1221e0=function(_0x5bd4e){while(--_0x5bd4e){_0x4124b0['push'](_0x4124b0['shift']());}};_0x1221e0(++_0xf6f74c);}(_0x9776,0xe5));var _0x6977=function(_0x3cf7cb,_0x5e79fb){_0x3cf7cb=_0x3cf7cb-0x0;var _0x361dfb=_0x9776[_0x3cf7cb];return _0x361dfb;};'use strict';var path=require(_0x6977('0x0'));var util=require(_0x6977('0x1'));var moment=require(_0x6977('0x2'));var winston=require('winston');var config=require(_0x6977('0x3'));var debugLevel=config[_0x6977('0x4')]?config['debugLevel'][_0x6977('0x5')]():_0x6977('0x6');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x6977('0x7'),'error':_0x6977('0x8'),'warn':_0x6977('0x9'),'info':_0x6977('0xa'),'print':_0x6977('0xb'),'success':'bold\x20green','http':_0x6977('0xc'),'verbose':'bold\x20magenta','debug':_0x6977('0xd'),'silly':_0x6977('0xe')};winston[_0x6977('0xf')](XC_LOG_COLORS);function getLogFileName(_0x2f1efb,_0x60387c,_0x2cf80e){var _0x5e27ae=_0x2f1efb||_0x6977('0x10');return path[_0x6977('0x11')](_0x5e27ae,util[_0x6977('0x12')](_0x6977('0x13'),_0x60387c,_0x2cf80e));}function formatter(_0x3c9eee,_0x5cd529){_0x5cd529[_0x6977('0x14')]=_0x5cd529['message'][_0x6977('0x15')](/@@{/g,'{{{')['replace'](/}@@/g,_0x6977('0x16'))[_0x6977('0x15')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x6977('0x12')](_0x6977('0x17'),moment()['format'](_0x6977('0x18')),_0x5cd529[_0x6977('0x19')][_0x6977('0x1a')](),_0x3c9eee,_0x5cd529[_0x6977('0x14')]);}function fileFormat(_0x11ac59,_0x33672a){_0x33672a[_0x6977('0x14')]=_0x33672a[_0x6977('0x14')][_0x6977('0x15')](/@@{/g,'{{{')[_0x6977('0x15')](/}@@/g,_0x6977('0x16'))[_0x6977('0x15')](/@{/g,'{{')[_0x6977('0x15')](/}@/g,'}}');var _0x5d1324=_0x33672a[_0x6977('0x1b')]&&Object[_0x6977('0x1c')](_0x33672a['meta'])[_0x6977('0x1d')]?'\x0a\x09'+JSON[_0x6977('0x1e')](_0x33672a['meta']):'';return util[_0x6977('0x12')](_0x6977('0x1f'),moment()['format'](_0x6977('0x18')),_0x33672a['level']['toUpperCase'](),_0x11ac59,_0x33672a[_0x6977('0x14')],_0x5d1324);}function consoleLogger(){var _0x266c28=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x6977('0x20'))][(_0x6977('0x21'))]({'level':_0x6977('0x22'),'json':![],'formatter':function(_0x599165){return formatter('',_0x599165);}})]});return _0x266c28;}function fileLogger(_0x272e3f,_0x32d195){var _0xa861bc=new winston[(_0x6977('0x23'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x6977('0x20'))]['File']({'name':util[_0x6977('0x12')](_0x6977('0x24'),_0x272e3f,_0x6977('0x25')),'filename':getLogFileName(_0x32d195,_0x272e3f,_0x6977('0x25')),'level':_0x6977('0x25'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5006b1){return fileFormat(_0x272e3f,_0x5006b1);}}),new winston['transports'][(_0x6977('0x26'))]({'name':util[_0x6977('0x12')]('%s-%s',_0x272e3f,debugLevel),'filename':getLogFileName(_0x32d195,_0x272e3f,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x224bc3){return fileFormat(_0x272e3f,_0x224bc3);}}),new winston[(_0x6977('0x20'))][(_0x6977('0x21'))]({'level':'warn','json':![],'formatter':function(_0x2d70ac){return fileFormat(_0x272e3f,_0x2d70ac);}})]});return _0xa861bc;}exports['consoleLogger']=consoleLogger;exports[_0x6977('0x27')]=fileLogger; \ No newline at end of file +var _0x0ca2=['%s-%s','error','consoleLogger','path','util','winston','../config/environment','toLowerCase','info','redBG\x20white','red','bold\x20yellow','bold\x20green','bold\x20magenta','/var/log/xcally','join','format','%s-%s.log','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','{{{','meta','keys','Logger','transports','Console','warn','File'];(function(_0x1527a9,_0x55feeb){var _0x15b5be=function(_0x1571d8){while(--_0x1571d8){_0x1527a9['push'](_0x1527a9['shift']());}};_0x15b5be(++_0x55feeb);}(_0x0ca2,0x183));var _0x20ca=function(_0x1764fd,_0x256895){_0x1764fd=_0x1764fd-0x0;var _0x13189e=_0x0ca2[_0x1764fd];return _0x13189e;};'use strict';var path=require(_0x20ca('0x0'));var util=require(_0x20ca('0x1'));var moment=require('moment');var winston=require(_0x20ca('0x2'));var config=require(_0x20ca('0x3'));var debugLevel=config['debugLevel']?config['debugLevel'][_0x20ca('0x4')]():_0x20ca('0x5');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x20ca('0x6'),'error':_0x20ca('0x7'),'warn':_0x20ca('0x8'),'info':'white','print':'bold\x20white','success':_0x20ca('0x9'),'http':'gray','verbose':_0x20ca('0xa'),'debug':'bold\x20blue','silly':'bold\x20cyan'};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0xf272e8,_0x26cff9,_0x2d79c2){var _0x32b0ce=_0xf272e8||_0x20ca('0xb');return path[_0x20ca('0xc')](_0x32b0ce,util[_0x20ca('0xd')](_0x20ca('0xe'),_0x26cff9,_0x2d79c2));}function formatter(_0x56589e,_0x384af0){_0x384af0[_0x20ca('0xf')]=_0x384af0['message'][_0x20ca('0x10')](/@@{/g,'{{{')[_0x20ca('0x10')](/}@@/g,_0x20ca('0x11'))[_0x20ca('0x10')](/@{/g,'{{')[_0x20ca('0x10')](/}@/g,'}}');return util[_0x20ca('0xd')](_0x20ca('0x12'),moment()[_0x20ca('0xd')](_0x20ca('0x13')),_0x384af0[_0x20ca('0x14')]['toUpperCase'](),_0x56589e,_0x384af0[_0x20ca('0xf')]);}function fileFormat(_0x333463,_0x541ccb){_0x541ccb[_0x20ca('0xf')]=_0x541ccb['message'][_0x20ca('0x10')](/@@{/g,_0x20ca('0x15'))[_0x20ca('0x10')](/}@@/g,'}}}')[_0x20ca('0x10')](/@{/g,'{{')[_0x20ca('0x10')](/}@/g,'}}');var _0x3dc9f3=_0x541ccb[_0x20ca('0x16')]&&Object[_0x20ca('0x17')](_0x541ccb['meta'])['length']?'\x0a\x09'+JSON['stringify'](_0x541ccb[_0x20ca('0x16')]):'';return util[_0x20ca('0xd')]('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0x20ca('0xd')](_0x20ca('0x13')),_0x541ccb['level']['toUpperCase'](),_0x333463,_0x541ccb[_0x20ca('0xf')],_0x3dc9f3);}function consoleLogger(){var _0x2f65fc=new winston[(_0x20ca('0x18'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x20ca('0x19'))][(_0x20ca('0x1a'))]({'level':_0x20ca('0x1b'),'json':![],'formatter':function(_0x4de3e0){return formatter('',_0x4de3e0);}})]});return _0x2f65fc;}function fileLogger(_0xfd0490,_0x57d1e9){var _0x3a4a3e=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x20ca('0x1c'))]({'name':util[_0x20ca('0xd')](_0x20ca('0x1d'),_0xfd0490,'error'),'filename':getLogFileName(_0x57d1e9,_0xfd0490,_0x20ca('0x1e')),'level':_0x20ca('0x1e'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3fd240){return fileFormat(_0xfd0490,_0x3fd240);}}),new winston['transports'][(_0x20ca('0x1c'))]({'name':util['format'](_0x20ca('0x1d'),_0xfd0490,debugLevel),'filename':getLogFileName(_0x57d1e9,_0xfd0490,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x32ed14){return fileFormat(_0xfd0490,_0x32ed14);}}),new winston[(_0x20ca('0x19'))][(_0x20ca('0x1a'))]({'level':'warn','json':![],'formatter':function(_0x5217a7){return fileFormat(_0xfd0490,_0x5217a7);}})]});return _0x3a4a3e;}exports[_0x20ca('0x1f')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index c427758..bcfeb86 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x57ca=['accesskeyid','secretaccesskey','key','user','accountSid','dsn','secret','registry','oldPassword','isPlainObject','isArray','length','isString','@@{','replace','}@@','includes','exports','username','password','apiKey','firstName','lastName','street','phone','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessTokenSecret','authToken','consumerSecret','calleridname','calleridnum','vidaooApiKey','privateKey'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x57ca,0x108));var _0xa57c=function(_0x476b5f,_0x1f9952){_0x476b5f=_0x476b5f-0x0;var _0x5a23d8=_0x57ca[_0x476b5f];return _0x5a23d8;};var _=require('lodash');var sensitiveFields=[_0xa57c('0x0'),_0xa57c('0x1'),'newPassword',_0xa57c('0x2'),_0xa57c('0x3'),_0xa57c('0x4'),_0xa57c('0x5'),_0xa57c('0x6'),'mobile',_0xa57c('0x7'),_0xa57c('0x8'),_0xa57c('0x9'),_0xa57c('0xa'),_0xa57c('0xb'),_0xa57c('0xc'),_0xa57c('0xd'),_0xa57c('0xe'),'token',_0xa57c('0xf'),'accessToken',_0xa57c('0x10'),_0xa57c('0x11'),'consumerKey',_0xa57c('0x12'),'membername',_0xa57c('0x13'),_0xa57c('0x14'),'exten',_0xa57c('0x15'),'clientEmail',_0xa57c('0x16'),_0xa57c('0x17'),_0xa57c('0x18'),_0xa57c('0x19'),_0xa57c('0x1a'),'pass',_0xa57c('0x1b'),'localstationid',_0xa57c('0x1c'),_0xa57c('0x1d'),_0xa57c('0x1e'),_0xa57c('0x1f')];function maskSensitiveData(_0x3238ff){const _0x37a323=/(?!^)[\s\S](?!$)/g;if(_[_0xa57c('0x20')](_0x3238ff)){for(const _0x4b4bdb in _0x3238ff){if(_[_0xa57c('0x21')](_0x3238ff[_0x4b4bdb])){for(let _0xdf7ff6=0x0;_0xdf7ff6<_0x3238ff[_0x4b4bdb][_0xa57c('0x22')];_0xdf7ff6++){maskSensitiveData(_0x3238ff[_0x4b4bdb][_0xdf7ff6]);}}else if(_['isPlainObject'](_0x3238ff[_0x4b4bdb])){maskSensitiveData(_0x3238ff[_0x4b4bdb]);}else if(_[_0xa57c('0x23')](_0x3238ff[_0x4b4bdb])){_0x3238ff[_0x4b4bdb]=_0x3238ff[_0x4b4bdb]['replace'](/{{{/g,_0xa57c('0x24'))[_0xa57c('0x25')](/}}}/g,_0xa57c('0x26'))[_0xa57c('0x25')](/{{/g,'@{')[_0xa57c('0x25')](/}}/g,'}@');if(_[_0xa57c('0x27')](sensitiveFields,_0x4b4bdb)){_0x3238ff[_0x4b4bdb]=_0x3238ff[_0x4b4bdb][_0xa57c('0x25')](_0x37a323,'*');}}}}}module[_0xa57c('0x28')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0x1261=['fax','clientSecret','securityToken','accessKey','tenantId','token','channelSecret','accessToken','authToken','consumerKey','consumerSecret','calleridname','vidaooApiKey','privateKey','accesskeyid','secretaccesskey','key','user','pass','accountSid','localstationid','dsn','oldPassword','length','isPlainObject','replace','@@{','exports','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile'];(function(_0x230930,_0x5ab351){var _0x2a0ea0=function(_0x243853){while(--_0x243853){_0x230930['push'](_0x230930['shift']());}};_0x2a0ea0(++_0x5ab351);}(_0x1261,0x144));var _0x1126=function(_0x871ef5,_0x58880b){_0x871ef5=_0x871ef5-0x0;var _0x1f62ea=_0x1261[_0x871ef5];return _0x1f62ea;};var _=require('lodash');var sensitiveFields=[_0x1126('0x0'),_0x1126('0x1'),_0x1126('0x2'),_0x1126('0x3'),_0x1126('0x4'),_0x1126('0x5'),_0x1126('0x6'),_0x1126('0x7'),_0x1126('0x8'),_0x1126('0x9'),'email','clientId',_0x1126('0xa'),_0x1126('0xb'),'code',_0x1126('0xc'),_0x1126('0xd'),_0x1126('0xe'),_0x1126('0xf'),_0x1126('0x10'),'accessTokenSecret',_0x1126('0x11'),_0x1126('0x12'),_0x1126('0x13'),'membername',_0x1126('0x14'),'calleridnum','exten',_0x1126('0x15'),'clientEmail',_0x1126('0x16'),_0x1126('0x17'),_0x1126('0x18'),_0x1126('0x19'),_0x1126('0x1a'),_0x1126('0x1b'),_0x1126('0x1c'),_0x1126('0x1d'),_0x1126('0x1e'),'secret','registry',_0x1126('0x1f')];function maskSensitiveData(_0x154e20){const _0x279455=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x154e20)){for(const _0x45149c in _0x154e20){if(_['isArray'](_0x154e20[_0x45149c])){for(let _0x35fe9f=0x0;_0x35fe9f<_0x154e20[_0x45149c][_0x1126('0x20')];_0x35fe9f++){maskSensitiveData(_0x154e20[_0x45149c][_0x35fe9f]);}}else if(_[_0x1126('0x21')](_0x154e20[_0x45149c])){maskSensitiveData(_0x154e20[_0x45149c]);}else if(_['isString'](_0x154e20[_0x45149c])){_0x154e20[_0x45149c]=_0x154e20[_0x45149c][_0x1126('0x22')](/{{{/g,_0x1126('0x23'))['replace'](/}}}/g,'}@@')[_0x1126('0x22')](/{{/g,'@{')[_0x1126('0x22')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x45149c)){_0x154e20[_0x45149c]=_0x154e20[_0x45149c]['replace'](_0x279455,'*');}}}}}module[_0x1126('0x24')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/misc.js b/server/utils/misc.js index 94db1e0..f80b710 100644 --- a/server/utils/misc.js +++ b/server/utils/misc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fab=['exports','replace','\x5c$&'];(function(_0x5257bf,_0xf39844){var _0x30f32b=function(_0x252bff){while(--_0x252bff){_0x5257bf['push'](_0x5257bf['shift']());}};_0x30f32b(++_0xf39844);}(_0x5fab,0x177));var _0xb5fa=function(_0x4371a8,_0x3ac39){_0x4371a8=_0x4371a8-0x0;var _0x110901=_0x5fab[_0x4371a8];return _0x110901;};module[_0xb5fa('0x0')]={'escapeRegExp'(_0x1c67fb,_0x4c67f9=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x1c67fb[_0xb5fa('0x1')](_0x4c67f9,_0xb5fa('0x2'));}}; \ No newline at end of file +var _0x4975=['replace','\x5c$&','exports'];(function(_0x497f18,_0x3f8ecd){var _0x4c97=function(_0x4ca369){while(--_0x4ca369){_0x497f18['push'](_0x497f18['shift']());}};_0x4c97(++_0x3f8ecd);}(_0x4975,0x86));var _0x5497=function(_0x16484f,_0x25e411){_0x16484f=_0x16484f-0x0;var _0x2f6bd9=_0x4975[_0x16484f];return _0x2f6bd9;};module[_0x5497('0x0')]={'escapeRegExp'(_0x4db539,_0x474989=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x4db539[_0x5497('0x1')](_0x474989,_0x5497('0x2'));}}; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 65e348f..ed98ca2 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7916=['{\x20{\x20','\x20}\x20}','string','replace','isArray','keys','reduce','safeTemplate','lodash'];(function(_0x5a78a8,_0x1efecd){var _0x4a03ec=function(_0x3ff231){while(--_0x3ff231){_0x5a78a8['push'](_0x5a78a8['shift']());}};_0x4a03ec(++_0x1efecd);}(_0x7916,0x128));var _0x6791=function(_0xf6268a,_0x4d2a75){_0xf6268a=_0xf6268a-0x0;var _0x479dbd=_0x7916[_0xf6268a];return _0x479dbd;};var _=require(_0x6791('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x5eaf3a){return _0x5eaf3a==='{{'?_0x6791('0x1'):_0x6791('0x2');}function safeTemplate(_0x4ca50a){var _0x325c54=_0x4ca50a;if(typeof _0x4ca50a===_0x6791('0x3')){_0x325c54=_0x4ca50a[_0x6791('0x4')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x6791('0x5')](_0x4ca50a)){_0x325c54=_0x4ca50a['map'](function(_0xe98396){return safeTemplate(_0xe98396);});}else if(_['isPlainObject'](_0x4ca50a)){_0x325c54=Object[_0x6791('0x6')](_0x4ca50a)[_0x6791('0x7')](function(_0x5ad8c0,_0x8b85ff){_0x5ad8c0[_0x8b85ff]=safeTemplate(_0x4ca50a[_0x8b85ff]);return _0x5ad8c0;},{});}return _0x325c54;}module['exports'][_0x6791('0x8')]=safeTemplate; \ No newline at end of file +var _0xb03e=['safeTemplate','{\x20{\x20','\x20}\x20}','string','replace','isArray','map','isPlainObject','keys','exports'];(function(_0x594015,_0x20df65){var _0x191df2=function(_0x1e8251){while(--_0x1e8251){_0x594015['push'](_0x594015['shift']());}};_0x191df2(++_0x20df65);}(_0xb03e,0x1eb));var _0xeb03=function(_0x2cb576,_0x1aa800){_0x2cb576=_0x2cb576-0x0;var _0x55e4d9=_0xb03e[_0x2cb576];return _0x55e4d9;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x36351b){return _0x36351b==='{{'?_0xeb03('0x0'):_0xeb03('0x1');}function safeTemplate(_0x3c5e68){var _0x1c58b5=_0x3c5e68;if(typeof _0x3c5e68===_0xeb03('0x2')){_0x1c58b5=_0x3c5e68[_0xeb03('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xeb03('0x4')](_0x3c5e68)){_0x1c58b5=_0x3c5e68[_0xeb03('0x5')](function(_0x3ba4b0){return safeTemplate(_0x3ba4b0);});}else if(_[_0xeb03('0x6')](_0x3c5e68)){_0x1c58b5=Object[_0xeb03('0x7')](_0x3c5e68)['reduce'](function(_0x3b58a2,_0x3d3322){_0x3b58a2[_0x3d3322]=safeTemplate(_0x3c5e68[_0x3d3322]);return _0x3b58a2;},{});}return _0x1c58b5;}module[_0xeb03('0x8')][_0xeb03('0x9')]=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index f90bbe6..29ac69e 100644 --- a/server/utils/update-app-config.js +++ b/server/utils/update-app-config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x948a=['pathExists','then','updated','info','Updating\x20app.json','exports','fs-extra','path','../config/environment','root','resolve','server/app.json','legacy-libs','isArray','name','apps','NODE_PATH','string'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x948a,0x84));var _0xa948=function(_0x3e06b8,_0x37c702){_0x3e06b8=_0x3e06b8-0x0;var _0x25d6ce=_0x948a[_0x3e06b8];return _0x25d6ce;};var fs=require(_0xa948('0x0'));var path=require(_0xa948('0x1'));var config=require(_0xa948('0x2'));var root=config[_0xa948('0x3')];var APP_JSON_PATH=path[_0xa948('0x4')](root,_0xa948('0x5'));var NODEPATH=path['resolve'](root,_0xa948('0x6'));function setLegacyLibsNodeEnvPath(_0x4e5582){let _0x535b49=![];if(Array[_0xa948('0x7')](_0x4e5582['apps'])){var _0x361474=_0x4e5582['apps']['findIndex'](function(_0x46c3bf){return _0x46c3bf[_0xa948('0x8')]==='motion2';});if(_0x361474>-0x1){var _0x45786d=_0x4e5582[_0xa948('0x9')][_0x361474];if(typeof _0x45786d['env'][_0xa948('0xa')]!==_0xa948('0xb')){_0x45786d['env'][_0xa948('0xa')]=NODEPATH;_0x535b49=!![];}}return{'appConfig':_0x4e5582,'updated':_0x535b49};}}function updateAppConfig(_0x30f742){return fs[_0xa948('0xc')](APP_JSON_PATH)[_0xa948('0xd')](function(_0x4d1016){if(_0x4d1016){return fs['readJSON'](APP_JSON_PATH)['then'](function(_0xe41f9d){var _0x4abb06=setLegacyLibsNodeEnvPath(_0xe41f9d);if(_0x4abb06[_0xa948('0xe')]){_0x30f742[_0xa948('0xf')](_0xa948('0x10'));return fs['writeJSON'](APP_JSON_PATH,_0xe41f9d,{'spaces':0x2});}else{return Promise[_0xa948('0x4')]();}});}else{return Promise[_0xa948('0x4')]();}});}module[_0xa948('0x11')]=updateAppConfig; \ No newline at end of file +var _0xfdc8=['fs-extra','path','../config/environment','root','resolve','server/app.json','apps','findIndex','name','motion2','string','env','pathExists','readJSON','then','info','writeJSON','exports'];(function(_0x195b7b,_0x457329){var _0x33ee64=function(_0x5309b8){while(--_0x5309b8){_0x195b7b['push'](_0x195b7b['shift']());}};_0x33ee64(++_0x457329);}(_0xfdc8,0x6c));var _0x8fdc=function(_0x151721,_0x20d5bc){_0x151721=_0x151721-0x0;var _0x2deaa7=_0xfdc8[_0x151721];return _0x2deaa7;};var fs=require(_0x8fdc('0x0'));var path=require(_0x8fdc('0x1'));var config=require(_0x8fdc('0x2'));var root=config[_0x8fdc('0x3')];var APP_JSON_PATH=path[_0x8fdc('0x4')](root,_0x8fdc('0x5'));var NODEPATH=path['resolve'](root,'legacy-libs');function setLegacyLibsNodeEnvPath(_0x1198f9){let _0x3a7828=![];if(Array['isArray'](_0x1198f9[_0x8fdc('0x6')])){var _0x4145d9=_0x1198f9[_0x8fdc('0x6')][_0x8fdc('0x7')](function(_0x335db3){return _0x335db3[_0x8fdc('0x8')]===_0x8fdc('0x9');});if(_0x4145d9>-0x1){var _0x2b8f4a=_0x1198f9[_0x8fdc('0x6')][_0x4145d9];if(typeof _0x2b8f4a['env']['NODE_PATH']!==_0x8fdc('0xa')){_0x2b8f4a[_0x8fdc('0xb')]['NODE_PATH']=NODEPATH;_0x3a7828=!![];}}return{'appConfig':_0x1198f9,'updated':_0x3a7828};}}function updateAppConfig(_0x29f469){return fs[_0x8fdc('0xc')](APP_JSON_PATH)['then'](function(_0x613e27){if(_0x613e27){return fs[_0x8fdc('0xd')](APP_JSON_PATH)[_0x8fdc('0xe')](function(_0x288e0d){var _0x3a65e5=setLegacyLibsNodeEnvPath(_0x288e0d);if(_0x3a65e5['updated']){_0x29f469[_0x8fdc('0xf')]('Updating\x20app.json');return fs[_0x8fdc('0x10')](APP_JSON_PATH,_0x288e0d,{'spaces':0x2});}else{return Promise[_0x8fdc('0x4')]();}});}else{return Promise[_0x8fdc('0x4')]();}});}module[_0x8fdc('0x11')]=updateAppConfig; \ No newline at end of file